From: Andrea Amorese Date: Thu, 4 Nov 2021 08:25:58 +0000 (+0100) Subject: Built motion from commit a29ce673.|2.5.37 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=b75ddde41ab507e58b8e71ff85ec02f6961ddec1;p=motion2.git Built motion from commit a29ce673.|2.5.37 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b7739b1..b7cf92f 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-03T14:49:06.499Z", + "time": "2021-11-04T08:14:16.968Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index efb1652..f7c1f38 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-11-03T14:49:06.499Z", + "time": "2021-11-04T08:14:16.968Z", "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 0945880..ee79306 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 _0xfdc4=['integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','getDataValue','action','contactManager'];(function(_0x5b8cdc,_0x4aa69b){var _0x30afb0=function(_0x55a73f){while(--_0x55a73f){_0x5b8cdc['push'](_0x5b8cdc['shift']());}};_0x30afb0(++_0x4aa69b);}(_0xfdc4,0x81));var _0x4fdc=function(_0x5f128d,_0x44ec49){_0x5f128d=_0x5f128d-0x0;var _0x160c95=_0xfdc4[_0x5f128d];return _0x160c95;};'use strict';var Sequelize=require(_0x4fdc('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xc18add){return this[_0x4fdc('0x1')](_0x4fdc('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x4fdc('0x3'),_0x4fdc('0x4'),_0x4fdc('0x5'),_0x4fdc('0x6'),_0x4fdc('0x7'),_0x4fdc('0x8'),_0x4fdc('0x9'),_0x4fdc('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4fdc('0xb')},'data1':{'type':Sequelize[_0x4fdc('0xc')](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[_0x4fdc('0xc')](0x1000),'comment':_0x4fdc('0xd')},'data3':{'type':Sequelize[_0x4fdc('0xc')](0x1000),'comment':_0x4fdc('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x4fdc('0xc')](0x1000),'comments':_0x4fdc('0xf')},'data6':{'type':Sequelize[_0x4fdc('0xc')],'comments':_0x4fdc('0x10')},'data7':{'type':Sequelize[_0x4fdc('0x11')],'comments':_0x4fdc('0x12')}}; \ No newline at end of file +var _0xa43f=['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)]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x436849,_0x430b00){var _0x5c5f73=function(_0x5bdf78){while(--_0x5bdf78){_0x436849['push'](_0x436849['shift']());}};_0x5c5f73(++_0x430b00);}(_0xa43f,0xcb));var _0xfa43=function(_0x385010,_0xaed2d6){_0x385010=_0x385010-0x0;var _0x110e1d=_0xa43f[_0x385010];return _0x110e1d;};'use strict';var Sequelize=require(_0xfa43('0x0'));module[_0xfa43('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2a1248){return this[_0xfa43('0x2')](_0xfa43('0x3'));}},'action':{'type':Sequelize[_0xfa43('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xfa43('0x5'),'integration',_0xfa43('0x6'),_0xfa43('0x7'),_0xfa43('0x8'),_0xfa43('0x9'),_0xfa43('0xa'),_0xfa43('0xb')]],'msg':_0xfa43('0xc')}},'comment':_0xfa43('0xc')},'data1':{'type':Sequelize[_0xfa43('0x4')](0x1000),'comment':_0xfa43('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xfa43('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xfa43('0xf')},'data4':{'type':Sequelize[_0xfa43('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xfa43('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xfa43('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xfa43('0x10')],'comments':_0xfa43('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 58e32c7..e3ce769 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 _0x2575=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','end','error','name','send','body','Action','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x2575,0x10d));var _0x5257=function(_0x2f3507,_0xf69714){_0x2f3507=_0x2f3507-0x0;var _0x2afb8e=_0x2575[_0x2f3507];return _0x2afb8e;};'use strict';var emlformat=require(_0x5257('0x0'));var rimraf=require(_0x5257('0x1'));var zipdir=require(_0x5257('0x2'));var jsonpatch=require(_0x5257('0x3'));var rp=require(_0x5257('0x4'));var moment=require(_0x5257('0x5'));var BPromise=require(_0x5257('0x6'));var Mustache=require(_0x5257('0x7'));var util=require(_0x5257('0x8'));var path=require('path');var sox=require(_0x5257('0x9'));var csv=require(_0x5257('0xa'));var ejs=require(_0x5257('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5257('0xc'));var squel=require('squel');var crypto=require(_0x5257('0xd'));var jsforce=require(_0x5257('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5257('0xa'));var querystring=require(_0x5257('0xf'));var Papa=require(_0x5257('0x10'));var Redis=require(_0x5257('0x11'));var authService=require(_0x5257('0x12'));var qs=require(_0x5257('0x13'));var as=require(_0x5257('0x14'));var hardwareService=require(_0x5257('0x15'));var logger=require(_0x5257('0x16'))(_0x5257('0x17'));var utils=require(_0x5257('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5257('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22dabd,_0x4fe9b1){_0x4fe9b1=_0x4fe9b1||0xcc;return function(_0x5087fe){if(_0x5087fe){return _0x22dabd[_0x5257('0x1a')](_0x4fe9b1);}return _0x22dabd[_0x5257('0x1b')](_0x4fe9b1)['end']();};}function respondWithResult(_0x15078c,_0x45d54b){_0x45d54b=_0x45d54b||0xc8;return function(_0x20c137){if(_0x20c137){return _0x15078c[_0x5257('0x1b')](_0x45d54b)[_0x5257('0x1c')](_0x20c137);}};}function respondWithFilteredResult(_0x845242,_0x1e0cdc){return function(_0x2d395e){if(_0x2d395e){var _0xf76e1e=typeof _0x1e0cdc[_0x5257('0x1d')]===_0x5257('0x1e')&&typeof _0x1e0cdc['limit']===_0x5257('0x1e');var _0x4e5b2d=_0x2d395e[_0x5257('0x1f')];var _0x2db31e=_0xf76e1e?0x0:_0x1e0cdc[_0x5257('0x1d')];var _0x1a0138=_0xf76e1e?_0x2d395e['count']:_0x1e0cdc[_0x5257('0x1d')]+_0x1e0cdc[_0x5257('0x20')];var _0x32efae;if(_0x1a0138>=_0x4e5b2d){_0x1a0138=_0x4e5b2d;_0x32efae=0xc8;}else{_0x32efae=0xce;}_0x845242[_0x5257('0x1b')](_0x32efae);return _0x845242['set'](_0x5257('0x21'),_0x2db31e+'-'+_0x1a0138+'/'+_0x4e5b2d)[_0x5257('0x1c')](_0x2d395e);}return null;};}function patchUpdates(_0x1c675b){return function(_0x7344c2){try{jsonpatch[_0x5257('0x22')](_0x7344c2,_0x1c675b,!![]);}catch(_0x116af4){return BPromise['reject'](_0x116af4);}return _0x7344c2[_0x5257('0x23')]();};}function saveUpdates(_0x27d48f,_0x1b3cd6){return function(_0x1b67c0){if(_0x1b67c0){return _0x1b67c0[_0x5257('0x24')](_0x27d48f)['then'](function(_0xa9f187){return _0xa9f187;});}return null;};}function removeEntity(_0x3942aa,_0xc29d3b){return function(_0x564c08){if(_0x564c08){return _0x564c08[_0x5257('0x25')]()[_0x5257('0x26')](function(){_0x3942aa[_0x5257('0x1b')](0xcc)[_0x5257('0x27')]();});}};}function handleEntityNotFound(_0x49a947,_0x2d6314){return function(_0x1d88cd){if(!_0x1d88cd){_0x49a947[_0x5257('0x1a')](0x194);}return _0x1d88cd;};}function handleError(_0xb25332,_0x518f52){_0x518f52=_0x518f52||0x1f4;return function(_0x3e6921){logger[_0x5257('0x28')](_0x3e6921['stack']);if(_0x3e6921[_0x5257('0x29')]){delete _0x3e6921['name'];}_0xb25332[_0x5257('0x1b')](_0x518f52)[_0x5257('0x2a')](_0x3e6921);};}exports[_0x5257('0x24')]=function(_0x53b285,_0x253d55){if(_0x53b285[_0x5257('0x2b')]['id']){delete _0x53b285[_0x5257('0x2b')]['id'];}return db[_0x5257('0x2c')]['find']({'where':{'id':_0x53b285[_0x5257('0x2d')]['id']}})[_0x5257('0x26')](handleEntityNotFound(_0x253d55,null))[_0x5257('0x26')](saveUpdates(_0x53b285[_0x5257('0x2b')],null))[_0x5257('0x26')](respondWithResult(_0x253d55,null))[_0x5257('0x2e')](handleError(_0x253d55,null));};exports[_0x5257('0x25')]=function(_0x37513d,_0x1f72f3){return db[_0x5257('0x2c')]['find']({'where':{'id':_0x37513d[_0x5257('0x2d')]['id']}})[_0x5257('0x26')](handleEntityNotFound(_0x1f72f3,null))['then'](removeEntity(_0x1f72f3,null))[_0x5257('0x2e')](handleError(_0x1f72f3,null));}; \ No newline at end of file +var _0x0437=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','body','params','catch','Action','eml-format','rimraf','moment'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0x0437,0x13f));var _0x7043=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0437[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7043('0x0'));var rimraf=require(_0x7043('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7043('0x2'));var BPromise=require(_0x7043('0x3'));var Mustache=require(_0x7043('0x4'));var util=require('util');var path=require(_0x7043('0x5'));var sox=require(_0x7043('0x6'));var csv=require(_0x7043('0x7'));var ejs=require(_0x7043('0x8'));var fs=require('fs');var fs_extra=require(_0x7043('0x9'));var _=require('lodash');var squel=require(_0x7043('0xa'));var crypto=require(_0x7043('0xb'));var jsforce=require(_0x7043('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7043('0x7'));var querystring=require(_0x7043('0xd'));var Papa=require('papaparse');var Redis=require(_0x7043('0xe'));var authService=require(_0x7043('0xf'));var qs=require(_0x7043('0x10'));var as=require(_0x7043('0x11'));var hardwareService=require(_0x7043('0x12'));var logger=require(_0x7043('0x13'))(_0x7043('0x14'));var utils=require(_0x7043('0x15'));var config=require(_0x7043('0x16'));var licenseUtil=require(_0x7043('0x17'));var db=require(_0x7043('0x18'))['db'];function respondWithStatusCode(_0x488442,_0x3f993f){_0x3f993f=_0x3f993f||0xcc;return function(_0xe909b3){if(_0xe909b3){return _0x488442['sendStatus'](_0x3f993f);}return _0x488442[_0x7043('0x19')](_0x3f993f)[_0x7043('0x1a')]();};}function respondWithResult(_0x23330b,_0x5a4aa4){_0x5a4aa4=_0x5a4aa4||0xc8;return function(_0x5f5f3){if(_0x5f5f3){return _0x23330b[_0x7043('0x19')](_0x5a4aa4)['json'](_0x5f5f3);}};}function respondWithFilteredResult(_0x545893,_0xbfa966){return function(_0x5a9bdc){if(_0x5a9bdc){var _0x452812=typeof _0xbfa966[_0x7043('0x1b')]==='undefined'&&typeof _0xbfa966[_0x7043('0x1c')]===_0x7043('0x1d');var _0x309e66=_0x5a9bdc[_0x7043('0x1e')];var _0x44f5af=_0x452812?0x0:_0xbfa966[_0x7043('0x1b')];var _0x4e3f2b=_0x452812?_0x5a9bdc['count']:_0xbfa966[_0x7043('0x1b')]+_0xbfa966[_0x7043('0x1c')];var _0x4ba786;if(_0x4e3f2b>=_0x309e66){_0x4e3f2b=_0x309e66;_0x4ba786=0xc8;}else{_0x4ba786=0xce;}_0x545893['status'](_0x4ba786);return _0x545893[_0x7043('0x1f')](_0x7043('0x20'),_0x44f5af+'-'+_0x4e3f2b+'/'+_0x309e66)[_0x7043('0x21')](_0x5a9bdc);}return null;};}function patchUpdates(_0x13af42){return function(_0x1a4cec){try{jsonpatch[_0x7043('0x22')](_0x1a4cec,_0x13af42,!![]);}catch(_0x52b454){return BPromise[_0x7043('0x23')](_0x52b454);}return _0x1a4cec['save']();};}function saveUpdates(_0x54c6df,_0x533866){return function(_0x121572){if(_0x121572){return _0x121572[_0x7043('0x24')](_0x54c6df)[_0x7043('0x25')](function(_0x239f2){return _0x239f2;});}return null;};}function removeEntity(_0x1eda20,_0x24eb85){return function(_0x5c4108){if(_0x5c4108){return _0x5c4108[_0x7043('0x26')]()['then'](function(){_0x1eda20['status'](0xcc)[_0x7043('0x1a')]();});}};}function handleEntityNotFound(_0x594703,_0x2a309e){return function(_0x29ca0a){if(!_0x29ca0a){_0x594703['sendStatus'](0x194);}return _0x29ca0a;};}function handleError(_0x16f3a6,_0x392f8d){_0x392f8d=_0x392f8d||0x1f4;return function(_0xf73a0c){logger[_0x7043('0x27')](_0xf73a0c[_0x7043('0x28')]);if(_0xf73a0c[_0x7043('0x29')]){delete _0xf73a0c[_0x7043('0x29')];}_0x16f3a6[_0x7043('0x19')](_0x392f8d)['send'](_0xf73a0c);};}exports[_0x7043('0x24')]=function(_0x1e1236,_0x97e0de){if(_0x1e1236[_0x7043('0x2a')]['id']){delete _0x1e1236['body']['id'];}return db['Action']['find']({'where':{'id':_0x1e1236[_0x7043('0x2b')]['id']}})['then'](handleEntityNotFound(_0x97e0de,null))[_0x7043('0x25')](saveUpdates(_0x1e1236[_0x7043('0x2a')],null))[_0x7043('0x25')](respondWithResult(_0x97e0de,null))[_0x7043('0x2c')](handleError(_0x97e0de,null));};exports[_0x7043('0x26')]=function(_0x21cedb,_0x2208ba){return db[_0x7043('0x2d')]['find']({'where':{'id':_0x21cedb[_0x7043('0x2b')]['id']}})['then'](handleEntityNotFound(_0x2208ba,null))[_0x7043('0x25')](removeEntity(_0x2208ba,null))[_0x7043('0x2c')](handleError(_0x2208ba,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 0f1a208..aebf3f0 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 _0x8b89=['moment','bluebird','request-promise','path','rimraf','./action.attributes','exports','define','Action','lodash','util','../../config/logger','api'];(function(_0x15cdac,_0x567bed){var _0x1d7d30=function(_0x4a09fc){while(--_0x4a09fc){_0x15cdac['push'](_0x15cdac['shift']());}};_0x1d7d30(++_0x567bed);}(_0x8b89,0x7e));var _0x98b8=function(_0x37296b,_0x2e9820){_0x37296b=_0x37296b-0x0;var _0x561567=_0x8b89[_0x37296b];return _0x561567;};'use strict';var _=require(_0x98b8('0x0'));var util=require(_0x98b8('0x1'));var logger=require(_0x98b8('0x2'))(_0x98b8('0x3'));var moment=require(_0x98b8('0x4'));var BPromise=require(_0x98b8('0x5'));var rp=require(_0x98b8('0x6'));var fs=require('fs');var path=require(_0x98b8('0x7'));var rimraf=require(_0x98b8('0x8'));var config=require('../../config/environment');var attributes=require(_0x98b8('0x9'));module[_0x98b8('0xa')]=function(_0x41fa2f,_0x48868c){return _0x41fa2f[_0x98b8('0xb')](_0x98b8('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f81=['exports','Action','tools_actions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x352122,_0x4ae950){var _0xbb53a6=function(_0x31e59b){while(--_0x31e59b){_0x352122['push'](_0x352122['shift']());}};_0xbb53a6(++_0x4ae950);}(_0x1f81,0xab));var _0x11f8=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x1f81[_0x511b76];return _0x5424ff;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var logger=require('../../config/logger')(_0x11f8('0x2'));var moment=require(_0x11f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x11f8('0x4'));var fs=require('fs');var path=require(_0x11f8('0x5'));var rimraf=require(_0x11f8('0x6'));var config=require(_0x11f8('0x7'));var attributes=require(_0x11f8('0x8'));module[_0x11f8('0x9')]=function(_0x1a16e9,_0xe63071){return _0x1a16e9['define'](_0x11f8('0xa'),attributes,{'tableName':_0x11f8('0xb'),'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 7ff3dbd..b36500c 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(_0x4ad9be,_0x3b108d){var _0x33e99b=function(_0x25c545){while(--_0x25c545){_0x4ad9be['push'](_0x4ad9be['shift']());}};_0x33e99b(++_0x3b108d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0xf494,0x1c6));var _0x4f49=function(_0x50821c,_0x2a072e){_0x50821c=_0x50821c-0x0;var _0x152bdb=_0xf494[_0x50821c];return _0x152bdb;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 399c974..8d8fae5 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 _0x518f=['multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','exports'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x518f,0x11e));var _0xf518=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x518f[_0x4e198a];return _0xb84bfe;};'use strict';var multer=require(_0xf518('0x0'));var util=require(_0xf518('0x1'));var path=require('path');var timeout=require(_0xf518('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf518('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf518('0x4'));var config=require(_0xf518('0x5'));var controller=require(_0xf518('0x6'));router[_0xf518('0x7')](_0xf518('0x8'),auth[_0xf518('0x9')](),controller[_0xf518('0xa')]);router['delete']('/:id',auth[_0xf518('0x9')](),controller[_0xf518('0xb')]);module[_0xf518('0xc')]=router; \ No newline at end of file +var _0xd33f=['/:id','isAuthenticated','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x556a99,_0x3d0574){var _0x45a65a=function(_0x12f83b){while(--_0x12f83b){_0x556a99['push'](_0x556a99['shift']());}};_0x45a65a(++_0x3d0574);}(_0xd33f,0x1ca));var _0xfd33=function(_0x309a45,_0x139d58){_0x309a45=_0x309a45-0x0;var _0x2e8030=_0xd33f[_0x309a45];return _0x2e8030;};'use strict';var multer=require(_0xfd33('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfd33('0x1'));var express=require(_0xfd33('0x2'));var router=express[_0xfd33('0x3')]();var fs_extra=require(_0xfd33('0x4'));var auth=require(_0xfd33('0x5'));var interaction=require(_0xfd33('0x6'));var config=require(_0xfd33('0x7'));var controller=require(_0xfd33('0x8'));router[_0xfd33('0x9')](_0xfd33('0xa'),auth[_0xfd33('0xb')](),controller['update']);router[_0xfd33('0xc')](_0xfd33('0xa'),auth[_0xfd33('0xb')](),controller['destroy']);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 2b09be8..511f7be 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2dd0b9,_0x2046ab){_0x2dd0b9=_0x2dd0b9-0x0;var _0x1de4d1=_0x1cb9[_0x2dd0b9];return _0x1de4d1;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file +var _0x4819=['TEXT','exports','STRING'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x4819,0xcd));var _0x9481=function(_0x36e0f6,_0x4da6a7){_0x36e0f6=_0x36e0f6-0x0;var _0xc90479=_0x4819[_0x36e0f6];return _0xc90479;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 426c986..e489a51 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 _0xefe6=['run','runReport','cross_join','keyBy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','dbH','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','get','CustomReports','UserProfileResource','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','filter','merge','AnalyticCustomReport','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','ROUND(%s)','getFields','ValidationErrorItem','DESC','output','fullPath','name','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','QueryTypes','SELECT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xefe6,0x14c));var _0x6efe=function(_0x404634,_0x56ed3f){_0x404634=_0x404634-0x0;var _0x524e06=_0xefe6[_0x404634];return _0x524e06;};'use strict';var emlformat=require(_0x6efe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6efe('0x1'));var jsonpatch=require(_0x6efe('0x2'));var rp=require(_0x6efe('0x3'));var moment=require(_0x6efe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6efe('0x5'));var util=require(_0x6efe('0x6'));var path=require(_0x6efe('0x7'));var sox=require('sox');var csv=require(_0x6efe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6efe('0x9'));var _=require(_0x6efe('0xa'));var squel=require('squel');var crypto=require(_0x6efe('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6efe('0x8'));var querystring=require('querystring');var Papa=require(_0x6efe('0xc'));var Redis=require(_0x6efe('0xd'));var authService=require(_0x6efe('0xe'));var qs=require(_0x6efe('0xf'));var as=require(_0x6efe('0x10'));var hardwareService=require(_0x6efe('0x11'));var logger=require(_0x6efe('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6efe('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6efe('0x14'))['db'];var dbH=require('../../mysqldb')[_0x6efe('0x15')];function respondWithStatusCode(_0x24353c,_0x2e8e95){_0x2e8e95=_0x2e8e95||0xcc;return function(_0x7de519){if(_0x7de519){return _0x24353c['sendStatus'](_0x2e8e95);}return _0x24353c[_0x6efe('0x16')](_0x2e8e95)[_0x6efe('0x17')]();};}function respondWithResult(_0x28fb8c,_0x5db4e8){_0x5db4e8=_0x5db4e8||0xc8;return function(_0x591e20){if(_0x591e20){return _0x28fb8c[_0x6efe('0x16')](_0x5db4e8)[_0x6efe('0x18')](_0x591e20);}};}function respondWithFilteredResult(_0x54e8fa,_0x4497f4){return function(_0x37b125){if(_0x37b125){var _0x681e45=typeof _0x4497f4[_0x6efe('0x19')]==='undefined'&&typeof _0x4497f4[_0x6efe('0x1a')]===_0x6efe('0x1b');var _0x3d8e8f=_0x37b125[_0x6efe('0x1c')];var _0x473dd8=_0x681e45?0x0:_0x4497f4[_0x6efe('0x19')];var _0x1ea2e9=_0x681e45?_0x37b125['count']:_0x4497f4[_0x6efe('0x19')]+_0x4497f4[_0x6efe('0x1a')];var _0x15f983;if(_0x1ea2e9>=_0x3d8e8f){_0x1ea2e9=_0x3d8e8f;_0x15f983=0xc8;}else{_0x15f983=0xce;}_0x54e8fa['status'](_0x15f983);return _0x54e8fa[_0x6efe('0x1d')](_0x6efe('0x1e'),_0x473dd8+'-'+_0x1ea2e9+'/'+_0x3d8e8f)[_0x6efe('0x18')](_0x37b125);}return null;};}function patchUpdates(_0x1e5d57){return function(_0x4423cb){try{jsonpatch[_0x6efe('0x1f')](_0x4423cb,_0x1e5d57,!![]);}catch(_0x12bb85){return BPromise[_0x6efe('0x20')](_0x12bb85);}return _0x4423cb['save']();};}function saveUpdates(_0x3c76b6,_0x51f992){return function(_0x1e2fab){if(_0x1e2fab){return _0x1e2fab[_0x6efe('0x21')](_0x3c76b6)['then'](function(_0x159879){return _0x159879;});}return null;};}function removeEntity(_0x4ce461,_0x3759c6){return function(_0x2a0910){if(_0x2a0910){return _0x2a0910['destroy']()[_0x6efe('0x22')](function(){var _0x184ede=_0x2a0910[_0x6efe('0x23')]({'plain':!![]});var _0x38745f=_0x6efe('0x24');return db[_0x6efe('0x25')]['destroy']({'where':{'type':_0x38745f,'resourceId':_0x184ede['id']}})[_0x6efe('0x22')](function(){return _0x2a0910;});})[_0x6efe('0x22')](function(){_0x4ce461[_0x6efe('0x16')](0xcc)[_0x6efe('0x17')]();});}};}function handleEntityNotFound(_0x291578,_0x2791ae){return function(_0x1a304f){if(!_0x1a304f){_0x291578[_0x6efe('0x26')](0x194);}return _0x1a304f;};}function handleError(_0x206ada,_0x50c3d7){_0x50c3d7=_0x50c3d7||0x1f4;return function(_0x250ef4){logger[_0x6efe('0x27')](_0x250ef4[_0x6efe('0x28')]);if(_0x250ef4['name']){delete _0x250ef4['name'];}_0x206ada['status'](_0x50c3d7)[_0x6efe('0x29')](_0x250ef4);};}exports[_0x6efe('0x2a')]=function(_0x5bffd3,_0x4ceda8){var _0x40d0ef={},_0x14c001={},_0x30ea65={'count':0x0,'rows':[]};var _0x73e756=_[_0x6efe('0x2b')](db['AnalyticCustomReport'][_0x6efe('0x2c')],function(_0x5071fb){return{'name':_0x5071fb[_0x6efe('0x2d')],'type':_0x5071fb[_0x6efe('0x2e')][_0x6efe('0x2f')]};});_0x14c001[_0x6efe('0x30')]=_[_0x6efe('0x2b')](_0x73e756,'name');_0x14c001[_0x6efe('0x31')]=_['keys'](_0x5bffd3[_0x6efe('0x31')]);_0x14c001[_0x6efe('0x32')]=_[_0x6efe('0x33')](_0x14c001[_0x6efe('0x30')],_0x14c001[_0x6efe('0x31')]);_0x40d0ef['attributes']=_[_0x6efe('0x33')](_0x14c001['model'],qs[_0x6efe('0x34')](_0x5bffd3[_0x6efe('0x31')][_0x6efe('0x34')]));_0x40d0ef['attributes']=_0x40d0ef['attributes'][_0x6efe('0x35')]?_0x40d0ef[_0x6efe('0x36')]:_0x14c001[_0x6efe('0x30')];if(!_0x5bffd3['query']['hasOwnProperty'](_0x6efe('0x37'))){_0x40d0ef[_0x6efe('0x1a')]=qs[_0x6efe('0x1a')](_0x5bffd3['query'][_0x6efe('0x1a')]);_0x40d0ef[_0x6efe('0x19')]=qs[_0x6efe('0x19')](_0x5bffd3[_0x6efe('0x31')][_0x6efe('0x19')]);}_0x40d0ef[_0x6efe('0x38')]=qs[_0x6efe('0x39')](_0x5bffd3['query'][_0x6efe('0x39')]);_0x40d0ef[_0x6efe('0x3a')]=qs[_0x6efe('0x32')](_['pick'](_0x5bffd3[_0x6efe('0x31')],_0x14c001[_0x6efe('0x32')]),_0x73e756);if(_0x5bffd3['query'][_0x6efe('0x3b')]){_0x40d0ef['where']=_[_0x6efe('0x3c')](_0x40d0ef['where'],{'$or':_[_0x6efe('0x2b')](_0x73e756,function(_0x579f0f){if(_0x579f0f[_0x6efe('0x2e')]!=='VIRTUAL'){var _0x360350={};_0x360350[_0x579f0f['name']]={'$like':'%'+_0x5bffd3['query'][_0x6efe('0x3b')]+'%'};return _0x360350;}})});}_0x40d0ef=_['merge']({},_0x40d0ef,_0x5bffd3['options']);var _0x5c1792={'where':_0x40d0ef[_0x6efe('0x3a')]};return db[_0x6efe('0x3d')][_0x6efe('0x1c')](_0x5c1792)[_0x6efe('0x22')](function(_0x493c58){_0x30ea65[_0x6efe('0x1c')]=_0x493c58;if(_0x5bffd3[_0x6efe('0x31')][_0x6efe('0x3e')]){_0x40d0ef[_0x6efe('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x6efe('0x40')](_0x40d0ef);})[_0x6efe('0x22')](function(_0x3a8c2a){_0x30ea65[_0x6efe('0x41')]=_0x3a8c2a;return _0x30ea65;})[_0x6efe('0x22')](respondWithFilteredResult(_0x4ceda8,_0x40d0ef))['catch'](handleError(_0x4ceda8,null));};exports[_0x6efe('0x42')]=function(_0x4949ee,_0x3c1443){var _0x1f068f={'raw':![],'where':{'id':_0x4949ee[_0x6efe('0x43')]['id']}},_0x3a16f8={};_0x3a16f8[_0x6efe('0x30')]=_[_0x6efe('0x44')](db[_0x6efe('0x3d')][_0x6efe('0x2c')]);_0x3a16f8['query']=_[_0x6efe('0x44')](_0x4949ee[_0x6efe('0x31')]);_0x3a16f8[_0x6efe('0x32')]=_[_0x6efe('0x33')](_0x3a16f8[_0x6efe('0x30')],_0x3a16f8[_0x6efe('0x31')]);_0x1f068f[_0x6efe('0x36')]=_[_0x6efe('0x33')](_0x3a16f8[_0x6efe('0x30')],qs[_0x6efe('0x34')](_0x4949ee[_0x6efe('0x31')]['fields']));_0x1f068f[_0x6efe('0x36')]=_0x1f068f[_0x6efe('0x36')]['length']?_0x1f068f[_0x6efe('0x36')]:_0x3a16f8[_0x6efe('0x30')];if(_0x4949ee[_0x6efe('0x31')][_0x6efe('0x3e')]){_0x1f068f[_0x6efe('0x3f')]=[{'all':!![]}];}_0x1f068f=_['merge']({},_0x1f068f,_0x4949ee[_0x6efe('0x45')]);return db['AnalyticCustomReport'][_0x6efe('0x46')](_0x1f068f)['then'](handleEntityNotFound(_0x3c1443,null))[_0x6efe('0x22')](respondWithResult(_0x3c1443,null))['catch'](handleError(_0x3c1443,null));};exports[_0x6efe('0x47')]=function(_0x1b72cf,_0x1f7266){return db['AnalyticCustomReport'][_0x6efe('0x47')](_0x1b72cf[_0x6efe('0x48')],{})[_0x6efe('0x22')](function(_0x5d6cc5){var _0x477e67=_0x1b72cf[_0x6efe('0x49')][_0x6efe('0x23')]({'plain':!![]});if(!_0x477e67)throw new Error(_0x6efe('0x4a'));if(_0x477e67['role']===_0x6efe('0x49')){var _0x2b10d0=_0x5d6cc5[_0x6efe('0x23')]({'plain':!![]});var _0x51f4d6=_0x6efe('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x51f4d6,'userProfileId':_0x477e67['userProfileId']},'raw':!![]})[_0x6efe('0x22')](function(_0x1c5eb0){if(_0x1c5eb0&&_0x1c5eb0[_0x6efe('0x4c')]===0x0){return db[_0x6efe('0x25')][_0x6efe('0x47')]({'name':_0x2b10d0['name'],'resourceId':_0x2b10d0['id'],'type':_0x6efe('0x24'),'sectionId':_0x1c5eb0['id']},{})[_0x6efe('0x22')](function(){return _0x5d6cc5;});}else{return _0x5d6cc5;}})[_0x6efe('0x4d')](function(_0x14261f){logger[_0x6efe('0x27')](_0x6efe('0x4e'),_0x14261f);throw _0x14261f;});}return _0x5d6cc5;})['then'](respondWithResult(_0x1f7266,0xc9))[_0x6efe('0x4d')](handleError(_0x1f7266,null));};exports[_0x6efe('0x21')]=function(_0x1c9050,_0x2719c8){if(_0x1c9050['body']['id']){delete _0x1c9050[_0x6efe('0x48')]['id'];}return db[_0x6efe('0x3d')][_0x6efe('0x46')]({'where':{'id':_0x1c9050['params']['id']}})[_0x6efe('0x22')](handleEntityNotFound(_0x2719c8,null))['then'](saveUpdates(_0x1c9050['body'],null))['then'](respondWithResult(_0x2719c8,null))['catch'](handleError(_0x2719c8,null));};exports[_0x6efe('0x4f')]=function(_0x5bd2ef,_0x2b3de3){return db[_0x6efe('0x3d')][_0x6efe('0x46')]({'where':{'id':_0x5bd2ef[_0x6efe('0x43')]['id']}})[_0x6efe('0x22')](handleEntityNotFound(_0x2b3de3,null))['then'](removeEntity(_0x2b3de3,null))[_0x6efe('0x4d')](handleError(_0x2b3de3,null));};exports[_0x6efe('0x50')]=function(_0x18cec8,_0x4f60e4){var _0x2cdb61=0xa;var _0x3d83ac=[_0x6efe('0x51'),_0x6efe('0x52'),_0x6efe('0x53'),'cross_join'];var _0x24a90c={'SUM':'SUM(%s)','COUNT':_0x6efe('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x6efe('0x55'),'AVG':_0x6efe('0x56'),'GROUP_CONCAT':_0x6efe('0x57'),'GROUP_CONCAT ASC':_0x6efe('0x58'),'GROUP_CONCAT DESC':_0x6efe('0x59')};var _0x36dd35={'SEC_TO_TIME':_0x6efe('0x5a'),'DATE':_0x6efe('0x5b'),'HOUR':_0x6efe('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6efe('0x5d')};var _0x49c87e=function(_0x3fe842){return!_[_0x6efe('0x5e')]([_0x6efe('0x5f'),_0x6efe('0x60'),_0x6efe('0x61'),_0x6efe('0x62')],_0x3fe842);};var _0xc16303=function(_0x5c3797){if(!_0x5c3797||!_0x5c3797[_0x6efe('0x63')]['length']){return'';}for(var _0x508b3d='(',_0x216cc2=0x0;_0x216cc2<_0x5c3797['rules']['length'];_0x216cc2+=0x1){_0x216cc2>0x0&&(_0x508b3d+='\x20'+_0x5c3797[_0x6efe('0x64')]+'\x20');_0x508b3d+=_0x5c3797[_0x6efe('0x63')][_0x216cc2][_0x6efe('0x65')]?_0xc16303(_0x5c3797[_0x6efe('0x63')][_0x216cc2]['group']):_0x5c3797['rules'][_0x216cc2][_0x6efe('0x66')]+'\x20'+_0x5c3797['rules'][_0x216cc2][_0x6efe('0x67')]+(_0x49c87e(_0x5c3797['rules'][_0x216cc2][_0x6efe('0x67')])?'\x20'+_0x5c3797[_0x6efe('0x63')][_0x216cc2][_0x6efe('0x68')]:'');}return _0x508b3d+')';};var _0x3017b7={'where':{'id':_0x18cec8['params']['id']}},_0x2c03d0,_0x5d8546,_0x5b4d4c,_0x1f456e,_0x5c3ea6;_0x3017b7=_[_0x6efe('0x3c')]({},_0x3017b7,_0x18cec8[_0x6efe('0x45')]);return db[_0x6efe('0x3d')]['find'](_0x3017b7)[_0x6efe('0x22')](function(_0x1c3d6e){if(_0x1c3d6e){_0x2c03d0=_0x1c3d6e;return _0x1c3d6e['getFields']();}return null;})['then'](function(_0x1a3259){if(_0x1a3259){if(!_0x1a3259['length']){throw new db[(_0x6efe('0x69'))]['ValidationErrorItem'](_0x6efe('0x6a'),0x193);}_0x5d8546=_0x1a3259;return db[_0x6efe('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x6efe('0x22')](function(_0x51520f){if(_0x51520f){_0x5b4d4c=_['keyBy'](_0x51520f,'id');var _0x20ea09;var _0x2b972b=squel[_0x6efe('0x6c')]();_0x2b972b[_0x6efe('0x6d')](_0x2c03d0['table']);for(var _0x46ecf4=0x0;_0x46ecf4<_0x5d8546[_0x6efe('0x35')];_0x46ecf4+=0x1){_0x20ea09=_0x5d8546[_0x46ecf4][_0x6efe('0x6e')]?_0x5b4d4c[_0x5d8546[_0x46ecf4][_0x6efe('0x6e')]][_0x6efe('0x6f')]:_0x5d8546[_0x46ecf4][_0x6efe('0x66')];_0x20ea09=_0x5d8546[_0x46ecf4][_0x6efe('0x70')]?_[_0x6efe('0x71')](_0x24a90c[_0x5d8546[_0x46ecf4][_0x6efe('0x70')]],'%s',_0x20ea09):_0x20ea09;_0x20ea09=_0x5d8546[_0x46ecf4]['format']?_[_0x6efe('0x71')](_0x36dd35[_0x5d8546[_0x46ecf4][_0x6efe('0x72')]],'%s',_0x20ea09):_0x20ea09;if(_0x5d8546[_0x46ecf4][_0x6efe('0x73')]){_0x2b972b['group'](_0x20ea09);}_0x5d8546[_0x46ecf4][_0x6efe('0x74')]&&_0x2b972b[_0x6efe('0x38')](_0x20ea09,_0x5d8546[_0x46ecf4]['orderBy']==='DESC'?![]:!![]);_0x2b972b['field'](_0x20ea09,_0x5d8546[_0x46ecf4][_0x6efe('0x75')]||_0x20ea09);}if(_0x2c03d0['joins']){_0x2c03d0[_0x6efe('0x76')]=JSON[_0x6efe('0x77')](_0x2c03d0[_0x6efe('0x76')]);for(var _0x2435b5=0x0;_0x2435b5<_0x2c03d0['joins']['length'];_0x2435b5+=0x1){if(_0x2c03d0['joins'][_0x2435b5][_0x6efe('0x2e')]&&_[_0x6efe('0x5e')](_0x3d83ac,_0x2c03d0[_0x6efe('0x76')][_0x2435b5][_0x6efe('0x2e')])&&_0x2c03d0[_0x6efe('0x76')][_0x2435b5][_0x6efe('0x78')]&&_0x2c03d0[_0x6efe('0x76')][_0x2435b5]['foreignTable']&&_0x2c03d0[_0x6efe('0x76')][_0x2435b5][_0x6efe('0x79')]){_0x2b972b[_0x2c03d0[_0x6efe('0x76')][_0x2435b5]['type']](_0x2c03d0['joins'][_0x2435b5][_0x6efe('0x7a')],null,util['format'](_0x6efe('0x7b'),_0x2c03d0[_0x6efe('0x7c')],_0x2c03d0[_0x6efe('0x76')][_0x2435b5][_0x6efe('0x78')],_0x2c03d0['joins'][_0x2435b5][_0x6efe('0x7a')],_0x2c03d0[_0x6efe('0x76')][_0x2435b5]['foreignKey']));}}}if(_0x2c03d0[_0x6efe('0x7d')]){_0x2c03d0['conditions']=JSON[_0x6efe('0x77')](_0x2c03d0[_0x6efe('0x7d')]);_0x2b972b[_0x6efe('0x3a')](_0xc16303(_0x2c03d0[_0x6efe('0x7d')][_0x6efe('0x65')]));}_0x5c3ea6=_0x2b972b[_0x6efe('0x7e')]();_0x2b972b[_0x6efe('0x1a')](_0x2cdb61);_0x2b972b[_0x6efe('0x19')](0x0);logger[_0x6efe('0x7f')](_0x6efe('0x80'),_0x2b972b[_0x6efe('0x81')]());return dbH[_0x6efe('0x82')][_0x6efe('0x31')](_0x2b972b['toString'](),{'type':dbH[_0x6efe('0x82')]['QueryTypes']['SELECT']});}})[_0x6efe('0x22')](respondWithResult(_0x4f60e4,null))[_0x6efe('0x4d')](handleError(_0x4f60e4,null));};function runReport(_0x551016,_0x10b056,_0x5e3a2f){var _0x479fee=_0x10b056['name'];var _0x519dcc=0xa;var _0x1d1702=[_0x6efe('0x51'),_0x6efe('0x52'),_0x6efe('0x53'),'cross_join'];var _0x253203={'SUM':_0x6efe('0x83'),'COUNT':_0x6efe('0x54'),'COUNT DISTINCT':_0x6efe('0x84'),'MAX':_0x6efe('0x85'),'MIN':_0x6efe('0x55'),'AVG':_0x6efe('0x56'),'GROUP_CONCAT':_0x6efe('0x57'),'GROUP_CONCAT ASC':_0x6efe('0x58'),'GROUP_CONCAT DESC':_0x6efe('0x59')};var _0x471ff6={'SEC_TO_TIME':_0x6efe('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x6efe('0x86'),'UNIX_TIMESTAMP':_0x6efe('0x5d')};var _0x1291f1=function(_0x467b3d){return!_[_0x6efe('0x5e')]([_0x6efe('0x5f'),_0x6efe('0x60'),_0x6efe('0x61'),'IS\x20NOT\x20EMPTY'],_0x467b3d);};var _0x1b7c8b=function(_0x382186){if(!_0x382186||!_0x382186[_0x6efe('0x63')][_0x6efe('0x35')]){return'';}for(var _0x4d209a='(',_0x103f48=0x0;_0x103f48<_0x382186[_0x6efe('0x63')][_0x6efe('0x35')];_0x103f48+=0x1){_0x103f48>0x0&&(_0x4d209a+='\x20'+_0x382186[_0x6efe('0x64')]+'\x20');_0x4d209a+=_0x382186[_0x6efe('0x63')][_0x103f48][_0x6efe('0x65')]?_0x1b7c8b(_0x382186[_0x6efe('0x63')][_0x103f48]['group']):_0x382186['rules'][_0x103f48][_0x6efe('0x66')]+'\x20'+_0x382186[_0x6efe('0x63')][_0x103f48]['condition']+(_0x1291f1(_0x382186['rules'][_0x103f48][_0x6efe('0x67')])?'\x20'+_0x382186['rules'][_0x103f48]['value']:'');}return _0x4d209a+')';};var _0x411fef={'where':{'id':_0x551016['id']}},_0x27ec9a,_0x7cfcba,_0x5f5021,_0x5d2dfb,_0x579173;_0x411fef=_[_0x6efe('0x3c')]({},_0x411fef,_0x5e3a2f);return db[_0x6efe('0x3d')][_0x6efe('0x46')](_0x411fef)['then'](function(_0x5f76a5){if(_0x5f76a5){_0x27ec9a=_0x5f76a5;return _0x5f76a5[_0x6efe('0x87')]();}return null;})[_0x6efe('0x22')](function(_0x217283){if(_0x217283){if(!_0x217283['length']){throw new db[(_0x6efe('0x69'))][(_0x6efe('0x88'))](_0x6efe('0x6a'),0x193);}_0x7cfcba=_0x217283;return db[_0x6efe('0x6b')][_0x6efe('0x40')]({'raw':!![]});}return null;})[_0x6efe('0x22')](function(_0x5b8a98){if(_0x5b8a98){_0x5f5021=_['keyBy'](_0x5b8a98,'id');var _0x5b844d;var _0x45bb00=squel[_0x6efe('0x6c')]();_0x45bb00['from'](_0x27ec9a['table']);for(var _0x368030=0x0;_0x368030<_0x7cfcba['length'];_0x368030+=0x1){_0x5b844d=_0x7cfcba[_0x368030][_0x6efe('0x6e')]?_0x5f5021[_0x7cfcba[_0x368030][_0x6efe('0x6e')]][_0x6efe('0x6f')]:_0x7cfcba[_0x368030][_0x6efe('0x66')];_0x5b844d=_0x7cfcba[_0x368030][_0x6efe('0x70')]?_['replace'](_0x253203[_0x7cfcba[_0x368030]['function']],'%s',_0x5b844d):_0x5b844d;_0x5b844d=_0x7cfcba[_0x368030][_0x6efe('0x72')]?_['replace'](_0x471ff6[_0x7cfcba[_0x368030][_0x6efe('0x72')]],'%s',_0x5b844d):_0x5b844d;if(_0x7cfcba[_0x368030][_0x6efe('0x73')]){_0x45bb00[_0x6efe('0x65')](_0x5b844d);}_0x7cfcba[_0x368030][_0x6efe('0x74')]&&_0x45bb00[_0x6efe('0x38')](_0x5b844d,_0x7cfcba[_0x368030][_0x6efe('0x74')]===_0x6efe('0x89')?![]:!![]);_0x45bb00[_0x6efe('0x66')](_0x5b844d,_0x7cfcba[_0x368030]['alias']||_0x5b844d);}if(_0x27ec9a[_0x6efe('0x76')]){_0x27ec9a[_0x6efe('0x76')]=JSON[_0x6efe('0x77')](_0x27ec9a[_0x6efe('0x76')]);for(var _0x3b815f=0x0;_0x3b815f<_0x27ec9a[_0x6efe('0x76')][_0x6efe('0x35')];_0x3b815f+=0x1){if(_0x27ec9a[_0x6efe('0x76')][_0x3b815f]['type']&&_['includes'](_0x1d1702,_0x27ec9a[_0x6efe('0x76')][_0x3b815f][_0x6efe('0x2e')])&&_0x27ec9a[_0x6efe('0x76')][_0x3b815f][_0x6efe('0x78')]&&_0x27ec9a[_0x6efe('0x76')][_0x3b815f][_0x6efe('0x7a')]&&_0x27ec9a[_0x6efe('0x76')][_0x3b815f][_0x6efe('0x79')]){_0x45bb00[_0x27ec9a['joins'][_0x3b815f]['type']](_0x27ec9a[_0x6efe('0x76')][_0x3b815f][_0x6efe('0x7a')],null,util['format'](_0x6efe('0x7b'),_0x27ec9a['table'],_0x27ec9a['joins'][_0x3b815f][_0x6efe('0x78')],_0x27ec9a['joins'][_0x3b815f][_0x6efe('0x7a')],_0x27ec9a['joins'][_0x3b815f]['foreignKey']));}}}if(_0x27ec9a[_0x6efe('0x7d')]){_0x27ec9a[_0x6efe('0x7d')]=JSON[_0x6efe('0x77')](_0x27ec9a[_0x6efe('0x7d')]);_0x45bb00[_0x6efe('0x3a')](_0x1b7c8b(_0x27ec9a[_0x6efe('0x7d')][_0x6efe('0x65')]));}_0x579173=_0x45bb00[_0x6efe('0x7e')]();_0x45bb00['limit'](_0x519dcc);_0x45bb00[_0x6efe('0x19')](0x0);return;}})[_0x6efe('0x22')](function(){if(_0x10b056[_0x6efe('0x8a')]==='web'){return null;}var _0x324618=_[_0x6efe('0x3c')](_0x10b056,{'name':_0x10b056[_0x6efe('0x8b')]||_0x10b056[_0x6efe('0x8c')]||_0x27ec9a[_0x6efe('0x8c')],'basename':_0x479fee,'savename':util[_0x6efe('0x72')](_0x6efe('0x8d'),_0x10b056[_0x6efe('0x8c')]||_0x27ec9a[_0x6efe('0x8c')],require(_0x6efe('0x8e'))[_0x6efe('0x8f')](0x4),_0x10b056[_0x6efe('0x8a')]||_0x6efe('0x90')),'reportId':_0x27ec9a['id'],'reportType':_0x6efe('0x91')});return db[_0x6efe('0x92')]['create'](_0x324618,{'raw':!![]});})[_0x6efe('0x22')](function(_0x364639){if(_0x27ec9a[_0x6efe('0x7c')]===_0x6efe('0x93')){_0x579173[_0x6efe('0x3a')](_0x27ec9a[_0x6efe('0x7c')]+_0x6efe('0x94'),_0x10b056[_0x6efe('0x95')],_0x10b056[_0x6efe('0x96')]);}else{_0x579173[_0x6efe('0x3a')](_0x27ec9a[_0x6efe('0x7c')]+_0x6efe('0x97'),_0x10b056[_0x6efe('0x95')],_0x10b056['endDate']);}if(_0x364639){logger[_0x6efe('0x98')](_0x6efe('0x99'),_0x579173[_0x6efe('0x81')]());require(_0x6efe('0x9a'))[_0x6efe('0x9b')](path[_0x6efe('0x51')](__dirname,_0x6efe('0x9c'),_0x364639['output']),[_0x364639['id'],_0x579173[_0x6efe('0x81')](),path['join'](__dirname,'../../files/reports',_0x364639[_0x6efe('0x9d')]),_0x479fee]);return _0x364639;}else{var _0x1c8cde=squel[_0x6efe('0x6c')]();_0x1c8cde[_0x6efe('0x6d')]('('+_0x579173[_0x6efe('0x81')]()+')','countTable');_0x1c8cde[_0x6efe('0x66')]('COUNT(*)',_0x6efe('0x1c'));_0x579173[_0x6efe('0x1a')](_0x10b056['limit']||_0x519dcc);_0x579173['offset'](_0x10b056[_0x6efe('0x19')]||0x0);return dbH[_0x6efe('0x82')][_0x6efe('0x31')](_0x1c8cde['toString'](),{'type':dbH[_0x6efe('0x82')][_0x6efe('0x9e')][_0x6efe('0x9f')]})['then'](function(_0x21cc30){if(!_0x21cc30[_0x6efe('0x35')]){_0x5d2dfb=0x0;}else{_0x5d2dfb=_0x21cc30[0x0]['count']||0x0;}return dbH[_0x6efe('0x82')]['query'](_0x579173['toString'](),{'type':dbH['sequelize'][_0x6efe('0x9e')][_0x6efe('0x9f')]});})[_0x6efe('0x22')](function(_0x1fe2bb){return{'rows':_0x1fe2bb||[],'count':_0x5d2dfb};});}});}exports[_0x6efe('0xa0')]=function(_0x472f13,_0xfce440){return runReport(_0x472f13[_0x6efe('0x43')],_0x472f13[_0x6efe('0x31')],_0x472f13[_0x6efe('0x45')])[_0x6efe('0x22')](respondWithResult(_0xfce440,null))['catch'](handleError(_0xfce440,null));};exports[_0x6efe('0xa1')]=runReport;exports[_0x6efe('0x31')]=function(_0x27e4fc,_0x477e5f){var _0xc99069=0xa;var _0x172507=[_0x6efe('0x51'),_0x6efe('0x52'),_0x6efe('0x53'),_0x6efe('0xa2')];var _0x1882e6={'SUM':'SUM(%s)','COUNT':_0x6efe('0x54'),'COUNT DISTINCT':_0x6efe('0x84'),'MAX':_0x6efe('0x85'),'MIN':_0x6efe('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6efe('0x57'),'GROUP_CONCAT ASC':_0x6efe('0x58'),'GROUP_CONCAT DESC':_0x6efe('0x59')};var _0x472a0a={'SEC_TO_TIME':_0x6efe('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x6efe('0x86'),'UNIX_TIMESTAMP':_0x6efe('0x5d')};var _0x542405=function(_0xb0f44a){return!_[_0x6efe('0x5e')](['IS\x20NULL',_0x6efe('0x60'),_0x6efe('0x61'),'IS\x20NOT\x20EMPTY'],_0xb0f44a);};var _0x131f4e=function(_0x2a6528){if(!_0x2a6528||!_0x2a6528[_0x6efe('0x63')]['length']){return'';}for(var _0x428bb3='(',_0x4a81b3=0x0;_0x4a81b3<_0x2a6528[_0x6efe('0x63')][_0x6efe('0x35')];_0x4a81b3+=0x1){_0x4a81b3>0x0&&(_0x428bb3+='\x20'+_0x2a6528['operator']+'\x20');_0x428bb3+=_0x2a6528[_0x6efe('0x63')][_0x4a81b3][_0x6efe('0x65')]?_0x131f4e(_0x2a6528[_0x6efe('0x63')][_0x4a81b3][_0x6efe('0x65')]):_0x2a6528[_0x6efe('0x63')][_0x4a81b3][_0x6efe('0x66')]+'\x20'+_0x2a6528[_0x6efe('0x63')][_0x4a81b3]['condition']+(_0x542405(_0x2a6528[_0x6efe('0x63')][_0x4a81b3][_0x6efe('0x67')])?'\x20'+_0x2a6528[_0x6efe('0x63')][_0x4a81b3][_0x6efe('0x68')]:'');}return _0x428bb3+')';};var _0x245894={'where':{'id':_0x27e4fc[_0x6efe('0x43')]['id']}},_0x522a65,_0x1f7f70,_0x3f1e61,_0x220c52,_0x481d98;_0x245894=_['merge']({},_0x245894,_0x27e4fc[_0x6efe('0x45')]);return db[_0x6efe('0x3d')]['find'](_0x245894)[_0x6efe('0x22')](function(_0x1ff34d){if(_0x1ff34d){_0x522a65=_0x1ff34d;return _0x1ff34d[_0x6efe('0x87')]();}return null;})[_0x6efe('0x22')](function(_0x5c87b7){if(_0x5c87b7){if(!_0x5c87b7[_0x6efe('0x35')]){throw new db[(_0x6efe('0x69'))]['ValidationErrorItem'](_0x6efe('0x6a'),0x193);}_0x1f7f70=_0x5c87b7;return db['AnalyticMetric'][_0x6efe('0x40')]({'raw':!![]});}return null;})[_0x6efe('0x22')](function(_0x12d300){if(_0x12d300){_0x3f1e61=_[_0x6efe('0xa3')](_0x12d300,'id');var _0x2def82;var _0x49b636=squel[_0x6efe('0x6c')]();_0x49b636[_0x6efe('0x6d')](_0x522a65[_0x6efe('0x7c')]);for(var _0x5090c7=0x0;_0x5090c7<_0x1f7f70[_0x6efe('0x35')];_0x5090c7+=0x1){_0x2def82=_0x1f7f70[_0x5090c7]['MetricId']?_0x3f1e61[_0x1f7f70[_0x5090c7][_0x6efe('0x6e')]]['metric']:_0x1f7f70[_0x5090c7]['field'];_0x2def82=_0x1f7f70[_0x5090c7][_0x6efe('0x70')]?_[_0x6efe('0x71')](_0x1882e6[_0x1f7f70[_0x5090c7]['function']],'%s',_0x2def82):_0x2def82;_0x2def82=_0x1f7f70[_0x5090c7]['format']?_['replace'](_0x472a0a[_0x1f7f70[_0x5090c7][_0x6efe('0x72')]],'%s',_0x2def82):_0x2def82;if(_0x1f7f70[_0x5090c7][_0x6efe('0x73')]){_0x49b636[_0x6efe('0x65')](_0x2def82);}_0x1f7f70[_0x5090c7][_0x6efe('0x74')]&&_0x49b636[_0x6efe('0x38')](_0x2def82,_0x1f7f70[_0x5090c7][_0x6efe('0x74')]==='DESC'?![]:!![]);_0x49b636[_0x6efe('0x66')](_0x2def82,_0x1f7f70[_0x5090c7][_0x6efe('0x75')]||_0x2def82);}if(_0x522a65[_0x6efe('0x76')]){_0x522a65[_0x6efe('0x76')]=JSON['parse'](_0x522a65[_0x6efe('0x76')]);for(var _0x4ec63c=0x0;_0x4ec63c<_0x522a65[_0x6efe('0x76')][_0x6efe('0x35')];_0x4ec63c+=0x1){if(_0x522a65[_0x6efe('0x76')][_0x4ec63c]['type']&&_[_0x6efe('0x5e')](_0x172507,_0x522a65[_0x6efe('0x76')][_0x4ec63c][_0x6efe('0x2e')])&&_0x522a65[_0x6efe('0x76')][_0x4ec63c][_0x6efe('0x78')]&&_0x522a65[_0x6efe('0x76')][_0x4ec63c]['foreignTable']&&_0x522a65[_0x6efe('0x76')][_0x4ec63c][_0x6efe('0x79')]){_0x49b636[_0x522a65['joins'][_0x4ec63c][_0x6efe('0x2e')]](_0x522a65[_0x6efe('0x76')][_0x4ec63c][_0x6efe('0x7a')],null,util[_0x6efe('0x72')](_0x6efe('0x7b'),_0x522a65[_0x6efe('0x7c')],_0x522a65[_0x6efe('0x76')][_0x4ec63c][_0x6efe('0x78')],_0x522a65[_0x6efe('0x76')][_0x4ec63c]['foreignTable'],_0x522a65[_0x6efe('0x76')][_0x4ec63c]['foreignKey']));}}}if(_0x522a65[_0x6efe('0x7d')]){_0x522a65['conditions']=JSON[_0x6efe('0x77')](_0x522a65['conditions']);_0x49b636[_0x6efe('0x3a')](_0x131f4e(_0x522a65[_0x6efe('0x7d')][_0x6efe('0x65')]));}_0x481d98=_0x49b636[_0x6efe('0x7e')]();_0x49b636[_0x6efe('0x1a')](_0xc99069);_0x49b636[_0x6efe('0x19')](0x0);logger[_0x6efe('0x7f')]('Limited\x20Query:',_0x49b636[_0x6efe('0x81')]());return dbH[_0x6efe('0x82')][_0x6efe('0x31')](_0x49b636[_0x6efe('0x81')](),{'type':dbH['sequelize']['QueryTypes'][_0x6efe('0x9f')]});}})[_0x6efe('0x22')](function(){return{'sql':_0x481d98[_0x6efe('0x81')]()};})['then'](respondWithResult(_0x477e5f,null))['catch'](handleError(_0x477e5f,null));}; \ No newline at end of file +var _0x34ef=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','get','CustomReports','UserProfileResource','destroy','send','index','AnalyticCustomReport','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','clone','web','%s-%s.%s','randomstring','generate','output','csv','custom','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','run','runReport','UNIX_TIMESTAMP(%s)','order','eml-format','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x34ef,0x8e));var _0xf34e=function(_0xa46106,_0x20f6d5){_0xa46106=_0xa46106-0x0;var _0x4fb272=_0x34ef[_0xa46106];return _0x4fb272;};'use strict';var emlformat=require(_0xf34e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf34e('0x1'));var rp=require(_0xf34e('0x2'));var moment=require(_0xf34e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf34e('0x4'));var util=require('util');var path=require(_0xf34e('0x5'));var sox=require('sox');var csv=require(_0xf34e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf34e('0x7'));var _=require(_0xf34e('0x8'));var squel=require(_0xf34e('0x9'));var crypto=require(_0xf34e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf34e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf34e('0xc'));var Papa=require(_0xf34e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf34e('0xe'));var as=require(_0xf34e('0xf'));var hardwareService=require(_0xf34e('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf34e('0x11'));var config=require(_0xf34e('0x12'));var licenseUtil=require(_0xf34e('0x13'));var db=require(_0xf34e('0x14'))['db'];var dbH=require(_0xf34e('0x14'))['dbH'];function respondWithStatusCode(_0x7646ea,_0x2f8d67){_0x2f8d67=_0x2f8d67||0xcc;return function(_0x459591){if(_0x459591){return _0x7646ea[_0xf34e('0x15')](_0x2f8d67);}return _0x7646ea[_0xf34e('0x16')](_0x2f8d67)[_0xf34e('0x17')]();};}function respondWithResult(_0x38767d,_0x2c0dfe){_0x2c0dfe=_0x2c0dfe||0xc8;return function(_0x13da83){if(_0x13da83){return _0x38767d['status'](_0x2c0dfe)[_0xf34e('0x18')](_0x13da83);}};}function respondWithFilteredResult(_0x1e6227,_0x297d08){return function(_0x5bd586){if(_0x5bd586){var _0x5a5afb=typeof _0x297d08[_0xf34e('0x19')]===_0xf34e('0x1a')&&typeof _0x297d08['limit']===_0xf34e('0x1a');var _0x31c922=_0x5bd586[_0xf34e('0x1b')];var _0x2336d0=_0x5a5afb?0x0:_0x297d08[_0xf34e('0x19')];var _0x5d12db=_0x5a5afb?_0x5bd586[_0xf34e('0x1b')]:_0x297d08[_0xf34e('0x19')]+_0x297d08['limit'];var _0x164b98;if(_0x5d12db>=_0x31c922){_0x5d12db=_0x31c922;_0x164b98=0xc8;}else{_0x164b98=0xce;}_0x1e6227['status'](_0x164b98);return _0x1e6227[_0xf34e('0x1c')](_0xf34e('0x1d'),_0x2336d0+'-'+_0x5d12db+'/'+_0x31c922)[_0xf34e('0x18')](_0x5bd586);}return null;};}function patchUpdates(_0x2f5c06){return function(_0x31d2af){try{jsonpatch[_0xf34e('0x1e')](_0x31d2af,_0x2f5c06,!![]);}catch(_0x5d5102){return BPromise['reject'](_0x5d5102);}return _0x31d2af[_0xf34e('0x1f')]();};}function saveUpdates(_0x3f0d85,_0x915ff7){return function(_0x8b8824){if(_0x8b8824){return _0x8b8824[_0xf34e('0x20')](_0x3f0d85)[_0xf34e('0x21')](function(_0x584902){return _0x584902;});}return null;};}function removeEntity(_0x2ed69b,_0x232491){return function(_0xae45d){if(_0xae45d){return _0xae45d['destroy']()[_0xf34e('0x21')](function(){var _0x5ebedd=_0xae45d[_0xf34e('0x22')]({'plain':!![]});var _0x4aed96=_0xf34e('0x23');return db[_0xf34e('0x24')][_0xf34e('0x25')]({'where':{'type':_0x4aed96,'resourceId':_0x5ebedd['id']}})[_0xf34e('0x21')](function(){return _0xae45d;});})[_0xf34e('0x21')](function(){_0x2ed69b[_0xf34e('0x16')](0xcc)[_0xf34e('0x17')]();});}};}function handleEntityNotFound(_0x16eba0,_0x3d2f69){return function(_0x4c3eb5){if(!_0x4c3eb5){_0x16eba0[_0xf34e('0x15')](0x194);}return _0x4c3eb5;};}function handleError(_0x17678b,_0x1fb24a){_0x1fb24a=_0x1fb24a||0x1f4;return function(_0x3b49f9){logger['error'](_0x3b49f9['stack']);if(_0x3b49f9['name']){delete _0x3b49f9['name'];}_0x17678b[_0xf34e('0x16')](_0x1fb24a)[_0xf34e('0x26')](_0x3b49f9);};}exports[_0xf34e('0x27')]=function(_0x1a2e85,_0x5db4a0){var _0x303672={},_0x1ad257={},_0x5ae684={'count':0x0,'rows':[]};var _0x214bd6=_['map'](db[_0xf34e('0x28')]['rawAttributes'],function(_0x2584e2){return{'name':_0x2584e2['fieldName'],'type':_0x2584e2[_0xf34e('0x29')][_0xf34e('0x2a')]};});_0x1ad257[_0xf34e('0x2b')]=_[_0xf34e('0x2c')](_0x214bd6,_0xf34e('0x2d'));_0x1ad257['query']=_[_0xf34e('0x2e')](_0x1a2e85[_0xf34e('0x2f')]);_0x1ad257[_0xf34e('0x30')]=_[_0xf34e('0x31')](_0x1ad257[_0xf34e('0x2b')],_0x1ad257[_0xf34e('0x2f')]);_0x303672[_0xf34e('0x32')]=_['intersection'](_0x1ad257['model'],qs[_0xf34e('0x33')](_0x1a2e85[_0xf34e('0x2f')][_0xf34e('0x33')]));_0x303672['attributes']=_0x303672[_0xf34e('0x32')][_0xf34e('0x34')]?_0x303672[_0xf34e('0x32')]:_0x1ad257[_0xf34e('0x2b')];if(!_0x1a2e85['query'][_0xf34e('0x35')](_0xf34e('0x36'))){_0x303672[_0xf34e('0x37')]=qs['limit'](_0x1a2e85['query'][_0xf34e('0x37')]);_0x303672[_0xf34e('0x19')]=qs[_0xf34e('0x19')](_0x1a2e85[_0xf34e('0x2f')][_0xf34e('0x19')]);}_0x303672['order']=qs['sort'](_0x1a2e85[_0xf34e('0x2f')][_0xf34e('0x38')]);_0x303672[_0xf34e('0x39')]=qs['filters'](_[_0xf34e('0x3a')](_0x1a2e85[_0xf34e('0x2f')],_0x1ad257['filters']),_0x214bd6);if(_0x1a2e85['query']['filter']){_0x303672[_0xf34e('0x39')]=_[_0xf34e('0x3b')](_0x303672[_0xf34e('0x39')],{'$or':_[_0xf34e('0x2c')](_0x214bd6,function(_0x5fdc6d){if(_0x5fdc6d[_0xf34e('0x29')]!==_0xf34e('0x3c')){var _0x11547e={};_0x11547e[_0x5fdc6d[_0xf34e('0x2d')]]={'$like':'%'+_0x1a2e85[_0xf34e('0x2f')][_0xf34e('0x3d')]+'%'};return _0x11547e;}})});}_0x303672=_[_0xf34e('0x3b')]({},_0x303672,_0x1a2e85['options']);var _0x423f85={'where':_0x303672[_0xf34e('0x39')]};return db['AnalyticCustomReport'][_0xf34e('0x1b')](_0x423f85)[_0xf34e('0x21')](function(_0x18f421){_0x5ae684['count']=_0x18f421;if(_0x1a2e85['query'][_0xf34e('0x3e')]){_0x303672[_0xf34e('0x3f')]=[{'all':!![]}];}return db[_0xf34e('0x28')][_0xf34e('0x40')](_0x303672);})[_0xf34e('0x21')](function(_0x67e99d){_0x5ae684[_0xf34e('0x41')]=_0x67e99d;return _0x5ae684;})[_0xf34e('0x21')](respondWithFilteredResult(_0x5db4a0,_0x303672))[_0xf34e('0x42')](handleError(_0x5db4a0,null));};exports['show']=function(_0x3e68a0,_0x261e3f){var _0x28cbae={'raw':![],'where':{'id':_0x3e68a0['params']['id']}},_0x193468={};_0x193468[_0xf34e('0x2b')]=_[_0xf34e('0x2e')](db[_0xf34e('0x28')]['rawAttributes']);_0x193468[_0xf34e('0x2f')]=_['keys'](_0x3e68a0[_0xf34e('0x2f')]);_0x193468['filters']=_[_0xf34e('0x31')](_0x193468[_0xf34e('0x2b')],_0x193468[_0xf34e('0x2f')]);_0x28cbae['attributes']=_['intersection'](_0x193468[_0xf34e('0x2b')],qs[_0xf34e('0x33')](_0x3e68a0[_0xf34e('0x2f')][_0xf34e('0x33')]));_0x28cbae[_0xf34e('0x32')]=_0x28cbae['attributes'][_0xf34e('0x34')]?_0x28cbae['attributes']:_0x193468['model'];if(_0x3e68a0[_0xf34e('0x2f')][_0xf34e('0x3e')]){_0x28cbae[_0xf34e('0x3f')]=[{'all':!![]}];}_0x28cbae=_[_0xf34e('0x3b')]({},_0x28cbae,_0x3e68a0['options']);return db['AnalyticCustomReport'][_0xf34e('0x43')](_0x28cbae)['then'](handleEntityNotFound(_0x261e3f,null))[_0xf34e('0x21')](respondWithResult(_0x261e3f,null))[_0xf34e('0x42')](handleError(_0x261e3f,null));};exports['create']=function(_0x531906,_0xb1698f){return db['AnalyticCustomReport']['create'](_0x531906['body'],{})[_0xf34e('0x21')](function(_0x1257d0){var _0x3bb3b6=_0x531906[_0xf34e('0x44')][_0xf34e('0x22')]({'plain':!![]});if(!_0x3bb3b6)throw new Error(_0xf34e('0x45'));if(_0x3bb3b6[_0xf34e('0x46')]===_0xf34e('0x44')){var _0x26921e=_0x1257d0['get']({'plain':!![]});var _0x5536c8=_0xf34e('0x47');return db[_0xf34e('0x48')][_0xf34e('0x43')]({'where':{'name':_0x5536c8,'userProfileId':_0x3bb3b6[_0xf34e('0x49')]},'raw':!![]})[_0xf34e('0x21')](function(_0x24f61b){if(_0x24f61b&&_0x24f61b[_0xf34e('0x4a')]===0x0){return db[_0xf34e('0x24')][_0xf34e('0x4b')]({'name':_0x26921e[_0xf34e('0x2d')],'resourceId':_0x26921e['id'],'type':_0xf34e('0x23'),'sectionId':_0x24f61b['id']},{})['then'](function(){return _0x1257d0;});}else{return _0x1257d0;}})[_0xf34e('0x42')](function(_0x57c458){logger['error'](_0xf34e('0x4c'),_0x57c458);throw _0x57c458;});}return _0x1257d0;})['then'](respondWithResult(_0xb1698f,0xc9))['catch'](handleError(_0xb1698f,null));};exports[_0xf34e('0x20')]=function(_0x5b5e9c,_0x11d0a6){if(_0x5b5e9c[_0xf34e('0x4d')]['id']){delete _0x5b5e9c[_0xf34e('0x4d')]['id'];}return db[_0xf34e('0x28')][_0xf34e('0x43')]({'where':{'id':_0x5b5e9c[_0xf34e('0x4e')]['id']}})[_0xf34e('0x21')](handleEntityNotFound(_0x11d0a6,null))[_0xf34e('0x21')](saveUpdates(_0x5b5e9c[_0xf34e('0x4d')],null))[_0xf34e('0x21')](respondWithResult(_0x11d0a6,null))['catch'](handleError(_0x11d0a6,null));};exports[_0xf34e('0x25')]=function(_0x1ca1b7,_0xf262b9){return db[_0xf34e('0x28')][_0xf34e('0x43')]({'where':{'id':_0x1ca1b7[_0xf34e('0x4e')]['id']}})[_0xf34e('0x21')](handleEntityNotFound(_0xf262b9,null))[_0xf34e('0x21')](removeEntity(_0xf262b9,null))[_0xf34e('0x42')](handleError(_0xf262b9,null));};exports[_0xf34e('0x4f')]=function(_0x57cd99,_0x591bc1){var _0x20dca4=0xa;var _0x472342=[_0xf34e('0x50'),_0xf34e('0x51'),_0xf34e('0x52'),_0xf34e('0x53')];var _0x322dcf={'SUM':_0xf34e('0x54'),'COUNT':_0xf34e('0x55'),'COUNT DISTINCT':_0xf34e('0x56'),'MAX':_0xf34e('0x57'),'MIN':_0xf34e('0x58'),'AVG':_0xf34e('0x59'),'GROUP_CONCAT':_0xf34e('0x5a'),'GROUP_CONCAT ASC':_0xf34e('0x5b'),'GROUP_CONCAT DESC':_0xf34e('0x5c')};var _0x289c43={'SEC_TO_TIME':_0xf34e('0x5d'),'DATE':_0xf34e('0x5e'),'HOUR':_0xf34e('0x5f'),'ROUND':_0xf34e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x84e832=function(_0x5826fa){return!_['includes']([_0xf34e('0x61'),'IS\x20NOT\x20NULL',_0xf34e('0x62'),_0xf34e('0x63')],_0x5826fa);};var _0x23cbd3=function(_0xaf19fa){if(!_0xaf19fa||!_0xaf19fa[_0xf34e('0x64')]['length']){return'';}for(var _0x23f6d5='(',_0x343a61=0x0;_0x343a61<_0xaf19fa[_0xf34e('0x64')][_0xf34e('0x34')];_0x343a61+=0x1){_0x343a61>0x0&&(_0x23f6d5+='\x20'+_0xaf19fa[_0xf34e('0x65')]+'\x20');_0x23f6d5+=_0xaf19fa[_0xf34e('0x64')][_0x343a61]['group']?_0x23cbd3(_0xaf19fa[_0xf34e('0x64')][_0x343a61][_0xf34e('0x66')]):_0xaf19fa[_0xf34e('0x64')][_0x343a61][_0xf34e('0x67')]+'\x20'+_0xaf19fa['rules'][_0x343a61][_0xf34e('0x68')]+(_0x84e832(_0xaf19fa['rules'][_0x343a61][_0xf34e('0x68')])?'\x20'+_0xaf19fa['rules'][_0x343a61][_0xf34e('0x69')]:'');}return _0x23f6d5+')';};var _0x3822f2={'where':{'id':_0x57cd99['params']['id']}},_0x2a2f03,_0x160320,_0x395d3c,_0x2623a5,_0x7f4d4e;_0x3822f2=_[_0xf34e('0x3b')]({},_0x3822f2,_0x57cd99['options']);return db[_0xf34e('0x28')][_0xf34e('0x43')](_0x3822f2)[_0xf34e('0x21')](function(_0x1ae18b){if(_0x1ae18b){_0x2a2f03=_0x1ae18b;return _0x1ae18b[_0xf34e('0x6a')]();}return null;})[_0xf34e('0x21')](function(_0x4eb735){if(_0x4eb735){if(!_0x4eb735['length']){throw new db[(_0xf34e('0x6b'))][(_0xf34e('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x160320=_0x4eb735;return db[_0xf34e('0x6d')][_0xf34e('0x40')]({'raw':!![]});}return null;})[_0xf34e('0x21')](function(_0x3eca1a){if(_0x3eca1a){_0x395d3c=_[_0xf34e('0x6e')](_0x3eca1a,'id');var _0x2380d7;var _0xb80e75=squel[_0xf34e('0x6f')]();_0xb80e75[_0xf34e('0x70')](_0x2a2f03['table']);for(var _0x213da1=0x0;_0x213da1<_0x160320[_0xf34e('0x34')];_0x213da1+=0x1){_0x2380d7=_0x160320[_0x213da1][_0xf34e('0x71')]?_0x395d3c[_0x160320[_0x213da1][_0xf34e('0x71')]][_0xf34e('0x72')]:_0x160320[_0x213da1][_0xf34e('0x67')];_0x2380d7=_0x160320[_0x213da1][_0xf34e('0x73')]?_[_0xf34e('0x74')](_0x322dcf[_0x160320[_0x213da1]['function']],'%s',_0x2380d7):_0x2380d7;_0x2380d7=_0x160320[_0x213da1][_0xf34e('0x75')]?_[_0xf34e('0x74')](_0x289c43[_0x160320[_0x213da1][_0xf34e('0x75')]],'%s',_0x2380d7):_0x2380d7;if(_0x160320[_0x213da1][_0xf34e('0x76')]){_0xb80e75[_0xf34e('0x66')](_0x2380d7);}_0x160320[_0x213da1][_0xf34e('0x77')]&&_0xb80e75['order'](_0x2380d7,_0x160320[_0x213da1]['orderBy']===_0xf34e('0x78')?![]:!![]);_0xb80e75[_0xf34e('0x67')](_0x2380d7,_0x160320[_0x213da1][_0xf34e('0x79')]||_0x2380d7);}if(_0x2a2f03['joins']){_0x2a2f03[_0xf34e('0x7a')]=JSON['parse'](_0x2a2f03[_0xf34e('0x7a')]);for(var _0xd84d69=0x0;_0xd84d69<_0x2a2f03[_0xf34e('0x7a')]['length'];_0xd84d69+=0x1){if(_0x2a2f03['joins'][_0xd84d69][_0xf34e('0x29')]&&_[_0xf34e('0x7b')](_0x472342,_0x2a2f03['joins'][_0xd84d69]['type'])&&_0x2a2f03[_0xf34e('0x7a')][_0xd84d69][_0xf34e('0x7c')]&&_0x2a2f03[_0xf34e('0x7a')][_0xd84d69][_0xf34e('0x7d')]&&_0x2a2f03[_0xf34e('0x7a')][_0xd84d69]['foreignKey']){_0xb80e75[_0x2a2f03[_0xf34e('0x7a')][_0xd84d69][_0xf34e('0x29')]](_0x2a2f03[_0xf34e('0x7a')][_0xd84d69][_0xf34e('0x7d')],null,util['format'](_0xf34e('0x7e'),_0x2a2f03[_0xf34e('0x7f')],_0x2a2f03[_0xf34e('0x7a')][_0xd84d69][_0xf34e('0x7c')],_0x2a2f03[_0xf34e('0x7a')][_0xd84d69][_0xf34e('0x7d')],_0x2a2f03[_0xf34e('0x7a')][_0xd84d69][_0xf34e('0x80')]));}}}if(_0x2a2f03[_0xf34e('0x81')]){_0x2a2f03[_0xf34e('0x81')]=JSON[_0xf34e('0x82')](_0x2a2f03['conditions']);_0xb80e75[_0xf34e('0x39')](_0x23cbd3(_0x2a2f03['conditions']['group']));}_0x7f4d4e=_0xb80e75['clone']();_0xb80e75[_0xf34e('0x37')](_0x20dca4);_0xb80e75['offset'](0x0);logger[_0xf34e('0x83')](_0xf34e('0x84'),_0xb80e75[_0xf34e('0x85')]());return dbH[_0xf34e('0x86')]['query'](_0xb80e75[_0xf34e('0x85')](),{'type':dbH[_0xf34e('0x86')][_0xf34e('0x87')][_0xf34e('0x88')]});}})[_0xf34e('0x21')](respondWithResult(_0x591bc1,null))[_0xf34e('0x42')](handleError(_0x591bc1,null));};function runReport(_0x3bbb26,_0x2e92e9,_0x509553){var _0x12d42d=_0x2e92e9[_0xf34e('0x2d')];var _0x4501ef=0xa;var _0x4a4a38=[_0xf34e('0x50'),_0xf34e('0x51'),_0xf34e('0x52'),'cross_join'];var _0x130a2e={'SUM':_0xf34e('0x54'),'COUNT':_0xf34e('0x55'),'COUNT DISTINCT':_0xf34e('0x56'),'MAX':_0xf34e('0x57'),'MIN':_0xf34e('0x58'),'AVG':_0xf34e('0x59'),'GROUP_CONCAT':_0xf34e('0x5a'),'GROUP_CONCAT ASC':_0xf34e('0x5b'),'GROUP_CONCAT DESC':_0xf34e('0x5c')};var _0x460dae={'SEC_TO_TIME':_0xf34e('0x5d'),'DATE':_0xf34e('0x5e'),'HOUR':_0xf34e('0x5f'),'ROUND':_0xf34e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4f94f0=function(_0x4e3dd6){return!_[_0xf34e('0x7b')]([_0xf34e('0x61'),_0xf34e('0x89'),_0xf34e('0x62'),'IS\x20NOT\x20EMPTY'],_0x4e3dd6);};var _0x51bf96=function(_0x469867){if(!_0x469867||!_0x469867[_0xf34e('0x64')][_0xf34e('0x34')]){return'';}for(var _0x296ec6='(',_0xc05561=0x0;_0xc05561<_0x469867[_0xf34e('0x64')]['length'];_0xc05561+=0x1){_0xc05561>0x0&&(_0x296ec6+='\x20'+_0x469867[_0xf34e('0x65')]+'\x20');_0x296ec6+=_0x469867['rules'][_0xc05561][_0xf34e('0x66')]?_0x51bf96(_0x469867['rules'][_0xc05561][_0xf34e('0x66')]):_0x469867[_0xf34e('0x64')][_0xc05561][_0xf34e('0x67')]+'\x20'+_0x469867[_0xf34e('0x64')][_0xc05561][_0xf34e('0x68')]+(_0x4f94f0(_0x469867[_0xf34e('0x64')][_0xc05561]['condition'])?'\x20'+_0x469867[_0xf34e('0x64')][_0xc05561][_0xf34e('0x69')]:'');}return _0x296ec6+')';};var _0x46f2b3={'where':{'id':_0x3bbb26['id']}},_0x540fee,_0x41573e,_0x352e83,_0x266855,_0x34a845;_0x46f2b3=_[_0xf34e('0x3b')]({},_0x46f2b3,_0x509553);return db['AnalyticCustomReport']['find'](_0x46f2b3)[_0xf34e('0x21')](function(_0x202788){if(_0x202788){_0x540fee=_0x202788;return _0x202788[_0xf34e('0x6a')]();}return null;})[_0xf34e('0x21')](function(_0x10c7f7){if(_0x10c7f7){if(!_0x10c7f7[_0xf34e('0x34')]){throw new db[(_0xf34e('0x6b'))]['ValidationErrorItem'](_0xf34e('0x8a'),0x193);}_0x41573e=_0x10c7f7;return db[_0xf34e('0x6d')][_0xf34e('0x40')]({'raw':!![]});}return null;})[_0xf34e('0x21')](function(_0x1e8504){if(_0x1e8504){_0x352e83=_[_0xf34e('0x6e')](_0x1e8504,'id');var _0x5bda60;var _0x2676ba=squel['select']();_0x2676ba[_0xf34e('0x70')](_0x540fee[_0xf34e('0x7f')]);for(var _0x28457a=0x0;_0x28457a<_0x41573e[_0xf34e('0x34')];_0x28457a+=0x1){_0x5bda60=_0x41573e[_0x28457a]['MetricId']?_0x352e83[_0x41573e[_0x28457a][_0xf34e('0x71')]][_0xf34e('0x72')]:_0x41573e[_0x28457a]['field'];_0x5bda60=_0x41573e[_0x28457a][_0xf34e('0x73')]?_[_0xf34e('0x74')](_0x130a2e[_0x41573e[_0x28457a][_0xf34e('0x73')]],'%s',_0x5bda60):_0x5bda60;_0x5bda60=_0x41573e[_0x28457a][_0xf34e('0x75')]?_[_0xf34e('0x74')](_0x460dae[_0x41573e[_0x28457a]['format']],'%s',_0x5bda60):_0x5bda60;if(_0x41573e[_0x28457a][_0xf34e('0x76')]){_0x2676ba[_0xf34e('0x66')](_0x5bda60);}_0x41573e[_0x28457a]['orderBy']&&_0x2676ba['order'](_0x5bda60,_0x41573e[_0x28457a][_0xf34e('0x77')]===_0xf34e('0x78')?![]:!![]);_0x2676ba[_0xf34e('0x67')](_0x5bda60,_0x41573e[_0x28457a][_0xf34e('0x79')]||_0x5bda60);}if(_0x540fee[_0xf34e('0x7a')]){_0x540fee[_0xf34e('0x7a')]=JSON[_0xf34e('0x82')](_0x540fee[_0xf34e('0x7a')]);for(var _0x14ac49=0x0;_0x14ac49<_0x540fee[_0xf34e('0x7a')]['length'];_0x14ac49+=0x1){if(_0x540fee['joins'][_0x14ac49]['type']&&_[_0xf34e('0x7b')](_0x4a4a38,_0x540fee[_0xf34e('0x7a')][_0x14ac49][_0xf34e('0x29')])&&_0x540fee[_0xf34e('0x7a')][_0x14ac49][_0xf34e('0x7c')]&&_0x540fee['joins'][_0x14ac49]['foreignTable']&&_0x540fee[_0xf34e('0x7a')][_0x14ac49][_0xf34e('0x80')]){_0x2676ba[_0x540fee[_0xf34e('0x7a')][_0x14ac49][_0xf34e('0x29')]](_0x540fee[_0xf34e('0x7a')][_0x14ac49][_0xf34e('0x7d')],null,util[_0xf34e('0x75')](_0xf34e('0x7e'),_0x540fee[_0xf34e('0x7f')],_0x540fee[_0xf34e('0x7a')][_0x14ac49][_0xf34e('0x7c')],_0x540fee[_0xf34e('0x7a')][_0x14ac49][_0xf34e('0x7d')],_0x540fee['joins'][_0x14ac49][_0xf34e('0x80')]));}}}if(_0x540fee[_0xf34e('0x81')]){_0x540fee[_0xf34e('0x81')]=JSON[_0xf34e('0x82')](_0x540fee[_0xf34e('0x81')]);_0x2676ba['where'](_0x51bf96(_0x540fee['conditions'][_0xf34e('0x66')]));}_0x34a845=_0x2676ba[_0xf34e('0x8b')]();_0x2676ba['limit'](_0x4501ef);_0x2676ba[_0xf34e('0x19')](0x0);return;}})['then'](function(){if(_0x2e92e9['output']===_0xf34e('0x8c')){return null;}var _0x3ac840=_['merge'](_0x2e92e9,{'name':_0x2e92e9['fullPath']||_0x2e92e9['name']||_0x540fee['name'],'basename':_0x12d42d,'savename':util[_0xf34e('0x75')](_0xf34e('0x8d'),_0x2e92e9[_0xf34e('0x2d')]||_0x540fee['name'],require(_0xf34e('0x8e'))[_0xf34e('0x8f')](0x4),_0x2e92e9[_0xf34e('0x90')]||_0xf34e('0x91')),'reportId':_0x540fee['id'],'reportType':_0xf34e('0x92')});return db['AnalyticExtractedReport'][_0xf34e('0x4b')](_0x3ac840,{'raw':!![]});})[_0xf34e('0x21')](function(_0x5b30b4){if(_0x540fee[_0xf34e('0x7f')]==='cdr'){_0x34a845[_0xf34e('0x39')](_0x540fee[_0xf34e('0x7f')]+_0xf34e('0x93'),_0x2e92e9['startDate'],_0x2e92e9[_0xf34e('0x94')]);}else{_0x34a845[_0xf34e('0x39')](_0x540fee[_0xf34e('0x7f')]+_0xf34e('0x95'),_0x2e92e9[_0xf34e('0x96')],_0x2e92e9[_0xf34e('0x94')]);}if(_0x5b30b4){logger[_0xf34e('0x97')](_0xf34e('0x98'),_0x34a845['toString']());require(_0xf34e('0x99'))[_0xf34e('0x9a')](path['join'](__dirname,_0xf34e('0x9b'),_0x5b30b4[_0xf34e('0x90')]),[_0x5b30b4['id'],_0x34a845[_0xf34e('0x85')](),path[_0xf34e('0x50')](__dirname,_0xf34e('0x9c'),_0x5b30b4[_0xf34e('0x9d')]),_0x12d42d]);return _0x5b30b4;}else{var _0x2bd63c=squel[_0xf34e('0x6f')]();_0x2bd63c[_0xf34e('0x70')]('('+_0x34a845[_0xf34e('0x85')]()+')','countTable');_0x2bd63c[_0xf34e('0x67')]('COUNT(*)',_0xf34e('0x1b'));_0x34a845[_0xf34e('0x37')](_0x2e92e9[_0xf34e('0x37')]||_0x4501ef);_0x34a845['offset'](_0x2e92e9[_0xf34e('0x19')]||0x0);return dbH[_0xf34e('0x86')][_0xf34e('0x2f')](_0x2bd63c[_0xf34e('0x85')](),{'type':dbH[_0xf34e('0x86')][_0xf34e('0x87')][_0xf34e('0x88')]})['then'](function(_0x19cb42){if(!_0x19cb42[_0xf34e('0x34')]){_0x266855=0x0;}else{_0x266855=_0x19cb42[0x0][_0xf34e('0x1b')]||0x0;}return dbH[_0xf34e('0x86')][_0xf34e('0x2f')](_0x34a845[_0xf34e('0x85')](),{'type':dbH[_0xf34e('0x86')]['QueryTypes'][_0xf34e('0x88')]});})[_0xf34e('0x21')](function(_0x114acf){return{'rows':_0x114acf||[],'count':_0x266855};});}});}exports[_0xf34e('0x9e')]=function(_0x484589,_0x257292){return runReport(_0x484589[_0xf34e('0x4e')],_0x484589[_0xf34e('0x2f')],_0x484589['options'])[_0xf34e('0x21')](respondWithResult(_0x257292,null))[_0xf34e('0x42')](handleError(_0x257292,null));};exports[_0xf34e('0x9f')]=runReport;exports['query']=function(_0x51cc3b,_0x296491){var _0x228c00=0xa;var _0x24cd25=[_0xf34e('0x50'),_0xf34e('0x51'),'right_join',_0xf34e('0x53')];var _0x15cd76={'SUM':_0xf34e('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf34e('0x56'),'MAX':_0xf34e('0x57'),'MIN':'MIN(%s)','AVG':_0xf34e('0x59'),'GROUP_CONCAT':_0xf34e('0x5a'),'GROUP_CONCAT ASC':_0xf34e('0x5b'),'GROUP_CONCAT DESC':_0xf34e('0x5c')};var _0x2018f1={'SEC_TO_TIME':_0xf34e('0x5d'),'DATE':'DATE(%s)','HOUR':_0xf34e('0x5f'),'ROUND':_0xf34e('0x60'),'UNIX_TIMESTAMP':_0xf34e('0xa0')};var _0x1be98f=function(_0x4e6130){return!_[_0xf34e('0x7b')]([_0xf34e('0x61'),_0xf34e('0x89'),'IS\x20EMPTY',_0xf34e('0x63')],_0x4e6130);};var _0x1c3005=function(_0x4c887b){if(!_0x4c887b||!_0x4c887b[_0xf34e('0x64')][_0xf34e('0x34')]){return'';}for(var _0x1397ec='(',_0x3566ca=0x0;_0x3566ca<_0x4c887b[_0xf34e('0x64')][_0xf34e('0x34')];_0x3566ca+=0x1){_0x3566ca>0x0&&(_0x1397ec+='\x20'+_0x4c887b[_0xf34e('0x65')]+'\x20');_0x1397ec+=_0x4c887b[_0xf34e('0x64')][_0x3566ca]['group']?_0x1c3005(_0x4c887b[_0xf34e('0x64')][_0x3566ca][_0xf34e('0x66')]):_0x4c887b[_0xf34e('0x64')][_0x3566ca][_0xf34e('0x67')]+'\x20'+_0x4c887b[_0xf34e('0x64')][_0x3566ca]['condition']+(_0x1be98f(_0x4c887b[_0xf34e('0x64')][_0x3566ca]['condition'])?'\x20'+_0x4c887b[_0xf34e('0x64')][_0x3566ca][_0xf34e('0x69')]:'');}return _0x1397ec+')';};var _0x1dfcef={'where':{'id':_0x51cc3b[_0xf34e('0x4e')]['id']}},_0x2dbb1c,_0x50cb17,_0x5294f0,_0x129395,_0x329f3b;_0x1dfcef=_['merge']({},_0x1dfcef,_0x51cc3b['options']);return db['AnalyticCustomReport'][_0xf34e('0x43')](_0x1dfcef)[_0xf34e('0x21')](function(_0x2f206e){if(_0x2f206e){_0x2dbb1c=_0x2f206e;return _0x2f206e['getFields']();}return null;})[_0xf34e('0x21')](function(_0x357bbc){if(_0x357bbc){if(!_0x357bbc[_0xf34e('0x34')]){throw new db[(_0xf34e('0x6b'))][(_0xf34e('0x6c'))](_0xf34e('0x8a'),0x193);}_0x50cb17=_0x357bbc;return db[_0xf34e('0x6d')][_0xf34e('0x40')]({'raw':!![]});}return null;})[_0xf34e('0x21')](function(_0x34d9fa){if(_0x34d9fa){_0x5294f0=_[_0xf34e('0x6e')](_0x34d9fa,'id');var _0x319be5;var _0x428a56=squel['select']();_0x428a56[_0xf34e('0x70')](_0x2dbb1c[_0xf34e('0x7f')]);for(var _0x221716=0x0;_0x221716<_0x50cb17[_0xf34e('0x34')];_0x221716+=0x1){_0x319be5=_0x50cb17[_0x221716][_0xf34e('0x71')]?_0x5294f0[_0x50cb17[_0x221716][_0xf34e('0x71')]][_0xf34e('0x72')]:_0x50cb17[_0x221716][_0xf34e('0x67')];_0x319be5=_0x50cb17[_0x221716]['function']?_[_0xf34e('0x74')](_0x15cd76[_0x50cb17[_0x221716][_0xf34e('0x73')]],'%s',_0x319be5):_0x319be5;_0x319be5=_0x50cb17[_0x221716][_0xf34e('0x75')]?_[_0xf34e('0x74')](_0x2018f1[_0x50cb17[_0x221716][_0xf34e('0x75')]],'%s',_0x319be5):_0x319be5;if(_0x50cb17[_0x221716][_0xf34e('0x76')]){_0x428a56['group'](_0x319be5);}_0x50cb17[_0x221716]['orderBy']&&_0x428a56[_0xf34e('0xa1')](_0x319be5,_0x50cb17[_0x221716][_0xf34e('0x77')]===_0xf34e('0x78')?![]:!![]);_0x428a56[_0xf34e('0x67')](_0x319be5,_0x50cb17[_0x221716]['alias']||_0x319be5);}if(_0x2dbb1c[_0xf34e('0x7a')]){_0x2dbb1c[_0xf34e('0x7a')]=JSON[_0xf34e('0x82')](_0x2dbb1c['joins']);for(var _0xfbb3fe=0x0;_0xfbb3fe<_0x2dbb1c['joins'][_0xf34e('0x34')];_0xfbb3fe+=0x1){if(_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe]['type']&&_[_0xf34e('0x7b')](_0x24cd25,_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe][_0xf34e('0x29')])&&_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe][_0xf34e('0x7c')]&&_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe][_0xf34e('0x7d')]&&_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe]['foreignKey']){_0x428a56[_0x2dbb1c['joins'][_0xfbb3fe][_0xf34e('0x29')]](_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe][_0xf34e('0x7d')],null,util[_0xf34e('0x75')](_0xf34e('0x7e'),_0x2dbb1c[_0xf34e('0x7f')],_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe][_0xf34e('0x7c')],_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe][_0xf34e('0x7d')],_0x2dbb1c[_0xf34e('0x7a')][_0xfbb3fe][_0xf34e('0x80')]));}}}if(_0x2dbb1c['conditions']){_0x2dbb1c[_0xf34e('0x81')]=JSON['parse'](_0x2dbb1c['conditions']);_0x428a56['where'](_0x1c3005(_0x2dbb1c[_0xf34e('0x81')]['group']));}_0x329f3b=_0x428a56['clone']();_0x428a56[_0xf34e('0x37')](_0x228c00);_0x428a56[_0xf34e('0x19')](0x0);logger[_0xf34e('0x83')](_0xf34e('0x84'),_0x428a56[_0xf34e('0x85')]());return dbH['sequelize']['query'](_0x428a56['toString'](),{'type':dbH[_0xf34e('0x86')][_0xf34e('0x87')][_0xf34e('0x88')]});}})[_0xf34e('0x21')](function(){return{'sql':_0x329f3b['toString']()};})[_0xf34e('0x21')](respondWithResult(_0x296491,null))[_0xf34e('0x42')](handleError(_0x296491,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 8922252..d2689ff 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 _0xc556=['../../config/logger','moment','bluebird','request-promise','path','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x548074,_0x26c4c1){var _0x60ecd=function(_0x29e252){while(--_0x29e252){_0x548074['push'](_0x548074['shift']());}};_0x60ecd(++_0x26c4c1);}(_0xc556,0x1d4));var _0x6c55=function(_0x5a7fc4,_0x2bf516){_0x5a7fc4=_0x5a7fc4-0x0;var _0x13cb0f=_0xc556[_0x5a7fc4];return _0x13cb0f;};'use strict';var _=require(_0x6c55('0x0'));var util=require(_0x6c55('0x1'));var logger=require(_0x6c55('0x2'))('api');var moment=require(_0x6c55('0x3'));var BPromise=require(_0x6c55('0x4'));var rp=require(_0x6c55('0x5'));var fs=require('fs');var path=require(_0x6c55('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x6c55('0x7')]=function(_0x5b6678,_0x160ac0){return _0x5b6678['define'](_0x6c55('0x8'),attributes,{'tableName':_0x6c55('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad96=['exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xad96,0x19b));var _0x6ad9=function(_0x39e1f0,_0x560848){_0x39e1f0=_0x39e1f0-0x0;var _0x240e82=_0xad96[_0x39e1f0];return _0x240e82;};'use strict';var _=require(_0x6ad9('0x0'));var util=require(_0x6ad9('0x1'));var logger=require(_0x6ad9('0x2'))(_0x6ad9('0x3'));var moment=require(_0x6ad9('0x4'));var BPromise=require(_0x6ad9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ad9('0x6'));var rimraf=require(_0x6ad9('0x7'));var config=require(_0x6ad9('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x6ad9('0x9')]=function(_0x4214ce,_0x357105){return _0x4214ce[_0x6ad9('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x6ad9('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 77727d3..9b2a48f 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 _0x6fea=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0xdcc00d,_0x593f16){var _0x5a537d=function(_0x212d18){while(--_0x212d18){_0xdcc00d['push'](_0xdcc00d['shift']());}};_0x5a537d(++_0x593f16);}(_0x6fea,0xf1));var _0xa6fe=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x6fea[_0x3e6729];return _0x535bcd;};'use strict';var _=require(_0xa6fe('0x0'));var util=require('util');var moment=require(_0xa6fe('0x1'));var BPromise=require(_0xa6fe('0x2'));var rs=require(_0xa6fe('0x3'));var fs=require('fs');var Redis=require(_0xa6fe('0x4'));var db=require(_0xa6fe('0x5'))['db'];var utils=require(_0xa6fe('0x6'));var logger=require(_0xa6fe('0x7'))(_0xa6fe('0x8'));var config=require(_0xa6fe('0x9'));var jayson=require(_0xa6fe('0xa'));var client=jayson['client'][_0xa6fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x111e65,_0x359206,_0x67c4bf){return new BPromise(function(_0x21e194,_0x581ced){return client[_0xa6fe('0xc')](_0x111e65,_0x67c4bf)[_0xa6fe('0xd')](function(_0x141ff7){logger['info'](_0xa6fe('0xe'),_0x359206,_0xa6fe('0xf'));logger[_0xa6fe('0x10')](_0xa6fe('0x11'),_0x359206,_0xa6fe('0xf'),JSON['stringify'](_0x141ff7));if(_0x141ff7['error']){if(_0x141ff7[_0xa6fe('0x12')][_0xa6fe('0x13')]===0x1f4){logger[_0xa6fe('0x12')](_0xa6fe('0xe'),_0x359206,_0x141ff7['error'][_0xa6fe('0x14')]);return _0x581ced(_0x141ff7[_0xa6fe('0x12')]['message']);}logger['error'](_0xa6fe('0xe'),_0x359206,_0x141ff7[_0xa6fe('0x12')][_0xa6fe('0x14')]);return _0x21e194(_0x141ff7[_0xa6fe('0x12')]['message']);}else{logger[_0xa6fe('0x15')](_0xa6fe('0xe'),_0x359206,_0xa6fe('0xf'));_0x21e194(_0x141ff7[_0xa6fe('0x16')][_0xa6fe('0x14')]);}})[_0xa6fe('0x17')](function(_0x1c5e22){logger[_0xa6fe('0x12')](_0xa6fe('0xe'),_0x359206,_0x1c5e22);_0x581ced(_0x1c5e22);});});} \ No newline at end of file +var _0xbd80=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x25341e,_0x227a2d){var _0xfb3818=function(_0x5f4d6f){while(--_0x5f4d6f){_0x25341e['push'](_0x25341e['shift']());}};_0xfb3818(++_0x227a2d);}(_0xbd80,0x1e7));var _0x0bd8=function(_0x3e93d7,_0x2256d0){_0x3e93d7=_0x3e93d7-0x0;var _0x5407a9=_0xbd80[_0x3e93d7];return _0x5407a9;};'use strict';var _=require(_0x0bd8('0x0'));var util=require(_0x0bd8('0x1'));var moment=require(_0x0bd8('0x2'));var BPromise=require(_0x0bd8('0x3'));var rs=require(_0x0bd8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0bd8('0x5'));var logger=require(_0x0bd8('0x6'))(_0x0bd8('0x7'));var config=require(_0x0bd8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0bd8('0x9')][_0x0bd8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1330ef,_0x269538,_0x12d9f7){return new BPromise(function(_0x497c14,_0x41e3ca){return client[_0x0bd8('0xb')](_0x1330ef,_0x12d9f7)[_0x0bd8('0xc')](function(_0x3da307){logger['info'](_0x0bd8('0xd'),_0x269538,_0x0bd8('0xe'));logger[_0x0bd8('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x269538,_0x0bd8('0xe'),JSON[_0x0bd8('0x10')](_0x3da307));if(_0x3da307[_0x0bd8('0x11')]){if(_0x3da307['error'][_0x0bd8('0x12')]===0x1f4){logger[_0x0bd8('0x11')](_0x0bd8('0xd'),_0x269538,_0x3da307['error'][_0x0bd8('0x13')]);return _0x41e3ca(_0x3da307[_0x0bd8('0x11')][_0x0bd8('0x13')]);}logger[_0x0bd8('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x269538,_0x3da307[_0x0bd8('0x11')]['message']);return _0x497c14(_0x3da307['error'][_0x0bd8('0x13')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x269538,_0x0bd8('0xe'));_0x497c14(_0x3da307[_0x0bd8('0x14')]['message']);}})[_0x0bd8('0x15')](function(_0x39d0d5){logger[_0x0bd8('0x11')](_0x0bd8('0xd'),_0x269538,_0x39d0d5);_0x41e3ca(_0x39d0d5);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 6b917f7..c687ed1 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 _0x0b39=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','run','/:id/query','post','create','put','update','delete'];(function(_0x29f014,_0x508522){var _0x316be5=function(_0x1753a5){while(--_0x1753a5){_0x29f014['push'](_0x29f014['shift']());}};_0x316be5(++_0x508522);}(_0x0b39,0xda));var _0x90b3=function(_0x406ee6,_0x4fb919){_0x406ee6=_0x406ee6-0x0;var _0x5aa0d7=_0x0b39[_0x406ee6];return _0x5aa0d7;};'use strict';var multer=require(_0x90b3('0x0'));var util=require(_0x90b3('0x1'));var path=require(_0x90b3('0x2'));var timeout=require(_0x90b3('0x3'));var express=require(_0x90b3('0x4'));var router=express['Router']();var fs_extra=require(_0x90b3('0x5'));var auth=require(_0x90b3('0x6'));var interaction=require(_0x90b3('0x7'));var config=require(_0x90b3('0x8'));var controller=require(_0x90b3('0x9'));router[_0x90b3('0xa')]('/',auth[_0x90b3('0xb')](),controller['index']);router['get'](_0x90b3('0xc'),auth[_0x90b3('0xb')](),controller['show']);router[_0x90b3('0xa')](_0x90b3('0xd'),auth[_0x90b3('0xb')](),controller[_0x90b3('0xe')]);router['get']('/:id/run',auth[_0x90b3('0xb')](),controller[_0x90b3('0xf')]);router[_0x90b3('0xa')](_0x90b3('0x10'),auth[_0x90b3('0xb')](),controller['query']);router[_0x90b3('0x11')]('/',auth[_0x90b3('0xb')](),controller[_0x90b3('0x12')]);router[_0x90b3('0x13')]('/:id',auth[_0x90b3('0xb')](),controller[_0x90b3('0x14')]);router[_0x90b3('0x15')](_0x90b3('0xc'),auth['isAuthenticated'](),controller[_0x90b3('0x16')]);module[_0x90b3('0x17')]=router; \ No newline at end of file +var _0x2b7e=['fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x55f170,_0x5dc684){var _0x33a622=function(_0x1f50ce){while(--_0x1f50ce){_0x55f170['push'](_0x55f170['shift']());}};_0x33a622(++_0x5dc684);}(_0x2b7e,0x1b4));var _0xe2b7=function(_0x208b98,_0x33d59e){_0x208b98=_0x208b98-0x0;var _0x31408b=_0x2b7e[_0x208b98];return _0x31408b;};'use strict';var multer=require(_0xe2b7('0x0'));var util=require(_0xe2b7('0x1'));var path=require(_0xe2b7('0x2'));var timeout=require(_0xe2b7('0x3'));var express=require(_0xe2b7('0x4'));var router=express[_0xe2b7('0x5')]();var fs_extra=require(_0xe2b7('0x6'));var auth=require(_0xe2b7('0x7'));var interaction=require(_0xe2b7('0x8'));var config=require('../../config/environment');var controller=require(_0xe2b7('0x9'));router[_0xe2b7('0xa')]('/',auth[_0xe2b7('0xb')](),controller['index']);router[_0xe2b7('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe2b7('0xc')]);router['get'](_0xe2b7('0xd'),auth['isAuthenticated'](),controller[_0xe2b7('0xe')]);router[_0xe2b7('0xa')](_0xe2b7('0xf'),auth[_0xe2b7('0xb')](),controller[_0xe2b7('0x10')]);router['get'](_0xe2b7('0x11'),auth['isAuthenticated'](),controller[_0xe2b7('0x12')]);router[_0xe2b7('0x13')]('/',auth[_0xe2b7('0xb')](),controller[_0xe2b7('0x14')]);router[_0xe2b7('0x15')](_0xe2b7('0x16'),auth[_0xe2b7('0xb')](),controller[_0xe2b7('0x17')]);router[_0xe2b7('0x18')](_0xe2b7('0x16'),auth[_0xe2b7('0xb')](),controller[_0xe2b7('0x19')]);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 f9883f9..81d1062 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 _0x33c5=['STRING','TEXT','exports'];(function(_0x282dc3,_0x4a8bab){var _0xaf13af=function(_0xca680a){while(--_0xca680a){_0x282dc3['push'](_0x282dc3['shift']());}};_0xaf13af(++_0x4a8bab);}(_0x33c5,0xe6));var _0x533c=function(_0x26299e,_0x394ad1){_0x26299e=_0x26299e-0x0;var _0x6c4f4a=_0x33c5[_0x26299e];return _0x6c4f4a;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}}; \ No newline at end of file +var _0xda19=['exports','STRING','TEXT'];(function(_0x26ae75,_0x1085ac){var _0x194ebd=function(_0x4a0aa7){while(--_0x4a0aa7){_0x26ae75['push'](_0x26ae75['shift']());}};_0x194ebd(++_0x1085ac);}(_0xda19,0xd5));var _0x9da1=function(_0xdad321,_0x43f77b){_0xdad321=_0xdad321-0x0;var _0x559d84=_0xda19[_0xdad321];return _0x559d84;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 307174e..6690883 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','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','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x382567,_0x33ce26){var _0x23a460=function(_0x5c0471){while(--_0x5c0471){_0x382567['push'](_0x382567['shift']());}};_0x23a460(++_0x33ce26);}(_0x53ec,0x192));var _0xc53e=function(_0x25a6a7,_0x1986cb){_0x25a6a7=_0x25a6a7-0x0;var _0x20cfd1=_0x53ec[_0x25a6a7];return _0x20cfd1;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index d1d0ff2..d74972f 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 _0x4269=['util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x4269,0x172));var _0x9426=function(_0x50667a,_0x86eb28){_0x50667a=_0x50667a-0x0;var _0x4987e5=_0x4269[_0x50667a];return _0x4987e5;};'use strict';var _=require('lodash');var util=require(_0x9426('0x0'));var logger=require(_0x9426('0x1'))(_0x9426('0x2'));var moment=require(_0x9426('0x3'));var BPromise=require(_0x9426('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9426('0x5'));var rimraf=require(_0x9426('0x6'));var config=require('../../config/environment');var attributes=require(_0x9426('0x7'));module[_0x9426('0x8')]=function(_0x1d9329,_0x55e77e){return _0x1d9329[_0x9426('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28d1=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x50667a,_0x86eb28){var _0x4987e5=function(_0x4482b1){while(--_0x4482b1){_0x50667a['push'](_0x50667a['shift']());}};_0x4987e5(++_0x86eb28);}(_0x28d1,0xb3));var _0x128d=function(_0x2c2cbe,_0x2c4955){_0x2c2cbe=_0x2c2cbe-0x0;var _0x4a6cd3=_0x28d1[_0x2c2cbe];return _0x4a6cd3;};'use strict';var _=require(_0x128d('0x0'));var util=require(_0x128d('0x1'));var logger=require(_0x128d('0x2'))(_0x128d('0x3'));var moment=require(_0x128d('0x4'));var BPromise=require(_0x128d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x128d('0x6'));var rimraf=require('rimraf');var config=require(_0x128d('0x7'));var attributes=require(_0x128d('0x8'));module['exports']=function(_0x1fc787,_0x1a23d0){return _0x1fc787[_0x128d('0x9')](_0x128d('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index d650ee6..ff168d9 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 _0x8a8b=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x8a8b,0x1e0));var _0xb8a8=function(_0x11bfc6,_0x350748){_0x11bfc6=_0x11bfc6-0x0;var _0x3f4837=_0x8a8b[_0x11bfc6];return _0x3f4837;};'use strict';var _=require(_0xb8a8('0x0'));var util=require(_0xb8a8('0x1'));var moment=require(_0xb8a8('0x2'));var BPromise=require(_0xb8a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8a8('0x4'));var db=require(_0xb8a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8a8('0x6'))('rpc');var config=require(_0xb8a8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb8a8('0x8')][_0xb8a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4be915,_0x5d5a4e,_0x5c6703){return new BPromise(function(_0x3568a3,_0x5834a1){return client['request'](_0x4be915,_0x5c6703)[_0xb8a8('0xa')](function(_0x16d038){logger['info'](_0xb8a8('0xb'),_0x5d5a4e,'request\x20sent');logger[_0xb8a8('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x5d5a4e,_0xb8a8('0xd'),JSON['stringify'](_0x16d038));if(_0x16d038['error']){if(_0x16d038[_0xb8a8('0xe')][_0xb8a8('0xf')]===0x1f4){logger[_0xb8a8('0xe')](_0xb8a8('0xb'),_0x5d5a4e,_0x16d038[_0xb8a8('0xe')]['message']);return _0x5834a1(_0x16d038[_0xb8a8('0xe')][_0xb8a8('0x10')]);}logger[_0xb8a8('0xe')](_0xb8a8('0xb'),_0x5d5a4e,_0x16d038[_0xb8a8('0xe')][_0xb8a8('0x10')]);return _0x3568a3(_0x16d038[_0xb8a8('0xe')][_0xb8a8('0x10')]);}else{logger[_0xb8a8('0x11')](_0xb8a8('0xb'),_0x5d5a4e,_0xb8a8('0xd'));_0x3568a3(_0x16d038[_0xb8a8('0x12')][_0xb8a8('0x10')]);}})[_0xb8a8('0x13')](function(_0x11d36d){logger[_0xb8a8('0xe')](_0xb8a8('0xb'),_0x5d5a4e,_0x11d36d);_0x5834a1(_0x11d36d);});});} \ No newline at end of file +var _0xa97c=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request\x20sent','debug'];(function(_0x1d1d17,_0x15315e){var _0x4393c6=function(_0x4e54d1){while(--_0x4e54d1){_0x1d1d17['push'](_0x1d1d17['shift']());}};_0x4393c6(++_0x15315e);}(_0xa97c,0x16f));var _0xca97=function(_0x87fe28,_0x112ad7){_0x87fe28=_0x87fe28-0x0;var _0x1067e7=_0xa97c[_0x87fe28];return _0x1067e7;};'use strict';var _=require(_0xca97('0x0'));var util=require(_0xca97('0x1'));var moment=require(_0xca97('0x2'));var BPromise=require(_0xca97('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca97('0x4'));var db=require(_0xca97('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xca97('0x6'));var jayson=require(_0xca97('0x7'));var client=jayson[_0xca97('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x330209,_0x26a44d,_0x416ff1){return new BPromise(function(_0x426e80,_0x5cb691){return client['request'](_0x330209,_0x416ff1)['then'](function(_0x19d1db){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x26a44d,_0xca97('0x9'));logger[_0xca97('0xa')](_0xca97('0xb'),_0x26a44d,'request\x20sent',JSON[_0xca97('0xc')](_0x19d1db));if(_0x19d1db[_0xca97('0xd')]){if(_0x19d1db[_0xca97('0xd')]['code']===0x1f4){logger[_0xca97('0xd')](_0xca97('0xe'),_0x26a44d,_0x19d1db[_0xca97('0xd')]['message']);return _0x5cb691(_0x19d1db[_0xca97('0xd')][_0xca97('0xf')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x26a44d,_0x19d1db[_0xca97('0xd')][_0xca97('0xf')]);return _0x426e80(_0x19d1db[_0xca97('0xd')][_0xca97('0xf')]);}else{logger['info'](_0xca97('0xe'),_0x26a44d,_0xca97('0x9'));_0x426e80(_0x19d1db[_0xca97('0x10')]['message']);}})[_0xca97('0x11')](function(_0x2ebe49){logger[_0xca97('0xd')](_0xca97('0xe'),_0x26a44d,_0x2ebe49);_0x5cb691(_0x2ebe49);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index c26fdc4..9485efc 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 _0x57d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','put','update','/:id','destroy','multer','path','connect-timeout','express'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x57d1,0x104));var _0x157d=function(_0x2bf19e,_0x5d3307){_0x2bf19e=_0x2bf19e-0x0;var _0x576553=_0x57d1[_0x2bf19e];return _0x576553;};'use strict';var multer=require(_0x157d('0x0'));var util=require('util');var path=require(_0x157d('0x1'));var timeout=require(_0x157d('0x2'));var express=require(_0x157d('0x3'));var router=express['Router']();var fs_extra=require(_0x157d('0x4'));var auth=require(_0x157d('0x5'));var interaction=require(_0x157d('0x6'));var config=require(_0x157d('0x7'));var controller=require(_0x157d('0x8'));router[_0x157d('0x9')]('/',auth[_0x157d('0xa')](),controller[_0x157d('0xb')]);router[_0x157d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x157d('0xc')]);router[_0x157d('0x9')](_0x157d('0xd'),auth[_0x157d('0xa')](),controller[_0x157d('0xe')]);router[_0x157d('0x9')](_0x157d('0xf'),auth['isAuthenticated'](),controller[_0x157d('0x10')]);router[_0x157d('0x9')](_0x157d('0x11'),auth[_0x157d('0xa')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x157d('0x12')]('/:id',auth[_0x157d('0xa')](),controller[_0x157d('0x13')]);router['delete'](_0x157d('0x14'),auth[_0x157d('0xa')](),controller[_0x157d('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa648=['update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','post','create','put'];(function(_0x3b8453,_0x12b2e1){var _0x2b0206=function(_0x1183ef){while(--_0x1183ef){_0x3b8453['push'](_0x3b8453['shift']());}};_0x2b0206(++_0x12b2e1);}(_0xa648,0xf6));var _0x8a64=function(_0x715e6e,_0x2ee4cd){_0x715e6e=_0x715e6e-0x0;var _0x1f15a3=_0xa648[_0x715e6e];return _0x1f15a3;};'use strict';var multer=require(_0x8a64('0x0'));var util=require(_0x8a64('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8a64('0x2'));var router=express[_0x8a64('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8a64('0x4'));var interaction=require(_0x8a64('0x5'));var config=require(_0x8a64('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x8a64('0x7')]('/',auth['isAuthenticated'](),controller[_0x8a64('0x8')]);router[_0x8a64('0x7')](_0x8a64('0x9'),auth[_0x8a64('0xa')](),controller[_0x8a64('0xb')]);router[_0x8a64('0x7')](_0x8a64('0xc'),auth[_0x8a64('0xa')](),controller['preview']);router['get'](_0x8a64('0xd'),auth[_0x8a64('0xa')](),controller[_0x8a64('0xe')]);router[_0x8a64('0x7')]('/:id/query',auth[_0x8a64('0xa')](),controller['query']);router[_0x8a64('0xf')]('/',auth[_0x8a64('0xa')](),controller[_0x8a64('0x10')]);router[_0x8a64('0x11')](_0x8a64('0x9'),auth['isAuthenticated'](),controller[_0x8a64('0x12')]);router[_0x8a64('0x13')](_0x8a64('0x9'),auth[_0x8a64('0xa')](),controller[_0x8a64('0x14')]);module[_0x8a64('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 17c46ec..fefdacb 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 _0x4d84=['DATE','manual','scheduled','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4d84,0x190));var _0x44d8=function(_0x571edb,_0x5a648d){_0x571edb=_0x571edb-0x0;var _0x2a682e=_0x4d84[_0x571edb];return _0x2a682e;};'use strict';var Sequelize=require(_0x44d8('0x0'));var moment=require('moment');module[_0x44d8('0x1')]={'name':{'type':Sequelize[_0x44d8('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x44d8('0x3')](_0x44d8('0x4'),_0x44d8('0x5'),_0x44d8('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x44d8('0x7')]},'status':{'type':Sequelize[_0x44d8('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x44d8('0x3')](_0x44d8('0x8'),_0x44d8('0x9')),'allowNull':![],'defaultValue':_0x44d8('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x44d8('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x609c=['pdf','csv','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','STRING','ENUM'];(function(_0x3c80fe,_0x34b69b){var _0xc341ab=function(_0x4b4b56){while(--_0x4b4b56){_0x3c80fe['push'](_0x3c80fe['shift']());}};_0xc341ab(++_0x34b69b);}(_0x609c,0x1c9));var _0xc609=function(_0x4580b3,_0x2fc04e){_0x4580b3=_0x4580b3-0x0;var _0x2622d5=_0x609c[_0x4580b3];return _0x2622d5;};'use strict';var Sequelize=require(_0xc609('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xc609('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xc609('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xc609('0x2')]('csv',_0xc609('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0xc609('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xc609('0x5')]},'status':{'type':Sequelize[_0xc609('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xc609('0x2')](_0xc609('0x6'),_0xc609('0x7')),'allowNull':![],'defaultValue':_0xc609('0x6')},'reportId':{'type':Sequelize[_0xc609('0x8')](0xb)[_0xc609('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 072d513..d87a6f8 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 _0x53dc=['type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','AnalyticExtractedReport','rawAttributes','fieldName'];(function(_0x27ec4f,_0x205ae1){var _0x15804c=function(_0x232813){while(--_0x232813){_0x27ec4f['push'](_0x27ec4f['shift']());}};_0x15804c(++_0x205ae1);}(_0x53dc,0x8c));var _0xc53d=function(_0x5c2c07,_0x71da22){_0x5c2c07=_0x5c2c07-0x0;var _0x4147b4=_0x53dc[_0x5c2c07];return _0x4147b4;};'use strict';var emlformat=require(_0xc53d('0x0'));var rimraf=require(_0xc53d('0x1'));var zipdir=require(_0xc53d('0x2'));var jsonpatch=require(_0xc53d('0x3'));var rp=require('request-promise');var moment=require(_0xc53d('0x4'));var BPromise=require(_0xc53d('0x5'));var Mustache=require(_0xc53d('0x6'));var util=require(_0xc53d('0x7'));var path=require('path');var sox=require(_0xc53d('0x8'));var csv=require(_0xc53d('0x9'));var ejs=require(_0xc53d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53d('0xb'));var squel=require(_0xc53d('0xc'));var crypto=require(_0xc53d('0xd'));var jsforce=require(_0xc53d('0xe'));var deskjs=require(_0xc53d('0xf'));var toCsv=require(_0xc53d('0x9'));var querystring=require(_0xc53d('0x10'));var Papa=require(_0xc53d('0x11'));var Redis=require('ioredis');var authService=require(_0xc53d('0x12'));var qs=require(_0xc53d('0x13'));var as=require(_0xc53d('0x14'));var hardwareService=require(_0xc53d('0x15'));var logger=require('../../config/logger')(_0xc53d('0x16'));var utils=require(_0xc53d('0x17'));var config=require(_0xc53d('0x18'));var licenseUtil=require(_0xc53d('0x19'));var db=require(_0xc53d('0x1a'))['db'];function respondWithStatusCode(_0x2aab29,_0x4310d8){_0x4310d8=_0x4310d8||0xcc;return function(_0x35b3be){if(_0x35b3be){return _0x2aab29[_0xc53d('0x1b')](_0x4310d8);}return _0x2aab29['status'](_0x4310d8)['end']();};}function respondWithResult(_0x355f7f,_0x1b7c0e){_0x1b7c0e=_0x1b7c0e||0xc8;return function(_0x8599bc){if(_0x8599bc){return _0x355f7f[_0xc53d('0x1c')](_0x1b7c0e)[_0xc53d('0x1d')](_0x8599bc);}};}function respondWithFilteredResult(_0x305ccd,_0x344e5f){return function(_0x48b18c){if(_0x48b18c){var _0x2be176=typeof _0x344e5f[_0xc53d('0x1e')]===_0xc53d('0x1f')&&typeof _0x344e5f[_0xc53d('0x20')]===_0xc53d('0x1f');var _0x45150d=_0x48b18c[_0xc53d('0x21')];var _0x171bec=_0x2be176?0x0:_0x344e5f['offset'];var _0x13d007=_0x2be176?_0x48b18c[_0xc53d('0x21')]:_0x344e5f[_0xc53d('0x1e')]+_0x344e5f[_0xc53d('0x20')];var _0xf39dfc;if(_0x13d007>=_0x45150d){_0x13d007=_0x45150d;_0xf39dfc=0xc8;}else{_0xf39dfc=0xce;}_0x305ccd[_0xc53d('0x1c')](_0xf39dfc);return _0x305ccd[_0xc53d('0x22')]('Content-Range',_0x171bec+'-'+_0x13d007+'/'+_0x45150d)[_0xc53d('0x1d')](_0x48b18c);}return null;};}function patchUpdates(_0x577f6f){return function(_0x3aaa76){try{jsonpatch[_0xc53d('0x23')](_0x3aaa76,_0x577f6f,!![]);}catch(_0x1d0a02){return BPromise['reject'](_0x1d0a02);}return _0x3aaa76['save']();};}function saveUpdates(_0x33b22b,_0x1f3e35){return function(_0xbfb092){if(_0xbfb092){return _0xbfb092[_0xc53d('0x24')](_0x33b22b)[_0xc53d('0x25')](function(_0x43e5d1){return _0x43e5d1;});}return null;};}function removeEntity(_0x40dfbd,_0x985df4){return function(_0x38d640){if(_0x38d640){return _0x38d640[_0xc53d('0x26')]()['then'](function(){var _0x3d97e4=_0x38d640[_0xc53d('0x27')]({'plain':!![]});var _0x2f3c0b=_0xc53d('0x28');return db[_0xc53d('0x29')][_0xc53d('0x26')]({'where':{'type':_0x2f3c0b,'resourceId':_0x3d97e4['id']}})[_0xc53d('0x25')](function(){return _0x38d640;});})[_0xc53d('0x25')](function(){_0x40dfbd[_0xc53d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5db7fc,_0x5009c3){return function(_0x2790d0){if(!_0x2790d0){_0x5db7fc['sendStatus'](0x194);}return _0x2790d0;};}function handleError(_0x134a2e,_0x41fa47){_0x41fa47=_0x41fa47||0x1f4;return function(_0x58a00d){logger[_0xc53d('0x2a')](_0x58a00d['stack']);if(_0x58a00d['name']){delete _0x58a00d[_0xc53d('0x2b')];}_0x134a2e['status'](_0x41fa47)[_0xc53d('0x2c')](_0x58a00d);};}exports['index']=function(_0x17417c,_0x15465){var _0x43e5e9={},_0x226285={},_0x2e7090={'count':0x0,'rows':[]};var _0x4cce9d=_['map'](db[_0xc53d('0x2d')][_0xc53d('0x2e')],function(_0x17063a){return{'name':_0x17063a[_0xc53d('0x2f')],'type':_0x17063a[_0xc53d('0x30')][_0xc53d('0x31')]};});_0x226285[_0xc53d('0x32')]=_[_0xc53d('0x33')](_0x4cce9d,_0xc53d('0x2b'));_0x226285[_0xc53d('0x34')]=_['keys'](_0x17417c[_0xc53d('0x34')]);_0x226285[_0xc53d('0x35')]=_[_0xc53d('0x36')](_0x226285[_0xc53d('0x32')],_0x226285[_0xc53d('0x34')]);_0x43e5e9['attributes']=_[_0xc53d('0x36')](_0x226285[_0xc53d('0x32')],qs['fields'](_0x17417c[_0xc53d('0x34')][_0xc53d('0x37')]));_0x43e5e9['attributes']=_0x43e5e9[_0xc53d('0x38')]['length']?_0x43e5e9[_0xc53d('0x38')]:_0x226285[_0xc53d('0x32')];if(!_0x17417c['query'][_0xc53d('0x39')](_0xc53d('0x3a'))){_0x43e5e9[_0xc53d('0x20')]=qs[_0xc53d('0x20')](_0x17417c[_0xc53d('0x34')][_0xc53d('0x20')]);_0x43e5e9[_0xc53d('0x1e')]=qs[_0xc53d('0x1e')](_0x17417c['query'][_0xc53d('0x1e')]);}_0x43e5e9['order']=qs[_0xc53d('0x3b')](_0x17417c[_0xc53d('0x34')][_0xc53d('0x3b')]);_0x43e5e9['where']=qs[_0xc53d('0x35')](_[_0xc53d('0x3c')](_0x17417c[_0xc53d('0x34')],_0x226285[_0xc53d('0x35')]),_0x4cce9d);if(_0x17417c['query'][_0xc53d('0x3d')]){_0x43e5e9['where']=_[_0xc53d('0x3e')](_0x43e5e9['where'],{'$or':_[_0xc53d('0x33')](_0x4cce9d,function(_0x3d3081){if(_0x3d3081['type']!=='VIRTUAL'){var _0xeeeb7a={};_0xeeeb7a[_0x3d3081[_0xc53d('0x2b')]]={'$like':'%'+_0x17417c['query'][_0xc53d('0x3d')]+'%'};return _0xeeeb7a;}})});}_0x43e5e9=_['merge']({},_0x43e5e9,_0x17417c[_0xc53d('0x3f')]);var _0x2e63e4={'where':_0x43e5e9[_0xc53d('0x40')]};return db[_0xc53d('0x2d')][_0xc53d('0x21')](_0x2e63e4)[_0xc53d('0x25')](function(_0x35b8e4){_0x2e7090[_0xc53d('0x21')]=_0x35b8e4;if(_0x17417c[_0xc53d('0x34')][_0xc53d('0x41')]){_0x43e5e9[_0xc53d('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xc53d('0x43')](_0x43e5e9);})[_0xc53d('0x25')](function(_0xa35a14){_0x2e7090[_0xc53d('0x44')]=_0xa35a14;return _0x2e7090;})[_0xc53d('0x25')](respondWithFilteredResult(_0x15465,_0x43e5e9))[_0xc53d('0x45')](handleError(_0x15465,null));};exports[_0xc53d('0x46')]=function(_0x45c813,_0x2067cb){var _0x42f73a={'raw':!![],'where':{'id':_0x45c813[_0xc53d('0x47')]['id']}},_0x2c319c={};_0x2c319c[_0xc53d('0x32')]=_[_0xc53d('0x48')](db[_0xc53d('0x2d')][_0xc53d('0x2e')]);_0x2c319c[_0xc53d('0x34')]=_[_0xc53d('0x48')](_0x45c813[_0xc53d('0x34')]);_0x2c319c[_0xc53d('0x35')]=_[_0xc53d('0x36')](_0x2c319c[_0xc53d('0x32')],_0x2c319c[_0xc53d('0x34')]);_0x42f73a['attributes']=_[_0xc53d('0x36')](_0x2c319c[_0xc53d('0x32')],qs[_0xc53d('0x37')](_0x45c813[_0xc53d('0x34')][_0xc53d('0x37')]));_0x42f73a['attributes']=_0x42f73a[_0xc53d('0x38')][_0xc53d('0x49')]?_0x42f73a['attributes']:_0x2c319c['model'];if(_0x45c813[_0xc53d('0x34')]['includeAll']){_0x42f73a[_0xc53d('0x42')]=[{'all':!![]}];}_0x42f73a=_[_0xc53d('0x3e')]({},_0x42f73a,_0x45c813[_0xc53d('0x3f')]);return db[_0xc53d('0x2d')][_0xc53d('0x4a')](_0x42f73a)['then'](handleEntityNotFound(_0x2067cb,null))[_0xc53d('0x25')](respondWithResult(_0x2067cb,null))['catch'](handleError(_0x2067cb,null));};exports[_0xc53d('0x4b')]=function(_0x299c14,_0x316f2f){return db[_0xc53d('0x2d')]['create'](_0x299c14['body'],{})['then'](function(_0x28ae98){var _0x2e5260=_0x299c14['user']['get']({'plain':!![]});if(!_0x2e5260)throw new Error(_0xc53d('0x4c'));if(_0x2e5260[_0xc53d('0x4d')]===_0xc53d('0x4e')){var _0x572bd8=_0x28ae98[_0xc53d('0x27')]({'plain':!![]});var _0xf60b60='ExtractedReports';return db['UserProfileSection'][_0xc53d('0x4a')]({'where':{'name':_0xf60b60,'userProfileId':_0x2e5260[_0xc53d('0x4f')]},'raw':!![]})[_0xc53d('0x25')](function(_0x3db661){if(_0x3db661&&_0x3db661['autoAssociation']===0x0){return db[_0xc53d('0x29')][_0xc53d('0x4b')]({'name':_0x572bd8[_0xc53d('0x2b')],'resourceId':_0x572bd8['id'],'type':_0x3db661[_0xc53d('0x2b')],'sectionId':_0x3db661['id']},{})[_0xc53d('0x25')](function(){return _0x28ae98;});}else{return _0x28ae98;}})['catch'](function(_0x39e8b1){logger[_0xc53d('0x2a')](_0xc53d('0x50'),_0x39e8b1);throw _0x39e8b1;});}return _0x28ae98;})[_0xc53d('0x25')](respondWithResult(_0x316f2f,0xc9))[_0xc53d('0x45')](handleError(_0x316f2f,null));};exports[_0xc53d('0x24')]=function(_0x5c531c,_0x589ea4){if(_0x5c531c[_0xc53d('0x51')]['id']){delete _0x5c531c['body']['id'];}return db[_0xc53d('0x2d')][_0xc53d('0x4a')]({'where':{'id':_0x5c531c['params']['id']}})['then'](handleEntityNotFound(_0x589ea4,null))[_0xc53d('0x25')](saveUpdates(_0x5c531c[_0xc53d('0x51')],null))[_0xc53d('0x25')](respondWithResult(_0x589ea4,null))[_0xc53d('0x45')](handleError(_0x589ea4,null));};exports['destroy']=function(_0x30a8a0,_0x4e51b1){return db[_0xc53d('0x2d')][_0xc53d('0x4a')]({'where':{'id':_0x30a8a0['params']['id']}})[_0xc53d('0x25')](handleEntityNotFound(_0x4e51b1,null))[_0xc53d('0x25')](removeEntity(_0x4e51b1,null))['catch'](handleError(_0x4e51b1,null));};exports['download']=function(_0x408791,_0x56e2ef,_0x3e02b0){return db[_0xc53d('0x2d')][_0xc53d('0x4a')]({'where':{'id':_0x408791[_0xc53d('0x47')]['id']},'attributes':[_0xc53d('0x2b'),'basename',_0xc53d('0x52'),_0xc53d('0x53')],'raw':!![]})[_0xc53d('0x25')](handleEntityNotFound(_0x56e2ef,null))[_0xc53d('0x25')](function(_0x3af974){if(_0x3af974){if(!fs['existsSync'](path[_0xc53d('0x54')](config[_0xc53d('0x55')],_0xc53d('0x56'),_0x3af974[_0xc53d('0x52')]))){throw new db[(_0xc53d('0x57'))][(_0xc53d('0x58'))](_0xc53d('0x59'));}if(_0x408791[_0xc53d('0x34')]['exists']){return _0x56e2ef[_0xc53d('0x1b')](0xc8);}return _0x56e2ef[_0xc53d('0x5a')](path[_0xc53d('0x54')](config[_0xc53d('0x55')],_0xc53d('0x56'),_0x3af974[_0xc53d('0x52')]),util[_0xc53d('0x5b')](_0xc53d('0x5c'),_0x3af974[_0xc53d('0x5d')]||_0x3af974[_0xc53d('0x2b')],_0x3af974[_0xc53d('0x53')]['toLowerCase']()));}})['catch'](handleError(_0x56e2ef,null));}; \ No newline at end of file +var _0x36b3=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','then','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','type','VIRTUAL','filter','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x36b3,0x15d));var _0x336b=function(_0xd76b9a,_0x10b7e3){_0xd76b9a=_0xd76b9a-0x0;var _0x1379ee=_0x36b3[_0xd76b9a];return _0x1379ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x336b('0x0'));var rp=require(_0x336b('0x1'));var moment=require('moment');var BPromise=require(_0x336b('0x2'));var Mustache=require(_0x336b('0x3'));var util=require(_0x336b('0x4'));var path=require(_0x336b('0x5'));var sox=require('sox');var csv=require(_0x336b('0x6'));var ejs=require(_0x336b('0x7'));var fs=require('fs');var fs_extra=require(_0x336b('0x8'));var _=require(_0x336b('0x9'));var squel=require('squel');var crypto=require(_0x336b('0xa'));var jsforce=require(_0x336b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x336b('0xc'));var Redis=require(_0x336b('0xd'));var authService=require(_0x336b('0xe'));var qs=require(_0x336b('0xf'));var as=require(_0x336b('0x10'));var hardwareService=require(_0x336b('0x11'));var logger=require(_0x336b('0x12'))(_0x336b('0x13'));var utils=require(_0x336b('0x14'));var config=require(_0x336b('0x15'));var licenseUtil=require(_0x336b('0x16'));var db=require(_0x336b('0x17'))['db'];function respondWithStatusCode(_0x572ca8,_0x475b76){_0x475b76=_0x475b76||0xcc;return function(_0xb87ac){if(_0xb87ac){return _0x572ca8[_0x336b('0x18')](_0x475b76);}return _0x572ca8[_0x336b('0x19')](_0x475b76)[_0x336b('0x1a')]();};}function respondWithResult(_0x9d16a5,_0x23547e){_0x23547e=_0x23547e||0xc8;return function(_0x5d6bd2){if(_0x5d6bd2){return _0x9d16a5[_0x336b('0x19')](_0x23547e)[_0x336b('0x1b')](_0x5d6bd2);}};}function respondWithFilteredResult(_0x54f3e7,_0x4bf9b4){return function(_0x397c60){if(_0x397c60){var _0x369a7a=typeof _0x4bf9b4['offset']===_0x336b('0x1c')&&typeof _0x4bf9b4[_0x336b('0x1d')]===_0x336b('0x1c');var _0x203d68=_0x397c60[_0x336b('0x1e')];var _0x3c88ca=_0x369a7a?0x0:_0x4bf9b4[_0x336b('0x1f')];var _0x4c498a=_0x369a7a?_0x397c60[_0x336b('0x1e')]:_0x4bf9b4[_0x336b('0x1f')]+_0x4bf9b4[_0x336b('0x1d')];var _0x12a930;if(_0x4c498a>=_0x203d68){_0x4c498a=_0x203d68;_0x12a930=0xc8;}else{_0x12a930=0xce;}_0x54f3e7[_0x336b('0x19')](_0x12a930);return _0x54f3e7[_0x336b('0x20')]('Content-Range',_0x3c88ca+'-'+_0x4c498a+'/'+_0x203d68)[_0x336b('0x1b')](_0x397c60);}return null;};}function patchUpdates(_0x2544b6){return function(_0x5890ad){try{jsonpatch['apply'](_0x5890ad,_0x2544b6,!![]);}catch(_0x4bb51f){return BPromise['reject'](_0x4bb51f);}return _0x5890ad['save']();};}function saveUpdates(_0x355ff8,_0xb4477){return function(_0x425cb6){if(_0x425cb6){return _0x425cb6[_0x336b('0x21')](_0x355ff8)['then'](function(_0x2b1fe6){return _0x2b1fe6;});}return null;};}function removeEntity(_0x149805,_0x2add99){return function(_0x46f6ff){if(_0x46f6ff){return _0x46f6ff[_0x336b('0x22')]()[_0x336b('0x23')](function(){var _0x17c355=_0x46f6ff[_0x336b('0x24')]({'plain':!![]});var _0x494817=_0x336b('0x25');return db[_0x336b('0x26')]['destroy']({'where':{'type':_0x494817,'resourceId':_0x17c355['id']}})[_0x336b('0x23')](function(){return _0x46f6ff;});})['then'](function(){_0x149805['status'](0xcc)[_0x336b('0x1a')]();});}};}function handleEntityNotFound(_0x45ec21,_0x57d5ca){return function(_0x395a1a){if(!_0x395a1a){_0x45ec21[_0x336b('0x18')](0x194);}return _0x395a1a;};}function handleError(_0x490225,_0x293fbb){_0x293fbb=_0x293fbb||0x1f4;return function(_0x5c4c77){logger['error'](_0x5c4c77[_0x336b('0x27')]);if(_0x5c4c77['name']){delete _0x5c4c77[_0x336b('0x28')];}_0x490225[_0x336b('0x19')](_0x293fbb)[_0x336b('0x29')](_0x5c4c77);};}exports[_0x336b('0x2a')]=function(_0x5def78,_0x2c2268){var _0x3a6c1c={},_0x5b845b={},_0x14ce19={'count':0x0,'rows':[]};var _0xc6dcc7=_[_0x336b('0x2b')](db[_0x336b('0x2c')][_0x336b('0x2d')],function(_0x259456){return{'name':_0x259456[_0x336b('0x2e')],'type':_0x259456['type']['key']};});_0x5b845b[_0x336b('0x2f')]=_[_0x336b('0x2b')](_0xc6dcc7,_0x336b('0x28'));_0x5b845b[_0x336b('0x30')]=_['keys'](_0x5def78[_0x336b('0x30')]);_0x5b845b[_0x336b('0x31')]=_['intersection'](_0x5b845b[_0x336b('0x2f')],_0x5b845b[_0x336b('0x30')]);_0x3a6c1c['attributes']=_[_0x336b('0x32')](_0x5b845b[_0x336b('0x2f')],qs[_0x336b('0x33')](_0x5def78['query']['fields']));_0x3a6c1c[_0x336b('0x34')]=_0x3a6c1c[_0x336b('0x34')][_0x336b('0x35')]?_0x3a6c1c[_0x336b('0x34')]:_0x5b845b['model'];if(!_0x5def78[_0x336b('0x30')][_0x336b('0x36')](_0x336b('0x37'))){_0x3a6c1c[_0x336b('0x1d')]=qs['limit'](_0x5def78[_0x336b('0x30')][_0x336b('0x1d')]);_0x3a6c1c[_0x336b('0x1f')]=qs['offset'](_0x5def78[_0x336b('0x30')][_0x336b('0x1f')]);}_0x3a6c1c[_0x336b('0x38')]=qs[_0x336b('0x39')](_0x5def78['query'][_0x336b('0x39')]);_0x3a6c1c['where']=qs[_0x336b('0x31')](_[_0x336b('0x3a')](_0x5def78[_0x336b('0x30')],_0x5b845b[_0x336b('0x31')]),_0xc6dcc7);if(_0x5def78[_0x336b('0x30')]['filter']){_0x3a6c1c['where']=_[_0x336b('0x3b')](_0x3a6c1c['where'],{'$or':_[_0x336b('0x2b')](_0xc6dcc7,function(_0x5857ae){if(_0x5857ae[_0x336b('0x3c')]!==_0x336b('0x3d')){var _0x6f57cc={};_0x6f57cc[_0x5857ae[_0x336b('0x28')]]={'$like':'%'+_0x5def78[_0x336b('0x30')][_0x336b('0x3e')]+'%'};return _0x6f57cc;}})});}_0x3a6c1c=_['merge']({},_0x3a6c1c,_0x5def78['options']);var _0x59077f={'where':_0x3a6c1c['where']};return db[_0x336b('0x2c')]['count'](_0x59077f)[_0x336b('0x23')](function(_0x4fc623){_0x14ce19[_0x336b('0x1e')]=_0x4fc623;if(_0x5def78[_0x336b('0x30')]['includeAll']){_0x3a6c1c[_0x336b('0x3f')]=[{'all':!![]}];}return db[_0x336b('0x2c')][_0x336b('0x40')](_0x3a6c1c);})['then'](function(_0x29e2cc){_0x14ce19[_0x336b('0x41')]=_0x29e2cc;return _0x14ce19;})[_0x336b('0x23')](respondWithFilteredResult(_0x2c2268,_0x3a6c1c))['catch'](handleError(_0x2c2268,null));};exports[_0x336b('0x42')]=function(_0xec6f80,_0x35977a){var _0x2e04bb={'raw':!![],'where':{'id':_0xec6f80[_0x336b('0x43')]['id']}},_0x4e5917={};_0x4e5917['model']=_[_0x336b('0x44')](db['AnalyticExtractedReport'][_0x336b('0x2d')]);_0x4e5917['query']=_[_0x336b('0x44')](_0xec6f80[_0x336b('0x30')]);_0x4e5917[_0x336b('0x31')]=_[_0x336b('0x32')](_0x4e5917[_0x336b('0x2f')],_0x4e5917[_0x336b('0x30')]);_0x2e04bb[_0x336b('0x34')]=_[_0x336b('0x32')](_0x4e5917[_0x336b('0x2f')],qs[_0x336b('0x33')](_0xec6f80[_0x336b('0x30')]['fields']));_0x2e04bb[_0x336b('0x34')]=_0x2e04bb[_0x336b('0x34')][_0x336b('0x35')]?_0x2e04bb[_0x336b('0x34')]:_0x4e5917[_0x336b('0x2f')];if(_0xec6f80[_0x336b('0x30')][_0x336b('0x45')]){_0x2e04bb[_0x336b('0x3f')]=[{'all':!![]}];}_0x2e04bb=_['merge']({},_0x2e04bb,_0xec6f80['options']);return db['AnalyticExtractedReport'][_0x336b('0x46')](_0x2e04bb)['then'](handleEntityNotFound(_0x35977a,null))[_0x336b('0x23')](respondWithResult(_0x35977a,null))[_0x336b('0x47')](handleError(_0x35977a,null));};exports[_0x336b('0x48')]=function(_0x4a3c69,_0x39ae1a){return db[_0x336b('0x2c')]['create'](_0x4a3c69[_0x336b('0x49')],{})['then'](function(_0x5aae0f){var _0x5e36e6=_0x4a3c69[_0x336b('0x4a')][_0x336b('0x24')]({'plain':!![]});if(!_0x5e36e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e36e6[_0x336b('0x4b')]===_0x336b('0x4a')){var _0x467452=_0x5aae0f[_0x336b('0x24')]({'plain':!![]});var _0x4364b8=_0x336b('0x25');return db[_0x336b('0x4c')][_0x336b('0x46')]({'where':{'name':_0x4364b8,'userProfileId':_0x5e36e6[_0x336b('0x4d')]},'raw':!![]})[_0x336b('0x23')](function(_0x57b4a6){if(_0x57b4a6&&_0x57b4a6['autoAssociation']===0x0){return db[_0x336b('0x26')]['create']({'name':_0x467452['name'],'resourceId':_0x467452['id'],'type':_0x57b4a6['name'],'sectionId':_0x57b4a6['id']},{})[_0x336b('0x23')](function(){return _0x5aae0f;});}else{return _0x5aae0f;}})['catch'](function(_0x4aeb82){logger[_0x336b('0x4e')](_0x336b('0x4f'),_0x4aeb82);throw _0x4aeb82;});}return _0x5aae0f;})[_0x336b('0x23')](respondWithResult(_0x39ae1a,0xc9))[_0x336b('0x47')](handleError(_0x39ae1a,null));};exports[_0x336b('0x21')]=function(_0x26c598,_0x5df2b4){if(_0x26c598[_0x336b('0x49')]['id']){delete _0x26c598[_0x336b('0x49')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x26c598[_0x336b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5df2b4,null))[_0x336b('0x23')](saveUpdates(_0x26c598[_0x336b('0x49')],null))['then'](respondWithResult(_0x5df2b4,null))[_0x336b('0x47')](handleError(_0x5df2b4,null));};exports['destroy']=function(_0xfae4b4,_0x508db2){return db['AnalyticExtractedReport'][_0x336b('0x46')]({'where':{'id':_0xfae4b4[_0x336b('0x43')]['id']}})[_0x336b('0x23')](handleEntityNotFound(_0x508db2,null))['then'](removeEntity(_0x508db2,null))[_0x336b('0x47')](handleError(_0x508db2,null));};exports[_0x336b('0x50')]=function(_0x31ed8e,_0x17cbd0,_0xca0c3){return db[_0x336b('0x2c')][_0x336b('0x46')]({'where':{'id':_0x31ed8e[_0x336b('0x43')]['id']},'attributes':[_0x336b('0x28'),_0x336b('0x51'),_0x336b('0x52'),_0x336b('0x53')],'raw':!![]})[_0x336b('0x23')](handleEntityNotFound(_0x17cbd0,null))[_0x336b('0x23')](function(_0x5ef545){if(_0x5ef545){if(!fs['existsSync'](path[_0x336b('0x54')](config[_0x336b('0x55')],'server/files/reports',_0x5ef545[_0x336b('0x52')]))){throw new db[(_0x336b('0x56'))]['ValidationError'](_0x336b('0x57'));}if(_0x31ed8e['query'][_0x336b('0x58')]){return _0x17cbd0[_0x336b('0x18')](0xc8);}return _0x17cbd0['download'](path[_0x336b('0x54')](config[_0x336b('0x55')],'server/files/reports',_0x5ef545[_0x336b('0x52')]),util[_0x336b('0x59')](_0x336b('0x5a'),_0x5ef545[_0x336b('0x51')]||_0x5ef545[_0x336b('0x28')],_0x5ef545[_0x336b('0x53')][_0x336b('0x5b')]()));}})[_0x336b('0x47')](handleError(_0x17cbd0,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 0df1eab..671f1b8 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 _0xdf2f=['moment','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x39212c,_0x3f0c5f){var _0xb86ab=function(_0x14bce0){while(--_0x14bce0){_0x39212c['push'](_0x39212c['shift']());}};_0xb86ab(++_0x3f0c5f);}(_0xdf2f,0xa2));var _0xfdf2=function(_0x2f05f8,_0x2cda12){_0x2f05f8=_0x2f05f8-0x0;var _0x102b8b=_0xdf2f[_0x2f05f8];return _0x102b8b;};'use strict';var _=require(_0xfdf2('0x0'));var util=require(_0xfdf2('0x1'));var logger=require(_0xfdf2('0x2'))('api');var moment=require(_0xfdf2('0x3'));var BPromise=require('bluebird');var rp=require(_0xfdf2('0x4'));var fs=require('fs');var path=require(_0xfdf2('0x5'));var rimraf=require('rimraf');var config=require(_0xfdf2('0x6'));var attributes=require(_0xfdf2('0x7'));module[_0xfdf2('0x8')]=function(_0x4bea9e,_0x58e362){return _0x4bea9e[_0xfdf2('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xfdf2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1089=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x550aed,_0x1ba6cb){var _0x1c43a5=function(_0x39e5f7){while(--_0x39e5f7){_0x550aed['push'](_0x550aed['shift']());}};_0x1c43a5(++_0x1ba6cb);}(_0x1089,0x73));var _0x9108=function(_0x146524,_0x3e32a8){_0x146524=_0x146524-0x0;var _0x2f7632=_0x1089[_0x146524];return _0x2f7632;};'use strict';var _=require(_0x9108('0x0'));var util=require(_0x9108('0x1'));var logger=require(_0x9108('0x2'))('api');var moment=require(_0x9108('0x3'));var BPromise=require('bluebird');var rp=require(_0x9108('0x4'));var fs=require('fs');var path=require(_0x9108('0x5'));var rimraf=require(_0x9108('0x6'));var config=require(_0x9108('0x7'));var attributes=require(_0x9108('0x8'));module[_0x9108('0x9')]=function(_0x29ff9a,_0x25fcd7){return _0x29ff9a[_0x9108('0xa')](_0x9108('0xb'),attributes,{'tableName':_0x9108('0xc'),'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 f353f8d..ba3e4db 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 _0x918e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x918e,0x173));var _0xe918=function(_0x4228a9,_0x40d3a3){_0x4228a9=_0x4228a9-0x0;var _0xdbce4a=_0x918e[_0x4228a9];return _0xdbce4a;};'use strict';var _=require(_0xe918('0x0'));var util=require(_0xe918('0x1'));var moment=require(_0xe918('0x2'));var BPromise=require('bluebird');var rs=require(_0xe918('0x3'));var fs=require('fs');var Redis=require(_0xe918('0x4'));var db=require(_0xe918('0x5'))['db'];var utils=require(_0xe918('0x6'));var logger=require(_0xe918('0x7'))(_0xe918('0x8'));var config=require(_0xe918('0x9'));var jayson=require(_0xe918('0xa'));var client=jayson[_0xe918('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40643c,_0x544aeb,_0x2585f8){return new BPromise(function(_0x35dd05,_0x279924){return client[_0xe918('0xc')](_0x40643c,_0x2585f8)[_0xe918('0xd')](function(_0x3fb2af){logger[_0xe918('0xe')](_0xe918('0xf'),_0x544aeb,_0xe918('0x10'));logger[_0xe918('0x11')](_0xe918('0x12'),_0x544aeb,_0xe918('0x10'),JSON[_0xe918('0x13')](_0x3fb2af));if(_0x3fb2af[_0xe918('0x14')]){if(_0x3fb2af['error'][_0xe918('0x15')]===0x1f4){logger[_0xe918('0x14')](_0xe918('0xf'),_0x544aeb,_0x3fb2af[_0xe918('0x14')][_0xe918('0x16')]);return _0x279924(_0x3fb2af[_0xe918('0x14')]['message']);}logger[_0xe918('0x14')](_0xe918('0xf'),_0x544aeb,_0x3fb2af[_0xe918('0x14')][_0xe918('0x16')]);return _0x35dd05(_0x3fb2af[_0xe918('0x14')][_0xe918('0x16')]);}else{logger['info'](_0xe918('0xf'),_0x544aeb,'request\x20sent');_0x35dd05(_0x3fb2af[_0xe918('0x17')][_0xe918('0x16')]);}})[_0xe918('0x18')](function(_0x28f0d1){logger[_0xe918('0x14')](_0xe918('0xf'),_0x544aeb,_0x28f0d1);_0x279924(_0x28f0d1);});});} \ No newline at end of file +var _0xc985=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x4d183d,_0x123de0){var _0x431236=function(_0x35642b){while(--_0x35642b){_0x4d183d['push'](_0x4d183d['shift']());}};_0x431236(++_0x123de0);}(_0xc985,0x85));var _0x5c98=function(_0x736f7d,_0x366808){_0x736f7d=_0x736f7d-0x0;var _0x561384=_0xc985[_0x736f7d];return _0x561384;};'use strict';var _=require(_0x5c98('0x0'));var util=require(_0x5c98('0x1'));var moment=require(_0x5c98('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c98('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c98('0x4'));var logger=require(_0x5c98('0x5'))(_0x5c98('0x6'));var config=require(_0x5c98('0x7'));var jayson=require(_0x5c98('0x8'));var client=jayson[_0x5c98('0x9')][_0x5c98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a789,_0x49216b,_0x49f692){return new BPromise(function(_0x2997e8,_0x24190e){return client['request'](_0x13a789,_0x49f692)[_0x5c98('0xb')](function(_0x215cc5){logger[_0x5c98('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x49216b,_0x5c98('0xd'));logger[_0x5c98('0xe')](_0x5c98('0xf'),_0x49216b,_0x5c98('0xd'),JSON[_0x5c98('0x10')](_0x215cc5));if(_0x215cc5[_0x5c98('0x11')]){if(_0x215cc5[_0x5c98('0x11')]['code']===0x1f4){logger['error'](_0x5c98('0x12'),_0x49216b,_0x215cc5[_0x5c98('0x11')][_0x5c98('0x13')]);return _0x24190e(_0x215cc5[_0x5c98('0x11')][_0x5c98('0x13')]);}logger[_0x5c98('0x11')](_0x5c98('0x12'),_0x49216b,_0x215cc5[_0x5c98('0x11')]['message']);return _0x2997e8(_0x215cc5['error'][_0x5c98('0x13')]);}else{logger['info'](_0x5c98('0x12'),_0x49216b,_0x5c98('0xd'));_0x2997e8(_0x215cc5[_0x5c98('0x14')]['message']);}})['catch'](function(_0x21c1ae){logger[_0x5c98('0x11')](_0x5c98('0x12'),_0x49216b,_0x21c1ae);_0x24190e(_0x21c1ae);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2b59ced..17d4b84 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 _0x721e=['download','post','create','put','update','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download'];(function(_0x10614a,_0x53ff27){var _0x5888ec=function(_0x50aa1f){while(--_0x50aa1f){_0x10614a['push'](_0x10614a['shift']());}};_0x5888ec(++_0x53ff27);}(_0x721e,0xa7));var _0xe721=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x721e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe721('0x0'));var timeout=require('connect-timeout');var express=require(_0xe721('0x1'));var router=express[_0xe721('0x2')]();var fs_extra=require(_0xe721('0x3'));var auth=require(_0xe721('0x4'));var interaction=require(_0xe721('0x5'));var config=require('../../config/environment');var controller=require(_0xe721('0x6'));router[_0xe721('0x7')]('/',auth['isAuthenticated'](),controller[_0xe721('0x8')]);router[_0xe721('0x7')](_0xe721('0x9'),auth[_0xe721('0xa')](),controller[_0xe721('0xb')]);router['get'](_0xe721('0xc'),auth['isAuthenticated'](),controller[_0xe721('0xd')]);router[_0xe721('0xe')]('/',auth[_0xe721('0xa')](),controller[_0xe721('0xf')]);router[_0xe721('0x10')](_0xe721('0x9'),auth['isAuthenticated'](),controller[_0xe721('0x11')]);router[_0xe721('0x12')](_0xe721('0x9'),auth[_0xe721('0xa')](),controller[_0xe721('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1950=['fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','/:id/download','post','create','put','update','/:id','exports','util','path','connect-timeout','express','Router'];(function(_0x25ad66,_0x46e4dc){var _0x141bc4=function(_0x3a7f8e){while(--_0x3a7f8e){_0x25ad66['push'](_0x25ad66['shift']());}};_0x141bc4(++_0x46e4dc);}(_0x1950,0x163));var _0x0195=function(_0x287924,_0x3d1669){_0x287924=_0x287924-0x0;var _0xc02f77=_0x1950[_0x287924];return _0xc02f77;};'use strict';var multer=require('multer');var util=require(_0x0195('0x0'));var path=require(_0x0195('0x1'));var timeout=require(_0x0195('0x2'));var express=require(_0x0195('0x3'));var router=express[_0x0195('0x4')]();var fs_extra=require(_0x0195('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0195('0x6'));var config=require(_0x0195('0x7'));var controller=require(_0x0195('0x8'));router['get']('/',auth[_0x0195('0x9')](),controller[_0x0195('0xa')]);router['get']('/:id',auth[_0x0195('0x9')](),controller['show']);router['get'](_0x0195('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x0195('0xc')]('/',auth[_0x0195('0x9')](),controller[_0x0195('0xd')]);router[_0x0195('0xe')]('/:id',auth[_0x0195('0x9')](),controller[_0x0195('0xf')]);router['delete'](_0x0195('0x10'),auth[_0x0195('0x9')](),controller['destroy']);module[_0x0195('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0d8429f..7c6b78c 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 _0x7ea0=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x7ea0,0x18a));var _0x07ea=function(_0x4714e4,_0x20e90d){_0x4714e4=_0x4714e4-0x0;var _0x12e07c=_0x7ea0[_0x4714e4];return _0x12e07c;};'use strict';var Sequelize=require(_0x07ea('0x0'));module[_0x07ea('0x1')]={'field':{'type':Sequelize[_0x07ea('0x2')]},'alias':{'type':Sequelize[_0x07ea('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x07ea('0x3')]},'groupBy':{'type':Sequelize[_0x07ea('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x07ea('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6188=['sequelize','exports','STRING','BOOLEAN'];(function(_0x5a405f,_0x2aa5be){var _0xef5c44=function(_0x59ac71){while(--_0x59ac71){_0x5a405f['push'](_0x5a405f['shift']());}};_0xef5c44(++_0x2aa5be);}(_0x6188,0x1e8));var _0x8618=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x6188[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x8618('0x0'));module[_0x8618('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x8618('0x2')]},'function':{'type':Sequelize[_0x8618('0x2')]},'format':{'type':Sequelize[_0x8618('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8618('0x2')]},'custom':{'type':Sequelize[_0x8618('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 6c51004..65dcdb6 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 _0xd4c7=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticFieldReport','includeAll','include','findAll','catch','show','params','find','body','ids','addFields','AnalyticCustomReport','findOne','transaction','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x26d7c1,_0x46ce50){var _0x3cb172=function(_0x17c980){while(--_0x17c980){_0x26d7c1['push'](_0x26d7c1['shift']());}};_0x3cb172(++_0x46ce50);}(_0xd4c7,0x1c7));var _0x7d4c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd4c7[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d4c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d4c('0x1'));var moment=require('moment');var BPromise=require(_0x7d4c('0x2'));var Mustache=require(_0x7d4c('0x3'));var util=require(_0x7d4c('0x4'));var path=require(_0x7d4c('0x5'));var sox=require(_0x7d4c('0x6'));var csv=require(_0x7d4c('0x7'));var ejs=require(_0x7d4c('0x8'));var fs=require('fs');var fs_extra=require(_0x7d4c('0x9'));var _=require(_0x7d4c('0xa'));var squel=require(_0x7d4c('0xb'));var crypto=require(_0x7d4c('0xc'));var jsforce=require(_0x7d4c('0xd'));var deskjs=require(_0x7d4c('0xe'));var toCsv=require(_0x7d4c('0x7'));var querystring=require(_0x7d4c('0xf'));var Papa=require(_0x7d4c('0x10'));var Redis=require(_0x7d4c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7d4c('0x12'));var as=require(_0x7d4c('0x13'));var hardwareService=require(_0x7d4c('0x14'));var logger=require(_0x7d4c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x7d4c('0x16'));var licenseUtil=require(_0x7d4c('0x17'));var db=require(_0x7d4c('0x18'))['db'];function respondWithStatusCode(_0x4158f9,_0x3c3759){_0x3c3759=_0x3c3759||0xcc;return function(_0x5c81cb){if(_0x5c81cb){return _0x4158f9[_0x7d4c('0x19')](_0x3c3759);}return _0x4158f9['status'](_0x3c3759)['end']();};}function respondWithResult(_0x379024,_0x417937){_0x417937=_0x417937||0xc8;return function(_0x5a6137){if(_0x5a6137){return _0x379024[_0x7d4c('0x1a')](_0x417937)[_0x7d4c('0x1b')](_0x5a6137);}};}function respondWithFilteredResult(_0x1cb689,_0x18251e){return function(_0x48d8d1){if(_0x48d8d1){var _0x55cba8=typeof _0x18251e['offset']===_0x7d4c('0x1c')&&typeof _0x18251e[_0x7d4c('0x1d')]===_0x7d4c('0x1c');var _0x909251=_0x48d8d1[_0x7d4c('0x1e')];var _0x27e0f7=_0x55cba8?0x0:_0x18251e[_0x7d4c('0x1f')];var _0x3f51a3=_0x55cba8?_0x48d8d1[_0x7d4c('0x1e')]:_0x18251e[_0x7d4c('0x1f')]+_0x18251e[_0x7d4c('0x1d')];var _0x27b084;if(_0x3f51a3>=_0x909251){_0x3f51a3=_0x909251;_0x27b084=0xc8;}else{_0x27b084=0xce;}_0x1cb689['status'](_0x27b084);return _0x1cb689[_0x7d4c('0x20')](_0x7d4c('0x21'),_0x27e0f7+'-'+_0x3f51a3+'/'+_0x909251)[_0x7d4c('0x1b')](_0x48d8d1);}return null;};}function patchUpdates(_0x880ed4){return function(_0x1a6b73){try{jsonpatch[_0x7d4c('0x22')](_0x1a6b73,_0x880ed4,!![]);}catch(_0x1746ad){return BPromise[_0x7d4c('0x23')](_0x1746ad);}return _0x1a6b73['save']();};}function saveUpdates(_0x59ff1e,_0x588231){return function(_0x3a25fb){if(_0x3a25fb){return _0x3a25fb['update'](_0x59ff1e)[_0x7d4c('0x24')](function(_0x1973bc){return _0x1973bc;});}return null;};}function removeEntity(_0x132afb,_0x319224){return function(_0x26bcb3){if(_0x26bcb3){return _0x26bcb3[_0x7d4c('0x25')]()[_0x7d4c('0x24')](function(){_0x132afb['status'](0xcc)[_0x7d4c('0x26')]();});}};}function handleEntityNotFound(_0x5f4d5a,_0x134226){return function(_0x3d9e69){if(!_0x3d9e69){_0x5f4d5a['sendStatus'](0x194);}return _0x3d9e69;};}function handleError(_0x5a4b28,_0xeca830){_0xeca830=_0xeca830||0x1f4;return function(_0xf1a695){logger['error'](_0xf1a695[_0x7d4c('0x27')]);if(_0xf1a695[_0x7d4c('0x28')]){delete _0xf1a695[_0x7d4c('0x28')];}_0x5a4b28[_0x7d4c('0x1a')](_0xeca830)[_0x7d4c('0x29')](_0xf1a695);};}exports[_0x7d4c('0x2a')]=function(_0x3c8036,_0x126e7c){var _0x34382e={},_0x441349={},_0x46e290={'count':0x0,'rows':[]};var _0x5d3f38=_[_0x7d4c('0x2b')](db['AnalyticFieldReport'][_0x7d4c('0x2c')],function(_0x2e9818){return{'name':_0x2e9818[_0x7d4c('0x2d')],'type':_0x2e9818[_0x7d4c('0x2e')][_0x7d4c('0x2f')]};});_0x441349['model']=_[_0x7d4c('0x2b')](_0x5d3f38,_0x7d4c('0x28'));_0x441349['query']=_[_0x7d4c('0x30')](_0x3c8036[_0x7d4c('0x31')]);_0x441349[_0x7d4c('0x32')]=_[_0x7d4c('0x33')](_0x441349['model'],_0x441349[_0x7d4c('0x31')]);_0x34382e[_0x7d4c('0x34')]=_[_0x7d4c('0x33')](_0x441349[_0x7d4c('0x35')],qs[_0x7d4c('0x36')](_0x3c8036['query'][_0x7d4c('0x36')]));_0x34382e[_0x7d4c('0x34')]=_0x34382e[_0x7d4c('0x34')][_0x7d4c('0x37')]?_0x34382e[_0x7d4c('0x34')]:_0x441349[_0x7d4c('0x35')];if(!_0x3c8036['query'][_0x7d4c('0x38')](_0x7d4c('0x39'))){_0x34382e['limit']=qs[_0x7d4c('0x1d')](_0x3c8036[_0x7d4c('0x31')]['limit']);_0x34382e['offset']=qs[_0x7d4c('0x1f')](_0x3c8036[_0x7d4c('0x31')][_0x7d4c('0x1f')]);}_0x34382e[_0x7d4c('0x3a')]=qs[_0x7d4c('0x3b')](_0x3c8036[_0x7d4c('0x31')][_0x7d4c('0x3b')]);_0x34382e[_0x7d4c('0x3c')]=qs['filters'](_[_0x7d4c('0x3d')](_0x3c8036[_0x7d4c('0x31')],_0x441349[_0x7d4c('0x32')]),_0x5d3f38);if(_0x3c8036[_0x7d4c('0x31')][_0x7d4c('0x3e')]){_0x34382e[_0x7d4c('0x3c')]=_[_0x7d4c('0x3f')](_0x34382e[_0x7d4c('0x3c')],{'$or':_['map'](_0x5d3f38,function(_0x26fd75){if(_0x26fd75[_0x7d4c('0x2e')]!=='VIRTUAL'){var _0x347959={};_0x347959[_0x26fd75[_0x7d4c('0x28')]]={'$like':'%'+_0x3c8036[_0x7d4c('0x31')][_0x7d4c('0x3e')]+'%'};return _0x347959;}})});}_0x34382e=_[_0x7d4c('0x3f')]({},_0x34382e,_0x3c8036[_0x7d4c('0x40')]);var _0x166a0c={'where':_0x34382e[_0x7d4c('0x3c')]};return db[_0x7d4c('0x41')]['count'](_0x166a0c)[_0x7d4c('0x24')](function(_0x52f1bd){_0x46e290['count']=_0x52f1bd;if(_0x3c8036[_0x7d4c('0x31')][_0x7d4c('0x42')]){_0x34382e[_0x7d4c('0x43')]=[{'all':!![]}];}return db[_0x7d4c('0x41')][_0x7d4c('0x44')](_0x34382e);})[_0x7d4c('0x24')](function(_0xe6edfd){_0x46e290['rows']=_0xe6edfd;return _0x46e290;})[_0x7d4c('0x24')](respondWithFilteredResult(_0x126e7c,_0x34382e))[_0x7d4c('0x45')](handleError(_0x126e7c,null));};exports[_0x7d4c('0x46')]=function(_0x4256de,_0x1a64d9){var _0x5b43ba={'raw':![],'where':{'id':_0x4256de[_0x7d4c('0x47')]['id']}},_0x2edb21={};_0x2edb21[_0x7d4c('0x35')]=_['keys'](db[_0x7d4c('0x41')][_0x7d4c('0x2c')]);_0x2edb21[_0x7d4c('0x31')]=_[_0x7d4c('0x30')](_0x4256de[_0x7d4c('0x31')]);_0x2edb21[_0x7d4c('0x32')]=_['intersection'](_0x2edb21[_0x7d4c('0x35')],_0x2edb21[_0x7d4c('0x31')]);_0x5b43ba[_0x7d4c('0x34')]=_[_0x7d4c('0x33')](_0x2edb21[_0x7d4c('0x35')],qs['fields'](_0x4256de[_0x7d4c('0x31')][_0x7d4c('0x36')]));_0x5b43ba['attributes']=_0x5b43ba[_0x7d4c('0x34')]['length']?_0x5b43ba[_0x7d4c('0x34')]:_0x2edb21[_0x7d4c('0x35')];if(_0x4256de['query'][_0x7d4c('0x42')]){_0x5b43ba[_0x7d4c('0x43')]=[{'all':!![]}];}_0x5b43ba=_[_0x7d4c('0x3f')]({},_0x5b43ba,_0x4256de[_0x7d4c('0x40')]);return db[_0x7d4c('0x41')][_0x7d4c('0x48')](_0x5b43ba)[_0x7d4c('0x24')](handleEntityNotFound(_0x1a64d9,null))[_0x7d4c('0x24')](respondWithResult(_0x1a64d9,null))[_0x7d4c('0x45')](handleError(_0x1a64d9,null));};exports['create']=function(_0x1a3370,_0x1f1155){return db['AnalyticFieldReport']['create'](_0x1a3370['body'],{})['then'](respondWithResult(_0x1f1155,0xc9))[_0x7d4c('0x45')](handleError(_0x1f1155,null));};exports['bulkCreate']=function(_0x2df0fc,_0x31f4b0){return db['AnalyticFieldReport']['bulkCreate'](_0x2df0fc[_0x7d4c('0x49')],{'raw':![],'individualHooks':!![]})[_0x7d4c('0x24')](respondWithResult(_0x31f4b0,0xc9))['catch'](handleError(_0x31f4b0,null));};exports['update']=function(_0x226154,_0x1fa3a0){if(_0x226154[_0x7d4c('0x49')]['id']){delete _0x226154[_0x7d4c('0x49')]['id'];}return db[_0x7d4c('0x41')][_0x7d4c('0x48')]({'where':{'id':_0x226154[_0x7d4c('0x47')]['id']}})[_0x7d4c('0x24')](handleEntityNotFound(_0x1fa3a0,null))[_0x7d4c('0x24')](saveUpdates(_0x226154['body'],null))[_0x7d4c('0x24')](respondWithResult(_0x1fa3a0,null))['catch'](handleError(_0x1fa3a0,null));};exports[_0x7d4c('0x25')]=function(_0x11b9cd,_0x24d54f){return db['AnalyticFieldReport'][_0x7d4c('0x48')]({'where':{'id':_0x11b9cd[_0x7d4c('0x47')]['id']}})[_0x7d4c('0x24')](handleEntityNotFound(_0x24d54f,null))['then'](removeEntity(_0x24d54f,null))[_0x7d4c('0x45')](handleError(_0x24d54f,null));};exports['bulkDestroy']=function(_0x4f02b2,_0x57d3c0){return db['AnalyticFieldReport'][_0x7d4c('0x25')]({'where':{'id':_0x4f02b2[_0x7d4c('0x31')][_0x7d4c('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x7d4c('0x24')](respondWithResult(_0x57d3c0,0xcc))[_0x7d4c('0x45')](handleError(_0x57d3c0,null));};exports[_0x7d4c('0x4b')]=function(_0x2b58e1,_0x42ac2e,_0x1fd929){return db[_0x7d4c('0x4c')][_0x7d4c('0x4d')]({'where':{'id':_0x2b58e1[_0x7d4c('0x47')]['id']}})[_0x7d4c('0x24')](handleEntityNotFound(_0x42ac2e,null))[_0x7d4c('0x24')](function(_0x49ea67){if(_0x49ea67){return db['sequelize'][_0x7d4c('0x4e')](function(_0x4c1095){return db[_0x7d4c('0x41')][_0x7d4c('0x25')]({'where':{'CustomReportId':_0x2b58e1['params']['id']},'transaction':_0x4c1095})[_0x7d4c('0x24')](function(_0x4b9420){var _0x2504a3=_[_0x7d4c('0x2b')](_0x2b58e1['body'],function(_0x56c7a4){delete _0x56c7a4['id'];_0x56c7a4['CustomReportId']=_0x2b58e1[_0x7d4c('0x47')]['id'];return _0x56c7a4;});return db['AnalyticFieldReport']['bulkCreate'](_0x2504a3,{'transaction':_0x4c1095});});})[_0x7d4c('0x24')](function(){return db[_0x7d4c('0x41')][_0x7d4c('0x44')]({'where':{'CustomReportId':_0x2b58e1['params']['id']}});});}})[_0x7d4c('0x24')](respondWithResult(_0x42ac2e,null))[_0x7d4c('0x45')](handleError(_0x42ac2e,null));}; \ No newline at end of file +var _0x75c7=['destroy','then','end','error','stack','name','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update'];(function(_0x2b9ddb,_0x3993f7){var _0x4fa608=function(_0xe27c18){while(--_0xe27c18){_0x2b9ddb['push'](_0x2b9ddb['shift']());}};_0x4fa608(++_0x3993f7);}(_0x75c7,0x155));var _0x775c=function(_0x531595,_0x1605ab){_0x531595=_0x531595-0x0;var _0x3d0141=_0x75c7[_0x531595];return _0x3d0141;};'use strict';var emlformat=require(_0x775c('0x0'));var rimraf=require(_0x775c('0x1'));var zipdir=require(_0x775c('0x2'));var jsonpatch=require(_0x775c('0x3'));var rp=require(_0x775c('0x4'));var moment=require(_0x775c('0x5'));var BPromise=require(_0x775c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x775c('0x7'));var sox=require(_0x775c('0x8'));var csv=require(_0x775c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x775c('0xa'));var _=require(_0x775c('0xb'));var squel=require('squel');var crypto=require(_0x775c('0xc'));var jsforce=require(_0x775c('0xd'));var deskjs=require(_0x775c('0xe'));var toCsv=require(_0x775c('0x9'));var querystring=require(_0x775c('0xf'));var Papa=require(_0x775c('0x10'));var Redis=require(_0x775c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x775c('0x12'));var hardwareService=require(_0x775c('0x13'));var logger=require(_0x775c('0x14'))('api');var utils=require(_0x775c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x775c('0x16'))['db'];function respondWithStatusCode(_0x16caf0,_0x18ab70){_0x18ab70=_0x18ab70||0xcc;return function(_0x551de9){if(_0x551de9){return _0x16caf0['sendStatus'](_0x18ab70);}return _0x16caf0[_0x775c('0x17')](_0x18ab70)['end']();};}function respondWithResult(_0x2b9e54,_0x2a0982){_0x2a0982=_0x2a0982||0xc8;return function(_0x2a4ab1){if(_0x2a4ab1){return _0x2b9e54[_0x775c('0x17')](_0x2a0982)[_0x775c('0x18')](_0x2a4ab1);}};}function respondWithFilteredResult(_0x1fe36b,_0xb2f950){return function(_0x3dc0ba){if(_0x3dc0ba){var _0x46b714=typeof _0xb2f950[_0x775c('0x19')]==='undefined'&&typeof _0xb2f950[_0x775c('0x1a')]===_0x775c('0x1b');var _0x12d8b5=_0x3dc0ba[_0x775c('0x1c')];var _0x491998=_0x46b714?0x0:_0xb2f950['offset'];var _0x526ed2=_0x46b714?_0x3dc0ba[_0x775c('0x1c')]:_0xb2f950[_0x775c('0x19')]+_0xb2f950[_0x775c('0x1a')];var _0x405bc6;if(_0x526ed2>=_0x12d8b5){_0x526ed2=_0x12d8b5;_0x405bc6=0xc8;}else{_0x405bc6=0xce;}_0x1fe36b['status'](_0x405bc6);return _0x1fe36b['set'](_0x775c('0x1d'),_0x491998+'-'+_0x526ed2+'/'+_0x12d8b5)[_0x775c('0x18')](_0x3dc0ba);}return null;};}function patchUpdates(_0x571394){return function(_0x129d4b){try{jsonpatch[_0x775c('0x1e')](_0x129d4b,_0x571394,!![]);}catch(_0x31b8ed){return BPromise[_0x775c('0x1f')](_0x31b8ed);}return _0x129d4b[_0x775c('0x20')]();};}function saveUpdates(_0x400c63,_0x3dc912){return function(_0x17d261){if(_0x17d261){return _0x17d261[_0x775c('0x21')](_0x400c63)['then'](function(_0x2dbc4b){return _0x2dbc4b;});}return null;};}function removeEntity(_0x53d682,_0x360669){return function(_0xeaecc2){if(_0xeaecc2){return _0xeaecc2[_0x775c('0x22')]()[_0x775c('0x23')](function(){_0x53d682[_0x775c('0x17')](0xcc)[_0x775c('0x24')]();});}};}function handleEntityNotFound(_0x54e166,_0x38aa42){return function(_0x2cf183){if(!_0x2cf183){_0x54e166['sendStatus'](0x194);}return _0x2cf183;};}function handleError(_0x53430c,_0x19b131){_0x19b131=_0x19b131||0x1f4;return function(_0x4892c1){logger[_0x775c('0x25')](_0x4892c1[_0x775c('0x26')]);if(_0x4892c1[_0x775c('0x27')]){delete _0x4892c1[_0x775c('0x27')];}_0x53430c[_0x775c('0x17')](_0x19b131)['send'](_0x4892c1);};}exports['index']=function(_0x1ce00d,_0x4b6fbb){var _0x313d16={},_0x2505a7={},_0x1cf03e={'count':0x0,'rows':[]};var _0x28a8b1=_['map'](db[_0x775c('0x28')][_0x775c('0x29')],function(_0x205e4d){return{'name':_0x205e4d[_0x775c('0x2a')],'type':_0x205e4d[_0x775c('0x2b')][_0x775c('0x2c')]};});_0x2505a7[_0x775c('0x2d')]=_[_0x775c('0x2e')](_0x28a8b1,'name');_0x2505a7[_0x775c('0x2f')]=_[_0x775c('0x30')](_0x1ce00d[_0x775c('0x2f')]);_0x2505a7[_0x775c('0x31')]=_[_0x775c('0x32')](_0x2505a7[_0x775c('0x2d')],_0x2505a7[_0x775c('0x2f')]);_0x313d16['attributes']=_['intersection'](_0x2505a7['model'],qs[_0x775c('0x33')](_0x1ce00d[_0x775c('0x2f')][_0x775c('0x33')]));_0x313d16[_0x775c('0x34')]=_0x313d16['attributes']['length']?_0x313d16[_0x775c('0x34')]:_0x2505a7['model'];if(!_0x1ce00d['query']['hasOwnProperty'](_0x775c('0x35'))){_0x313d16[_0x775c('0x1a')]=qs[_0x775c('0x1a')](_0x1ce00d['query'][_0x775c('0x1a')]);_0x313d16['offset']=qs[_0x775c('0x19')](_0x1ce00d[_0x775c('0x2f')][_0x775c('0x19')]);}_0x313d16['order']=qs['sort'](_0x1ce00d['query']['sort']);_0x313d16['where']=qs[_0x775c('0x31')](_['pick'](_0x1ce00d[_0x775c('0x2f')],_0x2505a7[_0x775c('0x31')]),_0x28a8b1);if(_0x1ce00d[_0x775c('0x2f')]['filter']){_0x313d16[_0x775c('0x36')]=_[_0x775c('0x37')](_0x313d16[_0x775c('0x36')],{'$or':_[_0x775c('0x2e')](_0x28a8b1,function(_0x275f91){if(_0x275f91[_0x775c('0x2b')]!==_0x775c('0x38')){var _0x3b1a84={};_0x3b1a84[_0x275f91['name']]={'$like':'%'+_0x1ce00d[_0x775c('0x2f')]['filter']+'%'};return _0x3b1a84;}})});}_0x313d16=_[_0x775c('0x37')]({},_0x313d16,_0x1ce00d[_0x775c('0x39')]);var _0x2dac31={'where':_0x313d16[_0x775c('0x36')]};return db['AnalyticFieldReport'][_0x775c('0x1c')](_0x2dac31)[_0x775c('0x23')](function(_0x159fb7){_0x1cf03e['count']=_0x159fb7;if(_0x1ce00d[_0x775c('0x2f')][_0x775c('0x3a')]){_0x313d16[_0x775c('0x3b')]=[{'all':!![]}];}return db[_0x775c('0x28')]['findAll'](_0x313d16);})[_0x775c('0x23')](function(_0x56acae){_0x1cf03e['rows']=_0x56acae;return _0x1cf03e;})[_0x775c('0x23')](respondWithFilteredResult(_0x4b6fbb,_0x313d16))[_0x775c('0x3c')](handleError(_0x4b6fbb,null));};exports[_0x775c('0x3d')]=function(_0x3ff7ec,_0x59c582){var _0x4af356={'raw':![],'where':{'id':_0x3ff7ec[_0x775c('0x3e')]['id']}},_0x23f543={};_0x23f543['model']=_[_0x775c('0x30')](db[_0x775c('0x28')][_0x775c('0x29')]);_0x23f543['query']=_['keys'](_0x3ff7ec[_0x775c('0x2f')]);_0x23f543[_0x775c('0x31')]=_['intersection'](_0x23f543['model'],_0x23f543['query']);_0x4af356[_0x775c('0x34')]=_[_0x775c('0x32')](_0x23f543[_0x775c('0x2d')],qs[_0x775c('0x33')](_0x3ff7ec[_0x775c('0x2f')]['fields']));_0x4af356[_0x775c('0x34')]=_0x4af356[_0x775c('0x34')][_0x775c('0x3f')]?_0x4af356[_0x775c('0x34')]:_0x23f543[_0x775c('0x2d')];if(_0x3ff7ec[_0x775c('0x2f')][_0x775c('0x3a')]){_0x4af356[_0x775c('0x3b')]=[{'all':!![]}];}_0x4af356=_[_0x775c('0x37')]({},_0x4af356,_0x3ff7ec[_0x775c('0x39')]);return db['AnalyticFieldReport'][_0x775c('0x40')](_0x4af356)[_0x775c('0x23')](handleEntityNotFound(_0x59c582,null))[_0x775c('0x23')](respondWithResult(_0x59c582,null))[_0x775c('0x3c')](handleError(_0x59c582,null));};exports[_0x775c('0x41')]=function(_0x4c2b42,_0x55e1fe){return db['AnalyticFieldReport'][_0x775c('0x41')](_0x4c2b42[_0x775c('0x42')],{})[_0x775c('0x23')](respondWithResult(_0x55e1fe,0xc9))[_0x775c('0x3c')](handleError(_0x55e1fe,null));};exports[_0x775c('0x43')]=function(_0x1939bd,_0x1c8f90){return db['AnalyticFieldReport'][_0x775c('0x43')](_0x1939bd[_0x775c('0x42')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1c8f90,0xc9))['catch'](handleError(_0x1c8f90,null));};exports[_0x775c('0x21')]=function(_0x21886a,_0x143e90){if(_0x21886a[_0x775c('0x42')]['id']){delete _0x21886a[_0x775c('0x42')]['id'];}return db[_0x775c('0x28')][_0x775c('0x40')]({'where':{'id':_0x21886a[_0x775c('0x3e')]['id']}})[_0x775c('0x23')](handleEntityNotFound(_0x143e90,null))[_0x775c('0x23')](saveUpdates(_0x21886a['body'],null))[_0x775c('0x23')](respondWithResult(_0x143e90,null))[_0x775c('0x3c')](handleError(_0x143e90,null));};exports[_0x775c('0x22')]=function(_0x48d266,_0x263fa1){return db['AnalyticFieldReport']['find']({'where':{'id':_0x48d266[_0x775c('0x3e')]['id']}})[_0x775c('0x23')](handleEntityNotFound(_0x263fa1,null))[_0x775c('0x23')](removeEntity(_0x263fa1,null))[_0x775c('0x3c')](handleError(_0x263fa1,null));};exports[_0x775c('0x44')]=function(_0x541eff,_0x10e3dc){return db['AnalyticFieldReport'][_0x775c('0x22')]({'where':{'id':_0x541eff[_0x775c('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x775c('0x23')](respondWithResult(_0x10e3dc,0xcc))[_0x775c('0x3c')](handleError(_0x10e3dc,null));};exports[_0x775c('0x45')]=function(_0x563499,_0x4e2998,_0xbe0b12){return db[_0x775c('0x46')][_0x775c('0x47')]({'where':{'id':_0x563499[_0x775c('0x3e')]['id']}})[_0x775c('0x23')](handleEntityNotFound(_0x4e2998,null))[_0x775c('0x23')](function(_0x11b11a){if(_0x11b11a){return db[_0x775c('0x48')]['transaction'](function(_0xa7bec4){return db[_0x775c('0x28')]['destroy']({'where':{'CustomReportId':_0x563499[_0x775c('0x3e')]['id']},'transaction':_0xa7bec4})[_0x775c('0x23')](function(_0xd929a5){var _0x4a412b=_[_0x775c('0x2e')](_0x563499[_0x775c('0x42')],function(_0x13e273){delete _0x13e273['id'];_0x13e273[_0x775c('0x49')]=_0x563499[_0x775c('0x3e')]['id'];return _0x13e273;});return db[_0x775c('0x28')]['bulkCreate'](_0x4a412b,{'transaction':_0xa7bec4});});})[_0x775c('0x23')](function(){return db['AnalyticFieldReport'][_0x775c('0x4a')]({'where':{'CustomReportId':_0x563499[_0x775c('0x3e')]['id']}});});}})[_0x775c('0x23')](respondWithResult(_0x4e2998,null))[_0x775c('0x3c')](handleError(_0x4e2998,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 05a5f91..064597e 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 _0x2759=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','rimraf','./analyticFieldReport.attributes','exports','define'];(function(_0x4be62d,_0x40d3e9){var _0x2b12e6=function(_0x2c701d){while(--_0x2c701d){_0x4be62d['push'](_0x4be62d['shift']());}};_0x2b12e6(++_0x40d3e9);}(_0x2759,0x1db));var _0x9275=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0x2759[_0x1e6b59];return _0x40d7c5;};'use strict';var _=require(_0x9275('0x0'));var util=require(_0x9275('0x1'));var logger=require(_0x9275('0x2'))(_0x9275('0x3'));var moment=require('moment');var BPromise=require(_0x9275('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9275('0x5'));var config=require('../../config/environment');var attributes=require(_0x9275('0x6'));module[_0x9275('0x7')]=function(_0x2355b6,_0x3d6b31){return _0x2355b6[_0x9275('0x8')](_0x9275('0x9'),attributes,{'tableName':_0x9275('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8124=['moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api'];(function(_0x2ac13,_0x3f98a5){var _0x2a5c5f=function(_0x55f050){while(--_0x55f050){_0x2ac13['push'](_0x2ac13['shift']());}};_0x2a5c5f(++_0x3f98a5);}(_0x8124,0x75));var _0x4812=function(_0x3f5fc0,_0x6ef49c){_0x3f5fc0=_0x3f5fc0-0x0;var _0x62e643=_0x8124[_0x3f5fc0];return _0x62e643;};'use strict';var _=require(_0x4812('0x0'));var util=require(_0x4812('0x1'));var logger=require('../../config/logger')(_0x4812('0x2'));var moment=require(_0x4812('0x3'));var BPromise=require('bluebird');var rp=require(_0x4812('0x4'));var fs=require('fs');var path=require(_0x4812('0x5'));var rimraf=require(_0x4812('0x6'));var config=require(_0x4812('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x4812('0x8')]=function(_0x583496,_0x44a7f5){return _0x583496[_0x4812('0x9')](_0x4812('0xa'),attributes,{'tableName':_0x4812('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 90da6c3..7bfff44 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 _0x0162=['stringify','error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../config/logger','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x1c7aa8,_0x5035b9){var _0x5a6657=function(_0xb8d83b){while(--_0xb8d83b){_0x1c7aa8['push'](_0x1c7aa8['shift']());}};_0x5a6657(++_0x5035b9);}(_0x0162,0x15c));var _0x2016=function(_0x1e745d,_0x5a66be){_0x1e745d=_0x1e745d-0x0;var _0x5a4378=_0x0162[_0x1e745d];return _0x5a4378;};'use strict';var _=require(_0x2016('0x0'));var util=require('util');var moment=require(_0x2016('0x1'));var BPromise=require('bluebird');var rs=require(_0x2016('0x2'));var fs=require('fs');var Redis=require(_0x2016('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2016('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2016('0x5'));var client=jayson['client'][_0x2016('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3508b6,_0x3bc026,_0x1bd176){return new BPromise(function(_0x5a9fac,_0xb05eba){return client[_0x2016('0x7')](_0x3508b6,_0x1bd176)[_0x2016('0x8')](function(_0x53364d){logger[_0x2016('0x9')](_0x2016('0xa'),_0x3bc026,'request\x20sent');logger['debug'](_0x2016('0xb'),_0x3bc026,'request\x20sent',JSON[_0x2016('0xc')](_0x53364d));if(_0x53364d[_0x2016('0xd')]){if(_0x53364d[_0x2016('0xd')][_0x2016('0xe')]===0x1f4){logger[_0x2016('0xd')](_0x2016('0xa'),_0x3bc026,_0x53364d[_0x2016('0xd')]['message']);return _0xb05eba(_0x53364d[_0x2016('0xd')][_0x2016('0xf')]);}logger[_0x2016('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3bc026,_0x53364d[_0x2016('0xd')][_0x2016('0xf')]);return _0x5a9fac(_0x53364d[_0x2016('0xd')]['message']);}else{logger[_0x2016('0x9')](_0x2016('0xa'),_0x3bc026,_0x2016('0x10'));_0x5a9fac(_0x53364d['result']['message']);}})[_0x2016('0x11')](function(_0x3f169c){logger[_0x2016('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3bc026,_0x3f169c);_0xb05eba(_0x3f169c);});});} \ No newline at end of file +var _0x1b89=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4ae024,_0x2e3bfc){var _0x1b0f81=function(_0x52417d){while(--_0x52417d){_0x4ae024['push'](_0x4ae024['shift']());}};_0x1b0f81(++_0x2e3bfc);}(_0x1b89,0x187));var _0x91b8=function(_0x446ed4,_0x5875d9){_0x446ed4=_0x446ed4-0x0;var _0x4a26e5=_0x1b89[_0x446ed4];return _0x4a26e5;};'use strict';var _=require(_0x91b8('0x0'));var util=require(_0x91b8('0x1'));var moment=require('moment');var BPromise=require(_0x91b8('0x2'));var rs=require(_0x91b8('0x3'));var fs=require('fs');var Redis=require(_0x91b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91b8('0x5'));var logger=require('../../config/logger')(_0x91b8('0x6'));var config=require(_0x91b8('0x7'));var jayson=require(_0x91b8('0x8'));var client=jayson[_0x91b8('0x9')][_0x91b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd2cb43,_0x53e2de,_0x2af39f){return new BPromise(function(_0xdb9902,_0xf73a2a){return client[_0x91b8('0xb')](_0xd2cb43,_0x2af39f)[_0x91b8('0xc')](function(_0x23f25c){logger['info'](_0x91b8('0xd'),_0x53e2de,'request\x20sent');logger[_0x91b8('0xe')](_0x91b8('0xf'),_0x53e2de,_0x91b8('0x10'),JSON['stringify'](_0x23f25c));if(_0x23f25c[_0x91b8('0x11')]){if(_0x23f25c[_0x91b8('0x11')][_0x91b8('0x12')]===0x1f4){logger[_0x91b8('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x53e2de,_0x23f25c[_0x91b8('0x11')][_0x91b8('0x13')]);return _0xf73a2a(_0x23f25c['error']['message']);}logger[_0x91b8('0x11')](_0x91b8('0xd'),_0x53e2de,_0x23f25c['error'][_0x91b8('0x13')]);return _0xdb9902(_0x23f25c['error']['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x53e2de,_0x91b8('0x10'));_0xdb9902(_0x23f25c[_0x91b8('0x14')][_0x91b8('0x13')]);}})[_0x91b8('0x15')](function(_0x4c70cc){logger['error'](_0x91b8('0xd'),_0x53e2de,_0x4c70cc);_0xf73a2a(_0x4c70cc);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 2849956..ae9dafe 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(_0x50403c,_0x1b4d74){var _0x329b8a=function(_0x28ded9){while(--_0x28ded9){_0x50403c['push'](_0x50403c['shift']());}};_0x329b8a(++_0x1b4d74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x5a4c22,_0x262082){var _0x1d86dd=function(_0x229714){while(--_0x229714){_0x5a4c22['push'](_0x5a4c22['shift']());}};_0x1d86dd(++_0x262082);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 5c0c7ff..6bb0a79 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 _0x78f0=['exports','STRING','name','TEXT','sequelize'];(function(_0x2f741a,_0x1411d6){var _0x4f3e30=function(_0x287373){while(--_0x287373){_0x2f741a['push'](_0x2f741a['shift']());}};_0x4f3e30(++_0x1411d6);}(_0x78f0,0x15d));var _0x078f=function(_0x3474e2,_0x497dd8){_0x3474e2=_0x3474e2-0x0;var _0x26fbd3=_0x78f0[_0x3474e2];return _0x26fbd3;};'use strict';var Sequelize=require(_0x078f('0x0'));module[_0x078f('0x1')]={'name':{'type':Sequelize[_0x078f('0x2')],'allowNull':![],'unique':_0x078f('0x3')},'table':{'type':Sequelize[_0x078f('0x2')]},'metric':{'type':Sequelize[_0x078f('0x4')]},'description':{'type':Sequelize[_0x078f('0x2')]}}; \ No newline at end of file +var _0xeffd=['STRING','name','TEXT','sequelize'];(function(_0x37d50f,_0x1c42ed){var _0x1eb933=function(_0x66fed9){while(--_0x66fed9){_0x37d50f['push'](_0x37d50f['shift']());}};_0x1eb933(++_0x1c42ed);}(_0xeffd,0x6b));var _0xdeff=function(_0x24a7e5,_0x58a298){_0x24a7e5=_0x24a7e5-0x0;var _0x13e2d3=_0xeffd[_0x24a7e5];return _0x13e2d3;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'name':{'type':Sequelize[_0xdeff('0x1')],'allowNull':![],'unique':_0xdeff('0x2')},'table':{'type':Sequelize[_0xdeff('0x1')]},'metric':{'type':Sequelize[_0xdeff('0x3')]},'description':{'type':Sequelize[_0xdeff('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 4af4ac4..f8ef3bf 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 _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x26f9f6,_0x311c71){var _0x2e2ce1=function(_0x4bdff8){while(--_0x4bdff8){_0x26f9f6['push'](_0x26f9f6['shift']());}};_0x2e2ce1(++_0x311c71);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5cb952,_0x381d68){_0x5cb952=_0x5cb952-0x0;var _0x968255=_0xdbf5[_0x5cb952];return _0x968255;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file +var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x2c865f,_0x5524aa){var _0x3713db=function(_0x550307){while(--_0x550307){_0x2c865f['push'](_0x2c865f['shift']());}};_0x3713db(++_0x5524aa);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0x24ca[_0x5311a1];return _0x2acb9f;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 3a3614b..64292f8 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 _0x598a=['util','../../config/logger','api','moment','request-promise','./analyticMetric.attributes','exports','define','lodash'];(function(_0x2e68f3,_0x13dc10){var _0x977ca0=function(_0x372c6d){while(--_0x372c6d){_0x2e68f3['push'](_0x2e68f3['shift']());}};_0x977ca0(++_0x13dc10);}(_0x598a,0xfb));var _0xa598=function(_0x3308f3,_0x3e6027){_0x3308f3=_0x3308f3-0x0;var _0x1e9268=_0x598a[_0x3308f3];return _0x1e9268;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var logger=require(_0xa598('0x2'))(_0xa598('0x3'));var moment=require(_0xa598('0x4'));var BPromise=require('bluebird');var rp=require(_0xa598('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa598('0x6'));module[_0xa598('0x7')]=function(_0x41ebaa,_0x2b0ef0){return _0x41ebaa[_0xa598('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf78f=['moment','bluebird','request-promise','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api'];(function(_0x51916d,_0x1074c5){var _0x3fe4e8=function(_0x2ebabb){while(--_0x2ebabb){_0x51916d['push'](_0x51916d['shift']());}};_0x3fe4e8(++_0x1074c5);}(_0xf78f,0x72));var _0xff78=function(_0x313fca,_0x47ac02){_0x313fca=_0x313fca-0x0;var _0x21050b=_0xf78f[_0x313fca];return _0x21050b;};'use strict';var _=require('lodash');var util=require(_0xff78('0x0'));var logger=require(_0xff78('0x1'))(_0xff78('0x2'));var moment=require(_0xff78('0x3'));var BPromise=require(_0xff78('0x4'));var rp=require(_0xff78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x35f208,_0x487ec1){return _0x35f208[_0xff78('0x6')](_0xff78('0x7'),attributes,{'tableName':_0xff78('0x8'),'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 a66b6eb..a3196c3 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 _0xf7dc=['request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x214ff2,_0x196e25){var _0x3c8098=function(_0x261ab1){while(--_0x261ab1){_0x214ff2['push'](_0x214ff2['shift']());}};_0x3c8098(++_0x196e25);}(_0xf7dc,0x1be));var _0xcf7d=function(_0x574bd5,_0x163211){_0x574bd5=_0x574bd5-0x0;var _0x150e5f=_0xf7dc[_0x574bd5];return _0x150e5f;};'use strict';var _=require(_0xcf7d('0x0'));var util=require('util');var moment=require(_0xcf7d('0x1'));var BPromise=require(_0xcf7d('0x2'));var rs=require(_0xcf7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf7d('0x4'))['db'];var utils=require(_0xcf7d('0x5'));var logger=require(_0xcf7d('0x6'))(_0xcf7d('0x7'));var config=require(_0xcf7d('0x8'));var jayson=require(_0xcf7d('0x9'));var client=jayson[_0xcf7d('0xa')][_0xcf7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c1928,_0x31ff2e,_0x3d6218){return new BPromise(function(_0x47e1d3,_0x51513f){return client[_0xcf7d('0xc')](_0x3c1928,_0x3d6218)['then'](function(_0x4b9edc){logger[_0xcf7d('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x31ff2e,_0xcf7d('0xe'));logger['debug'](_0xcf7d('0xf'),_0x31ff2e,'request\x20sent',JSON[_0xcf7d('0x10')](_0x4b9edc));if(_0x4b9edc[_0xcf7d('0x11')]){if(_0x4b9edc['error'][_0xcf7d('0x12')]===0x1f4){logger[_0xcf7d('0x11')](_0xcf7d('0x13'),_0x31ff2e,_0x4b9edc[_0xcf7d('0x11')]['message']);return _0x51513f(_0x4b9edc[_0xcf7d('0x11')][_0xcf7d('0x14')]);}logger['error'](_0xcf7d('0x13'),_0x31ff2e,_0x4b9edc[_0xcf7d('0x11')]['message']);return _0x47e1d3(_0x4b9edc['error']['message']);}else{logger[_0xcf7d('0xd')](_0xcf7d('0x13'),_0x31ff2e,'request\x20sent');_0x47e1d3(_0x4b9edc[_0xcf7d('0x15')][_0xcf7d('0x14')]);}})[_0xcf7d('0x16')](function(_0x35b206){logger[_0xcf7d('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x31ff2e,_0x35b206);_0x51513f(_0x35b206);});});} \ No newline at end of file +var _0x2ff1=['catch','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result'];(function(_0x243c7b,_0x1973fd){var _0x4a632e=function(_0x2ff281){while(--_0x2ff281){_0x243c7b['push'](_0x243c7b['shift']());}};_0x4a632e(++_0x1973fd);}(_0x2ff1,0xd9));var _0x12ff=function(_0x32007d,_0x5f4ae5){_0x32007d=_0x32007d-0x0;var _0x30c5d0=_0x2ff1[_0x32007d];return _0x30c5d0;};'use strict';var _=require('lodash');var util=require(_0x12ff('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12ff('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x12ff('0x2'));var logger=require(_0x12ff('0x3'))('rpc');var config=require(_0x12ff('0x4'));var jayson=require(_0x12ff('0x5'));var client=jayson[_0x12ff('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bf498,_0x1d25de,_0x486d3c){return new BPromise(function(_0x51fcb2,_0x3ff715){return client[_0x12ff('0x7')](_0x4bf498,_0x486d3c)['then'](function(_0x430753){logger[_0x12ff('0x8')]('AnalyticMetric,\x20%s,\x20%s',_0x1d25de,'request\x20sent');logger['debug'](_0x12ff('0x9'),_0x1d25de,_0x12ff('0xa'),JSON[_0x12ff('0xb')](_0x430753));if(_0x430753[_0x12ff('0xc')]){if(_0x430753[_0x12ff('0xc')][_0x12ff('0xd')]===0x1f4){logger[_0x12ff('0xc')](_0x12ff('0xe'),_0x1d25de,_0x430753[_0x12ff('0xc')][_0x12ff('0xf')]);return _0x3ff715(_0x430753[_0x12ff('0xc')][_0x12ff('0xf')]);}logger[_0x12ff('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1d25de,_0x430753[_0x12ff('0xc')][_0x12ff('0xf')]);return _0x51fcb2(_0x430753['error'][_0x12ff('0xf')]);}else{logger['info'](_0x12ff('0xe'),_0x1d25de,'request\x20sent');_0x51fcb2(_0x430753[_0x12ff('0x10')]['message']);}})[_0x12ff('0x11')](function(_0x597ec0){logger['error'](_0x12ff('0xe'),_0x1d25de,_0x597ec0);_0x3ff715(_0x597ec0);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 8ec9ae7..153d77d 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 _0x307e=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x440d63,_0x1eaa0f){var _0x3c8868=function(_0x42018a){while(--_0x42018a){_0x440d63['push'](_0x440d63['shift']());}};_0x3c8868(++_0x1eaa0f);}(_0x307e,0xc9));var _0xe307=function(_0x350099,_0x50bacd){_0x350099=_0x350099-0x0;var _0x29d26f=_0x307e[_0x350099];return _0x29d26f;};'use strict';var multer=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var path=require(_0xe307('0x2'));var timeout=require(_0xe307('0x3'));var express=require(_0xe307('0x4'));var router=express['Router']();var fs_extra=require(_0xe307('0x5'));var auth=require(_0xe307('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe307('0x7'));var controller=require('./analyticMetric.controller');router[_0xe307('0x8')]('/',auth[_0xe307('0x9')](),controller[_0xe307('0xa')]);router['get'](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0xc')]);router[_0xe307('0xd')]('/',auth[_0xe307('0x9')](),controller[_0xe307('0xe')]);router[_0xe307('0xf')](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0x10')]);router[_0xe307('0x11')](_0xe307('0xb'),auth[_0xe307('0x9')](),controller[_0xe307('0x12')]);module[_0xe307('0x13')]=router; \ No newline at end of file +var _0xf1c6=['post','put','update','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x333050,_0x39a31f){var _0x4b8d57=function(_0x23adfb){while(--_0x23adfb){_0x333050['push'](_0x333050['shift']());}};_0x4b8d57(++_0x39a31f);}(_0xf1c6,0x145));var _0x6f1c=function(_0x2bc24f,_0x5f36b4){_0x2bc24f=_0x2bc24f-0x0;var _0x1475c9=_0xf1c6[_0x2bc24f];return _0x1475c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f1c('0x0'));var timeout=require(_0x6f1c('0x1'));var express=require(_0x6f1c('0x2'));var router=express[_0x6f1c('0x3')]();var fs_extra=require(_0x6f1c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f1c('0x5'));var controller=require('./analyticMetric.controller');router[_0x6f1c('0x6')]('/',auth[_0x6f1c('0x7')](),controller[_0x6f1c('0x8')]);router['get'](_0x6f1c('0x9'),auth['isAuthenticated'](),controller[_0x6f1c('0xa')]);router[_0x6f1c('0xb')]('/',auth[_0x6f1c('0x7')](),controller['create']);router[_0x6f1c('0xc')]('/:id',auth[_0x6f1c('0x7')](),controller[_0x6f1c('0xd')]);router['delete'](_0x6f1c('0x9'),auth[_0x6f1c('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 9f74c8a..65b32b8 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 _0xa61d=['exports','sequelize'];(function(_0x33e1bf,_0x32331b){var _0x19c98f=function(_0x4ef7f5){while(--_0x4ef7f5){_0x33e1bf['push'](_0x33e1bf['shift']());}};_0x19c98f(++_0x32331b);}(_0xa61d,0x7f));var _0xda61=function(_0x206f02,_0x36f322){_0x206f02=_0x206f02-0x0;var _0x8a2663=_0xa61d[_0x206f02];return _0x8a2663;};'use strict';var Sequelize=require(_0xda61('0x0'));module[_0xda61('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x8249=['TEXT','sequelize','exports'];(function(_0x82382b,_0x490d89){var _0x39ebed=function(_0x430a69){while(--_0x430a69){_0x82382b['push'](_0x82382b['shift']());}};_0x39ebed(++_0x490d89);}(_0x8249,0x88));var _0x9824=function(_0x54af83,_0x947eb2){_0x54af83=_0x54af83-0x0;var _0x2eaed6=_0x8249[_0x54af83];return _0x2eaed6;};'use strict';var Sequelize=require(_0x9824('0x0'));module[_0x9824('0x1')]={'tree':{'type':Sequelize[_0x9824('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 862fd1e..05de9a5 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 _0xd178=['ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','merge','type','VIRTUAL','options','rows','then','catch','show','params','keys','length','includeAll','include','find','create','body','destroy','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x111408,_0x495ab8){var _0x215895=function(_0x54fade){while(--_0x54fade){_0x111408['push'](_0x111408['shift']());}};_0x215895(++_0x495ab8);}(_0xd178,0x144));var _0x8d17=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xd178[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x8d17('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8d17('0x1'));var moment=require(_0x8d17('0x2'));var BPromise=require(_0x8d17('0x3'));var Mustache=require(_0x8d17('0x4'));var util=require(_0x8d17('0x5'));var path=require(_0x8d17('0x6'));var sox=require(_0x8d17('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d17('0x8'));var _=require(_0x8d17('0x9'));var squel=require(_0x8d17('0xa'));var crypto=require(_0x8d17('0xb'));var jsforce=require(_0x8d17('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8d17('0xd'));var querystring=require(_0x8d17('0xe'));var Papa=require(_0x8d17('0xf'));var Redis=require(_0x8d17('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8d17('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8d17('0x12'));var utils=require(_0x8d17('0x13'));var config=require(_0x8d17('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35c531,_0x507b5c){_0x507b5c=_0x507b5c||0xcc;return function(_0x40cf05){if(_0x40cf05){return _0x35c531[_0x8d17('0x15')](_0x507b5c);}return _0x35c531[_0x8d17('0x16')](_0x507b5c)['end']();};}function respondWithResult(_0xfc10e9,_0x257036){_0x257036=_0x257036||0xc8;return function(_0x1ff34a){if(_0x1ff34a){return _0xfc10e9[_0x8d17('0x16')](_0x257036)['json'](_0x1ff34a);}};}function respondWithFilteredResult(_0x4464ce,_0x595a46){return function(_0x411e05){if(_0x411e05){var _0x1b6c1d=typeof _0x595a46[_0x8d17('0x17')]===_0x8d17('0x18')&&typeof _0x595a46[_0x8d17('0x19')]===_0x8d17('0x18');var _0x4256d5=_0x411e05[_0x8d17('0x1a')];var _0x25042f=_0x1b6c1d?0x0:_0x595a46[_0x8d17('0x17')];var _0x1f59aa=_0x1b6c1d?_0x411e05[_0x8d17('0x1a')]:_0x595a46[_0x8d17('0x17')]+_0x595a46[_0x8d17('0x19')];var _0x83efc4;if(_0x1f59aa>=_0x4256d5){_0x1f59aa=_0x4256d5;_0x83efc4=0xc8;}else{_0x83efc4=0xce;}_0x4464ce[_0x8d17('0x16')](_0x83efc4);return _0x4464ce[_0x8d17('0x1b')](_0x8d17('0x1c'),_0x25042f+'-'+_0x1f59aa+'/'+_0x4256d5)[_0x8d17('0x1d')](_0x411e05);}return null;};}function patchUpdates(_0x555da5){return function(_0x5731a9){try{jsonpatch['apply'](_0x5731a9,_0x555da5,!![]);}catch(_0x3a5903){return BPromise['reject'](_0x3a5903);}return _0x5731a9[_0x8d17('0x1e')]();};}function saveUpdates(_0x5b74f4,_0x72c886){return function(_0x529dae){if(_0x529dae){return _0x529dae[_0x8d17('0x1f')](_0x5b74f4)['then'](function(_0x1d6fd5){return _0x1d6fd5;});}return null;};}function removeEntity(_0x4bb24d,_0x19e644){return function(_0x462014){if(_0x462014){return _0x462014['destroy']()['then'](function(){_0x4bb24d[_0x8d17('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b53d1,_0x4cd2d4){return function(_0x3ed341){if(!_0x3ed341){_0x3b53d1['sendStatus'](0x194);}return _0x3ed341;};}function handleError(_0x270a3a,_0x245774){_0x245774=_0x245774||0x1f4;return function(_0x2ca01b){logger[_0x8d17('0x20')](_0x2ca01b[_0x8d17('0x21')]);if(_0x2ca01b[_0x8d17('0x22')]){delete _0x2ca01b[_0x8d17('0x22')];}_0x270a3a[_0x8d17('0x16')](_0x245774)[_0x8d17('0x23')](_0x2ca01b);};}exports[_0x8d17('0x24')]=function(_0x447e11,_0x26174b){var _0x30d649={},_0x3012af={},_0x5301c8={'count':0x0,'rows':[]};var _0x47dc26=_[_0x8d17('0x25')](db[_0x8d17('0x26')]['rawAttributes'],function(_0x14feb5){return{'name':_0x14feb5[_0x8d17('0x27')],'type':_0x14feb5['type'][_0x8d17('0x28')]};});_0x3012af[_0x8d17('0x29')]=_[_0x8d17('0x25')](_0x47dc26,_0x8d17('0x22'));_0x3012af[_0x8d17('0x2a')]=_['keys'](_0x447e11[_0x8d17('0x2a')]);_0x3012af[_0x8d17('0x2b')]=_[_0x8d17('0x2c')](_0x3012af[_0x8d17('0x29')],_0x3012af[_0x8d17('0x2a')]);_0x30d649['attributes']=_[_0x8d17('0x2c')](_0x3012af['model'],qs[_0x8d17('0x2d')](_0x447e11[_0x8d17('0x2a')][_0x8d17('0x2d')]));_0x30d649[_0x8d17('0x2e')]=_0x30d649[_0x8d17('0x2e')]['length']?_0x30d649[_0x8d17('0x2e')]:_0x3012af[_0x8d17('0x29')];if(!_0x447e11[_0x8d17('0x2a')]['hasOwnProperty'](_0x8d17('0x2f'))){_0x30d649[_0x8d17('0x19')]=qs[_0x8d17('0x19')](_0x447e11[_0x8d17('0x2a')][_0x8d17('0x19')]);_0x30d649[_0x8d17('0x17')]=qs[_0x8d17('0x17')](_0x447e11[_0x8d17('0x2a')][_0x8d17('0x17')]);}_0x30d649['order']=qs[_0x8d17('0x30')](_0x447e11[_0x8d17('0x2a')][_0x8d17('0x30')]);_0x30d649[_0x8d17('0x31')]=qs[_0x8d17('0x2b')](_[_0x8d17('0x32')](_0x447e11['query'],_0x3012af['filters']),_0x47dc26);if(_0x447e11[_0x8d17('0x2a')]['filter']){_0x30d649[_0x8d17('0x31')]=_[_0x8d17('0x33')](_0x30d649[_0x8d17('0x31')],{'$or':_[_0x8d17('0x25')](_0x47dc26,function(_0x19704d){if(_0x19704d[_0x8d17('0x34')]!==_0x8d17('0x35')){var _0xe93288={};_0xe93288[_0x19704d['name']]={'$like':'%'+_0x447e11[_0x8d17('0x2a')]['filter']+'%'};return _0xe93288;}})});}_0x30d649=_[_0x8d17('0x33')]({},_0x30d649,_0x447e11[_0x8d17('0x36')]);var _0x50a134={'where':_0x30d649[_0x8d17('0x31')]};return db[_0x8d17('0x26')][_0x8d17('0x1a')](_0x50a134)['then'](function(_0x211270){_0x5301c8['count']=_0x211270;if(_0x447e11[_0x8d17('0x2a')]['includeAll']){_0x30d649['include']=[{'all':!![]}];}return db[_0x8d17('0x26')]['findAll'](_0x30d649);})['then'](function(_0x318852){_0x5301c8[_0x8d17('0x37')]=_0x318852;return _0x5301c8;})[_0x8d17('0x38')](respondWithFilteredResult(_0x26174b,_0x30d649))[_0x8d17('0x39')](handleError(_0x26174b,null));};exports[_0x8d17('0x3a')]=function(_0x4ee159,_0x56f834){var _0x251cfb={'raw':!![],'where':{'id':_0x4ee159[_0x8d17('0x3b')]['id']}},_0x15162c={};_0x15162c[_0x8d17('0x29')]=_[_0x8d17('0x3c')](db[_0x8d17('0x26')]['rawAttributes']);_0x15162c[_0x8d17('0x2a')]=_['keys'](_0x4ee159[_0x8d17('0x2a')]);_0x15162c['filters']=_['intersection'](_0x15162c['model'],_0x15162c[_0x8d17('0x2a')]);_0x251cfb['attributes']=_[_0x8d17('0x2c')](_0x15162c[_0x8d17('0x29')],qs[_0x8d17('0x2d')](_0x4ee159[_0x8d17('0x2a')][_0x8d17('0x2d')]));_0x251cfb[_0x8d17('0x2e')]=_0x251cfb[_0x8d17('0x2e')][_0x8d17('0x3d')]?_0x251cfb[_0x8d17('0x2e')]:_0x15162c[_0x8d17('0x29')];if(_0x4ee159[_0x8d17('0x2a')][_0x8d17('0x3e')]){_0x251cfb[_0x8d17('0x3f')]=[{'all':!![]}];}_0x251cfb=_['merge']({},_0x251cfb,_0x4ee159[_0x8d17('0x36')]);return db['AnalyticTreeReport'][_0x8d17('0x40')](_0x251cfb)[_0x8d17('0x38')](handleEntityNotFound(_0x56f834,null))['then'](respondWithResult(_0x56f834,null))[_0x8d17('0x39')](handleError(_0x56f834,null));};exports[_0x8d17('0x41')]=function(_0x53aab6,_0x101c2a){return db['AnalyticTreeReport']['create'](_0x53aab6[_0x8d17('0x42')],{})[_0x8d17('0x38')](respondWithResult(_0x101c2a,0xc9))[_0x8d17('0x39')](handleError(_0x101c2a,null));};exports[_0x8d17('0x1f')]=function(_0x5f3bb9,_0x383afd){if(_0x5f3bb9[_0x8d17('0x42')]['id']){delete _0x5f3bb9[_0x8d17('0x42')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x5f3bb9[_0x8d17('0x3b')]['id']}})[_0x8d17('0x38')](handleEntityNotFound(_0x383afd,null))[_0x8d17('0x38')](saveUpdates(_0x5f3bb9[_0x8d17('0x42')],null))[_0x8d17('0x38')](respondWithResult(_0x383afd,null))[_0x8d17('0x39')](handleError(_0x383afd,null));};exports[_0x8d17('0x43')]=function(_0xc6d438,_0x2f7416){return db[_0x8d17('0x26')][_0x8d17('0x40')]({'where':{'id':_0xc6d438[_0x8d17('0x3b')]['id']}})[_0x8d17('0x38')](handleEntityNotFound(_0x2f7416,null))[_0x8d17('0x38')](removeEntity(_0x2f7416,null))[_0x8d17('0x39')](handleError(_0x2f7416,null));}; \ No newline at end of file +var _0xe5ea=['error','name','index','map','AnalyticTreeReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','then','catch','show','params','options','create','body','find','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','update'];(function(_0x347bf8,_0x3eb017){var _0x46f908=function(_0x13f8cd){while(--_0x13f8cd){_0x347bf8['push'](_0x347bf8['shift']());}};_0x46f908(++_0x3eb017);}(_0xe5ea,0xf1));var _0xae5e=function(_0x30998f,_0x57741b){_0x30998f=_0x30998f-0x0;var _0x20c151=_0xe5ea[_0x30998f];return _0x20c151;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae5e('0x0'));var zipdir=require(_0xae5e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae5e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xae5e('0x3'));var util=require(_0xae5e('0x4'));var path=require(_0xae5e('0x5'));var sox=require(_0xae5e('0x6'));var csv=require(_0xae5e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae5e('0x8'));var _=require(_0xae5e('0x9'));var squel=require(_0xae5e('0xa'));var crypto=require('crypto');var jsforce=require(_0xae5e('0xb'));var deskjs=require(_0xae5e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xae5e('0xd'));var Papa=require('papaparse');var Redis=require(_0xae5e('0xe'));var authService=require(_0xae5e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xae5e('0x10'));var hardwareService=require(_0xae5e('0x11'));var logger=require(_0xae5e('0x12'))(_0xae5e('0x13'));var utils=require('../../config/utils');var config=require(_0xae5e('0x14'));var licenseUtil=require(_0xae5e('0x15'));var db=require(_0xae5e('0x16'))['db'];function respondWithStatusCode(_0x11d93c,_0xa93c8a){_0xa93c8a=_0xa93c8a||0xcc;return function(_0x48f905){if(_0x48f905){return _0x11d93c[_0xae5e('0x17')](_0xa93c8a);}return _0x11d93c[_0xae5e('0x18')](_0xa93c8a)[_0xae5e('0x19')]();};}function respondWithResult(_0x36115e,_0x11a517){_0x11a517=_0x11a517||0xc8;return function(_0x30e97d){if(_0x30e97d){return _0x36115e[_0xae5e('0x18')](_0x11a517)['json'](_0x30e97d);}};}function respondWithFilteredResult(_0x3ad519,_0x4380be){return function(_0x1d0a94){if(_0x1d0a94){var _0x5473c7=typeof _0x4380be[_0xae5e('0x1a')]==='undefined'&&typeof _0x4380be[_0xae5e('0x1b')]===_0xae5e('0x1c');var _0x29fda5=_0x1d0a94[_0xae5e('0x1d')];var _0x4c0ff9=_0x5473c7?0x0:_0x4380be['offset'];var _0x5caed4=_0x5473c7?_0x1d0a94[_0xae5e('0x1d')]:_0x4380be[_0xae5e('0x1a')]+_0x4380be[_0xae5e('0x1b')];var _0x5c4adb;if(_0x5caed4>=_0x29fda5){_0x5caed4=_0x29fda5;_0x5c4adb=0xc8;}else{_0x5c4adb=0xce;}_0x3ad519[_0xae5e('0x18')](_0x5c4adb);return _0x3ad519['set'](_0xae5e('0x1e'),_0x4c0ff9+'-'+_0x5caed4+'/'+_0x29fda5)[_0xae5e('0x1f')](_0x1d0a94);}return null;};}function patchUpdates(_0x167c98){return function(_0x284090){try{jsonpatch[_0xae5e('0x20')](_0x284090,_0x167c98,!![]);}catch(_0x1e8abd){return BPromise[_0xae5e('0x21')](_0x1e8abd);}return _0x284090['save']();};}function saveUpdates(_0x181326,_0x348a3a){return function(_0x472556){if(_0x472556){return _0x472556[_0xae5e('0x22')](_0x181326)['then'](function(_0x2658bc){return _0x2658bc;});}return null;};}function removeEntity(_0x3dcfff,_0x86dfa0){return function(_0x2090b8){if(_0x2090b8){return _0x2090b8['destroy']()['then'](function(){_0x3dcfff[_0xae5e('0x18')](0xcc)[_0xae5e('0x19')]();});}};}function handleEntityNotFound(_0x55aba5,_0x581828){return function(_0x520af0){if(!_0x520af0){_0x55aba5['sendStatus'](0x194);}return _0x520af0;};}function handleError(_0x544d5b,_0x11ba3f){_0x11ba3f=_0x11ba3f||0x1f4;return function(_0x4a752b){logger[_0xae5e('0x23')](_0x4a752b['stack']);if(_0x4a752b[_0xae5e('0x24')]){delete _0x4a752b[_0xae5e('0x24')];}_0x544d5b[_0xae5e('0x18')](_0x11ba3f)['send'](_0x4a752b);};}exports[_0xae5e('0x25')]=function(_0x247d1b,_0x558ad6){var _0x4381d1={},_0x10941e={},_0x1276fc={'count':0x0,'rows':[]};var _0x21b861=_[_0xae5e('0x26')](db[_0xae5e('0x27')][_0xae5e('0x28')],function(_0x35e074){return{'name':_0x35e074['fieldName'],'type':_0x35e074['type'][_0xae5e('0x29')]};});_0x10941e[_0xae5e('0x2a')]=_[_0xae5e('0x26')](_0x21b861,_0xae5e('0x24'));_0x10941e[_0xae5e('0x2b')]=_[_0xae5e('0x2c')](_0x247d1b[_0xae5e('0x2b')]);_0x10941e[_0xae5e('0x2d')]=_[_0xae5e('0x2e')](_0x10941e[_0xae5e('0x2a')],_0x10941e[_0xae5e('0x2b')]);_0x4381d1[_0xae5e('0x2f')]=_[_0xae5e('0x2e')](_0x10941e[_0xae5e('0x2a')],qs[_0xae5e('0x30')](_0x247d1b['query']['fields']));_0x4381d1[_0xae5e('0x2f')]=_0x4381d1[_0xae5e('0x2f')][_0xae5e('0x31')]?_0x4381d1[_0xae5e('0x2f')]:_0x10941e[_0xae5e('0x2a')];if(!_0x247d1b[_0xae5e('0x2b')][_0xae5e('0x32')](_0xae5e('0x33'))){_0x4381d1['limit']=qs[_0xae5e('0x1b')](_0x247d1b['query'][_0xae5e('0x1b')]);_0x4381d1[_0xae5e('0x1a')]=qs[_0xae5e('0x1a')](_0x247d1b[_0xae5e('0x2b')][_0xae5e('0x1a')]);}_0x4381d1['order']=qs['sort'](_0x247d1b[_0xae5e('0x2b')][_0xae5e('0x34')]);_0x4381d1[_0xae5e('0x35')]=qs[_0xae5e('0x2d')](_[_0xae5e('0x36')](_0x247d1b[_0xae5e('0x2b')],_0x10941e[_0xae5e('0x2d')]),_0x21b861);if(_0x247d1b[_0xae5e('0x2b')][_0xae5e('0x37')]){_0x4381d1[_0xae5e('0x35')]=_['merge'](_0x4381d1[_0xae5e('0x35')],{'$or':_[_0xae5e('0x26')](_0x21b861,function(_0x544fe8){if(_0x544fe8[_0xae5e('0x38')]!==_0xae5e('0x39')){var _0x561166={};_0x561166[_0x544fe8[_0xae5e('0x24')]]={'$like':'%'+_0x247d1b[_0xae5e('0x2b')][_0xae5e('0x37')]+'%'};return _0x561166;}})});}_0x4381d1=_[_0xae5e('0x3a')]({},_0x4381d1,_0x247d1b['options']);var _0x1358f3={'where':_0x4381d1[_0xae5e('0x35')]};return db['AnalyticTreeReport'][_0xae5e('0x1d')](_0x1358f3)['then'](function(_0x3c777c){_0x1276fc[_0xae5e('0x1d')]=_0x3c777c;if(_0x247d1b[_0xae5e('0x2b')][_0xae5e('0x3b')]){_0x4381d1[_0xae5e('0x3c')]=[{'all':!![]}];}return db[_0xae5e('0x27')]['findAll'](_0x4381d1);})['then'](function(_0x791f39){_0x1276fc['rows']=_0x791f39;return _0x1276fc;})[_0xae5e('0x3d')](respondWithFilteredResult(_0x558ad6,_0x4381d1))[_0xae5e('0x3e')](handleError(_0x558ad6,null));};exports[_0xae5e('0x3f')]=function(_0x342d1f,_0x5108f6){var _0x121c8d={'raw':!![],'where':{'id':_0x342d1f[_0xae5e('0x40')]['id']}},_0x331135={};_0x331135[_0xae5e('0x2a')]=_['keys'](db['AnalyticTreeReport'][_0xae5e('0x28')]);_0x331135['query']=_['keys'](_0x342d1f[_0xae5e('0x2b')]);_0x331135[_0xae5e('0x2d')]=_[_0xae5e('0x2e')](_0x331135[_0xae5e('0x2a')],_0x331135['query']);_0x121c8d['attributes']=_[_0xae5e('0x2e')](_0x331135[_0xae5e('0x2a')],qs[_0xae5e('0x30')](_0x342d1f['query'][_0xae5e('0x30')]));_0x121c8d[_0xae5e('0x2f')]=_0x121c8d[_0xae5e('0x2f')][_0xae5e('0x31')]?_0x121c8d[_0xae5e('0x2f')]:_0x331135['model'];if(_0x342d1f[_0xae5e('0x2b')][_0xae5e('0x3b')]){_0x121c8d[_0xae5e('0x3c')]=[{'all':!![]}];}_0x121c8d=_[_0xae5e('0x3a')]({},_0x121c8d,_0x342d1f[_0xae5e('0x41')]);return db['AnalyticTreeReport']['find'](_0x121c8d)[_0xae5e('0x3d')](handleEntityNotFound(_0x5108f6,null))[_0xae5e('0x3d')](respondWithResult(_0x5108f6,null))[_0xae5e('0x3e')](handleError(_0x5108f6,null));};exports['create']=function(_0x2c170,_0x339216){return db['AnalyticTreeReport'][_0xae5e('0x42')](_0x2c170[_0xae5e('0x43')],{})['then'](respondWithResult(_0x339216,0xc9))[_0xae5e('0x3e')](handleError(_0x339216,null));};exports[_0xae5e('0x22')]=function(_0x4e4e99,_0x5da75d){if(_0x4e4e99[_0xae5e('0x43')]['id']){delete _0x4e4e99[_0xae5e('0x43')]['id'];}return db[_0xae5e('0x27')]['find']({'where':{'id':_0x4e4e99[_0xae5e('0x40')]['id']}})[_0xae5e('0x3d')](handleEntityNotFound(_0x5da75d,null))[_0xae5e('0x3d')](saveUpdates(_0x4e4e99['body'],null))['then'](respondWithResult(_0x5da75d,null))[_0xae5e('0x3e')](handleError(_0x5da75d,null));};exports['destroy']=function(_0x234bfc,_0x39d5db){return db[_0xae5e('0x27')][_0xae5e('0x44')]({'where':{'id':_0x234bfc[_0xae5e('0x40')]['id']}})[_0xae5e('0x3d')](handleEntityNotFound(_0x39d5db,null))['then'](removeEntity(_0x39d5db,null))[_0xae5e('0x3e')](handleError(_0x39d5db,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 8266e12..04297ca 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 _0x87f8=['AnalyticTreeReport','analytics_report_trees','lodash','util','moment','bluebird','path','rimraf','./analyticTreeReport.attributes','exports'];(function(_0x118986,_0x2ea044){var _0x25c9e6=function(_0x13b4d4){while(--_0x13b4d4){_0x118986['push'](_0x118986['shift']());}};_0x25c9e6(++_0x2ea044);}(_0x87f8,0x106));var _0x887f=function(_0x1e7364,_0x141ff0){_0x1e7364=_0x1e7364-0x0;var _0x9d05a4=_0x87f8[_0x1e7364];return _0x9d05a4;};'use strict';var _=require(_0x887f('0x0'));var util=require(_0x887f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x887f('0x2'));var BPromise=require(_0x887f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x887f('0x4'));var rimraf=require(_0x887f('0x5'));var config=require('../../config/environment');var attributes=require(_0x887f('0x6'));module[_0x887f('0x7')]=function(_0x579037,_0x2c82fd){return _0x579037['define'](_0x887f('0x8'),attributes,{'tableName':_0x887f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4d5=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x277b7b,_0x19a357){var _0x2a1c83=function(_0x4567f1){while(--_0x4567f1){_0x277b7b['push'](_0x277b7b['shift']());}};_0x2a1c83(++_0x19a357);}(_0xe4d5,0xb7));var _0x5e4d=function(_0x2c54db,_0x4decb4){_0x2c54db=_0x2c54db-0x0;var _0x40c4e4=_0xe4d5[_0x2c54db];return _0x40c4e4;};'use strict';var _=require(_0x5e4d('0x0'));var util=require(_0x5e4d('0x1'));var logger=require(_0x5e4d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e4d('0x3'));var rp=require(_0x5e4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e4d('0x5'));var config=require(_0x5e4d('0x6'));var attributes=require(_0x5e4d('0x7'));module[_0x5e4d('0x8')]=function(_0x3f90e4,_0x9338){return _0x3f90e4[_0x5e4d('0x9')](_0x5e4d('0xa'),attributes,{'tableName':_0x5e4d('0xb'),'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 5a0e57b..bb46e5a 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(_0x1d2806,_0x54bebb){var _0x4fa43a=function(_0x35ec69){while(--_0x35ec69){_0x1d2806['push'](_0x1d2806['shift']());}};_0x4fa43a(++_0x54bebb);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x222afd,_0x82e7b){_0x222afd=_0x222afd-0x0;var _0x5f2f39=_0x7a54[_0x222afd];return _0x5f2f39;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 3cd0629..045042b 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 _0xf610=['isAuthenticated','index','/:id','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x15916f,_0x3a89ca){var _0x8f6ab6=function(_0x284ae6){while(--_0x284ae6){_0x15916f['push'](_0x15916f['shift']());}};_0x8f6ab6(++_0x3a89ca);}(_0xf610,0xa0));var _0x0f61=function(_0x223732,_0x1bd6d4){_0x223732=_0x223732-0x0;var _0x230140=_0xf610[_0x223732];return _0x230140;};'use strict';var multer=require(_0x0f61('0x0'));var util=require('util');var path=require(_0x0f61('0x1'));var timeout=require(_0x0f61('0x2'));var express=require('express');var router=express[_0x0f61('0x3')]();var fs_extra=require(_0x0f61('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0f61('0x5'));var config=require(_0x0f61('0x6'));var controller=require(_0x0f61('0x7'));router['get']('/',auth[_0x0f61('0x8')](),controller[_0x0f61('0x9')]);router['get'](_0x0f61('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0f61('0x8')](),controller['create']);router['put'](_0x0f61('0xa'),auth[_0x0f61('0x8')](),controller['update']);router[_0x0f61('0xb')](_0x0f61('0xa'),auth['isAuthenticated'](),controller[_0x0f61('0xc')]);module[_0x0f61('0xd')]=router; \ No newline at end of file +var _0xecb6=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1c156e,_0x3263a6){var _0x58fc22=function(_0x42f1eb){while(--_0x42f1eb){_0x1c156e['push'](_0x1c156e['shift']());}};_0x58fc22(++_0x3263a6);}(_0xecb6,0x186));var _0x6ecb=function(_0x264cda,_0x7f05ab){_0x264cda=_0x264cda-0x0;var _0x3e38ac=_0xecb6[_0x264cda];return _0x3e38ac;};'use strict';var multer=require(_0x6ecb('0x0'));var util=require('util');var path=require(_0x6ecb('0x1'));var timeout=require(_0x6ecb('0x2'));var express=require(_0x6ecb('0x3'));var router=express[_0x6ecb('0x4')]();var fs_extra=require(_0x6ecb('0x5'));var auth=require(_0x6ecb('0x6'));var interaction=require(_0x6ecb('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x6ecb('0x8')]('/',auth[_0x6ecb('0x9')](),controller[_0x6ecb('0xa')]);router[_0x6ecb('0x8')](_0x6ecb('0xb'),auth['isAuthenticated'](),controller[_0x6ecb('0xc')]);router[_0x6ecb('0xd')]('/',auth[_0x6ecb('0x9')](),controller['create']);router[_0x6ecb('0xe')](_0x6ecb('0xb'),auth['isAuthenticated'](),controller[_0x6ecb('0xf')]);router[_0x6ecb('0x10')](_0x6ecb('0xb'),auth[_0x6ecb('0x9')](),controller[_0x6ecb('0x11')]);module[_0x6ecb('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 89b5792..bc7c869 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 _0x5640=['STRING','sequelize'];(function(_0x169140,_0x9b4fa){var _0x8cf839=function(_0x597c3e){while(--_0x597c3e){_0x169140['push'](_0x169140['shift']());}};_0x8cf839(++_0x9b4fa);}(_0x5640,0x111));var _0x0564=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5640[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x0564('0x0'));module['exports']={'name':{'type':Sequelize[_0x0564('0x1')]},'basename':{'type':Sequelize[_0x0564('0x1')]},'type':{'type':Sequelize[_0x0564('0x1')]}}; \ No newline at end of file +var _0x6364=['STRING'];(function(_0x3cfa86,_0x18603c){var _0x16edd6=function(_0x1350fc){while(--_0x1350fc){_0x3cfa86['push'](_0x3cfa86['shift']());}};_0x16edd6(++_0x18603c);}(_0x6364,0x8f));var _0x4636=function(_0x3c19e7,_0x2d682f){_0x3c19e7=_0x3c19e7-0x0;var _0x4b9bde=_0x6364[_0x3c19e7];return _0x4b9bde;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4636('0x0')]},'basename':{'type':Sequelize[_0x4636('0x0')]},'type':{'type':Sequelize[_0x4636('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 23c9f0d..e074cba 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 _0x2278=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','clone','createdAt','updatedAt','body','create','update','file','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','basename','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x3a67bc,_0x450a99){var _0x3d96c9=function(_0x1711e8){while(--_0x1711e8){_0x3a67bc['push'](_0x3a67bc['shift']());}};_0x3d96c9(++_0x450a99);}(_0x2278,0x1f3));var _0x8227=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2278[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8227('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8227('0x1'));var moment=require(_0x8227('0x2'));var BPromise=require(_0x8227('0x3'));var Mustache=require(_0x8227('0x4'));var util=require(_0x8227('0x5'));var path=require('path');var sox=require(_0x8227('0x6'));var csv=require(_0x8227('0x7'));var ejs=require(_0x8227('0x8'));var fs=require('fs');var fs_extra=require(_0x8227('0x9'));var _=require(_0x8227('0xa'));var squel=require(_0x8227('0xb'));var crypto=require(_0x8227('0xc'));var jsforce=require(_0x8227('0xd'));var deskjs=require(_0x8227('0xe'));var toCsv=require(_0x8227('0x7'));var querystring=require('querystring');var Papa=require(_0x8227('0xf'));var Redis=require(_0x8227('0x10'));var authService=require(_0x8227('0x11'));var qs=require(_0x8227('0x12'));var as=require(_0x8227('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8227('0x14'))('api');var utils=require(_0x8227('0x15'));var config=require(_0x8227('0x16'));var licenseUtil=require(_0x8227('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49e07e,_0x315564){_0x315564=_0x315564||0xcc;return function(_0x4cb999){if(_0x4cb999){return _0x49e07e['sendStatus'](_0x315564);}return _0x49e07e[_0x8227('0x18')](_0x315564)['end']();};}function respondWithResult(_0xbcf6cd,_0x354aff){_0x354aff=_0x354aff||0xc8;return function(_0x13d846){if(_0x13d846){return _0xbcf6cd[_0x8227('0x18')](_0x354aff)[_0x8227('0x19')](_0x13d846);}};}function respondWithFilteredResult(_0x2c02cd,_0x414d6b){return function(_0x4a3d8a){if(_0x4a3d8a){var _0x2a3b8d=typeof _0x414d6b[_0x8227('0x1a')]===_0x8227('0x1b')&&typeof _0x414d6b[_0x8227('0x1c')]==='undefined';var _0x28fa7d=_0x4a3d8a[_0x8227('0x1d')];var _0x54eadd=_0x2a3b8d?0x0:_0x414d6b[_0x8227('0x1a')];var _0x331688=_0x2a3b8d?_0x4a3d8a[_0x8227('0x1d')]:_0x414d6b[_0x8227('0x1a')]+_0x414d6b[_0x8227('0x1c')];var _0x5b902d;if(_0x331688>=_0x28fa7d){_0x331688=_0x28fa7d;_0x5b902d=0xc8;}else{_0x5b902d=0xce;}_0x2c02cd['status'](_0x5b902d);return _0x2c02cd[_0x8227('0x1e')]('Content-Range',_0x54eadd+'-'+_0x331688+'/'+_0x28fa7d)[_0x8227('0x19')](_0x4a3d8a);}return null;};}function patchUpdates(_0x52f7e4){return function(_0xb836e4){try{jsonpatch[_0x8227('0x1f')](_0xb836e4,_0x52f7e4,!![]);}catch(_0x2342d6){return BPromise[_0x8227('0x20')](_0x2342d6);}return _0xb836e4[_0x8227('0x21')]();};}function saveUpdates(_0x25f921,_0x2c7373){return function(_0x1a0e6c){if(_0x1a0e6c){return _0x1a0e6c['update'](_0x25f921)[_0x8227('0x22')](function(_0x4c5fc8){return _0x4c5fc8;});}return null;};}function removeEntity(_0x59371b,_0x497120){return function(_0x28c12b){if(_0x28c12b){return _0x28c12b[_0x8227('0x23')]()[_0x8227('0x22')](function(){_0x59371b['status'](0xcc)[_0x8227('0x24')]();});}};}function handleEntityNotFound(_0x33ea9e,_0x1b093d){return function(_0x515626){if(!_0x515626){_0x33ea9e[_0x8227('0x25')](0x194);}return _0x515626;};}function handleError(_0x189115,_0x4b625c){_0x4b625c=_0x4b625c||0x1f4;return function(_0x308169){logger[_0x8227('0x26')](_0x308169[_0x8227('0x27')]);if(_0x308169[_0x8227('0x28')]){delete _0x308169[_0x8227('0x28')];}_0x189115[_0x8227('0x18')](_0x4b625c)[_0x8227('0x29')](_0x308169);};}exports[_0x8227('0x2a')]=function(_0x5ace0d,_0x3a947c){var _0x916b99={},_0x4b3539={},_0x288a47={'count':0x0,'rows':[]};var _0x5b560d=_[_0x8227('0x2b')](db[_0x8227('0x2c')][_0x8227('0x2d')],function(_0x44f402){return{'name':_0x44f402[_0x8227('0x2e')],'type':_0x44f402[_0x8227('0x2f')][_0x8227('0x30')]};});_0x4b3539['model']=_[_0x8227('0x2b')](_0x5b560d,'name');_0x4b3539[_0x8227('0x31')]=_[_0x8227('0x32')](_0x5ace0d['query']);_0x4b3539['filters']=_[_0x8227('0x33')](_0x4b3539['model'],_0x4b3539['query']);_0x916b99['attributes']=_[_0x8227('0x33')](_0x4b3539[_0x8227('0x34')],qs[_0x8227('0x35')](_0x5ace0d['query']['fields']));_0x916b99[_0x8227('0x36')]=_0x916b99[_0x8227('0x36')][_0x8227('0x37')]?_0x916b99[_0x8227('0x36')]:_0x4b3539[_0x8227('0x34')];if(!_0x5ace0d['query']['hasOwnProperty'](_0x8227('0x38'))){_0x916b99['limit']=qs[_0x8227('0x1c')](_0x5ace0d['query'][_0x8227('0x1c')]);_0x916b99['offset']=qs[_0x8227('0x1a')](_0x5ace0d[_0x8227('0x31')]['offset']);}_0x916b99['order']=qs[_0x8227('0x39')](_0x5ace0d[_0x8227('0x31')]['sort']);_0x916b99[_0x8227('0x3a')]=qs['filters'](_['pick'](_0x5ace0d[_0x8227('0x31')],_0x4b3539[_0x8227('0x3b')]),_0x5b560d);if(_0x5ace0d[_0x8227('0x31')][_0x8227('0x3c')]){_0x916b99[_0x8227('0x3a')]=_[_0x8227('0x3d')](_0x916b99[_0x8227('0x3a')],{'$or':_[_0x8227('0x2b')](_0x5b560d,function(_0x4954b3){if(_0x4954b3[_0x8227('0x2f')]!==_0x8227('0x3e')){var _0x3ce067={};_0x3ce067[_0x4954b3[_0x8227('0x28')]]={'$like':'%'+_0x5ace0d[_0x8227('0x31')][_0x8227('0x3c')]+'%'};return _0x3ce067;}})});}_0x916b99=_[_0x8227('0x3d')]({},_0x916b99,_0x5ace0d[_0x8227('0x3f')]);var _0x401aab={'where':_0x916b99[_0x8227('0x3a')]};return db['Attachment'][_0x8227('0x1d')](_0x401aab)[_0x8227('0x22')](function(_0x5607d8){_0x288a47[_0x8227('0x1d')]=_0x5607d8;if(_0x5ace0d[_0x8227('0x31')][_0x8227('0x40')]){_0x916b99[_0x8227('0x41')]=[{'all':!![]}];}return db[_0x8227('0x2c')][_0x8227('0x42')](_0x916b99);})[_0x8227('0x22')](function(_0x289864){_0x288a47['rows']=_0x289864;return _0x288a47;})[_0x8227('0x22')](respondWithFilteredResult(_0x3a947c,_0x916b99))[_0x8227('0x43')](handleError(_0x3a947c,null));};exports[_0x8227('0x44')]=function(_0x567089,_0x4c14c0){var _0x29e940={'raw':!![],'where':{'id':_0x567089[_0x8227('0x45')]['id']}},_0x593be0={};_0x593be0[_0x8227('0x34')]=_[_0x8227('0x32')](db[_0x8227('0x2c')][_0x8227('0x2d')]);_0x593be0[_0x8227('0x31')]=_[_0x8227('0x32')](_0x567089[_0x8227('0x31')]);_0x593be0[_0x8227('0x3b')]=_[_0x8227('0x33')](_0x593be0[_0x8227('0x34')],_0x593be0[_0x8227('0x31')]);_0x29e940['attributes']=_['intersection'](_0x593be0[_0x8227('0x34')],qs['fields'](_0x567089['query'][_0x8227('0x35')]));_0x29e940['attributes']=_0x29e940[_0x8227('0x36')]['length']?_0x29e940[_0x8227('0x36')]:_0x593be0['model'];if(_0x567089['query']['includeAll']){_0x29e940[_0x8227('0x41')]=[{'all':!![]}];}_0x29e940=_[_0x8227('0x3d')]({},_0x29e940,_0x567089[_0x8227('0x3f')]);return db['Attachment'][_0x8227('0x46')](_0x29e940)[_0x8227('0x22')](handleEntityNotFound(_0x4c14c0,null))[_0x8227('0x22')](respondWithResult(_0x4c14c0,null))[_0x8227('0x43')](handleError(_0x4c14c0,null));};exports[_0x8227('0x47')]=function(_0x245359,_0x20c4d1){var _0x2aca97={'where':{'id':_0x245359[_0x8227('0x45')]['id']}},_0x201f32={};_0x201f32[_0x8227('0x34')]=_[_0x8227('0x32')](db['Attachment'][_0x8227('0x2d')]);_0x2aca97['attributes']=_[_0x8227('0x33')](_0x201f32[_0x8227('0x34')],qs[_0x8227('0x35')](_0x245359[_0x8227('0x31')]['fields']));_0x2aca97[_0x8227('0x36')]=_0x2aca97['attributes'][_0x8227('0x37')]?_0x2aca97[_0x8227('0x36')]:_0x201f32[_0x8227('0x34')];if(_0x245359[_0x8227('0x31')]['includeAll']){_0x2aca97[_0x8227('0x41')]=[{'all':!![]}];}_0x2aca97=_[_0x8227('0x3d')]({},_0x2aca97,_0x245359[_0x8227('0x3f')]);return db[_0x8227('0x2c')][_0x8227('0x46')](_0x2aca97)[_0x8227('0x22')](handleEntityNotFound(_0x20c4d1,null))[_0x8227('0x22')](function(_0x3e974c){if(_0x3e974c){var _0xfb277a=_0x3e974c['get']({'plain':!![]});_0xfb277a=qs['omit'](_0xfb277a,['id',_0x8227('0x48'),_0x8227('0x49')]);_0x245359[_0x8227('0x4a')]=_['omit'](_0x245359[_0x8227('0x4a')],['id',_0x8227('0x48'),_0x8227('0x49')]);return db[_0x8227('0x2c')][_0x8227('0x4b')](_[_0x8227('0x3d')](_0xfb277a,_0x245359['body']),{'include':_0x245359[_0x8227('0x31')][_0x8227('0x40')]?[{'all':!![]}]:undefined});}})[_0x8227('0x22')](respondWithResult(_0x20c4d1,0xc9))[_0x8227('0x43')](handleError(_0x20c4d1,null));};exports[_0x8227('0x4c')]=function(_0x313df8,_0x28a9a8){if(_0x313df8['body']['id']){delete _0x313df8[_0x8227('0x4a')]['id'];}return db['Attachment']['find']({'where':{'id':_0x313df8[_0x8227('0x45')]['id']}})[_0x8227('0x22')](handleEntityNotFound(_0x28a9a8,null))[_0x8227('0x22')](saveUpdates(_0x313df8[_0x8227('0x4a')],null))[_0x8227('0x22')](respondWithResult(_0x28a9a8,null))[_0x8227('0x43')](handleError(_0x28a9a8,null));};exports[_0x8227('0x23')]=function(_0x2d8703,_0x121fd5){return db[_0x8227('0x2c')][_0x8227('0x46')]({'where':{'id':_0x2d8703[_0x8227('0x45')]['id']}})[_0x8227('0x22')](handleEntityNotFound(_0x121fd5,null))[_0x8227('0x22')](removeEntity(_0x121fd5,null))[_0x8227('0x43')](handleError(_0x121fd5,null));};exports[_0x8227('0x4b')]=function(_0x55d564,_0x4d7bd6,_0x23e0bc){_0x55d564[_0x8227('0x4a')][_0x8227('0x28')]=_0x55d564[_0x8227('0x4d')]['originalname'];_0x55d564[_0x8227('0x4a')]['basename']=_0x55d564[_0x8227('0x4d')][_0x8227('0x4e')];_0x55d564[_0x8227('0x4a')][_0x8227('0x2f')]=_0x55d564[_0x8227('0x4d')]['mimetype'];return db[_0x8227('0x2c')][_0x8227('0x4b')](_0x55d564[_0x8227('0x4a')])[_0x8227('0x22')](respondWithResult(_0x4d7bd6,0xc9))[_0x8227('0x43')](handleError(_0x4d7bd6,null));};exports[_0x8227('0x4f')]=function(_0x564461,_0x2f7fda,_0x130aa9){return db[_0x8227('0x2c')][_0x8227('0x50')]({'where':{'id':_0x564461['params']['id']},'raw':!![]})[_0x8227('0x22')](handleEntityNotFound(_0x2f7fda,null))['then'](function(_0x1a5913){if(_0x1a5913){var _0x4739b0=_0x1a5913[_0x8227('0x51')]!==null;var _0x26bf36=path[_0x8227('0x52')](config[_0x8227('0x53')],'server/files/attachments/');if(_0x4739b0){_0x26bf36=path['join'](_0x26bf36,_0x8227('0x54'));}var _0x539d73=path[_0x8227('0x52')](_0x26bf36,_0x1a5913[_0x8227('0x55')]);return _0x2f7fda[_0x8227('0x4f')](_0x539d73);}})[_0x8227('0x43')](handleError(_0x2f7fda,null));}; \ No newline at end of file +var _0xc90c=['rawAttributes','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','clone','find','omit','createdAt','updatedAt','body','create','file','originalname','filename','type','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','Attachment'];(function(_0x381005,_0x3956b4){var _0x233f91=function(_0x10cd84){while(--_0x10cd84){_0x381005['push'](_0x381005['shift']());}};_0x233f91(++_0x3956b4);}(_0xc90c,0x195));var _0xcc90=function(_0x1c13b7,_0x2e0e97){_0x1c13b7=_0x1c13b7-0x0;var _0x1d9581=_0xc90c[_0x1c13b7];return _0x1d9581;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc90('0x0'));var zipdir=require(_0xcc90('0x1'));var jsonpatch=require(_0xcc90('0x2'));var rp=require(_0xcc90('0x3'));var moment=require(_0xcc90('0x4'));var BPromise=require(_0xcc90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc90('0x6'));var sox=require(_0xcc90('0x7'));var csv=require('to-csv');var ejs=require(_0xcc90('0x8'));var fs=require('fs');var fs_extra=require(_0xcc90('0x9'));var _=require(_0xcc90('0xa'));var squel=require(_0xcc90('0xb'));var crypto=require('crypto');var jsforce=require(_0xcc90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcc90('0xd'));var querystring=require(_0xcc90('0xe'));var Papa=require(_0xcc90('0xf'));var Redis=require(_0xcc90('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcc90('0x11'));var as=require(_0xcc90('0x12'));var hardwareService=require(_0xcc90('0x13'));var logger=require(_0xcc90('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xcc90('0x15'));var licenseUtil=require(_0xcc90('0x16'));var db=require(_0xcc90('0x17'))['db'];function respondWithStatusCode(_0x1fb153,_0x1d8587){_0x1d8587=_0x1d8587||0xcc;return function(_0x23f91b){if(_0x23f91b){return _0x1fb153[_0xcc90('0x18')](_0x1d8587);}return _0x1fb153[_0xcc90('0x19')](_0x1d8587)[_0xcc90('0x1a')]();};}function respondWithResult(_0x2da561,_0x521252){_0x521252=_0x521252||0xc8;return function(_0x4c71a3){if(_0x4c71a3){return _0x2da561[_0xcc90('0x19')](_0x521252)['json'](_0x4c71a3);}};}function respondWithFilteredResult(_0x24da4a,_0x16aac7){return function(_0x4499ff){if(_0x4499ff){var _0x1766f5=typeof _0x16aac7[_0xcc90('0x1b')]===_0xcc90('0x1c')&&typeof _0x16aac7[_0xcc90('0x1d')]==='undefined';var _0x43b057=_0x4499ff[_0xcc90('0x1e')];var _0x1d61b7=_0x1766f5?0x0:_0x16aac7[_0xcc90('0x1b')];var _0x3f2c6c=_0x1766f5?_0x4499ff[_0xcc90('0x1e')]:_0x16aac7['offset']+_0x16aac7[_0xcc90('0x1d')];var _0x5623f1;if(_0x3f2c6c>=_0x43b057){_0x3f2c6c=_0x43b057;_0x5623f1=0xc8;}else{_0x5623f1=0xce;}_0x24da4a[_0xcc90('0x19')](_0x5623f1);return _0x24da4a[_0xcc90('0x1f')](_0xcc90('0x20'),_0x1d61b7+'-'+_0x3f2c6c+'/'+_0x43b057)['json'](_0x4499ff);}return null;};}function patchUpdates(_0x117ed1){return function(_0xed0ffc){try{jsonpatch[_0xcc90('0x21')](_0xed0ffc,_0x117ed1,!![]);}catch(_0x23ba9d){return BPromise[_0xcc90('0x22')](_0x23ba9d);}return _0xed0ffc[_0xcc90('0x23')]();};}function saveUpdates(_0x1663ab,_0x2270af){return function(_0x5cdae2){if(_0x5cdae2){return _0x5cdae2[_0xcc90('0x24')](_0x1663ab)['then'](function(_0x47d8c6){return _0x47d8c6;});}return null;};}function removeEntity(_0x39db75,_0x2beec8){return function(_0x5cc54e){if(_0x5cc54e){return _0x5cc54e[_0xcc90('0x25')]()[_0xcc90('0x26')](function(){_0x39db75[_0xcc90('0x19')](0xcc)[_0xcc90('0x1a')]();});}};}function handleEntityNotFound(_0x49353f,_0x11167c){return function(_0x1d2c43){if(!_0x1d2c43){_0x49353f[_0xcc90('0x18')](0x194);}return _0x1d2c43;};}function handleError(_0x51475a,_0xdbd219){_0xdbd219=_0xdbd219||0x1f4;return function(_0x33274e){logger[_0xcc90('0x27')](_0x33274e[_0xcc90('0x28')]);if(_0x33274e['name']){delete _0x33274e[_0xcc90('0x29')];}_0x51475a['status'](_0xdbd219)['send'](_0x33274e);};}exports[_0xcc90('0x2a')]=function(_0x2f2eaa,_0x40f347){var _0x5e7392={},_0x288eaa={},_0xde8eca={'count':0x0,'rows':[]};var _0x4124f7=_[_0xcc90('0x2b')](db[_0xcc90('0x2c')][_0xcc90('0x2d')],function(_0x2a19ef){return{'name':_0x2a19ef['fieldName'],'type':_0x2a19ef['type'][_0xcc90('0x2e')]};});_0x288eaa['model']=_['map'](_0x4124f7,_0xcc90('0x29'));_0x288eaa['query']=_[_0xcc90('0x2f')](_0x2f2eaa[_0xcc90('0x30')]);_0x288eaa['filters']=_[_0xcc90('0x31')](_0x288eaa[_0xcc90('0x32')],_0x288eaa[_0xcc90('0x30')]);_0x5e7392[_0xcc90('0x33')]=_[_0xcc90('0x31')](_0x288eaa[_0xcc90('0x32')],qs['fields'](_0x2f2eaa[_0xcc90('0x30')][_0xcc90('0x34')]));_0x5e7392[_0xcc90('0x33')]=_0x5e7392[_0xcc90('0x33')][_0xcc90('0x35')]?_0x5e7392[_0xcc90('0x33')]:_0x288eaa[_0xcc90('0x32')];if(!_0x2f2eaa[_0xcc90('0x30')][_0xcc90('0x36')](_0xcc90('0x37'))){_0x5e7392[_0xcc90('0x1d')]=qs[_0xcc90('0x1d')](_0x2f2eaa['query'][_0xcc90('0x1d')]);_0x5e7392[_0xcc90('0x1b')]=qs[_0xcc90('0x1b')](_0x2f2eaa['query']['offset']);}_0x5e7392[_0xcc90('0x38')]=qs['sort'](_0x2f2eaa[_0xcc90('0x30')][_0xcc90('0x39')]);_0x5e7392[_0xcc90('0x3a')]=qs[_0xcc90('0x3b')](_[_0xcc90('0x3c')](_0x2f2eaa[_0xcc90('0x30')],_0x288eaa[_0xcc90('0x3b')]),_0x4124f7);if(_0x2f2eaa[_0xcc90('0x30')][_0xcc90('0x3d')]){_0x5e7392[_0xcc90('0x3a')]=_[_0xcc90('0x3e')](_0x5e7392[_0xcc90('0x3a')],{'$or':_[_0xcc90('0x2b')](_0x4124f7,function(_0xcaa9ea){if(_0xcaa9ea['type']!==_0xcc90('0x3f')){var _0x52c321={};_0x52c321[_0xcaa9ea[_0xcc90('0x29')]]={'$like':'%'+_0x2f2eaa[_0xcc90('0x30')][_0xcc90('0x3d')]+'%'};return _0x52c321;}})});}_0x5e7392=_[_0xcc90('0x3e')]({},_0x5e7392,_0x2f2eaa[_0xcc90('0x40')]);var _0x57dfa3={'where':_0x5e7392['where']};return db[_0xcc90('0x2c')][_0xcc90('0x1e')](_0x57dfa3)[_0xcc90('0x26')](function(_0x506a64){_0xde8eca['count']=_0x506a64;if(_0x2f2eaa[_0xcc90('0x30')][_0xcc90('0x41')]){_0x5e7392[_0xcc90('0x42')]=[{'all':!![]}];}return db['Attachment'][_0xcc90('0x43')](_0x5e7392);})['then'](function(_0xc599ec){_0xde8eca[_0xcc90('0x44')]=_0xc599ec;return _0xde8eca;})['then'](respondWithFilteredResult(_0x40f347,_0x5e7392))[_0xcc90('0x45')](handleError(_0x40f347,null));};exports['show']=function(_0x4a46f7,_0x2ef209){var _0x2cd2de={'raw':!![],'where':{'id':_0x4a46f7[_0xcc90('0x46')]['id']}},_0x28f52f={};_0x28f52f[_0xcc90('0x32')]=_[_0xcc90('0x2f')](db['Attachment']['rawAttributes']);_0x28f52f[_0xcc90('0x30')]=_[_0xcc90('0x2f')](_0x4a46f7['query']);_0x28f52f[_0xcc90('0x3b')]=_[_0xcc90('0x31')](_0x28f52f[_0xcc90('0x32')],_0x28f52f[_0xcc90('0x30')]);_0x2cd2de[_0xcc90('0x33')]=_[_0xcc90('0x31')](_0x28f52f[_0xcc90('0x32')],qs[_0xcc90('0x34')](_0x4a46f7[_0xcc90('0x30')][_0xcc90('0x34')]));_0x2cd2de[_0xcc90('0x33')]=_0x2cd2de['attributes']['length']?_0x2cd2de[_0xcc90('0x33')]:_0x28f52f[_0xcc90('0x32')];if(_0x4a46f7[_0xcc90('0x30')][_0xcc90('0x41')]){_0x2cd2de[_0xcc90('0x42')]=[{'all':!![]}];}_0x2cd2de=_[_0xcc90('0x3e')]({},_0x2cd2de,_0x4a46f7[_0xcc90('0x40')]);return db[_0xcc90('0x2c')]['find'](_0x2cd2de)[_0xcc90('0x26')](handleEntityNotFound(_0x2ef209,null))[_0xcc90('0x26')](respondWithResult(_0x2ef209,null))[_0xcc90('0x45')](handleError(_0x2ef209,null));};exports[_0xcc90('0x47')]=function(_0x509409,_0x25b44a){var _0x2c45b5={'where':{'id':_0x509409[_0xcc90('0x46')]['id']}},_0x788cc1={};_0x788cc1[_0xcc90('0x32')]=_[_0xcc90('0x2f')](db[_0xcc90('0x2c')][_0xcc90('0x2d')]);_0x2c45b5[_0xcc90('0x33')]=_['intersection'](_0x788cc1[_0xcc90('0x32')],qs[_0xcc90('0x34')](_0x509409['query'][_0xcc90('0x34')]));_0x2c45b5[_0xcc90('0x33')]=_0x2c45b5[_0xcc90('0x33')][_0xcc90('0x35')]?_0x2c45b5['attributes']:_0x788cc1[_0xcc90('0x32')];if(_0x509409[_0xcc90('0x30')]['includeAll']){_0x2c45b5['include']=[{'all':!![]}];}_0x2c45b5=_['merge']({},_0x2c45b5,_0x509409['options']);return db[_0xcc90('0x2c')][_0xcc90('0x48')](_0x2c45b5)[_0xcc90('0x26')](handleEntityNotFound(_0x25b44a,null))[_0xcc90('0x26')](function(_0x467a56){if(_0x467a56){var _0x232534=_0x467a56['get']({'plain':!![]});_0x232534=qs[_0xcc90('0x49')](_0x232534,['id',_0xcc90('0x4a'),'updatedAt']);_0x509409['body']=_['omit'](_0x509409['body'],['id',_0xcc90('0x4a'),_0xcc90('0x4b')]);return db[_0xcc90('0x2c')]['create'](_['merge'](_0x232534,_0x509409['body']),{'include':_0x509409[_0xcc90('0x30')][_0xcc90('0x41')]?[{'all':!![]}]:undefined});}})[_0xcc90('0x26')](respondWithResult(_0x25b44a,0xc9))[_0xcc90('0x45')](handleError(_0x25b44a,null));};exports[_0xcc90('0x24')]=function(_0x2da337,_0x4c26e8){if(_0x2da337[_0xcc90('0x4c')]['id']){delete _0x2da337['body']['id'];}return db[_0xcc90('0x2c')]['find']({'where':{'id':_0x2da337[_0xcc90('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c26e8,null))['then'](saveUpdates(_0x2da337[_0xcc90('0x4c')],null))[_0xcc90('0x26')](respondWithResult(_0x4c26e8,null))[_0xcc90('0x45')](handleError(_0x4c26e8,null));};exports[_0xcc90('0x25')]=function(_0x5b01b5,_0x455fb7){return db[_0xcc90('0x2c')][_0xcc90('0x48')]({'where':{'id':_0x5b01b5[_0xcc90('0x46')]['id']}})['then'](handleEntityNotFound(_0x455fb7,null))[_0xcc90('0x26')](removeEntity(_0x455fb7,null))[_0xcc90('0x45')](handleError(_0x455fb7,null));};exports[_0xcc90('0x4d')]=function(_0x69e2c4,_0x25092b,_0x2475da){_0x69e2c4[_0xcc90('0x4c')][_0xcc90('0x29')]=_0x69e2c4[_0xcc90('0x4e')][_0xcc90('0x4f')];_0x69e2c4[_0xcc90('0x4c')]['basename']=_0x69e2c4['file'][_0xcc90('0x50')];_0x69e2c4['body'][_0xcc90('0x51')]=_0x69e2c4['file'][_0xcc90('0x52')];return db[_0xcc90('0x2c')][_0xcc90('0x4d')](_0x69e2c4[_0xcc90('0x4c')])[_0xcc90('0x26')](respondWithResult(_0x25092b,0xc9))['catch'](handleError(_0x25092b,null));};exports[_0xcc90('0x53')]=function(_0x178195,_0x4bdf37,_0x5c8666){return db['Attachment'][_0xcc90('0x54')]({'where':{'id':_0x178195[_0xcc90('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4bdf37,null))[_0xcc90('0x26')](function(_0x51af4f){if(_0x51af4f){var _0x4d7410=_0x51af4f[_0xcc90('0x55')]!==null;var _0x79e50=path[_0xcc90('0x56')](config['root'],_0xcc90('0x57'));if(_0x4d7410){_0x79e50=path['join'](_0x79e50,_0xcc90('0x58'));}var _0x3e8cc4=path['join'](_0x79e50,_0x51af4f[_0xcc90('0x59')]);return _0x4bdf37['download'](_0x3e8cc4);}})[_0xcc90('0x45')](handleError(_0x4bdf37,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 674898c..d053cc2 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 _0xf71b=['Attachment','attachments','lodash','util','../../config/logger','api','bluebird','path','rimraf','./attachment.attributes','define'];(function(_0x5f1e39,_0x4686b3){var _0x3837a8=function(_0x3c6f73){while(--_0x3c6f73){_0x5f1e39['push'](_0x5f1e39['shift']());}};_0x3837a8(++_0x4686b3);}(_0xf71b,0x157));var _0xbf71=function(_0x4479c4,_0x3ea7f1){_0x4479c4=_0x4479c4-0x0;var _0x27c84f=_0xf71b[_0x4479c4];return _0x27c84f;};'use strict';var _=require(_0xbf71('0x0'));var util=require(_0xbf71('0x1'));var logger=require(_0xbf71('0x2'))(_0xbf71('0x3'));var moment=require('moment');var BPromise=require(_0xbf71('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf71('0x5'));var rimraf=require(_0xbf71('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf71('0x7'));module['exports']=function(_0x59daa4,_0x243621){return _0x59daa4[_0xbf71('0x8')](_0xbf71('0x9'),attributes,{'tableName':_0xbf71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbace=['../../config/logger','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util'];(function(_0x2e9aab,_0x56b941){var _0xeb3a86=function(_0x20fcd4){while(--_0x20fcd4){_0x2e9aab['push'](_0x2e9aab['shift']());}};_0xeb3a86(++_0x56b941);}(_0xbace,0xfa));var _0xebac=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbace[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xebac('0x0'));var util=require(_0xebac('0x1'));var logger=require(_0xebac('0x2'))('api');var moment=require('moment');var BPromise=require(_0xebac('0x3'));var rp=require(_0xebac('0x4'));var fs=require('fs');var path=require(_0xebac('0x5'));var rimraf=require('rimraf');var config=require(_0xebac('0x6'));var attributes=require(_0xebac('0x7'));module[_0xebac('0x8')]=function(_0x57c3c3,_0x2ac966){return _0x57c3c3[_0xebac('0x9')](_0xebac('0xa'),attributes,{'tableName':_0xebac('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 af3190a..ee3e58e 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 _0x688a=['result','catch','create','body','options','CreateAttachment','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Attachment,\x20%s,\x20%s'];(function(_0x1735e9,_0x34e915){var _0x5c2b8b=function(_0x4a4e6d){while(--_0x4a4e6d){_0x1735e9['push'](_0x1735e9['shift']());}};_0x5c2b8b(++_0x34e915);}(_0x688a,0x124));var _0xa688=function(_0x14bcf0,_0xedfb4b){_0x14bcf0=_0x14bcf0-0x0;var _0x5b2c56=_0x688a[_0x14bcf0];return _0x5b2c56;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var moment=require(_0xa688('0x2'));var BPromise=require('bluebird');var rs=require(_0xa688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa688('0x4'))['db'];var utils=require(_0xa688('0x5'));var logger=require('../../config/logger')(_0xa688('0x6'));var config=require(_0xa688('0x7'));var jayson=require(_0xa688('0x8'));var client=jayson[_0xa688('0x9')][_0xa688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a362a,_0x49e75d,_0x5aee29){return new BPromise(function(_0x45c969,_0x3f3d81){return client[_0xa688('0xb')](_0x2a362a,_0x5aee29)['then'](function(_0x4d3b92){logger[_0xa688('0xc')]('Attachment,\x20%s,\x20%s',_0x49e75d,'request\x20sent');logger[_0xa688('0xd')](_0xa688('0xe'),_0x49e75d,_0xa688('0xf'),JSON[_0xa688('0x10')](_0x4d3b92));if(_0x4d3b92[_0xa688('0x11')]){if(_0x4d3b92[_0xa688('0x11')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x49e75d,_0x4d3b92[_0xa688('0x11')][_0xa688('0x12')]);return _0x3f3d81(_0x4d3b92['error'][_0xa688('0x12')]);}logger['error'](_0xa688('0x13'),_0x49e75d,_0x4d3b92[_0xa688('0x11')]['message']);return _0x45c969(_0x4d3b92['error'][_0xa688('0x12')]);}else{logger['info'](_0xa688('0x13'),_0x49e75d,'request\x20sent');_0x45c969(_0x4d3b92[_0xa688('0x14')][_0xa688('0x12')]);}})[_0xa688('0x15')](function(_0x25b453){logger[_0xa688('0x11')](_0xa688('0x13'),_0x49e75d,_0x25b453);_0x3f3d81(_0x25b453);});});}exports['CreateAttachment']=function(_0x59e392){var _0x14ca3c=this;return new Promise(function(_0x1330d5,_0x5dc07f){return db['Attachment'][_0xa688('0x16')](_0x59e392[_0xa688('0x17')],{'raw':_0x59e392['options']?_0x59e392[_0xa688('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x152cfe){logger[_0xa688('0xc')](_0xa688('0x19'),_0x59e392);logger[_0xa688('0xd')](_0xa688('0x19'),_0x59e392,JSON[_0xa688('0x10')](_0x152cfe));_0x1330d5(_0x152cfe);})[_0xa688('0x15')](function(_0x203214){logger[_0xa688('0x11')](_0xa688('0x19'),_0x203214[_0xa688('0x12')],_0x59e392);_0x5dc07f(_0x14ca3c[_0xa688('0x11')](0x1f4,_0x203214[_0xa688('0x12')]));});});}; \ No newline at end of file +var _0x131e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','Attachment,\x20%s,\x20%s','catch','Attachment','create','options','raw','CreateAttachment','bluebird','randomstring'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x131e,0x1ec));var _0xe131=function(_0x253f3c,_0x273533){_0x253f3c=_0x253f3c-0x0;var _0xbbffcc=_0x131e[_0x253f3c];return _0xbbffcc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe131('0x0'));var rs=require(_0xe131('0x1'));var fs=require('fs');var Redis=require(_0xe131('0x2'));var db=require(_0xe131('0x3'))['db'];var utils=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('rpc');var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')][_0xe131('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1002a6,_0x48a90e,_0x5c4eb5){return new BPromise(function(_0x562617,_0x4bf386){return client[_0xe131('0xa')](_0x1002a6,_0x5c4eb5)[_0xe131('0xb')](function(_0x530ecb){logger[_0xe131('0xc')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0xe131('0xd'));logger[_0xe131('0xe')](_0xe131('0xf'),_0x48a90e,_0xe131('0xd'),JSON[_0xe131('0x10')](_0x530ecb));if(_0x530ecb[_0xe131('0x11')]){if(_0x530ecb[_0xe131('0x11')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x48a90e,_0x530ecb['error'][_0xe131('0x12')]);return _0x4bf386(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}logger[_0xe131('0x11')](_0xe131('0x13'),_0x48a90e,_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);return _0x562617(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x48a90e,'request\x20sent');_0x562617(_0x530ecb['result']['message']);}})[_0xe131('0x14')](function(_0x32091b){logger[_0xe131('0x11')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0x32091b);_0x4bf386(_0x32091b);});});}exports['CreateAttachment']=function(_0x400f6b){var _0x2e2bf8=this;return new Promise(function(_0x3bbca8,_0x1a1e03){return db[_0xe131('0x15')][_0xe131('0x16')](_0x400f6b['body'],{'raw':_0x400f6b[_0xe131('0x17')]?_0x400f6b[_0xe131('0x17')][_0xe131('0x18')]===undefined?!![]:![]:!![]})[_0xe131('0xb')](function(_0x2d6c6b){logger['info']('CreateAttachment',_0x400f6b);logger[_0xe131('0xe')](_0xe131('0x19'),_0x400f6b,JSON['stringify'](_0x2d6c6b));_0x3bbca8(_0x2d6c6b);})[_0xe131('0x14')](function(_0x55b0c5){logger['error'](_0xe131('0x19'),_0x55b0c5[_0xe131('0x12')],_0x400f6b);_0x1a1e03(_0x2e2bf8[_0xe131('0x11')](0x1f4,_0x55b0c5[_0xe131('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 7f621c4..a79c85b 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x9f4654,_0xcb9c42){var _0xe857a3=function(_0xde37dc){while(--_0xde37dc){_0x9f4654['push'](_0x9f4654['shift']());}};_0xe857a3(++_0xcb9c42);}(_0xb10b,0x12a));var _0xbb10=function(_0x513683,_0x56bd88){_0x513683=_0x513683-0x0;var _0x6028e=_0xb10b[_0x513683];return _0x6028e;};'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('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x1ede57,_0x516345){var _0x38c633=function(_0x3cb248){while(--_0x3cb248){_0x1ede57['push'](_0x1ede57['shift']());}};_0x38c633(++_0x516345);}(_0xb10b,0x12a));var _0xbb10=function(_0x4eda22,_0x3d2db4){_0x4eda22=_0x4eda22-0x0;var _0x4a5706=_0xb10b[_0x4eda22];return _0x4a5706;};'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('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 2d3b5e1..bc02c33 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 _0x751b=['findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','google','profile','email','callback','authenticate','/login','use','clientSecret','secret','callbackURL'];(function(_0x4c1c47,_0x410899){var _0x171a8e=function(_0x4a4a6d){while(--_0x4a4a6d){_0x4c1c47['push'](_0x4c1c47['shift']());}};_0x171a8e(++_0x410899);}(_0x751b,0x1cd));var _0xb751=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x751b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb751('0x0'));var passport=require(_0xb751('0x1'));var GoogleStrategy=require(_0xb751('0x2'))[_0xb751('0x3')];var moment=require(_0xb751('0x4'));var db=require(_0xb751('0x5'))['db'];var config=require(_0xb751('0x6'));var signToken=require(_0xb751('0x7'))[_0xb751('0x8')];var utils=require(_0xb751('0x9'));exports['login']=passport['authenticate'](_0xb751('0xa'),{'failureRedirect':'/login','scope':[_0xb751('0xb'),_0xb751('0xc')],'session':![]});exports[_0xb751('0xd')]=passport[_0xb751('0xe')]('google',{'failureRedirect':_0xb751('0xf'),'session':![]});passport[_0xb751('0x10')](new GoogleStrategy({'clientID':config[_0xb751('0xa')]?config[_0xb751('0xa')]['clientID']:'id','clientSecret':config[_0xb751('0xa')]?config[_0xb751('0xa')][_0xb751('0x11')]:_0xb751('0x12'),'callbackURL':config['google']?config['google'][_0xb751('0x13')]:''},function(_0x34a4db,_0x2c8453,_0x4b3cde,_0x1e5287){var _0x5ee184,_0x54ea92;return db['Setting'][_0xb751('0x14')]({'where':{'id':0x1},'attributes':[_0xb751('0x15'),_0xb751('0x16')],'raw':!![]})[_0xb751('0x17')](function(_0x2db8c5){_0x5ee184=_0x2db8c5;return db[_0xb751('0x18')][_0xb751('0x19')]({'where':{'email':_[_0xb751('0x1a')](_0x4b3cde[_0xb751('0x1b')],_0xb751('0x1c')),'role':{'$or':['admin',_0xb751('0x1d'),_0xb751('0x1e')]}}});})[_0xb751('0x17')](function(_0xc493ae){_0x54ea92=_0xc493ae;if(_0x54ea92){if(_0x54ea92[_0xb751('0x1f')]){return _0x1e5287(_0xb751('0x20'));}else if(_0x5ee184[_0xb751('0x16')]>0x0){if(_0x54ea92['blocked']){if(moment(_0x54ea92[_0xb751('0x21')])[_0xb751('0x22')](_0x5ee184[_0xb751('0x16')],'minutes')>moment()){return _0x1e5287(_0xb751('0x20'));}else{return utils[_0xb751('0x23')](_0x54ea92,0x0,![],null)[_0xb751('0x17')](function(){return utils[_0xb751('0x24')](_0x54ea92);})[_0xb751('0x17')](function(){return _0x1e5287(null,_0x54ea92);});}}else{return utils[_0xb751('0x24')](_0x54ea92)[_0xb751('0x17')](function(){return _0x1e5287(null,_0x54ea92);});}}else{return utils['getLicense'](_0x54ea92)['then'](function(){return _0x1e5287(null,_0x54ea92);});}}return _0x1e5287(_0xb751('0x20'));})['catch'](function(_0x4ee668){_0x1e5287(_0x4ee668);});})); \ No newline at end of file +var _0x2d64=['signToken','../../config/utils','login','authenticate','google','/login','profile','email','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','emails','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x2d64,0x162));var _0x42d6=function(_0x4d2fed,_0x31bec1){_0x4d2fed=_0x4d2fed-0x0;var _0x627dc3=_0x2d64[_0x4d2fed];return _0x627dc3;};'use strict';var _=require(_0x42d6('0x0'));var passport=require(_0x42d6('0x1'));var GoogleStrategy=require(_0x42d6('0x2'))[_0x42d6('0x3')];var moment=require(_0x42d6('0x4'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x42d6('0x5'))[_0x42d6('0x6')];var utils=require(_0x42d6('0x7'));exports[_0x42d6('0x8')]=passport[_0x42d6('0x9')](_0x42d6('0xa'),{'failureRedirect':_0x42d6('0xb'),'scope':[_0x42d6('0xc'),_0x42d6('0xd')],'session':![]});exports['callback']=passport[_0x42d6('0x9')](_0x42d6('0xa'),{'failureRedirect':_0x42d6('0xb'),'session':![]});passport[_0x42d6('0xe')](new GoogleStrategy({'clientID':config[_0x42d6('0xa')]?config['google'][_0x42d6('0xf')]:'id','clientSecret':config['google']?config[_0x42d6('0xa')][_0x42d6('0x10')]:'secret','callbackURL':config[_0x42d6('0xa')]?config[_0x42d6('0xa')][_0x42d6('0x11')]:''},function(_0x53fe81,_0x3f3b4c,_0x2151ef,_0x545658){var _0x4cabad,_0x5baa9c;return db[_0x42d6('0x12')][_0x42d6('0x13')]({'where':{'id':0x1},'attributes':[_0x42d6('0x14'),_0x42d6('0x15')],'raw':!![]})[_0x42d6('0x16')](function(_0x2fff86){_0x4cabad=_0x2fff86;return db[_0x42d6('0x17')]['find']({'where':{'email':_['map'](_0x2151ef[_0x42d6('0x18')],'value'),'role':{'$or':[_0x42d6('0x19'),_0x42d6('0x1a'),'agent']}}});})[_0x42d6('0x16')](function(_0x52d1d5){_0x5baa9c=_0x52d1d5;if(_0x5baa9c){if(_0x5baa9c[_0x42d6('0x1b')]){return _0x545658(_0x42d6('0x1c'));}else if(_0x4cabad[_0x42d6('0x15')]>0x0){if(_0x5baa9c[_0x42d6('0x1d')]){if(moment(_0x5baa9c[_0x42d6('0x1e')])[_0x42d6('0x1f')](_0x4cabad[_0x42d6('0x15')],_0x42d6('0x20'))>moment()){return _0x545658(_0x42d6('0x1c'));}else{return utils[_0x42d6('0x21')](_0x5baa9c,0x0,![],null)[_0x42d6('0x16')](function(){return utils['getLicense'](_0x5baa9c);})[_0x42d6('0x16')](function(){return _0x545658(null,_0x5baa9c);});}}else{return utils[_0x42d6('0x22')](_0x5baa9c)[_0x42d6('0x16')](function(){return _0x545658(null,_0x5baa9c);});}}else{return utils[_0x42d6('0x22')](_0x5baa9c)['then'](function(){return _0x545658(null,_0x5baa9c);});}}return _0x545658(_0x42d6('0x1c'));})[_0x42d6('0x23')](function(_0x225593){_0x545658(_0x225593);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index b4b22cf..d132f2c 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 _0x4262=['exports','express','passport','Router','../user/user.controller.js','get','/callback','callback','isMiddleware','login'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4262,0x15f));var _0x2426=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4262[_0x432682];return _0x463d05;};'use strict';var express=require(_0x2426('0x0'));var passport=require(_0x2426('0x1'));var router=express[_0x2426('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x2426('0x3'));var authService=require('../../components/auth/service');router[_0x2426('0x4')]('/',controller['login']);router['get'](_0x2426('0x5'),controller[_0x2426('0x6')],authService[_0x2426('0x7')],userController[_0x2426('0x8')],authService['setTokenCookie']);module[_0x2426('0x9')]=router; \ No newline at end of file +var _0x5b7b=['login','/callback','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','get'];(function(_0x422ac3,_0x48bbd4){var _0x53c0d4=function(_0x4b50f6){while(--_0x4b50f6){_0x422ac3['push'](_0x422ac3['shift']());}};_0x53c0d4(++_0x48bbd4);}(_0x5b7b,0x1a2));var _0xb5b7=function(_0x48d7aa,_0x52349c){_0x48d7aa=_0x48d7aa-0x0;var _0x138fc6=_0x5b7b[_0x48d7aa];return _0x138fc6;};'use strict';var express=require('express');var passport=require(_0xb5b7('0x0'));var router=express[_0xb5b7('0x1')]();var controller=require(_0xb5b7('0x2'));var userController=require(_0xb5b7('0x3'));var authService=require('../../components/auth/service');router[_0xb5b7('0x4')]('/',controller[_0xb5b7('0x5')]);router[_0xb5b7('0x4')](_0xb5b7('0x6'),controller['callback'],authService['isMiddleware'],userController['login'],authService[_0xb5b7('0x7')]);module[_0xb5b7('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 00888e7..738c5c8 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 _0x6c20=['params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','Password\x20reset!','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','authenticate','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset'];(function(_0x5a7cfe,_0x25f9cf){var _0x5079bd=function(_0x4649a2){while(--_0x4649a2){_0x5a7cfe['push'](_0x5a7cfe['shift']());}};_0x5079bd(++_0x25f9cf);}(_0x6c20,0xaf));var _0x06c2=function(_0x327473,_0x26d1cc){_0x327473=_0x327473-0x0;var _0x594ce7=_0x6c20[_0x327473];return _0x594ce7;};'use strict';var util=require(_0x06c2('0x0'));var passport=require(_0x06c2('0x1'));var LocalStrategy=require(_0x06c2('0x2'))[_0x06c2('0x3')];var jayson=require('jayson/promise');var _=require(_0x06c2('0x4'));var rs=require(_0x06c2('0x5'));var moment=require(_0x06c2('0x6'));var db=require(_0x06c2('0x7'))['db'];var authService=require(_0x06c2('0x8'));var utils=require(_0x06c2('0x9'));var client=jayson[_0x06c2('0xa')][_0x06c2('0xb')]({'port':0x232b});function localAuthenticate(_0x4650ba,_0x7e3e6b,_0x8ebe3e,_0x15311d){var _0x259762,_0x160b7e;return db[_0x06c2('0xc')][_0x06c2('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x06c2('0xe')],'raw':!![]})[_0x06c2('0xf')](function(_0x5c303){_0x259762=_0x5c303;return _0x4650ba[_0x06c2('0xd')]({'attributes':['id',_0x06c2('0x10'),_0x06c2('0x11'),'salt',_0x06c2('0x12'),_0x06c2('0x13'),'blocked',_0x06c2('0x14'),_0x06c2('0x15')],'where':{'name':_0x7e3e6b,'role':{'$or':[_0x06c2('0x16'),_0x06c2('0x17'),_0x06c2('0x18')]}}});})['then'](function(_0x38c2fb){if(!_0x38c2fb||_0x38c2fb&&_0x38c2fb[_0x06c2('0x10')]!==_0x7e3e6b){throw new Error(_0x06c2('0x19'));}else{_0x160b7e=_0x38c2fb;return _0x160b7e;}})['then'](function(){_0x160b7e['authenticate'](_0x8ebe3e,function(_0x400101,_0x244cba){var _0x555be9=_0x160b7e[_0x06c2('0x15')]+0x1;if(_0x400101){return _0x15311d(_0x400101);}else if(!_0x244cba){if(_0x160b7e[_0x06c2('0x13')]){return _0x15311d(null,![],{'message':_0x06c2('0x19')});}else if(_0x259762['allowedLoginAttempts']>0x0){if(_0x160b7e[_0x06c2('0x1a')]){if(_0x259762[_0x06c2('0xe')]>0x0){if(moment(_0x160b7e[_0x06c2('0x14')])[_0x06c2('0x1b')](_0x259762[_0x06c2('0xe')],_0x06c2('0x1c'))>moment()){return _0x15311d(null,![],{'message':_0x06c2('0x19')});}else{return utils[_0x06c2('0x1d')](_0x160b7e,_0x555be9,![],null)['then'](function(){return _0x15311d(null,![],{'message':_0x06c2('0x19')});});}}else{return _0x15311d(null,![],{'message':_0x06c2('0x19')});}}else{if(_0x555be9>=_0x259762[_0x06c2('0x1e')]){return utils[_0x06c2('0x1d')](_0x160b7e,0x0,!![],moment())[_0x06c2('0xf')](function(){return _0x15311d(null,![],{'message':_0x06c2('0x19')});});}else{return utils[_0x06c2('0x1d')](_0x160b7e,_0x555be9,![],null)[_0x06c2('0xf')](function(){return _0x15311d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x15311d(null,![],{'message':_0x06c2('0x19')});}}else{if(_0x160b7e[_0x06c2('0x13')]){return _0x15311d(null,![],{'message':_0x06c2('0x19')});}else if(_0x259762[_0x06c2('0x1e')]>0x0){if(_0x160b7e['blocked']){if(_0x259762['blockDuration']>0x0){if(moment(_0x160b7e[_0x06c2('0x14')])['add'](_0x259762['blockDuration'],_0x06c2('0x1c'))>moment()){return _0x15311d(null,![],{'message':_0x06c2('0x19')});}else{return utils['clearBlockUser'](_0x160b7e,0x0,![],null)['then'](function(){return utils[_0x06c2('0x1f')](_0x160b7e);})[_0x06c2('0xf')](function(){return _0x15311d(null,_0x160b7e);});}}else{return _0x15311d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x06c2('0x1d')](_0x160b7e,0x0,![],null)['then'](function(){return utils['getLicense'](_0x160b7e);})['then'](function(){return _0x15311d(null,_0x160b7e);})[_0x06c2('0x20')](function(_0x5be8d6){return _0x15311d(null,![],_0x5be8d6);});}}else{if(_0x160b7e['blocked']){return _0x15311d(null,![],{'message':_0x06c2('0x19')});}else{return utils['getLicense'](_0x160b7e)['then'](function(){return _0x15311d(null,_0x160b7e);});}}}});})[_0x06c2('0x20')](function(_0x588f0a){return _0x15311d(null,![],_0x588f0a);});}function sendServiceMail(_0x14b675){return db['MailAccount'][_0x06c2('0x21')]({'where':{'service':!![]},'attributes':['id',_0x06c2('0x10'),_0x06c2('0x22')],'include':[{'model':db[_0x06c2('0x23')],'as':_0x06c2('0x24')}]})[_0x06c2('0xf')](function(_0x594134){if(!_0x594134){throw new Error(_0x06c2('0x25'));}var _0x2c308c={'tls':{'rejectUnauthorized':![]}};if(_0x594134['Smtp']['service']){_0x2c308c[_0x06c2('0x26')]=_0x594134[_0x06c2('0x24')][_0x06c2('0x26')];}else{_0x2c308c[_0x06c2('0x27')]=_0x594134[_0x06c2('0x24')][_0x06c2('0x27')];_0x2c308c[_0x06c2('0x28')]=_0x594134[_0x06c2('0x24')][_0x06c2('0x28')];_0x2c308c[_0x06c2('0x29')]=_0x594134[_0x06c2('0x24')][_0x06c2('0x29')];}if(_0x594134[_0x06c2('0x24')][_0x06c2('0x2a')]){_0x2c308c['auth']={'user':_0x594134[_0x06c2('0x24')]['user'],'pass':_0x594134[_0x06c2('0x24')][_0x06c2('0x2b')]};}var _0x5340a4={'account':_0x2c308c,'message':_[_0x06c2('0x2c')]({'from':util[_0x06c2('0x2d')](_0x06c2('0x2e'),_0x594134[_0x06c2('0x10')],_0x594134[_0x06c2('0x22')]||_0x594134['Smtp'][_0x06c2('0x17')])},_0x14b675)};return client[_0x06c2('0x2f')](_0x06c2('0x30'),_0x5340a4);})[_0x06c2('0xf')](function(_0x15cbea){if(_0x15cbea[_0x06c2('0x31')]){throw new Error(util[_0x06c2('0x2d')](_0x06c2('0x32'),_0x15cbea[_0x06c2('0x31')][_0x06c2('0x33')]||JSON['stringify'](_0x15cbea[_0x06c2('0x31')])));}return!![];});}function handleError(_0x92894b,_0x22b49d,_0x5564af){return _0x92894b[_0x06c2('0x34')](_0x22b49d||0x1f4)[_0x06c2('0x35')]({'message':_0x5564af?_0x5564af[_0x06c2('0x33')]||_0x5564af:''});}exports[_0x06c2('0x36')]=function(_0x46dcfe,_0x31ad41,_0x377b5a){passport[_0x06c2('0x37')]('local',function(_0x2aee39,_0x2f4e1d,_0x5cde5f){var _0x584414=_0x2aee39||_0x5cde5f;if(_0x584414){return handleError(_0x31ad41,0x191,_0x584414);}if(!_0x2f4e1d){return handleError(_0x31ad41,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x8305f2={'payload':{'id':_0x2f4e1d['id'],'role':_0x2f4e1d[_0x06c2('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x06c2('0x38')](_0x8305f2)[_0x06c2('0xf')](function(_0x1ca014){_0x31ad41[_0x06c2('0x39')]({'id':_0x2f4e1d['id'],'token':_0x1ca014,'statusCall':'','isAlreadyLogged':_0x2f4e1d['online']});});}})(_0x46dcfe,_0x31ad41,_0x377b5a);};exports['forgot']=function(_0x10335c,_0x5513c6,_0x39161e){if(!_0x10335c[_0x06c2('0x3a')]['email']){return handleError(_0x5513c6,0x1f4,{'message':_0x06c2('0x3b')});}var _0x16736a=rs[_0x06c2('0x3c')]();_0x10335c[_0x06c2('0x3a')][_0x06c2('0x22')]=_0x10335c[_0x06c2('0x3a')][_0x06c2('0x22')][_0x06c2('0x3d')]()[_0x06c2('0x3e')]();var _0xc69177;return db['Setting'][_0x06c2('0xd')]({'where':{'id':0x1},'attributes':[_0x06c2('0x1e'),'blockDuration'],'raw':!![]})[_0x06c2('0xf')](function(_0x140c88){_0xc69177=_0x140c88;return db[_0x06c2('0x3f')]['find']({'where':{'email':_0x10335c[_0x06c2('0x3a')][_0x06c2('0x22')]}});})[_0x06c2('0xf')](function(_0x49351d){if(!_0x49351d){throw new Error(_0x06c2('0x40'));}if(_0x49351d[_0x06c2('0x13')]){throw new Error(_0x06c2('0x41'));}if(_0x49351d[_0x06c2('0x1a')]){if(moment(_0x49351d[_0x06c2('0x14')])[_0x06c2('0x1b')](_0xc69177[_0x06c2('0xe')],_0x06c2('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x49351d[_0x06c2('0x1a')]=![];_0x49351d[_0x06c2('0x14')]=null;}}_0x49351d[_0x06c2('0x42')]=_0x16736a;_0x49351d[_0x06c2('0x43')]=Date[_0x06c2('0x44')]()+0x36ee80;return _0x49351d[_0x06c2('0x45')]();})[_0x06c2('0xf')](function(){return sendServiceMail({'to':_0x10335c[_0x06c2('0x3a')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x06c2('0x46')+_0x06c2('0x47')+_0x06c2('0x48')+_0x10335c['headers'][_0x06c2('0x27')]+_0x06c2('0x49')+_0x16736a+'\x0a\x0a'+_0x06c2('0x4a')});})[_0x06c2('0xf')](function(){_0x5513c6[_0x06c2('0x34')](0xc8)[_0x06c2('0x35')]({'message':_0x06c2('0x4b')});})[_0x06c2('0x20')](function(_0x3c70dc){return handleError(_0x5513c6,0x1f4,_0x3c70dc);});};exports[_0x06c2('0x4c')]=function(_0x53b1e8,_0x313631,_0xa256be){return db[_0x06c2('0x3f')][_0x06c2('0x21')]({'where':{'resetPasswordToken':_0x53b1e8[_0x06c2('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x06c2('0xf')](function(_0x5ad69b){if(!_0x5ad69b){throw new Error(_0x06c2('0x4e'));}return db[_0x06c2('0xc')]['findOne']({'attributes':['id',_0x06c2('0x4f'),_0x06c2('0x50'),'passwordHistoryLimit']})[_0x06c2('0xf')](function(_0x37b670){if(_0x37b670['securePassword'])authService[_0x06c2('0x51')](_0x53b1e8[_0x06c2('0x3a')][_0x06c2('0x11')]);if(!_0x37b670[_0x06c2('0x50')]||!_0x5ad69b[_0x06c2('0x52')])return _0x5ad69b;authService['validatePasswordHistory'](_0x53b1e8[_0x06c2('0x3a')][_0x06c2('0x11')],_0x5ad69b[_0x06c2('0x52')],_0x37b670['passwordHistoryLimit']);return _0x5ad69b;})[_0x06c2('0xf')](function(){_0x5ad69b[_0x06c2('0x11')]=_0x53b1e8[_0x06c2('0x3a')][_0x06c2('0x11')];_0x5ad69b[_0x06c2('0x42')]=null;_0x5ad69b[_0x06c2('0x43')]=null;return _0x5ad69b[_0x06c2('0x45')]();});})[_0x06c2('0xf')](function(){_0x313631[_0x06c2('0x34')](0xc8)[_0x06c2('0x35')]({'message':_0x06c2('0x53')});})[_0x06c2('0x20')](function(_0x5e6cb4){return handleError(_0x313631,0x1f4,_0x5e6cb4);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x06c2('0x11')},function(_0x27e327,_0xbc470a,_0x561a22){return localAuthenticate(db[_0x06c2('0x3f')],_0x27e327,_0xbc470a,_0x561a22);})); \ No newline at end of file +var _0x62b9=['SendMail','error','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','util','passport','passport-local','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','format','\x22%s\x22\x20<%s>','request'];(function(_0x329d59,_0xae2550){var _0x2ff3bb=function(_0x2f9019){while(--_0x2f9019){_0x329d59['push'](_0x329d59['shift']());}};_0x2ff3bb(++_0xae2550);}(_0x62b9,0x130));var _0x962b=function(_0xa7e9ec,_0x208512){_0xa7e9ec=_0xa7e9ec-0x0;var _0x2f3abd=_0x62b9[_0xa7e9ec];return _0x2f3abd;};'use strict';var util=require(_0x962b('0x0'));var passport=require(_0x962b('0x1'));var LocalStrategy=require(_0x962b('0x2'))[_0x962b('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x962b('0x4'));var moment=require(_0x962b('0x5'));var db=require(_0x962b('0x6'))['db'];var authService=require(_0x962b('0x7'));var utils=require(_0x962b('0x8'));var client=jayson['client'][_0x962b('0x9')]({'port':0x232b});function localAuthenticate(_0x439523,_0x432365,_0x1d9eef,_0x44fe4e){var _0x19241c,_0x3a3e2a;return db[_0x962b('0xa')][_0x962b('0xb')]({'where':{'id':0x1},'attributes':[_0x962b('0xc'),_0x962b('0xd')],'raw':!![]})[_0x962b('0xe')](function(_0x564e62){_0x19241c=_0x564e62;return _0x439523[_0x962b('0xb')]({'attributes':['id',_0x962b('0xf'),_0x962b('0x10'),_0x962b('0x11'),_0x962b('0x12'),_0x962b('0x13'),'blocked','blockedAt',_0x962b('0x14')],'where':{'name':_0x432365,'role':{'$or':[_0x962b('0x15'),_0x962b('0x16'),_0x962b('0x17')]}}});})['then'](function(_0x5c8352){if(!_0x5c8352||_0x5c8352&&_0x5c8352['name']!==_0x432365){throw new Error(_0x962b('0x18'));}else{_0x3a3e2a=_0x5c8352;return _0x3a3e2a;}})['then'](function(){_0x3a3e2a[_0x962b('0x19')](_0x1d9eef,function(_0x29e2f3,_0x5d6f2f){var _0x398676=_0x3a3e2a['loginAttempts']+0x1;if(_0x29e2f3){return _0x44fe4e(_0x29e2f3);}else if(!_0x5d6f2f){if(_0x3a3e2a[_0x962b('0x13')]){return _0x44fe4e(null,![],{'message':_0x962b('0x18')});}else if(_0x19241c[_0x962b('0xc')]>0x0){if(_0x3a3e2a[_0x962b('0x1a')]){if(_0x19241c['blockDuration']>0x0){if(moment(_0x3a3e2a['blockedAt'])[_0x962b('0x1b')](_0x19241c['blockDuration'],_0x962b('0x1c'))>moment()){return _0x44fe4e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x962b('0x1d')](_0x3a3e2a,_0x398676,![],null)['then'](function(){return _0x44fe4e(null,![],{'message':_0x962b('0x18')});});}}else{return _0x44fe4e(null,![],{'message':_0x962b('0x18')});}}else{if(_0x398676>=_0x19241c[_0x962b('0xc')]){return utils['clearBlockUser'](_0x3a3e2a,0x0,!![],moment())[_0x962b('0xe')](function(){return _0x44fe4e(null,![],{'message':_0x962b('0x18')});});}else{return utils[_0x962b('0x1d')](_0x3a3e2a,_0x398676,![],null)['then'](function(){return _0x44fe4e(null,![],{'message':_0x962b('0x18')});});}}}else{return _0x44fe4e(null,![],{'message':_0x962b('0x18')});}}else{if(_0x3a3e2a['disabled']){return _0x44fe4e(null,![],{'message':_0x962b('0x18')});}else if(_0x19241c[_0x962b('0xc')]>0x0){if(_0x3a3e2a[_0x962b('0x1a')]){if(_0x19241c['blockDuration']>0x0){if(moment(_0x3a3e2a[_0x962b('0x1e')])[_0x962b('0x1b')](_0x19241c[_0x962b('0xd')],_0x962b('0x1c'))>moment()){return _0x44fe4e(null,![],{'message':_0x962b('0x18')});}else{return utils[_0x962b('0x1d')](_0x3a3e2a,0x0,![],null)[_0x962b('0xe')](function(){return utils['getLicense'](_0x3a3e2a);})['then'](function(){return _0x44fe4e(null,_0x3a3e2a);});}}else{return _0x44fe4e(null,![],{'message':_0x962b('0x18')});}}else{return utils[_0x962b('0x1d')](_0x3a3e2a,0x0,![],null)[_0x962b('0xe')](function(){return utils[_0x962b('0x1f')](_0x3a3e2a);})['then'](function(){return _0x44fe4e(null,_0x3a3e2a);})[_0x962b('0x20')](function(_0x1af3ec){return _0x44fe4e(null,![],_0x1af3ec);});}}else{if(_0x3a3e2a[_0x962b('0x1a')]){return _0x44fe4e(null,![],{'message':_0x962b('0x18')});}else{return utils[_0x962b('0x1f')](_0x3a3e2a)[_0x962b('0xe')](function(){return _0x44fe4e(null,_0x3a3e2a);});}}}});})[_0x962b('0x20')](function(_0x4080e9){return _0x44fe4e(null,![],_0x4080e9);});}function sendServiceMail(_0x262eb8){return db[_0x962b('0x21')][_0x962b('0x22')]({'where':{'service':!![]},'attributes':['id',_0x962b('0xf'),_0x962b('0x23')],'include':[{'model':db[_0x962b('0x24')],'as':_0x962b('0x25')}]})[_0x962b('0xe')](function(_0x5a823e){if(!_0x5a823e){throw new Error(_0x962b('0x26'));}var _0x2c23f1={'tls':{'rejectUnauthorized':![]}};if(_0x5a823e[_0x962b('0x25')][_0x962b('0x27')]){_0x2c23f1[_0x962b('0x27')]=_0x5a823e[_0x962b('0x25')]['service'];}else{_0x2c23f1[_0x962b('0x28')]=_0x5a823e[_0x962b('0x25')][_0x962b('0x28')];_0x2c23f1[_0x962b('0x29')]=_0x5a823e[_0x962b('0x25')]['port'];_0x2c23f1['secure']=_0x5a823e['Smtp'][_0x962b('0x2a')];}if(_0x5a823e[_0x962b('0x25')]['authentication']){_0x2c23f1[_0x962b('0x2b')]={'user':_0x5a823e[_0x962b('0x25')][_0x962b('0x16')],'pass':_0x5a823e[_0x962b('0x25')][_0x962b('0x2c')]};}var _0x497ac1={'account':_0x2c23f1,'message':_['merge']({'from':util[_0x962b('0x2d')](_0x962b('0x2e'),_0x5a823e[_0x962b('0xf')],_0x5a823e['email']||_0x5a823e[_0x962b('0x25')]['user'])},_0x262eb8)};return client[_0x962b('0x2f')](_0x962b('0x30'),_0x497ac1);})[_0x962b('0xe')](function(_0x478fd8){if(_0x478fd8[_0x962b('0x31')]){throw new Error(util[_0x962b('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x478fd8[_0x962b('0x31')][_0x962b('0x32')]||JSON[_0x962b('0x33')](_0x478fd8[_0x962b('0x31')])));}return!![];});}function handleError(_0x316c04,_0x186b7e,_0x30ec42){return _0x316c04[_0x962b('0x34')](_0x186b7e||0x1f4)[_0x962b('0x35')]({'message':_0x30ec42?_0x30ec42[_0x962b('0x32')]||_0x30ec42:''});}exports[_0x962b('0x36')]=function(_0x2f3a62,_0x205bc1,_0x1c5e57){passport[_0x962b('0x19')](_0x962b('0x37'),function(_0x5dfe26,_0x6a3cb5,_0x325abd){var _0x24af2d=_0x5dfe26||_0x325abd;if(_0x24af2d){return handleError(_0x205bc1,0x191,_0x24af2d);}if(!_0x6a3cb5){return handleError(_0x205bc1,0x194,{'message':_0x962b('0x38')});}else{var _0x16ab94={'payload':{'id':_0x6a3cb5['id'],'role':_0x6a3cb5[_0x962b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x962b('0x39')](_0x16ab94)[_0x962b('0xe')](function(_0x46dec5){_0x205bc1[_0x962b('0x3a')]({'id':_0x6a3cb5['id'],'token':_0x46dec5,'statusCall':'','isAlreadyLogged':_0x6a3cb5[_0x962b('0x3b')]});});}})(_0x2f3a62,_0x205bc1,_0x1c5e57);};exports['forgot']=function(_0x39b27b,_0x33f9e7,_0x1ec737){if(!_0x39b27b[_0x962b('0x3c')][_0x962b('0x23')]){return handleError(_0x33f9e7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x367de2=rs[_0x962b('0x3d')]();_0x39b27b[_0x962b('0x3c')][_0x962b('0x23')]=_0x39b27b[_0x962b('0x3c')][_0x962b('0x23')][_0x962b('0x3e')]()[_0x962b('0x3f')]();var _0x6a0790;return db[_0x962b('0xa')][_0x962b('0xb')]({'where':{'id':0x1},'attributes':[_0x962b('0xc'),_0x962b('0xd')],'raw':!![]})[_0x962b('0xe')](function(_0x3f2fbf){_0x6a0790=_0x3f2fbf;return db[_0x962b('0x40')]['find']({'where':{'email':_0x39b27b[_0x962b('0x3c')][_0x962b('0x23')]}});})[_0x962b('0xe')](function(_0x5abddf){if(!_0x5abddf){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5abddf['disabled']){throw new Error(_0x962b('0x41'));}if(_0x5abddf['blocked']){if(moment(_0x5abddf['blockedAt'])['add'](_0x6a0790[_0x962b('0xd')],_0x962b('0x1c'))>moment()){throw new Error(_0x962b('0x42'));}else{_0x5abddf[_0x962b('0x1a')]=![];_0x5abddf[_0x962b('0x1e')]=null;}}_0x5abddf[_0x962b('0x43')]=_0x367de2;_0x5abddf['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x5abddf['save']();})['then'](function(){return sendServiceMail({'to':_0x39b27b[_0x962b('0x3c')][_0x962b('0x23')],'subject':_0x962b('0x44'),'text':_0x962b('0x45')+_0x962b('0x46')+_0x962b('0x47')+_0x39b27b[_0x962b('0x48')][_0x962b('0x28')]+_0x962b('0x49')+_0x367de2+'\x0a\x0a'+_0x962b('0x4a')});})[_0x962b('0xe')](function(){_0x33f9e7['status'](0xc8)[_0x962b('0x35')]({'message':_0x962b('0x4b')});})[_0x962b('0x20')](function(_0x39bee5){return handleError(_0x33f9e7,0x1f4,_0x39bee5);});};exports[_0x962b('0x4c')]=function(_0xc2a03a,_0x567e50,_0x21ac3e){return db[_0x962b('0x40')]['find']({'where':{'resetPasswordToken':_0xc2a03a[_0x962b('0x4d')][_0x962b('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x962b('0x4f')]()}}})[_0x962b('0xe')](function(_0x5b24e8){if(!_0x5b24e8){throw new Error(_0x962b('0x50'));}return db[_0x962b('0xa')][_0x962b('0xb')]({'attributes':['id',_0x962b('0x51'),_0x962b('0x52'),'passwordHistoryLimit']})['then'](function(_0x3e2824){if(_0x3e2824[_0x962b('0x51')])authService[_0x962b('0x53')](_0xc2a03a[_0x962b('0x3c')][_0x962b('0x10')]);if(!_0x3e2824[_0x962b('0x52')]||!_0x5b24e8[_0x962b('0x54')])return _0x5b24e8;authService[_0x962b('0x55')](_0xc2a03a[_0x962b('0x3c')][_0x962b('0x10')],_0x5b24e8[_0x962b('0x54')],_0x3e2824['passwordHistoryLimit']);return _0x5b24e8;})[_0x962b('0xe')](function(){_0x5b24e8[_0x962b('0x10')]=_0xc2a03a['body'][_0x962b('0x10')];_0x5b24e8[_0x962b('0x43')]=null;_0x5b24e8['resetPasswordExpires']=null;return _0x5b24e8[_0x962b('0x56')]();});})[_0x962b('0xe')](function(){_0x567e50[_0x962b('0x34')](0xc8)[_0x962b('0x35')]({'message':_0x962b('0x57')});})[_0x962b('0x20')](function(_0x33dc27){return handleError(_0x567e50,0x1f4,_0x33dc27);});};passport['use'](new LocalStrategy({'usernameField':_0x962b('0xf'),'passwordField':'password'},function(_0x35c811,_0x160975,_0x58b47d){return localAuthenticate(db[_0x962b('0x40')],_0x35c811,_0x160975,_0x58b47d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 41d8dbe..252224c 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 _0x798c=['/forgot','/reset/:token','reset','exports','express','Router','post'];(function(_0x33c945,_0x361861){var _0x3677b7=function(_0x53ef74){while(--_0x53ef74){_0x33c945['push'](_0x33c945['shift']());}};_0x3677b7(++_0x361861);}(_0x798c,0x1a8));var _0xc798=function(_0x390d63,_0x3a4c6e){_0x390d63=_0x390d63-0x0;var _0x55450e=_0x798c[_0x390d63];return _0x55450e;};'use strict';var express=require(_0xc798('0x0'));var router=express[_0xc798('0x1')]();var controller=require('./authLocal.controller');router[_0xc798('0x2')]('/',controller['login']);router[_0xc798('0x2')](_0xc798('0x3'),controller['forgot']);router[_0xc798('0x2')](_0xc798('0x4'),controller[_0xc798('0x5')]);module[_0xc798('0x6')]=router; \ No newline at end of file +var _0xe0af=['reset','exports','express','Router','post','login','/forgot','/reset/:token'];(function(_0x42c4cc,_0x5d2f5e){var _0x43e16c=function(_0x3aa27b){while(--_0x3aa27b){_0x42c4cc['push'](_0x42c4cc['shift']());}};_0x43e16c(++_0x5d2f5e);}(_0xe0af,0x132));var _0xfe0a=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xe0af[_0x15cbce];return _0x257f29;};'use strict';var express=require(_0xfe0a('0x0'));var router=express[_0xfe0a('0x1')]();var controller=require('./authLocal.controller');router[_0xfe0a('0x2')]('/',controller[_0xfe0a('0x3')]);router[_0xfe0a('0x2')](_0xfe0a('0x4'),controller['forgot']);router[_0xfe0a('0x2')](_0xfe0a('0x5'),controller[_0xfe0a('0x6')]);module[_0xfe0a('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a42e430..2db9dc5 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 _0xfdb9=['BOOLEAN','sequelize','exports','STRING'];(function(_0x13a782,_0x223a1d){var _0x2dc247=function(_0x29b623){while(--_0x29b623){_0x13a782['push'](_0x13a782['shift']());}};_0x2dc247(++_0x223a1d);}(_0xfdb9,0x1cd));var _0x9fdb=function(_0x42f5d2,_0x58e86c){_0x42f5d2=_0x42f5d2-0x0;var _0x15ae1e=_0xfdb9[_0x42f5d2];return _0x15ae1e;};'use strict';var Sequelize=require(_0x9fdb('0x0'));module[_0x9fdb('0x1')]={'name':{'type':Sequelize[_0x9fdb('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x9fdb('0x2')]},'description':{'type':Sequelize[_0x9fdb('0x2')]},'status':{'type':Sequelize[_0x9fdb('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x6be6=['STRING','INTEGER','sequelize'];(function(_0x280303,_0x414afa){var _0x1daaa3=function(_0x461dbc){while(--_0x461dbc){_0x280303['push'](_0x280303['shift']());}};_0x1daaa3(++_0x414afa);}(_0x6be6,0x155));var _0x66be=function(_0xf63735,_0x416fe2){_0xf63735=_0xf63735-0x0;var _0x3ebcae=_0x6be6[_0xf63735];return _0x3ebcae;};'use strict';var Sequelize=require(_0x66be('0x0'));module['exports']={'name':{'type':Sequelize[_0x66be('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x66be('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x66be('0x2')],'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 4de8aae..cacb2af 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 _0x7be8=['order','nolimit','Action','addActions','getActions','findOne','eml-format','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','status','json','undefined','offset','limit','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','find','create','body','catch','addConditions','Condition','ids','omit','getConditions'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7be8,0x9e));var _0x87be=function(_0x5d7697,_0x4a5a89){_0x5d7697=_0x5d7697-0x0;var _0x54caa6=_0x7be8[_0x5d7697];return _0x54caa6;};'use strict';var emlformat=require(_0x87be('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x87be('0x1'));var rp=require('request-promise');var moment=require(_0x87be('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87be('0x3'));var path=require(_0x87be('0x4'));var sox=require(_0x87be('0x5'));var csv=require('to-csv');var ejs=require(_0x87be('0x6'));var fs=require('fs');var fs_extra=require(_0x87be('0x7'));var _=require(_0x87be('0x8'));var squel=require(_0x87be('0x9'));var crypto=require(_0x87be('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x87be('0xb'));var Papa=require('papaparse');var Redis=require(_0x87be('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x87be('0xd'));var hardwareService=require(_0x87be('0xe'));var logger=require(_0x87be('0xf'))('api');var utils=require(_0x87be('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1309fd,_0x770653){_0x770653=_0x770653||0xcc;return function(_0x13ff1a){if(_0x13ff1a){return _0x1309fd['sendStatus'](_0x770653);}return _0x1309fd[_0x87be('0x11')](_0x770653)['end']();};}function respondWithResult(_0x133ddb,_0xb731a4){_0xb731a4=_0xb731a4||0xc8;return function(_0x5d2275){if(_0x5d2275){return _0x133ddb[_0x87be('0x11')](_0xb731a4)[_0x87be('0x12')](_0x5d2275);}};}function respondWithFilteredResult(_0x6b4ae0,_0x3ab568){return function(_0x26695c){if(_0x26695c){var _0x287eb5=typeof _0x3ab568['offset']===_0x87be('0x13')&&typeof _0x3ab568['limit']===_0x87be('0x13');var _0x3e273f=_0x26695c['count'];var _0x2411a0=_0x287eb5?0x0:_0x3ab568[_0x87be('0x14')];var _0x21e4cb=_0x287eb5?_0x26695c['count']:_0x3ab568[_0x87be('0x14')]+_0x3ab568[_0x87be('0x15')];var _0x190b89;if(_0x21e4cb>=_0x3e273f){_0x21e4cb=_0x3e273f;_0x190b89=0xc8;}else{_0x190b89=0xce;}_0x6b4ae0[_0x87be('0x11')](_0x190b89);return _0x6b4ae0['set']('Content-Range',_0x2411a0+'-'+_0x21e4cb+'/'+_0x3e273f)[_0x87be('0x12')](_0x26695c);}return null;};}function patchUpdates(_0x24abd3){return function(_0x52df29){try{jsonpatch[_0x87be('0x16')](_0x52df29,_0x24abd3,!![]);}catch(_0x1d2f99){return BPromise[_0x87be('0x17')](_0x1d2f99);}return _0x52df29['save']();};}function saveUpdates(_0x491c04,_0x54844e){return function(_0x6b4657){if(_0x6b4657){return _0x6b4657[_0x87be('0x18')](_0x491c04)[_0x87be('0x19')](function(_0x57c982){return _0x57c982;});}return null;};}function removeEntity(_0x596022,_0x11bd5e){return function(_0x4facaf){if(_0x4facaf){return _0x4facaf[_0x87be('0x1a')]()[_0x87be('0x19')](function(){_0x596022[_0x87be('0x11')](0xcc)[_0x87be('0x1b')]();});}};}function handleEntityNotFound(_0xd46b67,_0x14dc0a){return function(_0x15db4a){if(!_0x15db4a){_0xd46b67[_0x87be('0x1c')](0x194);}return _0x15db4a;};}function handleError(_0x38110e,_0x29e2dc){_0x29e2dc=_0x29e2dc||0x1f4;return function(_0x7596bc){logger[_0x87be('0x1d')](_0x7596bc[_0x87be('0x1e')]);if(_0x7596bc[_0x87be('0x1f')]){delete _0x7596bc[_0x87be('0x1f')];}_0x38110e[_0x87be('0x11')](_0x29e2dc)['send'](_0x7596bc);};}exports[_0x87be('0x20')]=function(_0x593259,_0xe1bce2){var _0x4b6614={},_0x367c6f={},_0x21c8ce={'count':0x0,'rows':[]};var _0x49de9b=_[_0x87be('0x21')](db[_0x87be('0x22')][_0x87be('0x23')],function(_0x3ce42a){return{'name':_0x3ce42a[_0x87be('0x24')],'type':_0x3ce42a[_0x87be('0x25')][_0x87be('0x26')]};});_0x367c6f[_0x87be('0x27')]=_['map'](_0x49de9b,_0x87be('0x1f'));_0x367c6f['query']=_[_0x87be('0x28')](_0x593259[_0x87be('0x29')]);_0x367c6f[_0x87be('0x2a')]=_[_0x87be('0x2b')](_0x367c6f[_0x87be('0x27')],_0x367c6f[_0x87be('0x29')]);_0x4b6614['attributes']=_[_0x87be('0x2b')](_0x367c6f['model'],qs[_0x87be('0x2c')](_0x593259[_0x87be('0x29')][_0x87be('0x2c')]));_0x4b6614[_0x87be('0x2d')]=_0x4b6614['attributes'][_0x87be('0x2e')]?_0x4b6614['attributes']:_0x367c6f[_0x87be('0x27')];if(!_0x593259[_0x87be('0x29')][_0x87be('0x2f')]('nolimit')){_0x4b6614[_0x87be('0x15')]=qs[_0x87be('0x15')](_0x593259[_0x87be('0x29')][_0x87be('0x15')]);_0x4b6614[_0x87be('0x14')]=qs['offset'](_0x593259[_0x87be('0x29')]['offset']);}_0x4b6614['order']=qs[_0x87be('0x30')](_0x593259[_0x87be('0x29')][_0x87be('0x30')]);_0x4b6614[_0x87be('0x31')]=qs[_0x87be('0x2a')](_[_0x87be('0x32')](_0x593259[_0x87be('0x29')],_0x367c6f[_0x87be('0x2a')]),_0x49de9b);if(_0x593259[_0x87be('0x29')][_0x87be('0x33')]){_0x4b6614[_0x87be('0x31')]=_[_0x87be('0x34')](_0x4b6614[_0x87be('0x31')],{'$or':_[_0x87be('0x21')](_0x49de9b,function(_0x3879d6){if(_0x3879d6[_0x87be('0x25')]!==_0x87be('0x35')){var _0xddc1cf={};_0xddc1cf[_0x3879d6[_0x87be('0x1f')]]={'$like':'%'+_0x593259[_0x87be('0x29')][_0x87be('0x33')]+'%'};return _0xddc1cf;}})});}_0x4b6614=_[_0x87be('0x34')]({},_0x4b6614,_0x593259[_0x87be('0x36')]);var _0x2e2de5={'where':_0x4b6614[_0x87be('0x31')]};return db[_0x87be('0x22')][_0x87be('0x37')](_0x2e2de5)[_0x87be('0x19')](function(_0x2bd8b8){_0x21c8ce[_0x87be('0x37')]=_0x2bd8b8;if(_0x593259[_0x87be('0x29')]['includeAll']){_0x4b6614[_0x87be('0x38')]=[{'all':!![]}];}return db[_0x87be('0x22')][_0x87be('0x39')](_0x4b6614);})[_0x87be('0x19')](function(_0x3a1478){_0x21c8ce[_0x87be('0x3a')]=_0x3a1478;return _0x21c8ce;})[_0x87be('0x19')](respondWithFilteredResult(_0xe1bce2,_0x4b6614))['catch'](handleError(_0xe1bce2,null));};exports[_0x87be('0x3b')]=function(_0x44a629,_0x3a1a14){var _0x12a41d={'raw':![],'where':{'id':_0x44a629[_0x87be('0x3c')]['id']}},_0x4a605d={};_0x4a605d[_0x87be('0x27')]=_['keys'](db[_0x87be('0x22')][_0x87be('0x23')]);_0x4a605d[_0x87be('0x29')]=_['keys'](_0x44a629[_0x87be('0x29')]);_0x4a605d[_0x87be('0x2a')]=_[_0x87be('0x2b')](_0x4a605d[_0x87be('0x27')],_0x4a605d['query']);_0x12a41d[_0x87be('0x2d')]=_[_0x87be('0x2b')](_0x4a605d[_0x87be('0x27')],qs[_0x87be('0x2c')](_0x44a629[_0x87be('0x29')][_0x87be('0x2c')]));_0x12a41d[_0x87be('0x2d')]=_0x12a41d[_0x87be('0x2d')]['length']?_0x12a41d[_0x87be('0x2d')]:_0x4a605d[_0x87be('0x27')];if(_0x44a629[_0x87be('0x29')]['includeAll']){_0x12a41d[_0x87be('0x38')]=[{'all':!![]}];}_0x12a41d=_['merge']({},_0x12a41d,_0x44a629[_0x87be('0x36')]);return db[_0x87be('0x22')][_0x87be('0x3d')](_0x12a41d)[_0x87be('0x19')](handleEntityNotFound(_0x3a1a14,null))[_0x87be('0x19')](respondWithResult(_0x3a1a14,null))['catch'](handleError(_0x3a1a14,null));};exports[_0x87be('0x3e')]=function(_0x9e453b,_0x4681ab){return db[_0x87be('0x22')][_0x87be('0x3e')](_0x9e453b[_0x87be('0x3f')],{})['then'](respondWithResult(_0x4681ab,0xc9))['catch'](handleError(_0x4681ab,null));};exports[_0x87be('0x18')]=function(_0x5692ce,_0x21947d){if(_0x5692ce['body']['id']){delete _0x5692ce[_0x87be('0x3f')]['id'];}return db[_0x87be('0x22')][_0x87be('0x3d')]({'where':{'id':_0x5692ce[_0x87be('0x3c')]['id']}})[_0x87be('0x19')](handleEntityNotFound(_0x21947d,null))[_0x87be('0x19')](saveUpdates(_0x5692ce[_0x87be('0x3f')],null))['then'](respondWithResult(_0x21947d,null))['catch'](handleError(_0x21947d,null));};exports['destroy']=function(_0x3099cc,_0x30ce29){return db[_0x87be('0x22')]['find']({'where':{'id':_0x3099cc[_0x87be('0x3c')]['id']}})[_0x87be('0x19')](handleEntityNotFound(_0x30ce29,null))['then'](removeEntity(_0x30ce29,null))[_0x87be('0x40')](handleError(_0x30ce29,null));};exports[_0x87be('0x41')]=function(_0x589b8c,_0x450b5d,_0x30710f){return db[_0x87be('0x42')][_0x87be('0x3d')]({'where':{'id':_0x589b8c[_0x87be('0x3c')]['id']}})[_0x87be('0x19')](handleEntityNotFound(_0x450b5d,null))[_0x87be('0x19')](function(_0x240b2f){if(_0x240b2f){return _0x240b2f[_0x87be('0x41')](_0x589b8c[_0x87be('0x3f')][_0x87be('0x43')],_[_0x87be('0x44')](_0x589b8c[_0x87be('0x3f')],[_0x87be('0x43'),'id'])||{});}})['then'](respondWithResult(_0x450b5d,null))[_0x87be('0x40')](handleError(_0x450b5d,null));};exports[_0x87be('0x45')]=function(_0x352ff8,_0x3c1905,_0xa84b79){var _0xc24088={};var _0xd970a8={};var _0x49d4b7;var _0x1b8a12;return db[_0x87be('0x22')]['findOne']({'where':{'id':_0x352ff8[_0x87be('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3c1905,null))[_0x87be('0x19')](function(_0x3df545){if(_0x3df545){_0x49d4b7=_0x3df545;_0xd970a8[_0x87be('0x27')]=_['keys'](db[_0x87be('0x42')][_0x87be('0x23')]);_0xd970a8[_0x87be('0x29')]=_[_0x87be('0x28')](_0x352ff8[_0x87be('0x29')]);_0xd970a8[_0x87be('0x2a')]=_[_0x87be('0x2b')](_0xd970a8[_0x87be('0x27')],_0xd970a8[_0x87be('0x29')]);_0xc24088[_0x87be('0x2d')]=_[_0x87be('0x2b')](_0xd970a8['model'],qs[_0x87be('0x2c')](_0x352ff8['query'][_0x87be('0x2c')]));_0xc24088['attributes']=_0xc24088[_0x87be('0x2d')][_0x87be('0x2e')]?_0xc24088[_0x87be('0x2d')]:_0xd970a8[_0x87be('0x27')];_0xc24088[_0x87be('0x46')]=qs[_0x87be('0x30')](_0x352ff8['query'][_0x87be('0x30')]);_0xc24088[_0x87be('0x31')]=qs[_0x87be('0x2a')](_[_0x87be('0x32')](_0x352ff8[_0x87be('0x29')],_0xd970a8[_0x87be('0x2a')]));if(_0x352ff8[_0x87be('0x29')][_0x87be('0x33')]){_0xc24088[_0x87be('0x31')]=_[_0x87be('0x34')](_0xc24088['where'],{'$or':_['map'](_0xc24088[_0x87be('0x2d')],function(_0x360873){var _0x2b1a4f={};_0x2b1a4f[_0x360873]={'$like':'%'+_0x352ff8[_0x87be('0x29')]['filter']+'%'};return _0x2b1a4f;})});}_0xc24088=_[_0x87be('0x34')]({},_0xc24088,_0x352ff8[_0x87be('0x36')]);return _0x49d4b7[_0x87be('0x45')](_0xc24088);}})[_0x87be('0x19')](function(_0x25a59b){if(_0x25a59b){_0x1b8a12=_0x25a59b['length'];if(!_0x352ff8[_0x87be('0x29')][_0x87be('0x2f')](_0x87be('0x47'))){_0xc24088['limit']=qs['limit'](_0x352ff8[_0x87be('0x29')]['limit']);_0xc24088[_0x87be('0x14')]=qs[_0x87be('0x14')](_0x352ff8[_0x87be('0x29')][_0x87be('0x14')]);}return _0x49d4b7[_0x87be('0x45')](_0xc24088);}})[_0x87be('0x19')](function(_0x100f58){if(_0x100f58){return _0x100f58?{'count':_0x1b8a12,'rows':_0x100f58}:null;}})[_0x87be('0x19')](respondWithResult(_0x3c1905,null))[_0x87be('0x40')](handleError(_0x3c1905,null));};exports['addActions']=function(_0x27a908,_0x3c2a1c,_0xda6148){return db[_0x87be('0x48')][_0x87be('0x3d')]({'where':{'id':_0x27a908[_0x87be('0x3c')]['id']}})[_0x87be('0x19')](handleEntityNotFound(_0x3c2a1c,null))['then'](function(_0x57b30c){if(_0x57b30c){return _0x57b30c[_0x87be('0x49')](_0x27a908[_0x87be('0x3f')][_0x87be('0x43')],_[_0x87be('0x44')](_0x27a908['body'],[_0x87be('0x43'),'id'])||{});}})['then'](respondWithResult(_0x3c2a1c,null))[_0x87be('0x40')](handleError(_0x3c2a1c,null));};exports[_0x87be('0x4a')]=function(_0x591709,_0xbdb766,_0x1dc37a){var _0x47c9ba={};var _0x178e32={};var _0x235030;var _0x2ead12;return db[_0x87be('0x22')][_0x87be('0x4b')]({'where':{'id':_0x591709[_0x87be('0x3c')]['id']}})[_0x87be('0x19')](handleEntityNotFound(_0xbdb766,null))[_0x87be('0x19')](function(_0x124936){if(_0x124936){_0x235030=_0x124936;_0x178e32[_0x87be('0x27')]=_[_0x87be('0x28')](db[_0x87be('0x48')][_0x87be('0x23')]);_0x178e32[_0x87be('0x29')]=_[_0x87be('0x28')](_0x591709['query']);_0x178e32[_0x87be('0x2a')]=_['intersection'](_0x178e32[_0x87be('0x27')],_0x178e32[_0x87be('0x29')]);_0x47c9ba[_0x87be('0x2d')]=_[_0x87be('0x2b')](_0x178e32['model'],qs[_0x87be('0x2c')](_0x591709['query'][_0x87be('0x2c')]));_0x47c9ba[_0x87be('0x2d')]=_0x47c9ba['attributes'][_0x87be('0x2e')]?_0x47c9ba[_0x87be('0x2d')]:_0x178e32[_0x87be('0x27')];_0x47c9ba[_0x87be('0x46')]=qs[_0x87be('0x30')](_0x591709['query']['sort']);_0x47c9ba[_0x87be('0x31')]=qs[_0x87be('0x2a')](_[_0x87be('0x32')](_0x591709['query'],_0x178e32[_0x87be('0x2a')]));if(_0x591709[_0x87be('0x29')]['filter']){_0x47c9ba['where']=_[_0x87be('0x34')](_0x47c9ba[_0x87be('0x31')],{'$or':_[_0x87be('0x21')](_0x47c9ba[_0x87be('0x2d')],function(_0x1958e0){var _0x5d052d={};_0x5d052d[_0x1958e0]={'$like':'%'+_0x591709[_0x87be('0x29')][_0x87be('0x33')]+'%'};return _0x5d052d;})});}_0x47c9ba=_[_0x87be('0x34')]({},_0x47c9ba,_0x591709['options']);return _0x235030[_0x87be('0x4a')](_0x47c9ba);}})[_0x87be('0x19')](function(_0x38cc65){if(_0x38cc65){_0x2ead12=_0x38cc65[_0x87be('0x2e')];if(!_0x591709[_0x87be('0x29')][_0x87be('0x2f')](_0x87be('0x47'))){_0x47c9ba[_0x87be('0x15')]=qs['limit'](_0x591709[_0x87be('0x29')][_0x87be('0x15')]);_0x47c9ba[_0x87be('0x14')]=qs[_0x87be('0x14')](_0x591709['query'][_0x87be('0x14')]);}return _0x235030[_0x87be('0x4a')](_0x47c9ba);}})[_0x87be('0x19')](function(_0x554906){if(_0x554906){return _0x554906?{'count':_0x2ead12,'rows':_0x554906}:null;}})[_0x87be('0x19')](respondWithResult(_0xbdb766,null))['catch'](handleError(_0xbdb766,null));}; \ No newline at end of file +var _0xfd93=['../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','error','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Automation','then','include','rows','catch','params','create','body','find','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3c3d6b,_0x24dd55){var _0x3c9779=function(_0x3979db){while(--_0x3979db){_0x3c3d6b['push'](_0x3c3d6b['shift']());}};_0x3c9779(++_0x24dd55);}(_0xfd93,0x12a));var _0x3fd9=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xfd93[_0x8b8564];return _0x360c61;};'use strict';var emlformat=require(_0x3fd9('0x0'));var rimraf=require(_0x3fd9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fd9('0x2'));var rp=require('request-promise');var moment=require(_0x3fd9('0x3'));var BPromise=require(_0x3fd9('0x4'));var Mustache=require(_0x3fd9('0x5'));var util=require(_0x3fd9('0x6'));var path=require(_0x3fd9('0x7'));var sox=require(_0x3fd9('0x8'));var csv=require(_0x3fd9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fd9('0xa'));var _=require(_0x3fd9('0xb'));var squel=require(_0x3fd9('0xc'));var crypto=require(_0x3fd9('0xd'));var jsforce=require(_0x3fd9('0xe'));var deskjs=require(_0x3fd9('0xf'));var toCsv=require(_0x3fd9('0x9'));var querystring=require(_0x3fd9('0x10'));var Papa=require(_0x3fd9('0x11'));var Redis=require(_0x3fd9('0x12'));var authService=require(_0x3fd9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3fd9('0x14'));var hardwareService=require(_0x3fd9('0x15'));var logger=require(_0x3fd9('0x16'))('api');var utils=require(_0x3fd9('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3fd9('0x18'))['db'];function respondWithStatusCode(_0x4a46df,_0x8e21fb){_0x8e21fb=_0x8e21fb||0xcc;return function(_0x1487fc){if(_0x1487fc){return _0x4a46df[_0x3fd9('0x19')](_0x8e21fb);}return _0x4a46df[_0x3fd9('0x1a')](_0x8e21fb)['end']();};}function respondWithResult(_0x5b55ff,_0x2e3ac){_0x2e3ac=_0x2e3ac||0xc8;return function(_0x5a3564){if(_0x5a3564){return _0x5b55ff['status'](_0x2e3ac)[_0x3fd9('0x1b')](_0x5a3564);}};}function respondWithFilteredResult(_0x3847e9,_0x183e6a){return function(_0x26437b){if(_0x26437b){var _0x4e3833=typeof _0x183e6a[_0x3fd9('0x1c')]===_0x3fd9('0x1d')&&typeof _0x183e6a[_0x3fd9('0x1e')]===_0x3fd9('0x1d');var _0x30afa4=_0x26437b[_0x3fd9('0x1f')];var _0x17468d=_0x4e3833?0x0:_0x183e6a[_0x3fd9('0x1c')];var _0x358dab=_0x4e3833?_0x26437b[_0x3fd9('0x1f')]:_0x183e6a[_0x3fd9('0x1c')]+_0x183e6a[_0x3fd9('0x1e')];var _0x50c9cd;if(_0x358dab>=_0x30afa4){_0x358dab=_0x30afa4;_0x50c9cd=0xc8;}else{_0x50c9cd=0xce;}_0x3847e9[_0x3fd9('0x1a')](_0x50c9cd);return _0x3847e9[_0x3fd9('0x20')]('Content-Range',_0x17468d+'-'+_0x358dab+'/'+_0x30afa4)[_0x3fd9('0x1b')](_0x26437b);}return null;};}function patchUpdates(_0x3e2df6){return function(_0x5e74d0){try{jsonpatch['apply'](_0x5e74d0,_0x3e2df6,!![]);}catch(_0x69a121){return BPromise[_0x3fd9('0x21')](_0x69a121);}return _0x5e74d0[_0x3fd9('0x22')]();};}function saveUpdates(_0x1c2aee,_0x246b41){return function(_0x46010b){if(_0x46010b){return _0x46010b[_0x3fd9('0x23')](_0x1c2aee)['then'](function(_0x45613d){return _0x45613d;});}return null;};}function removeEntity(_0x4b1e6a,_0x2bb246){return function(_0x62004a){if(_0x62004a){return _0x62004a[_0x3fd9('0x24')]()['then'](function(){_0x4b1e6a[_0x3fd9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e40eb,_0x2533fb){return function(_0x401969){if(!_0x401969){_0x4e40eb[_0x3fd9('0x19')](0x194);}return _0x401969;};}function handleError(_0x4085e7,_0x48bb32){_0x48bb32=_0x48bb32||0x1f4;return function(_0x3b13cb){logger[_0x3fd9('0x25')](_0x3b13cb['stack']);if(_0x3b13cb[_0x3fd9('0x26')]){delete _0x3b13cb[_0x3fd9('0x26')];}_0x4085e7['status'](_0x48bb32)['send'](_0x3b13cb);};}exports[_0x3fd9('0x27')]=function(_0x38ff4f,_0x965ed1){var _0x7be824={},_0x3c298e={},_0x182b36={'count':0x0,'rows':[]};var _0x2a127d=_[_0x3fd9('0x28')](db['Automation'][_0x3fd9('0x29')],function(_0x2678ac){return{'name':_0x2678ac['fieldName'],'type':_0x2678ac[_0x3fd9('0x2a')][_0x3fd9('0x2b')]};});_0x3c298e[_0x3fd9('0x2c')]=_[_0x3fd9('0x28')](_0x2a127d,_0x3fd9('0x26'));_0x3c298e[_0x3fd9('0x2d')]=_[_0x3fd9('0x2e')](_0x38ff4f['query']);_0x3c298e[_0x3fd9('0x2f')]=_[_0x3fd9('0x30')](_0x3c298e[_0x3fd9('0x2c')],_0x3c298e[_0x3fd9('0x2d')]);_0x7be824[_0x3fd9('0x31')]=_[_0x3fd9('0x30')](_0x3c298e[_0x3fd9('0x2c')],qs[_0x3fd9('0x32')](_0x38ff4f[_0x3fd9('0x2d')]['fields']));_0x7be824['attributes']=_0x7be824[_0x3fd9('0x31')][_0x3fd9('0x33')]?_0x7be824[_0x3fd9('0x31')]:_0x3c298e[_0x3fd9('0x2c')];if(!_0x38ff4f['query'][_0x3fd9('0x34')](_0x3fd9('0x35'))){_0x7be824['limit']=qs[_0x3fd9('0x1e')](_0x38ff4f[_0x3fd9('0x2d')][_0x3fd9('0x1e')]);_0x7be824[_0x3fd9('0x1c')]=qs['offset'](_0x38ff4f['query'][_0x3fd9('0x1c')]);}_0x7be824[_0x3fd9('0x36')]=qs[_0x3fd9('0x37')](_0x38ff4f['query'][_0x3fd9('0x37')]);_0x7be824[_0x3fd9('0x38')]=qs['filters'](_[_0x3fd9('0x39')](_0x38ff4f[_0x3fd9('0x2d')],_0x3c298e[_0x3fd9('0x2f')]),_0x2a127d);if(_0x38ff4f[_0x3fd9('0x2d')][_0x3fd9('0x3a')]){_0x7be824[_0x3fd9('0x38')]=_[_0x3fd9('0x3b')](_0x7be824[_0x3fd9('0x38')],{'$or':_[_0x3fd9('0x28')](_0x2a127d,function(_0x16212b){if(_0x16212b[_0x3fd9('0x2a')]!==_0x3fd9('0x3c')){var _0xfd0563={};_0xfd0563[_0x16212b[_0x3fd9('0x26')]]={'$like':'%'+_0x38ff4f[_0x3fd9('0x2d')][_0x3fd9('0x3a')]+'%'};return _0xfd0563;}})});}_0x7be824=_[_0x3fd9('0x3b')]({},_0x7be824,_0x38ff4f[_0x3fd9('0x3d')]);var _0x2e5ba9={'where':_0x7be824[_0x3fd9('0x38')]};return db[_0x3fd9('0x3e')][_0x3fd9('0x1f')](_0x2e5ba9)[_0x3fd9('0x3f')](function(_0xd031b6){_0x182b36[_0x3fd9('0x1f')]=_0xd031b6;if(_0x38ff4f[_0x3fd9('0x2d')]['includeAll']){_0x7be824[_0x3fd9('0x40')]=[{'all':!![]}];}return db[_0x3fd9('0x3e')]['findAll'](_0x7be824);})[_0x3fd9('0x3f')](function(_0x5f21fe){_0x182b36[_0x3fd9('0x41')]=_0x5f21fe;return _0x182b36;})[_0x3fd9('0x3f')](respondWithFilteredResult(_0x965ed1,_0x7be824))[_0x3fd9('0x42')](handleError(_0x965ed1,null));};exports['show']=function(_0xfd2527,_0x3b8e1c){var _0x5eb2ca={'raw':![],'where':{'id':_0xfd2527[_0x3fd9('0x43')]['id']}},_0xf1e0d6={};_0xf1e0d6['model']=_[_0x3fd9('0x2e')](db[_0x3fd9('0x3e')][_0x3fd9('0x29')]);_0xf1e0d6['query']=_[_0x3fd9('0x2e')](_0xfd2527[_0x3fd9('0x2d')]);_0xf1e0d6[_0x3fd9('0x2f')]=_[_0x3fd9('0x30')](_0xf1e0d6['model'],_0xf1e0d6['query']);_0x5eb2ca[_0x3fd9('0x31')]=_[_0x3fd9('0x30')](_0xf1e0d6[_0x3fd9('0x2c')],qs[_0x3fd9('0x32')](_0xfd2527[_0x3fd9('0x2d')][_0x3fd9('0x32')]));_0x5eb2ca[_0x3fd9('0x31')]=_0x5eb2ca[_0x3fd9('0x31')][_0x3fd9('0x33')]?_0x5eb2ca[_0x3fd9('0x31')]:_0xf1e0d6[_0x3fd9('0x2c')];if(_0xfd2527[_0x3fd9('0x2d')]['includeAll']){_0x5eb2ca['include']=[{'all':!![]}];}_0x5eb2ca=_[_0x3fd9('0x3b')]({},_0x5eb2ca,_0xfd2527['options']);return db[_0x3fd9('0x3e')]['find'](_0x5eb2ca)['then'](handleEntityNotFound(_0x3b8e1c,null))['then'](respondWithResult(_0x3b8e1c,null))[_0x3fd9('0x42')](handleError(_0x3b8e1c,null));};exports['create']=function(_0xcff076,_0x132f25){return db[_0x3fd9('0x3e')][_0x3fd9('0x44')](_0xcff076[_0x3fd9('0x45')],{})[_0x3fd9('0x3f')](respondWithResult(_0x132f25,0xc9))[_0x3fd9('0x42')](handleError(_0x132f25,null));};exports[_0x3fd9('0x23')]=function(_0x494cc4,_0x29122c){if(_0x494cc4[_0x3fd9('0x45')]['id']){delete _0x494cc4[_0x3fd9('0x45')]['id'];}return db['Automation'][_0x3fd9('0x46')]({'where':{'id':_0x494cc4[_0x3fd9('0x43')]['id']}})[_0x3fd9('0x3f')](handleEntityNotFound(_0x29122c,null))['then'](saveUpdates(_0x494cc4[_0x3fd9('0x45')],null))[_0x3fd9('0x3f')](respondWithResult(_0x29122c,null))[_0x3fd9('0x42')](handleError(_0x29122c,null));};exports[_0x3fd9('0x24')]=function(_0x3d43a9,_0x288a8b){return db[_0x3fd9('0x3e')][_0x3fd9('0x46')]({'where':{'id':_0x3d43a9[_0x3fd9('0x43')]['id']}})['then'](handleEntityNotFound(_0x288a8b,null))[_0x3fd9('0x3f')](removeEntity(_0x288a8b,null))['catch'](handleError(_0x288a8b,null));};exports[_0x3fd9('0x47')]=function(_0x23e353,_0x20e48e,_0x1726d2){return db[_0x3fd9('0x48')]['find']({'where':{'id':_0x23e353[_0x3fd9('0x43')]['id']}})[_0x3fd9('0x3f')](handleEntityNotFound(_0x20e48e,null))[_0x3fd9('0x3f')](function(_0x20b888){if(_0x20b888){return _0x20b888[_0x3fd9('0x47')](_0x23e353[_0x3fd9('0x45')][_0x3fd9('0x49')],_[_0x3fd9('0x4a')](_0x23e353['body'],[_0x3fd9('0x49'),'id'])||{});}})[_0x3fd9('0x3f')](respondWithResult(_0x20e48e,null))['catch'](handleError(_0x20e48e,null));};exports[_0x3fd9('0x4b')]=function(_0x4a94d7,_0x40c476,_0x5b138f){var _0x3c8c6={};var _0x1859e0={};var _0x1d1597;var _0x369779;return db[_0x3fd9('0x3e')]['findOne']({'where':{'id':_0x4a94d7[_0x3fd9('0x43')]['id']}})[_0x3fd9('0x3f')](handleEntityNotFound(_0x40c476,null))[_0x3fd9('0x3f')](function(_0x2a573c){if(_0x2a573c){_0x1d1597=_0x2a573c;_0x1859e0[_0x3fd9('0x2c')]=_['keys'](db['Condition'][_0x3fd9('0x29')]);_0x1859e0[_0x3fd9('0x2d')]=_[_0x3fd9('0x2e')](_0x4a94d7[_0x3fd9('0x2d')]);_0x1859e0[_0x3fd9('0x2f')]=_[_0x3fd9('0x30')](_0x1859e0['model'],_0x1859e0[_0x3fd9('0x2d')]);_0x3c8c6[_0x3fd9('0x31')]=_[_0x3fd9('0x30')](_0x1859e0['model'],qs['fields'](_0x4a94d7[_0x3fd9('0x2d')][_0x3fd9('0x32')]));_0x3c8c6[_0x3fd9('0x31')]=_0x3c8c6[_0x3fd9('0x31')][_0x3fd9('0x33')]?_0x3c8c6['attributes']:_0x1859e0[_0x3fd9('0x2c')];_0x3c8c6[_0x3fd9('0x36')]=qs['sort'](_0x4a94d7[_0x3fd9('0x2d')][_0x3fd9('0x37')]);_0x3c8c6['where']=qs['filters'](_[_0x3fd9('0x39')](_0x4a94d7[_0x3fd9('0x2d')],_0x1859e0[_0x3fd9('0x2f')]));if(_0x4a94d7[_0x3fd9('0x2d')][_0x3fd9('0x3a')]){_0x3c8c6[_0x3fd9('0x38')]=_['merge'](_0x3c8c6[_0x3fd9('0x38')],{'$or':_['map'](_0x3c8c6['attributes'],function(_0x2688cc){var _0x70892d={};_0x70892d[_0x2688cc]={'$like':'%'+_0x4a94d7[_0x3fd9('0x2d')][_0x3fd9('0x3a')]+'%'};return _0x70892d;})});}_0x3c8c6=_[_0x3fd9('0x3b')]({},_0x3c8c6,_0x4a94d7[_0x3fd9('0x3d')]);return _0x1d1597['getConditions'](_0x3c8c6);}})['then'](function(_0x476ba1){if(_0x476ba1){_0x369779=_0x476ba1[_0x3fd9('0x33')];if(!_0x4a94d7[_0x3fd9('0x2d')][_0x3fd9('0x34')](_0x3fd9('0x35'))){_0x3c8c6[_0x3fd9('0x1e')]=qs[_0x3fd9('0x1e')](_0x4a94d7['query'][_0x3fd9('0x1e')]);_0x3c8c6[_0x3fd9('0x1c')]=qs[_0x3fd9('0x1c')](_0x4a94d7['query']['offset']);}return _0x1d1597['getConditions'](_0x3c8c6);}})[_0x3fd9('0x3f')](function(_0x4062d9){if(_0x4062d9){return _0x4062d9?{'count':_0x369779,'rows':_0x4062d9}:null;}})['then'](respondWithResult(_0x40c476,null))[_0x3fd9('0x42')](handleError(_0x40c476,null));};exports[_0x3fd9('0x4c')]=function(_0x3ef197,_0x17cae3,_0x43acd1){return db[_0x3fd9('0x4d')][_0x3fd9('0x46')]({'where':{'id':_0x3ef197[_0x3fd9('0x43')]['id']}})['then'](handleEntityNotFound(_0x17cae3,null))['then'](function(_0x14e89b){if(_0x14e89b){return _0x14e89b['addActions'](_0x3ef197['body'][_0x3fd9('0x49')],_['omit'](_0x3ef197['body'],[_0x3fd9('0x49'),'id'])||{});}})[_0x3fd9('0x3f')](respondWithResult(_0x17cae3,null))[_0x3fd9('0x42')](handleError(_0x17cae3,null));};exports[_0x3fd9('0x4e')]=function(_0x265d57,_0x2fe10d,_0x2861aa){var _0x3b18a6={};var _0x3a5a1e={};var _0x4253ad;var _0x301e77;return db['Automation'][_0x3fd9('0x4f')]({'where':{'id':_0x265d57[_0x3fd9('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fe10d,null))['then'](function(_0x3121e4){if(_0x3121e4){_0x4253ad=_0x3121e4;_0x3a5a1e[_0x3fd9('0x2c')]=_['keys'](db[_0x3fd9('0x4d')][_0x3fd9('0x29')]);_0x3a5a1e['query']=_[_0x3fd9('0x2e')](_0x265d57[_0x3fd9('0x2d')]);_0x3a5a1e[_0x3fd9('0x2f')]=_[_0x3fd9('0x30')](_0x3a5a1e[_0x3fd9('0x2c')],_0x3a5a1e[_0x3fd9('0x2d')]);_0x3b18a6[_0x3fd9('0x31')]=_['intersection'](_0x3a5a1e[_0x3fd9('0x2c')],qs[_0x3fd9('0x32')](_0x265d57[_0x3fd9('0x2d')]['fields']));_0x3b18a6[_0x3fd9('0x31')]=_0x3b18a6[_0x3fd9('0x31')][_0x3fd9('0x33')]?_0x3b18a6[_0x3fd9('0x31')]:_0x3a5a1e[_0x3fd9('0x2c')];_0x3b18a6[_0x3fd9('0x36')]=qs[_0x3fd9('0x37')](_0x265d57[_0x3fd9('0x2d')]['sort']);_0x3b18a6[_0x3fd9('0x38')]=qs[_0x3fd9('0x2f')](_[_0x3fd9('0x39')](_0x265d57[_0x3fd9('0x2d')],_0x3a5a1e[_0x3fd9('0x2f')]));if(_0x265d57['query'][_0x3fd9('0x3a')]){_0x3b18a6['where']=_[_0x3fd9('0x3b')](_0x3b18a6[_0x3fd9('0x38')],{'$or':_[_0x3fd9('0x28')](_0x3b18a6['attributes'],function(_0x4acbfd){var _0x2c486d={};_0x2c486d[_0x4acbfd]={'$like':'%'+_0x265d57[_0x3fd9('0x2d')]['filter']+'%'};return _0x2c486d;})});}_0x3b18a6=_['merge']({},_0x3b18a6,_0x265d57[_0x3fd9('0x3d')]);return _0x4253ad['getActions'](_0x3b18a6);}})['then'](function(_0xaf8dae){if(_0xaf8dae){_0x301e77=_0xaf8dae[_0x3fd9('0x33')];if(!_0x265d57[_0x3fd9('0x2d')][_0x3fd9('0x34')]('nolimit')){_0x3b18a6['limit']=qs[_0x3fd9('0x1e')](_0x265d57[_0x3fd9('0x2d')][_0x3fd9('0x1e')]);_0x3b18a6[_0x3fd9('0x1c')]=qs[_0x3fd9('0x1c')](_0x265d57[_0x3fd9('0x2d')]['offset']);}return _0x4253ad[_0x3fd9('0x4e')](_0x3b18a6);}})[_0x3fd9('0x3f')](function(_0x5888d3){if(_0x5888d3){return _0x5888d3?{'count':_0x301e77,'rows':_0x5888d3}:null;}})['then'](respondWithResult(_0x2fe10d,null))[_0x3fd9('0x42')](handleError(_0x2fe10d,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c060808..bf5e6ea 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 _0x656f=['define','Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x567d,_0x2f8123){var _0x3b7a37=function(_0x55e43b){while(--_0x55e43b){_0x567d['push'](_0x567d['shift']());}};_0x3b7a37(++_0x2f8123);}(_0x656f,0x1e2));var _0xf656=function(_0x5e6243,_0x3f68e5){_0x5e6243=_0x5e6243-0x0;var _0xcc6d67=_0x656f[_0x5e6243];return _0xcc6d67;};'use strict';var _=require(_0xf656('0x0'));var util=require(_0xf656('0x1'));var logger=require(_0xf656('0x2'))(_0xf656('0x3'));var moment=require(_0xf656('0x4'));var BPromise=require(_0xf656('0x5'));var rp=require(_0xf656('0x6'));var fs=require('fs');var path=require(_0xf656('0x7'));var rimraf=require('rimraf');var config=require(_0xf656('0x8'));var attributes=require('./automation.attributes');module[_0xf656('0x9')]=function(_0xa9545c,_0x345ba0){return _0xa9545c[_0xf656('0xa')](_0xf656('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3764=['./automation.attributes','exports','lodash','util','moment','bluebird','path','../../config/environment'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x3764,0x12a));var _0x4376=function(_0x5b92c3,_0x41ac82){_0x5b92c3=_0x5b92c3-0x0;var _0x3ed3e7=_0x3764[_0x5b92c3];return _0x3ed3e7;};'use strict';var _=require(_0x4376('0x0'));var util=require(_0x4376('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4376('0x2'));var BPromise=require(_0x4376('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4376('0x4'));var rimraf=require('rimraf');var config=require(_0x4376('0x5'));var attributes=require(_0x4376('0x6'));module[_0x4376('0x7')]=function(_0x50cb69,_0x1ef5a7){return _0x50cb69['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index bd61df1..1dff111 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 _0xf4f4=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x329139,_0x3ac69e){var _0x21c0e4=function(_0xfbe9b8){while(--_0xfbe9b8){_0x329139['push'](_0x329139['shift']());}};_0x21c0e4(++_0x3ac69e);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3137c1,_0x535382){_0x3137c1=_0x3137c1-0x0;var _0x195276=_0xf4f4[_0x3137c1];return _0x195276;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ff75a,_0x3c4877,_0x249f8a){return new BPromise(function(_0x2faba9,_0x3768d7){return client['request'](_0x1ff75a,_0x249f8a)[_0x4f4f('0xb')](function(_0x38d110){logger[_0x4f4f('0xc')](_0x4f4f('0xd'),_0x3c4877,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x3c4877,_0x4f4f('0xe'),JSON['stringify'](_0x38d110));if(_0x38d110['error']){if(_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x12')]===0x1f4){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x3768d7(_0x38d110['error'][_0x4f4f('0x13')]);}logger['error'](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x2faba9(_0x38d110[_0x4f4f('0x11')]['message']);}else{logger[_0x4f4f('0xc')]('Automation,\x20%s,\x20%s',_0x3c4877,'request\x20sent');_0x2faba9(_0x38d110['result'][_0x4f4f('0x13')]);}})[_0x4f4f('0x14')](function(_0x2d21ed){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x2d21ed);_0x3768d7(_0x2d21ed);});});} \ No newline at end of file +var _0x3af5=['stringify','error','code','message','info','request\x20sent','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3af5,0x1d3));var _0x53af=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0x3af5[_0x45f4e9];return _0x559d8f;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var moment=require('moment');var BPromise=require(_0x53af('0x2'));var rs=require(_0x53af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53af('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x53af('0x5'));var jayson=require(_0x53af('0x6'));var client=jayson['client'][_0x53af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4eb461,_0x3aefaf,_0x27eed3){return new BPromise(function(_0x2875ab,_0x22c0cb){return client[_0x53af('0x8')](_0x4eb461,_0x27eed3)[_0x53af('0x9')](function(_0x56751b){logger['info'](_0x53af('0xa'),_0x3aefaf,'request\x20sent');logger[_0x53af('0xb')](_0x53af('0xc'),_0x3aefaf,'request\x20sent',JSON[_0x53af('0xd')](_0x56751b));if(_0x56751b[_0x53af('0xe')]){if(_0x56751b['error'][_0x53af('0xf')]===0x1f4){logger[_0x53af('0xe')](_0x53af('0xa'),_0x3aefaf,_0x56751b['error'][_0x53af('0x10')]);return _0x22c0cb(_0x56751b['error'][_0x53af('0x10')]);}logger[_0x53af('0xe')](_0x53af('0xa'),_0x3aefaf,_0x56751b[_0x53af('0xe')][_0x53af('0x10')]);return _0x2875ab(_0x56751b[_0x53af('0xe')][_0x53af('0x10')]);}else{logger[_0x53af('0x11')](_0x53af('0xa'),_0x3aefaf,_0x53af('0x12'));_0x2875ab(_0x56751b['result'][_0x53af('0x10')]);}})[_0x53af('0x13')](function(_0x29bb86){logger[_0x53af('0xe')](_0x53af('0xa'),_0x3aefaf,_0x29bb86);_0x22c0cb(_0x29bb86);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 4f2dc78..6eb85a4 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 _0xd0ba=['index','/:id','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1c378f,_0xca7e7c){var _0x1b9fe3=function(_0xef6551){while(--_0xef6551){_0x1c378f['push'](_0x1c378f['shift']());}};_0x1b9fe3(++_0xca7e7c);}(_0xd0ba,0x17c));var _0xad0b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xd0ba[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0xad0b('0x0'));var path=require(_0xad0b('0x1'));var timeout=require(_0xad0b('0x2'));var express=require(_0xad0b('0x3'));var router=express[_0xad0b('0x4')]();var fs_extra=require(_0xad0b('0x5'));var auth=require(_0xad0b('0x6'));var interaction=require(_0xad0b('0x7'));var config=require(_0xad0b('0x8'));var controller=require('./automation.controller');router[_0xad0b('0x9')]('/',auth[_0xad0b('0xa')](),controller[_0xad0b('0xb')]);router['get'](_0xad0b('0xc'),auth[_0xad0b('0xa')](),controller['show']);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0xad0b('0xd')]);router['get'](_0xad0b('0xe'),auth[_0xad0b('0xa')](),controller['getActions']);router[_0xad0b('0xf')]('/',auth[_0xad0b('0xa')](),controller[_0xad0b('0x10')]);router[_0xad0b('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xad0b('0x11')]);router[_0xad0b('0xf')](_0xad0b('0xe'),auth[_0xad0b('0xa')](),controller[_0xad0b('0x12')]);router[_0xad0b('0x13')](_0xad0b('0xc'),auth[_0xad0b('0xa')](),controller[_0xad0b('0x14')]);router[_0xad0b('0x15')]('/:id',auth[_0xad0b('0xa')](),controller[_0xad0b('0x16')]);module['exports']=router; \ No newline at end of file +var _0x01d3=['../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7e072f,_0x4cbd0c){var _0x5c4af7=function(_0x33cba0){while(--_0x33cba0){_0x7e072f['push'](_0x7e072f['shift']());}};_0x5c4af7(++_0x4cbd0c);}(_0x01d3,0xdb));var _0x301d=function(_0x2cb08e,_0x48f58a){_0x2cb08e=_0x2cb08e-0x0;var _0x3b5f48=_0x01d3[_0x2cb08e];return _0x3b5f48;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x301d('0x0'));var timeout=require(_0x301d('0x1'));var express=require(_0x301d('0x2'));var router=express['Router']();var fs_extra=require(_0x301d('0x3'));var auth=require(_0x301d('0x4'));var interaction=require(_0x301d('0x5'));var config=require(_0x301d('0x6'));var controller=require(_0x301d('0x7'));router['get']('/',auth[_0x301d('0x8')](),controller[_0x301d('0x9')]);router[_0x301d('0xa')](_0x301d('0xb'),auth[_0x301d('0x8')](),controller['show']);router[_0x301d('0xa')](_0x301d('0xc'),auth[_0x301d('0x8')](),controller[_0x301d('0xd')]);router[_0x301d('0xa')](_0x301d('0xe'),auth[_0x301d('0x8')](),controller[_0x301d('0xf')]);router[_0x301d('0x10')]('/',auth['isAuthenticated'](),controller[_0x301d('0x11')]);router[_0x301d('0x10')]('/:id/conditions',auth[_0x301d('0x8')](),controller[_0x301d('0x12')]);router[_0x301d('0x10')](_0x301d('0xe'),auth['isAuthenticated'](),controller[_0x301d('0x13')]);router[_0x301d('0x14')](_0x301d('0xb'),auth[_0x301d('0x8')](),controller[_0x301d('0x15')]);router[_0x301d('0x16')](_0x301d('0xb'),auth['isAuthenticated'](),controller[_0x301d('0x17')]);module[_0x301d('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index fb93056..a8bbf14 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 _0x007a=['UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign'];(function(_0x39fe8b,_0x3892f5){var _0x4fec0c=function(_0x5b6073){while(--_0x5b6073){_0x39fe8b['push'](_0x39fe8b['shift']());}};_0x4fec0c(++_0x3892f5);}(_0x007a,0x145));var _0xa007=function(_0x2e9b61,_0x2120cf){_0x2e9b61=_0x2e9b61-0x0;var _0x597ccd=_0x007a[_0x2e9b61];return _0x597ccd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa007('0x0')],'unique':_0xa007('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xa007('0x2')),'allowNull':![],'defaultValue':_0xa007('0x2')},'description':{'type':Sequelize[_0xa007('0x0')]},'active':{'type':Sequelize[_0xa007('0x3')],'defaultValue':0x0,'comment':_0xa007('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa007('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa007('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa007('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xa007('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa007('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)[_0xa007('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa007('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa007('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa007('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)[_0xa007('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa007('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa007('0x6')](0x5)[_0xa007('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa007('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa007('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa007('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa007('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)[_0xa007('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xa007('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa007('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa007('0xe')](_0xa007('0xf'),'never',_0xa007('0x10')),'defaultValue':_0xa007('0xf')},'dialAMDActive':{'type':Sequelize[_0xa007('0x3')],'defaultValue':0x0,'comment':_0xa007('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa007('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa007('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xa007('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa007('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa007('0x6')](0x9)[_0xa007('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xa007('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa007('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa007('0x6')](0x9)[_0xa007('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa007('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa007('0x6')](0x5)[_0xa007('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa007('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa007('0x6')](0x9)[_0xa007('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa007('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa007('0x18'),_0xa007('0x19')),'defaultValue':_0xa007('0x18')},'dialPrefix':{'type':Sequelize[_0xa007('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa007('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa007('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa007('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)[_0xa007('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa007('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xa007('0x6')](0x5)[_0xa007('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)[_0xa007('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa007('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa007('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa007('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa007('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa007('0x6')](0x5)[_0xa007('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa007('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa007('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa007('0x6')](0x5)[_0xa007('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa007('0x20')}}; \ No newline at end of file +var _0x2121=['BOOLEAN','Active/Disactive\x20Campaign','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#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)','exports','STRING','ENUM','ivr'];(function(_0x370dbd,_0x546f1e){var _0x5256d7=function(_0xd7ce0e){while(--_0xd7ce0e){_0x370dbd['push'](_0x370dbd['shift']());}};_0x5256d7(++_0x546f1e);}(_0x2121,0x98));var _0x1212=function(_0x3da93e,_0x89ab20){_0x3da93e=_0x3da93e-0x0;var _0x5e897b=_0x2121[_0x3da93e];return _0x5e897b;};'use strict';var Sequelize=require('sequelize');module[_0x1212('0x0')]={'name':{'type':Sequelize[_0x1212('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1212('0x2')](_0x1212('0x3')),'allowNull':![],'defaultValue':_0x1212('0x3')},'description':{'type':Sequelize[_0x1212('0x1')]},'active':{'type':Sequelize[_0x1212('0x4')],'defaultValue':0x0,'comment':_0x1212('0x5')},'limitCalls':{'type':Sequelize[_0x1212('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1212('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1212('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1212('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1212('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1212('0x6')](0x3)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1212('0x6')](0x5)[_0x1212('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1212('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1212('0x6')](0x3)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1212('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1212('0x8')],'defaultValue':0x3,'comment':_0x1212('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1212('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1212('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1212('0xe')},'dialTimezone':{'type':Sequelize[_0x1212('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1212('0x1')],'defaultValue':_0x1212('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1212('0x2')](_0x1212('0x10'),_0x1212('0x11'),_0x1212('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1212('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x1212('0x6')](0x9)[_0x1212('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1212('0x6')](0x9)[_0x1212('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1212('0x6')](0x9)[_0x1212('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1212('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1212('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1212('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x1212('0x6')](0x9)[_0x1212('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1212('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1212('0x6')](0x9)[_0x1212('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1212('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1212('0x6')](0x9)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1212('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1212('0x6')](0x5)[_0x1212('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1212('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1212('0x6')](0x9)[_0x1212('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1212('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1212('0x1b'),'ASC'),'defaultValue':_0x1212('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1212('0x6')](0x3)[_0x1212('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1212('0x1c')},'dialCutDigit':{'type':Sequelize[_0x1212('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1212('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1212('0x6')](0x3)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1212('0x6')](0x5)[_0x1212('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1212('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x1212('0x6')](0x3)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x1212('0x6')](0x5)[_0x1212('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1212('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1212('0x6')](0x3)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1212('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1212('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1212('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1212('0x6')](0x5)[_0x1212('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1212('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index eaf6a65..486aeca 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 _0xeeea=['role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','get','omit','createdAt','updatedAt','body','params','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','filter','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','ListId','field','scheduledAt','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','ContactId','from','push','all','removeLists','getBlackLists','addBlackLists','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','end','sendStatus','name','send','index','map','Campaign','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','merge','includeAll','include','findAll','catch','rawAttributes','length','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x3f8fff,_0x12f8e2){var _0x342bfb=function(_0x1c188d){while(--_0x1c188d){_0x3f8fff['push'](_0x3f8fff['shift']());}};_0x342bfb(++_0x12f8e2);}(_0xeeea,0x1c7));var _0xaeee=function(_0x1c8cf3,_0x25daa3){_0x1c8cf3=_0x1c8cf3-0x0;var _0x4483bc=_0xeeea[_0x1c8cf3];return _0x4483bc;};'use strict';var emlformat=require(_0xaeee('0x0'));var rimraf=require(_0xaeee('0x1'));var zipdir=require(_0xaeee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaeee('0x3'));var moment=require('moment');var BPromise=require(_0xaeee('0x4'));var Mustache=require(_0xaeee('0x5'));var util=require('util');var path=require(_0xaeee('0x6'));var sox=require(_0xaeee('0x7'));var csv=require(_0xaeee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaeee('0x9'));var squel=require(_0xaeee('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaeee('0xb'));var toCsv=require(_0xaeee('0x8'));var querystring=require(_0xaeee('0xc'));var Papa=require(_0xaeee('0xd'));var Redis=require(_0xaeee('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xaeee('0xf'));var as=require(_0xaeee('0x10'));var hardwareService=require(_0xaeee('0x11'));var logger=require('../../config/logger')(_0xaeee('0x12'));var utils=require(_0xaeee('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaeee('0x14'))['db'];function respondWithStatusCode(_0x1c7150,_0x3b1a15){_0x3b1a15=_0x3b1a15||0xcc;return function(_0x37c2c4){if(_0x37c2c4){return _0x1c7150['sendStatus'](_0x3b1a15);}return _0x1c7150['status'](_0x3b1a15)['end']();};}function respondWithResult(_0x42b139,_0x49fcbd){_0x49fcbd=_0x49fcbd||0xc8;return function(_0xdb0e52){if(_0xdb0e52){return _0x42b139[_0xaeee('0x15')](_0x49fcbd)[_0xaeee('0x16')](_0xdb0e52);}};}function respondWithFilteredResult(_0x4dcbab,_0x4276b8){return function(_0x43e622){if(_0x43e622){var _0x31ea76=typeof _0x4276b8[_0xaeee('0x17')]===_0xaeee('0x18')&&typeof _0x4276b8[_0xaeee('0x19')]===_0xaeee('0x18');var _0x1bef78=_0x43e622[_0xaeee('0x1a')];var _0x43da36=_0x31ea76?0x0:_0x4276b8[_0xaeee('0x17')];var _0x19b1b3=_0x31ea76?_0x43e622[_0xaeee('0x1a')]:_0x4276b8[_0xaeee('0x17')]+_0x4276b8['limit'];var _0x3a9536;if(_0x19b1b3>=_0x1bef78){_0x19b1b3=_0x1bef78;_0x3a9536=0xc8;}else{_0x3a9536=0xce;}_0x4dcbab['status'](_0x3a9536);return _0x4dcbab[_0xaeee('0x1b')](_0xaeee('0x1c'),_0x43da36+'-'+_0x19b1b3+'/'+_0x1bef78)[_0xaeee('0x16')](_0x43e622);}return null;};}function patchUpdates(_0x3265e5){return function(_0x19a230){try{jsonpatch[_0xaeee('0x1d')](_0x19a230,_0x3265e5,!![]);}catch(_0x3f5f7e){return BPromise[_0xaeee('0x1e')](_0x3f5f7e);}return _0x19a230[_0xaeee('0x1f')]();};}function saveUpdates(_0x1f6456,_0x587e3f){return function(_0x5c7ccd){if(_0x5c7ccd){return _0x5c7ccd[_0xaeee('0x20')](_0x1f6456)[_0xaeee('0x21')](function(_0x1e5565){return _0x1e5565;});}return null;};}function removeEntity(_0x3e297d,_0x2853b1){return function(_0x2834b8){if(_0x2834b8){return _0x2834b8[_0xaeee('0x22')]()['then'](function(){var _0x38001e=_0x2834b8['get']({'plain':!![]});var _0x22b8f1=_0xaeee('0x23');return db[_0xaeee('0x24')][_0xaeee('0x22')]({'where':{'type':_0x22b8f1,'resourceId':_0x38001e['id']}})[_0xaeee('0x21')](function(){return _0x2834b8;});})[_0xaeee('0x21')](function(){_0x3e297d[_0xaeee('0x15')](0xcc)[_0xaeee('0x25')]();});}};}function handleEntityNotFound(_0x561d64,_0x2fb7f6){return function(_0xc35475){if(!_0xc35475){_0x561d64[_0xaeee('0x26')](0x194);}return _0xc35475;};}function handleError(_0x250101,_0x256dab){_0x256dab=_0x256dab||0x1f4;return function(_0x488c49){logger['error'](_0x488c49['stack']);if(_0x488c49[_0xaeee('0x27')]){delete _0x488c49[_0xaeee('0x27')];}_0x250101['status'](_0x256dab)[_0xaeee('0x28')](_0x488c49);};}exports[_0xaeee('0x29')]=function(_0x4c605b,_0x496b5e){var _0x5ae86f={},_0x3400a6={},_0xc6257={'count':0x0,'rows':[]};var _0x59c856=_[_0xaeee('0x2a')](db[_0xaeee('0x2b')]['rawAttributes'],function(_0x1cf87c){return{'name':_0x1cf87c[_0xaeee('0x2c')],'type':_0x1cf87c[_0xaeee('0x2d')][_0xaeee('0x2e')]};});_0x3400a6[_0xaeee('0x2f')]=_[_0xaeee('0x2a')](_0x59c856,_0xaeee('0x27'));_0x3400a6['query']=_[_0xaeee('0x30')](_0x4c605b[_0xaeee('0x31')]);_0x3400a6['filters']=_[_0xaeee('0x32')](_0x3400a6['model'],_0x3400a6[_0xaeee('0x31')]);_0x5ae86f['attributes']=_[_0xaeee('0x32')](_0x3400a6[_0xaeee('0x2f')],qs[_0xaeee('0x33')](_0x4c605b[_0xaeee('0x31')][_0xaeee('0x33')]));_0x5ae86f[_0xaeee('0x34')]=_0x5ae86f[_0xaeee('0x34')]['length']?_0x5ae86f[_0xaeee('0x34')]:_0x3400a6[_0xaeee('0x2f')];if(!_0x4c605b[_0xaeee('0x31')]['hasOwnProperty'](_0xaeee('0x35'))){_0x5ae86f['limit']=qs[_0xaeee('0x19')](_0x4c605b[_0xaeee('0x31')][_0xaeee('0x19')]);_0x5ae86f['offset']=qs[_0xaeee('0x17')](_0x4c605b[_0xaeee('0x31')][_0xaeee('0x17')]);}_0x5ae86f['order']=qs[_0xaeee('0x36')](_0x4c605b[_0xaeee('0x31')][_0xaeee('0x36')]);_0x5ae86f[_0xaeee('0x37')]=qs[_0xaeee('0x38')](_[_0xaeee('0x39')](_0x4c605b[_0xaeee('0x31')],_0x3400a6[_0xaeee('0x38')]),_0x59c856);if(_0x4c605b[_0xaeee('0x31')]['filter']){_0x5ae86f['where']=_[_0xaeee('0x3a')](_0x5ae86f[_0xaeee('0x37')],{'$or':_[_0xaeee('0x2a')](_0x59c856,function(_0x36c9d4){if(_0x36c9d4[_0xaeee('0x2d')]!=='VIRTUAL'){var _0x320e9d={};_0x320e9d[_0x36c9d4[_0xaeee('0x27')]]={'$like':'%'+_0x4c605b[_0xaeee('0x31')]['filter']+'%'};return _0x320e9d;}})});}_0x5ae86f=_[_0xaeee('0x3a')]({},_0x5ae86f,_0x4c605b['options']);var _0x4633d5={'where':_0x5ae86f[_0xaeee('0x37')]};return db[_0xaeee('0x2b')][_0xaeee('0x1a')](_0x4633d5)[_0xaeee('0x21')](function(_0x1830ea){_0xc6257[_0xaeee('0x1a')]=_0x1830ea;if(_0x4c605b[_0xaeee('0x31')][_0xaeee('0x3b')]){_0x5ae86f[_0xaeee('0x3c')]=[{'all':!![]}];}return db[_0xaeee('0x2b')][_0xaeee('0x3d')](_0x5ae86f);})['then'](function(_0x64ec34){_0xc6257['rows']=_0x64ec34;return _0xc6257;})[_0xaeee('0x21')](respondWithFilteredResult(_0x496b5e,_0x5ae86f))[_0xaeee('0x3e')](handleError(_0x496b5e,null));};exports['show']=function(_0x2233a5,_0x435765){var _0x211e85={'raw':![],'where':{'id':_0x2233a5['params']['id']}},_0x4f7cc1={};_0x4f7cc1[_0xaeee('0x2f')]=_[_0xaeee('0x30')](db[_0xaeee('0x2b')][_0xaeee('0x3f')]);_0x4f7cc1[_0xaeee('0x31')]=_[_0xaeee('0x30')](_0x2233a5['query']);_0x4f7cc1[_0xaeee('0x38')]=_['intersection'](_0x4f7cc1[_0xaeee('0x2f')],_0x4f7cc1['query']);_0x211e85['attributes']=_[_0xaeee('0x32')](_0x4f7cc1[_0xaeee('0x2f')],qs[_0xaeee('0x33')](_0x2233a5['query'][_0xaeee('0x33')]));_0x211e85[_0xaeee('0x34')]=_0x211e85[_0xaeee('0x34')][_0xaeee('0x40')]?_0x211e85[_0xaeee('0x34')]:_0x4f7cc1['model'];if(_0x2233a5['query'][_0xaeee('0x3b')]){_0x211e85[_0xaeee('0x3c')]=[{'all':!![]}];}_0x211e85=_[_0xaeee('0x3a')]({},_0x211e85,_0x2233a5[_0xaeee('0x41')]);return db['Campaign'][_0xaeee('0x42')](_0x211e85)[_0xaeee('0x21')](handleEntityNotFound(_0x435765,null))[_0xaeee('0x21')](respondWithResult(_0x435765,null))[_0xaeee('0x3e')](handleError(_0x435765,null));};exports[_0xaeee('0x43')]=function(_0x10d993,_0x144e84){return db[_0xaeee('0x2b')][_0xaeee('0x43')](_0x10d993['body'],{})['then'](function(_0x45926b){var _0x1b212f=_0x10d993['user']['get']({'plain':!![]});if(!_0x1b212f)throw new Error(_0xaeee('0x44'));if(_0x1b212f[_0xaeee('0x45')]===_0xaeee('0x46')){var _0x553fcc=_0x45926b['get']({'plain':!![]});var _0x118088=_0xaeee('0x23');return db[_0xaeee('0x47')]['find']({'where':{'name':_0x118088,'userProfileId':_0x1b212f[_0xaeee('0x48')]},'raw':!![]})[_0xaeee('0x21')](function(_0x4f7da1){if(_0x4f7da1&&_0x4f7da1['autoAssociation']===0x0){return db[_0xaeee('0x24')][_0xaeee('0x43')]({'name':_0x553fcc[_0xaeee('0x27')],'resourceId':_0x553fcc['id'],'type':_0x4f7da1[_0xaeee('0x27')],'sectionId':_0x4f7da1['id']},{})['then'](function(){return _0x45926b;});}else{return _0x45926b;}})[_0xaeee('0x3e')](function(_0x2026b6){logger[_0xaeee('0x49')](_0xaeee('0x4a'),_0x2026b6);throw _0x2026b6;});}return _0x45926b;})[_0xaeee('0x21')](respondWithResult(_0x144e84,0xc9))[_0xaeee('0x3e')](handleError(_0x144e84,null));};exports[_0xaeee('0x4b')]=function(_0x3f1bd6,_0x82b34b){var _0x332a85={'where':{'id':_0x3f1bd6['params']['id']}},_0x45880b={};_0x45880b['model']=_[_0xaeee('0x30')](db['Campaign']['rawAttributes']);_0x332a85['attributes']=_[_0xaeee('0x32')](_0x45880b['model'],qs[_0xaeee('0x33')](_0x3f1bd6[_0xaeee('0x31')][_0xaeee('0x33')]));_0x332a85['attributes']=_0x332a85[_0xaeee('0x34')]['length']?_0x332a85['attributes']:_0x45880b[_0xaeee('0x2f')];if(_0x3f1bd6[_0xaeee('0x31')][_0xaeee('0x3b')]){_0x332a85[_0xaeee('0x3c')]=[{'all':!![]}];}_0x332a85=_['merge']({},_0x332a85,_0x3f1bd6[_0xaeee('0x41')]);return db[_0xaeee('0x2b')][_0xaeee('0x42')](_0x332a85)[_0xaeee('0x21')](handleEntityNotFound(_0x82b34b,null))[_0xaeee('0x21')](function(_0x5e52ce){if(_0x5e52ce){var _0x5ed656=_0x5e52ce[_0xaeee('0x4c')]({'plain':!![]});_0x5ed656=qs[_0xaeee('0x4d')](_0x5ed656,['id',_0xaeee('0x4e'),_0xaeee('0x4f')]);_0x3f1bd6[_0xaeee('0x50')]=_[_0xaeee('0x4d')](_0x3f1bd6[_0xaeee('0x50')],['id',_0xaeee('0x4e'),_0xaeee('0x4f')]);return db[_0xaeee('0x2b')][_0xaeee('0x43')](_['merge'](_0x5ed656,_0x3f1bd6[_0xaeee('0x50')]),{'include':_0x3f1bd6[_0xaeee('0x31')][_0xaeee('0x3b')]?[{'all':!![]}]:undefined})[_0xaeee('0x21')](function(_0x14918a){var _0xd4ddea=_0x3f1bd6['user']['get']({'plain':!![]});if(!_0xd4ddea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd4ddea['role']===_0xaeee('0x46')){var _0x30ab1e=_0x14918a[_0xaeee('0x4c')]({'plain':!![]});var _0x56a383=_0xaeee('0x23');return db['UserProfileSection'][_0xaeee('0x42')]({'where':{'name':_0x56a383,'userProfileId':_0xd4ddea['userProfileId']},'raw':!![]})[_0xaeee('0x21')](function(_0x1e25c3){if(_0x1e25c3&&_0x1e25c3['autoAssociation']===0x0){return db[_0xaeee('0x24')][_0xaeee('0x43')]({'name':_0x30ab1e['name'],'resourceId':_0x30ab1e['id'],'type':_0x1e25c3['name'],'sectionId':_0x1e25c3['id']},{})[_0xaeee('0x21')](function(){return _0x14918a;});}else{return _0x14918a;}})[_0xaeee('0x3e')](function(_0x5b11a8){logger[_0xaeee('0x49')](_0xaeee('0x4a'),_0x5b11a8);throw _0x5b11a8;});}return _0x14918a;});}})[_0xaeee('0x21')](respondWithResult(_0x82b34b,0xc9))['catch'](handleError(_0x82b34b,null));};exports[_0xaeee('0x20')]=function(_0x3d55e7,_0x406f0a){if(_0x3d55e7[_0xaeee('0x50')]['id']){delete _0x3d55e7['body']['id'];}return db[_0xaeee('0x2b')][_0xaeee('0x42')]({'where':{'id':_0x3d55e7[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0x406f0a,null))[_0xaeee('0x21')](saveUpdates(_0x3d55e7[_0xaeee('0x50')],null))[_0xaeee('0x21')](respondWithResult(_0x406f0a,null))[_0xaeee('0x3e')](handleError(_0x406f0a,null));};exports[_0xaeee('0x22')]=function(_0x27dbad,_0xf4be59){return db['Campaign'][_0xaeee('0x42')]({'where':{'id':_0x27dbad[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0xf4be59,null))[_0xaeee('0x21')](removeEntity(_0xf4be59,null))[_0xaeee('0x3e')](handleError(_0xf4be59,null));};exports[_0xaeee('0x52')]=function(_0x4ef920,_0x51c491,_0x2f77ef){var _0x426dc1={'raw':!![],'where':{}};var _0x2b9d2b={};var _0x20fe9f={'count':0x0,'rows':[]};return db['Campaign'][_0xaeee('0x53')]({'where':{'id':_0x4ef920[_0xaeee('0x51')]['id']}})['then'](handleEntityNotFound(_0x51c491,null))[_0xaeee('0x21')](function(_0x587a24){if(_0x587a24){_0x2b9d2b[_0xaeee('0x2f')]=_[_0xaeee('0x30')](db[_0xaeee('0x54')][_0xaeee('0x3f')]);_0x2b9d2b[_0xaeee('0x31')]=_[_0xaeee('0x30')](_0x4ef920[_0xaeee('0x31')]);_0x2b9d2b['filters']=_['intersection'](_0x2b9d2b[_0xaeee('0x2f')],_0x2b9d2b[_0xaeee('0x31')]);_0x426dc1['attributes']=_[_0xaeee('0x32')](_0x2b9d2b[_0xaeee('0x2f')],qs['fields'](_0x4ef920[_0xaeee('0x31')]['fields']));_0x426dc1['attributes']=_0x426dc1['attributes'][_0xaeee('0x40')]?_0x426dc1['attributes']:_0x2b9d2b['model'];if(!_0x4ef920[_0xaeee('0x31')][_0xaeee('0x55')](_0xaeee('0x35'))){_0x426dc1[_0xaeee('0x19')]=qs[_0xaeee('0x19')](_0x4ef920[_0xaeee('0x31')][_0xaeee('0x19')]);_0x426dc1['offset']=qs[_0xaeee('0x17')](_0x4ef920[_0xaeee('0x31')][_0xaeee('0x17')]);}_0x426dc1[_0xaeee('0x56')]=qs[_0xaeee('0x36')](_0x4ef920['query'][_0xaeee('0x36')]);_0x426dc1['where']=qs['filters'](_['pick'](_0x4ef920[_0xaeee('0x31')],_0x2b9d2b[_0xaeee('0x38')]));_0x426dc1['where'][_0xaeee('0x57')]=_0x587a24['id'];if(_0x4ef920[_0xaeee('0x31')][_0xaeee('0x58')]){_0x426dc1['where']=_[_0xaeee('0x3a')](_0x426dc1[_0xaeee('0x37')],{'$or':_[_0xaeee('0x2a')](_0x426dc1[_0xaeee('0x34')],function(_0x37f02a){var _0x529dd1={};_0x529dd1[_0x37f02a]={'$like':'%'+_0x4ef920[_0xaeee('0x31')][_0xaeee('0x58')]+'%'};return _0x529dd1;})});}_0x426dc1=_[_0xaeee('0x3a')]({},_0x426dc1,_0x4ef920['options']);return db[_0xaeee('0x54')]['count']({'where':_0x426dc1['where']})[_0xaeee('0x21')](function(_0x2a377f){_0x20fe9f[_0xaeee('0x1a')]=_0x2a377f;if(_0x4ef920['query'][_0xaeee('0x3b')]){_0x426dc1[_0xaeee('0x3c')]=[{'all':!![]}];}return db['CmHopper'][_0xaeee('0x3d')](_0x426dc1);})[_0xaeee('0x21')](function(_0x12d371){_0x20fe9f[_0xaeee('0x59')]=_0x12d371;return _0x20fe9f;});}})['then'](respondWithFilteredResult(_0x51c491,_0x426dc1))[_0xaeee('0x3e')](handleError(_0x51c491,null));};exports['getHopperHistories']=function(_0x48fc54,_0x1965cf,_0x5e8482){var _0x3da18a={'raw':!![],'where':{}};var _0xcba2cd={};var _0x2f5a4e={'count':0x0,'rows':[]};return db[_0xaeee('0x2b')][_0xaeee('0x53')]({'where':{'id':_0x48fc54[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0x1965cf,null))['then'](function(_0x478b4e){if(_0x478b4e){_0xcba2cd[_0xaeee('0x2f')]=_[_0xaeee('0x30')](db[_0xaeee('0x5a')][_0xaeee('0x3f')]);_0xcba2cd[_0xaeee('0x31')]=_[_0xaeee('0x30')](_0x48fc54[_0xaeee('0x31')]);_0xcba2cd[_0xaeee('0x38')]=_['intersection'](_0xcba2cd[_0xaeee('0x2f')],_0xcba2cd[_0xaeee('0x31')]);_0x3da18a['attributes']=_[_0xaeee('0x32')](_0xcba2cd['model'],qs[_0xaeee('0x33')](_0x48fc54[_0xaeee('0x31')]['fields']));_0x3da18a[_0xaeee('0x34')]=_0x3da18a[_0xaeee('0x34')][_0xaeee('0x40')]?_0x3da18a[_0xaeee('0x34')]:_0xcba2cd[_0xaeee('0x2f')];if(!_0x48fc54[_0xaeee('0x31')][_0xaeee('0x55')](_0xaeee('0x35'))){_0x3da18a[_0xaeee('0x19')]=qs[_0xaeee('0x19')](_0x48fc54['query']['limit']);_0x3da18a[_0xaeee('0x17')]=qs['offset'](_0x48fc54[_0xaeee('0x31')]['offset']);}_0x3da18a[_0xaeee('0x56')]=qs[_0xaeee('0x36')](_0x48fc54['query']['sort']);_0x3da18a['where']=qs[_0xaeee('0x38')](_[_0xaeee('0x39')](_0x48fc54['query'],_0xcba2cd[_0xaeee('0x38')]));_0x3da18a[_0xaeee('0x37')][_0xaeee('0x57')]=_0x478b4e['id'];if(_0x48fc54[_0xaeee('0x31')]['filter']){_0x3da18a[_0xaeee('0x37')]=_[_0xaeee('0x3a')](_0x3da18a[_0xaeee('0x37')],{'$or':_['map'](_0x3da18a[_0xaeee('0x34')],function(_0x15da7f){var _0x345dfe={};_0x345dfe[_0x15da7f]={'$like':'%'+_0x48fc54[_0xaeee('0x31')][_0xaeee('0x58')]+'%'};return _0x345dfe;})});}_0x3da18a=_['merge']({},_0x3da18a,_0x48fc54[_0xaeee('0x41')]);return db[_0xaeee('0x5a')][_0xaeee('0x1a')]({'where':_0x3da18a[_0xaeee('0x37')]})[_0xaeee('0x21')](function(_0x4a17c1){_0x2f5a4e['count']=_0x4a17c1;if(_0x48fc54[_0xaeee('0x31')][_0xaeee('0x3b')]){_0x3da18a[_0xaeee('0x3c')]=[{'all':!![]}];}return db[_0xaeee('0x5a')]['findAll'](_0x3da18a);})['then'](function(_0x3e64f7){_0x2f5a4e['rows']=_0x3e64f7;return _0x2f5a4e;});}})[_0xaeee('0x21')](respondWithFilteredResult(_0x1965cf,_0x3da18a))[_0xaeee('0x3e')](handleError(_0x1965cf,null));};exports[_0xaeee('0x5b')]=function(_0x2ab5d9,_0x182f4a,_0x3444b0){var _0x774fdf={'raw':!![],'where':{}};var _0x3af155={};var _0x13e28a={'count':0x0,'rows':[]};return db[_0xaeee('0x2b')][_0xaeee('0x53')]({'where':{'id':_0x2ab5d9[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0x182f4a,null))[_0xaeee('0x21')](function(_0x2e4b75){if(_0x2e4b75){_0x3af155['model']=_['keys'](db[_0xaeee('0x5c')][_0xaeee('0x3f')]);_0x3af155[_0xaeee('0x31')]=_['keys'](_0x2ab5d9[_0xaeee('0x31')]);_0x3af155[_0xaeee('0x38')]=_[_0xaeee('0x32')](_0x3af155[_0xaeee('0x2f')],_0x3af155[_0xaeee('0x31')]);_0x774fdf['attributes']=_[_0xaeee('0x32')](_0x3af155['model'],qs['fields'](_0x2ab5d9[_0xaeee('0x31')]['fields']));_0x774fdf['attributes']=_0x774fdf[_0xaeee('0x34')]['length']?_0x774fdf[_0xaeee('0x34')]:_0x3af155['model'];if(!_0x2ab5d9['query'][_0xaeee('0x55')](_0xaeee('0x35'))){_0x774fdf['limit']=qs[_0xaeee('0x19')](_0x2ab5d9[_0xaeee('0x31')][_0xaeee('0x19')]);_0x774fdf[_0xaeee('0x17')]=qs[_0xaeee('0x17')](_0x2ab5d9[_0xaeee('0x31')]['offset']);}_0x774fdf[_0xaeee('0x56')]=qs[_0xaeee('0x36')](_0x2ab5d9['query']['sort']);_0x774fdf[_0xaeee('0x37')]=qs[_0xaeee('0x38')](_['pick'](_0x2ab5d9[_0xaeee('0x31')],_0x3af155[_0xaeee('0x38')]));_0x774fdf[_0xaeee('0x37')]['CampaignId']=_0x2e4b75['id'];if(_0x2ab5d9[_0xaeee('0x31')][_0xaeee('0x58')]){_0x774fdf[_0xaeee('0x37')]=_['merge'](_0x774fdf[_0xaeee('0x37')],{'$or':_['map'](_0x774fdf[_0xaeee('0x34')],function(_0x40cad3){var _0x24bb0f={};_0x24bb0f[_0x40cad3]={'$like':'%'+_0x2ab5d9['query'][_0xaeee('0x58')]+'%'};return _0x24bb0f;})});}_0x774fdf=_['merge']({},_0x774fdf,_0x2ab5d9['options']);return db[_0xaeee('0x5c')][_0xaeee('0x1a')]({'where':_0x774fdf['where']})[_0xaeee('0x21')](function(_0x408867){_0x13e28a[_0xaeee('0x1a')]=_0x408867;if(_0x2ab5d9['query'][_0xaeee('0x3b')]){_0x774fdf[_0xaeee('0x3c')]=[{'all':!![]}];}return db[_0xaeee('0x5c')]['findAll'](_0x774fdf);})[_0xaeee('0x21')](function(_0x481907){_0x13e28a[_0xaeee('0x59')]=_0x481907;return _0x13e28a;});}})[_0xaeee('0x21')](respondWithFilteredResult(_0x182f4a,_0x774fdf))[_0xaeee('0x3e')](handleError(_0x182f4a,null));};exports[_0xaeee('0x5d')]=function(_0x31620c,_0xdf5f,_0x48d602){var _0x589d14={'raw':!![],'where':{}};var _0x220178={};var _0x4354d7={'count':0x0,'rows':[]};return db['Campaign'][_0xaeee('0x53')]({'where':{'id':_0x31620c[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0xdf5f,null))[_0xaeee('0x21')](function(_0x3b1d73){if(_0x3b1d73){_0x220178['model']=_['keys'](db[_0xaeee('0x5e')][_0xaeee('0x3f')]);_0x220178['query']=_[_0xaeee('0x30')](_0x31620c['query']);_0x220178[_0xaeee('0x38')]=_['intersection'](_0x220178['model'],_0x220178['query']);_0x589d14[_0xaeee('0x34')]=_[_0xaeee('0x32')](_0x220178[_0xaeee('0x2f')],qs[_0xaeee('0x33')](_0x31620c['query'][_0xaeee('0x33')]));_0x589d14[_0xaeee('0x34')]=_0x589d14['attributes']['length']?_0x589d14[_0xaeee('0x34')]:_0x220178['model'];if(!_0x31620c[_0xaeee('0x31')][_0xaeee('0x55')]('nolimit')){_0x589d14[_0xaeee('0x19')]=qs[_0xaeee('0x19')](_0x31620c[_0xaeee('0x31')]['limit']);_0x589d14[_0xaeee('0x17')]=qs[_0xaeee('0x17')](_0x31620c[_0xaeee('0x31')][_0xaeee('0x17')]);}_0x589d14['order']=qs['sort'](_0x31620c[_0xaeee('0x31')][_0xaeee('0x36')]);_0x589d14['where']=qs[_0xaeee('0x38')](_[_0xaeee('0x39')](_0x31620c['query'],_0x220178[_0xaeee('0x38')]));_0x589d14[_0xaeee('0x37')][_0xaeee('0x57')]=_0x3b1d73['id'];if(_0x31620c[_0xaeee('0x31')][_0xaeee('0x58')]){_0x589d14[_0xaeee('0x37')]=_[_0xaeee('0x3a')](_0x589d14[_0xaeee('0x37')],{'$or':_[_0xaeee('0x2a')](_0x589d14[_0xaeee('0x34')],function(_0x5c468a){var _0x36f163={};_0x36f163[_0x5c468a]={'$like':'%'+_0x31620c[_0xaeee('0x31')][_0xaeee('0x58')]+'%'};return _0x36f163;})});}_0x589d14=_['merge']({},_0x589d14,_0x31620c[_0xaeee('0x41')]);return db[_0xaeee('0x5e')][_0xaeee('0x1a')]({'where':_0x589d14['where']})[_0xaeee('0x21')](function(_0x240952){_0x4354d7[_0xaeee('0x1a')]=_0x240952;if(_0x31620c[_0xaeee('0x31')]['includeAll']){_0x589d14['include']=[{'all':!![]}];}return db[_0xaeee('0x5e')][_0xaeee('0x3d')](_0x589d14);})[_0xaeee('0x21')](function(_0x2e6bc1){_0x4354d7['rows']=_0x2e6bc1;return _0x4354d7;});}})[_0xaeee('0x21')](respondWithFilteredResult(_0xdf5f,_0x589d14))[_0xaeee('0x3e')](handleError(_0xdf5f,null));};exports['getLists']=function(_0x36b1d1,_0x376fbf,_0x4ced5b){var _0x2b1075={};var _0xeb9c1c={};var _0x30bd68;var _0x463dca;return db[_0xaeee('0x2b')]['findOne']({'where':{'id':_0x36b1d1[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0x376fbf,null))[_0xaeee('0x21')](function(_0x4de6d1){if(_0x4de6d1){_0x30bd68=_0x4de6d1;_0xeb9c1c[_0xaeee('0x2f')]=_[_0xaeee('0x30')](db[_0xaeee('0x5f')][_0xaeee('0x3f')]);_0xeb9c1c[_0xaeee('0x31')]=_['keys'](_0x36b1d1[_0xaeee('0x31')]);_0xeb9c1c[_0xaeee('0x38')]=_[_0xaeee('0x32')](_0xeb9c1c[_0xaeee('0x2f')],_0xeb9c1c[_0xaeee('0x31')]);_0x2b1075[_0xaeee('0x34')]=_[_0xaeee('0x32')](_0xeb9c1c[_0xaeee('0x2f')],qs[_0xaeee('0x33')](_0x36b1d1['query'][_0xaeee('0x33')]));_0x2b1075['attributes']=_0x2b1075['attributes'][_0xaeee('0x40')]?_0x2b1075[_0xaeee('0x34')]:_0xeb9c1c[_0xaeee('0x2f')];_0x2b1075[_0xaeee('0x56')]=qs[_0xaeee('0x36')](_0x36b1d1[_0xaeee('0x31')][_0xaeee('0x36')]);_0x2b1075[_0xaeee('0x37')]=qs[_0xaeee('0x38')](_['pick'](_0x36b1d1[_0xaeee('0x31')],_0xeb9c1c[_0xaeee('0x38')]));if(_0x36b1d1[_0xaeee('0x31')][_0xaeee('0x58')]){_0x2b1075[_0xaeee('0x37')]=_['merge'](_0x2b1075['where'],{'$or':_[_0xaeee('0x2a')](_0x2b1075[_0xaeee('0x34')],function(_0x4147f4){var _0x23e394={};_0x23e394[_0x4147f4]={'$like':'%'+_0x36b1d1['query'][_0xaeee('0x58')]+'%'};return _0x23e394;})});}_0x2b1075=_[_0xaeee('0x3a')]({},_0x2b1075,_0x36b1d1['options']);return _0x30bd68[_0xaeee('0x60')](_0x2b1075);}})[_0xaeee('0x21')](function(_0xee89d6){if(_0xee89d6){_0x463dca=_0xee89d6[_0xaeee('0x40')];if(!_0x36b1d1[_0xaeee('0x31')][_0xaeee('0x55')](_0xaeee('0x35'))){_0x2b1075[_0xaeee('0x19')]=qs[_0xaeee('0x19')](_0x36b1d1['query']['limit']);_0x2b1075['offset']=qs[_0xaeee('0x17')](_0x36b1d1[_0xaeee('0x31')][_0xaeee('0x17')]);}return _0x30bd68[_0xaeee('0x60')](_0x2b1075);}})[_0xaeee('0x21')](function(_0x53eb84){if(_0x53eb84){return _0x53eb84?{'count':_0x463dca,'rows':_0x53eb84}:null;}})[_0xaeee('0x21')](respondWithResult(_0x376fbf,null))['catch'](handleError(_0x376fbf,null));};exports[_0xaeee('0x61')]=function(_0x2c7bfc,_0x575cce,_0x56b476){var _0x455542,_0x56696a;return db[_0xaeee('0x2b')][_0xaeee('0x42')]({'where':{'id':_0x2c7bfc[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0x575cce,null))[_0xaeee('0x21')](function(_0x5de550){if(_0x5de550){_0x56696a=_0x5de550;return _0x5de550[_0xaeee('0x61')](_0x2c7bfc[_0xaeee('0x50')][_0xaeee('0x62')],_['omit'](_0x2c7bfc[_0xaeee('0x50')],[_0xaeee('0x62'),'id'])||{});}return null;})[_0xaeee('0x63')](function(_0x27479f){var _0x5a6185;_0x455542=_0x27479f||[];var _0x54a8f1=[];if(_0x27479f){for(var _0x35398a=0x0;_0x35398a<_0x27479f[_0xaeee('0x40')];_0x35398a+=0x1){var _0x38491e=_0x27479f[_0x35398a][_0xaeee('0x4c')]({'plain':!![]});_0x56696a[_0xaeee('0x64')]=_0x2c7bfc[_0xaeee('0x50')][_0xaeee('0x64')]?_0x2c7bfc[_0xaeee('0x50')]['dialCheckDuplicateType']:_0x56696a[_0xaeee('0x64')];switch(_0x56696a[_0xaeee('0x64')]){case'always':_0x5a6185=squel['insert']()[_0xaeee('0x65')](_0xaeee('0x66'))['fromQuery']([_0xaeee('0x67'),'scheduledAt','ContactId',_0xaeee('0x68'),_0xaeee('0x57'),'createdAt','updatedAt'],squel['select']()[_0xaeee('0x69')](_0xaeee('0x67'),_0xaeee('0x67'))[_0xaeee('0x69')]('NOW()',_0xaeee('0x6a'))[_0xaeee('0x69')]('id','ContactId')[_0xaeee('0x69')](_0x38491e[_0xaeee('0x6b')][_0xaeee('0x6c')](),_0xaeee('0x68'))['field'](_0x2c7bfc[_0xaeee('0x51')]['id']['toString'](),_0xaeee('0x57'))[_0xaeee('0x69')](_0xaeee('0x6d'),_0xaeee('0x4e'))[_0xaeee('0x69')]('NOW()',_0xaeee('0x4f'))['from'](_0xaeee('0x6e'))[_0xaeee('0x37')](_0xaeee('0x6f'))[_0xaeee('0x37')](_0xaeee('0x70'),_0x38491e[_0xaeee('0x6b')][_0xaeee('0x6c')]())[_0xaeee('0x37')](_0xaeee('0x71'))[_0xaeee('0x37')](_0xaeee('0x72'),squel[_0xaeee('0x73')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xaeee('0x74'))[_0xaeee('0x37')](_0xaeee('0x75'),_0x2c7bfc[_0xaeee('0x51')]['id']['toString']()))[_0xaeee('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xaeee('0x73')]()[_0xaeee('0x69')](_0xaeee('0x76'))['from'](_0xaeee('0x66'))['where'](_0xaeee('0x75'),_0x2c7bfc[_0xaeee('0x51')]['id'][_0xaeee('0x6c')]())))[_0xaeee('0x6c')]();break;case _0xaeee('0x77'):_0x5a6185=squel[_0xaeee('0x78')]()[_0xaeee('0x65')](_0xaeee('0x66'))[_0xaeee('0x79')]([_0xaeee('0x67'),_0xaeee('0x6a'),'ContactId',_0xaeee('0x68'),_0xaeee('0x57'),_0xaeee('0x4e'),_0xaeee('0x4f')],squel['select']()[_0xaeee('0x69')](_0xaeee('0x67'),_0xaeee('0x67'))[_0xaeee('0x69')](_0xaeee('0x6d'),_0xaeee('0x6a'))[_0xaeee('0x69')]('id',_0xaeee('0x7a'))[_0xaeee('0x69')](_0x38491e[_0xaeee('0x6b')][_0xaeee('0x6c')](),_0xaeee('0x68'))[_0xaeee('0x69')](_0x2c7bfc[_0xaeee('0x51')]['id'][_0xaeee('0x6c')](),_0xaeee('0x57'))[_0xaeee('0x69')](_0xaeee('0x6d'),_0xaeee('0x4e'))['field'](_0xaeee('0x6d'),_0xaeee('0x4f'))[_0xaeee('0x7b')](_0xaeee('0x6e'))[_0xaeee('0x37')](_0xaeee('0x6f'))[_0xaeee('0x37')]('ListId\x20=\x20?',_0x38491e[_0xaeee('0x6b')][_0xaeee('0x6c')]())[_0xaeee('0x37')](_0xaeee('0x71'))[_0xaeee('0x37')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xaeee('0x69')](_0xaeee('0x76'))['from'](_0xaeee('0x66'))['where'](_0xaeee('0x75'),_0x2c7bfc[_0xaeee('0x51')]['id'][_0xaeee('0x6c')]())))[_0xaeee('0x6c')]();break;default:_0x5a6185=squel[_0xaeee('0x78')]()['into'](_0xaeee('0x66'))[_0xaeee('0x79')]([_0xaeee('0x67'),_0xaeee('0x6a'),'ContactId',_0xaeee('0x68'),_0xaeee('0x57'),_0xaeee('0x4e'),_0xaeee('0x4f')],squel[_0xaeee('0x73')]()['field'](_0xaeee('0x67'),_0xaeee('0x67'))[_0xaeee('0x69')](_0xaeee('0x6d'),_0xaeee('0x6a'))[_0xaeee('0x69')]('id','ContactId')[_0xaeee('0x69')](_0x38491e[_0xaeee('0x6b')][_0xaeee('0x6c')](),_0xaeee('0x68'))[_0xaeee('0x69')](_0x2c7bfc[_0xaeee('0x51')]['id'][_0xaeee('0x6c')](),'CampaignId')['field'](_0xaeee('0x6d'),'createdAt')['field']('NOW()','updatedAt')[_0xaeee('0x7b')](_0xaeee('0x6e'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xaeee('0x70'),_0x38491e[_0xaeee('0x6b')][_0xaeee('0x6c')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xaeee('0x6c')]();}_0x54a8f1[_0xaeee('0x7c')](db['sequelize']['query'](_0x5a6185));}return BPromise[_0xaeee('0x7d')](_0x54a8f1);}})[_0xaeee('0x21')](function(){return _0x455542;})[_0xaeee('0x21')](respondWithResult(_0x575cce,null))[_0xaeee('0x3e')](handleError(_0x575cce,null));};exports[_0xaeee('0x7e')]=function(_0x513d9e,_0x363d8d,_0x24eff4){return db[_0xaeee('0x2b')][_0xaeee('0x42')]({'where':{'id':_0x513d9e[_0xaeee('0x51')]['id']}})['then'](handleEntityNotFound(_0x363d8d,null))[_0xaeee('0x21')](function(_0x303d7c){if(_0x303d7c){return _0x303d7c[_0xaeee('0x7e')](_0x513d9e['query'][_0xaeee('0x62')]);}})[_0xaeee('0x21')](function(_0x48a796){if(_0x48a796){return db[_0xaeee('0x54')][_0xaeee('0x22')]({'where':{'ListId':_0x513d9e[_0xaeee('0x31')]['ids'],'CampaignId':_0x513d9e['params']['id']}})[_0xaeee('0x21')](function(){return _0x48a796;});}})['then'](respondWithStatusCode(_0x363d8d,null))['catch'](handleError(_0x363d8d,null));};exports['getBlackLists']=function(_0x3b9b17,_0x4220a9,_0x5b9d1e){var _0x25db0f={};var _0x2a3fac={};var _0x401b60;var _0x277f87;return db[_0xaeee('0x2b')][_0xaeee('0x53')]({'where':{'id':_0x3b9b17[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0x4220a9,null))['then'](function(_0x51aa29){if(_0x51aa29){_0x401b60=_0x51aa29;_0x2a3fac[_0xaeee('0x2f')]=_[_0xaeee('0x30')](db[_0xaeee('0x5f')][_0xaeee('0x3f')]);_0x2a3fac[_0xaeee('0x31')]=_['keys'](_0x3b9b17[_0xaeee('0x31')]);_0x2a3fac[_0xaeee('0x38')]=_['intersection'](_0x2a3fac[_0xaeee('0x2f')],_0x2a3fac[_0xaeee('0x31')]);_0x25db0f[_0xaeee('0x34')]=_[_0xaeee('0x32')](_0x2a3fac[_0xaeee('0x2f')],qs[_0xaeee('0x33')](_0x3b9b17['query'][_0xaeee('0x33')]));_0x25db0f['attributes']=_0x25db0f[_0xaeee('0x34')]['length']?_0x25db0f[_0xaeee('0x34')]:_0x2a3fac[_0xaeee('0x2f')];_0x25db0f[_0xaeee('0x56')]=qs[_0xaeee('0x36')](_0x3b9b17[_0xaeee('0x31')][_0xaeee('0x36')]);_0x25db0f[_0xaeee('0x37')]=qs[_0xaeee('0x38')](_['pick'](_0x3b9b17[_0xaeee('0x31')],_0x2a3fac['filters']));if(_0x3b9b17['query'][_0xaeee('0x58')]){_0x25db0f['where']=_['merge'](_0x25db0f[_0xaeee('0x37')],{'$or':_['map'](_0x25db0f['attributes'],function(_0x4dfafc){var _0x5851f4={};_0x5851f4[_0x4dfafc]={'$like':'%'+_0x3b9b17[_0xaeee('0x31')]['filter']+'%'};return _0x5851f4;})});}_0x25db0f=_['merge']({},_0x25db0f,_0x3b9b17['options']);return _0x401b60['getBlackLists'](_0x25db0f);}})[_0xaeee('0x21')](function(_0x173e13){if(_0x173e13){_0x277f87=_0x173e13['length'];if(!_0x3b9b17[_0xaeee('0x31')][_0xaeee('0x55')]('nolimit')){_0x25db0f[_0xaeee('0x19')]=qs[_0xaeee('0x19')](_0x3b9b17[_0xaeee('0x31')][_0xaeee('0x19')]);_0x25db0f['offset']=qs[_0xaeee('0x17')](_0x3b9b17[_0xaeee('0x31')][_0xaeee('0x17')]);}return _0x401b60[_0xaeee('0x7f')](_0x25db0f);}})[_0xaeee('0x21')](function(_0x301069){if(_0x301069){return _0x301069?{'count':_0x277f87,'rows':_0x301069}:null;}})['then'](respondWithResult(_0x4220a9,null))[_0xaeee('0x3e')](handleError(_0x4220a9,null));};exports[_0xaeee('0x80')]=function(_0x5c6d1b,_0x1916b0,_0x2b10a1){var _0x402f3a,_0x5f7942;return db[_0xaeee('0x2b')][_0xaeee('0x42')]({'where':{'id':_0x5c6d1b[_0xaeee('0x51')]['id']}})['then'](handleEntityNotFound(_0x1916b0,null))['then'](function(_0xb39870){if(_0xb39870){_0x5f7942=_0xb39870;return _0xb39870['addBlackLists'](_0x5c6d1b[_0xaeee('0x50')][_0xaeee('0x62')],_['omit'](_0x5c6d1b[_0xaeee('0x50')],[_0xaeee('0x62'),'id'])||{});}return null;})[_0xaeee('0x63')](function(_0x377379){var _0x56d911;_0x402f3a=_0x377379||[];var _0x39746b=[];if(_0x377379){for(var _0x2f743b=0x0;_0x2f743b<_0x377379[_0xaeee('0x40')];_0x2f743b+=0x1){var _0x29a25c=_0x377379[_0x2f743b][_0xaeee('0x4c')]({'plain':!![]});_0x56d911=squel['insert']()['into']('cm_hopper_black')[_0xaeee('0x79')]([_0xaeee('0x67'),'ContactId',_0xaeee('0x68'),_0xaeee('0x57'),'createdAt',_0xaeee('0x4f')],squel['select']()[_0xaeee('0x69')]('phone',_0xaeee('0x67'))['field']('id',_0xaeee('0x7a'))[_0xaeee('0x69')](_0x29a25c['CmListId'][_0xaeee('0x6c')](),_0xaeee('0x68'))[_0xaeee('0x69')](_0x5c6d1b['params']['id'][_0xaeee('0x6c')](),_0xaeee('0x57'))[_0xaeee('0x69')](_0xaeee('0x6d'),_0xaeee('0x4e'))['field']('NOW()','updatedAt')['from'](_0xaeee('0x6e'))[_0xaeee('0x37')](_0xaeee('0x6f'))[_0xaeee('0x37')]('ListId\x20=\x20?',_0x29a25c[_0xaeee('0x6b')][_0xaeee('0x6c')]())[_0xaeee('0x37')](_0xaeee('0x71')))['toString']();_0x39746b[_0xaeee('0x7c')](db[_0xaeee('0x81')][_0xaeee('0x31')](_0x56d911));}return BPromise[_0xaeee('0x7d')](_0x39746b);}})[_0xaeee('0x21')](function(){return _0x402f3a;})[_0xaeee('0x21')](respondWithResult(_0x1916b0,null))[_0xaeee('0x3e')](handleError(_0x1916b0,null));};exports[_0xaeee('0x82')]=function(_0xa4ad6d,_0x57af51,_0x2d0415){return db[_0xaeee('0x2b')][_0xaeee('0x42')]({'where':{'id':_0xa4ad6d[_0xaeee('0x51')]['id']}})[_0xaeee('0x21')](handleEntityNotFound(_0x57af51,null))[_0xaeee('0x21')](function(_0x1c3262){if(_0x1c3262){return _0x1c3262[_0xaeee('0x82')](_0xa4ad6d[_0xaeee('0x31')][_0xaeee('0x62')]);}})[_0xaeee('0x21')](function(_0x5d0e9a){if(_0x5d0e9a){return db[_0xaeee('0x5e')][_0xaeee('0x22')]({'where':{'ListId':_0xa4ad6d['query'][_0xaeee('0x62')],'CampaignId':_0xa4ad6d['params']['id']}})['then'](function(){return _0x5d0e9a;});}})['then'](respondWithStatusCode(_0x57af51,null))[_0xaeee('0x3e')](handleError(_0x57af51,null));}; \ No newline at end of file +var _0x5d70=['all','removeLists','getBlackLists','CmList','cm_hopper_black','removeBlackLists','eml-format','rimraf','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','Campaign','includeAll','include','findAll','rows','intersection','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','role','update','CmHopper','nolimit','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','select','field','CmListId','toString','ListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ContactId','ListId\x20=\x20?','insert','push','sequelize'];(function(_0x2803dc,_0x1cdaf1){var _0x552ae4=function(_0x15f1ef){while(--_0x15f1ef){_0x2803dc['push'](_0x2803dc['shift']());}};_0x552ae4(++_0x1cdaf1);}(_0x5d70,0x18f));var _0x05d7=function(_0xfd0f6b,_0x18a886){_0xfd0f6b=_0xfd0f6b-0x0;var _0x44d542=_0x5d70[_0xfd0f6b];return _0x44d542;};'use strict';var emlformat=require(_0x05d7('0x0'));var rimraf=require(_0x05d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x05d7('0x2'));var BPromise=require(_0x05d7('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x05d7('0x4'));var sox=require('sox');var csv=require(_0x05d7('0x5'));var ejs=require(_0x05d7('0x6'));var fs=require('fs');var fs_extra=require(_0x05d7('0x7'));var _=require(_0x05d7('0x8'));var squel=require('squel');var crypto=require(_0x05d7('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x05d7('0xa'));var Papa=require(_0x05d7('0xb'));var Redis=require(_0x05d7('0xc'));var authService=require(_0x05d7('0xd'));var qs=require(_0x05d7('0xe'));var as=require(_0x05d7('0xf'));var hardwareService=require(_0x05d7('0x10'));var logger=require(_0x05d7('0x11'))(_0x05d7('0x12'));var utils=require(_0x05d7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x05d7('0x14'));var db=require(_0x05d7('0x15'))['db'];function respondWithStatusCode(_0x70818c,_0x4a5a94){_0x4a5a94=_0x4a5a94||0xcc;return function(_0x1d0b1a){if(_0x1d0b1a){return _0x70818c['sendStatus'](_0x4a5a94);}return _0x70818c['status'](_0x4a5a94)[_0x05d7('0x16')]();};}function respondWithResult(_0x57fb40,_0x473016){_0x473016=_0x473016||0xc8;return function(_0x16824d){if(_0x16824d){return _0x57fb40['status'](_0x473016)[_0x05d7('0x17')](_0x16824d);}};}function respondWithFilteredResult(_0x6851b,_0x1e360a){return function(_0x4b94f6){if(_0x4b94f6){var _0xba0b9a=typeof _0x1e360a[_0x05d7('0x18')]===_0x05d7('0x19')&&typeof _0x1e360a[_0x05d7('0x1a')]===_0x05d7('0x19');var _0x1a9889=_0x4b94f6[_0x05d7('0x1b')];var _0x1d5cea=_0xba0b9a?0x0:_0x1e360a[_0x05d7('0x18')];var _0x51fd65=_0xba0b9a?_0x4b94f6[_0x05d7('0x1b')]:_0x1e360a[_0x05d7('0x18')]+_0x1e360a['limit'];var _0x49f8ef;if(_0x51fd65>=_0x1a9889){_0x51fd65=_0x1a9889;_0x49f8ef=0xc8;}else{_0x49f8ef=0xce;}_0x6851b[_0x05d7('0x1c')](_0x49f8ef);return _0x6851b['set'](_0x05d7('0x1d'),_0x1d5cea+'-'+_0x51fd65+'/'+_0x1a9889)['json'](_0x4b94f6);}return null;};}function patchUpdates(_0x3450c4){return function(_0x51daa1){try{jsonpatch[_0x05d7('0x1e')](_0x51daa1,_0x3450c4,!![]);}catch(_0x3a587a){return BPromise[_0x05d7('0x1f')](_0x3a587a);}return _0x51daa1[_0x05d7('0x20')]();};}function saveUpdates(_0x181dfc,_0x470eb3){return function(_0x56bffb){if(_0x56bffb){return _0x56bffb['update'](_0x181dfc)[_0x05d7('0x21')](function(_0x309ead){return _0x309ead;});}return null;};}function removeEntity(_0x59c420,_0x35bf03){return function(_0x38e10a){if(_0x38e10a){return _0x38e10a[_0x05d7('0x22')]()[_0x05d7('0x21')](function(){var _0x37e708=_0x38e10a['get']({'plain':!![]});var _0x261bd9=_0x05d7('0x23');return db[_0x05d7('0x24')][_0x05d7('0x22')]({'where':{'type':_0x261bd9,'resourceId':_0x37e708['id']}})[_0x05d7('0x21')](function(){return _0x38e10a;});})[_0x05d7('0x21')](function(){_0x59c420['status'](0xcc)[_0x05d7('0x16')]();});}};}function handleEntityNotFound(_0x2884ea,_0x21560b){return function(_0x584bbc){if(!_0x584bbc){_0x2884ea[_0x05d7('0x25')](0x194);}return _0x584bbc;};}function handleError(_0x34cfb6,_0x5f08cf){_0x5f08cf=_0x5f08cf||0x1f4;return function(_0x4d3651){logger['error'](_0x4d3651[_0x05d7('0x26')]);if(_0x4d3651['name']){delete _0x4d3651[_0x05d7('0x27')];}_0x34cfb6[_0x05d7('0x1c')](_0x5f08cf)[_0x05d7('0x28')](_0x4d3651);};}exports[_0x05d7('0x29')]=function(_0xfeeab3,_0x5de8fc){var _0x1fee1a={},_0x20fadc={},_0x1d3421={'count':0x0,'rows':[]};var _0x4c25a3=_[_0x05d7('0x2a')](db['Campaign'][_0x05d7('0x2b')],function(_0x17bcb7){return{'name':_0x17bcb7[_0x05d7('0x2c')],'type':_0x17bcb7[_0x05d7('0x2d')]['key']};});_0x20fadc[_0x05d7('0x2e')]=_[_0x05d7('0x2a')](_0x4c25a3,_0x05d7('0x27'));_0x20fadc[_0x05d7('0x2f')]=_[_0x05d7('0x30')](_0xfeeab3[_0x05d7('0x2f')]);_0x20fadc['filters']=_['intersection'](_0x20fadc['model'],_0x20fadc[_0x05d7('0x2f')]);_0x1fee1a[_0x05d7('0x31')]=_['intersection'](_0x20fadc[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0xfeeab3['query'][_0x05d7('0x32')]));_0x1fee1a[_0x05d7('0x31')]=_0x1fee1a[_0x05d7('0x31')][_0x05d7('0x33')]?_0x1fee1a[_0x05d7('0x31')]:_0x20fadc[_0x05d7('0x2e')];if(!_0xfeeab3[_0x05d7('0x2f')]['hasOwnProperty']('nolimit')){_0x1fee1a['limit']=qs[_0x05d7('0x1a')](_0xfeeab3['query']['limit']);_0x1fee1a[_0x05d7('0x18')]=qs[_0x05d7('0x18')](_0xfeeab3['query'][_0x05d7('0x18')]);}_0x1fee1a[_0x05d7('0x34')]=qs[_0x05d7('0x35')](_0xfeeab3['query'][_0x05d7('0x35')]);_0x1fee1a[_0x05d7('0x36')]=qs['filters'](_[_0x05d7('0x37')](_0xfeeab3[_0x05d7('0x2f')],_0x20fadc[_0x05d7('0x38')]),_0x4c25a3);if(_0xfeeab3[_0x05d7('0x2f')][_0x05d7('0x39')]){_0x1fee1a['where']=_['merge'](_0x1fee1a[_0x05d7('0x36')],{'$or':_['map'](_0x4c25a3,function(_0x3c6597){if(_0x3c6597['type']!==_0x05d7('0x3a')){var _0x34d370={};_0x34d370[_0x3c6597[_0x05d7('0x27')]]={'$like':'%'+_0xfeeab3[_0x05d7('0x2f')][_0x05d7('0x39')]+'%'};return _0x34d370;}})});}_0x1fee1a=_[_0x05d7('0x3b')]({},_0x1fee1a,_0xfeeab3[_0x05d7('0x3c')]);var _0x88b708={'where':_0x1fee1a[_0x05d7('0x36')]};return db[_0x05d7('0x3d')][_0x05d7('0x1b')](_0x88b708)[_0x05d7('0x21')](function(_0x46e1a0){_0x1d3421[_0x05d7('0x1b')]=_0x46e1a0;if(_0xfeeab3[_0x05d7('0x2f')][_0x05d7('0x3e')]){_0x1fee1a[_0x05d7('0x3f')]=[{'all':!![]}];}return db[_0x05d7('0x3d')][_0x05d7('0x40')](_0x1fee1a);})[_0x05d7('0x21')](function(_0x78db05){_0x1d3421[_0x05d7('0x41')]=_0x78db05;return _0x1d3421;})[_0x05d7('0x21')](respondWithFilteredResult(_0x5de8fc,_0x1fee1a))['catch'](handleError(_0x5de8fc,null));};exports['show']=function(_0x3289bf,_0x137ba4){var _0x32f976={'raw':![],'where':{'id':_0x3289bf['params']['id']}},_0x5ba7c0={};_0x5ba7c0[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db[_0x05d7('0x3d')]['rawAttributes']);_0x5ba7c0[_0x05d7('0x2f')]=_['keys'](_0x3289bf[_0x05d7('0x2f')]);_0x5ba7c0[_0x05d7('0x38')]=_[_0x05d7('0x42')](_0x5ba7c0[_0x05d7('0x2e')],_0x5ba7c0[_0x05d7('0x2f')]);_0x32f976[_0x05d7('0x31')]=_[_0x05d7('0x42')](_0x5ba7c0[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0x3289bf[_0x05d7('0x2f')]['fields']));_0x32f976[_0x05d7('0x31')]=_0x32f976[_0x05d7('0x31')][_0x05d7('0x33')]?_0x32f976[_0x05d7('0x31')]:_0x5ba7c0[_0x05d7('0x2e')];if(_0x3289bf[_0x05d7('0x2f')][_0x05d7('0x3e')]){_0x32f976[_0x05d7('0x3f')]=[{'all':!![]}];}_0x32f976=_['merge']({},_0x32f976,_0x3289bf[_0x05d7('0x3c')]);return db[_0x05d7('0x3d')][_0x05d7('0x43')](_0x32f976)['then'](handleEntityNotFound(_0x137ba4,null))[_0x05d7('0x21')](respondWithResult(_0x137ba4,null))[_0x05d7('0x44')](handleError(_0x137ba4,null));};exports[_0x05d7('0x45')]=function(_0x41ac8b,_0x460cb5){return db[_0x05d7('0x3d')][_0x05d7('0x45')](_0x41ac8b[_0x05d7('0x46')],{})[_0x05d7('0x21')](function(_0x49696e){var _0x5762e1=_0x41ac8b[_0x05d7('0x47')][_0x05d7('0x48')]({'plain':!![]});if(!_0x5762e1)throw new Error(_0x05d7('0x49'));if(_0x5762e1['role']==='user'){var _0x4b6509=_0x49696e[_0x05d7('0x48')]({'plain':!![]});var _0x6d73d6=_0x05d7('0x23');return db[_0x05d7('0x4a')][_0x05d7('0x43')]({'where':{'name':_0x6d73d6,'userProfileId':_0x5762e1[_0x05d7('0x4b')]},'raw':!![]})['then'](function(_0x118fe5){if(_0x118fe5&&_0x118fe5[_0x05d7('0x4c')]===0x0){return db['UserProfileResource'][_0x05d7('0x45')]({'name':_0x4b6509[_0x05d7('0x27')],'resourceId':_0x4b6509['id'],'type':_0x118fe5['name'],'sectionId':_0x118fe5['id']},{})[_0x05d7('0x21')](function(){return _0x49696e;});}else{return _0x49696e;}})[_0x05d7('0x44')](function(_0x74ca27){logger[_0x05d7('0x4d')](_0x05d7('0x4e'),_0x74ca27);throw _0x74ca27;});}return _0x49696e;})[_0x05d7('0x21')](respondWithResult(_0x460cb5,0xc9))[_0x05d7('0x44')](handleError(_0x460cb5,null));};exports['clone']=function(_0x39849d,_0x1bc315){var _0x3302f6={'where':{'id':_0x39849d[_0x05d7('0x4f')]['id']}},_0x3b1170={};_0x3b1170[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db['Campaign'][_0x05d7('0x2b')]);_0x3302f6['attributes']=_['intersection'](_0x3b1170[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0x39849d[_0x05d7('0x2f')][_0x05d7('0x32')]));_0x3302f6[_0x05d7('0x31')]=_0x3302f6[_0x05d7('0x31')][_0x05d7('0x33')]?_0x3302f6[_0x05d7('0x31')]:_0x3b1170[_0x05d7('0x2e')];if(_0x39849d[_0x05d7('0x2f')][_0x05d7('0x3e')]){_0x3302f6[_0x05d7('0x3f')]=[{'all':!![]}];}_0x3302f6=_[_0x05d7('0x3b')]({},_0x3302f6,_0x39849d[_0x05d7('0x3c')]);return db['Campaign']['find'](_0x3302f6)[_0x05d7('0x21')](handleEntityNotFound(_0x1bc315,null))[_0x05d7('0x21')](function(_0x5ed94e){if(_0x5ed94e){var _0x171e1d=_0x5ed94e['get']({'plain':!![]});_0x171e1d=qs[_0x05d7('0x50')](_0x171e1d,['id',_0x05d7('0x51'),_0x05d7('0x52')]);_0x39849d[_0x05d7('0x46')]=_[_0x05d7('0x50')](_0x39849d[_0x05d7('0x46')],['id',_0x05d7('0x51'),_0x05d7('0x52')]);return db['Campaign']['create'](_[_0x05d7('0x3b')](_0x171e1d,_0x39849d['body']),{'include':_0x39849d['query'][_0x05d7('0x3e')]?[{'all':!![]}]:undefined})[_0x05d7('0x21')](function(_0x63e24f){var _0x43248b=_0x39849d[_0x05d7('0x47')]['get']({'plain':!![]});if(!_0x43248b)throw new Error(_0x05d7('0x49'));if(_0x43248b[_0x05d7('0x53')]===_0x05d7('0x47')){var _0x1b8088=_0x63e24f['get']({'plain':!![]});var _0x6fc4b=_0x05d7('0x23');return db[_0x05d7('0x4a')][_0x05d7('0x43')]({'where':{'name':_0x6fc4b,'userProfileId':_0x43248b[_0x05d7('0x4b')]},'raw':!![]})[_0x05d7('0x21')](function(_0xe193a2){if(_0xe193a2&&_0xe193a2[_0x05d7('0x4c')]===0x0){return db[_0x05d7('0x24')][_0x05d7('0x45')]({'name':_0x1b8088[_0x05d7('0x27')],'resourceId':_0x1b8088['id'],'type':_0xe193a2['name'],'sectionId':_0xe193a2['id']},{})['then'](function(){return _0x63e24f;});}else{return _0x63e24f;}})['catch'](function(_0x1ae41b){logger['error'](_0x05d7('0x4e'),_0x1ae41b);throw _0x1ae41b;});}return _0x63e24f;});}})['then'](respondWithResult(_0x1bc315,0xc9))[_0x05d7('0x44')](handleError(_0x1bc315,null));};exports[_0x05d7('0x54')]=function(_0x5172ba,_0x49290c){if(_0x5172ba[_0x05d7('0x46')]['id']){delete _0x5172ba[_0x05d7('0x46')]['id'];}return db[_0x05d7('0x3d')][_0x05d7('0x43')]({'where':{'id':_0x5172ba['params']['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x49290c,null))[_0x05d7('0x21')](saveUpdates(_0x5172ba['body'],null))[_0x05d7('0x21')](respondWithResult(_0x49290c,null))[_0x05d7('0x44')](handleError(_0x49290c,null));};exports[_0x05d7('0x22')]=function(_0x337e67,_0x48c7af){return db['Campaign']['find']({'where':{'id':_0x337e67[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x48c7af,null))[_0x05d7('0x21')](removeEntity(_0x48c7af,null))[_0x05d7('0x44')](handleError(_0x48c7af,null));};exports['getHoppers']=function(_0x49a4d4,_0x54615b,_0x16188d){var _0x4360f7={'raw':!![],'where':{}};var _0x8619a7={};var _0x4a56ac={'count':0x0,'rows':[]};return db[_0x05d7('0x3d')]['findOne']({'where':{'id':_0x49a4d4['params']['id']}})['then'](handleEntityNotFound(_0x54615b,null))['then'](function(_0x569589){if(_0x569589){_0x8619a7[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db[_0x05d7('0x55')][_0x05d7('0x2b')]);_0x8619a7[_0x05d7('0x2f')]=_['keys'](_0x49a4d4['query']);_0x8619a7[_0x05d7('0x38')]=_['intersection'](_0x8619a7[_0x05d7('0x2e')],_0x8619a7[_0x05d7('0x2f')]);_0x4360f7['attributes']=_[_0x05d7('0x42')](_0x8619a7[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0x49a4d4[_0x05d7('0x2f')][_0x05d7('0x32')]));_0x4360f7[_0x05d7('0x31')]=_0x4360f7['attributes'][_0x05d7('0x33')]?_0x4360f7[_0x05d7('0x31')]:_0x8619a7[_0x05d7('0x2e')];if(!_0x49a4d4['query']['hasOwnProperty'](_0x05d7('0x56'))){_0x4360f7[_0x05d7('0x1a')]=qs['limit'](_0x49a4d4['query'][_0x05d7('0x1a')]);_0x4360f7[_0x05d7('0x18')]=qs['offset'](_0x49a4d4['query'][_0x05d7('0x18')]);}_0x4360f7[_0x05d7('0x34')]=qs[_0x05d7('0x35')](_0x49a4d4['query'][_0x05d7('0x35')]);_0x4360f7[_0x05d7('0x36')]=qs[_0x05d7('0x38')](_[_0x05d7('0x37')](_0x49a4d4[_0x05d7('0x2f')],_0x8619a7[_0x05d7('0x38')]));_0x4360f7['where']['CampaignId']=_0x569589['id'];if(_0x49a4d4['query'][_0x05d7('0x39')]){_0x4360f7[_0x05d7('0x36')]=_['merge'](_0x4360f7['where'],{'$or':_[_0x05d7('0x2a')](_0x4360f7[_0x05d7('0x31')],function(_0x28b70a){var _0x4700d6={};_0x4700d6[_0x28b70a]={'$like':'%'+_0x49a4d4[_0x05d7('0x2f')][_0x05d7('0x39')]+'%'};return _0x4700d6;})});}_0x4360f7=_[_0x05d7('0x3b')]({},_0x4360f7,_0x49a4d4['options']);return db['CmHopper'][_0x05d7('0x1b')]({'where':_0x4360f7[_0x05d7('0x36')]})[_0x05d7('0x21')](function(_0x3366cc){_0x4a56ac['count']=_0x3366cc;if(_0x49a4d4[_0x05d7('0x2f')][_0x05d7('0x3e')]){_0x4360f7[_0x05d7('0x3f')]=[{'all':!![]}];}return db[_0x05d7('0x55')][_0x05d7('0x40')](_0x4360f7);})[_0x05d7('0x21')](function(_0x4d9cc9){_0x4a56ac['rows']=_0x4d9cc9;return _0x4a56ac;});}})[_0x05d7('0x21')](respondWithFilteredResult(_0x54615b,_0x4360f7))['catch'](handleError(_0x54615b,null));};exports[_0x05d7('0x57')]=function(_0x21696f,_0x30a4c5,_0x416797){var _0x59f26f={'raw':!![],'where':{}};var _0x18e81c={};var _0x2c79a6={'count':0x0,'rows':[]};return db[_0x05d7('0x3d')][_0x05d7('0x58')]({'where':{'id':_0x21696f[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x30a4c5,null))[_0x05d7('0x21')](function(_0x388cab){if(_0x388cab){_0x18e81c[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db[_0x05d7('0x59')]['rawAttributes']);_0x18e81c[_0x05d7('0x2f')]=_[_0x05d7('0x30')](_0x21696f[_0x05d7('0x2f')]);_0x18e81c[_0x05d7('0x38')]=_[_0x05d7('0x42')](_0x18e81c[_0x05d7('0x2e')],_0x18e81c[_0x05d7('0x2f')]);_0x59f26f['attributes']=_[_0x05d7('0x42')](_0x18e81c[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0x21696f[_0x05d7('0x2f')][_0x05d7('0x32')]));_0x59f26f[_0x05d7('0x31')]=_0x59f26f[_0x05d7('0x31')][_0x05d7('0x33')]?_0x59f26f[_0x05d7('0x31')]:_0x18e81c['model'];if(!_0x21696f[_0x05d7('0x2f')][_0x05d7('0x5a')](_0x05d7('0x56'))){_0x59f26f['limit']=qs[_0x05d7('0x1a')](_0x21696f['query'][_0x05d7('0x1a')]);_0x59f26f['offset']=qs[_0x05d7('0x18')](_0x21696f['query']['offset']);}_0x59f26f['order']=qs[_0x05d7('0x35')](_0x21696f[_0x05d7('0x2f')]['sort']);_0x59f26f[_0x05d7('0x36')]=qs[_0x05d7('0x38')](_[_0x05d7('0x37')](_0x21696f[_0x05d7('0x2f')],_0x18e81c[_0x05d7('0x38')]));_0x59f26f[_0x05d7('0x36')]['CampaignId']=_0x388cab['id'];if(_0x21696f[_0x05d7('0x2f')]['filter']){_0x59f26f[_0x05d7('0x36')]=_[_0x05d7('0x3b')](_0x59f26f[_0x05d7('0x36')],{'$or':_['map'](_0x59f26f[_0x05d7('0x31')],function(_0xa7e459){var _0xf87dc4={};_0xf87dc4[_0xa7e459]={'$like':'%'+_0x21696f[_0x05d7('0x2f')]['filter']+'%'};return _0xf87dc4;})});}_0x59f26f=_['merge']({},_0x59f26f,_0x21696f[_0x05d7('0x3c')]);return db[_0x05d7('0x59')]['count']({'where':_0x59f26f[_0x05d7('0x36')]})['then'](function(_0xd8b664){_0x2c79a6[_0x05d7('0x1b')]=_0xd8b664;if(_0x21696f[_0x05d7('0x2f')][_0x05d7('0x3e')]){_0x59f26f['include']=[{'all':!![]}];}return db[_0x05d7('0x59')][_0x05d7('0x40')](_0x59f26f);})[_0x05d7('0x21')](function(_0x444af8){_0x2c79a6[_0x05d7('0x41')]=_0x444af8;return _0x2c79a6;});}})[_0x05d7('0x21')](respondWithFilteredResult(_0x30a4c5,_0x59f26f))[_0x05d7('0x44')](handleError(_0x30a4c5,null));};exports[_0x05d7('0x5b')]=function(_0x175c71,_0x59bce2,_0x571bf7){var _0x2366c6={'raw':!![],'where':{}};var _0x563fdf={};var _0x42323e={'count':0x0,'rows':[]};return db['Campaign'][_0x05d7('0x58')]({'where':{'id':_0x175c71[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x59bce2,null))['then'](function(_0x52f5c7){if(_0x52f5c7){_0x563fdf[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db[_0x05d7('0x5c')]['rawAttributes']);_0x563fdf[_0x05d7('0x2f')]=_[_0x05d7('0x30')](_0x175c71[_0x05d7('0x2f')]);_0x563fdf[_0x05d7('0x38')]=_[_0x05d7('0x42')](_0x563fdf[_0x05d7('0x2e')],_0x563fdf[_0x05d7('0x2f')]);_0x2366c6['attributes']=_[_0x05d7('0x42')](_0x563fdf[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0x175c71[_0x05d7('0x2f')][_0x05d7('0x32')]));_0x2366c6[_0x05d7('0x31')]=_0x2366c6[_0x05d7('0x31')][_0x05d7('0x33')]?_0x2366c6['attributes']:_0x563fdf['model'];if(!_0x175c71[_0x05d7('0x2f')]['hasOwnProperty']('nolimit')){_0x2366c6['limit']=qs['limit'](_0x175c71[_0x05d7('0x2f')][_0x05d7('0x1a')]);_0x2366c6[_0x05d7('0x18')]=qs[_0x05d7('0x18')](_0x175c71[_0x05d7('0x2f')][_0x05d7('0x18')]);}_0x2366c6[_0x05d7('0x34')]=qs['sort'](_0x175c71['query'][_0x05d7('0x35')]);_0x2366c6[_0x05d7('0x36')]=qs[_0x05d7('0x38')](_[_0x05d7('0x37')](_0x175c71[_0x05d7('0x2f')],_0x563fdf['filters']));_0x2366c6[_0x05d7('0x36')][_0x05d7('0x5d')]=_0x52f5c7['id'];if(_0x175c71[_0x05d7('0x2f')][_0x05d7('0x39')]){_0x2366c6[_0x05d7('0x36')]=_[_0x05d7('0x3b')](_0x2366c6[_0x05d7('0x36')],{'$or':_[_0x05d7('0x2a')](_0x2366c6[_0x05d7('0x31')],function(_0x201496){var _0xa8c94d={};_0xa8c94d[_0x201496]={'$like':'%'+_0x175c71[_0x05d7('0x2f')][_0x05d7('0x39')]+'%'};return _0xa8c94d;})});}_0x2366c6=_[_0x05d7('0x3b')]({},_0x2366c6,_0x175c71['options']);return db[_0x05d7('0x5c')][_0x05d7('0x1b')]({'where':_0x2366c6[_0x05d7('0x36')]})[_0x05d7('0x21')](function(_0x4056fe){_0x42323e[_0x05d7('0x1b')]=_0x4056fe;if(_0x175c71[_0x05d7('0x2f')]['includeAll']){_0x2366c6['include']=[{'all':!![]}];}return db[_0x05d7('0x5c')][_0x05d7('0x40')](_0x2366c6);})[_0x05d7('0x21')](function(_0x47d8a7){_0x42323e['rows']=_0x47d8a7;return _0x42323e;});}})[_0x05d7('0x21')](respondWithFilteredResult(_0x59bce2,_0x2366c6))['catch'](handleError(_0x59bce2,null));};exports[_0x05d7('0x5e')]=function(_0x31780f,_0x4feffe,_0x41a9b3){var _0x29bd27={'raw':!![],'where':{}};var _0xa1fa6a={};var _0x31834e={'count':0x0,'rows':[]};return db[_0x05d7('0x3d')][_0x05d7('0x58')]({'where':{'id':_0x31780f[_0x05d7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4feffe,null))['then'](function(_0x575e45){if(_0x575e45){_0xa1fa6a[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db[_0x05d7('0x5f')]['rawAttributes']);_0xa1fa6a[_0x05d7('0x2f')]=_[_0x05d7('0x30')](_0x31780f[_0x05d7('0x2f')]);_0xa1fa6a[_0x05d7('0x38')]=_[_0x05d7('0x42')](_0xa1fa6a[_0x05d7('0x2e')],_0xa1fa6a[_0x05d7('0x2f')]);_0x29bd27[_0x05d7('0x31')]=_['intersection'](_0xa1fa6a[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0x31780f[_0x05d7('0x2f')][_0x05d7('0x32')]));_0x29bd27[_0x05d7('0x31')]=_0x29bd27[_0x05d7('0x31')][_0x05d7('0x33')]?_0x29bd27['attributes']:_0xa1fa6a[_0x05d7('0x2e')];if(!_0x31780f[_0x05d7('0x2f')]['hasOwnProperty'](_0x05d7('0x56'))){_0x29bd27[_0x05d7('0x1a')]=qs[_0x05d7('0x1a')](_0x31780f[_0x05d7('0x2f')][_0x05d7('0x1a')]);_0x29bd27[_0x05d7('0x18')]=qs[_0x05d7('0x18')](_0x31780f[_0x05d7('0x2f')]['offset']);}_0x29bd27[_0x05d7('0x34')]=qs[_0x05d7('0x35')](_0x31780f[_0x05d7('0x2f')][_0x05d7('0x35')]);_0x29bd27[_0x05d7('0x36')]=qs['filters'](_[_0x05d7('0x37')](_0x31780f[_0x05d7('0x2f')],_0xa1fa6a[_0x05d7('0x38')]));_0x29bd27[_0x05d7('0x36')][_0x05d7('0x5d')]=_0x575e45['id'];if(_0x31780f[_0x05d7('0x2f')]['filter']){_0x29bd27['where']=_[_0x05d7('0x3b')](_0x29bd27[_0x05d7('0x36')],{'$or':_['map'](_0x29bd27['attributes'],function(_0x438855){var _0x39da99={};_0x39da99[_0x438855]={'$like':'%'+_0x31780f[_0x05d7('0x2f')][_0x05d7('0x39')]+'%'};return _0x39da99;})});}_0x29bd27=_[_0x05d7('0x3b')]({},_0x29bd27,_0x31780f[_0x05d7('0x3c')]);return db[_0x05d7('0x5f')][_0x05d7('0x1b')]({'where':_0x29bd27[_0x05d7('0x36')]})[_0x05d7('0x21')](function(_0x32ebd6){_0x31834e[_0x05d7('0x1b')]=_0x32ebd6;if(_0x31780f[_0x05d7('0x2f')]['includeAll']){_0x29bd27[_0x05d7('0x3f')]=[{'all':!![]}];}return db[_0x05d7('0x5f')][_0x05d7('0x40')](_0x29bd27);})[_0x05d7('0x21')](function(_0x5a47ff){_0x31834e[_0x05d7('0x41')]=_0x5a47ff;return _0x31834e;});}})[_0x05d7('0x21')](respondWithFilteredResult(_0x4feffe,_0x29bd27))[_0x05d7('0x44')](handleError(_0x4feffe,null));};exports[_0x05d7('0x60')]=function(_0xfd804,_0x3a77e5,_0x3ada41){var _0x529449={};var _0x562734={};var _0x84107f;var _0x138c0d;return db[_0x05d7('0x3d')][_0x05d7('0x58')]({'where':{'id':_0xfd804[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x3a77e5,null))[_0x05d7('0x21')](function(_0x5ec1dd){if(_0x5ec1dd){_0x84107f=_0x5ec1dd;_0x562734[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db['CmList'][_0x05d7('0x2b')]);_0x562734[_0x05d7('0x2f')]=_['keys'](_0xfd804['query']);_0x562734[_0x05d7('0x38')]=_['intersection'](_0x562734[_0x05d7('0x2e')],_0x562734[_0x05d7('0x2f')]);_0x529449[_0x05d7('0x31')]=_[_0x05d7('0x42')](_0x562734['model'],qs[_0x05d7('0x32')](_0xfd804[_0x05d7('0x2f')][_0x05d7('0x32')]));_0x529449['attributes']=_0x529449[_0x05d7('0x31')][_0x05d7('0x33')]?_0x529449[_0x05d7('0x31')]:_0x562734['model'];_0x529449[_0x05d7('0x34')]=qs[_0x05d7('0x35')](_0xfd804[_0x05d7('0x2f')]['sort']);_0x529449[_0x05d7('0x36')]=qs['filters'](_['pick'](_0xfd804[_0x05d7('0x2f')],_0x562734[_0x05d7('0x38')]));if(_0xfd804['query'][_0x05d7('0x39')]){_0x529449[_0x05d7('0x36')]=_[_0x05d7('0x3b')](_0x529449[_0x05d7('0x36')],{'$or':_[_0x05d7('0x2a')](_0x529449[_0x05d7('0x31')],function(_0x4efc8d){var _0x3ceb9d={};_0x3ceb9d[_0x4efc8d]={'$like':'%'+_0xfd804[_0x05d7('0x2f')]['filter']+'%'};return _0x3ceb9d;})});}_0x529449=_['merge']({},_0x529449,_0xfd804[_0x05d7('0x3c')]);return _0x84107f['getLists'](_0x529449);}})[_0x05d7('0x21')](function(_0x3270b7){if(_0x3270b7){_0x138c0d=_0x3270b7[_0x05d7('0x33')];if(!_0xfd804[_0x05d7('0x2f')][_0x05d7('0x5a')](_0x05d7('0x56'))){_0x529449[_0x05d7('0x1a')]=qs[_0x05d7('0x1a')](_0xfd804[_0x05d7('0x2f')][_0x05d7('0x1a')]);_0x529449[_0x05d7('0x18')]=qs[_0x05d7('0x18')](_0xfd804[_0x05d7('0x2f')][_0x05d7('0x18')]);}return _0x84107f[_0x05d7('0x60')](_0x529449);}})[_0x05d7('0x21')](function(_0x167c8c){if(_0x167c8c){return _0x167c8c?{'count':_0x138c0d,'rows':_0x167c8c}:null;}})[_0x05d7('0x21')](respondWithResult(_0x3a77e5,null))[_0x05d7('0x44')](handleError(_0x3a77e5,null));};exports[_0x05d7('0x61')]=function(_0x4f118b,_0x543450,_0x45a73d){var _0x4a7172,_0x41ec4a;return db[_0x05d7('0x3d')][_0x05d7('0x43')]({'where':{'id':_0x4f118b[_0x05d7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x543450,null))['then'](function(_0x36a22f){if(_0x36a22f){_0x41ec4a=_0x36a22f;return _0x36a22f[_0x05d7('0x61')](_0x4f118b[_0x05d7('0x46')][_0x05d7('0x62')],_[_0x05d7('0x50')](_0x4f118b[_0x05d7('0x46')],[_0x05d7('0x62'),'id'])||{});}return null;})['spread'](function(_0x1f1ff1){var _0x5f3294;_0x4a7172=_0x1f1ff1||[];var _0x136fbc=[];if(_0x1f1ff1){for(var _0x1c3037=0x0;_0x1c3037<_0x1f1ff1[_0x05d7('0x33')];_0x1c3037+=0x1){var _0x3fe246=_0x1f1ff1[_0x1c3037]['get']({'plain':!![]});_0x41ec4a[_0x05d7('0x63')]=_0x4f118b[_0x05d7('0x46')][_0x05d7('0x63')]?_0x4f118b[_0x05d7('0x46')]['dialCheckDuplicateType']:_0x41ec4a[_0x05d7('0x63')];switch(_0x41ec4a[_0x05d7('0x63')]){case _0x05d7('0x64'):_0x5f3294=squel['insert']()[_0x05d7('0x65')](_0x05d7('0x66'))[_0x05d7('0x67')]([_0x05d7('0x68'),_0x05d7('0x69'),'ContactId','ListId',_0x05d7('0x5d'),_0x05d7('0x51'),'updatedAt'],squel[_0x05d7('0x6a')]()[_0x05d7('0x6b')]('phone',_0x05d7('0x68'))[_0x05d7('0x6b')]('NOW()',_0x05d7('0x69'))[_0x05d7('0x6b')]('id','ContactId')[_0x05d7('0x6b')](_0x3fe246[_0x05d7('0x6c')][_0x05d7('0x6d')](),_0x05d7('0x6e'))['field'](_0x4f118b['params']['id'][_0x05d7('0x6d')](),_0x05d7('0x5d'))[_0x05d7('0x6b')]('NOW()',_0x05d7('0x51'))[_0x05d7('0x6b')](_0x05d7('0x6f'),_0x05d7('0x52'))[_0x05d7('0x70')](_0x05d7('0x71'))['where'](_0x05d7('0x72'))[_0x05d7('0x36')]('ListId\x20=\x20?',_0x3fe246[_0x05d7('0x6c')]['toString']())[_0x05d7('0x36')](_0x05d7('0x73'))[_0x05d7('0x36')](_0x05d7('0x74'),squel[_0x05d7('0x6a')]()[_0x05d7('0x6b')](_0x05d7('0x75'))[_0x05d7('0x70')]('cm_hopper_final')[_0x05d7('0x36')](_0x05d7('0x76'),_0x4f118b['params']['id'][_0x05d7('0x6d')]()))['where'](_0x05d7('0x74'),squel[_0x05d7('0x6a')]()[_0x05d7('0x6b')](_0x05d7('0x77'))['from'](_0x05d7('0x66'))['where']('CampaignId\x20=\x20?',_0x4f118b[_0x05d7('0x4f')]['id'][_0x05d7('0x6d')]())))[_0x05d7('0x6d')]();break;case'onlyIfOpen':_0x5f3294=squel['insert']()[_0x05d7('0x65')]('cm_hopper')[_0x05d7('0x67')]([_0x05d7('0x68'),_0x05d7('0x69'),'ContactId',_0x05d7('0x6e'),_0x05d7('0x5d'),_0x05d7('0x51'),_0x05d7('0x52')],squel[_0x05d7('0x6a')]()[_0x05d7('0x6b')](_0x05d7('0x68'),_0x05d7('0x68'))['field'](_0x05d7('0x6f'),'scheduledAt')[_0x05d7('0x6b')]('id',_0x05d7('0x78'))['field'](_0x3fe246[_0x05d7('0x6c')]['toString'](),_0x05d7('0x6e'))[_0x05d7('0x6b')](_0x4f118b['params']['id']['toString'](),_0x05d7('0x5d'))[_0x05d7('0x6b')](_0x05d7('0x6f'),'createdAt')[_0x05d7('0x6b')](_0x05d7('0x6f'),_0x05d7('0x52'))[_0x05d7('0x70')](_0x05d7('0x71'))[_0x05d7('0x36')](_0x05d7('0x72'))[_0x05d7('0x36')](_0x05d7('0x79'),_0x3fe246[_0x05d7('0x6c')][_0x05d7('0x6d')]())['where'](_0x05d7('0x73'))[_0x05d7('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x05d7('0x6a')]()[_0x05d7('0x6b')](_0x05d7('0x77'))[_0x05d7('0x70')](_0x05d7('0x66'))['where'](_0x05d7('0x76'),_0x4f118b['params']['id'][_0x05d7('0x6d')]())))[_0x05d7('0x6d')]();break;default:_0x5f3294=squel[_0x05d7('0x7a')]()['into']('cm_hopper')[_0x05d7('0x67')]([_0x05d7('0x68'),_0x05d7('0x69'),_0x05d7('0x78'),_0x05d7('0x6e'),'CampaignId',_0x05d7('0x51'),_0x05d7('0x52')],squel[_0x05d7('0x6a')]()[_0x05d7('0x6b')]('phone',_0x05d7('0x68'))[_0x05d7('0x6b')](_0x05d7('0x6f'),'scheduledAt')[_0x05d7('0x6b')]('id',_0x05d7('0x78'))[_0x05d7('0x6b')](_0x3fe246['CmListId']['toString'](),_0x05d7('0x6e'))[_0x05d7('0x6b')](_0x4f118b[_0x05d7('0x4f')]['id']['toString'](),_0x05d7('0x5d'))[_0x05d7('0x6b')](_0x05d7('0x6f'),_0x05d7('0x51'))[_0x05d7('0x6b')]('NOW()','updatedAt')[_0x05d7('0x70')]('cm_contacts')[_0x05d7('0x36')](_0x05d7('0x72'))[_0x05d7('0x36')](_0x05d7('0x79'),_0x3fe246['CmListId'][_0x05d7('0x6d')]())[_0x05d7('0x36')](_0x05d7('0x73')))['toString']();}_0x136fbc[_0x05d7('0x7b')](db[_0x05d7('0x7c')][_0x05d7('0x2f')](_0x5f3294));}return BPromise[_0x05d7('0x7d')](_0x136fbc);}})[_0x05d7('0x21')](function(){return _0x4a7172;})['then'](respondWithResult(_0x543450,null))[_0x05d7('0x44')](handleError(_0x543450,null));};exports[_0x05d7('0x7e')]=function(_0x34ffc4,_0xea9a7f,_0x3d1c1b){return db[_0x05d7('0x3d')][_0x05d7('0x43')]({'where':{'id':_0x34ffc4[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0xea9a7f,null))[_0x05d7('0x21')](function(_0x2ee4b4){if(_0x2ee4b4){return _0x2ee4b4['removeLists'](_0x34ffc4[_0x05d7('0x2f')][_0x05d7('0x62')]);}})[_0x05d7('0x21')](function(_0x1bb45e){if(_0x1bb45e){return db[_0x05d7('0x55')]['destroy']({'where':{'ListId':_0x34ffc4[_0x05d7('0x2f')]['ids'],'CampaignId':_0x34ffc4[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](function(){return _0x1bb45e;});}})[_0x05d7('0x21')](respondWithStatusCode(_0xea9a7f,null))['catch'](handleError(_0xea9a7f,null));};exports[_0x05d7('0x7f')]=function(_0x491e59,_0x91d627,_0x2c660f){var _0x171c45={};var _0x518079={};var _0x479285;var _0x4a8a04;return db[_0x05d7('0x3d')][_0x05d7('0x58')]({'where':{'id':_0x491e59['params']['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x91d627,null))['then'](function(_0x4cb044){if(_0x4cb044){_0x479285=_0x4cb044;_0x518079[_0x05d7('0x2e')]=_[_0x05d7('0x30')](db[_0x05d7('0x80')]['rawAttributes']);_0x518079[_0x05d7('0x2f')]=_[_0x05d7('0x30')](_0x491e59['query']);_0x518079[_0x05d7('0x38')]=_[_0x05d7('0x42')](_0x518079[_0x05d7('0x2e')],_0x518079[_0x05d7('0x2f')]);_0x171c45[_0x05d7('0x31')]=_[_0x05d7('0x42')](_0x518079[_0x05d7('0x2e')],qs[_0x05d7('0x32')](_0x491e59[_0x05d7('0x2f')][_0x05d7('0x32')]));_0x171c45['attributes']=_0x171c45['attributes']['length']?_0x171c45[_0x05d7('0x31')]:_0x518079[_0x05d7('0x2e')];_0x171c45[_0x05d7('0x34')]=qs[_0x05d7('0x35')](_0x491e59['query'][_0x05d7('0x35')]);_0x171c45[_0x05d7('0x36')]=qs[_0x05d7('0x38')](_['pick'](_0x491e59[_0x05d7('0x2f')],_0x518079[_0x05d7('0x38')]));if(_0x491e59['query']['filter']){_0x171c45[_0x05d7('0x36')]=_[_0x05d7('0x3b')](_0x171c45[_0x05d7('0x36')],{'$or':_['map'](_0x171c45[_0x05d7('0x31')],function(_0x43c761){var _0x3b9703={};_0x3b9703[_0x43c761]={'$like':'%'+_0x491e59['query'][_0x05d7('0x39')]+'%'};return _0x3b9703;})});}_0x171c45=_[_0x05d7('0x3b')]({},_0x171c45,_0x491e59['options']);return _0x479285[_0x05d7('0x7f')](_0x171c45);}})['then'](function(_0x3ee489){if(_0x3ee489){_0x4a8a04=_0x3ee489['length'];if(!_0x491e59[_0x05d7('0x2f')][_0x05d7('0x5a')]('nolimit')){_0x171c45['limit']=qs['limit'](_0x491e59[_0x05d7('0x2f')][_0x05d7('0x1a')]);_0x171c45[_0x05d7('0x18')]=qs[_0x05d7('0x18')](_0x491e59[_0x05d7('0x2f')][_0x05d7('0x18')]);}return _0x479285['getBlackLists'](_0x171c45);}})[_0x05d7('0x21')](function(_0x234353){if(_0x234353){return _0x234353?{'count':_0x4a8a04,'rows':_0x234353}:null;}})[_0x05d7('0x21')](respondWithResult(_0x91d627,null))[_0x05d7('0x44')](handleError(_0x91d627,null));};exports['addBlackLists']=function(_0x33b6d5,_0x2ebe8,_0x42f63c){var _0x2b62d2,_0x4c2d69;return db[_0x05d7('0x3d')][_0x05d7('0x43')]({'where':{'id':_0x33b6d5[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x2ebe8,null))['then'](function(_0x4e91c8){if(_0x4e91c8){_0x4c2d69=_0x4e91c8;return _0x4e91c8['addBlackLists'](_0x33b6d5[_0x05d7('0x46')][_0x05d7('0x62')],_[_0x05d7('0x50')](_0x33b6d5[_0x05d7('0x46')],[_0x05d7('0x62'),'id'])||{});}return null;})['spread'](function(_0x10b861){var _0x47ee51;_0x2b62d2=_0x10b861||[];var _0x181a5c=[];if(_0x10b861){for(var _0x9e6507=0x0;_0x9e6507<_0x10b861[_0x05d7('0x33')];_0x9e6507+=0x1){var _0x54a1b2=_0x10b861[_0x9e6507][_0x05d7('0x48')]({'plain':!![]});_0x47ee51=squel[_0x05d7('0x7a')]()['into'](_0x05d7('0x81'))[_0x05d7('0x67')](['phone','ContactId',_0x05d7('0x6e'),_0x05d7('0x5d'),_0x05d7('0x51'),_0x05d7('0x52')],squel[_0x05d7('0x6a')]()[_0x05d7('0x6b')]('phone','phone')[_0x05d7('0x6b')]('id','ContactId')[_0x05d7('0x6b')](_0x54a1b2[_0x05d7('0x6c')][_0x05d7('0x6d')](),_0x05d7('0x6e'))[_0x05d7('0x6b')](_0x33b6d5['params']['id'][_0x05d7('0x6d')](),_0x05d7('0x5d'))[_0x05d7('0x6b')]('NOW()',_0x05d7('0x51'))[_0x05d7('0x6b')]('NOW()',_0x05d7('0x52'))[_0x05d7('0x70')]('cm_contacts')[_0x05d7('0x36')]('deletedAt\x20IS\x20NULL')[_0x05d7('0x36')](_0x05d7('0x79'),_0x54a1b2[_0x05d7('0x6c')][_0x05d7('0x6d')]())[_0x05d7('0x36')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x181a5c[_0x05d7('0x7b')](db[_0x05d7('0x7c')]['query'](_0x47ee51));}return BPromise[_0x05d7('0x7d')](_0x181a5c);}})['then'](function(){return _0x2b62d2;})['then'](respondWithResult(_0x2ebe8,null))[_0x05d7('0x44')](handleError(_0x2ebe8,null));};exports[_0x05d7('0x82')]=function(_0x45efaf,_0x11fb8b,_0x1bb179){return db[_0x05d7('0x3d')][_0x05d7('0x43')]({'where':{'id':_0x45efaf[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](handleEntityNotFound(_0x11fb8b,null))[_0x05d7('0x21')](function(_0x1fb0dc){if(_0x1fb0dc){return _0x1fb0dc[_0x05d7('0x82')](_0x45efaf[_0x05d7('0x2f')][_0x05d7('0x62')]);}})[_0x05d7('0x21')](function(_0x4c064b){if(_0x4c064b){return db['CmHopperBlack'][_0x05d7('0x22')]({'where':{'ListId':_0x45efaf[_0x05d7('0x2f')]['ids'],'CampaignId':_0x45efaf[_0x05d7('0x4f')]['id']}})[_0x05d7('0x21')](function(){return _0x4c064b;});}})[_0x05d7('0x21')](respondWithStatusCode(_0x11fb8b,null))[_0x05d7('0x44')](handleError(_0x11fb8b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a413786..c0acf7b 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(_0x188998,_0x2a082e){var _0x17801b=function(_0x394c9d){while(--_0x394c9d){_0x188998['push'](_0x188998['shift']());}};_0x17801b(++_0x2a082e);}(_0x7a54,0x106));var _0x47a5=function(_0x4070e3,_0xfe9c25){_0x4070e3=_0x4070e3-0x0;var _0x5cb6fe=_0x7a54[_0x4070e3];return _0x5cb6fe;};'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(_0xe94632,_0x27964f){var _0x380b09=function(_0x3ffa4b){while(--_0x3ffa4b){_0xe94632['push'](_0xe94632['shift']());}};_0x380b09(++_0x27964f);}(_0x7a54,0x106));var _0x47a5=function(_0x42cf3e,_0x53495e){_0x42cf3e=_0x42cf3e-0x0;var _0x259485=_0x7a54[_0x42cf3e];return _0x259485;};'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 fbf33db..0ef92f0 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 _0x6c63=['include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6c63,0x1ee));var _0x36c6=function(_0x1c3c40,_0x1d0dbb){_0x1c3c40=_0x1c3c40-0x0;var _0xee295b=_0x6c63[_0x1c3c40];return _0xee295b;};'use strict';var _=require(_0x36c6('0x0'));var util=require(_0x36c6('0x1'));var moment=require(_0x36c6('0x2'));var BPromise=require(_0x36c6('0x3'));var rs=require(_0x36c6('0x4'));var fs=require('fs');var Redis=require(_0x36c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x36c6('0x6'));var logger=require(_0x36c6('0x7'))(_0x36c6('0x8'));var config=require(_0x36c6('0x9'));var jayson=require(_0x36c6('0xa'));var client=jayson['client'][_0x36c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16f996,_0x24268d,_0x1c3752){return new BPromise(function(_0x19b670,_0x5bacef){return client[_0x36c6('0xc')](_0x16f996,_0x1c3752)['then'](function(_0x21444c){logger['info'](_0x36c6('0xd'),_0x24268d,_0x36c6('0xe'));logger[_0x36c6('0xf')](_0x36c6('0x10'),_0x24268d,_0x36c6('0xe'),JSON[_0x36c6('0x11')](_0x21444c));if(_0x21444c[_0x36c6('0x12')]){if(_0x21444c[_0x36c6('0x12')][_0x36c6('0x13')]===0x1f4){logger[_0x36c6('0x12')](_0x36c6('0xd'),_0x24268d,_0x21444c[_0x36c6('0x12')][_0x36c6('0x14')]);return _0x5bacef(_0x21444c[_0x36c6('0x12')]['message']);}logger[_0x36c6('0x12')](_0x36c6('0xd'),_0x24268d,_0x21444c[_0x36c6('0x12')]['message']);return _0x19b670(_0x21444c[_0x36c6('0x12')][_0x36c6('0x14')]);}else{logger[_0x36c6('0x15')](_0x36c6('0xd'),_0x24268d,_0x36c6('0xe'));_0x19b670(_0x21444c[_0x36c6('0x16')][_0x36c6('0x14')]);}})[_0x36c6('0x17')](function(_0x3871bc){logger[_0x36c6('0x12')]('Campaign,\x20%s,\x20%s',_0x24268d,_0x3871bc);_0x5bacef(_0x3871bc);});});}exports[_0x36c6('0x18')]=function(_0x499c50){var _0x133d09=this;return new Promise(function(_0x59ab0c,_0x33d89c){return db[_0x36c6('0x19')][_0x36c6('0x1a')]({'raw':_0x499c50['options']?_0x499c50[_0x36c6('0x1b')][_0x36c6('0x1c')]===undefined?!![]:![]:!![],'where':_0x499c50[_0x36c6('0x1b')]?_0x499c50[_0x36c6('0x1b')][_0x36c6('0x1d')]||null:null,'attributes':_0x499c50[_0x36c6('0x1b')]?_0x499c50[_0x36c6('0x1b')]['attributes']||null:null,'limit':_0x499c50['options']?_0x499c50[_0x36c6('0x1b')][_0x36c6('0x1e')]||null:null,'include':_0x499c50['options']?_0x499c50['options'][_0x36c6('0x1f')]?_[_0x36c6('0x20')](_0x499c50[_0x36c6('0x1b')][_0x36c6('0x1f')],function(_0x2e12f7){return{'model':db[_0x2e12f7[_0x36c6('0x21')]],'as':_0x2e12f7['as'],'attributes':_0x2e12f7[_0x36c6('0x22')],'include':_0x2e12f7[_0x36c6('0x1f')]?_['map'](_0x2e12f7[_0x36c6('0x1f')],function(_0x3c5195){return{'model':db[_0x3c5195[_0x36c6('0x21')]],'as':_0x3c5195['as'],'attributes':_0x3c5195['attributes'],'include':_0x3c5195[_0x36c6('0x1f')]?_[_0x36c6('0x20')](_0x3c5195[_0x36c6('0x1f')],function(_0x83612d){return{'model':db[_0x83612d['model']],'as':_0x83612d['as'],'attributes':_0x83612d[_0x36c6('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x473aa2){logger[_0x36c6('0x15')]('GetCampaign',_0x499c50);logger['debug'](_0x36c6('0x18'),_0x499c50,JSON[_0x36c6('0x11')](_0x473aa2));_0x59ab0c(_0x473aa2);})[_0x36c6('0x17')](function(_0x4eae9a){logger['error'](_0x36c6('0x18'),_0x4eae9a[_0x36c6('0x14')],_0x499c50);_0x33d89c(_0x133d09[_0x36c6('0x12')](0x1f4,_0x4eae9a[_0x36c6('0x14')]));});});}; \ No newline at end of file +var _0x8664=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','options','raw','attributes','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5431a1,_0x502ef4){var _0x1a866a=function(_0x44ab62){while(--_0x44ab62){_0x5431a1['push'](_0x5431a1['shift']());}};_0x1a866a(++_0x502ef4);}(_0x8664,0x11a));var _0x4866=function(_0x54d624,_0x481973){_0x54d624=_0x54d624-0x0;var _0x2de0dc=_0x8664[_0x54d624];return _0x2de0dc;};'use strict';var _=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var moment=require(_0x4866('0x2'));var BPromise=require(_0x4866('0x3'));var rs=require(_0x4866('0x4'));var fs=require('fs');var Redis=require(_0x4866('0x5'));var db=require(_0x4866('0x6'))['db'];var utils=require(_0x4866('0x7'));var logger=require(_0x4866('0x8'))('rpc');var config=require(_0x4866('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4866('0xa')][_0x4866('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x439f55,_0x10f7c1,_0x2b4bb0){return new BPromise(function(_0x142f18,_0x4e07e3){return client[_0x4866('0xc')](_0x439f55,_0x2b4bb0)[_0x4866('0xd')](function(_0x10a369){logger[_0x4866('0xe')](_0x4866('0xf'),_0x10f7c1,'request\x20sent');logger[_0x4866('0x10')](_0x4866('0x11'),_0x10f7c1,'request\x20sent',JSON[_0x4866('0x12')](_0x10a369));if(_0x10a369[_0x4866('0x13')]){if(_0x10a369['error']['code']===0x1f4){logger['error'](_0x4866('0xf'),_0x10f7c1,_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);return _0x4e07e3(_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);}logger[_0x4866('0x13')]('Campaign,\x20%s,\x20%s',_0x10f7c1,_0x10a369[_0x4866('0x13')][_0x4866('0x14')]);return _0x142f18(_0x10a369['error'][_0x4866('0x14')]);}else{logger[_0x4866('0xe')](_0x4866('0xf'),_0x10f7c1,_0x4866('0x15'));_0x142f18(_0x10a369[_0x4866('0x16')][_0x4866('0x14')]);}})[_0x4866('0x17')](function(_0x653916){logger[_0x4866('0x13')]('Campaign,\x20%s,\x20%s',_0x10f7c1,_0x653916);_0x4e07e3(_0x653916);});});}exports['GetCampaign']=function(_0x423490){var _0x137ddf=this;return new Promise(function(_0x176c99,_0x51038a){return db['Campaign'][_0x4866('0x18')]({'raw':_0x423490[_0x4866('0x19')]?_0x423490['options'][_0x4866('0x1a')]===undefined?!![]:![]:!![],'where':_0x423490['options']?_0x423490[_0x4866('0x19')]['where']||null:null,'attributes':_0x423490[_0x4866('0x19')]?_0x423490[_0x4866('0x19')][_0x4866('0x1b')]||null:null,'limit':_0x423490[_0x4866('0x19')]?_0x423490[_0x4866('0x19')]['limit']||null:null,'include':_0x423490['options']?_0x423490[_0x4866('0x19')][_0x4866('0x1c')]?_[_0x4866('0x1d')](_0x423490['options'][_0x4866('0x1c')],function(_0x4d3da4){return{'model':db[_0x4d3da4['model']],'as':_0x4d3da4['as'],'attributes':_0x4d3da4[_0x4866('0x1b')],'include':_0x4d3da4[_0x4866('0x1c')]?_['map'](_0x4d3da4[_0x4866('0x1c')],function(_0x3aa7ad){return{'model':db[_0x3aa7ad[_0x4866('0x1e')]],'as':_0x3aa7ad['as'],'attributes':_0x3aa7ad[_0x4866('0x1b')],'include':_0x3aa7ad[_0x4866('0x1c')]?_[_0x4866('0x1d')](_0x3aa7ad[_0x4866('0x1c')],function(_0x136b1f){return{'model':db[_0x136b1f[_0x4866('0x1e')]],'as':_0x136b1f['as'],'attributes':_0x136b1f[_0x4866('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4866('0xd')](function(_0x58f5f4){logger[_0x4866('0xe')](_0x4866('0x1f'),_0x423490);logger[_0x4866('0x10')](_0x4866('0x1f'),_0x423490,JSON[_0x4866('0x12')](_0x58f5f4));_0x176c99(_0x58f5f4);})[_0x4866('0x17')](function(_0x2e9b65){logger[_0x4866('0x13')](_0x4866('0x1f'),_0x2e9b65[_0x4866('0x14')],_0x423490);_0x51038a(_0x137ddf[_0x4866('0x13')](0x1f4,_0x2e9b65[_0x4866('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 96ba015..d25260d 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 _0xfb6c=['../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','put','delete','destroy','/:id/lists','removeBlackLists','exports','util','../../components/interaction/service'];(function(_0x4ec216,_0xa8ac4d){var _0x24d4d5=function(_0x166eb7){while(--_0x166eb7){_0x4ec216['push'](_0x4ec216['shift']());}};_0x24d4d5(++_0xa8ac4d);}(_0xfb6c,0x1a2));var _0xcfb6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb6c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xcfb6('0x0'));var path=require('path');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(_0xcfb6('0x1'));var config=require(_0xcfb6('0x2'));var controller=require(_0xcfb6('0x3'));router[_0xcfb6('0x4')]('/',auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x6')]);router['get'](_0xcfb6('0x7'),auth['isAuthenticated'](),controller[_0xcfb6('0x8')]);router[_0xcfb6('0x4')](_0xcfb6('0x9'),auth['isAuthenticated'](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xcfb6('0x4')](_0xcfb6('0xa'),auth[_0xcfb6('0x5')](),controller[_0xcfb6('0xb')]);router[_0xcfb6('0x4')](_0xcfb6('0xc'),auth[_0xcfb6('0x5')](),controller[_0xcfb6('0xd')]);router[_0xcfb6('0x4')]('/:id/lists',auth[_0xcfb6('0x5')](),controller[_0xcfb6('0xe')]);router[_0xcfb6('0x4')](_0xcfb6('0xf'),auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x10')]);router[_0xcfb6('0x11')]('/',auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x12')]);router[_0xcfb6('0x11')]('/:id/clone',auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x13')]);router[_0xcfb6('0x11')]('/:id/lists',auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x14')]);router[_0xcfb6('0x11')](_0xcfb6('0xf'),auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x15')]);router[_0xcfb6('0x16')](_0xcfb6('0x7'),auth[_0xcfb6('0x5')](),controller['update']);router[_0xcfb6('0x17')]('/:id',auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x18')]);router['delete'](_0xcfb6('0x19'),auth[_0xcfb6('0x5')](),controller['removeLists']);router[_0xcfb6('0x17')]('/:id/blacklists',auth[_0xcfb6('0x5')](),controller[_0xcfb6('0x1a')]);module[_0xcfb6('0x1b')]=router; \ No newline at end of file +var _0x6b98=['removeLists','/:id/blacklists','removeBlackLists','exports','path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6b98,0x13a));var _0x86b9=function(_0x35a6f8,_0x2a19d0){_0x35a6f8=_0x35a6f8-0x0;var _0x11d2da=_0x6b98[_0x35a6f8];return _0x11d2da;};'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('./campaign.controller');router['get']('/',auth[_0x86b9('0x5')](),controller[_0x86b9('0x6')]);router[_0x86b9('0x7')](_0x86b9('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x86b9('0x7')](_0x86b9('0x9'),auth[_0x86b9('0x5')](),controller[_0x86b9('0xa')]);router[_0x86b9('0x7')]('/:id/hopper_histories',auth[_0x86b9('0x5')](),controller[_0x86b9('0xb')]);router[_0x86b9('0x7')](_0x86b9('0xc'),auth[_0x86b9('0x5')](),controller[_0x86b9('0xd')]);router[_0x86b9('0x7')](_0x86b9('0xe'),auth[_0x86b9('0x5')](),controller[_0x86b9('0xf')]);router[_0x86b9('0x7')](_0x86b9('0x10'),auth[_0x86b9('0x5')](),controller[_0x86b9('0x11')]);router[_0x86b9('0x7')]('/:id/blacklists',auth[_0x86b9('0x5')](),controller[_0x86b9('0x12')]);router[_0x86b9('0x13')]('/',auth[_0x86b9('0x5')](),controller['create']);router[_0x86b9('0x13')](_0x86b9('0x14'),auth[_0x86b9('0x5')](),controller[_0x86b9('0x15')]);router[_0x86b9('0x13')](_0x86b9('0x10'),auth[_0x86b9('0x5')](),controller[_0x86b9('0x16')]);router[_0x86b9('0x13')]('/:id/blacklists',auth[_0x86b9('0x5')](),controller[_0x86b9('0x17')]);router[_0x86b9('0x18')](_0x86b9('0x8'),auth[_0x86b9('0x5')](),controller[_0x86b9('0x19')]);router[_0x86b9('0x1a')]('/:id',auth[_0x86b9('0x5')](),controller['destroy']);router[_0x86b9('0x1a')](_0x86b9('0x10'),auth[_0x86b9('0x5')](),controller[_0x86b9('0x1b')]);router[_0x86b9('0x1a')](_0x86b9('0x1c'),auth['isAuthenticated'](),controller[_0x86b9('0x1d')]);module[_0x86b9('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index cf694c9..f7948af 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 _0xdcbb=['getDataValue','key','sequelize','STRING','TEXT','VIRTUAL'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xdcbb,0x116));var _0xbdcb=function(_0x2fccb0,_0x4a5216){_0x2fccb0=_0x2fccb0-0x0;var _0x364771=_0xdcbb[_0x2fccb0];return _0x364771;};'use strict';var Sequelize=require(_0xbdcb('0x0'));module['exports']={'key':{'type':Sequelize[_0xbdcb('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xbdcb('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xbdcb('0x3')],'get':function(){return this[_0xbdcb('0x4')](_0xbdcb('0x5'));}}}; \ No newline at end of file +var _0x2e20=['exports','STRING','VIRTUAL','getDataValue','key'];(function(_0x3e4eb5,_0x44efa7){var _0xc5cd7d=function(_0x348063){while(--_0x348063){_0x3e4eb5['push'](_0x3e4eb5['shift']());}};_0xc5cd7d(++_0x44efa7);}(_0x2e20,0x7d));var _0x02e2=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x2e20[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require('sequelize');module[_0x02e2('0x0')]={'key':{'type':Sequelize[_0x02e2('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x02e2('0x1')]},'name':{'type':Sequelize[_0x02e2('0x2')],'get':function(){return this[_0x02e2('0x3')](_0x02e2('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 27bfff9..8d32fda 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 _0xb01f=['SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','create','eml-format','rimraf','zip-dir','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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','find','body','MailAccountId'];(function(_0xaa9ced,_0x2df546){var _0xab73f0=function(_0x526602){while(--_0x526602){_0xaa9ced['push'](_0xaa9ced['shift']());}};_0xab73f0(++_0x2df546);}(_0xb01f,0x65));var _0xfb01=function(_0x31fbf8,_0x8dc165){_0x31fbf8=_0x31fbf8-0x0;var _0x28c4f4=_0xb01f[_0x31fbf8];return _0x28c4f4;};'use strict';var emlformat=require(_0xfb01('0x0'));var rimraf=require(_0xfb01('0x1'));var zipdir=require(_0xfb01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb01('0x3'));var moment=require(_0xfb01('0x4'));var BPromise=require(_0xfb01('0x5'));var Mustache=require(_0xfb01('0x6'));var util=require('util');var path=require(_0xfb01('0x7'));var sox=require(_0xfb01('0x8'));var csv=require(_0xfb01('0x9'));var ejs=require(_0xfb01('0xa'));var fs=require('fs');var fs_extra=require(_0xfb01('0xb'));var _=require(_0xfb01('0xc'));var squel=require(_0xfb01('0xd'));var crypto=require(_0xfb01('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfb01('0xf'));var toCsv=require(_0xfb01('0x9'));var querystring=require(_0xfb01('0x10'));var Papa=require(_0xfb01('0x11'));var Redis=require(_0xfb01('0x12'));var authService=require(_0xfb01('0x13'));var qs=require(_0xfb01('0x14'));var as=require(_0xfb01('0x15'));var hardwareService=require(_0xfb01('0x16'));var logger=require(_0xfb01('0x17'))(_0xfb01('0x18'));var utils=require(_0xfb01('0x19'));var config=require(_0xfb01('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20e5f1,_0xf73157){_0xf73157=_0xf73157||0xcc;return function(_0x347693){if(_0x347693){return _0x20e5f1[_0xfb01('0x1b')](_0xf73157);}return _0x20e5f1[_0xfb01('0x1c')](_0xf73157)[_0xfb01('0x1d')]();};}function respondWithResult(_0x3a4847,_0x23369f){_0x23369f=_0x23369f||0xc8;return function(_0x34bea8){if(_0x34bea8){return _0x3a4847[_0xfb01('0x1c')](_0x23369f)[_0xfb01('0x1e')](_0x34bea8);}};}function respondWithFilteredResult(_0x21ae5a,_0x4971b7){return function(_0x23daa8){if(_0x23daa8){var _0x35dfde=typeof _0x4971b7['offset']===_0xfb01('0x1f')&&typeof _0x4971b7[_0xfb01('0x20')]===_0xfb01('0x1f');var _0x1eb947=_0x23daa8[_0xfb01('0x21')];var _0x156c5c=_0x35dfde?0x0:_0x4971b7[_0xfb01('0x22')];var _0x2c1937=_0x35dfde?_0x23daa8[_0xfb01('0x21')]:_0x4971b7[_0xfb01('0x22')]+_0x4971b7['limit'];var _0x159312;if(_0x2c1937>=_0x1eb947){_0x2c1937=_0x1eb947;_0x159312=0xc8;}else{_0x159312=0xce;}_0x21ae5a[_0xfb01('0x1c')](_0x159312);return _0x21ae5a[_0xfb01('0x23')](_0xfb01('0x24'),_0x156c5c+'-'+_0x2c1937+'/'+_0x1eb947)['json'](_0x23daa8);}return null;};}function patchUpdates(_0x2d419e){return function(_0x31425c){try{jsonpatch[_0xfb01('0x25')](_0x31425c,_0x2d419e,!![]);}catch(_0x792c67){return BPromise[_0xfb01('0x26')](_0x792c67);}return _0x31425c[_0xfb01('0x27')]();};}function saveUpdates(_0x5a4808,_0x20874b){return function(_0x23535e){if(_0x23535e){return _0x23535e[_0xfb01('0x28')](_0x5a4808)[_0xfb01('0x29')](function(_0xacab6){return _0xacab6;});}return null;};}function removeEntity(_0x1f267b,_0x2bbb25){return function(_0x180871){if(_0x180871){return _0x180871['destroy']()[_0xfb01('0x29')](function(){var _0xcf6fc0=_0x180871[_0xfb01('0x2a')]({'plain':!![]});var _0x32b0e2=_0xfb01('0x2b');return db[_0xfb01('0x2c')][_0xfb01('0x2d')]({'where':{'type':_0x32b0e2,'resourceId':_0xcf6fc0['id']}})[_0xfb01('0x29')](function(){return _0x180871;});})[_0xfb01('0x29')](function(){_0x1f267b['status'](0xcc)[_0xfb01('0x1d')]();});}};}function handleEntityNotFound(_0x1a04b4,_0x3515c1){return function(_0x421ec9){if(!_0x421ec9){_0x1a04b4[_0xfb01('0x1b')](0x194);}return _0x421ec9;};}function handleError(_0x4bf9f5,_0x3eba88){_0x3eba88=_0x3eba88||0x1f4;return function(_0x25f218){logger[_0xfb01('0x2e')](_0x25f218[_0xfb01('0x2f')]);if(_0x25f218[_0xfb01('0x30')]){delete _0x25f218['name'];}_0x4bf9f5[_0xfb01('0x1c')](_0x3eba88)[_0xfb01('0x31')](_0x25f218);};}exports[_0xfb01('0x32')]=function(_0x171017,_0x1a3423){var _0x505802={},_0x1b61e8={},_0x596b67={'count':0x0,'rows':[]};var _0x443a3b=_[_0xfb01('0x33')](db[_0xfb01('0x34')][_0xfb01('0x35')],function(_0x42923b){return{'name':_0x42923b[_0xfb01('0x36')],'type':_0x42923b[_0xfb01('0x37')][_0xfb01('0x38')]};});_0x1b61e8[_0xfb01('0x39')]=_[_0xfb01('0x33')](_0x443a3b,_0xfb01('0x30'));_0x1b61e8[_0xfb01('0x3a')]=_['keys'](_0x171017['query']);_0x1b61e8[_0xfb01('0x3b')]=_[_0xfb01('0x3c')](_0x1b61e8[_0xfb01('0x39')],_0x1b61e8[_0xfb01('0x3a')]);_0x505802[_0xfb01('0x3d')]=_[_0xfb01('0x3c')](_0x1b61e8[_0xfb01('0x39')],qs[_0xfb01('0x3e')](_0x171017[_0xfb01('0x3a')][_0xfb01('0x3e')]));_0x505802['attributes']=_0x505802['attributes'][_0xfb01('0x3f')]?_0x505802[_0xfb01('0x3d')]:_0x1b61e8[_0xfb01('0x39')];if(!_0x171017[_0xfb01('0x3a')]['hasOwnProperty']('nolimit')){_0x505802[_0xfb01('0x20')]=qs['limit'](_0x171017[_0xfb01('0x3a')][_0xfb01('0x20')]);_0x505802[_0xfb01('0x22')]=qs['offset'](_0x171017[_0xfb01('0x3a')][_0xfb01('0x22')]);}_0x505802[_0xfb01('0x40')]=qs['sort'](_0x171017['query'][_0xfb01('0x41')]);_0x505802[_0xfb01('0x42')]=qs['filters'](_[_0xfb01('0x43')](_0x171017[_0xfb01('0x3a')],_0x1b61e8[_0xfb01('0x3b')]),_0x443a3b);if(_0x171017['query'][_0xfb01('0x44')]){_0x505802[_0xfb01('0x42')]=_[_0xfb01('0x45')](_0x505802[_0xfb01('0x42')],{'$or':[{'key':{'$like':'%'+_0x171017['query'][_0xfb01('0x44')]+'%'}},{'value':{'$like':'%'+_0x171017[_0xfb01('0x3a')][_0xfb01('0x44')]+'%'}}]});}_0x505802=_[_0xfb01('0x45')]({},_0x505802,_0x171017[_0xfb01('0x46')]);var _0x22ad8a={'where':_0x505802[_0xfb01('0x42')]};return db[_0xfb01('0x34')][_0xfb01('0x21')](_0x22ad8a)[_0xfb01('0x29')](function(_0x593770){_0x596b67[_0xfb01('0x21')]=_0x593770;if(_0x171017[_0xfb01('0x3a')]['includeAll']){_0x505802[_0xfb01('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0xfb01('0x48')](_0x505802);})['then'](function(_0x3dfd83){_0x596b67[_0xfb01('0x49')]=_0x3dfd83;return _0x596b67;})['then'](respondWithFilteredResult(_0x1a3423,_0x505802))[_0xfb01('0x4a')](handleError(_0x1a3423,null));};exports[_0xfb01('0x4b')]=function(_0x54fe50,_0x5f0694){var _0x515b1a={'raw':!![],'where':{'id':_0x54fe50[_0xfb01('0x4c')]['id']}},_0x44cb2c={};_0x44cb2c[_0xfb01('0x39')]=_[_0xfb01('0x4d')](db[_0xfb01('0x34')][_0xfb01('0x35')]);_0x44cb2c['query']=_[_0xfb01('0x4d')](_0x54fe50[_0xfb01('0x3a')]);_0x44cb2c[_0xfb01('0x3b')]=_['intersection'](_0x44cb2c[_0xfb01('0x39')],_0x44cb2c[_0xfb01('0x3a')]);_0x515b1a[_0xfb01('0x3d')]=_[_0xfb01('0x3c')](_0x44cb2c[_0xfb01('0x39')],qs[_0xfb01('0x3e')](_0x54fe50[_0xfb01('0x3a')][_0xfb01('0x3e')]));_0x515b1a[_0xfb01('0x3d')]=_0x515b1a[_0xfb01('0x3d')][_0xfb01('0x3f')]?_0x515b1a[_0xfb01('0x3d')]:_0x44cb2c[_0xfb01('0x39')];if(_0x54fe50[_0xfb01('0x3a')]['includeAll']){_0x515b1a[_0xfb01('0x47')]=[{'all':!![]}];}_0x515b1a=_[_0xfb01('0x45')]({},_0x515b1a,_0x54fe50[_0xfb01('0x46')]);return db['CannedAnswer'][_0xfb01('0x4e')](_0x515b1a)['then'](handleEntityNotFound(_0x5f0694,null))[_0xfb01('0x29')](respondWithResult(_0x5f0694,null))[_0xfb01('0x4a')](handleError(_0x5f0694,null));};exports['update']=function(_0x22bc12,_0x1f980b){if(_0x22bc12[_0xfb01('0x4f')]['id']){delete _0x22bc12[_0xfb01('0x4f')]['id'];}return db[_0xfb01('0x34')][_0xfb01('0x4e')]({'where':{'id':_0x22bc12[_0xfb01('0x4c')]['id']}})[_0xfb01('0x29')](handleEntityNotFound(_0x1f980b,null))[_0xfb01('0x29')](saveUpdates(_0x22bc12[_0xfb01('0x4f')],null))[_0xfb01('0x29')](respondWithResult(_0x1f980b,null))[_0xfb01('0x4a')](handleError(_0x1f980b,null));};exports[_0xfb01('0x2d')]=function(_0xf20a62,_0x1b8169){return db['CannedAnswer'][_0xfb01('0x4e')]({'where':{'id':_0xf20a62[_0xfb01('0x4c')]['id']}})[_0xfb01('0x29')](handleEntityNotFound(_0x1b8169,null))[_0xfb01('0x29')](removeEntity(_0x1b8169,null))[_0xfb01('0x4a')](handleError(_0x1b8169,null));};exports['create']=function(_0x1dc98a,_0x51ae47){var _0xd85b6e={'key':_0x1dc98a[_0xfb01('0x4f')][_0xfb01('0x38')]};if(_0x1dc98a[_0xfb01('0x4f')][_0xfb01('0x50')]){_0xd85b6e[_0xfb01('0x50')]=_0x1dc98a[_0xfb01('0x4f')]['MailAccountId'];}else if(_0x1dc98a[_0xfb01('0x4f')]['SmsAccountId']){_0xd85b6e[_0xfb01('0x51')]=_0x1dc98a[_0xfb01('0x4f')][_0xfb01('0x51')];}else if(_0x1dc98a[_0xfb01('0x4f')][_0xfb01('0x52')]){_0xd85b6e[_0xfb01('0x52')]=_0x1dc98a['body'][_0xfb01('0x52')];}else if(_0x1dc98a[_0xfb01('0x4f')][_0xfb01('0x53')]){_0xd85b6e['ChatWebsiteId']=_0x1dc98a[_0xfb01('0x4f')]['ChatWebsiteId'];}return db[_0xfb01('0x34')]['find']({'where':_0xd85b6e})[_0xfb01('0x29')](function(_0x502f90){if(_0x502f90){throw new db['Sequelize'][(_0xfb01('0x54'))](_0xfb01('0x55'));}return db[_0xfb01('0x34')]['create'](_0x1dc98a[_0xfb01('0x4f')]);})['then'](function(_0x475a21){var _0x34befc=_0x1dc98a[_0xfb01('0x56')]['get']({'plain':!![]});if(!_0x34befc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34befc['role']==='user'){var _0x57e5ac=_0x475a21[_0xfb01('0x2a')]({'plain':!![]});return db[_0xfb01('0x57')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x34befc[_0xfb01('0x58')]},'raw':!![]})[_0xfb01('0x29')](function(_0x39d312){if(_0x39d312&&_0x39d312[_0xfb01('0x59')]===0x0){return db[_0xfb01('0x2c')][_0xfb01('0x5a')]({'name':_0x57e5ac['name'],'resourceId':_0x57e5ac['id'],'type':_0x39d312['name'],'sectionId':_0x39d312['id']},{})[_0xfb01('0x29')](function(){return _0x475a21;});}else{return _0x475a21;}})[_0xfb01('0x4a')](function(_0x287089){logger[_0xfb01('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x287089);throw _0x287089;});}return _0x475a21;})[_0xfb01('0x29')](respondWithResult(_0x51ae47,0xc9))['catch'](handleError(_0x51ae47,null));}; \ No newline at end of file +var _0x4575=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x4575,0xb5));var _0x5457=function(_0x5b2155,_0x11bf44){_0x5b2155=_0x5b2155-0x0;var _0x1fd657=_0x4575[_0x5b2155];return _0x1fd657;};'use strict';var emlformat=require(_0x5457('0x0'));var rimraf=require(_0x5457('0x1'));var zipdir=require(_0x5457('0x2'));var jsonpatch=require(_0x5457('0x3'));var rp=require(_0x5457('0x4'));var moment=require(_0x5457('0x5'));var BPromise=require(_0x5457('0x6'));var Mustache=require(_0x5457('0x7'));var util=require(_0x5457('0x8'));var path=require(_0x5457('0x9'));var sox=require(_0x5457('0xa'));var csv=require(_0x5457('0xb'));var ejs=require(_0x5457('0xc'));var fs=require('fs');var fs_extra=require(_0x5457('0xd'));var _=require(_0x5457('0xe'));var squel=require('squel');var crypto=require(_0x5457('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5457('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5457('0x10'));var qs=require(_0x5457('0x11'));var as=require(_0x5457('0x12'));var hardwareService=require(_0x5457('0x13'));var logger=require(_0x5457('0x14'))(_0x5457('0x15'));var utils=require(_0x5457('0x16'));var config=require(_0x5457('0x17'));var licenseUtil=require(_0x5457('0x18'));var db=require(_0x5457('0x19'))['db'];function respondWithStatusCode(_0x354a8a,_0x1705bd){_0x1705bd=_0x1705bd||0xcc;return function(_0x919d33){if(_0x919d33){return _0x354a8a[_0x5457('0x1a')](_0x1705bd);}return _0x354a8a[_0x5457('0x1b')](_0x1705bd)[_0x5457('0x1c')]();};}function respondWithResult(_0x24544e,_0x8a9f46){_0x8a9f46=_0x8a9f46||0xc8;return function(_0x26fa4a){if(_0x26fa4a){return _0x24544e[_0x5457('0x1b')](_0x8a9f46)[_0x5457('0x1d')](_0x26fa4a);}};}function respondWithFilteredResult(_0x28aa7a,_0x68dde4){return function(_0x33ce63){if(_0x33ce63){var _0x5f062c=typeof _0x68dde4[_0x5457('0x1e')]==='undefined'&&typeof _0x68dde4[_0x5457('0x1f')]===_0x5457('0x20');var _0x312d44=_0x33ce63[_0x5457('0x21')];var _0x18910a=_0x5f062c?0x0:_0x68dde4['offset'];var _0x53800d=_0x5f062c?_0x33ce63[_0x5457('0x21')]:_0x68dde4['offset']+_0x68dde4[_0x5457('0x1f')];var _0x335a05;if(_0x53800d>=_0x312d44){_0x53800d=_0x312d44;_0x335a05=0xc8;}else{_0x335a05=0xce;}_0x28aa7a[_0x5457('0x1b')](_0x335a05);return _0x28aa7a['set'](_0x5457('0x22'),_0x18910a+'-'+_0x53800d+'/'+_0x312d44)['json'](_0x33ce63);}return null;};}function patchUpdates(_0x395f7a){return function(_0x3ae014){try{jsonpatch[_0x5457('0x23')](_0x3ae014,_0x395f7a,!![]);}catch(_0x3e82fd){return BPromise[_0x5457('0x24')](_0x3e82fd);}return _0x3ae014[_0x5457('0x25')]();};}function saveUpdates(_0x10066b,_0x156e42){return function(_0x55b6d8){if(_0x55b6d8){return _0x55b6d8[_0x5457('0x26')](_0x10066b)[_0x5457('0x27')](function(_0x57d6d7){return _0x57d6d7;});}return null;};}function removeEntity(_0x564107,_0x4b1e7e){return function(_0x466390){if(_0x466390){return _0x466390['destroy']()[_0x5457('0x27')](function(){var _0x394d91=_0x466390[_0x5457('0x28')]({'plain':!![]});var _0x36f272=_0x5457('0x29');return db[_0x5457('0x2a')][_0x5457('0x2b')]({'where':{'type':_0x36f272,'resourceId':_0x394d91['id']}})['then'](function(){return _0x466390;});})[_0x5457('0x27')](function(){_0x564107[_0x5457('0x1b')](0xcc)[_0x5457('0x1c')]();});}};}function handleEntityNotFound(_0x280fc8,_0x4ab1c3){return function(_0x13b44c){if(!_0x13b44c){_0x280fc8[_0x5457('0x1a')](0x194);}return _0x13b44c;};}function handleError(_0x4fc099,_0x1793d5){_0x1793d5=_0x1793d5||0x1f4;return function(_0x235149){logger['error'](_0x235149[_0x5457('0x2c')]);if(_0x235149[_0x5457('0x2d')]){delete _0x235149[_0x5457('0x2d')];}_0x4fc099[_0x5457('0x1b')](_0x1793d5)[_0x5457('0x2e')](_0x235149);};}exports[_0x5457('0x2f')]=function(_0x4ab338,_0x197add){var _0x2443a7={},_0x397c97={},_0x2d77ab={'count':0x0,'rows':[]};var _0x2f14c4=_[_0x5457('0x30')](db[_0x5457('0x31')][_0x5457('0x32')],function(_0x5b3cf2){return{'name':_0x5b3cf2[_0x5457('0x33')],'type':_0x5b3cf2[_0x5457('0x34')]['key']};});_0x397c97[_0x5457('0x35')]=_[_0x5457('0x30')](_0x2f14c4,_0x5457('0x2d'));_0x397c97[_0x5457('0x36')]=_[_0x5457('0x37')](_0x4ab338[_0x5457('0x36')]);_0x397c97[_0x5457('0x38')]=_[_0x5457('0x39')](_0x397c97[_0x5457('0x35')],_0x397c97[_0x5457('0x36')]);_0x2443a7[_0x5457('0x3a')]=_[_0x5457('0x39')](_0x397c97[_0x5457('0x35')],qs[_0x5457('0x3b')](_0x4ab338[_0x5457('0x36')][_0x5457('0x3b')]));_0x2443a7[_0x5457('0x3a')]=_0x2443a7[_0x5457('0x3a')]['length']?_0x2443a7[_0x5457('0x3a')]:_0x397c97[_0x5457('0x35')];if(!_0x4ab338['query']['hasOwnProperty'](_0x5457('0x3c'))){_0x2443a7[_0x5457('0x1f')]=qs[_0x5457('0x1f')](_0x4ab338[_0x5457('0x36')][_0x5457('0x1f')]);_0x2443a7[_0x5457('0x1e')]=qs['offset'](_0x4ab338['query']['offset']);}_0x2443a7[_0x5457('0x3d')]=qs[_0x5457('0x3e')](_0x4ab338[_0x5457('0x36')][_0x5457('0x3e')]);_0x2443a7[_0x5457('0x3f')]=qs[_0x5457('0x38')](_[_0x5457('0x40')](_0x4ab338[_0x5457('0x36')],_0x397c97[_0x5457('0x38')]),_0x2f14c4);if(_0x4ab338[_0x5457('0x36')][_0x5457('0x41')]){_0x2443a7[_0x5457('0x3f')]=_[_0x5457('0x42')](_0x2443a7['where'],{'$or':[{'key':{'$like':'%'+_0x4ab338[_0x5457('0x36')][_0x5457('0x41')]+'%'}},{'value':{'$like':'%'+_0x4ab338[_0x5457('0x36')][_0x5457('0x41')]+'%'}}]});}_0x2443a7=_[_0x5457('0x42')]({},_0x2443a7,_0x4ab338[_0x5457('0x43')]);var _0x3ec3e5={'where':_0x2443a7['where']};return db['CannedAnswer'][_0x5457('0x21')](_0x3ec3e5)[_0x5457('0x27')](function(_0x37d1a9){_0x2d77ab[_0x5457('0x21')]=_0x37d1a9;if(_0x4ab338[_0x5457('0x36')][_0x5457('0x44')]){_0x2443a7[_0x5457('0x45')]=[{'all':!![]}];}return db[_0x5457('0x31')][_0x5457('0x46')](_0x2443a7);})['then'](function(_0x5d683b){_0x2d77ab[_0x5457('0x47')]=_0x5d683b;return _0x2d77ab;})[_0x5457('0x27')](respondWithFilteredResult(_0x197add,_0x2443a7))[_0x5457('0x48')](handleError(_0x197add,null));};exports[_0x5457('0x49')]=function(_0x57bfd0,_0x55fb48){var _0x1f5cbd={'raw':!![],'where':{'id':_0x57bfd0[_0x5457('0x4a')]['id']}},_0x23e42b={};_0x23e42b[_0x5457('0x35')]=_[_0x5457('0x37')](db[_0x5457('0x31')][_0x5457('0x32')]);_0x23e42b['query']=_[_0x5457('0x37')](_0x57bfd0[_0x5457('0x36')]);_0x23e42b['filters']=_['intersection'](_0x23e42b[_0x5457('0x35')],_0x23e42b['query']);_0x1f5cbd[_0x5457('0x3a')]=_[_0x5457('0x39')](_0x23e42b[_0x5457('0x35')],qs[_0x5457('0x3b')](_0x57bfd0[_0x5457('0x36')][_0x5457('0x3b')]));_0x1f5cbd['attributes']=_0x1f5cbd[_0x5457('0x3a')]['length']?_0x1f5cbd[_0x5457('0x3a')]:_0x23e42b[_0x5457('0x35')];if(_0x57bfd0[_0x5457('0x36')][_0x5457('0x44')]){_0x1f5cbd['include']=[{'all':!![]}];}_0x1f5cbd=_[_0x5457('0x42')]({},_0x1f5cbd,_0x57bfd0[_0x5457('0x43')]);return db[_0x5457('0x31')][_0x5457('0x4b')](_0x1f5cbd)['then'](handleEntityNotFound(_0x55fb48,null))[_0x5457('0x27')](respondWithResult(_0x55fb48,null))['catch'](handleError(_0x55fb48,null));};exports[_0x5457('0x26')]=function(_0x44b376,_0x48ea48){if(_0x44b376[_0x5457('0x4c')]['id']){delete _0x44b376['body']['id'];}return db[_0x5457('0x31')][_0x5457('0x4b')]({'where':{'id':_0x44b376[_0x5457('0x4a')]['id']}})[_0x5457('0x27')](handleEntityNotFound(_0x48ea48,null))[_0x5457('0x27')](saveUpdates(_0x44b376[_0x5457('0x4c')],null))[_0x5457('0x27')](respondWithResult(_0x48ea48,null))[_0x5457('0x48')](handleError(_0x48ea48,null));};exports[_0x5457('0x2b')]=function(_0x1fb2ef,_0x4ab861){return db[_0x5457('0x31')][_0x5457('0x4b')]({'where':{'id':_0x1fb2ef[_0x5457('0x4a')]['id']}})[_0x5457('0x27')](handleEntityNotFound(_0x4ab861,null))[_0x5457('0x27')](removeEntity(_0x4ab861,null))[_0x5457('0x48')](handleError(_0x4ab861,null));};exports[_0x5457('0x4d')]=function(_0x1fa296,_0x5d809c){var _0x53a809={'key':_0x1fa296['body'][_0x5457('0x4e')]};if(_0x1fa296[_0x5457('0x4c')]['MailAccountId']){_0x53a809['MailAccountId']=_0x1fa296['body'][_0x5457('0x4f')];}else if(_0x1fa296[_0x5457('0x4c')][_0x5457('0x50')]){_0x53a809['SmsAccountId']=_0x1fa296[_0x5457('0x4c')][_0x5457('0x50')];}else if(_0x1fa296[_0x5457('0x4c')]['OpenchannelAccountId']){_0x53a809[_0x5457('0x51')]=_0x1fa296[_0x5457('0x4c')][_0x5457('0x51')];}else if(_0x1fa296[_0x5457('0x4c')][_0x5457('0x52')]){_0x53a809[_0x5457('0x52')]=_0x1fa296[_0x5457('0x4c')][_0x5457('0x52')];}return db[_0x5457('0x31')][_0x5457('0x4b')]({'where':_0x53a809})[_0x5457('0x27')](function(_0x327839){if(_0x327839){throw new db[(_0x5457('0x53'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x5457('0x31')][_0x5457('0x4d')](_0x1fa296[_0x5457('0x4c')]);})[_0x5457('0x27')](function(_0x4aecf3){var _0x262b7c=_0x1fa296[_0x5457('0x54')][_0x5457('0x28')]({'plain':!![]});if(!_0x262b7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x262b7c[_0x5457('0x55')]===_0x5457('0x54')){var _0xc341d6=_0x4aecf3[_0x5457('0x28')]({'plain':!![]});return db[_0x5457('0x56')][_0x5457('0x4b')]({'where':{'name':_0x5457('0x29'),'userProfileId':_0x262b7c[_0x5457('0x57')]},'raw':!![]})[_0x5457('0x27')](function(_0x1db1c4){if(_0x1db1c4&&_0x1db1c4[_0x5457('0x58')]===0x0){return db[_0x5457('0x2a')][_0x5457('0x4d')]({'name':_0xc341d6[_0x5457('0x2d')],'resourceId':_0xc341d6['id'],'type':_0x1db1c4['name'],'sectionId':_0x1db1c4['id']},{})['then'](function(){return _0x4aecf3;});}else{return _0x4aecf3;}})[_0x5457('0x48')](function(_0xeb8327){logger[_0x5457('0x59')](_0x5457('0x5a'),_0xeb8327);throw _0xeb8327;});}return _0x4aecf3;})[_0x5457('0x27')](respondWithResult(_0x5d809c,0xc9))[_0x5457('0x48')](handleError(_0x5d809c,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 5347ef9..41296a1 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 _0x18dd=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xd193eb,_0x7761e6){var _0x19ff21=function(_0x44b033){while(--_0x44b033){_0xd193eb['push'](_0xd193eb['shift']());}};_0x19ff21(++_0x7761e6);}(_0x18dd,0x7a));var _0xd18d=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x18dd[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xd18d('0x0'));var util=require('util');var logger=require(_0xd18d('0x1'))('api');var moment=require(_0xd18d('0x2'));var BPromise=require(_0xd18d('0x3'));var rp=require(_0xd18d('0x4'));var fs=require('fs');var path=require(_0xd18d('0x5'));var rimraf=require(_0xd18d('0x6'));var config=require(_0xd18d('0x7'));var attributes=require(_0xd18d('0x8'));module[_0xd18d('0x9')]=function(_0x2c2c67,_0x38b1d1){return _0x2c2c67[_0xd18d('0xa')]('CannedAnswer',attributes,{'tableName':_0xd18d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd18d('0xc')});}; \ No newline at end of file +var _0x3957=['path','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xb3e003,_0x13c54f){var _0x2c6342=function(_0x8f0be3){while(--_0x8f0be3){_0xb3e003['push'](_0xb3e003['shift']());}};_0x2c6342(++_0x13c54f);}(_0x3957,0x199));var _0x7395=function(_0x50d94a,_0x4bb055){_0x50d94a=_0x50d94a-0x0;var _0x4b88ec=_0x3957[_0x50d94a];return _0x4b88ec;};'use strict';var _=require(_0x7395('0x0'));var util=require(_0x7395('0x1'));var logger=require(_0x7395('0x2'))(_0x7395('0x3'));var moment=require(_0x7395('0x4'));var BPromise=require(_0x7395('0x5'));var rp=require(_0x7395('0x6'));var fs=require('fs');var path=require(_0x7395('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7395('0x8'));module['exports']=function(_0x3b1874,_0x5eb5b7){return _0x3b1874['define'](_0x7395('0x9'),attributes,{'tableName':_0x7395('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7395('0xb'),'collate':_0x7395('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 7e5b3bc..67efdb8 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(_0x2b38f6,_0x51b0c1){var _0x135a1b=function(_0x3b15f2){while(--_0x3b15f2){_0x2b38f6['push'](_0x2b38f6['shift']());}};_0x135a1b(++_0x51b0c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3ec87c,_0x128197){var _0x325961=function(_0x402a27){while(--_0x402a27){_0x3ec87c['push'](_0x3ec87c['shift']());}};_0x325961(++_0x128197);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 0116ed5..93a0e7b 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 _0xdede=['express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x2b50e0,_0x48d2bb){var _0x379c45=function(_0x5d652f){while(--_0x5d652f){_0x2b50e0['push'](_0x2b50e0['shift']());}};_0x379c45(++_0x48d2bb);}(_0xdede,0xde));var _0xeded=function(_0x3177a8,_0x2e8897){_0x3177a8=_0x3177a8-0x0;var _0x30868d=_0xdede[_0x3177a8];return _0x30868d;};'use strict';var multer=require(_0xeded('0x0'));var util=require(_0xeded('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeded('0x2'));var router=express['Router']();var fs_extra=require(_0xeded('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xeded('0x4'));var config=require(_0xeded('0x5'));var controller=require('./cannedAnswer.controller');router[_0xeded('0x6')]('/',auth[_0xeded('0x7')](),controller[_0xeded('0x8')]);router[_0xeded('0x6')]('/:id',auth[_0xeded('0x7')](),controller['show']);router[_0xeded('0x9')]('/',auth[_0xeded('0x7')](),controller['create']);router[_0xeded('0xa')](_0xeded('0xb'),auth[_0xeded('0x7')](),controller[_0xeded('0xc')]);router[_0xeded('0xd')](_0xeded('0xb'),auth[_0xeded('0x7')](),controller[_0xeded('0xe')]);module[_0xeded('0xf')]=router; \ No newline at end of file +var _0x930f=['./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x930f,0x13a));var _0xf930=function(_0x12865c,_0x2605b2){_0x12865c=_0x12865c-0x0;var _0x26fb40=_0x930f[_0x12865c];return _0x26fb40;};'use strict';var multer=require(_0xf930('0x0'));var util=require(_0xf930('0x1'));var path=require('path');var timeout=require(_0xf930('0x2'));var express=require(_0xf930('0x3'));var router=express[_0xf930('0x4')]();var fs_extra=require(_0xf930('0x5'));var auth=require(_0xf930('0x6'));var interaction=require(_0xf930('0x7'));var config=require(_0xf930('0x8'));var controller=require(_0xf930('0x9'));router[_0xf930('0xa')]('/',auth[_0xf930('0xb')](),controller[_0xf930('0xc')]);router[_0xf930('0xa')](_0xf930('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf930('0xe')]('/',auth[_0xf930('0xb')](),controller['create']);router[_0xf930('0xf')](_0xf930('0xd'),auth[_0xf930('0xb')](),controller[_0xf930('0x10')]);router[_0xf930('0x11')](_0xf930('0xd'),auth[_0xf930('0xb')](),controller['destroy']);module[_0xf930('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9e3ab92..c232a2d 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 _0xabed=['sequelize','exports','STRING','INTEGER'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xabed,0xa4));var _0xdabe=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0xabed[_0x52c4e9];return _0x252a03;};'use strict';var Sequelize=require(_0xdabe('0x0'));module[_0xdabe('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xdabe('0x2')]},'src':{'type':Sequelize[_0xdabe('0x2')]},'dst':{'type':Sequelize[_0xdabe('0x2')]},'dcontext':{'type':Sequelize[_0xdabe('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xdabe('0x2')]},'lastdata':{'type':Sequelize[_0xdabe('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdabe('0x2')]},'amaflags':{'type':Sequelize[_0xdabe('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xdabe('0x2')]},'userfield':{'type':Sequelize[_0xdabe('0x2')]},'uniqueid':{'type':Sequelize[_0xdabe('0x2')]},'linkedid':{'type':Sequelize[_0xdabe('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xdabe('0x2')]},'type':{'type':Sequelize[_0xdabe('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x132f=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x132f,0x182));var _0xf132=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0x132f[_0x5e28c2];return _0x1a8cc6;};'use strict';var Sequelize=require(_0xf132('0x0'));module[_0xf132('0x1')]={'calldate':{'type':Sequelize[_0xf132('0x2')],'allowNull':![],'defaultValue':_0xf132('0x3')},'clid':{'type':Sequelize[_0xf132('0x4')]},'src':{'type':Sequelize[_0xf132('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xf132('0x4')]},'channel':{'type':Sequelize[_0xf132('0x4')]},'dstchannel':{'type':Sequelize[_0xf132('0x4')]},'lastapp':{'type':Sequelize[_0xf132('0x4')]},'lastdata':{'type':Sequelize[_0xf132('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf132('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf132('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf132('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf132('0x4')]},'linkedid':{'type':Sequelize[_0xf132('0x4')]},'sequence':{'type':Sequelize[_0xf132('0x4')]},'peeraccount':{'type':Sequelize[_0xf132('0x4')]},'type':{'type':Sequelize[_0xf132('0x4')]},'tag':{'type':Sequelize[_0xf132('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e3a9e5b..1104954 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 _0x3c6c=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x594dc7,_0x269225){var _0x2e287d=function(_0x57f96c){while(--_0x57f96c){_0x594dc7['push'](_0x594dc7['shift']());}};_0x2e287d(++_0x269225);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x1f347e,_0x12e1ad){_0x1f347e=_0x1f347e-0x0;var _0x5213c2=_0x3c6c[_0x1f347e];return _0x5213c2;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={},_0xb047b1={},_0x4571f4={'count':0x0,'rows':[]};var _0x31975e=_[_0xc3c6('0x29')](db['Cdr'][_0xc3c6('0x2a')],function(_0x1bcc34){return{'name':_0x1bcc34[_0xc3c6('0x2b')],'type':_0x1bcc34[_0xc3c6('0x2c')][_0xc3c6('0x2d')]};});_0xb047b1[_0xc3c6('0x2e')]=_['map'](_0x31975e,_0xc3c6('0x26'));_0xb047b1[_0xc3c6('0x2f')]=_[_0xc3c6('0x30')](_0x2e4094[_0xc3c6('0x2f')]);_0xb047b1[_0xc3c6('0x31')]=_['intersection'](_0xb047b1[_0xc3c6('0x2e')],_0xb047b1[_0xc3c6('0x2f')]);_0x478a4b[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0xb047b1[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x2e4094[_0xc3c6('0x2f')]['fields']));_0x478a4b[_0xc3c6('0x32')]=_0x478a4b['attributes'][_0xc3c6('0x35')]?_0x478a4b[_0xc3c6('0x32')]:_0xb047b1[_0xc3c6('0x2e')];if(!_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x36')](_0xc3c6('0x37'))){_0x478a4b['limit']=qs[_0xc3c6('0x1a')](_0x2e4094[_0xc3c6('0x2f')]['limit']);_0x478a4b[_0xc3c6('0x18')]=qs[_0xc3c6('0x18')](_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x18')]);}_0x478a4b[_0xc3c6('0x38')]=qs[_0xc3c6('0x39')](_0x2e4094[_0xc3c6('0x2f')]['sort']);_0x478a4b['where']=qs[_0xc3c6('0x31')](_[_0xc3c6('0x3a')](_0x2e4094[_0xc3c6('0x2f')],_0xb047b1[_0xc3c6('0x31')]),_0x31975e);if(_0x2e4094[_0xc3c6('0x2f')]['filter']){_0x478a4b[_0xc3c6('0x3b')]=_[_0xc3c6('0x3c')](_0x478a4b[_0xc3c6('0x3b')],{'$or':_[_0xc3c6('0x29')](_0x31975e,function(_0x1eb423){if(_0x1eb423[_0xc3c6('0x2c')]!==_0xc3c6('0x3d')){var _0xada6f={};_0xada6f[_0x1eb423[_0xc3c6('0x26')]]={'$like':'%'+_0x2e4094['query'][_0xc3c6('0x3e')]+'%'};return _0xada6f;}})});}_0x478a4b=_[_0xc3c6('0x3c')]({},_0x478a4b,_0x2e4094[_0xc3c6('0x3f')]);var _0x316605={'where':_0x478a4b[_0xc3c6('0x3b')]};return db[_0xc3c6('0x40')][_0xc3c6('0x1b')](_0x316605)[_0xc3c6('0x23')](function(_0x59b2d9){_0x4571f4[_0xc3c6('0x1b')]=_0x59b2d9;if(_0x2e4094[_0xc3c6('0x2f')]['includeAll']){_0x478a4b[_0xc3c6('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xc3c6('0x42')](_0x478a4b);})[_0xc3c6('0x23')](function(_0x25bb1e){_0x4571f4[_0xc3c6('0x43')]=_0x25bb1e;return _0x4571f4;})[_0xc3c6('0x23')](respondWithFilteredResult(_0x1f1d36,_0x478a4b))[_0xc3c6('0x44')](handleError(_0x1f1d36,null));};exports[_0xc3c6('0x45')]=function(_0x998388,_0x572339){var _0xda8652={'raw':!![],'where':{'id':_0x998388[_0xc3c6('0x46')]['id']}},_0x570d11={};_0x570d11[_0xc3c6('0x2e')]=_[_0xc3c6('0x30')](db[_0xc3c6('0x40')]['rawAttributes']);_0x570d11['query']=_[_0xc3c6('0x30')](_0x998388[_0xc3c6('0x2f')]);_0x570d11[_0xc3c6('0x31')]=_[_0xc3c6('0x33')](_0x570d11['model'],_0x570d11[_0xc3c6('0x2f')]);_0xda8652[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0x570d11[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x34')]));_0xda8652['attributes']=_0xda8652['attributes'][_0xc3c6('0x35')]?_0xda8652[_0xc3c6('0x32')]:_0x570d11['model'];if(_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x47')]){_0xda8652['include']=[{'all':!![]}];}_0xda8652=_[_0xc3c6('0x3c')]({},_0xda8652,_0x998388[_0xc3c6('0x3f')]);return db['Cdr'][_0xc3c6('0x48')](_0xda8652)[_0xc3c6('0x23')](handleEntityNotFound(_0x572339,null))[_0xc3c6('0x23')](respondWithResult(_0x572339,null))[_0xc3c6('0x44')](handleError(_0x572339,null));};exports[_0xc3c6('0x49')]=function(_0x333698,_0x508731){return db[_0xc3c6('0x40')][_0xc3c6('0x49')](_0x333698[_0xc3c6('0x4a')],{})[_0xc3c6('0x23')](respondWithResult(_0x508731,0xc9))[_0xc3c6('0x44')](handleError(_0x508731,null));};exports[_0xc3c6('0x21')]=function(_0x21b8a0,_0x55b8bc){if(_0x21b8a0['body']['id']){delete _0x21b8a0[_0xc3c6('0x4a')]['id'];}return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x21b8a0[_0xc3c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b8bc,null))['then'](saveUpdates(_0x21b8a0[_0xc3c6('0x4a')],null))[_0xc3c6('0x23')](respondWithResult(_0x55b8bc,null))[_0xc3c6('0x44')](handleError(_0x55b8bc,null));};exports[_0xc3c6('0x22')]=function(_0x34ed73,_0x313277){return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x34ed73[_0xc3c6('0x46')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x313277,null))[_0xc3c6('0x23')](removeEntity(_0x313277,null))[_0xc3c6('0x44')](handleError(_0x313277,null));};exports[_0xc3c6('0x4b')]=function(_0xc84c69,_0xad293e){return db[_0xc3c6('0x40')]['describe']()[_0xc3c6('0x23')](respondWithResult(_0xad293e,null))[_0xc3c6('0x44')](handleError(_0xad293e,null));}; \ No newline at end of file +var _0x60c2=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','filters','filter','merge','where','VIRTUAL','options','includeAll','include','Cdr','findAll','rows','params','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x17d112,_0x891ef7){var _0x5f5cd3=function(_0x50c99f){while(--_0x50c99f){_0x17d112['push'](_0x17d112['shift']());}};_0x5f5cd3(++_0x891ef7);}(_0x60c2,0x8f));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x260c('0x0'));var zipdir=require(_0x260c('0x1'));var jsonpatch=require(_0x260c('0x2'));var rp=require(_0x260c('0x3'));var moment=require(_0x260c('0x4'));var BPromise=require(_0x260c('0x5'));var Mustache=require(_0x260c('0x6'));var util=require(_0x260c('0x7'));var path=require(_0x260c('0x8'));var sox=require(_0x260c('0x9'));var csv=require(_0x260c('0xa'));var ejs=require(_0x260c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x260c('0xc'));var squel=require(_0x260c('0xd'));var crypto=require(_0x260c('0xe'));var jsforce=require(_0x260c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x260c('0xa'));var querystring=require(_0x260c('0x10'));var Papa=require(_0x260c('0x11'));var Redis=require(_0x260c('0x12'));var authService=require(_0x260c('0x13'));var qs=require(_0x260c('0x14'));var as=require(_0x260c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x260c('0x16'))(_0x260c('0x17'));var utils=require(_0x260c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x260c('0x19'));var db=require(_0x260c('0x1a'))['db'];function respondWithStatusCode(_0x191490,_0x5aed37){_0x5aed37=_0x5aed37||0xcc;return function(_0xc44e8d){if(_0xc44e8d){return _0x191490[_0x260c('0x1b')](_0x5aed37);}return _0x191490[_0x260c('0x1c')](_0x5aed37)[_0x260c('0x1d')]();};}function respondWithResult(_0x1d3775,_0x53df53){_0x53df53=_0x53df53||0xc8;return function(_0x3930b6){if(_0x3930b6){return _0x1d3775['status'](_0x53df53)[_0x260c('0x1e')](_0x3930b6);}};}function respondWithFilteredResult(_0x5a021c,_0x47edc1){return function(_0xd8b310){if(_0xd8b310){var _0x5299a4=typeof _0x47edc1[_0x260c('0x1f')]===_0x260c('0x20')&&typeof _0x47edc1[_0x260c('0x21')]===_0x260c('0x20');var _0x2bf3b8=_0xd8b310[_0x260c('0x22')];var _0x11e634=_0x5299a4?0x0:_0x47edc1[_0x260c('0x1f')];var _0x201e59=_0x5299a4?_0xd8b310[_0x260c('0x22')]:_0x47edc1[_0x260c('0x1f')]+_0x47edc1['limit'];var _0xd977b;if(_0x201e59>=_0x2bf3b8){_0x201e59=_0x2bf3b8;_0xd977b=0xc8;}else{_0xd977b=0xce;}_0x5a021c['status'](_0xd977b);return _0x5a021c[_0x260c('0x23')](_0x260c('0x24'),_0x11e634+'-'+_0x201e59+'/'+_0x2bf3b8)['json'](_0xd8b310);}return null;};}function patchUpdates(_0x1ccf81){return function(_0xe824db){try{jsonpatch[_0x260c('0x25')](_0xe824db,_0x1ccf81,!![]);}catch(_0x1c53e1){return BPromise[_0x260c('0x26')](_0x1c53e1);}return _0xe824db[_0x260c('0x27')]();};}function saveUpdates(_0x4b5b7a,_0xd5b7d8){return function(_0x158bc6){if(_0x158bc6){return _0x158bc6[_0x260c('0x28')](_0x4b5b7a)[_0x260c('0x29')](function(_0x58688c){return _0x58688c;});}return null;};}function removeEntity(_0x3f299f,_0x304961){return function(_0x461c8a){if(_0x461c8a){return _0x461c8a[_0x260c('0x2a')]()['then'](function(){_0x3f299f[_0x260c('0x1c')](0xcc)[_0x260c('0x1d')]();});}};}function handleEntityNotFound(_0x3bdfce,_0x29e10e){return function(_0x4cf0f9){if(!_0x4cf0f9){_0x3bdfce[_0x260c('0x1b')](0x194);}return _0x4cf0f9;};}function handleError(_0x2957e5,_0x480179){_0x480179=_0x480179||0x1f4;return function(_0x5def72){logger[_0x260c('0x2b')](_0x5def72[_0x260c('0x2c')]);if(_0x5def72[_0x260c('0x2d')]){delete _0x5def72[_0x260c('0x2d')];}_0x2957e5[_0x260c('0x1c')](_0x480179)[_0x260c('0x2e')](_0x5def72);};}exports['index']=function(_0xf1ad3e,_0x2e49dd){var _0x16b663={},_0x233a61={},_0x5993fd={'count':0x0,'rows':[]};var _0xc6868a=_[_0x260c('0x2f')](db['Cdr'][_0x260c('0x30')],function(_0xcb8c28){return{'name':_0xcb8c28[_0x260c('0x31')],'type':_0xcb8c28[_0x260c('0x32')][_0x260c('0x33')]};});_0x233a61[_0x260c('0x34')]=_[_0x260c('0x2f')](_0xc6868a,_0x260c('0x2d'));_0x233a61['query']=_[_0x260c('0x35')](_0xf1ad3e[_0x260c('0x36')]);_0x233a61['filters']=_[_0x260c('0x37')](_0x233a61['model'],_0x233a61['query']);_0x16b663['attributes']=_[_0x260c('0x37')](_0x233a61[_0x260c('0x34')],qs['fields'](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x38')]));_0x16b663[_0x260c('0x39')]=_0x16b663[_0x260c('0x39')][_0x260c('0x3a')]?_0x16b663[_0x260c('0x39')]:_0x233a61['model'];if(!_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3b')](_0x260c('0x3c'))){_0x16b663[_0x260c('0x21')]=qs[_0x260c('0x21')](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x21')]);_0x16b663[_0x260c('0x1f')]=qs[_0x260c('0x1f')](_0xf1ad3e['query'][_0x260c('0x1f')]);}_0x16b663['order']=qs['sort'](_0xf1ad3e['query']['sort']);_0x16b663['where']=qs['filters'](_['pick'](_0xf1ad3e[_0x260c('0x36')],_0x233a61[_0x260c('0x3d')]),_0xc6868a);if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3e')]){_0x16b663['where']=_[_0x260c('0x3f')](_0x16b663[_0x260c('0x40')],{'$or':_['map'](_0xc6868a,function(_0x35afd6){if(_0x35afd6[_0x260c('0x32')]!==_0x260c('0x41')){var _0x1dbc8a={};_0x1dbc8a[_0x35afd6[_0x260c('0x2d')]]={'$like':'%'+_0xf1ad3e['query']['filter']+'%'};return _0x1dbc8a;}})});}_0x16b663=_[_0x260c('0x3f')]({},_0x16b663,_0xf1ad3e[_0x260c('0x42')]);var _0x1de711={'where':_0x16b663[_0x260c('0x40')]};return db['Cdr'][_0x260c('0x22')](_0x1de711)[_0x260c('0x29')](function(_0x265bd8){_0x5993fd[_0x260c('0x22')]=_0x265bd8;if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x43')]){_0x16b663[_0x260c('0x44')]=[{'all':!![]}];}return db[_0x260c('0x45')][_0x260c('0x46')](_0x16b663);})[_0x260c('0x29')](function(_0x3392df){_0x5993fd[_0x260c('0x47')]=_0x3392df;return _0x5993fd;})[_0x260c('0x29')](respondWithFilteredResult(_0x2e49dd,_0x16b663))['catch'](handleError(_0x2e49dd,null));};exports['show']=function(_0x19ab59,_0x30b3f9){var _0xccd9c1={'raw':!![],'where':{'id':_0x19ab59[_0x260c('0x48')]['id']}},_0x50ed87={};_0x50ed87['model']=_['keys'](db[_0x260c('0x45')]['rawAttributes']);_0x50ed87[_0x260c('0x36')]=_[_0x260c('0x35')](_0x19ab59[_0x260c('0x36')]);_0x50ed87[_0x260c('0x3d')]=_['intersection'](_0x50ed87[_0x260c('0x34')],_0x50ed87[_0x260c('0x36')]);_0xccd9c1['attributes']=_[_0x260c('0x37')](_0x50ed87['model'],qs[_0x260c('0x38')](_0x19ab59[_0x260c('0x36')][_0x260c('0x38')]));_0xccd9c1['attributes']=_0xccd9c1[_0x260c('0x39')][_0x260c('0x3a')]?_0xccd9c1[_0x260c('0x39')]:_0x50ed87[_0x260c('0x34')];if(_0x19ab59[_0x260c('0x36')][_0x260c('0x43')]){_0xccd9c1[_0x260c('0x44')]=[{'all':!![]}];}_0xccd9c1=_[_0x260c('0x3f')]({},_0xccd9c1,_0x19ab59[_0x260c('0x42')]);return db[_0x260c('0x45')][_0x260c('0x49')](_0xccd9c1)[_0x260c('0x29')](handleEntityNotFound(_0x30b3f9,null))['then'](respondWithResult(_0x30b3f9,null))['catch'](handleError(_0x30b3f9,null));};exports[_0x260c('0x4a')]=function(_0x4517be,_0x18321f){return db[_0x260c('0x45')]['create'](_0x4517be[_0x260c('0x4b')],{})[_0x260c('0x29')](respondWithResult(_0x18321f,0xc9))[_0x260c('0x4c')](handleError(_0x18321f,null));};exports[_0x260c('0x28')]=function(_0x45175a,_0x1d0890){if(_0x45175a[_0x260c('0x4b')]['id']){delete _0x45175a[_0x260c('0x4b')]['id'];}return db[_0x260c('0x45')]['find']({'where':{'id':_0x45175a[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1d0890,null))['then'](saveUpdates(_0x45175a[_0x260c('0x4b')],null))['then'](respondWithResult(_0x1d0890,null))[_0x260c('0x4c')](handleError(_0x1d0890,null));};exports['destroy']=function(_0x4dcdca,_0x1e34fe){return db[_0x260c('0x45')][_0x260c('0x49')]({'where':{'id':_0x4dcdca[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1e34fe,null))[_0x260c('0x29')](removeEntity(_0x1e34fe,null))[_0x260c('0x4c')](handleError(_0x1e34fe,null));};exports['describe']=function(_0x12fbe5,_0x49b350){return db[_0x260c('0x45')][_0x260c('0x4d')]()[_0x260c('0x29')](respondWithResult(_0x49b350,null))[_0x260c('0x4c')](handleError(_0x49b350,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index de93707..cb9c027 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4e1efc,_0xf4af1b){var _0x2cc374=function(_0x4d27f9){while(--_0x4d27f9){_0x4e1efc['push'](_0x4e1efc['shift']());}};_0x2cc374(++_0xf4af1b);}(_0x7a54,0x106));var _0x47a5=function(_0x5350a4,_0x3da425){_0x5350a4=_0x5350a4-0x0;var _0x53b6c2=_0x7a54[_0x5350a4];return _0x53b6c2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x29a746,_0x4288ff){var _0x51dcb1=function(_0x3ee3b8){while(--_0x3ee3b8){_0x29a746['push'](_0x29a746['shift']());}};_0x51dcb1(++_0x4288ff);}(_0x7a54,0x106));var _0x47a5=function(_0x200a9e,_0x538788){_0x200a9e=_0x200a9e-0x0;var _0x2f4111=_0x7a54[_0x200a9e];return _0x2f4111;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index be1d1f7..cfcccfd 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 _0xecb6=['Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','request','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xc22d7c,_0x51d9ae){var _0x65b8a6=function(_0x18fba2){while(--_0x18fba2){_0xc22d7c['push'](_0xc22d7c['shift']());}};_0x65b8a6(++_0x51d9ae);}(_0xecb6,0x133));var _0x6ecb=function(_0x182f09,_0x2ee907){_0x182f09=_0x182f09-0x0;var _0x2516ea=_0xecb6[_0x182f09];return _0x2516ea;};'use strict';var _=require(_0x6ecb('0x0'));var util=require(_0x6ecb('0x1'));var moment=require(_0x6ecb('0x2'));var BPromise=require(_0x6ecb('0x3'));var rs=require(_0x6ecb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ecb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6ecb('0x6'));var config=require(_0x6ecb('0x7'));var jayson=require(_0x6ecb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2cef4b,_0x1d015f,_0x217e6b){return new BPromise(function(_0x2d8621,_0x2866b5){return client[_0x6ecb('0x9')](_0x2cef4b,_0x217e6b)['then'](function(_0x473b08){logger['info'](_0x6ecb('0xa'),_0x1d015f,_0x6ecb('0xb'));logger[_0x6ecb('0xc')](_0x6ecb('0xd'),_0x1d015f,_0x6ecb('0xb'),JSON['stringify'](_0x473b08));if(_0x473b08[_0x6ecb('0xe')]){if(_0x473b08[_0x6ecb('0xe')][_0x6ecb('0xf')]===0x1f4){logger[_0x6ecb('0xe')]('Cdr,\x20%s,\x20%s',_0x1d015f,_0x473b08[_0x6ecb('0xe')]['message']);return _0x2866b5(_0x473b08[_0x6ecb('0xe')][_0x6ecb('0x10')]);}logger['error'](_0x6ecb('0xa'),_0x1d015f,_0x473b08[_0x6ecb('0xe')]['message']);return _0x2d8621(_0x473b08[_0x6ecb('0xe')]['message']);}else{logger[_0x6ecb('0x11')](_0x6ecb('0xa'),_0x1d015f,_0x6ecb('0xb'));_0x2d8621(_0x473b08[_0x6ecb('0x12')]['message']);}})[_0x6ecb('0x13')](function(_0x56b38d){logger['error']('Cdr,\x20%s,\x20%s',_0x1d015f,_0x56b38d);_0x2866b5(_0x56b38d);});});} \ No newline at end of file +var _0x138c=['../../config/logger','rpc','client','http','request','then','Cdr,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x413675,_0x39adde){var _0x1fc702=function(_0x5538d8){while(--_0x5538d8){_0x413675['push'](_0x413675['shift']());}};_0x1fc702(++_0x39adde);}(_0x138c,0x73));var _0xc138=function(_0xad1c7e,_0x5c40fd){_0xad1c7e=_0xad1c7e-0x0;var _0x3c9111=_0x138c[_0xad1c7e];return _0x3c9111;};'use strict';var _=require(_0xc138('0x0'));var util=require(_0xc138('0x1'));var moment=require('moment');var BPromise=require(_0xc138('0x2'));var rs=require(_0xc138('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc138('0x4'));var logger=require(_0xc138('0x5'))(_0xc138('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc138('0x7')][_0xc138('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x421f47,_0xe5ede0,_0x54046a){return new BPromise(function(_0x334fe1,_0x22031f){return client[_0xc138('0x9')](_0x421f47,_0x54046a)[_0xc138('0xa')](function(_0x32fc18){logger['info'](_0xc138('0xb'),_0xe5ede0,'request\x20sent');logger[_0xc138('0xc')]('Cdr,\x20%s,\x20%s,\x20%s',_0xe5ede0,_0xc138('0xd'),JSON[_0xc138('0xe')](_0x32fc18));if(_0x32fc18['error']){if(_0x32fc18['error']['code']===0x1f4){logger[_0xc138('0xf')](_0xc138('0xb'),_0xe5ede0,_0x32fc18[_0xc138('0xf')][_0xc138('0x10')]);return _0x22031f(_0x32fc18[_0xc138('0xf')][_0xc138('0x10')]);}logger[_0xc138('0xf')](_0xc138('0xb'),_0xe5ede0,_0x32fc18['error'][_0xc138('0x10')]);return _0x334fe1(_0x32fc18[_0xc138('0xf')][_0xc138('0x10')]);}else{logger[_0xc138('0x11')](_0xc138('0xb'),_0xe5ede0,_0xc138('0xd'));_0x334fe1(_0x32fc18[_0xc138('0x12')]['message']);}})[_0xc138('0x13')](function(_0x238d0b){logger[_0xc138('0xf')](_0xc138('0xb'),_0xe5ede0,_0x238d0b);_0x22031f(_0x238d0b);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index c467930..96c4bf6 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x59e4a9,_0x4dc536){var _0x2c5183=function(_0x31a0f2){while(--_0x31a0f2){_0x59e4a9['push'](_0x59e4a9['shift']());}};_0x2c5183(++_0x4dc536);}(_0xb10b,0x12a));var _0xbb10=function(_0x12d917,_0x59ddd4){_0x12d917=_0x12d917-0x0;var _0x576d1a=_0xb10b[_0x12d917];return _0x576d1a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x31ee6c,_0x3c4217){var _0x8fae3a=function(_0x569129){while(--_0x569129){_0x31ee6c['push'](_0x31ee6c['shift']());}};_0x8fae3a(++_0x3c4217);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 3a710ec..c473c44 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 _0xbc4f=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x22079f,_0x41a9d3){var _0x54628a=function(_0x231271){while(--_0x231271){_0x22079f['push'](_0x22079f['shift']());}};_0x54628a(++_0x41a9d3);}(_0xbc4f,0x148));var _0xfbc4=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xbc4f[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xfbc4('0x0'));module[_0xfbc4('0x1')]={'priority':{'type':Sequelize[_0xfbc4('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfbc4('0x3')},'appdata':{'type':Sequelize[_0xfbc4('0x4')]()},'description':{'type':Sequelize[_0xfbc4('0x5')]},'interval':{'type':Sequelize[_0xfbc4('0x5')],'defaultValue':_0xfbc4('0x6')}}; \ No newline at end of file +var _0x9536=['TEXT','STRING','noop'];(function(_0x50e701,_0x23cfc6){var _0x311157=function(_0x129779){while(--_0x129779){_0x50e701['push'](_0x50e701['shift']());}};_0x311157(++_0x23cfc6);}(_0x9536,0x94));var _0x6953=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0x9536[_0x2ecc65];return _0x103cc3;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6953('0x0')],'allowNull':![],'defaultValue':_0x6953('0x1')},'appdata':{'type':Sequelize[_0x6953('0x2')]()},'description':{'type':Sequelize[_0x6953('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index e55402a..399128f 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 _0x9bb4=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','keys','filters','intersection','query','attributes','fields','length','includeAll','include','merge','catch','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9bb4,0xd5));var _0x49bb=function(_0x23fee6,_0x58969a){_0x23fee6=_0x23fee6-0x0;var _0x4bed2f=_0x9bb4[_0x23fee6];return _0x4bed2f;};'use strict';var emlformat=require(_0x49bb('0x0'));var rimraf=require(_0x49bb('0x1'));var zipdir=require(_0x49bb('0x2'));var jsonpatch=require(_0x49bb('0x3'));var rp=require(_0x49bb('0x4'));var moment=require(_0x49bb('0x5'));var BPromise=require(_0x49bb('0x6'));var Mustache=require(_0x49bb('0x7'));var util=require(_0x49bb('0x8'));var path=require('path');var sox=require(_0x49bb('0x9'));var csv=require(_0x49bb('0xa'));var ejs=require(_0x49bb('0xb'));var fs=require('fs');var fs_extra=require(_0x49bb('0xc'));var _=require('lodash');var squel=require(_0x49bb('0xd'));var crypto=require(_0x49bb('0xe'));var jsforce=require(_0x49bb('0xf'));var deskjs=require(_0x49bb('0x10'));var toCsv=require(_0x49bb('0xa'));var querystring=require('querystring');var Papa=require(_0x49bb('0x11'));var Redis=require('ioredis');var authService=require(_0x49bb('0x12'));var qs=require(_0x49bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49bb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x49bb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x49bb('0x16'));var db=require(_0x49bb('0x17'))['db'];function respondWithStatusCode(_0xfab080,_0x3b85fc){_0x3b85fc=_0x3b85fc||0xcc;return function(_0x1ff6d1){if(_0x1ff6d1){return _0xfab080[_0x49bb('0x18')](_0x3b85fc);}return _0xfab080[_0x49bb('0x19')](_0x3b85fc)[_0x49bb('0x1a')]();};}function respondWithResult(_0x3beb36,_0x59472f){_0x59472f=_0x59472f||0xc8;return function(_0x13c850){if(_0x13c850){return _0x3beb36['status'](_0x59472f)[_0x49bb('0x1b')](_0x13c850);}};}function respondWithFilteredResult(_0x1f7573,_0x1f0210){return function(_0x230f20){if(_0x230f20){var _0x145d52=typeof _0x1f0210[_0x49bb('0x1c')]===_0x49bb('0x1d')&&typeof _0x1f0210[_0x49bb('0x1e')]==='undefined';var _0x2d76be=_0x230f20[_0x49bb('0x1f')];var _0x5b45c0=_0x145d52?0x0:_0x1f0210[_0x49bb('0x1c')];var _0x3d41f2=_0x145d52?_0x230f20['count']:_0x1f0210[_0x49bb('0x1c')]+_0x1f0210[_0x49bb('0x1e')];var _0x4af5e0;if(_0x3d41f2>=_0x2d76be){_0x3d41f2=_0x2d76be;_0x4af5e0=0xc8;}else{_0x4af5e0=0xce;}_0x1f7573[_0x49bb('0x19')](_0x4af5e0);return _0x1f7573[_0x49bb('0x20')]('Content-Range',_0x5b45c0+'-'+_0x3d41f2+'/'+_0x2d76be)[_0x49bb('0x1b')](_0x230f20);}return null;};}function patchUpdates(_0x5387ed){return function(_0x1728e9){try{jsonpatch['apply'](_0x1728e9,_0x5387ed,!![]);}catch(_0x47918a){return BPromise[_0x49bb('0x21')](_0x47918a);}return _0x1728e9['save']();};}function saveUpdates(_0x5b18f0,_0x16b8fa){return function(_0x1ade8b){if(_0x1ade8b){return _0x1ade8b[_0x49bb('0x22')](_0x5b18f0)[_0x49bb('0x23')](function(_0x4f2764){return _0x4f2764;});}return null;};}function removeEntity(_0x490c3e,_0x5cacdb){return function(_0x4eae24){if(_0x4eae24){return _0x4eae24['destroy']()[_0x49bb('0x23')](function(){_0x490c3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6dac61,_0x42fd72){return function(_0x341bd9){if(!_0x341bd9){_0x6dac61[_0x49bb('0x18')](0x194);}return _0x341bd9;};}function handleError(_0xa64ee6,_0x59225e){_0x59225e=_0x59225e||0x1f4;return function(_0x323be7){logger[_0x49bb('0x24')](_0x323be7[_0x49bb('0x25')]);if(_0x323be7[_0x49bb('0x26')]){delete _0x323be7['name'];}_0xa64ee6[_0x49bb('0x19')](_0x59225e)[_0x49bb('0x27')](_0x323be7);};}exports[_0x49bb('0x28')]=function(_0x47540c,_0x51cc97){var _0x1f0c73={'raw':!![],'where':{'id':_0x47540c[_0x49bb('0x29')]['id']}},_0x3207e9={};_0x3207e9[_0x49bb('0x2a')]=_['keys'](db[_0x49bb('0x2b')][_0x49bb('0x2c')]);_0x3207e9['query']=_[_0x49bb('0x2d')](_0x47540c['query']);_0x3207e9[_0x49bb('0x2e')]=_[_0x49bb('0x2f')](_0x3207e9['model'],_0x3207e9[_0x49bb('0x30')]);_0x1f0c73[_0x49bb('0x31')]=_['intersection'](_0x3207e9[_0x49bb('0x2a')],qs[_0x49bb('0x32')](_0x47540c[_0x49bb('0x30')][_0x49bb('0x32')]));_0x1f0c73[_0x49bb('0x31')]=_0x1f0c73[_0x49bb('0x31')][_0x49bb('0x33')]?_0x1f0c73[_0x49bb('0x31')]:_0x3207e9['model'];if(_0x47540c[_0x49bb('0x30')][_0x49bb('0x34')]){_0x1f0c73[_0x49bb('0x35')]=[{'all':!![]}];}_0x1f0c73=_[_0x49bb('0x36')]({},_0x1f0c73,_0x47540c['options']);return db[_0x49bb('0x2b')]['find'](_0x1f0c73)[_0x49bb('0x23')](handleEntityNotFound(_0x51cc97,null))['then'](respondWithResult(_0x51cc97,null))[_0x49bb('0x37')](handleError(_0x51cc97,null));};exports['update']=function(_0x302624,_0x1a24f3){if(_0x302624['body']['id']){delete _0x302624['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x302624['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x1a24f3,null))[_0x49bb('0x23')](saveUpdates(_0x302624[_0x49bb('0x38')],null))[_0x49bb('0x23')](respondWithResult(_0x1a24f3,null))[_0x49bb('0x37')](handleError(_0x1a24f3,null));};exports[_0x49bb('0x39')]=function(_0x1025c5,_0x505171){return db['ChatApplication'][_0x49bb('0x3a')]({'where':{'id':_0x1025c5[_0x49bb('0x29')]['id']}})['then'](handleEntityNotFound(_0x505171,null))[_0x49bb('0x23')](removeEntity(_0x505171,null))[_0x49bb('0x37')](handleError(_0x505171,null));}; \ No newline at end of file +var _0xb010=['save','update','then','destroy','error','name','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','length','includeAll','merge','find','body','catch','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x4179b3,_0x2eaff2){var _0x5b5c7e=function(_0x568341){while(--_0x568341){_0x4179b3['push'](_0x4179b3['shift']());}};_0x5b5c7e(++_0x2eaff2);}(_0xb010,0x8b));var _0x0b01=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb010[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b01('0x1'));var rp=require('request-promise');var moment=require(_0x0b01('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0b01('0x3'));var util=require(_0x0b01('0x4'));var path=require(_0x0b01('0x5'));var sox=require(_0x0b01('0x6'));var csv=require(_0x0b01('0x7'));var ejs=require(_0x0b01('0x8'));var fs=require('fs');var fs_extra=require(_0x0b01('0x9'));var _=require(_0x0b01('0xa'));var squel=require(_0x0b01('0xb'));var crypto=require(_0x0b01('0xc'));var jsforce=require(_0x0b01('0xd'));var deskjs=require(_0x0b01('0xe'));var toCsv=require(_0x0b01('0x7'));var querystring=require('querystring');var Papa=require(_0x0b01('0xf'));var Redis=require(_0x0b01('0x10'));var authService=require(_0x0b01('0x11'));var qs=require(_0x0b01('0x12'));var as=require(_0x0b01('0x13'));var hardwareService=require(_0x0b01('0x14'));var logger=require(_0x0b01('0x15'))(_0x0b01('0x16'));var utils=require(_0x0b01('0x17'));var config=require(_0x0b01('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b01('0x19'))['db'];function respondWithStatusCode(_0x462720,_0x8834b5){_0x8834b5=_0x8834b5||0xcc;return function(_0x1da264){if(_0x1da264){return _0x462720[_0x0b01('0x1a')](_0x8834b5);}return _0x462720[_0x0b01('0x1b')](_0x8834b5)[_0x0b01('0x1c')]();};}function respondWithResult(_0x53372e,_0xfc0d4f){_0xfc0d4f=_0xfc0d4f||0xc8;return function(_0x3fc8cb){if(_0x3fc8cb){return _0x53372e[_0x0b01('0x1b')](_0xfc0d4f)[_0x0b01('0x1d')](_0x3fc8cb);}};}function respondWithFilteredResult(_0x4074c2,_0x2448a4){return function(_0x24c0d4){if(_0x24c0d4){var _0x2348ef=typeof _0x2448a4[_0x0b01('0x1e')]===_0x0b01('0x1f')&&typeof _0x2448a4[_0x0b01('0x20')]===_0x0b01('0x1f');var _0x55aceb=_0x24c0d4[_0x0b01('0x21')];var _0x21139b=_0x2348ef?0x0:_0x2448a4[_0x0b01('0x1e')];var _0x4a288c=_0x2348ef?_0x24c0d4['count']:_0x2448a4['offset']+_0x2448a4[_0x0b01('0x20')];var _0x217eac;if(_0x4a288c>=_0x55aceb){_0x4a288c=_0x55aceb;_0x217eac=0xc8;}else{_0x217eac=0xce;}_0x4074c2[_0x0b01('0x1b')](_0x217eac);return _0x4074c2[_0x0b01('0x22')](_0x0b01('0x23'),_0x21139b+'-'+_0x4a288c+'/'+_0x55aceb)[_0x0b01('0x1d')](_0x24c0d4);}return null;};}function patchUpdates(_0x5a68c1){return function(_0x29dae4){try{jsonpatch[_0x0b01('0x24')](_0x29dae4,_0x5a68c1,!![]);}catch(_0xc91328){return BPromise[_0x0b01('0x25')](_0xc91328);}return _0x29dae4[_0x0b01('0x26')]();};}function saveUpdates(_0x589324,_0x5f4cf1){return function(_0x3e966c){if(_0x3e966c){return _0x3e966c[_0x0b01('0x27')](_0x589324)[_0x0b01('0x28')](function(_0x220615){return _0x220615;});}return null;};}function removeEntity(_0x51bbaf,_0x5034fc){return function(_0x47f13a){if(_0x47f13a){return _0x47f13a[_0x0b01('0x29')]()['then'](function(){_0x51bbaf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a165f,_0x80c47){return function(_0xed5e34){if(!_0xed5e34){_0x2a165f[_0x0b01('0x1a')](0x194);}return _0xed5e34;};}function handleError(_0x313f9c,_0x1c538e){_0x1c538e=_0x1c538e||0x1f4;return function(_0x450427){logger[_0x0b01('0x2a')](_0x450427['stack']);if(_0x450427[_0x0b01('0x2b')]){delete _0x450427[_0x0b01('0x2b')];}_0x313f9c[_0x0b01('0x1b')](_0x1c538e)['send'](_0x450427);};}exports['show']=function(_0x29799c,_0x4b1e21){var _0x48f7a6={'raw':!![],'where':{'id':_0x29799c[_0x0b01('0x2c')]['id']}},_0x40f202={};_0x40f202[_0x0b01('0x2d')]=_['keys'](db[_0x0b01('0x2e')][_0x0b01('0x2f')]);_0x40f202[_0x0b01('0x30')]=_[_0x0b01('0x31')](_0x29799c[_0x0b01('0x30')]);_0x40f202[_0x0b01('0x32')]=_[_0x0b01('0x33')](_0x40f202[_0x0b01('0x2d')],_0x40f202['query']);_0x48f7a6[_0x0b01('0x34')]=_[_0x0b01('0x33')](_0x40f202[_0x0b01('0x2d')],qs['fields'](_0x29799c[_0x0b01('0x30')]['fields']));_0x48f7a6[_0x0b01('0x34')]=_0x48f7a6['attributes'][_0x0b01('0x35')]?_0x48f7a6['attributes']:_0x40f202[_0x0b01('0x2d')];if(_0x29799c[_0x0b01('0x30')][_0x0b01('0x36')]){_0x48f7a6['include']=[{'all':!![]}];}_0x48f7a6=_[_0x0b01('0x37')]({},_0x48f7a6,_0x29799c['options']);return db[_0x0b01('0x2e')][_0x0b01('0x38')](_0x48f7a6)[_0x0b01('0x28')](handleEntityNotFound(_0x4b1e21,null))[_0x0b01('0x28')](respondWithResult(_0x4b1e21,null))['catch'](handleError(_0x4b1e21,null));};exports['update']=function(_0x5b7743,_0x3b5dbb){if(_0x5b7743['body']['id']){delete _0x5b7743[_0x0b01('0x39')]['id'];}return db['ChatApplication'][_0x0b01('0x38')]({'where':{'id':_0x5b7743[_0x0b01('0x2c')]['id']}})[_0x0b01('0x28')](handleEntityNotFound(_0x3b5dbb,null))[_0x0b01('0x28')](saveUpdates(_0x5b7743[_0x0b01('0x39')],null))['then'](respondWithResult(_0x3b5dbb,null))['catch'](handleError(_0x3b5dbb,null));};exports[_0x0b01('0x29')]=function(_0x3c0dc3,_0xd1f7c){return db['ChatApplication']['find']({'where':{'id':_0x3c0dc3[_0x0b01('0x2c')]['id']}})['then'](handleEntityNotFound(_0xd1f7c,null))[_0x0b01('0x28')](removeEntity(_0xd1f7c,null))[_0x0b01('0x3a')](handleError(_0xd1f7c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index a899f3e..1158f1d 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 _0x25aa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash'];(function(_0x30bd36,_0x1b934b){var _0x5976b1=function(_0x28ee2d){while(--_0x28ee2d){_0x30bd36['push'](_0x30bd36['shift']());}};_0x5976b1(++_0x1b934b);}(_0x25aa,0x151));var _0xa25a=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x25aa[_0x1b745b];return _0x120a9d;};'use strict';var _=require(_0xa25a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa25a('0x1'));var moment=require(_0xa25a('0x2'));var BPromise=require(_0xa25a('0x3'));var rp=require(_0xa25a('0x4'));var fs=require('fs');var path=require(_0xa25a('0x5'));var rimraf=require(_0xa25a('0x6'));var config=require(_0xa25a('0x7'));var attributes=require(_0xa25a('0x8'));module[_0xa25a('0x9')]=function(_0x2d8e23,_0x1d2ee3){return _0x2d8e23[_0xa25a('0xa')](_0xa25a('0xb'),attributes,{'tableName':_0xa25a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcd0a=['../../config/environment','define','ChatApplication','chat_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x386bfb,_0x5bbb80){var _0x596ab4=function(_0x444508){while(--_0x444508){_0x386bfb['push'](_0x386bfb['shift']());}};_0x596ab4(++_0x5bbb80);}(_0xcd0a,0xee));var _0xacd0=function(_0xd9c569,_0xf0b007){_0xd9c569=_0xd9c569-0x0;var _0x5d23b9=_0xcd0a[_0xd9c569];return _0x5d23b9;};'use strict';var _=require(_0xacd0('0x0'));var util=require(_0xacd0('0x1'));var logger=require(_0xacd0('0x2'))(_0xacd0('0x3'));var moment=require(_0xacd0('0x4'));var BPromise=require(_0xacd0('0x5'));var rp=require(_0xacd0('0x6'));var fs=require('fs');var path=require(_0xacd0('0x7'));var rimraf=require(_0xacd0('0x8'));var config=require(_0xacd0('0x9'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x5d911e,_0x10f84f){return _0x5d911e[_0xacd0('0xa')](_0xacd0('0xb'),attributes,{'tableName':_0xacd0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 c8c3399..6782a73 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 _0x803d=['rpc','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x803d,0x19d));var _0xd803=function(_0x2788aa,_0x1ff870){_0x2788aa=_0x2788aa-0x0;var _0x16b6ac=_0x803d[_0x2788aa];return _0x16b6ac;};'use strict';var _=require(_0xd803('0x0'));var util=require('util');var moment=require(_0xd803('0x1'));var BPromise=require('bluebird');var rs=require(_0xd803('0x2'));var fs=require('fs');var Redis=require(_0xd803('0x3'));var db=require(_0xd803('0x4'))['db'];var utils=require(_0xd803('0x5'));var logger=require(_0xd803('0x6'))(_0xd803('0x7'));var config=require(_0xd803('0x8'));var jayson=require(_0xd803('0x9'));var client=jayson[_0xd803('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28e2db,_0x57cfb0,_0x545fa3){return new BPromise(function(_0x218a10,_0x2b2d08){return client['request'](_0x28e2db,_0x545fa3)[_0xd803('0xb')](function(_0x2d3aa8){logger[_0xd803('0xc')](_0xd803('0xd'),_0x57cfb0,'request\x20sent');logger[_0xd803('0xe')](_0xd803('0xf'),_0x57cfb0,'request\x20sent',JSON['stringify'](_0x2d3aa8));if(_0x2d3aa8['error']){if(_0x2d3aa8['error']['code']===0x1f4){logger[_0xd803('0x10')](_0xd803('0xd'),_0x57cfb0,_0x2d3aa8[_0xd803('0x10')][_0xd803('0x11')]);return _0x2b2d08(_0x2d3aa8[_0xd803('0x10')][_0xd803('0x11')]);}logger[_0xd803('0x10')]('ChatApplication,\x20%s,\x20%s',_0x57cfb0,_0x2d3aa8[_0xd803('0x10')]['message']);return _0x218a10(_0x2d3aa8[_0xd803('0x10')][_0xd803('0x11')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x57cfb0,_0xd803('0x12'));_0x218a10(_0x2d3aa8[_0xd803('0x13')][_0xd803('0x11')]);}})[_0xd803('0x14')](function(_0x4d0290){logger[_0xd803('0x10')](_0xd803('0xd'),_0x57cfb0,_0x4d0290);_0x2b2d08(_0x4d0290);});});} \ No newline at end of file +var _0x29fc=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1de880,_0x3eefab){var _0x56004d=function(_0x3a4ebc){while(--_0x3a4ebc){_0x1de880['push'](_0x1de880['shift']());}};_0x56004d(++_0x3eefab);}(_0x29fc,0x75));var _0xc29f=function(_0x1b1cd7,_0x277482){_0x1b1cd7=_0x1b1cd7-0x0;var _0x641bf7=_0x29fc[_0x1b1cd7];return _0x641bf7;};'use strict';var _=require(_0xc29f('0x0'));var util=require(_0xc29f('0x1'));var moment=require(_0xc29f('0x2'));var BPromise=require(_0xc29f('0x3'));var rs=require(_0xc29f('0x4'));var fs=require('fs');var Redis=require(_0xc29f('0x5'));var db=require(_0xc29f('0x6'))['db'];var utils=require(_0xc29f('0x7'));var logger=require(_0xc29f('0x8'))(_0xc29f('0x9'));var config=require(_0xc29f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc29f('0xb')][_0xc29f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x348087,_0x514b97,_0x85a0a2){return new BPromise(function(_0x5c82cb,_0x7e76f4){return client[_0xc29f('0xd')](_0x348087,_0x85a0a2)[_0xc29f('0xe')](function(_0x5ab444){logger[_0xc29f('0xf')](_0xc29f('0x10'),_0x514b97,_0xc29f('0x11'));logger[_0xc29f('0x12')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x514b97,'request\x20sent',JSON[_0xc29f('0x13')](_0x5ab444));if(_0x5ab444[_0xc29f('0x14')]){if(_0x5ab444[_0xc29f('0x14')][_0xc29f('0x15')]===0x1f4){logger[_0xc29f('0x14')](_0xc29f('0x10'),_0x514b97,_0x5ab444[_0xc29f('0x14')]['message']);return _0x7e76f4(_0x5ab444[_0xc29f('0x14')]['message']);}logger[_0xc29f('0x14')](_0xc29f('0x10'),_0x514b97,_0x5ab444[_0xc29f('0x14')]['message']);return _0x5c82cb(_0x5ab444[_0xc29f('0x14')][_0xc29f('0x16')]);}else{logger[_0xc29f('0xf')](_0xc29f('0x10'),_0x514b97,_0xc29f('0x11'));_0x5c82cb(_0x5ab444[_0xc29f('0x17')][_0xc29f('0x16')]);}})[_0xc29f('0x18')](function(_0x5e441e){logger[_0xc29f('0x14')]('ChatApplication,\x20%s,\x20%s',_0x514b97,_0x5e441e);_0x7e76f4(_0x5e441e);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 261de09..eef7f2d 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 _0x627a=['get','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller'];(function(_0x2fe0ca,_0x148d97){var _0xccce3a=function(_0x42bdde){while(--_0x42bdde){_0x2fe0ca['push'](_0x2fe0ca['shift']());}};_0xccce3a(++_0x148d97);}(_0x627a,0x1e4));var _0xa627=function(_0x235628,_0x308ed0){_0x235628=_0x235628-0x0;var _0x4a4325=_0x627a[_0x235628];return _0x4a4325;};'use strict';var multer=require(_0xa627('0x0'));var util=require(_0xa627('0x1'));var path=require(_0xa627('0x2'));var timeout=require('connect-timeout');var express=require(_0xa627('0x3'));var router=express[_0xa627('0x4')]();var fs_extra=require(_0xa627('0x5'));var auth=require(_0xa627('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa627('0x7'));var controller=require(_0xa627('0x8'));router[_0xa627('0x9')](_0xa627('0xa'),auth[_0xa627('0xb')](),controller[_0xa627('0xc')]);router['put'](_0xa627('0xa'),auth[_0xa627('0xb')](),controller[_0xa627('0xd')]);router[_0xa627('0xe')](_0xa627('0xa'),auth[_0xa627('0xb')](),controller[_0xa627('0xf')]);module[_0xa627('0x10')]=router; \ No newline at end of file +var _0xcdba=['get','/:id','show','isAuthenticated','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller'];(function(_0x1e0caf,_0xd1c0fd){var _0x1ba383=function(_0x31d053){while(--_0x31d053){_0x1e0caf['push'](_0x1e0caf['shift']());}};_0x1ba383(++_0xd1c0fd);}(_0xcdba,0x1ba));var _0xacdb=function(_0x35b34e,_0x435826){_0x35b34e=_0x35b34e-0x0;var _0x22c8a6=_0xcdba[_0x35b34e];return _0x22c8a6;};'use strict';var multer=require(_0xacdb('0x0'));var util=require(_0xacdb('0x1'));var path=require(_0xacdb('0x2'));var timeout=require('connect-timeout');var express=require(_0xacdb('0x3'));var router=express[_0xacdb('0x4')]();var fs_extra=require(_0xacdb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacdb('0x6'));var config=require('../../config/environment');var controller=require(_0xacdb('0x7'));router[_0xacdb('0x8')](_0xacdb('0x9'),auth['isAuthenticated'](),controller[_0xacdb('0xa')]);router['put'](_0xacdb('0x9'),auth[_0xacdb('0xb')](),controller[_0xacdb('0xc')]);router['delete'](_0xacdb('0x9'),auth[_0xacdb('0xb')](),controller[_0xacdb('0xd')]);module[_0xacdb('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 e151c2d..919aeae 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 _0xf424=['BOOLEAN','exports','STRING'];(function(_0x3e2fc7,_0x5ecda4){var _0x352421=function(_0x55b8c9){while(--_0x55b8c9){_0x3e2fc7['push'](_0x3e2fc7['shift']());}};_0x352421(++_0x5ecda4);}(_0xf424,0x15d));var _0x4f42=function(_0x42160c,_0x30e856){_0x42160c=_0x42160c-0x0;var _0xdba9cb=_0xf424[_0x42160c];return _0xdba9cb;};'use strict';var Sequelize=require('sequelize');module[_0x4f42('0x0')]={'name':{'type':Sequelize[_0x4f42('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4f42('0x1')]},'write':{'type':Sequelize[_0x4f42('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3d49=['BOOLEAN','exports','STRING'];(function(_0x296ba4,_0xeada14){var _0x5e13d4=function(_0x120385){while(--_0x120385){_0x296ba4['push'](_0x296ba4['shift']());}};_0x5e13d4(++_0xeada14);}(_0x3d49,0x151));var _0x93d4=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0x3d49[_0x4b3e49];return _0x57e339;};'use strict';var Sequelize=require('sequelize');module[_0x93d4('0x0')]={'name':{'type':Sequelize[_0x93d4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x93d4('0x1')]},'write':{'type':Sequelize[_0x93d4('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 191fcb1..c281583 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 _0x774e=['destroy','error','stack','name','send','map','ChatGroup','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','catch','show','filters','length','find','create','body','describe','ChatInternalMessage','params','toInteger','addMembers','ids','omit','getMembers','findOne','removeMembers','ChatGroupId','getMessages','order','$gte','format','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update'];(function(_0x163438,_0x5e4998){var _0x40cac2=function(_0x4e0e4f){while(--_0x4e0e4f){_0x163438['push'](_0x163438['shift']());}};_0x40cac2(++_0x5e4998);}(_0x774e,0x149));var _0xe774=function(_0x268566,_0x4dc90a){_0x268566=_0x268566-0x0;var _0x46cb1f=_0x774e[_0x268566];return _0x46cb1f;};'use strict';var emlformat=require(_0xe774('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe774('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe774('0x2'));var moment=require(_0xe774('0x3'));var BPromise=require(_0xe774('0x4'));var Mustache=require(_0xe774('0x5'));var util=require(_0xe774('0x6'));var path=require(_0xe774('0x7'));var sox=require(_0xe774('0x8'));var csv=require(_0xe774('0x9'));var ejs=require(_0xe774('0xa'));var fs=require('fs');var fs_extra=require(_0xe774('0xb'));var _=require(_0xe774('0xc'));var squel=require('squel');var crypto=require(_0xe774('0xd'));var jsforce=require(_0xe774('0xe'));var deskjs=require(_0xe774('0xf'));var toCsv=require(_0xe774('0x9'));var querystring=require(_0xe774('0x10'));var Papa=require(_0xe774('0x11'));var Redis=require(_0xe774('0x12'));var authService=require(_0xe774('0x13'));var qs=require(_0xe774('0x14'));var as=require(_0xe774('0x15'));var hardwareService=require(_0xe774('0x16'));var logger=require('../../config/logger')(_0xe774('0x17'));var utils=require(_0xe774('0x18'));var config=require(_0xe774('0x19'));var licenseUtil=require(_0xe774('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe774('0x1b')]=_[_0xe774('0x1c')](config[_0xe774('0x1b')],{'host':_0xe774('0x1d'),'port':0x18eb});var socket=require(_0xe774('0x1e'))(new Redis(config[_0xe774('0x1b')]));require(_0xe774('0x1f'))['register'](socket);function respondWithStatusCode(_0x1c7301,_0x3122c1){_0x3122c1=_0x3122c1||0xcc;return function(_0x443a87){if(_0x443a87){return _0x1c7301[_0xe774('0x20')](_0x3122c1);}return _0x1c7301[_0xe774('0x21')](_0x3122c1)[_0xe774('0x22')]();};}function respondWithResult(_0x5c91fa,_0x29076e){_0x29076e=_0x29076e||0xc8;return function(_0x1176b3){if(_0x1176b3){return _0x5c91fa[_0xe774('0x21')](_0x29076e)[_0xe774('0x23')](_0x1176b3);}};}function respondWithFilteredResult(_0x459a59,_0x9fe251){return function(_0x274fcf){if(_0x274fcf){var _0x9daf5c=typeof _0x9fe251[_0xe774('0x24')]==='undefined'&&typeof _0x9fe251[_0xe774('0x25')]===_0xe774('0x26');var _0x5de063=_0x274fcf[_0xe774('0x27')];var _0x13bf4b=_0x9daf5c?0x0:_0x9fe251[_0xe774('0x24')];var _0x5257e5=_0x9daf5c?_0x274fcf[_0xe774('0x27')]:_0x9fe251[_0xe774('0x24')]+_0x9fe251[_0xe774('0x25')];var _0x1cef8d;if(_0x5257e5>=_0x5de063){_0x5257e5=_0x5de063;_0x1cef8d=0xc8;}else{_0x1cef8d=0xce;}_0x459a59[_0xe774('0x21')](_0x1cef8d);return _0x459a59[_0xe774('0x28')]('Content-Range',_0x13bf4b+'-'+_0x5257e5+'/'+_0x5de063)[_0xe774('0x23')](_0x274fcf);}return null;};}function patchUpdates(_0x1739d3){return function(_0x3e6f7c){try{jsonpatch['apply'](_0x3e6f7c,_0x1739d3,!![]);}catch(_0x132de7){return BPromise['reject'](_0x132de7);}return _0x3e6f7c[_0xe774('0x29')]();};}function saveUpdates(_0x446997,_0x4d0354){return function(_0x49a36b){if(_0x49a36b){return _0x49a36b[_0xe774('0x2a')](_0x446997)['then'](function(_0x50dab2){return _0x50dab2;});}return null;};}function removeEntity(_0x2dc511,_0x6e2081){return function(_0x2059fb){if(_0x2059fb){return _0x2059fb[_0xe774('0x2b')]()['then'](function(){_0x2dc511[_0xe774('0x21')](0xcc)[_0xe774('0x22')]();});}};}function handleEntityNotFound(_0x2f5464,_0x1936ed){return function(_0x8348b4){if(!_0x8348b4){_0x2f5464['sendStatus'](0x194);}return _0x8348b4;};}function handleError(_0x39c89f,_0x413c1d){_0x413c1d=_0x413c1d||0x1f4;return function(_0x8d1035){logger[_0xe774('0x2c')](_0x8d1035[_0xe774('0x2d')]);if(_0x8d1035['name']){delete _0x8d1035[_0xe774('0x2e')];}_0x39c89f[_0xe774('0x21')](_0x413c1d)[_0xe774('0x2f')](_0x8d1035);};}exports['index']=function(_0x1419ba,_0x35bf28){var _0x402174={},_0x33e6ed={},_0x58d143={'count':0x0,'rows':[]};var _0x567831=_[_0xe774('0x30')](db[_0xe774('0x31')][_0xe774('0x32')],function(_0x2a9e77){return{'name':_0x2a9e77['fieldName'],'type':_0x2a9e77[_0xe774('0x33')][_0xe774('0x34')]};});_0x33e6ed[_0xe774('0x35')]=_[_0xe774('0x30')](_0x567831,_0xe774('0x2e'));_0x33e6ed[_0xe774('0x36')]=_[_0xe774('0x37')](_0x1419ba['query']);_0x33e6ed['filters']=_['intersection'](_0x33e6ed[_0xe774('0x35')],_0x33e6ed['query']);_0x402174[_0xe774('0x38')]=_[_0xe774('0x39')](_0x33e6ed[_0xe774('0x35')],qs['fields'](_0x1419ba[_0xe774('0x36')][_0xe774('0x3a')]));_0x402174['attributes']=_0x402174[_0xe774('0x38')]['length']?_0x402174[_0xe774('0x38')]:_0x33e6ed[_0xe774('0x35')];if(!_0x1419ba['query'][_0xe774('0x3b')](_0xe774('0x3c'))){_0x402174[_0xe774('0x25')]=qs[_0xe774('0x25')](_0x1419ba[_0xe774('0x36')]['limit']);_0x402174['offset']=qs[_0xe774('0x24')](_0x1419ba[_0xe774('0x36')][_0xe774('0x24')]);}_0x402174['order']=qs[_0xe774('0x3d')](_0x1419ba[_0xe774('0x36')][_0xe774('0x3d')]);_0x402174['where']=qs['filters'](_[_0xe774('0x3e')](_0x1419ba['query'],_0x33e6ed['filters']),_0x567831);if(_0x1419ba[_0xe774('0x36')][_0xe774('0x3f')]){_0x402174[_0xe774('0x40')]=_[_0xe774('0x41')](_0x402174[_0xe774('0x40')],{'$or':_['map'](_0x567831,function(_0x36b290){if(_0x36b290['type']!==_0xe774('0x42')){var _0x2a82cc={};_0x2a82cc[_0x36b290['name']]={'$like':'%'+_0x1419ba['query']['filter']+'%'};return _0x2a82cc;}})});}_0x402174=_[_0xe774('0x41')]({},_0x402174,_0x1419ba[_0xe774('0x43')]);var _0x4b432b={'where':_0x402174['where']};return db['ChatGroup'][_0xe774('0x27')](_0x4b432b)[_0xe774('0x44')](function(_0x317bb3){_0x58d143[_0xe774('0x27')]=_0x317bb3;if(_0x1419ba[_0xe774('0x36')][_0xe774('0x45')]){_0x402174[_0xe774('0x46')]=[{'all':!![]}];}return db[_0xe774('0x31')]['findAll'](_0x402174);})[_0xe774('0x44')](function(_0x17f712){_0x58d143['rows']=_0x17f712;return _0x58d143;})['then'](respondWithFilteredResult(_0x35bf28,_0x402174))[_0xe774('0x47')](handleError(_0x35bf28,null));};exports[_0xe774('0x48')]=function(_0x35518d,_0x2471e2){var _0x3670b9={'raw':!![],'where':{'id':_0x35518d['params']['id']}},_0x4319bb={};_0x4319bb['model']=_[_0xe774('0x37')](db[_0xe774('0x31')]['rawAttributes']);_0x4319bb[_0xe774('0x36')]=_['keys'](_0x35518d[_0xe774('0x36')]);_0x4319bb[_0xe774('0x49')]=_['intersection'](_0x4319bb['model'],_0x4319bb[_0xe774('0x36')]);_0x3670b9['attributes']=_['intersection'](_0x4319bb[_0xe774('0x35')],qs[_0xe774('0x3a')](_0x35518d[_0xe774('0x36')]['fields']));_0x3670b9[_0xe774('0x38')]=_0x3670b9['attributes'][_0xe774('0x4a')]?_0x3670b9[_0xe774('0x38')]:_0x4319bb[_0xe774('0x35')];if(_0x35518d[_0xe774('0x36')]['includeAll']){_0x3670b9[_0xe774('0x46')]=[{'all':!![]}];}_0x3670b9=_[_0xe774('0x41')]({},_0x3670b9,_0x35518d[_0xe774('0x43')]);return db['ChatGroup'][_0xe774('0x4b')](_0x3670b9)['then'](handleEntityNotFound(_0x2471e2,null))['then'](respondWithResult(_0x2471e2,null))[_0xe774('0x47')](handleError(_0x2471e2,null));};exports[_0xe774('0x4c')]=function(_0x1ca962,_0x148421){return db[_0xe774('0x31')][_0xe774('0x4c')](_0x1ca962[_0xe774('0x4d')],{})[_0xe774('0x44')](respondWithResult(_0x148421,0xc9))[_0xe774('0x47')](handleError(_0x148421,null));};exports[_0xe774('0x2a')]=function(_0x59b2b6,_0x21800c){if(_0x59b2b6[_0xe774('0x4d')]['id']){delete _0x59b2b6[_0xe774('0x4d')]['id'];}return db[_0xe774('0x31')][_0xe774('0x4b')]({'where':{'id':_0x59b2b6['params']['id']}})[_0xe774('0x44')](handleEntityNotFound(_0x21800c,null))['then'](saveUpdates(_0x59b2b6[_0xe774('0x4d')],null))[_0xe774('0x44')](respondWithResult(_0x21800c,null))[_0xe774('0x47')](handleError(_0x21800c,null));};exports[_0xe774('0x2b')]=function(_0x5ba3ed,_0x270cf9){return db[_0xe774('0x31')][_0xe774('0x4b')]({'where':{'id':_0x5ba3ed['params']['id']}})[_0xe774('0x44')](handleEntityNotFound(_0x270cf9,null))[_0xe774('0x44')](removeEntity(_0x270cf9,null))['catch'](handleError(_0x270cf9,null));};exports[_0xe774('0x4e')]=function(_0x73d10b,_0x1fe5bf){return db[_0xe774('0x31')][_0xe774('0x4e')]()[_0xe774('0x44')](respondWithResult(_0x1fe5bf,null))[_0xe774('0x47')](handleError(_0x1fe5bf,null));};exports['getUnread']=function(_0x58fc68,_0x4b5dfe,_0x4a41b0){return db[_0xe774('0x4f')][_0xe774('0x27')]({'where':{'ChatGroupId':_0x58fc68[_0xe774('0x50')]['id'],'ToId':_0x58fc68['user']['id'],'read':![]}})[_0xe774('0x44')](function(_0x1c61c0){return{'id':_[_0xe774('0x51')](_0x58fc68['params']['id']),'count':_0x1c61c0};})['then'](respondWithResult(_0x4b5dfe,null))[_0xe774('0x47')](handleError(_0x4b5dfe,null));};exports['addMembers']=function(_0x4e3b5b,_0x194497,_0x1a6f0f){return db[_0xe774('0x31')]['find']({'where':{'id':_0x4e3b5b['params']['id']}})[_0xe774('0x44')](handleEntityNotFound(_0x194497,null))['then'](function(_0x2344a6){if(_0x2344a6){return _0x2344a6[_0xe774('0x52')](_0x4e3b5b[_0xe774('0x4d')][_0xe774('0x53')],_[_0xe774('0x54')](_0x4e3b5b[_0xe774('0x4d')],[_0xe774('0x53'),'id'])||{});}})[_0xe774('0x44')](respondWithResult(_0x194497,null))[_0xe774('0x47')](handleError(_0x194497,null));};exports[_0xe774('0x55')]=function(_0x4221d1,_0x4da609,_0x11bc7f){var _0x4995c9={};var _0x33ce56={};var _0xa022f1;var _0x3cc4b8;return db[_0xe774('0x31')][_0xe774('0x56')]({'where':{'id':_0x4221d1[_0xe774('0x50')]['id']}})['then'](handleEntityNotFound(_0x4da609,null))[_0xe774('0x44')](function(_0x1a818e){if(_0x1a818e){_0xa022f1=_0x1a818e;_0x33ce56[_0xe774('0x35')]=_[_0xe774('0x37')](db['User'][_0xe774('0x32')]);_0x33ce56['query']=_['keys'](_0x4221d1[_0xe774('0x36')]);_0x33ce56[_0xe774('0x49')]=_[_0xe774('0x39')](_0x33ce56[_0xe774('0x35')],_0x33ce56[_0xe774('0x36')]);_0x4995c9['attributes']=_[_0xe774('0x39')](_0x33ce56[_0xe774('0x35')],qs[_0xe774('0x3a')](_0x4221d1[_0xe774('0x36')]['fields']));_0x4995c9['attributes']=_0x4995c9['attributes'][_0xe774('0x4a')]?_0x4995c9['attributes']:_0x33ce56[_0xe774('0x35')];_0x4995c9['order']=qs['sort'](_0x4221d1[_0xe774('0x36')][_0xe774('0x3d')]);_0x4995c9[_0xe774('0x40')]=qs['filters'](_['pick'](_0x4221d1[_0xe774('0x36')],_0x33ce56[_0xe774('0x49')]));if(_0x4221d1[_0xe774('0x36')][_0xe774('0x3f')]){_0x4995c9['where']=_[_0xe774('0x41')](_0x4995c9[_0xe774('0x40')],{'$or':_[_0xe774('0x30')](_0x4995c9[_0xe774('0x38')],function(_0x334ae5){var _0x4a68cd={};_0x4a68cd[_0x334ae5]={'$like':'%'+_0x4221d1[_0xe774('0x36')][_0xe774('0x3f')]+'%'};return _0x4a68cd;})});}_0x4995c9=_[_0xe774('0x41')]({},_0x4995c9,_0x4221d1[_0xe774('0x43')]);return _0xa022f1[_0xe774('0x55')](_0x4995c9);}})[_0xe774('0x44')](function(_0x58cf91){if(_0x58cf91){_0x3cc4b8=_0x58cf91[_0xe774('0x4a')];if(!_0x4221d1['query'][_0xe774('0x3b')](_0xe774('0x3c'))){_0x4995c9[_0xe774('0x25')]=qs['limit'](_0x4221d1[_0xe774('0x36')][_0xe774('0x25')]);_0x4995c9[_0xe774('0x24')]=qs['offset'](_0x4221d1[_0xe774('0x36')][_0xe774('0x24')]);}return _0xa022f1['getMembers'](_0x4995c9);}})[_0xe774('0x44')](function(_0x57a140){if(_0x57a140){return _0x57a140?{'count':_0x3cc4b8,'rows':_0x57a140}:null;}})['then'](respondWithResult(_0x4da609,null))[_0xe774('0x47')](handleError(_0x4da609,null));};exports[_0xe774('0x57')]=function(_0xc527b7,_0x432db7,_0x9c995d){return db[_0xe774('0x31')][_0xe774('0x4b')]({'where':{'id':_0xc527b7[_0xe774('0x50')]['id']}})[_0xe774('0x44')](handleEntityNotFound(_0x432db7,null))['then'](function(_0x1a012e){if(_0x1a012e){return _0x1a012e['removeMembers'](_0xc527b7[_0xe774('0x36')]['ids']);}})[_0xe774('0x44')](respondWithStatusCode(_0x432db7,null))[_0xe774('0x47')](handleError(_0x432db7,null));};exports['addMessage']=function(_0x3b7925,_0x249be4,_0x4232f9){if(_0x3b7925['body']['id']){delete _0x3b7925[_0xe774('0x4d')]['id'];}return db[_0xe774('0x31')]['find']({'where':{'id':_0x3b7925[_0xe774('0x50')]['id']}})[_0xe774('0x44')](handleEntityNotFound(_0x249be4,null))['then'](function(_0x4706bc){if(_0x4706bc){_0x3b7925[_0xe774('0x4d')][_0xe774('0x58')]=_0x4706bc['id'];return db[_0xe774('0x4f')][_0xe774('0x4c')](_0x3b7925['body']);}})[_0xe774('0x44')](respondWithResult(_0x249be4,null))['catch'](handleError(_0x249be4,null));};exports[_0xe774('0x59')]=function(_0x3bdd02,_0x404431,_0x598ec8){var _0xe9bd0b={};var _0x334d09={};var _0xbd4980;var _0x5a314d;return db[_0xe774('0x31')][_0xe774('0x56')]({'where':{'id':_0x3bdd02[_0xe774('0x50')]['id']}})[_0xe774('0x44')](handleEntityNotFound(_0x404431,null))['then'](function(_0x44c7d0){if(_0x44c7d0){_0xbd4980=_0x44c7d0;_0x334d09[_0xe774('0x35')]=_[_0xe774('0x37')](db[_0xe774('0x4f')]['rawAttributes']);_0x334d09[_0xe774('0x36')]=_['keys'](_0x3bdd02[_0xe774('0x36')]);_0x334d09['filters']=_[_0xe774('0x39')](_0x334d09['model'],_0x334d09[_0xe774('0x36')]);_0xe9bd0b['attributes']=_[_0xe774('0x39')](_0x334d09[_0xe774('0x35')],qs['fields'](_0x3bdd02['query']['fields']));_0xe9bd0b[_0xe774('0x38')]=_0xe9bd0b[_0xe774('0x38')]['length']?_0xe9bd0b['attributes']:_0x334d09[_0xe774('0x35')];_0xe9bd0b[_0xe774('0x5a')]=qs[_0xe774('0x3d')](_0x3bdd02[_0xe774('0x36')]['sort']);_0xe9bd0b['where']=qs[_0xe774('0x49')](_[_0xe774('0x3e')](_0x3bdd02[_0xe774('0x36')],_0x334d09[_0xe774('0x49')]));if(_0x3bdd02['query'][_0xe774('0x3f')]){_0xe9bd0b[_0xe774('0x40')]=_[_0xe774('0x41')](_0xe9bd0b['where'],{'$or':_['map'](_0xe9bd0b['attributes'],function(_0x540020){var _0x16a476={};_0x16a476[_0x540020]={'$like':'%'+_0x3bdd02[_0xe774('0x36')][_0xe774('0x3f')]+'%'};return _0x16a476;})});}if(_0x3bdd02[_0xe774('0x36')]['$gte']){var _0x4c2844=_0x3bdd02[_0xe774('0x36')][_0xe774('0x5b')]['split'](',');var _0x28f2b9={};_0x28f2b9[_0x4c2844[0x0]]={'$gte':moment(_0x4c2844[0x1])[_0xe774('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe9bd0b[_0xe774('0x40')]=_['merge'](_0xe9bd0b[_0xe774('0x40')],_0x28f2b9);}_0xe9bd0b=_['merge']({},_0xe9bd0b,_0x3bdd02[_0xe774('0x43')]);return _0xbd4980['getMessages'](_0xe9bd0b);}})[_0xe774('0x44')](function(_0x4d8833){if(_0x4d8833){_0x5a314d=_0x4d8833[_0xe774('0x4a')];if(!_0x3bdd02['query'][_0xe774('0x3b')](_0xe774('0x3c'))){_0xe9bd0b[_0xe774('0x25')]=qs[_0xe774('0x25')](_0x3bdd02[_0xe774('0x36')][_0xe774('0x25')]);_0xe9bd0b[_0xe774('0x24')]=qs[_0xe774('0x24')](_0x3bdd02[_0xe774('0x36')][_0xe774('0x24')]);}return _0xbd4980[_0xe774('0x59')](_0xe9bd0b);}})[_0xe774('0x44')](function(_0x3052c3){if(_0x3052c3){return _0x3052c3?{'count':_0x5a314d,'rows':_0x3052c3}:null;}})['then'](respondWithResult(_0x404431,null))[_0xe774('0x47')](handleError(_0x404431,null));}; \ No newline at end of file +var _0x680e=['removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','./chatGroup.socket','register','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','attributes','intersection','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','keys','fields','includeAll','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','findOne','User','order','nolimit'];(function(_0x1f5955,_0x37ba92){var _0x249603=function(_0x37dcd0){while(--_0x37dcd0){_0x1f5955['push'](_0x1f5955['shift']());}};_0x249603(++_0x37ba92);}(_0x680e,0x13c));var _0xe680=function(_0x348847,_0x4d0771){_0x348847=_0x348847-0x0;var _0x3b8afa=_0x680e[_0x348847];return _0x3b8afa;};'use strict';var emlformat=require(_0xe680('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe680('0x1'));var jsonpatch=require(_0xe680('0x2'));var rp=require(_0xe680('0x3'));var moment=require(_0xe680('0x4'));var BPromise=require(_0xe680('0x5'));var Mustache=require(_0xe680('0x6'));var util=require(_0xe680('0x7'));var path=require(_0xe680('0x8'));var sox=require('sox');var csv=require(_0xe680('0x9'));var ejs=require(_0xe680('0xa'));var fs=require('fs');var fs_extra=require(_0xe680('0xb'));var _=require(_0xe680('0xc'));var squel=require(_0xe680('0xd'));var crypto=require(_0xe680('0xe'));var jsforce=require(_0xe680('0xf'));var deskjs=require(_0xe680('0x10'));var toCsv=require(_0xe680('0x9'));var querystring=require(_0xe680('0x11'));var Papa=require(_0xe680('0x12'));var Redis=require('ioredis');var authService=require(_0xe680('0x13'));var qs=require(_0xe680('0x14'));var as=require(_0xe680('0x15'));var hardwareService=require(_0xe680('0x16'));var logger=require(_0xe680('0x17'))(_0xe680('0x18'));var utils=require(_0xe680('0x19'));var config=require(_0xe680('0x1a'));var licenseUtil=require(_0xe680('0x1b'));var db=require(_0xe680('0x1c'))['db'];config[_0xe680('0x1d')]=_['defaults'](config[_0xe680('0x1d')],{'host':_0xe680('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe680('0x1f'))[_0xe680('0x20')](socket);function respondWithStatusCode(_0x3b48b9,_0x3f5f0e){_0x3f5f0e=_0x3f5f0e||0xcc;return function(_0x3f6ba6){if(_0x3f6ba6){return _0x3b48b9['sendStatus'](_0x3f5f0e);}return _0x3b48b9['status'](_0x3f5f0e)[_0xe680('0x21')]();};}function respondWithResult(_0x58db76,_0x5f4eb1){_0x5f4eb1=_0x5f4eb1||0xc8;return function(_0xff3c9e){if(_0xff3c9e){return _0x58db76[_0xe680('0x22')](_0x5f4eb1)['json'](_0xff3c9e);}};}function respondWithFilteredResult(_0x2430c7,_0x588055){return function(_0x9ed474){if(_0x9ed474){var _0x58ba31=typeof _0x588055[_0xe680('0x23')]===_0xe680('0x24')&&typeof _0x588055['limit']===_0xe680('0x24');var _0x9ed1d8=_0x9ed474[_0xe680('0x25')];var _0x7173ac=_0x58ba31?0x0:_0x588055['offset'];var _0x15e39b=_0x58ba31?_0x9ed474[_0xe680('0x25')]:_0x588055[_0xe680('0x23')]+_0x588055['limit'];var _0x22f837;if(_0x15e39b>=_0x9ed1d8){_0x15e39b=_0x9ed1d8;_0x22f837=0xc8;}else{_0x22f837=0xce;}_0x2430c7[_0xe680('0x22')](_0x22f837);return _0x2430c7[_0xe680('0x26')](_0xe680('0x27'),_0x7173ac+'-'+_0x15e39b+'/'+_0x9ed1d8)[_0xe680('0x28')](_0x9ed474);}return null;};}function patchUpdates(_0x48aa8b){return function(_0x1c1c7b){try{jsonpatch[_0xe680('0x29')](_0x1c1c7b,_0x48aa8b,!![]);}catch(_0xba2011){return BPromise[_0xe680('0x2a')](_0xba2011);}return _0x1c1c7b[_0xe680('0x2b')]();};}function saveUpdates(_0x35b483,_0x51cd24){return function(_0xaa43ef){if(_0xaa43ef){return _0xaa43ef[_0xe680('0x2c')](_0x35b483)[_0xe680('0x2d')](function(_0x1c1a4f){return _0x1c1a4f;});}return null;};}function removeEntity(_0x1c0326,_0x10ca57){return function(_0x4f3e05){if(_0x4f3e05){return _0x4f3e05[_0xe680('0x2e')]()[_0xe680('0x2d')](function(){_0x1c0326['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50ad24,_0x1777fd){return function(_0x4a50a5){if(!_0x4a50a5){_0x50ad24[_0xe680('0x2f')](0x194);}return _0x4a50a5;};}function handleError(_0x16c573,_0x5cda94){_0x5cda94=_0x5cda94||0x1f4;return function(_0x3b5900){logger[_0xe680('0x30')](_0x3b5900[_0xe680('0x31')]);if(_0x3b5900[_0xe680('0x32')]){delete _0x3b5900[_0xe680('0x32')];}_0x16c573[_0xe680('0x22')](_0x5cda94)[_0xe680('0x33')](_0x3b5900);};}exports[_0xe680('0x34')]=function(_0x57a016,_0x51679d){var _0x4b0aa4={},_0x1878cd={},_0x55cd81={'count':0x0,'rows':[]};var _0x4d3afd=_[_0xe680('0x35')](db[_0xe680('0x36')][_0xe680('0x37')],function(_0x1ff70d){return{'name':_0x1ff70d[_0xe680('0x38')],'type':_0x1ff70d[_0xe680('0x39')][_0xe680('0x3a')]};});_0x1878cd[_0xe680('0x3b')]=_['map'](_0x4d3afd,_0xe680('0x32'));_0x1878cd[_0xe680('0x3c')]=_['keys'](_0x57a016[_0xe680('0x3c')]);_0x1878cd['filters']=_['intersection'](_0x1878cd['model'],_0x1878cd[_0xe680('0x3c')]);_0x4b0aa4[_0xe680('0x3d')]=_[_0xe680('0x3e')](_0x1878cd[_0xe680('0x3b')],qs['fields'](_0x57a016[_0xe680('0x3c')]['fields']));_0x4b0aa4[_0xe680('0x3d')]=_0x4b0aa4[_0xe680('0x3d')][_0xe680('0x3f')]?_0x4b0aa4['attributes']:_0x1878cd[_0xe680('0x3b')];if(!_0x57a016[_0xe680('0x3c')][_0xe680('0x40')]('nolimit')){_0x4b0aa4[_0xe680('0x41')]=qs[_0xe680('0x41')](_0x57a016[_0xe680('0x3c')]['limit']);_0x4b0aa4[_0xe680('0x23')]=qs[_0xe680('0x23')](_0x57a016['query']['offset']);}_0x4b0aa4['order']=qs[_0xe680('0x42')](_0x57a016[_0xe680('0x3c')][_0xe680('0x42')]);_0x4b0aa4[_0xe680('0x43')]=qs[_0xe680('0x44')](_[_0xe680('0x45')](_0x57a016['query'],_0x1878cd[_0xe680('0x44')]),_0x4d3afd);if(_0x57a016[_0xe680('0x3c')][_0xe680('0x46')]){_0x4b0aa4['where']=_[_0xe680('0x47')](_0x4b0aa4[_0xe680('0x43')],{'$or':_['map'](_0x4d3afd,function(_0x544e9b){if(_0x544e9b['type']!=='VIRTUAL'){var _0x50c935={};_0x50c935[_0x544e9b[_0xe680('0x32')]]={'$like':'%'+_0x57a016['query'][_0xe680('0x46')]+'%'};return _0x50c935;}})});}_0x4b0aa4=_['merge']({},_0x4b0aa4,_0x57a016[_0xe680('0x48')]);var _0x170009={'where':_0x4b0aa4['where']};return db['ChatGroup'][_0xe680('0x25')](_0x170009)[_0xe680('0x2d')](function(_0x1629b2){_0x55cd81[_0xe680('0x25')]=_0x1629b2;if(_0x57a016[_0xe680('0x3c')]['includeAll']){_0x4b0aa4[_0xe680('0x49')]=[{'all':!![]}];}return db[_0xe680('0x36')][_0xe680('0x4a')](_0x4b0aa4);})[_0xe680('0x2d')](function(_0x29dc2b){_0x55cd81[_0xe680('0x4b')]=_0x29dc2b;return _0x55cd81;})[_0xe680('0x2d')](respondWithFilteredResult(_0x51679d,_0x4b0aa4))[_0xe680('0x4c')](handleError(_0x51679d,null));};exports[_0xe680('0x4d')]=function(_0x1e1b5d,_0x56b57c){var _0x13d09c={'raw':!![],'where':{'id':_0x1e1b5d['params']['id']}},_0xf10f51={};_0xf10f51['model']=_['keys'](db['ChatGroup'][_0xe680('0x37')]);_0xf10f51[_0xe680('0x3c')]=_[_0xe680('0x4e')](_0x1e1b5d[_0xe680('0x3c')]);_0xf10f51[_0xe680('0x44')]=_[_0xe680('0x3e')](_0xf10f51[_0xe680('0x3b')],_0xf10f51[_0xe680('0x3c')]);_0x13d09c[_0xe680('0x3d')]=_['intersection'](_0xf10f51[_0xe680('0x3b')],qs[_0xe680('0x4f')](_0x1e1b5d[_0xe680('0x3c')][_0xe680('0x4f')]));_0x13d09c[_0xe680('0x3d')]=_0x13d09c[_0xe680('0x3d')][_0xe680('0x3f')]?_0x13d09c[_0xe680('0x3d')]:_0xf10f51[_0xe680('0x3b')];if(_0x1e1b5d['query'][_0xe680('0x50')]){_0x13d09c[_0xe680('0x49')]=[{'all':!![]}];}_0x13d09c=_[_0xe680('0x47')]({},_0x13d09c,_0x1e1b5d['options']);return db[_0xe680('0x36')][_0xe680('0x51')](_0x13d09c)['then'](handleEntityNotFound(_0x56b57c,null))['then'](respondWithResult(_0x56b57c,null))['catch'](handleError(_0x56b57c,null));};exports['create']=function(_0x55839d,_0x4e8e92){return db['ChatGroup'][_0xe680('0x52')](_0x55839d[_0xe680('0x53')],{})[_0xe680('0x2d')](respondWithResult(_0x4e8e92,0xc9))[_0xe680('0x4c')](handleError(_0x4e8e92,null));};exports[_0xe680('0x2c')]=function(_0x220e12,_0x4de651){if(_0x220e12[_0xe680('0x53')]['id']){delete _0x220e12[_0xe680('0x53')]['id'];}return db['ChatGroup'][_0xe680('0x51')]({'where':{'id':_0x220e12[_0xe680('0x54')]['id']}})[_0xe680('0x2d')](handleEntityNotFound(_0x4de651,null))[_0xe680('0x2d')](saveUpdates(_0x220e12[_0xe680('0x53')],null))[_0xe680('0x2d')](respondWithResult(_0x4de651,null))[_0xe680('0x4c')](handleError(_0x4de651,null));};exports[_0xe680('0x2e')]=function(_0x28f020,_0x3260f3){return db[_0xe680('0x36')]['find']({'where':{'id':_0x28f020['params']['id']}})[_0xe680('0x2d')](handleEntityNotFound(_0x3260f3,null))['then'](removeEntity(_0x3260f3,null))[_0xe680('0x4c')](handleError(_0x3260f3,null));};exports[_0xe680('0x55')]=function(_0x1d08cd,_0x221ff6){return db['ChatGroup'][_0xe680('0x55')]()[_0xe680('0x2d')](respondWithResult(_0x221ff6,null))[_0xe680('0x4c')](handleError(_0x221ff6,null));};exports[_0xe680('0x56')]=function(_0x57773b,_0xfc1c11,_0x8cd778){return db[_0xe680('0x57')][_0xe680('0x25')]({'where':{'ChatGroupId':_0x57773b['params']['id'],'ToId':_0x57773b['user']['id'],'read':![]}})[_0xe680('0x2d')](function(_0xf525d0){return{'id':_[_0xe680('0x58')](_0x57773b[_0xe680('0x54')]['id']),'count':_0xf525d0};})['then'](respondWithResult(_0xfc1c11,null))[_0xe680('0x4c')](handleError(_0xfc1c11,null));};exports[_0xe680('0x59')]=function(_0x411106,_0x1d42d4,_0x173031){return db['ChatGroup']['find']({'where':{'id':_0x411106['params']['id']}})[_0xe680('0x2d')](handleEntityNotFound(_0x1d42d4,null))[_0xe680('0x2d')](function(_0x288228){if(_0x288228){return _0x288228[_0xe680('0x59')](_0x411106[_0xe680('0x53')]['ids'],_[_0xe680('0x5a')](_0x411106[_0xe680('0x53')],[_0xe680('0x5b'),'id'])||{});}})[_0xe680('0x2d')](respondWithResult(_0x1d42d4,null))[_0xe680('0x4c')](handleError(_0x1d42d4,null));};exports['getMembers']=function(_0x374b87,_0xee9180,_0x8482eb){var _0x113ff4={};var _0x5551ee={};var _0x55cb36;var _0x322d7a;return db['ChatGroup'][_0xe680('0x5c')]({'where':{'id':_0x374b87[_0xe680('0x54')]['id']}})[_0xe680('0x2d')](handleEntityNotFound(_0xee9180,null))['then'](function(_0x442e23){if(_0x442e23){_0x55cb36=_0x442e23;_0x5551ee[_0xe680('0x3b')]=_['keys'](db[_0xe680('0x5d')][_0xe680('0x37')]);_0x5551ee[_0xe680('0x3c')]=_[_0xe680('0x4e')](_0x374b87[_0xe680('0x3c')]);_0x5551ee[_0xe680('0x44')]=_[_0xe680('0x3e')](_0x5551ee[_0xe680('0x3b')],_0x5551ee[_0xe680('0x3c')]);_0x113ff4[_0xe680('0x3d')]=_[_0xe680('0x3e')](_0x5551ee[_0xe680('0x3b')],qs[_0xe680('0x4f')](_0x374b87[_0xe680('0x3c')][_0xe680('0x4f')]));_0x113ff4[_0xe680('0x3d')]=_0x113ff4['attributes'][_0xe680('0x3f')]?_0x113ff4[_0xe680('0x3d')]:_0x5551ee['model'];_0x113ff4[_0xe680('0x5e')]=qs[_0xe680('0x42')](_0x374b87[_0xe680('0x3c')]['sort']);_0x113ff4[_0xe680('0x43')]=qs[_0xe680('0x44')](_[_0xe680('0x45')](_0x374b87[_0xe680('0x3c')],_0x5551ee[_0xe680('0x44')]));if(_0x374b87['query']['filter']){_0x113ff4[_0xe680('0x43')]=_[_0xe680('0x47')](_0x113ff4[_0xe680('0x43')],{'$or':_[_0xe680('0x35')](_0x113ff4['attributes'],function(_0x4edcfc){var _0x52a834={};_0x52a834[_0x4edcfc]={'$like':'%'+_0x374b87['query']['filter']+'%'};return _0x52a834;})});}_0x113ff4=_['merge']({},_0x113ff4,_0x374b87[_0xe680('0x48')]);return _0x55cb36['getMembers'](_0x113ff4);}})[_0xe680('0x2d')](function(_0x226499){if(_0x226499){_0x322d7a=_0x226499[_0xe680('0x3f')];if(!_0x374b87[_0xe680('0x3c')]['hasOwnProperty'](_0xe680('0x5f'))){_0x113ff4[_0xe680('0x41')]=qs[_0xe680('0x41')](_0x374b87[_0xe680('0x3c')][_0xe680('0x41')]);_0x113ff4[_0xe680('0x23')]=qs['offset'](_0x374b87[_0xe680('0x3c')][_0xe680('0x23')]);}return _0x55cb36['getMembers'](_0x113ff4);}})[_0xe680('0x2d')](function(_0x41279f){if(_0x41279f){return _0x41279f?{'count':_0x322d7a,'rows':_0x41279f}:null;}})[_0xe680('0x2d')](respondWithResult(_0xee9180,null))['catch'](handleError(_0xee9180,null));};exports[_0xe680('0x60')]=function(_0x2a8867,_0x2cd758,_0x88c464){return db[_0xe680('0x36')][_0xe680('0x51')]({'where':{'id':_0x2a8867[_0xe680('0x54')]['id']}})[_0xe680('0x2d')](handleEntityNotFound(_0x2cd758,null))[_0xe680('0x2d')](function(_0x11685d){if(_0x11685d){return _0x11685d[_0xe680('0x60')](_0x2a8867[_0xe680('0x3c')][_0xe680('0x5b')]);}})['then'](respondWithStatusCode(_0x2cd758,null))[_0xe680('0x4c')](handleError(_0x2cd758,null));};exports[_0xe680('0x61')]=function(_0x388d5f,_0x183a00,_0x1f44fa){if(_0x388d5f[_0xe680('0x53')]['id']){delete _0x388d5f[_0xe680('0x53')]['id'];}return db[_0xe680('0x36')][_0xe680('0x51')]({'where':{'id':_0x388d5f['params']['id']}})[_0xe680('0x2d')](handleEntityNotFound(_0x183a00,null))[_0xe680('0x2d')](function(_0x30f779){if(_0x30f779){_0x388d5f['body'][_0xe680('0x62')]=_0x30f779['id'];return db['ChatInternalMessage'][_0xe680('0x52')](_0x388d5f[_0xe680('0x53')]);}})['then'](respondWithResult(_0x183a00,null))[_0xe680('0x4c')](handleError(_0x183a00,null));};exports['getMessages']=function(_0xa80828,_0x5361d8,_0x27e5af){var _0x203af5={};var _0x45241a={};var _0x53ee28;var _0x5ce0c0;return db['ChatGroup'][_0xe680('0x5c')]({'where':{'id':_0xa80828[_0xe680('0x54')]['id']}})[_0xe680('0x2d')](handleEntityNotFound(_0x5361d8,null))[_0xe680('0x2d')](function(_0x2d786e){if(_0x2d786e){_0x53ee28=_0x2d786e;_0x45241a[_0xe680('0x3b')]=_[_0xe680('0x4e')](db[_0xe680('0x57')]['rawAttributes']);_0x45241a[_0xe680('0x3c')]=_['keys'](_0xa80828[_0xe680('0x3c')]);_0x45241a[_0xe680('0x44')]=_[_0xe680('0x3e')](_0x45241a[_0xe680('0x3b')],_0x45241a['query']);_0x203af5[_0xe680('0x3d')]=_[_0xe680('0x3e')](_0x45241a['model'],qs[_0xe680('0x4f')](_0xa80828[_0xe680('0x3c')][_0xe680('0x4f')]));_0x203af5['attributes']=_0x203af5[_0xe680('0x3d')][_0xe680('0x3f')]?_0x203af5[_0xe680('0x3d')]:_0x45241a[_0xe680('0x3b')];_0x203af5['order']=qs[_0xe680('0x42')](_0xa80828[_0xe680('0x3c')][_0xe680('0x42')]);_0x203af5[_0xe680('0x43')]=qs[_0xe680('0x44')](_[_0xe680('0x45')](_0xa80828[_0xe680('0x3c')],_0x45241a['filters']));if(_0xa80828['query']['filter']){_0x203af5[_0xe680('0x43')]=_[_0xe680('0x47')](_0x203af5[_0xe680('0x43')],{'$or':_[_0xe680('0x35')](_0x203af5[_0xe680('0x3d')],function(_0x9b584){var _0x409ae0={};_0x409ae0[_0x9b584]={'$like':'%'+_0xa80828[_0xe680('0x3c')]['filter']+'%'};return _0x409ae0;})});}if(_0xa80828[_0xe680('0x3c')]['$gte']){var _0x36ad82=_0xa80828[_0xe680('0x3c')][_0xe680('0x63')][_0xe680('0x64')](',');var _0x67e175={};_0x67e175[_0x36ad82[0x0]]={'$gte':moment(_0x36ad82[0x1])[_0xe680('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};_0x203af5['where']=_['merge'](_0x203af5['where'],_0x67e175);}_0x203af5=_[_0xe680('0x47')]({},_0x203af5,_0xa80828[_0xe680('0x48')]);return _0x53ee28['getMessages'](_0x203af5);}})[_0xe680('0x2d')](function(_0x1a52a3){if(_0x1a52a3){_0x5ce0c0=_0x1a52a3[_0xe680('0x3f')];if(!_0xa80828['query'][_0xe680('0x40')](_0xe680('0x5f'))){_0x203af5[_0xe680('0x41')]=qs[_0xe680('0x41')](_0xa80828['query'][_0xe680('0x41')]);_0x203af5[_0xe680('0x23')]=qs[_0xe680('0x23')](_0xa80828[_0xe680('0x3c')][_0xe680('0x23')]);}return _0x53ee28[_0xe680('0x66')](_0x203af5);}})[_0xe680('0x2d')](function(_0xb650c3){if(_0xb650c3){return _0xb650c3?{'count':_0x5ce0c0,'rows':_0xb650c3}:null;}})[_0xe680('0x2d')](respondWithResult(_0x5361d8,null))[_0xe680('0x4c')](handleError(_0x5361d8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 46bf989..38b89f0 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 _0xdd04=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x8ad2f9,_0x6c378f){var _0x377a4c=function(_0x5dd580){while(--_0x5dd580){_0x8ad2f9['push'](_0x8ad2f9['shift']());}};_0x377a4c(++_0x6c378f);}(_0xdd04,0x15f));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4dd0('0x0'));var ChatGroup=require(_0x4dd0('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4dd0('0x2')](0x0);var events={'afterCreate':_0x4dd0('0x3'),'afterUpdate':_0x4dd0('0x4'),'afterDestroy':_0x4dd0('0x5')};function emitEvent(_0x442f29){return function(_0xfa57bc,_0x7db67,_0x104d13){ChatGroupEvents[_0x4dd0('0x6')](_0x442f29+':'+_0xfa57bc['id'],_0xfa57bc);ChatGroupEvents['emit'](_0x442f29,_0xfa57bc);_0x104d13(null);};}for(var e in events){if(events[_0x4dd0('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x4dd0('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xc49e=['remove','emit','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0xc49e,0x1bd));var _0xec49=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xc49e[_0x4a3898];return _0x25ceb0;};'use strict';var EventEmitter=require(_0xec49('0x0'));var ChatGroup=require(_0xec49('0x1'))['db'][_0xec49('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xec49('0x3')](0x0);var events={'afterCreate':_0xec49('0x4'),'afterUpdate':'update','afterDestroy':_0xec49('0x5')};function emitEvent(_0x11af3d){return function(_0x12615d,_0x49af67,_0x5dcd66){ChatGroupEvents[_0xec49('0x6')](_0x11af3d+':'+_0x12615d['id'],_0x12615d);ChatGroupEvents[_0xec49('0x6')](_0x11af3d,_0x12615d);_0x5dcd66(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xec49('0x7')](e,emitEvent(event));}}module[_0xec49('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ec57ca5..eb92e45 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 _0xf1a2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x2ff127,_0x3247b4){var _0x20ea30=function(_0x4c862e){while(--_0x4c862e){_0x2ff127['push'](_0x2ff127['shift']());}};_0x20ea30(++_0x3247b4);}(_0xf1a2,0x111));var _0x2f1a=function(_0x752b52,_0x3518b5){_0x752b52=_0x752b52-0x0;var _0x322d2e=_0xf1a2[_0x752b52];return _0x322d2e;};'use strict';var _=require(_0x2f1a('0x0'));var util=require(_0x2f1a('0x1'));var logger=require(_0x2f1a('0x2'))(_0x2f1a('0x3'));var moment=require('moment');var BPromise=require(_0x2f1a('0x4'));var rp=require(_0x2f1a('0x5'));var fs=require('fs');var path=require(_0x2f1a('0x6'));var rimraf=require(_0x2f1a('0x7'));var config=require('../../config/environment');var attributes=require(_0x2f1a('0x8'));module[_0x2f1a('0x9')]=function(_0x5de8bd,_0x31b537){return _0x5de8bd[_0x2f1a('0xa')](_0x2f1a('0xb'),attributes,{'tableName':_0x2f1a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9234=['../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x9234,0x1bf));var _0x4923=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9234[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var logger=require(_0x4923('0x1'))(_0x4923('0x2'));var moment=require(_0x4923('0x3'));var BPromise=require(_0x4923('0x4'));var rp=require(_0x4923('0x5'));var fs=require('fs');var path=require(_0x4923('0x6'));var rimraf=require(_0x4923('0x7'));var config=require(_0x4923('0x8'));var attributes=require(_0x4923('0x9'));module[_0x4923('0xa')]=function(_0x16fd44,_0x5efc9c){return _0x16fd44['define'](_0x4923('0xb'),attributes,{'tableName':_0x4923('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index fd13b4f..28f78aa 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 _0x25d5=['defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x3f6722,_0xf1fdfa){var _0x27934e=function(_0xabc89c){while(--_0xabc89c){_0x3f6722['push'](_0x3f6722['shift']());}};_0x27934e(++_0xf1fdfa);}(_0x25d5,0x91));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x525d('0x0'));var util=require('util');var moment=require(_0x525d('0x1'));var BPromise=require('bluebird');var rs=require(_0x525d('0x2'));var fs=require('fs');var Redis=require(_0x525d('0x3'));var db=require(_0x525d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x525d('0x5'))(_0x525d('0x6'));var config=require(_0x525d('0x7'));var jayson=require(_0x525d('0x8'));var client=jayson['client'][_0x525d('0x9')]({'port':0x232a});config[_0x525d('0xa')]=_[_0x525d('0xb')](config[_0x525d('0xa')],{'host':_0x525d('0xc'),'port':0x18eb});var socket=require(_0x525d('0xd'))(new Redis(config[_0x525d('0xa')]));require(_0x525d('0xe'))[_0x525d('0xf')](socket);function respondWithRpcPromise(_0x5081a7,_0x34c87a,_0x52e045){return new BPromise(function(_0x3144f8,_0x5741d0){return client['request'](_0x5081a7,_0x52e045)['then'](function(_0x25b077){logger[_0x525d('0x10')]('ChatGroup,\x20%s,\x20%s',_0x34c87a,_0x525d('0x11'));logger[_0x525d('0x12')](_0x525d('0x13'),_0x34c87a,'request\x20sent',JSON[_0x525d('0x14')](_0x25b077));if(_0x25b077[_0x525d('0x15')]){if(_0x25b077[_0x525d('0x15')][_0x525d('0x16')]===0x1f4){logger['error'](_0x525d('0x17'),_0x34c87a,_0x25b077[_0x525d('0x15')][_0x525d('0x18')]);return _0x5741d0(_0x25b077[_0x525d('0x15')][_0x525d('0x18')]);}logger[_0x525d('0x15')](_0x525d('0x17'),_0x34c87a,_0x25b077[_0x525d('0x15')]['message']);return _0x3144f8(_0x25b077['error'][_0x525d('0x18')]);}else{logger[_0x525d('0x10')](_0x525d('0x17'),_0x34c87a,_0x525d('0x11'));_0x3144f8(_0x25b077[_0x525d('0x19')][_0x525d('0x18')]);}})['catch'](function(_0x2d7ba4){logger[_0x525d('0x15')](_0x525d('0x17'),_0x34c87a,_0x2d7ba4);_0x5741d0(_0x2d7ba4);});});} \ No newline at end of file +var _0x7118=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x419560,_0x16a92c){var _0x52a0a9=function(_0x1cdc67){while(--_0x1cdc67){_0x419560['push'](_0x419560['shift']());}};_0x52a0a9(++_0x16a92c);}(_0x7118,0x159));var _0x8711=function(_0x6867a6,_0x5f121b){_0x6867a6=_0x6867a6-0x0;var _0x4f08e4=_0x7118[_0x6867a6];return _0x4f08e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8711('0x0'));var BPromise=require(_0x8711('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8711('0x2'));var db=require(_0x8711('0x3'))['db'];var utils=require(_0x8711('0x4'));var logger=require(_0x8711('0x5'))(_0x8711('0x6'));var config=require(_0x8711('0x7'));var jayson=require(_0x8711('0x8'));var client=jayson['client'][_0x8711('0x9')]({'port':0x232a});config[_0x8711('0xa')]=_[_0x8711('0xb')](config[_0x8711('0xa')],{'host':_0x8711('0xc'),'port':0x18eb});var socket=require(_0x8711('0xd'))(new Redis(config[_0x8711('0xa')]));require(_0x8711('0xe'))[_0x8711('0xf')](socket);function respondWithRpcPromise(_0x180954,_0x1cc68b,_0x4f74ae){return new BPromise(function(_0x52f3e9,_0x2892a2){return client[_0x8711('0x10')](_0x180954,_0x4f74ae)[_0x8711('0x11')](function(_0x4b1fbe){logger['info'](_0x8711('0x12'),_0x1cc68b,_0x8711('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1cc68b,_0x8711('0x13'),JSON[_0x8711('0x14')](_0x4b1fbe));if(_0x4b1fbe[_0x8711('0x15')]){if(_0x4b1fbe[_0x8711('0x15')][_0x8711('0x16')]===0x1f4){logger[_0x8711('0x15')](_0x8711('0x12'),_0x1cc68b,_0x4b1fbe['error'][_0x8711('0x17')]);return _0x2892a2(_0x4b1fbe[_0x8711('0x15')][_0x8711('0x17')]);}logger[_0x8711('0x15')](_0x8711('0x12'),_0x1cc68b,_0x4b1fbe[_0x8711('0x15')]['message']);return _0x52f3e9(_0x4b1fbe[_0x8711('0x15')][_0x8711('0x17')]);}else{logger[_0x8711('0x18')](_0x8711('0x12'),_0x1cc68b,_0x8711('0x13'));_0x52f3e9(_0x4b1fbe['result']['message']);}})['catch'](function(_0x26dfb0){logger[_0x8711('0x15')](_0x8711('0x12'),_0x1cc68b,_0x26dfb0);_0x2892a2(_0x26dfb0);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ea8cde9..93c3869 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 _0x31e4=['register','length','chatGroup:','./chatGroup.events','save'];(function(_0x2f8a99,_0x1a2e9a){var _0x3b2c5e=function(_0x645e7c){while(--_0x645e7c){_0x2f8a99['push'](_0x2f8a99['shift']());}};_0x3b2c5e(++_0x1a2e9a);}(_0x31e4,0x17a));var _0x431e=function(_0x5e3cbd,_0x2fd5cd){_0x5e3cbd=_0x5e3cbd-0x0;var _0x1ed1ce=_0x31e4[_0x5e3cbd];return _0x1ed1ce;};'use strict';var ChatGroupEvents=require(_0x431e('0x0'));var events=[_0x431e('0x1'),'remove','update'];function createListener(_0x4f7752,_0x222a10){return function(_0x2e055d){_0x222a10['emit'](_0x4f7752,_0x2e055d);};}function removeListener(_0x8d25a7,_0x52f04b){return function(){ChatGroupEvents['removeListener'](_0x8d25a7,_0x52f04b);};}exports[_0x431e('0x2')]=function(_0x1f67a0){for(var _0x34f471=0x0,_0x42b663=events[_0x431e('0x3')];_0x34f471<_0x42b663;_0x34f471++){var _0x83ccc=events[_0x34f471];var _0x5723a4=createListener(_0x431e('0x4')+_0x83ccc,_0x1f67a0);ChatGroupEvents['on'](_0x83ccc,_0x5723a4);}}; \ No newline at end of file +var _0x8d02=['update','emit','removeListener','register','length','./chatGroup.events','save','remove'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0x8d02,0x1dd));var _0x28d0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8d02[_0x3bf83f];return _0x22c4a9;};'use strict';var ChatGroupEvents=require(_0x28d0('0x0'));var events=[_0x28d0('0x1'),_0x28d0('0x2'),_0x28d0('0x3')];function createListener(_0x5596f9,_0x39b4bf){return function(_0x25eb17){_0x39b4bf[_0x28d0('0x4')](_0x5596f9,_0x25eb17);};}function removeListener(_0xe2729b,_0x3087e5){return function(){ChatGroupEvents[_0x28d0('0x5')](_0xe2729b,_0x3087e5);};}exports[_0x28d0('0x6')]=function(_0x5b2caf){for(var _0xc4e56a=0x0,_0x43bd8a=events[_0x28d0('0x7')];_0xc4e56a<_0x43bd8a;_0xc4e56a++){var _0x3f4023=events[_0xc4e56a];var _0xb588c2=createListener('chatGroup:'+_0x3f4023,_0x5b2caf);ChatGroupEvents['on'](_0x3f4023,_0xb588c2);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4352d20..5a6bc7f 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 _0xe75d=['show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','get','describe'];(function(_0x2673a4,_0x4d0b8d){var _0x5e3a6a=function(_0x59e268){while(--_0x59e268){_0x2673a4['push'](_0x2673a4['shift']());}};_0x5e3a6a(++_0x4d0b8d);}(_0xe75d,0x1af));var _0xde75=function(_0x4d56f7,_0x213776){_0x4d56f7=_0x4d56f7-0x0;var _0x431d99=_0xe75d[_0x4d56f7];return _0x431d99;};'use strict';var multer=require('multer');var util=require(_0xde75('0x0'));var path=require(_0xde75('0x1'));var timeout=require(_0xde75('0x2'));var express=require(_0xde75('0x3'));var router=express['Router']();var fs_extra=require(_0xde75('0x4'));var auth=require(_0xde75('0x5'));var interaction=require(_0xde75('0x6'));var config=require('../../config/environment');var controller=require(_0xde75('0x7'));router['get']('/',auth[_0xde75('0x8')](),controller['index']);router[_0xde75('0x9')]('/describe',auth[_0xde75('0x8')](),controller[_0xde75('0xa')]);router[_0xde75('0x9')]('/:id',auth[_0xde75('0x8')](),controller[_0xde75('0xb')]);router[_0xde75('0x9')](_0xde75('0xc'),auth[_0xde75('0x8')](),controller[_0xde75('0xd')]);router[_0xde75('0x9')](_0xde75('0xe'),auth[_0xde75('0x8')](),controller[_0xde75('0xf')]);router[_0xde75('0x9')](_0xde75('0x10'),auth[_0xde75('0x8')](),controller['getMessages']);router[_0xde75('0x11')]('/',auth[_0xde75('0x8')](),controller[_0xde75('0x12')]);router[_0xde75('0x11')](_0xde75('0xe'),auth[_0xde75('0x8')](),controller[_0xde75('0x13')]);router[_0xde75('0x11')](_0xde75('0x10'),auth[_0xde75('0x8')](),controller[_0xde75('0x14')]);router['put'](_0xde75('0x15'),auth[_0xde75('0x8')](),controller[_0xde75('0x16')]);router[_0xde75('0x17')](_0xde75('0x15'),auth[_0xde75('0x8')](),controller[_0xde75('0x18')]);router[_0xde75('0x17')](_0xde75('0xe'),auth[_0xde75('0x8')](),controller['removeMembers']);module[_0xde75('0x19')]=router; \ No newline at end of file +var _0xed9a=['getUnread','getMembers','/:id/messages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread'];(function(_0x513f23,_0x1cd508){var _0x564505=function(_0x895fb){while(--_0x895fb){_0x513f23['push'](_0x513f23['shift']());}};_0x564505(++_0x1cd508);}(_0xed9a,0xae));var _0xaed9=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xed9a[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0xaed9('0x0'));var util=require(_0xaed9('0x1'));var path=require(_0xaed9('0x2'));var timeout=require(_0xaed9('0x3'));var express=require(_0xaed9('0x4'));var router=express[_0xaed9('0x5')]();var fs_extra=require(_0xaed9('0x6'));var auth=require(_0xaed9('0x7'));var interaction=require(_0xaed9('0x8'));var config=require(_0xaed9('0x9'));var controller=require(_0xaed9('0xa'));router[_0xaed9('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xaed9('0xc'),auth[_0xaed9('0xd')](),controller[_0xaed9('0xe')]);router[_0xaed9('0xb')](_0xaed9('0xf'),auth[_0xaed9('0xd')](),controller[_0xaed9('0x10')]);router[_0xaed9('0xb')](_0xaed9('0x11'),auth['isAuthenticated'](),controller[_0xaed9('0x12')]);router[_0xaed9('0xb')]('/:id/members',auth[_0xaed9('0xd')](),controller[_0xaed9('0x13')]);router['get'](_0xaed9('0x14'),auth[_0xaed9('0xd')](),controller['getMessages']);router[_0xaed9('0x15')]('/',auth[_0xaed9('0xd')](),controller[_0xaed9('0x16')]);router[_0xaed9('0x15')](_0xaed9('0x17'),auth['isAuthenticated'](),controller[_0xaed9('0x18')]);router['post'](_0xaed9('0x14'),auth[_0xaed9('0xd')](),controller[_0xaed9('0x19')]);router[_0xaed9('0x1a')]('/:id',auth[_0xaed9('0xd')](),controller[_0xaed9('0x1b')]);router[_0xaed9('0x1c')](_0xaed9('0xf'),auth[_0xaed9('0xd')](),controller[_0xaed9('0x1d')]);router[_0xaed9('0x1c')](_0xaed9('0x17'),auth[_0xaed9('0xd')](),controller[_0xaed9('0x1e')]);module[_0xaed9('0x1f')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ab4c5ef..13df1ec 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 _0x688a=['star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','ENUM','thumb'];(function(_0x2925e3,_0x51df9f){var _0x4e1eaa=function(_0x2253c5){while(--_0x2253c5){_0x2925e3['push'](_0x2925e3['shift']());}};_0x4e1eaa(++_0x51df9f);}(_0x688a,0x124));var _0xa688=function(_0x1e12c4,_0x45ecc0){_0x1e12c4=_0x1e12c4-0x0;var _0x1712aa=_0x688a[_0x1e12c4];return _0x1712aa;};'use strict';var Sequelize=require(_0xa688('0x0'));module[_0xa688('0x1')]={'closed':{'type':Sequelize[_0xa688('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa688('0x3')]('star',_0xa688('0x4')),'defaultValue':_0xa688('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xa688('0x6')]},'mailTranscript':{'type':Sequelize[_0xa688('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa688('0x8')]},'disposition':{'type':Sequelize[_0xa688('0x7')]},'secondDisposition':{'type':Sequelize[_0xa688('0x7')]},'thirdDisposition':{'type':Sequelize[_0xa688('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xa688('0x7')]},'osName':{'type':Sequelize[_0xa688('0x7')]},'osVersion':{'type':Sequelize[_0xa688('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa688('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa688('0x6')](_0xa688('0x9'))},'read1stAt':{'type':Sequelize[_0xa688('0x8')]},'lastMsgAt':{'type':Sequelize[_0xa688('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xa688('0x3')]('in',_0xa688('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa688('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xda3f=['ENUM','out','exports','BOOLEAN','thumb','TEXT','DATE','STRING','long'];(function(_0x129ca1,_0x21890a){var _0x41188a=function(_0x1e162a){while(--_0x1e162a){_0x129ca1['push'](_0x129ca1['shift']());}};_0x41188a(++_0x21890a);}(_0xda3f,0xec));var _0xfda3=function(_0x1d4f6d,_0x3c532){_0x1d4f6d=_0x1d4f6d-0x0;var _0x246bba=_0xda3f[_0x1d4f6d];return _0x246bba;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'closed':{'type':Sequelize[_0xfda3('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0xfda3('0x2')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xfda3('0x3')]},'pathTranscript':{'type':Sequelize[_0xfda3('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfda3('0x4')]},'disposition':{'type':Sequelize[_0xfda3('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfda3('0x5')]},'browserName':{'type':Sequelize[_0xfda3('0x5')]},'browserVersion':{'type':Sequelize[_0xfda3('0x5')]},'osName':{'type':Sequelize[_0xfda3('0x5')]},'osVersion':{'type':Sequelize[_0xfda3('0x5')]},'deviceModel':{'type':Sequelize[_0xfda3('0x5')]},'deviceVendor':{'type':Sequelize[_0xfda3('0x5')]},'deviceType':{'type':Sequelize[_0xfda3('0x5')]},'referer':{'type':Sequelize[_0xfda3('0x3')]},'customerIp':{'type':Sequelize[_0xfda3('0x5')]},'formData':{'type':Sequelize[_0xfda3('0x3')](_0xfda3('0x6'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xfda3('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xfda3('0x7')]('in',_0xfda3('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfda3('0x5')]},'customerPort':{'type':Sequelize[_0xfda3('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfda3('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f12175a..2afedc1 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 _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','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','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','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','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x2d8b3f,_0xfa356a){var _0x2b62c0=function(_0x11527f){while(--_0x11527f){_0x2d8b3f['push'](_0x2d8b3f['shift']());}};_0x2b62c0(++_0xfa356a);}(_0x4fc2,0x111));var _0x24fc=function(_0x264f48,_0x2c82d8){_0x264f48=_0x264f48-0x0;var _0xb99167=_0x4fc2[_0x264f48];return _0xb99167;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));}; \ No newline at end of file +var _0x2032=['nolimit','order','sort','pick','field','color','tools_tags','select','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','o.id\x20=\x20i.UserId','chat_websites','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','$gte','parse','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','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.lastName','c.email','Contact.phone','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','keys','include','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','addTags','ids','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','customerIp','customerPort','tail','createReadStream','pipe','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','socket.io-emitter','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','destroy','end','name','send','merge','body','contact','agent','Users','map','fullname','TagIds','forEach','Tags','index','ChatInteraction','rawAttributes','type','model','query','filters','attributes','intersection','length','hasOwnProperty'];(function(_0x5ab3bb,_0xe01eca){var _0x478507=function(_0x2e1f1f){while(--_0x2e1f1f){_0x5ab3bb['push'](_0x5ab3bb['shift']());}};_0x478507(++_0xe01eca);}(_0x2032,0xd9));var _0x2203=function(_0xf7b68,_0x4546f3){_0xf7b68=_0xf7b68-0x0;var _0x8fd0a=_0x2032[_0xf7b68];return _0x8fd0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x2203('0x14'));var logger=require('../../config/logger')(_0x2203('0x15'));var utils=require('../../config/utils');var config=require(_0x2203('0x16'));var licenseUtil=require(_0x2203('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2203('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2203('0x19')](socket);var jayson=require(_0x2203('0x1a'));var client=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232b});var client9004=jayson[_0x2203('0x1b')][_0x2203('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2c36e6,_0x2c085c,_0xdf9d0b,_0x3053f3){return new BPromise(function(_0x5129fb,_0x280eda){var _0x2ee127=_0x3053f3||client;return _0x2ee127['request'](_0x2c36e6,_0xdf9d0b)[_0x2203('0x1d')](function(_0x8906e1){logger['info'](_0x2203('0x1e'),_0x2c085c,'request\x20sent');logger[_0x2203('0x1f')](_0x2203('0x20'),_0x2c085c,_0x2203('0x21'),JSON[_0x2203('0x22')](_0x8906e1));if(_0x8906e1[_0x2203('0x23')]){if(_0x8906e1[_0x2203('0x23')]['code']===0x1f4){logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1['error'][_0x2203('0x24')]);return _0x280eda(_0x8906e1['error'][_0x2203('0x24')]);}logger[_0x2203('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x2c085c,_0x8906e1[_0x2203('0x23')]['message']);return _0x5129fb(_0x8906e1['error'][_0x2203('0x24')]);}else{logger[_0x2203('0x25')](_0x2203('0x1e'),_0x2c085c,_0x2203('0x21'));_0x5129fb(_0x8906e1[_0x2203('0x26')][_0x2203('0x24')]);}})[_0x2203('0x27')](function(_0x250349){logger['error'](_0x2203('0x1e'),_0x2c085c,_0x250349);_0x280eda(_0x250349);});});}function respondWithStatusCode(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0xcc;return function(_0x5f11bf){if(_0x5f11bf){return _0x36b958[_0x2203('0x28')](_0x39a11a);}return _0x36b958[_0x2203('0x29')](_0x39a11a)['end']();};}function respondWithResult(_0xd6e109,_0xd91f5d){_0xd91f5d=_0xd91f5d||0xc8;return function(_0x1c6a77){if(_0x1c6a77){return _0xd6e109[_0x2203('0x29')](_0xd91f5d)[_0x2203('0x2a')](_0x1c6a77);}};}function respondWithFilteredResult(_0x1df508,_0x9c53f){return function(_0x5a95c1){if(_0x5a95c1){var _0x34b8ba=typeof _0x9c53f[_0x2203('0x2b')]===_0x2203('0x2c')&&typeof _0x9c53f[_0x2203('0x2d')]==='undefined';var _0x3a8e23=_0x5a95c1[_0x2203('0x2e')];var _0x287c95=_0x34b8ba?0x0:_0x9c53f[_0x2203('0x2b')];var _0x520602=_0x34b8ba?_0x5a95c1[_0x2203('0x2e')]:_0x9c53f[_0x2203('0x2b')]+_0x9c53f['limit'];var _0x5c0157;if(_0x520602>=_0x3a8e23){_0x520602=_0x3a8e23;_0x5c0157=0xc8;}else{_0x5c0157=0xce;}_0x1df508[_0x2203('0x29')](_0x5c0157);return _0x1df508['set']('Content-Range',_0x287c95+'-'+_0x520602+'/'+_0x3a8e23)[_0x2203('0x2a')](_0x5a95c1);}return null;};}function patchUpdates(_0x464c88){return function(_0x191894){try{jsonpatch[_0x2203('0x2f')](_0x191894,_0x464c88,!![]);}catch(_0xf2801d){return BPromise['reject'](_0xf2801d);}return _0x191894[_0x2203('0x30')]();};}function saveUpdates(_0x2324c0,_0x49caec){return function(_0x2a2ee7){if(_0x2a2ee7){return _0x2a2ee7[_0x2203('0x31')](_0x2324c0)[_0x2203('0x1d')](function(_0x4187b4){return _0x4187b4;});}return null;};}function removeEntity(_0x43fee1,_0x24d138){return function(_0x29da55){if(_0x29da55){return _0x29da55[_0x2203('0x32')]()[_0x2203('0x1d')](function(){_0x43fee1['status'](0xcc)[_0x2203('0x33')]();});}};}function handleEntityNotFound(_0x347d3e,_0x56f9b2){return function(_0x54b90b){if(!_0x54b90b){_0x347d3e[_0x2203('0x28')](0x194);}return _0x54b90b;};}function handleError(_0x5e9841,_0x25cc97){_0x25cc97=_0x25cc97||0x1f4;return function(_0x3b1eeb){logger[_0x2203('0x23')](_0x3b1eeb['stack']);if(_0x3b1eeb['name']){delete _0x3b1eeb[_0x2203('0x34')];}_0x5e9841['status'](_0x25cc97)[_0x2203('0x35')](_0x3b1eeb);};}function getMustacheRender(_0x5cfe5e,_0x11451e){return Mustache['render'](_0x5cfe5e,_[_0x2203('0x36')](_0x11451e[_0x2203('0x37')],{'contact':_0x11451e[_0x2203('0x38')],'message':_0x11451e[_0x2203('0x24')],'agent':_0x11451e[_0x2203('0x39')],'interaction':_0x11451e['interaction'],'account':_0x11451e['account']}))||'';}function getInteractionUsers(_0x4c0e9e,_0x7ea79b){return new BPromise(function(_0x25a2dc,_0x323798){try{if(_0x7ea79b[_0x4c0e9e['id']]){_0x4c0e9e[_0x2203('0x3a')]=_[_0x2203('0x3b')](_0x7ea79b[_0x4c0e9e['id']],function(_0x3b250a){return{'id':_0x3b250a['id'],'fullname':_0x3b250a[_0x2203('0x3c')]};});}}catch(_0x590b4e){_0x323798(_0x590b4e);}_0x25a2dc(_0x4c0e9e);});}function getInteractionTags(_0x175945,_0x1b12c3){return new BPromise(function(_0x108fde,_0x26be74){try{if(_0x175945['TagIds']){_0x175945['Tags']=[];_0x175945[_0x2203('0x3d')]['split'](',')[_0x2203('0x3e')](function(_0x446209){_0x175945[_0x2203('0x3f')]['push'](_0x1b12c3[_0x446209]);});}delete _0x175945['TagIds'];}catch(_0x1e7ebc){_0x26be74(_0x1e7ebc);}_0x108fde(_0x175945);});}function updateChatInteraction(_0x3739f6,_0x368444,_0x1e09f3){return new BPromise(function(_0x372709,_0x1fa734){return getInteractionUsers(_0x3739f6,_0x1e09f3)['then'](function(_0x15d3b6){return getInteractionTags(_0x15d3b6,_0x368444);})[_0x2203('0x1d')](function(_0x3a866c){_0x372709(_0x3a866c);})[_0x2203('0x27')](function(_0x16b452){_0x1fa734(_0x16b452);});});}exports[_0x2203('0x40')]=function(_0x5b4842,_0x23a6e8){var _0x36b8e4={},_0x1e34a0={},_0x595281={'count':0x0,'rows':[]};var _0x2e2ca5=_[_0x2203('0x3b')](db[_0x2203('0x41')][_0x2203('0x42')],function(_0x4c3259){return{'name':_0x4c3259['fieldName'],'type':_0x4c3259[_0x2203('0x43')]['key']};});_0x1e34a0[_0x2203('0x44')]=_[_0x2203('0x3b')](_0x2e2ca5,_0x2203('0x34'));_0x1e34a0[_0x2203('0x45')]=_['keys'](_0x5b4842[_0x2203('0x45')]);_0x1e34a0[_0x2203('0x46')]=_['intersection'](_0x1e34a0[_0x2203('0x44')],_0x1e34a0[_0x2203('0x45')]);_0x36b8e4[_0x2203('0x47')]=_[_0x2203('0x48')](_0x1e34a0['model'],qs['fields'](_0x5b4842[_0x2203('0x45')]['fields']));_0x36b8e4['attributes']=_0x36b8e4[_0x2203('0x47')][_0x2203('0x49')]?_0x36b8e4[_0x2203('0x47')]:_0x1e34a0['model'];if(!_0x5b4842['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x36b8e4[_0x2203('0x2d')]=qs[_0x2203('0x2d')](_0x5b4842[_0x2203('0x45')][_0x2203('0x2d')]);_0x36b8e4['offset']=qs[_0x2203('0x2b')](_0x5b4842['query'][_0x2203('0x2b')]);}_0x36b8e4[_0x2203('0x4c')]=qs[_0x2203('0x4d')](_0x5b4842[_0x2203('0x45')]['sort']);_0x36b8e4['where']=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x5b4842[_0x2203('0x45')],_0x1e34a0[_0x2203('0x46')]),_0x2e2ca5);var _0x559370=[];var _0x4de47a=squel['select']()[_0x2203('0x4f')]('id')[_0x2203('0x4f')]('name')[_0x2203('0x4f')](_0x2203('0x50'))['from'](_0x2203('0x51'));var _0xb47204=squel[_0x2203('0x52')]()[_0x2203('0x4f')]('u.id')[_0x2203('0x4f')]('u.fullname')[_0x2203('0x4f')](_0x2203('0x53'))['from'](_0x2203('0x54'),'ui')[_0x2203('0x55')](_0x2203('0x56'),'u',_0x2203('0x57'));var _0x3f335a=squel[_0x2203('0x52')]()['from']('chat_interactions','i')[_0x2203('0x55')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2203('0x55')](_0x2203('0x56'),'o',_0x2203('0x58'))['left_join'](_0x2203('0x59'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x2203('0x5a'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0x2203('0x5b'))[_0x2203('0x55')](_0x2203('0x51'),'t',_0x2203('0x5c'));var _0x26d3d9=squel[_0x2203('0x5d')]();var _0x2baea2=[];var _0x91f70c=squel[_0x2203('0x5d')]();var _0x216641;if(_0x5b4842[_0x2203('0x45')][_0x2203('0x5e')]){_0x216641=as['parseSearch'](_0x5b4842['query'][_0x2203('0x5e')]);var _0x43d8c0=_0x216641[_0x2203('0x5f')];for(var _0x2446be=0x0;_0x2446be<_0x216641[_0x2203('0x60')][_0x2203('0x49')];_0x2446be++){var _0x4f8b8e=_0x216641['conditions'][_0x2446be];var _0xb49120='i';var _0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x4f8b8e[_0x2203('0x4f')]]);if(!_0x34358e){switch(_0x4f8b8e[_0x2203('0x4f')]){case _0x2203('0x62'):if(_0x4f8b8e[_0x2203('0x63')]==0x1){_0x3f335a[_0x2203('0x64')]('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x65'));}else{_0x3f335a['having']('`'+_0x4f8b8e[_0x2203('0x4f')]+_0x2203('0x66'));}break;case _0x2203('0x67'):if(_0x4f8b8e[_0x2203('0x68')]===_0x2203('0x69')){if(_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')]('\x20')[_0x2203('0x49')]>0x1){_0x26d3d9[_0x43d8c0](_0x2203('0x6b'),qs[_0x2203('0x6c')](_0x4f8b8e[_0x2203('0x63')]),null);}else{var _0x6ea7e8='%'+_0x4f8b8e[_0x2203('0x63')]+'%';_0x26d3d9[_0x43d8c0](_0x2203('0x6d'),_0x6ea7e8,_0x6ea7e8,_0x6ea7e8);}}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x6e')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x6e');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d['value'][_0x2203('0x33')]);}break;case _0x2203('0x72'):var _0x1b4f96=_0x4f8b8e[_0x2203('0x63')][_0x2203('0x6a')](',')['map'](function(_0x38b077){return Number(_0x38b077);});_0x1b4f96[_0x2203('0x3e')](function(_0x1c63bf){_0x91f70c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c63bf+',%');});_0x2baea2=_['union'](_0x2baea2,_0x1b4f96);break;case'User':if(_0x4f8b8e['operator']==='$substring'){_0x26d3d9[_0x43d8c0](_0x2203('0x73'),'%'+_0x4f8b8e[_0x2203('0x63')]+'%',null);}else{_0x34358e=_[_0x2203('0x61')](_0x2e2ca5,[_0x2203('0x34'),_0x2203('0x74')]);_0x4f8b8e[_0x2203('0x4f')]=_0x2203('0x74');_0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e['type'],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d['text'],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}break;case _0x2203('0x37'):_0xf16e1d=as[_0x2203('0x6f')]('me',null,_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);break;}}else{var _0xf16e1d=as[_0x2203('0x6f')](_0xb49120,_0x34358e[_0x2203('0x43')],_0x4f8b8e);_0x26d3d9[_0x43d8c0](_0xf16e1d[_0x2203('0x70')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x71')],_0xf16e1d[_0x2203('0x63')][_0x2203('0x33')]);}}}else{var _0x4b2e4f=_(_0x5b4842[_0x2203('0x45')])['keys']()[_0x2203('0x3b')](function(_0x55ecbb){return _[_0x2203('0x75')](_0x2e2ca5,[_0x2203('0x34'),_0x55ecbb])?_0x55ecbb:undefined;})[_0x2203('0x76')]()[_0x2203('0x63')]();if(!_[_0x2203('0x77')](_0x4b2e4f)){_0x4b2e4f[_0x2203('0x3e')](function(_0x3e1583){if(_0x3e1583===_0x2203('0x78')){_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x2203('0x79')](_0x5b4842[_0x2203('0x45')][_0x3e1583]));}else if(_0x3e1583===_0x2203('0x7a')){var _0x484549=JSON['parse'](_0x5b4842['query'][_0x3e1583])[_0x2203('0x7b')];var _0x2d26ba=JSON[_0x2203('0x7c')](_0x5b4842[_0x2203('0x45')][_0x3e1583])['$lte'];_0x3f335a[_0x2203('0x7d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x484549,_0x2d26ba);}else{if(_0x5b4842[_0x2203('0x45')][_0x3e1583]===_0x2203('0x7e')){_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+_0x2203('0x7f'));}else{_0x3f335a[_0x2203('0x7d')]('i.'+_0x3e1583+'\x20=\x20?',_0x5b4842[_0x2203('0x45')][_0x3e1583]);}}});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x80')]){if(_0x5b4842['query'][_0x2203('0x80')]==0x1){_0x3f335a[_0x2203('0x64')](_0x2203('0x81'));}else{_0x3f335a[_0x2203('0x64')](_0x2203('0x82'));}}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]){_0x2baea2=_[_0x2203('0x84')](_0x5b4842[_0x2203('0x45')][_0x2203('0x83')])?_0x5b4842[_0x2203('0x45')]['tag']:new Array(_0x5b4842[_0x2203('0x45')][_0x2203('0x83')]);_0x2baea2[_0x2203('0x3e')](function(_0x2da37c){_0x91f70c['or'](_0x2203('0x85'),'%,'+_0x2da37c+',%');});}if(_0x5b4842[_0x2203('0x45')][_0x2203('0x86')]){var _0x2a5a4b=_0x5b4842[_0x2203('0x45')][_0x2203('0x86')][_0x2203('0x87')]('\x5c','\x5c\x5c')[_0x2203('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2a5a4b)){_0x26d3d9['or']('i.id\x20LIKE\x20?',_0x2a5a4b+'%');}else{_0x26d3d9['or'](_0x2203('0x88'),qs[_0x2203('0x6c')](_0x2a5a4b))['or'](_0x2203('0x89'),_0x2a5a4b+'%');}}}_0x3f335a[_0x2203('0x7d')](_0x26d3d9);_0x3f335a[_0x2203('0x8a')]('i.id');var _0x16e518={'type':db[_0x2203('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4edac6=_0x3f335a['clone']();_0x4edac6['field'](_0x2203('0x8c'));_0x4edac6[_0x2203('0x4f')](_0x2203('0x8d'),'unreadMessages');if(_0x36b8e4['order']){_0x36b8e4['order'][_0x2203('0x3e')](function(_0x1e90c4){var _0x15d061=_0x1e90c4[0x0]===_0x2203('0x8e')?_0x1e90c4[0x0]:'i.'+_0x1e90c4[0x0];_0x3f335a[_0x2203('0x4c')](_0x15d061,_0x1e90c4[0x1]===_0x2203('0x8f')?![]:!![]);});}if(!_[_0x2203('0x77')](_0x2baea2)){_0x3f335a['having'](_0x91f70c);_0x4edac6[_0x2203('0x7d')](_0x2203('0x90'),_0x2baea2);}BPromise[_0x2203('0x91')]()[_0x2203('0x1d')](function(){if(!_0x216641){if(_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return;_0x4edac6[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3f335a[_0x2203('0x7d')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5b4842['user'][_0x2203('0x92')]!=='agent')return;return _0x5b4842[_0x2203('0x93')][_0x2203('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x29d545){if(_[_0x2203('0x77')](_0x29d545)){_0x4edac6[_0x2203('0x7d')](_0x2203('0x95'));_0x3f335a[_0x2203('0x7d')](_0x2203('0x95'));}else{_0x4edac6['where'](_0x2203('0x96'),_[_0x2203('0x3b')](_0x29d545,'id'));_0x3f335a['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x2203('0x3b')](_0x29d545,'id'));}});})[_0x2203('0x1d')](function(){if(_0x5b4842[_0x2203('0x93')][_0x2203('0x92')]===_0x2203('0x39')&&!_0x216641&&!_0x5b4842[_0x2203('0x45')][_0x2203('0x78')])return[];return db[_0x2203('0x97')][_0x2203('0x45')](_0x4edac6[_0x2203('0x98')](),_0x16e518);})[_0x2203('0x1d')](function(_0x413729){_0x595281[_0x2203('0x2e')]=_0x413729[_0x2203('0x49')];if(_0x595281[_0x2203('0x2e')]===0x0)return[];return db[_0x2203('0x97')]['query'](_0x4de47a['toString'](),_0x16e518)[_0x2203('0x1d')](function(_0x1295a3){_0x559370=_['keyBy'](_0x1295a3,'id');_0x16e518=_[_0x2203('0x36')](_0x16e518,{'model':db[_0x2203('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b4842['query'][_0x2203('0x99')]){_0x36b8e4[_0x2203('0x47')]['forEach'](function(_0x21f357){_0x3f335a[_0x2203('0x4f')]('i.'+_0x21f357);});}else{_0x3f335a['field'](_0x2203('0x8d'),_0x2203('0x62'));_0x3f335a[_0x2203('0x4f')](_0x2203('0x9a'),'Account.key');_0x3f335a['field'](_0x2203('0x9b'),_0x2203('0x9c'));_0x3f335a[_0x2203('0x4f')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9d'));_0x3f335a[_0x2203('0x4f')]('c.firstName','Contact.firstName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9e'),'Contact.lastName');_0x3f335a[_0x2203('0x4f')](_0x2203('0x9f'),'Contact.email');_0x3f335a[_0x2203('0x4f')]('c.phone',_0x2203('0xa0'));_0x3f335a['field']('c.mobile','Contact.mobile');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa1'),'Contact.fax');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa2'),_0x2203('0xa3'));_0x3f335a['field'](_0x2203('0xa4'),'Owner.internal');_0x3f335a[_0x2203('0x4f')](_0x2203('0xa5'),'TagIds');}if(_0x36b8e4[_0x2203('0x2d')])_0x3f335a[_0x2203('0x2d')](_0x36b8e4['limit']);if(_0x36b8e4[_0x2203('0x2b')])_0x3f335a[_0x2203('0x2b')](_0x36b8e4[_0x2203('0x2b')]);return db[_0x2203('0x97')][_0x2203('0x45')](_0x3f335a['toString'](),_0x16e518);})[_0x2203('0x1d')](function(_0x1b5185){if(_0x1b5185[_0x2203('0x49')]>0x0)_0xb47204[_0x2203('0x7d')](_0x2203('0xa6'),_[_0x2203('0x3b')](_0x1b5185,'id'));return db['sequelize'][_0x2203('0x45')](_0xb47204[_0x2203('0x98')](),_0x16e518)['then'](function(_0x13fc7b){var _0x5e0bff=_[_0x2203('0xa7')](_0x13fc7b,_0x2203('0xa8'));var _0xc611e8=[];_0x1b5185['forEach'](function(_0xab7f0b){_0xc611e8[_0x2203('0xa9')](updateChatInteraction(_0xab7f0b,_0x559370,_0x5e0bff));});return BPromise[_0x2203('0xaa')](_0xc611e8);});});})[_0x2203('0x1d')](function(_0x2c275f){_0x595281[_0x2203('0xab')]=_0x2c275f;return _0x595281;})[_0x2203('0x1d')](respondWithFilteredResult(_0x23a6e8,_0x36b8e4))['catch'](handleError(_0x23a6e8,null));};exports['show']=function(_0x106534,_0x41eb4c){var _0x25996c={'raw':![],'where':{'id':_0x106534[_0x2203('0xac')]['id']}},_0x4e1f55={};_0x4e1f55[_0x2203('0x44')]=_[_0x2203('0xad')](db['ChatInteraction'][_0x2203('0x42')]);_0x4e1f55[_0x2203('0x45')]=_['keys'](_0x106534[_0x2203('0x45')]);_0x4e1f55['filters']=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],_0x4e1f55['query']);_0x25996c[_0x2203('0x47')]=_[_0x2203('0x48')](_0x4e1f55[_0x2203('0x44')],qs[_0x2203('0x99')](_0x106534[_0x2203('0x45')][_0x2203('0x99')]));_0x25996c[_0x2203('0x47')]=_0x25996c[_0x2203('0x47')][_0x2203('0x49')]?_0x25996c[_0x2203('0x47')]:_0x4e1f55[_0x2203('0x44')];if(_0x106534[_0x2203('0x45')]['includeAll']){_0x25996c[_0x2203('0xae')]=[{'all':!![]}];}_0x25996c=_['merge']({},_0x25996c,_0x106534[_0x2203('0xaf')]);return db[_0x2203('0x41')][_0x2203('0x61')](_0x25996c)[_0x2203('0x1d')](handleEntityNotFound(_0x41eb4c,null))[_0x2203('0x1d')](respondWithResult(_0x41eb4c,null))[_0x2203('0x27')](handleError(_0x41eb4c,null));};exports[_0x2203('0xb0')]=function(_0x8f9f98,_0x36205d){return db[_0x2203('0x41')][_0x2203('0xb0')](_0x8f9f98['body'],{})[_0x2203('0x1d')](respondWithResult(_0x36205d,0xc9))['catch'](handleError(_0x36205d,null));};exports[_0x2203('0x31')]=function(_0x3deb3b,_0x6b8ea4){if(_0x3deb3b['body']['id']){delete _0x3deb3b[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3deb3b[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x6b8ea4,null))['then'](saveUpdates(_0x3deb3b[_0x2203('0x37')],null))['then'](respondWithResult(_0x6b8ea4,null))[_0x2203('0x27')](handleError(_0x6b8ea4,null));};exports[_0x2203('0x32')]=function(_0x5f5270,_0x376954){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x5f5270[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x376954,null))[_0x2203('0x1d')](removeEntity(_0x376954,null))['catch'](handleError(_0x376954,null));};exports['describe']=function(_0x4055eb,_0x95b45a){return db[_0x2203('0x41')][_0x2203('0xb1')]()[_0x2203('0x1d')](respondWithResult(_0x95b45a,null))[_0x2203('0x27')](handleError(_0x95b45a,null));};exports[_0x2203('0xb2')]=function(_0x4b6d6f,_0xb40f2b){var _0x4769ee=_0x4b6d6f[_0x2203('0xac')]['id'];var _0x492179;var _0x4fc1cc;var _0x4d6ece;return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4769ee}})[_0x2203('0x1d')](function(_0x2d1ee6){_0x492179=_0x2d1ee6;return db['ChatWebsite'][_0x2203('0xb3')]({'where':{'id':_0x2d1ee6[_0x2203('0x78')]},'attributes':['id',_0x2203('0xb4'),_0x2203('0xb5'),'vidaooTopic','vidaooNote',_0x2203('0xb6')],'raw':!![]});})[_0x2203('0x1d')](function(_0x1ed416){if(_0x1ed416&&_0x1ed416['vidaooApiKey']&&_0x1ed416[_0x2203('0xb5')]){_0x4fc1cc=_0x1ed416;var _0x28bf0a={'interaction':{'id':_0x4769ee},'agent':{'id':_0x4b6d6f[_0x2203('0x93')]['id'],'name':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x34')],'fullname':_0x4b6d6f[_0x2203('0x93')][_0x2203('0x3c')],'email':_0x4b6d6f['user'][_0x2203('0xb7')]},'contact':_0x4b6d6f[_0x2203('0x37')][_0x2203('0x38')],'account':_0x4b6d6f[_0x2203('0x37')][_0x2203('0xb8')]};var _0x4457c9={'rejectUnauthorized':![],'method':_0x2203('0xb9'),'url':_0x2203('0xba'),'headers':{'X-APIKEY':_0x1ed416[_0x2203('0xb4')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4b6d6f['user'][_0x2203('0xb7')]],'buttons':null,'topic':_0x4fc1cc[_0x2203('0xbb')],'note':_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xbd')])?null:getMustacheRender(_0x4fc1cc['vidaooNote'],_0x28bf0a),'metadata':null},'redirect':_0x2203('0xbe'),'json':!![]};try{if(!_[_0x2203('0xbc')](_0x4fc1cc[_0x2203('0xb6')])){var _0x19ef05=getMustacheRender(_0x4fc1cc[_0x2203('0xb6')],_0x28bf0a);var _0x3f3062=JSON[_0x2203('0x7c')](_0x19ef05);_0x4457c9[_0x2203('0x37')][_0x2203('0xbf')]=_0x3f3062;}}catch(_0x597e49){throw new db['Sequelize'][(_0x2203('0xc0'))](_0x2203('0xc1'));}return rp(_0x4457c9);}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x2203('0x1d')](function(_0x289cde){_0x4d6ece=_0x289cde;if(_0x4d6ece['id']){var _0x5d5e8e={'body':_0x4d6ece[_0x2203('0xc2')],'ChatWebsiteId':_0x4fc1cc['id'],'ChatInteractionId':_0x492179['id'],'direction':_0x2203('0xc3'),'UserId':_0x4b6d6f[_0x2203('0x93')]['id']};return db[_0x2203('0xc4')]['create'](_0x5d5e8e,{});}else{throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xc5'));}})['then'](function(){return _0x492179[_0x2203('0xc6')]({'vidaooSessionId':_0x4d6ece['id']});})[_0x2203('0x1d')](respondWithResult(_0xb40f2b,null))[_0x2203('0x27')](handleError(_0xb40f2b,null));};exports['customUpdate']=function(_0x590035,_0x207c86){if(_0x590035[_0x2203('0x37')]['id']){delete _0x590035[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')]['find']({'where':{'id':_0x590035[_0x2203('0xac')]['id']},'include':[{'model':db[_0x2203('0xc7')],'as':_0x2203('0x67')}]})['then'](handleEntityNotFound(_0x207c86,null))['then'](saveUpdates(_0x590035[_0x2203('0x37')],null))[_0x2203('0x1d')](respondWithResult(_0x207c86,null))[_0x2203('0x27')](handleError(_0x207c86,null));};exports[_0x2203('0xc8')]=function(_0x401831,_0x410894,_0x2b0d0b){if(_0x401831[_0x2203('0x37')]['id']){delete _0x401831[_0x2203('0x37')]['id'];}return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x401831['params']['id']}})[_0x2203('0x1d')](function(_0x5edebd){if(!_0x5edebd){logger[_0x2203('0x23')](_0x2203('0xc9'),_0x2203('0xc8'),0x194,_0x2203('0xca'));_0x410894[_0x2203('0x28')](0x194);}else{if(_0x5edebd['UserId']){throw new db[(_0x2203('0x8b'))][(_0x2203('0xc0'))](_0x2203('0xcb'));}}return _0x5edebd;})['then'](function(_0xe9cd8f){if(_0xe9cd8f){return _0xe9cd8f[_0x2203('0x31')]({'closed':_0x401831[_0x2203('0x37')][_0x2203('0xcc')],'disposition':_0x401831['body'][_0x2203('0xcd')]})[_0x2203('0x1d')](function(_0x4508c3){return _0x4508c3;});}})[_0x2203('0x1d')](function(_0x4e3ea8){return respondWithRpcPromise(_0x2203('0xce'),_0x2203('0xc8'),_0x401831['body'],client9004);})[_0x2203('0x1d')](respondWithResult(_0x410894,null))[_0x2203('0x27')](handleError(_0x410894,null));};exports['attachmentUpload']=function(_0x5cb5be,_0x54f1a1,_0x5d21eb){_0x5cb5be[_0x2203('0x37')]['name']=_0x5cb5be[_0x2203('0xcf')]['originalname'];_0x5cb5be['body'][_0x2203('0xd0')]=_0x5cb5be['file'][_0x2203('0xd1')];_0x5cb5be['body'][_0x2203('0x43')]=_0x5cb5be[_0x2203('0xcf')][_0x2203('0xd2')];return db[_0x2203('0xd3')][_0x2203('0xb0')](_0x5cb5be[_0x2203('0x37')])[_0x2203('0x1d')](respondWithResult(_0x54f1a1,0xc9))[_0x2203('0x27')](handleError(_0x54f1a1,null));};exports[_0x2203('0xd4')]=function(_0xabe2eb,_0x453179,_0x359968){return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0xac')]['id']},'raw':!![]})[_0x2203('0x1d')](handleEntityNotFound(_0x453179,null))[_0x2203('0x1d')](function(_0x3d2ba9){if(_0x3d2ba9){if(_0x3d2ba9[_0x2203('0xcc')]){return _0x453179['status'](0x193)[_0x2203('0x2a')]({'status':0x193,'message':_0x2203('0xd5')});}return db[_0x2203('0xd3')][_0x2203('0xb3')]({'where':{'id':_0xabe2eb[_0x2203('0x45')][_0x2203('0xd6')]},'raw':!![]})['then'](handleEntityNotFound(_0x453179,null));}})[_0x2203('0x1d')](function(_0x5a9d4e){if(_0x5a9d4e){var _0x3217a3=_0x5a9d4e['ChatOfflineMessageId']!==null;var _0x219e9d=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0xd9'));if(_0x3217a3){_0x219e9d=path['join'](_0x219e9d,_0x2203('0xda'));}var _0x4598cb=path[_0x2203('0xd7')](_0x219e9d,_0x5a9d4e[_0x2203('0xd0')]);return _0x453179[_0x2203('0xdb')](_0x4598cb);}})[_0x2203('0x27')](handleError(_0x453179,null));};exports[_0x2203('0xdc')]=function(_0x38fb99,_0x5bcf17){var _0x581d9f=null;var _0x5ddb1a=null;var _0x358ab1=null;var _0x5b8c97=null;if(_0x38fb99[_0x2203('0x37')]['id']){delete _0x38fb99[_0x2203('0x37')]['id'];}if(_0x38fb99['body']['mailTranscript']){_0x5b8c97=path[_0x2203('0xd7')](config[_0x2203('0xd8')],'server/files/chat/upload/',util[_0x2203('0xdd')](_0x2203('0xde'),Date[_0x2203('0xdf')]()));_0x38fb99['body'][_0x2203('0xe0')]=_0x5b8c97;}return db['ChatInteraction'][_0x2203('0x61')]({'where':{'id':_0x38fb99['params']['id']},'include':[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'include':[{'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2')}]}]})['then'](handleEntityNotFound(_0x5bcf17,null))[_0x2203('0x1d')](saveUpdates(_0x38fb99['body'],null))[_0x2203('0x1d')](function(_0x5f098d){if(_0x5f098d){_0x581d9f=_0x5f098d;return db[_0x2203('0xe3')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x78')]}});}})[_0x2203('0x1d')](function(_0x5c2159){if(_0x5c2159){_0x358ab1=_0x5c2159;return db[_0x2203('0xc7')][_0x2203('0x61')]({'where':{'id':_0x581d9f[_0x2203('0x6e')]}});}})[_0x2203('0x1d')](function(_0x23daeb){if(_0x23daeb){_0x5ddb1a=_0x23daeb;if(_0x5b8c97){var _0x2ad175=null;for(var _0x3ca475=0x1;_0x3ca475<_0x581d9f[_0x2203('0xe1')][_0x2203('0x49')];++_0x3ca475){_0x2ad175=_0x581d9f[_0x2203('0xe1')][_0x3ca475];var _0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):'System';var _0x4cf298=_0x38fb99[_0x2203('0x37')][_0x2203('0xe6')]||util[_0x2203('0xdd')](_0x2203('0xe4'),_0x2203('0xe7'),_0x2ad175[_0x2203('0x6e')]);switch(_0x358ab1['agentIdentifier']){case _0x2203('0xe8'):_0x199849=_0x2ad175[_0x2203('0x74')]?util['format']('%s%d',_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');break;case _0x2203('0xea'):_0x199849=_0x2ad175['UserId']?_0x2ad175[_0x2203('0xe2')][_0x2203('0xeb')]||_0x2ad175['User'][_0x2203('0x3c')]:'System';break;case _0x2203('0xec'):_0x199849=_0x2ad175[_0x2203('0x74')]?_0x2ad175[_0x2203('0xe2')]['fullname']:_0x2203('0xe9');break;default:_0x199849=_0x2ad175[_0x2203('0x74')]?util[_0x2203('0xdd')](_0x2203('0xe4'),_0x358ab1[_0x2203('0xe5')],_0x2ad175['UserId']):_0x2203('0xe9');}var _0x20f50b=util[_0x2203('0xdd')](_0x2203('0xed'),moment(_0x2ad175['createdAt'])[_0x2203('0xdd')](_0x2203('0xee')),_0x2ad175[_0x2203('0xef')]==='in'?_0x4cf298:_0x199849,_0x2ad175[_0x2203('0x37')]);if(!_0x2ad175[_0x2203('0xf0')]){fs['appendFileSync'](_0x5b8c97,_0x20f50b);}}return db[_0x2203('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2203('0xf2')],'as':_0x2203('0xf3'),'raw':!![]}]});}}})[_0x2203('0x1d')](function(_0x16686c){if(_0x16686c&&_0x16686c['Smtp']&&_0x38fb99[_0x2203('0x37')]){var _0x21dfbc={'tls':{'rejectUnauthorized':![]}};if(_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')]){_0x21dfbc[_0x2203('0xf4')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf4')];}else{_0x21dfbc[_0x2203('0xf5')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf5')];_0x21dfbc[_0x2203('0xf6')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf6')];_0x21dfbc[_0x2203('0xf7')]=_0x16686c[_0x2203('0xf3')][_0x2203('0xf7')];}if(_0x16686c['Smtp']['authentication']){_0x21dfbc['auth']={'user':_0x16686c[_0x2203('0xf3')][_0x2203('0x93')],'pass':_0x16686c[_0x2203('0xf3')]['pass']};}return respondWithRpcPromise(_0x2203('0xf8'),_0x2203('0xf9'),{'account':_0x21dfbc,'message':{'from':util[_0x2203('0xdd')](_0x2203('0xfa'),_0x16686c[_0x2203('0x34')],_0x16686c['email']||_0x16686c[_0x2203('0xf3')][_0x2203('0x93')]),'to':_0x38fb99[_0x2203('0x37')][_0x2203('0xfb')],'subject':_0x2203('0xfc'),'text':util['format'](_0x2203('0xfd'),_0x38fb99[_0x2203('0x37')]['mailTranscript']),'attachments':[{'path':_0x5b8c97}]}})['then'](function(){return _0x581d9f;})[_0x2203('0x27')](function(_0xfd2832){console[_0x2203('0x23')](_0xfd2832);});}else{return _0x581d9f;}})[_0x2203('0x1d')](respondWithStatusCode(_0x5bcf17,0xc8))[_0x2203('0x27')](handleError(_0x5bcf17,null));};exports[_0x2203('0xfe')]=function(_0x50d583,_0x5f01c0,_0x30df28){return db[_0x2203('0xc4')][_0x2203('0x61')]({'where':{'id':_0x50d583[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0x5f01c0,null))[_0x2203('0x1d')](function(_0x3fa96f){if(_0x3fa96f){return _0x3fa96f['addMessage'](_0x50d583[_0x2203('0x37')]['ids'],_[_0x2203('0xff')](_0x50d583[_0x2203('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x5f01c0,null))[_0x2203('0x27')](handleError(_0x5f01c0,null));};exports[_0x2203('0x100')]=function(_0x4dccbf,_0x2bc31c,_0x5807ef){var _0x45a460={'raw':![],'where':{}};var _0x59eb03={};var _0x2964d7={'count':0x0,'rows':[]};return db[_0x2203('0x41')][_0x2203('0xb3')]({'where':{'id':_0x4dccbf['params']['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x2bc31c,null))[_0x2203('0x1d')](function(_0x46d93b){if(_0x46d93b){_0x59eb03[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')][_0x2203('0x42')]);_0x59eb03[_0x2203('0x45')]=_[_0x2203('0xad')](_0x4dccbf[_0x2203('0x45')]);_0x59eb03['filters']=_[_0x2203('0x48')](_0x59eb03['model'],_0x59eb03[_0x2203('0x45')]);_0x45a460[_0x2203('0x47')]=_[_0x2203('0x48')](_0x59eb03[_0x2203('0x44')],qs['fields'](_0x4dccbf['query'][_0x2203('0x99')]));_0x45a460['attributes']=_0x45a460[_0x2203('0x47')]['length']?_0x45a460[_0x2203('0x47')]:_0x59eb03['model'];if(!_0x4dccbf['query'][_0x2203('0x4a')](_0x2203('0x4b'))){_0x45a460['limit']=qs[_0x2203('0x2d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2d')]);_0x45a460[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x2b')]);}_0x45a460['order']=qs[_0x2203('0x4d')](_0x4dccbf[_0x2203('0x45')][_0x2203('0x4d')]);_0x45a460[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x4dccbf[_0x2203('0x45')],_0x59eb03[_0x2203('0x46')]));_0x45a460[_0x2203('0x7d')][_0x2203('0xa8')]=_0x46d93b['id'];if(_0x4dccbf['query'][_0x2203('0x86')]){_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0x45a460[_0x2203('0x47')],function(_0x36d988){var _0x36141a={};_0x36141a[_0x36d988]={'$like':'%'+_0x4dccbf[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x36141a;})});}if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x7b')]){var _0x2c7cc8=_0x4dccbf['query'][_0x2203('0x7b')][_0x2203('0x6a')](',');var _0x481a3e={};_0x481a3e[_0x2c7cc8[0x0]]={'$gte':moment(_0x2c7cc8[0x1])[_0x2203('0xdd')](_0x2203('0x101'))};_0x45a460[_0x2203('0x7d')]=_[_0x2203('0x36')](_0x45a460[_0x2203('0x7d')],_0x481a3e);}_0x45a460=_[_0x2203('0x36')]({},_0x45a460,_0x4dccbf[_0x2203('0xaf')]);return db[_0x2203('0xc4')][_0x2203('0x2e')]({'where':_0x45a460['where']})[_0x2203('0x1d')](function(_0x2485d3){_0x2964d7[_0x2203('0x2e')]=_0x2485d3;if(_0x4dccbf[_0x2203('0x45')][_0x2203('0x102')]){_0x45a460[_0x2203('0xae')]=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0x45a460);})['then'](function(_0xc53b76){_0x2964d7['rows']=_0xc53b76;return _0x2964d7;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x2bc31c,_0x45a460))['catch'](handleError(_0x2bc31c,null));};exports[_0x2203('0x104')]=function(_0x581c4f,_0x3c279b,_0x4031b7){var _0xa9cf5a={'where':{}},_0x135b65={},_0x3c4bc3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2203('0xb3')]({'where':{'id':_0x581c4f[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x3c279b,null))[_0x2203('0x1d')](function(_0x203956){if(_0x203956){_0x135b65[_0x2203('0x44')]=_[_0x2203('0xad')](db[_0x2203('0xc4')]['rawAttributes']);_0x135b65['query']=_['keys'](_0x581c4f[_0x2203('0x45')]);_0x135b65['filters']=_['intersection'](_0x135b65[_0x2203('0x44')],_0x135b65[_0x2203('0x45')]);_0xa9cf5a['attributes']=_['intersection'](_0x135b65[_0x2203('0x44')],qs[_0x2203('0x99')](_0x581c4f[_0x2203('0x45')]['fields']));_0xa9cf5a[_0x2203('0x47')]=_0xa9cf5a[_0x2203('0x47')][_0x2203('0x49')]?_0xa9cf5a[_0x2203('0x47')]:_0x135b65[_0x2203('0x44')];if(!_0x581c4f[_0x2203('0x45')]['hasOwnProperty'](_0x2203('0x4b'))){_0xa9cf5a['limit']=qs[_0x2203('0x2d')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2d')]);_0xa9cf5a[_0x2203('0x2b')]=qs[_0x2203('0x2b')](_0x581c4f[_0x2203('0x45')][_0x2203('0x2b')]);}_0xa9cf5a['order']=qs[_0x2203('0x4d')](_0x581c4f[_0x2203('0x45')]['sort']);_0xa9cf5a[_0x2203('0x7d')]=qs[_0x2203('0x46')](_[_0x2203('0x4e')](_0x581c4f[_0x2203('0x45')],_0x135b65[_0x2203('0x46')]));_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xa8')]=_0x203956['id'];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]){_0xa9cf5a[_0x2203('0x7d')]=_['merge'](_0xa9cf5a[_0x2203('0x7d')],{'$or':_[_0x2203('0x3b')](_0xa9cf5a[_0x2203('0x47')],function(_0x4a6a84){var _0x361282={};_0x361282[_0x4a6a84]={'$like':'%'+_0x581c4f[_0x2203('0x45')][_0x2203('0x86')]+'%'};return _0x361282;})});}_0xa9cf5a[_0x2203('0x7d')][_0x2203('0xf0')]=![];if(_0x581c4f[_0x2203('0x45')]['id']){_0xa9cf5a[_0x2203('0x7d')]['id']={'$gt':_0x581c4f[_0x2203('0x45')]['id']};}_0xa9cf5a=_[_0x2203('0x36')]({},_0xa9cf5a,_0x581c4f[_0x2203('0xaf')]);return db[_0x2203('0xc4')]['count']({'where':_0xa9cf5a[_0x2203('0x7d')]})[_0x2203('0x1d')](function(_0x554450){_0x3c4bc3[_0x2203('0x2e')]=_0x554450;_0xa9cf5a[_0x2203('0xae')]=[];if(_0x581c4f[_0x2203('0x45')][_0x2203('0x105')]){_0xa9cf5a[_0x2203('0xae')][_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c'),'alias']});}if(_0x581c4f[_0x2203('0x45')][_0x2203('0x102')]){_0xa9cf5a['include']=[{'all':!![]}];}return db[_0x2203('0xc4')][_0x2203('0x103')](_0xa9cf5a);})[_0x2203('0x1d')](function(_0x291aef){_0x3c4bc3[_0x2203('0xab')]=_0x291aef;return _0x3c4bc3;});}})[_0x2203('0x1d')](respondWithFilteredResult(_0x3c279b,_0xa9cf5a))[_0x2203('0x27')](handleError(_0x3c279b,null));};exports[_0x2203('0x106')]=function(_0x3e2390,_0x44d30c,_0x46c088){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x3e2390[_0x2203('0xac')]['id']}})[_0x2203('0x1d')](handleEntityNotFound(_0x44d30c,null))['then'](function(_0x42669a){if(_0x42669a){return _0x42669a['setTags'](_0x3e2390['body'][_0x2203('0x107')],_['omit'](_0x3e2390['body'],['ids','id'])||{})['spread'](function(){return db[_0x2203('0x72')][_0x2203('0x103')]({'attributes':['id',_0x2203('0x34'),_0x2203('0x50')],'where':{'id':_0x3e2390['body'][_0x2203('0x107')]}});})[_0x2203('0x1d')](function(_0x44ff9f){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]});return{'id':Number(_0x3e2390[_0x2203('0xac')]['id']),'tags':_0x44ff9f||[]};});}})[_0x2203('0x1d')](respondWithResult(_0x44d30c,null))[_0x2203('0x27')](handleError(_0x44d30c,null));};exports[_0x2203('0x108')]=function(_0x2c0df7,_0xdd4efc,_0x2481f5){return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x2c0df7[_0x2203('0xac')]['id']}})['then'](handleEntityNotFound(_0xdd4efc,null))['then'](function(_0x135655){if(_0x135655){return _0x135655[_0x2203('0x108')](_0x2c0df7[_0x2203('0x45')][_0x2203('0x107')]);}})['then'](respondWithStatusCode(_0xdd4efc,null))[_0x2203('0x27')](handleError(_0xdd4efc,null));};exports[_0x2203('0xdb')]=function(_0x4718f4,_0x5b771e){var _0x3dd02d=moment()[_0x2203('0x109')]()[_0x2203('0x98')]();var _0x552a73=path[_0x2203('0xd7')](config['root'],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10c'));var _0x2111b4=path[_0x2203('0xd7')](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x10b'),_0x2203('0x10d'));var _0x20a488=path[_0x2203('0xd7')](_0x552a73,_0x3dd02d);var _0x505c2a=util[_0x2203('0xdd')](_0x2203('0x10e'),_0x4718f4[_0x2203('0xac')]['id'],_0x3dd02d);var _0x44ae18=path[_0x2203('0xd7')](_0x552a73,_0x505c2a);var _0x3fbe4c=[];_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0xe2'),'attributes':['id',_0x2203('0x3c')],'raw':!![]});_0x3fbe4c[_0x2203('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x2203('0x10f'),_0x2203('0x110')],'raw':!![]});if(_0x4718f4[_0x2203('0x45')][_0x2203('0x10d')]){_0x3fbe4c[_0x2203('0xa9')]({'model':db[_0x2203('0xd3')],'as':_0x2203('0xd3'),'raw':!![]});}var _0x10081d=[{'model':db[_0x2203('0xc4')],'as':_0x2203('0xe1'),'attributes':['id',_0x2203('0x37'),_0x2203('0x7a'),'direction','secret',_0x2203('0x80')],'include':_0x3fbe4c}];_0x10081d['push']({'model':db['ChatWebsite'],'as':_0x2203('0x111'),'attributes':['id','name']});_0x10081d[_0x2203('0xa9')]({'model':db[_0x2203('0xe2')],'as':_0x2203('0x112'),'attributes':['id',_0x2203('0x3c')]});return db[_0x2203('0x41')][_0x2203('0x61')]({'where':{'id':_0x4718f4[_0x2203('0xac')]['id']},'include':_0x10081d})[_0x2203('0x1d')](handleEntityNotFound(_0x5b771e,null))[_0x2203('0x1d')](function(_0x51dbc8){if(_0x51dbc8){var _0xd584ee=_0x51dbc8['get']({'plain':!![]});fs[_0x2203('0x113')](_0x20a488);var _0x1c36d4={'channel':_0x2203('0x114'),'account':_0xd584ee[_0x2203('0x111')][_0x2203('0x34')],'agent':_0xd584ee['Owner']?_0xd584ee[_0x2203('0x112')]['fullname']:_0x2203('0x115'),'createdAt':moment(_0xd584ee['createdAt'])['format'](_0x2203('0x101'))[_0x2203('0x98')](),'closedAt':_0xd584ee[_0x2203('0xcc')]?moment(_0xd584ee[_0x2203('0x116')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')]():'','disposition':_0xd584ee[_0x2203('0xcd')],'chatInfo':{'browser':_0xd584ee[_0x2203('0x117')],'os':_0xd584ee['osName'],'referer':_0xd584ee['referer'],'customerIp':_0xd584ee[_0x2203('0x118')],'customerPort':_0xd584ee[_0x2203('0x119')]?_0xd584ee[_0x2203('0x119')]:_0x2203('0x115')},'messages':_(_0xd584ee[_0x2203('0xe1')])[_0x2203('0x11a')]()[_0x2203('0x86')]({'secret':![]})[_0x2203('0x3b')](function(_0x2fc5cf){if(_0x2fc5cf[_0x2203('0xd3')]){var _0x2097be=path['join'](_0x2111b4,_0x2fc5cf['Attachment'][_0x2203('0xd0')]);if(fs['existsSync'](_0x2097be)){fs[_0x2203('0x11b')](_0x2097be)[_0x2203('0x11c')](fs['createWriteStream'](path['join'](_0x20a488,_0x2fc5cf[_0x2203('0xd3')][_0x2203('0xd0')])));}}return{'date':moment(_0x2fc5cf[_0x2203('0x7a')])[_0x2203('0xdd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2203('0x98')](),'sender':_0x2fc5cf[_0x2203('0xef')]==='out'?_0x2fc5cf[_0x2203('0xe2')]?_0x2fc5cf['User'][_0x2203('0x3c')]:'System':_0x2fc5cf[_0x2203('0x67')][_0x2203('0x10f')]+(_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]?'\x20'+_0x2fc5cf[_0x2203('0x67')][_0x2203('0x110')]:''),'body':_0x2fc5cf[_0x2203('0xd3')]?_0x2fc5cf['Attachment'][_0x2203('0xd0')]:_0x2fc5cf['body'],'direction':_0x2fc5cf[_0x2203('0xef')]===_0x2203('0xc3')?'A':'C','secret':_0x2fc5cf[_0x2203('0xf0')],'read':_0x2fc5cf[_0x2203('0x80')],'attachment':_0x2fc5cf[_0x2203('0xd3')]};})[_0x2203('0x63')]()};return ejs['renderFile'](path['join'](config[_0x2203('0xd8')],_0x2203('0x10a'),_0x2203('0x11d'),'downloadInteraction.ejs'),{'interaction':_0x1c36d4})[_0x2203('0x1d')](function(_0x15260f){var _0x4419a8=path[_0x2203('0xd7')](_0x20a488,_0x2203('0x11e')+_0xd584ee['id']+'-'+_0x3dd02d+_0x2203('0x11f'));var _0x2af4f6={'path':_0x4419a8,'channel':'Chat','interactionId':_0xd584ee['id']};return pdf[_0x2203('0x120')](_0x15260f,_0x2af4f6);})[_0x2203('0x1d')](function(){return new BPromise(function(_0x3e8221,_0x16ccec){zipdir(_0x20a488,{'saveTo':_0x44ae18},function(_0x7da828,_0x29846d){if(_0x7da828)return _0x16ccec(_0x7da828);return _0x3e8221(_0x29846d);});})[_0x2203('0x1d')](function(){return new BPromise(function(_0x1c3684,_0x11c1db){rimraf(_0x20a488,function(_0x447a00){if(_0x447a00)_0x11c1db(_0x447a00);return _0x1c3684();});});})[_0x2203('0x1d')](function(){return _0x5b771e['download'](_0x44ae18,_0x505c2a,function(_0x2a679c){if(_0x2a679c){console[_0x2203('0x121')](_0x2203('0x122'),_0x2a679c);}else{fs[_0x2203('0x123')](_0x44ae18);}});});});}else{return _0x5b771e[_0x2203('0x28')](0xc8);}})['catch'](handleError(_0x5b771e,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 6f4ac5b..370da41 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 _0xa0ae=['map','findAll','setDataValue','unreadMessages','emit','catch','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','getUsers','then','Users'];(function(_0x92b8f1,_0x11e551){var _0x283131=function(_0x5a6d62){while(--_0x5a6d62){_0x92b8f1['push'](_0x92b8f1['shift']());}};_0x283131(++_0x11e551);}(_0xa0ae,0x16e));var _0xea0a=function(_0x5e570c,_0x233990){_0x5e570c=_0x5e570c-0x0;var _0xc62527=_0xa0ae[_0x5e570c];return _0xc62527;};'use strict';var EventEmitter=require(_0xea0a('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xea0a('0x1')];var ChatMessage=require(_0xea0a('0x2'))['db'][_0xea0a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xea0a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea0a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x588994){return function(_0x5cf0dc,_0x1c9fd1,_0xc02627){_0x5cf0dc[_0xea0a('0x6')]({'attributes':['id'],'raw':!![]})[_0xea0a('0x7')](function(_0x15a5c4){_0x5cf0dc['setDataValue'](_0xea0a('0x8'),_0x15a5c4[_0xea0a('0x9')](function(_0x1c8c68){return{'id':_0x1c8c68['id']};}));return ChatMessage[_0xea0a('0xa')]({'where':{'ChatInteractionId':_0x5cf0dc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xea0a('0x7')](function(_0x4baee3){_0x5cf0dc[_0xea0a('0xb')](_0xea0a('0xc'),_0x4baee3['length']);ChatInteractionEvents[_0xea0a('0xd')](_0x588994+':'+_0x5cf0dc['id'],_0x5cf0dc);ChatInteractionEvents[_0xea0a('0xd')](_0x588994,_0x5cf0dc);_0xc02627(null);})[_0xea0a('0xe')](_0xc02627(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x9ff3=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','remove'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x9ff3,0x72));var _0x39ff=function(_0x195786,_0x8a097d){_0x195786=_0x195786-0x0;var _0x31935a=_0x9ff3[_0x195786];return _0x31935a;};'use strict';var EventEmitter=require(_0x39ff('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x39ff('0x1')];var ChatMessage=require(_0x39ff('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x39ff('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x39ff('0x4')};function emitEvent(_0x5eec55){return function(_0x211ead,_0x347cdb,_0x46d01e){_0x211ead['getUsers']({'attributes':['id'],'raw':!![]})[_0x39ff('0x5')](function(_0x85a7bf){_0x211ead[_0x39ff('0x6')](_0x39ff('0x7'),_0x85a7bf[_0x39ff('0x8')](function(_0x2c0bef){return{'id':_0x2c0bef['id']};}));return ChatMessage[_0x39ff('0x9')]({'where':{'ChatInteractionId':_0x211ead['id'],'direction':'in','read':![]},'raw':!![]});})[_0x39ff('0x5')](function(_0x2219ca){_0x211ead[_0x39ff('0x6')](_0x39ff('0xa'),_0x2219ca[_0x39ff('0xb')]);ChatInteractionEvents[_0x39ff('0xc')](_0x5eec55+':'+_0x211ead['id'],_0x211ead);ChatInteractionEvents[_0x39ff('0xc')](_0x5eec55,_0x211ead);_0x46d01e(null);})[_0x39ff('0xd')](_0x46d01e(null));};}for(var e in events){if(events[_0x39ff('0xe')](e)){var event=events[e];ChatInteraction[_0x39ff('0xf')](e,emitEvent(event));}}module[_0x39ff('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 974e97e..1ba2965 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 _0xc15e=['../../config/environment','./chatInteraction.attributes','define','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0xc15e,0xb4));var _0xec15=function(_0x39fb09,_0x4f0fc6){_0x39fb09=_0x39fb09-0x0;var _0x31aa84=_0xc15e[_0x39fb09];return _0x31aa84;};'use strict';var _=require(_0xec15('0x0'));var util=require(_0xec15('0x1'));var logger=require(_0xec15('0x2'))(_0xec15('0x3'));var moment=require(_0xec15('0x4'));var BPromise=require(_0xec15('0x5'));var rp=require(_0xec15('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xec15('0x7'));var attributes=require(_0xec15('0x8'));module['exports']=function(_0x5ead86,_0x5e6a86){return _0x5ead86[_0xec15('0x9')]('ChatInteraction',attributes,{'tableName':_0xec15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1cb68a,_0x2c1234,_0x49adb3){if(_0x1cb68a[_0xec15('0xb')](_0xec15('0xc'))){_0x1cb68a[_0xec15('0xd')]=moment()['format'](_0xec15('0xe'));}_0x49adb3(null,_0x1cb68a);}},'charset':_0xec15('0xf'),'collate':_0xec15('0x10')});}; \ No newline at end of file +var _0x432f=['moment','bluebird','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x306306,_0x577e3c){var _0x396564=function(_0x1c1cc6){while(--_0x1c1cc6){_0x306306['push'](_0x306306['shift']());}};_0x396564(++_0x577e3c);}(_0x432f,0x172));var _0xf432=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x432f[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xf432('0x0'));var util=require(_0xf432('0x1'));var logger=require(_0xf432('0x2'))(_0xf432('0x3'));var moment=require(_0xf432('0x4'));var BPromise=require(_0xf432('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf432('0x6'));var rimraf=require('rimraf');var config=require(_0xf432('0x7'));var attributes=require(_0xf432('0x8'));module[_0xf432('0x9')]=function(_0x4fd305,_0x48ee1b){return _0x4fd305['define'](_0xf432('0xa'),attributes,{'tableName':_0xf432('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ea903,_0x231422,_0x109ed5){if(_0x3ea903[_0xf432('0xc')]('closed')){_0x3ea903[_0xf432('0xd')]=moment()[_0xf432('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x109ed5(null,_0x3ea903);}},'charset':_0xf432('0xf'),'collate':_0xf432('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e4bc03c..d8eaa80 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 _0x32fa=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','ChatInteraction','update','body','raw','options','where','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment'];(function(_0x1b179d,_0x539891){var _0x215270=function(_0xa0a560){while(--_0xa0a560){_0x1b179d['push'](_0x1b179d['shift']());}};_0x215270(++_0x539891);}(_0x32fa,0x1b5));var _0xa32f=function(_0x4cc1c9,_0x317e26){_0x4cc1c9=_0x4cc1c9-0x0;var _0x178a6b=_0x32fa[_0x4cc1c9];return _0x178a6b;};'use strict';var _=require(_0xa32f('0x0'));var util=require(_0xa32f('0x1'));var moment=require(_0xa32f('0x2'));var BPromise=require('bluebird');var rs=require(_0xa32f('0x3'));var fs=require('fs');var Redis=require(_0xa32f('0x4'));var db=require(_0xa32f('0x5'))['db'];var utils=require(_0xa32f('0x6'));var logger=require(_0xa32f('0x7'))(_0xa32f('0x8'));var config=require(_0xa32f('0x9'));var jayson=require(_0xa32f('0xa'));var client=jayson[_0xa32f('0xb')][_0xa32f('0xc')]({'port':0x232a});config[_0xa32f('0xd')]=_[_0xa32f('0xe')](config[_0xa32f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa32f('0xf'))(new Redis(config[_0xa32f('0xd')]));require(_0xa32f('0x10'))[_0xa32f('0x11')](socket);function respondWithRpcPromise(_0x32da42,_0x5d9408,_0x5c2cdf){return new BPromise(function(_0x354a78,_0x345115){return client[_0xa32f('0x12')](_0x32da42,_0x5c2cdf)[_0xa32f('0x13')](function(_0x3517e1){logger[_0xa32f('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5d9408,_0xa32f('0x15'));logger[_0xa32f('0x16')](_0xa32f('0x17'),_0x5d9408,_0xa32f('0x15'),JSON['stringify'](_0x3517e1));if(_0x3517e1[_0xa32f('0x18')]){if(_0x3517e1[_0xa32f('0x18')][_0xa32f('0x19')]===0x1f4){logger[_0xa32f('0x18')](_0xa32f('0x1a'),_0x5d9408,_0x3517e1['error']['message']);return _0x345115(_0x3517e1[_0xa32f('0x18')]['message']);}logger[_0xa32f('0x18')](_0xa32f('0x1a'),_0x5d9408,_0x3517e1['error']['message']);return _0x354a78(_0x3517e1['error'][_0xa32f('0x1b')]);}else{logger[_0xa32f('0x14')](_0xa32f('0x1a'),_0x5d9408,_0xa32f('0x15'));_0x354a78(_0x3517e1['result']['message']);}})[_0xa32f('0x1c')](function(_0x5a5338){logger[_0xa32f('0x18')](_0xa32f('0x1a'),_0x5d9408,_0x5a5338);_0x345115(_0x5a5338);});});}exports[_0xa32f('0x1d')]=function(_0x16cd67){var _0x28661a=this;return new Promise(function(_0x1cf1fa,_0x513aa2){return db[_0xa32f('0x1e')][_0xa32f('0x1f')](_0x16cd67[_0xa32f('0x20')],{'raw':_0x16cd67['options']?_0x16cd67['options'][_0xa32f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16cd67[_0xa32f('0x22')]?_0x16cd67[_0xa32f('0x22')][_0xa32f('0x23')]||null:null,'attributes':_0x16cd67[_0xa32f('0x22')]?_0x16cd67[_0xa32f('0x22')]['attributes']||null:null,'limit':_0x16cd67['options']?_0x16cd67[_0xa32f('0x22')][_0xa32f('0x24')]||null:null})[_0xa32f('0x13')](function(_0x4f429d){logger[_0xa32f('0x14')](_0xa32f('0x1d'),_0x16cd67);logger[_0xa32f('0x16')](_0xa32f('0x1d'),_0x16cd67,JSON[_0xa32f('0x25')](_0x4f429d));_0x1cf1fa(_0x4f429d);})[_0xa32f('0x1c')](function(_0x58c1f8){logger[_0xa32f('0x18')](_0xa32f('0x1d'),_0x58c1f8[_0xa32f('0x1b')],_0x16cd67);_0x513aa2(_0x28661a[_0xa32f('0x18')](0x1f4,_0x58c1f8[_0xa32f('0x1b')]));});});};exports[_0xa32f('0x26')]=function(_0x1eef9e){return new Promise(function(_0x3058b6,_0x4d0dcf){return db['ChatInteraction'][_0xa32f('0x27')]({'where':_0x1eef9e[_0xa32f('0x22')]?_0x1eef9e[_0xa32f('0x22')][_0xa32f('0x23')]||null:null})[_0xa32f('0x13')](function(_0x3e7490){if(_0x3e7490){return _0x3e7490[_0xa32f('0x28')](_0x1eef9e['body'][_0xa32f('0x29')],_[_0xa32f('0x2a')](_0x1eef9e[_0xa32f('0x20')],[_0xa32f('0x29'),'id'])||{});}})['spread'](function(_0xc51437){logger['info']('AddTags',_0x1eef9e);logger[_0xa32f('0x16')](_0xa32f('0x2b'),_0x1eef9e,JSON[_0xa32f('0x25')](_0xc51437));_0x3058b6(_0xc51437);})[_0xa32f('0x1c')](function(_0x5c488c){logger[_0xa32f('0x18')]('AddTags',_0x5c488c[_0xa32f('0x1b')],_0x1eef9e);_0x4d0dcf(_this['error'](0x1f4,_0x5c488c[_0xa32f('0x1b')]));});});}; \ No newline at end of file +var _0x27e1=['localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x220228,_0x30a350){var _0x30e3e2=function(_0x58e4a3){while(--_0x58e4a3){_0x220228['push'](_0x220228['shift']());}};_0x30e3e2(++_0x30a350);}(_0x27e1,0x121));var _0x127e=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x27e1[_0x533e4e];return _0x1f14bb;};'use strict';var _=require('lodash');var util=require(_0x127e('0x0'));var moment=require(_0x127e('0x1'));var BPromise=require(_0x127e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x127e('0x3'))['db'];var utils=require(_0x127e('0x4'));var logger=require(_0x127e('0x5'))(_0x127e('0x6'));var config=require(_0x127e('0x7'));var jayson=require(_0x127e('0x8'));var client=jayson['client'][_0x127e('0x9')]({'port':0x232a});config[_0x127e('0xa')]=_[_0x127e('0xb')](config[_0x127e('0xa')],{'host':_0x127e('0xc'),'port':0x18eb});var socket=require(_0x127e('0xd'))(new Redis(config[_0x127e('0xa')]));require(_0x127e('0xe'))[_0x127e('0xf')](socket);function respondWithRpcPromise(_0x3a0e09,_0x4e1ad6,_0x5f3164){return new BPromise(function(_0x1b5a4d,_0x1ec28d){return client[_0x127e('0x10')](_0x3a0e09,_0x5f3164)[_0x127e('0x11')](function(_0x523596){logger['info'](_0x127e('0x12'),_0x4e1ad6,_0x127e('0x13'));logger[_0x127e('0x14')](_0x127e('0x15'),_0x4e1ad6,_0x127e('0x13'),JSON['stringify'](_0x523596));if(_0x523596[_0x127e('0x16')]){if(_0x523596[_0x127e('0x16')][_0x127e('0x17')]===0x1f4){logger[_0x127e('0x16')](_0x127e('0x12'),_0x4e1ad6,_0x523596[_0x127e('0x16')]['message']);return _0x1ec28d(_0x523596['error']['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4e1ad6,_0x523596[_0x127e('0x16')][_0x127e('0x18')]);return _0x1b5a4d(_0x523596['error'][_0x127e('0x18')]);}else{logger[_0x127e('0x19')](_0x127e('0x12'),_0x4e1ad6,_0x127e('0x13'));_0x1b5a4d(_0x523596['result'][_0x127e('0x18')]);}})[_0x127e('0x1a')](function(_0x24091c){logger[_0x127e('0x16')](_0x127e('0x12'),_0x4e1ad6,_0x24091c);_0x1ec28d(_0x24091c);});});}exports[_0x127e('0x1b')]=function(_0x19cc0e){var _0x520375=this;return new Promise(function(_0x5d4798,_0x5b5724){return db[_0x127e('0x1c')][_0x127e('0x1d')](_0x19cc0e['body'],{'raw':_0x19cc0e[_0x127e('0x1e')]?_0x19cc0e['options'][_0x127e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19cc0e[_0x127e('0x1e')]?_0x19cc0e[_0x127e('0x1e')][_0x127e('0x20')]||null:null,'attributes':_0x19cc0e[_0x127e('0x1e')]?_0x19cc0e[_0x127e('0x1e')][_0x127e('0x21')]||null:null,'limit':_0x19cc0e[_0x127e('0x1e')]?_0x19cc0e[_0x127e('0x1e')][_0x127e('0x22')]||null:null})[_0x127e('0x11')](function(_0x1ca5df){logger[_0x127e('0x19')](_0x127e('0x1b'),_0x19cc0e);logger['debug'](_0x127e('0x1b'),_0x19cc0e,JSON[_0x127e('0x23')](_0x1ca5df));_0x5d4798(_0x1ca5df);})[_0x127e('0x1a')](function(_0x2d8fad){logger[_0x127e('0x16')]('UpdateChatInteraction',_0x2d8fad[_0x127e('0x18')],_0x19cc0e);_0x5b5724(_0x520375[_0x127e('0x16')](0x1f4,_0x2d8fad[_0x127e('0x18')]));});});};exports[_0x127e('0x24')]=function(_0x37e8d2){return new Promise(function(_0x158814,_0x4b142f){return db[_0x127e('0x1c')]['find']({'where':_0x37e8d2[_0x127e('0x1e')]?_0x37e8d2[_0x127e('0x1e')][_0x127e('0x20')]||null:null})[_0x127e('0x11')](function(_0x476f85){if(_0x476f85){return _0x476f85[_0x127e('0x25')](_0x37e8d2[_0x127e('0x26')][_0x127e('0x27')],_[_0x127e('0x28')](_0x37e8d2[_0x127e('0x26')],[_0x127e('0x27'),'id'])||{});}})[_0x127e('0x29')](function(_0x113c64){logger[_0x127e('0x19')](_0x127e('0x2a'),_0x37e8d2);logger['debug'](_0x127e('0x2a'),_0x37e8d2,JSON[_0x127e('0x23')](_0x113c64));_0x158814(_0x113c64);})['catch'](function(_0x56c4bb){logger[_0x127e('0x16')](_0x127e('0x2a'),_0x56c4bb[_0x127e('0x18')],_0x37e8d2);_0x4b142f(_this[_0x127e('0x16')](0x1f4,_0x56c4bb['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 1fceaf8..5c326b4 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 _0x8aaa=['remove','emit','removeListener','register','./chatInteraction.events','save'];(function(_0x1d669e,_0x4921c9){var _0x1d1ec7=function(_0x332a50){while(--_0x332a50){_0x1d669e['push'](_0x1d669e['shift']());}};_0x1d1ec7(++_0x4921c9);}(_0x8aaa,0x64));var _0xa8aa=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x8aaa[_0x30033a];return _0x5e3518;};'use strict';var ChatInteractionEvents=require(_0xa8aa('0x0'));var events=[_0xa8aa('0x1'),_0xa8aa('0x2'),'update'];function createListener(_0x459dbd,_0x4744c6){return function(_0x37a647){_0x4744c6[_0xa8aa('0x3')](_0x459dbd,_0x37a647);};}function removeListener(_0x28fa1b,_0x3443c7){return function(){ChatInteractionEvents[_0xa8aa('0x4')](_0x28fa1b,_0x3443c7);};}exports[_0xa8aa('0x5')]=function(_0x5db8ce){for(var _0x1aa721=0x0,_0x4dbf55=events['length'];_0x1aa721<_0x4dbf55;_0x1aa721++){var _0xe28e68=events[_0x1aa721];var _0x2339b3=createListener('chatInteraction:'+_0xe28e68,_0x5db8ce);ChatInteractionEvents['on'](_0xe28e68,_0x2339b3);}}; \ No newline at end of file +var _0xd772=['remove','emit','removeListener','save'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0xd772,0xd7));var _0x2d77=function(_0x4f9d6e,_0x10fa1c){_0x4f9d6e=_0x4f9d6e-0x0;var _0x277e0c=_0xd772[_0x4f9d6e];return _0x277e0c;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x2d77('0x0'),_0x2d77('0x1'),'update'];function createListener(_0x4fe0cc,_0x20c86f){return function(_0x47fffd){_0x20c86f[_0x2d77('0x2')](_0x4fe0cc,_0x47fffd);};}function removeListener(_0x2e4c49,_0x12cc40){return function(){ChatInteractionEvents[_0x2d77('0x3')](_0x2e4c49,_0x12cc40);};}exports['register']=function(_0x2a7860){for(var _0x1ad986=0x0,_0x39365d=events['length'];_0x1ad986<_0x39365d;_0x1ad986++){var _0x427da2=events[_0x1ad986];var _0x3a7e2d=createListener('chatInteraction:'+_0x427da2,_0x2a7860);ChatInteractionEvents['on'](_0x427da2,_0x3a7e2d);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 2f169a0..a48f815 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 _0x10d4=['tracked','chat','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','delete','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','describe','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','attachmentUpload','isChatInteractionAuthorized','/:id/tags','chatinteraction:addtags','addTags','put','/:id'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x10d4,0x6c));var _0x410d=function(_0x40e0eb,_0x51f9a5){_0x40e0eb=_0x40e0eb-0x0;var _0x3b11ee=_0x10d4[_0x40e0eb];return _0x3b11ee;};'use strict';var multer=require('multer');var util=require(_0x410d('0x0'));var path=require('path');var timeout=require(_0x410d('0x1'));var express=require('express');var router=express[_0x410d('0x2')]();var fs_extra=require(_0x410d('0x3'));var auth=require(_0x410d('0x4'));var interaction=require(_0x410d('0x5'));var config=require(_0x410d('0x6'));var controller=require(_0x410d('0x7'));router['get']('/',auth[_0x410d('0x8')](),controller[_0x410d('0x9')]);router[_0x410d('0xa')]('/describe',auth[_0x410d('0x8')](),controller[_0x410d('0xb')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0x410d('0xa')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x410d('0xc')]);router[_0x410d('0xa')](_0x410d('0xd'),auth[_0x410d('0x8')](),controller[_0x410d('0xe')]);router[_0x410d('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x410d('0xf')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x410d('0x10')]);router[_0x410d('0x11')]('/',auth[_0x410d('0x8')](),controller[_0x410d('0x12')]);router[_0x410d('0x11')](_0x410d('0x13'),auth[_0x410d('0x8')](),controller[_0x410d('0x14')]);var upload=multer({'storage':multer[_0x410d('0x15')]({'destination':function(_0x49b49c,_0x49da62,_0x24dd8f){_0x24dd8f(null,path['join'](config[_0x410d('0x16')],_0x410d('0x17')));},'filename':function(_0x36aaa9,_0xd18363,_0x1ca26e){_0x1ca26e(null,util[_0x410d('0x18')]('%s-%s',Date['now'](),_0xd18363[_0x410d('0x19')][_0x410d('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x410d('0x1b'),upload[_0x410d('0x1c')]('file'),controller[_0x410d('0x1d')]);router['post'](_0x410d('0xd'),auth[_0x410d('0x1e')](),controller['addMessage']);router['post'](_0x410d('0x1f'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x410d('0x20')),controller[_0x410d('0x21')]);router[_0x410d('0x22')](_0x410d('0x23'),auth[_0x410d('0x8')](),interaction[_0x410d('0x24')](_0x410d('0x25'),'chatinteraction:update'),controller[_0x410d('0x26')]);router[_0x410d('0x22')](_0x410d('0x27'),controller['customUpdate']);router['put'](_0x410d('0x28'),auth[_0x410d('0x1e')](),controller[_0x410d('0x29')]);router[_0x410d('0x22')](_0x410d('0x2a'),controller['close']);router['delete'](_0x410d('0x23'),auth[_0x410d('0x8')](),interaction[_0x410d('0x24')]('chat',_0x410d('0x2b')),controller[_0x410d('0x2c')]);router[_0x410d('0x2d')]('/:id/tags',auth[_0x410d('0x8')](),controller[_0x410d('0x2e')]);module[_0x410d('0x2f')]=router; \ No newline at end of file +var _0xa1c5=['server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','chat','chatinteraction:addtags','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','put','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root'];(function(_0x2faa4f,_0x1a2814){var _0xc10f5d=function(_0x5cb751){while(--_0x5cb751){_0x2faa4f['push'](_0x2faa4f['shift']());}};_0xc10f5d(++_0x1a2814);}(_0xa1c5,0x144));var _0x5a1c=function(_0x4a4f32,_0x30fcb8){_0x4a4f32=_0x4a4f32-0x0;var _0xba2691=_0xa1c5[_0x4a4f32];return _0xba2691;};'use strict';var multer=require(_0x5a1c('0x0'));var util=require(_0x5a1c('0x1'));var path=require(_0x5a1c('0x2'));var timeout=require(_0x5a1c('0x3'));var express=require(_0x5a1c('0x4'));var router=express[_0x5a1c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5a1c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x5a1c('0x7')](),controller[_0x5a1c('0x8')]);router[_0x5a1c('0x9')]('/describe',auth[_0x5a1c('0x7')](),controller[_0x5a1c('0xa')]);router[_0x5a1c('0x9')](_0x5a1c('0xb'),auth[_0x5a1c('0xc')](),controller['show']);router[_0x5a1c('0x9')]('/:id/attachment_download',auth[_0x5a1c('0xc')](),controller[_0x5a1c('0xd')]);router[_0x5a1c('0x9')](_0x5a1c('0xe'),auth[_0x5a1c('0x7')](),controller[_0x5a1c('0xf')]);router[_0x5a1c('0x9')](_0x5a1c('0x10'),auth[_0x5a1c('0xc')](),controller[_0x5a1c('0x11')]);router[_0x5a1c('0x9')](_0x5a1c('0x12'),auth[_0x5a1c('0x7')](),controller[_0x5a1c('0x13')]);router[_0x5a1c('0x14')]('/',auth[_0x5a1c('0x7')](),controller[_0x5a1c('0x15')]);router['post']('/:id/vidaoo',auth[_0x5a1c('0x7')](),controller[_0x5a1c('0x16')]);var upload=multer({'storage':multer[_0x5a1c('0x17')]({'destination':function(_0xc6a18f,_0x590cf5,_0x4733fc){_0x4733fc(null,path[_0x5a1c('0x18')](config[_0x5a1c('0x19')],_0x5a1c('0x1a')));},'filename':function(_0x5c164f,_0xa93285,_0x2e4cfc){_0x2e4cfc(null,util['format'](_0x5a1c('0x1b'),Date[_0x5a1c('0x1c')](),_0xa93285['originalname'][_0x5a1c('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5a1c('0x14')](_0x5a1c('0x1e'),upload[_0x5a1c('0x1f')](_0x5a1c('0x20')),controller[_0x5a1c('0x21')]);router['post'](_0x5a1c('0xe'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x5a1c('0x14')](_0x5a1c('0x22'),auth['isAuthenticated'](),interaction['tracked'](_0x5a1c('0x23'),_0x5a1c('0x24')),controller['addTags']);router['put'](_0x5a1c('0xb'),auth[_0x5a1c('0x7')](),interaction[_0x5a1c('0x25')]('chat',_0x5a1c('0x26')),controller[_0x5a1c('0x27')]);router['put'](_0x5a1c('0x28'),controller[_0x5a1c('0x29')]);router[_0x5a1c('0x2a')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x5a1c('0x2b')]);router['put'](_0x5a1c('0x2c'),controller[_0x5a1c('0x2d')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x5a1c('0x25')](_0x5a1c('0x23'),_0x5a1c('0x2e')),controller['destroy']);router[_0x5a1c('0x2f')](_0x5a1c('0x22'),auth[_0x5a1c('0x7')](),controller[_0x5a1c('0x30')]);module[_0x5a1c('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 8e49b3b..6bb9a05 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 _0xa32b=['BOOLEAN','TEXT','medium'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa32b,0xbb));var _0xba32=function(_0x100e0c,_0x5523b8){_0x100e0c=_0x100e0c-0x0;var _0x4db1aa=_0xa32b[_0x100e0c];return _0x4db1aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xba32('0x0')](_0xba32('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xba32('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x874b=['sequelize','exports','TEXT','medium','INTEGER'];(function(_0x52c9e3,_0x4c883d){var _0x252fda=function(_0x48c522){while(--_0x48c522){_0x52c9e3['push'](_0x52c9e3['shift']());}};_0x252fda(++_0x4c883d);}(_0x874b,0x131));var _0xb874=function(_0x192379,_0x55e108){_0x192379=_0x192379-0x0;var _0x33b230=_0x874b[_0x192379];return _0x33b230;};'use strict';var Sequelize=require(_0xb874('0x0'));module[_0xb874('0x1')]={'body':{'type':Sequelize[_0xb874('0x2')](_0xb874('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb874('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9cc5623..3616b6c 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 _0xca22=['socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','offset','limit','undefined','count','status','Content-Range','json','reject','save','update','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','params','length','includeAll','create','body','destroy','describe','messages','lastMessage','lastMessageAt','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xca22,0x129));var _0x2ca2=function(_0x4f9779,_0x52808a){_0x4f9779=_0x4f9779-0x0;var _0x13f3cc=_0xca22[_0x4f9779];return _0x13f3cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ca2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ca2('0x1'));var rp=require(_0x2ca2('0x2'));var moment=require('moment');var BPromise=require(_0x2ca2('0x3'));var Mustache=require('mustache');var util=require(_0x2ca2('0x4'));var path=require(_0x2ca2('0x5'));var sox=require(_0x2ca2('0x6'));var csv=require(_0x2ca2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ca2('0x8'));var squel=require(_0x2ca2('0x9'));var crypto=require(_0x2ca2('0xa'));var jsforce=require(_0x2ca2('0xb'));var deskjs=require(_0x2ca2('0xc'));var toCsv=require(_0x2ca2('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2ca2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2ca2('0xe'));var as=require(_0x2ca2('0xf'));var hardwareService=require(_0x2ca2('0x10'));var logger=require('../../config/logger')(_0x2ca2('0x11'));var utils=require(_0x2ca2('0x12'));var config=require(_0x2ca2('0x13'));var licenseUtil=require(_0x2ca2('0x14'));var db=require('../../mysqldb')['db'];config[_0x2ca2('0x15')]=_[_0x2ca2('0x16')](config[_0x2ca2('0x15')],{'host':_0x2ca2('0x17'),'port':0x18eb});var socket=require(_0x2ca2('0x18'))(new Redis(config['redis']));require(_0x2ca2('0x19'))['register'](socket);function respondWithStatusCode(_0xe51a39,_0x463033){_0x463033=_0x463033||0xcc;return function(_0x425e86){if(_0x425e86){return _0xe51a39[_0x2ca2('0x1a')](_0x463033);}return _0xe51a39['status'](_0x463033)[_0x2ca2('0x1b')]();};}function respondWithResult(_0xfed17b,_0x44f584){_0x44f584=_0x44f584||0xc8;return function(_0x32f6cf){if(_0x32f6cf){return _0xfed17b['status'](_0x44f584)['json'](_0x32f6cf);}};}function respondWithFilteredResult(_0x13d61b,_0x183e74){return function(_0x1d438e){if(_0x1d438e){var _0x51b792=typeof _0x183e74[_0x2ca2('0x1c')]==='undefined'&&typeof _0x183e74[_0x2ca2('0x1d')]===_0x2ca2('0x1e');var _0x5a590e=_0x1d438e[_0x2ca2('0x1f')];var _0x480338=_0x51b792?0x0:_0x183e74[_0x2ca2('0x1c')];var _0x29faa8=_0x51b792?_0x1d438e[_0x2ca2('0x1f')]:_0x183e74[_0x2ca2('0x1c')]+_0x183e74[_0x2ca2('0x1d')];var _0x34086d;if(_0x29faa8>=_0x5a590e){_0x29faa8=_0x5a590e;_0x34086d=0xc8;}else{_0x34086d=0xce;}_0x13d61b[_0x2ca2('0x20')](_0x34086d);return _0x13d61b['set'](_0x2ca2('0x21'),_0x480338+'-'+_0x29faa8+'/'+_0x5a590e)[_0x2ca2('0x22')](_0x1d438e);}return null;};}function patchUpdates(_0x4f6237){return function(_0x5d037c){try{jsonpatch['apply'](_0x5d037c,_0x4f6237,!![]);}catch(_0x29e9ba){return BPromise[_0x2ca2('0x23')](_0x29e9ba);}return _0x5d037c[_0x2ca2('0x24')]();};}function saveUpdates(_0x4daa39,_0x3b7039){return function(_0x55276d){if(_0x55276d){return _0x55276d[_0x2ca2('0x25')](_0x4daa39)[_0x2ca2('0x26')](function(_0x25ffb8){return _0x25ffb8;});}return null;};}function removeEntity(_0x2e580e,_0x536ae5){return function(_0x22a9c1){if(_0x22a9c1){return _0x22a9c1['destroy']()[_0x2ca2('0x26')](function(){_0x2e580e[_0x2ca2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40d584,_0xe65074){return function(_0xb1e039){if(!_0xb1e039){_0x40d584['sendStatus'](0x194);}return _0xb1e039;};}function handleError(_0x4e1608,_0x6e3236){_0x6e3236=_0x6e3236||0x1f4;return function(_0x55e3dc){logger['error'](_0x55e3dc[_0x2ca2('0x27')]);if(_0x55e3dc[_0x2ca2('0x28')]){delete _0x55e3dc[_0x2ca2('0x28')];}_0x4e1608[_0x2ca2('0x20')](_0x6e3236)[_0x2ca2('0x29')](_0x55e3dc);};}exports[_0x2ca2('0x2a')]=function(_0x1cc1c2,_0x453796){var _0x5d5ec0={},_0x1bd984={},_0x28c9ed={'count':0x0,'rows':[]};var _0x522810=_[_0x2ca2('0x2b')](db[_0x2ca2('0x2c')][_0x2ca2('0x2d')],function(_0x1683a5){return{'name':_0x1683a5[_0x2ca2('0x2e')],'type':_0x1683a5[_0x2ca2('0x2f')][_0x2ca2('0x30')]};});_0x1bd984[_0x2ca2('0x31')]=_[_0x2ca2('0x2b')](_0x522810,_0x2ca2('0x28'));_0x1bd984[_0x2ca2('0x32')]=_[_0x2ca2('0x33')](_0x1cc1c2[_0x2ca2('0x32')]);_0x1bd984[_0x2ca2('0x34')]=_[_0x2ca2('0x35')](_0x1bd984['model'],_0x1bd984[_0x2ca2('0x32')]);_0x5d5ec0[_0x2ca2('0x36')]=_[_0x2ca2('0x35')](_0x1bd984['model'],qs[_0x2ca2('0x37')](_0x1cc1c2[_0x2ca2('0x32')][_0x2ca2('0x37')]));_0x5d5ec0[_0x2ca2('0x36')]=_0x5d5ec0['attributes']['length']?_0x5d5ec0['attributes']:_0x1bd984[_0x2ca2('0x31')];if(!_0x1cc1c2['query'][_0x2ca2('0x38')]('nolimit')){_0x5d5ec0['limit']=qs[_0x2ca2('0x1d')](_0x1cc1c2[_0x2ca2('0x32')][_0x2ca2('0x1d')]);_0x5d5ec0[_0x2ca2('0x1c')]=qs[_0x2ca2('0x1c')](_0x1cc1c2[_0x2ca2('0x32')][_0x2ca2('0x1c')]);}_0x5d5ec0[_0x2ca2('0x39')]=qs[_0x2ca2('0x3a')](_0x1cc1c2['query']['sort']);_0x5d5ec0[_0x2ca2('0x3b')]=qs[_0x2ca2('0x34')](_['pick'](_0x1cc1c2['query'],_0x1bd984[_0x2ca2('0x34')]),_0x522810);if(_0x1cc1c2[_0x2ca2('0x32')][_0x2ca2('0x3c')]){_0x5d5ec0[_0x2ca2('0x3b')]=_['merge'](_0x5d5ec0[_0x2ca2('0x3b')],{'$or':_[_0x2ca2('0x2b')](_0x522810,function(_0x5f2a1e){if(_0x5f2a1e['type']!==_0x2ca2('0x3d')){var _0x5a26a9={};_0x5a26a9[_0x5f2a1e[_0x2ca2('0x28')]]={'$like':'%'+_0x1cc1c2[_0x2ca2('0x32')]['filter']+'%'};return _0x5a26a9;}})});}_0x5d5ec0=_[_0x2ca2('0x3e')]({},_0x5d5ec0,_0x1cc1c2['options']);var _0x74cbd7={'where':_0x5d5ec0[_0x2ca2('0x3b')]};return db[_0x2ca2('0x2c')][_0x2ca2('0x1f')](_0x74cbd7)[_0x2ca2('0x26')](function(_0x4640ac){_0x28c9ed[_0x2ca2('0x1f')]=_0x4640ac;if(_0x1cc1c2[_0x2ca2('0x32')]['includeAll']){_0x5d5ec0[_0x2ca2('0x3f')]=[{'all':!![]}];}return db[_0x2ca2('0x2c')][_0x2ca2('0x40')](_0x5d5ec0);})['then'](function(_0x1b74b1){_0x28c9ed[_0x2ca2('0x41')]=_0x1b74b1;return _0x28c9ed;})[_0x2ca2('0x26')](respondWithFilteredResult(_0x453796,_0x5d5ec0))[_0x2ca2('0x42')](handleError(_0x453796,null));};exports['show']=function(_0x1b7d27,_0x5785de){var _0x41d734={'raw':!![],'where':{'id':_0x1b7d27[_0x2ca2('0x43')]['id']}},_0x2096b4={};_0x2096b4[_0x2ca2('0x31')]=_[_0x2ca2('0x33')](db[_0x2ca2('0x2c')][_0x2ca2('0x2d')]);_0x2096b4[_0x2ca2('0x32')]=_[_0x2ca2('0x33')](_0x1b7d27[_0x2ca2('0x32')]);_0x2096b4[_0x2ca2('0x34')]=_[_0x2ca2('0x35')](_0x2096b4['model'],_0x2096b4['query']);_0x41d734[_0x2ca2('0x36')]=_[_0x2ca2('0x35')](_0x2096b4[_0x2ca2('0x31')],qs['fields'](_0x1b7d27['query']['fields']));_0x41d734[_0x2ca2('0x36')]=_0x41d734['attributes'][_0x2ca2('0x44')]?_0x41d734['attributes']:_0x2096b4[_0x2ca2('0x31')];if(_0x1b7d27[_0x2ca2('0x32')][_0x2ca2('0x45')]){_0x41d734[_0x2ca2('0x3f')]=[{'all':!![]}];}_0x41d734=_[_0x2ca2('0x3e')]({},_0x41d734,_0x1b7d27['options']);return db[_0x2ca2('0x2c')]['find'](_0x41d734)[_0x2ca2('0x26')](handleEntityNotFound(_0x5785de,null))[_0x2ca2('0x26')](respondWithResult(_0x5785de,null))[_0x2ca2('0x42')](handleError(_0x5785de,null));};exports[_0x2ca2('0x46')]=function(_0x20ba83,_0x1ef945){return db[_0x2ca2('0x2c')][_0x2ca2('0x46')](_0x20ba83[_0x2ca2('0x47')],{})[_0x2ca2('0x26')](respondWithResult(_0x1ef945,0xc9))[_0x2ca2('0x42')](handleError(_0x1ef945,null));};exports[_0x2ca2('0x25')]=function(_0x1fedb7,_0x3982e7){if(_0x1fedb7['body']['id']){delete _0x1fedb7[_0x2ca2('0x47')]['id'];}return db[_0x2ca2('0x2c')]['find']({'where':{'id':_0x1fedb7[_0x2ca2('0x43')]['id']}})[_0x2ca2('0x26')](handleEntityNotFound(_0x3982e7,null))[_0x2ca2('0x26')](saveUpdates(_0x1fedb7[_0x2ca2('0x47')],null))['then'](respondWithResult(_0x3982e7,null))['catch'](handleError(_0x3982e7,null));};exports[_0x2ca2('0x48')]=function(_0x50840d,_0x5302ed){return db[_0x2ca2('0x2c')]['find']({'where':{'id':_0x50840d[_0x2ca2('0x43')]['id']}})[_0x2ca2('0x26')](handleEntityNotFound(_0x5302ed,null))[_0x2ca2('0x26')](removeEntity(_0x5302ed,null))['catch'](handleError(_0x5302ed,null));};exports[_0x2ca2('0x49')]=function(_0x164b49,_0x269ad0){return db[_0x2ca2('0x2c')]['describe']()['then'](respondWithResult(_0x269ad0,null))[_0x2ca2('0x42')](handleError(_0x269ad0,null));};function wrapUser(_0x4563c6){return function(_0x3fd889){var _0x1de90f=_0x4563c6['get']({'plain':!![]});_0x1de90f[_0x2ca2('0x4a')]=[];if(_0x3fd889){_0x1de90f['lastMessageAt']=_0x3fd889['createdAt'];_0x1de90f[_0x2ca2('0x4b')]=_0x3fd889;}else{_0x1de90f[_0x2ca2('0x4c')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1de90f['lastMessage']={};}return _0x1de90f;};}exports[_0x2ca2('0x4d')]=function(_0x125d6e,_0x4ab193,_0xb11166){var _0x2951b9=[];return db[_0x2ca2('0x4e')][_0x2ca2('0x40')]({'where':{'role':[_0x2ca2('0x4f'),_0x2ca2('0x50'),_0x2ca2('0x51')]},'attributes':['id',_0x2ca2('0x52'),'name',_0x2ca2('0x53'),_0x2ca2('0x54'),_0x2ca2('0x55'),_0x2ca2('0x56'),'lastLoginAt',_0x2ca2('0x57'),_0x2ca2('0x58')],'order':qs[_0x2ca2('0x3a')](_0x2ca2('0x59')),'include':[{'model':db['VoiceQueue'],'as':_0x2ca2('0x5a'),'attributes':['id',_0x2ca2('0x28'),_0x2ca2('0x2f')],'through':{'attributes':[]}}]})[_0x2ca2('0x26')](function(_0x10d10f){if(_0x10d10f){var _0xdf6bdb=_0x125d6e[_0x2ca2('0x51')][_0x2ca2('0x5b')]({'plain':!![]});if(!_0xdf6bdb)throw new Error(_0x2ca2('0x5c'));if(_0xdf6bdb['role']===_0x2ca2('0x51')){return db[_0x2ca2('0x5d')][_0x2ca2('0x5e')]({'where':{'name':'Agents','userProfileId':_0xdf6bdb[_0x2ca2('0x5f')]},'raw':!![]})[_0x2ca2('0x26')](function(_0x33f04b){if(_0x33f04b){if(_0x33f04b[_0x2ca2('0x60')]===0x0){return db[_0x2ca2('0x61')][_0x2ca2('0x40')]({'where':{'sectionId':_0x33f04b['id']},'raw':!![]})[_0x2ca2('0x26')](function(_0x16f903){var _0x3023aa=[];if(_[_0x2ca2('0x62')](_0x16f903)){_0x3023aa=_[_0x2ca2('0x3c')](_0x10d10f,function(_0x1a606b){if(_0x1a606b[_0x2ca2('0x53')]!==_0x2ca2('0x4f')){return _0x1a606b;}});return _0x3023aa;}else{for(var _0x1e962a=0x0;_0x1e962a<_0x10d10f[_0x2ca2('0x44')];_0x1e962a++){var _0x21bc84=_0x10d10f[_0x1e962a];if(_0x21bc84[_0x2ca2('0x53')]===_0x2ca2('0x4f')){var _0x3f7a52=_['find'](_0x16f903,function(_0x6797a){return _0x6797a[_0x2ca2('0x63')]===_0x21bc84['id'];});if(_0x3f7a52)_0x3023aa[_0x2ca2('0x64')](_0x21bc84);}else{_0x3023aa['push'](_0x21bc84);}}return _0x3023aa;}});}else{return _0x10d10f;}}else{var _0x21fb1f=_[_0x2ca2('0x3c')](_0x10d10f,function(_0x1ac2b4){if(_0x1ac2b4[_0x2ca2('0x53')]!==_0x2ca2('0x4f')){return _0x1ac2b4;}});return _0x21fb1f;}});}else{return _0x10d10f;}}})[_0x2ca2('0x26')](function(_0x326132){var _0x3c7805=[];if(_0x326132){_0x2951b9=_0x326132;for(var _0x2a3590=0x0;_0x2a3590<_0x326132['length'];_0x2a3590+=0x1){_0x2951b9[_0x2a3590][_0x2ca2('0x4a')]=[];_0x3c7805[_0x2ca2('0x64')](db[_0x2ca2('0x2c')]['find']({'where':{'FromId':[_0x125d6e[_0x2ca2('0x51')]['id'],_0x326132[_0x2a3590]['id']],'ToId':[_0x125d6e[_0x2ca2('0x51')]['id'],_0x326132[_0x2a3590]['id']],'ChatGroupId':null},'attributes':['id',_0x2ca2('0x65'),_0x2ca2('0x66'),_0x2ca2('0x67'),_0x2ca2('0x68'),_0x2ca2('0x47')],'order':qs[_0x2ca2('0x3a')](_0x2ca2('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2ca2('0x26')](wrapUser(_0x326132[_0x2a3590])));}return BPromise[_0x2ca2('0x6a')](_0x3c7805);}return[];})[_0x2ca2('0x26')](function(_0x58ae2b){return{'rows':_0x58ae2b,'count':_0x58ae2b[_0x2ca2('0x44')]};})[_0x2ca2('0x26')](respondWithResult(_0x4ab193,null))[_0x2ca2('0x42')](handleError(_0x4ab193,null));}; \ No newline at end of file +var _0x4bb6=['lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','user','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','-createdAt','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','ChatInternalMessage','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','find','params','describe','messages'];(function(_0x2353f5,_0x5751a1){var _0x54836c=function(_0x686bf8){while(--_0x686bf8){_0x2353f5['push'](_0x2353f5['shift']());}};_0x54836c(++_0x5751a1);}(_0x4bb6,0x1de));var _0x64bb=function(_0x1c78a7,_0x14df1c){_0x1c78a7=_0x1c78a7-0x0;var _0x3af718=_0x4bb6[_0x1c78a7];return _0x3af718;};'use strict';var emlformat=require(_0x64bb('0x0'));var rimraf=require(_0x64bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64bb('0x2'));var rp=require(_0x64bb('0x3'));var moment=require(_0x64bb('0x4'));var BPromise=require(_0x64bb('0x5'));var Mustache=require(_0x64bb('0x6'));var util=require(_0x64bb('0x7'));var path=require(_0x64bb('0x8'));var sox=require('sox');var csv=require(_0x64bb('0x9'));var ejs=require(_0x64bb('0xa'));var fs=require('fs');var fs_extra=require(_0x64bb('0xb'));var _=require(_0x64bb('0xc'));var squel=require(_0x64bb('0xd'));var crypto=require(_0x64bb('0xe'));var jsforce=require(_0x64bb('0xf'));var deskjs=require(_0x64bb('0x10'));var toCsv=require('to-csv');var querystring=require(_0x64bb('0x11'));var Papa=require(_0x64bb('0x12'));var Redis=require(_0x64bb('0x13'));var authService=require(_0x64bb('0x14'));var qs=require(_0x64bb('0x15'));var as=require(_0x64bb('0x16'));var hardwareService=require(_0x64bb('0x17'));var logger=require(_0x64bb('0x18'))(_0x64bb('0x19'));var utils=require('../../config/utils');var config=require(_0x64bb('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x64bb('0x1b'))['db'];config[_0x64bb('0x1c')]=_[_0x64bb('0x1d')](config[_0x64bb('0x1c')],{'host':_0x64bb('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64bb('0x1c')]));require(_0x64bb('0x1f'))['register'](socket);function respondWithStatusCode(_0x190cf2,_0x2e2b9d){_0x2e2b9d=_0x2e2b9d||0xcc;return function(_0x436443){if(_0x436443){return _0x190cf2[_0x64bb('0x20')](_0x2e2b9d);}return _0x190cf2[_0x64bb('0x21')](_0x2e2b9d)[_0x64bb('0x22')]();};}function respondWithResult(_0x56dd8a,_0x582b7d){_0x582b7d=_0x582b7d||0xc8;return function(_0x625bf1){if(_0x625bf1){return _0x56dd8a[_0x64bb('0x21')](_0x582b7d)[_0x64bb('0x23')](_0x625bf1);}};}function respondWithFilteredResult(_0x12acc8,_0x38fa82){return function(_0x13a406){if(_0x13a406){var _0x531fc0=typeof _0x38fa82[_0x64bb('0x24')]==='undefined'&&typeof _0x38fa82[_0x64bb('0x25')]===_0x64bb('0x26');var _0x506eda=_0x13a406[_0x64bb('0x27')];var _0x2155ea=_0x531fc0?0x0:_0x38fa82['offset'];var _0x495dd6=_0x531fc0?_0x13a406[_0x64bb('0x27')]:_0x38fa82[_0x64bb('0x24')]+_0x38fa82[_0x64bb('0x25')];var _0x125222;if(_0x495dd6>=_0x506eda){_0x495dd6=_0x506eda;_0x125222=0xc8;}else{_0x125222=0xce;}_0x12acc8[_0x64bb('0x21')](_0x125222);return _0x12acc8[_0x64bb('0x28')](_0x64bb('0x29'),_0x2155ea+'-'+_0x495dd6+'/'+_0x506eda)[_0x64bb('0x23')](_0x13a406);}return null;};}function patchUpdates(_0x1d51d6){return function(_0x461fd8){try{jsonpatch[_0x64bb('0x2a')](_0x461fd8,_0x1d51d6,!![]);}catch(_0x2556ed){return BPromise[_0x64bb('0x2b')](_0x2556ed);}return _0x461fd8['save']();};}function saveUpdates(_0x5420cc,_0x5891ef){return function(_0x1da63b){if(_0x1da63b){return _0x1da63b[_0x64bb('0x2c')](_0x5420cc)[_0x64bb('0x2d')](function(_0x22257e){return _0x22257e;});}return null;};}function removeEntity(_0xf7885,_0xab8d9c){return function(_0x53432d){if(_0x53432d){return _0x53432d[_0x64bb('0x2e')]()[_0x64bb('0x2d')](function(){_0xf7885[_0x64bb('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d947,_0xe8a2ab){return function(_0x2b862f){if(!_0x2b862f){_0x59d947['sendStatus'](0x194);}return _0x2b862f;};}function handleError(_0x51c7b2,_0x33c370){_0x33c370=_0x33c370||0x1f4;return function(_0x1f1087){logger[_0x64bb('0x2f')](_0x1f1087['stack']);if(_0x1f1087['name']){delete _0x1f1087[_0x64bb('0x30')];}_0x51c7b2[_0x64bb('0x21')](_0x33c370)[_0x64bb('0x31')](_0x1f1087);};}exports['index']=function(_0x4c611d,_0x467f29){var _0x27a8ee={},_0x937973={},_0x578c74={'count':0x0,'rows':[]};var _0x4a4c09=_[_0x64bb('0x32')](db[_0x64bb('0x33')]['rawAttributes'],function(_0x3fe33a){return{'name':_0x3fe33a[_0x64bb('0x34')],'type':_0x3fe33a[_0x64bb('0x35')]['key']};});_0x937973[_0x64bb('0x36')]=_[_0x64bb('0x32')](_0x4a4c09,_0x64bb('0x30'));_0x937973[_0x64bb('0x37')]=_[_0x64bb('0x38')](_0x4c611d['query']);_0x937973['filters']=_[_0x64bb('0x39')](_0x937973[_0x64bb('0x36')],_0x937973[_0x64bb('0x37')]);_0x27a8ee[_0x64bb('0x3a')]=_[_0x64bb('0x39')](_0x937973[_0x64bb('0x36')],qs[_0x64bb('0x3b')](_0x4c611d[_0x64bb('0x37')][_0x64bb('0x3b')]));_0x27a8ee[_0x64bb('0x3a')]=_0x27a8ee[_0x64bb('0x3a')][_0x64bb('0x3c')]?_0x27a8ee['attributes']:_0x937973[_0x64bb('0x36')];if(!_0x4c611d[_0x64bb('0x37')][_0x64bb('0x3d')]('nolimit')){_0x27a8ee[_0x64bb('0x25')]=qs[_0x64bb('0x25')](_0x4c611d['query'][_0x64bb('0x25')]);_0x27a8ee[_0x64bb('0x24')]=qs[_0x64bb('0x24')](_0x4c611d[_0x64bb('0x37')][_0x64bb('0x24')]);}_0x27a8ee[_0x64bb('0x3e')]=qs[_0x64bb('0x3f')](_0x4c611d[_0x64bb('0x37')][_0x64bb('0x3f')]);_0x27a8ee[_0x64bb('0x40')]=qs[_0x64bb('0x41')](_[_0x64bb('0x42')](_0x4c611d['query'],_0x937973[_0x64bb('0x41')]),_0x4a4c09);if(_0x4c611d[_0x64bb('0x37')][_0x64bb('0x43')]){_0x27a8ee['where']=_[_0x64bb('0x44')](_0x27a8ee[_0x64bb('0x40')],{'$or':_[_0x64bb('0x32')](_0x4a4c09,function(_0x58488e){if(_0x58488e[_0x64bb('0x35')]!==_0x64bb('0x45')){var _0x2134f7={};_0x2134f7[_0x58488e[_0x64bb('0x30')]]={'$like':'%'+_0x4c611d[_0x64bb('0x37')][_0x64bb('0x43')]+'%'};return _0x2134f7;}})});}_0x27a8ee=_['merge']({},_0x27a8ee,_0x4c611d[_0x64bb('0x46')]);var _0x4b7d22={'where':_0x27a8ee[_0x64bb('0x40')]};return db[_0x64bb('0x33')]['count'](_0x4b7d22)['then'](function(_0x30fd03){_0x578c74[_0x64bb('0x27')]=_0x30fd03;if(_0x4c611d['query'][_0x64bb('0x47')]){_0x27a8ee[_0x64bb('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x64bb('0x49')](_0x27a8ee);})[_0x64bb('0x2d')](function(_0x183513){_0x578c74['rows']=_0x183513;return _0x578c74;})[_0x64bb('0x2d')](respondWithFilteredResult(_0x467f29,_0x27a8ee))['catch'](handleError(_0x467f29,null));};exports[_0x64bb('0x4a')]=function(_0x56e05a,_0x56d157){var _0x4fbb37={'raw':!![],'where':{'id':_0x56e05a['params']['id']}},_0x492eb1={};_0x492eb1['model']=_[_0x64bb('0x38')](db[_0x64bb('0x33')]['rawAttributes']);_0x492eb1[_0x64bb('0x37')]=_[_0x64bb('0x38')](_0x56e05a[_0x64bb('0x37')]);_0x492eb1[_0x64bb('0x41')]=_[_0x64bb('0x39')](_0x492eb1[_0x64bb('0x36')],_0x492eb1[_0x64bb('0x37')]);_0x4fbb37['attributes']=_[_0x64bb('0x39')](_0x492eb1['model'],qs[_0x64bb('0x3b')](_0x56e05a[_0x64bb('0x37')]['fields']));_0x4fbb37[_0x64bb('0x3a')]=_0x4fbb37['attributes']['length']?_0x4fbb37[_0x64bb('0x3a')]:_0x492eb1[_0x64bb('0x36')];if(_0x56e05a[_0x64bb('0x37')][_0x64bb('0x47')]){_0x4fbb37[_0x64bb('0x48')]=[{'all':!![]}];}_0x4fbb37=_[_0x64bb('0x44')]({},_0x4fbb37,_0x56e05a[_0x64bb('0x46')]);return db[_0x64bb('0x33')]['find'](_0x4fbb37)['then'](handleEntityNotFound(_0x56d157,null))[_0x64bb('0x2d')](respondWithResult(_0x56d157,null))[_0x64bb('0x4b')](handleError(_0x56d157,null));};exports[_0x64bb('0x4c')]=function(_0x38d14c,_0x15f4a5){return db[_0x64bb('0x33')][_0x64bb('0x4c')](_0x38d14c[_0x64bb('0x4d')],{})['then'](respondWithResult(_0x15f4a5,0xc9))['catch'](handleError(_0x15f4a5,null));};exports[_0x64bb('0x2c')]=function(_0x4c95c2,_0x1756e4){if(_0x4c95c2['body']['id']){delete _0x4c95c2[_0x64bb('0x4d')]['id'];}return db[_0x64bb('0x33')][_0x64bb('0x4e')]({'where':{'id':_0x4c95c2[_0x64bb('0x4f')]['id']}})[_0x64bb('0x2d')](handleEntityNotFound(_0x1756e4,null))[_0x64bb('0x2d')](saveUpdates(_0x4c95c2[_0x64bb('0x4d')],null))[_0x64bb('0x2d')](respondWithResult(_0x1756e4,null))['catch'](handleError(_0x1756e4,null));};exports[_0x64bb('0x2e')]=function(_0x4f68e8,_0x598be1){return db[_0x64bb('0x33')][_0x64bb('0x4e')]({'where':{'id':_0x4f68e8[_0x64bb('0x4f')]['id']}})[_0x64bb('0x2d')](handleEntityNotFound(_0x598be1,null))['then'](removeEntity(_0x598be1,null))['catch'](handleError(_0x598be1,null));};exports[_0x64bb('0x50')]=function(_0x1efaeb,_0xb16bc5){return db[_0x64bb('0x33')][_0x64bb('0x50')]()[_0x64bb('0x2d')](respondWithResult(_0xb16bc5,null))[_0x64bb('0x4b')](handleError(_0xb16bc5,null));};function wrapUser(_0x76ba2f){return function(_0x613fb4){var _0x178aa8=_0x76ba2f['get']({'plain':!![]});_0x178aa8[_0x64bb('0x51')]=[];if(_0x613fb4){_0x178aa8[_0x64bb('0x52')]=_0x613fb4['createdAt'];_0x178aa8[_0x64bb('0x53')]=_0x613fb4;}else{_0x178aa8['lastMessageAt']=moment(0x0)['format'](_0x64bb('0x54'));_0x178aa8['lastMessage']={};}return _0x178aa8;};}exports[_0x64bb('0x55')]=function(_0x421435,_0x17508f,_0x340c57){var _0x5b10b7=[];return db['User']['findAll']({'where':{'role':[_0x64bb('0x56'),_0x64bb('0x57'),'user']},'attributes':['id',_0x64bb('0x58'),_0x64bb('0x30'),_0x64bb('0x59'),_0x64bb('0x5a'),_0x64bb('0x5b'),_0x64bb('0x5c'),_0x64bb('0x5d'),_0x64bb('0x5e'),_0x64bb('0x5f')],'order':qs[_0x64bb('0x3f')]('-online'),'include':[{'model':db[_0x64bb('0x60')],'as':_0x64bb('0x61'),'attributes':['id',_0x64bb('0x30'),_0x64bb('0x35')],'through':{'attributes':[]}}]})[_0x64bb('0x2d')](function(_0x3582cc){if(_0x3582cc){var _0x472bc1=_0x421435[_0x64bb('0x62')][_0x64bb('0x63')]({'plain':!![]});if(!_0x472bc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x472bc1['role']==='user'){return db[_0x64bb('0x64')][_0x64bb('0x4e')]({'where':{'name':_0x64bb('0x65'),'userProfileId':_0x472bc1[_0x64bb('0x66')]},'raw':!![]})['then'](function(_0x299977){if(_0x299977){if(_0x299977[_0x64bb('0x67')]===0x0){return db[_0x64bb('0x68')][_0x64bb('0x49')]({'where':{'sectionId':_0x299977['id']},'raw':!![]})[_0x64bb('0x2d')](function(_0x11618a){var _0x3a43ed=[];if(_[_0x64bb('0x69')](_0x11618a)){_0x3a43ed=_[_0x64bb('0x43')](_0x3582cc,function(_0x3a97ba){if(_0x3a97ba[_0x64bb('0x59')]!=='agent'){return _0x3a97ba;}});return _0x3a43ed;}else{for(var _0x1f910c=0x0;_0x1f910c<_0x3582cc[_0x64bb('0x3c')];_0x1f910c++){var _0x224b85=_0x3582cc[_0x1f910c];if(_0x224b85[_0x64bb('0x59')]===_0x64bb('0x56')){var _0x42e397=_[_0x64bb('0x4e')](_0x11618a,function(_0x3edee1){return _0x3edee1[_0x64bb('0x6a')]===_0x224b85['id'];});if(_0x42e397)_0x3a43ed[_0x64bb('0x6b')](_0x224b85);}else{_0x3a43ed[_0x64bb('0x6b')](_0x224b85);}}return _0x3a43ed;}});}else{return _0x3582cc;}}else{var _0x262a52=_[_0x64bb('0x43')](_0x3582cc,function(_0x548e29){if(_0x548e29[_0x64bb('0x59')]!==_0x64bb('0x56')){return _0x548e29;}});return _0x262a52;}});}else{return _0x3582cc;}}})[_0x64bb('0x2d')](function(_0x331bb8){var _0x250adc=[];if(_0x331bb8){_0x5b10b7=_0x331bb8;for(var _0x1d1210=0x0;_0x1d1210<_0x331bb8['length'];_0x1d1210+=0x1){_0x5b10b7[_0x1d1210][_0x64bb('0x51')]=[];_0x250adc['push'](db[_0x64bb('0x33')][_0x64bb('0x4e')]({'where':{'FromId':[_0x421435[_0x64bb('0x62')]['id'],_0x331bb8[_0x1d1210]['id']],'ToId':[_0x421435[_0x64bb('0x62')]['id'],_0x331bb8[_0x1d1210]['id']],'ChatGroupId':null},'attributes':['id',_0x64bb('0x6c'),_0x64bb('0x6d'),'ToId',_0x64bb('0x6e'),_0x64bb('0x4d')],'order':qs[_0x64bb('0x3f')](_0x64bb('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x64bb('0x2d')](wrapUser(_0x331bb8[_0x1d1210])));}return BPromise['all'](_0x250adc);}return[];})[_0x64bb('0x2d')](function(_0x30c547){return{'rows':_0x30c547,'count':_0x30c547[_0x64bb('0x3c')]};})[_0x64bb('0x2d')](respondWithResult(_0x17508f,null))['catch'](handleError(_0x17508f,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 045f96b..c1250cb 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 _0xb730=['save','update','emit','exports','../../mysqldb','ChatInternalMessage'];(function(_0x295795,_0x107a09){var _0x2688c4=function(_0x259b4c){while(--_0x259b4c){_0x295795['push'](_0x295795['shift']());}};_0x2688c4(++_0x107a09);}(_0xb730,0xac));var _0x0b73=function(_0x3aefeb,_0x1f96b1){_0x3aefeb=_0x3aefeb-0x0;var _0x37ab2d=_0xb730[_0x3aefeb];return _0x37ab2d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0b73('0x0'))['db'][_0x0b73('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0b73('0x2'),'afterUpdate':_0x0b73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5ec88a){return function(_0x4ea36f,_0x12e05b,_0x50e4d9){ChatInternalMessageEvents[_0x0b73('0x4')](_0x5ec88a+':'+_0x4ea36f['id'],_0x4ea36f);ChatInternalMessageEvents['emit'](_0x5ec88a,_0x4ea36f);_0x50e4d9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x0b73('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x09a1=['emit','hook','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x469665,_0x394876){var _0x291ab5=function(_0x55c1c7){while(--_0x55c1c7){_0x469665['push'](_0x469665['shift']());}};_0x291ab5(++_0x394876);}(_0x09a1,0x14b));var _0x109a=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x09a1[_0xf0bc07];return _0x1c50c2;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x109a('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x109a('0x1')](0x0);var events={'afterCreate':_0x109a('0x2'),'afterUpdate':_0x109a('0x3'),'afterDestroy':_0x109a('0x4')};function emitEvent(_0x35342b){return function(_0x3ba56a,_0x47a6b2,_0x16d169){ChatInternalMessageEvents['emit'](_0x35342b+':'+_0x3ba56a['id'],_0x3ba56a);ChatInternalMessageEvents[_0x109a('0x5')](_0x35342b,_0x3ba56a);_0x16d169(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x109a('0x6')](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 e0405bd..9282af4 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 _0x8827=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird'];(function(_0x3c738c,_0x276028){var _0x2fdbb2=function(_0x103dfb){while(--_0x103dfb){_0x3c738c['push'](_0x3c738c['shift']());}};_0x2fdbb2(++_0x276028);}(_0x8827,0xed));var _0x7882=function(_0x3008b9,_0x1c1675){_0x3008b9=_0x3008b9-0x0;var _0x3e4650=_0x8827[_0x3008b9];return _0x3e4650;};'use strict';var _=require(_0x7882('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7882('0x1'));var moment=require('moment');var BPromise=require(_0x7882('0x2'));var rp=require(_0x7882('0x3'));var fs=require('fs');var path=require(_0x7882('0x4'));var rimraf=require(_0x7882('0x5'));var config=require(_0x7882('0x6'));var attributes=require(_0x7882('0x7'));module['exports']=function(_0xe70adb,_0xc4dd9e){return _0xe70adb['define'](_0x7882('0x8'),attributes,{'tableName':_0x7882('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7882('0xa'),'collate':_0x7882('0xb')});}; \ No newline at end of file +var _0xf504=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xf504,0x149));var _0x4f50=function(_0x29fb0d,_0xa48a67){_0x29fb0d=_0x29fb0d-0x0;var _0x44a634=_0xf504[_0x29fb0d];return _0x44a634;};'use strict';var _=require(_0x4f50('0x0'));var util=require(_0x4f50('0x1'));var logger=require(_0x4f50('0x2'))('api');var moment=require(_0x4f50('0x3'));var BPromise=require(_0x4f50('0x4'));var rp=require(_0x4f50('0x5'));var fs=require('fs');var path=require(_0x4f50('0x6'));var rimraf=require(_0x4f50('0x7'));var config=require(_0x4f50('0x8'));var attributes=require(_0x4f50('0x9'));module[_0x4f50('0xa')]=function(_0x42c8bb,_0x2c90ac){return _0x42c8bb[_0x4f50('0xb')](_0x4f50('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4f50('0xd'),'collate':_0x4f50('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index bf67c8f..1b379c3 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 _0x9ee6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','./chatInternalMessage.socket','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x9ee6,0x125));var _0x69ee=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x9ee6[_0x593d89];return _0x4aa403;};'use strict';var _=require(_0x69ee('0x0'));var util=require(_0x69ee('0x1'));var moment=require(_0x69ee('0x2'));var BPromise=require(_0x69ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69ee('0x4'));var db=require(_0x69ee('0x5'))['db'];var utils=require(_0x69ee('0x6'));var logger=require('../../config/logger')(_0x69ee('0x7'));var config=require(_0x69ee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x69ee('0x9')]['http']({'port':0x232a});config[_0x69ee('0xa')]=_[_0x69ee('0xb')](config[_0x69ee('0xa')],{'host':_0x69ee('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x69ee('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99b3,_0xa957e1,_0x4b5bf5){return new BPromise(function(_0x3e6fb3,_0x260701){return client[_0x69ee('0xe')](_0x1a99b3,_0x4b5bf5)[_0x69ee('0xf')](function(_0x5e229e){logger['info'](_0x69ee('0x10'),_0xa957e1,_0x69ee('0x11'));logger[_0x69ee('0x12')](_0x69ee('0x13'),_0xa957e1,'request\x20sent',JSON[_0x69ee('0x14')](_0x5e229e));if(_0x5e229e[_0x69ee('0x15')]){if(_0x5e229e[_0x69ee('0x15')][_0x69ee('0x16')]===0x1f4){logger['error'](_0x69ee('0x10'),_0xa957e1,_0x5e229e['error'][_0x69ee('0x17')]);return _0x260701(_0x5e229e['error']['message']);}logger[_0x69ee('0x15')](_0x69ee('0x10'),_0xa957e1,_0x5e229e[_0x69ee('0x15')][_0x69ee('0x17')]);return _0x3e6fb3(_0x5e229e[_0x69ee('0x15')][_0x69ee('0x17')]);}else{logger[_0x69ee('0x18')](_0x69ee('0x10'),_0xa957e1,_0x69ee('0x11'));_0x3e6fb3(_0x5e229e[_0x69ee('0x19')][_0x69ee('0x17')]);}})[_0x69ee('0x1a')](function(_0x5c52ba){logger[_0x69ee('0x15')](_0x69ee('0x10'),_0xa957e1,_0x5c52ba);_0x260701(_0x5c52ba);});});} \ No newline at end of file +var _0xf924=['request\x20sent','stringify','error','message','info','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf924,0x1db));var _0x4f92=function(_0x513254,_0x1305ca){_0x513254=_0x513254-0x0;var _0x384c92=_0xf924[_0x513254];return _0x384c92;};'use strict';var _=require('lodash');var util=require(_0x4f92('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f92('0x1'));var db=require(_0x4f92('0x2'))['db'];var utils=require(_0x4f92('0x3'));var logger=require(_0x4f92('0x4'))(_0x4f92('0x5'));var config=require(_0x4f92('0x6'));var jayson=require(_0x4f92('0x7'));var client=jayson[_0x4f92('0x8')][_0x4f92('0x9')]({'port':0x232a});config[_0x4f92('0xa')]=_[_0x4f92('0xb')](config[_0x4f92('0xa')],{'host':_0x4f92('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f92('0xa')]));require(_0x4f92('0xd'))[_0x4f92('0xe')](socket);function respondWithRpcPromise(_0x34c5f2,_0x11352f,_0x4cf3c1){return new BPromise(function(_0x307105,_0x3de456){return client[_0x4f92('0xf')](_0x34c5f2,_0x4cf3c1)[_0x4f92('0x10')](function(_0x5af06d){logger['info'](_0x4f92('0x11'),_0x11352f,'request\x20sent');logger[_0x4f92('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x11352f,_0x4f92('0x13'),JSON[_0x4f92('0x14')](_0x5af06d));if(_0x5af06d[_0x4f92('0x15')]){if(_0x5af06d['error']['code']===0x1f4){logger['error'](_0x4f92('0x11'),_0x11352f,_0x5af06d[_0x4f92('0x15')]['message']);return _0x3de456(_0x5af06d[_0x4f92('0x15')][_0x4f92('0x16')]);}logger[_0x4f92('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x11352f,_0x5af06d[_0x4f92('0x15')][_0x4f92('0x16')]);return _0x307105(_0x5af06d[_0x4f92('0x15')][_0x4f92('0x16')]);}else{logger[_0x4f92('0x17')](_0x4f92('0x11'),_0x11352f,'request\x20sent');_0x307105(_0x5af06d[_0x4f92('0x18')]['message']);}})[_0x4f92('0x19')](function(_0x3e90e9){logger['error'](_0x4f92('0x11'),_0x11352f,_0x3e90e9);_0x3de456(_0x3e90e9);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 997c294..338e8fb 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 _0x115f=['./chatInternalMessage.events','save','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x4c5faa,_0x5bedd7){var _0x3333b3=function(_0x4b1083){while(--_0x4b1083){_0x4c5faa['push'](_0x4c5faa['shift']());}};_0x3333b3(++_0x5bedd7);}(_0x115f,0x108));var _0xf115=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x115f[_0x21a9d9];return _0x46adce;};'use strict';var ChatInternalMessageEvents=require(_0xf115('0x0'));var events=[_0xf115('0x1'),'remove',_0xf115('0x2')];function createListener(_0xbd8d0c,_0x361434){return function(_0x3fb8a4){_0x361434[_0xf115('0x3')](_0xbd8d0c,_0x3fb8a4);};}function removeListener(_0x2f62c0,_0x4167e3){return function(){ChatInternalMessageEvents[_0xf115('0x4')](_0x2f62c0,_0x4167e3);};}exports[_0xf115('0x5')]=function(_0x4bba9b){for(var _0xc1d0bc=0x0,_0x4d40a1=events[_0xf115('0x6')];_0xc1d0bc<_0x4d40a1;_0xc1d0bc++){var _0x1c8cca=events[_0xc1d0bc];var _0xba7dde=createListener(_0xf115('0x7')+_0x1c8cca,_0x4bba9b);ChatInternalMessageEvents['on'](_0x1c8cca,_0xba7dde);}}; \ No newline at end of file +var _0xc437=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc437,0xdd));var _0x7c43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc437[_0x321bb2];return _0x9c12ed;};'use strict';var ChatInternalMessageEvents=require(_0x7c43('0x0'));var events=['save',_0x7c43('0x1'),_0x7c43('0x2')];function createListener(_0x5a1685,_0x432a51){return function(_0x338f20){_0x432a51[_0x7c43('0x3')](_0x5a1685,_0x338f20);};}function removeListener(_0x31c5d3,_0x397443){return function(){ChatInternalMessageEvents[_0x7c43('0x4')](_0x31c5d3,_0x397443);};}exports[_0x7c43('0x5')]=function(_0x3d9d63){for(var _0x10094c=0x0,_0x221803=events[_0x7c43('0x6')];_0x10094c<_0x221803;_0x10094c++){var _0x21e0ca=events[_0x10094c];var _0x3f2a8b=createListener(_0x7c43('0x7')+_0x21e0ca,_0x3d9d63);ChatInternalMessageEvents['on'](_0x21e0ca,_0x3f2a8b);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 8e9b884..eb7510d 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 _0xea49=['getUsers','show','post','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users'];(function(_0x3b26f4,_0x1fe634){var _0x36ba62=function(_0x488999){while(--_0x488999){_0x3b26f4['push'](_0x3b26f4['shift']());}};_0x36ba62(++_0x1fe634);}(_0xea49,0x14b));var _0x9ea4=function(_0x168310,_0xe393f5){_0x168310=_0x168310-0x0;var _0x4ba9d3=_0xea49[_0x168310];return _0x4ba9d3;};'use strict';var multer=require(_0x9ea4('0x0'));var util=require(_0x9ea4('0x1'));var path=require('path');var timeout=require(_0x9ea4('0x2'));var express=require(_0x9ea4('0x3'));var router=express[_0x9ea4('0x4')]();var fs_extra=require(_0x9ea4('0x5'));var auth=require(_0x9ea4('0x6'));var interaction=require(_0x9ea4('0x7'));var config=require('../../config/environment');var controller=require(_0x9ea4('0x8'));router[_0x9ea4('0x9')]('/',auth[_0x9ea4('0xa')](),controller[_0x9ea4('0xb')]);router[_0x9ea4('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9ea4('0xc')]);router[_0x9ea4('0x9')](_0x9ea4('0xd'),auth[_0x9ea4('0xa')](),controller[_0x9ea4('0xe')]);router[_0x9ea4('0x9')]('/:id',auth[_0x9ea4('0xa')](),controller[_0x9ea4('0xf')]);router[_0x9ea4('0x10')]('/',auth[_0x9ea4('0xa')](),controller['create']);router[_0x9ea4('0x11')]('/:id',controller[_0x9ea4('0x12')]);router[_0x9ea4('0x13')](_0x9ea4('0x14'),auth[_0x9ea4('0xa')](),controller[_0x9ea4('0x15')]);module[_0x9ea4('0x16')]=router; \ No newline at end of file +var _0xcf3e=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','create','put','/:id','update','destroy'];(function(_0x17e623,_0x3b42e8){var _0x228219=function(_0x2e58e2){while(--_0x2e58e2){_0x17e623['push'](_0x17e623['shift']());}};_0x228219(++_0x3b42e8);}(_0xcf3e,0xc1));var _0xecf3=function(_0x51a1ca,_0x22fd11){_0x51a1ca=_0x51a1ca-0x0;var _0x35f0f8=_0xcf3e[_0x51a1ca];return _0x35f0f8;};'use strict';var multer=require(_0xecf3('0x0'));var util=require(_0xecf3('0x1'));var path=require(_0xecf3('0x2'));var timeout=require('connect-timeout');var express=require(_0xecf3('0x3'));var router=express[_0xecf3('0x4')]();var fs_extra=require(_0xecf3('0x5'));var auth=require(_0xecf3('0x6'));var interaction=require(_0xecf3('0x7'));var config=require(_0xecf3('0x8'));var controller=require(_0xecf3('0x9'));router[_0xecf3('0xa')]('/',auth[_0xecf3('0xb')](),controller[_0xecf3('0xc')]);router['get'](_0xecf3('0xd'),auth[_0xecf3('0xb')](),controller[_0xecf3('0xe')]);router[_0xecf3('0xa')](_0xecf3('0xf'),auth[_0xecf3('0xb')](),controller[_0xecf3('0x10')]);router['get']('/:id',auth[_0xecf3('0xb')](),controller[_0xecf3('0x11')]);router['post']('/',auth[_0xecf3('0xb')](),controller[_0xecf3('0x12')]);router[_0xecf3('0x13')](_0xecf3('0x14'),controller[_0xecf3('0x15')]);router['delete'](_0xecf3('0x14'),auth[_0xecf3('0xb')](),controller[_0xecf3('0x16')]);module[_0xecf3('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 62845fb..7401250 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 _0x352e=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x169045,_0x36511c){var _0x5a78ef=function(_0x21ccd0){while(--_0x21ccd0){_0x169045['push'](_0x169045['shift']());}};_0x5a78ef(++_0x36511c);}(_0x352e,0x1a6));var _0xe352=function(_0x43781a,_0x1231df){_0x43781a=_0x43781a-0x0;var _0xc90438=_0x352e[_0x43781a];return _0xc90438;};'use strict';var Sequelize=require(_0xe352('0x0'));module[_0xe352('0x1')]={'body':{'type':Sequelize[_0xe352('0x2')](_0xe352('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe352('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe352('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe352('0x5')]('in',_0xe352('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe352('0x7')]},'providerName':{'type':Sequelize[_0xe352('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9d5b=['BOOLEAN','out','DATE','STRING','exports','TEXT','medium'];(function(_0x51ddc6,_0x548743){var _0x51f813=function(_0x34aa08){while(--_0x34aa08){_0x51ddc6['push'](_0x51ddc6['shift']());}};_0x51f813(++_0x548743);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x26d717,_0x2746f0){_0x26d717=_0x26d717-0x0;var _0xaa9377=_0x9d5b[_0x26d717];return _0xaa9377;};'use strict';var Sequelize=require('sequelize');module[_0xb9d5('0x0')]={'body':{'type':Sequelize[_0xb9d5('0x1')](_0xb9d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb9d5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9d5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb9d5('0x5')]},'providerName':{'type':Sequelize[_0xb9d5('0x6')]},'providerResponse':{'type':Sequelize[_0xb9d5('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index c93bcd3..bce5f86 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 _0xc9b8=['UserId','user','agent','get','ChatInteraction','update','isNil','interaction','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','email','EventManager','rejectmessage','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','request','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','info','request\x20sent','catch','status','json','undefined','count','offset','limit','Content-Range','apply','reject','then','destroy','end','sendStatus','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5c3b55,_0x36f644){var _0x1409b9=function(_0x277607){while(--_0x277607){_0x5c3b55['push'](_0x5c3b55['shift']());}};_0x1409b9(++_0x36f644);}(_0xc9b8,0xaa));var _0x8c9b=function(_0x4c7bca,_0xf81478){_0x4c7bca=_0x4c7bca-0x0;var _0x39435c=_0xc9b8[_0x4c7bca];return _0x39435c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8c9b('0x0'));var rp=require(_0x8c9b('0x1'));var moment=require(_0x8c9b('0x2'));var BPromise=require(_0x8c9b('0x3'));var Mustache=require(_0x8c9b('0x4'));var util=require(_0x8c9b('0x5'));var path=require(_0x8c9b('0x6'));var sox=require(_0x8c9b('0x7'));var csv=require(_0x8c9b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c9b('0x9'));var _=require(_0x8c9b('0xa'));var squel=require('squel');var crypto=require(_0x8c9b('0xb'));var jsforce=require(_0x8c9b('0xc'));var deskjs=require(_0x8c9b('0xd'));var toCsv=require(_0x8c9b('0x8'));var querystring=require(_0x8c9b('0xe'));var Papa=require(_0x8c9b('0xf'));var Redis=require(_0x8c9b('0x10'));var authService=require(_0x8c9b('0x11'));var qs=require(_0x8c9b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c9b('0x13'))(_0x8c9b('0x14'));var utils=require(_0x8c9b('0x15'));var config=require(_0x8c9b('0x16'));var licenseUtil=require(_0x8c9b('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8c9b('0x18')](config['redis'],{'host':_0x8c9b('0x19'),'port':0x18eb});var socket=require(_0x8c9b('0x1a'))(new Redis(config[_0x8c9b('0x1b')]));require(_0x8c9b('0x1c'))[_0x8c9b('0x1d')](socket);var jayson=require(_0x8c9b('0x1e'));var client=jayson['client'][_0x8c9b('0x1f')]({'port':0x232c});var client9002=jayson[_0x8c9b('0x20')][_0x8c9b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x44e462,_0x38ffb5,_0x22fbab,_0x4ed3a5){return new BPromise(function(_0x5a31cd,_0x4b5a02){var _0x4b7915=_0x4ed3a5||client;return _0x4b7915[_0x8c9b('0x21')](_0x44e462,_0x22fbab)['then'](function(_0xab0c3a){logger['info']('ChatMessage,\x20%s,\x20%s',_0x38ffb5,'request\x20sent');logger[_0x8c9b('0x22')](_0x8c9b('0x23'),_0x38ffb5,'request\x20sent',JSON[_0x8c9b('0x24')](_0xab0c3a));if(_0xab0c3a[_0x8c9b('0x25')]){if(_0xab0c3a[_0x8c9b('0x25')][_0x8c9b('0x26')]===0x1f4){logger[_0x8c9b('0x25')]('ChatMessage,\x20%s,\x20%s',_0x38ffb5,_0xab0c3a['error'][_0x8c9b('0x27')]);return _0x4b5a02(_0xab0c3a[_0x8c9b('0x25')]['message']);}logger['error'](_0x8c9b('0x28'),_0x38ffb5,_0xab0c3a[_0x8c9b('0x25')]['message']);return _0x5a31cd(_0xab0c3a[_0x8c9b('0x25')][_0x8c9b('0x27')]);}else{logger[_0x8c9b('0x29')](_0x8c9b('0x28'),_0x38ffb5,_0x8c9b('0x2a'));_0x5a31cd(_0xab0c3a['result'][_0x8c9b('0x27')]);}})[_0x8c9b('0x2b')](function(_0x1b2d00){logger[_0x8c9b('0x25')](_0x8c9b('0x28'),_0x38ffb5,_0x1b2d00);_0x4b5a02(_0x1b2d00);});});}function respondWithStatusCode(_0x4fab05,_0x4ce4ab){_0x4ce4ab=_0x4ce4ab||0xcc;return function(_0x47f89a){if(_0x47f89a){return _0x4fab05['sendStatus'](_0x4ce4ab);}return _0x4fab05[_0x8c9b('0x2c')](_0x4ce4ab)['end']();};}function respondWithResult(_0x3a45d3,_0x44305a){_0x44305a=_0x44305a||0xc8;return function(_0x15919b){if(_0x15919b){return _0x3a45d3[_0x8c9b('0x2c')](_0x44305a)[_0x8c9b('0x2d')](_0x15919b);}};}function respondWithFilteredResult(_0x5125dd,_0x521b1d){return function(_0x59a747){if(_0x59a747){var _0x46e869=typeof _0x521b1d['offset']===_0x8c9b('0x2e')&&typeof _0x521b1d['limit']==='undefined';var _0x4f9174=_0x59a747[_0x8c9b('0x2f')];var _0x32f51a=_0x46e869?0x0:_0x521b1d[_0x8c9b('0x30')];var _0x3435dd=_0x46e869?_0x59a747[_0x8c9b('0x2f')]:_0x521b1d[_0x8c9b('0x30')]+_0x521b1d[_0x8c9b('0x31')];var _0x87b7a0;if(_0x3435dd>=_0x4f9174){_0x3435dd=_0x4f9174;_0x87b7a0=0xc8;}else{_0x87b7a0=0xce;}_0x5125dd[_0x8c9b('0x2c')](_0x87b7a0);return _0x5125dd['set'](_0x8c9b('0x32'),_0x32f51a+'-'+_0x3435dd+'/'+_0x4f9174)[_0x8c9b('0x2d')](_0x59a747);}return null;};}function patchUpdates(_0x41fb0a){return function(_0x4cb842){try{jsonpatch[_0x8c9b('0x33')](_0x4cb842,_0x41fb0a,!![]);}catch(_0x4ce695){return BPromise[_0x8c9b('0x34')](_0x4ce695);}return _0x4cb842['save']();};}function saveUpdates(_0x5e4e38,_0x1f35d1){return function(_0x15027e){if(_0x15027e){return _0x15027e['update'](_0x5e4e38)[_0x8c9b('0x35')](function(_0x5347e4){return _0x5347e4;});}return null;};}function removeEntity(_0x41f849,_0x49fd4e){return function(_0x2b51b5){if(_0x2b51b5){return _0x2b51b5[_0x8c9b('0x36')]()[_0x8c9b('0x35')](function(){_0x41f849[_0x8c9b('0x2c')](0xcc)[_0x8c9b('0x37')]();});}};}function handleEntityNotFound(_0x194bc4,_0x4566a0){return function(_0x236555){if(!_0x236555){_0x194bc4[_0x8c9b('0x38')](0x194);}return _0x236555;};}function handleError(_0x311e10,_0x53ed09){_0x53ed09=_0x53ed09||0x1f4;return function(_0x10a828){logger[_0x8c9b('0x25')](_0x10a828['stack']);if(_0x10a828[_0x8c9b('0x39')]){delete _0x10a828[_0x8c9b('0x39')];}_0x311e10['status'](_0x53ed09)[_0x8c9b('0x3a')](_0x10a828);};}exports['index']=function(_0x255cc2,_0x20e4ff){var _0x2b62cd={},_0x1ff88b={},_0xbcb377={'count':0x0,'rows':[]};var _0x5339b1=_[_0x8c9b('0x3b')](db[_0x8c9b('0x3c')][_0x8c9b('0x3d')],function(_0x52d945){return{'name':_0x52d945[_0x8c9b('0x3e')],'type':_0x52d945[_0x8c9b('0x3f')][_0x8c9b('0x40')]};});_0x1ff88b[_0x8c9b('0x41')]=_[_0x8c9b('0x3b')](_0x5339b1,'name');_0x1ff88b[_0x8c9b('0x42')]=_[_0x8c9b('0x43')](_0x255cc2['query']);_0x1ff88b['filters']=_['intersection'](_0x1ff88b[_0x8c9b('0x41')],_0x1ff88b[_0x8c9b('0x42')]);_0x2b62cd[_0x8c9b('0x44')]=_[_0x8c9b('0x45')](_0x1ff88b['model'],qs[_0x8c9b('0x46')](_0x255cc2['query'][_0x8c9b('0x46')]));_0x2b62cd[_0x8c9b('0x44')]=_0x2b62cd[_0x8c9b('0x44')][_0x8c9b('0x47')]?_0x2b62cd['attributes']:_0x1ff88b[_0x8c9b('0x41')];if(!_0x255cc2[_0x8c9b('0x42')][_0x8c9b('0x48')](_0x8c9b('0x49'))){_0x2b62cd['limit']=qs[_0x8c9b('0x31')](_0x255cc2['query']['limit']);_0x2b62cd['offset']=qs[_0x8c9b('0x30')](_0x255cc2[_0x8c9b('0x42')]['offset']);}_0x2b62cd['order']=qs[_0x8c9b('0x4a')](_0x255cc2['query'][_0x8c9b('0x4a')]);_0x2b62cd[_0x8c9b('0x4b')]=qs['filters'](_[_0x8c9b('0x4c')](_0x255cc2[_0x8c9b('0x42')],_0x1ff88b[_0x8c9b('0x4d')]),_0x5339b1);if(_0x255cc2[_0x8c9b('0x42')][_0x8c9b('0x4e')]){_0x2b62cd[_0x8c9b('0x4b')]=_[_0x8c9b('0x4f')](_0x2b62cd[_0x8c9b('0x4b')],{'$or':_[_0x8c9b('0x3b')](_0x5339b1,function(_0x43f041){if(_0x43f041[_0x8c9b('0x3f')]!==_0x8c9b('0x50')){var _0x268f99={};_0x268f99[_0x43f041['name']]={'$like':'%'+_0x255cc2[_0x8c9b('0x42')]['filter']+'%'};return _0x268f99;}})});}_0x2b62cd=_['merge']({},_0x2b62cd,_0x255cc2[_0x8c9b('0x51')]);var _0x5dfc62={'where':_0x2b62cd['where']};return db[_0x8c9b('0x3c')][_0x8c9b('0x2f')](_0x5dfc62)[_0x8c9b('0x35')](function(_0x5cbe7c){_0xbcb377['count']=_0x5cbe7c;if(_0x255cc2[_0x8c9b('0x42')][_0x8c9b('0x52')]){_0x2b62cd[_0x8c9b('0x53')]=[{'all':!![]}];}return db[_0x8c9b('0x3c')][_0x8c9b('0x54')](_0x2b62cd);})[_0x8c9b('0x35')](function(_0x1a281c){_0xbcb377[_0x8c9b('0x55')]=_0x1a281c;return _0xbcb377;})[_0x8c9b('0x35')](respondWithFilteredResult(_0x20e4ff,_0x2b62cd))[_0x8c9b('0x2b')](handleError(_0x20e4ff,null));};exports[_0x8c9b('0x56')]=function(_0x17bc45,_0x5f2a73){var _0x5e1902={'raw':!![],'where':{'id':_0x17bc45[_0x8c9b('0x57')]['id']}},_0x404d61={};_0x404d61['model']=_['keys'](db[_0x8c9b('0x3c')][_0x8c9b('0x3d')]);_0x404d61[_0x8c9b('0x42')]=_[_0x8c9b('0x43')](_0x17bc45[_0x8c9b('0x42')]);_0x404d61['filters']=_[_0x8c9b('0x45')](_0x404d61[_0x8c9b('0x41')],_0x404d61[_0x8c9b('0x42')]);_0x5e1902['attributes']=_[_0x8c9b('0x45')](_0x404d61[_0x8c9b('0x41')],qs[_0x8c9b('0x46')](_0x17bc45['query'][_0x8c9b('0x46')]));_0x5e1902[_0x8c9b('0x44')]=_0x5e1902[_0x8c9b('0x44')][_0x8c9b('0x47')]?_0x5e1902[_0x8c9b('0x44')]:_0x404d61[_0x8c9b('0x41')];if(_0x17bc45[_0x8c9b('0x42')][_0x8c9b('0x52')]){_0x5e1902[_0x8c9b('0x53')]=[{'all':!![]}];}_0x5e1902=_[_0x8c9b('0x4f')]({},_0x5e1902,_0x17bc45[_0x8c9b('0x51')]);return db[_0x8c9b('0x3c')]['find'](_0x5e1902)['then'](handleEntityNotFound(_0x5f2a73,null))[_0x8c9b('0x35')](respondWithResult(_0x5f2a73,null))[_0x8c9b('0x2b')](handleError(_0x5f2a73,null));};exports['create']=function(_0x4f3b6d,_0x4c9f84){return db[_0x8c9b('0x3c')][_0x8c9b('0x58')](_0x4f3b6d['body'],{})[_0x8c9b('0x35')](respondWithResult(_0x4c9f84,0xc9))[_0x8c9b('0x2b')](handleError(_0x4c9f84,null));};exports['update']=function(_0x40d628,_0x3e4a30){if(_0x40d628[_0x8c9b('0x59')]['id']){delete _0x40d628['body']['id'];}return db['ChatMessage'][_0x8c9b('0x5a')]({'where':{'id':_0x40d628['params']['id']}})[_0x8c9b('0x35')](handleEntityNotFound(_0x3e4a30,null))[_0x8c9b('0x35')](saveUpdates(_0x40d628[_0x8c9b('0x59')],null))[_0x8c9b('0x35')](respondWithResult(_0x3e4a30,null))[_0x8c9b('0x2b')](handleError(_0x3e4a30,null));};exports[_0x8c9b('0x36')]=function(_0x1a1663,_0x4e01f1){return db[_0x8c9b('0x3c')][_0x8c9b('0x5a')]({'where':{'id':_0x1a1663[_0x8c9b('0x57')]['id']}})['then'](handleEntityNotFound(_0x4e01f1,null))['then'](removeEntity(_0x4e01f1,null))['catch'](handleError(_0x4e01f1,null));};exports['describe']=function(_0x379ad6,_0x336846){return db[_0x8c9b('0x3c')]['describe']()[_0x8c9b('0x35')](respondWithResult(_0x336846,null))[_0x8c9b('0x2b')](handleError(_0x336846,null));};var interaction_log=require(_0x8c9b('0x13'))(_0x8c9b('0x5b'));exports[_0x8c9b('0x5c')]=function(_0x334308,_0xfb9e24,_0x93e997){var _0xf8b8da={'agent':{},'channel':_0x8c9b('0x5d')};if(_0x334308[_0x8c9b('0x59')]['id']){delete _0x334308[_0x8c9b('0x59')]['id'];}_0x334308['body'][_0x8c9b('0x5e')]=!![];_0x334308[_0x8c9b('0x59')][_0x8c9b('0x5f')]=moment()[_0x8c9b('0x60')](_0x8c9b('0x61'));_0x334308[_0x8c9b('0x59')][_0x8c9b('0x62')]=_0x334308[_0x8c9b('0x59')][_0x8c9b('0x62')]||_0x334308[_0x8c9b('0x63')]['id'];_0xf8b8da[_0x8c9b('0x64')]['id']=_0x334308[_0x8c9b('0x59')]['UserId'];return db[_0x8c9b('0x3c')]['find']({'where':{'id':_0x334308[_0x8c9b('0x57')]['id'],'UserId':null}})[_0x8c9b('0x35')](handleEntityNotFound(_0xfb9e24,null))[_0x8c9b('0x35')](saveUpdates(_0x334308[_0x8c9b('0x59')],null))[_0x8c9b('0x35')](function(_0x267abd){if(_0x267abd){_0xf8b8da['message']=_0x267abd[_0x8c9b('0x65')]({'plain':!![]});return db[_0x8c9b('0x66')]['find']({'where':{'id':_0x267abd['ChatInteractionId']}});}return null;})[_0x8c9b('0x35')](handleEntityNotFound(_0xfb9e24,null))[_0x8c9b('0x35')](function(_0xe2795d){if(_0xe2795d){return _0xe2795d[_0x8c9b('0x67')]({'UserId':_0x334308['body'][_0x8c9b('0x62')],'read1stAt':_[_0x8c9b('0x68')](_0xe2795d['read1stAt'])?moment()[_0x8c9b('0x60')](_0x8c9b('0x61')):undefined});}return null;})['then'](function(_0xcfc5ba){if(_0xcfc5ba){_0xf8b8da[_0x8c9b('0x69')]=_0xcfc5ba[_0x8c9b('0x65')]({'plain':!![]});interaction_log[_0x8c9b('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x334308['user']['id'],_0x334308[_0x8c9b('0x63')]['name'],_0x334308[_0x8c9b('0x63')][_0x8c9b('0x6a')],_0xf8b8da[_0x8c9b('0x69')]['id'],_0x334308['body']?JSON['stringify'](_0x334308['body']):_0x8c9b('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xf8b8da);}return null;})[_0x8c9b('0x35')](function(_0x59dca8){var _0x890bf6=_0x8c9b('0x6c')+_0x59dca8[_0x8c9b('0x27')][_0x8c9b('0x6d')];return db[_0x8c9b('0x6e')]['query'](_0x890bf6,{'type':db[_0x8c9b('0x6f')][_0x8c9b('0x70')][_0x8c9b('0x71')],'raw':!![]})[_0x8c9b('0x35')](function(_0x2568ec){return _0x2568ec;});})[_0x8c9b('0x35')](function(_0x3f3632){if(_0x3f3632){_0xf8b8da[_0x8c9b('0x27')][_0x8c9b('0x72')]=_0x3f3632[0x0];if(!_0x334308[_0x8c9b('0x59')][_0x8c9b('0x62')])return;return db[_0x8c9b('0x73')][_0x8c9b('0x5a')]({'where':{'id':_0x334308['body']['UserId'],'role':_0x8c9b('0x64')},'attributes':['id','name','fullname','email',_0x8c9b('0x74')],'raw':!![]});}return null;})[_0x8c9b('0x35')](function(_0x243ea5){if(!_0x243ea5)return null;_0xf8b8da['message']['agent']=_0x243ea5;return _0xf8b8da;})['then'](function(_0x4d437a){if(_0x4d437a){if(_0x334308['body'][_0x8c9b('0x75')]){_0xf8b8da[_0x8c9b('0x27')][_0x8c9b('0x76')]=util[_0x8c9b('0x60')](_0x8c9b('0x77'),_0x334308['user'][_0x8c9b('0x39')]);_0xf8b8da[_0x8c9b('0x27')][_0x8c9b('0x78')]=_0xf8b8da[_0x8c9b('0x78')];_0xf8b8da[_0x8c9b('0x27')][_0x8c9b('0x79')]=_0xf8b8da[_0x8c9b('0x78')];_0xf8b8da[_0x8c9b('0x27')][_0x8c9b('0x7a')]=_0x8c9b('0x5c');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x8c9b('0x7b'),'message':_[_0x8c9b('0x4f')](_0xf8b8da[_0x8c9b('0x27')],JSON[_0x8c9b('0x7c')](_0xf8b8da[_0x8c9b('0x69')][_0x8c9b('0x7d')]))},client9002)[_0x8c9b('0x35')](function(){return _0xf8b8da;});}return _0xf8b8da;}return null;})[_0x8c9b('0x35')](respondWithResult(_0xfb9e24,null))[_0x8c9b('0x2b')](handleError(_0xfb9e24,null));};var interaction_log=require(_0x8c9b('0x13'))(_0x8c9b('0x5b'));exports[_0x8c9b('0x34')]=function(_0x2ff995,_0x57621c,_0x710d9b){var _0x15855d={'agent':{},'channel':_0x8c9b('0x5d')};if(_0x2ff995[_0x8c9b('0x59')]['id']){delete _0x2ff995['body']['id'];}_0x2ff995[_0x8c9b('0x59')]['UserId']=_0x2ff995[_0x8c9b('0x59')][_0x8c9b('0x62')]||_0x2ff995[_0x8c9b('0x63')]['id'];_0x15855d[_0x8c9b('0x64')]['id']=_0x2ff995[_0x8c9b('0x59')]['UserId'];return db[_0x8c9b('0x3c')][_0x8c9b('0x5a')]({'where':{'id':_0x2ff995[_0x8c9b('0x57')]['id'],'UserId':null}})[_0x8c9b('0x35')](handleEntityNotFound(_0x57621c,null))[_0x8c9b('0x35')](function(_0x24f529){if(_0x24f529){_0x15855d[_0x8c9b('0x27')]=_0x24f529[_0x8c9b('0x65')]({'plain':!![]});return db[_0x8c9b('0x66')][_0x8c9b('0x5a')]({'where':{'id':_0x24f529[_0x8c9b('0x7e')]}});}return null;})[_0x8c9b('0x35')](handleEntityNotFound(_0x57621c,null))['then'](function(_0x4e2004){if(_0x4e2004){_0x15855d['interaction']=_0x4e2004[_0x8c9b('0x65')]({'plain':!![]});interaction_log[_0x8c9b('0x29')](_0x8c9b('0x7f'),_0x2ff995[_0x8c9b('0x63')]['id'],_0x2ff995[_0x8c9b('0x63')]['name'],_0x2ff995[_0x8c9b('0x63')][_0x8c9b('0x6a')],_0x15855d[_0x8c9b('0x69')]['id'],_0x2ff995[_0x8c9b('0x59')]?JSON[_0x8c9b('0x24')](_0x2ff995[_0x8c9b('0x59')]):_0x8c9b('0x6b'));return respondWithRpcPromise(_0x8c9b('0x80'),_0x8c9b('0x81'),_0x15855d);}return null;})['then'](function(_0x370521){var _0xe790da=_0x8c9b('0x6c')+_0x370521[_0x8c9b('0x27')]['ContactId'];return db[_0x8c9b('0x6e')][_0x8c9b('0x42')](_0xe790da,{'type':db['Sequelize'][_0x8c9b('0x70')][_0x8c9b('0x71')],'raw':!![]})[_0x8c9b('0x35')](function(_0x172ddc){return _0x172ddc;});})[_0x8c9b('0x35')](function(_0x41253a){if(_0x41253a){_0x15855d[_0x8c9b('0x27')][_0x8c9b('0x72')]=_0x41253a[0x0];if(!_0x2ff995[_0x8c9b('0x59')][_0x8c9b('0x62')])return;return db[_0x8c9b('0x73')][_0x8c9b('0x5a')]({'where':{'id':_0x2ff995[_0x8c9b('0x59')][_0x8c9b('0x62')],'role':_0x8c9b('0x64')},'attributes':['id','name',_0x8c9b('0x82'),_0x8c9b('0x83'),_0x8c9b('0x74')],'raw':!![]});}return null;})[_0x8c9b('0x35')](function(_0x474b0d){if(!_0x474b0d)return null;_0x15855d['message'][_0x8c9b('0x64')]=_0x474b0d;return _0x15855d;})['then'](function(_0x207b6d){if(_0x207b6d){_0x207b6d['message'][_0x8c9b('0x76')]=util[_0x8c9b('0x60')](_0x8c9b('0x77'),_0x2ff995[_0x8c9b('0x63')][_0x8c9b('0x39')]);_0x207b6d['message'][_0x8c9b('0x78')]=_0x15855d[_0x8c9b('0x78')];_0x207b6d[_0x8c9b('0x27')]['motionChannel']=_0x15855d['channel'];_0x207b6d['message'][_0x8c9b('0x7a')]='reject';respondWithRpcPromise('EventManager',_0x8c9b('0x84'),{'event':_0x8c9b('0x85'),'message':_[_0x8c9b('0x4f')](_0x15855d['message'],JSON[_0x8c9b('0x7c')](_0x15855d[_0x8c9b('0x69')]['formData']))},client9002);return _0x15855d;}return null;})[_0x8c9b('0x35')](respondWithResult(_0x57621c,null))[_0x8c9b('0x2b')](handleError(_0x57621c,null));}; \ No newline at end of file +var _0x0a85=['SELECT','interface','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','request','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','stack','name','send','map','ChatMessage','fieldName','type','key','query','keys','filters','intersection','model','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','rawAttributes','attributes','fields','includeAll','find','create','body','update','describe','../../config/logger','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','reject','user','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage'];(function(_0x4b9e80,_0x2b3179){var _0xc73b33=function(_0x256723){while(--_0x256723){_0x4b9e80['push'](_0x4b9e80['shift']());}};_0xc73b33(++_0x2b3179);}(_0x0a85,0x1a5));var _0x50a8=function(_0x4d023a,_0x565196){_0x4d023a=_0x4d023a-0x0;var _0x40156b=_0x0a85[_0x4d023a];return _0x40156b;};'use strict';var emlformat=require(_0x50a8('0x0'));var rimraf=require(_0x50a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50a8('0x2'));var rp=require(_0x50a8('0x3'));var moment=require(_0x50a8('0x4'));var BPromise=require(_0x50a8('0x5'));var Mustache=require(_0x50a8('0x6'));var util=require(_0x50a8('0x7'));var path=require('path');var sox=require(_0x50a8('0x8'));var csv=require(_0x50a8('0x9'));var ejs=require(_0x50a8('0xa'));var fs=require('fs');var fs_extra=require(_0x50a8('0xb'));var _=require(_0x50a8('0xc'));var squel=require(_0x50a8('0xd'));var crypto=require(_0x50a8('0xe'));var jsforce=require(_0x50a8('0xf'));var deskjs=require(_0x50a8('0x10'));var toCsv=require(_0x50a8('0x9'));var querystring=require(_0x50a8('0x11'));var Papa=require(_0x50a8('0x12'));var Redis=require(_0x50a8('0x13'));var authService=require(_0x50a8('0x14'));var qs=require(_0x50a8('0x15'));var as=require(_0x50a8('0x16'));var hardwareService=require(_0x50a8('0x17'));var logger=require('../../config/logger')(_0x50a8('0x18'));var utils=require(_0x50a8('0x19'));var config=require(_0x50a8('0x1a'));var licenseUtil=require(_0x50a8('0x1b'));var db=require(_0x50a8('0x1c'))['db'];config['redis']=_[_0x50a8('0x1d')](config[_0x50a8('0x1e')],{'host':_0x50a8('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50a8('0x1e')]));require('./chatMessage.socket')[_0x50a8('0x20')](socket);var jayson=require(_0x50a8('0x21'));var client=jayson[_0x50a8('0x22')][_0x50a8('0x23')]({'port':0x232c});var client9002=jayson[_0x50a8('0x22')][_0x50a8('0x23')]({'port':0x232a});function respondWithRpcPromise(_0xce4ffa,_0x47a4fa,_0x3950f0,_0x45346c){return new BPromise(function(_0x1670ea,_0x917cf5){var _0x394060=_0x45346c||client;return _0x394060[_0x50a8('0x24')](_0xce4ffa,_0x3950f0)[_0x50a8('0x25')](function(_0x200afe){logger['info']('ChatMessage,\x20%s,\x20%s',_0x47a4fa,'request\x20sent');logger[_0x50a8('0x26')](_0x50a8('0x27'),_0x47a4fa,_0x50a8('0x28'),JSON[_0x50a8('0x29')](_0x200afe));if(_0x200afe[_0x50a8('0x2a')]){if(_0x200afe[_0x50a8('0x2a')][_0x50a8('0x2b')]===0x1f4){logger[_0x50a8('0x2a')](_0x50a8('0x2c'),_0x47a4fa,_0x200afe[_0x50a8('0x2a')][_0x50a8('0x2d')]);return _0x917cf5(_0x200afe[_0x50a8('0x2a')][_0x50a8('0x2d')]);}logger['error'](_0x50a8('0x2c'),_0x47a4fa,_0x200afe['error'][_0x50a8('0x2d')]);return _0x1670ea(_0x200afe[_0x50a8('0x2a')]['message']);}else{logger[_0x50a8('0x2e')](_0x50a8('0x2c'),_0x47a4fa,_0x50a8('0x28'));_0x1670ea(_0x200afe[_0x50a8('0x2f')][_0x50a8('0x2d')]);}})['catch'](function(_0x3bb781){logger[_0x50a8('0x2a')](_0x50a8('0x2c'),_0x47a4fa,_0x3bb781);_0x917cf5(_0x3bb781);});});}function respondWithStatusCode(_0x5cae9e,_0x135195){_0x135195=_0x135195||0xcc;return function(_0x36100f){if(_0x36100f){return _0x5cae9e[_0x50a8('0x30')](_0x135195);}return _0x5cae9e[_0x50a8('0x31')](_0x135195)[_0x50a8('0x32')]();};}function respondWithResult(_0x15adcf,_0x43f7d9){_0x43f7d9=_0x43f7d9||0xc8;return function(_0x44e63a){if(_0x44e63a){return _0x15adcf[_0x50a8('0x31')](_0x43f7d9)[_0x50a8('0x33')](_0x44e63a);}};}function respondWithFilteredResult(_0x152cc2,_0x357f65){return function(_0x527be9){if(_0x527be9){var _0x263163=typeof _0x357f65[_0x50a8('0x34')]===_0x50a8('0x35')&&typeof _0x357f65[_0x50a8('0x36')]===_0x50a8('0x35');var _0x5b5048=_0x527be9[_0x50a8('0x37')];var _0x1dcbca=_0x263163?0x0:_0x357f65[_0x50a8('0x34')];var _0x373d03=_0x263163?_0x527be9['count']:_0x357f65['offset']+_0x357f65[_0x50a8('0x36')];var _0x44dac4;if(_0x373d03>=_0x5b5048){_0x373d03=_0x5b5048;_0x44dac4=0xc8;}else{_0x44dac4=0xce;}_0x152cc2[_0x50a8('0x31')](_0x44dac4);return _0x152cc2[_0x50a8('0x38')](_0x50a8('0x39'),_0x1dcbca+'-'+_0x373d03+'/'+_0x5b5048)[_0x50a8('0x33')](_0x527be9);}return null;};}function patchUpdates(_0x3bf3bc){return function(_0x5356fe){try{jsonpatch[_0x50a8('0x3a')](_0x5356fe,_0x3bf3bc,!![]);}catch(_0x1852f8){return BPromise['reject'](_0x1852f8);}return _0x5356fe[_0x50a8('0x3b')]();};}function saveUpdates(_0x20e77f,_0x53606b){return function(_0x43fbb7){if(_0x43fbb7){return _0x43fbb7['update'](_0x20e77f)['then'](function(_0x48c995){return _0x48c995;});}return null;};}function removeEntity(_0x3eb89a,_0x4bc651){return function(_0x5808ef){if(_0x5808ef){return _0x5808ef[_0x50a8('0x3c')]()[_0x50a8('0x25')](function(){_0x3eb89a[_0x50a8('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fbd91,_0x5ceeac){return function(_0x59a241){if(!_0x59a241){_0x3fbd91[_0x50a8('0x30')](0x194);}return _0x59a241;};}function handleError(_0x87366c,_0x1e4a60){_0x1e4a60=_0x1e4a60||0x1f4;return function(_0x4ecdd2){logger['error'](_0x4ecdd2[_0x50a8('0x3d')]);if(_0x4ecdd2[_0x50a8('0x3e')]){delete _0x4ecdd2[_0x50a8('0x3e')];}_0x87366c[_0x50a8('0x31')](_0x1e4a60)[_0x50a8('0x3f')](_0x4ecdd2);};}exports['index']=function(_0x5d79b2,_0x78af56){var _0x4f22e9={},_0x1d1f5c={},_0x5431c3={'count':0x0,'rows':[]};var _0x15bf0a=_[_0x50a8('0x40')](db[_0x50a8('0x41')]['rawAttributes'],function(_0x41502e){return{'name':_0x41502e[_0x50a8('0x42')],'type':_0x41502e[_0x50a8('0x43')][_0x50a8('0x44')]};});_0x1d1f5c['model']=_[_0x50a8('0x40')](_0x15bf0a,_0x50a8('0x3e'));_0x1d1f5c[_0x50a8('0x45')]=_[_0x50a8('0x46')](_0x5d79b2['query']);_0x1d1f5c[_0x50a8('0x47')]=_[_0x50a8('0x48')](_0x1d1f5c['model'],_0x1d1f5c['query']);_0x4f22e9['attributes']=_[_0x50a8('0x48')](_0x1d1f5c[_0x50a8('0x49')],qs['fields'](_0x5d79b2[_0x50a8('0x45')]['fields']));_0x4f22e9['attributes']=_0x4f22e9['attributes'][_0x50a8('0x4a')]?_0x4f22e9['attributes']:_0x1d1f5c[_0x50a8('0x49')];if(!_0x5d79b2[_0x50a8('0x45')][_0x50a8('0x4b')]('nolimit')){_0x4f22e9['limit']=qs[_0x50a8('0x36')](_0x5d79b2[_0x50a8('0x45')][_0x50a8('0x36')]);_0x4f22e9['offset']=qs[_0x50a8('0x34')](_0x5d79b2[_0x50a8('0x45')]['offset']);}_0x4f22e9[_0x50a8('0x4c')]=qs[_0x50a8('0x4d')](_0x5d79b2[_0x50a8('0x45')][_0x50a8('0x4d')]);_0x4f22e9['where']=qs['filters'](_[_0x50a8('0x4e')](_0x5d79b2[_0x50a8('0x45')],_0x1d1f5c['filters']),_0x15bf0a);if(_0x5d79b2[_0x50a8('0x45')][_0x50a8('0x4f')]){_0x4f22e9[_0x50a8('0x50')]=_['merge'](_0x4f22e9[_0x50a8('0x50')],{'$or':_['map'](_0x15bf0a,function(_0x5c747a){if(_0x5c747a[_0x50a8('0x43')]!==_0x50a8('0x51')){var _0x583dec={};_0x583dec[_0x5c747a[_0x50a8('0x3e')]]={'$like':'%'+_0x5d79b2[_0x50a8('0x45')]['filter']+'%'};return _0x583dec;}})});}_0x4f22e9=_[_0x50a8('0x52')]({},_0x4f22e9,_0x5d79b2[_0x50a8('0x53')]);var _0x3b5d54={'where':_0x4f22e9[_0x50a8('0x50')]};return db[_0x50a8('0x41')][_0x50a8('0x37')](_0x3b5d54)[_0x50a8('0x25')](function(_0xb05141){_0x5431c3[_0x50a8('0x37')]=_0xb05141;if(_0x5d79b2['query']['includeAll']){_0x4f22e9['include']=[{'all':!![]}];}return db[_0x50a8('0x41')][_0x50a8('0x54')](_0x4f22e9);})['then'](function(_0x5cd530){_0x5431c3[_0x50a8('0x55')]=_0x5cd530;return _0x5431c3;})[_0x50a8('0x25')](respondWithFilteredResult(_0x78af56,_0x4f22e9))[_0x50a8('0x56')](handleError(_0x78af56,null));};exports[_0x50a8('0x57')]=function(_0x22b294,_0x20b6bb){var _0x2b6675={'raw':!![],'where':{'id':_0x22b294[_0x50a8('0x58')]['id']}},_0x482ab7={};_0x482ab7[_0x50a8('0x49')]=_[_0x50a8('0x46')](db[_0x50a8('0x41')][_0x50a8('0x59')]);_0x482ab7[_0x50a8('0x45')]=_[_0x50a8('0x46')](_0x22b294['query']);_0x482ab7[_0x50a8('0x47')]=_[_0x50a8('0x48')](_0x482ab7[_0x50a8('0x49')],_0x482ab7['query']);_0x2b6675[_0x50a8('0x5a')]=_['intersection'](_0x482ab7[_0x50a8('0x49')],qs['fields'](_0x22b294['query'][_0x50a8('0x5b')]));_0x2b6675[_0x50a8('0x5a')]=_0x2b6675[_0x50a8('0x5a')][_0x50a8('0x4a')]?_0x2b6675['attributes']:_0x482ab7[_0x50a8('0x49')];if(_0x22b294[_0x50a8('0x45')][_0x50a8('0x5c')]){_0x2b6675['include']=[{'all':!![]}];}_0x2b6675=_[_0x50a8('0x52')]({},_0x2b6675,_0x22b294['options']);return db['ChatMessage'][_0x50a8('0x5d')](_0x2b6675)[_0x50a8('0x25')](handleEntityNotFound(_0x20b6bb,null))[_0x50a8('0x25')](respondWithResult(_0x20b6bb,null))[_0x50a8('0x56')](handleError(_0x20b6bb,null));};exports[_0x50a8('0x5e')]=function(_0x346cc0,_0xf99378){return db[_0x50a8('0x41')][_0x50a8('0x5e')](_0x346cc0[_0x50a8('0x5f')],{})[_0x50a8('0x25')](respondWithResult(_0xf99378,0xc9))['catch'](handleError(_0xf99378,null));};exports[_0x50a8('0x60')]=function(_0x48754d,_0x427fac){if(_0x48754d[_0x50a8('0x5f')]['id']){delete _0x48754d[_0x50a8('0x5f')]['id'];}return db['ChatMessage'][_0x50a8('0x5d')]({'where':{'id':_0x48754d['params']['id']}})[_0x50a8('0x25')](handleEntityNotFound(_0x427fac,null))[_0x50a8('0x25')](saveUpdates(_0x48754d[_0x50a8('0x5f')],null))[_0x50a8('0x25')](respondWithResult(_0x427fac,null))['catch'](handleError(_0x427fac,null));};exports['destroy']=function(_0x346919,_0x1e0ec7){return db[_0x50a8('0x41')][_0x50a8('0x5d')]({'where':{'id':_0x346919[_0x50a8('0x58')]['id']}})[_0x50a8('0x25')](handleEntityNotFound(_0x1e0ec7,null))['then'](removeEntity(_0x1e0ec7,null))[_0x50a8('0x56')](handleError(_0x1e0ec7,null));};exports[_0x50a8('0x61')]=function(_0x21a50b,_0x37c45e){return db['ChatMessage'][_0x50a8('0x61')]()['then'](respondWithResult(_0x37c45e,null))[_0x50a8('0x56')](handleError(_0x37c45e,null));};var interaction_log=require(_0x50a8('0x62'))('chat-interactions');exports[_0x50a8('0x63')]=function(_0x4391dd,_0x483a97,_0x144982){var _0x7a698c={'agent':{},'channel':_0x50a8('0x64')};if(_0x4391dd[_0x50a8('0x5f')]['id']){delete _0x4391dd[_0x50a8('0x5f')]['id'];}_0x4391dd[_0x50a8('0x5f')]['read']=!![];_0x4391dd[_0x50a8('0x5f')][_0x50a8('0x65')]=moment()[_0x50a8('0x66')](_0x50a8('0x67'));_0x4391dd[_0x50a8('0x5f')]['UserId']=_0x4391dd[_0x50a8('0x5f')][_0x50a8('0x68')]||_0x4391dd['user']['id'];_0x7a698c[_0x50a8('0x69')]['id']=_0x4391dd[_0x50a8('0x5f')][_0x50a8('0x68')];return db[_0x50a8('0x41')][_0x50a8('0x5d')]({'where':{'id':_0x4391dd['params']['id'],'UserId':null}})[_0x50a8('0x25')](handleEntityNotFound(_0x483a97,null))[_0x50a8('0x25')](saveUpdates(_0x4391dd[_0x50a8('0x5f')],null))['then'](function(_0x4e12d7){if(_0x4e12d7){_0x7a698c[_0x50a8('0x2d')]=_0x4e12d7[_0x50a8('0x6a')]({'plain':!![]});return db[_0x50a8('0x6b')]['find']({'where':{'id':_0x4e12d7[_0x50a8('0x6c')]}});}return null;})[_0x50a8('0x25')](handleEntityNotFound(_0x483a97,null))[_0x50a8('0x25')](function(_0x243fbf){if(_0x243fbf){return _0x243fbf[_0x50a8('0x60')]({'UserId':_0x4391dd[_0x50a8('0x5f')][_0x50a8('0x68')],'read1stAt':_[_0x50a8('0x6d')](_0x243fbf[_0x50a8('0x6e')])?moment()[_0x50a8('0x66')](_0x50a8('0x67')):undefined});}return null;})[_0x50a8('0x25')](function(_0x313208){if(_0x313208){_0x7a698c[_0x50a8('0x6f')]=_0x313208[_0x50a8('0x6a')]({'plain':!![]});interaction_log[_0x50a8('0x2e')](_0x50a8('0x70'),_0x4391dd['user']['id'],_0x4391dd['user'][_0x50a8('0x3e')],_0x4391dd['user'][_0x50a8('0x71')],_0x7a698c[_0x50a8('0x6f')]['id'],_0x4391dd[_0x50a8('0x5f')]?JSON['stringify'](_0x4391dd['body']):_0x50a8('0x72'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x7a698c);}return null;})[_0x50a8('0x25')](function(_0x3fcd69){var _0x477a66=_0x50a8('0x73')+_0x3fcd69[_0x50a8('0x2d')][_0x50a8('0x74')];return db[_0x50a8('0x75')]['query'](_0x477a66,{'type':db[_0x50a8('0x76')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x6ce645){return _0x6ce645;});})[_0x50a8('0x25')](function(_0x4fb085){if(_0x4fb085){_0x7a698c[_0x50a8('0x2d')][_0x50a8('0x77')]=_0x4fb085[0x0];if(!_0x4391dd[_0x50a8('0x5f')][_0x50a8('0x68')])return;return db[_0x50a8('0x78')][_0x50a8('0x5d')]({'where':{'id':_0x4391dd['body'][_0x50a8('0x68')],'role':'agent'},'attributes':['id',_0x50a8('0x3e'),_0x50a8('0x79'),_0x50a8('0x7a'),_0x50a8('0x7b')],'raw':!![]});}return null;})[_0x50a8('0x25')](function(_0x3d9515){if(!_0x3d9515)return null;_0x7a698c[_0x50a8('0x2d')][_0x50a8('0x69')]=_0x3d9515;return _0x7a698c;})[_0x50a8('0x25')](function(_0x135ffb){if(_0x135ffb){if(_0x4391dd[_0x50a8('0x5f')][_0x50a8('0x7c')]){_0x7a698c[_0x50a8('0x2d')]['interface']=util[_0x50a8('0x66')](_0x50a8('0x7d'),_0x4391dd['user'][_0x50a8('0x3e')]);_0x7a698c[_0x50a8('0x2d')][_0x50a8('0x7e')]=_0x7a698c[_0x50a8('0x7e')];_0x7a698c[_0x50a8('0x2d')]['motionChannel']=_0x7a698c[_0x50a8('0x7e')];_0x7a698c[_0x50a8('0x2d')][_0x50a8('0x7f')]=_0x50a8('0x63');return respondWithRpcPromise(_0x50a8('0x80'),_0x50a8('0x80'),{'event':_0x50a8('0x81'),'message':_[_0x50a8('0x52')](_0x7a698c['message'],JSON[_0x50a8('0x82')](_0x7a698c[_0x50a8('0x6f')]['formData']))},client9002)[_0x50a8('0x25')](function(){return _0x7a698c;});}return _0x7a698c;}return null;})[_0x50a8('0x25')](respondWithResult(_0x483a97,null))['catch'](handleError(_0x483a97,null));};var interaction_log=require(_0x50a8('0x62'))('chat-interactions');exports[_0x50a8('0x83')]=function(_0xd833f0,_0x401a4f,_0x3f3a5c){var _0x56fe3a={'agent':{},'channel':'chat'};if(_0xd833f0[_0x50a8('0x5f')]['id']){delete _0xd833f0[_0x50a8('0x5f')]['id'];}_0xd833f0['body']['UserId']=_0xd833f0['body']['UserId']||_0xd833f0[_0x50a8('0x84')]['id'];_0x56fe3a[_0x50a8('0x69')]['id']=_0xd833f0[_0x50a8('0x5f')][_0x50a8('0x68')];return db[_0x50a8('0x41')]['find']({'where':{'id':_0xd833f0[_0x50a8('0x58')]['id'],'UserId':null}})[_0x50a8('0x25')](handleEntityNotFound(_0x401a4f,null))[_0x50a8('0x25')](function(_0x174b8c){if(_0x174b8c){_0x56fe3a[_0x50a8('0x2d')]=_0x174b8c['get']({'plain':!![]});return db[_0x50a8('0x6b')]['find']({'where':{'id':_0x174b8c[_0x50a8('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x401a4f,null))[_0x50a8('0x25')](function(_0xb291ea){if(_0xb291ea){_0x56fe3a['interaction']=_0xb291ea[_0x50a8('0x6a')]({'plain':!![]});interaction_log['info'](_0x50a8('0x85'),_0xd833f0[_0x50a8('0x84')]['id'],_0xd833f0[_0x50a8('0x84')][_0x50a8('0x3e')],_0xd833f0[_0x50a8('0x84')][_0x50a8('0x71')],_0x56fe3a[_0x50a8('0x6f')]['id'],_0xd833f0[_0x50a8('0x5f')]?JSON[_0x50a8('0x29')](_0xd833f0[_0x50a8('0x5f')]):_0x50a8('0x72'));return respondWithRpcPromise('RejectMessage',_0x50a8('0x86'),_0x56fe3a);}return null;})['then'](function(_0x3d3e54){var _0x23d15a=_0x50a8('0x73')+_0x3d3e54[_0x50a8('0x2d')][_0x50a8('0x74')];return db[_0x50a8('0x75')][_0x50a8('0x45')](_0x23d15a,{'type':db[_0x50a8('0x76')]['QueryTypes'][_0x50a8('0x87')],'raw':!![]})[_0x50a8('0x25')](function(_0x55f1ca){return _0x55f1ca;});})[_0x50a8('0x25')](function(_0x5c4a0d){if(_0x5c4a0d){_0x56fe3a[_0x50a8('0x2d')][_0x50a8('0x77')]=_0x5c4a0d[0x0];if(!_0xd833f0[_0x50a8('0x5f')]['UserId'])return;return db[_0x50a8('0x78')][_0x50a8('0x5d')]({'where':{'id':_0xd833f0[_0x50a8('0x5f')][_0x50a8('0x68')],'role':_0x50a8('0x69')},'attributes':['id',_0x50a8('0x3e'),'fullname','email',_0x50a8('0x7b')],'raw':!![]});}return null;})['then'](function(_0x17d41d){if(!_0x17d41d)return null;_0x56fe3a[_0x50a8('0x2d')][_0x50a8('0x69')]=_0x17d41d;return _0x56fe3a;})[_0x50a8('0x25')](function(_0x20d14d){if(_0x20d14d){_0x20d14d['message'][_0x50a8('0x88')]=util[_0x50a8('0x66')](_0x50a8('0x7d'),_0xd833f0[_0x50a8('0x84')][_0x50a8('0x3e')]);_0x20d14d[_0x50a8('0x2d')][_0x50a8('0x7e')]=_0x56fe3a[_0x50a8('0x7e')];_0x20d14d[_0x50a8('0x2d')][_0x50a8('0x89')]=_0x56fe3a['channel'];_0x20d14d[_0x50a8('0x2d')]['event']=_0x50a8('0x83');respondWithRpcPromise(_0x50a8('0x80'),_0x50a8('0x80'),{'event':_0x50a8('0x8a'),'message':_[_0x50a8('0x52')](_0x56fe3a[_0x50a8('0x2d')],JSON[_0x50a8('0x82')](_0x56fe3a['interaction']['formData']))},client9002);return _0x56fe3a;}return null;})[_0x50a8('0x25')](respondWithResult(_0x401a4f,null))[_0x50a8('0x56')](handleError(_0x401a4f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0e7b5bc..b6bd570 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 _0xee86=['events','../../mysqldb','ChatMessage','setMaxListeners','update','emit','hook'];(function(_0x489b4d,_0x4ddcbe){var _0x17f1ba=function(_0x90a305){while(--_0x90a305){_0x489b4d['push'](_0x489b4d['shift']());}};_0x17f1ba(++_0x4ddcbe);}(_0xee86,0x16c));var _0x6ee8=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xee86[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x6ee8('0x0'));var ChatMessage=require(_0x6ee8('0x1'))['db'][_0x6ee8('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6ee8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ee8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59a37b){return function(_0x6938f8,_0x314577,_0x5eab4a){ChatMessageEvents['emit'](_0x59a37b+':'+_0x6938f8['id'],_0x6938f8);ChatMessageEvents[_0x6ee8('0x5')](_0x59a37b,_0x6938f8);_0x5eab4a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6ee8('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x141e=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x4a9eab,_0x544bb8){var _0x32b9ac=function(_0x504234){while(--_0x504234){_0x4a9eab['push'](_0x4a9eab['shift']());}};_0x32b9ac(++_0x544bb8);}(_0x141e,0x1b5));var _0xe141=function(_0xc48cb8,_0x20bb64){_0xc48cb8=_0xc48cb8-0x0;var _0x28690f=_0x141e[_0xc48cb8];return _0x28690f;};'use strict';var EventEmitter=require(_0xe141('0x0'));var ChatMessage=require(_0xe141('0x1'))['db'][_0xe141('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe141('0x3')](0x0);var events={'afterCreate':_0xe141('0x4'),'afterUpdate':'update','afterDestroy':_0xe141('0x5')};function emitEvent(_0x5db7bc){return function(_0x4043e9,_0x47d4aa,_0x135941){ChatMessageEvents[_0xe141('0x6')](_0x5db7bc+':'+_0x4043e9['id'],_0x4043e9);ChatMessageEvents[_0xe141('0x6')](_0x5db7bc,_0x4043e9);_0x135941(null);};}for(var e in events){if(events[_0xe141('0x7')](e)){var event=events[e];ChatMessage[_0xe141('0x8')](e,emitEvent(event));}}module[_0xe141('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 266f5ce..105b762 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 _0x181d=['UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','direction','catch','error','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','toLowerCase','out','secret','isNil'];(function(_0x458f09,_0xf2ee90){var _0x1ca565=function(_0x8ec760){while(--_0x8ec760){_0x458f09['push'](_0x458f09['shift']());}};_0x1ca565(++_0xf2ee90);}(_0x181d,0x10f));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd181('0x0'))('api');var moment=require(_0xd181('0x1'));var BPromise=require(_0xd181('0x2'));var rp=require(_0xd181('0x3'));var fs=require('fs');var path=require(_0xd181('0x4'));var rimraf=require('rimraf');var config=require(_0xd181('0x5'));var attributes=require(_0xd181('0x6'));module['exports']=function(_0x4a92e1,_0x1ceb30){return _0x4a92e1['define'](_0xd181('0x7'),attributes,{'tableName':_0xd181('0x8'),'paranoid':![],'indexes':[{'name':_0xd181('0x9'),'fields':['body'],'type':_0xd181('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x466959,_0x2c28b7,_0x74ef22){var _0x103eee=_0x4a92e1['models'];var _0x51d3ce=_0x466959['get']({'plain':!![]});if(_0x51d3ce['direction'][_0xd181('0xb')]()==='in'||_0x51d3ce['direction']['toLowerCase']()===_0xd181('0xc')&&!_0x51d3ce[_0xd181('0xd')]&&!_[_0xd181('0xe')](_0x51d3ce[_0xd181('0xf')])){_0x103eee[_0xd181('0x10')][_0xd181('0x11')]({'where':{'id':_0x51d3ce[_0xd181('0x12')]}})[_0xd181('0x13')](function(_0x399f39){if(_0x399f39){_0x399f39[_0xd181('0x14')]({'lastMsgAt':_0x51d3ce[_0xd181('0x15')],'lastMsgDirection':_0x51d3ce[_0xd181('0x16')][_0xd181('0xb')]()});}})[_0xd181('0x17')](function(_0x134045){console[_0xd181('0x18')](_0x134045);});}_0x74ef22();}},'charset':'utf8mb4','collate':_0xd181('0x19')});}; \ No newline at end of file +var _0xdb23=['request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','utf8mb4','lodash','util','api'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0xdb23,0xd5));var _0x3db2=function(_0x39be73,_0x31a022){_0x39be73=_0x39be73-0x0;var _0x14b572=_0xdb23[_0x39be73];return _0x14b572;};'use strict';var _=require(_0x3db2('0x0'));var util=require(_0x3db2('0x1'));var logger=require('../../config/logger')(_0x3db2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3db2('0x3'));var fs=require('fs');var path=require(_0x3db2('0x4'));var rimraf=require(_0x3db2('0x5'));var config=require(_0x3db2('0x6'));var attributes=require(_0x3db2('0x7'));module[_0x3db2('0x8')]=function(_0x45b43f,_0x52ba65){return _0x45b43f[_0x3db2('0x9')](_0x3db2('0xa'),attributes,{'tableName':_0x3db2('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3db2('0xc')],'type':_0x3db2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c7ded,_0x2b7d08,_0x120768){var _0xb4623e=_0x45b43f[_0x3db2('0xe')];var _0x558c79=_0x3c7ded[_0x3db2('0xf')]({'plain':!![]});if(_0x558c79[_0x3db2('0x10')][_0x3db2('0x11')]()==='in'||_0x558c79[_0x3db2('0x10')][_0x3db2('0x11')]()==='out'&&!_0x558c79[_0x3db2('0x12')]&&!_[_0x3db2('0x13')](_0x558c79[_0x3db2('0x14')])){_0xb4623e[_0x3db2('0x15')][_0x3db2('0x16')]({'where':{'id':_0x558c79[_0x3db2('0x17')]}})[_0x3db2('0x18')](function(_0xd5a909){if(_0xd5a909){_0xd5a909['update']({'lastMsgAt':_0x558c79[_0x3db2('0x19')],'lastMsgDirection':_0x558c79[_0x3db2('0x10')][_0x3db2('0x11')]()});}})['catch'](function(_0x565e94){console['error'](_0x565e94);});}_0x120768();}},'charset':_0x3db2('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 28e23b8..64f0ed8 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 _0x6673=['error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','register','request','then','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1b2232,_0x314a30){var _0x51edd5=function(_0x21bf6c){while(--_0x21bf6c){_0x1b2232['push'](_0x1b2232['shift']());}};_0x51edd5(++_0x314a30);}(_0x6673,0x1df));var _0x3667=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x6673[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x3667('0x0'));var util=require('util');var moment=require(_0x3667('0x1'));var BPromise=require('bluebird');var rs=require(_0x3667('0x2'));var fs=require('fs');var Redis=require(_0x3667('0x3'));var db=require(_0x3667('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3667('0x5'))(_0x3667('0x6'));var config=require('../../config/environment');var jayson=require(_0x3667('0x7'));var client=jayson[_0x3667('0x8')]['http']({'port':0x232a});config['redis']=_[_0x3667('0x9')](config[_0x3667('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0x3667('0xb')](socket);function respondWithRpcPromise(_0xa83336,_0x214f71,_0x5cce65){return new BPromise(function(_0x5392cf,_0x16ba0e){return client[_0x3667('0xc')](_0xa83336,_0x5cce65)[_0x3667('0xd')](function(_0x3bc19d){logger['info'](_0x3667('0xe'),_0x214f71,'request\x20sent');logger['debug'](_0x3667('0xf'),_0x214f71,_0x3667('0x10'),JSON['stringify'](_0x3bc19d));if(_0x3bc19d['error']){if(_0x3bc19d[_0x3667('0x11')][_0x3667('0x12')]===0x1f4){logger['error'](_0x3667('0xe'),_0x214f71,_0x3bc19d[_0x3667('0x11')][_0x3667('0x13')]);return _0x16ba0e(_0x3bc19d['error'][_0x3667('0x13')]);}logger[_0x3667('0x11')]('ChatMessage,\x20%s,\x20%s',_0x214f71,_0x3bc19d['error'][_0x3667('0x13')]);return _0x5392cf(_0x3bc19d['error']['message']);}else{logger[_0x3667('0x14')](_0x3667('0xe'),_0x214f71,_0x3667('0x10'));_0x5392cf(_0x3bc19d[_0x3667('0x15')][_0x3667('0x13')]);}})[_0x3667('0x16')](function(_0x1363af){logger[_0x3667('0x11')]('ChatMessage,\x20%s,\x20%s',_0x214f71,_0x1363af);_0x16ba0e(_0x1363af);});});}exports[_0x3667('0x17')]=function(_0x4544cf){var _0x5a1793=this;return new Promise(function(_0x4c949c,_0x8f53fc){return db[_0x3667('0x18')][_0x3667('0x19')](_0x4544cf[_0x3667('0x1a')],{'raw':_0x4544cf['options']?_0x4544cf[_0x3667('0x1b')][_0x3667('0x1c')]===undefined?!![]:![]:!![]})[_0x3667('0xd')](function(_0x4dd203){logger[_0x3667('0x14')](_0x3667('0x17'),_0x4544cf);logger[_0x3667('0x1d')]('CreateChatMessage',_0x4544cf,JSON[_0x3667('0x1e')](_0x4dd203));_0x4c949c(_0x4dd203);})[_0x3667('0x16')](function(_0x48b20c){logger[_0x3667('0x11')]('CreateChatMessage',_0x48b20c[_0x3667('0x13')],_0x4544cf);_0x8f53fc(_0x5a1793[_0x3667('0x11')](0x1f4,_0x48b20c[_0x3667('0x13')]));});});}; \ No newline at end of file +var _0xbf6c=['stringify','error','message','CreateChatMessage','create','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x20eb35,_0x513f00){var _0x20cab=function(_0x597a19){while(--_0x597a19){_0x20eb35['push'](_0x20eb35['shift']());}};_0x20cab(++_0x513f00);}(_0xbf6c,0x1c9));var _0xcbf6=function(_0x15b640,_0x1e7207){_0x15b640=_0x15b640-0x0;var _0x4c2e24=_0xbf6c[_0x15b640];return _0x4c2e24;};'use strict';var _=require(_0xcbf6('0x0'));var util=require(_0xcbf6('0x1'));var moment=require(_0xcbf6('0x2'));var BPromise=require(_0xcbf6('0x3'));var rs=require(_0xcbf6('0x4'));var fs=require('fs');var Redis=require(_0xcbf6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcbf6('0x6'))(_0xcbf6('0x7'));var config=require(_0xcbf6('0x8'));var jayson=require(_0xcbf6('0x9'));var client=jayson[_0xcbf6('0xa')][_0xcbf6('0xb')]({'port':0x232a});config['redis']=_[_0xcbf6('0xc')](config[_0xcbf6('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbf6('0xd')]));require(_0xcbf6('0xe'))[_0xcbf6('0xf')](socket);function respondWithRpcPromise(_0x55d399,_0x3412fc,_0x57a357){return new BPromise(function(_0x4b9fb4,_0xc6c7a0){return client[_0xcbf6('0x10')](_0x55d399,_0x57a357)[_0xcbf6('0x11')](function(_0x4740e6){logger[_0xcbf6('0x12')](_0xcbf6('0x13'),_0x3412fc,_0xcbf6('0x14'));logger[_0xcbf6('0x15')](_0xcbf6('0x16'),_0x3412fc,_0xcbf6('0x14'),JSON[_0xcbf6('0x17')](_0x4740e6));if(_0x4740e6['error']){if(_0x4740e6[_0xcbf6('0x18')]['code']===0x1f4){logger['error'](_0xcbf6('0x13'),_0x3412fc,_0x4740e6[_0xcbf6('0x18')][_0xcbf6('0x19')]);return _0xc6c7a0(_0x4740e6['error'][_0xcbf6('0x19')]);}logger[_0xcbf6('0x18')](_0xcbf6('0x13'),_0x3412fc,_0x4740e6[_0xcbf6('0x18')][_0xcbf6('0x19')]);return _0x4b9fb4(_0x4740e6[_0xcbf6('0x18')]['message']);}else{logger[_0xcbf6('0x12')](_0xcbf6('0x13'),_0x3412fc,_0xcbf6('0x14'));_0x4b9fb4(_0x4740e6['result'][_0xcbf6('0x19')]);}})['catch'](function(_0x21dcfe){logger['error'](_0xcbf6('0x13'),_0x3412fc,_0x21dcfe);_0xc6c7a0(_0x21dcfe);});});}exports[_0xcbf6('0x1a')]=function(_0x174e95){var _0x32cf80=this;return new Promise(function(_0x2d5089,_0x4ae3da){return db['ChatMessage'][_0xcbf6('0x1b')](_0x174e95['body'],{'raw':_0x174e95['options']?_0x174e95['options'][_0xcbf6('0x1c')]===undefined?!![]:![]:!![]})[_0xcbf6('0x11')](function(_0x16280e){logger[_0xcbf6('0x12')]('CreateChatMessage',_0x174e95);logger[_0xcbf6('0x15')](_0xcbf6('0x1a'),_0x174e95,JSON[_0xcbf6('0x17')](_0x16280e));_0x2d5089(_0x16280e);})[_0xcbf6('0x1d')](function(_0x4eb7d8){logger[_0xcbf6('0x18')](_0xcbf6('0x1a'),_0x4eb7d8[_0xcbf6('0x19')],_0x174e95);_0x4ae3da(_0x32cf80[_0xcbf6('0x18')](0x1f4,_0x4eb7d8['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 11917ba..5e87452 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 _0x91c6=['removeListener','register','chatMessage:','./chatMessage.events','update','emit'];(function(_0x41f519,_0x413585){var _0x26e4c9=function(_0x3306b5){while(--_0x3306b5){_0x41f519['push'](_0x41f519['shift']());}};_0x26e4c9(++_0x413585);}(_0x91c6,0xf9));var _0x691c=function(_0x18e150,_0x28e550){_0x18e150=_0x18e150-0x0;var _0x5078bb=_0x91c6[_0x18e150];return _0x5078bb;};'use strict';var ChatMessageEvents=require(_0x691c('0x0'));var events=['save','remove',_0x691c('0x1')];function createListener(_0x20c69c,_0xafe4d5){return function(_0xa59a0a){_0xafe4d5[_0x691c('0x2')](_0x20c69c,_0xa59a0a);};}function removeListener(_0x4944ce,_0xa14528){return function(){ChatMessageEvents[_0x691c('0x3')](_0x4944ce,_0xa14528);};}exports[_0x691c('0x4')]=function(_0x1b2e82){for(var _0x3dddf8=0x0,_0x29876a=events['length'];_0x3dddf8<_0x29876a;_0x3dddf8++){var _0x93b7b0=events[_0x3dddf8];var _0x40629a=createListener(_0x691c('0x5')+_0x93b7b0,_0x1b2e82);ChatMessageEvents['on'](_0x93b7b0,_0x40629a);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./chatMessage.events','remove'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4232c2,_0x4f5a1e){_0x4232c2=_0x4232c2-0x0;var _0x1470db=_0x1cb9[_0x4232c2];return _0x1470db;};'use strict';var ChatMessageEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){ChatMessageEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('chatMessage:'+_0x4c1f56,_0x186dc3);ChatMessageEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 0a77657..ce1d95e 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 _0xd651=['update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','chat','chatmessage:create','create','put'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xd651,0x157));var _0x1d65=function(_0x2e95cb,_0x3d6bb2){_0x2e95cb=_0x2e95cb-0x0;var _0x41d3c4=_0xd651[_0x2e95cb];return _0x41d3c4;};'use strict';var multer=require(_0x1d65('0x0'));var util=require(_0x1d65('0x1'));var path=require(_0x1d65('0x2'));var timeout=require(_0x1d65('0x3'));var express=require(_0x1d65('0x4'));var router=express[_0x1d65('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1d65('0x6'));var interaction=require(_0x1d65('0x7'));var config=require('../../config/environment');var controller=require(_0x1d65('0x8'));router[_0x1d65('0x9')]('/',auth['isAuthenticated'](),controller[_0x1d65('0xa')]);router[_0x1d65('0x9')](_0x1d65('0xb'),auth[_0x1d65('0xc')](),controller[_0x1d65('0xd')]);router[_0x1d65('0x9')](_0x1d65('0xe'),auth['isAuthenticated'](),controller[_0x1d65('0xf')]);router['post']('/',auth[_0x1d65('0xc')](),interaction[_0x1d65('0x10')](_0x1d65('0x11'),_0x1d65('0x12')),controller[_0x1d65('0x13')]);router[_0x1d65('0x14')](_0x1d65('0xe'),controller[_0x1d65('0x15')]);router[_0x1d65('0x14')](_0x1d65('0x16'),auth[_0x1d65('0xc')](),controller[_0x1d65('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x1d65('0x18')]);router[_0x1d65('0x19')](_0x1d65('0xe'),auth['isAuthenticated'](),controller[_0x1d65('0x1a')]);module[_0x1d65('0x1b')]=router; \ No newline at end of file +var _0x3065=['put','reject','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','update','accept'];(function(_0x58a01b,_0x5afed2){var _0x2a6c7a=function(_0x2977d8){while(--_0x2977d8){_0x58a01b['push'](_0x58a01b['shift']());}};_0x2a6c7a(++_0x5afed2);}(_0x3065,0x101));var _0x5306=function(_0x44f9b5,_0x4574b7){_0x44f9b5=_0x44f9b5-0x0;var _0x5761f7=_0x3065[_0x44f9b5];return _0x5761f7;};'use strict';var multer=require(_0x5306('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5306('0x1'));var express=require(_0x5306('0x2'));var router=express[_0x5306('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5306('0x4'));var interaction=require(_0x5306('0x5'));var config=require(_0x5306('0x6'));var controller=require('./chatMessage.controller');router[_0x5306('0x7')]('/',auth[_0x5306('0x8')](),controller['index']);router[_0x5306('0x7')](_0x5306('0x9'),auth[_0x5306('0x8')](),controller[_0x5306('0xa')]);router[_0x5306('0x7')](_0x5306('0xb'),auth[_0x5306('0x8')](),controller['show']);router[_0x5306('0xc')]('/',auth[_0x5306('0x8')](),interaction[_0x5306('0xd')](_0x5306('0xe'),_0x5306('0xf')),controller[_0x5306('0x10')]);router['put'](_0x5306('0xb'),controller[_0x5306('0x11')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x5306('0x12')]);router[_0x5306('0x13')]('/:id/reject',auth[_0x5306('0x8')](),controller[_0x5306('0x14')]);router[_0x5306('0x15')](_0x5306('0xb'),auth['isAuthenticated'](),controller[_0x5306('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 68d74e8..93181b8 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 _0x7562=['sequelize','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7562,0x1a0));var _0x2756=function(_0x4a94e0,_0x4ef47f){_0x4a94e0=_0x4a94e0-0x0;var _0x306228=_0x7562[_0x4a94e0];return _0x306228;};'use strict';var Sequelize=require(_0x2756('0x0'));module[_0x2756('0x1')]={'body':{'type':Sequelize[_0x2756('0x2')](_0x2756('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xfad0=['exports','medium'];(function(_0x10c91f,_0x1578e8){var _0x3218e0=function(_0x203479){while(--_0x203479){_0x10c91f['push'](_0x10c91f['shift']());}};_0x3218e0(++_0x1578e8);}(_0xfad0,0xb0));var _0x0fad=function(_0x5c3bfd,_0x5eeae6){_0x5c3bfd=_0x5c3bfd-0x0;var _0x24b846=_0xfad0[_0x5c3bfd];return _0x24b846;};'use strict';var Sequelize=require('sequelize');module[_0x0fad('0x0')]={'body':{'type':Sequelize['TEXT'](_0x0fad('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 6d4c7ae..df88ad1 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(_0x46a343,_0xb1d9ec){var _0x56cfcc=function(_0x5a4a07){while(--_0x5a4a07){_0x46a343['push'](_0x46a343['shift']());}};_0x56cfcc(++_0xb1d9ec);}(_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 +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(_0x184487,_0x554b84){var _0x2b2d7d=function(_0x40b865){while(--_0x40b865){_0x184487['push'](_0x184487['shift']());}};_0x2b2d7d(++_0x554b84);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index eedc992..8655da3 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 _0x938f=['bluebird','request-promise','path','rimraf','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x551f36,_0x2ea858){var _0x116708=function(_0x18498c){while(--_0x18498c){_0x551f36['push'](_0x551f36['shift']());}};_0x116708(++_0x2ea858);}(_0x938f,0x188));var _0xf938=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x938f[_0xcf4569];return _0x7fef;};'use strict';var _=require(_0xf938('0x0'));var util=require('util');var logger=require(_0xf938('0x1'))(_0xf938('0x2'));var moment=require(_0xf938('0x3'));var BPromise=require(_0xf938('0x4'));var rp=require(_0xf938('0x5'));var fs=require('fs');var path=require(_0xf938('0x6'));var rimraf=require(_0xf938('0x7'));var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x4dec18,_0x53accc){return _0x4dec18[_0xf938('0x8')](_0xf938('0x9'),attributes,{'tableName':_0xf938('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf938('0xb')});}; \ No newline at end of file +var _0x2422=['path','rimraf','../../config/environment','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x154d14,_0xf96ce){var _0x432baf=function(_0x4b826d){while(--_0x4b826d){_0x154d14['push'](_0x154d14['shift']());}};_0x432baf(++_0xf96ce);}(_0x2422,0x80));var _0x2242=function(_0x429b61,_0x4eaa94){_0x429b61=_0x429b61-0x0;var _0x40f212=_0x2422[_0x429b61];return _0x40f212;};'use strict';var _=require(_0x2242('0x0'));var util=require(_0x2242('0x1'));var logger=require(_0x2242('0x2'))(_0x2242('0x3'));var moment=require(_0x2242('0x4'));var BPromise=require(_0x2242('0x5'));var rp=require(_0x2242('0x6'));var fs=require('fs');var path=require(_0x2242('0x7'));var rimraf=require(_0x2242('0x8'));var config=require(_0x2242('0x9'));var attributes=require('./chatOfflineMessage.attributes');module[_0x2242('0xa')]=function(_0x4f76d7,_0x4ef86a){return _0x4f76d7['define'](_0x2242('0xb'),attributes,{'tableName':_0x2242('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2242('0xd'),'collate':_0x2242('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 5be157e..63b013a 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 _0x4990=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4990,0x149));var _0x0499=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x4990[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x0499('0x0'));var util=require(_0x0499('0x1'));var moment=require(_0x0499('0x2'));var BPromise=require(_0x0499('0x3'));var rs=require(_0x0499('0x4'));var fs=require('fs');var Redis=require(_0x0499('0x5'));var db=require(_0x0499('0x6'))['db'];var utils=require(_0x0499('0x7'));var logger=require(_0x0499('0x8'))(_0x0499('0x9'));var config=require(_0x0499('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0499('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7fd34f,_0x7287d0,_0x203ab9){return new BPromise(function(_0x24cccc,_0x4d1156){return client[_0x0499('0xc')](_0x7fd34f,_0x203ab9)[_0x0499('0xd')](function(_0x2bd35a){logger[_0x0499('0xe')](_0x0499('0xf'),_0x7287d0,_0x0499('0x10'));logger[_0x0499('0x11')](_0x0499('0x12'),_0x7287d0,'request\x20sent',JSON[_0x0499('0x13')](_0x2bd35a));if(_0x2bd35a['error']){if(_0x2bd35a[_0x0499('0x14')]['code']===0x1f4){logger[_0x0499('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x7287d0,_0x2bd35a[_0x0499('0x14')][_0x0499('0x15')]);return _0x4d1156(_0x2bd35a['error'][_0x0499('0x15')]);}logger[_0x0499('0x14')](_0x0499('0xf'),_0x7287d0,_0x2bd35a['error'][_0x0499('0x15')]);return _0x24cccc(_0x2bd35a['error'][_0x0499('0x15')]);}else{logger[_0x0499('0xe')](_0x0499('0xf'),_0x7287d0,'request\x20sent');_0x24cccc(_0x2bd35a[_0x0499('0x16')][_0x0499('0x15')]);}})[_0x0499('0x17')](function(_0x413c0f){logger[_0x0499('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x7287d0,_0x413c0f);_0x4d1156(_0x413c0f);});});} \ No newline at end of file +var _0xfd7b=['ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0xfd7b[_0x541ea6];return _0x3c3e84;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var moment=require(_0xbfd7('0x1'));var BPromise=require(_0xbfd7('0x2'));var rs=require(_0xbfd7('0x3'));var fs=require('fs');var Redis=require(_0xbfd7('0x4'));var db=require(_0xbfd7('0x5'))['db'];var utils=require(_0xbfd7('0x6'));var logger=require(_0xbfd7('0x7'))(_0xbfd7('0x8'));var config=require(_0xbfd7('0x9'));var jayson=require(_0xbfd7('0xa'));var client=jayson[_0xbfd7('0xb')][_0xbfd7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f3067,_0x38b1ef,_0x48f2aa){return new BPromise(function(_0x33dab1,_0x5cee3d){return client[_0xbfd7('0xd')](_0x5f3067,_0x48f2aa)[_0xbfd7('0xe')](function(_0x5a3d78){logger[_0xbfd7('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x38b1ef,_0xbfd7('0x10'));logger[_0xbfd7('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x38b1ef,'request\x20sent',JSON[_0xbfd7('0x12')](_0x5a3d78));if(_0x5a3d78[_0xbfd7('0x13')]){if(_0x5a3d78[_0xbfd7('0x13')][_0xbfd7('0x14')]===0x1f4){logger[_0xbfd7('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x38b1ef,_0x5a3d78[_0xbfd7('0x13')]['message']);return _0x5cee3d(_0x5a3d78[_0xbfd7('0x13')]['message']);}logger['error'](_0xbfd7('0x15'),_0x38b1ef,_0x5a3d78[_0xbfd7('0x13')][_0xbfd7('0x16')]);return _0x33dab1(_0x5a3d78[_0xbfd7('0x13')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x38b1ef,_0xbfd7('0x10'));_0x33dab1(_0x5a3d78[_0xbfd7('0x17')][_0xbfd7('0x16')]);}})[_0xbfd7('0x18')](function(_0x30c721){logger[_0xbfd7('0x13')](_0xbfd7('0x15'),_0x38b1ef,_0x30c721);_0x5cee3d(_0x30c721);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b869ded..0e76a7c 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 _0x5544=['index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x5544,0xd1));var _0x4554=function(_0x56cf51,_0x307b0b){_0x56cf51=_0x56cf51-0x0;var _0x3cd490=_0x5544[_0x56cf51];return _0x3cd490;};'use strict';var multer=require(_0x4554('0x0'));var util=require(_0x4554('0x1'));var path=require(_0x4554('0x2'));var timeout=require(_0x4554('0x3'));var express=require(_0x4554('0x4'));var router=express[_0x4554('0x5')]();var fs_extra=require(_0x4554('0x6'));var auth=require(_0x4554('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4554('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x4554('0x9')]('/',auth[_0x4554('0xa')](),controller[_0x4554('0xb')]);router['get'](_0x4554('0xc'),auth[_0x4554('0xa')](),controller[_0x4554('0xd')]);router[_0x4554('0x9')](_0x4554('0xe'),auth[_0x4554('0xa')](),controller[_0x4554('0xf')]);router[_0x4554('0x10')]('/',auth[_0x4554('0xa')](),controller[_0x4554('0x11')]);router[_0x4554('0x12')](_0x4554('0xe'),auth['isAuthenticated'](),controller[_0x4554('0x13')]);router[_0x4554('0x14')](_0x4554('0xe'),auth[_0x4554('0xa')](),controller['destroy']);module[_0x4554('0x15')]=router; \ No newline at end of file +var _0xe251=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x270411,_0x251347){var _0x3dec5f=function(_0x59177f){while(--_0x59177f){_0x270411['push'](_0x270411['shift']());}};_0x3dec5f(++_0x251347);}(_0xe251,0x112));var _0x1e25=function(_0x331298,_0x12341a){_0x331298=_0x331298-0x0;var _0x3824bc=_0xe251[_0x331298];return _0x3824bc;};'use strict';var multer=require(_0x1e25('0x0'));var util=require(_0x1e25('0x1'));var path=require(_0x1e25('0x2'));var timeout=require(_0x1e25('0x3'));var express=require(_0x1e25('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1e25('0x5'));var interaction=require(_0x1e25('0x6'));var config=require(_0x1e25('0x7'));var controller=require(_0x1e25('0x8'));router[_0x1e25('0x9')]('/',auth[_0x1e25('0xa')](),controller[_0x1e25('0xb')]);router[_0x1e25('0x9')](_0x1e25('0xc'),auth[_0x1e25('0xa')](),controller['describe']);router[_0x1e25('0x9')](_0x1e25('0xd'),auth[_0x1e25('0xa')](),controller[_0x1e25('0xe')]);router[_0x1e25('0xf')]('/',auth[_0x1e25('0xa')](),controller[_0x1e25('0x10')]);router[_0x1e25('0x11')](_0x1e25('0xd'),auth['isAuthenticated'](),controller[_0x1e25('0x12')]);router[_0x1e25('0x13')](_0x1e25('0xd'),auth[_0x1e25('0xa')](),controller['destroy']);module[_0x1e25('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 996eaaf..96d4556 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 _0xde13=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x4a8f29,_0x535dc8){var _0x51bb81=function(_0x41116b){while(--_0x41116b){_0x4a8f29['push'](_0x4a8f29['shift']());}};_0x51bb81(++_0x535dc8);}(_0xde13,0x157));var _0x3de1=function(_0x322d34,_0xdb62ea){_0x322d34=_0x322d34-0x0;var _0x2baffb=_0xde13[_0x322d34];return _0x2baffb;};'use strict';var Sequelize=require(_0x3de1('0x0'));module[_0x3de1('0x1')]={'name':{'type':Sequelize[_0x3de1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3de1('0x3')](_0x3de1('0x4'),_0x3de1('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x3de1('0x2')]},'timeout':{'type':Sequelize[_0x3de1('0x6')]}}; \ No newline at end of file +var _0xfcda=['ENUM','timeout','sequelize','exports','STRING'];(function(_0x19a169,_0x541988){var _0x2473f3=function(_0x3d812b){while(--_0x3d812b){_0x19a169['push'](_0x19a169['shift']());}};_0x2473f3(++_0x541988);}(_0xfcda,0x89));var _0xafcd=function(_0xc8eefa,_0x9aeaf0){_0xc8eefa=_0xc8eefa-0x0;var _0x167a81=_0xfcda[_0xc8eefa];return _0x167a81;};'use strict';var Sequelize=require(_0xafcd('0x0'));module[_0xafcd('0x1')]={'name':{'type':Sequelize[_0xafcd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xafcd('0x3')]('mouseOver',_0xafcd('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xafcd('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 6e7503f..7b88dfe 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 _0x1280=['sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x51ce95,_0x234bbe){var _0x14a697=function(_0x26896c){while(--_0x26896c){_0x51ce95['push'](_0x51ce95['shift']());}};_0x14a697(++_0x234bbe);}(_0x1280,0xba));var _0x0128=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x1280[_0x4e783c];return _0x2fbd6d;};'use strict';var emlformat=require(_0x0128('0x0'));var rimraf=require(_0x0128('0x1'));var zipdir=require(_0x0128('0x2'));var jsonpatch=require(_0x0128('0x3'));var rp=require(_0x0128('0x4'));var moment=require(_0x0128('0x5'));var BPromise=require(_0x0128('0x6'));var Mustache=require(_0x0128('0x7'));var util=require(_0x0128('0x8'));var path=require('path');var sox=require(_0x0128('0x9'));var csv=require(_0x0128('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0128('0xb'));var squel=require(_0x0128('0xc'));var crypto=require(_0x0128('0xd'));var jsforce=require(_0x0128('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var as=require(_0x0128('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0128('0x14'))(_0x0128('0x15'));var utils=require(_0x0128('0x16'));var config=require(_0x0128('0x17'));var licenseUtil=require(_0x0128('0x18'));var db=require(_0x0128('0x19'))['db'];function respondWithStatusCode(_0xa4d9af,_0x152702){_0x152702=_0x152702||0xcc;return function(_0x578f2d){if(_0x578f2d){return _0xa4d9af[_0x0128('0x1a')](_0x152702);}return _0xa4d9af['status'](_0x152702)['end']();};}function respondWithResult(_0x3ee065,_0x91d6b3){_0x91d6b3=_0x91d6b3||0xc8;return function(_0x4467ae){if(_0x4467ae){return _0x3ee065[_0x0128('0x1b')](_0x91d6b3)[_0x0128('0x1c')](_0x4467ae);}};}function respondWithFilteredResult(_0x4fd99f,_0x247f8b){return function(_0x2b4c26){if(_0x2b4c26){var _0x35106a=typeof _0x247f8b['offset']==='undefined'&&typeof _0x247f8b['limit']===_0x0128('0x1d');var _0x170fb3=_0x2b4c26[_0x0128('0x1e')];var _0x179a99=_0x35106a?0x0:_0x247f8b['offset'];var _0x50a307=_0x35106a?_0x2b4c26[_0x0128('0x1e')]:_0x247f8b[_0x0128('0x1f')]+_0x247f8b[_0x0128('0x20')];var _0x11f76e;if(_0x50a307>=_0x170fb3){_0x50a307=_0x170fb3;_0x11f76e=0xc8;}else{_0x11f76e=0xce;}_0x4fd99f['status'](_0x11f76e);return _0x4fd99f['set'](_0x0128('0x21'),_0x179a99+'-'+_0x50a307+'/'+_0x170fb3)[_0x0128('0x1c')](_0x2b4c26);}return null;};}function patchUpdates(_0x283ca2){return function(_0x2f2880){try{jsonpatch[_0x0128('0x22')](_0x2f2880,_0x283ca2,!![]);}catch(_0x5753b4){return BPromise[_0x0128('0x23')](_0x5753b4);}return _0x2f2880[_0x0128('0x24')]();};}function saveUpdates(_0x1f4391,_0x1852d1){return function(_0x1b8938){if(_0x1b8938){return _0x1b8938[_0x0128('0x25')](_0x1f4391)[_0x0128('0x26')](function(_0x75054e){return _0x75054e;});}return null;};}function removeEntity(_0x22583c,_0x5205ad){return function(_0x377dec){if(_0x377dec){return _0x377dec['destroy']()[_0x0128('0x26')](function(){_0x22583c['status'](0xcc)[_0x0128('0x27')]();});}};}function handleEntityNotFound(_0x175a21,_0x3ad8a9){return function(_0x132fa2){if(!_0x132fa2){_0x175a21[_0x0128('0x1a')](0x194);}return _0x132fa2;};}function handleError(_0x13c5ff,_0x270dc8){_0x270dc8=_0x270dc8||0x1f4;return function(_0x22fb36){logger[_0x0128('0x28')](_0x22fb36[_0x0128('0x29')]);if(_0x22fb36[_0x0128('0x2a')]){delete _0x22fb36[_0x0128('0x2a')];}_0x13c5ff['status'](_0x270dc8)[_0x0128('0x2b')](_0x22fb36);};}exports[_0x0128('0x2c')]=function(_0x197580,_0x11f7c5){var _0x4d21c7={'raw':!![],'where':{'id':_0x197580['params']['id']}},_0x3bf940={};_0x3bf940[_0x0128('0x2d')]=_[_0x0128('0x2e')](db[_0x0128('0x2f')][_0x0128('0x30')]);_0x3bf940[_0x0128('0x31')]=_[_0x0128('0x2e')](_0x197580[_0x0128('0x31')]);_0x3bf940[_0x0128('0x32')]=_['intersection'](_0x3bf940[_0x0128('0x2d')],_0x3bf940[_0x0128('0x31')]);_0x4d21c7[_0x0128('0x33')]=_[_0x0128('0x34')](_0x3bf940['model'],qs['fields'](_0x197580[_0x0128('0x31')][_0x0128('0x35')]));_0x4d21c7[_0x0128('0x33')]=_0x4d21c7[_0x0128('0x33')][_0x0128('0x36')]?_0x4d21c7[_0x0128('0x33')]:_0x3bf940[_0x0128('0x2d')];if(_0x197580[_0x0128('0x31')][_0x0128('0x37')]){_0x4d21c7[_0x0128('0x38')]=[{'all':!![]}];}_0x4d21c7=_[_0x0128('0x39')]({},_0x4d21c7,_0x197580[_0x0128('0x3a')]);return db[_0x0128('0x2f')][_0x0128('0x3b')](_0x4d21c7)['then'](handleEntityNotFound(_0x11f7c5,null))[_0x0128('0x26')](respondWithResult(_0x11f7c5,null))[_0x0128('0x3c')](handleError(_0x11f7c5,null));};exports[_0x0128('0x3d')]=function(_0x74cd52,_0xc2fe47){return db[_0x0128('0x2f')][_0x0128('0x3d')](_0x74cd52[_0x0128('0x3e')],{})[_0x0128('0x26')](respondWithResult(_0xc2fe47,0xc9))[_0x0128('0x3c')](handleError(_0xc2fe47,null));};exports[_0x0128('0x25')]=function(_0xa94d51,_0x3d8055){if(_0xa94d51[_0x0128('0x3e')]['id']){delete _0xa94d51['body']['id'];}return db[_0x0128('0x2f')][_0x0128('0x3b')]({'where':{'id':_0xa94d51[_0x0128('0x3f')]['id']}})[_0x0128('0x26')](handleEntityNotFound(_0x3d8055,null))['then'](saveUpdates(_0xa94d51[_0x0128('0x3e')],null))[_0x0128('0x26')](respondWithResult(_0x3d8055,null))[_0x0128('0x3c')](handleError(_0x3d8055,null));};exports[_0x0128('0x40')]=function(_0x3face9,_0x3aa515){return db[_0x0128('0x2f')][_0x0128('0x3b')]({'where':{'id':_0x3face9[_0x0128('0x3f')]['id']}})[_0x0128('0x26')](handleEntityNotFound(_0x3aa515,null))[_0x0128('0x26')](removeEntity(_0x3aa515,null))[_0x0128('0x3c')](handleError(_0x3aa515,null));}; \ No newline at end of file +var _0x6347=['model','keys','ChatProactiveAction','query','attributes','intersection','fields','length','include','merge','options','then','catch','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','error','name','send','show','params'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x6347,0x1c9));var _0x7634=function(_0x52cdd8,_0x4bc1fd){_0x52cdd8=_0x52cdd8-0x0;var _0x525e4c=_0x6347[_0x52cdd8];return _0x525e4c;};'use strict';var emlformat=require(_0x7634('0x0'));var rimraf=require(_0x7634('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7634('0x2'));var rp=require(_0x7634('0x3'));var moment=require(_0x7634('0x4'));var BPromise=require(_0x7634('0x5'));var Mustache=require('mustache');var util=require(_0x7634('0x6'));var path=require('path');var sox=require(_0x7634('0x7'));var csv=require(_0x7634('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7634('0x9'));var squel=require(_0x7634('0xa'));var crypto=require(_0x7634('0xb'));var jsforce=require(_0x7634('0xc'));var deskjs=require(_0x7634('0xd'));var toCsv=require(_0x7634('0x8'));var querystring=require('querystring');var Papa=require(_0x7634('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7634('0xf'));var hardwareService=require(_0x7634('0x10'));var logger=require(_0x7634('0x11'))(_0x7634('0x12'));var utils=require(_0x7634('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7634('0x14'))['db'];function respondWithStatusCode(_0x1bde2c,_0x15c1bd){_0x15c1bd=_0x15c1bd||0xcc;return function(_0x22213f){if(_0x22213f){return _0x1bde2c[_0x7634('0x15')](_0x15c1bd);}return _0x1bde2c[_0x7634('0x16')](_0x15c1bd)[_0x7634('0x17')]();};}function respondWithResult(_0x2b505a,_0x54d77b){_0x54d77b=_0x54d77b||0xc8;return function(_0x3b0fd4){if(_0x3b0fd4){return _0x2b505a[_0x7634('0x16')](_0x54d77b)[_0x7634('0x18')](_0x3b0fd4);}};}function respondWithFilteredResult(_0x20dc07,_0x47b1b7){return function(_0x1f58f7){if(_0x1f58f7){var _0x4be9c7=typeof _0x47b1b7[_0x7634('0x19')]===_0x7634('0x1a')&&typeof _0x47b1b7[_0x7634('0x1b')]===_0x7634('0x1a');var _0x5cfed7=_0x1f58f7[_0x7634('0x1c')];var _0x4832e3=_0x4be9c7?0x0:_0x47b1b7[_0x7634('0x19')];var _0x3f8074=_0x4be9c7?_0x1f58f7['count']:_0x47b1b7[_0x7634('0x19')]+_0x47b1b7[_0x7634('0x1b')];var _0x5a95e2;if(_0x3f8074>=_0x5cfed7){_0x3f8074=_0x5cfed7;_0x5a95e2=0xc8;}else{_0x5a95e2=0xce;}_0x20dc07[_0x7634('0x16')](_0x5a95e2);return _0x20dc07['set'](_0x7634('0x1d'),_0x4832e3+'-'+_0x3f8074+'/'+_0x5cfed7)['json'](_0x1f58f7);}return null;};}function patchUpdates(_0x475635){return function(_0xbe6288){try{jsonpatch[_0x7634('0x1e')](_0xbe6288,_0x475635,!![]);}catch(_0x42b977){return BPromise['reject'](_0x42b977);}return _0xbe6288[_0x7634('0x1f')]();};}function saveUpdates(_0x347a56,_0x2a2538){return function(_0x462461){if(_0x462461){return _0x462461[_0x7634('0x20')](_0x347a56)['then'](function(_0xc68369){return _0xc68369;});}return null;};}function removeEntity(_0x5d3418,_0x40e3a8){return function(_0x2ab4fc){if(_0x2ab4fc){return _0x2ab4fc['destroy']()['then'](function(){_0x5d3418['status'](0xcc)[_0x7634('0x17')]();});}};}function handleEntityNotFound(_0x512776,_0x35cbf3){return function(_0x5d0335){if(!_0x5d0335){_0x512776['sendStatus'](0x194);}return _0x5d0335;};}function handleError(_0x117e6a,_0x50a053){_0x50a053=_0x50a053||0x1f4;return function(_0x377b03){logger[_0x7634('0x21')](_0x377b03['stack']);if(_0x377b03[_0x7634('0x22')]){delete _0x377b03[_0x7634('0x22')];}_0x117e6a[_0x7634('0x16')](_0x50a053)[_0x7634('0x23')](_0x377b03);};}exports[_0x7634('0x24')]=function(_0x4df6d6,_0x13708f){var _0xb742e6={'raw':!![],'where':{'id':_0x4df6d6[_0x7634('0x25')]['id']}},_0x4c527f={};_0x4c527f[_0x7634('0x26')]=_[_0x7634('0x27')](db[_0x7634('0x28')]['rawAttributes']);_0x4c527f[_0x7634('0x29')]=_[_0x7634('0x27')](_0x4df6d6[_0x7634('0x29')]);_0x4c527f['filters']=_['intersection'](_0x4c527f[_0x7634('0x26')],_0x4c527f[_0x7634('0x29')]);_0xb742e6[_0x7634('0x2a')]=_[_0x7634('0x2b')](_0x4c527f[_0x7634('0x26')],qs[_0x7634('0x2c')](_0x4df6d6['query'][_0x7634('0x2c')]));_0xb742e6[_0x7634('0x2a')]=_0xb742e6['attributes'][_0x7634('0x2d')]?_0xb742e6['attributes']:_0x4c527f[_0x7634('0x26')];if(_0x4df6d6['query']['includeAll']){_0xb742e6[_0x7634('0x2e')]=[{'all':!![]}];}_0xb742e6=_[_0x7634('0x2f')]({},_0xb742e6,_0x4df6d6[_0x7634('0x30')]);return db['ChatProactiveAction']['find'](_0xb742e6)[_0x7634('0x31')](handleEntityNotFound(_0x13708f,null))[_0x7634('0x31')](respondWithResult(_0x13708f,null))[_0x7634('0x32')](handleError(_0x13708f,null));};exports[_0x7634('0x33')]=function(_0x568ff1,_0x3268de){return db[_0x7634('0x28')][_0x7634('0x33')](_0x568ff1[_0x7634('0x34')],{})[_0x7634('0x31')](respondWithResult(_0x3268de,0xc9))[_0x7634('0x32')](handleError(_0x3268de,null));};exports[_0x7634('0x20')]=function(_0x44c3b8,_0x1340bf){if(_0x44c3b8[_0x7634('0x34')]['id']){delete _0x44c3b8[_0x7634('0x34')]['id'];}return db['ChatProactiveAction'][_0x7634('0x35')]({'where':{'id':_0x44c3b8[_0x7634('0x25')]['id']}})['then'](handleEntityNotFound(_0x1340bf,null))[_0x7634('0x31')](saveUpdates(_0x44c3b8['body'],null))[_0x7634('0x31')](respondWithResult(_0x1340bf,null))[_0x7634('0x32')](handleError(_0x1340bf,null));};exports[_0x7634('0x36')]=function(_0x2467cf,_0x24aedc){return db['ChatProactiveAction']['find']({'where':{'id':_0x2467cf[_0x7634('0x25')]['id']}})[_0x7634('0x31')](handleEntityNotFound(_0x24aedc,null))[_0x7634('0x31')](removeEntity(_0x24aedc,null))[_0x7634('0x32')](handleError(_0x24aedc,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index eb629ea..90de5c9 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 _0xc55b=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2de1a0,_0x13714e){var _0x1f0ba3=function(_0x3301d7){while(--_0x3301d7){_0x2de1a0['push'](_0x2de1a0['shift']());}};_0x1f0ba3(++_0x13714e);}(_0xc55b,0x96));var _0xbc55=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc55b[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xbc55('0x0'));var util=require(_0xbc55('0x1'));var logger=require(_0xbc55('0x2'))(_0xbc55('0x3'));var moment=require('moment');var BPromise=require(_0xbc55('0x4'));var rp=require(_0xbc55('0x5'));var fs=require('fs');var path=require(_0xbc55('0x6'));var rimraf=require(_0xbc55('0x7'));var config=require(_0xbc55('0x8'));var attributes=require(_0xbc55('0x9'));module[_0xbc55('0xa')]=function(_0x2f7c2c,_0x3b5069){return _0x2f7c2c['define'](_0xbc55('0xb'),attributes,{'tableName':_0xbc55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8865=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x450d4e,_0xcacc3){var _0x300304=function(_0x49ab27){while(--_0x49ab27){_0x450d4e['push'](_0x450d4e['shift']());}};_0x300304(++_0xcacc3);}(_0x8865,0xe4));var _0x5886=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x8865[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x5886('0x0'));var util=require(_0x5886('0x1'));var logger=require(_0x5886('0x2'))(_0x5886('0x3'));var moment=require(_0x5886('0x4'));var BPromise=require(_0x5886('0x5'));var rp=require(_0x5886('0x6'));var fs=require('fs');var path=require(_0x5886('0x7'));var rimraf=require('rimraf');var config=require(_0x5886('0x8'));var attributes=require(_0x5886('0x9'));module[_0x5886('0xa')]=function(_0x1d88ec,_0x28a814){return _0x1d88ec[_0x5886('0xb')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','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 30995ec..6173e34 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 _0x44fa=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x57f941,_0x3f4041){var _0x321067=function(_0x13e99c){while(--_0x13e99c){_0x57f941['push'](_0x57f941['shift']());}};_0x321067(++_0x3f4041);}(_0x44fa,0xd6));var _0xa44f=function(_0x3a4b60,_0x5f97e3){_0x3a4b60=_0x3a4b60-0x0;var _0x5cb1a0=_0x44fa[_0x3a4b60];return _0x5cb1a0;};'use strict';var _=require(_0xa44f('0x0'));var util=require(_0xa44f('0x1'));var moment=require(_0xa44f('0x2'));var BPromise=require(_0xa44f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa44f('0x4'));var db=require(_0xa44f('0x5'))['db'];var utils=require(_0xa44f('0x6'));var logger=require(_0xa44f('0x7'))(_0xa44f('0x8'));var config=require('../../config/environment');var jayson=require(_0xa44f('0x9'));var client=jayson[_0xa44f('0xa')][_0xa44f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x113cd5,_0x4a591b,_0x1a6af5){return new BPromise(function(_0x559cf1,_0x4fc494){return client['request'](_0x113cd5,_0x1a6af5)[_0xa44f('0xc')](function(_0x451dad){logger[_0xa44f('0xd')](_0xa44f('0xe'),_0x4a591b,_0xa44f('0xf'));logger[_0xa44f('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4a591b,_0xa44f('0xf'),JSON[_0xa44f('0x11')](_0x451dad));if(_0x451dad[_0xa44f('0x12')]){if(_0x451dad[_0xa44f('0x12')][_0xa44f('0x13')]===0x1f4){logger[_0xa44f('0x12')](_0xa44f('0xe'),_0x4a591b,_0x451dad[_0xa44f('0x12')][_0xa44f('0x14')]);return _0x4fc494(_0x451dad[_0xa44f('0x12')][_0xa44f('0x14')]);}logger[_0xa44f('0x12')](_0xa44f('0xe'),_0x4a591b,_0x451dad[_0xa44f('0x12')]['message']);return _0x559cf1(_0x451dad['error']['message']);}else{logger[_0xa44f('0xd')](_0xa44f('0xe'),_0x4a591b,_0xa44f('0xf'));_0x559cf1(_0x451dad[_0xa44f('0x15')][_0xa44f('0x14')]);}})[_0xa44f('0x16')](function(_0xab427d){logger['error'](_0xa44f('0xe'),_0x4a591b,_0xab427d);_0x4fc494(_0xab427d);});});} \ No newline at end of file +var _0x6b68=['jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6b68,0x168));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x86b6('0x0'));var util=require('util');var moment=require(_0x86b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x86b6('0x2'));var fs=require('fs');var Redis=require(_0x86b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86b6('0x4'));var logger=require(_0x86b6('0x5'))(_0x86b6('0x6'));var config=require(_0x86b6('0x7'));var jayson=require(_0x86b6('0x8'));var client=jayson[_0x86b6('0x9')][_0x86b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13e8fd,_0x579063,_0x1a6a0b){return new BPromise(function(_0x1b1ef3,_0xf5497){return client[_0x86b6('0xb')](_0x13e8fd,_0x1a6a0b)[_0x86b6('0xc')](function(_0x364ddf){logger[_0x86b6('0xd')](_0x86b6('0xe'),_0x579063,_0x86b6('0xf'));logger[_0x86b6('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x579063,_0x86b6('0xf'),JSON[_0x86b6('0x11')](_0x364ddf));if(_0x364ddf[_0x86b6('0x12')]){if(_0x364ddf[_0x86b6('0x12')][_0x86b6('0x13')]===0x1f4){logger[_0x86b6('0x12')](_0x86b6('0xe'),_0x579063,_0x364ddf['error']['message']);return _0xf5497(_0x364ddf[_0x86b6('0x12')][_0x86b6('0x14')]);}logger[_0x86b6('0x12')](_0x86b6('0xe'),_0x579063,_0x364ddf[_0x86b6('0x12')][_0x86b6('0x14')]);return _0x1b1ef3(_0x364ddf[_0x86b6('0x12')][_0x86b6('0x14')]);}else{logger[_0x86b6('0xd')](_0x86b6('0xe'),_0x579063,_0x86b6('0xf'));_0x1b1ef3(_0x364ddf[_0x86b6('0x15')][_0x86b6('0x14')]);}})[_0x86b6('0x16')](function(_0xd8b86){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x579063,_0xd8b86);_0xf5497(_0xd8b86);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 0c881fb..f3d3dda 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 _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3bafc1,_0x15b49e){var _0x487f57=function(_0x58ecdb){while(--_0x58ecdb){_0x3bafc1['push'](_0x3bafc1['shift']());}};_0x487f57(++_0x15b49e);}(_0x6aa7,0x178));var _0x76aa=function(_0x113828,_0x377874){_0x113828=_0x113828-0x0;var _0x3a930a=_0x6aa7[_0x113828];return _0x3a930a;};'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('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router; \ No newline at end of file +var _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x26f8a8,_0x3443fa){_0x26f8a8=_0x26f8a8-0x0;var _0x1d745c=_0x8d0e[_0x26f8a8];return _0x1d745c;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 450dc09..a501b85 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 _0x1be1=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2701be,_0x25b6f6){var _0x33094d=function(_0x2f5a9f){while(--_0x2f5a9f){_0x2701be['push'](_0x2701be['shift']());}};_0x33094d(++_0x25b6f6);}(_0x1be1,0x1db));var _0x11be=function(_0x347353,_0x5c3a8e){_0x347353=_0x347353-0x0;var _0x216a46=_0x1be1[_0x347353];return _0x216a46;};'use strict';var Sequelize=require(_0x11be('0x0'));module[_0x11be('0x1')]={'name':{'type':Sequelize[_0x11be('0x2')],'unique':_0x11be('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x11be('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x11be('0x5')](_0x11be('0x6'),'beepall',_0x11be('0x7'))}}; \ No newline at end of file +var _0x80b1=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0x80b1,0x1b7));var _0x180b=function(_0x4f7912,_0x21079d){_0x4f7912=_0x4f7912-0x0;var _0x48b209=_0x80b1[_0x4f7912];return _0x48b209;};'use strict';var Sequelize=require(_0x180b('0x0'));module[_0x180b('0x1')]={'name':{'type':Sequelize[_0x180b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x180b('0x2')]},'timeout':{'type':Sequelize[_0x180b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x180b('0x4'),_0x180b('0x5'),_0x180b('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 56cc47c..1fcdde5 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 _0xe34f=['destroy','get','ChatQueues','end','sendStatus','stack','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','merge','VIRTUAL','ChatQueue','count','include','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','filter','User','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','QueryTypes','every','includes','all','union','compact','value','ids','isEmpty','emit','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','options','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','json','offset','undefined','status','set','apply','save'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xe34f,0x19e));var _0xfe34=function(_0x5df793,_0x243ddd){_0x5df793=_0x5df793-0x0;var _0x10f16e=_0xe34f[_0x5df793];return _0x10f16e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe34('0x0'));var zipdir=require(_0xfe34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe34('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfe34('0x3'));var util=require(_0xfe34('0x4'));var path=require(_0xfe34('0x5'));var sox=require(_0xfe34('0x6'));var csv=require(_0xfe34('0x7'));var ejs=require(_0xfe34('0x8'));var fs=require('fs');var fs_extra=require(_0xfe34('0x9'));var _=require(_0xfe34('0xa'));var squel=require(_0xfe34('0xb'));var crypto=require('crypto');var jsforce=require(_0xfe34('0xc'));var deskjs=require(_0xfe34('0xd'));var toCsv=require(_0xfe34('0x7'));var querystring=require(_0xfe34('0xe'));var Papa=require(_0xfe34('0xf'));var Redis=require(_0xfe34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfe34('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe34('0x12'));var logger=require('../../config/logger')(_0xfe34('0x13'));var utils=require(_0xfe34('0x14'));var config=require(_0xfe34('0x15'));var licenseUtil=require(_0xfe34('0x16'));var db=require(_0xfe34('0x17'))['db'];config['redis']=_[_0xfe34('0x18')](config[_0xfe34('0x19')],{'host':_0xfe34('0x1a'),'port':0x18eb});var socket=require(_0xfe34('0x1b'))(new Redis(config[_0xfe34('0x19')]));require(_0xfe34('0x1c'))[_0xfe34('0x1d')](socket);var jayson=require(_0xfe34('0x1e'));var client=jayson['client'][_0xfe34('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4aa71e,_0x19f9cc,_0x3907cd,_0x3390ad){return new BPromise(function(_0x487916,_0x35b4f6){var _0x43c73f=_0x3390ad||client;return _0x43c73f[_0xfe34('0x20')](_0x4aa71e,_0x3907cd)[_0xfe34('0x21')](function(_0x5aaa05){logger['info'](_0xfe34('0x22'),_0x19f9cc,_0xfe34('0x23'));logger[_0xfe34('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x19f9cc,_0xfe34('0x23'),JSON[_0xfe34('0x25')](_0x5aaa05));if(_0x5aaa05[_0xfe34('0x26')]){if(_0x5aaa05[_0xfe34('0x26')][_0xfe34('0x27')]===0x1f4){logger[_0xfe34('0x26')]('ChatQueue,\x20%s,\x20%s',_0x19f9cc,_0x5aaa05[_0xfe34('0x26')]['message']);return _0x35b4f6(_0x5aaa05[_0xfe34('0x26')][_0xfe34('0x28')]);}logger[_0xfe34('0x26')]('ChatQueue,\x20%s,\x20%s',_0x19f9cc,_0x5aaa05['error'][_0xfe34('0x28')]);return _0x487916(_0x5aaa05[_0xfe34('0x26')][_0xfe34('0x28')]);}else{logger[_0xfe34('0x29')](_0xfe34('0x22'),_0x19f9cc,_0xfe34('0x23'));_0x487916(_0x5aaa05[_0xfe34('0x2a')]['message']);}})[_0xfe34('0x2b')](function(_0x40e9c8){logger[_0xfe34('0x26')](_0xfe34('0x22'),_0x19f9cc,_0x40e9c8);_0x35b4f6(_0x40e9c8);});});}function respondWithStatusCode(_0x2cf851,_0x45b2c9){_0x45b2c9=_0x45b2c9||0xcc;return function(_0x161e6e){if(_0x161e6e){return _0x2cf851['sendStatus'](_0x45b2c9);}return _0x2cf851['status'](_0x45b2c9)['end']();};}function respondWithResult(_0x116911,_0xe3cf13){_0xe3cf13=_0xe3cf13||0xc8;return function(_0x1e8704){if(_0x1e8704){return _0x116911['status'](_0xe3cf13)[_0xfe34('0x2c')](_0x1e8704);}};}function respondWithFilteredResult(_0x4f111e,_0x51bd3d){return function(_0x414cdb){if(_0x414cdb){var _0x2cb37d=typeof _0x51bd3d[_0xfe34('0x2d')]===_0xfe34('0x2e')&&typeof _0x51bd3d['limit']===_0xfe34('0x2e');var _0x57568e=_0x414cdb['count'];var _0x3da0ad=_0x2cb37d?0x0:_0x51bd3d[_0xfe34('0x2d')];var _0x224893=_0x2cb37d?_0x414cdb['count']:_0x51bd3d[_0xfe34('0x2d')]+_0x51bd3d['limit'];var _0x325dd0;if(_0x224893>=_0x57568e){_0x224893=_0x57568e;_0x325dd0=0xc8;}else{_0x325dd0=0xce;}_0x4f111e[_0xfe34('0x2f')](_0x325dd0);return _0x4f111e[_0xfe34('0x30')]('Content-Range',_0x3da0ad+'-'+_0x224893+'/'+_0x57568e)[_0xfe34('0x2c')](_0x414cdb);}return null;};}function patchUpdates(_0x5165a3){return function(_0x4336f5){try{jsonpatch[_0xfe34('0x31')](_0x4336f5,_0x5165a3,!![]);}catch(_0x5f0dd0){return BPromise['reject'](_0x5f0dd0);}return _0x4336f5[_0xfe34('0x32')]();};}function saveUpdates(_0xe8a114,_0x44fb0f){return function(_0x2d273e){if(_0x2d273e){return _0x2d273e['update'](_0xe8a114)[_0xfe34('0x21')](function(_0x26f8c0){return _0x26f8c0;});}return null;};}function removeEntity(_0x3473ae,_0x118c94){return function(_0x4b9430){if(_0x4b9430){return _0x4b9430[_0xfe34('0x33')]()[_0xfe34('0x21')](function(){var _0xfac80c=_0x4b9430[_0xfe34('0x34')]({'plain':!![]});var _0x382efb=_0xfe34('0x35');return db['UserProfileResource'][_0xfe34('0x33')]({'where':{'type':_0x382efb,'resourceId':_0xfac80c['id']}})[_0xfe34('0x21')](function(){return _0x4b9430;});})[_0xfe34('0x21')](function(){_0x3473ae['status'](0xcc)[_0xfe34('0x36')]();});}};}function handleEntityNotFound(_0x32ce0d,_0x4bf347){return function(_0x152df1){if(!_0x152df1){_0x32ce0d[_0xfe34('0x37')](0x194);}return _0x152df1;};}function handleError(_0x3fbc5a,_0x3970af){_0x3970af=_0x3970af||0x1f4;return function(_0x48466b){logger[_0xfe34('0x26')](_0x48466b[_0xfe34('0x38')]);if(_0x48466b['name']){delete _0x48466b[_0xfe34('0x39')];}_0x3fbc5a[_0xfe34('0x2f')](_0x3970af)[_0xfe34('0x3a')](_0x48466b);};}exports[_0xfe34('0x3b')]=function(_0x1ab610,_0x5ad626){var _0x3fc939={},_0x48bf70={},_0x4e3e4d={'count':0x0,'rows':[]};var _0x576276=_[_0xfe34('0x3c')](db['ChatQueue']['rawAttributes'],function(_0xf204d6){return{'name':_0xf204d6[_0xfe34('0x3d')],'type':_0xf204d6[_0xfe34('0x3e')]['key']};});_0x48bf70[_0xfe34('0x3f')]=_['map'](_0x576276,_0xfe34('0x39'));_0x48bf70['query']=_[_0xfe34('0x40')](_0x1ab610[_0xfe34('0x41')]);_0x48bf70[_0xfe34('0x42')]=_[_0xfe34('0x43')](_0x48bf70['model'],_0x48bf70[_0xfe34('0x41')]);_0x3fc939['attributes']=_[_0xfe34('0x43')](_0x48bf70[_0xfe34('0x3f')],qs['fields'](_0x1ab610['query'][_0xfe34('0x44')]));_0x3fc939[_0xfe34('0x45')]=_0x3fc939[_0xfe34('0x45')][_0xfe34('0x46')]?_0x3fc939[_0xfe34('0x45')]:_0x48bf70['model'];if(!_0x1ab610[_0xfe34('0x41')]['hasOwnProperty'](_0xfe34('0x47'))){_0x3fc939['limit']=qs[_0xfe34('0x48')](_0x1ab610[_0xfe34('0x41')][_0xfe34('0x48')]);_0x3fc939[_0xfe34('0x2d')]=qs[_0xfe34('0x2d')](_0x1ab610['query'][_0xfe34('0x2d')]);}_0x3fc939[_0xfe34('0x49')]=qs[_0xfe34('0x4a')](_0x1ab610[_0xfe34('0x41')]['sort']);_0x3fc939[_0xfe34('0x4b')]=qs['filters'](_['pick'](_0x1ab610['query'],_0x48bf70['filters']),_0x576276);if(_0x1ab610['query']['filter']){_0x3fc939['where']=_[_0xfe34('0x4c')](_0x3fc939[_0xfe34('0x4b')],{'$or':_[_0xfe34('0x3c')](_0x576276,function(_0x10e831){if(_0x10e831[_0xfe34('0x3e')]!==_0xfe34('0x4d')){var _0x92a4aa={};_0x92a4aa[_0x10e831[_0xfe34('0x39')]]={'$like':'%'+_0x1ab610[_0xfe34('0x41')]['filter']+'%'};return _0x92a4aa;}})});}_0x3fc939=_['merge']({},_0x3fc939,_0x1ab610['options']);var _0x3e7d67={'where':_0x3fc939[_0xfe34('0x4b')]};return db[_0xfe34('0x4e')][_0xfe34('0x4f')](_0x3e7d67)[_0xfe34('0x21')](function(_0x2e7a10){_0x4e3e4d[_0xfe34('0x4f')]=_0x2e7a10;if(_0x1ab610['query']['includeAll']){_0x3fc939[_0xfe34('0x50')]=[{'all':!![]}];}return db[_0xfe34('0x4e')]['findAll'](_0x3fc939);})[_0xfe34('0x21')](function(_0x53a688){_0x4e3e4d['rows']=_0x53a688;return _0x4e3e4d;})[_0xfe34('0x21')](respondWithFilteredResult(_0x5ad626,_0x3fc939))['catch'](handleError(_0x5ad626,null));};exports[_0xfe34('0x51')]=function(_0x28a3fd,_0x47f395){var _0x2cf0ce={'raw':!![],'where':{'id':_0x28a3fd[_0xfe34('0x52')]['id']}},_0x59128a={};_0x59128a['model']=_[_0xfe34('0x40')](db[_0xfe34('0x4e')][_0xfe34('0x53')]);_0x59128a[_0xfe34('0x41')]=_[_0xfe34('0x40')](_0x28a3fd[_0xfe34('0x41')]);_0x59128a[_0xfe34('0x42')]=_[_0xfe34('0x43')](_0x59128a[_0xfe34('0x3f')],_0x59128a[_0xfe34('0x41')]);_0x2cf0ce[_0xfe34('0x45')]=_[_0xfe34('0x43')](_0x59128a[_0xfe34('0x3f')],qs[_0xfe34('0x44')](_0x28a3fd[_0xfe34('0x41')][_0xfe34('0x44')]));_0x2cf0ce[_0xfe34('0x45')]=_0x2cf0ce[_0xfe34('0x45')][_0xfe34('0x46')]?_0x2cf0ce[_0xfe34('0x45')]:_0x59128a['model'];if(_0x28a3fd[_0xfe34('0x41')]['includeAll']){_0x2cf0ce[_0xfe34('0x50')]=[{'all':!![]}];}_0x2cf0ce=_[_0xfe34('0x4c')]({},_0x2cf0ce,_0x28a3fd['options']);return db[_0xfe34('0x4e')]['find'](_0x2cf0ce)[_0xfe34('0x21')](handleEntityNotFound(_0x47f395,null))[_0xfe34('0x21')](respondWithResult(_0x47f395,null))['catch'](handleError(_0x47f395,null));};exports[_0xfe34('0x54')]=function(_0x47c42b,_0x55b11a){return db[_0xfe34('0x4e')][_0xfe34('0x54')](_0x47c42b['body'],{})[_0xfe34('0x21')](function(_0x3716d7){var _0x2a523b=_0x47c42b[_0xfe34('0x55')][_0xfe34('0x34')]({'plain':!![]});if(!_0x2a523b)throw new Error(_0xfe34('0x56'));if(_0x2a523b[_0xfe34('0x57')]==='user'){var _0x218c01=_0x3716d7[_0xfe34('0x34')]({'plain':!![]});var _0x1bec63='ChatQueues';return db[_0xfe34('0x58')][_0xfe34('0x59')]({'where':{'name':_0x1bec63,'userProfileId':_0x2a523b['userProfileId']},'raw':!![]})[_0xfe34('0x21')](function(_0x457dc8){if(_0x457dc8&&_0x457dc8[_0xfe34('0x5a')]===0x0){return db[_0xfe34('0x5b')]['create']({'name':_0x218c01[_0xfe34('0x39')],'resourceId':_0x218c01['id'],'type':_0x457dc8['name'],'sectionId':_0x457dc8['id']},{})[_0xfe34('0x21')](function(){return _0x3716d7;});}else{return _0x3716d7;}})[_0xfe34('0x2b')](function(_0x33a8c8){logger['error'](_0xfe34('0x5c'),_0x33a8c8);throw _0x33a8c8;});}return _0x3716d7;})['then'](respondWithResult(_0x55b11a,0xc9))[_0xfe34('0x2b')](handleError(_0x55b11a,null));};exports[_0xfe34('0x5d')]=function(_0x10ee49,_0x2d835c){if(_0x10ee49[_0xfe34('0x5e')]['id']){delete _0x10ee49[_0xfe34('0x5e')]['id'];}return db[_0xfe34('0x4e')][_0xfe34('0x59')]({'where':{'id':_0x10ee49[_0xfe34('0x52')]['id']}})[_0xfe34('0x21')](handleEntityNotFound(_0x2d835c,null))[_0xfe34('0x21')](saveUpdates(_0x10ee49[_0xfe34('0x5e')],null))['then'](respondWithResult(_0x2d835c,null))[_0xfe34('0x2b')](handleError(_0x2d835c,null));};exports[_0xfe34('0x33')]=function(_0x1ae5cb,_0xa73b59){return db['ChatQueue'][_0xfe34('0x59')]({'where':{'id':_0x1ae5cb['params']['id']}})[_0xfe34('0x21')](handleEntityNotFound(_0xa73b59,null))[_0xfe34('0x21')](removeEntity(_0xa73b59,null))[_0xfe34('0x2b')](handleError(_0xa73b59,null));};exports[_0xfe34('0x5f')]=function(_0x3784a9,_0xdb585c){return db[_0xfe34('0x4e')][_0xfe34('0x5f')]()[_0xfe34('0x21')](respondWithResult(_0xdb585c,null))[_0xfe34('0x2b')](handleError(_0xdb585c,null));};exports[_0xfe34('0x60')]=function(_0x3d315f,_0x201aca,_0x91d950){var _0x3b378d={'raw':!![],'where':{}},_0x453e72={},_0x2af2ea;return db['ChatQueue'][_0xfe34('0x61')]({'where':{'id':_0x3d315f['params']['id']}})[_0xfe34('0x21')](handleEntityNotFound(_0x201aca,null))[_0xfe34('0x21')](function(_0x384550){if(_0x384550){_0x2af2ea=_0x384550['get']({'plain':!![]});_0x453e72[_0xfe34('0x3f')]=_[_0xfe34('0x40')](db[_0xfe34('0x62')]['rawAttributes']);_0x453e72['query']=_[_0xfe34('0x40')](_0x3d315f['query']);_0x453e72['filters']=_['intersection'](_0x453e72['model'],_0x453e72[_0xfe34('0x41')]);_0x3b378d[_0xfe34('0x45')]=_[_0xfe34('0x43')](_0x453e72[_0xfe34('0x3f')],qs[_0xfe34('0x44')](_0x3d315f[_0xfe34('0x41')][_0xfe34('0x44')]));_0x3b378d[_0xfe34('0x45')]=_0x3b378d[_0xfe34('0x45')][_0xfe34('0x46')]?_0x3b378d['attributes']:_0x453e72['model'];if(!_0x3d315f[_0xfe34('0x41')]['hasOwnProperty'](_0xfe34('0x47'))){_0x3b378d[_0xfe34('0x48')]=qs['limit'](_0x3d315f[_0xfe34('0x41')][_0xfe34('0x48')]);_0x3b378d[_0xfe34('0x2d')]=qs[_0xfe34('0x2d')](_0x3d315f[_0xfe34('0x41')][_0xfe34('0x2d')]);}_0x3b378d[_0xfe34('0x49')]=qs['sort'](_0x3d315f['query']['sort']);_0x3b378d[_0xfe34('0x4b')]=qs[_0xfe34('0x42')](_[_0xfe34('0x63')](_0x3d315f[_0xfe34('0x41')],_0x453e72[_0xfe34('0x42')]));_0x3b378d[_0xfe34('0x4b')][_0xfe34('0x64')]=_0x384550['id'];if(_0x3d315f[_0xfe34('0x41')][_0xfe34('0x65')]){_0x3b378d[_0xfe34('0x4b')]=_[_0xfe34('0x4c')](_0x3b378d[_0xfe34('0x4b')],{'$or':_[_0xfe34('0x3c')](_0x3b378d[_0xfe34('0x45')],function(_0x5ebf9b){var _0x8d5a5b={};_0x8d5a5b[_0x5ebf9b]={'$like':'%'+_0x3d315f[_0xfe34('0x41')][_0xfe34('0x65')]+'%'};return _0x8d5a5b;})});}_0x3b378d=_['merge']({},_0x3b378d,_0x3d315f['options']);return db[_0xfe34('0x62')]['findAll'](_0x3b378d);}})[_0xfe34('0x21')](function(_0xa80160){if(_0xa80160){return db[_0xfe34('0x66')]['findAndCountAll']({'where':{'id':_[_0xfe34('0x3c')](_0xa80160,_0xfe34('0x67')),'role':_0xfe34('0x68')},'attributes':['id',_0xfe34('0x39'),_0xfe34('0x69'),_0xfe34('0x6a'),_0xfe34('0x6b')]});}})[_0xfe34('0x21')](function(_0x1180ad){if(_0x1180ad){return{'count':_0x1180ad[_0xfe34('0x4f')],'rows':_['map'](_0x1180ad[_0xfe34('0x6c')],function(_0x586858){return{'membername':_0x586858['name'],'UserId':_0x586858['id'],'queue_name':_0x2af2ea[_0xfe34('0x39')],'ChatQueueId':_0x2af2ea['id'],'interface':util[_0xfe34('0x6d')](_0xfe34('0x6e'),_0xfe34('0x6f'),_0x586858['name']),'penalty':0x0,'paused':_0x586858['chatPause'],'createdAt':_0x586858[_0xfe34('0x6b')],'updatedAt':_0x586858['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xfe34('0x21')](respondWithFilteredResult(_0x201aca,_0x3b378d))[_0xfe34('0x2b')](handleError(_0x201aca,null));};exports[_0xfe34('0x70')]=function(_0x1914c3,_0x374a84,_0x308ca9){var _0x42e6f1={};var _0x54aeb4={};var _0x4eb3b0;var _0x382045;return db[_0xfe34('0x4e')]['findOne']({'where':{'id':_0x1914c3[_0xfe34('0x52')]['id']}})[_0xfe34('0x21')](handleEntityNotFound(_0x374a84,null))[_0xfe34('0x21')](function(_0xe6ef3f){if(_0xe6ef3f){_0x4eb3b0=_0xe6ef3f;_0x54aeb4['model']=_['keys'](db[_0xfe34('0x71')][_0xfe34('0x53')]);_0x54aeb4[_0xfe34('0x41')]=_[_0xfe34('0x40')](_0x1914c3['query']);_0x54aeb4[_0xfe34('0x42')]=_['intersection'](_0x54aeb4[_0xfe34('0x3f')],_0x54aeb4[_0xfe34('0x41')]);_0x42e6f1[_0xfe34('0x45')]=_[_0xfe34('0x43')](_0x54aeb4[_0xfe34('0x3f')],qs['fields'](_0x1914c3[_0xfe34('0x41')][_0xfe34('0x44')]));_0x42e6f1[_0xfe34('0x45')]=_0x42e6f1['attributes']['length']?_0x42e6f1[_0xfe34('0x45')]:_0x54aeb4[_0xfe34('0x3f')];_0x42e6f1[_0xfe34('0x49')]=qs[_0xfe34('0x4a')](_0x1914c3[_0xfe34('0x41')][_0xfe34('0x4a')]);_0x42e6f1[_0xfe34('0x4b')]=qs[_0xfe34('0x42')](_[_0xfe34('0x63')](_0x1914c3['query'],_0x54aeb4[_0xfe34('0x42')]));if(_0x1914c3[_0xfe34('0x41')][_0xfe34('0x65')]){_0x42e6f1[_0xfe34('0x4b')]=_[_0xfe34('0x4c')](_0x42e6f1[_0xfe34('0x4b')],{'$or':_[_0xfe34('0x3c')](_0x42e6f1['attributes'],function(_0x2f00de){var _0x3495fc={};_0x3495fc[_0x2f00de]={'$like':'%'+_0x1914c3['query'][_0xfe34('0x65')]+'%'};return _0x3495fc;})});}_0x42e6f1=_[_0xfe34('0x4c')]({},_0x42e6f1,_0x1914c3['options']);return _0x4eb3b0[_0xfe34('0x70')](_0x42e6f1);}})[_0xfe34('0x21')](function(_0x2e8c81){if(_0x2e8c81){_0x382045=_0x2e8c81[_0xfe34('0x46')];if(!_0x1914c3[_0xfe34('0x41')][_0xfe34('0x72')](_0xfe34('0x47'))){_0x42e6f1['limit']=qs[_0xfe34('0x48')](_0x1914c3[_0xfe34('0x41')][_0xfe34('0x48')]);_0x42e6f1[_0xfe34('0x2d')]=qs[_0xfe34('0x2d')](_0x1914c3[_0xfe34('0x41')][_0xfe34('0x2d')]);}return _0x4eb3b0[_0xfe34('0x70')](_0x42e6f1);}})[_0xfe34('0x21')](function(_0x1e8e40){if(_0x1e8e40){return _0x1e8e40?{'count':_0x382045,'rows':_0x1e8e40}:null;}})['then'](respondWithResult(_0x374a84,null))[_0xfe34('0x2b')](handleError(_0x374a84,null));};exports[_0xfe34('0x73')]=function(_0x3f488e,_0x1ae970,_0xa6687d){var _0x510a90=_0x3f488e['body']['ids'];return db['Team'][_0xfe34('0x74')]({'where':{'id':_0x510a90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfe34('0x75'),'attributes':['id',_0xfe34('0x39'),_0xfe34('0x76'),_0xfe34('0x77'),_0xfe34('0x78')],'raw':!![]}]})[_0xfe34('0x21')](function(_0xfd59f5){if(_0xfd59f5){var _0x416b7e=_[_0xfe34('0x79')](_0xfd59f5,function(_0x2f8d51){var _0x5b28fb=_0x2f8d51[_0xfe34('0x34')]({'plain':!![]});return _0x5b28fb[_0xfe34('0x75')];});return db[_0xfe34('0x4e')][_0xfe34('0x59')]({'where':{'id':_0x3f488e[_0xfe34('0x52')]['id']}})[_0xfe34('0x21')](function(_0x230d4e){return db[_0xfe34('0x7a')][_0xfe34('0x7b')](function(_0x382f33){return _0x230d4e[_0xfe34('0x73')](_0x510a90,{'transaction':_0x382f33})[_0xfe34('0x21')](function(){return BPromise['each'](_0x416b7e,function(_0x57b856){return db[_0xfe34('0x62')]['findOrCreate']({'where':{'UserId':_0x57b856['id'],'ChatQueueId':_0x3f488e['params']['id']},'transaction':_0x382f33});});})[_0xfe34('0x21')](function(){_0x416b7e[_0xfe34('0x7c')](function(_0x2591ab){socket['emit'](_0xfe34('0x7d'),{'UserId':_0x2591ab['id'],'ChatQueueId':_0x230d4e['id']});});});});});}})[_0xfe34('0x21')](respondWithStatusCode(_0x1ae970,null))[_0xfe34('0x2b')](handleError(_0x1ae970,null));};exports[_0xfe34('0x7e')]=function(_0x22865c,_0x289154,_0x333253){return db[_0xfe34('0x71')]['findAll']({'where':{'id':_0x22865c[_0xfe34('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfe34('0x66')],'as':_0xfe34('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x289154,null))[_0xfe34('0x21')](function(_0x225141){var _0x32faeb=_['map'](_0x225141,'id');var _0x3729c8=[];var _0xff4baa=[];var _0x369fc6=squel[_0xfe34('0x7f')]();_0x369fc6[_0xfe34('0x80')](_0xfe34('0x81'))[_0xfe34('0x82')](_0xfe34('0x83'),'tq')[_0xfe34('0x84')](_0xfe34('0x85'),'ut',_0xfe34('0x86'))[_0xfe34('0x4b')](_0xfe34('0x87'),_0x22865c[_0xfe34('0x52')]['id']);for(var _0x4803fd=0x0;_0x4803fd<_0x225141[_0xfe34('0x46')];_0x4803fd+=0x1){let _0x5d380c=_0x225141[_0x4803fd];for(var _0x54fcda=0x0;_0x54fcda<_0x5d380c[_0xfe34('0x75')][_0xfe34('0x46')];_0x54fcda+=0x1){let _0xe5a936=_0x5d380c[_0xfe34('0x75')][_0x54fcda];var _0x304e40=_0x369fc6[_0xfe34('0x88')]();_0x304e40['where']('ut.UserId\x20=\x20?',_0xe5a936['id']);_0xff4baa[_0xfe34('0x89')](db[_0xfe34('0x7a')][_0xfe34('0x41')](_0x304e40['toString'](),{'type':db[_0xfe34('0x7a')][_0xfe34('0x8a')]['SELECT']})['then'](function(_0x4302bf){if(_0x4302bf[_0xfe34('0x46')]===0x1){return _0xe5a936['id'];}else{var _0x23c369=_[_0xfe34('0x8b')](_[_0xfe34('0x3c')](_0x4302bf,'TeamId'),function(_0x4a8c84){return _[_0xfe34('0x8c')](_0x32faeb,_0x4a8c84);});if(_0x23c369){return _0xe5a936['id'];}}}));}}return BPromise[_0xfe34('0x8d')](_0xff4baa)['then'](function(_0x1fc900){_0x3729c8=_(_0x3729c8)[_0xfe34('0x8e')](_0x1fc900)[_0xfe34('0x8f')]()[_0xfe34('0x90')]();return db[_0xfe34('0x4e')][_0xfe34('0x59')]({'where':{'id':_0x22865c[_0xfe34('0x52')]['id']}})[_0xfe34('0x21')](function(_0x2fdfde){return db[_0xfe34('0x7a')]['transaction'](function(_0x31ec01){return _0x2fdfde[_0xfe34('0x7e')](_0x22865c[_0xfe34('0x41')][_0xfe34('0x91')],{'transaction':_0x31ec01})[_0xfe34('0x21')](function(){if(!_[_0xfe34('0x92')](_0x3729c8)){return _0x2fdfde['removeAgents'](_0x3729c8,{'transaction':_0x31ec01});}})[_0xfe34('0x21')](function(){_0x3729c8[_0xfe34('0x7c')](function(_0x205126){socket[_0xfe34('0x93')](_0xfe34('0x94'),{'UserId':_0x205126,'ChatQueueId':_0x2fdfde['id']});});});});});});})['then'](respondWithStatusCode(_0x289154,null))[_0xfe34('0x2b')](handleError(_0x289154,null));};exports[_0xfe34('0x95')]=function(_0xdf66c,_0x5d2e58,_0x3c049a){return db[_0xfe34('0x4e')][_0xfe34('0x59')]({'where':{'id':_0xdf66c[_0xfe34('0x52')]['id']}})[_0xfe34('0x21')](handleEntityNotFound(_0x5d2e58,null))['then'](function(_0x5645d8){if(_0x5645d8){return _0x5645d8[_0xfe34('0x95')](_0xdf66c['body'][_0xfe34('0x91')],_[_0xfe34('0x96')](_0xdf66c[_0xfe34('0x5e')],[_0xfe34('0x91'),'id'])||{})['spread'](function(_0x5bc0c3){for(var _0xf5ccc5=0x0;_0xf5ccc5<_0xdf66c[_0xfe34('0x5e')]['ids']['length'];_0xf5ccc5+=0x1){socket[_0xfe34('0x93')](_0xfe34('0x7d'),{'UserId':Number(_0xdf66c[_0xfe34('0x5e')][_0xfe34('0x91')][_0xf5ccc5]),'ChatQueueId':Number(_0xdf66c[_0xfe34('0x52')]['id'])});}return _0x5bc0c3;});}})['then'](respondWithResult(_0x5d2e58,null))[_0xfe34('0x2b')](handleError(_0x5d2e58,null));};exports[_0xfe34('0x97')]=function(_0x397e9c,_0x3e2778,_0x5e76b8){return db[_0xfe34('0x4e')][_0xfe34('0x59')]({'where':{'id':_0x397e9c[_0xfe34('0x52')]['id']}})['then'](handleEntityNotFound(_0x3e2778,null))[_0xfe34('0x21')](function(_0x207fbf){if(_0x207fbf){return _0x207fbf[_0xfe34('0x97')](_0x397e9c['query'][_0xfe34('0x91')])['then'](function(){if(_[_0xfe34('0x98')](_0x397e9c[_0xfe34('0x41')][_0xfe34('0x91')])){for(var _0x1c59cc=0x0;_0x1c59cc<_0x397e9c[_0xfe34('0x41')][_0xfe34('0x91')][_0xfe34('0x46')];_0x1c59cc+=0x1){socket['emit'](_0xfe34('0x94'),{'UserId':Number(_0x397e9c['query'][_0xfe34('0x91')][_0x1c59cc]),'ChatQueueId':Number(_0x397e9c[_0xfe34('0x52')]['id'])});}}else{socket[_0xfe34('0x93')]('userChatQueue:remove',{'UserId':Number(_0x397e9c[_0xfe34('0x41')]['ids']),'ChatQueueId':Number(_0x397e9c['params']['id'])});}});}})[_0xfe34('0x21')](respondWithStatusCode(_0x3e2778,null))[_0xfe34('0x2b')](handleError(_0x3e2778,null));};exports[_0xfe34('0x99')]=function(_0x29ac11,_0x586b64,_0x85730b){var _0x409e7f={};var _0x284e17={};var _0x5ac331;var _0x4d5d51;return db['ChatQueue']['findOne']({'where':{'id':_0x29ac11[_0xfe34('0x52')]['id']}})['then'](handleEntityNotFound(_0x586b64,null))['then'](function(_0x53c350){if(_0x53c350){_0x5ac331=_0x53c350;_0x284e17[_0xfe34('0x3f')]=_['keys'](db[_0xfe34('0x66')]['rawAttributes']);_0x284e17['query']=_[_0xfe34('0x40')](_0x29ac11[_0xfe34('0x41')]);_0x284e17[_0xfe34('0x42')]=_[_0xfe34('0x43')](_0x284e17['model'],_0x284e17[_0xfe34('0x41')]);_0x409e7f[_0xfe34('0x45')]=_[_0xfe34('0x43')](_0x284e17[_0xfe34('0x3f')],qs['fields'](_0x29ac11['query']['fields']));_0x409e7f[_0xfe34('0x45')]=_0x409e7f[_0xfe34('0x45')][_0xfe34('0x46')]?_0x409e7f[_0xfe34('0x45')]:_0x284e17[_0xfe34('0x3f')];_0x409e7f[_0xfe34('0x49')]=qs['sort'](_0x29ac11['query'][_0xfe34('0x4a')]);_0x409e7f[_0xfe34('0x4b')]=qs[_0xfe34('0x42')](_[_0xfe34('0x63')](_0x29ac11[_0xfe34('0x41')],_0x284e17[_0xfe34('0x42')]));if(_0x29ac11['query'][_0xfe34('0x65')]){_0x409e7f[_0xfe34('0x4b')]=_['merge'](_0x409e7f['where'],{'$or':_[_0xfe34('0x3c')](_0x409e7f[_0xfe34('0x45')],function(_0x25a79c){var _0x17d68e={};_0x17d68e[_0x25a79c]={'$like':'%'+_0x29ac11[_0xfe34('0x41')][_0xfe34('0x65')]+'%'};return _0x17d68e;})});}_0x409e7f=_['merge']({},_0x409e7f,_0x29ac11[_0xfe34('0x9a')]);return _0x5ac331[_0xfe34('0x99')](_0x409e7f);}})['then'](function(_0x40b152){if(_0x40b152){_0x4d5d51=_0x40b152[_0xfe34('0x46')];if(!_0x29ac11['query'][_0xfe34('0x72')](_0xfe34('0x47'))){_0x409e7f[_0xfe34('0x48')]=qs[_0xfe34('0x48')](_0x29ac11['query'][_0xfe34('0x48')]);_0x409e7f[_0xfe34('0x2d')]=qs['offset'](_0x29ac11[_0xfe34('0x41')]['offset']);}return _0x5ac331[_0xfe34('0x99')](_0x409e7f);}})[_0xfe34('0x21')](function(_0x5e6da3){if(_0x5e6da3){return _0x5e6da3?{'count':_0x4d5d51,'rows':_0x5e6da3}:null;}})[_0xfe34('0x21')](respondWithResult(_0x586b64,null))[_0xfe34('0x2b')](handleError(_0x586b64,null));}; \ No newline at end of file +var _0x8166=['model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','ChatQueue','includeAll','findAll','rows','show','fields','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','Team','pick','addTeams','ids','User','Agents','voicePause','flatMap','each','forEach','emit','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','removeTeams','isEmpty','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','fs-extra','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','get','ChatQueues','stack','name','map','rawAttributes','type'];(function(_0x1de26c,_0x45fb8e){var _0x41ced2=function(_0x112b45){while(--_0x112b45){_0x1de26c['push'](_0x1de26c['shift']());}};_0x41ced2(++_0x45fb8e);}(_0x8166,0xde));var _0x6816=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0x8166[_0x28be72];return _0x46c5da;};'use strict';var emlformat=require(_0x6816('0x0'));var rimraf=require(_0x6816('0x1'));var zipdir=require(_0x6816('0x2'));var jsonpatch=require(_0x6816('0x3'));var rp=require(_0x6816('0x4'));var moment=require('moment');var BPromise=require(_0x6816('0x5'));var Mustache=require(_0x6816('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6816('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6816('0x8'));var _=require('lodash');var squel=require(_0x6816('0x9'));var crypto=require(_0x6816('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6816('0xb'));var toCsv=require(_0x6816('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6816('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6816('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6816('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6816('0xf'))['db'];config[_0x6816('0x10')]=_['defaults'](config[_0x6816('0x10')],{'host':_0x6816('0x11'),'port':0x18eb});var socket=require(_0x6816('0x12'))(new Redis(config['redis']));require(_0x6816('0x13'))[_0x6816('0x14')](socket);var jayson=require(_0x6816('0x15'));var client=jayson[_0x6816('0x16')][_0x6816('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4955ac,_0x1d8d6d,_0x3d94b3,_0x4be552){return new BPromise(function(_0x1cba71,_0x230384){var _0x984769=_0x4be552||client;return _0x984769[_0x6816('0x18')](_0x4955ac,_0x3d94b3)['then'](function(_0x4172c1){logger[_0x6816('0x19')](_0x6816('0x1a'),_0x1d8d6d,_0x6816('0x1b'));logger[_0x6816('0x1c')](_0x6816('0x1d'),_0x1d8d6d,_0x6816('0x1b'),JSON['stringify'](_0x4172c1));if(_0x4172c1['error']){if(_0x4172c1[_0x6816('0x1e')][_0x6816('0x1f')]===0x1f4){logger[_0x6816('0x1e')]('ChatQueue,\x20%s,\x20%s',_0x1d8d6d,_0x4172c1[_0x6816('0x1e')]['message']);return _0x230384(_0x4172c1['error'][_0x6816('0x20')]);}logger[_0x6816('0x1e')](_0x6816('0x1a'),_0x1d8d6d,_0x4172c1[_0x6816('0x1e')][_0x6816('0x20')]);return _0x1cba71(_0x4172c1[_0x6816('0x1e')][_0x6816('0x20')]);}else{logger[_0x6816('0x19')](_0x6816('0x1a'),_0x1d8d6d,'request\x20sent');_0x1cba71(_0x4172c1[_0x6816('0x21')]['message']);}})[_0x6816('0x22')](function(_0x5ca590){logger[_0x6816('0x1e')](_0x6816('0x1a'),_0x1d8d6d,_0x5ca590);_0x230384(_0x5ca590);});});}function respondWithStatusCode(_0x36794d,_0x2dd74d){_0x2dd74d=_0x2dd74d||0xcc;return function(_0x3f683a){if(_0x3f683a){return _0x36794d[_0x6816('0x23')](_0x2dd74d);}return _0x36794d[_0x6816('0x24')](_0x2dd74d)[_0x6816('0x25')]();};}function respondWithResult(_0x3940b,_0x34eb55){_0x34eb55=_0x34eb55||0xc8;return function(_0x73454a){if(_0x73454a){return _0x3940b[_0x6816('0x24')](_0x34eb55)[_0x6816('0x26')](_0x73454a);}};}function respondWithFilteredResult(_0x398a16,_0x24dfae){return function(_0x1af29a){if(_0x1af29a){var _0x1741ad=typeof _0x24dfae['offset']===_0x6816('0x27')&&typeof _0x24dfae[_0x6816('0x28')]==='undefined';var _0x4922c5=_0x1af29a[_0x6816('0x29')];var _0x4e1a98=_0x1741ad?0x0:_0x24dfae[_0x6816('0x2a')];var _0x21bc76=_0x1741ad?_0x1af29a[_0x6816('0x29')]:_0x24dfae[_0x6816('0x2a')]+_0x24dfae[_0x6816('0x28')];var _0x3fcc7f;if(_0x21bc76>=_0x4922c5){_0x21bc76=_0x4922c5;_0x3fcc7f=0xc8;}else{_0x3fcc7f=0xce;}_0x398a16[_0x6816('0x24')](_0x3fcc7f);return _0x398a16[_0x6816('0x2b')]('Content-Range',_0x4e1a98+'-'+_0x21bc76+'/'+_0x4922c5)[_0x6816('0x26')](_0x1af29a);}return null;};}function patchUpdates(_0x2236e9){return function(_0x4a527e){try{jsonpatch[_0x6816('0x2c')](_0x4a527e,_0x2236e9,!![]);}catch(_0x2f7c84){return BPromise[_0x6816('0x2d')](_0x2f7c84);}return _0x4a527e[_0x6816('0x2e')]();};}function saveUpdates(_0x495463,_0x19ebaa){return function(_0x229b46){if(_0x229b46){return _0x229b46['update'](_0x495463)[_0x6816('0x2f')](function(_0x55f89f){return _0x55f89f;});}return null;};}function removeEntity(_0x4bbc01,_0x3b4f70){return function(_0x1320d5){if(_0x1320d5){return _0x1320d5[_0x6816('0x30')]()[_0x6816('0x2f')](function(){var _0xfdb3b4=_0x1320d5[_0x6816('0x31')]({'plain':!![]});var _0x200aeb=_0x6816('0x32');return db['UserProfileResource'][_0x6816('0x30')]({'where':{'type':_0x200aeb,'resourceId':_0xfdb3b4['id']}})[_0x6816('0x2f')](function(){return _0x1320d5;});})[_0x6816('0x2f')](function(){_0x4bbc01[_0x6816('0x24')](0xcc)[_0x6816('0x25')]();});}};}function handleEntityNotFound(_0x3d23d5,_0x260a17){return function(_0x2f6a41){if(!_0x2f6a41){_0x3d23d5['sendStatus'](0x194);}return _0x2f6a41;};}function handleError(_0x4e1185,_0x32e9af){_0x32e9af=_0x32e9af||0x1f4;return function(_0x22c5f6){logger[_0x6816('0x1e')](_0x22c5f6[_0x6816('0x33')]);if(_0x22c5f6[_0x6816('0x34')]){delete _0x22c5f6['name'];}_0x4e1185[_0x6816('0x24')](_0x32e9af)['send'](_0x22c5f6);};}exports['index']=function(_0x3b599b,_0x55928d){var _0x1b9984={},_0x2b35d5={},_0x113606={'count':0x0,'rows':[]};var _0x1e77d4=_[_0x6816('0x35')](db['ChatQueue'][_0x6816('0x36')],function(_0x37e765){return{'name':_0x37e765['fieldName'],'type':_0x37e765[_0x6816('0x37')]['key']};});_0x2b35d5[_0x6816('0x38')]=_[_0x6816('0x35')](_0x1e77d4,_0x6816('0x34'));_0x2b35d5['query']=_[_0x6816('0x39')](_0x3b599b[_0x6816('0x3a')]);_0x2b35d5[_0x6816('0x3b')]=_[_0x6816('0x3c')](_0x2b35d5[_0x6816('0x38')],_0x2b35d5[_0x6816('0x3a')]);_0x1b9984['attributes']=_[_0x6816('0x3c')](_0x2b35d5[_0x6816('0x38')],qs['fields'](_0x3b599b[_0x6816('0x3a')]['fields']));_0x1b9984[_0x6816('0x3d')]=_0x1b9984[_0x6816('0x3d')][_0x6816('0x3e')]?_0x1b9984[_0x6816('0x3d')]:_0x2b35d5[_0x6816('0x38')];if(!_0x3b599b[_0x6816('0x3a')][_0x6816('0x3f')](_0x6816('0x40'))){_0x1b9984[_0x6816('0x28')]=qs[_0x6816('0x28')](_0x3b599b[_0x6816('0x3a')][_0x6816('0x28')]);_0x1b9984[_0x6816('0x2a')]=qs[_0x6816('0x2a')](_0x3b599b[_0x6816('0x3a')]['offset']);}_0x1b9984[_0x6816('0x41')]=qs[_0x6816('0x42')](_0x3b599b['query'][_0x6816('0x42')]);_0x1b9984[_0x6816('0x43')]=qs[_0x6816('0x3b')](_['pick'](_0x3b599b[_0x6816('0x3a')],_0x2b35d5[_0x6816('0x3b')]),_0x1e77d4);if(_0x3b599b['query'][_0x6816('0x44')]){_0x1b9984['where']=_['merge'](_0x1b9984['where'],{'$or':_[_0x6816('0x35')](_0x1e77d4,function(_0x52c35e){if(_0x52c35e[_0x6816('0x37')]!==_0x6816('0x45')){var _0x34949e={};_0x34949e[_0x52c35e['name']]={'$like':'%'+_0x3b599b[_0x6816('0x3a')][_0x6816('0x44')]+'%'};return _0x34949e;}})});}_0x1b9984=_[_0x6816('0x46')]({},_0x1b9984,_0x3b599b[_0x6816('0x47')]);var _0xdf1d00={'where':_0x1b9984[_0x6816('0x43')]};return db[_0x6816('0x48')][_0x6816('0x29')](_0xdf1d00)[_0x6816('0x2f')](function(_0x75f7b9){_0x113606[_0x6816('0x29')]=_0x75f7b9;if(_0x3b599b[_0x6816('0x3a')][_0x6816('0x49')]){_0x1b9984['include']=[{'all':!![]}];}return db[_0x6816('0x48')][_0x6816('0x4a')](_0x1b9984);})['then'](function(_0x52749c){_0x113606[_0x6816('0x4b')]=_0x52749c;return _0x113606;})[_0x6816('0x2f')](respondWithFilteredResult(_0x55928d,_0x1b9984))[_0x6816('0x22')](handleError(_0x55928d,null));};exports[_0x6816('0x4c')]=function(_0x45c32a,_0x1aeea5){var _0x24cf71={'raw':!![],'where':{'id':_0x45c32a['params']['id']}},_0x51e94f={};_0x51e94f[_0x6816('0x38')]=_[_0x6816('0x39')](db[_0x6816('0x48')]['rawAttributes']);_0x51e94f[_0x6816('0x3a')]=_['keys'](_0x45c32a['query']);_0x51e94f[_0x6816('0x3b')]=_[_0x6816('0x3c')](_0x51e94f[_0x6816('0x38')],_0x51e94f[_0x6816('0x3a')]);_0x24cf71['attributes']=_[_0x6816('0x3c')](_0x51e94f[_0x6816('0x38')],qs['fields'](_0x45c32a[_0x6816('0x3a')][_0x6816('0x4d')]));_0x24cf71[_0x6816('0x3d')]=_0x24cf71['attributes'][_0x6816('0x3e')]?_0x24cf71['attributes']:_0x51e94f[_0x6816('0x38')];if(_0x45c32a[_0x6816('0x3a')][_0x6816('0x49')]){_0x24cf71[_0x6816('0x4e')]=[{'all':!![]}];}_0x24cf71=_[_0x6816('0x46')]({},_0x24cf71,_0x45c32a[_0x6816('0x47')]);return db['ChatQueue'][_0x6816('0x4f')](_0x24cf71)['then'](handleEntityNotFound(_0x1aeea5,null))['then'](respondWithResult(_0x1aeea5,null))[_0x6816('0x22')](handleError(_0x1aeea5,null));};exports['create']=function(_0x27407c,_0x3e7148){return db[_0x6816('0x48')]['create'](_0x27407c[_0x6816('0x50')],{})['then'](function(_0x5ab774){var _0x2768bc=_0x27407c[_0x6816('0x51')][_0x6816('0x31')]({'plain':!![]});if(!_0x2768bc)throw new Error(_0x6816('0x52'));if(_0x2768bc[_0x6816('0x53')]==='user'){var _0x1513cb=_0x5ab774[_0x6816('0x31')]({'plain':!![]});var _0x3103c5='ChatQueues';return db[_0x6816('0x54')][_0x6816('0x4f')]({'where':{'name':_0x3103c5,'userProfileId':_0x2768bc[_0x6816('0x55')]},'raw':!![]})[_0x6816('0x2f')](function(_0x2475b9){if(_0x2475b9&&_0x2475b9[_0x6816('0x56')]===0x0){return db['UserProfileResource'][_0x6816('0x57')]({'name':_0x1513cb[_0x6816('0x34')],'resourceId':_0x1513cb['id'],'type':_0x2475b9['name'],'sectionId':_0x2475b9['id']},{})[_0x6816('0x2f')](function(){return _0x5ab774;});}else{return _0x5ab774;}})['catch'](function(_0x330619){logger[_0x6816('0x1e')](_0x6816('0x58'),_0x330619);throw _0x330619;});}return _0x5ab774;})[_0x6816('0x2f')](respondWithResult(_0x3e7148,0xc9))[_0x6816('0x22')](handleError(_0x3e7148,null));};exports['update']=function(_0x3e37c4,_0x5a8935){if(_0x3e37c4['body']['id']){delete _0x3e37c4['body']['id'];}return db[_0x6816('0x48')][_0x6816('0x4f')]({'where':{'id':_0x3e37c4[_0x6816('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a8935,null))[_0x6816('0x2f')](saveUpdates(_0x3e37c4['body'],null))[_0x6816('0x2f')](respondWithResult(_0x5a8935,null))[_0x6816('0x22')](handleError(_0x5a8935,null));};exports[_0x6816('0x30')]=function(_0x4a9704,_0x3d1b91){return db[_0x6816('0x48')][_0x6816('0x4f')]({'where':{'id':_0x4a9704['params']['id']}})[_0x6816('0x2f')](handleEntityNotFound(_0x3d1b91,null))[_0x6816('0x2f')](removeEntity(_0x3d1b91,null))[_0x6816('0x22')](handleError(_0x3d1b91,null));};exports[_0x6816('0x5a')]=function(_0x3c3605,_0x32573b){return db[_0x6816('0x48')][_0x6816('0x5a')]()[_0x6816('0x2f')](respondWithResult(_0x32573b,null))['catch'](handleError(_0x32573b,null));};exports[_0x6816('0x5b')]=function(_0x1ce12e,_0x1e961f,_0x437f3b){var _0xa0a922={'raw':!![],'where':{}},_0x2b5b18={},_0x531296;return db['ChatQueue'][_0x6816('0x5c')]({'where':{'id':_0x1ce12e[_0x6816('0x59')]['id']}})[_0x6816('0x2f')](handleEntityNotFound(_0x1e961f,null))[_0x6816('0x2f')](function(_0x4178f1){if(_0x4178f1){_0x531296=_0x4178f1[_0x6816('0x31')]({'plain':!![]});_0x2b5b18[_0x6816('0x38')]=_[_0x6816('0x39')](db[_0x6816('0x5d')][_0x6816('0x36')]);_0x2b5b18[_0x6816('0x3a')]=_[_0x6816('0x39')](_0x1ce12e[_0x6816('0x3a')]);_0x2b5b18[_0x6816('0x3b')]=_['intersection'](_0x2b5b18[_0x6816('0x38')],_0x2b5b18[_0x6816('0x3a')]);_0xa0a922['attributes']=_['intersection'](_0x2b5b18[_0x6816('0x38')],qs['fields'](_0x1ce12e[_0x6816('0x3a')][_0x6816('0x4d')]));_0xa0a922['attributes']=_0xa0a922['attributes']['length']?_0xa0a922[_0x6816('0x3d')]:_0x2b5b18['model'];if(!_0x1ce12e['query'][_0x6816('0x3f')](_0x6816('0x40'))){_0xa0a922[_0x6816('0x28')]=qs[_0x6816('0x28')](_0x1ce12e[_0x6816('0x3a')][_0x6816('0x28')]);_0xa0a922[_0x6816('0x2a')]=qs[_0x6816('0x2a')](_0x1ce12e['query'][_0x6816('0x2a')]);}_0xa0a922[_0x6816('0x41')]=qs[_0x6816('0x42')](_0x1ce12e[_0x6816('0x3a')][_0x6816('0x42')]);_0xa0a922[_0x6816('0x43')]=qs[_0x6816('0x3b')](_['pick'](_0x1ce12e[_0x6816('0x3a')],_0x2b5b18[_0x6816('0x3b')]));_0xa0a922[_0x6816('0x43')][_0x6816('0x5e')]=_0x4178f1['id'];if(_0x1ce12e['query'][_0x6816('0x44')]){_0xa0a922[_0x6816('0x43')]=_[_0x6816('0x46')](_0xa0a922[_0x6816('0x43')],{'$or':_[_0x6816('0x35')](_0xa0a922[_0x6816('0x3d')],function(_0x3af9f8){var _0x408fd8={};_0x408fd8[_0x3af9f8]={'$like':'%'+_0x1ce12e[_0x6816('0x3a')][_0x6816('0x44')]+'%'};return _0x408fd8;})});}_0xa0a922=_['merge']({},_0xa0a922,_0x1ce12e[_0x6816('0x47')]);return db[_0x6816('0x5d')]['findAll'](_0xa0a922);}})[_0x6816('0x2f')](function(_0x4f045e){if(_0x4f045e){return db['User']['findAndCountAll']({'where':{'id':_[_0x6816('0x35')](_0x4f045e,_0x6816('0x5f')),'role':_0x6816('0x60')},'attributes':['id',_0x6816('0x34'),_0x6816('0x61'),_0x6816('0x62'),'createdAt']});}})[_0x6816('0x2f')](function(_0x55b650){if(_0x55b650){return{'count':_0x55b650[_0x6816('0x29')],'rows':_[_0x6816('0x35')](_0x55b650[_0x6816('0x4b')],function(_0x2622f7){return{'membername':_0x2622f7[_0x6816('0x34')],'UserId':_0x2622f7['id'],'queue_name':_0x531296['name'],'ChatQueueId':_0x531296['id'],'interface':util[_0x6816('0x63')]('%s/%s',_0x6816('0x64'),_0x2622f7['name']),'penalty':0x0,'paused':_0x2622f7[_0x6816('0x61')],'createdAt':_0x2622f7[_0x6816('0x65')],'updatedAt':_0x2622f7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6816('0x2f')](respondWithFilteredResult(_0x1e961f,_0xa0a922))[_0x6816('0x22')](handleError(_0x1e961f,null));};exports[_0x6816('0x66')]=function(_0x34c539,_0x276cbe,_0x26bef6){var _0x21eb53={};var _0x55b4ad={};var _0x558371;var _0xdf109d;return db[_0x6816('0x48')][_0x6816('0x5c')]({'where':{'id':_0x34c539[_0x6816('0x59')]['id']}})['then'](handleEntityNotFound(_0x276cbe,null))[_0x6816('0x2f')](function(_0x2564a9){if(_0x2564a9){_0x558371=_0x2564a9;_0x55b4ad[_0x6816('0x38')]=_[_0x6816('0x39')](db[_0x6816('0x67')][_0x6816('0x36')]);_0x55b4ad[_0x6816('0x3a')]=_[_0x6816('0x39')](_0x34c539[_0x6816('0x3a')]);_0x55b4ad[_0x6816('0x3b')]=_[_0x6816('0x3c')](_0x55b4ad[_0x6816('0x38')],_0x55b4ad[_0x6816('0x3a')]);_0x21eb53['attributes']=_[_0x6816('0x3c')](_0x55b4ad[_0x6816('0x38')],qs[_0x6816('0x4d')](_0x34c539[_0x6816('0x3a')][_0x6816('0x4d')]));_0x21eb53['attributes']=_0x21eb53['attributes'][_0x6816('0x3e')]?_0x21eb53[_0x6816('0x3d')]:_0x55b4ad[_0x6816('0x38')];_0x21eb53[_0x6816('0x41')]=qs[_0x6816('0x42')](_0x34c539[_0x6816('0x3a')]['sort']);_0x21eb53['where']=qs[_0x6816('0x3b')](_[_0x6816('0x68')](_0x34c539[_0x6816('0x3a')],_0x55b4ad[_0x6816('0x3b')]));if(_0x34c539[_0x6816('0x3a')][_0x6816('0x44')]){_0x21eb53[_0x6816('0x43')]=_['merge'](_0x21eb53[_0x6816('0x43')],{'$or':_[_0x6816('0x35')](_0x21eb53[_0x6816('0x3d')],function(_0x4e292f){var _0x343f52={};_0x343f52[_0x4e292f]={'$like':'%'+_0x34c539[_0x6816('0x3a')][_0x6816('0x44')]+'%'};return _0x343f52;})});}_0x21eb53=_[_0x6816('0x46')]({},_0x21eb53,_0x34c539['options']);return _0x558371[_0x6816('0x66')](_0x21eb53);}})['then'](function(_0x4c55ba){if(_0x4c55ba){_0xdf109d=_0x4c55ba['length'];if(!_0x34c539['query'][_0x6816('0x3f')](_0x6816('0x40'))){_0x21eb53[_0x6816('0x28')]=qs['limit'](_0x34c539[_0x6816('0x3a')][_0x6816('0x28')]);_0x21eb53[_0x6816('0x2a')]=qs['offset'](_0x34c539[_0x6816('0x3a')][_0x6816('0x2a')]);}return _0x558371['getTeams'](_0x21eb53);}})[_0x6816('0x2f')](function(_0x35932a){if(_0x35932a){return _0x35932a?{'count':_0xdf109d,'rows':_0x35932a}:null;}})[_0x6816('0x2f')](respondWithResult(_0x276cbe,null))[_0x6816('0x22')](handleError(_0x276cbe,null));};exports[_0x6816('0x69')]=function(_0x2128b0,_0x108480,_0x5f00a2){var _0x2e8a81=_0x2128b0['body'][_0x6816('0x6a')];return db[_0x6816('0x67')]['findAll']({'where':{'id':_0x2e8a81},'attributes':['id'],'include':[{'model':db[_0x6816('0x6b')],'as':_0x6816('0x6c'),'attributes':['id',_0x6816('0x34'),'online',_0x6816('0x6d'),'interface'],'raw':!![]}]})['then'](function(_0x1593d4){if(_0x1593d4){var _0xa43b9=_[_0x6816('0x6e')](_0x1593d4,function(_0x3bcd07){var _0x4763b9=_0x3bcd07[_0x6816('0x31')]({'plain':!![]});return _0x4763b9['Agents'];});return db['ChatQueue'][_0x6816('0x4f')]({'where':{'id':_0x2128b0[_0x6816('0x59')]['id']}})[_0x6816('0x2f')](function(_0x119051){return db['sequelize']['transaction'](function(_0x46fc06){return _0x119051['addTeams'](_0x2e8a81,{'transaction':_0x46fc06})['then'](function(){return BPromise[_0x6816('0x6f')](_0xa43b9,function(_0x5dc4d0){return db[_0x6816('0x5d')]['findOrCreate']({'where':{'UserId':_0x5dc4d0['id'],'ChatQueueId':_0x2128b0[_0x6816('0x59')]['id']},'transaction':_0x46fc06});});})[_0x6816('0x2f')](function(){_0xa43b9[_0x6816('0x70')](function(_0x52b2d7){socket[_0x6816('0x71')]('userChatQueue:save',{'UserId':_0x52b2d7['id'],'ChatQueueId':_0x119051['id']});});});});});}})[_0x6816('0x2f')](respondWithStatusCode(_0x108480,null))[_0x6816('0x22')](handleError(_0x108480,null));};exports['removeTeams']=function(_0x2d3128,_0x6c1e91,_0x463c64){return db[_0x6816('0x67')]['findAll']({'where':{'id':_0x2d3128[_0x6816('0x3a')][_0x6816('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x6816('0x6b')],'as':_0x6816('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6c1e91,null))[_0x6816('0x2f')](function(_0x56f8d2){var _0x2aaf8a=_[_0x6816('0x35')](_0x56f8d2,'id');var _0xb56f83=[];var _0x259f86=[];var _0x188e2b=squel['select']();_0x188e2b[_0x6816('0x72')](_0x6816('0x73'))[_0x6816('0x74')](_0x6816('0x75'),'tq')['join'](_0x6816('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x2d3128['params']['id']);for(var _0x496f2d=0x0;_0x496f2d<_0x56f8d2['length'];_0x496f2d+=0x1){let _0xf3d48b=_0x56f8d2[_0x496f2d];for(var _0x43154e=0x0;_0x43154e<_0xf3d48b['Agents'][_0x6816('0x3e')];_0x43154e+=0x1){let _0x10cb16=_0xf3d48b[_0x6816('0x6c')][_0x43154e];var _0x17f61=_0x188e2b['clone']();_0x17f61[_0x6816('0x43')](_0x6816('0x77'),_0x10cb16['id']);_0x259f86[_0x6816('0x78')](db[_0x6816('0x79')][_0x6816('0x3a')](_0x17f61[_0x6816('0x7a')](),{'type':db[_0x6816('0x79')][_0x6816('0x7b')][_0x6816('0x7c')]})[_0x6816('0x2f')](function(_0x49c61d){if(_0x49c61d['length']===0x1){return _0x10cb16['id'];}else{var _0x161a1c=_[_0x6816('0x7d')](_[_0x6816('0x35')](_0x49c61d,_0x6816('0x7e')),function(_0xb5628c){return _[_0x6816('0x7f')](_0x2aaf8a,_0xb5628c);});if(_0x161a1c){return _0x10cb16['id'];}}}));}}return BPromise[_0x6816('0x80')](_0x259f86)[_0x6816('0x2f')](function(_0x44fcdc){_0xb56f83=_(_0xb56f83)[_0x6816('0x81')](_0x44fcdc)['compact']()[_0x6816('0x82')]();return db[_0x6816('0x48')]['find']({'where':{'id':_0x2d3128[_0x6816('0x59')]['id']}})[_0x6816('0x2f')](function(_0x186a94){return db['sequelize'][_0x6816('0x83')](function(_0xfbda5b){return _0x186a94[_0x6816('0x84')](_0x2d3128[_0x6816('0x3a')][_0x6816('0x6a')],{'transaction':_0xfbda5b})[_0x6816('0x2f')](function(){if(!_[_0x6816('0x85')](_0xb56f83)){return _0x186a94['removeAgents'](_0xb56f83,{'transaction':_0xfbda5b});}})[_0x6816('0x2f')](function(){_0xb56f83['forEach'](function(_0x3b7ca7){socket[_0x6816('0x71')](_0x6816('0x86'),{'UserId':_0x3b7ca7,'ChatQueueId':_0x186a94['id']});});});});});});})[_0x6816('0x2f')](respondWithStatusCode(_0x6c1e91,null))[_0x6816('0x22')](handleError(_0x6c1e91,null));};exports['addAgents']=function(_0x376743,_0xb97919,_0x186a8d){return db[_0x6816('0x48')][_0x6816('0x4f')]({'where':{'id':_0x376743[_0x6816('0x59')]['id']}})['then'](handleEntityNotFound(_0xb97919,null))[_0x6816('0x2f')](function(_0x19de3c){if(_0x19de3c){return _0x19de3c[_0x6816('0x87')](_0x376743['body']['ids'],_['omit'](_0x376743[_0x6816('0x50')],['ids','id'])||{})[_0x6816('0x88')](function(_0x229804){for(var _0xe4558e=0x0;_0xe4558e<_0x376743[_0x6816('0x50')][_0x6816('0x6a')]['length'];_0xe4558e+=0x1){socket[_0x6816('0x71')]('userChatQueue:save',{'UserId':Number(_0x376743['body']['ids'][_0xe4558e]),'ChatQueueId':Number(_0x376743[_0x6816('0x59')]['id'])});}return _0x229804;});}})['then'](respondWithResult(_0xb97919,null))[_0x6816('0x22')](handleError(_0xb97919,null));};exports['removeAgents']=function(_0x4f9d97,_0x6f652f,_0x323b88){return db[_0x6816('0x48')][_0x6816('0x4f')]({'where':{'id':_0x4f9d97[_0x6816('0x59')]['id']}})['then'](handleEntityNotFound(_0x6f652f,null))[_0x6816('0x2f')](function(_0xac0033){if(_0xac0033){return _0xac0033['removeAgents'](_0x4f9d97['query']['ids'])[_0x6816('0x2f')](function(){if(_[_0x6816('0x89')](_0x4f9d97[_0x6816('0x3a')][_0x6816('0x6a')])){for(var _0x21b9ad=0x0;_0x21b9ad<_0x4f9d97[_0x6816('0x3a')][_0x6816('0x6a')][_0x6816('0x3e')];_0x21b9ad+=0x1){socket[_0x6816('0x71')](_0x6816('0x86'),{'UserId':Number(_0x4f9d97[_0x6816('0x3a')][_0x6816('0x6a')][_0x21b9ad]),'ChatQueueId':Number(_0x4f9d97[_0x6816('0x59')]['id'])});}}else{socket[_0x6816('0x71')](_0x6816('0x86'),{'UserId':Number(_0x4f9d97[_0x6816('0x3a')][_0x6816('0x6a')]),'ChatQueueId':Number(_0x4f9d97['params']['id'])});}});}})[_0x6816('0x2f')](respondWithStatusCode(_0x6f652f,null))[_0x6816('0x22')](handleError(_0x6f652f,null));};exports[_0x6816('0x8a')]=function(_0xb78a35,_0x24b29c,_0x5efd56){var _0x574357={};var _0x1c1fe2={};var _0x1ae6f7;var _0x9ef82e;return db['ChatQueue'][_0x6816('0x5c')]({'where':{'id':_0xb78a35[_0x6816('0x59')]['id']}})['then'](handleEntityNotFound(_0x24b29c,null))['then'](function(_0x1c5b14){if(_0x1c5b14){_0x1ae6f7=_0x1c5b14;_0x1c1fe2[_0x6816('0x38')]=_[_0x6816('0x39')](db['User'][_0x6816('0x36')]);_0x1c1fe2['query']=_[_0x6816('0x39')](_0xb78a35[_0x6816('0x3a')]);_0x1c1fe2[_0x6816('0x3b')]=_[_0x6816('0x3c')](_0x1c1fe2[_0x6816('0x38')],_0x1c1fe2[_0x6816('0x3a')]);_0x574357['attributes']=_[_0x6816('0x3c')](_0x1c1fe2[_0x6816('0x38')],qs[_0x6816('0x4d')](_0xb78a35['query'][_0x6816('0x4d')]));_0x574357['attributes']=_0x574357[_0x6816('0x3d')]['length']?_0x574357[_0x6816('0x3d')]:_0x1c1fe2[_0x6816('0x38')];_0x574357[_0x6816('0x41')]=qs[_0x6816('0x42')](_0xb78a35[_0x6816('0x3a')][_0x6816('0x42')]);_0x574357[_0x6816('0x43')]=qs[_0x6816('0x3b')](_[_0x6816('0x68')](_0xb78a35[_0x6816('0x3a')],_0x1c1fe2[_0x6816('0x3b')]));if(_0xb78a35['query'][_0x6816('0x44')]){_0x574357['where']=_[_0x6816('0x46')](_0x574357[_0x6816('0x43')],{'$or':_[_0x6816('0x35')](_0x574357[_0x6816('0x3d')],function(_0x304046){var _0x227530={};_0x227530[_0x304046]={'$like':'%'+_0xb78a35[_0x6816('0x3a')][_0x6816('0x44')]+'%'};return _0x227530;})});}_0x574357=_[_0x6816('0x46')]({},_0x574357,_0xb78a35[_0x6816('0x47')]);return _0x1ae6f7[_0x6816('0x8a')](_0x574357);}})['then'](function(_0x2aeee2){if(_0x2aeee2){_0x9ef82e=_0x2aeee2['length'];if(!_0xb78a35[_0x6816('0x3a')][_0x6816('0x3f')]('nolimit')){_0x574357[_0x6816('0x28')]=qs['limit'](_0xb78a35[_0x6816('0x3a')][_0x6816('0x28')]);_0x574357[_0x6816('0x2a')]=qs[_0x6816('0x2a')](_0xb78a35['query'][_0x6816('0x2a')]);}return _0x1ae6f7['getAgents'](_0x574357);}})[_0x6816('0x2f')](function(_0xf9443c){if(_0xf9443c){return _0xf9443c?{'count':_0x9ef82e,'rows':_0xf9443c}:null;}})[_0x6816('0x2f')](respondWithResult(_0x24b29c,null))[_0x6816('0x22')](handleError(_0x24b29c,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 33dac73..c5dfe5e 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 _0x9f3a=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x20aef0,_0x42107a){var _0x19e9a6=function(_0x19a96d){while(--_0x19a96d){_0x20aef0['push'](_0x20aef0['shift']());}};_0x19e9a6(++_0x42107a);}(_0x9f3a,0xcc));var _0xa9f3=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0x9f3a[_0xf35bc1];return _0xa6b162;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xa9f3('0x0'))['db'][_0xa9f3('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa9f3('0x2')](0x0);var events={'afterCreate':_0xa9f3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5aba03){return function(_0x53c3cf,_0x4f8ca0,_0xe57f6c){ChatQueueEvents[_0xa9f3('0x4')](_0x5aba03+':'+_0x53c3cf['id'],_0x53c3cf);ChatQueueEvents[_0xa9f3('0x4')](_0x5aba03,_0x53c3cf);_0xe57f6c(null);};}for(var e in events){if(events[_0xa9f3('0x5')](e)){var event=events[e];ChatQueue[_0xa9f3('0x6')](e,emitEvent(event));}}module[_0xa9f3('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x8bd7=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xeadbaa,_0x745c06){var _0x19fcee=function(_0x337063){while(--_0x337063){_0xeadbaa['push'](_0xeadbaa['shift']());}};_0x19fcee(++_0x745c06);}(_0x8bd7,0x1a1));var _0x78bd=function(_0x2c8f39,_0x418912){_0x2c8f39=_0x2c8f39-0x0;var _0x26cc1a=_0x8bd7[_0x2c8f39];return _0x26cc1a;};'use strict';var EventEmitter=require(_0x78bd('0x0'));var ChatQueue=require(_0x78bd('0x1'))['db'][_0x78bd('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x78bd('0x3')](0x0);var events={'afterCreate':_0x78bd('0x4'),'afterUpdate':_0x78bd('0x5'),'afterDestroy':_0x78bd('0x6')};function emitEvent(_0x49d6db){return function(_0x1f53f8,_0x1403cc,_0x5b9505){ChatQueueEvents[_0x78bd('0x7')](_0x49d6db+':'+_0x1f53f8['id'],_0x1f53f8);ChatQueueEvents[_0x78bd('0x7')](_0x49d6db,_0x1f53f8);_0x5b9505(null);};}for(var e in events){if(events[_0x78bd('0x8')](e)){var event=events[e];ChatQueue[_0x78bd('0x9')](e,emitEvent(event));}}module[_0x78bd('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 818c1ad..e0dffcf 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 _0x68e7=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger','api'];(function(_0x4bc2c6,_0x1cb4a6){var _0x173087=function(_0x80e213){while(--_0x80e213){_0x4bc2c6['push'](_0x4bc2c6['shift']());}};_0x173087(++_0x1cb4a6);}(_0x68e7,0x1e9));var _0x768e=function(_0x5a1a1e,_0x3d9b30){_0x5a1a1e=_0x5a1a1e-0x0;var _0x3d106b=_0x68e7[_0x5a1a1e];return _0x3d106b;};'use strict';var _=require(_0x768e('0x0'));var util=require('util');var logger=require(_0x768e('0x1'))(_0x768e('0x2'));var moment=require(_0x768e('0x3'));var BPromise=require(_0x768e('0x4'));var rp=require(_0x768e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x768e('0x6'));var config=require(_0x768e('0x7'));var attributes=require(_0x768e('0x8'));module[_0x768e('0x9')]=function(_0x477c34,_0x5b8078){return _0x477c34['define'](_0x768e('0xa'),attributes,{'tableName':_0x768e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a62=['api','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash','util','../../config/logger'];(function(_0x31c6ca,_0x5b37b3){var _0x1b5088=function(_0x3c840b){while(--_0x3c840b){_0x31c6ca['push'](_0x31c6ca['shift']());}};_0x1b5088(++_0x5b37b3);}(_0x5a62,0xfa));var _0x25a6=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x5a62[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x25a6('0x0'));var util=require(_0x25a6('0x1'));var logger=require(_0x25a6('0x2'))(_0x25a6('0x3'));var moment=require('moment');var BPromise=require(_0x25a6('0x4'));var rp=require(_0x25a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25a6('0x6'));var config=require(_0x25a6('0x7'));var attributes=require(_0x25a6('0x8'));module['exports']=function(_0x5d4d0a,_0x150455){return _0x5d4d0a[_0x25a6('0x9')]('ChatQueue',attributes,{'tableName':_0x25a6('0xa'),'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 faaedf6..38f1823 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 _0x7e74=['request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','raw','where','limit','map','include','attributes','model','ShowChatQueue','ChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatQueue.socket','register'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x7e74,0xbd));var _0x47e7=function(_0x77973f,_0x580d6b){_0x77973f=_0x77973f-0x0;var _0x37a86f=_0x7e74[_0x77973f];return _0x37a86f;};'use strict';var _=require(_0x47e7('0x0'));var util=require('util');var moment=require(_0x47e7('0x1'));var BPromise=require(_0x47e7('0x2'));var rs=require(_0x47e7('0x3'));var fs=require('fs');var Redis=require(_0x47e7('0x4'));var db=require(_0x47e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x47e7('0x6'))(_0x47e7('0x7'));var config=require(_0x47e7('0x8'));var jayson=require(_0x47e7('0x9'));var client=jayson[_0x47e7('0xa')][_0x47e7('0xb')]({'port':0x232a});config[_0x47e7('0xc')]=_['defaults'](config[_0x47e7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47e7('0xd'))(new Redis(config[_0x47e7('0xc')]));require(_0x47e7('0xe'))[_0x47e7('0xf')](socket);function respondWithRpcPromise(_0x3c3abe,_0x1a0189,_0x25a04d){return new BPromise(function(_0x10e968,_0x41b00d){return client[_0x47e7('0x10')](_0x3c3abe,_0x25a04d)[_0x47e7('0x11')](function(_0x409b39){logger[_0x47e7('0x12')]('ChatQueue,\x20%s,\x20%s',_0x1a0189,_0x47e7('0x13'));logger[_0x47e7('0x14')](_0x47e7('0x15'),_0x1a0189,'request\x20sent',JSON[_0x47e7('0x16')](_0x409b39));if(_0x409b39[_0x47e7('0x17')]){if(_0x409b39[_0x47e7('0x17')][_0x47e7('0x18')]===0x1f4){logger['error'](_0x47e7('0x19'),_0x1a0189,_0x409b39[_0x47e7('0x17')][_0x47e7('0x1a')]);return _0x41b00d(_0x409b39[_0x47e7('0x17')][_0x47e7('0x1a')]);}logger['error'](_0x47e7('0x19'),_0x1a0189,_0x409b39['error'][_0x47e7('0x1a')]);return _0x10e968(_0x409b39[_0x47e7('0x17')][_0x47e7('0x1a')]);}else{logger[_0x47e7('0x12')](_0x47e7('0x19'),_0x1a0189,_0x47e7('0x13'));_0x10e968(_0x409b39[_0x47e7('0x1b')][_0x47e7('0x1a')]);}})[_0x47e7('0x1c')](function(_0x37d436){logger[_0x47e7('0x17')](_0x47e7('0x19'),_0x1a0189,_0x37d436);_0x41b00d(_0x37d436);});});}exports[_0x47e7('0x1d')]=function(_0x32e00e){var _0x53ec62=this;return new Promise(function(_0x578649,_0x528fc7){return db['ChatQueue'][_0x47e7('0x1e')]({'raw':_0x32e00e[_0x47e7('0x1f')]?_0x32e00e[_0x47e7('0x1f')][_0x47e7('0x20')]===undefined?!![]:![]:!![],'where':_0x32e00e['options']?_0x32e00e['options'][_0x47e7('0x21')]||null:null,'attributes':_0x32e00e['options']?_0x32e00e[_0x47e7('0x1f')]['attributes']||null:null,'limit':_0x32e00e[_0x47e7('0x1f')]?_0x32e00e[_0x47e7('0x1f')][_0x47e7('0x22')]||null:null,'include':_0x32e00e[_0x47e7('0x1f')]?_0x32e00e['options']['include']?_[_0x47e7('0x23')](_0x32e00e[_0x47e7('0x1f')][_0x47e7('0x24')],function(_0x28843b){return{'model':db[_0x28843b['model']],'as':_0x28843b['as'],'attributes':_0x28843b[_0x47e7('0x25')],'include':_0x28843b[_0x47e7('0x24')]?_[_0x47e7('0x23')](_0x28843b[_0x47e7('0x24')],function(_0x53f0ac){return{'model':db[_0x53f0ac[_0x47e7('0x26')]],'as':_0x53f0ac['as'],'attributes':_0x53f0ac[_0x47e7('0x25')],'include':_0x53f0ac[_0x47e7('0x24')]?_[_0x47e7('0x23')](_0x53f0ac[_0x47e7('0x24')],function(_0x303ff6){return{'model':db[_0x303ff6[_0x47e7('0x26')]],'as':_0x303ff6['as'],'attributes':_0x303ff6[_0x47e7('0x25')]};}):[]};}):[]};}):[]:[]})[_0x47e7('0x11')](function(_0x1f066f){logger[_0x47e7('0x12')](_0x47e7('0x1d'),_0x32e00e);logger[_0x47e7('0x14')](_0x47e7('0x1d'),_0x32e00e,JSON['stringify'](_0x1f066f));_0x578649(_0x1f066f);})[_0x47e7('0x1c')](function(_0x193a9a){logger[_0x47e7('0x17')](_0x47e7('0x1d'),_0x193a9a[_0x47e7('0x1a')],_0x32e00e);_0x528fc7(_0x53ec62['error'](0x1f4,_0x193a9a[_0x47e7('0x1a')]));});});};exports[_0x47e7('0x27')]=function(_0x38413f){var _0x117bec=this;return new Promise(function(_0xcd42b0,_0x24f833){return db[_0x47e7('0x28')]['find']({'raw':_0x38413f['options']?_0x38413f[_0x47e7('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x38413f[_0x47e7('0x1f')]?_0x38413f[_0x47e7('0x1f')]['where']||null:null,'attributes':_0x38413f[_0x47e7('0x1f')]?_0x38413f[_0x47e7('0x1f')][_0x47e7('0x25')]||null:null,'include':_0x38413f['options']?_0x38413f['options'][_0x47e7('0x24')]?_[_0x47e7('0x23')](_0x38413f['options'][_0x47e7('0x24')],function(_0x3a6d7d){return{'model':db[_0x3a6d7d[_0x47e7('0x26')]],'as':_0x3a6d7d['as'],'attributes':_0x3a6d7d['attributes'],'include':_0x3a6d7d[_0x47e7('0x24')]?_['map'](_0x3a6d7d[_0x47e7('0x24')],function(_0x33c4f6){return{'model':db[_0x33c4f6[_0x47e7('0x26')]],'as':_0x33c4f6['as'],'attributes':_0x33c4f6['attributes'],'include':_0x33c4f6[_0x47e7('0x24')]?_[_0x47e7('0x23')](_0x33c4f6[_0x47e7('0x24')],function(_0x2e2888){return{'model':db[_0x2e2888[_0x47e7('0x26')]],'as':_0x2e2888['as'],'attributes':_0x2e2888[_0x47e7('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5621ed){logger[_0x47e7('0x12')]('ShowChatQueue',_0x38413f);logger[_0x47e7('0x14')](_0x47e7('0x27'),_0x38413f,JSON[_0x47e7('0x16')](_0x5621ed));_0xcd42b0(_0x5621ed);})[_0x47e7('0x1c')](function(_0x2b8ded){logger[_0x47e7('0x17')](_0x47e7('0x27'),_0x2b8ded[_0x47e7('0x1a')],_0x38413f);_0x24f833(_0x117bec[_0x47e7('0x17')](0x1f4,_0x2b8ded[_0x47e7('0x1a')]));});});}; \ No newline at end of file +var _0xe8e8=['ShowChatQueue','ChatQueue','find','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','options','raw','where','map','include','attributes','model','catch'];(function(_0x2a5c1b,_0x47b844){var _0xff034f=function(_0xc2426){while(--_0xc2426){_0x2a5c1b['push'](_0x2a5c1b['shift']());}};_0xff034f(++_0x47b844);}(_0xe8e8,0xc6));var _0x8e8e=function(_0x46e441,_0x15f701){_0x46e441=_0x46e441-0x0;var _0x1050c6=_0xe8e8[_0x46e441];return _0x1050c6;};'use strict';var _=require(_0x8e8e('0x0'));var util=require(_0x8e8e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e8e('0x2'));var fs=require('fs');var Redis=require(_0x8e8e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e8e('0x4'))('rpc');var config=require(_0x8e8e('0x5'));var jayson=require(_0x8e8e('0x6'));var client=jayson[_0x8e8e('0x7')][_0x8e8e('0x8')]({'port':0x232a});config['redis']=_[_0x8e8e('0x9')](config['redis'],{'host':_0x8e8e('0xa'),'port':0x18eb});var socket=require(_0x8e8e('0xb'))(new Redis(config[_0x8e8e('0xc')]));require(_0x8e8e('0xd'))[_0x8e8e('0xe')](socket);function respondWithRpcPromise(_0x18d54f,_0x314e27,_0x57a80e){return new BPromise(function(_0x262606,_0x20134b){return client[_0x8e8e('0xf')](_0x18d54f,_0x57a80e)[_0x8e8e('0x10')](function(_0x5ec26b){logger[_0x8e8e('0x11')](_0x8e8e('0x12'),_0x314e27,_0x8e8e('0x13'));logger[_0x8e8e('0x14')](_0x8e8e('0x15'),_0x314e27,_0x8e8e('0x13'),JSON[_0x8e8e('0x16')](_0x5ec26b));if(_0x5ec26b[_0x8e8e('0x17')]){if(_0x5ec26b[_0x8e8e('0x17')][_0x8e8e('0x18')]===0x1f4){logger['error'](_0x8e8e('0x12'),_0x314e27,_0x5ec26b[_0x8e8e('0x17')]['message']);return _0x20134b(_0x5ec26b[_0x8e8e('0x17')][_0x8e8e('0x19')]);}logger['error'](_0x8e8e('0x12'),_0x314e27,_0x5ec26b[_0x8e8e('0x17')][_0x8e8e('0x19')]);return _0x262606(_0x5ec26b[_0x8e8e('0x17')][_0x8e8e('0x19')]);}else{logger[_0x8e8e('0x11')](_0x8e8e('0x12'),_0x314e27,_0x8e8e('0x13'));_0x262606(_0x5ec26b[_0x8e8e('0x1a')][_0x8e8e('0x19')]);}})['catch'](function(_0x4a148c){logger[_0x8e8e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x314e27,_0x4a148c);_0x20134b(_0x4a148c);});});}exports[_0x8e8e('0x1b')]=function(_0x399359){var _0x2c23db=this;return new Promise(function(_0xf928c8,_0x572c19){return db['ChatQueue']['findAll']({'raw':_0x399359[_0x8e8e('0x1c')]?_0x399359[_0x8e8e('0x1c')][_0x8e8e('0x1d')]===undefined?!![]:![]:!![],'where':_0x399359[_0x8e8e('0x1c')]?_0x399359['options'][_0x8e8e('0x1e')]||null:null,'attributes':_0x399359[_0x8e8e('0x1c')]?_0x399359[_0x8e8e('0x1c')]['attributes']||null:null,'limit':_0x399359[_0x8e8e('0x1c')]?_0x399359['options']['limit']||null:null,'include':_0x399359[_0x8e8e('0x1c')]?_0x399359[_0x8e8e('0x1c')]['include']?_[_0x8e8e('0x1f')](_0x399359[_0x8e8e('0x1c')][_0x8e8e('0x20')],function(_0x110c70){return{'model':db[_0x110c70['model']],'as':_0x110c70['as'],'attributes':_0x110c70[_0x8e8e('0x21')],'include':_0x110c70[_0x8e8e('0x20')]?_[_0x8e8e('0x1f')](_0x110c70[_0x8e8e('0x20')],function(_0xa24bae){return{'model':db[_0xa24bae[_0x8e8e('0x22')]],'as':_0xa24bae['as'],'attributes':_0xa24bae[_0x8e8e('0x21')],'include':_0xa24bae[_0x8e8e('0x20')]?_[_0x8e8e('0x1f')](_0xa24bae[_0x8e8e('0x20')],function(_0x56424b){return{'model':db[_0x56424b[_0x8e8e('0x22')]],'as':_0x56424b['as'],'attributes':_0x56424b[_0x8e8e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8e8e('0x10')](function(_0x4929ab){logger[_0x8e8e('0x11')](_0x8e8e('0x1b'),_0x399359);logger[_0x8e8e('0x14')](_0x8e8e('0x1b'),_0x399359,JSON['stringify'](_0x4929ab));_0xf928c8(_0x4929ab);})[_0x8e8e('0x23')](function(_0x17de8e){logger[_0x8e8e('0x17')]('GetChatQueue',_0x17de8e[_0x8e8e('0x19')],_0x399359);_0x572c19(_0x2c23db[_0x8e8e('0x17')](0x1f4,_0x17de8e['message']));});});};exports[_0x8e8e('0x24')]=function(_0x1aadd3){var _0x4b3f0c=this;return new Promise(function(_0x52a135,_0x5de068){return db[_0x8e8e('0x25')][_0x8e8e('0x26')]({'raw':_0x1aadd3[_0x8e8e('0x1c')]?_0x1aadd3[_0x8e8e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1aadd3[_0x8e8e('0x1c')]?_0x1aadd3['options']['where']||null:null,'attributes':_0x1aadd3[_0x8e8e('0x1c')]?_0x1aadd3[_0x8e8e('0x1c')]['attributes']||null:null,'include':_0x1aadd3[_0x8e8e('0x1c')]?_0x1aadd3[_0x8e8e('0x1c')]['include']?_[_0x8e8e('0x1f')](_0x1aadd3[_0x8e8e('0x1c')][_0x8e8e('0x20')],function(_0x172dbb){return{'model':db[_0x172dbb[_0x8e8e('0x22')]],'as':_0x172dbb['as'],'attributes':_0x172dbb[_0x8e8e('0x21')],'include':_0x172dbb[_0x8e8e('0x20')]?_[_0x8e8e('0x1f')](_0x172dbb[_0x8e8e('0x20')],function(_0x89f8d0){return{'model':db[_0x89f8d0[_0x8e8e('0x22')]],'as':_0x89f8d0['as'],'attributes':_0x89f8d0['attributes'],'include':_0x89f8d0[_0x8e8e('0x20')]?_['map'](_0x89f8d0[_0x8e8e('0x20')],function(_0xe0adc1){return{'model':db[_0xe0adc1[_0x8e8e('0x22')]],'as':_0xe0adc1['as'],'attributes':_0xe0adc1[_0x8e8e('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8e8e('0x10')](function(_0x4e0f5c){logger[_0x8e8e('0x11')]('ShowChatQueue',_0x1aadd3);logger[_0x8e8e('0x14')](_0x8e8e('0x24'),_0x1aadd3,JSON[_0x8e8e('0x16')](_0x4e0f5c));_0x52a135(_0x4e0f5c);})['catch'](function(_0x53dc67){logger[_0x8e8e('0x17')]('ShowChatQueue',_0x53dc67[_0x8e8e('0x19')],_0x1aadd3);_0x5de068(_0x4b3f0c[_0x8e8e('0x17')](0x1f4,_0x53dc67[_0x8e8e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index f09eaf3..d66ab29 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 _0x0e85=['update','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x4a8d5c,_0x243dd9){var _0x531656=function(_0x549278){while(--_0x549278){_0x4a8d5c['push'](_0x4a8d5c['shift']());}};_0x531656(++_0x243dd9);}(_0x0e85,0x7c));var _0x50e8=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x0e85[_0x1da527];return _0x40fc7c;};'use strict';var ChatQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatQueueEvents['on'](_0x108edc,_0x42665e);}}; \ No newline at end of file +var _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x261675,_0x36c5e2){var _0x194b5f=function(_0x4765c2){while(--_0x4765c2){_0x261675['push'](_0x261675['shift']());}};_0x194b5f(++_0x36c5e2);}(_0x80d9,0x15c));var _0x980d=function(_0x230c0c,_0x669c05){_0x230c0c=_0x230c0c-0x0;var _0x48dd75=_0x80d9[_0x230c0c];return _0x48dd75;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 996d87d..afaf414 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x3d9d83,_0x9413c1){_0x3d9d83=_0x3d9d83-0x0;var _0x283158=_0x3e74[_0x3d9d83];return _0x283158;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _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(_0x15d1ab,_0x18bc4f){var _0xdb08ca=function(_0xb2dc1){while(--_0xb2dc1){_0x15d1ab['push'](_0x15d1ab['shift']());}};_0xdb08ca(++_0x18bc4f);}(_0xe14b,0x93));var _0xbe14=function(_0xcbb19c,_0xe6bf4f){_0xcbb19c=_0xcbb19c-0x0;var _0x110b28=_0xe14b[_0xcbb19c];return _0x110b28;};'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 d262404..3ec8b7e 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 _0x2df6=['exports','STRING','DATE','moment','sequelize'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x2df6,0x6c));var _0x62df=function(_0x3a914e,_0x4bfedb){_0x3a914e=_0x3a914e-0x0;var _0x3450da=_0x2df6[_0x3a914e];return _0x3450da;};'use strict';var moment=require(_0x62df('0x0'));var Sequelize=require(_0x62df('0x1'));module[_0x62df('0x2')]={'uniqueid':{'type':Sequelize[_0x62df('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x62df('0x3')]},'joinAt':{'type':Sequelize[_0x62df('0x4')]},'leaveAt':{'type':Sequelize[_0x62df('0x4')]},'acceptAt':{'type':Sequelize[_0x62df('0x4')]},'exitAt':{'type':Sequelize[_0x62df('0x4')]},'reason':{'type':Sequelize[_0x62df('0x3')]}}; \ No newline at end of file +var _0xb71a=['STRING','DATE','moment','exports'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0xb71a,0x1e2));var _0xab71=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0xb71a[_0x51fe5f];return _0x4abce9;};'use strict';var moment=require(_0xab71('0x0'));var Sequelize=require('sequelize');module[_0xab71('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xab71('0x2')]},'joinAt':{'type':Sequelize[_0xab71('0x3')]},'leaveAt':{'type':Sequelize[_0xab71('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xab71('0x3')]},'reason':{'type':Sequelize[_0xab71('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 62d9c89..8bdd261 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 _0xbf25=['undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','options','includeAll','ChatQueueReport','rows','catch','show','keys','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x584ba8,_0x23e525){var _0x4ac9a4=function(_0x409a3a){while(--_0x409a3a){_0x584ba8['push'](_0x584ba8['shift']());}};_0x4ac9a4(++_0x23e525);}(_0xbf25,0x15e));var _0x5bf2=function(_0x38817a,_0x459f4e){_0x38817a=_0x38817a-0x0;var _0x38d8c6=_0xbf25[_0x38817a];return _0x38d8c6;};'use strict';var emlformat=require(_0x5bf2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5bf2('0x1'));var jsonpatch=require(_0x5bf2('0x2'));var rp=require(_0x5bf2('0x3'));var moment=require(_0x5bf2('0x4'));var BPromise=require(_0x5bf2('0x5'));var Mustache=require(_0x5bf2('0x6'));var util=require('util');var path=require(_0x5bf2('0x7'));var sox=require('sox');var csv=require(_0x5bf2('0x8'));var ejs=require(_0x5bf2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5bf2('0xa'));var squel=require(_0x5bf2('0xb'));var crypto=require(_0x5bf2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5bf2('0xd'));var toCsv=require(_0x5bf2('0x8'));var querystring=require(_0x5bf2('0xe'));var Papa=require('papaparse');var Redis=require(_0x5bf2('0xf'));var authService=require(_0x5bf2('0x10'));var qs=require(_0x5bf2('0x11'));var as=require(_0x5bf2('0x12'));var hardwareService=require(_0x5bf2('0x13'));var logger=require(_0x5bf2('0x14'))(_0x5bf2('0x15'));var utils=require(_0x5bf2('0x16'));var config=require(_0x5bf2('0x17'));var licenseUtil=require(_0x5bf2('0x18'));var db=require(_0x5bf2('0x19'))['db'];function respondWithStatusCode(_0x656dc6,_0x355620){_0x355620=_0x355620||0xcc;return function(_0x541e89){if(_0x541e89){return _0x656dc6['sendStatus'](_0x355620);}return _0x656dc6[_0x5bf2('0x1a')](_0x355620)[_0x5bf2('0x1b')]();};}function respondWithResult(_0x5d3cb6,_0x10c8a1){_0x10c8a1=_0x10c8a1||0xc8;return function(_0x43a83b){if(_0x43a83b){return _0x5d3cb6[_0x5bf2('0x1a')](_0x10c8a1)[_0x5bf2('0x1c')](_0x43a83b);}};}function respondWithFilteredResult(_0x15abc4,_0x277d50){return function(_0x3083cd){if(_0x3083cd){var _0xff9397=typeof _0x277d50[_0x5bf2('0x1d')]===_0x5bf2('0x1e')&&typeof _0x277d50[_0x5bf2('0x1f')]===_0x5bf2('0x1e');var _0x4d1990=_0x3083cd['count'];var _0x2f87ff=_0xff9397?0x0:_0x277d50['offset'];var _0x3df0cd=_0xff9397?_0x3083cd[_0x5bf2('0x20')]:_0x277d50['offset']+_0x277d50['limit'];var _0x3adc26;if(_0x3df0cd>=_0x4d1990){_0x3df0cd=_0x4d1990;_0x3adc26=0xc8;}else{_0x3adc26=0xce;}_0x15abc4[_0x5bf2('0x1a')](_0x3adc26);return _0x15abc4[_0x5bf2('0x21')](_0x5bf2('0x22'),_0x2f87ff+'-'+_0x3df0cd+'/'+_0x4d1990)[_0x5bf2('0x1c')](_0x3083cd);}return null;};}function patchUpdates(_0x3c97f5){return function(_0x3a9694){try{jsonpatch[_0x5bf2('0x23')](_0x3a9694,_0x3c97f5,!![]);}catch(_0x44bedc){return BPromise['reject'](_0x44bedc);}return _0x3a9694['save']();};}function saveUpdates(_0xe8c648,_0x3885e8){return function(_0x161ec2){if(_0x161ec2){return _0x161ec2[_0x5bf2('0x24')](_0xe8c648)[_0x5bf2('0x25')](function(_0x1cb9e1){return _0x1cb9e1;});}return null;};}function removeEntity(_0x37036d,_0x2eea63){return function(_0x239206){if(_0x239206){return _0x239206[_0x5bf2('0x26')]()[_0x5bf2('0x25')](function(){_0x37036d[_0x5bf2('0x1a')](0xcc)[_0x5bf2('0x1b')]();});}};}function handleEntityNotFound(_0x5ae161,_0x1a90e7){return function(_0x4d3067){if(!_0x4d3067){_0x5ae161[_0x5bf2('0x27')](0x194);}return _0x4d3067;};}function handleError(_0x1a0573,_0x569d26){_0x569d26=_0x569d26||0x1f4;return function(_0xc028a0){logger[_0x5bf2('0x28')](_0xc028a0['stack']);if(_0xc028a0['name']){delete _0xc028a0[_0x5bf2('0x29')];}_0x1a0573[_0x5bf2('0x1a')](_0x569d26)[_0x5bf2('0x2a')](_0xc028a0);};}exports[_0x5bf2('0x2b')]=function(_0x5ca619,_0x593d8e){var _0xe3d05e={},_0x3cb9e6={},_0x1ebd88={'count':0x0,'rows':[]};var _0x321621=_[_0x5bf2('0x2c')](db['ChatQueueReport'][_0x5bf2('0x2d')],function(_0x2ea937){return{'name':_0x2ea937[_0x5bf2('0x2e')],'type':_0x2ea937['type'][_0x5bf2('0x2f')]};});_0x3cb9e6[_0x5bf2('0x30')]=_[_0x5bf2('0x2c')](_0x321621,'name');_0x3cb9e6['query']=_['keys'](_0x5ca619[_0x5bf2('0x31')]);_0x3cb9e6[_0x5bf2('0x32')]=_[_0x5bf2('0x33')](_0x3cb9e6[_0x5bf2('0x30')],_0x3cb9e6[_0x5bf2('0x31')]);_0xe3d05e['attributes']=_['intersection'](_0x3cb9e6[_0x5bf2('0x30')],qs[_0x5bf2('0x34')](_0x5ca619[_0x5bf2('0x31')][_0x5bf2('0x34')]));_0xe3d05e[_0x5bf2('0x35')]=_0xe3d05e[_0x5bf2('0x35')][_0x5bf2('0x36')]?_0xe3d05e[_0x5bf2('0x35')]:_0x3cb9e6[_0x5bf2('0x30')];if(!_0x5ca619[_0x5bf2('0x31')][_0x5bf2('0x37')](_0x5bf2('0x38'))){_0xe3d05e[_0x5bf2('0x1f')]=qs['limit'](_0x5ca619[_0x5bf2('0x31')]['limit']);_0xe3d05e['offset']=qs['offset'](_0x5ca619['query'][_0x5bf2('0x1d')]);}_0xe3d05e[_0x5bf2('0x39')]=qs[_0x5bf2('0x3a')](_0x5ca619[_0x5bf2('0x31')][_0x5bf2('0x3a')]);_0xe3d05e['where']=qs['filters'](_['pick'](_0x5ca619[_0x5bf2('0x31')],_0x3cb9e6[_0x5bf2('0x32')]),_0x321621);if(_0x5ca619['query']['filter']){_0xe3d05e['where']=_['merge'](_0xe3d05e[_0x5bf2('0x3b')],{'$or':_['map'](_0x321621,function(_0x455a89){if(_0x455a89[_0x5bf2('0x3c')]!==_0x5bf2('0x3d')){var _0x1f926c={};_0x1f926c[_0x455a89[_0x5bf2('0x29')]]={'$like':'%'+_0x5ca619['query']['filter']+'%'};return _0x1f926c;}})});}_0xe3d05e=_[_0x5bf2('0x3e')]({},_0xe3d05e,_0x5ca619[_0x5bf2('0x3f')]);var _0x43abb2={'where':_0xe3d05e[_0x5bf2('0x3b')]};return db['ChatQueueReport']['count'](_0x43abb2)[_0x5bf2('0x25')](function(_0x29d56f){_0x1ebd88[_0x5bf2('0x20')]=_0x29d56f;if(_0x5ca619['query'][_0x5bf2('0x40')]){_0xe3d05e['include']=[{'all':!![]}];}return db[_0x5bf2('0x41')]['findAll'](_0xe3d05e);})[_0x5bf2('0x25')](function(_0x22e6d4){_0x1ebd88[_0x5bf2('0x42')]=_0x22e6d4;return _0x1ebd88;})[_0x5bf2('0x25')](respondWithFilteredResult(_0x593d8e,_0xe3d05e))[_0x5bf2('0x43')](handleError(_0x593d8e,null));};exports[_0x5bf2('0x44')]=function(_0xdd6c54,_0x512847){var _0x4fb02f={'raw':!![],'where':{'id':_0xdd6c54['params']['id']}},_0x1509c1={};_0x1509c1['model']=_[_0x5bf2('0x45')](db[_0x5bf2('0x41')][_0x5bf2('0x2d')]);_0x1509c1[_0x5bf2('0x31')]=_[_0x5bf2('0x45')](_0xdd6c54['query']);_0x1509c1[_0x5bf2('0x32')]=_[_0x5bf2('0x33')](_0x1509c1[_0x5bf2('0x30')],_0x1509c1['query']);_0x4fb02f[_0x5bf2('0x35')]=_['intersection'](_0x1509c1[_0x5bf2('0x30')],qs[_0x5bf2('0x34')](_0xdd6c54['query'][_0x5bf2('0x34')]));_0x4fb02f['attributes']=_0x4fb02f['attributes'][_0x5bf2('0x36')]?_0x4fb02f['attributes']:_0x1509c1['model'];if(_0xdd6c54['query'][_0x5bf2('0x40')]){_0x4fb02f[_0x5bf2('0x46')]=[{'all':!![]}];}_0x4fb02f=_['merge']({},_0x4fb02f,_0xdd6c54[_0x5bf2('0x3f')]);return db[_0x5bf2('0x41')][_0x5bf2('0x47')](_0x4fb02f)[_0x5bf2('0x25')](handleEntityNotFound(_0x512847,null))['then'](respondWithResult(_0x512847,null))[_0x5bf2('0x43')](handleError(_0x512847,null));};exports[_0x5bf2('0x48')]=function(_0x58df98,_0x5b09c7){return db[_0x5bf2('0x41')]['create'](_0x58df98[_0x5bf2('0x49')],{})[_0x5bf2('0x25')](respondWithResult(_0x5b09c7,0xc9))['catch'](handleError(_0x5b09c7,null));};exports['update']=function(_0x3a58fe,_0x4a2b21){if(_0x3a58fe[_0x5bf2('0x49')]['id']){delete _0x3a58fe['body']['id'];}return db['ChatQueueReport'][_0x5bf2('0x47')]({'where':{'id':_0x3a58fe[_0x5bf2('0x4a')]['id']}})[_0x5bf2('0x25')](handleEntityNotFound(_0x4a2b21,null))['then'](saveUpdates(_0x3a58fe[_0x5bf2('0x49')],null))[_0x5bf2('0x25')](respondWithResult(_0x4a2b21,null))['catch'](handleError(_0x4a2b21,null));};exports['destroy']=function(_0x141747,_0x4a0c21){return db[_0x5bf2('0x41')][_0x5bf2('0x47')]({'where':{'id':_0x141747['params']['id']}})['then'](handleEntityNotFound(_0x4a0c21,null))[_0x5bf2('0x25')](removeEntity(_0x4a0c21,null))[_0x5bf2('0x43')](handleError(_0x4a0c21,null));};exports[_0x5bf2('0x4b')]=function(_0x393ccc,_0x5ee857){return db[_0x5bf2('0x41')][_0x5bf2('0x4b')]()[_0x5bf2('0x25')](respondWithResult(_0x5ee857,null))[_0x5bf2('0x43')](handleError(_0x5ee857,null));}; \ No newline at end of file +var _0x7c71=['bluebird','mustache','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','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5ee719,_0xa34b72){var _0x2a21ee=function(_0x1d047c){while(--_0x1d047c){_0x5ee719['push'](_0x5ee719['shift']());}};_0x2a21ee(++_0xa34b72);}(_0x7c71,0x177));var _0x17c7=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x7c71[_0x1db481];return _0x3db95b;};'use strict';var emlformat=require(_0x17c7('0x0'));var rimraf=require(_0x17c7('0x1'));var zipdir=require(_0x17c7('0x2'));var jsonpatch=require(_0x17c7('0x3'));var rp=require('request-promise');var moment=require(_0x17c7('0x4'));var BPromise=require(_0x17c7('0x5'));var Mustache=require(_0x17c7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x17c7('0x7'));var csv=require(_0x17c7('0x8'));var ejs=require(_0x17c7('0x9'));var fs=require('fs');var fs_extra=require(_0x17c7('0xa'));var _=require(_0x17c7('0xb'));var squel=require(_0x17c7('0xc'));var crypto=require(_0x17c7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x17c7('0xe'));var toCsv=require(_0x17c7('0x8'));var querystring=require(_0x17c7('0xf'));var Papa=require(_0x17c7('0x10'));var Redis=require(_0x17c7('0x11'));var authService=require(_0x17c7('0x12'));var qs=require(_0x17c7('0x13'));var as=require(_0x17c7('0x14'));var hardwareService=require(_0x17c7('0x15'));var logger=require(_0x17c7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x17c7('0x17'));var licenseUtil=require(_0x17c7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x430506,_0x22ad50){_0x22ad50=_0x22ad50||0xcc;return function(_0x4fd6af){if(_0x4fd6af){return _0x430506[_0x17c7('0x19')](_0x22ad50);}return _0x430506[_0x17c7('0x1a')](_0x22ad50)['end']();};}function respondWithResult(_0x56ef3b,_0xfae300){_0xfae300=_0xfae300||0xc8;return function(_0x2d980d){if(_0x2d980d){return _0x56ef3b[_0x17c7('0x1a')](_0xfae300)[_0x17c7('0x1b')](_0x2d980d);}};}function respondWithFilteredResult(_0x3d0fb2,_0x2851){return function(_0x2c992f){if(_0x2c992f){var _0x295168=typeof _0x2851[_0x17c7('0x1c')]===_0x17c7('0x1d')&&typeof _0x2851[_0x17c7('0x1e')]===_0x17c7('0x1d');var _0x5470ab=_0x2c992f[_0x17c7('0x1f')];var _0x81d998=_0x295168?0x0:_0x2851['offset'];var _0x42d06c=_0x295168?_0x2c992f[_0x17c7('0x1f')]:_0x2851[_0x17c7('0x1c')]+_0x2851[_0x17c7('0x1e')];var _0x5b9e72;if(_0x42d06c>=_0x5470ab){_0x42d06c=_0x5470ab;_0x5b9e72=0xc8;}else{_0x5b9e72=0xce;}_0x3d0fb2['status'](_0x5b9e72);return _0x3d0fb2[_0x17c7('0x20')](_0x17c7('0x21'),_0x81d998+'-'+_0x42d06c+'/'+_0x5470ab)[_0x17c7('0x1b')](_0x2c992f);}return null;};}function patchUpdates(_0x86956b){return function(_0x2579b7){try{jsonpatch[_0x17c7('0x22')](_0x2579b7,_0x86956b,!![]);}catch(_0x357c27){return BPromise['reject'](_0x357c27);}return _0x2579b7[_0x17c7('0x23')]();};}function saveUpdates(_0x3885c8,_0x3c25ba){return function(_0x16700d){if(_0x16700d){return _0x16700d[_0x17c7('0x24')](_0x3885c8)[_0x17c7('0x25')](function(_0x29a4ac){return _0x29a4ac;});}return null;};}function removeEntity(_0x196e0e,_0x512c3c){return function(_0x312373){if(_0x312373){return _0x312373[_0x17c7('0x26')]()[_0x17c7('0x25')](function(){_0x196e0e[_0x17c7('0x1a')](0xcc)[_0x17c7('0x27')]();});}};}function handleEntityNotFound(_0xa6cfe5,_0x4eb516){return function(_0x36236d){if(!_0x36236d){_0xa6cfe5[_0x17c7('0x19')](0x194);}return _0x36236d;};}function handleError(_0x5e21ec,_0x30a3be){_0x30a3be=_0x30a3be||0x1f4;return function(_0x4d2460){logger[_0x17c7('0x28')](_0x4d2460[_0x17c7('0x29')]);if(_0x4d2460['name']){delete _0x4d2460[_0x17c7('0x2a')];}_0x5e21ec[_0x17c7('0x1a')](_0x30a3be)[_0x17c7('0x2b')](_0x4d2460);};}exports[_0x17c7('0x2c')]=function(_0xe6f177,_0xc6d7b2){var _0x3ca9d3={},_0x14ddac={},_0x3ccf3b={'count':0x0,'rows':[]};var _0x24a2cc=_[_0x17c7('0x2d')](db[_0x17c7('0x2e')][_0x17c7('0x2f')],function(_0xd38b0b){return{'name':_0xd38b0b['fieldName'],'type':_0xd38b0b[_0x17c7('0x30')]['key']};});_0x14ddac[_0x17c7('0x31')]=_[_0x17c7('0x2d')](_0x24a2cc,_0x17c7('0x2a'));_0x14ddac[_0x17c7('0x32')]=_[_0x17c7('0x33')](_0xe6f177['query']);_0x14ddac['filters']=_[_0x17c7('0x34')](_0x14ddac[_0x17c7('0x31')],_0x14ddac[_0x17c7('0x32')]);_0x3ca9d3[_0x17c7('0x35')]=_[_0x17c7('0x34')](_0x14ddac[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0xe6f177[_0x17c7('0x32')][_0x17c7('0x36')]));_0x3ca9d3['attributes']=_0x3ca9d3[_0x17c7('0x35')][_0x17c7('0x37')]?_0x3ca9d3[_0x17c7('0x35')]:_0x14ddac['model'];if(!_0xe6f177[_0x17c7('0x32')][_0x17c7('0x38')](_0x17c7('0x39'))){_0x3ca9d3[_0x17c7('0x1e')]=qs[_0x17c7('0x1e')](_0xe6f177[_0x17c7('0x32')][_0x17c7('0x1e')]);_0x3ca9d3['offset']=qs['offset'](_0xe6f177['query'][_0x17c7('0x1c')]);}_0x3ca9d3['order']=qs[_0x17c7('0x3a')](_0xe6f177[_0x17c7('0x32')][_0x17c7('0x3a')]);_0x3ca9d3['where']=qs[_0x17c7('0x3b')](_['pick'](_0xe6f177['query'],_0x14ddac[_0x17c7('0x3b')]),_0x24a2cc);if(_0xe6f177[_0x17c7('0x32')][_0x17c7('0x3c')]){_0x3ca9d3[_0x17c7('0x3d')]=_[_0x17c7('0x3e')](_0x3ca9d3[_0x17c7('0x3d')],{'$or':_[_0x17c7('0x2d')](_0x24a2cc,function(_0x342b18){if(_0x342b18[_0x17c7('0x30')]!==_0x17c7('0x3f')){var _0x4ae7a6={};_0x4ae7a6[_0x342b18[_0x17c7('0x2a')]]={'$like':'%'+_0xe6f177[_0x17c7('0x32')][_0x17c7('0x3c')]+'%'};return _0x4ae7a6;}})});}_0x3ca9d3=_[_0x17c7('0x3e')]({},_0x3ca9d3,_0xe6f177[_0x17c7('0x40')]);var _0xbd845c={'where':_0x3ca9d3['where']};return db[_0x17c7('0x2e')][_0x17c7('0x1f')](_0xbd845c)[_0x17c7('0x25')](function(_0x21f15d){_0x3ccf3b[_0x17c7('0x1f')]=_0x21f15d;if(_0xe6f177[_0x17c7('0x32')][_0x17c7('0x41')]){_0x3ca9d3['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x17c7('0x42')](_0x3ca9d3);})[_0x17c7('0x25')](function(_0xef91f1){_0x3ccf3b[_0x17c7('0x43')]=_0xef91f1;return _0x3ccf3b;})[_0x17c7('0x25')](respondWithFilteredResult(_0xc6d7b2,_0x3ca9d3))['catch'](handleError(_0xc6d7b2,null));};exports[_0x17c7('0x44')]=function(_0x2813ef,_0x5b45db){var _0x13420f={'raw':!![],'where':{'id':_0x2813ef['params']['id']}},_0x3d4f9d={};_0x3d4f9d[_0x17c7('0x31')]=_[_0x17c7('0x33')](db[_0x17c7('0x2e')]['rawAttributes']);_0x3d4f9d['query']=_[_0x17c7('0x33')](_0x2813ef[_0x17c7('0x32')]);_0x3d4f9d[_0x17c7('0x3b')]=_['intersection'](_0x3d4f9d[_0x17c7('0x31')],_0x3d4f9d['query']);_0x13420f[_0x17c7('0x35')]=_['intersection'](_0x3d4f9d[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0x2813ef[_0x17c7('0x32')]['fields']));_0x13420f[_0x17c7('0x35')]=_0x13420f[_0x17c7('0x35')][_0x17c7('0x37')]?_0x13420f[_0x17c7('0x35')]:_0x3d4f9d[_0x17c7('0x31')];if(_0x2813ef[_0x17c7('0x32')][_0x17c7('0x41')]){_0x13420f[_0x17c7('0x45')]=[{'all':!![]}];}_0x13420f=_[_0x17c7('0x3e')]({},_0x13420f,_0x2813ef[_0x17c7('0x40')]);return db['ChatQueueReport'][_0x17c7('0x46')](_0x13420f)['then'](handleEntityNotFound(_0x5b45db,null))[_0x17c7('0x25')](respondWithResult(_0x5b45db,null))['catch'](handleError(_0x5b45db,null));};exports[_0x17c7('0x47')]=function(_0x48d0e5,_0x3b2e65){return db[_0x17c7('0x2e')]['create'](_0x48d0e5['body'],{})[_0x17c7('0x25')](respondWithResult(_0x3b2e65,0xc9))[_0x17c7('0x48')](handleError(_0x3b2e65,null));};exports[_0x17c7('0x24')]=function(_0x32d007,_0x2f1136){if(_0x32d007[_0x17c7('0x49')]['id']){delete _0x32d007[_0x17c7('0x49')]['id'];}return db[_0x17c7('0x2e')]['find']({'where':{'id':_0x32d007[_0x17c7('0x4a')]['id']}})[_0x17c7('0x25')](handleEntityNotFound(_0x2f1136,null))[_0x17c7('0x25')](saveUpdates(_0x32d007[_0x17c7('0x49')],null))[_0x17c7('0x25')](respondWithResult(_0x2f1136,null))[_0x17c7('0x48')](handleError(_0x2f1136,null));};exports[_0x17c7('0x26')]=function(_0x5166c0,_0xb2bb36){return db[_0x17c7('0x2e')]['find']({'where':{'id':_0x5166c0[_0x17c7('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb2bb36,null))[_0x17c7('0x25')](removeEntity(_0xb2bb36,null))[_0x17c7('0x48')](handleError(_0xb2bb36,null));};exports[_0x17c7('0x4b')]=function(_0x292d21,_0x6519f2){return db[_0x17c7('0x2e')][_0x17c7('0x4b')]()[_0x17c7('0x25')](respondWithResult(_0x6519f2,null))[_0x17c7('0x48')](handleError(_0x6519f2,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 5b1ff8a..83a01a0 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x4c658f,_0x311d94){var _0x326899=function(_0x97ce6c){while(--_0x97ce6c){_0x4c658f['push'](_0x4c658f['shift']());}};_0x326899(++_0x311d94);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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 +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5c6680,_0x3dfdb7){var _0x438b0d=function(_0x375da8){while(--_0x375da8){_0x5c6680['push'](_0x5c6680['shift']());}};_0x438b0d(++_0x3dfdb7);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index a77b782..500657c 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 _0xe9e8=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','then','lodash','util','bluebird','randomstring'];(function(_0x9a3a5d,_0x39428b){var _0x534b99=function(_0x1194d4){while(--_0x1194d4){_0x9a3a5d['push'](_0x9a3a5d['shift']());}};_0x534b99(++_0x39428b);}(_0xe9e8,0x13c));var _0x8e9e=function(_0x27f548,_0x1f6776){_0x27f548=_0x27f548-0x0;var _0x3cc35b=_0xe9e8[_0x27f548];return _0x3cc35b;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require('moment');var BPromise=require(_0x8e9e('0x2'));var rs=require(_0x8e9e('0x3'));var fs=require('fs');var Redis=require(_0x8e9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x5'))(_0x8e9e('0x6'));var config=require(_0x8e9e('0x7'));var jayson=require(_0x8e9e('0x8'));var client=jayson[_0x8e9e('0x9')][_0x8e9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36d094,_0x306c73,_0x1a55e5){return new BPromise(function(_0x54e33e,_0x5c53c6){return client[_0x8e9e('0xb')](_0x36d094,_0x1a55e5)['then'](function(_0x168628){logger[_0x8e9e('0xc')](_0x8e9e('0xd'),_0x306c73,_0x8e9e('0xe'));logger[_0x8e9e('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x306c73,_0x8e9e('0xe'),JSON[_0x8e9e('0x10')](_0x168628));if(_0x168628['error']){if(_0x168628['error'][_0x8e9e('0x11')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x306c73,_0x168628[_0x8e9e('0x12')][_0x8e9e('0x13')]);return _0x5c53c6(_0x168628[_0x8e9e('0x12')]['message']);}logger[_0x8e9e('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x306c73,_0x168628['error'][_0x8e9e('0x13')]);return _0x54e33e(_0x168628[_0x8e9e('0x12')][_0x8e9e('0x13')]);}else{logger['info'](_0x8e9e('0xd'),_0x306c73,_0x8e9e('0xe'));_0x54e33e(_0x168628['result'][_0x8e9e('0x13')]);}})[_0x8e9e('0x14')](function(_0xad9fe){logger['error'](_0x8e9e('0xd'),_0x306c73,_0xad9fe);_0x5c53c6(_0xad9fe);});});}exports[_0x8e9e('0x15')]=function(_0xadec15){var _0x5245e8=this;return new Promise(function(_0xa30834,_0x72f95e){return db[_0x8e9e('0x16')][_0x8e9e('0x17')](_0xadec15[_0x8e9e('0x18')],{'raw':_0xadec15[_0x8e9e('0x19')]?_0xadec15[_0x8e9e('0x19')][_0x8e9e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x575344){logger['info'](_0x8e9e('0x15'),_0xadec15);logger[_0x8e9e('0xf')](_0x8e9e('0x15'),_0xadec15,JSON[_0x8e9e('0x10')](_0x575344));_0xa30834(_0x575344);})[_0x8e9e('0x14')](function(_0xed53ff){logger['error'](_0x8e9e('0x15'),_0xed53ff[_0x8e9e('0x13')],_0xadec15);_0x72f95e(_0x5245e8[_0x8e9e('0x12')](0x1f4,_0xed53ff[_0x8e9e('0x13')]));});});};exports[_0x8e9e('0x1b')]=function(_0xd1b10b){var _0x3404ac=this;return new Promise(function(_0x4831f8,_0x2e08b1){return db[_0x8e9e('0x16')][_0x8e9e('0x1c')](_0xd1b10b[_0x8e9e('0x18')],{'raw':_0xd1b10b[_0x8e9e('0x19')]?_0xd1b10b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd1b10b['options']?_0xd1b10b['options'][_0x8e9e('0x1d')]||null:null,'attributes':_0xd1b10b['options']?_0xd1b10b[_0x8e9e('0x19')][_0x8e9e('0x1e')]||null:null,'limit':_0xd1b10b[_0x8e9e('0x19')]?_0xd1b10b[_0x8e9e('0x19')]['limit']||null:null})[_0x8e9e('0x1f')](function(_0x39d131){logger[_0x8e9e('0xc')](_0x8e9e('0x1b'),_0xd1b10b);logger[_0x8e9e('0xf')](_0x8e9e('0x1b'),_0xd1b10b,JSON[_0x8e9e('0x10')](_0x39d131));_0x4831f8(_0x39d131);})[_0x8e9e('0x14')](function(_0xd34546){logger[_0x8e9e('0x12')](_0x8e9e('0x1b'),_0xd34546[_0x8e9e('0x13')],_0xd1b10b);_0x2e08b1(_0x3404ac['error'](0x1f4,_0xd34546['message']));});});}; \ No newline at end of file +var _0xb676=['body','options','raw','stringify','UpdateChatQueueReport','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x287553,_0x18a6cc){var _0x53e958=function(_0x38aa43){while(--_0x38aa43){_0x287553['push'](_0x287553['shift']());}};_0x53e958(++_0x18a6cc);}(_0xb676,0xbc));var _0x6b67=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb676[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x6b67('0x0'));var util=require('util');var moment=require(_0x6b67('0x1'));var BPromise=require(_0x6b67('0x2'));var rs=require(_0x6b67('0x3'));var fs=require('fs');var Redis=require(_0x6b67('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6b67('0x5'))(_0x6b67('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b67('0x7'));var client=jayson['client'][_0x6b67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45cab7,_0x3e10b4,_0x5a28e3){return new BPromise(function(_0x5659fc,_0x1f3234){return client[_0x6b67('0x9')](_0x45cab7,_0x5a28e3)['then'](function(_0xd783d8){logger[_0x6b67('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x3e10b4,_0x6b67('0xb'));logger[_0x6b67('0xc')](_0x6b67('0xd'),_0x3e10b4,_0x6b67('0xb'),JSON['stringify'](_0xd783d8));if(_0xd783d8[_0x6b67('0xe')]){if(_0xd783d8['error'][_0x6b67('0xf')]===0x1f4){logger[_0x6b67('0xe')](_0x6b67('0x10'),_0x3e10b4,_0xd783d8[_0x6b67('0xe')][_0x6b67('0x11')]);return _0x1f3234(_0xd783d8[_0x6b67('0xe')][_0x6b67('0x11')]);}logger[_0x6b67('0xe')](_0x6b67('0x10'),_0x3e10b4,_0xd783d8[_0x6b67('0xe')][_0x6b67('0x11')]);return _0x5659fc(_0xd783d8['error'][_0x6b67('0x11')]);}else{logger[_0x6b67('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x3e10b4,_0x6b67('0xb'));_0x5659fc(_0xd783d8[_0x6b67('0x12')][_0x6b67('0x11')]);}})[_0x6b67('0x13')](function(_0x4dc50f){logger[_0x6b67('0xe')](_0x6b67('0x10'),_0x3e10b4,_0x4dc50f);_0x1f3234(_0x4dc50f);});});}exports[_0x6b67('0x14')]=function(_0x46d828){var _0x1b54b5=this;return new Promise(function(_0x37d964,_0x5613da){return db[_0x6b67('0x15')]['create'](_0x46d828[_0x6b67('0x16')],{'raw':_0x46d828[_0x6b67('0x17')]?_0x46d828[_0x6b67('0x17')][_0x6b67('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xd36be3){logger[_0x6b67('0xa')](_0x6b67('0x14'),_0x46d828);logger['debug'](_0x6b67('0x14'),_0x46d828,JSON[_0x6b67('0x19')](_0xd36be3));_0x37d964(_0xd36be3);})[_0x6b67('0x13')](function(_0x4d48e1){logger[_0x6b67('0xe')](_0x6b67('0x14'),_0x4d48e1[_0x6b67('0x11')],_0x46d828);_0x5613da(_0x1b54b5[_0x6b67('0xe')](0x1f4,_0x4d48e1[_0x6b67('0x11')]));});});};exports[_0x6b67('0x1a')]=function(_0x3c89d2){var _0x326484=this;return new Promise(function(_0x188ed7,_0x39bfb2){return db[_0x6b67('0x15')]['update'](_0x3c89d2[_0x6b67('0x16')],{'raw':_0x3c89d2[_0x6b67('0x17')]?_0x3c89d2[_0x6b67('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c89d2[_0x6b67('0x17')]?_0x3c89d2[_0x6b67('0x17')]['where']||null:null,'attributes':_0x3c89d2[_0x6b67('0x17')]?_0x3c89d2[_0x6b67('0x17')][_0x6b67('0x1b')]||null:null,'limit':_0x3c89d2[_0x6b67('0x17')]?_0x3c89d2[_0x6b67('0x17')][_0x6b67('0x1c')]||null:null})[_0x6b67('0x1d')](function(_0x5d9f6d){logger[_0x6b67('0xa')](_0x6b67('0x1a'),_0x3c89d2);logger[_0x6b67('0xc')](_0x6b67('0x1a'),_0x3c89d2,JSON[_0x6b67('0x19')](_0x5d9f6d));_0x188ed7(_0x5d9f6d);})[_0x6b67('0x13')](function(_0x3c3262){logger[_0x6b67('0xe')]('UpdateChatQueueReport',_0x3c3262[_0x6b67('0x11')],_0x3c89d2);_0x39bfb2(_0x326484[_0x6b67('0xe')](0x1f4,_0x3c3262[_0x6b67('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4354b66..8434e72 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 _0x2a92=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','put'];(function(_0x5f4b7c,_0x28b472){var _0x38e043=function(_0x569135){while(--_0x569135){_0x5f4b7c['push'](_0x5f4b7c['shift']());}};_0x38e043(++_0x28b472);}(_0x2a92,0x178));var _0x22a9=function(_0x33d431,_0xf591fb){_0x33d431=_0x33d431-0x0;var _0xad1bc8=_0x2a92[_0x33d431];return _0xad1bc8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x22a9('0x0'));var timeout=require(_0x22a9('0x1'));var express=require(_0x22a9('0x2'));var router=express[_0x22a9('0x3')]();var fs_extra=require(_0x22a9('0x4'));var auth=require(_0x22a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22a9('0x6'));var controller=require('./chatQueueReport.controller');router[_0x22a9('0x7')]('/',auth[_0x22a9('0x8')](),controller['index']);router[_0x22a9('0x7')](_0x22a9('0x9'),auth[_0x22a9('0x8')](),controller[_0x22a9('0xa')]);router['get'](_0x22a9('0xb'),auth['isAuthenticated'](),controller[_0x22a9('0xc')]);router[_0x22a9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x22a9('0xe')]('/:id',auth[_0x22a9('0x8')](),controller['update']);router['delete']('/:id',auth[_0x22a9('0x8')](),controller[_0x22a9('0xf')]);module[_0x22a9('0x10')]=router; \ No newline at end of file +var _0xe11d=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','update'];(function(_0x5e0356,_0xea7356){var _0x17bd7f=function(_0x2c3aee){while(--_0x2c3aee){_0x5e0356['push'](_0x5e0356['shift']());}};_0x17bd7f(++_0xea7356);}(_0xe11d,0x1a7));var _0xde11=function(_0x4aedab,_0x1a6416){_0x4aedab=_0x4aedab-0x0;var _0x38f1d8=_0xe11d[_0x4aedab];return _0x38f1d8;};'use strict';var multer=require(_0xde11('0x0'));var util=require(_0xde11('0x1'));var path=require('path');var timeout=require(_0xde11('0x2'));var express=require(_0xde11('0x3'));var router=express[_0xde11('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xde11('0x5'));var interaction=require(_0xde11('0x6'));var config=require(_0xde11('0x7'));var controller=require(_0xde11('0x8'));router[_0xde11('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xde11('0x9')](_0xde11('0xa'),auth[_0xde11('0xb')](),controller[_0xde11('0xc')]);router[_0xde11('0x9')](_0xde11('0xd'),auth[_0xde11('0xb')](),controller[_0xde11('0xe')]);router[_0xde11('0xf')]('/',auth[_0xde11('0xb')](),controller[_0xde11('0x10')]);router['put'](_0xde11('0xd'),auth['isAuthenticated'](),controller[_0xde11('0x11')]);router[_0xde11('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xde11('0x13')]);module[_0xde11('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 8041998..a7d887a 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x52cc77,_0x32a459){var _0x3a9b16=function(_0x2aa802){while(--_0x2aa802){_0x52cc77['push'](_0x52cc77['shift']());}};_0x3a9b16(++_0x32a459);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0xf3cd[_0x5a7f64];return _0x3d30f1;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3c4856,_0x98f049){var _0xba2cac=function(_0x16fedc){while(--_0x16fedc){_0x3c4856['push'](_0x3c4856['shift']());}};_0xba2cac(++_0x98f049);}(_0x34e8,0x12c));var _0x834e=function(_0x3b7266,_0x1d30ef){_0x3b7266=_0x3b7266-0x0;var _0x5d7446=_0x34e8[_0x3b7266];return _0x5d7446;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 4033a6c..8ba63c8 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 _0xd16e=['include','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','VIRTUAL','options','includeAll'];(function(_0x45c477,_0x4b4db3){var _0x29002b=function(_0x10fcd6){while(--_0x10fcd6){_0x45c477['push'](_0x45c477['shift']());}};_0x29002b(++_0x4b4db3);}(_0xd16e,0x139));var _0xed16=function(_0x59c752,_0x9d20e7){_0x59c752=_0x59c752-0x0;var _0xd97090=_0xd16e[_0x59c752];return _0xd97090;};'use strict';var emlformat=require(_0xed16('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed16('0x1'));var jsonpatch=require(_0xed16('0x2'));var rp=require(_0xed16('0x3'));var moment=require(_0xed16('0x4'));var BPromise=require(_0xed16('0x5'));var Mustache=require(_0xed16('0x6'));var util=require('util');var path=require(_0xed16('0x7'));var sox=require(_0xed16('0x8'));var csv=require(_0xed16('0x9'));var ejs=require(_0xed16('0xa'));var fs=require('fs');var fs_extra=require(_0xed16('0xb'));var _=require(_0xed16('0xc'));var squel=require(_0xed16('0xd'));var crypto=require(_0xed16('0xe'));var jsforce=require(_0xed16('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xed16('0x9'));var querystring=require(_0xed16('0x10'));var Papa=require(_0xed16('0x11'));var Redis=require(_0xed16('0x12'));var authService=require(_0xed16('0x13'));var qs=require(_0xed16('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed16('0x15'));var logger=require(_0xed16('0x16'))(_0xed16('0x17'));var utils=require(_0xed16('0x18'));var config=require(_0xed16('0x19'));var licenseUtil=require(_0xed16('0x1a'));var db=require(_0xed16('0x1b'))['db'];function respondWithStatusCode(_0x505c8f,_0x54fa09){_0x54fa09=_0x54fa09||0xcc;return function(_0x15e169){if(_0x15e169){return _0x505c8f[_0xed16('0x1c')](_0x54fa09);}return _0x505c8f['status'](_0x54fa09)[_0xed16('0x1d')]();};}function respondWithResult(_0x3801e2,_0x2cbafc){_0x2cbafc=_0x2cbafc||0xc8;return function(_0x57e719){if(_0x57e719){return _0x3801e2['status'](_0x2cbafc)['json'](_0x57e719);}};}function respondWithFilteredResult(_0xb86b27,_0x3e6a9a){return function(_0x19fbd9){if(_0x19fbd9){var _0x1f8f93=typeof _0x3e6a9a['offset']===_0xed16('0x1e')&&typeof _0x3e6a9a['limit']===_0xed16('0x1e');var _0x4e93ed=_0x19fbd9[_0xed16('0x1f')];var _0xf50f6c=_0x1f8f93?0x0:_0x3e6a9a[_0xed16('0x20')];var _0x1d0fdd=_0x1f8f93?_0x19fbd9[_0xed16('0x1f')]:_0x3e6a9a[_0xed16('0x20')]+_0x3e6a9a[_0xed16('0x21')];var _0x41f068;if(_0x1d0fdd>=_0x4e93ed){_0x1d0fdd=_0x4e93ed;_0x41f068=0xc8;}else{_0x41f068=0xce;}_0xb86b27[_0xed16('0x22')](_0x41f068);return _0xb86b27[_0xed16('0x23')](_0xed16('0x24'),_0xf50f6c+'-'+_0x1d0fdd+'/'+_0x4e93ed)['json'](_0x19fbd9);}return null;};}function patchUpdates(_0x308107){return function(_0x2079e1){try{jsonpatch[_0xed16('0x25')](_0x2079e1,_0x308107,!![]);}catch(_0x9b7d04){return BPromise[_0xed16('0x26')](_0x9b7d04);}return _0x2079e1['save']();};}function saveUpdates(_0x55cb64,_0x4a52b0){return function(_0x4e53ae){if(_0x4e53ae){return _0x4e53ae['update'](_0x55cb64)['then'](function(_0x357ca8){return _0x357ca8;});}return null;};}function removeEntity(_0x232c70,_0x45c6a8){return function(_0x3e3e1e){if(_0x3e3e1e){return _0x3e3e1e[_0xed16('0x27')]()[_0xed16('0x28')](function(){_0x232c70[_0xed16('0x22')](0xcc)[_0xed16('0x1d')]();});}};}function handleEntityNotFound(_0x48cf4d,_0x2e3327){return function(_0x33360b){if(!_0x33360b){_0x48cf4d[_0xed16('0x1c')](0x194);}return _0x33360b;};}function handleError(_0x14cfc7,_0x4f8b17){_0x4f8b17=_0x4f8b17||0x1f4;return function(_0x526b05){logger[_0xed16('0x29')](_0x526b05[_0xed16('0x2a')]);if(_0x526b05[_0xed16('0x2b')]){delete _0x526b05[_0xed16('0x2b')];}_0x14cfc7[_0xed16('0x22')](_0x4f8b17)[_0xed16('0x2c')](_0x526b05);};}exports[_0xed16('0x2d')]=function(_0x2a0f03,_0x1c7ed3){var _0x1ad83e={},_0x438032={},_0xac138c={'count':0x0,'rows':[]};var _0x63a6f3=_['map'](db[_0xed16('0x2e')][_0xed16('0x2f')],function(_0x201e0d){return{'name':_0x201e0d[_0xed16('0x30')],'type':_0x201e0d[_0xed16('0x31')]['key']};});_0x438032['model']=_['map'](_0x63a6f3,_0xed16('0x2b'));_0x438032[_0xed16('0x32')]=_[_0xed16('0x33')](_0x2a0f03['query']);_0x438032[_0xed16('0x34')]=_[_0xed16('0x35')](_0x438032[_0xed16('0x36')],_0x438032[_0xed16('0x32')]);_0x1ad83e[_0xed16('0x37')]=_['intersection'](_0x438032[_0xed16('0x36')],qs[_0xed16('0x38')](_0x2a0f03['query'][_0xed16('0x38')]));_0x1ad83e['attributes']=_0x1ad83e['attributes'][_0xed16('0x39')]?_0x1ad83e[_0xed16('0x37')]:_0x438032[_0xed16('0x36')];if(!_0x2a0f03['query'][_0xed16('0x3a')]('nolimit')){_0x1ad83e[_0xed16('0x21')]=qs[_0xed16('0x21')](_0x2a0f03[_0xed16('0x32')][_0xed16('0x21')]);_0x1ad83e[_0xed16('0x20')]=qs[_0xed16('0x20')](_0x2a0f03['query'][_0xed16('0x20')]);}_0x1ad83e['order']=qs[_0xed16('0x3b')](_0x2a0f03['query'][_0xed16('0x3b')]);_0x1ad83e[_0xed16('0x3c')]=qs[_0xed16('0x34')](_['pick'](_0x2a0f03[_0xed16('0x32')],_0x438032[_0xed16('0x34')]),_0x63a6f3);if(_0x2a0f03[_0xed16('0x32')][_0xed16('0x3d')]){_0x1ad83e[_0xed16('0x3c')]=_[_0xed16('0x3e')](_0x1ad83e[_0xed16('0x3c')],{'$or':_[_0xed16('0x3f')](_0x63a6f3,function(_0x3e05f6){if(_0x3e05f6[_0xed16('0x31')]!==_0xed16('0x40')){var _0x1c1132={};_0x1c1132[_0x3e05f6[_0xed16('0x2b')]]={'$like':'%'+_0x2a0f03['query']['filter']+'%'};return _0x1c1132;}})});}_0x1ad83e=_[_0xed16('0x3e')]({},_0x1ad83e,_0x2a0f03[_0xed16('0x41')]);var _0x28048b={'where':_0x1ad83e[_0xed16('0x3c')]};return db['ChatTransferReport'][_0xed16('0x1f')](_0x28048b)['then'](function(_0x3e326b){_0xac138c[_0xed16('0x1f')]=_0x3e326b;if(_0x2a0f03[_0xed16('0x32')][_0xed16('0x42')]){_0x1ad83e[_0xed16('0x43')]=[{'all':!![]}];}return db[_0xed16('0x2e')][_0xed16('0x44')](_0x1ad83e);})[_0xed16('0x28')](function(_0x2ffa5d){_0xac138c['rows']=_0x2ffa5d;return _0xac138c;})[_0xed16('0x28')](respondWithFilteredResult(_0x1c7ed3,_0x1ad83e))[_0xed16('0x45')](handleError(_0x1c7ed3,null));};exports[_0xed16('0x46')]=function(_0x480499,_0x1f408d){var _0x1068bd={'raw':!![],'where':{'id':_0x480499[_0xed16('0x47')]['id']}},_0x565405={};_0x565405[_0xed16('0x36')]=_['keys'](db['ChatTransferReport'][_0xed16('0x2f')]);_0x565405[_0xed16('0x32')]=_[_0xed16('0x33')](_0x480499[_0xed16('0x32')]);_0x565405[_0xed16('0x34')]=_[_0xed16('0x35')](_0x565405[_0xed16('0x36')],_0x565405[_0xed16('0x32')]);_0x1068bd[_0xed16('0x37')]=_['intersection'](_0x565405[_0xed16('0x36')],qs[_0xed16('0x38')](_0x480499[_0xed16('0x32')]['fields']));_0x1068bd[_0xed16('0x37')]=_0x1068bd['attributes'][_0xed16('0x39')]?_0x1068bd[_0xed16('0x37')]:_0x565405[_0xed16('0x36')];if(_0x480499[_0xed16('0x32')]['includeAll']){_0x1068bd['include']=[{'all':!![]}];}_0x1068bd=_['merge']({},_0x1068bd,_0x480499[_0xed16('0x41')]);return db['ChatTransferReport'][_0xed16('0x48')](_0x1068bd)[_0xed16('0x28')](handleEntityNotFound(_0x1f408d,null))[_0xed16('0x28')](respondWithResult(_0x1f408d,null))['catch'](handleError(_0x1f408d,null));};exports[_0xed16('0x49')]=function(_0x4d494a,_0x36224e){return db[_0xed16('0x2e')][_0xed16('0x49')](_0x4d494a[_0xed16('0x4a')],{})[_0xed16('0x28')](respondWithResult(_0x36224e,0xc9))[_0xed16('0x45')](handleError(_0x36224e,null));};exports[_0xed16('0x4b')]=function(_0xb777c,_0x1baa29){if(_0xb777c['body']['id']){delete _0xb777c[_0xed16('0x4a')]['id'];}return db[_0xed16('0x2e')][_0xed16('0x48')]({'where':{'id':_0xb777c[_0xed16('0x47')]['id']}})[_0xed16('0x28')](handleEntityNotFound(_0x1baa29,null))[_0xed16('0x28')](saveUpdates(_0xb777c[_0xed16('0x4a')],null))[_0xed16('0x28')](respondWithResult(_0x1baa29,null))['catch'](handleError(_0x1baa29,null));};exports[_0xed16('0x27')]=function(_0x124936,_0x941ee9){return db[_0xed16('0x2e')][_0xed16('0x48')]({'where':{'id':_0x124936[_0xed16('0x47')]['id']}})[_0xed16('0x28')](handleEntityNotFound(_0x941ee9,null))[_0xed16('0x28')](removeEntity(_0x941ee9,null))[_0xed16('0x45')](handleError(_0x941ee9,null));};exports['describe']=function(_0x9d5a21,_0x36c3e1){return db[_0xed16('0x2e')]['describe']()[_0xed16('0x28')](respondWithResult(_0x36c3e1,null))[_0xed16('0x45')](handleError(_0x36c3e1,null));}; \ No newline at end of file +var _0xb2cc=['Content-Range','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','attributes','intersection','fields','query','length','nolimit','sort','where','filters','filter','VIRTUAL','options','ChatTransferReport','count','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb2cc,0xfa));var _0xcb2c=function(_0x1be7fd,_0x51ff5a){_0x1be7fd=_0x1be7fd-0x0;var _0x2f7949=_0xb2cc[_0x1be7fd];return _0x2f7949;};'use strict';var emlformat=require(_0xcb2c('0x0'));var rimraf=require(_0xcb2c('0x1'));var zipdir=require(_0xcb2c('0x2'));var jsonpatch=require(_0xcb2c('0x3'));var rp=require(_0xcb2c('0x4'));var moment=require(_0xcb2c('0x5'));var BPromise=require(_0xcb2c('0x6'));var Mustache=require(_0xcb2c('0x7'));var util=require(_0xcb2c('0x8'));var path=require(_0xcb2c('0x9'));var sox=require(_0xcb2c('0xa'));var csv=require(_0xcb2c('0xb'));var ejs=require(_0xcb2c('0xc'));var fs=require('fs');var fs_extra=require(_0xcb2c('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb2c('0xe'));var jsforce=require(_0xcb2c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcb2c('0x10'));var Papa=require('papaparse');var Redis=require(_0xcb2c('0x11'));var authService=require(_0xcb2c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcb2c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcb2c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb2c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b8977,_0x2552b4){_0x2552b4=_0x2552b4||0xcc;return function(_0x168434){if(_0x168434){return _0x3b8977[_0xcb2c('0x16')](_0x2552b4);}return _0x3b8977[_0xcb2c('0x17')](_0x2552b4)[_0xcb2c('0x18')]();};}function respondWithResult(_0x3bff45,_0x3b7630){_0x3b7630=_0x3b7630||0xc8;return function(_0x154904){if(_0x154904){return _0x3bff45[_0xcb2c('0x17')](_0x3b7630)[_0xcb2c('0x19')](_0x154904);}};}function respondWithFilteredResult(_0x5f5853,_0x271329){return function(_0xeddf56){if(_0xeddf56){var _0x169a0f=typeof _0x271329[_0xcb2c('0x1a')]===_0xcb2c('0x1b')&&typeof _0x271329[_0xcb2c('0x1c')]==='undefined';var _0x36225f=_0xeddf56['count'];var _0x3460d1=_0x169a0f?0x0:_0x271329[_0xcb2c('0x1a')];var _0x211557=_0x169a0f?_0xeddf56['count']:_0x271329[_0xcb2c('0x1a')]+_0x271329[_0xcb2c('0x1c')];var _0x49b608;if(_0x211557>=_0x36225f){_0x211557=_0x36225f;_0x49b608=0xc8;}else{_0x49b608=0xce;}_0x5f5853[_0xcb2c('0x17')](_0x49b608);return _0x5f5853[_0xcb2c('0x1d')](_0xcb2c('0x1e'),_0x3460d1+'-'+_0x211557+'/'+_0x36225f)[_0xcb2c('0x19')](_0xeddf56);}return null;};}function patchUpdates(_0x32f2ca){return function(_0xe40ebe){try{jsonpatch['apply'](_0xe40ebe,_0x32f2ca,!![]);}catch(_0x5597f4){return BPromise[_0xcb2c('0x1f')](_0x5597f4);}return _0xe40ebe[_0xcb2c('0x20')]();};}function saveUpdates(_0x17d9b3,_0x169475){return function(_0x44e144){if(_0x44e144){return _0x44e144[_0xcb2c('0x21')](_0x17d9b3)['then'](function(_0x5409e2){return _0x5409e2;});}return null;};}function removeEntity(_0x1bf11a,_0x199395){return function(_0x388c13){if(_0x388c13){return _0x388c13['destroy']()[_0xcb2c('0x22')](function(){_0x1bf11a[_0xcb2c('0x17')](0xcc)[_0xcb2c('0x18')]();});}};}function handleEntityNotFound(_0x5c0760,_0x4d1028){return function(_0xb5a606){if(!_0xb5a606){_0x5c0760[_0xcb2c('0x16')](0x194);}return _0xb5a606;};}function handleError(_0x43c0ae,_0xdd2e20){_0xdd2e20=_0xdd2e20||0x1f4;return function(_0xfd5b1d){logger[_0xcb2c('0x23')](_0xfd5b1d['stack']);if(_0xfd5b1d[_0xcb2c('0x24')]){delete _0xfd5b1d[_0xcb2c('0x24')];}_0x43c0ae[_0xcb2c('0x17')](_0xdd2e20)[_0xcb2c('0x25')](_0xfd5b1d);};}exports[_0xcb2c('0x26')]=function(_0x262a69,_0x2ed7a5){var _0x425da0={},_0x3c94f1={},_0x15d8be={'count':0x0,'rows':[]};var _0x37c50f=_[_0xcb2c('0x27')](db['ChatTransferReport'][_0xcb2c('0x28')],function(_0xf5635){return{'name':_0xf5635[_0xcb2c('0x29')],'type':_0xf5635[_0xcb2c('0x2a')][_0xcb2c('0x2b')]};});_0x3c94f1[_0xcb2c('0x2c')]=_[_0xcb2c('0x27')](_0x37c50f,_0xcb2c('0x24'));_0x3c94f1['query']=_[_0xcb2c('0x2d')](_0x262a69['query']);_0x3c94f1['filters']=_['intersection'](_0x3c94f1[_0xcb2c('0x2c')],_0x3c94f1['query']);_0x425da0[_0xcb2c('0x2e')]=_[_0xcb2c('0x2f')](_0x3c94f1['model'],qs[_0xcb2c('0x30')](_0x262a69[_0xcb2c('0x31')]['fields']));_0x425da0[_0xcb2c('0x2e')]=_0x425da0[_0xcb2c('0x2e')][_0xcb2c('0x32')]?_0x425da0[_0xcb2c('0x2e')]:_0x3c94f1[_0xcb2c('0x2c')];if(!_0x262a69[_0xcb2c('0x31')]['hasOwnProperty'](_0xcb2c('0x33'))){_0x425da0[_0xcb2c('0x1c')]=qs[_0xcb2c('0x1c')](_0x262a69[_0xcb2c('0x31')][_0xcb2c('0x1c')]);_0x425da0[_0xcb2c('0x1a')]=qs['offset'](_0x262a69[_0xcb2c('0x31')][_0xcb2c('0x1a')]);}_0x425da0['order']=qs[_0xcb2c('0x34')](_0x262a69['query'][_0xcb2c('0x34')]);_0x425da0[_0xcb2c('0x35')]=qs['filters'](_['pick'](_0x262a69[_0xcb2c('0x31')],_0x3c94f1[_0xcb2c('0x36')]),_0x37c50f);if(_0x262a69[_0xcb2c('0x31')][_0xcb2c('0x37')]){_0x425da0[_0xcb2c('0x35')]=_['merge'](_0x425da0['where'],{'$or':_['map'](_0x37c50f,function(_0x2c99e5){if(_0x2c99e5[_0xcb2c('0x2a')]!==_0xcb2c('0x38')){var _0x504b39={};_0x504b39[_0x2c99e5[_0xcb2c('0x24')]]={'$like':'%'+_0x262a69[_0xcb2c('0x31')][_0xcb2c('0x37')]+'%'};return _0x504b39;}})});}_0x425da0=_['merge']({},_0x425da0,_0x262a69[_0xcb2c('0x39')]);var _0x5d86fb={'where':_0x425da0[_0xcb2c('0x35')]};return db[_0xcb2c('0x3a')]['count'](_0x5d86fb)[_0xcb2c('0x22')](function(_0x3d1fc7){_0x15d8be[_0xcb2c('0x3b')]=_0x3d1fc7;if(_0x262a69[_0xcb2c('0x31')][_0xcb2c('0x3c')]){_0x425da0[_0xcb2c('0x3d')]=[{'all':!![]}];}return db[_0xcb2c('0x3a')][_0xcb2c('0x3e')](_0x425da0);})[_0xcb2c('0x22')](function(_0x56fbec){_0x15d8be['rows']=_0x56fbec;return _0x15d8be;})[_0xcb2c('0x22')](respondWithFilteredResult(_0x2ed7a5,_0x425da0))[_0xcb2c('0x3f')](handleError(_0x2ed7a5,null));};exports[_0xcb2c('0x40')]=function(_0x3aa3d5,_0x3e89b8){var _0xe3ee01={'raw':!![],'where':{'id':_0x3aa3d5[_0xcb2c('0x41')]['id']}},_0x4d4734={};_0x4d4734[_0xcb2c('0x2c')]=_['keys'](db[_0xcb2c('0x3a')]['rawAttributes']);_0x4d4734[_0xcb2c('0x31')]=_[_0xcb2c('0x2d')](_0x3aa3d5[_0xcb2c('0x31')]);_0x4d4734['filters']=_['intersection'](_0x4d4734[_0xcb2c('0x2c')],_0x4d4734[_0xcb2c('0x31')]);_0xe3ee01['attributes']=_[_0xcb2c('0x2f')](_0x4d4734[_0xcb2c('0x2c')],qs['fields'](_0x3aa3d5[_0xcb2c('0x31')][_0xcb2c('0x30')]));_0xe3ee01['attributes']=_0xe3ee01[_0xcb2c('0x2e')][_0xcb2c('0x32')]?_0xe3ee01[_0xcb2c('0x2e')]:_0x4d4734[_0xcb2c('0x2c')];if(_0x3aa3d5[_0xcb2c('0x31')][_0xcb2c('0x3c')]){_0xe3ee01[_0xcb2c('0x3d')]=[{'all':!![]}];}_0xe3ee01=_['merge']({},_0xe3ee01,_0x3aa3d5[_0xcb2c('0x39')]);return db[_0xcb2c('0x3a')]['find'](_0xe3ee01)[_0xcb2c('0x22')](handleEntityNotFound(_0x3e89b8,null))['then'](respondWithResult(_0x3e89b8,null))[_0xcb2c('0x3f')](handleError(_0x3e89b8,null));};exports['create']=function(_0x2ad214,_0x39cf6d){return db[_0xcb2c('0x3a')][_0xcb2c('0x42')](_0x2ad214['body'],{})[_0xcb2c('0x22')](respondWithResult(_0x39cf6d,0xc9))[_0xcb2c('0x3f')](handleError(_0x39cf6d,null));};exports['update']=function(_0x384046,_0x27cf73){if(_0x384046[_0xcb2c('0x43')]['id']){delete _0x384046[_0xcb2c('0x43')]['id'];}return db[_0xcb2c('0x3a')][_0xcb2c('0x44')]({'where':{'id':_0x384046['params']['id']}})['then'](handleEntityNotFound(_0x27cf73,null))[_0xcb2c('0x22')](saveUpdates(_0x384046[_0xcb2c('0x43')],null))[_0xcb2c('0x22')](respondWithResult(_0x27cf73,null))[_0xcb2c('0x3f')](handleError(_0x27cf73,null));};exports['destroy']=function(_0x105de4,_0x4e8466){return db[_0xcb2c('0x3a')]['find']({'where':{'id':_0x105de4[_0xcb2c('0x41')]['id']}})[_0xcb2c('0x22')](handleEntityNotFound(_0x4e8466,null))[_0xcb2c('0x22')](removeEntity(_0x4e8466,null))['catch'](handleError(_0x4e8466,null));};exports[_0xcb2c('0x45')]=function(_0x3accbf,_0x49259c){return db[_0xcb2c('0x3a')][_0xcb2c('0x45')]()[_0xcb2c('0x22')](respondWithResult(_0x49259c,null))[_0xcb2c('0x3f')](handleError(_0x49259c,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 0592974..f91acc9 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 _0x3d54=['bluebird','rimraf','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x4e936b,_0x193d71){var _0xda6dd6=function(_0x465be7){while(--_0x465be7){_0x4e936b['push'](_0x4e936b['shift']());}};_0xda6dd6(++_0x193d71);}(_0x3d54,0x9c));var _0x43d5=function(_0x214521,_0x1686b9){_0x214521=_0x214521-0x0;var _0x243e77=_0x3d54[_0x214521];return _0x243e77;};'use strict';var _=require(_0x43d5('0x0'));var util=require('util');var logger=require(_0x43d5('0x1'))(_0x43d5('0x2'));var moment=require(_0x43d5('0x3'));var BPromise=require(_0x43d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x43d5('0x5'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x236138,_0x1068d1){return _0x236138[_0x43d5('0x6')](_0x43d5('0x7'),attributes,{'tableName':_0x43d5('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x43d5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x96f2=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','util'];(function(_0x11e64b,_0x9fe0bb){var _0x4de080=function(_0x347eec){while(--_0x347eec){_0x11e64b['push'](_0x11e64b['shift']());}};_0x4de080(++_0x9fe0bb);}(_0x96f2,0x167));var _0x296f=function(_0x455aa8,_0x5d533f){_0x455aa8=_0x455aa8-0x0;var _0x1ad31b=_0x96f2[_0x455aa8];return _0x1ad31b;};'use strict';var _=require('lodash');var util=require(_0x296f('0x0'));var logger=require(_0x296f('0x1'))(_0x296f('0x2'));var moment=require(_0x296f('0x3'));var BPromise=require('bluebird');var rp=require(_0x296f('0x4'));var fs=require('fs');var path=require(_0x296f('0x5'));var rimraf=require(_0x296f('0x6'));var config=require(_0x296f('0x7'));var attributes=require(_0x296f('0x8'));module[_0x296f('0x9')]=function(_0x5190dd,_0x344927){return _0x5190dd['define']('ChatTransferReport',attributes,{'tableName':_0x296f('0xa'),'paranoid':![],'indexes':[{'name':_0x296f('0xb'),'fields':[_0x296f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index aa3c66c..a9bd8ef 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 _0xabe5=['message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatTransferReport,\x20%s,\x20%s'];(function(_0x54786f,_0xe28fee){var _0x155b10=function(_0x175227){while(--_0x175227){_0x54786f['push'](_0x54786f['shift']());}};_0x155b10(++_0xe28fee);}(_0xabe5,0x1a4));var _0x5abe=function(_0x17f8d9,_0x497863){_0x17f8d9=_0x17f8d9-0x0;var _0x4018b7=_0xabe5[_0x17f8d9];return _0x4018b7;};'use strict';var _=require(_0x5abe('0x0'));var util=require('util');var moment=require(_0x5abe('0x1'));var BPromise=require(_0x5abe('0x2'));var rs=require(_0x5abe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5abe('0x4'))['db'];var utils=require(_0x5abe('0x5'));var logger=require(_0x5abe('0x6'))(_0x5abe('0x7'));var config=require(_0x5abe('0x8'));var jayson=require(_0x5abe('0x9'));var client=jayson['client'][_0x5abe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57eaf,_0x573ec7,_0x472a03){return new BPromise(function(_0x1f2097,_0x6f0a35){return client[_0x5abe('0xb')](_0x57eaf,_0x472a03)[_0x5abe('0xc')](function(_0x59aaba){logger[_0x5abe('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x573ec7,_0x5abe('0xe'));logger[_0x5abe('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x573ec7,_0x5abe('0xe'),JSON[_0x5abe('0x10')](_0x59aaba));if(_0x59aaba[_0x5abe('0x11')]){if(_0x59aaba[_0x5abe('0x11')][_0x5abe('0x12')]===0x1f4){logger[_0x5abe('0x11')](_0x5abe('0x13'),_0x573ec7,_0x59aaba[_0x5abe('0x11')][_0x5abe('0x14')]);return _0x6f0a35(_0x59aaba[_0x5abe('0x11')][_0x5abe('0x14')]);}logger[_0x5abe('0x11')](_0x5abe('0x13'),_0x573ec7,_0x59aaba[_0x5abe('0x11')][_0x5abe('0x14')]);return _0x1f2097(_0x59aaba['error'][_0x5abe('0x14')]);}else{logger[_0x5abe('0xd')](_0x5abe('0x13'),_0x573ec7,_0x5abe('0xe'));_0x1f2097(_0x59aaba[_0x5abe('0x15')]['message']);}})['catch'](function(_0x451771){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x573ec7,_0x451771);_0x6f0a35(_0x451771);});});} \ No newline at end of file +var _0x0da4=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x12006d,_0x5c4429){var _0x1bb9e7=function(_0x4125a2){while(--_0x4125a2){_0x12006d['push'](_0x12006d['shift']());}};_0x1bb9e7(++_0x5c4429);}(_0x0da4,0x15f));var _0x40da=function(_0x5e704b,_0x5edb54){_0x5e704b=_0x5e704b-0x0;var _0x20e55e=_0x0da4[_0x5e704b];return _0x20e55e;};'use strict';var _=require('lodash');var util=require(_0x40da('0x0'));var moment=require(_0x40da('0x1'));var BPromise=require(_0x40da('0x2'));var rs=require(_0x40da('0x3'));var fs=require('fs');var Redis=require(_0x40da('0x4'));var db=require(_0x40da('0x5'))['db'];var utils=require(_0x40da('0x6'));var logger=require(_0x40da('0x7'))(_0x40da('0x8'));var config=require('../../config/environment');var jayson=require(_0x40da('0x9'));var client=jayson[_0x40da('0xa')][_0x40da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x297504,_0x128d6c,_0x21a1d7){return new BPromise(function(_0x28dec8,_0x36d583){return client[_0x40da('0xc')](_0x297504,_0x21a1d7)[_0x40da('0xd')](function(_0x34bedb){logger['info'](_0x40da('0xe'),_0x128d6c,_0x40da('0xf'));logger[_0x40da('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x128d6c,'request\x20sent',JSON[_0x40da('0x11')](_0x34bedb));if(_0x34bedb[_0x40da('0x12')]){if(_0x34bedb[_0x40da('0x12')][_0x40da('0x13')]===0x1f4){logger[_0x40da('0x12')](_0x40da('0xe'),_0x128d6c,_0x34bedb[_0x40da('0x12')][_0x40da('0x14')]);return _0x36d583(_0x34bedb[_0x40da('0x12')][_0x40da('0x14')]);}logger[_0x40da('0x12')](_0x40da('0xe'),_0x128d6c,_0x34bedb['error']['message']);return _0x28dec8(_0x34bedb[_0x40da('0x12')][_0x40da('0x14')]);}else{logger['info'](_0x40da('0xe'),_0x128d6c,_0x40da('0xf'));_0x28dec8(_0x34bedb[_0x40da('0x15')][_0x40da('0x14')]);}})[_0x40da('0x16')](function(_0x324494){logger[_0x40da('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x128d6c,_0x324494);_0x36d583(_0x324494);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index b6f4dd7..e01f463 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 _0x5323=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5323,0x169));var _0x3532=function(_0x1a7118,_0xf21148){_0x1a7118=_0x1a7118-0x0;var _0xf8eff4=_0x5323[_0x1a7118];return _0xf8eff4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3532('0x0'));var timeout=require(_0x3532('0x1'));var express=require(_0x3532('0x2'));var router=express[_0x3532('0x3')]();var fs_extra=require(_0x3532('0x4'));var auth=require(_0x3532('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3532('0x6'));var controller=require(_0x3532('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3532('0x8')]);router[_0x3532('0x9')]('/describe',auth[_0x3532('0xa')](),controller[_0x3532('0xb')]);router[_0x3532('0x9')](_0x3532('0xc'),auth['isAuthenticated'](),controller[_0x3532('0xd')]);router[_0x3532('0xe')]('/',auth[_0x3532('0xa')](),controller[_0x3532('0xf')]);router['put'](_0x3532('0xc'),auth['isAuthenticated'](),controller[_0x3532('0x10')]);router[_0x3532('0x11')](_0x3532('0xc'),auth[_0x3532('0xa')](),controller[_0x3532('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0307=['create','update','delete','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3be2d0,_0x243d18){var _0x3ebc99=function(_0x28539c){while(--_0x28539c){_0x3be2d0['push'](_0x3be2d0['shift']());}};_0x3ebc99(++_0x243d18);}(_0x0307,0x19d));var _0x7030=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x0307[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x7030('0x0'));var util=require('util');var path=require(_0x7030('0x1'));var timeout=require(_0x7030('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7030('0x3'));var config=require('../../config/environment');var controller=require(_0x7030('0x4'));router[_0x7030('0x5')]('/',auth[_0x7030('0x6')](),controller['index']);router[_0x7030('0x5')](_0x7030('0x7'),auth['isAuthenticated'](),controller[_0x7030('0x8')]);router[_0x7030('0x5')](_0x7030('0x9'),auth['isAuthenticated'](),controller[_0x7030('0xa')]);router[_0x7030('0xb')]('/',auth[_0x7030('0x6')](),controller[_0x7030('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7030('0xd')]);router[_0x7030('0xe')](_0x7030('0x9'),auth['isAuthenticated'](),controller[_0x7030('0xf')]);module[_0x7030('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 3dd8bc9..d7e5b91 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 _0x8dea=['Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','input','name','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message'];(function(_0x35f422,_0x1b34c1){var _0x269476=function(_0x5cff96){while(--_0x5cff96){_0x35f422['push'](_0x35f422['shift']());}};_0x269476(++_0x1b34c1);}(_0x8dea,0x17b));var _0xa8de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8dea[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xa8de('0x0'));var rs=require('randomstring');module[_0xa8de('0x1')]={'name':{'type':Sequelize[_0xa8de('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa8de('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa8de('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x3')},'key':{'type':Sequelize[_0xa8de('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x4')},'customerAlias':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa8de('0x2')],'allowNull':![],'defaultValue':_0xa8de('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa8de('0x2')],'allowNull':![],'defaultValue':_0xa8de('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa8de('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa8de('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa8de('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa8de('0x8')](_0xa8de('0x9'),_0xa8de('0xa')),'defaultValue':_0xa8de('0x9')},'header_online':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0xb')},'start_chat_button':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0xc')},'offline_chat_button':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0xd')},'header_offline':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0xe')},'download_transcript':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa8de('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa8de('0x11')]},'closingQuestion':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x14')},'closingMessage':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x15')},'closingMessageButton':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0xd')},'skipMessageButton':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x16')},'conditionAgreement':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x17')},'ratingType':{'type':Sequelize['ENUM']('star',_0xa8de('0x18')),'defaultValue':_0xa8de('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xa8de('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa8de('0x1a')]({'items':[{'type':_0xa8de('0x1b'),'variable':null,'config':{'placeholder':_0xa8de('0x1c'),'type':'text','required':!![]},'props':{'title':_0xa8de('0x1c'),'helpText':''}},{'type':_0xa8de('0x1b'),'props':{'title':_0xa8de('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa8de('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa8de('0x1d')]('onlineForm')?JSON[_0xa8de('0x1e')](this['getDataValue'](_0xa8de('0x1f'))):{};},'set':function(_0x16146a){return this[_0xa8de('0x20')](_0xa8de('0x1f'),JSON['stringify'](_0x16146a));}},'offlineForm':{'type':Sequelize[_0xa8de('0x11')],'defaultValue':function(){return JSON[_0xa8de('0x1a')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa8de('0x3'),'type':'email'},'variable':null},{'type':_0xa8de('0x21'),'config':{'placeholder':_0xa8de('0x22')},'props':{'title':_0xa8de('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xa8de('0x1d')](_0xa8de('0x23'))?JSON['parse'](this[_0xa8de('0x1d')]('offlineForm')):{};},'set':function(_0xda481e){return this['setDataValue'](_0xa8de('0x23'),JSON[_0xa8de('0x1a')](_0xda481e));}},'token':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':function(){return rs[_0xa8de('0x24')]();}},'autoclose':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa8de('0x2')]},'forwardOffline':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa8de('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa8de('0x25')},'waitingMessage':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x27')},'offlineMessageBody':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x29')},'skipUnmanaged':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x16')},'sendUnmanaged':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa8de('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa8de('0x11')],'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[_0xa8de('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa8de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xa8de('0x2a')},'verticalAlignment':{'type':Sequelize[_0xa8de('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':_0xa8de('0x2b')},'defaultTitle':{'type':Sequelize[_0xa8de('0x2')]},'customerAvatar':{'type':Sequelize[_0xa8de('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa8de('0x2')],'allowNull':![],'defaultValue':_0xa8de('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa8de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa8de('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xa8de('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa8de('0x2d'),'set':function(_0x268252){if(!_0x268252)this['setDataValue'](_0xa8de('0x2e'),null);this[_0xa8de('0x20')](_0xa8de('0x2f'),_0x268252);}},'vidaooEscalation':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa8de('0x2')]},'vidaooTopic':{'type':Sequelize[_0xa8de('0x2')],'allowNull':![],'defaultValue':_0xa8de('0x30')},'vidaooNote':{'type':Sequelize[_0xa8de('0x2')],'defaultValue':function(){return _0xa8de('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xa8de('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa8de('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa8de('0x11')]}}; \ No newline at end of file +var _0xa509=['randomstring','exports','STRING','address','email','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','INTEGER','stringify','name','text','onlineForm','getDataValue','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}'];(function(_0x2a5a7d,_0x3e6c1d){var _0x31f52e=function(_0x390940){while(--_0x390940){_0x2a5a7d['push'](_0x2a5a7d['shift']());}};_0x31f52e(++_0x3e6c1d);}(_0xa509,0x1f4));var _0x9a50=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa509[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9a50('0x0'));module[_0x9a50('0x1')]={'name':{'type':Sequelize[_0x9a50('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9a50('0x2')],'allowNull':![],'unique':_0x9a50('0x3')},'description':{'type':Sequelize[_0x9a50('0x2')]},'mapKey':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x4')},'key':{'type':Sequelize[_0x9a50('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9a50('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9a50('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9a50('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9a50('0x2')]},'animation':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9a50('0x8')](_0x9a50('0x9'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0xa')},'start_chat_button':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9a50('0xc')},'header_offline':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9a50('0xe')]},'closingQuestion':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x10')},'noteTitle':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x11')},'closingMessage':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x12')},'closingMessageButton':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0xc')},'skipMessageButton':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x13')},'conditionAgreement':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x9a50('0x8')](_0x9a50('0x14'),_0x9a50('0x15')),'defaultValue':_0x9a50('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x9a50('0x16')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9a50('0xe')],'defaultValue':function(){return JSON[_0x9a50('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x9a50('0x18'),'type':_0x9a50('0x19'),'required':!![]},'props':{'title':_0x9a50('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x9a50('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9a50('0x4'),'type':_0x9a50('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x9a50('0x1a'))?JSON['parse'](this[_0x9a50('0x1b')](_0x9a50('0x1a'))):{};},'set':function(_0x23f6fa){return this[_0x9a50('0x1c')](_0x9a50('0x1a'),JSON[_0x9a50('0x17')](_0x23f6fa));}},'offlineForm':{'type':Sequelize[_0x9a50('0xe')],'defaultValue':function(){return JSON[_0x9a50('0x17')]({'items':[{'type':_0x9a50('0x1d'),'props':{'title':_0x9a50('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9a50('0x4'),'type':_0x9a50('0x4')},'variable':null},{'type':_0x9a50('0x1e'),'config':{'placeholder':_0x9a50('0x1f')},'props':{'title':_0x9a50('0x1f'),'helpText':_0x9a50('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x9a50('0x1b')](_0x9a50('0x21'))?JSON[_0x9a50('0x22')](this[_0x9a50('0x1b')]('offlineForm')):{};},'set':function(_0x431126){return this[_0x9a50('0x1c')](_0x9a50('0x21'),JSON[_0x9a50('0x17')](_0x431126));}},'token':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9a50('0x2')]},'forwardOffline':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x23')},'offlineMessageBody':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x25')},'skipUnmanaged':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x13')},'sendUnmanaged':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9a50('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9a50('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9a50('0xe')],'defaultValue':function(){return _0x9a50('0x26');}},'notificationSound':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x9a50('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9a50('0x16')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x28')},'verticalAlignment':{'type':Sequelize[_0x9a50('0x16')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':_0x9a50('0x29')},'defaultTitle':{'type':Sequelize[_0x9a50('0x2')]},'customerAvatar':{'type':Sequelize[_0x9a50('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9a50('0x16')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9a50('0x2')],'allowNull':![],'defaultValue':_0x9a50('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9a50('0x16')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9a50('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9a50('0x16')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x9a50('0x2b')},'systemAvatar':{'type':Sequelize[_0x9a50('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9a50('0x16')],'comment':_0x9a50('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9a50('0x2d'),'set':function(_0x57c140){if(!_0x57c140)this[_0x9a50('0x1c')](_0x9a50('0x2e'),null);this[_0x9a50('0x1c')](_0x9a50('0x2f'),_0x57c140);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9a50('0x2')]},'vidaooTopic':{'type':Sequelize[_0x9a50('0x2')],'allowNull':![],'defaultValue':_0x9a50('0x30')},'vidaooNote':{'type':Sequelize[_0x9a50('0x2')],'defaultValue':function(){return _0x9a50('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9a50('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 22c0e26..a87f2d1 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 _0x5661=['removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','DESC','Applications','applications','list','orderBy','priority','asc','account','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','contact','messageId','created','autoclose','close','unmanaged','*,*,*,*','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Owner','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','connection','remoteAddress','alignment','verticalAlignment','backgroundColor','addApplications','Transaction','READ_COMMITTED','ChatApplication','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','fs-extra','lodash','querystring','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer'];(function(_0x278d8d,_0x458be8){var _0x8a6be7=function(_0xbefe2b){while(--_0xbefe2b){_0x278d8d['push'](_0x278d8d['shift']());}};_0x8a6be7(++_0x458be8);}(_0x5661,0xc3));var _0x1566=function(_0x4330ab,_0x141abd){_0x4330ab=_0x4330ab-0x0;var _0x1d764d=_0x5661[_0x4330ab];return _0x1d764d;};'use strict';var BPromise=require(_0x1566('0x0'));var Mustache=require('mustache');var util=require(_0x1566('0x1'));var path=require(_0x1566('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1566('0x3'));var _=require(_0x1566('0x4'));var querystring=require(_0x1566('0x5'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1566('0x6'))(_0x1566('0x7'));var config=require('../../config/environment');var db=require(_0x1566('0x8'))['db'];config['redis']=_['defaults'](config[_0x1566('0x9')],{'host':_0x1566('0xa'),'port':0x18eb});var socket=require(_0x1566('0xb'))(new Redis(config['redis']));require(_0x1566('0xc'))[_0x1566('0xd')](socket);var jayson=require(_0x1566('0xe'));var client=jayson[_0x1566('0xf')][_0x1566('0x10')]({'port':0x232c});var client9002=jayson[_0x1566('0xf')][_0x1566('0x10')]({'port':0x232a});var client9003=jayson[_0x1566('0xf')]['http']({'port':0x232b});var client9001=jayson[_0x1566('0xf')]['http']({'port':0x2329});function respondWithRpcPromise(_0x539b98,_0x3d4070,_0x19b3ae,_0x296c85){return new BPromise(function(_0x1ff0f9,_0x16fbb1){var _0x4c5e97=_0x296c85||client;return _0x4c5e97[_0x1566('0x11')](_0x539b98,_0x19b3ae)[_0x1566('0x12')](function(_0x4f19c7){logger[_0x1566('0x13')](_0x1566('0x14'),_0x3d4070,_0x1566('0x15'));logger['debug'](_0x1566('0x16'),_0x3d4070,_0x1566('0x15'),JSON[_0x1566('0x17')](_0x4f19c7));if(_0x4f19c7[_0x1566('0x18')]){if(_0x4f19c7[_0x1566('0x18')][_0x1566('0x19')]===0x1f4){logger[_0x1566('0x18')](_0x1566('0x14'),_0x3d4070,_0x4f19c7[_0x1566('0x18')][_0x1566('0x1a')]);return _0x16fbb1(_0x4f19c7['error'][_0x1566('0x1a')]);}logger[_0x1566('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x3d4070,_0x4f19c7[_0x1566('0x18')][_0x1566('0x1a')]);return _0x1ff0f9(_0x4f19c7['error'][_0x1566('0x1a')]);}else{logger[_0x1566('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x3d4070,'request\x20sent');_0x1ff0f9(_0x4f19c7[_0x1566('0x1b')]['message']);}})[_0x1566('0x1c')](function(_0x1c7aaf){logger[_0x1566('0x18')](_0x1566('0x14'),_0x3d4070,_0x1c7aaf);_0x16fbb1(_0x1c7aaf);});});}function respondWithStatusCode(_0x466846,_0x4bcf20){_0x4bcf20=_0x4bcf20||0xcc;return function(_0x4089c1){if(_0x4089c1){return _0x466846[_0x1566('0x1d')](_0x4bcf20);}return _0x466846[_0x1566('0x1e')](_0x4bcf20)['end']();};}function respondWithResult(_0x572bcc,_0xd034aa){_0xd034aa=_0xd034aa||0xc8;return function(_0x28f494){if(_0x28f494){return _0x572bcc[_0x1566('0x1e')](_0xd034aa)[_0x1566('0x1f')](_0x28f494);}};}function respondWithFilteredResult(_0x5e049b,_0x5799fb){return function(_0x17c641){if(_0x17c641){var _0x1342f4=typeof _0x5799fb[_0x1566('0x20')]===_0x1566('0x21')&&typeof _0x5799fb[_0x1566('0x22')]===_0x1566('0x21');var _0x31ce5b=_0x17c641['count'];var _0x67bfbd=_0x1342f4?0x0:_0x5799fb[_0x1566('0x20')];var _0x12b49c=_0x1342f4?_0x17c641[_0x1566('0x23')]:_0x5799fb[_0x1566('0x20')]+_0x5799fb[_0x1566('0x22')];var _0x17b4c3;if(_0x12b49c>=_0x31ce5b){_0x12b49c=_0x31ce5b;_0x17b4c3=0xc8;}else{_0x17b4c3=0xce;}_0x5e049b[_0x1566('0x1e')](_0x17b4c3);return _0x5e049b['set'](_0x1566('0x24'),_0x67bfbd+'-'+_0x12b49c+'/'+_0x31ce5b)[_0x1566('0x1f')](_0x17c641);}return null;};}function saveUpdates(_0x5ea3f8){return function(_0x25591b){if(_0x25591b){return _0x25591b[_0x1566('0x25')](_0x5ea3f8)[_0x1566('0x12')](function(_0x51a3d3){return _0x51a3d3;});}return null;};}function removeEntity(_0x465877){return function(_0xd2019e){if(_0xd2019e){return _0xd2019e[_0x1566('0x26')]()[_0x1566('0x12')](function(){var _0x1760a9=_0xd2019e[_0x1566('0x27')]({'plain':!![]});var _0x3fd9b6=_0x1566('0x28');return db['UserProfileResource'][_0x1566('0x26')]({'where':{'type':_0x3fd9b6,'resourceId':_0x1760a9['id']}})[_0x1566('0x12')](function(){return _0xd2019e;});})[_0x1566('0x12')](function(){_0x465877[_0x1566('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29af4c){return function(_0x4fd3f8){if(!_0x4fd3f8){_0x29af4c[_0x1566('0x1d')](0x194);}return _0x4fd3f8;};}function handleError(_0x5c360a,_0x510ade){_0x510ade=_0x510ade||0x1f4;return function(_0x134020){logger[_0x1566('0x18')](_0x134020[_0x1566('0x29')]);if(_0x134020[_0x1566('0x2a')]){delete _0x134020[_0x1566('0x2a')];}_0x5c360a[_0x1566('0x1e')](_0x510ade)[_0x1566('0x2b')](_0x134020);};}exports[_0x1566('0x2c')]=function(_0x1271bc,_0x1d4f1d){var _0x1ee7e9={'include':[{'model':db[_0x1566('0x2d')],'as':_0x1566('0x2e')}]},_0x45e631={},_0x426954={'count':0x0,'rows':[]};var _0x2ab935=_[_0x1566('0x2f')](db[_0x1566('0x30')]['rawAttributes'],function(_0x368316){return{'name':_0x368316[_0x1566('0x31')],'type':_0x368316[_0x1566('0x32')]['key']};});_0x45e631[_0x1566('0x33')]=_[_0x1566('0x2f')](_0x2ab935,'name');_0x45e631[_0x1566('0x34')]=_[_0x1566('0x35')](_0x1271bc[_0x1566('0x34')]);_0x45e631[_0x1566('0x36')]=_[_0x1566('0x37')](_0x45e631[_0x1566('0x33')],_0x45e631[_0x1566('0x34')]);_0x1ee7e9['attributes']=_[_0x1566('0x37')](_0x45e631['model'],qs[_0x1566('0x38')](_0x1271bc[_0x1566('0x34')][_0x1566('0x38')]));_0x1ee7e9[_0x1566('0x39')]=_0x1ee7e9[_0x1566('0x39')][_0x1566('0x3a')]?_0x1ee7e9['attributes']:_0x45e631[_0x1566('0x33')];if(!_0x1271bc[_0x1566('0x34')][_0x1566('0x3b')](_0x1566('0x3c'))){_0x1ee7e9[_0x1566('0x22')]=qs[_0x1566('0x22')](_0x1271bc[_0x1566('0x34')][_0x1566('0x22')]);_0x1ee7e9[_0x1566('0x20')]=qs[_0x1566('0x20')](_0x1271bc['query'][_0x1566('0x20')]);}_0x1ee7e9[_0x1566('0x3d')]=qs[_0x1566('0x3e')](_0x1271bc[_0x1566('0x34')]['sort']);_0x1ee7e9['where']=qs['filters'](_[_0x1566('0x3f')](_0x1271bc[_0x1566('0x34')],_0x45e631[_0x1566('0x36')]),_0x2ab935);if(_0x1271bc[_0x1566('0x34')][_0x1566('0x40')]){_0x1ee7e9[_0x1566('0x41')]=_[_0x1566('0x42')](_0x1ee7e9[_0x1566('0x41')],{'$or':_['map'](_0x2ab935,function(_0x375f37){if(_0x375f37['type']!==_0x1566('0x43')){var _0x2f8d1e={};_0x2f8d1e[_0x375f37[_0x1566('0x2a')]]={'$like':'%'+_0x1271bc['query'][_0x1566('0x40')]+'%'};return _0x2f8d1e;}})});}_0x1ee7e9=_[_0x1566('0x42')]({},_0x1ee7e9,_0x1271bc[_0x1566('0x44')]);var _0x44bf76={'where':_0x1ee7e9[_0x1566('0x41')]};return db[_0x1566('0x30')][_0x1566('0x23')](_0x44bf76)[_0x1566('0x12')](function(_0x2aaba1){_0x426954[_0x1566('0x23')]=_0x2aaba1;if(_0x1271bc[_0x1566('0x34')]['includeAll']){_0x1ee7e9[_0x1566('0x45')]=[{'all':!![]}];}return db['ChatWebsite'][_0x1566('0x46')](_0x1ee7e9);})[_0x1566('0x12')](function(_0x157efb){_0x426954[_0x1566('0x47')]=_0x157efb;return _0x426954;})[_0x1566('0x12')](respondWithFilteredResult(_0x1d4f1d,_0x1ee7e9))[_0x1566('0x1c')](handleError(_0x1d4f1d,null));};exports[_0x1566('0x48')]=function(_0x2043e3,_0x43cd4b){var _0x24827b={'raw':![],'where':{'id':_0x2043e3['params']['id']},'include':[{'model':db['Pause'],'as':_0x1566('0x2e')}]},_0x1d115b={};_0x1d115b[_0x1566('0x33')]=_[_0x1566('0x35')](db[_0x1566('0x30')][_0x1566('0x49')]);_0x1d115b['query']=_[_0x1566('0x35')](_0x2043e3['query']);_0x1d115b['filters']=_[_0x1566('0x37')](_0x1d115b[_0x1566('0x33')],_0x1d115b[_0x1566('0x34')]);_0x24827b[_0x1566('0x39')]=_[_0x1566('0x37')](_0x1d115b['model'],qs[_0x1566('0x38')](_0x2043e3[_0x1566('0x34')]['fields']));_0x24827b[_0x1566('0x39')]=_0x24827b[_0x1566('0x39')]['length']?_0x24827b[_0x1566('0x39')]:_0x1d115b['model'];if(_0x2043e3[_0x1566('0x34')][_0x1566('0x4a')]){_0x24827b[_0x1566('0x45')]=[{'all':!![]}];}_0x24827b=_[_0x1566('0x42')]({},_0x24827b,_0x2043e3[_0x1566('0x44')]);return db[_0x1566('0x30')]['find'](_0x24827b)[_0x1566('0x12')](handleEntityNotFound(_0x43cd4b,null))[_0x1566('0x12')](respondWithResult(_0x43cd4b,null))['catch'](handleError(_0x43cd4b,null));};exports['create']=function(_0x1a7f6d,_0x384107){return db['ChatWebsite'][_0x1566('0x4b')](_0x1a7f6d[_0x1566('0x4c')],{})[_0x1566('0x12')](function(_0x1f80f1){var _0x12ad40=_0x1a7f6d['user'][_0x1566('0x27')]({'plain':!![]});if(!_0x12ad40)throw new Error(_0x1566('0x4d'));if(_0x12ad40[_0x1566('0x4e')]===_0x1566('0x4f')){var _0x4cc0fc=_0x1f80f1[_0x1566('0x27')]({'plain':!![]});var _0xfb8841=_0x1566('0x28');return db[_0x1566('0x50')][_0x1566('0x51')]({'where':{'name':_0xfb8841,'userProfileId':_0x12ad40[_0x1566('0x52')]},'raw':!![]})['then'](function(_0x382442){if(_0x382442&&_0x382442['autoAssociation']===0x0){return db[_0x1566('0x53')][_0x1566('0x4b')]({'name':_0x4cc0fc[_0x1566('0x2a')],'resourceId':_0x4cc0fc['id'],'type':_0x382442[_0x1566('0x2a')],'sectionId':_0x382442['id']},{})[_0x1566('0x12')](function(){return _0x1f80f1;});}else{return _0x1f80f1;}})['catch'](function(_0x43dc27){logger[_0x1566('0x18')](_0x1566('0x54'),_0x43dc27);throw _0x43dc27;});}return _0x1f80f1;})[_0x1566('0x12')](respondWithResult(_0x384107,0xc9))[_0x1566('0x1c')](handleError(_0x384107,null));};exports[_0x1566('0x25')]=function(_0x9f0635,_0x4fa272){if(_0x9f0635[_0x1566('0x4c')]['id']){delete _0x9f0635[_0x1566('0x4c')]['id'];}return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x9f0635['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1566('0x12')](handleEntityNotFound(_0x4fa272,null))[_0x1566('0x12')](saveUpdates(_0x9f0635['body'],null))[_0x1566('0x12')](respondWithResult(_0x4fa272,null))[_0x1566('0x1c')](handleError(_0x4fa272,null));};exports[_0x1566('0x26')]=function(_0x17657d,_0x3b9471){return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x17657d[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x3b9471,null))[_0x1566('0x12')](removeEntity(_0x3b9471,null))[_0x1566('0x1c')](handleError(_0x3b9471,null));};exports[_0x1566('0x56')]=function(_0x4658ba,_0x54ef62){return db[_0x1566('0x30')][_0x1566('0x56')]()[_0x1566('0x12')](respondWithResult(_0x54ef62,null))[_0x1566('0x1c')](handleError(_0x54ef62,null));};exports[_0x1566('0x57')]=function(_0x10c9b2,_0x1fb858){if(_0x10c9b2[_0x1566('0x4c')]['id']){delete _0x10c9b2['body']['id'];}return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x10c9b2['params']['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x1fb858,null))['then'](function(_0x232b6f){if(_0x232b6f){_0x10c9b2[_0x1566('0x4c')][_0x1566('0x58')]=_0x232b6f['id'];return db[_0x1566('0x59')][_0x1566('0x4b')](_0x10c9b2[_0x1566('0x4c')]);}})[_0x1566('0x12')](respondWithResult(_0x1fb858,null))['catch'](handleError(_0x1fb858,null));};exports['getDispositions']=function(_0x2b8110,_0x7802bd){var _0x1fb367={'raw':![],'where':{}};var _0x5d4768={};var _0x1e3c31={'count':0x0,'rows':[]};return db[_0x1566('0x30')][_0x1566('0x5a')]({'where':{'id':_0x2b8110[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x7802bd,null))['then'](function(_0x3de9aa){if(_0x3de9aa){_0x5d4768['model']=_[_0x1566('0x35')](db[_0x1566('0x59')][_0x1566('0x49')]);_0x5d4768[_0x1566('0x34')]=_[_0x1566('0x35')](_0x2b8110[_0x1566('0x34')]);_0x5d4768[_0x1566('0x36')]=_[_0x1566('0x37')](_0x5d4768[_0x1566('0x33')],_0x5d4768['query']);_0x1fb367[_0x1566('0x39')]=_['intersection'](_0x5d4768['model'],qs[_0x1566('0x38')](_0x2b8110[_0x1566('0x34')][_0x1566('0x38')]));_0x1fb367[_0x1566('0x39')]=_0x1fb367['attributes']['length']?_0x1fb367[_0x1566('0x39')]:_0x5d4768['model'];if(!_0x2b8110[_0x1566('0x34')][_0x1566('0x3b')](_0x1566('0x3c'))){_0x1fb367['limit']=qs['limit'](_0x2b8110[_0x1566('0x34')]['limit']);_0x1fb367[_0x1566('0x20')]=qs[_0x1566('0x20')](_0x2b8110['query'][_0x1566('0x20')]);}_0x1fb367['order']=qs[_0x1566('0x3e')](_0x2b8110[_0x1566('0x34')][_0x1566('0x3e')]);_0x1fb367[_0x1566('0x41')]=qs[_0x1566('0x36')](_['pick'](_0x2b8110[_0x1566('0x34')],_0x5d4768['filters']));_0x1fb367[_0x1566('0x41')][_0x1566('0x58')]=_0x3de9aa['id'];if(_0x2b8110[_0x1566('0x34')]['filter']){_0x1fb367[_0x1566('0x41')]=_[_0x1566('0x42')](_0x1fb367[_0x1566('0x41')],{'$or':_[_0x1566('0x2f')](_0x1fb367['attributes'],function(_0x505e05){var _0x8e0145={};_0x8e0145[_0x505e05]={'$like':'%'+_0x2b8110['query'][_0x1566('0x40')]+'%'};return _0x8e0145;})});}_0x1fb367=_[_0x1566('0x42')]({},_0x1fb367,_0x2b8110[_0x1566('0x44')]);return db[_0x1566('0x59')][_0x1566('0x23')]({'where':_0x1fb367[_0x1566('0x41')]})[_0x1566('0x12')](function(_0x46bca0){_0x1e3c31[_0x1566('0x23')]=_0x46bca0;if(_0x2b8110[_0x1566('0x34')]['includeAll']){_0x1fb367['include']=[{'all':!![]}];}return db[_0x1566('0x59')][_0x1566('0x46')](_0x1fb367);})[_0x1566('0x12')](function(_0x5a8355){_0x1e3c31[_0x1566('0x47')]=_0x5a8355;return _0x1e3c31;});}})[_0x1566('0x12')](respondWithFilteredResult(_0x7802bd,_0x1fb367))[_0x1566('0x1c')](handleError(_0x7802bd,null));};exports[_0x1566('0x5b')]=function(_0x25b2ed,_0x259cf1){return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x25b2ed['params']['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x259cf1,null))[_0x1566('0x12')](function(_0x53315a){if(_0x53315a){return _0x53315a[_0x1566('0x5b')](_0x25b2ed[_0x1566('0x34')][_0x1566('0x5c')]);}})[_0x1566('0x12')](respondWithStatusCode(_0x259cf1,null))['catch'](handleError(_0x259cf1,null));};exports[_0x1566('0x5d')]=function(_0x27fd80,_0x4586f0){if(_0x27fd80['body']['id']){delete _0x27fd80[_0x1566('0x4c')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x27fd80[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x4586f0,null))['then'](function(_0x1f7435){if(_0x1f7435){_0x27fd80[_0x1566('0x4c')][_0x1566('0x58')]=_0x1f7435['id'];return db['CannedAnswer']['create'](_0x27fd80['body']);}})[_0x1566('0x12')](respondWithResult(_0x4586f0,null))['catch'](handleError(_0x4586f0,null));};exports['getAnswers']=function(_0x1dea6f,_0x5929bc){var _0x2d6e3f={'raw':![],'where':{}};var _0xbe24f8={};var _0x7e2a94={'count':0x0,'rows':[]};return db[_0x1566('0x30')]['findOne']({'where':{'id':_0x1dea6f[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x5929bc,null))['then'](function(_0x5757e1){if(_0x5757e1){_0xbe24f8[_0x1566('0x33')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0xbe24f8['query']=_['keys'](_0x1dea6f[_0x1566('0x34')]);_0xbe24f8['filters']=_[_0x1566('0x37')](_0xbe24f8[_0x1566('0x33')],_0xbe24f8[_0x1566('0x34')]);_0x2d6e3f[_0x1566('0x39')]=_[_0x1566('0x37')](_0xbe24f8['model'],qs['fields'](_0x1dea6f['query']['fields']));_0x2d6e3f[_0x1566('0x39')]=_0x2d6e3f[_0x1566('0x39')]['length']?_0x2d6e3f[_0x1566('0x39')]:_0xbe24f8[_0x1566('0x33')];if(!_0x1dea6f[_0x1566('0x34')]['hasOwnProperty'](_0x1566('0x3c'))){_0x2d6e3f[_0x1566('0x22')]=qs[_0x1566('0x22')](_0x1dea6f[_0x1566('0x34')]['limit']);_0x2d6e3f[_0x1566('0x20')]=qs['offset'](_0x1dea6f[_0x1566('0x34')][_0x1566('0x20')]);}_0x2d6e3f[_0x1566('0x3d')]=qs[_0x1566('0x3e')](_0x1dea6f[_0x1566('0x34')][_0x1566('0x3e')]);_0x2d6e3f[_0x1566('0x41')]=qs[_0x1566('0x36')](_[_0x1566('0x3f')](_0x1dea6f[_0x1566('0x34')],_0xbe24f8[_0x1566('0x36')]));_0x2d6e3f['where']['ChatWebsiteId']=_0x5757e1['id'];if(_0x1dea6f[_0x1566('0x34')][_0x1566('0x40')]){_0x2d6e3f[_0x1566('0x41')]=_[_0x1566('0x42')](_0x2d6e3f[_0x1566('0x41')],{'$or':_[_0x1566('0x2f')](_0x2d6e3f['attributes'],function(_0x249141){var _0x277e17={};_0x277e17[_0x249141]={'$like':'%'+_0x1dea6f[_0x1566('0x34')][_0x1566('0x40')]+'%'};return _0x277e17;})});}_0x2d6e3f=_[_0x1566('0x42')]({},_0x2d6e3f,_0x1dea6f[_0x1566('0x44')]);return db[_0x1566('0x5e')]['count']({'where':_0x2d6e3f[_0x1566('0x41')]})[_0x1566('0x12')](function(_0x540cb8){_0x7e2a94[_0x1566('0x23')]=_0x540cb8;if(_0x1dea6f[_0x1566('0x34')][_0x1566('0x4a')]){_0x2d6e3f[_0x1566('0x45')]=[{'all':!![]}];}return db[_0x1566('0x5e')][_0x1566('0x46')](_0x2d6e3f);})[_0x1566('0x12')](function(_0x87565d){_0x7e2a94[_0x1566('0x47')]=_0x87565d;return _0x7e2a94;});}})[_0x1566('0x12')](respondWithFilteredResult(_0x5929bc,_0x2d6e3f))['catch'](handleError(_0x5929bc,null));};exports[_0x1566('0x5f')]=function(_0x188594,_0x5a4d0d){return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x188594[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x5a4d0d,null))[_0x1566('0x12')](function(_0x2ba326){if(_0x2ba326){return _0x2ba326[_0x1566('0x5f')](_0x188594['query'][_0x1566('0x5c')]);}})['then'](respondWithStatusCode(_0x5a4d0d,null))[_0x1566('0x1c')](handleError(_0x5a4d0d,null));};exports['addLogo']=function(_0x5e691e,_0x44f27f){_0x5e691e[_0x1566('0x4c')][_0x1566('0x60')]=_0x5e691e[_0x1566('0x61')][_0x1566('0x62')];return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x5e691e['params']['id']}})['then'](handleEntityNotFound(_0x44f27f,null))['then'](saveUpdates(_0x5e691e[_0x1566('0x4c')],null))[_0x1566('0x12')](respondWithResult(_0x44f27f,null))[_0x1566('0x1c')](handleError(_0x44f27f,null));};exports[_0x1566('0x63')]=function(_0x5634a0,_0x3251fa){_0x5634a0[_0x1566('0x4c')][_0x1566('0x64')]=_0x5634a0['file'][_0x1566('0x62')];return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x5634a0[_0x1566('0x55')]['id']}})['then'](handleEntityNotFound(_0x3251fa,null))[_0x1566('0x12')](saveUpdates(_0x5634a0['body'],null))['then'](respondWithResult(_0x3251fa,null))[_0x1566('0x1c')](handleError(_0x3251fa,null));};exports[_0x1566('0x65')]=function(_0xef3bfb,_0x264211){_0xef3bfb[_0x1566('0x4c')][_0x1566('0x66')]=_0xef3bfb['file']['filename'];return db[_0x1566('0x30')]['find']({'where':{'id':_0xef3bfb[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x264211,null))[_0x1566('0x12')](saveUpdates(_0xef3bfb[_0x1566('0x4c')],null))['then'](respondWithResult(_0x264211,null))[_0x1566('0x1c')](handleError(_0x264211,null));};exports[_0x1566('0x67')]=function(_0x4a7ee1,_0x5e4588){_0x4a7ee1[_0x1566('0x4c')][_0x1566('0x68')]=_0x4a7ee1[_0x1566('0x61')][_0x1566('0x62')];return db[_0x1566('0x30')]['find']({'where':{'id':_0x4a7ee1['params']['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x5e4588,null))['then'](saveUpdates(_0x4a7ee1[_0x1566('0x4c')],null))[_0x1566('0x12')](respondWithResult(_0x5e4588,null))[_0x1566('0x1c')](handleError(_0x5e4588,null));};exports[_0x1566('0x69')]=function(_0x1f9c7b,_0x372ad3){var _0x42478d=path[_0x1566('0x6a')](config[_0x1566('0x6b')],_0x1566('0x6c'));var _0x1b81a4={'where':{'id':_0x1f9c7b[_0x1566('0x55')]['id']},'attributes':['id',_0x1566('0x60')],'raw':!![]};var _0x59241f=![];return require(_0x1566('0x6d'))[_0x1566('0x6e')]()[_0x1566('0x12')](function(_0x3e3ce0){if(_0x3e3ce0){_0x59241f=_0x3e3ce0['custom'];}})[_0x1566('0x12')](function(){return db[_0x1566('0x30')][_0x1566('0x51')](_0x1b81a4);})['then'](handleEntityNotFound(_0x372ad3,null))[_0x1566('0x12')](function(_0x54e3de){if(_0x54e3de){if(!_[_0x1566('0x6f')](_0x54e3de['sitepic'])){if(fs[_0x1566('0x70')](path[_0x1566('0x6a')](config['root'],_0x1566('0x71'),_0x54e3de['sitepic']))&&_0x59241f){_0x42478d=path[_0x1566('0x6a')](config['root'],_0x1566('0x71'),_0x54e3de['sitepic']);}}return _0x372ad3[_0x1566('0x72')](_0x42478d);}})['catch'](handleError(_0x372ad3,null));};exports[_0x1566('0x73')]=function(_0x1c8eee,_0x233d91){var _0x307b43=path['join'](config[_0x1566('0x6b')],_0x1566('0x74'));var _0x2478c0={'where':{'id':_0x1c8eee['params']['id']},'attributes':['id',_0x1566('0x64')],'raw':!![]};return db['ChatWebsite'][_0x1566('0x51')](_0x2478c0)['then'](handleEntityNotFound(_0x233d91,null))['then'](function(_0x116ddb){if(_0x116ddb){if(!_[_0x1566('0x6f')](_0x116ddb[_0x1566('0x64')])){if(fs[_0x1566('0x70')](path['join'](config[_0x1566('0x6b')],_0x1566('0x75'),_0x116ddb[_0x1566('0x64')]))){_0x307b43=path[_0x1566('0x6a')](config['root'],_0x1566('0x75'),_0x116ddb[_0x1566('0x64')]);}}return _0x233d91[_0x1566('0x72')](_0x307b43);}})[_0x1566('0x1c')](handleError(_0x233d91,null));};exports[_0x1566('0x76')]=function(_0x5a61ef,_0x17cfe4){var _0x2bebc3=path[_0x1566('0x6a')](config[_0x1566('0x6b')],'server/files/images/avatars/customer_avatar.png');var _0xfab2b2={'where':{'id':_0x5a61ef[_0x1566('0x55')]['id']},'attributes':['id',_0x1566('0x66'),'showCustomerAvatar'],'raw':!![]};return db[_0x1566('0x30')][_0x1566('0x51')](_0xfab2b2)['then'](handleEntityNotFound(_0x17cfe4,null))['then'](function(_0x2edceb){if(_0x2edceb){if(!_[_0x1566('0x6f')](_0x2edceb[_0x1566('0x66')])){if(fs['existsSync'](path[_0x1566('0x6a')](config[_0x1566('0x6b')],_0x1566('0x75'),_0x2edceb[_0x1566('0x66')]))&&_0x2edceb[_0x1566('0x77')]){_0x2bebc3=path[_0x1566('0x6a')](config[_0x1566('0x6b')],_0x1566('0x75'),_0x2edceb[_0x1566('0x66')]);}}return _0x17cfe4[_0x1566('0x72')](_0x2bebc3);}})[_0x1566('0x1c')](handleError(_0x17cfe4,null));};exports['getSystemAvatar']=function(_0xf76209,_0x2a19e7){var _0x3aba2a=path[_0x1566('0x6a')](config['root'],_0x1566('0x78'));var _0x3e7add={'where':{'id':_0xf76209[_0x1566('0x55')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x1566('0x30')][_0x1566('0x51')](_0x3e7add)['then'](handleEntityNotFound(_0x2a19e7,null))[_0x1566('0x12')](function(_0x4dea1f){if(_0x4dea1f){if(!_[_0x1566('0x6f')](_0x4dea1f['systemAvatar'])){if(fs[_0x1566('0x70')](path[_0x1566('0x6a')](config[_0x1566('0x6b')],_0x1566('0x75'),_0x4dea1f['systemAvatar']))){_0x3aba2a=path[_0x1566('0x6a')](config[_0x1566('0x6b')],_0x1566('0x75'),_0x4dea1f[_0x1566('0x68')]);}}return _0x2a19e7[_0x1566('0x72')](_0x3aba2a);}})[_0x1566('0x1c')](handleError(_0x2a19e7,null));};exports['notify']=function(_0xd568ff,_0x3b3a14){var _0x8e6126=require(_0x1566('0x79'));var _0x33d80d=new _0x8e6126();var _0x330e02=_0x33d80d[_0x1566('0x7a')](_0xd568ff['headers']['user-agent'])[_0x1566('0x7b')]();var _0x55e1f2={'body':_0xd568ff[_0x1566('0x4c')],'channel':_0x1566('0x7c')};var _0x5ed7c9=[];var _0x3e4d39=[];var _0x2b985b={};var _0x1b6711=![];return db['CmContact']['describe']()[_0x1566('0x12')](function(_0x13a851){if(!_0x13a851){throw new db[(_0x1566('0x7d'))][(_0x1566('0x7e'))](_0x1566('0x7f'));}_0x5ed7c9=_[_0x1566('0x80')](_[_0x1566('0x35')](_0x13a851),[_0x1566('0x81'),'updatedAt']);_0x3e4d39=_['difference'](_['keys'](_0x13a851),[_0x1566('0x81'),_0x1566('0x82'),_0x1566('0x83'),_0x1566('0x84')]);if(_0xd568ff[_0x1566('0x4c')]['id']){delete _0xd568ff[_0x1566('0x4c')]['id'];}if(_[_0x1566('0x6f')](_0xd568ff[_0x1566('0x4c')]['from'])){throw new db[(_0x1566('0x7d'))][(_0x1566('0x7e'))](_0x1566('0x85'));}if(_['isNil'](_0xd568ff[_0x1566('0x4c')][_0x1566('0x4c')])||_0xd568ff[_0x1566('0x4c')]['body']===''){throw new db['Sequelize'][(_0x1566('0x7e'))](_0x1566('0x86'));}if(_['isNil'](_0xd568ff[_0x1566('0x4c')][_0x1566('0x87')])){throw new db[(_0x1566('0x7d'))][(_0x1566('0x7e'))](_0x1566('0x88')+_0x3e4d39);}if(!_[_0x1566('0x89')](_0x3e4d39,_0xd568ff[_0x1566('0x4c')][_0x1566('0x87')])){throw new db['Sequelize'][(_0x1566('0x7e'))](_0x1566('0x8a')+_0x3e4d39);}_0x2b985b[_0xd568ff[_0x1566('0x4c')]['mapKey']]=_0xd568ff['body'][_0x1566('0x8b')];})[_0x1566('0x12')](function(){return db[_0x1566('0x30')]['find']({'where':{'id':_0xd568ff[_0x1566('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x1566('0x8c'),'include':[{'model':db[_0x1566('0x8d')],'as':_0x1566('0x8e'),'where':_0x2b985b,'limit':0x1,'order':[[_0x1566('0x82'),_0x1566('0x8f')]]}]},{'model':db['ChatApplication'],'as':_0x1566('0x90')}]});})['then'](handleEntityNotFound(_0x3b3a14,null))[_0x1566('0x12')](function(_0x28afa2){if(_0x28afa2&&_0x28afa2[_0x1566('0x8c')]){_0x55e1f2['account']=_0x28afa2;_0x55e1f2[_0x1566('0x91')]=_0x28afa2[_0x1566('0x90')];_0x55e1f2[_0x1566('0x92')]=_0x28afa2[_0x1566('0x8c')];_0x55e1f2['applications']=_[_0x1566('0x93')](_0x55e1f2[_0x1566('0x91')],[_0x1566('0x94')],[_0x1566('0x95')]);if(_0x55e1f2['account'][_0x1566('0x90')]){delete _0x55e1f2['account'][_0x1566('0x90')];}if(_0x55e1f2[_0x1566('0x96')]['List']&&_0x55e1f2[_0x1566('0x96')][_0x1566('0x8c')][_0x1566('0x8e')][_0x1566('0x3a')]){return _0x55e1f2['account']['List']['Contacts'][0x0];}var _0x2c7e8c=_['defaults'](_0xd568ff['body'],{'firstName':_0xd568ff['body'][_0x1566('0x8b')],'ListId':_0x28afa2[_0x1566('0x84')]});_0x2c7e8c[_0xd568ff[_0x1566('0x4c')]['mapKey']]=_0xd568ff[_0x1566('0x4c')][_0x1566('0x8b')];return db[_0x1566('0x8d')][_0x1566('0x4b')](_0x2c7e8c,{'fields':_0x5ed7c9,'raw':!![]});}})[_0x1566('0x12')](handleEntityNotFound(_0x3b3a14,null))['then'](function(_0x57e268){_0x55e1f2['contact']=_0x57e268;var _0x4b1259=_0xd568ff[_0x1566('0x4c')][_0x1566('0x97')];if(_0xd568ff[_0x1566('0x98')]['cf-connecting-ip']){_0x4b1259=_0xd568ff['headers'][_0x1566('0x99')];}else if(_0xd568ff[_0x1566('0x98')][_0x1566('0x9a')]){_0x4b1259=_[_0x1566('0x9b')](_0xd568ff[_0x1566('0x98')][_0x1566('0x9a')][_0x1566('0x9c')](','));}if(_0x57e268){var _0x1d1824={'ContactId':_0x57e268['id'],'ChatWebsiteId':_0xd568ff[_0x1566('0x55')]['id'],'from':(_0x57e268[_0x1566('0x9d')]||'')+'\x20'+(_0x57e268[_0x1566('0x9e')]||''),'customerIp':_0x4b1259,'customerPort':_0xd568ff[_0x1566('0x98')][_0x1566('0x9f')]?_0xd568ff['headers'][_0x1566('0x9f')]:null,'referer':_0xd568ff[_0x1566('0x4c')][_0x1566('0xa0')],'browserName':_0x330e02[_0x1566('0xa1')][_0x1566('0x2a')]&&_0x330e02[_0x1566('0xa1')]['version']?util[_0x1566('0xa2')](_0x1566('0xa3'),_0x330e02[_0x1566('0xa1')][_0x1566('0x2a')],_0x330e02[_0x1566('0xa1')][_0x1566('0xa4')]):_0x1566('0xa5'),'browserVersion':_0x330e02[_0x1566('0xa1')][_0x1566('0xa4')]||_0x1566('0xa5'),'osName':util['format'](_0x1566('0xa3'),_0x330e02['os'][_0x1566('0x2a')],_0x330e02['os'][_0x1566('0xa4')]),'osVersion':_0x330e02['os'][_0x1566('0xa4')],'deviceModel':_0x330e02[_0x1566('0xa6')][_0x1566('0x33')]&&_0x330e02[_0x1566('0xa6')][_0x1566('0xa7')]?util[_0x1566('0xa2')](_0x1566('0xa8'),_0x330e02[_0x1566('0xa6')][_0x1566('0x33')],_0x330e02['device'][_0x1566('0xa7')],_0x330e02[_0x1566('0xa6')][_0x1566('0x32')]):null,'deviceVendor':_0x330e02['device'][_0x1566('0xa7')],'deviceType':_0x330e02[_0x1566('0xa6')][_0x1566('0x32')],'formData':JSON[_0x1566('0x17')](_0xd568ff[_0x1566('0x4c')])};var _0x3d4d9a={'ChatWebsiteId':_0xd568ff[_0x1566('0x55')]['id'],'closed':![]};if(_0xd568ff[_0x1566('0x4c')][_0x1566('0xa9')]){_0x3d4d9a[_0x1566('0xa9')]=_0xd568ff['body']['threadId'];return db['ChatInteraction']['find']({'where':_0x3d4d9a})['then'](function(_0x23da5d){if(_0x23da5d){return[_0x23da5d,![]];}_0x1d1824[_0x1566('0xa9')]=_0xd568ff[_0x1566('0x4c')][_0x1566('0xa9')];_0x1d1824[_0x1566('0xaa')]=_0xd568ff[_0x1566('0x4c')][_0x1566('0xaa')];return db[_0x1566('0xab')][_0x1566('0x4b')](_0x1d1824)['then'](function(_0x4f2c70){return[_0x4f2c70,!![]];});});}_0x3d4d9a['ContactId']=_0x57e268['id'];if(_0xd568ff[_0x1566('0x4c')][_0x1566('0xac')]&&_0xd568ff[_0x1566('0x4c')][_0x1566('0xac')]['id']){_0x3d4d9a['id']=_0xd568ff[_0x1566('0x4c')]['interaction']['id'];return db[_0x1566('0xab')][_0x1566('0x51')]({'where':_0x3d4d9a})[_0x1566('0x12')](function(_0x38453a){if(_0x38453a){return[_0x38453a,![]];}return db[_0x1566('0xab')]['create'](_0x1d1824)[_0x1566('0x12')](function(_0x21080d){return[_0x21080d,!![]];});});}return db[_0x1566('0xab')][_0x1566('0x4b')](_0x1d1824)[_0x1566('0x12')](function(_0x514484){return[_0x514484,!![]];});}})[_0x1566('0xad')](function(_0x579005,_0x1c880f){if(_0x579005){_0x1b6711=_0x1c880f;if(!_0x1c880f){var _0x500f98={'from':(_0x55e1f2['contact'][_0x1566('0x9d')]||'')+'\x20'+(_0x55e1f2[_0x1566('0xae')]['lastName']||'')};if(_0xd568ff[_0x1566('0x4c')]['threadId']&&_0xd568ff[_0x1566('0x4c')][_0x1566('0xaf')]&&_0xd568ff[_0x1566('0x4c')][_0x1566('0xa9')]!=_0xd568ff[_0x1566('0x4c')][_0x1566('0xaf')]){_0x500f98['threadId']=_0xd568ff[_0x1566('0x4c')][_0x1566('0xaf')];}return _0x579005[_0x1566('0x25')](_0x500f98);}else{return _0x579005;}}})['then'](function(_0x3407df){_0x55e1f2[_0x1566('0xac')]=_0x3407df[_0x1566('0x27')]({'plain':!![]});_0x55e1f2['interaction'][_0x1566('0xb0')]=_0x1b6711;if(_0x55e1f2['interaction']['created']){if(_0x55e1f2[_0x1566('0x96')][_0x1566('0xb1')]){_0x55e1f2[_0x1566('0x91')]['push']({'id':0x0,'priority':_0x55e1f2['applications'][_0x1566('0x3a')]+0x1,'app':_0x1566('0xb2'),'appdata':_0x1566('0xb3'),'interval':_0x1566('0xb4')});}}return db['ChatMessage'][_0x1566('0x4b')]({'body':_0xd568ff[_0x1566('0x4c')][_0x1566('0x4c')],'ChatWebsiteId':_0xd568ff[_0x1566('0x55')]['id'],'ChatInteractionId':_0x3407df['id'],'direction':'in','ContactId':_0x55e1f2[_0x1566('0xae')]['id'],'AttachmentId':_0xd568ff[_0x1566('0x4c')]['AttachmentId']});})['then'](function(_0x4026b3){_0x55e1f2[_0x1566('0x1a')]=_0x4026b3;if(_0x55e1f2[_0x1566('0xac')]['UserId']){return db[_0x1566('0xb5')][_0x1566('0x51')]({'attributes':['id',_0x1566('0x2a')],'where':{'id':_0x55e1f2[_0x1566('0xac')][_0x1566('0xb6')]}})[_0x1566('0x12')](function(_0x5d0ffa){if(_0x5d0ffa){_0x55e1f2['applications'][_0x1566('0xb7')]({'id':0x0,'priority':0x0,'app':_0x1566('0xb8'),'appdata':_0x5d0ffa[_0x1566('0x2a')]+','+(_0x55e1f2[_0x1566('0x96')][_0x1566('0xb9')]||0xa),'interval':_0x1566('0xb4')});_0x55e1f2['forcedOwnership']=!![];}return respondWithRpcPromise(_0x1566('0xba'),'startRouting',_0x55e1f2);});}return respondWithRpcPromise(_0x1566('0xba'),'startRouting',_0x55e1f2);})[_0x1566('0x12')](function(_0x37529e){respondWithRpcPromise(_0x1566('0xbb'),'EventManager',{'event':_0x1566('0xbc'),'message':_0x37529e},client9002);return _0x37529e;})[_0x1566('0x12')](respondWithResult(_0x3b3a14,null))[_0x1566('0x1c')](handleError(_0x3b3a14,null));};exports[_0x1566('0xbd')]=function(_0x5e5204,_0x20f211){var _0x24ee5f,_0x3ea028,_0x3236a1;var _0xfeea68=[];var _0x3541a8={};var _0x1332e7=_0x5e5204[_0x1566('0xbe')]||[];var _0x13e1ed=[];var _0x2909eb;return db[_0x1566('0x8d')]['describe']()[_0x1566('0x12')](function(_0x4ad318){if(!_0x4ad318){throw new db[(_0x1566('0x7d'))][(_0x1566('0x7e'))](_0x1566('0x7f'));}_0xfeea68=_['difference'](_[_0x1566('0x35')](_0x4ad318),[_0x1566('0x81'),_0x1566('0x82'),_0x1566('0x83'),_0x1566('0x84')]);if(_0x5e5204[_0x1566('0x4c')]['id']){delete _0x5e5204[_0x1566('0x4c')]['id'];}if(_['isNil'](_0x5e5204['body'][_0x1566('0x8b')])){throw _0x20f211[_0x1566('0x1e')](0x1f4)[_0x1566('0x2b')](new db[(_0x1566('0x7d'))][(_0x1566('0x7e'))](_0x1566('0x85')));}if(_[_0x1566('0x6f')](_0x5e5204[_0x1566('0x4c')][_0x1566('0x4c')])||_0x5e5204[_0x1566('0x4c')][_0x1566('0x4c')]===''){throw _0x20f211[_0x1566('0x1e')](0x1f4)['send'](new db[(_0x1566('0x7d'))][(_0x1566('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x5e5204[_0x1566('0x4c')][_0x1566('0xbf')])){throw _0x20f211['status'](0x1f4)['send'](new db['Sequelize'][(_0x1566('0x7e'))](_0x1566('0xc0')+_0xfeea68));}if(!_['includes'](_0xfeea68,_0x5e5204['body']['mapKeyOffline'])){throw _0x20f211[_0x1566('0x1e')](0x1f4)[_0x1566('0x2b')](new db[(_0x1566('0x7d'))][(_0x1566('0x7e'))](_0x1566('0xc1')+_0xfeea68));}_0x3541a8[_0x5e5204[_0x1566('0x4c')]['mapKeyOffline']]=_0x5e5204[_0x1566('0x4c')][_0x1566('0x8b')];})['then'](function(){return db['ChatWebsite'][_0x1566('0x51')]({'where':{'id':_0x5e5204[_0x1566('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x1566('0x8c')},{'model':db['MailAccount'],'as':_0x1566('0xc2')}]});})['then'](handleEntityNotFound(_0x20f211,null))[_0x1566('0x12')](function(_0x475e08){if(_0x475e08&&_0x475e08['List']){_0x3ea028=_0x475e08;var _0x2f304b=_[_0x1566('0xc3')](_0x5e5204['body'],{'firstName':_0x5e5204['body'][_0x1566('0x8b')],'phone':_0x5e5204[_0x1566('0x4c')][_0x1566('0x8b')],'ListId':_0x475e08['ListId']});_0x2f304b[_0x5e5204[_0x1566('0x4c')][_0x1566('0xbf')]]=_0x5e5204[_0x1566('0x4c')][_0x1566('0x8b')];return db[_0x1566('0x8d')][_0x1566('0xc4')]({'where':_0x3541a8,'defaults':_0x2f304b});}})[_0x1566('0xad')](function(_0x1a8ecc){if(_0x1a8ecc){_0x3236a1=_0x1a8ecc;var _0x1d7c21=fs[_0x1566('0xc5')](path[_0x1566('0x6a')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x1566('0xc6'));var _0x5f2201=ejs['render'](_0x1d7c21,{'body':_['toPairs'](_0x5e5204[_0x1566('0x4c')][_0x1566('0x4c')]),'bodyTitle':_0x3ea028[_0x1566('0xc7')]});return db[_0x1566('0xc8')]['create']({'body':_0x5f2201,'ContactId':_0x1a8ecc['id'],'ChatWebsiteId':_0x3ea028['id']});}})['then'](function(_0x2704c1){_0x2909eb=_0x2704c1;if(_0x1332e7[_0x1566('0x3a')]){var _0x16f23e=_0x1332e7['map'](function(_0x323af4){return{'name':_0x323af4[_0x1566('0xc9')],'basename':_0x323af4[_0x1566('0x62')],'type':_0x323af4[_0x1566('0xca')],'ChatOfflineMessageId':_0x2704c1['id']};});_0x13e1ed=_0x16f23e[_0x1566('0x2f')](_0x1fcd22=>{var _0x5dd320={'filename':_0x1fcd22[_0x1566('0x2a')],'path':path[_0x1566('0x6a')](config[_0x1566('0x6b')],_0x1566('0xcb'),_0x1566('0xbe'),_0x1566('0xcc'),_0x1566('0xcd'),_0x1fcd22[_0x1566('0xce')])};return _0x5dd320;});if(!_0x3ea028[_0x1566('0xcf')]){return db[_0x1566('0xd0')]['transaction'](function(_0x140dad){return db[_0x1566('0xd1')][_0x1566('0xd2')](_0x16f23e,{'transaction':_0x140dad});});}}})[_0x1566('0x12')](function(){if(_0x2909eb){_0x24ee5f=_0x2909eb;return db[_0x1566('0xc2')][_0x1566('0x5a')]({'where':{'active':!![]},'include':[{'model':db[_0x1566('0xd3')],'as':_0x1566('0xd4'),'raw':!![]}]});}})[_0x1566('0x12')](function(_0x37120b){if(_0x37120b&&_0x37120b['Smtp']&&_0x3ea028[_0x1566('0xd5')]&&_0x3ea028[_0x1566('0xd6')]){var _0x25efee={'tls':{'rejectUnauthorized':![]}};if(_0x37120b['Smtp'][_0x1566('0xd7')]){_0x25efee['service']=_0x37120b[_0x1566('0xd4')][_0x1566('0xd7')];}else{_0x25efee[_0x1566('0xd8')]=_0x37120b[_0x1566('0xd4')][_0x1566('0xd8')];_0x25efee['port']=_0x37120b[_0x1566('0xd4')][_0x1566('0xd9')];_0x25efee[_0x1566('0xda')]=_0x37120b['Smtp'][_0x1566('0xda')];}if(_0x37120b[_0x1566('0xd4')][_0x1566('0xdb')]){_0x25efee[_0x1566('0xdc')]={'user':_0x37120b['Smtp'][_0x1566('0x4f')],'pass':_0x37120b[_0x1566('0xd4')][_0x1566('0xdd')]};}return respondWithRpcPromise(_0x1566('0xde'),_0x1566('0xdf'),{'account':_0x25efee,'message':{'from':util['format'](_0x1566('0xe0'),_0x37120b[_0x1566('0x2a')],_0x37120b[_0x1566('0xe1')]||_0x37120b['Smtp'][_0x1566('0x4f')]),'to':_0x3ea028[_0x1566('0xd6')],'subject':_0x3ea028['offlineMessageSubject'],'html':_0x24ee5f[_0x1566('0x4c')],'attachments':_0x13e1ed}},client9003)[_0x1566('0x12')](function(){return _0x24ee5f;})[_0x1566('0x1c')](function(_0x5828af){console[_0x1566('0x18')](_0x5828af);});}})['then'](function(){if(_0x3ea028&&_0x3ea028[_0x1566('0xcf')]&&_0x3ea028['MailAccountId']){var _0x521944=[];if(_0x1332e7['length']){_0x521944=_0x1332e7['map'](function(_0x2fe587){return{'name':_0x2fe587['originalname'],'basename':_0x2fe587['filename'],'type':_0x2fe587[_0x1566('0xca')],'ChatOfflineMessageId':_0x2909eb['id']};});}var _0x592294;if(!_[_0x1566('0x6f')](_0x3ea028[_0x1566('0xe2')])){var _0x13fd53=_[_0x1566('0x2f')](_0x5e5204[_0x1566('0x4c')],function(_0xb5cb43){return _0xb5cb43;});var _0x51212a=_[_0x1566('0xe3')](_0x13fd53)[0x0];var _0x2d4cbd=_['mapValues'](_0x51212a,function(_0x5f0619){return _0x5f0619;});_0x592294=_0x2d4cbd[0x1][_0x3ea028[_0x1566('0xe2')]];}var _0x29df9d={'from':_0x3236a1['email'],'firstName':_0x3236a1[_0x1566('0x9d')],'lastName':_0x3236a1[_0x1566('0x9e')],'mapKey':_0x1566('0xe1'),'message':{'from':_0x3236a1['email'],'to':_0x3ea028['MailAccount'][_0x1566('0xe1')],'cc':'','subject':_[_0x1566('0x6f')](_0x592294)?_0x3ea028['offlineMessageSubject']:_0x592294,'messageId':'','sentAt':new Date(),'attach':_0x521944[_0x1566('0x3a')],'attachments':_0x521944,'originChannel':'Chat','ChatWebsiteId':_0x3ea028['id'],'ChatOfflineMessageId':_0x24ee5f['id'],'originTo':_0x3ea028['MailAccount']['email']},'body':_0x24ee5f[_0x1566('0x4c')]};var _0x27b836={'account':{'id':_0x3ea028[_0x1566('0xe4')]},'body':_0x29df9d,'log':_0x1566('0xe5')};return respondWithRpcPromise(_0x1566('0xe5'),_0x1566('0xe6'),_0x27b836,client9001)[_0x1566('0x12')](function(){return _0x24ee5f;})['catch'](function(_0x20a4f2){console[_0x1566('0x18')](_0x20a4f2);});}return;})[_0x1566('0x12')](function(){if(_0x24ee5f){return _0x24ee5f;}})['then'](respondWithResult(_0x20f211,null))[_0x1566('0x1c')](function(_0x4dea43){console[_0x1566('0x18')](_0x1566('0x1c'),_0x4dea43);for(var _0x40b1e8 of _0x1332e7){var _0x5338c3=path['join'](config[_0x1566('0x6b')],_0x1566('0xcb'),_0x1566('0xbe'),_0x1566('0xcc'),_0x1566('0xcd'),_0x40b1e8['filename']);fs_extra['remove'](_0x5338c3)['catch'](function(_0x1d4d42){console[_0x1566('0x18')](_0x1566('0xe7'),_0x5338c3,_0x1d4d42);});}});};exports['addInteraction']=function(_0xc10a5,_0x47d07a){return db[_0x1566('0xab')][_0x1566('0x51')]({'where':{'id':_0xc10a5[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x47d07a,null))['then'](function(_0x2159cc){if(_0x2159cc){return _0x2159cc[_0x1566('0xe8')](_0xc10a5[_0x1566('0x4c')][_0x1566('0x5c')],_['omit'](_0xc10a5[_0x1566('0x4c')],['ids','id'])||{});}})[_0x1566('0x12')](respondWithResult(_0x47d07a,null))[_0x1566('0x1c')](handleError(_0x47d07a,null));};exports['getInteractions']=function(_0x4c8991,_0x496e16){var _0x3aef6f={'raw':![],'where':{}};var _0x28c73b={};var _0x5b4256={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1566('0x5a')]({'where':{'id':_0x4c8991['params']['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x496e16,null))[_0x1566('0x12')](function(_0x2f935d){if(_0x2f935d){_0x28c73b['model']=_[_0x1566('0x35')](db[_0x1566('0xab')][_0x1566('0x49')]);_0x28c73b[_0x1566('0x34')]=_[_0x1566('0x35')](_0x4c8991[_0x1566('0x34')]);_0x28c73b[_0x1566('0x36')]=_['intersection'](_0x28c73b[_0x1566('0x33')],_0x28c73b[_0x1566('0x34')]);_0x3aef6f[_0x1566('0x39')]=_[_0x1566('0x37')](_0x28c73b[_0x1566('0x33')],qs['fields'](_0x4c8991[_0x1566('0x34')]['fields']));_0x3aef6f[_0x1566('0x39')]=_0x3aef6f[_0x1566('0x39')][_0x1566('0x3a')]?_0x3aef6f[_0x1566('0x39')]:_0x28c73b['model'];if(!_0x4c8991[_0x1566('0x34')][_0x1566('0x3b')](_0x1566('0x3c'))){_0x3aef6f[_0x1566('0x22')]=qs['limit'](_0x4c8991[_0x1566('0x34')][_0x1566('0x22')]);_0x3aef6f[_0x1566('0x20')]=qs[_0x1566('0x20')](_0x4c8991[_0x1566('0x34')]['offset']);}_0x3aef6f[_0x1566('0x3d')]=qs[_0x1566('0x3e')](_0x4c8991[_0x1566('0x34')][_0x1566('0x3e')]);_0x3aef6f['where']=qs['filters'](_[_0x1566('0x3f')](_0x4c8991[_0x1566('0x34')],_0x28c73b[_0x1566('0x36')]));_0x3aef6f[_0x1566('0x41')][_0x1566('0x58')]=_0x2f935d['id'];if(_0x4c8991['query'][_0x1566('0x40')]){_0x3aef6f[_0x1566('0x41')]=_[_0x1566('0x42')](_0x3aef6f[_0x1566('0x41')],{'$or':_['map'](_0x3aef6f[_0x1566('0x39')],function(_0x4232c8){var _0x143bf6={};_0x143bf6[_0x4232c8]={'$like':'%'+_0x4c8991[_0x1566('0x34')]['filter']+'%'};return _0x143bf6;})});}_0x3aef6f=_[_0x1566('0x42')]({},_0x3aef6f,_0x4c8991[_0x1566('0x44')]);return db[_0x1566('0xab')][_0x1566('0x23')]({'where':_0x3aef6f[_0x1566('0x41')]})['then'](function(_0x326d28){_0x5b4256[_0x1566('0x23')]=_0x326d28;if(_0x4c8991[_0x1566('0x34')][_0x1566('0x4a')]){_0x3aef6f[_0x1566('0x45')]=[{'model':db[_0x1566('0x8d')],'as':'Contact','required':![]},{'model':db[_0x1566('0xb5')],'as':_0x1566('0xe9'),'attributes':[_0x1566('0x2a'),'fullname',_0x1566('0xea')],'required':![]},{'model':db['Tag'],'as':_0x1566('0xeb'),'attributes':['id','name',_0x1566('0xec')],'where':_0x4c8991[_0x1566('0x34')][_0x1566('0xed')]?{'id':_0x4c8991[_0x1566('0x34')]['tag']}:undefined,'required':_0x4c8991[_0x1566('0x34')][_0x1566('0xed')]?!![]:![]}];}return db[_0x1566('0xab')][_0x1566('0x46')](_0x3aef6f);})['then'](function(_0x32f8ad){_0x5b4256[_0x1566('0x47')]=_0x32f8ad;return _0x5b4256;});}})[_0x1566('0x12')](respondWithFilteredResult(_0x496e16,_0x3aef6f))[_0x1566('0x1c')](handleError(_0x496e16,null));};function iftimePromise(_0x75a9f3,_0xff0c27){return respondWithRpcPromise(_0x1566('0xee'),'getSnippet',{'command':_0xff0c27[_0x1566('0xef')]?util['format'](_0x1566('0xf0'),_0x75a9f3[_0x1566('0xf1')],_0xff0c27['timezone']):util[_0x1566('0xa2')](_0x1566('0xf2'),_0x75a9f3[_0x1566('0xf1')])},client9002)['then'](function(_0x38c955){var _0x127c3a=_0x38c955&&_0x38c955[_0x1566('0xf3')](_0x1566('0xf4'))>=0x0?!![]:![];logger[_0x1566('0x13')](_0x1566('0xf5'),_0xff0c27['id'],_0x75a9f3['id'],_0x75a9f3[_0x1566('0xf1')],_0x127c3a?_0x1566('0xf6'):_0x1566('0xf7'),_0xff0c27[_0x1566('0xef')]?_0xff0c27[_0x1566('0xef')]:_0x1566('0xf8'));return _0x127c3a;})[_0x1566('0x1c')](function(_0x5c4960){logger[_0x1566('0x18')](_0x1566('0xf5'),_0xff0c27['id'],_0x75a9f3['id'],_0x75a9f3['interval'],util[_0x1566('0xf9')](_0x5c4960,{'showHidden':![],'depth':null}),_0xff0c27[_0x1566('0xef')]?_0xff0c27[_0x1566('0xef')]:_0x1566('0xf8'));return![];});}exports[_0x1566('0xfa')]=function(_0x53078b,_0x38e456){var _0x34d6fe=0x0;var _0x55103b=0x0;var _0x3bf4c0=![];var _0xafe79;var _0x3993d3;return db[_0x1566('0x30')]['find']({'where':{'id':_0x53078b[_0x1566('0x55')]['id']},'include':[{'model':db[_0x1566('0xfb')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x1566('0xfc'),'attributes':['id',_0x1566('0xf1')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x38e456,null))[_0x1566('0x12')](function(_0x5ab87b){if(_0x5ab87b){_0xafe79=_0x5ab87b;return _0x5ab87b[_0x1566('0xfd')]({'raw':!![]});}})[_0x1566('0x12')](function(_0x305e0e){if(_0xafe79){if(_0x305e0e){_0x3993d3=_0x305e0e;}}return require(_0x1566('0x6d'))[_0x1566('0x6e')]();})[_0x1566('0x12')](function(_0x4c8e70){if(_0x4c8e70){_0x55103b=_0x4c8e70[_0x1566('0xfe')];_0x3bf4c0=_0x4c8e70[_0x1566('0xff')];}})['then'](function(){return db[_0x1566('0xab')][_0x1566('0x23')]({'where':{'closed':![]}});})[_0x1566('0x12')](function(_0x5513d3){_0x34d6fe=_0x5513d3;if(_0x55103b&&_0x5513d3>_0x55103b){return db['License'][_0x1566('0x5a')]({'where':{'id':0x1}})['then'](function(_0x223fdb){if(_0x223fdb){_0x223fdb[_0x1566('0x100')](_0x1566('0x101'));}});}})[_0x1566('0x12')](function(){if(_0xafe79[_0x1566('0xfb')]&&_0xafe79['Interval']['Intervals']){var _0x3bb853=[];for(var _0x8fef3=0x0;_0x8fef3<_0xafe79[_0x1566('0xfb')][_0x1566('0xfc')]['length'];_0x8fef3++){var _0x31595d=_0xafe79[_0x1566('0xfb')][_0x1566('0xfc')][_0x8fef3]['get']({'plain':!![]});_0x3bb853['push'](iftimePromise(_0x31595d,_0xafe79));}return BPromise[_0x1566('0x102')](_0x3bb853)[_0x1566('0x12')](function(_0x24a81f){return _['some'](_0x24a81f);});}else{return!![];}})['then'](function(_0x1c6e69){var _0x311584=fs[_0x1566('0xc5')](path[_0x1566('0x6a')](config[_0x1566('0x6b')],_0x1566('0x103')),_0x1566('0xc6'));var _0x41c8b5={'remote':_0xafe79[_0x1566('0x104')],'query':querystring[_0x1566('0x17')](_[_0x1566('0x42')](_0xafe79['get']({'plain':!![]}),{'customerIp':_0x53078b['headers'][_0x1566('0x9a')]||_0x53078b[_0x1566('0x98')]['x-real-ip']||_0x53078b[_0x1566('0x105')][_0x1566('0x106')]||_0x53078b['ip'],'referer':_0x53078b[_0x1566('0x98')][_0x1566('0xa0')],'openedInteractions':_0x34d6fe,'maxInteractions':_0x55103b,'virtual':_0x3bf4c0[_0x1566('0xfe')],'online':_0x1c6e69,'custom':_0x3bf4c0}))['replace'](/'/g,'\x5c\x27')};_0x38e456[_0x1566('0x2b')](ejs['render'](Mustache['render'](_0x311584,_0x41c8b5),{'proactiveActions':_0x3993d3,'alignment':_0xafe79[_0x1566('0x107')],'verticalAlignment':_0xafe79[_0x1566('0x108')],'div_color':_0xafe79['color'],'text_color':_0xafe79['textColor'],'button_color':_0xafe79['color_button'],'background_color':_0xafe79[_0x1566('0x109')]}));})[_0x1566('0x1c')](handleError(_0x38e456,null));};exports[_0x1566('0x10a')]=function(_0x3ef9a3,_0x2dccd3){var _0x5ce5f2=_0x3ef9a3['params']['id'];var _0x21f672=_0x3ef9a3[_0x1566('0x4c')];var _0x1b7fbc=0xc8;var _0x18397c=null;return db[_0x1566('0xd0')]['transaction']({'isolationLevel':db['sequelize'][_0x1566('0x10b')]['ISOLATION_LEVELS'][_0x1566('0x10c')]},function(_0x37269d){return db[_0x1566('0x30')][_0x1566('0x5a')]({'where':{'id':_0x5ce5f2},'transaction':_0x37269d})[_0x1566('0x12')](function(_0x503597){if(_0x503597){return db[_0x1566('0x10d')][_0x1566('0x26')]({'where':{'ChatWebsiteId':_0x5ce5f2},'transaction':_0x37269d})[_0x1566('0x12')](function(){var _0x22f843=_[_0x1566('0x2f')](_0x21f672,function(_0x4fc298){_0x4fc298[_0x1566('0x58')]=_0x5ce5f2;return _0x4fc298;});return db[_0x1566('0x10d')][_0x1566('0xd2')](_0x22f843,{'transaction':_0x37269d});});}else{_0x1b7fbc=0x194;_0x18397c=[];}});})[_0x1566('0x12')](function(){if(_0x1b7fbc!==0x194){return db[_0x1566('0x10d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5ce5f2},'order':_0x1566('0x94')})['then'](function(_0x24415e){_0x18397c=_0x24415e;});}})[_0x1566('0x1c')](function(_0x5360b1){_0x1b7fbc=0x1f4;logger[_0x1566('0x18')](_0x5360b1['stack']);if(_0x5360b1[_0x1566('0x2a')]){delete _0x5360b1['name'];}_0x18397c=_0x5360b1;})[_0x1566('0x10e')](function(){if(_0x18397c===null){_0x2dccd3[_0x1566('0x1d')](_0x1b7fbc);}else{if(_0x1b7fbc===0x1f4){_0x2dccd3['status'](_0x1b7fbc)['send'](_0x18397c);}else{_0x2dccd3['status'](_0x1b7fbc)['json'](_0x18397c);}}});};exports['getApplications']=function(_0x445a92,_0x4a9625){var _0x457498={};var _0x2681c7={};var _0x1878f3;var _0x1ab227;return db['ChatWebsite'][_0x1566('0x5a')]({'where':{'id':_0x445a92[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x4a9625,null))[_0x1566('0x12')](function(_0x392c29){if(_0x392c29){_0x1878f3=_0x392c29;_0x2681c7['model']=_['keys'](db[_0x1566('0x10d')][_0x1566('0x49')]);_0x2681c7['query']=_[_0x1566('0x35')](_0x445a92[_0x1566('0x34')]);_0x2681c7['filters']=_[_0x1566('0x37')](_0x2681c7[_0x1566('0x33')],_0x2681c7['query']);_0x457498[_0x1566('0x39')]=_[_0x1566('0x37')](_0x2681c7[_0x1566('0x33')],qs[_0x1566('0x38')](_0x445a92['query'][_0x1566('0x38')]));_0x457498[_0x1566('0x39')]=_0x457498[_0x1566('0x39')][_0x1566('0x3a')]?_0x457498[_0x1566('0x39')]:_0x2681c7[_0x1566('0x33')];_0x457498['order']=qs['sort'](_0x445a92[_0x1566('0x34')][_0x1566('0x3e')]);_0x457498['where']=qs[_0x1566('0x36')](_[_0x1566('0x3f')](_0x445a92[_0x1566('0x34')],_0x2681c7[_0x1566('0x36')]));if(_0x445a92[_0x1566('0x34')][_0x1566('0x40')]){_0x457498[_0x1566('0x41')]=_[_0x1566('0x42')](_0x457498[_0x1566('0x41')],{'$or':_['map'](_0x457498['attributes'],function(_0x43f494){var _0x17d722={};_0x17d722[_0x43f494]={'$like':'%'+_0x445a92[_0x1566('0x34')]['filter']+'%'};return _0x17d722;})});}_0x457498=_[_0x1566('0x42')]({},_0x457498,_0x445a92[_0x1566('0x44')]);return _0x1878f3[_0x1566('0x10f')](_0x457498);}})[_0x1566('0x12')](function(_0x21cfca){if(_0x21cfca){_0x1ab227=_0x21cfca[_0x1566('0x3a')];if(!_0x445a92[_0x1566('0x34')][_0x1566('0x3b')](_0x1566('0x3c'))){_0x457498['limit']=qs[_0x1566('0x22')](_0x445a92['query'][_0x1566('0x22')]);_0x457498[_0x1566('0x20')]=qs[_0x1566('0x20')](_0x445a92[_0x1566('0x34')][_0x1566('0x20')]);}return _0x1878f3[_0x1566('0x10f')](_0x457498);}})[_0x1566('0x12')](function(_0x1cadee){if(_0x1cadee){return _0x1cadee?{'count':_0x1ab227,'rows':_0x1cadee}:null;}})[_0x1566('0x12')](respondWithResult(_0x4a9625,null))[_0x1566('0x1c')](handleError(_0x4a9625,null));};exports[_0x1566('0x110')]=function(_0x375157,_0x415a3f){return db['chatProactiveAction'][_0x1566('0x51')]({'where':{'id':_0x375157[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x415a3f,null))[_0x1566('0x12')](function(_0x3a7ef6){if(_0x3a7ef6){return _0x3a7ef6['addProactiveActions'](_0x375157['body'][_0x1566('0x5c')],_[_0x1566('0x111')](_0x375157[_0x1566('0x4c')],[_0x1566('0x5c'),'id'])||{});}})[_0x1566('0x12')](respondWithResult(_0x415a3f,null))[_0x1566('0x1c')](handleError(_0x415a3f,null));};exports[_0x1566('0xfd')]=function(_0xe9840,_0x3047da){var _0x1ee789={};var _0x443eb3={};var _0x5e67b6;var _0x57b082;return db['ChatWebsite'][_0x1566('0x5a')]({'where':{'id':_0xe9840[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x3047da,null))[_0x1566('0x12')](function(_0x1e1373){if(_0x1e1373){_0x5e67b6=_0x1e1373;_0x443eb3['model']=_[_0x1566('0x35')](db[_0x1566('0x112')]['rawAttributes']);_0x443eb3[_0x1566('0x34')]=_[_0x1566('0x35')](_0xe9840['query']);_0x443eb3[_0x1566('0x36')]=_[_0x1566('0x37')](_0x443eb3[_0x1566('0x33')],_0x443eb3['query']);_0x1ee789[_0x1566('0x39')]=_['intersection'](_0x443eb3[_0x1566('0x33')],qs['fields'](_0xe9840['query'][_0x1566('0x38')]));_0x1ee789[_0x1566('0x39')]=_0x1ee789[_0x1566('0x39')][_0x1566('0x3a')]?_0x1ee789[_0x1566('0x39')]:_0x443eb3[_0x1566('0x33')];_0x1ee789[_0x1566('0x3d')]=qs[_0x1566('0x3e')](_0xe9840[_0x1566('0x34')][_0x1566('0x3e')]);_0x1ee789['where']=qs[_0x1566('0x36')](_[_0x1566('0x3f')](_0xe9840[_0x1566('0x34')],_0x443eb3[_0x1566('0x36')]));if(_0xe9840['query'][_0x1566('0x40')]){_0x1ee789['where']=_['merge'](_0x1ee789[_0x1566('0x41')],{'$or':_[_0x1566('0x2f')](_0x1ee789[_0x1566('0x39')],function(_0x462f23){var _0xe43159={};_0xe43159[_0x462f23]={'$like':'%'+_0xe9840[_0x1566('0x34')][_0x1566('0x40')]+'%'};return _0xe43159;})});}_0x1ee789=_[_0x1566('0x42')]({},_0x1ee789,_0xe9840['options']);return _0x5e67b6['getProactiveActions'](_0x1ee789);}})['then'](function(_0x4b6eb9){if(_0x4b6eb9){_0x57b082=_0x4b6eb9['length'];if(!_0xe9840[_0x1566('0x34')][_0x1566('0x3b')]('nolimit')){_0x1ee789['limit']=qs[_0x1566('0x22')](_0xe9840[_0x1566('0x34')][_0x1566('0x22')]);_0x1ee789['offset']=qs['offset'](_0xe9840[_0x1566('0x34')][_0x1566('0x20')]);}return _0x5e67b6[_0x1566('0xfd')](_0x1ee789);}})[_0x1566('0x12')](function(_0xd948c1){if(_0xd948c1){return _0xd948c1?{'count':_0x57b082,'rows':_0xd948c1}:null;}})[_0x1566('0x12')](respondWithResult(_0x3047da,null))[_0x1566('0x1c')](handleError(_0x3047da,null));};exports[_0x1566('0x113')]=function(_0x541fe3,_0x53c740){var _0x4e3bd0=_0x541fe3[_0x1566('0x34')]['online']===_0x1566('0x114')?_0x1566('0x115'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x4e3bd0],'where':{'id':_0x541fe3['params']['id']}})['then'](handleEntityNotFound(_0x53c740,null))[_0x1566('0x12')](function(_0x772be2){if(_0x772be2){var _0x58d8bb=_0x772be2[_0x4e3bd0];var _0x58d2f9=_0x58d8bb&&_0x58d8bb[_0x1566('0x116')]?_0x58d8bb['items']:[];_0x53c740[_0x1566('0x2b')]({'fromKey':_[_0x1566('0x6f')](_0x58d8bb['fromKey'])?undefined:_0x58d8bb[_0x1566('0x117')],'count':_0x58d2f9[_0x1566('0x3a')],'rows':_0x58d2f9});}})[_0x1566('0x1c')](handleError(_0x53c740,null));};exports[_0x1566('0x118')]=function(_0x53696b,_0x4ab754){var _0x3d4457={'raw':![],'where':{}};var _0x24c98f={};var _0x41335a={'count':0x0,'rows':[]};return db[_0x1566('0x30')][_0x1566('0x5a')]({'where':{'id':_0x53696b[_0x1566('0x55')]['id']}})[_0x1566('0x12')](handleEntityNotFound(_0x4ab754,null))['then'](function(_0x328bff){if(_0x328bff){_0x24c98f[_0x1566('0x33')]=_['keys'](db['ChatOfflineMessage'][_0x1566('0x49')]);_0x24c98f[_0x1566('0x34')]=_[_0x1566('0x35')](_0x53696b['query']);_0x24c98f[_0x1566('0x36')]=_[_0x1566('0x37')](_0x24c98f[_0x1566('0x33')],_0x24c98f[_0x1566('0x34')]);_0x3d4457[_0x1566('0x39')]=_[_0x1566('0x37')](_0x24c98f[_0x1566('0x33')],qs[_0x1566('0x38')](_0x53696b[_0x1566('0x34')][_0x1566('0x38')]));_0x3d4457[_0x1566('0x39')]=_0x3d4457[_0x1566('0x39')][_0x1566('0x3a')]?_0x3d4457['attributes']:_0x24c98f['model'];if(!_0x53696b[_0x1566('0x34')][_0x1566('0x3b')](_0x1566('0x3c'))){_0x3d4457['limit']=qs[_0x1566('0x22')](_0x53696b[_0x1566('0x34')][_0x1566('0x22')]);_0x3d4457['offset']=qs[_0x1566('0x20')](_0x53696b['query'][_0x1566('0x20')]);}_0x3d4457['order']=qs[_0x1566('0x3e')](_0x53696b[_0x1566('0x34')][_0x1566('0x3e')]);_0x3d4457['where']=qs[_0x1566('0x36')](_['pick'](_0x53696b[_0x1566('0x34')],_0x24c98f[_0x1566('0x36')]));_0x3d4457[_0x1566('0x41')][_0x1566('0x58')]=_0x328bff['id'];if(_0x53696b[_0x1566('0x34')]['filter']){_0x3d4457[_0x1566('0x41')]=_[_0x1566('0x42')](_0x3d4457['where'],{'$or':_[_0x1566('0x2f')](_0x3d4457[_0x1566('0x39')],function(_0x1d51c4){var _0x969e94={};_0x969e94[_0x1d51c4]={'$like':'%'+_0x53696b[_0x1566('0x34')][_0x1566('0x40')]+'%'};return _0x969e94;})});}_0x3d4457=_['merge']({},_0x3d4457,_0x53696b[_0x1566('0x44')]);return db[_0x1566('0xc8')][_0x1566('0x23')]({'where':_0x3d4457[_0x1566('0x41')]})[_0x1566('0x12')](function(_0x15614e){_0x41335a[_0x1566('0x23')]=_0x15614e;if(_0x53696b[_0x1566('0x34')][_0x1566('0x4a')]){_0x3d4457['include']=[{'all':!![]}];}else{_0x3d4457[_0x1566('0x45')]=[{'model':db['CmContact'],'as':_0x1566('0x119'),'required':![]},{'model':db[_0x1566('0xd1')],'as':_0x1566('0x11a'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x3d4457);})[_0x1566('0x12')](function(_0x450798){_0x41335a[_0x1566('0x47')]=_0x450798;return _0x41335a;});}})[_0x1566('0x12')](respondWithFilteredResult(_0x4ab754,_0x3d4457))[_0x1566('0x1c')](handleError(_0x4ab754,null));};exports[_0x1566('0x11b')]=function(_0x1759de,_0xf2fcca){return db[_0x1566('0x30')][_0x1566('0x51')]({'where':{'id':_0x1759de[_0x1566('0x55')]['id']}})['then'](handleEntityNotFound(_0xf2fcca,null))[_0x1566('0x12')](function(_0x5aef99){if(_0x5aef99){return _0x5aef99['addAgents'](_0x1759de['body']['ids'],_[_0x1566('0x111')](_0x1759de[_0x1566('0x4c')],['ids','id'])||{})['spread'](function(_0x149e71){for(var _0x26f114=0x0;_0x26f114<_0x1759de[_0x1566('0x4c')]['ids']['length'];_0x26f114+=0x1){socket[_0x1566('0x11c')](_0x1566('0x11d'),{'UserId':Number(_0x1759de[_0x1566('0x4c')][_0x1566('0x5c')][_0x26f114]),'ChatWebsiteId':Number(_0x1759de[_0x1566('0x55')]['id'])});}return _0x149e71;});}})[_0x1566('0x12')](respondWithResult(_0xf2fcca,null))[_0x1566('0x1c')](handleError(_0xf2fcca,null));};exports[_0x1566('0x11e')]=function(_0x8b69e8,_0x9f9d37){return db['ChatWebsite'][_0x1566('0x51')]({'where':{'id':_0x8b69e8[_0x1566('0x55')]['id']}})['then'](handleEntityNotFound(_0x9f9d37,null))[_0x1566('0x12')](function(_0x385b5c){if(_0x385b5c){return _0x385b5c[_0x1566('0x11e')](_0x8b69e8[_0x1566('0x34')][_0x1566('0x5c')])[_0x1566('0x12')](function(){if(_[_0x1566('0x11f')](_0x8b69e8[_0x1566('0x34')][_0x1566('0x5c')])){for(var _0x4cd77c=0x0;_0x4cd77c<_0x8b69e8[_0x1566('0x34')][_0x1566('0x5c')][_0x1566('0x3a')];_0x4cd77c+=0x1){socket[_0x1566('0x11c')](_0x1566('0x120'),{'UserId':Number(_0x8b69e8[_0x1566('0x34')][_0x1566('0x5c')][_0x4cd77c]),'ChatWebsiteId':Number(_0x8b69e8[_0x1566('0x55')]['id'])});}}else{socket[_0x1566('0x11c')](_0x1566('0x120'),{'UserId':Number(_0x8b69e8[_0x1566('0x34')][_0x1566('0x5c')]),'ChatWebsiteId':Number(_0x8b69e8['params']['id'])});}});}})[_0x1566('0x12')](respondWithStatusCode(_0x9f9d37,null))[_0x1566('0x1c')](handleError(_0x9f9d37,null));};exports[_0x1566('0x121')]=function(_0x2f33d9,_0x2fd026){var _0x3dcb6e={};var _0x3a1fca={};var _0x55806b;var _0x7adee7;return db[_0x1566('0x30')][_0x1566('0x5a')]({'where':{'id':_0x2f33d9[_0x1566('0x55')]['id']}})['then'](handleEntityNotFound(_0x2fd026,null))[_0x1566('0x12')](function(_0x43088a){if(_0x43088a){_0x55806b=_0x43088a;_0x3a1fca[_0x1566('0x33')]=_[_0x1566('0x35')](db['User'][_0x1566('0x49')]);_0x3a1fca[_0x1566('0x34')]=_['keys'](_0x2f33d9[_0x1566('0x34')]);_0x3a1fca[_0x1566('0x36')]=_['intersection'](_0x3a1fca[_0x1566('0x33')],_0x3a1fca[_0x1566('0x34')]);_0x3dcb6e[_0x1566('0x39')]=_[_0x1566('0x37')](_0x3a1fca['model'],qs[_0x1566('0x38')](_0x2f33d9[_0x1566('0x34')][_0x1566('0x38')]));_0x3dcb6e['attributes']=_0x3dcb6e[_0x1566('0x39')][_0x1566('0x3a')]?_0x3dcb6e[_0x1566('0x39')]:_0x3a1fca[_0x1566('0x33')];_0x3dcb6e[_0x1566('0x3d')]=qs[_0x1566('0x3e')](_0x2f33d9[_0x1566('0x34')][_0x1566('0x3e')]);_0x3dcb6e[_0x1566('0x41')]=qs['filters'](_[_0x1566('0x3f')](_0x2f33d9[_0x1566('0x34')],_0x3a1fca['filters']));if(_0x2f33d9[_0x1566('0x34')][_0x1566('0x40')]){_0x3dcb6e[_0x1566('0x41')]=_['merge'](_0x3dcb6e['where'],{'$or':_[_0x1566('0x2f')](_0x3dcb6e[_0x1566('0x39')],function(_0x10255e){var _0x5c99f3={};_0x5c99f3[_0x10255e]={'$like':'%'+_0x2f33d9[_0x1566('0x34')][_0x1566('0x40')]+'%'};return _0x5c99f3;})});}_0x3dcb6e=_[_0x1566('0x42')]({},_0x3dcb6e,_0x2f33d9[_0x1566('0x44')]);return _0x55806b[_0x1566('0x121')](_0x3dcb6e);}})[_0x1566('0x12')](function(_0x54ae07){if(_0x54ae07){_0x7adee7=_0x54ae07[_0x1566('0x3a')];if(!_0x2f33d9[_0x1566('0x34')][_0x1566('0x3b')](_0x1566('0x3c'))){_0x3dcb6e[_0x1566('0x22')]=qs[_0x1566('0x22')](_0x2f33d9[_0x1566('0x34')][_0x1566('0x22')]);_0x3dcb6e[_0x1566('0x20')]=qs[_0x1566('0x20')](_0x2f33d9[_0x1566('0x34')][_0x1566('0x20')]);}return _0x55806b[_0x1566('0x121')](_0x3dcb6e);}})['then'](function(_0x58bd5e){if(_0x58bd5e){return _0x58bd5e?{'count':_0x7adee7,'rows':_0x58bd5e}:null;}})[_0x1566('0x12')](respondWithResult(_0x2fd026,null))[_0x1566('0x1c')](handleError(_0x2fd026,null));}; \ No newline at end of file +var _0x3c1e=['*,*,*,*','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','SendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','subjectOffline','email','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','internal','Tags','color','tag','Command','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','push','some','remote','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','sendStatus','getApplications','addProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','Attachment','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ChatWebsite','includeAll','include','findAll','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','sitepic','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','mapKey','contact','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','created','autoclose','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent'];(function(_0x1e8f35,_0x3db390){var _0x446c13=function(_0xa1e11e){while(--_0xa1e11e){_0x1e8f35['push'](_0x1e8f35['shift']());}};_0x446c13(++_0x3db390);}(_0x3c1e,0x194));var _0xe3c1=function(_0x976f23,_0x2430bb){_0x976f23=_0x976f23-0x0;var _0x5ea186=_0x3c1e[_0x976f23];return _0x5ea186;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xe3c1('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xe3c1('0x1'));var fs=require('fs');var fs_extra=require(_0xe3c1('0x2'));var _=require(_0xe3c1('0x3'));var querystring=require(_0xe3c1('0x4'));var Redis=require(_0xe3c1('0x5'));var qs=require(_0xe3c1('0x6'));var logger=require(_0xe3c1('0x7'))(_0xe3c1('0x8'));var config=require(_0xe3c1('0x9'));var db=require('../../mysqldb')['db'];config[_0xe3c1('0xa')]=_[_0xe3c1('0xb')](config[_0xe3c1('0xa')],{'host':_0xe3c1('0xc'),'port':0x18eb});var socket=require(_0xe3c1('0xd'))(new Redis(config[_0xe3c1('0xa')]));require('./chatWebsite.socket')[_0xe3c1('0xe')](socket);var jayson=require(_0xe3c1('0xf'));var client=jayson['client'][_0xe3c1('0x10')]({'port':0x232c});var client9002=jayson[_0xe3c1('0x11')][_0xe3c1('0x10')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xe3c1('0x11')][_0xe3c1('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x19c145,_0x4eed6b,_0x522e48,_0x1bf0fa){return new BPromise(function(_0x45f266,_0x34ed0d){var _0x3106e3=_0x1bf0fa||client;return _0x3106e3[_0xe3c1('0x12')](_0x19c145,_0x522e48)[_0xe3c1('0x13')](function(_0x238396){logger[_0xe3c1('0x14')](_0xe3c1('0x15'),_0x4eed6b,'request\x20sent');logger[_0xe3c1('0x16')](_0xe3c1('0x17'),_0x4eed6b,_0xe3c1('0x18'),JSON[_0xe3c1('0x19')](_0x238396));if(_0x238396[_0xe3c1('0x1a')]){if(_0x238396[_0xe3c1('0x1a')][_0xe3c1('0x1b')]===0x1f4){logger[_0xe3c1('0x1a')](_0xe3c1('0x15'),_0x4eed6b,_0x238396[_0xe3c1('0x1a')][_0xe3c1('0x1c')]);return _0x34ed0d(_0x238396['error'][_0xe3c1('0x1c')]);}logger['error'](_0xe3c1('0x15'),_0x4eed6b,_0x238396[_0xe3c1('0x1a')][_0xe3c1('0x1c')]);return _0x45f266(_0x238396[_0xe3c1('0x1a')][_0xe3c1('0x1c')]);}else{logger[_0xe3c1('0x14')](_0xe3c1('0x15'),_0x4eed6b,_0xe3c1('0x18'));_0x45f266(_0x238396[_0xe3c1('0x1d')][_0xe3c1('0x1c')]);}})[_0xe3c1('0x1e')](function(_0x166cd3){logger['error'](_0xe3c1('0x15'),_0x4eed6b,_0x166cd3);_0x34ed0d(_0x166cd3);});});}function respondWithStatusCode(_0x48ba51,_0x5a08c9){_0x5a08c9=_0x5a08c9||0xcc;return function(_0xabe505){if(_0xabe505){return _0x48ba51['sendStatus'](_0x5a08c9);}return _0x48ba51[_0xe3c1('0x1f')](_0x5a08c9)[_0xe3c1('0x20')]();};}function respondWithResult(_0x460260,_0x5ac8e1){_0x5ac8e1=_0x5ac8e1||0xc8;return function(_0xcd845){if(_0xcd845){return _0x460260[_0xe3c1('0x1f')](_0x5ac8e1)['json'](_0xcd845);}};}function respondWithFilteredResult(_0x1d7658,_0x304c9c){return function(_0x1a7fdc){if(_0x1a7fdc){var _0x4994c9=typeof _0x304c9c[_0xe3c1('0x21')]===_0xe3c1('0x22')&&typeof _0x304c9c[_0xe3c1('0x23')]===_0xe3c1('0x22');var _0x2f99d7=_0x1a7fdc['count'];var _0x556439=_0x4994c9?0x0:_0x304c9c[_0xe3c1('0x21')];var _0x1928d4=_0x4994c9?_0x1a7fdc[_0xe3c1('0x24')]:_0x304c9c[_0xe3c1('0x21')]+_0x304c9c['limit'];var _0x34c9c0;if(_0x1928d4>=_0x2f99d7){_0x1928d4=_0x2f99d7;_0x34c9c0=0xc8;}else{_0x34c9c0=0xce;}_0x1d7658['status'](_0x34c9c0);return _0x1d7658['set'](_0xe3c1('0x25'),_0x556439+'-'+_0x1928d4+'/'+_0x2f99d7)[_0xe3c1('0x26')](_0x1a7fdc);}return null;};}function saveUpdates(_0x27134e){return function(_0x4f4584){if(_0x4f4584){return _0x4f4584['update'](_0x27134e)[_0xe3c1('0x13')](function(_0x5eefbc){return _0x5eefbc;});}return null;};}function removeEntity(_0x56964e){return function(_0x41336b){if(_0x41336b){return _0x41336b[_0xe3c1('0x27')]()[_0xe3c1('0x13')](function(){var _0x45beb8=_0x41336b[_0xe3c1('0x28')]({'plain':!![]});var _0x4fe1d6=_0xe3c1('0x29');return db[_0xe3c1('0x2a')][_0xe3c1('0x27')]({'where':{'type':_0x4fe1d6,'resourceId':_0x45beb8['id']}})[_0xe3c1('0x13')](function(){return _0x41336b;});})[_0xe3c1('0x13')](function(){_0x56964e[_0xe3c1('0x1f')](0xcc)[_0xe3c1('0x20')]();});}};}function handleEntityNotFound(_0x47440b){return function(_0x43b183){if(!_0x43b183){_0x47440b['sendStatus'](0x194);}return _0x43b183;};}function handleError(_0x5a4ce5,_0x436c73){_0x436c73=_0x436c73||0x1f4;return function(_0x71e801){logger[_0xe3c1('0x1a')](_0x71e801[_0xe3c1('0x2b')]);if(_0x71e801[_0xe3c1('0x2c')]){delete _0x71e801[_0xe3c1('0x2c')];}_0x5a4ce5[_0xe3c1('0x1f')](_0x436c73)[_0xe3c1('0x2d')](_0x71e801);};}exports[_0xe3c1('0x2e')]=function(_0x20a07c,_0xd3a404){var _0x4e35cb={'include':[{'model':db[_0xe3c1('0x2f')],'as':_0xe3c1('0x30')}]},_0x3a2f16={},_0x5d00df={'count':0x0,'rows':[]};var _0x35ed7d=_['map'](db['ChatWebsite'][_0xe3c1('0x31')],function(_0x26a64b){return{'name':_0x26a64b[_0xe3c1('0x32')],'type':_0x26a64b[_0xe3c1('0x33')][_0xe3c1('0x34')]};});_0x3a2f16[_0xe3c1('0x35')]=_[_0xe3c1('0x36')](_0x35ed7d,_0xe3c1('0x2c'));_0x3a2f16[_0xe3c1('0x37')]=_[_0xe3c1('0x38')](_0x20a07c[_0xe3c1('0x37')]);_0x3a2f16[_0xe3c1('0x39')]=_[_0xe3c1('0x3a')](_0x3a2f16[_0xe3c1('0x35')],_0x3a2f16[_0xe3c1('0x37')]);_0x4e35cb[_0xe3c1('0x3b')]=_[_0xe3c1('0x3a')](_0x3a2f16[_0xe3c1('0x35')],qs[_0xe3c1('0x3c')](_0x20a07c[_0xe3c1('0x37')]['fields']));_0x4e35cb[_0xe3c1('0x3b')]=_0x4e35cb[_0xe3c1('0x3b')][_0xe3c1('0x3d')]?_0x4e35cb[_0xe3c1('0x3b')]:_0x3a2f16[_0xe3c1('0x35')];if(!_0x20a07c[_0xe3c1('0x37')][_0xe3c1('0x3e')](_0xe3c1('0x3f'))){_0x4e35cb[_0xe3c1('0x23')]=qs['limit'](_0x20a07c[_0xe3c1('0x37')][_0xe3c1('0x23')]);_0x4e35cb[_0xe3c1('0x21')]=qs['offset'](_0x20a07c[_0xe3c1('0x37')][_0xe3c1('0x21')]);}_0x4e35cb['order']=qs[_0xe3c1('0x40')](_0x20a07c['query'][_0xe3c1('0x40')]);_0x4e35cb[_0xe3c1('0x41')]=qs[_0xe3c1('0x39')](_[_0xe3c1('0x42')](_0x20a07c[_0xe3c1('0x37')],_0x3a2f16[_0xe3c1('0x39')]),_0x35ed7d);if(_0x20a07c[_0xe3c1('0x37')][_0xe3c1('0x43')]){_0x4e35cb[_0xe3c1('0x41')]=_['merge'](_0x4e35cb['where'],{'$or':_[_0xe3c1('0x36')](_0x35ed7d,function(_0x326738){if(_0x326738[_0xe3c1('0x33')]!==_0xe3c1('0x44')){var _0x3d8d34={};_0x3d8d34[_0x326738[_0xe3c1('0x2c')]]={'$like':'%'+_0x20a07c[_0xe3c1('0x37')][_0xe3c1('0x43')]+'%'};return _0x3d8d34;}})});}_0x4e35cb=_[_0xe3c1('0x45')]({},_0x4e35cb,_0x20a07c[_0xe3c1('0x46')]);var _0x5e89cb={'where':_0x4e35cb[_0xe3c1('0x41')]};return db[_0xe3c1('0x47')][_0xe3c1('0x24')](_0x5e89cb)[_0xe3c1('0x13')](function(_0x41b1ee){_0x5d00df[_0xe3c1('0x24')]=_0x41b1ee;if(_0x20a07c[_0xe3c1('0x37')][_0xe3c1('0x48')]){_0x4e35cb[_0xe3c1('0x49')]=[{'all':!![]}];}return db['ChatWebsite'][_0xe3c1('0x4a')](_0x4e35cb);})[_0xe3c1('0x13')](function(_0x434b1c){_0x5d00df['rows']=_0x434b1c;return _0x5d00df;})[_0xe3c1('0x13')](respondWithFilteredResult(_0xd3a404,_0x4e35cb))[_0xe3c1('0x1e')](handleError(_0xd3a404,null));};exports[_0xe3c1('0x4b')]=function(_0x5e9fa7,_0x331224){var _0x15f073={'raw':![],'where':{'id':_0x5e9fa7[_0xe3c1('0x4c')]['id']},'include':[{'model':db[_0xe3c1('0x2f')],'as':'mandatoryDispositionPause'}]},_0x23653e={};_0x23653e[_0xe3c1('0x35')]=_[_0xe3c1('0x38')](db[_0xe3c1('0x47')][_0xe3c1('0x31')]);_0x23653e[_0xe3c1('0x37')]=_['keys'](_0x5e9fa7[_0xe3c1('0x37')]);_0x23653e[_0xe3c1('0x39')]=_[_0xe3c1('0x3a')](_0x23653e[_0xe3c1('0x35')],_0x23653e[_0xe3c1('0x37')]);_0x15f073[_0xe3c1('0x3b')]=_[_0xe3c1('0x3a')](_0x23653e[_0xe3c1('0x35')],qs[_0xe3c1('0x3c')](_0x5e9fa7[_0xe3c1('0x37')][_0xe3c1('0x3c')]));_0x15f073[_0xe3c1('0x3b')]=_0x15f073[_0xe3c1('0x3b')][_0xe3c1('0x3d')]?_0x15f073['attributes']:_0x23653e[_0xe3c1('0x35')];if(_0x5e9fa7[_0xe3c1('0x37')][_0xe3c1('0x48')]){_0x15f073[_0xe3c1('0x49')]=[{'all':!![]}];}_0x15f073=_[_0xe3c1('0x45')]({},_0x15f073,_0x5e9fa7[_0xe3c1('0x46')]);return db[_0xe3c1('0x47')]['find'](_0x15f073)['then'](handleEntityNotFound(_0x331224,null))[_0xe3c1('0x13')](respondWithResult(_0x331224,null))['catch'](handleError(_0x331224,null));};exports['create']=function(_0x24c2a8,_0x1a8764){return db[_0xe3c1('0x47')][_0xe3c1('0x4d')](_0x24c2a8[_0xe3c1('0x4e')],{})[_0xe3c1('0x13')](function(_0x266138){var _0x4689b4=_0x24c2a8[_0xe3c1('0x4f')][_0xe3c1('0x28')]({'plain':!![]});if(!_0x4689b4)throw new Error(_0xe3c1('0x50'));if(_0x4689b4[_0xe3c1('0x51')]===_0xe3c1('0x4f')){var _0x51f2ff=_0x266138[_0xe3c1('0x28')]({'plain':!![]});var _0x41eb01=_0xe3c1('0x29');return db[_0xe3c1('0x52')][_0xe3c1('0x53')]({'where':{'name':_0x41eb01,'userProfileId':_0x4689b4['userProfileId']},'raw':!![]})[_0xe3c1('0x13')](function(_0x1c87fc){if(_0x1c87fc&&_0x1c87fc['autoAssociation']===0x0){return db[_0xe3c1('0x2a')][_0xe3c1('0x4d')]({'name':_0x51f2ff[_0xe3c1('0x2c')],'resourceId':_0x51f2ff['id'],'type':_0x1c87fc['name'],'sectionId':_0x1c87fc['id']},{})[_0xe3c1('0x13')](function(){return _0x266138;});}else{return _0x266138;}})['catch'](function(_0xd4d2){logger[_0xe3c1('0x1a')](_0xe3c1('0x54'),_0xd4d2);throw _0xd4d2;});}return _0x266138;})[_0xe3c1('0x13')](respondWithResult(_0x1a8764,0xc9))[_0xe3c1('0x1e')](handleError(_0x1a8764,null));};exports[_0xe3c1('0x55')]=function(_0x11f12d,_0x1d9313){if(_0x11f12d['body']['id']){delete _0x11f12d['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x11f12d[_0xe3c1('0x4c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xe3c1('0x13')](handleEntityNotFound(_0x1d9313,null))[_0xe3c1('0x13')](saveUpdates(_0x11f12d['body'],null))[_0xe3c1('0x13')](respondWithResult(_0x1d9313,null))['catch'](handleError(_0x1d9313,null));};exports['destroy']=function(_0x54e5ed,_0x3c109d){return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x54e5ed[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x3c109d,null))['then'](removeEntity(_0x3c109d,null))[_0xe3c1('0x1e')](handleError(_0x3c109d,null));};exports[_0xe3c1('0x56')]=function(_0x596922,_0x9452e7){return db[_0xe3c1('0x47')][_0xe3c1('0x56')]()[_0xe3c1('0x13')](respondWithResult(_0x9452e7,null))[_0xe3c1('0x1e')](handleError(_0x9452e7,null));};exports[_0xe3c1('0x57')]=function(_0x51cfe1,_0x35b308){if(_0x51cfe1[_0xe3c1('0x4e')]['id']){delete _0x51cfe1['body']['id'];}return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x51cfe1[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x35b308,null))[_0xe3c1('0x13')](function(_0x5b6748){if(_0x5b6748){_0x51cfe1[_0xe3c1('0x4e')][_0xe3c1('0x58')]=_0x5b6748['id'];return db[_0xe3c1('0x59')][_0xe3c1('0x4d')](_0x51cfe1[_0xe3c1('0x4e')]);}})['then'](respondWithResult(_0x35b308,null))[_0xe3c1('0x1e')](handleError(_0x35b308,null));};exports['getDispositions']=function(_0x46233a,_0x25845e){var _0x1e6a40={'raw':![],'where':{}};var _0x66003c={};var _0x40fb4a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe3c1('0x5a')]({'where':{'id':_0x46233a[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x25845e,null))[_0xe3c1('0x13')](function(_0x56c8fd){if(_0x56c8fd){_0x66003c['model']=_[_0xe3c1('0x38')](db[_0xe3c1('0x59')][_0xe3c1('0x31')]);_0x66003c[_0xe3c1('0x37')]=_[_0xe3c1('0x38')](_0x46233a['query']);_0x66003c[_0xe3c1('0x39')]=_[_0xe3c1('0x3a')](_0x66003c['model'],_0x66003c[_0xe3c1('0x37')]);_0x1e6a40[_0xe3c1('0x3b')]=_['intersection'](_0x66003c[_0xe3c1('0x35')],qs[_0xe3c1('0x3c')](_0x46233a[_0xe3c1('0x37')]['fields']));_0x1e6a40['attributes']=_0x1e6a40[_0xe3c1('0x3b')]['length']?_0x1e6a40['attributes']:_0x66003c[_0xe3c1('0x35')];if(!_0x46233a[_0xe3c1('0x37')][_0xe3c1('0x3e')](_0xe3c1('0x3f'))){_0x1e6a40[_0xe3c1('0x23')]=qs[_0xe3c1('0x23')](_0x46233a[_0xe3c1('0x37')][_0xe3c1('0x23')]);_0x1e6a40[_0xe3c1('0x21')]=qs[_0xe3c1('0x21')](_0x46233a[_0xe3c1('0x37')][_0xe3c1('0x21')]);}_0x1e6a40['order']=qs[_0xe3c1('0x40')](_0x46233a[_0xe3c1('0x37')]['sort']);_0x1e6a40[_0xe3c1('0x41')]=qs[_0xe3c1('0x39')](_[_0xe3c1('0x42')](_0x46233a[_0xe3c1('0x37')],_0x66003c['filters']));_0x1e6a40['where']['ChatWebsiteId']=_0x56c8fd['id'];if(_0x46233a[_0xe3c1('0x37')][_0xe3c1('0x43')]){_0x1e6a40[_0xe3c1('0x41')]=_[_0xe3c1('0x45')](_0x1e6a40[_0xe3c1('0x41')],{'$or':_['map'](_0x1e6a40['attributes'],function(_0x2e6aab){var _0x132d8c={};_0x132d8c[_0x2e6aab]={'$like':'%'+_0x46233a[_0xe3c1('0x37')][_0xe3c1('0x43')]+'%'};return _0x132d8c;})});}_0x1e6a40=_[_0xe3c1('0x45')]({},_0x1e6a40,_0x46233a[_0xe3c1('0x46')]);return db[_0xe3c1('0x59')][_0xe3c1('0x24')]({'where':_0x1e6a40[_0xe3c1('0x41')]})[_0xe3c1('0x13')](function(_0x2a219a){_0x40fb4a[_0xe3c1('0x24')]=_0x2a219a;if(_0x46233a[_0xe3c1('0x37')][_0xe3c1('0x48')]){_0x1e6a40[_0xe3c1('0x49')]=[{'all':!![]}];}return db[_0xe3c1('0x59')][_0xe3c1('0x4a')](_0x1e6a40);})['then'](function(_0x364d40){_0x40fb4a[_0xe3c1('0x5b')]=_0x364d40;return _0x40fb4a;});}})[_0xe3c1('0x13')](respondWithFilteredResult(_0x25845e,_0x1e6a40))[_0xe3c1('0x1e')](handleError(_0x25845e,null));};exports[_0xe3c1('0x5c')]=function(_0x314e74,_0x47eeb7){return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x314e74[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x47eeb7,null))['then'](function(_0x3c24b6){if(_0x3c24b6){return _0x3c24b6[_0xe3c1('0x5c')](_0x314e74[_0xe3c1('0x37')][_0xe3c1('0x5d')]);}})[_0xe3c1('0x13')](respondWithStatusCode(_0x47eeb7,null))[_0xe3c1('0x1e')](handleError(_0x47eeb7,null));};exports[_0xe3c1('0x5e')]=function(_0x25fb6a,_0x37e39b){if(_0x25fb6a[_0xe3c1('0x4e')]['id']){delete _0x25fb6a[_0xe3c1('0x4e')]['id'];}return db['ChatWebsite'][_0xe3c1('0x53')]({'where':{'id':_0x25fb6a[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x37e39b,null))[_0xe3c1('0x13')](function(_0xe2e9c7){if(_0xe2e9c7){_0x25fb6a[_0xe3c1('0x4e')][_0xe3c1('0x58')]=_0xe2e9c7['id'];return db[_0xe3c1('0x5f')][_0xe3c1('0x4d')](_0x25fb6a[_0xe3c1('0x4e')]);}})[_0xe3c1('0x13')](respondWithResult(_0x37e39b,null))[_0xe3c1('0x1e')](handleError(_0x37e39b,null));};exports[_0xe3c1('0x60')]=function(_0x564ec,_0x1c2c00){var _0x1fcd00={'raw':![],'where':{}};var _0x5c733b={};var _0x113bbb={'count':0x0,'rows':[]};return db[_0xe3c1('0x47')][_0xe3c1('0x5a')]({'where':{'id':_0x564ec[_0xe3c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c2c00,null))[_0xe3c1('0x13')](function(_0x58bd8b){if(_0x58bd8b){_0x5c733b[_0xe3c1('0x35')]=_[_0xe3c1('0x38')](db['CannedAnswer'][_0xe3c1('0x31')]);_0x5c733b['query']=_['keys'](_0x564ec[_0xe3c1('0x37')]);_0x5c733b[_0xe3c1('0x39')]=_[_0xe3c1('0x3a')](_0x5c733b[_0xe3c1('0x35')],_0x5c733b[_0xe3c1('0x37')]);_0x1fcd00[_0xe3c1('0x3b')]=_[_0xe3c1('0x3a')](_0x5c733b['model'],qs[_0xe3c1('0x3c')](_0x564ec[_0xe3c1('0x37')]['fields']));_0x1fcd00[_0xe3c1('0x3b')]=_0x1fcd00[_0xe3c1('0x3b')][_0xe3c1('0x3d')]?_0x1fcd00[_0xe3c1('0x3b')]:_0x5c733b[_0xe3c1('0x35')];if(!_0x564ec[_0xe3c1('0x37')][_0xe3c1('0x3e')](_0xe3c1('0x3f'))){_0x1fcd00[_0xe3c1('0x23')]=qs[_0xe3c1('0x23')](_0x564ec['query']['limit']);_0x1fcd00[_0xe3c1('0x21')]=qs[_0xe3c1('0x21')](_0x564ec[_0xe3c1('0x37')][_0xe3c1('0x21')]);}_0x1fcd00[_0xe3c1('0x61')]=qs[_0xe3c1('0x40')](_0x564ec[_0xe3c1('0x37')][_0xe3c1('0x40')]);_0x1fcd00['where']=qs[_0xe3c1('0x39')](_[_0xe3c1('0x42')](_0x564ec[_0xe3c1('0x37')],_0x5c733b[_0xe3c1('0x39')]));_0x1fcd00['where'][_0xe3c1('0x58')]=_0x58bd8b['id'];if(_0x564ec[_0xe3c1('0x37')][_0xe3c1('0x43')]){_0x1fcd00[_0xe3c1('0x41')]=_[_0xe3c1('0x45')](_0x1fcd00[_0xe3c1('0x41')],{'$or':_[_0xe3c1('0x36')](_0x1fcd00[_0xe3c1('0x3b')],function(_0x6310cb){var _0x4e97e1={};_0x4e97e1[_0x6310cb]={'$like':'%'+_0x564ec[_0xe3c1('0x37')][_0xe3c1('0x43')]+'%'};return _0x4e97e1;})});}_0x1fcd00=_['merge']({},_0x1fcd00,_0x564ec[_0xe3c1('0x46')]);return db[_0xe3c1('0x5f')][_0xe3c1('0x24')]({'where':_0x1fcd00[_0xe3c1('0x41')]})['then'](function(_0xdf10c){_0x113bbb[_0xe3c1('0x24')]=_0xdf10c;if(_0x564ec[_0xe3c1('0x37')]['includeAll']){_0x1fcd00[_0xe3c1('0x49')]=[{'all':!![]}];}return db[_0xe3c1('0x5f')][_0xe3c1('0x4a')](_0x1fcd00);})[_0xe3c1('0x13')](function(_0x3b4c53){_0x113bbb[_0xe3c1('0x5b')]=_0x3b4c53;return _0x113bbb;});}})[_0xe3c1('0x13')](respondWithFilteredResult(_0x1c2c00,_0x1fcd00))[_0xe3c1('0x1e')](handleError(_0x1c2c00,null));};exports['removeAnswers']=function(_0x54e7f5,_0x17dc8b){return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x54e7f5['params']['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x17dc8b,null))[_0xe3c1('0x13')](function(_0x2c51ea){if(_0x2c51ea){return _0x2c51ea[_0xe3c1('0x62')](_0x54e7f5[_0xe3c1('0x37')]['ids']);}})[_0xe3c1('0x13')](respondWithStatusCode(_0x17dc8b,null))[_0xe3c1('0x1e')](handleError(_0x17dc8b,null));};exports[_0xe3c1('0x63')]=function(_0x3e3d25,_0x19165c){_0x3e3d25[_0xe3c1('0x4e')]['sitepic']=_0x3e3d25[_0xe3c1('0x64')][_0xe3c1('0x65')];return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x3e3d25[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x19165c,null))[_0xe3c1('0x13')](saveUpdates(_0x3e3d25[_0xe3c1('0x4e')],null))[_0xe3c1('0x13')](respondWithResult(_0x19165c,null))[_0xe3c1('0x1e')](handleError(_0x19165c,null));};exports[_0xe3c1('0x66')]=function(_0x3f0a5d,_0x4c881f){_0x3f0a5d[_0xe3c1('0x4e')][_0xe3c1('0x67')]=_0x3f0a5d[_0xe3c1('0x64')][_0xe3c1('0x65')];return db[_0xe3c1('0x47')]['find']({'where':{'id':_0x3f0a5d['params']['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x4c881f,null))[_0xe3c1('0x13')](saveUpdates(_0x3f0a5d[_0xe3c1('0x4e')],null))[_0xe3c1('0x13')](respondWithResult(_0x4c881f,null))['catch'](handleError(_0x4c881f,null));};exports[_0xe3c1('0x68')]=function(_0x248981,_0x4d1fdd){_0x248981[_0xe3c1('0x4e')][_0xe3c1('0x69')]=_0x248981[_0xe3c1('0x64')][_0xe3c1('0x65')];return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x248981[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x4d1fdd,null))[_0xe3c1('0x13')](saveUpdates(_0x248981[_0xe3c1('0x4e')],null))[_0xe3c1('0x13')](respondWithResult(_0x4d1fdd,null))[_0xe3c1('0x1e')](handleError(_0x4d1fdd,null));};exports[_0xe3c1('0x6a')]=function(_0x2d7755,_0x480ce9){_0x2d7755[_0xe3c1('0x4e')]['systemAvatar']=_0x2d7755['file'][_0xe3c1('0x65')];return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x2d7755['params']['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x480ce9,null))[_0xe3c1('0x13')](saveUpdates(_0x2d7755[_0xe3c1('0x4e')],null))[_0xe3c1('0x13')](respondWithResult(_0x480ce9,null))['catch'](handleError(_0x480ce9,null));};exports[_0xe3c1('0x6b')]=function(_0x54aa4a,_0x1ae10d){var _0x3573c0=path[_0xe3c1('0x6c')](config['root'],_0xe3c1('0x6d'));var _0x2d70db={'where':{'id':_0x54aa4a['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x128d10=![];return require(_0xe3c1('0x6e'))['getLicense']()[_0xe3c1('0x13')](function(_0x33bafa){if(_0x33bafa){_0x128d10=_0x33bafa[_0xe3c1('0x6f')];}})['then'](function(){return db[_0xe3c1('0x47')][_0xe3c1('0x53')](_0x2d70db);})[_0xe3c1('0x13')](handleEntityNotFound(_0x1ae10d,null))[_0xe3c1('0x13')](function(_0x369b43){if(_0x369b43){if(!_[_0xe3c1('0x70')](_0x369b43[_0xe3c1('0x71')])){if(fs['existsSync'](path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],_0xe3c1('0x73'),_0x369b43[_0xe3c1('0x71')]))&&_0x128d10){_0x3573c0=path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],_0xe3c1('0x73'),_0x369b43['sitepic']);}}return _0x1ae10d[_0xe3c1('0x74')](_0x3573c0);}})[_0xe3c1('0x1e')](handleError(_0x1ae10d,null));};exports[_0xe3c1('0x75')]=function(_0x4031c8,_0x55e67f){var _0x125ef2=path['join'](config[_0xe3c1('0x72')],_0xe3c1('0x76'));var _0x4eb129={'where':{'id':_0x4031c8['params']['id']},'attributes':['id',_0xe3c1('0x67')],'raw':!![]};return db['ChatWebsite'][_0xe3c1('0x53')](_0x4eb129)['then'](handleEntityNotFound(_0x55e67f,null))[_0xe3c1('0x13')](function(_0x2accce){if(_0x2accce){if(!_[_0xe3c1('0x70')](_0x2accce[_0xe3c1('0x67')])){if(fs[_0xe3c1('0x77')](path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],_0xe3c1('0x78'),_0x2accce[_0xe3c1('0x67')]))){_0x125ef2=path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],_0xe3c1('0x78'),_0x2accce[_0xe3c1('0x67')]);}}return _0x55e67f['download'](_0x125ef2);}})[_0xe3c1('0x1e')](handleError(_0x55e67f,null));};exports[_0xe3c1('0x79')]=function(_0x512162,_0x185d99){var _0x5dff87=path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],'server/files/images/avatars/customer_avatar.png');var _0x5f164d={'where':{'id':_0x512162[_0xe3c1('0x4c')]['id']},'attributes':['id',_0xe3c1('0x69'),_0xe3c1('0x7a')],'raw':!![]};return db[_0xe3c1('0x47')][_0xe3c1('0x53')](_0x5f164d)[_0xe3c1('0x13')](handleEntityNotFound(_0x185d99,null))['then'](function(_0x5f581e){if(_0x5f581e){if(!_['isNil'](_0x5f581e['customerAvatar'])){if(fs[_0xe3c1('0x77')](path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],_0xe3c1('0x78'),_0x5f581e[_0xe3c1('0x69')]))&&_0x5f581e[_0xe3c1('0x7a')]){_0x5dff87=path['join'](config[_0xe3c1('0x72')],'server/files/images/avatars/',_0x5f581e['customerAvatar']);}}return _0x185d99['download'](_0x5dff87);}})[_0xe3c1('0x1e')](handleError(_0x185d99,null));};exports[_0xe3c1('0x7b')]=function(_0x2e20d4,_0x905736){var _0x2b0433=path['join'](config[_0xe3c1('0x72')],_0xe3c1('0x7c'));var _0x1d6c33={'where':{'id':_0x2e20d4['params']['id']},'attributes':['id',_0xe3c1('0x7d')],'raw':!![]};return db[_0xe3c1('0x47')]['find'](_0x1d6c33)['then'](handleEntityNotFound(_0x905736,null))[_0xe3c1('0x13')](function(_0x4751a4){if(_0x4751a4){if(!_['isNil'](_0x4751a4[_0xe3c1('0x7d')])){if(fs[_0xe3c1('0x77')](path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],_0xe3c1('0x78'),_0x4751a4[_0xe3c1('0x7d')]))){_0x2b0433=path['join'](config[_0xe3c1('0x72')],_0xe3c1('0x78'),_0x4751a4['systemAvatar']);}}return _0x905736[_0xe3c1('0x74')](_0x2b0433);}})['catch'](handleError(_0x905736,null));};exports[_0xe3c1('0x7e')]=function(_0x21f5d9,_0x36f54b){var _0x17b774=require(_0xe3c1('0x7f'));var _0x2c79ed=new _0x17b774();var _0x23c85c=_0x2c79ed[_0xe3c1('0x80')](_0x21f5d9[_0xe3c1('0x81')][_0xe3c1('0x82')])['getResult']();var _0x25e154={'body':_0x21f5d9[_0xe3c1('0x4e')],'channel':_0xe3c1('0x83')};var _0x192b83=[];var _0x35b24e=[];var _0x349887={};var _0x556de4=![];return db[_0xe3c1('0x84')]['describe']()[_0xe3c1('0x13')](function(_0x5c7fab){if(!_0x5c7fab){throw new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))](_0xe3c1('0x87'));}_0x192b83=_[_0xe3c1('0x88')](_['keys'](_0x5c7fab),[_0xe3c1('0x89'),_0xe3c1('0x8a')]);_0x35b24e=_[_0xe3c1('0x88')](_[_0xe3c1('0x38')](_0x5c7fab),[_0xe3c1('0x89'),_0xe3c1('0x8a'),_0xe3c1('0x8b'),_0xe3c1('0x8c')]);if(_0x21f5d9[_0xe3c1('0x4e')]['id']){delete _0x21f5d9[_0xe3c1('0x4e')]['id'];}if(_[_0xe3c1('0x70')](_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0x8d')])){throw new db[(_0xe3c1('0x85'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xe3c1('0x70')](_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0x4e')])||_0x21f5d9[_0xe3c1('0x4e')]['body']===''){throw new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))](_0xe3c1('0x8e'));}if(_[_0xe3c1('0x70')](_0x21f5d9[_0xe3c1('0x4e')]['mapKey'])){throw new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35b24e);}if(!_['includes'](_0x35b24e,_0x21f5d9[_0xe3c1('0x4e')]['mapKey'])){throw new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))](_0xe3c1('0x8f')+_0x35b24e);}_0x349887[_0x21f5d9['body']['mapKey']]=_0x21f5d9['body'][_0xe3c1('0x8d')];})[_0xe3c1('0x13')](function(){return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x21f5d9[_0xe3c1('0x4c')]['id']},'include':[{'model':db[_0xe3c1('0x90')],'as':_0xe3c1('0x91'),'include':[{'model':db['CmContact'],'as':_0xe3c1('0x92'),'where':_0x349887,'limit':0x1,'order':[[_0xe3c1('0x8a'),'DESC']]}]},{'model':db[_0xe3c1('0x93')],'as':_0xe3c1('0x94')}]});})[_0xe3c1('0x13')](handleEntityNotFound(_0x36f54b,null))[_0xe3c1('0x13')](function(_0x4fa218){if(_0x4fa218&&_0x4fa218[_0xe3c1('0x91')]){_0x25e154[_0xe3c1('0x95')]=_0x4fa218;_0x25e154[_0xe3c1('0x96')]=_0x4fa218[_0xe3c1('0x94')];_0x25e154[_0xe3c1('0x97')]=_0x4fa218['List'];_0x25e154['applications']=_[_0xe3c1('0x98')](_0x25e154[_0xe3c1('0x96')],['priority'],[_0xe3c1('0x99')]);if(_0x25e154[_0xe3c1('0x95')][_0xe3c1('0x94')]){delete _0x25e154[_0xe3c1('0x95')][_0xe3c1('0x94')];}if(_0x25e154['account'][_0xe3c1('0x91')]&&_0x25e154[_0xe3c1('0x95')][_0xe3c1('0x91')][_0xe3c1('0x92')][_0xe3c1('0x3d')]){return _0x25e154[_0xe3c1('0x95')]['List'][_0xe3c1('0x92')][0x0];}var _0x5acb91=_[_0xe3c1('0xb')](_0x21f5d9[_0xe3c1('0x4e')],{'firstName':_0x21f5d9[_0xe3c1('0x4e')]['from'],'ListId':_0x4fa218['ListId']});_0x5acb91[_0x21f5d9['body'][_0xe3c1('0x9a')]]=_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0x8d')];return db[_0xe3c1('0x84')][_0xe3c1('0x4d')](_0x5acb91,{'fields':_0x192b83,'raw':!![]});}})[_0xe3c1('0x13')](handleEntityNotFound(_0x36f54b,null))[_0xe3c1('0x13')](function(_0x417a82){_0x25e154[_0xe3c1('0x9b')]=_0x417a82;var _0x16b667=_0x21f5d9['body']['customerIp'];if(_0x21f5d9[_0xe3c1('0x81')][_0xe3c1('0x9c')]){_0x16b667=_0x21f5d9[_0xe3c1('0x81')][_0xe3c1('0x9c')];}else if(_0x21f5d9['headers'][_0xe3c1('0x9d')]){_0x16b667=_[_0xe3c1('0x9e')](_0x21f5d9[_0xe3c1('0x81')][_0xe3c1('0x9d')][_0xe3c1('0x9f')](','));}if(_0x417a82){var _0x277fda={'ContactId':_0x417a82['id'],'ChatWebsiteId':_0x21f5d9[_0xe3c1('0x4c')]['id'],'from':(_0x417a82['firstName']||'')+'\x20'+(_0x417a82[_0xe3c1('0xa0')]||''),'customerIp':_0x16b667,'customerPort':_0x21f5d9[_0xe3c1('0x81')]['x-real-port']?_0x21f5d9[_0xe3c1('0x81')][_0xe3c1('0xa1')]:null,'referer':_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xa2')],'browserName':_0x23c85c[_0xe3c1('0xa3')][_0xe3c1('0x2c')]&&_0x23c85c[_0xe3c1('0xa3')][_0xe3c1('0xa4')]?util[_0xe3c1('0xa5')](_0xe3c1('0xa6'),_0x23c85c['browser'][_0xe3c1('0x2c')],_0x23c85c[_0xe3c1('0xa3')][_0xe3c1('0xa4')]):_0xe3c1('0xa7'),'browserVersion':_0x23c85c[_0xe3c1('0xa3')]['version']||'unknown','osName':util['format'](_0xe3c1('0xa6'),_0x23c85c['os'][_0xe3c1('0x2c')],_0x23c85c['os']['version']),'osVersion':_0x23c85c['os'][_0xe3c1('0xa4')],'deviceModel':_0x23c85c[_0xe3c1('0xa8')]['model']&&_0x23c85c[_0xe3c1('0xa8')][_0xe3c1('0xa9')]?util[_0xe3c1('0xa5')](_0xe3c1('0xaa'),_0x23c85c['device'][_0xe3c1('0x35')],_0x23c85c[_0xe3c1('0xa8')][_0xe3c1('0xa9')],_0x23c85c[_0xe3c1('0xa8')][_0xe3c1('0x33')]):null,'deviceVendor':_0x23c85c[_0xe3c1('0xa8')][_0xe3c1('0xa9')],'deviceType':_0x23c85c['device'][_0xe3c1('0x33')],'formData':JSON[_0xe3c1('0x19')](_0x21f5d9['body'])};var _0x401444={'ChatWebsiteId':_0x21f5d9[_0xe3c1('0x4c')]['id'],'closed':![]};if(_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xab')]){_0x401444[_0xe3c1('0xab')]=_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xab')];return db[_0xe3c1('0xac')]['find']({'where':_0x401444})['then'](function(_0x47ead1){if(_0x47ead1){return[_0x47ead1,![]];}_0x277fda[_0xe3c1('0xab')]=_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xab')];_0x277fda[_0xe3c1('0xad')]=_0x21f5d9[_0xe3c1('0x4e')]['externalUrl'];return db[_0xe3c1('0xac')][_0xe3c1('0x4d')](_0x277fda)[_0xe3c1('0x13')](function(_0x11634b){return[_0x11634b,!![]];});});}_0x401444['ContactId']=_0x417a82['id'];if(_0x21f5d9['body'][_0xe3c1('0xae')]&&_0x21f5d9['body']['interaction']['id']){_0x401444['id']=_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xae')]['id'];return db[_0xe3c1('0xac')]['find']({'where':_0x401444})['then'](function(_0x8c3a9e){if(_0x8c3a9e){return[_0x8c3a9e,![]];}return db[_0xe3c1('0xac')][_0xe3c1('0x4d')](_0x277fda)[_0xe3c1('0x13')](function(_0x2a00e3){return[_0x2a00e3,!![]];});});}return db[_0xe3c1('0xac')][_0xe3c1('0x4d')](_0x277fda)['then'](function(_0x4d4e60){return[_0x4d4e60,!![]];});}})[_0xe3c1('0xaf')](function(_0x10cea7,_0x465576){if(_0x10cea7){_0x556de4=_0x465576;if(!_0x465576){var _0x18d575={'from':(_0x25e154[_0xe3c1('0x9b')][_0xe3c1('0xb0')]||'')+'\x20'+(_0x25e154['contact'][_0xe3c1('0xa0')]||'')};if(_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xab')]&&_0x21f5d9[_0xe3c1('0x4e')]['messageId']&&_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xab')]!=_0x21f5d9[_0xe3c1('0x4e')]['messageId']){_0x18d575[_0xe3c1('0xab')]=_0x21f5d9['body']['messageId'];}return _0x10cea7[_0xe3c1('0x55')](_0x18d575);}else{return _0x10cea7;}}})['then'](function(_0x5e6890){_0x25e154[_0xe3c1('0xae')]=_0x5e6890['get']({'plain':!![]});_0x25e154[_0xe3c1('0xae')]['created']=_0x556de4;if(_0x25e154['interaction'][_0xe3c1('0xb1')]){if(_0x25e154['account'][_0xe3c1('0xb2')]){_0x25e154[_0xe3c1('0x96')]['push']({'id':0x0,'priority':_0x25e154[_0xe3c1('0x96')][_0xe3c1('0x3d')]+0x1,'app':'close','appdata':_0xe3c1('0xb3'),'interval':'*,*,*,*'});}}return db[_0xe3c1('0xb4')]['create']({'body':_0x21f5d9[_0xe3c1('0x4e')]['body'],'ChatWebsiteId':_0x21f5d9[_0xe3c1('0x4c')]['id'],'ChatInteractionId':_0x5e6890['id'],'direction':'in','ContactId':_0x25e154[_0xe3c1('0x9b')]['id'],'AttachmentId':_0x21f5d9[_0xe3c1('0x4e')][_0xe3c1('0xb5')]});})[_0xe3c1('0x13')](function(_0x1f3721){_0x25e154[_0xe3c1('0x1c')]=_0x1f3721;if(_0x25e154[_0xe3c1('0xae')][_0xe3c1('0xb6')]){return db[_0xe3c1('0xb7')][_0xe3c1('0x53')]({'attributes':['id',_0xe3c1('0x2c')],'where':{'id':_0x25e154[_0xe3c1('0xae')][_0xe3c1('0xb6')]}})[_0xe3c1('0x13')](function(_0xa0085d){if(_0xa0085d){_0x25e154['applications'][_0xe3c1('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xa0085d[_0xe3c1('0x2c')]+','+(_0x25e154[_0xe3c1('0x95')][_0xe3c1('0xb9')]||0xa),'interval':_0xe3c1('0xba')});_0x25e154['forcedOwnership']=!![];}return respondWithRpcPromise(_0xe3c1('0xbb'),'startRouting',_0x25e154);});}return respondWithRpcPromise(_0xe3c1('0xbb'),_0xe3c1('0xbc'),_0x25e154);})[_0xe3c1('0x13')](function(_0x427de6){respondWithRpcPromise(_0xe3c1('0xbd'),_0xe3c1('0xbd'),{'event':_0xe3c1('0x7e'),'message':_0x427de6},client9002);return _0x427de6;})[_0xe3c1('0x13')](respondWithResult(_0x36f54b,null))[_0xe3c1('0x1e')](handleError(_0x36f54b,null));};exports[_0xe3c1('0xbe')]=function(_0x32eb18,_0x417aa6){var _0x2e6be5,_0x2a5417,_0x51e28a;var _0x56528a=[];var _0x27fc8a={};var _0x22a84a=_0x32eb18[_0xe3c1('0xbf')]||[];var _0x5d8aa9=[];var _0x12e4b6;return db['CmContact']['describe']()[_0xe3c1('0x13')](function(_0x55fc6b){if(!_0x55fc6b){throw new db[(_0xe3c1('0x85'))]['ValidationError'](_0xe3c1('0x87'));}_0x56528a=_['difference'](_['keys'](_0x55fc6b),['createdAt','updatedAt','CompanyId',_0xe3c1('0x8c')]);if(_0x32eb18[_0xe3c1('0x4e')]['id']){delete _0x32eb18[_0xe3c1('0x4e')]['id'];}if(_['isNil'](_0x32eb18[_0xe3c1('0x4e')][_0xe3c1('0x8d')])){throw _0x417aa6[_0xe3c1('0x1f')](0x1f4)['send'](new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))](_0xe3c1('0xc0')));}if(_[_0xe3c1('0x70')](_0x32eb18[_0xe3c1('0x4e')][_0xe3c1('0x4e')])||_0x32eb18['body'][_0xe3c1('0x4e')]===''){throw _0x417aa6[_0xe3c1('0x1f')](0x1f4)['send'](new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))](_0xe3c1('0x8e')));}if(_[_0xe3c1('0x70')](_0x32eb18[_0xe3c1('0x4e')][_0xe3c1('0xc1')])){throw _0x417aa6[_0xe3c1('0x1f')](0x1f4)[_0xe3c1('0x2d')](new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x56528a));}if(!_[_0xe3c1('0xc2')](_0x56528a,_0x32eb18[_0xe3c1('0x4e')][_0xe3c1('0xc1')])){throw _0x417aa6[_0xe3c1('0x1f')](0x1f4)['send'](new db[(_0xe3c1('0x85'))][(_0xe3c1('0x86'))](_0xe3c1('0xc3')+_0x56528a));}_0x27fc8a[_0x32eb18[_0xe3c1('0x4e')][_0xe3c1('0xc1')]]=_0x32eb18[_0xe3c1('0x4e')]['from'];})[_0xe3c1('0x13')](function(){return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0x32eb18[_0xe3c1('0x4c')]['id']},'include':[{'model':db[_0xe3c1('0x90')],'as':'List'},{'model':db[_0xe3c1('0xc4')],'as':_0xe3c1('0xc4')}]});})[_0xe3c1('0x13')](handleEntityNotFound(_0x417aa6,null))[_0xe3c1('0x13')](function(_0x3d4621){if(_0x3d4621&&_0x3d4621[_0xe3c1('0x91')]){_0x2a5417=_0x3d4621;var _0x1e0fb6=_[_0xe3c1('0xb')](_0x32eb18['body'],{'firstName':_0x32eb18[_0xe3c1('0x4e')][_0xe3c1('0x8d')],'phone':_0x32eb18[_0xe3c1('0x4e')][_0xe3c1('0x8d')],'ListId':_0x3d4621[_0xe3c1('0x8c')]});_0x1e0fb6[_0x32eb18[_0xe3c1('0x4e')]['mapKeyOffline']]=_0x32eb18[_0xe3c1('0x4e')]['from'];return db['CmContact'][_0xe3c1('0xc5')]({'where':_0x27fc8a,'defaults':_0x1e0fb6});}})[_0xe3c1('0xaf')](function(_0x415fc6){if(_0x415fc6){_0x51e28a=_0x415fc6;var _0xb87a2e=fs[_0xe3c1('0xc6')](path[_0xe3c1('0x6c')](config[_0xe3c1('0x72')],_0xe3c1('0xc7')),_0xe3c1('0xc8'));var _0x4203df=ejs[_0xe3c1('0xc9')](_0xb87a2e,{'body':_[_0xe3c1('0xca')](_0x32eb18['body']['body']),'bodyTitle':_0x2a5417[_0xe3c1('0xcb')]});return db[_0xe3c1('0xcc')]['create']({'body':_0x4203df,'ContactId':_0x415fc6['id'],'ChatWebsiteId':_0x2a5417['id']});}})[_0xe3c1('0x13')](function(_0x2ac904){_0x12e4b6=_0x2ac904;if(_0x22a84a[_0xe3c1('0x3d')]){var _0x141a38=_0x22a84a[_0xe3c1('0x36')](function(_0xc427f6){return{'name':_0xc427f6[_0xe3c1('0xcd')],'basename':_0xc427f6[_0xe3c1('0x65')],'type':_0xc427f6[_0xe3c1('0xce')],'ChatOfflineMessageId':_0x2ac904['id']};});_0x5d8aa9=_0x141a38[_0xe3c1('0x36')](_0x15aefe=>{var _0x195882={'filename':_0x15aefe['name'],'path':path['join'](config[_0xe3c1('0x72')],_0xe3c1('0xcf'),'files',_0xe3c1('0xd0'),_0xe3c1('0xd1'),_0x15aefe[_0xe3c1('0xd2')])};return _0x195882;});if(!_0x2a5417['openNewInteraction']){return db[_0xe3c1('0xd3')][_0xe3c1('0xd4')](function(_0x38ad08){return db['Attachment'][_0xe3c1('0xd5')](_0x141a38,{'transaction':_0x38ad08});});}}})['then'](function(){if(_0x12e4b6){_0x2e6be5=_0x12e4b6;return db[_0xe3c1('0xc4')][_0xe3c1('0x5a')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0xe3c1('0x13')](function(_0x4048a7){if(_0x4048a7&&_0x4048a7[_0xe3c1('0xd6')]&&_0x2a5417[_0xe3c1('0xd7')]&&_0x2a5417[_0xe3c1('0xd8')]){var _0x493697={'tls':{'rejectUnauthorized':![]}};if(_0x4048a7[_0xe3c1('0xd6')]['service']){_0x493697[_0xe3c1('0xd9')]=_0x4048a7[_0xe3c1('0xd6')][_0xe3c1('0xd9')];}else{_0x493697[_0xe3c1('0xda')]=_0x4048a7[_0xe3c1('0xd6')]['host'];_0x493697[_0xe3c1('0xdb')]=_0x4048a7['Smtp'][_0xe3c1('0xdb')];_0x493697['secure']=_0x4048a7['Smtp'][_0xe3c1('0xdc')];}if(_0x4048a7[_0xe3c1('0xd6')][_0xe3c1('0xdd')]){_0x493697['auth']={'user':_0x4048a7[_0xe3c1('0xd6')][_0xe3c1('0x4f')],'pass':_0x4048a7[_0xe3c1('0xd6')]['pass']};}return respondWithRpcPromise(_0xe3c1('0xde'),'sendMail',{'account':_0x493697,'message':{'from':util[_0xe3c1('0xa5')](_0xe3c1('0xdf'),_0x4048a7[_0xe3c1('0x2c')],_0x4048a7['email']||_0x4048a7[_0xe3c1('0xd6')][_0xe3c1('0x4f')]),'to':_0x2a5417[_0xe3c1('0xd8')],'subject':_0x2a5417[_0xe3c1('0xe0')],'html':_0x2e6be5[_0xe3c1('0x4e')],'attachments':_0x5d8aa9}},client9003)[_0xe3c1('0x13')](function(){return _0x2e6be5;})[_0xe3c1('0x1e')](function(_0x315975){console[_0xe3c1('0x1a')](_0x315975);});}})[_0xe3c1('0x13')](function(){if(_0x2a5417&&_0x2a5417[_0xe3c1('0xe1')]&&_0x2a5417[_0xe3c1('0xe2')]){var _0x388f7d=[];if(_0x22a84a[_0xe3c1('0x3d')]){_0x388f7d=_0x22a84a[_0xe3c1('0x36')](function(_0x3461ae){return{'name':_0x3461ae['originalname'],'basename':_0x3461ae[_0xe3c1('0x65')],'type':_0x3461ae[_0xe3c1('0xce')],'ChatOfflineMessageId':_0x12e4b6['id']};});}var _0x4d2d2f;if(!_[_0xe3c1('0x70')](_0x2a5417['subjectOffline'])){var _0xa91a9d=_[_0xe3c1('0x36')](_0x32eb18[_0xe3c1('0x4e')],function(_0x29bd2b){return _0x29bd2b;});var _0x1aa3bd=_[_0xe3c1('0xe3')](_0xa91a9d)[0x0];var _0x5ee29c=_['mapValues'](_0x1aa3bd,function(_0x194679){return _0x194679;});_0x4d2d2f=_0x5ee29c[0x1][_0x2a5417[_0xe3c1('0xe4')]];}var _0x20d2f2={'from':_0x51e28a['email'],'firstName':_0x51e28a[_0xe3c1('0xb0')],'lastName':_0x51e28a['lastName'],'mapKey':'email','message':{'from':_0x51e28a[_0xe3c1('0xe5')],'to':_0x2a5417['MailAccount'][_0xe3c1('0xe5')],'cc':'','subject':_[_0xe3c1('0x70')](_0x4d2d2f)?_0x2a5417[_0xe3c1('0xe0')]:_0x4d2d2f,'messageId':'','sentAt':new Date(),'attach':_0x388f7d['length'],'attachments':_0x388f7d,'originChannel':_0xe3c1('0xe6'),'ChatWebsiteId':_0x2a5417['id'],'ChatOfflineMessageId':_0x2e6be5['id'],'originTo':_0x2a5417[_0xe3c1('0xc4')]['email']},'body':_0x2e6be5[_0xe3c1('0x4e')]};var _0x20f2d2={'account':{'id':_0x2a5417[_0xe3c1('0xe2')]},'body':_0x20d2f2,'log':_0xe3c1('0xe7')};return respondWithRpcPromise(_0xe3c1('0xe7'),_0xe3c1('0xe8'),_0x20f2d2,client9001)[_0xe3c1('0x13')](function(){return _0x2e6be5;})['catch'](function(_0x160d35){console[_0xe3c1('0x1a')](_0x160d35);});}return;})[_0xe3c1('0x13')](function(){if(_0x2e6be5){return _0x2e6be5;}})['then'](respondWithResult(_0x417aa6,null))['catch'](function(_0x1accab){console['error']('catch',_0x1accab);for(var _0x2744c7 of _0x22a84a){var _0x3156b5=path[_0xe3c1('0x6c')](config['root'],_0xe3c1('0xcf'),_0xe3c1('0xbf'),'attachments',_0xe3c1('0xd1'),_0x2744c7[_0xe3c1('0x65')]);fs_extra[_0xe3c1('0xe9')](_0x3156b5)['catch'](function(_0x5d8ac6){console[_0xe3c1('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x3156b5,_0x5d8ac6);});}});};exports['addInteraction']=function(_0x49b2ce,_0x22e8ad){return db[_0xe3c1('0xac')][_0xe3c1('0x53')]({'where':{'id':_0x49b2ce['params']['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x22e8ad,null))['then'](function(_0x210241){if(_0x210241){return _0x210241[_0xe3c1('0xea')](_0x49b2ce[_0xe3c1('0x4e')][_0xe3c1('0x5d')],_[_0xe3c1('0xeb')](_0x49b2ce[_0xe3c1('0x4e')],[_0xe3c1('0x5d'),'id'])||{});}})[_0xe3c1('0x13')](respondWithResult(_0x22e8ad,null))['catch'](handleError(_0x22e8ad,null));};exports[_0xe3c1('0xec')]=function(_0x530b5b,_0x349d5c){var _0x2f0946={'raw':![],'where':{}};var _0x2f6670={};var _0x42c6fb={'count':0x0,'rows':[]};return db[_0xe3c1('0x47')][_0xe3c1('0x5a')]({'where':{'id':_0x530b5b[_0xe3c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x349d5c,null))[_0xe3c1('0x13')](function(_0x40618a){if(_0x40618a){_0x2f6670[_0xe3c1('0x35')]=_[_0xe3c1('0x38')](db['ChatInteraction'][_0xe3c1('0x31')]);_0x2f6670[_0xe3c1('0x37')]=_[_0xe3c1('0x38')](_0x530b5b[_0xe3c1('0x37')]);_0x2f6670[_0xe3c1('0x39')]=_[_0xe3c1('0x3a')](_0x2f6670[_0xe3c1('0x35')],_0x2f6670[_0xe3c1('0x37')]);_0x2f0946[_0xe3c1('0x3b')]=_[_0xe3c1('0x3a')](_0x2f6670[_0xe3c1('0x35')],qs['fields'](_0x530b5b[_0xe3c1('0x37')][_0xe3c1('0x3c')]));_0x2f0946[_0xe3c1('0x3b')]=_0x2f0946[_0xe3c1('0x3b')][_0xe3c1('0x3d')]?_0x2f0946[_0xe3c1('0x3b')]:_0x2f6670[_0xe3c1('0x35')];if(!_0x530b5b['query'][_0xe3c1('0x3e')](_0xe3c1('0x3f'))){_0x2f0946['limit']=qs[_0xe3c1('0x23')](_0x530b5b['query'][_0xe3c1('0x23')]);_0x2f0946[_0xe3c1('0x21')]=qs[_0xe3c1('0x21')](_0x530b5b['query'][_0xe3c1('0x21')]);}_0x2f0946['order']=qs['sort'](_0x530b5b[_0xe3c1('0x37')][_0xe3c1('0x40')]);_0x2f0946[_0xe3c1('0x41')]=qs['filters'](_[_0xe3c1('0x42')](_0x530b5b[_0xe3c1('0x37')],_0x2f6670[_0xe3c1('0x39')]));_0x2f0946[_0xe3c1('0x41')]['ChatWebsiteId']=_0x40618a['id'];if(_0x530b5b['query'][_0xe3c1('0x43')]){_0x2f0946[_0xe3c1('0x41')]=_['merge'](_0x2f0946[_0xe3c1('0x41')],{'$or':_[_0xe3c1('0x36')](_0x2f0946[_0xe3c1('0x3b')],function(_0x2ad981){var _0x31b35a={};_0x31b35a[_0x2ad981]={'$like':'%'+_0x530b5b[_0xe3c1('0x37')]['filter']+'%'};return _0x31b35a;})});}_0x2f0946=_[_0xe3c1('0x45')]({},_0x2f0946,_0x530b5b[_0xe3c1('0x46')]);return db[_0xe3c1('0xac')][_0xe3c1('0x24')]({'where':_0x2f0946['where']})['then'](function(_0x4dfc5c){_0x42c6fb['count']=_0x4dfc5c;if(_0x530b5b[_0xe3c1('0x37')][_0xe3c1('0x48')]){_0x2f0946[_0xe3c1('0x49')]=[{'model':db[_0xe3c1('0x84')],'as':_0xe3c1('0xed'),'required':![]},{'model':db[_0xe3c1('0xb7')],'as':_0xe3c1('0xee'),'attributes':['name','fullname',_0xe3c1('0xef')],'required':![]},{'model':db['Tag'],'as':_0xe3c1('0xf0'),'attributes':['id',_0xe3c1('0x2c'),_0xe3c1('0xf1')],'where':_0x530b5b[_0xe3c1('0x37')][_0xe3c1('0xf2')]?{'id':_0x530b5b['query'][_0xe3c1('0xf2')]}:undefined,'required':_0x530b5b['query'][_0xe3c1('0xf2')]?!![]:![]}];}return db[_0xe3c1('0xac')][_0xe3c1('0x4a')](_0x2f0946);})[_0xe3c1('0x13')](function(_0x2417d3){_0x42c6fb['rows']=_0x2417d3;return _0x42c6fb;});}})[_0xe3c1('0x13')](respondWithFilteredResult(_0x349d5c,_0x2f0946))[_0xe3c1('0x1e')](handleError(_0x349d5c,null));};function iftimePromise(_0x214885,_0x2ec186){return respondWithRpcPromise(_0xe3c1('0xf3'),'getSnippet',{'command':_0x2ec186['timezone']?util[_0xe3c1('0xa5')](_0xe3c1('0xf4'),_0x214885[_0xe3c1('0xf5')],_0x2ec186['timezone']):util[_0xe3c1('0xa5')](_0xe3c1('0xf6'),_0x214885[_0xe3c1('0xf5')])},client9002)[_0xe3c1('0x13')](function(_0x19119f){var _0x49a624=_0x19119f&&_0x19119f[_0xe3c1('0xf7')](_0xe3c1('0xf8'))>=0x0?!![]:![];logger[_0xe3c1('0x14')](_0xe3c1('0xf9'),_0x2ec186['id'],_0x214885['id'],_0x214885[_0xe3c1('0xf5')],_0x49a624?_0xe3c1('0xfa'):_0xe3c1('0xfb'),_0x2ec186['timezone']?_0x2ec186[_0xe3c1('0xfc')]:_0xe3c1('0xfd'));return _0x49a624;})[_0xe3c1('0x1e')](function(_0xceef54){logger[_0xe3c1('0x1a')](_0xe3c1('0xf9'),_0x2ec186['id'],_0x214885['id'],_0x214885[_0xe3c1('0xf5')],util['inspect'](_0xceef54,{'showHidden':![],'depth':null}),_0x2ec186[_0xe3c1('0xfc')]?_0x2ec186[_0xe3c1('0xfc')]:_0xe3c1('0xfd'));return![];});}exports[_0xe3c1('0xfe')]=function(_0x35838e,_0xb1ed76){var _0x1fda16=0x0;var _0x418354=0x0;var _0x351cda=![];var _0x3f7ee7;var _0x268a3e;return db[_0xe3c1('0x47')]['find']({'where':{'id':_0x35838e['params']['id']},'include':[{'model':db[_0xe3c1('0xff')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xe3c1('0x100'),'attributes':['id',_0xe3c1('0xf5')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0xb1ed76,null))[_0xe3c1('0x13')](function(_0x2e3ce8){if(_0x2e3ce8){_0x3f7ee7=_0x2e3ce8;return _0x2e3ce8[_0xe3c1('0x101')]({'raw':!![]});}})[_0xe3c1('0x13')](function(_0x12387e){if(_0x3f7ee7){if(_0x12387e){_0x268a3e=_0x12387e;}}return require(_0xe3c1('0x6e'))[_0xe3c1('0x102')]();})[_0xe3c1('0x13')](function(_0x9cbc62){if(_0x9cbc62){_0x418354=_0x9cbc62[_0xe3c1('0x103')];_0x351cda=_0x9cbc62['custom'];}})['then'](function(){return db[_0xe3c1('0xac')]['count']({'where':{'closed':![]}});})[_0xe3c1('0x13')](function(_0x247725){_0x1fda16=_0x247725;if(_0x418354&&_0x247725>_0x418354){return db[_0xe3c1('0x104')][_0xe3c1('0x5a')]({'where':{'id':0x1}})[_0xe3c1('0x13')](function(_0xdd270c){if(_0xdd270c){_0xdd270c[_0xe3c1('0x105')](_0xe3c1('0x106'));}});}})['then'](function(){if(_0x3f7ee7[_0xe3c1('0xff')]&&_0x3f7ee7[_0xe3c1('0xff')][_0xe3c1('0x100')]){var _0x17fedd=[];for(var _0x2b13b8=0x0;_0x2b13b8<_0x3f7ee7['Interval'][_0xe3c1('0x100')][_0xe3c1('0x3d')];_0x2b13b8++){var _0x2b0c33=_0x3f7ee7[_0xe3c1('0xff')][_0xe3c1('0x100')][_0x2b13b8][_0xe3c1('0x28')]({'plain':!![]});_0x17fedd[_0xe3c1('0x107')](iftimePromise(_0x2b0c33,_0x3f7ee7));}return BPromise['all'](_0x17fedd)['then'](function(_0x4e59b9){return _[_0xe3c1('0x108')](_0x4e59b9);});}else{return!![];}})[_0xe3c1('0x13')](function(_0x3cbdc5){var _0x1c2c32=fs['readFileSync'](path['join'](config[_0xe3c1('0x72')],'server/files/chat/iframe.ejs'),_0xe3c1('0xc8'));var _0x3f2337={'remote':_0x3f7ee7[_0xe3c1('0x109')],'query':querystring[_0xe3c1('0x19')](_['merge'](_0x3f7ee7['get']({'plain':!![]}),{'customerIp':_0x35838e['headers'][_0xe3c1('0x9d')]||_0x35838e[_0xe3c1('0x81')]['x-real-ip']||_0x35838e[_0xe3c1('0x10a')][_0xe3c1('0x10b')]||_0x35838e['ip'],'referer':_0x35838e[_0xe3c1('0x81')][_0xe3c1('0xa2')],'openedInteractions':_0x1fda16,'maxInteractions':_0x418354,'virtual':_0x351cda[_0xe3c1('0x103')],'online':_0x3cbdc5,'custom':_0x351cda}))[_0xe3c1('0x10c')](/'/g,'\x5c\x27')};_0xb1ed76[_0xe3c1('0x2d')](ejs['render'](Mustache[_0xe3c1('0xc9')](_0x1c2c32,_0x3f2337),{'proactiveActions':_0x268a3e,'alignment':_0x3f7ee7[_0xe3c1('0x10d')],'verticalAlignment':_0x3f7ee7[_0xe3c1('0x10e')],'div_color':_0x3f7ee7[_0xe3c1('0xf1')],'text_color':_0x3f7ee7[_0xe3c1('0x10f')],'button_color':_0x3f7ee7[_0xe3c1('0x110')],'background_color':_0x3f7ee7[_0xe3c1('0x111')]}));})[_0xe3c1('0x1e')](handleError(_0xb1ed76,null));};exports[_0xe3c1('0x112')]=function(_0x4e4838,_0x41b31f){var _0x899b39=_0x4e4838['params']['id'];var _0x5dff93=_0x4e4838[_0xe3c1('0x4e')];var _0x37415e=0xc8;var _0x5796e6=null;return db[_0xe3c1('0xd3')][_0xe3c1('0xd4')]({'isolationLevel':db[_0xe3c1('0xd3')][_0xe3c1('0x113')][_0xe3c1('0x114')]['READ_COMMITTED']},function(_0x30ffa8){return db[_0xe3c1('0x47')][_0xe3c1('0x5a')]({'where':{'id':_0x899b39},'transaction':_0x30ffa8})[_0xe3c1('0x13')](function(_0x7c026c){if(_0x7c026c){return db[_0xe3c1('0x93')][_0xe3c1('0x27')]({'where':{'ChatWebsiteId':_0x899b39},'transaction':_0x30ffa8})[_0xe3c1('0x13')](function(){var _0x43a4cc=_[_0xe3c1('0x36')](_0x5dff93,function(_0x4a474d){_0x4a474d['ChatWebsiteId']=_0x899b39;return _0x4a474d;});return db[_0xe3c1('0x93')]['bulkCreate'](_0x43a4cc,{'transaction':_0x30ffa8});});}else{_0x37415e=0x194;_0x5796e6=[];}});})['then'](function(){if(_0x37415e!==0x194){return db[_0xe3c1('0x93')][_0xe3c1('0x115')]({'where':{'ChatWebsiteId':_0x899b39},'order':_0xe3c1('0x116')})['then'](function(_0x263d7a){_0x5796e6=_0x263d7a;});}})[_0xe3c1('0x1e')](function(_0x5b828b){_0x37415e=0x1f4;logger[_0xe3c1('0x1a')](_0x5b828b[_0xe3c1('0x2b')]);if(_0x5b828b[_0xe3c1('0x2c')]){delete _0x5b828b[_0xe3c1('0x2c')];}_0x5796e6=_0x5b828b;})['finally'](function(){if(_0x5796e6===null){_0x41b31f[_0xe3c1('0x117')](_0x37415e);}else{if(_0x37415e===0x1f4){_0x41b31f[_0xe3c1('0x1f')](_0x37415e)[_0xe3c1('0x2d')](_0x5796e6);}else{_0x41b31f[_0xe3c1('0x1f')](_0x37415e)['json'](_0x5796e6);}}});};exports[_0xe3c1('0x118')]=function(_0x698fdb,_0x22f4da){var _0x2bdf31={};var _0x13b861={};var _0x5752f2;var _0x374a88;return db['ChatWebsite']['findOne']({'where':{'id':_0x698fdb['params']['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x22f4da,null))[_0xe3c1('0x13')](function(_0x3ef768){if(_0x3ef768){_0x5752f2=_0x3ef768;_0x13b861[_0xe3c1('0x35')]=_[_0xe3c1('0x38')](db[_0xe3c1('0x93')][_0xe3c1('0x31')]);_0x13b861[_0xe3c1('0x37')]=_[_0xe3c1('0x38')](_0x698fdb[_0xe3c1('0x37')]);_0x13b861[_0xe3c1('0x39')]=_['intersection'](_0x13b861['model'],_0x13b861[_0xe3c1('0x37')]);_0x2bdf31[_0xe3c1('0x3b')]=_[_0xe3c1('0x3a')](_0x13b861[_0xe3c1('0x35')],qs[_0xe3c1('0x3c')](_0x698fdb[_0xe3c1('0x37')]['fields']));_0x2bdf31[_0xe3c1('0x3b')]=_0x2bdf31['attributes'][_0xe3c1('0x3d')]?_0x2bdf31['attributes']:_0x13b861['model'];_0x2bdf31[_0xe3c1('0x61')]=qs[_0xe3c1('0x40')](_0x698fdb[_0xe3c1('0x37')][_0xe3c1('0x40')]);_0x2bdf31[_0xe3c1('0x41')]=qs[_0xe3c1('0x39')](_[_0xe3c1('0x42')](_0x698fdb['query'],_0x13b861[_0xe3c1('0x39')]));if(_0x698fdb[_0xe3c1('0x37')]['filter']){_0x2bdf31[_0xe3c1('0x41')]=_[_0xe3c1('0x45')](_0x2bdf31[_0xe3c1('0x41')],{'$or':_[_0xe3c1('0x36')](_0x2bdf31[_0xe3c1('0x3b')],function(_0x499cc2){var _0x2fe3fa={};_0x2fe3fa[_0x499cc2]={'$like':'%'+_0x698fdb[_0xe3c1('0x37')][_0xe3c1('0x43')]+'%'};return _0x2fe3fa;})});}_0x2bdf31=_[_0xe3c1('0x45')]({},_0x2bdf31,_0x698fdb[_0xe3c1('0x46')]);return _0x5752f2[_0xe3c1('0x118')](_0x2bdf31);}})['then'](function(_0xe3def6){if(_0xe3def6){_0x374a88=_0xe3def6[_0xe3c1('0x3d')];if(!_0x698fdb['query'][_0xe3c1('0x3e')](_0xe3c1('0x3f'))){_0x2bdf31['limit']=qs[_0xe3c1('0x23')](_0x698fdb[_0xe3c1('0x37')]['limit']);_0x2bdf31[_0xe3c1('0x21')]=qs['offset'](_0x698fdb['query']['offset']);}return _0x5752f2[_0xe3c1('0x118')](_0x2bdf31);}})[_0xe3c1('0x13')](function(_0x298a9e){if(_0x298a9e){return _0x298a9e?{'count':_0x374a88,'rows':_0x298a9e}:null;}})[_0xe3c1('0x13')](respondWithResult(_0x22f4da,null))[_0xe3c1('0x1e')](handleError(_0x22f4da,null));};exports[_0xe3c1('0x119')]=function(_0x28bf40,_0x4bfb44){return db['chatProactiveAction']['find']({'where':{'id':_0x28bf40[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x4bfb44,null))[_0xe3c1('0x13')](function(_0x1871d9){if(_0x1871d9){return _0x1871d9['addProactiveActions'](_0x28bf40['body'][_0xe3c1('0x5d')],_[_0xe3c1('0xeb')](_0x28bf40[_0xe3c1('0x4e')],[_0xe3c1('0x5d'),'id'])||{});}})[_0xe3c1('0x13')](respondWithResult(_0x4bfb44,null))[_0xe3c1('0x1e')](handleError(_0x4bfb44,null));};exports[_0xe3c1('0x101')]=function(_0x29534f,_0x436865){var _0x2e99ab={};var _0xdb2223={};var _0x1b2708;var _0x157d0b;return db[_0xe3c1('0x47')]['findOne']({'where':{'id':_0x29534f[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x436865,null))[_0xe3c1('0x13')](function(_0x35e328){if(_0x35e328){_0x1b2708=_0x35e328;_0xdb2223['model']=_['keys'](db[_0xe3c1('0x11a')][_0xe3c1('0x31')]);_0xdb2223[_0xe3c1('0x37')]=_[_0xe3c1('0x38')](_0x29534f['query']);_0xdb2223['filters']=_['intersection'](_0xdb2223[_0xe3c1('0x35')],_0xdb2223[_0xe3c1('0x37')]);_0x2e99ab[_0xe3c1('0x3b')]=_[_0xe3c1('0x3a')](_0xdb2223['model'],qs['fields'](_0x29534f[_0xe3c1('0x37')][_0xe3c1('0x3c')]));_0x2e99ab[_0xe3c1('0x3b')]=_0x2e99ab[_0xe3c1('0x3b')][_0xe3c1('0x3d')]?_0x2e99ab[_0xe3c1('0x3b')]:_0xdb2223[_0xe3c1('0x35')];_0x2e99ab['order']=qs['sort'](_0x29534f[_0xe3c1('0x37')]['sort']);_0x2e99ab[_0xe3c1('0x41')]=qs[_0xe3c1('0x39')](_['pick'](_0x29534f[_0xe3c1('0x37')],_0xdb2223['filters']));if(_0x29534f[_0xe3c1('0x37')]['filter']){_0x2e99ab['where']=_['merge'](_0x2e99ab['where'],{'$or':_[_0xe3c1('0x36')](_0x2e99ab['attributes'],function(_0x139809){var _0xdbc29d={};_0xdbc29d[_0x139809]={'$like':'%'+_0x29534f[_0xe3c1('0x37')]['filter']+'%'};return _0xdbc29d;})});}_0x2e99ab=_[_0xe3c1('0x45')]({},_0x2e99ab,_0x29534f[_0xe3c1('0x46')]);return _0x1b2708['getProactiveActions'](_0x2e99ab);}})[_0xe3c1('0x13')](function(_0x4ca022){if(_0x4ca022){_0x157d0b=_0x4ca022[_0xe3c1('0x3d')];if(!_0x29534f[_0xe3c1('0x37')][_0xe3c1('0x3e')](_0xe3c1('0x3f'))){_0x2e99ab[_0xe3c1('0x23')]=qs[_0xe3c1('0x23')](_0x29534f[_0xe3c1('0x37')][_0xe3c1('0x23')]);_0x2e99ab[_0xe3c1('0x21')]=qs[_0xe3c1('0x21')](_0x29534f['query'][_0xe3c1('0x21')]);}return _0x1b2708[_0xe3c1('0x101')](_0x2e99ab);}})[_0xe3c1('0x13')](function(_0x2ccc55){if(_0x2ccc55){return _0x2ccc55?{'count':_0x157d0b,'rows':_0x2ccc55}:null;}})[_0xe3c1('0x13')](respondWithResult(_0x436865,null))[_0xe3c1('0x1e')](handleError(_0x436865,null));};exports['getFields']=function(_0x605fb2,_0xdaf36d){var _0x59ed42=_0x605fb2[_0xe3c1('0x37')][_0xe3c1('0x11b')]===_0xe3c1('0x11c')?_0xe3c1('0x11d'):'onlineForm';return db[_0xe3c1('0x47')]['find']({'attributes':['id',_0x59ed42],'where':{'id':_0x605fb2['params']['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0xdaf36d,null))[_0xe3c1('0x13')](function(_0x3c6ae9){if(_0x3c6ae9){var _0x368093=_0x3c6ae9[_0x59ed42];var _0x4bf5a5=_0x368093&&_0x368093['items']?_0x368093[_0xe3c1('0x11e')]:[];_0xdaf36d[_0xe3c1('0x2d')]({'fromKey':_[_0xe3c1('0x70')](_0x368093['fromKey'])?undefined:_0x368093[_0xe3c1('0x11f')],'count':_0x4bf5a5[_0xe3c1('0x3d')],'rows':_0x4bf5a5});}})[_0xe3c1('0x1e')](handleError(_0xdaf36d,null));};exports['getOfflineMessages']=function(_0x2ff02b,_0x42042b){var _0x57dad9={'raw':![],'where':{}};var _0x9f8b77={};var _0xd7d21f={'count':0x0,'rows':[]};return db[_0xe3c1('0x47')][_0xe3c1('0x5a')]({'where':{'id':_0x2ff02b[_0xe3c1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42042b,null))[_0xe3c1('0x13')](function(_0x1731fe){if(_0x1731fe){_0x9f8b77[_0xe3c1('0x35')]=_[_0xe3c1('0x38')](db[_0xe3c1('0xcc')][_0xe3c1('0x31')]);_0x9f8b77[_0xe3c1('0x37')]=_['keys'](_0x2ff02b[_0xe3c1('0x37')]);_0x9f8b77['filters']=_[_0xe3c1('0x3a')](_0x9f8b77[_0xe3c1('0x35')],_0x9f8b77[_0xe3c1('0x37')]);_0x57dad9[_0xe3c1('0x3b')]=_['intersection'](_0x9f8b77[_0xe3c1('0x35')],qs[_0xe3c1('0x3c')](_0x2ff02b['query'][_0xe3c1('0x3c')]));_0x57dad9['attributes']=_0x57dad9[_0xe3c1('0x3b')][_0xe3c1('0x3d')]?_0x57dad9[_0xe3c1('0x3b')]:_0x9f8b77['model'];if(!_0x2ff02b[_0xe3c1('0x37')][_0xe3c1('0x3e')](_0xe3c1('0x3f'))){_0x57dad9[_0xe3c1('0x23')]=qs[_0xe3c1('0x23')](_0x2ff02b[_0xe3c1('0x37')]['limit']);_0x57dad9[_0xe3c1('0x21')]=qs[_0xe3c1('0x21')](_0x2ff02b['query'][_0xe3c1('0x21')]);}_0x57dad9[_0xe3c1('0x61')]=qs[_0xe3c1('0x40')](_0x2ff02b['query'][_0xe3c1('0x40')]);_0x57dad9[_0xe3c1('0x41')]=qs[_0xe3c1('0x39')](_['pick'](_0x2ff02b[_0xe3c1('0x37')],_0x9f8b77[_0xe3c1('0x39')]));_0x57dad9['where'][_0xe3c1('0x58')]=_0x1731fe['id'];if(_0x2ff02b[_0xe3c1('0x37')]['filter']){_0x57dad9[_0xe3c1('0x41')]=_[_0xe3c1('0x45')](_0x57dad9['where'],{'$or':_[_0xe3c1('0x36')](_0x57dad9['attributes'],function(_0x187564){var _0x333b5c={};_0x333b5c[_0x187564]={'$like':'%'+_0x2ff02b[_0xe3c1('0x37')][_0xe3c1('0x43')]+'%'};return _0x333b5c;})});}_0x57dad9=_[_0xe3c1('0x45')]({},_0x57dad9,_0x2ff02b[_0xe3c1('0x46')]);return db[_0xe3c1('0xcc')][_0xe3c1('0x24')]({'where':_0x57dad9[_0xe3c1('0x41')]})[_0xe3c1('0x13')](function(_0x3bd8db){_0xd7d21f[_0xe3c1('0x24')]=_0x3bd8db;if(_0x2ff02b[_0xe3c1('0x37')][_0xe3c1('0x48')]){_0x57dad9['include']=[{'all':!![]}];}else{_0x57dad9['include']=[{'model':db['CmContact'],'as':_0xe3c1('0xed'),'required':![]},{'model':db[_0xe3c1('0x120')],'as':'Attachments','required':![]}];}return db[_0xe3c1('0xcc')][_0xe3c1('0x4a')](_0x57dad9);})['then'](function(_0xe2f21e){_0xd7d21f[_0xe3c1('0x5b')]=_0xe2f21e;return _0xd7d21f;});}})[_0xe3c1('0x13')](respondWithFilteredResult(_0x42042b,_0x57dad9))[_0xe3c1('0x1e')](handleError(_0x42042b,null));};exports['addAgents']=function(_0xcabf2a,_0x45a661){return db['ChatWebsite']['find']({'where':{'id':_0xcabf2a[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x45a661,null))[_0xe3c1('0x13')](function(_0x302655){if(_0x302655){return _0x302655[_0xe3c1('0x121')](_0xcabf2a[_0xe3c1('0x4e')]['ids'],_[_0xe3c1('0xeb')](_0xcabf2a[_0xe3c1('0x4e')],['ids','id'])||{})[_0xe3c1('0xaf')](function(_0x1cdf4e){for(var _0x4dfbaf=0x0;_0x4dfbaf<_0xcabf2a[_0xe3c1('0x4e')]['ids'][_0xe3c1('0x3d')];_0x4dfbaf+=0x1){socket[_0xe3c1('0x122')]('userChatWebsite:save',{'UserId':Number(_0xcabf2a[_0xe3c1('0x4e')]['ids'][_0x4dfbaf]),'ChatWebsiteId':Number(_0xcabf2a[_0xe3c1('0x4c')]['id'])});}return _0x1cdf4e;});}})[_0xe3c1('0x13')](respondWithResult(_0x45a661,null))['catch'](handleError(_0x45a661,null));};exports[_0xe3c1('0x123')]=function(_0xa53f0f,_0x450200){return db[_0xe3c1('0x47')][_0xe3c1('0x53')]({'where':{'id':_0xa53f0f[_0xe3c1('0x4c')]['id']}})[_0xe3c1('0x13')](handleEntityNotFound(_0x450200,null))[_0xe3c1('0x13')](function(_0x4759c6){if(_0x4759c6){return _0x4759c6['removeAgents'](_0xa53f0f['query'][_0xe3c1('0x5d')])[_0xe3c1('0x13')](function(){if(_[_0xe3c1('0x124')](_0xa53f0f[_0xe3c1('0x37')]['ids'])){for(var _0x1abd0d=0x0;_0x1abd0d<_0xa53f0f[_0xe3c1('0x37')][_0xe3c1('0x5d')][_0xe3c1('0x3d')];_0x1abd0d+=0x1){socket[_0xe3c1('0x122')]('userChatWebsite:remove',{'UserId':Number(_0xa53f0f['query'][_0xe3c1('0x5d')][_0x1abd0d]),'ChatWebsiteId':Number(_0xa53f0f[_0xe3c1('0x4c')]['id'])});}}else{socket['emit'](_0xe3c1('0x125'),{'UserId':Number(_0xa53f0f[_0xe3c1('0x37')][_0xe3c1('0x5d')]),'ChatWebsiteId':Number(_0xa53f0f[_0xe3c1('0x4c')]['id'])});}});}})[_0xe3c1('0x13')](respondWithStatusCode(_0x450200,null))[_0xe3c1('0x1e')](handleError(_0x450200,null));};exports['getAgents']=function(_0x31080a,_0xf1c31d){var _0x4ac6a1={};var _0x15708e={};var _0x19fc8e;var _0xb11b4c;return db[_0xe3c1('0x47')]['findOne']({'where':{'id':_0x31080a['params']['id']}})['then'](handleEntityNotFound(_0xf1c31d,null))[_0xe3c1('0x13')](function(_0x282f04){if(_0x282f04){_0x19fc8e=_0x282f04;_0x15708e[_0xe3c1('0x35')]=_['keys'](db[_0xe3c1('0xb7')][_0xe3c1('0x31')]);_0x15708e[_0xe3c1('0x37')]=_[_0xe3c1('0x38')](_0x31080a[_0xe3c1('0x37')]);_0x15708e['filters']=_[_0xe3c1('0x3a')](_0x15708e[_0xe3c1('0x35')],_0x15708e[_0xe3c1('0x37')]);_0x4ac6a1[_0xe3c1('0x3b')]=_[_0xe3c1('0x3a')](_0x15708e['model'],qs[_0xe3c1('0x3c')](_0x31080a[_0xe3c1('0x37')]['fields']));_0x4ac6a1['attributes']=_0x4ac6a1[_0xe3c1('0x3b')][_0xe3c1('0x3d')]?_0x4ac6a1['attributes']:_0x15708e[_0xe3c1('0x35')];_0x4ac6a1[_0xe3c1('0x61')]=qs[_0xe3c1('0x40')](_0x31080a[_0xe3c1('0x37')][_0xe3c1('0x40')]);_0x4ac6a1[_0xe3c1('0x41')]=qs['filters'](_['pick'](_0x31080a[_0xe3c1('0x37')],_0x15708e[_0xe3c1('0x39')]));if(_0x31080a['query']['filter']){_0x4ac6a1['where']=_[_0xe3c1('0x45')](_0x4ac6a1[_0xe3c1('0x41')],{'$or':_[_0xe3c1('0x36')](_0x4ac6a1[_0xe3c1('0x3b')],function(_0x76035){var _0x3d7fd6={};_0x3d7fd6[_0x76035]={'$like':'%'+_0x31080a['query'][_0xe3c1('0x43')]+'%'};return _0x3d7fd6;})});}_0x4ac6a1=_[_0xe3c1('0x45')]({},_0x4ac6a1,_0x31080a[_0xe3c1('0x46')]);return _0x19fc8e[_0xe3c1('0x126')](_0x4ac6a1);}})['then'](function(_0x2d7277){if(_0x2d7277){_0xb11b4c=_0x2d7277[_0xe3c1('0x3d')];if(!_0x31080a['query']['hasOwnProperty'](_0xe3c1('0x3f'))){_0x4ac6a1[_0xe3c1('0x23')]=qs[_0xe3c1('0x23')](_0x31080a[_0xe3c1('0x37')][_0xe3c1('0x23')]);_0x4ac6a1['offset']=qs[_0xe3c1('0x21')](_0x31080a[_0xe3c1('0x37')]['offset']);}return _0x19fc8e[_0xe3c1('0x126')](_0x4ac6a1);}})[_0xe3c1('0x13')](function(_0x2e2b55){if(_0x2e2b55){return _0x2e2b55?{'count':_0xb11b4c,'rows':_0x2e2b55}:null;}})[_0xe3c1('0x13')](respondWithResult(_0xf1c31d,null))[_0xe3c1('0x1e')](handleError(_0xf1c31d,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index a466a1c..31221df 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 _0xab5b=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x409deb,_0x2b731){var _0x15a4f7=function(_0x556510){while(--_0x556510){_0x409deb['push'](_0x409deb['shift']());}};_0x15a4f7(++_0x2b731);}(_0xab5b,0x11a));var _0xbab5=function(_0x49c481,_0x1f5ec5){_0x49c481=_0x49c481-0x0;var _0x58e5d3=_0xab5b[_0x49c481];return _0x58e5d3;};'use strict';var EventEmitter=require(_0xbab5('0x0'));var ChatWebsite=require(_0xbab5('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbab5('0x2')](0x0);var events={'afterCreate':_0xbab5('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2a5d23){return function(_0x58f49f,_0xa320ef,_0x2fe469){ChatWebsiteEvents[_0xbab5('0x4')](_0x2a5d23+':'+_0x58f49f['id'],_0x58f49f);ChatWebsiteEvents[_0xbab5('0x4')](_0x2a5d23,_0x58f49f);_0x2fe469(null);};}for(var e in events){if(events[_0xbab5('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xbab5('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x21d1=['ChatWebsite','setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x5a8a00,_0x10aa01){var _0x31c791=function(_0x9234e5){while(--_0x9234e5){_0x5a8a00['push'](_0x5a8a00['shift']());}};_0x31c791(++_0x10aa01);}(_0x21d1,0x1c9));var _0x121d=function(_0x294867,_0x595ddd){_0x294867=_0x294867-0x0;var _0x53d781=_0x21d1[_0x294867];return _0x53d781;};'use strict';var EventEmitter=require(_0x121d('0x0'));var ChatWebsite=require(_0x121d('0x1'))['db'][_0x121d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x121d('0x3')](0x0);var events={'afterCreate':_0x121d('0x4'),'afterUpdate':_0x121d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50365e){return function(_0x20b991,_0x19c637,_0x885fc4){ChatWebsiteEvents[_0x121d('0x6')](_0x50365e+':'+_0x20b991['id'],_0x20b991);ChatWebsiteEvents[_0x121d('0x6')](_0x50365e,_0x20b991);_0x885fc4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x121d('0x7')](e,emitEvent(event));}}module[_0x121d('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 5c88416..7ed5e97 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 _0xa824=['request-promise','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','util','moment','bluebird'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa824,0x1c8));var _0x4a82=function(_0x53f852,_0x18ab08){_0x53f852=_0x53f852-0x0;var _0x2640c2=_0xa824[_0x53f852];return _0x2640c2;};'use strict';var _=require('lodash');var util=require(_0x4a82('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4a82('0x1'));var BPromise=require(_0x4a82('0x2'));var rp=require(_0x4a82('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a82('0x4'));var config=require('../../config/environment');var attributes=require(_0x4a82('0x5'));module[_0x4a82('0x6')]=function(_0x89f8e3,_0x1e7a38){return _0x89f8e3[_0x4a82('0x7')](_0x4a82('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fc7=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash'];(function(_0x298731,_0x4c8cc4){var _0x538761=function(_0x2afa72){while(--_0x2afa72){_0x298731['push'](_0x298731['shift']());}};_0x538761(++_0x4c8cc4);}(_0x2fc7,0x1df));var _0x72fc=function(_0x553c2d,_0x585842){_0x553c2d=_0x553c2d-0x0;var _0x28aa65=_0x2fc7[_0x553c2d];return _0x28aa65;};'use strict';var _=require(_0x72fc('0x0'));var util=require(_0x72fc('0x1'));var logger=require(_0x72fc('0x2'))(_0x72fc('0x3'));var moment=require('moment');var BPromise=require(_0x72fc('0x4'));var rp=require(_0x72fc('0x5'));var fs=require('fs');var path=require(_0x72fc('0x6'));var rimraf=require('rimraf');var config=require(_0x72fc('0x7'));var attributes=require(_0x72fc('0x8'));module[_0x72fc('0x9')]=function(_0x332a47,_0x5df77a){return _0x332a47[_0x72fc('0xa')](_0x72fc('0xb'),attributes,{'tableName':'chat_websites','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 ee43865..52d0ae9 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 _0xa672=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1b36c9,_0x457e68){var _0xe16e11=function(_0x3f985b){while(--_0x3f985b){_0x1b36c9['push'](_0x1b36c9['shift']());}};_0xe16e11(++_0x457e68);}(_0xa672,0x15d));var _0x2a67=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xa672[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x2a67('0x0'));var util=require(_0x2a67('0x1'));var moment=require(_0x2a67('0x2'));var BPromise=require(_0x2a67('0x3'));var rs=require(_0x2a67('0x4'));var fs=require('fs');var Redis=require(_0x2a67('0x5'));var db=require(_0x2a67('0x6'))['db'];var utils=require(_0x2a67('0x7'));var logger=require(_0x2a67('0x8'))(_0x2a67('0x9'));var config=require(_0x2a67('0xa'));var jayson=require(_0x2a67('0xb'));var client=jayson[_0x2a67('0xc')]['http']({'port':0x232a});config[_0x2a67('0xd')]=_[_0x2a67('0xe')](config[_0x2a67('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2a67('0xf'))(new Redis(config[_0x2a67('0xd')]));require(_0x2a67('0x10'))[_0x2a67('0x11')](socket);function respondWithRpcPromise(_0x1d6063,_0x249fc9,_0x248b5b){return new BPromise(function(_0x4e22ea,_0x541e8b){return client[_0x2a67('0x12')](_0x1d6063,_0x248b5b)['then'](function(_0x10d2ee){logger[_0x2a67('0x13')](_0x2a67('0x14'),_0x249fc9,_0x2a67('0x15'));logger[_0x2a67('0x16')](_0x2a67('0x17'),_0x249fc9,'request\x20sent',JSON[_0x2a67('0x18')](_0x10d2ee));if(_0x10d2ee[_0x2a67('0x19')]){if(_0x10d2ee[_0x2a67('0x19')][_0x2a67('0x1a')]===0x1f4){logger[_0x2a67('0x19')](_0x2a67('0x14'),_0x249fc9,_0x10d2ee[_0x2a67('0x19')][_0x2a67('0x1b')]);return _0x541e8b(_0x10d2ee[_0x2a67('0x19')][_0x2a67('0x1b')]);}logger[_0x2a67('0x19')](_0x2a67('0x14'),_0x249fc9,_0x10d2ee[_0x2a67('0x19')][_0x2a67('0x1b')]);return _0x4e22ea(_0x10d2ee['error'][_0x2a67('0x1b')]);}else{logger[_0x2a67('0x13')](_0x2a67('0x14'),_0x249fc9,_0x2a67('0x15'));_0x4e22ea(_0x10d2ee['result'][_0x2a67('0x1b')]);}})[_0x2a67('0x1c')](function(_0x46a775){logger[_0x2a67('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x249fc9,_0x46a775);_0x541e8b(_0x46a775);});});} \ No newline at end of file +var _0xaaf1=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xaaf1,0x180));var _0x1aaf=function(_0x567792,_0x262a77){_0x567792=_0x567792-0x0;var _0x3ebeff=_0xaaf1[_0x567792];return _0x3ebeff;};'use strict';var _=require(_0x1aaf('0x0'));var util=require(_0x1aaf('0x1'));var moment=require(_0x1aaf('0x2'));var BPromise=require(_0x1aaf('0x3'));var rs=require(_0x1aaf('0x4'));var fs=require('fs');var Redis=require(_0x1aaf('0x5'));var db=require(_0x1aaf('0x6'))['db'];var utils=require(_0x1aaf('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1aaf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1aaf('0x9')][_0x1aaf('0xa')]({'port':0x232a});config[_0x1aaf('0xb')]=_[_0x1aaf('0xc')](config[_0x1aaf('0xb')],{'host':_0x1aaf('0xd'),'port':0x18eb});var socket=require(_0x1aaf('0xe'))(new Redis(config[_0x1aaf('0xb')]));require('./chatWebsite.socket')[_0x1aaf('0xf')](socket);function respondWithRpcPromise(_0x560128,_0x293d97,_0xfb6c44){return new BPromise(function(_0x1aa5c4,_0x28f13b){return client[_0x1aaf('0x10')](_0x560128,_0xfb6c44)[_0x1aaf('0x11')](function(_0x2f8398){logger[_0x1aaf('0x12')](_0x1aaf('0x13'),_0x293d97,_0x1aaf('0x14'));logger[_0x1aaf('0x15')](_0x1aaf('0x16'),_0x293d97,'request\x20sent',JSON[_0x1aaf('0x17')](_0x2f8398));if(_0x2f8398[_0x1aaf('0x18')]){if(_0x2f8398['error'][_0x1aaf('0x19')]===0x1f4){logger[_0x1aaf('0x18')](_0x1aaf('0x13'),_0x293d97,_0x2f8398['error']['message']);return _0x28f13b(_0x2f8398['error'][_0x1aaf('0x1a')]);}logger[_0x1aaf('0x18')](_0x1aaf('0x13'),_0x293d97,_0x2f8398[_0x1aaf('0x18')][_0x1aaf('0x1a')]);return _0x1aa5c4(_0x2f8398[_0x1aaf('0x18')][_0x1aaf('0x1a')]);}else{logger['info'](_0x1aaf('0x13'),_0x293d97,_0x1aaf('0x14'));_0x1aa5c4(_0x2f8398['result']['message']);}})['catch'](function(_0x3c407c){logger[_0x1aaf('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x293d97,_0x3c407c);_0x28f13b(_0x3c407c);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 95d9bf3..d2adb22 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 _0x8a7e=['./chatWebsite.events','save','remove','update','emit','register','chatWebsite:'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x8a7e,0x1b2));var _0xe8a7=function(_0x55781d,_0x3183ca){_0x55781d=_0x55781d-0x0;var _0x478c14=_0x8a7e[_0x55781d];return _0x478c14;};'use strict';var ChatWebsiteEvents=require(_0xe8a7('0x0'));var events=[_0xe8a7('0x1'),_0xe8a7('0x2'),_0xe8a7('0x3')];function createListener(_0x49f0ab,_0x1ac729){return function(_0x43fa97){_0x1ac729[_0xe8a7('0x4')](_0x49f0ab,_0x43fa97);};}function removeListener(_0x2524c7,_0x12ca87){return function(){ChatWebsiteEvents['removeListener'](_0x2524c7,_0x12ca87);};}exports[_0xe8a7('0x5')]=function(_0x5c9c2f){for(var _0x283338=0x0,_0x2cabc2=events['length'];_0x283338<_0x2cabc2;_0x283338++){var _0x184b21=events[_0x283338];var _0x1be3f2=createListener(_0xe8a7('0x6')+_0x184b21,_0x5c9c2f);ChatWebsiteEvents['on'](_0x184b21,_0x1be3f2);}}; \ No newline at end of file +var _0x0f6d=['save','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x1bd3b2,_0x14d3b7){var _0x2b95bc=function(_0x5d485b){while(--_0x5d485b){_0x1bd3b2['push'](_0x1bd3b2['shift']());}};_0x2b95bc(++_0x14d3b7);}(_0x0f6d,0x87));var _0xd0f6=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x0f6d[_0x5e8d3e];return _0x1348c0;};'use strict';var ChatWebsiteEvents=require(_0xd0f6('0x0'));var events=[_0xd0f6('0x1'),'remove',_0xd0f6('0x2')];function createListener(_0x14781c,_0x1c658e){return function(_0x1044fb){_0x1c658e[_0xd0f6('0x3')](_0x14781c,_0x1044fb);};}function removeListener(_0x2ce40f,_0x380397){return function(){ChatWebsiteEvents[_0xd0f6('0x4')](_0x2ce40f,_0x380397);};}exports[_0xd0f6('0x5')]=function(_0xf28c5b){for(var _0x4d93bc=0x0,_0x1088f6=events[_0xd0f6('0x6')];_0x4d93bc<_0x1088f6;_0x4d93bc++){var _0xb3c50=events[_0x4d93bc];var _0x2042d9=createListener(_0xd0f6('0x7')+_0xb3c50,_0xf28c5b);ChatWebsiteEvents['on'](_0xb3c50,_0x2042d9);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 615bb90..fda51f7 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 _0x83aa=['replace','/:id/offline','offline','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','single','file','addLogo','server/files/images/avatars/','originalname','addAvatar','addCustomerAvatar','%s-%s','addSystemAvatar','notify','attachments','offline-chat','ensureDir'];(function(_0x4af05c,_0x314e3e){var _0x1964d6=function(_0x596066){while(--_0x596066){_0x4af05c['push'](_0x4af05c['shift']());}};_0x1964d6(++_0x314e3e);}(_0x83aa,0xf7));var _0xa83a=function(_0x3bf194,_0x342216){_0x3bf194=_0x3bf194-0x0;var _0x105954=_0x83aa[_0x3bf194];return _0x105954;};'use strict';var multer=require(_0xa83a('0x0'));var util=require(_0xa83a('0x1'));var path=require(_0xa83a('0x2'));var timeout=require(_0xa83a('0x3'));var express=require(_0xa83a('0x4'));var router=express[_0xa83a('0x5')]();var fs_extra=require(_0xa83a('0x6'));var auth=require(_0xa83a('0x7'));var interaction=require(_0xa83a('0x8'));var config=require(_0xa83a('0x9'));var controller=require(_0xa83a('0xa'));router[_0xa83a('0xb')]('/',auth['isAuthenticated'](),controller[_0xa83a('0xc')]);router[_0xa83a('0xb')](_0xa83a('0xd'),auth[_0xa83a('0xe')](),controller[_0xa83a('0xf')]);router[_0xa83a('0xb')](_0xa83a('0x10'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x11')]);router[_0xa83a('0xb')](_0xa83a('0x12'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x13')]);router[_0xa83a('0xb')]('/:id/canned_answers',auth[_0xa83a('0xe')](),controller[_0xa83a('0x14')]);router[_0xa83a('0xb')](_0xa83a('0x15'),controller[_0xa83a('0x16')]);router['get'](_0xa83a('0x17'),controller['getAvatar']);router['get'](_0xa83a('0x18'),controller[_0xa83a('0x19')]);router['get'](_0xa83a('0x1a'),controller['getSystemAvatar']);router[_0xa83a('0xb')](_0xa83a('0x1b'),auth[_0xa83a('0xe')](),controller['getInteractions']);router['get'](_0xa83a('0x1c'),controller[_0xa83a('0x1d')]);router[_0xa83a('0xb')](_0xa83a('0x1e'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x1f')]);router[_0xa83a('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xa83a('0x20')]);router[_0xa83a('0xb')](_0xa83a('0x21'),controller[_0xa83a('0x22')]);router[_0xa83a('0xb')]('/:id/offline_messages',auth[_0xa83a('0xe')](),controller[_0xa83a('0x23')]);router[_0xa83a('0xb')](_0xa83a('0x24'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x25')]);router[_0xa83a('0x26')]('/',auth[_0xa83a('0xe')](),controller[_0xa83a('0x27')]);router['post'](_0xa83a('0x12'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x28')]);router[_0xa83a('0x26')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa83a('0x29')]);var upload=multer({'storage':multer[_0xa83a('0x2a')]({'destination':function(_0x1613ec,_0x91413,_0x3c25a2){_0x3c25a2(null,path[_0xa83a('0x2b')](config[_0xa83a('0x2c')],_0xa83a('0x2d')));},'filename':function(_0x22e8d9,_0x3d727e,_0x20103d){_0x20103d(null,util[_0xa83a('0x2e')]('%s-%s',Date[_0xa83a('0x2f')](),_0x3d727e['originalname']));}})});router[_0xa83a('0x26')](_0xa83a('0x15'),upload[_0xa83a('0x30')](_0xa83a('0x31')),controller[_0xa83a('0x32')]);var upload=multer({'storage':multer[_0xa83a('0x2a')]({'destination':function(_0x63a744,_0x31f961,_0x20af4b){_0x20af4b(null,path[_0xa83a('0x2b')](config[_0xa83a('0x2c')],_0xa83a('0x33')));},'filename':function(_0x50eef1,_0x2f28e2,_0x447229){_0x447229(null,util[_0xa83a('0x2e')]('%s-%s',Date[_0xa83a('0x2f')](),_0x2f28e2[_0xa83a('0x34')]));}})});router[_0xa83a('0x26')](_0xa83a('0x17'),upload['single'](_0xa83a('0x31')),controller[_0xa83a('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42d660,_0x498fcf,_0x285f49){_0x285f49(null,path[_0xa83a('0x2b')](config[_0xa83a('0x2c')],_0xa83a('0x33')));},'filename':function(_0x571985,_0x2a4a65,_0x5ea6a6){_0x5ea6a6(null,util['format']('%s-%s',Date['now'](),_0x2a4a65['originalname']));}})});router[_0xa83a('0x26')]('/:id/customer_avatar',upload['single'](_0xa83a('0x31')),controller[_0xa83a('0x36')]);var upload=multer({'storage':multer[_0xa83a('0x2a')]({'destination':function(_0x1f1da4,_0x2fcc64,_0x4ea014){_0x4ea014(null,path[_0xa83a('0x2b')](config['root'],_0xa83a('0x33')));},'filename':function(_0x429527,_0x3705c8,_0x44edce){_0x44edce(null,util['format'](_0xa83a('0x37'),Date[_0xa83a('0x2f')](),_0x3705c8['originalname']));}})});router['post'](_0xa83a('0x1a'),upload[_0xa83a('0x30')](_0xa83a('0x31')),controller[_0xa83a('0x38')]);router[_0xa83a('0x26')]('/:id/notify',controller[_0xa83a('0x39')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x228b19,_0x55d47b,_0x51434e){const _0x423b5e=path[_0xa83a('0x2b')](config[_0xa83a('0x2c')],'server/files',_0xa83a('0x3a'),_0xa83a('0x3b'));fs_extra[_0xa83a('0x3c')](_0x423b5e,function(){_0x51434e(null,_0x423b5e);});},'filename':function(_0x1f8711,_0x5f3945,_0xb43382){const _0x57aea7=_0x5f3945[_0xa83a('0x34')][_0xa83a('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5c177e=path['extname'](_0x57aea7);const _0x51830b=Date['now']()+'-'+_0x57aea7[_0xa83a('0x3d')](_0x5c177e,'')+_0x5c177e;_0xb43382(null,_0x51830b);}})});router[_0xa83a('0x26')](_0xa83a('0x3e'),offlineUploadMulter['any'](),controller[_0xa83a('0x3f')]);router[_0xa83a('0x26')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xa83a('0x40')]);router[_0xa83a('0x26')](_0xa83a('0x1e'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x41')]);router[_0xa83a('0x26')](_0xa83a('0x42'),auth[_0xa83a('0xe')](),controller['addProactiveActions']);router[_0xa83a('0x26')](_0xa83a('0x24'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x43')]);router[_0xa83a('0x44')]('/:id',auth[_0xa83a('0xe')](),controller[_0xa83a('0x45')]);router[_0xa83a('0x46')](_0xa83a('0x10'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x47')]);router[_0xa83a('0x46')](_0xa83a('0x12'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x48')]);router['delete'](_0xa83a('0x49'),auth['isAuthenticated'](),controller[_0xa83a('0x4a')]);router['delete'](_0xa83a('0x24'),auth[_0xa83a('0xe')](),controller[_0xa83a('0x4b')]);module[_0xa83a('0x4c')]=router; \ No newline at end of file +var _0xbea3=['addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','put','/:id','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','getSnippet','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create','post','addAnswer','root','%s-%s','originalname','single','addLogo','diskStorage','server/files/images/avatars/','format','now','join','file'];(function(_0x18eecc,_0x795532){var _0x5d4cbe=function(_0x2cc23a){while(--_0x2cc23a){_0x18eecc['push'](_0x18eecc['shift']());}};_0x5d4cbe(++_0x795532);}(_0xbea3,0x119));var _0x3bea=function(_0x389d73,_0x13f8e8){_0x389d73=_0x389d73-0x0;var _0x345a9f=_0xbea3[_0x389d73];return _0x345a9f;};'use strict';var multer=require(_0x3bea('0x0'));var util=require(_0x3bea('0x1'));var path=require(_0x3bea('0x2'));var timeout=require(_0x3bea('0x3'));var express=require(_0x3bea('0x4'));var router=express['Router']();var fs_extra=require(_0x3bea('0x5'));var auth=require(_0x3bea('0x6'));var interaction=require(_0x3bea('0x7'));var config=require('../../config/environment');var controller=require(_0x3bea('0x8'));router[_0x3bea('0x9')]('/',auth[_0x3bea('0xa')](),controller['index']);router[_0x3bea('0x9')](_0x3bea('0xb'),auth[_0x3bea('0xa')](),controller[_0x3bea('0xc')]);router[_0x3bea('0x9')]('/:id',auth[_0x3bea('0xa')](),controller['show']);router[_0x3bea('0x9')](_0x3bea('0xd'),auth[_0x3bea('0xa')](),controller['getDispositions']);router[_0x3bea('0x9')](_0x3bea('0xe'),auth['isAuthenticated'](),controller[_0x3bea('0xf')]);router[_0x3bea('0x9')](_0x3bea('0x10'),controller[_0x3bea('0x11')]);router[_0x3bea('0x9')](_0x3bea('0x12'),controller[_0x3bea('0x13')]);router[_0x3bea('0x9')](_0x3bea('0x14'),controller[_0x3bea('0x15')]);router[_0x3bea('0x9')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x3bea('0x9')]('/:id/interactions',auth[_0x3bea('0xa')](),controller[_0x3bea('0x16')]);router[_0x3bea('0x9')]('/:id/snippet',controller[_0x3bea('0x17')]);router[_0x3bea('0x9')]('/:id/applications',auth[_0x3bea('0xa')](),controller['getApplications']);router['get'](_0x3bea('0x18'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x3bea('0x19'),controller[_0x3bea('0x1a')]);router[_0x3bea('0x9')](_0x3bea('0x1b'),auth['isAuthenticated'](),controller[_0x3bea('0x1c')]);router[_0x3bea('0x9')](_0x3bea('0x1d'),auth[_0x3bea('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x3bea('0x1e')]);router[_0x3bea('0x1f')](_0x3bea('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x3bea('0x1f')](_0x3bea('0xe'),auth['isAuthenticated'](),controller[_0x3bea('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b68ac,_0x4fa818,_0x1e4ae3){_0x1e4ae3(null,path['join'](config[_0x3bea('0x21')],'server/files/images/logos/'));},'filename':function(_0x30b595,_0xb98c16,_0x4085a2){_0x4085a2(null,util['format'](_0x3bea('0x22'),Date['now'](),_0xb98c16[_0x3bea('0x23')]));}})});router[_0x3bea('0x1f')](_0x3bea('0x10'),upload[_0x3bea('0x24')]('file'),controller[_0x3bea('0x25')]);var upload=multer({'storage':multer[_0x3bea('0x26')]({'destination':function(_0x47748e,_0x23166d,_0x2022bc){_0x2022bc(null,path['join'](config[_0x3bea('0x21')],_0x3bea('0x27')));},'filename':function(_0x590c0a,_0x4f7183,_0x5cf4f9){_0x5cf4f9(null,util[_0x3bea('0x28')](_0x3bea('0x22'),Date[_0x3bea('0x29')](),_0x4f7183[_0x3bea('0x23')]));}})});router[_0x3bea('0x1f')](_0x3bea('0x12'),upload[_0x3bea('0x24')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x3bea('0x26')]({'destination':function(_0x4377f9,_0x2dea7d,_0x5bae9e){_0x5bae9e(null,path[_0x3bea('0x2a')](config[_0x3bea('0x21')],_0x3bea('0x27')));},'filename':function(_0x32ed64,_0x1c032f,_0x17bd02){_0x17bd02(null,util['format'](_0x3bea('0x22'),Date['now'](),_0x1c032f[_0x3bea('0x23')]));}})});router[_0x3bea('0x1f')]('/:id/customer_avatar',upload[_0x3bea('0x24')](_0x3bea('0x2b')),controller[_0x3bea('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bffd2,_0x155f14,_0x3f3654){_0x3f3654(null,path['join'](config[_0x3bea('0x21')],_0x3bea('0x27')));},'filename':function(_0xdb6c8,_0x1184d8,_0x197e39){_0x197e39(null,util[_0x3bea('0x28')](_0x3bea('0x22'),Date['now'](),_0x1184d8[_0x3bea('0x23')]));}})});router[_0x3bea('0x1f')]('/:id/system_avatar',upload[_0x3bea('0x24')](_0x3bea('0x2b')),controller[_0x3bea('0x2d')]);router[_0x3bea('0x1f')](_0x3bea('0x2e'),controller[_0x3bea('0x2f')]);const offlineUploadMulter=multer({'storage':multer[_0x3bea('0x26')]({'destination':function(_0x4c8406,_0x3b9858,_0x2e098d){const _0xbed3a4=path[_0x3bea('0x2a')](config[_0x3bea('0x21')],'server/files',_0x3bea('0x30'),_0x3bea('0x31'));fs_extra[_0x3bea('0x32')](_0xbed3a4,function(){_0x2e098d(null,_0xbed3a4);});},'filename':function(_0x2feabe,_0x5aebf2,_0x454ff3){const _0x580c86=_0x5aebf2['originalname'][_0x3bea('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x379e8b=path['extname'](_0x580c86);const _0x144f0b=Date[_0x3bea('0x29')]()+'-'+_0x580c86[_0x3bea('0x33')](_0x379e8b,'')+_0x379e8b;_0x454ff3(null,_0x144f0b);}})});router[_0x3bea('0x1f')]('/:id/offline',offlineUploadMulter[_0x3bea('0x34')](),controller[_0x3bea('0x35')]);router[_0x3bea('0x1f')](_0x3bea('0x36'),auth[_0x3bea('0xa')](),controller[_0x3bea('0x37')]);router[_0x3bea('0x1f')]('/:id/applications',auth[_0x3bea('0xa')](),controller[_0x3bea('0x38')]);router[_0x3bea('0x1f')](_0x3bea('0x18'),auth[_0x3bea('0xa')](),controller[_0x3bea('0x39')]);router['post']('/:id/users',auth[_0x3bea('0xa')](),controller['addAgents']);router[_0x3bea('0x3a')](_0x3bea('0x3b'),auth[_0x3bea('0xa')](),controller['update']);router[_0x3bea('0x3c')](_0x3bea('0x3b'),auth[_0x3bea('0xa')](),controller[_0x3bea('0x3d')]);router[_0x3bea('0x3c')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x3bea('0x3c')](_0x3bea('0xe'),auth[_0x3bea('0xa')](),controller[_0x3bea('0x3e')]);router['delete'](_0x3bea('0x1d'),auth[_0x3bea('0xa')](),controller[_0x3bea('0x3f')]);module[_0x3bea('0x40')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index c670bda..580481c 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 _0xe503=['isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use'];(function(_0x553744,_0x3d7f20){var _0x309e4e=function(_0x50ed4f){while(--_0x50ed4f){_0x553744['push'](_0x553744['shift']());}};_0x309e4e(++_0x3d7f20);}(_0xe503,0x1bc));var _0x3e50=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xe503[_0x484c03];return _0x294127;};var beaverLogger=require('beaver-logger/server');var express=require(_0x3e50('0x0'));var auth=require(_0x3e50('0x1'));var config=require(_0x3e50('0x2'));var router=express[_0x3e50('0x3')]();var isProduction=config[_0x3e50('0x4')]==='production'||![];function clientSideLogs(_0x4efe6b,_0x5ca439,_0x1c13e7){var _0x27c80f=_0x4efe6b[_0x3e50('0x5')][_0x3e50('0x6')](_0x3e50('0x7'));if(!_0x27c80f){throw new Error(_0x3e50('0x8'));}return beaverLogger[_0x3e50('0x9')]({'uri':'/client-logs','logger':_0x27c80f,'enableCors':!isProduction})(_0x4efe6b,_0x5ca439,_0x1c13e7);}router[_0x3e50('0xa')](auth[_0x3e50('0xb')](),clientSideLogs);module[_0x3e50('0xc')]=router; \ No newline at end of file +var _0xde27=['../config/environment','Router','env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','express','../components/auth/service'];(function(_0x327deb,_0xabcd75){var _0xe15245=function(_0x19be9c){while(--_0x19be9c){_0x327deb['push'](_0x327deb['shift']());}};_0xe15245(++_0xabcd75);}(_0xde27,0x73));var _0x7de2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xde27[_0x40a045];return _0x1a687c;};var beaverLogger=require('beaver-logger/server');var express=require(_0x7de2('0x0'));var auth=require(_0x7de2('0x1'));var config=require(_0x7de2('0x2'));var router=express[_0x7de2('0x3')]();var isProduction=config[_0x7de2('0x4')]===_0x7de2('0x5')||![];function clientSideLogs(_0x1b4de5,_0x4fb5fa,_0x36ab86){var _0x2f2cb7=_0x1b4de5['app'][_0x7de2('0x6')](_0x7de2('0x7'));if(!_0x2f2cb7){throw new Error(_0x7de2('0x8'));}return beaverLogger[_0x7de2('0x9')]({'uri':_0x7de2('0xa'),'logger':_0x2f2cb7,'enableCors':!isProduction})(_0x1b4de5,_0x4fb5fa,_0x36ab86);}router[_0x7de2('0xb')](auth[_0x7de2('0xc')](),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 23a6240..f076f62 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 _0xc99e=['AmazonAWS','Google','sequelize','exports','STRING','ENUM'];(function(_0x581bc8,_0x7566e){var _0x351c3e=function(_0x512a01){while(--_0x512a01){_0x581bc8['push'](_0x581bc8['shift']());}};_0x351c3e(++_0x7566e);}(_0xc99e,0x6e));var _0xec99=function(_0x244f2a,_0x46111e){_0x244f2a=_0x244f2a-0x0;var _0x2fea1c=_0xc99e[_0x244f2a];return _0x2fea1c;};'use strict';var Sequelize=require(_0xec99('0x0'));module[_0xec99('0x1')]={'name':{'type':Sequelize[_0xec99('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xec99('0x3')](_0xec99('0x4'),_0xec99('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xec99('0x2')]}}; \ No newline at end of file +var _0x5fab=['AmazonAWS','Google','STRING','sequelize','exports','ENUM'];(function(_0x28cda9,_0x52e9d1){var _0x5019fb=function(_0x10ab27){while(--_0x10ab27){_0x28cda9['push'](_0x28cda9['shift']());}};_0x5019fb(++_0x52e9d1);}(_0x5fab,0x177));var _0xb5fa=function(_0x567751,_0x4287c3){_0x567751=_0x567751-0x0;var _0x21a84c=_0x5fab[_0x567751];return _0x21a84c;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb5fa('0x2')](_0xb5fa('0x3'),_0xb5fa('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xb5fa('0x5')]},'data2':{'type':Sequelize[_0xb5fa('0x5')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 36f958f..a3f2c4f 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xadb5,0xad));var _0x5adb=function(_0x134e25,_0x50d084){_0x134e25=_0x134e25-0x0;var _0x5a2102=_0xadb5[_0x134e25];return _0x5a2102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xadb5,0xad));var _0x5adb=function(_0x4bc737,_0x563f6e){_0x4bc737=_0x4bc737-0x0;var _0x229715=_0xadb5[_0x4bc737];return _0x229715;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 9958da5..2d805fd 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 _0x9500=['request-promise','rimraf','../../config/environment','exports','define','CloudProvider','cloud_providers','lodash','util','api','moment'];(function(_0x56ba73,_0x3990f0){var _0x588e79=function(_0xaf43be){while(--_0xaf43be){_0x56ba73['push'](_0x56ba73['shift']());}};_0x588e79(++_0x3990f0);}(_0x9500,0x8b));var _0x0950=function(_0x488f38,_0x5cd941){_0x488f38=_0x488f38-0x0;var _0x33a7e4=_0x9500[_0x488f38];return _0x33a7e4;};'use strict';var _=require(_0x0950('0x0'));var util=require(_0x0950('0x1'));var logger=require('../../config/logger')(_0x0950('0x2'));var moment=require(_0x0950('0x3'));var BPromise=require('bluebird');var rp=require(_0x0950('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0950('0x5'));var config=require(_0x0950('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x0950('0x7')]=function(_0x2d1b1b,_0xe88794){return _0x2d1b1b[_0x0950('0x8')](_0x0950('0x9'),attributes,{'tableName':_0x0950('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5f6=['cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x3e2198,_0x5efff5){var _0x353b90=function(_0x26fd5f){while(--_0x26fd5f){_0x3e2198['push'](_0x3e2198['shift']());}};_0x353b90(++_0x5efff5);}(_0xc5f6,0xb7));var _0x6c5f=function(_0x54f243,_0x57fa1e){_0x54f243=_0x54f243-0x0;var _0x230631=_0xc5f6[_0x54f243];return _0x230631;};'use strict';var _=require(_0x6c5f('0x0'));var util=require('util');var logger=require(_0x6c5f('0x1'))(_0x6c5f('0x2'));var moment=require(_0x6c5f('0x3'));var BPromise=require(_0x6c5f('0x4'));var rp=require(_0x6c5f('0x5'));var fs=require('fs');var path=require(_0x6c5f('0x6'));var rimraf=require(_0x6c5f('0x7'));var config=require(_0x6c5f('0x8'));var attributes=require(_0x6c5f('0x9'));module[_0x6c5f('0xa')]=function(_0x5e4b70,_0x1bc357){return _0x5e4b70[_0x6c5f('0xb')](_0x6c5f('0xc'),attributes,{'tableName':_0x6c5f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index db9732f..52b90ce 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 _0x082a=['error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x257329,_0x1e86e2){var _0x2255b2=function(_0x319972){while(--_0x319972){_0x257329['push'](_0x257329['shift']());}};_0x2255b2(++_0x1e86e2);}(_0x082a,0x154));var _0xa082=function(_0x398d2e,_0x36b6f9){_0x398d2e=_0x398d2e-0x0;var _0x979247=_0x082a[_0x398d2e];return _0x979247;};'use strict';var _=require('lodash');var util=require(_0xa082('0x0'));var moment=require(_0xa082('0x1'));var BPromise=require(_0xa082('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa082('0x3'));var db=require(_0xa082('0x4'))['db'];var utils=require(_0xa082('0x5'));var logger=require(_0xa082('0x6'))(_0xa082('0x7'));var config=require('../../config/environment');var jayson=require(_0xa082('0x8'));var client=jayson['client'][_0xa082('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41030c,_0x5ae561,_0x31c98d){return new BPromise(function(_0x193550,_0x382b03){return client['request'](_0x41030c,_0x31c98d)[_0xa082('0xa')](function(_0xafc3c1){logger[_0xa082('0xb')](_0xa082('0xc'),_0x5ae561,_0xa082('0xd'));logger['debug'](_0xa082('0xe'),_0x5ae561,_0xa082('0xd'),JSON[_0xa082('0xf')](_0xafc3c1));if(_0xafc3c1['error']){if(_0xafc3c1['error'][_0xa082('0x10')]===0x1f4){logger[_0xa082('0x11')](_0xa082('0xc'),_0x5ae561,_0xafc3c1[_0xa082('0x11')]['message']);return _0x382b03(_0xafc3c1[_0xa082('0x11')][_0xa082('0x12')]);}logger[_0xa082('0x11')](_0xa082('0xc'),_0x5ae561,_0xafc3c1[_0xa082('0x11')][_0xa082('0x12')]);return _0x193550(_0xafc3c1['error'][_0xa082('0x12')]);}else{logger[_0xa082('0xb')]('CloudProvider,\x20%s,\x20%s',_0x5ae561,_0xa082('0xd'));_0x193550(_0xafc3c1[_0xa082('0x13')][_0xa082('0x12')]);}})[_0xa082('0x14')](function(_0x507d9c){logger['error'](_0xa082('0xc'),_0x5ae561,_0x507d9c);_0x382b03(_0x507d9c);});});} \ No newline at end of file +var _0xdec3=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5e7d13,_0x3d1dca){var _0x3ba4cf=function(_0x61347){while(--_0x61347){_0x5e7d13['push'](_0x5e7d13['shift']());}};_0x3ba4cf(++_0x3d1dca);}(_0xdec3,0x89));var _0x3dec=function(_0x484e7d,_0x11359f){_0x484e7d=_0x484e7d-0x0;var _0x725108=_0xdec3[_0x484e7d];return _0x725108;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var moment=require(_0x3dec('0x1'));var BPromise=require(_0x3dec('0x2'));var rs=require(_0x3dec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3dec('0x4'))['db'];var utils=require(_0x3dec('0x5'));var logger=require(_0x3dec('0x6'))(_0x3dec('0x7'));var config=require('../../config/environment');var jayson=require(_0x3dec('0x8'));var client=jayson[_0x3dec('0x9')][_0x3dec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd3208e,_0x1826ab,_0x311a74){return new BPromise(function(_0x207dcf,_0x4b32d2){return client[_0x3dec('0xb')](_0xd3208e,_0x311a74)[_0x3dec('0xc')](function(_0x599552){logger[_0x3dec('0xd')]('CloudProvider,\x20%s,\x20%s',_0x1826ab,'request\x20sent');logger[_0x3dec('0xe')](_0x3dec('0xf'),_0x1826ab,'request\x20sent',JSON[_0x3dec('0x10')](_0x599552));if(_0x599552[_0x3dec('0x11')]){if(_0x599552['error'][_0x3dec('0x12')]===0x1f4){logger[_0x3dec('0x11')](_0x3dec('0x13'),_0x1826ab,_0x599552[_0x3dec('0x11')][_0x3dec('0x14')]);return _0x4b32d2(_0x599552[_0x3dec('0x11')]['message']);}logger['error'](_0x3dec('0x13'),_0x1826ab,_0x599552['error'][_0x3dec('0x14')]);return _0x207dcf(_0x599552[_0x3dec('0x11')]['message']);}else{logger['info'](_0x3dec('0x13'),_0x1826ab,'request\x20sent');_0x207dcf(_0x599552[_0x3dec('0x15')]['message']);}})[_0x3dec('0x16')](function(_0x51cb2c){logger[_0x3dec('0x11')](_0x3dec('0x13'),_0x1826ab,_0x51cb2c);_0x4b32d2(_0x51cb2c);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index eba420d..82cfe52 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 _0x26fb=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xb9a411,_0x5700a5){var _0x293589=function(_0x211e35){while(--_0x211e35){_0xb9a411['push'](_0xb9a411['shift']());}};_0x293589(++_0x5700a5);}(_0x26fb,0x1f4));var _0xb26f=function(_0x59f2fe,_0x372cfb){_0x59f2fe=_0x59f2fe-0x0;var _0x121432=_0x26fb[_0x59f2fe];return _0x121432;};'use strict';var multer=require(_0xb26f('0x0'));var util=require(_0xb26f('0x1'));var path=require(_0xb26f('0x2'));var timeout=require(_0xb26f('0x3'));var express=require(_0xb26f('0x4'));var router=express[_0xb26f('0x5')]();var fs_extra=require(_0xb26f('0x6'));var auth=require(_0xb26f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb26f('0x8'));var controller=require(_0xb26f('0x9'));router[_0xb26f('0xa')]('/',auth[_0xb26f('0xb')](),controller[_0xb26f('0xc')]);router['get'](_0xb26f('0xd'),auth[_0xb26f('0xb')](),controller[_0xb26f('0xe')]);router[_0xb26f('0xf')]('/',auth[_0xb26f('0xb')](),controller['create']);router[_0xb26f('0x10')](_0xb26f('0xd'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x11')]);router[_0xb26f('0x12')](_0xb26f('0xd'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x13')]);module[_0xb26f('0x14')]=router; \ No newline at end of file +var _0x3f1b=['Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','create','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x19ba30,_0x206ee2){var _0x2a861d=function(_0x459c57){while(--_0x459c57){_0x19ba30['push'](_0x19ba30['shift']());}};_0x2a861d(++_0x206ee2);}(_0x3f1b,0xcc));var _0xb3f1=function(_0x3a1b45,_0x3c2205){_0x3a1b45=_0x3a1b45-0x0;var _0xfaeaad=_0x3f1b[_0x3a1b45];return _0xfaeaad;};'use strict';var multer=require(_0xb3f1('0x0'));var util=require(_0xb3f1('0x1'));var path=require(_0xb3f1('0x2'));var timeout=require(_0xb3f1('0x3'));var express=require(_0xb3f1('0x4'));var router=express[_0xb3f1('0x5')]();var fs_extra=require(_0xb3f1('0x6'));var auth=require(_0xb3f1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb3f1('0x8'));var controller=require(_0xb3f1('0x9'));router[_0xb3f1('0xa')]('/',auth['isAuthenticated'](),controller[_0xb3f1('0xb')]);router[_0xb3f1('0xa')](_0xb3f1('0xc'),auth[_0xb3f1('0xd')](),controller[_0xb3f1('0xe')]);router['post']('/',auth[_0xb3f1('0xd')](),controller[_0xb3f1('0xf')]);router['put'](_0xb3f1('0xc'),auth[_0xb3f1('0xd')](),controller['update']);router[_0xb3f1('0x10')](_0xb3f1('0xc'),auth[_0xb3f1('0xd')](),controller[_0xb3f1('0x11')]);module[_0xb3f1('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 7c5f557..a8a6d7c 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 _0xc457=['sequelize','exports','STRING','name'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0xc457,0x190));var _0x7c45=function(_0x372d2b,_0x31a70a){_0x372d2b=_0x372d2b-0x0;var _0x108281=_0xc457[_0x372d2b];return _0x108281;};'use strict';var Sequelize=require(_0x7c45('0x0'));module[_0x7c45('0x1')]={'name':{'type':Sequelize[_0x7c45('0x2')],'unique':_0x7c45('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x7c45('0x2')]},'website':{'type':Sequelize[_0x7c45('0x2')]},'phone':{'type':Sequelize[_0x7c45('0x2')]},'fax':{'type':Sequelize[_0x7c45('0x2')]},'type':{'type':Sequelize[_0x7c45('0x2')]},'street':{'type':Sequelize[_0x7c45('0x2')]},'postalCode':{'type':Sequelize[_0x7c45('0x2')]},'city':{'type':Sequelize[_0x7c45('0x2')]},'country':{'type':Sequelize[_0x7c45('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x7c45('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x7c45('0x2')]},'sCountry':{'type':Sequelize[_0x7c45('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7294=['sequelize','exports','name','STRING'];(function(_0x4bcb87,_0x6507e6){var _0x65a580=function(_0x35f6f4){while(--_0x35f6f4){_0x4bcb87['push'](_0x4bcb87['shift']());}};_0x65a580(++_0x6507e6);}(_0x7294,0x100));var _0x4729=function(_0x2aef94,_0xe67173){_0x2aef94=_0x2aef94-0x0;var _0x2443e6=_0x7294[_0x2aef94];return _0x2443e6;};'use strict';var Sequelize=require(_0x4729('0x0'));module[_0x4729('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4729('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4729('0x3')]},'companyId':{'type':Sequelize[_0x4729('0x3')]},'website':{'type':Sequelize[_0x4729('0x3')]},'phone':{'type':Sequelize[_0x4729('0x3')]},'fax':{'type':Sequelize[_0x4729('0x3')]},'type':{'type':Sequelize[_0x4729('0x3')]},'street':{'type':Sequelize[_0x4729('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4729('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4729('0x3')]},'sStreet':{'type':Sequelize[_0x4729('0x3')]},'sPostalCode':{'type':Sequelize[_0x4729('0x3')]},'sCity':{'type':Sequelize[_0x4729('0x3')]},'sCountry':{'type':Sequelize[_0x4729('0x3')]},'description':{'type':Sequelize[_0x4729('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 7816329..a7790c5 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 _0x125d=['destroy','error','name','send','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','role','user','autoAssociation','addContacts','CmContact','ids','omit','getContacts','order','rimraf','zip-dir','fast-json-patch','bluebird','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource'];(function(_0xaa1350,_0x4a7ab4){var _0x5d5f6b=function(_0x27c7e4){while(--_0x27c7e4){_0xaa1350['push'](_0xaa1350['shift']());}};_0x5d5f6b(++_0x4a7ab4);}(_0x125d,0xca));var _0xd125=function(_0x2ba976,_0x121c42){_0x2ba976=_0x2ba976-0x0;var _0x15a936=_0x125d[_0x2ba976];return _0x15a936;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd125('0x0'));var zipdir=require(_0xd125('0x1'));var jsonpatch=require(_0xd125('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd125('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd125('0x4'));var sox=require('sox');var csv=require(_0xd125('0x5'));var ejs=require(_0xd125('0x6'));var fs=require('fs');var fs_extra=require(_0xd125('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd125('0x8'));var jsforce=require(_0xd125('0x9'));var deskjs=require(_0xd125('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd125('0xb'));var Papa=require(_0xd125('0xc'));var Redis=require(_0xd125('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd125('0xe'));var as=require(_0xd125('0xf'));var hardwareService=require(_0xd125('0x10'));var logger=require(_0xd125('0x11'))('api');var utils=require(_0xd125('0x12'));var config=require(_0xd125('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd125('0x14'))['db'];function respondWithStatusCode(_0x68400f,_0x1a258c){_0x1a258c=_0x1a258c||0xcc;return function(_0x4ae2f6){if(_0x4ae2f6){return _0x68400f[_0xd125('0x15')](_0x1a258c);}return _0x68400f[_0xd125('0x16')](_0x1a258c)[_0xd125('0x17')]();};}function respondWithResult(_0x36a855,_0x1435e1){_0x1435e1=_0x1435e1||0xc8;return function(_0x24019c){if(_0x24019c){return _0x36a855['status'](_0x1435e1)['json'](_0x24019c);}};}function respondWithFilteredResult(_0x32d459,_0x3e9f79){return function(_0x158209){if(_0x158209){var _0x4a2b63=typeof _0x3e9f79['offset']===_0xd125('0x18')&&typeof _0x3e9f79[_0xd125('0x19')]==='undefined';var _0x4ee182=_0x158209[_0xd125('0x1a')];var _0x51d9c7=_0x4a2b63?0x0:_0x3e9f79[_0xd125('0x1b')];var _0x520887=_0x4a2b63?_0x158209[_0xd125('0x1a')]:_0x3e9f79[_0xd125('0x1b')]+_0x3e9f79[_0xd125('0x19')];var _0x5bda33;if(_0x520887>=_0x4ee182){_0x520887=_0x4ee182;_0x5bda33=0xc8;}else{_0x5bda33=0xce;}_0x32d459[_0xd125('0x16')](_0x5bda33);return _0x32d459[_0xd125('0x1c')](_0xd125('0x1d'),_0x51d9c7+'-'+_0x520887+'/'+_0x4ee182)['json'](_0x158209);}return null;};}function patchUpdates(_0x4bad73){return function(_0x2fc501){try{jsonpatch[_0xd125('0x1e')](_0x2fc501,_0x4bad73,!![]);}catch(_0x52c9e4){return BPromise[_0xd125('0x1f')](_0x52c9e4);}return _0x2fc501[_0xd125('0x20')]();};}function saveUpdates(_0x543591,_0xa4e6a0){return function(_0x47bea5){if(_0x47bea5){return _0x47bea5[_0xd125('0x21')](_0x543591)['then'](function(_0x3ccbe3){return _0x3ccbe3;});}return null;};}function removeEntity(_0x1e0b7b,_0x227298){return function(_0x3c8ad3){if(_0x3c8ad3){return _0x3c8ad3['destroy']()[_0xd125('0x22')](function(){var _0xd4053f=_0x3c8ad3[_0xd125('0x23')]({'plain':!![]});var _0x126443=_0xd125('0x24');return db[_0xd125('0x25')][_0xd125('0x26')]({'where':{'type':_0x126443,'resourceId':_0xd4053f['id']}})[_0xd125('0x22')](function(){return _0x3c8ad3;});})[_0xd125('0x22')](function(){_0x1e0b7b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5da227,_0x59cd01){return function(_0x468b9d){if(!_0x468b9d){_0x5da227[_0xd125('0x15')](0x194);}return _0x468b9d;};}function handleError(_0x2ef8cf,_0x31dc9e){_0x31dc9e=_0x31dc9e||0x1f4;return function(_0x924117){logger[_0xd125('0x27')](_0x924117['stack']);if(_0x924117['name']){delete _0x924117[_0xd125('0x28')];}_0x2ef8cf[_0xd125('0x16')](_0x31dc9e)[_0xd125('0x29')](_0x924117);};}exports['index']=function(_0x38f3d9,_0x425b43){var _0x4583c6={},_0xd7b169={},_0x38766a={'count':0x0,'rows':[]};return db[_0xd125('0x2a')][_0xd125('0x2b')]()[_0xd125('0x22')](function(_0x2bcc83){_0xd7b169[_0xd125('0x2c')]=_[_0xd125('0x2d')](_0x2bcc83);_0xd7b169[_0xd125('0x2e')]=_[_0xd125('0x2d')](_0x38f3d9[_0xd125('0x2e')]);_0xd7b169[_0xd125('0x2f')]=_[_0xd125('0x30')](_0xd7b169[_0xd125('0x2c')],_0xd7b169[_0xd125('0x2e')]);_0x4583c6[_0xd125('0x31')]=_['intersection'](_0xd7b169[_0xd125('0x2c')],qs[_0xd125('0x32')](_0x38f3d9[_0xd125('0x2e')]['fields']));_0x4583c6['attributes']=_0x4583c6[_0xd125('0x31')][_0xd125('0x33')]?_0x4583c6['attributes']:_0xd7b169['model'];if(!_0x38f3d9[_0xd125('0x2e')][_0xd125('0x34')](_0xd125('0x35'))){_0x4583c6[_0xd125('0x19')]=qs[_0xd125('0x19')](_0x38f3d9[_0xd125('0x2e')][_0xd125('0x19')]);_0x4583c6[_0xd125('0x1b')]=qs[_0xd125('0x1b')](_0x38f3d9['query'][_0xd125('0x1b')]);}_0x4583c6['order']=qs['sort'](_0x38f3d9['query'][_0xd125('0x36')]);_0x4583c6[_0xd125('0x37')]=qs[_0xd125('0x2f')](_[_0xd125('0x38')](_0x38f3d9['query'],_0xd7b169[_0xd125('0x2f')]),_0x2bcc83);if(_0x38f3d9[_0xd125('0x2e')]['filter']){_0x4583c6[_0xd125('0x37')]=_['merge'](_0x4583c6[_0xd125('0x37')],{'$or':_[_0xd125('0x39')](_0x4583c6[_0xd125('0x31')],function(_0x350713){var _0x56df87={};_0x56df87[_0x350713]={'$like':'%'+_0x38f3d9[_0xd125('0x2e')][_0xd125('0x3a')]+'%'};return _0x56df87;})});}_0x4583c6=_[_0xd125('0x3b')]({},_0x4583c6,_0x38f3d9[_0xd125('0x3c')]);var _0x3f853d={'where':_0x4583c6[_0xd125('0x37')]};return db[_0xd125('0x2a')][_0xd125('0x1a')](_0x3f853d)[_0xd125('0x22')](function(_0x37819a){_0x38766a['count']=_0x37819a;if(_0x38f3d9[_0xd125('0x2e')][_0xd125('0x3d')]){_0x4583c6[_0xd125('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x4583c6);})[_0xd125('0x22')](function(_0x180c97){_0x38766a[_0xd125('0x3f')]=_0x180c97;return _0x38766a;})[_0xd125('0x22')](respondWithFilteredResult(_0x425b43,_0x4583c6))[_0xd125('0x40')](handleError(_0x425b43,null));})['catch'](handleError(_0x425b43,null));};exports[_0xd125('0x41')]=function(_0x2b5bd9,_0x213402){var _0x13259e={'raw':![],'where':{'id':_0x2b5bd9[_0xd125('0x42')]['id']}},_0x50c186={};_0x50c186[_0xd125('0x2c')]=_[_0xd125('0x2d')](db[_0xd125('0x2a')][_0xd125('0x43')]);_0x50c186['query']=_[_0xd125('0x2d')](_0x2b5bd9[_0xd125('0x2e')]);_0x50c186[_0xd125('0x2f')]=_[_0xd125('0x30')](_0x50c186[_0xd125('0x2c')],_0x50c186[_0xd125('0x2e')]);_0x13259e['attributes']=_[_0xd125('0x30')](_0x50c186[_0xd125('0x2c')],qs[_0xd125('0x32')](_0x2b5bd9[_0xd125('0x2e')]['fields']));_0x13259e[_0xd125('0x31')]=_0x13259e[_0xd125('0x31')][_0xd125('0x33')]?_0x13259e[_0xd125('0x31')]:_0x50c186[_0xd125('0x2c')];if(_0x2b5bd9[_0xd125('0x2e')][_0xd125('0x3d')]){_0x13259e[_0xd125('0x3e')]=[{'all':!![]}];}_0x13259e=_[_0xd125('0x3b')]({},_0x13259e,_0x2b5bd9['options']);return db[_0xd125('0x2a')][_0xd125('0x44')](_0x13259e)[_0xd125('0x22')](handleEntityNotFound(_0x213402,null))[_0xd125('0x22')](respondWithResult(_0x213402,null))[_0xd125('0x40')](handleError(_0x213402,null));};exports[_0xd125('0x45')]=function(_0x1c3e32,_0x4ddad5){return db[_0xd125('0x2a')][_0xd125('0x45')](_0x1c3e32[_0xd125('0x46')],{})[_0xd125('0x22')](function(_0x5bd4e){var _0x1aebdf=_0x1c3e32['user']['get']({'plain':!![]});if(!_0x1aebdf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1aebdf[_0xd125('0x47')]===_0xd125('0x48')){var _0x5238eb=_0x5bd4e[_0xd125('0x23')]({'plain':!![]});var _0x242c8f='Companies';return db['UserProfileSection'][_0xd125('0x44')]({'where':{'name':_0x242c8f,'userProfileId':_0x1aebdf['userProfileId']},'raw':!![]})['then'](function(_0x4257aa){if(_0x4257aa&&_0x4257aa[_0xd125('0x49')]===0x0){return db[_0xd125('0x25')][_0xd125('0x45')]({'name':_0x5238eb[_0xd125('0x28')],'resourceId':_0x5238eb['id'],'type':_0x4257aa[_0xd125('0x28')],'sectionId':_0x4257aa['id']},{})[_0xd125('0x22')](function(){return _0x5bd4e;});}else{return _0x5bd4e;}})[_0xd125('0x40')](function(_0x5d03ed){logger[_0xd125('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d03ed);throw _0x5d03ed;});}return _0x5bd4e;})[_0xd125('0x22')](respondWithResult(_0x4ddad5,0xc9))[_0xd125('0x40')](handleError(_0x4ddad5,null));};exports[_0xd125('0x21')]=function(_0x5121a3,_0x371ecb){if(_0x5121a3['body']['id']){delete _0x5121a3[_0xd125('0x46')]['id'];}return db[_0xd125('0x2a')]['find']({'where':{'id':_0x5121a3[_0xd125('0x42')]['id']}})['then'](handleEntityNotFound(_0x371ecb,null))[_0xd125('0x22')](saveUpdates(_0x5121a3[_0xd125('0x46')],null))['then'](respondWithResult(_0x371ecb,null))[_0xd125('0x40')](handleError(_0x371ecb,null));};exports[_0xd125('0x26')]=function(_0x2c33fc,_0x3fb5b3){return db['CmCompany'][_0xd125('0x44')]({'where':{'id':_0x2c33fc[_0xd125('0x42')]['id']}})[_0xd125('0x22')](handleEntityNotFound(_0x3fb5b3,null))[_0xd125('0x22')](removeEntity(_0x3fb5b3,null))['catch'](handleError(_0x3fb5b3,null));};exports[_0xd125('0x2b')]=function(_0x2ab3fb,_0x4aab13){return db['CmCompany'][_0xd125('0x2b')]()[_0xd125('0x22')](respondWithResult(_0x4aab13,null))[_0xd125('0x40')](handleError(_0x4aab13,null));};exports[_0xd125('0x4a')]=function(_0x13419b,_0x569add,_0x519dd0){return db[_0xd125('0x4b')]['find']({'where':{'id':_0x13419b['params']['id']}})[_0xd125('0x22')](handleEntityNotFound(_0x569add,null))[_0xd125('0x22')](function(_0x126c4e){if(_0x126c4e){return _0x126c4e['addContacts'](_0x13419b[_0xd125('0x46')][_0xd125('0x4c')],_[_0xd125('0x4d')](_0x13419b[_0xd125('0x46')],[_0xd125('0x4c'),'id'])||{});}})[_0xd125('0x22')](respondWithResult(_0x569add,null))[_0xd125('0x40')](handleError(_0x569add,null));};exports[_0xd125('0x4e')]=function(_0x4c5962,_0x488ffc,_0x4d739b){var _0x28b40f={};var _0x35d63={};var _0x4af6cf;var _0x1d78e3;return db[_0xd125('0x2a')]['findOne']({'where':{'id':_0x4c5962['params']['id']}})[_0xd125('0x22')](handleEntityNotFound(_0x488ffc,null))[_0xd125('0x22')](function(_0x338d54){if(_0x338d54){_0x4af6cf=_0x338d54;_0x35d63[_0xd125('0x2c')]=_[_0xd125('0x2d')](db[_0xd125('0x4b')][_0xd125('0x43')]);_0x35d63['query']=_[_0xd125('0x2d')](_0x4c5962[_0xd125('0x2e')]);_0x35d63[_0xd125('0x2f')]=_[_0xd125('0x30')](_0x35d63['model'],_0x35d63['query']);_0x28b40f[_0xd125('0x31')]=_[_0xd125('0x30')](_0x35d63['model'],qs[_0xd125('0x32')](_0x4c5962[_0xd125('0x2e')][_0xd125('0x32')]));_0x28b40f['attributes']=_0x28b40f[_0xd125('0x31')]['length']?_0x28b40f[_0xd125('0x31')]:_0x35d63['model'];_0x28b40f[_0xd125('0x4f')]=qs[_0xd125('0x36')](_0x4c5962['query'][_0xd125('0x36')]);_0x28b40f[_0xd125('0x37')]=qs[_0xd125('0x2f')](_[_0xd125('0x38')](_0x4c5962[_0xd125('0x2e')],_0x35d63[_0xd125('0x2f')]));if(_0x4c5962[_0xd125('0x2e')][_0xd125('0x3a')]){_0x28b40f['where']=_[_0xd125('0x3b')](_0x28b40f[_0xd125('0x37')],{'$or':_['map'](_0x28b40f[_0xd125('0x31')],function(_0x2c3992){var _0x4c124a={};_0x4c124a[_0x2c3992]={'$like':'%'+_0x4c5962['query'][_0xd125('0x3a')]+'%'};return _0x4c124a;})});}_0x28b40f=_['merge']({},_0x28b40f,_0x4c5962[_0xd125('0x3c')]);return _0x4af6cf[_0xd125('0x4e')](_0x28b40f);}})['then'](function(_0x18bac3){if(_0x18bac3){_0x1d78e3=_0x18bac3[_0xd125('0x33')];if(!_0x4c5962[_0xd125('0x2e')][_0xd125('0x34')](_0xd125('0x35'))){_0x28b40f[_0xd125('0x19')]=qs[_0xd125('0x19')](_0x4c5962[_0xd125('0x2e')][_0xd125('0x19')]);_0x28b40f[_0xd125('0x1b')]=qs[_0xd125('0x1b')](_0x4c5962['query'][_0xd125('0x1b')]);}return _0x4af6cf['getContacts'](_0x28b40f);}})['then'](function(_0x54c3fa){if(_0x54c3fa){return _0x54c3fa?{'count':_0x1d78e3,'rows':_0x54c3fa}:null;}})['then'](respondWithResult(_0x488ffc,null))[_0xd125('0x40')](handleError(_0x488ffc,null));}; \ No newline at end of file +var _0x6ac4=['UserProfileResource','then','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','omit','findOne','getContacts','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','Companies'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x6ac4,0xdd));var _0x46ac=function(_0x56ec07,_0x56a55f){_0x56ec07=_0x56ec07-0x0;var _0x3ce6f7=_0x6ac4[_0x56ec07];return _0x3ce6f7;};'use strict';var emlformat=require(_0x46ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x46ac('0x1'));var jsonpatch=require(_0x46ac('0x2'));var rp=require(_0x46ac('0x3'));var moment=require(_0x46ac('0x4'));var BPromise=require(_0x46ac('0x5'));var Mustache=require(_0x46ac('0x6'));var util=require('util');var path=require(_0x46ac('0x7'));var sox=require(_0x46ac('0x8'));var csv=require('to-csv');var ejs=require(_0x46ac('0x9'));var fs=require('fs');var fs_extra=require(_0x46ac('0xa'));var _=require('lodash');var squel=require(_0x46ac('0xb'));var crypto=require(_0x46ac('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x46ac('0xd'));var toCsv=require(_0x46ac('0xe'));var querystring=require(_0x46ac('0xf'));var Papa=require(_0x46ac('0x10'));var Redis=require(_0x46ac('0x11'));var authService=require(_0x46ac('0x12'));var qs=require(_0x46ac('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46ac('0x14'));var logger=require(_0x46ac('0x15'))(_0x46ac('0x16'));var utils=require(_0x46ac('0x17'));var config=require(_0x46ac('0x18'));var licenseUtil=require(_0x46ac('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49d9fd,_0x129382){_0x129382=_0x129382||0xcc;return function(_0x375928){if(_0x375928){return _0x49d9fd[_0x46ac('0x1a')](_0x129382);}return _0x49d9fd[_0x46ac('0x1b')](_0x129382)[_0x46ac('0x1c')]();};}function respondWithResult(_0x31697b,_0x445e8){_0x445e8=_0x445e8||0xc8;return function(_0x788dcb){if(_0x788dcb){return _0x31697b[_0x46ac('0x1b')](_0x445e8)['json'](_0x788dcb);}};}function respondWithFilteredResult(_0x104735,_0x5ad1dc){return function(_0x4d878e){if(_0x4d878e){var _0x4c1043=typeof _0x5ad1dc[_0x46ac('0x1d')]===_0x46ac('0x1e')&&typeof _0x5ad1dc['limit']==='undefined';var _0x29f233=_0x4d878e[_0x46ac('0x1f')];var _0x1262d0=_0x4c1043?0x0:_0x5ad1dc['offset'];var _0x272ac9=_0x4c1043?_0x4d878e['count']:_0x5ad1dc[_0x46ac('0x1d')]+_0x5ad1dc[_0x46ac('0x20')];var _0x3471bd;if(_0x272ac9>=_0x29f233){_0x272ac9=_0x29f233;_0x3471bd=0xc8;}else{_0x3471bd=0xce;}_0x104735[_0x46ac('0x1b')](_0x3471bd);return _0x104735['set'](_0x46ac('0x21'),_0x1262d0+'-'+_0x272ac9+'/'+_0x29f233)['json'](_0x4d878e);}return null;};}function patchUpdates(_0x218565){return function(_0x1d7e01){try{jsonpatch[_0x46ac('0x22')](_0x1d7e01,_0x218565,!![]);}catch(_0xd1c33b){return BPromise['reject'](_0xd1c33b);}return _0x1d7e01[_0x46ac('0x23')]();};}function saveUpdates(_0x572f2a,_0x21bccd){return function(_0x2ee750){if(_0x2ee750){return _0x2ee750[_0x46ac('0x24')](_0x572f2a)['then'](function(_0x440329){return _0x440329;});}return null;};}function removeEntity(_0x55aaff,_0x21ec86){return function(_0x476c19){if(_0x476c19){return _0x476c19[_0x46ac('0x25')]()['then'](function(){var _0x457ca5=_0x476c19[_0x46ac('0x26')]({'plain':!![]});var _0x344d15=_0x46ac('0x27');return db[_0x46ac('0x28')][_0x46ac('0x25')]({'where':{'type':_0x344d15,'resourceId':_0x457ca5['id']}})[_0x46ac('0x29')](function(){return _0x476c19;});})[_0x46ac('0x29')](function(){_0x55aaff[_0x46ac('0x1b')](0xcc)[_0x46ac('0x1c')]();});}};}function handleEntityNotFound(_0x5c33ab,_0x22c427){return function(_0x311692){if(!_0x311692){_0x5c33ab['sendStatus'](0x194);}return _0x311692;};}function handleError(_0x461cdf,_0x11dd0f){_0x11dd0f=_0x11dd0f||0x1f4;return function(_0x2ca389){logger[_0x46ac('0x2a')](_0x2ca389['stack']);if(_0x2ca389[_0x46ac('0x2b')]){delete _0x2ca389[_0x46ac('0x2b')];}_0x461cdf['status'](_0x11dd0f)[_0x46ac('0x2c')](_0x2ca389);};}exports[_0x46ac('0x2d')]=function(_0x171319,_0x3b4e5b){var _0x2fbdf4={},_0x9aac20={},_0x54c996={'count':0x0,'rows':[]};return db[_0x46ac('0x2e')][_0x46ac('0x2f')]()['then'](function(_0x7f7080){_0x9aac20[_0x46ac('0x30')]=_[_0x46ac('0x31')](_0x7f7080);_0x9aac20[_0x46ac('0x32')]=_[_0x46ac('0x31')](_0x171319['query']);_0x9aac20[_0x46ac('0x33')]=_[_0x46ac('0x34')](_0x9aac20[_0x46ac('0x30')],_0x9aac20[_0x46ac('0x32')]);_0x2fbdf4[_0x46ac('0x35')]=_[_0x46ac('0x34')](_0x9aac20[_0x46ac('0x30')],qs[_0x46ac('0x36')](_0x171319['query'][_0x46ac('0x36')]));_0x2fbdf4[_0x46ac('0x35')]=_0x2fbdf4['attributes'][_0x46ac('0x37')]?_0x2fbdf4[_0x46ac('0x35')]:_0x9aac20[_0x46ac('0x30')];if(!_0x171319[_0x46ac('0x32')]['hasOwnProperty'](_0x46ac('0x38'))){_0x2fbdf4['limit']=qs[_0x46ac('0x20')](_0x171319[_0x46ac('0x32')]['limit']);_0x2fbdf4[_0x46ac('0x1d')]=qs[_0x46ac('0x1d')](_0x171319['query'][_0x46ac('0x1d')]);}_0x2fbdf4['order']=qs[_0x46ac('0x39')](_0x171319[_0x46ac('0x32')][_0x46ac('0x39')]);_0x2fbdf4[_0x46ac('0x3a')]=qs[_0x46ac('0x33')](_[_0x46ac('0x3b')](_0x171319[_0x46ac('0x32')],_0x9aac20['filters']),_0x7f7080);if(_0x171319[_0x46ac('0x32')][_0x46ac('0x3c')]){_0x2fbdf4['where']=_[_0x46ac('0x3d')](_0x2fbdf4['where'],{'$or':_[_0x46ac('0x3e')](_0x2fbdf4[_0x46ac('0x35')],function(_0x53e7b6){var _0xe08e21={};_0xe08e21[_0x53e7b6]={'$like':'%'+_0x171319[_0x46ac('0x32')][_0x46ac('0x3c')]+'%'};return _0xe08e21;})});}_0x2fbdf4=_[_0x46ac('0x3d')]({},_0x2fbdf4,_0x171319[_0x46ac('0x3f')]);var _0x524659={'where':_0x2fbdf4[_0x46ac('0x3a')]};return db[_0x46ac('0x2e')][_0x46ac('0x1f')](_0x524659)[_0x46ac('0x29')](function(_0x4ba892){_0x54c996[_0x46ac('0x1f')]=_0x4ba892;if(_0x171319['query']['includeAll']){_0x2fbdf4[_0x46ac('0x40')]=[{'all':!![]}];}return db[_0x46ac('0x2e')][_0x46ac('0x41')](_0x2fbdf4);})['then'](function(_0x1f6f63){_0x54c996[_0x46ac('0x42')]=_0x1f6f63;return _0x54c996;})['then'](respondWithFilteredResult(_0x3b4e5b,_0x2fbdf4))[_0x46ac('0x43')](handleError(_0x3b4e5b,null));})[_0x46ac('0x43')](handleError(_0x3b4e5b,null));};exports[_0x46ac('0x44')]=function(_0x426aa6,_0x8a9373){var _0x1f38a1={'raw':![],'where':{'id':_0x426aa6['params']['id']}},_0x31a3b9={};_0x31a3b9[_0x46ac('0x30')]=_[_0x46ac('0x31')](db[_0x46ac('0x2e')][_0x46ac('0x45')]);_0x31a3b9[_0x46ac('0x32')]=_[_0x46ac('0x31')](_0x426aa6['query']);_0x31a3b9[_0x46ac('0x33')]=_[_0x46ac('0x34')](_0x31a3b9[_0x46ac('0x30')],_0x31a3b9[_0x46ac('0x32')]);_0x1f38a1[_0x46ac('0x35')]=_[_0x46ac('0x34')](_0x31a3b9[_0x46ac('0x30')],qs[_0x46ac('0x36')](_0x426aa6[_0x46ac('0x32')][_0x46ac('0x36')]));_0x1f38a1[_0x46ac('0x35')]=_0x1f38a1[_0x46ac('0x35')][_0x46ac('0x37')]?_0x1f38a1[_0x46ac('0x35')]:_0x31a3b9[_0x46ac('0x30')];if(_0x426aa6['query']['includeAll']){_0x1f38a1[_0x46ac('0x40')]=[{'all':!![]}];}_0x1f38a1=_[_0x46ac('0x3d')]({},_0x1f38a1,_0x426aa6[_0x46ac('0x3f')]);return db[_0x46ac('0x2e')][_0x46ac('0x46')](_0x1f38a1)[_0x46ac('0x29')](handleEntityNotFound(_0x8a9373,null))['then'](respondWithResult(_0x8a9373,null))[_0x46ac('0x43')](handleError(_0x8a9373,null));};exports[_0x46ac('0x47')]=function(_0x2f5f97,_0x24f865){return db[_0x46ac('0x2e')][_0x46ac('0x47')](_0x2f5f97[_0x46ac('0x48')],{})['then'](function(_0x2ded10){var _0x29eaa7=_0x2f5f97['user'][_0x46ac('0x26')]({'plain':!![]});if(!_0x29eaa7)throw new Error(_0x46ac('0x49'));if(_0x29eaa7[_0x46ac('0x4a')]===_0x46ac('0x4b')){var _0x455224=_0x2ded10[_0x46ac('0x26')]({'plain':!![]});var _0x37e0c1=_0x46ac('0x27');return db[_0x46ac('0x4c')][_0x46ac('0x46')]({'where':{'name':_0x37e0c1,'userProfileId':_0x29eaa7[_0x46ac('0x4d')]},'raw':!![]})['then'](function(_0x2e7ea8){if(_0x2e7ea8&&_0x2e7ea8['autoAssociation']===0x0){return db[_0x46ac('0x28')][_0x46ac('0x47')]({'name':_0x455224['name'],'resourceId':_0x455224['id'],'type':_0x2e7ea8[_0x46ac('0x2b')],'sectionId':_0x2e7ea8['id']},{})[_0x46ac('0x29')](function(){return _0x2ded10;});}else{return _0x2ded10;}})[_0x46ac('0x43')](function(_0x28c35f){logger[_0x46ac('0x2a')](_0x46ac('0x4e'),_0x28c35f);throw _0x28c35f;});}return _0x2ded10;})[_0x46ac('0x29')](respondWithResult(_0x24f865,0xc9))[_0x46ac('0x43')](handleError(_0x24f865,null));};exports[_0x46ac('0x24')]=function(_0x1bf207,_0x1d09a0){if(_0x1bf207[_0x46ac('0x48')]['id']){delete _0x1bf207[_0x46ac('0x48')]['id'];}return db['CmCompany'][_0x46ac('0x46')]({'where':{'id':_0x1bf207[_0x46ac('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d09a0,null))[_0x46ac('0x29')](saveUpdates(_0x1bf207[_0x46ac('0x48')],null))[_0x46ac('0x29')](respondWithResult(_0x1d09a0,null))[_0x46ac('0x43')](handleError(_0x1d09a0,null));};exports[_0x46ac('0x25')]=function(_0x369ceb,_0x423d55){return db['CmCompany'][_0x46ac('0x46')]({'where':{'id':_0x369ceb[_0x46ac('0x4f')]['id']}})[_0x46ac('0x29')](handleEntityNotFound(_0x423d55,null))[_0x46ac('0x29')](removeEntity(_0x423d55,null))[_0x46ac('0x43')](handleError(_0x423d55,null));};exports[_0x46ac('0x2f')]=function(_0x535e0c,_0x3c9ff3){return db[_0x46ac('0x2e')][_0x46ac('0x2f')]()[_0x46ac('0x29')](respondWithResult(_0x3c9ff3,null))[_0x46ac('0x43')](handleError(_0x3c9ff3,null));};exports['addContacts']=function(_0x25875d,_0x5a2dfc,_0x40fd6b){return db[_0x46ac('0x50')][_0x46ac('0x46')]({'where':{'id':_0x25875d['params']['id']}})['then'](handleEntityNotFound(_0x5a2dfc,null))[_0x46ac('0x29')](function(_0x4cd5ee){if(_0x4cd5ee){return _0x4cd5ee[_0x46ac('0x51')](_0x25875d['body'][_0x46ac('0x52')],_[_0x46ac('0x53')](_0x25875d[_0x46ac('0x48')],[_0x46ac('0x52'),'id'])||{});}})[_0x46ac('0x29')](respondWithResult(_0x5a2dfc,null))[_0x46ac('0x43')](handleError(_0x5a2dfc,null));};exports['getContacts']=function(_0x485c75,_0x184835,_0x825003){var _0x10372c={};var _0x3c49ed={};var _0x53bb68;var _0x5523e8;return db['CmCompany'][_0x46ac('0x54')]({'where':{'id':_0x485c75[_0x46ac('0x4f')]['id']}})[_0x46ac('0x29')](handleEntityNotFound(_0x184835,null))[_0x46ac('0x29')](function(_0x153ed2){if(_0x153ed2){_0x53bb68=_0x153ed2;_0x3c49ed[_0x46ac('0x30')]=_['keys'](db[_0x46ac('0x50')][_0x46ac('0x45')]);_0x3c49ed[_0x46ac('0x32')]=_[_0x46ac('0x31')](_0x485c75[_0x46ac('0x32')]);_0x3c49ed[_0x46ac('0x33')]=_[_0x46ac('0x34')](_0x3c49ed['model'],_0x3c49ed[_0x46ac('0x32')]);_0x10372c[_0x46ac('0x35')]=_[_0x46ac('0x34')](_0x3c49ed[_0x46ac('0x30')],qs['fields'](_0x485c75[_0x46ac('0x32')][_0x46ac('0x36')]));_0x10372c[_0x46ac('0x35')]=_0x10372c['attributes'][_0x46ac('0x37')]?_0x10372c[_0x46ac('0x35')]:_0x3c49ed[_0x46ac('0x30')];_0x10372c['order']=qs[_0x46ac('0x39')](_0x485c75[_0x46ac('0x32')][_0x46ac('0x39')]);_0x10372c[_0x46ac('0x3a')]=qs['filters'](_['pick'](_0x485c75[_0x46ac('0x32')],_0x3c49ed[_0x46ac('0x33')]));if(_0x485c75['query'][_0x46ac('0x3c')]){_0x10372c[_0x46ac('0x3a')]=_['merge'](_0x10372c['where'],{'$or':_[_0x46ac('0x3e')](_0x10372c[_0x46ac('0x35')],function(_0x213af8){var _0x20c91a={};_0x20c91a[_0x213af8]={'$like':'%'+_0x485c75[_0x46ac('0x32')][_0x46ac('0x3c')]+'%'};return _0x20c91a;})});}_0x10372c=_[_0x46ac('0x3d')]({},_0x10372c,_0x485c75[_0x46ac('0x3f')]);return _0x53bb68[_0x46ac('0x55')](_0x10372c);}})['then'](function(_0x4ac47a){if(_0x4ac47a){_0x5523e8=_0x4ac47a['length'];if(!_0x485c75[_0x46ac('0x32')][_0x46ac('0x56')](_0x46ac('0x38'))){_0x10372c[_0x46ac('0x20')]=qs[_0x46ac('0x20')](_0x485c75[_0x46ac('0x32')]['limit']);_0x10372c[_0x46ac('0x1d')]=qs[_0x46ac('0x1d')](_0x485c75[_0x46ac('0x32')][_0x46ac('0x1d')]);}return _0x53bb68[_0x46ac('0x55')](_0x10372c);}})[_0x46ac('0x29')](function(_0x4373b1){if(_0x4373b1){return _0x4373b1?{'count':_0x5523e8,'rows':_0x4373b1}:null;}})[_0x46ac('0x29')](respondWithResult(_0x184835,null))[_0x46ac('0x43')](handleError(_0x184835,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 36b2c04..b543b81 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 _0x3305=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_companies','lodash'];(function(_0x12b6e2,_0x1bb255){var _0x187187=function(_0x285ec4){while(--_0x285ec4){_0x12b6e2['push'](_0x12b6e2['shift']());}};_0x187187(++_0x1bb255);}(_0x3305,0xe3));var _0x5330=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3305[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5330('0x0'));var util=require(_0x5330('0x1'));var logger=require(_0x5330('0x2'))('api');var moment=require(_0x5330('0x3'));var BPromise=require(_0x5330('0x4'));var rp=require(_0x5330('0x5'));var fs=require('fs');var path=require(_0x5330('0x6'));var rimraf=require(_0x5330('0x7'));var config=require(_0x5330('0x8'));var attributes=require('./cmCompany.attributes');module[_0x5330('0x9')]=function(_0x22919c,_0x1960c5){return _0x22919c[_0x5330('0xa')]('CmCompany',attributes,{'tableName':_0x5330('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bab=['../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x269df0,_0x1b1c5c){var _0x4f2674=function(_0x3b0b71){while(--_0x3b0b71){_0x269df0['push'](_0x269df0['shift']());}};_0x4f2674(++_0x1b1c5c);}(_0x8bab,0xd6));var _0xb8ba=function(_0x333c11,_0x49e032){_0x333c11=_0x333c11-0x0;var _0x17df42=_0x8bab[_0x333c11];return _0x17df42;};'use strict';var _=require(_0xb8ba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb8ba('0x1'));var moment=require(_0xb8ba('0x2'));var BPromise=require(_0xb8ba('0x3'));var rp=require(_0xb8ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8ba('0x5'));var config=require(_0xb8ba('0x6'));var attributes=require(_0xb8ba('0x7'));module[_0xb8ba('0x8')]=function(_0x5a26e6,_0x7af9ef){return _0x5a26e6['define'](_0xb8ba('0x9'),attributes,{'tableName':_0xb8ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 7f20530..839b71f 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 _0x8973=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info'];(function(_0x3a2995,_0x544720){var _0x3b04bf=function(_0x11a7d4){while(--_0x11a7d4){_0x3a2995['push'](_0x3a2995['shift']());}};_0x3b04bf(++_0x544720);}(_0x8973,0x13b));var _0x3897=function(_0x5ce1e5,_0x246b56){_0x5ce1e5=_0x5ce1e5-0x0;var _0x5ce33c=_0x8973[_0x5ce1e5];return _0x5ce33c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3897('0x0'));var rs=require(_0x3897('0x1'));var fs=require('fs');var Redis=require(_0x3897('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3897('0x3'));var logger=require(_0x3897('0x4'))(_0x3897('0x5'));var config=require(_0x3897('0x6'));var jayson=require(_0x3897('0x7'));var client=jayson[_0x3897('0x8')][_0x3897('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41dfd7,_0x1b78af,_0x41cc25){return new BPromise(function(_0x4afd80,_0x33f401){return client[_0x3897('0xa')](_0x41dfd7,_0x41cc25)[_0x3897('0xb')](function(_0x510f7f){logger['info']('CmCompany,\x20%s,\x20%s',_0x1b78af,'request\x20sent');logger[_0x3897('0xc')](_0x3897('0xd'),_0x1b78af,_0x3897('0xe'),JSON[_0x3897('0xf')](_0x510f7f));if(_0x510f7f[_0x3897('0x10')]){if(_0x510f7f['error'][_0x3897('0x11')]===0x1f4){logger['error'](_0x3897('0x12'),_0x1b78af,_0x510f7f[_0x3897('0x10')]['message']);return _0x33f401(_0x510f7f[_0x3897('0x10')][_0x3897('0x13')]);}logger['error'](_0x3897('0x12'),_0x1b78af,_0x510f7f['error'][_0x3897('0x13')]);return _0x4afd80(_0x510f7f[_0x3897('0x10')][_0x3897('0x13')]);}else{logger[_0x3897('0x14')](_0x3897('0x12'),_0x1b78af,'request\x20sent');_0x4afd80(_0x510f7f['result'][_0x3897('0x13')]);}})['catch'](function(_0x53d787){logger['error']('CmCompany,\x20%s,\x20%s',_0x1b78af,_0x53d787);_0x33f401(_0x53d787);});});} \ No newline at end of file +var _0x5b70=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x69a35d,_0x9607af){var _0xcf283f=function(_0x415690){while(--_0x415690){_0x69a35d['push'](_0x69a35d['shift']());}};_0xcf283f(++_0x9607af);}(_0x5b70,0x7b));var _0x05b7=function(_0x11f03e,_0x18eeba){_0x11f03e=_0x11f03e-0x0;var _0x10e59b=_0x5b70[_0x11f03e];return _0x10e59b;};'use strict';var _=require('lodash');var util=require(_0x05b7('0x0'));var moment=require(_0x05b7('0x1'));var BPromise=require(_0x05b7('0x2'));var rs=require(_0x05b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05b7('0x4'))['db'];var utils=require(_0x05b7('0x5'));var logger=require('../../config/logger')(_0x05b7('0x6'));var config=require(_0x05b7('0x7'));var jayson=require(_0x05b7('0x8'));var client=jayson['client'][_0x05b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f84cf,_0x436b5d,_0xf63de3){return new BPromise(function(_0x567165,_0x28c974){return client['request'](_0x3f84cf,_0xf63de3)[_0x05b7('0xa')](function(_0x4578f9){logger['info'](_0x05b7('0xb'),_0x436b5d,'request\x20sent');logger[_0x05b7('0xc')](_0x05b7('0xd'),_0x436b5d,_0x05b7('0xe'),JSON[_0x05b7('0xf')](_0x4578f9));if(_0x4578f9[_0x05b7('0x10')]){if(_0x4578f9['error'][_0x05b7('0x11')]===0x1f4){logger[_0x05b7('0x10')](_0x05b7('0xb'),_0x436b5d,_0x4578f9[_0x05b7('0x10')][_0x05b7('0x12')]);return _0x28c974(_0x4578f9[_0x05b7('0x10')]['message']);}logger[_0x05b7('0x10')]('CmCompany,\x20%s,\x20%s',_0x436b5d,_0x4578f9[_0x05b7('0x10')]['message']);return _0x567165(_0x4578f9['error']['message']);}else{logger['info'](_0x05b7('0xb'),_0x436b5d,_0x05b7('0xe'));_0x567165(_0x4578f9[_0x05b7('0x13')][_0x05b7('0x12')]);}})[_0x05b7('0x14')](function(_0xe98b77){logger['error'](_0x05b7('0xb'),_0x436b5d,_0xe98b77);_0x28c974(_0xe98b77);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index e8c9f30..b70673a 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 _0xa404=['/:id','show','/:id/contacts','create','post','addContacts','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./cmCompany.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x575829,_0x4da0aa){var _0x590322=function(_0x88d5dc){while(--_0x88d5dc){_0x575829['push'](_0x575829['shift']());}};_0x590322(++_0x4da0aa);}(_0xa404,0x1c2));var _0x4a40=function(_0x1e5a51,_0x1e8f22){_0x1e5a51=_0x1e5a51-0x0;var _0x3d9f79=_0xa404[_0x1e5a51];return _0x3d9f79;};'use strict';var multer=require(_0x4a40('0x0'));var util=require('util');var path=require(_0x4a40('0x1'));var timeout=require(_0x4a40('0x2'));var express=require(_0x4a40('0x3'));var router=express['Router']();var fs_extra=require(_0x4a40('0x4'));var auth=require(_0x4a40('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4a40('0x6'));router[_0x4a40('0x7')]('/',auth['isAuthenticated'](),controller[_0x4a40('0x8')]);router['get'](_0x4a40('0x9'),auth[_0x4a40('0xa')](),controller[_0x4a40('0xb')]);router[_0x4a40('0x7')](_0x4a40('0xc'),auth[_0x4a40('0xa')](),controller[_0x4a40('0xd')]);router[_0x4a40('0x7')](_0x4a40('0xe'),auth['isAuthenticated'](),controller['getContacts']);router['post']('/',auth[_0x4a40('0xa')](),controller[_0x4a40('0xf')]);router[_0x4a40('0x10')]('/:id/contacts',auth[_0x4a40('0xa')](),controller[_0x4a40('0x11')]);router[_0x4a40('0x12')](_0x4a40('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4a40('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4a40('0x14')]);module[_0x4a40('0x15')]=router; \ No newline at end of file +var _0x29dd=['/:id/contacts','getContacts','post','create','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x1cd916,_0x333f5c){var _0x1ff07a=function(_0x340c8e){while(--_0x340c8e){_0x1cd916['push'](_0x1cd916['shift']());}};_0x1ff07a(++_0x333f5c);}(_0x29dd,0x1d3));var _0xd29d=function(_0x1673b2,_0x18cdb5){_0x1673b2=_0x1673b2-0x0;var _0x467359=_0x29dd[_0x1673b2];return _0x467359;};'use strict';var multer=require('multer');var util=require(_0xd29d('0x0'));var path=require(_0xd29d('0x1'));var timeout=require('connect-timeout');var express=require(_0xd29d('0x2'));var router=express[_0xd29d('0x3')]();var fs_extra=require(_0xd29d('0x4'));var auth=require(_0xd29d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd29d('0x6'));var controller=require(_0xd29d('0x7'));router[_0xd29d('0x8')]('/',auth[_0xd29d('0x9')](),controller['index']);router[_0xd29d('0x8')](_0xd29d('0xa'),auth[_0xd29d('0x9')](),controller['describe']);router[_0xd29d('0x8')](_0xd29d('0xb'),auth[_0xd29d('0x9')](),controller[_0xd29d('0xc')]);router['get'](_0xd29d('0xd'),auth[_0xd29d('0x9')](),controller[_0xd29d('0xe')]);router[_0xd29d('0xf')]('/',auth['isAuthenticated'](),controller[_0xd29d('0x10')]);router[_0xd29d('0xf')](_0xd29d('0xd'),auth['isAuthenticated'](),controller['addContacts']);router[_0xd29d('0x11')](_0xd29d('0xb'),auth[_0xd29d('0x9')](),controller['update']);router[_0xd29d('0x12')](_0xd29d('0xb'),auth[_0xd29d('0x9')](),controller[_0xd29d('0x13')]);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 ecc9a9f..aac183e 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 _0xf10d=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x5a4526,_0x521684){var _0x4d5f94=function(_0x240bd6){while(--_0x240bd6){_0x5a4526['push'](_0x5a4526['shift']());}};_0x4d5f94(++_0x521684);}(_0xf10d,0xf8));var _0xdf10=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xf10d[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require(_0xdf10('0x0'));var Sequelize=require(_0xdf10('0x1'));module[_0xdf10('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xdf10('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdf10('0x3')]},'country':{'type':Sequelize[_0xdf10('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdf10('0x4')]},'phone':{'type':Sequelize[_0xdf10('0x3')]},'mobile':{'type':Sequelize[_0xdf10('0x3')]},'fax':{'type':Sequelize[_0xdf10('0x3')]},'email':{'type':Sequelize[_0xdf10('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xdf10('0x3')]},'fb_data':{'type':Sequelize[_0xdf10('0x3')]},'twitter':{'type':Sequelize[_0xdf10('0x3')]},'skype':{'type':Sequelize[_0xdf10('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xdf10('0x3')]},'telegram':{'type':Sequelize[_0xdf10('0x3')]},'UserId':{'type':Sequelize[_0xdf10('0x5')]},'priority':{'type':Sequelize[_0xdf10('0x5')](0x2)[_0xdf10('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xdf10('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x8bfb=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x429793,_0x37b8a4){var _0x9ae422=function(_0x3ec307){while(--_0x3ec307){_0x429793['push'](_0x429793['shift']());}};_0x9ae422(++_0x37b8a4);}(_0x8bfb,0x90));var _0xb8bf=function(_0x4a2176,_0x176e35){_0x4a2176=_0x4a2176-0x0;var _0x29e2c7=_0x8bfb[_0x4a2176];return _0x29e2c7;};'use strict';var _=require('lodash');var Sequelize=require(_0xb8bf('0x0'));module[_0xb8bf('0x1')]={'firstName':{'type':Sequelize[_0xb8bf('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb8bf('0x2')]},'street':{'type':Sequelize[_0xb8bf('0x2')]},'postalCode':{'type':Sequelize[_0xb8bf('0x2')]},'city':{'type':Sequelize[_0xb8bf('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xb8bf('0x2')]},'description':{'type':Sequelize[_0xb8bf('0x3')]},'phone':{'type':Sequelize[_0xb8bf('0x2')]},'mobile':{'type':Sequelize[_0xb8bf('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb8bf('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xb8bf('0x2')]},'fb_data':{'type':Sequelize[_0xb8bf('0x2')]},'twitter':{'type':Sequelize[_0xb8bf('0x2')]},'skype':{'type':Sequelize[_0xb8bf('0x2')]},'teams':{'type':Sequelize[_0xb8bf('0x2')]},'viber':{'type':Sequelize[_0xb8bf('0x2')]},'line':{'type':Sequelize[_0xb8bf('0x2')]},'wechat':{'type':Sequelize[_0xb8bf('0x2')]},'telegram':{'type':Sequelize[_0xb8bf('0x2')]},'UserId':{'type':Sequelize[_0xb8bf('0x4')]},'priority':{'type':Sequelize[_0xb8bf('0x4')](0x2)[_0xb8bf('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb8bf('0x6')],'defaultValue':Sequelize[_0xb8bf('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 3cc1ebb..969ede9 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 _0x1298=['tags','columnName','displayName','analytics','findAll','alias','custom','values','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','bulkCreate','each','duplicates','findOrCreate','spread','show','color','isNil','$and','omit','cf_%d','pickBy','format','table','setFields','id\x20=\x20?','phone','getTags','Tag','intersection','pick','options','nolimit','setTags','ids','getHoppers','CmHopper','rawAttributes','includeAll','include','rows','getHopperHistories','ContactId','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','pid','upload','createReadStream','meta','import','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','voice','channel','Invalid\x20channel','toLowerCase','range','uniqueid','source','destination','callerid','starttime','endtime','userSecondDisposition','UserId','fullname','createdAt','VoiceCallReport','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','deviceModel','ratingMessage','ratingType','ratingValue','referer','substatus','openchannel','externalUrl','threadId','Interaction','Owner','sortBy','path','lodash','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','limit','undefined','offset','count','then','destroy','end','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','model','query','attributes','fields','sort','filters','select','field','tools_tags','from','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','value','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','datetime','castTo','buildExpression','type','text','map','hasOwnProperty','filter','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','c.id','order','DESC','t.id\x20IN\x20?','resolve','user','role','agent','some','isEmpty','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.fax','c.email','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','catch','find','params'];(function(_0x3ecc51,_0x43fc22){var _0x451fd3=function(_0x1bf879){while(--_0x1bf879){_0x3ecc51['push'](_0x3ecc51['shift']());}};_0x451fd3(++_0x43fc22);}(_0x1298,0x1a0));var _0x8129=function(_0x42e95f,_0x49f2a0){_0x42e95f=_0x42e95f-0x0;var _0x5edc38=_0x1298[_0x42e95f];return _0x5edc38;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x8129('0x0'));var fs=require('fs');var _=require(_0x8129('0x1'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x8129('0x2'));var qs=require('../../components/parsers/qs');var as=require(_0x8129('0x3'));var logger=require(_0x8129('0x4'))(_0x8129('0x5'));var config=require(_0x8129('0x6'));var db=require(_0x8129('0x7'))['db'];config[_0x8129('0x8')]=_[_0x8129('0x9')](config[_0x8129('0x8')],{'host':_0x8129('0xa'),'port':0x18eb});var socket=require(_0x8129('0xb'))(new Redis(config[_0x8129('0x8')]));require(_0x8129('0xc'))[_0x8129('0xd')](socket);function respondWithResult(_0xee251d,_0x5f2f2b){_0x5f2f2b=_0x5f2f2b||0xc8;return function(_0x1b0cc2){if(_0x1b0cc2){return _0xee251d[_0x8129('0xe')](_0x5f2f2b)[_0x8129('0xf')](_0x1b0cc2);}};}function respondWithFilteredResult(_0x4a1ba5,_0x2d921c){return function(_0x476e3f){if(_0x476e3f){var _0x502439=typeof _0x2d921c['offset']==='undefined'&&typeof _0x2d921c[_0x8129('0x10')]===_0x8129('0x11');var _0x3e079b=_0x476e3f['count'];var _0x17d543=_0x502439?0x0:_0x2d921c[_0x8129('0x12')];var _0x579c3e=_0x502439?_0x476e3f[_0x8129('0x13')]:_0x2d921c[_0x8129('0x12')]+_0x2d921c[_0x8129('0x10')];var _0x171b9c;if(_0x579c3e>=_0x3e079b){_0x579c3e=_0x3e079b;_0x171b9c=0xc8;}else{_0x171b9c=0xce;}_0x4a1ba5['status'](_0x171b9c);return _0x4a1ba5['set']('Content-Range',_0x17d543+'-'+_0x579c3e+'/'+_0x3e079b)[_0x8129('0xf')](_0x476e3f);}return null;};}function saveUpdates(_0x176280){return function(_0x5f2cec){if(_0x5f2cec){return _0x5f2cec['update'](_0x176280)[_0x8129('0x14')](function(_0x396168){return _0x396168;});}return null;};}function removeEntity(_0x5529bf){return function(_0xc0ed00){if(_0xc0ed00){return _0xc0ed00[_0x8129('0x15')]()[_0x8129('0x14')](function(){_0x5529bf[_0x8129('0xe')](0xcc)[_0x8129('0x16')]();});}};}function handleEntityNotFound(_0x24bed4){return function(_0x3ab8dc){if(!_0x3ab8dc){_0x24bed4['sendStatus'](0x194);}return _0x3ab8dc;};}function handleError(_0x5e3a95,_0x4b52ed){_0x4b52ed=_0x4b52ed||0x1f4;return function(_0x20c886){logger[_0x8129('0x17')](_0x20c886[_0x8129('0x18')]);if(_0x20c886[_0x8129('0x19')]){delete _0x20c886[_0x8129('0x19')];}_0x5e3a95['status'](_0x4b52ed)[_0x8129('0x1a')](_0x20c886);};}exports[_0x8129('0x1b')]=function(_0x5064ea,_0x18d537){var _0x580ff3={},_0x4f23de={},_0xf21b66={'count':0x0,'rows':[]};return db[_0x8129('0x1c')][_0x8129('0x1d')]()[_0x8129('0x14')](function(_0xb0b3ab){var _0x226c69=[];for(var _0x34bd4a=0x0;_0x34bd4a0x1){_0x4a37c2['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8129('0x52')](_0x1ae2c7),null);}else{if(qs[_0x8129('0x53')](_0x1ae2c7)){_0x4a37c2['or'](_0x8129('0x54'),_0x1ae2c7+'%');_0x4a37c2['or'](_0x8129('0x55'),_0x1ae2c7+'%');_0x4a37c2['or'](_0x8129('0x56'),_0x1ae2c7+'%');_0x4a37c2['or'](_0x8129('0x57'),_0x1ae2c7+'%');}else if(qs[_0x8129('0x58')](_0x1ae2c7)){_0x4a37c2['or'](_0x8129('0x59'),_0x1ae2c7+'%');}else{_0x4a37c2['or'](_0x8129('0x5a'),'%'+_0x1ae2c7+'%');_0x4a37c2['or']('c.lastName\x20LIKE\x20?','%'+_0x1ae2c7+'%');_0x4a37c2['or']('c.email\x20LIKE\x20?','%'+_0x1ae2c7+'%');}}}}_0x6b4fed[_0x8129('0x36')](_0x4a37c2);_0x6b4fed[_0x8129('0x5b')]('c.id');var _0x21ba7d={'type':db[_0x8129('0x5c')][_0x8129('0x5d')][_0x8129('0x5e')],'raw':!![]};var _0x199605=_0x6b4fed[_0x8129('0x5f')]()[_0x8129('0x2e')](_0x8129('0x60'));if(_0x580ff3[_0x8129('0x61')]){_0x580ff3[_0x8129('0x61')][_0x8129('0x3d')](function(_0x518108){_0x6b4fed['order']('c.'+_0x518108[0x0],_0x518108[0x1]===_0x8129('0x62')?![]:!![]);});}if(!_['isEmpty'](_0x5a4633)){_0x6b4fed['having'](_0x1f9dcd);_0x199605['where'](_0x8129('0x63'),_0x5a4633);}BPromise[_0x8129('0x64')]()['then'](function(){if(!_0x216b65)return;if(_0x5064ea[_0x8129('0x65')][_0x8129('0x66')]!==_0x8129('0x67'))return;if(!_[_0x8129('0x68')](_0x216b65[_0x8129('0x3b')],[_0x8129('0x2e'),_0x8129('0x40')])){return _0x5064ea[_0x8129('0x65')]['getLists']({'attributes':['id'],'raw':!![]})[_0x8129('0x14')](function(_0x37a0a4){if(_[_0x8129('0x69')](_0x37a0a4)){_0x199605[_0x8129('0x36')](_0x8129('0x6a'));_0x6b4fed['where']('c.ListId\x20IS\x20NULL');}else{_0x199605[_0x8129('0x36')](_0x8129('0x4b'),_['map'](_0x37a0a4,'id'));_0x6b4fed[_0x8129('0x36')](_0x8129('0x4b'),_[_0x8129('0x47')](_0x37a0a4,'id'));}});}})[_0x8129('0x14')](function(){if(_0x5064ea[_0x8129('0x65')]['role']===_0x8129('0x67')&&!_0x216b65&&!_0x5064ea[_0x8129('0x28')][_0x8129('0x6b')])return[];return db[_0x8129('0x6c')][_0x8129('0x28')](_0x199605[_0x8129('0x6d')](),_0x21ba7d);})['then'](function(_0x2666dc){_0xf21b66['count']=_0x2666dc['length'];if(_0xf21b66[_0x8129('0x13')]===0x0)return[];return db['sequelize'][_0x8129('0x28')](_0x23ff3b['toString'](),_0x21ba7d)[_0x8129('0x14')](function(_0x4bf490){_0x1a55b=_[_0x8129('0x6e')](_0x4bf490,'id');_0x21ba7d=_[_0x8129('0x6f')](_0x21ba7d,{'model':db[_0x8129('0x1c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5064ea['query'][_0x8129('0x2a')]){_0x580ff3[_0x8129('0x29')][_0x8129('0x3d')](function(_0x49e5d1){_0x6b4fed['field']('c.'+_0x49e5d1);});}else{_0x6b4fed[_0x8129('0x2e')]('c.id');_0x6b4fed[_0x8129('0x2e')](_0x8129('0x70'));_0x6b4fed[_0x8129('0x2e')](_0x8129('0x71'));_0x6b4fed[_0x8129('0x2e')](_0x8129('0x72'));_0x6b4fed[_0x8129('0x2e')]('c.mobile');_0x6b4fed[_0x8129('0x2e')](_0x8129('0x73'));_0x6b4fed[_0x8129('0x2e')](_0x8129('0x74'));_0x6b4fed[_0x8129('0x2e')]('c.ListId');_0x6b4fed['field']('c.createdAt');_0x6b4fed[_0x8129('0x2e')](_0x8129('0x75'));_0x6b4fed[_0x8129('0x2e')](_0x8129('0x76'));_0x6b4fed[_0x8129('0x2e')](_0x8129('0x77'),_0x8129('0x78'));}if(_0x580ff3['limit'])_0x6b4fed[_0x8129('0x10')](_0x580ff3[_0x8129('0x10')]);if(_0x580ff3[_0x8129('0x12')])_0x6b4fed[_0x8129('0x12')](_0x580ff3[_0x8129('0x12')]);return db[_0x8129('0x6c')][_0x8129('0x28')](_0x6b4fed[_0x8129('0x6d')](),_0x21ba7d);});})[_0x8129('0x14')](function(_0x4336c2){_0x4336c2['forEach'](function(_0x841ee5){if(_0x841ee5[_0x8129('0x78')]){_0x841ee5[_0x8129('0x79')]=[];_0x841ee5[_0x8129('0x78')][_0x8129('0x7a')](',')['forEach'](function(_0x3a0da2){_0x841ee5[_0x8129('0x79')][_0x8129('0x22')](_0x1a55b[_0x3a0da2]);});}delete _0x841ee5[_0x8129('0x78')];});_0xf21b66['rows']=_0x4336c2;return _0xf21b66;})[_0x8129('0x14')](respondWithFilteredResult(_0x18d537,_0x580ff3));})[_0x8129('0x7b')](handleError(_0x18d537,null));};exports[_0x8129('0x15')]=function(_0xfcf6da,_0x3f337c){return db[_0x8129('0x1c')][_0x8129('0x7c')]({'where':{'id':_0xfcf6da[_0x8129('0x7d')]['id']}})['then'](handleEntityNotFound(_0x3f337c,null))['then'](removeEntity(_0x3f337c,null))[_0x8129('0x7b')](handleError(_0x3f337c,null));};exports['describe']=function(_0x12115f,_0x404517){return db[_0x8129('0x1c')][_0x8129('0x1d')]()[_0x8129('0x14')](function(_0x2e836e){delete _0x2e836e[_0x8129('0x7e')];for(var _0x4170f5=0x0;_0x4170f5=_0x2cdb34){_0x1bf96f=_0x2cdb34;_0x495de1=0xc8;}else{_0x495de1=0xce;}_0x1077cc[_0x8c1e('0x10')](_0x495de1);return _0x1077cc[_0x8c1e('0x16')](_0x8c1e('0x17'),_0x281930+'-'+_0x1bf96f+'/'+_0x2cdb34)[_0x8c1e('0x11')](_0x351ba8);}return null;};}function saveUpdates(_0x1884d1){return function(_0x404cc8){if(_0x404cc8){return _0x404cc8[_0x8c1e('0x18')](_0x1884d1)[_0x8c1e('0x19')](function(_0x4443ca){return _0x4443ca;});}return null;};}function removeEntity(_0x1aad1e){return function(_0x5b83cd){if(_0x5b83cd){return _0x5b83cd[_0x8c1e('0x1a')]()[_0x8c1e('0x19')](function(){_0x1aad1e[_0x8c1e('0x10')](0xcc)[_0x8c1e('0x1b')]();});}};}function handleEntityNotFound(_0x378b22){return function(_0x4d3161){if(!_0x4d3161){_0x378b22[_0x8c1e('0x1c')](0x194);}return _0x4d3161;};}function handleError(_0x29ca3c,_0xda8ada){_0xda8ada=_0xda8ada||0x1f4;return function(_0x5e3c4e){logger[_0x8c1e('0x1d')](_0x5e3c4e['stack']);if(_0x5e3c4e[_0x8c1e('0x1e')]){delete _0x5e3c4e[_0x8c1e('0x1e')];}_0x29ca3c[_0x8c1e('0x10')](_0xda8ada)[_0x8c1e('0x1f')](_0x5e3c4e);};}exports[_0x8c1e('0x20')]=function(_0x2baa5a,_0x3ab627){var _0x1a994e={},_0xdfe49={},_0x38bbdf={'count':0x0,'rows':[]};return db[_0x8c1e('0x21')]['describe']()[_0x8c1e('0x19')](function(_0x2e8414){var _0x28a31d=[];for(var _0x269bc7=0x0;_0x269bc70x1){_0x310723['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8c1e('0x62')](_0x2ee0d2),null);}else{if(qs[_0x8c1e('0x63')](_0x2ee0d2)){_0x310723['or'](_0x8c1e('0x64'),_0x2ee0d2+'%');_0x310723['or'](_0x8c1e('0x65'),_0x2ee0d2+'%');_0x310723['or'](_0x8c1e('0x66'),_0x2ee0d2+'%');_0x310723['or'](_0x8c1e('0x67'),_0x2ee0d2+'%');}else if(qs['isEmail'](_0x2ee0d2)){_0x310723['or']('c.email\x20LIKE\x20?',_0x2ee0d2+'%');}else{_0x310723['or'](_0x8c1e('0x68'),'%'+_0x2ee0d2+'%');_0x310723['or']('c.lastName\x20LIKE\x20?','%'+_0x2ee0d2+'%');_0x310723['or'](_0x8c1e('0x69'),'%'+_0x2ee0d2+'%');}}}}_0x2c4edc[_0x8c1e('0x33')](_0x310723);_0x2c4edc[_0x8c1e('0x6a')]('c.id');var _0x253caf={'type':db['Sequelize']['QueryTypes'][_0x8c1e('0x6b')],'raw':!![]};var _0x3819b1=_0x2c4edc[_0x8c1e('0x6c')]()['field'](_0x8c1e('0x6d'));if(_0x1a994e[_0x8c1e('0x31')]){_0x1a994e[_0x8c1e('0x31')][_0x8c1e('0x4b')](function(_0x744a2e){_0x2c4edc[_0x8c1e('0x31')]('c.'+_0x744a2e[0x0],_0x744a2e[0x1]===_0x8c1e('0x6e')?![]:!![]);});}if(!_['isEmpty'](_0x307eaa)){_0x2c4edc['having'](_0x353694);_0x3819b1[_0x8c1e('0x33')](_0x8c1e('0x6f'),_0x307eaa);}BPromise[_0x8c1e('0x70')]()[_0x8c1e('0x19')](function(){if(!_0x2b6374)return;if(_0x2baa5a['user'][_0x8c1e('0x71')]!=='agent')return;if(!_[_0x8c1e('0x72')](_0x2b6374[_0x8c1e('0x45')],[_0x8c1e('0x36'),_0x8c1e('0x4e')])){return _0x2baa5a[_0x8c1e('0x73')][_0x8c1e('0x74')]({'attributes':['id'],'raw':!![]})['then'](function(_0x41b08a){if(_[_0x8c1e('0x5a')](_0x41b08a)){_0x3819b1[_0x8c1e('0x33')](_0x8c1e('0x75'));_0x2c4edc[_0x8c1e('0x33')]('c.ListId\x20IS\x20NULL');}else{_0x3819b1['where'](_0x8c1e('0x5c'),_[_0x8c1e('0x4a')](_0x41b08a,'id'));_0x2c4edc[_0x8c1e('0x33')](_0x8c1e('0x5c'),_['map'](_0x41b08a,'id'));}});}})[_0x8c1e('0x19')](function(){if(_0x2baa5a['user']['role']===_0x8c1e('0x76')&&!_0x2b6374&&!_0x2baa5a[_0x8c1e('0x2c')][_0x8c1e('0x5b')])return[];return db[_0x8c1e('0x77')][_0x8c1e('0x2c')](_0x3819b1['toString'](),_0x253caf);})[_0x8c1e('0x19')](function(_0x27c37f){_0x38bbdf[_0x8c1e('0x15')]=_0x27c37f['length'];if(_0x38bbdf[_0x8c1e('0x15')]===0x0)return[];return db[_0x8c1e('0x77')][_0x8c1e('0x2c')](_0x3adbe6[_0x8c1e('0x78')](),_0x253caf)[_0x8c1e('0x19')](function(_0x3fbd13){_0x6ed644=_[_0x8c1e('0x79')](_0x3fbd13,'id');_0x253caf=_['merge'](_0x253caf,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2baa5a['query']['fields']){_0x1a994e[_0x8c1e('0x2e')][_0x8c1e('0x4b')](function(_0x31ac32){_0x2c4edc[_0x8c1e('0x36')]('c.'+_0x31ac32);});}else{_0x2c4edc[_0x8c1e('0x36')](_0x8c1e('0x6d'));_0x2c4edc[_0x8c1e('0x36')](_0x8c1e('0x7a'));_0x2c4edc[_0x8c1e('0x36')](_0x8c1e('0x7b'));_0x2c4edc[_0x8c1e('0x36')]('c.phone');_0x2c4edc[_0x8c1e('0x36')]('c.mobile');_0x2c4edc[_0x8c1e('0x36')](_0x8c1e('0x7c'));_0x2c4edc['field'](_0x8c1e('0x7d'));_0x2c4edc[_0x8c1e('0x36')](_0x8c1e('0x7e'));_0x2c4edc[_0x8c1e('0x36')](_0x8c1e('0x7f'));_0x2c4edc[_0x8c1e('0x36')]('c.deletedAt');_0x2c4edc['field'](_0x8c1e('0x80'));_0x2c4edc[_0x8c1e('0x36')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1a994e[_0x8c1e('0x14')])_0x2c4edc[_0x8c1e('0x14')](_0x1a994e['limit']);if(_0x1a994e[_0x8c1e('0x12')])_0x2c4edc[_0x8c1e('0x12')](_0x1a994e[_0x8c1e('0x12')]);return db['sequelize']['query'](_0x2c4edc['toString'](),_0x253caf);});})[_0x8c1e('0x19')](function(_0x593d89){_0x593d89[_0x8c1e('0x4b')](function(_0x5e70ad){if(_0x5e70ad[_0x8c1e('0x81')]){_0x5e70ad[_0x8c1e('0x82')]=[];_0x5e70ad[_0x8c1e('0x81')][_0x8c1e('0x49')](',')[_0x8c1e('0x4b')](function(_0x4ff52f){_0x5e70ad['Tags'][_0x8c1e('0x26')](_0x6ed644[_0x4ff52f]);});}delete _0x5e70ad[_0x8c1e('0x81')];});_0x38bbdf[_0x8c1e('0x83')]=_0x593d89;return _0x38bbdf;})[_0x8c1e('0x19')](respondWithFilteredResult(_0x3ab627,_0x1a994e));})['catch'](handleError(_0x3ab627,null));};exports[_0x8c1e('0x1a')]=function(_0x9191e2,_0x311f4c){return db['CmContact'][_0x8c1e('0x46')]({'where':{'id':_0x9191e2[_0x8c1e('0x84')]['id']}})[_0x8c1e('0x19')](handleEntityNotFound(_0x311f4c,null))['then'](removeEntity(_0x311f4c,null))['catch'](handleError(_0x311f4c,null));};exports[_0x8c1e('0x85')]=function(_0x5f37d3,_0x2a8a8f){return db[_0x8c1e('0x21')]['describe']()[_0x8c1e('0x19')](function(_0x587d0f){delete _0x587d0f[_0x8c1e('0x86')];for(var _0x534a2b=0x0;_0x534a2b{}\s\\|]/g,'-');_0x5f32b7(null,util[_0xb45c('0x24')](_0xb45c('0x25'),path['basename'](_0x126dfd['originalname'],path['extname'](_0x126dfd['originalname'])),Date[_0xb45c('0x26')](),path[_0xb45c('0x27')](_0x126dfd[_0xb45c('0x22')])));}})});router['post'](_0xb45c('0x28'),upload[_0xb45c('0x29')]('file'),controller[_0xb45c('0x2a')]);var upload=multer({'storage':multer[_0xb45c('0x1e')]({'destination':function(_0x243a85,_0x52f528,_0x185b60){_0x185b60(null,path[_0xb45c('0x1f')](config['root'],_0xb45c('0x21')));},'filename':function(_0x31d720,_0x3fa0f0,_0x247882){_0x3fa0f0[_0xb45c('0x22')]=_0x3fa0f0['originalname'][_0xb45c('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x247882(null,util[_0xb45c('0x24')](_0xb45c('0x25'),path[_0xb45c('0x2b')](_0x3fa0f0[_0xb45c('0x22')],path[_0xb45c('0x27')](_0x3fa0f0[_0xb45c('0x22')])),Date[_0xb45c('0x26')](),path[_0xb45c('0x27')](_0x3fa0f0[_0xb45c('0x22')])));}})});router[_0xb45c('0x17')](_0xb45c('0x2c'),upload[_0xb45c('0x29')](_0xb45c('0x2d')),controller[_0xb45c('0x2e')]);router['post'](_0xb45c('0x2f'),auth['isAuthenticated'](),controller[_0xb45c('0x30')]);router['put'](_0xb45c('0x31'),auth['isAuthenticated'](),controller[_0xb45c('0x32')]);router[_0xb45c('0x33')]('/:id',auth['isAuthenticated'](),controller[_0xb45c('0x34')]);module[_0xb45c('0x35')]=router; \ No newline at end of file +var _0xcc92=['setTags','join','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','now','single','file','uploadCsv','format','/upload','upload','/upload/:id','import','put','update','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/:id/tags','getTags','/:id/hopper_histories','/:id/hopper_finals','/:id/jscripty_sessions','/:id/journey','post','/merge','merge','create','/create_many','bulkCreate'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xcc92,0x76));var _0x2cc9=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0xcc92[_0x1e381c];return _0x9b5ea9;};'use strict';var multer=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var path=require(_0x2cc9('0x2'));var timeout=require(_0x2cc9('0x3'));var express=require(_0x2cc9('0x4'));var router=express[_0x2cc9('0x5')]();var fs_extra=require(_0x2cc9('0x6'));var auth=require(_0x2cc9('0x7'));var interaction=require(_0x2cc9('0x8'));var config=require(_0x2cc9('0x9'));var controller=require(_0x2cc9('0xa'));router[_0x2cc9('0xb')]('/',auth[_0x2cc9('0xc')](),controller[_0x2cc9('0xd')]);router[_0x2cc9('0xb')]('/describe',auth[_0x2cc9('0xc')](),controller['describe']);router[_0x2cc9('0xb')]('/:id',auth[_0x2cc9('0xc')](),controller['show']);router['get'](_0x2cc9('0xe'),auth['isAuthenticated'](),controller[_0x2cc9('0xf')]);router[_0x2cc9('0xb')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x2cc9('0xb')](_0x2cc9('0x10'),auth[_0x2cc9('0xc')](),controller['getHopperHistories']);router[_0x2cc9('0xb')](_0x2cc9('0x11'),auth[_0x2cc9('0xc')](),controller['getHopperFinals']);router[_0x2cc9('0xb')](_0x2cc9('0x12'),auth[_0x2cc9('0xc')](),controller['getJscriptySessions']);router['get'](_0x2cc9('0x13'),auth[_0x2cc9('0xc')](),controller['getJourney']);router[_0x2cc9('0x14')](_0x2cc9('0x15'),auth['isAuthenticated'](),controller[_0x2cc9('0x16')]);router[_0x2cc9('0x14')]('/',auth[_0x2cc9('0xc')](),controller[_0x2cc9('0x17')]);router[_0x2cc9('0x14')](_0x2cc9('0x18'),auth[_0x2cc9('0xc')](),controller[_0x2cc9('0x19')]);router[_0x2cc9('0x14')](_0x2cc9('0xe'),auth[_0x2cc9('0xc')](),controller[_0x2cc9('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x275be7,_0x2a49cb,_0x4dad85){_0x4dad85(null,path[_0x2cc9('0x1b')](config[_0x2cc9('0x1c')],_0x2cc9('0x1d')));},'filename':function(_0x4d2360,_0x16e944,_0x356a78){_0x16e944[_0x2cc9('0x1e')]=_0x16e944[_0x2cc9('0x1e')][_0x2cc9('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x356a78(null,util['format'](_0x2cc9('0x20'),path[_0x2cc9('0x21')](_0x16e944[_0x2cc9('0x1e')],path[_0x2cc9('0x22')](_0x16e944[_0x2cc9('0x1e')])),Date[_0x2cc9('0x23')](),path['extname'](_0x16e944[_0x2cc9('0x1e')])));}})});router[_0x2cc9('0x14')]('/csv',upload[_0x2cc9('0x24')](_0x2cc9('0x25')),controller[_0x2cc9('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ca4d9,_0x24b98e,_0x1e05e3){_0x1e05e3(null,path[_0x2cc9('0x1b')](config[_0x2cc9('0x1c')],_0x2cc9('0x1d')));},'filename':function(_0x2067d4,_0xe75e59,_0x4a0939){_0xe75e59[_0x2cc9('0x1e')]=_0xe75e59[_0x2cc9('0x1e')][_0x2cc9('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4a0939(null,util[_0x2cc9('0x27')]('%s-%s%s',path[_0x2cc9('0x21')](_0xe75e59['originalname'],path[_0x2cc9('0x22')](_0xe75e59['originalname'])),Date[_0x2cc9('0x23')](),path[_0x2cc9('0x22')](_0xe75e59[_0x2cc9('0x1e')])));}})});router[_0x2cc9('0x14')](_0x2cc9('0x28'),upload[_0x2cc9('0x24')](_0x2cc9('0x25')),controller[_0x2cc9('0x29')]);router[_0x2cc9('0x14')](_0x2cc9('0x2a'),auth[_0x2cc9('0xc')](),controller[_0x2cc9('0x2b')]);router[_0x2cc9('0x2c')]('/:id',auth[_0x2cc9('0xc')](),controller[_0x2cc9('0x2d')]);router['delete'](_0x2cc9('0x2e'),auth[_0x2cc9('0xc')](),controller[_0x2cc9('0x2f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 5c15cc4..06446ce 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 _0x19e0=['VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','select','parse','values','stringify','BOOLEAN','ENUM','sequelize','lodash','exports'];(function(_0xe6c242,_0x116ad0){var _0x903b8f=function(_0x3fa49a){while(--_0x3fa49a){_0xe6c242['push'](_0xe6c242['shift']());}};_0x903b8f(++_0x116ad0);}(_0x19e0,0xfc));var _0x019e=function(_0x37e9fe,_0x4cfad2){_0x37e9fe=_0x37e9fe-0x0;var _0x405167=_0x19e0[_0x37e9fe];return _0x405167;};'use strict';var Sequelize=require(_0x019e('0x0'));var _=require(_0x019e('0x1'));module[_0x019e('0x2')]={'name':{'type':Sequelize[_0x019e('0x3')],'get':function(_0x3a40f9){return this[_0x019e('0x4')](_0x019e('0x5'));}},'alias':{'type':Sequelize[_0x019e('0x6')],'allowNull':![],'set':function(_0xc58c95){this[_0x019e('0x7')](_0x019e('0x5'),_0xc58c95?_0xc58c95:this[_0x019e('0x4')](_0x019e('0x8')));}},'type':{'type':Sequelize[_0x019e('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x019e('0x9')),'get':function(){if(this['getDataValue'](_0x019e('0xa'))===_0x019e('0xb')){return JSON[_0x019e('0xc')](this['getDataValue'](_0x019e('0xd')));}else{return this[_0x019e('0x4')](_0x019e('0xd'));}},'set':function(_0x5d4442){if(Array['isArray'](_0x5d4442)){this[_0x019e('0x7')](_0x019e('0xd'),JSON[_0x019e('0xe')](_0x5d4442));}else{this[_0x019e('0x7')](_0x019e('0xd'),_0x5d4442);}}},'required':{'type':Sequelize[_0x019e('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x019e('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x019e('0x10')]('voice')}}; \ No newline at end of file +var _0x3173=['isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','lodash','exports','getDataValue','alias','STRING','name','TEXT','type','select','values'];(function(_0x2ade4a,_0x9f7ab7){var _0x537800=function(_0x3b3779){while(--_0x3b3779){_0x2ade4a['push'](_0x2ade4a['shift']());}};_0x537800(++_0x9f7ab7);}(_0x3173,0x116));var _0x3317=function(_0x560d9d,_0x40e8eb){_0x560d9d=_0x560d9d-0x0;var _0x290661=_0x3173[_0x560d9d];return _0x290661;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3317('0x0'));module[_0x3317('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x13456e){return this[_0x3317('0x2')](_0x3317('0x3'));}},'alias':{'type':Sequelize[_0x3317('0x4')],'allowNull':![],'set':function(_0x2de6af){this['setDataValue'](_0x3317('0x3'),_0x2de6af?_0x2de6af:this['getDataValue'](_0x3317('0x5')));}},'type':{'type':Sequelize[_0x3317('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x3317('0x6')]('long'),'get':function(){if(this[_0x3317('0x2')](_0x3317('0x7'))===_0x3317('0x8')){return JSON['parse'](this[_0x3317('0x2')]('values'));}else{return this['getDataValue'](_0x3317('0x9'));}},'set':function(_0x5371d8){if(Array[_0x3317('0xa')](_0x5371d8)){this[_0x3317('0xb')](_0x3317('0x9'),JSON[_0x3317('0xc')](_0x5371d8));}else{this[_0x3317('0xb')](_0x3317('0x9'),_0x5371d8);}}},'required':{'type':Sequelize[_0x3317('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x3317('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3317('0xe')](_0x3317('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 8ec9739..e3c4bc2 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 _0xb0cf=['differenceBy','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','CmCustomField','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','destroy','create','sequelize','Sequelize','TEXT','number','switch','BOOLEAN','queryInterface','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','rawAttributes','fieldName','key','model'];(function(_0x3524b8,_0x2ed411){var _0x365e6c=function(_0x47f509){while(--_0x47f509){_0x3524b8['push'](_0x3524b8['shift']());}};_0x365e6c(++_0x2ed411);}(_0xb0cf,0x84));var _0xfb0c=function(_0x332eee,_0x106125){_0x332eee=_0x332eee-0x0;var _0xe3cd4e=_0xb0cf[_0x332eee];return _0xe3cd4e;};'use strict';var emlformat=require(_0xfb0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb0c('0x1'));var jsonpatch=require(_0xfb0c('0x2'));var rp=require(_0xfb0c('0x3'));var moment=require(_0xfb0c('0x4'));var BPromise=require(_0xfb0c('0x5'));var Mustache=require(_0xfb0c('0x6'));var util=require('util');var path=require(_0xfb0c('0x7'));var sox=require(_0xfb0c('0x8'));var csv=require(_0xfb0c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb0c('0xa'));var _=require(_0xfb0c('0xb'));var squel=require(_0xfb0c('0xc'));var crypto=require(_0xfb0c('0xd'));var jsforce=require(_0xfb0c('0xe'));var deskjs=require(_0xfb0c('0xf'));var toCsv=require(_0xfb0c('0x9'));var querystring=require(_0xfb0c('0x10'));var Papa=require(_0xfb0c('0x11'));var Redis=require(_0xfb0c('0x12'));var authService=require(_0xfb0c('0x13'));var qs=require(_0xfb0c('0x14'));var as=require(_0xfb0c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfb0c('0x16'));var utils=require(_0xfb0c('0x17'));var config=require(_0xfb0c('0x18'));var licenseUtil=require(_0xfb0c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e60e6,_0x5e695e){_0x5e695e=_0x5e695e||0xcc;return function(_0x58f004){if(_0x58f004){return _0x2e60e6[_0xfb0c('0x1a')](_0x5e695e);}return _0x2e60e6[_0xfb0c('0x1b')](_0x5e695e)[_0xfb0c('0x1c')]();};}function respondWithResult(_0xd4ee69,_0x29ddb1){_0x29ddb1=_0x29ddb1||0xc8;return function(_0x5d9fbb){if(_0x5d9fbb){return _0xd4ee69['status'](_0x29ddb1)['json'](_0x5d9fbb);}};}function respondWithFilteredResult(_0x329971,_0x3370be){return function(_0x5b44d6){if(_0x5b44d6){var _0x4bd20e=typeof _0x3370be[_0xfb0c('0x1d')]===_0xfb0c('0x1e')&&typeof _0x3370be[_0xfb0c('0x1f')]===_0xfb0c('0x1e');var _0xf98ee7=_0x5b44d6[_0xfb0c('0x20')];var _0xa7b026=_0x4bd20e?0x0:_0x3370be['offset'];var _0x155508=_0x4bd20e?_0x5b44d6['count']:_0x3370be[_0xfb0c('0x1d')]+_0x3370be[_0xfb0c('0x1f')];var _0x35b3a6;if(_0x155508>=_0xf98ee7){_0x155508=_0xf98ee7;_0x35b3a6=0xc8;}else{_0x35b3a6=0xce;}_0x329971[_0xfb0c('0x1b')](_0x35b3a6);return _0x329971['set'](_0xfb0c('0x21'),_0xa7b026+'-'+_0x155508+'/'+_0xf98ee7)[_0xfb0c('0x22')](_0x5b44d6);}return null;};}function patchUpdates(_0x29bf80){return function(_0x1de55f){try{jsonpatch[_0xfb0c('0x23')](_0x1de55f,_0x29bf80,!![]);}catch(_0x17e141){return BPromise[_0xfb0c('0x24')](_0x17e141);}return _0x1de55f[_0xfb0c('0x25')]();};}function saveUpdates(_0x7861de,_0x5dcd14){return function(_0x6cdcf6){if(_0x6cdcf6){return _0x6cdcf6[_0xfb0c('0x26')](_0x7861de)[_0xfb0c('0x27')](function(_0x409d1d){return _0x409d1d;});}return null;};}function removeEntity(_0x1270c6,_0x35687e){return function(_0x2b6b8c){if(_0x2b6b8c){return _0x2b6b8c['destroy']()[_0xfb0c('0x27')](function(){_0x1270c6[_0xfb0c('0x1b')](0xcc)[_0xfb0c('0x1c')]();});}};}function handleEntityNotFound(_0xcf6904,_0x3fa3a6){return function(_0x84c176){if(!_0x84c176){_0xcf6904['sendStatus'](0x194);}return _0x84c176;};}function handleError(_0x95a30,_0x214b40){_0x214b40=_0x214b40||0x1f4;return function(_0x572be3){logger['error'](_0x572be3[_0xfb0c('0x28')]);if(_0x572be3[_0xfb0c('0x29')]){delete _0x572be3[_0xfb0c('0x29')];}_0x95a30['status'](_0x214b40)[_0xfb0c('0x2a')](_0x572be3);};}exports[_0xfb0c('0x2b')]=function(_0x413b0b,_0x45093a){var _0x391984={},_0x5a65ec={},_0x3eb450={'count':0x0,'rows':[]};var _0x13c89b=_['map'](db['CmCustomField'][_0xfb0c('0x2c')],function(_0x5256d6){return{'name':_0x5256d6[_0xfb0c('0x2d')],'type':_0x5256d6['type'][_0xfb0c('0x2e')]};});_0x5a65ec[_0xfb0c('0x2f')]=_[_0xfb0c('0x30')](_[_0xfb0c('0x31')](_0x13c89b,_0xfb0c('0x29')),[_0xfb0c('0x29')]);_0x5a65ec[_0xfb0c('0x32')]=_[_0xfb0c('0x33')](_0x413b0b[_0xfb0c('0x32')]);_0x5a65ec[_0xfb0c('0x34')]=_[_0xfb0c('0x35')](_0x5a65ec[_0xfb0c('0x2f')],_0x5a65ec[_0xfb0c('0x32')]);_0x391984['attributes']=_[_0xfb0c('0x35')](_0x5a65ec[_0xfb0c('0x2f')],qs[_0xfb0c('0x36')](_0x413b0b[_0xfb0c('0x32')][_0xfb0c('0x36')]));_0x391984[_0xfb0c('0x37')]=_0x391984['attributes']['length']?_0x391984[_0xfb0c('0x37')]:_0x5a65ec[_0xfb0c('0x2f')];if(!_0x413b0b['query'][_0xfb0c('0x38')](_0xfb0c('0x39'))){_0x391984['limit']=qs['limit'](_0x413b0b[_0xfb0c('0x32')][_0xfb0c('0x1f')]);_0x391984[_0xfb0c('0x1d')]=qs[_0xfb0c('0x1d')](_0x413b0b[_0xfb0c('0x32')][_0xfb0c('0x1d')]);}_0x391984[_0xfb0c('0x3a')]=qs[_0xfb0c('0x3b')](_0x413b0b['query'][_0xfb0c('0x3b')]);_0x391984[_0xfb0c('0x3c')]=qs['filters'](_[_0xfb0c('0x3d')](_0x413b0b['query'],_0x5a65ec[_0xfb0c('0x34')]),_0x13c89b);if(_0x413b0b[_0xfb0c('0x32')][_0xfb0c('0x3e')]){_0x391984[_0xfb0c('0x3c')]=_[_0xfb0c('0x3f')](_0x391984[_0xfb0c('0x3c')],{'$or':_[_0xfb0c('0x31')](_0x13c89b,function(_0x3e9d0e){if(_0x3e9d0e[_0xfb0c('0x40')]!==_0xfb0c('0x41')){var _0x53bb20={};_0x53bb20[_0x3e9d0e['name']]={'$like':'%'+_0x413b0b[_0xfb0c('0x32')][_0xfb0c('0x3e')]+'%'};return _0x53bb20;}})});}_0x391984=_[_0xfb0c('0x3f')]({},_0x391984,_0x413b0b['options']);var _0x2a15e9={'where':_0x391984[_0xfb0c('0x3c')]};return db[_0xfb0c('0x42')][_0xfb0c('0x20')](_0x2a15e9)[_0xfb0c('0x27')](function(_0x59c520){_0x3eb450['count']=_0x59c520;if(_0x413b0b[_0xfb0c('0x32')][_0xfb0c('0x43')]){_0x391984[_0xfb0c('0x44')]=[{'all':!![]}];}return db[_0xfb0c('0x42')][_0xfb0c('0x45')](_0x391984);})[_0xfb0c('0x27')](function(_0x59429f){_0x3eb450[_0xfb0c('0x46')]=_0x59429f;return _0x3eb450;})['then'](respondWithFilteredResult(_0x45093a,_0x391984))[_0xfb0c('0x47')](handleError(_0x45093a,null));};exports[_0xfb0c('0x48')]=function(_0x1b70ec,_0x4c3dc6){var _0x40b051={'raw':!![],'where':{'id':_0x1b70ec[_0xfb0c('0x49')]['id']}},_0x18b944={};_0x18b944[_0xfb0c('0x2f')]=_[_0xfb0c('0x33')](db['CmCustomField'][_0xfb0c('0x2c')]);_0x18b944[_0xfb0c('0x32')]=_[_0xfb0c('0x33')](_0x1b70ec[_0xfb0c('0x32')]);_0x18b944[_0xfb0c('0x34')]=_['intersection'](_0x18b944[_0xfb0c('0x2f')],_0x18b944[_0xfb0c('0x32')]);_0x40b051['attributes']=_[_0xfb0c('0x35')](_0x18b944['model'],qs[_0xfb0c('0x36')](_0x1b70ec[_0xfb0c('0x32')]['fields']));_0x40b051['attributes']=_0x40b051[_0xfb0c('0x37')][_0xfb0c('0x4a')]?_0x40b051[_0xfb0c('0x37')]:_0x18b944['model'];if(_0x1b70ec[_0xfb0c('0x32')][_0xfb0c('0x43')]){_0x40b051[_0xfb0c('0x44')]=[{'all':!![]}];}_0x40b051=_[_0xfb0c('0x3f')]({},_0x40b051,_0x1b70ec[_0xfb0c('0x4b')]);return db[_0xfb0c('0x42')][_0xfb0c('0x4c')](_0x40b051)[_0xfb0c('0x27')](handleEntityNotFound(_0x4c3dc6,null))[_0xfb0c('0x27')](respondWithResult(_0x4c3dc6,null))['catch'](handleError(_0x4c3dc6,null));};exports[_0xfb0c('0x26')]=function(_0x38f7a6,_0x311c74){if(_0x38f7a6['body']['id']){delete _0x38f7a6[_0xfb0c('0x4d')]['id'];}return db[_0xfb0c('0x42')][_0xfb0c('0x4c')]({'where':{'id':_0x38f7a6['params']['id']}})[_0xfb0c('0x27')](handleEntityNotFound(_0x311c74,null))['then'](saveUpdates(_0x38f7a6[_0xfb0c('0x4d')],null))[_0xfb0c('0x27')](respondWithResult(_0x311c74,null))[_0xfb0c('0x47')](handleError(_0x311c74,null));};exports[_0xfb0c('0x4e')]=function(_0x1b8ca8,_0x46223e){return db[_0xfb0c('0x42')]['find']({'where':{'id':_0x1b8ca8[_0xfb0c('0x49')]['id']}})[_0xfb0c('0x27')](handleEntityNotFound(_0x46223e,null))[_0xfb0c('0x27')](removeEntity(_0x46223e,null))['catch'](handleError(_0x46223e,null));};exports[_0xfb0c('0x4f')]=function(_0x2aaedf,_0x4d1cee){var _0x3c91ea;return db[_0xfb0c('0x50')]['transaction'](function(_0xfec076){return db['CmCustomField'][_0xfb0c('0x4f')](_0x2aaedf[_0xfb0c('0x4d')],{'transaction':_0xfec076})[_0xfb0c('0x27')](function(_0x1a193a){_0x3c91ea=_0x1a193a;var _0x15fedb={'type':db[_0xfb0c('0x51')]['TEXT'],'transaction':_0xfec076};switch(_0x2aaedf[_0xfb0c('0x4d')]['type']){case'text':_0x15fedb[_0xfb0c('0x40')]=db['Sequelize'][_0xfb0c('0x52')];break;case _0xfb0c('0x53'):_0x15fedb[_0xfb0c('0x40')]=db[_0xfb0c('0x51')]['INTEGER'];break;case _0xfb0c('0x54'):_0x15fedb[_0xfb0c('0x40')]=db[_0xfb0c('0x51')][_0xfb0c('0x55')];_0x15fedb['defaultValue']=![];break;default:}return db[_0xfb0c('0x50')][_0xfb0c('0x56')]['addColumn'](_0xfb0c('0x57'),util[_0xfb0c('0x58')](_0xfb0c('0x59'),_0x3c91ea['id']),_0x15fedb);})['then'](function(){return _0x3c91ea;});})[_0xfb0c('0x27')](respondWithResult(_0x4d1cee,0xc9))[_0xfb0c('0x47')](handleError(_0x4d1cee,null));}; \ No newline at end of file +var _0x4187=['differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','BOOLEAN','defaultValue','queryInterface','addColumn','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','map','CmCustomField','fieldName','type','key','model'];(function(_0x594a78,_0x2f1dab){var _0x3b6fbd=function(_0x17fc04){while(--_0x17fc04){_0x594a78['push'](_0x594a78['shift']());}};_0x3b6fbd(++_0x2f1dab);}(_0x4187,0x16f));var _0x7418=function(_0x3e4234,_0x561eb1){_0x3e4234=_0x3e4234-0x0;var _0xce6af7=_0x4187[_0x3e4234];return _0xce6af7;};'use strict';var emlformat=require(_0x7418('0x0'));var rimraf=require(_0x7418('0x1'));var zipdir=require(_0x7418('0x2'));var jsonpatch=require(_0x7418('0x3'));var rp=require(_0x7418('0x4'));var moment=require('moment');var BPromise=require(_0x7418('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7418('0x6'));var csv=require(_0x7418('0x7'));var ejs=require(_0x7418('0x8'));var fs=require('fs');var fs_extra=require(_0x7418('0x9'));var _=require('lodash');var squel=require(_0x7418('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7418('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7418('0xc'));var Papa=require(_0x7418('0xd'));var Redis=require('ioredis');var authService=require(_0x7418('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7418('0xf'));var hardwareService=require(_0x7418('0x10'));var logger=require(_0x7418('0x11'))('api');var utils=require(_0x7418('0x12'));var config=require(_0x7418('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25aee4,_0x5d1596){_0x5d1596=_0x5d1596||0xcc;return function(_0x2d52c9){if(_0x2d52c9){return _0x25aee4[_0x7418('0x14')](_0x5d1596);}return _0x25aee4['status'](_0x5d1596)[_0x7418('0x15')]();};}function respondWithResult(_0x20f44a,_0xc6d89e){_0xc6d89e=_0xc6d89e||0xc8;return function(_0x4fc05f){if(_0x4fc05f){return _0x20f44a[_0x7418('0x16')](_0xc6d89e)['json'](_0x4fc05f);}};}function respondWithFilteredResult(_0x11202d,_0x514dff){return function(_0x107295){if(_0x107295){var _0x3723a0=typeof _0x514dff['offset']===_0x7418('0x17')&&typeof _0x514dff[_0x7418('0x18')]===_0x7418('0x17');var _0x384953=_0x107295[_0x7418('0x19')];var _0x5e9c7e=_0x3723a0?0x0:_0x514dff['offset'];var _0x16cc98=_0x3723a0?_0x107295[_0x7418('0x19')]:_0x514dff['offset']+_0x514dff['limit'];var _0x29994b;if(_0x16cc98>=_0x384953){_0x16cc98=_0x384953;_0x29994b=0xc8;}else{_0x29994b=0xce;}_0x11202d[_0x7418('0x16')](_0x29994b);return _0x11202d[_0x7418('0x1a')]('Content-Range',_0x5e9c7e+'-'+_0x16cc98+'/'+_0x384953)[_0x7418('0x1b')](_0x107295);}return null;};}function patchUpdates(_0x17481a){return function(_0x164e11){try{jsonpatch[_0x7418('0x1c')](_0x164e11,_0x17481a,!![]);}catch(_0x12d7d0){return BPromise[_0x7418('0x1d')](_0x12d7d0);}return _0x164e11[_0x7418('0x1e')]();};}function saveUpdates(_0x1dc6ca,_0x518eac){return function(_0x31a8e3){if(_0x31a8e3){return _0x31a8e3[_0x7418('0x1f')](_0x1dc6ca)[_0x7418('0x20')](function(_0x2524e2){return _0x2524e2;});}return null;};}function removeEntity(_0x254725,_0x195880){return function(_0x4bc465){if(_0x4bc465){return _0x4bc465[_0x7418('0x21')]()[_0x7418('0x20')](function(){_0x254725['status'](0xcc)[_0x7418('0x15')]();});}};}function handleEntityNotFound(_0x352b81,_0x189964){return function(_0x31c451){if(!_0x31c451){_0x352b81['sendStatus'](0x194);}return _0x31c451;};}function handleError(_0x258883,_0x4a0f70){_0x4a0f70=_0x4a0f70||0x1f4;return function(_0x4e5d56){logger[_0x7418('0x22')](_0x4e5d56[_0x7418('0x23')]);if(_0x4e5d56[_0x7418('0x24')]){delete _0x4e5d56[_0x7418('0x24')];}_0x258883[_0x7418('0x16')](_0x4a0f70)['send'](_0x4e5d56);};}exports['index']=function(_0x5939dd,_0x4ee4df){var _0x5a48e3={},_0x1c749a={},_0x19a39d={'count':0x0,'rows':[]};var _0x1ed791=_[_0x7418('0x25')](db[_0x7418('0x26')]['rawAttributes'],function(_0xa4d067){return{'name':_0xa4d067[_0x7418('0x27')],'type':_0xa4d067[_0x7418('0x28')][_0x7418('0x29')]};});_0x1c749a[_0x7418('0x2a')]=_[_0x7418('0x2b')](_[_0x7418('0x25')](_0x1ed791,_0x7418('0x24')),['name']);_0x1c749a[_0x7418('0x2c')]=_[_0x7418('0x2d')](_0x5939dd['query']);_0x1c749a['filters']=_[_0x7418('0x2e')](_0x1c749a[_0x7418('0x2a')],_0x1c749a[_0x7418('0x2c')]);_0x5a48e3[_0x7418('0x2f')]=_['intersection'](_0x1c749a[_0x7418('0x2a')],qs[_0x7418('0x30')](_0x5939dd[_0x7418('0x2c')][_0x7418('0x30')]));_0x5a48e3['attributes']=_0x5a48e3[_0x7418('0x2f')]['length']?_0x5a48e3[_0x7418('0x2f')]:_0x1c749a[_0x7418('0x2a')];if(!_0x5939dd[_0x7418('0x2c')][_0x7418('0x31')](_0x7418('0x32'))){_0x5a48e3['limit']=qs[_0x7418('0x18')](_0x5939dd[_0x7418('0x2c')][_0x7418('0x18')]);_0x5a48e3[_0x7418('0x33')]=qs[_0x7418('0x33')](_0x5939dd[_0x7418('0x2c')]['offset']);}_0x5a48e3[_0x7418('0x34')]=qs[_0x7418('0x35')](_0x5939dd[_0x7418('0x2c')][_0x7418('0x35')]);_0x5a48e3[_0x7418('0x36')]=qs[_0x7418('0x37')](_[_0x7418('0x38')](_0x5939dd['query'],_0x1c749a[_0x7418('0x37')]),_0x1ed791);if(_0x5939dd[_0x7418('0x2c')][_0x7418('0x39')]){_0x5a48e3['where']=_['merge'](_0x5a48e3[_0x7418('0x36')],{'$or':_['map'](_0x1ed791,function(_0x561c5b){if(_0x561c5b[_0x7418('0x28')]!=='VIRTUAL'){var _0x3cc7c3={};_0x3cc7c3[_0x561c5b[_0x7418('0x24')]]={'$like':'%'+_0x5939dd[_0x7418('0x2c')][_0x7418('0x39')]+'%'};return _0x3cc7c3;}})});}_0x5a48e3=_[_0x7418('0x3a')]({},_0x5a48e3,_0x5939dd[_0x7418('0x3b')]);var _0x51ec9b={'where':_0x5a48e3[_0x7418('0x36')]};return db['CmCustomField'][_0x7418('0x19')](_0x51ec9b)[_0x7418('0x20')](function(_0x2e1d86){_0x19a39d[_0x7418('0x19')]=_0x2e1d86;if(_0x5939dd[_0x7418('0x2c')]['includeAll']){_0x5a48e3[_0x7418('0x3c')]=[{'all':!![]}];}return db[_0x7418('0x26')][_0x7418('0x3d')](_0x5a48e3);})['then'](function(_0x24e87b){_0x19a39d[_0x7418('0x3e')]=_0x24e87b;return _0x19a39d;})[_0x7418('0x20')](respondWithFilteredResult(_0x4ee4df,_0x5a48e3))[_0x7418('0x3f')](handleError(_0x4ee4df,null));};exports[_0x7418('0x40')]=function(_0x44f339,_0x4fec6e){var _0x547f21={'raw':!![],'where':{'id':_0x44f339[_0x7418('0x41')]['id']}},_0x2bc913={};_0x2bc913['model']=_['keys'](db[_0x7418('0x26')][_0x7418('0x42')]);_0x2bc913[_0x7418('0x2c')]=_['keys'](_0x44f339[_0x7418('0x2c')]);_0x2bc913[_0x7418('0x37')]=_[_0x7418('0x2e')](_0x2bc913[_0x7418('0x2a')],_0x2bc913['query']);_0x547f21[_0x7418('0x2f')]=_[_0x7418('0x2e')](_0x2bc913[_0x7418('0x2a')],qs[_0x7418('0x30')](_0x44f339[_0x7418('0x2c')][_0x7418('0x30')]));_0x547f21[_0x7418('0x2f')]=_0x547f21['attributes']['length']?_0x547f21[_0x7418('0x2f')]:_0x2bc913[_0x7418('0x2a')];if(_0x44f339[_0x7418('0x2c')][_0x7418('0x43')]){_0x547f21[_0x7418('0x3c')]=[{'all':!![]}];}_0x547f21=_['merge']({},_0x547f21,_0x44f339[_0x7418('0x3b')]);return db[_0x7418('0x26')][_0x7418('0x44')](_0x547f21)[_0x7418('0x20')](handleEntityNotFound(_0x4fec6e,null))['then'](respondWithResult(_0x4fec6e,null))[_0x7418('0x3f')](handleError(_0x4fec6e,null));};exports['update']=function(_0x39b9db,_0x1a40f1){if(_0x39b9db['body']['id']){delete _0x39b9db[_0x7418('0x45')]['id'];}return db[_0x7418('0x26')]['find']({'where':{'id':_0x39b9db['params']['id']}})['then'](handleEntityNotFound(_0x1a40f1,null))[_0x7418('0x20')](saveUpdates(_0x39b9db['body'],null))[_0x7418('0x20')](respondWithResult(_0x1a40f1,null))[_0x7418('0x3f')](handleError(_0x1a40f1,null));};exports[_0x7418('0x21')]=function(_0x5b7973,_0x1b26b0){return db[_0x7418('0x26')][_0x7418('0x44')]({'where':{'id':_0x5b7973['params']['id']}})['then'](handleEntityNotFound(_0x1b26b0,null))[_0x7418('0x20')](removeEntity(_0x1b26b0,null))[_0x7418('0x3f')](handleError(_0x1b26b0,null));};exports[_0x7418('0x46')]=function(_0x43cf82,_0xd6b5af){var _0x286b5f;return db[_0x7418('0x47')][_0x7418('0x48')](function(_0x31a732){return db[_0x7418('0x26')][_0x7418('0x46')](_0x43cf82[_0x7418('0x45')],{'transaction':_0x31a732})[_0x7418('0x20')](function(_0x40ba7c){_0x286b5f=_0x40ba7c;var _0x4daacd={'type':db[_0x7418('0x49')][_0x7418('0x4a')],'transaction':_0x31a732};switch(_0x43cf82[_0x7418('0x45')][_0x7418('0x28')]){case _0x7418('0x4b'):_0x4daacd[_0x7418('0x28')]=db['Sequelize'][_0x7418('0x4a')];break;case _0x7418('0x4c'):_0x4daacd['type']=db[_0x7418('0x49')]['INTEGER'];break;case'switch':_0x4daacd[_0x7418('0x28')]=db[_0x7418('0x49')][_0x7418('0x4d')];_0x4daacd[_0x7418('0x4e')]=![];break;default:}return db[_0x7418('0x47')][_0x7418('0x4f')][_0x7418('0x50')]('cm_contacts',util[_0x7418('0x51')]('cf_%d',_0x286b5f['id']),_0x4daacd);})[_0x7418('0x20')](function(){return _0x286b5f;});})[_0x7418('0x20')](respondWithResult(_0xd6b5af,0xc9))[_0x7418('0x3f')](handleError(_0xd6b5af,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index ddb4b84..1b830c8 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 _0x9322=['bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','cm_custom_fields','lodash','util','../../config/logger','api','moment'];(function(_0x553f30,_0x203ce3){var _0x51161d=function(_0x46cbe5){while(--_0x46cbe5){_0x553f30['push'](_0x553f30['shift']());}};_0x51161d(++_0x203ce3);}(_0x9322,0x1f3));var _0x2932=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9322[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x2932('0x0'));var util=require(_0x2932('0x1'));var logger=require(_0x2932('0x2'))(_0x2932('0x3'));var moment=require(_0x2932('0x4'));var BPromise=require(_0x2932('0x5'));var rp=require(_0x2932('0x6'));var fs=require('fs');var path=require(_0x2932('0x7'));var rimraf=require('rimraf');var config=require(_0x2932('0x8'));var attributes=require(_0x2932('0x9'));module[_0x2932('0xa')]=function(_0xbab8c1,_0x581f27){return _0xbab8c1['define']('CmCustomField',attributes,{'tableName':_0x2932('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81f9=['util','../../config/logger','api','moment','bluebird','path','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash'];(function(_0x127b4a,_0x2279a6){var _0x29736b=function(_0x5f4eb1){while(--_0x5f4eb1){_0x127b4a['push'](_0x127b4a['shift']());}};_0x29736b(++_0x2279a6);}(_0x81f9,0x133));var _0x981f=function(_0x37d9b1,_0x358b0d){_0x37d9b1=_0x37d9b1-0x0;var _0x580044=_0x81f9[_0x37d9b1];return _0x580044;};'use strict';var _=require(_0x981f('0x0'));var util=require(_0x981f('0x1'));var logger=require(_0x981f('0x2'))(_0x981f('0x3'));var moment=require(_0x981f('0x4'));var BPromise=require(_0x981f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x981f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x981f('0x7'));module[_0x981f('0x8')]=function(_0x6e4703,_0x4c5919){return _0x6e4703[_0x981f('0x9')]('CmCustomField',attributes,{'tableName':_0x981f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index a300fe5..9160305 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 _0x32a4=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x32a4,0x14c));var _0x432a=function(_0x1519ec,_0x26ab64){_0x1519ec=_0x1519ec-0x0;var _0x4ebabc=_0x32a4[_0x1519ec];return _0x4ebabc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x432a('0x0'));var BPromise=require('bluebird');var rs=require(_0x432a('0x1'));var fs=require('fs');var Redis=require(_0x432a('0x2'));var db=require(_0x432a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x432a('0x4'))(_0x432a('0x5'));var config=require(_0x432a('0x6'));var jayson=require(_0x432a('0x7'));var client=jayson['client'][_0x432a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5607a6,_0x4ca349,_0x3c2155){return new BPromise(function(_0x4a1156,_0xfba9db){return client['request'](_0x5607a6,_0x3c2155)[_0x432a('0x9')](function(_0x52313a){logger[_0x432a('0xa')](_0x432a('0xb'),_0x4ca349,_0x432a('0xc'));logger['debug'](_0x432a('0xd'),_0x4ca349,'request\x20sent',JSON[_0x432a('0xe')](_0x52313a));if(_0x52313a['error']){if(_0x52313a[_0x432a('0xf')]['code']===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x4ca349,_0x52313a[_0x432a('0xf')][_0x432a('0x10')]);return _0xfba9db(_0x52313a[_0x432a('0xf')]['message']);}logger['error'](_0x432a('0xb'),_0x4ca349,_0x52313a[_0x432a('0xf')][_0x432a('0x10')]);return _0x4a1156(_0x52313a['error'][_0x432a('0x10')]);}else{logger[_0x432a('0xa')]('CmCustomField,\x20%s,\x20%s',_0x4ca349,'request\x20sent');_0x4a1156(_0x52313a[_0x432a('0x11')][_0x432a('0x10')]);}})[_0x432a('0x12')](function(_0x63e186){logger[_0x432a('0xf')](_0x432a('0xb'),_0x4ca349,_0x63e186);_0xfba9db(_0x63e186);});});} \ No newline at end of file +var _0xd7e8=['../../config/environment','client','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3e45ed,_0x58552c){var _0x5f5a72=function(_0x32d892){while(--_0x32d892){_0x3e45ed['push'](_0x3e45ed['shift']());}};_0x5f5a72(++_0x58552c);}(_0xd7e8,0x98));var _0x8d7e=function(_0x2e9fbd,_0x50d4f5){_0x2e9fbd=_0x2e9fbd-0x0;var _0x367731=_0xd7e8[_0x2e9fbd];return _0x367731;};'use strict';var _=require(_0x8d7e('0x0'));var util=require('util');var moment=require(_0x8d7e('0x1'));var BPromise=require(_0x8d7e('0x2'));var rs=require(_0x8d7e('0x3'));var fs=require('fs');var Redis=require(_0x8d7e('0x4'));var db=require(_0x8d7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d7e('0x6'))(_0x8d7e('0x7'));var config=require(_0x8d7e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8d7e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34c0c5,_0x4e1d68,_0x3f5381){return new BPromise(function(_0x43a4d6,_0x54cde9){return client[_0x8d7e('0xa')](_0x34c0c5,_0x3f5381)['then'](function(_0x502f4a){logger['info'](_0x8d7e('0xb'),_0x4e1d68,_0x8d7e('0xc'));logger[_0x8d7e('0xd')](_0x8d7e('0xe'),_0x4e1d68,_0x8d7e('0xc'),JSON[_0x8d7e('0xf')](_0x502f4a));if(_0x502f4a[_0x8d7e('0x10')]){if(_0x502f4a['error'][_0x8d7e('0x11')]===0x1f4){logger['error'](_0x8d7e('0xb'),_0x4e1d68,_0x502f4a[_0x8d7e('0x10')]['message']);return _0x54cde9(_0x502f4a[_0x8d7e('0x10')][_0x8d7e('0x12')]);}logger[_0x8d7e('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4e1d68,_0x502f4a[_0x8d7e('0x10')][_0x8d7e('0x12')]);return _0x43a4d6(_0x502f4a[_0x8d7e('0x10')][_0x8d7e('0x12')]);}else{logger[_0x8d7e('0x13')]('CmCustomField,\x20%s,\x20%s',_0x4e1d68,_0x8d7e('0xc'));_0x43a4d6(_0x502f4a['result'][_0x8d7e('0x12')]);}})['catch'](function(_0x5a09f6){logger[_0x8d7e('0x10')](_0x8d7e('0xb'),_0x4e1d68,_0x5a09f6);_0x54cde9(_0x5a09f6);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 52e4a47..4cd5e41 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 _0xe198=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get'];(function(_0x32776a,_0x592b3b){var _0x4e4c3f=function(_0x328a00){while(--_0x328a00){_0x32776a['push'](_0x32776a['shift']());}};_0x4e4c3f(++_0x592b3b);}(_0xe198,0x6f));var _0x8e19=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xe198[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e19('0x2'));var router=express[_0x8e19('0x3')]();var fs_extra=require(_0x8e19('0x4'));var auth=require(_0x8e19('0x5'));var interaction=require(_0x8e19('0x6'));var config=require('../../config/environment');var controller=require(_0x8e19('0x7'));router[_0x8e19('0x8')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xa')]);router[_0x8e19('0x8')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xc')]);router[_0x8e19('0xd')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xe')]);router[_0x8e19('0xf')](_0x8e19('0xb'),auth['isAuthenticated'](),controller[_0x8e19('0x10')]);router[_0x8e19('0x11')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0x12')]);module[_0x8e19('0x13')]=router; \ No newline at end of file +var _0x04f1=['get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','index'];(function(_0x518189,_0x280941){var _0x14f749=function(_0x3c1318){while(--_0x3c1318){_0x518189['push'](_0x518189['shift']());}};_0x14f749(++_0x280941);}(_0x04f1,0x92));var _0x104f=function(_0x4de837,_0x2ba794){_0x4de837=_0x4de837-0x0;var _0x34b74e=_0x04f1[_0x4de837];return _0x34b74e;};'use strict';var multer=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var path=require(_0x104f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x104f('0x3')]();var fs_extra=require(_0x104f('0x4'));var auth=require(_0x104f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x104f('0x6')]);router[_0x104f('0x7')](_0x104f('0x8'),auth[_0x104f('0x9')](),controller['show']);router[_0x104f('0xa')]('/',auth[_0x104f('0x9')](),controller[_0x104f('0xb')]);router[_0x104f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x104f('0xd')]);router[_0x104f('0xe')](_0x104f('0x8'),auth[_0x104f('0x9')](),controller[_0x104f('0xf')]);module[_0x104f('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index d74f0aa..977c597 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 _0xe1a3=['BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0xb6ec75,_0xa415c3){var _0x5bbc02=function(_0x1489bb){while(--_0x1489bb){_0xb6ec75['push'](_0xb6ec75['shift']());}};_0x5bbc02(++_0xa415c3);}(_0xe1a3,0xf7));var _0x3e1a=function(_0x3bc738,_0x40ed05){_0x3bc738=_0x3bc738-0x0;var _0x3563b4=_0xe1a3[_0x3bc738];return _0x3563b4;};'use strict';var moment=require(_0x3e1a('0x0'));var Sequelize=require(_0x3e1a('0x1'));module[_0x3e1a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x3e1a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3e1a('0x4')],'defaultValue':moment()['format'](_0x3e1a('0x5'))},'countbusyretry':{'type':Sequelize[_0x3e1a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3e1a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3e1a('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3e1a('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e1a('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3e1a('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3e1a('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3e1a('0x6')],'unique':_0x3e1a('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3e1a('0x9')},'UserId':{'type':Sequelize[_0x3e1a('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x3e1a('0x6')],'unique':_0x3e1a('0x9')},'CampaignId':{'type':Sequelize[_0x3e1a('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x3e1a('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3e1a('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3e1a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8198=['sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue'];(function(_0x1ab858,_0x4f02ae){var _0x4bca87=function(_0x13a82c){while(--_0x13a82c){_0x1ab858['push'](_0x1ab858['shift']());}};_0x4bca87(++_0x4f02ae);}(_0x8198,0xe6));var _0x8819=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x8198[_0x3cf5a3];return _0x39ba2d;};'use strict';var moment=require('moment');var Sequelize=require(_0x8819('0x0'));module[_0x8819('0x1')]={'phone':{'type':Sequelize[_0x8819('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8819('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x8819('0x4')](_0x8819('0x5'))},'countbusyretry':{'type':Sequelize[_0x8819('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8819('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8819('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8819('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8819('0x7')]},'priority':{'type':Sequelize[_0x8819('0x6')](0x2)[_0x8819('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x8819('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8819('0x6')],'unique':_0x8819('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x8819('0x9')},'UserId':{'type':Sequelize[_0x8819('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x8819('0x9')},'CampaignId':{'type':Sequelize[_0x8819('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x8819('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8819('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8819('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8819('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8819('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index c748d69..5938d71 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 _0xd33b=['rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','then','error','send','index','map','CmHopper','rawAttributes','model','name','query','keys','intersection','filters','$and','$or','$gt','$gte','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','show','options','find','catch','create','body','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Company','CmList','List','dialActive','getOpenContacts','isNumber','json','entity\x20not\x20found','eml-format'];(function(_0xf774a6,_0x3ec242){var _0x57749a=function(_0x978429){while(--_0x978429){_0xf774a6['push'](_0xf774a6['shift']());}};_0x57749a(++_0x3ec242);}(_0xd33b,0x1af));var _0xbd33=function(_0xa0f946,_0xd6b003){_0xa0f946=_0xa0f946-0x0;var _0x4a5379=_0xd33b[_0xa0f946];return _0x4a5379;};'use strict';var emlformat=require(_0xbd33('0x0'));var rimraf=require(_0xbd33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd33('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbd33('0x3'));var util=require(_0xbd33('0x4'));var path=require('path');var sox=require(_0xbd33('0x5'));var csv=require(_0xbd33('0x6'));var ejs=require(_0xbd33('0x7'));var fs=require('fs');var fs_extra=require(_0xbd33('0x8'));var _=require('lodash');var squel=require(_0xbd33('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd33('0xa'));var deskjs=require(_0xbd33('0xb'));var toCsv=require(_0xbd33('0x6'));var querystring=require(_0xbd33('0xc'));var Papa=require(_0xbd33('0xd'));var Redis=require(_0xbd33('0xe'));var authService=require(_0xbd33('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbd33('0x10'));var hardwareService=require(_0xbd33('0x11'));var logger=require('../../config/logger')(_0xbd33('0x12'));var utils=require(_0xbd33('0x13'));var config=require(_0xbd33('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd33('0x15'))['db'];function respondWithStatusCode(_0x3cba28,_0x40f1f6){_0x40f1f6=_0x40f1f6||0xcc;return function(_0x335fb0){if(_0x335fb0){return _0x3cba28[_0xbd33('0x16')](_0x40f1f6);}return _0x3cba28[_0xbd33('0x17')](_0x40f1f6)[_0xbd33('0x18')]();};}function respondWithResult(_0x4bfcde,_0x16dcbe){_0x16dcbe=_0x16dcbe||0xc8;return function(_0x3ba02b){if(_0x3ba02b){return _0x4bfcde[_0xbd33('0x17')](_0x16dcbe)['json'](_0x3ba02b);}};}function respondWithFilteredResult(_0x5130a0,_0x576356){return function(_0x519694){if(_0x519694){var _0x3f5964=typeof _0x576356[_0xbd33('0x19')]==='undefined'&&typeof _0x576356[_0xbd33('0x1a')]===_0xbd33('0x1b');var _0x4791b0=_0x519694[_0xbd33('0x1c')];var _0x381a36=_0x3f5964?0x0:_0x576356[_0xbd33('0x19')];var _0xcd198f=_0x3f5964?_0x519694['count']:_0x576356[_0xbd33('0x19')]+_0x576356[_0xbd33('0x1a')];var _0x1586c2;if(_0xcd198f>=_0x4791b0){_0xcd198f=_0x4791b0;_0x1586c2=0xc8;}else{_0x1586c2=0xce;}_0x5130a0[_0xbd33('0x17')](_0x1586c2);return _0x5130a0[_0xbd33('0x1d')](_0xbd33('0x1e'),_0x381a36+'-'+_0xcd198f+'/'+_0x4791b0)['json'](_0x519694);}return null;};}function patchUpdates(_0x52aa09){return function(_0x5a177a){try{jsonpatch[_0xbd33('0x1f')](_0x5a177a,_0x52aa09,!![]);}catch(_0x3f3c12){return BPromise['reject'](_0x3f3c12);}return _0x5a177a['save']();};}function saveUpdates(_0x4d021a,_0x48f4af){return function(_0x9c2f99){if(_0x9c2f99){return _0x9c2f99['update'](_0x4d021a)[_0xbd33('0x20')](function(_0x1a0dcd){return _0x1a0dcd;});}return null;};}function removeEntity(_0x11f6a1,_0x2bfeac){return function(_0x3c1332){if(_0x3c1332){return _0x3c1332['destroy']()['then'](function(){_0x11f6a1[_0xbd33('0x17')](0xcc)[_0xbd33('0x18')]();});}};}function handleEntityNotFound(_0x349a44,_0x142253){return function(_0x1be515){if(!_0x1be515){_0x349a44[_0xbd33('0x16')](0x194);}return _0x1be515;};}function handleError(_0x2ccdcb,_0x2e3ab1){_0x2e3ab1=_0x2e3ab1||0x1f4;return function(_0x27325d){logger[_0xbd33('0x21')](_0x27325d['stack']);if(_0x27325d['name']){delete _0x27325d['name'];}_0x2ccdcb[_0xbd33('0x17')](_0x2e3ab1)[_0xbd33('0x22')](_0x27325d);};}exports[_0xbd33('0x23')]=function(_0x22a9c9,_0x11105f){var _0x343068={},_0x47ce9f={},_0x30848c={'count':0x0,'rows':[]};var _0x3806c3=_[_0xbd33('0x24')](db[_0xbd33('0x25')][_0xbd33('0x26')],function(_0x29204f){return{'name':_0x29204f['fieldName'],'type':_0x29204f['type']['key']};});_0x47ce9f[_0xbd33('0x27')]=_['map'](_0x3806c3,_0xbd33('0x28'));_0x47ce9f[_0xbd33('0x29')]=_[_0xbd33('0x2a')](_0x22a9c9[_0xbd33('0x29')]);_0x47ce9f['filters']=_[_0xbd33('0x2b')](_0x47ce9f[_0xbd33('0x27')],_0x47ce9f['query']);_0x47ce9f[_0xbd33('0x2c')]=_['concat'](_0x47ce9f[_0xbd33('0x2c')],[_0xbd33('0x2d'),_0xbd33('0x2e'),_0xbd33('0x2f'),_0xbd33('0x30'),'$lt',_0xbd33('0x31'),'$ne',_0xbd33('0x32'),_0xbd33('0x33'),_0xbd33('0x34'),_0xbd33('0x35'),_0xbd33('0x36'),_0xbd33('0x37'),_0xbd33('0x38'),_0xbd33('0x39'),_0xbd33('0x3a'),_0xbd33('0x3b'),_0xbd33('0x38'),_0xbd33('0x3c'),_0xbd33('0x3d'),'$contained',_0xbd33('0x3e')]);_0x343068[_0xbd33('0x3f')]=_[_0xbd33('0x2b')](_0x47ce9f[_0xbd33('0x27')],qs['fields'](_0x22a9c9[_0xbd33('0x29')][_0xbd33('0x40')]));_0x343068[_0xbd33('0x3f')]=_0x343068['attributes'][_0xbd33('0x41')]?_0x343068['attributes']:_0x47ce9f['model'];if(!_0x22a9c9[_0xbd33('0x29')][_0xbd33('0x42')](_0xbd33('0x43'))){_0x343068[_0xbd33('0x1a')]=qs['limit'](_0x22a9c9[_0xbd33('0x29')][_0xbd33('0x1a')]);_0x343068[_0xbd33('0x19')]=qs[_0xbd33('0x19')](_0x22a9c9[_0xbd33('0x29')][_0xbd33('0x19')]);}_0x343068[_0xbd33('0x44')]=qs[_0xbd33('0x45')](_0x22a9c9['query'][_0xbd33('0x45')]);_0x343068['where']=qs[_0xbd33('0x2c')](_[_0xbd33('0x46')](_0x22a9c9[_0xbd33('0x29')],_0x47ce9f[_0xbd33('0x2c')]),_0x3806c3);if(_0x22a9c9[_0xbd33('0x29')]['filter']){_0x343068[_0xbd33('0x47')]=_[_0xbd33('0x48')](_0x343068[_0xbd33('0x47')],{'$or':_[_0xbd33('0x24')](_0x3806c3,function(_0x1e70d2){if(_0x1e70d2[_0xbd33('0x49')]!==_0xbd33('0x4a')){var _0x2204b0={};_0x2204b0[_0x1e70d2[_0xbd33('0x28')]]={'$like':'%'+_0x22a9c9['query'][_0xbd33('0x4b')]+'%'};return _0x2204b0;}})});}_0x343068=_['merge']({},_0x343068,_0x22a9c9['options']);var _0x14ee8a={'where':_0x343068[_0xbd33('0x47')]};return db['CmHopper'][_0xbd33('0x1c')](_0x14ee8a)[_0xbd33('0x20')](function(_0x4be30d){_0x30848c[_0xbd33('0x1c')]=_0x4be30d;if(_0x22a9c9[_0xbd33('0x29')][_0xbd33('0x4c')]){_0x343068[_0xbd33('0x4d')]=[{'all':!![]}];}return db[_0xbd33('0x25')][_0xbd33('0x4e')](_0x343068);})[_0xbd33('0x20')](function(_0x55062c){_0x30848c['rows']=_0x55062c;return _0x30848c;})[_0xbd33('0x20')](respondWithFilteredResult(_0x11105f,_0x343068))['catch'](handleError(_0x11105f,null));};exports[_0xbd33('0x4f')]=function(_0x46b98c,_0x556be5){var _0x37ef88={'raw':!![],'where':{'id':_0x46b98c['params']['id']}},_0x4ce968={};_0x4ce968[_0xbd33('0x27')]=_[_0xbd33('0x2a')](db[_0xbd33('0x25')][_0xbd33('0x26')]);_0x4ce968[_0xbd33('0x29')]=_[_0xbd33('0x2a')](_0x46b98c[_0xbd33('0x29')]);_0x4ce968[_0xbd33('0x2c')]=_['intersection'](_0x4ce968[_0xbd33('0x27')],_0x4ce968[_0xbd33('0x29')]);_0x37ef88['attributes']=_[_0xbd33('0x2b')](_0x4ce968[_0xbd33('0x27')],qs[_0xbd33('0x40')](_0x46b98c[_0xbd33('0x29')][_0xbd33('0x40')]));_0x37ef88[_0xbd33('0x3f')]=_0x37ef88[_0xbd33('0x3f')][_0xbd33('0x41')]?_0x37ef88[_0xbd33('0x3f')]:_0x4ce968[_0xbd33('0x27')];if(_0x46b98c['query'][_0xbd33('0x4c')]){_0x37ef88[_0xbd33('0x4d')]=[{'all':!![]}];}_0x37ef88=_[_0xbd33('0x48')]({},_0x37ef88,_0x46b98c[_0xbd33('0x50')]);return db[_0xbd33('0x25')][_0xbd33('0x51')](_0x37ef88)[_0xbd33('0x20')](handleEntityNotFound(_0x556be5,null))['then'](respondWithResult(_0x556be5,null))[_0xbd33('0x52')](handleError(_0x556be5,null));};exports[_0xbd33('0x53')]=function(_0x5e6677,_0x2ddce4){return db['CmHopper'][_0xbd33('0x53')](_0x5e6677[_0xbd33('0x54')],{})[_0xbd33('0x20')](respondWithResult(_0x2ddce4,0xc9))['catch'](handleError(_0x2ddce4,null));};exports['update']=function(_0x31b1a0,_0x4a8bb8){if(_0x31b1a0['body']['id']){delete _0x31b1a0[_0xbd33('0x54')]['id'];}return db[_0xbd33('0x25')]['find']({'where':{'id':_0x31b1a0[_0xbd33('0x55')]['id']}})['then'](handleEntityNotFound(_0x4a8bb8,null))['then'](saveUpdates(_0x31b1a0[_0xbd33('0x54')],null))[_0xbd33('0x20')](respondWithResult(_0x4a8bb8,null))['catch'](handleError(_0x4a8bb8,null));};exports[_0xbd33('0x56')]=function(_0x2e383f,_0x58c233){return db[_0xbd33('0x25')][_0xbd33('0x56')]()[_0xbd33('0x20')](respondWithResult(_0x58c233,null))['catch'](handleError(_0x58c233,null));};exports[_0xbd33('0x57')]=function(_0x3e70b4,_0x5f3cf6){var _0x15bdeb;return db[_0xbd33('0x25')]['find']({'where':{'id':_0x3e70b4[_0xbd33('0x55')]['id']}})[_0xbd33('0x20')](handleEntityNotFound(_0x5f3cf6,null))[_0xbd33('0x20')](function(_0x365c71){if(_0x365c71){return _0x365c71['destroy']()[_0xbd33('0x20')](function(_0x282250){return _0x282250;});}})[_0xbd33('0x20')](function(_0x4ce0fd){_0x15bdeb=_0x4ce0fd;if(_0x4ce0fd){if(_0x4ce0fd['VoiceQueueId']||_0x4ce0fd[_0xbd33('0x58')]){return db[_0x4ce0fd[_0xbd33('0x59')]?_0xbd33('0x5a'):_0xbd33('0x5b')][_0xbd33('0x51')]({'where':{'id':_0x4ce0fd[_0xbd33('0x59')]?_0x4ce0fd['VoiceQueueId']:_0x4ce0fd[_0xbd33('0x58')]},'attributes':['id','name'],'raw':!![]});}}})[_0xbd33('0x20')](function(_0x42a8d8){var _0x58ec02={};if(_0x42a8d8){_[_0xbd33('0x48')](_0x58ec02,_[_0xbd33('0x5c')](_0x15bdeb['dataValues'],[_0xbd33('0x5d'),'updatedAt','id']));_0x58ec02[_0xbd33('0x5e')]=0x15;_0x58ec02[_0xbd33('0x5f')]=_0xbd33('0x60');_0x58ec02[_0xbd33('0x61')]=_0x42a8d8[_0xbd33('0x28')];_0x58ec02[_0xbd33('0x62')]=_0x3e70b4[_0xbd33('0x63')][_0xbd33('0x28')];_0x58ec02[_0xbd33('0x64')]=_0x3e70b4[_0xbd33('0x63')]['id'];_0x58ec02[_0xbd33('0x60')]=!![];_0x58ec02['deletedat']=moment()[_0xbd33('0x65')](_0xbd33('0x66'));_0x58ec02[_0xbd33('0x67')]=_0x15bdeb[_0xbd33('0x68')];_0x58ec02[_0xbd33('0x69')]=_0x15bdeb[_0xbd33('0x59')]?_0xbd33('0x6a'):'ivr';return db[_0xbd33('0x6b')][_0xbd33('0x51')]({'where':{'id':_0x58ec02[_0xbd33('0x6c')]},'attributes':[_0xbd33('0x6d'),'lastName']})[_0xbd33('0x20')](function(_0x2346c6){if(!_[_0xbd33('0x6e')](_0x5f3cf6)&&!_[_0xbd33('0x6e')](_0x2346c6[_0xbd33('0x6d')])){_0x58ec02[_0xbd33('0x6f')]=_0x2346c6[_0xbd33('0x6d')];if(!_[_0xbd33('0x6e')](_0x2346c6['lastName'])){_0x58ec02[_0xbd33('0x6f')]+='\x20'+_0x2346c6[_0xbd33('0x70')];}}})[_0xbd33('0x71')](function(){return db[_0xbd33('0x72')][_0xbd33('0x53')](_0x58ec02);});}})[_0xbd33('0x20')](function(){return _0x5f3cf6[_0xbd33('0x17')](0xcc)[_0xbd33('0x18')]();})[_0xbd33('0x52')](handleError(_0x5f3cf6,null));};exports[_0xbd33('0x73')]=function(_0x1fa444,_0x1f8757,_0x3ebb55){var _0x2930c0=[];return db[_0xbd33('0x6b')][_0xbd33('0x56')]()[_0xbd33('0x20')](function(_0x1cc42d){_0x2930c0=_[_0xbd33('0x2a')](_0x1cc42d);return _0x1fa444[_0xbd33('0x63')][_0xbd33('0x74')]({'where':{'type':_0xbd33('0x75'),'dialActive':!![],'dialMethod':_0xbd33('0x76')},'attributes':['id','dialOrderByScheduledAt',_0xbd33('0x77')],'raw':!![]});})[_0xbd33('0x20')](function(_0x3ab0a7){if(_0x3ab0a7&&_0x3ab0a7[_0xbd33('0x41')]){return db['sequelize']['transaction'](function(_0x1de76f){var _0xf63ff0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbd33('0x65')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3ab0a7,'id')},'$or':[{'UserId':null},{'UserId':_0x1fa444['user']['id']}]};var _0x58781b={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3ab0a7)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xbd33('0x24')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x1fa444['user']['id']}]};var _0x571a51={'$or':[_0xf63ff0,_0x58781b]};var _0xd2e1fb=[];if(_0x1fa444['body']['direction']&&_0x1fa444['body'][_0xbd33('0x78')]===_0xbd33('0x79')){if(!_[_0xbd33('0x7a')](_0x1fa444['body']['hopperIds'])){_0x571a51['id']={'$in':_0x1fa444[_0xbd33('0x54')][_0xbd33('0x7b')]};}_0xd2e1fb=[[_0xbd33('0x7c'),_0xbd33('0x7d')],[_0xbd33('0x7e'),_0x3ab0a7[0x0]['dialOrderByScheduledAt']===_0xbd33('0x7d')?'DESC':_0xbd33('0x7d')],db[_0xbd33('0x7f')][_0xbd33('0x80')](_0xbd33('0x81')),['id','DESC']];}else{if(!_[_0xbd33('0x7a')](_0x1fa444['body'][_0xbd33('0x7b')])){_0x571a51['id']={'$notIn':_0x1fa444[_0xbd33('0x54')]['hopperIds']};}_0xd2e1fb=[['priority',_0xbd33('0x82')],[_0xbd33('0x7e'),_0x3ab0a7[0x0]['dialOrderByScheduledAt']],db[_0xbd33('0x7f')][_0xbd33('0x80')](_0xbd33('0x83')),['id',_0xbd33('0x7d')]];}return db[_0xbd33('0x25')][_0xbd33('0x84')]({'attributes':['id',_0xbd33('0x85'),_0xbd33('0x86')],'where':_0x571a51,'order':_0xd2e1fb,'transaction':_0x1de76f,'lock':_0x1de76f['LOCK'][_0xbd33('0x87')],'include':[{'model':db[_0xbd33('0x6b')],'as':'Contact','attributes':_0x2930c0,'include':[{'model':db['CmCompany'],'as':_0xbd33('0x88'),'attributes':['id','name']}]},{'model':db[_0xbd33('0x89')],'as':_0xbd33('0x8a'),'attributes':['id','name']},{'model':db[_0xbd33('0x5a')],'as':'Queue','attributes':['id',_0xbd33('0x28'),_0xbd33('0x8b')]}]})[_0xbd33('0x20')](function(_0x38ce93){if(_0x38ce93){return _0x38ce93['update']({'UserId':_0x1fa444['user']['id']},{'transaction':_0x1de76f});}});});}})['then'](handleEntityNotFound(_0x1f8757,null))[_0xbd33('0x20')](respondWithResult(_0x1f8757,null))[_0xbd33('0x52')](handleError(_0x1f8757,null));};exports[_0xbd33('0x8c')]=function(_0x2e6acf,_0xbbad84,_0x12e1e0){return _0x2e6acf['user'][_0xbd33('0x74')]({'where':{'type':_0xbd33('0x75'),'dialActive':!![],'dialMethod':_0xbd33('0x76')},'attributes':['id'],'raw':!![]})[_0xbd33('0x20')](function(_0xfe1e1f){if(_0xfe1e1f&&_0xfe1e1f[_0xbd33('0x41')]){return db[_0xbd33('0x25')][_0xbd33('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xbd33('0x66'))},'VoiceQueueId':{'$in':_[_0xbd33('0x24')](_0xfe1e1f,'id')},'$or':[{'UserId':null},{'UserId':_0x2e6acf['user']['id']}]}});}return 0x0;})[_0xbd33('0x20')](function(_0x52f2c0){if(!_[_0xbd33('0x6e')](_0x52f2c0)&&_[_0xbd33('0x8d')](_0x52f2c0)){return _0xbbad84['status'](0xc8)[_0xbd33('0x8e')]({'contacts':_0x52f2c0});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0xbd33('0x8c'),0x194,_0xbd33('0x8f'));_0xbbad84[_0xbd33('0x16')](0x194);}})['catch'](handleError(_0xbbad84,null));}; \ No newline at end of file +var _0xc62c=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','query','keys','filters','intersection','model','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','create','body','find','describe','VoiceQueueId','Campaign','CampaignId','omit','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','filter','value','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir'];(function(_0x332dc0,_0x4c8fc8){var _0x19c823=function(_0x1dfc48){while(--_0x1dfc48){_0x332dc0['push'](_0x332dc0['shift']());}};_0x19c823(++_0x4c8fc8);}(_0xc62c,0x1c2));var _0xcc62=function(_0x15cef9,_0x2bd04d){_0x15cef9=_0x15cef9-0x0;var _0x419f21=_0xc62c[_0x15cef9];return _0x419f21;};'use strict';var emlformat=require(_0xcc62('0x0'));var rimraf=require(_0xcc62('0x1'));var zipdir=require(_0xcc62('0x2'));var jsonpatch=require(_0xcc62('0x3'));var rp=require('request-promise');var moment=require(_0xcc62('0x4'));var BPromise=require(_0xcc62('0x5'));var Mustache=require(_0xcc62('0x6'));var util=require(_0xcc62('0x7'));var path=require(_0xcc62('0x8'));var sox=require(_0xcc62('0x9'));var csv=require(_0xcc62('0xa'));var ejs=require(_0xcc62('0xb'));var fs=require('fs');var fs_extra=require(_0xcc62('0xc'));var _=require('lodash');var squel=require(_0xcc62('0xd'));var crypto=require('crypto');var jsforce=require(_0xcc62('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc62('0xa'));var querystring=require(_0xcc62('0xf'));var Papa=require(_0xcc62('0x10'));var Redis=require(_0xcc62('0x11'));var authService=require(_0xcc62('0x12'));var qs=require(_0xcc62('0x13'));var as=require(_0xcc62('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcc62('0x15'));var utils=require('../../config/utils');var config=require(_0xcc62('0x16'));var licenseUtil=require(_0xcc62('0x17'));var db=require(_0xcc62('0x18'))['db'];function respondWithStatusCode(_0xd8b6bc,_0x34f9fe){_0x34f9fe=_0x34f9fe||0xcc;return function(_0x353bbe){if(_0x353bbe){return _0xd8b6bc[_0xcc62('0x19')](_0x34f9fe);}return _0xd8b6bc[_0xcc62('0x1a')](_0x34f9fe)[_0xcc62('0x1b')]();};}function respondWithResult(_0x2e1b41,_0x1401d4){_0x1401d4=_0x1401d4||0xc8;return function(_0x379508){if(_0x379508){return _0x2e1b41['status'](_0x1401d4)[_0xcc62('0x1c')](_0x379508);}};}function respondWithFilteredResult(_0x376452,_0x4c31d4){return function(_0x1e452f){if(_0x1e452f){var _0x1dae87=typeof _0x4c31d4[_0xcc62('0x1d')]===_0xcc62('0x1e')&&typeof _0x4c31d4[_0xcc62('0x1f')]===_0xcc62('0x1e');var _0x22f7ec=_0x1e452f['count'];var _0x5ab8f3=_0x1dae87?0x0:_0x4c31d4[_0xcc62('0x1d')];var _0x4800e1=_0x1dae87?_0x1e452f[_0xcc62('0x20')]:_0x4c31d4['offset']+_0x4c31d4['limit'];var _0x299936;if(_0x4800e1>=_0x22f7ec){_0x4800e1=_0x22f7ec;_0x299936=0xc8;}else{_0x299936=0xce;}_0x376452[_0xcc62('0x1a')](_0x299936);return _0x376452['set'](_0xcc62('0x21'),_0x5ab8f3+'-'+_0x4800e1+'/'+_0x22f7ec)['json'](_0x1e452f);}return null;};}function patchUpdates(_0x368a00){return function(_0x152287){try{jsonpatch[_0xcc62('0x22')](_0x152287,_0x368a00,!![]);}catch(_0x59b015){return BPromise[_0xcc62('0x23')](_0x59b015);}return _0x152287['save']();};}function saveUpdates(_0x1de903,_0x185826){return function(_0x4cae7f){if(_0x4cae7f){return _0x4cae7f[_0xcc62('0x24')](_0x1de903)[_0xcc62('0x25')](function(_0xad9361){return _0xad9361;});}return null;};}function removeEntity(_0x5ec849,_0x5cd6ea){return function(_0x4d1dd1){if(_0x4d1dd1){return _0x4d1dd1[_0xcc62('0x26')]()['then'](function(){_0x5ec849['status'](0xcc)[_0xcc62('0x1b')]();});}};}function handleEntityNotFound(_0x30c182,_0xe8f37a){return function(_0x586834){if(!_0x586834){_0x30c182['sendStatus'](0x194);}return _0x586834;};}function handleError(_0x315762,_0x31aacd){_0x31aacd=_0x31aacd||0x1f4;return function(_0x33b11a){logger['error'](_0x33b11a[_0xcc62('0x27')]);if(_0x33b11a[_0xcc62('0x28')]){delete _0x33b11a[_0xcc62('0x28')];}_0x315762[_0xcc62('0x1a')](_0x31aacd)['send'](_0x33b11a);};}exports[_0xcc62('0x29')]=function(_0x4aa5a2,_0x325c80){var _0x4f5bd1={},_0x14d003={},_0x4893e8={'count':0x0,'rows':[]};var _0x1c5a51=_[_0xcc62('0x2a')](db[_0xcc62('0x2b')][_0xcc62('0x2c')],function(_0x48daf0){return{'name':_0x48daf0[_0xcc62('0x2d')],'type':_0x48daf0[_0xcc62('0x2e')]['key']};});_0x14d003['model']=_[_0xcc62('0x2a')](_0x1c5a51,_0xcc62('0x28'));_0x14d003[_0xcc62('0x2f')]=_[_0xcc62('0x30')](_0x4aa5a2['query']);_0x14d003[_0xcc62('0x31')]=_[_0xcc62('0x32')](_0x14d003[_0xcc62('0x33')],_0x14d003['query']);_0x14d003[_0xcc62('0x31')]=_[_0xcc62('0x34')](_0x14d003['filters'],[_0xcc62('0x35'),_0xcc62('0x36'),_0xcc62('0x37'),_0xcc62('0x38'),_0xcc62('0x39'),_0xcc62('0x3a'),_0xcc62('0x3b'),'$eq',_0xcc62('0x3c'),_0xcc62('0x3d'),'$notBetween','$in','$notIn',_0xcc62('0x3e'),_0xcc62('0x3f'),_0xcc62('0x40'),_0xcc62('0x41'),_0xcc62('0x3e'),_0xcc62('0x42'),_0xcc62('0x43'),_0xcc62('0x44'),_0xcc62('0x45')]);_0x4f5bd1[_0xcc62('0x46')]=_['intersection'](_0x14d003[_0xcc62('0x33')],qs[_0xcc62('0x47')](_0x4aa5a2[_0xcc62('0x2f')][_0xcc62('0x47')]));_0x4f5bd1[_0xcc62('0x46')]=_0x4f5bd1[_0xcc62('0x46')][_0xcc62('0x48')]?_0x4f5bd1[_0xcc62('0x46')]:_0x14d003['model'];if(!_0x4aa5a2['query']['hasOwnProperty'](_0xcc62('0x49'))){_0x4f5bd1[_0xcc62('0x1f')]=qs[_0xcc62('0x1f')](_0x4aa5a2[_0xcc62('0x2f')][_0xcc62('0x1f')]);_0x4f5bd1['offset']=qs['offset'](_0x4aa5a2[_0xcc62('0x2f')]['offset']);}_0x4f5bd1[_0xcc62('0x4a')]=qs[_0xcc62('0x4b')](_0x4aa5a2[_0xcc62('0x2f')][_0xcc62('0x4b')]);_0x4f5bd1[_0xcc62('0x4c')]=qs[_0xcc62('0x31')](_['pick'](_0x4aa5a2[_0xcc62('0x2f')],_0x14d003[_0xcc62('0x31')]),_0x1c5a51);if(_0x4aa5a2[_0xcc62('0x2f')]['filter']){_0x4f5bd1[_0xcc62('0x4c')]=_['merge'](_0x4f5bd1[_0xcc62('0x4c')],{'$or':_['map'](_0x1c5a51,function(_0x509301){if(_0x509301[_0xcc62('0x2e')]!==_0xcc62('0x4d')){var _0x92720c={};_0x92720c[_0x509301['name']]={'$like':'%'+_0x4aa5a2['query']['filter']+'%'};return _0x92720c;}})});}_0x4f5bd1=_[_0xcc62('0x4e')]({},_0x4f5bd1,_0x4aa5a2[_0xcc62('0x4f')]);var _0x27c843={'where':_0x4f5bd1['where']};return db[_0xcc62('0x2b')]['count'](_0x27c843)[_0xcc62('0x25')](function(_0x2cf38b){_0x4893e8['count']=_0x2cf38b;if(_0x4aa5a2['query'][_0xcc62('0x50')]){_0x4f5bd1['include']=[{'all':!![]}];}return db[_0xcc62('0x2b')][_0xcc62('0x51')](_0x4f5bd1);})[_0xcc62('0x25')](function(_0x146d57){_0x4893e8['rows']=_0x146d57;return _0x4893e8;})[_0xcc62('0x25')](respondWithFilteredResult(_0x325c80,_0x4f5bd1))[_0xcc62('0x52')](handleError(_0x325c80,null));};exports[_0xcc62('0x53')]=function(_0x40f694,_0x3a94c2){var _0x357fc3={'raw':!![],'where':{'id':_0x40f694[_0xcc62('0x54')]['id']}},_0x397cc8={};_0x397cc8[_0xcc62('0x33')]=_[_0xcc62('0x30')](db[_0xcc62('0x2b')]['rawAttributes']);_0x397cc8[_0xcc62('0x2f')]=_[_0xcc62('0x30')](_0x40f694['query']);_0x397cc8[_0xcc62('0x31')]=_[_0xcc62('0x32')](_0x397cc8[_0xcc62('0x33')],_0x397cc8['query']);_0x357fc3[_0xcc62('0x46')]=_[_0xcc62('0x32')](_0x397cc8[_0xcc62('0x33')],qs[_0xcc62('0x47')](_0x40f694[_0xcc62('0x2f')]['fields']));_0x357fc3[_0xcc62('0x46')]=_0x357fc3[_0xcc62('0x46')][_0xcc62('0x48')]?_0x357fc3[_0xcc62('0x46')]:_0x397cc8[_0xcc62('0x33')];if(_0x40f694[_0xcc62('0x2f')][_0xcc62('0x50')]){_0x357fc3['include']=[{'all':!![]}];}_0x357fc3=_['merge']({},_0x357fc3,_0x40f694['options']);return db[_0xcc62('0x2b')]['find'](_0x357fc3)[_0xcc62('0x25')](handleEntityNotFound(_0x3a94c2,null))[_0xcc62('0x25')](respondWithResult(_0x3a94c2,null))[_0xcc62('0x52')](handleError(_0x3a94c2,null));};exports[_0xcc62('0x55')]=function(_0x5eab48,_0x6f0f48){return db[_0xcc62('0x2b')]['create'](_0x5eab48[_0xcc62('0x56')],{})[_0xcc62('0x25')](respondWithResult(_0x6f0f48,0xc9))[_0xcc62('0x52')](handleError(_0x6f0f48,null));};exports[_0xcc62('0x24')]=function(_0x343cf3,_0x16a025){if(_0x343cf3[_0xcc62('0x56')]['id']){delete _0x343cf3[_0xcc62('0x56')]['id'];}return db['CmHopper'][_0xcc62('0x57')]({'where':{'id':_0x343cf3[_0xcc62('0x54')]['id']}})[_0xcc62('0x25')](handleEntityNotFound(_0x16a025,null))[_0xcc62('0x25')](saveUpdates(_0x343cf3['body'],null))[_0xcc62('0x25')](respondWithResult(_0x16a025,null))[_0xcc62('0x52')](handleError(_0x16a025,null));};exports['describe']=function(_0x5213ce,_0x576c48){return db[_0xcc62('0x2b')][_0xcc62('0x58')]()[_0xcc62('0x25')](respondWithResult(_0x576c48,null))[_0xcc62('0x52')](handleError(_0x576c48,null));};exports[_0xcc62('0x26')]=function(_0x54b52f,_0x13665a){var _0x2ce898;return db['CmHopper'][_0xcc62('0x57')]({'where':{'id':_0x54b52f[_0xcc62('0x54')]['id']}})['then'](handleEntityNotFound(_0x13665a,null))['then'](function(_0x3bcd46){if(_0x3bcd46){return _0x3bcd46[_0xcc62('0x26')]()[_0xcc62('0x25')](function(_0x352e2e){return _0x352e2e;});}})[_0xcc62('0x25')](function(_0x19062b){_0x2ce898=_0x19062b;if(_0x19062b){if(_0x19062b[_0xcc62('0x59')]||_0x19062b['CampaignId']){return db[_0x19062b[_0xcc62('0x59')]?'VoiceQueue':_0xcc62('0x5a')][_0xcc62('0x57')]({'where':{'id':_0x19062b[_0xcc62('0x59')]?_0x19062b['VoiceQueueId']:_0x19062b[_0xcc62('0x5b')]},'attributes':['id',_0xcc62('0x28')],'raw':!![]});}}})[_0xcc62('0x25')](function(_0x7bdbb3){var _0xb0c570={};if(_0x7bdbb3){_['merge'](_0xb0c570,_[_0xcc62('0x5c')](_0x2ce898['dataValues'],['createdAt',_0xcc62('0x5d'),'id']));_0xb0c570[_0xcc62('0x5e')]=0x15;_0xb0c570[_0xcc62('0x5f')]=_0xcc62('0x60');_0xb0c570[_0xcc62('0x61')]=_0x7bdbb3['name'];_0xb0c570['membername']=_0x54b52f['user'][_0xcc62('0x28')];_0xb0c570[_0xcc62('0x62')]=_0x54b52f[_0xcc62('0x63')]['id'];_0xb0c570[_0xcc62('0x60')]=!![];_0xb0c570[_0xcc62('0x64')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xb0c570[_0xcc62('0x65')]=_0x2ce898['phone'];_0xb0c570[_0xcc62('0x66')]=_0x2ce898[_0xcc62('0x59')]?_0xcc62('0x67'):_0xcc62('0x68');return db[_0xcc62('0x69')][_0xcc62('0x57')]({'where':{'id':_0xb0c570[_0xcc62('0x6a')]},'attributes':[_0xcc62('0x6b'),_0xcc62('0x6c')]})[_0xcc62('0x25')](function(_0x50133f){if(!_[_0xcc62('0x6d')](_0x13665a)&&!_[_0xcc62('0x6d')](_0x50133f[_0xcc62('0x6b')])){_0xb0c570['calleridname']=_0x50133f[_0xcc62('0x6b')];if(!_[_0xcc62('0x6d')](_0x50133f[_0xcc62('0x6c')])){_0xb0c570[_0xcc62('0x6e')]+='\x20'+_0x50133f['lastName'];}}})[_0xcc62('0x6f')](function(){return db[_0xcc62('0x70')][_0xcc62('0x55')](_0xb0c570);});}})[_0xcc62('0x25')](function(){return _0x13665a[_0xcc62('0x1a')](0xcc)[_0xcc62('0x1b')]();})[_0xcc62('0x52')](handleError(_0x13665a,null));};exports[_0xcc62('0x71')]=function(_0x1ba3ca,_0x23b72b,_0x10e89b){var _0x43f2a2=[];return db['CmContact']['describe']()[_0xcc62('0x25')](function(_0x264d88){_0x43f2a2=_['keys'](_0x264d88);return _0x1ba3ca[_0xcc62('0x63')][_0xcc62('0x72')]({'where':{'type':_0xcc62('0x73'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xcc62('0x74'),_0xcc62('0x75')],'raw':!![]});})['then'](function(_0x101f01){if(_0x101f01&&_0x101f01[_0xcc62('0x48')]){return db[_0xcc62('0x76')][_0xcc62('0x77')](function(_0x333d27){var _0x214125={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcc62('0x78')](_0xcc62('0x79'))},'VoiceQueueId':{'$in':_['map'](_0x101f01,'id')},'$or':[{'UserId':null},{'UserId':_0x1ba3ca[_0xcc62('0x63')]['id']}]};var _0x957b05={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x101f01)[_0xcc62('0x7a')](['dialPreviewAutoRecallMe',0x0])[_0xcc62('0x2a')]('id')[_0xcc62('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x1ba3ca[_0xcc62('0x63')]['id']}]};var _0x47879a={'$or':[_0x214125,_0x957b05]};var _0x3ce1d8=[];if(_0x1ba3ca[_0xcc62('0x56')][_0xcc62('0x7c')]&&_0x1ba3ca['body'][_0xcc62('0x7c')]===_0xcc62('0x7d')){if(!_[_0xcc62('0x7e')](_0x1ba3ca[_0xcc62('0x56')][_0xcc62('0x7f')])){_0x47879a['id']={'$in':_0x1ba3ca[_0xcc62('0x56')]['hopperIds']};}_0x3ce1d8=[[_0xcc62('0x80'),'ASC'],[_0xcc62('0x81'),_0x101f01[0x0]['dialOrderByScheduledAt']===_0xcc62('0x82')?'DESC':_0xcc62('0x82')],db[_0xcc62('0x76')]['literal'](_0xcc62('0x83')),['id','DESC']];}else{if(!_[_0xcc62('0x7e')](_0x1ba3ca[_0xcc62('0x56')][_0xcc62('0x7f')])){_0x47879a['id']={'$notIn':_0x1ba3ca['body'][_0xcc62('0x7f')]};}_0x3ce1d8=[['priority','DESC'],['scheduledAt',_0x101f01[0x0][_0xcc62('0x74')]],db[_0xcc62('0x76')][_0xcc62('0x84')](_0xcc62('0x85')),['id','ASC']];}return db[_0xcc62('0x2b')][_0xcc62('0x86')]({'attributes':['id',_0xcc62('0x87'),'recallme'],'where':_0x47879a,'order':_0x3ce1d8,'transaction':_0x333d27,'lock':_0x333d27[_0xcc62('0x88')][_0xcc62('0x89')],'include':[{'model':db[_0xcc62('0x69')],'as':_0xcc62('0x8a'),'attributes':_0x43f2a2,'include':[{'model':db[_0xcc62('0x8b')],'as':'Company','attributes':['id','name']}]},{'model':db[_0xcc62('0x8c')],'as':_0xcc62('0x8d'),'attributes':['id',_0xcc62('0x28')]},{'model':db[_0xcc62('0x8e')],'as':_0xcc62('0x8f'),'attributes':['id',_0xcc62('0x28'),_0xcc62('0x90')]}]})[_0xcc62('0x25')](function(_0x269204){if(_0x269204){return _0x269204['update']({'UserId':_0x1ba3ca[_0xcc62('0x63')]['id']},{'transaction':_0x333d27});}});});}})[_0xcc62('0x25')](handleEntityNotFound(_0x23b72b,null))['then'](respondWithResult(_0x23b72b,null))[_0xcc62('0x52')](handleError(_0x23b72b,null));};exports[_0xcc62('0x91')]=function(_0x3e786b,_0xbd37,_0x3f6efa){return _0x3e786b[_0xcc62('0x63')][_0xcc62('0x72')]({'where':{'type':_0xcc62('0x73'),'dialActive':!![],'dialMethod':_0xcc62('0x92')},'attributes':['id'],'raw':!![]})[_0xcc62('0x25')](function(_0x364e22){if(_0x364e22&&_0x364e22['length']){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcc62('0x78')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xcc62('0x2a')](_0x364e22,'id')},'$or':[{'UserId':null},{'UserId':_0x3e786b['user']['id']}]}});}return 0x0;})[_0xcc62('0x25')](function(_0x7878ec){if(!_['isNil'](_0x7878ec)&&_[_0xcc62('0x93')](_0x7878ec)){return _0xbd37['status'](0xc8)[_0xcc62('0x1c')]({'contacts':_0x7878ec});}else{logger[_0xcc62('0x94')](_0xcc62('0x95'),_0xcc62('0x91'),0x194,_0xcc62('0x96'));_0xbd37['sendStatus'](0x194);}})[_0xcc62('0x52')](handleError(_0xbd37,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 36efbed..3e38383 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 _0x814b=['phone','priority','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat'];(function(_0x586642,_0x3b2e5d){var _0xef997a=function(_0x31839a){while(--_0x31839a){_0x586642['push'](_0x586642['shift']());}};_0xef997a(++_0x3b2e5d);}(_0x814b,0x1a2));var _0xb814=function(_0x4392af,_0xec5afe){_0x4392af=_0x4392af-0x0;var _0x9fa8eb=_0x814b[_0x4392af];return _0x9fa8eb;};'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':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]},{'name':_0xb814('0xe'),'fields':[_0xb814('0xe')]},{'name':_0xb814('0xf'),'fields':[_0xb814('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x2aaf68,_0x522680){var _0x479818=function(_0x4378bd){while(--_0x4378bd){_0x2aaf68['push'](_0x2aaf68['shift']());}};_0x479818(++_0x522680);}(_0xeda8,0x104));var _0x8eda=function(_0x10c936,_0xa3200b){_0x10c936=_0x10c936-0x0;var _0x38320b=_0xeda8[_0x10c936];return _0x38320b;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 0e300dd..3cb85e7 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 _0xc368=['\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','all','GetCmHopperPreview','ResetActiveCalls','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopper','CmHopper','options','raw','attributes','limit','include','map','model','catch','ShowCmHopper','find','where','CreateCmHopper','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','UserId','push','includes','length','dataValues','ContactId','GetContactDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format'];(function(_0x2c2ee8,_0x3e6e75){var _0xaad4ae=function(_0x3f4b07){while(--_0x3f4b07){_0x2c2ee8['push'](_0x2c2ee8['shift']());}};_0xaad4ae(++_0x3e6e75);}(_0xc368,0xfa));var _0x8c36=function(_0x420267,_0x2f7415){_0x420267=_0x420267-0x0;var _0x5b1ff1=_0xc368[_0x420267];return _0x5b1ff1;};'use strict';var _=require(_0x8c36('0x0'));var util=require(_0x8c36('0x1'));var moment=require(_0x8c36('0x2'));var BPromise=require(_0x8c36('0x3'));var rs=require(_0x8c36('0x4'));var fs=require('fs');var Redis=require(_0x8c36('0x5'));var db=require(_0x8c36('0x6'))['db'];var utils=require(_0x8c36('0x7'));var logger=require(_0x8c36('0x8'))(_0x8c36('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8c36('0xa')][_0x8c36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe46752,_0x40d285,_0x385021){return new BPromise(function(_0x5e67fb,_0x2e0420){return client[_0x8c36('0xc')](_0xe46752,_0x385021)[_0x8c36('0xd')](function(_0x26115f){logger[_0x8c36('0xe')](_0x8c36('0xf'),_0x40d285,_0x8c36('0x10'));logger[_0x8c36('0x11')](_0x8c36('0x12'),_0x40d285,_0x8c36('0x10'),JSON[_0x8c36('0x13')](_0x26115f));if(_0x26115f['error']){if(_0x26115f[_0x8c36('0x14')][_0x8c36('0x15')]===0x1f4){logger[_0x8c36('0x14')](_0x8c36('0xf'),_0x40d285,_0x26115f[_0x8c36('0x14')][_0x8c36('0x16')]);return _0x2e0420(_0x26115f[_0x8c36('0x14')][_0x8c36('0x16')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x40d285,_0x26115f[_0x8c36('0x14')][_0x8c36('0x16')]);return _0x5e67fb(_0x26115f['error'][_0x8c36('0x16')]);}else{logger[_0x8c36('0xe')](_0x8c36('0xf'),_0x40d285,'request\x20sent');_0x5e67fb(_0x26115f[_0x8c36('0x17')][_0x8c36('0x16')]);}})['catch'](function(_0x526fc3){logger[_0x8c36('0x14')](_0x8c36('0xf'),_0x40d285,_0x526fc3);_0x2e0420(_0x526fc3);});});}exports[_0x8c36('0x18')]=function(_0x348fc2){var _0x4e224d=this;return new Promise(function(_0x294fee,_0x54fb1a){return db[_0x8c36('0x19')]['findAll']({'raw':_0x348fc2[_0x8c36('0x1a')]?_0x348fc2[_0x8c36('0x1a')][_0x8c36('0x1b')]===undefined?!![]:![]:!![],'where':_0x348fc2[_0x8c36('0x1a')]?_0x348fc2['options']['where']||null:null,'attributes':_0x348fc2[_0x8c36('0x1a')]?_0x348fc2[_0x8c36('0x1a')][_0x8c36('0x1c')]||null:null,'limit':_0x348fc2[_0x8c36('0x1a')]?_0x348fc2[_0x8c36('0x1a')][_0x8c36('0x1d')]||null:null,'include':_0x348fc2[_0x8c36('0x1a')]?_0x348fc2[_0x8c36('0x1a')][_0x8c36('0x1e')]?_[_0x8c36('0x1f')](_0x348fc2['options'][_0x8c36('0x1e')],function(_0x58bcd2){return{'model':db[_0x58bcd2[_0x8c36('0x20')]],'as':_0x58bcd2['as'],'attributes':_0x58bcd2['attributes'],'include':_0x58bcd2[_0x8c36('0x1e')]?_[_0x8c36('0x1f')](_0x58bcd2[_0x8c36('0x1e')],function(_0x30e95b){return{'model':db[_0x30e95b[_0x8c36('0x20')]],'as':_0x30e95b['as'],'attributes':_0x30e95b[_0x8c36('0x1c')],'include':_0x30e95b[_0x8c36('0x1e')]?_[_0x8c36('0x1f')](_0x30e95b[_0x8c36('0x1e')],function(_0xfd2393){return{'model':db[_0xfd2393['model']],'as':_0xfd2393['as'],'attributes':_0xfd2393[_0x8c36('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8c36('0xd')](function(_0x3e7d2a){logger[_0x8c36('0xe')](_0x8c36('0x18'),_0x348fc2);logger[_0x8c36('0x11')](_0x8c36('0x18'),_0x348fc2,JSON[_0x8c36('0x13')](_0x3e7d2a));_0x294fee(_0x3e7d2a);})[_0x8c36('0x21')](function(_0x461992){logger['error'](_0x8c36('0x18'),_0x461992[_0x8c36('0x16')],_0x348fc2);_0x54fb1a(_0x4e224d[_0x8c36('0x14')](0x1f4,_0x461992[_0x8c36('0x16')]));});});};exports[_0x8c36('0x22')]=function(_0x1fa515){var _0x49c20a=this;return new Promise(function(_0x392774,_0x5d12fd){return db[_0x8c36('0x19')][_0x8c36('0x23')]({'raw':_0x1fa515['options']?_0x1fa515[_0x8c36('0x1a')][_0x8c36('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fa515[_0x8c36('0x1a')]?_0x1fa515[_0x8c36('0x1a')][_0x8c36('0x24')]||null:null,'attributes':_0x1fa515[_0x8c36('0x1a')]?_0x1fa515[_0x8c36('0x1a')][_0x8c36('0x1c')]||null:null,'include':_0x1fa515[_0x8c36('0x1a')]?_0x1fa515[_0x8c36('0x1a')][_0x8c36('0x1e')]?_['map'](_0x1fa515['options']['include'],function(_0x449816){return{'model':db[_0x449816[_0x8c36('0x20')]],'as':_0x449816['as'],'attributes':_0x449816['attributes'],'include':_0x449816[_0x8c36('0x1e')]?_['map'](_0x449816['include'],function(_0x2488ab){return{'model':db[_0x2488ab[_0x8c36('0x20')]],'as':_0x2488ab['as'],'attributes':_0x2488ab[_0x8c36('0x1c')],'include':_0x2488ab[_0x8c36('0x1e')]?_[_0x8c36('0x1f')](_0x2488ab['include'],function(_0x14b6d4){return{'model':db[_0x14b6d4[_0x8c36('0x20')]],'as':_0x14b6d4['as'],'attributes':_0x14b6d4[_0x8c36('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9732){logger[_0x8c36('0xe')](_0x8c36('0x22'),_0x1fa515);logger[_0x8c36('0x11')]('ShowCmHopper',_0x1fa515,JSON[_0x8c36('0x13')](_0x1f9732));_0x392774(_0x1f9732);})[_0x8c36('0x21')](function(_0x470fe3){logger[_0x8c36('0x14')](_0x8c36('0x22'),_0x470fe3[_0x8c36('0x16')],_0x1fa515);_0x5d12fd(_0x49c20a[_0x8c36('0x14')](0x1f4,_0x470fe3[_0x8c36('0x16')]));});});};exports[_0x8c36('0x25')]=function(_0x94fb56){var _0x101cc3=this;return new Promise(function(_0x4a2786,_0x54a596){return db[_0x8c36('0x19')]['create'](_0x94fb56['body'],{'raw':_0x94fb56[_0x8c36('0x1a')]?_0x94fb56[_0x8c36('0x1a')][_0x8c36('0x1b')]===undefined?!![]:![]:!![]})[_0x8c36('0xd')](function(_0xf577d8){logger[_0x8c36('0xe')](_0x8c36('0x25'),_0x94fb56);logger['debug'](_0x8c36('0x25'),_0x94fb56,JSON[_0x8c36('0x13')](_0xf577d8));_0x4a2786(_0xf577d8);})['catch'](function(_0x5646a6){logger[_0x8c36('0x14')](_0x8c36('0x25'),_0x5646a6[_0x8c36('0x16')],_0x94fb56);_0x54a596(_0x101cc3[_0x8c36('0x14')](0x1f4,_0x5646a6[_0x8c36('0x16')]));});});};exports['UpdateCmHopper']=function(_0x29e1a8){var _0x39d7dc=this;return new Promise(function(_0x302eb4,_0x5246dd){return db[_0x8c36('0x19')][_0x8c36('0x26')](_0x29e1a8['body'],{'raw':_0x29e1a8[_0x8c36('0x1a')]?_0x29e1a8[_0x8c36('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29e1a8[_0x8c36('0x1a')]?_0x29e1a8[_0x8c36('0x1a')][_0x8c36('0x24')]||null:null,'attributes':_0x29e1a8[_0x8c36('0x1a')]?_0x29e1a8['options'][_0x8c36('0x1c')]||null:null,'limit':_0x29e1a8['options']?_0x29e1a8[_0x8c36('0x1a')][_0x8c36('0x1d')]||null:null})[_0x8c36('0xd')](function(_0x5455ef){logger[_0x8c36('0xe')](_0x8c36('0x27'),_0x29e1a8);logger['info'](_0x8c36('0x28'),JSON[_0x8c36('0x13')](_0x29e1a8['options'][_0x8c36('0x24')]),_0x29e1a8[_0x8c36('0x29')][_0x8c36('0x2a')]);logger[_0x8c36('0x11')](_0x8c36('0x27'),_0x29e1a8,JSON[_0x8c36('0x13')](_0x5455ef));_0x302eb4(_0x5455ef);})[_0x8c36('0x21')](function(_0x1e61a0){logger['error'](_0x8c36('0x27'),_0x1e61a0['message'],_0x29e1a8);_0x5246dd(_0x39d7dc[_0x8c36('0x14')](0x1f4,_0x1e61a0[_0x8c36('0x16')]));});});};exports[_0x8c36('0x2b')]=function(_0xfc2433){var _0x3a295f=this;return new Promise(function(_0x179f9c,_0x6ada75){return db[_0x8c36('0x19')][_0x8c36('0x2c')]({'where':_0xfc2433[_0x8c36('0x1a')]?_0xfc2433[_0x8c36('0x1a')][_0x8c36('0x24')]||null:null})[_0x8c36('0xd')](function(_0x3f3af6){logger[_0x8c36('0xe')]('DestroyCmHopper',_0xfc2433);logger['debug'](_0x8c36('0x2b'),_0xfc2433,JSON['stringify'](_0x3f3af6));_0x179f9c(_0x3f3af6);})[_0x8c36('0x21')](function(_0x544bcb){logger[_0x8c36('0x14')](_0x8c36('0x2b'),_0x544bcb[_0x8c36('0x16')],_0xfc2433);_0x6ada75(_0x3a295f[_0x8c36('0x14')](0x1f4,_0x544bcb['message']));});});};exports['GetContactDialer']=function(_0x3a84b7){var _0x2ee3fb=this;return new Promise(function(_0x5b86fe,_0x24207d){return db[_0x8c36('0x2d')][_0x8c36('0x2e')]()['then'](function(_0x116bfc){return db[_0x8c36('0x2f')]['transaction'](function(_0x20d966){return db[_0x8c36('0x19')][_0x8c36('0x30')]({'where':_0x3a84b7[_0x8c36('0x1a')]?_0x3a84b7['options']['where']||null:null,'attributes':_0x3a84b7[_0x8c36('0x1a')]?_0x3a84b7[_0x8c36('0x1a')][_0x8c36('0x1c')]||null:null,'limit':_0x3a84b7[_0x8c36('0x1a')]?_0x3a84b7[_0x8c36('0x1a')][_0x8c36('0x1d')]||null:null,'order':_0x3a84b7[_0x8c36('0x1a')]?_0x3a84b7[_0x8c36('0x1a')][_0x8c36('0x31')]||null:null,'transaction':_0x20d966,'lock':_0x20d966[_0x8c36('0x32')][_0x8c36('0x33')],'include':[{'model':db[_0x8c36('0x2d')],'as':_0x8c36('0x34'),'attributes':_[_0x8c36('0x35')](_0x116bfc)},{'model':db[_0x8c36('0x36')],'as':_0x8c36('0x37'),'attributes':['id',_0x8c36('0x38'),_0x8c36('0x39')]}]})[_0x8c36('0xd')](function(_0x36f9ab){var _0x4ba4ec=[];var _0x2a2e32=[];for(var _0x53a5f3=0x0;_0x53a5f3<_0x36f9ab['length'];_0x53a5f3+=0x1){var _0x28fd68=_0x36f9ab[_0x53a5f3][_0x8c36('0x3a')];if(_0x28fd68===null){_0x4ba4ec[_0x8c36('0x3b')](_0x36f9ab[_0x53a5f3][_0x8c36('0x26')](_0x3a84b7['body'],{'transaction':_0x20d966}));}else if(!_0x2a2e32[_0x8c36('0x3c')](_0x28fd68)){_0x2a2e32[_0x8c36('0x3b')](_0x28fd68);_0x4ba4ec[_0x8c36('0x3b')](_0x36f9ab[_0x53a5f3]['update'](_0x3a84b7['body'],{'transaction':_0x20d966}));}}return BPromise['all'](_0x4ba4ec);});})[_0x8c36('0xd')](function(_0x24f9b7){logger[_0x8c36('0xe')]('GetContactDialer',_0x3a84b7);if(_0x24f9b7[_0x8c36('0x3d')]>0x0){logger[_0x8c36('0xe')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x24f9b7[0x0]['dataValues']['id'],_0x24f9b7[0x0][_0x8c36('0x3e')][_0x8c36('0x3f')],_0x24f9b7[0x0][_0x8c36('0x3e')][_0x8c36('0x2a')]);}logger[_0x8c36('0x11')]('GetContactDialer',_0x3a84b7,JSON[_0x8c36('0x13')](_0x24f9b7));_0x5b86fe(_0x24f9b7);})['catch'](function(_0x20213a){logger[_0x8c36('0x14')](_0x8c36('0x40'),_0x20213a[_0x8c36('0x16')],_0x3a84b7);_0x24207d(_0x2ee3fb[_0x8c36('0x14')](0x1f4,_0x20213a['message']));});});});};exports['MoveContactManagedDialer']=function(_0x5b3dac){var _0x35589f=this;return new Promise(function(_0x2711db,_0x5494ef){return db['sequelize'][_0x8c36('0x41')](function(_0x36b165){return db[_0x8c36('0x42')]['create'](_0x5b3dac[_0x8c36('0x29')],{'raw':_0x5b3dac[_0x8c36('0x1a')]?_0x5b3dac[_0x8c36('0x1a')]['raw']===undefined?!![]:![]:!![],'transaction':_0x36b165})['then'](function(){logger[_0x8c36('0xe')](_0x8c36('0x43'),JSON[_0x8c36('0x13')](_0x5b3dac[_0x8c36('0x1a')][_0x8c36('0x24')]),_0x5b3dac[_0x8c36('0x1a')][_0x8c36('0x24')]['active']);return db[_0x8c36('0x19')][_0x8c36('0x2c')]({'where':_0x5b3dac['options']?_0x5b3dac[_0x8c36('0x1a')][_0x8c36('0x24')]||null:null,'transaction':_0x36b165});});})[_0x8c36('0xd')](function(_0x4c06d1){logger[_0x8c36('0xe')](_0x8c36('0x44'),_0x5b3dac);logger[_0x8c36('0x11')]('MoveContactManagedDialer',_0x5b3dac,JSON[_0x8c36('0x13')](_0x4c06d1));_0x2711db(_0x4c06d1);})[_0x8c36('0x21')](function(_0x1e0d6a){logger[_0x8c36('0x14')](_0x8c36('0x44'),_0x1e0d6a[_0x8c36('0x16')],_0x5b3dac);_0x5494ef(_0x35589f[_0x8c36('0x14')](0x1f4,_0x1e0d6a[_0x8c36('0x16')]));});});};exports[_0x8c36('0x45')]=function(_0x175eb6){var _0x4bcdf5=this;return new Promise(function(_0x28d131,_0x2ac5ee){return db[_0x8c36('0x19')]['findAll']({'raw':_0x175eb6['options']?_0x175eb6[_0x8c36('0x1a')][_0x8c36('0x1b')]===undefined?!![]:![]:!![],'where':_0x175eb6['options']?_0x175eb6[_0x8c36('0x1a')][_0x8c36('0x24')]||null:null,'attributes':[[db[_0x8c36('0x2f')]['fn'](_0x8c36('0x46'),db[_0x8c36('0x2f')]['fn']('IF',db[_0x8c36('0x2f')][_0x8c36('0x47')](_0x8c36('0x48')+util[_0x8c36('0x49')](_0x8c36('0x4a'),moment()[_0x8c36('0x49')](_0x8c36('0x4b')))+'\x20,\x201,\x20null'))),_0x8c36('0x4c')]]})[_0x8c36('0xd')](function(_0x324e36){logger[_0x8c36('0xe')](_0x8c36('0x45'),_0x175eb6);logger[_0x8c36('0x11')](_0x8c36('0x45'),_0x175eb6,JSON[_0x8c36('0x13')](_0x324e36));_0x28d131(_0x324e36);})['catch'](function(_0x1d1dd0){logger[_0x8c36('0x14')](_0x8c36('0x45'),_0x1d1dd0[_0x8c36('0x16')],_0x175eb6);_0x2ac5ee(_0x4bcdf5[_0x8c36('0x14')](0x1f4,_0x1d1dd0['message']));});});};exports[_0x8c36('0x4d')]=function(_0x4599ad){var _0x5f5904=this;return new Promise(function(_0x3b5eb8,_0x378f5e){return db[_0x8c36('0x2d')]['describe']()['then'](function(_0x3ff36d){return db[_0x8c36('0x2f')][_0x8c36('0x41')](function(_0x1d5f90){return db['CmHopper'][_0x8c36('0x30')]({'where':_0x4599ad['options']?_0x4599ad['options']['where']||null:null,'attributes':_0x4599ad[_0x8c36('0x1a')]?_0x4599ad[_0x8c36('0x1a')][_0x8c36('0x1c')]||null:null,'limit':0x1,'order':_0x4599ad[_0x8c36('0x1a')]?_0x4599ad[_0x8c36('0x1a')][_0x8c36('0x31')]||null:null,'group':db[_0x8c36('0x19')]['UserId'],'transaction':_0x1d5f90,'lock':_0x1d5f90['LOCK'][_0x8c36('0x33')],'include':_0x4599ad['options']?_0x4599ad['options'][_0x8c36('0x1e')]?_['map'](_0x4599ad[_0x8c36('0x1a')][_0x8c36('0x1e')],function(_0x5a0f71){return{'model':db[_0x5a0f71[_0x8c36('0x20')]],'as':_0x5a0f71['as'],'attributes':_0x5a0f71[_0x8c36('0x1c')],'include':_0x5a0f71[_0x8c36('0x1e')]?_[_0x8c36('0x1f')](_0x5a0f71['include'],function(_0x4b7010){return{'model':db[_0x4b7010[_0x8c36('0x20')]],'as':_0x4b7010['as'],'attributes':_0x4b7010[_0x8c36('0x1c')],'include':_0x4b7010['include']?_[_0x8c36('0x1f')](_0x4b7010[_0x8c36('0x1e')],function(_0x53fb32){return{'model':db[_0x53fb32['model']],'as':_0x53fb32['as'],'attributes':_0x53fb32[_0x8c36('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16472f){var _0x11cb84=[];for(var _0x34498c=0x0;_0x34498c<_0x16472f[_0x8c36('0x3d')];_0x34498c+=0x1){_0x11cb84[_0x8c36('0x3b')](_0x16472f[_0x34498c][_0x8c36('0x26')](_0x4599ad['body'],{'transaction':_0x1d5f90}));}return BPromise[_0x8c36('0x4e')](_0x11cb84);});})[_0x8c36('0xd')](function(_0x4c1edd){logger[_0x8c36('0xe')](_0x8c36('0x4d'),_0x4599ad);logger[_0x8c36('0x11')](_0x8c36('0x4d'),_0x4599ad,JSON[_0x8c36('0x13')](_0x4c1edd));_0x3b5eb8(_0x4c1edd);})['catch'](function(_0x503058){logger['error'](_0x8c36('0x4d'),_0x503058[_0x8c36('0x16')],_0x4599ad);_0x378f5e(_0x5f5904[_0x8c36('0x14')](0x1f4,_0x503058[_0x8c36('0x16')]));});});});};exports[_0x8c36('0x4f')]=function(_0x20d96b){var _0x3c9052=this;return new Promise(function(_0x275c2b,_0x30711b){db[_0x8c36('0x2d')][_0x8c36('0x2e')]()['then'](function(_0x3954d9){return db[_0x8c36('0x19')][_0x8c36('0x30')]({'raw':_0x20d96b[_0x8c36('0x1a')]?_0x20d96b[_0x8c36('0x1a')][_0x8c36('0x1b')]===undefined?!![]:![]:!![],'where':_0x20d96b[_0x8c36('0x1a')]?_0x20d96b[_0x8c36('0x1a')][_0x8c36('0x24')]||null:null,'attributes':_0x20d96b[_0x8c36('0x1a')]?_0x20d96b['options']['attributes']||null:null,'limit':_0x20d96b[_0x8c36('0x1a')]?_0x20d96b[_0x8c36('0x1a')][_0x8c36('0x1d')]||null:null,'include':_0x20d96b['options']?_0x20d96b[_0x8c36('0x1a')]['include']?_[_0x8c36('0x1f')](_0x20d96b[_0x8c36('0x1a')]['include'],function(_0x64b93){return{'model':db[_0x64b93[_0x8c36('0x20')]],'as':_0x64b93['as'],'attributes':_0x64b93['as']===_0x8c36('0x34')?_[_0x8c36('0x35')](_0x3954d9):_0x64b93[_0x8c36('0x1c')],'include':_0x64b93['include']?_['map'](_0x64b93[_0x8c36('0x1e')],function(_0x30267e){return{'model':db[_0x30267e['model']],'as':_0x30267e['as'],'attributes':_0x30267e[_0x8c36('0x1c')],'include':_0x30267e[_0x8c36('0x1e')]?_[_0x8c36('0x1f')](_0x30267e[_0x8c36('0x1e')],function(_0x5a0f7a){return{'model':db[_0x5a0f7a[_0x8c36('0x20')]],'as':_0x5a0f7a['as'],'attributes':_0x5a0f7a[_0x8c36('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8c36('0xd')](function(_0x4979cd){logger['info'](_0x8c36('0x18'),_0x20d96b);logger['debug']('GetCmHopper',_0x20d96b,JSON['stringify'](_0x4979cd));_0x275c2b(_0x4979cd);})[_0x8c36('0x21')](function(_0x2b813a){logger[_0x8c36('0x14')](_0x8c36('0x18'),_0x2b813a['message'],_0x20d96b);_0x30711b(_0x3c9052[_0x8c36('0x14')](0x1f4,_0x2b813a[_0x8c36('0x16')]));});});});};exports[_0x8c36('0x50')]=function(_0x5bbd7a){var _0x2adf2b=this;return new Promise(function(_0x30f31d,_0x1599f4){return db['sequelize']['transaction'](function(_0x36ca69){return db[_0x8c36('0x19')]['update']({'active':![]},{'where':{},'transaction':_0x36ca69})['then'](function(_0x2ddf54){logger[_0x8c36('0xe')](_0x8c36('0x50'),_0x5bbd7a);logger[_0x8c36('0x11')](_0x8c36('0x50'),_0x5bbd7a,JSON['stringify'](_0x2ddf54));_0x30f31d(_0x2ddf54);})[_0x8c36('0x21')](function(_0x54c5d0){logger['error']('ResetActiveCalls',_0x54c5d0[_0x8c36('0x16')],_0x5bbd7a);_0x1599f4(_0x2adf2b['error'](0x1f4,_0x54c5d0[_0x8c36('0x16')]));});});});}; \ No newline at end of file +var _0x57c1=['GetCmHopper','options','where','attributes','limit','include','map','model','ShowCmHopper','find','raw','CreateCmHopper','CmHopper','UpdateCmHopper','body','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','UPDATE','Contact','keys','User','name','length','push','update','includes','all','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','ResetActiveCalls','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x57c1,0x83));var _0x157c=function(_0x5dd24d,_0x54c94d){_0x5dd24d=_0x5dd24d-0x0;var _0x4c976f=_0x57c1[_0x5dd24d];return _0x4c976f;};'use strict';var _=require(_0x157c('0x0'));var util=require(_0x157c('0x1'));var moment=require(_0x157c('0x2'));var BPromise=require(_0x157c('0x3'));var rs=require(_0x157c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x157c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x157c('0x6'))(_0x157c('0x7'));var config=require(_0x157c('0x8'));var jayson=require(_0x157c('0x9'));var client=jayson[_0x157c('0xa')][_0x157c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cb144,_0x23ab6c,_0x5ccfec){return new BPromise(function(_0x17eb54,_0x1a7bb8){return client[_0x157c('0xc')](_0x2cb144,_0x5ccfec)[_0x157c('0xd')](function(_0x39267d){logger[_0x157c('0xe')](_0x157c('0xf'),_0x23ab6c,_0x157c('0x10'));logger[_0x157c('0x11')](_0x157c('0x12'),_0x23ab6c,_0x157c('0x10'),JSON[_0x157c('0x13')](_0x39267d));if(_0x39267d[_0x157c('0x14')]){if(_0x39267d[_0x157c('0x14')][_0x157c('0x15')]===0x1f4){logger[_0x157c('0x14')](_0x157c('0xf'),_0x23ab6c,_0x39267d[_0x157c('0x14')][_0x157c('0x16')]);return _0x1a7bb8(_0x39267d[_0x157c('0x14')][_0x157c('0x16')]);}logger[_0x157c('0x14')]('CmHopper,\x20%s,\x20%s',_0x23ab6c,_0x39267d[_0x157c('0x14')][_0x157c('0x16')]);return _0x17eb54(_0x39267d[_0x157c('0x14')]['message']);}else{logger[_0x157c('0xe')](_0x157c('0xf'),_0x23ab6c,_0x157c('0x10'));_0x17eb54(_0x39267d[_0x157c('0x17')]['message']);}})[_0x157c('0x18')](function(_0x23468d){logger[_0x157c('0x14')](_0x157c('0xf'),_0x23ab6c,_0x23468d);_0x1a7bb8(_0x23468d);});});}exports[_0x157c('0x19')]=function(_0x2648d7){var _0x160804=this;return new Promise(function(_0x346308,_0x3ef4e4){return db['CmHopper']['findAll']({'raw':_0x2648d7[_0x157c('0x1a')]?_0x2648d7[_0x157c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2648d7[_0x157c('0x1a')]?_0x2648d7[_0x157c('0x1a')][_0x157c('0x1b')]||null:null,'attributes':_0x2648d7[_0x157c('0x1a')]?_0x2648d7[_0x157c('0x1a')][_0x157c('0x1c')]||null:null,'limit':_0x2648d7[_0x157c('0x1a')]?_0x2648d7[_0x157c('0x1a')][_0x157c('0x1d')]||null:null,'include':_0x2648d7[_0x157c('0x1a')]?_0x2648d7[_0x157c('0x1a')][_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x2648d7[_0x157c('0x1a')][_0x157c('0x1e')],function(_0x1f9de1){return{'model':db[_0x1f9de1[_0x157c('0x20')]],'as':_0x1f9de1['as'],'attributes':_0x1f9de1[_0x157c('0x1c')],'include':_0x1f9de1[_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x1f9de1[_0x157c('0x1e')],function(_0x57b0e9){return{'model':db[_0x57b0e9['model']],'as':_0x57b0e9['as'],'attributes':_0x57b0e9[_0x157c('0x1c')],'include':_0x57b0e9[_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x57b0e9['include'],function(_0x4f962d){return{'model':db[_0x4f962d[_0x157c('0x20')]],'as':_0x4f962d['as'],'attributes':_0x4f962d[_0x157c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x157c('0xd')](function(_0x3a9138){logger[_0x157c('0xe')](_0x157c('0x19'),_0x2648d7);logger[_0x157c('0x11')](_0x157c('0x19'),_0x2648d7,JSON[_0x157c('0x13')](_0x3a9138));_0x346308(_0x3a9138);})[_0x157c('0x18')](function(_0x2ea107){logger['error']('GetCmHopper',_0x2ea107[_0x157c('0x16')],_0x2648d7);_0x3ef4e4(_0x160804[_0x157c('0x14')](0x1f4,_0x2ea107[_0x157c('0x16')]));});});};exports[_0x157c('0x21')]=function(_0x18a88f){var _0x3fea1d=this;return new Promise(function(_0x42709c,_0xe5bdd8){return db['CmHopper'][_0x157c('0x22')]({'raw':_0x18a88f[_0x157c('0x1a')]?_0x18a88f[_0x157c('0x1a')][_0x157c('0x23')]===undefined?!![]:![]:!![],'where':_0x18a88f[_0x157c('0x1a')]?_0x18a88f[_0x157c('0x1a')][_0x157c('0x1b')]||null:null,'attributes':_0x18a88f[_0x157c('0x1a')]?_0x18a88f['options'][_0x157c('0x1c')]||null:null,'include':_0x18a88f['options']?_0x18a88f[_0x157c('0x1a')][_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x18a88f[_0x157c('0x1a')][_0x157c('0x1e')],function(_0x51f526){return{'model':db[_0x51f526[_0x157c('0x20')]],'as':_0x51f526['as'],'attributes':_0x51f526['attributes'],'include':_0x51f526[_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x51f526[_0x157c('0x1e')],function(_0x1cc666){return{'model':db[_0x1cc666[_0x157c('0x20')]],'as':_0x1cc666['as'],'attributes':_0x1cc666[_0x157c('0x1c')],'include':_0x1cc666['include']?_[_0x157c('0x1f')](_0x1cc666[_0x157c('0x1e')],function(_0x4cf22d){return{'model':db[_0x4cf22d[_0x157c('0x20')]],'as':_0x4cf22d['as'],'attributes':_0x4cf22d[_0x157c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x157c('0xd')](function(_0x4e616e){logger[_0x157c('0xe')]('ShowCmHopper',_0x18a88f);logger['debug']('ShowCmHopper',_0x18a88f,JSON[_0x157c('0x13')](_0x4e616e));_0x42709c(_0x4e616e);})[_0x157c('0x18')](function(_0x6e57b7){logger[_0x157c('0x14')]('ShowCmHopper',_0x6e57b7[_0x157c('0x16')],_0x18a88f);_0xe5bdd8(_0x3fea1d[_0x157c('0x14')](0x1f4,_0x6e57b7[_0x157c('0x16')]));});});};exports[_0x157c('0x24')]=function(_0x321e14){var _0x50600d=this;return new Promise(function(_0x458ccf,_0x4358da){return db[_0x157c('0x25')]['create'](_0x321e14['body'],{'raw':_0x321e14[_0x157c('0x1a')]?_0x321e14[_0x157c('0x1a')][_0x157c('0x23')]===undefined?!![]:![]:!![]})[_0x157c('0xd')](function(_0x49d10e){logger['info'](_0x157c('0x24'),_0x321e14);logger[_0x157c('0x11')](_0x157c('0x24'),_0x321e14,JSON['stringify'](_0x49d10e));_0x458ccf(_0x49d10e);})[_0x157c('0x18')](function(_0x5ef1ba){logger[_0x157c('0x14')](_0x157c('0x24'),_0x5ef1ba[_0x157c('0x16')],_0x321e14);_0x4358da(_0x50600d[_0x157c('0x14')](0x1f4,_0x5ef1ba[_0x157c('0x16')]));});});};exports[_0x157c('0x26')]=function(_0x5935fb){var _0x412a95=this;return new Promise(function(_0x2b9be3,_0x3c99dd){return db[_0x157c('0x25')]['update'](_0x5935fb['body'],{'raw':_0x5935fb['options']?_0x5935fb['options'][_0x157c('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5935fb[_0x157c('0x1a')]?_0x5935fb['options'][_0x157c('0x1b')]||null:null,'attributes':_0x5935fb[_0x157c('0x1a')]?_0x5935fb[_0x157c('0x1a')]['attributes']||null:null,'limit':_0x5935fb[_0x157c('0x1a')]?_0x5935fb[_0x157c('0x1a')]['limit']||null:null})[_0x157c('0xd')](function(_0x54a17a){logger[_0x157c('0xe')](_0x157c('0x26'),_0x5935fb);logger[_0x157c('0xe')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x157c('0x13')](_0x5935fb[_0x157c('0x1a')]['where']),_0x5935fb[_0x157c('0x27')][_0x157c('0x28')]);logger['debug']('UpdateCmHopper',_0x5935fb,JSON[_0x157c('0x13')](_0x54a17a));_0x2b9be3(_0x54a17a);})[_0x157c('0x18')](function(_0x531eb0){logger['error'](_0x157c('0x26'),_0x531eb0[_0x157c('0x16')],_0x5935fb);_0x3c99dd(_0x412a95[_0x157c('0x14')](0x1f4,_0x531eb0['message']));});});};exports[_0x157c('0x29')]=function(_0x35abcb){var _0x51fc25=this;return new Promise(function(_0x8e2a6c,_0x26131f){return db[_0x157c('0x25')][_0x157c('0x2a')]({'where':_0x35abcb['options']?_0x35abcb[_0x157c('0x1a')][_0x157c('0x1b')]||null:null})[_0x157c('0xd')](function(_0x35dc2a){logger[_0x157c('0xe')](_0x157c('0x29'),_0x35abcb);logger[_0x157c('0x11')](_0x157c('0x29'),_0x35abcb,JSON[_0x157c('0x13')](_0x35dc2a));_0x8e2a6c(_0x35dc2a);})[_0x157c('0x18')](function(_0x5a29d9){logger[_0x157c('0x14')]('DestroyCmHopper',_0x5a29d9['message'],_0x35abcb);_0x26131f(_0x51fc25['error'](0x1f4,_0x5a29d9[_0x157c('0x16')]));});});};exports[_0x157c('0x2b')]=function(_0x37e2b2){var _0x5b028a=this;return new Promise(function(_0x1b6644,_0x32b44b){return db[_0x157c('0x2c')][_0x157c('0x2d')]()[_0x157c('0xd')](function(_0x3b3f9d){return db[_0x157c('0x2e')][_0x157c('0x2f')](function(_0x59c23b){return db[_0x157c('0x25')][_0x157c('0x30')]({'where':_0x37e2b2[_0x157c('0x1a')]?_0x37e2b2[_0x157c('0x1a')]['where']||null:null,'attributes':_0x37e2b2[_0x157c('0x1a')]?_0x37e2b2[_0x157c('0x1a')][_0x157c('0x1c')]||null:null,'limit':_0x37e2b2['options']?_0x37e2b2[_0x157c('0x1a')][_0x157c('0x1d')]||null:null,'order':_0x37e2b2[_0x157c('0x1a')]?_0x37e2b2[_0x157c('0x1a')][_0x157c('0x31')]||null:null,'transaction':_0x59c23b,'lock':_0x59c23b['LOCK'][_0x157c('0x32')],'include':[{'model':db['CmContact'],'as':_0x157c('0x33'),'attributes':_[_0x157c('0x34')](_0x3b3f9d)},{'model':db[_0x157c('0x35')],'as':'Agent','attributes':['id',_0x157c('0x36'),'voicePause']}]})[_0x157c('0xd')](function(_0x1af1b5){var _0x412fbe=[];var _0x269c13=[];for(var _0x4b6849=0x0;_0x4b6849<_0x1af1b5[_0x157c('0x37')];_0x4b6849+=0x1){var _0x124f60=_0x1af1b5[_0x4b6849]['UserId'];if(_0x124f60===null){_0x412fbe[_0x157c('0x38')](_0x1af1b5[_0x4b6849][_0x157c('0x39')](_0x37e2b2[_0x157c('0x27')],{'transaction':_0x59c23b}));}else if(!_0x269c13[_0x157c('0x3a')](_0x124f60)){_0x269c13[_0x157c('0x38')](_0x124f60);_0x412fbe['push'](_0x1af1b5[_0x4b6849][_0x157c('0x39')](_0x37e2b2[_0x157c('0x27')],{'transaction':_0x59c23b}));}}return BPromise[_0x157c('0x3b')](_0x412fbe);});})[_0x157c('0xd')](function(_0x25f9ac){logger[_0x157c('0xe')](_0x157c('0x2b'),_0x37e2b2);if(_0x25f9ac[_0x157c('0x37')]>0x0){logger[_0x157c('0xe')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x25f9ac[0x0][_0x157c('0x3c')]['id'],_0x25f9ac[0x0][_0x157c('0x3c')][_0x157c('0x3d')],_0x25f9ac[0x0]['dataValues'][_0x157c('0x28')]);}logger[_0x157c('0x11')](_0x157c('0x2b'),_0x37e2b2,JSON[_0x157c('0x13')](_0x25f9ac));_0x1b6644(_0x25f9ac);})['catch'](function(_0x46b43c){logger[_0x157c('0x14')](_0x157c('0x2b'),_0x46b43c[_0x157c('0x16')],_0x37e2b2);_0x32b44b(_0x5b028a[_0x157c('0x14')](0x1f4,_0x46b43c[_0x157c('0x16')]));});});});};exports[_0x157c('0x3e')]=function(_0x13db6b){var _0x16de20=this;return new Promise(function(_0x86ce8b,_0x2c7bf1){return db[_0x157c('0x2e')][_0x157c('0x2f')](function(_0x4ead7c){return db[_0x157c('0x3f')]['create'](_0x13db6b[_0x157c('0x27')],{'raw':_0x13db6b['options']?_0x13db6b[_0x157c('0x1a')][_0x157c('0x23')]===undefined?!![]:![]:!![],'transaction':_0x4ead7c})[_0x157c('0xd')](function(){logger[_0x157c('0xe')](_0x157c('0x40'),JSON[_0x157c('0x13')](_0x13db6b[_0x157c('0x1a')][_0x157c('0x1b')]),_0x13db6b[_0x157c('0x1a')][_0x157c('0x1b')][_0x157c('0x28')]);return db[_0x157c('0x25')][_0x157c('0x2a')]({'where':_0x13db6b[_0x157c('0x1a')]?_0x13db6b[_0x157c('0x1a')][_0x157c('0x1b')]||null:null,'transaction':_0x4ead7c});});})['then'](function(_0x217856){logger[_0x157c('0xe')](_0x157c('0x3e'),_0x13db6b);logger[_0x157c('0x11')](_0x157c('0x3e'),_0x13db6b,JSON['stringify'](_0x217856));_0x86ce8b(_0x217856);})[_0x157c('0x18')](function(_0x3004d5){logger['error'](_0x157c('0x3e'),_0x3004d5[_0x157c('0x16')],_0x13db6b);_0x2c7bf1(_0x16de20['error'](0x1f4,_0x3004d5['message']));});});};exports[_0x157c('0x41')]=function(_0x363344){var _0x38728b=this;return new Promise(function(_0x190065,_0x427131){return db[_0x157c('0x25')][_0x157c('0x30')]({'raw':_0x363344[_0x157c('0x1a')]?_0x363344['options'][_0x157c('0x23')]===undefined?!![]:![]:!![],'where':_0x363344['options']?_0x363344['options']['where']||null:null,'attributes':[[db[_0x157c('0x2e')]['fn'](_0x157c('0x42'),db[_0x157c('0x2e')]['fn']('IF',db[_0x157c('0x2e')][_0x157c('0x43')](_0x157c('0x44')+util['format'](_0x157c('0x45'),moment()[_0x157c('0x46')](_0x157c('0x47')))+_0x157c('0x48')))),_0x157c('0x49')]]})['then'](function(_0x5378e0){logger['info'](_0x157c('0x41'),_0x363344);logger[_0x157c('0x11')]('CountReScheduled',_0x363344,JSON[_0x157c('0x13')](_0x5378e0));_0x190065(_0x5378e0);})['catch'](function(_0x553987){logger[_0x157c('0x14')](_0x157c('0x41'),_0x553987[_0x157c('0x16')],_0x363344);_0x427131(_0x38728b[_0x157c('0x14')](0x1f4,_0x553987[_0x157c('0x16')]));});});};exports[_0x157c('0x4a')]=function(_0x32bb63){var _0x5d3e25=this;return new Promise(function(_0x28a72e,_0x2fde8a){return db[_0x157c('0x2c')][_0x157c('0x2d')]()['then'](function(_0x35d39c){return db[_0x157c('0x2e')][_0x157c('0x2f')](function(_0x3f4c53){return db[_0x157c('0x25')][_0x157c('0x30')]({'where':_0x32bb63['options']?_0x32bb63[_0x157c('0x1a')][_0x157c('0x1b')]||null:null,'attributes':_0x32bb63[_0x157c('0x1a')]?_0x32bb63[_0x157c('0x1a')][_0x157c('0x1c')]||null:null,'limit':0x1,'order':_0x32bb63[_0x157c('0x1a')]?_0x32bb63[_0x157c('0x1a')][_0x157c('0x31')]||null:null,'group':db[_0x157c('0x25')][_0x157c('0x4b')],'transaction':_0x3f4c53,'lock':_0x3f4c53[_0x157c('0x4c')][_0x157c('0x32')],'include':_0x32bb63[_0x157c('0x1a')]?_0x32bb63[_0x157c('0x1a')][_0x157c('0x1e')]?_['map'](_0x32bb63[_0x157c('0x1a')][_0x157c('0x1e')],function(_0x4f9e5e){return{'model':db[_0x4f9e5e[_0x157c('0x20')]],'as':_0x4f9e5e['as'],'attributes':_0x4f9e5e[_0x157c('0x1c')],'include':_0x4f9e5e[_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x4f9e5e[_0x157c('0x1e')],function(_0xd1ac16){return{'model':db[_0xd1ac16[_0x157c('0x20')]],'as':_0xd1ac16['as'],'attributes':_0xd1ac16[_0x157c('0x1c')],'include':_0xd1ac16[_0x157c('0x1e')]?_[_0x157c('0x1f')](_0xd1ac16[_0x157c('0x1e')],function(_0x4b8d04){return{'model':db[_0x4b8d04[_0x157c('0x20')]],'as':_0x4b8d04['as'],'attributes':_0x4b8d04[_0x157c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x157c('0xd')](function(_0xf3a3dc){var _0x2da9aa=[];for(var _0x3bcd8a=0x0;_0x3bcd8a<_0xf3a3dc[_0x157c('0x37')];_0x3bcd8a+=0x1){_0x2da9aa[_0x157c('0x38')](_0xf3a3dc[_0x3bcd8a][_0x157c('0x39')](_0x32bb63[_0x157c('0x27')],{'transaction':_0x3f4c53}));}return BPromise[_0x157c('0x3b')](_0x2da9aa);});})['then'](function(_0xbccf27){logger[_0x157c('0xe')]('GetContactRecallMe',_0x32bb63);logger[_0x157c('0x11')]('GetContactRecallMe',_0x32bb63,JSON[_0x157c('0x13')](_0xbccf27));_0x28a72e(_0xbccf27);})[_0x157c('0x18')](function(_0x165c36){logger[_0x157c('0x14')](_0x157c('0x4a'),_0x165c36[_0x157c('0x16')],_0x32bb63);_0x2fde8a(_0x5d3e25['error'](0x1f4,_0x165c36[_0x157c('0x16')]));});});});};exports['GetCmHopperPreview']=function(_0x46df66){var _0x148189=this;return new Promise(function(_0x515e8c,_0x2a9d97){db[_0x157c('0x2c')][_0x157c('0x2d')]()[_0x157c('0xd')](function(_0x48b5f8){return db['CmHopper'][_0x157c('0x30')]({'raw':_0x46df66[_0x157c('0x1a')]?_0x46df66[_0x157c('0x1a')][_0x157c('0x23')]===undefined?!![]:![]:!![],'where':_0x46df66['options']?_0x46df66[_0x157c('0x1a')]['where']||null:null,'attributes':_0x46df66['options']?_0x46df66[_0x157c('0x1a')][_0x157c('0x1c')]||null:null,'limit':_0x46df66[_0x157c('0x1a')]?_0x46df66[_0x157c('0x1a')][_0x157c('0x1d')]||null:null,'include':_0x46df66[_0x157c('0x1a')]?_0x46df66[_0x157c('0x1a')][_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x46df66[_0x157c('0x1a')]['include'],function(_0x51caed){return{'model':db[_0x51caed['model']],'as':_0x51caed['as'],'attributes':_0x51caed['as']===_0x157c('0x33')?_[_0x157c('0x34')](_0x48b5f8):_0x51caed[_0x157c('0x1c')],'include':_0x51caed[_0x157c('0x1e')]?_['map'](_0x51caed[_0x157c('0x1e')],function(_0x527bae){return{'model':db[_0x527bae[_0x157c('0x20')]],'as':_0x527bae['as'],'attributes':_0x527bae[_0x157c('0x1c')],'include':_0x527bae[_0x157c('0x1e')]?_[_0x157c('0x1f')](_0x527bae[_0x157c('0x1e')],function(_0x3ae6c5){return{'model':db[_0x3ae6c5['model']],'as':_0x3ae6c5['as'],'attributes':_0x3ae6c5[_0x157c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x157c('0xd')](function(_0x2431a2){logger[_0x157c('0xe')](_0x157c('0x19'),_0x46df66);logger['debug'](_0x157c('0x19'),_0x46df66,JSON[_0x157c('0x13')](_0x2431a2));_0x515e8c(_0x2431a2);})['catch'](function(_0x1b8d46){logger[_0x157c('0x14')](_0x157c('0x19'),_0x1b8d46['message'],_0x46df66);_0x2a9d97(_0x148189[_0x157c('0x14')](0x1f4,_0x1b8d46[_0x157c('0x16')]));});});});};exports[_0x157c('0x4d')]=function(_0x25ae91){var _0x451330=this;return new Promise(function(_0x131398,_0x1409c9){return db['sequelize'][_0x157c('0x2f')](function(_0x4bb387){return db[_0x157c('0x25')][_0x157c('0x39')]({'active':![]},{'where':{},'transaction':_0x4bb387})['then'](function(_0x390d96){logger['info'](_0x157c('0x4d'),_0x25ae91);logger[_0x157c('0x11')]('ResetActiveCalls',_0x25ae91,JSON[_0x157c('0x13')](_0x390d96));_0x131398(_0x390d96);})['catch'](function(_0x3b1a98){logger[_0x157c('0x14')](_0x157c('0x4d'),_0x3b1a98[_0x157c('0x16')],_0x25ae91);_0x1409c9(_0x451330[_0x157c('0x14')](0x1f4,_0x3b1a98[_0x157c('0x16')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 494484d..962ee15 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 _0x8a62=['/describe','describe','getOpenContacts','show','create','post','/preview','getPreview','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x8a62,0x19c));var _0x28a6=function(_0x5658d7,_0x9741b4){_0x5658d7=_0x5658d7-0x0;var _0x5bea17=_0x8a62[_0x5658d7];return _0x5bea17;};'use strict';var multer=require(_0x28a6('0x0'));var util=require(_0x28a6('0x1'));var path=require(_0x28a6('0x2'));var timeout=require(_0x28a6('0x3'));var express=require(_0x28a6('0x4'));var router=express[_0x28a6('0x5')]();var fs_extra=require(_0x28a6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x28a6('0x7'));var config=require(_0x28a6('0x8'));var controller=require(_0x28a6('0x9'));router[_0x28a6('0xa')]('/',auth[_0x28a6('0xb')](),controller[_0x28a6('0xc')]);router[_0x28a6('0xa')](_0x28a6('0xd'),auth[_0x28a6('0xb')](),controller[_0x28a6('0xe')]);router[_0x28a6('0xa')]('/opencontacts',auth[_0x28a6('0xb')](),controller[_0x28a6('0xf')]);router[_0x28a6('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x28a6('0x10')]);router['post']('/',auth[_0x28a6('0xb')](),controller[_0x28a6('0x11')]);router[_0x28a6('0x12')](_0x28a6('0x13'),auth[_0x28a6('0xb')](),controller[_0x28a6('0x14')]);router[_0x28a6('0x15')](_0x28a6('0x16'),auth['isAuthenticated'](),controller[_0x28a6('0x17')]);router['delete'](_0x28a6('0x16'),auth[_0x28a6('0xb')](),controller[_0x28a6('0x18')]);module['exports']=router; \ No newline at end of file +var _0x4c71=['put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','getOpenContacts','/:id','post','create','getPreview'];(function(_0x35f236,_0x595299){var _0x3aed18=function(_0x1d0b2b){while(--_0x1d0b2b){_0x35f236['push'](_0x35f236['shift']());}};_0x3aed18(++_0x595299);}(_0x4c71,0x1d1));var _0x14c7=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4c71[_0x21549c];return _0x426cbd;};'use strict';var multer=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var path=require(_0x14c7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x14c7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x14c7('0x4'));var config=require(_0x14c7('0x5'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0x14c7('0x6')](),controller[_0x14c7('0x7')]);router[_0x14c7('0x8')]('/describe',auth[_0x14c7('0x6')](),controller[_0x14c7('0x9')]);router['get']('/opencontacts',auth[_0x14c7('0x6')](),controller[_0x14c7('0xa')]);router[_0x14c7('0x8')](_0x14c7('0xb'),auth[_0x14c7('0x6')](),controller['show']);router[_0x14c7('0xc')]('/',auth[_0x14c7('0x6')](),controller[_0x14c7('0xd')]);router[_0x14c7('0xc')]('/preview',auth[_0x14c7('0x6')](),controller[_0x14c7('0xe')]);router[_0x14c7('0xf')](_0x14c7('0xb'),auth[_0x14c7('0x6')](),controller[_0x14c7('0x10')]);router[_0x14c7('0x11')]('/:id',auth[_0x14c7('0x6')](),controller[_0x14c7('0x12')]);module[_0x14c7('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index b4c1ba9..2f29d3d 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 _0xa151=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x54cf98,_0x2cce80){var _0x56f37f=function(_0x36799c){while(--_0x36799c){_0x54cf98['push'](_0x54cf98['shift']());}};_0x56f37f(++_0x2cce80);}(_0xa151,0x13d));var _0x1a15=function(_0x5dbbca,_0x127d3e){_0x5dbbca=_0x5dbbca-0x0;var _0x25b4e5=_0xa151[_0x5dbbca];return _0x25b4e5;};'use strict';var moment=require(_0x1a15('0x0'));var Sequelize=require(_0x1a15('0x1'));module['exports']={'phone':{'type':Sequelize[_0x1a15('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1a15('0x3')],'unique':_0x1a15('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1a15('0x4')},'VoiceQueueId':{'type':Sequelize[_0x1a15('0x3')],'unique':_0x1a15('0x4')}}; \ No newline at end of file +var _0x1805=['contactListQueue','INTEGER','sequelize','exports','STRING'];(function(_0xb26b7,_0x4ccac4){var _0x4d252e=function(_0x3d2f69){while(--_0x3d2f69){_0xb26b7['push'](_0xb26b7['shift']());}};_0x4d252e(++_0x4ccac4);}(_0x1805,0x1bf));var _0x5180=function(_0x53ee0f,_0x12ff39){_0x53ee0f=_0x53ee0f-0x0;var _0x1f0f1d=_0x1805[_0x53ee0f];return _0x1f0f1d;};'use strict';var moment=require('moment');var Sequelize=require(_0x5180('0x0'));module[_0x5180('0x1')]={'phone':{'type':Sequelize[_0x5180('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5180('0x3')},'ListId':{'type':Sequelize[_0x5180('0x4')],'unique':_0x5180('0x3')},'VoiceQueueId':{'type':Sequelize[_0x5180('0x4')],'unique':_0x5180('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 576e237..d257905 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 _0xe03f=['filter','then','include','findAll','rows','catch','show','includeAll','options','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','offset','undefined','count','limit','status','set','json','apply','reject','save','update','destroy','sendStatus','error','name','send','index','map','CmHopperBlack','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xe03f,0xa3));var _0xfe03=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe03f[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xfe03('0x0'));var rimraf=require(_0xfe03('0x1'));var zipdir=require(_0xfe03('0x2'));var jsonpatch=require(_0xfe03('0x3'));var rp=require('request-promise');var moment=require(_0xfe03('0x4'));var BPromise=require(_0xfe03('0x5'));var Mustache=require(_0xfe03('0x6'));var util=require(_0xfe03('0x7'));var path=require(_0xfe03('0x8'));var sox=require(_0xfe03('0x9'));var csv=require('to-csv');var ejs=require(_0xfe03('0xa'));var fs=require('fs');var fs_extra=require(_0xfe03('0xb'));var _=require(_0xfe03('0xc'));var squel=require('squel');var crypto=require(_0xfe03('0xd'));var jsforce=require(_0xfe03('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfe03('0xf'));var querystring=require('querystring');var Papa=require(_0xfe03('0x10'));var Redis=require(_0xfe03('0x11'));var authService=require(_0xfe03('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfe03('0x13'));var hardwareService=require(_0xfe03('0x14'));var logger=require(_0xfe03('0x15'))(_0xfe03('0x16'));var utils=require(_0xfe03('0x17'));var config=require(_0xfe03('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe03('0x19'))['db'];function respondWithStatusCode(_0x292f95,_0x5ebdb2){_0x5ebdb2=_0x5ebdb2||0xcc;return function(_0x4382f8){if(_0x4382f8){return _0x292f95['sendStatus'](_0x5ebdb2);}return _0x292f95['status'](_0x5ebdb2)[_0xfe03('0x1a')]();};}function respondWithResult(_0x2f9440,_0x2c0934){_0x2c0934=_0x2c0934||0xc8;return function(_0x3227ac){if(_0x3227ac){return _0x2f9440['status'](_0x2c0934)['json'](_0x3227ac);}};}function respondWithFilteredResult(_0xd130ad,_0x4c8ab0){return function(_0x8e866f){if(_0x8e866f){var _0x1e41fa=typeof _0x4c8ab0[_0xfe03('0x1b')]===_0xfe03('0x1c')&&typeof _0x4c8ab0['limit']===_0xfe03('0x1c');var _0x1fae80=_0x8e866f['count'];var _0x460219=_0x1e41fa?0x0:_0x4c8ab0[_0xfe03('0x1b')];var _0x5707dd=_0x1e41fa?_0x8e866f[_0xfe03('0x1d')]:_0x4c8ab0[_0xfe03('0x1b')]+_0x4c8ab0[_0xfe03('0x1e')];var _0x3aafb2;if(_0x5707dd>=_0x1fae80){_0x5707dd=_0x1fae80;_0x3aafb2=0xc8;}else{_0x3aafb2=0xce;}_0xd130ad[_0xfe03('0x1f')](_0x3aafb2);return _0xd130ad[_0xfe03('0x20')]('Content-Range',_0x460219+'-'+_0x5707dd+'/'+_0x1fae80)[_0xfe03('0x21')](_0x8e866f);}return null;};}function patchUpdates(_0x21c13a){return function(_0x482311){try{jsonpatch[_0xfe03('0x22')](_0x482311,_0x21c13a,!![]);}catch(_0x5da24c){return BPromise[_0xfe03('0x23')](_0x5da24c);}return _0x482311[_0xfe03('0x24')]();};}function saveUpdates(_0x2e1aa0,_0x3d8579){return function(_0x15d9f6){if(_0x15d9f6){return _0x15d9f6[_0xfe03('0x25')](_0x2e1aa0)['then'](function(_0x2843c6){return _0x2843c6;});}return null;};}function removeEntity(_0x56c1fb,_0x511916){return function(_0x503cf7){if(_0x503cf7){return _0x503cf7[_0xfe03('0x26')]()['then'](function(){_0x56c1fb[_0xfe03('0x1f')](0xcc)[_0xfe03('0x1a')]();});}};}function handleEntityNotFound(_0x3d3330,_0x1d5d86){return function(_0x4f6353){if(!_0x4f6353){_0x3d3330[_0xfe03('0x27')](0x194);}return _0x4f6353;};}function handleError(_0x471dcc,_0x465dd8){_0x465dd8=_0x465dd8||0x1f4;return function(_0x1d9861){logger[_0xfe03('0x28')](_0x1d9861['stack']);if(_0x1d9861[_0xfe03('0x29')]){delete _0x1d9861['name'];}_0x471dcc[_0xfe03('0x1f')](_0x465dd8)[_0xfe03('0x2a')](_0x1d9861);};}exports[_0xfe03('0x2b')]=function(_0x194e61,_0x493807){var _0x2fbd5a={},_0x54cf53={},_0x2c4625={'count':0x0,'rows':[]};var _0x204c9d=_[_0xfe03('0x2c')](db[_0xfe03('0x2d')][_0xfe03('0x2e')],function(_0x59e8e3){return{'name':_0x59e8e3['fieldName'],'type':_0x59e8e3[_0xfe03('0x2f')][_0xfe03('0x30')]};});_0x54cf53[_0xfe03('0x31')]=_['map'](_0x204c9d,_0xfe03('0x29'));_0x54cf53['query']=_[_0xfe03('0x32')](_0x194e61[_0xfe03('0x33')]);_0x54cf53[_0xfe03('0x34')]=_[_0xfe03('0x35')](_0x54cf53['model'],_0x54cf53[_0xfe03('0x33')]);_0x2fbd5a[_0xfe03('0x36')]=_[_0xfe03('0x35')](_0x54cf53[_0xfe03('0x31')],qs[_0xfe03('0x37')](_0x194e61[_0xfe03('0x33')][_0xfe03('0x37')]));_0x2fbd5a['attributes']=_0x2fbd5a[_0xfe03('0x36')]['length']?_0x2fbd5a['attributes']:_0x54cf53[_0xfe03('0x31')];if(!_0x194e61[_0xfe03('0x33')]['hasOwnProperty']('nolimit')){_0x2fbd5a[_0xfe03('0x1e')]=qs['limit'](_0x194e61[_0xfe03('0x33')][_0xfe03('0x1e')]);_0x2fbd5a[_0xfe03('0x1b')]=qs[_0xfe03('0x1b')](_0x194e61[_0xfe03('0x33')][_0xfe03('0x1b')]);}_0x2fbd5a[_0xfe03('0x38')]=qs[_0xfe03('0x39')](_0x194e61[_0xfe03('0x33')][_0xfe03('0x39')]);_0x2fbd5a[_0xfe03('0x3a')]=qs[_0xfe03('0x34')](_[_0xfe03('0x3b')](_0x194e61[_0xfe03('0x33')],_0x54cf53['filters']),_0x204c9d);if(_0x194e61['query']['filter']){_0x2fbd5a[_0xfe03('0x3a')]=_[_0xfe03('0x3c')](_0x2fbd5a[_0xfe03('0x3a')],{'$or':_[_0xfe03('0x2c')](_0x204c9d,function(_0x1cbbbd){if(_0x1cbbbd['type']!==_0xfe03('0x3d')){var _0x4ade5a={};_0x4ade5a[_0x1cbbbd['name']]={'$like':'%'+_0x194e61['query'][_0xfe03('0x3e')]+'%'};return _0x4ade5a;}})});}_0x2fbd5a=_[_0xfe03('0x3c')]({},_0x2fbd5a,_0x194e61['options']);var _0x3ce22f={'where':_0x2fbd5a['where']};return db[_0xfe03('0x2d')][_0xfe03('0x1d')](_0x3ce22f)[_0xfe03('0x3f')](function(_0xd3f369){_0x2c4625[_0xfe03('0x1d')]=_0xd3f369;if(_0x194e61[_0xfe03('0x33')]['includeAll']){_0x2fbd5a[_0xfe03('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xfe03('0x41')](_0x2fbd5a);})[_0xfe03('0x3f')](function(_0x1ee3af){_0x2c4625[_0xfe03('0x42')]=_0x1ee3af;return _0x2c4625;})[_0xfe03('0x3f')](respondWithFilteredResult(_0x493807,_0x2fbd5a))[_0xfe03('0x43')](handleError(_0x493807,null));};exports[_0xfe03('0x44')]=function(_0xefe86f,_0x1d618d){var _0x1f263e={'raw':!![],'where':{'id':_0xefe86f['params']['id']}},_0x17cf03={};_0x17cf03[_0xfe03('0x31')]=_[_0xfe03('0x32')](db['CmHopperBlack'][_0xfe03('0x2e')]);_0x17cf03[_0xfe03('0x33')]=_[_0xfe03('0x32')](_0xefe86f[_0xfe03('0x33')]);_0x17cf03[_0xfe03('0x34')]=_[_0xfe03('0x35')](_0x17cf03[_0xfe03('0x31')],_0x17cf03[_0xfe03('0x33')]);_0x1f263e[_0xfe03('0x36')]=_[_0xfe03('0x35')](_0x17cf03[_0xfe03('0x31')],qs[_0xfe03('0x37')](_0xefe86f['query'][_0xfe03('0x37')]));_0x1f263e['attributes']=_0x1f263e[_0xfe03('0x36')]['length']?_0x1f263e[_0xfe03('0x36')]:_0x17cf03['model'];if(_0xefe86f[_0xfe03('0x33')][_0xfe03('0x45')]){_0x1f263e[_0xfe03('0x40')]=[{'all':!![]}];}_0x1f263e=_['merge']({},_0x1f263e,_0xefe86f[_0xfe03('0x46')]);return db[_0xfe03('0x2d')][_0xfe03('0x47')](_0x1f263e)[_0xfe03('0x3f')](handleEntityNotFound(_0x1d618d,null))['then'](respondWithResult(_0x1d618d,null))[_0xfe03('0x43')](handleError(_0x1d618d,null));};exports[_0xfe03('0x25')]=function(_0x3aadba,_0xfbbb52){if(_0x3aadba[_0xfe03('0x48')]['id']){delete _0x3aadba[_0xfe03('0x48')]['id'];}return db[_0xfe03('0x2d')][_0xfe03('0x47')]({'where':{'id':_0x3aadba[_0xfe03('0x49')]['id']}})[_0xfe03('0x3f')](handleEntityNotFound(_0xfbbb52,null))[_0xfe03('0x3f')](saveUpdates(_0x3aadba['body'],null))[_0xfe03('0x3f')](respondWithResult(_0xfbbb52,null))[_0xfe03('0x43')](handleError(_0xfbbb52,null));};exports[_0xfe03('0x26')]=function(_0x57033c,_0x115638){return db[_0xfe03('0x2d')][_0xfe03('0x47')]({'where':{'id':_0x57033c[_0xfe03('0x49')]['id']}})[_0xfe03('0x3f')](handleEntityNotFound(_0x115638,null))[_0xfe03('0x3f')](removeEntity(_0x115638,null))[_0xfe03('0x43')](handleError(_0x115638,null));};exports['describe']=function(_0x3745cb,_0x4631e2){return db['CmHopperBlack'][_0xfe03('0x4a')]()[_0xfe03('0x3f')](respondWithResult(_0x4631e2,null))[_0xfe03('0x43')](handleError(_0x4631e2,null));}; \ No newline at end of file +var _0x9b49=['to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','map','CmHopperBlack','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','params','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0xe9f4a2,_0x50f0c4){var _0x25e066=function(_0x32557f){while(--_0x32557f){_0xe9f4a2['push'](_0xe9f4a2['shift']());}};_0x25e066(++_0x50f0c4);}(_0x9b49,0x16d));var _0x99b4=function(_0x1249f4,_0x27226c){_0x1249f4=_0x1249f4-0x0;var _0x47c8a9=_0x9b49[_0x1249f4];return _0x47c8a9;};'use strict';var emlformat=require(_0x99b4('0x0'));var rimraf=require(_0x99b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99b4('0x2'));var rp=require(_0x99b4('0x3'));var moment=require(_0x99b4('0x4'));var BPromise=require(_0x99b4('0x5'));var Mustache=require(_0x99b4('0x6'));var util=require(_0x99b4('0x7'));var path=require(_0x99b4('0x8'));var sox=require(_0x99b4('0x9'));var csv=require(_0x99b4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99b4('0xb'));var _=require(_0x99b4('0xc'));var squel=require(_0x99b4('0xd'));var crypto=require(_0x99b4('0xe'));var jsforce=require(_0x99b4('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x99b4('0x10'));var Papa=require(_0x99b4('0x11'));var Redis=require(_0x99b4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x99b4('0x13'));var as=require(_0x99b4('0x14'));var hardwareService=require(_0x99b4('0x15'));var logger=require(_0x99b4('0x16'))(_0x99b4('0x17'));var utils=require(_0x99b4('0x18'));var config=require(_0x99b4('0x19'));var licenseUtil=require(_0x99b4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x255f7f,_0x784df5){_0x784df5=_0x784df5||0xcc;return function(_0x2e8a7a){if(_0x2e8a7a){return _0x255f7f[_0x99b4('0x1b')](_0x784df5);}return _0x255f7f[_0x99b4('0x1c')](_0x784df5)[_0x99b4('0x1d')]();};}function respondWithResult(_0x4c7d2b,_0x23338e){_0x23338e=_0x23338e||0xc8;return function(_0x4c465a){if(_0x4c465a){return _0x4c7d2b[_0x99b4('0x1c')](_0x23338e)[_0x99b4('0x1e')](_0x4c465a);}};}function respondWithFilteredResult(_0x285edb,_0x998efd){return function(_0x17c1b5){if(_0x17c1b5){var _0x52181a=typeof _0x998efd[_0x99b4('0x1f')]===_0x99b4('0x20')&&typeof _0x998efd[_0x99b4('0x21')]===_0x99b4('0x20');var _0x2748b1=_0x17c1b5['count'];var _0x1c1dbd=_0x52181a?0x0:_0x998efd[_0x99b4('0x1f')];var _0x40a343=_0x52181a?_0x17c1b5[_0x99b4('0x22')]:_0x998efd['offset']+_0x998efd['limit'];var _0x1000f4;if(_0x40a343>=_0x2748b1){_0x40a343=_0x2748b1;_0x1000f4=0xc8;}else{_0x1000f4=0xce;}_0x285edb[_0x99b4('0x1c')](_0x1000f4);return _0x285edb[_0x99b4('0x23')]('Content-Range',_0x1c1dbd+'-'+_0x40a343+'/'+_0x2748b1)[_0x99b4('0x1e')](_0x17c1b5);}return null;};}function patchUpdates(_0x1420ae){return function(_0x9f0b5f){try{jsonpatch[_0x99b4('0x24')](_0x9f0b5f,_0x1420ae,!![]);}catch(_0x5c2f87){return BPromise[_0x99b4('0x25')](_0x5c2f87);}return _0x9f0b5f[_0x99b4('0x26')]();};}function saveUpdates(_0x409ab9,_0x23f583){return function(_0x4fb9fc){if(_0x4fb9fc){return _0x4fb9fc[_0x99b4('0x27')](_0x409ab9)['then'](function(_0x2353ea){return _0x2353ea;});}return null;};}function removeEntity(_0x1735d4,_0x3fd0f2){return function(_0x266bbe){if(_0x266bbe){return _0x266bbe[_0x99b4('0x28')]()['then'](function(){_0x1735d4[_0x99b4('0x1c')](0xcc)[_0x99b4('0x1d')]();});}};}function handleEntityNotFound(_0x405add,_0x487b3a){return function(_0xbdffba){if(!_0xbdffba){_0x405add[_0x99b4('0x1b')](0x194);}return _0xbdffba;};}function handleError(_0x4d19a0,_0x42b03b){_0x42b03b=_0x42b03b||0x1f4;return function(_0x10c180){logger[_0x99b4('0x29')](_0x10c180[_0x99b4('0x2a')]);if(_0x10c180['name']){delete _0x10c180[_0x99b4('0x2b')];}_0x4d19a0['status'](_0x42b03b)[_0x99b4('0x2c')](_0x10c180);};}exports['index']=function(_0x2ea6d4,_0x552045){var _0x52dae4={},_0x247793={},_0x2f3519={'count':0x0,'rows':[]};var _0x2344d9=_[_0x99b4('0x2d')](db[_0x99b4('0x2e')][_0x99b4('0x2f')],function(_0x57274b){return{'name':_0x57274b['fieldName'],'type':_0x57274b[_0x99b4('0x30')]['key']};});_0x247793[_0x99b4('0x31')]=_[_0x99b4('0x2d')](_0x2344d9,_0x99b4('0x2b'));_0x247793[_0x99b4('0x32')]=_[_0x99b4('0x33')](_0x2ea6d4['query']);_0x247793['filters']=_[_0x99b4('0x34')](_0x247793['model'],_0x247793[_0x99b4('0x32')]);_0x52dae4[_0x99b4('0x35')]=_[_0x99b4('0x34')](_0x247793[_0x99b4('0x31')],qs[_0x99b4('0x36')](_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x36')]));_0x52dae4['attributes']=_0x52dae4[_0x99b4('0x35')]['length']?_0x52dae4[_0x99b4('0x35')]:_0x247793[_0x99b4('0x31')];if(!_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x37')](_0x99b4('0x38'))){_0x52dae4['limit']=qs[_0x99b4('0x21')](_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x21')]);_0x52dae4[_0x99b4('0x1f')]=qs[_0x99b4('0x1f')](_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x1f')]);}_0x52dae4['order']=qs['sort'](_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x39')]);_0x52dae4['where']=qs[_0x99b4('0x3a')](_[_0x99b4('0x3b')](_0x2ea6d4[_0x99b4('0x32')],_0x247793[_0x99b4('0x3a')]),_0x2344d9);if(_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x3c')]){_0x52dae4['where']=_[_0x99b4('0x3d')](_0x52dae4[_0x99b4('0x3e')],{'$or':_['map'](_0x2344d9,function(_0x793f57){if(_0x793f57[_0x99b4('0x30')]!==_0x99b4('0x3f')){var _0x21fc40={};_0x21fc40[_0x793f57[_0x99b4('0x2b')]]={'$like':'%'+_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x3c')]+'%'};return _0x21fc40;}})});}_0x52dae4=_[_0x99b4('0x3d')]({},_0x52dae4,_0x2ea6d4['options']);var _0x47177d={'where':_0x52dae4[_0x99b4('0x3e')]};return db[_0x99b4('0x2e')][_0x99b4('0x22')](_0x47177d)[_0x99b4('0x40')](function(_0x2fcd1f){_0x2f3519[_0x99b4('0x22')]=_0x2fcd1f;if(_0x2ea6d4[_0x99b4('0x32')][_0x99b4('0x41')]){_0x52dae4[_0x99b4('0x42')]=[{'all':!![]}];}return db[_0x99b4('0x2e')][_0x99b4('0x43')](_0x52dae4);})[_0x99b4('0x40')](function(_0x49433e){_0x2f3519[_0x99b4('0x44')]=_0x49433e;return _0x2f3519;})[_0x99b4('0x40')](respondWithFilteredResult(_0x552045,_0x52dae4))[_0x99b4('0x45')](handleError(_0x552045,null));};exports[_0x99b4('0x46')]=function(_0x11be88,_0x3555c5){var _0x285d37={'raw':!![],'where':{'id':_0x11be88[_0x99b4('0x47')]['id']}},_0x5f57e9={};_0x5f57e9[_0x99b4('0x31')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x5f57e9[_0x99b4('0x32')]=_[_0x99b4('0x33')](_0x11be88[_0x99b4('0x32')]);_0x5f57e9['filters']=_[_0x99b4('0x34')](_0x5f57e9[_0x99b4('0x31')],_0x5f57e9[_0x99b4('0x32')]);_0x285d37[_0x99b4('0x35')]=_['intersection'](_0x5f57e9[_0x99b4('0x31')],qs[_0x99b4('0x36')](_0x11be88['query'][_0x99b4('0x36')]));_0x285d37[_0x99b4('0x35')]=_0x285d37[_0x99b4('0x35')]['length']?_0x285d37[_0x99b4('0x35')]:_0x5f57e9[_0x99b4('0x31')];if(_0x11be88[_0x99b4('0x32')][_0x99b4('0x41')]){_0x285d37[_0x99b4('0x42')]=[{'all':!![]}];}_0x285d37=_['merge']({},_0x285d37,_0x11be88['options']);return db[_0x99b4('0x2e')]['find'](_0x285d37)[_0x99b4('0x40')](handleEntityNotFound(_0x3555c5,null))['then'](respondWithResult(_0x3555c5,null))[_0x99b4('0x45')](handleError(_0x3555c5,null));};exports[_0x99b4('0x27')]=function(_0x5531d4,_0x1a23a5){if(_0x5531d4[_0x99b4('0x48')]['id']){delete _0x5531d4['body']['id'];}return db[_0x99b4('0x2e')][_0x99b4('0x49')]({'where':{'id':_0x5531d4[_0x99b4('0x47')]['id']}})[_0x99b4('0x40')](handleEntityNotFound(_0x1a23a5,null))[_0x99b4('0x40')](saveUpdates(_0x5531d4[_0x99b4('0x48')],null))[_0x99b4('0x40')](respondWithResult(_0x1a23a5,null))['catch'](handleError(_0x1a23a5,null));};exports['destroy']=function(_0x344b0e,_0x151c2e){return db[_0x99b4('0x2e')][_0x99b4('0x49')]({'where':{'id':_0x344b0e[_0x99b4('0x47')]['id']}})[_0x99b4('0x40')](handleEntityNotFound(_0x151c2e,null))[_0x99b4('0x40')](removeEntity(_0x151c2e,null))[_0x99b4('0x45')](handleError(_0x151c2e,null));};exports[_0x99b4('0x4a')]=function(_0x1c836b,_0x281c97){return db[_0x99b4('0x2e')][_0x99b4('0x4a')]()[_0x99b4('0x40')](respondWithResult(_0x281c97,null))[_0x99b4('0x45')](handleError(_0x281c97,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3fab57f..5326490 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 _0x2188=['bluebird','request-promise','path','CmHopperBlack','cm_hopper_black','lodash','util','moment'];(function(_0x17511b,_0x2e7849){var _0x433136=function(_0x1d5e6c){while(--_0x1d5e6c){_0x17511b['push'](_0x17511b['shift']());}};_0x433136(++_0x2e7849);}(_0x2188,0x10d));var _0x8218=function(_0x512a65,_0x3d1c0c){_0x512a65=_0x512a65-0x0;var _0x2d3472=_0x2188[_0x512a65];return _0x2d3472;};'use strict';var _=require(_0x8218('0x0'));var util=require(_0x8218('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8218('0x2'));var BPromise=require(_0x8218('0x3'));var rp=require(_0x8218('0x4'));var fs=require('fs');var path=require(_0x8218('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x53efdc,_0x455790){return _0x53efdc['define'](_0x8218('0x6'),attributes,{'tableName':_0x8218('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c2c=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','../../config/logger'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5c2c,0x112));var _0xc5c2=function(_0x8c8176,_0x5360a1){_0x8c8176=_0x8c8176-0x0;var _0x4dc47b=_0x5c2c[_0x8c8176];return _0x4dc47b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc5c2('0x0'))(_0xc5c2('0x1'));var moment=require('moment');var BPromise=require(_0xc5c2('0x2'));var rp=require(_0xc5c2('0x3'));var fs=require('fs');var path=require(_0xc5c2('0x4'));var rimraf=require(_0xc5c2('0x5'));var config=require(_0xc5c2('0x6'));var attributes=require(_0xc5c2('0x7'));module['exports']=function(_0x480c70,_0x1e72b4){return _0x480c70[_0xc5c2('0x8')](_0xc5c2('0x9'),attributes,{'tableName':_0xc5c2('0xa'),'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 ef1b3f6..c8798f5 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 _0x3e1d=['limit','include','map','model','attributes','GetCmHopperBlack','catch','UpdateCmHopperBlack','CmHopperBlack','body','destroy','DestroyCmHopperBlack','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','info','findAll','options','raw','where'];(function(_0x5b5ff8,_0x4b6053){var _0x556752=function(_0xc5976d){while(--_0xc5976d){_0x5b5ff8['push'](_0x5b5ff8['shift']());}};_0x556752(++_0x4b6053);}(_0x3e1d,0xa8));var _0xd3e1=function(_0x552352,_0x51e3b0){_0x552352=_0x552352-0x0;var _0x1e0d71=_0x3e1d[_0x552352];return _0x1e0d71;};'use strict';var _=require(_0xd3e1('0x0'));var util=require(_0xd3e1('0x1'));var moment=require(_0xd3e1('0x2'));var BPromise=require('bluebird');var rs=require(_0xd3e1('0x3'));var fs=require('fs');var Redis=require(_0xd3e1('0x4'));var db=require(_0xd3e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3e1('0x6'))(_0xd3e1('0x7'));var config=require(_0xd3e1('0x8'));var jayson=require(_0xd3e1('0x9'));var client=jayson[_0xd3e1('0xa')][_0xd3e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17929a,_0x1fd2a7,_0xe6a815){return new BPromise(function(_0x49f194,_0x359d52){return client[_0xd3e1('0xc')](_0x17929a,_0xe6a815)[_0xd3e1('0xd')](function(_0x456177){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x1fd2a7,_0xd3e1('0xe'));logger[_0xd3e1('0xf')](_0xd3e1('0x10'),_0x1fd2a7,_0xd3e1('0xe'),JSON[_0xd3e1('0x11')](_0x456177));if(_0x456177['error']){if(_0x456177[_0xd3e1('0x12')][_0xd3e1('0x13')]===0x1f4){logger['error'](_0xd3e1('0x14'),_0x1fd2a7,_0x456177[_0xd3e1('0x12')]['message']);return _0x359d52(_0x456177[_0xd3e1('0x12')][_0xd3e1('0x15')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1fd2a7,_0x456177['error'][_0xd3e1('0x15')]);return _0x49f194(_0x456177['error'][_0xd3e1('0x15')]);}else{logger[_0xd3e1('0x16')]('CmHopperBlack,\x20%s,\x20%s',_0x1fd2a7,_0xd3e1('0xe'));_0x49f194(_0x456177['result'][_0xd3e1('0x15')]);}})['catch'](function(_0x2379d9){logger['error'](_0xd3e1('0x14'),_0x1fd2a7,_0x2379d9);_0x359d52(_0x2379d9);});});}exports['GetCmHopperBlack']=function(_0x5a80d6){var _0x2b3dc3=this;return new Promise(function(_0x3b6bcf,_0x4a6817){return db['CmHopperBlack'][_0xd3e1('0x17')]({'raw':_0x5a80d6[_0xd3e1('0x18')]?_0x5a80d6[_0xd3e1('0x18')][_0xd3e1('0x19')]===undefined?!![]:![]:!![],'where':_0x5a80d6['options']?_0x5a80d6[_0xd3e1('0x18')][_0xd3e1('0x1a')]||null:null,'attributes':_0x5a80d6[_0xd3e1('0x18')]?_0x5a80d6[_0xd3e1('0x18')]['attributes']||null:null,'limit':_0x5a80d6[_0xd3e1('0x18')]?_0x5a80d6[_0xd3e1('0x18')][_0xd3e1('0x1b')]||null:null,'include':_0x5a80d6[_0xd3e1('0x18')]?_0x5a80d6['options'][_0xd3e1('0x1c')]?_[_0xd3e1('0x1d')](_0x5a80d6['options'][_0xd3e1('0x1c')],function(_0x17609f){return{'model':db[_0x17609f[_0xd3e1('0x1e')]],'as':_0x17609f['as'],'attributes':_0x17609f[_0xd3e1('0x1f')],'include':_0x17609f[_0xd3e1('0x1c')]?_[_0xd3e1('0x1d')](_0x17609f[_0xd3e1('0x1c')],function(_0xa805ff){return{'model':db[_0xa805ff[_0xd3e1('0x1e')]],'as':_0xa805ff['as'],'attributes':_0xa805ff[_0xd3e1('0x1f')],'include':_0xa805ff[_0xd3e1('0x1c')]?_[_0xd3e1('0x1d')](_0xa805ff['include'],function(_0x5aad7b){return{'model':db[_0x5aad7b[_0xd3e1('0x1e')]],'as':_0x5aad7b['as'],'attributes':_0x5aad7b[_0xd3e1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd3e1('0xd')](function(_0x2d0517){logger['info'](_0xd3e1('0x20'),_0x5a80d6);logger[_0xd3e1('0xf')](_0xd3e1('0x20'),_0x5a80d6,JSON['stringify'](_0x2d0517));_0x3b6bcf(_0x2d0517);})[_0xd3e1('0x21')](function(_0x301aca){logger[_0xd3e1('0x12')](_0xd3e1('0x20'),_0x301aca[_0xd3e1('0x15')],_0x5a80d6);_0x4a6817(_0x2b3dc3[_0xd3e1('0x12')](0x1f4,_0x301aca[_0xd3e1('0x15')]));});});};exports[_0xd3e1('0x22')]=function(_0x1f5c5b){var _0x4ac04f=this;return new Promise(function(_0x1db460,_0x1368ef){return db[_0xd3e1('0x23')]['update'](_0x1f5c5b[_0xd3e1('0x24')],{'raw':_0x1f5c5b[_0xd3e1('0x18')]?_0x1f5c5b[_0xd3e1('0x18')][_0xd3e1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f5c5b['options']?_0x1f5c5b[_0xd3e1('0x18')][_0xd3e1('0x1a')]||null:null,'attributes':_0x1f5c5b['options']?_0x1f5c5b[_0xd3e1('0x18')][_0xd3e1('0x1f')]||null:null,'limit':_0x1f5c5b['options']?_0x1f5c5b[_0xd3e1('0x18')][_0xd3e1('0x1b')]||null:null})[_0xd3e1('0xd')](function(_0x21a2c8){logger[_0xd3e1('0x16')](_0xd3e1('0x22'),_0x1f5c5b);logger['debug'](_0xd3e1('0x22'),_0x1f5c5b,JSON[_0xd3e1('0x11')](_0x21a2c8));_0x1db460(_0x21a2c8);})['catch'](function(_0x3d323f){logger[_0xd3e1('0x12')](_0xd3e1('0x22'),_0x3d323f['message'],_0x1f5c5b);_0x1368ef(_0x4ac04f[_0xd3e1('0x12')](0x1f4,_0x3d323f['message']));});});};exports['DestroyCmHopperBlack']=function(_0x431173){var _0x4a37db=this;return new Promise(function(_0x29cd29,_0x443339){return db[_0xd3e1('0x23')][_0xd3e1('0x25')]({'where':_0x431173['options']?_0x431173['options'][_0xd3e1('0x1a')]||null:null})['then'](function(_0x59e504){logger[_0xd3e1('0x16')]('DestroyCmHopperBlack',_0x431173);logger[_0xd3e1('0xf')](_0xd3e1('0x26'),_0x431173,JSON['stringify'](_0x59e504));_0x29cd29(_0x59e504);})[_0xd3e1('0x21')](function(_0x286563){logger['error']('DestroyCmHopperBlack',_0x286563[_0xd3e1('0x15')],_0x431173);_0x443339(_0x4a37db[_0xd3e1('0x12')](0x1f4,_0x286563[_0xd3e1('0x15')]));});});}; \ No newline at end of file +var _0x6b74=['destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','body','where'];(function(_0x8524c7,_0x47dc3a){var _0xbc97f7=function(_0x10f77b){while(--_0x10f77b){_0x8524c7['push'](_0x8524c7['shift']());}};_0xbc97f7(++_0x47dc3a);}(_0x6b74,0x9e));var _0x46b7=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0x6b74[_0x2b4448];return _0xb4b465;};'use strict';var _=require(_0x46b7('0x0'));var util=require(_0x46b7('0x1'));var moment=require(_0x46b7('0x2'));var BPromise=require(_0x46b7('0x3'));var rs=require(_0x46b7('0x4'));var fs=require('fs');var Redis=require(_0x46b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x46b7('0x6'));var logger=require('../../config/logger')(_0x46b7('0x7'));var config=require(_0x46b7('0x8'));var jayson=require(_0x46b7('0x9'));var client=jayson[_0x46b7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x527cae,_0x36b2cd,_0x1e5713){return new BPromise(function(_0x49661a,_0x4b2e83){return client[_0x46b7('0xb')](_0x527cae,_0x1e5713)[_0x46b7('0xc')](function(_0x488513){logger[_0x46b7('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x36b2cd,_0x46b7('0xe'));logger[_0x46b7('0xf')](_0x46b7('0x10'),_0x36b2cd,'request\x20sent',JSON['stringify'](_0x488513));if(_0x488513[_0x46b7('0x11')]){if(_0x488513['error'][_0x46b7('0x12')]===0x1f4){logger['error'](_0x46b7('0x13'),_0x36b2cd,_0x488513['error']['message']);return _0x4b2e83(_0x488513['error'][_0x46b7('0x14')]);}logger[_0x46b7('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x36b2cd,_0x488513[_0x46b7('0x11')]['message']);return _0x49661a(_0x488513[_0x46b7('0x11')]['message']);}else{logger[_0x46b7('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x36b2cd,_0x46b7('0xe'));_0x49661a(_0x488513[_0x46b7('0x15')]['message']);}})[_0x46b7('0x16')](function(_0x391741){logger[_0x46b7('0x11')](_0x46b7('0x13'),_0x36b2cd,_0x391741);_0x4b2e83(_0x391741);});});}exports[_0x46b7('0x17')]=function(_0x19c9b3){var _0x98f934=this;return new Promise(function(_0x5314d9,_0x4a7f62){return db[_0x46b7('0x18')][_0x46b7('0x19')]({'raw':_0x19c9b3[_0x46b7('0x1a')]?_0x19c9b3[_0x46b7('0x1a')][_0x46b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x19c9b3[_0x46b7('0x1a')]?_0x19c9b3[_0x46b7('0x1a')]['where']||null:null,'attributes':_0x19c9b3[_0x46b7('0x1a')]?_0x19c9b3[_0x46b7('0x1a')][_0x46b7('0x1c')]||null:null,'limit':_0x19c9b3[_0x46b7('0x1a')]?_0x19c9b3[_0x46b7('0x1a')][_0x46b7('0x1d')]||null:null,'include':_0x19c9b3['options']?_0x19c9b3['options'][_0x46b7('0x1e')]?_[_0x46b7('0x1f')](_0x19c9b3[_0x46b7('0x1a')][_0x46b7('0x1e')],function(_0x317355){return{'model':db[_0x317355[_0x46b7('0x20')]],'as':_0x317355['as'],'attributes':_0x317355['attributes'],'include':_0x317355[_0x46b7('0x1e')]?_[_0x46b7('0x1f')](_0x317355[_0x46b7('0x1e')],function(_0x14a3cb){return{'model':db[_0x14a3cb[_0x46b7('0x20')]],'as':_0x14a3cb['as'],'attributes':_0x14a3cb[_0x46b7('0x1c')],'include':_0x14a3cb[_0x46b7('0x1e')]?_[_0x46b7('0x1f')](_0x14a3cb[_0x46b7('0x1e')],function(_0x44ecbb){return{'model':db[_0x44ecbb[_0x46b7('0x20')]],'as':_0x44ecbb['as'],'attributes':_0x44ecbb[_0x46b7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x46b7('0xc')](function(_0x1f77ac){logger['info'](_0x46b7('0x17'),_0x19c9b3);logger[_0x46b7('0xf')](_0x46b7('0x17'),_0x19c9b3,JSON[_0x46b7('0x21')](_0x1f77ac));_0x5314d9(_0x1f77ac);})['catch'](function(_0x3fff8b){logger[_0x46b7('0x11')](_0x46b7('0x17'),_0x3fff8b[_0x46b7('0x14')],_0x19c9b3);_0x4a7f62(_0x98f934['error'](0x1f4,_0x3fff8b['message']));});});};exports[_0x46b7('0x22')]=function(_0x2b6fe9){var _0x3cdd29=this;return new Promise(function(_0x42f8d0,_0x20f9dc){return db[_0x46b7('0x18')]['update'](_0x2b6fe9[_0x46b7('0x23')],{'raw':_0x2b6fe9[_0x46b7('0x1a')]?_0x2b6fe9[_0x46b7('0x1a')][_0x46b7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b6fe9[_0x46b7('0x1a')]?_0x2b6fe9[_0x46b7('0x1a')][_0x46b7('0x24')]||null:null,'attributes':_0x2b6fe9[_0x46b7('0x1a')]?_0x2b6fe9['options'][_0x46b7('0x1c')]||null:null,'limit':_0x2b6fe9[_0x46b7('0x1a')]?_0x2b6fe9['options'][_0x46b7('0x1d')]||null:null})[_0x46b7('0xc')](function(_0x155b74){logger[_0x46b7('0xd')](_0x46b7('0x22'),_0x2b6fe9);logger[_0x46b7('0xf')](_0x46b7('0x22'),_0x2b6fe9,JSON['stringify'](_0x155b74));_0x42f8d0(_0x155b74);})[_0x46b7('0x16')](function(_0x40793f){logger[_0x46b7('0x11')](_0x46b7('0x22'),_0x40793f[_0x46b7('0x14')],_0x2b6fe9);_0x20f9dc(_0x3cdd29[_0x46b7('0x11')](0x1f4,_0x40793f['message']));});});};exports['DestroyCmHopperBlack']=function(_0x5e489c){var _0x52b707=this;return new Promise(function(_0x107171,_0x11e5c2){return db[_0x46b7('0x18')][_0x46b7('0x25')]({'where':_0x5e489c['options']?_0x5e489c[_0x46b7('0x1a')][_0x46b7('0x24')]||null:null})[_0x46b7('0xc')](function(_0x4985a5){logger[_0x46b7('0xd')](_0x46b7('0x26'),_0x5e489c);logger[_0x46b7('0xf')]('DestroyCmHopperBlack',_0x5e489c,JSON[_0x46b7('0x21')](_0x4985a5));_0x107171(_0x4985a5);})[_0x46b7('0x16')](function(_0x122218){logger[_0x46b7('0x11')]('DestroyCmHopperBlack',_0x122218['message'],_0x5e489c);_0x11e5c2(_0x52b707[_0x46b7('0x11')](0x1f4,_0x122218['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index c4b7b71..a518e81 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 _0xaa3f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util'];(function(_0x2b5048,_0x4d95e2){var _0x154813=function(_0x43bb16){while(--_0x43bb16){_0x2b5048['push'](_0x2b5048['shift']());}};_0x154813(++_0x4d95e2);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x1ee590,_0x2ec068){_0x1ee590=_0x1ee590-0x0;var _0x28846f=_0xaa3f[_0x1ee590];return _0x28846f;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0x9')](_0xfaa3('0xe'),auth['isAuthenticated'](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfaa3('0x11')]);router[_0xfaa3('0x12')](_0xfaa3('0xe'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x13')]);module[_0xfaa3('0x14')]=router; \ No newline at end of file +var _0xfb65=['put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x48a212,_0x1aeab6){var _0x43c165=function(_0x27cf11){while(--_0x27cf11){_0x48a212['push'](_0x48a212['shift']());}};_0x43c165(++_0x1aeab6);}(_0xfb65,0x82));var _0x5fb6=function(_0x5dfd07,_0x11f42e){_0x5dfd07=_0x5dfd07-0x0;var _0x10cd46=_0xfb65[_0x5dfd07];return _0x10cd46;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0xe')]('/:id',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xf')]);router['delete'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x10')]);module[_0x5fb6('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 6f39648..ef668f6 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 _0x36b0=['getDataValue','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x36b0,0x1bf));var _0x036b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x36b0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x036b('0x0')]={'state':{'type':Sequelize[_0x036b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x036b('0x2')]},'scheduledat':{'type':Sequelize[_0x036b('0x3')]},'countbusyretry':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x036b('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x036b('0x2')]},'calleridnum':{'type':Sequelize[_0x036b('0x2')]},'calleridname':{'type':Sequelize[_0x036b('0x2')]},'starttime':{'type':Sequelize[_0x036b('0x3')]},'responsetime':{'type':Sequelize[_0x036b('0x3')]},'answertime':{'type':Sequelize[_0x036b('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x036b('0x3')]},'ringtime':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x036b('0x2')]},'campaign':{'type':Sequelize[_0x036b('0x2')]},'campaigntype':{'type':Sequelize[_0x036b('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x036b('0x2')]},'disposition':{'type':Sequelize[_0x036b('0x2')]},'secondDisposition':{'type':Sequelize[_0x036b('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x036b('0x3')],'set':function(_0x58242a){var _0x33eeaf=this[_0x036b('0x4')]('endtime');if(_0x33eeaf&&_0x58242a){this[_0x036b('0x5')](_0x036b('0x6'),moment(_0x58242a)[_0x036b('0x7')](moment(_0x33eeaf),_0x036b('0x8')));}return this[_0x036b('0x5')](_0x036b('0x9'),_0x58242a);}},'amd':{'type':Sequelize[_0x036b('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x036b('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x036b('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x036b('0x3')]},'callback':{'type':Sequelize[_0x036b('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x036b('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x036b('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x036b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdd6e=['DATE','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0x52646c,_0x509c6f){var _0x53339b=function(_0x19b1fd){while(--_0x19b1fd){_0x52646c['push'](_0x52646c['shift']());}};_0x53339b(++_0x509c6f);}(_0xdd6e,0xf2));var _0xedd6=function(_0xbe6a18,_0x13bb10){_0xbe6a18=_0xbe6a18-0x0;var _0x3e41e1=_0xdd6e[_0xbe6a18];return _0x3e41e1;};'use strict';var Sequelize=require(_0xedd6('0x0'));var moment=require(_0xedd6('0x1'));module[_0xedd6('0x2')]={'state':{'type':Sequelize[_0xedd6('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xedd6('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xedd6('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xedd6('0x4')]},'calleridnum':{'type':Sequelize[_0xedd6('0x4')]},'calleridname':{'type':Sequelize[_0xedd6('0x4')]},'starttime':{'type':Sequelize[_0xedd6('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xedd6('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xedd6('0x4')]},'campaign':{'type':Sequelize[_0xedd6('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xedd6('0x4')]},'reason':{'type':Sequelize[_0xedd6('0x4')]},'disposition':{'type':Sequelize[_0xedd6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xedd6('0x4')]},'dispositionat':{'type':Sequelize[_0xedd6('0x5')],'set':function(_0x36a497){var _0x35696a=this['getDataValue'](_0xedd6('0x6'));if(_0x35696a&&_0x36a497){this[_0xedd6('0x7')](_0xedd6('0x8'),moment(_0x36a497)[_0xedd6('0x9')](moment(_0x35696a),_0xedd6('0xa')));}return this[_0xedd6('0x7')](_0xedd6('0xb'),_0x36a497);}},'amd':{'type':Sequelize[_0xedd6('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xedd6('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xedd6('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xedd6('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xedd6('0x5')]},'recallme':{'type':Sequelize[_0xedd6('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xedd6('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index ac8a4b8..567d5d2 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(_0x297544,_0x378fa4){var _0x482915=function(_0xfaded7){while(--_0xfaded7){_0x297544['push'](_0x297544['shift']());}};_0x482915(++_0x378fa4);}(_0xc2c7,0x134));var _0x7c2c=function(_0x21d467,_0x340b66){_0x21d467=_0x21d467-0x0;var _0x4f2cd3=_0xc2c7[_0x21d467];return _0x4f2cd3;};'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 _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x2331f8,_0x446a3a){var _0x244773=function(_0x2accba){while(--_0x2accba){_0x2331f8['push'](_0x2331f8['shift']());}};_0x244773(++_0x446a3a);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8b667fa..22f4371 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 _0x3a14=['util','../../config/logger','moment','bluebird','path','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x3a14,0xf0));var _0x43a1=function(_0x753716,_0x1355ec){_0x753716=_0x753716-0x0;var _0x424e50=_0x3a14[_0x753716];return _0x424e50;};'use strict';var _=require('lodash');var util=require(_0x43a1('0x0'));var logger=require(_0x43a1('0x1'))('api');var moment=require(_0x43a1('0x2'));var BPromise=require(_0x43a1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43a1('0x4'));var rimraf=require('rimraf');var config=require(_0x43a1('0x5'));var attributes=require(_0x43a1('0x6'));module[_0x43a1('0x7')]=function(_0x4b448a,_0xc9af37){return _0x4b448a[_0x43a1('0x8')]('CmHopperFinal',attributes,{'tableName':_0x43a1('0x9'),'paranoid':![],'indexes':[{'name':_0x43a1('0xa'),'fields':[_0x43a1('0xa')]},{'name':'uniqueid','fields':[_0x43a1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8938=['exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','../../config/logger','moment','bluebird','path','rimraf','./cmHopperFinal.attributes'];(function(_0x12546c,_0x4678e2){var _0x49815b=function(_0x5c1493){while(--_0x5c1493){_0x12546c['push'](_0x12546c['shift']());}};_0x49815b(++_0x4678e2);}(_0x8938,0x170));var _0x8893=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x8938[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8893('0x0'))('api');var moment=require(_0x8893('0x1'));var BPromise=require(_0x8893('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8893('0x3'));var rimraf=require(_0x8893('0x4'));var config=require('../../config/environment');var attributes=require(_0x8893('0x5'));module[_0x8893('0x6')]=function(_0x142622,_0x594671){return _0x142622['define'](_0x8893('0x7'),attributes,{'tableName':_0x8893('0x8'),'paranoid':![],'indexes':[{'name':_0x8893('0x9'),'fields':['calleridnum']},{'name':_0x8893('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 4a68103..8b049c6 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(_0x86f42f,_0x1c636a){var _0x58cf06=function(_0xcb00b1){while(--_0xcb00b1){_0x86f42f['push'](_0x86f42f['shift']());}};_0x58cf06(++_0x1c636a);}(_0xb10b,0x12a));var _0xbb10=function(_0x40124e,_0x47920b){_0x40124e=_0x40124e-0x0;var _0x2e8dc2=_0xb10b[_0x40124e];return _0x2e8dc2;};'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(_0x4be16a,_0x503112){var _0x302b28=function(_0x2f6ca4){while(--_0x2f6ca4){_0x4be16a['push'](_0x4be16a['shift']());}};_0x302b28(++_0x503112);}(_0xb10b,0x12a));var _0xbb10=function(_0x65f140,_0x45cbc7){_0x65f140=_0x65f140-0x0;var _0x18fbda=_0xb10b[_0x65f140];return _0x18fbda;};'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 769c789..369571c 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 _0xc5e4=['./cmHopperFinal.controller','get','isAuthenticated','index','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','put','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x43fe73,_0x5ac74c){var _0x5c4e0a=function(_0x5781b7){while(--_0x5781b7){_0x43fe73['push'](_0x43fe73['shift']());}};_0x5c4e0a(++_0x5ac74c);}(_0xc5e4,0x117));var _0x4c5e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc5e4[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x4c5e('0x0'));var path=require(_0x4c5e('0x1'));var timeout=require('connect-timeout');var express=require(_0x4c5e('0x2'));var router=express[_0x4c5e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4c5e('0x4'));var interaction=require(_0x4c5e('0x5'));var config=require(_0x4c5e('0x6'));var controller=require(_0x4c5e('0x7'));router[_0x4c5e('0x8')]('/',auth[_0x4c5e('0x9')](),controller[_0x4c5e('0xa')]);router[_0x4c5e('0x8')]('/describe',auth[_0x4c5e('0x9')](),controller['describe']);router[_0x4c5e('0x8')](_0x4c5e('0xb'),auth[_0x4c5e('0x9')](),controller[_0x4c5e('0xc')]);router[_0x4c5e('0x8')](_0x4c5e('0xd'),auth['isAuthenticated'](),controller[_0x4c5e('0xe')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0x4c5e('0xf')]);router['post'](_0x4c5e('0x10'),auth[_0x4c5e('0x9')](),controller[_0x4c5e('0x11')]);router['post'](_0x4c5e('0x12'),auth[_0x4c5e('0x9')](),controller[_0x4c5e('0x13')]);router[_0x4c5e('0x14')](_0x4c5e('0x15'),auth[_0x4c5e('0x9')](),controller[_0x4c5e('0x16')]);router[_0x4c5e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x4c5e('0x18')]);module[_0x4c5e('0x19')]=router; \ No newline at end of file +var _0x2c26=['/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x2c26,0xb4));var _0x62c2=function(_0x465d34,_0x3f778e){_0x465d34=_0x465d34-0x0;var _0x26d2c2=_0x2c26[_0x465d34];return _0x26d2c2;};'use strict';var multer=require(_0x62c2('0x0'));var util=require(_0x62c2('0x1'));var path=require(_0x62c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x62c2('0x3'));var router=express[_0x62c2('0x4')]();var fs_extra=require(_0x62c2('0x5'));var auth=require(_0x62c2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x62c2('0x7'));var controller=require(_0x62c2('0x8'));router[_0x62c2('0x9')]('/',auth[_0x62c2('0xa')](),controller[_0x62c2('0xb')]);router[_0x62c2('0x9')](_0x62c2('0xc'),auth[_0x62c2('0xa')](),controller[_0x62c2('0xd')]);router[_0x62c2('0x9')]('/:id',auth[_0x62c2('0xa')](),controller['show']);router[_0x62c2('0x9')](_0x62c2('0xe'),auth[_0x62c2('0xa')](),controller[_0x62c2('0xf')]);router[_0x62c2('0x9')](_0x62c2('0x10'),auth[_0x62c2('0xa')](),controller[_0x62c2('0x11')]);router['post'](_0x62c2('0x12'),auth[_0x62c2('0xa')](),controller[_0x62c2('0x13')]);router[_0x62c2('0x14')](_0x62c2('0x15'),auth[_0x62c2('0xa')](),controller[_0x62c2('0x16')]);router[_0x62c2('0x14')](_0x62c2('0x17'),auth['isAuthenticated'](),controller[_0x62c2('0x18')]);router[_0x62c2('0x19')](_0x62c2('0x1a'),auth[_0x62c2('0xa')](),controller[_0x62c2('0x1b')]);module[_0x62c2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 9febaca..82e902e 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 _0xabef=['INTEGER','BOOLEAN','sequelize','STRING','DATE'];(function(_0x5d88a2,_0x263f79){var _0x206f65=function(_0x3ec538){while(--_0x3ec538){_0x5d88a2['push'](_0x5d88a2['shift']());}};_0x206f65(++_0x263f79);}(_0xabef,0x15b));var _0xfabe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xabef[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xfabe('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xfabe('0x1')]},'scheduledat':{'type':Sequelize[_0xfabe('0x2')]},'countbusyretry':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfabe('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xfabe('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfabe('0x1')]},'calleridname':{'type':Sequelize[_0xfabe('0x1')]},'starttime':{'type':Sequelize[_0xfabe('0x2')]},'responsetime':{'type':Sequelize[_0xfabe('0x2')]},'answertime':{'type':Sequelize[_0xfabe('0x2')]},'droptime':{'type':Sequelize[_0xfabe('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xfabe('0x1')]},'campaigntype':{'type':Sequelize[_0xfabe('0x1')]},'membername':{'type':Sequelize[_0xfabe('0x1')]},'reason':{'type':Sequelize[_0xfabe('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xfabe('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xfabe('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfabe('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xfabe('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xfabe('0x2')]},'edited':{'type':Sequelize[_0xfabe('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfabe('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3495=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x335986,_0x2225b0){var _0x4520af=function(_0x58046d){while(--_0x58046d){_0x335986['push'](_0x335986['shift']());}};_0x4520af(++_0x2225b0);}(_0x3495,0x1c2));var _0x5349=function(_0x46f09d,_0x5587d8){_0x46f09d=_0x46f09d-0x0;var _0xd1627f=_0x3495[_0x46f09d];return _0xd1627f;};'use strict';var Sequelize=require(_0x5349('0x0'));module[_0x5349('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5349('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5349('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x5349('0x2')]},'originatecalleridname':{'type':Sequelize[_0x5349('0x2')]},'calleridnum':{'type':Sequelize[_0x5349('0x2')]},'calleridname':{'type':Sequelize[_0x5349('0x2')]},'starttime':{'type':Sequelize[_0x5349('0x4')]},'responsetime':{'type':Sequelize[_0x5349('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5349('0x4')]},'ringtime':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5349('0x2')]},'reason':{'type':Sequelize[_0x5349('0x2')]},'amd':{'type':Sequelize[_0x5349('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5349('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5349('0x4')]},'recallme':{'type':Sequelize[_0x5349('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5349('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5349('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b0f72f7..01fb321 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 _0xc6b3=['save','update','then','destroy','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','fields','create','body','uniqueid','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0xc6b3,0xb0));var _0x3c6b=function(_0x183d0e,_0x1f520f){_0x183d0e=_0x183d0e-0x0;var _0x278ff8=_0xc6b3[_0x183d0e];return _0x278ff8;};'use strict';var emlformat=require(_0x3c6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c6b('0x2'));var moment=require(_0x3c6b('0x3'));var BPromise=require(_0x3c6b('0x4'));var Mustache=require(_0x3c6b('0x5'));var util=require(_0x3c6b('0x6'));var path=require(_0x3c6b('0x7'));var sox=require('sox');var csv=require(_0x3c6b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c6b('0x9'));var _=require('lodash');var squel=require(_0x3c6b('0xa'));var crypto=require(_0x3c6b('0xb'));var jsforce=require(_0x3c6b('0xc'));var deskjs=require(_0x3c6b('0xd'));var toCsv=require(_0x3c6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3c6b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3c6b('0xf'));var hardwareService=require(_0x3c6b('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x3c6b('0x11'));var config=require(_0x3c6b('0x12'));var licenseUtil=require(_0x3c6b('0x13'));var db=require(_0x3c6b('0x14'))['db'];function respondWithStatusCode(_0x5ac6a6,_0x450ffd){_0x450ffd=_0x450ffd||0xcc;return function(_0x3951c7){if(_0x3951c7){return _0x5ac6a6[_0x3c6b('0x15')](_0x450ffd);}return _0x5ac6a6[_0x3c6b('0x16')](_0x450ffd)[_0x3c6b('0x17')]();};}function respondWithResult(_0x41559a,_0x2ebe3d){_0x2ebe3d=_0x2ebe3d||0xc8;return function(_0x212097){if(_0x212097){return _0x41559a[_0x3c6b('0x16')](_0x2ebe3d)[_0x3c6b('0x18')](_0x212097);}};}function respondWithFilteredResult(_0x5a0623,_0x90e285){return function(_0x1ead29){if(_0x1ead29){var _0x5d589c=typeof _0x90e285[_0x3c6b('0x19')]===_0x3c6b('0x1a')&&typeof _0x90e285[_0x3c6b('0x1b')]===_0x3c6b('0x1a');var _0x4f387e=_0x1ead29[_0x3c6b('0x1c')];var _0x5f1474=_0x5d589c?0x0:_0x90e285['offset'];var _0x23c681=_0x5d589c?_0x1ead29[_0x3c6b('0x1c')]:_0x90e285['offset']+_0x90e285[_0x3c6b('0x1b')];var _0x7c25c9;if(_0x23c681>=_0x4f387e){_0x23c681=_0x4f387e;_0x7c25c9=0xc8;}else{_0x7c25c9=0xce;}_0x5a0623[_0x3c6b('0x16')](_0x7c25c9);return _0x5a0623['set']('Content-Range',_0x5f1474+'-'+_0x23c681+'/'+_0x4f387e)[_0x3c6b('0x18')](_0x1ead29);}return null;};}function patchUpdates(_0x2c07d2){return function(_0x28658e){try{jsonpatch[_0x3c6b('0x1d')](_0x28658e,_0x2c07d2,!![]);}catch(_0x23c68a){return BPromise[_0x3c6b('0x1e')](_0x23c68a);}return _0x28658e[_0x3c6b('0x1f')]();};}function saveUpdates(_0x4c66a0,_0x2875c9){return function(_0x375ce8){if(_0x375ce8){return _0x375ce8[_0x3c6b('0x20')](_0x4c66a0)[_0x3c6b('0x21')](function(_0x10d5f7){return _0x10d5f7;});}return null;};}function removeEntity(_0x2d256c,_0x4ea095){return function(_0x59a34c){if(_0x59a34c){return _0x59a34c[_0x3c6b('0x22')]()[_0x3c6b('0x21')](function(){_0x2d256c[_0x3c6b('0x16')](0xcc)[_0x3c6b('0x17')]();});}};}function handleEntityNotFound(_0x457d08,_0x7a3c21){return function(_0x5219ae){if(!_0x5219ae){_0x457d08[_0x3c6b('0x15')](0x194);}return _0x5219ae;};}function handleError(_0x447d66,_0x26b14a){_0x26b14a=_0x26b14a||0x1f4;return function(_0x524d55){logger['error'](_0x524d55[_0x3c6b('0x23')]);if(_0x524d55[_0x3c6b('0x24')]){delete _0x524d55['name'];}_0x447d66[_0x3c6b('0x16')](_0x26b14a)['send'](_0x524d55);};}exports[_0x3c6b('0x25')]=function(_0x2bdef1,_0x33fcba){var _0x4ebf78={},_0x369e9a={},_0x2796f3={'count':0x0,'rows':[]};var _0x47f582=_[_0x3c6b('0x26')](db[_0x3c6b('0x27')][_0x3c6b('0x28')],function(_0xecf3f4){return{'name':_0xecf3f4[_0x3c6b('0x29')],'type':_0xecf3f4[_0x3c6b('0x2a')][_0x3c6b('0x2b')]};});_0x369e9a[_0x3c6b('0x2c')]=_['map'](_0x47f582,_0x3c6b('0x24'));_0x369e9a['query']=_[_0x3c6b('0x2d')](_0x2bdef1[_0x3c6b('0x2e')]);_0x369e9a[_0x3c6b('0x2f')]=_[_0x3c6b('0x30')](_0x369e9a[_0x3c6b('0x2c')],_0x369e9a[_0x3c6b('0x2e')]);_0x4ebf78[_0x3c6b('0x31')]=_[_0x3c6b('0x30')](_0x369e9a[_0x3c6b('0x2c')],qs['fields'](_0x2bdef1['query']['fields']));_0x4ebf78[_0x3c6b('0x31')]=_0x4ebf78[_0x3c6b('0x31')][_0x3c6b('0x32')]?_0x4ebf78[_0x3c6b('0x31')]:_0x369e9a['model'];if(!_0x2bdef1['query'][_0x3c6b('0x33')]('nolimit')){_0x4ebf78[_0x3c6b('0x1b')]=qs[_0x3c6b('0x1b')](_0x2bdef1[_0x3c6b('0x2e')][_0x3c6b('0x1b')]);_0x4ebf78[_0x3c6b('0x19')]=qs['offset'](_0x2bdef1['query'][_0x3c6b('0x19')]);}_0x4ebf78['order']=qs[_0x3c6b('0x34')](_0x2bdef1[_0x3c6b('0x2e')][_0x3c6b('0x34')]);_0x4ebf78[_0x3c6b('0x35')]=qs['filters'](_['pick'](_0x2bdef1[_0x3c6b('0x2e')],_0x369e9a['filters']),_0x47f582);if(_0x2bdef1[_0x3c6b('0x2e')]['filter']){_0x4ebf78[_0x3c6b('0x35')]=_[_0x3c6b('0x36')](_0x4ebf78['where'],{'$or':_[_0x3c6b('0x26')](_0x47f582,function(_0x239760){if(_0x239760[_0x3c6b('0x2a')]!==_0x3c6b('0x37')){var _0x24abe7={};_0x24abe7[_0x239760['name']]={'$like':'%'+_0x2bdef1[_0x3c6b('0x2e')][_0x3c6b('0x38')]+'%'};return _0x24abe7;}})});}_0x4ebf78=_[_0x3c6b('0x36')]({},_0x4ebf78,_0x2bdef1[_0x3c6b('0x39')]);var _0x8ca440={'where':_0x4ebf78[_0x3c6b('0x35')]};return db[_0x3c6b('0x27')][_0x3c6b('0x1c')](_0x8ca440)[_0x3c6b('0x21')](function(_0x1fc3a4){_0x2796f3[_0x3c6b('0x1c')]=_0x1fc3a4;if(_0x2bdef1[_0x3c6b('0x2e')][_0x3c6b('0x3a')]){_0x4ebf78[_0x3c6b('0x3b')]=[{'all':!![]}];}return db[_0x3c6b('0x27')]['findAll'](_0x4ebf78);})[_0x3c6b('0x21')](function(_0x230d04){_0x2796f3[_0x3c6b('0x3c')]=_0x230d04;return _0x2796f3;})[_0x3c6b('0x21')](respondWithFilteredResult(_0x33fcba,_0x4ebf78))[_0x3c6b('0x3d')](handleError(_0x33fcba,null));};exports[_0x3c6b('0x3e')]=function(_0x26b331,_0xd3cee0){var _0x275db5={'raw':!![],'where':{'id':_0x26b331[_0x3c6b('0x3f')]['id']}},_0x5a9d38={};_0x5a9d38[_0x3c6b('0x2c')]=_[_0x3c6b('0x2d')](db['CmHopperHistory'][_0x3c6b('0x28')]);_0x5a9d38[_0x3c6b('0x2e')]=_[_0x3c6b('0x2d')](_0x26b331[_0x3c6b('0x2e')]);_0x5a9d38['filters']=_[_0x3c6b('0x30')](_0x5a9d38[_0x3c6b('0x2c')],_0x5a9d38['query']);_0x275db5[_0x3c6b('0x31')]=_[_0x3c6b('0x30')](_0x5a9d38['model'],qs['fields'](_0x26b331['query'][_0x3c6b('0x40')]));_0x275db5['attributes']=_0x275db5[_0x3c6b('0x31')][_0x3c6b('0x32')]?_0x275db5['attributes']:_0x5a9d38[_0x3c6b('0x2c')];if(_0x26b331[_0x3c6b('0x2e')][_0x3c6b('0x3a')]){_0x275db5[_0x3c6b('0x3b')]=[{'all':!![]}];}_0x275db5=_[_0x3c6b('0x36')]({},_0x275db5,_0x26b331[_0x3c6b('0x39')]);return db['CmHopperHistory']['find'](_0x275db5)[_0x3c6b('0x21')](handleEntityNotFound(_0xd3cee0,null))[_0x3c6b('0x21')](respondWithResult(_0xd3cee0,null))['catch'](handleError(_0xd3cee0,null));};exports[_0x3c6b('0x41')]=function(_0x121998,_0x24280d){return db[_0x3c6b('0x27')]['create'](_0x121998['body'],{})[_0x3c6b('0x21')](respondWithResult(_0x24280d,0xc9))[_0x3c6b('0x3d')](handleError(_0x24280d,null));};exports['describe']=function(_0x3d64ae,_0x3ca89f){return db[_0x3c6b('0x27')]['describe']()['then'](respondWithResult(_0x3ca89f,null))[_0x3c6b('0x3d')](handleError(_0x3ca89f,null));};exports[_0x3c6b('0x20')]=function(_0x217621,_0x34db1a){if(_0x217621[_0x3c6b('0x42')]['uniqueid']){delete _0x217621[_0x3c6b('0x42')][_0x3c6b('0x43')];}return db[_0x3c6b('0x27')][_0x3c6b('0x44')]({'where':{'uniqueid':_0x217621['params']['id']}})['then'](handleEntityNotFound(_0x34db1a,null))[_0x3c6b('0x21')](saveUpdates(_0x217621[_0x3c6b('0x42')],null))['then'](respondWithResult(_0x34db1a,null))[_0x3c6b('0x3d')](handleError(_0x34db1a,null));}; \ No newline at end of file +var _0xf6a2=['Content-Range','apply','reject','save','update','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','body','uniqueid','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf6a2,0x1d3));var _0x2f6a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xf6a2[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x2f6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f6a('0x1'));var jsonpatch=require(_0x2f6a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f6a('0x3'));var Mustache=require('mustache');var util=require(_0x2f6a('0x4'));var path=require(_0x2f6a('0x5'));var sox=require(_0x2f6a('0x6'));var csv=require(_0x2f6a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f6a('0x8'));var _=require(_0x2f6a('0x9'));var squel=require(_0x2f6a('0xa'));var crypto=require('crypto');var jsforce=require(_0x2f6a('0xb'));var deskjs=require(_0x2f6a('0xc'));var toCsv=require(_0x2f6a('0x7'));var querystring=require('querystring');var Papa=require(_0x2f6a('0xd'));var Redis=require('ioredis');var authService=require(_0x2f6a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2f6a('0xf'));var hardwareService=require(_0x2f6a('0x10'));var logger=require(_0x2f6a('0x11'))(_0x2f6a('0x12'));var utils=require(_0x2f6a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2f6a('0x14'));var db=require(_0x2f6a('0x15'))['db'];function respondWithStatusCode(_0x183ee1,_0x5c2966){_0x5c2966=_0x5c2966||0xcc;return function(_0xc1f5fc){if(_0xc1f5fc){return _0x183ee1[_0x2f6a('0x16')](_0x5c2966);}return _0x183ee1[_0x2f6a('0x17')](_0x5c2966)[_0x2f6a('0x18')]();};}function respondWithResult(_0x3a0040,_0x1a46f4){_0x1a46f4=_0x1a46f4||0xc8;return function(_0xb0e075){if(_0xb0e075){return _0x3a0040[_0x2f6a('0x17')](_0x1a46f4)[_0x2f6a('0x19')](_0xb0e075);}};}function respondWithFilteredResult(_0x56040f,_0x403f4b){return function(_0x57a436){if(_0x57a436){var _0x5854a7=typeof _0x403f4b['offset']===_0x2f6a('0x1a')&&typeof _0x403f4b[_0x2f6a('0x1b')]===_0x2f6a('0x1a');var _0x18b963=_0x57a436['count'];var _0x1c8bf7=_0x5854a7?0x0:_0x403f4b[_0x2f6a('0x1c')];var _0xe2fa7e=_0x5854a7?_0x57a436[_0x2f6a('0x1d')]:_0x403f4b[_0x2f6a('0x1c')]+_0x403f4b[_0x2f6a('0x1b')];var _0x4d401c;if(_0xe2fa7e>=_0x18b963){_0xe2fa7e=_0x18b963;_0x4d401c=0xc8;}else{_0x4d401c=0xce;}_0x56040f[_0x2f6a('0x17')](_0x4d401c);return _0x56040f['set'](_0x2f6a('0x1e'),_0x1c8bf7+'-'+_0xe2fa7e+'/'+_0x18b963)[_0x2f6a('0x19')](_0x57a436);}return null;};}function patchUpdates(_0x3c2846){return function(_0x18d8f7){try{jsonpatch[_0x2f6a('0x1f')](_0x18d8f7,_0x3c2846,!![]);}catch(_0x97518e){return BPromise[_0x2f6a('0x20')](_0x97518e);}return _0x18d8f7[_0x2f6a('0x21')]();};}function saveUpdates(_0x4d77ea,_0x1157e5){return function(_0x379fa1){if(_0x379fa1){return _0x379fa1[_0x2f6a('0x22')](_0x4d77ea)[_0x2f6a('0x23')](function(_0x3b8def){return _0x3b8def;});}return null;};}function removeEntity(_0x266d94,_0x231fa2){return function(_0x129053){if(_0x129053){return _0x129053['destroy']()[_0x2f6a('0x23')](function(){_0x266d94['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5fc2d0,_0x2ae1c4){return function(_0x99ac78){if(!_0x99ac78){_0x5fc2d0[_0x2f6a('0x16')](0x194);}return _0x99ac78;};}function handleError(_0x5470ea,_0x5b7be0){_0x5b7be0=_0x5b7be0||0x1f4;return function(_0x8e94f3){logger[_0x2f6a('0x24')](_0x8e94f3[_0x2f6a('0x25')]);if(_0x8e94f3['name']){delete _0x8e94f3[_0x2f6a('0x26')];}_0x5470ea[_0x2f6a('0x17')](_0x5b7be0)['send'](_0x8e94f3);};}exports[_0x2f6a('0x27')]=function(_0x11ead5,_0x17214f){var _0x26bb96={},_0x2ff9cc={},_0x31ba24={'count':0x0,'rows':[]};var _0x1bacd8=_[_0x2f6a('0x28')](db[_0x2f6a('0x29')][_0x2f6a('0x2a')],function(_0x190ccf){return{'name':_0x190ccf[_0x2f6a('0x2b')],'type':_0x190ccf[_0x2f6a('0x2c')]['key']};});_0x2ff9cc[_0x2f6a('0x2d')]=_['map'](_0x1bacd8,_0x2f6a('0x26'));_0x2ff9cc[_0x2f6a('0x2e')]=_[_0x2f6a('0x2f')](_0x11ead5[_0x2f6a('0x2e')]);_0x2ff9cc[_0x2f6a('0x30')]=_['intersection'](_0x2ff9cc[_0x2f6a('0x2d')],_0x2ff9cc[_0x2f6a('0x2e')]);_0x26bb96['attributes']=_['intersection'](_0x2ff9cc[_0x2f6a('0x2d')],qs[_0x2f6a('0x31')](_0x11ead5[_0x2f6a('0x2e')][_0x2f6a('0x31')]));_0x26bb96[_0x2f6a('0x32')]=_0x26bb96[_0x2f6a('0x32')]['length']?_0x26bb96[_0x2f6a('0x32')]:_0x2ff9cc['model'];if(!_0x11ead5[_0x2f6a('0x2e')]['hasOwnProperty'](_0x2f6a('0x33'))){_0x26bb96[_0x2f6a('0x1b')]=qs[_0x2f6a('0x1b')](_0x11ead5['query'][_0x2f6a('0x1b')]);_0x26bb96[_0x2f6a('0x1c')]=qs[_0x2f6a('0x1c')](_0x11ead5['query'][_0x2f6a('0x1c')]);}_0x26bb96[_0x2f6a('0x34')]=qs[_0x2f6a('0x35')](_0x11ead5[_0x2f6a('0x2e')][_0x2f6a('0x35')]);_0x26bb96[_0x2f6a('0x36')]=qs[_0x2f6a('0x30')](_[_0x2f6a('0x37')](_0x11ead5[_0x2f6a('0x2e')],_0x2ff9cc['filters']),_0x1bacd8);if(_0x11ead5[_0x2f6a('0x2e')][_0x2f6a('0x38')]){_0x26bb96[_0x2f6a('0x36')]=_[_0x2f6a('0x39')](_0x26bb96[_0x2f6a('0x36')],{'$or':_[_0x2f6a('0x28')](_0x1bacd8,function(_0x25eaf6){if(_0x25eaf6['type']!=='VIRTUAL'){var _0x5546f8={};_0x5546f8[_0x25eaf6[_0x2f6a('0x26')]]={'$like':'%'+_0x11ead5['query'][_0x2f6a('0x38')]+'%'};return _0x5546f8;}})});}_0x26bb96=_[_0x2f6a('0x39')]({},_0x26bb96,_0x11ead5[_0x2f6a('0x3a')]);var _0x2eb085={'where':_0x26bb96[_0x2f6a('0x36')]};return db[_0x2f6a('0x29')][_0x2f6a('0x1d')](_0x2eb085)[_0x2f6a('0x23')](function(_0x5aa2dd){_0x31ba24[_0x2f6a('0x1d')]=_0x5aa2dd;if(_0x11ead5[_0x2f6a('0x2e')][_0x2f6a('0x3b')]){_0x26bb96[_0x2f6a('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x2f6a('0x3d')](_0x26bb96);})['then'](function(_0x34af3d){_0x31ba24[_0x2f6a('0x3e')]=_0x34af3d;return _0x31ba24;})[_0x2f6a('0x23')](respondWithFilteredResult(_0x17214f,_0x26bb96))['catch'](handleError(_0x17214f,null));};exports[_0x2f6a('0x3f')]=function(_0x527157,_0x48142f){var _0x4ce5f5={'raw':!![],'where':{'id':_0x527157[_0x2f6a('0x40')]['id']}},_0x4146b3={};_0x4146b3[_0x2f6a('0x2d')]=_[_0x2f6a('0x2f')](db[_0x2f6a('0x29')][_0x2f6a('0x2a')]);_0x4146b3[_0x2f6a('0x2e')]=_[_0x2f6a('0x2f')](_0x527157[_0x2f6a('0x2e')]);_0x4146b3[_0x2f6a('0x30')]=_[_0x2f6a('0x41')](_0x4146b3[_0x2f6a('0x2d')],_0x4146b3['query']);_0x4ce5f5[_0x2f6a('0x32')]=_['intersection'](_0x4146b3[_0x2f6a('0x2d')],qs[_0x2f6a('0x31')](_0x527157[_0x2f6a('0x2e')][_0x2f6a('0x31')]));_0x4ce5f5[_0x2f6a('0x32')]=_0x4ce5f5['attributes'][_0x2f6a('0x42')]?_0x4ce5f5['attributes']:_0x4146b3[_0x2f6a('0x2d')];if(_0x527157['query'][_0x2f6a('0x3b')]){_0x4ce5f5[_0x2f6a('0x3c')]=[{'all':!![]}];}_0x4ce5f5=_['merge']({},_0x4ce5f5,_0x527157['options']);return db[_0x2f6a('0x29')][_0x2f6a('0x43')](_0x4ce5f5)[_0x2f6a('0x23')](handleEntityNotFound(_0x48142f,null))['then'](respondWithResult(_0x48142f,null))[_0x2f6a('0x44')](handleError(_0x48142f,null));};exports['create']=function(_0x1ee6ec,_0x335052){return db[_0x2f6a('0x29')]['create'](_0x1ee6ec[_0x2f6a('0x45')],{})[_0x2f6a('0x23')](respondWithResult(_0x335052,0xc9))[_0x2f6a('0x44')](handleError(_0x335052,null));};exports['describe']=function(_0x45e5df,_0x3bcb26){return db[_0x2f6a('0x29')]['describe']()['then'](respondWithResult(_0x3bcb26,null))[_0x2f6a('0x44')](handleError(_0x3bcb26,null));};exports[_0x2f6a('0x22')]=function(_0x26860f,_0x424bd8){if(_0x26860f[_0x2f6a('0x45')][_0x2f6a('0x46')]){delete _0x26860f[_0x2f6a('0x45')]['uniqueid'];}return db[_0x2f6a('0x29')][_0x2f6a('0x43')]({'where':{'uniqueid':_0x26860f[_0x2f6a('0x40')]['id']}})[_0x2f6a('0x23')](handleEntityNotFound(_0x424bd8,null))['then'](saveUpdates(_0x26860f[_0x2f6a('0x45')],null))[_0x2f6a('0x23')](respondWithResult(_0x424bd8,null))[_0x2f6a('0x44')](handleError(_0x424bd8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index fa91032..7f9f110 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 _0x056b=['cm_hopper_history','endtime','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x18ea8a,_0x32f09f){var _0x19c99a=function(_0x21d8d6){while(--_0x21d8d6){_0x18ea8a['push'](_0x18ea8a['shift']());}};_0x19c99a(++_0x32f09f);}(_0x056b,0xb6));var _0xb056=function(_0x567adc,_0x2486d2){_0x567adc=_0x567adc-0x0;var _0xf3ed85=_0x056b[_0x567adc];return _0xf3ed85;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'paranoid':![],'indexes':[{'name':_0xb056('0xe'),'fields':[_0xb056('0xe')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b47=['rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird','request-promise'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x6b47,0xe9));var _0x76b4=function(_0x28de32,_0x242d8b){_0x28de32=_0x28de32-0x0;var _0x5ec7a8=_0x6b47[_0x28de32];return _0x5ec7a8;};'use strict';var _=require('lodash');var util=require(_0x76b4('0x0'));var logger=require('../../config/logger')(_0x76b4('0x1'));var moment=require(_0x76b4('0x2'));var BPromise=require(_0x76b4('0x3'));var rp=require(_0x76b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76b4('0x5'));var config=require(_0x76b4('0x6'));var attributes=require(_0x76b4('0x7'));module[_0x76b4('0x8')]=function(_0x292e27,_0x49fc2a){return _0x292e27[_0x76b4('0x9')](_0x76b4('0xa'),attributes,{'tableName':_0x76b4('0xb'),'paranoid':![],'indexes':[{'name':_0x76b4('0xc'),'fields':[_0x76b4('0xc')]},{'name':_0x76b4('0xd'),'fields':[_0x76b4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index e589441..c3ffad1 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 _0x80df=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`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','outboundAnswerAgiCallsDay','outboundRejectCallsDay','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null'];(function(_0x15718e,_0x2f5096){var _0xf3b1d2=function(_0x718af1){while(--_0x718af1){_0x15718e['push'](_0x15718e['shift']());}};_0xf3b1d2(++_0x2f5096);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});}exports[_0xf80d('0x19')]=function(_0x1d104a){var _0x34b49d=this;return new Promise(function(_0x2ea2c1,_0x7ba89c){return db[_0xf80d('0x1a')][_0xf80d('0x1b')](_0x1d104a['body'],{'raw':_0x1d104a[_0xf80d('0x1c')]?_0x1d104a[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf80d('0xe')](function(_0x539c80){logger[_0xf80d('0xf')](_0xf80d('0x19'),_0x1d104a);logger[_0xf80d('0x12')](_0xf80d('0x19'),_0x1d104a,JSON[_0xf80d('0x14')](_0x539c80));_0x2ea2c1(_0x539c80);})[_0xf80d('0x18')](function(_0x446153){logger[_0xf80d('0x15')](_0xf80d('0x19'),_0x446153[_0xf80d('0x16')],_0x1d104a);_0x7ba89c(_0x34b49d[_0xf80d('0x15')](0x1f4,_0x446153[_0xf80d('0x16')]));});});};exports['AvgHandleTime']=function(_0x32ad42){var _0x1dce73=this;return new Promise(function(_0x5906fa,_0x3353a3){return db[_0xf80d('0x1a')][_0xf80d('0x1d')]({'raw':_0x32ad42[_0xf80d('0x1c')]?_0x32ad42['options'][_0xf80d('0x1e')]===undefined?!![]:![]:!![],'where':_0x32ad42[_0xf80d('0x1c')]?_0x32ad42[_0xf80d('0x1c')][_0xf80d('0x1f')]||null:null,'attributes':[[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')][_0xf80d('0x22')]('id')),_0xf80d('0x23')],[db['sequelize']['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x25')))),_0xf80d('0x26')],[db[_0xf80d('0x20')]['fn']('COUNT',db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xf80d('0x21'),db['sequelize']['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x29'),db['sequelize']['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x29'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xf80d('0x2b')]]})['then'](function(_0x2004c5){logger[_0xf80d('0xf')](_0xf80d('0x2c'),_0x32ad42);logger[_0xf80d('0x12')]('AvgHandleTime',_0x32ad42,JSON[_0xf80d('0x14')](_0x2004c5));_0x5906fa(_0x2004c5);})[_0xf80d('0x18')](function(_0xbc0d77){logger[_0xf80d('0x15')]('AvgHandleTime',_0xbc0d77[_0xf80d('0x16')],_0x32ad42);_0x3353a3(_0x1dce73[_0xf80d('0x15')](0x1f4,_0xbc0d77[_0xf80d('0x16')]));});});};exports[_0xf80d('0x2d')]=function(_0x1f7c18){var _0x39f970=this;return new Promise(function(_0x35039f,_0x45765a){return db['CmHopperHistory'][_0xf80d('0x1d')]({'raw':_0x1f7c18[_0xf80d('0x1c')]?_0x1f7c18[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1f7c18[_0xf80d('0x1c')]?_0x1f7c18['options'][_0xf80d('0x1f')]||null:null,'attributes':[[_0xf80d('0x2e'),_0xf80d('0x2f')],[db[_0xf80d('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xf80d('0x24')](_0xf80d('0x30')))),_0xf80d('0x31')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db['sequelize'][_0xf80d('0x24')](_0xf80d('0x32')))),_0xf80d('0x33')],[db['sequelize']['fn'](_0xf80d('0x21'),db['sequelize']['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x25')))),_0xf80d('0x34')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x35')))),_0xf80d('0x36')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x37')))),_0xf80d('0x38')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x39')))),_0xf80d('0x3a')],[db['sequelize']['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x3b')))),'outboundDropCallsDayCallersExit'],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x3c')))),_0xf80d('0x3d')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x3e')))),_0xf80d('0x3f')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db['sequelize'][_0xf80d('0x24')](_0xf80d('0x40')))),_0xf80d('0x41')],[db['sequelize']['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db['sequelize']['literal'](_0xf80d('0x42')))),'outboundRejectCallsDay'],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x43')))),_0xf80d('0x44')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')]['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')]('`state`\x20=\x2020,\x201,\x20null'))),_0xf80d('0x45')],[db[_0xf80d('0x20')]['fn'](_0xf80d('0x21'),db['sequelize']['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xf80d('0x46')]],'group':[_0xf80d('0x2e')]})['then'](function(_0xee12ae){logger[_0xf80d('0xf')](_0xf80d('0x2d'),_0x1f7c18);logger[_0xf80d('0x12')]('GetVoiceQueueHopperHistory',_0x1f7c18,JSON[_0xf80d('0x14')](_0xee12ae));_0x35039f(_0xee12ae);})[_0xf80d('0x18')](function(_0x1a4c08){logger['error'](_0xf80d('0x2d'),_0x1a4c08[_0xf80d('0x16')],_0x1f7c18);_0x45765a(_0x39f970[_0xf80d('0x15')](0x1f4,_0x1a4c08[_0xf80d('0x16')]));});});};exports[_0xf80d('0x47')]=function(_0x2ea04b){var _0x3e5ddc=this;return new Promise(function(_0x31ecdc,_0x6d0b18){return db[_0xf80d('0x1a')]['findAll']({'raw':_0x2ea04b[_0xf80d('0x1c')]?_0x2ea04b[_0xf80d('0x1c')][_0xf80d('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ea04b[_0xf80d('0x1c')]?_0x2ea04b['options']['where']||null:null,'attributes':[[_0xf80d('0x2e'),_0xf80d('0x2f')],[db['sequelize']['fn'](_0xf80d('0x21'),db[_0xf80d('0x20')][_0xf80d('0x22')]('id')),_0xf80d('0x48')],[db['sequelize']['fn'](_0xf80d('0x21'),db['sequelize']['fn']('IF',db[_0xf80d('0x20')][_0xf80d('0x24')](_0xf80d('0x25')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0xf80d('0xe')](function(_0x27b9f3){logger['info']('GetCampaignHopperHistory',_0x2ea04b);logger[_0xf80d('0x12')](_0xf80d('0x47'),_0x2ea04b,JSON[_0xf80d('0x14')](_0x27b9f3));_0x31ecdc(_0x27b9f3);})[_0xf80d('0x18')](function(_0x436a38){logger[_0xf80d('0x15')](_0xf80d('0x47'),_0x436a38[_0xf80d('0x16')],_0x2ea04b);_0x6d0b18(_0x3e5ddc['error'](0x1f4,_0x436a38[_0xf80d('0x16')]));});});}; \ No newline at end of file +var _0x38e7=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','debug','stringify','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null'];(function(_0x11087e,_0xe1b00b){var _0x2d0c85=function(_0x501a10){while(--_0x501a10){_0x11087e['push'](_0x11087e['shift']());}};_0x2d0c85(++_0xe1b00b);}(_0x38e7,0x1eb));var _0x738e=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0x38e7[_0x43aee5];return _0x76d1d0;};'use strict';var _=require(_0x738e('0x0'));var util=require(_0x738e('0x1'));var moment=require(_0x738e('0x2'));var BPromise=require(_0x738e('0x3'));var rs=require(_0x738e('0x4'));var fs=require('fs');var Redis=require(_0x738e('0x5'));var db=require(_0x738e('0x6'))['db'];var utils=require(_0x738e('0x7'));var logger=require(_0x738e('0x8'))(_0x738e('0x9'));var config=require(_0x738e('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x282b59,_0x35db07,_0x26c0a7){return new BPromise(function(_0x287d50,_0x160926){return client[_0x738e('0xb')](_0x282b59,_0x26c0a7)[_0x738e('0xc')](function(_0x36f796){logger[_0x738e('0xd')](_0x738e('0xe'),_0x35db07,_0x738e('0xf'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x35db07,_0x738e('0xf'),JSON['stringify'](_0x36f796));if(_0x36f796[_0x738e('0x10')]){if(_0x36f796[_0x738e('0x10')]['code']===0x1f4){logger[_0x738e('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x35db07,_0x36f796[_0x738e('0x10')][_0x738e('0x11')]);return _0x160926(_0x36f796[_0x738e('0x10')][_0x738e('0x11')]);}logger[_0x738e('0x10')](_0x738e('0xe'),_0x35db07,_0x36f796['error'][_0x738e('0x11')]);return _0x287d50(_0x36f796[_0x738e('0x10')][_0x738e('0x11')]);}else{logger[_0x738e('0xd')](_0x738e('0xe'),_0x35db07,_0x738e('0xf'));_0x287d50(_0x36f796['result'][_0x738e('0x11')]);}})[_0x738e('0x12')](function(_0x4d0651){logger[_0x738e('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x35db07,_0x4d0651);_0x160926(_0x4d0651);});});}exports[_0x738e('0x13')]=function(_0x3add89){var _0x4618a4=this;return new Promise(function(_0x130bc5,_0x2b9eab){return db[_0x738e('0x14')][_0x738e('0x15')](_0x3add89['body'],{'raw':_0x3add89[_0x738e('0x16')]?_0x3add89['options'][_0x738e('0x17')]===undefined?!![]:![]:!![]})[_0x738e('0xc')](function(_0xb1d393){logger['info'](_0x738e('0x13'),_0x3add89);logger[_0x738e('0x18')](_0x738e('0x13'),_0x3add89,JSON[_0x738e('0x19')](_0xb1d393));_0x130bc5(_0xb1d393);})[_0x738e('0x12')](function(_0x3d8c4b){logger[_0x738e('0x10')](_0x738e('0x13'),_0x3d8c4b[_0x738e('0x11')],_0x3add89);_0x2b9eab(_0x4618a4['error'](0x1f4,_0x3d8c4b[_0x738e('0x11')]));});});};exports[_0x738e('0x1a')]=function(_0xf1cde0){var _0x57b5a2=this;return new Promise(function(_0x2c5173,_0x17673){return db['CmHopperHistory'][_0x738e('0x1b')]({'raw':_0xf1cde0['options']?_0xf1cde0['options'][_0x738e('0x17')]===undefined?!![]:![]:!![],'where':_0xf1cde0[_0x738e('0x16')]?_0xf1cde0[_0x738e('0x16')][_0x738e('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')][_0x738e('0x1f')]('id')),_0x738e('0x20')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x22')))),_0x738e('0x23')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')]['literal'](_0x738e('0x24')))),_0x738e('0x25')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x738e('0x21')](_0x738e('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x738e('0x1e')]['fn'](_0x738e('0x27'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x28')))),_0x738e('0x29')],[db['sequelize']['fn'](_0x738e('0x27'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x2a')))),_0x738e('0x2b')]]})[_0x738e('0xc')](function(_0x1f7720){logger[_0x738e('0xd')](_0x738e('0x1a'),_0xf1cde0);logger['debug'](_0x738e('0x1a'),_0xf1cde0,JSON[_0x738e('0x19')](_0x1f7720));_0x2c5173(_0x1f7720);})[_0x738e('0x12')](function(_0x4e836a){logger['error'](_0x738e('0x1a'),_0x4e836a[_0x738e('0x11')],_0xf1cde0);_0x17673(_0x57b5a2[_0x738e('0x10')](0x1f4,_0x4e836a[_0x738e('0x11')]));});});};exports[_0x738e('0x2c')]=function(_0x40b104){var _0x2df6e9=this;return new Promise(function(_0x5b7f3e,_0x5f4bdd){return db[_0x738e('0x14')]['findAll']({'raw':_0x40b104[_0x738e('0x16')]?_0x40b104[_0x738e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x40b104[_0x738e('0x16')]?_0x40b104[_0x738e('0x16')]['where']||null:null,'attributes':[[_0x738e('0x2d'),_0x738e('0x2e')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x30')))),_0x738e('0x31')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x738e('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x738e('0x32')],[db[_0x738e('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x738e('0x33')],[db['sequelize']['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db['sequelize'][_0x738e('0x21')](_0x738e('0x34')))),_0x738e('0x35')],[db['sequelize']['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x36')))),_0x738e('0x37')],[db['sequelize']['fn'](_0x738e('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x738e('0x38')))),_0x738e('0x39')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0x738e('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x738e('0x1e')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x738e('0x3b')],[db['sequelize']['fn']('COUNT',db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')]['literal'](_0x738e('0x3c')))),_0x738e('0x3d')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db['sequelize'][_0x738e('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0x738e('0x3e')],[db[_0x738e('0x1e')]['fn']('COUNT',db[_0x738e('0x1e')]['fn']('IF',db['sequelize'][_0x738e('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x738e('0x3f')],[db[_0x738e('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x40')))),_0x738e('0x3e')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db['sequelize']['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x519657){logger[_0x738e('0xd')]('GetVoiceQueueHopperHistory',_0x40b104);logger[_0x738e('0x18')](_0x738e('0x2c'),_0x40b104,JSON['stringify'](_0x519657));_0x5b7f3e(_0x519657);})[_0x738e('0x12')](function(_0x36561d){logger[_0x738e('0x10')]('GetVoiceQueueHopperHistory',_0x36561d[_0x738e('0x11')],_0x40b104);_0x5f4bdd(_0x2df6e9['error'](0x1f4,_0x36561d['message']));});});};exports['GetCampaignHopperHistory']=function(_0x3a397d){var _0x4b7377=this;return new Promise(function(_0x3721d4,_0x5df7a9){return db['CmHopperHistory'][_0x738e('0x1b')]({'raw':_0x3a397d[_0x738e('0x16')]?_0x3a397d[_0x738e('0x16')][_0x738e('0x17')]===undefined?!![]:![]:!![],'where':_0x3a397d['options']?_0x3a397d['options']['where']||null:null,'attributes':[[_0x738e('0x2d'),_0x738e('0x2e')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['col']('id')),_0x738e('0x41')],[db[_0x738e('0x1e')]['fn'](_0x738e('0x1d'),db[_0x738e('0x1e')]['fn']('IF',db[_0x738e('0x1e')][_0x738e('0x21')](_0x738e('0x22')))),_0x738e('0x42')]],'group':[_0x738e('0x2d')]})[_0x738e('0xc')](function(_0x60a686){logger[_0x738e('0xd')](_0x738e('0x43'),_0x3a397d);logger[_0x738e('0x18')](_0x738e('0x43'),_0x3a397d,JSON[_0x738e('0x19')](_0x60a686));_0x3721d4(_0x60a686);})['catch'](function(_0xcd9404){logger[_0x738e('0x10')](_0x738e('0x43'),_0xcd9404[_0x738e('0x11')],_0x3a397d);_0x5df7a9(_0x4b7377[_0x738e('0x10')](0x1f4,_0xcd9404[_0x738e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 023692a..d2fa7b7 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 _0x2081=['put','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','show','post','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2081,0x147));var _0x1208=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2081[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require('multer');var util=require(_0x1208('0x0'));var path=require(_0x1208('0x1'));var timeout=require(_0x1208('0x2'));var express=require('express');var router=express[_0x1208('0x3')]();var fs_extra=require(_0x1208('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1208('0x5'));var config=require(_0x1208('0x6'));var controller=require(_0x1208('0x7'));router[_0x1208('0x8')]('/',auth[_0x1208('0x9')](),controller[_0x1208('0xa')]);router['get']('/describe',auth[_0x1208('0x9')](),controller[_0x1208('0xb')]);router[_0x1208('0x8')]('/:id',auth[_0x1208('0x9')](),controller[_0x1208('0xc')]);router[_0x1208('0xd')]('/',auth[_0x1208('0x9')](),controller[_0x1208('0xe')]);router[_0x1208('0xf')]('/:id',auth[_0x1208('0x9')](),controller[_0x1208('0x10')]);module[_0x1208('0x11')]=router; \ No newline at end of file +var _0xfdfd=['get','isAuthenticated','index','/describe','describe','show','post','create','put','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x130de3,_0xeff0d2){var _0x307f7e=function(_0x12642d){while(--_0x12642d){_0x130de3['push'](_0x130de3['shift']());}};_0x307f7e(++_0xeff0d2);}(_0xfdfd,0x1b3));var _0xdfdf=function(_0x3b482c,_0x4896ab){_0x3b482c=_0x3b482c-0x0;var _0x16de3f=_0xfdfd[_0x3b482c];return _0x16de3f;};'use strict';var multer=require('multer');var util=require(_0xdfdf('0x0'));var path=require(_0xdfdf('0x1'));var timeout=require(_0xdfdf('0x2'));var express=require(_0xdfdf('0x3'));var router=express['Router']();var fs_extra=require(_0xdfdf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdfdf('0x5'));var config=require(_0xdfdf('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xdfdf('0x7')]('/',auth[_0xdfdf('0x8')](),controller[_0xdfdf('0x9')]);router[_0xdfdf('0x7')](_0xdfdf('0xa'),auth[_0xdfdf('0x8')](),controller[_0xdfdf('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdfdf('0xc')]);router[_0xdfdf('0xd')]('/',auth['isAuthenticated'](),controller[_0xdfdf('0xe')]);router[_0xdfdf('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0xdfdf('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 76d5976..88dec34 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 _0x089f=['STRING','name','exports'];(function(_0x50baaa,_0x57244f){var _0x53f5db=function(_0x4390da){while(--_0x4390da){_0x50baaa['push'](_0x50baaa['shift']());}};_0x53f5db(++_0x57244f);}(_0x089f,0x1c7));var _0xf089=function(_0x261a02,_0x2ef3c2){_0x261a02=_0x261a02-0x0;var _0x5cf947=_0x089f[_0x261a02];return _0x5cf947;};'use strict';var Sequelize=require('sequelize');module[_0xf089('0x0')]={'name':{'type':Sequelize[_0xf089('0x1')],'unique':_0xf089('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf089('0x1')]},'dialPrefix':{'type':Sequelize[_0xf089('0x1')]}}; \ No newline at end of file +var _0xa631=['exports','STRING','name'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa631,0xe4));var _0x1a63=function(_0x5068c4,_0x6d5efb){_0x5068c4=_0x5068c4-0x0;var _0x461006=_0xa631[_0x5068c4];return _0x461006;};'use strict';var Sequelize=require('sequelize');module[_0x1a63('0x0')]={'name':{'type':Sequelize[_0x1a63('0x1')],'unique':_0x1a63('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x1a63('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ca0dce6..0477f8d 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 _0xe84a=['cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','order','sort','pick','filter','where','merge','VIRTUAL','options','catch','show','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','findAll','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','raw','getContactsCsv','CmCustomField','concat','length','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe84a,0xaa));var _0xae84=function(_0x162bc9,_0x5c117e){_0x162bc9=_0x162bc9-0x0;var _0x475e2d=_0xe84a[_0x162bc9];return _0x475e2d;};'use strict';var emlformat=require(_0xae84('0x0'));var rimraf=require(_0xae84('0x1'));var zipdir=require(_0xae84('0x2'));var jsonpatch=require(_0xae84('0x3'));var rp=require(_0xae84('0x4'));var moment=require('moment');var BPromise=require(_0xae84('0x5'));var Mustache=require(_0xae84('0x6'));var util=require(_0xae84('0x7'));var path=require(_0xae84('0x8'));var sox=require(_0xae84('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae84('0xa'));var _=require('lodash');var squel=require(_0xae84('0xb'));var crypto=require('crypto');var jsforce=require(_0xae84('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xae84('0xd'));var querystring=require(_0xae84('0xe'));var Papa=require(_0xae84('0xf'));var Redis=require(_0xae84('0x10'));var authService=require(_0xae84('0x11'));var qs=require(_0xae84('0x12'));var as=require(_0xae84('0x13'));var hardwareService=require(_0xae84('0x14'));var logger=require(_0xae84('0x15'))(_0xae84('0x16'));var utils=require(_0xae84('0x17'));var config=require(_0xae84('0x18'));var licenseUtil=require(_0xae84('0x19'));var db=require(_0xae84('0x1a'))['db'];config[_0xae84('0x1b')]=_[_0xae84('0x1c')](config[_0xae84('0x1b')],{'host':_0xae84('0x1d'),'port':0x18eb});var socket=require(_0xae84('0x1e'))(new Redis(config[_0xae84('0x1b')]));require(_0xae84('0x1f'))[_0xae84('0x20')](socket);function respondWithStatusCode(_0x41f4a2,_0x262122){_0x262122=_0x262122||0xcc;return function(_0x5ce19c){if(_0x5ce19c){return _0x41f4a2['sendStatus'](_0x262122);}return _0x41f4a2[_0xae84('0x21')](_0x262122)['end']();};}function respondWithResult(_0x46ada1,_0x132d14){_0x132d14=_0x132d14||0xc8;return function(_0x4d32db){if(_0x4d32db){return _0x46ada1[_0xae84('0x21')](_0x132d14)[_0xae84('0x22')](_0x4d32db);}};}function respondWithFilteredResult(_0x4d0cd2,_0x119c3d){return function(_0x2bb8d1){if(_0x2bb8d1){var _0x468e78=typeof _0x119c3d[_0xae84('0x23')]===_0xae84('0x24')&&typeof _0x119c3d[_0xae84('0x25')]===_0xae84('0x24');var _0xfa697f=_0x2bb8d1['count'];var _0x155cd9=_0x468e78?0x0:_0x119c3d[_0xae84('0x23')];var _0x59bf87=_0x468e78?_0x2bb8d1[_0xae84('0x26')]:_0x119c3d[_0xae84('0x23')]+_0x119c3d[_0xae84('0x25')];var _0x3bf0b5;if(_0x59bf87>=_0xfa697f){_0x59bf87=_0xfa697f;_0x3bf0b5=0xc8;}else{_0x3bf0b5=0xce;}_0x4d0cd2[_0xae84('0x21')](_0x3bf0b5);return _0x4d0cd2[_0xae84('0x27')](_0xae84('0x28'),_0x155cd9+'-'+_0x59bf87+'/'+_0xfa697f)[_0xae84('0x22')](_0x2bb8d1);}return null;};}function patchUpdates(_0x9b0dc7){return function(_0x549556){try{jsonpatch['apply'](_0x549556,_0x9b0dc7,!![]);}catch(_0x106cd8){return BPromise[_0xae84('0x29')](_0x106cd8);}return _0x549556[_0xae84('0x2a')]();};}function saveUpdates(_0x4ed048,_0x52a0b0){return function(_0x5863c5){if(_0x5863c5){return _0x5863c5[_0xae84('0x2b')](_0x4ed048)[_0xae84('0x2c')](function(_0x5aea73){return _0x5aea73;});}return null;};}function removeEntity(_0x4ce37a,_0x31073e){return function(_0x2b951f){if(_0x2b951f){return _0x2b951f[_0xae84('0x2d')]()[_0xae84('0x2c')](function(){var _0x33946a=_0x2b951f[_0xae84('0x2e')]({'plain':!![]});var _0x55c5ea=_0xae84('0x2f');return db[_0xae84('0x30')][_0xae84('0x2d')]({'where':{'type':_0x55c5ea,'resourceId':_0x33946a['id']}})[_0xae84('0x2c')](function(){return _0x2b951f;});})[_0xae84('0x2c')](function(){_0x4ce37a[_0xae84('0x21')](0xcc)[_0xae84('0x31')]();});}};}function handleEntityNotFound(_0x57c942,_0x3c4734){return function(_0x3abf88){if(!_0x3abf88){_0x57c942[_0xae84('0x32')](0x194);}return _0x3abf88;};}function handleError(_0x42b41e,_0x107bf3){_0x107bf3=_0x107bf3||0x1f4;return function(_0x4545f2){logger[_0xae84('0x33')](_0x4545f2[_0xae84('0x34')]);if(_0x4545f2[_0xae84('0x35')]){delete _0x4545f2['name'];}_0x42b41e[_0xae84('0x21')](_0x107bf3)[_0xae84('0x36')](_0x4545f2);};}exports[_0xae84('0x37')]=function(_0x5c78c2,_0x373e1c){var _0x561a3e={},_0x42225c={},_0x4b6088={'count':0x0,'rows':[]};var _0x7b9a97=_['map'](db[_0xae84('0x38')][_0xae84('0x39')],function(_0x2d4afb){return{'name':_0x2d4afb[_0xae84('0x3a')],'type':_0x2d4afb[_0xae84('0x3b')][_0xae84('0x3c')]};});_0x42225c[_0xae84('0x3d')]=_[_0xae84('0x3e')](_0x7b9a97,_0xae84('0x35'));_0x42225c[_0xae84('0x3f')]=_[_0xae84('0x40')](_0x5c78c2[_0xae84('0x3f')]);_0x42225c[_0xae84('0x41')]=_[_0xae84('0x42')](_0x42225c[_0xae84('0x3d')],_0x42225c[_0xae84('0x3f')]);_0x561a3e['attributes']=_[_0xae84('0x42')](_0x42225c[_0xae84('0x3d')],qs[_0xae84('0x43')](_0x5c78c2[_0xae84('0x3f')][_0xae84('0x43')]));_0x561a3e[_0xae84('0x44')]=_0x561a3e[_0xae84('0x44')]['length']?_0x561a3e[_0xae84('0x44')]:_0x42225c[_0xae84('0x3d')];if(!_0x5c78c2[_0xae84('0x3f')]['hasOwnProperty']('nolimit')){_0x561a3e[_0xae84('0x25')]=qs[_0xae84('0x25')](_0x5c78c2[_0xae84('0x3f')]['limit']);_0x561a3e[_0xae84('0x23')]=qs[_0xae84('0x23')](_0x5c78c2[_0xae84('0x3f')][_0xae84('0x23')]);}_0x561a3e[_0xae84('0x45')]=qs[_0xae84('0x46')](_0x5c78c2[_0xae84('0x3f')][_0xae84('0x46')]);_0x561a3e['where']=qs['filters'](_[_0xae84('0x47')](_0x5c78c2[_0xae84('0x3f')],_0x42225c[_0xae84('0x41')]),_0x7b9a97);if(_0x5c78c2[_0xae84('0x3f')][_0xae84('0x48')]){_0x561a3e[_0xae84('0x49')]=_[_0xae84('0x4a')](_0x561a3e[_0xae84('0x49')],{'$or':_[_0xae84('0x3e')](_0x7b9a97,function(_0x83f013){if(_0x83f013[_0xae84('0x3b')]!==_0xae84('0x4b')){var _0x1677b5={};_0x1677b5[_0x83f013[_0xae84('0x35')]]={'$like':'%'+_0x5c78c2['query'][_0xae84('0x48')]+'%'};return _0x1677b5;}})});}_0x561a3e=_[_0xae84('0x4a')]({},_0x561a3e,_0x5c78c2[_0xae84('0x4c')]);var _0x1f1d76={'where':_0x561a3e[_0xae84('0x49')]};return db[_0xae84('0x38')][_0xae84('0x26')](_0x1f1d76)[_0xae84('0x2c')](function(_0x4ccae9){_0x4b6088['count']=_0x4ccae9;if(_0x5c78c2[_0xae84('0x3f')]['includeAll']){_0x561a3e['include']=[{'all':!![]}];}return db[_0xae84('0x38')]['findAll'](_0x561a3e);})[_0xae84('0x2c')](function(_0x228fa5){_0x4b6088['rows']=_0x228fa5;return _0x4b6088;})[_0xae84('0x2c')](respondWithFilteredResult(_0x373e1c,_0x561a3e))[_0xae84('0x4d')](handleError(_0x373e1c,null));};exports[_0xae84('0x4e')]=function(_0x3b17f4,_0xaf0ad7){var _0x470a85={'raw':![],'where':{'id':_0x3b17f4[_0xae84('0x4f')]['id']}},_0x104e48={};_0x104e48['model']=_[_0xae84('0x40')](db[_0xae84('0x38')][_0xae84('0x39')]);_0x104e48[_0xae84('0x3f')]=_[_0xae84('0x40')](_0x3b17f4[_0xae84('0x3f')]);_0x104e48[_0xae84('0x41')]=_[_0xae84('0x42')](_0x104e48[_0xae84('0x3d')],_0x104e48[_0xae84('0x3f')]);_0x470a85[_0xae84('0x44')]=_[_0xae84('0x42')](_0x104e48[_0xae84('0x3d')],qs[_0xae84('0x43')](_0x3b17f4['query'][_0xae84('0x43')]));_0x470a85['attributes']=_0x470a85['attributes']['length']?_0x470a85[_0xae84('0x44')]:_0x104e48['model'];if(_0x3b17f4[_0xae84('0x3f')][_0xae84('0x50')]){_0x470a85[_0xae84('0x51')]=[{'all':!![]}];}_0x470a85=_[_0xae84('0x4a')]({},_0x470a85,_0x3b17f4[_0xae84('0x4c')]);return db[_0xae84('0x38')][_0xae84('0x52')](_0x470a85)[_0xae84('0x2c')](handleEntityNotFound(_0xaf0ad7,null))['then'](respondWithResult(_0xaf0ad7,null))[_0xae84('0x4d')](handleError(_0xaf0ad7,null));};exports[_0xae84('0x53')]=function(_0x1628ea,_0x52b933){return db[_0xae84('0x38')][_0xae84('0x53')](_0x1628ea[_0xae84('0x54')],{})['then'](function(_0x36402f){var _0x1f27b0=_0x1628ea['user'][_0xae84('0x2e')]({'plain':!![]});if(!_0x1f27b0)throw new Error(_0xae84('0x55'));if(_0x1f27b0['role']==='user'){var _0xa272c4=_0x36402f[_0xae84('0x2e')]({'plain':!![]});var _0x42fa4e=_0xae84('0x2f');return db[_0xae84('0x56')]['find']({'where':{'name':_0x42fa4e,'userProfileId':_0x1f27b0[_0xae84('0x57')]},'raw':!![]})[_0xae84('0x2c')](function(_0x25eada){if(_0x25eada&&_0x25eada[_0xae84('0x58')]===0x0){return db[_0xae84('0x30')][_0xae84('0x53')]({'name':_0xa272c4[_0xae84('0x35')],'resourceId':_0xa272c4['id'],'type':_0x25eada['name'],'sectionId':_0x25eada['id']},{})[_0xae84('0x2c')](function(){return _0x36402f;});}else{return _0x36402f;}})[_0xae84('0x4d')](function(_0x5831f0){logger[_0xae84('0x33')](_0xae84('0x59'),_0x5831f0);throw _0x5831f0;});}return _0x36402f;})[_0xae84('0x2c')](respondWithResult(_0x52b933,0xc9))[_0xae84('0x4d')](handleError(_0x52b933,null));};exports[_0xae84('0x2b')]=function(_0x3a57b8,_0x5c4b69){if(_0x3a57b8[_0xae84('0x54')]['id']){delete _0x3a57b8[_0xae84('0x54')]['id'];}return db['CmList'][_0xae84('0x52')]({'where':{'id':_0x3a57b8[_0xae84('0x4f')]['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x5c4b69,null))['then'](saveUpdates(_0x3a57b8[_0xae84('0x54')],null))[_0xae84('0x2c')](respondWithResult(_0x5c4b69,null))[_0xae84('0x4d')](handleError(_0x5c4b69,null));};exports[_0xae84('0x2d')]=function(_0x3ec144,_0x14dcb1){return db[_0xae84('0x38')][_0xae84('0x52')]({'where':{'id':_0x3ec144[_0xae84('0x4f')]['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x14dcb1,null))[_0xae84('0x2c')](removeEntity(_0x14dcb1,null))[_0xae84('0x4d')](handleError(_0x14dcb1,null));};exports[_0xae84('0x5a')]=function(_0x12a7f9,_0xf2979){return db[_0xae84('0x38')][_0xae84('0x5a')]()['then'](respondWithResult(_0xf2979,null))[_0xae84('0x4d')](handleError(_0xf2979,null));};exports[_0xae84('0x5b')]=function(_0x7e96e3,_0x5c3842,_0x539b47){if(_0x7e96e3[_0xae84('0x54')]['id']){delete _0x7e96e3['body']['id'];}return db[_0xae84('0x38')]['find']({'where':{'id':_0x7e96e3[_0xae84('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5c3842,null))[_0xae84('0x2c')](function(_0x2e8678){if(_0x2e8678){_0x7e96e3['body'][_0xae84('0x5c')]=_0x2e8678['id'];return db[_0xae84('0x5d')][_0xae84('0x53')](_0x7e96e3[_0xae84('0x54')]);}})['then'](respondWithResult(_0x5c3842,null))['catch'](handleError(_0x5c3842,null));};exports[_0xae84('0x5e')]=function(_0x1ceee7,_0x36653f,_0x1411bb){var _0x4e7c28={'raw':![],'where':{}};var _0x103f7e={};var _0x5c6056={'count':0x0,'rows':[]};return db[_0xae84('0x38')][_0xae84('0x5f')]({'where':{'id':_0x1ceee7[_0xae84('0x4f')]['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x36653f,null))[_0xae84('0x2c')](function(_0x5d8328){if(_0x5d8328){_0x103f7e['model']=_['keys'](db[_0xae84('0x5d')][_0xae84('0x39')]);_0x103f7e[_0xae84('0x3f')]=_[_0xae84('0x40')](_0x1ceee7[_0xae84('0x3f')]);_0x103f7e[_0xae84('0x41')]=_['intersection'](_0x103f7e[_0xae84('0x3d')],_0x103f7e[_0xae84('0x3f')]);_0x4e7c28[_0xae84('0x44')]=_[_0xae84('0x42')](_0x103f7e['model'],qs['fields'](_0x1ceee7[_0xae84('0x3f')][_0xae84('0x43')]));_0x4e7c28['attributes']=_0x4e7c28[_0xae84('0x44')]['length']?_0x4e7c28[_0xae84('0x44')]:_0x103f7e['model'];if(!_0x1ceee7['query'][_0xae84('0x60')](_0xae84('0x61'))){_0x4e7c28[_0xae84('0x25')]=qs['limit'](_0x1ceee7['query'][_0xae84('0x25')]);_0x4e7c28[_0xae84('0x23')]=qs['offset'](_0x1ceee7[_0xae84('0x3f')][_0xae84('0x23')]);}_0x4e7c28[_0xae84('0x45')]=qs['sort'](_0x1ceee7[_0xae84('0x3f')][_0xae84('0x46')]);_0x4e7c28['where']=qs[_0xae84('0x41')](_[_0xae84('0x47')](_0x1ceee7[_0xae84('0x3f')],_0x103f7e[_0xae84('0x41')]));_0x4e7c28[_0xae84('0x49')]['ListId']=_0x5d8328['id'];if(_0x1ceee7[_0xae84('0x3f')][_0xae84('0x48')]){_0x4e7c28['where']=_[_0xae84('0x4a')](_0x4e7c28[_0xae84('0x49')],{'$or':_[_0xae84('0x3e')](_0x4e7c28['attributes'],function(_0x1d5ec8){var _0x4b7b4d={};_0x4b7b4d[_0x1d5ec8]={'$like':'%'+_0x1ceee7[_0xae84('0x3f')][_0xae84('0x48')]+'%'};return _0x4b7b4d;})});}_0x4e7c28=_[_0xae84('0x4a')]({},_0x4e7c28,_0x1ceee7['options']);return db[_0xae84('0x5d')][_0xae84('0x26')]({'where':_0x4e7c28['where']})['then'](function(_0x1092f8){_0x5c6056[_0xae84('0x26')]=_0x1092f8;if(_0x1ceee7[_0xae84('0x3f')][_0xae84('0x50')]){_0x4e7c28[_0xae84('0x51')]=[{'all':!![]}];}return db[_0xae84('0x5d')][_0xae84('0x62')](_0x4e7c28);})[_0xae84('0x2c')](function(_0x595d8f){_0x5c6056[_0xae84('0x63')]=_0x595d8f;return _0x5c6056;});}})[_0xae84('0x2c')](respondWithFilteredResult(_0x36653f,_0x4e7c28))[_0xae84('0x4d')](handleError(_0x36653f,null));};exports[_0xae84('0x64')]=function(_0xe31640,_0x25ff09,_0x57fa8c){return db[_0xae84('0x38')]['find']({'where':{'id':_0xe31640[_0xae84('0x4f')]['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x25ff09,null))['then'](function(_0x3ca8c7){if(_0x3ca8c7){return _0x3ca8c7[_0xae84('0x64')](_0xe31640['query'][_0xae84('0x65')]);}})[_0xae84('0x2c')](respondWithStatusCode(_0x25ff09,null))[_0xae84('0x4d')](handleError(_0x25ff09,null));};exports[_0xae84('0x66')]=function(_0x2327aa,_0x2c5c6f,_0x57867c){return db[_0xae84('0x38')]['find']({'where':{'id':_0x2327aa['params']['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x2c5c6f,null))[_0xae84('0x2c')](function(_0xa104dd){if(_0xa104dd){var _0x40d72d=[];var _0x2645be={'success':[],'errors':[]};return db[_0xae84('0x67')][_0xae84('0x5a')]()['then'](function(_0x3fbdd7){if(_0x2327aa[_0xae84('0x54')][_0xae84('0x68')]&&_[_0xae84('0x69')](_0x2327aa[_0xae84('0x54')][_0xae84('0x68')])){if(_0x2327aa['body']['tags']['length']){_0x2327aa['body'][_0xae84('0x68')]=_0x2327aa[_0xae84('0x54')][_0xae84('0x68')][_0xae84('0x6a')](';')+';';}else{_0x2327aa[_0xae84('0x54')][_0xae84('0x68')]=null;}}else{_0x2327aa['body'][_0xae84('0x68')]=null;}if(_0x2327aa[_0xae84('0x54')]&&_[_0xae84('0x69')](_0x2327aa['body'])){for(var _0x427e0a=0x0;_0x427e0a<_0x2327aa[_0xae84('0x54')]['length'];_0x427e0a+=0x1){_0x2327aa['body'][_0x427e0a]['ListId']=_0x2327aa[_0xae84('0x4f')]['id'];_0x40d72d[_0xae84('0x6b')](_0x2327aa[_0xae84('0x54')][_0x427e0a]);}return BPromise[_0xae84('0x6c')](_0x40d72d,function(_0xd63afe){return db[_0xae84('0x67')][_0xae84('0x53')](_[_0xae84('0x6d')](_0xd63afe,[_0xae84('0x65'),'id'])||{},{'fields':_[_0xae84('0x40')](_0x3fbdd7),'raw':!![]})['then'](function(_0x248aab){_0x2645be[_0xae84('0x6e')][_0xae84('0x6b')](_0x248aab[_0xae84('0x6f')]);})['catch'](function(_0x34bb4d){_0x2645be[_0xae84('0x70')][_0xae84('0x6b')]({'data':_0xd63afe,'error':_0x34bb4d[_0xae84('0x71')]});});})[_0xae84('0x2c')](function(_0x2fea39){return _0x2645be;})['catch'](function(_0x3815d8){return _0x3815d8;});}else{_0x2c5c6f[_0xae84('0x21')](0x190)[_0xae84('0x22')]({'message':_0xae84('0x72')});}});}})['then'](respondWithResult(_0x2c5c6f,null))[_0xae84('0x4d')](handleError(_0x2c5c6f,null));};exports[_0xae84('0x73')]=function(_0x1a5d8e,_0x1f47ca,_0x35e1b3){var _0x346e89;return db[_0xae84('0x38')][_0xae84('0x52')]({'where':{'id':_0x1a5d8e[_0xae84('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xae84('0x2c')](handleEntityNotFound(_0x1f47ca,null))[_0xae84('0x2c')](function(_0x5ca191){if(_0x5ca191){_0x346e89=_0x5ca191;return db[_0xae84('0x67')][_0xae84('0x39')];}})['then'](function(_0x4d40d1){if(_0x4d40d1){var _0x21163d={};var _0x268f9a={};_0x268f9a[_0xae84('0x3d')]=_['concat'](_[_0xae84('0x40')](_0x4d40d1),_[_0xae84('0x3e')](_0x346e89[_0xae84('0x74')],function(_0x2aa37c){return util[_0xae84('0x75')](_0xae84('0x76'),_0x2aa37c['id']);}));_0x268f9a[_0xae84('0x3f')]=_[_0xae84('0x40')](_0x1a5d8e['query']);_0x268f9a[_0xae84('0x41')]=_[_0xae84('0x42')](_0x268f9a[_0xae84('0x3d')],_0x268f9a[_0xae84('0x3f')]);_0x21163d[_0xae84('0x44')]=_['intersection'](_0x268f9a['model'],qs[_0xae84('0x43')](_0x1a5d8e[_0xae84('0x3f')][_0xae84('0x43')]));_0x21163d[_0xae84('0x44')]=_0x21163d['attributes']['length']?_0x21163d[_0xae84('0x44')]:_0x268f9a[_0xae84('0x3d')];if(!_0x1a5d8e[_0xae84('0x3f')][_0xae84('0x60')](_0xae84('0x61'))){_0x21163d[_0xae84('0x25')]=qs[_0xae84('0x25')](_0x1a5d8e[_0xae84('0x3f')][_0xae84('0x25')]);_0x21163d[_0xae84('0x23')]=qs['offset'](_0x1a5d8e['query']['offset']);}_0x21163d['order']=qs[_0xae84('0x46')](_0x1a5d8e[_0xae84('0x3f')][_0xae84('0x46')]);_0x21163d[_0xae84('0x49')]=qs[_0xae84('0x41')](_[_0xae84('0x47')](_0x1a5d8e['query'],_0x268f9a[_0xae84('0x41')]));_0x21163d[_0xae84('0x77')]=!![];if(_0x1a5d8e[_0xae84('0x3f')][_0xae84('0x48')]){_0x21163d[_0xae84('0x49')]=_[_0xae84('0x4a')](_0x21163d[_0xae84('0x49')],{'$or':_[_0xae84('0x3e')](_0x21163d[_0xae84('0x44')],function(_0x2f49bc){var _0x1987ef={};_0x1987ef[_0x2f49bc]={'$like':'%'+_0x1a5d8e[_0xae84('0x3f')][_0xae84('0x48')]+'%'};return _0x1987ef;})});}_0x21163d=_[_0xae84('0x4a')]({},_0x21163d,_0x1a5d8e[_0xae84('0x4c')]);return _0x346e89['getContacts'](_0x21163d);}})['then'](respondWithResult(_0x1f47ca,null))[_0xae84('0x4d')](handleError(_0x1f47ca,null));};exports[_0xae84('0x78')]=function(_0x2abe4a,_0x5d18fa,_0x389b27){var _0x57bd35;return db['CmList']['find']({'where':{'id':_0x2abe4a[_0xae84('0x4f')]['id']},'include':[{'model':db[_0xae84('0x79')],'as':_0xae84('0x74')}]})['then'](handleEntityNotFound(_0x5d18fa,null))[_0xae84('0x2c')](function(_0x1e47bc){if(_0x1e47bc){_0x57bd35=_0x1e47bc;return db['CmContact'][_0xae84('0x39')];}})[_0xae84('0x2c')](function(_0x28212f){if(_0x28212f){var _0x510db3={};var _0x12c311={};_0x12c311[_0xae84('0x3d')]=_[_0xae84('0x7a')](_[_0xae84('0x40')](_0x28212f),_[_0xae84('0x3e')](_0x57bd35[_0xae84('0x74')],function(_0x46872c){return util[_0xae84('0x75')](_0xae84('0x76'),_0x46872c['id']);}));_0x12c311[_0xae84('0x3f')]=_[_0xae84('0x40')](_0x2abe4a[_0xae84('0x3f')]);_0x12c311[_0xae84('0x41')]=_[_0xae84('0x42')](_0x12c311[_0xae84('0x3d')],_0x12c311[_0xae84('0x3f')]);_0x510db3[_0xae84('0x44')]=_[_0xae84('0x42')](_0x12c311[_0xae84('0x3d')],qs['fields'](_0x2abe4a[_0xae84('0x3f')][_0xae84('0x43')]));_0x510db3[_0xae84('0x44')]=_0x510db3[_0xae84('0x44')][_0xae84('0x7b')]?_0x510db3[_0xae84('0x44')]:_0x12c311[_0xae84('0x3d')];if(!_0x2abe4a['query']['hasOwnProperty'](_0xae84('0x61'))){_0x510db3[_0xae84('0x25')]=qs[_0xae84('0x25')](_0x2abe4a[_0xae84('0x3f')][_0xae84('0x25')]);_0x510db3[_0xae84('0x23')]=qs['offset'](_0x2abe4a[_0xae84('0x3f')][_0xae84('0x23')]);}_0x510db3[_0xae84('0x45')]=qs[_0xae84('0x46')](_0x2abe4a[_0xae84('0x3f')][_0xae84('0x46')]);_0x510db3[_0xae84('0x49')]=qs['filters'](_[_0xae84('0x47')](_0x2abe4a['query'],_0x12c311[_0xae84('0x41')]));_0x510db3[_0xae84('0x77')]=!![];if(_0x2abe4a[_0xae84('0x3f')][_0xae84('0x48')]){_0x510db3[_0xae84('0x49')]=_[_0xae84('0x4a')](_0x510db3[_0xae84('0x49')],{'$or':_[_0xae84('0x3e')](_0x510db3[_0xae84('0x44')],function(_0x21bf5a){var _0x35f1b6={};_0x35f1b6[_0x21bf5a]={'$like':'%'+_0x2abe4a['query']['filter']+'%'};return _0x35f1b6;})});}_0x510db3=_['merge']({},_0x510db3,_0x2abe4a[_0xae84('0x4c')]);return _0x57bd35['getContacts'](_0x510db3);}})['then'](function(_0x982693){if(!_[_0xae84('0x7c')](_0x982693)){var _0x23cf24=toCsv(_0x982693);var _0x25023a=Date[_0xae84('0x7d')]();fs[_0xae84('0x7e')](util[_0xae84('0x75')](_0xae84('0x7f'),_0x57bd35['id'],_0x25023a),_0x23cf24);_0x5d18fa['setHeader'](_0xae84('0x80'),_0xae84('0x81')+util[_0xae84('0x75')](_0xae84('0x82'),_0x57bd35['id'],_0x25023a));_0x5d18fa[_0xae84('0x83')](_0xae84('0x84'),_0xae84('0x85'));return _0x5d18fa[_0xae84('0x86')](util[_0xae84('0x75')](_0xae84('0x7f'),_0x57bd35['id'],_0x25023a));}else{return _0x5d18fa[_0xae84('0x32')](0xcc);}})[_0xae84('0x4d')](handleError(_0x5d18fa,null));};exports['addCustomField']=function(_0x12eb1f,_0x57e7ee,_0x4ec41d){var _0x2c02e4;delete _0x12eb1f[_0xae84('0x54')]['id'];return db[_0xae84('0x38')][_0xae84('0x5f')]({'where':{'id':_0x12eb1f[_0xae84('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57e7ee,null))[_0xae84('0x2c')](function(_0x1d050a){if(_0x1d050a){return db[_0xae84('0x87')]['transaction'](function(_0x5a61b3){return db[_0xae84('0x79')]['create'](_0x12eb1f[_0xae84('0x54')],{'transaction':_0x5a61b3})[_0xae84('0x2c')](function(_0x4bda41){_0x2c02e4=_0x4bda41;return _0x1d050a[_0xae84('0x88')](_0x4bda41,{'transaction':_0x5a61b3});})[_0xae84('0x2c')](function(){var _0x13b4b3={'type':db[_0xae84('0x89')][_0xae84('0x8a')],'transaction':_0x5a61b3};switch(_0x12eb1f[_0xae84('0x54')][_0xae84('0x3b')]){case _0xae84('0x8b'):_0x13b4b3['type']=db[_0xae84('0x89')][_0xae84('0x8a')];break;case _0xae84('0x8c'):_0x13b4b3[_0xae84('0x3b')]=db[_0xae84('0x89')][_0xae84('0x8d')];break;case _0xae84('0x8e'):_0x13b4b3[_0xae84('0x3b')]=db[_0xae84('0x89')][_0xae84('0x8f')];_0x13b4b3[_0xae84('0x90')]=![];break;default:}return db['sequelize'][_0xae84('0x91')][_0xae84('0x92')](_0xae84('0x93'),util[_0xae84('0x75')](_0xae84('0x94'),_0x2c02e4['id']),_0x13b4b3);})['then'](function(){return _0x2c02e4;});});}})['then'](respondWithResult(_0x57e7ee,null))[_0xae84('0x4d')](handleError(_0x57e7ee,null));};exports[_0xae84('0x95')]=function(_0xf62ace,_0x38681f,_0x35db8c){var _0x16b545={};var _0x3b0f06={};var _0x41b1da;var _0x69135c;return db[_0xae84('0x38')]['findOne']({'where':{'id':_0xf62ace['params']['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x38681f,null))[_0xae84('0x2c')](function(_0x5029b1){if(_0x5029b1){_0x41b1da=_0x5029b1;_0x3b0f06[_0xae84('0x3d')]=_[_0xae84('0x40')](db[_0xae84('0x79')]['rawAttributes']);_0x3b0f06['query']=_['keys'](_0xf62ace[_0xae84('0x3f')]);_0x3b0f06[_0xae84('0x41')]=_[_0xae84('0x42')](_0x3b0f06['model'],_0x3b0f06['query']);_0x16b545[_0xae84('0x44')]=_[_0xae84('0x42')](_0x3b0f06['model'],qs[_0xae84('0x43')](_0xf62ace[_0xae84('0x3f')][_0xae84('0x43')]));_0x16b545[_0xae84('0x44')]=_0x16b545['attributes'][_0xae84('0x7b')]?_0x16b545[_0xae84('0x44')]:_0x3b0f06[_0xae84('0x3d')];_0x16b545[_0xae84('0x45')]=qs[_0xae84('0x46')](_0xf62ace['query'][_0xae84('0x46')]);_0x16b545[_0xae84('0x49')]=qs[_0xae84('0x41')](_[_0xae84('0x47')](_0xf62ace[_0xae84('0x3f')],_0x3b0f06[_0xae84('0x41')]));_0x16b545['where']=_[_0xae84('0x4a')](_0x16b545[_0xae84('0x49')],{'$or':[{'ListId':_0x5029b1['id']},{'ListId':null}]});if(_0xf62ace[_0xae84('0x3f')][_0xae84('0x48')]){_0x16b545[_0xae84('0x49')]=_['merge'](_0x16b545[_0xae84('0x49')],{'$or':_[_0xae84('0x3e')](_0x16b545[_0xae84('0x44')],function(_0x187503){var _0x41072f={};_0x41072f[_0x187503]={'$like':'%'+_0xf62ace[_0xae84('0x3f')][_0xae84('0x48')]+'%'};return _0x41072f;})});}_0x16b545=_[_0xae84('0x4a')]({},_0x16b545,_0xf62ace[_0xae84('0x4c')]);return db[_0xae84('0x79')][_0xae84('0x96')](_0x16b545);}})[_0xae84('0x2c')](respondWithResult(_0x38681f,null))[_0xae84('0x4d')](handleError(_0x38681f,null));};exports[_0xae84('0x97')]=function(_0xec84ee,_0x2150d5,_0x37dd6c){return db[_0xae84('0x38')][_0xae84('0x52')]({'where':{'id':_0xec84ee[_0xae84('0x4f')]['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x2150d5,null))[_0xae84('0x2c')](function(_0x43da55){if(_0x43da55){return _0x43da55[_0xae84('0x97')](_0xec84ee[_0xae84('0x54')][_0xae84('0x65')],_[_0xae84('0x6d')](_0xec84ee[_0xae84('0x54')],[_0xae84('0x65'),'id'])||{})[_0xae84('0x98')](function(_0x495e04){for(var _0x443172=0x0;_0x443172<_0xec84ee[_0xae84('0x54')]['ids'][_0xae84('0x7b')];_0x443172+=0x1){socket[_0xae84('0x99')](_0xae84('0x9a'),{'UserId':Number(_0xec84ee[_0xae84('0x54')]['ids'][_0x443172]),'CmListId':Number(_0xec84ee[_0xae84('0x4f')]['id'])});}return _0x495e04;});}})[_0xae84('0x2c')](respondWithResult(_0x2150d5,null))[_0xae84('0x4d')](handleError(_0x2150d5,null));};exports[_0xae84('0x9b')]=function(_0x53fbbc,_0x22b7af,_0x2a52d5){return db[_0xae84('0x38')]['find']({'where':{'id':_0x53fbbc[_0xae84('0x4f')]['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x22b7af,null))[_0xae84('0x2c')](function(_0x2a3575){if(_0x2a3575){return _0x2a3575['removeAgents'](_0x53fbbc[_0xae84('0x3f')][_0xae84('0x65')])['then'](function(){if(_[_0xae84('0x69')](_0x53fbbc[_0xae84('0x3f')][_0xae84('0x65')])){for(var _0x249be2=0x0;_0x249be2<_0x53fbbc[_0xae84('0x3f')][_0xae84('0x65')][_0xae84('0x7b')];_0x249be2+=0x1){socket[_0xae84('0x99')]('userCmList:remove',{'UserId':Number(_0x53fbbc[_0xae84('0x3f')][_0xae84('0x65')][_0x249be2]),'CmListId':Number(_0x53fbbc[_0xae84('0x4f')]['id'])});}}else{socket[_0xae84('0x99')](_0xae84('0x9c'),{'UserId':Number(_0x53fbbc[_0xae84('0x3f')][_0xae84('0x65')]),'CmListId':Number(_0x53fbbc[_0xae84('0x4f')]['id'])});}});}})[_0xae84('0x2c')](respondWithStatusCode(_0x22b7af,null))[_0xae84('0x4d')](handleError(_0x22b7af,null));};exports[_0xae84('0x9d')]=function(_0x59614a,_0x240a12,_0x1843b6){var _0x1329a5={};var _0x916807={};var _0x356ded;var _0x4c0b74;return db[_0xae84('0x38')]['findOne']({'where':{'id':_0x59614a[_0xae84('0x4f')]['id']}})[_0xae84('0x2c')](handleEntityNotFound(_0x240a12,null))[_0xae84('0x2c')](function(_0x3df5c9){if(_0x3df5c9){_0x356ded=_0x3df5c9;_0x916807['model']=_[_0xae84('0x40')](db[_0xae84('0x9e')][_0xae84('0x39')]);_0x916807['query']=_[_0xae84('0x40')](_0x59614a[_0xae84('0x3f')]);_0x916807[_0xae84('0x41')]=_[_0xae84('0x42')](_0x916807['model'],_0x916807[_0xae84('0x3f')]);_0x1329a5[_0xae84('0x44')]=_[_0xae84('0x42')](_0x916807[_0xae84('0x3d')],qs[_0xae84('0x43')](_0x59614a[_0xae84('0x3f')][_0xae84('0x43')]));_0x1329a5['attributes']=_0x1329a5['attributes'][_0xae84('0x7b')]?_0x1329a5[_0xae84('0x44')]:_0x916807['model'];_0x1329a5[_0xae84('0x45')]=qs[_0xae84('0x46')](_0x59614a[_0xae84('0x3f')][_0xae84('0x46')]);_0x1329a5['where']=qs[_0xae84('0x41')](_['pick'](_0x59614a[_0xae84('0x3f')],_0x916807[_0xae84('0x41')]));if(_0x59614a['query'][_0xae84('0x48')]){_0x1329a5['where']=_['merge'](_0x1329a5[_0xae84('0x49')],{'$or':_[_0xae84('0x3e')](_0x1329a5[_0xae84('0x44')],function(_0x44587b){var _0x4b8ff2={};_0x4b8ff2[_0x44587b]={'$like':'%'+_0x59614a['query'][_0xae84('0x48')]+'%'};return _0x4b8ff2;})});}_0x1329a5=_[_0xae84('0x4a')]({},_0x1329a5,_0x59614a[_0xae84('0x4c')]);return _0x356ded[_0xae84('0x9d')](_0x1329a5);}})['then'](function(_0x4a2a41){if(_0x4a2a41){_0x4c0b74=_0x4a2a41['length'];if(!_0x59614a['query']['hasOwnProperty'](_0xae84('0x61'))){_0x1329a5[_0xae84('0x25')]=qs[_0xae84('0x25')](_0x59614a['query'][_0xae84('0x25')]);_0x1329a5['offset']=qs[_0xae84('0x23')](_0x59614a[_0xae84('0x3f')][_0xae84('0x23')]);}return _0x356ded[_0xae84('0x9d')](_0x1329a5);}})[_0xae84('0x2c')](function(_0x45ec43){if(_0x45ec43){return _0x45ec43?{'count':_0x4c0b74,'rows':_0x45ec43}:null;}})[_0xae84('0x2c')](respondWithResult(_0x240a12,null))[_0xae84('0x4d')](handleError(_0x240a12,null));}; \ No newline at end of file +var _0xfa15=['defaults','./cmList.socket','register','end','status','json','undefined','offset','limit','set','Content-Range','reject','save','update','then','destroy','Lists','error','stack','send','index','CmList','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','name','options','count','include','findAll','rows','catch','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','getDispositions','Disposition','pick','ids','addContacts','CmContact','tags','isArray','join','omit','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','getContactsCsv','raw','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','findOne','addAgents','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x5344e5,_0x379f66){var _0x2c1c10=function(_0x44eb13){while(--_0x44eb13){_0x5344e5['push'](_0x5344e5['shift']());}};_0x2c1c10(++_0x379f66);}(_0xfa15,0x101));var _0x5fa1=function(_0x1830cc,_0x80acd4){_0x1830cc=_0x1830cc-0x0;var _0x39149e=_0xfa15[_0x1830cc];return _0x39149e;};'use strict';var emlformat=require(_0x5fa1('0x0'));var rimraf=require(_0x5fa1('0x1'));var zipdir=require(_0x5fa1('0x2'));var jsonpatch=require(_0x5fa1('0x3'));var rp=require(_0x5fa1('0x4'));var moment=require(_0x5fa1('0x5'));var BPromise=require(_0x5fa1('0x6'));var Mustache=require(_0x5fa1('0x7'));var util=require('util');var path=require(_0x5fa1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5fa1('0x9'));var fs=require('fs');var fs_extra=require(_0x5fa1('0xa'));var _=require('lodash');var squel=require(_0x5fa1('0xb'));var crypto=require(_0x5fa1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5fa1('0xd'));var toCsv=require(_0x5fa1('0xe'));var querystring=require(_0x5fa1('0xf'));var Papa=require('papaparse');var Redis=require(_0x5fa1('0x10'));var authService=require(_0x5fa1('0x11'));var qs=require(_0x5fa1('0x12'));var as=require(_0x5fa1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fa1('0x14'))(_0x5fa1('0x15'));var utils=require(_0x5fa1('0x16'));var config=require(_0x5fa1('0x17'));var licenseUtil=require(_0x5fa1('0x18'));var db=require(_0x5fa1('0x19'))['db'];config[_0x5fa1('0x1a')]=_[_0x5fa1('0x1b')](config[_0x5fa1('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fa1('0x1a')]));require(_0x5fa1('0x1c'))[_0x5fa1('0x1d')](socket);function respondWithStatusCode(_0x36de3e,_0x1d386a){_0x1d386a=_0x1d386a||0xcc;return function(_0x32c11d){if(_0x32c11d){return _0x36de3e['sendStatus'](_0x1d386a);}return _0x36de3e['status'](_0x1d386a)[_0x5fa1('0x1e')]();};}function respondWithResult(_0x37fc09,_0x6bc6a8){_0x6bc6a8=_0x6bc6a8||0xc8;return function(_0x299668){if(_0x299668){return _0x37fc09[_0x5fa1('0x1f')](_0x6bc6a8)[_0x5fa1('0x20')](_0x299668);}};}function respondWithFilteredResult(_0x5970b6,_0x17a710){return function(_0x57da20){if(_0x57da20){var _0x3c96cf=typeof _0x17a710['offset']===_0x5fa1('0x21')&&typeof _0x17a710['limit']===_0x5fa1('0x21');var _0x140989=_0x57da20['count'];var _0xf75b33=_0x3c96cf?0x0:_0x17a710[_0x5fa1('0x22')];var _0x595256=_0x3c96cf?_0x57da20['count']:_0x17a710[_0x5fa1('0x22')]+_0x17a710[_0x5fa1('0x23')];var _0x424ab4;if(_0x595256>=_0x140989){_0x595256=_0x140989;_0x424ab4=0xc8;}else{_0x424ab4=0xce;}_0x5970b6[_0x5fa1('0x1f')](_0x424ab4);return _0x5970b6[_0x5fa1('0x24')](_0x5fa1('0x25'),_0xf75b33+'-'+_0x595256+'/'+_0x140989)[_0x5fa1('0x20')](_0x57da20);}return null;};}function patchUpdates(_0x3a5ac4){return function(_0x287b33){try{jsonpatch['apply'](_0x287b33,_0x3a5ac4,!![]);}catch(_0x397ebc){return BPromise[_0x5fa1('0x26')](_0x397ebc);}return _0x287b33[_0x5fa1('0x27')]();};}function saveUpdates(_0x1786eb,_0x259e7b){return function(_0x257fe4){if(_0x257fe4){return _0x257fe4[_0x5fa1('0x28')](_0x1786eb)[_0x5fa1('0x29')](function(_0x1ff590){return _0x1ff590;});}return null;};}function removeEntity(_0x47005f,_0x577dbd){return function(_0x2334b9){if(_0x2334b9){return _0x2334b9[_0x5fa1('0x2a')]()[_0x5fa1('0x29')](function(){var _0x2fc9dc=_0x2334b9['get']({'plain':!![]});var _0x40a1be=_0x5fa1('0x2b');return db['UserProfileResource'][_0x5fa1('0x2a')]({'where':{'type':_0x40a1be,'resourceId':_0x2fc9dc['id']}})['then'](function(){return _0x2334b9;});})[_0x5fa1('0x29')](function(){_0x47005f[_0x5fa1('0x1f')](0xcc)[_0x5fa1('0x1e')]();});}};}function handleEntityNotFound(_0x31452f,_0x5e8010){return function(_0x24abe6){if(!_0x24abe6){_0x31452f['sendStatus'](0x194);}return _0x24abe6;};}function handleError(_0x304019,_0x3227d2){_0x3227d2=_0x3227d2||0x1f4;return function(_0x1eddd9){logger[_0x5fa1('0x2c')](_0x1eddd9[_0x5fa1('0x2d')]);if(_0x1eddd9['name']){delete _0x1eddd9['name'];}_0x304019[_0x5fa1('0x1f')](_0x3227d2)[_0x5fa1('0x2e')](_0x1eddd9);};}exports[_0x5fa1('0x2f')]=function(_0x2a3f27,_0x3fb298){var _0x46742c={},_0x88ae9b={},_0x4f0fb2={'count':0x0,'rows':[]};var _0x787b3d=_['map'](db[_0x5fa1('0x30')][_0x5fa1('0x31')],function(_0x48a03e){return{'name':_0x48a03e['fieldName'],'type':_0x48a03e[_0x5fa1('0x32')][_0x5fa1('0x33')]};});_0x88ae9b[_0x5fa1('0x34')]=_['map'](_0x787b3d,'name');_0x88ae9b[_0x5fa1('0x35')]=_['keys'](_0x2a3f27['query']);_0x88ae9b['filters']=_[_0x5fa1('0x36')](_0x88ae9b[_0x5fa1('0x34')],_0x88ae9b['query']);_0x46742c[_0x5fa1('0x37')]=_[_0x5fa1('0x36')](_0x88ae9b[_0x5fa1('0x34')],qs[_0x5fa1('0x38')](_0x2a3f27[_0x5fa1('0x35')][_0x5fa1('0x38')]));_0x46742c[_0x5fa1('0x37')]=_0x46742c[_0x5fa1('0x37')][_0x5fa1('0x39')]?_0x46742c[_0x5fa1('0x37')]:_0x88ae9b[_0x5fa1('0x34')];if(!_0x2a3f27[_0x5fa1('0x35')][_0x5fa1('0x3a')](_0x5fa1('0x3b'))){_0x46742c['limit']=qs['limit'](_0x2a3f27[_0x5fa1('0x35')]['limit']);_0x46742c[_0x5fa1('0x22')]=qs['offset'](_0x2a3f27[_0x5fa1('0x35')]['offset']);}_0x46742c[_0x5fa1('0x3c')]=qs[_0x5fa1('0x3d')](_0x2a3f27[_0x5fa1('0x35')][_0x5fa1('0x3d')]);_0x46742c[_0x5fa1('0x3e')]=qs[_0x5fa1('0x3f')](_['pick'](_0x2a3f27['query'],_0x88ae9b[_0x5fa1('0x3f')]),_0x787b3d);if(_0x2a3f27[_0x5fa1('0x35')][_0x5fa1('0x40')]){_0x46742c[_0x5fa1('0x3e')]=_[_0x5fa1('0x41')](_0x46742c[_0x5fa1('0x3e')],{'$or':_[_0x5fa1('0x42')](_0x787b3d,function(_0x55d857){if(_0x55d857['type']!==_0x5fa1('0x43')){var _0x5b8fe0={};_0x5b8fe0[_0x55d857[_0x5fa1('0x44')]]={'$like':'%'+_0x2a3f27[_0x5fa1('0x35')][_0x5fa1('0x40')]+'%'};return _0x5b8fe0;}})});}_0x46742c=_[_0x5fa1('0x41')]({},_0x46742c,_0x2a3f27[_0x5fa1('0x45')]);var _0x256b24={'where':_0x46742c[_0x5fa1('0x3e')]};return db[_0x5fa1('0x30')]['count'](_0x256b24)[_0x5fa1('0x29')](function(_0x3c1701){_0x4f0fb2[_0x5fa1('0x46')]=_0x3c1701;if(_0x2a3f27[_0x5fa1('0x35')]['includeAll']){_0x46742c[_0x5fa1('0x47')]=[{'all':!![]}];}return db[_0x5fa1('0x30')][_0x5fa1('0x48')](_0x46742c);})[_0x5fa1('0x29')](function(_0x40c906){_0x4f0fb2[_0x5fa1('0x49')]=_0x40c906;return _0x4f0fb2;})[_0x5fa1('0x29')](respondWithFilteredResult(_0x3fb298,_0x46742c))[_0x5fa1('0x4a')](handleError(_0x3fb298,null));};exports['show']=function(_0x19898e,_0x663ca1){var _0x36f44c={'raw':![],'where':{'id':_0x19898e['params']['id']}},_0x5186af={};_0x5186af[_0x5fa1('0x34')]=_[_0x5fa1('0x4b')](db[_0x5fa1('0x30')][_0x5fa1('0x31')]);_0x5186af['query']=_[_0x5fa1('0x4b')](_0x19898e['query']);_0x5186af[_0x5fa1('0x3f')]=_[_0x5fa1('0x36')](_0x5186af[_0x5fa1('0x34')],_0x5186af[_0x5fa1('0x35')]);_0x36f44c[_0x5fa1('0x37')]=_['intersection'](_0x5186af[_0x5fa1('0x34')],qs[_0x5fa1('0x38')](_0x19898e[_0x5fa1('0x35')]['fields']));_0x36f44c['attributes']=_0x36f44c['attributes'][_0x5fa1('0x39')]?_0x36f44c['attributes']:_0x5186af[_0x5fa1('0x34')];if(_0x19898e[_0x5fa1('0x35')][_0x5fa1('0x4c')]){_0x36f44c[_0x5fa1('0x47')]=[{'all':!![]}];}_0x36f44c=_[_0x5fa1('0x41')]({},_0x36f44c,_0x19898e['options']);return db['CmList'][_0x5fa1('0x4d')](_0x36f44c)[_0x5fa1('0x29')](handleEntityNotFound(_0x663ca1,null))[_0x5fa1('0x29')](respondWithResult(_0x663ca1,null))[_0x5fa1('0x4a')](handleError(_0x663ca1,null));};exports[_0x5fa1('0x4e')]=function(_0x32a330,_0x5140a2){return db[_0x5fa1('0x30')][_0x5fa1('0x4e')](_0x32a330[_0x5fa1('0x4f')],{})[_0x5fa1('0x29')](function(_0x3e5d48){var _0x367865=_0x32a330[_0x5fa1('0x50')][_0x5fa1('0x51')]({'plain':!![]});if(!_0x367865)throw new Error(_0x5fa1('0x52'));if(_0x367865[_0x5fa1('0x53')]===_0x5fa1('0x50')){var _0x4aa6c3=_0x3e5d48[_0x5fa1('0x51')]({'plain':!![]});var _0x4a6223=_0x5fa1('0x2b');return db[_0x5fa1('0x54')][_0x5fa1('0x4d')]({'where':{'name':_0x4a6223,'userProfileId':_0x367865['userProfileId']},'raw':!![]})['then'](function(_0x159c57){if(_0x159c57&&_0x159c57[_0x5fa1('0x55')]===0x0){return db['UserProfileResource'][_0x5fa1('0x4e')]({'name':_0x4aa6c3[_0x5fa1('0x44')],'resourceId':_0x4aa6c3['id'],'type':_0x159c57[_0x5fa1('0x44')],'sectionId':_0x159c57['id']},{})[_0x5fa1('0x29')](function(){return _0x3e5d48;});}else{return _0x3e5d48;}})[_0x5fa1('0x4a')](function(_0x3d4e6d){logger[_0x5fa1('0x2c')](_0x5fa1('0x56'),_0x3d4e6d);throw _0x3d4e6d;});}return _0x3e5d48;})['then'](respondWithResult(_0x5140a2,0xc9))[_0x5fa1('0x4a')](handleError(_0x5140a2,null));};exports[_0x5fa1('0x28')]=function(_0x5235c3,_0x587f48){if(_0x5235c3[_0x5fa1('0x4f')]['id']){delete _0x5235c3[_0x5fa1('0x4f')]['id'];}return db['CmList'][_0x5fa1('0x4d')]({'where':{'id':_0x5235c3['params']['id']}})['then'](handleEntityNotFound(_0x587f48,null))[_0x5fa1('0x29')](saveUpdates(_0x5235c3['body'],null))['then'](respondWithResult(_0x587f48,null))[_0x5fa1('0x4a')](handleError(_0x587f48,null));};exports[_0x5fa1('0x2a')]=function(_0x3f6618,_0x265737){return db[_0x5fa1('0x30')]['find']({'where':{'id':_0x3f6618[_0x5fa1('0x57')]['id']}})[_0x5fa1('0x29')](handleEntityNotFound(_0x265737,null))[_0x5fa1('0x29')](removeEntity(_0x265737,null))[_0x5fa1('0x4a')](handleError(_0x265737,null));};exports[_0x5fa1('0x58')]=function(_0x82b374,_0x36ca78){return db[_0x5fa1('0x30')][_0x5fa1('0x58')]()[_0x5fa1('0x29')](respondWithResult(_0x36ca78,null))[_0x5fa1('0x4a')](handleError(_0x36ca78,null));};exports[_0x5fa1('0x59')]=function(_0x5341b3,_0x4d7c7c,_0x103f9c){if(_0x5341b3[_0x5fa1('0x4f')]['id']){delete _0x5341b3[_0x5fa1('0x4f')]['id'];}return db[_0x5fa1('0x30')]['find']({'where':{'id':_0x5341b3[_0x5fa1('0x57')]['id']}})[_0x5fa1('0x29')](handleEntityNotFound(_0x4d7c7c,null))['then'](function(_0x518518){if(_0x518518){_0x5341b3[_0x5fa1('0x4f')][_0x5fa1('0x5a')]=_0x518518['id'];return db['Disposition'][_0x5fa1('0x4e')](_0x5341b3[_0x5fa1('0x4f')]);}})[_0x5fa1('0x29')](respondWithResult(_0x4d7c7c,null))['catch'](handleError(_0x4d7c7c,null));};exports[_0x5fa1('0x5b')]=function(_0x1d22e2,_0x3a345f,_0x2f94cd){var _0x466ad7={'raw':![],'where':{}};var _0x36d802={};var _0x517467={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x1d22e2['params']['id']}})['then'](handleEntityNotFound(_0x3a345f,null))[_0x5fa1('0x29')](function(_0x2eaf01){if(_0x2eaf01){_0x36d802[_0x5fa1('0x34')]=_['keys'](db[_0x5fa1('0x5c')][_0x5fa1('0x31')]);_0x36d802[_0x5fa1('0x35')]=_[_0x5fa1('0x4b')](_0x1d22e2[_0x5fa1('0x35')]);_0x36d802[_0x5fa1('0x3f')]=_['intersection'](_0x36d802[_0x5fa1('0x34')],_0x36d802[_0x5fa1('0x35')]);_0x466ad7['attributes']=_[_0x5fa1('0x36')](_0x36d802[_0x5fa1('0x34')],qs[_0x5fa1('0x38')](_0x1d22e2[_0x5fa1('0x35')][_0x5fa1('0x38')]));_0x466ad7[_0x5fa1('0x37')]=_0x466ad7['attributes']['length']?_0x466ad7[_0x5fa1('0x37')]:_0x36d802[_0x5fa1('0x34')];if(!_0x1d22e2[_0x5fa1('0x35')]['hasOwnProperty'](_0x5fa1('0x3b'))){_0x466ad7['limit']=qs[_0x5fa1('0x23')](_0x1d22e2['query']['limit']);_0x466ad7[_0x5fa1('0x22')]=qs[_0x5fa1('0x22')](_0x1d22e2[_0x5fa1('0x35')][_0x5fa1('0x22')]);}_0x466ad7[_0x5fa1('0x3c')]=qs[_0x5fa1('0x3d')](_0x1d22e2[_0x5fa1('0x35')][_0x5fa1('0x3d')]);_0x466ad7[_0x5fa1('0x3e')]=qs['filters'](_[_0x5fa1('0x5d')](_0x1d22e2[_0x5fa1('0x35')],_0x36d802[_0x5fa1('0x3f')]));_0x466ad7[_0x5fa1('0x3e')][_0x5fa1('0x5a')]=_0x2eaf01['id'];if(_0x1d22e2['query'][_0x5fa1('0x40')]){_0x466ad7[_0x5fa1('0x3e')]=_[_0x5fa1('0x41')](_0x466ad7[_0x5fa1('0x3e')],{'$or':_[_0x5fa1('0x42')](_0x466ad7['attributes'],function(_0x2c2a6a){var _0x24b2e5={};_0x24b2e5[_0x2c2a6a]={'$like':'%'+_0x1d22e2[_0x5fa1('0x35')][_0x5fa1('0x40')]+'%'};return _0x24b2e5;})});}_0x466ad7=_[_0x5fa1('0x41')]({},_0x466ad7,_0x1d22e2[_0x5fa1('0x45')]);return db[_0x5fa1('0x5c')][_0x5fa1('0x46')]({'where':_0x466ad7['where']})[_0x5fa1('0x29')](function(_0x1c3229){_0x517467[_0x5fa1('0x46')]=_0x1c3229;if(_0x1d22e2['query'][_0x5fa1('0x4c')]){_0x466ad7[_0x5fa1('0x47')]=[{'all':!![]}];}return db[_0x5fa1('0x5c')][_0x5fa1('0x48')](_0x466ad7);})['then'](function(_0xa61cdc){_0x517467[_0x5fa1('0x49')]=_0xa61cdc;return _0x517467;});}})['then'](respondWithFilteredResult(_0x3a345f,_0x466ad7))[_0x5fa1('0x4a')](handleError(_0x3a345f,null));};exports['removeDispositions']=function(_0x18d0cf,_0x4d9c16,_0x125fa2){return db[_0x5fa1('0x30')][_0x5fa1('0x4d')]({'where':{'id':_0x18d0cf[_0x5fa1('0x57')]['id']}})[_0x5fa1('0x29')](handleEntityNotFound(_0x4d9c16,null))[_0x5fa1('0x29')](function(_0x5ef069){if(_0x5ef069){return _0x5ef069['removeDispositions'](_0x18d0cf[_0x5fa1('0x35')][_0x5fa1('0x5e')]);}})['then'](respondWithStatusCode(_0x4d9c16,null))[_0x5fa1('0x4a')](handleError(_0x4d9c16,null));};exports[_0x5fa1('0x5f')]=function(_0x45b256,_0x32ec48,_0x2c423e){return db[_0x5fa1('0x30')][_0x5fa1('0x4d')]({'where':{'id':_0x45b256[_0x5fa1('0x57')]['id']}})[_0x5fa1('0x29')](handleEntityNotFound(_0x32ec48,null))['then'](function(_0x182982){if(_0x182982){var _0x4224cd=[];var _0x452635={'success':[],'errors':[]};return db[_0x5fa1('0x60')][_0x5fa1('0x58')]()[_0x5fa1('0x29')](function(_0x3b21a8){if(_0x45b256['body'][_0x5fa1('0x61')]&&_[_0x5fa1('0x62')](_0x45b256[_0x5fa1('0x4f')][_0x5fa1('0x61')])){if(_0x45b256[_0x5fa1('0x4f')][_0x5fa1('0x61')]['length']){_0x45b256[_0x5fa1('0x4f')]['tags']=_0x45b256[_0x5fa1('0x4f')][_0x5fa1('0x61')][_0x5fa1('0x63')](';')+';';}else{_0x45b256[_0x5fa1('0x4f')][_0x5fa1('0x61')]=null;}}else{_0x45b256[_0x5fa1('0x4f')]['tags']=null;}if(_0x45b256[_0x5fa1('0x4f')]&&_[_0x5fa1('0x62')](_0x45b256[_0x5fa1('0x4f')])){for(var _0x5a1313=0x0;_0x5a1313<_0x45b256[_0x5fa1('0x4f')][_0x5fa1('0x39')];_0x5a1313+=0x1){_0x45b256[_0x5fa1('0x4f')][_0x5a1313][_0x5fa1('0x5a')]=_0x45b256[_0x5fa1('0x57')]['id'];_0x4224cd['push'](_0x45b256[_0x5fa1('0x4f')][_0x5a1313]);}return BPromise['each'](_0x4224cd,function(_0x5967cf){return db[_0x5fa1('0x60')][_0x5fa1('0x4e')](_[_0x5fa1('0x64')](_0x5967cf,['ids','id'])||{},{'fields':_[_0x5fa1('0x4b')](_0x3b21a8),'raw':!![]})[_0x5fa1('0x29')](function(_0x33aafb){_0x452635['success'][_0x5fa1('0x65')](_0x33aafb['dataValues']);})['catch'](function(_0x1b31a4){_0x452635['errors'][_0x5fa1('0x65')]({'data':_0x5967cf,'error':_0x1b31a4[_0x5fa1('0x66')]});});})['then'](function(_0x37142c){return _0x452635;})[_0x5fa1('0x4a')](function(_0x4fcd02){return _0x4fcd02;});}else{_0x32ec48[_0x5fa1('0x1f')](0x190)[_0x5fa1('0x20')]({'message':_0x5fa1('0x67')});}});}})[_0x5fa1('0x29')](respondWithResult(_0x32ec48,null))[_0x5fa1('0x4a')](handleError(_0x32ec48,null));};exports[_0x5fa1('0x68')]=function(_0x3cd4f8,_0x12f354,_0x5bd12c){var _0x48867a;return db['CmList'][_0x5fa1('0x4d')]({'where':{'id':_0x3cd4f8[_0x5fa1('0x57')]['id']},'include':[{'model':db[_0x5fa1('0x69')],'as':_0x5fa1('0x6a')}]})['then'](handleEntityNotFound(_0x12f354,null))[_0x5fa1('0x29')](function(_0x4425a4){if(_0x4425a4){_0x48867a=_0x4425a4;return db['CmContact'][_0x5fa1('0x31')];}})[_0x5fa1('0x29')](function(_0x3464e8){if(_0x3464e8){var _0x51189c={};var _0x8a69ef={};_0x8a69ef[_0x5fa1('0x34')]=_['concat'](_[_0x5fa1('0x4b')](_0x3464e8),_['map'](_0x48867a[_0x5fa1('0x6a')],function(_0x2bd754){return util[_0x5fa1('0x6b')](_0x5fa1('0x6c'),_0x2bd754['id']);}));_0x8a69ef[_0x5fa1('0x35')]=_[_0x5fa1('0x4b')](_0x3cd4f8[_0x5fa1('0x35')]);_0x8a69ef[_0x5fa1('0x3f')]=_[_0x5fa1('0x36')](_0x8a69ef[_0x5fa1('0x34')],_0x8a69ef['query']);_0x51189c[_0x5fa1('0x37')]=_['intersection'](_0x8a69ef['model'],qs[_0x5fa1('0x38')](_0x3cd4f8[_0x5fa1('0x35')][_0x5fa1('0x38')]));_0x51189c[_0x5fa1('0x37')]=_0x51189c[_0x5fa1('0x37')][_0x5fa1('0x39')]?_0x51189c[_0x5fa1('0x37')]:_0x8a69ef[_0x5fa1('0x34')];if(!_0x3cd4f8['query']['hasOwnProperty'](_0x5fa1('0x3b'))){_0x51189c[_0x5fa1('0x23')]=qs[_0x5fa1('0x23')](_0x3cd4f8['query'][_0x5fa1('0x23')]);_0x51189c[_0x5fa1('0x22')]=qs[_0x5fa1('0x22')](_0x3cd4f8['query']['offset']);}_0x51189c[_0x5fa1('0x3c')]=qs[_0x5fa1('0x3d')](_0x3cd4f8[_0x5fa1('0x35')][_0x5fa1('0x3d')]);_0x51189c[_0x5fa1('0x3e')]=qs[_0x5fa1('0x3f')](_['pick'](_0x3cd4f8[_0x5fa1('0x35')],_0x8a69ef[_0x5fa1('0x3f')]));_0x51189c['raw']=!![];if(_0x3cd4f8[_0x5fa1('0x35')][_0x5fa1('0x40')]){_0x51189c[_0x5fa1('0x3e')]=_[_0x5fa1('0x41')](_0x51189c[_0x5fa1('0x3e')],{'$or':_[_0x5fa1('0x42')](_0x51189c[_0x5fa1('0x37')],function(_0x469e90){var _0x4ea8f7={};_0x4ea8f7[_0x469e90]={'$like':'%'+_0x3cd4f8[_0x5fa1('0x35')][_0x5fa1('0x40')]+'%'};return _0x4ea8f7;})});}_0x51189c=_[_0x5fa1('0x41')]({},_0x51189c,_0x3cd4f8['options']);return _0x48867a[_0x5fa1('0x68')](_0x51189c);}})['then'](respondWithResult(_0x12f354,null))[_0x5fa1('0x4a')](handleError(_0x12f354,null));};exports[_0x5fa1('0x6d')]=function(_0x4c86e0,_0x51c275,_0x108b90){var _0x56df99;return db['CmList']['find']({'where':{'id':_0x4c86e0[_0x5fa1('0x57')]['id']},'include':[{'model':db[_0x5fa1('0x69')],'as':'CustomFields'}]})[_0x5fa1('0x29')](handleEntityNotFound(_0x51c275,null))[_0x5fa1('0x29')](function(_0x6e8e47){if(_0x6e8e47){_0x56df99=_0x6e8e47;return db[_0x5fa1('0x60')][_0x5fa1('0x31')];}})[_0x5fa1('0x29')](function(_0x16a031){if(_0x16a031){var _0x525e59={};var _0x5cbe4d={};_0x5cbe4d['model']=_['concat'](_[_0x5fa1('0x4b')](_0x16a031),_[_0x5fa1('0x42')](_0x56df99['CustomFields'],function(_0x11b85b){return util[_0x5fa1('0x6b')](_0x5fa1('0x6c'),_0x11b85b['id']);}));_0x5cbe4d[_0x5fa1('0x35')]=_[_0x5fa1('0x4b')](_0x4c86e0['query']);_0x5cbe4d[_0x5fa1('0x3f')]=_[_0x5fa1('0x36')](_0x5cbe4d[_0x5fa1('0x34')],_0x5cbe4d['query']);_0x525e59['attributes']=_['intersection'](_0x5cbe4d[_0x5fa1('0x34')],qs[_0x5fa1('0x38')](_0x4c86e0[_0x5fa1('0x35')]['fields']));_0x525e59[_0x5fa1('0x37')]=_0x525e59[_0x5fa1('0x37')][_0x5fa1('0x39')]?_0x525e59[_0x5fa1('0x37')]:_0x5cbe4d[_0x5fa1('0x34')];if(!_0x4c86e0[_0x5fa1('0x35')][_0x5fa1('0x3a')]('nolimit')){_0x525e59[_0x5fa1('0x23')]=qs[_0x5fa1('0x23')](_0x4c86e0[_0x5fa1('0x35')][_0x5fa1('0x23')]);_0x525e59[_0x5fa1('0x22')]=qs[_0x5fa1('0x22')](_0x4c86e0['query'][_0x5fa1('0x22')]);}_0x525e59[_0x5fa1('0x3c')]=qs[_0x5fa1('0x3d')](_0x4c86e0[_0x5fa1('0x35')]['sort']);_0x525e59[_0x5fa1('0x3e')]=qs[_0x5fa1('0x3f')](_[_0x5fa1('0x5d')](_0x4c86e0[_0x5fa1('0x35')],_0x5cbe4d['filters']));_0x525e59[_0x5fa1('0x6e')]=!![];if(_0x4c86e0['query'][_0x5fa1('0x40')]){_0x525e59['where']=_[_0x5fa1('0x41')](_0x525e59[_0x5fa1('0x3e')],{'$or':_[_0x5fa1('0x42')](_0x525e59[_0x5fa1('0x37')],function(_0x4d445c){var _0x2aa8e0={};_0x2aa8e0[_0x4d445c]={'$like':'%'+_0x4c86e0[_0x5fa1('0x35')]['filter']+'%'};return _0x2aa8e0;})});}_0x525e59=_[_0x5fa1('0x41')]({},_0x525e59,_0x4c86e0['options']);return _0x56df99[_0x5fa1('0x68')](_0x525e59);}})[_0x5fa1('0x29')](function(_0x42cc41){if(!_[_0x5fa1('0x6f')](_0x42cc41)){var _0x15ea03=toCsv(_0x42cc41);var _0x231641=Date['now']();fs[_0x5fa1('0x70')](util[_0x5fa1('0x6b')](_0x5fa1('0x71'),_0x56df99['id'],_0x231641),_0x15ea03);_0x51c275[_0x5fa1('0x72')]('Content-disposition',_0x5fa1('0x73')+util['format']('list_%d_%s.csv',_0x56df99['id'],_0x231641));_0x51c275['setHeader'](_0x5fa1('0x74'),_0x5fa1('0x75'));return _0x51c275[_0x5fa1('0x76')](util['format']('/tmp/list_%d_%s.csv',_0x56df99['id'],_0x231641));}else{return _0x51c275[_0x5fa1('0x77')](0xcc);}})[_0x5fa1('0x4a')](handleError(_0x51c275,null));};exports[_0x5fa1('0x78')]=function(_0x36c655,_0xaf0fec,_0x9ce949){var _0x505930;delete _0x36c655['body']['id'];return db[_0x5fa1('0x30')]['findOne']({'where':{'id':_0x36c655[_0x5fa1('0x57')]['id']}})['then'](handleEntityNotFound(_0xaf0fec,null))['then'](function(_0x449da3){if(_0x449da3){return db[_0x5fa1('0x79')]['transaction'](function(_0x311caa){return db[_0x5fa1('0x69')][_0x5fa1('0x4e')](_0x36c655[_0x5fa1('0x4f')],{'transaction':_0x311caa})[_0x5fa1('0x29')](function(_0x4a1ca7){_0x505930=_0x4a1ca7;return _0x449da3[_0x5fa1('0x7a')](_0x4a1ca7,{'transaction':_0x311caa});})[_0x5fa1('0x29')](function(){var _0x46f341={'type':db[_0x5fa1('0x7b')][_0x5fa1('0x7c')],'transaction':_0x311caa};switch(_0x36c655['body'][_0x5fa1('0x32')]){case _0x5fa1('0x7d'):_0x46f341['type']=db[_0x5fa1('0x7b')][_0x5fa1('0x7c')];break;case _0x5fa1('0x7e'):_0x46f341[_0x5fa1('0x32')]=db[_0x5fa1('0x7b')][_0x5fa1('0x7f')];break;case _0x5fa1('0x80'):_0x46f341[_0x5fa1('0x32')]=db['Sequelize'][_0x5fa1('0x81')];_0x46f341[_0x5fa1('0x82')]=![];break;default:}return db[_0x5fa1('0x79')][_0x5fa1('0x83')][_0x5fa1('0x84')](_0x5fa1('0x85'),util[_0x5fa1('0x6b')](_0x5fa1('0x86'),_0x505930['id']),_0x46f341);})['then'](function(){return _0x505930;});});}})['then'](respondWithResult(_0xaf0fec,null))['catch'](handleError(_0xaf0fec,null));};exports['getCustomFields']=function(_0x54dcfd,_0x347199,_0x1c36e0){var _0x2e7aad={};var _0x26f87b={};var _0x61e216;var _0x49efe9;return db[_0x5fa1('0x30')][_0x5fa1('0x87')]({'where':{'id':_0x54dcfd[_0x5fa1('0x57')]['id']}})[_0x5fa1('0x29')](handleEntityNotFound(_0x347199,null))['then'](function(_0x5de4cd){if(_0x5de4cd){_0x61e216=_0x5de4cd;_0x26f87b['model']=_['keys'](db['CmCustomField'][_0x5fa1('0x31')]);_0x26f87b['query']=_['keys'](_0x54dcfd[_0x5fa1('0x35')]);_0x26f87b['filters']=_['intersection'](_0x26f87b[_0x5fa1('0x34')],_0x26f87b[_0x5fa1('0x35')]);_0x2e7aad[_0x5fa1('0x37')]=_[_0x5fa1('0x36')](_0x26f87b[_0x5fa1('0x34')],qs[_0x5fa1('0x38')](_0x54dcfd['query'][_0x5fa1('0x38')]));_0x2e7aad[_0x5fa1('0x37')]=_0x2e7aad[_0x5fa1('0x37')][_0x5fa1('0x39')]?_0x2e7aad[_0x5fa1('0x37')]:_0x26f87b[_0x5fa1('0x34')];_0x2e7aad['order']=qs['sort'](_0x54dcfd[_0x5fa1('0x35')][_0x5fa1('0x3d')]);_0x2e7aad[_0x5fa1('0x3e')]=qs[_0x5fa1('0x3f')](_[_0x5fa1('0x5d')](_0x54dcfd[_0x5fa1('0x35')],_0x26f87b[_0x5fa1('0x3f')]));_0x2e7aad[_0x5fa1('0x3e')]=_['merge'](_0x2e7aad[_0x5fa1('0x3e')],{'$or':[{'ListId':_0x5de4cd['id']},{'ListId':null}]});if(_0x54dcfd['query'][_0x5fa1('0x40')]){_0x2e7aad[_0x5fa1('0x3e')]=_[_0x5fa1('0x41')](_0x2e7aad[_0x5fa1('0x3e')],{'$or':_[_0x5fa1('0x42')](_0x2e7aad[_0x5fa1('0x37')],function(_0x9c25df){var _0x3569a8={};_0x3569a8[_0x9c25df]={'$like':'%'+_0x54dcfd['query'][_0x5fa1('0x40')]+'%'};return _0x3569a8;})});}_0x2e7aad=_[_0x5fa1('0x41')]({},_0x2e7aad,_0x54dcfd[_0x5fa1('0x45')]);return db[_0x5fa1('0x69')]['findAndCountAll'](_0x2e7aad);}})[_0x5fa1('0x29')](respondWithResult(_0x347199,null))[_0x5fa1('0x4a')](handleError(_0x347199,null));};exports[_0x5fa1('0x88')]=function(_0x3a3467,_0x3b0b30,_0x25dca9){return db[_0x5fa1('0x30')][_0x5fa1('0x4d')]({'where':{'id':_0x3a3467[_0x5fa1('0x57')]['id']}})[_0x5fa1('0x29')](handleEntityNotFound(_0x3b0b30,null))[_0x5fa1('0x29')](function(_0x14eefd){if(_0x14eefd){return _0x14eefd['addAgents'](_0x3a3467['body'][_0x5fa1('0x5e')],_[_0x5fa1('0x64')](_0x3a3467['body'],['ids','id'])||{})['spread'](function(_0x32eca9){for(var _0x4045d0=0x0;_0x4045d0<_0x3a3467[_0x5fa1('0x4f')]['ids'][_0x5fa1('0x39')];_0x4045d0+=0x1){socket[_0x5fa1('0x89')]('userCmList:save',{'UserId':Number(_0x3a3467['body'][_0x5fa1('0x5e')][_0x4045d0]),'CmListId':Number(_0x3a3467[_0x5fa1('0x57')]['id'])});}return _0x32eca9;});}})[_0x5fa1('0x29')](respondWithResult(_0x3b0b30,null))[_0x5fa1('0x4a')](handleError(_0x3b0b30,null));};exports[_0x5fa1('0x8a')]=function(_0x2c2892,_0x347bab,_0x4f6ee7){return db['CmList'][_0x5fa1('0x4d')]({'where':{'id':_0x2c2892[_0x5fa1('0x57')]['id']}})['then'](handleEntityNotFound(_0x347bab,null))[_0x5fa1('0x29')](function(_0x5cf51a){if(_0x5cf51a){return _0x5cf51a[_0x5fa1('0x8a')](_0x2c2892[_0x5fa1('0x35')][_0x5fa1('0x5e')])[_0x5fa1('0x29')](function(){if(_[_0x5fa1('0x62')](_0x2c2892[_0x5fa1('0x35')]['ids'])){for(var _0x4c0b1a=0x0;_0x4c0b1a<_0x2c2892[_0x5fa1('0x35')][_0x5fa1('0x5e')][_0x5fa1('0x39')];_0x4c0b1a+=0x1){socket[_0x5fa1('0x89')](_0x5fa1('0x8b'),{'UserId':Number(_0x2c2892['query']['ids'][_0x4c0b1a]),'CmListId':Number(_0x2c2892[_0x5fa1('0x57')]['id'])});}}else{socket['emit'](_0x5fa1('0x8b'),{'UserId':Number(_0x2c2892[_0x5fa1('0x35')][_0x5fa1('0x5e')]),'CmListId':Number(_0x2c2892['params']['id'])});}});}})[_0x5fa1('0x29')](respondWithStatusCode(_0x347bab,null))[_0x5fa1('0x4a')](handleError(_0x347bab,null));};exports[_0x5fa1('0x8c')]=function(_0x122ec9,_0x255c28,_0xe0c0f1){var _0x1db7cc={};var _0x16c130={};var _0x3b3e77;var _0x54fce6;return db[_0x5fa1('0x30')]['findOne']({'where':{'id':_0x122ec9[_0x5fa1('0x57')]['id']}})[_0x5fa1('0x29')](handleEntityNotFound(_0x255c28,null))[_0x5fa1('0x29')](function(_0x3a64f9){if(_0x3a64f9){_0x3b3e77=_0x3a64f9;_0x16c130[_0x5fa1('0x34')]=_[_0x5fa1('0x4b')](db[_0x5fa1('0x8d')][_0x5fa1('0x31')]);_0x16c130[_0x5fa1('0x35')]=_[_0x5fa1('0x4b')](_0x122ec9[_0x5fa1('0x35')]);_0x16c130[_0x5fa1('0x3f')]=_[_0x5fa1('0x36')](_0x16c130['model'],_0x16c130[_0x5fa1('0x35')]);_0x1db7cc['attributes']=_[_0x5fa1('0x36')](_0x16c130[_0x5fa1('0x34')],qs[_0x5fa1('0x38')](_0x122ec9['query'][_0x5fa1('0x38')]));_0x1db7cc['attributes']=_0x1db7cc[_0x5fa1('0x37')][_0x5fa1('0x39')]?_0x1db7cc[_0x5fa1('0x37')]:_0x16c130[_0x5fa1('0x34')];_0x1db7cc[_0x5fa1('0x3c')]=qs[_0x5fa1('0x3d')](_0x122ec9[_0x5fa1('0x35')][_0x5fa1('0x3d')]);_0x1db7cc[_0x5fa1('0x3e')]=qs[_0x5fa1('0x3f')](_['pick'](_0x122ec9[_0x5fa1('0x35')],_0x16c130[_0x5fa1('0x3f')]));if(_0x122ec9['query'][_0x5fa1('0x40')]){_0x1db7cc[_0x5fa1('0x3e')]=_['merge'](_0x1db7cc['where'],{'$or':_[_0x5fa1('0x42')](_0x1db7cc[_0x5fa1('0x37')],function(_0x3b88f4){var _0x19bf17={};_0x19bf17[_0x3b88f4]={'$like':'%'+_0x122ec9['query']['filter']+'%'};return _0x19bf17;})});}_0x1db7cc=_['merge']({},_0x1db7cc,_0x122ec9['options']);return _0x3b3e77[_0x5fa1('0x8c')](_0x1db7cc);}})[_0x5fa1('0x29')](function(_0x46b6eb){if(_0x46b6eb){_0x54fce6=_0x46b6eb['length'];if(!_0x122ec9['query'][_0x5fa1('0x3a')](_0x5fa1('0x3b'))){_0x1db7cc[_0x5fa1('0x23')]=qs[_0x5fa1('0x23')](_0x122ec9[_0x5fa1('0x35')]['limit']);_0x1db7cc[_0x5fa1('0x22')]=qs[_0x5fa1('0x22')](_0x122ec9['query'][_0x5fa1('0x22')]);}return _0x3b3e77[_0x5fa1('0x8c')](_0x1db7cc);}})[_0x5fa1('0x29')](function(_0x5c2d8d){if(_0x5c2d8d){return _0x5c2d8d?{'count':_0x54fce6,'rows':_0x5c2d8d}:null;}})[_0x5fa1('0x29')](respondWithResult(_0x255c28,null))['catch'](handleError(_0x255c28,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index b1f3ae6..3bbacc7 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x55ca,0x126));var _0xa55c=function(_0x5d24c1,_0xf7cd20){_0x5d24c1=_0x5d24c1-0x0;var _0x89701b=_0x55ca[_0x5d24c1];return _0x89701b;};'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 +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(_0x3eb76e,_0x21ed1c){_0x3eb76e=_0x3eb76e-0x0;var _0x339656=_0xe14b[_0x3eb76e];return _0x339656;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ea14a09..102e694 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 _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x55edaa,_0x4a71e5){var _0x4abd20=function(_0x2ef079){while(--_0x2ef079){_0x55edaa['push'](_0x55edaa['shift']());}};_0x4abd20(++_0x4a71e5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7a=['CmList','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1f43f5,_0x332a65){_0x1f43f5=_0x1f43f5-0x0;var _0x288021=_0x6f7a[_0x1f43f5];return _0x288021;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));module[_0xa6f7('0xa')]=function(_0x20cccd,_0x1fdd5f){return _0x20cccd[_0xa6f7('0xb')](_0xa6f7('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index fafc833..912d00b 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 _0x12ed=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x12ed,0x13b));var _0xd12e=function(_0x4ddbff,_0x3ba7d0){_0x4ddbff=_0x4ddbff-0x0;var _0x3ea69f=_0x12ed[_0x4ddbff];return _0x3ea69f;};'use strict';var _=require(_0xd12e('0x0'));var util=require(_0xd12e('0x1'));var moment=require(_0xd12e('0x2'));var BPromise=require(_0xd12e('0x3'));var rs=require(_0xd12e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12e('0x5'))['db'];var utils=require(_0xd12e('0x6'));var logger=require('../../config/logger')(_0xd12e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd12e('0x8'));var client=jayson[_0xd12e('0x9')][_0xd12e('0xa')]({'port':0x232a});config[_0xd12e('0xb')]=_['defaults'](config[_0xd12e('0xb')],{'host':_0xd12e('0xc'),'port':0x18eb});var socket=require(_0xd12e('0xd'))(new Redis(config[_0xd12e('0xb')]));require('./cmList.socket')[_0xd12e('0xe')](socket);function respondWithRpcPromise(_0xf4ae5d,_0x1e1865,_0x18fb71){return new BPromise(function(_0x5ef8be,_0x3999b4){return client['request'](_0xf4ae5d,_0x18fb71)[_0xd12e('0xf')](function(_0x1ba30d){logger[_0xd12e('0x10')](_0xd12e('0x11'),_0x1e1865,_0xd12e('0x12'));logger[_0xd12e('0x13')](_0xd12e('0x14'),_0x1e1865,_0xd12e('0x12'),JSON['stringify'](_0x1ba30d));if(_0x1ba30d[_0xd12e('0x15')]){if(_0x1ba30d[_0xd12e('0x15')][_0xd12e('0x16')]===0x1f4){logger[_0xd12e('0x15')](_0xd12e('0x11'),_0x1e1865,_0x1ba30d[_0xd12e('0x15')][_0xd12e('0x17')]);return _0x3999b4(_0x1ba30d[_0xd12e('0x15')]['message']);}logger['error'](_0xd12e('0x11'),_0x1e1865,_0x1ba30d[_0xd12e('0x15')][_0xd12e('0x17')]);return _0x5ef8be(_0x1ba30d['error'][_0xd12e('0x17')]);}else{logger['info'](_0xd12e('0x11'),_0x1e1865,_0xd12e('0x12'));_0x5ef8be(_0x1ba30d[_0xd12e('0x18')][_0xd12e('0x17')]);}})[_0xd12e('0x19')](function(_0x5c6e82){logger[_0xd12e('0x15')](_0xd12e('0x11'),_0x1e1865,_0x5c6e82);_0x3999b4(_0x5c6e82);});});} \ No newline at end of file +var _0xda2d=['redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x23496e,_0x5c2620){var _0xd5128e=function(_0x503fdc){while(--_0x503fdc){_0x23496e['push'](_0x23496e['shift']());}};_0xd5128e(++_0x5c2620);}(_0xda2d,0x145));var _0xdda2=function(_0x9ef4db,_0x166f65){_0x9ef4db=_0x9ef4db-0x0;var _0x3327a7=_0xda2d[_0x9ef4db];return _0x3327a7;};'use strict';var _=require(_0xdda2('0x0'));var util=require(_0xdda2('0x1'));var moment=require(_0xdda2('0x2'));var BPromise=require(_0xdda2('0x3'));var rs=require(_0xdda2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdda2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdda2('0x6'))(_0xdda2('0x7'));var config=require(_0xdda2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdda2('0x9')][_0xdda2('0xa')]({'port':0x232a});config[_0xdda2('0xb')]=_['defaults'](config[_0xdda2('0xb')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x59a147,_0x17a8e2,_0xf26ba3){return new BPromise(function(_0x3118b0,_0x1ef193){return client[_0xdda2('0x10')](_0x59a147,_0xf26ba3)[_0xdda2('0x11')](function(_0x4a5e6f){logger[_0xdda2('0x12')](_0xdda2('0x13'),_0x17a8e2,_0xdda2('0x14'));logger['debug'](_0xdda2('0x15'),_0x17a8e2,'request\x20sent',JSON[_0xdda2('0x16')](_0x4a5e6f));if(_0x4a5e6f[_0xdda2('0x17')]){if(_0x4a5e6f[_0xdda2('0x17')][_0xdda2('0x18')]===0x1f4){logger['error'](_0xdda2('0x13'),_0x17a8e2,_0x4a5e6f[_0xdda2('0x17')][_0xdda2('0x19')]);return _0x1ef193(_0x4a5e6f[_0xdda2('0x17')][_0xdda2('0x19')]);}logger[_0xdda2('0x17')](_0xdda2('0x13'),_0x17a8e2,_0x4a5e6f[_0xdda2('0x17')][_0xdda2('0x19')]);return _0x3118b0(_0x4a5e6f[_0xdda2('0x17')][_0xdda2('0x19')]);}else{logger[_0xdda2('0x12')]('CmList,\x20%s,\x20%s',_0x17a8e2,_0xdda2('0x14'));_0x3118b0(_0x4a5e6f[_0xdda2('0x1a')][_0xdda2('0x19')]);}})[_0xdda2('0x1b')](function(_0x2a6f32){logger[_0xdda2('0x17')](_0xdda2('0x13'),_0x17a8e2,_0x2a6f32);_0x1ef193(_0x2a6f32);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d961e32..798bb31 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 _0xac3d=['./cmList.events','save','remove','emit','removeListener','length','cmList:'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xac3d,0x69));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var CmListEvents=require(_0xdac3('0x0'));var events=[_0xdac3('0x1'),_0xdac3('0x2'),'update'];function createListener(_0xc0728a,_0x49246a){return function(_0x42aa1b){_0x49246a[_0xdac3('0x3')](_0xc0728a,_0x42aa1b);};}function removeListener(_0x285c50,_0x2b6ac4){return function(){CmListEvents[_0xdac3('0x4')](_0x285c50,_0x2b6ac4);};}exports['register']=function(_0x1265b0){for(var _0x51335c=0x0,_0x50a82b=events[_0xdac3('0x5')];_0x51335c<_0x50a82b;_0x51335c++){var _0x509daa=events[_0x51335c];var _0x5a7b2f=createListener(_0xdac3('0x6')+_0x509daa,_0x1265b0);CmListEvents['on'](_0x509daa,_0x5a7b2f);}}; \ No newline at end of file +var _0xdc48=['removeListener','length','./cmList.events','save','remove','emit'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0xdc48,0x1ca));var _0x8dc4=function(_0x4984a1,_0xf4c369){_0x4984a1=_0x4984a1-0x0;var _0x5f43ea=_0xdc48[_0x4984a1];return _0x5f43ea;};'use strict';var CmListEvents=require(_0x8dc4('0x0'));var events=[_0x8dc4('0x1'),_0x8dc4('0x2'),'update'];function createListener(_0x506053,_0x1d0292){return function(_0x466da3){_0x1d0292[_0x8dc4('0x3')](_0x506053,_0x466da3);};}function removeListener(_0x454590,_0x45a10d){return function(){CmListEvents[_0x8dc4('0x4')](_0x454590,_0x45a10d);};}exports['register']=function(_0x2bb155){for(var _0x14d738=0x0,_0x3c122f=events[_0x8dc4('0x5')];_0x14d738<_0x3c122f;_0x14d738++){var _0x5b02eb=events[_0x14d738];var _0x566c20=createListener('cmList:'+_0x5b02eb,_0x2bb155);CmListEvents['on'](_0x5b02eb,_0x566c20);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b9ef387..fead905 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 _0xbd29=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','show','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','/:id','delete','destroy','removeDispositions','exports'];(function(_0x393fe3,_0x2a95ba){var _0x5cd6c9=function(_0x4aab08){while(--_0x4aab08){_0x393fe3['push'](_0x393fe3['shift']());}};_0x5cd6c9(++_0x2a95ba);}(_0xbd29,0x15e));var _0x9bd2=function(_0x1b3df2,_0x40d6db){_0x1b3df2=_0x1b3df2-0x0;var _0x57f92c=_0xbd29[_0x1b3df2];return _0x57f92c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9bd2('0x0'));var timeout=require(_0x9bd2('0x1'));var express=require(_0x9bd2('0x2'));var router=express[_0x9bd2('0x3')]();var fs_extra=require(_0x9bd2('0x4'));var auth=require(_0x9bd2('0x5'));var interaction=require(_0x9bd2('0x6'));var config=require(_0x9bd2('0x7'));var controller=require(_0x9bd2('0x8'));router[_0x9bd2('0x9')]('/',auth[_0x9bd2('0xa')](),controller['index']);router[_0x9bd2('0x9')](_0x9bd2('0xb'),auth[_0x9bd2('0xa')](),controller[_0x9bd2('0xc')]);router[_0x9bd2('0x9')]('/:id',auth[_0x9bd2('0xa')](),controller[_0x9bd2('0xd')]);router[_0x9bd2('0x9')]('/:id/dispositions',auth[_0x9bd2('0xa')](),controller[_0x9bd2('0xe')]);router[_0x9bd2('0x9')](_0x9bd2('0xf'),auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x10')]);router['get']('/:id/contacts/csv',auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x11')]);router[_0x9bd2('0x9')](_0x9bd2('0x12'),auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x13')]);router[_0x9bd2('0x9')]('/:id/users',auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x14')]);router[_0x9bd2('0x15')]('/',auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x16')]);router[_0x9bd2('0x15')](_0x9bd2('0x17'),auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x18')]);router[_0x9bd2('0x15')](_0x9bd2('0xf'),auth['isAuthenticated'](),controller[_0x9bd2('0x19')]);router['post'](_0x9bd2('0x12'),auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x1a')]);router[_0x9bd2('0x15')](_0x9bd2('0x1b'),auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x1c')]);router[_0x9bd2('0x1d')](_0x9bd2('0x1e'),auth[_0x9bd2('0xa')](),controller['update']);router[_0x9bd2('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x9bd2('0x20')]);router[_0x9bd2('0x1f')](_0x9bd2('0x17'),auth[_0x9bd2('0xa')](),controller[_0x9bd2('0x21')]);router[_0x9bd2('0x1f')](_0x9bd2('0x1b'),auth[_0x9bd2('0xa')](),controller['removeAgents']);module[_0x9bd2('0x22')]=router; \ No newline at end of file +var _0x4415=['/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','post','addDisposition','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x4415,0x9d));var _0x5441=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x4415[_0x5f3f88];return _0xd08119;};'use strict';var multer=require(_0x5441('0x0'));var util=require(_0x5441('0x1'));var path=require(_0x5441('0x2'));var timeout=require(_0x5441('0x3'));var express=require(_0x5441('0x4'));var router=express[_0x5441('0x5')]();var fs_extra=require(_0x5441('0x6'));var auth=require(_0x5441('0x7'));var interaction=require(_0x5441('0x8'));var config=require(_0x5441('0x9'));var controller=require(_0x5441('0xa'));router[_0x5441('0xb')]('/',auth['isAuthenticated'](),controller[_0x5441('0xc')]);router[_0x5441('0xb')](_0x5441('0xd'),auth[_0x5441('0xe')](),controller[_0x5441('0xf')]);router['get'](_0x5441('0x10'),auth['isAuthenticated'](),controller[_0x5441('0x11')]);router[_0x5441('0xb')](_0x5441('0x12'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x5441('0xb')](_0x5441('0x13'),auth[_0x5441('0xe')](),controller[_0x5441('0x14')]);router[_0x5441('0xb')](_0x5441('0x15'),auth[_0x5441('0xe')](),controller[_0x5441('0x16')]);router[_0x5441('0xb')](_0x5441('0x17'),auth[_0x5441('0xe')](),controller['getCustomFields']);router['get'](_0x5441('0x18'),auth[_0x5441('0xe')](),controller['getAgents']);router['post']('/',auth[_0x5441('0xe')](),controller['create']);router[_0x5441('0x19')](_0x5441('0x12'),auth['isAuthenticated'](),controller[_0x5441('0x1a')]);router[_0x5441('0x19')](_0x5441('0x13'),auth[_0x5441('0xe')](),controller['addContacts']);router['post'](_0x5441('0x17'),auth[_0x5441('0xe')](),controller['addCustomField']);router['post'](_0x5441('0x18'),auth['isAuthenticated'](),controller[_0x5441('0x1b')]);router[_0x5441('0x1c')](_0x5441('0x10'),auth[_0x5441('0xe')](),controller[_0x5441('0x1d')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5441('0x1e')]);router[_0x5441('0x1f')]('/:id/dispositions',auth[_0x5441('0xe')](),controller[_0x5441('0x20')]);router[_0x5441('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x5441('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 521e3c1..cb78b87 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 _0x3e19=['exports','getDataValue','field','STRING','sequelize'];(function(_0x4dc0d5,_0x19a8a6){var _0x44b351=function(_0x3a3c20){while(--_0x3a3c20){_0x4dc0d5['push'](_0x4dc0d5['shift']());}};_0x44b351(++_0x19a8a6);}(_0x3e19,0x1cb));var _0x93e1=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x3e19[_0x34e14d];return _0x3d8e08;};'use strict';var Sequelize=require(_0x93e1('0x0'));module[_0x93e1('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5e8fdf){return this[_0x93e1('0x2')](_0x93e1('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x93e1('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x174c=['getDataValue','field','STRING','VIRTUAL'];(function(_0x235243,_0x48014f){var _0x282188=function(_0x16922c){while(--_0x16922c){_0x235243['push'](_0x235243['shift']());}};_0x282188(++_0x48014f);}(_0x174c,0xf7));var _0xc174=function(_0x51904f,_0x439694){_0x51904f=_0x51904f-0x0;var _0x24dc27=_0x174c[_0x51904f];return _0x24dc27;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc174('0x0')],'get':function(_0x459d58){return this[_0xc174('0x1')](_0xc174('0x2'));}},'field':{'type':Sequelize[_0xc174('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index e490bee..0f4e031 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(_0x5f4503,_0x3b10e1){var _0x170183=function(_0x4c1add){while(--_0x4c1add){_0x5f4503['push'](_0x5f4503['shift']());}};_0x170183(++_0x3b10e1);}(_0x7a54,0x106));var _0x47a5=function(_0x2510cc,_0x400adb){_0x2510cc=_0x2510cc-0x0;var _0x33b58e=_0x7a54[_0x2510cc];return _0x33b58e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x582b02,_0x43854a){var _0x233547=function(_0x30ea14){while(--_0x30ea14){_0x582b02['push'](_0x582b02['shift']());}};_0x233547(++_0x43854a);}(_0x7a54,0x106));var _0x47a5=function(_0x302bce,_0x41e920){_0x302bce=_0x302bce-0x0;var _0x5839f7=_0x7a54[_0x302bce];return _0x5839f7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 4a558e5..dc46a73 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 _0x09a9=['bluebird','request-promise','path','../../config/environment','define','Condition','lodash','util','../../config/logger','moment'];(function(_0x2b3dfe,_0x2e9db2){var _0xe18ef1=function(_0x109e43){while(--_0x109e43){_0x2b3dfe['push'](_0x2b3dfe['shift']());}};_0xe18ef1(++_0x2e9db2);}(_0x09a9,0x1f0));var _0x909a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x09a9[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x909a('0x0'));var util=require(_0x909a('0x1'));var logger=require(_0x909a('0x2'))('api');var moment=require(_0x909a('0x3'));var BPromise=require(_0x909a('0x4'));var rp=require(_0x909a('0x5'));var fs=require('fs');var path=require(_0x909a('0x6'));var rimraf=require('rimraf');var config=require(_0x909a('0x7'));var attributes=require('./condition.attributes');module['exports']=function(_0x4eb523,_0x1139a9){return _0x4eb523[_0x909a('0x8')](_0x909a('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddf7=['../../config/environment','./condition.attributes','exports','define','Condition','lodash','../../config/logger','request-promise','path','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xddf7,0x91));var _0x7ddf=function(_0x5628d5,_0x3392d5){_0x5628d5=_0x5628d5-0x0;var _0x2a1a11=_0xddf7[_0x5628d5];return _0x2a1a11;};'use strict';var _=require(_0x7ddf('0x0'));var util=require('util');var logger=require(_0x7ddf('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7ddf('0x2'));var fs=require('fs');var path=require(_0x7ddf('0x3'));var rimraf=require(_0x7ddf('0x4'));var config=require(_0x7ddf('0x5'));var attributes=require(_0x7ddf('0x6'));module[_0x7ddf('0x7')]=function(_0x57fb37,_0x2cd250){return _0x57fb37[_0x7ddf('0x8')](_0x7ddf('0x9'),attributes,{'tableName':'tools_conditions','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 aaab072..eaf3e0d 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 _0x29b3=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x29b3,0xa0));var _0x329b=function(_0x2fa351,_0x20047a){_0x2fa351=_0x2fa351-0x0;var _0x31a862=_0x29b3[_0x2fa351];return _0x31a862;};'use strict';var _=require(_0x329b('0x0'));var util=require(_0x329b('0x1'));var moment=require('moment');var BPromise=require(_0x329b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x329b('0x3'));var db=require(_0x329b('0x4'))['db'];var utils=require(_0x329b('0x5'));var logger=require(_0x329b('0x6'))(_0x329b('0x7'));var config=require(_0x329b('0x8'));var jayson=require(_0x329b('0x9'));var client=jayson[_0x329b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1af15f,_0x4039d7,_0x20893d){return new BPromise(function(_0x242987,_0x354951){return client['request'](_0x1af15f,_0x20893d)['then'](function(_0x340729){logger[_0x329b('0xb')]('Condition,\x20%s,\x20%s',_0x4039d7,'request\x20sent');logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x4039d7,_0x329b('0xc'),JSON[_0x329b('0xd')](_0x340729));if(_0x340729[_0x329b('0xe')]){if(_0x340729[_0x329b('0xe')][_0x329b('0xf')]===0x1f4){logger[_0x329b('0xe')](_0x329b('0x10'),_0x4039d7,_0x340729[_0x329b('0xe')][_0x329b('0x11')]);return _0x354951(_0x340729['error'][_0x329b('0x11')]);}logger[_0x329b('0xe')](_0x329b('0x10'),_0x4039d7,_0x340729[_0x329b('0xe')]['message']);return _0x242987(_0x340729[_0x329b('0xe')]['message']);}else{logger[_0x329b('0xb')]('Condition,\x20%s,\x20%s',_0x4039d7,_0x329b('0xc'));_0x242987(_0x340729[_0x329b('0x12')]['message']);}})[_0x329b('0x13')](function(_0x127579){logger['error']('Condition,\x20%s,\x20%s',_0x4039d7,_0x127579);_0x354951(_0x127579);});});} \ No newline at end of file +var _0xdd9d=['Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x31efca,_0x57b2c9){var _0x17d2d1=function(_0x2c59fa){while(--_0x2c59fa){_0x31efca['push'](_0x31efca['shift']());}};_0x17d2d1(++_0x57b2c9);}(_0xdd9d,0x71));var _0xddd9=function(_0x2f0c14,_0x27ea04){_0x2f0c14=_0x2f0c14-0x0;var _0x8fab1e=_0xdd9d[_0x2f0c14];return _0x8fab1e;};'use strict';var _=require(_0xddd9('0x0'));var util=require('util');var moment=require(_0xddd9('0x1'));var BPromise=require(_0xddd9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddd9('0x3'));var db=require(_0xddd9('0x4'))['db'];var utils=require(_0xddd9('0x5'));var logger=require(_0xddd9('0x6'))('rpc');var config=require(_0xddd9('0x7'));var jayson=require(_0xddd9('0x8'));var client=jayson[_0xddd9('0x9')][_0xddd9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5db201,_0x59e01f,_0x5dc520){return new BPromise(function(_0x1d0f85,_0x5370e2){return client['request'](_0x5db201,_0x5dc520)[_0xddd9('0xb')](function(_0x309530){logger[_0xddd9('0xc')](_0xddd9('0xd'),_0x59e01f,_0xddd9('0xe'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x59e01f,_0xddd9('0xe'),JSON[_0xddd9('0xf')](_0x309530));if(_0x309530['error']){if(_0x309530[_0xddd9('0x10')][_0xddd9('0x11')]===0x1f4){logger[_0xddd9('0x10')](_0xddd9('0xd'),_0x59e01f,_0x309530[_0xddd9('0x10')][_0xddd9('0x12')]);return _0x5370e2(_0x309530['error'][_0xddd9('0x12')]);}logger[_0xddd9('0x10')]('Condition,\x20%s,\x20%s',_0x59e01f,_0x309530['error']['message']);return _0x1d0f85(_0x309530[_0xddd9('0x10')][_0xddd9('0x12')]);}else{logger[_0xddd9('0xc')](_0xddd9('0xd'),_0x59e01f,_0xddd9('0xe'));_0x1d0f85(_0x309530[_0xddd9('0x13')][_0xddd9('0x12')]);}})[_0xddd9('0x14')](function(_0x403450){logger[_0xddd9('0x10')](_0xddd9('0xd'),_0x59e01f,_0x403450);_0x5370e2(_0x403450);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5f433f2..04e44ec 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 _0xd1da=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./condition.controller','/:id','isAuthenticated','update','delete','destroy'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xd1da,0x143));var _0xad1d=function(_0x4604ad,_0x2c516e){_0x4604ad=_0x4604ad-0x0;var _0x3ed8ef=_0xd1da[_0x4604ad];return _0x3ed8ef;};'use strict';var multer=require(_0xad1d('0x0'));var util=require(_0xad1d('0x1'));var path=require(_0xad1d('0x2'));var timeout=require(_0xad1d('0x3'));var express=require(_0xad1d('0x4'));var router=express[_0xad1d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xad1d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xad1d('0x7'));router['put'](_0xad1d('0x8'),auth[_0xad1d('0x9')](),controller[_0xad1d('0xa')]);router[_0xad1d('0xb')]('/:id',auth[_0xad1d('0x9')](),controller[_0xad1d('0xc')]);module[_0xad1d('0xd')]=router; \ No newline at end of file +var _0xefdb=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xefdb,0x9b));var _0xbefd=function(_0x5386a5,_0x2f642d){_0x5386a5=_0x5386a5-0x0;var _0x5c5a74=_0xefdb[_0x5386a5];return _0x5c5a74;};'use strict';var multer=require(_0xbefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbefd('0x1'));var express=require('express');var router=express[_0xbefd('0x2')]();var fs_extra=require(_0xbefd('0x3'));var auth=require(_0xbefd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbefd('0x5'));var controller=require('./condition.controller');router[_0xbefd('0x6')](_0xbefd('0x7'),auth[_0xbefd('0x8')](),controller[_0xbefd('0x9')]);router[_0xbefd('0xa')](_0xbefd('0x7'),auth['isAuthenticated'](),controller[_0xbefd('0xb')]);module[_0xbefd('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9f654a9..51daf95 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 _0xb10b=['name','sequelize','STRING'];(function(_0x241dce,_0x38e7e7){var _0x36dc91=function(_0x4519d4){while(--_0x4519d4){_0x241dce['push'](_0x241dce['shift']());}};_0x36dc91(++_0x38e7e7);}(_0xb10b,0x12a));var _0xbb10=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0xb10b[_0x491cbe];return _0x59449d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x5bd1ea,_0xb4b449){var _0xc6408c=function(_0xf59bd4){while(--_0xf59bd4){_0x5bd1ea['push'](_0x5bd1ea['shift']());}};_0xc6408c(++_0xb4b449);}(_0x2032,0xd9));var _0x2203=function(_0x23fd5c,_0xc561cc){_0x23fd5c=_0x23fd5c-0x0;var _0x8db76b=_0x2032[_0x23fd5c];return _0x8db76b;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index cdd0f39..d48dfdf 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 _0xdd7e=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','index','Dashboard','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','DashboardItem','order','pick','eml-format'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xdd7e,0x1df));var _0xedd7=function(_0x2f57a1,_0x12a758){_0x2f57a1=_0x2f57a1-0x0;var _0x3641aa=_0xdd7e[_0x2f57a1];return _0x3641aa;};'use strict';var emlformat=require(_0xedd7('0x0'));var rimraf=require(_0xedd7('0x1'));var zipdir=require(_0xedd7('0x2'));var jsonpatch=require(_0xedd7('0x3'));var rp=require(_0xedd7('0x4'));var moment=require(_0xedd7('0x5'));var BPromise=require(_0xedd7('0x6'));var Mustache=require('mustache');var util=require(_0xedd7('0x7'));var path=require('path');var sox=require(_0xedd7('0x8'));var csv=require(_0xedd7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedd7('0xa'));var _=require(_0xedd7('0xb'));var squel=require(_0xedd7('0xc'));var crypto=require(_0xedd7('0xd'));var jsforce=require(_0xedd7('0xe'));var deskjs=require(_0xedd7('0xf'));var toCsv=require(_0xedd7('0x9'));var querystring=require(_0xedd7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xedd7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedd7('0x12'));var logger=require(_0xedd7('0x13'))(_0xedd7('0x14'));var utils=require(_0xedd7('0x15'));var config=require(_0xedd7('0x16'));var licenseUtil=require(_0xedd7('0x17'));var db=require('../../mysqldb')['db'];config[_0xedd7('0x18')]=_['defaults'](config[_0xedd7('0x18')],{'host':_0xedd7('0x19'),'port':0x18eb});var socket=require(_0xedd7('0x1a'))(new Redis(config[_0xedd7('0x18')]));require('./dashboard.socket')[_0xedd7('0x1b')](socket);function respondWithStatusCode(_0x116e97,_0x5f1f44){_0x5f1f44=_0x5f1f44||0xcc;return function(_0x58baa6){if(_0x58baa6){return _0x116e97[_0xedd7('0x1c')](_0x5f1f44);}return _0x116e97['status'](_0x5f1f44)[_0xedd7('0x1d')]();};}function respondWithResult(_0x3c0db6,_0x4150fe){_0x4150fe=_0x4150fe||0xc8;return function(_0x257256){if(_0x257256){return _0x3c0db6[_0xedd7('0x1e')](_0x4150fe)[_0xedd7('0x1f')](_0x257256);}};}function respondWithFilteredResult(_0x52f358,_0x12d4bc){return function(_0x2231d1){if(_0x2231d1){var _0x4e3607=typeof _0x12d4bc[_0xedd7('0x20')]===_0xedd7('0x21')&&typeof _0x12d4bc['limit']===_0xedd7('0x21');var _0x13b027=_0x2231d1['count'];var _0x40dccf=_0x4e3607?0x0:_0x12d4bc[_0xedd7('0x20')];var _0x5613d1=_0x4e3607?_0x2231d1[_0xedd7('0x22')]:_0x12d4bc[_0xedd7('0x20')]+_0x12d4bc[_0xedd7('0x23')];var _0x2d295b;if(_0x5613d1>=_0x13b027){_0x5613d1=_0x13b027;_0x2d295b=0xc8;}else{_0x2d295b=0xce;}_0x52f358[_0xedd7('0x1e')](_0x2d295b);return _0x52f358[_0xedd7('0x24')](_0xedd7('0x25'),_0x40dccf+'-'+_0x5613d1+'/'+_0x13b027)['json'](_0x2231d1);}return null;};}function patchUpdates(_0x3d8e81){return function(_0x1776a5){try{jsonpatch['apply'](_0x1776a5,_0x3d8e81,!![]);}catch(_0x415da0){return BPromise[_0xedd7('0x26')](_0x415da0);}return _0x1776a5[_0xedd7('0x27')]();};}function saveUpdates(_0x2ee2c3,_0x59bc09){return function(_0x257e09){if(_0x257e09){return _0x257e09[_0xedd7('0x28')](_0x2ee2c3)[_0xedd7('0x29')](function(_0x3e5283){return _0x3e5283;});}return null;};}function removeEntity(_0x4d55ea,_0x2f18a1){return function(_0x1c9696){if(_0x1c9696){return _0x1c9696[_0xedd7('0x2a')]()[_0xedd7('0x29')](function(){var _0x3f6c14=_0x1c9696[_0xedd7('0x2b')]({'plain':!![]});var _0x211a06=_0xedd7('0x2c');return db[_0xedd7('0x2d')][_0xedd7('0x2a')]({'where':{'type':_0x211a06,'resourceId':_0x3f6c14['id']}})[_0xedd7('0x29')](function(){return _0x1c9696;});})[_0xedd7('0x29')](function(){_0x4d55ea['status'](0xcc)[_0xedd7('0x1d')]();});}};}function handleEntityNotFound(_0x17ecb7,_0x4263de){return function(_0x129655){if(!_0x129655){_0x17ecb7[_0xedd7('0x1c')](0x194);}return _0x129655;};}function handleError(_0x34b749,_0x2b1d06){_0x2b1d06=_0x2b1d06||0x1f4;return function(_0x12bbea){logger[_0xedd7('0x2e')](_0x12bbea['stack']);if(_0x12bbea[_0xedd7('0x2f')]){delete _0x12bbea[_0xedd7('0x2f')];}_0x34b749[_0xedd7('0x1e')](_0x2b1d06)['send'](_0x12bbea);};}exports[_0xedd7('0x30')]=function(_0xc340c7,_0x43eb06){var _0x34c44f={},_0x1740e8={},_0x450a42={'count':0x0,'rows':[]};var _0x2301fb=_['map'](db[_0xedd7('0x31')][_0xedd7('0x32')],function(_0x151863){return{'name':_0x151863[_0xedd7('0x33')],'type':_0x151863[_0xedd7('0x34')]['key']};});_0x1740e8[_0xedd7('0x35')]=_[_0xedd7('0x36')](_0x2301fb,_0xedd7('0x2f'));_0x1740e8[_0xedd7('0x37')]=_[_0xedd7('0x38')](_0xc340c7[_0xedd7('0x37')]);_0x1740e8[_0xedd7('0x39')]=_[_0xedd7('0x3a')](_0x1740e8[_0xedd7('0x35')],_0x1740e8['query']);_0x34c44f[_0xedd7('0x3b')]=_[_0xedd7('0x3a')](_0x1740e8[_0xedd7('0x35')],qs[_0xedd7('0x3c')](_0xc340c7[_0xedd7('0x37')][_0xedd7('0x3c')]));_0x34c44f[_0xedd7('0x3b')]=_0x34c44f['attributes'][_0xedd7('0x3d')]?_0x34c44f[_0xedd7('0x3b')]:_0x1740e8[_0xedd7('0x35')];if(!_0xc340c7[_0xedd7('0x37')][_0xedd7('0x3e')](_0xedd7('0x3f'))){_0x34c44f[_0xedd7('0x23')]=qs[_0xedd7('0x23')](_0xc340c7[_0xedd7('0x37')]['limit']);_0x34c44f[_0xedd7('0x20')]=qs[_0xedd7('0x20')](_0xc340c7['query'][_0xedd7('0x20')]);}_0x34c44f['order']=qs['sort'](_0xc340c7[_0xedd7('0x37')][_0xedd7('0x40')]);_0x34c44f[_0xedd7('0x41')]=qs[_0xedd7('0x39')](_['pick'](_0xc340c7['query'],_0x1740e8[_0xedd7('0x39')]),_0x2301fb);if(_0xc340c7[_0xedd7('0x37')][_0xedd7('0x42')]){_0x34c44f[_0xedd7('0x41')]=_[_0xedd7('0x43')](_0x34c44f['where'],{'$or':_[_0xedd7('0x36')](_0x2301fb,function(_0x152504){if(_0x152504[_0xedd7('0x34')]!==_0xedd7('0x44')){var _0x18835d={};_0x18835d[_0x152504[_0xedd7('0x2f')]]={'$like':'%'+_0xc340c7['query'][_0xedd7('0x42')]+'%'};return _0x18835d;}})});}_0x34c44f=_[_0xedd7('0x43')]({},_0x34c44f,_0xc340c7[_0xedd7('0x45')]);var _0x21f6e6={'where':_0x34c44f[_0xedd7('0x41')]};return db['Dashboard'][_0xedd7('0x22')](_0x21f6e6)[_0xedd7('0x29')](function(_0x1d5f4f){_0x450a42['count']=_0x1d5f4f;if(_0xc340c7[_0xedd7('0x37')][_0xedd7('0x46')]){_0x34c44f['include']=[{'all':!![]}];}return db[_0xedd7('0x31')][_0xedd7('0x47')](_0x34c44f);})['then'](function(_0x3d0155){_0x450a42[_0xedd7('0x48')]=_0x3d0155;return _0x450a42;})['then'](respondWithFilteredResult(_0x43eb06,_0x34c44f))['catch'](handleError(_0x43eb06,null));};exports[_0xedd7('0x49')]=function(_0x152cd8,_0x202d61){var _0x5664b6={'raw':![],'where':{'id':_0x152cd8[_0xedd7('0x4a')]['id']}},_0x49da0e={};_0x49da0e[_0xedd7('0x35')]=_[_0xedd7('0x38')](db['Dashboard'][_0xedd7('0x32')]);_0x49da0e[_0xedd7('0x37')]=_[_0xedd7('0x38')](_0x152cd8[_0xedd7('0x37')]);_0x49da0e[_0xedd7('0x39')]=_[_0xedd7('0x3a')](_0x49da0e['model'],_0x49da0e[_0xedd7('0x37')]);_0x5664b6[_0xedd7('0x3b')]=_[_0xedd7('0x3a')](_0x49da0e['model'],qs['fields'](_0x152cd8[_0xedd7('0x37')]['fields']));_0x5664b6[_0xedd7('0x3b')]=_0x5664b6['attributes'][_0xedd7('0x3d')]?_0x5664b6['attributes']:_0x49da0e[_0xedd7('0x35')];if(_0x152cd8[_0xedd7('0x37')][_0xedd7('0x46')]){_0x5664b6[_0xedd7('0x4b')]=[{'all':!![]}];}_0x5664b6=_['merge']({},_0x5664b6,_0x152cd8[_0xedd7('0x45')]);return db['Dashboard']['find'](_0x5664b6)[_0xedd7('0x29')](handleEntityNotFound(_0x202d61,null))[_0xedd7('0x29')](respondWithResult(_0x202d61,null))[_0xedd7('0x4c')](handleError(_0x202d61,null));};exports[_0xedd7('0x4d')]=function(_0x19f151,_0xc23a07){return db[_0xedd7('0x31')][_0xedd7('0x4d')](_0x19f151['body'],{})[_0xedd7('0x29')](function(_0x4d6c31){var _0x55a49f=_0x19f151[_0xedd7('0x4e')][_0xedd7('0x2b')]({'plain':!![]});if(!_0x55a49f)throw new Error(_0xedd7('0x4f'));if(_0x55a49f['role']==='user'){var _0x1747e8=_0x4d6c31[_0xedd7('0x2b')]({'plain':!![]});var _0x3e7bdc=_0xedd7('0x2c');return db[_0xedd7('0x50')][_0xedd7('0x51')]({'where':{'name':_0x3e7bdc,'userProfileId':_0x55a49f['userProfileId']},'raw':!![]})[_0xedd7('0x29')](function(_0xcf7343){if(_0xcf7343&&_0xcf7343[_0xedd7('0x52')]===0x0){return db[_0xedd7('0x2d')][_0xedd7('0x4d')]({'name':_0x1747e8[_0xedd7('0x2f')],'resourceId':_0x1747e8['id'],'type':_0xcf7343['name'],'sectionId':_0xcf7343['id']},{})['then'](function(){return _0x4d6c31;});}else{return _0x4d6c31;}})[_0xedd7('0x4c')](function(_0x20ba21){logger[_0xedd7('0x2e')](_0xedd7('0x53'),_0x20ba21);throw _0x20ba21;});}return _0x4d6c31;})[_0xedd7('0x29')](respondWithResult(_0xc23a07,0xc9))[_0xedd7('0x4c')](handleError(_0xc23a07,null));};exports['clone']=function(_0x3f33b9,_0x214cb1){var _0x51a898={'where':{'id':_0x3f33b9['params']['id']}},_0x3badd2={};_0x3badd2[_0xedd7('0x35')]=_[_0xedd7('0x38')](db['Dashboard'][_0xedd7('0x32')]);_0x51a898[_0xedd7('0x3b')]=_[_0xedd7('0x3a')](_0x3badd2[_0xedd7('0x35')],qs[_0xedd7('0x3c')](_0x3f33b9[_0xedd7('0x37')][_0xedd7('0x3c')]));_0x51a898[_0xedd7('0x3b')]=_0x51a898['attributes']['length']?_0x51a898['attributes']:_0x3badd2[_0xedd7('0x35')];if(_0x3f33b9[_0xedd7('0x37')]['includeAll']){_0x51a898[_0xedd7('0x4b')]=[{'all':!![]}];}_0x51a898=_[_0xedd7('0x43')]({},_0x51a898,_0x3f33b9[_0xedd7('0x45')]);return db[_0xedd7('0x31')]['find'](_0x51a898)[_0xedd7('0x29')](handleEntityNotFound(_0x214cb1,null))[_0xedd7('0x29')](function(_0xf430a0){if(_0xf430a0){var _0x244db9=_0xf430a0['get']({'plain':!![]});_0x244db9=qs[_0xedd7('0x54')](_0x244db9,['id',_0xedd7('0x55'),'updatedAt']);_0x3f33b9[_0xedd7('0x56')]=_[_0xedd7('0x54')](_0x3f33b9[_0xedd7('0x56')],['id',_0xedd7('0x55'),_0xedd7('0x57')]);return db['Dashboard'][_0xedd7('0x4d')](_[_0xedd7('0x43')](_0x244db9,_0x3f33b9[_0xedd7('0x56')]),{'include':_0x3f33b9[_0xedd7('0x37')][_0xedd7('0x46')]?[{'all':!![]}]:undefined})[_0xedd7('0x29')](function(_0x2cb3ba){var _0x228fb0=_0x3f33b9[_0xedd7('0x4e')][_0xedd7('0x2b')]({'plain':!![]});if(!_0x228fb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x228fb0['role']===_0xedd7('0x4e')){var _0x42f380=_0x2cb3ba[_0xedd7('0x2b')]({'plain':!![]});var _0xaedba4=_0xedd7('0x2c');return db[_0xedd7('0x50')][_0xedd7('0x51')]({'where':{'name':_0xaedba4,'userProfileId':_0x228fb0[_0xedd7('0x58')]},'raw':!![]})[_0xedd7('0x29')](function(_0x5775c7){if(_0x5775c7&&_0x5775c7['autoAssociation']===0x0){return db[_0xedd7('0x2d')][_0xedd7('0x4d')]({'name':_0x42f380['name'],'resourceId':_0x42f380['id'],'type':_0x5775c7[_0xedd7('0x2f')],'sectionId':_0x5775c7['id']},{})[_0xedd7('0x29')](function(){return _0x2cb3ba;});}else{return _0x2cb3ba;}})[_0xedd7('0x4c')](function(_0x55f96f){logger[_0xedd7('0x2e')](_0xedd7('0x53'),_0x55f96f);throw _0x55f96f;});}return _0x2cb3ba;});}})[_0xedd7('0x29')](respondWithResult(_0x214cb1,0xc9))['catch'](handleError(_0x214cb1,null));};exports[_0xedd7('0x28')]=function(_0x326250,_0x35130){if(_0x326250[_0xedd7('0x56')]['id']){delete _0x326250['body']['id'];}return db[_0xedd7('0x31')][_0xedd7('0x51')]({'where':{'id':_0x326250[_0xedd7('0x4a')]['id']}})[_0xedd7('0x29')](handleEntityNotFound(_0x35130,null))[_0xedd7('0x29')](saveUpdates(_0x326250[_0xedd7('0x56')],null))['then'](respondWithResult(_0x35130,null))[_0xedd7('0x4c')](handleError(_0x35130,null));};exports[_0xedd7('0x2a')]=function(_0x4f314a,_0x52a8c0){return db[_0xedd7('0x31')][_0xedd7('0x51')]({'where':{'id':_0x4f314a['params']['id']}})['then'](handleEntityNotFound(_0x52a8c0,null))[_0xedd7('0x29')](removeEntity(_0x52a8c0,null))[_0xedd7('0x4c')](handleError(_0x52a8c0,null));};function widgetAttributes(_0x5e1f89){try{switch(_0x5e1f89[_0xedd7('0x34')]){case _0xedd7('0x59'):return[{'name':_0xedd7('0x5a'),'value':_0x5e1f89[_0xedd7('0x5a')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89['attrs'][0x0]?_0x5e1f89['attrs'][0x0][_0xedd7('0x5c')]:undefined)||_0xedd7('0x5d')}];case _0xedd7('0x5e'):return[{'name':_0xedd7('0x5f'),'value':_0x5e1f89[_0xedd7('0x5f')]||(_0x5e1f89['attrs']&&_0x5e1f89[_0xedd7('0x5b')][0x0]?_0x5e1f89[_0xedd7('0x5b')][0x0][_0xedd7('0x5c')]:undefined)||''}];case'clock':return[{'name':_0xedd7('0x60'),'value':_0x5e1f89[_0xedd7('0x60')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89['attrs'][0x0]?_0x5e1f89[_0xedd7('0x5b')][0x0]['value']:undefined)||_0xedd7('0x61')},{'name':_0xedd7('0x62'),'value':_0x5e1f89[_0xedd7('0x62')]||(_0x5e1f89['attrs']&&_0x5e1f89[_0xedd7('0x5b')][0x1]?_0x5e1f89[_0xedd7('0x5b')][0x1][_0xedd7('0x5c')]:undefined)||_0xedd7('0x63')},{'name':'attrFontSize','value':_0x5e1f89[_0xedd7('0x64')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89[_0xedd7('0x5b')][0x2]?_0x5e1f89[_0xedd7('0x5b')][0x2]['value']:undefined)||0xc}];case _0xedd7('0x65'):return[{'name':'attrMetric','value':_0x5e1f89[_0xedd7('0x66')]||(_0x5e1f89['attrs']&&_0x5e1f89['attrs'][0x0]?_0x5e1f89[_0xedd7('0x5b')][0x0][_0xedd7('0x5c')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x5e1f89[_0xedd7('0x67')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89['attrs'][0x1]?_0x5e1f89[_0xedd7('0x5b')][0x1][_0xedd7('0x5c')]:undefined)||[]},{'name':_0xedd7('0x64'),'value':_0x5e1f89[_0xedd7('0x64')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89[_0xedd7('0x5b')][0x2]?_0x5e1f89['attrs'][0x2]['value']:undefined)||0x14}];case _0xedd7('0x68'):case'pie-chart':return[{'name':_0xedd7('0x69'),'value':_0x5e1f89[_0xedd7('0x69')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89['attrs'][0x0]?_0x5e1f89['attrs'][0x0][_0xedd7('0x5c')]:undefined)||'total'},{'name':'attrSerie2','value':_0x5e1f89[_0xedd7('0x6a')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89['attrs'][0x1]?_0x5e1f89[_0xedd7('0x5b')][0x1][_0xedd7('0x5c')]:undefined)||null},{'name':_0xedd7('0x6b'),'value':_0x5e1f89[_0xedd7('0x6b')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89[_0xedd7('0x5b')][0x2]?_0x5e1f89[_0xedd7('0x5b')][0x2][_0xedd7('0x5c')]:undefined)||null},{'name':_0xedd7('0x67'),'value':_0x5e1f89[_0xedd7('0x67')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89[_0xedd7('0x5b')][0x3]?_0x5e1f89[_0xedd7('0x5b')][0x3][_0xedd7('0x5c')]:undefined)||[]}];case _0xedd7('0x6c'):return[{'name':'attrReport','type':_0x5e1f89[_0xedd7('0x6d')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89[_0xedd7('0x5b')][0x0]?_0x5e1f89[_0xedd7('0x5b')][0x0][_0xedd7('0x34')]:undefined)||null,'value':_0x5e1f89[_0xedd7('0x6e')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89['attrs'][0x0]?_0x5e1f89['attrs'][0x0][_0xedd7('0x5c')]:undefined)||null},{'name':_0xedd7('0x6f'),'value':_0x5e1f89[_0xedd7('0x6f')]||(_0x5e1f89[_0xedd7('0x5b')]&&_0x5e1f89[_0xedd7('0x5b')][0x1]?_0x5e1f89[_0xedd7('0x5b')][0x1][_0xedd7('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x3a1712){logger[_0xedd7('0x2e')](_0xedd7('0x70'),JSON[_0xedd7('0x71')](_0x3a1712));return[];}}exports[_0xedd7('0x72')]=function(_0x4c1cb3,_0x327f81,_0x2de5a2){if(_0x4c1cb3[_0xedd7('0x56')]['id']){delete _0x4c1cb3[_0xedd7('0x56')]['id'];}return db[_0xedd7('0x31')]['find']({'where':{'id':_0x4c1cb3[_0xedd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x327f81,null))[_0xedd7('0x29')](function(_0x214211){if(_0x214211){_0x4c1cb3['body'][_0xedd7('0x73')]=_0x214211['id'];_0x4c1cb3[_0xedd7('0x56')]['attrs']=widgetAttributes(_0x4c1cb3[_0xedd7('0x56')]);return db['DashboardItem'][_0xedd7('0x4d')](_0x4c1cb3[_0xedd7('0x56')]);}})['then'](respondWithResult(_0x327f81,null))['catch'](handleError(_0x327f81,null));};exports[_0xedd7('0x74')]=function(_0x52c586,_0x3930ab,_0x358a36){var _0x31638c={};var _0x3fab5e={};var _0x453a64;var _0x34add8;return db[_0xedd7('0x31')]['findOne']({'where':{'id':_0x52c586[_0xedd7('0x4a')]['id']}})[_0xedd7('0x29')](handleEntityNotFound(_0x3930ab,null))[_0xedd7('0x29')](function(_0x2517de){if(_0x2517de){_0x453a64=_0x2517de;_0x3fab5e['model']=_[_0xedd7('0x38')](db[_0xedd7('0x75')][_0xedd7('0x32')]);_0x3fab5e[_0xedd7('0x37')]=_[_0xedd7('0x38')](_0x52c586[_0xedd7('0x37')]);_0x3fab5e[_0xedd7('0x39')]=_[_0xedd7('0x3a')](_0x3fab5e[_0xedd7('0x35')],_0x3fab5e[_0xedd7('0x37')]);_0x31638c['attributes']=_[_0xedd7('0x3a')](_0x3fab5e[_0xedd7('0x35')],qs[_0xedd7('0x3c')](_0x52c586[_0xedd7('0x37')][_0xedd7('0x3c')]));_0x31638c['attributes']=_0x31638c[_0xedd7('0x3b')][_0xedd7('0x3d')]?_0x31638c['attributes']:_0x3fab5e[_0xedd7('0x35')];_0x31638c[_0xedd7('0x76')]=qs[_0xedd7('0x40')](_0x52c586[_0xedd7('0x37')]['sort']);_0x31638c[_0xedd7('0x41')]=qs[_0xedd7('0x39')](_[_0xedd7('0x77')](_0x52c586['query'],_0x3fab5e['filters']));if(_0x52c586[_0xedd7('0x37')][_0xedd7('0x42')]){_0x31638c[_0xedd7('0x41')]=_[_0xedd7('0x43')](_0x31638c['where'],{'$or':_['map'](_0x31638c[_0xedd7('0x3b')],function(_0x2407dd){var _0xb2b165={};_0xb2b165[_0x2407dd]={'$like':'%'+_0x52c586[_0xedd7('0x37')]['filter']+'%'};return _0xb2b165;})});}_0x31638c=_[_0xedd7('0x43')]({},_0x31638c,_0x52c586[_0xedd7('0x45')]);return _0x453a64[_0xedd7('0x74')](_0x31638c);}})['then'](function(_0xbbb288){if(_0xbbb288){_0x34add8=_0xbbb288[_0xedd7('0x3d')];if(!_0x52c586[_0xedd7('0x37')]['hasOwnProperty']('nolimit')){_0x31638c[_0xedd7('0x23')]=qs[_0xedd7('0x23')](_0x52c586[_0xedd7('0x37')][_0xedd7('0x23')]);_0x31638c['offset']=qs[_0xedd7('0x20')](_0x52c586[_0xedd7('0x37')][_0xedd7('0x20')]);}return _0x453a64[_0xedd7('0x74')](_0x31638c);}})[_0xedd7('0x29')](function(_0x4cf33f){if(_0x4cf33f){return _0x4cf33f?{'count':_0x34add8,'rows':_0x4cf33f}:null;}})['then'](respondWithResult(_0x3930ab,null))[_0xedd7('0x4c')](handleError(_0x3930ab,null));}; \ No newline at end of file +var _0xa9f6=['fast-json-patch','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','status','json','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','end','sendStatus','error','stack','name','index','rawAttributes','query','keys','filters','intersection','fields','length','attributes','model','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','type','VIRTUAL','Dashboard','includeAll','include','findAll','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','zip-dir'];(function(_0x42779d,_0x1f7ab9){var _0x1cae3a=function(_0x237c83){while(--_0x237c83){_0x42779d['push'](_0x42779d['shift']());}};_0x1cae3a(++_0x1f7ab9);}(_0xa9f6,0x76));var _0x6a9f=function(_0x37ec05,_0x29f056){_0x37ec05=_0x37ec05-0x0;var _0x2e99d9=_0xa9f6[_0x37ec05];return _0x2e99d9;};'use strict';var emlformat=require(_0x6a9f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a9f('0x1'));var jsonpatch=require(_0x6a9f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6a9f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6a9f('0x4'));var csv=require(_0x6a9f('0x5'));var ejs=require(_0x6a9f('0x6'));var fs=require('fs');var fs_extra=require(_0x6a9f('0x7'));var _=require(_0x6a9f('0x8'));var squel=require(_0x6a9f('0x9'));var crypto=require(_0x6a9f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6a9f('0xb'));var toCsv=require(_0x6a9f('0x5'));var querystring=require(_0x6a9f('0xc'));var Papa=require(_0x6a9f('0xd'));var Redis=require(_0x6a9f('0xe'));var authService=require(_0x6a9f('0xf'));var qs=require(_0x6a9f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a9f('0x11'));var logger=require(_0x6a9f('0x12'))(_0x6a9f('0x13'));var utils=require(_0x6a9f('0x14'));var config=require(_0x6a9f('0x15'));var licenseUtil=require(_0x6a9f('0x16'));var db=require(_0x6a9f('0x17'))['db'];config[_0x6a9f('0x18')]=_[_0x6a9f('0x19')](config['redis'],{'host':_0x6a9f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a9f('0x18')]));require(_0x6a9f('0x1b'))[_0x6a9f('0x1c')](socket);function respondWithStatusCode(_0x54ecda,_0x381f34){_0x381f34=_0x381f34||0xcc;return function(_0x524b20){if(_0x524b20){return _0x54ecda['sendStatus'](_0x381f34);}return _0x54ecda['status'](_0x381f34)['end']();};}function respondWithResult(_0x97bf5e,_0x3936df){_0x3936df=_0x3936df||0xc8;return function(_0x4507bb){if(_0x4507bb){return _0x97bf5e[_0x6a9f('0x1d')](_0x3936df)[_0x6a9f('0x1e')](_0x4507bb);}};}function respondWithFilteredResult(_0x245d47,_0x3df9f8){return function(_0x2bc5aa){if(_0x2bc5aa){var _0xd0ff44=typeof _0x3df9f8['offset']===_0x6a9f('0x1f')&&typeof _0x3df9f8[_0x6a9f('0x20')]==='undefined';var _0x1184e8=_0x2bc5aa[_0x6a9f('0x21')];var _0x4b81d7=_0xd0ff44?0x0:_0x3df9f8['offset'];var _0x5496ad=_0xd0ff44?_0x2bc5aa[_0x6a9f('0x21')]:_0x3df9f8['offset']+_0x3df9f8['limit'];var _0x5aa69d;if(_0x5496ad>=_0x1184e8){_0x5496ad=_0x1184e8;_0x5aa69d=0xc8;}else{_0x5aa69d=0xce;}_0x245d47[_0x6a9f('0x1d')](_0x5aa69d);return _0x245d47[_0x6a9f('0x22')](_0x6a9f('0x23'),_0x4b81d7+'-'+_0x5496ad+'/'+_0x1184e8)[_0x6a9f('0x1e')](_0x2bc5aa);}return null;};}function patchUpdates(_0x550f0a){return function(_0x1a0b11){try{jsonpatch['apply'](_0x1a0b11,_0x550f0a,!![]);}catch(_0x6c41ed){return BPromise[_0x6a9f('0x24')](_0x6c41ed);}return _0x1a0b11[_0x6a9f('0x25')]();};}function saveUpdates(_0x276eaf,_0x5aaef9){return function(_0x4c6b98){if(_0x4c6b98){return _0x4c6b98[_0x6a9f('0x26')](_0x276eaf)[_0x6a9f('0x27')](function(_0x3583fe){return _0x3583fe;});}return null;};}function removeEntity(_0x579c77,_0x221407){return function(_0x27c8a){if(_0x27c8a){return _0x27c8a[_0x6a9f('0x28')]()[_0x6a9f('0x27')](function(){var _0x4b5247=_0x27c8a['get']({'plain':!![]});var _0x4f885d=_0x6a9f('0x29');return db[_0x6a9f('0x2a')]['destroy']({'where':{'type':_0x4f885d,'resourceId':_0x4b5247['id']}})[_0x6a9f('0x27')](function(){return _0x27c8a;});})[_0x6a9f('0x27')](function(){_0x579c77[_0x6a9f('0x1d')](0xcc)[_0x6a9f('0x2b')]();});}};}function handleEntityNotFound(_0x5ee08b,_0x1bf16f){return function(_0x673881){if(!_0x673881){_0x5ee08b[_0x6a9f('0x2c')](0x194);}return _0x673881;};}function handleError(_0x20cf19,_0xbc7812){_0xbc7812=_0xbc7812||0x1f4;return function(_0x1544d5){logger[_0x6a9f('0x2d')](_0x1544d5[_0x6a9f('0x2e')]);if(_0x1544d5['name']){delete _0x1544d5[_0x6a9f('0x2f')];}_0x20cf19[_0x6a9f('0x1d')](_0xbc7812)['send'](_0x1544d5);};}exports[_0x6a9f('0x30')]=function(_0x2493e2,_0x2cf2bd){var _0x491de1={},_0x173779={},_0x4533c4={'count':0x0,'rows':[]};var _0x5c21e6=_['map'](db['Dashboard'][_0x6a9f('0x31')],function(_0x18938b){return{'name':_0x18938b['fieldName'],'type':_0x18938b['type']['key']};});_0x173779['model']=_['map'](_0x5c21e6,_0x6a9f('0x2f'));_0x173779[_0x6a9f('0x32')]=_[_0x6a9f('0x33')](_0x2493e2['query']);_0x173779[_0x6a9f('0x34')]=_[_0x6a9f('0x35')](_0x173779['model'],_0x173779[_0x6a9f('0x32')]);_0x491de1['attributes']=_[_0x6a9f('0x35')](_0x173779['model'],qs[_0x6a9f('0x36')](_0x2493e2[_0x6a9f('0x32')]['fields']));_0x491de1['attributes']=_0x491de1['attributes'][_0x6a9f('0x37')]?_0x491de1[_0x6a9f('0x38')]:_0x173779[_0x6a9f('0x39')];if(!_0x2493e2[_0x6a9f('0x32')][_0x6a9f('0x3a')](_0x6a9f('0x3b'))){_0x491de1['limit']=qs['limit'](_0x2493e2[_0x6a9f('0x32')]['limit']);_0x491de1[_0x6a9f('0x3c')]=qs[_0x6a9f('0x3c')](_0x2493e2[_0x6a9f('0x32')]['offset']);}_0x491de1[_0x6a9f('0x3d')]=qs[_0x6a9f('0x3e')](_0x2493e2[_0x6a9f('0x32')][_0x6a9f('0x3e')]);_0x491de1[_0x6a9f('0x3f')]=qs[_0x6a9f('0x34')](_[_0x6a9f('0x40')](_0x2493e2[_0x6a9f('0x32')],_0x173779[_0x6a9f('0x34')]),_0x5c21e6);if(_0x2493e2[_0x6a9f('0x32')][_0x6a9f('0x41')]){_0x491de1[_0x6a9f('0x3f')]=_[_0x6a9f('0x42')](_0x491de1['where'],{'$or':_[_0x6a9f('0x43')](_0x5c21e6,function(_0x248cbb){if(_0x248cbb[_0x6a9f('0x44')]!==_0x6a9f('0x45')){var _0x3ff73f={};_0x3ff73f[_0x248cbb[_0x6a9f('0x2f')]]={'$like':'%'+_0x2493e2[_0x6a9f('0x32')][_0x6a9f('0x41')]+'%'};return _0x3ff73f;}})});}_0x491de1=_[_0x6a9f('0x42')]({},_0x491de1,_0x2493e2['options']);var _0xd0e156={'where':_0x491de1['where']};return db[_0x6a9f('0x46')][_0x6a9f('0x21')](_0xd0e156)['then'](function(_0x1034d0){_0x4533c4[_0x6a9f('0x21')]=_0x1034d0;if(_0x2493e2[_0x6a9f('0x32')][_0x6a9f('0x47')]){_0x491de1[_0x6a9f('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0x6a9f('0x49')](_0x491de1);})['then'](function(_0xc09685){_0x4533c4['rows']=_0xc09685;return _0x4533c4;})['then'](respondWithFilteredResult(_0x2cf2bd,_0x491de1))['catch'](handleError(_0x2cf2bd,null));};exports[_0x6a9f('0x4a')]=function(_0x1f0224,_0xcec537){var _0x4d21ac={'raw':![],'where':{'id':_0x1f0224[_0x6a9f('0x4b')]['id']}},_0x299c48={};_0x299c48[_0x6a9f('0x39')]=_[_0x6a9f('0x33')](db[_0x6a9f('0x46')]['rawAttributes']);_0x299c48[_0x6a9f('0x32')]=_[_0x6a9f('0x33')](_0x1f0224['query']);_0x299c48[_0x6a9f('0x34')]=_[_0x6a9f('0x35')](_0x299c48['model'],_0x299c48[_0x6a9f('0x32')]);_0x4d21ac['attributes']=_['intersection'](_0x299c48[_0x6a9f('0x39')],qs[_0x6a9f('0x36')](_0x1f0224['query']['fields']));_0x4d21ac[_0x6a9f('0x38')]=_0x4d21ac[_0x6a9f('0x38')][_0x6a9f('0x37')]?_0x4d21ac[_0x6a9f('0x38')]:_0x299c48['model'];if(_0x1f0224[_0x6a9f('0x32')][_0x6a9f('0x47')]){_0x4d21ac[_0x6a9f('0x48')]=[{'all':!![]}];}_0x4d21ac=_[_0x6a9f('0x42')]({},_0x4d21ac,_0x1f0224[_0x6a9f('0x4c')]);return db[_0x6a9f('0x46')][_0x6a9f('0x4d')](_0x4d21ac)['then'](handleEntityNotFound(_0xcec537,null))[_0x6a9f('0x27')](respondWithResult(_0xcec537,null))['catch'](handleError(_0xcec537,null));};exports[_0x6a9f('0x4e')]=function(_0x4a6f82,_0x167c8a){return db[_0x6a9f('0x46')][_0x6a9f('0x4e')](_0x4a6f82[_0x6a9f('0x4f')],{})['then'](function(_0x174667){var _0x2dcfb4=_0x4a6f82[_0x6a9f('0x50')][_0x6a9f('0x51')]({'plain':!![]});if(!_0x2dcfb4)throw new Error(_0x6a9f('0x52'));if(_0x2dcfb4[_0x6a9f('0x53')]===_0x6a9f('0x50')){var _0x1c82d5=_0x174667['get']({'plain':!![]});var _0x16ac14=_0x6a9f('0x29');return db[_0x6a9f('0x54')][_0x6a9f('0x4d')]({'where':{'name':_0x16ac14,'userProfileId':_0x2dcfb4[_0x6a9f('0x55')]},'raw':!![]})[_0x6a9f('0x27')](function(_0x49d3be){if(_0x49d3be&&_0x49d3be[_0x6a9f('0x56')]===0x0){return db[_0x6a9f('0x2a')][_0x6a9f('0x4e')]({'name':_0x1c82d5['name'],'resourceId':_0x1c82d5['id'],'type':_0x49d3be['name'],'sectionId':_0x49d3be['id']},{})[_0x6a9f('0x27')](function(){return _0x174667;});}else{return _0x174667;}})[_0x6a9f('0x57')](function(_0x345e13){logger[_0x6a9f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x345e13);throw _0x345e13;});}return _0x174667;})['then'](respondWithResult(_0x167c8a,0xc9))[_0x6a9f('0x57')](handleError(_0x167c8a,null));};exports['clone']=function(_0x2d13d0,_0x309f72){var _0x39efea={'where':{'id':_0x2d13d0['params']['id']}},_0x1ea373={};_0x1ea373[_0x6a9f('0x39')]=_[_0x6a9f('0x33')](db['Dashboard']['rawAttributes']);_0x39efea[_0x6a9f('0x38')]=_[_0x6a9f('0x35')](_0x1ea373[_0x6a9f('0x39')],qs[_0x6a9f('0x36')](_0x2d13d0['query']['fields']));_0x39efea[_0x6a9f('0x38')]=_0x39efea[_0x6a9f('0x38')][_0x6a9f('0x37')]?_0x39efea[_0x6a9f('0x38')]:_0x1ea373[_0x6a9f('0x39')];if(_0x2d13d0['query'][_0x6a9f('0x47')]){_0x39efea[_0x6a9f('0x48')]=[{'all':!![]}];}_0x39efea=_[_0x6a9f('0x42')]({},_0x39efea,_0x2d13d0[_0x6a9f('0x4c')]);return db[_0x6a9f('0x46')][_0x6a9f('0x4d')](_0x39efea)[_0x6a9f('0x27')](handleEntityNotFound(_0x309f72,null))['then'](function(_0xf7dd65){if(_0xf7dd65){var _0xcdc159=_0xf7dd65[_0x6a9f('0x51')]({'plain':!![]});_0xcdc159=qs['omit'](_0xcdc159,['id','createdAt','updatedAt']);_0x2d13d0[_0x6a9f('0x4f')]=_[_0x6a9f('0x58')](_0x2d13d0[_0x6a9f('0x4f')],['id',_0x6a9f('0x59'),'updatedAt']);return db[_0x6a9f('0x46')][_0x6a9f('0x4e')](_[_0x6a9f('0x42')](_0xcdc159,_0x2d13d0[_0x6a9f('0x4f')]),{'include':_0x2d13d0[_0x6a9f('0x32')][_0x6a9f('0x47')]?[{'all':!![]}]:undefined})[_0x6a9f('0x27')](function(_0x27c7ed){var _0x1a4f53=_0x2d13d0['user'][_0x6a9f('0x51')]({'plain':!![]});if(!_0x1a4f53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a4f53['role']==='user'){var _0x397ab4=_0x27c7ed[_0x6a9f('0x51')]({'plain':!![]});var _0x51a9f8='CustomDashboards';return db['UserProfileSection'][_0x6a9f('0x4d')]({'where':{'name':_0x51a9f8,'userProfileId':_0x1a4f53['userProfileId']},'raw':!![]})['then'](function(_0x47bf1c){if(_0x47bf1c&&_0x47bf1c[_0x6a9f('0x56')]===0x0){return db[_0x6a9f('0x2a')][_0x6a9f('0x4e')]({'name':_0x397ab4[_0x6a9f('0x2f')],'resourceId':_0x397ab4['id'],'type':_0x47bf1c[_0x6a9f('0x2f')],'sectionId':_0x47bf1c['id']},{})[_0x6a9f('0x27')](function(){return _0x27c7ed;});}else{return _0x27c7ed;}})[_0x6a9f('0x57')](function(_0x286b14){logger[_0x6a9f('0x2d')](_0x6a9f('0x5a'),_0x286b14);throw _0x286b14;});}return _0x27c7ed;});}})[_0x6a9f('0x27')](respondWithResult(_0x309f72,0xc9))[_0x6a9f('0x57')](handleError(_0x309f72,null));};exports[_0x6a9f('0x26')]=function(_0x35bb3a,_0x55e0ec){if(_0x35bb3a[_0x6a9f('0x4f')]['id']){delete _0x35bb3a[_0x6a9f('0x4f')]['id'];}return db[_0x6a9f('0x46')][_0x6a9f('0x4d')]({'where':{'id':_0x35bb3a[_0x6a9f('0x4b')]['id']}})[_0x6a9f('0x27')](handleEntityNotFound(_0x55e0ec,null))[_0x6a9f('0x27')](saveUpdates(_0x35bb3a['body'],null))[_0x6a9f('0x27')](respondWithResult(_0x55e0ec,null))[_0x6a9f('0x57')](handleError(_0x55e0ec,null));};exports['destroy']=function(_0x434d66,_0x170feb){return db[_0x6a9f('0x46')]['find']({'where':{'id':_0x434d66['params']['id']}})[_0x6a9f('0x27')](handleEntityNotFound(_0x170feb,null))[_0x6a9f('0x27')](removeEntity(_0x170feb,null))[_0x6a9f('0x57')](handleError(_0x170feb,null));};function widgetAttributes(_0x5b2d7b){try{switch(_0x5b2d7b['type']){case _0x6a9f('0x5b'):return[{'name':_0x6a9f('0x5c'),'value':_0x5b2d7b[_0x6a9f('0x5c')]||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b['attrs'][0x0]?_0x5b2d7b[_0x6a9f('0x5d')][0x0][_0x6a9f('0x5e')]:undefined)||_0x6a9f('0x5f')}];case _0x6a9f('0x60'):return[{'name':_0x6a9f('0x61'),'value':_0x5b2d7b[_0x6a9f('0x61')]||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x0]?_0x5b2d7b[_0x6a9f('0x5d')][0x0][_0x6a9f('0x5e')]:undefined)||''}];case'clock':return[{'name':_0x6a9f('0x62'),'value':_0x5b2d7b['attrHourFormat']||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x0]?_0x5b2d7b['attrs'][0x0][_0x6a9f('0x5e')]:undefined)||_0x6a9f('0x63')},{'name':_0x6a9f('0x64'),'value':_0x5b2d7b['attrTimezone']||(_0x5b2d7b['attrs']&&_0x5b2d7b[_0x6a9f('0x5d')][0x1]?_0x5b2d7b[_0x6a9f('0x5d')][0x1]['value']:undefined)||_0x6a9f('0x65')},{'name':_0x6a9f('0x66'),'value':_0x5b2d7b[_0x6a9f('0x66')]||(_0x5b2d7b['attrs']&&_0x5b2d7b[_0x6a9f('0x5d')][0x2]?_0x5b2d7b[_0x6a9f('0x5d')][0x2][_0x6a9f('0x5e')]:undefined)||0xc}];case _0x6a9f('0x67'):return[{'name':_0x6a9f('0x68'),'value':_0x5b2d7b[_0x6a9f('0x68')]||(_0x5b2d7b['attrs']&&_0x5b2d7b[_0x6a9f('0x5d')][0x0]?_0x5b2d7b[_0x6a9f('0x5d')][0x0][_0x6a9f('0x5e')]:undefined)||_0x6a9f('0x69')},{'name':_0x6a9f('0x6a'),'value':_0x5b2d7b['attrVoiceQueues']||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x1]?_0x5b2d7b['attrs'][0x1][_0x6a9f('0x5e')]:undefined)||[]},{'name':_0x6a9f('0x66'),'value':_0x5b2d7b[_0x6a9f('0x66')]||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x2]?_0x5b2d7b[_0x6a9f('0x5d')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x6a9f('0x6b'):return[{'name':_0x6a9f('0x6c'),'value':_0x5b2d7b['attrSerie1']||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x0]?_0x5b2d7b[_0x6a9f('0x5d')][0x0][_0x6a9f('0x5e')]:undefined)||_0x6a9f('0x69')},{'name':'attrSerie2','value':_0x5b2d7b[_0x6a9f('0x6d')]||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x1]?_0x5b2d7b[_0x6a9f('0x5d')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x5b2d7b['attrSerie3']||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x2]?_0x5b2d7b[_0x6a9f('0x5d')][0x2][_0x6a9f('0x5e')]:undefined)||null},{'name':_0x6a9f('0x6a'),'value':_0x5b2d7b['attrVoiceQueues']||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x3]?_0x5b2d7b[_0x6a9f('0x5d')][0x3][_0x6a9f('0x5e')]:undefined)||[]}];case _0x6a9f('0x6e'):return[{'name':_0x6a9f('0x6f'),'type':_0x5b2d7b['reportType']||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x0]?_0x5b2d7b['attrs'][0x0][_0x6a9f('0x44')]:undefined)||null,'value':_0x5b2d7b[_0x6a9f('0x6f')]||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x0]?_0x5b2d7b['attrs'][0x0][_0x6a9f('0x5e')]:undefined)||null},{'name':_0x6a9f('0x70'),'value':_0x5b2d7b[_0x6a9f('0x70')]||(_0x5b2d7b[_0x6a9f('0x5d')]&&_0x5b2d7b[_0x6a9f('0x5d')][0x1]?_0x5b2d7b[_0x6a9f('0x5d')][0x1][_0x6a9f('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x2e31a0){logger[_0x6a9f('0x2d')](_0x6a9f('0x71'),JSON[_0x6a9f('0x72')](_0x2e31a0));return[];}}exports[_0x6a9f('0x73')]=function(_0x2d9bce,_0x1d5ed8,_0x134792){if(_0x2d9bce[_0x6a9f('0x4f')]['id']){delete _0x2d9bce[_0x6a9f('0x4f')]['id'];}return db[_0x6a9f('0x46')][_0x6a9f('0x4d')]({'where':{'id':_0x2d9bce['params']['id']}})[_0x6a9f('0x27')](handleEntityNotFound(_0x1d5ed8,null))['then'](function(_0x14a652){if(_0x14a652){_0x2d9bce['body'][_0x6a9f('0x74')]=_0x14a652['id'];_0x2d9bce[_0x6a9f('0x4f')][_0x6a9f('0x5d')]=widgetAttributes(_0x2d9bce[_0x6a9f('0x4f')]);return db[_0x6a9f('0x75')][_0x6a9f('0x4e')](_0x2d9bce[_0x6a9f('0x4f')]);}})[_0x6a9f('0x27')](respondWithResult(_0x1d5ed8,null))['catch'](handleError(_0x1d5ed8,null));};exports[_0x6a9f('0x76')]=function(_0x196da4,_0x263b77,_0x5323ac){var _0x3aea7c={};var _0x439c10={};var _0x18ab6c;var _0x2ffcb5;return db[_0x6a9f('0x46')][_0x6a9f('0x77')]({'where':{'id':_0x196da4[_0x6a9f('0x4b')]['id']}})[_0x6a9f('0x27')](handleEntityNotFound(_0x263b77,null))['then'](function(_0x88f0c0){if(_0x88f0c0){_0x18ab6c=_0x88f0c0;_0x439c10['model']=_['keys'](db[_0x6a9f('0x75')][_0x6a9f('0x31')]);_0x439c10[_0x6a9f('0x32')]=_[_0x6a9f('0x33')](_0x196da4[_0x6a9f('0x32')]);_0x439c10[_0x6a9f('0x34')]=_[_0x6a9f('0x35')](_0x439c10[_0x6a9f('0x39')],_0x439c10[_0x6a9f('0x32')]);_0x3aea7c['attributes']=_[_0x6a9f('0x35')](_0x439c10[_0x6a9f('0x39')],qs[_0x6a9f('0x36')](_0x196da4[_0x6a9f('0x32')][_0x6a9f('0x36')]));_0x3aea7c[_0x6a9f('0x38')]=_0x3aea7c['attributes']['length']?_0x3aea7c[_0x6a9f('0x38')]:_0x439c10[_0x6a9f('0x39')];_0x3aea7c[_0x6a9f('0x3d')]=qs[_0x6a9f('0x3e')](_0x196da4[_0x6a9f('0x32')]['sort']);_0x3aea7c[_0x6a9f('0x3f')]=qs[_0x6a9f('0x34')](_[_0x6a9f('0x40')](_0x196da4[_0x6a9f('0x32')],_0x439c10[_0x6a9f('0x34')]));if(_0x196da4[_0x6a9f('0x32')][_0x6a9f('0x41')]){_0x3aea7c[_0x6a9f('0x3f')]=_['merge'](_0x3aea7c[_0x6a9f('0x3f')],{'$or':_[_0x6a9f('0x43')](_0x3aea7c['attributes'],function(_0x23f8f3){var _0x3b538b={};_0x3b538b[_0x23f8f3]={'$like':'%'+_0x196da4['query'][_0x6a9f('0x41')]+'%'};return _0x3b538b;})});}_0x3aea7c=_[_0x6a9f('0x42')]({},_0x3aea7c,_0x196da4[_0x6a9f('0x4c')]);return _0x18ab6c[_0x6a9f('0x76')](_0x3aea7c);}})[_0x6a9f('0x27')](function(_0x477dac){if(_0x477dac){_0x2ffcb5=_0x477dac[_0x6a9f('0x37')];if(!_0x196da4[_0x6a9f('0x32')]['hasOwnProperty']('nolimit')){_0x3aea7c[_0x6a9f('0x20')]=qs['limit'](_0x196da4[_0x6a9f('0x32')][_0x6a9f('0x20')]);_0x3aea7c[_0x6a9f('0x3c')]=qs[_0x6a9f('0x3c')](_0x196da4[_0x6a9f('0x32')]['offset']);}return _0x18ab6c[_0x6a9f('0x76')](_0x3aea7c);}})[_0x6a9f('0x27')](function(_0x2e701b){if(_0x2e701b){return _0x2e701b?{'count':_0x2ffcb5,'rows':_0x2e701b}:null;}})[_0x6a9f('0x27')](respondWithResult(_0x263b77,null))[_0x6a9f('0x57')](handleError(_0x263b77,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index d2ec168..c8b9c88 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 _0x2709=['exports','events','Dashboard','setMaxListeners','update','emit','hook'];(function(_0x18c669,_0x104cd5){var _0x49280a=function(_0x55ebd9){while(--_0x55ebd9){_0x18c669['push'](_0x18c669['shift']());}};_0x49280a(++_0x104cd5);}(_0x2709,0x189));var _0x9270=function(_0x138309,_0x3d0938){_0x138309=_0x138309-0x0;var _0x40d6f2=_0x2709[_0x138309];return _0x40d6f2;};'use strict';var EventEmitter=require(_0x9270('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x9270('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9270('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9270('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd5780b){return function(_0x26bdf5,_0x326c2a,_0x2c09b6){DashboardEvents[_0x9270('0x4')](_0xd5780b+':'+_0x26bdf5['id'],_0x26bdf5);DashboardEvents[_0x9270('0x4')](_0xd5780b,_0x26bdf5);_0x2c09b6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x9270('0x5')](e,emitEvent(event));}}module[_0x9270('0x6')]=DashboardEvents; \ No newline at end of file +var _0xfca0=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xfca0,0x171));var _0x0fca=function(_0x4d8856,_0x237d27){_0x4d8856=_0x4d8856-0x0;var _0xb126ee=_0xfca0[_0x4d8856];return _0xb126ee;};'use strict';var EventEmitter=require(_0x0fca('0x0'));var Dashboard=require(_0x0fca('0x1'))['db'][_0x0fca('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0fca('0x3')](0x0);var events={'afterCreate':_0x0fca('0x4'),'afterUpdate':_0x0fca('0x5'),'afterDestroy':_0x0fca('0x6')};function emitEvent(_0x214c33){return function(_0x52cfba,_0x226056,_0xb474bc){DashboardEvents[_0x0fca('0x7')](_0x214c33+':'+_0x52cfba['id'],_0x52cfba);DashboardEvents[_0x0fca('0x7')](_0x214c33,_0x52cfba);_0xb474bc(null);};}for(var e in events){if(events[_0x0fca('0x8')](e)){var event=events[e];Dashboard[_0x0fca('0x9')](e,emitEvent(event));}}module[_0x0fca('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index f066bda..47e5588 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 _0xcebc=['api','moment','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','lodash','../../config/logger'];(function(_0x22153b,_0x4528ec){var _0x217dae=function(_0x14520e){while(--_0x14520e){_0x22153b['push'](_0x22153b['shift']());}};_0x217dae(++_0x4528ec);}(_0xcebc,0x76));var _0xcceb=function(_0x49b951,_0x38959f){_0x49b951=_0x49b951-0x0;var _0x713874=_0xcebc[_0x49b951];return _0x713874;};'use strict';var _=require(_0xcceb('0x0'));var util=require('util');var logger=require(_0xcceb('0x1'))(_0xcceb('0x2'));var moment=require(_0xcceb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcceb('0x4'));var rimraf=require(_0xcceb('0x5'));var config=require(_0xcceb('0x6'));var attributes=require(_0xcceb('0x7'));module[_0xcceb('0x8')]=function(_0x2e6070,_0x55caee){return _0x2e6070[_0xcceb('0x9')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6f8=['define','Dashboard','dashboards','lodash','util','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports'];(function(_0x233a7d,_0x1e9e89){var _0xb43d31=function(_0x2fb942){while(--_0x2fb942){_0x233a7d['push'](_0x233a7d['shift']());}};_0xb43d31(++_0x1e9e89);}(_0xf6f8,0xbe));var _0x8f6f=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xf6f8[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x8f6f('0x0'));var util=require(_0x8f6f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8f6f('0x2'));var rp=require(_0x8f6f('0x3'));var fs=require('fs');var path=require(_0x8f6f('0x4'));var rimraf=require('rimraf');var config=require(_0x8f6f('0x5'));var attributes=require(_0x8f6f('0x6'));module[_0x8f6f('0x7')]=function(_0x5791cd,_0x3c93f6){return _0x5791cd[_0x8f6f('0x8')](_0x8f6f('0x9'),attributes,{'tableName':_0x8f6f('0xa'),'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 8a6fe0f..0044883 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 _0xe697=['util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x369a98,_0x32250c){var _0x29565c=function(_0x1a6973){while(--_0x1a6973){_0x369a98['push'](_0x369a98['shift']());}};_0x29565c(++_0x32250c);}(_0xe697,0xe0));var _0x7e69=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0xe697[_0x197185];return _0x2c8af1;};'use strict';var _=require(_0x7e69('0x0'));var util=require(_0x7e69('0x1'));var moment=require('moment');var BPromise=require(_0x7e69('0x2'));var rs=require(_0x7e69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e69('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e69('0x5'))('rpc');var config=require(_0x7e69('0x6'));var jayson=require(_0x7e69('0x7'));var client=jayson['client'][_0x7e69('0x8')]({'port':0x232a});config[_0x7e69('0x9')]=_[_0x7e69('0xa')](config[_0x7e69('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7e69('0xb'))(new Redis(config[_0x7e69('0x9')]));require(_0x7e69('0xc'))[_0x7e69('0xd')](socket);function respondWithRpcPromise(_0x1170c2,_0x599b88,_0x5c1420){return new BPromise(function(_0x2e021e,_0x2abef0){return client[_0x7e69('0xe')](_0x1170c2,_0x5c1420)[_0x7e69('0xf')](function(_0xd5f351){logger[_0x7e69('0x10')](_0x7e69('0x11'),_0x599b88,_0x7e69('0x12'));logger[_0x7e69('0x13')](_0x7e69('0x14'),_0x599b88,'request\x20sent',JSON['stringify'](_0xd5f351));if(_0xd5f351['error']){if(_0xd5f351[_0x7e69('0x15')]['code']===0x1f4){logger['error'](_0x7e69('0x11'),_0x599b88,_0xd5f351[_0x7e69('0x15')]['message']);return _0x2abef0(_0xd5f351['error'][_0x7e69('0x16')]);}logger[_0x7e69('0x15')](_0x7e69('0x11'),_0x599b88,_0xd5f351['error']['message']);return _0x2e021e(_0xd5f351[_0x7e69('0x15')][_0x7e69('0x16')]);}else{logger[_0x7e69('0x10')]('Dashboard,\x20%s,\x20%s',_0x599b88,_0x7e69('0x12'));_0x2e021e(_0xd5f351[_0x7e69('0x17')][_0x7e69('0x16')]);}})[_0x7e69('0x18')](function(_0x4bc6fd){logger[_0x7e69('0x15')](_0x7e69('0x11'),_0x599b88,_0x4bc6fd);_0x2abef0(_0x4bc6fd);});});} \ No newline at end of file +var _0x7383=['info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','ioredis','rpc','defaults','redis','socket.io-emitter','./dashboard.socket','register','request','then'];(function(_0x54a832,_0x526108){var _0x344ea9=function(_0x484afe){while(--_0x484afe){_0x54a832['push'](_0x54a832['shift']());}};_0x344ea9(++_0x526108);}(_0x7383,0x148));var _0x3738=function(_0x4e9732,_0x29325a){_0x4e9732=_0x4e9732-0x0;var _0x40d863=_0x7383[_0x4e9732];return _0x40d863;};'use strict';var _=require(_0x3738('0x0'));var util=require(_0x3738('0x1'));var moment=require(_0x3738('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3738('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3738('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x3738('0x5')](config[_0x3738('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x3738('0x7'))(new Redis(config[_0x3738('0x6')]));require(_0x3738('0x8'))[_0x3738('0x9')](socket);function respondWithRpcPromise(_0x1500ec,_0x1c7750,_0x45ee35){return new BPromise(function(_0x478fbd,_0x14b9ad){return client[_0x3738('0xa')](_0x1500ec,_0x45ee35)[_0x3738('0xb')](function(_0xa07e09){logger[_0x3738('0xc')](_0x3738('0xd'),_0x1c7750,_0x3738('0xe'));logger[_0x3738('0xf')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x1c7750,_0x3738('0xe'),JSON['stringify'](_0xa07e09));if(_0xa07e09[_0x3738('0x10')]){if(_0xa07e09[_0x3738('0x10')][_0x3738('0x11')]===0x1f4){logger['error'](_0x3738('0xd'),_0x1c7750,_0xa07e09[_0x3738('0x10')][_0x3738('0x12')]);return _0x14b9ad(_0xa07e09[_0x3738('0x10')][_0x3738('0x12')]);}logger[_0x3738('0x10')]('Dashboard,\x20%s,\x20%s',_0x1c7750,_0xa07e09[_0x3738('0x10')][_0x3738('0x12')]);return _0x478fbd(_0xa07e09[_0x3738('0x10')][_0x3738('0x12')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x1c7750,_0x3738('0xe'));_0x478fbd(_0xa07e09['result'][_0x3738('0x12')]);}})[_0x3738('0x13')](function(_0x33486b){logger[_0x3738('0x10')](_0x3738('0xd'),_0x1c7750,_0x33486b);_0x14b9ad(_0x33486b);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5dfa0f9..436950f 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 _0xb428=['dashboard:','./dashboard.events','save','update','emit','register','length'];(function(_0x4876c9,_0xb6af63){var _0x47d92a=function(_0x47d19f){while(--_0x47d19f){_0x4876c9['push'](_0x4876c9['shift']());}};_0x47d92a(++_0xb6af63);}(_0xb428,0x1eb));var _0x8b42=function(_0x2fc6cf,_0x2bb133){_0x2fc6cf=_0x2fc6cf-0x0;var _0xf2ade3=_0xb428[_0x2fc6cf];return _0xf2ade3;};'use strict';var DashboardEvents=require(_0x8b42('0x0'));var events=[_0x8b42('0x1'),'remove',_0x8b42('0x2')];function createListener(_0x1d4e71,_0x5bfd97){return function(_0x60f1d){_0x5bfd97[_0x8b42('0x3')](_0x1d4e71,_0x60f1d);};}function removeListener(_0x44c9ed,_0x31a41d){return function(){DashboardEvents['removeListener'](_0x44c9ed,_0x31a41d);};}exports[_0x8b42('0x4')]=function(_0x5e4142){for(var _0x3b3ba1=0x0,_0x10d7a9=events[_0x8b42('0x5')];_0x3b3ba1<_0x10d7a9;_0x3b3ba1++){var _0x643e29=events[_0x3b3ba1];var _0x83c69e=createListener(_0x8b42('0x6')+_0x643e29,_0x5e4142);DashboardEvents['on'](_0x643e29,_0x83c69e);}}; \ No newline at end of file +var _0xd711=['removeListener','register','dashboard:','./dashboard.events','save','emit'];(function(_0x41715b,_0x12c9e1){var _0x581e61=function(_0x5bb41b){while(--_0x5bb41b){_0x41715b['push'](_0x41715b['shift']());}};_0x581e61(++_0x12c9e1);}(_0xd711,0x13b));var _0x1d71=function(_0x37f41d,_0x4ec5b5){_0x37f41d=_0x37f41d-0x0;var _0x1d28b3=_0xd711[_0x37f41d];return _0x1d28b3;};'use strict';var DashboardEvents=require(_0x1d71('0x0'));var events=[_0x1d71('0x1'),'remove','update'];function createListener(_0x107503,_0x23ef75){return function(_0x4c7817){_0x23ef75[_0x1d71('0x2')](_0x107503,_0x4c7817);};}function removeListener(_0x20d193,_0xc60c89){return function(){DashboardEvents[_0x1d71('0x3')](_0x20d193,_0xc60c89);};}exports[_0x1d71('0x4')]=function(_0x3632a4){for(var _0x5addd9=0x0,_0x2e39c5=events['length'];_0x5addd9<_0x2e39c5;_0x5addd9++){var _0x40ab1c=events[_0x5addd9];var _0x543f0c=createListener(_0x1d71('0x5')+_0x40ab1c,_0x3632a4);DashboardEvents['on'](_0x40ab1c,_0x543f0c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index b179b2f..3d86b44 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 _0x1911=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x210916,_0x5ac3de){var _0x5262a5=function(_0x20ea52){while(--_0x20ea52){_0x210916['push'](_0x210916['shift']());}};_0x5262a5(++_0x5ac3de);}(_0x1911,0xc3));var _0x1191=function(_0x7b1ac1,_0x357625){_0x7b1ac1=_0x7b1ac1-0x0;var _0x290df3=_0x1911[_0x7b1ac1];return _0x290df3;};'use strict';var multer=require('multer');var util=require(_0x1191('0x0'));var path=require('path');var timeout=require(_0x1191('0x1'));var express=require(_0x1191('0x2'));var router=express[_0x1191('0x3')]();var fs_extra=require(_0x1191('0x4'));var auth=require(_0x1191('0x5'));var interaction=require(_0x1191('0x6'));var config=require(_0x1191('0x7'));var controller=require(_0x1191('0x8'));router[_0x1191('0x9')]('/',auth[_0x1191('0xa')](),controller[_0x1191('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1191('0xc')]);router[_0x1191('0x9')](_0x1191('0xd'),auth[_0x1191('0xa')](),controller[_0x1191('0xe')]);router[_0x1191('0xf')]('/',auth['isAuthenticated'](),controller[_0x1191('0x10')]);router[_0x1191('0xf')](_0x1191('0x11'),auth[_0x1191('0xa')](),controller[_0x1191('0x12')]);router[_0x1191('0xf')](_0x1191('0xd'),auth[_0x1191('0xa')](),controller[_0x1191('0x13')]);router[_0x1191('0x14')]('/:id',auth[_0x1191('0xa')](),controller[_0x1191('0x15')]);router[_0x1191('0x16')]('/:id',auth[_0x1191('0xa')](),controller[_0x1191('0x17')]);module[_0x1191('0x18')]=router; \ No newline at end of file +var _0xc3bc=['getItems','post','create','/:id/clone','clone','addItem','put','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','get','show','/:id/items'];(function(_0x5cd6ae,_0x8a4342){var _0x1a6e91=function(_0x314922){while(--_0x314922){_0x5cd6ae['push'](_0x5cd6ae['shift']());}};_0x1a6e91(++_0x8a4342);}(_0xc3bc,0x6a));var _0xcc3b=function(_0x561d56,_0x42e963){_0x561d56=_0x561d56-0x0;var _0x5320ca=_0xc3bc[_0x561d56];return _0x5320ca;};'use strict';var multer=require(_0xcc3b('0x0'));var util=require(_0xcc3b('0x1'));var path=require(_0xcc3b('0x2'));var timeout=require('connect-timeout');var express=require(_0xcc3b('0x3'));var router=express[_0xcc3b('0x4')]();var fs_extra=require(_0xcc3b('0x5'));var auth=require(_0xcc3b('0x6'));var interaction=require(_0xcc3b('0x7'));var config=require(_0xcc3b('0x8'));var controller=require(_0xcc3b('0x9'));router['get']('/',auth[_0xcc3b('0xa')](),controller['index']);router[_0xcc3b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xcc3b('0xc')]);router[_0xcc3b('0xb')](_0xcc3b('0xd'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0xe')]);router[_0xcc3b('0xf')]('/',auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x10')]);router['post'](_0xcc3b('0x11'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x12')]);router[_0xcc3b('0xf')]('/:id/items',auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x13')]);router[_0xcc3b('0x14')](_0xcc3b('0x15'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x16')]);router['delete'](_0xcc3b('0x15'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 38022b1..5a04eb8 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 _0x6f47=['#ffffff','squel','lodash','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x49b8b4,_0x55f27c){var _0x4615ca=function(_0x4d4408){while(--_0x4d4408){_0x49b8b4['push'](_0x49b8b4['shift']());}};_0x4615ca(++_0x55f27c);}(_0x6f47,0xc7));var _0x76f4=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x6f47[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));module['exports']={'title':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x76f4('0x3')]('long'),'get':function(){try{return JSON[_0x76f4('0x4')](this[_0x76f4('0x5')](_0x76f4('0x6')));}catch(_0x2523ba){return[];}},'set':function(_0x5754ca){try{this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')](_0x5754ca));}catch(_0x497f99){this[_0x76f4('0x7')](_0x76f4('0x6'),JSON[_0x76f4('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x76f4('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x76f4('0x2')],'allowNull':![],'defaultValue':_0x76f4('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x76f4('0x2')]},'titleFontSize':{'type':Sequelize[_0x76f4('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xe2fe=['setDataValue','INTEGER','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify'];(function(_0x34a10b,_0x3e2de5){var _0x4a0a5b=function(_0x25ec46){while(--_0x25ec46){_0x34a10b['push'](_0x34a10b['shift']());}};_0x4a0a5b(++_0x3e2de5);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));var squel=require('squel');var _=require('lodash');module[_0xee2f('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4')),'get':function(){try{return JSON[_0xee2f('0x5')](this[_0xee2f('0x6')]('attrs'));}catch(_0x311a2f){return[];}},'set':function(_0x2b7e7c){try{this['setDataValue'](_0xee2f('0x7'),JSON[_0xee2f('0x8')](_0x2b7e7c));}catch(_0x5a7975){this[_0xee2f('0x9')]('attrs',JSON[_0xee2f('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xee2f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xee2f('0xa')]},'col':{'type':Sequelize[_0xee2f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xee2f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 9c7f4fb..eed79be 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 _0x7cb5=['options','catch','find','params','type','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','model','keys','DashboardItem','query','intersection','attributes','length','includeAll','merge'];(function(_0x361a68,_0x286aee){var _0x16acb5=function(_0x5382f9){while(--_0x5382f9){_0x361a68['push'](_0x361a68['shift']());}};_0x16acb5(++_0x286aee);}(_0x7cb5,0xd9));var _0x57cb=function(_0x2e1777,_0x238f6c){_0x2e1777=_0x2e1777-0x0;var _0x3cc305=_0x7cb5[_0x2e1777];return _0x3cc305;};'use strict';var emlformat=require(_0x57cb('0x0'));var rimraf=require(_0x57cb('0x1'));var zipdir=require(_0x57cb('0x2'));var jsonpatch=require(_0x57cb('0x3'));var rp=require('request-promise');var moment=require(_0x57cb('0x4'));var BPromise=require(_0x57cb('0x5'));var Mustache=require(_0x57cb('0x6'));var util=require(_0x57cb('0x7'));var path=require(_0x57cb('0x8'));var sox=require(_0x57cb('0x9'));var csv=require(_0x57cb('0xa'));var ejs=require(_0x57cb('0xb'));var fs=require('fs');var fs_extra=require(_0x57cb('0xc'));var _=require(_0x57cb('0xd'));var squel=require(_0x57cb('0xe'));var crypto=require(_0x57cb('0xf'));var jsforce=require(_0x57cb('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x57cb('0xa'));var querystring=require(_0x57cb('0x11'));var Papa=require(_0x57cb('0x12'));var Redis=require(_0x57cb('0x13'));var authService=require(_0x57cb('0x14'));var qs=require(_0x57cb('0x15'));var as=require(_0x57cb('0x16'));var hardwareService=require(_0x57cb('0x17'));var logger=require(_0x57cb('0x18'))(_0x57cb('0x19'));var utils=require('../../config/utils');var config=require(_0x57cb('0x1a'));var licenseUtil=require(_0x57cb('0x1b'));var db=require(_0x57cb('0x1c'))['db'];config[_0x57cb('0x1d')]=_[_0x57cb('0x1e')](config[_0x57cb('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x57cb('0x1f'))(new Redis(config['redis']));require(_0x57cb('0x20'))[_0x57cb('0x21')](socket);function respondWithStatusCode(_0x4dac0a,_0xe41207){_0xe41207=_0xe41207||0xcc;return function(_0x52cfd1){if(_0x52cfd1){return _0x4dac0a[_0x57cb('0x22')](_0xe41207);}return _0x4dac0a[_0x57cb('0x23')](_0xe41207)[_0x57cb('0x24')]();};}function respondWithResult(_0x57cab3,_0x1bba87){_0x1bba87=_0x1bba87||0xc8;return function(_0x1c5ca2){if(_0x1c5ca2){return _0x57cab3[_0x57cb('0x23')](_0x1bba87)[_0x57cb('0x25')](_0x1c5ca2);}};}function respondWithFilteredResult(_0x3320e9,_0x4b0085){return function(_0x278408){if(_0x278408){var _0x3853d4=typeof _0x4b0085[_0x57cb('0x26')]==='undefined'&&typeof _0x4b0085[_0x57cb('0x27')]===_0x57cb('0x28');var _0x5abc44=_0x278408['count'];var _0x25b90d=_0x3853d4?0x0:_0x4b0085[_0x57cb('0x26')];var _0x34117f=_0x3853d4?_0x278408[_0x57cb('0x29')]:_0x4b0085[_0x57cb('0x26')]+_0x4b0085['limit'];var _0x4dd506;if(_0x34117f>=_0x5abc44){_0x34117f=_0x5abc44;_0x4dd506=0xc8;}else{_0x4dd506=0xce;}_0x3320e9[_0x57cb('0x23')](_0x4dd506);return _0x3320e9[_0x57cb('0x2a')]('Content-Range',_0x25b90d+'-'+_0x34117f+'/'+_0x5abc44)[_0x57cb('0x25')](_0x278408);}return null;};}function patchUpdates(_0x1b40d8){return function(_0x4a79f1){try{jsonpatch[_0x57cb('0x2b')](_0x4a79f1,_0x1b40d8,!![]);}catch(_0x3bed40){return BPromise[_0x57cb('0x2c')](_0x3bed40);}return _0x4a79f1[_0x57cb('0x2d')]();};}function saveUpdates(_0x44e55d,_0x5d46b2){return function(_0x4ba0d4){if(_0x4ba0d4){return _0x4ba0d4[_0x57cb('0x2e')](_0x44e55d)['then'](function(_0x9528af){return _0x9528af;});}return null;};}function removeEntity(_0x552c8f,_0x294d73){return function(_0x55ef03){if(_0x55ef03){return _0x55ef03[_0x57cb('0x2f')]()[_0x57cb('0x30')](function(){_0x552c8f[_0x57cb('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f4f3,_0x5c5c7e){return function(_0x6a897b){if(!_0x6a897b){_0x33f4f3['sendStatus'](0x194);}return _0x6a897b;};}function handleError(_0x3bec8b,_0x104f11){_0x104f11=_0x104f11||0x1f4;return function(_0x5df578){logger[_0x57cb('0x31')](_0x5df578[_0x57cb('0x32')]);if(_0x5df578[_0x57cb('0x33')]){delete _0x5df578[_0x57cb('0x33')];}_0x3bec8b[_0x57cb('0x23')](_0x104f11)[_0x57cb('0x34')](_0x5df578);};}exports['show']=function(_0x35b33d,_0xcbf766){var _0x4a5052={'raw':![],'where':{'id':_0x35b33d['params']['id']}},_0x86f827={};_0x86f827[_0x57cb('0x35')]=_[_0x57cb('0x36')](db[_0x57cb('0x37')]['rawAttributes']);_0x86f827[_0x57cb('0x38')]=_[_0x57cb('0x36')](_0x35b33d['query']);_0x86f827['filters']=_[_0x57cb('0x39')](_0x86f827[_0x57cb('0x35')],_0x86f827[_0x57cb('0x38')]);_0x4a5052['attributes']=_[_0x57cb('0x39')](_0x86f827['model'],qs['fields'](_0x35b33d[_0x57cb('0x38')]['fields']));_0x4a5052[_0x57cb('0x3a')]=_0x4a5052['attributes'][_0x57cb('0x3b')]?_0x4a5052['attributes']:_0x86f827['model'];if(_0x35b33d[_0x57cb('0x38')][_0x57cb('0x3c')]){_0x4a5052['include']=[{'all':!![]}];}_0x4a5052=_[_0x57cb('0x3d')]({},_0x4a5052,_0x35b33d[_0x57cb('0x3e')]);return db[_0x57cb('0x37')]['find'](_0x4a5052)[_0x57cb('0x30')](handleEntityNotFound(_0xcbf766,null))[_0x57cb('0x30')](respondWithResult(_0xcbf766,null))[_0x57cb('0x3f')](handleError(_0xcbf766,null));};exports[_0x57cb('0x2f')]=function(_0x2cc668,_0x365e33){return db[_0x57cb('0x37')][_0x57cb('0x40')]({'where':{'id':_0x2cc668[_0x57cb('0x41')]['id']}})[_0x57cb('0x30')](handleEntityNotFound(_0x365e33,null))['then'](removeEntity(_0x365e33,null))['catch'](handleError(_0x365e33,null));};function widgetAttributes(_0x3540da){try{switch(_0x3540da[_0x57cb('0x42')]){case _0x57cb('0x43'):return[{'name':_0x57cb('0x44'),'value':_0x3540da[_0x57cb('0x44')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x0]?_0x3540da[_0x57cb('0x45')][0x0]['value']:undefined)||_0x57cb('0x46')}];case'custom':return[{'name':_0x57cb('0x47'),'value':_0x3540da['attrPath']||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x0]?_0x3540da[_0x57cb('0x45')][0x0][_0x57cb('0x48')]:undefined)||''}];case _0x57cb('0x49'):return[{'name':_0x57cb('0x4a'),'value':_0x3540da[_0x57cb('0x4a')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x0]?_0x3540da[_0x57cb('0x45')][0x0][_0x57cb('0x48')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x3540da[_0x57cb('0x4b')]||(_0x3540da['attrs']&&_0x3540da['attrs'][0x1]?_0x3540da[_0x57cb('0x45')][0x1]['value']:undefined)||_0x57cb('0x4c')},{'name':_0x57cb('0x4d'),'value':_0x3540da[_0x57cb('0x4d')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x2]?_0x3540da['attrs'][0x2][_0x57cb('0x48')]:undefined)||0xc}];case _0x57cb('0x4e'):return[{'name':_0x57cb('0x4f'),'value':_0x3540da[_0x57cb('0x4f')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x0]?_0x3540da[_0x57cb('0x45')][0x0][_0x57cb('0x48')]:undefined)||_0x57cb('0x50')},{'name':_0x57cb('0x51'),'value':_0x3540da['attrVoiceQueues']||(_0x3540da['attrs']&&_0x3540da[_0x57cb('0x45')][0x1]?_0x3540da[_0x57cb('0x45')][0x1]['value']:undefined)||[]},{'name':_0x57cb('0x4d'),'value':_0x3540da[_0x57cb('0x4d')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x2]?_0x3540da[_0x57cb('0x45')][0x2]['value']:undefined)||0x14}];case _0x57cb('0x52'):case'pie-chart':return[{'name':'attrSerie1','value':_0x3540da[_0x57cb('0x53')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x0]?_0x3540da[_0x57cb('0x45')][0x0]['value']:undefined)||_0x57cb('0x50')},{'name':'attrSerie2','value':_0x3540da[_0x57cb('0x54')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da['attrs'][0x1]?_0x3540da['attrs'][0x1][_0x57cb('0x48')]:undefined)||null},{'name':'attrSerie3','value':_0x3540da[_0x57cb('0x55')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da['attrs'][0x2]?_0x3540da[_0x57cb('0x45')][0x2][_0x57cb('0x48')]:undefined)||null},{'name':_0x57cb('0x51'),'value':_0x3540da[_0x57cb('0x51')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x3]?_0x3540da[_0x57cb('0x45')][0x3][_0x57cb('0x48')]:undefined)||[]}];case _0x57cb('0x56'):return[{'name':'attrReport','type':_0x3540da[_0x57cb('0x57')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x0]?_0x3540da[_0x57cb('0x45')][0x0]['type']:undefined)||null,'value':_0x3540da[_0x57cb('0x58')]||(_0x3540da['attrs']&&_0x3540da['attrs'][0x0]?_0x3540da[_0x57cb('0x45')][0x0]['value']:undefined)||null},{'name':_0x57cb('0x59'),'value':_0x3540da[_0x57cb('0x59')]||(_0x3540da[_0x57cb('0x45')]&&_0x3540da[_0x57cb('0x45')][0x1]?_0x3540da['attrs'][0x1][_0x57cb('0x48')]:undefined)||0x0}];default:return[];}}catch(_0x274b5b){logger['error'](_0x57cb('0x5a'),JSON['stringify'](_0x274b5b));return[];}}exports[_0x57cb('0x5b')]=function(_0x262c20,_0x46f8ea){if(_0x262c20[_0x57cb('0x5c')]){_0x262c20[_0x57cb('0x5c')][_0x57cb('0x45')]=widgetAttributes(_0x262c20[_0x57cb('0x5c')]);}return db[_0x57cb('0x37')][_0x57cb('0x5b')](_0x262c20[_0x57cb('0x5c')],{})[_0x57cb('0x30')](respondWithResult(_0x46f8ea,0xc9))[_0x57cb('0x3f')](handleError(_0x46f8ea,null));};exports['update']=function(_0x1b9c78,_0x5d6bcf){if(_0x1b9c78[_0x57cb('0x5c')]['id']){delete _0x1b9c78[_0x57cb('0x5c')]['id'];}_0x1b9c78[_0x57cb('0x5c')]['attrs']=widgetAttributes(_0x1b9c78[_0x57cb('0x5c')]);return db[_0x57cb('0x37')]['find']({'where':{'id':_0x1b9c78[_0x57cb('0x41')]['id']}})[_0x57cb('0x30')](handleEntityNotFound(_0x5d6bcf,null))[_0x57cb('0x30')](saveUpdates(_0x1b9c78[_0x57cb('0x5c')],null))[_0x57cb('0x30')](respondWithResult(_0x5d6bcf,null))[_0x57cb('0x3f')](handleError(_0x5d6bcf,null));}; \ No newline at end of file +var _0xe062=['params','model','keys','query','filters','attributes','fields','length','includeAll','include','options','DashboardItem','catch','find','type','iframe','attrs','value','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show'];(function(_0x10d0bf,_0x5f3acb){var _0x2dabd4=function(_0x288ab9){while(--_0x288ab9){_0x10d0bf['push'](_0x10d0bf['shift']());}};_0x2dabd4(++_0x5f3acb);}(_0xe062,0xd5));var _0x2e06=function(_0x33d586,_0x375907){_0x33d586=_0x33d586-0x0;var _0x3c8911=_0xe062[_0x33d586];return _0x3c8911;};'use strict';var emlformat=require(_0x2e06('0x0'));var rimraf=require(_0x2e06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e06('0x2'));var rp=require(_0x2e06('0x3'));var moment=require(_0x2e06('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2e06('0x5'));var path=require(_0x2e06('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e06('0x7'));var fs=require('fs');var fs_extra=require(_0x2e06('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2e06('0x9'));var jsforce=require(_0x2e06('0xa'));var deskjs=require(_0x2e06('0xb'));var toCsv=require(_0x2e06('0xc'));var querystring=require(_0x2e06('0xd'));var Papa=require(_0x2e06('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2e06('0xf'));var as=require(_0x2e06('0x10'));var hardwareService=require(_0x2e06('0x11'));var logger=require('../../config/logger')(_0x2e06('0x12'));var utils=require(_0x2e06('0x13'));var config=require(_0x2e06('0x14'));var licenseUtil=require(_0x2e06('0x15'));var db=require('../../mysqldb')['db'];config[_0x2e06('0x16')]=_[_0x2e06('0x17')](config['redis'],{'host':_0x2e06('0x18'),'port':0x18eb});var socket=require(_0x2e06('0x19'))(new Redis(config['redis']));require(_0x2e06('0x1a'))[_0x2e06('0x1b')](socket);function respondWithStatusCode(_0x9a3ab4,_0x25909a){_0x25909a=_0x25909a||0xcc;return function(_0x3dfbee){if(_0x3dfbee){return _0x9a3ab4[_0x2e06('0x1c')](_0x25909a);}return _0x9a3ab4['status'](_0x25909a)[_0x2e06('0x1d')]();};}function respondWithResult(_0x330e5e,_0x210e11){_0x210e11=_0x210e11||0xc8;return function(_0x2ba1ed){if(_0x2ba1ed){return _0x330e5e[_0x2e06('0x1e')](_0x210e11)[_0x2e06('0x1f')](_0x2ba1ed);}};}function respondWithFilteredResult(_0x23da6b,_0xb67ba8){return function(_0x1418e4){if(_0x1418e4){var _0x4fd048=typeof _0xb67ba8[_0x2e06('0x20')]===_0x2e06('0x21')&&typeof _0xb67ba8['limit']===_0x2e06('0x21');var _0x173e14=_0x1418e4[_0x2e06('0x22')];var _0x202a20=_0x4fd048?0x0:_0xb67ba8[_0x2e06('0x20')];var _0x2b931f=_0x4fd048?_0x1418e4[_0x2e06('0x22')]:_0xb67ba8[_0x2e06('0x20')]+_0xb67ba8[_0x2e06('0x23')];var _0x223d24;if(_0x2b931f>=_0x173e14){_0x2b931f=_0x173e14;_0x223d24=0xc8;}else{_0x223d24=0xce;}_0x23da6b[_0x2e06('0x1e')](_0x223d24);return _0x23da6b[_0x2e06('0x24')](_0x2e06('0x25'),_0x202a20+'-'+_0x2b931f+'/'+_0x173e14)[_0x2e06('0x1f')](_0x1418e4);}return null;};}function patchUpdates(_0x27d028){return function(_0x38b5db){try{jsonpatch[_0x2e06('0x26')](_0x38b5db,_0x27d028,!![]);}catch(_0x22c571){return BPromise['reject'](_0x22c571);}return _0x38b5db[_0x2e06('0x27')]();};}function saveUpdates(_0x1c1e6f,_0x74e8e6){return function(_0x47120f){if(_0x47120f){return _0x47120f[_0x2e06('0x28')](_0x1c1e6f)[_0x2e06('0x29')](function(_0x73d502){return _0x73d502;});}return null;};}function removeEntity(_0x1ed50e,_0x202338){return function(_0x4a0dbc){if(_0x4a0dbc){return _0x4a0dbc[_0x2e06('0x2a')]()[_0x2e06('0x29')](function(){_0x1ed50e[_0x2e06('0x1e')](0xcc)[_0x2e06('0x1d')]();});}};}function handleEntityNotFound(_0xd54278,_0x5ca0e2){return function(_0x455bf3){if(!_0x455bf3){_0xd54278['sendStatus'](0x194);}return _0x455bf3;};}function handleError(_0x1ed86f,_0x258adf){_0x258adf=_0x258adf||0x1f4;return function(_0x577278){logger[_0x2e06('0x2b')](_0x577278[_0x2e06('0x2c')]);if(_0x577278[_0x2e06('0x2d')]){delete _0x577278['name'];}_0x1ed86f['status'](_0x258adf)[_0x2e06('0x2e')](_0x577278);};}exports[_0x2e06('0x2f')]=function(_0x11d757,_0x305316){var _0x394619={'raw':![],'where':{'id':_0x11d757[_0x2e06('0x30')]['id']}},_0x63e387={};_0x63e387[_0x2e06('0x31')]=_[_0x2e06('0x32')](db['DashboardItem']['rawAttributes']);_0x63e387['query']=_['keys'](_0x11d757[_0x2e06('0x33')]);_0x63e387[_0x2e06('0x34')]=_['intersection'](_0x63e387[_0x2e06('0x31')],_0x63e387[_0x2e06('0x33')]);_0x394619[_0x2e06('0x35')]=_['intersection'](_0x63e387[_0x2e06('0x31')],qs[_0x2e06('0x36')](_0x11d757['query'][_0x2e06('0x36')]));_0x394619[_0x2e06('0x35')]=_0x394619[_0x2e06('0x35')][_0x2e06('0x37')]?_0x394619['attributes']:_0x63e387[_0x2e06('0x31')];if(_0x11d757[_0x2e06('0x33')][_0x2e06('0x38')]){_0x394619[_0x2e06('0x39')]=[{'all':!![]}];}_0x394619=_['merge']({},_0x394619,_0x11d757[_0x2e06('0x3a')]);return db[_0x2e06('0x3b')]['find'](_0x394619)['then'](handleEntityNotFound(_0x305316,null))['then'](respondWithResult(_0x305316,null))[_0x2e06('0x3c')](handleError(_0x305316,null));};exports['destroy']=function(_0x5a0f36,_0x370235){return db[_0x2e06('0x3b')][_0x2e06('0x3d')]({'where':{'id':_0x5a0f36['params']['id']}})[_0x2e06('0x29')](handleEntityNotFound(_0x370235,null))['then'](removeEntity(_0x370235,null))[_0x2e06('0x3c')](handleError(_0x370235,null));};function widgetAttributes(_0x4c4174){try{switch(_0x4c4174[_0x2e06('0x3e')]){case _0x2e06('0x3f'):return[{'name':'attrUrl','value':_0x4c4174['attrUrl']||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x0]?_0x4c4174[_0x2e06('0x40')][0x0][_0x2e06('0x41')]:undefined)||'https://'}];case _0x2e06('0x42'):return[{'name':'attrPath','value':_0x4c4174['attrPath']||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174['attrs'][0x0]?_0x4c4174['attrs'][0x0][_0x2e06('0x41')]:undefined)||''}];case _0x2e06('0x43'):return[{'name':_0x2e06('0x44'),'value':_0x4c4174[_0x2e06('0x44')]||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x0]?_0x4c4174[_0x2e06('0x40')][0x0][_0x2e06('0x41')]:undefined)||_0x2e06('0x45')},{'name':_0x2e06('0x46'),'value':_0x4c4174['attrTimezone']||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x1]?_0x4c4174[_0x2e06('0x40')][0x1][_0x2e06('0x41')]:undefined)||_0x2e06('0x47')},{'name':'attrFontSize','value':_0x4c4174[_0x2e06('0x48')]||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174['attrs'][0x2]?_0x4c4174['attrs'][0x2][_0x2e06('0x41')]:undefined)||0xc}];case _0x2e06('0x49'):return[{'name':_0x2e06('0x4a'),'value':_0x4c4174[_0x2e06('0x4a')]||(_0x4c4174['attrs']&&_0x4c4174[_0x2e06('0x40')][0x0]?_0x4c4174['attrs'][0x0][_0x2e06('0x41')]:undefined)||'total'},{'name':_0x2e06('0x4b'),'value':_0x4c4174[_0x2e06('0x4b')]||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174['attrs'][0x1]?_0x4c4174[_0x2e06('0x40')][0x1][_0x2e06('0x41')]:undefined)||[]},{'name':'attrFontSize','value':_0x4c4174[_0x2e06('0x48')]||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x2]?_0x4c4174[_0x2e06('0x40')][0x2][_0x2e06('0x41')]:undefined)||0x14}];case'multibar-chart':case _0x2e06('0x4c'):return[{'name':_0x2e06('0x4d'),'value':_0x4c4174[_0x2e06('0x4d')]||(_0x4c4174['attrs']&&_0x4c4174[_0x2e06('0x40')][0x0]?_0x4c4174['attrs'][0x0][_0x2e06('0x41')]:undefined)||'total'},{'name':_0x2e06('0x4e'),'value':_0x4c4174['attrSerie2']||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x1]?_0x4c4174['attrs'][0x1][_0x2e06('0x41')]:undefined)||null},{'name':_0x2e06('0x4f'),'value':_0x4c4174[_0x2e06('0x4f')]||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x2]?_0x4c4174['attrs'][0x2][_0x2e06('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4c4174[_0x2e06('0x4b')]||(_0x4c4174['attrs']&&_0x4c4174[_0x2e06('0x40')][0x3]?_0x4c4174[_0x2e06('0x40')][0x3][_0x2e06('0x41')]:undefined)||[]}];case _0x2e06('0x50'):return[{'name':'attrReport','type':_0x4c4174[_0x2e06('0x51')]||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174['attrs'][0x0]?_0x4c4174['attrs'][0x0][_0x2e06('0x3e')]:undefined)||null,'value':_0x4c4174['attrReport']||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x0]?_0x4c4174['attrs'][0x0][_0x2e06('0x41')]:undefined)||null},{'name':_0x2e06('0x52'),'value':_0x4c4174[_0x2e06('0x52')]||(_0x4c4174[_0x2e06('0x40')]&&_0x4c4174[_0x2e06('0x40')][0x1]?_0x4c4174['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x222452){logger[_0x2e06('0x2b')](_0x2e06('0x53'),JSON[_0x2e06('0x54')](_0x222452));return[];}}exports['create']=function(_0x1d8bb8,_0x5ac11){if(_0x1d8bb8['body']){_0x1d8bb8[_0x2e06('0x55')][_0x2e06('0x40')]=widgetAttributes(_0x1d8bb8['body']);}return db['DashboardItem'][_0x2e06('0x56')](_0x1d8bb8[_0x2e06('0x55')],{})[_0x2e06('0x29')](respondWithResult(_0x5ac11,0xc9))[_0x2e06('0x3c')](handleError(_0x5ac11,null));};exports[_0x2e06('0x28')]=function(_0x545554,_0x511c92){if(_0x545554['body']['id']){delete _0x545554[_0x2e06('0x55')]['id'];}_0x545554[_0x2e06('0x55')][_0x2e06('0x40')]=widgetAttributes(_0x545554[_0x2e06('0x55')]);return db['DashboardItem']['find']({'where':{'id':_0x545554['params']['id']}})[_0x2e06('0x29')](handleEntityNotFound(_0x511c92,null))[_0x2e06('0x29')](saveUpdates(_0x545554['body'],null))[_0x2e06('0x29')](respondWithResult(_0x511c92,null))['catch'](handleError(_0x511c92,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 343f083..dd50ce3 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 _0xd16c=['update','remove','emit','exports','events','DashboardItem','setMaxListeners'];(function(_0xc9e08,_0x5da448){var _0x44a7c2=function(_0x598d91){while(--_0x598d91){_0xc9e08['push'](_0xc9e08['shift']());}};_0x44a7c2(++_0x5da448);}(_0xd16c,0xd6));var _0xcd16=function(_0x4c6736,_0x568075){_0x4c6736=_0x4c6736-0x0;var _0x3b9469=_0xd16c[_0x4c6736];return _0x3b9469;};'use strict';var EventEmitter=require(_0xcd16('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xcd16('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xcd16('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd16('0x3'),'afterDestroy':_0xcd16('0x4')};function emitEvent(_0x5ad7b3){return function(_0x5152f9,_0x47cb63,_0x3b06f5){DashboardItemEvents[_0xcd16('0x5')](_0x5ad7b3+':'+_0x5152f9['id'],_0x5152f9);DashboardItemEvents['emit'](_0x5ad7b3,_0x5152f9);_0x3b06f5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xcd16('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xb6f3=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d3b05,_0x334c57){var _0x2c6ca3=function(_0x3fd1cc){while(--_0x3fd1cc){_0x3d3b05['push'](_0x3d3b05['shift']());}};_0x2c6ca3(++_0x334c57);}(_0xb6f3,0x1c4));var _0x3b6f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb6f3[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require(_0x3b6f('0x0'));var DashboardItem=require(_0x3b6f('0x1'))['db'][_0x3b6f('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3b6f('0x3')](0x0);var events={'afterCreate':_0x3b6f('0x4'),'afterUpdate':_0x3b6f('0x5'),'afterDestroy':_0x3b6f('0x6')};function emitEvent(_0x5b1280){return function(_0x46e558,_0x349297,_0x115aa6){DashboardItemEvents[_0x3b6f('0x7')](_0x5b1280+':'+_0x46e558['id'],_0x46e558);DashboardItemEvents[_0x3b6f('0x7')](_0x5b1280,_0x46e558);_0x115aa6(null);};}for(var e in events){if(events[_0x3b6f('0x8')](e)){var event=events[e];DashboardItem[_0x3b6f('0x9')](e,emitEvent(event));}}module[_0x3b6f('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 05c7331..42bc102 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 _0x11a6=['../../config/environment','./dashboardItem.attributes','define','DashboardItem','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1dd6e7,_0x1cda2b){var _0xb53aa4=function(_0xd2ac7b){while(--_0xd2ac7b){_0x1dd6e7['push'](_0x1dd6e7['shift']());}};_0xb53aa4(++_0x1cda2b);}(_0x11a6,0x1c7));var _0x611a=function(_0x286907,_0x52ef7a){_0x286907=_0x286907-0x0;var _0x8b184d=_0x11a6[_0x286907];return _0x8b184d;};'use strict';var _=require(_0x611a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x611a('0x1'));var moment=require(_0x611a('0x2'));var BPromise=require(_0x611a('0x3'));var rp=require(_0x611a('0x4'));var fs=require('fs');var path=require(_0x611a('0x5'));var rimraf=require(_0x611a('0x6'));var config=require(_0x611a('0x7'));var attributes=require(_0x611a('0x8'));module['exports']=function(_0x2a0bfb,_0x28f1fd){return _0x2a0bfb[_0x611a('0x9')](_0x611a('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f79=['../../config/environment','exports','define','dashboard_items','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f79,0x1d2));var _0x94f7=function(_0x22f1a7,_0x36fc2c){_0x22f1a7=_0x22f1a7-0x0;var _0x150144=_0x4f79[_0x22f1a7];return _0x150144;};'use strict';var _=require(_0x94f7('0x0'));var util=require(_0x94f7('0x1'));var logger=require('../../config/logger')(_0x94f7('0x2'));var moment=require(_0x94f7('0x3'));var BPromise=require(_0x94f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94f7('0x5'));var rimraf=require(_0x94f7('0x6'));var config=require(_0x94f7('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x94f7('0x8')]=function(_0x30bae8,_0x4314b2){return _0x30bae8[_0x94f7('0x9')]('DashboardItem',attributes,{'tableName':_0x94f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 943840b..6c277b2 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 _0xfb64=['localhost','socket.io-emitter','request','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults'];(function(_0x2277ab,_0x304a34){var _0xc520fc=function(_0x28104c){while(--_0x28104c){_0x2277ab['push'](_0x2277ab['shift']());}};_0xc520fc(++_0x304a34);}(_0xfb64,0xee));var _0x4fb6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfb64[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4fb6('0x0'));var util=require(_0x4fb6('0x1'));var moment=require('moment');var BPromise=require(_0x4fb6('0x2'));var rs=require(_0x4fb6('0x3'));var fs=require('fs');var Redis=require(_0x4fb6('0x4'));var db=require(_0x4fb6('0x5'))['db'];var utils=require(_0x4fb6('0x6'));var logger=require(_0x4fb6('0x7'))('rpc');var config=require(_0x4fb6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4fb6('0x9')]['http']({'port':0x232a});config[_0x4fb6('0xa')]=_[_0x4fb6('0xb')](config[_0x4fb6('0xa')],{'host':_0x4fb6('0xc'),'port':0x18eb});var socket=require(_0x4fb6('0xd'))(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x4a7edc,_0x1424b3,_0x316c94){return new BPromise(function(_0x3ab7cc,_0x2904f7){return client[_0x4fb6('0xe')](_0x4a7edc,_0x316c94)['then'](function(_0x54b0ee){logger[_0x4fb6('0xf')]('DashboardItem,\x20%s,\x20%s',_0x1424b3,'request\x20sent');logger[_0x4fb6('0x10')](_0x4fb6('0x11'),_0x1424b3,_0x4fb6('0x12'),JSON[_0x4fb6('0x13')](_0x54b0ee));if(_0x54b0ee[_0x4fb6('0x14')]){if(_0x54b0ee['error'][_0x4fb6('0x15')]===0x1f4){logger[_0x4fb6('0x14')]('DashboardItem,\x20%s,\x20%s',_0x1424b3,_0x54b0ee[_0x4fb6('0x14')][_0x4fb6('0x16')]);return _0x2904f7(_0x54b0ee[_0x4fb6('0x14')]['message']);}logger[_0x4fb6('0x14')](_0x4fb6('0x17'),_0x1424b3,_0x54b0ee[_0x4fb6('0x14')][_0x4fb6('0x16')]);return _0x3ab7cc(_0x54b0ee[_0x4fb6('0x14')][_0x4fb6('0x16')]);}else{logger['info'](_0x4fb6('0x17'),_0x1424b3,'request\x20sent');_0x3ab7cc(_0x54b0ee['result'][_0x4fb6('0x16')]);}})[_0x4fb6('0x18')](function(_0x145f17){logger[_0x4fb6('0x14')](_0x4fb6('0x17'),_0x1424b3,_0x145f17);_0x2904f7(_0x145f17);});});} \ No newline at end of file +var _0x10a9=['socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x64408f,_0x569d16){var _0x536de3=function(_0x2a4cb3){while(--_0x2a4cb3){_0x64408f['push'](_0x64408f['shift']());}};_0x536de3(++_0x569d16);}(_0x10a9,0x141));var _0x910a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x10a9[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x910a('0x0'));var util=require(_0x910a('0x1'));var moment=require(_0x910a('0x2'));var BPromise=require('bluebird');var rs=require(_0x910a('0x3'));var fs=require('fs');var Redis=require(_0x910a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x910a('0x5'));var logger=require(_0x910a('0x6'))(_0x910a('0x7'));var config=require(_0x910a('0x8'));var jayson=require(_0x910a('0x9'));var client=jayson[_0x910a('0xa')][_0x910a('0xb')]({'port':0x232a});config[_0x910a('0xc')]=_[_0x910a('0xd')](config[_0x910a('0xc')],{'host':_0x910a('0xe'),'port':0x18eb});var socket=require(_0x910a('0xf'))(new Redis(config[_0x910a('0xc')]));require('./dashboardItem.socket')[_0x910a('0x10')](socket);function respondWithRpcPromise(_0x12bd55,_0x2f433d,_0x583bb4){return new BPromise(function(_0x261f2e,_0x39ca14){return client[_0x910a('0x11')](_0x12bd55,_0x583bb4)[_0x910a('0x12')](function(_0x43d1f4){logger[_0x910a('0x13')](_0x910a('0x14'),_0x2f433d,'request\x20sent');logger[_0x910a('0x15')](_0x910a('0x16'),_0x2f433d,_0x910a('0x17'),JSON['stringify'](_0x43d1f4));if(_0x43d1f4[_0x910a('0x18')]){if(_0x43d1f4[_0x910a('0x18')][_0x910a('0x19')]===0x1f4){logger['error'](_0x910a('0x14'),_0x2f433d,_0x43d1f4[_0x910a('0x18')][_0x910a('0x1a')]);return _0x39ca14(_0x43d1f4['error'][_0x910a('0x1a')]);}logger['error'](_0x910a('0x14'),_0x2f433d,_0x43d1f4[_0x910a('0x18')]['message']);return _0x261f2e(_0x43d1f4[_0x910a('0x18')][_0x910a('0x1a')]);}else{logger[_0x910a('0x13')](_0x910a('0x14'),_0x2f433d,_0x910a('0x17'));_0x261f2e(_0x43d1f4['result'][_0x910a('0x1a')]);}})[_0x910a('0x1b')](function(_0xc4a7aa){logger[_0x910a('0x18')](_0x910a('0x14'),_0x2f433d,_0xc4a7aa);_0x39ca14(_0xc4a7aa);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index bce43c2..a510073 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 _0x8988=['emit','register','save','remove','update'];(function(_0x347d0b,_0x165d23){var _0x5aaa6b=function(_0x31ad63){while(--_0x31ad63){_0x347d0b['push'](_0x347d0b['shift']());}};_0x5aaa6b(++_0x165d23);}(_0x8988,0x70));var _0x8898=function(_0x10d478,_0x34a8ef){_0x10d478=_0x10d478-0x0;var _0x55df1c=_0x8988[_0x10d478];return _0x55df1c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x8898('0x0'),_0x8898('0x1'),_0x8898('0x2')];function createListener(_0x2aec98,_0x2fc38a){return function(_0x4d8d21){_0x2fc38a[_0x8898('0x3')](_0x2aec98,_0x4d8d21);};}function removeListener(_0x15c9a2,_0x415066){return function(){DashboardItemEvents['removeListener'](_0x15c9a2,_0x415066);};}exports[_0x8898('0x4')]=function(_0x505104){for(var _0x5eb3d7=0x0,_0x1f13be=events['length'];_0x5eb3d7<_0x1f13be;_0x5eb3d7++){var _0x300821=events[_0x5eb3d7];var _0x4c0702=createListener('dashboardItem:'+_0x300821,_0x505104);DashboardItemEvents['on'](_0x300821,_0x4c0702);}}; \ No newline at end of file +var _0x32e3=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','register','length'];(function(_0x293081,_0x7bf4f7){var _0x10516b=function(_0x5a27ba){while(--_0x5a27ba){_0x293081['push'](_0x293081['shift']());}};_0x10516b(++_0x7bf4f7);}(_0x32e3,0x181));var _0x332e=function(_0x424a60,_0x192bd0){_0x424a60=_0x424a60-0x0;var _0x490ab1=_0x32e3[_0x424a60];return _0x490ab1;};'use strict';var DashboardItemEvents=require(_0x332e('0x0'));var events=[_0x332e('0x1'),_0x332e('0x2'),_0x332e('0x3')];function createListener(_0x130b7d,_0x3e2506){return function(_0x48dc75){_0x3e2506[_0x332e('0x4')](_0x130b7d,_0x48dc75);};}function removeListener(_0x446f4c,_0x23f290){return function(){DashboardItemEvents['removeListener'](_0x446f4c,_0x23f290);};}exports[_0x332e('0x5')]=function(_0x4acea9){for(var _0x2d878b=0x0,_0x5c6726=events[_0x332e('0x6')];_0x2d878b<_0x5c6726;_0x2d878b++){var _0x396c7e=events[_0x2d878b];var _0x19f75d=createListener(_0x332e('0x7')+_0x396c7e,_0x4acea9);DashboardItemEvents['on'](_0x396c7e,_0x19f75d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 79231e0..af118d9 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 _0x6501=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put','update','destroy'];(function(_0x4e2e2f,_0xf9657b){var _0x296b97=function(_0x3e89c5){while(--_0x3e89c5){_0x4e2e2f['push'](_0x4e2e2f['shift']());}};_0x296b97(++_0xf9657b);}(_0x6501,0xa3));var _0x1650=function(_0x3ee1fe,_0xc8f366){_0x3ee1fe=_0x3ee1fe-0x0;var _0x8c8a41=_0x6501[_0x3ee1fe];return _0x8c8a41;};'use strict';var multer=require(_0x1650('0x0'));var util=require('util');var path=require(_0x1650('0x1'));var timeout=require(_0x1650('0x2'));var express=require(_0x1650('0x3'));var router=express[_0x1650('0x4')]();var fs_extra=require(_0x1650('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1650('0x6'));var config=require(_0x1650('0x7'));var controller=require(_0x1650('0x8'));router[_0x1650('0x9')](_0x1650('0xa'),auth[_0x1650('0xb')](),controller[_0x1650('0xc')]);router[_0x1650('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1650('0xe')](_0x1650('0xa'),auth[_0x1650('0xb')](),controller[_0x1650('0xf')]);router['delete'](_0x1650('0xa'),auth[_0x1650('0xb')](),controller[_0x1650('0x10')]);module[_0x1650('0x11')]=router; \ No newline at end of file +var _0x5907=['../../config/environment','./dashboardItem.controller','get','show','post','isAuthenticated','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5907,0x6b));var _0x7590=function(_0x4dc274,_0x380b50){_0x4dc274=_0x4dc274-0x0;var _0x4d6159=_0x5907[_0x4dc274];return _0x4d6159;};'use strict';var multer=require('multer');var util=require(_0x7590('0x0'));var path=require(_0x7590('0x1'));var timeout=require(_0x7590('0x2'));var express=require(_0x7590('0x3'));var router=express[_0x7590('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7590('0x5'));var interaction=require(_0x7590('0x6'));var config=require(_0x7590('0x7'));var controller=require(_0x7590('0x8'));router[_0x7590('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7590('0xa')]);router[_0x7590('0xb')]('/',auth[_0x7590('0xc')](),controller[_0x7590('0xd')]);router['put'](_0x7590('0xe'),auth[_0x7590('0xc')](),controller[_0x7590('0xf')]);router[_0x7590('0x10')](_0x7590('0xe'),auth['isAuthenticated'](),controller[_0x7590('0x11')]);module[_0x7590('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index ac10f6b..604a31c 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 _0xc54c=['third','sequelize','exports','STRING','ENUM','first','second'];(function(_0x389640,_0x5dcf62){var _0x45897b=function(_0x440a14){while(--_0x440a14){_0x389640['push'](_0x389640['shift']());}};_0x45897b(++_0x5dcf62);}(_0xc54c,0xda));var _0xcc54=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xc54c[_0x204ad4];return _0x50675f;};'use strict';var Sequelize=require(_0xcc54('0x0'));module[_0xcc54('0x1')]={'name':{'type':Sequelize[_0xcc54('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xcc54('0x3')](_0xcc54('0x4'),_0xcc54('0x5'),_0xcc54('0x6')),'allowNull':![],'defaultValue':_0xcc54('0x4')},'description':{'type':Sequelize[_0xcc54('0x2')]}}; \ No newline at end of file +var _0x0189=['exports','STRING','second','first'];(function(_0x2607b9,_0x1476b7){var _0x115ca6=function(_0x231976){while(--_0x231976){_0x2607b9['push'](_0x2607b9['shift']());}};_0x115ca6(++_0x1476b7);}(_0x0189,0x17c));var _0x9018=function(_0x552dcc,_0x44a4c4){_0x552dcc=_0x552dcc-0x0;var _0x2c8119=_0x0189[_0x552dcc];return _0x2c8119;};'use strict';var Sequelize=require('sequelize');module[_0x9018('0x0')]={'name':{'type':Sequelize[_0x9018('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x9018('0x2'),'third'),'allowNull':![],'defaultValue':_0x9018('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index f0a44c9..5646feb 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 _0x3658=['undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x123d61,_0x2eee74){var _0x1f5248=function(_0x4f400c){while(--_0x4f400c){_0x123d61['push'](_0x123d61['shift']());}};_0x1f5248(++_0x2eee74);}(_0x3658,0x133));var _0x8365=function(_0x163b00,_0x1caf5b){_0x163b00=_0x163b00-0x0;var _0x50c8c3=_0x3658[_0x163b00];return _0x50c8c3;};'use strict';var emlformat=require(_0x8365('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8365('0x1'));var jsonpatch=require(_0x8365('0x2'));var rp=require(_0x8365('0x3'));var moment=require(_0x8365('0x4'));var BPromise=require(_0x8365('0x5'));var Mustache=require('mustache');var util=require(_0x8365('0x6'));var path=require(_0x8365('0x7'));var sox=require(_0x8365('0x8'));var csv=require(_0x8365('0x9'));var ejs=require(_0x8365('0xa'));var fs=require('fs');var fs_extra=require(_0x8365('0xb'));var _=require(_0x8365('0xc'));var squel=require(_0x8365('0xd'));var crypto=require('crypto');var jsforce=require(_0x8365('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8365('0x9'));var querystring=require(_0x8365('0xf'));var Papa=require(_0x8365('0x10'));var Redis=require(_0x8365('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8365('0x12'));var hardwareService=require(_0x8365('0x13'));var logger=require(_0x8365('0x14'))('api');var utils=require(_0x8365('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8365('0x16'));var db=require(_0x8365('0x17'))['db'];function respondWithStatusCode(_0x11d763,_0x419f69){_0x419f69=_0x419f69||0xcc;return function(_0x463cf4){if(_0x463cf4){return _0x11d763[_0x8365('0x18')](_0x419f69);}return _0x11d763[_0x8365('0x19')](_0x419f69)[_0x8365('0x1a')]();};}function respondWithResult(_0x1f91ab,_0x5a4910){_0x5a4910=_0x5a4910||0xc8;return function(_0x8073d6){if(_0x8073d6){return _0x1f91ab[_0x8365('0x19')](_0x5a4910)[_0x8365('0x1b')](_0x8073d6);}};}function respondWithFilteredResult(_0x3cee42,_0x54c04b){return function(_0x712e18){if(_0x712e18){var _0x2eaa1d=typeof _0x54c04b[_0x8365('0x1c')]===_0x8365('0x1d')&&typeof _0x54c04b[_0x8365('0x1e')]==='undefined';var _0x1774d9=_0x712e18['count'];var _0x4f5e8a=_0x2eaa1d?0x0:_0x54c04b[_0x8365('0x1c')];var _0x1ded91=_0x2eaa1d?_0x712e18['count']:_0x54c04b[_0x8365('0x1c')]+_0x54c04b['limit'];var _0x28cd72;if(_0x1ded91>=_0x1774d9){_0x1ded91=_0x1774d9;_0x28cd72=0xc8;}else{_0x28cd72=0xce;}_0x3cee42['status'](_0x28cd72);return _0x3cee42[_0x8365('0x1f')](_0x8365('0x20'),_0x4f5e8a+'-'+_0x1ded91+'/'+_0x1774d9)[_0x8365('0x1b')](_0x712e18);}return null;};}function patchUpdates(_0x47ee37){return function(_0x3ccb89){try{jsonpatch[_0x8365('0x21')](_0x3ccb89,_0x47ee37,!![]);}catch(_0x2b544a){return BPromise[_0x8365('0x22')](_0x2b544a);}return _0x3ccb89[_0x8365('0x23')]();};}function saveUpdates(_0x144797,_0x464bbb){return function(_0x3639de){if(_0x3639de){return _0x3639de[_0x8365('0x24')](_0x144797)[_0x8365('0x25')](function(_0x7678e2){return _0x7678e2;});}return null;};}function removeEntity(_0x5a4109,_0x146bae){return function(_0x5ec466){if(_0x5ec466){return _0x5ec466[_0x8365('0x26')]()[_0x8365('0x25')](function(){var _0x53020e=_0x5ec466[_0x8365('0x27')]({'plain':!![]});var _0x42a08c=_0x8365('0x28');return db[_0x8365('0x29')][_0x8365('0x26')]({'where':{'type':_0x42a08c,'resourceId':_0x53020e['id']}})[_0x8365('0x25')](function(){return _0x5ec466;});})['then'](function(){_0x5a4109[_0x8365('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49767e,_0x4dcb67){return function(_0x21532e){if(!_0x21532e){_0x49767e[_0x8365('0x18')](0x194);}return _0x21532e;};}function handleError(_0x2d93ab,_0x14f318){_0x14f318=_0x14f318||0x1f4;return function(_0x6c9398){logger[_0x8365('0x2a')](_0x6c9398[_0x8365('0x2b')]);if(_0x6c9398[_0x8365('0x2c')]){delete _0x6c9398['name'];}_0x2d93ab[_0x8365('0x19')](_0x14f318)[_0x8365('0x2d')](_0x6c9398);};}exports[_0x8365('0x2e')]=function(_0x2ebd77,_0x2a62cd){var _0x42baf2={},_0x3b5759={},_0x567022={'count':0x0,'rows':[]};var _0x511c9a=_[_0x8365('0x2f')](db[_0x8365('0x30')][_0x8365('0x31')],function(_0x3a167d){return{'name':_0x3a167d[_0x8365('0x32')],'type':_0x3a167d['type'][_0x8365('0x33')]};});_0x3b5759[_0x8365('0x34')]=_['map'](_0x511c9a,_0x8365('0x2c'));_0x3b5759['query']=_[_0x8365('0x35')](_0x2ebd77['query']);_0x3b5759[_0x8365('0x36')]=_[_0x8365('0x37')](_0x3b5759[_0x8365('0x34')],_0x3b5759[_0x8365('0x38')]);_0x42baf2[_0x8365('0x39')]=_[_0x8365('0x37')](_0x3b5759[_0x8365('0x34')],qs[_0x8365('0x3a')](_0x2ebd77['query'][_0x8365('0x3a')]));_0x42baf2['attributes']=_0x42baf2[_0x8365('0x39')]['length']?_0x42baf2[_0x8365('0x39')]:_0x3b5759['model'];if(!_0x2ebd77[_0x8365('0x38')][_0x8365('0x3b')](_0x8365('0x3c'))){_0x42baf2[_0x8365('0x1e')]=qs[_0x8365('0x1e')](_0x2ebd77[_0x8365('0x38')][_0x8365('0x1e')]);_0x42baf2[_0x8365('0x1c')]=qs[_0x8365('0x1c')](_0x2ebd77[_0x8365('0x38')][_0x8365('0x1c')]);}_0x42baf2['order']=qs[_0x8365('0x3d')](_0x2ebd77[_0x8365('0x38')][_0x8365('0x3d')]);_0x42baf2[_0x8365('0x3e')]=qs['filters'](_[_0x8365('0x3f')](_0x2ebd77['query'],_0x3b5759[_0x8365('0x36')]),_0x511c9a);if(_0x2ebd77['query'][_0x8365('0x40')]){_0x42baf2[_0x8365('0x3e')]=_[_0x8365('0x41')](_0x42baf2['where'],{'$or':_[_0x8365('0x2f')](_0x511c9a,function(_0x39b08a){if(_0x39b08a[_0x8365('0x42')]!==_0x8365('0x43')){var _0x2531b3={};_0x2531b3[_0x39b08a[_0x8365('0x2c')]]={'$like':'%'+_0x2ebd77[_0x8365('0x38')]['filter']+'%'};return _0x2531b3;}})});}_0x42baf2=_[_0x8365('0x41')]({},_0x42baf2,_0x2ebd77[_0x8365('0x44')]);var _0x4472be={'where':_0x42baf2['where']};return db[_0x8365('0x30')][_0x8365('0x45')](_0x4472be)['then'](function(_0x271f15){_0x567022[_0x8365('0x45')]=_0x271f15;if(_0x2ebd77['query'][_0x8365('0x46')]){_0x42baf2['include']=[{'all':!![]}];}return db[_0x8365('0x30')][_0x8365('0x47')](_0x42baf2);})[_0x8365('0x25')](function(_0xdd47a1){_0x567022[_0x8365('0x48')]=_0xdd47a1;return _0x567022;})['then'](respondWithFilteredResult(_0x2a62cd,_0x42baf2))['catch'](handleError(_0x2a62cd,null));};exports[_0x8365('0x49')]=function(_0x3dee9c,_0x4c4ecc){var _0x1bba97={'raw':!![],'where':{'id':_0x3dee9c['params']['id']}},_0x400645={};_0x400645[_0x8365('0x34')]=_[_0x8365('0x35')](db[_0x8365('0x30')]['rawAttributes']);_0x400645[_0x8365('0x38')]=_['keys'](_0x3dee9c[_0x8365('0x38')]);_0x400645[_0x8365('0x36')]=_[_0x8365('0x37')](_0x400645[_0x8365('0x34')],_0x400645[_0x8365('0x38')]);_0x1bba97[_0x8365('0x39')]=_['intersection'](_0x400645[_0x8365('0x34')],qs[_0x8365('0x3a')](_0x3dee9c[_0x8365('0x38')][_0x8365('0x3a')]));_0x1bba97[_0x8365('0x39')]=_0x1bba97['attributes']['length']?_0x1bba97[_0x8365('0x39')]:_0x400645[_0x8365('0x34')];if(_0x3dee9c['query']['includeAll']){_0x1bba97[_0x8365('0x4a')]=[{'all':!![]}];}_0x1bba97=_['merge']({},_0x1bba97,_0x3dee9c[_0x8365('0x44')]);return db[_0x8365('0x30')][_0x8365('0x4b')](_0x1bba97)['then'](handleEntityNotFound(_0x4c4ecc,null))[_0x8365('0x25')](respondWithResult(_0x4c4ecc,null))[_0x8365('0x4c')](handleError(_0x4c4ecc,null));};exports[_0x8365('0x4d')]=function(_0xa87cf2,_0x523afc){return db['Disposition'][_0x8365('0x4d')](_0xa87cf2[_0x8365('0x4e')],{})[_0x8365('0x25')](function(_0x2c356b){var _0xa0fd1b=_0xa87cf2[_0x8365('0x4f')][_0x8365('0x27')]({'plain':!![]});if(!_0xa0fd1b)throw new Error(_0x8365('0x50'));if(_0xa0fd1b[_0x8365('0x51')]===_0x8365('0x4f')){var _0x536e55=_0x2c356b[_0x8365('0x27')]({'plain':!![]});var _0x192c97=_0x8365('0x28');return db['UserProfileSection'][_0x8365('0x4b')]({'where':{'name':_0x192c97,'userProfileId':_0xa0fd1b['userProfileId']},'raw':!![]})['then'](function(_0xad66b5){if(_0xad66b5&&_0xad66b5[_0x8365('0x52')]===0x0){return db[_0x8365('0x29')]['create']({'name':_0x536e55[_0x8365('0x2c')],'resourceId':_0x536e55['id'],'type':_0xad66b5[_0x8365('0x2c')],'sectionId':_0xad66b5['id']},{})[_0x8365('0x25')](function(){return _0x2c356b;});}else{return _0x2c356b;}})[_0x8365('0x4c')](function(_0x427716){logger[_0x8365('0x2a')](_0x8365('0x53'),_0x427716);throw _0x427716;});}return _0x2c356b;})[_0x8365('0x25')](respondWithResult(_0x523afc,0xc9))['catch'](handleError(_0x523afc,null));};exports['update']=function(_0x4f9fba,_0x57d8aa){if(_0x4f9fba[_0x8365('0x4e')]['id']){delete _0x4f9fba[_0x8365('0x4e')]['id'];}return db[_0x8365('0x30')][_0x8365('0x4b')]({'where':{'id':_0x4f9fba['params']['id']}})[_0x8365('0x25')](handleEntityNotFound(_0x57d8aa,null))[_0x8365('0x25')](saveUpdates(_0x4f9fba[_0x8365('0x4e')],null))[_0x8365('0x25')](respondWithResult(_0x57d8aa,null))[_0x8365('0x4c')](handleError(_0x57d8aa,null));};exports[_0x8365('0x26')]=function(_0x2128a7,_0x4ec93a){return db[_0x8365('0x30')][_0x8365('0x4b')]({'where':{'id':_0x2128a7['params']['id']}})[_0x8365('0x25')](handleEntityNotFound(_0x4ec93a,null))['then'](removeEntity(_0x4ec93a,null))['catch'](handleError(_0x4ec93a,null));}; \ No newline at end of file +var _0x90c5=['where','VIRTUAL','include','rows','catch','show','params','keys','merge','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Dispositions','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','then','UserProfileResource','destroy','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters'];(function(_0x3e859b,_0x1927c3){var _0x2e44c7=function(_0x155f0c){while(--_0x155f0c){_0x3e859b['push'](_0x3e859b['shift']());}};_0x2e44c7(++_0x1927c3);}(_0x90c5,0x17e));var _0x590c=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x90c5[_0x283127];return _0x43da5d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x590c('0x0'));var jsonpatch=require(_0x590c('0x1'));var rp=require(_0x590c('0x2'));var moment=require(_0x590c('0x3'));var BPromise=require(_0x590c('0x4'));var Mustache=require(_0x590c('0x5'));var util=require(_0x590c('0x6'));var path=require(_0x590c('0x7'));var sox=require(_0x590c('0x8'));var csv=require('to-csv');var ejs=require(_0x590c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x590c('0xa'));var squel=require(_0x590c('0xb'));var crypto=require('crypto');var jsforce=require(_0x590c('0xc'));var deskjs=require(_0x590c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x590c('0xe'));var Redis=require('ioredis');var authService=require(_0x590c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x590c('0x10'));var logger=require('../../config/logger')(_0x590c('0x11'));var utils=require(_0x590c('0x12'));var config=require(_0x590c('0x13'));var licenseUtil=require(_0x590c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31cd51,_0x4d1d35){_0x4d1d35=_0x4d1d35||0xcc;return function(_0x6e23b1){if(_0x6e23b1){return _0x31cd51[_0x590c('0x15')](_0x4d1d35);}return _0x31cd51[_0x590c('0x16')](_0x4d1d35)[_0x590c('0x17')]();};}function respondWithResult(_0x51862a,_0x4eb87f){_0x4eb87f=_0x4eb87f||0xc8;return function(_0x56b3f6){if(_0x56b3f6){return _0x51862a[_0x590c('0x16')](_0x4eb87f)['json'](_0x56b3f6);}};}function respondWithFilteredResult(_0xd35fb,_0x3edd0a){return function(_0x26fb48){if(_0x26fb48){var _0x7fc561=typeof _0x3edd0a[_0x590c('0x18')]===_0x590c('0x19')&&typeof _0x3edd0a['limit']===_0x590c('0x19');var _0x4e1ff1=_0x26fb48[_0x590c('0x1a')];var _0x2ce962=_0x7fc561?0x0:_0x3edd0a[_0x590c('0x18')];var _0x4ad18a=_0x7fc561?_0x26fb48['count']:_0x3edd0a['offset']+_0x3edd0a['limit'];var _0x3930b9;if(_0x4ad18a>=_0x4e1ff1){_0x4ad18a=_0x4e1ff1;_0x3930b9=0xc8;}else{_0x3930b9=0xce;}_0xd35fb[_0x590c('0x16')](_0x3930b9);return _0xd35fb['set'](_0x590c('0x1b'),_0x2ce962+'-'+_0x4ad18a+'/'+_0x4e1ff1)[_0x590c('0x1c')](_0x26fb48);}return null;};}function patchUpdates(_0x7d91d){return function(_0xa60edd){try{jsonpatch[_0x590c('0x1d')](_0xa60edd,_0x7d91d,!![]);}catch(_0x2e9dfa){return BPromise[_0x590c('0x1e')](_0x2e9dfa);}return _0xa60edd['save']();};}function saveUpdates(_0x577d6b,_0xa5e54b){return function(_0x323439){if(_0x323439){return _0x323439[_0x590c('0x1f')](_0x577d6b)[_0x590c('0x20')](function(_0x6ac0f5){return _0x6ac0f5;});}return null;};}function removeEntity(_0x4629f1,_0x1a874d){return function(_0x4c9804){if(_0x4c9804){return _0x4c9804['destroy']()[_0x590c('0x20')](function(){var _0x416752=_0x4c9804['get']({'plain':!![]});var _0x37aca5='Dispositions';return db[_0x590c('0x21')][_0x590c('0x22')]({'where':{'type':_0x37aca5,'resourceId':_0x416752['id']}})[_0x590c('0x20')](function(){return _0x4c9804;});})[_0x590c('0x20')](function(){_0x4629f1['status'](0xcc)[_0x590c('0x17')]();});}};}function handleEntityNotFound(_0x253760,_0x2dad5a){return function(_0x3fce55){if(!_0x3fce55){_0x253760[_0x590c('0x15')](0x194);}return _0x3fce55;};}function handleError(_0x3bbe65,_0xd23eac){_0xd23eac=_0xd23eac||0x1f4;return function(_0x3acf45){logger['error'](_0x3acf45[_0x590c('0x23')]);if(_0x3acf45['name']){delete _0x3acf45[_0x590c('0x24')];}_0x3bbe65['status'](_0xd23eac)[_0x590c('0x25')](_0x3acf45);};}exports[_0x590c('0x26')]=function(_0x32e2f4,_0x28e561){var _0x4e1c04={},_0x12de4f={},_0x1a87f0={'count':0x0,'rows':[]};var _0x2e3208=_[_0x590c('0x27')](db[_0x590c('0x28')][_0x590c('0x29')],function(_0x3d1c40){return{'name':_0x3d1c40['fieldName'],'type':_0x3d1c40[_0x590c('0x2a')][_0x590c('0x2b')]};});_0x12de4f[_0x590c('0x2c')]=_[_0x590c('0x27')](_0x2e3208,_0x590c('0x24'));_0x12de4f[_0x590c('0x2d')]=_['keys'](_0x32e2f4[_0x590c('0x2d')]);_0x12de4f['filters']=_[_0x590c('0x2e')](_0x12de4f[_0x590c('0x2c')],_0x12de4f[_0x590c('0x2d')]);_0x4e1c04[_0x590c('0x2f')]=_[_0x590c('0x2e')](_0x12de4f['model'],qs[_0x590c('0x30')](_0x32e2f4[_0x590c('0x2d')][_0x590c('0x30')]));_0x4e1c04[_0x590c('0x2f')]=_0x4e1c04['attributes'][_0x590c('0x31')]?_0x4e1c04[_0x590c('0x2f')]:_0x12de4f[_0x590c('0x2c')];if(!_0x32e2f4[_0x590c('0x2d')][_0x590c('0x32')](_0x590c('0x33'))){_0x4e1c04['limit']=qs['limit'](_0x32e2f4['query'][_0x590c('0x34')]);_0x4e1c04[_0x590c('0x18')]=qs[_0x590c('0x18')](_0x32e2f4[_0x590c('0x2d')][_0x590c('0x18')]);}_0x4e1c04[_0x590c('0x35')]=qs['sort'](_0x32e2f4['query'][_0x590c('0x36')]);_0x4e1c04['where']=qs[_0x590c('0x37')](_['pick'](_0x32e2f4[_0x590c('0x2d')],_0x12de4f[_0x590c('0x37')]),_0x2e3208);if(_0x32e2f4[_0x590c('0x2d')]['filter']){_0x4e1c04[_0x590c('0x38')]=_['merge'](_0x4e1c04[_0x590c('0x38')],{'$or':_[_0x590c('0x27')](_0x2e3208,function(_0x1e6265){if(_0x1e6265[_0x590c('0x2a')]!==_0x590c('0x39')){var _0x5dfdbf={};_0x5dfdbf[_0x1e6265[_0x590c('0x24')]]={'$like':'%'+_0x32e2f4[_0x590c('0x2d')]['filter']+'%'};return _0x5dfdbf;}})});}_0x4e1c04=_['merge']({},_0x4e1c04,_0x32e2f4['options']);var _0x18f545={'where':_0x4e1c04[_0x590c('0x38')]};return db[_0x590c('0x28')][_0x590c('0x1a')](_0x18f545)['then'](function(_0x4a14fb){_0x1a87f0['count']=_0x4a14fb;if(_0x32e2f4[_0x590c('0x2d')]['includeAll']){_0x4e1c04[_0x590c('0x3a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4e1c04);})[_0x590c('0x20')](function(_0x3d21ee){_0x1a87f0[_0x590c('0x3b')]=_0x3d21ee;return _0x1a87f0;})['then'](respondWithFilteredResult(_0x28e561,_0x4e1c04))[_0x590c('0x3c')](handleError(_0x28e561,null));};exports[_0x590c('0x3d')]=function(_0x5b5f2a,_0x50956b){var _0x171c21={'raw':!![],'where':{'id':_0x5b5f2a[_0x590c('0x3e')]['id']}},_0x1dc62b={};_0x1dc62b[_0x590c('0x2c')]=_['keys'](db[_0x590c('0x28')][_0x590c('0x29')]);_0x1dc62b[_0x590c('0x2d')]=_[_0x590c('0x3f')](_0x5b5f2a[_0x590c('0x2d')]);_0x1dc62b[_0x590c('0x37')]=_[_0x590c('0x2e')](_0x1dc62b[_0x590c('0x2c')],_0x1dc62b[_0x590c('0x2d')]);_0x171c21[_0x590c('0x2f')]=_[_0x590c('0x2e')](_0x1dc62b['model'],qs[_0x590c('0x30')](_0x5b5f2a[_0x590c('0x2d')]['fields']));_0x171c21[_0x590c('0x2f')]=_0x171c21['attributes'][_0x590c('0x31')]?_0x171c21['attributes']:_0x1dc62b[_0x590c('0x2c')];if(_0x5b5f2a[_0x590c('0x2d')]['includeAll']){_0x171c21[_0x590c('0x3a')]=[{'all':!![]}];}_0x171c21=_[_0x590c('0x40')]({},_0x171c21,_0x5b5f2a['options']);return db[_0x590c('0x28')]['find'](_0x171c21)[_0x590c('0x20')](handleEntityNotFound(_0x50956b,null))[_0x590c('0x20')](respondWithResult(_0x50956b,null))[_0x590c('0x3c')](handleError(_0x50956b,null));};exports[_0x590c('0x41')]=function(_0x4ff920,_0x5f0916){return db['Disposition'][_0x590c('0x41')](_0x4ff920[_0x590c('0x42')],{})[_0x590c('0x20')](function(_0x56f426){var _0x176da0=_0x4ff920['user'][_0x590c('0x43')]({'plain':!![]});if(!_0x176da0)throw new Error(_0x590c('0x44'));if(_0x176da0['role']==='user'){var _0x5d2e65=_0x56f426['get']({'plain':!![]});var _0x3ac480=_0x590c('0x45');return db['UserProfileSection']['find']({'where':{'name':_0x3ac480,'userProfileId':_0x176da0['userProfileId']},'raw':!![]})[_0x590c('0x20')](function(_0x1f5d69){if(_0x1f5d69&&_0x1f5d69['autoAssociation']===0x0){return db[_0x590c('0x21')][_0x590c('0x41')]({'name':_0x5d2e65[_0x590c('0x24')],'resourceId':_0x5d2e65['id'],'type':_0x1f5d69[_0x590c('0x24')],'sectionId':_0x1f5d69['id']},{})[_0x590c('0x20')](function(){return _0x56f426;});}else{return _0x56f426;}})['catch'](function(_0x21031f){logger[_0x590c('0x46')](_0x590c('0x47'),_0x21031f);throw _0x21031f;});}return _0x56f426;})[_0x590c('0x20')](respondWithResult(_0x5f0916,0xc9))[_0x590c('0x3c')](handleError(_0x5f0916,null));};exports['update']=function(_0x1c22b5,_0x56adf2){if(_0x1c22b5['body']['id']){delete _0x1c22b5[_0x590c('0x42')]['id'];}return db[_0x590c('0x28')][_0x590c('0x48')]({'where':{'id':_0x1c22b5[_0x590c('0x3e')]['id']}})[_0x590c('0x20')](handleEntityNotFound(_0x56adf2,null))[_0x590c('0x20')](saveUpdates(_0x1c22b5[_0x590c('0x42')],null))[_0x590c('0x20')](respondWithResult(_0x56adf2,null))[_0x590c('0x3c')](handleError(_0x56adf2,null));};exports[_0x590c('0x22')]=function(_0x1849f0,_0x32ee22){return db[_0x590c('0x28')]['find']({'where':{'id':_0x1849f0['params']['id']}})['then'](handleEntityNotFound(_0x32ee22,null))[_0x590c('0x20')](removeEntity(_0x32ee22,null))[_0x590c('0x3c')](handleError(_0x32ee22,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 043f8de..b90f4d4 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 _0x08bc=['WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_whatsapp'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x08bc,0x112));var _0xc08b=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x08bc[_0x2d2ca2];return _0x48489d;};'use strict';var _=require(_0xc08b('0x0'));var util=require(_0xc08b('0x1'));var logger=require(_0xc08b('0x2'))(_0xc08b('0x3'));var moment=require(_0xc08b('0x4'));var BPromise=require(_0xc08b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc08b('0x6'));var rimraf=require(_0xc08b('0x7'));var config=require(_0xc08b('0x8'));var attributes=require(_0xc08b('0x9'));module[_0xc08b('0xa')]=function(_0xb6b52e,_0xdfc278){return _0xb6b52e[_0xc08b('0xb')](_0xc08b('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xc08b('0xd'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0xc08b('0xd'),_0xc08b('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xc08b('0xd'),_0xc08b('0xf')]},{'unique':!![],'name':_0xc08b('0x10'),'fields':[_0xc08b('0xd'),_0xc08b('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0xc08b('0xd'),_0xc08b('0x12')]},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0xc08b('0x13'),'fields':[_0xc08b('0xd'),_0xc08b('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfc10=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash'];(function(_0x51bb81,_0x2b55f0){var _0x260a19=function(_0x59322d){while(--_0x59322d){_0x51bb81['push'](_0x51bb81['shift']());}};_0x260a19(++_0x2b55f0);}(_0xfc10,0x151));var _0x0fc1=function(_0x5d2bf9,_0x3652af){_0x5d2bf9=_0x5d2bf9-0x0;var _0x85c490=_0xfc10[_0x5d2bf9];return _0x85c490;};'use strict';var _=require(_0x0fc1('0x0'));var util=require(_0x0fc1('0x1'));var logger=require(_0x0fc1('0x2'))(_0x0fc1('0x3'));var moment=require(_0x0fc1('0x4'));var BPromise=require(_0x0fc1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fc1('0x6'));var rimraf=require(_0x0fc1('0x7'));var config=require(_0x0fc1('0x8'));var attributes=require(_0x0fc1('0x9'));module['exports']=function(_0x4c2c02,_0x1b965f){return _0x4c2c02[_0x0fc1('0xa')](_0x0fc1('0xb'),attributes,{'tableName':_0x0fc1('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0fc1('0xd'),'fields':['name',_0x0fc1('0xe')]},{'unique':!![],'name':_0x0fc1('0xf'),'fields':[_0x0fc1('0x10'),_0x0fc1('0x11')]},{'unique':!![],'name':'name_mail','fields':[_0x0fc1('0x10'),_0x0fc1('0x12')]},{'unique':!![],'name':_0x0fc1('0x13'),'fields':[_0x0fc1('0x10'),_0x0fc1('0x14')]},{'unique':!![],'name':_0x0fc1('0x15'),'fields':[_0x0fc1('0x10'),_0x0fc1('0x16')]},{'unique':!![],'name':_0x0fc1('0x17'),'fields':['name',_0x0fc1('0x18')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x0fc1('0x19')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ea653db..5142bc5 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(_0x3a7acc,_0x1f3d99){var _0x2cf10f=function(_0x342451){while(--_0x342451){_0x3a7acc['push'](_0x3a7acc['shift']());}};_0x2cf10f(++_0x1f3d99);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x27c28d,_0x3298f3){var _0x35833b=function(_0x5942f8){while(--_0x5942f8){_0x27c28d['push'](_0x27c28d['shift']());}};_0x35833b(++_0x3298f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 6e11dc2..cefc98c 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 _0xb939=['show','post','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../config/environment','./disposition.controller','isAuthenticated','index','get'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xb939,0x137));var _0x9b93=function(_0xb65193,_0x13d94d){_0xb65193=_0xb65193-0x0;var _0x12eeb4=_0xb939[_0xb65193];return _0x12eeb4;};'use strict';var multer=require(_0x9b93('0x0'));var util=require('util');var path=require(_0x9b93('0x1'));var timeout=require(_0x9b93('0x2'));var express=require('express');var router=express[_0x9b93('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9b93('0x4'));var controller=require(_0x9b93('0x5'));router['get']('/',auth[_0x9b93('0x6')](),controller[_0x9b93('0x7')]);router[_0x9b93('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9b93('0x9')]);router[_0x9b93('0xa')]('/',auth[_0x9b93('0x6')](),controller['create']);router['put'](_0x9b93('0xb'),auth[_0x9b93('0x6')](),controller[_0x9b93('0xc')]);router[_0x9b93('0xd')](_0x9b93('0xb'),auth[_0x9b93('0x6')](),controller[_0x9b93('0xe')]);module[_0x9b93('0xf')]=router; \ No newline at end of file +var _0xaf1c=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','show','post','update'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0xaf1c,0x168));var _0xcaf1=function(_0x3eddfa,_0x45950e){_0x3eddfa=_0x3eddfa-0x0;var _0x21a5fe=_0xaf1c[_0x3eddfa];return _0x21a5fe;};'use strict';var multer=require('multer');var util=require(_0xcaf1('0x0'));var path=require(_0xcaf1('0x1'));var timeout=require(_0xcaf1('0x2'));var express=require(_0xcaf1('0x3'));var router=express['Router']();var fs_extra=require(_0xcaf1('0x4'));var auth=require(_0xcaf1('0x5'));var interaction=require(_0xcaf1('0x6'));var config=require(_0xcaf1('0x7'));var controller=require(_0xcaf1('0x8'));router[_0xcaf1('0x9')]('/',auth[_0xcaf1('0xa')](),controller['index']);router[_0xcaf1('0x9')]('/:id',auth[_0xcaf1('0xa')](),controller[_0xcaf1('0xb')]);router[_0xcaf1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcaf1('0xd')]);router[_0xcaf1('0xe')]('/:id',auth[_0xcaf1('0xa')](),controller[_0xcaf1('0xf')]);module[_0xcaf1('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index f3cbe8f..609119a 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 _0x17c4=['yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600','14400','v17,v27,v29','INTEGER','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING'];(function(_0x35c4ae,_0x343dcf){var _0x95a047=function(_0x558427){while(--_0x558427){_0x35c4ae['push'](_0x35c4ae['shift']());}};_0x95a047(++_0x343dcf);}(_0x17c4,0x18a));var _0x417c=function(_0x4494bd,_0x5d4c66){_0x4494bd=_0x4494bd-0x0;var _0x49ede9=_0x17c4[_0x4494bd];return _0x49ede9;};'use strict';var Sequelize=require('sequelize');module[_0x417c('0x0')]={'name':{'type':Sequelize[_0x417c('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x417c('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x417c('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x417c('0x1')],'defaultValue':_0x417c('0x3')},'localstationid':{'type':Sequelize[_0x417c('0x1')],'unique':_0x417c('0x4')},'minrate':{'type':Sequelize[_0x417c('0x5')]('2400',_0x417c('0x6'),'7200','9600','12000','14400'),'defaultValue':_0x417c('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x417c('0x6'),_0x417c('0x7'),_0x417c('0x8'),'12000',_0x417c('0x9')),'defaultValue':_0x417c('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x417c('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x417c('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x417c('0xc'),_0x417c('0xd'),'DADHI','KHOMP'),'defaultValue':_0x417c('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x417c('0xe')],'defaultValue':function(){return _0x417c('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x417c('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x417c('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x417c('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x417c('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x417c('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x417c('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x417c('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x417c('0x10')],'defaultValue':![],'comment':_0x417c('0x12'),'set':function(_0x46fa4c){if(!_0x46fa4c)this[_0x417c('0x13')](_0x417c('0x14'),null);this[_0x417c('0x13')](_0x417c('0x15'),_0x46fa4c);}}}; \ No newline at end of file +var _0x8829=['2400','14400','v17,v27,v29','INTEGER','SIP','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600','12000'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x8829,0x1f0));var _0x9882=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8829[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9882('0x0')]={'name':{'type':Sequelize[_0x9882('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9882('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x9882('0x2'),'no'),'defaultValue':_0x9882('0x2')},'headerinfo':{'type':Sequelize[_0x9882('0x1')],'defaultValue':_0x9882('0x3')},'localstationid':{'type':Sequelize[_0x9882('0x1')],'unique':_0x9882('0x4')},'minrate':{'type':Sequelize[_0x9882('0x5')]('2400',_0x9882('0x6'),_0x9882('0x7'),_0x9882('0x8'),_0x9882('0x9'),'14400'),'defaultValue':_0x9882('0x6')},'maxrate':{'type':Sequelize[_0x9882('0x5')](_0x9882('0xa'),_0x9882('0x6'),_0x9882('0x7'),'9600','12000',_0x9882('0xb')),'defaultValue':_0x9882('0xb')},'modem':{'type':Sequelize[_0x9882('0x1')],'defaultValue':_0x9882('0xc')},'gateway':{'type':Sequelize[_0x9882('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9882('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9882('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9882('0x5')](_0x9882('0xe'),'IAX','DADHI',_0x9882('0xf')),'defaultValue':_0x9882('0xe')},'key':{'type':Sequelize[_0x9882('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9882('0x10')],'defaultValue':function(){return _0x9882('0x11');}},'notificationSound':{'type':Sequelize[_0x9882('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9882('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9882('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9882('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9882('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9882('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x9882('0x12')],'defaultValue':![],'comment':_0x9882('0x14'),'set':function(_0x437a76){if(!_0x437a76)this[_0x9882('0x15')]('mandatoryDispositionPauseId',null);this[_0x9882('0x15')](_0x9882('0x16'),_0x437a76);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7ff036d..00951f1 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 _0x013d=['headerinfo','maxrate','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','bulkCreate','tech','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','split','format','CmList','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','spread','out','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','userFaxAccount:remove','emit','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','FaxAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','ids','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','hasOwnProperty','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','finally','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','priority','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect'];(function(_0x1237e9,_0x21d734){var _0x3b6ef4=function(_0x1a729e){while(--_0x1a729e){_0x1237e9['push'](_0x1237e9['shift']());}};_0x3b6ef4(++_0x21d734);}(_0x013d,0xee));var _0xd013=function(_0x375233,_0x165da0){_0x375233=_0x375233-0x0;var _0xb1fac5=_0x013d[_0x375233];return _0xb1fac5;};'use strict';var emlformat=require(_0xd013('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd013('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd013('0x2'));var moment=require('moment');var BPromise=require(_0xd013('0x3'));var Mustache=require(_0xd013('0x4'));var util=require(_0xd013('0x5'));var path=require('path');var sox=require(_0xd013('0x6'));var csv=require('to-csv');var ejs=require(_0xd013('0x7'));var fs=require('fs');var fs_extra=require(_0xd013('0x8'));var _=require(_0xd013('0x9'));var squel=require(_0xd013('0xa'));var crypto=require(_0xd013('0xb'));var jsforce=require(_0xd013('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd013('0xd'));var querystring=require(_0xd013('0xe'));var Papa=require(_0xd013('0xf'));var Redis=require(_0xd013('0x10'));var authService=require(_0xd013('0x11'));var qs=require(_0xd013('0x12'));var as=require(_0xd013('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd013('0x14'));var utils=require(_0xd013('0x15'));var config=require(_0xd013('0x16'));var licenseUtil=require(_0xd013('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd013('0x18')](config[_0xd013('0x19')],{'host':_0xd013('0x1a'),'port':0x18eb});var socket=require(_0xd013('0x1b'))(new Redis(config[_0xd013('0x19')]));require(_0xd013('0x1c'))[_0xd013('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd013('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xd013('0x1e')][_0xd013('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5fd3ac,_0x2aa2f0,_0x8a3dff,_0x2de727){return new BPromise(function(_0x1b74ac,_0x2ad299){var _0x2e8003=_0x2de727||client;return _0x2e8003[_0xd013('0x20')](_0x5fd3ac,_0x8a3dff)[_0xd013('0x21')](function(_0x4d609e){logger[_0xd013('0x22')](_0xd013('0x23'),_0x2aa2f0,_0xd013('0x24'));logger['debug'](_0xd013('0x25'),_0x2aa2f0,_0xd013('0x24'),JSON['stringify'](_0x4d609e));if(_0x4d609e[_0xd013('0x26')]){if(_0x4d609e[_0xd013('0x26')][_0xd013('0x27')]===0x1f4){logger[_0xd013('0x26')](_0xd013('0x23'),_0x2aa2f0,_0x4d609e[_0xd013('0x26')][_0xd013('0x28')]);return _0x2ad299(_0x4d609e[_0xd013('0x26')]['message']);}logger['error'](_0xd013('0x23'),_0x2aa2f0,_0x4d609e[_0xd013('0x26')][_0xd013('0x28')]);return _0x1b74ac(_0x4d609e[_0xd013('0x26')]['message']);}else{logger[_0xd013('0x22')](_0xd013('0x23'),_0x2aa2f0,_0xd013('0x24'));_0x1b74ac(_0x4d609e[_0xd013('0x29')][_0xd013('0x28')]);}})[_0xd013('0x2a')](function(_0x1d604e){logger[_0xd013('0x26')](_0xd013('0x23'),_0x2aa2f0,_0x1d604e);_0x2ad299(_0x1d604e);});});}function respondWithStatusCode(_0x93aae,_0x959082){_0x959082=_0x959082||0xcc;return function(_0x276990){if(_0x276990){return _0x93aae[_0xd013('0x2b')](_0x959082);}return _0x93aae[_0xd013('0x2c')](_0x959082)[_0xd013('0x2d')]();};}function respondWithResult(_0x4922b3,_0x2ca946){_0x2ca946=_0x2ca946||0xc8;return function(_0x1b3459){if(_0x1b3459){return _0x4922b3['status'](_0x2ca946)['json'](_0x1b3459);}};}function respondWithFilteredResult(_0x3e9a15,_0x3dc11b){return function(_0x442f63){if(_0x442f63){var _0x4d35ef=typeof _0x3dc11b[_0xd013('0x2e')]===_0xd013('0x2f')&&typeof _0x3dc11b[_0xd013('0x30')]===_0xd013('0x2f');var _0x3756c7=_0x442f63['count'];var _0x5381d1=_0x4d35ef?0x0:_0x3dc11b[_0xd013('0x2e')];var _0x59aa61=_0x4d35ef?_0x442f63[_0xd013('0x31')]:_0x3dc11b[_0xd013('0x2e')]+_0x3dc11b[_0xd013('0x30')];var _0x1f8ad5;if(_0x59aa61>=_0x3756c7){_0x59aa61=_0x3756c7;_0x1f8ad5=0xc8;}else{_0x1f8ad5=0xce;}_0x3e9a15[_0xd013('0x2c')](_0x1f8ad5);return _0x3e9a15[_0xd013('0x32')]('Content-Range',_0x5381d1+'-'+_0x59aa61+'/'+_0x3756c7)[_0xd013('0x33')](_0x442f63);}return null;};}function patchUpdates(_0x439553){return function(_0x1b1cd2){try{jsonpatch['apply'](_0x1b1cd2,_0x439553,!![]);}catch(_0x2f576a){return BPromise[_0xd013('0x34')](_0x2f576a);}return _0x1b1cd2[_0xd013('0x35')]();};}function saveUpdates(_0x2e63f8,_0x1bebd5){return function(_0x4904a0){if(_0x4904a0){return _0x4904a0[_0xd013('0x36')](_0x2e63f8)[_0xd013('0x21')](function(_0x2f3b50){return _0x2f3b50;});}return null;};}function removeEntity(_0x2a3b41,_0x1f34ac){return function(_0x510c47){if(_0x510c47){return _0x510c47[_0xd013('0x37')]()[_0xd013('0x21')](function(){var _0x1deb06=_0x510c47[_0xd013('0x38')]({'plain':!![]});var _0x456c91='FaxAccounts';return db[_0xd013('0x39')]['destroy']({'where':{'type':_0x456c91,'resourceId':_0x1deb06['id']}})[_0xd013('0x21')](function(){return _0x510c47;});})['then'](function(){_0x2a3b41[_0xd013('0x2c')](0xcc)[_0xd013('0x2d')]();});}};}function handleEntityNotFound(_0x126835,_0x186b14){return function(_0x2bb758){if(!_0x2bb758){_0x126835['sendStatus'](0x194);}return _0x2bb758;};}function handleError(_0x507a96,_0xa57923){_0xa57923=_0xa57923||0x1f4;return function(_0x486b7c){logger['error'](_0x486b7c[_0xd013('0x3a')]);if(_0x486b7c[_0xd013('0x3b')]){delete _0x486b7c['name'];}_0x507a96[_0xd013('0x2c')](_0xa57923)[_0xd013('0x3c')](_0x486b7c);};}exports[_0xd013('0x3d')]=function(_0x41980d,_0x341ef6){var _0x231054={'include':[{'model':db[_0xd013('0x3e')],'as':'mandatoryDispositionPause'}]},_0x2adedb={},_0x19e50f={'count':0x0,'rows':[]};var _0x215f28=_['map'](db[_0xd013('0x3f')][_0xd013('0x40')],function(_0x460a02){return{'name':_0x460a02[_0xd013('0x41')],'type':_0x460a02[_0xd013('0x42')][_0xd013('0x43')]};});_0x2adedb[_0xd013('0x44')]=_[_0xd013('0x45')](_0x215f28,_0xd013('0x3b'));_0x2adedb['query']=_[_0xd013('0x46')](_0x41980d[_0xd013('0x47')]);_0x2adedb[_0xd013('0x48')]=_[_0xd013('0x49')](_0x2adedb['model'],_0x2adedb[_0xd013('0x47')]);_0x231054[_0xd013('0x4a')]=_['intersection'](_0x2adedb[_0xd013('0x44')],qs[_0xd013('0x4b')](_0x41980d[_0xd013('0x47')][_0xd013('0x4b')]));_0x231054[_0xd013('0x4a')]=_0x231054[_0xd013('0x4a')][_0xd013('0x4c')]?_0x231054[_0xd013('0x4a')]:_0x2adedb[_0xd013('0x44')];if(!_0x41980d[_0xd013('0x47')]['hasOwnProperty'](_0xd013('0x4d'))){_0x231054[_0xd013('0x30')]=qs[_0xd013('0x30')](_0x41980d[_0xd013('0x47')][_0xd013('0x30')]);_0x231054['offset']=qs[_0xd013('0x2e')](_0x41980d[_0xd013('0x47')][_0xd013('0x2e')]);}_0x231054[_0xd013('0x4e')]=qs[_0xd013('0x4f')](_0x41980d[_0xd013('0x47')][_0xd013('0x4f')]);_0x231054[_0xd013('0x50')]=qs[_0xd013('0x48')](_[_0xd013('0x51')](_0x41980d['query'],_0x2adedb[_0xd013('0x48')]),_0x215f28);if(_0x41980d['query'][_0xd013('0x52')]){_0x231054[_0xd013('0x50')]=_[_0xd013('0x53')](_0x231054[_0xd013('0x50')],{'$or':_['map'](_0x215f28,function(_0x4d3e52){if(_0x4d3e52[_0xd013('0x42')]!==_0xd013('0x54')){var _0xdc5d0e={};_0xdc5d0e[_0x4d3e52[_0xd013('0x3b')]]={'$like':'%'+_0x41980d[_0xd013('0x47')]['filter']+'%'};return _0xdc5d0e;}})});}_0x231054=_[_0xd013('0x53')]({},_0x231054,_0x41980d[_0xd013('0x55')]);var _0x177a3f={'where':_0x231054[_0xd013('0x50')]};return db[_0xd013('0x3f')][_0xd013('0x31')](_0x177a3f)['then'](function(_0x1712fd){_0x19e50f[_0xd013('0x31')]=_0x1712fd;if(_0x41980d[_0xd013('0x47')][_0xd013('0x56')]){_0x231054[_0xd013('0x57')]=[{'all':!![]}];}return db[_0xd013('0x3f')][_0xd013('0x58')](_0x231054);})[_0xd013('0x21')](function(_0x2943bb){_0x19e50f[_0xd013('0x59')]=_0x2943bb;return _0x19e50f;})[_0xd013('0x21')](respondWithFilteredResult(_0x341ef6,_0x231054))['catch'](handleError(_0x341ef6,null));};exports[_0xd013('0x5a')]=function(_0xcb07ce,_0x332dae){var _0x28f742={'raw':![],'where':{'id':_0xcb07ce[_0xd013('0x5b')]['id']},'include':[{'model':db[_0xd013('0x3e')],'as':_0xd013('0x5c')}]},_0x23d831={};_0x23d831[_0xd013('0x44')]=_[_0xd013('0x46')](db[_0xd013('0x3f')][_0xd013('0x40')]);_0x23d831[_0xd013('0x47')]=_[_0xd013('0x46')](_0xcb07ce[_0xd013('0x47')]);_0x23d831['filters']=_[_0xd013('0x49')](_0x23d831['model'],_0x23d831['query']);_0x28f742[_0xd013('0x4a')]=_['intersection'](_0x23d831[_0xd013('0x44')],qs[_0xd013('0x4b')](_0xcb07ce['query'][_0xd013('0x4b')]));_0x28f742[_0xd013('0x4a')]=_0x28f742['attributes']['length']?_0x28f742[_0xd013('0x4a')]:_0x23d831[_0xd013('0x44')];if(_0xcb07ce[_0xd013('0x47')][_0xd013('0x56')]){_0x28f742[_0xd013('0x57')]=[{'all':!![]}];}_0x28f742=_[_0xd013('0x53')]({},_0x28f742,_0xcb07ce[_0xd013('0x55')]);return db['FaxAccount']['find'](_0x28f742)[_0xd013('0x21')](handleEntityNotFound(_0x332dae,null))[_0xd013('0x21')](respondWithResult(_0x332dae,null))['catch'](handleError(_0x332dae,null));};exports[_0xd013('0x5d')]=function(_0x5b16e6,_0x1c9dc0){return db[_0xd013('0x3f')]['create'](_0x5b16e6[_0xd013('0x5e')],{})['then'](function(_0x4416a2){var _0x5c8c39=_0x5b16e6[_0xd013('0x5f')][_0xd013('0x38')]({'plain':!![]});if(!_0x5c8c39)throw new Error(_0xd013('0x60'));if(_0x5c8c39[_0xd013('0x61')]===_0xd013('0x5f')){var _0x83dfe9=_0x4416a2[_0xd013('0x38')]({'plain':!![]});var _0x22241f='FaxAccounts';return db[_0xd013('0x62')][_0xd013('0x63')]({'where':{'name':_0x22241f,'userProfileId':_0x5c8c39['userProfileId']},'raw':!![]})['then'](function(_0x33ccf0){if(_0x33ccf0&&_0x33ccf0['autoAssociation']===0x0){return db[_0xd013('0x39')][_0xd013('0x5d')]({'name':_0x83dfe9[_0xd013('0x3b')],'resourceId':_0x83dfe9['id'],'type':_0x33ccf0[_0xd013('0x3b')],'sectionId':_0x33ccf0['id']},{})[_0xd013('0x21')](function(){return _0x4416a2;});}else{return _0x4416a2;}})[_0xd013('0x2a')](function(_0x2f74d4){logger[_0xd013('0x26')](_0xd013('0x64'),_0x2f74d4);throw _0x2f74d4;});}return _0x4416a2;})[_0xd013('0x21')](respondWithResult(_0x1c9dc0,0xc9))['catch'](handleError(_0x1c9dc0,null));};exports[_0xd013('0x36')]=function(_0x3a1529,_0x2a399b){if(_0x3a1529[_0xd013('0x5e')]['id']){delete _0x3a1529[_0xd013('0x5e')]['id'];}return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0x3a1529[_0xd013('0x5b')]['id']},'include':[{'model':db[_0xd013('0x3e')],'as':_0xd013('0x5c')}]})[_0xd013('0x21')](handleEntityNotFound(_0x2a399b,null))['then'](saveUpdates(_0x3a1529[_0xd013('0x5e')],null))[_0xd013('0x21')](respondWithResult(_0x2a399b,null))['catch'](handleError(_0x2a399b,null));};exports[_0xd013('0x37')]=function(_0x2afd62,_0x373781){return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0x2afd62[_0xd013('0x5b')]['id']}})['then'](handleEntityNotFound(_0x373781,null))[_0xd013('0x21')](removeEntity(_0x373781,null))[_0xd013('0x2a')](handleError(_0x373781,null));};exports[_0xd013('0x65')]=function(_0x59bebf,_0x28e334){return db[_0xd013('0x3f')][_0xd013('0x65')]()[_0xd013('0x21')](respondWithResult(_0x28e334,null))[_0xd013('0x2a')](handleError(_0x28e334,null));};exports[_0xd013('0x66')]=function(_0x3939f9,_0x26ccf1,_0xa4e905){if(_0x3939f9[_0xd013('0x5e')]['id']){delete _0x3939f9[_0xd013('0x5e')]['id'];}return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0x3939f9[_0xd013('0x5b')]['id']}})['then'](handleEntityNotFound(_0x26ccf1,null))[_0xd013('0x21')](function(_0x2b5ccb){if(_0x2b5ccb){_0x3939f9[_0xd013('0x5e')][_0xd013('0x67')]=_0x2b5ccb['id'];return db['Disposition']['create'](_0x3939f9[_0xd013('0x5e')]);}})[_0xd013('0x21')](respondWithResult(_0x26ccf1,null))['catch'](handleError(_0x26ccf1,null));};exports[_0xd013('0x68')]=function(_0x2729fc,_0x4a84ea,_0x4c3bfb){var _0x28db03={'raw':![],'where':{}};var _0x11fcf3={};var _0x203ca3={'count':0x0,'rows':[]};return db[_0xd013('0x3f')][_0xd013('0x69')]({'where':{'id':_0x2729fc[_0xd013('0x5b')]['id']}})[_0xd013('0x21')](handleEntityNotFound(_0x4a84ea,null))[_0xd013('0x21')](function(_0x349b23){if(_0x349b23){_0x11fcf3['model']=_['keys'](db[_0xd013('0x6a')][_0xd013('0x40')]);_0x11fcf3[_0xd013('0x47')]=_['keys'](_0x2729fc['query']);_0x11fcf3[_0xd013('0x48')]=_['intersection'](_0x11fcf3[_0xd013('0x44')],_0x11fcf3['query']);_0x28db03[_0xd013('0x4a')]=_[_0xd013('0x49')](_0x11fcf3['model'],qs[_0xd013('0x4b')](_0x2729fc[_0xd013('0x47')][_0xd013('0x4b')]));_0x28db03[_0xd013('0x4a')]=_0x28db03[_0xd013('0x4a')]['length']?_0x28db03[_0xd013('0x4a')]:_0x11fcf3[_0xd013('0x44')];if(!_0x2729fc['query']['hasOwnProperty'](_0xd013('0x4d'))){_0x28db03[_0xd013('0x30')]=qs[_0xd013('0x30')](_0x2729fc[_0xd013('0x47')][_0xd013('0x30')]);_0x28db03['offset']=qs[_0xd013('0x2e')](_0x2729fc[_0xd013('0x47')][_0xd013('0x2e')]);}_0x28db03[_0xd013('0x4e')]=qs[_0xd013('0x4f')](_0x2729fc['query'][_0xd013('0x4f')]);_0x28db03[_0xd013('0x50')]=qs[_0xd013('0x48')](_[_0xd013('0x51')](_0x2729fc[_0xd013('0x47')],_0x11fcf3[_0xd013('0x48')]));_0x28db03[_0xd013('0x50')][_0xd013('0x67')]=_0x349b23['id'];if(_0x2729fc[_0xd013('0x47')]['filter']){_0x28db03[_0xd013('0x50')]=_[_0xd013('0x53')](_0x28db03[_0xd013('0x50')],{'$or':_[_0xd013('0x45')](_0x28db03['attributes'],function(_0x53ceb6){var _0x21a100={};_0x21a100[_0x53ceb6]={'$like':'%'+_0x2729fc[_0xd013('0x47')][_0xd013('0x52')]+'%'};return _0x21a100;})});}_0x28db03=_['merge']({},_0x28db03,_0x2729fc[_0xd013('0x55')]);return db['Disposition'][_0xd013('0x31')]({'where':_0x28db03[_0xd013('0x50')]})[_0xd013('0x21')](function(_0x28f105){_0x203ca3[_0xd013('0x31')]=_0x28f105;if(_0x2729fc[_0xd013('0x47')][_0xd013('0x56')]){_0x28db03['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x28db03);})[_0xd013('0x21')](function(_0x262081){_0x203ca3[_0xd013('0x59')]=_0x262081;return _0x203ca3;});}})['then'](respondWithFilteredResult(_0x4a84ea,_0x28db03))['catch'](handleError(_0x4a84ea,null));};exports['removeDispositions']=function(_0x4dda76,_0x4b9fb3,_0x2665dc){return db['FaxAccount'][_0xd013('0x63')]({'where':{'id':_0x4dda76[_0xd013('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4b9fb3,null))['then'](function(_0x1b7324){if(_0x1b7324){return _0x1b7324['removeDispositions'](_0x4dda76[_0xd013('0x47')][_0xd013('0x6b')]);}})[_0xd013('0x21')](respondWithStatusCode(_0x4b9fb3,null))['catch'](handleError(_0x4b9fb3,null));};exports[_0xd013('0x6c')]=function(_0x189d31,_0xad9b33,_0x324c70){if(_0x189d31[_0xd013('0x5e')]['id']){delete _0x189d31[_0xd013('0x5e')]['id'];}return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0x189d31[_0xd013('0x5b')]['id']}})['then'](handleEntityNotFound(_0xad9b33,null))[_0xd013('0x21')](function(_0x3e825a){if(_0x3e825a){_0x189d31[_0xd013('0x5e')]['FaxAccountId']=_0x3e825a['id'];return db['CannedAnswer'][_0xd013('0x5d')](_0x189d31[_0xd013('0x5e')]);}})[_0xd013('0x21')](respondWithResult(_0xad9b33,null))['catch'](handleError(_0xad9b33,null));};exports['getAnswers']=function(_0x279d97,_0x565c61,_0x3f183c){var _0x259db0={'raw':![],'where':{}};var _0x4cbb99={};var _0x4b1995={'count':0x0,'rows':[]};return db[_0xd013('0x3f')][_0xd013('0x69')]({'where':{'id':_0x279d97['params']['id']}})['then'](handleEntityNotFound(_0x565c61,null))[_0xd013('0x21')](function(_0x36cda1){if(_0x36cda1){_0x4cbb99[_0xd013('0x44')]=_['keys'](db['CannedAnswer'][_0xd013('0x40')]);_0x4cbb99[_0xd013('0x47')]=_[_0xd013('0x46')](_0x279d97[_0xd013('0x47')]);_0x4cbb99[_0xd013('0x48')]=_['intersection'](_0x4cbb99['model'],_0x4cbb99[_0xd013('0x47')]);_0x259db0['attributes']=_[_0xd013('0x49')](_0x4cbb99[_0xd013('0x44')],qs[_0xd013('0x4b')](_0x279d97['query']['fields']));_0x259db0[_0xd013('0x4a')]=_0x259db0['attributes'][_0xd013('0x4c')]?_0x259db0['attributes']:_0x4cbb99[_0xd013('0x44')];if(!_0x279d97[_0xd013('0x47')]['hasOwnProperty'](_0xd013('0x4d'))){_0x259db0[_0xd013('0x30')]=qs[_0xd013('0x30')](_0x279d97['query'][_0xd013('0x30')]);_0x259db0[_0xd013('0x2e')]=qs[_0xd013('0x2e')](_0x279d97[_0xd013('0x47')]['offset']);}_0x259db0[_0xd013('0x4e')]=qs[_0xd013('0x4f')](_0x279d97['query'][_0xd013('0x4f')]);_0x259db0[_0xd013('0x50')]=qs[_0xd013('0x48')](_['pick'](_0x279d97[_0xd013('0x47')],_0x4cbb99[_0xd013('0x48')]));_0x259db0[_0xd013('0x50')][_0xd013('0x67')]=_0x36cda1['id'];if(_0x279d97[_0xd013('0x47')][_0xd013('0x52')]){_0x259db0[_0xd013('0x50')]=_['merge'](_0x259db0[_0xd013('0x50')],{'$or':_['map'](_0x259db0[_0xd013('0x4a')],function(_0x423c83){var _0x121659={};_0x121659[_0x423c83]={'$like':'%'+_0x279d97[_0xd013('0x47')][_0xd013('0x52')]+'%'};return _0x121659;})});}_0x259db0=_[_0xd013('0x53')]({},_0x259db0,_0x279d97[_0xd013('0x55')]);return db[_0xd013('0x6d')][_0xd013('0x31')]({'where':_0x259db0[_0xd013('0x50')]})['then'](function(_0xb7dd85){_0x4b1995['count']=_0xb7dd85;if(_0x279d97[_0xd013('0x47')]['includeAll']){_0x259db0[_0xd013('0x57')]=[{'all':!![]}];}return db[_0xd013('0x6d')][_0xd013('0x58')](_0x259db0);})['then'](function(_0x52d380){_0x4b1995[_0xd013('0x59')]=_0x52d380;return _0x4b1995;});}})[_0xd013('0x21')](respondWithFilteredResult(_0x565c61,_0x259db0))['catch'](handleError(_0x565c61,null));};exports[_0xd013('0x6e')]=function(_0xd6d711,_0x5a0745,_0x2a8edb){return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0xd6d711[_0xd013('0x5b')]['id']}})[_0xd013('0x21')](handleEntityNotFound(_0x5a0745,null))['then'](function(_0x156302){if(_0x156302){return _0x156302[_0xd013('0x6e')](_0xd6d711['query']['ids']);}})['then'](respondWithStatusCode(_0x5a0745,null))['catch'](handleError(_0x5a0745,null));};exports['addInteraction']=function(_0x345e99,_0x591043,_0x3a946f){return db[_0xd013('0x6f')][_0xd013('0x63')]({'where':{'id':_0x345e99[_0xd013('0x5b')]['id']}})[_0xd013('0x21')](handleEntityNotFound(_0x591043,null))[_0xd013('0x21')](function(_0x4d7fe4){if(_0x4d7fe4){return _0x4d7fe4[_0xd013('0x70')](_0x345e99[_0xd013('0x5e')][_0xd013('0x6b')],_[_0xd013('0x71')](_0x345e99[_0xd013('0x5e')],['ids','id'])||{});}})['then'](respondWithResult(_0x591043,null))[_0xd013('0x2a')](handleError(_0x591043,null));};exports[_0xd013('0x72')]=function(_0x4929da,_0x48f178,_0x4e7152){var _0x34242c={'raw':![],'where':{}};var _0x450182={};var _0x37e2ca={'count':0x0,'rows':[]};return db[_0xd013('0x3f')][_0xd013('0x69')]({'where':{'id':_0x4929da[_0xd013('0x5b')]['id']}})[_0xd013('0x21')](handleEntityNotFound(_0x48f178,null))[_0xd013('0x21')](function(_0x54a746){if(_0x54a746){_0x450182[_0xd013('0x44')]=_[_0xd013('0x46')](db['FaxInteraction']['rawAttributes']);_0x450182['query']=_['keys'](_0x4929da[_0xd013('0x47')]);_0x450182[_0xd013('0x48')]=_[_0xd013('0x49')](_0x450182[_0xd013('0x44')],_0x450182[_0xd013('0x47')]);_0x34242c['attributes']=_[_0xd013('0x49')](_0x450182[_0xd013('0x44')],qs[_0xd013('0x4b')](_0x4929da[_0xd013('0x47')]['fields']));_0x34242c[_0xd013('0x4a')]=_0x34242c['attributes']['length']?_0x34242c[_0xd013('0x4a')]:_0x450182[_0xd013('0x44')];if(!_0x4929da[_0xd013('0x47')][_0xd013('0x73')](_0xd013('0x4d'))){_0x34242c[_0xd013('0x30')]=qs['limit'](_0x4929da[_0xd013('0x47')][_0xd013('0x30')]);_0x34242c['offset']=qs[_0xd013('0x2e')](_0x4929da['query']['offset']);}_0x34242c['order']=qs['sort'](_0x4929da['query']['sort']);_0x34242c[_0xd013('0x50')]=qs[_0xd013('0x48')](_['pick'](_0x4929da['query'],_0x450182['filters']));_0x34242c[_0xd013('0x50')]['FaxAccountId']=_0x54a746['id'];if(_0x4929da[_0xd013('0x47')][_0xd013('0x52')]){_0x34242c[_0xd013('0x50')]=_[_0xd013('0x53')](_0x34242c[_0xd013('0x50')],{'$or':_[_0xd013('0x45')](_0x34242c[_0xd013('0x4a')],function(_0x300c65){var _0x13fb89={};_0x13fb89[_0x300c65]={'$like':'%'+_0x4929da['query'][_0xd013('0x52')]+'%'};return _0x13fb89;})});}_0x34242c=_[_0xd013('0x53')]({},_0x34242c,_0x4929da[_0xd013('0x55')]);return db[_0xd013('0x6f')]['count']({'where':_0x34242c[_0xd013('0x50')]})[_0xd013('0x21')](function(_0x9502df){_0x37e2ca[_0xd013('0x31')]=_0x9502df;if(_0x4929da[_0xd013('0x47')][_0xd013('0x56')]){_0x34242c[_0xd013('0x57')]=[{'model':db[_0xd013('0x74')],'as':_0xd013('0x75'),'required':![]},{'model':db[_0xd013('0x76')],'as':'Owner','attributes':[_0xd013('0x3b'),_0xd013('0x77'),_0xd013('0x78')],'required':![]},{'model':db['Tag'],'as':_0xd013('0x79'),'attributes':['id',_0xd013('0x3b'),_0xd013('0x7a')],'where':_0x4929da[_0xd013('0x47')][_0xd013('0x7b')]?{'id':_0x4929da['query'][_0xd013('0x7b')]}:undefined,'required':_0x4929da[_0xd013('0x47')][_0xd013('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0xd013('0x58')](_0x34242c);})['then'](function(_0x78dbc2){_0x37e2ca['rows']=_0x78dbc2;return _0x37e2ca;});}})[_0xd013('0x21')](respondWithFilteredResult(_0x48f178,_0x34242c))['catch'](handleError(_0x48f178,null));};exports[_0xd013('0x7c')]=function(_0x23701b,_0x3aba92){var _0x4c6d0c=_0x23701b[_0xd013('0x5b')]['id'];var _0x528b6d=_0x23701b[_0xd013('0x5e')];var _0x35f206=0xc8;var _0x10dd7f=null;return db[_0xd013('0x7d')]['transaction']({'isolationLevel':db[_0xd013('0x7d')][_0xd013('0x7e')][_0xd013('0x7f')]['READ_COMMITTED']},function(_0x25bfe2){return db[_0xd013('0x3f')][_0xd013('0x69')]({'where':{'id':_0x4c6d0c},'transaction':_0x25bfe2})[_0xd013('0x21')](function(_0x3b65c4){if(_0x3b65c4){return db[_0xd013('0x80')][_0xd013('0x37')]({'where':{'FaxAccountId':_0x4c6d0c},'transaction':_0x25bfe2})[_0xd013('0x21')](function(){var _0x169716=_['map'](_0x528b6d,function(_0x3d030c){_0x3d030c['FaxAccountId']=_0x4c6d0c;return _0x3d030c;});return db[_0xd013('0x80')]['bulkCreate'](_0x169716,{'transaction':_0x25bfe2});});}else{_0x35f206=0x194;_0x10dd7f=[];}});})[_0xd013('0x21')](function(){if(_0x35f206!==0x194){return db[_0xd013('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x4c6d0c},'order':'priority'})[_0xd013('0x21')](function(_0x1132b9){_0x10dd7f=_0x1132b9;});}})[_0xd013('0x2a')](function(_0x553e32){_0x35f206=0x1f4;logger[_0xd013('0x26')](_0x553e32['stack']);if(_0x553e32['name']){delete _0x553e32[_0xd013('0x3b')];}_0x10dd7f=_0x553e32;})[_0xd013('0x81')](function(){if(_0x10dd7f===null){_0x3aba92[_0xd013('0x2b')](_0x35f206);}else{if(_0x35f206===0x1f4){_0x3aba92[_0xd013('0x2c')](_0x35f206)[_0xd013('0x3c')](_0x10dd7f);}else{_0x3aba92[_0xd013('0x2c')](_0x35f206)['json'](_0x10dd7f);}}});};exports['getApplications']=function(_0x26a2e6,_0x31f7fd,_0x359c7c){var _0x3e172b={};var _0x29dcbd={};var _0x445800;var _0x48d2a5;return db[_0xd013('0x3f')][_0xd013('0x69')]({'where':{'id':_0x26a2e6[_0xd013('0x5b')]['id']}})[_0xd013('0x21')](handleEntityNotFound(_0x31f7fd,null))[_0xd013('0x21')](function(_0x26ff5f){if(_0x26ff5f){_0x445800=_0x26ff5f;_0x29dcbd['model']=_['keys'](db[_0xd013('0x80')][_0xd013('0x40')]);_0x29dcbd[_0xd013('0x47')]=_[_0xd013('0x46')](_0x26a2e6[_0xd013('0x47')]);_0x29dcbd[_0xd013('0x48')]=_[_0xd013('0x49')](_0x29dcbd[_0xd013('0x44')],_0x29dcbd['query']);_0x3e172b[_0xd013('0x4a')]=_['intersection'](_0x29dcbd[_0xd013('0x44')],qs[_0xd013('0x4b')](_0x26a2e6[_0xd013('0x47')]['fields']));_0x3e172b[_0xd013('0x4a')]=_0x3e172b[_0xd013('0x4a')][_0xd013('0x4c')]?_0x3e172b[_0xd013('0x4a')]:_0x29dcbd[_0xd013('0x44')];_0x3e172b[_0xd013('0x4e')]=qs[_0xd013('0x4f')](_0x26a2e6['query'][_0xd013('0x4f')]);_0x3e172b[_0xd013('0x50')]=qs['filters'](_[_0xd013('0x51')](_0x26a2e6[_0xd013('0x47')],_0x29dcbd[_0xd013('0x48')]));if(_0x26a2e6[_0xd013('0x47')][_0xd013('0x52')]){_0x3e172b['where']=_[_0xd013('0x53')](_0x3e172b[_0xd013('0x50')],{'$or':_[_0xd013('0x45')](_0x3e172b[_0xd013('0x4a')],function(_0x2d0a73){var _0x2027a3={};_0x2027a3[_0x2d0a73]={'$like':'%'+_0x26a2e6[_0xd013('0x47')][_0xd013('0x52')]+'%'};return _0x2027a3;})});}_0x3e172b=_[_0xd013('0x53')]({},_0x3e172b,_0x26a2e6['options']);return _0x445800[_0xd013('0x82')](_0x3e172b);}})[_0xd013('0x21')](function(_0x212911){if(_0x212911){_0x48d2a5=_0x212911[_0xd013('0x4c')];if(!_0x26a2e6[_0xd013('0x47')][_0xd013('0x73')](_0xd013('0x4d'))){_0x3e172b['limit']=qs[_0xd013('0x30')](_0x26a2e6[_0xd013('0x47')][_0xd013('0x30')]);_0x3e172b[_0xd013('0x2e')]=qs['offset'](_0x26a2e6[_0xd013('0x47')]['offset']);}return _0x445800[_0xd013('0x82')](_0x3e172b);}})[_0xd013('0x21')](function(_0x4251fc){if(_0x4251fc){return _0x4251fc?{'count':_0x48d2a5,'rows':_0x4251fc}:null;}})[_0xd013('0x21')](respondWithResult(_0x31f7fd,null))[_0xd013('0x2a')](handleError(_0x31f7fd,null));};function Extension(_0x485ab8,_0x4297d9,_0x1e6ce7,_0x5c3368){this[_0xd013('0x83')]=_0xd013('0x84');this[_0xd013('0x85')]=_0x485ab8[_0xd013('0x86')];this['app']=_0x5c3368;this[_0xd013('0x42')]=_0xd013('0x87');this[_0xd013('0x88')]=_0xd013('0x89');this[_0xd013('0x67')]=_0x485ab8['id'];this[_0xd013('0x8a')]=_0x4297d9;this[_0xd013('0x8b')]=_0x1e6ce7;}function createExtensionsReciveFax(_0x245627){var _0x43d719=0x1;var _0x2f431d=[];_0x2f431d[_0xd013('0x8c')](new Extension(_0x245627,_0x43d719,'','Answer'));_0x43d719+=0x1;_0x2f431d[_0xd013('0x8c')](new Extension(_0x245627,_0x43d719,_0xd013('0x8d'),_0xd013('0x8e')));_0x43d719+=0x1;for(var _0x364a63 in _0x245627){if(_0x245627[_0xd013('0x73')](_0x364a63)&&(_0x364a63===_0xd013('0x8f')||_0x364a63==='localstationid'||_0x364a63===_0xd013('0x90')||_0x364a63===_0xd013('0x91')||_0x364a63===_0xd013('0x92')||_0x364a63===_0xd013('0x93')||_0x364a63==='minrate'||_0x364a63==='modem'||_0x364a63==='t38timeout')){_0x2f431d[_0xd013('0x8c')](new Extension(_0x245627,_0x43d719,_0xd013('0x94')+_0x364a63+')='+_0x245627[_0x364a63],_0xd013('0x8e')));_0x43d719+=0x1;}}_0x2f431d[_0xd013('0x8c')](new Extension(_0x245627,_0x43d719,'6','Wait'));_0x43d719+=0x1;_0x2f431d[_0xd013('0x8c')](new Extension(_0x245627,_0x43d719,_0xd013('0x95'),_0xd013('0x96')));_0x43d719=0x0;return _0x2f431d;}exports[_0xd013('0x97')]=function(_0x488616,_0x3ab007,_0x18f6bc){var _0x31b2cc;return db[_0xd013('0x7d')]['transaction'](function(_0x165c3a){return db['FaxAccount']['create'](_0x488616[_0xd013('0x5e')],{'transaction':_0x165c3a})[_0xd013('0x21')](function(_0x290782){_0x31b2cc=_0x290782[_0xd013('0x38')]({'plain':!![]});return db[_0xd013('0x98')]['bulkCreate'](createExtensionsReciveFax(_0x31b2cc),{'transaction':_0x165c3a});});})[_0xd013('0x21')](function(){return _0x31b2cc;})[_0xd013('0x21')](respondWithResult(_0x3ab007,null))[_0xd013('0x2a')](handleError(_0x3ab007,null));};exports[_0xd013('0x99')]=function(_0x128919,_0x4f215c,_0x30ee57){var _0x85d899;return db[_0xd013('0x7d')]['transaction'](function(_0x33bb8b){return db[_0xd013('0x3f')][_0xd013('0x36')](_0x128919[_0xd013('0x5e')],{'where':{'id':_0x128919['body']['id']},'transaction':_0x33bb8b})[_0xd013('0x21')](function(_0x2fc110){return db[_0xd013('0x98')][_0xd013('0x37')]({'where':{'FaxAccountId':_0x128919[_0xd013('0x5e')]['id']},'transaction':_0x33bb8b})[_0xd013('0x21')](function(_0x40eb2c){return db[_0xd013('0x98')][_0xd013('0x9a')](createExtensionsReciveFax(_['omit'](_0x128919[_0xd013('0x5e')],[_0xd013('0x9b'),_0xd013('0x43'),_0xd013('0x9c'),_0xd013('0x9d'),'TrunkId',_0xd013('0x9e')])),{'transaction':_0x33bb8b});});});})['then'](function(){return db['FaxAccount'][_0xd013('0x9f')](_0x128919[_0xd013('0x5e')]['id']);})['then'](respondWithResult(_0x4f215c,null))['catch'](handleError(_0x4f215c,null));};exports[_0xd013('0xa0')]=function(_0x576f2b,_0x179c62,_0x5d4d04){var _0x1d8821={'raw':!![],'where':{}};var _0x54a801={};var _0x5b28f9={'count':0x0,'rows':[]};return db[_0xd013('0x3f')][_0xd013('0x69')]({'where':{'id':_0x576f2b[_0xd013('0x5b')]['id']}})[_0xd013('0x21')](handleEntityNotFound(_0x179c62,null))[_0xd013('0x21')](function(_0x1b3976){if(_0x1b3976){_0x54a801[_0xd013('0x44')]=_[_0xd013('0x46')](db[_0xd013('0xa1')][_0xd013('0x40')]);_0x54a801[_0xd013('0x47')]=_[_0xd013('0x46')](_0x576f2b[_0xd013('0x47')]);_0x54a801[_0xd013('0x48')]=_[_0xd013('0x49')](_0x54a801[_0xd013('0x44')],_0x54a801[_0xd013('0x47')]);_0x1d8821[_0xd013('0x4a')]=_[_0xd013('0x49')](_0x54a801['model'],qs[_0xd013('0x4b')](_0x576f2b[_0xd013('0x47')][_0xd013('0x4b')]));_0x1d8821[_0xd013('0x4a')]=_0x1d8821[_0xd013('0x4a')][_0xd013('0x4c')]?_0x1d8821[_0xd013('0x4a')]:_0x54a801['model'];if(!_0x576f2b['query'][_0xd013('0x73')](_0xd013('0x4d'))){_0x1d8821[_0xd013('0x30')]=qs[_0xd013('0x30')](_0x576f2b[_0xd013('0x47')][_0xd013('0x30')]);_0x1d8821['offset']=qs[_0xd013('0x2e')](_0x576f2b[_0xd013('0x47')]['offset']);}_0x1d8821[_0xd013('0x4e')]=qs[_0xd013('0x4f')](_0x576f2b[_0xd013('0x47')]['sort']);_0x1d8821[_0xd013('0x50')]=qs[_0xd013('0x48')](_['pick'](_0x576f2b[_0xd013('0x47')],_0x54a801['filters']));_0x1d8821['where'][_0xd013('0x67')]=_0x1b3976['id'];if(_0x576f2b['query'][_0xd013('0x52')]){_0x1d8821[_0xd013('0x50')]=_[_0xd013('0x53')](_0x1d8821[_0xd013('0x50')],{'$or':_['map'](_0x1d8821[_0xd013('0x4a')],function(_0x505586){var _0xa2f8f4={};_0xa2f8f4[_0x505586]={'$like':'%'+_0x576f2b[_0xd013('0x47')]['filter']+'%'};return _0xa2f8f4;})});}if(_0x576f2b[_0xd013('0x47')]['$gte']){var _0x10c23c=_0x576f2b['query']['$gte'][_0xd013('0xa2')](',');var _0x52f38d={};_0x52f38d[_0x10c23c[0x0]]={'$gte':moment(_0x10c23c[0x1])[_0xd013('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d8821[_0xd013('0x50')]=_[_0xd013('0x53')](_0x1d8821['where'],_0x52f38d);}_0x1d8821=_[_0xd013('0x53')]({},_0x1d8821,_0x576f2b[_0xd013('0x55')]);return db[_0xd013('0xa1')][_0xd013('0x31')]({'where':_0x1d8821[_0xd013('0x50')]})[_0xd013('0x21')](function(_0x342903){_0x5b28f9[_0xd013('0x31')]=_0x342903;if(_0x576f2b['query']['includeAll']){_0x1d8821[_0xd013('0x57')]=[{'all':!![]}];}return db['FaxMessage'][_0xd013('0x58')](_0x1d8821);})[_0xd013('0x21')](function(_0x3e4748){_0x5b28f9[_0xd013('0x59')]=_0x3e4748;return _0x5b28f9;});}})[_0xd013('0x21')](respondWithFilteredResult(_0x179c62,_0x1d8821))[_0xd013('0x2a')](handleError(_0x179c62,null));};exports[_0xd013('0x3c')]=function(_0x5bf2d4,_0x4692d6,_0x55bd70){var _0x5deff5,_0x73d09a={},_0x486358;if(_0x5bf2d4[_0xd013('0x5e')]['to']){_0x486358=_0x5bf2d4[_0xd013('0x5e')]['to'][0x0];}return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0x5bf2d4[_0xd013('0x5b')]['id']},'include':[{'model':db[_0xd013('0xa4')],'as':'List','include':[{'model':db['CmContact'],'as':_0xd013('0xa5'),'where':{'fax':_0x486358},'limit':0x1,'order':[[_0xd013('0x9d'),'DESC']]}]}]})[_0xd013('0x21')](handleEntityNotFound(_0x4692d6,null))['then'](function(_0x2c98ef){_0x5deff5=_0x2c98ef;if(_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')]&&_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')]['length']){for(var _0x2af3f7=0x0;_0x2af3f7<_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][_0xd013('0x4c')];_0x2af3f7+=0x1){_0x5bf2d4['body'][_0xd013('0xa6')][_0x2af3f7]={'filename':_0x5bf2d4['body'][_0xd013('0xa6')][_0x2af3f7][_0xd013('0x3b')],'id':_0x5bf2d4['body'][_0xd013('0xa6')][_0x2af3f7]['id'],'path':path[_0xd013('0xa7')](config[_0xd013('0xa8')],_0xd013('0xa9'),_0x5bf2d4['body'][_0xd013('0xa6')][_0x2af3f7][_0xd013('0xaa')])};}}return respondWithRpcPromise(_0xd013('0xab'),_0xd013('0xab'),{'FaxAccountId':_[_0xd013('0xac')](_0x5bf2d4[_0xd013('0x5b')]['id'])?undefined:_0x5bf2d4[_0xd013('0x5b')]['id'],'path':_[_0xd013('0xac')](_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][0x0][_0xd013('0xad')])?undefined:_0x5bf2d4[_0xd013('0x5e')]['attachments'][0x0]['path'],'fax':_[_0xd013('0xac')](_0x5bf2d4['body']['to'][0x0])?undefined:_0x5bf2d4[_0xd013('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x5deff5){if(_['isNil'](_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xae')])){_0x5bf2d4[_0xd013('0x5e')]['from']=util[_0xd013('0xa3')](_0xd013('0xaf'),_0x5deff5[_0xd013('0x3b')],_0x5deff5['fax']);}if(_0x5deff5[_0xd013('0xb0')]){if(_0x5deff5['List'][_0xd013('0xa5')][_0xd013('0x4c')]){return _0x5deff5[_0xd013('0xb0')][_0xd013('0xa5')][0x0];}else{return db[_0xd013('0x74')][_0xd013('0x5d')](_['defaults'](_0x5bf2d4['body'],{'firstName':_0x5bf2d4['body']['to'][0x0],'phone':_0x5bf2d4['body']['to'][0x0],'fax':_0x5bf2d4[_0xd013('0x5e')]['to'][0x0],'ListId':_0x5deff5['ListId']}));}}else{throw new Error(_0xd013('0xb1'));}}else{throw new Error(_0xd013('0xb2'));}})[_0xd013('0x21')](function(_0x3e072d){if(_0x3e072d){return db[_0xd013('0x6f')][_0xd013('0x63')]({'where':{'ContactId':_0x3e072d['id'],'closed':![],'FaxAccountId':_0x5deff5['id']}})['then'](function(_0x39c320){if(_0x39c320){return[_0x39c320,![]];}return db[_0xd013('0x6f')][_0xd013('0x5d')]({'UserId':_0x5bf2d4[_0xd013('0x5f')]['id'],'ContactId':_0x3e072d['id'],'FaxAccountId':_0x5deff5['id'],'fax':_0x5bf2d4[_0xd013('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xd013('0x53')](_0x5bf2d4[_0xd013('0x5e')],{'read':![],'body':_0x5bf2d4['body'][_0xd013('0xa6')][0x0][_0xd013('0xb3')],'FaxAccountId':_0x5deff5['id'],'UserId':_0x5bf2d4[_0xd013('0x5f')]['id'],'ContactId':_0x3e072d['id'],'AttachmentId':_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0xd013('0xa1')],'as':'Messages'}]})[_0xd013('0x21')](function(_0x505962){return[_0x505962,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd013('0xb4')](function(_0x3b43b8,_0x5d0f95){if(_0x5d0f95){return _0x3b43b8;}return db['FaxMessage'][_0xd013('0x5d')]({'direction':_0xd013('0xb5'),'read':![],'body':_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][0x0][_0xd013('0xb3')],'FaxAccountId':_0x5deff5['id'],'FaxInteractionId':_0x3b43b8['id'],'UserId':_0x5bf2d4[_0xd013('0x5f')]['id'],'ContactId':_0x3b43b8['ContactId'],'AttachmentId':_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][0x0]['id']})[_0xd013('0x21')](function(_0xebab80){_0x3b43b8[_0xd013('0xb6')][_0xd013('0xb7')]=[];_0x3b43b8[_0xd013('0xb6')][_0xd013('0xb7')][_0xd013('0x8c')](_0xebab80[_0xd013('0xb6')]);return _0x3b43b8;});})[_0xd013('0x21')](function(_0x1e997b){respondWithRpcPromise('SendFax',_0xd013('0xb8'),{'FaxAccountId':_['isNil'](_0x5bf2d4[_0xd013('0x5b')]['id'])?undefined:_0x5bf2d4[_0xd013('0x5b')]['id'],'path':_[_0xd013('0xac')](_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][0x0][_0xd013('0xad')])?undefined:_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][0x0][_0xd013('0xad')],'fax':_[_0xd013('0xac')](_0x5bf2d4[_0xd013('0x5e')]['to'][0x0])?undefined:_0x5bf2d4[_0xd013('0x5e')]['to'][0x0],'AttachmentId':_0x5bf2d4[_0xd013('0x5e')][_0xd013('0xa6')][0x0]['id']},client9002)[_0xd013('0x21')](function(_0x5725e8){logger[_0xd013('0x22')](_0xd013('0xb9'),_0x5725e8);})[_0xd013('0x2a')](function(_0x1d6593){logger[_0xd013('0x22')](_0xd013('0xb9'),_0x1d6593);});return _0x1e997b;})[_0xd013('0x21')](respondWithResult(_0x4692d6,null))[_0xd013('0x2a')](handleError(_0x4692d6,null));};exports[_0xd013('0xba')]=function(_0x1fe4e0,_0xa43a20,_0x45b320){return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0x1fe4e0['params']['id']}})[_0xd013('0x21')](handleEntityNotFound(_0xa43a20,null))[_0xd013('0x21')](function(_0x10d179){if(_0x10d179){return _0x10d179[_0xd013('0xba')](_0x1fe4e0[_0xd013('0x5e')][_0xd013('0x6b')],_['omit'](_0x1fe4e0['body'],[_0xd013('0x6b'),'id'])||{})['spread'](function(_0x1751b2){for(var _0x3cf0e4=0x0;_0x3cf0e4<_0x1fe4e0[_0xd013('0x5e')]['ids'][_0xd013('0x4c')];_0x3cf0e4+=0x1){socket['emit'](_0xd013('0xbb'),{'UserId':Number(_0x1fe4e0[_0xd013('0x5e')][_0xd013('0x6b')][_0x3cf0e4]),'FaxAccountId':Number(_0x1fe4e0[_0xd013('0x5b')]['id'])});}return _0x1751b2;});}})['then'](respondWithResult(_0xa43a20,null))['catch'](handleError(_0xa43a20,null));};exports[_0xd013('0xbc')]=function(_0x270ebe,_0x354c01,_0x4c3e87){return db[_0xd013('0x3f')][_0xd013('0x63')]({'where':{'id':_0x270ebe[_0xd013('0x5b')]['id']}})['then'](handleEntityNotFound(_0x354c01,null))[_0xd013('0x21')](function(_0x42da0c){if(_0x42da0c){return _0x42da0c[_0xd013('0xbc')](_0x270ebe[_0xd013('0x47')][_0xd013('0x6b')])[_0xd013('0x21')](function(){if(_['isArray'](_0x270ebe[_0xd013('0x47')][_0xd013('0x6b')])){for(var _0x34fa44=0x0;_0x34fa44<_0x270ebe[_0xd013('0x47')]['ids'][_0xd013('0x4c')];_0x34fa44+=0x1){socket['emit'](_0xd013('0xbd'),{'UserId':Number(_0x270ebe[_0xd013('0x47')][_0xd013('0x6b')][_0x34fa44]),'FaxAccountId':Number(_0x270ebe[_0xd013('0x5b')]['id'])});}}else{socket[_0xd013('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x270ebe['query'][_0xd013('0x6b')]),'FaxAccountId':Number(_0x270ebe[_0xd013('0x5b')]['id'])});}});}})[_0xd013('0x21')](respondWithStatusCode(_0x354c01,null))['catch'](handleError(_0x354c01,null));};exports['getAgents']=function(_0x309d77,_0x31af2e,_0x24c93c){var _0x2d6b36={};var _0x1d72e0={};var _0x454e00;var _0x620ba9;return db[_0xd013('0x3f')][_0xd013('0x69')]({'where':{'id':_0x309d77['params']['id']}})[_0xd013('0x21')](handleEntityNotFound(_0x31af2e,null))[_0xd013('0x21')](function(_0x8e8563){if(_0x8e8563){_0x454e00=_0x8e8563;_0x1d72e0[_0xd013('0x44')]=_[_0xd013('0x46')](db['User'][_0xd013('0x40')]);_0x1d72e0['query']=_[_0xd013('0x46')](_0x309d77['query']);_0x1d72e0[_0xd013('0x48')]=_[_0xd013('0x49')](_0x1d72e0['model'],_0x1d72e0[_0xd013('0x47')]);_0x2d6b36[_0xd013('0x4a')]=_['intersection'](_0x1d72e0[_0xd013('0x44')],qs['fields'](_0x309d77[_0xd013('0x47')][_0xd013('0x4b')]));_0x2d6b36[_0xd013('0x4a')]=_0x2d6b36[_0xd013('0x4a')][_0xd013('0x4c')]?_0x2d6b36[_0xd013('0x4a')]:_0x1d72e0[_0xd013('0x44')];_0x2d6b36[_0xd013('0x4e')]=qs[_0xd013('0x4f')](_0x309d77[_0xd013('0x47')][_0xd013('0x4f')]);_0x2d6b36[_0xd013('0x50')]=qs['filters'](_[_0xd013('0x51')](_0x309d77[_0xd013('0x47')],_0x1d72e0[_0xd013('0x48')]));if(_0x309d77[_0xd013('0x47')][_0xd013('0x52')]){_0x2d6b36[_0xd013('0x50')]=_[_0xd013('0x53')](_0x2d6b36[_0xd013('0x50')],{'$or':_['map'](_0x2d6b36[_0xd013('0x4a')],function(_0x58ca22){var _0x4defd2={};_0x4defd2[_0x58ca22]={'$like':'%'+_0x309d77[_0xd013('0x47')]['filter']+'%'};return _0x4defd2;})});}_0x2d6b36=_[_0xd013('0x53')]({},_0x2d6b36,_0x309d77[_0xd013('0x55')]);return _0x454e00[_0xd013('0xbf')](_0x2d6b36);}})[_0xd013('0x21')](function(_0x54b2bb){if(_0x54b2bb){_0x620ba9=_0x54b2bb[_0xd013('0x4c')];if(!_0x309d77[_0xd013('0x47')][_0xd013('0x73')](_0xd013('0x4d'))){_0x2d6b36[_0xd013('0x30')]=qs[_0xd013('0x30')](_0x309d77['query'][_0xd013('0x30')]);_0x2d6b36[_0xd013('0x2e')]=qs[_0xd013('0x2e')](_0x309d77[_0xd013('0x47')][_0xd013('0x2e')]);}return _0x454e00[_0xd013('0xbf')](_0x2d6b36);}})['then'](function(_0x33b565){if(_0x33b565){return _0x33b565?{'count':_0x620ba9,'rows':_0x33b565}:null;}})['then'](respondWithResult(_0x31af2e,null))['catch'](handleError(_0x31af2e,null));}; \ No newline at end of file +var _0xe419=['fullname','internal','Tags','color','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','priority','finally','sendStatus','getApplications','exten','localstationid','app','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','gateway','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Set','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Contacts','ListId','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','getAgents','User','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','http','client','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','params','describe','addDisposition','Disposition','findOne','pick','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','getInteractions','order','Contact'];(function(_0x2ec36f,_0x451fe8){var _0x1e6fbe=function(_0x38d7c7){while(--_0x38d7c7){_0x2ec36f['push'](_0x2ec36f['shift']());}};_0x1e6fbe(++_0x451fe8);}(_0xe419,0x10e));var _0x9e41=function(_0x17a858,_0x44ba58){_0x17a858=_0x17a858-0x0;var _0xa64aa1=_0xe419[_0x17a858];return _0xa64aa1;};'use strict';var emlformat=require(_0x9e41('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e41('0x1'));var rp=require(_0x9e41('0x2'));var moment=require(_0x9e41('0x3'));var BPromise=require(_0x9e41('0x4'));var Mustache=require('mustache');var util=require(_0x9e41('0x5'));var path=require(_0x9e41('0x6'));var sox=require(_0x9e41('0x7'));var csv=require('to-csv');var ejs=require(_0x9e41('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e41('0x9'));var squel=require(_0x9e41('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e41('0xb'));var deskjs=require(_0x9e41('0xc'));var toCsv=require(_0x9e41('0xd'));var querystring=require(_0x9e41('0xe'));var Papa=require(_0x9e41('0xf'));var Redis=require(_0x9e41('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9e41('0x11'));var hardwareService=require(_0x9e41('0x12'));var logger=require('../../config/logger')(_0x9e41('0x13'));var utils=require(_0x9e41('0x14'));var config=require(_0x9e41('0x15'));var licenseUtil=require(_0x9e41('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9e41('0x17')](config[_0x9e41('0x18')],{'host':_0x9e41('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e41('0x18')]));require('./faxAccount.socket')[_0x9e41('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9e41('0x1b')]({'port':0x232c});var client9002=jayson[_0x9e41('0x1c')][_0x9e41('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2f53c0,_0x5cc4db,_0x20a571,_0x4f8227){return new BPromise(function(_0x1d88b8,_0x518dd6){var _0x26636a=_0x4f8227||client;return _0x26636a[_0x9e41('0x1d')](_0x2f53c0,_0x20a571)['then'](function(_0x40d66c){logger[_0x9e41('0x1e')]('FaxAccount,\x20%s,\x20%s',_0x5cc4db,_0x9e41('0x1f'));logger[_0x9e41('0x20')](_0x9e41('0x21'),_0x5cc4db,_0x9e41('0x1f'),JSON['stringify'](_0x40d66c));if(_0x40d66c[_0x9e41('0x22')]){if(_0x40d66c[_0x9e41('0x22')][_0x9e41('0x23')]===0x1f4){logger[_0x9e41('0x22')]('FaxAccount,\x20%s,\x20%s',_0x5cc4db,_0x40d66c[_0x9e41('0x22')][_0x9e41('0x24')]);return _0x518dd6(_0x40d66c[_0x9e41('0x22')][_0x9e41('0x24')]);}logger['error'](_0x9e41('0x25'),_0x5cc4db,_0x40d66c['error']['message']);return _0x1d88b8(_0x40d66c['error']['message']);}else{logger[_0x9e41('0x1e')](_0x9e41('0x25'),_0x5cc4db,_0x9e41('0x1f'));_0x1d88b8(_0x40d66c[_0x9e41('0x26')][_0x9e41('0x24')]);}})[_0x9e41('0x27')](function(_0x12e248){logger[_0x9e41('0x22')](_0x9e41('0x25'),_0x5cc4db,_0x12e248);_0x518dd6(_0x12e248);});});}function respondWithStatusCode(_0x12c80f,_0x46259a){_0x46259a=_0x46259a||0xcc;return function(_0x21a0e6){if(_0x21a0e6){return _0x12c80f['sendStatus'](_0x46259a);}return _0x12c80f[_0x9e41('0x28')](_0x46259a)[_0x9e41('0x29')]();};}function respondWithResult(_0x3b4683,_0x4751c3){_0x4751c3=_0x4751c3||0xc8;return function(_0x440fb5){if(_0x440fb5){return _0x3b4683[_0x9e41('0x28')](_0x4751c3)[_0x9e41('0x2a')](_0x440fb5);}};}function respondWithFilteredResult(_0x532286,_0x5229aa){return function(_0x25a331){if(_0x25a331){var _0x174057=typeof _0x5229aa['offset']==='undefined'&&typeof _0x5229aa[_0x9e41('0x2b')]===_0x9e41('0x2c');var _0x48689e=_0x25a331[_0x9e41('0x2d')];var _0x52d475=_0x174057?0x0:_0x5229aa[_0x9e41('0x2e')];var _0x4708fb=_0x174057?_0x25a331[_0x9e41('0x2d')]:_0x5229aa[_0x9e41('0x2e')]+_0x5229aa['limit'];var _0x1feb11;if(_0x4708fb>=_0x48689e){_0x4708fb=_0x48689e;_0x1feb11=0xc8;}else{_0x1feb11=0xce;}_0x532286[_0x9e41('0x28')](_0x1feb11);return _0x532286[_0x9e41('0x2f')](_0x9e41('0x30'),_0x52d475+'-'+_0x4708fb+'/'+_0x48689e)[_0x9e41('0x2a')](_0x25a331);}return null;};}function patchUpdates(_0x529b45){return function(_0x3ec7e9){try{jsonpatch[_0x9e41('0x31')](_0x3ec7e9,_0x529b45,!![]);}catch(_0x17774f){return BPromise[_0x9e41('0x32')](_0x17774f);}return _0x3ec7e9[_0x9e41('0x33')]();};}function saveUpdates(_0x1c075d,_0x3fa81a){return function(_0x438e95){if(_0x438e95){return _0x438e95[_0x9e41('0x34')](_0x1c075d)[_0x9e41('0x35')](function(_0x1730c2){return _0x1730c2;});}return null;};}function removeEntity(_0x1e47c4,_0x437655){return function(_0x575711){if(_0x575711){return _0x575711['destroy']()[_0x9e41('0x35')](function(){var _0x252f65=_0x575711[_0x9e41('0x36')]({'plain':!![]});var _0x504f84=_0x9e41('0x37');return db[_0x9e41('0x38')][_0x9e41('0x39')]({'where':{'type':_0x504f84,'resourceId':_0x252f65['id']}})[_0x9e41('0x35')](function(){return _0x575711;});})['then'](function(){_0x1e47c4[_0x9e41('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x119169,_0x4fe3ae){return function(_0x1ec112){if(!_0x1ec112){_0x119169['sendStatus'](0x194);}return _0x1ec112;};}function handleError(_0x50e6e9,_0x3906d3){_0x3906d3=_0x3906d3||0x1f4;return function(_0x2ba882){logger['error'](_0x2ba882[_0x9e41('0x3a')]);if(_0x2ba882[_0x9e41('0x3b')]){delete _0x2ba882[_0x9e41('0x3b')];}_0x50e6e9[_0x9e41('0x28')](_0x3906d3)[_0x9e41('0x3c')](_0x2ba882);};}exports[_0x9e41('0x3d')]=function(_0x527d91,_0x4dca0d){var _0x4fca17={'include':[{'model':db[_0x9e41('0x3e')],'as':_0x9e41('0x3f')}]},_0x5e5273={},_0x113de2={'count':0x0,'rows':[]};var _0x4ec787=_[_0x9e41('0x40')](db[_0x9e41('0x41')][_0x9e41('0x42')],function(_0xe3b70f){return{'name':_0xe3b70f['fieldName'],'type':_0xe3b70f[_0x9e41('0x43')][_0x9e41('0x44')]};});_0x5e5273[_0x9e41('0x45')]=_[_0x9e41('0x40')](_0x4ec787,_0x9e41('0x3b'));_0x5e5273[_0x9e41('0x46')]=_['keys'](_0x527d91[_0x9e41('0x46')]);_0x5e5273['filters']=_[_0x9e41('0x47')](_0x5e5273[_0x9e41('0x45')],_0x5e5273[_0x9e41('0x46')]);_0x4fca17[_0x9e41('0x48')]=_[_0x9e41('0x47')](_0x5e5273[_0x9e41('0x45')],qs[_0x9e41('0x49')](_0x527d91[_0x9e41('0x46')][_0x9e41('0x49')]));_0x4fca17[_0x9e41('0x48')]=_0x4fca17[_0x9e41('0x48')][_0x9e41('0x4a')]?_0x4fca17[_0x9e41('0x48')]:_0x5e5273[_0x9e41('0x45')];if(!_0x527d91[_0x9e41('0x46')][_0x9e41('0x4b')](_0x9e41('0x4c'))){_0x4fca17['limit']=qs['limit'](_0x527d91[_0x9e41('0x46')][_0x9e41('0x2b')]);_0x4fca17['offset']=qs[_0x9e41('0x2e')](_0x527d91[_0x9e41('0x46')][_0x9e41('0x2e')]);}_0x4fca17['order']=qs[_0x9e41('0x4d')](_0x527d91[_0x9e41('0x46')]['sort']);_0x4fca17[_0x9e41('0x4e')]=qs[_0x9e41('0x4f')](_['pick'](_0x527d91[_0x9e41('0x46')],_0x5e5273['filters']),_0x4ec787);if(_0x527d91['query'][_0x9e41('0x50')]){_0x4fca17[_0x9e41('0x4e')]=_['merge'](_0x4fca17[_0x9e41('0x4e')],{'$or':_[_0x9e41('0x40')](_0x4ec787,function(_0x90f1dd){if(_0x90f1dd[_0x9e41('0x43')]!==_0x9e41('0x51')){var _0x22a440={};_0x22a440[_0x90f1dd['name']]={'$like':'%'+_0x527d91[_0x9e41('0x46')][_0x9e41('0x50')]+'%'};return _0x22a440;}})});}_0x4fca17=_[_0x9e41('0x52')]({},_0x4fca17,_0x527d91[_0x9e41('0x53')]);var _0x2d9af8={'where':_0x4fca17['where']};return db[_0x9e41('0x41')]['count'](_0x2d9af8)[_0x9e41('0x35')](function(_0x4ed790){_0x113de2[_0x9e41('0x2d')]=_0x4ed790;if(_0x527d91[_0x9e41('0x46')][_0x9e41('0x54')]){_0x4fca17[_0x9e41('0x55')]=[{'all':!![]}];}return db[_0x9e41('0x41')][_0x9e41('0x56')](_0x4fca17);})[_0x9e41('0x35')](function(_0x29954d){_0x113de2[_0x9e41('0x57')]=_0x29954d;return _0x113de2;})[_0x9e41('0x35')](respondWithFilteredResult(_0x4dca0d,_0x4fca17))[_0x9e41('0x27')](handleError(_0x4dca0d,null));};exports[_0x9e41('0x58')]=function(_0x2496d5,_0x4ee93d){var _0xdd6f4f={'raw':![],'where':{'id':_0x2496d5['params']['id']},'include':[{'model':db['Pause'],'as':_0x9e41('0x3f')}]},_0xd123dd={};_0xd123dd[_0x9e41('0x45')]=_['keys'](db['FaxAccount'][_0x9e41('0x42')]);_0xd123dd['query']=_[_0x9e41('0x59')](_0x2496d5[_0x9e41('0x46')]);_0xd123dd[_0x9e41('0x4f')]=_[_0x9e41('0x47')](_0xd123dd[_0x9e41('0x45')],_0xd123dd[_0x9e41('0x46')]);_0xdd6f4f[_0x9e41('0x48')]=_['intersection'](_0xd123dd['model'],qs[_0x9e41('0x49')](_0x2496d5[_0x9e41('0x46')]['fields']));_0xdd6f4f[_0x9e41('0x48')]=_0xdd6f4f[_0x9e41('0x48')][_0x9e41('0x4a')]?_0xdd6f4f['attributes']:_0xd123dd[_0x9e41('0x45')];if(_0x2496d5['query'][_0x9e41('0x54')]){_0xdd6f4f['include']=[{'all':!![]}];}_0xdd6f4f=_[_0x9e41('0x52')]({},_0xdd6f4f,_0x2496d5[_0x9e41('0x53')]);return db[_0x9e41('0x41')][_0x9e41('0x5a')](_0xdd6f4f)[_0x9e41('0x35')](handleEntityNotFound(_0x4ee93d,null))[_0x9e41('0x35')](respondWithResult(_0x4ee93d,null))[_0x9e41('0x27')](handleError(_0x4ee93d,null));};exports[_0x9e41('0x5b')]=function(_0x13b5ac,_0x5379d5){return db[_0x9e41('0x41')][_0x9e41('0x5b')](_0x13b5ac['body'],{})[_0x9e41('0x35')](function(_0x180a6b){var _0x5b795e=_0x13b5ac[_0x9e41('0x5c')]['get']({'plain':!![]});if(!_0x5b795e)throw new Error(_0x9e41('0x5d'));if(_0x5b795e[_0x9e41('0x5e')]===_0x9e41('0x5c')){var _0x205d86=_0x180a6b[_0x9e41('0x36')]({'plain':!![]});var _0x17b819=_0x9e41('0x37');return db[_0x9e41('0x5f')][_0x9e41('0x5a')]({'where':{'name':_0x17b819,'userProfileId':_0x5b795e[_0x9e41('0x60')]},'raw':!![]})['then'](function(_0x5d734d){if(_0x5d734d&&_0x5d734d['autoAssociation']===0x0){return db[_0x9e41('0x38')][_0x9e41('0x5b')]({'name':_0x205d86[_0x9e41('0x3b')],'resourceId':_0x205d86['id'],'type':_0x5d734d['name'],'sectionId':_0x5d734d['id']},{})['then'](function(){return _0x180a6b;});}else{return _0x180a6b;}})[_0x9e41('0x27')](function(_0x2ce7e6){logger[_0x9e41('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ce7e6);throw _0x2ce7e6;});}return _0x180a6b;})[_0x9e41('0x35')](respondWithResult(_0x5379d5,0xc9))['catch'](handleError(_0x5379d5,null));};exports[_0x9e41('0x34')]=function(_0x4f23a0,_0x3aed34){if(_0x4f23a0['body']['id']){delete _0x4f23a0[_0x9e41('0x61')]['id'];}return db[_0x9e41('0x41')][_0x9e41('0x5a')]({'where':{'id':_0x4f23a0[_0x9e41('0x62')]['id']},'include':[{'model':db[_0x9e41('0x3e')],'as':_0x9e41('0x3f')}]})[_0x9e41('0x35')](handleEntityNotFound(_0x3aed34,null))[_0x9e41('0x35')](saveUpdates(_0x4f23a0['body'],null))['then'](respondWithResult(_0x3aed34,null))[_0x9e41('0x27')](handleError(_0x3aed34,null));};exports[_0x9e41('0x39')]=function(_0x2e8070,_0x2d9b2){return db[_0x9e41('0x41')][_0x9e41('0x5a')]({'where':{'id':_0x2e8070['params']['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x2d9b2,null))[_0x9e41('0x35')](removeEntity(_0x2d9b2,null))[_0x9e41('0x27')](handleError(_0x2d9b2,null));};exports[_0x9e41('0x63')]=function(_0x4ab151,_0x2ac64d){return db[_0x9e41('0x41')]['describe']()[_0x9e41('0x35')](respondWithResult(_0x2ac64d,null))[_0x9e41('0x27')](handleError(_0x2ac64d,null));};exports[_0x9e41('0x64')]=function(_0x4b9739,_0xf6df3c,_0x10f6c7){if(_0x4b9739['body']['id']){delete _0x4b9739[_0x9e41('0x61')]['id'];}return db[_0x9e41('0x41')][_0x9e41('0x5a')]({'where':{'id':_0x4b9739[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0xf6df3c,null))['then'](function(_0x297047){if(_0x297047){_0x4b9739[_0x9e41('0x61')]['FaxAccountId']=_0x297047['id'];return db[_0x9e41('0x65')][_0x9e41('0x5b')](_0x4b9739[_0x9e41('0x61')]);}})[_0x9e41('0x35')](respondWithResult(_0xf6df3c,null))[_0x9e41('0x27')](handleError(_0xf6df3c,null));};exports['getDispositions']=function(_0x29be68,_0x637f3e,_0x2f70ba){var _0x454208={'raw':![],'where':{}};var _0x2e9362={};var _0x29be67={'count':0x0,'rows':[]};return db[_0x9e41('0x41')][_0x9e41('0x66')]({'where':{'id':_0x29be68[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x637f3e,null))[_0x9e41('0x35')](function(_0x530ee2){if(_0x530ee2){_0x2e9362[_0x9e41('0x45')]=_[_0x9e41('0x59')](db[_0x9e41('0x65')]['rawAttributes']);_0x2e9362[_0x9e41('0x46')]=_[_0x9e41('0x59')](_0x29be68[_0x9e41('0x46')]);_0x2e9362[_0x9e41('0x4f')]=_[_0x9e41('0x47')](_0x2e9362[_0x9e41('0x45')],_0x2e9362[_0x9e41('0x46')]);_0x454208['attributes']=_[_0x9e41('0x47')](_0x2e9362['model'],qs[_0x9e41('0x49')](_0x29be68[_0x9e41('0x46')][_0x9e41('0x49')]));_0x454208[_0x9e41('0x48')]=_0x454208[_0x9e41('0x48')][_0x9e41('0x4a')]?_0x454208['attributes']:_0x2e9362['model'];if(!_0x29be68['query'][_0x9e41('0x4b')](_0x9e41('0x4c'))){_0x454208[_0x9e41('0x2b')]=qs[_0x9e41('0x2b')](_0x29be68['query'][_0x9e41('0x2b')]);_0x454208[_0x9e41('0x2e')]=qs[_0x9e41('0x2e')](_0x29be68[_0x9e41('0x46')][_0x9e41('0x2e')]);}_0x454208['order']=qs['sort'](_0x29be68[_0x9e41('0x46')][_0x9e41('0x4d')]);_0x454208[_0x9e41('0x4e')]=qs[_0x9e41('0x4f')](_[_0x9e41('0x67')](_0x29be68[_0x9e41('0x46')],_0x2e9362[_0x9e41('0x4f')]));_0x454208[_0x9e41('0x4e')][_0x9e41('0x68')]=_0x530ee2['id'];if(_0x29be68[_0x9e41('0x46')][_0x9e41('0x50')]){_0x454208[_0x9e41('0x4e')]=_['merge'](_0x454208['where'],{'$or':_[_0x9e41('0x40')](_0x454208[_0x9e41('0x48')],function(_0x4e7437){var _0x2d705d={};_0x2d705d[_0x4e7437]={'$like':'%'+_0x29be68[_0x9e41('0x46')][_0x9e41('0x50')]+'%'};return _0x2d705d;})});}_0x454208=_[_0x9e41('0x52')]({},_0x454208,_0x29be68[_0x9e41('0x53')]);return db['Disposition'][_0x9e41('0x2d')]({'where':_0x454208[_0x9e41('0x4e')]})[_0x9e41('0x35')](function(_0x40ae14){_0x29be67[_0x9e41('0x2d')]=_0x40ae14;if(_0x29be68[_0x9e41('0x46')][_0x9e41('0x54')]){_0x454208[_0x9e41('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x454208);})[_0x9e41('0x35')](function(_0x1e79ad){_0x29be67[_0x9e41('0x57')]=_0x1e79ad;return _0x29be67;});}})['then'](respondWithFilteredResult(_0x637f3e,_0x454208))[_0x9e41('0x27')](handleError(_0x637f3e,null));};exports['removeDispositions']=function(_0x3760ec,_0x5cd40a,_0x5d25c5){return db['FaxAccount'][_0x9e41('0x5a')]({'where':{'id':_0x3760ec[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x5cd40a,null))['then'](function(_0x29e76e){if(_0x29e76e){return _0x29e76e[_0x9e41('0x69')](_0x3760ec['query'][_0x9e41('0x6a')]);}})['then'](respondWithStatusCode(_0x5cd40a,null))[_0x9e41('0x27')](handleError(_0x5cd40a,null));};exports[_0x9e41('0x6b')]=function(_0xfcfcdf,_0x106f11,_0x48bee2){if(_0xfcfcdf['body']['id']){delete _0xfcfcdf[_0x9e41('0x61')]['id'];}return db['FaxAccount'][_0x9e41('0x5a')]({'where':{'id':_0xfcfcdf['params']['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x106f11,null))[_0x9e41('0x35')](function(_0x41329f){if(_0x41329f){_0xfcfcdf[_0x9e41('0x61')][_0x9e41('0x68')]=_0x41329f['id'];return db[_0x9e41('0x6c')][_0x9e41('0x5b')](_0xfcfcdf[_0x9e41('0x61')]);}})[_0x9e41('0x35')](respondWithResult(_0x106f11,null))[_0x9e41('0x27')](handleError(_0x106f11,null));};exports[_0x9e41('0x6d')]=function(_0x31cb2f,_0x52b8b8,_0x19371e){var _0x1920d6={'raw':![],'where':{}};var _0x4fa0eb={};var _0x4db911={'count':0x0,'rows':[]};return db[_0x9e41('0x41')][_0x9e41('0x66')]({'where':{'id':_0x31cb2f[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x52b8b8,null))[_0x9e41('0x35')](function(_0xf85c7f){if(_0xf85c7f){_0x4fa0eb[_0x9e41('0x45')]=_[_0x9e41('0x59')](db[_0x9e41('0x6c')][_0x9e41('0x42')]);_0x4fa0eb['query']=_[_0x9e41('0x59')](_0x31cb2f[_0x9e41('0x46')]);_0x4fa0eb[_0x9e41('0x4f')]=_[_0x9e41('0x47')](_0x4fa0eb[_0x9e41('0x45')],_0x4fa0eb[_0x9e41('0x46')]);_0x1920d6['attributes']=_[_0x9e41('0x47')](_0x4fa0eb[_0x9e41('0x45')],qs[_0x9e41('0x49')](_0x31cb2f[_0x9e41('0x46')][_0x9e41('0x49')]));_0x1920d6[_0x9e41('0x48')]=_0x1920d6['attributes'][_0x9e41('0x4a')]?_0x1920d6[_0x9e41('0x48')]:_0x4fa0eb[_0x9e41('0x45')];if(!_0x31cb2f['query'][_0x9e41('0x4b')](_0x9e41('0x4c'))){_0x1920d6[_0x9e41('0x2b')]=qs[_0x9e41('0x2b')](_0x31cb2f['query'][_0x9e41('0x2b')]);_0x1920d6[_0x9e41('0x2e')]=qs[_0x9e41('0x2e')](_0x31cb2f[_0x9e41('0x46')][_0x9e41('0x2e')]);}_0x1920d6['order']=qs[_0x9e41('0x4d')](_0x31cb2f[_0x9e41('0x46')][_0x9e41('0x4d')]);_0x1920d6[_0x9e41('0x4e')]=qs[_0x9e41('0x4f')](_['pick'](_0x31cb2f[_0x9e41('0x46')],_0x4fa0eb['filters']));_0x1920d6['where']['FaxAccountId']=_0xf85c7f['id'];if(_0x31cb2f[_0x9e41('0x46')][_0x9e41('0x50')]){_0x1920d6[_0x9e41('0x4e')]=_[_0x9e41('0x52')](_0x1920d6[_0x9e41('0x4e')],{'$or':_['map'](_0x1920d6['attributes'],function(_0x341ca4){var _0x32f4ae={};_0x32f4ae[_0x341ca4]={'$like':'%'+_0x31cb2f[_0x9e41('0x46')]['filter']+'%'};return _0x32f4ae;})});}_0x1920d6=_[_0x9e41('0x52')]({},_0x1920d6,_0x31cb2f[_0x9e41('0x53')]);return db[_0x9e41('0x6c')]['count']({'where':_0x1920d6['where']})[_0x9e41('0x35')](function(_0x42a36b){_0x4db911[_0x9e41('0x2d')]=_0x42a36b;if(_0x31cb2f['query'][_0x9e41('0x54')]){_0x1920d6[_0x9e41('0x55')]=[{'all':!![]}];}return db[_0x9e41('0x6c')][_0x9e41('0x56')](_0x1920d6);})['then'](function(_0x3f087c){_0x4db911[_0x9e41('0x57')]=_0x3f087c;return _0x4db911;});}})[_0x9e41('0x35')](respondWithFilteredResult(_0x52b8b8,_0x1920d6))[_0x9e41('0x27')](handleError(_0x52b8b8,null));};exports[_0x9e41('0x6e')]=function(_0x57afaa,_0x4f4b36,_0x16ebff){return db[_0x9e41('0x41')]['find']({'where':{'id':_0x57afaa[_0x9e41('0x62')]['id']}})['then'](handleEntityNotFound(_0x4f4b36,null))[_0x9e41('0x35')](function(_0x2ec8b3){if(_0x2ec8b3){return _0x2ec8b3[_0x9e41('0x6e')](_0x57afaa['query'][_0x9e41('0x6a')]);}})[_0x9e41('0x35')](respondWithStatusCode(_0x4f4b36,null))['catch'](handleError(_0x4f4b36,null));};exports[_0x9e41('0x6f')]=function(_0x1e9702,_0x1b9ed4,_0x4dd5a0){return db[_0x9e41('0x70')][_0x9e41('0x5a')]({'where':{'id':_0x1e9702[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x1b9ed4,null))[_0x9e41('0x35')](function(_0x41226f){if(_0x41226f){return _0x41226f[_0x9e41('0x6f')](_0x1e9702['body'][_0x9e41('0x6a')],_['omit'](_0x1e9702[_0x9e41('0x61')],[_0x9e41('0x6a'),'id'])||{});}})[_0x9e41('0x35')](respondWithResult(_0x1b9ed4,null))['catch'](handleError(_0x1b9ed4,null));};exports[_0x9e41('0x71')]=function(_0x3d0b93,_0x5cabd8,_0x6102af){var _0xbc89c={'raw':![],'where':{}};var _0xc2599b={};var _0x1afdd4={'count':0x0,'rows':[]};return db[_0x9e41('0x41')][_0x9e41('0x66')]({'where':{'id':_0x3d0b93[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x5cabd8,null))['then'](function(_0x112baf){if(_0x112baf){_0xc2599b['model']=_[_0x9e41('0x59')](db['FaxInteraction'][_0x9e41('0x42')]);_0xc2599b['query']=_[_0x9e41('0x59')](_0x3d0b93[_0x9e41('0x46')]);_0xc2599b[_0x9e41('0x4f')]=_[_0x9e41('0x47')](_0xc2599b[_0x9e41('0x45')],_0xc2599b[_0x9e41('0x46')]);_0xbc89c['attributes']=_[_0x9e41('0x47')](_0xc2599b[_0x9e41('0x45')],qs['fields'](_0x3d0b93[_0x9e41('0x46')][_0x9e41('0x49')]));_0xbc89c[_0x9e41('0x48')]=_0xbc89c[_0x9e41('0x48')][_0x9e41('0x4a')]?_0xbc89c[_0x9e41('0x48')]:_0xc2599b[_0x9e41('0x45')];if(!_0x3d0b93['query'][_0x9e41('0x4b')](_0x9e41('0x4c'))){_0xbc89c['limit']=qs[_0x9e41('0x2b')](_0x3d0b93[_0x9e41('0x46')][_0x9e41('0x2b')]);_0xbc89c[_0x9e41('0x2e')]=qs['offset'](_0x3d0b93[_0x9e41('0x46')][_0x9e41('0x2e')]);}_0xbc89c[_0x9e41('0x72')]=qs[_0x9e41('0x4d')](_0x3d0b93[_0x9e41('0x46')]['sort']);_0xbc89c[_0x9e41('0x4e')]=qs[_0x9e41('0x4f')](_[_0x9e41('0x67')](_0x3d0b93[_0x9e41('0x46')],_0xc2599b[_0x9e41('0x4f')]));_0xbc89c['where'][_0x9e41('0x68')]=_0x112baf['id'];if(_0x3d0b93[_0x9e41('0x46')][_0x9e41('0x50')]){_0xbc89c[_0x9e41('0x4e')]=_[_0x9e41('0x52')](_0xbc89c[_0x9e41('0x4e')],{'$or':_[_0x9e41('0x40')](_0xbc89c['attributes'],function(_0x1cd2ca){var _0x5075e7={};_0x5075e7[_0x1cd2ca]={'$like':'%'+_0x3d0b93['query'][_0x9e41('0x50')]+'%'};return _0x5075e7;})});}_0xbc89c=_['merge']({},_0xbc89c,_0x3d0b93[_0x9e41('0x53')]);return db[_0x9e41('0x70')][_0x9e41('0x2d')]({'where':_0xbc89c['where']})[_0x9e41('0x35')](function(_0x1f75ed){_0x1afdd4[_0x9e41('0x2d')]=_0x1f75ed;if(_0x3d0b93[_0x9e41('0x46')][_0x9e41('0x54')]){_0xbc89c[_0x9e41('0x55')]=[{'model':db['CmContact'],'as':_0x9e41('0x73'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x9e41('0x3b'),_0x9e41('0x74'),_0x9e41('0x75')],'required':![]},{'model':db['Tag'],'as':_0x9e41('0x76'),'attributes':['id',_0x9e41('0x3b'),_0x9e41('0x77')],'where':_0x3d0b93['query']['tag']?{'id':_0x3d0b93[_0x9e41('0x46')]['tag']}:undefined,'required':_0x3d0b93['query']['tag']?!![]:![]}];}return db[_0x9e41('0x70')][_0x9e41('0x56')](_0xbc89c);})[_0x9e41('0x35')](function(_0x27ee68){_0x1afdd4[_0x9e41('0x57')]=_0x27ee68;return _0x1afdd4;});}})['then'](respondWithFilteredResult(_0x5cabd8,_0xbc89c))[_0x9e41('0x27')](handleError(_0x5cabd8,null));};exports[_0x9e41('0x78')]=function(_0x192a41,_0x2b0705){var _0x3f0079=_0x192a41['params']['id'];var _0x57273e=_0x192a41[_0x9e41('0x61')];var _0x41d2a2=0xc8;var _0x57a0ce=null;return db[_0x9e41('0x79')][_0x9e41('0x7a')]({'isolationLevel':db[_0x9e41('0x79')][_0x9e41('0x7b')][_0x9e41('0x7c')][_0x9e41('0x7d')]},function(_0x585c5){return db['FaxAccount'][_0x9e41('0x66')]({'where':{'id':_0x3f0079},'transaction':_0x585c5})[_0x9e41('0x35')](function(_0x29fc1d){if(_0x29fc1d){return db['FaxApplication'][_0x9e41('0x39')]({'where':{'FaxAccountId':_0x3f0079},'transaction':_0x585c5})['then'](function(){var _0x34eb76=_[_0x9e41('0x40')](_0x57273e,function(_0x322921){_0x322921['FaxAccountId']=_0x3f0079;return _0x322921;});return db['FaxApplication'][_0x9e41('0x7e')](_0x34eb76,{'transaction':_0x585c5});});}else{_0x41d2a2=0x194;_0x57a0ce=[];}});})[_0x9e41('0x35')](function(){if(_0x41d2a2!==0x194){return db[_0x9e41('0x7f')]['findAndCountAll']({'where':{'FaxAccountId':_0x3f0079},'order':_0x9e41('0x80')})[_0x9e41('0x35')](function(_0x2d04c7){_0x57a0ce=_0x2d04c7;});}})[_0x9e41('0x27')](function(_0x1c0639){_0x41d2a2=0x1f4;logger[_0x9e41('0x22')](_0x1c0639[_0x9e41('0x3a')]);if(_0x1c0639['name']){delete _0x1c0639['name'];}_0x57a0ce=_0x1c0639;})[_0x9e41('0x81')](function(){if(_0x57a0ce===null){_0x2b0705[_0x9e41('0x82')](_0x41d2a2);}else{if(_0x41d2a2===0x1f4){_0x2b0705['status'](_0x41d2a2)[_0x9e41('0x3c')](_0x57a0ce);}else{_0x2b0705[_0x9e41('0x28')](_0x41d2a2)[_0x9e41('0x2a')](_0x57a0ce);}}});};exports[_0x9e41('0x83')]=function(_0x12f077,_0x187a6c,_0x3b9b7b){var _0x6765cf={};var _0x2f6703={};var _0x299c51;var _0x1be50a;return db[_0x9e41('0x41')][_0x9e41('0x66')]({'where':{'id':_0x12f077[_0x9e41('0x62')]['id']}})['then'](handleEntityNotFound(_0x187a6c,null))[_0x9e41('0x35')](function(_0x18d7a7){if(_0x18d7a7){_0x299c51=_0x18d7a7;_0x2f6703['model']=_[_0x9e41('0x59')](db['FaxApplication'][_0x9e41('0x42')]);_0x2f6703[_0x9e41('0x46')]=_[_0x9e41('0x59')](_0x12f077[_0x9e41('0x46')]);_0x2f6703[_0x9e41('0x4f')]=_[_0x9e41('0x47')](_0x2f6703[_0x9e41('0x45')],_0x2f6703[_0x9e41('0x46')]);_0x6765cf['attributes']=_[_0x9e41('0x47')](_0x2f6703['model'],qs[_0x9e41('0x49')](_0x12f077[_0x9e41('0x46')][_0x9e41('0x49')]));_0x6765cf[_0x9e41('0x48')]=_0x6765cf[_0x9e41('0x48')]['length']?_0x6765cf[_0x9e41('0x48')]:_0x2f6703['model'];_0x6765cf[_0x9e41('0x72')]=qs[_0x9e41('0x4d')](_0x12f077[_0x9e41('0x46')][_0x9e41('0x4d')]);_0x6765cf[_0x9e41('0x4e')]=qs[_0x9e41('0x4f')](_['pick'](_0x12f077['query'],_0x2f6703[_0x9e41('0x4f')]));if(_0x12f077[_0x9e41('0x46')]['filter']){_0x6765cf['where']=_[_0x9e41('0x52')](_0x6765cf[_0x9e41('0x4e')],{'$or':_[_0x9e41('0x40')](_0x6765cf[_0x9e41('0x48')],function(_0x261b7d){var _0x471534={};_0x471534[_0x261b7d]={'$like':'%'+_0x12f077[_0x9e41('0x46')][_0x9e41('0x50')]+'%'};return _0x471534;})});}_0x6765cf=_[_0x9e41('0x52')]({},_0x6765cf,_0x12f077[_0x9e41('0x53')]);return _0x299c51[_0x9e41('0x83')](_0x6765cf);}})[_0x9e41('0x35')](function(_0x201b40){if(_0x201b40){_0x1be50a=_0x201b40['length'];if(!_0x12f077[_0x9e41('0x46')][_0x9e41('0x4b')](_0x9e41('0x4c'))){_0x6765cf[_0x9e41('0x2b')]=qs[_0x9e41('0x2b')](_0x12f077[_0x9e41('0x46')][_0x9e41('0x2b')]);_0x6765cf['offset']=qs[_0x9e41('0x2e')](_0x12f077[_0x9e41('0x46')]['offset']);}return _0x299c51['getApplications'](_0x6765cf);}})[_0x9e41('0x35')](function(_0x595b77){if(_0x595b77){return _0x595b77?{'count':_0x1be50a,'rows':_0x595b77}:null;}})['then'](respondWithResult(_0x187a6c,null))[_0x9e41('0x27')](handleError(_0x187a6c,null));};function Extension(_0x24d85b,_0x3d835d,_0x436574,_0x4bac47){this['context']='from-voip-provider';this[_0x9e41('0x84')]=_0x24d85b[_0x9e41('0x85')];this[_0x9e41('0x86')]=_0x4bac47;this[_0x9e41('0x43')]='system';this['description']=_0x9e41('0x87');this[_0x9e41('0x68')]=_0x24d85b['id'];this[_0x9e41('0x80')]=_0x3d835d;this['appdata']=_0x436574;}function createExtensionsReciveFax(_0x452099){var _0x4ff9d9=0x1;var _0x1ca544=[];_0x1ca544[_0x9e41('0x88')](new Extension(_0x452099,_0x4ff9d9,'',_0x9e41('0x89')));_0x4ff9d9+=0x1;_0x1ca544[_0x9e41('0x88')](new Extension(_0x452099,_0x4ff9d9,_0x9e41('0x8a'),'Set'));_0x4ff9d9+=0x1;for(var _0x51cb54 in _0x452099){if(_0x452099['hasOwnProperty'](_0x51cb54)&&(_0x51cb54===_0x9e41('0x8b')||_0x51cb54==='localstationid'||_0x51cb54===_0x9e41('0x8c')||_0x51cb54==='faxdetect'||_0x51cb54===_0x9e41('0x8d')||_0x51cb54===_0x9e41('0x8e')||_0x51cb54==='minrate'||_0x51cb54===_0x9e41('0x8f')||_0x51cb54===_0x9e41('0x90'))){_0x1ca544[_0x9e41('0x88')](new Extension(_0x452099,_0x4ff9d9,_0x9e41('0x91')+_0x51cb54+')='+_0x452099[_0x51cb54],_0x9e41('0x92')));_0x4ff9d9+=0x1;}}_0x1ca544[_0x9e41('0x88')](new Extension(_0x452099,_0x4ff9d9,'6',_0x9e41('0x93')));_0x4ff9d9+=0x1;_0x1ca544['push'](new Extension(_0x452099,_0x4ff9d9,'/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',_0x9e41('0x94')));_0x4ff9d9=0x0;return _0x1ca544;}exports[_0x9e41('0x95')]=function(_0x1b10f9,_0x4025e6,_0x4bab1e){var _0x4b2348;return db[_0x9e41('0x79')][_0x9e41('0x7a')](function(_0x31cd34){return db['FaxAccount'][_0x9e41('0x5b')](_0x1b10f9[_0x9e41('0x61')],{'transaction':_0x31cd34})['then'](function(_0x41970b){_0x4b2348=_0x41970b[_0x9e41('0x36')]({'plain':!![]});return db[_0x9e41('0x96')][_0x9e41('0x7e')](createExtensionsReciveFax(_0x4b2348),{'transaction':_0x31cd34});});})[_0x9e41('0x35')](function(){return _0x4b2348;})[_0x9e41('0x35')](respondWithResult(_0x4025e6,null))[_0x9e41('0x27')](handleError(_0x4025e6,null));};exports[_0x9e41('0x97')]=function(_0x2a3aed,_0xc2e09f,_0x542312){var _0x2399e2;return db[_0x9e41('0x79')][_0x9e41('0x7a')](function(_0x36b5e1){return db['FaxAccount'][_0x9e41('0x34')](_0x2a3aed['body'],{'where':{'id':_0x2a3aed[_0x9e41('0x61')]['id']},'transaction':_0x36b5e1})[_0x9e41('0x35')](function(_0x34ba38){return db['VoiceExtension'][_0x9e41('0x39')]({'where':{'FaxAccountId':_0x2a3aed['body']['id']},'transaction':_0x36b5e1})[_0x9e41('0x35')](function(_0x367fee){return db['VoiceExtension'][_0x9e41('0x7e')](createExtensionsReciveFax(_['omit'](_0x2a3aed[_0x9e41('0x61')],[_0x9e41('0x98'),_0x9e41('0x44'),_0x9e41('0x99'),_0x9e41('0x9a'),_0x9e41('0x9b'),'ListId'])),{'transaction':_0x36b5e1});});});})[_0x9e41('0x35')](function(){return db['FaxAccount']['findById'](_0x2a3aed[_0x9e41('0x61')]['id']);})[_0x9e41('0x35')](respondWithResult(_0xc2e09f,null))['catch'](handleError(_0xc2e09f,null));};exports[_0x9e41('0x9c')]=function(_0x5e1fa8,_0x31fb9d,_0x1aa444){var _0x18ef90={'raw':!![],'where':{}};var _0x4bedfc={};var _0x25b57a={'count':0x0,'rows':[]};return db[_0x9e41('0x41')]['findOne']({'where':{'id':_0x5e1fa8[_0x9e41('0x62')]['id']}})['then'](handleEntityNotFound(_0x31fb9d,null))[_0x9e41('0x35')](function(_0x55fdce){if(_0x55fdce){_0x4bedfc['model']=_[_0x9e41('0x59')](db[_0x9e41('0x9d')][_0x9e41('0x42')]);_0x4bedfc['query']=_[_0x9e41('0x59')](_0x5e1fa8[_0x9e41('0x46')]);_0x4bedfc[_0x9e41('0x4f')]=_[_0x9e41('0x47')](_0x4bedfc[_0x9e41('0x45')],_0x4bedfc[_0x9e41('0x46')]);_0x18ef90[_0x9e41('0x48')]=_['intersection'](_0x4bedfc[_0x9e41('0x45')],qs[_0x9e41('0x49')](_0x5e1fa8[_0x9e41('0x46')]['fields']));_0x18ef90[_0x9e41('0x48')]=_0x18ef90['attributes'][_0x9e41('0x4a')]?_0x18ef90[_0x9e41('0x48')]:_0x4bedfc['model'];if(!_0x5e1fa8['query'][_0x9e41('0x4b')](_0x9e41('0x4c'))){_0x18ef90[_0x9e41('0x2b')]=qs[_0x9e41('0x2b')](_0x5e1fa8[_0x9e41('0x46')][_0x9e41('0x2b')]);_0x18ef90['offset']=qs[_0x9e41('0x2e')](_0x5e1fa8[_0x9e41('0x46')]['offset']);}_0x18ef90['order']=qs[_0x9e41('0x4d')](_0x5e1fa8[_0x9e41('0x46')][_0x9e41('0x4d')]);_0x18ef90[_0x9e41('0x4e')]=qs[_0x9e41('0x4f')](_[_0x9e41('0x67')](_0x5e1fa8['query'],_0x4bedfc[_0x9e41('0x4f')]));_0x18ef90[_0x9e41('0x4e')][_0x9e41('0x68')]=_0x55fdce['id'];if(_0x5e1fa8[_0x9e41('0x46')][_0x9e41('0x50')]){_0x18ef90[_0x9e41('0x4e')]=_[_0x9e41('0x52')](_0x18ef90[_0x9e41('0x4e')],{'$or':_[_0x9e41('0x40')](_0x18ef90[_0x9e41('0x48')],function(_0xfdcb05){var _0x3eadea={};_0x3eadea[_0xfdcb05]={'$like':'%'+_0x5e1fa8[_0x9e41('0x46')][_0x9e41('0x50')]+'%'};return _0x3eadea;})});}if(_0x5e1fa8[_0x9e41('0x46')][_0x9e41('0x9e')]){var _0x3d69a5=_0x5e1fa8[_0x9e41('0x46')][_0x9e41('0x9e')][_0x9e41('0x9f')](',');var _0x3d03c0={};_0x3d03c0[_0x3d69a5[0x0]]={'$gte':moment(_0x3d69a5[0x1])[_0x9e41('0xa0')](_0x9e41('0xa1'))};_0x18ef90['where']=_[_0x9e41('0x52')](_0x18ef90['where'],_0x3d03c0);}_0x18ef90=_[_0x9e41('0x52')]({},_0x18ef90,_0x5e1fa8[_0x9e41('0x53')]);return db[_0x9e41('0x9d')][_0x9e41('0x2d')]({'where':_0x18ef90['where']})[_0x9e41('0x35')](function(_0x22db11){_0x25b57a[_0x9e41('0x2d')]=_0x22db11;if(_0x5e1fa8['query']['includeAll']){_0x18ef90[_0x9e41('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0x9e41('0x56')](_0x18ef90);})[_0x9e41('0x35')](function(_0x5578cc){_0x25b57a[_0x9e41('0x57')]=_0x5578cc;return _0x25b57a;});}})[_0x9e41('0x35')](respondWithFilteredResult(_0x31fb9d,_0x18ef90))[_0x9e41('0x27')](handleError(_0x31fb9d,null));};exports[_0x9e41('0x3c')]=function(_0x26f755,_0x27a908,_0x23a91f){var _0x2cd65,_0x3d5139={},_0x43ca5c;if(_0x26f755[_0x9e41('0x61')]['to']){_0x43ca5c=_0x26f755[_0x9e41('0x61')]['to'][0x0];}return db[_0x9e41('0x41')][_0x9e41('0x5a')]({'where':{'id':_0x26f755['params']['id']},'include':[{'model':db[_0x9e41('0xa2')],'as':_0x9e41('0xa3'),'include':[{'model':db[_0x9e41('0xa4')],'as':'Contacts','where':{'fax':_0x43ca5c},'limit':0x1,'order':[[_0x9e41('0x9a'),_0x9e41('0xa5')]]}]}]})[_0x9e41('0x35')](handleEntityNotFound(_0x27a908,null))[_0x9e41('0x35')](function(_0x45e77a){_0x2cd65=_0x45e77a;if(_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')]&&_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')][_0x9e41('0x4a')]){for(var _0x3c687a=0x0;_0x3c687a<_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')][_0x9e41('0x4a')];_0x3c687a+=0x1){_0x26f755['body']['attachments'][_0x3c687a]={'filename':_0x26f755['body']['attachments'][_0x3c687a][_0x9e41('0x3b')],'id':_0x26f755[_0x9e41('0x61')]['attachments'][_0x3c687a]['id'],'path':path[_0x9e41('0xa7')](config['root'],_0x9e41('0xa8'),_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')][_0x3c687a][_0x9e41('0xa9')])};}}return respondWithRpcPromise('CheckAfterSend',_0x9e41('0xaa'),{'FaxAccountId':_[_0x9e41('0xab')](_0x26f755[_0x9e41('0x62')]['id'])?undefined:_0x26f755[_0x9e41('0x62')]['id'],'path':_['isNil'](_0x26f755['body']['attachments'][0x0][_0x9e41('0x6')])?undefined:_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')][0x0][_0x9e41('0x6')],'fax':_[_0x9e41('0xab')](_0x26f755['body']['to'][0x0])?undefined:_0x26f755[_0x9e41('0x61')]['to'][0x0]},client9002);})[_0x9e41('0x35')](function(){if(_0x2cd65){if(_['isNil'](_0x26f755[_0x9e41('0x61')][_0x9e41('0xac')])){_0x26f755[_0x9e41('0x61')][_0x9e41('0xac')]=util[_0x9e41('0xa0')](_0x9e41('0xad'),_0x2cd65[_0x9e41('0x3b')],_0x2cd65['fax']);}if(_0x2cd65[_0x9e41('0xa3')]){if(_0x2cd65[_0x9e41('0xa3')]['Contacts']['length']){return _0x2cd65[_0x9e41('0xa3')][_0x9e41('0xae')][0x0];}else{return db[_0x9e41('0xa4')][_0x9e41('0x5b')](_[_0x9e41('0x17')](_0x26f755[_0x9e41('0x61')],{'firstName':_0x26f755[_0x9e41('0x61')]['to'][0x0],'phone':_0x26f755[_0x9e41('0x61')]['to'][0x0],'fax':_0x26f755[_0x9e41('0x61')]['to'][0x0],'ListId':_0x2cd65[_0x9e41('0xaf')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x9e41('0xb0'));}})['then'](function(_0x51f597){if(_0x51f597){return db[_0x9e41('0x70')][_0x9e41('0x5a')]({'where':{'ContactId':_0x51f597['id'],'closed':![],'FaxAccountId':_0x2cd65['id']}})['then'](function(_0x4b3c9f){if(_0x4b3c9f){return[_0x4b3c9f,![]];}return db[_0x9e41('0x70')][_0x9e41('0x5b')]({'UserId':_0x26f755[_0x9e41('0x5c')]['id'],'ContactId':_0x51f597['id'],'FaxAccountId':_0x2cd65['id'],'fax':_0x26f755[_0x9e41('0x61')]['to'][0x0],'firstMsgDirection':_0x9e41('0xb1'),'Messages':[_[_0x9e41('0x52')](_0x26f755[_0x9e41('0x61')],{'read':![],'body':_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')][0x0][_0x9e41('0xb2')],'FaxAccountId':_0x2cd65['id'],'UserId':_0x26f755['user']['id'],'ContactId':_0x51f597['id'],'AttachmentId':_0x26f755[_0x9e41('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x9e41('0x9d')],'as':_0x9e41('0xb3')}]})['then'](function(_0x99838c){return[_0x99838c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x9e41('0xb4')](function(_0x24e0eb,_0x471243){if(_0x471243){return _0x24e0eb;}return db[_0x9e41('0x9d')][_0x9e41('0x5b')]({'direction':_0x9e41('0xb1'),'read':![],'body':_0x26f755['body'][_0x9e41('0xa6')][0x0][_0x9e41('0xb2')],'FaxAccountId':_0x2cd65['id'],'FaxInteractionId':_0x24e0eb['id'],'UserId':_0x26f755[_0x9e41('0x5c')]['id'],'ContactId':_0x24e0eb[_0x9e41('0xb5')],'AttachmentId':_0x26f755[_0x9e41('0x61')]['attachments'][0x0]['id']})[_0x9e41('0x35')](function(_0x1a707f){_0x24e0eb['dataValues'][_0x9e41('0xb3')]=[];_0x24e0eb[_0x9e41('0xb6')][_0x9e41('0xb3')][_0x9e41('0x88')](_0x1a707f[_0x9e41('0xb6')]);return _0x24e0eb;});})[_0x9e41('0x35')](function(_0x348029){respondWithRpcPromise(_0x9e41('0xb7'),_0x9e41('0xb7'),{'FaxAccountId':_[_0x9e41('0xab')](_0x26f755[_0x9e41('0x62')]['id'])?undefined:_0x26f755[_0x9e41('0x62')]['id'],'path':_['isNil'](_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')][0x0][_0x9e41('0x6')])?undefined:_0x26f755['body'][_0x9e41('0xa6')][0x0][_0x9e41('0x6')],'fax':_['isNil'](_0x26f755[_0x9e41('0x61')]['to'][0x0])?undefined:_0x26f755[_0x9e41('0x61')]['to'][0x0],'AttachmentId':_0x26f755[_0x9e41('0x61')][_0x9e41('0xa6')][0x0]['id']},client9002)[_0x9e41('0x35')](function(_0x21d0a1){logger['info'](_0x9e41('0xb8'),_0x21d0a1);})[_0x9e41('0x27')](function(_0x32cad2){logger[_0x9e41('0x1e')](_0x9e41('0xb8'),_0x32cad2);});return _0x348029;})[_0x9e41('0x35')](respondWithResult(_0x27a908,null))[_0x9e41('0x27')](handleError(_0x27a908,null));};exports[_0x9e41('0xb9')]=function(_0x3190fc,_0x3dbd24,_0x2227dc){return db[_0x9e41('0x41')][_0x9e41('0x5a')]({'where':{'id':_0x3190fc[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x3dbd24,null))[_0x9e41('0x35')](function(_0x56419d){if(_0x56419d){return _0x56419d['addAgents'](_0x3190fc[_0x9e41('0x61')][_0x9e41('0x6a')],_[_0x9e41('0xba')](_0x3190fc[_0x9e41('0x61')],[_0x9e41('0x6a'),'id'])||{})['spread'](function(_0x46d971){for(var _0x5ec691=0x0;_0x5ec691<_0x3190fc[_0x9e41('0x61')]['ids'][_0x9e41('0x4a')];_0x5ec691+=0x1){socket['emit'](_0x9e41('0xbb'),{'UserId':Number(_0x3190fc[_0x9e41('0x61')][_0x9e41('0x6a')][_0x5ec691]),'FaxAccountId':Number(_0x3190fc[_0x9e41('0x62')]['id'])});}return _0x46d971;});}})['then'](respondWithResult(_0x3dbd24,null))[_0x9e41('0x27')](handleError(_0x3dbd24,null));};exports[_0x9e41('0xbc')]=function(_0x47d057,_0x4738be,_0x55cd17){return db[_0x9e41('0x41')][_0x9e41('0x5a')]({'where':{'id':_0x47d057['params']['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x4738be,null))[_0x9e41('0x35')](function(_0x356275){if(_0x356275){return _0x356275[_0x9e41('0xbc')](_0x47d057[_0x9e41('0x46')][_0x9e41('0x6a')])[_0x9e41('0x35')](function(){if(_['isArray'](_0x47d057['query'][_0x9e41('0x6a')])){for(var _0x482262=0x0;_0x482262<_0x47d057[_0x9e41('0x46')][_0x9e41('0x6a')]['length'];_0x482262+=0x1){socket[_0x9e41('0xbd')](_0x9e41('0xbe'),{'UserId':Number(_0x47d057[_0x9e41('0x46')]['ids'][_0x482262]),'FaxAccountId':Number(_0x47d057[_0x9e41('0x62')]['id'])});}}else{socket['emit'](_0x9e41('0xbe'),{'UserId':Number(_0x47d057[_0x9e41('0x46')][_0x9e41('0x6a')]),'FaxAccountId':Number(_0x47d057[_0x9e41('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x4738be,null))['catch'](handleError(_0x4738be,null));};exports[_0x9e41('0xbf')]=function(_0x15725b,_0x5b727d,_0x22e2f2){var _0x101af5={};var _0x2a4a19={};var _0x1b981c;var _0xc42102;return db['FaxAccount'][_0x9e41('0x66')]({'where':{'id':_0x15725b[_0x9e41('0x62')]['id']}})[_0x9e41('0x35')](handleEntityNotFound(_0x5b727d,null))[_0x9e41('0x35')](function(_0x2ea6a2){if(_0x2ea6a2){_0x1b981c=_0x2ea6a2;_0x2a4a19[_0x9e41('0x45')]=_['keys'](db[_0x9e41('0xc0')][_0x9e41('0x42')]);_0x2a4a19[_0x9e41('0x46')]=_[_0x9e41('0x59')](_0x15725b[_0x9e41('0x46')]);_0x2a4a19[_0x9e41('0x4f')]=_[_0x9e41('0x47')](_0x2a4a19[_0x9e41('0x45')],_0x2a4a19['query']);_0x101af5[_0x9e41('0x48')]=_[_0x9e41('0x47')](_0x2a4a19[_0x9e41('0x45')],qs[_0x9e41('0x49')](_0x15725b[_0x9e41('0x46')][_0x9e41('0x49')]));_0x101af5[_0x9e41('0x48')]=_0x101af5[_0x9e41('0x48')]['length']?_0x101af5[_0x9e41('0x48')]:_0x2a4a19[_0x9e41('0x45')];_0x101af5['order']=qs[_0x9e41('0x4d')](_0x15725b[_0x9e41('0x46')][_0x9e41('0x4d')]);_0x101af5[_0x9e41('0x4e')]=qs[_0x9e41('0x4f')](_[_0x9e41('0x67')](_0x15725b['query'],_0x2a4a19[_0x9e41('0x4f')]));if(_0x15725b[_0x9e41('0x46')]['filter']){_0x101af5[_0x9e41('0x4e')]=_[_0x9e41('0x52')](_0x101af5[_0x9e41('0x4e')],{'$or':_['map'](_0x101af5[_0x9e41('0x48')],function(_0x2322bb){var _0x19d750={};_0x19d750[_0x2322bb]={'$like':'%'+_0x15725b[_0x9e41('0x46')]['filter']+'%'};return _0x19d750;})});}_0x101af5=_[_0x9e41('0x52')]({},_0x101af5,_0x15725b[_0x9e41('0x53')]);return _0x1b981c[_0x9e41('0xbf')](_0x101af5);}})[_0x9e41('0x35')](function(_0x6e6d6d){if(_0x6e6d6d){_0xc42102=_0x6e6d6d['length'];if(!_0x15725b[_0x9e41('0x46')][_0x9e41('0x4b')](_0x9e41('0x4c'))){_0x101af5[_0x9e41('0x2b')]=qs['limit'](_0x15725b['query'][_0x9e41('0x2b')]);_0x101af5[_0x9e41('0x2e')]=qs['offset'](_0x15725b[_0x9e41('0x46')]['offset']);}return _0x1b981c[_0x9e41('0xbf')](_0x101af5);}})[_0x9e41('0x35')](function(_0x3a1c05){if(_0x3a1c05){return _0x3a1c05?{'count':_0xc42102,'rows':_0x3a1c05}:null;}})['then'](respondWithResult(_0x5b727d,null))['catch'](handleError(_0x5b727d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7275b7d..67bfe6e 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 _0xbd44=['save','update','emit','hook','exports','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x4a1ec6,_0x4bb13d){var _0x1439f7=function(_0x17a62d){while(--_0x17a62d){_0x4a1ec6['push'](_0x4a1ec6['shift']());}};_0x1439f7(++_0x4bb13d);}(_0xbd44,0x17d));var _0x4bd4=function(_0x230bac,_0xaa1726){_0x230bac=_0x230bac-0x0;var _0x337068=_0xbd44[_0x230bac];return _0x337068;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x4bd4('0x0'))['db'][_0x4bd4('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4bd4('0x2')](0x0);var events={'afterCreate':_0x4bd4('0x3'),'afterUpdate':_0x4bd4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7941d0){return function(_0x4cf62f,_0x612471,_0x44df5c){FaxAccountEvents[_0x4bd4('0x5')](_0x7941d0+':'+_0x4cf62f['id'],_0x4cf62f);FaxAccountEvents[_0x4bd4('0x5')](_0x7941d0,_0x4cf62f);_0x44df5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x4bd4('0x6')](e,emitEvent(event));}}module[_0x4bd4('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x2f56=['hook','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x51946c,_0x1a9fc7){var _0x3f318a=function(_0x132665){while(--_0x132665){_0x51946c['push'](_0x51946c['shift']());}};_0x3f318a(++_0x1a9fc7);}(_0x2f56,0xb5));var _0x62f5=function(_0x19a92e,_0x21236b){_0x19a92e=_0x19a92e-0x0;var _0x5c4df6=_0x2f56[_0x19a92e];return _0x5c4df6;};'use strict';var EventEmitter=require(_0x62f5('0x0'));var FaxAccount=require(_0x62f5('0x1'))['db'][_0x62f5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x62f5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x62f5('0x4'),'afterDestroy':_0x62f5('0x5')};function emitEvent(_0x41ad3d){return function(_0xbdd22f,_0x460fc0,_0x48f920){FaxAccountEvents[_0x62f5('0x6')](_0x41ad3d+':'+_0xbdd22f['id'],_0xbdd22f);FaxAccountEvents[_0x62f5('0x6')](_0x41ad3d,_0xbdd22f);_0x48f920(null);};}for(var e in events){if(events[_0x62f5('0x7')](e)){var event=events[e];FaxAccount[_0x62f5('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 9ce7efa..1410a9b 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 _0xc89a=['./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','api','moment','bluebird','path','../../config/environment'];(function(_0x169ab4,_0x5cb5cf){var _0x2bdd67=function(_0x85e896){while(--_0x85e896){_0x169ab4['push'](_0x169ab4['shift']());}};_0x2bdd67(++_0x5cb5cf);}(_0xc89a,0xb5));var _0xac89=function(_0x3337ca,_0x22ae1c){_0x3337ca=_0x3337ca-0x0;var _0x3a7472=_0xc89a[_0x3337ca];return _0x3a7472;};'use strict';var _=require('lodash');var util=require(_0xac89('0x0'));var logger=require('../../config/logger')(_0xac89('0x1'));var moment=require(_0xac89('0x2'));var BPromise=require(_0xac89('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac89('0x4'));var rimraf=require('rimraf');var config=require(_0xac89('0x5'));var attributes=require(_0xac89('0x6'));module[_0xac89('0x7')]=function(_0x10ff3b,_0x4ccb97){return _0x10ff3b[_0xac89('0x8')](_0xac89('0x9'),attributes,{'tableName':_0xac89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6fc=['../../config/logger','moment','bluebird','path','rimraf','exports','define','FaxAccount','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb6fc,0x170));var _0xcb6f=function(_0x48ed97,_0x5b03d7){_0x48ed97=_0x48ed97-0x0;var _0x459423=_0xb6fc[_0x48ed97];return _0x459423;};'use strict';var _=require('lodash');var util=require(_0xcb6f('0x0'));var logger=require(_0xcb6f('0x1'))('api');var moment=require(_0xcb6f('0x2'));var BPromise=require(_0xcb6f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb6f('0x4'));var rimraf=require(_0xcb6f('0x5'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0xcb6f('0x6')]=function(_0x293c31,_0x55fc36){return _0x293c31[_0xcb6f('0x7')](_0xcb6f('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index d09bef0..1e34678 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 _0x3383=['result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetFaxAccount','stringify','NotifyFaxAccount','body','CmContact','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','ValidationError','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','then','find','CmList','Contacts','DESC','FaxApplication','Applications','applications','list','List','priority','account','length','mapKey','create','contact','FaxInteraction','get','autoclose','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','info'];(function(_0x5bb2fe,_0x1785e5){var _0x1b89c4=function(_0x359d59){while(--_0x359d59){_0x5bb2fe['push'](_0x5bb2fe['shift']());}};_0x1b89c4(++_0x1785e5);}(_0x3383,0x1ab));var _0x3338=function(_0x70c55a,_0x2ea78e){_0x70c55a=_0x70c55a-0x0;var _0x27732b=_0x3383[_0x70c55a];return _0x27732b;};'use strict';var _=require(_0x3338('0x0'));var util=require(_0x3338('0x1'));var moment=require(_0x3338('0x2'));var BPromise=require(_0x3338('0x3'));var rs=require(_0x3338('0x4'));var fs=require('fs');var Redis=require(_0x3338('0x5'));var db=require(_0x3338('0x6'))['db'];var utils=require(_0x3338('0x7'));var logger=require(_0x3338('0x8'))(_0x3338('0x9'));var config=require(_0x3338('0xa'));var jayson=require(_0x3338('0xb'));var client=jayson[_0x3338('0xc')][_0x3338('0xd')]({'port':0x232c});config['redis']=_[_0x3338('0xe')](config[_0x3338('0xf')],{'host':_0x3338('0x10'),'port':0x18eb});var socket=require(_0x3338('0x11'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x3338('0x12')](socket);function respondWithRpcPromise(_0x550a2b,_0x3f4d68,_0x5600a6){return new BPromise(function(_0x402b38,_0x424d97){return client[_0x3338('0x13')](_0x550a2b,_0x5600a6)['then'](function(_0x521a9b){logger['info']('FaxAccount,\x20%s,\x20%s',_0x3f4d68,_0x3338('0x14'));logger[_0x3338('0x15')](_0x3338('0x16'),_0x3f4d68,_0x3338('0x14'),JSON['stringify'](_0x521a9b));if(_0x521a9b[_0x3338('0x17')]){if(_0x521a9b[_0x3338('0x17')][_0x3338('0x18')]===0x1f4){logger[_0x3338('0x17')](_0x3338('0x19'),_0x3f4d68,_0x521a9b[_0x3338('0x17')][_0x3338('0x1a')]);return _0x424d97(_0x521a9b['error'][_0x3338('0x1a')]);}logger[_0x3338('0x17')](_0x3338('0x19'),_0x3f4d68,_0x521a9b[_0x3338('0x17')][_0x3338('0x1a')]);return _0x402b38(_0x521a9b[_0x3338('0x17')][_0x3338('0x1a')]);}else{logger[_0x3338('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x3f4d68,_0x3338('0x14'));_0x402b38(_0x521a9b[_0x3338('0x1c')][_0x3338('0x1a')]);}})[_0x3338('0x1d')](function(_0x35bd92){logger[_0x3338('0x17')](_0x3338('0x19'),_0x3f4d68,_0x35bd92);_0x424d97(_0x35bd92);});});}exports['GetFaxAccount']=function(_0x33c9f7){var _0x793817=this;return new Promise(function(_0x4c462e,_0x5b9cab){return db[_0x3338('0x1e')][_0x3338('0x1f')]({'raw':_0x33c9f7['options']?_0x33c9f7[_0x3338('0x20')][_0x3338('0x21')]===undefined?!![]:![]:!![],'where':_0x33c9f7['options']?_0x33c9f7['options'][_0x3338('0x22')]||null:null,'attributes':_0x33c9f7['options']?_0x33c9f7['options'][_0x3338('0x23')]||null:null,'limit':_0x33c9f7['options']?_0x33c9f7[_0x3338('0x20')][_0x3338('0x24')]||null:null,'include':_0x33c9f7[_0x3338('0x20')]?_0x33c9f7[_0x3338('0x20')]['include']?_[_0x3338('0x25')](_0x33c9f7[_0x3338('0x20')][_0x3338('0x26')],function(_0x6d09a2){return{'model':db[_0x6d09a2['model']],'as':_0x6d09a2['as'],'attributes':_0x6d09a2[_0x3338('0x23')],'include':_0x6d09a2[_0x3338('0x26')]?_[_0x3338('0x25')](_0x6d09a2['include'],function(_0x1ee363){return{'model':db[_0x1ee363[_0x3338('0x27')]],'as':_0x1ee363['as'],'attributes':_0x1ee363[_0x3338('0x23')],'include':_0x1ee363[_0x3338('0x26')]?_[_0x3338('0x25')](_0x1ee363[_0x3338('0x26')],function(_0x441d5f){return{'model':db[_0x441d5f[_0x3338('0x27')]],'as':_0x441d5f['as'],'attributes':_0x441d5f[_0x3338('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49727d){logger[_0x3338('0x1b')](_0x3338('0x28'),_0x33c9f7);logger[_0x3338('0x15')](_0x3338('0x28'),_0x33c9f7,JSON[_0x3338('0x29')](_0x49727d));_0x4c462e(_0x49727d);})[_0x3338('0x1d')](function(_0x41148e){logger[_0x3338('0x17')](_0x3338('0x28'),_0x41148e[_0x3338('0x1a')],_0x33c9f7);_0x5b9cab(_0x793817[_0x3338('0x17')](0x1f4,_0x41148e['message']));});});};exports[_0x3338('0x2a')]=function(_0x12d118,_0x2c2725,_0x5dbafa){var _0x16daa5=this;return new Promise(function(_0x5698c5,_0x353dd9){var _0x118be8={'body':_0x12d118[_0x3338('0x2b')],'channel':'fax'};var _0x3bdca3=[];var _0x2659a8=[];var _0x1cb33={};return db[_0x3338('0x2c')]['describe']()['then'](function(_0x77b9ab){if(!_0x77b9ab){throw new db[(_0x3338('0x2d'))]['ValidationError'](_0x3338('0x2e'));}_0x3bdca3=_[_0x3338('0x2f')](_[_0x3338('0x30')](_0x77b9ab),[_0x3338('0x31'),_0x3338('0x32')]);_0x2659a8=_[_0x3338('0x2f')](_['keys'](_0x77b9ab),[_0x3338('0x31'),_0x3338('0x32'),_0x3338('0x33'),_0x3338('0x34')]);if(_0x12d118[_0x3338('0x2b')]['id']){delete _0x12d118[_0x3338('0x2b')]['id'];}if(_[_0x3338('0x35')](_0x12d118['body'][_0x3338('0x36')])){throw new db[(_0x3338('0x2d'))]['ValidationError'](_0x3338('0x37'));}if(_[_0x3338('0x35')](_0x12d118[_0x3338('0x2b')][_0x3338('0x2b')])||_0x12d118[_0x3338('0x2b')][_0x3338('0x2b')]===''){throw new db[(_0x3338('0x2d'))]['ValidationError'](_0x3338('0x38'));}if(_[_0x3338('0x35')](_0x12d118[_0x3338('0x2b')]['mapKey'])){throw new db['Sequelize'][(_0x3338('0x39'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2659a8);}if(!_['includes'](_0x2659a8,_0x12d118[_0x3338('0x2b')]['mapKey'])){throw new db[(_0x3338('0x2d'))][(_0x3338('0x39'))](_0x3338('0x3a')+_0x2659a8);}_0x1cb33[_0x12d118[_0x3338('0x2b')]['mapKey']]=_0x12d118['body'][_0x3338('0x36')];})[_0x3338('0x3b')](function(){return db[_0x3338('0x1e')][_0x3338('0x3c')]({'where':{'id':_0x12d118['account']['id']},'include':[{'model':db[_0x3338('0x3d')],'as':'List','include':[{'model':db[_0x3338('0x2c')],'as':_0x3338('0x3e'),'where':_0x1cb33,'limit':0x1,'order':[[_0x3338('0x32'),_0x3338('0x3f')]]}]},{'model':db[_0x3338('0x40')],'as':_0x3338('0x41')}]});})[_0x3338('0x3b')](function(_0x518468){if(_0x518468&&_0x518468['List']){var _0x340746=_0x518468['get']({'plain':!![]});_0x118be8['account']=_0x340746;_0x118be8[_0x3338('0x42')]=_0x340746[_0x3338('0x41')];_0x118be8[_0x3338('0x43')]=_0x340746[_0x3338('0x44')];_0x118be8[_0x3338('0x42')]=_['orderBy'](_0x118be8[_0x3338('0x42')],[_0x3338('0x45')],['asc']);if(_0x118be8['account']['Applications']){delete _0x118be8[_0x3338('0x46')][_0x3338('0x41')];}if(_0x118be8['account'][_0x3338('0x44')]&&_0x118be8[_0x3338('0x46')][_0x3338('0x44')][_0x3338('0x3e')][_0x3338('0x47')]){return _0x118be8[_0x3338('0x46')][_0x3338('0x44')]['Contacts'][0x0];}var _0xe2cfd7=_[_0x3338('0xe')](_0x12d118[_0x3338('0x2b')],{'firstName':_0x12d118['body'][_0x3338('0x36')],'ListId':_0x340746[_0x3338('0x34')]});_0xe2cfd7[_0x12d118[_0x3338('0x2b')][_0x3338('0x48')]]=_0x12d118['body'][_0x3338('0x36')];return db[_0x3338('0x2c')][_0x3338('0x49')](_0xe2cfd7,{'fields':_0x3bdca3,'raw':!![]});}})[_0x3338('0x3b')](function(_0x49a99a){_0x118be8[_0x3338('0x4a')]=_0x49a99a;if(_0x49a99a){var _0x5b81ae={'ContactId':_0x49a99a['id'],'FaxAccountId':_0x12d118[_0x3338('0x46')]['id'],'fax':_0x49a99a['fax']};return db[_0x3338('0x4b')]['find']({'where':{'ContactId':_0x49a99a['id'],'closed':![],'FaxAccountId':_0x12d118['account']['id']}})[_0x3338('0x3b')](function(_0x3f00b7){if(_0x3f00b7){return[_0x3f00b7,![]];}return db[_0x3338('0x4b')][_0x3338('0x49')](_0x5b81ae)[_0x3338('0x3b')](function(_0x5bf7ef){return[_0x5bf7ef,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x198c11,_0x33c520){var _0x3a7885=_0x198c11[_0x3338('0x4c')]({'plain':!![]});if(_0x33c520){if(_0x118be8[_0x3338('0x46')][_0x3338('0x4d')]){_0x118be8[_0x3338('0x42')]['push']({'id':0x0,'priority':_0x118be8['applications'][_0x3338('0x47')]+0x1,'app':_0x3338('0x4e'),'appdata':'unmanaged','interval':_0x3338('0x4f')});}_0x3a7885[_0x3338('0x50')]=!![];}else{_0x3a7885[_0x3338('0x50')]=![];}_0x118be8['interaction']=_0x3a7885;return db[_0x3338('0x51')][_0x3338('0x49')]({'body':_0x12d118['body']['body'],'FaxAccountId':_0x12d118[_0x3338('0x46')]['id'],'FaxInteractionId':_0x198c11['id'],'direction':'in','ContactId':_0x198c11[_0x3338('0x52')],'AttachmentId':_0x12d118[_0x3338('0x2b')][_0x3338('0x53')]});})[_0x3338('0x3b')](function(_0x3fecb4){_0x118be8['message']=_0x3fecb4;if(_0x118be8[_0x3338('0x54')][_0x3338('0x55')]){return db['User'][_0x3338('0x3c')]({'attributes':['id',_0x3338('0x56')],'where':{'id':_0x118be8[_0x3338('0x54')]['UserId']}})[_0x3338('0x3b')](function(_0x4a3405){if(_0x4a3405){_0x118be8[_0x3338('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3338('0x57'),'appdata':_0x4a3405[_0x3338('0x56')]+','+(_0x118be8[_0x3338('0x46')][_0x3338('0x58')]||0xa),'interval':_0x3338('0x4f')});}return respondWithRpcPromise(_0x3338('0x59'),_0x3338('0x5a'),_0x118be8);});}return respondWithRpcPromise(_0x3338('0x59'),_0x3338('0x5a'),_0x118be8);})['then'](function(_0x4dbb11){_0x5698c5(_0x4dbb11);})['catch'](function(_0x2006fa){_0x353dd9(_0x16daa5[_0x3338('0x17')](0x1f4,_0x2006fa[_0x3338('0x1a')]));});});}; \ No newline at end of file +var _0xe6f2=['List','Contacts','DESC','FaxApplication','Applications','applications','list','asc','account','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFaxAccount','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','CmList'];(function(_0x5571d3,_0x215161){var _0x582e7d=function(_0x2c5670){while(--_0x2c5670){_0x5571d3['push'](_0x5571d3['shift']());}};_0x582e7d(++_0x215161);}(_0xe6f2,0x75));var _0x2e6f=function(_0x2ef98d,_0x444431){_0x2ef98d=_0x2ef98d-0x0;var _0x26649b=_0xe6f2[_0x2ef98d];return _0x26649b;};'use strict';var _=require(_0x2e6f('0x0'));var util=require('util');var moment=require(_0x2e6f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e6f('0x2'));var db=require(_0x2e6f('0x3'))['db'];var utils=require(_0x2e6f('0x4'));var logger=require(_0x2e6f('0x5'))(_0x2e6f('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e6f('0x7'));var client=jayson[_0x2e6f('0x8')]['http']({'port':0x232c});config[_0x2e6f('0x9')]=_[_0x2e6f('0xa')](config[_0x2e6f('0x9')],{'host':_0x2e6f('0xb'),'port':0x18eb});var socket=require(_0x2e6f('0xc'))(new Redis(config[_0x2e6f('0x9')]));require('./faxAccount.socket')[_0x2e6f('0xd')](socket);function respondWithRpcPromise(_0x24374b,_0x1c8bb3,_0x189e9e){return new BPromise(function(_0x144809,_0xfd670f){return client[_0x2e6f('0xe')](_0x24374b,_0x189e9e)['then'](function(_0x2bc9f9){logger[_0x2e6f('0xf')]('FaxAccount,\x20%s,\x20%s',_0x1c8bb3,_0x2e6f('0x10'));logger[_0x2e6f('0x11')](_0x2e6f('0x12'),_0x1c8bb3,_0x2e6f('0x10'),JSON['stringify'](_0x2bc9f9));if(_0x2bc9f9[_0x2e6f('0x13')]){if(_0x2bc9f9['error'][_0x2e6f('0x14')]===0x1f4){logger[_0x2e6f('0x13')](_0x2e6f('0x15'),_0x1c8bb3,_0x2bc9f9['error'][_0x2e6f('0x16')]);return _0xfd670f(_0x2bc9f9['error'][_0x2e6f('0x16')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x1c8bb3,_0x2bc9f9['error'][_0x2e6f('0x16')]);return _0x144809(_0x2bc9f9['error']['message']);}else{logger[_0x2e6f('0xf')](_0x2e6f('0x15'),_0x1c8bb3,_0x2e6f('0x10'));_0x144809(_0x2bc9f9[_0x2e6f('0x17')][_0x2e6f('0x16')]);}})[_0x2e6f('0x18')](function(_0x17e249){logger[_0x2e6f('0x13')]('FaxAccount,\x20%s,\x20%s',_0x1c8bb3,_0x17e249);_0xfd670f(_0x17e249);});});}exports['GetFaxAccount']=function(_0x20f028){var _0x24e214=this;return new Promise(function(_0x22eba8,_0x560795){return db[_0x2e6f('0x19')][_0x2e6f('0x1a')]({'raw':_0x20f028['options']?_0x20f028[_0x2e6f('0x1b')][_0x2e6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x20f028['options']?_0x20f028['options'][_0x2e6f('0x1d')]||null:null,'attributes':_0x20f028[_0x2e6f('0x1b')]?_0x20f028['options'][_0x2e6f('0x1e')]||null:null,'limit':_0x20f028[_0x2e6f('0x1b')]?_0x20f028['options'][_0x2e6f('0x1f')]||null:null,'include':_0x20f028['options']?_0x20f028['options'][_0x2e6f('0x20')]?_[_0x2e6f('0x21')](_0x20f028[_0x2e6f('0x1b')][_0x2e6f('0x20')],function(_0x354ed2){return{'model':db[_0x354ed2[_0x2e6f('0x22')]],'as':_0x354ed2['as'],'attributes':_0x354ed2[_0x2e6f('0x1e')],'include':_0x354ed2[_0x2e6f('0x20')]?_[_0x2e6f('0x21')](_0x354ed2['include'],function(_0x749bad){return{'model':db[_0x749bad[_0x2e6f('0x22')]],'as':_0x749bad['as'],'attributes':_0x749bad[_0x2e6f('0x1e')],'include':_0x749bad['include']?_['map'](_0x749bad[_0x2e6f('0x20')],function(_0x34b87d){return{'model':db[_0x34b87d[_0x2e6f('0x22')]],'as':_0x34b87d['as'],'attributes':_0x34b87d[_0x2e6f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2e6f('0x23')](function(_0x66c77){logger[_0x2e6f('0xf')](_0x2e6f('0x24'),_0x20f028);logger['debug'](_0x2e6f('0x24'),_0x20f028,JSON[_0x2e6f('0x25')](_0x66c77));_0x22eba8(_0x66c77);})[_0x2e6f('0x18')](function(_0x6495fa){logger[_0x2e6f('0x13')](_0x2e6f('0x24'),_0x6495fa[_0x2e6f('0x16')],_0x20f028);_0x560795(_0x24e214[_0x2e6f('0x13')](0x1f4,_0x6495fa[_0x2e6f('0x16')]));});});};exports[_0x2e6f('0x26')]=function(_0x530598,_0x5a30c8,_0x2cb71f){var _0x4dc21b=this;return new Promise(function(_0x53f4e9,_0x4083c0){var _0x528d2e={'body':_0x530598[_0x2e6f('0x27')],'channel':_0x2e6f('0x28')};var _0x42b97a=[];var _0x2ff6df=[];var _0x3524c4={};return db[_0x2e6f('0x29')]['describe']()[_0x2e6f('0x23')](function(_0x32cabb){if(!_0x32cabb){throw new db[(_0x2e6f('0x2a'))][(_0x2e6f('0x2b'))]('no\x20available\x20attributes');}_0x42b97a=_[_0x2e6f('0x2c')](_[_0x2e6f('0x2d')](_0x32cabb),[_0x2e6f('0x2e'),_0x2e6f('0x2f')]);_0x2ff6df=_[_0x2e6f('0x2c')](_[_0x2e6f('0x2d')](_0x32cabb),[_0x2e6f('0x2e'),_0x2e6f('0x2f'),'CompanyId',_0x2e6f('0x30')]);if(_0x530598['body']['id']){delete _0x530598[_0x2e6f('0x27')]['id'];}if(_['isNil'](_0x530598[_0x2e6f('0x27')][_0x2e6f('0x31')])){throw new db['Sequelize'][(_0x2e6f('0x2b'))]('from\x20is\x20mandatory');}if(_[_0x2e6f('0x32')](_0x530598[_0x2e6f('0x27')]['body'])||_0x530598[_0x2e6f('0x27')][_0x2e6f('0x27')]===''){throw new db[(_0x2e6f('0x2a'))][(_0x2e6f('0x2b'))](_0x2e6f('0x33'));}if(_['isNil'](_0x530598[_0x2e6f('0x27')]['mapKey'])){throw new db[(_0x2e6f('0x2a'))][(_0x2e6f('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2ff6df);}if(!_[_0x2e6f('0x34')](_0x2ff6df,_0x530598[_0x2e6f('0x27')]['mapKey'])){throw new db[(_0x2e6f('0x2a'))][(_0x2e6f('0x2b'))](_0x2e6f('0x35')+_0x2ff6df);}_0x3524c4[_0x530598[_0x2e6f('0x27')][_0x2e6f('0x36')]]=_0x530598['body'][_0x2e6f('0x31')];})['then'](function(){return db[_0x2e6f('0x19')][_0x2e6f('0x37')]({'where':{'id':_0x530598['account']['id']},'include':[{'model':db[_0x2e6f('0x38')],'as':_0x2e6f('0x39'),'include':[{'model':db['CmContact'],'as':_0x2e6f('0x3a'),'where':_0x3524c4,'limit':0x1,'order':[[_0x2e6f('0x2f'),_0x2e6f('0x3b')]]}]},{'model':db[_0x2e6f('0x3c')],'as':_0x2e6f('0x3d')}]});})[_0x2e6f('0x23')](function(_0xc508ac){if(_0xc508ac&&_0xc508ac['List']){var _0x21735d=_0xc508ac['get']({'plain':!![]});_0x528d2e['account']=_0x21735d;_0x528d2e[_0x2e6f('0x3e')]=_0x21735d[_0x2e6f('0x3d')];_0x528d2e[_0x2e6f('0x3f')]=_0x21735d[_0x2e6f('0x39')];_0x528d2e[_0x2e6f('0x3e')]=_['orderBy'](_0x528d2e['applications'],['priority'],[_0x2e6f('0x40')]);if(_0x528d2e[_0x2e6f('0x41')][_0x2e6f('0x3d')]){delete _0x528d2e['account']['Applications'];}if(_0x528d2e[_0x2e6f('0x41')]['List']&&_0x528d2e[_0x2e6f('0x41')][_0x2e6f('0x39')]['Contacts'][_0x2e6f('0x42')]){return _0x528d2e[_0x2e6f('0x41')][_0x2e6f('0x39')][_0x2e6f('0x3a')][0x0];}var _0x14f3cb=_[_0x2e6f('0xa')](_0x530598['body'],{'firstName':_0x530598[_0x2e6f('0x27')][_0x2e6f('0x31')],'ListId':_0x21735d[_0x2e6f('0x30')]});_0x14f3cb[_0x530598[_0x2e6f('0x27')][_0x2e6f('0x36')]]=_0x530598[_0x2e6f('0x27')][_0x2e6f('0x31')];return db['CmContact'][_0x2e6f('0x43')](_0x14f3cb,{'fields':_0x42b97a,'raw':!![]});}})[_0x2e6f('0x23')](function(_0x4880c9){_0x528d2e[_0x2e6f('0x44')]=_0x4880c9;if(_0x4880c9){var _0x52b30e={'ContactId':_0x4880c9['id'],'FaxAccountId':_0x530598[_0x2e6f('0x41')]['id'],'fax':_0x4880c9['fax']};return db[_0x2e6f('0x45')]['find']({'where':{'ContactId':_0x4880c9['id'],'closed':![],'FaxAccountId':_0x530598[_0x2e6f('0x41')]['id']}})[_0x2e6f('0x23')](function(_0x520458){if(_0x520458){return[_0x520458,![]];}return db[_0x2e6f('0x45')][_0x2e6f('0x43')](_0x52b30e)[_0x2e6f('0x23')](function(_0x2ad7dc){return[_0x2ad7dc,!![]];});});}else{throw new Error(_0x2e6f('0x46'));}})[_0x2e6f('0x47')](function(_0x3eb2e9,_0x2c1380){var _0x5937e2=_0x3eb2e9[_0x2e6f('0x48')]({'plain':!![]});if(_0x2c1380){if(_0x528d2e[_0x2e6f('0x41')]['autoclose']){_0x528d2e[_0x2e6f('0x3e')]['push']({'id':0x0,'priority':_0x528d2e[_0x2e6f('0x3e')]['length']+0x1,'app':_0x2e6f('0x49'),'appdata':_0x2e6f('0x4a'),'interval':_0x2e6f('0x4b')});}_0x5937e2[_0x2e6f('0x4c')]=!![];}else{_0x5937e2[_0x2e6f('0x4c')]=![];}_0x528d2e[_0x2e6f('0x4d')]=_0x5937e2;return db['FaxMessage'][_0x2e6f('0x43')]({'body':_0x530598[_0x2e6f('0x27')]['body'],'FaxAccountId':_0x530598[_0x2e6f('0x41')]['id'],'FaxInteractionId':_0x3eb2e9['id'],'direction':'in','ContactId':_0x3eb2e9[_0x2e6f('0x4e')],'AttachmentId':_0x530598[_0x2e6f('0x27')][_0x2e6f('0x4f')]});})[_0x2e6f('0x23')](function(_0x17351f){_0x528d2e[_0x2e6f('0x16')]=_0x17351f;if(_0x528d2e[_0x2e6f('0x4d')][_0x2e6f('0x50')]){return db[_0x2e6f('0x51')][_0x2e6f('0x37')]({'attributes':['id',_0x2e6f('0x52')],'where':{'id':_0x528d2e['interaction'][_0x2e6f('0x50')]}})['then'](function(_0x3d0d85){if(_0x3d0d85){_0x528d2e['applications'][_0x2e6f('0x53')]({'id':0x0,'priority':0x0,'app':_0x2e6f('0x54'),'appdata':_0x3d0d85[_0x2e6f('0x52')]+','+(_0x528d2e[_0x2e6f('0x41')][_0x2e6f('0x55')]||0xa),'interval':_0x2e6f('0x4b')});}return respondWithRpcPromise('Start',_0x2e6f('0x56'),_0x528d2e);});}return respondWithRpcPromise('Start',_0x2e6f('0x56'),_0x528d2e);})['then'](function(_0x59b7b8){_0x53f4e9(_0x59b7b8);})[_0x2e6f('0x18')](function(_0x239f40){_0x4083c0(_0x4dc21b[_0x2e6f('0x13')](0x1f4,_0x239f40[_0x2e6f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 989c111..194aef3 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 _0x83ba=['emit','register','length','./faxAccount.events','save','update'];(function(_0x3698ae,_0x51035f){var _0x1cedfc=function(_0x3258e8){while(--_0x3258e8){_0x3698ae['push'](_0x3698ae['shift']());}};_0x1cedfc(++_0x51035f);}(_0x83ba,0x18f));var _0xa83b=function(_0x56f598,_0x19a7e9){_0x56f598=_0x56f598-0x0;var _0x12663d=_0x83ba[_0x56f598];return _0x12663d;};'use strict';var FaxAccountEvents=require(_0xa83b('0x0'));var events=[_0xa83b('0x1'),'remove',_0xa83b('0x2')];function createListener(_0x4a61e2,_0x3bc693){return function(_0x4f8c18){_0x3bc693[_0xa83b('0x3')](_0x4a61e2,_0x4f8c18);};}function removeListener(_0x4aeb8e,_0x510beb){return function(){FaxAccountEvents['removeListener'](_0x4aeb8e,_0x510beb);};}exports[_0xa83b('0x4')]=function(_0x2410ef){for(var _0x249bda=0x0,_0x2433b1=events[_0xa83b('0x5')];_0x249bda<_0x2433b1;_0x249bda++){var _0x536746=events[_0x249bda];var _0x2c0d32=createListener('faxAccount:'+_0x536746,_0x2410ef);FaxAccountEvents['on'](_0x536746,_0x2c0d32);}}; \ No newline at end of file +var _0xbc90=['faxAccount:','./faxAccount.events','save','emit','removeListener'];(function(_0x5a72de,_0x5e52dc){var _0x554f6b=function(_0x1746b8){while(--_0x1746b8){_0x5a72de['push'](_0x5a72de['shift']());}};_0x554f6b(++_0x5e52dc);}(_0xbc90,0x83));var _0x0bc9=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xbc90[_0x27af45];return _0x18df21;};'use strict';var FaxAccountEvents=require(_0x0bc9('0x0'));var events=[_0x0bc9('0x1'),'remove','update'];function createListener(_0x4bc9a5,_0x4b5d50){return function(_0x57a6bf){_0x4b5d50[_0x0bc9('0x2')](_0x4bc9a5,_0x57a6bf);};}function removeListener(_0x4879ca,_0x28d034){return function(){FaxAccountEvents[_0x0bc9('0x3')](_0x4879ca,_0x28d034);};}exports['register']=function(_0x521430){for(var _0x4397fe=0x0,_0x45b7b4=events['length'];_0x4397fe<_0x45b7b4;_0x4397fe++){var _0x14fff4=events[_0x4397fe];var _0xec843d=createListener(_0x0bc9('0x4')+_0x14fff4,_0x521430);FaxAccountEvents['on'](_0x14fff4,_0xec843d);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 001028b..0c75b9b 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(_0x29d044,_0x4d9f96){var _0x522c49=function(_0x5af506){while(--_0x5af506){_0x29d044['push'](_0x29d044['shift']());}};_0x522c49(++_0x4d9f96);}(_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['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(_0x15cc52,_0x167dca){var _0x47224b=function(_0x2046e6){while(--_0x2046e6){_0x15cc52['push'](_0x15cc52['shift']());}};_0x47224b(++_0x167dca);}(_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['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 d792fe7..8059629 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 _0x0d99=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x22d2c8,_0x22f4e8){var _0x4b4b8b=function(_0x24a01d){while(--_0x24a01d){_0x22d2c8['push'](_0x22d2c8['shift']());}};_0x4b4b8b(++_0x22f4e8);}(_0x0d99,0x1c5));var _0x90d9=function(_0x367b28,_0x4f90e9){_0x367b28=_0x367b28-0x0;var _0x4618f8=_0x0d99[_0x367b28];return _0x4618f8;};'use strict';var Sequelize=require(_0x90d9('0x0'));module[_0x90d9('0x1')]={'priority':{'type':Sequelize[_0x90d9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x90d9('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x90d9('0x4')]},'interval':{'type':Sequelize[_0x90d9('0x4')],'defaultValue':_0x90d9('0x5')}}; \ No newline at end of file +var _0x3353=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1b8e24,_0x1dbcd0){var _0x44b6b3=function(_0x32199e){while(--_0x32199e){_0x1b8e24['push'](_0x1b8e24['shift']());}};_0x44b6b3(++_0x1dbcd0);}(_0x3353,0x1d9));var _0x3335=function(_0xcbf331,_0x6408f){_0xcbf331=_0xcbf331-0x0;var _0x42195a=_0x3353[_0xcbf331];return _0x42195a;};'use strict';var Sequelize=require(_0x3335('0x0'));module[_0x3335('0x1')]={'priority':{'type':Sequelize[_0x3335('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3335('0x3')},'appdata':{'type':Sequelize[_0x3335('0x4')]()},'description':{'type':Sequelize[_0x3335('0x5')]},'interval':{'type':Sequelize[_0x3335('0x5')],'defaultValue':_0x3335('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 7fd07f7..1703c5d 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 _0x0e67=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','rows','catch','params','includeAll','options','find','create','body','update','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','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','end','error','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x5dee06,_0x1cace2){var _0x46ce71=function(_0x51689c){while(--_0x51689c){_0x5dee06['push'](_0x5dee06['shift']());}};_0x46ce71(++_0x1cace2);}(_0x0e67,0x145));var _0x70e6=function(_0x471abc,_0x43c75d){_0x471abc=_0x471abc-0x0;var _0x311fae=_0x0e67[_0x471abc];return _0x311fae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x70e6('0x0'));var zipdir=require(_0x70e6('0x1'));var jsonpatch=require(_0x70e6('0x2'));var rp=require(_0x70e6('0x3'));var moment=require(_0x70e6('0x4'));var BPromise=require(_0x70e6('0x5'));var Mustache=require(_0x70e6('0x6'));var util=require(_0x70e6('0x7'));var path=require(_0x70e6('0x8'));var sox=require(_0x70e6('0x9'));var csv=require(_0x70e6('0xa'));var ejs=require(_0x70e6('0xb'));var fs=require('fs');var fs_extra=require(_0x70e6('0xc'));var _=require(_0x70e6('0xd'));var squel=require(_0x70e6('0xe'));var crypto=require(_0x70e6('0xf'));var jsforce=require(_0x70e6('0x10'));var deskjs=require(_0x70e6('0x11'));var toCsv=require(_0x70e6('0xa'));var querystring=require(_0x70e6('0x12'));var Papa=require(_0x70e6('0x13'));var Redis=require('ioredis');var authService=require(_0x70e6('0x14'));var qs=require(_0x70e6('0x15'));var as=require(_0x70e6('0x16'));var hardwareService=require(_0x70e6('0x17'));var logger=require(_0x70e6('0x18'))('api');var utils=require(_0x70e6('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x70e6('0x1a'));var db=require(_0x70e6('0x1b'))['db'];function respondWithStatusCode(_0x433e17,_0x44996e){_0x44996e=_0x44996e||0xcc;return function(_0x30404f){if(_0x30404f){return _0x433e17['sendStatus'](_0x44996e);}return _0x433e17[_0x70e6('0x1c')](_0x44996e)['end']();};}function respondWithResult(_0x2fcd92,_0xea8a29){_0xea8a29=_0xea8a29||0xc8;return function(_0x397ea4){if(_0x397ea4){return _0x2fcd92[_0x70e6('0x1c')](_0xea8a29)[_0x70e6('0x1d')](_0x397ea4);}};}function respondWithFilteredResult(_0x1a4097,_0x30e5f2){return function(_0x2b5c07){if(_0x2b5c07){var _0x2dcd2d=typeof _0x30e5f2[_0x70e6('0x1e')]===_0x70e6('0x1f')&&typeof _0x30e5f2[_0x70e6('0x20')]===_0x70e6('0x1f');var _0x3d4d3a=_0x2b5c07[_0x70e6('0x21')];var _0x5049c2=_0x2dcd2d?0x0:_0x30e5f2[_0x70e6('0x1e')];var _0x241e09=_0x2dcd2d?_0x2b5c07[_0x70e6('0x21')]:_0x30e5f2[_0x70e6('0x1e')]+_0x30e5f2[_0x70e6('0x20')];var _0x377d23;if(_0x241e09>=_0x3d4d3a){_0x241e09=_0x3d4d3a;_0x377d23=0xc8;}else{_0x377d23=0xce;}_0x1a4097[_0x70e6('0x1c')](_0x377d23);return _0x1a4097[_0x70e6('0x22')](_0x70e6('0x23'),_0x5049c2+'-'+_0x241e09+'/'+_0x3d4d3a)[_0x70e6('0x1d')](_0x2b5c07);}return null;};}function patchUpdates(_0x32a232){return function(_0x59a967){try{jsonpatch[_0x70e6('0x24')](_0x59a967,_0x32a232,!![]);}catch(_0x1deeb9){return BPromise[_0x70e6('0x25')](_0x1deeb9);}return _0x59a967[_0x70e6('0x26')]();};}function saveUpdates(_0x5c2f25,_0x131d34){return function(_0x146f24){if(_0x146f24){return _0x146f24['update'](_0x5c2f25)['then'](function(_0x41f8ac){return _0x41f8ac;});}return null;};}function removeEntity(_0x21f73a,_0x177b75){return function(_0x3357c0){if(_0x3357c0){return _0x3357c0[_0x70e6('0x27')]()[_0x70e6('0x28')](function(){_0x21f73a[_0x70e6('0x1c')](0xcc)[_0x70e6('0x29')]();});}};}function handleEntityNotFound(_0x5278ff,_0x14ef7c){return function(_0x47fee9){if(!_0x47fee9){_0x5278ff['sendStatus'](0x194);}return _0x47fee9;};}function handleError(_0x41c989,_0x285fe6){_0x285fe6=_0x285fe6||0x1f4;return function(_0xf4a838){logger[_0x70e6('0x2a')](_0xf4a838['stack']);if(_0xf4a838[_0x70e6('0x2b')]){delete _0xf4a838[_0x70e6('0x2b')];}_0x41c989[_0x70e6('0x1c')](_0x285fe6)[_0x70e6('0x2c')](_0xf4a838);};}exports[_0x70e6('0x2d')]=function(_0x56e897,_0x440307){var _0x48427b={},_0xe5d0d9={},_0x4020e2={'count':0x0,'rows':[]};var _0x7fe49b=_['map'](db[_0x70e6('0x2e')][_0x70e6('0x2f')],function(_0x3fc709){return{'name':_0x3fc709[_0x70e6('0x30')],'type':_0x3fc709[_0x70e6('0x31')][_0x70e6('0x32')]};});_0xe5d0d9[_0x70e6('0x33')]=_[_0x70e6('0x34')](_0x7fe49b,_0x70e6('0x2b'));_0xe5d0d9[_0x70e6('0x35')]=_[_0x70e6('0x36')](_0x56e897[_0x70e6('0x35')]);_0xe5d0d9['filters']=_[_0x70e6('0x37')](_0xe5d0d9['model'],_0xe5d0d9[_0x70e6('0x35')]);_0x48427b[_0x70e6('0x38')]=_[_0x70e6('0x37')](_0xe5d0d9[_0x70e6('0x33')],qs[_0x70e6('0x39')](_0x56e897[_0x70e6('0x35')]['fields']));_0x48427b[_0x70e6('0x38')]=_0x48427b[_0x70e6('0x38')][_0x70e6('0x3a')]?_0x48427b['attributes']:_0xe5d0d9[_0x70e6('0x33')];if(!_0x56e897[_0x70e6('0x35')][_0x70e6('0x3b')](_0x70e6('0x3c'))){_0x48427b['limit']=qs[_0x70e6('0x20')](_0x56e897[_0x70e6('0x35')][_0x70e6('0x20')]);_0x48427b['offset']=qs[_0x70e6('0x1e')](_0x56e897['query'][_0x70e6('0x1e')]);}_0x48427b[_0x70e6('0x3d')]=qs[_0x70e6('0x3e')](_0x56e897[_0x70e6('0x35')][_0x70e6('0x3e')]);_0x48427b['where']=qs[_0x70e6('0x3f')](_['pick'](_0x56e897[_0x70e6('0x35')],_0xe5d0d9['filters']),_0x7fe49b);if(_0x56e897['query'][_0x70e6('0x40')]){_0x48427b[_0x70e6('0x41')]=_[_0x70e6('0x42')](_0x48427b[_0x70e6('0x41')],{'$or':_[_0x70e6('0x34')](_0x7fe49b,function(_0x186a38){if(_0x186a38['type']!=='VIRTUAL'){var _0x3daeae={};_0x3daeae[_0x186a38[_0x70e6('0x2b')]]={'$like':'%'+_0x56e897[_0x70e6('0x35')][_0x70e6('0x40')]+'%'};return _0x3daeae;}})});}_0x48427b=_[_0x70e6('0x42')]({},_0x48427b,_0x56e897['options']);var _0x13f1a4={'where':_0x48427b['where']};return db[_0x70e6('0x2e')][_0x70e6('0x21')](_0x13f1a4)['then'](function(_0x41fe5a){_0x4020e2[_0x70e6('0x21')]=_0x41fe5a;if(_0x56e897[_0x70e6('0x35')]['includeAll']){_0x48427b['include']=[{'all':!![]}];}return db[_0x70e6('0x2e')]['findAll'](_0x48427b);})[_0x70e6('0x28')](function(_0x284f2b){_0x4020e2[_0x70e6('0x43')]=_0x284f2b;return _0x4020e2;})[_0x70e6('0x28')](respondWithFilteredResult(_0x440307,_0x48427b))[_0x70e6('0x44')](handleError(_0x440307,null));};exports['show']=function(_0x1a3a52,_0x3b2e77){var _0x5467ff={'raw':!![],'where':{'id':_0x1a3a52[_0x70e6('0x45')]['id']}},_0x17df01={};_0x17df01[_0x70e6('0x33')]=_[_0x70e6('0x36')](db[_0x70e6('0x2e')][_0x70e6('0x2f')]);_0x17df01['query']=_[_0x70e6('0x36')](_0x1a3a52['query']);_0x17df01['filters']=_['intersection'](_0x17df01[_0x70e6('0x33')],_0x17df01[_0x70e6('0x35')]);_0x5467ff['attributes']=_['intersection'](_0x17df01[_0x70e6('0x33')],qs[_0x70e6('0x39')](_0x1a3a52[_0x70e6('0x35')][_0x70e6('0x39')]));_0x5467ff[_0x70e6('0x38')]=_0x5467ff[_0x70e6('0x38')]['length']?_0x5467ff[_0x70e6('0x38')]:_0x17df01[_0x70e6('0x33')];if(_0x1a3a52[_0x70e6('0x35')][_0x70e6('0x46')]){_0x5467ff['include']=[{'all':!![]}];}_0x5467ff=_[_0x70e6('0x42')]({},_0x5467ff,_0x1a3a52[_0x70e6('0x47')]);return db['FaxApplication'][_0x70e6('0x48')](_0x5467ff)[_0x70e6('0x28')](handleEntityNotFound(_0x3b2e77,null))[_0x70e6('0x28')](respondWithResult(_0x3b2e77,null))['catch'](handleError(_0x3b2e77,null));};exports['create']=function(_0x13f728,_0x598358){return db[_0x70e6('0x2e')][_0x70e6('0x49')](_0x13f728[_0x70e6('0x4a')],{})['then'](respondWithResult(_0x598358,0xc9))[_0x70e6('0x44')](handleError(_0x598358,null));};exports[_0x70e6('0x4b')]=function(_0x4d514a,_0x110a8d){if(_0x4d514a['body']['id']){delete _0x4d514a[_0x70e6('0x4a')]['id'];}return db[_0x70e6('0x2e')][_0x70e6('0x48')]({'where':{'id':_0x4d514a[_0x70e6('0x45')]['id']}})[_0x70e6('0x28')](handleEntityNotFound(_0x110a8d,null))[_0x70e6('0x28')](saveUpdates(_0x4d514a[_0x70e6('0x4a')],null))[_0x70e6('0x28')](respondWithResult(_0x110a8d,null))[_0x70e6('0x44')](handleError(_0x110a8d,null));};exports[_0x70e6('0x27')]=function(_0x5f0ea0,_0x5d9986){return db[_0x70e6('0x2e')][_0x70e6('0x48')]({'where':{'id':_0x5f0ea0[_0x70e6('0x45')]['id']}})[_0x70e6('0x28')](handleEntityNotFound(_0x5d9986,null))[_0x70e6('0x28')](removeEntity(_0x5d9986,null))[_0x70e6('0x44')](handleError(_0x5d9986,null));}; \ No newline at end of file +var _0x342d=['create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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','status','end','limit','undefined','count','offset','set','json','reject','then','destroy','sendStatus','error','stack','name','send','index','FaxApplication','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes'];(function(_0x228b53,_0x5e33fa){var _0x29e093=function(_0x57a476){while(--_0x57a476){_0x228b53['push'](_0x228b53['shift']());}};_0x29e093(++_0x5e33fa);}(_0x342d,0x189));var _0xd342=function(_0x33d796,_0x342f83){_0x33d796=_0x33d796-0x0;var _0x13eab8=_0x342d[_0x33d796];return _0x13eab8;};'use strict';var emlformat=require(_0xd342('0x0'));var rimraf=require(_0xd342('0x1'));var zipdir=require(_0xd342('0x2'));var jsonpatch=require(_0xd342('0x3'));var rp=require('request-promise');var moment=require(_0xd342('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd342('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd342('0x6'));var ejs=require(_0xd342('0x7'));var fs=require('fs');var fs_extra=require(_0xd342('0x8'));var _=require(_0xd342('0x9'));var squel=require(_0xd342('0xa'));var crypto=require(_0xd342('0xb'));var jsforce=require(_0xd342('0xc'));var deskjs=require(_0xd342('0xd'));var toCsv=require(_0xd342('0x6'));var querystring=require(_0xd342('0xe'));var Papa=require(_0xd342('0xf'));var Redis=require(_0xd342('0x10'));var authService=require(_0xd342('0x11'));var qs=require(_0xd342('0x12'));var as=require(_0xd342('0x13'));var hardwareService=require(_0xd342('0x14'));var logger=require(_0xd342('0x15'))(_0xd342('0x16'));var utils=require(_0xd342('0x17'));var config=require(_0xd342('0x18'));var licenseUtil=require(_0xd342('0x19'));var db=require(_0xd342('0x1a'))['db'];function respondWithStatusCode(_0x474753,_0x234784){_0x234784=_0x234784||0xcc;return function(_0x2bc0ee){if(_0x2bc0ee){return _0x474753['sendStatus'](_0x234784);}return _0x474753[_0xd342('0x1b')](_0x234784)[_0xd342('0x1c')]();};}function respondWithResult(_0x2d683b,_0x59ad8e){_0x59ad8e=_0x59ad8e||0xc8;return function(_0x21b758){if(_0x21b758){return _0x2d683b[_0xd342('0x1b')](_0x59ad8e)['json'](_0x21b758);}};}function respondWithFilteredResult(_0xa2ef4b,_0x4dc49e){return function(_0x4eb317){if(_0x4eb317){var _0x546215=typeof _0x4dc49e['offset']==='undefined'&&typeof _0x4dc49e[_0xd342('0x1d')]===_0xd342('0x1e');var _0x1af233=_0x4eb317[_0xd342('0x1f')];var _0x4dff90=_0x546215?0x0:_0x4dc49e[_0xd342('0x20')];var _0x181856=_0x546215?_0x4eb317[_0xd342('0x1f')]:_0x4dc49e['offset']+_0x4dc49e['limit'];var _0x5891fd;if(_0x181856>=_0x1af233){_0x181856=_0x1af233;_0x5891fd=0xc8;}else{_0x5891fd=0xce;}_0xa2ef4b[_0xd342('0x1b')](_0x5891fd);return _0xa2ef4b[_0xd342('0x21')]('Content-Range',_0x4dff90+'-'+_0x181856+'/'+_0x1af233)[_0xd342('0x22')](_0x4eb317);}return null;};}function patchUpdates(_0x5d2918){return function(_0x661067){try{jsonpatch['apply'](_0x661067,_0x5d2918,!![]);}catch(_0x161dd9){return BPromise[_0xd342('0x23')](_0x161dd9);}return _0x661067['save']();};}function saveUpdates(_0x54a5db,_0x291dc1){return function(_0x196fe0){if(_0x196fe0){return _0x196fe0['update'](_0x54a5db)[_0xd342('0x24')](function(_0x469fab){return _0x469fab;});}return null;};}function removeEntity(_0x1d38d7,_0x455e60){return function(_0x3e4753){if(_0x3e4753){return _0x3e4753[_0xd342('0x25')]()['then'](function(){_0x1d38d7['status'](0xcc)[_0xd342('0x1c')]();});}};}function handleEntityNotFound(_0x464c07,_0x368424){return function(_0x23502e){if(!_0x23502e){_0x464c07[_0xd342('0x26')](0x194);}return _0x23502e;};}function handleError(_0x55695b,_0x17cea7){_0x17cea7=_0x17cea7||0x1f4;return function(_0x5967ec){logger[_0xd342('0x27')](_0x5967ec[_0xd342('0x28')]);if(_0x5967ec[_0xd342('0x29')]){delete _0x5967ec[_0xd342('0x29')];}_0x55695b[_0xd342('0x1b')](_0x17cea7)[_0xd342('0x2a')](_0x5967ec);};}exports[_0xd342('0x2b')]=function(_0x4ebaee,_0x4b39ae){var _0x3c300e={},_0x2f0f36={},_0x2ca760={'count':0x0,'rows':[]};var _0x19c50e=_['map'](db[_0xd342('0x2c')]['rawAttributes'],function(_0x2b617b){return{'name':_0x2b617b[_0xd342('0x2d')],'type':_0x2b617b[_0xd342('0x2e')][_0xd342('0x2f')]};});_0x2f0f36[_0xd342('0x30')]=_['map'](_0x19c50e,_0xd342('0x29'));_0x2f0f36[_0xd342('0x31')]=_['keys'](_0x4ebaee[_0xd342('0x31')]);_0x2f0f36[_0xd342('0x32')]=_[_0xd342('0x33')](_0x2f0f36[_0xd342('0x30')],_0x2f0f36[_0xd342('0x31')]);_0x3c300e[_0xd342('0x34')]=_[_0xd342('0x33')](_0x2f0f36[_0xd342('0x30')],qs[_0xd342('0x35')](_0x4ebaee[_0xd342('0x31')][_0xd342('0x35')]));_0x3c300e[_0xd342('0x34')]=_0x3c300e[_0xd342('0x34')][_0xd342('0x36')]?_0x3c300e[_0xd342('0x34')]:_0x2f0f36[_0xd342('0x30')];if(!_0x4ebaee[_0xd342('0x31')][_0xd342('0x37')](_0xd342('0x38'))){_0x3c300e['limit']=qs['limit'](_0x4ebaee[_0xd342('0x31')][_0xd342('0x1d')]);_0x3c300e[_0xd342('0x20')]=qs[_0xd342('0x20')](_0x4ebaee[_0xd342('0x31')][_0xd342('0x20')]);}_0x3c300e[_0xd342('0x39')]=qs['sort'](_0x4ebaee[_0xd342('0x31')][_0xd342('0x3a')]);_0x3c300e[_0xd342('0x3b')]=qs[_0xd342('0x32')](_[_0xd342('0x3c')](_0x4ebaee[_0xd342('0x31')],_0x2f0f36[_0xd342('0x32')]),_0x19c50e);if(_0x4ebaee[_0xd342('0x31')][_0xd342('0x3d')]){_0x3c300e[_0xd342('0x3b')]=_[_0xd342('0x3e')](_0x3c300e[_0xd342('0x3b')],{'$or':_[_0xd342('0x3f')](_0x19c50e,function(_0x58a73c){if(_0x58a73c[_0xd342('0x2e')]!==_0xd342('0x40')){var _0x5714cf={};_0x5714cf[_0x58a73c[_0xd342('0x29')]]={'$like':'%'+_0x4ebaee[_0xd342('0x31')]['filter']+'%'};return _0x5714cf;}})});}_0x3c300e=_[_0xd342('0x3e')]({},_0x3c300e,_0x4ebaee[_0xd342('0x41')]);var _0x44e807={'where':_0x3c300e[_0xd342('0x3b')]};return db[_0xd342('0x2c')]['count'](_0x44e807)['then'](function(_0x239205){_0x2ca760[_0xd342('0x1f')]=_0x239205;if(_0x4ebaee['query'][_0xd342('0x42')]){_0x3c300e[_0xd342('0x43')]=[{'all':!![]}];}return db[_0xd342('0x2c')][_0xd342('0x44')](_0x3c300e);})[_0xd342('0x24')](function(_0x1d14cd){_0x2ca760[_0xd342('0x45')]=_0x1d14cd;return _0x2ca760;})['then'](respondWithFilteredResult(_0x4b39ae,_0x3c300e))[_0xd342('0x46')](handleError(_0x4b39ae,null));};exports[_0xd342('0x47')]=function(_0x1df03a,_0x4c077f){var _0x29fd21={'raw':!![],'where':{'id':_0x1df03a[_0xd342('0x48')]['id']}},_0x1a19f8={};_0x1a19f8[_0xd342('0x30')]=_[_0xd342('0x49')](db[_0xd342('0x2c')][_0xd342('0x4a')]);_0x1a19f8[_0xd342('0x31')]=_[_0xd342('0x49')](_0x1df03a['query']);_0x1a19f8[_0xd342('0x32')]=_[_0xd342('0x33')](_0x1a19f8[_0xd342('0x30')],_0x1a19f8[_0xd342('0x31')]);_0x29fd21[_0xd342('0x34')]=_[_0xd342('0x33')](_0x1a19f8[_0xd342('0x30')],qs[_0xd342('0x35')](_0x1df03a[_0xd342('0x31')][_0xd342('0x35')]));_0x29fd21[_0xd342('0x34')]=_0x29fd21[_0xd342('0x34')]['length']?_0x29fd21[_0xd342('0x34')]:_0x1a19f8[_0xd342('0x30')];if(_0x1df03a[_0xd342('0x31')][_0xd342('0x42')]){_0x29fd21['include']=[{'all':!![]}];}_0x29fd21=_[_0xd342('0x3e')]({},_0x29fd21,_0x1df03a[_0xd342('0x41')]);return db['FaxApplication']['find'](_0x29fd21)['then'](handleEntityNotFound(_0x4c077f,null))[_0xd342('0x24')](respondWithResult(_0x4c077f,null))['catch'](handleError(_0x4c077f,null));};exports[_0xd342('0x4b')]=function(_0x15d9f6,_0x554d87){return db['FaxApplication'][_0xd342('0x4b')](_0x15d9f6['body'],{})['then'](respondWithResult(_0x554d87,0xc9))[_0xd342('0x46')](handleError(_0x554d87,null));};exports[_0xd342('0x4c')]=function(_0x1ac12e,_0x362b03){if(_0x1ac12e[_0xd342('0x4d')]['id']){delete _0x1ac12e[_0xd342('0x4d')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x1ac12e[_0xd342('0x48')]['id']}})[_0xd342('0x24')](handleEntityNotFound(_0x362b03,null))[_0xd342('0x24')](saveUpdates(_0x1ac12e[_0xd342('0x4d')],null))[_0xd342('0x24')](respondWithResult(_0x362b03,null))[_0xd342('0x46')](handleError(_0x362b03,null));};exports[_0xd342('0x25')]=function(_0x2d95ae,_0x6d30d6){return db[_0xd342('0x2c')]['find']({'where':{'id':_0x2d95ae[_0xd342('0x48')]['id']}})[_0xd342('0x24')](handleEntityNotFound(_0x6d30d6,null))[_0xd342('0x24')](removeEntity(_0x6d30d6,null))[_0xd342('0x46')](handleError(_0x6d30d6,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index c23f2fe..1761988 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 _0x055b=['util','moment','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash'];(function(_0x44b249,_0x5b4811){var _0x23b853=function(_0x3f90ef){while(--_0x3f90ef){_0x44b249['push'](_0x44b249['shift']());}};_0x23b853(++_0x5b4811);}(_0x055b,0x133));var _0xb055=function(_0x4f0666,_0x2df27b){_0x4f0666=_0x4f0666-0x0;var _0x260e73=_0x055b[_0x4f0666];return _0x260e73;};'use strict';var _=require(_0xb055('0x0'));var util=require(_0xb055('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb055('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb055('0x3'));var config=require(_0xb055('0x4'));var attributes=require(_0xb055('0x5'));module[_0xb055('0x6')]=function(_0x4c38d4,_0x4b6d57){return _0x4c38d4[_0xb055('0x7')](_0xb055('0x8'),attributes,{'tableName':_0xb055('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb055('0xa')});}; \ No newline at end of file +var _0xde2a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4c7990,_0x21e2ed){var _0x21ea68=function(_0x8dc714){while(--_0x8dc714){_0x4c7990['push'](_0x4c7990['shift']());}};_0x21ea68(++_0x21e2ed);}(_0xde2a,0x9a));var _0xade2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xde2a[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xade2('0x0'));var util=require(_0xade2('0x1'));var logger=require(_0xade2('0x2'))(_0xade2('0x3'));var moment=require(_0xade2('0x4'));var BPromise=require(_0xade2('0x5'));var rp=require(_0xade2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xade2('0x7'));var attributes=require('./faxApplication.attributes');module[_0xade2('0x8')]=function(_0x392707,_0x39dbea){return _0x392707[_0xade2('0x9')](_0xade2('0xa'),attributes,{'tableName':_0xade2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xade2('0xc'),'collate':_0xade2('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 5517e18..cd9cec2 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 _0xe7c4=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xe7c4,0xa3));var _0x4e7c=function(_0x23a2af,_0x55631d){_0x23a2af=_0x23a2af-0x0;var _0x43cc45=_0xe7c4[_0x23a2af];return _0x43cc45;};'use strict';var _=require(_0x4e7c('0x0'));var util=require(_0x4e7c('0x1'));var moment=require(_0x4e7c('0x2'));var BPromise=require(_0x4e7c('0x3'));var rs=require(_0x4e7c('0x4'));var fs=require('fs');var Redis=require(_0x4e7c('0x5'));var db=require(_0x4e7c('0x6'))['db'];var utils=require(_0x4e7c('0x7'));var logger=require('../../config/logger')(_0x4e7c('0x8'));var config=require(_0x4e7c('0x9'));var jayson=require(_0x4e7c('0xa'));var client=jayson[_0x4e7c('0xb')][_0x4e7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x123620,_0x1441a5,_0x11c183){return new BPromise(function(_0x487dcb,_0x478050){return client['request'](_0x123620,_0x11c183)[_0x4e7c('0xd')](function(_0x1d1427){logger[_0x4e7c('0xe')](_0x4e7c('0xf'),_0x1441a5,_0x4e7c('0x10'));logger[_0x4e7c('0x11')](_0x4e7c('0x12'),_0x1441a5,_0x4e7c('0x10'),JSON[_0x4e7c('0x13')](_0x1d1427));if(_0x1d1427[_0x4e7c('0x14')]){if(_0x1d1427[_0x4e7c('0x14')][_0x4e7c('0x15')]===0x1f4){logger[_0x4e7c('0x14')]('FaxApplication,\x20%s,\x20%s',_0x1441a5,_0x1d1427[_0x4e7c('0x14')][_0x4e7c('0x16')]);return _0x478050(_0x1d1427[_0x4e7c('0x14')][_0x4e7c('0x16')]);}logger[_0x4e7c('0x14')](_0x4e7c('0xf'),_0x1441a5,_0x1d1427['error'][_0x4e7c('0x16')]);return _0x487dcb(_0x1d1427[_0x4e7c('0x14')][_0x4e7c('0x16')]);}else{logger[_0x4e7c('0xe')]('FaxApplication,\x20%s,\x20%s',_0x1441a5,_0x4e7c('0x10'));_0x487dcb(_0x1d1427[_0x4e7c('0x17')][_0x4e7c('0x16')]);}})[_0x4e7c('0x18')](function(_0xdf0a29){logger[_0x4e7c('0x14')](_0x4e7c('0xf'),_0x1441a5,_0xdf0a29);_0x478050(_0xdf0a29);});});}exports[_0x4e7c('0x19')]=function(_0x331776){var _0xbf7635=this;return new Promise(function(_0x32b6bf,_0x538aaa){return db[_0x4e7c('0x1a')][_0x4e7c('0x1b')](_0x331776[_0x4e7c('0x1c')],{'raw':_0x331776['options']?_0x331776[_0x4e7c('0x1d')][_0x4e7c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x331776[_0x4e7c('0x1d')]?_0x331776['options'][_0x4e7c('0x1f')]||null:null,'attributes':_0x331776[_0x4e7c('0x1d')]?_0x331776['options'][_0x4e7c('0x20')]||null:null,'limit':_0x331776[_0x4e7c('0x1d')]?_0x331776['options'][_0x4e7c('0x21')]||null:null})[_0x4e7c('0xd')](function(_0xa0770a){logger[_0x4e7c('0xe')](_0x4e7c('0x19'),_0x331776);logger[_0x4e7c('0x11')](_0x4e7c('0x19'),_0x331776,JSON[_0x4e7c('0x13')](_0xa0770a));_0x32b6bf(_0xa0770a);})[_0x4e7c('0x18')](function(_0x4b1465){logger[_0x4e7c('0x14')]('UpdateFaxApplication',_0x4b1465['message'],_0x331776);_0x538aaa(_0xbf7635[_0x4e7c('0x14')](0x1f4,_0x4b1465[_0x4e7c('0x16')]));});});}; \ No newline at end of file +var _0xc27a=['error','code','message','info','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x119161,_0x1794a9){var _0x7c0cf2=function(_0x4ea9f3){while(--_0x4ea9f3){_0x119161['push'](_0x119161['shift']());}};_0x7c0cf2(++_0x1794a9);}(_0xc27a,0x1b2));var _0xac27=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0xc27a[_0x17823f];return _0x51fc21;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac27('0x0'));var BPromise=require('bluebird');var rs=require(_0xac27('0x1'));var fs=require('fs');var Redis=require(_0xac27('0x2'));var db=require(_0xac27('0x3'))['db'];var utils=require(_0xac27('0x4'));var logger=require('../../config/logger')(_0xac27('0x5'));var config=require(_0xac27('0x6'));var jayson=require(_0xac27('0x7'));var client=jayson['client'][_0xac27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dbeda,_0x3519ad,_0x228e19){return new BPromise(function(_0x5eb846,_0x547ca5){return client[_0xac27('0x9')](_0x3dbeda,_0x228e19)[_0xac27('0xa')](function(_0x3a6861){logger['info'](_0xac27('0xb'),_0x3519ad,'request\x20sent');logger[_0xac27('0xc')](_0xac27('0xd'),_0x3519ad,_0xac27('0xe'),JSON[_0xac27('0xf')](_0x3a6861));if(_0x3a6861[_0xac27('0x10')]){if(_0x3a6861['error'][_0xac27('0x11')]===0x1f4){logger[_0xac27('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3519ad,_0x3a6861['error'][_0xac27('0x12')]);return _0x547ca5(_0x3a6861[_0xac27('0x10')][_0xac27('0x12')]);}logger[_0xac27('0x10')](_0xac27('0xb'),_0x3519ad,_0x3a6861[_0xac27('0x10')][_0xac27('0x12')]);return _0x5eb846(_0x3a6861[_0xac27('0x10')][_0xac27('0x12')]);}else{logger[_0xac27('0x13')](_0xac27('0xb'),_0x3519ad,_0xac27('0xe'));_0x5eb846(_0x3a6861[_0xac27('0x14')][_0xac27('0x12')]);}})[_0xac27('0x15')](function(_0x14edd9){logger[_0xac27('0x10')](_0xac27('0xb'),_0x3519ad,_0x14edd9);_0x547ca5(_0x14edd9);});});}exports[_0xac27('0x16')]=function(_0x47ee94){var _0x1b06e3=this;return new Promise(function(_0x16b875,_0xf3a4f9){return db[_0xac27('0x17')][_0xac27('0x18')](_0x47ee94[_0xac27('0x19')],{'raw':_0x47ee94[_0xac27('0x1a')]?_0x47ee94[_0xac27('0x1a')][_0xac27('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47ee94[_0xac27('0x1a')]?_0x47ee94[_0xac27('0x1a')][_0xac27('0x1c')]||null:null,'attributes':_0x47ee94['options']?_0x47ee94['options']['attributes']||null:null,'limit':_0x47ee94['options']?_0x47ee94[_0xac27('0x1a')][_0xac27('0x1d')]||null:null})[_0xac27('0xa')](function(_0x2cb599){logger['info'](_0xac27('0x16'),_0x47ee94);logger[_0xac27('0xc')](_0xac27('0x16'),_0x47ee94,JSON[_0xac27('0xf')](_0x2cb599));_0x16b875(_0x2cb599);})['catch'](function(_0x562e81){logger[_0xac27('0x10')](_0xac27('0x16'),_0x562e81['message'],_0x47ee94);_0xf3a4f9(_0x1b06e3[_0xac27('0x10')](0x1f4,_0x562e81[_0xac27('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index aa7c623..c45dd2d 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x4d3b2d,_0x2733b9){var _0xa5dc59=function(_0x389b05){while(--_0x389b05){_0x4d3b2d['push'](_0x4d3b2d['shift']());}};_0xa5dc59(++_0x2733b9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0x1eba=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x48b4a1,_0x3c2bf4){var _0x2df379=function(_0x5962c1){while(--_0x5962c1){_0x48b4a1['push'](_0x48b4a1['shift']());}};_0x2df379(++_0x3c2bf4);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x1eba[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0xe')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0xf')]);router['put'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router['delete'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x11')]);module[_0xa1eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index cc29a80..519d954 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 _0x8293=['out','DATE','STRING','ENUM'];(function(_0x46e6f0,_0x3ae518){var _0x3cef50=function(_0x58c7ba){while(--_0x58c7ba){_0x46e6f0['push'](_0x46e6f0['shift']());}};_0x3cef50(++_0x3ae518);}(_0x8293,0xb9));var _0x3829=function(_0x372aee,_0x485288){_0x372aee=_0x372aee-0x0;var _0x55e225=_0x8293[_0x372aee];return _0x55e225;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3829('0x0')]},'disposition':{'type':Sequelize[_0x3829('0x1')]},'secondDisposition':{'type':Sequelize[_0x3829('0x1')]},'thirdDisposition':{'type':Sequelize[_0x3829('0x1')]},'note':{'type':Sequelize[_0x3829('0x1')]},'read1stAt':{'type':Sequelize[_0x3829('0x0')]},'fax':{'type':Sequelize[_0x3829('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x3829('0x2')]('in',_0x3829('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3829('0x3')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd94e=['sequelize','exports','BOOLEAN','DATE','STRING','out'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xd94e,0xae));var _0xed94=function(_0xe8f3bc,_0x12985f){_0xe8f3bc=_0xe8f3bc-0x0;var _0x4d1fe2=_0xd94e[_0xe8f3bc];return _0x4d1fe2;};'use strict';var Sequelize=require(_0xed94('0x0'));module[_0xed94('0x1')]={'closed':{'type':Sequelize[_0xed94('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xed94('0x3')]},'disposition':{'type':Sequelize[_0xed94('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xed94('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xed94('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xed94('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xed94('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 be31194..15fa236 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 _0x0efd=['fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','then','destroy','name','send','Users','map','fullname','TagIds','Tags','split','forEach','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','UserId','some','compact','isEmpty','FaxAccountId','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','order','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','agent','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','catch','params','includeAll','include','body','update','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','FaxMessage','findAll','rows','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs'];(function(_0x8c659f,_0x99256a){var _0x3c00b4=function(_0x404a5e){while(--_0x404a5e){_0x8c659f['push'](_0x8c659f['shift']());}};_0x3c00b4(++_0x99256a);}(_0x0efd,0x1a6));var _0xd0ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0efd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0ef('0x0'));var zipdir=require(_0xd0ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0ef('0x2'));var moment=require(_0xd0ef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd0ef('0x4'));var util=require('util');var path=require(_0xd0ef('0x5'));var sox=require(_0xd0ef('0x6'));var csv=require('to-csv');var ejs=require(_0xd0ef('0x7'));var fs=require('fs');var fs_extra=require(_0xd0ef('0x8'));var _=require(_0xd0ef('0x9'));var squel=require(_0xd0ef('0xa'));var crypto=require(_0xd0ef('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd0ef('0xc'));var querystring=require(_0xd0ef('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd0ef('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd0ef('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0ef('0x10'))(_0xd0ef('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd0ef('0x12'));var db=require(_0xd0ef('0x13'))['db'];config['redis']=_[_0xd0ef('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd0ef('0x15'))(new Redis(config[_0xd0ef('0x16')]));require(_0xd0ef('0x17'))[_0xd0ef('0x18')](socket);function respondWithStatusCode(_0x4b25e6,_0xf1d036){_0xf1d036=_0xf1d036||0xcc;return function(_0x5e69db){if(_0x5e69db){return _0x4b25e6[_0xd0ef('0x19')](_0xf1d036);}return _0x4b25e6['status'](_0xf1d036)[_0xd0ef('0x1a')]();};}function respondWithResult(_0x49b0d3,_0x38a9ac){_0x38a9ac=_0x38a9ac||0xc8;return function(_0x4f2d56){if(_0x4f2d56){return _0x49b0d3[_0xd0ef('0x1b')](_0x38a9ac)[_0xd0ef('0x1c')](_0x4f2d56);}};}function respondWithFilteredResult(_0x250757,_0xe7ff38){return function(_0x344729){if(_0x344729){var _0x2a2bc6=typeof _0xe7ff38[_0xd0ef('0x1d')]===_0xd0ef('0x1e')&&typeof _0xe7ff38['limit']===_0xd0ef('0x1e');var _0x5bc5d7=_0x344729[_0xd0ef('0x1f')];var _0x5b8072=_0x2a2bc6?0x0:_0xe7ff38['offset'];var _0x372413=_0x2a2bc6?_0x344729[_0xd0ef('0x1f')]:_0xe7ff38[_0xd0ef('0x1d')]+_0xe7ff38[_0xd0ef('0x20')];var _0x2ff941;if(_0x372413>=_0x5bc5d7){_0x372413=_0x5bc5d7;_0x2ff941=0xc8;}else{_0x2ff941=0xce;}_0x250757[_0xd0ef('0x1b')](_0x2ff941);return _0x250757[_0xd0ef('0x21')]('Content-Range',_0x5b8072+'-'+_0x372413+'/'+_0x5bc5d7)['json'](_0x344729);}return null;};}function patchUpdates(_0x169fd5){return function(_0x3f9862){try{jsonpatch[_0xd0ef('0x22')](_0x3f9862,_0x169fd5,!![]);}catch(_0x21da62){return BPromise['reject'](_0x21da62);}return _0x3f9862['save']();};}function saveUpdates(_0x50829b,_0x5c9ae3){return function(_0x6701ac){if(_0x6701ac){return _0x6701ac['update'](_0x50829b)[_0xd0ef('0x23')](function(_0x570154){return _0x570154;});}return null;};}function removeEntity(_0x508b49,_0x1965fa){return function(_0x2d281e){if(_0x2d281e){return _0x2d281e[_0xd0ef('0x24')]()['then'](function(){_0x508b49[_0xd0ef('0x1b')](0xcc)[_0xd0ef('0x1a')]();});}};}function handleEntityNotFound(_0x4b35d8,_0x3c689c){return function(_0x325d54){if(!_0x325d54){_0x4b35d8[_0xd0ef('0x19')](0x194);}return _0x325d54;};}function handleError(_0x276427,_0x2e0846){_0x2e0846=_0x2e0846||0x1f4;return function(_0x38529c){logger['error'](_0x38529c['stack']);if(_0x38529c[_0xd0ef('0x25')]){delete _0x38529c['name'];}_0x276427[_0xd0ef('0x1b')](_0x2e0846)[_0xd0ef('0x26')](_0x38529c);};}function getInteractionUsers(_0x2b3a23,_0x2845da){return new BPromise(function(_0x984729,_0x1d9006){try{if(_0x2845da[_0x2b3a23['id']]){_0x2b3a23[_0xd0ef('0x27')]=_[_0xd0ef('0x28')](_0x2845da[_0x2b3a23['id']],function(_0x56ba2a){return{'id':_0x56ba2a['id'],'fullname':_0x56ba2a[_0xd0ef('0x29')]};});}}catch(_0x361db6){_0x1d9006(_0x361db6);}_0x984729(_0x2b3a23);});}function getInteractionTags(_0x4b7c0d,_0x2ae438){return new BPromise(function(_0x105635,_0x35b681){try{if(_0x4b7c0d[_0xd0ef('0x2a')]){_0x4b7c0d[_0xd0ef('0x2b')]=[];_0x4b7c0d[_0xd0ef('0x2a')][_0xd0ef('0x2c')](',')[_0xd0ef('0x2d')](function(_0x140b35){_0x4b7c0d[_0xd0ef('0x2b')]['push'](_0x2ae438[_0x140b35]);});}delete _0x4b7c0d['TagIds'];}catch(_0x25cdb0){_0x35b681(_0x25cdb0);}_0x105635(_0x4b7c0d);});}function updateFaxInteraction(_0xa7db4e,_0x3dda02,_0x199e5f){return new BPromise(function(_0x17335a,_0x37d7a2){return getInteractionUsers(_0xa7db4e,_0x199e5f)['then'](function(_0x404ed9){return getInteractionTags(_0x404ed9,_0x3dda02);})[_0xd0ef('0x23')](function(_0x209651){_0x17335a(_0x209651);})['catch'](function(_0x144d59){_0x37d7a2(_0x144d59);});});}exports[_0xd0ef('0x2e')]=function(_0x5250c2,_0x167e3d){var _0x441aed={},_0x3f087c={},_0x16dd1d={'count':0x0,'rows':[]};var _0x2303c8=_['map'](db[_0xd0ef('0x2f')][_0xd0ef('0x30')],function(_0x4ef1f6){return{'name':_0x4ef1f6[_0xd0ef('0x31')],'type':_0x4ef1f6[_0xd0ef('0x32')][_0xd0ef('0x33')]};});_0x3f087c[_0xd0ef('0x34')]=_[_0xd0ef('0x28')](_0x2303c8,_0xd0ef('0x25'));_0x3f087c[_0xd0ef('0x35')]=_[_0xd0ef('0x36')](_0x5250c2['query']);_0x3f087c[_0xd0ef('0x37')]=_[_0xd0ef('0x38')](_0x3f087c[_0xd0ef('0x34')],_0x3f087c[_0xd0ef('0x35')]);_0x441aed['attributes']=_[_0xd0ef('0x38')](_0x3f087c[_0xd0ef('0x34')],qs[_0xd0ef('0x39')](_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x39')]));_0x441aed[_0xd0ef('0x3a')]=_0x441aed['attributes'][_0xd0ef('0x3b')]?_0x441aed[_0xd0ef('0x3a')]:_0x3f087c[_0xd0ef('0x34')];if(!_0x5250c2['query']['hasOwnProperty']('nolimit')){_0x441aed['limit']=qs['limit'](_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x20')]);_0x441aed[_0xd0ef('0x1d')]=qs[_0xd0ef('0x1d')](_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x1d')]);}_0x441aed['order']=qs['sort'](_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x3c')]);_0x441aed[_0xd0ef('0x3d')]=qs[_0xd0ef('0x37')](_[_0xd0ef('0x3e')](_0x5250c2[_0xd0ef('0x35')],_0x3f087c[_0xd0ef('0x37')]),_0x2303c8);var _0xa0f7c5=[];var _0x463b52=squel[_0xd0ef('0x3f')]()[_0xd0ef('0x40')]('id')[_0xd0ef('0x40')](_0xd0ef('0x25'))['field']('color')[_0xd0ef('0x41')](_0xd0ef('0x42'));var _0xe9e6c0=squel[_0xd0ef('0x3f')]()[_0xd0ef('0x40')](_0xd0ef('0x43'))['field'](_0xd0ef('0x44'))['field'](_0xd0ef('0x45'))[_0xd0ef('0x41')](_0xd0ef('0x46'),'ui')['left_join'](_0xd0ef('0x47'),'u',_0xd0ef('0x48'));var _0x153821=squel[_0xd0ef('0x3f')]()[_0xd0ef('0x41')](_0xd0ef('0x49'),'i')[_0xd0ef('0x4a')](_0xd0ef('0x4b'),'c',_0xd0ef('0x4c'))[_0xd0ef('0x4a')](_0xd0ef('0x47'),'o',_0xd0ef('0x4d'))[_0xd0ef('0x4a')](_0xd0ef('0x4e'),'a','a.id\x20=\x20i.FaxAccountId')[_0xd0ef('0x4a')](_0xd0ef('0x4f'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xd0ef('0x4a')](_0xd0ef('0x50'),'it',_0xd0ef('0x51'))[_0xd0ef('0x4a')](_0xd0ef('0x42'),'t',_0xd0ef('0x52'));var _0x4dd4d4=squel[_0xd0ef('0x53')]();var _0x36212a=[];var _0x14bcbc=squel[_0xd0ef('0x53')]();var _0x222f9a;if(_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x54')]){_0x222f9a=as[_0xd0ef('0x55')](_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x54')]);var _0x2f49d2=_0x222f9a['sqlOperator'];for(var _0x529ed6=0x0;_0x529ed6<_0x222f9a[_0xd0ef('0x56')]['length'];_0x529ed6++){var _0x2185a7=_0x222f9a[_0xd0ef('0x56')][_0x529ed6];var _0x44cfe5='i';var _0x1630f8=_[_0xd0ef('0x57')](_0x2303c8,[_0xd0ef('0x25'),_0x2185a7[_0xd0ef('0x40')]]);if(!_0x1630f8){switch(_0x2185a7[_0xd0ef('0x40')]){case _0xd0ef('0x58'):if(_0x2185a7[_0xd0ef('0x59')]==0x1){_0x153821[_0xd0ef('0x5a')]('`'+_0x2185a7['field']+_0xd0ef('0x5b'));}else{_0x153821['having']('`'+_0x2185a7[_0xd0ef('0x40')]+_0xd0ef('0x5c'));}break;case _0xd0ef('0x5d'):if(_0x2185a7[_0xd0ef('0x5e')]===_0xd0ef('0x5f')){if(_0x2185a7['value'][_0xd0ef('0x2c')]('\x20')[_0xd0ef('0x3b')]>0x1){_0x4dd4d4[_0x2f49d2](_0xd0ef('0x60'),qs[_0xd0ef('0x61')](_0x2185a7[_0xd0ef('0x59')]),null);}else{var _0x13bd75='%'+_0x2185a7[_0xd0ef('0x59')]+'%';_0x4dd4d4[_0x2f49d2](_0xd0ef('0x62'),_0x13bd75,_0x13bd75,_0x13bd75);}}else{_0x1630f8=_[_0xd0ef('0x57')](_0x2303c8,[_0xd0ef('0x25'),_0xd0ef('0x63')]);_0x2185a7[_0xd0ef('0x40')]=_0xd0ef('0x63');_0x2b09ff=as[_0xd0ef('0x64')](_0x44cfe5,_0x1630f8[_0xd0ef('0x32')],_0x2185a7);_0x4dd4d4[_0x2f49d2](_0x2b09ff[_0xd0ef('0x65')],_0x2b09ff[_0xd0ef('0x59')][_0xd0ef('0x66')],_0x2b09ff[_0xd0ef('0x59')][_0xd0ef('0x1a')]);}break;case _0xd0ef('0x67'):var _0x32dedb=_0x2185a7[_0xd0ef('0x59')][_0xd0ef('0x2c')](',')[_0xd0ef('0x28')](function(_0x14d659){return Number(_0x14d659);});_0x32dedb[_0xd0ef('0x2d')](function(_0x4d522c){_0x14bcbc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4d522c+',%');});_0x36212a=_[_0xd0ef('0x68')](_0x36212a,_0x32dedb);break;case _0xd0ef('0x69'):if(_0x2185a7['operator']===_0xd0ef('0x5f')){_0x4dd4d4[_0x2f49d2]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2185a7[_0xd0ef('0x59')]+'%',null);}else{_0x1630f8=_[_0xd0ef('0x57')](_0x2303c8,[_0xd0ef('0x25'),_0xd0ef('0x6a')]);_0x2185a7['field']=_0xd0ef('0x6a');_0x2b09ff=as[_0xd0ef('0x64')](_0x44cfe5,_0x1630f8[_0xd0ef('0x32')],_0x2185a7);_0x4dd4d4[_0x2f49d2](_0x2b09ff[_0xd0ef('0x65')],_0x2b09ff[_0xd0ef('0x59')]['start'],_0x2b09ff[_0xd0ef('0x59')][_0xd0ef('0x1a')]);}break;case'body':_0x2b09ff=as[_0xd0ef('0x64')]('me',null,_0x2185a7);_0x4dd4d4[_0x2f49d2](_0x2b09ff['text'],_0x2b09ff[_0xd0ef('0x59')]['start'],_0x2b09ff['value'][_0xd0ef('0x1a')]);break;}}else{var _0x2b09ff=as['buildExpression'](_0x44cfe5,_0x1630f8[_0xd0ef('0x32')],_0x2185a7);_0x4dd4d4[_0x2f49d2](_0x2b09ff[_0xd0ef('0x65')],_0x2b09ff[_0xd0ef('0x59')]['start'],_0x2b09ff[_0xd0ef('0x59')][_0xd0ef('0x1a')]);}}}else{var _0x3b2cf5=_(_0x5250c2[_0xd0ef('0x35')])[_0xd0ef('0x36')]()[_0xd0ef('0x28')](function(_0x1afd2f){return _[_0xd0ef('0x6b')](_0x2303c8,[_0xd0ef('0x25'),_0x1afd2f])?_0x1afd2f:undefined;})[_0xd0ef('0x6c')]()[_0xd0ef('0x59')]();if(!_[_0xd0ef('0x6d')](_0x3b2cf5)){_0x3b2cf5[_0xd0ef('0x2d')](function(_0x556bbd){if(_0x556bbd===_0xd0ef('0x6e')){_0x153821[_0xd0ef('0x3d')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x5250c2[_0xd0ef('0x35')][_0x556bbd]));}else if(_0x556bbd===_0xd0ef('0x6f')){var _0x34ae1f=JSON[_0xd0ef('0x70')](_0x5250c2[_0xd0ef('0x35')][_0x556bbd])['$gte'];var _0xfc880=JSON['parse'](_0x5250c2['query'][_0x556bbd])['$lte'];_0x153821[_0xd0ef('0x3d')](_0xd0ef('0x71'),_0x34ae1f,_0xfc880);}else{if(_0x5250c2['query'][_0x556bbd]==='null'){_0x153821['where']('i.'+_0x556bbd+_0xd0ef('0x72'));}else{_0x153821[_0xd0ef('0x3d')]('i.'+_0x556bbd+'\x20=\x20?',_0x5250c2[_0xd0ef('0x35')][_0x556bbd]);}}});}if(_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x73')]){if(_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x73')]==0x1){_0x153821[_0xd0ef('0x5a')](_0xd0ef('0x74'));}else{_0x153821['having'](_0xd0ef('0x75'));}}if(_0x5250c2['query']['tag']){_0x36212a=_[_0xd0ef('0x76')](_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x77')])?_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x77')]:new Array(_0x5250c2[_0xd0ef('0x35')]['tag']);_0x36212a[_0xd0ef('0x2d')](function(_0x3dfa38){_0x14bcbc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3dfa38+',%');});}if(_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x78')]){var _0x20b38b=_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x78')][_0xd0ef('0x79')]('\x5c','\x5c\x5c')[_0xd0ef('0x79')](/'/g,'\x27\x27');if(qs[_0xd0ef('0x7a')](_0x20b38b)){_0x4dd4d4['or'](_0xd0ef('0x7b'),_0x20b38b+'%')['or'](_0xd0ef('0x7c'),_0x20b38b+'%');}_0x4dd4d4['or'](_0xd0ef('0x7d'),_0x20b38b+'%');}}_0x153821[_0xd0ef('0x3d')](_0x4dd4d4);_0x153821[_0xd0ef('0x7e')]('i.id');var _0x14eca5={'type':db[_0xd0ef('0x7f')][_0xd0ef('0x80')][_0xd0ef('0x81')],'raw':!![]};var _0x1613a9=_0x153821['clone']();_0x1613a9['field'](_0xd0ef('0x82'));_0x1613a9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd0ef('0x58'));if(_0x441aed[_0xd0ef('0x83')]){_0x441aed[_0xd0ef('0x83')][_0xd0ef('0x2d')](function(_0x432055){var _0x492d16=_0x432055[0x0]===_0xd0ef('0x84')?_0x432055[0x0]:'i.'+_0x432055[0x0];_0x153821[_0xd0ef('0x83')](_0x492d16,_0x432055[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x36212a)){_0x153821[_0xd0ef('0x5a')](_0x14bcbc);_0x1613a9[_0xd0ef('0x3d')](_0xd0ef('0x85'),_0x36212a);}BPromise[_0xd0ef('0x86')]()[_0xd0ef('0x23')](function(){if(!_0x222f9a){if(_0x5250c2[_0xd0ef('0x35')]['FaxAccountId'])return;_0x1613a9[_0xd0ef('0x3d')](_0xd0ef('0x87'));_0x153821['where'](_0xd0ef('0x87'));return;}if(_0x5250c2[_0xd0ef('0x88')]['role']!=='agent')return;return _0x5250c2[_0xd0ef('0x88')][_0xd0ef('0x89')]({'attributes':['id'],'raw':!![]})['then'](function(_0x111b19){if(_['isEmpty'](_0x111b19)){_0x1613a9[_0xd0ef('0x3d')](_0xd0ef('0x8a'));_0x153821[_0xd0ef('0x3d')](_0xd0ef('0x8a'));}else{_0x1613a9[_0xd0ef('0x3d')](_0xd0ef('0x8b'),_[_0xd0ef('0x28')](_0x111b19,'id'));_0x153821['where'](_0xd0ef('0x8b'),_[_0xd0ef('0x28')](_0x111b19,'id'));}});})[_0xd0ef('0x23')](function(){if(_0x5250c2[_0xd0ef('0x88')][_0xd0ef('0x8c')]===_0xd0ef('0x8d')&&!_0x222f9a&&!_0x5250c2[_0xd0ef('0x35')]['FaxAccountId'])return[];return db[_0xd0ef('0x8e')][_0xd0ef('0x35')](_0x1613a9['toString'](),_0x14eca5);})['then'](function(_0x508b37){_0x16dd1d['count']=_0x508b37[_0xd0ef('0x3b')];if(_0x16dd1d[_0xd0ef('0x1f')]===0x0)return[];return db[_0xd0ef('0x8e')]['query'](_0x463b52[_0xd0ef('0x8f')](),_0x14eca5)[_0xd0ef('0x23')](function(_0x59bb5c){_0xa0f7c5=_['keyBy'](_0x59bb5c,'id');_0x14eca5=_[_0xd0ef('0x90')](_0x14eca5,{'model':db[_0xd0ef('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5250c2[_0xd0ef('0x35')][_0xd0ef('0x39')]){_0x441aed[_0xd0ef('0x3a')][_0xd0ef('0x2d')](function(_0x2657e4){_0x153821[_0xd0ef('0x40')]('i.'+_0x2657e4);});}else{_0x153821[_0xd0ef('0x40')](_0xd0ef('0x91'),'unreadMessages');_0x153821[_0xd0ef('0x40')](_0xd0ef('0x92'),_0xd0ef('0x93'));_0x153821[_0xd0ef('0x40')](_0xd0ef('0x94'),_0xd0ef('0x95'));_0x153821[_0xd0ef('0x40')](_0xd0ef('0x96'),'contactName');_0x153821['field'](_0xd0ef('0x97'));_0x153821[_0xd0ef('0x40')](_0xd0ef('0x98'),_0xd0ef('0x99'));_0x153821['field']('c.lastName',_0xd0ef('0x9a'));_0x153821[_0xd0ef('0x40')]('c.email','Contact.email');_0x153821[_0xd0ef('0x40')](_0xd0ef('0x9b'),'Contact.phone');_0x153821[_0xd0ef('0x40')](_0xd0ef('0x9c'),_0xd0ef('0x9d'));_0x153821['field'](_0xd0ef('0x9e'),'Contact.fax');_0x153821[_0xd0ef('0x40')](_0xd0ef('0x9f'),_0xd0ef('0xa0'));_0x153821[_0xd0ef('0x40')](_0xd0ef('0xa1'),'Owner.internal');_0x153821[_0xd0ef('0x40')](_0xd0ef('0xa2'),_0xd0ef('0x2a'));}if(_0x441aed[_0xd0ef('0x20')])_0x153821[_0xd0ef('0x20')](_0x441aed[_0xd0ef('0x20')]);if(_0x441aed['offset'])_0x153821[_0xd0ef('0x1d')](_0x441aed[_0xd0ef('0x1d')]);return db[_0xd0ef('0x8e')]['query'](_0x153821[_0xd0ef('0x8f')](),_0x14eca5);})['then'](function(_0xf3d076){if(_0xf3d076[_0xd0ef('0x3b')]>0x0)_0xe9e6c0[_0xd0ef('0x3d')](_0xd0ef('0xa3'),_[_0xd0ef('0x28')](_0xf3d076,'id'));return db[_0xd0ef('0x8e')][_0xd0ef('0x35')](_0xe9e6c0[_0xd0ef('0x8f')](),_0x14eca5)['then'](function(_0x1f8046){var _0x468916=_[_0xd0ef('0xa4')](_0x1f8046,_0xd0ef('0xa5'));var _0x51b2f1=[];_0xf3d076[_0xd0ef('0x2d')](function(_0x280334){_0x51b2f1[_0xd0ef('0xa6')](updateFaxInteraction(_0x280334,_0xa0f7c5,_0x468916));});return BPromise[_0xd0ef('0xa7')](_0x51b2f1);});});})['then'](function(_0x139c9b){_0x16dd1d['rows']=_0x139c9b;return _0x16dd1d;})[_0xd0ef('0x23')](respondWithFilteredResult(_0x167e3d,_0x441aed))[_0xd0ef('0xa8')](handleError(_0x167e3d,null));};exports['show']=function(_0x314527,_0x58d28b){var _0x1d0925={'raw':![],'where':{'id':_0x314527[_0xd0ef('0xa9')]['id']}},_0x28a114={};_0x28a114['model']=_[_0xd0ef('0x36')](db['FaxInteraction'][_0xd0ef('0x30')]);_0x28a114[_0xd0ef('0x35')]=_[_0xd0ef('0x36')](_0x314527[_0xd0ef('0x35')]);_0x28a114[_0xd0ef('0x37')]=_[_0xd0ef('0x38')](_0x28a114[_0xd0ef('0x34')],_0x28a114[_0xd0ef('0x35')]);_0x1d0925[_0xd0ef('0x3a')]=_[_0xd0ef('0x38')](_0x28a114[_0xd0ef('0x34')],qs[_0xd0ef('0x39')](_0x314527[_0xd0ef('0x35')]['fields']));_0x1d0925['attributes']=_0x1d0925[_0xd0ef('0x3a')][_0xd0ef('0x3b')]?_0x1d0925[_0xd0ef('0x3a')]:_0x28a114[_0xd0ef('0x34')];if(_0x314527[_0xd0ef('0x35')][_0xd0ef('0xaa')]){_0x1d0925[_0xd0ef('0xab')]=[{'all':!![]}];}_0x1d0925=_[_0xd0ef('0x90')]({},_0x1d0925,_0x314527['options']);return db[_0xd0ef('0x2f')]['find'](_0x1d0925)[_0xd0ef('0x23')](handleEntityNotFound(_0x58d28b,null))[_0xd0ef('0x23')](respondWithResult(_0x58d28b,null))['catch'](handleError(_0x58d28b,null));};exports['create']=function(_0x4d1979,_0x2587f4){return db[_0xd0ef('0x2f')]['create'](_0x4d1979[_0xd0ef('0xac')],{})[_0xd0ef('0x23')](respondWithResult(_0x2587f4,0xc9))['catch'](handleError(_0x2587f4,null));};exports[_0xd0ef('0xad')]=function(_0x2c0249,_0x3a70db){if(_0x2c0249[_0xd0ef('0xac')]['id']){delete _0x2c0249[_0xd0ef('0xac')]['id'];}return db[_0xd0ef('0x2f')][_0xd0ef('0x57')]({'where':{'id':_0x2c0249[_0xd0ef('0xa9')]['id']}})['then'](handleEntityNotFound(_0x3a70db,null))[_0xd0ef('0x23')](saveUpdates(_0x2c0249[_0xd0ef('0xac')],null))[_0xd0ef('0x23')](respondWithResult(_0x3a70db,null))[_0xd0ef('0xa8')](handleError(_0x3a70db,null));};exports[_0xd0ef('0x24')]=function(_0x45dc04,_0x53f7fa){return db[_0xd0ef('0x2f')][_0xd0ef('0x57')]({'where':{'id':_0x45dc04[_0xd0ef('0xa9')]['id']}})[_0xd0ef('0x23')](handleEntityNotFound(_0x53f7fa,null))['then'](removeEntity(_0x53f7fa,null))[_0xd0ef('0xa8')](handleError(_0x53f7fa,null));};exports['describe']=function(_0x29293b,_0x53697c){return db[_0xd0ef('0x2f')][_0xd0ef('0xae')]()[_0xd0ef('0x23')](respondWithResult(_0x53697c,null))[_0xd0ef('0xa8')](handleError(_0x53697c,null));};exports[_0xd0ef('0xaf')]=function(_0x79d531,_0x52cfba,_0x5f3474){return db['FaxMessage'][_0xd0ef('0x57')]({'where':{'id':_0x79d531[_0xd0ef('0xa9')]['id']}})['then'](handleEntityNotFound(_0x52cfba,null))[_0xd0ef('0x23')](function(_0x4f8e7c){if(_0x4f8e7c){return _0x4f8e7c['addMessage'](_0x79d531[_0xd0ef('0xac')][_0xd0ef('0xb0')],_[_0xd0ef('0xb1')](_0x79d531[_0xd0ef('0xac')],[_0xd0ef('0xb0'),'id'])||{});}})['then'](respondWithResult(_0x52cfba,null))[_0xd0ef('0xa8')](handleError(_0x52cfba,null));};exports[_0xd0ef('0xb2')]=function(_0x5a35ab,_0x2fb8e4,_0x4064fd){var _0x279ebe={'raw':![],'where':{}};var _0x50af46={};var _0x1da8db={'count':0x0,'rows':[]};return db[_0xd0ef('0x2f')][_0xd0ef('0xb3')]({'where':{'id':_0x5a35ab[_0xd0ef('0xa9')]['id']}})['then'](handleEntityNotFound(_0x2fb8e4,null))[_0xd0ef('0x23')](function(_0x57f77a){if(_0x57f77a){_0x50af46[_0xd0ef('0x34')]=_['keys'](db['FaxMessage'][_0xd0ef('0x30')]);_0x50af46['query']=_[_0xd0ef('0x36')](_0x5a35ab[_0xd0ef('0x35')]);_0x50af46[_0xd0ef('0x37')]=_[_0xd0ef('0x38')](_0x50af46[_0xd0ef('0x34')],_0x50af46[_0xd0ef('0x35')]);_0x279ebe['attributes']=_['intersection'](_0x50af46[_0xd0ef('0x34')],qs[_0xd0ef('0x39')](_0x5a35ab[_0xd0ef('0x35')][_0xd0ef('0x39')]));_0x279ebe['attributes']=_0x279ebe[_0xd0ef('0x3a')][_0xd0ef('0x3b')]?_0x279ebe[_0xd0ef('0x3a')]:_0x50af46['model'];if(!_0x5a35ab[_0xd0ef('0x35')][_0xd0ef('0xb4')](_0xd0ef('0xb5'))){_0x279ebe[_0xd0ef('0x20')]=qs[_0xd0ef('0x20')](_0x5a35ab['query'][_0xd0ef('0x20')]);_0x279ebe['offset']=qs[_0xd0ef('0x1d')](_0x5a35ab[_0xd0ef('0x35')][_0xd0ef('0x1d')]);}_0x279ebe[_0xd0ef('0x83')]=qs[_0xd0ef('0x3c')](_0x5a35ab['query'][_0xd0ef('0x3c')]);_0x279ebe[_0xd0ef('0x3d')]=qs[_0xd0ef('0x37')](_[_0xd0ef('0x3e')](_0x5a35ab[_0xd0ef('0x35')],_0x50af46['filters']));_0x279ebe[_0xd0ef('0x3d')][_0xd0ef('0xa5')]=_0x57f77a['id'];if(_0x5a35ab['query'][_0xd0ef('0x78')]){_0x279ebe['where']=_[_0xd0ef('0x90')](_0x279ebe[_0xd0ef('0x3d')],{'$or':_[_0xd0ef('0x28')](_0x279ebe[_0xd0ef('0x3a')],function(_0x4583e1){var _0x1e5032={};_0x1e5032[_0x4583e1]={'$like':'%'+_0x5a35ab[_0xd0ef('0x35')][_0xd0ef('0x78')]+'%'};return _0x1e5032;})});}if(_0x5a35ab[_0xd0ef('0x35')][_0xd0ef('0xb6')]){var _0x3c5c10=_0x5a35ab[_0xd0ef('0x35')]['$gte'][_0xd0ef('0x2c')](',');var _0x48b374={};_0x48b374[_0x3c5c10[0x0]]={'$gte':moment(_0x3c5c10[0x1])[_0xd0ef('0xb7')](_0xd0ef('0xb8'))};_0x279ebe['where']=_['merge'](_0x279ebe['where'],_0x48b374);}_0x279ebe=_[_0xd0ef('0x90')]({},_0x279ebe,_0x5a35ab[_0xd0ef('0xb9')]);return db[_0xd0ef('0xba')][_0xd0ef('0x1f')]({'where':_0x279ebe[_0xd0ef('0x3d')]})[_0xd0ef('0x23')](function(_0x121a95){_0x1da8db['count']=_0x121a95;if(_0x5a35ab[_0xd0ef('0x35')][_0xd0ef('0xaa')]){_0x279ebe[_0xd0ef('0xab')]=[{'all':!![]}];}return db['FaxMessage'][_0xd0ef('0xbb')](_0x279ebe);})[_0xd0ef('0x23')](function(_0x569362){_0x1da8db[_0xd0ef('0xbc')]=_0x569362;return _0x1da8db;});}})['then'](respondWithFilteredResult(_0x2fb8e4,_0x279ebe))[_0xd0ef('0xa8')](handleError(_0x2fb8e4,null));};exports[_0xd0ef('0xbd')]=function(_0x13a4c3,_0x4b3ae6,_0x1dd8a0){return db['FaxInteraction']['find']({'where':{'id':_0x13a4c3[_0xd0ef('0xa9')]['id']}})[_0xd0ef('0x23')](handleEntityNotFound(_0x4b3ae6,null))[_0xd0ef('0x23')](function(_0x1721b2){if(_0x1721b2){return _0x1721b2[_0xd0ef('0xbe')](_0x13a4c3[_0xd0ef('0xac')][_0xd0ef('0xb0')],_[_0xd0ef('0xb1')](_0x13a4c3[_0xd0ef('0xac')],['ids','id'])||{})[_0xd0ef('0xbf')](function(){return db[_0xd0ef('0x67')][_0xd0ef('0xbb')]({'attributes':['id',_0xd0ef('0x25'),_0xd0ef('0xc0')],'where':{'id':_0x13a4c3['body'][_0xd0ef('0xb0')]}});})['then'](function(_0x118f91){socket[_0xd0ef('0xc1')](_0xd0ef('0xc2'),{'id':Number(_0x13a4c3[_0xd0ef('0xa9')]['id']),'tags':_0x118f91||[]});return{'id':Number(_0x13a4c3[_0xd0ef('0xa9')]['id']),'tags':_0x118f91||[]};});}})[_0xd0ef('0x23')](respondWithResult(_0x4b3ae6,null))[_0xd0ef('0xa8')](handleError(_0x4b3ae6,null));};exports[_0xd0ef('0xc3')]=function(_0x493096,_0x13db1d,_0x369b91){return db['FaxInteraction'][_0xd0ef('0x57')]({'where':{'id':_0x493096[_0xd0ef('0xa9')]['id']}})['then'](handleEntityNotFound(_0x13db1d,null))[_0xd0ef('0x23')](function(_0x2ec841){if(_0x2ec841){return _0x2ec841['removeTags'](_0x493096[_0xd0ef('0x35')][_0xd0ef('0xb0')]);}})[_0xd0ef('0x23')](respondWithStatusCode(_0x13db1d,null))[_0xd0ef('0xa8')](handleError(_0x13db1d,null));};exports[_0xd0ef('0xc4')]=function(_0x41d84f,_0x17208e){var _0x5d2647=moment()[_0xd0ef('0xc5')]()[_0xd0ef('0x8f')]();var _0x531bd7=path[_0xd0ef('0xc6')](config[_0xd0ef('0xc7')],'server',_0xd0ef('0xc8'),'tmp');var _0x46004d=path[_0xd0ef('0xc6')](config[_0xd0ef('0xc7')],_0xd0ef('0xc9'),_0xd0ef('0xc8'),_0xd0ef('0xca'));var _0x1b9314=path[_0xd0ef('0xc6')](_0x531bd7,_0x5d2647);var _0x5003be=util[_0xd0ef('0xb7')]('transcript-%d-%s.zip',_0x41d84f['params']['id'],_0x5d2647);var _0x2fe756=path[_0xd0ef('0xc6')](_0x531bd7,_0x5003be);var _0x1d103b=[];_0x1d103b[_0xd0ef('0xa6')]({'model':db[_0xd0ef('0xcb')],'as':_0xd0ef('0xcb'),'raw':!![]});var _0x1d8dea=[{'model':db[_0xd0ef('0xba')],'as':_0xd0ef('0xcc'),'attributes':['id',_0xd0ef('0xac'),_0xd0ef('0x6f')],'include':_0x1d103b}];return db[_0xd0ef('0x2f')][_0xd0ef('0x57')]({'where':{'id':_0x41d84f['params']['id']},'include':_0x1d8dea})[_0xd0ef('0x23')](handleEntityNotFound(_0x17208e,null))['then'](function(_0x3e2043){if(_0x3e2043&&_0x3e2043[_0xd0ef('0xcc')]){var _0x13dcfa=_0x3e2043[_0xd0ef('0xcd')]({'plain':!![]});fs[_0xd0ef('0xce')](_0x1b9314);for(var _0x2e2a9b=0x0;_0x2e2a9b<_0x13dcfa[_0xd0ef('0xcc')][_0xd0ef('0x3b')];_0x2e2a9b++){var _0x30f194=_0x13dcfa[_0xd0ef('0xcc')][_0x2e2a9b][_0xd0ef('0xcb')];if(_0x30f194){var _0x4e7bf3=path[_0xd0ef('0xc6')](_0x46004d,_0x30f194[_0xd0ef('0xcf')]);if(fs[_0xd0ef('0xd0')](_0x4e7bf3)){fs[_0xd0ef('0xd1')](_0x4e7bf3)[_0xd0ef('0xd2')](fs[_0xd0ef('0xd3')](path[_0xd0ef('0xc6')](_0x1b9314,_0x30f194[_0xd0ef('0xcf')])));}}}return BPromise[_0xd0ef('0x86')]()['then'](function(){return new BPromise(function(_0x273085,_0x1d90fd){zipdir(_0x1b9314,{'saveTo':_0x2fe756},function(_0x391e8f,_0x333367){if(_0x391e8f)return _0x1d90fd(_0x391e8f);return _0x273085(_0x333367);});})[_0xd0ef('0x23')](function(){return new BPromise(function(_0x579f02,_0x4848d2){rimraf(_0x1b9314,function(_0x3a8a76){if(_0x3a8a76)_0x4848d2(_0x3a8a76);return _0x579f02();});});})['then'](function(){return _0x17208e[_0xd0ef('0xc4')](_0x2fe756,_0x5003be,function(_0x21cc08){if(_0x21cc08){console[_0xd0ef('0xd4')](_0xd0ef('0xd5'),_0x21cc08);}else{fs[_0xd0ef('0xd6')](_0x2fe756);}});});});}else{return _0x17208e[_0xd0ef('0x19')](0xc8);}})['catch'](handleError(_0x17208e,null));}; \ No newline at end of file +var _0x925a=['SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','agent','keyBy','merge','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','toString','ui.FaxInteractionId\x20IN\x20?','sequelize','groupBy','FaxInteractionId','params','rawAttributes','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','Tags','TagIds','forEach','push','catch','index','FaxInteraction','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','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','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','$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?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone'];(function(_0x584177,_0x309d20){var _0xb3a033=function(_0x17cfdf){while(--_0x17cfdf){_0x584177['push'](_0x584177['shift']());}};_0xb3a033(++_0x309d20);}(_0x925a,0x114));var _0xa925=function(_0x31e627,_0xc241cf){_0x31e627=_0x31e627-0x0;var _0x8f16a=_0x925a[_0x31e627];return _0x8f16a;};'use strict';var emlformat=require(_0xa925('0x0'));var rimraf=require(_0xa925('0x1'));var zipdir=require(_0xa925('0x2'));var jsonpatch=require(_0xa925('0x3'));var rp=require(_0xa925('0x4'));var moment=require(_0xa925('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa925('0x6'));var path=require(_0xa925('0x7'));var sox=require(_0xa925('0x8'));var csv=require(_0xa925('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa925('0xa'));var crypto=require('crypto');var jsforce=require(_0xa925('0xb'));var deskjs=require(_0xa925('0xc'));var toCsv=require(_0xa925('0x9'));var querystring=require('querystring');var Papa=require(_0xa925('0xd'));var Redis=require(_0xa925('0xe'));var authService=require(_0xa925('0xf'));var qs=require(_0xa925('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa925('0x11'));var logger=require(_0xa925('0x12'))('api');var utils=require(_0xa925('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa925('0x14'));var db=require(_0xa925('0x15'))['db'];config['redis']=_[_0xa925('0x16')](config[_0xa925('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa925('0x17')]));require(_0xa925('0x18'))[_0xa925('0x19')](socket);function respondWithStatusCode(_0xf8f6a4,_0x317d67){_0x317d67=_0x317d67||0xcc;return function(_0x9d3d24){if(_0x9d3d24){return _0xf8f6a4[_0xa925('0x1a')](_0x317d67);}return _0xf8f6a4[_0xa925('0x1b')](_0x317d67)[_0xa925('0x1c')]();};}function respondWithResult(_0x16ce99,_0x21ff1e){_0x21ff1e=_0x21ff1e||0xc8;return function(_0xed2af8){if(_0xed2af8){return _0x16ce99[_0xa925('0x1b')](_0x21ff1e)[_0xa925('0x1d')](_0xed2af8);}};}function respondWithFilteredResult(_0x3b428f,_0x404a2d){return function(_0x4265da){if(_0x4265da){var _0x1c0e3c=typeof _0x404a2d[_0xa925('0x1e')]===_0xa925('0x1f')&&typeof _0x404a2d[_0xa925('0x20')]===_0xa925('0x1f');var _0x2c9067=_0x4265da['count'];var _0x4423b3=_0x1c0e3c?0x0:_0x404a2d[_0xa925('0x1e')];var _0x20b2ee=_0x1c0e3c?_0x4265da[_0xa925('0x21')]:_0x404a2d[_0xa925('0x1e')]+_0x404a2d[_0xa925('0x20')];var _0x386a34;if(_0x20b2ee>=_0x2c9067){_0x20b2ee=_0x2c9067;_0x386a34=0xc8;}else{_0x386a34=0xce;}_0x3b428f['status'](_0x386a34);return _0x3b428f[_0xa925('0x22')](_0xa925('0x23'),_0x4423b3+'-'+_0x20b2ee+'/'+_0x2c9067)[_0xa925('0x1d')](_0x4265da);}return null;};}function patchUpdates(_0x51a710){return function(_0x120e87){try{jsonpatch['apply'](_0x120e87,_0x51a710,!![]);}catch(_0x1968e8){return BPromise[_0xa925('0x24')](_0x1968e8);}return _0x120e87['save']();};}function saveUpdates(_0x50c118,_0x57d0fb){return function(_0x3374cb){if(_0x3374cb){return _0x3374cb[_0xa925('0x25')](_0x50c118)[_0xa925('0x26')](function(_0x207c18){return _0x207c18;});}return null;};}function removeEntity(_0x439ce4,_0x175812){return function(_0x332e7f){if(_0x332e7f){return _0x332e7f[_0xa925('0x27')]()[_0xa925('0x26')](function(){_0x439ce4[_0xa925('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24491f,_0x716c2b){return function(_0x21a7ac){if(!_0x21a7ac){_0x24491f['sendStatus'](0x194);}return _0x21a7ac;};}function handleError(_0x20c9f7,_0x3b2004){_0x3b2004=_0x3b2004||0x1f4;return function(_0x3d4b0c){logger[_0xa925('0x28')](_0x3d4b0c[_0xa925('0x29')]);if(_0x3d4b0c[_0xa925('0x2a')]){delete _0x3d4b0c['name'];}_0x20c9f7['status'](_0x3b2004)[_0xa925('0x2b')](_0x3d4b0c);};}function getInteractionUsers(_0x56c4e8,_0x4357a8){return new BPromise(function(_0x553298,_0x23ad05){try{if(_0x4357a8[_0x56c4e8['id']]){_0x56c4e8['Users']=_[_0xa925('0x2c')](_0x4357a8[_0x56c4e8['id']],function(_0x27f550){return{'id':_0x27f550['id'],'fullname':_0x27f550['fullname']};});}}catch(_0x5c0b0c){_0x23ad05(_0x5c0b0c);}_0x553298(_0x56c4e8);});}function getInteractionTags(_0x516ab1,_0x3d46d3){return new BPromise(function(_0x53b5cb,_0x4e9537){try{if(_0x516ab1['TagIds']){_0x516ab1[_0xa925('0x2d')]=[];_0x516ab1[_0xa925('0x2e')]['split'](',')[_0xa925('0x2f')](function(_0x4748c6){_0x516ab1[_0xa925('0x2d')][_0xa925('0x30')](_0x3d46d3[_0x4748c6]);});}delete _0x516ab1[_0xa925('0x2e')];}catch(_0x2ae32f){_0x4e9537(_0x2ae32f);}_0x53b5cb(_0x516ab1);});}function updateFaxInteraction(_0x2c925d,_0x43004c,_0x55666c){return new BPromise(function(_0x1bd7d9,_0x147314){return getInteractionUsers(_0x2c925d,_0x55666c)[_0xa925('0x26')](function(_0x440084){return getInteractionTags(_0x440084,_0x43004c);})[_0xa925('0x26')](function(_0x524e85){_0x1bd7d9(_0x524e85);})[_0xa925('0x31')](function(_0x51871d){_0x147314(_0x51871d);});});}exports[_0xa925('0x32')]=function(_0x18a7a,_0x1304b8){var _0xcc822d={},_0x293a0e={},_0x3ae130={'count':0x0,'rows':[]};var _0x58e575=_[_0xa925('0x2c')](db[_0xa925('0x33')]['rawAttributes'],function(_0x352228){return{'name':_0x352228[_0xa925('0x34')],'type':_0x352228[_0xa925('0x35')][_0xa925('0x36')]};});_0x293a0e[_0xa925('0x37')]=_[_0xa925('0x2c')](_0x58e575,'name');_0x293a0e[_0xa925('0x38')]=_[_0xa925('0x39')](_0x18a7a[_0xa925('0x38')]);_0x293a0e[_0xa925('0x3a')]=_['intersection'](_0x293a0e[_0xa925('0x37')],_0x293a0e['query']);_0xcc822d[_0xa925('0x3b')]=_[_0xa925('0x3c')](_0x293a0e[_0xa925('0x37')],qs[_0xa925('0x3d')](_0x18a7a[_0xa925('0x38')][_0xa925('0x3d')]));_0xcc822d[_0xa925('0x3b')]=_0xcc822d[_0xa925('0x3b')][_0xa925('0x3e')]?_0xcc822d[_0xa925('0x3b')]:_0x293a0e[_0xa925('0x37')];if(!_0x18a7a[_0xa925('0x38')][_0xa925('0x3f')](_0xa925('0x40'))){_0xcc822d['limit']=qs[_0xa925('0x20')](_0x18a7a['query'][_0xa925('0x20')]);_0xcc822d[_0xa925('0x1e')]=qs[_0xa925('0x1e')](_0x18a7a[_0xa925('0x38')][_0xa925('0x1e')]);}_0xcc822d[_0xa925('0x41')]=qs['sort'](_0x18a7a[_0xa925('0x38')][_0xa925('0x42')]);_0xcc822d[_0xa925('0x43')]=qs['filters'](_['pick'](_0x18a7a[_0xa925('0x38')],_0x293a0e[_0xa925('0x3a')]),_0x58e575);var _0x3d27ad=[];var _0x273134=squel[_0xa925('0x44')]()[_0xa925('0x45')]('id')['field'](_0xa925('0x2a'))[_0xa925('0x45')](_0xa925('0x46'))[_0xa925('0x47')](_0xa925('0x48'));var _0x3245f7=squel[_0xa925('0x44')]()['field'](_0xa925('0x49'))[_0xa925('0x45')](_0xa925('0x4a'))[_0xa925('0x45')](_0xa925('0x4b'))[_0xa925('0x47')](_0xa925('0x4c'),'ui')[_0xa925('0x4d')](_0xa925('0x4e'),'u',_0xa925('0x4f'));var _0x5813e1=squel[_0xa925('0x44')]()['from'](_0xa925('0x50'),'i')['left_join']('cm_contacts','c',_0xa925('0x51'))['left_join'](_0xa925('0x4e'),'o',_0xa925('0x52'))[_0xa925('0x4d')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0xa925('0x4d')](_0xa925('0x53'),'me',_0xa925('0x54'))[_0xa925('0x4d')](_0xa925('0x55'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xa925('0x4d')](_0xa925('0x48'),'t',_0xa925('0x56'));var _0x22687a=squel[_0xa925('0x57')]();var _0x383309=[];var _0x54e96c=squel[_0xa925('0x57')]();var _0x64a10e;if(_0x18a7a[_0xa925('0x38')][_0xa925('0x58')]){_0x64a10e=as['parseSearch'](_0x18a7a[_0xa925('0x38')]['search']);var _0x276166=_0x64a10e[_0xa925('0x59')];for(var _0x35615b=0x0;_0x35615b<_0x64a10e['conditions'][_0xa925('0x3e')];_0x35615b++){var _0x3e81ee=_0x64a10e[_0xa925('0x5a')][_0x35615b];var _0x36cc36='i';var _0x3c03dd=_[_0xa925('0x5b')](_0x58e575,['name',_0x3e81ee['field']]);if(!_0x3c03dd){switch(_0x3e81ee[_0xa925('0x45')]){case _0xa925('0x5c'):if(_0x3e81ee[_0xa925('0x5d')]==0x1){_0x5813e1[_0xa925('0x5e')]('`'+_0x3e81ee[_0xa925('0x45')]+_0xa925('0x5f'));}else{_0x5813e1[_0xa925('0x5e')]('`'+_0x3e81ee[_0xa925('0x45')]+'`\x20>\x200');}break;case _0xa925('0x60'):if(_0x3e81ee[_0xa925('0x61')]===_0xa925('0x62')){if(_0x3e81ee[_0xa925('0x5d')][_0xa925('0x63')]('\x20')[_0xa925('0x3e')]>0x1){_0x22687a[_0x276166](_0xa925('0x64'),qs['getFullTextValue'](_0x3e81ee[_0xa925('0x5d')]),null);}else{var _0x4fad15='%'+_0x3e81ee[_0xa925('0x5d')]+'%';_0x22687a[_0x276166]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4fad15,_0x4fad15,_0x4fad15);}}else{_0x3c03dd=_['find'](_0x58e575,['name',_0xa925('0x65')]);_0x3e81ee[_0xa925('0x45')]='ContactId';_0x49076f=as[_0xa925('0x66')](_0x36cc36,_0x3c03dd[_0xa925('0x35')],_0x3e81ee);_0x22687a[_0x276166](_0x49076f[_0xa925('0x67')],_0x49076f['value']['start'],_0x49076f[_0xa925('0x5d')][_0xa925('0x1c')]);}break;case _0xa925('0x68'):var _0x3d68a8=_0x3e81ee[_0xa925('0x5d')]['split'](',')[_0xa925('0x2c')](function(_0x1a7138){return Number(_0x1a7138);});_0x3d68a8[_0xa925('0x2f')](function(_0x5ecb93){_0x54e96c['or'](_0xa925('0x69'),'%,'+_0x5ecb93+',%');});_0x383309=_[_0xa925('0x6a')](_0x383309,_0x3d68a8);break;case _0xa925('0x6b'):if(_0x3e81ee[_0xa925('0x61')]===_0xa925('0x62')){_0x22687a[_0x276166](_0xa925('0x6c'),'%'+_0x3e81ee[_0xa925('0x5d')]+'%',null);}else{_0x3c03dd=_[_0xa925('0x5b')](_0x58e575,[_0xa925('0x2a'),_0xa925('0x6d')]);_0x3e81ee['field']=_0xa925('0x6d');_0x49076f=as[_0xa925('0x66')](_0x36cc36,_0x3c03dd[_0xa925('0x35')],_0x3e81ee);_0x22687a[_0x276166](_0x49076f['text'],_0x49076f[_0xa925('0x5d')][_0xa925('0x6e')],_0x49076f[_0xa925('0x5d')]['end']);}break;case _0xa925('0x6f'):_0x49076f=as[_0xa925('0x66')]('me',null,_0x3e81ee);_0x22687a[_0x276166](_0x49076f['text'],_0x49076f['value'][_0xa925('0x6e')],_0x49076f[_0xa925('0x5d')][_0xa925('0x1c')]);break;}}else{var _0x49076f=as[_0xa925('0x66')](_0x36cc36,_0x3c03dd[_0xa925('0x35')],_0x3e81ee);_0x22687a[_0x276166](_0x49076f[_0xa925('0x67')],_0x49076f[_0xa925('0x5d')][_0xa925('0x6e')],_0x49076f[_0xa925('0x5d')][_0xa925('0x1c')]);}}}else{var _0x26fbb3=_(_0x18a7a['query'])[_0xa925('0x39')]()['map'](function(_0xd73fe5){return _[_0xa925('0x70')](_0x58e575,[_0xa925('0x2a'),_0xd73fe5])?_0xd73fe5:undefined;})[_0xa925('0x71')]()[_0xa925('0x5d')]();if(!_[_0xa925('0x72')](_0x26fbb3)){_0x26fbb3[_0xa925('0x2f')](function(_0x3bd886){if(_0x3bd886==='FaxAccountId'){_0x5813e1[_0xa925('0x43')](_0xa925('0x73'),[][_0xa925('0x74')](_0x18a7a[_0xa925('0x38')][_0x3bd886]));}else if(_0x3bd886===_0xa925('0x75')){var _0x15a33c=JSON['parse'](_0x18a7a['query'][_0x3bd886])[_0xa925('0x76')];var _0x13ca7c=JSON['parse'](_0x18a7a[_0xa925('0x38')][_0x3bd886])[_0xa925('0x77')];_0x5813e1['where'](_0xa925('0x78'),_0x15a33c,_0x13ca7c);}else{if(_0x18a7a[_0xa925('0x38')][_0x3bd886]===_0xa925('0x79')){_0x5813e1[_0xa925('0x43')]('i.'+_0x3bd886+_0xa925('0x7a'));}else{_0x5813e1['where']('i.'+_0x3bd886+_0xa925('0x7b'),_0x18a7a[_0xa925('0x38')][_0x3bd886]);}}});}if(_0x18a7a[_0xa925('0x38')][_0xa925('0x7c')]){if(_0x18a7a[_0xa925('0x38')]['read']==0x1){_0x5813e1['having'](_0xa925('0x7d'));}else{_0x5813e1['having']('`unreadMessages`\x20>\x200');}}if(_0x18a7a[_0xa925('0x38')][_0xa925('0x7e')]){_0x383309=_[_0xa925('0x7f')](_0x18a7a[_0xa925('0x38')]['tag'])?_0x18a7a[_0xa925('0x38')][_0xa925('0x7e')]:new Array(_0x18a7a['query'][_0xa925('0x7e')]);_0x383309[_0xa925('0x2f')](function(_0x168b3c){_0x54e96c['or'](_0xa925('0x69'),'%,'+_0x168b3c+',%');});}if(_0x18a7a['query'][_0xa925('0x80')]){var _0x111107=_0x18a7a[_0xa925('0x38')][_0xa925('0x80')][_0xa925('0x81')]('\x5c','\x5c\x5c')[_0xa925('0x81')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x111107)){_0x22687a['or'](_0xa925('0x82'),_0x111107+'%')['or']('i.fax\x20LIKE\x20?',_0x111107+'%');}_0x22687a['or'](_0xa925('0x83'),_0x111107+'%');}}_0x5813e1['where'](_0x22687a);_0x5813e1['group'](_0xa925('0x84'));var _0x4310fa={'type':db[_0xa925('0x85')]['QueryTypes'][_0xa925('0x86')],'raw':!![]};var _0x4c3023=_0x5813e1[_0xa925('0x87')]();_0x4c3023[_0xa925('0x45')](_0xa925('0x84'));_0x4c3023[_0xa925('0x45')](_0xa925('0x88'),_0xa925('0x5c'));if(_0xcc822d['order']){_0xcc822d['order'][_0xa925('0x2f')](function(_0x11a75){var _0x261d53=_0x11a75[0x0]==='contactName'?_0x11a75[0x0]:'i.'+_0x11a75[0x0];_0x5813e1['order'](_0x261d53,_0x11a75[0x1]===_0xa925('0x89')?![]:!![]);});}if(!_[_0xa925('0x72')](_0x383309)){_0x5813e1[_0xa925('0x5e')](_0x54e96c);_0x4c3023[_0xa925('0x43')](_0xa925('0x8a'),_0x383309);}BPromise[_0xa925('0x8b')]()[_0xa925('0x26')](function(){if(!_0x64a10e){if(_0x18a7a[_0xa925('0x38')][_0xa925('0x8c')])return;_0x4c3023[_0xa925('0x43')](_0xa925('0x8d'));_0x5813e1[_0xa925('0x43')](_0xa925('0x8d'));return;}if(_0x18a7a[_0xa925('0x8e')]['role']!=='agent')return;return _0x18a7a[_0xa925('0x8e')][_0xa925('0x8f')]({'attributes':['id'],'raw':!![]})[_0xa925('0x26')](function(_0x3131f7){if(_[_0xa925('0x72')](_0x3131f7)){_0x4c3023[_0xa925('0x43')](_0xa925('0x90'));_0x5813e1[_0xa925('0x43')](_0xa925('0x90'));}else{_0x4c3023[_0xa925('0x43')]('i.FaxAccountId\x20IN\x20?',_[_0xa925('0x2c')](_0x3131f7,'id'));_0x5813e1['where'](_0xa925('0x73'),_[_0xa925('0x2c')](_0x3131f7,'id'));}});})[_0xa925('0x26')](function(){if(_0x18a7a[_0xa925('0x8e')][_0xa925('0x91')]===_0xa925('0x92')&&!_0x64a10e&&!_0x18a7a['query'][_0xa925('0x8c')])return[];return db['sequelize'][_0xa925('0x38')](_0x4c3023['toString'](),_0x4310fa);})[_0xa925('0x26')](function(_0x1a22a9){_0x3ae130['count']=_0x1a22a9[_0xa925('0x3e')];if(_0x3ae130[_0xa925('0x21')]===0x0)return[];return db['sequelize'][_0xa925('0x38')](_0x273134['toString'](),_0x4310fa)['then'](function(_0x4d8de1){_0x3d27ad=_[_0xa925('0x93')](_0x4d8de1,'id');_0x4310fa=_[_0xa925('0x94')](_0x4310fa,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18a7a[_0xa925('0x38')][_0xa925('0x3d')]){_0xcc822d[_0xa925('0x3b')][_0xa925('0x2f')](function(_0x33b14e){_0x5813e1[_0xa925('0x45')]('i.'+_0x33b14e);});}else{_0x5813e1[_0xa925('0x45')](_0xa925('0x88'),_0xa925('0x5c'));_0x5813e1['field'](_0xa925('0x95'),'Account.key');_0x5813e1['field'](_0xa925('0x96'),'Account.mandatoryDisposition');_0x5813e1[_0xa925('0x45')](_0xa925('0x97'),'contactName');_0x5813e1['field']('i.*');_0x5813e1['field']('c.firstName',_0xa925('0x98'));_0x5813e1['field'](_0xa925('0x99'),'Contact.lastName');_0x5813e1[_0xa925('0x45')]('c.email',_0xa925('0x9a'));_0x5813e1[_0xa925('0x45')](_0xa925('0x9b'),_0xa925('0x9c'));_0x5813e1[_0xa925('0x45')](_0xa925('0x9d'),_0xa925('0x9e'));_0x5813e1['field']('c.fax',_0xa925('0x9f'));_0x5813e1['field'](_0xa925('0xa0'),_0xa925('0xa1'));_0x5813e1[_0xa925('0x45')]('o.internal',_0xa925('0xa2'));_0x5813e1['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa925('0x2e'));}if(_0xcc822d[_0xa925('0x20')])_0x5813e1[_0xa925('0x20')](_0xcc822d['limit']);if(_0xcc822d[_0xa925('0x1e')])_0x5813e1[_0xa925('0x1e')](_0xcc822d['offset']);return db['sequelize'][_0xa925('0x38')](_0x5813e1[_0xa925('0xa3')](),_0x4310fa);})[_0xa925('0x26')](function(_0x488779){if(_0x488779['length']>0x0)_0x3245f7[_0xa925('0x43')](_0xa925('0xa4'),_['map'](_0x488779,'id'));return db[_0xa925('0xa5')][_0xa925('0x38')](_0x3245f7[_0xa925('0xa3')](),_0x4310fa)[_0xa925('0x26')](function(_0x1e8a1b){var _0x36a92c=_[_0xa925('0xa6')](_0x1e8a1b,_0xa925('0xa7'));var _0x5f2c5a=[];_0x488779[_0xa925('0x2f')](function(_0x1044cd){_0x5f2c5a['push'](updateFaxInteraction(_0x1044cd,_0x3d27ad,_0x36a92c));});return BPromise['all'](_0x5f2c5a);});});})[_0xa925('0x26')](function(_0x201a90){_0x3ae130['rows']=_0x201a90;return _0x3ae130;})['then'](respondWithFilteredResult(_0x1304b8,_0xcc822d))[_0xa925('0x31')](handleError(_0x1304b8,null));};exports['show']=function(_0x52c031,_0x218ebb){var _0x15675e={'raw':![],'where':{'id':_0x52c031[_0xa925('0xa8')]['id']}},_0x2345da={};_0x2345da[_0xa925('0x37')]=_[_0xa925('0x39')](db[_0xa925('0x33')][_0xa925('0xa9')]);_0x2345da[_0xa925('0x38')]=_['keys'](_0x52c031[_0xa925('0x38')]);_0x2345da['filters']=_[_0xa925('0x3c')](_0x2345da[_0xa925('0x37')],_0x2345da[_0xa925('0x38')]);_0x15675e[_0xa925('0x3b')]=_['intersection'](_0x2345da[_0xa925('0x37')],qs[_0xa925('0x3d')](_0x52c031[_0xa925('0x38')][_0xa925('0x3d')]));_0x15675e[_0xa925('0x3b')]=_0x15675e[_0xa925('0x3b')]['length']?_0x15675e[_0xa925('0x3b')]:_0x2345da[_0xa925('0x37')];if(_0x52c031[_0xa925('0x38')][_0xa925('0xaa')]){_0x15675e[_0xa925('0xab')]=[{'all':!![]}];}_0x15675e=_[_0xa925('0x94')]({},_0x15675e,_0x52c031[_0xa925('0xac')]);return db[_0xa925('0x33')][_0xa925('0x5b')](_0x15675e)[_0xa925('0x26')](handleEntityNotFound(_0x218ebb,null))[_0xa925('0x26')](respondWithResult(_0x218ebb,null))[_0xa925('0x31')](handleError(_0x218ebb,null));};exports['create']=function(_0x281f65,_0x330a3d){return db[_0xa925('0x33')][_0xa925('0xad')](_0x281f65[_0xa925('0x6f')],{})['then'](respondWithResult(_0x330a3d,0xc9))[_0xa925('0x31')](handleError(_0x330a3d,null));};exports[_0xa925('0x25')]=function(_0x904280,_0x46892f){if(_0x904280[_0xa925('0x6f')]['id']){delete _0x904280[_0xa925('0x6f')]['id'];}return db[_0xa925('0x33')][_0xa925('0x5b')]({'where':{'id':_0x904280[_0xa925('0xa8')]['id']}})[_0xa925('0x26')](handleEntityNotFound(_0x46892f,null))[_0xa925('0x26')](saveUpdates(_0x904280[_0xa925('0x6f')],null))[_0xa925('0x26')](respondWithResult(_0x46892f,null))['catch'](handleError(_0x46892f,null));};exports['destroy']=function(_0x56f868,_0x46a89a){return db[_0xa925('0x33')][_0xa925('0x5b')]({'where':{'id':_0x56f868[_0xa925('0xa8')]['id']}})['then'](handleEntityNotFound(_0x46a89a,null))[_0xa925('0x26')](removeEntity(_0x46a89a,null))[_0xa925('0x31')](handleError(_0x46a89a,null));};exports['describe']=function(_0x50d420,_0x4f0867){return db[_0xa925('0x33')][_0xa925('0xae')]()[_0xa925('0x26')](respondWithResult(_0x4f0867,null))[_0xa925('0x31')](handleError(_0x4f0867,null));};exports[_0xa925('0xaf')]=function(_0xe8c1ed,_0x1a61af,_0x44474c){return db[_0xa925('0xb0')][_0xa925('0x5b')]({'where':{'id':_0xe8c1ed[_0xa925('0xa8')]['id']}})[_0xa925('0x26')](handleEntityNotFound(_0x1a61af,null))[_0xa925('0x26')](function(_0x283894){if(_0x283894){return _0x283894['addMessage'](_0xe8c1ed[_0xa925('0x6f')][_0xa925('0xb1')],_['omit'](_0xe8c1ed['body'],['ids','id'])||{});}})[_0xa925('0x26')](respondWithResult(_0x1a61af,null))[_0xa925('0x31')](handleError(_0x1a61af,null));};exports['getMessages']=function(_0x58c689,_0x7391cb,_0x34b155){var _0x48e5ba={'raw':![],'where':{}};var _0x5a5fce={};var _0x2bc1f8={'count':0x0,'rows':[]};return db[_0xa925('0x33')]['findOne']({'where':{'id':_0x58c689[_0xa925('0xa8')]['id']}})[_0xa925('0x26')](handleEntityNotFound(_0x7391cb,null))['then'](function(_0x8af1da){if(_0x8af1da){_0x5a5fce[_0xa925('0x37')]=_[_0xa925('0x39')](db[_0xa925('0xb0')][_0xa925('0xa9')]);_0x5a5fce[_0xa925('0x38')]=_[_0xa925('0x39')](_0x58c689['query']);_0x5a5fce['filters']=_[_0xa925('0x3c')](_0x5a5fce[_0xa925('0x37')],_0x5a5fce[_0xa925('0x38')]);_0x48e5ba[_0xa925('0x3b')]=_['intersection'](_0x5a5fce[_0xa925('0x37')],qs['fields'](_0x58c689[_0xa925('0x38')][_0xa925('0x3d')]));_0x48e5ba[_0xa925('0x3b')]=_0x48e5ba['attributes'][_0xa925('0x3e')]?_0x48e5ba[_0xa925('0x3b')]:_0x5a5fce[_0xa925('0x37')];if(!_0x58c689[_0xa925('0x38')][_0xa925('0x3f')]('nolimit')){_0x48e5ba['limit']=qs['limit'](_0x58c689[_0xa925('0x38')][_0xa925('0x20')]);_0x48e5ba[_0xa925('0x1e')]=qs[_0xa925('0x1e')](_0x58c689[_0xa925('0x38')]['offset']);}_0x48e5ba[_0xa925('0x41')]=qs[_0xa925('0x42')](_0x58c689[_0xa925('0x38')]['sort']);_0x48e5ba['where']=qs[_0xa925('0x3a')](_[_0xa925('0xb2')](_0x58c689[_0xa925('0x38')],_0x5a5fce[_0xa925('0x3a')]));_0x48e5ba[_0xa925('0x43')]['FaxInteractionId']=_0x8af1da['id'];if(_0x58c689[_0xa925('0x38')][_0xa925('0x80')]){_0x48e5ba[_0xa925('0x43')]=_[_0xa925('0x94')](_0x48e5ba['where'],{'$or':_[_0xa925('0x2c')](_0x48e5ba[_0xa925('0x3b')],function(_0x53ea07){var _0x33aa5e={};_0x33aa5e[_0x53ea07]={'$like':'%'+_0x58c689['query'][_0xa925('0x80')]+'%'};return _0x33aa5e;})});}if(_0x58c689[_0xa925('0x38')][_0xa925('0x76')]){var _0x33db1a=_0x58c689[_0xa925('0x38')][_0xa925('0x76')][_0xa925('0x63')](',');var _0x2bed7d={};_0x2bed7d[_0x33db1a[0x0]]={'$gte':moment(_0x33db1a[0x1])[_0xa925('0xb3')](_0xa925('0xb4'))};_0x48e5ba[_0xa925('0x43')]=_[_0xa925('0x94')](_0x48e5ba[_0xa925('0x43')],_0x2bed7d);}_0x48e5ba=_[_0xa925('0x94')]({},_0x48e5ba,_0x58c689[_0xa925('0xac')]);return db[_0xa925('0xb0')]['count']({'where':_0x48e5ba['where']})[_0xa925('0x26')](function(_0x55572e){_0x2bc1f8['count']=_0x55572e;if(_0x58c689['query'][_0xa925('0xaa')]){_0x48e5ba[_0xa925('0xab')]=[{'all':!![]}];}return db[_0xa925('0xb0')][_0xa925('0xb5')](_0x48e5ba);})['then'](function(_0x1272e2){_0x2bc1f8[_0xa925('0xb6')]=_0x1272e2;return _0x2bc1f8;});}})[_0xa925('0x26')](respondWithFilteredResult(_0x7391cb,_0x48e5ba))[_0xa925('0x31')](handleError(_0x7391cb,null));};exports[_0xa925('0xb7')]=function(_0x2ab6b5,_0x3ce85c,_0x5ba940){return db[_0xa925('0x33')][_0xa925('0x5b')]({'where':{'id':_0x2ab6b5['params']['id']}})['then'](handleEntityNotFound(_0x3ce85c,null))[_0xa925('0x26')](function(_0x5bdbbd){if(_0x5bdbbd){return _0x5bdbbd[_0xa925('0xb8')](_0x2ab6b5[_0xa925('0x6f')]['ids'],_[_0xa925('0xb9')](_0x2ab6b5[_0xa925('0x6f')],[_0xa925('0xb1'),'id'])||{})['spread'](function(){return db['Tag'][_0xa925('0xb5')]({'attributes':['id',_0xa925('0x2a'),_0xa925('0x46')],'where':{'id':_0x2ab6b5[_0xa925('0x6f')][_0xa925('0xb1')]}});})[_0xa925('0x26')](function(_0x5c6aec){socket[_0xa925('0xba')](_0xa925('0xbb'),{'id':Number(_0x2ab6b5[_0xa925('0xa8')]['id']),'tags':_0x5c6aec||[]});return{'id':Number(_0x2ab6b5[_0xa925('0xa8')]['id']),'tags':_0x5c6aec||[]};});}})[_0xa925('0x26')](respondWithResult(_0x3ce85c,null))[_0xa925('0x31')](handleError(_0x3ce85c,null));};exports[_0xa925('0xbc')]=function(_0x512871,_0x20e024,_0x2bddaf){return db[_0xa925('0x33')][_0xa925('0x5b')]({'where':{'id':_0x512871[_0xa925('0xa8')]['id']}})[_0xa925('0x26')](handleEntityNotFound(_0x20e024,null))['then'](function(_0x1fa4d9){if(_0x1fa4d9){return _0x1fa4d9[_0xa925('0xbc')](_0x512871[_0xa925('0x38')][_0xa925('0xb1')]);}})[_0xa925('0x26')](respondWithStatusCode(_0x20e024,null))[_0xa925('0x31')](handleError(_0x20e024,null));};exports[_0xa925('0xbd')]=function(_0x47c8dc,_0x5a63dc){var _0x1b87b9=moment()[_0xa925('0xbe')]()[_0xa925('0xa3')]();var _0x85a250=path[_0xa925('0xbf')](config[_0xa925('0xc0')],_0xa925('0xc1'),_0xa925('0xc2'),_0xa925('0xc3'));var _0x352bab=path[_0xa925('0xbf')](config[_0xa925('0xc0')],_0xa925('0xc1'),_0xa925('0xc2'),'attachments');var _0x504385=path['join'](_0x85a250,_0x1b87b9);var _0xbf837b=util[_0xa925('0xb3')](_0xa925('0xc4'),_0x47c8dc[_0xa925('0xa8')]['id'],_0x1b87b9);var _0x17da3b=path[_0xa925('0xbf')](_0x85a250,_0xbf837b);var _0x3c6a4b=[];_0x3c6a4b[_0xa925('0x30')]({'model':db[_0xa925('0xc5')],'as':_0xa925('0xc5'),'raw':!![]});var _0x56bcbd=[{'model':db[_0xa925('0xb0')],'as':_0xa925('0xc6'),'attributes':['id',_0xa925('0x6f'),_0xa925('0x75')],'include':_0x3c6a4b}];return db[_0xa925('0x33')][_0xa925('0x5b')]({'where':{'id':_0x47c8dc[_0xa925('0xa8')]['id']},'include':_0x56bcbd})[_0xa925('0x26')](handleEntityNotFound(_0x5a63dc,null))['then'](function(_0x365f68){if(_0x365f68&&_0x365f68[_0xa925('0xc6')]){var _0x31efc3=_0x365f68[_0xa925('0xc7')]({'plain':!![]});fs['mkdirSync'](_0x504385);for(var _0x560759=0x0;_0x560759<_0x31efc3[_0xa925('0xc6')][_0xa925('0x3e')];_0x560759++){var _0x1f57bc=_0x31efc3[_0xa925('0xc6')][_0x560759]['Attachment'];if(_0x1f57bc){var _0x152d57=path[_0xa925('0xbf')](_0x352bab,_0x1f57bc[_0xa925('0xc8')]);if(fs[_0xa925('0xc9')](_0x152d57)){fs[_0xa925('0xca')](_0x152d57)[_0xa925('0xcb')](fs[_0xa925('0xcc')](path[_0xa925('0xbf')](_0x504385,_0x1f57bc[_0xa925('0xc8')])));}}}return BPromise[_0xa925('0x8b')]()[_0xa925('0x26')](function(){return new BPromise(function(_0x4b3d98,_0x580753){zipdir(_0x504385,{'saveTo':_0x17da3b},function(_0x5298b9,_0x200673){if(_0x5298b9)return _0x580753(_0x5298b9);return _0x4b3d98(_0x200673);});})['then'](function(){return new BPromise(function(_0x47781b,_0x5c594c){rimraf(_0x504385,function(_0x3aadf2){if(_0x3aadf2)_0x5c594c(_0x3aadf2);return _0x47781b();});});})['then'](function(){return _0x5a63dc[_0xa925('0xbd')](_0x17da3b,_0xbf837b,function(_0x113969){if(_0x113969){console['log']('err',_0x113969);}else{fs[_0xa925('0xcd')](_0x17da3b);}});});});}else{return _0x5a63dc[_0xa925('0x1a')](0xc8);}})[_0xa925('0x31')](handleError(_0x5a63dc,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d6e5f33..5dd1a27 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 _0xe0f9=['remove','then','setDataValue','Users','map','findAll','length','emit','exports','../../mysqldb','FaxMessage','setMaxListeners','update'];(function(_0x2a4158,_0x5a8ba6){var _0xe12114=function(_0x665944){while(--_0x665944){_0x2a4158['push'](_0x2a4158['shift']());}};_0xe12114(++_0x5a8ba6);}(_0xe0f9,0x19c));var _0x9e0f=function(_0x26d015,_0x145365){_0x26d015=_0x26d015-0x0;var _0x40cca3=_0xe0f9[_0x26d015];return _0x40cca3;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x9e0f('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x9e0f('0x0'))['db'][_0x9e0f('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9e0f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9e0f('0x3'),'afterDestroy':_0x9e0f('0x4')};function emitEvent(_0x2a11df){return function(_0x8ab64a,_0x122d06,_0x6bae71){_0x8ab64a['getUsers']({'attributes':['id'],'raw':!![]})[_0x9e0f('0x5')](function(_0x15a6ba){_0x8ab64a[_0x9e0f('0x6')](_0x9e0f('0x7'),_0x15a6ba[_0x9e0f('0x8')](function(_0x536296){return{'id':_0x536296['id']};}));return FaxMessage[_0x9e0f('0x9')]({'where':{'FaxInteractionId':_0x8ab64a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e0f('0x5')](function(_0x135862){_0x8ab64a['setDataValue']('unreadMessages',_0x135862[_0x9e0f('0xa')]);FaxInteractionEvents[_0x9e0f('0xb')](_0x2a11df+':'+_0x8ab64a['id'],_0x8ab64a);FaxInteractionEvents[_0x9e0f('0xb')](_0x2a11df,_0x8ab64a);_0x6bae71(null);})['catch'](_0x6bae71(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x9e0f('0xc')]=FaxInteractionEvents; \ No newline at end of file +var _0x88de=['then','length','emit','catch','events','../../mysqldb','FaxInteraction','FaxMessage','update','remove','getUsers','setDataValue','map','findAll'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x88de,0x1b6));var _0xe88d=function(_0x33ab9e,_0x55da93){_0x33ab9e=_0x33ab9e-0x0;var _0x308c54=_0x88de[_0x33ab9e];return _0x308c54;};'use strict';var EventEmitter=require(_0xe88d('0x0'));var FaxInteraction=require(_0xe88d('0x1'))['db'][_0xe88d('0x2')];var FaxMessage=require(_0xe88d('0x1'))['db'][_0xe88d('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe88d('0x4'),'afterDestroy':_0xe88d('0x5')};function emitEvent(_0x50254e){return function(_0x21943e,_0x159b7e,_0x12703c){_0x21943e[_0xe88d('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x280e96){_0x21943e[_0xe88d('0x7')]('Users',_0x280e96[_0xe88d('0x8')](function(_0x1b860b){return{'id':_0x1b860b['id']};}));return FaxMessage[_0xe88d('0x9')]({'where':{'FaxInteractionId':_0x21943e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe88d('0xa')](function(_0x2194f8){_0x21943e['setDataValue']('unreadMessages',_0x2194f8[_0xe88d('0xb')]);FaxInteractionEvents[_0xe88d('0xc')](_0x50254e+':'+_0x21943e['id'],_0x21943e);FaxInteractionEvents[_0xe88d('0xc')](_0x50254e,_0x21943e);_0x12703c(null);})[_0xe88d('0xd')](_0x12703c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5470963..5bac07c 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 _0x05e5=['path','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise'];(function(_0x4dc832,_0x18bd94){var _0xe9c3d3=function(_0xa8744a){while(--_0xa8744a){_0x4dc832['push'](_0x4dc832['shift']());}};_0xe9c3d3(++_0x18bd94);}(_0x05e5,0x17b));var _0x505e=function(_0x5d8987,_0x14d054){_0x5d8987=_0x5d8987-0x0;var _0x2997eb=_0x05e5[_0x5d8987];return _0x2997eb;};'use strict';var _=require(_0x505e('0x0'));var util=require(_0x505e('0x1'));var logger=require('../../config/logger')(_0x505e('0x2'));var moment=require('moment');var BPromise=require(_0x505e('0x3'));var rp=require(_0x505e('0x4'));var fs=require('fs');var path=require(_0x505e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x505e('0x6'));module[_0x505e('0x7')]=function(_0x1591db,_0x31adbc){return _0x1591db[_0x505e('0x8')](_0x505e('0x9'),attributes,{'tableName':_0x505e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x247c5f,_0x27b0e2,_0x517e21){if(_0x247c5f[_0x505e('0xb')](_0x505e('0xc'))){_0x247c5f[_0x505e('0xd')]=moment()[_0x505e('0xe')](_0x505e('0xf'));}_0x517e21(null,_0x247c5f);}}});}; \ No newline at end of file +var _0x019c=['request-promise','path','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','format','lodash','util','api','moment','bluebird'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x019c,0x1cc));var _0xc019=function(_0xa43910,_0x3768dc){_0xa43910=_0xa43910-0x0;var _0x168dad=_0x019c[_0xa43910];return _0x168dad;};'use strict';var _=require(_0xc019('0x0'));var util=require(_0xc019('0x1'));var logger=require('../../config/logger')(_0xc019('0x2'));var moment=require(_0xc019('0x3'));var BPromise=require(_0xc019('0x4'));var rp=require(_0xc019('0x5'));var fs=require('fs');var path=require(_0xc019('0x6'));var rimraf=require('rimraf');var config=require(_0xc019('0x7'));var attributes=require(_0xc019('0x8'));module['exports']=function(_0x353c32,_0x2bb7b4){return _0x353c32[_0xc019('0x9')](_0xc019('0xa'),attributes,{'tableName':_0xc019('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5180cc,_0x3df8cb,_0x2bfc1e){if(_0x5180cc[_0xc019('0xc')](_0xc019('0xd'))){_0x5180cc['closedAt']=moment()[_0xc019('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2bfc1e(null,_0x5180cc);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 657d452..3fbe61f 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 _0x169c=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','limit','AddTagsToFaxInteraction','find','ids','omit','AddTags'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0x169c,0x14d));var _0xc169=function(_0x453536,_0x46622b){_0x453536=_0x453536-0x0;var _0x252fb0=_0x169c[_0x453536];return _0x252fb0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc169('0x0'));var BPromise=require('bluebird');var rs=require(_0xc169('0x1'));var fs=require('fs');var Redis=require(_0xc169('0x2'));var db=require(_0xc169('0x3'))['db'];var utils=require(_0xc169('0x4'));var logger=require(_0xc169('0x5'))(_0xc169('0x6'));var config=require(_0xc169('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc169('0x8')]['http']({'port':0x232a});config[_0xc169('0x9')]=_[_0xc169('0xa')](config[_0xc169('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc169('0x9')]));require(_0xc169('0xb'))[_0xc169('0xc')](socket);function respondWithRpcPromise(_0xd24532,_0x542956,_0x4ce2ee){return new BPromise(function(_0x486e0c,_0x2f5bf4){return client['request'](_0xd24532,_0x4ce2ee)[_0xc169('0xd')](function(_0x31d58d){logger[_0xc169('0xe')](_0xc169('0xf'),_0x542956,_0xc169('0x10'));logger[_0xc169('0x11')](_0xc169('0x12'),_0x542956,_0xc169('0x10'),JSON[_0xc169('0x13')](_0x31d58d));if(_0x31d58d[_0xc169('0x14')]){if(_0x31d58d[_0xc169('0x14')][_0xc169('0x15')]===0x1f4){logger['error'](_0xc169('0xf'),_0x542956,_0x31d58d['error']['message']);return _0x2f5bf4(_0x31d58d[_0xc169('0x14')]['message']);}logger['error'](_0xc169('0xf'),_0x542956,_0x31d58d[_0xc169('0x14')][_0xc169('0x16')]);return _0x486e0c(_0x31d58d[_0xc169('0x14')][_0xc169('0x16')]);}else{logger[_0xc169('0xe')](_0xc169('0xf'),_0x542956,_0xc169('0x10'));_0x486e0c(_0x31d58d[_0xc169('0x17')][_0xc169('0x16')]);}})[_0xc169('0x18')](function(_0x2f3431){logger[_0xc169('0x14')](_0xc169('0xf'),_0x542956,_0x2f3431);_0x2f5bf4(_0x2f3431);});});}exports[_0xc169('0x19')]=function(_0x501d25){var _0x44842c=this;return new Promise(function(_0x324259,_0x52fafd){return db[_0xc169('0x1a')][_0xc169('0x1b')](_0x501d25[_0xc169('0x1c')],{'raw':_0x501d25['options']?_0x501d25['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x501d25[_0xc169('0x1d')]?_0x501d25[_0xc169('0x1d')][_0xc169('0x1e')]||null:null,'attributes':_0x501d25[_0xc169('0x1d')]?_0x501d25[_0xc169('0x1d')]['attributes']||null:null,'limit':_0x501d25[_0xc169('0x1d')]?_0x501d25[_0xc169('0x1d')][_0xc169('0x1f')]||null:null})['then'](function(_0x3c7ffc){logger[_0xc169('0xe')](_0xc169('0x19'),_0x501d25);logger[_0xc169('0x11')](_0xc169('0x19'),_0x501d25,JSON[_0xc169('0x13')](_0x3c7ffc));_0x324259(_0x3c7ffc);})[_0xc169('0x18')](function(_0x20429c){logger['error'](_0xc169('0x19'),_0x20429c['message'],_0x501d25);_0x52fafd(_0x44842c[_0xc169('0x14')](0x1f4,_0x20429c['message']));});});};exports[_0xc169('0x20')]=function(_0x3f49d1){return new Promise(function(_0x3d372c,_0x3327d3){return db[_0xc169('0x1a')][_0xc169('0x21')]({'where':_0x3f49d1[_0xc169('0x1d')]?_0x3f49d1[_0xc169('0x1d')][_0xc169('0x1e')]||null:null})[_0xc169('0xd')](function(_0x4718eb){if(_0x4718eb){return _0x4718eb['addTags'](_0x3f49d1[_0xc169('0x1c')][_0xc169('0x22')],_[_0xc169('0x23')](_0x3f49d1['body'],[_0xc169('0x22'),'id'])||{});}})['spread'](function(_0x2ae620){logger[_0xc169('0xe')](_0xc169('0x24'),_0x3f49d1);logger[_0xc169('0x11')](_0xc169('0x24'),_0x3f49d1,JSON[_0xc169('0x13')](_0x2ae620));_0x3d372c(_0x2ae620);})[_0xc169('0x18')](function(_0x41a3c6){logger['error']('AddTags',_0x41a3c6[_0xc169('0x16')],_0x3f49d1);_0x3327d3(_this[_0xc169('0x14')](0x1f4,_0x41a3c6['message']));});});}; \ No newline at end of file +var _0x8ece=['FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','limit','stringify','find','addTags','ids','omit','spread','AddTags','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./faxInteraction.socket','register','request','then'];(function(_0x59d8cf,_0x320169){var _0x3565fb=function(_0xc0c0a2){while(--_0xc0c0a2){_0x59d8cf['push'](_0x59d8cf['shift']());}};_0x3565fb(++_0x320169);}(_0x8ece,0x8d));var _0xe8ec=function(_0x49f64d,_0x3ae938){_0x49f64d=_0x49f64d-0x0;var _0x225f7e=_0x8ece[_0x49f64d];return _0x225f7e;};'use strict';var _=require(_0xe8ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8ec('0x1'));var fs=require('fs');var Redis=require(_0xe8ec('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8ec('0x3'));var logger=require(_0xe8ec('0x4'))(_0xe8ec('0x5'));var config=require(_0xe8ec('0x6'));var jayson=require(_0xe8ec('0x7'));var client=jayson[_0xe8ec('0x8')]['http']({'port':0x232a});config[_0xe8ec('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe8ec('0xa'))(new Redis(config[_0xe8ec('0x9')]));require(_0xe8ec('0xb'))[_0xe8ec('0xc')](socket);function respondWithRpcPromise(_0x1575da,_0x3df962,_0x2fb5fd){return new BPromise(function(_0x13fab9,_0x43c55d){return client[_0xe8ec('0xd')](_0x1575da,_0x2fb5fd)[_0xe8ec('0xe')](function(_0x4d0ddb){logger['info'](_0xe8ec('0xf'),_0x3df962,_0xe8ec('0x10'));logger[_0xe8ec('0x11')](_0xe8ec('0x12'),_0x3df962,_0xe8ec('0x10'),JSON['stringify'](_0x4d0ddb));if(_0x4d0ddb['error']){if(_0x4d0ddb[_0xe8ec('0x13')]['code']===0x1f4){logger[_0xe8ec('0x13')](_0xe8ec('0xf'),_0x3df962,_0x4d0ddb[_0xe8ec('0x13')]['message']);return _0x43c55d(_0x4d0ddb[_0xe8ec('0x13')][_0xe8ec('0x14')]);}logger['error'](_0xe8ec('0xf'),_0x3df962,_0x4d0ddb['error'][_0xe8ec('0x14')]);return _0x13fab9(_0x4d0ddb[_0xe8ec('0x13')][_0xe8ec('0x14')]);}else{logger[_0xe8ec('0x15')](_0xe8ec('0xf'),_0x3df962,_0xe8ec('0x10'));_0x13fab9(_0x4d0ddb[_0xe8ec('0x16')][_0xe8ec('0x14')]);}})['catch'](function(_0x3c6c8b){logger[_0xe8ec('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x3df962,_0x3c6c8b);_0x43c55d(_0x3c6c8b);});});}exports[_0xe8ec('0x17')]=function(_0x2508f9){var _0x4d55d9=this;return new Promise(function(_0x1984ed,_0x47c181){return db[_0xe8ec('0x18')][_0xe8ec('0x19')](_0x2508f9[_0xe8ec('0x1a')],{'raw':_0x2508f9[_0xe8ec('0x1b')]?_0x2508f9[_0xe8ec('0x1b')][_0xe8ec('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2508f9[_0xe8ec('0x1b')]?_0x2508f9[_0xe8ec('0x1b')][_0xe8ec('0x1d')]||null:null,'attributes':_0x2508f9[_0xe8ec('0x1b')]?_0x2508f9[_0xe8ec('0x1b')]['attributes']||null:null,'limit':_0x2508f9[_0xe8ec('0x1b')]?_0x2508f9[_0xe8ec('0x1b')][_0xe8ec('0x1e')]||null:null})[_0xe8ec('0xe')](function(_0x2fa811){logger[_0xe8ec('0x15')]('UpdateFaxInteraction',_0x2508f9);logger[_0xe8ec('0x11')](_0xe8ec('0x17'),_0x2508f9,JSON[_0xe8ec('0x1f')](_0x2fa811));_0x1984ed(_0x2fa811);})['catch'](function(_0x26e3d8){logger['error']('UpdateFaxInteraction',_0x26e3d8[_0xe8ec('0x14')],_0x2508f9);_0x47c181(_0x4d55d9[_0xe8ec('0x13')](0x1f4,_0x26e3d8[_0xe8ec('0x14')]));});});};exports['AddTagsToFaxInteraction']=function(_0x5d15d9){return new Promise(function(_0x2ee8d3,_0x1e86d6){return db[_0xe8ec('0x18')][_0xe8ec('0x20')]({'where':_0x5d15d9['options']?_0x5d15d9[_0xe8ec('0x1b')][_0xe8ec('0x1d')]||null:null})[_0xe8ec('0xe')](function(_0x163b0d){if(_0x163b0d){return _0x163b0d[_0xe8ec('0x21')](_0x5d15d9[_0xe8ec('0x1a')][_0xe8ec('0x22')],_[_0xe8ec('0x23')](_0x5d15d9[_0xe8ec('0x1a')],['ids','id'])||{});}})[_0xe8ec('0x24')](function(_0x39fa30){logger[_0xe8ec('0x15')](_0xe8ec('0x25'),_0x5d15d9);logger['debug']('AddTags',_0x5d15d9,JSON[_0xe8ec('0x1f')](_0x39fa30));_0x2ee8d3(_0x39fa30);})[_0xe8ec('0x26')](function(_0x190d00){logger[_0xe8ec('0x13')](_0xe8ec('0x25'),_0x190d00['message'],_0x5d15d9);_0x1e86d6(_this[_0xe8ec('0x13')](0x1f4,_0x190d00['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 56ff06d..18e204b 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 _0x77c4=['emit','removeListener','faxInteraction:','./faxInteraction.events','save','remove','update'];(function(_0x3755b8,_0x16f865){var _0x54c245=function(_0x46b968){while(--_0x46b968){_0x3755b8['push'](_0x3755b8['shift']());}};_0x54c245(++_0x16f865);}(_0x77c4,0x129));var _0x477c=function(_0x36b586,_0x317ee8){_0x36b586=_0x36b586-0x0;var _0x2b77dd=_0x77c4[_0x36b586];return _0x2b77dd;};'use strict';var FaxInteractionEvents=require(_0x477c('0x0'));var events=[_0x477c('0x1'),_0x477c('0x2'),_0x477c('0x3')];function createListener(_0x376b6b,_0x309b0b){return function(_0x40767f){_0x309b0b[_0x477c('0x4')](_0x376b6b,_0x40767f);};}function removeListener(_0x3c6168,_0x5d6361){return function(){FaxInteractionEvents[_0x477c('0x5')](_0x3c6168,_0x5d6361);};}exports['register']=function(_0x56eafa){for(var _0x496315=0x0,_0x4d8519=events['length'];_0x496315<_0x4d8519;_0x496315++){var _0x177cf5=events[_0x496315];var _0x1462e7=createListener(_0x477c('0x6')+_0x177cf5,_0x56eafa);FaxInteractionEvents['on'](_0x177cf5,_0x1462e7);}}; \ No newline at end of file +var _0x473f=['faxInteraction:','save','remove','update','emit','length'];(function(_0x45e38e,_0x2261a5){var _0xfeab7d=function(_0xbbd403){while(--_0xbbd403){_0x45e38e['push'](_0x45e38e['shift']());}};_0xfeab7d(++_0x2261a5);}(_0x473f,0xb5));var _0xf473=function(_0x4ada99,_0x49b683){_0x4ada99=_0x4ada99-0x0;var _0x2f853f=_0x473f[_0x4ada99];return _0x2f853f;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xf473('0x0'),_0xf473('0x1'),_0xf473('0x2')];function createListener(_0x4d1f7f,_0x47409d){return function(_0x68e165){_0x47409d[_0xf473('0x3')](_0x4d1f7f,_0x68e165);};}function removeListener(_0xf12755,_0x2ecb10){return function(){FaxInteractionEvents['removeListener'](_0xf12755,_0x2ecb10);};}exports['register']=function(_0x5d8bfb){for(var _0x462344=0x0,_0x18778d=events[_0xf473('0x4')];_0x462344<_0x18778d;_0x462344++){var _0x49268e=events[_0x462344];var _0x2f1d36=createListener(_0xf473('0x5')+_0x49268e,_0x5d8bfb);FaxInteractionEvents['on'](_0x49268e,_0x2f1d36);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index fa3c087..d8434f7 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 _0x419c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports'];(function(_0x3cb434,_0x360407){var _0x3b587b=function(_0x5e2592){while(--_0x5e2592){_0x3cb434['push'](_0x3cb434['shift']());}};_0x3b587b(++_0x360407);}(_0x419c,0xd2));var _0xc419=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0x419c[_0x3889ae];return _0x6533dd;};'use strict';var multer=require(_0xc419('0x0'));var util=require(_0xc419('0x1'));var path=require(_0xc419('0x2'));var timeout=require(_0xc419('0x3'));var express=require(_0xc419('0x4'));var router=express[_0xc419('0x5')]();var fs_extra=require(_0xc419('0x6'));var auth=require(_0xc419('0x7'));var interaction=require(_0xc419('0x8'));var config=require(_0xc419('0x9'));var controller=require(_0xc419('0xa'));router[_0xc419('0xb')]('/',auth['isAuthenticated'](),controller[_0xc419('0xc')]);router[_0xc419('0xb')](_0xc419('0xd'),auth[_0xc419('0xe')](),controller['describe']);router['get'](_0xc419('0xf'),auth[_0xc419('0xe')](),controller[_0xc419('0x10')]);router[_0xc419('0xb')](_0xc419('0x11'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xc419('0x12'),auth[_0xc419('0xe')](),controller[_0xc419('0x13')]);router[_0xc419('0x14')]('/',auth[_0xc419('0xe')](),controller[_0xc419('0x15')]);router['post'](_0xc419('0x11'),auth[_0xc419('0xe')](),controller['addMessage']);router['post'](_0xc419('0x16'),auth[_0xc419('0xe')](),interaction[_0xc419('0x17')](_0xc419('0x18'),_0xc419('0x19')),controller[_0xc419('0x1a')]);router[_0xc419('0x1b')](_0xc419('0xf'),auth[_0xc419('0xe')](),interaction[_0xc419('0x17')]('fax',_0xc419('0x1c')),controller[_0xc419('0x1d')]);router[_0xc419('0x1e')](_0xc419('0xf'),auth[_0xc419('0xe')](),interaction[_0xc419('0x17')](_0xc419('0x18'),_0xc419('0x1f')),controller[_0xc419('0x20')]);router[_0xc419('0x1e')](_0xc419('0x16'),auth[_0xc419('0xe')](),controller[_0xc419('0x21')]);module[_0xc419('0x22')]=router; \ No newline at end of file +var _0x6a08=['get','/describe','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','fax','faxinteraction:addtags','put','/:id','update','delete','faxinteraction:destroy','/:id/tags','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller'];(function(_0x5a53dd,_0x5a402f){var _0x42ddda=function(_0x39c8dc){while(--_0x39c8dc){_0x5a53dd['push'](_0x5a53dd['shift']());}};_0x42ddda(++_0x5a402f);}(_0x6a08,0xfe));var _0x86a0=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6a08[_0x3c4737];return _0x2bb926;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x86a0('0x0'));var express=require('express');var router=express[_0x86a0('0x1')]();var fs_extra=require(_0x86a0('0x2'));var auth=require(_0x86a0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86a0('0x4'));var controller=require(_0x86a0('0x5'));router[_0x86a0('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x86a0('0x7'),auth[_0x86a0('0x8')](),controller['describe']);router[_0x86a0('0x6')]('/:id',auth[_0x86a0('0x8')](),controller[_0x86a0('0x9')]);router[_0x86a0('0x6')](_0x86a0('0xa'),auth['isAuthenticated'](),controller[_0x86a0('0xb')]);router[_0x86a0('0x6')](_0x86a0('0xc'),auth[_0x86a0('0x8')](),controller[_0x86a0('0xd')]);router[_0x86a0('0xe')]('/',auth[_0x86a0('0x8')](),controller[_0x86a0('0xf')]);router[_0x86a0('0xe')](_0x86a0('0xa'),auth[_0x86a0('0x8')](),controller['addMessage']);router[_0x86a0('0xe')]('/:id/tags',auth[_0x86a0('0x8')](),interaction[_0x86a0('0x10')](_0x86a0('0x11'),_0x86a0('0x12')),controller['addTags']);router[_0x86a0('0x13')](_0x86a0('0x14'),auth[_0x86a0('0x8')](),interaction[_0x86a0('0x10')](_0x86a0('0x11'),'faxinteraction:update'),controller[_0x86a0('0x15')]);router[_0x86a0('0x16')](_0x86a0('0x14'),auth[_0x86a0('0x8')](),interaction[_0x86a0('0x10')](_0x86a0('0x11'),_0x86a0('0x17')),controller['destroy']);router[_0x86a0('0x16')](_0x86a0('0x18'),auth[_0x86a0('0x8')](),controller['removeTags']);module[_0x86a0('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 4e13016..ed1b430 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 _0x56e6=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1a29e0,_0x44d459){var _0x3f02d4=function(_0x6c7e20){while(--_0x6c7e20){_0x1a29e0['push'](_0x1a29e0['shift']());}};_0x3f02d4(++_0x44d459);}(_0x56e6,0x6b));var _0x656e=function(_0x55c84d,_0x267dbc){_0x55c84d=_0x55c84d-0x0;var _0xc35a37=_0x56e6[_0x55c84d];return _0xc35a37;};'use strict';var Sequelize=require(_0x656e('0x0'));module[_0x656e('0x1')]={'body':{'type':Sequelize[_0x656e('0x2')](_0x656e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x656e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x656e('0x5')]('in','out'),'defaultValue':_0x656e('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x656e('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x656e('0x7')]}}; \ No newline at end of file +var _0x9a19=['ENUM','out','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x4c4cbf,_0x1e6e6){var _0xa65774=function(_0x7827f4){while(--_0x7827f4){_0x4c4cbf['push'](_0x4c4cbf['shift']());}};_0xa65774(++_0x1e6e6);}(_0x9a19,0x114));var _0x99a1=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x9a19[_0x487496];return _0x539dc8;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'body':{'type':Sequelize[_0x99a1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x99a1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x99a1('0x4')]('in',_0x99a1('0x5')),'defaultValue':_0x99a1('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x99a1('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x99a1('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 61aeb21..8d6844d 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 _0xbbab=['name','send','index','map','FaxMessage','rawAttributes','type','key','model','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','intersection','length','includeAll','options','find','body','params','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','update','isNil','role','interaction','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','internal','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','http','client','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','stack'];(function(_0x277651,_0x32aa35){var _0x10d686=function(_0x1a5f5e){while(--_0x1a5f5e){_0x277651['push'](_0x277651['shift']());}};_0x10d686(++_0x32aa35);}(_0xbbab,0xe8));var _0xbbba=function(_0x41df41,_0x397b25){_0x41df41=_0x41df41-0x0;var _0x5036df=_0xbbab[_0x41df41];return _0x5036df;};'use strict';var emlformat=require(_0xbbba('0x0'));var rimraf=require(_0xbbba('0x1'));var zipdir=require(_0xbbba('0x2'));var jsonpatch=require(_0xbbba('0x3'));var rp=require(_0xbbba('0x4'));var moment=require(_0xbbba('0x5'));var BPromise=require(_0xbbba('0x6'));var Mustache=require(_0xbbba('0x7'));var util=require(_0xbbba('0x8'));var path=require('path');var sox=require(_0xbbba('0x9'));var csv=require('to-csv');var ejs=require(_0xbbba('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbba('0xb'));var squel=require(_0xbbba('0xc'));var crypto=require(_0xbbba('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbbba('0xe'));var Papa=require(_0xbbba('0xf'));var Redis=require(_0xbbba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbbba('0x11'));var as=require(_0xbbba('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbba('0x13'))(_0xbbba('0x14'));var utils=require(_0xbbba('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbbba('0x16'));var db=require(_0xbbba('0x17'))['db'];config['redis']=_[_0xbbba('0x18')](config[_0xbbba('0x19')],{'host':_0xbbba('0x1a'),'port':0x18eb});var socket=require(_0xbbba('0x1b'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xbbba('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xbbba('0x1d')]({'port':0x232c});var client9002=jayson[_0xbbba('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dec58,_0x186cfa,_0x13909a,_0x4127c1){return new BPromise(function(_0x2eb247,_0x1eb7b7){var _0x5c051e=_0x4127c1||client;return _0x5c051e['request'](_0x2dec58,_0x13909a)['then'](function(_0x5e97e7){logger[_0xbbba('0x1f')](_0xbbba('0x20'),_0x186cfa,_0xbbba('0x21'));logger[_0xbbba('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x186cfa,_0xbbba('0x21'),JSON['stringify'](_0x5e97e7));if(_0x5e97e7[_0xbbba('0x23')]){if(_0x5e97e7['error'][_0xbbba('0x24')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x186cfa,_0x5e97e7[_0xbbba('0x23')][_0xbbba('0x25')]);return _0x1eb7b7(_0x5e97e7[_0xbbba('0x23')][_0xbbba('0x25')]);}logger[_0xbbba('0x23')](_0xbbba('0x20'),_0x186cfa,_0x5e97e7[_0xbbba('0x23')][_0xbbba('0x25')]);return _0x2eb247(_0x5e97e7[_0xbbba('0x23')][_0xbbba('0x25')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x186cfa,_0xbbba('0x21'));_0x2eb247(_0x5e97e7[_0xbbba('0x26')][_0xbbba('0x25')]);}})[_0xbbba('0x27')](function(_0x3a6caa){logger[_0xbbba('0x23')](_0xbbba('0x20'),_0x186cfa,_0x3a6caa);_0x1eb7b7(_0x3a6caa);});});}function respondWithStatusCode(_0xdc5ef3,_0x19da6b){_0x19da6b=_0x19da6b||0xcc;return function(_0x4980da){if(_0x4980da){return _0xdc5ef3[_0xbbba('0x28')](_0x19da6b);}return _0xdc5ef3[_0xbbba('0x29')](_0x19da6b)[_0xbbba('0x2a')]();};}function respondWithResult(_0x35f734,_0x3bd1da){_0x3bd1da=_0x3bd1da||0xc8;return function(_0x47dc3d){if(_0x47dc3d){return _0x35f734[_0xbbba('0x29')](_0x3bd1da)[_0xbbba('0x2b')](_0x47dc3d);}};}function respondWithFilteredResult(_0x51e06d,_0x597bf0){return function(_0xd43085){if(_0xd43085){var _0x4e629c=typeof _0x597bf0[_0xbbba('0x2c')]==='undefined'&&typeof _0x597bf0[_0xbbba('0x2d')]===_0xbbba('0x2e');var _0x4082a5=_0xd43085[_0xbbba('0x2f')];var _0x56d0d7=_0x4e629c?0x0:_0x597bf0[_0xbbba('0x2c')];var _0x226088=_0x4e629c?_0xd43085[_0xbbba('0x2f')]:_0x597bf0[_0xbbba('0x2c')]+_0x597bf0[_0xbbba('0x2d')];var _0x287334;if(_0x226088>=_0x4082a5){_0x226088=_0x4082a5;_0x287334=0xc8;}else{_0x287334=0xce;}_0x51e06d[_0xbbba('0x29')](_0x287334);return _0x51e06d['set'](_0xbbba('0x30'),_0x56d0d7+'-'+_0x226088+'/'+_0x4082a5)[_0xbbba('0x2b')](_0xd43085);}return null;};}function patchUpdates(_0x1a3376){return function(_0x9fbc27){try{jsonpatch['apply'](_0x9fbc27,_0x1a3376,!![]);}catch(_0x3efbfd){return BPromise[_0xbbba('0x31')](_0x3efbfd);}return _0x9fbc27[_0xbbba('0x32')]();};}function saveUpdates(_0x2ae3ac,_0x2595df){return function(_0x2d2714){if(_0x2d2714){return _0x2d2714['update'](_0x2ae3ac)[_0xbbba('0x33')](function(_0x1e3983){return _0x1e3983;});}return null;};}function removeEntity(_0x315a5d,_0x2a327e){return function(_0x475a2e){if(_0x475a2e){return _0x475a2e[_0xbbba('0x34')]()[_0xbbba('0x33')](function(){_0x315a5d[_0xbbba('0x29')](0xcc)[_0xbbba('0x2a')]();});}};}function handleEntityNotFound(_0x7488a7,_0x588536){return function(_0x373116){if(!_0x373116){_0x7488a7['sendStatus'](0x194);}return _0x373116;};}function handleError(_0x251d82,_0x1f5b1e){_0x1f5b1e=_0x1f5b1e||0x1f4;return function(_0x5b9079){logger[_0xbbba('0x23')](_0x5b9079[_0xbbba('0x35')]);if(_0x5b9079[_0xbbba('0x36')]){delete _0x5b9079[_0xbbba('0x36')];}_0x251d82[_0xbbba('0x29')](_0x1f5b1e)[_0xbbba('0x37')](_0x5b9079);};}exports[_0xbbba('0x38')]=function(_0x4da64a,_0x38a1e4){var _0x30f9b0={},_0x33718a={},_0x1fbc20={'count':0x0,'rows':[]};var _0x27bf90=_[_0xbbba('0x39')](db[_0xbbba('0x3a')][_0xbbba('0x3b')],function(_0x462acc){return{'name':_0x462acc['fieldName'],'type':_0x462acc[_0xbbba('0x3c')][_0xbbba('0x3d')]};});_0x33718a[_0xbbba('0x3e')]=_[_0xbbba('0x39')](_0x27bf90,_0xbbba('0x36'));_0x33718a[_0xbbba('0x3f')]=_[_0xbbba('0x40')](_0x4da64a[_0xbbba('0x3f')]);_0x33718a[_0xbbba('0x41')]=_['intersection'](_0x33718a[_0xbbba('0x3e')],_0x33718a[_0xbbba('0x3f')]);_0x30f9b0['attributes']=_['intersection'](_0x33718a[_0xbbba('0x3e')],qs[_0xbbba('0x42')](_0x4da64a['query'][_0xbbba('0x42')]));_0x30f9b0[_0xbbba('0x43')]=_0x30f9b0[_0xbbba('0x43')]['length']?_0x30f9b0[_0xbbba('0x43')]:_0x33718a['model'];if(!_0x4da64a[_0xbbba('0x3f')]['hasOwnProperty'](_0xbbba('0x44'))){_0x30f9b0[_0xbbba('0x2d')]=qs[_0xbbba('0x2d')](_0x4da64a['query'][_0xbbba('0x2d')]);_0x30f9b0[_0xbbba('0x2c')]=qs[_0xbbba('0x2c')](_0x4da64a[_0xbbba('0x3f')][_0xbbba('0x2c')]);}_0x30f9b0[_0xbbba('0x45')]=qs['sort'](_0x4da64a[_0xbbba('0x3f')][_0xbbba('0x46')]);_0x30f9b0[_0xbbba('0x47')]=qs[_0xbbba('0x41')](_[_0xbbba('0x48')](_0x4da64a[_0xbbba('0x3f')],_0x33718a['filters']),_0x27bf90);if(_0x4da64a[_0xbbba('0x3f')][_0xbbba('0x49')]){_0x30f9b0[_0xbbba('0x47')]=_['merge'](_0x30f9b0[_0xbbba('0x47')],{'$or':_[_0xbbba('0x39')](_0x27bf90,function(_0x4723ad){if(_0x4723ad['type']!=='VIRTUAL'){var _0x3d677c={};_0x3d677c[_0x4723ad[_0xbbba('0x36')]]={'$like':'%'+_0x4da64a['query'][_0xbbba('0x49')]+'%'};return _0x3d677c;}})});}_0x30f9b0=_[_0xbbba('0x4a')]({},_0x30f9b0,_0x4da64a['options']);var _0x38f2f5={'where':_0x30f9b0[_0xbbba('0x47')]};return db[_0xbbba('0x3a')]['count'](_0x38f2f5)[_0xbbba('0x33')](function(_0x132c47){_0x1fbc20[_0xbbba('0x2f')]=_0x132c47;if(_0x4da64a[_0xbbba('0x3f')]['includeAll']){_0x30f9b0[_0xbbba('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0xbbba('0x4c')](_0x30f9b0);})[_0xbbba('0x33')](function(_0x8ed52a){_0x1fbc20[_0xbbba('0x4d')]=_0x8ed52a;return _0x1fbc20;})['then'](respondWithFilteredResult(_0x38a1e4,_0x30f9b0))[_0xbbba('0x27')](handleError(_0x38a1e4,null));};exports['show']=function(_0x16a155,_0x585e9d){var _0x18dc99={'raw':!![],'where':{'id':_0x16a155['params']['id']}},_0x1ce57c={};_0x1ce57c[_0xbbba('0x3e')]=_['keys'](db[_0xbbba('0x3a')][_0xbbba('0x3b')]);_0x1ce57c[_0xbbba('0x3f')]=_[_0xbbba('0x40')](_0x16a155['query']);_0x1ce57c[_0xbbba('0x41')]=_['intersection'](_0x1ce57c[_0xbbba('0x3e')],_0x1ce57c[_0xbbba('0x3f')]);_0x18dc99['attributes']=_[_0xbbba('0x4e')](_0x1ce57c['model'],qs[_0xbbba('0x42')](_0x16a155[_0xbbba('0x3f')]['fields']));_0x18dc99[_0xbbba('0x43')]=_0x18dc99[_0xbbba('0x43')][_0xbbba('0x4f')]?_0x18dc99[_0xbbba('0x43')]:_0x1ce57c['model'];if(_0x16a155['query'][_0xbbba('0x50')]){_0x18dc99['include']=[{'all':!![]}];}_0x18dc99=_[_0xbbba('0x4a')]({},_0x18dc99,_0x16a155[_0xbbba('0x51')]);return db['FaxMessage'][_0xbbba('0x52')](_0x18dc99)[_0xbbba('0x33')](handleEntityNotFound(_0x585e9d,null))['then'](respondWithResult(_0x585e9d,null))['catch'](handleError(_0x585e9d,null));};exports['update']=function(_0x3a4385,_0x18c19c){if(_0x3a4385[_0xbbba('0x53')]['id']){delete _0x3a4385[_0xbbba('0x53')]['id'];}return db[_0xbbba('0x3a')][_0xbbba('0x52')]({'where':{'id':_0x3a4385[_0xbbba('0x54')]['id']}})[_0xbbba('0x33')](handleEntityNotFound(_0x18c19c,null))[_0xbbba('0x33')](saveUpdates(_0x3a4385['body'],null))[_0xbbba('0x33')](respondWithResult(_0x18c19c,null))[_0xbbba('0x27')](handleError(_0x18c19c,null));};exports['destroy']=function(_0x1a7955,_0x51369f){return db[_0xbbba('0x3a')][_0xbbba('0x52')]({'where':{'id':_0x1a7955[_0xbbba('0x54')]['id']}})[_0xbbba('0x33')](handleEntityNotFound(_0x51369f,null))[_0xbbba('0x33')](removeEntity(_0x51369f,null))[_0xbbba('0x27')](handleError(_0x51369f,null));};exports[_0xbbba('0x55')]=function(_0x5bda69,_0x4226ab){return db[_0xbbba('0x3a')][_0xbbba('0x55')]()[_0xbbba('0x33')](respondWithResult(_0x4226ab,null))[_0xbbba('0x27')](handleError(_0x4226ab,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xbbba('0x56')]=function(_0x4d7239,_0x53d04f,_0x2e8709){var _0x27c2cf={'agent':{},'channel':_0xbbba('0x57')};if(_0x4d7239['body']['id']){delete _0x4d7239['body']['id'];}_0x4d7239[_0xbbba('0x53')][_0xbbba('0x58')]=!![];_0x4d7239[_0xbbba('0x53')]['readAt']=moment()[_0xbbba('0x59')](_0xbbba('0x5a'));_0x4d7239[_0xbbba('0x53')][_0xbbba('0x5b')]=_0x4d7239[_0xbbba('0x53')][_0xbbba('0x5b')]||_0x4d7239[_0xbbba('0x5c')]['id'];_0x27c2cf[_0xbbba('0x5d')]['id']=_0x4d7239['body'][_0xbbba('0x5b')];return db[_0xbbba('0x3a')][_0xbbba('0x52')]({'where':{'id':_0x4d7239[_0xbbba('0x54')]['id'],'UserId':null}})[_0xbbba('0x33')](handleEntityNotFound(_0x53d04f,null))[_0xbbba('0x33')](saveUpdates(_0x4d7239[_0xbbba('0x53')],null))[_0xbbba('0x33')](function(_0x7c7a53){if(_0x7c7a53){_0x27c2cf[_0xbbba('0x25')]=_0x7c7a53[_0xbbba('0x5e')]({'plain':!![]});return db[_0xbbba('0x5f')][_0xbbba('0x52')]({'where':{'id':_0x7c7a53['FaxInteractionId']}});}return null;})[_0xbbba('0x33')](handleEntityNotFound(_0x53d04f,null))['then'](function(_0x4bb0c1){if(_0x4bb0c1){return _0x4bb0c1[_0xbbba('0x60')]({'UserId':_0x4d7239[_0xbbba('0x53')][_0xbbba('0x5b')],'read1stAt':_[_0xbbba('0x61')](_0x4bb0c1['read1stAt'])?moment()[_0xbbba('0x59')](_0xbbba('0x5a')):undefined});}return null;})[_0xbbba('0x33')](function(_0x587f10){if(_0x587f10){_0x27c2cf['interaction']=_0x587f10[_0xbbba('0x5e')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d7239[_0xbbba('0x5c')]['id'],_0x4d7239[_0xbbba('0x5c')][_0xbbba('0x36')],_0x4d7239[_0xbbba('0x5c')][_0xbbba('0x62')],_0x27c2cf[_0xbbba('0x63')]['id'],_0x4d7239[_0xbbba('0x53')]?JSON[_0xbbba('0x64')](_0x4d7239[_0xbbba('0x53')]):_0xbbba('0x65'));return respondWithRpcPromise('AcceptMessage',_0xbbba('0x66'),_0x27c2cf);}return null;})[_0xbbba('0x33')](function(_0x59c583){var _0x3f6cf4=_0xbbba('0x67')+_0x59c583[_0xbbba('0x25')][_0xbbba('0x68')];return db[_0xbbba('0x69')]['query'](_0x3f6cf4,{'type':db[_0xbbba('0x6a')]['QueryTypes'][_0xbbba('0x6b')],'raw':!![]})[_0xbbba('0x33')](function(_0x269fe7){return _0x269fe7;});})[_0xbbba('0x33')](function(_0x40f9e2){if(_0x40f9e2){_0x27c2cf[_0xbbba('0x25')][_0xbbba('0x6c')]=_0x40f9e2[0x0];if(!_0x4d7239[_0xbbba('0x53')]['UserId'])return;return db[_0xbbba('0x6d')]['find']({'where':{'id':_0x4d7239[_0xbbba('0x53')][_0xbbba('0x5b')],'role':_0xbbba('0x5d')},'attributes':['id',_0xbbba('0x36'),_0xbbba('0x6e'),_0xbbba('0x6f'),'internal'],'raw':!![]});}return null;})[_0xbbba('0x33')](function(_0x546d34){if(!_0x546d34)return null;_0x27c2cf[_0xbbba('0x25')][_0xbbba('0x5d')]=_0x546d34;return _0x27c2cf;})[_0xbbba('0x33')](function(_0x4eca68){if(_0x4eca68){if(_0x4d7239['body'][_0xbbba('0x70')]){_0x27c2cf[_0xbbba('0x25')][_0xbbba('0x71')]=util['format'](_0xbbba('0x72'),_0x4d7239[_0xbbba('0x5c')][_0xbbba('0x36')]);_0x27c2cf[_0xbbba('0x25')][_0xbbba('0x73')]=_0x27c2cf[_0xbbba('0x73')];_0x27c2cf['message']['motionChannel']=_0x27c2cf[_0xbbba('0x73')];_0x27c2cf['message'][_0xbbba('0x74')]=_0xbbba('0x56');return respondWithRpcPromise(_0xbbba('0x75'),'EventManager',{'event':_0xbbba('0x76'),'message':_0x27c2cf[_0xbbba('0x25')]},client9002)['then'](function(){return _0x27c2cf;});}return _0x27c2cf;}return null;})[_0xbbba('0x33')](respondWithResult(_0x53d04f,null))['catch'](handleError(_0x53d04f,null));};var interaction_log=require(_0xbbba('0x13'))(_0xbbba('0x77'));exports[_0xbbba('0x31')]=function(_0x40bf77,_0x4f3c5d,_0x5d9bf0){var _0x1b8e5e={'agent':{},'channel':_0xbbba('0x57')};if(_0x40bf77[_0xbbba('0x53')]['id']){delete _0x40bf77[_0xbbba('0x53')]['id'];}_0x40bf77[_0xbbba('0x53')]['UserId']=_0x40bf77[_0xbbba('0x53')][_0xbbba('0x5b')]||_0x40bf77['user']['id'];_0x1b8e5e[_0xbbba('0x5d')]['id']=_0x40bf77['body'][_0xbbba('0x5b')];return db['FaxMessage'][_0xbbba('0x52')]({'where':{'id':_0x40bf77[_0xbbba('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4f3c5d,null))[_0xbbba('0x33')](function(_0x2cb451){if(_0x2cb451){_0x1b8e5e['message']=_0x2cb451[_0xbbba('0x5e')]({'plain':!![]});return db[_0xbbba('0x5f')][_0xbbba('0x52')]({'where':{'id':_0x2cb451[_0xbbba('0x78')]}});}return null;})['then'](handleEntityNotFound(_0x4f3c5d,null))[_0xbbba('0x33')](function(_0x2b6143){if(_0x2b6143){_0x1b8e5e[_0xbbba('0x63')]=_0x2b6143[_0xbbba('0x5e')]({'plain':!![]});interaction_log[_0xbbba('0x1f')](_0xbbba('0x79'),_0x40bf77['user']['id'],_0x40bf77[_0xbbba('0x5c')][_0xbbba('0x36')],_0x40bf77[_0xbbba('0x5c')][_0xbbba('0x62')],_0x1b8e5e[_0xbbba('0x63')]['id'],_0x40bf77[_0xbbba('0x53')]?JSON['stringify'](_0x40bf77[_0xbbba('0x53')]):_0xbbba('0x65'));return respondWithRpcPromise(_0xbbba('0x7a'),_0xbbba('0x7b'),_0x1b8e5e);}return null;})[_0xbbba('0x33')](function(_0x15dae2){var _0x13a654='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15dae2[_0xbbba('0x25')][_0xbbba('0x68')];return db[_0xbbba('0x69')]['query'](_0x13a654,{'type':db['Sequelize'][_0xbbba('0x7c')][_0xbbba('0x6b')],'raw':!![]})['then'](function(_0x2dfc55){return _0x2dfc55;});})[_0xbbba('0x33')](function(_0x1d9d4e){if(_0x1d9d4e){_0x1b8e5e[_0xbbba('0x25')][_0xbbba('0x6c')]=_0x1d9d4e[0x0];if(!_0x40bf77[_0xbbba('0x53')]['UserId'])return;return db[_0xbbba('0x6d')][_0xbbba('0x52')]({'where':{'id':_0x40bf77['body']['UserId'],'role':'agent'},'attributes':['id',_0xbbba('0x36'),_0xbbba('0x6e'),_0xbbba('0x6f'),_0xbbba('0x7d')],'raw':!![]});}return null;})[_0xbbba('0x33')](function(_0x1aba29){if(!_0x1aba29)return null;_0x1b8e5e[_0xbbba('0x25')][_0xbbba('0x5d')]=_0x1aba29;return _0x1b8e5e;})['then'](function(_0x487280){if(_0x487280){_0x487280[_0xbbba('0x25')][_0xbbba('0x71')]=util[_0xbbba('0x59')]('SIP/%s',_0x40bf77['user'][_0xbbba('0x36')]);_0x487280[_0xbbba('0x25')][_0xbbba('0x73')]=_0x1b8e5e[_0xbbba('0x73')];_0x487280[_0xbbba('0x25')][_0xbbba('0x7e')]=_0x1b8e5e[_0xbbba('0x73')];_0x487280[_0xbbba('0x25')][_0xbbba('0x74')]='reject';respondWithRpcPromise('EventManager',_0xbbba('0x75'),{'event':_0xbbba('0x7f'),'message':_0x487280[_0xbbba('0x25')]},client9002);return _0x1b8e5e;}return null;})['then'](respondWithResult(_0x4f3c5d,null))[_0xbbba('0x27')](handleError(_0x4f3c5d,null));};exports[_0xbbba('0x80')]=function(_0x24c9f4,_0x40442a){var _0xd7e9a6;return db[_0xbbba('0x3a')][_0xbbba('0x80')](_0x24c9f4[_0xbbba('0x53')],{})[_0xbbba('0x33')](function(_0x2d4d46){_0xd7e9a6=_0x2d4d46;return db[_0xbbba('0x81')][_0xbbba('0x82')]({'where':{'id':_0xd7e9a6[_0xbbba('0x68')]}});})[_0xbbba('0x33')](function(_0x5d0c21){if(_[_0xbbba('0x61')](_0x5d0c21)){return;}else{_0xd7e9a6[_0xbbba('0x57')]=_0x5d0c21[_0xbbba('0x57')];return db[_0xbbba('0x83')][_0xbbba('0x82')]({'where':{'id':_0xd7e9a6[_0xbbba('0x84')]}});}})[_0xbbba('0x33')](function(_0x3b572d){return respondWithRpcPromise(_0xbbba('0x85'),'SendFax',{'FaxAccountId':_[_0xbbba('0x61')](_0x24c9f4['body'])?undefined:_0x24c9f4['body'][_0xbbba('0x86')],'path':_['isNil'](_0x3b572d)?undefined:util[_0xbbba('0x59')](_0xbbba('0x87'),_0x3b572d['basename']),'fax':_[_0xbbba('0x61')](_0xd7e9a6[_0xbbba('0x57')])?undefined:_0xd7e9a6[_0xbbba('0x57')],'AttachmentId':_0xd7e9a6['AttachmentId']},client9002);})['then'](respondWithResult(_0x40442a,0xc9))[_0xbbba('0x27')](handleError(_0x40442a,null));};exports[_0xbbba('0x88')]=function(_0x5027c2,_0x17f90e){var _0x46be28=path[_0xbbba('0x89')](config[_0xbbba('0x8a')],_0xbbba('0x8b'),_0xbbba('0x8c'),_0xbbba('0x8d'));return db[_0xbbba('0x3a')][_0xbbba('0x52')]({'where':{'id':_0x5027c2[_0xbbba('0x54')]['id']},'include':[{'model':db[_0xbbba('0x83')],'as':_0xbbba('0x83')}]})[_0xbbba('0x33')](handleEntityNotFound(_0x17f90e,null))[_0xbbba('0x33')](function(_0x21a4d6){if(_0x21a4d6){return _0x17f90e[_0xbbba('0x88')](path[_0xbbba('0x89')](_0x46be28,_0x21a4d6[_0xbbba('0x83')][_0xbbba('0x8e')]));}})[_0xbbba('0x27')](handleError(_0x17f90e,null));}; \ No newline at end of file +var _0x06de=['localhost','socket.io-emitter','./faxMessage.socket','register','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','keys','filters','attributes','intersection','fields','query','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','show','params','length','include','find','body','describe','fax-interactions','accept','read','readAt','format','UserId','user','get','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','contact','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0x546885,_0x3e8413){var _0x44b1c6=function(_0x5a0dc0){while(--_0x5a0dc0){_0x546885['push'](_0x546885['shift']());}};_0x44b1c6(++_0x3e8413);}(_0x06de,0x10e));var _0xe06d=function(_0x458e3e,_0x576c7f){_0x458e3e=_0x458e3e-0x0;var _0x4bb0ee=_0x06de[_0x458e3e];return _0x4bb0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe06d('0x0'));var zipdir=require(_0xe06d('0x1'));var jsonpatch=require(_0xe06d('0x2'));var rp=require(_0xe06d('0x3'));var moment=require(_0xe06d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe06d('0x5'));var util=require(_0xe06d('0x6'));var path=require('path');var sox=require(_0xe06d('0x7'));var csv=require('to-csv');var ejs=require(_0xe06d('0x8'));var fs=require('fs');var fs_extra=require(_0xe06d('0x9'));var _=require(_0xe06d('0xa'));var squel=require(_0xe06d('0xb'));var crypto=require(_0xe06d('0xc'));var jsforce=require(_0xe06d('0xd'));var deskjs=require(_0xe06d('0xe'));var toCsv=require(_0xe06d('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe06d('0x10'));var authService=require(_0xe06d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe06d('0x12'));var hardwareService=require(_0xe06d('0x13'));var logger=require(_0xe06d('0x14'))(_0xe06d('0x15'));var utils=require(_0xe06d('0x16'));var config=require(_0xe06d('0x17'));var licenseUtil=require(_0xe06d('0x18'));var db=require(_0xe06d('0x19'))['db'];config['redis']=_[_0xe06d('0x1a')](config[_0xe06d('0x1b')],{'host':_0xe06d('0x1c'),'port':0x18eb});var socket=require(_0xe06d('0x1d'))(new Redis(config['redis']));require(_0xe06d('0x1e'))[_0xe06d('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe06d('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xe06d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3397fc,_0x2e2137,_0x203041,_0x3a08d4){return new BPromise(function(_0x407e1c,_0x5e2c59){var _0x5e5491=_0x3a08d4||client;return _0x5e5491[_0xe06d('0x21')](_0x3397fc,_0x203041)[_0xe06d('0x22')](function(_0x5e786c){logger[_0xe06d('0x23')](_0xe06d('0x24'),_0x2e2137,_0xe06d('0x25'));logger[_0xe06d('0x26')](_0xe06d('0x27'),_0x2e2137,_0xe06d('0x25'),JSON[_0xe06d('0x28')](_0x5e786c));if(_0x5e786c[_0xe06d('0x29')]){if(_0x5e786c[_0xe06d('0x29')]['code']===0x1f4){logger[_0xe06d('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2e2137,_0x5e786c['error'][_0xe06d('0x2a')]);return _0x5e2c59(_0x5e786c['error']['message']);}logger['error'](_0xe06d('0x24'),_0x2e2137,_0x5e786c[_0xe06d('0x29')]['message']);return _0x407e1c(_0x5e786c[_0xe06d('0x29')][_0xe06d('0x2a')]);}else{logger[_0xe06d('0x23')](_0xe06d('0x24'),_0x2e2137,_0xe06d('0x25'));_0x407e1c(_0x5e786c[_0xe06d('0x2b')][_0xe06d('0x2a')]);}})[_0xe06d('0x2c')](function(_0x40674c){logger[_0xe06d('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2e2137,_0x40674c);_0x5e2c59(_0x40674c);});});}function respondWithStatusCode(_0x352f68,_0x3d61fd){_0x3d61fd=_0x3d61fd||0xcc;return function(_0x18ab07){if(_0x18ab07){return _0x352f68[_0xe06d('0x2d')](_0x3d61fd);}return _0x352f68[_0xe06d('0x2e')](_0x3d61fd)[_0xe06d('0x2f')]();};}function respondWithResult(_0x34dc56,_0x42ced9){_0x42ced9=_0x42ced9||0xc8;return function(_0x9d82af){if(_0x9d82af){return _0x34dc56[_0xe06d('0x2e')](_0x42ced9)[_0xe06d('0x30')](_0x9d82af);}};}function respondWithFilteredResult(_0x130a13,_0x52b4fe){return function(_0x16f109){if(_0x16f109){var _0x4ebfb4=typeof _0x52b4fe[_0xe06d('0x31')]===_0xe06d('0x32')&&typeof _0x52b4fe[_0xe06d('0x33')]==='undefined';var _0x10e827=_0x16f109['count'];var _0x22484b=_0x4ebfb4?0x0:_0x52b4fe['offset'];var _0x2c42d8=_0x4ebfb4?_0x16f109['count']:_0x52b4fe[_0xe06d('0x31')]+_0x52b4fe['limit'];var _0x4bf430;if(_0x2c42d8>=_0x10e827){_0x2c42d8=_0x10e827;_0x4bf430=0xc8;}else{_0x4bf430=0xce;}_0x130a13['status'](_0x4bf430);return _0x130a13[_0xe06d('0x34')](_0xe06d('0x35'),_0x22484b+'-'+_0x2c42d8+'/'+_0x10e827)[_0xe06d('0x30')](_0x16f109);}return null;};}function patchUpdates(_0x37f98c){return function(_0x5cfc3c){try{jsonpatch[_0xe06d('0x36')](_0x5cfc3c,_0x37f98c,!![]);}catch(_0x48ef7c){return BPromise['reject'](_0x48ef7c);}return _0x5cfc3c[_0xe06d('0x37')]();};}function saveUpdates(_0x31dba8,_0x3da48a){return function(_0x3dd62b){if(_0x3dd62b){return _0x3dd62b[_0xe06d('0x38')](_0x31dba8)[_0xe06d('0x22')](function(_0x44564f){return _0x44564f;});}return null;};}function removeEntity(_0x42e40b,_0x138279){return function(_0x214d0b){if(_0x214d0b){return _0x214d0b[_0xe06d('0x39')]()[_0xe06d('0x22')](function(){_0x42e40b[_0xe06d('0x2e')](0xcc)[_0xe06d('0x2f')]();});}};}function handleEntityNotFound(_0x49db39,_0x28b974){return function(_0x2d1f32){if(!_0x2d1f32){_0x49db39[_0xe06d('0x2d')](0x194);}return _0x2d1f32;};}function handleError(_0x5eadc6,_0x577e95){_0x577e95=_0x577e95||0x1f4;return function(_0x57a901){logger['error'](_0x57a901['stack']);if(_0x57a901[_0xe06d('0x3a')]){delete _0x57a901[_0xe06d('0x3a')];}_0x5eadc6[_0xe06d('0x2e')](_0x577e95)[_0xe06d('0x3b')](_0x57a901);};}exports[_0xe06d('0x3c')]=function(_0xcb9664,_0x2b43e5){var _0x730743={},_0x5ba4c7={},_0x392da3={'count':0x0,'rows':[]};var _0x68f517=_[_0xe06d('0x3d')](db[_0xe06d('0x3e')][_0xe06d('0x3f')],function(_0x14bb1d){return{'name':_0x14bb1d[_0xe06d('0x40')],'type':_0x14bb1d[_0xe06d('0x41')]['key']};});_0x5ba4c7[_0xe06d('0x42')]=_[_0xe06d('0x3d')](_0x68f517,_0xe06d('0x3a'));_0x5ba4c7['query']=_[_0xe06d('0x43')](_0xcb9664['query']);_0x5ba4c7[_0xe06d('0x44')]=_['intersection'](_0x5ba4c7['model'],_0x5ba4c7['query']);_0x730743[_0xe06d('0x45')]=_[_0xe06d('0x46')](_0x5ba4c7[_0xe06d('0x42')],qs[_0xe06d('0x47')](_0xcb9664[_0xe06d('0x48')]['fields']));_0x730743['attributes']=_0x730743[_0xe06d('0x45')]['length']?_0x730743['attributes']:_0x5ba4c7['model'];if(!_0xcb9664[_0xe06d('0x48')]['hasOwnProperty'](_0xe06d('0x49'))){_0x730743[_0xe06d('0x33')]=qs['limit'](_0xcb9664[_0xe06d('0x48')][_0xe06d('0x33')]);_0x730743[_0xe06d('0x31')]=qs[_0xe06d('0x31')](_0xcb9664[_0xe06d('0x48')][_0xe06d('0x31')]);}_0x730743[_0xe06d('0x4a')]=qs[_0xe06d('0x4b')](_0xcb9664['query'][_0xe06d('0x4b')]);_0x730743[_0xe06d('0x4c')]=qs[_0xe06d('0x44')](_['pick'](_0xcb9664['query'],_0x5ba4c7['filters']),_0x68f517);if(_0xcb9664['query'][_0xe06d('0x4d')]){_0x730743['where']=_['merge'](_0x730743[_0xe06d('0x4c')],{'$or':_[_0xe06d('0x3d')](_0x68f517,function(_0x4e8108){if(_0x4e8108[_0xe06d('0x41')]!==_0xe06d('0x4e')){var _0x24ca20={};_0x24ca20[_0x4e8108[_0xe06d('0x3a')]]={'$like':'%'+_0xcb9664['query'][_0xe06d('0x4d')]+'%'};return _0x24ca20;}})});}_0x730743=_[_0xe06d('0x4f')]({},_0x730743,_0xcb9664[_0xe06d('0x50')]);var _0x4d0cac={'where':_0x730743[_0xe06d('0x4c')]};return db[_0xe06d('0x3e')][_0xe06d('0x51')](_0x4d0cac)[_0xe06d('0x22')](function(_0x539a54){_0x392da3[_0xe06d('0x51')]=_0x539a54;if(_0xcb9664['query'][_0xe06d('0x52')]){_0x730743['include']=[{'all':!![]}];}return db[_0xe06d('0x3e')][_0xe06d('0x53')](_0x730743);})[_0xe06d('0x22')](function(_0x3935f3){_0x392da3[_0xe06d('0x54')]=_0x3935f3;return _0x392da3;})[_0xe06d('0x22')](respondWithFilteredResult(_0x2b43e5,_0x730743))[_0xe06d('0x2c')](handleError(_0x2b43e5,null));};exports[_0xe06d('0x55')]=function(_0xa2e83b,_0x93b89c){var _0x51e11b={'raw':!![],'where':{'id':_0xa2e83b[_0xe06d('0x56')]['id']}},_0xaeb45={};_0xaeb45[_0xe06d('0x42')]=_[_0xe06d('0x43')](db[_0xe06d('0x3e')][_0xe06d('0x3f')]);_0xaeb45[_0xe06d('0x48')]=_['keys'](_0xa2e83b['query']);_0xaeb45[_0xe06d('0x44')]=_['intersection'](_0xaeb45[_0xe06d('0x42')],_0xaeb45[_0xe06d('0x48')]);_0x51e11b[_0xe06d('0x45')]=_[_0xe06d('0x46')](_0xaeb45['model'],qs[_0xe06d('0x47')](_0xa2e83b[_0xe06d('0x48')][_0xe06d('0x47')]));_0x51e11b[_0xe06d('0x45')]=_0x51e11b[_0xe06d('0x45')][_0xe06d('0x57')]?_0x51e11b[_0xe06d('0x45')]:_0xaeb45['model'];if(_0xa2e83b[_0xe06d('0x48')][_0xe06d('0x52')]){_0x51e11b[_0xe06d('0x58')]=[{'all':!![]}];}_0x51e11b=_[_0xe06d('0x4f')]({},_0x51e11b,_0xa2e83b[_0xe06d('0x50')]);return db[_0xe06d('0x3e')][_0xe06d('0x59')](_0x51e11b)[_0xe06d('0x22')](handleEntityNotFound(_0x93b89c,null))['then'](respondWithResult(_0x93b89c,null))[_0xe06d('0x2c')](handleError(_0x93b89c,null));};exports[_0xe06d('0x38')]=function(_0x4dd034,_0x4cdbfb){if(_0x4dd034['body']['id']){delete _0x4dd034[_0xe06d('0x5a')]['id'];}return db[_0xe06d('0x3e')][_0xe06d('0x59')]({'where':{'id':_0x4dd034['params']['id']}})[_0xe06d('0x22')](handleEntityNotFound(_0x4cdbfb,null))[_0xe06d('0x22')](saveUpdates(_0x4dd034[_0xe06d('0x5a')],null))[_0xe06d('0x22')](respondWithResult(_0x4cdbfb,null))[_0xe06d('0x2c')](handleError(_0x4cdbfb,null));};exports[_0xe06d('0x39')]=function(_0x50277e,_0xc26e88){return db[_0xe06d('0x3e')][_0xe06d('0x59')]({'where':{'id':_0x50277e['params']['id']}})[_0xe06d('0x22')](handleEntityNotFound(_0xc26e88,null))[_0xe06d('0x22')](removeEntity(_0xc26e88,null))['catch'](handleError(_0xc26e88,null));};exports[_0xe06d('0x5b')]=function(_0x4e4147,_0x29589a){return db[_0xe06d('0x3e')][_0xe06d('0x5b')]()[_0xe06d('0x22')](respondWithResult(_0x29589a,null))[_0xe06d('0x2c')](handleError(_0x29589a,null));};var interaction_log=require(_0xe06d('0x14'))(_0xe06d('0x5c'));exports[_0xe06d('0x5d')]=function(_0x414a35,_0xa417a8,_0x46a506){var _0x21246e={'agent':{},'channel':'fax'};if(_0x414a35[_0xe06d('0x5a')]['id']){delete _0x414a35[_0xe06d('0x5a')]['id'];}_0x414a35[_0xe06d('0x5a')][_0xe06d('0x5e')]=!![];_0x414a35[_0xe06d('0x5a')][_0xe06d('0x5f')]=moment()[_0xe06d('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x414a35[_0xe06d('0x5a')]['UserId']=_0x414a35['body'][_0xe06d('0x61')]||_0x414a35[_0xe06d('0x62')]['id'];_0x21246e['agent']['id']=_0x414a35[_0xe06d('0x5a')]['UserId'];return db[_0xe06d('0x3e')][_0xe06d('0x59')]({'where':{'id':_0x414a35[_0xe06d('0x56')]['id'],'UserId':null}})[_0xe06d('0x22')](handleEntityNotFound(_0xa417a8,null))['then'](saveUpdates(_0x414a35[_0xe06d('0x5a')],null))[_0xe06d('0x22')](function(_0x22d28b){if(_0x22d28b){_0x21246e[_0xe06d('0x2a')]=_0x22d28b[_0xe06d('0x63')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x22d28b[_0xe06d('0x64')]}});}return null;})[_0xe06d('0x22')](handleEntityNotFound(_0xa417a8,null))[_0xe06d('0x22')](function(_0x3836de){if(_0x3836de){return _0x3836de[_0xe06d('0x38')]({'UserId':_0x414a35[_0xe06d('0x5a')][_0xe06d('0x61')],'read1stAt':_[_0xe06d('0x65')](_0x3836de[_0xe06d('0x66')])?moment()[_0xe06d('0x60')](_0xe06d('0x67')):undefined});}return null;})['then'](function(_0x6e2345){if(_0x6e2345){_0x21246e[_0xe06d('0x68')]=_0x6e2345[_0xe06d('0x63')]({'plain':!![]});interaction_log[_0xe06d('0x23')](_0xe06d('0x69'),_0x414a35[_0xe06d('0x62')]['id'],_0x414a35['user'][_0xe06d('0x3a')],_0x414a35[_0xe06d('0x62')][_0xe06d('0x6a')],_0x21246e[_0xe06d('0x68')]['id'],_0x414a35[_0xe06d('0x5a')]?JSON['stringify'](_0x414a35[_0xe06d('0x5a')]):'null');return respondWithRpcPromise(_0xe06d('0x6b'),_0xe06d('0x6c'),_0x21246e);}return null;})[_0xe06d('0x22')](function(_0x273e84){var _0x96476a=_0xe06d('0x6d')+_0x273e84[_0xe06d('0x2a')][_0xe06d('0x6e')];return db[_0xe06d('0x6f')][_0xe06d('0x48')](_0x96476a,{'type':db[_0xe06d('0x70')]['QueryTypes'][_0xe06d('0x71')],'raw':!![]})[_0xe06d('0x22')](function(_0x5f3b85){return _0x5f3b85;});})[_0xe06d('0x22')](function(_0x5eb06e){if(_0x5eb06e){_0x21246e[_0xe06d('0x2a')]['contact']=_0x5eb06e[0x0];if(!_0x414a35['body'][_0xe06d('0x61')])return;return db['User'][_0xe06d('0x59')]({'where':{'id':_0x414a35[_0xe06d('0x5a')][_0xe06d('0x61')],'role':_0xe06d('0x72')},'attributes':['id',_0xe06d('0x3a'),_0xe06d('0x73'),_0xe06d('0x74'),_0xe06d('0x75')],'raw':!![]});}return null;})[_0xe06d('0x22')](function(_0x16cfa9){if(!_0x16cfa9)return null;_0x21246e['message'][_0xe06d('0x72')]=_0x16cfa9;return _0x21246e;})['then'](function(_0x4cb14b){if(_0x4cb14b){if(_0x414a35[_0xe06d('0x5a')][_0xe06d('0x76')]){_0x21246e[_0xe06d('0x2a')]['interface']=util['format'](_0xe06d('0x77'),_0x414a35['user'][_0xe06d('0x3a')]);_0x21246e['message'][_0xe06d('0x78')]=_0x21246e[_0xe06d('0x78')];_0x21246e['message'][_0xe06d('0x79')]=_0x21246e[_0xe06d('0x78')];_0x21246e[_0xe06d('0x2a')][_0xe06d('0x7a')]=_0xe06d('0x5d');return respondWithRpcPromise(_0xe06d('0x7b'),'EventManager',{'event':_0xe06d('0x7c'),'message':_0x21246e['message']},client9002)['then'](function(){return _0x21246e;});}return _0x21246e;}return null;})[_0xe06d('0x22')](respondWithResult(_0xa417a8,null))[_0xe06d('0x2c')](handleError(_0xa417a8,null));};var interaction_log=require(_0xe06d('0x14'))(_0xe06d('0x5c'));exports[_0xe06d('0x7d')]=function(_0x15ff90,_0xc324ba,_0x26e826){var _0x5c0305={'agent':{},'channel':_0xe06d('0x7e')};if(_0x15ff90['body']['id']){delete _0x15ff90['body']['id'];}_0x15ff90[_0xe06d('0x5a')][_0xe06d('0x61')]=_0x15ff90[_0xe06d('0x5a')][_0xe06d('0x61')]||_0x15ff90[_0xe06d('0x62')]['id'];_0x5c0305[_0xe06d('0x72')]['id']=_0x15ff90['body'][_0xe06d('0x61')];return db['FaxMessage']['find']({'where':{'id':_0x15ff90[_0xe06d('0x56')]['id'],'UserId':null}})[_0xe06d('0x22')](handleEntityNotFound(_0xc324ba,null))[_0xe06d('0x22')](function(_0x2c816a){if(_0x2c816a){_0x5c0305['message']=_0x2c816a['get']({'plain':!![]});return db[_0xe06d('0x7f')][_0xe06d('0x59')]({'where':{'id':_0x2c816a[_0xe06d('0x64')]}});}return null;})[_0xe06d('0x22')](handleEntityNotFound(_0xc324ba,null))[_0xe06d('0x22')](function(_0x162c36){if(_0x162c36){_0x5c0305[_0xe06d('0x68')]=_0x162c36[_0xe06d('0x63')]({'plain':!![]});interaction_log[_0xe06d('0x23')](_0xe06d('0x80'),_0x15ff90[_0xe06d('0x62')]['id'],_0x15ff90[_0xe06d('0x62')]['name'],_0x15ff90[_0xe06d('0x62')]['role'],_0x5c0305['interaction']['id'],_0x15ff90['body']?JSON[_0xe06d('0x28')](_0x15ff90[_0xe06d('0x5a')]):_0xe06d('0x81'));return respondWithRpcPromise(_0xe06d('0x82'),_0xe06d('0x83'),_0x5c0305);}return null;})['then'](function(_0x1c774d){var _0x5a9ef0=_0xe06d('0x6d')+_0x1c774d['message'][_0xe06d('0x6e')];return db[_0xe06d('0x6f')][_0xe06d('0x48')](_0x5a9ef0,{'type':db['Sequelize'][_0xe06d('0x84')]['SELECT'],'raw':!![]})[_0xe06d('0x22')](function(_0x1b5852){return _0x1b5852;});})[_0xe06d('0x22')](function(_0xe40aa9){if(_0xe40aa9){_0x5c0305['message'][_0xe06d('0x85')]=_0xe40aa9[0x0];if(!_0x15ff90[_0xe06d('0x5a')][_0xe06d('0x61')])return;return db['User'][_0xe06d('0x59')]({'where':{'id':_0x15ff90[_0xe06d('0x5a')][_0xe06d('0x61')],'role':'agent'},'attributes':['id','name',_0xe06d('0x73'),_0xe06d('0x74'),_0xe06d('0x75')],'raw':!![]});}return null;})[_0xe06d('0x22')](function(_0x354c3c){if(!_0x354c3c)return null;_0x5c0305[_0xe06d('0x2a')]['agent']=_0x354c3c;return _0x5c0305;})[_0xe06d('0x22')](function(_0x5d6c71){if(_0x5d6c71){_0x5d6c71[_0xe06d('0x2a')][_0xe06d('0x86')]=util[_0xe06d('0x60')](_0xe06d('0x77'),_0x15ff90[_0xe06d('0x62')][_0xe06d('0x3a')]);_0x5d6c71[_0xe06d('0x2a')][_0xe06d('0x78')]=_0x5c0305['channel'];_0x5d6c71[_0xe06d('0x2a')][_0xe06d('0x79')]=_0x5c0305[_0xe06d('0x78')];_0x5d6c71['message'][_0xe06d('0x7a')]=_0xe06d('0x7d');respondWithRpcPromise(_0xe06d('0x7b'),'EventManager',{'event':_0xe06d('0x87'),'message':_0x5d6c71['message']},client9002);return _0x5c0305;}return null;})[_0xe06d('0x22')](respondWithResult(_0xc324ba,null))[_0xe06d('0x2c')](handleError(_0xc324ba,null));};exports[_0xe06d('0x88')]=function(_0xb077fe,_0x3fa4dd){var _0x31cbfb;return db[_0xe06d('0x3e')][_0xe06d('0x88')](_0xb077fe['body'],{})[_0xe06d('0x22')](function(_0x71d7c8){_0x31cbfb=_0x71d7c8;return db[_0xe06d('0x89')][_0xe06d('0x8a')]({'where':{'id':_0x31cbfb[_0xe06d('0x6e')]}});})[_0xe06d('0x22')](function(_0x3aef69){if(_[_0xe06d('0x65')](_0x3aef69)){return;}else{_0x31cbfb[_0xe06d('0x7e')]=_0x3aef69[_0xe06d('0x7e')];return db[_0xe06d('0x8b')][_0xe06d('0x8a')]({'where':{'id':_0x31cbfb[_0xe06d('0x8c')]}});}})[_0xe06d('0x22')](function(_0x5d5928){return respondWithRpcPromise(_0xe06d('0x8d'),_0xe06d('0x8d'),{'FaxAccountId':_[_0xe06d('0x65')](_0xb077fe[_0xe06d('0x5a')])?undefined:_0xb077fe[_0xe06d('0x5a')][_0xe06d('0x8e')],'path':_[_0xe06d('0x65')](_0x5d5928)?undefined:util[_0xe06d('0x60')](_0xe06d('0x8f'),_0x5d5928[_0xe06d('0x90')]),'fax':_[_0xe06d('0x65')](_0x31cbfb[_0xe06d('0x7e')])?undefined:_0x31cbfb[_0xe06d('0x7e')],'AttachmentId':_0x31cbfb['AttachmentId']},client9002);})[_0xe06d('0x22')](respondWithResult(_0x3fa4dd,0xc9))[_0xe06d('0x2c')](handleError(_0x3fa4dd,null));};exports[_0xe06d('0x91')]=function(_0x3dcab9,_0x3a9c50){var _0x28c1d1=path[_0xe06d('0x92')](config['root'],_0xe06d('0x93'),_0xe06d('0x94'),'attachments');return db[_0xe06d('0x3e')]['find']({'where':{'id':_0x3dcab9[_0xe06d('0x56')]['id']},'include':[{'model':db[_0xe06d('0x8b')],'as':_0xe06d('0x8b')}]})[_0xe06d('0x22')](handleEntityNotFound(_0x3a9c50,null))[_0xe06d('0x22')](function(_0x3979c4){if(_0x3979c4){return _0x3a9c50[_0xe06d('0x91')](path[_0xe06d('0x92')](_0x28c1d1,_0x3979c4[_0xe06d('0x8b')][_0xe06d('0x90')]));}})[_0xe06d('0x2c')](handleError(_0x3a9c50,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index bdf1ac7..68afdb7 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 _0x1a0b=['FaxMessage','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1a0b,0x18f));var _0xb1a0=function(_0xf5add7,_0x54ce93){_0xf5add7=_0xf5add7-0x0;var _0x29dba9=_0x1a0b[_0xf5add7];return _0x29dba9;};'use strict';var EventEmitter=require(_0xb1a0('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xb1a0('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xb1a0('0x2')](0x0);var events={'afterCreate':_0xb1a0('0x3'),'afterUpdate':_0xb1a0('0x4'),'afterDestroy':_0xb1a0('0x5')};function emitEvent(_0x4522c2){return function(_0x46f819,_0x34c5fb,_0x1126a3){FaxMessageEvents[_0xb1a0('0x6')](_0x4522c2+':'+_0x46f819['id'],_0x46f819);FaxMessageEvents[_0xb1a0('0x6')](_0x4522c2,_0x46f819);_0x1126a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xb1a0('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0xdd68=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','FaxMessage'];(function(_0x143c84,_0x5924f8){var _0x4a9b6a=function(_0x5d11a6){while(--_0x5d11a6){_0x143c84['push'](_0x143c84['shift']());}};_0x4a9b6a(++_0x5924f8);}(_0xdd68,0x196));var _0x8dd6=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xdd68[_0x75f869];return _0x10af8b;};'use strict';var EventEmitter=require(_0x8dd6('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x8dd6('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':_0x8dd6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b71c){return function(_0x469e0c,_0x5c7c72,_0x310895){FaxMessageEvents[_0x8dd6('0x5')](_0x37b71c+':'+_0x469e0c['id'],_0x469e0c);FaxMessageEvents['emit'](_0x37b71c,_0x469e0c);_0x310895(null);};}for(var e in events){if(events[_0x8dd6('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x8dd6('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3f9f5f4..01680ee 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 _0x2de4=['exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c9fc2,_0x5d0a8a){var _0x43ab57=function(_0x2b99a2){while(--_0x2b99a2){_0x3c9fc2['push'](_0x3c9fc2['shift']());}};_0x43ab57(++_0x5d0a8a);}(_0x2de4,0x189));var _0x42de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2de4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x42de('0x0'));var util=require(_0x42de('0x1'));var logger=require(_0x42de('0x2'))(_0x42de('0x3'));var moment=require(_0x42de('0x4'));var BPromise=require(_0x42de('0x5'));var rp=require(_0x42de('0x6'));var fs=require('fs');var path=require(_0x42de('0x7'));var rimraf=require(_0x42de('0x8'));var config=require(_0x42de('0x9'));var attributes=require('./faxMessage.attributes');module[_0x42de('0xa')]=function(_0x3807bf,_0x4e3a0b){return _0x3807bf[_0x42de('0xb')](_0x42de('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x42de('0xd'),'fields':[_0x42de('0xe')],'type':_0x42de('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28b461,_0x49207b,_0x2d525a){var _0x4cbe3b=_0x3807bf[_0x42de('0x10')];var _0x369470=_0x28b461[_0x42de('0x11')]({'plain':!![]});if(_0x369470[_0x42de('0x12')][_0x42de('0x13')]()==='in'||_0x369470['direction'][_0x42de('0x13')]()===_0x42de('0x14')&&!_0x369470[_0x42de('0x15')]&&!_[_0x42de('0x16')](_0x369470[_0x42de('0x17')])){_0x4cbe3b[_0x42de('0x18')][_0x42de('0x19')]({'where':{'id':_0x369470['FaxInteractionId']}})[_0x42de('0x1a')](function(_0x453c76){if(_0x453c76){_0x453c76['update']({'lastMsgAt':_0x369470[_0x42de('0x1b')],'lastMsgDirection':_0x369470[_0x42de('0x12')]['toLowerCase']()});}})['catch'](function(_0x145222){console[_0x42de('0x1c')](_0x145222);});}_0x2d525a();}},'charset':_0x42de('0x1d'),'collate':_0x42de('0x1e')});}; \ No newline at end of file +var _0xfaf5=['toLowerCase','direction','out','secret','findOne','FaxInteractionId','createdAt','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','models','get'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xfaf5,0x11c));var _0x5faf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaf5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5faf('0x0'));var util=require(_0x5faf('0x1'));var logger=require(_0x5faf('0x2'))('api');var moment=require(_0x5faf('0x3'));var BPromise=require('bluebird');var rp=require(_0x5faf('0x4'));var fs=require('fs');var path=require(_0x5faf('0x5'));var rimraf=require(_0x5faf('0x6'));var config=require(_0x5faf('0x7'));var attributes=require(_0x5faf('0x8'));module['exports']=function(_0x4f4fee,_0x197fc7){return _0x4f4fee[_0x5faf('0x9')](_0x5faf('0xa'),attributes,{'tableName':_0x5faf('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x5faf('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x90f281,_0x2df351,_0x2f6ca2){var _0x5d7161=_0x4f4fee[_0x5faf('0xd')];var _0x5e6b09=_0x90f281[_0x5faf('0xe')]({'plain':!![]});if(_0x5e6b09['direction'][_0x5faf('0xf')]()==='in'||_0x5e6b09[_0x5faf('0x10')][_0x5faf('0xf')]()===_0x5faf('0x11')&&!_0x5e6b09[_0x5faf('0x12')]&&!_['isNil'](_0x5e6b09['UserId'])){_0x5d7161['FaxInteraction'][_0x5faf('0x13')]({'where':{'id':_0x5e6b09[_0x5faf('0x14')]}})['then'](function(_0x51b84b){if(_0x51b84b){_0x51b84b['update']({'lastMsgAt':_0x5e6b09[_0x5faf('0x15')],'lastMsgDirection':_0x5e6b09[_0x5faf('0x10')][_0x5faf('0xf')]()});}})['catch'](function(_0xf37b77){console['error'](_0xf37b77);});}_0x2f6ca2();}},'charset':'utf8mb4','collate':_0x5faf('0x16')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 8e5e894..8c95bd7 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 _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fd1,0x155));var _0x15fd=function(_0x235711,_0x3a17b0){_0x235711=_0x235711-0x0;var _0x10a252=_0x5fd1[_0x235711];return _0x10a252;};'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});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file +var _0x81bd=['debug','request\x20sent','stringify','error','message','result','catch','CreateFaxMessage','create','body','options','raw','FaxMessage','update','limit','UpdateFaxMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s'];(function(_0x5399ef,_0x2d0974){var _0x15c3b5=function(_0x1b7208){while(--_0x1b7208){_0x5399ef['push'](_0x5399ef['shift']());}};_0x15c3b5(++_0x2d0974);}(_0x81bd,0x7c));var _0xd81b=function(_0x5cdf85,_0x4f5610){_0x5cdf85=_0x5cdf85-0x0;var _0x109a19=_0x81bd[_0x5cdf85];return _0x109a19;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});config[_0xd81b('0xc')]=_['defaults'](config['redis'],{'host':_0xd81b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd81b('0xc')]));require(_0xd81b('0xe'))[_0xd81b('0xf')](socket);function respondWithRpcPromise(_0x86dab6,_0x17fba4,_0x1ff60f){return new BPromise(function(_0x4391be,_0x17e09f){return client[_0xd81b('0x10')](_0x86dab6,_0x1ff60f)[_0xd81b('0x11')](function(_0x215b92){logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,'request\x20sent');logger[_0xd81b('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x17fba4,_0xd81b('0x15'),JSON[_0xd81b('0x16')](_0x215b92));if(_0x215b92['error']){if(_0x215b92[_0xd81b('0x17')]['code']===0x1f4){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);return _0x17e09f(_0x215b92[_0xd81b('0x17')]['message']);}logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x215b92['error'][_0xd81b('0x18')]);return _0x4391be(_0x215b92[_0xd81b('0x17')][_0xd81b('0x18')]);}else{logger[_0xd81b('0x12')](_0xd81b('0x13'),_0x17fba4,_0xd81b('0x15'));_0x4391be(_0x215b92[_0xd81b('0x19')][_0xd81b('0x18')]);}})[_0xd81b('0x1a')](function(_0x285164){logger[_0xd81b('0x17')](_0xd81b('0x13'),_0x17fba4,_0x285164);_0x17e09f(_0x285164);});});}exports[_0xd81b('0x1b')]=function(_0x3518f0){var _0x156894=this;return new Promise(function(_0x4f8c0b,_0x5f101a){return db['FaxMessage'][_0xd81b('0x1c')](_0x3518f0[_0xd81b('0x1d')],{'raw':_0x3518f0[_0xd81b('0x1e')]?_0x3518f0['options'][_0xd81b('0x1f')]===undefined?!![]:![]:!![]})[_0xd81b('0x11')](function(_0x542ee2){logger[_0xd81b('0x12')](_0xd81b('0x1b'),_0x3518f0);logger[_0xd81b('0x14')](_0xd81b('0x1b'),_0x3518f0,JSON[_0xd81b('0x16')](_0x542ee2));_0x4f8c0b(_0x542ee2);})[_0xd81b('0x1a')](function(_0x255011){logger[_0xd81b('0x17')](_0xd81b('0x1b'),_0x255011[_0xd81b('0x18')],_0x3518f0);_0x5f101a(_0x156894[_0xd81b('0x17')](0x1f4,_0x255011[_0xd81b('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x28768f){var _0x99dbc9=this;return new Promise(function(_0xe3637a,_0x31b9fd){return db[_0xd81b('0x20')][_0xd81b('0x21')](_0x28768f[_0xd81b('0x1d')],{'raw':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28768f[_0xd81b('0x1e')]?_0x28768f['options']['where']||null:null,'attributes':_0x28768f[_0xd81b('0x1e')]?_0x28768f[_0xd81b('0x1e')]['attributes']||null:null,'limit':_0x28768f['options']?_0x28768f[_0xd81b('0x1e')][_0xd81b('0x22')]||null:null})[_0xd81b('0x11')](function(_0x289f54){logger[_0xd81b('0x12')](_0xd81b('0x23'),_0x28768f);logger['debug'](_0xd81b('0x23'),_0x28768f,JSON[_0xd81b('0x16')](_0x289f54));_0xe3637a(_0x289f54);})['catch'](function(_0x56d80b){logger[_0xd81b('0x17')](_0xd81b('0x23'),_0x56d80b['message'],_0x28768f);_0x31b9fd(_0x99dbc9['error'](0x1f4,_0x56d80b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 1445801..95a7cc1 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 _0x8363=['faxMessage:','./faxMessage.events','save','emit','removeListener','register','length'];(function(_0x2e2720,_0x1ae995){var _0x3f9d2d=function(_0x5067a2){while(--_0x5067a2){_0x2e2720['push'](_0x2e2720['shift']());}};_0x3f9d2d(++_0x1ae995);}(_0x8363,0x86));var _0x3836=function(_0x538f42,_0x52088a){_0x538f42=_0x538f42-0x0;var _0x1dd4a3=_0x8363[_0x538f42];return _0x1dd4a3;};'use strict';var FaxMessageEvents=require(_0x3836('0x0'));var events=[_0x3836('0x1'),'remove','update'];function createListener(_0x55ae1b,_0x43177e){return function(_0x2f95e6){_0x43177e[_0x3836('0x2')](_0x55ae1b,_0x2f95e6);};}function removeListener(_0x14f693,_0x3bea68){return function(){FaxMessageEvents[_0x3836('0x3')](_0x14f693,_0x3bea68);};}exports[_0x3836('0x4')]=function(_0x3b3613){for(var _0x37cef5=0x0,_0x5ba5f9=events[_0x3836('0x5')];_0x37cef5<_0x5ba5f9;_0x37cef5++){var _0x3221e8=events[_0x37cef5];var _0x5e0614=createListener(_0x3836('0x6')+_0x3221e8,_0x3b3613);FaxMessageEvents['on'](_0x3221e8,_0x5e0614);}}; \ No newline at end of file +var _0x1212=['update','emit','removeListener','faxMessage:','./faxMessage.events'];(function(_0x5be8cc,_0x4a6037){var _0x5f1b7e=function(_0xebd8db){while(--_0xebd8db){_0x5be8cc['push'](_0x5be8cc['shift']());}};_0x5f1b7e(++_0x4a6037);}(_0x1212,0x1f3));var _0x2121=function(_0x5f2503,_0x4a3261){_0x5f2503=_0x5f2503-0x0;var _0x1def2d=_0x1212[_0x5f2503];return _0x1def2d;};'use strict';var FaxMessageEvents=require(_0x2121('0x0'));var events=['save','remove',_0x2121('0x1')];function createListener(_0x34e6ea,_0x3cad26){return function(_0x5d254b){_0x3cad26[_0x2121('0x2')](_0x34e6ea,_0x5d254b);};}function removeListener(_0x321a42,_0x1f217c){return function(){FaxMessageEvents[_0x2121('0x3')](_0x321a42,_0x1f217c);};}exports['register']=function(_0x35aeaa){for(var _0x16c3a8=0x0,_0x518564=events['length'];_0x16c3a8<_0x518564;_0x16c3a8++){var _0x223dad=events[_0x16c3a8];var _0x491d55=createListener(_0x2121('0x4')+_0x223dad,_0x35aeaa);FaxMessageEvents['on'](_0x223dad,_0x491d55);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4f2cf5a..bf3eff5 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 _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(_0x61dc33,_0x3b336c){var _0x56fd05=function(_0x5d39ee){while(--_0x5d39ee){_0x61dc33['push'](_0x61dc33['shift']());}};_0x56fd05(++_0x3b336c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x239f5f,_0xb07544){_0x239f5f=_0x239f5f-0x0;var _0x47bef0=_0xf4eb[_0x239f5f];return _0x47bef0;};'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 +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','faxmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe706,0xa3));var _0x6e70=function(_0x4066c2,_0xad48e8){_0x4066c2=_0x4066c2-0x0;var _0x3870a0=_0xe706[_0x4066c2];return _0x3870a0;};'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('0x13')]('/',auth[_0x6e70('0xb')](),interaction['tracked']('fax',_0x6e70('0x14')),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')](_0x6e70('0x18'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x6e70('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x6e70('0x1a')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index fb16066..2cd0794 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 _0x16a8=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x16a8,0x1db));var _0x816a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x16a8[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x816a('0x0'));module[_0x816a('0x1')]={'name':{'type':Sequelize[_0x816a('0x2')],'unique':_0x816a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x816a('0x2')]},'timeout':{'type':Sequelize[_0x816a('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x816a('0x5')]('rrmemory',_0x816a('0x6'),_0x816a('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x816a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x594e=['roundrobin','STRING','ENUM','rrmemory','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x594e,0x11e));var _0xe594=function(_0x2b09b7,_0x426a19){_0x2b09b7=_0x2b09b7-0x0;var _0x4ad184=_0x594e[_0x2b09b7];return _0x4ad184;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe594('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe594('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe594('0x1')](_0xe594('0x2'),_0xe594('0x3'),_0xe594('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 5441773..aee325a 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 _0xe4c9=['UserFaxQueue','FaxQueueId','UserId','agent','faxPause','updatedAt','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','FaxQueue','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','autoAssociation','params','describe','getMembers'];(function(_0x589eb4,_0xaa2019){var _0xf50816=function(_0x572fc5){while(--_0x572fc5){_0x589eb4['push'](_0x589eb4['shift']());}};_0xf50816(++_0xaa2019);}(_0xe4c9,0xc1));var _0x9e4c=function(_0x552cf8,_0x493a58){_0x552cf8=_0x552cf8-0x0;var _0x5b0eca=_0xe4c9[_0x552cf8];return _0x5b0eca;};'use strict';var emlformat=require(_0x9e4c('0x0'));var rimraf=require(_0x9e4c('0x1'));var zipdir=require(_0x9e4c('0x2'));var jsonpatch=require(_0x9e4c('0x3'));var rp=require(_0x9e4c('0x4'));var moment=require(_0x9e4c('0x5'));var BPromise=require(_0x9e4c('0x6'));var Mustache=require(_0x9e4c('0x7'));var util=require(_0x9e4c('0x8'));var path=require(_0x9e4c('0x9'));var sox=require(_0x9e4c('0xa'));var csv=require(_0x9e4c('0xb'));var ejs=require(_0x9e4c('0xc'));var fs=require('fs');var fs_extra=require(_0x9e4c('0xd'));var _=require(_0x9e4c('0xe'));var squel=require('squel');var crypto=require(_0x9e4c('0xf'));var jsforce=require(_0x9e4c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9e4c('0xb'));var querystring=require(_0x9e4c('0x11'));var Papa=require(_0x9e4c('0x12'));var Redis=require(_0x9e4c('0x13'));var authService=require(_0x9e4c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9e4c('0x15'));var hardwareService=require(_0x9e4c('0x16'));var logger=require('../../config/logger')(_0x9e4c('0x17'));var utils=require('../../config/utils');var config=require(_0x9e4c('0x18'));var licenseUtil=require(_0x9e4c('0x19'));var db=require('../../mysqldb')['db'];config[_0x9e4c('0x1a')]=_[_0x9e4c('0x1b')](config[_0x9e4c('0x1a')],{'host':_0x9e4c('0x1c'),'port':0x18eb});var socket=require(_0x9e4c('0x1d'))(new Redis(config['redis']));require(_0x9e4c('0x1e'))[_0x9e4c('0x1f')](socket);function respondWithStatusCode(_0x5eee47,_0x4c827d){_0x4c827d=_0x4c827d||0xcc;return function(_0x20192a){if(_0x20192a){return _0x5eee47[_0x9e4c('0x20')](_0x4c827d);}return _0x5eee47[_0x9e4c('0x21')](_0x4c827d)[_0x9e4c('0x22')]();};}function respondWithResult(_0x4afa98,_0x367720){_0x367720=_0x367720||0xc8;return function(_0x4ba75e){if(_0x4ba75e){return _0x4afa98['status'](_0x367720)[_0x9e4c('0x23')](_0x4ba75e);}};}function respondWithFilteredResult(_0x109488,_0x1e5ba7){return function(_0x5f2440){if(_0x5f2440){var _0x4a63e1=typeof _0x1e5ba7[_0x9e4c('0x24')]===_0x9e4c('0x25')&&typeof _0x1e5ba7['limit']===_0x9e4c('0x25');var _0x5984c7=_0x5f2440[_0x9e4c('0x26')];var _0x20aacc=_0x4a63e1?0x0:_0x1e5ba7[_0x9e4c('0x24')];var _0x515009=_0x4a63e1?_0x5f2440[_0x9e4c('0x26')]:_0x1e5ba7['offset']+_0x1e5ba7[_0x9e4c('0x27')];var _0xcde3fe;if(_0x515009>=_0x5984c7){_0x515009=_0x5984c7;_0xcde3fe=0xc8;}else{_0xcde3fe=0xce;}_0x109488['status'](_0xcde3fe);return _0x109488['set'](_0x9e4c('0x28'),_0x20aacc+'-'+_0x515009+'/'+_0x5984c7)[_0x9e4c('0x23')](_0x5f2440);}return null;};}function patchUpdates(_0x2cbb88){return function(_0x257d68){try{jsonpatch[_0x9e4c('0x29')](_0x257d68,_0x2cbb88,!![]);}catch(_0x2099df){return BPromise[_0x9e4c('0x2a')](_0x2099df);}return _0x257d68['save']();};}function saveUpdates(_0x19a289,_0x367eea){return function(_0x671fd7){if(_0x671fd7){return _0x671fd7[_0x9e4c('0x2b')](_0x19a289)[_0x9e4c('0x2c')](function(_0x1679f9){return _0x1679f9;});}return null;};}function removeEntity(_0x487742,_0xf73c71){return function(_0x515385){if(_0x515385){return _0x515385[_0x9e4c('0x2d')]()[_0x9e4c('0x2c')](function(){var _0x3925ec=_0x515385[_0x9e4c('0x2e')]({'plain':!![]});var _0x26d792='FaxQueues';return db[_0x9e4c('0x2f')]['destroy']({'where':{'type':_0x26d792,'resourceId':_0x3925ec['id']}})[_0x9e4c('0x2c')](function(){return _0x515385;});})['then'](function(){_0x487742[_0x9e4c('0x21')](0xcc)[_0x9e4c('0x22')]();});}};}function handleEntityNotFound(_0x190b43,_0x155178){return function(_0xa3fee2){if(!_0xa3fee2){_0x190b43['sendStatus'](0x194);}return _0xa3fee2;};}function handleError(_0x51dbaf,_0x391e76){_0x391e76=_0x391e76||0x1f4;return function(_0xaed988){logger[_0x9e4c('0x30')](_0xaed988[_0x9e4c('0x31')]);if(_0xaed988[_0x9e4c('0x32')]){delete _0xaed988[_0x9e4c('0x32')];}_0x51dbaf['status'](_0x391e76)['send'](_0xaed988);};}exports[_0x9e4c('0x33')]=function(_0x5902fa,_0x55a7c5){var _0x4eb03f={},_0x142c66={},_0x335a2e={'count':0x0,'rows':[]};var _0xfadef9=_[_0x9e4c('0x34')](db['FaxQueue']['rawAttributes'],function(_0x174767){return{'name':_0x174767[_0x9e4c('0x35')],'type':_0x174767[_0x9e4c('0x36')][_0x9e4c('0x37')]};});_0x142c66['model']=_['map'](_0xfadef9,_0x9e4c('0x32'));_0x142c66[_0x9e4c('0x38')]=_[_0x9e4c('0x39')](_0x5902fa[_0x9e4c('0x38')]);_0x142c66[_0x9e4c('0x3a')]=_[_0x9e4c('0x3b')](_0x142c66[_0x9e4c('0x3c')],_0x142c66['query']);_0x4eb03f[_0x9e4c('0x3d')]=_[_0x9e4c('0x3b')](_0x142c66[_0x9e4c('0x3c')],qs['fields'](_0x5902fa['query'][_0x9e4c('0x3e')]));_0x4eb03f[_0x9e4c('0x3d')]=_0x4eb03f[_0x9e4c('0x3d')][_0x9e4c('0x3f')]?_0x4eb03f[_0x9e4c('0x3d')]:_0x142c66[_0x9e4c('0x3c')];if(!_0x5902fa[_0x9e4c('0x38')][_0x9e4c('0x40')](_0x9e4c('0x41'))){_0x4eb03f[_0x9e4c('0x27')]=qs['limit'](_0x5902fa['query']['limit']);_0x4eb03f['offset']=qs['offset'](_0x5902fa['query'][_0x9e4c('0x24')]);}_0x4eb03f[_0x9e4c('0x42')]=qs[_0x9e4c('0x43')](_0x5902fa[_0x9e4c('0x38')][_0x9e4c('0x43')]);_0x4eb03f[_0x9e4c('0x44')]=qs[_0x9e4c('0x3a')](_[_0x9e4c('0x45')](_0x5902fa[_0x9e4c('0x38')],_0x142c66[_0x9e4c('0x3a')]),_0xfadef9);if(_0x5902fa['query']['filter']){_0x4eb03f[_0x9e4c('0x44')]=_[_0x9e4c('0x46')](_0x4eb03f[_0x9e4c('0x44')],{'$or':_[_0x9e4c('0x34')](_0xfadef9,function(_0x22dcd6){if(_0x22dcd6['type']!=='VIRTUAL'){var _0x204e9f={};_0x204e9f[_0x22dcd6['name']]={'$like':'%'+_0x5902fa[_0x9e4c('0x38')][_0x9e4c('0x47')]+'%'};return _0x204e9f;}})});}_0x4eb03f=_[_0x9e4c('0x46')]({},_0x4eb03f,_0x5902fa[_0x9e4c('0x48')]);var _0x4a1c1d={'where':_0x4eb03f[_0x9e4c('0x44')]};return db[_0x9e4c('0x49')]['count'](_0x4a1c1d)[_0x9e4c('0x2c')](function(_0x3bcbf0){_0x335a2e[_0x9e4c('0x26')]=_0x3bcbf0;if(_0x5902fa['query'][_0x9e4c('0x4a')]){_0x4eb03f['include']=[{'all':!![]}];}return db[_0x9e4c('0x49')][_0x9e4c('0x4b')](_0x4eb03f);})[_0x9e4c('0x2c')](function(_0x5097b1){_0x335a2e[_0x9e4c('0x4c')]=_0x5097b1;return _0x335a2e;})[_0x9e4c('0x2c')](respondWithFilteredResult(_0x55a7c5,_0x4eb03f))['catch'](handleError(_0x55a7c5,null));};exports[_0x9e4c('0x4d')]=function(_0x3914fd,_0x451078){var _0x3f4e84={'raw':!![],'where':{'id':_0x3914fd['params']['id']}},_0x5a1417={};_0x5a1417[_0x9e4c('0x3c')]=_['keys'](db[_0x9e4c('0x49')][_0x9e4c('0x4e')]);_0x5a1417[_0x9e4c('0x38')]=_[_0x9e4c('0x39')](_0x3914fd[_0x9e4c('0x38')]);_0x5a1417['filters']=_[_0x9e4c('0x3b')](_0x5a1417[_0x9e4c('0x3c')],_0x5a1417[_0x9e4c('0x38')]);_0x3f4e84[_0x9e4c('0x3d')]=_['intersection'](_0x5a1417[_0x9e4c('0x3c')],qs[_0x9e4c('0x3e')](_0x3914fd[_0x9e4c('0x38')]['fields']));_0x3f4e84[_0x9e4c('0x3d')]=_0x3f4e84[_0x9e4c('0x3d')][_0x9e4c('0x3f')]?_0x3f4e84[_0x9e4c('0x3d')]:_0x5a1417[_0x9e4c('0x3c')];if(_0x3914fd[_0x9e4c('0x38')][_0x9e4c('0x4a')]){_0x3f4e84[_0x9e4c('0x4f')]=[{'all':!![]}];}_0x3f4e84=_[_0x9e4c('0x46')]({},_0x3f4e84,_0x3914fd[_0x9e4c('0x48')]);return db[_0x9e4c('0x49')][_0x9e4c('0x50')](_0x3f4e84)[_0x9e4c('0x2c')](handleEntityNotFound(_0x451078,null))[_0x9e4c('0x2c')](respondWithResult(_0x451078,null))[_0x9e4c('0x51')](handleError(_0x451078,null));};exports[_0x9e4c('0x52')]=function(_0x27e8cf,_0x19d9a8){return db[_0x9e4c('0x49')][_0x9e4c('0x52')](_0x27e8cf[_0x9e4c('0x53')],{})[_0x9e4c('0x2c')](function(_0x46bb45){var _0x1447f2=_0x27e8cf[_0x9e4c('0x54')]['get']({'plain':!![]});if(!_0x1447f2)throw new Error(_0x9e4c('0x55'));if(_0x1447f2[_0x9e4c('0x56')]===_0x9e4c('0x54')){var _0x408df4=_0x46bb45[_0x9e4c('0x2e')]({'plain':!![]});var _0xbb40bf=_0x9e4c('0x57');return db[_0x9e4c('0x58')][_0x9e4c('0x50')]({'where':{'name':_0xbb40bf,'userProfileId':_0x1447f2['userProfileId']},'raw':!![]})['then'](function(_0x497c74){if(_0x497c74&&_0x497c74[_0x9e4c('0x59')]===0x0){return db[_0x9e4c('0x2f')]['create']({'name':_0x408df4[_0x9e4c('0x32')],'resourceId':_0x408df4['id'],'type':_0x497c74[_0x9e4c('0x32')],'sectionId':_0x497c74['id']},{})[_0x9e4c('0x2c')](function(){return _0x46bb45;});}else{return _0x46bb45;}})[_0x9e4c('0x51')](function(_0x7c5589){logger[_0x9e4c('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7c5589);throw _0x7c5589;});}return _0x46bb45;})[_0x9e4c('0x2c')](respondWithResult(_0x19d9a8,0xc9))[_0x9e4c('0x51')](handleError(_0x19d9a8,null));};exports[_0x9e4c('0x2b')]=function(_0x23aeec,_0x36f425){if(_0x23aeec[_0x9e4c('0x53')]['id']){delete _0x23aeec[_0x9e4c('0x53')]['id'];}return db[_0x9e4c('0x49')][_0x9e4c('0x50')]({'where':{'id':_0x23aeec['params']['id']}})[_0x9e4c('0x2c')](handleEntityNotFound(_0x36f425,null))[_0x9e4c('0x2c')](saveUpdates(_0x23aeec[_0x9e4c('0x53')],null))['then'](respondWithResult(_0x36f425,null))['catch'](handleError(_0x36f425,null));};exports[_0x9e4c('0x2d')]=function(_0x50761f,_0x49617f){return db[_0x9e4c('0x49')][_0x9e4c('0x50')]({'where':{'id':_0x50761f[_0x9e4c('0x5a')]['id']}})[_0x9e4c('0x2c')](handleEntityNotFound(_0x49617f,null))[_0x9e4c('0x2c')](removeEntity(_0x49617f,null))[_0x9e4c('0x51')](handleError(_0x49617f,null));};exports[_0x9e4c('0x5b')]=function(_0x4521c8,_0x23297b){return db[_0x9e4c('0x49')][_0x9e4c('0x5b')]()[_0x9e4c('0x2c')](respondWithResult(_0x23297b,null))['catch'](handleError(_0x23297b,null));};exports[_0x9e4c('0x5c')]=function(_0x46d380,_0x535c6e,_0x1750b4){var _0x2db99c={'raw':!![],'where':{}},_0x5d4665={},_0x58676f;return db[_0x9e4c('0x49')]['findOne']({'where':{'id':_0x46d380[_0x9e4c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x535c6e,null))[_0x9e4c('0x2c')](function(_0x1bb51a){if(_0x1bb51a){_0x58676f=_0x1bb51a[_0x9e4c('0x2e')]({'plain':!![]});_0x5d4665[_0x9e4c('0x3c')]=_[_0x9e4c('0x39')](db[_0x9e4c('0x5d')][_0x9e4c('0x4e')]);_0x5d4665['query']=_[_0x9e4c('0x39')](_0x46d380['query']);_0x5d4665[_0x9e4c('0x3a')]=_[_0x9e4c('0x3b')](_0x5d4665['model'],_0x5d4665['query']);_0x2db99c[_0x9e4c('0x3d')]=_['intersection'](_0x5d4665[_0x9e4c('0x3c')],qs[_0x9e4c('0x3e')](_0x46d380['query'][_0x9e4c('0x3e')]));_0x2db99c[_0x9e4c('0x3d')]=_0x2db99c[_0x9e4c('0x3d')][_0x9e4c('0x3f')]?_0x2db99c[_0x9e4c('0x3d')]:_0x5d4665[_0x9e4c('0x3c')];if(!_0x46d380[_0x9e4c('0x38')][_0x9e4c('0x40')](_0x9e4c('0x41'))){_0x2db99c['limit']=qs['limit'](_0x46d380['query'][_0x9e4c('0x27')]);_0x2db99c[_0x9e4c('0x24')]=qs[_0x9e4c('0x24')](_0x46d380[_0x9e4c('0x38')][_0x9e4c('0x24')]);}_0x2db99c[_0x9e4c('0x42')]=qs[_0x9e4c('0x43')](_0x46d380['query'][_0x9e4c('0x43')]);_0x2db99c[_0x9e4c('0x44')]=qs[_0x9e4c('0x3a')](_['pick'](_0x46d380[_0x9e4c('0x38')],_0x5d4665[_0x9e4c('0x3a')]));_0x2db99c[_0x9e4c('0x44')][_0x9e4c('0x5e')]=_0x1bb51a['id'];if(_0x46d380[_0x9e4c('0x38')][_0x9e4c('0x47')]){_0x2db99c['where']=_[_0x9e4c('0x46')](_0x2db99c[_0x9e4c('0x44')],{'$or':_[_0x9e4c('0x34')](_0x2db99c['attributes'],function(_0x25fc2c){var _0x213b12={};_0x213b12[_0x25fc2c]={'$like':'%'+_0x46d380['query'][_0x9e4c('0x47')]+'%'};return _0x213b12;})});}_0x2db99c=_[_0x9e4c('0x46')]({},_0x2db99c,_0x46d380[_0x9e4c('0x48')]);return db['UserFaxQueue'][_0x9e4c('0x4b')](_0x2db99c);}})[_0x9e4c('0x2c')](function(_0x177bcd){if(_0x177bcd){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x177bcd,_0x9e4c('0x5f')),'role':_0x9e4c('0x60')},'attributes':['id','name',_0x9e4c('0x61'),_0x9e4c('0x62'),'createdAt']});}})[_0x9e4c('0x2c')](function(_0x3031e0){if(_0x3031e0){return{'count':_0x3031e0['count'],'rows':_['map'](_0x3031e0[_0x9e4c('0x4c')],function(_0x3ab328){return{'membername':_0x3ab328[_0x9e4c('0x32')],'UserId':_0x3ab328['id'],'queue_name':_0x58676f['name'],'FaxQueueId':_0x58676f['id'],'interface':util['format']('%s/%s',_0x9e4c('0x63'),_0x3ab328['name']),'penalty':0x0,'paused':_0x3ab328['faxPause'],'createdAt':_0x3ab328[_0x9e4c('0x64')],'updatedAt':_0x3ab328[_0x9e4c('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9e4c('0x2c')](respondWithFilteredResult(_0x535c6e,_0x2db99c))[_0x9e4c('0x51')](handleError(_0x535c6e,null));};exports[_0x9e4c('0x65')]=function(_0x21bf98,_0x4dca0a,_0x4b1aa8){var _0x2f90af={};var _0x4008fb={};var _0x52bbc0;var _0x143e2a;return db[_0x9e4c('0x49')][_0x9e4c('0x66')]({'where':{'id':_0x21bf98['params']['id']}})[_0x9e4c('0x2c')](handleEntityNotFound(_0x4dca0a,null))[_0x9e4c('0x2c')](function(_0x277362){if(_0x277362){_0x52bbc0=_0x277362;_0x4008fb[_0x9e4c('0x3c')]=_[_0x9e4c('0x39')](db[_0x9e4c('0x67')][_0x9e4c('0x4e')]);_0x4008fb[_0x9e4c('0x38')]=_[_0x9e4c('0x39')](_0x21bf98[_0x9e4c('0x38')]);_0x4008fb[_0x9e4c('0x3a')]=_[_0x9e4c('0x3b')](_0x4008fb[_0x9e4c('0x3c')],_0x4008fb[_0x9e4c('0x38')]);_0x2f90af['attributes']=_['intersection'](_0x4008fb['model'],qs[_0x9e4c('0x3e')](_0x21bf98[_0x9e4c('0x38')][_0x9e4c('0x3e')]));_0x2f90af[_0x9e4c('0x3d')]=_0x2f90af[_0x9e4c('0x3d')][_0x9e4c('0x3f')]?_0x2f90af['attributes']:_0x4008fb['model'];_0x2f90af[_0x9e4c('0x42')]=qs['sort'](_0x21bf98[_0x9e4c('0x38')][_0x9e4c('0x43')]);_0x2f90af[_0x9e4c('0x44')]=qs['filters'](_[_0x9e4c('0x45')](_0x21bf98[_0x9e4c('0x38')],_0x4008fb[_0x9e4c('0x3a')]));if(_0x21bf98[_0x9e4c('0x38')][_0x9e4c('0x47')]){_0x2f90af['where']=_[_0x9e4c('0x46')](_0x2f90af[_0x9e4c('0x44')],{'$or':_[_0x9e4c('0x34')](_0x2f90af[_0x9e4c('0x3d')],function(_0x288ddb){var _0xd4ae34={};_0xd4ae34[_0x288ddb]={'$like':'%'+_0x21bf98['query'][_0x9e4c('0x47')]+'%'};return _0xd4ae34;})});}_0x2f90af=_['merge']({},_0x2f90af,_0x21bf98[_0x9e4c('0x48')]);return _0x52bbc0[_0x9e4c('0x65')](_0x2f90af);}})[_0x9e4c('0x2c')](function(_0x40eb53){if(_0x40eb53){_0x143e2a=_0x40eb53[_0x9e4c('0x3f')];if(!_0x21bf98[_0x9e4c('0x38')][_0x9e4c('0x40')](_0x9e4c('0x41'))){_0x2f90af['limit']=qs[_0x9e4c('0x27')](_0x21bf98[_0x9e4c('0x38')][_0x9e4c('0x27')]);_0x2f90af[_0x9e4c('0x24')]=qs[_0x9e4c('0x24')](_0x21bf98[_0x9e4c('0x38')][_0x9e4c('0x24')]);}return _0x52bbc0[_0x9e4c('0x65')](_0x2f90af);}})['then'](function(_0xf64981){if(_0xf64981){return _0xf64981?{'count':_0x143e2a,'rows':_0xf64981}:null;}})[_0x9e4c('0x2c')](respondWithResult(_0x4dca0a,null))[_0x9e4c('0x51')](handleError(_0x4dca0a,null));};exports[_0x9e4c('0x68')]=function(_0x481c06,_0x1bdfb1,_0x5ab898){var _0x21a957=_0x481c06[_0x9e4c('0x53')][_0x9e4c('0x69')];return db[_0x9e4c('0x67')]['findAll']({'where':{'id':_0x21a957},'attributes':['id'],'include':[{'model':db[_0x9e4c('0x6a')],'as':_0x9e4c('0x6b'),'attributes':['id','name',_0x9e4c('0x6c'),_0x9e4c('0x6d'),'interface'],'raw':!![]}]})[_0x9e4c('0x2c')](function(_0x16846d){if(_0x16846d){var _0x184be2=_[_0x9e4c('0x6e')](_0x16846d,function(_0x6d54db){var _0x526fd8=_0x6d54db['get']({'plain':!![]});return _0x526fd8['Agents'];});return db[_0x9e4c('0x49')]['find']({'where':{'id':_0x481c06[_0x9e4c('0x5a')]['id']}})[_0x9e4c('0x2c')](function(_0x27c6cf){return db[_0x9e4c('0x6f')][_0x9e4c('0x70')](function(_0x5cea03){return _0x27c6cf[_0x9e4c('0x68')](_0x21a957,{'transaction':_0x5cea03})[_0x9e4c('0x2c')](function(){return BPromise['each'](_0x184be2,function(_0xf71fb){return db[_0x9e4c('0x5d')][_0x9e4c('0x71')]({'where':{'UserId':_0xf71fb['id'],'FaxQueueId':_0x481c06[_0x9e4c('0x5a')]['id']},'transaction':_0x5cea03});});})[_0x9e4c('0x2c')](function(){_0x184be2[_0x9e4c('0x72')](function(_0x51c957){socket['emit'](_0x9e4c('0x73'),{'UserId':_0x51c957['id'],'FaxQueueId':_0x27c6cf['id']});});});});});}})['then'](respondWithStatusCode(_0x1bdfb1,null))[_0x9e4c('0x51')](handleError(_0x1bdfb1,null));};exports[_0x9e4c('0x74')]=function(_0x3acfb7,_0x6af3bf,_0x181816){return db[_0x9e4c('0x67')][_0x9e4c('0x4b')]({'where':{'id':_0x3acfb7[_0x9e4c('0x38')][_0x9e4c('0x69')]},'attributes':['id'],'include':[{'model':db[_0x9e4c('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9e4c('0x2c')](handleEntityNotFound(_0x6af3bf,null))['then'](function(_0x2251b4){var _0x1ec55f=_[_0x9e4c('0x34')](_0x2251b4,'id');var _0x172f92=[];var _0x34b120=[];var _0x4d26ec=squel[_0x9e4c('0x75')]();_0x4d26ec['field'](_0x9e4c('0x76'))['from'](_0x9e4c('0x77'),'tq')[_0x9e4c('0x78')](_0x9e4c('0x79'),'ut',_0x9e4c('0x7a'))[_0x9e4c('0x44')](_0x9e4c('0x7b'),_0x3acfb7[_0x9e4c('0x5a')]['id']);for(var _0x532477=0x0;_0x532477<_0x2251b4[_0x9e4c('0x3f')];_0x532477+=0x1){let _0x589fb5=_0x2251b4[_0x532477];for(var _0x56cb81=0x0;_0x56cb81<_0x589fb5[_0x9e4c('0x6b')]['length'];_0x56cb81+=0x1){let _0x30dca7=_0x589fb5[_0x9e4c('0x6b')][_0x56cb81];var _0xb67092=_0x4d26ec[_0x9e4c('0x7c')]();_0xb67092[_0x9e4c('0x44')](_0x9e4c('0x7d'),_0x30dca7['id']);_0x34b120[_0x9e4c('0x7e')](db[_0x9e4c('0x6f')][_0x9e4c('0x38')](_0xb67092[_0x9e4c('0x7f')](),{'type':db[_0x9e4c('0x6f')][_0x9e4c('0x80')][_0x9e4c('0x81')]})['then'](function(_0x4de08f){if(_0x4de08f[_0x9e4c('0x3f')]===0x1){return _0x30dca7['id'];}else{var _0x580f51=_[_0x9e4c('0x82')](_['map'](_0x4de08f,_0x9e4c('0x83')),function(_0x3b96d2){return _['includes'](_0x1ec55f,_0x3b96d2);});if(_0x580f51){return _0x30dca7['id'];}}}));}}return BPromise[_0x9e4c('0x84')](_0x34b120)[_0x9e4c('0x2c')](function(_0x4ffea8){_0x172f92=_(_0x172f92)[_0x9e4c('0x85')](_0x4ffea8)[_0x9e4c('0x86')]()['value']();return db[_0x9e4c('0x49')]['find']({'where':{'id':_0x3acfb7['params']['id']}})[_0x9e4c('0x2c')](function(_0x359f0e){return db[_0x9e4c('0x6f')][_0x9e4c('0x70')](function(_0x518078){return _0x359f0e['removeTeams'](_0x3acfb7['query']['ids'],{'transaction':_0x518078})[_0x9e4c('0x2c')](function(){if(!_[_0x9e4c('0x87')](_0x172f92)){return _0x359f0e[_0x9e4c('0x88')](_0x172f92,{'transaction':_0x518078});}})[_0x9e4c('0x2c')](function(){_0x172f92[_0x9e4c('0x72')](function(_0x5b13b4){socket[_0x9e4c('0x89')](_0x9e4c('0x8a'),{'UserId':_0x5b13b4,'FaxQueueId':_0x359f0e['id']});});});});});});})['then'](respondWithStatusCode(_0x6af3bf,null))[_0x9e4c('0x51')](handleError(_0x6af3bf,null));};exports['addAgents']=function(_0x57ce72,_0x5de1cf,_0x133acf){return db[_0x9e4c('0x49')][_0x9e4c('0x50')]({'where':{'id':_0x57ce72[_0x9e4c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5de1cf,null))[_0x9e4c('0x2c')](function(_0x236050){if(_0x236050){return _0x236050[_0x9e4c('0x8b')](_0x57ce72[_0x9e4c('0x53')][_0x9e4c('0x69')],_[_0x9e4c('0x8c')](_0x57ce72[_0x9e4c('0x53')],[_0x9e4c('0x69'),'id'])||{})['spread'](function(_0x2ef755){for(var _0x264907=0x0;_0x264907<_0x57ce72[_0x9e4c('0x53')]['ids'][_0x9e4c('0x3f')];_0x264907+=0x1){socket[_0x9e4c('0x89')](_0x9e4c('0x73'),{'UserId':Number(_0x57ce72[_0x9e4c('0x53')][_0x9e4c('0x69')][_0x264907]),'FaxQueueId':Number(_0x57ce72['params']['id'])});}return _0x2ef755;});}})[_0x9e4c('0x2c')](respondWithResult(_0x5de1cf,null))[_0x9e4c('0x51')](handleError(_0x5de1cf,null));};exports['removeAgents']=function(_0x25dc7c,_0x2b86da,_0x5e000d){return db['FaxQueue'][_0x9e4c('0x50')]({'where':{'id':_0x25dc7c[_0x9e4c('0x5a')]['id']}})[_0x9e4c('0x2c')](handleEntityNotFound(_0x2b86da,null))[_0x9e4c('0x2c')](function(_0x581024){if(_0x581024){return _0x581024[_0x9e4c('0x88')](_0x25dc7c['query']['ids'])[_0x9e4c('0x2c')](function(){if(_[_0x9e4c('0x8d')](_0x25dc7c[_0x9e4c('0x38')]['ids'])){for(var _0x5a7ed6=0x0;_0x5a7ed6<_0x25dc7c[_0x9e4c('0x38')][_0x9e4c('0x69')][_0x9e4c('0x3f')];_0x5a7ed6+=0x1){socket[_0x9e4c('0x89')](_0x9e4c('0x8a'),{'UserId':Number(_0x25dc7c[_0x9e4c('0x38')]['ids'][_0x5a7ed6]),'FaxQueueId':Number(_0x25dc7c[_0x9e4c('0x5a')]['id'])});}}else{socket[_0x9e4c('0x89')](_0x9e4c('0x8a'),{'UserId':Number(_0x25dc7c[_0x9e4c('0x38')][_0x9e4c('0x69')]),'FaxQueueId':Number(_0x25dc7c['params']['id'])});}});}})[_0x9e4c('0x2c')](respondWithStatusCode(_0x2b86da,null))[_0x9e4c('0x51')](handleError(_0x2b86da,null));};exports[_0x9e4c('0x8e')]=function(_0x478052,_0x11a3ef,_0x3bd23f){var _0x5ecfcb={};var _0x14c9e9={};var _0x1f0744;var _0x20dccd;return db[_0x9e4c('0x49')][_0x9e4c('0x66')]({'where':{'id':_0x478052['params']['id']}})[_0x9e4c('0x2c')](handleEntityNotFound(_0x11a3ef,null))[_0x9e4c('0x2c')](function(_0x90a5ed){if(_0x90a5ed){_0x1f0744=_0x90a5ed;_0x14c9e9[_0x9e4c('0x3c')]=_['keys'](db['User'][_0x9e4c('0x4e')]);_0x14c9e9['query']=_[_0x9e4c('0x39')](_0x478052[_0x9e4c('0x38')]);_0x14c9e9[_0x9e4c('0x3a')]=_[_0x9e4c('0x3b')](_0x14c9e9[_0x9e4c('0x3c')],_0x14c9e9['query']);_0x5ecfcb['attributes']=_[_0x9e4c('0x3b')](_0x14c9e9[_0x9e4c('0x3c')],qs[_0x9e4c('0x3e')](_0x478052[_0x9e4c('0x38')][_0x9e4c('0x3e')]));_0x5ecfcb[_0x9e4c('0x3d')]=_0x5ecfcb[_0x9e4c('0x3d')][_0x9e4c('0x3f')]?_0x5ecfcb[_0x9e4c('0x3d')]:_0x14c9e9[_0x9e4c('0x3c')];_0x5ecfcb[_0x9e4c('0x42')]=qs['sort'](_0x478052[_0x9e4c('0x38')][_0x9e4c('0x43')]);_0x5ecfcb[_0x9e4c('0x44')]=qs[_0x9e4c('0x3a')](_[_0x9e4c('0x45')](_0x478052[_0x9e4c('0x38')],_0x14c9e9[_0x9e4c('0x3a')]));if(_0x478052[_0x9e4c('0x38')]['filter']){_0x5ecfcb['where']=_[_0x9e4c('0x46')](_0x5ecfcb['where'],{'$or':_[_0x9e4c('0x34')](_0x5ecfcb[_0x9e4c('0x3d')],function(_0x4cab18){var _0x30e5d5={};_0x30e5d5[_0x4cab18]={'$like':'%'+_0x478052[_0x9e4c('0x38')][_0x9e4c('0x47')]+'%'};return _0x30e5d5;})});}_0x5ecfcb=_[_0x9e4c('0x46')]({},_0x5ecfcb,_0x478052[_0x9e4c('0x48')]);return _0x1f0744[_0x9e4c('0x8e')](_0x5ecfcb);}})[_0x9e4c('0x2c')](function(_0x2a4540){if(_0x2a4540){_0x20dccd=_0x2a4540[_0x9e4c('0x3f')];if(!_0x478052[_0x9e4c('0x38')][_0x9e4c('0x40')](_0x9e4c('0x41'))){_0x5ecfcb[_0x9e4c('0x27')]=qs['limit'](_0x478052['query'][_0x9e4c('0x27')]);_0x5ecfcb[_0x9e4c('0x24')]=qs[_0x9e4c('0x24')](_0x478052[_0x9e4c('0x38')][_0x9e4c('0x24')]);}return _0x1f0744['getAgents'](_0x5ecfcb);}})[_0x9e4c('0x2c')](function(_0x55c4e8){if(_0x55c4e8){return _0x55c4e8?{'count':_0x20dccd,'rows':_0x55c4e8}:null;}})[_0x9e4c('0x2c')](respondWithResult(_0x11a3ef,null))[_0x9e4c('0x51')](handleError(_0x11a3ef,null));}; \ No newline at end of file +var _0xe1c7=['json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','FaxQueues','destroy','end','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','filter','findAll','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status'];(function(_0x440ecf,_0x1e144c){var _0xe1f460=function(_0x553626){while(--_0x553626){_0x440ecf['push'](_0x440ecf['shift']());}};_0xe1f460(++_0x1e144c);}(_0xe1c7,0xfb));var _0x7e1c=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xe1c7[_0x1f44e4];return _0x591989;};'use strict';var emlformat=require(_0x7e1c('0x0'));var rimraf=require(_0x7e1c('0x1'));var zipdir=require(_0x7e1c('0x2'));var jsonpatch=require(_0x7e1c('0x3'));var rp=require('request-promise');var moment=require(_0x7e1c('0x4'));var BPromise=require(_0x7e1c('0x5'));var Mustache=require(_0x7e1c('0x6'));var util=require(_0x7e1c('0x7'));var path=require(_0x7e1c('0x8'));var sox=require(_0x7e1c('0x9'));var csv=require(_0x7e1c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e1c('0xb'));var squel=require(_0x7e1c('0xc'));var crypto=require(_0x7e1c('0xd'));var jsforce=require(_0x7e1c('0xe'));var deskjs=require(_0x7e1c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7e1c('0x10'));var Redis=require(_0x7e1c('0x11'));var authService=require(_0x7e1c('0x12'));var qs=require(_0x7e1c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e1c('0x14'))(_0x7e1c('0x15'));var utils=require(_0x7e1c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e1c('0x17'));var db=require(_0x7e1c('0x18'))['db'];config[_0x7e1c('0x19')]=_[_0x7e1c('0x1a')](config[_0x7e1c('0x19')],{'host':_0x7e1c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e1c('0x19')]));require('./faxQueue.socket')[_0x7e1c('0x1c')](socket);function respondWithStatusCode(_0x10ba24,_0x3a6b0d){_0x3a6b0d=_0x3a6b0d||0xcc;return function(_0x20b121){if(_0x20b121){return _0x10ba24[_0x7e1c('0x1d')](_0x3a6b0d);}return _0x10ba24[_0x7e1c('0x1e')](_0x3a6b0d)['end']();};}function respondWithResult(_0x30efe5,_0x4893bb){_0x4893bb=_0x4893bb||0xc8;return function(_0x7bbfb6){if(_0x7bbfb6){return _0x30efe5['status'](_0x4893bb)[_0x7e1c('0x1f')](_0x7bbfb6);}};}function respondWithFilteredResult(_0x3ea018,_0x4a6040){return function(_0x154355){if(_0x154355){var _0x3859a3=typeof _0x4a6040[_0x7e1c('0x20')]==='undefined'&&typeof _0x4a6040[_0x7e1c('0x21')]===_0x7e1c('0x22');var _0x1a1052=_0x154355[_0x7e1c('0x23')];var _0x1b39be=_0x3859a3?0x0:_0x4a6040[_0x7e1c('0x20')];var _0x284846=_0x3859a3?_0x154355['count']:_0x4a6040[_0x7e1c('0x20')]+_0x4a6040[_0x7e1c('0x21')];var _0x16f68f;if(_0x284846>=_0x1a1052){_0x284846=_0x1a1052;_0x16f68f=0xc8;}else{_0x16f68f=0xce;}_0x3ea018[_0x7e1c('0x1e')](_0x16f68f);return _0x3ea018[_0x7e1c('0x24')](_0x7e1c('0x25'),_0x1b39be+'-'+_0x284846+'/'+_0x1a1052)[_0x7e1c('0x1f')](_0x154355);}return null;};}function patchUpdates(_0x50eaa0){return function(_0x34bbf0){try{jsonpatch[_0x7e1c('0x26')](_0x34bbf0,_0x50eaa0,!![]);}catch(_0x1c15a3){return BPromise['reject'](_0x1c15a3);}return _0x34bbf0[_0x7e1c('0x27')]();};}function saveUpdates(_0x1d97f2,_0x205ba2){return function(_0x517c20){if(_0x517c20){return _0x517c20[_0x7e1c('0x28')](_0x1d97f2)[_0x7e1c('0x29')](function(_0x5e6691){return _0x5e6691;});}return null;};}function removeEntity(_0x28bc83,_0x2b6d73){return function(_0x3434b1){if(_0x3434b1){return _0x3434b1['destroy']()[_0x7e1c('0x29')](function(){var _0x11da1c=_0x3434b1['get']({'plain':!![]});var _0x3fca81=_0x7e1c('0x2a');return db['UserProfileResource'][_0x7e1c('0x2b')]({'where':{'type':_0x3fca81,'resourceId':_0x11da1c['id']}})['then'](function(){return _0x3434b1;});})['then'](function(){_0x28bc83[_0x7e1c('0x1e')](0xcc)[_0x7e1c('0x2c')]();});}};}function handleEntityNotFound(_0x36ba25,_0x9cbd72){return function(_0x1472d9){if(!_0x1472d9){_0x36ba25[_0x7e1c('0x1d')](0x194);}return _0x1472d9;};}function handleError(_0x38a0cb,_0x453316){_0x453316=_0x453316||0x1f4;return function(_0x4f1a29){logger[_0x7e1c('0x2d')](_0x4f1a29[_0x7e1c('0x2e')]);if(_0x4f1a29[_0x7e1c('0x2f')]){delete _0x4f1a29['name'];}_0x38a0cb[_0x7e1c('0x1e')](_0x453316)[_0x7e1c('0x30')](_0x4f1a29);};}exports['index']=function(_0x2e3bd7,_0x24ca66){var _0x599e4c={},_0x5045f8={},_0x422665={'count':0x0,'rows':[]};var _0x1b9797=_[_0x7e1c('0x31')](db[_0x7e1c('0x32')][_0x7e1c('0x33')],function(_0x1975a7){return{'name':_0x1975a7[_0x7e1c('0x34')],'type':_0x1975a7[_0x7e1c('0x35')][_0x7e1c('0x36')]};});_0x5045f8[_0x7e1c('0x37')]=_[_0x7e1c('0x31')](_0x1b9797,_0x7e1c('0x2f'));_0x5045f8[_0x7e1c('0x38')]=_[_0x7e1c('0x39')](_0x2e3bd7[_0x7e1c('0x38')]);_0x5045f8[_0x7e1c('0x3a')]=_[_0x7e1c('0x3b')](_0x5045f8[_0x7e1c('0x37')],_0x5045f8['query']);_0x599e4c[_0x7e1c('0x3c')]=_[_0x7e1c('0x3b')](_0x5045f8[_0x7e1c('0x37')],qs[_0x7e1c('0x3d')](_0x2e3bd7[_0x7e1c('0x38')][_0x7e1c('0x3d')]));_0x599e4c[_0x7e1c('0x3c')]=_0x599e4c[_0x7e1c('0x3c')][_0x7e1c('0x3e')]?_0x599e4c[_0x7e1c('0x3c')]:_0x5045f8[_0x7e1c('0x37')];if(!_0x2e3bd7[_0x7e1c('0x38')]['hasOwnProperty'](_0x7e1c('0x3f'))){_0x599e4c[_0x7e1c('0x21')]=qs[_0x7e1c('0x21')](_0x2e3bd7[_0x7e1c('0x38')][_0x7e1c('0x21')]);_0x599e4c[_0x7e1c('0x20')]=qs[_0x7e1c('0x20')](_0x2e3bd7['query']['offset']);}_0x599e4c[_0x7e1c('0x40')]=qs[_0x7e1c('0x41')](_0x2e3bd7[_0x7e1c('0x38')][_0x7e1c('0x41')]);_0x599e4c[_0x7e1c('0x42')]=qs[_0x7e1c('0x3a')](_[_0x7e1c('0x43')](_0x2e3bd7[_0x7e1c('0x38')],_0x5045f8[_0x7e1c('0x3a')]),_0x1b9797);if(_0x2e3bd7[_0x7e1c('0x38')]['filter']){_0x599e4c[_0x7e1c('0x42')]=_[_0x7e1c('0x44')](_0x599e4c[_0x7e1c('0x42')],{'$or':_['map'](_0x1b9797,function(_0x53b947){if(_0x53b947[_0x7e1c('0x35')]!==_0x7e1c('0x45')){var _0xe28067={};_0xe28067[_0x53b947['name']]={'$like':'%'+_0x2e3bd7[_0x7e1c('0x38')]['filter']+'%'};return _0xe28067;}})});}_0x599e4c=_['merge']({},_0x599e4c,_0x2e3bd7[_0x7e1c('0x46')]);var _0x4a72f6={'where':_0x599e4c['where']};return db[_0x7e1c('0x32')][_0x7e1c('0x23')](_0x4a72f6)[_0x7e1c('0x29')](function(_0x1e4f8f){_0x422665['count']=_0x1e4f8f;if(_0x2e3bd7[_0x7e1c('0x38')][_0x7e1c('0x47')]){_0x599e4c['include']=[{'all':!![]}];}return db[_0x7e1c('0x32')]['findAll'](_0x599e4c);})[_0x7e1c('0x29')](function(_0x429731){_0x422665[_0x7e1c('0x48')]=_0x429731;return _0x422665;})[_0x7e1c('0x29')](respondWithFilteredResult(_0x24ca66,_0x599e4c))[_0x7e1c('0x49')](handleError(_0x24ca66,null));};exports['show']=function(_0x5639bb,_0x3e2885){var _0x2c4855={'raw':!![],'where':{'id':_0x5639bb[_0x7e1c('0x4a')]['id']}},_0x3275a1={};_0x3275a1[_0x7e1c('0x37')]=_[_0x7e1c('0x39')](db['FaxQueue']['rawAttributes']);_0x3275a1['query']=_[_0x7e1c('0x39')](_0x5639bb[_0x7e1c('0x38')]);_0x3275a1[_0x7e1c('0x3a')]=_[_0x7e1c('0x3b')](_0x3275a1[_0x7e1c('0x37')],_0x3275a1[_0x7e1c('0x38')]);_0x2c4855['attributes']=_[_0x7e1c('0x3b')](_0x3275a1['model'],qs['fields'](_0x5639bb[_0x7e1c('0x38')][_0x7e1c('0x3d')]));_0x2c4855[_0x7e1c('0x3c')]=_0x2c4855['attributes'][_0x7e1c('0x3e')]?_0x2c4855[_0x7e1c('0x3c')]:_0x3275a1[_0x7e1c('0x37')];if(_0x5639bb[_0x7e1c('0x38')][_0x7e1c('0x47')]){_0x2c4855[_0x7e1c('0x4b')]=[{'all':!![]}];}_0x2c4855=_[_0x7e1c('0x44')]({},_0x2c4855,_0x5639bb['options']);return db[_0x7e1c('0x32')][_0x7e1c('0x4c')](_0x2c4855)[_0x7e1c('0x29')](handleEntityNotFound(_0x3e2885,null))[_0x7e1c('0x29')](respondWithResult(_0x3e2885,null))[_0x7e1c('0x49')](handleError(_0x3e2885,null));};exports[_0x7e1c('0x4d')]=function(_0x1e82b4,_0x5a721f){return db['FaxQueue'][_0x7e1c('0x4d')](_0x1e82b4[_0x7e1c('0x4e')],{})[_0x7e1c('0x29')](function(_0x731e2a){var _0x1d6113=_0x1e82b4[_0x7e1c('0x4f')][_0x7e1c('0x50')]({'plain':!![]});if(!_0x1d6113)throw new Error(_0x7e1c('0x51'));if(_0x1d6113[_0x7e1c('0x52')]===_0x7e1c('0x4f')){var _0x1c83dd=_0x731e2a[_0x7e1c('0x50')]({'plain':!![]});var _0x2c20d6='FaxQueues';return db[_0x7e1c('0x53')]['find']({'where':{'name':_0x2c20d6,'userProfileId':_0x1d6113[_0x7e1c('0x54')]},'raw':!![]})[_0x7e1c('0x29')](function(_0x41d2fb){if(_0x41d2fb&&_0x41d2fb[_0x7e1c('0x55')]===0x0){return db[_0x7e1c('0x56')]['create']({'name':_0x1c83dd[_0x7e1c('0x2f')],'resourceId':_0x1c83dd['id'],'type':_0x41d2fb[_0x7e1c('0x2f')],'sectionId':_0x41d2fb['id']},{})['then'](function(){return _0x731e2a;});}else{return _0x731e2a;}})[_0x7e1c('0x49')](function(_0x5b2458){logger[_0x7e1c('0x2d')](_0x7e1c('0x57'),_0x5b2458);throw _0x5b2458;});}return _0x731e2a;})['then'](respondWithResult(_0x5a721f,0xc9))[_0x7e1c('0x49')](handleError(_0x5a721f,null));};exports['update']=function(_0x43d267,_0x2def77){if(_0x43d267['body']['id']){delete _0x43d267['body']['id'];}return db[_0x7e1c('0x32')][_0x7e1c('0x4c')]({'where':{'id':_0x43d267[_0x7e1c('0x4a')]['id']}})[_0x7e1c('0x29')](handleEntityNotFound(_0x2def77,null))[_0x7e1c('0x29')](saveUpdates(_0x43d267[_0x7e1c('0x4e')],null))['then'](respondWithResult(_0x2def77,null))[_0x7e1c('0x49')](handleError(_0x2def77,null));};exports[_0x7e1c('0x2b')]=function(_0x29574d,_0x7c31c2){return db['FaxQueue'][_0x7e1c('0x4c')]({'where':{'id':_0x29574d[_0x7e1c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7c31c2,null))[_0x7e1c('0x29')](removeEntity(_0x7c31c2,null))['catch'](handleError(_0x7c31c2,null));};exports[_0x7e1c('0x58')]=function(_0x11ab9c,_0x3bde38){return db['FaxQueue'][_0x7e1c('0x58')]()[_0x7e1c('0x29')](respondWithResult(_0x3bde38,null))['catch'](handleError(_0x3bde38,null));};exports[_0x7e1c('0x59')]=function(_0x1af2f2,_0x348c86,_0x58de47){var _0x451789={'raw':!![],'where':{}},_0x320a3f={},_0x3f5e7b;return db[_0x7e1c('0x32')][_0x7e1c('0x5a')]({'where':{'id':_0x1af2f2[_0x7e1c('0x4a')]['id']}})[_0x7e1c('0x29')](handleEntityNotFound(_0x348c86,null))[_0x7e1c('0x29')](function(_0x308d79){if(_0x308d79){_0x3f5e7b=_0x308d79[_0x7e1c('0x50')]({'plain':!![]});_0x320a3f[_0x7e1c('0x37')]=_[_0x7e1c('0x39')](db[_0x7e1c('0x5b')][_0x7e1c('0x33')]);_0x320a3f[_0x7e1c('0x38')]=_[_0x7e1c('0x39')](_0x1af2f2[_0x7e1c('0x38')]);_0x320a3f[_0x7e1c('0x3a')]=_[_0x7e1c('0x3b')](_0x320a3f[_0x7e1c('0x37')],_0x320a3f[_0x7e1c('0x38')]);_0x451789[_0x7e1c('0x3c')]=_[_0x7e1c('0x3b')](_0x320a3f[_0x7e1c('0x37')],qs[_0x7e1c('0x3d')](_0x1af2f2['query'][_0x7e1c('0x3d')]));_0x451789[_0x7e1c('0x3c')]=_0x451789[_0x7e1c('0x3c')]['length']?_0x451789[_0x7e1c('0x3c')]:_0x320a3f[_0x7e1c('0x37')];if(!_0x1af2f2[_0x7e1c('0x38')][_0x7e1c('0x5c')]('nolimit')){_0x451789[_0x7e1c('0x21')]=qs[_0x7e1c('0x21')](_0x1af2f2[_0x7e1c('0x38')]['limit']);_0x451789[_0x7e1c('0x20')]=qs[_0x7e1c('0x20')](_0x1af2f2['query'][_0x7e1c('0x20')]);}_0x451789[_0x7e1c('0x40')]=qs[_0x7e1c('0x41')](_0x1af2f2[_0x7e1c('0x38')]['sort']);_0x451789[_0x7e1c('0x42')]=qs[_0x7e1c('0x3a')](_[_0x7e1c('0x43')](_0x1af2f2[_0x7e1c('0x38')],_0x320a3f['filters']));_0x451789[_0x7e1c('0x42')][_0x7e1c('0x5d')]=_0x308d79['id'];if(_0x1af2f2[_0x7e1c('0x38')][_0x7e1c('0x5e')]){_0x451789[_0x7e1c('0x42')]=_[_0x7e1c('0x44')](_0x451789[_0x7e1c('0x42')],{'$or':_['map'](_0x451789['attributes'],function(_0xf6135f){var _0x1f22a7={};_0x1f22a7[_0xf6135f]={'$like':'%'+_0x1af2f2[_0x7e1c('0x38')][_0x7e1c('0x5e')]+'%'};return _0x1f22a7;})});}_0x451789=_[_0x7e1c('0x44')]({},_0x451789,_0x1af2f2[_0x7e1c('0x46')]);return db[_0x7e1c('0x5b')][_0x7e1c('0x5f')](_0x451789);}})['then'](function(_0x4a0b15){if(_0x4a0b15){return db[_0x7e1c('0x60')][_0x7e1c('0x61')]({'where':{'id':_[_0x7e1c('0x31')](_0x4a0b15,'UserId'),'role':_0x7e1c('0x62')},'attributes':['id',_0x7e1c('0x2f'),_0x7e1c('0x63'),_0x7e1c('0x64'),_0x7e1c('0x65')]});}})[_0x7e1c('0x29')](function(_0x1b7c51){if(_0x1b7c51){return{'count':_0x1b7c51[_0x7e1c('0x23')],'rows':_[_0x7e1c('0x31')](_0x1b7c51[_0x7e1c('0x48')],function(_0x101d0b){return{'membername':_0x101d0b[_0x7e1c('0x2f')],'UserId':_0x101d0b['id'],'queue_name':_0x3f5e7b[_0x7e1c('0x2f')],'FaxQueueId':_0x3f5e7b['id'],'interface':util[_0x7e1c('0x66')](_0x7e1c('0x67'),_0x7e1c('0x68'),_0x101d0b['name']),'penalty':0x0,'paused':_0x101d0b['faxPause'],'createdAt':_0x101d0b[_0x7e1c('0x65')],'updatedAt':_0x101d0b[_0x7e1c('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x348c86,_0x451789))[_0x7e1c('0x49')](handleError(_0x348c86,null));};exports[_0x7e1c('0x69')]=function(_0x1de524,_0x8dca5d,_0xc3dd62){var _0x4e5182={};var _0x650f9b={};var _0x40a97f;var _0x462f88;return db[_0x7e1c('0x32')][_0x7e1c('0x5a')]({'where':{'id':_0x1de524['params']['id']}})['then'](handleEntityNotFound(_0x8dca5d,null))[_0x7e1c('0x29')](function(_0x4182a6){if(_0x4182a6){_0x40a97f=_0x4182a6;_0x650f9b[_0x7e1c('0x37')]=_['keys'](db[_0x7e1c('0x6a')][_0x7e1c('0x33')]);_0x650f9b['query']=_['keys'](_0x1de524[_0x7e1c('0x38')]);_0x650f9b[_0x7e1c('0x3a')]=_[_0x7e1c('0x3b')](_0x650f9b['model'],_0x650f9b[_0x7e1c('0x38')]);_0x4e5182['attributes']=_['intersection'](_0x650f9b[_0x7e1c('0x37')],qs[_0x7e1c('0x3d')](_0x1de524['query'][_0x7e1c('0x3d')]));_0x4e5182[_0x7e1c('0x3c')]=_0x4e5182['attributes'][_0x7e1c('0x3e')]?_0x4e5182[_0x7e1c('0x3c')]:_0x650f9b[_0x7e1c('0x37')];_0x4e5182[_0x7e1c('0x40')]=qs['sort'](_0x1de524['query'][_0x7e1c('0x41')]);_0x4e5182[_0x7e1c('0x42')]=qs['filters'](_[_0x7e1c('0x43')](_0x1de524[_0x7e1c('0x38')],_0x650f9b[_0x7e1c('0x3a')]));if(_0x1de524[_0x7e1c('0x38')][_0x7e1c('0x5e')]){_0x4e5182[_0x7e1c('0x42')]=_[_0x7e1c('0x44')](_0x4e5182[_0x7e1c('0x42')],{'$or':_[_0x7e1c('0x31')](_0x4e5182[_0x7e1c('0x3c')],function(_0x332ae9){var _0x4714ae={};_0x4714ae[_0x332ae9]={'$like':'%'+_0x1de524['query']['filter']+'%'};return _0x4714ae;})});}_0x4e5182=_[_0x7e1c('0x44')]({},_0x4e5182,_0x1de524[_0x7e1c('0x46')]);return _0x40a97f['getTeams'](_0x4e5182);}})[_0x7e1c('0x29')](function(_0x2ab8cb){if(_0x2ab8cb){_0x462f88=_0x2ab8cb[_0x7e1c('0x3e')];if(!_0x1de524['query'][_0x7e1c('0x5c')](_0x7e1c('0x3f'))){_0x4e5182[_0x7e1c('0x21')]=qs[_0x7e1c('0x21')](_0x1de524[_0x7e1c('0x38')][_0x7e1c('0x21')]);_0x4e5182['offset']=qs[_0x7e1c('0x20')](_0x1de524[_0x7e1c('0x38')][_0x7e1c('0x20')]);}return _0x40a97f[_0x7e1c('0x69')](_0x4e5182);}})[_0x7e1c('0x29')](function(_0x31bf75){if(_0x31bf75){return _0x31bf75?{'count':_0x462f88,'rows':_0x31bf75}:null;}})[_0x7e1c('0x29')](respondWithResult(_0x8dca5d,null))[_0x7e1c('0x49')](handleError(_0x8dca5d,null));};exports[_0x7e1c('0x6b')]=function(_0x5ec7da,_0x1124d6,_0x2f9aba){var _0x221a97=_0x5ec7da[_0x7e1c('0x4e')]['ids'];return db['Team']['findAll']({'where':{'id':_0x221a97},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7e1c('0x6c'),'attributes':['id',_0x7e1c('0x2f'),'online',_0x7e1c('0x6d'),_0x7e1c('0x6e')],'raw':!![]}]})['then'](function(_0x1e7450){if(_0x1e7450){var _0x56a637=_[_0x7e1c('0x6f')](_0x1e7450,function(_0x29b0b8){var _0x4b6622=_0x29b0b8['get']({'plain':!![]});return _0x4b6622[_0x7e1c('0x6c')];});return db[_0x7e1c('0x32')]['find']({'where':{'id':_0x5ec7da['params']['id']}})[_0x7e1c('0x29')](function(_0x3289ca){return db[_0x7e1c('0x70')][_0x7e1c('0x71')](function(_0xd9c291){return _0x3289ca[_0x7e1c('0x6b')](_0x221a97,{'transaction':_0xd9c291})[_0x7e1c('0x29')](function(){return BPromise['each'](_0x56a637,function(_0x73b87e){return db[_0x7e1c('0x5b')][_0x7e1c('0x72')]({'where':{'UserId':_0x73b87e['id'],'FaxQueueId':_0x5ec7da[_0x7e1c('0x4a')]['id']},'transaction':_0xd9c291});});})[_0x7e1c('0x29')](function(){_0x56a637[_0x7e1c('0x73')](function(_0x1f415f){socket[_0x7e1c('0x74')](_0x7e1c('0x75'),{'UserId':_0x1f415f['id'],'FaxQueueId':_0x3289ca['id']});});});});});}})[_0x7e1c('0x29')](respondWithStatusCode(_0x1124d6,null))['catch'](handleError(_0x1124d6,null));};exports[_0x7e1c('0x76')]=function(_0x5191d1,_0x1bf3be,_0x35fea2){return db['Team']['findAll']({'where':{'id':_0x5191d1['query'][_0x7e1c('0x77')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7e1c('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x7e1c('0x29')](handleEntityNotFound(_0x1bf3be,null))[_0x7e1c('0x29')](function(_0x5a5e78){var _0x10e1c6=_['map'](_0x5a5e78,'id');var _0x1a88fa=[];var _0x4f4aa7=[];var _0x2ebf40=squel[_0x7e1c('0x78')]();_0x2ebf40[_0x7e1c('0x79')]('tq.TeamId')[_0x7e1c('0x7a')](_0x7e1c('0x7b'),'tq')['join'](_0x7e1c('0x7c'),'ut',_0x7e1c('0x7d'))['where'](_0x7e1c('0x7e'),_0x5191d1[_0x7e1c('0x4a')]['id']);for(var _0x23dfa0=0x0;_0x23dfa0<_0x5a5e78['length'];_0x23dfa0+=0x1){let _0x4edfbb=_0x5a5e78[_0x23dfa0];for(var _0x23c899=0x0;_0x23c899<_0x4edfbb[_0x7e1c('0x6c')][_0x7e1c('0x3e')];_0x23c899+=0x1){let _0x231f40=_0x4edfbb['Agents'][_0x23c899];var _0x1dc7f9=_0x2ebf40[_0x7e1c('0x7f')]();_0x1dc7f9['where'](_0x7e1c('0x80'),_0x231f40['id']);_0x4f4aa7['push'](db[_0x7e1c('0x70')][_0x7e1c('0x38')](_0x1dc7f9[_0x7e1c('0x81')](),{'type':db[_0x7e1c('0x70')]['QueryTypes']['SELECT']})[_0x7e1c('0x29')](function(_0x2b0487){if(_0x2b0487[_0x7e1c('0x3e')]===0x1){return _0x231f40['id'];}else{var _0x3e00cf=_[_0x7e1c('0x82')](_[_0x7e1c('0x31')](_0x2b0487,_0x7e1c('0x83')),function(_0x234c23){return _['includes'](_0x10e1c6,_0x234c23);});if(_0x3e00cf){return _0x231f40['id'];}}}));}}return BPromise[_0x7e1c('0x84')](_0x4f4aa7)[_0x7e1c('0x29')](function(_0x16e67f){_0x1a88fa=_(_0x1a88fa)[_0x7e1c('0x85')](_0x16e67f)[_0x7e1c('0x86')]()[_0x7e1c('0x87')]();return db['FaxQueue']['find']({'where':{'id':_0x5191d1[_0x7e1c('0x4a')]['id']}})[_0x7e1c('0x29')](function(_0x8cfc9d){return db[_0x7e1c('0x70')][_0x7e1c('0x71')](function(_0x116b58){return _0x8cfc9d[_0x7e1c('0x76')](_0x5191d1[_0x7e1c('0x38')][_0x7e1c('0x77')],{'transaction':_0x116b58})['then'](function(){if(!_[_0x7e1c('0x88')](_0x1a88fa)){return _0x8cfc9d[_0x7e1c('0x89')](_0x1a88fa,{'transaction':_0x116b58});}})[_0x7e1c('0x29')](function(){_0x1a88fa[_0x7e1c('0x73')](function(_0x421669){socket[_0x7e1c('0x74')](_0x7e1c('0x8a'),{'UserId':_0x421669,'FaxQueueId':_0x8cfc9d['id']});});});});});});})['then'](respondWithStatusCode(_0x1bf3be,null))[_0x7e1c('0x49')](handleError(_0x1bf3be,null));};exports[_0x7e1c('0x8b')]=function(_0x431106,_0x44c11c,_0x10a3f0){return db[_0x7e1c('0x32')][_0x7e1c('0x4c')]({'where':{'id':_0x431106['params']['id']}})[_0x7e1c('0x29')](handleEntityNotFound(_0x44c11c,null))[_0x7e1c('0x29')](function(_0x20bdfb){if(_0x20bdfb){return _0x20bdfb[_0x7e1c('0x8b')](_0x431106[_0x7e1c('0x4e')][_0x7e1c('0x77')],_['omit'](_0x431106[_0x7e1c('0x4e')],['ids','id'])||{})['spread'](function(_0xead2f2){for(var _0x22332a=0x0;_0x22332a<_0x431106[_0x7e1c('0x4e')][_0x7e1c('0x77')]['length'];_0x22332a+=0x1){socket[_0x7e1c('0x74')]('userFaxQueue:save',{'UserId':Number(_0x431106[_0x7e1c('0x4e')][_0x7e1c('0x77')][_0x22332a]),'FaxQueueId':Number(_0x431106[_0x7e1c('0x4a')]['id'])});}return _0xead2f2;});}})[_0x7e1c('0x29')](respondWithResult(_0x44c11c,null))['catch'](handleError(_0x44c11c,null));};exports[_0x7e1c('0x89')]=function(_0x54784c,_0x5da7d8,_0x5418d7){return db[_0x7e1c('0x32')][_0x7e1c('0x4c')]({'where':{'id':_0x54784c['params']['id']}})[_0x7e1c('0x29')](handleEntityNotFound(_0x5da7d8,null))[_0x7e1c('0x29')](function(_0x465ac5){if(_0x465ac5){return _0x465ac5['removeAgents'](_0x54784c[_0x7e1c('0x38')][_0x7e1c('0x77')])[_0x7e1c('0x29')](function(){if(_['isArray'](_0x54784c[_0x7e1c('0x38')][_0x7e1c('0x77')])){for(var _0x46bad5=0x0;_0x46bad5<_0x54784c['query'][_0x7e1c('0x77')][_0x7e1c('0x3e')];_0x46bad5+=0x1){socket[_0x7e1c('0x74')]('userFaxQueue:remove',{'UserId':Number(_0x54784c[_0x7e1c('0x38')]['ids'][_0x46bad5]),'FaxQueueId':Number(_0x54784c[_0x7e1c('0x4a')]['id'])});}}else{socket[_0x7e1c('0x74')](_0x7e1c('0x8a'),{'UserId':Number(_0x54784c['query'][_0x7e1c('0x77')]),'FaxQueueId':Number(_0x54784c[_0x7e1c('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5da7d8,null))[_0x7e1c('0x49')](handleError(_0x5da7d8,null));};exports[_0x7e1c('0x8c')]=function(_0x3bb713,_0x3867ef,_0x3049cd){var _0x473814={};var _0x460784={};var _0x840124;var _0x5c075c;return db[_0x7e1c('0x32')][_0x7e1c('0x5a')]({'where':{'id':_0x3bb713[_0x7e1c('0x4a')]['id']}})[_0x7e1c('0x29')](handleEntityNotFound(_0x3867ef,null))[_0x7e1c('0x29')](function(_0x5b31e1){if(_0x5b31e1){_0x840124=_0x5b31e1;_0x460784[_0x7e1c('0x37')]=_[_0x7e1c('0x39')](db[_0x7e1c('0x60')][_0x7e1c('0x33')]);_0x460784[_0x7e1c('0x38')]=_[_0x7e1c('0x39')](_0x3bb713[_0x7e1c('0x38')]);_0x460784['filters']=_[_0x7e1c('0x3b')](_0x460784['model'],_0x460784[_0x7e1c('0x38')]);_0x473814[_0x7e1c('0x3c')]=_['intersection'](_0x460784[_0x7e1c('0x37')],qs['fields'](_0x3bb713['query'][_0x7e1c('0x3d')]));_0x473814[_0x7e1c('0x3c')]=_0x473814[_0x7e1c('0x3c')][_0x7e1c('0x3e')]?_0x473814['attributes']:_0x460784['model'];_0x473814[_0x7e1c('0x40')]=qs[_0x7e1c('0x41')](_0x3bb713['query'][_0x7e1c('0x41')]);_0x473814['where']=qs[_0x7e1c('0x3a')](_[_0x7e1c('0x43')](_0x3bb713[_0x7e1c('0x38')],_0x460784[_0x7e1c('0x3a')]));if(_0x3bb713['query'][_0x7e1c('0x5e')]){_0x473814[_0x7e1c('0x42')]=_[_0x7e1c('0x44')](_0x473814[_0x7e1c('0x42')],{'$or':_[_0x7e1c('0x31')](_0x473814[_0x7e1c('0x3c')],function(_0x2bad35){var _0xa2ebdb={};_0xa2ebdb[_0x2bad35]={'$like':'%'+_0x3bb713[_0x7e1c('0x38')][_0x7e1c('0x5e')]+'%'};return _0xa2ebdb;})});}_0x473814=_[_0x7e1c('0x44')]({},_0x473814,_0x3bb713[_0x7e1c('0x46')]);return _0x840124['getAgents'](_0x473814);}})['then'](function(_0x14ca5f){if(_0x14ca5f){_0x5c075c=_0x14ca5f[_0x7e1c('0x3e')];if(!_0x3bb713[_0x7e1c('0x38')][_0x7e1c('0x5c')](_0x7e1c('0x3f'))){_0x473814[_0x7e1c('0x21')]=qs[_0x7e1c('0x21')](_0x3bb713[_0x7e1c('0x38')][_0x7e1c('0x21')]);_0x473814[_0x7e1c('0x20')]=qs[_0x7e1c('0x20')](_0x3bb713[_0x7e1c('0x38')]['offset']);}return _0x840124[_0x7e1c('0x8c')](_0x473814);}})['then'](function(_0x4386c0){if(_0x4386c0){return _0x4386c0?{'count':_0x5c075c,'rows':_0x4386c0}:null;}})[_0x7e1c('0x29')](respondWithResult(_0x3867ef,null))[_0x7e1c('0x49')](handleError(_0x3867ef,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index dda40ad..c0b1851 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 _0xe0b6=['update','remove','exports','events','../../mysqldb','save'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xe0b6,0x195));var _0x6e0b=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0xe0b6[_0x236c89];return _0x3b2a15;};'use strict';var EventEmitter=require(_0x6e0b('0x0'));var FaxQueue=require(_0x6e0b('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e0b('0x2'),'afterUpdate':_0x6e0b('0x3'),'afterDestroy':_0x6e0b('0x4')};function emitEvent(_0x44a789){return function(_0x290547,_0x20b022,_0x2315f6){FaxQueueEvents['emit'](_0x44a789+':'+_0x290547['id'],_0x290547);FaxQueueEvents['emit'](_0x44a789,_0x290547);_0x2315f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x6e0b('0x5')]=FaxQueueEvents; \ No newline at end of file +var _0xa593=['remove','emit','hasOwnProperty','hook','../../mysqldb','FaxQueue','save','update'];(function(_0x50d326,_0x1fc7e2){var _0x10f473=function(_0x2588fd){while(--_0x2588fd){_0x50d326['push'](_0x50d326['shift']());}};_0x10f473(++_0x1fc7e2);}(_0xa593,0x18c));var _0x3a59=function(_0x186578,_0xc005e9){_0x186578=_0x186578-0x0;var _0x3f8761=_0xa593[_0x186578];return _0x3f8761;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3a59('0x0'))['db'][_0x3a59('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3a59('0x2'),'afterUpdate':_0x3a59('0x3'),'afterDestroy':_0x3a59('0x4')};function emitEvent(_0x3eafc7){return function(_0x58aca7,_0x23591e,_0xd977c8){FaxQueueEvents['emit'](_0x3eafc7+':'+_0x58aca7['id'],_0x58aca7);FaxQueueEvents[_0x3a59('0x5')](_0x3eafc7,_0x58aca7);_0xd977c8(null);};}for(var e in events){if(events[_0x3a59('0x6')](e)){var event=events[e];FaxQueue[_0x3a59('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 655082f..a4cab61 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 _0x9522=['moment','bluebird','request-promise','path','rimraf','define','FaxQueue','fax_queues','lodash'];(function(_0x17f85f,_0x5c6ff9){var _0x38100a=function(_0x1dca1f){while(--_0x1dca1f){_0x17f85f['push'](_0x17f85f['shift']());}};_0x38100a(++_0x5c6ff9);}(_0x9522,0x8f));var _0x2952=function(_0x560485,_0x244601){_0x560485=_0x560485-0x0;var _0x3e7f69=_0x9522[_0x560485];return _0x3e7f69;};'use strict';var _=require(_0x2952('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2952('0x1'));var BPromise=require(_0x2952('0x2'));var rp=require(_0x2952('0x3'));var fs=require('fs');var path=require(_0x2952('0x4'));var rimraf=require(_0x2952('0x5'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module['exports']=function(_0x21534a,_0xe3d6ca){return _0x21534a[_0x2952('0x6')](_0x2952('0x7'),attributes,{'tableName':_0x2952('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd95=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','define','FaxQueue','fax_queues'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xbd95,0x190));var _0x5bd9=function(_0x18b477,_0x511d11){_0x18b477=_0x18b477-0x0;var _0x4ebd49=_0xbd95[_0x18b477];return _0x4ebd49;};'use strict';var _=require('lodash');var util=require(_0x5bd9('0x0'));var logger=require(_0x5bd9('0x1'))(_0x5bd9('0x2'));var moment=require(_0x5bd9('0x3'));var BPromise=require('bluebird');var rp=require(_0x5bd9('0x4'));var fs=require('fs');var path=require(_0x5bd9('0x5'));var rimraf=require('rimraf');var config=require(_0x5bd9('0x6'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x3e045f,_0x52e6df){return _0x3e045f[_0x5bd9('0x7')](_0x5bd9('0x8'),attributes,{'tableName':_0x5bd9('0x9'),'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 2dc8a4a..07c88a8 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 _0xe47c=['findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowFaxQueue','FaxQueue','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue'];(function(_0x5504f5,_0xf5c1ba){var _0x9933d=function(_0x5bced1){while(--_0x5bced1){_0x5504f5['push'](_0x5504f5['shift']());}};_0x9933d(++_0xf5c1ba);}(_0xe47c,0xfd));var _0xce47=function(_0x5379e1,_0xb43f9a){_0x5379e1=_0x5379e1-0x0;var _0x3bcb8b=_0xe47c[_0x5379e1];return _0x3bcb8b;};'use strict';var _=require(_0xce47('0x0'));var util=require(_0xce47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce47('0x2'));var db=require(_0xce47('0x3'))['db'];var utils=require(_0xce47('0x4'));var logger=require(_0xce47('0x5'))(_0xce47('0x6'));var config=require('../../config/environment');var jayson=require(_0xce47('0x7'));var client=jayson['client'][_0xce47('0x8')]({'port':0x232a});config[_0xce47('0x9')]=_[_0xce47('0xa')](config[_0xce47('0x9')],{'host':_0xce47('0xb'),'port':0x18eb});var socket=require(_0xce47('0xc'))(new Redis(config[_0xce47('0x9')]));require(_0xce47('0xd'))[_0xce47('0xe')](socket);function respondWithRpcPromise(_0x549247,_0xf743e0,_0x53379d){return new BPromise(function(_0x61743e,_0x3a8834){return client['request'](_0x549247,_0x53379d)[_0xce47('0xf')](function(_0x384081){logger[_0xce47('0x10')](_0xce47('0x11'),_0xf743e0,_0xce47('0x12'));logger[_0xce47('0x13')](_0xce47('0x14'),_0xf743e0,_0xce47('0x12'),JSON['stringify'](_0x384081));if(_0x384081[_0xce47('0x15')]){if(_0x384081[_0xce47('0x15')][_0xce47('0x16')]===0x1f4){logger['error'](_0xce47('0x11'),_0xf743e0,_0x384081[_0xce47('0x15')][_0xce47('0x17')]);return _0x3a8834(_0x384081[_0xce47('0x15')][_0xce47('0x17')]);}logger[_0xce47('0x15')]('FaxQueue,\x20%s,\x20%s',_0xf743e0,_0x384081[_0xce47('0x15')][_0xce47('0x17')]);return _0x61743e(_0x384081[_0xce47('0x15')]['message']);}else{logger[_0xce47('0x10')]('FaxQueue,\x20%s,\x20%s',_0xf743e0,'request\x20sent');_0x61743e(_0x384081[_0xce47('0x18')][_0xce47('0x17')]);}})[_0xce47('0x19')](function(_0x534f3f){logger['error']('FaxQueue,\x20%s,\x20%s',_0xf743e0,_0x534f3f);_0x3a8834(_0x534f3f);});});}exports[_0xce47('0x1a')]=function(_0x157935){var _0xf0fe5e=this;return new Promise(function(_0x563911,_0x49e001){return db['FaxQueue'][_0xce47('0x1b')]({'raw':_0x157935[_0xce47('0x1c')]?_0x157935['options'][_0xce47('0x1d')]===undefined?!![]:![]:!![],'where':_0x157935[_0xce47('0x1c')]?_0x157935['options'][_0xce47('0x1e')]||null:null,'attributes':_0x157935['options']?_0x157935[_0xce47('0x1c')][_0xce47('0x1f')]||null:null,'limit':_0x157935['options']?_0x157935[_0xce47('0x1c')][_0xce47('0x20')]||null:null,'include':_0x157935[_0xce47('0x1c')]?_0x157935[_0xce47('0x1c')][_0xce47('0x21')]?_['map'](_0x157935[_0xce47('0x1c')][_0xce47('0x21')],function(_0x3a2baf){return{'model':db[_0x3a2baf[_0xce47('0x22')]],'as':_0x3a2baf['as'],'attributes':_0x3a2baf['attributes'],'include':_0x3a2baf[_0xce47('0x21')]?_[_0xce47('0x23')](_0x3a2baf[_0xce47('0x21')],function(_0x4ff05d){return{'model':db[_0x4ff05d[_0xce47('0x22')]],'as':_0x4ff05d['as'],'attributes':_0x4ff05d[_0xce47('0x1f')],'include':_0x4ff05d[_0xce47('0x21')]?_['map'](_0x4ff05d[_0xce47('0x21')],function(_0x2125af){return{'model':db[_0x2125af[_0xce47('0x22')]],'as':_0x2125af['as'],'attributes':_0x2125af[_0xce47('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xce47('0xf')](function(_0x1a61e9){logger['info']('GetFaxQueue',_0x157935);logger['debug'](_0xce47('0x1a'),_0x157935,JSON[_0xce47('0x24')](_0x1a61e9));_0x563911(_0x1a61e9);})[_0xce47('0x19')](function(_0x5518f1){logger[_0xce47('0x15')](_0xce47('0x1a'),_0x5518f1['message'],_0x157935);_0x49e001(_0xf0fe5e['error'](0x1f4,_0x5518f1[_0xce47('0x17')]));});});};exports[_0xce47('0x25')]=function(_0x235234){var _0x51d466=this;return new Promise(function(_0x1ecc1a,_0x1e2c56){return db[_0xce47('0x26')][_0xce47('0x27')]({'raw':_0x235234[_0xce47('0x1c')]?_0x235234[_0xce47('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x235234[_0xce47('0x1c')]?_0x235234[_0xce47('0x1c')][_0xce47('0x1e')]||null:null,'attributes':_0x235234[_0xce47('0x1c')]?_0x235234[_0xce47('0x1c')]['attributes']||null:null,'include':_0x235234[_0xce47('0x1c')]?_0x235234[_0xce47('0x1c')][_0xce47('0x21')]?_[_0xce47('0x23')](_0x235234[_0xce47('0x1c')][_0xce47('0x21')],function(_0xa4337b){return{'model':db[_0xa4337b[_0xce47('0x22')]],'as':_0xa4337b['as'],'attributes':_0xa4337b[_0xce47('0x1f')],'include':_0xa4337b[_0xce47('0x21')]?_[_0xce47('0x23')](_0xa4337b[_0xce47('0x21')],function(_0x467100){return{'model':db[_0x467100[_0xce47('0x22')]],'as':_0x467100['as'],'attributes':_0x467100[_0xce47('0x1f')],'include':_0x467100[_0xce47('0x21')]?_[_0xce47('0x23')](_0x467100[_0xce47('0x21')],function(_0x4b9e10){return{'model':db[_0x4b9e10[_0xce47('0x22')]],'as':_0x4b9e10['as'],'attributes':_0x4b9e10[_0xce47('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d4023){logger[_0xce47('0x10')](_0xce47('0x25'),_0x235234);logger[_0xce47('0x13')](_0xce47('0x25'),_0x235234,JSON[_0xce47('0x24')](_0x3d4023));_0x1ecc1a(_0x3d4023);})['catch'](function(_0x23673e){logger[_0xce47('0x15')](_0xce47('0x25'),_0x23673e[_0xce47('0x17')],_0x235234);_0x1e2c56(_0x51d466[_0xce47('0x15')](0x1f4,_0x23673e[_0xce47('0x17')]));});});}; \ No newline at end of file +var _0xf179=['jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','attributes','limit','include','model','map','find','where','ShowFaxQueue','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x20b618,_0x9508b2){var _0x49478b=function(_0x38ec4b){while(--_0x38ec4b){_0x20b618['push'](_0x20b618['shift']());}};_0x49478b(++_0x9508b2);}(_0xf179,0x1a6));var _0x9f17=function(_0x248830,_0x2845c0){_0x248830=_0x248830-0x0;var _0x9274d3=_0xf179[_0x248830];return _0x9274d3;};'use strict';var _=require(_0x9f17('0x0'));var util=require(_0x9f17('0x1'));var moment=require(_0x9f17('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f17('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f17('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f17('0x5'))(_0x9f17('0x6'));var config=require('../../config/environment');var jayson=require(_0x9f17('0x7'));var client=jayson[_0x9f17('0x8')][_0x9f17('0x9')]({'port':0x232a});config['redis']=_[_0x9f17('0xa')](config[_0x9f17('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f17('0xc'))(new Redis(config[_0x9f17('0xb')]));require(_0x9f17('0xd'))[_0x9f17('0xe')](socket);function respondWithRpcPromise(_0x372d39,_0x3e6d2a,_0x3077e5){return new BPromise(function(_0x48dd2c,_0x77e535){return client[_0x9f17('0xf')](_0x372d39,_0x3077e5)[_0x9f17('0x10')](function(_0x5efa5b){logger[_0x9f17('0x11')](_0x9f17('0x12'),_0x3e6d2a,'request\x20sent');logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3e6d2a,_0x9f17('0x13'),JSON[_0x9f17('0x14')](_0x5efa5b));if(_0x5efa5b['error']){if(_0x5efa5b[_0x9f17('0x15')][_0x9f17('0x16')]===0x1f4){logger[_0x9f17('0x15')](_0x9f17('0x12'),_0x3e6d2a,_0x5efa5b[_0x9f17('0x15')][_0x9f17('0x17')]);return _0x77e535(_0x5efa5b['error'][_0x9f17('0x17')]);}logger['error'](_0x9f17('0x12'),_0x3e6d2a,_0x5efa5b[_0x9f17('0x15')][_0x9f17('0x17')]);return _0x48dd2c(_0x5efa5b['error'][_0x9f17('0x17')]);}else{logger['info'](_0x9f17('0x12'),_0x3e6d2a,_0x9f17('0x13'));_0x48dd2c(_0x5efa5b[_0x9f17('0x18')][_0x9f17('0x17')]);}})[_0x9f17('0x19')](function(_0x72fd06){logger['error'](_0x9f17('0x12'),_0x3e6d2a,_0x72fd06);_0x77e535(_0x72fd06);});});}exports[_0x9f17('0x1a')]=function(_0x33957e){var _0x1cebe1=this;return new Promise(function(_0x4ef496,_0x478262){return db[_0x9f17('0x1b')]['findAll']({'raw':_0x33957e[_0x9f17('0x1c')]?_0x33957e[_0x9f17('0x1c')][_0x9f17('0x1d')]===undefined?!![]:![]:!![],'where':_0x33957e[_0x9f17('0x1c')]?_0x33957e[_0x9f17('0x1c')]['where']||null:null,'attributes':_0x33957e[_0x9f17('0x1c')]?_0x33957e[_0x9f17('0x1c')][_0x9f17('0x1e')]||null:null,'limit':_0x33957e['options']?_0x33957e['options'][_0x9f17('0x1f')]||null:null,'include':_0x33957e[_0x9f17('0x1c')]?_0x33957e[_0x9f17('0x1c')][_0x9f17('0x20')]?_['map'](_0x33957e[_0x9f17('0x1c')]['include'],function(_0x351500){return{'model':db[_0x351500[_0x9f17('0x21')]],'as':_0x351500['as'],'attributes':_0x351500[_0x9f17('0x1e')],'include':_0x351500[_0x9f17('0x20')]?_[_0x9f17('0x22')](_0x351500[_0x9f17('0x20')],function(_0x1c4e75){return{'model':db[_0x1c4e75[_0x9f17('0x21')]],'as':_0x1c4e75['as'],'attributes':_0x1c4e75[_0x9f17('0x1e')],'include':_0x1c4e75[_0x9f17('0x20')]?_[_0x9f17('0x22')](_0x1c4e75[_0x9f17('0x20')],function(_0x366991){return{'model':db[_0x366991[_0x9f17('0x21')]],'as':_0x366991['as'],'attributes':_0x366991[_0x9f17('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9f17('0x10')](function(_0x56060d){logger[_0x9f17('0x11')](_0x9f17('0x1a'),_0x33957e);logger['debug'](_0x9f17('0x1a'),_0x33957e,JSON[_0x9f17('0x14')](_0x56060d));_0x4ef496(_0x56060d);})[_0x9f17('0x19')](function(_0x3b551a){logger[_0x9f17('0x15')](_0x9f17('0x1a'),_0x3b551a['message'],_0x33957e);_0x478262(_0x1cebe1[_0x9f17('0x15')](0x1f4,_0x3b551a[_0x9f17('0x17')]));});});};exports['ShowFaxQueue']=function(_0x5cc13d){var _0x3db48b=this;return new Promise(function(_0xac3b7e,_0x587caf){return db[_0x9f17('0x1b')][_0x9f17('0x23')]({'raw':_0x5cc13d['options']?_0x5cc13d[_0x9f17('0x1c')][_0x9f17('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cc13d['options']?_0x5cc13d[_0x9f17('0x1c')][_0x9f17('0x24')]||null:null,'attributes':_0x5cc13d[_0x9f17('0x1c')]?_0x5cc13d[_0x9f17('0x1c')][_0x9f17('0x1e')]||null:null,'include':_0x5cc13d[_0x9f17('0x1c')]?_0x5cc13d[_0x9f17('0x1c')][_0x9f17('0x20')]?_['map'](_0x5cc13d[_0x9f17('0x1c')]['include'],function(_0x2b42d9){return{'model':db[_0x2b42d9['model']],'as':_0x2b42d9['as'],'attributes':_0x2b42d9[_0x9f17('0x1e')],'include':_0x2b42d9[_0x9f17('0x20')]?_['map'](_0x2b42d9[_0x9f17('0x20')],function(_0x2ad379){return{'model':db[_0x2ad379[_0x9f17('0x21')]],'as':_0x2ad379['as'],'attributes':_0x2ad379[_0x9f17('0x1e')],'include':_0x2ad379[_0x9f17('0x20')]?_['map'](_0x2ad379['include'],function(_0x45400c){return{'model':db[_0x45400c[_0x9f17('0x21')]],'as':_0x45400c['as'],'attributes':_0x45400c[_0x9f17('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9f17('0x10')](function(_0x306c4){logger['info'](_0x9f17('0x25'),_0x5cc13d);logger[_0x9f17('0x26')](_0x9f17('0x25'),_0x5cc13d,JSON['stringify'](_0x306c4));_0xac3b7e(_0x306c4);})[_0x9f17('0x19')](function(_0x21b2fe){logger[_0x9f17('0x15')]('ShowFaxQueue',_0x21b2fe[_0x9f17('0x17')],_0x5cc13d);_0x587caf(_0x3db48b[_0x9f17('0x15')](0x1f4,_0x21b2fe[_0x9f17('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index e851438..000bd2e 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 _0xcd89=['length','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x59cd93,_0x590532){var _0x4efd8d=function(_0x388661){while(--_0x388661){_0x59cd93['push'](_0x59cd93['shift']());}};_0x4efd8d(++_0x590532);}(_0xcd89,0xe1));var _0x9cd8=function(_0x34af3d,_0xbd593b){_0x34af3d=_0x34af3d-0x0;var _0x83f947=_0xcd89[_0x34af3d];return _0x83f947;};'use strict';var FaxQueueEvents=require(_0x9cd8('0x0'));var events=[_0x9cd8('0x1'),_0x9cd8('0x2'),_0x9cd8('0x3')];function createListener(_0x151245,_0x5269e6){return function(_0x371ddc){_0x5269e6[_0x9cd8('0x4')](_0x151245,_0x371ddc);};}function removeListener(_0x5b8913,_0x2b5a82){return function(){FaxQueueEvents[_0x9cd8('0x5')](_0x5b8913,_0x2b5a82);};}exports[_0x9cd8('0x6')]=function(_0x11b931){for(var _0x43650e=0x0,_0x12ed7a=events[_0x9cd8('0x7')];_0x43650e<_0x12ed7a;_0x43650e++){var _0x171ec7=events[_0x43650e];var _0x3cd37f=createListener('faxQueue:'+_0x171ec7,_0x11b931);FaxQueueEvents['on'](_0x171ec7,_0x3cd37f);}}; \ No newline at end of file +var _0x044c=['emit','removeListener','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x3d3bf4,_0x49629e){var _0x38722f=function(_0xdeb870){while(--_0xdeb870){_0x3d3bf4['push'](_0x3d3bf4['shift']());}};_0x38722f(++_0x49629e);}(_0x044c,0x1d1));var _0xc044=function(_0x5907eb,_0xe735ab){_0x5907eb=_0x5907eb-0x0;var _0x1f28bc=_0x044c[_0x5907eb];return _0x1f28bc;};'use strict';var FaxQueueEvents=require(_0xc044('0x0'));var events=[_0xc044('0x1'),_0xc044('0x2'),_0xc044('0x3')];function createListener(_0x1fba76,_0x10b97c){return function(_0x474f4c){_0x10b97c[_0xc044('0x4')](_0x1fba76,_0x474f4c);};}function removeListener(_0x3bfd41,_0x3c613c){return function(){FaxQueueEvents[_0xc044('0x5')](_0x3bfd41,_0x3c613c);};}exports['register']=function(_0x3f84fc){for(var _0x8a4f6=0x0,_0x1f1194=events['length'];_0x8a4f6<_0x1f1194;_0x8a4f6++){var _0x2c2613=events[_0x8a4f6];var _0x1179b7=createListener(_0xc044('0x6')+_0x2c2613,_0x3f84fc);FaxQueueEvents['on'](_0x2c2613,_0x1179b7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 938fcf5..9bfaae6 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 _0xeda8=['get','isAuthenticated','index','describe','/:id','getMembers','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','/:id/teams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller'];(function(_0x3093de,_0xb5b462){var _0x4e31ab=function(_0x3b69cd){while(--_0x3b69cd){_0x3093de['push'](_0x3093de['shift']());}};_0x4e31ab(++_0xb5b462);}(_0xeda8,0x104));var _0x8eda=function(_0x5f487d,_0x34f88d){_0x5f487d=_0x5f487d-0x0;var _0x403143=_0xeda8[_0x5f487d];return _0x403143;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/describe',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/members',auth[_0x8eda('0xb')](),controller[_0x8eda('0xf')]);router[_0x8eda('0xa')]('/:id/teams',auth[_0x8eda('0xb')](),controller['getTeams']);router[_0x8eda('0xa')](_0x8eda('0x10'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x11')]);router[_0x8eda('0x12')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);router[_0x8eda('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8eda('0x14')]);router[_0x8eda('0x12')]('/:id/users',auth[_0x8eda('0xb')](),controller[_0x8eda('0x15')]);router[_0x8eda('0x16')]('/:id',auth[_0x8eda('0xb')](),controller['update']);router[_0x8eda('0x17')]('/:id',auth[_0x8eda('0xb')](),controller['destroy']);router[_0x8eda('0x17')](_0x8eda('0x18'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x8eda('0x17')](_0x8eda('0x10'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x19')]);module[_0x8eda('0x1a')]=router; \ No newline at end of file +var _0x3f8a=['delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','update'];(function(_0x2fba07,_0x42681a){var _0x3b940f=function(_0x216265){while(--_0x216265){_0x2fba07['push'](_0x2fba07['shift']());}};_0x3b940f(++_0x42681a);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x431b72,_0x4a85be){_0x431b72=_0x431b72-0x0;var _0x16a63c=_0x3f8a[_0x431b72];return _0x16a63c;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xa')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xa')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router['get'](_0xa3f8('0x11'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x12')]);router[_0xa3f8('0xa')]('/:id/teams',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x13')]);router[_0xa3f8('0xa')](_0xa3f8('0x14'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x15')]);router[_0xa3f8('0x16')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x17')]);router[_0xa3f8('0x16')](_0xa3f8('0x18'),auth[_0xa3f8('0xb')](),controller['addTeams']);router[_0xa3f8('0x16')](_0xa3f8('0x14'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x19')]);router['put'](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1a')]);router[_0xa3f8('0x1b')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1c')]);router[_0xa3f8('0x1b')](_0xa3f8('0x18'),auth[_0xa3f8('0xb')](),controller['removeTeams']);router[_0xa3f8('0x1b')]('/:id/users',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x1d')]);module[_0xa3f8('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 74a5f95..73e266d 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 _0x2894=['STRING','DATE','moment','sequelize'];(function(_0x49e6db,_0x1a4546){var _0x5a6137=function(_0xcf3ed9){while(--_0xcf3ed9){_0x49e6db['push'](_0x49e6db['shift']());}};_0x5a6137(++_0x1a4546);}(_0x2894,0xb2));var _0x4289=function(_0x55550f,_0x4311c0){_0x55550f=_0x55550f-0x0;var _0x306237=_0x2894[_0x55550f];return _0x306237;};'use strict';var moment=require(_0x4289('0x0'));var Sequelize=require(_0x4289('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4289('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4289('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4289('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4289('0x3')]},'reason':{'type':Sequelize[_0x4289('0x2')]}}; \ No newline at end of file +var _0xf6f0=['DATE','STRING'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0xf6f0,0x157));var _0x0f6f=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xf6f0[_0xc6be3a];return _0x56a310;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0f6f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x0f6f('0x0')]},'joinAt':{'type':Sequelize[_0x0f6f('0x1')]},'leaveAt':{'type':Sequelize[_0x0f6f('0x1')]},'acceptAt':{'type':Sequelize[_0x0f6f('0x1')]},'exitAt':{'type':Sequelize[_0x0f6f('0x1')]},'reason':{'type':Sequelize[_0x0f6f('0x0')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 56471cf..6718fe4 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 _0x1c4f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName'];(function(_0x43baad,_0x4180d5){var _0x5e2904=function(_0x1042a3){while(--_0x1042a3){_0x43baad['push'](_0x43baad['shift']());}};_0x5e2904(++_0x4180d5);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x1f2a74,_0x476564){_0x1f2a74=_0x1f2a74-0x0;var _0x2849c2=_0x1c4f[_0x1f2a74];return _0x2849c2;};'use strict';var emlformat=require(_0xf1c4('0x0'));var rimraf=require(_0xf1c4('0x1'));var zipdir=require(_0xf1c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1c4('0x3'));var moment=require(_0xf1c4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1c4('0x5'));var util=require(_0xf1c4('0x6'));var path=require(_0xf1c4('0x7'));var sox=require('sox');var csv=require(_0xf1c4('0x8'));var ejs=require(_0xf1c4('0x9'));var fs=require('fs');var fs_extra=require(_0xf1c4('0xa'));var _=require(_0xf1c4('0xb'));var squel=require(_0xf1c4('0xc'));var crypto=require(_0xf1c4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf1c4('0xe'));var toCsv=require(_0xf1c4('0x8'));var querystring=require(_0xf1c4('0xf'));var Papa=require('papaparse');var Redis=require(_0xf1c4('0x10'));var authService=require(_0xf1c4('0x11'));var qs=require(_0xf1c4('0x12'));var as=require(_0xf1c4('0x13'));var hardwareService=require(_0xf1c4('0x14'));var logger=require(_0xf1c4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf1c4('0x16'));var licenseUtil=require(_0xf1c4('0x17'));var db=require(_0xf1c4('0x18'))['db'];function respondWithStatusCode(_0x63cbf4,_0x45e5c3){_0x45e5c3=_0x45e5c3||0xcc;return function(_0x2f7302){if(_0x2f7302){return _0x63cbf4[_0xf1c4('0x19')](_0x45e5c3);}return _0x63cbf4['status'](_0x45e5c3)[_0xf1c4('0x1a')]();};}function respondWithResult(_0x4b1189,_0x2d49ce){_0x2d49ce=_0x2d49ce||0xc8;return function(_0x3c211b){if(_0x3c211b){return _0x4b1189[_0xf1c4('0x1b')](_0x2d49ce)[_0xf1c4('0x1c')](_0x3c211b);}};}function respondWithFilteredResult(_0x390dfa,_0x119d04){return function(_0x30efff){if(_0x30efff){var _0xa294d3=typeof _0x119d04[_0xf1c4('0x1d')]===_0xf1c4('0x1e')&&typeof _0x119d04[_0xf1c4('0x1f')]==='undefined';var _0x3ab930=_0x30efff['count'];var _0x4dd06f=_0xa294d3?0x0:_0x119d04[_0xf1c4('0x1d')];var _0x87cd5f=_0xa294d3?_0x30efff['count']:_0x119d04[_0xf1c4('0x1d')]+_0x119d04[_0xf1c4('0x1f')];var _0x3d6795;if(_0x87cd5f>=_0x3ab930){_0x87cd5f=_0x3ab930;_0x3d6795=0xc8;}else{_0x3d6795=0xce;}_0x390dfa[_0xf1c4('0x1b')](_0x3d6795);return _0x390dfa[_0xf1c4('0x20')](_0xf1c4('0x21'),_0x4dd06f+'-'+_0x87cd5f+'/'+_0x3ab930)['json'](_0x30efff);}return null;};}function patchUpdates(_0x5b48a5){return function(_0x3e8616){try{jsonpatch[_0xf1c4('0x22')](_0x3e8616,_0x5b48a5,!![]);}catch(_0x6dcb98){return BPromise[_0xf1c4('0x23')](_0x6dcb98);}return _0x3e8616[_0xf1c4('0x24')]();};}function saveUpdates(_0x3384f2,_0x20a0ff){return function(_0x4ffb27){if(_0x4ffb27){return _0x4ffb27['update'](_0x3384f2)[_0xf1c4('0x25')](function(_0x496518){return _0x496518;});}return null;};}function removeEntity(_0x4ca299,_0x1e4521){return function(_0x215a62){if(_0x215a62){return _0x215a62['destroy']()[_0xf1c4('0x25')](function(){_0x4ca299['status'](0xcc)[_0xf1c4('0x1a')]();});}};}function handleEntityNotFound(_0x4e351d,_0x1bc59e){return function(_0x286028){if(!_0x286028){_0x4e351d[_0xf1c4('0x19')](0x194);}return _0x286028;};}function handleError(_0x2d6417,_0x1a7440){_0x1a7440=_0x1a7440||0x1f4;return function(_0x6d3d79){logger[_0xf1c4('0x26')](_0x6d3d79[_0xf1c4('0x27')]);if(_0x6d3d79[_0xf1c4('0x28')]){delete _0x6d3d79['name'];}_0x2d6417[_0xf1c4('0x1b')](_0x1a7440)[_0xf1c4('0x29')](_0x6d3d79);};}exports['index']=function(_0x5b51ea,_0x316048){var _0x1f29fe={},_0x30e431={},_0xf16ca3={'count':0x0,'rows':[]};var _0x2dd8f1=_[_0xf1c4('0x2a')](db[_0xf1c4('0x2b')][_0xf1c4('0x2c')],function(_0x451c13){return{'name':_0x451c13[_0xf1c4('0x2d')],'type':_0x451c13[_0xf1c4('0x2e')][_0xf1c4('0x2f')]};});_0x30e431[_0xf1c4('0x30')]=_[_0xf1c4('0x2a')](_0x2dd8f1,'name');_0x30e431[_0xf1c4('0x31')]=_[_0xf1c4('0x32')](_0x5b51ea[_0xf1c4('0x31')]);_0x30e431[_0xf1c4('0x33')]=_[_0xf1c4('0x34')](_0x30e431[_0xf1c4('0x30')],_0x30e431[_0xf1c4('0x31')]);_0x1f29fe[_0xf1c4('0x35')]=_[_0xf1c4('0x34')](_0x30e431[_0xf1c4('0x30')],qs['fields'](_0x5b51ea['query'][_0xf1c4('0x36')]));_0x1f29fe[_0xf1c4('0x35')]=_0x1f29fe[_0xf1c4('0x35')][_0xf1c4('0x37')]?_0x1f29fe[_0xf1c4('0x35')]:_0x30e431['model'];if(!_0x5b51ea[_0xf1c4('0x31')][_0xf1c4('0x38')](_0xf1c4('0x39'))){_0x1f29fe[_0xf1c4('0x1f')]=qs[_0xf1c4('0x1f')](_0x5b51ea[_0xf1c4('0x31')][_0xf1c4('0x1f')]);_0x1f29fe[_0xf1c4('0x1d')]=qs[_0xf1c4('0x1d')](_0x5b51ea[_0xf1c4('0x31')][_0xf1c4('0x1d')]);}_0x1f29fe['order']=qs[_0xf1c4('0x3a')](_0x5b51ea['query'][_0xf1c4('0x3a')]);_0x1f29fe[_0xf1c4('0x3b')]=qs['filters'](_[_0xf1c4('0x3c')](_0x5b51ea[_0xf1c4('0x31')],_0x30e431[_0xf1c4('0x33')]),_0x2dd8f1);if(_0x5b51ea['query']['filter']){_0x1f29fe[_0xf1c4('0x3b')]=_['merge'](_0x1f29fe['where'],{'$or':_[_0xf1c4('0x2a')](_0x2dd8f1,function(_0x96b648){if(_0x96b648[_0xf1c4('0x2e')]!==_0xf1c4('0x3d')){var _0xd557f9={};_0xd557f9[_0x96b648['name']]={'$like':'%'+_0x5b51ea['query'][_0xf1c4('0x3e')]+'%'};return _0xd557f9;}})});}_0x1f29fe=_[_0xf1c4('0x3f')]({},_0x1f29fe,_0x5b51ea[_0xf1c4('0x40')]);var _0x39742d={'where':_0x1f29fe[_0xf1c4('0x3b')]};return db[_0xf1c4('0x2b')]['count'](_0x39742d)['then'](function(_0x441b1b){_0xf16ca3[_0xf1c4('0x41')]=_0x441b1b;if(_0x5b51ea['query'][_0xf1c4('0x42')]){_0x1f29fe[_0xf1c4('0x43')]=[{'all':!![]}];}return db[_0xf1c4('0x2b')][_0xf1c4('0x44')](_0x1f29fe);})[_0xf1c4('0x25')](function(_0x3ef0ef){_0xf16ca3[_0xf1c4('0x45')]=_0x3ef0ef;return _0xf16ca3;})[_0xf1c4('0x25')](respondWithFilteredResult(_0x316048,_0x1f29fe))[_0xf1c4('0x46')](handleError(_0x316048,null));};exports[_0xf1c4('0x47')]=function(_0x1212ba,_0x2a8adc){var _0x597f85={'raw':!![],'where':{'id':_0x1212ba[_0xf1c4('0x48')]['id']}},_0x141521={};_0x141521['model']=_[_0xf1c4('0x32')](db['FaxQueueReport'][_0xf1c4('0x2c')]);_0x141521[_0xf1c4('0x31')]=_[_0xf1c4('0x32')](_0x1212ba[_0xf1c4('0x31')]);_0x141521['filters']=_[_0xf1c4('0x34')](_0x141521[_0xf1c4('0x30')],_0x141521[_0xf1c4('0x31')]);_0x597f85[_0xf1c4('0x35')]=_[_0xf1c4('0x34')](_0x141521[_0xf1c4('0x30')],qs[_0xf1c4('0x36')](_0x1212ba[_0xf1c4('0x31')]['fields']));_0x597f85[_0xf1c4('0x35')]=_0x597f85[_0xf1c4('0x35')][_0xf1c4('0x37')]?_0x597f85[_0xf1c4('0x35')]:_0x141521[_0xf1c4('0x30')];if(_0x1212ba[_0xf1c4('0x31')][_0xf1c4('0x42')]){_0x597f85['include']=[{'all':!![]}];}_0x597f85=_['merge']({},_0x597f85,_0x1212ba['options']);return db['FaxQueueReport'][_0xf1c4('0x49')](_0x597f85)[_0xf1c4('0x25')](handleEntityNotFound(_0x2a8adc,null))[_0xf1c4('0x25')](respondWithResult(_0x2a8adc,null))[_0xf1c4('0x46')](handleError(_0x2a8adc,null));};exports[_0xf1c4('0x4a')]=function(_0x10c159,_0x5dd946){return db[_0xf1c4('0x2b')][_0xf1c4('0x4a')](_0x10c159[_0xf1c4('0x4b')],{})['then'](respondWithResult(_0x5dd946,0xc9))[_0xf1c4('0x46')](handleError(_0x5dd946,null));};exports['update']=function(_0x383591,_0x1e1ba9){if(_0x383591[_0xf1c4('0x4b')]['id']){delete _0x383591[_0xf1c4('0x4b')]['id'];}return db[_0xf1c4('0x2b')]['find']({'where':{'id':_0x383591[_0xf1c4('0x48')]['id']}})[_0xf1c4('0x25')](handleEntityNotFound(_0x1e1ba9,null))[_0xf1c4('0x25')](saveUpdates(_0x383591[_0xf1c4('0x4b')],null))[_0xf1c4('0x25')](respondWithResult(_0x1e1ba9,null))[_0xf1c4('0x46')](handleError(_0x1e1ba9,null));};exports[_0xf1c4('0x4c')]=function(_0x5c5c05,_0x3fe99e){return db[_0xf1c4('0x2b')][_0xf1c4('0x49')]({'where':{'id':_0x5c5c05[_0xf1c4('0x48')]['id']}})[_0xf1c4('0x25')](handleEntityNotFound(_0x3fe99e,null))['then'](removeEntity(_0x3fe99e,null))[_0xf1c4('0x46')](handleError(_0x3fe99e,null));};exports[_0xf1c4('0x4d')]=function(_0x3a4cb8,_0x6221f7){return db[_0xf1c4('0x2b')]['describe']()['then'](respondWithResult(_0x6221f7,null))['catch'](handleError(_0x6221f7,null));}; \ No newline at end of file +var _0x26bc=['Content-Range','apply','reject','update','then','sendStatus','stack','name','send','FaxQueueReport','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x26bc,0x162));var _0xc26b=function(_0x1bc08e,_0xc6d702){_0x1bc08e=_0x1bc08e-0x0;var _0x5e1b8f=_0x26bc[_0x1bc08e];return _0x5e1b8f;};'use strict';var emlformat=require(_0xc26b('0x0'));var rimraf=require(_0xc26b('0x1'));var zipdir=require(_0xc26b('0x2'));var jsonpatch=require(_0xc26b('0x3'));var rp=require(_0xc26b('0x4'));var moment=require('moment');var BPromise=require(_0xc26b('0x5'));var Mustache=require(_0xc26b('0x6'));var util=require(_0xc26b('0x7'));var path=require('path');var sox=require(_0xc26b('0x8'));var csv=require('to-csv');var ejs=require(_0xc26b('0x9'));var fs=require('fs');var fs_extra=require(_0xc26b('0xa'));var _=require(_0xc26b('0xb'));var squel=require('squel');var crypto=require(_0xc26b('0xc'));var jsforce=require(_0xc26b('0xd'));var deskjs=require(_0xc26b('0xe'));var toCsv=require(_0xc26b('0xf'));var querystring=require(_0xc26b('0x10'));var Papa=require(_0xc26b('0x11'));var Redis=require(_0xc26b('0x12'));var authService=require(_0xc26b('0x13'));var qs=require(_0xc26b('0x14'));var as=require(_0xc26b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc26b('0x16'))(_0xc26b('0x17'));var utils=require(_0xc26b('0x18'));var config=require(_0xc26b('0x19'));var licenseUtil=require(_0xc26b('0x1a'));var db=require(_0xc26b('0x1b'))['db'];function respondWithStatusCode(_0x5c9ca1,_0x3d0813){_0x3d0813=_0x3d0813||0xcc;return function(_0x5a95fc){if(_0x5a95fc){return _0x5c9ca1['sendStatus'](_0x3d0813);}return _0x5c9ca1[_0xc26b('0x1c')](_0x3d0813)[_0xc26b('0x1d')]();};}function respondWithResult(_0x21f711,_0x27d81c){_0x27d81c=_0x27d81c||0xc8;return function(_0x4b692b){if(_0x4b692b){return _0x21f711[_0xc26b('0x1c')](_0x27d81c)[_0xc26b('0x1e')](_0x4b692b);}};}function respondWithFilteredResult(_0x19be02,_0x5bd8c4){return function(_0x20f796){if(_0x20f796){var _0x34e006=typeof _0x5bd8c4['offset']===_0xc26b('0x1f')&&typeof _0x5bd8c4[_0xc26b('0x20')]==='undefined';var _0x1dba27=_0x20f796['count'];var _0x4802c7=_0x34e006?0x0:_0x5bd8c4[_0xc26b('0x21')];var _0x47e75b=_0x34e006?_0x20f796[_0xc26b('0x22')]:_0x5bd8c4[_0xc26b('0x21')]+_0x5bd8c4[_0xc26b('0x20')];var _0x9d9098;if(_0x47e75b>=_0x1dba27){_0x47e75b=_0x1dba27;_0x9d9098=0xc8;}else{_0x9d9098=0xce;}_0x19be02['status'](_0x9d9098);return _0x19be02[_0xc26b('0x23')](_0xc26b('0x24'),_0x4802c7+'-'+_0x47e75b+'/'+_0x1dba27)[_0xc26b('0x1e')](_0x20f796);}return null;};}function patchUpdates(_0x8531d6){return function(_0x3fb860){try{jsonpatch[_0xc26b('0x25')](_0x3fb860,_0x8531d6,!![]);}catch(_0x4f90f3){return BPromise[_0xc26b('0x26')](_0x4f90f3);}return _0x3fb860['save']();};}function saveUpdates(_0x1f8240,_0x129080){return function(_0x282928){if(_0x282928){return _0x282928[_0xc26b('0x27')](_0x1f8240)['then'](function(_0x261d3c){return _0x261d3c;});}return null;};}function removeEntity(_0x297286,_0x176f29){return function(_0x465bdd){if(_0x465bdd){return _0x465bdd['destroy']()[_0xc26b('0x28')](function(){_0x297286[_0xc26b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c0095,_0x203374){return function(_0x1bb8e5){if(!_0x1bb8e5){_0x4c0095[_0xc26b('0x29')](0x194);}return _0x1bb8e5;};}function handleError(_0x59b15a,_0x33e752){_0x33e752=_0x33e752||0x1f4;return function(_0x20a84f){logger['error'](_0x20a84f[_0xc26b('0x2a')]);if(_0x20a84f['name']){delete _0x20a84f[_0xc26b('0x2b')];}_0x59b15a[_0xc26b('0x1c')](_0x33e752)[_0xc26b('0x2c')](_0x20a84f);};}exports['index']=function(_0x1f7d2e,_0x3459d3){var _0x17c93e={},_0x1dd5d4={},_0x34148e={'count':0x0,'rows':[]};var _0x2a9d83=_['map'](db[_0xc26b('0x2d')]['rawAttributes'],function(_0x2f7db7){return{'name':_0x2f7db7['fieldName'],'type':_0x2f7db7['type'][_0xc26b('0x2e')]};});_0x1dd5d4[_0xc26b('0x2f')]=_[_0xc26b('0x30')](_0x2a9d83,'name');_0x1dd5d4[_0xc26b('0x31')]=_[_0xc26b('0x32')](_0x1f7d2e['query']);_0x1dd5d4[_0xc26b('0x33')]=_[_0xc26b('0x34')](_0x1dd5d4[_0xc26b('0x2f')],_0x1dd5d4[_0xc26b('0x31')]);_0x17c93e[_0xc26b('0x35')]=_[_0xc26b('0x34')](_0x1dd5d4[_0xc26b('0x2f')],qs[_0xc26b('0x36')](_0x1f7d2e[_0xc26b('0x31')][_0xc26b('0x36')]));_0x17c93e['attributes']=_0x17c93e[_0xc26b('0x35')]['length']?_0x17c93e[_0xc26b('0x35')]:_0x1dd5d4[_0xc26b('0x2f')];if(!_0x1f7d2e['query'][_0xc26b('0x37')](_0xc26b('0x38'))){_0x17c93e[_0xc26b('0x20')]=qs[_0xc26b('0x20')](_0x1f7d2e[_0xc26b('0x31')][_0xc26b('0x20')]);_0x17c93e[_0xc26b('0x21')]=qs[_0xc26b('0x21')](_0x1f7d2e[_0xc26b('0x31')][_0xc26b('0x21')]);}_0x17c93e['order']=qs[_0xc26b('0x39')](_0x1f7d2e[_0xc26b('0x31')][_0xc26b('0x39')]);_0x17c93e[_0xc26b('0x3a')]=qs[_0xc26b('0x33')](_[_0xc26b('0x3b')](_0x1f7d2e[_0xc26b('0x31')],_0x1dd5d4[_0xc26b('0x33')]),_0x2a9d83);if(_0x1f7d2e[_0xc26b('0x31')][_0xc26b('0x3c')]){_0x17c93e[_0xc26b('0x3a')]=_[_0xc26b('0x3d')](_0x17c93e[_0xc26b('0x3a')],{'$or':_[_0xc26b('0x30')](_0x2a9d83,function(_0x2c1a4c){if(_0x2c1a4c['type']!==_0xc26b('0x3e')){var _0x49e7ff={};_0x49e7ff[_0x2c1a4c[_0xc26b('0x2b')]]={'$like':'%'+_0x1f7d2e[_0xc26b('0x31')]['filter']+'%'};return _0x49e7ff;}})});}_0x17c93e=_['merge']({},_0x17c93e,_0x1f7d2e[_0xc26b('0x3f')]);var _0x4143fb={'where':_0x17c93e[_0xc26b('0x3a')]};return db['FaxQueueReport']['count'](_0x4143fb)[_0xc26b('0x28')](function(_0x458d49){_0x34148e[_0xc26b('0x22')]=_0x458d49;if(_0x1f7d2e[_0xc26b('0x31')][_0xc26b('0x40')]){_0x17c93e[_0xc26b('0x41')]=[{'all':!![]}];}return db[_0xc26b('0x2d')][_0xc26b('0x42')](_0x17c93e);})[_0xc26b('0x28')](function(_0x13f760){_0x34148e[_0xc26b('0x43')]=_0x13f760;return _0x34148e;})['then'](respondWithFilteredResult(_0x3459d3,_0x17c93e))[_0xc26b('0x44')](handleError(_0x3459d3,null));};exports[_0xc26b('0x45')]=function(_0x1995e9,_0x188017){var _0x494e4b={'raw':!![],'where':{'id':_0x1995e9[_0xc26b('0x46')]['id']}},_0x5e0abc={};_0x5e0abc['model']=_[_0xc26b('0x32')](db[_0xc26b('0x2d')][_0xc26b('0x47')]);_0x5e0abc[_0xc26b('0x31')]=_[_0xc26b('0x32')](_0x1995e9[_0xc26b('0x31')]);_0x5e0abc[_0xc26b('0x33')]=_['intersection'](_0x5e0abc['model'],_0x5e0abc[_0xc26b('0x31')]);_0x494e4b[_0xc26b('0x35')]=_[_0xc26b('0x34')](_0x5e0abc[_0xc26b('0x2f')],qs['fields'](_0x1995e9[_0xc26b('0x31')]['fields']));_0x494e4b[_0xc26b('0x35')]=_0x494e4b[_0xc26b('0x35')][_0xc26b('0x48')]?_0x494e4b[_0xc26b('0x35')]:_0x5e0abc[_0xc26b('0x2f')];if(_0x1995e9['query'][_0xc26b('0x40')]){_0x494e4b['include']=[{'all':!![]}];}_0x494e4b=_[_0xc26b('0x3d')]({},_0x494e4b,_0x1995e9[_0xc26b('0x3f')]);return db[_0xc26b('0x2d')][_0xc26b('0x49')](_0x494e4b)['then'](handleEntityNotFound(_0x188017,null))['then'](respondWithResult(_0x188017,null))[_0xc26b('0x44')](handleError(_0x188017,null));};exports['create']=function(_0x566d77,_0x268903){return db[_0xc26b('0x2d')][_0xc26b('0x4a')](_0x566d77[_0xc26b('0x4b')],{})[_0xc26b('0x28')](respondWithResult(_0x268903,0xc9))[_0xc26b('0x44')](handleError(_0x268903,null));};exports[_0xc26b('0x27')]=function(_0x16933f,_0x3bef7f){if(_0x16933f[_0xc26b('0x4b')]['id']){delete _0x16933f[_0xc26b('0x4b')]['id'];}return db[_0xc26b('0x2d')][_0xc26b('0x49')]({'where':{'id':_0x16933f[_0xc26b('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bef7f,null))['then'](saveUpdates(_0x16933f[_0xc26b('0x4b')],null))[_0xc26b('0x28')](respondWithResult(_0x3bef7f,null))[_0xc26b('0x44')](handleError(_0x3bef7f,null));};exports[_0xc26b('0x4c')]=function(_0x51448d,_0x1aa08f){return db['FaxQueueReport'][_0xc26b('0x49')]({'where':{'id':_0x51448d[_0xc26b('0x46')]['id']}})['then'](handleEntityNotFound(_0x1aa08f,null))[_0xc26b('0x28')](removeEntity(_0x1aa08f,null))['catch'](handleError(_0x1aa08f,null));};exports['describe']=function(_0x49f06c,_0x4c63ed){return db[_0xc26b('0x2d')][_0xc26b('0x4d')]()[_0xc26b('0x28')](respondWithResult(_0x4c63ed,null))[_0xc26b('0x44')](handleError(_0x4c63ed,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index fc9fdd0..811858e 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 _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x5a860,_0x5f542d){var _0x47f5f8=function(_0x3801e0){while(--_0x3801e0){_0x5a860['push'](_0x5a860['shift']());}};_0x47f5f8(++_0x5f542d);}(_0xf494,0x1c6));var _0x4f49=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xf494[_0x28394f];return _0x2618d2;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x1779e4,_0x3f8bbe){var _0x4970dd=function(_0x2332de){while(--_0x2332de){_0x1779e4['push'](_0x1779e4['shift']());}};_0x4970dd(++_0x3f8bbe);}(_0x5fab,0x177));var _0xb5fa=function(_0x3b33a4,_0x5ae448){_0x3b33a4=_0x3b33a4-0x0;var _0x2e9389=_0x5fab[_0x3b33a4];return _0x2e9389;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'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 c1a821a..de1b6c4 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 _0xc8e9=['limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxQueueReport','create','body','options','raw','then','CreateFaxQueueReport','debug','UpdateFaxQueueReport','where','attributes'];(function(_0x1c18c4,_0x2542a2){var _0x1613ca=function(_0x369cb3){while(--_0x369cb3){_0x1c18c4['push'](_0x1c18c4['shift']());}};_0x1613ca(++_0x2542a2);}(_0xc8e9,0x1bc));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9c8e('0x0'));var util=require(_0x9c8e('0x1'));var moment=require(_0x9c8e('0x2'));var BPromise=require(_0x9c8e('0x3'));var rs=require(_0x9c8e('0x4'));var fs=require('fs');var Redis=require(_0x9c8e('0x5'));var db=require(_0x9c8e('0x6'))['db'];var utils=require(_0x9c8e('0x7'));var logger=require(_0x9c8e('0x8'))(_0x9c8e('0x9'));var config=require(_0x9c8e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9c8e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25d022,_0x319362,_0xa1a586){return new BPromise(function(_0x53dd41,_0xc2f58c){return client[_0x9c8e('0xc')](_0x25d022,_0xa1a586)['then'](function(_0x39133b){logger[_0x9c8e('0xd')](_0x9c8e('0xe'),_0x319362,_0x9c8e('0xf'));logger['debug'](_0x9c8e('0x10'),_0x319362,_0x9c8e('0xf'),JSON[_0x9c8e('0x11')](_0x39133b));if(_0x39133b[_0x9c8e('0x12')]){if(_0x39133b['error']['code']===0x1f4){logger[_0x9c8e('0x12')](_0x9c8e('0xe'),_0x319362,_0x39133b['error'][_0x9c8e('0x13')]);return _0xc2f58c(_0x39133b['error'][_0x9c8e('0x13')]);}logger[_0x9c8e('0x12')](_0x9c8e('0xe'),_0x319362,_0x39133b[_0x9c8e('0x12')][_0x9c8e('0x13')]);return _0x53dd41(_0x39133b['error'][_0x9c8e('0x13')]);}else{logger[_0x9c8e('0xd')](_0x9c8e('0xe'),_0x319362,_0x9c8e('0xf'));_0x53dd41(_0x39133b[_0x9c8e('0x14')][_0x9c8e('0x13')]);}})['catch'](function(_0x261f2c){logger[_0x9c8e('0x12')](_0x9c8e('0xe'),_0x319362,_0x261f2c);_0xc2f58c(_0x261f2c);});});}exports['CreateFaxQueueReport']=function(_0x433163){var _0x49d1a7=this;return new Promise(function(_0x123e08,_0x5827d3){return db[_0x9c8e('0x15')][_0x9c8e('0x16')](_0x433163[_0x9c8e('0x17')],{'raw':_0x433163[_0x9c8e('0x18')]?_0x433163[_0x9c8e('0x18')][_0x9c8e('0x19')]===undefined?!![]:![]:!![]})[_0x9c8e('0x1a')](function(_0x35f392){logger[_0x9c8e('0xd')](_0x9c8e('0x1b'),_0x433163);logger[_0x9c8e('0x1c')](_0x9c8e('0x1b'),_0x433163,JSON['stringify'](_0x35f392));_0x123e08(_0x35f392);})['catch'](function(_0x17748a){logger[_0x9c8e('0x12')](_0x9c8e('0x1b'),_0x17748a[_0x9c8e('0x13')],_0x433163);_0x5827d3(_0x49d1a7[_0x9c8e('0x12')](0x1f4,_0x17748a['message']));});});};exports[_0x9c8e('0x1d')]=function(_0x24733a){var _0x1b5b3e=this;return new Promise(function(_0x5efe82,_0x3c7462){return db[_0x9c8e('0x15')]['update'](_0x24733a['body'],{'raw':_0x24733a[_0x9c8e('0x18')]?_0x24733a[_0x9c8e('0x18')][_0x9c8e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24733a[_0x9c8e('0x18')]?_0x24733a[_0x9c8e('0x18')][_0x9c8e('0x1e')]||null:null,'attributes':_0x24733a['options']?_0x24733a[_0x9c8e('0x18')][_0x9c8e('0x1f')]||null:null,'limit':_0x24733a['options']?_0x24733a[_0x9c8e('0x18')][_0x9c8e('0x20')]||null:null})['then'](function(_0x392c1f){logger['info'](_0x9c8e('0x1d'),_0x24733a);logger[_0x9c8e('0x1c')](_0x9c8e('0x1d'),_0x24733a,JSON[_0x9c8e('0x11')](_0x392c1f));_0x5efe82(_0x392c1f);})[_0x9c8e('0x21')](function(_0x24d62e){logger[_0x9c8e('0x12')](_0x9c8e('0x1d'),_0x24d62e[_0x9c8e('0x13')],_0x24733a);_0x3c7462(_0x1b5b3e[_0x9c8e('0x12')](0x1f4,_0x24d62e[_0x9c8e('0x13')]));});});}; \ No newline at end of file +var _0x23b7=['attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','stringify','UpdateFaxQueueReport','update','body','raw'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x23b7,0x1ae));var _0x723b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23b7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x723b('0x0'));var util=require(_0x723b('0x1'));var moment=require(_0x723b('0x2'));var BPromise=require(_0x723b('0x3'));var rs=require(_0x723b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x723b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x723b('0x6'))(_0x723b('0x7'));var config=require(_0x723b('0x8'));var jayson=require(_0x723b('0x9'));var client=jayson[_0x723b('0xa')][_0x723b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x567d15,_0x2125c7,_0x27fa44){return new BPromise(function(_0x128fe8,_0x5754c1){return client[_0x723b('0xc')](_0x567d15,_0x27fa44)[_0x723b('0xd')](function(_0x3dd0d6){logger[_0x723b('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x2125c7,_0x723b('0xf'));logger[_0x723b('0x10')](_0x723b('0x11'),_0x2125c7,_0x723b('0xf'),JSON['stringify'](_0x3dd0d6));if(_0x3dd0d6[_0x723b('0x12')]){if(_0x3dd0d6[_0x723b('0x12')]['code']===0x1f4){logger[_0x723b('0x12')](_0x723b('0x13'),_0x2125c7,_0x3dd0d6[_0x723b('0x12')]['message']);return _0x5754c1(_0x3dd0d6[_0x723b('0x12')][_0x723b('0x14')]);}logger[_0x723b('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2125c7,_0x3dd0d6['error'][_0x723b('0x14')]);return _0x128fe8(_0x3dd0d6[_0x723b('0x12')][_0x723b('0x14')]);}else{logger['info'](_0x723b('0x13'),_0x2125c7,_0x723b('0xf'));_0x128fe8(_0x3dd0d6[_0x723b('0x15')][_0x723b('0x14')]);}})[_0x723b('0x16')](function(_0x3727bd){logger[_0x723b('0x12')](_0x723b('0x13'),_0x2125c7,_0x3727bd);_0x5754c1(_0x3727bd);});});}exports[_0x723b('0x17')]=function(_0x42ca65){var _0x815b97=this;return new Promise(function(_0x234c3a,_0x486073){return db[_0x723b('0x18')][_0x723b('0x19')](_0x42ca65['body'],{'raw':_0x42ca65['options']?_0x42ca65[_0x723b('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x723b('0xd')](function(_0x40249d){logger[_0x723b('0xe')](_0x723b('0x17'),_0x42ca65);logger['debug']('CreateFaxQueueReport',_0x42ca65,JSON[_0x723b('0x1b')](_0x40249d));_0x234c3a(_0x40249d);})[_0x723b('0x16')](function(_0xd1508){logger[_0x723b('0x12')](_0x723b('0x17'),_0xd1508[_0x723b('0x14')],_0x42ca65);_0x486073(_0x815b97[_0x723b('0x12')](0x1f4,_0xd1508['message']));});});};exports[_0x723b('0x1c')]=function(_0x5c455e){var _0x4ee897=this;return new Promise(function(_0x3e6099,_0x29d70f){return db[_0x723b('0x18')][_0x723b('0x1d')](_0x5c455e[_0x723b('0x1e')],{'raw':_0x5c455e[_0x723b('0x1a')]?_0x5c455e['options'][_0x723b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c455e[_0x723b('0x1a')]?_0x5c455e[_0x723b('0x1a')]['where']||null:null,'attributes':_0x5c455e[_0x723b('0x1a')]?_0x5c455e[_0x723b('0x1a')][_0x723b('0x20')]||null:null,'limit':_0x5c455e['options']?_0x5c455e[_0x723b('0x1a')]['limit']||null:null})[_0x723b('0xd')](function(_0x2d46ae){logger['info']('UpdateFaxQueueReport',_0x5c455e);logger[_0x723b('0x10')](_0x723b('0x1c'),_0x5c455e,JSON[_0x723b('0x1b')](_0x2d46ae));_0x3e6099(_0x2d46ae);})['catch'](function(_0x1aa56d){logger['error'](_0x723b('0x1c'),_0x1aa56d[_0x723b('0x14')],_0x5c455e);_0x29d70f(_0x4ee897['error'](0x1f4,_0x1aa56d['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d7ed70b..2ec496e 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 _0xafb6=['exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy'];(function(_0x35ecfc,_0xa522ae){var _0x5d759d=function(_0x51bf48){while(--_0x51bf48){_0x35ecfc['push'](_0x35ecfc['shift']());}};_0x5d759d(++_0xa522ae);}(_0xafb6,0xe5));var _0x6afb=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0xafb6[_0xf89c3];return _0x274fc8;};'use strict';var multer=require(_0x6afb('0x0'));var util=require(_0x6afb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6afb('0x2'));var router=express['Router']();var fs_extra=require(_0x6afb('0x3'));var auth=require(_0x6afb('0x4'));var interaction=require(_0x6afb('0x5'));var config=require(_0x6afb('0x6'));var controller=require(_0x6afb('0x7'));router['get']('/',auth[_0x6afb('0x8')](),controller[_0x6afb('0x9')]);router['get'](_0x6afb('0xa'),auth[_0x6afb('0x8')](),controller['describe']);router['get'](_0x6afb('0xb'),auth['isAuthenticated'](),controller[_0x6afb('0xc')]);router['post']('/',auth[_0x6afb('0x8')](),controller[_0x6afb('0xd')]);router[_0x6afb('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6afb('0xf')]);router[_0x6afb('0x10')](_0x6afb('0xb'),auth[_0x6afb('0x8')](),controller[_0x6afb('0x11')]);module[_0x6afb('0x12')]=router; \ No newline at end of file +var _0x8b72=['path','express','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x8b72,0xb2));var _0x28b7=function(_0x30b92a,_0x156760){_0x30b92a=_0x30b92a-0x0;var _0x5107f9=_0x8b72[_0x30b92a];return _0x5107f9;};'use strict';var multer=require(_0x28b7('0x0'));var util=require(_0x28b7('0x1'));var path=require(_0x28b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x28b7('0x3'));var router=express[_0x28b7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x28b7('0x5'));var config=require(_0x28b7('0x6'));var controller=require(_0x28b7('0x7'));router[_0x28b7('0x8')]('/',auth['isAuthenticated'](),controller[_0x28b7('0x9')]);router[_0x28b7('0x8')](_0x28b7('0xa'),auth['isAuthenticated'](),controller[_0x28b7('0xb')]);router['get'](_0x28b7('0xc'),auth[_0x28b7('0xd')](),controller[_0x28b7('0xe')]);router[_0x28b7('0xf')]('/',auth['isAuthenticated'](),controller[_0x28b7('0x10')]);router[_0x28b7('0x11')](_0x28b7('0xc'),auth[_0x28b7('0xd')](),controller['update']);router['delete'](_0x28b7('0xc'),auth[_0x28b7('0xd')](),controller[_0x28b7('0x12')]);module[_0x28b7('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index d6262c6..11a5752 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4e80c3,_0x45498f){var _0x5710fe=function(_0x4a268c){while(--_0x4a268c){_0x4e80c3['push'](_0x4e80c3['shift']());}};_0x5710fe(++_0x45498f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0xcb91[_0x492535];return _0x256620;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5cdf85,_0x4f5610){var _0x109a19=function(_0x97db52){while(--_0x97db52){_0x5cdf85['push'](_0x5cdf85['shift']());}};_0x109a19(++_0x4f5610);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 093bc1c..3097667 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 _0x8b3a=['sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','FaxTransferReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','show','includeAll','include','options','find','body','catch','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x8b3a,0x123));var _0xa8b3=function(_0x3ab928,_0x2b990b){_0x3ab928=_0x3ab928-0x0;var _0xf47692=_0x8b3a[_0x3ab928];return _0xf47692;};'use strict';var emlformat=require(_0xa8b3('0x0'));var rimraf=require(_0xa8b3('0x1'));var zipdir=require(_0xa8b3('0x2'));var jsonpatch=require(_0xa8b3('0x3'));var rp=require(_0xa8b3('0x4'));var moment=require(_0xa8b3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa8b3('0x6'));var util=require(_0xa8b3('0x7'));var path=require(_0xa8b3('0x8'));var sox=require(_0xa8b3('0x9'));var csv=require(_0xa8b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8b3('0xb'));var _=require(_0xa8b3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa8b3('0xd'));var deskjs=require(_0xa8b3('0xe'));var toCsv=require(_0xa8b3('0xa'));var querystring=require(_0xa8b3('0xf'));var Papa=require('papaparse');var Redis=require(_0xa8b3('0x10'));var authService=require(_0xa8b3('0x11'));var qs=require(_0xa8b3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8b3('0x13'));var logger=require('../../config/logger')(_0xa8b3('0x14'));var utils=require(_0xa8b3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa8b3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd27531,_0x405c9c){_0x405c9c=_0x405c9c||0xcc;return function(_0x237525){if(_0x237525){return _0xd27531[_0xa8b3('0x17')](_0x405c9c);}return _0xd27531['status'](_0x405c9c)[_0xa8b3('0x18')]();};}function respondWithResult(_0x3e59d4,_0x3d5d82){_0x3d5d82=_0x3d5d82||0xc8;return function(_0x22e50e){if(_0x22e50e){return _0x3e59d4[_0xa8b3('0x19')](_0x3d5d82)['json'](_0x22e50e);}};}function respondWithFilteredResult(_0x5ddbc9,_0x14dc94){return function(_0x14d6a8){if(_0x14d6a8){var _0x65191e=typeof _0x14dc94[_0xa8b3('0x1a')]===_0xa8b3('0x1b')&&typeof _0x14dc94['limit']==='undefined';var _0x576cdb=_0x14d6a8[_0xa8b3('0x1c')];var _0x2464b4=_0x65191e?0x0:_0x14dc94['offset'];var _0x470609=_0x65191e?_0x14d6a8[_0xa8b3('0x1c')]:_0x14dc94[_0xa8b3('0x1a')]+_0x14dc94[_0xa8b3('0x1d')];var _0x4f06cf;if(_0x470609>=_0x576cdb){_0x470609=_0x576cdb;_0x4f06cf=0xc8;}else{_0x4f06cf=0xce;}_0x5ddbc9[_0xa8b3('0x19')](_0x4f06cf);return _0x5ddbc9[_0xa8b3('0x1e')](_0xa8b3('0x1f'),_0x2464b4+'-'+_0x470609+'/'+_0x576cdb)[_0xa8b3('0x20')](_0x14d6a8);}return null;};}function patchUpdates(_0x774754){return function(_0x90c0c0){try{jsonpatch[_0xa8b3('0x21')](_0x90c0c0,_0x774754,!![]);}catch(_0x2d6494){return BPromise[_0xa8b3('0x22')](_0x2d6494);}return _0x90c0c0[_0xa8b3('0x23')]();};}function saveUpdates(_0x1d4b19,_0xd37f76){return function(_0x4d82dc){if(_0x4d82dc){return _0x4d82dc['update'](_0x1d4b19)[_0xa8b3('0x24')](function(_0x5a8187){return _0x5a8187;});}return null;};}function removeEntity(_0x4192e9,_0xda78b9){return function(_0x2476fd){if(_0x2476fd){return _0x2476fd[_0xa8b3('0x25')]()[_0xa8b3('0x24')](function(){_0x4192e9['status'](0xcc)[_0xa8b3('0x18')]();});}};}function handleEntityNotFound(_0x2598d2,_0x13f198){return function(_0x3312b8){if(!_0x3312b8){_0x2598d2[_0xa8b3('0x17')](0x194);}return _0x3312b8;};}function handleError(_0x504b38,_0xda7459){_0xda7459=_0xda7459||0x1f4;return function(_0x522ad3){logger[_0xa8b3('0x26')](_0x522ad3[_0xa8b3('0x27')]);if(_0x522ad3[_0xa8b3('0x28')]){delete _0x522ad3[_0xa8b3('0x28')];}_0x504b38[_0xa8b3('0x19')](_0xda7459)[_0xa8b3('0x29')](_0x522ad3);};}exports[_0xa8b3('0x2a')]=function(_0x475bae,_0x17cd21){var _0x1ca8c4={},_0x57f2ee={},_0x3d084b={'count':0x0,'rows':[]};var _0x5b30f9=_['map'](db[_0xa8b3('0x2b')][_0xa8b3('0x2c')],function(_0x33b032){return{'name':_0x33b032['fieldName'],'type':_0x33b032[_0xa8b3('0x2d')][_0xa8b3('0x2e')]};});_0x57f2ee['model']=_[_0xa8b3('0x2f')](_0x5b30f9,'name');_0x57f2ee[_0xa8b3('0x30')]=_[_0xa8b3('0x31')](_0x475bae[_0xa8b3('0x30')]);_0x57f2ee[_0xa8b3('0x32')]=_[_0xa8b3('0x33')](_0x57f2ee[_0xa8b3('0x34')],_0x57f2ee[_0xa8b3('0x30')]);_0x1ca8c4[_0xa8b3('0x35')]=_['intersection'](_0x57f2ee['model'],qs['fields'](_0x475bae[_0xa8b3('0x30')][_0xa8b3('0x36')]));_0x1ca8c4[_0xa8b3('0x35')]=_0x1ca8c4[_0xa8b3('0x35')][_0xa8b3('0x37')]?_0x1ca8c4['attributes']:_0x57f2ee[_0xa8b3('0x34')];if(!_0x475bae[_0xa8b3('0x30')][_0xa8b3('0x38')](_0xa8b3('0x39'))){_0x1ca8c4[_0xa8b3('0x1d')]=qs['limit'](_0x475bae['query'][_0xa8b3('0x1d')]);_0x1ca8c4['offset']=qs[_0xa8b3('0x1a')](_0x475bae[_0xa8b3('0x30')][_0xa8b3('0x1a')]);}_0x1ca8c4[_0xa8b3('0x3a')]=qs[_0xa8b3('0x3b')](_0x475bae[_0xa8b3('0x30')][_0xa8b3('0x3b')]);_0x1ca8c4[_0xa8b3('0x3c')]=qs[_0xa8b3('0x32')](_[_0xa8b3('0x3d')](_0x475bae[_0xa8b3('0x30')],_0x57f2ee[_0xa8b3('0x32')]),_0x5b30f9);if(_0x475bae[_0xa8b3('0x30')][_0xa8b3('0x3e')]){_0x1ca8c4[_0xa8b3('0x3c')]=_[_0xa8b3('0x3f')](_0x1ca8c4[_0xa8b3('0x3c')],{'$or':_[_0xa8b3('0x2f')](_0x5b30f9,function(_0x5b3dfe){if(_0x5b3dfe[_0xa8b3('0x2d')]!==_0xa8b3('0x40')){var _0x2cd36d={};_0x2cd36d[_0x5b3dfe[_0xa8b3('0x28')]]={'$like':'%'+_0x475bae[_0xa8b3('0x30')]['filter']+'%'};return _0x2cd36d;}})});}_0x1ca8c4=_['merge']({},_0x1ca8c4,_0x475bae['options']);var _0x47b132={'where':_0x1ca8c4[_0xa8b3('0x3c')]};return db[_0xa8b3('0x2b')][_0xa8b3('0x1c')](_0x47b132)[_0xa8b3('0x24')](function(_0x1c4248){_0x3d084b['count']=_0x1c4248;if(_0x475bae['query']['includeAll']){_0x1ca8c4['include']=[{'all':!![]}];}return db[_0xa8b3('0x2b')][_0xa8b3('0x41')](_0x1ca8c4);})[_0xa8b3('0x24')](function(_0x41c66f){_0x3d084b['rows']=_0x41c66f;return _0x3d084b;})[_0xa8b3('0x24')](respondWithFilteredResult(_0x17cd21,_0x1ca8c4))['catch'](handleError(_0x17cd21,null));};exports[_0xa8b3('0x42')]=function(_0x31d07b,_0x36ec6e){var _0xfdd913={'raw':!![],'where':{'id':_0x31d07b['params']['id']}},_0x30381d={};_0x30381d['model']=_['keys'](db[_0xa8b3('0x2b')]['rawAttributes']);_0x30381d[_0xa8b3('0x30')]=_[_0xa8b3('0x31')](_0x31d07b[_0xa8b3('0x30')]);_0x30381d['filters']=_[_0xa8b3('0x33')](_0x30381d[_0xa8b3('0x34')],_0x30381d['query']);_0xfdd913[_0xa8b3('0x35')]=_[_0xa8b3('0x33')](_0x30381d[_0xa8b3('0x34')],qs[_0xa8b3('0x36')](_0x31d07b[_0xa8b3('0x30')]['fields']));_0xfdd913[_0xa8b3('0x35')]=_0xfdd913[_0xa8b3('0x35')]['length']?_0xfdd913[_0xa8b3('0x35')]:_0x30381d['model'];if(_0x31d07b[_0xa8b3('0x30')][_0xa8b3('0x43')]){_0xfdd913[_0xa8b3('0x44')]=[{'all':!![]}];}_0xfdd913=_[_0xa8b3('0x3f')]({},_0xfdd913,_0x31d07b[_0xa8b3('0x45')]);return db['FaxTransferReport'][_0xa8b3('0x46')](_0xfdd913)[_0xa8b3('0x24')](handleEntityNotFound(_0x36ec6e,null))[_0xa8b3('0x24')](respondWithResult(_0x36ec6e,null))['catch'](handleError(_0x36ec6e,null));};exports['create']=function(_0x300d8b,_0x20e395){return db[_0xa8b3('0x2b')]['create'](_0x300d8b[_0xa8b3('0x47')],{})['then'](respondWithResult(_0x20e395,0xc9))[_0xa8b3('0x48')](handleError(_0x20e395,null));};exports[_0xa8b3('0x49')]=function(_0x1b1fd1,_0x5d1389){if(_0x1b1fd1[_0xa8b3('0x47')]['id']){delete _0x1b1fd1[_0xa8b3('0x47')]['id'];}return db['FaxTransferReport'][_0xa8b3('0x46')]({'where':{'id':_0x1b1fd1['params']['id']}})[_0xa8b3('0x24')](handleEntityNotFound(_0x5d1389,null))[_0xa8b3('0x24')](saveUpdates(_0x1b1fd1[_0xa8b3('0x47')],null))[_0xa8b3('0x24')](respondWithResult(_0x5d1389,null))['catch'](handleError(_0x5d1389,null));};exports[_0xa8b3('0x25')]=function(_0x2b3cf8,_0xb3660e){return db['FaxTransferReport']['find']({'where':{'id':_0x2b3cf8['params']['id']}})[_0xa8b3('0x24')](handleEntityNotFound(_0xb3660e,null))[_0xa8b3('0x24')](removeEntity(_0xb3660e,null))[_0xa8b3('0x48')](handleError(_0xb3660e,null));};exports[_0xa8b3('0x4a')]=function(_0x385321,_0x51d2ca){return db[_0xa8b3('0x2b')][_0xa8b3('0x4a')]()['then'](respondWithResult(_0x51d2ca,null))[_0xa8b3('0x48')](handleError(_0x51d2ca,null));}; \ No newline at end of file +var _0xe7db=['reject','update','then','destroy','sendStatus','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','keys','merge','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply'];(function(_0x172d8e,_0xeb2530){var _0x19feaa=function(_0x185879){while(--_0x185879){_0x172d8e['push'](_0x172d8e['shift']());}};_0x19feaa(++_0xeb2530);}(_0xe7db,0x1a9));var _0xbe7d=function(_0x4b9f35,_0x287585){_0x4b9f35=_0x4b9f35-0x0;var _0x200ea1=_0xe7db[_0x4b9f35];return _0x200ea1;};'use strict';var emlformat=require(_0xbe7d('0x0'));var rimraf=require(_0xbe7d('0x1'));var zipdir=require(_0xbe7d('0x2'));var jsonpatch=require(_0xbe7d('0x3'));var rp=require('request-promise');var moment=require(_0xbe7d('0x4'));var BPromise=require(_0xbe7d('0x5'));var Mustache=require('mustache');var util=require(_0xbe7d('0x6'));var path=require(_0xbe7d('0x7'));var sox=require(_0xbe7d('0x8'));var csv=require(_0xbe7d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe7d('0xa'));var _=require('lodash');var squel=require(_0xbe7d('0xb'));var crypto=require(_0xbe7d('0xc'));var jsforce=require(_0xbe7d('0xd'));var deskjs=require(_0xbe7d('0xe'));var toCsv=require(_0xbe7d('0x9'));var querystring=require(_0xbe7d('0xf'));var Papa=require(_0xbe7d('0x10'));var Redis=require(_0xbe7d('0x11'));var authService=require(_0xbe7d('0x12'));var qs=require(_0xbe7d('0x13'));var as=require(_0xbe7d('0x14'));var hardwareService=require(_0xbe7d('0x15'));var logger=require(_0xbe7d('0x16'))(_0xbe7d('0x17'));var utils=require(_0xbe7d('0x18'));var config=require(_0xbe7d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe7d('0x1a'))['db'];function respondWithStatusCode(_0x502ede,_0x85efd6){_0x85efd6=_0x85efd6||0xcc;return function(_0x36d1c5){if(_0x36d1c5){return _0x502ede['sendStatus'](_0x85efd6);}return _0x502ede[_0xbe7d('0x1b')](_0x85efd6)[_0xbe7d('0x1c')]();};}function respondWithResult(_0x487ef3,_0x5afbad){_0x5afbad=_0x5afbad||0xc8;return function(_0xed6b67){if(_0xed6b67){return _0x487ef3[_0xbe7d('0x1b')](_0x5afbad)[_0xbe7d('0x1d')](_0xed6b67);}};}function respondWithFilteredResult(_0xd6c453,_0x52bc39){return function(_0x3e4ed2){if(_0x3e4ed2){var _0x3e001b=typeof _0x52bc39['offset']===_0xbe7d('0x1e')&&typeof _0x52bc39['limit']===_0xbe7d('0x1e');var _0x44f97e=_0x3e4ed2[_0xbe7d('0x1f')];var _0x166f08=_0x3e001b?0x0:_0x52bc39[_0xbe7d('0x20')];var _0xbd4d7e=_0x3e001b?_0x3e4ed2['count']:_0x52bc39[_0xbe7d('0x20')]+_0x52bc39[_0xbe7d('0x21')];var _0x1c673a;if(_0xbd4d7e>=_0x44f97e){_0xbd4d7e=_0x44f97e;_0x1c673a=0xc8;}else{_0x1c673a=0xce;}_0xd6c453['status'](_0x1c673a);return _0xd6c453[_0xbe7d('0x22')](_0xbe7d('0x23'),_0x166f08+'-'+_0xbd4d7e+'/'+_0x44f97e)[_0xbe7d('0x1d')](_0x3e4ed2);}return null;};}function patchUpdates(_0x459fd8){return function(_0x5389b1){try{jsonpatch[_0xbe7d('0x24')](_0x5389b1,_0x459fd8,!![]);}catch(_0x2f0645){return BPromise[_0xbe7d('0x25')](_0x2f0645);}return _0x5389b1['save']();};}function saveUpdates(_0xb2a3ba,_0x20f2e0){return function(_0x69417){if(_0x69417){return _0x69417[_0xbe7d('0x26')](_0xb2a3ba)[_0xbe7d('0x27')](function(_0x544d31){return _0x544d31;});}return null;};}function removeEntity(_0x4764c3,_0x375a23){return function(_0x559f4e){if(_0x559f4e){return _0x559f4e[_0xbe7d('0x28')]()['then'](function(){_0x4764c3[_0xbe7d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a85c,_0x2ec1cd){return function(_0x1e1f72){if(!_0x1e1f72){_0x17a85c[_0xbe7d('0x29')](0x194);}return _0x1e1f72;};}function handleError(_0x4a45bf,_0x240acc){_0x240acc=_0x240acc||0x1f4;return function(_0x45b8bc){logger['error'](_0x45b8bc[_0xbe7d('0x2a')]);if(_0x45b8bc[_0xbe7d('0x2b')]){delete _0x45b8bc[_0xbe7d('0x2b')];}_0x4a45bf[_0xbe7d('0x1b')](_0x240acc)[_0xbe7d('0x2c')](_0x45b8bc);};}exports[_0xbe7d('0x2d')]=function(_0x58e493,_0xf68480){var _0x3b4414={},_0xc481bf={},_0x38ffd7={'count':0x0,'rows':[]};var _0x395881=_[_0xbe7d('0x2e')](db[_0xbe7d('0x2f')][_0xbe7d('0x30')],function(_0x43c10e){return{'name':_0x43c10e[_0xbe7d('0x31')],'type':_0x43c10e[_0xbe7d('0x32')]['key']};});_0xc481bf[_0xbe7d('0x33')]=_[_0xbe7d('0x2e')](_0x395881,_0xbe7d('0x2b'));_0xc481bf[_0xbe7d('0x34')]=_['keys'](_0x58e493['query']);_0xc481bf[_0xbe7d('0x35')]=_[_0xbe7d('0x36')](_0xc481bf['model'],_0xc481bf[_0xbe7d('0x34')]);_0x3b4414[_0xbe7d('0x37')]=_['intersection'](_0xc481bf[_0xbe7d('0x33')],qs[_0xbe7d('0x38')](_0x58e493[_0xbe7d('0x34')][_0xbe7d('0x38')]));_0x3b4414[_0xbe7d('0x37')]=_0x3b4414[_0xbe7d('0x37')][_0xbe7d('0x39')]?_0x3b4414[_0xbe7d('0x37')]:_0xc481bf['model'];if(!_0x58e493['query'][_0xbe7d('0x3a')](_0xbe7d('0x3b'))){_0x3b4414[_0xbe7d('0x21')]=qs['limit'](_0x58e493[_0xbe7d('0x34')]['limit']);_0x3b4414[_0xbe7d('0x20')]=qs[_0xbe7d('0x20')](_0x58e493['query'][_0xbe7d('0x20')]);}_0x3b4414['order']=qs[_0xbe7d('0x3c')](_0x58e493['query'][_0xbe7d('0x3c')]);_0x3b4414[_0xbe7d('0x3d')]=qs[_0xbe7d('0x35')](_['pick'](_0x58e493[_0xbe7d('0x34')],_0xc481bf[_0xbe7d('0x35')]),_0x395881);if(_0x58e493[_0xbe7d('0x34')][_0xbe7d('0x3e')]){_0x3b4414[_0xbe7d('0x3d')]=_['merge'](_0x3b4414['where'],{'$or':_[_0xbe7d('0x2e')](_0x395881,function(_0x40a9c7){if(_0x40a9c7[_0xbe7d('0x32')]!==_0xbe7d('0x3f')){var _0x576bcd={};_0x576bcd[_0x40a9c7[_0xbe7d('0x2b')]]={'$like':'%'+_0x58e493[_0xbe7d('0x34')][_0xbe7d('0x3e')]+'%'};return _0x576bcd;}})});}_0x3b4414=_['merge']({},_0x3b4414,_0x58e493[_0xbe7d('0x40')]);var _0x258ed7={'where':_0x3b4414['where']};return db[_0xbe7d('0x2f')][_0xbe7d('0x1f')](_0x258ed7)[_0xbe7d('0x27')](function(_0x1ffbe2){_0x38ffd7[_0xbe7d('0x1f')]=_0x1ffbe2;if(_0x58e493[_0xbe7d('0x34')][_0xbe7d('0x41')]){_0x3b4414[_0xbe7d('0x42')]=[{'all':!![]}];}return db[_0xbe7d('0x2f')]['findAll'](_0x3b4414);})[_0xbe7d('0x27')](function(_0x4f72f5){_0x38ffd7[_0xbe7d('0x43')]=_0x4f72f5;return _0x38ffd7;})['then'](respondWithFilteredResult(_0xf68480,_0x3b4414))[_0xbe7d('0x44')](handleError(_0xf68480,null));};exports[_0xbe7d('0x45')]=function(_0x286e38,_0x385ef9){var _0x1d363c={'raw':!![],'where':{'id':_0x286e38['params']['id']}},_0x366b2b={};_0x366b2b[_0xbe7d('0x33')]=_[_0xbe7d('0x46')](db[_0xbe7d('0x2f')][_0xbe7d('0x30')]);_0x366b2b[_0xbe7d('0x34')]=_[_0xbe7d('0x46')](_0x286e38['query']);_0x366b2b[_0xbe7d('0x35')]=_[_0xbe7d('0x36')](_0x366b2b[_0xbe7d('0x33')],_0x366b2b[_0xbe7d('0x34')]);_0x1d363c[_0xbe7d('0x37')]=_[_0xbe7d('0x36')](_0x366b2b[_0xbe7d('0x33')],qs[_0xbe7d('0x38')](_0x286e38['query']['fields']));_0x1d363c['attributes']=_0x1d363c['attributes'][_0xbe7d('0x39')]?_0x1d363c[_0xbe7d('0x37')]:_0x366b2b[_0xbe7d('0x33')];if(_0x286e38[_0xbe7d('0x34')][_0xbe7d('0x41')]){_0x1d363c[_0xbe7d('0x42')]=[{'all':!![]}];}_0x1d363c=_[_0xbe7d('0x47')]({},_0x1d363c,_0x286e38[_0xbe7d('0x40')]);return db['FaxTransferReport']['find'](_0x1d363c)[_0xbe7d('0x27')](handleEntityNotFound(_0x385ef9,null))['then'](respondWithResult(_0x385ef9,null))[_0xbe7d('0x44')](handleError(_0x385ef9,null));};exports[_0xbe7d('0x48')]=function(_0x5e67b7,_0x3a1c6e){return db[_0xbe7d('0x2f')][_0xbe7d('0x48')](_0x5e67b7['body'],{})[_0xbe7d('0x27')](respondWithResult(_0x3a1c6e,0xc9))[_0xbe7d('0x44')](handleError(_0x3a1c6e,null));};exports[_0xbe7d('0x26')]=function(_0xb718f7,_0x240d36){if(_0xb718f7[_0xbe7d('0x49')]['id']){delete _0xb718f7['body']['id'];}return db[_0xbe7d('0x2f')][_0xbe7d('0x4a')]({'where':{'id':_0xb718f7[_0xbe7d('0x4b')]['id']}})[_0xbe7d('0x27')](handleEntityNotFound(_0x240d36,null))[_0xbe7d('0x27')](saveUpdates(_0xb718f7[_0xbe7d('0x49')],null))['then'](respondWithResult(_0x240d36,null))['catch'](handleError(_0x240d36,null));};exports[_0xbe7d('0x28')]=function(_0x2f809c,_0x52452b){return db[_0xbe7d('0x2f')][_0xbe7d('0x4a')]({'where':{'id':_0x2f809c[_0xbe7d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x52452b,null))[_0xbe7d('0x27')](removeEntity(_0x52452b,null))['catch'](handleError(_0x52452b,null));};exports['describe']=function(_0x389a25,_0x34670f){return db['FaxTransferReport'][_0xbe7d('0x4c')]()['then'](respondWithResult(_0x34670f,null))[_0xbe7d('0x44')](handleError(_0x34670f,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 36a3fae..2b61677 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 _0xa478=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16c0f5,_0x6b622b){var _0x40a7d8=function(_0xc52f48){while(--_0xc52f48){_0x16c0f5['push'](_0x16c0f5['shift']());}};_0x40a7d8(++_0x6b622b);}(_0xa478,0x136));var _0x8a47=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xa478[_0x381372];return _0x4e959a;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var logger=require(_0x8a47('0x2'))(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var BPromise=require(_0x8a47('0x5'));var rp=require(_0x8a47('0x6'));var fs=require('fs');var path=require(_0x8a47('0x7'));var rimraf=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var attributes=require(_0x8a47('0xa'));module[_0x8a47('0xb')]=function(_0x50226a,_0x413787){return _0x50226a[_0x8a47('0xc')](_0x8a47('0xd'),attributes,{'tableName':_0x8a47('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8a47('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x39aa=['request-promise','path','rimraf','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x1193cb,_0x588c90){var _0x1ed3e8=function(_0x506828){while(--_0x506828){_0x1193cb['push'](_0x1193cb['shift']());}};_0x1ed3e8(++_0x588c90);}(_0x39aa,0x11b));var _0xa39a=function(_0x3497b5,_0x5775b8){_0x3497b5=_0x3497b5-0x0;var _0x9c5460=_0x39aa[_0x3497b5];return _0x9c5460;};'use strict';var _=require(_0xa39a('0x0'));var util=require(_0xa39a('0x1'));var logger=require('../../config/logger')(_0xa39a('0x2'));var moment=require(_0xa39a('0x3'));var BPromise=require(_0xa39a('0x4'));var rp=require(_0xa39a('0x5'));var fs=require('fs');var path=require(_0xa39a('0x6'));var rimraf=require(_0xa39a('0x7'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x3dba2c,_0x911d67){return _0x3dba2c[_0xa39a('0x8')](_0xa39a('0x9'),attributes,{'tableName':_0xa39a('0xa'),'paranoid':![],'indexes':[{'name':_0xa39a('0xb'),'fields':[_0xa39a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 9006eeb..9275fba 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 _0xb8df=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x53cb86,_0x30b21c){var _0x12a260=function(_0x4c3f14){while(--_0x4c3f14){_0x53cb86['push'](_0x53cb86['shift']());}};_0x12a260(++_0x30b21c);}(_0xb8df,0x1e0));var _0xfb8d=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb8df[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xfb8d('0x0'));var util=require(_0xfb8d('0x1'));var moment=require(_0xfb8d('0x2'));var BPromise=require(_0xfb8d('0x3'));var rs=require(_0xfb8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb8d('0x5'))['db'];var utils=require(_0xfb8d('0x6'));var logger=require(_0xfb8d('0x7'))(_0xfb8d('0x8'));var config=require(_0xfb8d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb8d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd8a8,_0x241439,_0x1d851a){return new BPromise(function(_0x95dba6,_0x32374e){return client['request'](_0x3dd8a8,_0x1d851a)[_0xfb8d('0xb')](function(_0x524b0b){logger[_0xfb8d('0xc')](_0xfb8d('0xd'),_0x241439,_0xfb8d('0xe'));logger[_0xfb8d('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x241439,_0xfb8d('0xe'),JSON[_0xfb8d('0x10')](_0x524b0b));if(_0x524b0b[_0xfb8d('0x11')]){if(_0x524b0b[_0xfb8d('0x11')][_0xfb8d('0x12')]===0x1f4){logger[_0xfb8d('0x11')](_0xfb8d('0xd'),_0x241439,_0x524b0b['error']['message']);return _0x32374e(_0x524b0b[_0xfb8d('0x11')][_0xfb8d('0x13')]);}logger['error'](_0xfb8d('0xd'),_0x241439,_0x524b0b[_0xfb8d('0x11')]['message']);return _0x95dba6(_0x524b0b['error'][_0xfb8d('0x13')]);}else{logger['info'](_0xfb8d('0xd'),_0x241439,_0xfb8d('0xe'));_0x95dba6(_0x524b0b['result'][_0xfb8d('0x13')]);}})[_0xfb8d('0x14')](function(_0x823e3d){logger[_0xfb8d('0x11')](_0xfb8d('0xd'),_0x241439,_0x823e3d);_0x32374e(_0x823e3d);});});} \ No newline at end of file +var _0x99ba=['message','FaxTransferReport,\x20%s,\x20%s','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x187426,_0x19d562){var _0x28aa81=function(_0xc82bb2){while(--_0xc82bb2){_0x187426['push'](_0x187426['shift']());}};_0x28aa81(++_0x19d562);}(_0x99ba,0x156));var _0xa99b=function(_0x2514c1,_0x1cdf48){_0x2514c1=_0x2514c1-0x0;var _0x428ca3=_0x99ba[_0x2514c1];return _0x428ca3;};'use strict';var _=require(_0xa99b('0x0'));var util=require('util');var moment=require(_0xa99b('0x1'));var BPromise=require('bluebird');var rs=require(_0xa99b('0x2'));var fs=require('fs');var Redis=require(_0xa99b('0x3'));var db=require(_0xa99b('0x4'))['db'];var utils=require(_0xa99b('0x5'));var logger=require(_0xa99b('0x6'))(_0xa99b('0x7'));var config=require(_0xa99b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa99b('0x9')][_0xa99b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x434f93,_0x24c560,_0x213eb4){return new BPromise(function(_0x14d8b2,_0x1298d0){return client[_0xa99b('0xb')](_0x434f93,_0x213eb4)['then'](function(_0x1c1b6e){logger[_0xa99b('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x24c560,_0xa99b('0xd'));logger['debug'](_0xa99b('0xe'),_0x24c560,'request\x20sent',JSON[_0xa99b('0xf')](_0x1c1b6e));if(_0x1c1b6e[_0xa99b('0x10')]){if(_0x1c1b6e['error'][_0xa99b('0x11')]===0x1f4){logger[_0xa99b('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x24c560,_0x1c1b6e['error'][_0xa99b('0x12')]);return _0x1298d0(_0x1c1b6e[_0xa99b('0x10')][_0xa99b('0x12')]);}logger[_0xa99b('0x10')](_0xa99b('0x13'),_0x24c560,_0x1c1b6e[_0xa99b('0x10')][_0xa99b('0x12')]);return _0x14d8b2(_0x1c1b6e[_0xa99b('0x10')]['message']);}else{logger[_0xa99b('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x24c560,_0xa99b('0xd'));_0x14d8b2(_0x1c1b6e['result']['message']);}})['catch'](function(_0x111bd8){logger[_0xa99b('0x10')](_0xa99b('0x13'),_0x24c560,_0x111bd8);_0x1298d0(_0x111bd8);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c6aa315..7dde1ef 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 _0xb0fb=['create','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','index','get','/:id'];(function(_0x543eef,_0x6edbfb){var _0x1e662d=function(_0x52883f){while(--_0x52883f){_0x543eef['push'](_0x543eef['shift']());}};_0x1e662d(++_0x6edbfb);}(_0xb0fb,0x18a));var _0xbb0f=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb0fb[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0xbb0f('0x0'));var util=require(_0xbb0f('0x1'));var path=require(_0xbb0f('0x2'));var timeout=require(_0xbb0f('0x3'));var express=require(_0xbb0f('0x4'));var router=express[_0xbb0f('0x5')]();var fs_extra=require(_0xbb0f('0x6'));var auth=require(_0xbb0f('0x7'));var interaction=require(_0xbb0f('0x8'));var config=require('../../config/environment');var controller=require(_0xbb0f('0x9'));router['get']('/',auth[_0xbb0f('0xa')](),controller[_0xbb0f('0xb')]);router[_0xbb0f('0xc')]('/describe',auth[_0xbb0f('0xa')](),controller['describe']);router[_0xbb0f('0xc')](_0xbb0f('0xd'),auth[_0xbb0f('0xa')](),controller['show']);router['post']('/',auth[_0xbb0f('0xa')](),controller[_0xbb0f('0xe')]);router['put'](_0xbb0f('0xd'),auth[_0xbb0f('0xa')](),controller[_0xbb0f('0xf')]);router[_0xbb0f('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9593=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','post','create','put','/:id','update','destroy','exports','multer','path','express','Router'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x9593,0x11c));var _0x3959=function(_0xb3b452,_0x582e8e){_0xb3b452=_0xb3b452-0x0;var _0x238983=_0x9593[_0xb3b452];return _0x238983;};'use strict';var multer=require(_0x3959('0x0'));var util=require('util');var path=require(_0x3959('0x1'));var timeout=require('connect-timeout');var express=require(_0x3959('0x2'));var router=express[_0x3959('0x3')]();var fs_extra=require(_0x3959('0x4'));var auth=require(_0x3959('0x5'));var interaction=require(_0x3959('0x6'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x3959('0x7')]('/',auth[_0x3959('0x8')](),controller[_0x3959('0x9')]);router['get'](_0x3959('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3959('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3959('0xb')]('/',auth['isAuthenticated'](),controller[_0x3959('0xc')]);router[_0x3959('0xd')](_0x3959('0xe'),auth[_0x3959('0x8')](),controller[_0x3959('0xf')]);router['delete'](_0x3959('0xe'),auth[_0x3959('0x8')](),controller[_0x3959('0x10')]);module[_0x3959('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 9f1830c..ba4a810 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 _0xbdb8=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','/:id','delete','destroy','exports'];(function(_0x41bdf2,_0x5d8136){var _0xde852b=function(_0x4c046c){while(--_0x4c046c){_0x41bdf2['push'](_0x41bdf2['shift']());}};_0xde852b(++_0x5d8136);}(_0xbdb8,0x13b));var _0x8bdb=function(_0x1f68dd,_0x40414e){_0x1f68dd=_0x1f68dd-0x0;var _0x5b72c9=_0xbdb8[_0x1f68dd];return _0x5b72c9;};'use strict';var multer=require(_0x8bdb('0x0'));var util=require(_0x8bdb('0x1'));var path=require(_0x8bdb('0x2'));var timeout=require(_0x8bdb('0x3'));var express=require(_0x8bdb('0x4'));var router=express[_0x8bdb('0x5')]();var fs_extra=require(_0x8bdb('0x6'));var auth=require(_0x8bdb('0x7'));var interaction=require(_0x8bdb('0x8'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x8bdb('0x9')]('/',auth[_0x8bdb('0xa')](),controller[_0x8bdb('0xb')]);router[_0x8bdb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8bdb('0x9')](_0x8bdb('0xc'),auth['isAuthenticated'](),controller[_0x8bdb('0xd')]);router[_0x8bdb('0x9')](_0x8bdb('0xe'),auth[_0x8bdb('0xa')](),controller[_0x8bdb('0xf')]);router[_0x8bdb('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8bdb('0x10')](_0x8bdb('0xc'),auth[_0x8bdb('0xa')](),controller['addConfiguration']);router['put'](_0x8bdb('0x11'),auth[_0x8bdb('0xa')](),controller['update']);router[_0x8bdb('0x12')](_0x8bdb('0x11'),auth['isAuthenticated'](),controller[_0x8bdb('0x13')]);module[_0x8bdb('0x14')]=router; \ No newline at end of file +var _0x6f6c=['getFields','post','create','addConfiguration','put','delete','/:id','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x4764d8,_0x301371){var _0x22e574=function(_0x441d43){while(--_0x441d43){_0x4764d8['push'](_0x4764d8['shift']());}};_0x22e574(++_0x301371);}(_0x6f6c,0x8d));var _0xc6f6=function(_0x3fb04f,_0x217372){_0x3fb04f=_0x3fb04f-0x0;var _0x14adb6=_0x6f6c[_0x3fb04f];return _0x14adb6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc6f6('0x0'));var timeout=require(_0xc6f6('0x1'));var express=require(_0xc6f6('0x2'));var router=express['Router']();var fs_extra=require(_0xc6f6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc6f6('0x4'));var config=require(_0xc6f6('0x5'));var controller=require(_0xc6f6('0x6'));router[_0xc6f6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6f6('0x7')]('/:id',auth[_0xc6f6('0x8')](),controller[_0xc6f6('0x9')]);router['get'](_0xc6f6('0xa'),auth[_0xc6f6('0x8')](),controller[_0xc6f6('0xb')]);router[_0xc6f6('0x7')](_0xc6f6('0xc'),auth[_0xc6f6('0x8')](),controller[_0xc6f6('0xd')]);router[_0xc6f6('0xe')]('/',auth[_0xc6f6('0x8')](),controller[_0xc6f6('0xf')]);router[_0xc6f6('0xe')](_0xc6f6('0xa'),auth['isAuthenticated'](),controller[_0xc6f6('0x10')]);router[_0xc6f6('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc6f6('0x12')](_0xc6f6('0x13'),auth[_0xc6f6('0x8')](),controller[_0xc6f6('0x14')]);module[_0xc6f6('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index d14be0f..d290cb2 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 _0xbfe2=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x45b1ad,_0x215b03){var _0x3d5696=function(_0x4d9e73){while(--_0x4d9e73){_0x45b1ad['push'](_0x45b1ad['shift']());}};_0x3d5696(++_0x215b03);}(_0xbfe2,0x19c));var _0x2bfe=function(_0x30eb2e,_0xff5e90){_0x30eb2e=_0x30eb2e-0x0;var _0x2ec168=_0xbfe2[_0x30eb2e];return _0x2ec168;};'use strict';var Sequelize=require(_0x2bfe('0x0'));module[_0x2bfe('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2bfe('0x2')]},'username':{'type':Sequelize[_0x2bfe('0x2')]},'remoteUri':{'type':Sequelize[_0x2bfe('0x2')]},'authType':{'type':Sequelize[_0x2bfe('0x3')](_0x2bfe('0x4')),'defaultValue':_0x2bfe('0x4')},'password':{'type':Sequelize[_0x2bfe('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x2bfe('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x2bfe('0x2')]},'serverUrl':{'type':Sequelize[_0x2bfe('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2bfe('0x3')](_0x2bfe('0x5'),_0x2bfe('0x6')),'defaultValue':_0x2bfe('0x5')}}; \ No newline at end of file +var _0x272e=['newTab','integrationTab','sequelize','STRING','ENUM','basic'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0x272e,0xda));var _0xe272=function(_0x4a5d5e,_0x14fea1){_0x4a5d5e=_0x4a5d5e-0x0;var _0xfde258=_0x272e[_0x4a5d5e];return _0xfde258;};'use strict';var Sequelize=require(_0xe272('0x0'));module['exports']={'name':{'type':Sequelize[_0xe272('0x1')]},'description':{'type':Sequelize[_0xe272('0x1')]},'username':{'type':Sequelize[_0xe272('0x1')]},'remoteUri':{'type':Sequelize[_0xe272('0x1')]},'authType':{'type':Sequelize[_0xe272('0x2')]('basic'),'defaultValue':_0xe272('0x3')},'password':{'type':Sequelize[_0xe272('0x1')]},'consumerKey':{'type':Sequelize[_0xe272('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe272('0x1')]},'tokenSecret':{'type':Sequelize[_0xe272('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe272('0x2')]('integrationTab',_0xe272('0x4')),'defaultValue':_0xe272('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9937292..7a92408 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 _0xea47=['params','include','find','create','body','catch','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','Descriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','toString','base64','concat','_embedded','label','test','statusCode','stringify','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','DeskAccount','includeAll'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xea47,0x96));var _0x7ea4=function(_0x4b3f82,_0x28dc7a){_0x4b3f82=_0x4b3f82-0x0;var _0x5df090=_0xea47[_0x4b3f82];return _0x5df090;};'use strict';var emlformat=require(_0x7ea4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7ea4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ea4('0x2'));var moment=require(_0x7ea4('0x3'));var BPromise=require(_0x7ea4('0x4'));var Mustache=require(_0x7ea4('0x5'));var util=require(_0x7ea4('0x6'));var path=require('path');var sox=require(_0x7ea4('0x7'));var csv=require(_0x7ea4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ea4('0x9'));var squel=require(_0x7ea4('0xa'));var crypto=require('crypto');var jsforce=require(_0x7ea4('0xb'));var deskjs=require(_0x7ea4('0xc'));var toCsv=require(_0x7ea4('0x8'));var querystring=require(_0x7ea4('0xd'));var Papa=require(_0x7ea4('0xe'));var Redis=require(_0x7ea4('0xf'));var authService=require(_0x7ea4('0x10'));var qs=require(_0x7ea4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ea4('0x12'));var logger=require(_0x7ea4('0x13'))(_0x7ea4('0x14'));var utils=require(_0x7ea4('0x15'));var config=require(_0x7ea4('0x16'));var licenseUtil=require(_0x7ea4('0x17'));var db=require(_0x7ea4('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x337f0d,_0x581d10){_0x581d10=_0x581d10||0xcc;return function(_0x567290){if(_0x567290){return _0x337f0d[_0x7ea4('0x19')](_0x581d10);}return _0x337f0d['status'](_0x581d10)[_0x7ea4('0x1a')]();};}function respondWithResult(_0x4499c8,_0x4f68a9){_0x4f68a9=_0x4f68a9||0xc8;return function(_0x1f642f){if(_0x1f642f){return _0x4499c8['status'](_0x4f68a9)['json'](_0x1f642f);}};}function respondWithFilteredResult(_0x23052b,_0x564459){return function(_0x2f391c){if(_0x2f391c){var _0x5d9095=typeof _0x564459['offset']===_0x7ea4('0x1b')&&typeof _0x564459[_0x7ea4('0x1c')]===_0x7ea4('0x1b');var _0x10281c=_0x2f391c[_0x7ea4('0x1d')];var _0x2c147f=_0x5d9095?0x0:_0x564459[_0x7ea4('0x1e')];var _0x5df9a7=_0x5d9095?_0x2f391c[_0x7ea4('0x1d')]:_0x564459[_0x7ea4('0x1e')]+_0x564459[_0x7ea4('0x1c')];var _0x5c5d5e;if(_0x5df9a7>=_0x10281c){_0x5df9a7=_0x10281c;_0x5c5d5e=0xc8;}else{_0x5c5d5e=0xce;}_0x23052b[_0x7ea4('0x1f')](_0x5c5d5e);return _0x23052b[_0x7ea4('0x20')](_0x7ea4('0x21'),_0x2c147f+'-'+_0x5df9a7+'/'+_0x10281c)['json'](_0x2f391c);}return null;};}function patchUpdates(_0x28ae3d){return function(_0x528d82){try{jsonpatch[_0x7ea4('0x22')](_0x528d82,_0x28ae3d,!![]);}catch(_0x45ad75){return BPromise[_0x7ea4('0x23')](_0x45ad75);}return _0x528d82[_0x7ea4('0x24')]();};}function saveUpdates(_0x578e19,_0x4e84ab){return function(_0x429842){if(_0x429842){return _0x429842[_0x7ea4('0x25')](_0x578e19)[_0x7ea4('0x26')](function(_0x31f795){return _0x31f795;});}return null;};}function removeEntity(_0x308fa4,_0x48ec8e){return function(_0x34230f){if(_0x34230f){return _0x34230f[_0x7ea4('0x27')]()['then'](function(){_0x308fa4[_0x7ea4('0x1f')](0xcc)[_0x7ea4('0x1a')]();});}};}function handleEntityNotFound(_0x409ee9,_0x40c881){return function(_0x8b97e9){if(!_0x8b97e9){_0x409ee9['sendStatus'](0x194);}return _0x8b97e9;};}function handleError(_0x5e8d6d,_0x5f5ba7){_0x5f5ba7=_0x5f5ba7||0x1f4;return function(_0x5beba){logger[_0x7ea4('0x28')](_0x5beba[_0x7ea4('0x29')]);if(_0x5beba[_0x7ea4('0x2a')]){delete _0x5beba[_0x7ea4('0x2a')];}_0x5e8d6d[_0x7ea4('0x1f')](_0x5f5ba7)[_0x7ea4('0x2b')](_0x5beba);};}exports['index']=function(_0x56051f,_0x45bc0f){var _0x2267b4={},_0x48133c={},_0x2046b1={'count':0x0,'rows':[]};var _0x5d0362=_['map'](db['DeskAccount'][_0x7ea4('0x2c')],function(_0x4b12a3){return{'name':_0x4b12a3[_0x7ea4('0x2d')],'type':_0x4b12a3[_0x7ea4('0x2e')][_0x7ea4('0x2f')]};});_0x48133c[_0x7ea4('0x30')]=_[_0x7ea4('0x31')](_0x5d0362,_0x7ea4('0x2a'));_0x48133c[_0x7ea4('0x32')]=_[_0x7ea4('0x33')](_0x56051f[_0x7ea4('0x32')]);_0x48133c[_0x7ea4('0x34')]=_[_0x7ea4('0x35')](_0x48133c['model'],_0x48133c[_0x7ea4('0x32')]);_0x2267b4[_0x7ea4('0x36')]=_[_0x7ea4('0x35')](_0x48133c['model'],qs[_0x7ea4('0x37')](_0x56051f[_0x7ea4('0x32')]['fields']));_0x2267b4['attributes']=_0x2267b4[_0x7ea4('0x36')][_0x7ea4('0x38')]?_0x2267b4[_0x7ea4('0x36')]:_0x48133c[_0x7ea4('0x30')];if(!_0x56051f[_0x7ea4('0x32')][_0x7ea4('0x39')](_0x7ea4('0x3a'))){_0x2267b4[_0x7ea4('0x1c')]=qs[_0x7ea4('0x1c')](_0x56051f[_0x7ea4('0x32')]['limit']);_0x2267b4[_0x7ea4('0x1e')]=qs[_0x7ea4('0x1e')](_0x56051f[_0x7ea4('0x32')][_0x7ea4('0x1e')]);}_0x2267b4[_0x7ea4('0x3b')]=qs['sort'](_0x56051f['query'][_0x7ea4('0x3c')]);_0x2267b4[_0x7ea4('0x3d')]=qs[_0x7ea4('0x34')](_['pick'](_0x56051f[_0x7ea4('0x32')],_0x48133c[_0x7ea4('0x34')]),_0x5d0362);if(_0x56051f[_0x7ea4('0x32')][_0x7ea4('0x3e')]){_0x2267b4['where']=_[_0x7ea4('0x3f')](_0x2267b4[_0x7ea4('0x3d')],{'$or':_[_0x7ea4('0x31')](_0x5d0362,function(_0x5cb840){if(_0x5cb840[_0x7ea4('0x2e')]!==_0x7ea4('0x40')){var _0x3548c9={};_0x3548c9[_0x5cb840[_0x7ea4('0x2a')]]={'$like':'%'+_0x56051f['query'][_0x7ea4('0x3e')]+'%'};return _0x3548c9;}})});}_0x2267b4=_[_0x7ea4('0x3f')]({},_0x2267b4,_0x56051f[_0x7ea4('0x41')]);var _0x386199={'where':_0x2267b4['where']};return db[_0x7ea4('0x42')][_0x7ea4('0x1d')](_0x386199)['then'](function(_0x12b413){_0x2046b1['count']=_0x12b413;if(_0x56051f[_0x7ea4('0x32')][_0x7ea4('0x43')]){_0x2267b4['include']=[{'all':!![]}];}return db[_0x7ea4('0x42')]['findAll'](_0x2267b4);})[_0x7ea4('0x26')](function(_0x2e3d84){_0x2046b1['rows']=_0x2e3d84;return _0x2046b1;})[_0x7ea4('0x26')](respondWithFilteredResult(_0x45bc0f,_0x2267b4))['catch'](handleError(_0x45bc0f,null));};exports['show']=function(_0x4e1a5d,_0x5d2713){var _0x3ead8d={'raw':![],'where':{'id':_0x4e1a5d[_0x7ea4('0x44')]['id']}},_0x53a184={};_0x53a184[_0x7ea4('0x30')]=_['keys'](db[_0x7ea4('0x42')][_0x7ea4('0x2c')]);_0x53a184[_0x7ea4('0x32')]=_[_0x7ea4('0x33')](_0x4e1a5d[_0x7ea4('0x32')]);_0x53a184['filters']=_[_0x7ea4('0x35')](_0x53a184[_0x7ea4('0x30')],_0x53a184['query']);_0x3ead8d[_0x7ea4('0x36')]=_[_0x7ea4('0x35')](_0x53a184[_0x7ea4('0x30')],qs['fields'](_0x4e1a5d[_0x7ea4('0x32')][_0x7ea4('0x37')]));_0x3ead8d['attributes']=_0x3ead8d[_0x7ea4('0x36')][_0x7ea4('0x38')]?_0x3ead8d['attributes']:_0x53a184['model'];if(_0x4e1a5d[_0x7ea4('0x32')][_0x7ea4('0x43')]){_0x3ead8d[_0x7ea4('0x45')]=[{'all':!![]}];}_0x3ead8d=_[_0x7ea4('0x3f')]({},_0x3ead8d,_0x4e1a5d[_0x7ea4('0x41')]);return db[_0x7ea4('0x42')][_0x7ea4('0x46')](_0x3ead8d)[_0x7ea4('0x26')](handleEntityNotFound(_0x5d2713,null))['then'](respondWithResult(_0x5d2713,null))['catch'](handleError(_0x5d2713,null));};exports['create']=function(_0x7bc091,_0x293d7d){return db['DeskAccount'][_0x7ea4('0x47')](_0x7bc091[_0x7ea4('0x48')],{})[_0x7ea4('0x26')](respondWithResult(_0x293d7d,0xc9))['catch'](handleError(_0x293d7d,null));};exports['update']=function(_0x4e784a,_0x3e5614){if(_0x4e784a[_0x7ea4('0x48')]['id']){delete _0x4e784a['body']['id'];}return db['DeskAccount']['find']({'where':{'id':_0x4e784a['params']['id']}})['then'](handleEntityNotFound(_0x3e5614,null))[_0x7ea4('0x26')](saveUpdates(_0x4e784a[_0x7ea4('0x48')],null))[_0x7ea4('0x26')](respondWithResult(_0x3e5614,null))[_0x7ea4('0x49')](handleError(_0x3e5614,null));};exports[_0x7ea4('0x27')]=function(_0x469e23,_0x5c8f5b){return db['DeskAccount'][_0x7ea4('0x46')]({'where':{'id':_0x469e23[_0x7ea4('0x44')]['id']}})[_0x7ea4('0x26')](handleEntityNotFound(_0x5c8f5b,null))[_0x7ea4('0x26')](removeEntity(_0x5c8f5b,null))['catch'](handleError(_0x5c8f5b,null));};exports[_0x7ea4('0x4a')]=function(_0x2d97f2,_0x7c2f96,_0x273edd){var _0x3eb635={};var _0x26d7c0={};var _0x33cdec;var _0x378581;return db[_0x7ea4('0x42')][_0x7ea4('0x4b')]({'where':{'id':_0x2d97f2['params']['id']}})[_0x7ea4('0x26')](handleEntityNotFound(_0x7c2f96,null))[_0x7ea4('0x26')](function(_0x5c0f34){if(_0x5c0f34){_0x33cdec=_0x5c0f34;_0x26d7c0[_0x7ea4('0x30')]=_[_0x7ea4('0x33')](db['DeskConfiguration'][_0x7ea4('0x2c')]);_0x26d7c0['query']=_[_0x7ea4('0x33')](_0x2d97f2[_0x7ea4('0x32')]);_0x26d7c0[_0x7ea4('0x34')]=_[_0x7ea4('0x35')](_0x26d7c0['model'],_0x26d7c0[_0x7ea4('0x32')]);_0x3eb635[_0x7ea4('0x36')]=_[_0x7ea4('0x35')](_0x26d7c0[_0x7ea4('0x30')],qs[_0x7ea4('0x37')](_0x2d97f2[_0x7ea4('0x32')][_0x7ea4('0x37')]));_0x3eb635['attributes']=_0x3eb635['attributes'][_0x7ea4('0x38')]?_0x3eb635['attributes']:_0x26d7c0[_0x7ea4('0x30')];_0x3eb635[_0x7ea4('0x3b')]=qs[_0x7ea4('0x3c')](_0x2d97f2['query'][_0x7ea4('0x3c')]);_0x3eb635[_0x7ea4('0x3d')]=qs['filters'](_[_0x7ea4('0x4c')](_0x2d97f2[_0x7ea4('0x32')],_0x26d7c0[_0x7ea4('0x34')]));if(_0x2d97f2[_0x7ea4('0x32')][_0x7ea4('0x3e')]){_0x3eb635['where']=_[_0x7ea4('0x3f')](_0x3eb635[_0x7ea4('0x3d')],{'$or':_[_0x7ea4('0x31')](_0x3eb635['attributes'],function(_0x159091){var _0x1cbefc={};_0x1cbefc[_0x159091]={'$like':'%'+_0x2d97f2[_0x7ea4('0x32')][_0x7ea4('0x3e')]+'%'};return _0x1cbefc;})});}_0x3eb635=_['merge']({},_0x3eb635,_0x2d97f2[_0x7ea4('0x41')]);return _0x33cdec[_0x7ea4('0x4a')](_0x3eb635);}})['then'](function(_0xb020f7){if(_0xb020f7){_0x378581=_0xb020f7[_0x7ea4('0x38')];if(!_0x2d97f2[_0x7ea4('0x32')][_0x7ea4('0x39')]('nolimit')){_0x3eb635[_0x7ea4('0x1c')]=qs[_0x7ea4('0x1c')](_0x2d97f2[_0x7ea4('0x32')][_0x7ea4('0x1c')]);_0x3eb635[_0x7ea4('0x1e')]=qs[_0x7ea4('0x1e')](_0x2d97f2[_0x7ea4('0x32')][_0x7ea4('0x1e')]);}return _0x33cdec[_0x7ea4('0x4a')](_0x3eb635);}})[_0x7ea4('0x26')](function(_0x54dbc5){if(_0x54dbc5){return _0x54dbc5?{'count':_0x378581,'rows':_0x54dbc5}:null;}})[_0x7ea4('0x26')](respondWithResult(_0x7c2f96,null))['catch'](handleError(_0x7c2f96,null));};exports[_0x7ea4('0x4d')]=function(_0x12182b,_0xb10eef,_0x579b5d){if(_0x12182b[_0x7ea4('0x48')]['id']){delete _0x12182b[_0x7ea4('0x48')]['id'];}return db[_0x7ea4('0x42')][_0x7ea4('0x4b')]({'where':{'id':_0x12182b[_0x7ea4('0x44')]['id']}})[_0x7ea4('0x26')](handleEntityNotFound(_0xb10eef,null))[_0x7ea4('0x26')](function(_0x24560a){if(_0x24560a){_0x12182b['body'][_0x7ea4('0x4e')]=_0x24560a['id'];_0x12182b[_0x7ea4('0x48')][_0x7ea4('0x4f')]=integrations['getSubjects'](_0x12182b['body']['channel'],_0x12182b[_0x7ea4('0x48')]['type']);_0x12182b[_0x7ea4('0x48')][_0x7ea4('0x50')]=integrations['getDescriptions'](_0x12182b[_0x7ea4('0x48')][_0x7ea4('0x51')],_0x12182b[_0x7ea4('0x48')][_0x7ea4('0x2e')]);return db['DeskConfiguration'][_0x7ea4('0x47')](_0x12182b['body'],{'include':[{'model':db[_0x7ea4('0x52')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x7ea4('0x50')}]});}return null;})[_0x7ea4('0x26')](respondWithResult(_0xb10eef,null))[_0x7ea4('0x49')](handleError(_0xb10eef,null));};exports[_0x7ea4('0x53')]=function(_0x4eb38e,_0x445783,_0x5264b0){var _0x472e2f=[{'name':_0x7ea4('0x54'),'label':_0x7ea4('0x54'),'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 _0x162eb9='';return db[_0x7ea4('0x42')][_0x7ea4('0x4b')]({'where':{'id':_0x4eb38e[_0x7ea4('0x44')]['id']},'attributes':['id',_0x7ea4('0x55'),_0x7ea4('0x56'),_0x7ea4('0x57'),_0x7ea4('0x58'),_0x7ea4('0x59'),'consumerSecret',_0x7ea4('0x5a'),_0x7ea4('0x5b')]})[_0x7ea4('0x26')](handleEntityNotFound(_0x445783,null))[_0x7ea4('0x26')](function(_0x2b6466){if(_0x2b6466){_0x162eb9=_0x2b6466[_0x7ea4('0x55')];var _0x297254=_0x162eb9['slice'](-0x1);if(_0x297254==='/'){_0x162eb9=_0x162eb9[_0x7ea4('0x5c')](0x0,_0x162eb9[_0x7ea4('0x5d')](_0x297254));}var _0x162289={'method':_0x7ea4('0x5e'),'uri':util[_0x7ea4('0x5f')](_0x7ea4('0x60'),_0x162eb9),'headers':{'Content-Type':_0x7ea4('0x61'),'Accept':_0x7ea4('0x61')},'json':!![]};if(_0x2b6466[_0x7ea4('0x56')]===_0x7ea4('0x62')){_0x162289[_0x7ea4('0x63')]['Authorization']=util[_0x7ea4('0x5f')](_0x7ea4('0x64'),new Buffer(util[_0x7ea4('0x5f')]('%s:%s',_0x2b6466[_0x7ea4('0x57')],_0x2b6466[_0x7ea4('0x58')]))[_0x7ea4('0x65')](_0x7ea4('0x66')));}return rp(_0x162289)[_0x7ea4('0x26')](function(_0x21ce45){return _0x472e2f[_0x7ea4('0x67')](_[_0x7ea4('0x31')](_0x21ce45[_0x7ea4('0x68')]['entries'],function(_0x4975ca){return{'id':_0x4975ca[_0x7ea4('0x2a')],'name':_0x4975ca['name'],'type':_0x4975ca[_0x7ea4('0x2e')],'active':_0x4975ca['active'],'label':_0x4975ca[_0x7ea4('0x69')],'custom':!![]};}));});}})['then'](function(_0xbc46ac){return{'count':_0xbc46ac[_0x7ea4('0x38')],'rows':_0xbc46ac};})[_0x7ea4('0x26')](respondWithResult(_0x445783,null))[_0x7ea4('0x49')](function(_0x4af770){var _0x361da9=_0x4eb38e['query'][_0x7ea4('0x6a')]?0x1f4:_0x4af770[_0x7ea4('0x6b')]||0x1f4;logger[_0x7ea4('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x7ea4('0x53'),_0x361da9,JSON[_0x7ea4('0x6c')](_0x4af770));delete _0x4af770[_0x7ea4('0x2a')];if(_0x361da9===0x191){_0x361da9=0x190;}_0x445783[_0x7ea4('0x1f')](_0x361da9)[_0x7ea4('0x2b')](_0x4eb38e[_0x7ea4('0x32')][_0x7ea4('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x4af770['statusCode']}:_0x4af770);});}; \ No newline at end of file +var _0x430f=['Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','DeskAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne','DeskConfiguration','hasOwnProperty','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','DeskField','getFields','authType','password','consumerSecret','tokenSecret','remoteUri','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','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/license/util','../../components/integrations/configuration','end','status','json','offset','undefined','count','limit','set'];(function(_0x1f612d,_0x243c0d){var _0xc6089b=function(_0x3e7b47){while(--_0x3e7b47){_0x1f612d['push'](_0x1f612d['shift']());}};_0xc6089b(++_0x243c0d);}(_0x430f,0x1b6));var _0xf430=function(_0x591707,_0x44302b){_0x591707=_0x591707-0x0;var _0x3df29c=_0x430f[_0x591707];return _0x3df29c;};'use strict';var emlformat=require(_0xf430('0x0'));var rimraf=require(_0xf430('0x1'));var zipdir=require(_0xf430('0x2'));var jsonpatch=require(_0xf430('0x3'));var rp=require(_0xf430('0x4'));var moment=require('moment');var BPromise=require(_0xf430('0x5'));var Mustache=require('mustache');var util=require(_0xf430('0x6'));var path=require(_0xf430('0x7'));var sox=require('sox');var csv=require(_0xf430('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf430('0x9'));var _=require(_0xf430('0xa'));var squel=require(_0xf430('0xb'));var crypto=require(_0xf430('0xc'));var jsforce=require(_0xf430('0xd'));var deskjs=require(_0xf430('0xe'));var toCsv=require(_0xf430('0x8'));var querystring=require(_0xf430('0xf'));var Papa=require(_0xf430('0x10'));var Redis=require(_0xf430('0x11'));var authService=require(_0xf430('0x12'));var qs=require(_0xf430('0x13'));var as=require(_0xf430('0x14'));var hardwareService=require(_0xf430('0x15'));var logger=require(_0xf430('0x16'))(_0xf430('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf430('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf430('0x19'));function respondWithStatusCode(_0x5b51a4,_0x1ccef2){_0x1ccef2=_0x1ccef2||0xcc;return function(_0x3e417f){if(_0x3e417f){return _0x5b51a4['sendStatus'](_0x1ccef2);}return _0x5b51a4['status'](_0x1ccef2)[_0xf430('0x1a')]();};}function respondWithResult(_0x50695d,_0x381982){_0x381982=_0x381982||0xc8;return function(_0x3abc14){if(_0x3abc14){return _0x50695d[_0xf430('0x1b')](_0x381982)[_0xf430('0x1c')](_0x3abc14);}};}function respondWithFilteredResult(_0xf1fc62,_0x2ce1b0){return function(_0x238b25){if(_0x238b25){var _0x55cd2d=typeof _0x2ce1b0[_0xf430('0x1d')]==='undefined'&&typeof _0x2ce1b0['limit']===_0xf430('0x1e');var _0x1f3862=_0x238b25[_0xf430('0x1f')];var _0x1bb0d7=_0x55cd2d?0x0:_0x2ce1b0[_0xf430('0x1d')];var _0x1146ac=_0x55cd2d?_0x238b25[_0xf430('0x1f')]:_0x2ce1b0['offset']+_0x2ce1b0[_0xf430('0x20')];var _0x2e5f75;if(_0x1146ac>=_0x1f3862){_0x1146ac=_0x1f3862;_0x2e5f75=0xc8;}else{_0x2e5f75=0xce;}_0xf1fc62['status'](_0x2e5f75);return _0xf1fc62[_0xf430('0x21')](_0xf430('0x22'),_0x1bb0d7+'-'+_0x1146ac+'/'+_0x1f3862)[_0xf430('0x1c')](_0x238b25);}return null;};}function patchUpdates(_0x4b2f65){return function(_0x2c1b39){try{jsonpatch[_0xf430('0x23')](_0x2c1b39,_0x4b2f65,!![]);}catch(_0x5ba275){return BPromise[_0xf430('0x24')](_0x5ba275);}return _0x2c1b39[_0xf430('0x25')]();};}function saveUpdates(_0x1a0cb3,_0x3b57e0){return function(_0x52f61f){if(_0x52f61f){return _0x52f61f[_0xf430('0x26')](_0x1a0cb3)['then'](function(_0x219b78){return _0x219b78;});}return null;};}function removeEntity(_0xc98723,_0xb5919f){return function(_0x2d5957){if(_0x2d5957){return _0x2d5957[_0xf430('0x27')]()[_0xf430('0x28')](function(){_0xc98723[_0xf430('0x1b')](0xcc)[_0xf430('0x1a')]();});}};}function handleEntityNotFound(_0x2c5dae,_0x34f548){return function(_0x1d6547){if(!_0x1d6547){_0x2c5dae[_0xf430('0x29')](0x194);}return _0x1d6547;};}function handleError(_0x26513e,_0x3f39aa){_0x3f39aa=_0x3f39aa||0x1f4;return function(_0x55e18a){logger[_0xf430('0x2a')](_0x55e18a[_0xf430('0x2b')]);if(_0x55e18a[_0xf430('0x2c')]){delete _0x55e18a[_0xf430('0x2c')];}_0x26513e['status'](_0x3f39aa)[_0xf430('0x2d')](_0x55e18a);};}exports[_0xf430('0x2e')]=function(_0xd10ee7,_0x7b5b24){var _0x1e9947={},_0x5db6e3={},_0x1ef9d4={'count':0x0,'rows':[]};var _0x1671f1=_[_0xf430('0x2f')](db['DeskAccount'][_0xf430('0x30')],function(_0x465f3b){return{'name':_0x465f3b['fieldName'],'type':_0x465f3b['type'][_0xf430('0x31')]};});_0x5db6e3[_0xf430('0x32')]=_[_0xf430('0x2f')](_0x1671f1,_0xf430('0x2c'));_0x5db6e3[_0xf430('0x33')]=_['keys'](_0xd10ee7[_0xf430('0x33')]);_0x5db6e3['filters']=_[_0xf430('0x34')](_0x5db6e3[_0xf430('0x32')],_0x5db6e3[_0xf430('0x33')]);_0x1e9947[_0xf430('0x35')]=_[_0xf430('0x34')](_0x5db6e3['model'],qs['fields'](_0xd10ee7[_0xf430('0x33')][_0xf430('0x36')]));_0x1e9947[_0xf430('0x35')]=_0x1e9947[_0xf430('0x35')][_0xf430('0x37')]?_0x1e9947[_0xf430('0x35')]:_0x5db6e3[_0xf430('0x32')];if(!_0xd10ee7[_0xf430('0x33')]['hasOwnProperty'](_0xf430('0x38'))){_0x1e9947[_0xf430('0x20')]=qs[_0xf430('0x20')](_0xd10ee7[_0xf430('0x33')][_0xf430('0x20')]);_0x1e9947[_0xf430('0x1d')]=qs[_0xf430('0x1d')](_0xd10ee7['query']['offset']);}_0x1e9947[_0xf430('0x39')]=qs[_0xf430('0x3a')](_0xd10ee7[_0xf430('0x33')]['sort']);_0x1e9947[_0xf430('0x3b')]=qs[_0xf430('0x3c')](_['pick'](_0xd10ee7[_0xf430('0x33')],_0x5db6e3['filters']),_0x1671f1);if(_0xd10ee7[_0xf430('0x33')][_0xf430('0x3d')]){_0x1e9947['where']=_[_0xf430('0x3e')](_0x1e9947[_0xf430('0x3b')],{'$or':_[_0xf430('0x2f')](_0x1671f1,function(_0x2db392){if(_0x2db392[_0xf430('0x3f')]!==_0xf430('0x40')){var _0x2d73ff={};_0x2d73ff[_0x2db392['name']]={'$like':'%'+_0xd10ee7[_0xf430('0x33')][_0xf430('0x3d')]+'%'};return _0x2d73ff;}})});}_0x1e9947=_['merge']({},_0x1e9947,_0xd10ee7[_0xf430('0x41')]);var _0x49836e={'where':_0x1e9947['where']};return db[_0xf430('0x42')][_0xf430('0x1f')](_0x49836e)[_0xf430('0x28')](function(_0x15f2b1){_0x1ef9d4[_0xf430('0x1f')]=_0x15f2b1;if(_0xd10ee7[_0xf430('0x33')][_0xf430('0x43')]){_0x1e9947[_0xf430('0x44')]=[{'all':!![]}];}return db[_0xf430('0x42')][_0xf430('0x45')](_0x1e9947);})['then'](function(_0xfdee6e){_0x1ef9d4[_0xf430('0x46')]=_0xfdee6e;return _0x1ef9d4;})[_0xf430('0x28')](respondWithFilteredResult(_0x7b5b24,_0x1e9947))[_0xf430('0x47')](handleError(_0x7b5b24,null));};exports[_0xf430('0x48')]=function(_0x5a05cf,_0x52018a){var _0xe3e7ca={'raw':![],'where':{'id':_0x5a05cf[_0xf430('0x49')]['id']}},_0x479dd9={};_0x479dd9[_0xf430('0x32')]=_['keys'](db[_0xf430('0x42')][_0xf430('0x30')]);_0x479dd9[_0xf430('0x33')]=_[_0xf430('0x4a')](_0x5a05cf[_0xf430('0x33')]);_0x479dd9[_0xf430('0x3c')]=_['intersection'](_0x479dd9['model'],_0x479dd9['query']);_0xe3e7ca['attributes']=_[_0xf430('0x34')](_0x479dd9['model'],qs[_0xf430('0x36')](_0x5a05cf[_0xf430('0x33')][_0xf430('0x36')]));_0xe3e7ca[_0xf430('0x35')]=_0xe3e7ca[_0xf430('0x35')][_0xf430('0x37')]?_0xe3e7ca[_0xf430('0x35')]:_0x479dd9[_0xf430('0x32')];if(_0x5a05cf[_0xf430('0x33')]['includeAll']){_0xe3e7ca[_0xf430('0x44')]=[{'all':!![]}];}_0xe3e7ca=_[_0xf430('0x3e')]({},_0xe3e7ca,_0x5a05cf[_0xf430('0x41')]);return db['DeskAccount'][_0xf430('0x4b')](_0xe3e7ca)[_0xf430('0x28')](handleEntityNotFound(_0x52018a,null))['then'](respondWithResult(_0x52018a,null))[_0xf430('0x47')](handleError(_0x52018a,null));};exports[_0xf430('0x4c')]=function(_0x163bb8,_0x3b75b3){return db[_0xf430('0x42')][_0xf430('0x4c')](_0x163bb8['body'],{})[_0xf430('0x28')](respondWithResult(_0x3b75b3,0xc9))['catch'](handleError(_0x3b75b3,null));};exports['update']=function(_0x37c662,_0x5f1ae2){if(_0x37c662[_0xf430('0x4d')]['id']){delete _0x37c662['body']['id'];}return db[_0xf430('0x42')][_0xf430('0x4b')]({'where':{'id':_0x37c662[_0xf430('0x49')]['id']}})[_0xf430('0x28')](handleEntityNotFound(_0x5f1ae2,null))[_0xf430('0x28')](saveUpdates(_0x37c662[_0xf430('0x4d')],null))['then'](respondWithResult(_0x5f1ae2,null))[_0xf430('0x47')](handleError(_0x5f1ae2,null));};exports[_0xf430('0x27')]=function(_0x2c8ae1,_0x12025c){return db[_0xf430('0x42')][_0xf430('0x4b')]({'where':{'id':_0x2c8ae1[_0xf430('0x49')]['id']}})[_0xf430('0x28')](handleEntityNotFound(_0x12025c,null))['then'](removeEntity(_0x12025c,null))[_0xf430('0x47')](handleError(_0x12025c,null));};exports['getConfigurations']=function(_0x1f73db,_0x10a9bc,_0x230f21){var _0x5e6ae2={};var _0x425f4d={};var _0x45780c;var _0x48bbf8;return db[_0xf430('0x42')][_0xf430('0x4e')]({'where':{'id':_0x1f73db['params']['id']}})['then'](handleEntityNotFound(_0x10a9bc,null))[_0xf430('0x28')](function(_0x441d02){if(_0x441d02){_0x45780c=_0x441d02;_0x425f4d[_0xf430('0x32')]=_[_0xf430('0x4a')](db[_0xf430('0x4f')]['rawAttributes']);_0x425f4d[_0xf430('0x33')]=_['keys'](_0x1f73db['query']);_0x425f4d['filters']=_[_0xf430('0x34')](_0x425f4d[_0xf430('0x32')],_0x425f4d[_0xf430('0x33')]);_0x5e6ae2[_0xf430('0x35')]=_[_0xf430('0x34')](_0x425f4d[_0xf430('0x32')],qs[_0xf430('0x36')](_0x1f73db['query'][_0xf430('0x36')]));_0x5e6ae2['attributes']=_0x5e6ae2[_0xf430('0x35')][_0xf430('0x37')]?_0x5e6ae2['attributes']:_0x425f4d[_0xf430('0x32')];_0x5e6ae2['order']=qs[_0xf430('0x3a')](_0x1f73db[_0xf430('0x33')][_0xf430('0x3a')]);_0x5e6ae2[_0xf430('0x3b')]=qs[_0xf430('0x3c')](_['pick'](_0x1f73db['query'],_0x425f4d['filters']));if(_0x1f73db[_0xf430('0x33')][_0xf430('0x3d')]){_0x5e6ae2[_0xf430('0x3b')]=_[_0xf430('0x3e')](_0x5e6ae2[_0xf430('0x3b')],{'$or':_['map'](_0x5e6ae2[_0xf430('0x35')],function(_0x3de43c){var _0x37bdfd={};_0x37bdfd[_0x3de43c]={'$like':'%'+_0x1f73db[_0xf430('0x33')][_0xf430('0x3d')]+'%'};return _0x37bdfd;})});}_0x5e6ae2=_[_0xf430('0x3e')]({},_0x5e6ae2,_0x1f73db['options']);return _0x45780c['getConfigurations'](_0x5e6ae2);}})['then'](function(_0x5b159d){if(_0x5b159d){_0x48bbf8=_0x5b159d[_0xf430('0x37')];if(!_0x1f73db[_0xf430('0x33')][_0xf430('0x50')]('nolimit')){_0x5e6ae2[_0xf430('0x20')]=qs[_0xf430('0x20')](_0x1f73db[_0xf430('0x33')][_0xf430('0x20')]);_0x5e6ae2['offset']=qs[_0xf430('0x1d')](_0x1f73db[_0xf430('0x33')][_0xf430('0x1d')]);}return _0x45780c[_0xf430('0x51')](_0x5e6ae2);}})['then'](function(_0x3d6ab1){if(_0x3d6ab1){return _0x3d6ab1?{'count':_0x48bbf8,'rows':_0x3d6ab1}:null;}})[_0xf430('0x28')](respondWithResult(_0x10a9bc,null))[_0xf430('0x47')](handleError(_0x10a9bc,null));};exports[_0xf430('0x52')]=function(_0x3767d1,_0x8a075b,_0x3379db){if(_0x3767d1['body']['id']){delete _0x3767d1[_0xf430('0x4d')]['id'];}return db['DeskAccount'][_0xf430('0x4e')]({'where':{'id':_0x3767d1['params']['id']}})['then'](handleEntityNotFound(_0x8a075b,null))[_0xf430('0x28')](function(_0x1fcef6){if(_0x1fcef6){_0x3767d1[_0xf430('0x4d')][_0xf430('0x53')]=_0x1fcef6['id'];_0x3767d1['body'][_0xf430('0x54')]=integrations['getSubjects'](_0x3767d1[_0xf430('0x4d')][_0xf430('0x55')],_0x3767d1[_0xf430('0x4d')]['type']);_0x3767d1[_0xf430('0x4d')]['Descriptions']=integrations[_0xf430('0x56')](_0x3767d1['body'][_0xf430('0x55')],_0x3767d1['body'][_0xf430('0x3f')]);return db[_0xf430('0x4f')][_0xf430('0x4c')](_0x3767d1[_0xf430('0x4d')],{'include':[{'model':db[_0xf430('0x57')],'as':_0xf430('0x54')},{'model':db[_0xf430('0x57')],'as':'Descriptions'}]});}return null;})[_0xf430('0x28')](respondWithResult(_0x8a075b,null))[_0xf430('0x47')](handleError(_0x8a075b,null));};exports[_0xf430('0x58')]=function(_0x2cbcb1,_0x58d23c,_0x27db30){var _0x12b794=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xd1b516='';return db['DeskAccount']['findOne']({'where':{'id':_0x2cbcb1[_0xf430('0x49')]['id']},'attributes':['id','remoteUri',_0xf430('0x59'),'username',_0xf430('0x5a'),'consumerKey',_0xf430('0x5b'),'token',_0xf430('0x5c')]})[_0xf430('0x28')](handleEntityNotFound(_0x58d23c,null))[_0xf430('0x28')](function(_0x2aea5a){if(_0x2aea5a){_0xd1b516=_0x2aea5a[_0xf430('0x5d')];var _0x283cb1=_0xd1b516['slice'](-0x1);if(_0x283cb1==='/'){_0xd1b516=_0xd1b516[_0xf430('0x5e')](0x0,_0xd1b516[_0xf430('0x5f')](_0x283cb1));}var _0x1898ab={'method':_0xf430('0x60'),'uri':util[_0xf430('0x61')](_0xf430('0x62'),_0xd1b516),'headers':{'Content-Type':_0xf430('0x63'),'Accept':_0xf430('0x63')},'json':!![]};if(_0x2aea5a[_0xf430('0x59')]===_0xf430('0x64')){_0x1898ab[_0xf430('0x65')][_0xf430('0x66')]=util['format'](_0xf430('0x67'),new Buffer(util[_0xf430('0x61')](_0xf430('0x68'),_0x2aea5a[_0xf430('0x69')],_0x2aea5a[_0xf430('0x5a')]))[_0xf430('0x6a')](_0xf430('0x6b')));}return rp(_0x1898ab)['then'](function(_0x317453){return _0x12b794[_0xf430('0x6c')](_[_0xf430('0x2f')](_0x317453[_0xf430('0x6d')][_0xf430('0x6e')],function(_0x236595){return{'id':_0x236595[_0xf430('0x2c')],'name':_0x236595['name'],'type':_0x236595['type'],'active':_0x236595[_0xf430('0x6f')],'label':_0x236595[_0xf430('0x70')],'custom':!![]};}));});}})[_0xf430('0x28')](function(_0x30c7e1){return{'count':_0x30c7e1[_0xf430('0x37')],'rows':_0x30c7e1};})['then'](respondWithResult(_0x58d23c,null))[_0xf430('0x47')](function(_0x406699){var _0x3eefaa=_0x2cbcb1[_0xf430('0x33')]['test']?0x1f4:_0x406699[_0xf430('0x71')]||0x1f4;logger[_0xf430('0x2a')](_0xf430('0x72'),'getFields',_0x3eefaa,JSON[_0xf430('0x73')](_0x406699));delete _0x406699[_0xf430('0x2c')];if(_0x3eefaa===0x191){_0x3eefaa=0x190;}_0x58d23c['status'](_0x3eefaa)[_0xf430('0x2d')](_0x2cbcb1['query'][_0xf430('0x74')]?{'message':_0xf430('0x75'),'statusCode':_0x406699[_0xf430('0x71')]}:_0x406699);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 062d367..3cbc9f3 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 _0x4743=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39d4fb,_0x1663a2){var _0x570d46=function(_0x19e373){while(--_0x19e373){_0x39d4fb['push'](_0x39d4fb['shift']());}};_0x570d46(++_0x1663a2);}(_0x4743,0x16c));var _0x3474=function(_0x49b984,_0x387c83){_0x49b984=_0x49b984-0x0;var _0x49d1e0=_0x4743[_0x49b984];return _0x49d1e0;};'use strict';var _=require(_0x3474('0x0'));var util=require('util');var logger=require(_0x3474('0x1'))('api');var moment=require(_0x3474('0x2'));var BPromise=require(_0x3474('0x3'));var rp=require(_0x3474('0x4'));var fs=require('fs');var path=require(_0x3474('0x5'));var rimraf=require(_0x3474('0x6'));var config=require(_0x3474('0x7'));var attributes=require(_0x3474('0x8'));var integrations=require(_0x3474('0x9'));module[_0x3474('0xa')]=function(_0x133d3e,_0x144442){return _0x133d3e['define'](_0x3474('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5bfd=['exports','DeskAccount','int_desk_accounts','lodash','api','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x19fec1,_0x1cc62f){var _0x29cd35=function(_0x712a4f){while(--_0x712a4f){_0x19fec1['push'](_0x19fec1['shift']());}};_0x29cd35(++_0x1cc62f);}(_0x5bfd,0x9d));var _0xd5bf=function(_0x594548,_0x43412f){_0x594548=_0x594548-0x0;var _0x1631ab=_0x5bfd[_0x594548];return _0x1631ab;};'use strict';var _=require(_0xd5bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd5bf('0x1'));var moment=require('moment');var BPromise=require(_0xd5bf('0x2'));var rp=require(_0xd5bf('0x3'));var fs=require('fs');var path=require(_0xd5bf('0x4'));var rimraf=require('rimraf');var config=require(_0xd5bf('0x5'));var attributes=require(_0xd5bf('0x6'));var integrations=require(_0xd5bf('0x7'));module[_0xd5bf('0x8')]=function(_0x4725e5,_0x3a391d){return _0x4725e5['define'](_0xd5bf('0x9'),attributes,{'tableName':_0xd5bf('0xa'),'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 bf199fa..f43c5c0 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 _0x5a36=['rpc','../../config/environment','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','limit','include','map','model','attributes','debug','ShowDeskAccount','find','lodash','util','moment','randomstring','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5a36,0x19b));var _0x65a3=function(_0x5ddd7f,_0x3b5443){_0x5ddd7f=_0x5ddd7f-0x0;var _0x42dfbf=_0x5a36[_0x5ddd7f];return _0x42dfbf;};'use strict';var _=require(_0x65a3('0x0'));var util=require(_0x65a3('0x1'));var moment=require(_0x65a3('0x2'));var BPromise=require('bluebird');var rs=require(_0x65a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x65a3('0x4'));var logger=require('../../config/logger')(_0x65a3('0x5'));var config=require(_0x65a3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65a3('0x7')][_0x65a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x119bf8,_0x19319e,_0x16aa96){return new BPromise(function(_0x3bad97,_0xd3bc6f){return client['request'](_0x119bf8,_0x16aa96)[_0x65a3('0x9')](function(_0x4b8dcd){logger[_0x65a3('0xa')](_0x65a3('0xb'),_0x19319e,_0x65a3('0xc'));logger['debug'](_0x65a3('0xd'),_0x19319e,_0x65a3('0xc'),JSON[_0x65a3('0xe')](_0x4b8dcd));if(_0x4b8dcd[_0x65a3('0xf')]){if(_0x4b8dcd[_0x65a3('0xf')]['code']===0x1f4){logger[_0x65a3('0xf')](_0x65a3('0xb'),_0x19319e,_0x4b8dcd[_0x65a3('0xf')][_0x65a3('0x10')]);return _0xd3bc6f(_0x4b8dcd[_0x65a3('0xf')][_0x65a3('0x10')]);}logger[_0x65a3('0xf')](_0x65a3('0xb'),_0x19319e,_0x4b8dcd[_0x65a3('0xf')][_0x65a3('0x10')]);return _0x3bad97(_0x4b8dcd['error'][_0x65a3('0x10')]);}else{logger[_0x65a3('0xa')]('DeskAccount,\x20%s,\x20%s',_0x19319e,_0x65a3('0xc'));_0x3bad97(_0x4b8dcd[_0x65a3('0x11')]['message']);}})[_0x65a3('0x12')](function(_0x2790e2){logger[_0x65a3('0xf')](_0x65a3('0xb'),_0x19319e,_0x2790e2);_0xd3bc6f(_0x2790e2);});});}exports[_0x65a3('0x13')]=function(_0x5461c2){var _0x1561ec=this;return new Promise(function(_0xd8d903,_0x5ccd05){return db[_0x65a3('0x14')][_0x65a3('0x15')]({'raw':_0x5461c2['options']?_0x5461c2[_0x65a3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5461c2[_0x65a3('0x16')]?_0x5461c2[_0x65a3('0x16')][_0x65a3('0x17')]||null:null,'attributes':_0x5461c2[_0x65a3('0x16')]?_0x5461c2[_0x65a3('0x16')]['attributes']||null:null,'limit':_0x5461c2[_0x65a3('0x16')]?_0x5461c2[_0x65a3('0x16')][_0x65a3('0x18')]||null:null,'include':_0x5461c2[_0x65a3('0x16')]?_0x5461c2[_0x65a3('0x16')][_0x65a3('0x19')]?_[_0x65a3('0x1a')](_0x5461c2[_0x65a3('0x16')]['include'],function(_0x8c14e6){return{'model':db[_0x8c14e6[_0x65a3('0x1b')]],'as':_0x8c14e6['as'],'attributes':_0x8c14e6[_0x65a3('0x1c')],'include':_0x8c14e6[_0x65a3('0x19')]?_[_0x65a3('0x1a')](_0x8c14e6[_0x65a3('0x19')],function(_0x5643f0){return{'model':db[_0x5643f0[_0x65a3('0x1b')]],'as':_0x5643f0['as'],'attributes':_0x5643f0[_0x65a3('0x1c')],'include':_0x5643f0['include']?_['map'](_0x5643f0[_0x65a3('0x19')],function(_0x39db29){return{'model':db[_0x39db29['model']],'as':_0x39db29['as'],'attributes':_0x39db29[_0x65a3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x65a3('0x9')](function(_0x408938){logger[_0x65a3('0xa')](_0x65a3('0x13'),_0x5461c2);logger[_0x65a3('0x1d')](_0x65a3('0x13'),_0x5461c2,JSON['stringify'](_0x408938));_0xd8d903(_0x408938);})['catch'](function(_0x5f0224){logger[_0x65a3('0xf')]('GetDeskAccount',_0x5f0224[_0x65a3('0x10')],_0x5461c2);_0x5ccd05(_0x1561ec[_0x65a3('0xf')](0x1f4,_0x5f0224[_0x65a3('0x10')]));});});};exports[_0x65a3('0x1e')]=function(_0x1c7f7d){var _0x3ad0ca=this;return new Promise(function(_0x42ef48,_0x538bd9){return db[_0x65a3('0x14')][_0x65a3('0x1f')]({'raw':_0x1c7f7d[_0x65a3('0x16')]?_0x1c7f7d[_0x65a3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1c7f7d['options']?_0x1c7f7d[_0x65a3('0x16')][_0x65a3('0x17')]||null:null,'attributes':_0x1c7f7d['options']?_0x1c7f7d[_0x65a3('0x16')][_0x65a3('0x1c')]||null:null,'include':_0x1c7f7d['options']?_0x1c7f7d[_0x65a3('0x16')][_0x65a3('0x19')]?_[_0x65a3('0x1a')](_0x1c7f7d[_0x65a3('0x16')][_0x65a3('0x19')],function(_0x32947e){return{'model':db[_0x32947e[_0x65a3('0x1b')]],'as':_0x32947e['as'],'attributes':_0x32947e[_0x65a3('0x1c')],'include':_0x32947e['include']?_[_0x65a3('0x1a')](_0x32947e[_0x65a3('0x19')],function(_0x271b43){return{'model':db[_0x271b43['model']],'as':_0x271b43['as'],'attributes':_0x271b43[_0x65a3('0x1c')],'include':_0x271b43['include']?_[_0x65a3('0x1a')](_0x271b43['include'],function(_0x408b34){return{'model':db[_0x408b34['model']],'as':_0x408b34['as'],'attributes':_0x408b34[_0x65a3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x65a3('0x9')](function(_0x325b69){logger['info'](_0x65a3('0x1e'),_0x1c7f7d);logger[_0x65a3('0x1d')]('ShowDeskAccount',_0x1c7f7d,JSON[_0x65a3('0xe')](_0x325b69));_0x42ef48(_0x325b69);})['catch'](function(_0x856d34){logger[_0x65a3('0xf')](_0x65a3('0x1e'),_0x856d34[_0x65a3('0x10')],_0x1c7f7d);_0x538bd9(_0x3ad0ca[_0x65a3('0xf')](0x1f4,_0x856d34[_0x65a3('0x10')]));});});}; \ No newline at end of file +var _0x3a90=['stringify','error','message','info','GetDeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','catch','DeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0xd91551,_0x52d19c){var _0x4a387c=function(_0x1207a4){while(--_0x1207a4){_0xd91551['push'](_0xd91551['shift']());}};_0x4a387c(++_0x52d19c);}(_0x3a90,0xbc));var _0x03a9=function(_0x137881,_0x407d58){_0x137881=_0x137881-0x0;var _0x937122=_0x3a90[_0x137881];return _0x937122;};'use strict';var _=require(_0x03a9('0x0'));var util=require(_0x03a9('0x1'));var moment=require(_0x03a9('0x2'));var BPromise=require(_0x03a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x03a9('0x5'));var config=require(_0x03a9('0x6'));var jayson=require(_0x03a9('0x7'));var client=jayson[_0x03a9('0x8')][_0x03a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dbd99,_0x5a9d8f,_0x2ba63d){return new BPromise(function(_0x435f4c,_0xdc4364){return client[_0x03a9('0xa')](_0x1dbd99,_0x2ba63d)[_0x03a9('0xb')](function(_0x57a00e){logger['info'](_0x03a9('0xc'),_0x5a9d8f,_0x03a9('0xd'));logger[_0x03a9('0xe')](_0x03a9('0xf'),_0x5a9d8f,_0x03a9('0xd'),JSON[_0x03a9('0x10')](_0x57a00e));if(_0x57a00e[_0x03a9('0x11')]){if(_0x57a00e[_0x03a9('0x11')]['code']===0x1f4){logger[_0x03a9('0x11')](_0x03a9('0xc'),_0x5a9d8f,_0x57a00e[_0x03a9('0x11')]['message']);return _0xdc4364(_0x57a00e[_0x03a9('0x11')][_0x03a9('0x12')]);}logger[_0x03a9('0x11')]('DeskAccount,\x20%s,\x20%s',_0x5a9d8f,_0x57a00e[_0x03a9('0x11')]['message']);return _0x435f4c(_0x57a00e[_0x03a9('0x11')]['message']);}else{logger[_0x03a9('0x13')](_0x03a9('0xc'),_0x5a9d8f,'request\x20sent');_0x435f4c(_0x57a00e['result']['message']);}})['catch'](function(_0x40510f){logger['error'](_0x03a9('0xc'),_0x5a9d8f,_0x40510f);_0xdc4364(_0x40510f);});});}exports[_0x03a9('0x14')]=function(_0x2d6a27){var _0x167b07=this;return new Promise(function(_0x6b3d36,_0x357217){return db['DeskAccount'][_0x03a9('0x15')]({'raw':_0x2d6a27[_0x03a9('0x16')]?_0x2d6a27[_0x03a9('0x16')][_0x03a9('0x17')]===undefined?!![]:![]:!![],'where':_0x2d6a27[_0x03a9('0x16')]?_0x2d6a27['options'][_0x03a9('0x18')]||null:null,'attributes':_0x2d6a27[_0x03a9('0x16')]?_0x2d6a27[_0x03a9('0x16')]['attributes']||null:null,'limit':_0x2d6a27[_0x03a9('0x16')]?_0x2d6a27[_0x03a9('0x16')][_0x03a9('0x19')]||null:null,'include':_0x2d6a27[_0x03a9('0x16')]?_0x2d6a27[_0x03a9('0x16')][_0x03a9('0x1a')]?_[_0x03a9('0x1b')](_0x2d6a27['options'][_0x03a9('0x1a')],function(_0x53e627){return{'model':db[_0x53e627[_0x03a9('0x1c')]],'as':_0x53e627['as'],'attributes':_0x53e627[_0x03a9('0x1d')],'include':_0x53e627[_0x03a9('0x1a')]?_[_0x03a9('0x1b')](_0x53e627[_0x03a9('0x1a')],function(_0x485cca){return{'model':db[_0x485cca['model']],'as':_0x485cca['as'],'attributes':_0x485cca[_0x03a9('0x1d')],'include':_0x485cca[_0x03a9('0x1a')]?_[_0x03a9('0x1b')](_0x485cca['include'],function(_0xa5f2d2){return{'model':db[_0xa5f2d2[_0x03a9('0x1c')]],'as':_0xa5f2d2['as'],'attributes':_0xa5f2d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x03a9('0xb')](function(_0x536118){logger[_0x03a9('0x13')]('GetDeskAccount',_0x2d6a27);logger[_0x03a9('0xe')]('GetDeskAccount',_0x2d6a27,JSON[_0x03a9('0x10')](_0x536118));_0x6b3d36(_0x536118);})[_0x03a9('0x1e')](function(_0x43c322){logger['error']('GetDeskAccount',_0x43c322['message'],_0x2d6a27);_0x357217(_0x167b07['error'](0x1f4,_0x43c322[_0x03a9('0x12')]));});});};exports['ShowDeskAccount']=function(_0x3d2bb7){var _0x34f689=this;return new Promise(function(_0x11c719,_0x8017a3){return db[_0x03a9('0x1f')][_0x03a9('0x20')]({'raw':_0x3d2bb7[_0x03a9('0x16')]?_0x3d2bb7[_0x03a9('0x16')][_0x03a9('0x17')]===undefined?!![]:![]:!![],'where':_0x3d2bb7[_0x03a9('0x16')]?_0x3d2bb7[_0x03a9('0x16')][_0x03a9('0x18')]||null:null,'attributes':_0x3d2bb7[_0x03a9('0x16')]?_0x3d2bb7['options'][_0x03a9('0x1d')]||null:null,'include':_0x3d2bb7['options']?_0x3d2bb7[_0x03a9('0x16')][_0x03a9('0x1a')]?_['map'](_0x3d2bb7[_0x03a9('0x16')][_0x03a9('0x1a')],function(_0x4b836d){return{'model':db[_0x4b836d['model']],'as':_0x4b836d['as'],'attributes':_0x4b836d[_0x03a9('0x1d')],'include':_0x4b836d['include']?_[_0x03a9('0x1b')](_0x4b836d[_0x03a9('0x1a')],function(_0x2b8fb2){return{'model':db[_0x2b8fb2[_0x03a9('0x1c')]],'as':_0x2b8fb2['as'],'attributes':_0x2b8fb2[_0x03a9('0x1d')],'include':_0x2b8fb2['include']?_[_0x03a9('0x1b')](_0x2b8fb2[_0x03a9('0x1a')],function(_0x2f085d){return{'model':db[_0x2f085d[_0x03a9('0x1c')]],'as':_0x2f085d['as'],'attributes':_0x2f085d['attributes']};}):[]};}):[]};}):[]:[]})[_0x03a9('0xb')](function(_0x5ed04e){logger['info']('ShowDeskAccount',_0x3d2bb7);logger['debug'](_0x03a9('0x21'),_0x3d2bb7,JSON[_0x03a9('0x10')](_0x5ed04e));_0x11c719(_0x5ed04e);})[_0x03a9('0x1e')](function(_0x25da70){logger[_0x03a9('0x11')](_0x03a9('0x21'),_0x25da70[_0x03a9('0x12')],_0x3d2bb7);_0x8017a3(_0x34f689[_0x03a9('0x11')](0x1f4,_0x25da70['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a5f200e..604e892 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x54acf5,_0x5227af){var _0x535f4d=function(_0x403e1f){while(--_0x403e1f){_0x54acf5['push'](_0x54acf5['shift']());}};_0x535f4d(++_0x5227af);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x7ed2b2,_0x38e016){var _0x27320e=function(_0x4bc460){while(--_0x4bc460){_0x7ed2b2['push'](_0x7ed2b2['shift']());}};_0x27320e(++_0x38e016);}(_0x7217,0x19e));var _0x7721=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x7217[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 2d76654..8a1d8be 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 _0x5fe6=['exports','STRING','sequelize'];(function(_0x4949a5,_0x4d4667){var _0x1269c2=function(_0x1cf087){while(--_0x1cf087){_0x4949a5['push'](_0x4949a5['shift']());}};_0x1269c2(++_0x4d4667);}(_0x5fe6,0x86));var _0x65fe=function(_0x47029e,_0x275210){_0x47029e=_0x47029e-0x0;var _0x137b88=_0x5fe6[_0x47029e];return _0x137b88;};'use strict';var Sequelize=require(_0x65fe('0x0'));module[_0x65fe('0x1')]={'name':{'type':Sequelize[_0x65fe('0x2')]},'description':{'type':Sequelize[_0x65fe('0x2')]}}; \ No newline at end of file +var _0x773e=['sequelize','STRING'];(function(_0xe99981,_0x15d90b){var _0x2b5c6b=function(_0x55a2ba){while(--_0x55a2ba){_0xe99981['push'](_0xe99981['shift']());}};_0x2b5c6b(++_0x15d90b);}(_0x773e,0x114));var _0xe773=function(_0x20561a,_0x19bfc0){_0x20561a=_0x20561a-0x0;var _0x40e249=_0x773e[_0x20561a];return _0x40e249;};'use strict';var Sequelize=require(_0xe773('0x0'));module['exports']={'name':{'type':Sequelize[_0xe773('0x1')]},'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 75d5472..5fc852d 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 _0x7745=['sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','then','end','error','name','send','index','DeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x37c2f,_0x2d5b93){var _0x1e2529=function(_0x515fbf){while(--_0x515fbf){_0x37c2f['push'](_0x37c2f['shift']());}};_0x1e2529(++_0x2d5b93);}(_0x7745,0xc1));var _0x5774=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x7745[_0x2ec461];return _0x28603d;};'use strict';var emlformat=require(_0x5774('0x0'));var rimraf=require(_0x5774('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5774('0x2'));var rp=require(_0x5774('0x3'));var moment=require(_0x5774('0x4'));var BPromise=require(_0x5774('0x5'));var Mustache=require('mustache');var util=require(_0x5774('0x6'));var path=require(_0x5774('0x7'));var sox=require(_0x5774('0x8'));var csv=require(_0x5774('0x9'));var ejs=require(_0x5774('0xa'));var fs=require('fs');var fs_extra=require(_0x5774('0xb'));var _=require(_0x5774('0xc'));var squel=require('squel');var crypto=require(_0x5774('0xd'));var jsforce=require(_0x5774('0xe'));var deskjs=require(_0x5774('0xf'));var toCsv=require(_0x5774('0x9'));var querystring=require(_0x5774('0x10'));var Papa=require(_0x5774('0x11'));var Redis=require('ioredis');var authService=require(_0x5774('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5774('0x13'));var hardwareService=require(_0x5774('0x14'));var logger=require(_0x5774('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5774('0x16'));var licenseUtil=require(_0x5774('0x17'));var db=require(_0x5774('0x18'))['db'];function respondWithStatusCode(_0x130678,_0x508c09){_0x508c09=_0x508c09||0xcc;return function(_0x25da3c){if(_0x25da3c){return _0x130678[_0x5774('0x19')](_0x508c09);}return _0x130678[_0x5774('0x1a')](_0x508c09)['end']();};}function respondWithResult(_0x4d6bba,_0x20a7dd){_0x20a7dd=_0x20a7dd||0xc8;return function(_0x551089){if(_0x551089){return _0x4d6bba[_0x5774('0x1a')](_0x20a7dd)[_0x5774('0x1b')](_0x551089);}};}function respondWithFilteredResult(_0x5e1069,_0x5d2754){return function(_0x42a9a1){if(_0x42a9a1){var _0x343585=typeof _0x5d2754[_0x5774('0x1c')]===_0x5774('0x1d')&&typeof _0x5d2754[_0x5774('0x1e')]==='undefined';var _0x10b2b4=_0x42a9a1[_0x5774('0x1f')];var _0x2f9a7b=_0x343585?0x0:_0x5d2754[_0x5774('0x1c')];var _0x1f24b2=_0x343585?_0x42a9a1[_0x5774('0x1f')]:_0x5d2754[_0x5774('0x1c')]+_0x5d2754[_0x5774('0x1e')];var _0x41b2af;if(_0x1f24b2>=_0x10b2b4){_0x1f24b2=_0x10b2b4;_0x41b2af=0xc8;}else{_0x41b2af=0xce;}_0x5e1069[_0x5774('0x1a')](_0x41b2af);return _0x5e1069[_0x5774('0x20')](_0x5774('0x21'),_0x2f9a7b+'-'+_0x1f24b2+'/'+_0x10b2b4)[_0x5774('0x1b')](_0x42a9a1);}return null;};}function patchUpdates(_0x3d638d){return function(_0x215299){try{jsonpatch[_0x5774('0x22')](_0x215299,_0x3d638d,!![]);}catch(_0x134100){return BPromise['reject'](_0x134100);}return _0x215299['save']();};}function saveUpdates(_0x2da64f,_0x2d6c6c){return function(_0x3c5e1f){if(_0x3c5e1f){return _0x3c5e1f['update'](_0x2da64f)['then'](function(_0x3bfcad){return _0x3bfcad;});}return null;};}function removeEntity(_0x596494,_0x2c39da){return function(_0x2b450){if(_0x2b450){return _0x2b450[_0x5774('0x23')]()[_0x5774('0x24')](function(){_0x596494[_0x5774('0x1a')](0xcc)[_0x5774('0x25')]();});}};}function handleEntityNotFound(_0x178ba0,_0x35eaaf){return function(_0x39338e){if(!_0x39338e){_0x178ba0[_0x5774('0x19')](0x194);}return _0x39338e;};}function handleError(_0x4340a7,_0x1e918c){_0x1e918c=_0x1e918c||0x1f4;return function(_0x1f8cb3){logger[_0x5774('0x26')](_0x1f8cb3['stack']);if(_0x1f8cb3['name']){delete _0x1f8cb3[_0x5774('0x27')];}_0x4340a7[_0x5774('0x1a')](_0x1e918c)[_0x5774('0x28')](_0x1f8cb3);};}exports[_0x5774('0x29')]=function(_0x228c74,_0x44c0cf){var _0x2bc179={},_0x39799b={},_0x3a2956={'count':0x0,'rows':[]};var _0x347562=_['map'](db[_0x5774('0x2a')][_0x5774('0x2b')],function(_0x2068ef){return{'name':_0x2068ef[_0x5774('0x2c')],'type':_0x2068ef['type'][_0x5774('0x2d')]};});_0x39799b[_0x5774('0x2e')]=_[_0x5774('0x2f')](_0x347562,_0x5774('0x27'));_0x39799b[_0x5774('0x30')]=_[_0x5774('0x31')](_0x228c74[_0x5774('0x30')]);_0x39799b['filters']=_[_0x5774('0x32')](_0x39799b['model'],_0x39799b[_0x5774('0x30')]);_0x2bc179['attributes']=_[_0x5774('0x32')](_0x39799b[_0x5774('0x2e')],qs[_0x5774('0x33')](_0x228c74[_0x5774('0x30')][_0x5774('0x33')]));_0x2bc179['attributes']=_0x2bc179[_0x5774('0x34')]['length']?_0x2bc179[_0x5774('0x34')]:_0x39799b['model'];if(!_0x228c74['query'][_0x5774('0x35')](_0x5774('0x36'))){_0x2bc179['limit']=qs[_0x5774('0x1e')](_0x228c74['query'][_0x5774('0x1e')]);_0x2bc179['offset']=qs[_0x5774('0x1c')](_0x228c74['query'][_0x5774('0x1c')]);}_0x2bc179[_0x5774('0x37')]=qs[_0x5774('0x38')](_0x228c74[_0x5774('0x30')][_0x5774('0x38')]);_0x2bc179[_0x5774('0x39')]=qs['filters'](_[_0x5774('0x3a')](_0x228c74[_0x5774('0x30')],_0x39799b[_0x5774('0x3b')]),_0x347562);if(_0x228c74[_0x5774('0x30')][_0x5774('0x3c')]){_0x2bc179[_0x5774('0x39')]=_[_0x5774('0x3d')](_0x2bc179[_0x5774('0x39')],{'$or':_[_0x5774('0x2f')](_0x347562,function(_0xdae13a){if(_0xdae13a[_0x5774('0x3e')]!==_0x5774('0x3f')){var _0x166adf={};_0x166adf[_0xdae13a[_0x5774('0x27')]]={'$like':'%'+_0x228c74[_0x5774('0x30')][_0x5774('0x3c')]+'%'};return _0x166adf;}})});}_0x2bc179=_[_0x5774('0x3d')]({},_0x2bc179,_0x228c74[_0x5774('0x40')]);var _0x46fea8={'where':_0x2bc179[_0x5774('0x39')]};return db[_0x5774('0x2a')][_0x5774('0x1f')](_0x46fea8)[_0x5774('0x24')](function(_0x532f8c){_0x3a2956['count']=_0x532f8c;if(_0x228c74[_0x5774('0x30')][_0x5774('0x41')]){_0x2bc179[_0x5774('0x42')]=[{'all':!![]}];}return db[_0x5774('0x2a')]['findAll'](_0x2bc179);})[_0x5774('0x24')](function(_0x2d38a7){_0x3a2956[_0x5774('0x43')]=_0x2d38a7;return _0x3a2956;})['then'](respondWithFilteredResult(_0x44c0cf,_0x2bc179))[_0x5774('0x44')](handleError(_0x44c0cf,null));};exports[_0x5774('0x45')]=function(_0x4b54d4,_0x559116){var _0x4652d5={'raw':![],'where':{'id':_0x4b54d4[_0x5774('0x46')]['id']}},_0x14c1cc={};_0x14c1cc['model']=_[_0x5774('0x31')](db[_0x5774('0x2a')][_0x5774('0x2b')]);_0x14c1cc[_0x5774('0x30')]=_[_0x5774('0x31')](_0x4b54d4[_0x5774('0x30')]);_0x14c1cc[_0x5774('0x3b')]=_[_0x5774('0x32')](_0x14c1cc[_0x5774('0x2e')],_0x14c1cc['query']);_0x4652d5[_0x5774('0x34')]=_['intersection'](_0x14c1cc[_0x5774('0x2e')],qs[_0x5774('0x33')](_0x4b54d4['query'][_0x5774('0x33')]));_0x4652d5['attributes']=_0x4652d5[_0x5774('0x34')][_0x5774('0x47')]?_0x4652d5[_0x5774('0x34')]:_0x14c1cc[_0x5774('0x2e')];if(_0x4b54d4[_0x5774('0x30')][_0x5774('0x41')]){_0x4652d5[_0x5774('0x42')]=[{'all':!![]}];}_0x4652d5=_[_0x5774('0x3d')]({},_0x4652d5,_0x4b54d4['options']);return db['DeskConfiguration'][_0x5774('0x48')](_0x4652d5)['then'](handleEntityNotFound(_0x559116,null))['then'](respondWithResult(_0x559116,null))[_0x5774('0x44')](handleError(_0x559116,null));};exports[_0x5774('0x49')]=function(_0x3571b5,_0x698ca4){return db[_0x5774('0x2a')][_0x5774('0x49')](_0x3571b5[_0x5774('0x4a')],{})[_0x5774('0x24')](respondWithResult(_0x698ca4,0xc9))['catch'](handleError(_0x698ca4,null));};exports['update']=function(_0x20cb58,_0x12ec2c){if(_0x20cb58[_0x5774('0x4a')]['id']){delete _0x20cb58['body']['id'];}return db[_0x5774('0x2a')][_0x5774('0x48')]({'where':{'id':_0x20cb58['params']['id']}})[_0x5774('0x24')](handleEntityNotFound(_0x12ec2c,null))[_0x5774('0x24')](saveUpdates(_0x20cb58[_0x5774('0x4a')],null))[_0x5774('0x24')](respondWithResult(_0x12ec2c,null))[_0x5774('0x44')](handleError(_0x12ec2c,null));};exports['destroy']=function(_0x74c4a9,_0x3f6bfc){return db[_0x5774('0x2a')][_0x5774('0x48')]({'where':{'id':_0x74c4a9[_0x5774('0x46')]['id']}})[_0x5774('0x24')](handleEntityNotFound(_0x3f6bfc,null))['then'](removeEntity(_0x3f6bfc,null))['catch'](handleError(_0x3f6bfc,null));};exports[_0x5774('0x4b')]=function(_0x1659b8,_0x10bcff,_0x53606f){var _0x150982={};var _0x3c5432={};var _0x31f46e;var _0x1feee1;return db[_0x5774('0x2a')][_0x5774('0x4c')]({'where':{'id':_0x1659b8['params']['id']}})[_0x5774('0x24')](handleEntityNotFound(_0x10bcff,null))[_0x5774('0x24')](function(_0x3573e4){if(_0x3573e4){_0x31f46e=_0x3573e4;_0x3c5432['model']=_[_0x5774('0x31')](db[_0x5774('0x4d')][_0x5774('0x2b')]);_0x3c5432['query']=_[_0x5774('0x31')](_0x1659b8[_0x5774('0x30')]);_0x3c5432[_0x5774('0x3b')]=_[_0x5774('0x32')](_0x3c5432['model'],_0x3c5432[_0x5774('0x30')]);_0x150982['attributes']=_[_0x5774('0x32')](_0x3c5432['model'],qs['fields'](_0x1659b8[_0x5774('0x30')][_0x5774('0x33')]));_0x150982[_0x5774('0x34')]=_0x150982['attributes'][_0x5774('0x47')]?_0x150982[_0x5774('0x34')]:_0x3c5432['model'];_0x150982[_0x5774('0x37')]=qs[_0x5774('0x38')](_0x1659b8[_0x5774('0x30')][_0x5774('0x38')]);_0x150982[_0x5774('0x39')]=qs['filters'](_[_0x5774('0x3a')](_0x1659b8[_0x5774('0x30')],_0x3c5432[_0x5774('0x3b')]));if(_0x1659b8[_0x5774('0x30')][_0x5774('0x3c')]){_0x150982['where']=_['merge'](_0x150982['where'],{'$or':_[_0x5774('0x2f')](_0x150982[_0x5774('0x34')],function(_0x44e43b){var _0x2aa6bf={};_0x2aa6bf[_0x44e43b]={'$like':'%'+_0x1659b8[_0x5774('0x30')]['filter']+'%'};return _0x2aa6bf;})});}_0x150982=_[_0x5774('0x3d')]({},_0x150982,_0x1659b8[_0x5774('0x40')]);return _0x31f46e['getFields'](_0x150982);}})[_0x5774('0x24')](function(_0x294b44){if(_0x294b44){_0x1feee1=_0x294b44[_0x5774('0x47')];if(!_0x1659b8[_0x5774('0x30')][_0x5774('0x35')](_0x5774('0x36'))){_0x150982[_0x5774('0x1e')]=qs[_0x5774('0x1e')](_0x1659b8[_0x5774('0x30')]['limit']);_0x150982[_0x5774('0x1c')]=qs[_0x5774('0x1c')](_0x1659b8[_0x5774('0x30')][_0x5774('0x1c')]);}return _0x31f46e[_0x5774('0x4b')](_0x150982);}})[_0x5774('0x24')](function(_0xbf935c){if(_0xbf935c){return _0xbf935c?{'count':_0x1feee1,'rows':_0xbf935c}:null;}})[_0x5774('0x24')](respondWithResult(_0x10bcff,null))[_0x5774('0x44')](handleError(_0x10bcff,null));};exports['getSubjects']=function(_0x2be9b0,_0x4cb982,_0x3f2e7c){var _0x3ff723={};var _0x4fe9ef={};var _0x3d7c62;var _0xacd48b;return db[_0x5774('0x2a')]['findOne']({'where':{'id':_0x2be9b0[_0x5774('0x46')]['id']}})[_0x5774('0x24')](handleEntityNotFound(_0x4cb982,null))[_0x5774('0x24')](function(_0x12e666){if(_0x12e666){_0x3d7c62=_0x12e666;_0x4fe9ef[_0x5774('0x2e')]=_[_0x5774('0x31')](db[_0x5774('0x4d')][_0x5774('0x2b')]);_0x4fe9ef[_0x5774('0x30')]=_[_0x5774('0x31')](_0x2be9b0[_0x5774('0x30')]);_0x4fe9ef[_0x5774('0x3b')]=_[_0x5774('0x32')](_0x4fe9ef[_0x5774('0x2e')],_0x4fe9ef['query']);_0x3ff723[_0x5774('0x34')]=_[_0x5774('0x32')](_0x4fe9ef[_0x5774('0x2e')],qs[_0x5774('0x33')](_0x2be9b0[_0x5774('0x30')][_0x5774('0x33')]));_0x3ff723[_0x5774('0x34')]=_0x3ff723[_0x5774('0x34')][_0x5774('0x47')]?_0x3ff723['attributes']:_0x4fe9ef['model'];_0x3ff723[_0x5774('0x37')]=qs[_0x5774('0x38')](_0x2be9b0[_0x5774('0x30')][_0x5774('0x38')]);_0x3ff723[_0x5774('0x39')]=qs[_0x5774('0x3b')](_[_0x5774('0x3a')](_0x2be9b0['query'],_0x4fe9ef['filters']));if(_0x2be9b0[_0x5774('0x30')][_0x5774('0x3c')]){_0x3ff723[_0x5774('0x39')]=_['merge'](_0x3ff723[_0x5774('0x39')],{'$or':_[_0x5774('0x2f')](_0x3ff723['attributes'],function(_0x21d13b){var _0x2a650d={};_0x2a650d[_0x21d13b]={'$like':'%'+_0x2be9b0['query'][_0x5774('0x3c')]+'%'};return _0x2a650d;})});}_0x3ff723=_[_0x5774('0x3d')]({},_0x3ff723,_0x2be9b0[_0x5774('0x40')]);return _0x3d7c62[_0x5774('0x4e')](_0x3ff723);}})[_0x5774('0x24')](function(_0x3ae629){if(_0x3ae629){_0xacd48b=_0x3ae629[_0x5774('0x47')];if(!_0x2be9b0[_0x5774('0x30')][_0x5774('0x35')](_0x5774('0x36'))){_0x3ff723[_0x5774('0x1e')]=qs[_0x5774('0x1e')](_0x2be9b0['query'][_0x5774('0x1e')]);_0x3ff723[_0x5774('0x1c')]=qs[_0x5774('0x1c')](_0x2be9b0[_0x5774('0x30')][_0x5774('0x1c')]);}return _0x3d7c62[_0x5774('0x4e')](_0x3ff723);}})[_0x5774('0x24')](function(_0x2b92ef){if(_0x2b92ef){return _0x2b92ef?{'count':_0xacd48b,'rows':_0x2b92ef}:null;}})[_0x5774('0x24')](respondWithResult(_0x4cb982,null))['catch'](handleError(_0x4cb982,null));};exports[_0x5774('0x4f')]=function(_0x4e55e6,_0x478cf6,_0x457cf1){var _0x49318e={};var _0x41a32b={};var _0x270b85;var _0xa759d2;return db[_0x5774('0x2a')][_0x5774('0x4c')]({'where':{'id':_0x4e55e6[_0x5774('0x46')]['id']}})[_0x5774('0x24')](handleEntityNotFound(_0x478cf6,null))[_0x5774('0x24')](function(_0x6c9213){if(_0x6c9213){_0x270b85=_0x6c9213;_0x41a32b[_0x5774('0x2e')]=_[_0x5774('0x31')](db['DeskField'][_0x5774('0x2b')]);_0x41a32b[_0x5774('0x30')]=_[_0x5774('0x31')](_0x4e55e6['query']);_0x41a32b[_0x5774('0x3b')]=_[_0x5774('0x32')](_0x41a32b[_0x5774('0x2e')],_0x41a32b[_0x5774('0x30')]);_0x49318e[_0x5774('0x34')]=_[_0x5774('0x32')](_0x41a32b[_0x5774('0x2e')],qs[_0x5774('0x33')](_0x4e55e6['query']['fields']));_0x49318e['attributes']=_0x49318e[_0x5774('0x34')][_0x5774('0x47')]?_0x49318e['attributes']:_0x41a32b[_0x5774('0x2e')];_0x49318e[_0x5774('0x37')]=qs['sort'](_0x4e55e6[_0x5774('0x30')]['sort']);_0x49318e['where']=qs['filters'](_[_0x5774('0x3a')](_0x4e55e6[_0x5774('0x30')],_0x41a32b['filters']));if(_0x4e55e6['query'][_0x5774('0x3c')]){_0x49318e['where']=_[_0x5774('0x3d')](_0x49318e[_0x5774('0x39')],{'$or':_['map'](_0x49318e[_0x5774('0x34')],function(_0x1ed690){var _0x59573b={};_0x59573b[_0x1ed690]={'$like':'%'+_0x4e55e6[_0x5774('0x30')][_0x5774('0x3c')]+'%'};return _0x59573b;})});}_0x49318e=_['merge']({},_0x49318e,_0x4e55e6[_0x5774('0x40')]);return _0x270b85[_0x5774('0x4f')](_0x49318e);}})[_0x5774('0x24')](function(_0x26ea5a){if(_0x26ea5a){_0xa759d2=_0x26ea5a[_0x5774('0x47')];if(!_0x4e55e6['query'][_0x5774('0x35')](_0x5774('0x36'))){_0x49318e['limit']=qs[_0x5774('0x1e')](_0x4e55e6[_0x5774('0x30')][_0x5774('0x1e')]);_0x49318e[_0x5774('0x1c')]=qs[_0x5774('0x1c')](_0x4e55e6['query'][_0x5774('0x1c')]);}return _0x270b85[_0x5774('0x4f')](_0x49318e);}})[_0x5774('0x24')](function(_0x5018d9){if(_0x5018d9){return _0x5018d9?{'count':_0xa759d2,'rows':_0x5018d9}:null;}})[_0x5774('0x24')](respondWithResult(_0x478cf6,null))[_0x5774('0x44')](handleError(_0x478cf6,null));};exports['getTags']=function(_0x321968,_0xb9feb6,_0x4b5f53){var _0x3138aa={};var _0x14e536={};var _0x12d67f;var _0x3a4bf2;return db[_0x5774('0x2a')]['findOne']({'where':{'id':_0x321968['params']['id']}})[_0x5774('0x24')](handleEntityNotFound(_0xb9feb6,null))[_0x5774('0x24')](function(_0x5c0ee4){if(_0x5c0ee4){_0x12d67f=_0x5c0ee4;_0x14e536[_0x5774('0x2e')]=_[_0x5774('0x31')](db['Tag'][_0x5774('0x2b')]);_0x14e536[_0x5774('0x30')]=_[_0x5774('0x31')](_0x321968['query']);_0x14e536[_0x5774('0x3b')]=_[_0x5774('0x32')](_0x14e536[_0x5774('0x2e')],_0x14e536['query']);_0x3138aa[_0x5774('0x34')]=_[_0x5774('0x32')](_0x14e536[_0x5774('0x2e')],qs[_0x5774('0x33')](_0x321968[_0x5774('0x30')]['fields']));_0x3138aa['attributes']=_0x3138aa[_0x5774('0x34')][_0x5774('0x47')]?_0x3138aa['attributes']:_0x14e536[_0x5774('0x2e')];_0x3138aa[_0x5774('0x37')]=qs[_0x5774('0x38')](_0x321968[_0x5774('0x30')][_0x5774('0x38')]);_0x3138aa[_0x5774('0x39')]=qs[_0x5774('0x3b')](_[_0x5774('0x3a')](_0x321968[_0x5774('0x30')],_0x14e536[_0x5774('0x3b')]));if(_0x321968[_0x5774('0x30')][_0x5774('0x3c')]){_0x3138aa[_0x5774('0x39')]=_[_0x5774('0x3d')](_0x3138aa[_0x5774('0x39')],{'$or':_[_0x5774('0x2f')](_0x3138aa['attributes'],function(_0xb5169b){var _0x27c759={};_0x27c759[_0xb5169b]={'$like':'%'+_0x321968[_0x5774('0x30')][_0x5774('0x3c')]+'%'};return _0x27c759;})});}_0x3138aa=_['merge']({},_0x3138aa,_0x321968[_0x5774('0x40')]);return _0x12d67f[_0x5774('0x50')](_0x3138aa);}})[_0x5774('0x24')](function(_0x1c49c6){if(_0x1c49c6){_0x3a4bf2=_0x1c49c6[_0x5774('0x47')];if(!_0x321968[_0x5774('0x30')][_0x5774('0x35')](_0x5774('0x36'))){_0x3138aa['limit']=qs[_0x5774('0x1e')](_0x321968[_0x5774('0x30')]['limit']);_0x3138aa['offset']=qs[_0x5774('0x1c')](_0x321968[_0x5774('0x30')]['offset']);}return _0x12d67f[_0x5774('0x50')](_0x3138aa);}})[_0x5774('0x24')](function(_0x7772dc){if(_0x7772dc){return _0x7772dc?{'count':_0x3a4bf2,'rows':_0x7772dc}:null;}})['then'](respondWithResult(_0xb9feb6,null))[_0x5774('0x44')](handleError(_0xb9feb6,null));};exports[_0x5774('0x51')]=function(_0x56fae8,_0xd4c5b6,_0x545a2e){if(_0x56fae8['body']['id']){delete _0x56fae8['body']['id'];}return db[_0x5774('0x2a')]['findOne']({'where':{'id':_0x56fae8[_0x5774('0x46')]['id']}})[_0x5774('0x24')](handleEntityNotFound(_0xd4c5b6,null))[_0x5774('0x24')](function(_0x8e32e4){if(_0x8e32e4){return _0x8e32e4[_0x5774('0x51')](_0x56fae8[_0x5774('0x4a')][_0x5774('0x52')]||[]);}return null;})[_0x5774('0x24')](respondWithResult(_0xd4c5b6,null))[_0x5774('0x44')](handleError(_0xd4c5b6,null));}; \ No newline at end of file +var _0x5506=['setTags','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','DeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','pick','map','getSubjects','getDescriptions','getTags'];(function(_0x3ba399,_0x443937){var _0x77b2fc=function(_0x2da41b){while(--_0x2da41b){_0x3ba399['push'](_0x3ba399['shift']());}};_0x77b2fc(++_0x443937);}(_0x5506,0x1a5));var _0x6550=function(_0x5cc3ba,_0xff11b5){_0x5cc3ba=_0x5cc3ba-0x0;var _0x44e19a=_0x5506[_0x5cc3ba];return _0x44e19a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6550('0x0'));var zipdir=require(_0x6550('0x1'));var jsonpatch=require(_0x6550('0x2'));var rp=require('request-promise');var moment=require(_0x6550('0x3'));var BPromise=require(_0x6550('0x4'));var Mustache=require(_0x6550('0x5'));var util=require(_0x6550('0x6'));var path=require(_0x6550('0x7'));var sox=require('sox');var csv=require(_0x6550('0x8'));var ejs=require(_0x6550('0x9'));var fs=require('fs');var fs_extra=require(_0x6550('0xa'));var _=require(_0x6550('0xb'));var squel=require(_0x6550('0xc'));var crypto=require(_0x6550('0xd'));var jsforce=require(_0x6550('0xe'));var deskjs=require(_0x6550('0xf'));var toCsv=require(_0x6550('0x8'));var querystring=require(_0x6550('0x10'));var Papa=require(_0x6550('0x11'));var Redis=require('ioredis');var authService=require(_0x6550('0x12'));var qs=require(_0x6550('0x13'));var as=require(_0x6550('0x14'));var hardwareService=require(_0x6550('0x15'));var logger=require(_0x6550('0x16'))(_0x6550('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31a1d7,_0x3a9ed8){_0x3a9ed8=_0x3a9ed8||0xcc;return function(_0x18350c){if(_0x18350c){return _0x31a1d7['sendStatus'](_0x3a9ed8);}return _0x31a1d7[_0x6550('0x18')](_0x3a9ed8)[_0x6550('0x19')]();};}function respondWithResult(_0xf09c9e,_0x57a085){_0x57a085=_0x57a085||0xc8;return function(_0x4e0eb3){if(_0x4e0eb3){return _0xf09c9e[_0x6550('0x18')](_0x57a085)[_0x6550('0x1a')](_0x4e0eb3);}};}function respondWithFilteredResult(_0x3e15c3,_0x300442){return function(_0x7a078b){if(_0x7a078b){var _0x590480=typeof _0x300442[_0x6550('0x1b')]==='undefined'&&typeof _0x300442[_0x6550('0x1c')]===_0x6550('0x1d');var _0x2128fe=_0x7a078b[_0x6550('0x1e')];var _0x4218b0=_0x590480?0x0:_0x300442[_0x6550('0x1b')];var _0x59b0ca=_0x590480?_0x7a078b[_0x6550('0x1e')]:_0x300442[_0x6550('0x1b')]+_0x300442[_0x6550('0x1c')];var _0x4cb0e4;if(_0x59b0ca>=_0x2128fe){_0x59b0ca=_0x2128fe;_0x4cb0e4=0xc8;}else{_0x4cb0e4=0xce;}_0x3e15c3['status'](_0x4cb0e4);return _0x3e15c3[_0x6550('0x1f')](_0x6550('0x20'),_0x4218b0+'-'+_0x59b0ca+'/'+_0x2128fe)[_0x6550('0x1a')](_0x7a078b);}return null;};}function patchUpdates(_0x37b262){return function(_0x30f6dd){try{jsonpatch[_0x6550('0x21')](_0x30f6dd,_0x37b262,!![]);}catch(_0x1fef8e){return BPromise[_0x6550('0x22')](_0x1fef8e);}return _0x30f6dd['save']();};}function saveUpdates(_0x4249e4,_0x11014c){return function(_0x4989bf){if(_0x4989bf){return _0x4989bf['update'](_0x4249e4)[_0x6550('0x23')](function(_0x25eeed){return _0x25eeed;});}return null;};}function removeEntity(_0x327590,_0x6f30bf){return function(_0x69420f){if(_0x69420f){return _0x69420f[_0x6550('0x24')]()[_0x6550('0x23')](function(){_0x327590[_0x6550('0x18')](0xcc)[_0x6550('0x19')]();});}};}function handleEntityNotFound(_0x40583f,_0x4f6f6b){return function(_0x1a798a){if(!_0x1a798a){_0x40583f[_0x6550('0x25')](0x194);}return _0x1a798a;};}function handleError(_0x417c2e,_0xa06421){_0xa06421=_0xa06421||0x1f4;return function(_0x32c5aa){logger[_0x6550('0x26')](_0x32c5aa[_0x6550('0x27')]);if(_0x32c5aa['name']){delete _0x32c5aa[_0x6550('0x28')];}_0x417c2e[_0x6550('0x18')](_0xa06421)[_0x6550('0x29')](_0x32c5aa);};}exports[_0x6550('0x2a')]=function(_0x4857be,_0x1d75ca){var _0x3dc766={},_0x512dfc={},_0x20002e={'count':0x0,'rows':[]};var _0x7936ef=_['map'](db[_0x6550('0x2b')]['rawAttributes'],function(_0x389ff7){return{'name':_0x389ff7[_0x6550('0x2c')],'type':_0x389ff7[_0x6550('0x2d')][_0x6550('0x2e')]};});_0x512dfc[_0x6550('0x2f')]=_['map'](_0x7936ef,_0x6550('0x28'));_0x512dfc[_0x6550('0x30')]=_[_0x6550('0x31')](_0x4857be[_0x6550('0x30')]);_0x512dfc[_0x6550('0x32')]=_[_0x6550('0x33')](_0x512dfc[_0x6550('0x2f')],_0x512dfc['query']);_0x3dc766[_0x6550('0x34')]=_[_0x6550('0x33')](_0x512dfc[_0x6550('0x2f')],qs[_0x6550('0x35')](_0x4857be[_0x6550('0x30')][_0x6550('0x35')]));_0x3dc766['attributes']=_0x3dc766[_0x6550('0x34')][_0x6550('0x36')]?_0x3dc766['attributes']:_0x512dfc[_0x6550('0x2f')];if(!_0x4857be[_0x6550('0x30')][_0x6550('0x37')](_0x6550('0x38'))){_0x3dc766[_0x6550('0x1c')]=qs[_0x6550('0x1c')](_0x4857be[_0x6550('0x30')][_0x6550('0x1c')]);_0x3dc766['offset']=qs[_0x6550('0x1b')](_0x4857be[_0x6550('0x30')][_0x6550('0x1b')]);}_0x3dc766[_0x6550('0x39')]=qs['sort'](_0x4857be[_0x6550('0x30')][_0x6550('0x3a')]);_0x3dc766[_0x6550('0x3b')]=qs[_0x6550('0x32')](_['pick'](_0x4857be['query'],_0x512dfc[_0x6550('0x32')]),_0x7936ef);if(_0x4857be[_0x6550('0x30')][_0x6550('0x3c')]){_0x3dc766['where']=_[_0x6550('0x3d')](_0x3dc766[_0x6550('0x3b')],{'$or':_['map'](_0x7936ef,function(_0x2e471d){if(_0x2e471d[_0x6550('0x2d')]!==_0x6550('0x3e')){var _0x255aa8={};_0x255aa8[_0x2e471d[_0x6550('0x28')]]={'$like':'%'+_0x4857be[_0x6550('0x30')][_0x6550('0x3c')]+'%'};return _0x255aa8;}})});}_0x3dc766=_[_0x6550('0x3d')]({},_0x3dc766,_0x4857be[_0x6550('0x3f')]);var _0x196e2b={'where':_0x3dc766[_0x6550('0x3b')]};return db[_0x6550('0x2b')][_0x6550('0x1e')](_0x196e2b)[_0x6550('0x23')](function(_0x590486){_0x20002e['count']=_0x590486;if(_0x4857be[_0x6550('0x30')][_0x6550('0x40')]){_0x3dc766[_0x6550('0x41')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x6550('0x42')](_0x3dc766);})[_0x6550('0x23')](function(_0x37625e){_0x20002e[_0x6550('0x43')]=_0x37625e;return _0x20002e;})[_0x6550('0x23')](respondWithFilteredResult(_0x1d75ca,_0x3dc766))[_0x6550('0x44')](handleError(_0x1d75ca,null));};exports[_0x6550('0x45')]=function(_0x16130f,_0x47a98d){var _0xcc8c4={'raw':![],'where':{'id':_0x16130f[_0x6550('0x46')]['id']}},_0x5954d7={};_0x5954d7[_0x6550('0x2f')]=_[_0x6550('0x31')](db[_0x6550('0x2b')][_0x6550('0x47')]);_0x5954d7[_0x6550('0x30')]=_[_0x6550('0x31')](_0x16130f[_0x6550('0x30')]);_0x5954d7[_0x6550('0x32')]=_[_0x6550('0x33')](_0x5954d7[_0x6550('0x2f')],_0x5954d7['query']);_0xcc8c4['attributes']=_['intersection'](_0x5954d7['model'],qs[_0x6550('0x35')](_0x16130f[_0x6550('0x30')]['fields']));_0xcc8c4['attributes']=_0xcc8c4[_0x6550('0x34')][_0x6550('0x36')]?_0xcc8c4['attributes']:_0x5954d7[_0x6550('0x2f')];if(_0x16130f['query'][_0x6550('0x40')]){_0xcc8c4['include']=[{'all':!![]}];}_0xcc8c4=_[_0x6550('0x3d')]({},_0xcc8c4,_0x16130f[_0x6550('0x3f')]);return db['DeskConfiguration'][_0x6550('0x48')](_0xcc8c4)[_0x6550('0x23')](handleEntityNotFound(_0x47a98d,null))[_0x6550('0x23')](respondWithResult(_0x47a98d,null))[_0x6550('0x44')](handleError(_0x47a98d,null));};exports[_0x6550('0x49')]=function(_0x83c0a6,_0x3e7e31){return db[_0x6550('0x2b')][_0x6550('0x49')](_0x83c0a6[_0x6550('0x4a')],{})[_0x6550('0x23')](respondWithResult(_0x3e7e31,0xc9))[_0x6550('0x44')](handleError(_0x3e7e31,null));};exports['update']=function(_0x2b1113,_0x13861f){if(_0x2b1113[_0x6550('0x4a')]['id']){delete _0x2b1113['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x2b1113[_0x6550('0x46')]['id']}})['then'](handleEntityNotFound(_0x13861f,null))[_0x6550('0x23')](saveUpdates(_0x2b1113[_0x6550('0x4a')],null))[_0x6550('0x23')](respondWithResult(_0x13861f,null))['catch'](handleError(_0x13861f,null));};exports['destroy']=function(_0x512de1,_0x16339f){return db[_0x6550('0x2b')]['find']({'where':{'id':_0x512de1[_0x6550('0x46')]['id']}})['then'](handleEntityNotFound(_0x16339f,null))[_0x6550('0x23')](removeEntity(_0x16339f,null))[_0x6550('0x44')](handleError(_0x16339f,null));};exports[_0x6550('0x4b')]=function(_0x74d6a4,_0x3fd51f,_0x513852){var _0x3da8bc={};var _0x26908d={};var _0x4ddb84;var _0x42f847;return db[_0x6550('0x2b')][_0x6550('0x4c')]({'where':{'id':_0x74d6a4[_0x6550('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd51f,null))[_0x6550('0x23')](function(_0x15846b){if(_0x15846b){_0x4ddb84=_0x15846b;_0x26908d[_0x6550('0x2f')]=_[_0x6550('0x31')](db[_0x6550('0x4d')][_0x6550('0x47')]);_0x26908d[_0x6550('0x30')]=_['keys'](_0x74d6a4[_0x6550('0x30')]);_0x26908d[_0x6550('0x32')]=_[_0x6550('0x33')](_0x26908d[_0x6550('0x2f')],_0x26908d[_0x6550('0x30')]);_0x3da8bc['attributes']=_[_0x6550('0x33')](_0x26908d[_0x6550('0x2f')],qs['fields'](_0x74d6a4['query'][_0x6550('0x35')]));_0x3da8bc[_0x6550('0x34')]=_0x3da8bc['attributes'][_0x6550('0x36')]?_0x3da8bc['attributes']:_0x26908d['model'];_0x3da8bc[_0x6550('0x39')]=qs[_0x6550('0x3a')](_0x74d6a4[_0x6550('0x30')][_0x6550('0x3a')]);_0x3da8bc[_0x6550('0x3b')]=qs[_0x6550('0x32')](_[_0x6550('0x4e')](_0x74d6a4[_0x6550('0x30')],_0x26908d[_0x6550('0x32')]));if(_0x74d6a4[_0x6550('0x30')][_0x6550('0x3c')]){_0x3da8bc['where']=_[_0x6550('0x3d')](_0x3da8bc[_0x6550('0x3b')],{'$or':_[_0x6550('0x4f')](_0x3da8bc[_0x6550('0x34')],function(_0x18db68){var _0x1df4ff={};_0x1df4ff[_0x18db68]={'$like':'%'+_0x74d6a4['query'][_0x6550('0x3c')]+'%'};return _0x1df4ff;})});}_0x3da8bc=_['merge']({},_0x3da8bc,_0x74d6a4[_0x6550('0x3f')]);return _0x4ddb84[_0x6550('0x4b')](_0x3da8bc);}})[_0x6550('0x23')](function(_0x53799c){if(_0x53799c){_0x42f847=_0x53799c[_0x6550('0x36')];if(!_0x74d6a4[_0x6550('0x30')][_0x6550('0x37')](_0x6550('0x38'))){_0x3da8bc[_0x6550('0x1c')]=qs[_0x6550('0x1c')](_0x74d6a4['query']['limit']);_0x3da8bc[_0x6550('0x1b')]=qs[_0x6550('0x1b')](_0x74d6a4[_0x6550('0x30')][_0x6550('0x1b')]);}return _0x4ddb84[_0x6550('0x4b')](_0x3da8bc);}})[_0x6550('0x23')](function(_0x3f2417){if(_0x3f2417){return _0x3f2417?{'count':_0x42f847,'rows':_0x3f2417}:null;}})[_0x6550('0x23')](respondWithResult(_0x3fd51f,null))[_0x6550('0x44')](handleError(_0x3fd51f,null));};exports['getSubjects']=function(_0x10a10a,_0x1c0b16,_0x523187){var _0x1d56b2={};var _0x2a7c61={};var _0x201a14;var _0x4b3118;return db[_0x6550('0x2b')]['findOne']({'where':{'id':_0x10a10a[_0x6550('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c0b16,null))[_0x6550('0x23')](function(_0x50141e){if(_0x50141e){_0x201a14=_0x50141e;_0x2a7c61[_0x6550('0x2f')]=_['keys'](db['DeskField'][_0x6550('0x47')]);_0x2a7c61[_0x6550('0x30')]=_[_0x6550('0x31')](_0x10a10a['query']);_0x2a7c61['filters']=_[_0x6550('0x33')](_0x2a7c61[_0x6550('0x2f')],_0x2a7c61[_0x6550('0x30')]);_0x1d56b2[_0x6550('0x34')]=_[_0x6550('0x33')](_0x2a7c61['model'],qs[_0x6550('0x35')](_0x10a10a[_0x6550('0x30')]['fields']));_0x1d56b2[_0x6550('0x34')]=_0x1d56b2['attributes'][_0x6550('0x36')]?_0x1d56b2[_0x6550('0x34')]:_0x2a7c61['model'];_0x1d56b2['order']=qs['sort'](_0x10a10a[_0x6550('0x30')][_0x6550('0x3a')]);_0x1d56b2[_0x6550('0x3b')]=qs[_0x6550('0x32')](_[_0x6550('0x4e')](_0x10a10a[_0x6550('0x30')],_0x2a7c61[_0x6550('0x32')]));if(_0x10a10a['query'][_0x6550('0x3c')]){_0x1d56b2[_0x6550('0x3b')]=_['merge'](_0x1d56b2['where'],{'$or':_[_0x6550('0x4f')](_0x1d56b2[_0x6550('0x34')],function(_0x2bdc1e){var _0x33e727={};_0x33e727[_0x2bdc1e]={'$like':'%'+_0x10a10a['query'][_0x6550('0x3c')]+'%'};return _0x33e727;})});}_0x1d56b2=_[_0x6550('0x3d')]({},_0x1d56b2,_0x10a10a[_0x6550('0x3f')]);return _0x201a14['getSubjects'](_0x1d56b2);}})[_0x6550('0x23')](function(_0x120a8b){if(_0x120a8b){_0x4b3118=_0x120a8b[_0x6550('0x36')];if(!_0x10a10a['query'][_0x6550('0x37')](_0x6550('0x38'))){_0x1d56b2['limit']=qs['limit'](_0x10a10a[_0x6550('0x30')]['limit']);_0x1d56b2[_0x6550('0x1b')]=qs[_0x6550('0x1b')](_0x10a10a['query'][_0x6550('0x1b')]);}return _0x201a14[_0x6550('0x50')](_0x1d56b2);}})['then'](function(_0x434824){if(_0x434824){return _0x434824?{'count':_0x4b3118,'rows':_0x434824}:null;}})[_0x6550('0x23')](respondWithResult(_0x1c0b16,null))['catch'](handleError(_0x1c0b16,null));};exports[_0x6550('0x51')]=function(_0xe942dd,_0x3300f7,_0x205536){var _0x467841={};var _0x16c6ed={};var _0x100b58;var _0x52371a;return db[_0x6550('0x2b')]['findOne']({'where':{'id':_0xe942dd[_0x6550('0x46')]['id']}})[_0x6550('0x23')](handleEntityNotFound(_0x3300f7,null))[_0x6550('0x23')](function(_0x1215fd){if(_0x1215fd){_0x100b58=_0x1215fd;_0x16c6ed[_0x6550('0x2f')]=_[_0x6550('0x31')](db[_0x6550('0x4d')][_0x6550('0x47')]);_0x16c6ed['query']=_[_0x6550('0x31')](_0xe942dd['query']);_0x16c6ed[_0x6550('0x32')]=_[_0x6550('0x33')](_0x16c6ed['model'],_0x16c6ed['query']);_0x467841['attributes']=_[_0x6550('0x33')](_0x16c6ed[_0x6550('0x2f')],qs[_0x6550('0x35')](_0xe942dd[_0x6550('0x30')][_0x6550('0x35')]));_0x467841[_0x6550('0x34')]=_0x467841[_0x6550('0x34')][_0x6550('0x36')]?_0x467841[_0x6550('0x34')]:_0x16c6ed['model'];_0x467841[_0x6550('0x39')]=qs['sort'](_0xe942dd[_0x6550('0x30')][_0x6550('0x3a')]);_0x467841[_0x6550('0x3b')]=qs[_0x6550('0x32')](_['pick'](_0xe942dd[_0x6550('0x30')],_0x16c6ed[_0x6550('0x32')]));if(_0xe942dd[_0x6550('0x30')][_0x6550('0x3c')]){_0x467841[_0x6550('0x3b')]=_[_0x6550('0x3d')](_0x467841[_0x6550('0x3b')],{'$or':_['map'](_0x467841['attributes'],function(_0x9a0c6f){var _0x17efaa={};_0x17efaa[_0x9a0c6f]={'$like':'%'+_0xe942dd[_0x6550('0x30')]['filter']+'%'};return _0x17efaa;})});}_0x467841=_[_0x6550('0x3d')]({},_0x467841,_0xe942dd[_0x6550('0x3f')]);return _0x100b58[_0x6550('0x51')](_0x467841);}})[_0x6550('0x23')](function(_0x1268a4){if(_0x1268a4){_0x52371a=_0x1268a4['length'];if(!_0xe942dd[_0x6550('0x30')][_0x6550('0x37')]('nolimit')){_0x467841['limit']=qs['limit'](_0xe942dd[_0x6550('0x30')][_0x6550('0x1c')]);_0x467841[_0x6550('0x1b')]=qs[_0x6550('0x1b')](_0xe942dd[_0x6550('0x30')][_0x6550('0x1b')]);}return _0x100b58[_0x6550('0x51')](_0x467841);}})[_0x6550('0x23')](function(_0x2cbd92){if(_0x2cbd92){return _0x2cbd92?{'count':_0x52371a,'rows':_0x2cbd92}:null;}})['then'](respondWithResult(_0x3300f7,null))[_0x6550('0x44')](handleError(_0x3300f7,null));};exports['getTags']=function(_0x193a4b,_0x52b926,_0x10da91){var _0x2fe36f={};var _0x170dbd={};var _0x23d0ef;var _0x5d6d05;return db[_0x6550('0x2b')][_0x6550('0x4c')]({'where':{'id':_0x193a4b['params']['id']}})[_0x6550('0x23')](handleEntityNotFound(_0x52b926,null))[_0x6550('0x23')](function(_0xd9eca2){if(_0xd9eca2){_0x23d0ef=_0xd9eca2;_0x170dbd[_0x6550('0x2f')]=_['keys'](db['Tag'][_0x6550('0x47')]);_0x170dbd['query']=_[_0x6550('0x31')](_0x193a4b[_0x6550('0x30')]);_0x170dbd[_0x6550('0x32')]=_[_0x6550('0x33')](_0x170dbd['model'],_0x170dbd[_0x6550('0x30')]);_0x2fe36f[_0x6550('0x34')]=_[_0x6550('0x33')](_0x170dbd[_0x6550('0x2f')],qs[_0x6550('0x35')](_0x193a4b[_0x6550('0x30')][_0x6550('0x35')]));_0x2fe36f['attributes']=_0x2fe36f[_0x6550('0x34')]['length']?_0x2fe36f[_0x6550('0x34')]:_0x170dbd[_0x6550('0x2f')];_0x2fe36f['order']=qs[_0x6550('0x3a')](_0x193a4b[_0x6550('0x30')][_0x6550('0x3a')]);_0x2fe36f[_0x6550('0x3b')]=qs[_0x6550('0x32')](_[_0x6550('0x4e')](_0x193a4b[_0x6550('0x30')],_0x170dbd[_0x6550('0x32')]));if(_0x193a4b[_0x6550('0x30')][_0x6550('0x3c')]){_0x2fe36f['where']=_['merge'](_0x2fe36f[_0x6550('0x3b')],{'$or':_[_0x6550('0x4f')](_0x2fe36f[_0x6550('0x34')],function(_0x452949){var _0x2a0924={};_0x2a0924[_0x452949]={'$like':'%'+_0x193a4b[_0x6550('0x30')][_0x6550('0x3c')]+'%'};return _0x2a0924;})});}_0x2fe36f=_[_0x6550('0x3d')]({},_0x2fe36f,_0x193a4b['options']);return _0x23d0ef['getTags'](_0x2fe36f);}})[_0x6550('0x23')](function(_0x2444e9){if(_0x2444e9){_0x5d6d05=_0x2444e9['length'];if(!_0x193a4b[_0x6550('0x30')]['hasOwnProperty'](_0x6550('0x38'))){_0x2fe36f['limit']=qs[_0x6550('0x1c')](_0x193a4b['query']['limit']);_0x2fe36f[_0x6550('0x1b')]=qs[_0x6550('0x1b')](_0x193a4b[_0x6550('0x30')][_0x6550('0x1b')]);}return _0x23d0ef[_0x6550('0x52')](_0x2fe36f);}})[_0x6550('0x23')](function(_0x2f4da1){if(_0x2f4da1){return _0x2f4da1?{'count':_0x5d6d05,'rows':_0x2f4da1}:null;}})['then'](respondWithResult(_0x52b926,null))['catch'](handleError(_0x52b926,null));};exports[_0x6550('0x53')]=function(_0x247bee,_0x199948,_0x3f0504){if(_0x247bee[_0x6550('0x4a')]['id']){delete _0x247bee[_0x6550('0x4a')]['id'];}return db[_0x6550('0x2b')][_0x6550('0x4c')]({'where':{'id':_0x247bee[_0x6550('0x46')]['id']}})[_0x6550('0x23')](handleEntityNotFound(_0x199948,null))[_0x6550('0x23')](function(_0x3e46c8){if(_0x3e46c8){return _0x3e46c8['setTags'](_0x247bee[_0x6550('0x4a')]['ids']||[]);}return null;})['then'](respondWithResult(_0x199948,null))[_0x6550('0x44')](handleError(_0x199948,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index d26a277..84d10d1 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 _0xd720=['rimraf','exports','define','DeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5d6e1c,_0x1a79fb){var _0x5e7687=function(_0x3e725a){while(--_0x3e725a){_0x5d6e1c['push'](_0x5d6e1c['shift']());}};_0x5e7687(++_0x1a79fb);}(_0xd720,0x190));var _0x0d72=function(_0x2ab6fe,_0xf8b471){_0x2ab6fe=_0x2ab6fe-0x0;var _0x24f39b=_0xd720[_0x2ab6fe];return _0x24f39b;};'use strict';var _=require(_0x0d72('0x0'));var util=require(_0x0d72('0x1'));var logger=require(_0x0d72('0x2'))(_0x0d72('0x3'));var moment=require(_0x0d72('0x4'));var BPromise=require(_0x0d72('0x5'));var rp=require(_0x0d72('0x6'));var fs=require('fs');var path=require(_0x0d72('0x7'));var rimraf=require(_0x0d72('0x8'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x0d72('0x9')]=function(_0x13b651,_0x1f5a72){return _0x13b651[_0x0d72('0xa')](_0x0d72('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe74b=['lodash','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations'];(function(_0x11b437,_0x47e6f7){var _0x2c2b82=function(_0x23d0ae){while(--_0x23d0ae){_0x11b437['push'](_0x11b437['shift']());}};_0x2c2b82(++_0x47e6f7);}(_0xe74b,0xfc));var _0xbe74=function(_0x226f98,_0x3140d5){_0x226f98=_0x226f98-0x0;var _0x459c86=_0xe74b[_0x226f98];return _0x459c86;};'use strict';var _=require(_0xbe74('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbe74('0x1'));var moment=require(_0xbe74('0x2'));var BPromise=require(_0xbe74('0x3'));var rp=require(_0xbe74('0x4'));var fs=require('fs');var path=require(_0xbe74('0x5'));var rimraf=require(_0xbe74('0x6'));var config=require('../../config/environment');var attributes=require(_0xbe74('0x7'));module[_0xbe74('0x8')]=function(_0x195103,_0x12673d){return _0x195103[_0xbe74('0x9')](_0xbe74('0xa'),attributes,{'tableName':_0xbe74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index ebb6a99..74a1bcc 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 _0x81b7=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x81b7,0x1f2));var _0x781b=function(_0x4e5b95,_0x3372fd){_0x4e5b95=_0x4e5b95-0x0;var _0x45f65f=_0x81b7[_0x4e5b95];return _0x45f65f;};'use strict';var _=require('lodash');var util=require(_0x781b('0x0'));var moment=require(_0x781b('0x1'));var BPromise=require(_0x781b('0x2'));var rs=require(_0x781b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x781b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x781b('0x5'))(_0x781b('0x6'));var config=require(_0x781b('0x7'));var jayson=require(_0x781b('0x8'));var client=jayson['client'][_0x781b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd9d633,_0x482803,_0x4aa451){return new BPromise(function(_0x3de3cd,_0x33c04b){return client[_0x781b('0xa')](_0xd9d633,_0x4aa451)[_0x781b('0xb')](function(_0x5591d9){logger[_0x781b('0xc')](_0x781b('0xd'),_0x482803,'request\x20sent');logger['debug'](_0x781b('0xe'),_0x482803,'request\x20sent',JSON[_0x781b('0xf')](_0x5591d9));if(_0x5591d9['error']){if(_0x5591d9[_0x781b('0x10')]['code']===0x1f4){logger[_0x781b('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x482803,_0x5591d9[_0x781b('0x10')][_0x781b('0x11')]);return _0x33c04b(_0x5591d9[_0x781b('0x10')][_0x781b('0x11')]);}logger[_0x781b('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x482803,_0x5591d9[_0x781b('0x10')][_0x781b('0x11')]);return _0x3de3cd(_0x5591d9[_0x781b('0x10')][_0x781b('0x11')]);}else{logger['info'](_0x781b('0xd'),_0x482803,'request\x20sent');_0x3de3cd(_0x5591d9[_0x781b('0x12')][_0x781b('0x11')]);}})[_0x781b('0x13')](function(_0x4ac48a){logger[_0x781b('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x482803,_0x4ac48a);_0x33c04b(_0x4ac48a);});});} \ No newline at end of file +var _0xfae3=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a5186,_0x5a32a0){var _0x1f7cc6=function(_0x36fcf0){while(--_0x36fcf0){_0x1a5186['push'](_0x1a5186['shift']());}};_0x1f7cc6(++_0x5a32a0);}(_0xfae3,0xa1));var _0x3fae=function(_0x1f43f4,_0x16d500){_0x1f43f4=_0x1f43f4-0x0;var _0x5435b7=_0xfae3[_0x1f43f4];return _0x5435b7;};'use strict';var _=require(_0x3fae('0x0'));var util=require(_0x3fae('0x1'));var moment=require(_0x3fae('0x2'));var BPromise=require(_0x3fae('0x3'));var rs=require(_0x3fae('0x4'));var fs=require('fs');var Redis=require(_0x3fae('0x5'));var db=require(_0x3fae('0x6'))['db'];var utils=require(_0x3fae('0x7'));var logger=require(_0x3fae('0x8'))(_0x3fae('0x9'));var config=require(_0x3fae('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3fae('0xb')][_0x3fae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47a827,_0x58bd5f,_0x28c778){return new BPromise(function(_0x1f5ce2,_0x4a5f5c){return client[_0x3fae('0xd')](_0x47a827,_0x28c778)[_0x3fae('0xe')](function(_0x140ab3){logger[_0x3fae('0xf')](_0x3fae('0x10'),_0x58bd5f,_0x3fae('0x11'));logger[_0x3fae('0x12')](_0x3fae('0x13'),_0x58bd5f,_0x3fae('0x11'),JSON[_0x3fae('0x14')](_0x140ab3));if(_0x140ab3[_0x3fae('0x15')]){if(_0x140ab3[_0x3fae('0x15')][_0x3fae('0x16')]===0x1f4){logger['error'](_0x3fae('0x10'),_0x58bd5f,_0x140ab3['error'][_0x3fae('0x17')]);return _0x4a5f5c(_0x140ab3[_0x3fae('0x15')][_0x3fae('0x17')]);}logger[_0x3fae('0x15')](_0x3fae('0x10'),_0x58bd5f,_0x140ab3[_0x3fae('0x15')][_0x3fae('0x17')]);return _0x1f5ce2(_0x140ab3[_0x3fae('0x15')][_0x3fae('0x17')]);}else{logger[_0x3fae('0xf')](_0x3fae('0x10'),_0x58bd5f,_0x3fae('0x11'));_0x1f5ce2(_0x140ab3[_0x3fae('0x18')][_0x3fae('0x17')]);}})[_0x3fae('0x19')](function(_0xbfb96d){logger[_0x3fae('0x15')](_0x3fae('0x10'),_0x58bd5f,_0xbfb96d);_0x4a5f5c(_0xbfb96d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7cabfe0..09e714f 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 _0x57ee=['get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x57ee,0x199));var _0xe57e=function(_0x48b8da,_0x4c6afb){_0x48b8da=_0x48b8da-0x0;var _0x5b0b54=_0x57ee[_0x48b8da];return _0x5b0b54;};'use strict';var multer=require(_0xe57e('0x0'));var util=require(_0xe57e('0x1'));var path=require(_0xe57e('0x2'));var timeout=require('connect-timeout');var express=require(_0xe57e('0x3'));var router=express[_0xe57e('0x4')]();var fs_extra=require(_0xe57e('0x5'));var auth=require(_0xe57e('0x6'));var interaction=require(_0xe57e('0x7'));var config=require(_0xe57e('0x8'));var controller=require('./intDeskField.controller');router[_0xe57e('0x9')]('/',auth[_0xe57e('0xa')](),controller[_0xe57e('0xb')]);router[_0xe57e('0x9')](_0xe57e('0xc'),auth['isAuthenticated'](),controller[_0xe57e('0xd')]);router[_0xe57e('0xe')]('/',auth[_0xe57e('0xa')](),controller[_0xe57e('0xf')]);router['put']('/:id',auth[_0xe57e('0xa')](),controller['update']);router[_0xe57e('0x10')](_0xe57e('0xc'),auth[_0xe57e('0xa')](),controller[_0xe57e('0x11')]);module[_0xe57e('0x12')]=router; \ No newline at end of file +var _0xf831=['create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','show','post'];(function(_0x2b5014,_0x463ffd){var _0x262951=function(_0x271fcf){while(--_0x271fcf){_0x2b5014['push'](_0x2b5014['shift']());}};_0x262951(++_0x463ffd);}(_0xf831,0x10b));var _0x1f83=function(_0x559a4c,_0x4c6490){_0x559a4c=_0x559a4c-0x0;var _0x3ddcd9=_0xf831[_0x559a4c];return _0x3ddcd9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f83('0x0'));var timeout=require(_0x1f83('0x1'));var express=require(_0x1f83('0x2'));var router=express[_0x1f83('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f83('0x4'));var interaction=require(_0x1f83('0x5'));var config=require(_0x1f83('0x6'));var controller=require(_0x1f83('0x7'));router['get']('/',auth[_0x1f83('0x8')](),controller[_0x1f83('0x9')]);router[_0x1f83('0xa')]('/:id',auth[_0x1f83('0x8')](),controller[_0x1f83('0xb')]);router[_0x1f83('0xc')]('/',auth[_0x1f83('0x8')](),controller[_0x1f83('0xd')]);router[_0x1f83('0xe')](_0x1f83('0xf'),auth[_0x1f83('0x8')](),controller[_0x1f83('0x10')]);router[_0x1f83('0x11')](_0x1f83('0xf'),auth[_0x1f83('0x8')](),controller[_0x1f83('0x12')]);module[_0x1f83('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 4e936c0..61f7fd7 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 _0x55d1=['customVariable','BOOLEAN','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x5570ef,_0x25b17b){var _0x1bd7e6=function(_0x420541){while(--_0x420541){_0x5570ef['push'](_0x5570ef['shift']());}};_0x1bd7e6(++_0x25b17b);}(_0x55d1,0xfa));var _0x155d=function(_0x9fdd0c,_0x59b230){_0x9fdd0c=_0x9fdd0c-0x0;var _0x224beb=_0x55d1[_0x9fdd0c];return _0x224beb;};'use strict';var Sequelize=require('sequelize');module[_0x155d('0x0')]={'type':{'type':Sequelize[_0x155d('0x1')](_0x155d('0x2'),_0x155d('0x3'),'customVariable',_0x155d('0x4'),'picklist'),'defaultValue':_0x155d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x155d('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x155d('0x3'),_0x155d('0x6'))},'keyContent':{'type':Sequelize[_0x155d('0x5')]},'idField':{'type':Sequelize[_0x155d('0x5')]},'nameField':{'type':Sequelize[_0x155d('0x5')]},'customField':{'type':Sequelize[_0x155d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x155d('0x5')]}}; \ No newline at end of file +var _0x118b=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x41b1b1,_0x1bc864){var _0x2ca25c=function(_0x7897c3){while(--_0x7897c3){_0x41b1b1['push'](_0x41b1b1['shift']());}};_0x2ca25c(++_0x1bc864);}(_0x118b,0x1ec));var _0xb118=function(_0x14371b,_0x14e4e3){_0x14371b=_0x14371b-0x0;var _0x5ef2cb=_0x118b[_0x14371b];return _0x5ef2cb;};'use strict';var Sequelize=require(_0xb118('0x0'));module[_0xb118('0x1')]={'type':{'type':Sequelize[_0xb118('0x2')](_0xb118('0x3'),'variable',_0xb118('0x4'),_0xb118('0x5'),_0xb118('0x6')),'defaultValue':_0xb118('0x3')},'content':{'type':Sequelize[_0xb118('0x7')]},'key':{'type':Sequelize[_0xb118('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xb118('0x4'))},'keyContent':{'type':Sequelize[_0xb118('0x7')]},'idField':{'type':Sequelize[_0xb118('0x7')]},'nameField':{'type':Sequelize[_0xb118('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 04bebd3..7636b1a 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 _0xb3f9=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','DeskField','includeAll','findAll','show','params','include','options','find','create','body','catch','update','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x10ea69,_0x27b2b6){var _0x38d1da=function(_0x5baf43){while(--_0x5baf43){_0x10ea69['push'](_0x10ea69['shift']());}};_0x38d1da(++_0x27b2b6);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x25d4b3,_0x58b425){_0x25d4b3=_0x25d4b3-0x0;var _0x250f94=_0xb3f9[_0x25d4b3];return _0x250f94;};'use strict';var emlformat=require(_0x9b3f('0x0'));var rimraf=require(_0x9b3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9b3f('0x2'));var moment=require('moment');var BPromise=require(_0x9b3f('0x3'));var Mustache=require(_0x9b3f('0x4'));var util=require(_0x9b3f('0x5'));var path=require(_0x9b3f('0x6'));var sox=require(_0x9b3f('0x7'));var csv=require(_0x9b3f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b3f('0x9'));var squel=require(_0x9b3f('0xa'));var crypto=require('crypto');var jsforce=require(_0x9b3f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9b3f('0xc'));var Redis=require('ioredis');var authService=require(_0x9b3f('0xd'));var qs=require(_0x9b3f('0xe'));var as=require(_0x9b3f('0xf'));var hardwareService=require(_0x9b3f('0x10'));var logger=require(_0x9b3f('0x11'))('api');var utils=require(_0x9b3f('0x12'));var config=require(_0x9b3f('0x13'));var licenseUtil=require(_0x9b3f('0x14'));var db=require(_0x9b3f('0x15'))['db'];function respondWithStatusCode(_0x1ce80f,_0x310b83){_0x310b83=_0x310b83||0xcc;return function(_0x35554e){if(_0x35554e){return _0x1ce80f[_0x9b3f('0x16')](_0x310b83);}return _0x1ce80f['status'](_0x310b83)['end']();};}function respondWithResult(_0x56f676,_0x2f9d90){_0x2f9d90=_0x2f9d90||0xc8;return function(_0x27dab5){if(_0x27dab5){return _0x56f676[_0x9b3f('0x17')](_0x2f9d90)[_0x9b3f('0x18')](_0x27dab5);}};}function respondWithFilteredResult(_0x52310c,_0x4aa66a){return function(_0x49c0ac){if(_0x49c0ac){var _0x34fb19=typeof _0x4aa66a[_0x9b3f('0x19')]===_0x9b3f('0x1a')&&typeof _0x4aa66a[_0x9b3f('0x1b')]===_0x9b3f('0x1a');var _0x2cdc7c=_0x49c0ac['count'];var _0x579c32=_0x34fb19?0x0:_0x4aa66a[_0x9b3f('0x19')];var _0x235434=_0x34fb19?_0x49c0ac[_0x9b3f('0x1c')]:_0x4aa66a[_0x9b3f('0x19')]+_0x4aa66a[_0x9b3f('0x1b')];var _0x297fa8;if(_0x235434>=_0x2cdc7c){_0x235434=_0x2cdc7c;_0x297fa8=0xc8;}else{_0x297fa8=0xce;}_0x52310c[_0x9b3f('0x17')](_0x297fa8);return _0x52310c[_0x9b3f('0x1d')](_0x9b3f('0x1e'),_0x579c32+'-'+_0x235434+'/'+_0x2cdc7c)[_0x9b3f('0x18')](_0x49c0ac);}return null;};}function patchUpdates(_0xa4883e){return function(_0x1cb346){try{jsonpatch[_0x9b3f('0x1f')](_0x1cb346,_0xa4883e,!![]);}catch(_0x1218c0){return BPromise[_0x9b3f('0x20')](_0x1218c0);}return _0x1cb346[_0x9b3f('0x21')]();};}function saveUpdates(_0x1d5c43,_0x5195e9){return function(_0x3360d6){if(_0x3360d6){return _0x3360d6['update'](_0x1d5c43)[_0x9b3f('0x22')](function(_0x4db496){return _0x4db496;});}return null;};}function removeEntity(_0x4704dd,_0x5d075f){return function(_0x3c9d8d){if(_0x3c9d8d){return _0x3c9d8d[_0x9b3f('0x23')]()[_0x9b3f('0x22')](function(){_0x4704dd['status'](0xcc)[_0x9b3f('0x24')]();});}};}function handleEntityNotFound(_0x483eb3,_0x325c74){return function(_0x526355){if(!_0x526355){_0x483eb3[_0x9b3f('0x16')](0x194);}return _0x526355;};}function handleError(_0x32aa3e,_0x51014e){_0x51014e=_0x51014e||0x1f4;return function(_0x248c9d){logger[_0x9b3f('0x25')](_0x248c9d[_0x9b3f('0x26')]);if(_0x248c9d[_0x9b3f('0x27')]){delete _0x248c9d['name'];}_0x32aa3e['status'](_0x51014e)[_0x9b3f('0x28')](_0x248c9d);};}exports['index']=function(_0x377d0e,_0x4a0d60){var _0x1059b1={},_0x128542={},_0x35f2dd={'count':0x0,'rows':[]};var _0x1c89d3=_[_0x9b3f('0x29')](db['DeskField'][_0x9b3f('0x2a')],function(_0x38dd12){return{'name':_0x38dd12[_0x9b3f('0x2b')],'type':_0x38dd12[_0x9b3f('0x2c')][_0x9b3f('0x2d')]};});_0x128542[_0x9b3f('0x2e')]=_[_0x9b3f('0x29')](_0x1c89d3,'name');_0x128542['query']=_[_0x9b3f('0x2f')](_0x377d0e['query']);_0x128542['filters']=_[_0x9b3f('0x30')](_0x128542['model'],_0x128542[_0x9b3f('0x31')]);_0x1059b1[_0x9b3f('0x32')]=_[_0x9b3f('0x30')](_0x128542[_0x9b3f('0x2e')],qs[_0x9b3f('0x33')](_0x377d0e['query'][_0x9b3f('0x33')]));_0x1059b1[_0x9b3f('0x32')]=_0x1059b1[_0x9b3f('0x32')][_0x9b3f('0x34')]?_0x1059b1[_0x9b3f('0x32')]:_0x128542[_0x9b3f('0x2e')];if(!_0x377d0e['query'][_0x9b3f('0x35')](_0x9b3f('0x36'))){_0x1059b1[_0x9b3f('0x1b')]=qs['limit'](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x1b')]);_0x1059b1[_0x9b3f('0x19')]=qs[_0x9b3f('0x19')](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x19')]);}_0x1059b1[_0x9b3f('0x37')]=qs[_0x9b3f('0x38')](_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x38')]);_0x1059b1[_0x9b3f('0x39')]=qs[_0x9b3f('0x3a')](_[_0x9b3f('0x3b')](_0x377d0e[_0x9b3f('0x31')],_0x128542[_0x9b3f('0x3a')]),_0x1c89d3);if(_0x377d0e['query'][_0x9b3f('0x3c')]){_0x1059b1[_0x9b3f('0x39')]=_[_0x9b3f('0x3d')](_0x1059b1[_0x9b3f('0x39')],{'$or':_[_0x9b3f('0x29')](_0x1c89d3,function(_0x1d08b5){if(_0x1d08b5[_0x9b3f('0x2c')]!=='VIRTUAL'){var _0x1c2154={};_0x1c2154[_0x1d08b5[_0x9b3f('0x27')]]={'$like':'%'+_0x377d0e['query'][_0x9b3f('0x3c')]+'%'};return _0x1c2154;}})});}_0x1059b1=_[_0x9b3f('0x3d')]({},_0x1059b1,_0x377d0e['options']);var _0x13b6c4={'where':_0x1059b1[_0x9b3f('0x39')]};return db[_0x9b3f('0x3e')]['count'](_0x13b6c4)[_0x9b3f('0x22')](function(_0xb34c29){_0x35f2dd[_0x9b3f('0x1c')]=_0xb34c29;if(_0x377d0e[_0x9b3f('0x31')][_0x9b3f('0x3f')]){_0x1059b1['include']=[{'all':!![]}];}return db['DeskField'][_0x9b3f('0x40')](_0x1059b1);})[_0x9b3f('0x22')](function(_0x54e5bc){_0x35f2dd['rows']=_0x54e5bc;return _0x35f2dd;})[_0x9b3f('0x22')](respondWithFilteredResult(_0x4a0d60,_0x1059b1))['catch'](handleError(_0x4a0d60,null));};exports[_0x9b3f('0x41')]=function(_0x547fdc,_0x8f9971){var _0x4ae4c1={'raw':!![],'where':{'id':_0x547fdc[_0x9b3f('0x42')]['id']}},_0x4eb8fe={};_0x4eb8fe[_0x9b3f('0x2e')]=_[_0x9b3f('0x2f')](db[_0x9b3f('0x3e')]['rawAttributes']);_0x4eb8fe['query']=_[_0x9b3f('0x2f')](_0x547fdc['query']);_0x4eb8fe[_0x9b3f('0x3a')]=_[_0x9b3f('0x30')](_0x4eb8fe['model'],_0x4eb8fe[_0x9b3f('0x31')]);_0x4ae4c1[_0x9b3f('0x32')]=_[_0x9b3f('0x30')](_0x4eb8fe[_0x9b3f('0x2e')],qs['fields'](_0x547fdc[_0x9b3f('0x31')][_0x9b3f('0x33')]));_0x4ae4c1[_0x9b3f('0x32')]=_0x4ae4c1[_0x9b3f('0x32')][_0x9b3f('0x34')]?_0x4ae4c1['attributes']:_0x4eb8fe[_0x9b3f('0x2e')];if(_0x547fdc[_0x9b3f('0x31')]['includeAll']){_0x4ae4c1[_0x9b3f('0x43')]=[{'all':!![]}];}_0x4ae4c1=_[_0x9b3f('0x3d')]({},_0x4ae4c1,_0x547fdc[_0x9b3f('0x44')]);return db[_0x9b3f('0x3e')][_0x9b3f('0x45')](_0x4ae4c1)[_0x9b3f('0x22')](handleEntityNotFound(_0x8f9971,null))[_0x9b3f('0x22')](respondWithResult(_0x8f9971,null))['catch'](handleError(_0x8f9971,null));};exports[_0x9b3f('0x46')]=function(_0x3bc2c9,_0x420d6f){return db[_0x9b3f('0x3e')][_0x9b3f('0x46')](_0x3bc2c9[_0x9b3f('0x47')],{})[_0x9b3f('0x22')](respondWithResult(_0x420d6f,0xc9))[_0x9b3f('0x48')](handleError(_0x420d6f,null));};exports[_0x9b3f('0x49')]=function(_0x51dd3d,_0x24d3cd){if(_0x51dd3d['body']['id']){delete _0x51dd3d[_0x9b3f('0x47')]['id'];}return db[_0x9b3f('0x3e')][_0x9b3f('0x45')]({'where':{'id':_0x51dd3d[_0x9b3f('0x42')]['id']}})['then'](handleEntityNotFound(_0x24d3cd,null))[_0x9b3f('0x22')](saveUpdates(_0x51dd3d[_0x9b3f('0x47')],null))[_0x9b3f('0x22')](respondWithResult(_0x24d3cd,null))[_0x9b3f('0x48')](handleError(_0x24d3cd,null));};exports['destroy']=function(_0x571f57,_0x4eede7){return db['DeskField'][_0x9b3f('0x45')]({'where':{'id':_0x571f57[_0x9b3f('0x42')]['id']}})[_0x9b3f('0x22')](handleEntityNotFound(_0x4eede7,null))[_0x9b3f('0x22')](removeEntity(_0x4eede7,null))[_0x9b3f('0x48')](handleError(_0x4eede7,null));}; \ No newline at end of file +var _0x2192=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','params','keys','includeAll','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0x2192,0x1a0));var _0x2219=function(_0x430171,_0x18a910){_0x430171=_0x430171-0x0;var _0x51a842=_0x2192[_0x430171];return _0x51a842;};'use strict';var emlformat=require(_0x2219('0x0'));var rimraf=require(_0x2219('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2219('0x2'));var rp=require(_0x2219('0x3'));var moment=require(_0x2219('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2219('0x5'));var path=require('path');var sox=require(_0x2219('0x6'));var csv=require(_0x2219('0x7'));var ejs=require(_0x2219('0x8'));var fs=require('fs');var fs_extra=require(_0x2219('0x9'));var _=require(_0x2219('0xa'));var squel=require(_0x2219('0xb'));var crypto=require(_0x2219('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2219('0xd'));var toCsv=require(_0x2219('0x7'));var querystring=require(_0x2219('0xe'));var Papa=require(_0x2219('0xf'));var Redis=require(_0x2219('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2219('0x11'));var as=require(_0x2219('0x12'));var hardwareService=require(_0x2219('0x13'));var logger=require(_0x2219('0x14'))(_0x2219('0x15'));var utils=require(_0x2219('0x16'));var config=require(_0x2219('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2219('0x18'))['db'];function respondWithStatusCode(_0x5c232e,_0x5eb7fd){_0x5eb7fd=_0x5eb7fd||0xcc;return function(_0x13a832){if(_0x13a832){return _0x5c232e[_0x2219('0x19')](_0x5eb7fd);}return _0x5c232e[_0x2219('0x1a')](_0x5eb7fd)[_0x2219('0x1b')]();};}function respondWithResult(_0x131610,_0x3fe369){_0x3fe369=_0x3fe369||0xc8;return function(_0x1e3bc8){if(_0x1e3bc8){return _0x131610[_0x2219('0x1a')](_0x3fe369)[_0x2219('0x1c')](_0x1e3bc8);}};}function respondWithFilteredResult(_0x5ab933,_0x325b3d){return function(_0x1a2f60){if(_0x1a2f60){var _0xf1d07d=typeof _0x325b3d[_0x2219('0x1d')]===_0x2219('0x1e')&&typeof _0x325b3d[_0x2219('0x1f')]===_0x2219('0x1e');var _0x539e1b=_0x1a2f60[_0x2219('0x20')];var _0x4e1e40=_0xf1d07d?0x0:_0x325b3d[_0x2219('0x1d')];var _0x466b59=_0xf1d07d?_0x1a2f60[_0x2219('0x20')]:_0x325b3d['offset']+_0x325b3d[_0x2219('0x1f')];var _0x4506d3;if(_0x466b59>=_0x539e1b){_0x466b59=_0x539e1b;_0x4506d3=0xc8;}else{_0x4506d3=0xce;}_0x5ab933['status'](_0x4506d3);return _0x5ab933[_0x2219('0x21')](_0x2219('0x22'),_0x4e1e40+'-'+_0x466b59+'/'+_0x539e1b)['json'](_0x1a2f60);}return null;};}function patchUpdates(_0x1ba983){return function(_0xf905){try{jsonpatch[_0x2219('0x23')](_0xf905,_0x1ba983,!![]);}catch(_0x55b1aa){return BPromise['reject'](_0x55b1aa);}return _0xf905['save']();};}function saveUpdates(_0x41e1a2,_0x593309){return function(_0x5e6edd){if(_0x5e6edd){return _0x5e6edd['update'](_0x41e1a2)[_0x2219('0x24')](function(_0x18fa78){return _0x18fa78;});}return null;};}function removeEntity(_0x574243,_0x835f7b){return function(_0x840627){if(_0x840627){return _0x840627[_0x2219('0x25')]()['then'](function(){_0x574243[_0x2219('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x204aea,_0x3677bc){return function(_0x184716){if(!_0x184716){_0x204aea['sendStatus'](0x194);}return _0x184716;};}function handleError(_0x1d2ae0,_0x2d426e){_0x2d426e=_0x2d426e||0x1f4;return function(_0x174e1d){logger[_0x2219('0x26')](_0x174e1d['stack']);if(_0x174e1d[_0x2219('0x27')]){delete _0x174e1d['name'];}_0x1d2ae0[_0x2219('0x1a')](_0x2d426e)[_0x2219('0x28')](_0x174e1d);};}exports[_0x2219('0x29')]=function(_0x4753af,_0x1a26b5){var _0x8372c1={},_0x58288f={},_0x32cebb={'count':0x0,'rows':[]};var _0x3a3c10=_[_0x2219('0x2a')](db[_0x2219('0x2b')][_0x2219('0x2c')],function(_0x536dc5){return{'name':_0x536dc5[_0x2219('0x2d')],'type':_0x536dc5[_0x2219('0x2e')][_0x2219('0x2f')]};});_0x58288f[_0x2219('0x30')]=_[_0x2219('0x2a')](_0x3a3c10,'name');_0x58288f[_0x2219('0x31')]=_['keys'](_0x4753af[_0x2219('0x31')]);_0x58288f[_0x2219('0x32')]=_[_0x2219('0x33')](_0x58288f[_0x2219('0x30')],_0x58288f[_0x2219('0x31')]);_0x8372c1[_0x2219('0x34')]=_[_0x2219('0x33')](_0x58288f[_0x2219('0x30')],qs[_0x2219('0x35')](_0x4753af['query'][_0x2219('0x35')]));_0x8372c1[_0x2219('0x34')]=_0x8372c1[_0x2219('0x34')][_0x2219('0x36')]?_0x8372c1[_0x2219('0x34')]:_0x58288f['model'];if(!_0x4753af[_0x2219('0x31')][_0x2219('0x37')]('nolimit')){_0x8372c1[_0x2219('0x1f')]=qs[_0x2219('0x1f')](_0x4753af[_0x2219('0x31')][_0x2219('0x1f')]);_0x8372c1[_0x2219('0x1d')]=qs[_0x2219('0x1d')](_0x4753af[_0x2219('0x31')][_0x2219('0x1d')]);}_0x8372c1[_0x2219('0x38')]=qs[_0x2219('0x39')](_0x4753af['query'][_0x2219('0x39')]);_0x8372c1[_0x2219('0x3a')]=qs[_0x2219('0x32')](_[_0x2219('0x3b')](_0x4753af[_0x2219('0x31')],_0x58288f['filters']),_0x3a3c10);if(_0x4753af['query'][_0x2219('0x3c')]){_0x8372c1[_0x2219('0x3a')]=_[_0x2219('0x3d')](_0x8372c1[_0x2219('0x3a')],{'$or':_['map'](_0x3a3c10,function(_0x200c65){if(_0x200c65[_0x2219('0x2e')]!==_0x2219('0x3e')){var _0x32b5a9={};_0x32b5a9[_0x200c65[_0x2219('0x27')]]={'$like':'%'+_0x4753af['query']['filter']+'%'};return _0x32b5a9;}})});}_0x8372c1=_[_0x2219('0x3d')]({},_0x8372c1,_0x4753af[_0x2219('0x3f')]);var _0x1a7bd7={'where':_0x8372c1[_0x2219('0x3a')]};return db[_0x2219('0x2b')][_0x2219('0x20')](_0x1a7bd7)[_0x2219('0x24')](function(_0x105835){_0x32cebb[_0x2219('0x20')]=_0x105835;if(_0x4753af[_0x2219('0x31')]['includeAll']){_0x8372c1['include']=[{'all':!![]}];}return db[_0x2219('0x2b')][_0x2219('0x40')](_0x8372c1);})[_0x2219('0x24')](function(_0x2e8ffe){_0x32cebb['rows']=_0x2e8ffe;return _0x32cebb;})[_0x2219('0x24')](respondWithFilteredResult(_0x1a26b5,_0x8372c1))[_0x2219('0x41')](handleError(_0x1a26b5,null));};exports['show']=function(_0x58883c,_0x4255f2){var _0x584665={'raw':!![],'where':{'id':_0x58883c[_0x2219('0x42')]['id']}},_0x44bc56={};_0x44bc56[_0x2219('0x30')]=_[_0x2219('0x43')](db[_0x2219('0x2b')][_0x2219('0x2c')]);_0x44bc56[_0x2219('0x31')]=_[_0x2219('0x43')](_0x58883c['query']);_0x44bc56[_0x2219('0x32')]=_[_0x2219('0x33')](_0x44bc56['model'],_0x44bc56[_0x2219('0x31')]);_0x584665['attributes']=_['intersection'](_0x44bc56['model'],qs[_0x2219('0x35')](_0x58883c[_0x2219('0x31')][_0x2219('0x35')]));_0x584665[_0x2219('0x34')]=_0x584665['attributes'][_0x2219('0x36')]?_0x584665[_0x2219('0x34')]:_0x44bc56['model'];if(_0x58883c[_0x2219('0x31')][_0x2219('0x44')]){_0x584665[_0x2219('0x45')]=[{'all':!![]}];}_0x584665=_[_0x2219('0x3d')]({},_0x584665,_0x58883c['options']);return db[_0x2219('0x2b')][_0x2219('0x46')](_0x584665)[_0x2219('0x24')](handleEntityNotFound(_0x4255f2,null))['then'](respondWithResult(_0x4255f2,null))['catch'](handleError(_0x4255f2,null));};exports[_0x2219('0x47')]=function(_0x2442ee,_0x18ea14){return db[_0x2219('0x2b')][_0x2219('0x47')](_0x2442ee[_0x2219('0x48')],{})['then'](respondWithResult(_0x18ea14,0xc9))['catch'](handleError(_0x18ea14,null));};exports['update']=function(_0x346413,_0x473791){if(_0x346413[_0x2219('0x48')]['id']){delete _0x346413[_0x2219('0x48')]['id'];}return db[_0x2219('0x2b')][_0x2219('0x46')]({'where':{'id':_0x346413['params']['id']}})[_0x2219('0x24')](handleEntityNotFound(_0x473791,null))['then'](saveUpdates(_0x346413[_0x2219('0x48')],null))['then'](respondWithResult(_0x473791,null))['catch'](handleError(_0x473791,null));};exports[_0x2219('0x25')]=function(_0x4c3cf1,_0x3cfe6b){return db[_0x2219('0x2b')][_0x2219('0x46')]({'where':{'id':_0x4c3cf1[_0x2219('0x42')]['id']}})[_0x2219('0x24')](handleEntityNotFound(_0x3cfe6b,null))[_0x2219('0x24')](removeEntity(_0x3cfe6b,null))[_0x2219('0x41')](handleError(_0x3cfe6b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6c05412..097666c 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 _0x4807=['bluebird','rimraf','./intDeskField.attributes','define','DeskField','int_desk_fields','FieldId','lodash','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4807,0x11a));var _0x7480=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4807[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7480('0x0'));var util=require(_0x7480('0x1'));var logger=require('../../config/logger')(_0x7480('0x2'));var moment=require(_0x7480('0x3'));var BPromise=require(_0x7480('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7480('0x5'));var config=require('../../config/environment');var attributes=require(_0x7480('0x6'));module['exports']=function(_0x22d032,_0x5d508c){return _0x22d032[_0x7480('0x7')](_0x7480('0x8'),attributes,{'tableName':_0x7480('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x7480('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeaa6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','FieldId'];(function(_0x4d97f1,_0x12f4f3){var _0x27ebfd=function(_0x1bf9d9){while(--_0x1bf9d9){_0x4d97f1['push'](_0x4d97f1['shift']());}};_0x27ebfd(++_0x12f4f3);}(_0xeaa6,0x126));var _0x6eaa=function(_0x4e015e,_0x2fb5d9){_0x4e015e=_0x4e015e-0x0;var _0x2bcd9e=_0xeaa6[_0x4e015e];return _0x2bcd9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6eaa('0x0'))(_0x6eaa('0x1'));var moment=require(_0x6eaa('0x2'));var BPromise=require(_0x6eaa('0x3'));var rp=require(_0x6eaa('0x4'));var fs=require('fs');var path=require(_0x6eaa('0x5'));var rimraf=require(_0x6eaa('0x6'));var config=require('../../config/environment');var attributes=require(_0x6eaa('0x7'));module[_0x6eaa('0x8')]=function(_0x593544,_0x3a867b){return _0x593544[_0x6eaa('0x9')](_0x6eaa('0xa'),attributes,{'tableName':_0x6eaa('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x6eaa('0xc'),_0x6eaa('0xd')],'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 31742ca..f463614 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 _0xb94b=['DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0xb94b,0xea));var _0xbb94=function(_0x419ed3,_0x1de0f3){_0x419ed3=_0x419ed3-0x0;var _0xb11f34=_0xb94b[_0x419ed3];return _0xb11f34;};'use strict';var _=require(_0xbb94('0x0'));var util=require(_0xbb94('0x1'));var moment=require('moment');var BPromise=require(_0xbb94('0x2'));var rs=require(_0xbb94('0x3'));var fs=require('fs');var Redis=require(_0xbb94('0x4'));var db=require(_0xbb94('0x5'))['db'];var utils=require(_0xbb94('0x6'));var logger=require(_0xbb94('0x7'))(_0xbb94('0x8'));var config=require(_0xbb94('0x9'));var jayson=require(_0xbb94('0xa'));var client=jayson[_0xbb94('0xb')][_0xbb94('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5238a1,_0x468d3d,_0x21b945){return new BPromise(function(_0x391bd1,_0x5d333b){return client[_0xbb94('0xd')](_0x5238a1,_0x21b945)[_0xbb94('0xe')](function(_0x20889d){logger[_0xbb94('0xf')](_0xbb94('0x10'),_0x468d3d,_0xbb94('0x11'));logger[_0xbb94('0x12')](_0xbb94('0x13'),_0x468d3d,_0xbb94('0x11'),JSON[_0xbb94('0x14')](_0x20889d));if(_0x20889d[_0xbb94('0x15')]){if(_0x20889d[_0xbb94('0x15')][_0xbb94('0x16')]===0x1f4){logger[_0xbb94('0x15')](_0xbb94('0x10'),_0x468d3d,_0x20889d[_0xbb94('0x15')]['message']);return _0x5d333b(_0x20889d[_0xbb94('0x15')][_0xbb94('0x17')]);}logger[_0xbb94('0x15')](_0xbb94('0x10'),_0x468d3d,_0x20889d[_0xbb94('0x15')][_0xbb94('0x17')]);return _0x391bd1(_0x20889d['error'][_0xbb94('0x17')]);}else{logger[_0xbb94('0xf')](_0xbb94('0x10'),_0x468d3d,_0xbb94('0x11'));_0x391bd1(_0x20889d['result']['message']);}})[_0xbb94('0x18')](function(_0x2bd6a5){logger[_0xbb94('0x15')](_0xbb94('0x10'),_0x468d3d,_0x2bd6a5);_0x5d333b(_0x2bd6a5);});});} \ No newline at end of file +var _0x288b=['../../mysqldb','rpc','jayson/promise','http','request','info','request\x20sent','stringify','error','DeskField,\x20%s,\x20%s','message','result','lodash','util','bluebird'];(function(_0x2ad316,_0x5e526b){var _0x36537a=function(_0x389955){while(--_0x389955){_0x2ad316['push'](_0x2ad316['shift']());}};_0x36537a(++_0x5e526b);}(_0x288b,0x66));var _0xb288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x288b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb288('0x0'));var util=require(_0xb288('0x1'));var moment=require('moment');var BPromise=require(_0xb288('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb288('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb288('0x4'));var config=require('../../config/environment');var jayson=require(_0xb288('0x5'));var client=jayson['client'][_0xb288('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x226bea,_0xcf0ec7,_0x16dfc0){return new BPromise(function(_0x39b5bf,_0x52bb89){return client[_0xb288('0x7')](_0x226bea,_0x16dfc0)['then'](function(_0x2de81f){logger[_0xb288('0x8')]('DeskField,\x20%s,\x20%s',_0xcf0ec7,_0xb288('0x9'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0xcf0ec7,_0xb288('0x9'),JSON[_0xb288('0xa')](_0x2de81f));if(_0x2de81f[_0xb288('0xb')]){if(_0x2de81f['error']['code']===0x1f4){logger[_0xb288('0xb')](_0xb288('0xc'),_0xcf0ec7,_0x2de81f['error'][_0xb288('0xd')]);return _0x52bb89(_0x2de81f[_0xb288('0xb')][_0xb288('0xd')]);}logger[_0xb288('0xb')](_0xb288('0xc'),_0xcf0ec7,_0x2de81f[_0xb288('0xb')]['message']);return _0x39b5bf(_0x2de81f[_0xb288('0xb')][_0xb288('0xd')]);}else{logger['info'](_0xb288('0xc'),_0xcf0ec7,_0xb288('0x9'));_0x39b5bf(_0x2de81f[_0xb288('0xe')][_0xb288('0xd')]);}})['catch'](function(_0x5a0150){logger['error'](_0xb288('0xc'),_0xcf0ec7,_0x5a0150);_0x52bb89(_0x5a0150);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index e8b05e0..616b4cb 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 _0x1565=['index','/:id','show','getConfigurations','getFields','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated'];(function(_0x3d2821,_0xf536a1){var _0x19c01c=function(_0x3ebe57){while(--_0x3ebe57){_0x3d2821['push'](_0x3d2821['shift']());}};_0x19c01c(++_0xf536a1);}(_0x1565,0x97));var _0x5156=function(_0x5be360,_0x40115a){_0x5be360=_0x5be360-0x0;var _0xb0340c=_0x1565[_0x5be360];return _0xb0340c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5156('0x0'));var timeout=require(_0x5156('0x1'));var express=require(_0x5156('0x2'));var router=express[_0x5156('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5156('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5156('0x5'));var controller=require(_0x5156('0x6'));router[_0x5156('0x7')]('/',auth[_0x5156('0x8')](),controller[_0x5156('0x9')]);router['get'](_0x5156('0xa'),auth[_0x5156('0x8')](),controller[_0x5156('0xb')]);router[_0x5156('0x7')]('/:id/configurations',auth[_0x5156('0x8')](),controller[_0x5156('0xc')]);router['get']('/:id/fields',auth[_0x5156('0x8')](),controller[_0x5156('0xd')]);router[_0x5156('0xe')]('/',auth[_0x5156('0x8')](),controller[_0x5156('0xf')]);router['post']('/:id/configurations',auth[_0x5156('0x8')](),controller['addConfiguration']);router[_0x5156('0x10')](_0x5156('0xa'),auth[_0x5156('0x8')](),controller['update']);router[_0x5156('0x11')](_0x5156('0xa'),auth['isAuthenticated'](),controller[_0x5156('0x12')]);module[_0x5156('0x13')]=router; \ No newline at end of file +var _0x4a0c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x325cc1,_0xf5b785){var _0x38939b=function(_0x4518e2){while(--_0x4518e2){_0x325cc1['push'](_0x325cc1['shift']());}};_0x38939b(++_0xf5b785);}(_0x4a0c,0x96));var _0xc4a0=function(_0x180b7f,_0x5d8a0c){_0x180b7f=_0x180b7f-0x0;var _0xfa39ec=_0x4a0c[_0x180b7f];return _0xfa39ec;};'use strict';var multer=require(_0xc4a0('0x0'));var util=require(_0xc4a0('0x1'));var path=require(_0xc4a0('0x2'));var timeout=require(_0xc4a0('0x3'));var express=require(_0xc4a0('0x4'));var router=express[_0xc4a0('0x5')]();var fs_extra=require(_0xc4a0('0x6'));var auth=require(_0xc4a0('0x7'));var interaction=require(_0xc4a0('0x8'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xc4a0('0x9')]('/',auth[_0xc4a0('0xa')](),controller['index']);router[_0xc4a0('0x9')](_0xc4a0('0xb'),auth[_0xc4a0('0xa')](),controller['show']);router[_0xc4a0('0x9')](_0xc4a0('0xc'),auth[_0xc4a0('0xa')](),controller[_0xc4a0('0xd')]);router['get']('/:id/fields',auth[_0xc4a0('0xa')](),controller[_0xc4a0('0xe')]);router[_0xc4a0('0xf')]('/',auth[_0xc4a0('0xa')](),controller[_0xc4a0('0x10')]);router[_0xc4a0('0xf')](_0xc4a0('0xc'),auth[_0xc4a0('0xa')](),controller[_0xc4a0('0x11')]);router[_0xc4a0('0x12')](_0xc4a0('0xb'),auth[_0xc4a0('0xa')](),controller[_0xc4a0('0x13')]);router[_0xc4a0('0x14')](_0xc4a0('0xb'),auth[_0xc4a0('0xa')](),controller[_0xc4a0('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 8b333b9..4f42534 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 _0x4ce5=['STRING','sequelize'];(function(_0x1d1509,_0x4f7b66){var _0x2c13ae=function(_0x1eb725){while(--_0x1eb725){_0x1d1509['push'](_0x1d1509['shift']());}};_0x2c13ae(++_0x4f7b66);}(_0x4ce5,0x185));var _0x54ce=function(_0x5ef67e,_0xbfd168){_0x5ef67e=_0x5ef67e-0x0;var _0x2ff64b=_0x4ce5[_0x5ef67e];return _0x2ff64b;};'use strict';var Sequelize=require(_0x54ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x54ce('0x1')]},'username':{'type':Sequelize[_0x54ce('0x1')]},'password':{'type':Sequelize[_0x54ce('0x1')]},'remoteUri':{'type':Sequelize[_0x54ce('0x1')]},'tenantId':{'type':Sequelize[_0x54ce('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x54ce('0x1')]},'serverUrl':{'type':Sequelize[_0x54ce('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x54ce('0x1')]}}; \ No newline at end of file +var _0xd780=['STRING','sequelize','exports'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0xd780,0x1c0));var _0x0d78=function(_0x283044,_0x589c3b){_0x283044=_0x283044-0x0;var _0x373431=_0xd780[_0x283044];return _0x373431;};'use strict';var Sequelize=require(_0x0d78('0x0'));module[_0x0d78('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0d78('0x2')]},'password':{'type':Sequelize[_0x0d78('0x2')]},'remoteUri':{'type':Sequelize[_0x0d78('0x2')]},'tenantId':{'type':Sequelize[_0x0d78('0x2')]},'clientId':{'type':Sequelize[_0x0d78('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x0d78('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a7fcf91..8438a23 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 _0x8ef6=['@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','fields','hasOwnProperty','addConfiguration','channel','Descriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','PhoneCall','title','description','customerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridtype','customeridyominame','entityimage_timestamp','escalatedon','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','owneridtype','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x51e028,_0x5dd04a){_0x51e028=_0x51e028-0x0;var _0x1b72fa=_0x8ef6[_0x51e028];return _0x1b72fa;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];var integrations=require(_0x68ef('0x1b'));function respondWithStatusCode(_0x454ef4,_0x40f253){_0x40f253=_0x40f253||0xcc;return function(_0x288cc9){if(_0x288cc9){return _0x454ef4['sendStatus'](_0x40f253);}return _0x454ef4[_0x68ef('0x1c')](_0x40f253)[_0x68ef('0x1d')]();};}function respondWithResult(_0x2657c5,_0x47fbb5){_0x47fbb5=_0x47fbb5||0xc8;return function(_0x22fe96){if(_0x22fe96){return _0x2657c5[_0x68ef('0x1c')](_0x47fbb5)[_0x68ef('0x1e')](_0x22fe96);}};}function respondWithFilteredResult(_0x5005ba,_0x35493d){return function(_0x37c4cc){if(_0x37c4cc){var _0x3d1e90=typeof _0x35493d[_0x68ef('0x1f')]==='undefined'&&typeof _0x35493d[_0x68ef('0x20')]==='undefined';var _0x5cbb78=_0x37c4cc[_0x68ef('0x21')];var _0x404870=_0x3d1e90?0x0:_0x35493d['offset'];var _0x527870=_0x3d1e90?_0x37c4cc[_0x68ef('0x21')]:_0x35493d[_0x68ef('0x1f')]+_0x35493d[_0x68ef('0x20')];var _0x4fad1c;if(_0x527870>=_0x5cbb78){_0x527870=_0x5cbb78;_0x4fad1c=0xc8;}else{_0x4fad1c=0xce;}_0x5005ba[_0x68ef('0x1c')](_0x4fad1c);return _0x5005ba[_0x68ef('0x22')](_0x68ef('0x23'),_0x404870+'-'+_0x527870+'/'+_0x5cbb78)['json'](_0x37c4cc);}return null;};}function patchUpdates(_0x3c46d4){return function(_0x3be4c0){try{jsonpatch['apply'](_0x3be4c0,_0x3c46d4,!![]);}catch(_0x399da4){return BPromise[_0x68ef('0x24')](_0x399da4);}return _0x3be4c0[_0x68ef('0x25')]();};}function saveUpdates(_0x5ddec7,_0x59723c){return function(_0x59bebc){if(_0x59bebc){return _0x59bebc[_0x68ef('0x26')](_0x5ddec7)[_0x68ef('0x27')](function(_0x312cc9){return _0x312cc9;});}return null;};}function removeEntity(_0x2e6e39,_0x438b4c){return function(_0xfe2595){if(_0xfe2595){return _0xfe2595[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){_0x2e6e39[_0x68ef('0x1c')](0xcc)[_0x68ef('0x1d')]();});}};}function handleEntityNotFound(_0x5e4dbe,_0x178460){return function(_0x57f9ee){if(!_0x57f9ee){_0x5e4dbe['sendStatus'](0x194);}return _0x57f9ee;};}function handleError(_0x55d8b0,_0x1a7ce1){_0x1a7ce1=_0x1a7ce1||0x1f4;return function(_0x268f32){logger[_0x68ef('0x29')](_0x268f32[_0x68ef('0x2a')]);if(_0x268f32['name']){delete _0x268f32['name'];}_0x55d8b0[_0x68ef('0x1c')](_0x1a7ce1)[_0x68ef('0x2b')](_0x268f32);};}exports[_0x68ef('0x2c')]=function(_0x263b30,_0x22ef25){var _0x201884={},_0x26288a={},_0x4579cb={'count':0x0,'rows':[]};var _0x5a6dfd=_[_0x68ef('0x2d')](db[_0x68ef('0x2e')][_0x68ef('0x2f')],function(_0x4c25aa){return{'name':_0x4c25aa[_0x68ef('0x30')],'type':_0x4c25aa['type'][_0x68ef('0x31')]};});_0x26288a[_0x68ef('0x32')]=_['map'](_0x5a6dfd,'name');_0x26288a[_0x68ef('0x33')]=_[_0x68ef('0x34')](_0x263b30['query']);_0x26288a[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x26288a[_0x68ef('0x32')],_0x26288a[_0x68ef('0x33')]);_0x201884['attributes']=_[_0x68ef('0x36')](_0x26288a[_0x68ef('0x32')],qs['fields'](_0x263b30[_0x68ef('0x33')]['fields']));_0x201884[_0x68ef('0x37')]=_0x201884[_0x68ef('0x37')]['length']?_0x201884[_0x68ef('0x37')]:_0x26288a['model'];if(!_0x263b30[_0x68ef('0x33')]['hasOwnProperty'](_0x68ef('0x38'))){_0x201884[_0x68ef('0x20')]=qs[_0x68ef('0x20')](_0x263b30['query'][_0x68ef('0x20')]);_0x201884['offset']=qs[_0x68ef('0x1f')](_0x263b30['query'][_0x68ef('0x1f')]);}_0x201884[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x263b30[_0x68ef('0x33')][_0x68ef('0x3a')]);_0x201884[_0x68ef('0x3b')]=qs['filters'](_[_0x68ef('0x3c')](_0x263b30[_0x68ef('0x33')],_0x26288a[_0x68ef('0x35')]),_0x5a6dfd);if(_0x263b30['query'][_0x68ef('0x3d')]){_0x201884[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x201884['where'],{'$or':_['map'](_0x5a6dfd,function(_0x14f0fc){if(_0x14f0fc[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x42fc8c={};_0x42fc8c[_0x14f0fc[_0x68ef('0x41')]]={'$like':'%'+_0x263b30[_0x68ef('0x33')][_0x68ef('0x3d')]+'%'};return _0x42fc8c;}})});}_0x201884=_['merge']({},_0x201884,_0x263b30[_0x68ef('0x42')]);var _0xd7f9ca={'where':_0x201884[_0x68ef('0x3b')]};return db[_0x68ef('0x2e')]['count'](_0xd7f9ca)[_0x68ef('0x27')](function(_0x3a2f53){_0x4579cb[_0x68ef('0x21')]=_0x3a2f53;if(_0x263b30[_0x68ef('0x33')][_0x68ef('0x43')]){_0x201884[_0x68ef('0x44')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x68ef('0x45')](_0x201884);})[_0x68ef('0x27')](function(_0xf5010c){_0x4579cb[_0x68ef('0x46')]=_0xf5010c;return _0x4579cb;})[_0x68ef('0x27')](respondWithFilteredResult(_0x22ef25,_0x201884))[_0x68ef('0x47')](handleError(_0x22ef25,null));};exports[_0x68ef('0x48')]=function(_0xd6a0b5,_0xc687ab){var _0x531096={'raw':![],'where':{'id':_0xd6a0b5[_0x68ef('0x49')]['id']}},_0xad1a28={};_0xad1a28[_0x68ef('0x32')]=_[_0x68ef('0x34')](db[_0x68ef('0x2e')][_0x68ef('0x2f')]);_0xad1a28[_0x68ef('0x33')]=_['keys'](_0xd6a0b5[_0x68ef('0x33')]);_0xad1a28['filters']=_[_0x68ef('0x36')](_0xad1a28[_0x68ef('0x32')],_0xad1a28[_0x68ef('0x33')]);_0x531096[_0x68ef('0x37')]=_['intersection'](_0xad1a28[_0x68ef('0x32')],qs['fields'](_0xd6a0b5[_0x68ef('0x33')]['fields']));_0x531096[_0x68ef('0x37')]=_0x531096[_0x68ef('0x37')][_0x68ef('0x4a')]?_0x531096['attributes']:_0xad1a28['model'];if(_0xd6a0b5[_0x68ef('0x33')][_0x68ef('0x43')]){_0x531096['include']=[{'all':!![]}];}_0x531096=_['merge']({},_0x531096,_0xd6a0b5['options']);return db[_0x68ef('0x2e')][_0x68ef('0x4b')](_0x531096)[_0x68ef('0x27')](handleEntityNotFound(_0xc687ab,null))[_0x68ef('0x27')](respondWithResult(_0xc687ab,null))[_0x68ef('0x47')](handleError(_0xc687ab,null));};exports['create']=function(_0x55f385,_0xc39f5b){return db[_0x68ef('0x2e')][_0x68ef('0x4c')](_0x55f385[_0x68ef('0x4d')],{})['then'](respondWithResult(_0xc39f5b,0xc9))[_0x68ef('0x47')](handleError(_0xc39f5b,null));};exports[_0x68ef('0x26')]=function(_0x1c9b6f,_0x14142a){if(_0x1c9b6f['body']['id']){delete _0x1c9b6f['body']['id'];}return db[_0x68ef('0x2e')][_0x68ef('0x4b')]({'where':{'id':_0x1c9b6f['params']['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x14142a,null))[_0x68ef('0x27')](saveUpdates(_0x1c9b6f[_0x68ef('0x4d')],null))[_0x68ef('0x27')](respondWithResult(_0x14142a,null))[_0x68ef('0x47')](handleError(_0x14142a,null));};exports['destroy']=function(_0x35d6bd,_0x3984ca){return db[_0x68ef('0x2e')]['find']({'where':{'id':_0x35d6bd[_0x68ef('0x49')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x3984ca,null))[_0x68ef('0x27')](removeEntity(_0x3984ca,null))['catch'](handleError(_0x3984ca,null));};exports[_0x68ef('0x4e')]=function(_0x59e8ee,_0x574573,_0x1ccbe7){var _0x588072={};var _0x39dd21={};var _0xb33afd;var _0x53ebd;return db[_0x68ef('0x2e')][_0x68ef('0x4f')]({'where':{'id':_0x59e8ee[_0x68ef('0x49')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x574573,null))[_0x68ef('0x27')](function(_0x2b35f4){if(_0x2b35f4){_0xb33afd=_0x2b35f4;_0x39dd21[_0x68ef('0x32')]=_['keys'](db['Dynamics365Configuration'][_0x68ef('0x2f')]);_0x39dd21[_0x68ef('0x33')]=_[_0x68ef('0x34')](_0x59e8ee[_0x68ef('0x33')]);_0x39dd21[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x39dd21[_0x68ef('0x32')],_0x39dd21[_0x68ef('0x33')]);_0x588072[_0x68ef('0x37')]=_['intersection'](_0x39dd21['model'],qs[_0x68ef('0x50')](_0x59e8ee['query'][_0x68ef('0x50')]));_0x588072['attributes']=_0x588072[_0x68ef('0x37')][_0x68ef('0x4a')]?_0x588072['attributes']:_0x39dd21[_0x68ef('0x32')];_0x588072['order']=qs[_0x68ef('0x3a')](_0x59e8ee[_0x68ef('0x33')][_0x68ef('0x3a')]);_0x588072[_0x68ef('0x3b')]=qs[_0x68ef('0x35')](_[_0x68ef('0x3c')](_0x59e8ee['query'],_0x39dd21[_0x68ef('0x35')]));if(_0x59e8ee[_0x68ef('0x33')][_0x68ef('0x3d')]){_0x588072[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x588072[_0x68ef('0x3b')],{'$or':_['map'](_0x588072[_0x68ef('0x37')],function(_0x42d2a3){var _0x4886af={};_0x4886af[_0x42d2a3]={'$like':'%'+_0x59e8ee[_0x68ef('0x33')][_0x68ef('0x3d')]+'%'};return _0x4886af;})});}_0x588072=_[_0x68ef('0x3e')]({},_0x588072,_0x59e8ee['options']);return _0xb33afd[_0x68ef('0x4e')](_0x588072);}})['then'](function(_0x5412ea){if(_0x5412ea){_0x53ebd=_0x5412ea[_0x68ef('0x4a')];if(!_0x59e8ee['query'][_0x68ef('0x51')]('nolimit')){_0x588072[_0x68ef('0x20')]=qs[_0x68ef('0x20')](_0x59e8ee[_0x68ef('0x33')][_0x68ef('0x20')]);_0x588072[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x59e8ee['query'][_0x68ef('0x1f')]);}return _0xb33afd['getConfigurations'](_0x588072);}})[_0x68ef('0x27')](function(_0x4b0c3e){if(_0x4b0c3e){return _0x4b0c3e?{'count':_0x53ebd,'rows':_0x4b0c3e}:null;}})[_0x68ef('0x27')](respondWithResult(_0x574573,null))[_0x68ef('0x47')](handleError(_0x574573,null));};exports[_0x68ef('0x52')]=function(_0xf0a40f,_0x2f409c,_0x44d773){if(_0xf0a40f[_0x68ef('0x4d')]['id']){delete _0xf0a40f['body']['id'];}return db[_0x68ef('0x2e')][_0x68ef('0x4f')]({'where':{'id':_0xf0a40f[_0x68ef('0x49')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x2f409c,null))[_0x68ef('0x27')](function(_0x4ff8a6){if(_0x4ff8a6){_0xf0a40f[_0x68ef('0x4d')]['AccountId']=_0x4ff8a6['id'];_0xf0a40f[_0x68ef('0x4d')]['Subjects']=integrations['getSubjects'](_0xf0a40f[_0x68ef('0x4d')][_0x68ef('0x53')],_0xf0a40f[_0x68ef('0x4d')][_0x68ef('0x3f')]);_0xf0a40f['body'][_0x68ef('0x54')]=integrations['getDescriptions'](_0xf0a40f[_0x68ef('0x4d')][_0x68ef('0x53')],_0xf0a40f[_0x68ef('0x4d')]['type']);return db['Dynamics365Configuration'][_0x68ef('0x4c')](_0xf0a40f[_0x68ef('0x4d')],{'include':[{'model':db[_0x68ef('0x55')],'as':_0x68ef('0x56')},{'model':db['Dynamics365Field'],'as':_0x68ef('0x54')}]});}return null;})[_0x68ef('0x27')](respondWithResult(_0x2f409c,null))[_0x68ef('0x47')](handleError(_0x2f409c,null));};exports[_0x68ef('0x57')]=function(_0x5089b3,_0x3f56a7,_0x53a601){var _0x10c546=_0x5089b3[_0x68ef('0x33')][_0x68ef('0x58')];var _0x3193c8=_0x10c546===_0x68ef('0x59')?'Incident':_0x68ef('0x5a');var _0x2caed7='';var _0x147695='';var _0x595e79='';var _0x1001ed='';var _0x4de108='';var _0x69b1c='';var _0x535f65='';var _0x4c70c0='';var _0x100345=[_0x68ef('0x5b'),_0x68ef('0x5c'),_0x68ef('0x5d'),'ownerid',_0x68ef('0x5e'),_0x68ef('0x5f'),_0x68ef('0x60'),'regardingobjectid',_0x68ef('0x61'),_0x68ef('0x62')];var _0xea2a81=[_0x68ef('0x63'),_0x68ef('0x64'),_0x68ef('0x65'),_0x68ef('0x66'),_0x68ef('0x67'),_0x68ef('0x68'),_0x68ef('0x69'),_0x68ef('0x6a'),_0x68ef('0x6b'),'createdbyexternalpartyyominame',_0x68ef('0x6c'),_0x68ef('0x6d'),'createdon','createdonbehalfbyname',_0x68ef('0x6e'),'customeridname',_0x68ef('0x6f'),_0x68ef('0x70'),'emailaddress','entitlementidname',_0x68ef('0x71'),'entityimage_url',_0x68ef('0x72'),'exchangerate',_0x68ef('0x73'),'followupby',_0x68ef('0x74'),_0x68ef('0x75'),'kbarticleidname',_0x68ef('0x76'),_0x68ef('0x77'),_0x68ef('0x78'),_0x68ef('0x79'),'modifiedbyname',_0x68ef('0x7a'),_0x68ef('0x7b'),'modifiedonbehalfbyname',_0x68ef('0x7c'),_0x68ef('0x7d'),_0x68ef('0x7e'),'numberofchildincidents',_0x68ef('0x7f'),'overriddencreatedon',_0x68ef('0x80'),_0x68ef('0x81'),'owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame',_0x68ef('0x82'),_0x68ef('0x83'),_0x68ef('0x84'),_0x68ef('0x85'),_0x68ef('0x86'),_0x68ef('0x87'),_0x68ef('0x88'),_0x68ef('0x89'),_0x68ef('0x8a'),_0x68ef('0x8b'),_0x68ef('0x8c'),_0x68ef('0x8d'),_0x68ef('0x8e'),'statuscode',_0x68ef('0x8f'),'ticketnumber',_0x68ef('0x90'),'transactioncurrencyidname','traversedpath',_0x68ef('0x91'),_0x68ef('0x92')];var _0x2c72f2=_0x100345[_0x68ef('0x93')](_0xea2a81);return db['Dynamics365Account']['findOne']({'where':{'id':_0x5089b3[_0x68ef('0x49')]['id']},'attributes':['id',_0x68ef('0x94'),_0x68ef('0x95'),'remoteUri',_0x68ef('0x96'),_0x68ef('0x97'),_0x68ef('0x98')]})[_0x68ef('0x27')](handleEntityNotFound(_0x3f56a7,null))['then'](function(_0x214e89){if(_0x214e89){_0x4c70c0=_0x214e89[_0x68ef('0x99')];var _0x31550b=_0x4c70c0[_0x68ef('0x9a')](-0x1);if(_0x31550b==='/'){_0x4c70c0=_0x4c70c0[_0x68ef('0x9b')](0x0,_0x4c70c0[_0x68ef('0x9c')](_0x31550b));}_0x535f65=util['format'](_0x68ef('0x9d'),_0x4c70c0);var _0x49844f={'method':_0x68ef('0x9e'),'uri':_0x68ef('0x9f')+_0x214e89[_0x68ef('0x96')]+_0x68ef('0xa0'),'form':{'client_id':_0x214e89['clientId'],'resource':_0x4c70c0,'username':_0x214e89[_0x68ef('0x94')],'password':_0x214e89['password'],'grant_type':_0x68ef('0x95'),'client_secret':_0x214e89[_0x68ef('0x98')]},'json':!![]};return rp(_0x49844f);}})['then'](function(_0x55486a){_0x69b1c=_0x55486a[_0x68ef('0xa1')];var _0x4c40ea={'method':_0x68ef('0xa2'),'uri':encodeURI(_0x535f65+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3193c8+'\x27'),'headers':{'Authorization':_0x68ef('0xa3')+_0x69b1c,'If-None-Match':null,'OData-Version':_0x68ef('0xa4')},'json':!![]};return rp(_0x4c40ea);})[_0x68ef('0x27')](function(_0x1cc776){var _0x30eb96=_0x1cc776[_0x68ef('0xa5')][0x0];var _0x51b8db=_0x30eb96[_0x68ef('0xa6')];var _0x463356={'method':_0x68ef('0xa2'),'uri':_0x535f65+_0x68ef('0xa7')+_0x51b8db+_0x68ef('0xa8'),'headers':{'Authorization':_0x68ef('0xa3')+_0x69b1c,'If-None-Match':null,'OData-Version':_0x68ef('0xa4')},'json':!![]};return rp(_0x463356);})['then'](function(_0x295c0f){_0x2caed7=_0x295c0f;_0x147695=_0x2caed7[_0x68ef('0xa9')];_0x147695=_[_0x68ef('0xaa')](_0x147695,function(_0x2e20aa){return!_0x2c72f2[_0x68ef('0xab')](_0x2e20aa[_0x68ef('0xac')]);});var _0x3e0d3d=[];var _0x4478de=[];_0x147695[_0x68ef('0xad')](function(_0x580fe0){if(_0x580fe0[_0x68ef('0xae')]){var _0x530ae0=_0x580fe0['@odata.type']['substring'](_0x580fe0[_0x68ef('0xae')][_0x68ef('0x9c')]('.')+0x1);if(_0x530ae0===_0x68ef('0xaf')){_0x3e0d3d['push'](getSelectList(_0x535f65,_0x10c546,_0x4478de,_0x2caed7['MetadataId'],_0x580fe0['MetadataId'],_0x69b1c));}}});return Promise[_0x68ef('0xb0')](_0x3e0d3d);})[_0x68ef('0x27')](function(_0x239d05){_0x595e79=_0x239d05[0x0];var _0x40996e=[];var _0x29011d=[];_0x147695[_0x68ef('0xad')](function(_0x5546a2){if(!_[_0x68ef('0xb1')](_0x5546a2[_0x68ef('0xae')])){var _0x1bdacc=_0x5546a2[_0x68ef('0xae')]['substring'](_0x5546a2[_0x68ef('0xae')][_0x68ef('0x9c')]('.')+0x1);if(_0x1bdacc===_0x68ef('0xb2')){_0x40996e[_0x68ef('0xb3')](getBooleanList(_0x535f65,_0x10c546,_0x29011d,_0x2caed7[_0x68ef('0xa6')],_0x5546a2[_0x68ef('0xa6')],_0x69b1c));}}});return Promise[_0x68ef('0xb0')](_0x40996e);})[_0x68ef('0x27')](function(_0x4cdc78){_0x1001ed=_0x4cdc78[0x0];var _0x16dbaf=[];var _0x210ba6=[];_0x147695['forEach'](function(_0xdaed94){if(_0xdaed94[_0x68ef('0xae')]){var _0x1b9028=_0xdaed94[_0x68ef('0xae')][_0x68ef('0x9b')](_0xdaed94[_0x68ef('0xae')][_0x68ef('0x9c')]('.')+0x1);if(_0x1b9028===_0x68ef('0xb4')||_0x1b9028===_0x68ef('0xb5')||_0x1b9028===_0x68ef('0xb6')||_0x1b9028===_0x68ef('0xb7')||_0x1b9028===_0x68ef('0xb8')||_0x1b9028===_0x68ef('0xb9')||_0x1b9028===_0x68ef('0xba')||_0x1b9028===_0x68ef('0xbb')||_0x1b9028===_0x68ef('0xbc')||_0x1b9028===_0x68ef('0xbd')){_0x16dbaf[_0x68ef('0xb3')](getInputList(_0x535f65,_0x10c546,_0x1b9028,_0x210ba6,_0x2caed7['MetadataId'],_0xdaed94[_0x68ef('0xa6')],_0x69b1c));}}});return Promise[_0x68ef('0xb0')](_0x16dbaf);})[_0x68ef('0x27')](function(_0x80e777){_0x4de108=_0x80e777[0x0];var _0x254e6a=_0x595e79['concat'](_0x1001ed)[_0x68ef('0x93')](_0x4de108);var _0xfb4a5c={'count':_0x254e6a['length'],'rows':_0x254e6a};return _0xfb4a5c;})[_0x68ef('0x27')](respondWithResult(_0x3f56a7,null))['catch'](function(_0x5826b6){var _0x5a6148=_0x5089b3['query'][_0x68ef('0xbe')]?0x1f4:_0x5826b6['statusCode']||0x1f4;logger[_0x68ef('0x29')](_0x5826b6['stack']);delete _0x5826b6['name'];if(_0x5a6148===0x191){_0x5a6148=0x190;}_0x3f56a7['status'](_0x5a6148)[_0x68ef('0x2b')](_0x5089b3[_0x68ef('0x33')][_0x68ef('0xbe')]?{'message':_0x68ef('0xbf'),'statusCode':_0x5826b6[_0x68ef('0xc0')]}:_0x5826b6);});};function getSelectList(_0x510bc6,_0x33786d,_0x263da0,_0x2fcfbe,_0x78f4f8,_0x5be69b){var _0x18d2a3={'method':'GET','uri':_0x510bc6+'EntityDefinitions('+_0x2fcfbe+')/Attributes('+_0x78f4f8+_0x68ef('0xc1')+_0x68ef('0xc2'),'headers':{'Authorization':_0x68ef('0xa3')+_0x5be69b,'If-None-Match':null,'OData-Version':_0x68ef('0xa4')},'json':!![]};return rp(_0x18d2a3)[_0x68ef('0x27')](function(_0x167812){var _0x4522f3=[];var _0x4631a7=_0x167812[_0x68ef('0xc3')][_0x68ef('0xc4')];_0x4631a7[_0x68ef('0xad')](function(_0x2ab485){_0x4522f3['push']({'name':_0x2ab485['Label']['UserLocalizedLabel'][_0x68ef('0xc5')],'value':String(_0x2ab485[_0x68ef('0xc6')])});});var _0x4629ac={'id':_0x33786d+'_'+_0x167812['LogicalName'],'name':_0x167812[_0x68ef('0xc7')]['UserLocalizedLabel'][_0x68ef('0xc5')],'custom':![],'options':_0x4522f3};_0x263da0[_0x68ef('0xb3')](_0x4629ac);return _0x263da0;});}function getBooleanList(_0x635aa4,_0x55f7f1,_0x304260,_0x1730d4,_0x546b0d,_0x3f0d93){var _0x1b9bfc={'method':_0x68ef('0xa2'),'uri':_0x635aa4+_0x68ef('0xa7')+_0x1730d4+_0x68ef('0xc8')+_0x546b0d+_0x68ef('0xc9'),'headers':{'Authorization':_0x68ef('0xa3')+_0x3f0d93,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1b9bfc)[_0x68ef('0x27')](function(_0x26121d){var _0x5a262d=[];_0x5a262d[_0x68ef('0xb3')]({'name':_0x26121d[_0x68ef('0xc3')][_0x68ef('0xca')][_0x68ef('0xc5')][_0x68ef('0xcb')][_0x68ef('0xc5')],'value':_0x68ef('0xcc')},{'name':_0x26121d['OptionSet']['FalseOption'][_0x68ef('0xc5')]['UserLocalizedLabel'][_0x68ef('0xc5')],'value':_0x68ef('0xcd')});var _0xc4570c={'id':_0x55f7f1+'_'+_0x26121d[_0x68ef('0xac')],'name':_0x26121d[_0x68ef('0xc7')]['UserLocalizedLabel'][_0x68ef('0xc5')],'custom':![],'options':_0x5a262d};_0x304260[_0x68ef('0xb3')](_0xc4570c);return _0x304260;});}function getInputList(_0x1910d2,_0x3c862a,_0x5129e9,_0x574609,_0x2ff3d2,_0x1ed249,_0x50665f){var _0x36efc0={'method':_0x68ef('0xa2'),'uri':_0x1910d2+_0x68ef('0xa7')+_0x2ff3d2+_0x68ef('0xc8')+_0x1ed249+_0x68ef('0xce')+_0x5129e9+_0x68ef('0xcf'),'headers':{'Authorization':_0x68ef('0xa3')+_0x50665f,'If-None-Match':null,'OData-Version':_0x68ef('0xa4')},'json':!![]};return rp(_0x36efc0)['then'](function(_0x26b626){var _0x2b9d42={'id':_0x3c862a+'_'+_0x26b626[_0x68ef('0xac')],'name':_0x26b626[_0x68ef('0xc7')][_0x68ef('0xcb')]?_0x26b626[_0x68ef('0xc7')][_0x68ef('0xcb')][_0x68ef('0xc5')]:_0x26b626[_0x68ef('0xac')],'custom':![],'options':[]};_0x574609[_0x68ef('0xb3')](_0x2b9d42);return _0x574609;});} \ No newline at end of file +var _0x35aa=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','length','find','create','body','update','destroy','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getDescriptions','channel','Dynamics365Field','Descriptions','ticketType','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyname','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','entitlementidname','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','responseby','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x243688,_0x14a6f6){var _0x3ebb09=function(_0x1032e9){while(--_0x1032e9){_0x243688['push'](_0x243688['shift']());}};_0x3ebb09(++_0x14a6f6);}(_0x35aa,0xbe));var _0xa35a=function(_0x344073,_0x443928){_0x344073=_0x344073-0x0;var _0x22aa0d=_0x35aa[_0x344073];return _0x22aa0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa35a('0x0'));var zipdir=require(_0xa35a('0x1'));var jsonpatch=require(_0xa35a('0x2'));var rp=require(_0xa35a('0x3'));var moment=require('moment');var BPromise=require(_0xa35a('0x4'));var Mustache=require(_0xa35a('0x5'));var util=require(_0xa35a('0x6'));var path=require(_0xa35a('0x7'));var sox=require(_0xa35a('0x8'));var csv=require(_0xa35a('0x9'));var ejs=require(_0xa35a('0xa'));var fs=require('fs');var fs_extra=require(_0xa35a('0xb'));var _=require('lodash');var squel=require(_0xa35a('0xc'));var crypto=require('crypto');var jsforce=require(_0xa35a('0xd'));var deskjs=require(_0xa35a('0xe'));var toCsv=require(_0xa35a('0x9'));var querystring=require(_0xa35a('0xf'));var Papa=require(_0xa35a('0x10'));var Redis=require(_0xa35a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa35a('0x12'));var as=require(_0xa35a('0x13'));var hardwareService=require(_0xa35a('0x14'));var logger=require(_0xa35a('0x15'))('api');var utils=require(_0xa35a('0x16'));var config=require(_0xa35a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa35a('0x18'))['db'];var integrations=require(_0xa35a('0x19'));function respondWithStatusCode(_0x21709c,_0xcaa467){_0xcaa467=_0xcaa467||0xcc;return function(_0x105d00){if(_0x105d00){return _0x21709c[_0xa35a('0x1a')](_0xcaa467);}return _0x21709c['status'](_0xcaa467)['end']();};}function respondWithResult(_0x2dfa94,_0x4a4e06){_0x4a4e06=_0x4a4e06||0xc8;return function(_0x252b95){if(_0x252b95){return _0x2dfa94[_0xa35a('0x1b')](_0x4a4e06)['json'](_0x252b95);}};}function respondWithFilteredResult(_0x3f04b1,_0x121a06){return function(_0x5557da){if(_0x5557da){var _0x5cf7a6=typeof _0x121a06[_0xa35a('0x1c')]===_0xa35a('0x1d')&&typeof _0x121a06[_0xa35a('0x1e')]===_0xa35a('0x1d');var _0xedcf90=_0x5557da[_0xa35a('0x1f')];var _0x474cbd=_0x5cf7a6?0x0:_0x121a06[_0xa35a('0x1c')];var _0xdfc2=_0x5cf7a6?_0x5557da[_0xa35a('0x1f')]:_0x121a06[_0xa35a('0x1c')]+_0x121a06[_0xa35a('0x1e')];var _0x3af888;if(_0xdfc2>=_0xedcf90){_0xdfc2=_0xedcf90;_0x3af888=0xc8;}else{_0x3af888=0xce;}_0x3f04b1[_0xa35a('0x1b')](_0x3af888);return _0x3f04b1[_0xa35a('0x20')](_0xa35a('0x21'),_0x474cbd+'-'+_0xdfc2+'/'+_0xedcf90)[_0xa35a('0x22')](_0x5557da);}return null;};}function patchUpdates(_0xbb6da8){return function(_0x363167){try{jsonpatch[_0xa35a('0x23')](_0x363167,_0xbb6da8,!![]);}catch(_0x546c22){return BPromise[_0xa35a('0x24')](_0x546c22);}return _0x363167[_0xa35a('0x25')]();};}function saveUpdates(_0x5269e9,_0x569836){return function(_0x1f10ec){if(_0x1f10ec){return _0x1f10ec['update'](_0x5269e9)[_0xa35a('0x26')](function(_0x5a36f9){return _0x5a36f9;});}return null;};}function removeEntity(_0x302592,_0x31610f){return function(_0x454e45){if(_0x454e45){return _0x454e45['destroy']()[_0xa35a('0x26')](function(){_0x302592[_0xa35a('0x1b')](0xcc)[_0xa35a('0x27')]();});}};}function handleEntityNotFound(_0x103bb2,_0x4d4755){return function(_0x59ec78){if(!_0x59ec78){_0x103bb2[_0xa35a('0x1a')](0x194);}return _0x59ec78;};}function handleError(_0x15f617,_0x1d3381){_0x1d3381=_0x1d3381||0x1f4;return function(_0x41edd6){logger[_0xa35a('0x28')](_0x41edd6[_0xa35a('0x29')]);if(_0x41edd6[_0xa35a('0x2a')]){delete _0x41edd6['name'];}_0x15f617[_0xa35a('0x1b')](_0x1d3381)[_0xa35a('0x2b')](_0x41edd6);};}exports[_0xa35a('0x2c')]=function(_0x3e8a68,_0x47dd9a){var _0x539d67={},_0xb779b7={},_0x3e3746={'count':0x0,'rows':[]};var _0x2d4c96=_[_0xa35a('0x2d')](db[_0xa35a('0x2e')][_0xa35a('0x2f')],function(_0x59c1a4){return{'name':_0x59c1a4[_0xa35a('0x30')],'type':_0x59c1a4[_0xa35a('0x31')][_0xa35a('0x32')]};});_0xb779b7['model']=_[_0xa35a('0x2d')](_0x2d4c96,_0xa35a('0x2a'));_0xb779b7[_0xa35a('0x33')]=_['keys'](_0x3e8a68[_0xa35a('0x33')]);_0xb779b7[_0xa35a('0x34')]=_[_0xa35a('0x35')](_0xb779b7[_0xa35a('0x36')],_0xb779b7[_0xa35a('0x33')]);_0x539d67[_0xa35a('0x37')]=_[_0xa35a('0x35')](_0xb779b7[_0xa35a('0x36')],qs[_0xa35a('0x38')](_0x3e8a68[_0xa35a('0x33')][_0xa35a('0x38')]));_0x539d67['attributes']=_0x539d67[_0xa35a('0x37')]['length']?_0x539d67[_0xa35a('0x37')]:_0xb779b7[_0xa35a('0x36')];if(!_0x3e8a68[_0xa35a('0x33')][_0xa35a('0x39')](_0xa35a('0x3a'))){_0x539d67[_0xa35a('0x1e')]=qs['limit'](_0x3e8a68['query'][_0xa35a('0x1e')]);_0x539d67[_0xa35a('0x1c')]=qs[_0xa35a('0x1c')](_0x3e8a68[_0xa35a('0x33')][_0xa35a('0x1c')]);}_0x539d67[_0xa35a('0x3b')]=qs[_0xa35a('0x3c')](_0x3e8a68[_0xa35a('0x33')][_0xa35a('0x3c')]);_0x539d67[_0xa35a('0x3d')]=qs[_0xa35a('0x34')](_[_0xa35a('0x3e')](_0x3e8a68['query'],_0xb779b7['filters']),_0x2d4c96);if(_0x3e8a68[_0xa35a('0x33')][_0xa35a('0x3f')]){_0x539d67[_0xa35a('0x3d')]=_[_0xa35a('0x40')](_0x539d67[_0xa35a('0x3d')],{'$or':_[_0xa35a('0x2d')](_0x2d4c96,function(_0x550f66){if(_0x550f66[_0xa35a('0x31')]!==_0xa35a('0x41')){var _0x16a746={};_0x16a746[_0x550f66['name']]={'$like':'%'+_0x3e8a68[_0xa35a('0x33')][_0xa35a('0x3f')]+'%'};return _0x16a746;}})});}_0x539d67=_[_0xa35a('0x40')]({},_0x539d67,_0x3e8a68[_0xa35a('0x42')]);var _0x531a4f={'where':_0x539d67[_0xa35a('0x3d')]};return db[_0xa35a('0x2e')][_0xa35a('0x1f')](_0x531a4f)[_0xa35a('0x26')](function(_0x533b50){_0x3e3746['count']=_0x533b50;if(_0x3e8a68[_0xa35a('0x33')][_0xa35a('0x43')]){_0x539d67['include']=[{'all':!![]}];}return db[_0xa35a('0x2e')][_0xa35a('0x44')](_0x539d67);})[_0xa35a('0x26')](function(_0xa34728){_0x3e3746['rows']=_0xa34728;return _0x3e3746;})[_0xa35a('0x26')](respondWithFilteredResult(_0x47dd9a,_0x539d67))[_0xa35a('0x45')](handleError(_0x47dd9a,null));};exports[_0xa35a('0x46')]=function(_0x46945f,_0x131d49){var _0x319655={'raw':![],'where':{'id':_0x46945f[_0xa35a('0x47')]['id']}},_0x5cb8e6={};_0x5cb8e6[_0xa35a('0x36')]=_[_0xa35a('0x48')](db[_0xa35a('0x2e')][_0xa35a('0x2f')]);_0x5cb8e6[_0xa35a('0x33')]=_[_0xa35a('0x48')](_0x46945f['query']);_0x5cb8e6[_0xa35a('0x34')]=_['intersection'](_0x5cb8e6[_0xa35a('0x36')],_0x5cb8e6['query']);_0x319655['attributes']=_[_0xa35a('0x35')](_0x5cb8e6[_0xa35a('0x36')],qs[_0xa35a('0x38')](_0x46945f[_0xa35a('0x33')][_0xa35a('0x38')]));_0x319655[_0xa35a('0x37')]=_0x319655[_0xa35a('0x37')][_0xa35a('0x49')]?_0x319655[_0xa35a('0x37')]:_0x5cb8e6[_0xa35a('0x36')];if(_0x46945f[_0xa35a('0x33')][_0xa35a('0x43')]){_0x319655['include']=[{'all':!![]}];}_0x319655=_[_0xa35a('0x40')]({},_0x319655,_0x46945f[_0xa35a('0x42')]);return db[_0xa35a('0x2e')][_0xa35a('0x4a')](_0x319655)[_0xa35a('0x26')](handleEntityNotFound(_0x131d49,null))[_0xa35a('0x26')](respondWithResult(_0x131d49,null))[_0xa35a('0x45')](handleError(_0x131d49,null));};exports[_0xa35a('0x4b')]=function(_0x3f172d,_0x37a7a1){return db[_0xa35a('0x2e')][_0xa35a('0x4b')](_0x3f172d[_0xa35a('0x4c')],{})['then'](respondWithResult(_0x37a7a1,0xc9))['catch'](handleError(_0x37a7a1,null));};exports[_0xa35a('0x4d')]=function(_0xa12eaf,_0x54a7a2){if(_0xa12eaf[_0xa35a('0x4c')]['id']){delete _0xa12eaf[_0xa35a('0x4c')]['id'];}return db['Dynamics365Account'][_0xa35a('0x4a')]({'where':{'id':_0xa12eaf[_0xa35a('0x47')]['id']}})[_0xa35a('0x26')](handleEntityNotFound(_0x54a7a2,null))[_0xa35a('0x26')](saveUpdates(_0xa12eaf[_0xa35a('0x4c')],null))[_0xa35a('0x26')](respondWithResult(_0x54a7a2,null))[_0xa35a('0x45')](handleError(_0x54a7a2,null));};exports[_0xa35a('0x4e')]=function(_0x2b34f7,_0x41c8d8){return db['Dynamics365Account'][_0xa35a('0x4a')]({'where':{'id':_0x2b34f7['params']['id']}})['then'](handleEntityNotFound(_0x41c8d8,null))['then'](removeEntity(_0x41c8d8,null))[_0xa35a('0x45')](handleError(_0x41c8d8,null));};exports[_0xa35a('0x4f')]=function(_0x14cd85,_0x5af957,_0x1655a6){var _0x342da0={};var _0x329545={};var _0x186cf7;var _0xd58f2c;return db[_0xa35a('0x2e')][_0xa35a('0x50')]({'where':{'id':_0x14cd85['params']['id']}})[_0xa35a('0x26')](handleEntityNotFound(_0x5af957,null))['then'](function(_0x2a6989){if(_0x2a6989){_0x186cf7=_0x2a6989;_0x329545['model']=_[_0xa35a('0x48')](db[_0xa35a('0x51')][_0xa35a('0x2f')]);_0x329545[_0xa35a('0x33')]=_['keys'](_0x14cd85[_0xa35a('0x33')]);_0x329545['filters']=_[_0xa35a('0x35')](_0x329545['model'],_0x329545[_0xa35a('0x33')]);_0x342da0[_0xa35a('0x37')]=_[_0xa35a('0x35')](_0x329545['model'],qs[_0xa35a('0x38')](_0x14cd85['query'][_0xa35a('0x38')]));_0x342da0['attributes']=_0x342da0[_0xa35a('0x37')][_0xa35a('0x49')]?_0x342da0[_0xa35a('0x37')]:_0x329545[_0xa35a('0x36')];_0x342da0[_0xa35a('0x3b')]=qs[_0xa35a('0x3c')](_0x14cd85[_0xa35a('0x33')][_0xa35a('0x3c')]);_0x342da0[_0xa35a('0x3d')]=qs[_0xa35a('0x34')](_['pick'](_0x14cd85['query'],_0x329545[_0xa35a('0x34')]));if(_0x14cd85[_0xa35a('0x33')][_0xa35a('0x3f')]){_0x342da0[_0xa35a('0x3d')]=_['merge'](_0x342da0['where'],{'$or':_[_0xa35a('0x2d')](_0x342da0[_0xa35a('0x37')],function(_0x1d70f1){var _0x84ce84={};_0x84ce84[_0x1d70f1]={'$like':'%'+_0x14cd85[_0xa35a('0x33')][_0xa35a('0x3f')]+'%'};return _0x84ce84;})});}_0x342da0=_[_0xa35a('0x40')]({},_0x342da0,_0x14cd85[_0xa35a('0x42')]);return _0x186cf7[_0xa35a('0x4f')](_0x342da0);}})[_0xa35a('0x26')](function(_0x1f951d){if(_0x1f951d){_0xd58f2c=_0x1f951d['length'];if(!_0x14cd85[_0xa35a('0x33')][_0xa35a('0x39')]('nolimit')){_0x342da0[_0xa35a('0x1e')]=qs['limit'](_0x14cd85[_0xa35a('0x33')][_0xa35a('0x1e')]);_0x342da0['offset']=qs[_0xa35a('0x1c')](_0x14cd85[_0xa35a('0x33')]['offset']);}return _0x186cf7[_0xa35a('0x4f')](_0x342da0);}})[_0xa35a('0x26')](function(_0x27d2f8){if(_0x27d2f8){return _0x27d2f8?{'count':_0xd58f2c,'rows':_0x27d2f8}:null;}})[_0xa35a('0x26')](respondWithResult(_0x5af957,null))[_0xa35a('0x45')](handleError(_0x5af957,null));};exports[_0xa35a('0x52')]=function(_0x1432ba,_0x5b9660,_0x318711){if(_0x1432ba[_0xa35a('0x4c')]['id']){delete _0x1432ba[_0xa35a('0x4c')]['id'];}return db[_0xa35a('0x2e')][_0xa35a('0x50')]({'where':{'id':_0x1432ba[_0xa35a('0x47')]['id']}})[_0xa35a('0x26')](handleEntityNotFound(_0x5b9660,null))[_0xa35a('0x26')](function(_0x3f4fe5){if(_0x3f4fe5){_0x1432ba[_0xa35a('0x4c')][_0xa35a('0x53')]=_0x3f4fe5['id'];_0x1432ba['body'][_0xa35a('0x54')]=integrations['getSubjects'](_0x1432ba[_0xa35a('0x4c')]['channel'],_0x1432ba['body']['type']);_0x1432ba[_0xa35a('0x4c')]['Descriptions']=integrations[_0xa35a('0x55')](_0x1432ba['body'][_0xa35a('0x56')],_0x1432ba[_0xa35a('0x4c')]['type']);return db[_0xa35a('0x51')][_0xa35a('0x4b')](_0x1432ba[_0xa35a('0x4c')],{'include':[{'model':db[_0xa35a('0x57')],'as':_0xa35a('0x54')},{'model':db[_0xa35a('0x57')],'as':_0xa35a('0x58')}]});}return null;})['then'](respondWithResult(_0x5b9660,null))[_0xa35a('0x45')](handleError(_0x5b9660,null));};exports['getFields']=function(_0x4cb452,_0x3fa1a6,_0x2c48af){var _0x5390e5=_0x4cb452[_0xa35a('0x33')][_0xa35a('0x59')];var _0x29e3d4=_0x5390e5===_0xa35a('0x5a')?_0xa35a('0x5b'):_0xa35a('0x5c');var _0x249277='';var _0x2dea84='';var _0x69348e='';var _0xa6757b='';var _0xcaefb3='';var _0x3df7d9='';var _0x161cb7='';var _0x244409='';var _0x399ccd=[_0xa35a('0x5d'),_0xa35a('0x5e'),'customerid',_0xa35a('0x5f'),_0xa35a('0x60'),_0xa35a('0x61'),_0xa35a('0x62'),'regardingobjectid','directioncode',_0xa35a('0x63')];var _0x4c6c02=[_0xa35a('0x64'),_0xa35a('0x65'),_0xa35a('0x66'),_0xa35a('0x67'),_0xa35a('0x68'),_0xa35a('0x69'),_0xa35a('0x6a'),'contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame',_0xa35a('0x6b'),_0xa35a('0x6c'),'createdon','createdonbehalfbyname',_0xa35a('0x6d'),_0xa35a('0x6e'),_0xa35a('0x6f'),'customeridyominame','emailaddress',_0xa35a('0x70'),'entityimage_timestamp','entityimage_url',_0xa35a('0x71'),'exchangerate',_0xa35a('0x72'),_0xa35a('0x73'),_0xa35a('0x74'),_0xa35a('0x75'),_0xa35a('0x76'),_0xa35a('0x77'),_0xa35a('0x78'),_0xa35a('0x79'),'modifiedbyexternalpartyyominame',_0xa35a('0x7a'),'modifiedbyyominame',_0xa35a('0x7b'),_0xa35a('0x7c'),_0xa35a('0x7d'),_0xa35a('0x7e'),_0xa35a('0x7f'),_0xa35a('0x80'),_0xa35a('0x81'),_0xa35a('0x82'),_0xa35a('0x83'),_0xa35a('0x84'),_0xa35a('0x85'),_0xa35a('0x86'),_0xa35a('0x87'),_0xa35a('0x88'),_0xa35a('0x89'),'productidname',_0xa35a('0x8a'),'resolveby','resolvebykpiidname',_0xa35a('0x8b'),'responsiblecontactidname','responsiblecontactidyominame',_0xa35a('0x8c'),_0xa35a('0x8d'),_0xa35a('0x8e'),_0xa35a('0x8f'),_0xa35a('0x90'),_0xa35a('0x91'),'subjectidname',_0xa35a('0x92'),_0xa35a('0x93'),'transactioncurrencyidname','traversedpath','utcconversiontimezonecode',_0xa35a('0x94')];var _0x3f6e48=_0x399ccd[_0xa35a('0x95')](_0x4c6c02);return db[_0xa35a('0x2e')][_0xa35a('0x50')]({'where':{'id':_0x4cb452['params']['id']},'attributes':['id',_0xa35a('0x96'),_0xa35a('0x97'),_0xa35a('0x98'),_0xa35a('0x99'),_0xa35a('0x9a'),_0xa35a('0x9b')]})['then'](handleEntityNotFound(_0x3fa1a6,null))[_0xa35a('0x26')](function(_0x43208a){if(_0x43208a){_0x244409=_0x43208a['remoteUri'];var _0xeea38d=_0x244409[_0xa35a('0x9c')](-0x1);if(_0xeea38d==='/'){_0x244409=_0x244409[_0xa35a('0x9d')](0x0,_0x244409[_0xa35a('0x9e')](_0xeea38d));}_0x161cb7=util[_0xa35a('0x9f')](_0xa35a('0xa0'),_0x244409);var _0x487645={'method':_0xa35a('0xa1'),'uri':'https://login.microsoftonline.com/'+_0x43208a['tenantId']+_0xa35a('0xa2'),'form':{'client_id':_0x43208a['clientId'],'resource':_0x244409,'username':_0x43208a[_0xa35a('0x96')],'password':_0x43208a[_0xa35a('0x97')],'grant_type':_0xa35a('0x97'),'client_secret':_0x43208a[_0xa35a('0x9b')]},'json':!![]};return rp(_0x487645);}})[_0xa35a('0x26')](function(_0x3c5773){_0x3df7d9=_0x3c5773[_0xa35a('0xa3')];var _0xa1e0d0={'method':_0xa35a('0xa4'),'uri':encodeURI(_0x161cb7+_0xa35a('0xa5')+_0x29e3d4+'\x27'),'headers':{'Authorization':_0xa35a('0xa6')+_0x3df7d9,'If-None-Match':null,'OData-Version':_0xa35a('0xa7')},'json':!![]};return rp(_0xa1e0d0);})[_0xa35a('0x26')](function(_0x69e614){var _0x402a4e=_0x69e614[_0xa35a('0xa8')][0x0];var _0x2ad86a=_0x402a4e[_0xa35a('0xa9')];var _0x344cba={'method':_0xa35a('0xa4'),'uri':_0x161cb7+'EntityDefinitions('+_0x2ad86a+_0xa35a('0xaa'),'headers':{'Authorization':_0xa35a('0xa6')+_0x3df7d9,'If-None-Match':null,'OData-Version':_0xa35a('0xa7')},'json':!![]};return rp(_0x344cba);})[_0xa35a('0x26')](function(_0x226705){_0x249277=_0x226705;_0x2dea84=_0x249277[_0xa35a('0xab')];_0x2dea84=_['remove'](_0x2dea84,function(_0x4dd057){return!_0x3f6e48['includes'](_0x4dd057[_0xa35a('0xac')]);});var _0x43f53c=[];var _0xbccde9=[];_0x2dea84[_0xa35a('0xad')](function(_0x6b1bf0){if(_0x6b1bf0[_0xa35a('0xae')]){var _0x4599d0=_0x6b1bf0[_0xa35a('0xae')][_0xa35a('0x9d')](_0x6b1bf0[_0xa35a('0xae')]['lastIndexOf']('.')+0x1);if(_0x4599d0===_0xa35a('0xaf')){_0x43f53c[_0xa35a('0xb0')](getSelectList(_0x161cb7,_0x5390e5,_0xbccde9,_0x249277['MetadataId'],_0x6b1bf0['MetadataId'],_0x3df7d9));}}});return Promise[_0xa35a('0xb1')](_0x43f53c);})[_0xa35a('0x26')](function(_0x2a386f){_0x69348e=_0x2a386f[0x0];var _0x20d629=[];var _0x3a1e44=[];_0x2dea84[_0xa35a('0xad')](function(_0x352e26){if(!_[_0xa35a('0xb2')](_0x352e26[_0xa35a('0xae')])){var _0x130b74=_0x352e26[_0xa35a('0xae')][_0xa35a('0x9d')](_0x352e26[_0xa35a('0xae')][_0xa35a('0x9e')]('.')+0x1);if(_0x130b74===_0xa35a('0xb3')){_0x20d629[_0xa35a('0xb0')](getBooleanList(_0x161cb7,_0x5390e5,_0x3a1e44,_0x249277['MetadataId'],_0x352e26[_0xa35a('0xa9')],_0x3df7d9));}}});return Promise[_0xa35a('0xb1')](_0x20d629);})[_0xa35a('0x26')](function(_0x568c96){_0xa6757b=_0x568c96[0x0];var _0x269385=[];var _0x2881ae=[];_0x2dea84['forEach'](function(_0x5e806e){if(_0x5e806e[_0xa35a('0xae')]){var _0x376862=_0x5e806e['@odata.type']['substring'](_0x5e806e[_0xa35a('0xae')][_0xa35a('0x9e')]('.')+0x1);if(_0x376862===_0xa35a('0xb4')||_0x376862===_0xa35a('0xb5')||_0x376862===_0xa35a('0xb6')||_0x376862===_0xa35a('0xb7')||_0x376862===_0xa35a('0xb8')||_0x376862===_0xa35a('0xb9')||_0x376862===_0xa35a('0xba')||_0x376862===_0xa35a('0xbb')||_0x376862===_0xa35a('0xbc')||_0x376862==='DecimalAttributeMetadata'){_0x269385[_0xa35a('0xb0')](getInputList(_0x161cb7,_0x5390e5,_0x376862,_0x2881ae,_0x249277[_0xa35a('0xa9')],_0x5e806e['MetadataId'],_0x3df7d9));}}});return Promise[_0xa35a('0xb1')](_0x269385);})[_0xa35a('0x26')](function(_0x17b57b){_0xcaefb3=_0x17b57b[0x0];var _0x2af2a9=_0x69348e[_0xa35a('0x95')](_0xa6757b)['concat'](_0xcaefb3);var _0xf4df36={'count':_0x2af2a9[_0xa35a('0x49')],'rows':_0x2af2a9};return _0xf4df36;})[_0xa35a('0x26')](respondWithResult(_0x3fa1a6,null))[_0xa35a('0x45')](function(_0x96acf4){var _0x415619=_0x4cb452[_0xa35a('0x33')][_0xa35a('0xbd')]?0x1f4:_0x96acf4[_0xa35a('0xbe')]||0x1f4;logger[_0xa35a('0x28')](_0x96acf4[_0xa35a('0x29')]);delete _0x96acf4['name'];if(_0x415619===0x191){_0x415619=0x190;}_0x3fa1a6[_0xa35a('0x1b')](_0x415619)[_0xa35a('0x2b')](_0x4cb452[_0xa35a('0x33')][_0xa35a('0xbd')]?{'message':'Wrong\x20credentials','statusCode':_0x96acf4[_0xa35a('0xbe')]}:_0x96acf4);});};function getSelectList(_0x1fb224,_0x255932,_0x213fd5,_0xbdb42e,_0x1efe1f,_0x13cb13){var _0xba0ce2={'method':_0xa35a('0xa4'),'uri':_0x1fb224+_0xa35a('0xbf')+_0xbdb42e+_0xa35a('0xc0')+_0x1efe1f+_0xa35a('0xc1')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xa35a('0xa6')+_0x13cb13,'If-None-Match':null,'OData-Version':_0xa35a('0xa7')},'json':!![]};return rp(_0xba0ce2)['then'](function(_0x5b0277){var _0x596ef2=[];var _0x371d00=_0x5b0277[_0xa35a('0xc2')][_0xa35a('0xc3')];_0x371d00[_0xa35a('0xad')](function(_0x29ecff){_0x596ef2[_0xa35a('0xb0')]({'name':_0x29ecff[_0xa35a('0xc4')][_0xa35a('0xc5')][_0xa35a('0xc4')],'value':String(_0x29ecff[_0xa35a('0xc6')])});});var _0x2ba286={'id':_0x255932+'_'+_0x5b0277['LogicalName'],'name':_0x5b0277[_0xa35a('0xc7')][_0xa35a('0xc5')][_0xa35a('0xc4')],'custom':![],'options':_0x596ef2};_0x213fd5['push'](_0x2ba286);return _0x213fd5;});}function getBooleanList(_0x2fb4cd,_0x3b8467,_0x3f13a5,_0x350768,_0x30bbad,_0x37056e){var _0x362525={'method':'GET','uri':_0x2fb4cd+'EntityDefinitions('+_0x350768+')/Attributes('+_0x30bbad+_0xa35a('0xc8'),'headers':{'Authorization':_0xa35a('0xa6')+_0x37056e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x362525)[_0xa35a('0x26')](function(_0x5b75c3){var _0x42aa83=[];_0x42aa83[_0xa35a('0xb0')]({'name':_0x5b75c3['OptionSet'][_0xa35a('0xc9')][_0xa35a('0xc4')][_0xa35a('0xc5')][_0xa35a('0xc4')],'value':_0xa35a('0xca')},{'name':_0x5b75c3[_0xa35a('0xc2')][_0xa35a('0xcb')][_0xa35a('0xc4')]['UserLocalizedLabel'][_0xa35a('0xc4')],'value':_0xa35a('0xcc')});var _0x7c2ea7={'id':_0x3b8467+'_'+_0x5b75c3[_0xa35a('0xac')],'name':_0x5b75c3[_0xa35a('0xc7')]['UserLocalizedLabel'][_0xa35a('0xc4')],'custom':![],'options':_0x42aa83};_0x3f13a5[_0xa35a('0xb0')](_0x7c2ea7);return _0x3f13a5;});}function getInputList(_0x507296,_0x2398a7,_0x2c7636,_0x1b651a,_0x4d9460,_0x49c949,_0x1fbe65){var _0x573884={'method':_0xa35a('0xa4'),'uri':_0x507296+_0xa35a('0xbf')+_0x4d9460+_0xa35a('0xc0')+_0x49c949+_0xa35a('0xcd')+_0x2c7636+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa35a('0xa6')+_0x1fbe65,'If-None-Match':null,'OData-Version':_0xa35a('0xa7')},'json':!![]};return rp(_0x573884)[_0xa35a('0x26')](function(_0xb60a93){var _0x5c08d2={'id':_0x2398a7+'_'+_0xb60a93[_0xa35a('0xac')],'name':_0xb60a93[_0xa35a('0xc7')]['UserLocalizedLabel']?_0xb60a93['DisplayName'][_0xa35a('0xc5')][_0xa35a('0xc4')]:_0xb60a93[_0xa35a('0xac')],'custom':![],'options':[]};_0x1b651a[_0xa35a('0xb0')](_0x5c08d2);return _0x1b651a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 18266a9..5071c99 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x591476,_0x28b494){var _0x47516b=function(_0x29cc88){while(--_0x29cc88){_0x591476['push'](_0x591476['shift']());}};_0x47516b(++_0x28b494);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x32972e,_0x589b6a){var _0x50c554=function(_0x5c5ba5){while(--_0x5c5ba5){_0x32972e['push'](_0x32972e['shift']());}};_0x50c554(++_0x589b6a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 2331a4b..419aa15 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 _0x2d65=['error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','model','map','include','ShowDynamics365Account','find','then','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2d65,0x17b));var _0x52d6=function(_0x506bcc,_0xd60f76){_0x506bcc=_0x506bcc-0x0;var _0xea208e=_0x2d65[_0x506bcc];return _0xea208e;};'use strict';var _=require('lodash');var util=require(_0x52d6('0x0'));var moment=require(_0x52d6('0x1'));var BPromise=require(_0x52d6('0x2'));var rs=require(_0x52d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52d6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x52d6('0x5'))(_0x52d6('0x6'));var config=require(_0x52d6('0x7'));var jayson=require(_0x52d6('0x8'));var client=jayson[_0x52d6('0x9')][_0x52d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x106446,_0x30f811,_0x48bcef){return new BPromise(function(_0x50c661,_0x229b0b){return client[_0x52d6('0xb')](_0x106446,_0x48bcef)['then'](function(_0x2a4126){logger[_0x52d6('0xc')](_0x52d6('0xd'),_0x30f811,_0x52d6('0xe'));logger[_0x52d6('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x30f811,_0x52d6('0xe'),JSON[_0x52d6('0x10')](_0x2a4126));if(_0x2a4126[_0x52d6('0x11')]){if(_0x2a4126[_0x52d6('0x11')][_0x52d6('0x12')]===0x1f4){logger[_0x52d6('0x11')](_0x52d6('0xd'),_0x30f811,_0x2a4126[_0x52d6('0x11')][_0x52d6('0x13')]);return _0x229b0b(_0x2a4126['error'][_0x52d6('0x13')]);}logger[_0x52d6('0x11')](_0x52d6('0xd'),_0x30f811,_0x2a4126[_0x52d6('0x11')][_0x52d6('0x13')]);return _0x50c661(_0x2a4126['error'][_0x52d6('0x13')]);}else{logger[_0x52d6('0xc')](_0x52d6('0xd'),_0x30f811,_0x52d6('0xe'));_0x50c661(_0x2a4126[_0x52d6('0x14')][_0x52d6('0x13')]);}})['catch'](function(_0x15256d){logger[_0x52d6('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x30f811,_0x15256d);_0x229b0b(_0x15256d);});});}exports[_0x52d6('0x15')]=function(_0x1eae81){var _0x108de9=this;return new Promise(function(_0x1a2409,_0x59477f){return db[_0x52d6('0x16')][_0x52d6('0x17')]({'raw':_0x1eae81[_0x52d6('0x18')]?_0x1eae81[_0x52d6('0x18')][_0x52d6('0x19')]===undefined?!![]:![]:!![],'where':_0x1eae81[_0x52d6('0x18')]?_0x1eae81[_0x52d6('0x18')][_0x52d6('0x1a')]||null:null,'attributes':_0x1eae81[_0x52d6('0x18')]?_0x1eae81['options'][_0x52d6('0x1b')]||null:null,'limit':_0x1eae81['options']?_0x1eae81[_0x52d6('0x18')][_0x52d6('0x1c')]||null:null,'include':_0x1eae81[_0x52d6('0x18')]?_0x1eae81[_0x52d6('0x18')]['include']?_['map'](_0x1eae81[_0x52d6('0x18')]['include'],function(_0x40fc99){return{'model':db[_0x40fc99[_0x52d6('0x1d')]],'as':_0x40fc99['as'],'attributes':_0x40fc99[_0x52d6('0x1b')],'include':_0x40fc99['include']?_[_0x52d6('0x1e')](_0x40fc99[_0x52d6('0x1f')],function(_0x349590){return{'model':db[_0x349590[_0x52d6('0x1d')]],'as':_0x349590['as'],'attributes':_0x349590['attributes'],'include':_0x349590[_0x52d6('0x1f')]?_[_0x52d6('0x1e')](_0x349590['include'],function(_0x1222bb){return{'model':db[_0x1222bb[_0x52d6('0x1d')]],'as':_0x1222bb['as'],'attributes':_0x1222bb[_0x52d6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x662050){logger[_0x52d6('0xc')]('GetDynamics365Account',_0x1eae81);logger['debug'](_0x52d6('0x15'),_0x1eae81,JSON[_0x52d6('0x10')](_0x662050));_0x1a2409(_0x662050);})['catch'](function(_0x177c2e){logger['error'](_0x52d6('0x15'),_0x177c2e[_0x52d6('0x13')],_0x1eae81);_0x59477f(_0x108de9[_0x52d6('0x11')](0x1f4,_0x177c2e[_0x52d6('0x13')]));});});};exports[_0x52d6('0x20')]=function(_0xea1549){var _0x5eb94e=this;return new Promise(function(_0xb0b610,_0x17d90b){return db[_0x52d6('0x16')][_0x52d6('0x21')]({'raw':_0xea1549['options']?_0xea1549[_0x52d6('0x18')][_0x52d6('0x19')]===undefined?!![]:![]:!![],'where':_0xea1549[_0x52d6('0x18')]?_0xea1549[_0x52d6('0x18')][_0x52d6('0x1a')]||null:null,'attributes':_0xea1549['options']?_0xea1549[_0x52d6('0x18')][_0x52d6('0x1b')]||null:null,'include':_0xea1549['options']?_0xea1549[_0x52d6('0x18')][_0x52d6('0x1f')]?_[_0x52d6('0x1e')](_0xea1549[_0x52d6('0x18')][_0x52d6('0x1f')],function(_0x405393){return{'model':db[_0x405393[_0x52d6('0x1d')]],'as':_0x405393['as'],'attributes':_0x405393[_0x52d6('0x1b')],'include':_0x405393[_0x52d6('0x1f')]?_[_0x52d6('0x1e')](_0x405393[_0x52d6('0x1f')],function(_0x5079b3){return{'model':db[_0x5079b3[_0x52d6('0x1d')]],'as':_0x5079b3['as'],'attributes':_0x5079b3[_0x52d6('0x1b')],'include':_0x5079b3[_0x52d6('0x1f')]?_[_0x52d6('0x1e')](_0x5079b3['include'],function(_0x1ef4d3){return{'model':db[_0x1ef4d3[_0x52d6('0x1d')]],'as':_0x1ef4d3['as'],'attributes':_0x1ef4d3['attributes']};}):[]};}):[]};}):[]:[]})[_0x52d6('0x22')](function(_0x2f4568){logger['info']('ShowDynamics365Account',_0xea1549);logger[_0x52d6('0xf')](_0x52d6('0x20'),_0xea1549,JSON[_0x52d6('0x10')](_0x2f4568));_0xb0b610(_0x2f4568);})[_0x52d6('0x23')](function(_0x2edfa9){logger[_0x52d6('0x11')](_0x52d6('0x20'),_0x2edfa9[_0x52d6('0x13')],_0xea1549);_0x17d90b(_0x5eb94e[_0x52d6('0x11')](0x1f4,_0x2edfa9[_0x52d6('0x13')]));});});}; \ No newline at end of file +var _0x14f4=['Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','findAll','options','where','attributes','limit','include','map','model','Dynamics365Account','find','ShowDynamics365Account','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2a972c,_0x2f8026){var _0xc3c903=function(_0x2b66e6){while(--_0x2b66e6){_0x2a972c['push'](_0x2a972c['shift']());}};_0xc3c903(++_0x2f8026);}(_0x14f4,0x72));var _0x414f=function(_0x15beab,_0x2ce657){_0x15beab=_0x15beab-0x0;var _0x58e5c7=_0x14f4[_0x15beab];return _0x58e5c7;};'use strict';var _=require(_0x414f('0x0'));var util=require(_0x414f('0x1'));var moment=require('moment');var BPromise=require(_0x414f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x414f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x414f('0x4'));var logger=require(_0x414f('0x5'))(_0x414f('0x6'));var config=require(_0x414f('0x7'));var jayson=require(_0x414f('0x8'));var client=jayson['client'][_0x414f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45987f,_0x36b5ea,_0x57b5ab){return new BPromise(function(_0x5a4a97,_0x401347){return client[_0x414f('0xa')](_0x45987f,_0x57b5ab)[_0x414f('0xb')](function(_0x20f7bd){logger[_0x414f('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x36b5ea,'request\x20sent');logger[_0x414f('0xd')](_0x414f('0xe'),_0x36b5ea,'request\x20sent',JSON[_0x414f('0xf')](_0x20f7bd));if(_0x20f7bd[_0x414f('0x10')]){if(_0x20f7bd['error'][_0x414f('0x11')]===0x1f4){logger[_0x414f('0x10')](_0x414f('0x12'),_0x36b5ea,_0x20f7bd['error'][_0x414f('0x13')]);return _0x401347(_0x20f7bd[_0x414f('0x10')]['message']);}logger[_0x414f('0x10')](_0x414f('0x12'),_0x36b5ea,_0x20f7bd[_0x414f('0x10')][_0x414f('0x13')]);return _0x5a4a97(_0x20f7bd[_0x414f('0x10')]['message']);}else{logger['info'](_0x414f('0x12'),_0x36b5ea,'request\x20sent');_0x5a4a97(_0x20f7bd['result'][_0x414f('0x13')]);}})[_0x414f('0x14')](function(_0x4f4fdc){logger[_0x414f('0x10')](_0x414f('0x12'),_0x36b5ea,_0x4f4fdc);_0x401347(_0x4f4fdc);});});}exports[_0x414f('0x15')]=function(_0x1c00a0){var _0x5086f2=this;return new Promise(function(_0x3d6fed,_0x2fa9a9){return db['Dynamics365Account'][_0x414f('0x16')]({'raw':_0x1c00a0['options']?_0x1c00a0[_0x414f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1c00a0[_0x414f('0x17')]?_0x1c00a0[_0x414f('0x17')][_0x414f('0x18')]||null:null,'attributes':_0x1c00a0[_0x414f('0x17')]?_0x1c00a0[_0x414f('0x17')][_0x414f('0x19')]||null:null,'limit':_0x1c00a0[_0x414f('0x17')]?_0x1c00a0[_0x414f('0x17')][_0x414f('0x1a')]||null:null,'include':_0x1c00a0['options']?_0x1c00a0['options'][_0x414f('0x1b')]?_[_0x414f('0x1c')](_0x1c00a0[_0x414f('0x17')][_0x414f('0x1b')],function(_0x50829b){return{'model':db[_0x50829b[_0x414f('0x1d')]],'as':_0x50829b['as'],'attributes':_0x50829b['attributes'],'include':_0x50829b[_0x414f('0x1b')]?_['map'](_0x50829b[_0x414f('0x1b')],function(_0x2c2a47){return{'model':db[_0x2c2a47['model']],'as':_0x2c2a47['as'],'attributes':_0x2c2a47[_0x414f('0x19')],'include':_0x2c2a47[_0x414f('0x1b')]?_[_0x414f('0x1c')](_0x2c2a47['include'],function(_0x13077d){return{'model':db[_0x13077d[_0x414f('0x1d')]],'as':_0x13077d['as'],'attributes':_0x13077d[_0x414f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x414f('0xb')](function(_0x38d128){logger[_0x414f('0xc')](_0x414f('0x15'),_0x1c00a0);logger[_0x414f('0xd')]('GetDynamics365Account',_0x1c00a0,JSON[_0x414f('0xf')](_0x38d128));_0x3d6fed(_0x38d128);})[_0x414f('0x14')](function(_0x4ca432){logger['error']('GetDynamics365Account',_0x4ca432[_0x414f('0x13')],_0x1c00a0);_0x2fa9a9(_0x5086f2[_0x414f('0x10')](0x1f4,_0x4ca432[_0x414f('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x306ec6){var _0x3a618d=this;return new Promise(function(_0x448326,_0x487836){return db[_0x414f('0x1e')][_0x414f('0x1f')]({'raw':_0x306ec6[_0x414f('0x17')]?_0x306ec6[_0x414f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x306ec6[_0x414f('0x17')]?_0x306ec6['options'][_0x414f('0x18')]||null:null,'attributes':_0x306ec6[_0x414f('0x17')]?_0x306ec6['options']['attributes']||null:null,'include':_0x306ec6[_0x414f('0x17')]?_0x306ec6['options'][_0x414f('0x1b')]?_[_0x414f('0x1c')](_0x306ec6['options'][_0x414f('0x1b')],function(_0x4d83c8){return{'model':db[_0x4d83c8[_0x414f('0x1d')]],'as':_0x4d83c8['as'],'attributes':_0x4d83c8[_0x414f('0x19')],'include':_0x4d83c8[_0x414f('0x1b')]?_['map'](_0x4d83c8['include'],function(_0x4ecc3c){return{'model':db[_0x4ecc3c[_0x414f('0x1d')]],'as':_0x4ecc3c['as'],'attributes':_0x4ecc3c[_0x414f('0x19')],'include':_0x4ecc3c[_0x414f('0x1b')]?_[_0x414f('0x1c')](_0x4ecc3c[_0x414f('0x1b')],function(_0x389bf1){return{'model':db[_0x389bf1['model']],'as':_0x389bf1['as'],'attributes':_0x389bf1[_0x414f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x414f('0xb')](function(_0x46af04){logger[_0x414f('0xc')](_0x414f('0x20'),_0x306ec6);logger['debug'](_0x414f('0x20'),_0x306ec6,JSON[_0x414f('0xf')](_0x46af04));_0x448326(_0x46af04);})[_0x414f('0x14')](function(_0xe3a2d4){logger['error'](_0x414f('0x20'),_0xe3a2d4[_0x414f('0x13')],_0x306ec6);_0x487836(_0x3a618d['error'](0x1f4,_0xe3a2d4[_0x414f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 950259b..9b07ad2 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 _0x13cc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','post','create','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra'];(function(_0x485cb0,_0x14c913){var _0x4c72aa=function(_0x448d99){while(--_0x448d99){_0x485cb0['push'](_0x485cb0['shift']());}};_0x4c72aa(++_0x14c913);}(_0x13cc,0x161));var _0xc13c=function(_0xc48d84,_0x42352d){_0xc48d84=_0xc48d84-0x0;var _0xa68c33=_0x13cc[_0xc48d84];return _0xa68c33;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc13c('0x0'));var timeout=require(_0xc13c('0x1'));var express=require('express');var router=express[_0xc13c('0x2')]();var fs_extra=require(_0xc13c('0x3'));var auth=require(_0xc13c('0x4'));var interaction=require(_0xc13c('0x5'));var config=require(_0xc13c('0x6'));var controller=require(_0xc13c('0x7'));router['get']('/',auth[_0xc13c('0x8')](),controller['index']);router[_0xc13c('0x9')](_0xc13c('0xa'),auth[_0xc13c('0x8')](),controller[_0xc13c('0xb')]);router[_0xc13c('0x9')](_0xc13c('0xc'),auth[_0xc13c('0x8')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xc13c('0x8')](),controller[_0xc13c('0xd')]);router[_0xc13c('0x9')](_0xc13c('0xe'),auth[_0xc13c('0x8')](),controller['getDescriptions']);router[_0xc13c('0xf')]('/',auth['isAuthenticated'](),controller[_0xc13c('0x10')]);router['put']('/:id',auth[_0xc13c('0x8')](),controller[_0xc13c('0x11')]);router[_0xc13c('0x12')](_0xc13c('0xa'),auth[_0xc13c('0x8')](),controller[_0xc13c('0x13')]);module[_0xc13c('0x14')]=router; \ No newline at end of file +var _0xdf4d=['create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions'];(function(_0x491725,_0x57f791){var _0x540a84=function(_0x36a494){while(--_0x36a494){_0x491725['push'](_0x491725['shift']());}};_0x540a84(++_0x57f791);}(_0xdf4d,0xcb));var _0xddf4=function(_0x172db4,_0x27a961){_0x172db4=_0x172db4-0x0;var _0x408649=_0xdf4d[_0x172db4];return _0x408649;};'use strict';var multer=require('multer');var util=require(_0xddf4('0x0'));var path=require(_0xddf4('0x1'));var timeout=require('connect-timeout');var express=require(_0xddf4('0x2'));var router=express[_0xddf4('0x3')]();var fs_extra=require(_0xddf4('0x4'));var auth=require(_0xddf4('0x5'));var interaction=require(_0xddf4('0x6'));var config=require(_0xddf4('0x7'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0xddf4('0x8')](),controller[_0xddf4('0x9')]);router[_0xddf4('0xa')](_0xddf4('0xb'),auth[_0xddf4('0x8')](),controller[_0xddf4('0xc')]);router[_0xddf4('0xa')](_0xddf4('0xd'),auth[_0xddf4('0x8')](),controller[_0xddf4('0xe')]);router[_0xddf4('0xa')]('/:id/subjects',auth[_0xddf4('0x8')](),controller['getSubjects']);router[_0xddf4('0xa')](_0xddf4('0xf'),auth[_0xddf4('0x8')](),controller[_0xddf4('0x10')]);router['post']('/',auth[_0xddf4('0x8')](),controller[_0xddf4('0x11')]);router[_0xddf4('0x12')](_0xddf4('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xddf4('0x13')]('/:id',auth[_0xddf4('0x8')](),controller[_0xddf4('0x14')]);module[_0xddf4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 8587d3f..73110df 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 _0xf325=['STRING','ENUM','incident','phonecall','sequelize','exports'];(function(_0x2dbe01,_0x1048cc){var _0x4690ff=function(_0x14b70b){while(--_0x14b70b){_0x2dbe01['push'](_0x2dbe01['shift']());}};_0x4690ff(++_0x1048cc);}(_0xf325,0x11e));var _0x5f32=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf325[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x5f32('0x0'));module[_0x5f32('0x1')]={'name':{'type':Sequelize[_0x5f32('0x2')]},'description':{'type':Sequelize[_0x5f32('0x2')]},'ticketType':{'type':Sequelize[_0x5f32('0x3')](_0x5f32('0x4'),_0x5f32('0x5')),'defaultValue':'incident'}}; \ No newline at end of file +var _0xab3c=['incident','phonecall','sequelize','exports','STRING'];(function(_0x199e17,_0x2f11cd){var _0x1ada09=function(_0x5231fb){while(--_0x5231fb){_0x199e17['push'](_0x199e17['shift']());}};_0x1ada09(++_0x2f11cd);}(_0xab3c,0x66));var _0xcab3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab3c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcab3('0x0'));module[_0xcab3('0x1')]={'name':{'type':Sequelize[_0xcab3('0x2')]},'description':{'type':Sequelize[_0xcab3('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xcab3('0x3'),_0xcab3('0x4')),'defaultValue':_0xcab3('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 0c295cd..e16e403 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 _0xfa39=['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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','destroy','getFields','findOne','Dynamics365Field','getSubjects','hasOwnProperty','getDescriptions','eml-format','zip-dir'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfa39,0xa2));var _0x9fa3=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0xfa39[_0x217c2e];return _0x22b7d8;};'use strict';var emlformat=require(_0x9fa3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9fa3('0x1'));var jsonpatch=require(_0x9fa3('0x2'));var rp=require(_0x9fa3('0x3'));var moment=require('moment');var BPromise=require(_0x9fa3('0x4'));var Mustache=require(_0x9fa3('0x5'));var util=require(_0x9fa3('0x6'));var path=require(_0x9fa3('0x7'));var sox=require(_0x9fa3('0x8'));var csv=require(_0x9fa3('0x9'));var ejs=require(_0x9fa3('0xa'));var fs=require('fs');var fs_extra=require(_0x9fa3('0xb'));var _=require(_0x9fa3('0xc'));var squel=require(_0x9fa3('0xd'));var crypto=require(_0x9fa3('0xe'));var jsforce=require(_0x9fa3('0xf'));var deskjs=require(_0x9fa3('0x10'));var toCsv=require(_0x9fa3('0x9'));var querystring=require(_0x9fa3('0x11'));var Papa=require(_0x9fa3('0x12'));var Redis=require('ioredis');var authService=require(_0x9fa3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9fa3('0x14'));var hardwareService=require(_0x9fa3('0x15'));var logger=require(_0x9fa3('0x16'))(_0x9fa3('0x17'));var utils=require('../../config/utils');var config=require(_0x9fa3('0x18'));var licenseUtil=require(_0x9fa3('0x19'));var db=require(_0x9fa3('0x1a'))['db'];function respondWithStatusCode(_0x5802b5,_0x4fe6ae){_0x4fe6ae=_0x4fe6ae||0xcc;return function(_0x2e9fad){if(_0x2e9fad){return _0x5802b5['sendStatus'](_0x4fe6ae);}return _0x5802b5['status'](_0x4fe6ae)[_0x9fa3('0x1b')]();};}function respondWithResult(_0x2a68ce,_0x556318){_0x556318=_0x556318||0xc8;return function(_0x75988b){if(_0x75988b){return _0x2a68ce[_0x9fa3('0x1c')](_0x556318)[_0x9fa3('0x1d')](_0x75988b);}};}function respondWithFilteredResult(_0x67866c,_0x344d5f){return function(_0x3d4bd6){if(_0x3d4bd6){var _0x1cb1ac=typeof _0x344d5f[_0x9fa3('0x1e')]===_0x9fa3('0x1f')&&typeof _0x344d5f[_0x9fa3('0x20')]===_0x9fa3('0x1f');var _0x2b457c=_0x3d4bd6[_0x9fa3('0x21')];var _0x549684=_0x1cb1ac?0x0:_0x344d5f[_0x9fa3('0x1e')];var _0x418eb5=_0x1cb1ac?_0x3d4bd6[_0x9fa3('0x21')]:_0x344d5f['offset']+_0x344d5f[_0x9fa3('0x20')];var _0x577e6e;if(_0x418eb5>=_0x2b457c){_0x418eb5=_0x2b457c;_0x577e6e=0xc8;}else{_0x577e6e=0xce;}_0x67866c['status'](_0x577e6e);return _0x67866c[_0x9fa3('0x22')](_0x9fa3('0x23'),_0x549684+'-'+_0x418eb5+'/'+_0x2b457c)[_0x9fa3('0x1d')](_0x3d4bd6);}return null;};}function patchUpdates(_0x43a410){return function(_0x3c2afb){try{jsonpatch[_0x9fa3('0x24')](_0x3c2afb,_0x43a410,!![]);}catch(_0x1f3939){return BPromise['reject'](_0x1f3939);}return _0x3c2afb[_0x9fa3('0x25')]();};}function saveUpdates(_0x5a303a,_0x79a4ff){return function(_0x4297e9){if(_0x4297e9){return _0x4297e9[_0x9fa3('0x26')](_0x5a303a)[_0x9fa3('0x27')](function(_0x4c9f0b){return _0x4c9f0b;});}return null;};}function removeEntity(_0x1e7362,_0x540353){return function(_0x4ba5bd){if(_0x4ba5bd){return _0x4ba5bd['destroy']()[_0x9fa3('0x27')](function(){_0x1e7362['status'](0xcc)[_0x9fa3('0x1b')]();});}};}function handleEntityNotFound(_0x2f162f,_0x498644){return function(_0x4205dd){if(!_0x4205dd){_0x2f162f[_0x9fa3('0x28')](0x194);}return _0x4205dd;};}function handleError(_0x1b4af5,_0x56056f){_0x56056f=_0x56056f||0x1f4;return function(_0x170545){logger['error'](_0x170545['stack']);if(_0x170545[_0x9fa3('0x29')]){delete _0x170545[_0x9fa3('0x29')];}_0x1b4af5[_0x9fa3('0x1c')](_0x56056f)[_0x9fa3('0x2a')](_0x170545);};}exports[_0x9fa3('0x2b')]=function(_0x289ddb,_0x24fd5c){var _0x5b87c8={},_0x42c169={},_0x541107={'count':0x0,'rows':[]};var _0x201043=_[_0x9fa3('0x2c')](db[_0x9fa3('0x2d')][_0x9fa3('0x2e')],function(_0x4a7508){return{'name':_0x4a7508[_0x9fa3('0x2f')],'type':_0x4a7508[_0x9fa3('0x30')][_0x9fa3('0x31')]};});_0x42c169[_0x9fa3('0x32')]=_[_0x9fa3('0x2c')](_0x201043,'name');_0x42c169['query']=_[_0x9fa3('0x33')](_0x289ddb[_0x9fa3('0x34')]);_0x42c169['filters']=_[_0x9fa3('0x35')](_0x42c169[_0x9fa3('0x32')],_0x42c169[_0x9fa3('0x34')]);_0x5b87c8['attributes']=_[_0x9fa3('0x35')](_0x42c169[_0x9fa3('0x32')],qs['fields'](_0x289ddb['query'][_0x9fa3('0x36')]));_0x5b87c8[_0x9fa3('0x37')]=_0x5b87c8[_0x9fa3('0x37')][_0x9fa3('0x38')]?_0x5b87c8[_0x9fa3('0x37')]:_0x42c169[_0x9fa3('0x32')];if(!_0x289ddb[_0x9fa3('0x34')]['hasOwnProperty'](_0x9fa3('0x39'))){_0x5b87c8[_0x9fa3('0x20')]=qs[_0x9fa3('0x20')](_0x289ddb[_0x9fa3('0x34')][_0x9fa3('0x20')]);_0x5b87c8['offset']=qs['offset'](_0x289ddb[_0x9fa3('0x34')][_0x9fa3('0x1e')]);}_0x5b87c8[_0x9fa3('0x3a')]=qs[_0x9fa3('0x3b')](_0x289ddb['query'][_0x9fa3('0x3b')]);_0x5b87c8[_0x9fa3('0x3c')]=qs[_0x9fa3('0x3d')](_[_0x9fa3('0x3e')](_0x289ddb[_0x9fa3('0x34')],_0x42c169[_0x9fa3('0x3d')]),_0x201043);if(_0x289ddb[_0x9fa3('0x34')][_0x9fa3('0x3f')]){_0x5b87c8['where']=_[_0x9fa3('0x40')](_0x5b87c8['where'],{'$or':_[_0x9fa3('0x2c')](_0x201043,function(_0x33c3da){if(_0x33c3da[_0x9fa3('0x30')]!==_0x9fa3('0x41')){var _0x3b06b3={};_0x3b06b3[_0x33c3da['name']]={'$like':'%'+_0x289ddb['query']['filter']+'%'};return _0x3b06b3;}})});}_0x5b87c8=_[_0x9fa3('0x40')]({},_0x5b87c8,_0x289ddb[_0x9fa3('0x42')]);var _0x411979={'where':_0x5b87c8[_0x9fa3('0x3c')]};return db[_0x9fa3('0x2d')][_0x9fa3('0x21')](_0x411979)[_0x9fa3('0x27')](function(_0x424f98){_0x541107[_0x9fa3('0x21')]=_0x424f98;if(_0x289ddb['query'][_0x9fa3('0x43')]){_0x5b87c8['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x5b87c8);})['then'](function(_0x14af8d){_0x541107[_0x9fa3('0x44')]=_0x14af8d;return _0x541107;})[_0x9fa3('0x27')](respondWithFilteredResult(_0x24fd5c,_0x5b87c8))[_0x9fa3('0x45')](handleError(_0x24fd5c,null));};exports['show']=function(_0x3bbc9d,_0x256083){var _0xa8a68={'raw':![],'where':{'id':_0x3bbc9d[_0x9fa3('0x46')]['id']}},_0xd925c8={};_0xd925c8[_0x9fa3('0x32')]=_['keys'](db[_0x9fa3('0x2d')][_0x9fa3('0x2e')]);_0xd925c8['query']=_[_0x9fa3('0x33')](_0x3bbc9d[_0x9fa3('0x34')]);_0xd925c8[_0x9fa3('0x3d')]=_[_0x9fa3('0x35')](_0xd925c8[_0x9fa3('0x32')],_0xd925c8[_0x9fa3('0x34')]);_0xa8a68['attributes']=_[_0x9fa3('0x35')](_0xd925c8[_0x9fa3('0x32')],qs[_0x9fa3('0x36')](_0x3bbc9d['query'][_0x9fa3('0x36')]));_0xa8a68['attributes']=_0xa8a68['attributes'][_0x9fa3('0x38')]?_0xa8a68['attributes']:_0xd925c8[_0x9fa3('0x32')];if(_0x3bbc9d['query'][_0x9fa3('0x43')]){_0xa8a68[_0x9fa3('0x47')]=[{'all':!![]}];}_0xa8a68=_[_0x9fa3('0x40')]({},_0xa8a68,_0x3bbc9d['options']);return db[_0x9fa3('0x2d')][_0x9fa3('0x48')](_0xa8a68)[_0x9fa3('0x27')](handleEntityNotFound(_0x256083,null))[_0x9fa3('0x27')](respondWithResult(_0x256083,null))[_0x9fa3('0x45')](handleError(_0x256083,null));};exports['create']=function(_0x236b6c,_0x134bdf){return db[_0x9fa3('0x2d')][_0x9fa3('0x49')](_0x236b6c[_0x9fa3('0x4a')],{})[_0x9fa3('0x27')](respondWithResult(_0x134bdf,0xc9))[_0x9fa3('0x45')](handleError(_0x134bdf,null));};exports[_0x9fa3('0x26')]=function(_0xddcc66,_0x51dc9e){if(_0xddcc66['body']['id']){delete _0xddcc66['body']['id'];}return db[_0x9fa3('0x2d')][_0x9fa3('0x48')]({'where':{'id':_0xddcc66[_0x9fa3('0x46')]['id']}})[_0x9fa3('0x27')](handleEntityNotFound(_0x51dc9e,null))[_0x9fa3('0x27')](saveUpdates(_0xddcc66['body'],null))[_0x9fa3('0x27')](respondWithResult(_0x51dc9e,null))['catch'](handleError(_0x51dc9e,null));};exports[_0x9fa3('0x4b')]=function(_0x5538d0,_0x38c36b){return db[_0x9fa3('0x2d')][_0x9fa3('0x48')]({'where':{'id':_0x5538d0[_0x9fa3('0x46')]['id']}})['then'](handleEntityNotFound(_0x38c36b,null))[_0x9fa3('0x27')](removeEntity(_0x38c36b,null))[_0x9fa3('0x45')](handleError(_0x38c36b,null));};exports[_0x9fa3('0x4c')]=function(_0x4ae9c6,_0x8c8021,_0x582457){var _0x4098c8={};var _0x23d4ea={};var _0x4a6b83;var _0x35e768;return db['Dynamics365Configuration'][_0x9fa3('0x4d')]({'where':{'id':_0x4ae9c6[_0x9fa3('0x46')]['id']}})[_0x9fa3('0x27')](handleEntityNotFound(_0x8c8021,null))[_0x9fa3('0x27')](function(_0x4c12d3){if(_0x4c12d3){_0x4a6b83=_0x4c12d3;_0x23d4ea[_0x9fa3('0x32')]=_[_0x9fa3('0x33')](db[_0x9fa3('0x4e')][_0x9fa3('0x2e')]);_0x23d4ea[_0x9fa3('0x34')]=_[_0x9fa3('0x33')](_0x4ae9c6[_0x9fa3('0x34')]);_0x23d4ea['filters']=_[_0x9fa3('0x35')](_0x23d4ea['model'],_0x23d4ea[_0x9fa3('0x34')]);_0x4098c8['attributes']=_[_0x9fa3('0x35')](_0x23d4ea[_0x9fa3('0x32')],qs[_0x9fa3('0x36')](_0x4ae9c6[_0x9fa3('0x34')]['fields']));_0x4098c8['attributes']=_0x4098c8[_0x9fa3('0x37')]['length']?_0x4098c8[_0x9fa3('0x37')]:_0x23d4ea[_0x9fa3('0x32')];_0x4098c8[_0x9fa3('0x3a')]=qs['sort'](_0x4ae9c6[_0x9fa3('0x34')][_0x9fa3('0x3b')]);_0x4098c8['where']=qs[_0x9fa3('0x3d')](_['pick'](_0x4ae9c6['query'],_0x23d4ea[_0x9fa3('0x3d')]));if(_0x4ae9c6[_0x9fa3('0x34')]['filter']){_0x4098c8[_0x9fa3('0x3c')]=_[_0x9fa3('0x40')](_0x4098c8['where'],{'$or':_['map'](_0x4098c8[_0x9fa3('0x37')],function(_0x21acf7){var _0x47c91c={};_0x47c91c[_0x21acf7]={'$like':'%'+_0x4ae9c6[_0x9fa3('0x34')][_0x9fa3('0x3f')]+'%'};return _0x47c91c;})});}_0x4098c8=_[_0x9fa3('0x40')]({},_0x4098c8,_0x4ae9c6[_0x9fa3('0x42')]);return _0x4a6b83[_0x9fa3('0x4c')](_0x4098c8);}})[_0x9fa3('0x27')](function(_0x3f8e2b){if(_0x3f8e2b){_0x35e768=_0x3f8e2b['length'];if(!_0x4ae9c6[_0x9fa3('0x34')]['hasOwnProperty']('nolimit')){_0x4098c8[_0x9fa3('0x20')]=qs['limit'](_0x4ae9c6[_0x9fa3('0x34')][_0x9fa3('0x20')]);_0x4098c8['offset']=qs[_0x9fa3('0x1e')](_0x4ae9c6['query'][_0x9fa3('0x1e')]);}return _0x4a6b83[_0x9fa3('0x4c')](_0x4098c8);}})['then'](function(_0x5343e4){if(_0x5343e4){return _0x5343e4?{'count':_0x35e768,'rows':_0x5343e4}:null;}})[_0x9fa3('0x27')](respondWithResult(_0x8c8021,null))[_0x9fa3('0x45')](handleError(_0x8c8021,null));};exports[_0x9fa3('0x4f')]=function(_0x2cecd3,_0x3b92f8,_0x2573ba){var _0x14306e={};var _0xcedb9={};var _0x538807;var _0x2676fb;return db[_0x9fa3('0x2d')]['findOne']({'where':{'id':_0x2cecd3[_0x9fa3('0x46')]['id']}})[_0x9fa3('0x27')](handleEntityNotFound(_0x3b92f8,null))['then'](function(_0xc09121){if(_0xc09121){_0x538807=_0xc09121;_0xcedb9[_0x9fa3('0x32')]=_[_0x9fa3('0x33')](db[_0x9fa3('0x4e')][_0x9fa3('0x2e')]);_0xcedb9[_0x9fa3('0x34')]=_['keys'](_0x2cecd3['query']);_0xcedb9['filters']=_['intersection'](_0xcedb9[_0x9fa3('0x32')],_0xcedb9[_0x9fa3('0x34')]);_0x14306e[_0x9fa3('0x37')]=_['intersection'](_0xcedb9['model'],qs['fields'](_0x2cecd3[_0x9fa3('0x34')]['fields']));_0x14306e[_0x9fa3('0x37')]=_0x14306e[_0x9fa3('0x37')][_0x9fa3('0x38')]?_0x14306e['attributes']:_0xcedb9[_0x9fa3('0x32')];_0x14306e['order']=qs['sort'](_0x2cecd3[_0x9fa3('0x34')]['sort']);_0x14306e[_0x9fa3('0x3c')]=qs['filters'](_[_0x9fa3('0x3e')](_0x2cecd3['query'],_0xcedb9[_0x9fa3('0x3d')]));if(_0x2cecd3[_0x9fa3('0x34')]['filter']){_0x14306e['where']=_[_0x9fa3('0x40')](_0x14306e['where'],{'$or':_[_0x9fa3('0x2c')](_0x14306e['attributes'],function(_0x39796c){var _0x1708fe={};_0x1708fe[_0x39796c]={'$like':'%'+_0x2cecd3[_0x9fa3('0x34')][_0x9fa3('0x3f')]+'%'};return _0x1708fe;})});}_0x14306e=_['merge']({},_0x14306e,_0x2cecd3[_0x9fa3('0x42')]);return _0x538807[_0x9fa3('0x4f')](_0x14306e);}})[_0x9fa3('0x27')](function(_0x39d961){if(_0x39d961){_0x2676fb=_0x39d961[_0x9fa3('0x38')];if(!_0x2cecd3[_0x9fa3('0x34')][_0x9fa3('0x50')](_0x9fa3('0x39'))){_0x14306e['limit']=qs['limit'](_0x2cecd3['query'][_0x9fa3('0x20')]);_0x14306e[_0x9fa3('0x1e')]=qs[_0x9fa3('0x1e')](_0x2cecd3[_0x9fa3('0x34')][_0x9fa3('0x1e')]);}return _0x538807[_0x9fa3('0x4f')](_0x14306e);}})[_0x9fa3('0x27')](function(_0x4225c5){if(_0x4225c5){return _0x4225c5?{'count':_0x2676fb,'rows':_0x4225c5}:null;}})['then'](respondWithResult(_0x3b92f8,null))[_0x9fa3('0x45')](handleError(_0x3b92f8,null));};exports[_0x9fa3('0x51')]=function(_0xc17aaf,_0x143c28,_0x47a2aa){var _0x55b820={};var _0x13d13b={};var _0x18d95a;var _0x1558a9;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0xc17aaf['params']['id']}})[_0x9fa3('0x27')](handleEntityNotFound(_0x143c28,null))['then'](function(_0x160256){if(_0x160256){_0x18d95a=_0x160256;_0x13d13b['model']=_[_0x9fa3('0x33')](db[_0x9fa3('0x4e')][_0x9fa3('0x2e')]);_0x13d13b[_0x9fa3('0x34')]=_[_0x9fa3('0x33')](_0xc17aaf[_0x9fa3('0x34')]);_0x13d13b[_0x9fa3('0x3d')]=_['intersection'](_0x13d13b['model'],_0x13d13b['query']);_0x55b820[_0x9fa3('0x37')]=_[_0x9fa3('0x35')](_0x13d13b[_0x9fa3('0x32')],qs[_0x9fa3('0x36')](_0xc17aaf[_0x9fa3('0x34')][_0x9fa3('0x36')]));_0x55b820[_0x9fa3('0x37')]=_0x55b820[_0x9fa3('0x37')][_0x9fa3('0x38')]?_0x55b820['attributes']:_0x13d13b[_0x9fa3('0x32')];_0x55b820[_0x9fa3('0x3a')]=qs[_0x9fa3('0x3b')](_0xc17aaf[_0x9fa3('0x34')]['sort']);_0x55b820[_0x9fa3('0x3c')]=qs[_0x9fa3('0x3d')](_[_0x9fa3('0x3e')](_0xc17aaf[_0x9fa3('0x34')],_0x13d13b['filters']));if(_0xc17aaf[_0x9fa3('0x34')][_0x9fa3('0x3f')]){_0x55b820[_0x9fa3('0x3c')]=_[_0x9fa3('0x40')](_0x55b820[_0x9fa3('0x3c')],{'$or':_[_0x9fa3('0x2c')](_0x55b820[_0x9fa3('0x37')],function(_0x435e8f){var _0x2a485e={};_0x2a485e[_0x435e8f]={'$like':'%'+_0xc17aaf[_0x9fa3('0x34')][_0x9fa3('0x3f')]+'%'};return _0x2a485e;})});}_0x55b820=_[_0x9fa3('0x40')]({},_0x55b820,_0xc17aaf[_0x9fa3('0x42')]);return _0x18d95a[_0x9fa3('0x51')](_0x55b820);}})[_0x9fa3('0x27')](function(_0x1d6b97){if(_0x1d6b97){_0x1558a9=_0x1d6b97['length'];if(!_0xc17aaf[_0x9fa3('0x34')]['hasOwnProperty'](_0x9fa3('0x39'))){_0x55b820[_0x9fa3('0x20')]=qs['limit'](_0xc17aaf[_0x9fa3('0x34')][_0x9fa3('0x20')]);_0x55b820[_0x9fa3('0x1e')]=qs['offset'](_0xc17aaf[_0x9fa3('0x34')][_0x9fa3('0x1e')]);}return _0x18d95a['getDescriptions'](_0x55b820);}})[_0x9fa3('0x27')](function(_0x517860){if(_0x517860){return _0x517860?{'count':_0x1558a9,'rows':_0x517860}:null;}})[_0x9fa3('0x27')](respondWithResult(_0x143c28,null))[_0x9fa3('0x45')](handleError(_0x143c28,null));}; \ No newline at end of file +var _0x65a3=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','set','apply','reject','update','destroy','then','end','error','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','sort','where','pick','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','order','filter','hasOwnProperty','getFields','getSubjects','findOne','Dynamics365Field','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0x2cca45,_0x5483cb){var _0x230ad0=function(_0x5499fb){while(--_0x5499fb){_0x2cca45['push'](_0x2cca45['shift']());}};_0x230ad0(++_0x5483cb);}(_0x65a3,0xdd));var _0x365a=function(_0x3ca441,_0xd26876){_0x3ca441=_0x3ca441-0x0;var _0x8f8561=_0x65a3[_0x3ca441];return _0x8f8561;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x365a('0x0'));var zipdir=require(_0x365a('0x1'));var jsonpatch=require(_0x365a('0x2'));var rp=require(_0x365a('0x3'));var moment=require(_0x365a('0x4'));var BPromise=require(_0x365a('0x5'));var Mustache=require('mustache');var util=require(_0x365a('0x6'));var path=require(_0x365a('0x7'));var sox=require(_0x365a('0x8'));var csv=require(_0x365a('0x9'));var ejs=require(_0x365a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x365a('0xb'));var squel=require(_0x365a('0xc'));var crypto=require(_0x365a('0xd'));var jsforce=require(_0x365a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x365a('0x9'));var querystring=require(_0x365a('0xf'));var Papa=require('papaparse');var Redis=require(_0x365a('0x10'));var authService=require(_0x365a('0x11'));var qs=require(_0x365a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x365a('0x13'));var logger=require('../../config/logger')(_0x365a('0x14'));var utils=require(_0x365a('0x15'));var config=require(_0x365a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c8511,_0x572241){_0x572241=_0x572241||0xcc;return function(_0x28c1a1){if(_0x28c1a1){return _0x3c8511[_0x365a('0x17')](_0x572241);}return _0x3c8511[_0x365a('0x18')](_0x572241)['end']();};}function respondWithResult(_0x212608,_0x1cf4ac){_0x1cf4ac=_0x1cf4ac||0xc8;return function(_0xc0ef56){if(_0xc0ef56){return _0x212608[_0x365a('0x18')](_0x1cf4ac)[_0x365a('0x19')](_0xc0ef56);}};}function respondWithFilteredResult(_0x3bb7c7,_0x381078){return function(_0xba5588){if(_0xba5588){var _0x2f4a32=typeof _0x381078['offset']==='undefined'&&typeof _0x381078[_0x365a('0x1a')]===_0x365a('0x1b');var _0x4bed96=_0xba5588[_0x365a('0x1c')];var _0x3cf800=_0x2f4a32?0x0:_0x381078['offset'];var _0x4d7188=_0x2f4a32?_0xba5588[_0x365a('0x1c')]:_0x381078['offset']+_0x381078[_0x365a('0x1a')];var _0x20d842;if(_0x4d7188>=_0x4bed96){_0x4d7188=_0x4bed96;_0x20d842=0xc8;}else{_0x20d842=0xce;}_0x3bb7c7[_0x365a('0x18')](_0x20d842);return _0x3bb7c7[_0x365a('0x1d')]('Content-Range',_0x3cf800+'-'+_0x4d7188+'/'+_0x4bed96)['json'](_0xba5588);}return null;};}function patchUpdates(_0x4adfe4){return function(_0x11a2fc){try{jsonpatch[_0x365a('0x1e')](_0x11a2fc,_0x4adfe4,!![]);}catch(_0x291178){return BPromise[_0x365a('0x1f')](_0x291178);}return _0x11a2fc['save']();};}function saveUpdates(_0x3e1e3e,_0x509ae0){return function(_0x13ff4f){if(_0x13ff4f){return _0x13ff4f[_0x365a('0x20')](_0x3e1e3e)['then'](function(_0x20bc81){return _0x20bc81;});}return null;};}function removeEntity(_0x23abcf,_0x214040){return function(_0x5c8f76){if(_0x5c8f76){return _0x5c8f76[_0x365a('0x21')]()[_0x365a('0x22')](function(){_0x23abcf[_0x365a('0x18')](0xcc)[_0x365a('0x23')]();});}};}function handleEntityNotFound(_0x4f44eb,_0x40d99b){return function(_0x1e07ce){if(!_0x1e07ce){_0x4f44eb[_0x365a('0x17')](0x194);}return _0x1e07ce;};}function handleError(_0x46bc78,_0x2873e6){_0x2873e6=_0x2873e6||0x1f4;return function(_0x3c748b){logger[_0x365a('0x24')](_0x3c748b['stack']);if(_0x3c748b[_0x365a('0x25')]){delete _0x3c748b['name'];}_0x46bc78[_0x365a('0x18')](_0x2873e6)[_0x365a('0x26')](_0x3c748b);};}exports[_0x365a('0x27')]=function(_0xd52da7,_0x157897){var _0x1b6582={},_0x37d376={},_0x38ca9f={'count':0x0,'rows':[]};var _0xeedf6=_['map'](db[_0x365a('0x28')][_0x365a('0x29')],function(_0x15f149){return{'name':_0x15f149[_0x365a('0x2a')],'type':_0x15f149[_0x365a('0x2b')]['key']};});_0x37d376[_0x365a('0x2c')]=_[_0x365a('0x2d')](_0xeedf6,'name');_0x37d376[_0x365a('0x2e')]=_[_0x365a('0x2f')](_0xd52da7[_0x365a('0x2e')]);_0x37d376[_0x365a('0x30')]=_[_0x365a('0x31')](_0x37d376[_0x365a('0x2c')],_0x37d376[_0x365a('0x2e')]);_0x1b6582['attributes']=_['intersection'](_0x37d376[_0x365a('0x2c')],qs[_0x365a('0x32')](_0xd52da7[_0x365a('0x2e')][_0x365a('0x32')]));_0x1b6582['attributes']=_0x1b6582[_0x365a('0x33')][_0x365a('0x34')]?_0x1b6582[_0x365a('0x33')]:_0x37d376[_0x365a('0x2c')];if(!_0xd52da7[_0x365a('0x2e')]['hasOwnProperty'](_0x365a('0x35'))){_0x1b6582[_0x365a('0x1a')]=qs[_0x365a('0x1a')](_0xd52da7[_0x365a('0x2e')][_0x365a('0x1a')]);_0x1b6582['offset']=qs[_0x365a('0x36')](_0xd52da7[_0x365a('0x2e')][_0x365a('0x36')]);}_0x1b6582['order']=qs['sort'](_0xd52da7[_0x365a('0x2e')][_0x365a('0x37')]);_0x1b6582[_0x365a('0x38')]=qs[_0x365a('0x30')](_[_0x365a('0x39')](_0xd52da7[_0x365a('0x2e')],_0x37d376[_0x365a('0x30')]),_0xeedf6);if(_0xd52da7[_0x365a('0x2e')]['filter']){_0x1b6582[_0x365a('0x38')]=_[_0x365a('0x3a')](_0x1b6582['where'],{'$or':_[_0x365a('0x2d')](_0xeedf6,function(_0x247341){if(_0x247341[_0x365a('0x2b')]!==_0x365a('0x3b')){var _0xf5385e={};_0xf5385e[_0x247341['name']]={'$like':'%'+_0xd52da7[_0x365a('0x2e')]['filter']+'%'};return _0xf5385e;}})});}_0x1b6582=_[_0x365a('0x3a')]({},_0x1b6582,_0xd52da7[_0x365a('0x3c')]);var _0x425f5b={'where':_0x1b6582[_0x365a('0x38')]};return db[_0x365a('0x28')][_0x365a('0x1c')](_0x425f5b)[_0x365a('0x22')](function(_0x8eef7f){_0x38ca9f[_0x365a('0x1c')]=_0x8eef7f;if(_0xd52da7[_0x365a('0x2e')]['includeAll']){_0x1b6582['include']=[{'all':!![]}];}return db[_0x365a('0x28')][_0x365a('0x3d')](_0x1b6582);})[_0x365a('0x22')](function(_0x2e38cc){_0x38ca9f[_0x365a('0x3e')]=_0x2e38cc;return _0x38ca9f;})[_0x365a('0x22')](respondWithFilteredResult(_0x157897,_0x1b6582))['catch'](handleError(_0x157897,null));};exports[_0x365a('0x3f')]=function(_0x1967fb,_0x2f2b2e){var _0xed7718={'raw':![],'where':{'id':_0x1967fb[_0x365a('0x40')]['id']}},_0x3179e6={};_0x3179e6[_0x365a('0x2c')]=_['keys'](db[_0x365a('0x28')][_0x365a('0x29')]);_0x3179e6[_0x365a('0x2e')]=_[_0x365a('0x2f')](_0x1967fb[_0x365a('0x2e')]);_0x3179e6[_0x365a('0x30')]=_[_0x365a('0x31')](_0x3179e6['model'],_0x3179e6[_0x365a('0x2e')]);_0xed7718[_0x365a('0x33')]=_[_0x365a('0x31')](_0x3179e6[_0x365a('0x2c')],qs['fields'](_0x1967fb[_0x365a('0x2e')]['fields']));_0xed7718[_0x365a('0x33')]=_0xed7718['attributes']['length']?_0xed7718[_0x365a('0x33')]:_0x3179e6[_0x365a('0x2c')];if(_0x1967fb['query'][_0x365a('0x41')]){_0xed7718[_0x365a('0x42')]=[{'all':!![]}];}_0xed7718=_[_0x365a('0x3a')]({},_0xed7718,_0x1967fb[_0x365a('0x3c')]);return db[_0x365a('0x28')][_0x365a('0x43')](_0xed7718)[_0x365a('0x22')](handleEntityNotFound(_0x2f2b2e,null))['then'](respondWithResult(_0x2f2b2e,null))[_0x365a('0x44')](handleError(_0x2f2b2e,null));};exports[_0x365a('0x45')]=function(_0x4bccc4,_0x20d786){return db[_0x365a('0x28')][_0x365a('0x45')](_0x4bccc4[_0x365a('0x46')],{})[_0x365a('0x22')](respondWithResult(_0x20d786,0xc9))[_0x365a('0x44')](handleError(_0x20d786,null));};exports[_0x365a('0x20')]=function(_0x105068,_0xd96a57){if(_0x105068['body']['id']){delete _0x105068[_0x365a('0x46')]['id'];}return db[_0x365a('0x28')][_0x365a('0x43')]({'where':{'id':_0x105068['params']['id']}})['then'](handleEntityNotFound(_0xd96a57,null))['then'](saveUpdates(_0x105068[_0x365a('0x46')],null))[_0x365a('0x22')](respondWithResult(_0xd96a57,null))[_0x365a('0x44')](handleError(_0xd96a57,null));};exports[_0x365a('0x21')]=function(_0x244a00,_0x456077){return db[_0x365a('0x28')][_0x365a('0x43')]({'where':{'id':_0x244a00[_0x365a('0x40')]['id']}})['then'](handleEntityNotFound(_0x456077,null))[_0x365a('0x22')](removeEntity(_0x456077,null))[_0x365a('0x44')](handleError(_0x456077,null));};exports['getFields']=function(_0x3a135b,_0x2db094,_0x36d9ad){var _0x3d5276={};var _0x2e890d={};var _0x31e70d;var _0x16f544;return db[_0x365a('0x28')]['findOne']({'where':{'id':_0x3a135b[_0x365a('0x40')]['id']}})[_0x365a('0x22')](handleEntityNotFound(_0x2db094,null))[_0x365a('0x22')](function(_0x1fca5b){if(_0x1fca5b){_0x31e70d=_0x1fca5b;_0x2e890d[_0x365a('0x2c')]=_['keys'](db['Dynamics365Field'][_0x365a('0x29')]);_0x2e890d[_0x365a('0x2e')]=_[_0x365a('0x2f')](_0x3a135b['query']);_0x2e890d[_0x365a('0x30')]=_[_0x365a('0x31')](_0x2e890d[_0x365a('0x2c')],_0x2e890d[_0x365a('0x2e')]);_0x3d5276[_0x365a('0x33')]=_[_0x365a('0x31')](_0x2e890d['model'],qs[_0x365a('0x32')](_0x3a135b[_0x365a('0x2e')][_0x365a('0x32')]));_0x3d5276[_0x365a('0x33')]=_0x3d5276[_0x365a('0x33')][_0x365a('0x34')]?_0x3d5276['attributes']:_0x2e890d[_0x365a('0x2c')];_0x3d5276[_0x365a('0x47')]=qs[_0x365a('0x37')](_0x3a135b[_0x365a('0x2e')]['sort']);_0x3d5276[_0x365a('0x38')]=qs['filters'](_[_0x365a('0x39')](_0x3a135b[_0x365a('0x2e')],_0x2e890d['filters']));if(_0x3a135b[_0x365a('0x2e')][_0x365a('0x48')]){_0x3d5276[_0x365a('0x38')]=_['merge'](_0x3d5276[_0x365a('0x38')],{'$or':_[_0x365a('0x2d')](_0x3d5276[_0x365a('0x33')],function(_0x525f7d){var _0x390753={};_0x390753[_0x525f7d]={'$like':'%'+_0x3a135b[_0x365a('0x2e')][_0x365a('0x48')]+'%'};return _0x390753;})});}_0x3d5276=_[_0x365a('0x3a')]({},_0x3d5276,_0x3a135b[_0x365a('0x3c')]);return _0x31e70d['getFields'](_0x3d5276);}})[_0x365a('0x22')](function(_0x8b2c83){if(_0x8b2c83){_0x16f544=_0x8b2c83['length'];if(!_0x3a135b[_0x365a('0x2e')][_0x365a('0x49')](_0x365a('0x35'))){_0x3d5276[_0x365a('0x1a')]=qs[_0x365a('0x1a')](_0x3a135b[_0x365a('0x2e')][_0x365a('0x1a')]);_0x3d5276[_0x365a('0x36')]=qs['offset'](_0x3a135b[_0x365a('0x2e')]['offset']);}return _0x31e70d[_0x365a('0x4a')](_0x3d5276);}})[_0x365a('0x22')](function(_0xc9a056){if(_0xc9a056){return _0xc9a056?{'count':_0x16f544,'rows':_0xc9a056}:null;}})['then'](respondWithResult(_0x2db094,null))['catch'](handleError(_0x2db094,null));};exports[_0x365a('0x4b')]=function(_0x193119,_0x1b3d2f,_0x537297){var _0xf7ea63={};var _0x1abfaf={};var _0x4a049d;var _0x351059;return db[_0x365a('0x28')][_0x365a('0x4c')]({'where':{'id':_0x193119['params']['id']}})[_0x365a('0x22')](handleEntityNotFound(_0x1b3d2f,null))[_0x365a('0x22')](function(_0xbfe4a7){if(_0xbfe4a7){_0x4a049d=_0xbfe4a7;_0x1abfaf[_0x365a('0x2c')]=_[_0x365a('0x2f')](db[_0x365a('0x4d')][_0x365a('0x29')]);_0x1abfaf['query']=_[_0x365a('0x2f')](_0x193119[_0x365a('0x2e')]);_0x1abfaf[_0x365a('0x30')]=_[_0x365a('0x31')](_0x1abfaf[_0x365a('0x2c')],_0x1abfaf[_0x365a('0x2e')]);_0xf7ea63[_0x365a('0x33')]=_[_0x365a('0x31')](_0x1abfaf[_0x365a('0x2c')],qs[_0x365a('0x32')](_0x193119[_0x365a('0x2e')][_0x365a('0x32')]));_0xf7ea63[_0x365a('0x33')]=_0xf7ea63[_0x365a('0x33')]['length']?_0xf7ea63[_0x365a('0x33')]:_0x1abfaf[_0x365a('0x2c')];_0xf7ea63['order']=qs[_0x365a('0x37')](_0x193119[_0x365a('0x2e')]['sort']);_0xf7ea63[_0x365a('0x38')]=qs[_0x365a('0x30')](_[_0x365a('0x39')](_0x193119['query'],_0x1abfaf[_0x365a('0x30')]));if(_0x193119[_0x365a('0x2e')][_0x365a('0x48')]){_0xf7ea63[_0x365a('0x38')]=_[_0x365a('0x3a')](_0xf7ea63[_0x365a('0x38')],{'$or':_['map'](_0xf7ea63[_0x365a('0x33')],function(_0x3aed1e){var _0x5117ee={};_0x5117ee[_0x3aed1e]={'$like':'%'+_0x193119['query'][_0x365a('0x48')]+'%'};return _0x5117ee;})});}_0xf7ea63=_['merge']({},_0xf7ea63,_0x193119[_0x365a('0x3c')]);return _0x4a049d['getSubjects'](_0xf7ea63);}})[_0x365a('0x22')](function(_0x3ce6e8){if(_0x3ce6e8){_0x351059=_0x3ce6e8[_0x365a('0x34')];if(!_0x193119[_0x365a('0x2e')][_0x365a('0x49')](_0x365a('0x35'))){_0xf7ea63[_0x365a('0x1a')]=qs['limit'](_0x193119['query'][_0x365a('0x1a')]);_0xf7ea63['offset']=qs[_0x365a('0x36')](_0x193119[_0x365a('0x2e')]['offset']);}return _0x4a049d[_0x365a('0x4b')](_0xf7ea63);}})[_0x365a('0x22')](function(_0x13b6b4){if(_0x13b6b4){return _0x13b6b4?{'count':_0x351059,'rows':_0x13b6b4}:null;}})[_0x365a('0x22')](respondWithResult(_0x1b3d2f,null))[_0x365a('0x44')](handleError(_0x1b3d2f,null));};exports[_0x365a('0x4e')]=function(_0x20934a,_0x329063,_0x53cf47){var _0x58de47={};var _0x36eb87={};var _0x4c075c;var _0xee79ab;return db[_0x365a('0x28')][_0x365a('0x4c')]({'where':{'id':_0x20934a[_0x365a('0x40')]['id']}})[_0x365a('0x22')](handleEntityNotFound(_0x329063,null))[_0x365a('0x22')](function(_0x3813e2){if(_0x3813e2){_0x4c075c=_0x3813e2;_0x36eb87[_0x365a('0x2c')]=_[_0x365a('0x2f')](db['Dynamics365Field']['rawAttributes']);_0x36eb87[_0x365a('0x2e')]=_[_0x365a('0x2f')](_0x20934a[_0x365a('0x2e')]);_0x36eb87[_0x365a('0x30')]=_[_0x365a('0x31')](_0x36eb87[_0x365a('0x2c')],_0x36eb87[_0x365a('0x2e')]);_0x58de47[_0x365a('0x33')]=_[_0x365a('0x31')](_0x36eb87[_0x365a('0x2c')],qs[_0x365a('0x32')](_0x20934a[_0x365a('0x2e')][_0x365a('0x32')]));_0x58de47['attributes']=_0x58de47[_0x365a('0x33')]['length']?_0x58de47[_0x365a('0x33')]:_0x36eb87[_0x365a('0x2c')];_0x58de47[_0x365a('0x47')]=qs['sort'](_0x20934a[_0x365a('0x2e')][_0x365a('0x37')]);_0x58de47[_0x365a('0x38')]=qs[_0x365a('0x30')](_[_0x365a('0x39')](_0x20934a[_0x365a('0x2e')],_0x36eb87[_0x365a('0x30')]));if(_0x20934a[_0x365a('0x2e')][_0x365a('0x48')]){_0x58de47[_0x365a('0x38')]=_[_0x365a('0x3a')](_0x58de47[_0x365a('0x38')],{'$or':_[_0x365a('0x2d')](_0x58de47[_0x365a('0x33')],function(_0x570608){var _0x23df8d={};_0x23df8d[_0x570608]={'$like':'%'+_0x20934a[_0x365a('0x2e')][_0x365a('0x48')]+'%'};return _0x23df8d;})});}_0x58de47=_['merge']({},_0x58de47,_0x20934a['options']);return _0x4c075c['getDescriptions'](_0x58de47);}})['then'](function(_0x559cc8){if(_0x559cc8){_0xee79ab=_0x559cc8[_0x365a('0x34')];if(!_0x20934a[_0x365a('0x2e')][_0x365a('0x49')](_0x365a('0x35'))){_0x58de47[_0x365a('0x1a')]=qs['limit'](_0x20934a[_0x365a('0x2e')][_0x365a('0x1a')]);_0x58de47[_0x365a('0x36')]=qs[_0x365a('0x36')](_0x20934a[_0x365a('0x2e')][_0x365a('0x36')]);}return _0x4c075c['getDescriptions'](_0x58de47);}})['then'](function(_0xbf0041){if(_0xbf0041){return _0xbf0041?{'count':_0xee79ab,'rows':_0xbf0041}:null;}})[_0x365a('0x22')](respondWithResult(_0x329063,null))['catch'](handleError(_0x329063,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 4783a0a..c77ed92 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 _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3a4318,_0x13c6eb){_0x3a4318=_0x3a4318-0x0;var _0x36d746=_0x4b84[_0x3a4318];return _0x36d746;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x26406b,_0x28c1f4){var _0x2872f5=function(_0x58dae7){while(--_0x58dae7){_0x26406b['push'](_0x26406b['shift']());}};_0x2872f5(++_0x28c1f4);}(_0xb821,0xa7));var _0x1b82=function(_0x30c22e,_0x3f56d0){_0x30c22e=_0x30c22e-0x0;var _0xe5168c=_0xb821[_0x30c22e];return _0xe5168c;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 1d4ccb3..df4c5a0 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 _0x532d=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42a8d9,_0x46388a){var _0xa9e717=function(_0x271296){while(--_0x271296){_0x42a8d9['push'](_0x42a8d9['shift']());}};_0xa9e717(++_0x46388a);}(_0x532d,0x12d));var _0xd532=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x532d[_0x4bb2b9];return _0x40e2a2;};'use strict';var _=require(_0xd532('0x0'));var util=require(_0xd532('0x1'));var moment=require(_0xd532('0x2'));var BPromise=require(_0xd532('0x3'));var rs=require(_0xd532('0x4'));var fs=require('fs');var Redis=require(_0xd532('0x5'));var db=require(_0xd532('0x6'))['db'];var utils=require(_0xd532('0x7'));var logger=require(_0xd532('0x8'))(_0xd532('0x9'));var config=require(_0xd532('0xa'));var jayson=require(_0xd532('0xb'));var client=jayson[_0xd532('0xc')][_0xd532('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x44aa10,_0x1f57e3,_0x4b48f4){return new BPromise(function(_0x5f3ee0,_0x410d93){return client[_0xd532('0xe')](_0x44aa10,_0x4b48f4)[_0xd532('0xf')](function(_0x1641c6){logger[_0xd532('0x10')](_0xd532('0x11'),_0x1f57e3,_0xd532('0x12'));logger[_0xd532('0x13')](_0xd532('0x14'),_0x1f57e3,_0xd532('0x12'),JSON[_0xd532('0x15')](_0x1641c6));if(_0x1641c6['error']){if(_0x1641c6[_0xd532('0x16')][_0xd532('0x17')]===0x1f4){logger[_0xd532('0x16')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1f57e3,_0x1641c6[_0xd532('0x16')][_0xd532('0x18')]);return _0x410d93(_0x1641c6[_0xd532('0x16')][_0xd532('0x18')]);}logger[_0xd532('0x16')](_0xd532('0x11'),_0x1f57e3,_0x1641c6['error']['message']);return _0x5f3ee0(_0x1641c6['error']['message']);}else{logger['info'](_0xd532('0x11'),_0x1f57e3,'request\x20sent');_0x5f3ee0(_0x1641c6[_0xd532('0x19')][_0xd532('0x18')]);}})[_0xd532('0x1a')](function(_0x984f8d){logger[_0xd532('0x16')](_0xd532('0x11'),_0x1f57e3,_0x984f8d);_0x410d93(_0x984f8d);});});} \ No newline at end of file +var _0xbd5f=['message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x161a5b,_0x385ab9){var _0x1bdba8=function(_0x3dae52){while(--_0x3dae52){_0x161a5b['push'](_0x161a5b['shift']());}};_0x1bdba8(++_0x385ab9);}(_0xbd5f,0x1cc));var _0xfbd5=function(_0x2dbfa3,_0x3c4261){_0x2dbfa3=_0x2dbfa3-0x0;var _0x1f6e73=_0xbd5f[_0x2dbfa3];return _0x1f6e73;};'use strict';var _=require(_0xfbd5('0x0'));var util=require(_0xfbd5('0x1'));var moment=require(_0xfbd5('0x2'));var BPromise=require(_0xfbd5('0x3'));var rs=require(_0xfbd5('0x4'));var fs=require('fs');var Redis=require(_0xfbd5('0x5'));var db=require(_0xfbd5('0x6'))['db'];var utils=require(_0xfbd5('0x7'));var logger=require(_0xfbd5('0x8'))(_0xfbd5('0x9'));var config=require(_0xfbd5('0xa'));var jayson=require(_0xfbd5('0xb'));var client=jayson[_0xfbd5('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b51c1,_0x4219d8,_0x5e6cdc){return new BPromise(function(_0x4bb2ee,_0x57ac28){return client[_0xfbd5('0xd')](_0x5b51c1,_0x5e6cdc)[_0xfbd5('0xe')](function(_0xd6c2f6){logger[_0xfbd5('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4219d8,_0xfbd5('0x10'));logger[_0xfbd5('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4219d8,_0xfbd5('0x10'),JSON[_0xfbd5('0x12')](_0xd6c2f6));if(_0xd6c2f6[_0xfbd5('0x13')]){if(_0xd6c2f6[_0xfbd5('0x13')]['code']===0x1f4){logger[_0xfbd5('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4219d8,_0xd6c2f6[_0xfbd5('0x13')][_0xfbd5('0x14')]);return _0x57ac28(_0xd6c2f6[_0xfbd5('0x13')][_0xfbd5('0x14')]);}logger[_0xfbd5('0x13')](_0xfbd5('0x15'),_0x4219d8,_0xd6c2f6['error'][_0xfbd5('0x14')]);return _0x4bb2ee(_0xd6c2f6[_0xfbd5('0x13')][_0xfbd5('0x14')]);}else{logger[_0xfbd5('0xf')](_0xfbd5('0x15'),_0x4219d8,_0xfbd5('0x10'));_0x4bb2ee(_0xd6c2f6[_0xfbd5('0x16')][_0xfbd5('0x14')]);}})[_0xfbd5('0x17')](function(_0x1ddd9b){logger[_0xfbd5('0x13')](_0xfbd5('0x15'),_0x4219d8,_0x1ddd9b);_0x57ac28(_0x1ddd9b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 6f0d060..95c641b 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 _0xd715=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x8a0d74,_0xf1abaf){var _0x37c67a=function(_0x28194d){while(--_0x28194d){_0x8a0d74['push'](_0x8a0d74['shift']());}};_0x37c67a(++_0xf1abaf);}(_0xd715,0x91));var _0x5d71=function(_0x2f2fb4,_0x1b02eb){_0x2f2fb4=_0x2f2fb4-0x0;var _0x179780=_0xd715[_0x2f2fb4];return _0x179780;};'use strict';var multer=require('multer');var util=require(_0x5d71('0x0'));var path=require('path');var timeout=require(_0x5d71('0x1'));var express=require(_0x5d71('0x2'));var router=express[_0x5d71('0x3')]();var fs_extra=require(_0x5d71('0x4'));var auth=require(_0x5d71('0x5'));var interaction=require(_0x5d71('0x6'));var config=require(_0x5d71('0x7'));var controller=require(_0x5d71('0x8'));router[_0x5d71('0x9')]('/',auth[_0x5d71('0xa')](),controller[_0x5d71('0xb')]);router[_0x5d71('0x9')](_0x5d71('0xc'),auth[_0x5d71('0xa')](),controller[_0x5d71('0xd')]);router[_0x5d71('0xe')]('/',auth['isAuthenticated'](),controller[_0x5d71('0xf')]);router['put'](_0x5d71('0xc'),auth[_0x5d71('0xa')](),controller['update']);router[_0x5d71('0x10')](_0x5d71('0xc'),auth['isAuthenticated'](),controller[_0x5d71('0x11')]);module[_0x5d71('0x12')]=router; \ No newline at end of file +var _0x31dc=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x4bf7ff,_0x53004b){var _0x35ffb3=function(_0x5a281e){while(--_0x5a281e){_0x4bf7ff['push'](_0x4bf7ff['shift']());}};_0x35ffb3(++_0x53004b);}(_0x31dc,0x1d8));var _0xc31d=function(_0x387b20,_0xaaa8d8){_0x387b20=_0x387b20-0x0;var _0x201e64=_0x31dc[_0x387b20];return _0x201e64;};'use strict';var multer=require(_0xc31d('0x0'));var util=require(_0xc31d('0x1'));var path=require(_0xc31d('0x2'));var timeout=require(_0xc31d('0x3'));var express=require(_0xc31d('0x4'));var router=express[_0xc31d('0x5')]();var fs_extra=require(_0xc31d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc31d('0x7'));var config=require('../../config/environment');var controller=require(_0xc31d('0x8'));router[_0xc31d('0x9')]('/',auth[_0xc31d('0xa')](),controller[_0xc31d('0xb')]);router[_0xc31d('0x9')](_0xc31d('0xc'),auth['isAuthenticated'](),controller[_0xc31d('0xd')]);router[_0xc31d('0xe')]('/',auth[_0xc31d('0xa')](),controller[_0xc31d('0xf')]);router[_0xc31d('0x10')](_0xc31d('0xc'),auth[_0xc31d('0xa')](),controller['update']);router[_0xc31d('0x11')](_0xc31d('0xc'),auth[_0xc31d('0xa')](),controller['destroy']);module[_0xc31d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 32129be..34c207e 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 _0x46e0=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x46e0,0x18f));var _0x046e=function(_0x4ed4b8,_0x226c53){_0x4ed4b8=_0x4ed4b8-0x0;var _0x5a187b=_0x46e0[_0x4ed4b8];return _0x5a187b;};'use strict';var Sequelize=require(_0x046e('0x0'));module[_0x046e('0x1')]={'type':{'type':Sequelize[_0x046e('0x2')](_0x046e('0x3'),'variable','customVariable',_0x046e('0x4'),_0x046e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x046e('0x6')]},'key':{'type':Sequelize[_0x046e('0x6')]},'keyType':{'type':Sequelize[_0x046e('0x2')](_0x046e('0x3'),_0x046e('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x046e('0x6')]},'idField':{'type':Sequelize[_0x046e('0x6')]},'nameField':{'type':Sequelize[_0x046e('0x6')]},'customField':{'type':Sequelize[_0x046e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x046e('0x6')]}}; \ No newline at end of file +var _0x2bfc=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0xbf083d,_0x193129){var _0x5c378e=function(_0x1ac347){while(--_0x1ac347){_0xbf083d['push'](_0xbf083d['shift']());}};_0x5c378e(++_0x193129);}(_0x2bfc,0x1bb));var _0xc2bf=function(_0x11a576,_0x4cd903){_0x11a576=_0x11a576-0x0;var _0xc80fdf=_0x2bfc[_0x11a576];return _0xc80fdf;};'use strict';var Sequelize=require(_0xc2bf('0x0'));module[_0xc2bf('0x1')]={'type':{'type':Sequelize[_0xc2bf('0x2')](_0xc2bf('0x3'),_0xc2bf('0x4'),_0xc2bf('0x5'),_0xc2bf('0x6'),'picklist'),'defaultValue':_0xc2bf('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc2bf('0x7')]},'keyType':{'type':Sequelize[_0xc2bf('0x2')](_0xc2bf('0x3'),_0xc2bf('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xc2bf('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc2bf('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc2bf('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9a21e44..4773bb5 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 _0x51c1=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','model','name','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','length','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x248155,_0x27c15f){var _0x4deac9=function(_0x307dee){while(--_0x307dee){_0x248155['push'](_0x248155['shift']());}};_0x4deac9(++_0x27c15f);}(_0x51c1,0x7d));var _0x151c=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x51c1[_0x532112];return _0x23e5fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x151c('0x0'));var zipdir=require(_0x151c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x151c('0x2'));var moment=require(_0x151c('0x3'));var BPromise=require(_0x151c('0x4'));var Mustache=require(_0x151c('0x5'));var util=require(_0x151c('0x6'));var path=require(_0x151c('0x7'));var sox=require(_0x151c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x151c('0x9'));var jsforce=require(_0x151c('0xa'));var deskjs=require(_0x151c('0xb'));var toCsv=require(_0x151c('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x151c('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x151c('0xe'));var hardwareService=require(_0x151c('0xf'));var logger=require(_0x151c('0x10'))(_0x151c('0x11'));var utils=require(_0x151c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x151c('0x13'));var db=require(_0x151c('0x14'))['db'];function respondWithStatusCode(_0x2694d3,_0x1a6780){_0x1a6780=_0x1a6780||0xcc;return function(_0x2a61f7){if(_0x2a61f7){return _0x2694d3[_0x151c('0x15')](_0x1a6780);}return _0x2694d3[_0x151c('0x16')](_0x1a6780)[_0x151c('0x17')]();};}function respondWithResult(_0x323c0a,_0x5606c7){_0x5606c7=_0x5606c7||0xc8;return function(_0xd7e6a0){if(_0xd7e6a0){return _0x323c0a[_0x151c('0x16')](_0x5606c7)[_0x151c('0x18')](_0xd7e6a0);}};}function respondWithFilteredResult(_0x5ecb3c,_0x9b7280){return function(_0x39d2e8){if(_0x39d2e8){var _0x519a53=typeof _0x9b7280[_0x151c('0x19')]==='undefined'&&typeof _0x9b7280[_0x151c('0x1a')]===_0x151c('0x1b');var _0x5d6870=_0x39d2e8[_0x151c('0x1c')];var _0x48d639=_0x519a53?0x0:_0x9b7280[_0x151c('0x19')];var _0x272ba3=_0x519a53?_0x39d2e8['count']:_0x9b7280[_0x151c('0x19')]+_0x9b7280['limit'];var _0x5d2460;if(_0x272ba3>=_0x5d6870){_0x272ba3=_0x5d6870;_0x5d2460=0xc8;}else{_0x5d2460=0xce;}_0x5ecb3c[_0x151c('0x16')](_0x5d2460);return _0x5ecb3c[_0x151c('0x1d')](_0x151c('0x1e'),_0x48d639+'-'+_0x272ba3+'/'+_0x5d6870)[_0x151c('0x18')](_0x39d2e8);}return null;};}function patchUpdates(_0x3cbdf3){return function(_0xba1862){try{jsonpatch[_0x151c('0x1f')](_0xba1862,_0x3cbdf3,!![]);}catch(_0x43e428){return BPromise['reject'](_0x43e428);}return _0xba1862[_0x151c('0x20')]();};}function saveUpdates(_0x2db570,_0x5bffa1){return function(_0x24c662){if(_0x24c662){return _0x24c662[_0x151c('0x21')](_0x2db570)[_0x151c('0x22')](function(_0x1a548a){return _0x1a548a;});}return null;};}function removeEntity(_0x1abcf6,_0x941323){return function(_0x5167e2){if(_0x5167e2){return _0x5167e2[_0x151c('0x23')]()[_0x151c('0x22')](function(){_0x1abcf6[_0x151c('0x16')](0xcc)[_0x151c('0x17')]();});}};}function handleEntityNotFound(_0x573a0f,_0x5d9fd8){return function(_0x1ba598){if(!_0x1ba598){_0x573a0f[_0x151c('0x15')](0x194);}return _0x1ba598;};}function handleError(_0x395fcc,_0x4d21de){_0x4d21de=_0x4d21de||0x1f4;return function(_0x3540b8){logger[_0x151c('0x24')](_0x3540b8[_0x151c('0x25')]);if(_0x3540b8['name']){delete _0x3540b8['name'];}_0x395fcc[_0x151c('0x16')](_0x4d21de)[_0x151c('0x26')](_0x3540b8);};}exports[_0x151c('0x27')]=function(_0x288ed7,_0x5c105b){var _0x3434a7={},_0x522fe2={},_0x5a5529={'count':0x0,'rows':[]};var _0x30d0b0=_[_0x151c('0x28')](db[_0x151c('0x29')][_0x151c('0x2a')],function(_0x4bfdb8){return{'name':_0x4bfdb8[_0x151c('0x2b')],'type':_0x4bfdb8[_0x151c('0x2c')]['key']};});_0x522fe2[_0x151c('0x2d')]=_[_0x151c('0x28')](_0x30d0b0,_0x151c('0x2e'));_0x522fe2[_0x151c('0x2f')]=_['keys'](_0x288ed7['query']);_0x522fe2[_0x151c('0x30')]=_['intersection'](_0x522fe2[_0x151c('0x2d')],_0x522fe2[_0x151c('0x2f')]);_0x3434a7[_0x151c('0x31')]=_[_0x151c('0x32')](_0x522fe2[_0x151c('0x2d')],qs[_0x151c('0x33')](_0x288ed7[_0x151c('0x2f')][_0x151c('0x33')]));_0x3434a7[_0x151c('0x31')]=_0x3434a7['attributes']['length']?_0x3434a7['attributes']:_0x522fe2[_0x151c('0x2d')];if(!_0x288ed7[_0x151c('0x2f')][_0x151c('0x34')](_0x151c('0x35'))){_0x3434a7[_0x151c('0x1a')]=qs[_0x151c('0x1a')](_0x288ed7['query']['limit']);_0x3434a7['offset']=qs[_0x151c('0x19')](_0x288ed7[_0x151c('0x2f')][_0x151c('0x19')]);}_0x3434a7['order']=qs[_0x151c('0x36')](_0x288ed7['query'][_0x151c('0x36')]);_0x3434a7[_0x151c('0x37')]=qs[_0x151c('0x30')](_['pick'](_0x288ed7[_0x151c('0x2f')],_0x522fe2[_0x151c('0x30')]),_0x30d0b0);if(_0x288ed7['query']['filter']){_0x3434a7[_0x151c('0x37')]=_[_0x151c('0x38')](_0x3434a7[_0x151c('0x37')],{'$or':_['map'](_0x30d0b0,function(_0x5504b3){if(_0x5504b3[_0x151c('0x2c')]!==_0x151c('0x39')){var _0x5c0510={};_0x5c0510[_0x5504b3[_0x151c('0x2e')]]={'$like':'%'+_0x288ed7['query'][_0x151c('0x3a')]+'%'};return _0x5c0510;}})});}_0x3434a7=_[_0x151c('0x38')]({},_0x3434a7,_0x288ed7[_0x151c('0x3b')]);var _0x49843a={'where':_0x3434a7[_0x151c('0x37')]};return db[_0x151c('0x29')][_0x151c('0x1c')](_0x49843a)[_0x151c('0x22')](function(_0x1aa755){_0x5a5529[_0x151c('0x1c')]=_0x1aa755;if(_0x288ed7['query']['includeAll']){_0x3434a7[_0x151c('0x3c')]=[{'all':!![]}];}return db[_0x151c('0x29')][_0x151c('0x3d')](_0x3434a7);})[_0x151c('0x22')](function(_0x2f9480){_0x5a5529[_0x151c('0x3e')]=_0x2f9480;return _0x5a5529;})[_0x151c('0x22')](respondWithFilteredResult(_0x5c105b,_0x3434a7))[_0x151c('0x3f')](handleError(_0x5c105b,null));};exports[_0x151c('0x40')]=function(_0x57bb03,_0x4f5129){var _0x39df71={'raw':!![],'where':{'id':_0x57bb03[_0x151c('0x41')]['id']}},_0x2159b6={};_0x2159b6[_0x151c('0x2d')]=_[_0x151c('0x42')](db[_0x151c('0x29')][_0x151c('0x2a')]);_0x2159b6['query']=_[_0x151c('0x42')](_0x57bb03['query']);_0x2159b6[_0x151c('0x30')]=_[_0x151c('0x32')](_0x2159b6[_0x151c('0x2d')],_0x2159b6[_0x151c('0x2f')]);_0x39df71['attributes']=_[_0x151c('0x32')](_0x2159b6[_0x151c('0x2d')],qs[_0x151c('0x33')](_0x57bb03[_0x151c('0x2f')][_0x151c('0x33')]));_0x39df71[_0x151c('0x31')]=_0x39df71[_0x151c('0x31')][_0x151c('0x43')]?_0x39df71['attributes']:_0x2159b6[_0x151c('0x2d')];if(_0x57bb03[_0x151c('0x2f')]['includeAll']){_0x39df71['include']=[{'all':!![]}];}_0x39df71=_[_0x151c('0x38')]({},_0x39df71,_0x57bb03['options']);return db[_0x151c('0x29')]['find'](_0x39df71)[_0x151c('0x22')](handleEntityNotFound(_0x4f5129,null))[_0x151c('0x22')](respondWithResult(_0x4f5129,null))[_0x151c('0x3f')](handleError(_0x4f5129,null));};exports[_0x151c('0x44')]=function(_0x496c86,_0x26a683){return db['Dynamics365Field'][_0x151c('0x44')](_0x496c86[_0x151c('0x45')],{})['then'](respondWithResult(_0x26a683,0xc9))[_0x151c('0x3f')](handleError(_0x26a683,null));};exports[_0x151c('0x21')]=function(_0x2afa96,_0x131e50){if(_0x2afa96[_0x151c('0x45')]['id']){delete _0x2afa96[_0x151c('0x45')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x2afa96[_0x151c('0x41')]['id']}})[_0x151c('0x22')](handleEntityNotFound(_0x131e50,null))[_0x151c('0x22')](saveUpdates(_0x2afa96[_0x151c('0x45')],null))[_0x151c('0x22')](respondWithResult(_0x131e50,null))[_0x151c('0x3f')](handleError(_0x131e50,null));};exports[_0x151c('0x23')]=function(_0x1ed5be,_0x452bef){return db[_0x151c('0x29')][_0x151c('0x46')]({'where':{'id':_0x1ed5be['params']['id']}})[_0x151c('0x22')](handleEntityNotFound(_0x452bef,null))[_0x151c('0x22')](removeEntity(_0x452bef,null))[_0x151c('0x3f')](handleError(_0x452bef,null));}; \ No newline at end of file +var _0x6dda=['fieldName','type','key','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','model','includeAll','find','catch','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','stack','name','index','map','Dynamics365Field','rawAttributes'];(function(_0x251651,_0x34f766){var _0x47a490=function(_0x2ab41a){while(--_0x2ab41a){_0x251651['push'](_0x251651['shift']());}};_0x47a490(++_0x34f766);}(_0x6dda,0x6a));var _0xa6dd=function(_0x15398b,_0xa9ef60){_0x15398b=_0x15398b-0x0;var _0x55e7db=_0x6dda[_0x15398b];return _0x55e7db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6dd('0x0'));var zipdir=require(_0xa6dd('0x1'));var jsonpatch=require(_0xa6dd('0x2'));var rp=require(_0xa6dd('0x3'));var moment=require(_0xa6dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa6dd('0x5'));var util=require(_0xa6dd('0x6'));var path=require(_0xa6dd('0x7'));var sox=require(_0xa6dd('0x8'));var csv=require(_0xa6dd('0x9'));var ejs=require(_0xa6dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6dd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa6dd('0xc'));var deskjs=require(_0xa6dd('0xd'));var toCsv=require(_0xa6dd('0x9'));var querystring=require(_0xa6dd('0xe'));var Papa=require(_0xa6dd('0xf'));var Redis=require(_0xa6dd('0x10'));var authService=require(_0xa6dd('0x11'));var qs=require(_0xa6dd('0x12'));var as=require(_0xa6dd('0x13'));var hardwareService=require(_0xa6dd('0x14'));var logger=require(_0xa6dd('0x15'))('api');var utils=require(_0xa6dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa6dd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5764b3,_0xf90efe){_0xf90efe=_0xf90efe||0xcc;return function(_0xa0ca42){if(_0xa0ca42){return _0x5764b3[_0xa6dd('0x18')](_0xf90efe);}return _0x5764b3[_0xa6dd('0x19')](_0xf90efe)[_0xa6dd('0x1a')]();};}function respondWithResult(_0x337e1d,_0x121f7d){_0x121f7d=_0x121f7d||0xc8;return function(_0x1f3639){if(_0x1f3639){return _0x337e1d[_0xa6dd('0x19')](_0x121f7d)['json'](_0x1f3639);}};}function respondWithFilteredResult(_0x19bff7,_0x56a3b2){return function(_0x1dae25){if(_0x1dae25){var _0x3f74f6=typeof _0x56a3b2[_0xa6dd('0x1b')]===_0xa6dd('0x1c')&&typeof _0x56a3b2[_0xa6dd('0x1d')]===_0xa6dd('0x1c');var _0x521941=_0x1dae25[_0xa6dd('0x1e')];var _0x2b3d2b=_0x3f74f6?0x0:_0x56a3b2[_0xa6dd('0x1b')];var _0x49342c=_0x3f74f6?_0x1dae25[_0xa6dd('0x1e')]:_0x56a3b2[_0xa6dd('0x1b')]+_0x56a3b2['limit'];var _0x5784e;if(_0x49342c>=_0x521941){_0x49342c=_0x521941;_0x5784e=0xc8;}else{_0x5784e=0xce;}_0x19bff7['status'](_0x5784e);return _0x19bff7[_0xa6dd('0x1f')](_0xa6dd('0x20'),_0x2b3d2b+'-'+_0x49342c+'/'+_0x521941)[_0xa6dd('0x21')](_0x1dae25);}return null;};}function patchUpdates(_0x26a247){return function(_0x4b8cdc){try{jsonpatch[_0xa6dd('0x22')](_0x4b8cdc,_0x26a247,!![]);}catch(_0x1e935e){return BPromise['reject'](_0x1e935e);}return _0x4b8cdc[_0xa6dd('0x23')]();};}function saveUpdates(_0x3f3dc1,_0xd36476){return function(_0x77aafb){if(_0x77aafb){return _0x77aafb['update'](_0x3f3dc1)[_0xa6dd('0x24')](function(_0x4ce55e){return _0x4ce55e;});}return null;};}function removeEntity(_0x404e6e,_0x370d8b){return function(_0xc879){if(_0xc879){return _0xc879[_0xa6dd('0x25')]()[_0xa6dd('0x24')](function(){_0x404e6e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x198619,_0x1faaa1){return function(_0x3760d1){if(!_0x3760d1){_0x198619[_0xa6dd('0x18')](0x194);}return _0x3760d1;};}function handleError(_0x5cd33c,_0x3de76b){_0x3de76b=_0x3de76b||0x1f4;return function(_0x3d16c7){logger['error'](_0x3d16c7[_0xa6dd('0x26')]);if(_0x3d16c7[_0xa6dd('0x27')]){delete _0x3d16c7[_0xa6dd('0x27')];}_0x5cd33c[_0xa6dd('0x19')](_0x3de76b)['send'](_0x3d16c7);};}exports[_0xa6dd('0x28')]=function(_0xf7ed7e,_0x4349c9){var _0x5127d9={},_0x5acc24={},_0x2ed717={'count':0x0,'rows':[]};var _0x3a1a7c=_[_0xa6dd('0x29')](db[_0xa6dd('0x2a')][_0xa6dd('0x2b')],function(_0x546292){return{'name':_0x546292[_0xa6dd('0x2c')],'type':_0x546292[_0xa6dd('0x2d')][_0xa6dd('0x2e')]};});_0x5acc24['model']=_[_0xa6dd('0x29')](_0x3a1a7c,_0xa6dd('0x27'));_0x5acc24['query']=_[_0xa6dd('0x2f')](_0xf7ed7e['query']);_0x5acc24[_0xa6dd('0x30')]=_[_0xa6dd('0x31')](_0x5acc24['model'],_0x5acc24[_0xa6dd('0x32')]);_0x5127d9[_0xa6dd('0x33')]=_[_0xa6dd('0x31')](_0x5acc24['model'],qs['fields'](_0xf7ed7e[_0xa6dd('0x32')][_0xa6dd('0x34')]));_0x5127d9['attributes']=_0x5127d9[_0xa6dd('0x33')][_0xa6dd('0x35')]?_0x5127d9[_0xa6dd('0x33')]:_0x5acc24['model'];if(!_0xf7ed7e['query'][_0xa6dd('0x36')](_0xa6dd('0x37'))){_0x5127d9[_0xa6dd('0x1d')]=qs['limit'](_0xf7ed7e[_0xa6dd('0x32')][_0xa6dd('0x1d')]);_0x5127d9[_0xa6dd('0x1b')]=qs['offset'](_0xf7ed7e[_0xa6dd('0x32')][_0xa6dd('0x1b')]);}_0x5127d9['order']=qs[_0xa6dd('0x38')](_0xf7ed7e[_0xa6dd('0x32')]['sort']);_0x5127d9[_0xa6dd('0x39')]=qs[_0xa6dd('0x30')](_[_0xa6dd('0x3a')](_0xf7ed7e[_0xa6dd('0x32')],_0x5acc24[_0xa6dd('0x30')]),_0x3a1a7c);if(_0xf7ed7e['query'][_0xa6dd('0x3b')]){_0x5127d9[_0xa6dd('0x39')]=_[_0xa6dd('0x3c')](_0x5127d9['where'],{'$or':_[_0xa6dd('0x29')](_0x3a1a7c,function(_0x4cc2e8){if(_0x4cc2e8[_0xa6dd('0x2d')]!==_0xa6dd('0x3d')){var _0x562e83={};_0x562e83[_0x4cc2e8[_0xa6dd('0x27')]]={'$like':'%'+_0xf7ed7e['query'][_0xa6dd('0x3b')]+'%'};return _0x562e83;}})});}_0x5127d9=_[_0xa6dd('0x3c')]({},_0x5127d9,_0xf7ed7e[_0xa6dd('0x3e')]);var _0x398b01={'where':_0x5127d9['where']};return db[_0xa6dd('0x2a')][_0xa6dd('0x1e')](_0x398b01)[_0xa6dd('0x24')](function(_0x40923b){_0x2ed717[_0xa6dd('0x1e')]=_0x40923b;if(_0xf7ed7e[_0xa6dd('0x32')]['includeAll']){_0x5127d9[_0xa6dd('0x3f')]=[{'all':!![]}];}return db[_0xa6dd('0x2a')][_0xa6dd('0x40')](_0x5127d9);})['then'](function(_0xeca06){_0x2ed717[_0xa6dd('0x41')]=_0xeca06;return _0x2ed717;})[_0xa6dd('0x24')](respondWithFilteredResult(_0x4349c9,_0x5127d9))['catch'](handleError(_0x4349c9,null));};exports[_0xa6dd('0x42')]=function(_0x1b3bc3,_0x3845fd){var _0x21d4b7={'raw':!![],'where':{'id':_0x1b3bc3['params']['id']}},_0x5a52c6={};_0x5a52c6[_0xa6dd('0x43')]=_[_0xa6dd('0x2f')](db[_0xa6dd('0x2a')][_0xa6dd('0x2b')]);_0x5a52c6[_0xa6dd('0x32')]=_[_0xa6dd('0x2f')](_0x1b3bc3[_0xa6dd('0x32')]);_0x5a52c6[_0xa6dd('0x30')]=_['intersection'](_0x5a52c6[_0xa6dd('0x43')],_0x5a52c6[_0xa6dd('0x32')]);_0x21d4b7[_0xa6dd('0x33')]=_[_0xa6dd('0x31')](_0x5a52c6[_0xa6dd('0x43')],qs['fields'](_0x1b3bc3[_0xa6dd('0x32')][_0xa6dd('0x34')]));_0x21d4b7[_0xa6dd('0x33')]=_0x21d4b7[_0xa6dd('0x33')][_0xa6dd('0x35')]?_0x21d4b7[_0xa6dd('0x33')]:_0x5a52c6[_0xa6dd('0x43')];if(_0x1b3bc3[_0xa6dd('0x32')][_0xa6dd('0x44')]){_0x21d4b7[_0xa6dd('0x3f')]=[{'all':!![]}];}_0x21d4b7=_[_0xa6dd('0x3c')]({},_0x21d4b7,_0x1b3bc3['options']);return db['Dynamics365Field'][_0xa6dd('0x45')](_0x21d4b7)[_0xa6dd('0x24')](handleEntityNotFound(_0x3845fd,null))[_0xa6dd('0x24')](respondWithResult(_0x3845fd,null))[_0xa6dd('0x46')](handleError(_0x3845fd,null));};exports[_0xa6dd('0x47')]=function(_0x2d28de,_0x5ed818){return db[_0xa6dd('0x2a')][_0xa6dd('0x47')](_0x2d28de[_0xa6dd('0x48')],{})['then'](respondWithResult(_0x5ed818,0xc9))[_0xa6dd('0x46')](handleError(_0x5ed818,null));};exports[_0xa6dd('0x49')]=function(_0x1a7ee9,_0x284bf0){if(_0x1a7ee9[_0xa6dd('0x48')]['id']){delete _0x1a7ee9[_0xa6dd('0x48')]['id'];}return db['Dynamics365Field'][_0xa6dd('0x45')]({'where':{'id':_0x1a7ee9[_0xa6dd('0x4a')]['id']}})[_0xa6dd('0x24')](handleEntityNotFound(_0x284bf0,null))[_0xa6dd('0x24')](saveUpdates(_0x1a7ee9[_0xa6dd('0x48')],null))[_0xa6dd('0x24')](respondWithResult(_0x284bf0,null))['catch'](handleError(_0x284bf0,null));};exports['destroy']=function(_0x363698,_0x58358e){return db[_0xa6dd('0x2a')]['find']({'where':{'id':_0x363698[_0xa6dd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58358e,null))['then'](removeEntity(_0x58358e,null))[_0xa6dd('0x46')](handleError(_0x58358e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 142783e..32c8c1a 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 _0xcdac=['request-promise','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x24b24d,_0x3e1521){var _0x395435=function(_0x2f52c6){while(--_0x2f52c6){_0x24b24d['push'](_0x24b24d['shift']());}};_0x395435(++_0x3e1521);}(_0xcdac,0x1ce));var _0xccda=function(_0x46ccd8,_0x3036ed){_0x46ccd8=_0x46ccd8-0x0;var _0x210656=_0xcdac[_0x46ccd8];return _0x210656;};'use strict';var _=require(_0xccda('0x0'));var util=require(_0xccda('0x1'));var logger=require(_0xccda('0x2'))(_0xccda('0x3'));var moment=require(_0xccda('0x4'));var BPromise=require(_0xccda('0x5'));var rp=require(_0xccda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xccda('0x7'));var attributes=require(_0xccda('0x8'));module['exports']=function(_0x2d6734,_0x29bfc9){return _0x2d6734['define'](_0xccda('0x9'),attributes,{'tableName':_0xccda('0xa'),'paranoid':![],'indexes':[{'name':_0xccda('0xb'),'fields':['idField',_0xccda('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85af=['./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x65ddd5,_0x2185de){var _0x6a6511=function(_0x12edea){while(--_0x12edea){_0x65ddd5['push'](_0x65ddd5['shift']());}};_0x6a6511(++_0x2185de);}(_0x85af,0x1d7));var _0xf85a=function(_0xbf4b36,_0x24cd97){_0xbf4b36=_0xbf4b36-0x0;var _0x43bbe7=_0x85af[_0xbf4b36];return _0x43bbe7;};'use strict';var _=require('lodash');var util=require(_0xf85a('0x0'));var logger=require(_0xf85a('0x1'))(_0xf85a('0x2'));var moment=require(_0xf85a('0x3'));var BPromise=require(_0xf85a('0x4'));var rp=require(_0xf85a('0x5'));var fs=require('fs');var path=require(_0xf85a('0x6'));var rimraf=require(_0xf85a('0x7'));var config=require(_0xf85a('0x8'));var attributes=require(_0xf85a('0x9'));module['exports']=function(_0x42d53c,_0x47dcde){return _0x42d53c[_0xf85a('0xa')]('Dynamics365Field',attributes,{'tableName':_0xf85a('0xb'),'paranoid':![],'indexes':[{'name':_0xf85a('0xc'),'fields':[_0xf85a('0xd'),_0xf85a('0xe')],'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 896c7d7..bad26b2 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 _0xa49c=['client','http','request','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x22d020,_0x3602d4){var _0x2bd461=function(_0x504410){while(--_0x504410){_0x22d020['push'](_0x22d020['shift']());}};_0x2bd461(++_0x3602d4);}(_0xa49c,0x15d));var _0xca49=function(_0xe59cff,_0x1a7dbe){_0xe59cff=_0xe59cff-0x0;var _0x26e8c1=_0xa49c[_0xe59cff];return _0x26e8c1;};'use strict';var _=require(_0xca49('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xca49('0x1'));var rs=require(_0xca49('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca49('0x3'))['db'];var utils=require(_0xca49('0x4'));var logger=require(_0xca49('0x5'))(_0xca49('0x6'));var config=require('../../config/environment');var jayson=require(_0xca49('0x7'));var client=jayson[_0xca49('0x8')][_0xca49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcd3b40,_0x54a621,_0xea4451){return new BPromise(function(_0x531d19,_0x1f061a){return client[_0xca49('0xa')](_0xcd3b40,_0xea4451)['then'](function(_0x48f872){logger[_0xca49('0xb')](_0xca49('0xc'),_0x54a621,'request\x20sent');logger['debug'](_0xca49('0xd'),_0x54a621,_0xca49('0xe'),JSON[_0xca49('0xf')](_0x48f872));if(_0x48f872['error']){if(_0x48f872[_0xca49('0x10')][_0xca49('0x11')]===0x1f4){logger[_0xca49('0x10')](_0xca49('0xc'),_0x54a621,_0x48f872['error'][_0xca49('0x12')]);return _0x1f061a(_0x48f872[_0xca49('0x10')][_0xca49('0x12')]);}logger['error'](_0xca49('0xc'),_0x54a621,_0x48f872[_0xca49('0x10')][_0xca49('0x12')]);return _0x531d19(_0x48f872[_0xca49('0x10')][_0xca49('0x12')]);}else{logger[_0xca49('0xb')](_0xca49('0xc'),_0x54a621,_0xca49('0xe'));_0x531d19(_0x48f872[_0xca49('0x13')][_0xca49('0x12')]);}})[_0xca49('0x14')](function(_0x4960f8){logger[_0xca49('0x10')](_0xca49('0xc'),_0x54a621,_0x4960f8);_0x1f061a(_0x4960f8);});});} \ No newline at end of file +var _0xc963=['lodash','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc963,0x1e0));var _0x3c96=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0xc963[_0x20beae];return _0xf5725;};'use strict';var _=require(_0x3c96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3c96('0x1'));var fs=require('fs');var Redis=require(_0x3c96('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3c96('0x3'))(_0x3c96('0x4'));var config=require(_0x3c96('0x5'));var jayson=require(_0x3c96('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x532f9d,_0x1b1fa5,_0x27f840){return new BPromise(function(_0x473f97,_0x337098){return client[_0x3c96('0x7')](_0x532f9d,_0x27f840)[_0x3c96('0x8')](function(_0x359c35){logger[_0x3c96('0x9')](_0x3c96('0xa'),_0x1b1fa5,_0x3c96('0xb'));logger[_0x3c96('0xc')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1b1fa5,'request\x20sent',JSON[_0x3c96('0xd')](_0x359c35));if(_0x359c35['error']){if(_0x359c35[_0x3c96('0xe')]['code']===0x1f4){logger[_0x3c96('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x1b1fa5,_0x359c35[_0x3c96('0xe')][_0x3c96('0xf')]);return _0x337098(_0x359c35[_0x3c96('0xe')][_0x3c96('0xf')]);}logger[_0x3c96('0xe')](_0x3c96('0xa'),_0x1b1fa5,_0x359c35['error']['message']);return _0x473f97(_0x359c35['error'][_0x3c96('0xf')]);}else{logger[_0x3c96('0x9')](_0x3c96('0xa'),_0x1b1fa5,'request\x20sent');_0x473f97(_0x359c35['result'][_0x3c96('0xf')]);}})['catch'](function(_0x4ac57a){logger[_0x3c96('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x1b1fa5,_0x4ac57a);_0x337098(_0x4ac57a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index fc750b2..e71ecef 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 _0x2394=['../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x2394,0x117));var _0x4239=function(_0x48fdd8,_0x2db881){_0x48fdd8=_0x48fdd8-0x0;var _0x460b91=_0x2394[_0x48fdd8];return _0x460b91;};'use strict';var multer=require(_0x4239('0x0'));var util=require('util');var path=require(_0x4239('0x1'));var timeout=require(_0x4239('0x2'));var express=require(_0x4239('0x3'));var router=express[_0x4239('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4239('0x5'));var interaction=require(_0x4239('0x6'));var config=require(_0x4239('0x7'));var controller=require(_0x4239('0x8'));router[_0x4239('0x9')]('/',auth[_0x4239('0xa')](),controller['index']);router[_0x4239('0x9')](_0x4239('0xb'),auth[_0x4239('0xa')](),controller['show']);router[_0x4239('0x9')](_0x4239('0xc'),auth['isAuthenticated'](),controller[_0x4239('0xd')]);router['get'](_0x4239('0xe'),auth[_0x4239('0xa')](),controller[_0x4239('0xf')]);router[_0x4239('0x10')]('/',auth[_0x4239('0xa')](),controller[_0x4239('0x11')]);router['post'](_0x4239('0xc'),auth[_0x4239('0xa')](),controller['addConfiguration']);router[_0x4239('0x12')](_0x4239('0xb'),auth[_0x4239('0xa')](),controller[_0x4239('0x13')]);router[_0x4239('0x14')](_0x4239('0xb'),auth[_0x4239('0xa')](),controller['destroy']);module[_0x4239('0x15')]=router; \ No newline at end of file +var _0xe0d8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','put','/:id','update','delete','exports','multer','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe0d8,0x9e));var _0x8e0d=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0xe0d8[_0x25a42a];return _0x1129b1;};'use strict';var multer=require(_0x8e0d('0x0'));var util=require(_0x8e0d('0x1'));var path=require('path');var timeout=require(_0x8e0d('0x2'));var express=require(_0x8e0d('0x3'));var router=express[_0x8e0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8e0d('0x5'));var interaction=require(_0x8e0d('0x6'));var config=require(_0x8e0d('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x8e0d('0x8')]('/',auth[_0x8e0d('0x9')](),controller['index']);router[_0x8e0d('0x8')]('/:id',auth[_0x8e0d('0x9')](),controller[_0x8e0d('0xa')]);router['get'](_0x8e0d('0xb'),auth[_0x8e0d('0x9')](),controller[_0x8e0d('0xc')]);router[_0x8e0d('0x8')]('/:id/fields',auth[_0x8e0d('0x9')](),controller[_0x8e0d('0xd')]);router[_0x8e0d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8e0d('0xe')](_0x8e0d('0xb'),auth[_0x8e0d('0x9')](),controller['addConfiguration']);router[_0x8e0d('0xf')](_0x8e0d('0x10'),auth['isAuthenticated'](),controller[_0x8e0d('0x11')]);router[_0x8e0d('0x12')]('/:id',auth[_0x8e0d('0x9')](),controller['destroy']);module[_0x8e0d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index fedfb5d..f25e8f4 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 _0x57ca=['exports','STRING','username','remoteUri'];(function(_0x504c47,_0x13020d){var _0x9e34e0=function(_0x371e4c){while(--_0x371e4c){_0x504c47['push'](_0x504c47['shift']());}};_0x9e34e0(++_0x13020d);}(_0x57ca,0x108));var _0xa57c=function(_0x15c3b7,_0x3d75ab){_0x15c3b7=_0x15c3b7-0x0;var _0x5da7de=_0x57ca[_0x15c3b7];return _0x5da7de;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'name':{'type':Sequelize[_0xa57c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa57c('0x1')],'unique':_0xa57c('0x2')},'apiKey':{'type':Sequelize[_0xa57c('0x1')]},'remoteUri':{'type':Sequelize[_0xa57c('0x1')],'unique':_0xa57c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x8603=['remoteUri','exports','STRING'];(function(_0x219bf4,_0x3ebed4){var _0x5ad14d=function(_0x3c9257){while(--_0x3c9257){_0x219bf4['push'](_0x219bf4['shift']());}};_0x5ad14d(++_0x3ebed4);}(_0x8603,0x190));var _0x3860=function(_0x39fbbc,_0x9d36ab){_0x39fbbc=_0x39fbbc-0x0;var _0x1c171d=_0x8603[_0x39fbbc];return _0x1c171d;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0da62de..bc36ae9 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 _0xfc4c=['status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','FreshdeskConfiguration','FreshdeskField','Descriptions','getFields','remoteUri','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','priority','group','source','remove','custom_text','custom_dropdown','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfc4c,0xca));var _0xcfc4=function(_0x424ef1,_0x5c5a42){_0x424ef1=_0x424ef1-0x0;var _0x2a41d2=_0xfc4c[_0x424ef1];return _0x2a41d2;};'use strict';var emlformat=require(_0xcfc4('0x0'));var rimraf=require(_0xcfc4('0x1'));var zipdir=require(_0xcfc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfc4('0x3'));var moment=require(_0xcfc4('0x4'));var BPromise=require(_0xcfc4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcfc4('0x6'));var sox=require(_0xcfc4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfc4('0x8'));var _=require('lodash');var squel=require(_0xcfc4('0x9'));var crypto=require(_0xcfc4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcfc4('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcfc4('0xc'));var authService=require(_0xcfc4('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcfc4('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcfc4('0xf'));var utils=require(_0xcfc4('0x10'));var config=require(_0xcfc4('0x11'));var licenseUtil=require(_0xcfc4('0x12'));var db=require(_0xcfc4('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xb4e135,_0x5cd7ec){_0x5cd7ec=_0x5cd7ec||0xcc;return function(_0x46d009){if(_0x46d009){return _0xb4e135['sendStatus'](_0x5cd7ec);}return _0xb4e135[_0xcfc4('0x14')](_0x5cd7ec)['end']();};}function respondWithResult(_0x57fffb,_0x276b08){_0x276b08=_0x276b08||0xc8;return function(_0x40029f){if(_0x40029f){return _0x57fffb['status'](_0x276b08)[_0xcfc4('0x15')](_0x40029f);}};}function respondWithFilteredResult(_0x391d92,_0x39f8f1){return function(_0x4bb1f3){if(_0x4bb1f3){var _0x5af66f=typeof _0x39f8f1[_0xcfc4('0x16')]==='undefined'&&typeof _0x39f8f1['limit']==='undefined';var _0x136693=_0x4bb1f3['count'];var _0x472694=_0x5af66f?0x0:_0x39f8f1[_0xcfc4('0x16')];var _0x5ac260=_0x5af66f?_0x4bb1f3[_0xcfc4('0x17')]:_0x39f8f1[_0xcfc4('0x16')]+_0x39f8f1[_0xcfc4('0x18')];var _0x520dae;if(_0x5ac260>=_0x136693){_0x5ac260=_0x136693;_0x520dae=0xc8;}else{_0x520dae=0xce;}_0x391d92[_0xcfc4('0x14')](_0x520dae);return _0x391d92[_0xcfc4('0x19')](_0xcfc4('0x1a'),_0x472694+'-'+_0x5ac260+'/'+_0x136693)['json'](_0x4bb1f3);}return null;};}function patchUpdates(_0xfad718){return function(_0x3c4120){try{jsonpatch[_0xcfc4('0x1b')](_0x3c4120,_0xfad718,!![]);}catch(_0x22f140){return BPromise[_0xcfc4('0x1c')](_0x22f140);}return _0x3c4120[_0xcfc4('0x1d')]();};}function saveUpdates(_0x467e3f,_0x2c6406){return function(_0x180f2d){if(_0x180f2d){return _0x180f2d[_0xcfc4('0x1e')](_0x467e3f)[_0xcfc4('0x1f')](function(_0x554bea){return _0x554bea;});}return null;};}function removeEntity(_0x393d09,_0x1fa48d){return function(_0x33c6d0){if(_0x33c6d0){return _0x33c6d0['destroy']()[_0xcfc4('0x1f')](function(){_0x393d09['status'](0xcc)[_0xcfc4('0x20')]();});}};}function handleEntityNotFound(_0x2ebdfc,_0x1f0217){return function(_0x68f918){if(!_0x68f918){_0x2ebdfc[_0xcfc4('0x21')](0x194);}return _0x68f918;};}function handleError(_0x405c3a,_0x4fdb59){_0x4fdb59=_0x4fdb59||0x1f4;return function(_0x11aba3){logger[_0xcfc4('0x22')](_0x11aba3[_0xcfc4('0x23')]);if(_0x11aba3[_0xcfc4('0x24')]){delete _0x11aba3[_0xcfc4('0x24')];}_0x405c3a['status'](_0x4fdb59)[_0xcfc4('0x25')](_0x11aba3);};}exports[_0xcfc4('0x26')]=function(_0x37d762,_0x1d7dd4){var _0x59dd2d={},_0x4c65fc={},_0x534522={'count':0x0,'rows':[]};var _0x3c96bb=_[_0xcfc4('0x27')](db[_0xcfc4('0x28')][_0xcfc4('0x29')],function(_0xfff05a){return{'name':_0xfff05a[_0xcfc4('0x2a')],'type':_0xfff05a[_0xcfc4('0x2b')]['key']};});_0x4c65fc[_0xcfc4('0x2c')]=_[_0xcfc4('0x27')](_0x3c96bb,_0xcfc4('0x24'));_0x4c65fc[_0xcfc4('0x2d')]=_[_0xcfc4('0x2e')](_0x37d762[_0xcfc4('0x2d')]);_0x4c65fc[_0xcfc4('0x2f')]=_['intersection'](_0x4c65fc['model'],_0x4c65fc[_0xcfc4('0x2d')]);_0x59dd2d[_0xcfc4('0x30')]=_[_0xcfc4('0x31')](_0x4c65fc['model'],qs[_0xcfc4('0x32')](_0x37d762[_0xcfc4('0x2d')]['fields']));_0x59dd2d[_0xcfc4('0x30')]=_0x59dd2d[_0xcfc4('0x30')][_0xcfc4('0x33')]?_0x59dd2d[_0xcfc4('0x30')]:_0x4c65fc[_0xcfc4('0x2c')];if(!_0x37d762['query'][_0xcfc4('0x34')]('nolimit')){_0x59dd2d[_0xcfc4('0x18')]=qs[_0xcfc4('0x18')](_0x37d762[_0xcfc4('0x2d')][_0xcfc4('0x18')]);_0x59dd2d[_0xcfc4('0x16')]=qs[_0xcfc4('0x16')](_0x37d762[_0xcfc4('0x2d')][_0xcfc4('0x16')]);}_0x59dd2d[_0xcfc4('0x35')]=qs[_0xcfc4('0x36')](_0x37d762['query'][_0xcfc4('0x36')]);_0x59dd2d[_0xcfc4('0x37')]=qs[_0xcfc4('0x2f')](_[_0xcfc4('0x38')](_0x37d762[_0xcfc4('0x2d')],_0x4c65fc['filters']),_0x3c96bb);if(_0x37d762[_0xcfc4('0x2d')]['filter']){_0x59dd2d[_0xcfc4('0x37')]=_[_0xcfc4('0x39')](_0x59dd2d['where'],{'$or':_['map'](_0x3c96bb,function(_0x4929c8){if(_0x4929c8[_0xcfc4('0x2b')]!=='VIRTUAL'){var _0x14489a={};_0x14489a[_0x4929c8[_0xcfc4('0x24')]]={'$like':'%'+_0x37d762['query'][_0xcfc4('0x3a')]+'%'};return _0x14489a;}})});}_0x59dd2d=_[_0xcfc4('0x39')]({},_0x59dd2d,_0x37d762[_0xcfc4('0x3b')]);var _0x4854b4={'where':_0x59dd2d[_0xcfc4('0x37')]};return db['FreshdeskAccount'][_0xcfc4('0x17')](_0x4854b4)[_0xcfc4('0x1f')](function(_0x300d2d){_0x534522[_0xcfc4('0x17')]=_0x300d2d;if(_0x37d762[_0xcfc4('0x2d')][_0xcfc4('0x3c')]){_0x59dd2d[_0xcfc4('0x3d')]=[{'all':!![]}];}return db[_0xcfc4('0x28')]['findAll'](_0x59dd2d);})['then'](function(_0x1101f0){_0x534522[_0xcfc4('0x3e')]=_0x1101f0;return _0x534522;})['then'](respondWithFilteredResult(_0x1d7dd4,_0x59dd2d))[_0xcfc4('0x3f')](handleError(_0x1d7dd4,null));};exports[_0xcfc4('0x40')]=function(_0x5834eb,_0x3cfd34){var _0x5adf49={'raw':![],'where':{'id':_0x5834eb[_0xcfc4('0x41')]['id']}},_0x379773={};_0x379773['model']=_[_0xcfc4('0x2e')](db[_0xcfc4('0x28')][_0xcfc4('0x29')]);_0x379773[_0xcfc4('0x2d')]=_[_0xcfc4('0x2e')](_0x5834eb['query']);_0x379773[_0xcfc4('0x2f')]=_[_0xcfc4('0x31')](_0x379773[_0xcfc4('0x2c')],_0x379773[_0xcfc4('0x2d')]);_0x5adf49['attributes']=_['intersection'](_0x379773[_0xcfc4('0x2c')],qs['fields'](_0x5834eb[_0xcfc4('0x2d')][_0xcfc4('0x32')]));_0x5adf49[_0xcfc4('0x30')]=_0x5adf49[_0xcfc4('0x30')]['length']?_0x5adf49[_0xcfc4('0x30')]:_0x379773[_0xcfc4('0x2c')];if(_0x5834eb[_0xcfc4('0x2d')]['includeAll']){_0x5adf49[_0xcfc4('0x3d')]=[{'all':!![]}];}_0x5adf49=_[_0xcfc4('0x39')]({},_0x5adf49,_0x5834eb[_0xcfc4('0x3b')]);return db[_0xcfc4('0x28')][_0xcfc4('0x42')](_0x5adf49)[_0xcfc4('0x1f')](handleEntityNotFound(_0x3cfd34,null))[_0xcfc4('0x1f')](respondWithResult(_0x3cfd34,null))[_0xcfc4('0x3f')](handleError(_0x3cfd34,null));};exports[_0xcfc4('0x43')]=function(_0x1324fe,_0x38b723){return db['FreshdeskAccount']['create'](_0x1324fe[_0xcfc4('0x44')],{})['then'](respondWithResult(_0x38b723,0xc9))[_0xcfc4('0x3f')](handleError(_0x38b723,null));};exports[_0xcfc4('0x1e')]=function(_0x2e9243,_0x434d10){if(_0x2e9243[_0xcfc4('0x44')]['id']){delete _0x2e9243[_0xcfc4('0x44')]['id'];}return db[_0xcfc4('0x28')][_0xcfc4('0x42')]({'where':{'id':_0x2e9243['params']['id']}})[_0xcfc4('0x1f')](handleEntityNotFound(_0x434d10,null))[_0xcfc4('0x1f')](saveUpdates(_0x2e9243[_0xcfc4('0x44')],null))[_0xcfc4('0x1f')](respondWithResult(_0x434d10,null))['catch'](handleError(_0x434d10,null));};exports[_0xcfc4('0x45')]=function(_0x4548d9,_0x42ffe2){return db[_0xcfc4('0x28')][_0xcfc4('0x42')]({'where':{'id':_0x4548d9[_0xcfc4('0x41')]['id']}})['then'](handleEntityNotFound(_0x42ffe2,null))[_0xcfc4('0x1f')](removeEntity(_0x42ffe2,null))[_0xcfc4('0x3f')](handleError(_0x42ffe2,null));};exports['getConfigurations']=function(_0x59449e,_0x16fc65,_0x475ef5){var _0x137804={};var _0x4d5551={};var _0x3d7981;var _0x44d0e5;return db[_0xcfc4('0x28')]['findOne']({'where':{'id':_0x59449e['params']['id']}})[_0xcfc4('0x1f')](handleEntityNotFound(_0x16fc65,null))[_0xcfc4('0x1f')](function(_0x28991b){if(_0x28991b){_0x3d7981=_0x28991b;_0x4d5551[_0xcfc4('0x2c')]=_[_0xcfc4('0x2e')](db['FreshdeskConfiguration'][_0xcfc4('0x29')]);_0x4d5551[_0xcfc4('0x2d')]=_[_0xcfc4('0x2e')](_0x59449e[_0xcfc4('0x2d')]);_0x4d5551['filters']=_[_0xcfc4('0x31')](_0x4d5551[_0xcfc4('0x2c')],_0x4d5551[_0xcfc4('0x2d')]);_0x137804[_0xcfc4('0x30')]=_[_0xcfc4('0x31')](_0x4d5551['model'],qs[_0xcfc4('0x32')](_0x59449e[_0xcfc4('0x2d')][_0xcfc4('0x32')]));_0x137804[_0xcfc4('0x30')]=_0x137804[_0xcfc4('0x30')][_0xcfc4('0x33')]?_0x137804['attributes']:_0x4d5551['model'];_0x137804['order']=qs['sort'](_0x59449e[_0xcfc4('0x2d')]['sort']);_0x137804[_0xcfc4('0x37')]=qs['filters'](_[_0xcfc4('0x38')](_0x59449e['query'],_0x4d5551[_0xcfc4('0x2f')]));if(_0x59449e[_0xcfc4('0x2d')][_0xcfc4('0x3a')]){_0x137804[_0xcfc4('0x37')]=_[_0xcfc4('0x39')](_0x137804[_0xcfc4('0x37')],{'$or':_[_0xcfc4('0x27')](_0x137804[_0xcfc4('0x30')],function(_0x4baa0e){var _0x3f19d0={};_0x3f19d0[_0x4baa0e]={'$like':'%'+_0x59449e[_0xcfc4('0x2d')][_0xcfc4('0x3a')]+'%'};return _0x3f19d0;})});}_0x137804=_['merge']({},_0x137804,_0x59449e[_0xcfc4('0x3b')]);return _0x3d7981[_0xcfc4('0x46')](_0x137804);}})['then'](function(_0x2b37bc){if(_0x2b37bc){_0x44d0e5=_0x2b37bc['length'];if(!_0x59449e[_0xcfc4('0x2d')][_0xcfc4('0x34')](_0xcfc4('0x47'))){_0x137804['limit']=qs['limit'](_0x59449e['query'][_0xcfc4('0x18')]);_0x137804[_0xcfc4('0x16')]=qs['offset'](_0x59449e[_0xcfc4('0x2d')][_0xcfc4('0x16')]);}return _0x3d7981[_0xcfc4('0x46')](_0x137804);}})[_0xcfc4('0x1f')](function(_0x336800){if(_0x336800){return _0x336800?{'count':_0x44d0e5,'rows':_0x336800}:null;}})[_0xcfc4('0x1f')](respondWithResult(_0x16fc65,null))[_0xcfc4('0x3f')](handleError(_0x16fc65,null));};exports[_0xcfc4('0x48')]=function(_0x54802b,_0x30d118,_0x25174d){if(_0x54802b['body']['id']){delete _0x54802b['body']['id'];}return db[_0xcfc4('0x28')][_0xcfc4('0x49')]({'where':{'id':_0x54802b['params']['id']}})['then'](handleEntityNotFound(_0x30d118,null))[_0xcfc4('0x1f')](function(_0x582ee1){if(_0x582ee1){_0x54802b[_0xcfc4('0x44')][_0xcfc4('0x4a')]=_0x582ee1['id'];_0x54802b[_0xcfc4('0x44')][_0xcfc4('0x4b')]=integrations[_0xcfc4('0x4c')](_0x54802b[_0xcfc4('0x44')]['channel'],_0x54802b[_0xcfc4('0x44')]['type']);_0x54802b[_0xcfc4('0x44')]['Descriptions']=integrations[_0xcfc4('0x4d')](_0x54802b[_0xcfc4('0x44')]['channel'],_0x54802b[_0xcfc4('0x44')]['type']);return db[_0xcfc4('0x4e')][_0xcfc4('0x43')](_0x54802b[_0xcfc4('0x44')],{'include':[{'model':db[_0xcfc4('0x4f')],'as':_0xcfc4('0x4b')},{'model':db[_0xcfc4('0x4f')],'as':_0xcfc4('0x50')}]});}return null;})[_0xcfc4('0x1f')](respondWithResult(_0x30d118,null))[_0xcfc4('0x3f')](handleError(_0x30d118,null));};exports[_0xcfc4('0x51')]=function(_0x5ad449,_0x3245e4,_0x5455dd){var _0x1c5519='';return db['FreshdeskAccount'][_0xcfc4('0x49')]({'where':{'id':_0x5ad449['params']['id']},'attributes':['id',_0xcfc4('0x52'),'apiKey']})['then'](handleEntityNotFound(_0x3245e4,null))[_0xcfc4('0x1f')](function(_0x3752d0){if(_0x3752d0){_0x1c5519=_0x3752d0[_0xcfc4('0x52')];var _0x51ed43=_0x1c5519[_0xcfc4('0x53')](-0x1);if(_0x51ed43==='/'){_0x1c5519=_0x1c5519[_0xcfc4('0x54')](0x0,_0x1c5519['lastIndexOf'](_0x51ed43));}return rp({'method':_0xcfc4('0x55'),'uri':util['format'](_0xcfc4('0x56'),_0x1c5519,_0xcfc4('0x57')),'headers':{'Authorization':util[_0xcfc4('0x58')](_0xcfc4('0x59'),new Buffer(util[_0xcfc4('0x58')]('%s:X',_0x3752d0[_0xcfc4('0x5a')]))[_0xcfc4('0x5b')](_0xcfc4('0x5c')))},'json':!![]});}})[_0xcfc4('0x1f')](function(_0x4b9b40){if(_0x4b9b40){var _0x273a0d=[_0xcfc4('0x5d'),_0xcfc4('0x5e'),_0xcfc4('0x5f'),_0xcfc4('0x60'),_0xcfc4('0x14'),_0xcfc4('0x61'),_0xcfc4('0x62'),_0xcfc4('0x63'),'ticket_type',_0xcfc4('0x62'),'company'];_[_0xcfc4('0x64')](_0x4b9b40,function(_0x1b8a2b){return _0x273a0d['includes'](_0x1b8a2b[_0xcfc4('0x24')])||!_0x1b8a2b['default']&&_0x1b8a2b['type']!==_0xcfc4('0x65')&&_0x1b8a2b['type']!==_0xcfc4('0x66');});return{'count':_0x4b9b40[_0xcfc4('0x33')],'rows':_[_0xcfc4('0x27')](_0x4b9b40,function(_0x250789){return{'id':_0x250789[_0xcfc4('0x24')],'name':_0x250789['label'],'custom':!_0x250789[_0xcfc4('0x67')],'options':_0x250789[_0xcfc4('0x68')]?_[_0xcfc4('0x27')](_0x250789[_0xcfc4('0x68')],function(_0x5e2fbe){return{'name':_[_0xcfc4('0x69')](_0x5e2fbe),'value':_0x5e2fbe};}):[]};})};}})[_0xcfc4('0x1f')](respondWithResult(_0x3245e4,null))['catch'](function(_0x49fb2f){var _0x4636e0=_0x5ad449[_0xcfc4('0x2d')][_0xcfc4('0x6a')]?0x1f4:_0x49fb2f[_0xcfc4('0x6b')]||0x1f4;logger[_0xcfc4('0x22')](_0xcfc4('0x6c'),_0xcfc4('0x51'),_0x4636e0,JSON[_0xcfc4('0x6d')](_0x49fb2f));delete _0x49fb2f[_0xcfc4('0x24')];if(_0x4636e0===0x191){_0x4636e0=0x190;}_0x3245e4[_0xcfc4('0x14')](_0x4636e0)['send'](_0x5ad449[_0xcfc4('0x2d')][_0xcfc4('0x6a')]?{'message':_0xcfc4('0x6e'),'statusCode':_0x49fb2f[_0xcfc4('0x6b')]}:_0x49fb2f);});}; \ No newline at end of file +var _0x5269=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','FreshdeskAccount','findAll','then','catch','params','rawAttributes','length','options','body','update','find','findOne','FreshdeskConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','create','FreshdeskField','Subjects','Descriptions','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','priority','group','ticket_type','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x482bc3,_0x3d5ab){var _0x458dbe=function(_0x9600eb){while(--_0x9600eb){_0x482bc3['push'](_0x482bc3['shift']());}};_0x458dbe(++_0x3d5ab);}(_0x5269,0x150));var _0x9526=function(_0x55459f,_0x326541){_0x55459f=_0x55459f-0x0;var _0x602113=_0x5269[_0x55459f];return _0x602113;};'use strict';var emlformat=require(_0x9526('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9526('0x1'));var BPromise=require(_0x9526('0x2'));var Mustache=require(_0x9526('0x3'));var util=require('util');var path=require('path');var sox=require(_0x9526('0x4'));var csv=require('to-csv');var ejs=require(_0x9526('0x5'));var fs=require('fs');var fs_extra=require(_0x9526('0x6'));var _=require(_0x9526('0x7'));var squel=require(_0x9526('0x8'));var crypto=require(_0x9526('0x9'));var jsforce=require(_0x9526('0xa'));var deskjs=require(_0x9526('0xb'));var toCsv=require(_0x9526('0xc'));var querystring=require(_0x9526('0xd'));var Papa=require(_0x9526('0xe'));var Redis=require(_0x9526('0xf'));var authService=require(_0x9526('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9526('0x11'));var hardwareService=require(_0x9526('0x12'));var logger=require('../../config/logger')(_0x9526('0x13'));var utils=require(_0x9526('0x14'));var config=require(_0x9526('0x15'));var licenseUtil=require(_0x9526('0x16'));var db=require(_0x9526('0x17'))['db'];var integrations=require(_0x9526('0x18'));function respondWithStatusCode(_0x14dde8,_0x487158){_0x487158=_0x487158||0xcc;return function(_0x14ce60){if(_0x14ce60){return _0x14dde8[_0x9526('0x19')](_0x487158);}return _0x14dde8['status'](_0x487158)[_0x9526('0x1a')]();};}function respondWithResult(_0x13ca39,_0x530a5b){_0x530a5b=_0x530a5b||0xc8;return function(_0x4e2e8a){if(_0x4e2e8a){return _0x13ca39['status'](_0x530a5b)[_0x9526('0x1b')](_0x4e2e8a);}};}function respondWithFilteredResult(_0x5bf7ec,_0x20e6c7){return function(_0x37feda){if(_0x37feda){var _0x3c99df=typeof _0x20e6c7[_0x9526('0x1c')]===_0x9526('0x1d')&&typeof _0x20e6c7[_0x9526('0x1e')]==='undefined';var _0x54285e=_0x37feda[_0x9526('0x1f')];var _0x5a3957=_0x3c99df?0x0:_0x20e6c7[_0x9526('0x1c')];var _0x508d38=_0x3c99df?_0x37feda[_0x9526('0x1f')]:_0x20e6c7['offset']+_0x20e6c7[_0x9526('0x1e')];var _0x243710;if(_0x508d38>=_0x54285e){_0x508d38=_0x54285e;_0x243710=0xc8;}else{_0x243710=0xce;}_0x5bf7ec[_0x9526('0x20')](_0x243710);return _0x5bf7ec['set']('Content-Range',_0x5a3957+'-'+_0x508d38+'/'+_0x54285e)[_0x9526('0x1b')](_0x37feda);}return null;};}function patchUpdates(_0x1bfb23){return function(_0x300870){try{jsonpatch[_0x9526('0x21')](_0x300870,_0x1bfb23,!![]);}catch(_0x590a64){return BPromise[_0x9526('0x22')](_0x590a64);}return _0x300870['save']();};}function saveUpdates(_0x230c4a,_0x421382){return function(_0x5138ae){if(_0x5138ae){return _0x5138ae['update'](_0x230c4a)['then'](function(_0x18c11a){return _0x18c11a;});}return null;};}function removeEntity(_0x57c330,_0x12449e){return function(_0x4432ba){if(_0x4432ba){return _0x4432ba[_0x9526('0x23')]()['then'](function(){_0x57c330[_0x9526('0x20')](0xcc)[_0x9526('0x1a')]();});}};}function handleEntityNotFound(_0x10ec5f,_0x119882){return function(_0x45d079){if(!_0x45d079){_0x10ec5f[_0x9526('0x19')](0x194);}return _0x45d079;};}function handleError(_0x11789d,_0xc9304b){_0xc9304b=_0xc9304b||0x1f4;return function(_0x53865b){logger[_0x9526('0x24')](_0x53865b[_0x9526('0x25')]);if(_0x53865b['name']){delete _0x53865b[_0x9526('0x26')];}_0x11789d['status'](_0xc9304b)[_0x9526('0x27')](_0x53865b);};}exports[_0x9526('0x28')]=function(_0x1a4a42,_0x14c1c4){var _0x2a9304={},_0x12dca3={},_0x32d91a={'count':0x0,'rows':[]};var _0x411c97=_['map'](db['FreshdeskAccount']['rawAttributes'],function(_0x10dd77){return{'name':_0x10dd77[_0x9526('0x29')],'type':_0x10dd77[_0x9526('0x2a')][_0x9526('0x2b')]};});_0x12dca3[_0x9526('0x2c')]=_[_0x9526('0x2d')](_0x411c97,_0x9526('0x26'));_0x12dca3[_0x9526('0x2e')]=_[_0x9526('0x2f')](_0x1a4a42['query']);_0x12dca3['filters']=_['intersection'](_0x12dca3[_0x9526('0x2c')],_0x12dca3[_0x9526('0x2e')]);_0x2a9304[_0x9526('0x30')]=_[_0x9526('0x31')](_0x12dca3['model'],qs[_0x9526('0x32')](_0x1a4a42[_0x9526('0x2e')][_0x9526('0x32')]));_0x2a9304[_0x9526('0x30')]=_0x2a9304[_0x9526('0x30')]['length']?_0x2a9304[_0x9526('0x30')]:_0x12dca3[_0x9526('0x2c')];if(!_0x1a4a42[_0x9526('0x2e')][_0x9526('0x33')](_0x9526('0x34'))){_0x2a9304[_0x9526('0x1e')]=qs['limit'](_0x1a4a42[_0x9526('0x2e')]['limit']);_0x2a9304[_0x9526('0x1c')]=qs[_0x9526('0x1c')](_0x1a4a42[_0x9526('0x2e')][_0x9526('0x1c')]);}_0x2a9304['order']=qs['sort'](_0x1a4a42[_0x9526('0x2e')][_0x9526('0x35')]);_0x2a9304[_0x9526('0x36')]=qs['filters'](_[_0x9526('0x37')](_0x1a4a42[_0x9526('0x2e')],_0x12dca3[_0x9526('0x38')]),_0x411c97);if(_0x1a4a42[_0x9526('0x2e')][_0x9526('0x39')]){_0x2a9304[_0x9526('0x36')]=_[_0x9526('0x3a')](_0x2a9304[_0x9526('0x36')],{'$or':_[_0x9526('0x2d')](_0x411c97,function(_0x5714e9){if(_0x5714e9[_0x9526('0x2a')]!==_0x9526('0x3b')){var _0x1252cb={};_0x1252cb[_0x5714e9['name']]={'$like':'%'+_0x1a4a42[_0x9526('0x2e')]['filter']+'%'};return _0x1252cb;}})});}_0x2a9304=_[_0x9526('0x3a')]({},_0x2a9304,_0x1a4a42['options']);var _0x407d50={'where':_0x2a9304[_0x9526('0x36')]};return db['FreshdeskAccount'][_0x9526('0x1f')](_0x407d50)['then'](function(_0x4f38a9){_0x32d91a[_0x9526('0x1f')]=_0x4f38a9;if(_0x1a4a42[_0x9526('0x2e')][_0x9526('0x3c')]){_0x2a9304[_0x9526('0x3d')]=[{'all':!![]}];}return db[_0x9526('0x3e')][_0x9526('0x3f')](_0x2a9304);})[_0x9526('0x40')](function(_0x348c23){_0x32d91a['rows']=_0x348c23;return _0x32d91a;})[_0x9526('0x40')](respondWithFilteredResult(_0x14c1c4,_0x2a9304))[_0x9526('0x41')](handleError(_0x14c1c4,null));};exports['show']=function(_0x32ddfb,_0x253949){var _0xa0ad19={'raw':![],'where':{'id':_0x32ddfb[_0x9526('0x42')]['id']}},_0x419019={};_0x419019[_0x9526('0x2c')]=_[_0x9526('0x2f')](db[_0x9526('0x3e')][_0x9526('0x43')]);_0x419019[_0x9526('0x2e')]=_[_0x9526('0x2f')](_0x32ddfb[_0x9526('0x2e')]);_0x419019[_0x9526('0x38')]=_['intersection'](_0x419019[_0x9526('0x2c')],_0x419019['query']);_0xa0ad19[_0x9526('0x30')]=_[_0x9526('0x31')](_0x419019['model'],qs[_0x9526('0x32')](_0x32ddfb[_0x9526('0x2e')][_0x9526('0x32')]));_0xa0ad19[_0x9526('0x30')]=_0xa0ad19['attributes'][_0x9526('0x44')]?_0xa0ad19[_0x9526('0x30')]:_0x419019[_0x9526('0x2c')];if(_0x32ddfb[_0x9526('0x2e')]['includeAll']){_0xa0ad19[_0x9526('0x3d')]=[{'all':!![]}];}_0xa0ad19=_[_0x9526('0x3a')]({},_0xa0ad19,_0x32ddfb[_0x9526('0x45')]);return db[_0x9526('0x3e')]['find'](_0xa0ad19)[_0x9526('0x40')](handleEntityNotFound(_0x253949,null))[_0x9526('0x40')](respondWithResult(_0x253949,null))['catch'](handleError(_0x253949,null));};exports['create']=function(_0x53e362,_0x1d172a){return db[_0x9526('0x3e')]['create'](_0x53e362[_0x9526('0x46')],{})['then'](respondWithResult(_0x1d172a,0xc9))[_0x9526('0x41')](handleError(_0x1d172a,null));};exports[_0x9526('0x47')]=function(_0x10a251,_0x7a3f62){if(_0x10a251['body']['id']){delete _0x10a251[_0x9526('0x46')]['id'];}return db[_0x9526('0x3e')]['find']({'where':{'id':_0x10a251[_0x9526('0x42')]['id']}})[_0x9526('0x40')](handleEntityNotFound(_0x7a3f62,null))[_0x9526('0x40')](saveUpdates(_0x10a251[_0x9526('0x46')],null))['then'](respondWithResult(_0x7a3f62,null))[_0x9526('0x41')](handleError(_0x7a3f62,null));};exports[_0x9526('0x23')]=function(_0x1d168e,_0x36883d){return db['FreshdeskAccount'][_0x9526('0x48')]({'where':{'id':_0x1d168e[_0x9526('0x42')]['id']}})[_0x9526('0x40')](handleEntityNotFound(_0x36883d,null))[_0x9526('0x40')](removeEntity(_0x36883d,null))['catch'](handleError(_0x36883d,null));};exports['getConfigurations']=function(_0x220af9,_0x26744f,_0x45fce0){var _0x18f5f5={};var _0x283a8d={};var _0x48af74;var _0x3a564f;return db[_0x9526('0x3e')][_0x9526('0x49')]({'where':{'id':_0x220af9[_0x9526('0x42')]['id']}})[_0x9526('0x40')](handleEntityNotFound(_0x26744f,null))[_0x9526('0x40')](function(_0x5dd686){if(_0x5dd686){_0x48af74=_0x5dd686;_0x283a8d[_0x9526('0x2c')]=_[_0x9526('0x2f')](db[_0x9526('0x4a')]['rawAttributes']);_0x283a8d[_0x9526('0x2e')]=_[_0x9526('0x2f')](_0x220af9[_0x9526('0x2e')]);_0x283a8d[_0x9526('0x38')]=_[_0x9526('0x31')](_0x283a8d[_0x9526('0x2c')],_0x283a8d['query']);_0x18f5f5[_0x9526('0x30')]=_[_0x9526('0x31')](_0x283a8d[_0x9526('0x2c')],qs[_0x9526('0x32')](_0x220af9['query'][_0x9526('0x32')]));_0x18f5f5[_0x9526('0x30')]=_0x18f5f5['attributes'][_0x9526('0x44')]?_0x18f5f5['attributes']:_0x283a8d[_0x9526('0x2c')];_0x18f5f5['order']=qs[_0x9526('0x35')](_0x220af9[_0x9526('0x2e')][_0x9526('0x35')]);_0x18f5f5['where']=qs['filters'](_['pick'](_0x220af9[_0x9526('0x2e')],_0x283a8d[_0x9526('0x38')]));if(_0x220af9[_0x9526('0x2e')][_0x9526('0x39')]){_0x18f5f5[_0x9526('0x36')]=_['merge'](_0x18f5f5[_0x9526('0x36')],{'$or':_['map'](_0x18f5f5[_0x9526('0x30')],function(_0x413d56){var _0x33624c={};_0x33624c[_0x413d56]={'$like':'%'+_0x220af9[_0x9526('0x2e')][_0x9526('0x39')]+'%'};return _0x33624c;})});}_0x18f5f5=_['merge']({},_0x18f5f5,_0x220af9[_0x9526('0x45')]);return _0x48af74[_0x9526('0x4b')](_0x18f5f5);}})[_0x9526('0x40')](function(_0x349dc5){if(_0x349dc5){_0x3a564f=_0x349dc5[_0x9526('0x44')];if(!_0x220af9['query'][_0x9526('0x33')](_0x9526('0x34'))){_0x18f5f5['limit']=qs[_0x9526('0x1e')](_0x220af9[_0x9526('0x2e')][_0x9526('0x1e')]);_0x18f5f5[_0x9526('0x1c')]=qs[_0x9526('0x1c')](_0x220af9[_0x9526('0x2e')][_0x9526('0x1c')]);}return _0x48af74[_0x9526('0x4b')](_0x18f5f5);}})['then'](function(_0x1f5de9){if(_0x1f5de9){return _0x1f5de9?{'count':_0x3a564f,'rows':_0x1f5de9}:null;}})[_0x9526('0x40')](respondWithResult(_0x26744f,null))[_0x9526('0x41')](handleError(_0x26744f,null));};exports[_0x9526('0x4c')]=function(_0x348976,_0x1fcf8d,_0x3f6b12){if(_0x348976[_0x9526('0x46')]['id']){delete _0x348976[_0x9526('0x46')]['id'];}return db[_0x9526('0x3e')][_0x9526('0x49')]({'where':{'id':_0x348976['params']['id']}})[_0x9526('0x40')](handleEntityNotFound(_0x1fcf8d,null))['then'](function(_0x560e10){if(_0x560e10){_0x348976[_0x9526('0x46')][_0x9526('0x4d')]=_0x560e10['id'];_0x348976['body']['Subjects']=integrations[_0x9526('0x4e')](_0x348976['body']['channel'],_0x348976[_0x9526('0x46')][_0x9526('0x2a')]);_0x348976[_0x9526('0x46')]['Descriptions']=integrations[_0x9526('0x4f')](_0x348976['body'][_0x9526('0x50')],_0x348976['body'][_0x9526('0x2a')]);return db[_0x9526('0x4a')][_0x9526('0x51')](_0x348976[_0x9526('0x46')],{'include':[{'model':db[_0x9526('0x52')],'as':_0x9526('0x53')},{'model':db['FreshdeskField'],'as':_0x9526('0x54')}]});}return null;})['then'](respondWithResult(_0x1fcf8d,null))[_0x9526('0x41')](handleError(_0x1fcf8d,null));};exports['getFields']=function(_0x5f21f0,_0xc645c2,_0x4e0374){var _0x48aba5='';return db[_0x9526('0x3e')]['findOne']({'where':{'id':_0x5f21f0[_0x9526('0x42')]['id']},'attributes':['id',_0x9526('0x55'),_0x9526('0x56')]})[_0x9526('0x40')](handleEntityNotFound(_0xc645c2,null))['then'](function(_0x42c02b){if(_0x42c02b){_0x48aba5=_0x42c02b[_0x9526('0x55')];var _0x4bb9a2=_0x48aba5[_0x9526('0x57')](-0x1);if(_0x4bb9a2==='/'){_0x48aba5=_0x48aba5[_0x9526('0x58')](0x0,_0x48aba5[_0x9526('0x59')](_0x4bb9a2));}return rp({'method':_0x9526('0x5a'),'uri':util[_0x9526('0x5b')](_0x9526('0x5c'),_0x48aba5,_0x9526('0x5d')),'headers':{'Authorization':util['format'](_0x9526('0x5e'),new Buffer(util[_0x9526('0x5b')](_0x9526('0x5f'),_0x42c02b['apiKey']))[_0x9526('0x60')](_0x9526('0x61')))},'json':!![]});}})[_0x9526('0x40')](function(_0x6202b){if(_0x6202b){var _0x24e01f=[_0x9526('0x62'),_0x9526('0x63'),'agent',_0x9526('0x64'),_0x9526('0x20'),_0x9526('0x65'),_0x9526('0x66'),'source',_0x9526('0x67'),_0x9526('0x66'),'company'];_['remove'](_0x6202b,function(_0x97f6e9){return _0x24e01f['includes'](_0x97f6e9[_0x9526('0x26')])||!_0x97f6e9['default']&&_0x97f6e9[_0x9526('0x2a')]!==_0x9526('0x68')&&_0x97f6e9[_0x9526('0x2a')]!==_0x9526('0x69');});return{'count':_0x6202b['length'],'rows':_[_0x9526('0x2d')](_0x6202b,function(_0x16af1a){return{'id':_0x16af1a[_0x9526('0x26')],'name':_0x16af1a[_0x9526('0x6a')],'custom':!_0x16af1a[_0x9526('0x6b')],'options':_0x16af1a[_0x9526('0x6c')]?_[_0x9526('0x2d')](_0x16af1a[_0x9526('0x6c')],function(_0xfb3876){return{'name':_[_0x9526('0x6d')](_0xfb3876),'value':_0xfb3876};}):[]};})};}})[_0x9526('0x40')](respondWithResult(_0xc645c2,null))[_0x9526('0x41')](function(_0x51fb6e){var _0x39e403=_0x5f21f0[_0x9526('0x2e')][_0x9526('0x6e')]?0x1f4:_0x51fb6e[_0x9526('0x6f')]||0x1f4;logger[_0x9526('0x24')](_0x9526('0x70'),_0x9526('0x71'),_0x39e403,JSON[_0x9526('0x72')](_0x51fb6e));delete _0x51fb6e[_0x9526('0x26')];if(_0x39e403===0x191){_0x39e403=0x190;}_0xc645c2['status'](_0x39e403)[_0x9526('0x27')](_0x5f21f0[_0x9526('0x2e')][_0x9526('0x6e')]?{'message':_0x9526('0x73'),'statusCode':_0x51fb6e[_0x9526('0x6f')]}:_0x51fb6e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index c99c18f..9184b3e 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 _0xb05f=['int_freshdesk_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x426711,_0x12264c){var _0x592991=function(_0x564614){while(--_0x564614){_0x426711['push'](_0x426711['shift']());}};_0x592991(++_0x12264c);}(_0xb05f,0x143));var _0xfb05=function(_0x220427,_0x40cfa9){_0x220427=_0x220427-0x0;var _0x342e1a=_0xb05f[_0x220427];return _0x342e1a;};'use strict';var _=require('lodash');var util=require(_0xfb05('0x0'));var logger=require(_0xfb05('0x1'))('api');var moment=require(_0xfb05('0x2'));var BPromise=require(_0xfb05('0x3'));var rp=require(_0xfb05('0x4'));var fs=require('fs');var path=require(_0xfb05('0x5'));var rimraf=require(_0xfb05('0x6'));var config=require(_0xfb05('0x7'));var attributes=require(_0xfb05('0x8'));var integrations=require(_0xfb05('0x9'));module[_0xfb05('0xa')]=function(_0x2e4c40,_0x1afe3c){return _0x2e4c40[_0xfb05('0xb')](_0xfb05('0xc'),attributes,{'tableName':_0xfb05('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0ae=['../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xc0ae,0x192));var _0xec0a=function(_0x2576a4,_0x1bba31){_0x2576a4=_0x2576a4-0x0;var _0x5a279e=_0xc0ae[_0x2576a4];return _0x5a279e;};'use strict';var _=require('lodash');var util=require(_0xec0a('0x0'));var logger=require(_0xec0a('0x1'))('api');var moment=require(_0xec0a('0x2'));var BPromise=require(_0xec0a('0x3'));var rp=require(_0xec0a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec0a('0x5'));var config=require(_0xec0a('0x6'));var attributes=require(_0xec0a('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xec0a('0x8')]=function(_0x5b7ea0,_0x33547e){return _0x5b7ea0[_0xec0a('0x9')](_0xec0a('0xa'),attributes,{'tableName':_0xec0a('0xb'),'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 be4de7a..e2d9b31 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 _0x2b36=['error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x27a7dd,_0x3eeadf){var _0x2d2b4a=function(_0x5bcb4a){while(--_0x5bcb4a){_0x27a7dd['push'](_0x27a7dd['shift']());}};_0x2d2b4a(++_0x3eeadf);}(_0x2b36,0x1ee));var _0x62b3=function(_0x11c9f3,_0x1f8ef1){_0x11c9f3=_0x11c9f3-0x0;var _0x5a5eaa=_0x2b36[_0x11c9f3];return _0x5a5eaa;};'use strict';var _=require(_0x62b3('0x0'));var util=require('util');var moment=require(_0x62b3('0x1'));var BPromise=require(_0x62b3('0x2'));var rs=require(_0x62b3('0x3'));var fs=require('fs');var Redis=require(_0x62b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x62b3('0x5'));var logger=require(_0x62b3('0x6'))(_0x62b3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x62b3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x265c95,_0x50150d,_0x1e3db1){return new BPromise(function(_0x1beff1,_0x1137b2){return client[_0x62b3('0x9')](_0x265c95,_0x1e3db1)[_0x62b3('0xa')](function(_0x4e0d94){logger[_0x62b3('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x50150d,_0x62b3('0xc'));logger[_0x62b3('0xd')](_0x62b3('0xe'),_0x50150d,'request\x20sent',JSON[_0x62b3('0xf')](_0x4e0d94));if(_0x4e0d94[_0x62b3('0x10')]){if(_0x4e0d94[_0x62b3('0x10')]['code']===0x1f4){logger[_0x62b3('0x10')](_0x62b3('0x11'),_0x50150d,_0x4e0d94[_0x62b3('0x10')][_0x62b3('0x12')]);return _0x1137b2(_0x4e0d94['error'][_0x62b3('0x12')]);}logger[_0x62b3('0x10')](_0x62b3('0x11'),_0x50150d,_0x4e0d94[_0x62b3('0x10')][_0x62b3('0x12')]);return _0x1beff1(_0x4e0d94[_0x62b3('0x10')][_0x62b3('0x12')]);}else{logger[_0x62b3('0xb')](_0x62b3('0x11'),_0x50150d,_0x62b3('0xc'));_0x1beff1(_0x4e0d94[_0x62b3('0x13')][_0x62b3('0x12')]);}})[_0x62b3('0x14')](function(_0x376257){logger[_0x62b3('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x50150d,_0x376257);_0x1137b2(_0x376257);});});}exports['GetFreshdeskAccount']=function(_0x847d3d){var _0x1bb889=this;return new Promise(function(_0x28c30b,_0x3bd5a7){return db[_0x62b3('0x15')][_0x62b3('0x16')]({'raw':_0x847d3d[_0x62b3('0x17')]?_0x847d3d[_0x62b3('0x17')][_0x62b3('0x18')]===undefined?!![]:![]:!![],'where':_0x847d3d[_0x62b3('0x17')]?_0x847d3d[_0x62b3('0x17')][_0x62b3('0x19')]||null:null,'attributes':_0x847d3d['options']?_0x847d3d[_0x62b3('0x17')][_0x62b3('0x1a')]||null:null,'limit':_0x847d3d[_0x62b3('0x17')]?_0x847d3d[_0x62b3('0x17')][_0x62b3('0x1b')]||null:null,'include':_0x847d3d[_0x62b3('0x17')]?_0x847d3d['options'][_0x62b3('0x1c')]?_['map'](_0x847d3d['options'][_0x62b3('0x1c')],function(_0x40f1f7){return{'model':db[_0x40f1f7[_0x62b3('0x1d')]],'as':_0x40f1f7['as'],'attributes':_0x40f1f7['attributes'],'include':_0x40f1f7[_0x62b3('0x1c')]?_[_0x62b3('0x1e')](_0x40f1f7[_0x62b3('0x1c')],function(_0x5629c4){return{'model':db[_0x5629c4[_0x62b3('0x1d')]],'as':_0x5629c4['as'],'attributes':_0x5629c4[_0x62b3('0x1a')],'include':_0x5629c4[_0x62b3('0x1c')]?_[_0x62b3('0x1e')](_0x5629c4[_0x62b3('0x1c')],function(_0xa9a60c){return{'model':db[_0xa9a60c[_0x62b3('0x1d')]],'as':_0xa9a60c['as'],'attributes':_0xa9a60c[_0x62b3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x62b3('0xa')](function(_0x4880b3){logger[_0x62b3('0xb')](_0x62b3('0x1f'),_0x847d3d);logger['debug'](_0x62b3('0x1f'),_0x847d3d,JSON[_0x62b3('0xf')](_0x4880b3));_0x28c30b(_0x4880b3);})[_0x62b3('0x14')](function(_0x5ceb22){logger[_0x62b3('0x10')]('GetFreshdeskAccount',_0x5ceb22[_0x62b3('0x12')],_0x847d3d);_0x3bd5a7(_0x1bb889[_0x62b3('0x10')](0x1f4,_0x5ceb22[_0x62b3('0x12')]));});});};exports[_0x62b3('0x20')]=function(_0x19baa5){var _0x56d5b6=this;return new Promise(function(_0x14975c,_0x2880c6){return db[_0x62b3('0x15')][_0x62b3('0x21')]({'raw':_0x19baa5[_0x62b3('0x17')]?_0x19baa5['options'][_0x62b3('0x18')]===undefined?!![]:![]:!![],'where':_0x19baa5['options']?_0x19baa5[_0x62b3('0x17')]['where']||null:null,'attributes':_0x19baa5[_0x62b3('0x17')]?_0x19baa5[_0x62b3('0x17')][_0x62b3('0x1a')]||null:null,'include':_0x19baa5[_0x62b3('0x17')]?_0x19baa5[_0x62b3('0x17')][_0x62b3('0x1c')]?_['map'](_0x19baa5[_0x62b3('0x17')][_0x62b3('0x1c')],function(_0xc022e2){return{'model':db[_0xc022e2[_0x62b3('0x1d')]],'as':_0xc022e2['as'],'attributes':_0xc022e2[_0x62b3('0x1a')],'include':_0xc022e2['include']?_[_0x62b3('0x1e')](_0xc022e2[_0x62b3('0x1c')],function(_0x5f0a68){return{'model':db[_0x5f0a68['model']],'as':_0x5f0a68['as'],'attributes':_0x5f0a68[_0x62b3('0x1a')],'include':_0x5f0a68['include']?_['map'](_0x5f0a68[_0x62b3('0x1c')],function(_0x159ea9){return{'model':db[_0x159ea9['model']],'as':_0x159ea9['as'],'attributes':_0x159ea9[_0x62b3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x62b3('0xa')](function(_0x804151){logger[_0x62b3('0xb')](_0x62b3('0x20'),_0x19baa5);logger[_0x62b3('0xd')](_0x62b3('0x20'),_0x19baa5,JSON[_0x62b3('0xf')](_0x804151));_0x14975c(_0x804151);})[_0x62b3('0x14')](function(_0x2c6d19){logger[_0x62b3('0x10')](_0x62b3('0x20'),_0x2c6d19['message'],_0x19baa5);_0x2880c6(_0x56d5b6[_0x62b3('0x10')](0x1f4,_0x2c6d19[_0x62b3('0x12')]));});});}; \ No newline at end of file +var _0x8066=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','map','model','include','message','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8066,0x83));var _0x6806=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x8066[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0x6806('0x0'));var util=require(_0x6806('0x1'));var moment=require('moment');var BPromise=require(_0x6806('0x2'));var rs=require(_0x6806('0x3'));var fs=require('fs');var Redis=require(_0x6806('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6806('0x5'))(_0x6806('0x6'));var config=require(_0x6806('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6806('0x8')][_0x6806('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44f219,_0x4ba573,_0x225638){return new BPromise(function(_0xedf438,_0x2fce36){return client[_0x6806('0xa')](_0x44f219,_0x225638)[_0x6806('0xb')](function(_0x3a3129){logger[_0x6806('0xc')](_0x6806('0xd'),_0x4ba573,_0x6806('0xe'));logger[_0x6806('0xf')](_0x6806('0x10'),_0x4ba573,'request\x20sent',JSON[_0x6806('0x11')](_0x3a3129));if(_0x3a3129[_0x6806('0x12')]){if(_0x3a3129[_0x6806('0x12')][_0x6806('0x13')]===0x1f4){logger[_0x6806('0x12')](_0x6806('0xd'),_0x4ba573,_0x3a3129[_0x6806('0x12')]['message']);return _0x2fce36(_0x3a3129['error']['message']);}logger['error'](_0x6806('0xd'),_0x4ba573,_0x3a3129[_0x6806('0x12')]['message']);return _0xedf438(_0x3a3129[_0x6806('0x12')]['message']);}else{logger[_0x6806('0xc')](_0x6806('0xd'),_0x4ba573,_0x6806('0xe'));_0xedf438(_0x3a3129['result']['message']);}})[_0x6806('0x14')](function(_0x1746ea){logger['error'](_0x6806('0xd'),_0x4ba573,_0x1746ea);_0x2fce36(_0x1746ea);});});}exports[_0x6806('0x15')]=function(_0x3e0353){var _0x456de0=this;return new Promise(function(_0x55e173,_0x1a5533){return db[_0x6806('0x16')]['findAll']({'raw':_0x3e0353[_0x6806('0x17')]?_0x3e0353[_0x6806('0x17')][_0x6806('0x18')]===undefined?!![]:![]:!![],'where':_0x3e0353[_0x6806('0x17')]?_0x3e0353[_0x6806('0x17')][_0x6806('0x19')]||null:null,'attributes':_0x3e0353[_0x6806('0x17')]?_0x3e0353[_0x6806('0x17')][_0x6806('0x1a')]||null:null,'limit':_0x3e0353['options']?_0x3e0353[_0x6806('0x17')][_0x6806('0x1b')]||null:null,'include':_0x3e0353['options']?_0x3e0353[_0x6806('0x17')]['include']?_[_0x6806('0x1c')](_0x3e0353[_0x6806('0x17')]['include'],function(_0x2c1eea){return{'model':db[_0x2c1eea[_0x6806('0x1d')]],'as':_0x2c1eea['as'],'attributes':_0x2c1eea['attributes'],'include':_0x2c1eea[_0x6806('0x1e')]?_[_0x6806('0x1c')](_0x2c1eea[_0x6806('0x1e')],function(_0x20823c){return{'model':db[_0x20823c[_0x6806('0x1d')]],'as':_0x20823c['as'],'attributes':_0x20823c[_0x6806('0x1a')],'include':_0x20823c['include']?_[_0x6806('0x1c')](_0x20823c[_0x6806('0x1e')],function(_0x9538a){return{'model':db[_0x9538a[_0x6806('0x1d')]],'as':_0x9538a['as'],'attributes':_0x9538a[_0x6806('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6806('0xb')](function(_0x199d60){logger['info'](_0x6806('0x15'),_0x3e0353);logger[_0x6806('0xf')](_0x6806('0x15'),_0x3e0353,JSON[_0x6806('0x11')](_0x199d60));_0x55e173(_0x199d60);})[_0x6806('0x14')](function(_0x4136de){logger[_0x6806('0x12')](_0x6806('0x15'),_0x4136de[_0x6806('0x1f')],_0x3e0353);_0x1a5533(_0x456de0['error'](0x1f4,_0x4136de[_0x6806('0x1f')]));});});};exports[_0x6806('0x20')]=function(_0x43377e){var _0x2c7eab=this;return new Promise(function(_0x393f7e,_0x3da2fe){return db[_0x6806('0x16')][_0x6806('0x21')]({'raw':_0x43377e[_0x6806('0x17')]?_0x43377e['options'][_0x6806('0x18')]===undefined?!![]:![]:!![],'where':_0x43377e[_0x6806('0x17')]?_0x43377e['options'][_0x6806('0x19')]||null:null,'attributes':_0x43377e[_0x6806('0x17')]?_0x43377e[_0x6806('0x17')]['attributes']||null:null,'include':_0x43377e[_0x6806('0x17')]?_0x43377e[_0x6806('0x17')][_0x6806('0x1e')]?_[_0x6806('0x1c')](_0x43377e[_0x6806('0x17')][_0x6806('0x1e')],function(_0x1c2cc1){return{'model':db[_0x1c2cc1[_0x6806('0x1d')]],'as':_0x1c2cc1['as'],'attributes':_0x1c2cc1[_0x6806('0x1a')],'include':_0x1c2cc1[_0x6806('0x1e')]?_[_0x6806('0x1c')](_0x1c2cc1[_0x6806('0x1e')],function(_0x1d83af){return{'model':db[_0x1d83af[_0x6806('0x1d')]],'as':_0x1d83af['as'],'attributes':_0x1d83af[_0x6806('0x1a')],'include':_0x1d83af[_0x6806('0x1e')]?_['map'](_0x1d83af[_0x6806('0x1e')],function(_0x4cb8f4){return{'model':db[_0x4cb8f4['model']],'as':_0x4cb8f4['as'],'attributes':_0x4cb8f4[_0x6806('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ef2ca){logger[_0x6806('0xc')](_0x6806('0x20'),_0x43377e);logger[_0x6806('0xf')](_0x6806('0x20'),_0x43377e,JSON[_0x6806('0x11')](_0x1ef2ca));_0x393f7e(_0x1ef2ca);})[_0x6806('0x14')](function(_0x5ce3fd){logger['error']('ShowFreshdeskAccount',_0x5ce3fd[_0x6806('0x1f')],_0x43377e);_0x3da2fe(_0x2c7eab[_0x6806('0x12')](0x1f4,_0x5ce3fd[_0x6806('0x1f')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index de7f347..2b8a161 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 _0x775a=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x775a,0x83));var _0xa775=function(_0x1a5a21,_0x3d51bd){_0x1a5a21=_0x1a5a21-0x0;var _0x17e5f9=_0x775a[_0x1a5a21];return _0x17e5f9;};'use strict';var multer=require(_0xa775('0x0'));var util=require(_0xa775('0x1'));var path=require(_0xa775('0x2'));var timeout=require(_0xa775('0x3'));var express=require(_0xa775('0x4'));var router=express['Router']();var fs_extra=require(_0xa775('0x5'));var auth=require(_0xa775('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa775('0x7'));var controller=require(_0xa775('0x8'));router[_0xa775('0x9')]('/',auth[_0xa775('0xa')](),controller[_0xa775('0xb')]);router[_0xa775('0x9')](_0xa775('0xc'),auth[_0xa775('0xa')](),controller[_0xa775('0xd')]);router[_0xa775('0x9')](_0xa775('0xe'),auth[_0xa775('0xa')](),controller[_0xa775('0xf')]);router[_0xa775('0x9')](_0xa775('0x10'),auth[_0xa775('0xa')](),controller[_0xa775('0x11')]);router['get']('/:id/descriptions',auth[_0xa775('0xa')](),controller[_0xa775('0x12')]);router[_0xa775('0x9')](_0xa775('0x13'),auth[_0xa775('0xa')](),controller['getTags']);router['post']('/',auth[_0xa775('0xa')](),controller[_0xa775('0x14')]);router[_0xa775('0x15')](_0xa775('0x13'),auth[_0xa775('0xa')](),controller[_0xa775('0x16')]);router[_0xa775('0x17')](_0xa775('0xc'),auth[_0xa775('0xa')](),controller[_0xa775('0x18')]);router[_0xa775('0x19')](_0xa775('0xc'),auth['isAuthenticated'](),controller[_0xa775('0x1a')]);module[_0xa775('0x1b')]=router; \ No newline at end of file +var _0xe61e=['update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put'];(function(_0x3a75a1,_0x18842d){var _0x1f9f87=function(_0x1f21c2){while(--_0x1f21c2){_0x3a75a1['push'](_0x3a75a1['shift']());}};_0x1f9f87(++_0x18842d);}(_0xe61e,0xca));var _0xee61=function(_0x271c16,_0x1396f7){_0x271c16=_0x271c16-0x0;var _0x2bdcf5=_0xe61e[_0x271c16];return _0x2bdcf5;};'use strict';var multer=require(_0xee61('0x0'));var util=require(_0xee61('0x1'));var path=require('path');var timeout=require(_0xee61('0x2'));var express=require(_0xee61('0x3'));var router=express[_0xee61('0x4')]();var fs_extra=require(_0xee61('0x5'));var auth=require(_0xee61('0x6'));var interaction=require(_0xee61('0x7'));var config=require('../../config/environment');var controller=require(_0xee61('0x8'));router[_0xee61('0x9')]('/',auth[_0xee61('0xa')](),controller[_0xee61('0xb')]);router[_0xee61('0x9')](_0xee61('0xc'),auth['isAuthenticated'](),controller[_0xee61('0xd')]);router['get'](_0xee61('0xe'),auth[_0xee61('0xa')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xee61('0xa')](),controller[_0xee61('0xf')]);router['get'](_0xee61('0x10'),auth[_0xee61('0xa')](),controller[_0xee61('0x11')]);router['get'](_0xee61('0x12'),auth['isAuthenticated'](),controller['getTags']);router[_0xee61('0x13')]('/',auth[_0xee61('0xa')](),controller[_0xee61('0x14')]);router[_0xee61('0x13')](_0xee61('0x12'),auth[_0xee61('0xa')](),controller[_0xee61('0x15')]);router[_0xee61('0x16')](_0xee61('0xc'),auth[_0xee61('0xa')](),controller[_0xee61('0x17')]);router[_0xee61('0x18')](_0xee61('0xc'),auth[_0xee61('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index cfc49cd..f5c7911 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 _0xad27=['STRING','sequelize','exports'];(function(_0x3b5794,_0x254fa1){var _0x5ac592=function(_0x10fb9b){while(--_0x10fb9b){_0x3b5794['push'](_0x3b5794['shift']());}};_0x5ac592(++_0x254fa1);}(_0xad27,0xb5));var _0x7ad2=function(_0x6e5259,_0x3a1df4){_0x6e5259=_0x6e5259-0x0;var _0xd26e6e=_0xad27[_0x6e5259];return _0xd26e6e;};'use strict';var Sequelize=require(_0x7ad2('0x0'));module[_0x7ad2('0x1')]={'name':{'type':Sequelize[_0x7ad2('0x2')]},'description':{'type':Sequelize[_0x7ad2('0x2')]}}; \ No newline at end of file +var _0x2d2d=['exports','STRING','sequelize'];(function(_0x4fb89b,_0xd3eadb){var _0x5b7aa2=function(_0x181190){while(--_0x181190){_0x4fb89b['push'](_0x4fb89b['shift']());}};_0x5b7aa2(++_0xd3eadb);}(_0x2d2d,0x131));var _0xd2d2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2d2d[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0xd2d2('0x0'));module[_0xd2d2('0x1')]={'name':{'type':Sequelize[_0xd2d2('0x2')]},'description':{'type':Sequelize[_0xd2d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 1978a9d..808f8b8 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 _0xe0b6=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','merge','VIRTUAL','filter','options','where','rows','params','rawAttributes','include','find','catch','create','body','FreshdeskField','order','getFields','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','FreshdeskConfiguration','fieldName','type','key','model','map'];(function(_0x5be4bf,_0x4e9512){var _0x273ed3=function(_0x1c8f32){while(--_0x1c8f32){_0x5be4bf['push'](_0x5be4bf['shift']());}};_0x273ed3(++_0x4e9512);}(_0xe0b6,0xc8));var _0x6e0b=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0xe0b6[_0x9edfd5];return _0x330738;};'use strict';var emlformat=require(_0x6e0b('0x0'));var rimraf=require(_0x6e0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6e0b('0x2'));var moment=require(_0x6e0b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6e0b('0x4'));var path=require(_0x6e0b('0x5'));var sox=require(_0x6e0b('0x6'));var csv=require('to-csv');var ejs=require(_0x6e0b('0x7'));var fs=require('fs');var fs_extra=require(_0x6e0b('0x8'));var _=require(_0x6e0b('0x9'));var squel=require('squel');var crypto=require(_0x6e0b('0xa'));var jsforce=require(_0x6e0b('0xb'));var deskjs=require(_0x6e0b('0xc'));var toCsv=require(_0x6e0b('0xd'));var querystring=require('querystring');var Papa=require(_0x6e0b('0xe'));var Redis=require(_0x6e0b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6e0b('0x10'));var as=require(_0x6e0b('0x11'));var hardwareService=require(_0x6e0b('0x12'));var logger=require('../../config/logger')(_0x6e0b('0x13'));var utils=require(_0x6e0b('0x14'));var config=require(_0x6e0b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e0b('0x16'))['db'];function respondWithStatusCode(_0x3a468a,_0x496565){_0x496565=_0x496565||0xcc;return function(_0x491158){if(_0x491158){return _0x3a468a['sendStatus'](_0x496565);}return _0x3a468a[_0x6e0b('0x17')](_0x496565)[_0x6e0b('0x18')]();};}function respondWithResult(_0x40e553,_0x56346b){_0x56346b=_0x56346b||0xc8;return function(_0x5627de){if(_0x5627de){return _0x40e553[_0x6e0b('0x17')](_0x56346b)[_0x6e0b('0x19')](_0x5627de);}};}function respondWithFilteredResult(_0xbba2cc,_0x44f830){return function(_0x1a8704){if(_0x1a8704){var _0xe1070a=typeof _0x44f830[_0x6e0b('0x1a')]===_0x6e0b('0x1b')&&typeof _0x44f830['limit']==='undefined';var _0x3af7b4=_0x1a8704[_0x6e0b('0x1c')];var _0x17d91a=_0xe1070a?0x0:_0x44f830[_0x6e0b('0x1a')];var _0x28d2c3=_0xe1070a?_0x1a8704[_0x6e0b('0x1c')]:_0x44f830[_0x6e0b('0x1a')]+_0x44f830[_0x6e0b('0x1d')];var _0x4ea3e9;if(_0x28d2c3>=_0x3af7b4){_0x28d2c3=_0x3af7b4;_0x4ea3e9=0xc8;}else{_0x4ea3e9=0xce;}_0xbba2cc[_0x6e0b('0x17')](_0x4ea3e9);return _0xbba2cc['set'](_0x6e0b('0x1e'),_0x17d91a+'-'+_0x28d2c3+'/'+_0x3af7b4)[_0x6e0b('0x19')](_0x1a8704);}return null;};}function patchUpdates(_0x40d585){return function(_0x2ce16c){try{jsonpatch[_0x6e0b('0x1f')](_0x2ce16c,_0x40d585,!![]);}catch(_0x1c2809){return BPromise[_0x6e0b('0x20')](_0x1c2809);}return _0x2ce16c[_0x6e0b('0x21')]();};}function saveUpdates(_0x5784d3,_0x34c986){return function(_0x39558b){if(_0x39558b){return _0x39558b[_0x6e0b('0x22')](_0x5784d3)['then'](function(_0x14704f){return _0x14704f;});}return null;};}function removeEntity(_0x48a6c3,_0x2236ce){return function(_0x131658){if(_0x131658){return _0x131658[_0x6e0b('0x23')]()[_0x6e0b('0x24')](function(){_0x48a6c3[_0x6e0b('0x17')](0xcc)[_0x6e0b('0x18')]();});}};}function handleEntityNotFound(_0x3de863,_0x30fe4f){return function(_0x490392){if(!_0x490392){_0x3de863[_0x6e0b('0x25')](0x194);}return _0x490392;};}function handleError(_0x2d9742,_0x5a0b4e){_0x5a0b4e=_0x5a0b4e||0x1f4;return function(_0x524619){logger[_0x6e0b('0x26')](_0x524619[_0x6e0b('0x27')]);if(_0x524619[_0x6e0b('0x28')]){delete _0x524619['name'];}_0x2d9742['status'](_0x5a0b4e)[_0x6e0b('0x29')](_0x524619);};}exports[_0x6e0b('0x2a')]=function(_0x51fc9b,_0x2baa5b){var _0x423b52={},_0x4bc4c1={},_0x499f73={'count':0x0,'rows':[]};var _0x3f27c6=_['map'](db[_0x6e0b('0x2b')]['rawAttributes'],function(_0x494106){return{'name':_0x494106[_0x6e0b('0x2c')],'type':_0x494106[_0x6e0b('0x2d')][_0x6e0b('0x2e')]};});_0x4bc4c1[_0x6e0b('0x2f')]=_[_0x6e0b('0x30')](_0x3f27c6,_0x6e0b('0x28'));_0x4bc4c1[_0x6e0b('0x31')]=_[_0x6e0b('0x32')](_0x51fc9b['query']);_0x4bc4c1['filters']=_[_0x6e0b('0x33')](_0x4bc4c1[_0x6e0b('0x2f')],_0x4bc4c1[_0x6e0b('0x31')]);_0x423b52[_0x6e0b('0x34')]=_['intersection'](_0x4bc4c1[_0x6e0b('0x2f')],qs[_0x6e0b('0x35')](_0x51fc9b[_0x6e0b('0x31')]['fields']));_0x423b52['attributes']=_0x423b52[_0x6e0b('0x34')][_0x6e0b('0x36')]?_0x423b52[_0x6e0b('0x34')]:_0x4bc4c1[_0x6e0b('0x2f')];if(!_0x51fc9b['query'][_0x6e0b('0x37')](_0x6e0b('0x38'))){_0x423b52[_0x6e0b('0x1d')]=qs['limit'](_0x51fc9b[_0x6e0b('0x31')]['limit']);_0x423b52[_0x6e0b('0x1a')]=qs[_0x6e0b('0x1a')](_0x51fc9b[_0x6e0b('0x31')]['offset']);}_0x423b52['order']=qs[_0x6e0b('0x39')](_0x51fc9b['query'][_0x6e0b('0x39')]);_0x423b52['where']=qs['filters'](_[_0x6e0b('0x3a')](_0x51fc9b[_0x6e0b('0x31')],_0x4bc4c1[_0x6e0b('0x3b')]),_0x3f27c6);if(_0x51fc9b[_0x6e0b('0x31')]['filter']){_0x423b52['where']=_[_0x6e0b('0x3c')](_0x423b52['where'],{'$or':_[_0x6e0b('0x30')](_0x3f27c6,function(_0x5af83f){if(_0x5af83f[_0x6e0b('0x2d')]!==_0x6e0b('0x3d')){var _0xd458d2={};_0xd458d2[_0x5af83f[_0x6e0b('0x28')]]={'$like':'%'+_0x51fc9b['query'][_0x6e0b('0x3e')]+'%'};return _0xd458d2;}})});}_0x423b52=_[_0x6e0b('0x3c')]({},_0x423b52,_0x51fc9b[_0x6e0b('0x3f')]);var _0x4a3593={'where':_0x423b52[_0x6e0b('0x40')]};return db['FreshdeskConfiguration'][_0x6e0b('0x1c')](_0x4a3593)[_0x6e0b('0x24')](function(_0x488f7f){_0x499f73[_0x6e0b('0x1c')]=_0x488f7f;if(_0x51fc9b['query']['includeAll']){_0x423b52['include']=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x423b52);})[_0x6e0b('0x24')](function(_0x23cd2c){_0x499f73[_0x6e0b('0x41')]=_0x23cd2c;return _0x499f73;})[_0x6e0b('0x24')](respondWithFilteredResult(_0x2baa5b,_0x423b52))['catch'](handleError(_0x2baa5b,null));};exports['show']=function(_0x413a44,_0x31b845){var _0x22e993={'raw':![],'where':{'id':_0x413a44[_0x6e0b('0x42')]['id']}},_0x5c5988={};_0x5c5988[_0x6e0b('0x2f')]=_[_0x6e0b('0x32')](db[_0x6e0b('0x2b')][_0x6e0b('0x43')]);_0x5c5988[_0x6e0b('0x31')]=_[_0x6e0b('0x32')](_0x413a44[_0x6e0b('0x31')]);_0x5c5988[_0x6e0b('0x3b')]=_['intersection'](_0x5c5988['model'],_0x5c5988['query']);_0x22e993[_0x6e0b('0x34')]=_[_0x6e0b('0x33')](_0x5c5988['model'],qs[_0x6e0b('0x35')](_0x413a44['query']['fields']));_0x22e993[_0x6e0b('0x34')]=_0x22e993['attributes'][_0x6e0b('0x36')]?_0x22e993[_0x6e0b('0x34')]:_0x5c5988['model'];if(_0x413a44[_0x6e0b('0x31')]['includeAll']){_0x22e993[_0x6e0b('0x44')]=[{'all':!![]}];}_0x22e993=_['merge']({},_0x22e993,_0x413a44[_0x6e0b('0x3f')]);return db[_0x6e0b('0x2b')][_0x6e0b('0x45')](_0x22e993)[_0x6e0b('0x24')](handleEntityNotFound(_0x31b845,null))[_0x6e0b('0x24')](respondWithResult(_0x31b845,null))[_0x6e0b('0x46')](handleError(_0x31b845,null));};exports[_0x6e0b('0x47')]=function(_0x11084a,_0x17e525){return db['FreshdeskConfiguration'][_0x6e0b('0x47')](_0x11084a[_0x6e0b('0x48')],{})[_0x6e0b('0x24')](respondWithResult(_0x17e525,0xc9))[_0x6e0b('0x46')](handleError(_0x17e525,null));};exports['update']=function(_0x39bfa4,_0xbea67d){if(_0x39bfa4['body']['id']){delete _0x39bfa4[_0x6e0b('0x48')]['id'];}return db[_0x6e0b('0x2b')][_0x6e0b('0x45')]({'where':{'id':_0x39bfa4[_0x6e0b('0x42')]['id']}})[_0x6e0b('0x24')](handleEntityNotFound(_0xbea67d,null))[_0x6e0b('0x24')](saveUpdates(_0x39bfa4['body'],null))[_0x6e0b('0x24')](respondWithResult(_0xbea67d,null))[_0x6e0b('0x46')](handleError(_0xbea67d,null));};exports['destroy']=function(_0xe5787c,_0x10d1f9){return db[_0x6e0b('0x2b')][_0x6e0b('0x45')]({'where':{'id':_0xe5787c[_0x6e0b('0x42')]['id']}})[_0x6e0b('0x24')](handleEntityNotFound(_0x10d1f9,null))[_0x6e0b('0x24')](removeEntity(_0x10d1f9,null))['catch'](handleError(_0x10d1f9,null));};exports['getFields']=function(_0x3c139a,_0x2d7725,_0xc61e45){var _0x4aa609={};var _0x470a16={};var _0x15fcf7;var _0x20d04d;return db[_0x6e0b('0x2b')]['findOne']({'where':{'id':_0x3c139a[_0x6e0b('0x42')]['id']}})[_0x6e0b('0x24')](handleEntityNotFound(_0x2d7725,null))[_0x6e0b('0x24')](function(_0xc37f91){if(_0xc37f91){_0x15fcf7=_0xc37f91;_0x470a16[_0x6e0b('0x2f')]=_[_0x6e0b('0x32')](db[_0x6e0b('0x49')][_0x6e0b('0x43')]);_0x470a16[_0x6e0b('0x31')]=_[_0x6e0b('0x32')](_0x3c139a[_0x6e0b('0x31')]);_0x470a16['filters']=_[_0x6e0b('0x33')](_0x470a16[_0x6e0b('0x2f')],_0x470a16[_0x6e0b('0x31')]);_0x4aa609[_0x6e0b('0x34')]=_[_0x6e0b('0x33')](_0x470a16[_0x6e0b('0x2f')],qs['fields'](_0x3c139a[_0x6e0b('0x31')][_0x6e0b('0x35')]));_0x4aa609['attributes']=_0x4aa609['attributes']['length']?_0x4aa609['attributes']:_0x470a16['model'];_0x4aa609[_0x6e0b('0x4a')]=qs['sort'](_0x3c139a[_0x6e0b('0x31')]['sort']);_0x4aa609[_0x6e0b('0x40')]=qs[_0x6e0b('0x3b')](_['pick'](_0x3c139a[_0x6e0b('0x31')],_0x470a16[_0x6e0b('0x3b')]));if(_0x3c139a[_0x6e0b('0x31')][_0x6e0b('0x3e')]){_0x4aa609[_0x6e0b('0x40')]=_[_0x6e0b('0x3c')](_0x4aa609[_0x6e0b('0x40')],{'$or':_[_0x6e0b('0x30')](_0x4aa609['attributes'],function(_0x3d71d8){var _0x49193e={};_0x49193e[_0x3d71d8]={'$like':'%'+_0x3c139a[_0x6e0b('0x31')][_0x6e0b('0x3e')]+'%'};return _0x49193e;})});}_0x4aa609=_['merge']({},_0x4aa609,_0x3c139a[_0x6e0b('0x3f')]);return _0x15fcf7[_0x6e0b('0x4b')](_0x4aa609);}})['then'](function(_0x13501f){if(_0x13501f){_0x20d04d=_0x13501f['length'];if(!_0x3c139a[_0x6e0b('0x31')][_0x6e0b('0x37')](_0x6e0b('0x38'))){_0x4aa609['limit']=qs[_0x6e0b('0x1d')](_0x3c139a[_0x6e0b('0x31')][_0x6e0b('0x1d')]);_0x4aa609['offset']=qs[_0x6e0b('0x1a')](_0x3c139a[_0x6e0b('0x31')]['offset']);}return _0x15fcf7['getFields'](_0x4aa609);}})['then'](function(_0x329286){if(_0x329286){return _0x329286?{'count':_0x20d04d,'rows':_0x329286}:null;}})[_0x6e0b('0x24')](respondWithResult(_0x2d7725,null))['catch'](handleError(_0x2d7725,null));};exports[_0x6e0b('0x4c')]=function(_0x54ce12,_0x4893bd,_0x3af85a){var _0x52133b={};var _0x3b93c4={};var _0x1f320c;var _0x2584e8;return db[_0x6e0b('0x2b')][_0x6e0b('0x4d')]({'where':{'id':_0x54ce12[_0x6e0b('0x42')]['id']}})[_0x6e0b('0x24')](handleEntityNotFound(_0x4893bd,null))[_0x6e0b('0x24')](function(_0x581f58){if(_0x581f58){_0x1f320c=_0x581f58;_0x3b93c4[_0x6e0b('0x2f')]=_[_0x6e0b('0x32')](db[_0x6e0b('0x49')][_0x6e0b('0x43')]);_0x3b93c4[_0x6e0b('0x31')]=_[_0x6e0b('0x32')](_0x54ce12[_0x6e0b('0x31')]);_0x3b93c4[_0x6e0b('0x3b')]=_[_0x6e0b('0x33')](_0x3b93c4['model'],_0x3b93c4[_0x6e0b('0x31')]);_0x52133b[_0x6e0b('0x34')]=_[_0x6e0b('0x33')](_0x3b93c4[_0x6e0b('0x2f')],qs[_0x6e0b('0x35')](_0x54ce12[_0x6e0b('0x31')][_0x6e0b('0x35')]));_0x52133b[_0x6e0b('0x34')]=_0x52133b['attributes']['length']?_0x52133b[_0x6e0b('0x34')]:_0x3b93c4[_0x6e0b('0x2f')];_0x52133b['order']=qs[_0x6e0b('0x39')](_0x54ce12[_0x6e0b('0x31')][_0x6e0b('0x39')]);_0x52133b['where']=qs[_0x6e0b('0x3b')](_[_0x6e0b('0x3a')](_0x54ce12[_0x6e0b('0x31')],_0x3b93c4[_0x6e0b('0x3b')]));if(_0x54ce12[_0x6e0b('0x31')]['filter']){_0x52133b[_0x6e0b('0x40')]=_['merge'](_0x52133b[_0x6e0b('0x40')],{'$or':_['map'](_0x52133b[_0x6e0b('0x34')],function(_0x51aaea){var _0x4fceb8={};_0x4fceb8[_0x51aaea]={'$like':'%'+_0x54ce12[_0x6e0b('0x31')][_0x6e0b('0x3e')]+'%'};return _0x4fceb8;})});}_0x52133b=_[_0x6e0b('0x3c')]({},_0x52133b,_0x54ce12[_0x6e0b('0x3f')]);return _0x1f320c[_0x6e0b('0x4c')](_0x52133b);}})[_0x6e0b('0x24')](function(_0x46f621){if(_0x46f621){_0x2584e8=_0x46f621['length'];if(!_0x54ce12[_0x6e0b('0x31')][_0x6e0b('0x37')](_0x6e0b('0x38'))){_0x52133b['limit']=qs[_0x6e0b('0x1d')](_0x54ce12[_0x6e0b('0x31')]['limit']);_0x52133b[_0x6e0b('0x1a')]=qs['offset'](_0x54ce12[_0x6e0b('0x31')][_0x6e0b('0x1a')]);}return _0x1f320c[_0x6e0b('0x4c')](_0x52133b);}})[_0x6e0b('0x24')](function(_0x303e01){if(_0x303e01){return _0x303e01?{'count':_0x2584e8,'rows':_0x303e01}:null;}})['then'](respondWithResult(_0x4893bd,null))[_0x6e0b('0x46')](handleError(_0x4893bd,null));};exports[_0x6e0b('0x4e')]=function(_0x3974d0,_0xe6f5e0,_0x4aa22b){var _0x121abf={};var _0x4b242c={};var _0x21185c;var _0x520e55;return db['FreshdeskConfiguration'][_0x6e0b('0x4d')]({'where':{'id':_0x3974d0[_0x6e0b('0x42')]['id']}})[_0x6e0b('0x24')](handleEntityNotFound(_0xe6f5e0,null))[_0x6e0b('0x24')](function(_0x4843b4){if(_0x4843b4){_0x21185c=_0x4843b4;_0x4b242c[_0x6e0b('0x2f')]=_['keys'](db[_0x6e0b('0x49')][_0x6e0b('0x43')]);_0x4b242c[_0x6e0b('0x31')]=_[_0x6e0b('0x32')](_0x3974d0[_0x6e0b('0x31')]);_0x4b242c[_0x6e0b('0x3b')]=_['intersection'](_0x4b242c[_0x6e0b('0x2f')],_0x4b242c[_0x6e0b('0x31')]);_0x121abf[_0x6e0b('0x34')]=_[_0x6e0b('0x33')](_0x4b242c[_0x6e0b('0x2f')],qs[_0x6e0b('0x35')](_0x3974d0['query']['fields']));_0x121abf[_0x6e0b('0x34')]=_0x121abf[_0x6e0b('0x34')][_0x6e0b('0x36')]?_0x121abf[_0x6e0b('0x34')]:_0x4b242c['model'];_0x121abf[_0x6e0b('0x4a')]=qs[_0x6e0b('0x39')](_0x3974d0['query'][_0x6e0b('0x39')]);_0x121abf[_0x6e0b('0x40')]=qs[_0x6e0b('0x3b')](_['pick'](_0x3974d0[_0x6e0b('0x31')],_0x4b242c[_0x6e0b('0x3b')]));if(_0x3974d0['query']['filter']){_0x121abf[_0x6e0b('0x40')]=_[_0x6e0b('0x3c')](_0x121abf['where'],{'$or':_[_0x6e0b('0x30')](_0x121abf['attributes'],function(_0x4914b3){var _0x28678e={};_0x28678e[_0x4914b3]={'$like':'%'+_0x3974d0[_0x6e0b('0x31')]['filter']+'%'};return _0x28678e;})});}_0x121abf=_[_0x6e0b('0x3c')]({},_0x121abf,_0x3974d0[_0x6e0b('0x3f')]);return _0x21185c['getDescriptions'](_0x121abf);}})['then'](function(_0x281e50){if(_0x281e50){_0x520e55=_0x281e50[_0x6e0b('0x36')];if(!_0x3974d0['query'][_0x6e0b('0x37')](_0x6e0b('0x38'))){_0x121abf['limit']=qs[_0x6e0b('0x1d')](_0x3974d0[_0x6e0b('0x31')][_0x6e0b('0x1d')]);_0x121abf[_0x6e0b('0x1a')]=qs[_0x6e0b('0x1a')](_0x3974d0[_0x6e0b('0x31')][_0x6e0b('0x1a')]);}return _0x21185c[_0x6e0b('0x4e')](_0x121abf);}})[_0x6e0b('0x24')](function(_0x2e06ff){if(_0x2e06ff){return _0x2e06ff?{'count':_0x520e55,'rows':_0x2e06ff}:null;}})[_0x6e0b('0x24')](respondWithResult(_0xe6f5e0,null))[_0x6e0b('0x46')](handleError(_0xe6f5e0,null));};exports['getTags']=function(_0x551394,_0x40410f,_0x5b4fe9){var _0x892409={};var _0x2fda58={};var _0x12b7f4;var _0x314458;return db['FreshdeskConfiguration'][_0x6e0b('0x4d')]({'where':{'id':_0x551394[_0x6e0b('0x42')]['id']}})['then'](handleEntityNotFound(_0x40410f,null))[_0x6e0b('0x24')](function(_0x510151){if(_0x510151){_0x12b7f4=_0x510151;_0x2fda58[_0x6e0b('0x2f')]=_[_0x6e0b('0x32')](db[_0x6e0b('0x4f')][_0x6e0b('0x43')]);_0x2fda58[_0x6e0b('0x31')]=_['keys'](_0x551394['query']);_0x2fda58[_0x6e0b('0x3b')]=_[_0x6e0b('0x33')](_0x2fda58[_0x6e0b('0x2f')],_0x2fda58[_0x6e0b('0x31')]);_0x892409[_0x6e0b('0x34')]=_[_0x6e0b('0x33')](_0x2fda58['model'],qs['fields'](_0x551394[_0x6e0b('0x31')][_0x6e0b('0x35')]));_0x892409[_0x6e0b('0x34')]=_0x892409[_0x6e0b('0x34')][_0x6e0b('0x36')]?_0x892409[_0x6e0b('0x34')]:_0x2fda58[_0x6e0b('0x2f')];_0x892409['order']=qs[_0x6e0b('0x39')](_0x551394[_0x6e0b('0x31')][_0x6e0b('0x39')]);_0x892409['where']=qs[_0x6e0b('0x3b')](_['pick'](_0x551394[_0x6e0b('0x31')],_0x2fda58['filters']));if(_0x551394['query'][_0x6e0b('0x3e')]){_0x892409[_0x6e0b('0x40')]=_[_0x6e0b('0x3c')](_0x892409['where'],{'$or':_['map'](_0x892409[_0x6e0b('0x34')],function(_0x8ac445){var _0x306cd8={};_0x306cd8[_0x8ac445]={'$like':'%'+_0x551394['query'][_0x6e0b('0x3e')]+'%'};return _0x306cd8;})});}_0x892409=_['merge']({},_0x892409,_0x551394[_0x6e0b('0x3f')]);return _0x12b7f4[_0x6e0b('0x50')](_0x892409);}})[_0x6e0b('0x24')](function(_0x35d695){if(_0x35d695){_0x314458=_0x35d695[_0x6e0b('0x36')];if(!_0x551394[_0x6e0b('0x31')][_0x6e0b('0x37')](_0x6e0b('0x38'))){_0x892409[_0x6e0b('0x1d')]=qs[_0x6e0b('0x1d')](_0x551394[_0x6e0b('0x31')][_0x6e0b('0x1d')]);_0x892409[_0x6e0b('0x1a')]=qs[_0x6e0b('0x1a')](_0x551394['query'][_0x6e0b('0x1a')]);}return _0x12b7f4[_0x6e0b('0x50')](_0x892409);}})['then'](function(_0x271da5){if(_0x271da5){return _0x271da5?{'count':_0x314458,'rows':_0x271da5}:null;}})[_0x6e0b('0x24')](respondWithResult(_0x40410f,null))[_0x6e0b('0x46')](handleError(_0x40410f,null));};exports[_0x6e0b('0x51')]=function(_0x5e2bdb,_0x1501dc,_0x111e15){if(_0x5e2bdb[_0x6e0b('0x48')]['id']){delete _0x5e2bdb[_0x6e0b('0x48')]['id'];}return db[_0x6e0b('0x2b')][_0x6e0b('0x4d')]({'where':{'id':_0x5e2bdb[_0x6e0b('0x42')]['id']}})[_0x6e0b('0x24')](handleEntityNotFound(_0x1501dc,null))[_0x6e0b('0x24')](function(_0x53a237){if(_0x53a237){return _0x53a237[_0x6e0b('0x51')](_0x5e2bdb['body'][_0x6e0b('0x52')]||[]);}return null;})[_0x6e0b('0x24')](respondWithResult(_0x1501dc,null))[_0x6e0b('0x46')](handleError(_0x1501dc,null));}; \ No newline at end of file +var _0xd5c6=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','find','create','body','FreshdeskField','map','options','getFields','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x1a1639,_0xa100f1){var _0x12e31f=function(_0x2f1a84){while(--_0x2f1a84){_0x1a1639['push'](_0x1a1639['shift']());}};_0x12e31f(++_0xa100f1);}(_0xd5c6,0xa1));var _0x6d5c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd5c6[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x6d5c('0x0'));var rimraf=require(_0x6d5c('0x1'));var zipdir=require(_0x6d5c('0x2'));var jsonpatch=require(_0x6d5c('0x3'));var rp=require('request-promise');var moment=require(_0x6d5c('0x4'));var BPromise=require(_0x6d5c('0x5'));var Mustache=require(_0x6d5c('0x6'));var util=require('util');var path=require(_0x6d5c('0x7'));var sox=require(_0x6d5c('0x8'));var csv=require(_0x6d5c('0x9'));var ejs=require(_0x6d5c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d5c('0xb'));var squel=require('squel');var crypto=require(_0x6d5c('0xc'));var jsforce=require(_0x6d5c('0xd'));var deskjs=require(_0x6d5c('0xe'));var toCsv=require(_0x6d5c('0x9'));var querystring=require('querystring');var Papa=require(_0x6d5c('0xf'));var Redis=require(_0x6d5c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6d5c('0x11'));var as=require(_0x6d5c('0x12'));var hardwareService=require(_0x6d5c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6d5c('0x14'));var config=require(_0x6d5c('0x15'));var licenseUtil=require(_0x6d5c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aebdb,_0x865617){_0x865617=_0x865617||0xcc;return function(_0x235a52){if(_0x235a52){return _0x1aebdb[_0x6d5c('0x17')](_0x865617);}return _0x1aebdb['status'](_0x865617)[_0x6d5c('0x18')]();};}function respondWithResult(_0x37b110,_0x5a76a6){_0x5a76a6=_0x5a76a6||0xc8;return function(_0x27809a){if(_0x27809a){return _0x37b110[_0x6d5c('0x19')](_0x5a76a6)[_0x6d5c('0x1a')](_0x27809a);}};}function respondWithFilteredResult(_0x2eeec6,_0x2f02e8){return function(_0x429c1f){if(_0x429c1f){var _0x5a0387=typeof _0x2f02e8[_0x6d5c('0x1b')]===_0x6d5c('0x1c')&&typeof _0x2f02e8[_0x6d5c('0x1d')]===_0x6d5c('0x1c');var _0xc0c49d=_0x429c1f['count'];var _0x1d9d3e=_0x5a0387?0x0:_0x2f02e8[_0x6d5c('0x1b')];var _0x28f978=_0x5a0387?_0x429c1f[_0x6d5c('0x1e')]:_0x2f02e8[_0x6d5c('0x1b')]+_0x2f02e8['limit'];var _0x3b36e7;if(_0x28f978>=_0xc0c49d){_0x28f978=_0xc0c49d;_0x3b36e7=0xc8;}else{_0x3b36e7=0xce;}_0x2eeec6[_0x6d5c('0x19')](_0x3b36e7);return _0x2eeec6[_0x6d5c('0x1f')](_0x6d5c('0x20'),_0x1d9d3e+'-'+_0x28f978+'/'+_0xc0c49d)['json'](_0x429c1f);}return null;};}function patchUpdates(_0x23c1e2){return function(_0x381c53){try{jsonpatch[_0x6d5c('0x21')](_0x381c53,_0x23c1e2,!![]);}catch(_0x48552d){return BPromise['reject'](_0x48552d);}return _0x381c53[_0x6d5c('0x22')]();};}function saveUpdates(_0x12721a,_0x1aafe4){return function(_0x3c0b5c){if(_0x3c0b5c){return _0x3c0b5c[_0x6d5c('0x23')](_0x12721a)['then'](function(_0x66cc2f){return _0x66cc2f;});}return null;};}function removeEntity(_0x2fb037,_0x3bef62){return function(_0x71c9){if(_0x71c9){return _0x71c9[_0x6d5c('0x24')]()[_0x6d5c('0x25')](function(){_0x2fb037[_0x6d5c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xca7352,_0x133f64){return function(_0x51fd1a){if(!_0x51fd1a){_0xca7352[_0x6d5c('0x17')](0x194);}return _0x51fd1a;};}function handleError(_0x3b773b,_0x5d0bc5){_0x5d0bc5=_0x5d0bc5||0x1f4;return function(_0x40a1ed){logger[_0x6d5c('0x26')](_0x40a1ed['stack']);if(_0x40a1ed[_0x6d5c('0x27')]){delete _0x40a1ed[_0x6d5c('0x27')];}_0x3b773b[_0x6d5c('0x19')](_0x5d0bc5)[_0x6d5c('0x28')](_0x40a1ed);};}exports[_0x6d5c('0x29')]=function(_0x5a1858,_0x20848b){var _0x1ad1bf={},_0x815b3a={},_0x4f7e41={'count':0x0,'rows':[]};var _0x2e8b4a=_['map'](db[_0x6d5c('0x2a')][_0x6d5c('0x2b')],function(_0x53c021){return{'name':_0x53c021[_0x6d5c('0x2c')],'type':_0x53c021[_0x6d5c('0x2d')][_0x6d5c('0x2e')]};});_0x815b3a[_0x6d5c('0x2f')]=_['map'](_0x2e8b4a,_0x6d5c('0x27'));_0x815b3a[_0x6d5c('0x30')]=_[_0x6d5c('0x31')](_0x5a1858[_0x6d5c('0x30')]);_0x815b3a[_0x6d5c('0x32')]=_[_0x6d5c('0x33')](_0x815b3a[_0x6d5c('0x2f')],_0x815b3a['query']);_0x1ad1bf[_0x6d5c('0x34')]=_['intersection'](_0x815b3a['model'],qs[_0x6d5c('0x35')](_0x5a1858[_0x6d5c('0x30')][_0x6d5c('0x35')]));_0x1ad1bf[_0x6d5c('0x34')]=_0x1ad1bf[_0x6d5c('0x34')][_0x6d5c('0x36')]?_0x1ad1bf[_0x6d5c('0x34')]:_0x815b3a[_0x6d5c('0x2f')];if(!_0x5a1858[_0x6d5c('0x30')][_0x6d5c('0x37')](_0x6d5c('0x38'))){_0x1ad1bf['limit']=qs[_0x6d5c('0x1d')](_0x5a1858['query'][_0x6d5c('0x1d')]);_0x1ad1bf['offset']=qs[_0x6d5c('0x1b')](_0x5a1858['query']['offset']);}_0x1ad1bf[_0x6d5c('0x39')]=qs[_0x6d5c('0x3a')](_0x5a1858[_0x6d5c('0x30')]['sort']);_0x1ad1bf[_0x6d5c('0x3b')]=qs[_0x6d5c('0x32')](_[_0x6d5c('0x3c')](_0x5a1858['query'],_0x815b3a[_0x6d5c('0x32')]),_0x2e8b4a);if(_0x5a1858[_0x6d5c('0x30')][_0x6d5c('0x3d')]){_0x1ad1bf['where']=_[_0x6d5c('0x3e')](_0x1ad1bf[_0x6d5c('0x3b')],{'$or':_['map'](_0x2e8b4a,function(_0x23f5a4){if(_0x23f5a4[_0x6d5c('0x2d')]!=='VIRTUAL'){var _0x582ced={};_0x582ced[_0x23f5a4[_0x6d5c('0x27')]]={'$like':'%'+_0x5a1858['query'][_0x6d5c('0x3d')]+'%'};return _0x582ced;}})});}_0x1ad1bf=_[_0x6d5c('0x3e')]({},_0x1ad1bf,_0x5a1858['options']);var _0x5ce09c={'where':_0x1ad1bf[_0x6d5c('0x3b')]};return db['FreshdeskConfiguration'][_0x6d5c('0x1e')](_0x5ce09c)[_0x6d5c('0x25')](function(_0x3e8157){_0x4f7e41['count']=_0x3e8157;if(_0x5a1858[_0x6d5c('0x30')]['includeAll']){_0x1ad1bf[_0x6d5c('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x6d5c('0x40')](_0x1ad1bf);})[_0x6d5c('0x25')](function(_0x434072){_0x4f7e41[_0x6d5c('0x41')]=_0x434072;return _0x4f7e41;})[_0x6d5c('0x25')](respondWithFilteredResult(_0x20848b,_0x1ad1bf))[_0x6d5c('0x42')](handleError(_0x20848b,null));};exports[_0x6d5c('0x43')]=function(_0x261840,_0x386a89){var _0x565ec6={'raw':![],'where':{'id':_0x261840[_0x6d5c('0x44')]['id']}},_0x4e8700={};_0x4e8700[_0x6d5c('0x2f')]=_[_0x6d5c('0x31')](db['FreshdeskConfiguration'][_0x6d5c('0x2b')]);_0x4e8700[_0x6d5c('0x30')]=_[_0x6d5c('0x31')](_0x261840[_0x6d5c('0x30')]);_0x4e8700['filters']=_[_0x6d5c('0x33')](_0x4e8700['model'],_0x4e8700[_0x6d5c('0x30')]);_0x565ec6[_0x6d5c('0x34')]=_[_0x6d5c('0x33')](_0x4e8700[_0x6d5c('0x2f')],qs[_0x6d5c('0x35')](_0x261840[_0x6d5c('0x30')][_0x6d5c('0x35')]));_0x565ec6[_0x6d5c('0x34')]=_0x565ec6[_0x6d5c('0x34')]['length']?_0x565ec6[_0x6d5c('0x34')]:_0x4e8700[_0x6d5c('0x2f')];if(_0x261840[_0x6d5c('0x30')][_0x6d5c('0x45')]){_0x565ec6[_0x6d5c('0x3f')]=[{'all':!![]}];}_0x565ec6=_[_0x6d5c('0x3e')]({},_0x565ec6,_0x261840['options']);return db[_0x6d5c('0x2a')][_0x6d5c('0x46')](_0x565ec6)['then'](handleEntityNotFound(_0x386a89,null))['then'](respondWithResult(_0x386a89,null))[_0x6d5c('0x42')](handleError(_0x386a89,null));};exports[_0x6d5c('0x47')]=function(_0x4a49d5,_0x38fcb7){return db['FreshdeskConfiguration'][_0x6d5c('0x47')](_0x4a49d5[_0x6d5c('0x48')],{})[_0x6d5c('0x25')](respondWithResult(_0x38fcb7,0xc9))[_0x6d5c('0x42')](handleError(_0x38fcb7,null));};exports[_0x6d5c('0x23')]=function(_0x5ebc83,_0x7cbf4e){if(_0x5ebc83['body']['id']){delete _0x5ebc83[_0x6d5c('0x48')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x5ebc83[_0x6d5c('0x44')]['id']}})['then'](handleEntityNotFound(_0x7cbf4e,null))[_0x6d5c('0x25')](saveUpdates(_0x5ebc83[_0x6d5c('0x48')],null))[_0x6d5c('0x25')](respondWithResult(_0x7cbf4e,null))[_0x6d5c('0x42')](handleError(_0x7cbf4e,null));};exports['destroy']=function(_0x12f168,_0x3eb677){return db[_0x6d5c('0x2a')][_0x6d5c('0x46')]({'where':{'id':_0x12f168[_0x6d5c('0x44')]['id']}})[_0x6d5c('0x25')](handleEntityNotFound(_0x3eb677,null))['then'](removeEntity(_0x3eb677,null))[_0x6d5c('0x42')](handleError(_0x3eb677,null));};exports['getFields']=function(_0x1eab7b,_0x2652e5,_0x52d9e4){var _0x584926={};var _0x14485d={};var _0x2066f1;var _0x5d0b4a;return db[_0x6d5c('0x2a')]['findOne']({'where':{'id':_0x1eab7b[_0x6d5c('0x44')]['id']}})['then'](handleEntityNotFound(_0x2652e5,null))[_0x6d5c('0x25')](function(_0x319ec8){if(_0x319ec8){_0x2066f1=_0x319ec8;_0x14485d[_0x6d5c('0x2f')]=_[_0x6d5c('0x31')](db[_0x6d5c('0x49')][_0x6d5c('0x2b')]);_0x14485d[_0x6d5c('0x30')]=_[_0x6d5c('0x31')](_0x1eab7b[_0x6d5c('0x30')]);_0x14485d[_0x6d5c('0x32')]=_['intersection'](_0x14485d['model'],_0x14485d['query']);_0x584926['attributes']=_[_0x6d5c('0x33')](_0x14485d[_0x6d5c('0x2f')],qs[_0x6d5c('0x35')](_0x1eab7b['query'][_0x6d5c('0x35')]));_0x584926[_0x6d5c('0x34')]=_0x584926[_0x6d5c('0x34')][_0x6d5c('0x36')]?_0x584926[_0x6d5c('0x34')]:_0x14485d[_0x6d5c('0x2f')];_0x584926[_0x6d5c('0x39')]=qs[_0x6d5c('0x3a')](_0x1eab7b[_0x6d5c('0x30')]['sort']);_0x584926[_0x6d5c('0x3b')]=qs[_0x6d5c('0x32')](_[_0x6d5c('0x3c')](_0x1eab7b[_0x6d5c('0x30')],_0x14485d[_0x6d5c('0x32')]));if(_0x1eab7b[_0x6d5c('0x30')][_0x6d5c('0x3d')]){_0x584926[_0x6d5c('0x3b')]=_[_0x6d5c('0x3e')](_0x584926['where'],{'$or':_[_0x6d5c('0x4a')](_0x584926[_0x6d5c('0x34')],function(_0xa2274c){var _0x1a8280={};_0x1a8280[_0xa2274c]={'$like':'%'+_0x1eab7b['query']['filter']+'%'};return _0x1a8280;})});}_0x584926=_['merge']({},_0x584926,_0x1eab7b[_0x6d5c('0x4b')]);return _0x2066f1[_0x6d5c('0x4c')](_0x584926);}})['then'](function(_0x1a1161){if(_0x1a1161){_0x5d0b4a=_0x1a1161['length'];if(!_0x1eab7b[_0x6d5c('0x30')]['hasOwnProperty'](_0x6d5c('0x38'))){_0x584926[_0x6d5c('0x1d')]=qs[_0x6d5c('0x1d')](_0x1eab7b[_0x6d5c('0x30')][_0x6d5c('0x1d')]);_0x584926[_0x6d5c('0x1b')]=qs[_0x6d5c('0x1b')](_0x1eab7b[_0x6d5c('0x30')][_0x6d5c('0x1b')]);}return _0x2066f1[_0x6d5c('0x4c')](_0x584926);}})['then'](function(_0x49a24d){if(_0x49a24d){return _0x49a24d?{'count':_0x5d0b4a,'rows':_0x49a24d}:null;}})[_0x6d5c('0x25')](respondWithResult(_0x2652e5,null))[_0x6d5c('0x42')](handleError(_0x2652e5,null));};exports[_0x6d5c('0x4d')]=function(_0x74a073,_0x1e0afc,_0x282049){var _0x5da9cd={};var _0x849c54={};var _0x4513b1;var _0x16da9a;return db[_0x6d5c('0x2a')][_0x6d5c('0x4e')]({'where':{'id':_0x74a073[_0x6d5c('0x44')]['id']}})[_0x6d5c('0x25')](handleEntityNotFound(_0x1e0afc,null))['then'](function(_0x511dee){if(_0x511dee){_0x4513b1=_0x511dee;_0x849c54[_0x6d5c('0x2f')]=_[_0x6d5c('0x31')](db[_0x6d5c('0x49')]['rawAttributes']);_0x849c54[_0x6d5c('0x30')]=_['keys'](_0x74a073[_0x6d5c('0x30')]);_0x849c54[_0x6d5c('0x32')]=_[_0x6d5c('0x33')](_0x849c54['model'],_0x849c54['query']);_0x5da9cd['attributes']=_['intersection'](_0x849c54['model'],qs[_0x6d5c('0x35')](_0x74a073['query']['fields']));_0x5da9cd[_0x6d5c('0x34')]=_0x5da9cd[_0x6d5c('0x34')][_0x6d5c('0x36')]?_0x5da9cd['attributes']:_0x849c54[_0x6d5c('0x2f')];_0x5da9cd['order']=qs[_0x6d5c('0x3a')](_0x74a073['query'][_0x6d5c('0x3a')]);_0x5da9cd[_0x6d5c('0x3b')]=qs['filters'](_[_0x6d5c('0x3c')](_0x74a073[_0x6d5c('0x30')],_0x849c54[_0x6d5c('0x32')]));if(_0x74a073[_0x6d5c('0x30')][_0x6d5c('0x3d')]){_0x5da9cd['where']=_[_0x6d5c('0x3e')](_0x5da9cd[_0x6d5c('0x3b')],{'$or':_[_0x6d5c('0x4a')](_0x5da9cd[_0x6d5c('0x34')],function(_0x54d629){var _0x40b7f9={};_0x40b7f9[_0x54d629]={'$like':'%'+_0x74a073[_0x6d5c('0x30')][_0x6d5c('0x3d')]+'%'};return _0x40b7f9;})});}_0x5da9cd=_[_0x6d5c('0x3e')]({},_0x5da9cd,_0x74a073[_0x6d5c('0x4b')]);return _0x4513b1[_0x6d5c('0x4d')](_0x5da9cd);}})[_0x6d5c('0x25')](function(_0x27eafe){if(_0x27eafe){_0x16da9a=_0x27eafe[_0x6d5c('0x36')];if(!_0x74a073['query']['hasOwnProperty'](_0x6d5c('0x38'))){_0x5da9cd[_0x6d5c('0x1d')]=qs[_0x6d5c('0x1d')](_0x74a073[_0x6d5c('0x30')][_0x6d5c('0x1d')]);_0x5da9cd[_0x6d5c('0x1b')]=qs[_0x6d5c('0x1b')](_0x74a073[_0x6d5c('0x30')][_0x6d5c('0x1b')]);}return _0x4513b1[_0x6d5c('0x4d')](_0x5da9cd);}})['then'](function(_0x1023bb){if(_0x1023bb){return _0x1023bb?{'count':_0x16da9a,'rows':_0x1023bb}:null;}})[_0x6d5c('0x25')](respondWithResult(_0x1e0afc,null))[_0x6d5c('0x42')](handleError(_0x1e0afc,null));};exports[_0x6d5c('0x4f')]=function(_0xd97e59,_0xbaf690,_0x1a07cc){var _0x9b31c3={};var _0x35e7fe={};var _0x4605a6;var _0x2dd135;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0xd97e59[_0x6d5c('0x44')]['id']}})['then'](handleEntityNotFound(_0xbaf690,null))[_0x6d5c('0x25')](function(_0x1be88c){if(_0x1be88c){_0x4605a6=_0x1be88c;_0x35e7fe[_0x6d5c('0x2f')]=_[_0x6d5c('0x31')](db[_0x6d5c('0x49')][_0x6d5c('0x2b')]);_0x35e7fe['query']=_[_0x6d5c('0x31')](_0xd97e59[_0x6d5c('0x30')]);_0x35e7fe[_0x6d5c('0x32')]=_[_0x6d5c('0x33')](_0x35e7fe[_0x6d5c('0x2f')],_0x35e7fe[_0x6d5c('0x30')]);_0x9b31c3[_0x6d5c('0x34')]=_[_0x6d5c('0x33')](_0x35e7fe[_0x6d5c('0x2f')],qs['fields'](_0xd97e59[_0x6d5c('0x30')]['fields']));_0x9b31c3[_0x6d5c('0x34')]=_0x9b31c3[_0x6d5c('0x34')][_0x6d5c('0x36')]?_0x9b31c3['attributes']:_0x35e7fe[_0x6d5c('0x2f')];_0x9b31c3[_0x6d5c('0x39')]=qs[_0x6d5c('0x3a')](_0xd97e59['query'][_0x6d5c('0x3a')]);_0x9b31c3[_0x6d5c('0x3b')]=qs['filters'](_[_0x6d5c('0x3c')](_0xd97e59[_0x6d5c('0x30')],_0x35e7fe[_0x6d5c('0x32')]));if(_0xd97e59[_0x6d5c('0x30')]['filter']){_0x9b31c3[_0x6d5c('0x3b')]=_[_0x6d5c('0x3e')](_0x9b31c3['where'],{'$or':_[_0x6d5c('0x4a')](_0x9b31c3[_0x6d5c('0x34')],function(_0x4d18d7){var _0x531a2d={};_0x531a2d[_0x4d18d7]={'$like':'%'+_0xd97e59[_0x6d5c('0x30')]['filter']+'%'};return _0x531a2d;})});}_0x9b31c3=_[_0x6d5c('0x3e')]({},_0x9b31c3,_0xd97e59['options']);return _0x4605a6['getDescriptions'](_0x9b31c3);}})[_0x6d5c('0x25')](function(_0x21b6b5){if(_0x21b6b5){_0x2dd135=_0x21b6b5[_0x6d5c('0x36')];if(!_0xd97e59[_0x6d5c('0x30')][_0x6d5c('0x37')](_0x6d5c('0x38'))){_0x9b31c3[_0x6d5c('0x1d')]=qs[_0x6d5c('0x1d')](_0xd97e59['query'][_0x6d5c('0x1d')]);_0x9b31c3[_0x6d5c('0x1b')]=qs[_0x6d5c('0x1b')](_0xd97e59[_0x6d5c('0x30')]['offset']);}return _0x4605a6[_0x6d5c('0x4f')](_0x9b31c3);}})[_0x6d5c('0x25')](function(_0x4ce562){if(_0x4ce562){return _0x4ce562?{'count':_0x2dd135,'rows':_0x4ce562}:null;}})[_0x6d5c('0x25')](respondWithResult(_0xbaf690,null))[_0x6d5c('0x42')](handleError(_0xbaf690,null));};exports[_0x6d5c('0x50')]=function(_0x5225c0,_0x1f2c64,_0x38e0fe){var _0x5c1fa7={};var _0x33edc4={};var _0x4fdf62;var _0x7e5b32;return db['FreshdeskConfiguration'][_0x6d5c('0x4e')]({'where':{'id':_0x5225c0[_0x6d5c('0x44')]['id']}})[_0x6d5c('0x25')](handleEntityNotFound(_0x1f2c64,null))[_0x6d5c('0x25')](function(_0x3cfadf){if(_0x3cfadf){_0x4fdf62=_0x3cfadf;_0x33edc4[_0x6d5c('0x2f')]=_[_0x6d5c('0x31')](db[_0x6d5c('0x51')][_0x6d5c('0x2b')]);_0x33edc4['query']=_[_0x6d5c('0x31')](_0x5225c0[_0x6d5c('0x30')]);_0x33edc4[_0x6d5c('0x32')]=_[_0x6d5c('0x33')](_0x33edc4[_0x6d5c('0x2f')],_0x33edc4[_0x6d5c('0x30')]);_0x5c1fa7[_0x6d5c('0x34')]=_[_0x6d5c('0x33')](_0x33edc4[_0x6d5c('0x2f')],qs[_0x6d5c('0x35')](_0x5225c0['query'][_0x6d5c('0x35')]));_0x5c1fa7[_0x6d5c('0x34')]=_0x5c1fa7[_0x6d5c('0x34')]['length']?_0x5c1fa7[_0x6d5c('0x34')]:_0x33edc4[_0x6d5c('0x2f')];_0x5c1fa7[_0x6d5c('0x39')]=qs[_0x6d5c('0x3a')](_0x5225c0[_0x6d5c('0x30')][_0x6d5c('0x3a')]);_0x5c1fa7[_0x6d5c('0x3b')]=qs[_0x6d5c('0x32')](_['pick'](_0x5225c0[_0x6d5c('0x30')],_0x33edc4[_0x6d5c('0x32')]));if(_0x5225c0[_0x6d5c('0x30')][_0x6d5c('0x3d')]){_0x5c1fa7[_0x6d5c('0x3b')]=_[_0x6d5c('0x3e')](_0x5c1fa7['where'],{'$or':_['map'](_0x5c1fa7[_0x6d5c('0x34')],function(_0x2ed86b){var _0x4df5d9={};_0x4df5d9[_0x2ed86b]={'$like':'%'+_0x5225c0[_0x6d5c('0x30')]['filter']+'%'};return _0x4df5d9;})});}_0x5c1fa7=_[_0x6d5c('0x3e')]({},_0x5c1fa7,_0x5225c0[_0x6d5c('0x4b')]);return _0x4fdf62[_0x6d5c('0x50')](_0x5c1fa7);}})['then'](function(_0xb92f58){if(_0xb92f58){_0x7e5b32=_0xb92f58[_0x6d5c('0x36')];if(!_0x5225c0[_0x6d5c('0x30')][_0x6d5c('0x37')](_0x6d5c('0x38'))){_0x5c1fa7[_0x6d5c('0x1d')]=qs[_0x6d5c('0x1d')](_0x5225c0[_0x6d5c('0x30')]['limit']);_0x5c1fa7[_0x6d5c('0x1b')]=qs[_0x6d5c('0x1b')](_0x5225c0[_0x6d5c('0x30')][_0x6d5c('0x1b')]);}return _0x4fdf62[_0x6d5c('0x50')](_0x5c1fa7);}})[_0x6d5c('0x25')](function(_0x5002d4){if(_0x5002d4){return _0x5002d4?{'count':_0x7e5b32,'rows':_0x5002d4}:null;}})['then'](respondWithResult(_0x1f2c64,null))[_0x6d5c('0x42')](handleError(_0x1f2c64,null));};exports[_0x6d5c('0x52')]=function(_0x5a2405,_0x4c1406,_0x46036b){if(_0x5a2405[_0x6d5c('0x48')]['id']){delete _0x5a2405[_0x6d5c('0x48')]['id'];}return db[_0x6d5c('0x2a')][_0x6d5c('0x4e')]({'where':{'id':_0x5a2405[_0x6d5c('0x44')]['id']}})[_0x6d5c('0x25')](handleEntityNotFound(_0x4c1406,null))[_0x6d5c('0x25')](function(_0x37af0b){if(_0x37af0b){return _0x37af0b[_0x6d5c('0x52')](_0x5a2405[_0x6d5c('0x48')][_0x6d5c('0x53')]||[]);}return null;})[_0x6d5c('0x25')](respondWithResult(_0x4c1406,null))[_0x6d5c('0x42')](handleError(_0x4c1406,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b3a6116..bcf8987 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 _0x1868=['define','int_freshdesk_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x5d36dd,_0x3c38c1){var _0x52d18e=function(_0xe8c6b2){while(--_0xe8c6b2){_0x5d36dd['push'](_0x5d36dd['shift']());}};_0x52d18e(++_0x3c38c1);}(_0x1868,0x110));var _0x8186=function(_0x412d6e,_0x3c3c12){_0x412d6e=_0x412d6e-0x0;var _0x590c4d=_0x1868[_0x412d6e];return _0x590c4d;};'use strict';var _=require(_0x8186('0x0'));var util=require('util');var logger=require(_0x8186('0x1'))(_0x8186('0x2'));var moment=require('moment');var BPromise=require(_0x8186('0x3'));var rp=require(_0x8186('0x4'));var fs=require('fs');var path=require(_0x8186('0x5'));var rimraf=require('rimraf');var config=require(_0x8186('0x6'));var attributes=require(_0x8186('0x7'));module['exports']=function(_0x302e0b,_0x4f2544){return _0x302e0b[_0x8186('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0x8186('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ae7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x41942e,_0xabdcc5){var _0x505673=function(_0x2eda17){while(--_0x2eda17){_0x41942e['push'](_0x41942e['shift']());}};_0x505673(++_0xabdcc5);}(_0x1ae7,0x1ad));var _0x71ae=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x1ae7[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0x71ae('0x0'));var logger=require(_0x71ae('0x1'))(_0x71ae('0x2'));var moment=require(_0x71ae('0x3'));var BPromise=require(_0x71ae('0x4'));var rp=require(_0x71ae('0x5'));var fs=require('fs');var path=require(_0x71ae('0x6'));var rimraf=require(_0x71ae('0x7'));var config=require(_0x71ae('0x8'));var attributes=require(_0x71ae('0x9'));module[_0x71ae('0xa')]=function(_0x3d19fc,_0x2dc6a8){return _0x3d19fc['define'](_0x71ae('0xb'),attributes,{'tableName':_0x71ae('0xc'),'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 6e460f4..6026052 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 _0x11a8=['message','info','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x37e956,_0x2bdb13){var _0x2eeb1a=function(_0x540042){while(--_0x540042){_0x37e956['push'](_0x37e956['shift']());}};_0x2eeb1a(++_0x2bdb13);}(_0x11a8,0x18e));var _0x811a=function(_0x56ffcf,_0x38eb1f){_0x56ffcf=_0x56ffcf-0x0;var _0x3cc524=_0x11a8[_0x56ffcf];return _0x3cc524;};'use strict';var _=require('lodash');var util=require(_0x811a('0x0'));var moment=require(_0x811a('0x1'));var BPromise=require(_0x811a('0x2'));var rs=require(_0x811a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x811a('0x4'))(_0x811a('0x5'));var config=require(_0x811a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x811a('0x7')][_0x811a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e954a,_0x3a3723,_0xacfe25){return new BPromise(function(_0x1b9bc8,_0x5cc3d8){return client[_0x811a('0x9')](_0x1e954a,_0xacfe25)[_0x811a('0xa')](function(_0x162b0b){logger['info'](_0x811a('0xb'),_0x3a3723,_0x811a('0xc'));logger[_0x811a('0xd')](_0x811a('0xe'),_0x3a3723,_0x811a('0xc'),JSON['stringify'](_0x162b0b));if(_0x162b0b[_0x811a('0xf')]){if(_0x162b0b[_0x811a('0xf')]['code']===0x1f4){logger[_0x811a('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a3723,_0x162b0b['error']['message']);return _0x5cc3d8(_0x162b0b['error'][_0x811a('0x10')]);}logger[_0x811a('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a3723,_0x162b0b[_0x811a('0xf')][_0x811a('0x10')]);return _0x1b9bc8(_0x162b0b[_0x811a('0xf')][_0x811a('0x10')]);}else{logger[_0x811a('0x11')](_0x811a('0xb'),_0x3a3723,_0x811a('0xc'));_0x1b9bc8(_0x162b0b['result'][_0x811a('0x10')]);}})['catch'](function(_0x4effc0){logger[_0x811a('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a3723,_0x4effc0);_0x5cc3d8(_0x4effc0);});});} \ No newline at end of file +var _0xae79=['info','catch','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4c89dd,_0x408798){var _0x38a1a3=function(_0x1ac6d9){while(--_0x1ac6d9){_0x4c89dd['push'](_0x4c89dd['shift']());}};_0x38a1a3(++_0x408798);}(_0xae79,0x17c));var _0x9ae7=function(_0x32cd35,_0x474a45){_0x32cd35=_0x32cd35-0x0;var _0x153b60=_0xae79[_0x32cd35];return _0x153b60;};'use strict';var _=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var moment=require(_0x9ae7('0x2'));var BPromise=require(_0x9ae7('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(_0x9ae7('0x4'))(_0x9ae7('0x5'));var config=require(_0x9ae7('0x6'));var jayson=require(_0x9ae7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xce3cfc,_0x5c46ed,_0x5c759d){return new BPromise(function(_0x1fd51e,_0x382a4b){return client[_0x9ae7('0x8')](_0xce3cfc,_0x5c759d)['then'](function(_0x24abfc){logger['info'](_0x9ae7('0x9'),_0x5c46ed,_0x9ae7('0xa'));logger[_0x9ae7('0xb')](_0x9ae7('0xc'),_0x5c46ed,_0x9ae7('0xa'),JSON['stringify'](_0x24abfc));if(_0x24abfc[_0x9ae7('0xd')]){if(_0x24abfc[_0x9ae7('0xd')][_0x9ae7('0xe')]===0x1f4){logger[_0x9ae7('0xd')](_0x9ae7('0x9'),_0x5c46ed,_0x24abfc[_0x9ae7('0xd')]['message']);return _0x382a4b(_0x24abfc[_0x9ae7('0xd')][_0x9ae7('0xf')]);}logger[_0x9ae7('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c46ed,_0x24abfc[_0x9ae7('0xd')][_0x9ae7('0xf')]);return _0x1fd51e(_0x24abfc[_0x9ae7('0xd')]['message']);}else{logger[_0x9ae7('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c46ed,_0x9ae7('0xa'));_0x1fd51e(_0x24abfc['result']['message']);}})[_0x9ae7('0x11')](function(_0x4a47b2){logger[_0x9ae7('0xd')](_0x9ae7('0x9'),_0x5c46ed,_0x4a47b2);_0x382a4b(_0x4a47b2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 561516b..6dc9cfc 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 _0x1ec2=['index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated'];(function(_0x1d60ba,_0x55248f){var _0x54a5f2=function(_0x26f68f){while(--_0x26f68f){_0x1d60ba['push'](_0x1d60ba['shift']());}};_0x54a5f2(++_0x55248f);}(_0x1ec2,0x1ea));var _0x21ec=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1ec2[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x21ec('0x0'));var util=require(_0x21ec('0x1'));var path=require(_0x21ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x21ec('0x3'));var router=express[_0x21ec('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x21ec('0x5'));var interaction=require(_0x21ec('0x6'));var config=require(_0x21ec('0x7'));var controller=require(_0x21ec('0x8'));router['get']('/',auth[_0x21ec('0x9')](),controller[_0x21ec('0xa')]);router[_0x21ec('0xb')](_0x21ec('0xc'),auth[_0x21ec('0x9')](),controller['show']);router[_0x21ec('0xd')]('/',auth['isAuthenticated'](),controller[_0x21ec('0xe')]);router[_0x21ec('0xf')](_0x21ec('0xc'),auth[_0x21ec('0x9')](),controller[_0x21ec('0x10')]);router[_0x21ec('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x21ec('0x12')]);module[_0x21ec('0x13')]=router; \ No newline at end of file +var _0x53e1=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','create','put','delete','destroy','multer','util'];(function(_0x131803,_0x58cc66){var _0x5a728e=function(_0x3db5d4){while(--_0x3db5d4){_0x131803['push'](_0x131803['shift']());}};_0x5a728e(++_0x58cc66);}(_0x53e1,0x86));var _0x153e=function(_0x3d5351,_0x27bc80){_0x3d5351=_0x3d5351-0x0;var _0x1db4db=_0x53e1[_0x3d5351];return _0x1db4db;};'use strict';var multer=require(_0x153e('0x0'));var util=require(_0x153e('0x1'));var path=require(_0x153e('0x2'));var timeout=require('connect-timeout');var express=require(_0x153e('0x3'));var router=express[_0x153e('0x4')]();var fs_extra=require(_0x153e('0x5'));var auth=require(_0x153e('0x6'));var interaction=require(_0x153e('0x7'));var config=require(_0x153e('0x8'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x153e('0x9')]);router[_0x153e('0xa')](_0x153e('0xb'),auth[_0x153e('0xc')](),controller['show']);router['post']('/',auth[_0x153e('0xc')](),controller[_0x153e('0xd')]);router[_0x153e('0xe')](_0x153e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x153e('0xf')]('/:id',auth[_0x153e('0xc')](),controller[_0x153e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index f501911..9c9b777 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 _0x7232=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x329ebc,_0x3c7036){var _0x31017a=function(_0x3693ed){while(--_0x3693ed){_0x329ebc['push'](_0x329ebc['shift']());}};_0x31017a(++_0x3c7036);}(_0x7232,0x1bf));var _0x2723=function(_0x4a843e,_0x153c82){_0x4a843e=_0x4a843e-0x0;var _0x5e6510=_0x7232[_0x4a843e];return _0x5e6510;};'use strict';var Sequelize=require('sequelize');module[_0x2723('0x0')]={'type':{'type':Sequelize[_0x2723('0x1')](_0x2723('0x2'),_0x2723('0x3'),_0x2723('0x4'),_0x2723('0x5'),'picklist'),'defaultValue':_0x2723('0x2')},'content':{'type':Sequelize[_0x2723('0x6')]},'key':{'type':Sequelize[_0x2723('0x6')]},'keyType':{'type':Sequelize[_0x2723('0x1')]('string',_0x2723('0x3'),_0x2723('0x4'))},'keyContent':{'type':Sequelize[_0x2723('0x6')]},'idField':{'type':Sequelize[_0x2723('0x6')]},'nameField':{'type':Sequelize[_0x2723('0x6')]},'customField':{'type':Sequelize[_0x2723('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf143=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x11a12b,_0x27828d){var _0x58bd56=function(_0x51cedc){while(--_0x51cedc){_0x11a12b['push'](_0x11a12b['shift']());}};_0x58bd56(++_0x27828d);}(_0xf143,0x1a7));var _0x3f14=function(_0x3b3dcb,_0x6ff907){_0x3b3dcb=_0x3b3dcb-0x0;var _0x3d43cc=_0xf143[_0x3b3dcb];return _0x3d43cc;};'use strict';var Sequelize=require(_0x3f14('0x0'));module[_0x3f14('0x1')]={'type':{'type':Sequelize[_0x3f14('0x2')](_0x3f14('0x3'),_0x3f14('0x4'),_0x3f14('0x5'),_0x3f14('0x6'),_0x3f14('0x7')),'defaultValue':_0x3f14('0x3')},'content':{'type':Sequelize[_0x3f14('0x8')]},'key':{'type':Sequelize[_0x3f14('0x8')]},'keyType':{'type':Sequelize[_0x3f14('0x2')](_0x3f14('0x3'),_0x3f14('0x4'),_0x3f14('0x5'))},'keyContent':{'type':Sequelize[_0x3f14('0x8')]},'idField':{'type':Sequelize[_0x3f14('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 01d5533..a2ab8fe 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 _0xb4e6=['lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','end','error','stack','name','index','FreshdeskField','rawAttributes','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x282320,_0x379ad6){var _0x271d54=function(_0x5bfe98){while(--_0x5bfe98){_0x282320['push'](_0x282320['shift']());}};_0x271d54(++_0x379ad6);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0xb4e6[_0x325501];return _0x2c1626;};'use strict';var emlformat=require(_0x6b4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b4e('0x1'));var jsonpatch=require(_0x6b4e('0x2'));var rp=require(_0x6b4e('0x3'));var moment=require(_0x6b4e('0x4'));var BPromise=require(_0x6b4e('0x5'));var Mustache=require(_0x6b4e('0x6'));var util=require(_0x6b4e('0x7'));var path=require('path');var sox=require(_0x6b4e('0x8'));var csv=require(_0x6b4e('0x9'));var ejs=require(_0x6b4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b4e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b4e('0xd'));var Papa=require(_0x6b4e('0xe'));var Redis=require(_0x6b4e('0xf'));var authService=require(_0x6b4e('0x10'));var qs=require(_0x6b4e('0x11'));var as=require(_0x6b4e('0x12'));var hardwareService=require(_0x6b4e('0x13'));var logger=require('../../config/logger')(_0x6b4e('0x14'));var utils=require(_0x6b4e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6b4e('0x16'));var db=require(_0x6b4e('0x17'))['db'];function respondWithStatusCode(_0x432399,_0x2b2ce0){_0x2b2ce0=_0x2b2ce0||0xcc;return function(_0x9f8f6c){if(_0x9f8f6c){return _0x432399[_0x6b4e('0x18')](_0x2b2ce0);}return _0x432399[_0x6b4e('0x19')](_0x2b2ce0)['end']();};}function respondWithResult(_0x36f8a5,_0x29bdee){_0x29bdee=_0x29bdee||0xc8;return function(_0x4788cf){if(_0x4788cf){return _0x36f8a5[_0x6b4e('0x19')](_0x29bdee)['json'](_0x4788cf);}};}function respondWithFilteredResult(_0x355f10,_0x2195c1){return function(_0x3ba513){if(_0x3ba513){var _0x42e265=typeof _0x2195c1[_0x6b4e('0x1a')]===_0x6b4e('0x1b')&&typeof _0x2195c1['limit']==='undefined';var _0x67496d=_0x3ba513[_0x6b4e('0x1c')];var _0x10d2b1=_0x42e265?0x0:_0x2195c1[_0x6b4e('0x1a')];var _0x101d0a=_0x42e265?_0x3ba513[_0x6b4e('0x1c')]:_0x2195c1[_0x6b4e('0x1a')]+_0x2195c1[_0x6b4e('0x1d')];var _0x35aee1;if(_0x101d0a>=_0x67496d){_0x101d0a=_0x67496d;_0x35aee1=0xc8;}else{_0x35aee1=0xce;}_0x355f10[_0x6b4e('0x19')](_0x35aee1);return _0x355f10[_0x6b4e('0x1e')]('Content-Range',_0x10d2b1+'-'+_0x101d0a+'/'+_0x67496d)[_0x6b4e('0x1f')](_0x3ba513);}return null;};}function patchUpdates(_0x248fea){return function(_0x31fb9d){try{jsonpatch[_0x6b4e('0x20')](_0x31fb9d,_0x248fea,!![]);}catch(_0x5e5dcd){return BPromise[_0x6b4e('0x21')](_0x5e5dcd);}return _0x31fb9d['save']();};}function saveUpdates(_0x2503a5,_0x163dea){return function(_0x165a99){if(_0x165a99){return _0x165a99[_0x6b4e('0x22')](_0x2503a5)[_0x6b4e('0x23')](function(_0x346566){return _0x346566;});}return null;};}function removeEntity(_0x3e636f,_0x5c33be){return function(_0x2e36db){if(_0x2e36db){return _0x2e36db['destroy']()[_0x6b4e('0x23')](function(){_0x3e636f[_0x6b4e('0x19')](0xcc)[_0x6b4e('0x24')]();});}};}function handleEntityNotFound(_0xdba4fe,_0x4ec9cc){return function(_0xec7d35){if(!_0xec7d35){_0xdba4fe[_0x6b4e('0x18')](0x194);}return _0xec7d35;};}function handleError(_0x4e217c,_0x32102f){_0x32102f=_0x32102f||0x1f4;return function(_0x381ff0){logger[_0x6b4e('0x25')](_0x381ff0[_0x6b4e('0x26')]);if(_0x381ff0['name']){delete _0x381ff0[_0x6b4e('0x27')];}_0x4e217c[_0x6b4e('0x19')](_0x32102f)['send'](_0x381ff0);};}exports[_0x6b4e('0x28')]=function(_0x453beb,_0x2f1129){var _0x143de5={},_0x4a6c90={},_0x445278={'count':0x0,'rows':[]};var _0x4007b6=_['map'](db[_0x6b4e('0x29')][_0x6b4e('0x2a')],function(_0x37b636){return{'name':_0x37b636['fieldName'],'type':_0x37b636['type'][_0x6b4e('0x2b')]};});_0x4a6c90[_0x6b4e('0x2c')]=_[_0x6b4e('0x2d')](_0x4007b6,'name');_0x4a6c90[_0x6b4e('0x2e')]=_[_0x6b4e('0x2f')](_0x453beb[_0x6b4e('0x2e')]);_0x4a6c90['filters']=_['intersection'](_0x4a6c90[_0x6b4e('0x2c')],_0x4a6c90['query']);_0x143de5[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x4a6c90['model'],qs[_0x6b4e('0x32')](_0x453beb[_0x6b4e('0x2e')][_0x6b4e('0x32')]));_0x143de5[_0x6b4e('0x30')]=_0x143de5['attributes']['length']?_0x143de5[_0x6b4e('0x30')]:_0x4a6c90[_0x6b4e('0x2c')];if(!_0x453beb[_0x6b4e('0x2e')][_0x6b4e('0x33')](_0x6b4e('0x34'))){_0x143de5[_0x6b4e('0x1d')]=qs[_0x6b4e('0x1d')](_0x453beb[_0x6b4e('0x2e')][_0x6b4e('0x1d')]);_0x143de5[_0x6b4e('0x1a')]=qs[_0x6b4e('0x1a')](_0x453beb[_0x6b4e('0x2e')][_0x6b4e('0x1a')]);}_0x143de5['order']=qs[_0x6b4e('0x35')](_0x453beb[_0x6b4e('0x2e')][_0x6b4e('0x35')]);_0x143de5['where']=qs[_0x6b4e('0x36')](_['pick'](_0x453beb[_0x6b4e('0x2e')],_0x4a6c90[_0x6b4e('0x36')]),_0x4007b6);if(_0x453beb[_0x6b4e('0x2e')]['filter']){_0x143de5['where']=_[_0x6b4e('0x37')](_0x143de5[_0x6b4e('0x38')],{'$or':_['map'](_0x4007b6,function(_0x4d61dc){if(_0x4d61dc[_0x6b4e('0x39')]!==_0x6b4e('0x3a')){var _0x303507={};_0x303507[_0x4d61dc[_0x6b4e('0x27')]]={'$like':'%'+_0x453beb[_0x6b4e('0x2e')][_0x6b4e('0x3b')]+'%'};return _0x303507;}})});}_0x143de5=_[_0x6b4e('0x37')]({},_0x143de5,_0x453beb[_0x6b4e('0x3c')]);var _0x2faf8d={'where':_0x143de5[_0x6b4e('0x38')]};return db[_0x6b4e('0x29')]['count'](_0x2faf8d)[_0x6b4e('0x23')](function(_0x5516e7){_0x445278['count']=_0x5516e7;if(_0x453beb[_0x6b4e('0x2e')][_0x6b4e('0x3d')]){_0x143de5[_0x6b4e('0x3e')]=[{'all':!![]}];}return db[_0x6b4e('0x29')][_0x6b4e('0x3f')](_0x143de5);})['then'](function(_0x4e545c){_0x445278[_0x6b4e('0x40')]=_0x4e545c;return _0x445278;})['then'](respondWithFilteredResult(_0x2f1129,_0x143de5))[_0x6b4e('0x41')](handleError(_0x2f1129,null));};exports[_0x6b4e('0x42')]=function(_0x4d8227,_0xf70c24){var _0x50f0e7={'raw':!![],'where':{'id':_0x4d8227['params']['id']}},_0x3dec0f={};_0x3dec0f[_0x6b4e('0x2c')]=_[_0x6b4e('0x2f')](db[_0x6b4e('0x29')][_0x6b4e('0x2a')]);_0x3dec0f['query']=_[_0x6b4e('0x2f')](_0x4d8227[_0x6b4e('0x2e')]);_0x3dec0f[_0x6b4e('0x36')]=_['intersection'](_0x3dec0f[_0x6b4e('0x2c')],_0x3dec0f[_0x6b4e('0x2e')]);_0x50f0e7[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x3dec0f[_0x6b4e('0x2c')],qs[_0x6b4e('0x32')](_0x4d8227[_0x6b4e('0x2e')][_0x6b4e('0x32')]));_0x50f0e7[_0x6b4e('0x30')]=_0x50f0e7['attributes'][_0x6b4e('0x43')]?_0x50f0e7[_0x6b4e('0x30')]:_0x3dec0f[_0x6b4e('0x2c')];if(_0x4d8227[_0x6b4e('0x2e')][_0x6b4e('0x3d')]){_0x50f0e7['include']=[{'all':!![]}];}_0x50f0e7=_[_0x6b4e('0x37')]({},_0x50f0e7,_0x4d8227['options']);return db[_0x6b4e('0x29')][_0x6b4e('0x44')](_0x50f0e7)[_0x6b4e('0x23')](handleEntityNotFound(_0xf70c24,null))[_0x6b4e('0x23')](respondWithResult(_0xf70c24,null))['catch'](handleError(_0xf70c24,null));};exports[_0x6b4e('0x45')]=function(_0x46467e,_0x1d0eb3){return db['FreshdeskField'][_0x6b4e('0x45')](_0x46467e[_0x6b4e('0x46')],{})[_0x6b4e('0x23')](respondWithResult(_0x1d0eb3,0xc9))[_0x6b4e('0x41')](handleError(_0x1d0eb3,null));};exports[_0x6b4e('0x22')]=function(_0x33c797,_0x289dfa){if(_0x33c797[_0x6b4e('0x46')]['id']){delete _0x33c797[_0x6b4e('0x46')]['id'];}return db[_0x6b4e('0x29')]['find']({'where':{'id':_0x33c797[_0x6b4e('0x47')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x289dfa,null))[_0x6b4e('0x23')](saveUpdates(_0x33c797['body'],null))[_0x6b4e('0x23')](respondWithResult(_0x289dfa,null))[_0x6b4e('0x41')](handleError(_0x289dfa,null));};exports[_0x6b4e('0x48')]=function(_0x738ee5,_0x73c6be){return db[_0x6b4e('0x29')][_0x6b4e('0x44')]({'where':{'id':_0x738ee5[_0x6b4e('0x47')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x73c6be,null))[_0x6b4e('0x23')](removeEntity(_0x73c6be,null))[_0x6b4e('0x41')](handleError(_0x73c6be,null));}; \ No newline at end of file +var _0x2547=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','include','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x2547,0x1cd));var _0x7254=function(_0x391b63,_0x44845f){_0x391b63=_0x391b63-0x0;var _0x59e443=_0x2547[_0x391b63];return _0x59e443;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];function respondWithStatusCode(_0x53fc4f,_0x16c08e){_0x16c08e=_0x16c08e||0xcc;return function(_0x2bfff8){if(_0x2bfff8){return _0x53fc4f[_0x7254('0x17')](_0x16c08e);}return _0x53fc4f[_0x7254('0x18')](_0x16c08e)[_0x7254('0x19')]();};}function respondWithResult(_0x395a8a,_0x124192){_0x124192=_0x124192||0xc8;return function(_0x21cecc){if(_0x21cecc){return _0x395a8a[_0x7254('0x18')](_0x124192)[_0x7254('0x1a')](_0x21cecc);}};}function respondWithFilteredResult(_0x38a99c,_0x1ee5cb){return function(_0x163c8c){if(_0x163c8c){var _0x535065=typeof _0x1ee5cb[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x1ee5cb[_0x7254('0x1d')]===_0x7254('0x1c');var _0x3b5f06=_0x163c8c[_0x7254('0x1e')];var _0x2737e0=_0x535065?0x0:_0x1ee5cb['offset'];var _0x1f48f6=_0x535065?_0x163c8c[_0x7254('0x1e')]:_0x1ee5cb[_0x7254('0x1b')]+_0x1ee5cb[_0x7254('0x1d')];var _0x2a1ddc;if(_0x1f48f6>=_0x3b5f06){_0x1f48f6=_0x3b5f06;_0x2a1ddc=0xc8;}else{_0x2a1ddc=0xce;}_0x38a99c[_0x7254('0x18')](_0x2a1ddc);return _0x38a99c[_0x7254('0x1f')](_0x7254('0x20'),_0x2737e0+'-'+_0x1f48f6+'/'+_0x3b5f06)[_0x7254('0x1a')](_0x163c8c);}return null;};}function patchUpdates(_0x3b6cb6){return function(_0x2594b8){try{jsonpatch[_0x7254('0x21')](_0x2594b8,_0x3b6cb6,!![]);}catch(_0xc617b6){return BPromise[_0x7254('0x22')](_0xc617b6);}return _0x2594b8[_0x7254('0x23')]();};}function saveUpdates(_0x95ceaa,_0x2bb2fe){return function(_0x46c0a2){if(_0x46c0a2){return _0x46c0a2[_0x7254('0x24')](_0x95ceaa)[_0x7254('0x25')](function(_0x1be69b){return _0x1be69b;});}return null;};}function removeEntity(_0x50c34b,_0x493bfd){return function(_0x136ea3){if(_0x136ea3){return _0x136ea3[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x50c34b[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x36b5d5,_0x133aee){return function(_0x5d6df5){if(!_0x5d6df5){_0x36b5d5[_0x7254('0x17')](0x194);}return _0x5d6df5;};}function handleError(_0x21a579,_0x2b4f46){_0x2b4f46=_0x2b4f46||0x1f4;return function(_0x494cdb){logger[_0x7254('0x27')](_0x494cdb['stack']);if(_0x494cdb[_0x7254('0x28')]){delete _0x494cdb[_0x7254('0x28')];}_0x21a579['status'](_0x2b4f46)[_0x7254('0x29')](_0x494cdb);};}exports[_0x7254('0x2a')]=function(_0x4f684c,_0x14cbea){var _0x6c4927={},_0x37cb5c={},_0xb9198b={'count':0x0,'rows':[]};var _0x43bf02=_[_0x7254('0x2b')](db['FreshdeskField'][_0x7254('0x2c')],function(_0x2dba3f){return{'name':_0x2dba3f['fieldName'],'type':_0x2dba3f[_0x7254('0x2d')][_0x7254('0x2e')]};});_0x37cb5c[_0x7254('0x2f')]=_['map'](_0x43bf02,_0x7254('0x28'));_0x37cb5c[_0x7254('0x30')]=_[_0x7254('0x31')](_0x4f684c[_0x7254('0x30')]);_0x37cb5c[_0x7254('0x32')]=_[_0x7254('0x33')](_0x37cb5c[_0x7254('0x2f')],_0x37cb5c['query']);_0x6c4927[_0x7254('0x34')]=_['intersection'](_0x37cb5c['model'],qs[_0x7254('0x35')](_0x4f684c[_0x7254('0x30')][_0x7254('0x35')]));_0x6c4927[_0x7254('0x34')]=_0x6c4927[_0x7254('0x34')][_0x7254('0x36')]?_0x6c4927[_0x7254('0x34')]:_0x37cb5c[_0x7254('0x2f')];if(!_0x4f684c[_0x7254('0x30')][_0x7254('0x37')](_0x7254('0x38'))){_0x6c4927[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x4f684c[_0x7254('0x30')]['limit']);_0x6c4927[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x4f684c[_0x7254('0x30')][_0x7254('0x1b')]);}_0x6c4927[_0x7254('0x39')]=qs['sort'](_0x4f684c[_0x7254('0x30')]['sort']);_0x6c4927[_0x7254('0x3a')]=qs[_0x7254('0x32')](_[_0x7254('0x3b')](_0x4f684c[_0x7254('0x30')],_0x37cb5c[_0x7254('0x32')]),_0x43bf02);if(_0x4f684c['query'][_0x7254('0x3c')]){_0x6c4927['where']=_[_0x7254('0x3d')](_0x6c4927[_0x7254('0x3a')],{'$or':_['map'](_0x43bf02,function(_0x1485a0){if(_0x1485a0[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x9273ee={};_0x9273ee[_0x1485a0[_0x7254('0x28')]]={'$like':'%'+_0x4f684c[_0x7254('0x30')]['filter']+'%'};return _0x9273ee;}})});}_0x6c4927=_[_0x7254('0x3d')]({},_0x6c4927,_0x4f684c[_0x7254('0x3f')]);var _0x105b8c={'where':_0x6c4927['where']};return db[_0x7254('0x40')][_0x7254('0x1e')](_0x105b8c)[_0x7254('0x25')](function(_0x4824d5){_0xb9198b[_0x7254('0x1e')]=_0x4824d5;if(_0x4f684c[_0x7254('0x30')][_0x7254('0x41')]){_0x6c4927[_0x7254('0x42')]=[{'all':!![]}];}return db[_0x7254('0x40')]['findAll'](_0x6c4927);})['then'](function(_0x25004f){_0xb9198b[_0x7254('0x43')]=_0x25004f;return _0xb9198b;})[_0x7254('0x25')](respondWithFilteredResult(_0x14cbea,_0x6c4927))[_0x7254('0x44')](handleError(_0x14cbea,null));};exports['show']=function(_0x53a7a7,_0x29821a){var _0x565cd8={'raw':!![],'where':{'id':_0x53a7a7[_0x7254('0x45')]['id']}},_0x2ae22e={};_0x2ae22e[_0x7254('0x2f')]=_[_0x7254('0x31')](db['FreshdeskField']['rawAttributes']);_0x2ae22e[_0x7254('0x30')]=_[_0x7254('0x31')](_0x53a7a7[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x32')]=_[_0x7254('0x33')](_0x2ae22e['model'],_0x2ae22e['query']);_0x565cd8[_0x7254('0x34')]=_[_0x7254('0x33')](_0x2ae22e[_0x7254('0x2f')],qs['fields'](_0x53a7a7[_0x7254('0x30')][_0x7254('0x35')]));_0x565cd8['attributes']=_0x565cd8[_0x7254('0x34')][_0x7254('0x36')]?_0x565cd8[_0x7254('0x34')]:_0x2ae22e[_0x7254('0x2f')];if(_0x53a7a7['query'][_0x7254('0x41')]){_0x565cd8[_0x7254('0x42')]=[{'all':!![]}];}_0x565cd8=_['merge']({},_0x565cd8,_0x53a7a7[_0x7254('0x3f')]);return db[_0x7254('0x40')][_0x7254('0x46')](_0x565cd8)['then'](handleEntityNotFound(_0x29821a,null))[_0x7254('0x25')](respondWithResult(_0x29821a,null))[_0x7254('0x44')](handleError(_0x29821a,null));};exports['create']=function(_0x5f101e,_0x10b32f){return db['FreshdeskField'][_0x7254('0x47')](_0x5f101e[_0x7254('0x48')],{})['then'](respondWithResult(_0x10b32f,0xc9))['catch'](handleError(_0x10b32f,null));};exports[_0x7254('0x24')]=function(_0xc40bc5,_0x38bcd5){if(_0xc40bc5[_0x7254('0x48')]['id']){delete _0xc40bc5[_0x7254('0x48')]['id'];}return db[_0x7254('0x40')]['find']({'where':{'id':_0xc40bc5[_0x7254('0x45')]['id']}})['then'](handleEntityNotFound(_0x38bcd5,null))[_0x7254('0x25')](saveUpdates(_0xc40bc5[_0x7254('0x48')],null))[_0x7254('0x25')](respondWithResult(_0x38bcd5,null))['catch'](handleError(_0x38bcd5,null));};exports[_0x7254('0x26')]=function(_0x1c1a0e,_0x252758){return db['FreshdeskField'][_0x7254('0x46')]({'where':{'id':_0x1c1a0e[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x252758,null))[_0x7254('0x25')](removeEntity(_0x252758,null))[_0x7254('0x44')](handleError(_0x252758,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 8601ea6..ce51f9a 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 _0xf5b7=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshdeskField.attributes'];(function(_0xd29952,_0x353ba8){var _0x3cd62d=function(_0x2915c4){while(--_0x2915c4){_0xd29952['push'](_0xd29952['shift']());}};_0x3cd62d(++_0x353ba8);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x1a8752,_0x4cfe0a){_0x1a8752=_0x1a8752-0x0;var _0x5223a0=_0xf5b7[_0x1a8752];return _0x5223a0;};'use strict';var _=require('lodash');var util=require(_0x7f5b('0x0'));var logger=require(_0x7f5b('0x1'))(_0x7f5b('0x2'));var moment=require(_0x7f5b('0x3'));var BPromise=require(_0x7f5b('0x4'));var rp=require(_0x7f5b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f5b('0x6'));var config=require('../../config/environment');var attributes=require(_0x7f5b('0x7'));module[_0x7f5b('0x8')]=function(_0x481e5b,_0x295885){return _0x481e5b[_0x7f5b('0x9')](_0x7f5b('0xa'),attributes,{'tableName':_0x7f5b('0xb'),'paranoid':![],'indexes':[{'name':_0x7f5b('0xc'),'fields':[_0x7f5b('0xd'),_0x7f5b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7507=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','idField','lodash','../../config/logger'];(function(_0x4d605f,_0x1955ac){var _0x177aef=function(_0xf5ca58){while(--_0xf5ca58){_0x4d605f['push'](_0x4d605f['shift']());}};_0x177aef(++_0x1955ac);}(_0x7507,0x6a));var _0x7750=function(_0x5ac0cc,_0x2339fa){_0x5ac0cc=_0x5ac0cc-0x0;var _0xf83dac=_0x7507[_0x5ac0cc];return _0xf83dac;};'use strict';var _=require(_0x7750('0x0'));var util=require('util');var logger=require(_0x7750('0x1'))(_0x7750('0x2'));var moment=require(_0x7750('0x3'));var BPromise=require(_0x7750('0x4'));var rp=require(_0x7750('0x5'));var fs=require('fs');var path=require(_0x7750('0x6'));var rimraf=require(_0x7750('0x7'));var config=require(_0x7750('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x7750('0x9')]=function(_0x45ca9f,_0xad2b40){return _0x45ca9f[_0x7750('0xa')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x7750('0xb'),'FieldId'],'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 f65fb72..3628ba8 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 _0x6718=['stringify','error','message','FreshdeskField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0xa5ece8,_0x5b240e){var _0x12b877=function(_0x4a7c35){while(--_0x4a7c35){_0xa5ece8['push'](_0xa5ece8['shift']());}};_0x12b877(++_0x5b240e);}(_0x6718,0x1ea));var _0x8671=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x6718[_0x4812e0];return _0x252e0f;};'use strict';var _=require(_0x8671('0x0'));var util=require(_0x8671('0x1'));var moment=require('moment');var BPromise=require(_0x8671('0x2'));var rs=require(_0x8671('0x3'));var fs=require('fs');var Redis=require(_0x8671('0x4'));var db=require(_0x8671('0x5'))['db'];var utils=require(_0x8671('0x6'));var logger=require(_0x8671('0x7'))(_0x8671('0x8'));var config=require('../../config/environment');var jayson=require(_0x8671('0x9'));var client=jayson[_0x8671('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4db26b,_0x5ec462,_0x2c94c1){return new BPromise(function(_0x4b0e86,_0x9c4755){return client['request'](_0x4db26b,_0x2c94c1)[_0x8671('0xb')](function(_0x309c50){logger[_0x8671('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x5ec462,_0x8671('0xd'));logger[_0x8671('0xe')](_0x8671('0xf'),_0x5ec462,_0x8671('0xd'),JSON[_0x8671('0x10')](_0x309c50));if(_0x309c50[_0x8671('0x11')]){if(_0x309c50[_0x8671('0x11')]['code']===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5ec462,_0x309c50[_0x8671('0x11')][_0x8671('0x12')]);return _0x9c4755(_0x309c50[_0x8671('0x11')][_0x8671('0x12')]);}logger[_0x8671('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x5ec462,_0x309c50['error'][_0x8671('0x12')]);return _0x4b0e86(_0x309c50[_0x8671('0x11')][_0x8671('0x12')]);}else{logger[_0x8671('0xc')](_0x8671('0x13'),_0x5ec462,'request\x20sent');_0x4b0e86(_0x309c50[_0x8671('0x14')][_0x8671('0x12')]);}})[_0x8671('0x15')](function(_0x3d7dfd){logger[_0x8671('0x11')](_0x8671('0x13'),_0x5ec462,_0x3d7dfd);_0x9c4755(_0x3d7dfd);});});} \ No newline at end of file +var _0x4890=['jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xfd7573,_0x595b37){var _0x305269=function(_0x2e07c4){while(--_0x2e07c4){_0xfd7573['push'](_0xfd7573['shift']());}};_0x305269(++_0x595b37);}(_0x4890,0x16d));var _0x0489=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0x4890[_0x42bafd];return _0x2ed705;};'use strict';var _=require(_0x0489('0x0'));var util=require(_0x0489('0x1'));var moment=require('moment');var BPromise=require(_0x0489('0x2'));var rs=require(_0x0489('0x3'));var fs=require('fs');var Redis=require(_0x0489('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0489('0x5'));var logger=require(_0x0489('0x6'))(_0x0489('0x7'));var config=require(_0x0489('0x8'));var jayson=require(_0x0489('0x9'));var client=jayson[_0x0489('0xa')][_0x0489('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd982b6,_0x1b7307,_0x53df8b){return new BPromise(function(_0x4eddab,_0x143f0f){return client[_0x0489('0xc')](_0xd982b6,_0x53df8b)[_0x0489('0xd')](function(_0x5de73c){logger['info'](_0x0489('0xe'),_0x1b7307,_0x0489('0xf'));logger[_0x0489('0x10')](_0x0489('0x11'),_0x1b7307,'request\x20sent',JSON['stringify'](_0x5de73c));if(_0x5de73c[_0x0489('0x12')]){if(_0x5de73c[_0x0489('0x12')][_0x0489('0x13')]===0x1f4){logger[_0x0489('0x12')](_0x0489('0xe'),_0x1b7307,_0x5de73c[_0x0489('0x12')][_0x0489('0x14')]);return _0x143f0f(_0x5de73c[_0x0489('0x12')][_0x0489('0x14')]);}logger[_0x0489('0x12')](_0x0489('0xe'),_0x1b7307,_0x5de73c[_0x0489('0x12')][_0x0489('0x14')]);return _0x4eddab(_0x5de73c[_0x0489('0x12')][_0x0489('0x14')]);}else{logger[_0x0489('0x15')](_0x0489('0xe'),_0x1b7307,_0x0489('0xf'));_0x4eddab(_0x5de73c['result'][_0x0489('0x14')]);}})['catch'](function(_0x21e7ab){logger[_0x0489('0x12')](_0x0489('0xe'),_0x1b7307,_0x21e7ab);_0x143f0f(_0x21e7ab);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d0132dc..cf02bf7 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 _0x5eb8=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ba51a,_0x202d38){var _0x371892=function(_0x4fe805){while(--_0x4fe805){_0x3ba51a['push'](_0x3ba51a['shift']());}};_0x371892(++_0x202d38);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0x5eb8[_0x4991d6];return _0x50faf7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x12')]('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0x12')](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['update']);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x15')]);module[_0x85eb('0x16')]=router; \ No newline at end of file +var _0x63a5=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete'];(function(_0x12fdec,_0x228157){var _0x1bfdeb=function(_0x21bab5){while(--_0x21bab5){_0x12fdec['push'](_0x12fdec['shift']());}};_0x1bfdeb(++_0x228157);}(_0x63a5,0x18e));var _0x563a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x63a5[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var path=require(_0x563a('0x2'));var timeout=require('connect-timeout');var express=require(_0x563a('0x3'));var router=express['Router']();var fs_extra=require(_0x563a('0x4'));var auth=require(_0x563a('0x5'));var interaction=require(_0x563a('0x6'));var config=require(_0x563a('0x7'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x563a('0x8')](),controller['index']);router[_0x563a('0x9')](_0x563a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x563a('0x9')](_0x563a('0xb'),auth[_0x563a('0x8')](),controller[_0x563a('0xc')]);router[_0x563a('0x9')](_0x563a('0xd'),auth[_0x563a('0x8')](),controller[_0x563a('0xe')]);router[_0x563a('0xf')]('/',auth[_0x563a('0x8')](),controller[_0x563a('0x10')]);router[_0x563a('0xf')](_0x563a('0xb'),auth[_0x563a('0x8')](),controller['addConfiguration']);router[_0x563a('0x11')](_0x563a('0xa'),auth[_0x563a('0x8')](),controller[_0x563a('0x12')]);router[_0x563a('0x13')](_0x563a('0xa'),auth['isAuthenticated'](),controller[_0x563a('0x14')]);module[_0x563a('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 65fa483..1a05ea8 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 _0x5204=['exports','STRING','username','sequelize'];(function(_0x5f2e8f,_0x1f31d6){var _0x3f7703=function(_0x373bff){while(--_0x373bff){_0x5f2e8f['push'](_0x5f2e8f['shift']());}};_0x3f7703(++_0x1f31d6);}(_0x5204,0xdf));var _0x4520=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x5204[_0x178668];return _0x26107d;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe820=['sequelize','STRING','username'];(function(_0x5bac2f,_0x4e1c54){var _0x35ecc3=function(_0x9e0309){while(--_0x9e0309){_0x5bac2f['push'](_0x5bac2f['shift']());}};_0x35ecc3(++_0x4e1c54);}(_0xe820,0xd2));var _0x0e82=function(_0x32acf9,_0x122bf1){_0x32acf9=_0x32acf9-0x0;var _0x34a2e1=_0xe820[_0x32acf9];return _0x34a2e1;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0e82('0x2')},'apiKey':{'type':Sequelize[_0x0e82('0x1')]},'remoteUri':{'type':Sequelize[_0x0e82('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 97c8c54..a156f2a 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 _0x02f8=['show','params','keys','options','create','body','find','getConfigurations','FreshsalesConfiguration','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','findOne','username','apiKey','remoteUri','lastIndexOf','GET','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','set','reject','save','then','destroy','name','send','index','fieldName','type','map','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','FreshsalesAccount','count','includeAll','include','findAll','rows','catch'];(function(_0x43bf27,_0x26bc33){var _0xfa0620=function(_0x34fa99){while(--_0x34fa99){_0x43bf27['push'](_0x43bf27['shift']());}};_0xfa0620(++_0x26bc33);}(_0x02f8,0xe9));var _0x802f=function(_0x55bd38,_0x48eacf){_0x55bd38=_0x55bd38-0x0;var _0x444323=_0x02f8[_0x55bd38];return _0x444323;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x802f('0x0'));var zipdir=require(_0x802f('0x1'));var jsonpatch=require(_0x802f('0x2'));var rp=require('request-promise');var moment=require(_0x802f('0x3'));var BPromise=require(_0x802f('0x4'));var Mustache=require(_0x802f('0x5'));var util=require('util');var path=require(_0x802f('0x6'));var sox=require(_0x802f('0x7'));var csv=require(_0x802f('0x8'));var ejs=require(_0x802f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x802f('0xa'));var squel=require(_0x802f('0xb'));var crypto=require(_0x802f('0xc'));var jsforce=require(_0x802f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x802f('0x8'));var querystring=require(_0x802f('0xe'));var Papa=require(_0x802f('0xf'));var Redis=require(_0x802f('0x10'));var authService=require(_0x802f('0x11'));var qs=require(_0x802f('0x12'));var as=require(_0x802f('0x13'));var hardwareService=require(_0x802f('0x14'));var logger=require(_0x802f('0x15'))(_0x802f('0x16'));var utils=require(_0x802f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x802f('0x18'));var db=require(_0x802f('0x19'))['db'];var integrations=require(_0x802f('0x1a'));function respondWithStatusCode(_0x5d6e93,_0x57bfc3){_0x57bfc3=_0x57bfc3||0xcc;return function(_0x5a555d){if(_0x5a555d){return _0x5d6e93[_0x802f('0x1b')](_0x57bfc3);}return _0x5d6e93[_0x802f('0x1c')](_0x57bfc3)[_0x802f('0x1d')]();};}function respondWithResult(_0x523903,_0x4ddb27){_0x4ddb27=_0x4ddb27||0xc8;return function(_0x21c73e){if(_0x21c73e){return _0x523903[_0x802f('0x1c')](_0x4ddb27)[_0x802f('0x1e')](_0x21c73e);}};}function respondWithFilteredResult(_0x3daa2c,_0x25f681){return function(_0x5cc7d4){if(_0x5cc7d4){var _0x2a69f2=typeof _0x25f681[_0x802f('0x1f')]==='undefined'&&typeof _0x25f681[_0x802f('0x20')]===_0x802f('0x21');var _0x1bdb93=_0x5cc7d4['count'];var _0x12aada=_0x2a69f2?0x0:_0x25f681[_0x802f('0x1f')];var _0x58a419=_0x2a69f2?_0x5cc7d4['count']:_0x25f681[_0x802f('0x1f')]+_0x25f681[_0x802f('0x20')];var _0x269949;if(_0x58a419>=_0x1bdb93){_0x58a419=_0x1bdb93;_0x269949=0xc8;}else{_0x269949=0xce;}_0x3daa2c[_0x802f('0x1c')](_0x269949);return _0x3daa2c[_0x802f('0x22')]('Content-Range',_0x12aada+'-'+_0x58a419+'/'+_0x1bdb93)['json'](_0x5cc7d4);}return null;};}function patchUpdates(_0x5a7417){return function(_0x4a4807){try{jsonpatch['apply'](_0x4a4807,_0x5a7417,!![]);}catch(_0x45d870){return BPromise[_0x802f('0x23')](_0x45d870);}return _0x4a4807[_0x802f('0x24')]();};}function saveUpdates(_0x2a348b,_0x2ba2cf){return function(_0xcb4536){if(_0xcb4536){return _0xcb4536['update'](_0x2a348b)[_0x802f('0x25')](function(_0x52400c){return _0x52400c;});}return null;};}function removeEntity(_0x3203c6,_0x12535f){return function(_0x1d9f36){if(_0x1d9f36){return _0x1d9f36[_0x802f('0x26')]()['then'](function(){_0x3203c6['status'](0xcc)[_0x802f('0x1d')]();});}};}function handleEntityNotFound(_0x568d6f,_0x16ff4a){return function(_0xafc56){if(!_0xafc56){_0x568d6f[_0x802f('0x1b')](0x194);}return _0xafc56;};}function handleError(_0x27b3a1,_0x583505){_0x583505=_0x583505||0x1f4;return function(_0x47fe2b){logger['error'](_0x47fe2b['stack']);if(_0x47fe2b[_0x802f('0x27')]){delete _0x47fe2b[_0x802f('0x27')];}_0x27b3a1['status'](_0x583505)[_0x802f('0x28')](_0x47fe2b);};}exports[_0x802f('0x29')]=function(_0x64e4ef,_0x187462){var _0x581a75={},_0x2e1fc5={},_0x2a25cc={'count':0x0,'rows':[]};var _0x25785c=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x5d1fdd){return{'name':_0x5d1fdd[_0x802f('0x2a')],'type':_0x5d1fdd[_0x802f('0x2b')]['key']};});_0x2e1fc5['model']=_[_0x802f('0x2c')](_0x25785c,_0x802f('0x27'));_0x2e1fc5['query']=_['keys'](_0x64e4ef['query']);_0x2e1fc5['filters']=_[_0x802f('0x2d')](_0x2e1fc5[_0x802f('0x2e')],_0x2e1fc5[_0x802f('0x2f')]);_0x581a75[_0x802f('0x30')]=_[_0x802f('0x2d')](_0x2e1fc5[_0x802f('0x2e')],qs[_0x802f('0x31')](_0x64e4ef[_0x802f('0x2f')][_0x802f('0x31')]));_0x581a75[_0x802f('0x30')]=_0x581a75[_0x802f('0x30')][_0x802f('0x32')]?_0x581a75[_0x802f('0x30')]:_0x2e1fc5[_0x802f('0x2e')];if(!_0x64e4ef[_0x802f('0x2f')]['hasOwnProperty'](_0x802f('0x33'))){_0x581a75[_0x802f('0x20')]=qs[_0x802f('0x20')](_0x64e4ef[_0x802f('0x2f')][_0x802f('0x20')]);_0x581a75[_0x802f('0x1f')]=qs[_0x802f('0x1f')](_0x64e4ef[_0x802f('0x2f')][_0x802f('0x1f')]);}_0x581a75[_0x802f('0x34')]=qs[_0x802f('0x35')](_0x64e4ef[_0x802f('0x2f')]['sort']);_0x581a75[_0x802f('0x36')]=qs[_0x802f('0x37')](_[_0x802f('0x38')](_0x64e4ef['query'],_0x2e1fc5[_0x802f('0x37')]),_0x25785c);if(_0x64e4ef[_0x802f('0x2f')][_0x802f('0x39')]){_0x581a75[_0x802f('0x36')]=_[_0x802f('0x3a')](_0x581a75[_0x802f('0x36')],{'$or':_['map'](_0x25785c,function(_0x447d1d){if(_0x447d1d[_0x802f('0x2b')]!==_0x802f('0x3b')){var _0x415cdc={};_0x415cdc[_0x447d1d['name']]={'$like':'%'+_0x64e4ef[_0x802f('0x2f')][_0x802f('0x39')]+'%'};return _0x415cdc;}})});}_0x581a75=_[_0x802f('0x3a')]({},_0x581a75,_0x64e4ef['options']);var _0x26e6fc={'where':_0x581a75[_0x802f('0x36')]};return db[_0x802f('0x3c')][_0x802f('0x3d')](_0x26e6fc)[_0x802f('0x25')](function(_0x2ec682){_0x2a25cc[_0x802f('0x3d')]=_0x2ec682;if(_0x64e4ef[_0x802f('0x2f')][_0x802f('0x3e')]){_0x581a75[_0x802f('0x3f')]=[{'all':!![]}];}return db[_0x802f('0x3c')][_0x802f('0x40')](_0x581a75);})['then'](function(_0x42cf22){_0x2a25cc[_0x802f('0x41')]=_0x42cf22;return _0x2a25cc;})[_0x802f('0x25')](respondWithFilteredResult(_0x187462,_0x581a75))[_0x802f('0x42')](handleError(_0x187462,null));};exports[_0x802f('0x43')]=function(_0x111941,_0x461b1f){var _0x558295={'raw':![],'where':{'id':_0x111941[_0x802f('0x44')]['id']}},_0x21fc56={};_0x21fc56['model']=_['keys'](db[_0x802f('0x3c')]['rawAttributes']);_0x21fc56[_0x802f('0x2f')]=_[_0x802f('0x45')](_0x111941[_0x802f('0x2f')]);_0x21fc56['filters']=_[_0x802f('0x2d')](_0x21fc56[_0x802f('0x2e')],_0x21fc56[_0x802f('0x2f')]);_0x558295['attributes']=_[_0x802f('0x2d')](_0x21fc56['model'],qs[_0x802f('0x31')](_0x111941[_0x802f('0x2f')][_0x802f('0x31')]));_0x558295[_0x802f('0x30')]=_0x558295[_0x802f('0x30')][_0x802f('0x32')]?_0x558295[_0x802f('0x30')]:_0x21fc56[_0x802f('0x2e')];if(_0x111941['query'][_0x802f('0x3e')]){_0x558295[_0x802f('0x3f')]=[{'all':!![]}];}_0x558295=_[_0x802f('0x3a')]({},_0x558295,_0x111941[_0x802f('0x46')]);return db[_0x802f('0x3c')]['find'](_0x558295)[_0x802f('0x25')](handleEntityNotFound(_0x461b1f,null))[_0x802f('0x25')](respondWithResult(_0x461b1f,null))[_0x802f('0x42')](handleError(_0x461b1f,null));};exports[_0x802f('0x47')]=function(_0x5e3e3b,_0x54ef42){return db['FreshsalesAccount'][_0x802f('0x47')](_0x5e3e3b[_0x802f('0x48')],{})[_0x802f('0x25')](respondWithResult(_0x54ef42,0xc9))[_0x802f('0x42')](handleError(_0x54ef42,null));};exports['update']=function(_0x57680d,_0x17dfbb){if(_0x57680d[_0x802f('0x48')]['id']){delete _0x57680d[_0x802f('0x48')]['id'];}return db[_0x802f('0x3c')][_0x802f('0x49')]({'where':{'id':_0x57680d[_0x802f('0x44')]['id']}})[_0x802f('0x25')](handleEntityNotFound(_0x17dfbb,null))[_0x802f('0x25')](saveUpdates(_0x57680d['body'],null))['then'](respondWithResult(_0x17dfbb,null))[_0x802f('0x42')](handleError(_0x17dfbb,null));};exports['destroy']=function(_0x2ae533,_0x39cea3){return db[_0x802f('0x3c')][_0x802f('0x49')]({'where':{'id':_0x2ae533[_0x802f('0x44')]['id']}})[_0x802f('0x25')](handleEntityNotFound(_0x39cea3,null))[_0x802f('0x25')](removeEntity(_0x39cea3,null))[_0x802f('0x42')](handleError(_0x39cea3,null));};exports[_0x802f('0x4a')]=function(_0x3df45e,_0x4bd836,_0x317914){var _0x366ad1={};var _0xcc5534={};var _0x1e7ec0;var _0x49bd37;return db[_0x802f('0x3c')]['findOne']({'where':{'id':_0x3df45e['params']['id']}})[_0x802f('0x25')](handleEntityNotFound(_0x4bd836,null))[_0x802f('0x25')](function(_0x408bfe){if(_0x408bfe){_0x1e7ec0=_0x408bfe;_0xcc5534[_0x802f('0x2e')]=_['keys'](db[_0x802f('0x4b')]['rawAttributes']);_0xcc5534[_0x802f('0x2f')]=_[_0x802f('0x45')](_0x3df45e[_0x802f('0x2f')]);_0xcc5534[_0x802f('0x37')]=_[_0x802f('0x2d')](_0xcc5534[_0x802f('0x2e')],_0xcc5534[_0x802f('0x2f')]);_0x366ad1[_0x802f('0x30')]=_[_0x802f('0x2d')](_0xcc5534[_0x802f('0x2e')],qs[_0x802f('0x31')](_0x3df45e['query'][_0x802f('0x31')]));_0x366ad1[_0x802f('0x30')]=_0x366ad1[_0x802f('0x30')][_0x802f('0x32')]?_0x366ad1[_0x802f('0x30')]:_0xcc5534[_0x802f('0x2e')];_0x366ad1[_0x802f('0x34')]=qs[_0x802f('0x35')](_0x3df45e['query'][_0x802f('0x35')]);_0x366ad1[_0x802f('0x36')]=qs[_0x802f('0x37')](_[_0x802f('0x38')](_0x3df45e[_0x802f('0x2f')],_0xcc5534[_0x802f('0x37')]));if(_0x3df45e[_0x802f('0x2f')][_0x802f('0x39')]){_0x366ad1[_0x802f('0x36')]=_[_0x802f('0x3a')](_0x366ad1[_0x802f('0x36')],{'$or':_[_0x802f('0x2c')](_0x366ad1[_0x802f('0x30')],function(_0xb32067){var _0x48fdad={};_0x48fdad[_0xb32067]={'$like':'%'+_0x3df45e[_0x802f('0x2f')]['filter']+'%'};return _0x48fdad;})});}_0x366ad1=_[_0x802f('0x3a')]({},_0x366ad1,_0x3df45e[_0x802f('0x46')]);return _0x1e7ec0[_0x802f('0x4a')](_0x366ad1);}})['then'](function(_0x57e42e){if(_0x57e42e){_0x49bd37=_0x57e42e[_0x802f('0x32')];if(!_0x3df45e[_0x802f('0x2f')][_0x802f('0x4c')]('nolimit')){_0x366ad1[_0x802f('0x20')]=qs['limit'](_0x3df45e[_0x802f('0x2f')][_0x802f('0x20')]);_0x366ad1['offset']=qs[_0x802f('0x1f')](_0x3df45e[_0x802f('0x2f')][_0x802f('0x1f')]);}return _0x1e7ec0[_0x802f('0x4a')](_0x366ad1);}})['then'](function(_0x2789a8){if(_0x2789a8){return _0x2789a8?{'count':_0x49bd37,'rows':_0x2789a8}:null;}})[_0x802f('0x25')](respondWithResult(_0x4bd836,null))[_0x802f('0x42')](handleError(_0x4bd836,null));};exports['addConfiguration']=function(_0xa6feb3,_0x4557f3,_0x4ce885){if(_0xa6feb3[_0x802f('0x48')]['id']){delete _0xa6feb3[_0x802f('0x48')]['id'];}return db[_0x802f('0x3c')]['findOne']({'where':{'id':_0xa6feb3['params']['id']}})[_0x802f('0x25')](handleEntityNotFound(_0x4557f3,null))[_0x802f('0x25')](function(_0x1d0d81){if(_0x1d0d81){_0xa6feb3['body'][_0x802f('0x4d')]=_0x1d0d81['id'];_0xa6feb3['body']['Subjects']=integrations[_0x802f('0x4e')](_0xa6feb3['body'][_0x802f('0x4f')],_0xa6feb3[_0x802f('0x48')][_0x802f('0x2b')]);_0xa6feb3[_0x802f('0x48')][_0x802f('0x50')]=integrations[_0x802f('0x51')](_0xa6feb3[_0x802f('0x48')][_0x802f('0x4f')],_0xa6feb3[_0x802f('0x48')][_0x802f('0x2b')]);return db['FreshsalesConfiguration']['create'](_0xa6feb3[_0x802f('0x48')],{'include':[{'model':db[_0x802f('0x52')],'as':_0x802f('0x53')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x802f('0x25')](respondWithResult(_0x4557f3,null))[_0x802f('0x42')](handleError(_0x4557f3,null));};exports[_0x802f('0x54')]=function(_0x22a1e3,_0x50d25a,_0x192aa3){var _0x11be80='';var _0x193fa2='';return db['FreshsalesAccount'][_0x802f('0x55')]({'where':{'id':_0x22a1e3['params']['id']},'attributes':['id',_0x802f('0x56'),'remoteUri',_0x802f('0x57')]})[_0x802f('0x25')](handleEntityNotFound(_0x50d25a,null))['then'](function(_0x5d80e3){if(_0x5d80e3){_0x193fa2=_0x5d80e3[_0x802f('0x56')];_0x11be80=_0x5d80e3[_0x802f('0x58')];var _0x24abb9=_0x5d80e3[_0x802f('0x58')]['slice'](-0x1);if(_0x24abb9==='/'){_0x11be80=_0x11be80['substring'](0x0,_0x11be80[_0x802f('0x59')](_0x24abb9));}return rp({'method':_0x802f('0x5a'),'uri':util['format']('%s%s',_0x11be80,_0x802f('0x5b')),'headers':{'Authorization':_0x802f('0x5c')+_0x5d80e3[_0x802f('0x57')]},'json':!![]});}})[_0x802f('0x25')](function(_0xd0d87c){if(_0xd0d87c){var _0x3bd9ff=_0xd0d87c['users'];var _0x1a13c7=![];var _0x341038=null;for(_0x341038=0x0;_0x341038<_0x3bd9ff['length'];_0x341038++){if(_0x3bd9ff[_0x341038][_0x802f('0x5d')]===_0x193fa2){_0x1a13c7=!![];}}if(_0x1a13c7){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x802f('0x5e')});}}})[_0x802f('0x25')](respondWithResult(_0x50d25a,null))[_0x802f('0x42')](function(_0x49597b){var _0x5659c9=_0x22a1e3['query'][_0x802f('0x5f')]?0x1f4:_0x49597b[_0x802f('0x60')]||0x1f4;logger[_0x802f('0x61')](_0x802f('0x62'),_0x802f('0x54'),_0x5659c9,JSON[_0x802f('0x63')](_0x49597b));delete _0x49597b[_0x802f('0x27')];if(_0x5659c9===0x191){_0x5659c9=0x190;}_0x50d25a[_0x802f('0x1c')](_0x5659c9)[_0x802f('0x28')](_0x22a1e3[_0x802f('0x2f')][_0x802f('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x49597b[_0x802f('0x60')]}:_0x49597b);});}; \ No newline at end of file +var _0xd229=['nolimit','AccountId','getSubjects','Descriptions','getDescriptions','Subjects','FreshsalesField','getFields','username','remoteUri','slice','substring','format','%s%s','/api/selector/owners','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','FreshsalesAccount','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','options'];(function(_0x31ac0f,_0xad946c){var _0x498248=function(_0x3d46c1){while(--_0x3d46c1){_0x31ac0f['push'](_0x31ac0f['shift']());}};_0x498248(++_0xad946c);}(_0xd229,0x13b));var _0x9d22=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xd229[_0x6cf19c];return _0xce14f3;};'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(_0x9d22('0x0'));var moment=require(_0x9d22('0x1'));var BPromise=require(_0x9d22('0x2'));var Mustache=require(_0x9d22('0x3'));var util=require('util');var path=require('path');var sox=require(_0x9d22('0x4'));var csv=require(_0x9d22('0x5'));var ejs=require(_0x9d22('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9d22('0x7'));var crypto=require(_0x9d22('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x9d22('0x9'));var toCsv=require(_0x9d22('0x5'));var querystring=require(_0x9d22('0xa'));var Papa=require(_0x9d22('0xb'));var Redis=require('ioredis');var authService=require(_0x9d22('0xc'));var qs=require(_0x9d22('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d22('0xe'));var logger=require(_0x9d22('0xf'))(_0x9d22('0x10'));var utils=require('../../config/utils');var config=require(_0x9d22('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d22('0x12'))['db'];var integrations=require(_0x9d22('0x13'));function respondWithStatusCode(_0x24347d,_0x32315a){_0x32315a=_0x32315a||0xcc;return function(_0x2591d2){if(_0x2591d2){return _0x24347d[_0x9d22('0x14')](_0x32315a);}return _0x24347d[_0x9d22('0x15')](_0x32315a)[_0x9d22('0x16')]();};}function respondWithResult(_0x4d1ded,_0x5680a4){_0x5680a4=_0x5680a4||0xc8;return function(_0x1adc93){if(_0x1adc93){return _0x4d1ded[_0x9d22('0x15')](_0x5680a4)[_0x9d22('0x17')](_0x1adc93);}};}function respondWithFilteredResult(_0x938f68,_0x129ddc){return function(_0x5d5959){if(_0x5d5959){var _0x51d995=typeof _0x129ddc[_0x9d22('0x18')]===_0x9d22('0x19')&&typeof _0x129ddc[_0x9d22('0x1a')]===_0x9d22('0x19');var _0xa82863=_0x5d5959['count'];var _0x20957d=_0x51d995?0x0:_0x129ddc[_0x9d22('0x18')];var _0x106be2=_0x51d995?_0x5d5959[_0x9d22('0x1b')]:_0x129ddc[_0x9d22('0x18')]+_0x129ddc[_0x9d22('0x1a')];var _0x4713a3;if(_0x106be2>=_0xa82863){_0x106be2=_0xa82863;_0x4713a3=0xc8;}else{_0x4713a3=0xce;}_0x938f68[_0x9d22('0x15')](_0x4713a3);return _0x938f68[_0x9d22('0x1c')](_0x9d22('0x1d'),_0x20957d+'-'+_0x106be2+'/'+_0xa82863)[_0x9d22('0x17')](_0x5d5959);}return null;};}function patchUpdates(_0x33a7e9){return function(_0x5de0b8){try{jsonpatch[_0x9d22('0x1e')](_0x5de0b8,_0x33a7e9,!![]);}catch(_0x58e479){return BPromise[_0x9d22('0x1f')](_0x58e479);}return _0x5de0b8['save']();};}function saveUpdates(_0x354984,_0x5899af){return function(_0x19d0cc){if(_0x19d0cc){return _0x19d0cc['update'](_0x354984)['then'](function(_0x29e6e4){return _0x29e6e4;});}return null;};}function removeEntity(_0x32b167,_0x52aa25){return function(_0x229850){if(_0x229850){return _0x229850[_0x9d22('0x20')]()[_0x9d22('0x21')](function(){_0x32b167[_0x9d22('0x15')](0xcc)[_0x9d22('0x16')]();});}};}function handleEntityNotFound(_0x11b24a,_0x5269f4){return function(_0x5f3aea){if(!_0x5f3aea){_0x11b24a[_0x9d22('0x14')](0x194);}return _0x5f3aea;};}function handleError(_0x11d6c5,_0x43be8b){_0x43be8b=_0x43be8b||0x1f4;return function(_0x400c4b){logger[_0x9d22('0x22')](_0x400c4b[_0x9d22('0x23')]);if(_0x400c4b[_0x9d22('0x24')]){delete _0x400c4b['name'];}_0x11d6c5[_0x9d22('0x15')](_0x43be8b)[_0x9d22('0x25')](_0x400c4b);};}exports[_0x9d22('0x26')]=function(_0x358d00,_0x1b53dd){var _0x5ecc56={},_0xfc6944={},_0x7841ef={'count':0x0,'rows':[]};var _0xfbd4f2=_['map'](db[_0x9d22('0x27')][_0x9d22('0x28')],function(_0x312920){return{'name':_0x312920['fieldName'],'type':_0x312920[_0x9d22('0x29')][_0x9d22('0x2a')]};});_0xfc6944['model']=_[_0x9d22('0x2b')](_0xfbd4f2,_0x9d22('0x24'));_0xfc6944[_0x9d22('0x2c')]=_[_0x9d22('0x2d')](_0x358d00[_0x9d22('0x2c')]);_0xfc6944[_0x9d22('0x2e')]=_[_0x9d22('0x2f')](_0xfc6944[_0x9d22('0x30')],_0xfc6944[_0x9d22('0x2c')]);_0x5ecc56[_0x9d22('0x31')]=_['intersection'](_0xfc6944[_0x9d22('0x30')],qs[_0x9d22('0x32')](_0x358d00['query'][_0x9d22('0x32')]));_0x5ecc56['attributes']=_0x5ecc56[_0x9d22('0x31')][_0x9d22('0x33')]?_0x5ecc56[_0x9d22('0x31')]:_0xfc6944['model'];if(!_0x358d00[_0x9d22('0x2c')][_0x9d22('0x34')]('nolimit')){_0x5ecc56['limit']=qs[_0x9d22('0x1a')](_0x358d00[_0x9d22('0x2c')][_0x9d22('0x1a')]);_0x5ecc56[_0x9d22('0x18')]=qs['offset'](_0x358d00['query'][_0x9d22('0x18')]);}_0x5ecc56[_0x9d22('0x35')]=qs[_0x9d22('0x36')](_0x358d00[_0x9d22('0x2c')][_0x9d22('0x36')]);_0x5ecc56[_0x9d22('0x37')]=qs[_0x9d22('0x2e')](_[_0x9d22('0x38')](_0x358d00[_0x9d22('0x2c')],_0xfc6944[_0x9d22('0x2e')]),_0xfbd4f2);if(_0x358d00[_0x9d22('0x2c')]['filter']){_0x5ecc56[_0x9d22('0x37')]=_[_0x9d22('0x39')](_0x5ecc56['where'],{'$or':_[_0x9d22('0x2b')](_0xfbd4f2,function(_0x59f000){if(_0x59f000[_0x9d22('0x29')]!==_0x9d22('0x3a')){var _0x9aa546={};_0x9aa546[_0x59f000[_0x9d22('0x24')]]={'$like':'%'+_0x358d00[_0x9d22('0x2c')]['filter']+'%'};return _0x9aa546;}})});}_0x5ecc56=_[_0x9d22('0x39')]({},_0x5ecc56,_0x358d00['options']);var _0x37b040={'where':_0x5ecc56[_0x9d22('0x37')]};return db[_0x9d22('0x27')]['count'](_0x37b040)[_0x9d22('0x21')](function(_0x215c0f){_0x7841ef['count']=_0x215c0f;if(_0x358d00[_0x9d22('0x2c')][_0x9d22('0x3b')]){_0x5ecc56[_0x9d22('0x3c')]=[{'all':!![]}];}return db[_0x9d22('0x27')][_0x9d22('0x3d')](_0x5ecc56);})[_0x9d22('0x21')](function(_0x1e2e7c){_0x7841ef[_0x9d22('0x3e')]=_0x1e2e7c;return _0x7841ef;})[_0x9d22('0x21')](respondWithFilteredResult(_0x1b53dd,_0x5ecc56))[_0x9d22('0x3f')](handleError(_0x1b53dd,null));};exports[_0x9d22('0x40')]=function(_0x3fd7ae,_0x468216){var _0x3adb51={'raw':![],'where':{'id':_0x3fd7ae[_0x9d22('0x41')]['id']}},_0x20cc8e={};_0x20cc8e['model']=_['keys'](db[_0x9d22('0x27')][_0x9d22('0x28')]);_0x20cc8e['query']=_[_0x9d22('0x2d')](_0x3fd7ae[_0x9d22('0x2c')]);_0x20cc8e[_0x9d22('0x2e')]=_[_0x9d22('0x2f')](_0x20cc8e[_0x9d22('0x30')],_0x20cc8e[_0x9d22('0x2c')]);_0x3adb51[_0x9d22('0x31')]=_[_0x9d22('0x2f')](_0x20cc8e['model'],qs[_0x9d22('0x32')](_0x3fd7ae['query'][_0x9d22('0x32')]));_0x3adb51['attributes']=_0x3adb51[_0x9d22('0x31')]['length']?_0x3adb51['attributes']:_0x20cc8e['model'];if(_0x3fd7ae[_0x9d22('0x2c')][_0x9d22('0x3b')]){_0x3adb51[_0x9d22('0x3c')]=[{'all':!![]}];}_0x3adb51=_[_0x9d22('0x39')]({},_0x3adb51,_0x3fd7ae['options']);return db[_0x9d22('0x27')][_0x9d22('0x42')](_0x3adb51)[_0x9d22('0x21')](handleEntityNotFound(_0x468216,null))['then'](respondWithResult(_0x468216,null))[_0x9d22('0x3f')](handleError(_0x468216,null));};exports[_0x9d22('0x43')]=function(_0x2fbda1,_0x59507a){return db['FreshsalesAccount']['create'](_0x2fbda1['body'],{})[_0x9d22('0x21')](respondWithResult(_0x59507a,0xc9))[_0x9d22('0x3f')](handleError(_0x59507a,null));};exports['update']=function(_0x4ad65a,_0x134d81){if(_0x4ad65a[_0x9d22('0x44')]['id']){delete _0x4ad65a[_0x9d22('0x44')]['id'];}return db[_0x9d22('0x27')][_0x9d22('0x42')]({'where':{'id':_0x4ad65a[_0x9d22('0x41')]['id']}})[_0x9d22('0x21')](handleEntityNotFound(_0x134d81,null))[_0x9d22('0x21')](saveUpdates(_0x4ad65a[_0x9d22('0x44')],null))[_0x9d22('0x21')](respondWithResult(_0x134d81,null))[_0x9d22('0x3f')](handleError(_0x134d81,null));};exports[_0x9d22('0x20')]=function(_0x281e47,_0x407d06){return db[_0x9d22('0x27')][_0x9d22('0x42')]({'where':{'id':_0x281e47[_0x9d22('0x41')]['id']}})[_0x9d22('0x21')](handleEntityNotFound(_0x407d06,null))['then'](removeEntity(_0x407d06,null))['catch'](handleError(_0x407d06,null));};exports[_0x9d22('0x45')]=function(_0x505f2f,_0x2791bf,_0x574686){var _0x2221ea={};var _0x529693={};var _0x213ffb;var _0x54bfa9;return db[_0x9d22('0x27')][_0x9d22('0x46')]({'where':{'id':_0x505f2f[_0x9d22('0x41')]['id']}})[_0x9d22('0x21')](handleEntityNotFound(_0x2791bf,null))[_0x9d22('0x21')](function(_0x1cde87){if(_0x1cde87){_0x213ffb=_0x1cde87;_0x529693[_0x9d22('0x30')]=_['keys'](db[_0x9d22('0x47')][_0x9d22('0x28')]);_0x529693['query']=_[_0x9d22('0x2d')](_0x505f2f[_0x9d22('0x2c')]);_0x529693[_0x9d22('0x2e')]=_[_0x9d22('0x2f')](_0x529693[_0x9d22('0x30')],_0x529693['query']);_0x2221ea[_0x9d22('0x31')]=_[_0x9d22('0x2f')](_0x529693[_0x9d22('0x30')],qs[_0x9d22('0x32')](_0x505f2f['query'][_0x9d22('0x32')]));_0x2221ea[_0x9d22('0x31')]=_0x2221ea['attributes'][_0x9d22('0x33')]?_0x2221ea['attributes']:_0x529693[_0x9d22('0x30')];_0x2221ea[_0x9d22('0x35')]=qs[_0x9d22('0x36')](_0x505f2f[_0x9d22('0x2c')]['sort']);_0x2221ea[_0x9d22('0x37')]=qs[_0x9d22('0x2e')](_['pick'](_0x505f2f[_0x9d22('0x2c')],_0x529693[_0x9d22('0x2e')]));if(_0x505f2f[_0x9d22('0x2c')]['filter']){_0x2221ea[_0x9d22('0x37')]=_['merge'](_0x2221ea[_0x9d22('0x37')],{'$or':_['map'](_0x2221ea[_0x9d22('0x31')],function(_0x1df182){var _0x1c3640={};_0x1c3640[_0x1df182]={'$like':'%'+_0x505f2f[_0x9d22('0x2c')]['filter']+'%'};return _0x1c3640;})});}_0x2221ea=_[_0x9d22('0x39')]({},_0x2221ea,_0x505f2f[_0x9d22('0x48')]);return _0x213ffb[_0x9d22('0x45')](_0x2221ea);}})[_0x9d22('0x21')](function(_0x314356){if(_0x314356){_0x54bfa9=_0x314356[_0x9d22('0x33')];if(!_0x505f2f[_0x9d22('0x2c')][_0x9d22('0x34')](_0x9d22('0x49'))){_0x2221ea[_0x9d22('0x1a')]=qs[_0x9d22('0x1a')](_0x505f2f[_0x9d22('0x2c')][_0x9d22('0x1a')]);_0x2221ea[_0x9d22('0x18')]=qs[_0x9d22('0x18')](_0x505f2f[_0x9d22('0x2c')]['offset']);}return _0x213ffb[_0x9d22('0x45')](_0x2221ea);}})[_0x9d22('0x21')](function(_0x1048a2){if(_0x1048a2){return _0x1048a2?{'count':_0x54bfa9,'rows':_0x1048a2}:null;}})[_0x9d22('0x21')](respondWithResult(_0x2791bf,null))[_0x9d22('0x3f')](handleError(_0x2791bf,null));};exports['addConfiguration']=function(_0x11ae1d,_0x1089dd,_0xafa700){if(_0x11ae1d[_0x9d22('0x44')]['id']){delete _0x11ae1d[_0x9d22('0x44')]['id'];}return db[_0x9d22('0x27')][_0x9d22('0x46')]({'where':{'id':_0x11ae1d[_0x9d22('0x41')]['id']}})[_0x9d22('0x21')](handleEntityNotFound(_0x1089dd,null))[_0x9d22('0x21')](function(_0x213144){if(_0x213144){_0x11ae1d['body'][_0x9d22('0x4a')]=_0x213144['id'];_0x11ae1d[_0x9d22('0x44')]['Subjects']=integrations[_0x9d22('0x4b')](_0x11ae1d[_0x9d22('0x44')]['channel'],_0x11ae1d[_0x9d22('0x44')][_0x9d22('0x29')]);_0x11ae1d[_0x9d22('0x44')][_0x9d22('0x4c')]=integrations[_0x9d22('0x4d')](_0x11ae1d[_0x9d22('0x44')]['channel'],_0x11ae1d[_0x9d22('0x44')][_0x9d22('0x29')]);return db['FreshsalesConfiguration'][_0x9d22('0x43')](_0x11ae1d[_0x9d22('0x44')],{'include':[{'model':db['FreshsalesField'],'as':_0x9d22('0x4e')},{'model':db[_0x9d22('0x4f')],'as':_0x9d22('0x4c')}]});}return null;})[_0x9d22('0x21')](respondWithResult(_0x1089dd,null))[_0x9d22('0x3f')](handleError(_0x1089dd,null));};exports[_0x9d22('0x50')]=function(_0x1c4214,_0x4b21c2,_0x498cf6){var _0x19a1aa='';var _0x222b6e='';return db[_0x9d22('0x27')][_0x9d22('0x46')]({'where':{'id':_0x1c4214[_0x9d22('0x41')]['id']},'attributes':['id',_0x9d22('0x51'),_0x9d22('0x52'),'apiKey']})['then'](handleEntityNotFound(_0x4b21c2,null))[_0x9d22('0x21')](function(_0x53dfb6){if(_0x53dfb6){_0x222b6e=_0x53dfb6[_0x9d22('0x51')];_0x19a1aa=_0x53dfb6[_0x9d22('0x52')];var _0x4665cf=_0x53dfb6[_0x9d22('0x52')][_0x9d22('0x53')](-0x1);if(_0x4665cf==='/'){_0x19a1aa=_0x19a1aa[_0x9d22('0x54')](0x0,_0x19a1aa['lastIndexOf'](_0x4665cf));}return rp({'method':'GET','uri':util[_0x9d22('0x55')](_0x9d22('0x56'),_0x19a1aa,_0x9d22('0x57')),'headers':{'Authorization':'Token\x20token='+_0x53dfb6[_0x9d22('0x58')]},'json':!![]});}})[_0x9d22('0x21')](function(_0x222ba3){if(_0x222ba3){var _0x5d4f07=_0x222ba3[_0x9d22('0x59')];var _0x10740a=![];var _0x566279=null;for(_0x566279=0x0;_0x566279<_0x5d4f07[_0x9d22('0x33')];_0x566279++){if(_0x5d4f07[_0x566279][_0x9d22('0x5a')]===_0x222b6e){_0x10740a=!![];}}if(_0x10740a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9d22('0x5b')});}}})[_0x9d22('0x21')](respondWithResult(_0x4b21c2,null))[_0x9d22('0x3f')](function(_0x4babe6){var _0xae4d9a=_0x1c4214[_0x9d22('0x2c')][_0x9d22('0x5c')]?0x1f4:_0x4babe6['statusCode']||0x1f4;logger[_0x9d22('0x22')](_0x9d22('0x5d'),'getFields',_0xae4d9a,JSON[_0x9d22('0x5e')](_0x4babe6));delete _0x4babe6[_0x9d22('0x24')];if(_0xae4d9a===0x191){_0xae4d9a=0x190;}_0x4b21c2[_0x9d22('0x15')](_0xae4d9a)[_0x9d22('0x25')](_0x1c4214[_0x9d22('0x2c')]['test']?{'message':_0x9d22('0x5f'),'statusCode':_0x4babe6[_0x9d22('0x60')]}:_0x4babe6);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 3e17225..b145810 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 _0xba34=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x4be8fa,_0xb25e81){var _0x5dbc81=function(_0x3070a3){while(--_0x3070a3){_0x4be8fa['push'](_0x4be8fa['shift']());}};_0x5dbc81(++_0xb25e81);}(_0xba34,0x119));var _0x4ba3=function(_0x2db5e4,_0x9c526c){_0x2db5e4=_0x2db5e4-0x0;var _0x338186=_0xba34[_0x2db5e4];return _0x338186;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aad=['FreshsalesAccount','int_freshsales_accounts','lodash','util','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x3e32a8,_0x255953){var _0x2997b0=function(_0x2d564a){while(--_0x2d564a){_0x3e32a8['push'](_0x3e32a8['shift']());}};_0x2997b0(++_0x255953);}(_0x8aad,0x146));var _0xd8aa=function(_0x472b17,_0x4fc13c){_0x472b17=_0x472b17-0x0;var _0x513f52=_0x8aad[_0x472b17];return _0x513f52;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd8aa('0x6')]=function(_0x43ddeb,_0x16ea12){return _0x43ddeb['define'](_0xd8aa('0x7'),attributes,{'tableName':_0xd8aa('0x8'),'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 fa2e65f..eff0256 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 _0xa6b0=['http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','limit','include','map','then','GetFreshsalesAccount','ShowFreshsalesAccount','FreshsalesAccount','find','where','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1ae8ab,_0x6e5c2a){var _0x1ad705=function(_0x1dfa15){while(--_0x1dfa15){_0x1ae8ab['push'](_0x1ae8ab['shift']());}};_0x1ad705(++_0x6e5c2a);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x300511,_0x116001){_0x300511=_0x300511-0x0;var _0x537bfd=_0xa6b0[_0x300511];return _0x537bfd;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});}exports['GetFreshsalesAccount']=function(_0xcb412){var _0x31f347=this;return new Promise(function(_0x2cb10b,_0x1ad45d){return db['FreshsalesAccount'][_0x0a6b('0x17')]({'raw':_0xcb412[_0x0a6b('0x18')]?_0xcb412['options'][_0x0a6b('0x19')]===undefined?!![]:![]:!![],'where':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')]['where']||null:null,'attributes':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1a')]||null:null,'limit':_0xcb412['options']?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1b')]||null:null,'include':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1c')]?_['map'](_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1c')],function(_0x3d153f){return{'model':db[_0x3d153f['model']],'as':_0x3d153f['as'],'attributes':_0x3d153f[_0x0a6b('0x1a')],'include':_0x3d153f[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3d153f[_0x0a6b('0x1c')],function(_0x3b12a2){return{'model':db[_0x3b12a2['model']],'as':_0x3b12a2['as'],'attributes':_0x3b12a2[_0x0a6b('0x1a')],'include':_0x3b12a2[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3b12a2['include'],function(_0x3a9092){return{'model':db[_0x3a9092['model']],'as':_0x3a9092['as'],'attributes':_0x3a9092[_0x0a6b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0a6b('0x1e')](function(_0x45ae97){logger['info']('GetFreshsalesAccount',_0xcb412);logger[_0x0a6b('0xf')](_0x0a6b('0x1f'),_0xcb412,JSON[_0x0a6b('0x11')](_0x45ae97));_0x2cb10b(_0x45ae97);})[_0x0a6b('0x16')](function(_0x1935a3){logger[_0x0a6b('0x12')]('GetFreshsalesAccount',_0x1935a3[_0x0a6b('0x14')],_0xcb412);_0x1ad45d(_0x31f347[_0x0a6b('0x12')](0x1f4,_0x1935a3['message']));});});};exports[_0x0a6b('0x20')]=function(_0x554145){var _0x4eb516=this;return new Promise(function(_0xbf2f1a,_0x24e96a){return db[_0x0a6b('0x21')][_0x0a6b('0x22')]({'raw':_0x554145[_0x0a6b('0x18')]?_0x554145['options']['raw']===undefined?!![]:![]:!![],'where':_0x554145[_0x0a6b('0x18')]?_0x554145[_0x0a6b('0x18')][_0x0a6b('0x23')]||null:null,'attributes':_0x554145[_0x0a6b('0x18')]?_0x554145['options'][_0x0a6b('0x1a')]||null:null,'include':_0x554145[_0x0a6b('0x18')]?_0x554145['options']['include']?_[_0x0a6b('0x1d')](_0x554145[_0x0a6b('0x18')]['include'],function(_0x3c3c23){return{'model':db[_0x3c3c23[_0x0a6b('0x24')]],'as':_0x3c3c23['as'],'attributes':_0x3c3c23[_0x0a6b('0x1a')],'include':_0x3c3c23[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3c3c23[_0x0a6b('0x1c')],function(_0x1f6f82){return{'model':db[_0x1f6f82[_0x0a6b('0x24')]],'as':_0x1f6f82['as'],'attributes':_0x1f6f82[_0x0a6b('0x1a')],'include':_0x1f6f82[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x1f6f82[_0x0a6b('0x1c')],function(_0x49fa53){return{'model':db[_0x49fa53[_0x0a6b('0x24')]],'as':_0x49fa53['as'],'attributes':_0x49fa53[_0x0a6b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x390d62){logger[_0x0a6b('0xc')](_0x0a6b('0x20'),_0x554145);logger[_0x0a6b('0xf')](_0x0a6b('0x20'),_0x554145,JSON[_0x0a6b('0x11')](_0x390d62));_0xbf2f1a(_0x390d62);})[_0x0a6b('0x16')](function(_0x3f1be6){logger[_0x0a6b('0x12')]('ShowFreshsalesAccount',_0x3f1be6[_0x0a6b('0x14')],_0x554145);_0x24e96a(_0x4eb516[_0x0a6b('0x12')](0x1f4,_0x3f1be6[_0x0a6b('0x14')]));});});}; \ No newline at end of file +var _0x0424=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x567567,_0x49559b){var _0x32751d=function(_0x5cfaef){while(--_0x5cfaef){_0x567567['push'](_0x567567['shift']());}};_0x32751d(++_0x49559b);}(_0x0424,0x159));var _0x4042=function(_0x458f49,_0x1a1af1){_0x458f49=_0x458f49-0x0;var _0x36e8c9=_0x0424[_0x458f49];return _0x36e8c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['findAll']({'raw':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x466077[_0x4042('0x17')]?_0x466077['options'][_0x4042('0x19')]||null:null,'attributes':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1a')]||null:null,'limit':_0x466077['options']?_0x466077[_0x4042('0x17')][_0x4042('0x1b')]||null:null,'include':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1c')]?_['map'](_0x466077[_0x4042('0x17')][_0x4042('0x1c')],function(_0x519f2c){return{'model':db[_0x519f2c[_0x4042('0x1d')]],'as':_0x519f2c['as'],'attributes':_0x519f2c['attributes'],'include':_0x519f2c[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x519f2c[_0x4042('0x1c')],function(_0x5d5c6d){return{'model':db[_0x5d5c6d[_0x4042('0x1d')]],'as':_0x5d5c6d['as'],'attributes':_0x5d5c6d[_0x4042('0x1a')],'include':_0x5d5c6d[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x5d5c6d[_0x4042('0x1c')],function(_0x52e575){return{'model':db[_0x52e575['model']],'as':_0x52e575['as'],'attributes':_0x52e575[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26542c){logger[_0x4042('0x12')](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('GetFreshsalesAccount',_0x466077,JSON[_0x4042('0xf')](_0x26542c));_0xe5c1ec(_0x26542c);})[_0x4042('0x14')](function(_0x4a6a6e){logger[_0x4042('0x10')](_0x4042('0x15'),_0x4a6a6e[_0x4042('0x11')],_0x466077);_0x4fe024(_0x4b02d4['error'](0x1f4,_0x4a6a6e['message']));});});};exports[_0x4042('0x1f')]=function(_0x43bd1c){var _0x59773f=this;return new Promise(function(_0x3e9304,_0xc42d70){return db[_0x4042('0x16')][_0x4042('0x20')]({'raw':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['where']||null:null,'attributes':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['attributes']||null:null,'include':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['include']?_[_0x4042('0x1e')](_0x43bd1c[_0x4042('0x17')][_0x4042('0x1c')],function(_0xaa7c99){return{'model':db[_0xaa7c99[_0x4042('0x1d')]],'as':_0xaa7c99['as'],'attributes':_0xaa7c99[_0x4042('0x1a')],'include':_0xaa7c99[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0xaa7c99[_0x4042('0x1c')],function(_0x37195b){return{'model':db[_0x37195b[_0x4042('0x1d')]],'as':_0x37195b['as'],'attributes':_0x37195b[_0x4042('0x1a')],'include':_0x37195b[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x37195b[_0x4042('0x1c')],function(_0x2b5f5e){return{'model':db[_0x2b5f5e[_0x4042('0x1d')]],'as':_0x2b5f5e['as'],'attributes':_0x2b5f5e[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26b7b0){logger[_0x4042('0x12')]('ShowFreshsalesAccount',_0x43bd1c);logger[_0x4042('0xd')](_0x4042('0x1f'),_0x43bd1c,JSON[_0x4042('0xf')](_0x26b7b0));_0x3e9304(_0x26b7b0);})[_0x4042('0x14')](function(_0x588932){logger[_0x4042('0x10')](_0x4042('0x1f'),_0x588932[_0x4042('0x11')],_0x43bd1c);_0xc42d70(_0x59773f[_0x4042('0x10')](0x1f4,_0x588932[_0x4042('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d6f069a..4f2f094 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 _0xb19c=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','update','delete','destroy','exports','multer'];(function(_0x4f3b0d,_0x38531a){var _0x2c698d=function(_0x35bd4b){while(--_0x35bd4b){_0x4f3b0d['push'](_0x4f3b0d['shift']());}};_0x2c698d(++_0x38531a);}(_0xb19c,0xa7));var _0xcb19=function(_0x5f1366,_0x41f223){_0x5f1366=_0x5f1366-0x0;var _0x5b44b9=_0xb19c[_0x5f1366];return _0x5b44b9;};'use strict';var multer=require(_0xcb19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb19('0x1'));var express=require(_0xcb19('0x2'));var router=express[_0xcb19('0x3')]();var fs_extra=require(_0xcb19('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb19('0x5'));var config=require(_0xcb19('0x6'));var controller=require(_0xcb19('0x7'));router[_0xcb19('0x8')]('/',auth[_0xcb19('0x9')](),controller[_0xcb19('0xa')]);router['get'](_0xcb19('0xb'),auth['isAuthenticated'](),controller[_0xcb19('0xc')]);router[_0xcb19('0x8')](_0xcb19('0xd'),auth[_0xcb19('0x9')](),controller[_0xcb19('0xe')]);router[_0xcb19('0x8')](_0xcb19('0xf'),auth[_0xcb19('0x9')](),controller[_0xcb19('0x10')]);router[_0xcb19('0x8')](_0xcb19('0x11'),auth[_0xcb19('0x9')](),controller[_0xcb19('0x12')]);router[_0xcb19('0x13')]('/',auth[_0xcb19('0x9')](),controller['create']);router['put'](_0xcb19('0xb'),auth[_0xcb19('0x9')](),controller[_0xcb19('0x14')]);router[_0xcb19('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xcb19('0x16')]);module[_0xcb19('0x17')]=router; \ No newline at end of file +var _0x1fc1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','exports','multer','util'];(function(_0x1e48d4,_0x4a8aa5){var _0x52cfbc=function(_0x347c48){while(--_0x347c48){_0x1e48d4['push'](_0x1e48d4['shift']());}};_0x52cfbc(++_0x4a8aa5);}(_0x1fc1,0x184));var _0x11fc=function(_0xc4dbc9,_0x1aa6b6){_0xc4dbc9=_0xc4dbc9-0x0;var _0x531773=_0x1fc1[_0xc4dbc9];return _0x531773;};'use strict';var multer=require(_0x11fc('0x0'));var util=require(_0x11fc('0x1'));var path=require('path');var timeout=require(_0x11fc('0x2'));var express=require(_0x11fc('0x3'));var router=express[_0x11fc('0x4')]();var fs_extra=require(_0x11fc('0x5'));var auth=require(_0x11fc('0x6'));var interaction=require(_0x11fc('0x7'));var config=require(_0x11fc('0x8'));var controller=require(_0x11fc('0x9'));router[_0x11fc('0xa')]('/',auth[_0x11fc('0xb')](),controller[_0x11fc('0xc')]);router[_0x11fc('0xa')](_0x11fc('0xd'),auth[_0x11fc('0xb')](),controller[_0x11fc('0xe')]);router[_0x11fc('0xa')](_0x11fc('0xf'),auth[_0x11fc('0xb')](),controller[_0x11fc('0x10')]);router[_0x11fc('0xa')]('/:id/descriptions',auth[_0x11fc('0xb')](),controller[_0x11fc('0x11')]);router[_0x11fc('0xa')](_0x11fc('0x12'),auth[_0x11fc('0xb')](),controller[_0x11fc('0x13')]);router[_0x11fc('0x14')]('/',auth[_0x11fc('0xb')](),controller[_0x11fc('0x15')]);router[_0x11fc('0x16')](_0x11fc('0xd'),auth[_0x11fc('0xb')](),controller[_0x11fc('0x17')]);router[_0x11fc('0x18')](_0x11fc('0xd'),auth[_0x11fc('0xb')](),controller['destroy']);module[_0x11fc('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 281e53c..1ed3525 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 _0x502c=['STRING','sequelize'];(function(_0x11d851,_0x43c284){var _0xb51877=function(_0x428ad8){while(--_0x428ad8){_0x11d851['push'](_0x11d851['shift']());}};_0xb51877(++_0x43c284);}(_0x502c,0x71));var _0xc502=function(_0xd9d6f6,_0x50cf44){_0xd9d6f6=_0xd9d6f6-0x0;var _0x1df4dc=_0x502c[_0xd9d6f6];return _0x1df4dc;};'use strict';var Sequelize=require(_0xc502('0x0'));module['exports']={'name':{'type':Sequelize[_0xc502('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x49d2=['exports','STRING','sequelize'];(function(_0x946942,_0x2754be){var _0x2bcc37=function(_0x5b0703){while(--_0x5b0703){_0x946942['push'](_0x946942['shift']());}};_0x2bcc37(++_0x2754be);}(_0x49d2,0x74));var _0x249d=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x49d2[_0x119d25];return _0x39cf30;};'use strict';var Sequelize=require(_0x249d('0x0'));module[_0x249d('0x1')]={'name':{'type':Sequelize[_0x249d('0x2')]},'description':{'type':Sequelize[_0x249d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index e9bc970..4445b04 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 _0x980d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','end','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','create','find','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv'];(function(_0x4a5d53,_0x49c54c){var _0x528677=function(_0x350360){while(--_0x350360){_0x4a5d53['push'](_0x4a5d53['shift']());}};_0x528677(++_0x49c54c);}(_0x980d,0x184));var _0xd980=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x980d[_0x3e3bee];return _0x3ae14c;};'use strict';var emlformat=require(_0xd980('0x0'));var rimraf=require(_0xd980('0x1'));var zipdir=require(_0xd980('0x2'));var jsonpatch=require(_0xd980('0x3'));var rp=require(_0xd980('0x4'));var moment=require(_0xd980('0x5'));var BPromise=require(_0xd980('0x6'));var Mustache=require(_0xd980('0x7'));var util=require(_0xd980('0x8'));var path=require(_0xd980('0x9'));var sox=require(_0xd980('0xa'));var csv=require('to-csv');var ejs=require(_0xd980('0xb'));var fs=require('fs');var fs_extra=require(_0xd980('0xc'));var _=require(_0xd980('0xd'));var squel=require('squel');var crypto=require(_0xd980('0xe'));var jsforce=require(_0xd980('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd980('0x10'));var querystring=require('querystring');var Papa=require(_0xd980('0x11'));var Redis=require(_0xd980('0x12'));var authService=require(_0xd980('0x13'));var qs=require(_0xd980('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd980('0x15'));var logger=require(_0xd980('0x16'))(_0xd980('0x17'));var utils=require('../../config/utils');var config=require(_0xd980('0x18'));var licenseUtil=require(_0xd980('0x19'));var db=require(_0xd980('0x1a'))['db'];function respondWithStatusCode(_0x4b4288,_0x139675){_0x139675=_0x139675||0xcc;return function(_0x2f6ad2){if(_0x2f6ad2){return _0x4b4288[_0xd980('0x1b')](_0x139675);}return _0x4b4288[_0xd980('0x1c')](_0x139675)['end']();};}function respondWithResult(_0x138e00,_0x1e64e9){_0x1e64e9=_0x1e64e9||0xc8;return function(_0x19d19d){if(_0x19d19d){return _0x138e00['status'](_0x1e64e9)[_0xd980('0x1d')](_0x19d19d);}};}function respondWithFilteredResult(_0x5b1125,_0x485428){return function(_0x523c9b){if(_0x523c9b){var _0x38f9bb=typeof _0x485428['offset']===_0xd980('0x1e')&&typeof _0x485428[_0xd980('0x1f')]===_0xd980('0x1e');var _0x19c136=_0x523c9b[_0xd980('0x20')];var _0x367261=_0x38f9bb?0x0:_0x485428[_0xd980('0x21')];var _0x18f4cd=_0x38f9bb?_0x523c9b['count']:_0x485428['offset']+_0x485428[_0xd980('0x1f')];var _0x24b1ba;if(_0x18f4cd>=_0x19c136){_0x18f4cd=_0x19c136;_0x24b1ba=0xc8;}else{_0x24b1ba=0xce;}_0x5b1125['status'](_0x24b1ba);return _0x5b1125[_0xd980('0x22')]('Content-Range',_0x367261+'-'+_0x18f4cd+'/'+_0x19c136)['json'](_0x523c9b);}return null;};}function patchUpdates(_0x141040){return function(_0x118a5f){try{jsonpatch[_0xd980('0x23')](_0x118a5f,_0x141040,!![]);}catch(_0x347258){return BPromise['reject'](_0x347258);}return _0x118a5f[_0xd980('0x24')]();};}function saveUpdates(_0x5226ca,_0x3fd611){return function(_0x5d8641){if(_0x5d8641){return _0x5d8641[_0xd980('0x25')](_0x5226ca)[_0xd980('0x26')](function(_0x395abc){return _0x395abc;});}return null;};}function removeEntity(_0x18af46,_0x4d01c6){return function(_0x2c48a7){if(_0x2c48a7){return _0x2c48a7[_0xd980('0x27')]()[_0xd980('0x26')](function(){_0x18af46['status'](0xcc)[_0xd980('0x28')]();});}};}function handleEntityNotFound(_0x5e8c18,_0x4d4e66){return function(_0x4bcb71){if(!_0x4bcb71){_0x5e8c18[_0xd980('0x1b')](0x194);}return _0x4bcb71;};}function handleError(_0x5b92d2,_0x1c82d5){_0x1c82d5=_0x1c82d5||0x1f4;return function(_0xf92c17){logger['error'](_0xf92c17['stack']);if(_0xf92c17[_0xd980('0x29')]){delete _0xf92c17[_0xd980('0x29')];}_0x5b92d2['status'](_0x1c82d5)[_0xd980('0x2a')](_0xf92c17);};}exports[_0xd980('0x2b')]=function(_0x3842d0,_0x54c3ce){var _0x36534e={},_0x842362={},_0xf270e4={'count':0x0,'rows':[]};var _0x1f46d6=_[_0xd980('0x2c')](db[_0xd980('0x2d')][_0xd980('0x2e')],function(_0x2522c3){return{'name':_0x2522c3[_0xd980('0x2f')],'type':_0x2522c3[_0xd980('0x30')][_0xd980('0x31')]};});_0x842362[_0xd980('0x32')]=_[_0xd980('0x2c')](_0x1f46d6,_0xd980('0x29'));_0x842362[_0xd980('0x33')]=_[_0xd980('0x34')](_0x3842d0[_0xd980('0x33')]);_0x842362[_0xd980('0x35')]=_[_0xd980('0x36')](_0x842362['model'],_0x842362[_0xd980('0x33')]);_0x36534e[_0xd980('0x37')]=_['intersection'](_0x842362[_0xd980('0x32')],qs[_0xd980('0x38')](_0x3842d0[_0xd980('0x33')][_0xd980('0x38')]));_0x36534e[_0xd980('0x37')]=_0x36534e[_0xd980('0x37')][_0xd980('0x39')]?_0x36534e[_0xd980('0x37')]:_0x842362[_0xd980('0x32')];if(!_0x3842d0[_0xd980('0x33')]['hasOwnProperty'](_0xd980('0x3a'))){_0x36534e[_0xd980('0x1f')]=qs[_0xd980('0x1f')](_0x3842d0[_0xd980('0x33')][_0xd980('0x1f')]);_0x36534e[_0xd980('0x21')]=qs[_0xd980('0x21')](_0x3842d0[_0xd980('0x33')]['offset']);}_0x36534e[_0xd980('0x3b')]=qs['sort'](_0x3842d0[_0xd980('0x33')][_0xd980('0x3c')]);_0x36534e[_0xd980('0x3d')]=qs[_0xd980('0x35')](_[_0xd980('0x3e')](_0x3842d0['query'],_0x842362[_0xd980('0x35')]),_0x1f46d6);if(_0x3842d0['query'][_0xd980('0x3f')]){_0x36534e['where']=_[_0xd980('0x40')](_0x36534e['where'],{'$or':_[_0xd980('0x2c')](_0x1f46d6,function(_0x29c4c1){if(_0x29c4c1[_0xd980('0x30')]!=='VIRTUAL'){var _0x144b83={};_0x144b83[_0x29c4c1['name']]={'$like':'%'+_0x3842d0[_0xd980('0x33')][_0xd980('0x3f')]+'%'};return _0x144b83;}})});}_0x36534e=_[_0xd980('0x40')]({},_0x36534e,_0x3842d0[_0xd980('0x41')]);var _0x34d7f0={'where':_0x36534e[_0xd980('0x3d')]};return db[_0xd980('0x2d')]['count'](_0x34d7f0)[_0xd980('0x26')](function(_0x3fa5c1){_0xf270e4[_0xd980('0x20')]=_0x3fa5c1;if(_0x3842d0[_0xd980('0x33')][_0xd980('0x42')]){_0x36534e[_0xd980('0x43')]=[{'all':!![]}];}return db[_0xd980('0x2d')][_0xd980('0x44')](_0x36534e);})['then'](function(_0x45ef56){_0xf270e4['rows']=_0x45ef56;return _0xf270e4;})[_0xd980('0x26')](respondWithFilteredResult(_0x54c3ce,_0x36534e))[_0xd980('0x45')](handleError(_0x54c3ce,null));};exports[_0xd980('0x46')]=function(_0x5ebe3a,_0xf0e59d){var _0x2ff98a={'raw':![],'where':{'id':_0x5ebe3a[_0xd980('0x47')]['id']}},_0xd7a5c3={};_0xd7a5c3[_0xd980('0x32')]=_[_0xd980('0x34')](db[_0xd980('0x2d')][_0xd980('0x2e')]);_0xd7a5c3[_0xd980('0x33')]=_['keys'](_0x5ebe3a[_0xd980('0x33')]);_0xd7a5c3[_0xd980('0x35')]=_[_0xd980('0x36')](_0xd7a5c3[_0xd980('0x32')],_0xd7a5c3[_0xd980('0x33')]);_0x2ff98a[_0xd980('0x37')]=_['intersection'](_0xd7a5c3[_0xd980('0x32')],qs[_0xd980('0x38')](_0x5ebe3a['query'][_0xd980('0x38')]));_0x2ff98a['attributes']=_0x2ff98a[_0xd980('0x37')][_0xd980('0x39')]?_0x2ff98a['attributes']:_0xd7a5c3[_0xd980('0x32')];if(_0x5ebe3a['query'][_0xd980('0x42')]){_0x2ff98a[_0xd980('0x43')]=[{'all':!![]}];}_0x2ff98a=_['merge']({},_0x2ff98a,_0x5ebe3a[_0xd980('0x41')]);return db[_0xd980('0x2d')]['find'](_0x2ff98a)[_0xd980('0x26')](handleEntityNotFound(_0xf0e59d,null))['then'](respondWithResult(_0xf0e59d,null))[_0xd980('0x45')](handleError(_0xf0e59d,null));};exports[_0xd980('0x48')]=function(_0x468b67,_0x415d45){return db[_0xd980('0x2d')][_0xd980('0x48')](_0x468b67['body'],{})['then'](respondWithResult(_0x415d45,0xc9))[_0xd980('0x45')](handleError(_0x415d45,null));};exports['update']=function(_0x54c78f,_0x24067d){if(_0x54c78f['body']['id']){delete _0x54c78f['body']['id'];}return db['FreshsalesConfiguration'][_0xd980('0x49')]({'where':{'id':_0x54c78f['params']['id']}})[_0xd980('0x26')](handleEntityNotFound(_0x24067d,null))['then'](saveUpdates(_0x54c78f[_0xd980('0x4a')],null))[_0xd980('0x26')](respondWithResult(_0x24067d,null))[_0xd980('0x45')](handleError(_0x24067d,null));};exports[_0xd980('0x27')]=function(_0x311c4b,_0x29e81a){return db[_0xd980('0x2d')][_0xd980('0x49')]({'where':{'id':_0x311c4b[_0xd980('0x47')]['id']}})[_0xd980('0x26')](handleEntityNotFound(_0x29e81a,null))['then'](removeEntity(_0x29e81a,null))[_0xd980('0x45')](handleError(_0x29e81a,null));};exports[_0xd980('0x4b')]=function(_0x55b4ad,_0x4558a7,_0x1c0ee1){var _0x925585={};var _0x57c031={};var _0x39682f;var _0x290d15;return db[_0xd980('0x2d')][_0xd980('0x4c')]({'where':{'id':_0x55b4ad['params']['id']}})[_0xd980('0x26')](handleEntityNotFound(_0x4558a7,null))[_0xd980('0x26')](function(_0x5209fe){if(_0x5209fe){_0x39682f=_0x5209fe;_0x57c031[_0xd980('0x32')]=_[_0xd980('0x34')](db[_0xd980('0x4d')][_0xd980('0x2e')]);_0x57c031[_0xd980('0x33')]=_[_0xd980('0x34')](_0x55b4ad['query']);_0x57c031['filters']=_[_0xd980('0x36')](_0x57c031[_0xd980('0x32')],_0x57c031[_0xd980('0x33')]);_0x925585[_0xd980('0x37')]=_[_0xd980('0x36')](_0x57c031['model'],qs[_0xd980('0x38')](_0x55b4ad['query'][_0xd980('0x38')]));_0x925585[_0xd980('0x37')]=_0x925585[_0xd980('0x37')][_0xd980('0x39')]?_0x925585['attributes']:_0x57c031['model'];_0x925585[_0xd980('0x3b')]=qs[_0xd980('0x3c')](_0x55b4ad[_0xd980('0x33')][_0xd980('0x3c')]);_0x925585['where']=qs['filters'](_['pick'](_0x55b4ad['query'],_0x57c031[_0xd980('0x35')]));if(_0x55b4ad[_0xd980('0x33')][_0xd980('0x3f')]){_0x925585[_0xd980('0x3d')]=_[_0xd980('0x40')](_0x925585[_0xd980('0x3d')],{'$or':_[_0xd980('0x2c')](_0x925585[_0xd980('0x37')],function(_0x33861a){var _0x5e92af={};_0x5e92af[_0x33861a]={'$like':'%'+_0x55b4ad[_0xd980('0x33')][_0xd980('0x3f')]+'%'};return _0x5e92af;})});}_0x925585=_[_0xd980('0x40')]({},_0x925585,_0x55b4ad[_0xd980('0x41')]);return _0x39682f['getSubjects'](_0x925585);}})['then'](function(_0x4db497){if(_0x4db497){_0x290d15=_0x4db497[_0xd980('0x39')];if(!_0x55b4ad[_0xd980('0x33')][_0xd980('0x4e')](_0xd980('0x3a'))){_0x925585[_0xd980('0x1f')]=qs[_0xd980('0x1f')](_0x55b4ad[_0xd980('0x33')]['limit']);_0x925585[_0xd980('0x21')]=qs[_0xd980('0x21')](_0x55b4ad['query']['offset']);}return _0x39682f[_0xd980('0x4b')](_0x925585);}})[_0xd980('0x26')](function(_0x3782e3){if(_0x3782e3){return _0x3782e3?{'count':_0x290d15,'rows':_0x3782e3}:null;}})['then'](respondWithResult(_0x4558a7,null))[_0xd980('0x45')](handleError(_0x4558a7,null));};exports[_0xd980('0x4f')]=function(_0x2944de,_0x36727b,_0x686400){var _0x507c7d={};var _0x6d6161={};var _0x920dd3;var _0x3f59e1;return db[_0xd980('0x2d')][_0xd980('0x4c')]({'where':{'id':_0x2944de[_0xd980('0x47')]['id']}})[_0xd980('0x26')](handleEntityNotFound(_0x36727b,null))['then'](function(_0x17b792){if(_0x17b792){_0x920dd3=_0x17b792;_0x6d6161[_0xd980('0x32')]=_[_0xd980('0x34')](db[_0xd980('0x4d')]['rawAttributes']);_0x6d6161[_0xd980('0x33')]=_['keys'](_0x2944de[_0xd980('0x33')]);_0x6d6161[_0xd980('0x35')]=_[_0xd980('0x36')](_0x6d6161[_0xd980('0x32')],_0x6d6161[_0xd980('0x33')]);_0x507c7d[_0xd980('0x37')]=_['intersection'](_0x6d6161[_0xd980('0x32')],qs[_0xd980('0x38')](_0x2944de[_0xd980('0x33')][_0xd980('0x38')]));_0x507c7d[_0xd980('0x37')]=_0x507c7d[_0xd980('0x37')][_0xd980('0x39')]?_0x507c7d[_0xd980('0x37')]:_0x6d6161[_0xd980('0x32')];_0x507c7d[_0xd980('0x3b')]=qs[_0xd980('0x3c')](_0x2944de['query'][_0xd980('0x3c')]);_0x507c7d[_0xd980('0x3d')]=qs[_0xd980('0x35')](_[_0xd980('0x3e')](_0x2944de[_0xd980('0x33')],_0x6d6161[_0xd980('0x35')]));if(_0x2944de[_0xd980('0x33')][_0xd980('0x3f')]){_0x507c7d[_0xd980('0x3d')]=_[_0xd980('0x40')](_0x507c7d['where'],{'$or':_['map'](_0x507c7d[_0xd980('0x37')],function(_0x46c569){var _0x4c3f6a={};_0x4c3f6a[_0x46c569]={'$like':'%'+_0x2944de['query']['filter']+'%'};return _0x4c3f6a;})});}_0x507c7d=_[_0xd980('0x40')]({},_0x507c7d,_0x2944de[_0xd980('0x41')]);return _0x920dd3[_0xd980('0x4f')](_0x507c7d);}})[_0xd980('0x26')](function(_0x58d246){if(_0x58d246){_0x3f59e1=_0x58d246[_0xd980('0x39')];if(!_0x2944de[_0xd980('0x33')]['hasOwnProperty'](_0xd980('0x3a'))){_0x507c7d[_0xd980('0x1f')]=qs['limit'](_0x2944de[_0xd980('0x33')]['limit']);_0x507c7d['offset']=qs[_0xd980('0x21')](_0x2944de['query'][_0xd980('0x21')]);}return _0x920dd3[_0xd980('0x4f')](_0x507c7d);}})[_0xd980('0x26')](function(_0x5e15b6){if(_0x5e15b6){return _0x5e15b6?{'count':_0x3f59e1,'rows':_0x5e15b6}:null;}})[_0xd980('0x26')](respondWithResult(_0x36727b,null))['catch'](handleError(_0x36727b,null));};exports[_0xd980('0x50')]=function(_0x3fcfb5,_0x2cbb65,_0x42dbff){var _0x275afc={};var _0x28c380={};var _0x1435c8;var _0x4549a1;return db[_0xd980('0x2d')]['findOne']({'where':{'id':_0x3fcfb5['params']['id']}})[_0xd980('0x26')](handleEntityNotFound(_0x2cbb65,null))[_0xd980('0x26')](function(_0xf63acf){if(_0xf63acf){_0x1435c8=_0xf63acf;_0x28c380[_0xd980('0x32')]=_[_0xd980('0x34')](db['FreshsalesField'][_0xd980('0x2e')]);_0x28c380[_0xd980('0x33')]=_['keys'](_0x3fcfb5[_0xd980('0x33')]);_0x28c380['filters']=_[_0xd980('0x36')](_0x28c380['model'],_0x28c380['query']);_0x275afc[_0xd980('0x37')]=_[_0xd980('0x36')](_0x28c380['model'],qs[_0xd980('0x38')](_0x3fcfb5[_0xd980('0x33')][_0xd980('0x38')]));_0x275afc[_0xd980('0x37')]=_0x275afc[_0xd980('0x37')][_0xd980('0x39')]?_0x275afc[_0xd980('0x37')]:_0x28c380[_0xd980('0x32')];_0x275afc[_0xd980('0x3b')]=qs[_0xd980('0x3c')](_0x3fcfb5['query'][_0xd980('0x3c')]);_0x275afc[_0xd980('0x3d')]=qs[_0xd980('0x35')](_[_0xd980('0x3e')](_0x3fcfb5[_0xd980('0x33')],_0x28c380[_0xd980('0x35')]));if(_0x3fcfb5['query']['filter']){_0x275afc[_0xd980('0x3d')]=_[_0xd980('0x40')](_0x275afc[_0xd980('0x3d')],{'$or':_['map'](_0x275afc['attributes'],function(_0x4ca966){var _0x118824={};_0x118824[_0x4ca966]={'$like':'%'+_0x3fcfb5[_0xd980('0x33')][_0xd980('0x3f')]+'%'};return _0x118824;})});}_0x275afc=_[_0xd980('0x40')]({},_0x275afc,_0x3fcfb5[_0xd980('0x41')]);return _0x1435c8[_0xd980('0x50')](_0x275afc);}})[_0xd980('0x26')](function(_0x25b595){if(_0x25b595){_0x4549a1=_0x25b595['length'];if(!_0x3fcfb5['query'][_0xd980('0x4e')]('nolimit')){_0x275afc[_0xd980('0x1f')]=qs[_0xd980('0x1f')](_0x3fcfb5[_0xd980('0x33')][_0xd980('0x1f')]);_0x275afc[_0xd980('0x21')]=qs[_0xd980('0x21')](_0x3fcfb5['query'][_0xd980('0x21')]);}return _0x1435c8['getFields'](_0x275afc);}})[_0xd980('0x26')](function(_0x32f758){if(_0x32f758){return _0x32f758?{'count':_0x4549a1,'rows':_0x32f758}:null;}})[_0xd980('0x26')](respondWithResult(_0x2cbb65,null))[_0xd980('0x45')](handleError(_0x2cbb65,null));}; \ No newline at end of file +var _0xee1b=['papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','create','body','find','getSubjects','findOne','FreshsalesField','sort','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x13b442,_0x448c33){var _0x49d09c=function(_0x477277){while(--_0x477277){_0x13b442['push'](_0x13b442['shift']());}};_0x49d09c(++_0x448c33);}(_0xee1b,0x129));var _0xbee1=function(_0x368efe,_0x17b321){_0x368efe=_0x368efe-0x0;var _0x366661=_0xee1b[_0x368efe];return _0x366661;};'use strict';var emlformat=require(_0xbee1('0x0'));var rimraf=require(_0xbee1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbee1('0x2'));var rp=require(_0xbee1('0x3'));var moment=require(_0xbee1('0x4'));var BPromise=require(_0xbee1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbee1('0x6'));var sox=require(_0xbee1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbee1('0x8'));var _=require(_0xbee1('0x9'));var squel=require(_0xbee1('0xa'));var crypto=require(_0xbee1('0xb'));var jsforce=require(_0xbee1('0xc'));var deskjs=require(_0xbee1('0xd'));var toCsv=require(_0xbee1('0xe'));var querystring=require('querystring');var Papa=require(_0xbee1('0xf'));var Redis=require(_0xbee1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbee1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbee1('0x12'))('api');var utils=require(_0xbee1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbee1('0x14'));var db=require(_0xbee1('0x15'))['db'];function respondWithStatusCode(_0x6e84bd,_0x19571c){_0x19571c=_0x19571c||0xcc;return function(_0x1b51e0){if(_0x1b51e0){return _0x6e84bd['sendStatus'](_0x19571c);}return _0x6e84bd[_0xbee1('0x16')](_0x19571c)[_0xbee1('0x17')]();};}function respondWithResult(_0x132467,_0x5543af){_0x5543af=_0x5543af||0xc8;return function(_0x528809){if(_0x528809){return _0x132467[_0xbee1('0x16')](_0x5543af)['json'](_0x528809);}};}function respondWithFilteredResult(_0x2ef406,_0x15569e){return function(_0x4179d7){if(_0x4179d7){var _0x1a4753=typeof _0x15569e[_0xbee1('0x18')]==='undefined'&&typeof _0x15569e[_0xbee1('0x19')]===_0xbee1('0x1a');var _0x17528d=_0x4179d7['count'];var _0x16a143=_0x1a4753?0x0:_0x15569e[_0xbee1('0x18')];var _0x55cfb4=_0x1a4753?_0x4179d7[_0xbee1('0x1b')]:_0x15569e[_0xbee1('0x18')]+_0x15569e[_0xbee1('0x19')];var _0xd7bd29;if(_0x55cfb4>=_0x17528d){_0x55cfb4=_0x17528d;_0xd7bd29=0xc8;}else{_0xd7bd29=0xce;}_0x2ef406[_0xbee1('0x16')](_0xd7bd29);return _0x2ef406[_0xbee1('0x1c')]('Content-Range',_0x16a143+'-'+_0x55cfb4+'/'+_0x17528d)[_0xbee1('0x1d')](_0x4179d7);}return null;};}function patchUpdates(_0x575f91){return function(_0x1ef51a){try{jsonpatch[_0xbee1('0x1e')](_0x1ef51a,_0x575f91,!![]);}catch(_0x43da8c){return BPromise[_0xbee1('0x1f')](_0x43da8c);}return _0x1ef51a[_0xbee1('0x20')]();};}function saveUpdates(_0x4ac918,_0xa3db4e){return function(_0x1c372c){if(_0x1c372c){return _0x1c372c[_0xbee1('0x21')](_0x4ac918)['then'](function(_0x5e6dee){return _0x5e6dee;});}return null;};}function removeEntity(_0x3bb53d,_0x575b42){return function(_0x5a27eb){if(_0x5a27eb){return _0x5a27eb[_0xbee1('0x22')]()[_0xbee1('0x23')](function(){_0x3bb53d['status'](0xcc)[_0xbee1('0x17')]();});}};}function handleEntityNotFound(_0x29035e,_0x275c3b){return function(_0x122fa4){if(!_0x122fa4){_0x29035e['sendStatus'](0x194);}return _0x122fa4;};}function handleError(_0x1ada09,_0x42014b){_0x42014b=_0x42014b||0x1f4;return function(_0x45986a){logger[_0xbee1('0x24')](_0x45986a[_0xbee1('0x25')]);if(_0x45986a['name']){delete _0x45986a[_0xbee1('0x26')];}_0x1ada09[_0xbee1('0x16')](_0x42014b)[_0xbee1('0x27')](_0x45986a);};}exports['index']=function(_0x2360a1,_0x126afb){var _0x573b8f={},_0x50a1cc={},_0x56eb2b={'count':0x0,'rows':[]};var _0x11206e=_[_0xbee1('0x28')](db['FreshsalesConfiguration'][_0xbee1('0x29')],function(_0x18f961){return{'name':_0x18f961['fieldName'],'type':_0x18f961[_0xbee1('0x2a')][_0xbee1('0x2b')]};});_0x50a1cc[_0xbee1('0x2c')]=_[_0xbee1('0x28')](_0x11206e,_0xbee1('0x26'));_0x50a1cc['query']=_[_0xbee1('0x2d')](_0x2360a1['query']);_0x50a1cc[_0xbee1('0x2e')]=_[_0xbee1('0x2f')](_0x50a1cc['model'],_0x50a1cc[_0xbee1('0x30')]);_0x573b8f[_0xbee1('0x31')]=_[_0xbee1('0x2f')](_0x50a1cc[_0xbee1('0x2c')],qs[_0xbee1('0x32')](_0x2360a1[_0xbee1('0x30')][_0xbee1('0x32')]));_0x573b8f[_0xbee1('0x31')]=_0x573b8f[_0xbee1('0x31')][_0xbee1('0x33')]?_0x573b8f[_0xbee1('0x31')]:_0x50a1cc[_0xbee1('0x2c')];if(!_0x2360a1[_0xbee1('0x30')]['hasOwnProperty'](_0xbee1('0x34'))){_0x573b8f[_0xbee1('0x19')]=qs[_0xbee1('0x19')](_0x2360a1[_0xbee1('0x30')][_0xbee1('0x19')]);_0x573b8f['offset']=qs['offset'](_0x2360a1[_0xbee1('0x30')]['offset']);}_0x573b8f[_0xbee1('0x35')]=qs['sort'](_0x2360a1[_0xbee1('0x30')]['sort']);_0x573b8f[_0xbee1('0x36')]=qs[_0xbee1('0x2e')](_[_0xbee1('0x37')](_0x2360a1[_0xbee1('0x30')],_0x50a1cc[_0xbee1('0x2e')]),_0x11206e);if(_0x2360a1[_0xbee1('0x30')][_0xbee1('0x38')]){_0x573b8f[_0xbee1('0x36')]=_[_0xbee1('0x39')](_0x573b8f[_0xbee1('0x36')],{'$or':_[_0xbee1('0x28')](_0x11206e,function(_0x141734){if(_0x141734['type']!==_0xbee1('0x3a')){var _0x4fe541={};_0x4fe541[_0x141734[_0xbee1('0x26')]]={'$like':'%'+_0x2360a1[_0xbee1('0x30')][_0xbee1('0x38')]+'%'};return _0x4fe541;}})});}_0x573b8f=_[_0xbee1('0x39')]({},_0x573b8f,_0x2360a1[_0xbee1('0x3b')]);var _0x37cc9b={'where':_0x573b8f[_0xbee1('0x36')]};return db[_0xbee1('0x3c')][_0xbee1('0x1b')](_0x37cc9b)['then'](function(_0x1ad143){_0x56eb2b[_0xbee1('0x1b')]=_0x1ad143;if(_0x2360a1[_0xbee1('0x30')][_0xbee1('0x3d')]){_0x573b8f[_0xbee1('0x3e')]=[{'all':!![]}];}return db[_0xbee1('0x3c')][_0xbee1('0x3f')](_0x573b8f);})[_0xbee1('0x23')](function(_0x44b28f){_0x56eb2b[_0xbee1('0x40')]=_0x44b28f;return _0x56eb2b;})[_0xbee1('0x23')](respondWithFilteredResult(_0x126afb,_0x573b8f))[_0xbee1('0x41')](handleError(_0x126afb,null));};exports[_0xbee1('0x42')]=function(_0xb8d179,_0x62c175){var _0x5bf2f1={'raw':![],'where':{'id':_0xb8d179[_0xbee1('0x43')]['id']}},_0x1ff1c9={};_0x1ff1c9['model']=_['keys'](db[_0xbee1('0x3c')][_0xbee1('0x29')]);_0x1ff1c9['query']=_[_0xbee1('0x2d')](_0xb8d179['query']);_0x1ff1c9['filters']=_['intersection'](_0x1ff1c9[_0xbee1('0x2c')],_0x1ff1c9[_0xbee1('0x30')]);_0x5bf2f1[_0xbee1('0x31')]=_[_0xbee1('0x2f')](_0x1ff1c9[_0xbee1('0x2c')],qs[_0xbee1('0x32')](_0xb8d179['query']['fields']));_0x5bf2f1[_0xbee1('0x31')]=_0x5bf2f1[_0xbee1('0x31')]['length']?_0x5bf2f1[_0xbee1('0x31')]:_0x1ff1c9[_0xbee1('0x2c')];if(_0xb8d179['query'][_0xbee1('0x3d')]){_0x5bf2f1[_0xbee1('0x3e')]=[{'all':!![]}];}_0x5bf2f1=_[_0xbee1('0x39')]({},_0x5bf2f1,_0xb8d179[_0xbee1('0x3b')]);return db[_0xbee1('0x3c')]['find'](_0x5bf2f1)[_0xbee1('0x23')](handleEntityNotFound(_0x62c175,null))[_0xbee1('0x23')](respondWithResult(_0x62c175,null))[_0xbee1('0x41')](handleError(_0x62c175,null));};exports[_0xbee1('0x44')]=function(_0x16c389,_0x232f84){return db[_0xbee1('0x3c')]['create'](_0x16c389[_0xbee1('0x45')],{})[_0xbee1('0x23')](respondWithResult(_0x232f84,0xc9))[_0xbee1('0x41')](handleError(_0x232f84,null));};exports[_0xbee1('0x21')]=function(_0x4bd2bb,_0x4f32ad){if(_0x4bd2bb[_0xbee1('0x45')]['id']){delete _0x4bd2bb[_0xbee1('0x45')]['id'];}return db['FreshsalesConfiguration'][_0xbee1('0x46')]({'where':{'id':_0x4bd2bb[_0xbee1('0x43')]['id']}})[_0xbee1('0x23')](handleEntityNotFound(_0x4f32ad,null))[_0xbee1('0x23')](saveUpdates(_0x4bd2bb[_0xbee1('0x45')],null))[_0xbee1('0x23')](respondWithResult(_0x4f32ad,null))['catch'](handleError(_0x4f32ad,null));};exports['destroy']=function(_0x44b4fa,_0x35b951){return db[_0xbee1('0x3c')][_0xbee1('0x46')]({'where':{'id':_0x44b4fa[_0xbee1('0x43')]['id']}})['then'](handleEntityNotFound(_0x35b951,null))[_0xbee1('0x23')](removeEntity(_0x35b951,null))[_0xbee1('0x41')](handleError(_0x35b951,null));};exports[_0xbee1('0x47')]=function(_0x5961fe,_0x2768d2,_0xc87a56){var _0x416624={};var _0x5e4d7c={};var _0x556e72;var _0x1c5067;return db[_0xbee1('0x3c')][_0xbee1('0x48')]({'where':{'id':_0x5961fe[_0xbee1('0x43')]['id']}})[_0xbee1('0x23')](handleEntityNotFound(_0x2768d2,null))['then'](function(_0x1b1dbd){if(_0x1b1dbd){_0x556e72=_0x1b1dbd;_0x5e4d7c[_0xbee1('0x2c')]=_[_0xbee1('0x2d')](db[_0xbee1('0x49')][_0xbee1('0x29')]);_0x5e4d7c[_0xbee1('0x30')]=_[_0xbee1('0x2d')](_0x5961fe[_0xbee1('0x30')]);_0x5e4d7c[_0xbee1('0x2e')]=_['intersection'](_0x5e4d7c[_0xbee1('0x2c')],_0x5e4d7c[_0xbee1('0x30')]);_0x416624[_0xbee1('0x31')]=_[_0xbee1('0x2f')](_0x5e4d7c[_0xbee1('0x2c')],qs[_0xbee1('0x32')](_0x5961fe[_0xbee1('0x30')][_0xbee1('0x32')]));_0x416624['attributes']=_0x416624[_0xbee1('0x31')][_0xbee1('0x33')]?_0x416624['attributes']:_0x5e4d7c['model'];_0x416624['order']=qs[_0xbee1('0x4a')](_0x5961fe[_0xbee1('0x30')]['sort']);_0x416624[_0xbee1('0x36')]=qs['filters'](_[_0xbee1('0x37')](_0x5961fe[_0xbee1('0x30')],_0x5e4d7c['filters']));if(_0x5961fe[_0xbee1('0x30')][_0xbee1('0x38')]){_0x416624[_0xbee1('0x36')]=_[_0xbee1('0x39')](_0x416624[_0xbee1('0x36')],{'$or':_[_0xbee1('0x28')](_0x416624[_0xbee1('0x31')],function(_0x1f15f5){var _0x57a7e8={};_0x57a7e8[_0x1f15f5]={'$like':'%'+_0x5961fe['query'][_0xbee1('0x38')]+'%'};return _0x57a7e8;})});}_0x416624=_['merge']({},_0x416624,_0x5961fe[_0xbee1('0x3b')]);return _0x556e72[_0xbee1('0x47')](_0x416624);}})[_0xbee1('0x23')](function(_0x25d68e){if(_0x25d68e){_0x1c5067=_0x25d68e[_0xbee1('0x33')];if(!_0x5961fe[_0xbee1('0x30')][_0xbee1('0x4b')](_0xbee1('0x34'))){_0x416624[_0xbee1('0x19')]=qs[_0xbee1('0x19')](_0x5961fe['query']['limit']);_0x416624[_0xbee1('0x18')]=qs[_0xbee1('0x18')](_0x5961fe[_0xbee1('0x30')]['offset']);}return _0x556e72[_0xbee1('0x47')](_0x416624);}})[_0xbee1('0x23')](function(_0xfab6f1){if(_0xfab6f1){return _0xfab6f1?{'count':_0x1c5067,'rows':_0xfab6f1}:null;}})[_0xbee1('0x23')](respondWithResult(_0x2768d2,null))['catch'](handleError(_0x2768d2,null));};exports[_0xbee1('0x4c')]=function(_0x1fca5e,_0x55e887,_0x3652a7){var _0x5ee232={};var _0x5216d3={};var _0x173a45;var _0x56c338;return db['FreshsalesConfiguration'][_0xbee1('0x48')]({'where':{'id':_0x1fca5e[_0xbee1('0x43')]['id']}})[_0xbee1('0x23')](handleEntityNotFound(_0x55e887,null))[_0xbee1('0x23')](function(_0x546187){if(_0x546187){_0x173a45=_0x546187;_0x5216d3[_0xbee1('0x2c')]=_[_0xbee1('0x2d')](db[_0xbee1('0x49')][_0xbee1('0x29')]);_0x5216d3[_0xbee1('0x30')]=_[_0xbee1('0x2d')](_0x1fca5e[_0xbee1('0x30')]);_0x5216d3[_0xbee1('0x2e')]=_[_0xbee1('0x2f')](_0x5216d3[_0xbee1('0x2c')],_0x5216d3[_0xbee1('0x30')]);_0x5ee232[_0xbee1('0x31')]=_[_0xbee1('0x2f')](_0x5216d3['model'],qs[_0xbee1('0x32')](_0x1fca5e[_0xbee1('0x30')][_0xbee1('0x32')]));_0x5ee232[_0xbee1('0x31')]=_0x5ee232[_0xbee1('0x31')][_0xbee1('0x33')]?_0x5ee232[_0xbee1('0x31')]:_0x5216d3[_0xbee1('0x2c')];_0x5ee232[_0xbee1('0x35')]=qs[_0xbee1('0x4a')](_0x1fca5e['query'][_0xbee1('0x4a')]);_0x5ee232[_0xbee1('0x36')]=qs[_0xbee1('0x2e')](_[_0xbee1('0x37')](_0x1fca5e[_0xbee1('0x30')],_0x5216d3[_0xbee1('0x2e')]));if(_0x1fca5e['query'][_0xbee1('0x38')]){_0x5ee232[_0xbee1('0x36')]=_[_0xbee1('0x39')](_0x5ee232[_0xbee1('0x36')],{'$or':_[_0xbee1('0x28')](_0x5ee232[_0xbee1('0x31')],function(_0x41e2cf){var _0x5d4cfa={};_0x5d4cfa[_0x41e2cf]={'$like':'%'+_0x1fca5e[_0xbee1('0x30')]['filter']+'%'};return _0x5d4cfa;})});}_0x5ee232=_['merge']({},_0x5ee232,_0x1fca5e['options']);return _0x173a45[_0xbee1('0x4c')](_0x5ee232);}})['then'](function(_0x125012){if(_0x125012){_0x56c338=_0x125012['length'];if(!_0x1fca5e[_0xbee1('0x30')][_0xbee1('0x4b')]('nolimit')){_0x5ee232[_0xbee1('0x19')]=qs['limit'](_0x1fca5e[_0xbee1('0x30')][_0xbee1('0x19')]);_0x5ee232['offset']=qs[_0xbee1('0x18')](_0x1fca5e['query'][_0xbee1('0x18')]);}return _0x173a45[_0xbee1('0x4c')](_0x5ee232);}})['then'](function(_0x19dced){if(_0x19dced){return _0x19dced?{'count':_0x56c338,'rows':_0x19dced}:null;}})['then'](respondWithResult(_0x55e887,null))[_0xbee1('0x41')](handleError(_0x55e887,null));};exports['getFields']=function(_0x424c11,_0x18810f,_0x379d27){var _0x3cac79={};var _0x54a370={};var _0x4ba24e;var _0x14ccad;return db['FreshsalesConfiguration'][_0xbee1('0x48')]({'where':{'id':_0x424c11['params']['id']}})[_0xbee1('0x23')](handleEntityNotFound(_0x18810f,null))[_0xbee1('0x23')](function(_0x451deb){if(_0x451deb){_0x4ba24e=_0x451deb;_0x54a370[_0xbee1('0x2c')]=_['keys'](db[_0xbee1('0x49')][_0xbee1('0x29')]);_0x54a370[_0xbee1('0x30')]=_['keys'](_0x424c11[_0xbee1('0x30')]);_0x54a370[_0xbee1('0x2e')]=_[_0xbee1('0x2f')](_0x54a370[_0xbee1('0x2c')],_0x54a370['query']);_0x3cac79['attributes']=_['intersection'](_0x54a370[_0xbee1('0x2c')],qs[_0xbee1('0x32')](_0x424c11[_0xbee1('0x30')][_0xbee1('0x32')]));_0x3cac79['attributes']=_0x3cac79[_0xbee1('0x31')][_0xbee1('0x33')]?_0x3cac79[_0xbee1('0x31')]:_0x54a370[_0xbee1('0x2c')];_0x3cac79[_0xbee1('0x35')]=qs[_0xbee1('0x4a')](_0x424c11['query'][_0xbee1('0x4a')]);_0x3cac79[_0xbee1('0x36')]=qs[_0xbee1('0x2e')](_[_0xbee1('0x37')](_0x424c11[_0xbee1('0x30')],_0x54a370['filters']));if(_0x424c11['query'][_0xbee1('0x38')]){_0x3cac79[_0xbee1('0x36')]=_['merge'](_0x3cac79[_0xbee1('0x36')],{'$or':_['map'](_0x3cac79['attributes'],function(_0x225c72){var _0x32d8b0={};_0x32d8b0[_0x225c72]={'$like':'%'+_0x424c11[_0xbee1('0x30')]['filter']+'%'};return _0x32d8b0;})});}_0x3cac79=_[_0xbee1('0x39')]({},_0x3cac79,_0x424c11['options']);return _0x4ba24e['getFields'](_0x3cac79);}})['then'](function(_0x5145fd){if(_0x5145fd){_0x14ccad=_0x5145fd[_0xbee1('0x33')];if(!_0x424c11[_0xbee1('0x30')][_0xbee1('0x4b')]('nolimit')){_0x3cac79['limit']=qs[_0xbee1('0x19')](_0x424c11[_0xbee1('0x30')][_0xbee1('0x19')]);_0x3cac79[_0xbee1('0x18')]=qs[_0xbee1('0x18')](_0x424c11[_0xbee1('0x30')][_0xbee1('0x18')]);}return _0x4ba24e[_0xbee1('0x4d')](_0x3cac79);}})[_0xbee1('0x23')](function(_0x4252bd){if(_0x4252bd){return _0x4252bd?{'count':_0x14ccad,'rows':_0x4252bd}:null;}})[_0xbee1('0x23')](respondWithResult(_0x18810f,null))[_0xbee1('0x41')](handleError(_0x18810f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 8271f9a..c584b2f 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 _0x420f=['moment','request-promise','path','rimraf','exports','int_freshsales_configurations','util','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x420f,0x106));var _0xf420=function(_0x2858b9,_0x426cdc){_0x2858b9=_0x2858b9-0x0;var _0x50eb91=_0x420f[_0x2858b9];return _0x50eb91;};'use strict';var _=require('lodash');var util=require(_0xf420('0x0'));var logger=require(_0xf420('0x1'))('api');var moment=require(_0xf420('0x2'));var BPromise=require('bluebird');var rp=require(_0xf420('0x3'));var fs=require('fs');var path=require(_0xf420('0x4'));var rimraf=require(_0xf420('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xf420('0x6')]=function(_0x1c554e,_0x596def){return _0x1c554e['define']('FreshsalesConfiguration',attributes,{'tableName':_0xf420('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1879=['int_freshsales_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes'];(function(_0x3e8d8b,_0x1eb279){var _0x2a1cbe=function(_0x29a1e3){while(--_0x29a1e3){_0x3e8d8b['push'](_0x3e8d8b['shift']());}};_0x2a1cbe(++_0x1eb279);}(_0x1879,0xeb));var _0x9187=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0x1879[_0x33593e];return _0x53db1a;};'use strict';var _=require('lodash');var util=require(_0x9187('0x0'));var logger=require(_0x9187('0x1'))(_0x9187('0x2'));var moment=require(_0x9187('0x3'));var BPromise=require(_0x9187('0x4'));var rp=require(_0x9187('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9187('0x6'));var config=require('../../config/environment');var attributes=require(_0x9187('0x7'));module['exports']=function(_0x305c79,_0x6f9058){return _0x305c79['define']('FreshsalesConfiguration',attributes,{'tableName':_0x9187('0x8'),'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 87679ae..c3771bf 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 _0xecdd=['info','request\x20sent','debug','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/logger','client','http','request','then'];(function(_0x27076d,_0x1fa62d){var _0x4fe3e3=function(_0x1a001e){while(--_0x1a001e){_0x27076d['push'](_0x27076d['shift']());}};_0x4fe3e3(++_0x1fa62d);}(_0xecdd,0x13a));var _0xdecd=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xecdd[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xdecd('0x0'));var util=require(_0xdecd('0x1'));var moment=require(_0xdecd('0x2'));var BPromise=require('bluebird');var rs=require(_0xdecd('0x3'));var fs=require('fs');var Redis=require(_0xdecd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdecd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdecd('0x6')][_0xdecd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17ed5d,_0x5a24cf,_0x5a469f){return new BPromise(function(_0x5c8349,_0x2f3548){return client[_0xdecd('0x8')](_0x17ed5d,_0x5a469f)[_0xdecd('0x9')](function(_0x557267){logger[_0xdecd('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a24cf,_0xdecd('0xb'));logger[_0xdecd('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5a24cf,'request\x20sent',JSON[_0xdecd('0xd')](_0x557267));if(_0x557267[_0xdecd('0xe')]){if(_0x557267['error']['code']===0x1f4){logger['error'](_0xdecd('0xf'),_0x5a24cf,_0x557267[_0xdecd('0xe')][_0xdecd('0x10')]);return _0x2f3548(_0x557267[_0xdecd('0xe')][_0xdecd('0x10')]);}logger[_0xdecd('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a24cf,_0x557267[_0xdecd('0xe')][_0xdecd('0x10')]);return _0x5c8349(_0x557267[_0xdecd('0xe')][_0xdecd('0x10')]);}else{logger[_0xdecd('0xa')](_0xdecd('0xf'),_0x5a24cf,_0xdecd('0xb'));_0x5c8349(_0x557267[_0xdecd('0x11')][_0xdecd('0x10')]);}})['catch'](function(_0x592c09){logger[_0xdecd('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5a24cf,_0x592c09);_0x2f3548(_0x592c09);});});} \ No newline at end of file +var _0x9840=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9840,0x1dd));var _0x0984=function(_0x43ff8f,_0xa000ff){_0x43ff8f=_0x43ff8f-0x0;var _0x53cb24=_0x9840[_0x43ff8f];return _0x53cb24;};'use strict';var _=require(_0x0984('0x0'));var util=require(_0x0984('0x1'));var moment=require(_0x0984('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0984('0x3'));var db=require(_0x0984('0x4'))['db'];var utils=require(_0x0984('0x5'));var logger=require(_0x0984('0x6'))(_0x0984('0x7'));var config=require(_0x0984('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0984('0x9')][_0x0984('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ca96,_0x4cd05e,_0x2244a1){return new BPromise(function(_0x5b3286,_0x1f546e){return client[_0x0984('0xb')](_0x59ca96,_0x2244a1)[_0x0984('0xc')](function(_0x2c1faa){logger[_0x0984('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4cd05e,_0x0984('0xe'));logger[_0x0984('0xf')](_0x0984('0x10'),_0x4cd05e,_0x0984('0xe'),JSON[_0x0984('0x11')](_0x2c1faa));if(_0x2c1faa[_0x0984('0x12')]){if(_0x2c1faa['error'][_0x0984('0x13')]===0x1f4){logger[_0x0984('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4cd05e,_0x2c1faa[_0x0984('0x12')][_0x0984('0x14')]);return _0x1f546e(_0x2c1faa['error'][_0x0984('0x14')]);}logger['error'](_0x0984('0x15'),_0x4cd05e,_0x2c1faa['error'][_0x0984('0x14')]);return _0x5b3286(_0x2c1faa[_0x0984('0x12')][_0x0984('0x14')]);}else{logger['info'](_0x0984('0x15'),_0x4cd05e,_0x0984('0xe'));_0x5b3286(_0x2c1faa[_0x0984('0x16')][_0x0984('0x14')]);}})['catch'](function(_0x3eb1ea){logger['error'](_0x0984('0x15'),_0x4cd05e,_0x3eb1ea);_0x1f546e(_0x3eb1ea);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index f11dde7..9512d11 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 _0x5ebe=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','put','update'];(function(_0x3a17d1,_0x81ee02){var _0x27f52c=function(_0x3d622f){while(--_0x3d622f){_0x3a17d1['push'](_0x3a17d1['shift']());}};_0x27f52c(++_0x81ee02);}(_0x5ebe,0x69));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xe5eb('0x0'));var path=require(_0xe5eb('0x1'));var timeout=require(_0xe5eb('0x2'));var express=require(_0xe5eb('0x3'));var router=express[_0xe5eb('0x4')]();var fs_extra=require(_0xe5eb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5eb('0x6'));var controller=require(_0xe5eb('0x7'));router[_0xe5eb('0x8')]('/',auth[_0xe5eb('0x9')](),controller[_0xe5eb('0xa')]);router[_0xe5eb('0x8')](_0xe5eb('0xb'),auth[_0xe5eb('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe5eb('0xc')]('/:id',auth[_0xe5eb('0x9')](),controller[_0xe5eb('0xd')]);router[_0xe5eb('0xe')]('/:id',auth[_0xe5eb('0x9')](),controller[_0xe5eb('0xf')]);module[_0xe5eb('0x10')]=router; \ No newline at end of file +var _0xc788=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x32fd4f,_0x155c54){var _0x53f4f6=function(_0x32ed3f){while(--_0x32ed3f){_0x32fd4f['push'](_0x32fd4f['shift']());}};_0x53f4f6(++_0x155c54);}(_0xc788,0xc4));var _0x8c78=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0xc788[_0x46c1d5];return _0x40fe7b;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0xd')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0xf')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0x10')]);router['delete'](_0x8c78('0xb'),auth[_0x8c78('0x9')](),controller['destroy']);module[_0x8c78('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 23bd24a..8d6d639 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 _0x83d5=['picklist','STRING','ENUM','variable','BOOLEAN','exports','string','customVariable','keyValue'];(function(_0x1a4224,_0xaafde6){var _0x34cee8=function(_0x4c7b6d){while(--_0x4c7b6d){_0x1a4224['push'](_0x1a4224['shift']());}};_0x34cee8(++_0xaafde6);}(_0x83d5,0xa7));var _0x583d=function(_0x26a901,_0x29dd83){_0x26a901=_0x26a901-0x0;var _0x305c2a=_0x83d5[_0x26a901];return _0x305c2a;};'use strict';var Sequelize=require('sequelize');module[_0x583d('0x0')]={'type':{'type':Sequelize['ENUM'](_0x583d('0x1'),'variable',_0x583d('0x2'),_0x583d('0x3'),_0x583d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x583d('0x5')]},'key':{'type':Sequelize[_0x583d('0x5')]},'keyType':{'type':Sequelize[_0x583d('0x6')](_0x583d('0x1'),_0x583d('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x583d('0x5')]},'idField':{'type':Sequelize[_0x583d('0x5')]},'nameField':{'type':Sequelize[_0x583d('0x5')]},'customField':{'type':Sequelize[_0x583d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x583d('0x5')]}}; \ No newline at end of file +var _0xfde6=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x341ae4,_0x1edf33){var _0x2dc42d=function(_0x31a76c){while(--_0x31a76c){_0x341ae4['push'](_0x341ae4['shift']());}};_0x2dc42d(++_0x1edf33);}(_0xfde6,0x161));var _0x6fde=function(_0x374f83,_0x21fb70){_0x374f83=_0x374f83-0x0;var _0x145058=_0xfde6[_0x374f83];return _0x145058;};'use strict';var Sequelize=require(_0x6fde('0x0'));module['exports']={'type':{'type':Sequelize[_0x6fde('0x1')](_0x6fde('0x2'),_0x6fde('0x3'),_0x6fde('0x4'),_0x6fde('0x5'),_0x6fde('0x6')),'defaultValue':_0x6fde('0x2')},'content':{'type':Sequelize[_0x6fde('0x7')]},'key':{'type':Sequelize[_0x6fde('0x7')]},'keyType':{'type':Sequelize[_0x6fde('0x1')](_0x6fde('0x2'),'variable',_0x6fde('0x4'))},'keyContent':{'type':Sequelize[_0x6fde('0x7')]},'idField':{'type':Sequelize[_0x6fde('0x7')]},'nameField':{'type':Sequelize[_0x6fde('0x7')]},'customField':{'type':Sequelize[_0x6fde('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index a5b5ea7..0cf769c 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 _0xea0d=['save','then','end','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x134acf,_0x3a19c1){var _0x92e1e5=function(_0x1bc1da){while(--_0x1bc1da){_0x134acf['push'](_0x134acf['shift']());}};_0x92e1e5(++_0x3a19c1);}(_0xea0d,0x110));var _0xdea0=function(_0x54597a,_0x4ea42f){_0x54597a=_0x54597a-0x0;var _0x5a764f=_0xea0d[_0x54597a];return _0x5a764f;};'use strict';var emlformat=require(_0xdea0('0x0'));var rimraf=require(_0xdea0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdea0('0x2'));var moment=require(_0xdea0('0x3'));var BPromise=require(_0xdea0('0x4'));var Mustache=require(_0xdea0('0x5'));var util=require(_0xdea0('0x6'));var path=require(_0xdea0('0x7'));var sox=require(_0xdea0('0x8'));var csv=require(_0xdea0('0x9'));var ejs=require(_0xdea0('0xa'));var fs=require('fs');var fs_extra=require(_0xdea0('0xb'));var _=require(_0xdea0('0xc'));var squel=require(_0xdea0('0xd'));var crypto=require(_0xdea0('0xe'));var jsforce=require(_0xdea0('0xf'));var deskjs=require(_0xdea0('0x10'));var toCsv=require(_0xdea0('0x9'));var querystring=require('querystring');var Papa=require(_0xdea0('0x11'));var Redis=require(_0xdea0('0x12'));var authService=require(_0xdea0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdea0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdea0('0x15'));var utils=require(_0xdea0('0x16'));var config=require(_0xdea0('0x17'));var licenseUtil=require(_0xdea0('0x18'));var db=require(_0xdea0('0x19'))['db'];function respondWithStatusCode(_0x401ba2,_0x2765ad){_0x2765ad=_0x2765ad||0xcc;return function(_0x3edd6a){if(_0x3edd6a){return _0x401ba2[_0xdea0('0x1a')](_0x2765ad);}return _0x401ba2[_0xdea0('0x1b')](_0x2765ad)['end']();};}function respondWithResult(_0x32da07,_0x440f01){_0x440f01=_0x440f01||0xc8;return function(_0x1f90f2){if(_0x1f90f2){return _0x32da07[_0xdea0('0x1b')](_0x440f01)[_0xdea0('0x1c')](_0x1f90f2);}};}function respondWithFilteredResult(_0x14c1ed,_0x279202){return function(_0x57e87c){if(_0x57e87c){var _0xa86421=typeof _0x279202[_0xdea0('0x1d')]===_0xdea0('0x1e')&&typeof _0x279202[_0xdea0('0x1f')]===_0xdea0('0x1e');var _0x5081e2=_0x57e87c[_0xdea0('0x20')];var _0x17c21c=_0xa86421?0x0:_0x279202['offset'];var _0x114bf1=_0xa86421?_0x57e87c[_0xdea0('0x20')]:_0x279202[_0xdea0('0x1d')]+_0x279202[_0xdea0('0x1f')];var _0x293954;if(_0x114bf1>=_0x5081e2){_0x114bf1=_0x5081e2;_0x293954=0xc8;}else{_0x293954=0xce;}_0x14c1ed['status'](_0x293954);return _0x14c1ed[_0xdea0('0x21')](_0xdea0('0x22'),_0x17c21c+'-'+_0x114bf1+'/'+_0x5081e2)['json'](_0x57e87c);}return null;};}function patchUpdates(_0x596c98){return function(_0x469889){try{jsonpatch[_0xdea0('0x23')](_0x469889,_0x596c98,!![]);}catch(_0x456daf){return BPromise['reject'](_0x456daf);}return _0x469889[_0xdea0('0x24')]();};}function saveUpdates(_0x567495,_0x3bd35a){return function(_0x4494dc){if(_0x4494dc){return _0x4494dc['update'](_0x567495)[_0xdea0('0x25')](function(_0x23b1b4){return _0x23b1b4;});}return null;};}function removeEntity(_0x145c17,_0x573772){return function(_0x315489){if(_0x315489){return _0x315489['destroy']()[_0xdea0('0x25')](function(){_0x145c17['status'](0xcc)[_0xdea0('0x26')]();});}};}function handleEntityNotFound(_0x156e21,_0x173073){return function(_0x16b7be){if(!_0x16b7be){_0x156e21[_0xdea0('0x1a')](0x194);}return _0x16b7be;};}function handleError(_0xcef6f9,_0x3e6c5e){_0x3e6c5e=_0x3e6c5e||0x1f4;return function(_0x276793){logger[_0xdea0('0x27')](_0x276793[_0xdea0('0x28')]);if(_0x276793[_0xdea0('0x29')]){delete _0x276793[_0xdea0('0x29')];}_0xcef6f9[_0xdea0('0x1b')](_0x3e6c5e)[_0xdea0('0x2a')](_0x276793);};}exports['index']=function(_0x241941,_0x11f35f){var _0x4cdbec={},_0x41ba7e={},_0x55c267={'count':0x0,'rows':[]};var _0x2c1716=_[_0xdea0('0x2b')](db[_0xdea0('0x2c')][_0xdea0('0x2d')],function(_0x498ee9){return{'name':_0x498ee9[_0xdea0('0x2e')],'type':_0x498ee9[_0xdea0('0x2f')][_0xdea0('0x30')]};});_0x41ba7e['model']=_[_0xdea0('0x2b')](_0x2c1716,_0xdea0('0x29'));_0x41ba7e['query']=_[_0xdea0('0x31')](_0x241941[_0xdea0('0x32')]);_0x41ba7e[_0xdea0('0x33')]=_[_0xdea0('0x34')](_0x41ba7e['model'],_0x41ba7e['query']);_0x4cdbec[_0xdea0('0x35')]=_[_0xdea0('0x34')](_0x41ba7e[_0xdea0('0x36')],qs[_0xdea0('0x37')](_0x241941[_0xdea0('0x32')][_0xdea0('0x37')]));_0x4cdbec[_0xdea0('0x35')]=_0x4cdbec['attributes'][_0xdea0('0x38')]?_0x4cdbec[_0xdea0('0x35')]:_0x41ba7e[_0xdea0('0x36')];if(!_0x241941[_0xdea0('0x32')][_0xdea0('0x39')]('nolimit')){_0x4cdbec[_0xdea0('0x1f')]=qs[_0xdea0('0x1f')](_0x241941[_0xdea0('0x32')][_0xdea0('0x1f')]);_0x4cdbec[_0xdea0('0x1d')]=qs[_0xdea0('0x1d')](_0x241941[_0xdea0('0x32')][_0xdea0('0x1d')]);}_0x4cdbec[_0xdea0('0x3a')]=qs[_0xdea0('0x3b')](_0x241941[_0xdea0('0x32')][_0xdea0('0x3b')]);_0x4cdbec['where']=qs[_0xdea0('0x33')](_[_0xdea0('0x3c')](_0x241941['query'],_0x41ba7e[_0xdea0('0x33')]),_0x2c1716);if(_0x241941['query'][_0xdea0('0x3d')]){_0x4cdbec[_0xdea0('0x3e')]=_[_0xdea0('0x3f')](_0x4cdbec[_0xdea0('0x3e')],{'$or':_['map'](_0x2c1716,function(_0x12109f){if(_0x12109f[_0xdea0('0x2f')]!=='VIRTUAL'){var _0x46bc6b={};_0x46bc6b[_0x12109f['name']]={'$like':'%'+_0x241941['query'][_0xdea0('0x3d')]+'%'};return _0x46bc6b;}})});}_0x4cdbec=_[_0xdea0('0x3f')]({},_0x4cdbec,_0x241941[_0xdea0('0x40')]);var _0x6ac566={'where':_0x4cdbec[_0xdea0('0x3e')]};return db[_0xdea0('0x2c')][_0xdea0('0x20')](_0x6ac566)[_0xdea0('0x25')](function(_0x4a02b4){_0x55c267[_0xdea0('0x20')]=_0x4a02b4;if(_0x241941[_0xdea0('0x32')][_0xdea0('0x41')]){_0x4cdbec[_0xdea0('0x42')]=[{'all':!![]}];}return db[_0xdea0('0x2c')][_0xdea0('0x43')](_0x4cdbec);})[_0xdea0('0x25')](function(_0x549cd4){_0x55c267[_0xdea0('0x44')]=_0x549cd4;return _0x55c267;})[_0xdea0('0x25')](respondWithFilteredResult(_0x11f35f,_0x4cdbec))[_0xdea0('0x45')](handleError(_0x11f35f,null));};exports[_0xdea0('0x46')]=function(_0x1cdc39,_0x4a9a4c){var _0x2f705b={'raw':!![],'where':{'id':_0x1cdc39['params']['id']}},_0x42c548={};_0x42c548[_0xdea0('0x36')]=_[_0xdea0('0x31')](db['FreshsalesField'][_0xdea0('0x2d')]);_0x42c548[_0xdea0('0x32')]=_[_0xdea0('0x31')](_0x1cdc39[_0xdea0('0x32')]);_0x42c548[_0xdea0('0x33')]=_[_0xdea0('0x34')](_0x42c548[_0xdea0('0x36')],_0x42c548['query']);_0x2f705b[_0xdea0('0x35')]=_[_0xdea0('0x34')](_0x42c548['model'],qs['fields'](_0x1cdc39[_0xdea0('0x32')][_0xdea0('0x37')]));_0x2f705b[_0xdea0('0x35')]=_0x2f705b[_0xdea0('0x35')][_0xdea0('0x38')]?_0x2f705b[_0xdea0('0x35')]:_0x42c548[_0xdea0('0x36')];if(_0x1cdc39[_0xdea0('0x32')][_0xdea0('0x41')]){_0x2f705b['include']=[{'all':!![]}];}_0x2f705b=_[_0xdea0('0x3f')]({},_0x2f705b,_0x1cdc39[_0xdea0('0x40')]);return db[_0xdea0('0x2c')][_0xdea0('0x47')](_0x2f705b)['then'](handleEntityNotFound(_0x4a9a4c,null))[_0xdea0('0x25')](respondWithResult(_0x4a9a4c,null))[_0xdea0('0x45')](handleError(_0x4a9a4c,null));};exports[_0xdea0('0x48')]=function(_0x34d375,_0x1ec734){return db[_0xdea0('0x2c')][_0xdea0('0x48')](_0x34d375[_0xdea0('0x49')],{})[_0xdea0('0x25')](respondWithResult(_0x1ec734,0xc9))['catch'](handleError(_0x1ec734,null));};exports[_0xdea0('0x4a')]=function(_0x1bcb9c,_0x36b601){if(_0x1bcb9c[_0xdea0('0x49')]['id']){delete _0x1bcb9c['body']['id'];}return db[_0xdea0('0x2c')]['find']({'where':{'id':_0x1bcb9c[_0xdea0('0x4b')]['id']}})[_0xdea0('0x25')](handleEntityNotFound(_0x36b601,null))[_0xdea0('0x25')](saveUpdates(_0x1bcb9c[_0xdea0('0x49')],null))[_0xdea0('0x25')](respondWithResult(_0x36b601,null))[_0xdea0('0x45')](handleError(_0x36b601,null));};exports[_0xdea0('0x4c')]=function(_0x2990da,_0x128609){return db[_0xdea0('0x2c')]['find']({'where':{'id':_0x2990da['params']['id']}})['then'](handleEntityNotFound(_0x128609,null))['then'](removeEntity(_0x128609,null))[_0xdea0('0x45')](handleError(_0x128609,null));}; \ No newline at end of file +var _0x5cf7=['reject','save','update','then','destroy','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','create','body','find','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x54f9b9,_0x4bf008){var _0x390a44=function(_0x5ef93a){while(--_0x5ef93a){_0x54f9b9['push'](_0x54f9b9['shift']());}};_0x390a44(++_0x4bf008);}(_0x5cf7,0x14b));var _0x75cf=function(_0x312b61,_0x2e4c5e){_0x312b61=_0x312b61-0x0;var _0xeda76=_0x5cf7[_0x312b61];return _0xeda76;};'use strict';var emlformat=require(_0x75cf('0x0'));var rimraf=require(_0x75cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75cf('0x2'));var moment=require(_0x75cf('0x3'));var BPromise=require(_0x75cf('0x4'));var Mustache=require(_0x75cf('0x5'));var util=require(_0x75cf('0x6'));var path=require(_0x75cf('0x7'));var sox=require('sox');var csv=require(_0x75cf('0x8'));var ejs=require(_0x75cf('0x9'));var fs=require('fs');var fs_extra=require(_0x75cf('0xa'));var _=require('lodash');var squel=require(_0x75cf('0xb'));var crypto=require(_0x75cf('0xc'));var jsforce=require(_0x75cf('0xd'));var deskjs=require(_0x75cf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x75cf('0xf'));var Papa=require(_0x75cf('0x10'));var Redis=require(_0x75cf('0x11'));var authService=require(_0x75cf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x75cf('0x13'));var hardwareService=require(_0x75cf('0x14'));var logger=require(_0x75cf('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x75cf('0x16'));var db=require(_0x75cf('0x17'))['db'];function respondWithStatusCode(_0x2a0996,_0x4f17a5){_0x4f17a5=_0x4f17a5||0xcc;return function(_0x2496bb){if(_0x2496bb){return _0x2a0996[_0x75cf('0x18')](_0x4f17a5);}return _0x2a0996[_0x75cf('0x19')](_0x4f17a5)[_0x75cf('0x1a')]();};}function respondWithResult(_0x1eb26f,_0x351ab6){_0x351ab6=_0x351ab6||0xc8;return function(_0x344498){if(_0x344498){return _0x1eb26f[_0x75cf('0x19')](_0x351ab6)[_0x75cf('0x1b')](_0x344498);}};}function respondWithFilteredResult(_0x594ee5,_0x21e1f3){return function(_0x24e977){if(_0x24e977){var _0x1b99b8=typeof _0x21e1f3[_0x75cf('0x1c')]===_0x75cf('0x1d')&&typeof _0x21e1f3[_0x75cf('0x1e')]===_0x75cf('0x1d');var _0xe77668=_0x24e977[_0x75cf('0x1f')];var _0x52b835=_0x1b99b8?0x0:_0x21e1f3['offset'];var _0x1256ce=_0x1b99b8?_0x24e977[_0x75cf('0x1f')]:_0x21e1f3[_0x75cf('0x1c')]+_0x21e1f3[_0x75cf('0x1e')];var _0x13380e;if(_0x1256ce>=_0xe77668){_0x1256ce=_0xe77668;_0x13380e=0xc8;}else{_0x13380e=0xce;}_0x594ee5[_0x75cf('0x19')](_0x13380e);return _0x594ee5['set'](_0x75cf('0x20'),_0x52b835+'-'+_0x1256ce+'/'+_0xe77668)[_0x75cf('0x1b')](_0x24e977);}return null;};}function patchUpdates(_0x4f6063){return function(_0x521b9d){try{jsonpatch[_0x75cf('0x21')](_0x521b9d,_0x4f6063,!![]);}catch(_0x23d469){return BPromise[_0x75cf('0x22')](_0x23d469);}return _0x521b9d[_0x75cf('0x23')]();};}function saveUpdates(_0x4f1c4d,_0x46591f){return function(_0x1ba008){if(_0x1ba008){return _0x1ba008[_0x75cf('0x24')](_0x4f1c4d)[_0x75cf('0x25')](function(_0xff6841){return _0xff6841;});}return null;};}function removeEntity(_0x162d99,_0x2d8a0b){return function(_0x2e6b0c){if(_0x2e6b0c){return _0x2e6b0c[_0x75cf('0x26')]()[_0x75cf('0x25')](function(){_0x162d99['status'](0xcc)[_0x75cf('0x1a')]();});}};}function handleEntityNotFound(_0x3e44f1,_0x4a3544){return function(_0x1df360){if(!_0x1df360){_0x3e44f1[_0x75cf('0x18')](0x194);}return _0x1df360;};}function handleError(_0x143174,_0x142ab6){_0x142ab6=_0x142ab6||0x1f4;return function(_0x599c66){logger[_0x75cf('0x27')](_0x599c66[_0x75cf('0x28')]);if(_0x599c66[_0x75cf('0x29')]){delete _0x599c66['name'];}_0x143174[_0x75cf('0x19')](_0x142ab6)['send'](_0x599c66);};}exports[_0x75cf('0x2a')]=function(_0x1ee5cd,_0x155f9f){var _0x54489a={},_0x7e6640={},_0x4acef7={'count':0x0,'rows':[]};var _0x1e3e1e=_[_0x75cf('0x2b')](db[_0x75cf('0x2c')][_0x75cf('0x2d')],function(_0x1ee0df){return{'name':_0x1ee0df[_0x75cf('0x2e')],'type':_0x1ee0df[_0x75cf('0x2f')][_0x75cf('0x30')]};});_0x7e6640['model']=_[_0x75cf('0x2b')](_0x1e3e1e,'name');_0x7e6640[_0x75cf('0x31')]=_[_0x75cf('0x32')](_0x1ee5cd['query']);_0x7e6640[_0x75cf('0x33')]=_[_0x75cf('0x34')](_0x7e6640[_0x75cf('0x35')],_0x7e6640[_0x75cf('0x31')]);_0x54489a[_0x75cf('0x36')]=_[_0x75cf('0x34')](_0x7e6640[_0x75cf('0x35')],qs['fields'](_0x1ee5cd[_0x75cf('0x31')][_0x75cf('0x37')]));_0x54489a['attributes']=_0x54489a['attributes'][_0x75cf('0x38')]?_0x54489a['attributes']:_0x7e6640[_0x75cf('0x35')];if(!_0x1ee5cd[_0x75cf('0x31')][_0x75cf('0x39')]('nolimit')){_0x54489a[_0x75cf('0x1e')]=qs[_0x75cf('0x1e')](_0x1ee5cd[_0x75cf('0x31')][_0x75cf('0x1e')]);_0x54489a[_0x75cf('0x1c')]=qs[_0x75cf('0x1c')](_0x1ee5cd['query'][_0x75cf('0x1c')]);}_0x54489a[_0x75cf('0x3a')]=qs[_0x75cf('0x3b')](_0x1ee5cd[_0x75cf('0x31')]['sort']);_0x54489a[_0x75cf('0x3c')]=qs[_0x75cf('0x33')](_[_0x75cf('0x3d')](_0x1ee5cd[_0x75cf('0x31')],_0x7e6640[_0x75cf('0x33')]),_0x1e3e1e);if(_0x1ee5cd['query'][_0x75cf('0x3e')]){_0x54489a[_0x75cf('0x3c')]=_[_0x75cf('0x3f')](_0x54489a[_0x75cf('0x3c')],{'$or':_[_0x75cf('0x2b')](_0x1e3e1e,function(_0x1d610d){if(_0x1d610d['type']!==_0x75cf('0x40')){var _0x4a65b6={};_0x4a65b6[_0x1d610d[_0x75cf('0x29')]]={'$like':'%'+_0x1ee5cd[_0x75cf('0x31')][_0x75cf('0x3e')]+'%'};return _0x4a65b6;}})});}_0x54489a=_[_0x75cf('0x3f')]({},_0x54489a,_0x1ee5cd['options']);var _0x416d2d={'where':_0x54489a[_0x75cf('0x3c')]};return db[_0x75cf('0x2c')]['count'](_0x416d2d)['then'](function(_0x4acec8){_0x4acef7[_0x75cf('0x1f')]=_0x4acec8;if(_0x1ee5cd[_0x75cf('0x31')][_0x75cf('0x41')]){_0x54489a[_0x75cf('0x42')]=[{'all':!![]}];}return db['FreshsalesField'][_0x75cf('0x43')](_0x54489a);})[_0x75cf('0x25')](function(_0x38e7ee){_0x4acef7['rows']=_0x38e7ee;return _0x4acef7;})['then'](respondWithFilteredResult(_0x155f9f,_0x54489a))[_0x75cf('0x44')](handleError(_0x155f9f,null));};exports['show']=function(_0x5b7932,_0x4efb46){var _0x13a31={'raw':!![],'where':{'id':_0x5b7932['params']['id']}},_0x351c8a={};_0x351c8a[_0x75cf('0x35')]=_[_0x75cf('0x32')](db['FreshsalesField'][_0x75cf('0x2d')]);_0x351c8a['query']=_[_0x75cf('0x32')](_0x5b7932['query']);_0x351c8a[_0x75cf('0x33')]=_[_0x75cf('0x34')](_0x351c8a[_0x75cf('0x35')],_0x351c8a[_0x75cf('0x31')]);_0x13a31[_0x75cf('0x36')]=_['intersection'](_0x351c8a['model'],qs[_0x75cf('0x37')](_0x5b7932[_0x75cf('0x31')]['fields']));_0x13a31[_0x75cf('0x36')]=_0x13a31['attributes'][_0x75cf('0x38')]?_0x13a31[_0x75cf('0x36')]:_0x351c8a[_0x75cf('0x35')];if(_0x5b7932[_0x75cf('0x31')][_0x75cf('0x41')]){_0x13a31[_0x75cf('0x42')]=[{'all':!![]}];}_0x13a31=_[_0x75cf('0x3f')]({},_0x13a31,_0x5b7932['options']);return db[_0x75cf('0x2c')]['find'](_0x13a31)[_0x75cf('0x25')](handleEntityNotFound(_0x4efb46,null))['then'](respondWithResult(_0x4efb46,null))[_0x75cf('0x44')](handleError(_0x4efb46,null));};exports[_0x75cf('0x45')]=function(_0x215b90,_0x4cd5b1){return db['FreshsalesField'][_0x75cf('0x45')](_0x215b90['body'],{})[_0x75cf('0x25')](respondWithResult(_0x4cd5b1,0xc9))[_0x75cf('0x44')](handleError(_0x4cd5b1,null));};exports[_0x75cf('0x24')]=function(_0x27836e,_0x2e226f){if(_0x27836e['body']['id']){delete _0x27836e[_0x75cf('0x46')]['id'];}return db[_0x75cf('0x2c')][_0x75cf('0x47')]({'where':{'id':_0x27836e[_0x75cf('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e226f,null))['then'](saveUpdates(_0x27836e[_0x75cf('0x46')],null))[_0x75cf('0x25')](respondWithResult(_0x2e226f,null))['catch'](handleError(_0x2e226f,null));};exports[_0x75cf('0x26')]=function(_0xb4d830,_0x119737){return db[_0x75cf('0x2c')][_0x75cf('0x47')]({'where':{'id':_0xb4d830[_0x75cf('0x48')]['id']}})[_0x75cf('0x25')](handleEntityNotFound(_0x119737,null))[_0x75cf('0x25')](removeEntity(_0x119737,null))['catch'](handleError(_0x119737,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index c1b4a86..5c69bbe 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 _0x4910=['rimraf','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x225915,_0x2eaa2f){var _0x3b8d10=function(_0x4c9dd5){while(--_0x4c9dd5){_0x225915['push'](_0x225915['shift']());}};_0x3b8d10(++_0x2eaa2f);}(_0x4910,0x1d9));var _0x0491=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4910[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var logger=require(_0x0491('0x2'))('api');var moment=require(_0x0491('0x3'));var BPromise=require(_0x0491('0x4'));var rp=require(_0x0491('0x5'));var fs=require('fs');var path=require(_0x0491('0x6'));var rimraf=require(_0x0491('0x7'));var config=require('../../config/environment');var attributes=require(_0x0491('0x8'));module[_0x0491('0x9')]=function(_0x23dd63,_0x282be3){return _0x23dd63[_0x0491('0xa')]('FreshsalesField',attributes,{'tableName':_0x0491('0xb'),'paranoid':![],'indexes':[{'name':_0x0491('0xc'),'fields':[_0x0491('0xd'),_0x0491('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5276=['exports','define','int_freshsales_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x5276,0x163));var _0x6527=function(_0x18c529,_0x95b3ce){_0x18c529=_0x18c529-0x0;var _0x3e6af9=_0x5276[_0x18c529];return _0x3e6af9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6527('0x0'))(_0x6527('0x1'));var moment=require(_0x6527('0x2'));var BPromise=require(_0x6527('0x3'));var rp=require(_0x6527('0x4'));var fs=require('fs');var path=require(_0x6527('0x5'));var rimraf=require(_0x6527('0x6'));var config=require(_0x6527('0x7'));var attributes=require(_0x6527('0x8'));module[_0x6527('0x9')]=function(_0x3deb56,_0x9d7ba2){return _0x3deb56[_0x6527('0xa')]('FreshsalesField',attributes,{'tableName':_0x6527('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x6527('0xc'),_0x6527('0xd')],'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 6c50f7f..5b7df87 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(_0x2964ca,_0x1bac1b){var _0xd2142b=function(_0x44b3e1){while(--_0x44b3e1){_0x2964ca['push'](_0x2964ca['shift']());}};_0xd2142b(++_0x1bac1b);}(_0x1623,0xab));var _0x3162=function(_0x4e43ec,_0x2fa387){_0x4e43ec=_0x4e43ec-0x0;var _0x2d11f5=_0x1623[_0x4e43ec];return _0x2d11f5;};'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 _0xd8fb=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x36d8ff,_0x224895){var _0x906ef5=function(_0x2c21f1){while(--_0x2c21f1){_0x36d8ff['push'](_0x36d8ff['shift']());}};_0x906ef5(++_0x224895);}(_0xd8fb,0x99));var _0xbd8f=function(_0x466525,_0x1c8bd2){_0x466525=_0x466525-0x0;var _0x5930da=_0xd8fb[_0x466525];return _0x5930da;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){return client['request'](_0x4e97cf,_0x578499)['then'](function(_0x3caa93){logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,'request\x20sent');logger[_0xbd8f('0xb')](_0xbd8f('0xc'),_0xf503c4,'request\x20sent',JSON['stringify'](_0x3caa93));if(_0x3caa93[_0xbd8f('0xd')]){if(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xe')]===0x1f4){logger['error'](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x403edc(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);}logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x197827(_0x3caa93['error'][_0xbd8f('0xf')]);}else{logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,_0xbd8f('0x10'));_0x197827(_0x3caa93['result'][_0xbd8f('0xf')]);}})[_0xbd8f('0x11')](function(_0x5ebf8b){logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x5ebf8b);_0x403edc(_0x5ebf8b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5ce4034..d209094 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x12f993,_0x3a3c22){var _0x180936=function(_0x59073f){while(--_0x59073f){_0x12f993['push'](_0x12f993['shift']());}};_0x180936(++_0x3a3c22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x160594,_0x262f72){var _0x46049e=function(_0xa3a65e){while(--_0xa3a65e){_0x160594['push'](_0x160594['shift']());}};_0x46049e(++_0x262f72);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 9e77b0b..5383a48 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 _0x2b84=['integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x483181,_0x1496ec){var _0x4f274f=function(_0x5d47a5){while(--_0x5d47a5){_0x483181['push'](_0x483181['shift']());}};_0x4f274f(++_0x1496ec);}(_0x2b84,0x1ed));var _0x42b8=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x2b84[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x42b8('0x0'));module[_0x42b8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x42b8('0x2')]},'username':{'type':Sequelize[_0x42b8('0x2')],'unique':_0x42b8('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x42b8('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x42b8('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x42b8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x42b8('0x4')]('integrationTab','newTab'),'defaultValue':_0x42b8('0x5')}}; \ No newline at end of file +var _0x1e24=['username','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x8fc3d2,_0x25fa72){var _0x542564=function(_0xeae108){while(--_0xeae108){_0x8fc3d2['push'](_0x8fc3d2['shift']());}};_0x542564(++_0x25fa72);}(_0x1e24,0x82));var _0x41e2=function(_0x3d1684,_0x103504){_0x3d1684=_0x3d1684-0x0;var _0x20dbaa=_0x1e24[_0x3d1684];return _0x20dbaa;};'use strict';var Sequelize=require(_0x41e2('0x0'));module[_0x41e2('0x1')]={'name':{'type':Sequelize[_0x41e2('0x2')]},'description':{'type':Sequelize[_0x41e2('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x41e2('0x3')},'remoteUri':{'type':Sequelize[_0x41e2('0x2')]},'password':{'type':Sequelize[_0x41e2('0x2')]},'clientId':{'type':Sequelize[_0x41e2('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x41e2('0x2')]},'serverUrl':{'type':Sequelize[_0x41e2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x41e2('0x4')](_0x41e2('0x5'),_0x41e2('0x6')),'defaultValue':_0x41e2('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 0e2fcb7..4fd3fb7 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 _0x8fcb=['ticketType','describe','ActivityDate','string','picklist','boolean','email','remove','includes','label','custom','picklistValues','value','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','update','then','destroy','error','stack','send','index','map','SalesforceAccount','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','findOne','order','getConfigurations','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','clientId','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','login','concat','isNil'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8fcb,0x186));var _0xb8fc=function(_0x210304,_0x5549ea){_0x210304=_0x210304-0x0;var _0x15d260=_0x8fcb[_0x210304];return _0x15d260;};'use strict';var emlformat=require(_0xb8fc('0x0'));var rimraf=require(_0xb8fc('0x1'));var zipdir=require(_0xb8fc('0x2'));var jsonpatch=require(_0xb8fc('0x3'));var rp=require(_0xb8fc('0x4'));var moment=require(_0xb8fc('0x5'));var BPromise=require(_0xb8fc('0x6'));var Mustache=require(_0xb8fc('0x7'));var util=require('util');var path=require(_0xb8fc('0x8'));var sox=require(_0xb8fc('0x9'));var csv=require(_0xb8fc('0xa'));var ejs=require(_0xb8fc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb8fc('0xc'));var crypto=require(_0xb8fc('0xd'));var jsforce=require(_0xb8fc('0xe'));var deskjs=require(_0xb8fc('0xf'));var toCsv=require(_0xb8fc('0xa'));var querystring=require('querystring');var Papa=require(_0xb8fc('0x10'));var Redis=require('ioredis');var authService=require(_0xb8fc('0x11'));var qs=require(_0xb8fc('0x12'));var as=require(_0xb8fc('0x13'));var hardwareService=require(_0xb8fc('0x14'));var logger=require(_0xb8fc('0x15'))(_0xb8fc('0x16'));var utils=require(_0xb8fc('0x17'));var config=require(_0xb8fc('0x18'));var licenseUtil=require(_0xb8fc('0x19'));var db=require(_0xb8fc('0x1a'))['db'];var integrations=require(_0xb8fc('0x1b'));function respondWithStatusCode(_0x1a09b8,_0x4d3651){_0x4d3651=_0x4d3651||0xcc;return function(_0x36cc29){if(_0x36cc29){return _0x1a09b8[_0xb8fc('0x1c')](_0x4d3651);}return _0x1a09b8[_0xb8fc('0x1d')](_0x4d3651)[_0xb8fc('0x1e')]();};}function respondWithResult(_0x217cdb,_0xc1beae){_0xc1beae=_0xc1beae||0xc8;return function(_0x1a9da7){if(_0x1a9da7){return _0x217cdb['status'](_0xc1beae)[_0xb8fc('0x1f')](_0x1a9da7);}};}function respondWithFilteredResult(_0x3e0607,_0x3a8032){return function(_0x426915){if(_0x426915){var _0x5ef98b=typeof _0x3a8032[_0xb8fc('0x20')]===_0xb8fc('0x21')&&typeof _0x3a8032[_0xb8fc('0x22')]===_0xb8fc('0x21');var _0x24116f=_0x426915['count'];var _0x597712=_0x5ef98b?0x0:_0x3a8032['offset'];var _0x112f6f=_0x5ef98b?_0x426915['count']:_0x3a8032[_0xb8fc('0x20')]+_0x3a8032[_0xb8fc('0x22')];var _0x394874;if(_0x112f6f>=_0x24116f){_0x112f6f=_0x24116f;_0x394874=0xc8;}else{_0x394874=0xce;}_0x3e0607[_0xb8fc('0x1d')](_0x394874);return _0x3e0607[_0xb8fc('0x23')]('Content-Range',_0x597712+'-'+_0x112f6f+'/'+_0x24116f)[_0xb8fc('0x1f')](_0x426915);}return null;};}function patchUpdates(_0x3cc781){return function(_0x2771a6){try{jsonpatch[_0xb8fc('0x24')](_0x2771a6,_0x3cc781,!![]);}catch(_0x3e6358){return BPromise['reject'](_0x3e6358);}return _0x2771a6[_0xb8fc('0x25')]();};}function saveUpdates(_0x20c901,_0x494d84){return function(_0x3e651a){if(_0x3e651a){return _0x3e651a[_0xb8fc('0x26')](_0x20c901)[_0xb8fc('0x27')](function(_0x5e5dbc){return _0x5e5dbc;});}return null;};}function removeEntity(_0x15eb19,_0xe031b2){return function(_0x46bb2d){if(_0x46bb2d){return _0x46bb2d[_0xb8fc('0x28')]()[_0xb8fc('0x27')](function(){_0x15eb19['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x413784,_0xec046d){return function(_0xc1818e){if(!_0xc1818e){_0x413784['sendStatus'](0x194);}return _0xc1818e;};}function handleError(_0x268cf8,_0x3c8db9){_0x3c8db9=_0x3c8db9||0x1f4;return function(_0xc9e214){logger[_0xb8fc('0x29')](_0xc9e214[_0xb8fc('0x2a')]);if(_0xc9e214['name']){delete _0xc9e214['name'];}_0x268cf8[_0xb8fc('0x1d')](_0x3c8db9)[_0xb8fc('0x2b')](_0xc9e214);};}exports[_0xb8fc('0x2c')]=function(_0xc34aef,_0x38327f){var _0x8c8a55={},_0x1fceb0={},_0xb48a3={'count':0x0,'rows':[]};var _0x26d9c0=_[_0xb8fc('0x2d')](db[_0xb8fc('0x2e')]['rawAttributes'],function(_0x265327){return{'name':_0x265327[_0xb8fc('0x2f')],'type':_0x265327[_0xb8fc('0x30')][_0xb8fc('0x31')]};});_0x1fceb0[_0xb8fc('0x32')]=_[_0xb8fc('0x2d')](_0x26d9c0,_0xb8fc('0x33'));_0x1fceb0[_0xb8fc('0x34')]=_[_0xb8fc('0x35')](_0xc34aef['query']);_0x1fceb0[_0xb8fc('0x36')]=_[_0xb8fc('0x37')](_0x1fceb0[_0xb8fc('0x32')],_0x1fceb0[_0xb8fc('0x34')]);_0x8c8a55[_0xb8fc('0x38')]=_['intersection'](_0x1fceb0[_0xb8fc('0x32')],qs[_0xb8fc('0x39')](_0xc34aef['query']['fields']));_0x8c8a55['attributes']=_0x8c8a55[_0xb8fc('0x38')][_0xb8fc('0x3a')]?_0x8c8a55[_0xb8fc('0x38')]:_0x1fceb0[_0xb8fc('0x32')];if(!_0xc34aef[_0xb8fc('0x34')]['hasOwnProperty']('nolimit')){_0x8c8a55['limit']=qs[_0xb8fc('0x22')](_0xc34aef['query'][_0xb8fc('0x22')]);_0x8c8a55[_0xb8fc('0x20')]=qs['offset'](_0xc34aef['query'][_0xb8fc('0x20')]);}_0x8c8a55['order']=qs[_0xb8fc('0x3b')](_0xc34aef[_0xb8fc('0x34')][_0xb8fc('0x3b')]);_0x8c8a55[_0xb8fc('0x3c')]=qs[_0xb8fc('0x36')](_[_0xb8fc('0x3d')](_0xc34aef[_0xb8fc('0x34')],_0x1fceb0['filters']),_0x26d9c0);if(_0xc34aef[_0xb8fc('0x34')]['filter']){_0x8c8a55[_0xb8fc('0x3c')]=_[_0xb8fc('0x3e')](_0x8c8a55[_0xb8fc('0x3c')],{'$or':_[_0xb8fc('0x2d')](_0x26d9c0,function(_0x6832b1){if(_0x6832b1[_0xb8fc('0x30')]!=='VIRTUAL'){var _0x4a9625={};_0x4a9625[_0x6832b1[_0xb8fc('0x33')]]={'$like':'%'+_0xc34aef[_0xb8fc('0x34')][_0xb8fc('0x3f')]+'%'};return _0x4a9625;}})});}_0x8c8a55=_[_0xb8fc('0x3e')]({},_0x8c8a55,_0xc34aef['options']);var _0x57b55e={'where':_0x8c8a55[_0xb8fc('0x3c')]};return db[_0xb8fc('0x2e')]['count'](_0x57b55e)[_0xb8fc('0x27')](function(_0x3918bc){_0xb48a3['count']=_0x3918bc;if(_0xc34aef[_0xb8fc('0x34')][_0xb8fc('0x40')]){_0x8c8a55[_0xb8fc('0x41')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xb8fc('0x42')](_0x8c8a55);})['then'](function(_0x127a8d){_0xb48a3[_0xb8fc('0x43')]=_0x127a8d;return _0xb48a3;})[_0xb8fc('0x27')](respondWithFilteredResult(_0x38327f,_0x8c8a55))[_0xb8fc('0x44')](handleError(_0x38327f,null));};exports[_0xb8fc('0x45')]=function(_0xac3f07,_0x54d01a){var _0x16607e={'raw':![],'where':{'id':_0xac3f07[_0xb8fc('0x46')]['id']}},_0x1867b3={};_0x1867b3[_0xb8fc('0x32')]=_[_0xb8fc('0x35')](db['SalesforceAccount'][_0xb8fc('0x47')]);_0x1867b3[_0xb8fc('0x34')]=_[_0xb8fc('0x35')](_0xac3f07[_0xb8fc('0x34')]);_0x1867b3['filters']=_[_0xb8fc('0x37')](_0x1867b3['model'],_0x1867b3[_0xb8fc('0x34')]);_0x16607e['attributes']=_[_0xb8fc('0x37')](_0x1867b3[_0xb8fc('0x32')],qs['fields'](_0xac3f07[_0xb8fc('0x34')]['fields']));_0x16607e[_0xb8fc('0x38')]=_0x16607e['attributes']['length']?_0x16607e[_0xb8fc('0x38')]:_0x1867b3['model'];if(_0xac3f07['query'][_0xb8fc('0x40')]){_0x16607e[_0xb8fc('0x41')]=[{'all':!![]}];}_0x16607e=_[_0xb8fc('0x3e')]({},_0x16607e,_0xac3f07[_0xb8fc('0x48')]);return db[_0xb8fc('0x2e')][_0xb8fc('0x49')](_0x16607e)[_0xb8fc('0x27')](handleEntityNotFound(_0x54d01a,null))[_0xb8fc('0x27')](respondWithResult(_0x54d01a,null))[_0xb8fc('0x44')](handleError(_0x54d01a,null));};exports[_0xb8fc('0x4a')]=function(_0x2a8260,_0x3e4539){return db[_0xb8fc('0x2e')][_0xb8fc('0x4a')](_0x2a8260[_0xb8fc('0x4b')],{})[_0xb8fc('0x27')](respondWithResult(_0x3e4539,0xc9))['catch'](handleError(_0x3e4539,null));};exports['update']=function(_0x2f30a6,_0x4d0142){if(_0x2f30a6[_0xb8fc('0x4b')]['id']){delete _0x2f30a6[_0xb8fc('0x4b')]['id'];}return db['SalesforceAccount'][_0xb8fc('0x49')]({'where':{'id':_0x2f30a6[_0xb8fc('0x46')]['id']}})[_0xb8fc('0x27')](handleEntityNotFound(_0x4d0142,null))[_0xb8fc('0x27')](saveUpdates(_0x2f30a6[_0xb8fc('0x4b')],null))[_0xb8fc('0x27')](respondWithResult(_0x4d0142,null))[_0xb8fc('0x44')](handleError(_0x4d0142,null));};exports[_0xb8fc('0x28')]=function(_0x50a4a3,_0x46540f){return db[_0xb8fc('0x2e')][_0xb8fc('0x49')]({'where':{'id':_0x50a4a3[_0xb8fc('0x46')]['id']}})[_0xb8fc('0x27')](handleEntityNotFound(_0x46540f,null))['then'](removeEntity(_0x46540f,null))['catch'](handleError(_0x46540f,null));};exports['getConfigurations']=function(_0x61e60d,_0x5aae82,_0x22b92f){var _0x21d6a6={};var _0x3c5cda={};var _0x4a59b8;var _0x10778b;return db[_0xb8fc('0x2e')][_0xb8fc('0x4c')]({'where':{'id':_0x61e60d[_0xb8fc('0x46')]['id']}})[_0xb8fc('0x27')](handleEntityNotFound(_0x5aae82,null))[_0xb8fc('0x27')](function(_0x49b80e){if(_0x49b80e){_0x4a59b8=_0x49b80e;_0x3c5cda[_0xb8fc('0x32')]=_[_0xb8fc('0x35')](db['SalesforceConfiguration'][_0xb8fc('0x47')]);_0x3c5cda['query']=_[_0xb8fc('0x35')](_0x61e60d[_0xb8fc('0x34')]);_0x3c5cda['filters']=_[_0xb8fc('0x37')](_0x3c5cda[_0xb8fc('0x32')],_0x3c5cda['query']);_0x21d6a6[_0xb8fc('0x38')]=_['intersection'](_0x3c5cda[_0xb8fc('0x32')],qs[_0xb8fc('0x39')](_0x61e60d[_0xb8fc('0x34')][_0xb8fc('0x39')]));_0x21d6a6[_0xb8fc('0x38')]=_0x21d6a6[_0xb8fc('0x38')][_0xb8fc('0x3a')]?_0x21d6a6[_0xb8fc('0x38')]:_0x3c5cda[_0xb8fc('0x32')];_0x21d6a6[_0xb8fc('0x4d')]=qs[_0xb8fc('0x3b')](_0x61e60d['query'][_0xb8fc('0x3b')]);_0x21d6a6[_0xb8fc('0x3c')]=qs[_0xb8fc('0x36')](_[_0xb8fc('0x3d')](_0x61e60d[_0xb8fc('0x34')],_0x3c5cda['filters']));if(_0x61e60d[_0xb8fc('0x34')][_0xb8fc('0x3f')]){_0x21d6a6[_0xb8fc('0x3c')]=_[_0xb8fc('0x3e')](_0x21d6a6[_0xb8fc('0x3c')],{'$or':_['map'](_0x21d6a6[_0xb8fc('0x38')],function(_0x192d39){var _0x446def={};_0x446def[_0x192d39]={'$like':'%'+_0x61e60d[_0xb8fc('0x34')][_0xb8fc('0x3f')]+'%'};return _0x446def;})});}_0x21d6a6=_[_0xb8fc('0x3e')]({},_0x21d6a6,_0x61e60d[_0xb8fc('0x48')]);return _0x4a59b8[_0xb8fc('0x4e')](_0x21d6a6);}})[_0xb8fc('0x27')](function(_0x50856a){if(_0x50856a){_0x10778b=_0x50856a[_0xb8fc('0x3a')];if(!_0x61e60d[_0xb8fc('0x34')][_0xb8fc('0x4f')](_0xb8fc('0x50'))){_0x21d6a6['limit']=qs[_0xb8fc('0x22')](_0x61e60d['query']['limit']);_0x21d6a6[_0xb8fc('0x20')]=qs[_0xb8fc('0x20')](_0x61e60d[_0xb8fc('0x34')][_0xb8fc('0x20')]);}return _0x4a59b8[_0xb8fc('0x4e')](_0x21d6a6);}})['then'](function(_0x549fb6){if(_0x549fb6){return _0x549fb6?{'count':_0x10778b,'rows':_0x549fb6}:null;}})[_0xb8fc('0x27')](respondWithResult(_0x5aae82,null))[_0xb8fc('0x44')](handleError(_0x5aae82,null));};exports['addConfiguration']=function(_0x238391,_0x33d85b,_0x5d91f6){if(_0x238391['body']['id']){delete _0x238391[_0xb8fc('0x4b')]['id'];}return db[_0xb8fc('0x2e')][_0xb8fc('0x4c')]({'where':{'id':_0x238391[_0xb8fc('0x46')]['id']}})[_0xb8fc('0x27')](handleEntityNotFound(_0x33d85b,null))[_0xb8fc('0x27')](function(_0x233c26){if(_0x233c26){_0x238391[_0xb8fc('0x4b')][_0xb8fc('0x51')]=_0x233c26['id'];_0x238391[_0xb8fc('0x4b')][_0xb8fc('0x52')]=integrations[_0xb8fc('0x53')](_0x238391['body'][_0xb8fc('0x54')],_0x238391[_0xb8fc('0x4b')]['type']);_0x238391[_0xb8fc('0x4b')][_0xb8fc('0x55')]=integrations[_0xb8fc('0x56')](_0x238391[_0xb8fc('0x4b')]['channel'],_0x238391[_0xb8fc('0x4b')]['type']);return db[_0xb8fc('0x57')]['create'](_0x238391[_0xb8fc('0x4b')],{'include':[{'model':db['SalesforceField'],'as':_0xb8fc('0x52')},{'model':db[_0xb8fc('0x58')],'as':_0xb8fc('0x55')}]});}return null;})['then'](respondWithResult(_0x33d85b,null))['catch'](handleError(_0x33d85b,null));};exports[_0xb8fc('0x59')]=function(_0x224521,_0x52aa76,_0x277b3f){var _0x916993;var _0x29ee1='';var _0x10439f=_0xb8fc('0x5a');return db[_0xb8fc('0x2e')][_0xb8fc('0x4c')]({'where':{'id':_0x224521[_0xb8fc('0x46')]['id']},'attributes':['id','remoteUri',_0xb8fc('0x5b'),'clientSecret',_0xb8fc('0x5c'),_0xb8fc('0x5d'),_0xb8fc('0x5e')]})[_0xb8fc('0x27')](handleEntityNotFound(_0x52aa76,null))[_0xb8fc('0x27')](function(_0x5a639f){if(_0x5a639f){_0x29ee1=_0x5a639f[_0xb8fc('0x5f')];var _0x1cbaf1=_0x29ee1[_0xb8fc('0x60')](-0x1);if(_0x1cbaf1==='/'){_0x29ee1=_0x29ee1[_0xb8fc('0x61')](0x0,_0x29ee1[_0xb8fc('0x62')](_0x1cbaf1));}_0x916993=new jsforce['Connection']({'oauth2':{'loginUrl':_0x29ee1,'clientId':_0x5a639f[_0xb8fc('0x5b')],'clientSecret':_0x5a639f['clientSecret']}});return _0x916993[_0xb8fc('0x63')](_0x5a639f[_0xb8fc('0x5c')],_0x5a639f[_0xb8fc('0x5d')][_0xb8fc('0x64')](_0x5a639f[_0xb8fc('0x5e')]));}})[_0xb8fc('0x27')](function(_0x3dbf59){if(_0x3dbf59){if(!_[_0xb8fc('0x65')](_0x224521[_0xb8fc('0x34')][_0xb8fc('0x66')])){_0x10439f=_0x224521['query']['ticketType'];}return _0x916993['sobject'](_0x10439f)[_0xb8fc('0x67')]();}})['then'](function(_0x1c8ee3){var _0x39c250=['OwnerId',_0xb8fc('0x68'),'IsReminderSet','IsRecurrence','Subject','Description'];var _0x579ae9=[_0xb8fc('0x69'),'int',_0xb8fc('0x6a'),_0xb8fc('0x6b'),_0xb8fc('0x6c'),'textarea','phone'];if(_0x1c8ee3){_[_0xb8fc('0x6d')](_0x1c8ee3[_0xb8fc('0x39')],function(_0x34a482){return _0x39c250[_0xb8fc('0x6e')](_0x34a482[_0xb8fc('0x33')])||!_0x579ae9[_0xb8fc('0x6e')](_0x34a482[_0xb8fc('0x30')]);});return{'count':_0x1c8ee3[_0xb8fc('0x39')][_0xb8fc('0x3a')],'rows':_[_0xb8fc('0x2d')](_0x1c8ee3['fields'],function(_0xe3d3d){return{'id':_0xe3d3d[_0xb8fc('0x33')],'name':_0xe3d3d[_0xb8fc('0x6f')],'custom':_0xe3d3d[_0xb8fc('0x70')],'options':_0xe3d3d[_0xb8fc('0x71')]['length']>0x0?_[_0xb8fc('0x2d')](_0xe3d3d['picklistValues'],function(_0x7d092c){return{'name':_0x7d092c['label'],'value':_0x7d092c[_0xb8fc('0x72')]};}):_0xe3d3d[_0xb8fc('0x30')]=='boolean'?[{'name':'True','value':_0xb8fc('0x73')},{'name':_0xb8fc('0x74'),'value':_0xb8fc('0x75')}]:[]};})};}})[_0xb8fc('0x27')](respondWithResult(_0x52aa76,null))[_0xb8fc('0x44')](function(_0x426ca7){var _0x33e767=_0x224521[_0xb8fc('0x34')][_0xb8fc('0x76')]?0x1f4:_0x426ca7['statusCode']||0x1f4;logger[_0xb8fc('0x29')](_0xb8fc('0x77'),_0xb8fc('0x59'),_0x33e767,JSON[_0xb8fc('0x78')](_0x426ca7));delete _0x426ca7[_0xb8fc('0x33')];if(_0x33e767===0x191){_0x33e767=0x190;}_0x52aa76['status'](_0x33e767)[_0xb8fc('0x2b')](_0x224521[_0xb8fc('0x34')][_0xb8fc('0x76')]?{'message':_0xb8fc('0x79'),'statusCode':_0x426ca7[_0xb8fc('0x7a')]}:_0x426ca7);});}; \ No newline at end of file +var _0x357f=['True','false','test','statusCode','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','rawAttributes','options','find','create','body','params','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','Connection','login','password','concat','ticketType','sobject','describe','IsReminderSet','IsRecurrence','Subject','Description','string','boolean','textarea','remove','includes','label','custom','picklistValues','value'];(function(_0x36b02d,_0xacf919){var _0x32fcc3=function(_0x390c8d){while(--_0x390c8d){_0x36b02d['push'](_0x36b02d['shift']());}};_0x32fcc3(++_0xacf919);}(_0x357f,0x81));var _0xf357=function(_0x113821,_0xaedd0e){_0x113821=_0x113821-0x0;var _0x3589e6=_0x357f[_0x113821];return _0x3589e6;};'use strict';var emlformat=require(_0xf357('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf357('0x1'));var rp=require(_0xf357('0x2'));var moment=require(_0xf357('0x3'));var BPromise=require(_0xf357('0x4'));var Mustache=require(_0xf357('0x5'));var util=require(_0xf357('0x6'));var path=require(_0xf357('0x7'));var sox=require(_0xf357('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf357('0x9'));var _=require(_0xf357('0xa'));var squel=require(_0xf357('0xb'));var crypto=require(_0xf357('0xc'));var jsforce=require(_0xf357('0xd'));var deskjs=require(_0xf357('0xe'));var toCsv=require(_0xf357('0xf'));var querystring=require(_0xf357('0x10'));var Papa=require(_0xf357('0x11'));var Redis=require(_0xf357('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf357('0x13'));var as=require(_0xf357('0x14'));var hardwareService=require(_0xf357('0x15'));var logger=require(_0xf357('0x16'))('api');var utils=require(_0xf357('0x17'));var config=require(_0xf357('0x18'));var licenseUtil=require(_0xf357('0x19'));var db=require(_0xf357('0x1a'))['db'];var integrations=require(_0xf357('0x1b'));function respondWithStatusCode(_0x5ebec7,_0x5cb5dd){_0x5cb5dd=_0x5cb5dd||0xcc;return function(_0x1aed93){if(_0x1aed93){return _0x5ebec7[_0xf357('0x1c')](_0x5cb5dd);}return _0x5ebec7[_0xf357('0x1d')](_0x5cb5dd)['end']();};}function respondWithResult(_0x1e695e,_0x3fdbec){_0x3fdbec=_0x3fdbec||0xc8;return function(_0x4d31a5){if(_0x4d31a5){return _0x1e695e[_0xf357('0x1d')](_0x3fdbec)[_0xf357('0x1e')](_0x4d31a5);}};}function respondWithFilteredResult(_0x32d30f,_0x1b33de){return function(_0x432aab){if(_0x432aab){var _0x312a76=typeof _0x1b33de[_0xf357('0x1f')]===_0xf357('0x20')&&typeof _0x1b33de[_0xf357('0x21')]===_0xf357('0x20');var _0x357a22=_0x432aab[_0xf357('0x22')];var _0x89683a=_0x312a76?0x0:_0x1b33de[_0xf357('0x1f')];var _0x4c019f=_0x312a76?_0x432aab['count']:_0x1b33de[_0xf357('0x1f')]+_0x1b33de[_0xf357('0x21')];var _0x323dee;if(_0x4c019f>=_0x357a22){_0x4c019f=_0x357a22;_0x323dee=0xc8;}else{_0x323dee=0xce;}_0x32d30f[_0xf357('0x1d')](_0x323dee);return _0x32d30f[_0xf357('0x23')](_0xf357('0x24'),_0x89683a+'-'+_0x4c019f+'/'+_0x357a22)[_0xf357('0x1e')](_0x432aab);}return null;};}function patchUpdates(_0x22e025){return function(_0x3433a0){try{jsonpatch[_0xf357('0x25')](_0x3433a0,_0x22e025,!![]);}catch(_0x54ec2d){return BPromise[_0xf357('0x26')](_0x54ec2d);}return _0x3433a0[_0xf357('0x27')]();};}function saveUpdates(_0x5cd0bc,_0x29148b){return function(_0x51126f){if(_0x51126f){return _0x51126f[_0xf357('0x28')](_0x5cd0bc)['then'](function(_0x539e0b){return _0x539e0b;});}return null;};}function removeEntity(_0x1171f7,_0x3efcc3){return function(_0x313aa9){if(_0x313aa9){return _0x313aa9[_0xf357('0x29')]()[_0xf357('0x2a')](function(){_0x1171f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x74c8e,_0xe85d94){return function(_0x47aff2){if(!_0x47aff2){_0x74c8e[_0xf357('0x1c')](0x194);}return _0x47aff2;};}function handleError(_0x108fd2,_0x54e6d0){_0x54e6d0=_0x54e6d0||0x1f4;return function(_0x267740){logger[_0xf357('0x2b')](_0x267740[_0xf357('0x2c')]);if(_0x267740[_0xf357('0x2d')]){delete _0x267740[_0xf357('0x2d')];}_0x108fd2[_0xf357('0x1d')](_0x54e6d0)[_0xf357('0x2e')](_0x267740);};}exports[_0xf357('0x2f')]=function(_0x5adeaa,_0x17f634){var _0x38e44f={},_0x480265={},_0xd9f58b={'count':0x0,'rows':[]};var _0x3db0b0=_[_0xf357('0x30')](db[_0xf357('0x31')]['rawAttributes'],function(_0x34fc58){return{'name':_0x34fc58[_0xf357('0x32')],'type':_0x34fc58[_0xf357('0x33')]['key']};});_0x480265[_0xf357('0x34')]=_['map'](_0x3db0b0,_0xf357('0x2d'));_0x480265[_0xf357('0x35')]=_[_0xf357('0x36')](_0x5adeaa[_0xf357('0x35')]);_0x480265[_0xf357('0x37')]=_[_0xf357('0x38')](_0x480265['model'],_0x480265[_0xf357('0x35')]);_0x38e44f[_0xf357('0x39')]=_[_0xf357('0x38')](_0x480265[_0xf357('0x34')],qs[_0xf357('0x3a')](_0x5adeaa[_0xf357('0x35')][_0xf357('0x3a')]));_0x38e44f[_0xf357('0x39')]=_0x38e44f[_0xf357('0x39')][_0xf357('0x3b')]?_0x38e44f[_0xf357('0x39')]:_0x480265[_0xf357('0x34')];if(!_0x5adeaa[_0xf357('0x35')][_0xf357('0x3c')](_0xf357('0x3d'))){_0x38e44f[_0xf357('0x21')]=qs[_0xf357('0x21')](_0x5adeaa['query']['limit']);_0x38e44f[_0xf357('0x1f')]=qs[_0xf357('0x1f')](_0x5adeaa['query']['offset']);}_0x38e44f[_0xf357('0x3e')]=qs[_0xf357('0x3f')](_0x5adeaa[_0xf357('0x35')][_0xf357('0x3f')]);_0x38e44f['where']=qs[_0xf357('0x37')](_[_0xf357('0x40')](_0x5adeaa[_0xf357('0x35')],_0x480265[_0xf357('0x37')]),_0x3db0b0);if(_0x5adeaa[_0xf357('0x35')][_0xf357('0x41')]){_0x38e44f[_0xf357('0x42')]=_['merge'](_0x38e44f['where'],{'$or':_[_0xf357('0x30')](_0x3db0b0,function(_0x22be39){if(_0x22be39[_0xf357('0x33')]!==_0xf357('0x43')){var _0x337c95={};_0x337c95[_0x22be39[_0xf357('0x2d')]]={'$like':'%'+_0x5adeaa['query'][_0xf357('0x41')]+'%'};return _0x337c95;}})});}_0x38e44f=_[_0xf357('0x44')]({},_0x38e44f,_0x5adeaa['options']);var _0x19f801={'where':_0x38e44f[_0xf357('0x42')]};return db[_0xf357('0x31')][_0xf357('0x22')](_0x19f801)['then'](function(_0x6f912c){_0xd9f58b[_0xf357('0x22')]=_0x6f912c;if(_0x5adeaa[_0xf357('0x35')][_0xf357('0x45')]){_0x38e44f[_0xf357('0x46')]=[{'all':!![]}];}return db[_0xf357('0x31')]['findAll'](_0x38e44f);})['then'](function(_0x4be6bf){_0xd9f58b[_0xf357('0x47')]=_0x4be6bf;return _0xd9f58b;})[_0xf357('0x2a')](respondWithFilteredResult(_0x17f634,_0x38e44f))[_0xf357('0x48')](handleError(_0x17f634,null));};exports[_0xf357('0x49')]=function(_0x12da00,_0xd3fd58){var _0x363e54={'raw':![],'where':{'id':_0x12da00['params']['id']}},_0x24f119={};_0x24f119[_0xf357('0x34')]=_['keys'](db[_0xf357('0x31')][_0xf357('0x4a')]);_0x24f119[_0xf357('0x35')]=_[_0xf357('0x36')](_0x12da00['query']);_0x24f119[_0xf357('0x37')]=_[_0xf357('0x38')](_0x24f119[_0xf357('0x34')],_0x24f119[_0xf357('0x35')]);_0x363e54['attributes']=_[_0xf357('0x38')](_0x24f119['model'],qs[_0xf357('0x3a')](_0x12da00[_0xf357('0x35')][_0xf357('0x3a')]));_0x363e54[_0xf357('0x39')]=_0x363e54[_0xf357('0x39')][_0xf357('0x3b')]?_0x363e54[_0xf357('0x39')]:_0x24f119[_0xf357('0x34')];if(_0x12da00[_0xf357('0x35')][_0xf357('0x45')]){_0x363e54[_0xf357('0x46')]=[{'all':!![]}];}_0x363e54=_[_0xf357('0x44')]({},_0x363e54,_0x12da00[_0xf357('0x4b')]);return db['SalesforceAccount'][_0xf357('0x4c')](_0x363e54)[_0xf357('0x2a')](handleEntityNotFound(_0xd3fd58,null))[_0xf357('0x2a')](respondWithResult(_0xd3fd58,null))['catch'](handleError(_0xd3fd58,null));};exports[_0xf357('0x4d')]=function(_0x112afa,_0x5c8706){return db[_0xf357('0x31')][_0xf357('0x4d')](_0x112afa[_0xf357('0x4e')],{})[_0xf357('0x2a')](respondWithResult(_0x5c8706,0xc9))['catch'](handleError(_0x5c8706,null));};exports[_0xf357('0x28')]=function(_0x5eb7af,_0x31c2b6){if(_0x5eb7af[_0xf357('0x4e')]['id']){delete _0x5eb7af[_0xf357('0x4e')]['id'];}return db[_0xf357('0x31')]['find']({'where':{'id':_0x5eb7af[_0xf357('0x4f')]['id']}})[_0xf357('0x2a')](handleEntityNotFound(_0x31c2b6,null))['then'](saveUpdates(_0x5eb7af[_0xf357('0x4e')],null))[_0xf357('0x2a')](respondWithResult(_0x31c2b6,null))['catch'](handleError(_0x31c2b6,null));};exports[_0xf357('0x29')]=function(_0x1d6f0a,_0x200e34){return db[_0xf357('0x31')][_0xf357('0x4c')]({'where':{'id':_0x1d6f0a[_0xf357('0x4f')]['id']}})[_0xf357('0x2a')](handleEntityNotFound(_0x200e34,null))[_0xf357('0x2a')](removeEntity(_0x200e34,null))[_0xf357('0x48')](handleError(_0x200e34,null));};exports[_0xf357('0x50')]=function(_0x322da7,_0x321fbe,_0x8ce5a6){var _0x151c7a={};var _0x276e4e={};var _0x2a6dac;var _0x37b873;return db[_0xf357('0x31')]['findOne']({'where':{'id':_0x322da7[_0xf357('0x4f')]['id']}})['then'](handleEntityNotFound(_0x321fbe,null))[_0xf357('0x2a')](function(_0x7b309d){if(_0x7b309d){_0x2a6dac=_0x7b309d;_0x276e4e['model']=_[_0xf357('0x36')](db[_0xf357('0x51')][_0xf357('0x4a')]);_0x276e4e[_0xf357('0x35')]=_[_0xf357('0x36')](_0x322da7[_0xf357('0x35')]);_0x276e4e[_0xf357('0x37')]=_[_0xf357('0x38')](_0x276e4e['model'],_0x276e4e[_0xf357('0x35')]);_0x151c7a[_0xf357('0x39')]=_[_0xf357('0x38')](_0x276e4e[_0xf357('0x34')],qs[_0xf357('0x3a')](_0x322da7[_0xf357('0x35')]['fields']));_0x151c7a[_0xf357('0x39')]=_0x151c7a['attributes'][_0xf357('0x3b')]?_0x151c7a[_0xf357('0x39')]:_0x276e4e['model'];_0x151c7a[_0xf357('0x3e')]=qs['sort'](_0x322da7['query']['sort']);_0x151c7a[_0xf357('0x42')]=qs['filters'](_['pick'](_0x322da7[_0xf357('0x35')],_0x276e4e['filters']));if(_0x322da7[_0xf357('0x35')][_0xf357('0x41')]){_0x151c7a[_0xf357('0x42')]=_[_0xf357('0x44')](_0x151c7a[_0xf357('0x42')],{'$or':_['map'](_0x151c7a[_0xf357('0x39')],function(_0x36955c){var _0x51aeed={};_0x51aeed[_0x36955c]={'$like':'%'+_0x322da7[_0xf357('0x35')][_0xf357('0x41')]+'%'};return _0x51aeed;})});}_0x151c7a=_[_0xf357('0x44')]({},_0x151c7a,_0x322da7['options']);return _0x2a6dac[_0xf357('0x50')](_0x151c7a);}})[_0xf357('0x2a')](function(_0x4d1c73){if(_0x4d1c73){_0x37b873=_0x4d1c73[_0xf357('0x3b')];if(!_0x322da7[_0xf357('0x35')][_0xf357('0x3c')](_0xf357('0x3d'))){_0x151c7a['limit']=qs[_0xf357('0x21')](_0x322da7[_0xf357('0x35')]['limit']);_0x151c7a[_0xf357('0x1f')]=qs[_0xf357('0x1f')](_0x322da7['query'][_0xf357('0x1f')]);}return _0x2a6dac['getConfigurations'](_0x151c7a);}})[_0xf357('0x2a')](function(_0x300b1f){if(_0x300b1f){return _0x300b1f?{'count':_0x37b873,'rows':_0x300b1f}:null;}})[_0xf357('0x2a')](respondWithResult(_0x321fbe,null))[_0xf357('0x48')](handleError(_0x321fbe,null));};exports[_0xf357('0x52')]=function(_0x4c852a,_0x534167,_0x22291a){if(_0x4c852a[_0xf357('0x4e')]['id']){delete _0x4c852a['body']['id'];}return db[_0xf357('0x31')][_0xf357('0x53')]({'where':{'id':_0x4c852a[_0xf357('0x4f')]['id']}})['then'](handleEntityNotFound(_0x534167,null))[_0xf357('0x2a')](function(_0x39eb86){if(_0x39eb86){_0x4c852a[_0xf357('0x4e')][_0xf357('0x54')]=_0x39eb86['id'];_0x4c852a[_0xf357('0x4e')]['Subjects']=integrations['getSubjects'](_0x4c852a[_0xf357('0x4e')][_0xf357('0x55')],_0x4c852a[_0xf357('0x4e')]['type']);_0x4c852a['body'][_0xf357('0x56')]=integrations[_0xf357('0x57')](_0x4c852a[_0xf357('0x4e')][_0xf357('0x55')],_0x4c852a['body'][_0xf357('0x33')]);return db[_0xf357('0x51')][_0xf357('0x4d')](_0x4c852a['body'],{'include':[{'model':db[_0xf357('0x58')],'as':_0xf357('0x59')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xf357('0x2a')](respondWithResult(_0x534167,null))[_0xf357('0x48')](handleError(_0x534167,null));};exports[_0xf357('0x5a')]=function(_0x2a4163,_0x52f63b,_0x4001c7){var _0x10e983;var _0x17aa36='';var _0x5ba8c5=_0xf357('0x5b');return db[_0xf357('0x31')]['findOne']({'where':{'id':_0x2a4163['params']['id']},'attributes':['id',_0xf357('0x5c'),_0xf357('0x5d'),_0xf357('0x5e'),_0xf357('0x5f'),'password',_0xf357('0x60')]})[_0xf357('0x2a')](handleEntityNotFound(_0x52f63b,null))[_0xf357('0x2a')](function(_0x55320f){if(_0x55320f){_0x17aa36=_0x55320f[_0xf357('0x5c')];var _0x3e05c7=_0x17aa36[_0xf357('0x61')](-0x1);if(_0x3e05c7==='/'){_0x17aa36=_0x17aa36[_0xf357('0x62')](0x0,_0x17aa36['lastIndexOf'](_0x3e05c7));}_0x10e983=new jsforce[(_0xf357('0x63'))]({'oauth2':{'loginUrl':_0x17aa36,'clientId':_0x55320f[_0xf357('0x5d')],'clientSecret':_0x55320f[_0xf357('0x5e')]}});return _0x10e983[_0xf357('0x64')](_0x55320f['username'],_0x55320f[_0xf357('0x65')][_0xf357('0x66')](_0x55320f['securityToken']));}})[_0xf357('0x2a')](function(_0x3dc9e8){if(_0x3dc9e8){if(!_['isNil'](_0x2a4163['query'][_0xf357('0x67')])){_0x5ba8c5=_0x2a4163[_0xf357('0x35')][_0xf357('0x67')];}return _0x10e983[_0xf357('0x68')](_0x5ba8c5)[_0xf357('0x69')]();}})[_0xf357('0x2a')](function(_0x5bae56){var _0x5f3d56=['OwnerId','ActivityDate',_0xf357('0x6a'),_0xf357('0x6b'),_0xf357('0x6c'),_0xf357('0x6d')];var _0x37b4b9=[_0xf357('0x6e'),'int','picklist',_0xf357('0x6f'),'email',_0xf357('0x70'),'phone'];if(_0x5bae56){_[_0xf357('0x71')](_0x5bae56['fields'],function(_0x33e658){return _0x5f3d56[_0xf357('0x72')](_0x33e658[_0xf357('0x2d')])||!_0x37b4b9[_0xf357('0x72')](_0x33e658[_0xf357('0x33')]);});return{'count':_0x5bae56[_0xf357('0x3a')][_0xf357('0x3b')],'rows':_[_0xf357('0x30')](_0x5bae56[_0xf357('0x3a')],function(_0x5086d7){return{'id':_0x5086d7['name'],'name':_0x5086d7[_0xf357('0x73')],'custom':_0x5086d7[_0xf357('0x74')],'options':_0x5086d7[_0xf357('0x75')][_0xf357('0x3b')]>0x0?_['map'](_0x5086d7['picklistValues'],function(_0x22b073){return{'name':_0x22b073[_0xf357('0x73')],'value':_0x22b073[_0xf357('0x76')]};}):_0x5086d7[_0xf357('0x33')]==_0xf357('0x6f')?[{'name':_0xf357('0x77'),'value':'true'},{'name':'False','value':_0xf357('0x78')}]:[]};})};}})['then'](respondWithResult(_0x52f63b,null))[_0xf357('0x48')](function(_0xd5796c){var _0x106897=_0x2a4163[_0xf357('0x35')][_0xf357('0x79')]?0x1f4:_0xd5796c[_0xf357('0x7a')]||0x1f4;logger[_0xf357('0x2b')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x106897,JSON['stringify'](_0xd5796c));delete _0xd5796c[_0xf357('0x2d')];if(_0x106897===0x191){_0x106897=0x190;}_0x52f63b[_0xf357('0x1d')](_0x106897)['send'](_0x2a4163[_0xf357('0x35')][_0xf357('0x79')]?{'message':_0xf357('0x7b'),'statusCode':_0xd5796c['statusCode']}:_0xd5796c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a3c95e4..eafe3a1 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 _0x15f9=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x161e88,_0x49ce5e){var _0x40ee62=function(_0x2c4660){while(--_0x2c4660){_0x161e88['push'](_0x161e88['shift']());}};_0x40ee62(++_0x49ce5e);}(_0x15f9,0x150));var _0x915f=function(_0x36e556,_0x4e5c6d){_0x36e556=_0x36e556-0x0;var _0xbc83ca=_0x15f9[_0x36e556];return _0xbc83ca;};'use strict';var _=require(_0x915f('0x0'));var util=require(_0x915f('0x1'));var logger=require(_0x915f('0x2'))(_0x915f('0x3'));var moment=require(_0x915f('0x4'));var BPromise=require(_0x915f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x915f('0x6'));var rimraf=require(_0x915f('0x7'));var config=require(_0x915f('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x915f('0x9'));module['exports']=function(_0x19f0c4,_0x32d69e){return _0x19f0c4[_0x915f('0xa')](_0x915f('0xb'),attributes,{'tableName':_0x915f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a7b=['int_salesforce_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount'];(function(_0x3fdf3f,_0x55b37b){var _0x4f32b8=function(_0x2d94f7){while(--_0x2d94f7){_0x3fdf3f['push'](_0x3fdf3f['shift']());}};_0x4f32b8(++_0x55b37b);}(_0x6a7b,0x9d));var _0xb6a7=function(_0x52572a,_0x464dff){_0x52572a=_0x52572a-0x0;var _0x27f1b3=_0x6a7b[_0x52572a];return _0x27f1b3;};'use strict';var _=require(_0xb6a7('0x0'));var util=require('util');var logger=require(_0xb6a7('0x1'))(_0xb6a7('0x2'));var moment=require('moment');var BPromise=require(_0xb6a7('0x3'));var rp=require(_0xb6a7('0x4'));var fs=require('fs');var path=require(_0xb6a7('0x5'));var rimraf=require(_0xb6a7('0x6'));var config=require(_0xb6a7('0x7'));var attributes=require(_0xb6a7('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xb6a7('0x9')]=function(_0x1157a4,_0x4f4a8c){return _0x1157a4[_0xb6a7('0xa')](_0xb6a7('0xb'),attributes,{'tableName':_0xb6a7('0xc'),'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 5b1fe64..70cb489 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 _0x0384=['include','map','model','ShowSalesforceAccount','find','raw','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','where','attributes','limit'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0x0384,0x1e2));var _0x4038=function(_0x40464e,_0x2b058d){_0x40464e=_0x40464e-0x0;var _0x1324c3=_0x0384[_0x40464e];return _0x1324c3;};'use strict';var _=require(_0x4038('0x0'));var util=require('util');var moment=require(_0x4038('0x1'));var BPromise=require(_0x4038('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4038('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4038('0x4'));var logger=require(_0x4038('0x5'))(_0x4038('0x6'));var config=require(_0x4038('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4038('0x8')][_0x4038('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4556d6,_0x5a9146,_0x1623d1){return new BPromise(function(_0x2ab7e8,_0x4855be){return client[_0x4038('0xa')](_0x4556d6,_0x1623d1)[_0x4038('0xb')](function(_0xa03043){logger[_0x4038('0xc')](_0x4038('0xd'),_0x5a9146,_0x4038('0xe'));logger['debug'](_0x4038('0xf'),_0x5a9146,'request\x20sent',JSON[_0x4038('0x10')](_0xa03043));if(_0xa03043[_0x4038('0x11')]){if(_0xa03043[_0x4038('0x11')][_0x4038('0x12')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x5a9146,_0xa03043['error'][_0x4038('0x13')]);return _0x4855be(_0xa03043['error'][_0x4038('0x13')]);}logger[_0x4038('0x11')](_0x4038('0xd'),_0x5a9146,_0xa03043[_0x4038('0x11')][_0x4038('0x13')]);return _0x2ab7e8(_0xa03043['error'][_0x4038('0x13')]);}else{logger[_0x4038('0xc')](_0x4038('0xd'),_0x5a9146,_0x4038('0xe'));_0x2ab7e8(_0xa03043[_0x4038('0x14')]['message']);}})[_0x4038('0x15')](function(_0x4cfe73){logger[_0x4038('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x5a9146,_0x4cfe73);_0x4855be(_0x4cfe73);});});}exports[_0x4038('0x16')]=function(_0x5aac6b){var _0x98a696=this;return new Promise(function(_0x3d39a0,_0x2365a7){return db[_0x4038('0x17')]['findAll']({'raw':_0x5aac6b[_0x4038('0x18')]?_0x5aac6b[_0x4038('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5aac6b[_0x4038('0x18')]?_0x5aac6b[_0x4038('0x18')][_0x4038('0x19')]||null:null,'attributes':_0x5aac6b[_0x4038('0x18')]?_0x5aac6b[_0x4038('0x18')][_0x4038('0x1a')]||null:null,'limit':_0x5aac6b[_0x4038('0x18')]?_0x5aac6b[_0x4038('0x18')][_0x4038('0x1b')]||null:null,'include':_0x5aac6b[_0x4038('0x18')]?_0x5aac6b[_0x4038('0x18')][_0x4038('0x1c')]?_[_0x4038('0x1d')](_0x5aac6b['options'][_0x4038('0x1c')],function(_0x12a0f0){return{'model':db[_0x12a0f0[_0x4038('0x1e')]],'as':_0x12a0f0['as'],'attributes':_0x12a0f0[_0x4038('0x1a')],'include':_0x12a0f0[_0x4038('0x1c')]?_['map'](_0x12a0f0[_0x4038('0x1c')],function(_0x324b99){return{'model':db[_0x324b99[_0x4038('0x1e')]],'as':_0x324b99['as'],'attributes':_0x324b99[_0x4038('0x1a')],'include':_0x324b99[_0x4038('0x1c')]?_[_0x4038('0x1d')](_0x324b99[_0x4038('0x1c')],function(_0x57a10f){return{'model':db[_0x57a10f[_0x4038('0x1e')]],'as':_0x57a10f['as'],'attributes':_0x57a10f[_0x4038('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4038('0xb')](function(_0x464cef){logger[_0x4038('0xc')]('GetSalesforceAccount',_0x5aac6b);logger['debug'](_0x4038('0x16'),_0x5aac6b,JSON['stringify'](_0x464cef));_0x3d39a0(_0x464cef);})[_0x4038('0x15')](function(_0x30ff11){logger[_0x4038('0x11')](_0x4038('0x16'),_0x30ff11[_0x4038('0x13')],_0x5aac6b);_0x2365a7(_0x98a696[_0x4038('0x11')](0x1f4,_0x30ff11[_0x4038('0x13')]));});});};exports[_0x4038('0x1f')]=function(_0x3dff51){var _0x35c36b=this;return new Promise(function(_0x14bfe0,_0x100dd4){return db[_0x4038('0x17')][_0x4038('0x20')]({'raw':_0x3dff51[_0x4038('0x18')]?_0x3dff51[_0x4038('0x18')][_0x4038('0x21')]===undefined?!![]:![]:!![],'where':_0x3dff51[_0x4038('0x18')]?_0x3dff51[_0x4038('0x18')]['where']||null:null,'attributes':_0x3dff51['options']?_0x3dff51[_0x4038('0x18')][_0x4038('0x1a')]||null:null,'include':_0x3dff51[_0x4038('0x18')]?_0x3dff51[_0x4038('0x18')][_0x4038('0x1c')]?_[_0x4038('0x1d')](_0x3dff51[_0x4038('0x18')]['include'],function(_0x3773c8){return{'model':db[_0x3773c8[_0x4038('0x1e')]],'as':_0x3773c8['as'],'attributes':_0x3773c8['attributes'],'include':_0x3773c8[_0x4038('0x1c')]?_[_0x4038('0x1d')](_0x3773c8[_0x4038('0x1c')],function(_0x1bdf66){return{'model':db[_0x1bdf66[_0x4038('0x1e')]],'as':_0x1bdf66['as'],'attributes':_0x1bdf66[_0x4038('0x1a')],'include':_0x1bdf66[_0x4038('0x1c')]?_['map'](_0x1bdf66[_0x4038('0x1c')],function(_0x26aa78){return{'model':db[_0x26aa78[_0x4038('0x1e')]],'as':_0x26aa78['as'],'attributes':_0x26aa78[_0x4038('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4038('0xb')](function(_0x513346){logger[_0x4038('0xc')](_0x4038('0x1f'),_0x3dff51);logger['debug'](_0x4038('0x1f'),_0x3dff51,JSON[_0x4038('0x10')](_0x513346));_0x14bfe0(_0x513346);})[_0x4038('0x15')](function(_0x18ce16){logger[_0x4038('0x11')](_0x4038('0x1f'),_0x18ce16[_0x4038('0x13')],_0x3dff51);_0x100dd4(_0x35c36b[_0x4038('0x11')](0x1f4,_0x18ce16['message']));});});}; \ No newline at end of file +var _0x24d7=['map','model','then','ShowSalesforceAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x43a403,_0x1f00a4){var _0x40d4cd=function(_0x50db59){while(--_0x50db59){_0x43a403['push'](_0x43a403['shift']());}};_0x40d4cd(++_0x1f00a4);}(_0x24d7,0xb3));var _0x724d=function(_0x1e85e2,_0x441be4){_0x1e85e2=_0x1e85e2-0x0;var _0x3a7a31=_0x24d7[_0x1e85e2];return _0x3a7a31;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x724d('0x0'));var BPromise=require(_0x724d('0x1'));var rs=require(_0x724d('0x2'));var fs=require('fs');var Redis=require(_0x724d('0x3'));var db=require(_0x724d('0x4'))['db'];var utils=require(_0x724d('0x5'));var logger=require(_0x724d('0x6'))('rpc');var config=require(_0x724d('0x7'));var jayson=require(_0x724d('0x8'));var client=jayson[_0x724d('0x9')][_0x724d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6a5534,_0x443938,_0x309022){return new BPromise(function(_0x2210da,_0x2a619c){return client['request'](_0x6a5534,_0x309022)['then'](function(_0x5f52a0){logger[_0x724d('0xb')](_0x724d('0xc'),_0x443938,_0x724d('0xd'));logger[_0x724d('0xe')](_0x724d('0xf'),_0x443938,_0x724d('0xd'),JSON[_0x724d('0x10')](_0x5f52a0));if(_0x5f52a0[_0x724d('0x11')]){if(_0x5f52a0[_0x724d('0x11')][_0x724d('0x12')]===0x1f4){logger[_0x724d('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x443938,_0x5f52a0[_0x724d('0x11')]['message']);return _0x2a619c(_0x5f52a0['error'][_0x724d('0x13')]);}logger[_0x724d('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x443938,_0x5f52a0[_0x724d('0x11')][_0x724d('0x13')]);return _0x2210da(_0x5f52a0['error'][_0x724d('0x13')]);}else{logger[_0x724d('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x443938,'request\x20sent');_0x2210da(_0x5f52a0[_0x724d('0x14')][_0x724d('0x13')]);}})[_0x724d('0x15')](function(_0x5777b1){logger[_0x724d('0x11')](_0x724d('0xc'),_0x443938,_0x5777b1);_0x2a619c(_0x5777b1);});});}exports[_0x724d('0x16')]=function(_0x26b6e8){var _0x5d4351=this;return new Promise(function(_0x4ef218,_0x55d6b1){return db[_0x724d('0x17')][_0x724d('0x18')]({'raw':_0x26b6e8[_0x724d('0x19')]?_0x26b6e8[_0x724d('0x19')][_0x724d('0x1a')]===undefined?!![]:![]:!![],'where':_0x26b6e8[_0x724d('0x19')]?_0x26b6e8[_0x724d('0x19')][_0x724d('0x1b')]||null:null,'attributes':_0x26b6e8[_0x724d('0x19')]?_0x26b6e8[_0x724d('0x19')][_0x724d('0x1c')]||null:null,'limit':_0x26b6e8[_0x724d('0x19')]?_0x26b6e8[_0x724d('0x19')][_0x724d('0x1d')]||null:null,'include':_0x26b6e8[_0x724d('0x19')]?_0x26b6e8[_0x724d('0x19')][_0x724d('0x1e')]?_[_0x724d('0x1f')](_0x26b6e8['options'][_0x724d('0x1e')],function(_0x49bbba){return{'model':db[_0x49bbba['model']],'as':_0x49bbba['as'],'attributes':_0x49bbba['attributes'],'include':_0x49bbba[_0x724d('0x1e')]?_[_0x724d('0x1f')](_0x49bbba[_0x724d('0x1e')],function(_0x1b1999){return{'model':db[_0x1b1999[_0x724d('0x20')]],'as':_0x1b1999['as'],'attributes':_0x1b1999[_0x724d('0x1c')],'include':_0x1b1999[_0x724d('0x1e')]?_[_0x724d('0x1f')](_0x1b1999['include'],function(_0x2d58d7){return{'model':db[_0x2d58d7[_0x724d('0x20')]],'as':_0x2d58d7['as'],'attributes':_0x2d58d7[_0x724d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x724d('0x21')](function(_0xa23337){logger[_0x724d('0xb')](_0x724d('0x16'),_0x26b6e8);logger[_0x724d('0xe')](_0x724d('0x16'),_0x26b6e8,JSON[_0x724d('0x10')](_0xa23337));_0x4ef218(_0xa23337);})['catch'](function(_0xf7c926){logger[_0x724d('0x11')](_0x724d('0x16'),_0xf7c926['message'],_0x26b6e8);_0x55d6b1(_0x5d4351[_0x724d('0x11')](0x1f4,_0xf7c926['message']));});});};exports['ShowSalesforceAccount']=function(_0x1a82eb){var _0x1d2a4d=this;return new Promise(function(_0x24a006,_0x9fdade){return db['SalesforceAccount']['find']({'raw':_0x1a82eb[_0x724d('0x19')]?_0x1a82eb[_0x724d('0x19')][_0x724d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a82eb['options']?_0x1a82eb[_0x724d('0x19')][_0x724d('0x1b')]||null:null,'attributes':_0x1a82eb[_0x724d('0x19')]?_0x1a82eb['options'][_0x724d('0x1c')]||null:null,'include':_0x1a82eb[_0x724d('0x19')]?_0x1a82eb[_0x724d('0x19')][_0x724d('0x1e')]?_[_0x724d('0x1f')](_0x1a82eb['options'][_0x724d('0x1e')],function(_0x465a58){return{'model':db[_0x465a58[_0x724d('0x20')]],'as':_0x465a58['as'],'attributes':_0x465a58[_0x724d('0x1c')],'include':_0x465a58['include']?_[_0x724d('0x1f')](_0x465a58['include'],function(_0x1cae8a){return{'model':db[_0x1cae8a[_0x724d('0x20')]],'as':_0x1cae8a['as'],'attributes':_0x1cae8a[_0x724d('0x1c')],'include':_0x1cae8a[_0x724d('0x1e')]?_[_0x724d('0x1f')](_0x1cae8a[_0x724d('0x1e')],function(_0x3664ed){return{'model':db[_0x3664ed['model']],'as':_0x3664ed['as'],'attributes':_0x3664ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x724d('0x21')](function(_0x39f83d){logger['info'](_0x724d('0x22'),_0x1a82eb);logger['debug']('ShowSalesforceAccount',_0x1a82eb,JSON[_0x724d('0x10')](_0x39f83d));_0x24a006(_0x39f83d);})[_0x724d('0x15')](function(_0x5efac1){logger[_0x724d('0x11')]('ShowSalesforceAccount',_0x5efac1['message'],_0x1a82eb);_0x9fdade(_0x1d2a4d['error'](0x1f4,_0x5efac1[_0x724d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d0037e0..aaff1c5 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x0b0e[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x42aab8,_0x3b3c92){var _0x30225c=function(_0x256ce4){while(--_0x256ce4){_0x42aab8['push'](_0x42aab8['shift']());}};_0x30225c(++_0x3b3c92);}(_0x7a54,0x106));var _0x47a5=function(_0x220ea8,_0x4a07d3){_0x220ea8=_0x220ea8-0x0;var _0x162b39=_0x7a54[_0x220ea8];return _0x162b39;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 035bf17..604c6e3 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 _0x7284=['nothing','sequelize','STRING','ENUM','Task','Case','contact','lead','account_contact_lead','account','contact_lead'];(function(_0x452e98,_0x36811e){var _0x22b4f5=function(_0x3afbfd){while(--_0x3afbfd){_0x452e98['push'](_0x452e98['shift']());}};_0x22b4f5(++_0x36811e);}(_0x7284,0x9b));var _0x4728=function(_0x25517b,_0x217245){_0x25517b=_0x25517b-0x0;var _0x38d037=_0x7284[_0x25517b];return _0x38d037;};'use strict';var Sequelize=require(_0x4728('0x0'));module['exports']={'name':{'type':Sequelize[_0x4728('0x1')]},'description':{'type':Sequelize[_0x4728('0x1')]},'ticketType':{'type':Sequelize[_0x4728('0x2')](_0x4728('0x3'),_0x4728('0x4')),'defaultValue':_0x4728('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x4728('0x5'),_0x4728('0x6'),_0x4728('0x7'),_0x4728('0x8')),'defaultValue':_0x4728('0x9')},'moduleCreate':{'type':Sequelize[_0x4728('0x2')](_0x4728('0xa'),_0x4728('0x5'),_0x4728('0x6'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x4728('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x4728('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x4728('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf679=['Task','Case','contact_lead','contact','lead','account','nothing','sequelize','exports','STRING','ENUM'];(function(_0x14edb2,_0x1a2793){var _0x5e38c0=function(_0x383d54){while(--_0x383d54){_0x14edb2['push'](_0x14edb2['shift']());}};_0x5e38c0(++_0x1a2793);}(_0xf679,0x11a));var _0x9f67=function(_0x5d9260,_0x67ae2c){_0x5d9260=_0x5d9260-0x0;var _0x3b7af2=_0xf679[_0x5d9260];return _0x3b7af2;};'use strict';var Sequelize=require(_0x9f67('0x0'));module[_0x9f67('0x1')]={'name':{'type':Sequelize[_0x9f67('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9f67('0x3')](_0x9f67('0x4'),_0x9f67('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x9f67('0x6'),_0x9f67('0x7'),_0x9f67('0x8'),'account_contact_lead',_0x9f67('0x9')),'defaultValue':_0x9f67('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x9f67('0xa'),'contact',_0x9f67('0x8'),_0x9f67('0x9')),'defaultValue':_0x9f67('0x8')},'leadId':{'type':Sequelize[_0x9f67('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x9f67('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x9f67('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index f4da4c3..1a7bd10 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 _0xd9e9=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','length','body','params','destroy','SalesforceField','getFields','getSubjects','findOne','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','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/environment','../../config/license/util','../../mysqldb','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x1f5cb8,_0x2efb45){var _0x176ebb=function(_0x2e4e86){while(--_0x2e4e86){_0x1f5cb8['push'](_0x1f5cb8['shift']());}};_0x176ebb(++_0x2efb45);}(_0xd9e9,0xba));var _0x9d9e=function(_0xceff26,_0x3ea466){_0xceff26=_0xceff26-0x0;var _0x21ccd5=_0xd9e9[_0xceff26];return _0x21ccd5;};'use strict';var emlformat=require(_0x9d9e('0x0'));var rimraf=require(_0x9d9e('0x1'));var zipdir=require(_0x9d9e('0x2'));var jsonpatch=require(_0x9d9e('0x3'));var rp=require(_0x9d9e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d9e('0x5'));var path=require(_0x9d9e('0x6'));var sox=require(_0x9d9e('0x7'));var csv=require(_0x9d9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d9e('0x9'));var _=require(_0x9d9e('0xa'));var squel=require(_0x9d9e('0xb'));var crypto=require(_0x9d9e('0xc'));var jsforce=require(_0x9d9e('0xd'));var deskjs=require(_0x9d9e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9d9e('0xf'));var Papa=require(_0x9d9e('0x10'));var Redis=require(_0x9d9e('0x11'));var authService=require(_0x9d9e('0x12'));var qs=require(_0x9d9e('0x13'));var as=require(_0x9d9e('0x14'));var hardwareService=require(_0x9d9e('0x15'));var logger=require(_0x9d9e('0x16'))(_0x9d9e('0x17'));var utils=require('../../config/utils');var config=require(_0x9d9e('0x18'));var licenseUtil=require(_0x9d9e('0x19'));var db=require(_0x9d9e('0x1a'))['db'];function respondWithStatusCode(_0x2baea6,_0x214418){_0x214418=_0x214418||0xcc;return function(_0x1e4241){if(_0x1e4241){return _0x2baea6['sendStatus'](_0x214418);}return _0x2baea6['status'](_0x214418)['end']();};}function respondWithResult(_0x552f03,_0xa1f92a){_0xa1f92a=_0xa1f92a||0xc8;return function(_0x30bfb6){if(_0x30bfb6){return _0x552f03['status'](_0xa1f92a)[_0x9d9e('0x1b')](_0x30bfb6);}};}function respondWithFilteredResult(_0x2f8773,_0x3abc39){return function(_0x99ac4a){if(_0x99ac4a){var _0x12df02=typeof _0x3abc39[_0x9d9e('0x1c')]===_0x9d9e('0x1d')&&typeof _0x3abc39['limit']==='undefined';var _0x5086fa=_0x99ac4a[_0x9d9e('0x1e')];var _0x3a9668=_0x12df02?0x0:_0x3abc39['offset'];var _0x5e0de5=_0x12df02?_0x99ac4a[_0x9d9e('0x1e')]:_0x3abc39[_0x9d9e('0x1c')]+_0x3abc39[_0x9d9e('0x1f')];var _0x38c26b;if(_0x5e0de5>=_0x5086fa){_0x5e0de5=_0x5086fa;_0x38c26b=0xc8;}else{_0x38c26b=0xce;}_0x2f8773[_0x9d9e('0x20')](_0x38c26b);return _0x2f8773[_0x9d9e('0x21')](_0x9d9e('0x22'),_0x3a9668+'-'+_0x5e0de5+'/'+_0x5086fa)['json'](_0x99ac4a);}return null;};}function patchUpdates(_0x5f35ea){return function(_0xbe4ef0){try{jsonpatch[_0x9d9e('0x23')](_0xbe4ef0,_0x5f35ea,!![]);}catch(_0x3555a0){return BPromise[_0x9d9e('0x24')](_0x3555a0);}return _0xbe4ef0[_0x9d9e('0x25')]();};}function saveUpdates(_0x1be958,_0x3233d6){return function(_0x45ecb2){if(_0x45ecb2){return _0x45ecb2[_0x9d9e('0x26')](_0x1be958)[_0x9d9e('0x27')](function(_0x42cb4b){return _0x42cb4b;});}return null;};}function removeEntity(_0x1fb244,_0x4843d7){return function(_0x33b144){if(_0x33b144){return _0x33b144['destroy']()[_0x9d9e('0x27')](function(){_0x1fb244[_0x9d9e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cd1b3,_0x44af76){return function(_0x3f8fa4){if(!_0x3f8fa4){_0x1cd1b3[_0x9d9e('0x28')](0x194);}return _0x3f8fa4;};}function handleError(_0x3e5423,_0x5a4a3d){_0x5a4a3d=_0x5a4a3d||0x1f4;return function(_0x40a1d0){logger[_0x9d9e('0x29')](_0x40a1d0[_0x9d9e('0x2a')]);if(_0x40a1d0['name']){delete _0x40a1d0[_0x9d9e('0x2b')];}_0x3e5423[_0x9d9e('0x20')](_0x5a4a3d)['send'](_0x40a1d0);};}exports[_0x9d9e('0x2c')]=function(_0x15fbe0,_0x383492){var _0x53ae8a={},_0x2e5692={},_0x36766c={'count':0x0,'rows':[]};var _0x321f70=_[_0x9d9e('0x2d')](db[_0x9d9e('0x2e')][_0x9d9e('0x2f')],function(_0xa66a03){return{'name':_0xa66a03[_0x9d9e('0x30')],'type':_0xa66a03[_0x9d9e('0x31')][_0x9d9e('0x32')]};});_0x2e5692[_0x9d9e('0x33')]=_[_0x9d9e('0x2d')](_0x321f70,_0x9d9e('0x2b'));_0x2e5692['query']=_[_0x9d9e('0x34')](_0x15fbe0[_0x9d9e('0x35')]);_0x2e5692[_0x9d9e('0x36')]=_[_0x9d9e('0x37')](_0x2e5692['model'],_0x2e5692[_0x9d9e('0x35')]);_0x53ae8a[_0x9d9e('0x38')]=_[_0x9d9e('0x37')](_0x2e5692['model'],qs[_0x9d9e('0x39')](_0x15fbe0[_0x9d9e('0x35')]['fields']));_0x53ae8a[_0x9d9e('0x38')]=_0x53ae8a['attributes']['length']?_0x53ae8a[_0x9d9e('0x38')]:_0x2e5692[_0x9d9e('0x33')];if(!_0x15fbe0[_0x9d9e('0x35')]['hasOwnProperty'](_0x9d9e('0x3a'))){_0x53ae8a[_0x9d9e('0x1f')]=qs[_0x9d9e('0x1f')](_0x15fbe0[_0x9d9e('0x35')]['limit']);_0x53ae8a[_0x9d9e('0x1c')]=qs['offset'](_0x15fbe0[_0x9d9e('0x35')][_0x9d9e('0x1c')]);}_0x53ae8a[_0x9d9e('0x3b')]=qs[_0x9d9e('0x3c')](_0x15fbe0['query'][_0x9d9e('0x3c')]);_0x53ae8a[_0x9d9e('0x3d')]=qs['filters'](_[_0x9d9e('0x3e')](_0x15fbe0[_0x9d9e('0x35')],_0x2e5692[_0x9d9e('0x36')]),_0x321f70);if(_0x15fbe0[_0x9d9e('0x35')][_0x9d9e('0x3f')]){_0x53ae8a['where']=_[_0x9d9e('0x40')](_0x53ae8a[_0x9d9e('0x3d')],{'$or':_[_0x9d9e('0x2d')](_0x321f70,function(_0x388c8b){if(_0x388c8b['type']!==_0x9d9e('0x41')){var _0x2031b1={};_0x2031b1[_0x388c8b[_0x9d9e('0x2b')]]={'$like':'%'+_0x15fbe0[_0x9d9e('0x35')][_0x9d9e('0x3f')]+'%'};return _0x2031b1;}})});}_0x53ae8a=_['merge']({},_0x53ae8a,_0x15fbe0[_0x9d9e('0x42')]);var _0x16e0ac={'where':_0x53ae8a['where']};return db[_0x9d9e('0x2e')]['count'](_0x16e0ac)['then'](function(_0x177cdf){_0x36766c['count']=_0x177cdf;if(_0x15fbe0[_0x9d9e('0x35')][_0x9d9e('0x43')]){_0x53ae8a[_0x9d9e('0x44')]=[{'all':!![]}];}return db[_0x9d9e('0x2e')]['findAll'](_0x53ae8a);})[_0x9d9e('0x27')](function(_0x423af3){_0x36766c[_0x9d9e('0x45')]=_0x423af3;return _0x36766c;})['then'](respondWithFilteredResult(_0x383492,_0x53ae8a))[_0x9d9e('0x46')](handleError(_0x383492,null));};exports['show']=function(_0xef3d19,_0x501751){var _0x55ec2d={'raw':![],'where':{'id':_0xef3d19['params']['id']}},_0x2489f2={};_0x2489f2['model']=_['keys'](db[_0x9d9e('0x2e')][_0x9d9e('0x2f')]);_0x2489f2[_0x9d9e('0x35')]=_[_0x9d9e('0x34')](_0xef3d19['query']);_0x2489f2[_0x9d9e('0x36')]=_[_0x9d9e('0x37')](_0x2489f2[_0x9d9e('0x33')],_0x2489f2[_0x9d9e('0x35')]);_0x55ec2d[_0x9d9e('0x38')]=_[_0x9d9e('0x37')](_0x2489f2['model'],qs[_0x9d9e('0x39')](_0xef3d19[_0x9d9e('0x35')][_0x9d9e('0x39')]));_0x55ec2d[_0x9d9e('0x38')]=_0x55ec2d[_0x9d9e('0x38')][_0x9d9e('0x47')]?_0x55ec2d['attributes']:_0x2489f2[_0x9d9e('0x33')];if(_0xef3d19[_0x9d9e('0x35')]['includeAll']){_0x55ec2d[_0x9d9e('0x44')]=[{'all':!![]}];}_0x55ec2d=_['merge']({},_0x55ec2d,_0xef3d19['options']);return db[_0x9d9e('0x2e')]['find'](_0x55ec2d)['then'](handleEntityNotFound(_0x501751,null))[_0x9d9e('0x27')](respondWithResult(_0x501751,null))['catch'](handleError(_0x501751,null));};exports['create']=function(_0x9c2238,_0x442a72){return db[_0x9d9e('0x2e')]['create'](_0x9c2238[_0x9d9e('0x48')],{})['then'](respondWithResult(_0x442a72,0xc9))['catch'](handleError(_0x442a72,null));};exports['update']=function(_0x6be473,_0x2de6ae){if(_0x6be473[_0x9d9e('0x48')]['id']){delete _0x6be473[_0x9d9e('0x48')]['id'];}return db[_0x9d9e('0x2e')]['find']({'where':{'id':_0x6be473[_0x9d9e('0x49')]['id']}})['then'](handleEntityNotFound(_0x2de6ae,null))[_0x9d9e('0x27')](saveUpdates(_0x6be473[_0x9d9e('0x48')],null))[_0x9d9e('0x27')](respondWithResult(_0x2de6ae,null))[_0x9d9e('0x46')](handleError(_0x2de6ae,null));};exports[_0x9d9e('0x4a')]=function(_0x2aa068,_0x4b7d88){return db[_0x9d9e('0x2e')]['find']({'where':{'id':_0x2aa068[_0x9d9e('0x49')]['id']}})[_0x9d9e('0x27')](handleEntityNotFound(_0x4b7d88,null))[_0x9d9e('0x27')](removeEntity(_0x4b7d88,null))[_0x9d9e('0x46')](handleError(_0x4b7d88,null));};exports['getFields']=function(_0xb38760,_0x416b8c,_0x3f4a79){var _0x21e1a1={};var _0x416a78={};var _0x2978a1;var _0x481355;return db[_0x9d9e('0x2e')]['findOne']({'where':{'id':_0xb38760[_0x9d9e('0x49')]['id']}})[_0x9d9e('0x27')](handleEntityNotFound(_0x416b8c,null))[_0x9d9e('0x27')](function(_0x159d34){if(_0x159d34){_0x2978a1=_0x159d34;_0x416a78[_0x9d9e('0x33')]=_[_0x9d9e('0x34')](db[_0x9d9e('0x4b')][_0x9d9e('0x2f')]);_0x416a78[_0x9d9e('0x35')]=_[_0x9d9e('0x34')](_0xb38760[_0x9d9e('0x35')]);_0x416a78[_0x9d9e('0x36')]=_[_0x9d9e('0x37')](_0x416a78['model'],_0x416a78['query']);_0x21e1a1[_0x9d9e('0x38')]=_['intersection'](_0x416a78[_0x9d9e('0x33')],qs[_0x9d9e('0x39')](_0xb38760['query'][_0x9d9e('0x39')]));_0x21e1a1[_0x9d9e('0x38')]=_0x21e1a1[_0x9d9e('0x38')][_0x9d9e('0x47')]?_0x21e1a1['attributes']:_0x416a78[_0x9d9e('0x33')];_0x21e1a1[_0x9d9e('0x3b')]=qs[_0x9d9e('0x3c')](_0xb38760[_0x9d9e('0x35')]['sort']);_0x21e1a1['where']=qs[_0x9d9e('0x36')](_[_0x9d9e('0x3e')](_0xb38760[_0x9d9e('0x35')],_0x416a78[_0x9d9e('0x36')]));if(_0xb38760[_0x9d9e('0x35')][_0x9d9e('0x3f')]){_0x21e1a1[_0x9d9e('0x3d')]=_[_0x9d9e('0x40')](_0x21e1a1[_0x9d9e('0x3d')],{'$or':_[_0x9d9e('0x2d')](_0x21e1a1[_0x9d9e('0x38')],function(_0x1d349c){var _0x2dcbdd={};_0x2dcbdd[_0x1d349c]={'$like':'%'+_0xb38760[_0x9d9e('0x35')][_0x9d9e('0x3f')]+'%'};return _0x2dcbdd;})});}_0x21e1a1=_[_0x9d9e('0x40')]({},_0x21e1a1,_0xb38760[_0x9d9e('0x42')]);return _0x2978a1[_0x9d9e('0x4c')](_0x21e1a1);}})['then'](function(_0x38b9f4){if(_0x38b9f4){_0x481355=_0x38b9f4[_0x9d9e('0x47')];if(!_0xb38760[_0x9d9e('0x35')]['hasOwnProperty'](_0x9d9e('0x3a'))){_0x21e1a1[_0x9d9e('0x1f')]=qs[_0x9d9e('0x1f')](_0xb38760[_0x9d9e('0x35')][_0x9d9e('0x1f')]);_0x21e1a1[_0x9d9e('0x1c')]=qs[_0x9d9e('0x1c')](_0xb38760[_0x9d9e('0x35')][_0x9d9e('0x1c')]);}return _0x2978a1[_0x9d9e('0x4c')](_0x21e1a1);}})[_0x9d9e('0x27')](function(_0x300930){if(_0x300930){return _0x300930?{'count':_0x481355,'rows':_0x300930}:null;}})[_0x9d9e('0x27')](respondWithResult(_0x416b8c,null))[_0x9d9e('0x46')](handleError(_0x416b8c,null));};exports[_0x9d9e('0x4d')]=function(_0xc5c01b,_0x510b99,_0x2ee619){var _0x21ed21={};var _0x4b76d6={};var _0x3549b2;var _0x5ade71;return db['SalesforceConfiguration'][_0x9d9e('0x4e')]({'where':{'id':_0xc5c01b[_0x9d9e('0x49')]['id']}})[_0x9d9e('0x27')](handleEntityNotFound(_0x510b99,null))[_0x9d9e('0x27')](function(_0x331e78){if(_0x331e78){_0x3549b2=_0x331e78;_0x4b76d6[_0x9d9e('0x33')]=_[_0x9d9e('0x34')](db[_0x9d9e('0x4b')][_0x9d9e('0x2f')]);_0x4b76d6[_0x9d9e('0x35')]=_[_0x9d9e('0x34')](_0xc5c01b[_0x9d9e('0x35')]);_0x4b76d6[_0x9d9e('0x36')]=_[_0x9d9e('0x37')](_0x4b76d6['model'],_0x4b76d6[_0x9d9e('0x35')]);_0x21ed21[_0x9d9e('0x38')]=_[_0x9d9e('0x37')](_0x4b76d6[_0x9d9e('0x33')],qs[_0x9d9e('0x39')](_0xc5c01b['query'][_0x9d9e('0x39')]));_0x21ed21[_0x9d9e('0x38')]=_0x21ed21[_0x9d9e('0x38')]['length']?_0x21ed21[_0x9d9e('0x38')]:_0x4b76d6[_0x9d9e('0x33')];_0x21ed21['order']=qs[_0x9d9e('0x3c')](_0xc5c01b[_0x9d9e('0x35')][_0x9d9e('0x3c')]);_0x21ed21[_0x9d9e('0x3d')]=qs['filters'](_[_0x9d9e('0x3e')](_0xc5c01b['query'],_0x4b76d6['filters']));if(_0xc5c01b[_0x9d9e('0x35')][_0x9d9e('0x3f')]){_0x21ed21[_0x9d9e('0x3d')]=_[_0x9d9e('0x40')](_0x21ed21[_0x9d9e('0x3d')],{'$or':_[_0x9d9e('0x2d')](_0x21ed21[_0x9d9e('0x38')],function(_0x227100){var _0x50adcb={};_0x50adcb[_0x227100]={'$like':'%'+_0xc5c01b[_0x9d9e('0x35')]['filter']+'%'};return _0x50adcb;})});}_0x21ed21=_['merge']({},_0x21ed21,_0xc5c01b[_0x9d9e('0x42')]);return _0x3549b2['getSubjects'](_0x21ed21);}})['then'](function(_0x475c16){if(_0x475c16){_0x5ade71=_0x475c16[_0x9d9e('0x47')];if(!_0xc5c01b[_0x9d9e('0x35')][_0x9d9e('0x4f')](_0x9d9e('0x3a'))){_0x21ed21['limit']=qs[_0x9d9e('0x1f')](_0xc5c01b[_0x9d9e('0x35')][_0x9d9e('0x1f')]);_0x21ed21[_0x9d9e('0x1c')]=qs[_0x9d9e('0x1c')](_0xc5c01b[_0x9d9e('0x35')][_0x9d9e('0x1c')]);}return _0x3549b2[_0x9d9e('0x4d')](_0x21ed21);}})[_0x9d9e('0x27')](function(_0x92823c){if(_0x92823c){return _0x92823c?{'count':_0x5ade71,'rows':_0x92823c}:null;}})[_0x9d9e('0x27')](respondWithResult(_0x510b99,null))[_0x9d9e('0x46')](handleError(_0x510b99,null));};exports['getDescriptions']=function(_0x24f05d,_0x5a605d,_0x9ca28e){var _0x4a59ae={};var _0x28eba1={};var _0x5dfb20;var _0xe5426e;return db[_0x9d9e('0x2e')][_0x9d9e('0x4e')]({'where':{'id':_0x24f05d[_0x9d9e('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a605d,null))[_0x9d9e('0x27')](function(_0x49e2e2){if(_0x49e2e2){_0x5dfb20=_0x49e2e2;_0x28eba1[_0x9d9e('0x33')]=_['keys'](db['SalesforceField'][_0x9d9e('0x2f')]);_0x28eba1[_0x9d9e('0x35')]=_[_0x9d9e('0x34')](_0x24f05d[_0x9d9e('0x35')]);_0x28eba1[_0x9d9e('0x36')]=_[_0x9d9e('0x37')](_0x28eba1[_0x9d9e('0x33')],_0x28eba1['query']);_0x4a59ae[_0x9d9e('0x38')]=_[_0x9d9e('0x37')](_0x28eba1[_0x9d9e('0x33')],qs[_0x9d9e('0x39')](_0x24f05d['query'][_0x9d9e('0x39')]));_0x4a59ae[_0x9d9e('0x38')]=_0x4a59ae[_0x9d9e('0x38')][_0x9d9e('0x47')]?_0x4a59ae['attributes']:_0x28eba1[_0x9d9e('0x33')];_0x4a59ae[_0x9d9e('0x3b')]=qs[_0x9d9e('0x3c')](_0x24f05d['query']['sort']);_0x4a59ae['where']=qs[_0x9d9e('0x36')](_['pick'](_0x24f05d[_0x9d9e('0x35')],_0x28eba1[_0x9d9e('0x36')]));if(_0x24f05d[_0x9d9e('0x35')][_0x9d9e('0x3f')]){_0x4a59ae[_0x9d9e('0x3d')]=_['merge'](_0x4a59ae[_0x9d9e('0x3d')],{'$or':_['map'](_0x4a59ae['attributes'],function(_0x3b63b9){var _0x37e28e={};_0x37e28e[_0x3b63b9]={'$like':'%'+_0x24f05d[_0x9d9e('0x35')]['filter']+'%'};return _0x37e28e;})});}_0x4a59ae=_[_0x9d9e('0x40')]({},_0x4a59ae,_0x24f05d[_0x9d9e('0x42')]);return _0x5dfb20[_0x9d9e('0x50')](_0x4a59ae);}})[_0x9d9e('0x27')](function(_0x5d5ecb){if(_0x5d5ecb){_0xe5426e=_0x5d5ecb[_0x9d9e('0x47')];if(!_0x24f05d['query']['hasOwnProperty']('nolimit')){_0x4a59ae[_0x9d9e('0x1f')]=qs[_0x9d9e('0x1f')](_0x24f05d['query'][_0x9d9e('0x1f')]);_0x4a59ae[_0x9d9e('0x1c')]=qs['offset'](_0x24f05d[_0x9d9e('0x35')]['offset']);}return _0x5dfb20[_0x9d9e('0x50')](_0x4a59ae);}})[_0x9d9e('0x27')](function(_0x3ba9f7){if(_0x3ba9f7){return _0x3ba9f7?{'count':_0xe5426e,'rows':_0x3ba9f7}:null;}})['then'](respondWithResult(_0x5a605d,null))['catch'](handleError(_0x5a605d,null));}; \ No newline at end of file +var _0xc69b=['ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','find','body','destroy','getFields','findOne','SalesforceField','getSubjects','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3aff64,_0x55b017){var _0x1343d9=function(_0x7d5bd0){while(--_0x7d5bd0){_0x3aff64['push'](_0x3aff64['shift']());}};_0x1343d9(++_0x55b017);}(_0xc69b,0x1d3));var _0xbc69=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0xc69b[_0x6287b6];return _0x5d6be4;};'use strict';var emlformat=require(_0xbc69('0x0'));var rimraf=require(_0xbc69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc69('0x2'));var rp=require(_0xbc69('0x3'));var moment=require(_0xbc69('0x4'));var BPromise=require(_0xbc69('0x5'));var Mustache=require(_0xbc69('0x6'));var util=require(_0xbc69('0x7'));var path=require(_0xbc69('0x8'));var sox=require(_0xbc69('0x9'));var csv=require(_0xbc69('0xa'));var ejs=require(_0xbc69('0xb'));var fs=require('fs');var fs_extra=require(_0xbc69('0xc'));var _=require('lodash');var squel=require(_0xbc69('0xd'));var crypto=require(_0xbc69('0xe'));var jsforce=require(_0xbc69('0xf'));var deskjs=require(_0xbc69('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbc69('0x11'));var Papa=require(_0xbc69('0x12'));var Redis=require(_0xbc69('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbc69('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc69('0x15'))('api');var utils=require(_0xbc69('0x16'));var config=require(_0xbc69('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc69('0x18'))['db'];function respondWithStatusCode(_0x42f446,_0x31d0bf){_0x31d0bf=_0x31d0bf||0xcc;return function(_0x3e68ab){if(_0x3e68ab){return _0x42f446[_0xbc69('0x19')](_0x31d0bf);}return _0x42f446[_0xbc69('0x1a')](_0x31d0bf)[_0xbc69('0x1b')]();};}function respondWithResult(_0x17b99e,_0x1b5c5c){_0x1b5c5c=_0x1b5c5c||0xc8;return function(_0x428949){if(_0x428949){return _0x17b99e['status'](_0x1b5c5c)[_0xbc69('0x1c')](_0x428949);}};}function respondWithFilteredResult(_0x6969db,_0x117ca1){return function(_0x12981e){if(_0x12981e){var _0x13145e=typeof _0x117ca1['offset']==='undefined'&&typeof _0x117ca1[_0xbc69('0x1d')]===_0xbc69('0x1e');var _0xcee96e=_0x12981e['count'];var _0x50ac1c=_0x13145e?0x0:_0x117ca1[_0xbc69('0x1f')];var _0xc7af35=_0x13145e?_0x12981e[_0xbc69('0x20')]:_0x117ca1[_0xbc69('0x1f')]+_0x117ca1[_0xbc69('0x1d')];var _0x37cc34;if(_0xc7af35>=_0xcee96e){_0xc7af35=_0xcee96e;_0x37cc34=0xc8;}else{_0x37cc34=0xce;}_0x6969db[_0xbc69('0x1a')](_0x37cc34);return _0x6969db[_0xbc69('0x21')]('Content-Range',_0x50ac1c+'-'+_0xc7af35+'/'+_0xcee96e)[_0xbc69('0x1c')](_0x12981e);}return null;};}function patchUpdates(_0x141319){return function(_0x1802cc){try{jsonpatch[_0xbc69('0x22')](_0x1802cc,_0x141319,!![]);}catch(_0x4106df){return BPromise['reject'](_0x4106df);}return _0x1802cc[_0xbc69('0x23')]();};}function saveUpdates(_0x22cc8b,_0x13bde1){return function(_0x2ec91a){if(_0x2ec91a){return _0x2ec91a[_0xbc69('0x24')](_0x22cc8b)['then'](function(_0xdc6d5f){return _0xdc6d5f;});}return null;};}function removeEntity(_0x38e6a3,_0x342806){return function(_0x202d26){if(_0x202d26){return _0x202d26['destroy']()[_0xbc69('0x25')](function(){_0x38e6a3[_0xbc69('0x1a')](0xcc)[_0xbc69('0x1b')]();});}};}function handleEntityNotFound(_0x1042fc,_0x25d140){return function(_0xe14436){if(!_0xe14436){_0x1042fc[_0xbc69('0x19')](0x194);}return _0xe14436;};}function handleError(_0x5bd8df,_0x4f1194){_0x4f1194=_0x4f1194||0x1f4;return function(_0x2208b8){logger[_0xbc69('0x26')](_0x2208b8[_0xbc69('0x27')]);if(_0x2208b8['name']){delete _0x2208b8[_0xbc69('0x28')];}_0x5bd8df[_0xbc69('0x1a')](_0x4f1194)[_0xbc69('0x29')](_0x2208b8);};}exports[_0xbc69('0x2a')]=function(_0x39d2cc,_0x270044){var _0xb1506a={},_0x3e5906={},_0x1e41ae={'count':0x0,'rows':[]};var _0x5d42ca=_[_0xbc69('0x2b')](db['SalesforceConfiguration'][_0xbc69('0x2c')],function(_0x4566b5){return{'name':_0x4566b5[_0xbc69('0x2d')],'type':_0x4566b5[_0xbc69('0x2e')][_0xbc69('0x2f')]};});_0x3e5906[_0xbc69('0x30')]=_[_0xbc69('0x2b')](_0x5d42ca,_0xbc69('0x28'));_0x3e5906[_0xbc69('0x31')]=_['keys'](_0x39d2cc[_0xbc69('0x31')]);_0x3e5906['filters']=_[_0xbc69('0x32')](_0x3e5906[_0xbc69('0x30')],_0x3e5906[_0xbc69('0x31')]);_0xb1506a[_0xbc69('0x33')]=_['intersection'](_0x3e5906[_0xbc69('0x30')],qs[_0xbc69('0x34')](_0x39d2cc['query'][_0xbc69('0x34')]));_0xb1506a[_0xbc69('0x33')]=_0xb1506a['attributes'][_0xbc69('0x35')]?_0xb1506a['attributes']:_0x3e5906[_0xbc69('0x30')];if(!_0x39d2cc[_0xbc69('0x31')][_0xbc69('0x36')](_0xbc69('0x37'))){_0xb1506a['limit']=qs[_0xbc69('0x1d')](_0x39d2cc[_0xbc69('0x31')][_0xbc69('0x1d')]);_0xb1506a[_0xbc69('0x1f')]=qs[_0xbc69('0x1f')](_0x39d2cc[_0xbc69('0x31')]['offset']);}_0xb1506a['order']=qs[_0xbc69('0x38')](_0x39d2cc['query']['sort']);_0xb1506a[_0xbc69('0x39')]=qs[_0xbc69('0x3a')](_[_0xbc69('0x3b')](_0x39d2cc['query'],_0x3e5906[_0xbc69('0x3a')]),_0x5d42ca);if(_0x39d2cc['query'][_0xbc69('0x3c')]){_0xb1506a[_0xbc69('0x39')]=_[_0xbc69('0x3d')](_0xb1506a[_0xbc69('0x39')],{'$or':_[_0xbc69('0x2b')](_0x5d42ca,function(_0x4760a2){if(_0x4760a2[_0xbc69('0x2e')]!=='VIRTUAL'){var _0x545aeb={};_0x545aeb[_0x4760a2[_0xbc69('0x28')]]={'$like':'%'+_0x39d2cc['query'][_0xbc69('0x3c')]+'%'};return _0x545aeb;}})});}_0xb1506a=_[_0xbc69('0x3d')]({},_0xb1506a,_0x39d2cc[_0xbc69('0x3e')]);var _0x55b916={'where':_0xb1506a[_0xbc69('0x39')]};return db[_0xbc69('0x3f')][_0xbc69('0x20')](_0x55b916)[_0xbc69('0x25')](function(_0x32a0f8){_0x1e41ae[_0xbc69('0x20')]=_0x32a0f8;if(_0x39d2cc[_0xbc69('0x31')][_0xbc69('0x40')]){_0xb1506a[_0xbc69('0x41')]=[{'all':!![]}];}return db[_0xbc69('0x3f')][_0xbc69('0x42')](_0xb1506a);})[_0xbc69('0x25')](function(_0x1a7645){_0x1e41ae[_0xbc69('0x43')]=_0x1a7645;return _0x1e41ae;})[_0xbc69('0x25')](respondWithFilteredResult(_0x270044,_0xb1506a))[_0xbc69('0x44')](handleError(_0x270044,null));};exports[_0xbc69('0x45')]=function(_0x236b49,_0x2ada3e){var _0x3249ba={'raw':![],'where':{'id':_0x236b49[_0xbc69('0x46')]['id']}},_0x1503a5={};_0x1503a5[_0xbc69('0x30')]=_[_0xbc69('0x47')](db[_0xbc69('0x3f')][_0xbc69('0x2c')]);_0x1503a5[_0xbc69('0x31')]=_['keys'](_0x236b49['query']);_0x1503a5[_0xbc69('0x3a')]=_['intersection'](_0x1503a5['model'],_0x1503a5['query']);_0x3249ba[_0xbc69('0x33')]=_[_0xbc69('0x32')](_0x1503a5['model'],qs['fields'](_0x236b49[_0xbc69('0x31')][_0xbc69('0x34')]));_0x3249ba[_0xbc69('0x33')]=_0x3249ba[_0xbc69('0x33')]['length']?_0x3249ba[_0xbc69('0x33')]:_0x1503a5[_0xbc69('0x30')];if(_0x236b49[_0xbc69('0x31')][_0xbc69('0x40')]){_0x3249ba[_0xbc69('0x41')]=[{'all':!![]}];}_0x3249ba=_[_0xbc69('0x3d')]({},_0x3249ba,_0x236b49[_0xbc69('0x3e')]);return db[_0xbc69('0x3f')][_0xbc69('0x48')](_0x3249ba)[_0xbc69('0x25')](handleEntityNotFound(_0x2ada3e,null))['then'](respondWithResult(_0x2ada3e,null))[_0xbc69('0x44')](handleError(_0x2ada3e,null));};exports['create']=function(_0x17eacd,_0x12c2a9){return db['SalesforceConfiguration']['create'](_0x17eacd['body'],{})['then'](respondWithResult(_0x12c2a9,0xc9))['catch'](handleError(_0x12c2a9,null));};exports[_0xbc69('0x24')]=function(_0x512d8c,_0x240f74){if(_0x512d8c[_0xbc69('0x49')]['id']){delete _0x512d8c[_0xbc69('0x49')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x512d8c['params']['id']}})['then'](handleEntityNotFound(_0x240f74,null))[_0xbc69('0x25')](saveUpdates(_0x512d8c[_0xbc69('0x49')],null))[_0xbc69('0x25')](respondWithResult(_0x240f74,null))[_0xbc69('0x44')](handleError(_0x240f74,null));};exports[_0xbc69('0x4a')]=function(_0x32a305,_0x53d71d){return db[_0xbc69('0x3f')][_0xbc69('0x48')]({'where':{'id':_0x32a305['params']['id']}})[_0xbc69('0x25')](handleEntityNotFound(_0x53d71d,null))[_0xbc69('0x25')](removeEntity(_0x53d71d,null))['catch'](handleError(_0x53d71d,null));};exports[_0xbc69('0x4b')]=function(_0x1bff97,_0x3b8975,_0x5718b8){var _0x4cb15d={};var _0x1d426d={};var _0x5eaa8f;var _0x9d874c;return db[_0xbc69('0x3f')][_0xbc69('0x4c')]({'where':{'id':_0x1bff97[_0xbc69('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b8975,null))[_0xbc69('0x25')](function(_0x7687cc){if(_0x7687cc){_0x5eaa8f=_0x7687cc;_0x1d426d[_0xbc69('0x30')]=_[_0xbc69('0x47')](db[_0xbc69('0x4d')][_0xbc69('0x2c')]);_0x1d426d[_0xbc69('0x31')]=_[_0xbc69('0x47')](_0x1bff97[_0xbc69('0x31')]);_0x1d426d['filters']=_[_0xbc69('0x32')](_0x1d426d[_0xbc69('0x30')],_0x1d426d[_0xbc69('0x31')]);_0x4cb15d[_0xbc69('0x33')]=_[_0xbc69('0x32')](_0x1d426d['model'],qs[_0xbc69('0x34')](_0x1bff97[_0xbc69('0x31')][_0xbc69('0x34')]));_0x4cb15d[_0xbc69('0x33')]=_0x4cb15d[_0xbc69('0x33')]['length']?_0x4cb15d[_0xbc69('0x33')]:_0x1d426d['model'];_0x4cb15d['order']=qs[_0xbc69('0x38')](_0x1bff97[_0xbc69('0x31')][_0xbc69('0x38')]);_0x4cb15d[_0xbc69('0x39')]=qs[_0xbc69('0x3a')](_[_0xbc69('0x3b')](_0x1bff97[_0xbc69('0x31')],_0x1d426d['filters']));if(_0x1bff97[_0xbc69('0x31')][_0xbc69('0x3c')]){_0x4cb15d['where']=_[_0xbc69('0x3d')](_0x4cb15d['where'],{'$or':_[_0xbc69('0x2b')](_0x4cb15d[_0xbc69('0x33')],function(_0xcd5f93){var _0x23fdb9={};_0x23fdb9[_0xcd5f93]={'$like':'%'+_0x1bff97[_0xbc69('0x31')][_0xbc69('0x3c')]+'%'};return _0x23fdb9;})});}_0x4cb15d=_['merge']({},_0x4cb15d,_0x1bff97[_0xbc69('0x3e')]);return _0x5eaa8f[_0xbc69('0x4b')](_0x4cb15d);}})[_0xbc69('0x25')](function(_0x2f4b29){if(_0x2f4b29){_0x9d874c=_0x2f4b29[_0xbc69('0x35')];if(!_0x1bff97['query'][_0xbc69('0x36')](_0xbc69('0x37'))){_0x4cb15d[_0xbc69('0x1d')]=qs[_0xbc69('0x1d')](_0x1bff97[_0xbc69('0x31')][_0xbc69('0x1d')]);_0x4cb15d[_0xbc69('0x1f')]=qs[_0xbc69('0x1f')](_0x1bff97[_0xbc69('0x31')][_0xbc69('0x1f')]);}return _0x5eaa8f[_0xbc69('0x4b')](_0x4cb15d);}})[_0xbc69('0x25')](function(_0x30eef1){if(_0x30eef1){return _0x30eef1?{'count':_0x9d874c,'rows':_0x30eef1}:null;}})[_0xbc69('0x25')](respondWithResult(_0x3b8975,null))[_0xbc69('0x44')](handleError(_0x3b8975,null));};exports[_0xbc69('0x4e')]=function(_0x8ef1bb,_0x83224a,_0x3e3897){var _0x581a00={};var _0x439f3e={};var _0x110c9c;var _0x3dcd0a;return db[_0xbc69('0x3f')][_0xbc69('0x4c')]({'where':{'id':_0x8ef1bb[_0xbc69('0x46')]['id']}})[_0xbc69('0x25')](handleEntityNotFound(_0x83224a,null))[_0xbc69('0x25')](function(_0x31ce0b){if(_0x31ce0b){_0x110c9c=_0x31ce0b;_0x439f3e[_0xbc69('0x30')]=_['keys'](db[_0xbc69('0x4d')][_0xbc69('0x2c')]);_0x439f3e[_0xbc69('0x31')]=_['keys'](_0x8ef1bb[_0xbc69('0x31')]);_0x439f3e[_0xbc69('0x3a')]=_[_0xbc69('0x32')](_0x439f3e[_0xbc69('0x30')],_0x439f3e['query']);_0x581a00[_0xbc69('0x33')]=_[_0xbc69('0x32')](_0x439f3e['model'],qs[_0xbc69('0x34')](_0x8ef1bb['query'][_0xbc69('0x34')]));_0x581a00[_0xbc69('0x33')]=_0x581a00[_0xbc69('0x33')][_0xbc69('0x35')]?_0x581a00[_0xbc69('0x33')]:_0x439f3e[_0xbc69('0x30')];_0x581a00['order']=qs[_0xbc69('0x38')](_0x8ef1bb[_0xbc69('0x31')][_0xbc69('0x38')]);_0x581a00[_0xbc69('0x39')]=qs['filters'](_['pick'](_0x8ef1bb[_0xbc69('0x31')],_0x439f3e[_0xbc69('0x3a')]));if(_0x8ef1bb['query'][_0xbc69('0x3c')]){_0x581a00[_0xbc69('0x39')]=_[_0xbc69('0x3d')](_0x581a00[_0xbc69('0x39')],{'$or':_[_0xbc69('0x2b')](_0x581a00[_0xbc69('0x33')],function(_0x3e3de5){var _0x5abb81={};_0x5abb81[_0x3e3de5]={'$like':'%'+_0x8ef1bb['query'][_0xbc69('0x3c')]+'%'};return _0x5abb81;})});}_0x581a00=_['merge']({},_0x581a00,_0x8ef1bb[_0xbc69('0x3e')]);return _0x110c9c[_0xbc69('0x4e')](_0x581a00);}})[_0xbc69('0x25')](function(_0x5a2ffb){if(_0x5a2ffb){_0x3dcd0a=_0x5a2ffb['length'];if(!_0x8ef1bb['query'][_0xbc69('0x36')]('nolimit')){_0x581a00[_0xbc69('0x1d')]=qs[_0xbc69('0x1d')](_0x8ef1bb[_0xbc69('0x31')][_0xbc69('0x1d')]);_0x581a00[_0xbc69('0x1f')]=qs[_0xbc69('0x1f')](_0x8ef1bb[_0xbc69('0x31')]['offset']);}return _0x110c9c[_0xbc69('0x4e')](_0x581a00);}})[_0xbc69('0x25')](function(_0x34d44f){if(_0x34d44f){return _0x34d44f?{'count':_0x3dcd0a,'rows':_0x34d44f}:null;}})[_0xbc69('0x25')](respondWithResult(_0x83224a,null))[_0xbc69('0x44')](handleError(_0x83224a,null));};exports['getDescriptions']=function(_0x5e622a,_0x1266b0,_0x1ef553){var _0x294c96={};var _0x14dade={};var _0x619b3e;var _0x2a6d69;return db['SalesforceConfiguration'][_0xbc69('0x4c')]({'where':{'id':_0x5e622a[_0xbc69('0x46')]['id']}})[_0xbc69('0x25')](handleEntityNotFound(_0x1266b0,null))[_0xbc69('0x25')](function(_0x15fc08){if(_0x15fc08){_0x619b3e=_0x15fc08;_0x14dade['model']=_[_0xbc69('0x47')](db[_0xbc69('0x4d')][_0xbc69('0x2c')]);_0x14dade[_0xbc69('0x31')]=_[_0xbc69('0x47')](_0x5e622a['query']);_0x14dade[_0xbc69('0x3a')]=_[_0xbc69('0x32')](_0x14dade[_0xbc69('0x30')],_0x14dade[_0xbc69('0x31')]);_0x294c96['attributes']=_[_0xbc69('0x32')](_0x14dade[_0xbc69('0x30')],qs[_0xbc69('0x34')](_0x5e622a[_0xbc69('0x31')]['fields']));_0x294c96[_0xbc69('0x33')]=_0x294c96[_0xbc69('0x33')][_0xbc69('0x35')]?_0x294c96['attributes']:_0x14dade[_0xbc69('0x30')];_0x294c96[_0xbc69('0x4f')]=qs[_0xbc69('0x38')](_0x5e622a['query'][_0xbc69('0x38')]);_0x294c96[_0xbc69('0x39')]=qs[_0xbc69('0x3a')](_[_0xbc69('0x3b')](_0x5e622a['query'],_0x14dade['filters']));if(_0x5e622a[_0xbc69('0x31')]['filter']){_0x294c96['where']=_['merge'](_0x294c96['where'],{'$or':_['map'](_0x294c96[_0xbc69('0x33')],function(_0x5dc396){var _0x53cb13={};_0x53cb13[_0x5dc396]={'$like':'%'+_0x5e622a[_0xbc69('0x31')][_0xbc69('0x3c')]+'%'};return _0x53cb13;})});}_0x294c96=_['merge']({},_0x294c96,_0x5e622a[_0xbc69('0x3e')]);return _0x619b3e[_0xbc69('0x50')](_0x294c96);}})['then'](function(_0x214267){if(_0x214267){_0x2a6d69=_0x214267[_0xbc69('0x35')];if(!_0x5e622a[_0xbc69('0x31')]['hasOwnProperty'](_0xbc69('0x37'))){_0x294c96[_0xbc69('0x1d')]=qs[_0xbc69('0x1d')](_0x5e622a[_0xbc69('0x31')][_0xbc69('0x1d')]);_0x294c96[_0xbc69('0x1f')]=qs[_0xbc69('0x1f')](_0x5e622a['query'][_0xbc69('0x1f')]);}return _0x619b3e[_0xbc69('0x50')](_0x294c96);}})[_0xbc69('0x25')](function(_0x41ffff){if(_0x41ffff){return _0x41ffff?{'count':_0x2a6d69,'rows':_0x41ffff}:null;}})[_0xbc69('0x25')](respondWithResult(_0x1266b0,null))[_0xbc69('0x44')](handleError(_0x1266b0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index e93f60c..129c1a4 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 _0x0590=['./intSalesforceConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x229d7c,_0x2e8fd1){var _0x35c63b=function(_0x2f6d3e){while(--_0x2f6d3e){_0x229d7c['push'](_0x229d7c['shift']());}};_0x35c63b(++_0x2e8fd1);}(_0x0590,0x120));var _0x0059=function(_0xc364a5,_0x3df600){_0xc364a5=_0xc364a5-0x0;var _0x3599a6=_0x0590[_0xc364a5];return _0x3599a6;};'use strict';var _=require(_0x0059('0x0'));var util=require(_0x0059('0x1'));var logger=require(_0x0059('0x2'))(_0x0059('0x3'));var moment=require(_0x0059('0x4'));var BPromise=require('bluebird');var rp=require(_0x0059('0x5'));var fs=require('fs');var path=require(_0x0059('0x6'));var rimraf=require(_0x0059('0x7'));var config=require(_0x0059('0x8'));var attributes=require(_0x0059('0x9'));module['exports']=function(_0x435f54,_0x75bf02){return _0x435f54[_0x0059('0xa')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96db=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x3296c3,_0xc96c4a){var _0x1fb66a=function(_0xa92688){while(--_0xa92688){_0x3296c3['push'](_0x3296c3['shift']());}};_0x1fb66a(++_0xc96c4a);}(_0x96db,0x120));var _0xb96d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x96db[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xb96d('0x0'));var util=require(_0xb96d('0x1'));var logger=require(_0xb96d('0x2'))(_0xb96d('0x3'));var moment=require('moment');var BPromise=require(_0xb96d('0x4'));var rp=require(_0xb96d('0x5'));var fs=require('fs');var path=require(_0xb96d('0x6'));var rimraf=require(_0xb96d('0x7'));var config=require(_0xb96d('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xb96d('0x9')]=function(_0x312992,_0x508b4d){return _0x312992['define'](_0xb96d('0xa'),attributes,{'tableName':_0xb96d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index f71bf2e..3e09d95 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 _0x8042=['stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x40e285,_0xefd509){var _0x164535=function(_0x202168){while(--_0x202168){_0x40e285['push'](_0x40e285['shift']());}};_0x164535(++_0xefd509);}(_0x8042,0x157));var _0x2804=function(_0x2ac3cf,_0x465bb6){_0x2ac3cf=_0x2ac3cf-0x0;var _0x27dcca=_0x8042[_0x2ac3cf];return _0x27dcca;};'use strict';var _=require(_0x2804('0x0'));var util=require(_0x2804('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2804('0x2'));var fs=require('fs');var Redis=require(_0x2804('0x3'));var db=require(_0x2804('0x4'))['db'];var utils=require(_0x2804('0x5'));var logger=require('../../config/logger')(_0x2804('0x6'));var config=require(_0x2804('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2804('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f0bd9,_0x235b2b,_0x39ec06){return new BPromise(function(_0x4685f6,_0x3ddd6d){return client[_0x2804('0x9')](_0x3f0bd9,_0x39ec06)[_0x2804('0xa')](function(_0x2ad412){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x235b2b,_0x2804('0xb'));logger[_0x2804('0xc')](_0x2804('0xd'),_0x235b2b,'request\x20sent',JSON[_0x2804('0xe')](_0x2ad412));if(_0x2ad412[_0x2804('0xf')]){if(_0x2ad412['error'][_0x2804('0x10')]===0x1f4){logger[_0x2804('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x235b2b,_0x2ad412['error'][_0x2804('0x11')]);return _0x3ddd6d(_0x2ad412[_0x2804('0xf')][_0x2804('0x11')]);}logger[_0x2804('0xf')](_0x2804('0x12'),_0x235b2b,_0x2ad412[_0x2804('0xf')][_0x2804('0x11')]);return _0x4685f6(_0x2ad412['error'][_0x2804('0x11')]);}else{logger['info'](_0x2804('0x12'),_0x235b2b,'request\x20sent');_0x4685f6(_0x2ad412[_0x2804('0x13')][_0x2804('0x11')]);}})[_0x2804('0x14')](function(_0x43bf92){logger[_0x2804('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x235b2b,_0x43bf92);_0x3ddd6d(_0x43bf92);});});} \ No newline at end of file +var _0xe8e4=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b5ba1,_0xc8876d){var _0x1feb71=function(_0x4f06ed){while(--_0x4f06ed){_0x1b5ba1['push'](_0x1b5ba1['shift']());}};_0x1feb71(++_0xc8876d);}(_0xe8e4,0xbb));var _0x4e8e=function(_0x3debd6,_0x7ece6e){_0x3debd6=_0x3debd6-0x0;var _0x2ddf43=_0xe8e4[_0x3debd6];return _0x2ddf43;};'use strict';var _=require(_0x4e8e('0x0'));var util=require('util');var moment=require(_0x4e8e('0x1'));var BPromise=require(_0x4e8e('0x2'));var rs=require(_0x4e8e('0x3'));var fs=require('fs');var Redis=require(_0x4e8e('0x4'));var db=require(_0x4e8e('0x5'))['db'];var utils=require(_0x4e8e('0x6'));var logger=require('../../config/logger')(_0x4e8e('0x7'));var config=require('../../config/environment');var jayson=require(_0x4e8e('0x8'));var client=jayson[_0x4e8e('0x9')][_0x4e8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19313d,_0x254517,_0x33701f){return new BPromise(function(_0x1b6e99,_0x39e675){return client['request'](_0x19313d,_0x33701f)[_0x4e8e('0xb')](function(_0x264efb){logger[_0x4e8e('0xc')](_0x4e8e('0xd'),_0x254517,_0x4e8e('0xe'));logger[_0x4e8e('0xf')](_0x4e8e('0x10'),_0x254517,_0x4e8e('0xe'),JSON[_0x4e8e('0x11')](_0x264efb));if(_0x264efb['error']){if(_0x264efb[_0x4e8e('0x12')][_0x4e8e('0x13')]===0x1f4){logger[_0x4e8e('0x12')](_0x4e8e('0xd'),_0x254517,_0x264efb[_0x4e8e('0x12')][_0x4e8e('0x14')]);return _0x39e675(_0x264efb['error'][_0x4e8e('0x14')]);}logger[_0x4e8e('0x12')](_0x4e8e('0xd'),_0x254517,_0x264efb[_0x4e8e('0x12')]['message']);return _0x1b6e99(_0x264efb['error'][_0x4e8e('0x14')]);}else{logger[_0x4e8e('0xc')](_0x4e8e('0xd'),_0x254517,_0x4e8e('0xe'));_0x1b6e99(_0x264efb[_0x4e8e('0x15')][_0x4e8e('0x14')]);}})[_0x4e8e('0x16')](function(_0x4c8546){logger[_0x4e8e('0x12')](_0x4e8e('0xd'),_0x254517,_0x4c8546);_0x39e675(_0x4c8546);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 390e6f5..67afb2e 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 _0xae8c=['/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xae8c,0x68));var _0xcae8=function(_0x49dd26,_0x9e5a5d){_0x49dd26=_0x49dd26-0x0;var _0x45f549=_0xae8c[_0x49dd26];return _0x45f549;};'use strict';var multer=require(_0xcae8('0x0'));var util=require(_0xcae8('0x1'));var path=require(_0xcae8('0x2'));var timeout=require('connect-timeout');var express=require(_0xcae8('0x3'));var router=express[_0xcae8('0x4')]();var fs_extra=require(_0xcae8('0x5'));var auth=require(_0xcae8('0x6'));var interaction=require(_0xcae8('0x7'));var config=require('../../config/environment');var controller=require(_0xcae8('0x8'));router[_0xcae8('0x9')]('/',auth[_0xcae8('0xa')](),controller[_0xcae8('0xb')]);router[_0xcae8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcae8('0xc')]);router[_0xcae8('0xd')]('/',auth[_0xcae8('0xa')](),controller[_0xcae8('0xe')]);router[_0xcae8('0xf')](_0xcae8('0x10'),auth[_0xcae8('0xa')](),controller[_0xcae8('0x11')]);router[_0xcae8('0x12')](_0xcae8('0x10'),auth[_0xcae8('0xa')](),controller[_0xcae8('0x13')]);module['exports']=router; \ No newline at end of file +var _0xafe6=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xafe6,0x66));var _0x6afe=function(_0x1b9374,_0x138720){_0x1b9374=_0x1b9374-0x0;var _0x5c0f30=_0xafe6[_0x1b9374];return _0x5c0f30;};'use strict';var multer=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var path=require(_0x6afe('0x2'));var timeout=require(_0x6afe('0x3'));var express=require(_0x6afe('0x4'));var router=express['Router']();var fs_extra=require(_0x6afe('0x5'));var auth=require(_0x6afe('0x6'));var interaction=require(_0x6afe('0x7'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x6afe('0x8')]('/',auth['isAuthenticated'](),controller[_0x6afe('0x9')]);router[_0x6afe('0x8')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0xc')]);router['post']('/',auth[_0x6afe('0xb')](),controller['create']);router[_0x6afe('0xd')]('/:id',auth[_0x6afe('0xb')](),controller[_0x6afe('0xe')]);router[_0x6afe('0xf')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0x10')]);module[_0x6afe('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 a6e83b2..fa96d22 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 _0x2883=['keyValue','picklist','STRING','ENUM','customVariable','exports','string','variable'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2883,0x1c5));var _0x3288=function(_0x2af550,_0x1ddeb2){_0x2af550=_0x2af550-0x0;var _0x59d01f=_0x2883[_0x2af550];return _0x59d01f;};'use strict';var Sequelize=require('sequelize');module[_0x3288('0x0')]={'type':{'type':Sequelize['ENUM'](_0x3288('0x1'),_0x3288('0x2'),'customVariable',_0x3288('0x3'),_0x3288('0x4')),'defaultValue':_0x3288('0x1')},'content':{'type':Sequelize[_0x3288('0x5')]},'key':{'type':Sequelize[_0x3288('0x5')]},'keyType':{'type':Sequelize[_0x3288('0x6')](_0x3288('0x1'),'variable',_0x3288('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x3288('0x5')]}}; \ No newline at end of file +var _0x1982=['sequelize','exports','string','variable','picklist','STRING','customVariable'];(function(_0x536b4a,_0x55a96a){var _0x46dc17=function(_0x2220f1){while(--_0x2220f1){_0x536b4a['push'](_0x536b4a['shift']());}};_0x46dc17(++_0x55a96a);}(_0x1982,0xee));var _0x2198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1982[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2198('0x0'));module[_0x2198('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2198('0x2'),_0x2198('0x3'),'customVariable','keyValue',_0x2198('0x4')),'defaultValue':_0x2198('0x2')},'content':{'type':Sequelize[_0x2198('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2198('0x2'),'variable',_0x2198('0x6'))},'keyContent':{'type':Sequelize[_0x2198('0x5')]},'idField':{'type':Sequelize[_0x2198('0x5')]},'variableName':{'type':Sequelize[_0x2198('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 168a085..d96caf1 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 _0x1b61=['VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge'];(function(_0x513ebd,_0x8d6c4){var _0x5e28ae=function(_0x3248c2){while(--_0x3248c2){_0x513ebd['push'](_0x513ebd['shift']());}};_0x5e28ae(++_0x8d6c4);}(_0x1b61,0xec));var _0x11b6=function(_0x56568a,_0x25efcb){_0x56568a=_0x56568a-0x0;var _0x3eeb13=_0x1b61[_0x56568a];return _0x3eeb13;};'use strict';var emlformat=require(_0x11b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11b6('0x1'));var jsonpatch=require(_0x11b6('0x2'));var rp=require(_0x11b6('0x3'));var moment=require(_0x11b6('0x4'));var BPromise=require(_0x11b6('0x5'));var Mustache=require(_0x11b6('0x6'));var util=require('util');var path=require(_0x11b6('0x7'));var sox=require('sox');var csv=require(_0x11b6('0x8'));var ejs=require(_0x11b6('0x9'));var fs=require('fs');var fs_extra=require(_0x11b6('0xa'));var _=require(_0x11b6('0xb'));var squel=require('squel');var crypto=require(_0x11b6('0xc'));var jsforce=require(_0x11b6('0xd'));var deskjs=require(_0x11b6('0xe'));var toCsv=require(_0x11b6('0x8'));var querystring=require(_0x11b6('0xf'));var Papa=require('papaparse');var Redis=require(_0x11b6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x11b6('0x11'));var as=require(_0x11b6('0x12'));var hardwareService=require(_0x11b6('0x13'));var logger=require(_0x11b6('0x14'))(_0x11b6('0x15'));var utils=require(_0x11b6('0x16'));var config=require(_0x11b6('0x17'));var licenseUtil=require(_0x11b6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35065e,_0x511c7a){_0x511c7a=_0x511c7a||0xcc;return function(_0x12580f){if(_0x12580f){return _0x35065e[_0x11b6('0x19')](_0x511c7a);}return _0x35065e['status'](_0x511c7a)[_0x11b6('0x1a')]();};}function respondWithResult(_0x2be952,_0x8827e9){_0x8827e9=_0x8827e9||0xc8;return function(_0x36577c){if(_0x36577c){return _0x2be952[_0x11b6('0x1b')](_0x8827e9)[_0x11b6('0x1c')](_0x36577c);}};}function respondWithFilteredResult(_0x491e02,_0x2b01c0){return function(_0x2a2cb8){if(_0x2a2cb8){var _0x277c0a=typeof _0x2b01c0[_0x11b6('0x1d')]===_0x11b6('0x1e')&&typeof _0x2b01c0[_0x11b6('0x1f')]===_0x11b6('0x1e');var _0x9a34c8=_0x2a2cb8[_0x11b6('0x20')];var _0x1633a9=_0x277c0a?0x0:_0x2b01c0[_0x11b6('0x1d')];var _0x240a6=_0x277c0a?_0x2a2cb8[_0x11b6('0x20')]:_0x2b01c0[_0x11b6('0x1d')]+_0x2b01c0[_0x11b6('0x1f')];var _0xa26ca7;if(_0x240a6>=_0x9a34c8){_0x240a6=_0x9a34c8;_0xa26ca7=0xc8;}else{_0xa26ca7=0xce;}_0x491e02[_0x11b6('0x1b')](_0xa26ca7);return _0x491e02[_0x11b6('0x21')](_0x11b6('0x22'),_0x1633a9+'-'+_0x240a6+'/'+_0x9a34c8)[_0x11b6('0x1c')](_0x2a2cb8);}return null;};}function patchUpdates(_0x5e19cc){return function(_0x63105){try{jsonpatch[_0x11b6('0x23')](_0x63105,_0x5e19cc,!![]);}catch(_0xb82bc3){return BPromise[_0x11b6('0x24')](_0xb82bc3);}return _0x63105['save']();};}function saveUpdates(_0x2f1721,_0x5a265b){return function(_0x178f1e){if(_0x178f1e){return _0x178f1e[_0x11b6('0x25')](_0x2f1721)[_0x11b6('0x26')](function(_0x1a86be){return _0x1a86be;});}return null;};}function removeEntity(_0xea5b3,_0x2c9524){return function(_0x2e5a3c){if(_0x2e5a3c){return _0x2e5a3c['destroy']()[_0x11b6('0x26')](function(){_0xea5b3[_0x11b6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x328750,_0x7bbe00){return function(_0x5f0200){if(!_0x5f0200){_0x328750['sendStatus'](0x194);}return _0x5f0200;};}function handleError(_0x1a1445,_0x3dca8b){_0x3dca8b=_0x3dca8b||0x1f4;return function(_0x4bbae8){logger[_0x11b6('0x27')](_0x4bbae8[_0x11b6('0x28')]);if(_0x4bbae8['name']){delete _0x4bbae8[_0x11b6('0x29')];}_0x1a1445[_0x11b6('0x1b')](_0x3dca8b)[_0x11b6('0x2a')](_0x4bbae8);};}exports[_0x11b6('0x2b')]=function(_0x1c356f,_0x989ff1){var _0x17cdb4={},_0x2561ae={},_0x5c65ac={'count':0x0,'rows':[]};var _0x5ae1a5=_[_0x11b6('0x2c')](db[_0x11b6('0x2d')][_0x11b6('0x2e')],function(_0x48a9aa){return{'name':_0x48a9aa[_0x11b6('0x2f')],'type':_0x48a9aa[_0x11b6('0x30')][_0x11b6('0x31')]};});_0x2561ae['model']=_['map'](_0x5ae1a5,_0x11b6('0x29'));_0x2561ae[_0x11b6('0x32')]=_[_0x11b6('0x33')](_0x1c356f[_0x11b6('0x32')]);_0x2561ae['filters']=_[_0x11b6('0x34')](_0x2561ae[_0x11b6('0x35')],_0x2561ae[_0x11b6('0x32')]);_0x17cdb4[_0x11b6('0x36')]=_[_0x11b6('0x34')](_0x2561ae[_0x11b6('0x35')],qs[_0x11b6('0x37')](_0x1c356f[_0x11b6('0x32')]['fields']));_0x17cdb4[_0x11b6('0x36')]=_0x17cdb4[_0x11b6('0x36')][_0x11b6('0x38')]?_0x17cdb4[_0x11b6('0x36')]:_0x2561ae[_0x11b6('0x35')];if(!_0x1c356f[_0x11b6('0x32')]['hasOwnProperty'](_0x11b6('0x39'))){_0x17cdb4['limit']=qs[_0x11b6('0x1f')](_0x1c356f['query']['limit']);_0x17cdb4[_0x11b6('0x1d')]=qs[_0x11b6('0x1d')](_0x1c356f['query'][_0x11b6('0x1d')]);}_0x17cdb4[_0x11b6('0x3a')]=qs[_0x11b6('0x3b')](_0x1c356f[_0x11b6('0x32')][_0x11b6('0x3b')]);_0x17cdb4[_0x11b6('0x3c')]=qs['filters'](_['pick'](_0x1c356f[_0x11b6('0x32')],_0x2561ae[_0x11b6('0x3d')]),_0x5ae1a5);if(_0x1c356f[_0x11b6('0x32')][_0x11b6('0x3e')]){_0x17cdb4[_0x11b6('0x3c')]=_[_0x11b6('0x3f')](_0x17cdb4[_0x11b6('0x3c')],{'$or':_[_0x11b6('0x2c')](_0x5ae1a5,function(_0x4beea8){if(_0x4beea8[_0x11b6('0x30')]!==_0x11b6('0x40')){var _0x4bb4a0={};_0x4bb4a0[_0x4beea8[_0x11b6('0x29')]]={'$like':'%'+_0x1c356f[_0x11b6('0x32')][_0x11b6('0x3e')]+'%'};return _0x4bb4a0;}})});}_0x17cdb4=_[_0x11b6('0x3f')]({},_0x17cdb4,_0x1c356f['options']);var _0x5bc5dc={'where':_0x17cdb4[_0x11b6('0x3c')]};return db[_0x11b6('0x2d')]['count'](_0x5bc5dc)[_0x11b6('0x26')](function(_0x1423a3){_0x5c65ac[_0x11b6('0x20')]=_0x1423a3;if(_0x1c356f[_0x11b6('0x32')][_0x11b6('0x41')]){_0x17cdb4['include']=[{'all':!![]}];}return db[_0x11b6('0x2d')][_0x11b6('0x42')](_0x17cdb4);})['then'](function(_0x3dd433){_0x5c65ac[_0x11b6('0x43')]=_0x3dd433;return _0x5c65ac;})['then'](respondWithFilteredResult(_0x989ff1,_0x17cdb4))[_0x11b6('0x44')](handleError(_0x989ff1,null));};exports[_0x11b6('0x45')]=function(_0x5544be,_0x54117e){var _0x20d51f={'raw':!![],'where':{'id':_0x5544be[_0x11b6('0x46')]['id']}},_0x1cedbd={};_0x1cedbd[_0x11b6('0x35')]=_['keys'](db[_0x11b6('0x2d')]['rawAttributes']);_0x1cedbd[_0x11b6('0x32')]=_[_0x11b6('0x33')](_0x5544be['query']);_0x1cedbd[_0x11b6('0x3d')]=_[_0x11b6('0x34')](_0x1cedbd[_0x11b6('0x35')],_0x1cedbd[_0x11b6('0x32')]);_0x20d51f[_0x11b6('0x36')]=_[_0x11b6('0x34')](_0x1cedbd[_0x11b6('0x35')],qs[_0x11b6('0x37')](_0x5544be[_0x11b6('0x32')][_0x11b6('0x37')]));_0x20d51f[_0x11b6('0x36')]=_0x20d51f[_0x11b6('0x36')][_0x11b6('0x38')]?_0x20d51f[_0x11b6('0x36')]:_0x1cedbd[_0x11b6('0x35')];if(_0x5544be[_0x11b6('0x32')][_0x11b6('0x41')]){_0x20d51f[_0x11b6('0x47')]=[{'all':!![]}];}_0x20d51f=_['merge']({},_0x20d51f,_0x5544be['options']);return db['SalesforceField'][_0x11b6('0x48')](_0x20d51f)[_0x11b6('0x26')](handleEntityNotFound(_0x54117e,null))[_0x11b6('0x26')](respondWithResult(_0x54117e,null))[_0x11b6('0x44')](handleError(_0x54117e,null));};exports[_0x11b6('0x49')]=function(_0x59db39,_0x4a0ebe){return db[_0x11b6('0x2d')]['create'](_0x59db39[_0x11b6('0x4a')],{})[_0x11b6('0x26')](respondWithResult(_0x4a0ebe,0xc9))[_0x11b6('0x44')](handleError(_0x4a0ebe,null));};exports[_0x11b6('0x25')]=function(_0x1d64f5,_0x4d12af){if(_0x1d64f5['body']['id']){delete _0x1d64f5[_0x11b6('0x4a')]['id'];}return db['SalesforceField'][_0x11b6('0x48')]({'where':{'id':_0x1d64f5[_0x11b6('0x46')]['id']}})[_0x11b6('0x26')](handleEntityNotFound(_0x4d12af,null))[_0x11b6('0x26')](saveUpdates(_0x1d64f5['body'],null))[_0x11b6('0x26')](respondWithResult(_0x4d12af,null))[_0x11b6('0x44')](handleError(_0x4d12af,null));};exports['destroy']=function(_0x51d020,_0x248a74){return db[_0x11b6('0x2d')]['find']({'where':{'id':_0x51d020[_0x11b6('0x46')]['id']}})[_0x11b6('0x26')](handleEntityNotFound(_0x248a74,null))[_0x11b6('0x26')](removeEntity(_0x248a74,null))['catch'](handleError(_0x248a74,null));}; \ No newline at end of file +var _0xd6c2=['VIRTUAL','options','includeAll','include','show','find','catch','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','error','stack','send','map','SalesforceField','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x26b36c,_0x5d501e){var _0x2a0210=function(_0x5be73b){while(--_0x5be73b){_0x26b36c['push'](_0x26b36c['shift']());}};_0x2a0210(++_0x5d501e);}(_0xd6c2,0x187));var _0x2d6c=function(_0x1eaa74,_0x424c67){_0x1eaa74=_0x1eaa74-0x0;var _0x326705=_0xd6c2[_0x1eaa74];return _0x326705;};'use strict';var emlformat=require(_0x2d6c('0x0'));var rimraf=require(_0x2d6c('0x1'));var zipdir=require(_0x2d6c('0x2'));var jsonpatch=require(_0x2d6c('0x3'));var rp=require(_0x2d6c('0x4'));var moment=require(_0x2d6c('0x5'));var BPromise=require(_0x2d6c('0x6'));var Mustache=require(_0x2d6c('0x7'));var util=require(_0x2d6c('0x8'));var path=require('path');var sox=require(_0x2d6c('0x9'));var csv=require(_0x2d6c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d6c('0xb'));var _=require(_0x2d6c('0xc'));var squel=require(_0x2d6c('0xd'));var crypto=require(_0x2d6c('0xe'));var jsforce=require(_0x2d6c('0xf'));var deskjs=require(_0x2d6c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2d6c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d6c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2d6c('0x13'));var hardwareService=require(_0x2d6c('0x14'));var logger=require(_0x2d6c('0x15'))(_0x2d6c('0x16'));var utils=require('../../config/utils');var config=require(_0x2d6c('0x17'));var licenseUtil=require(_0x2d6c('0x18'));var db=require(_0x2d6c('0x19'))['db'];function respondWithStatusCode(_0x3ffc5f,_0x135a90){_0x135a90=_0x135a90||0xcc;return function(_0x9f5a81){if(_0x9f5a81){return _0x3ffc5f[_0x2d6c('0x1a')](_0x135a90);}return _0x3ffc5f[_0x2d6c('0x1b')](_0x135a90)[_0x2d6c('0x1c')]();};}function respondWithResult(_0x746c6b,_0x55e46d){_0x55e46d=_0x55e46d||0xc8;return function(_0x24aa5a){if(_0x24aa5a){return _0x746c6b[_0x2d6c('0x1b')](_0x55e46d)['json'](_0x24aa5a);}};}function respondWithFilteredResult(_0xbb46f7,_0x230e47){return function(_0x364927){if(_0x364927){var _0x35cd15=typeof _0x230e47['offset']===_0x2d6c('0x1d')&&typeof _0x230e47[_0x2d6c('0x1e')]===_0x2d6c('0x1d');var _0x282f67=_0x364927[_0x2d6c('0x1f')];var _0x28fd3f=_0x35cd15?0x0:_0x230e47[_0x2d6c('0x20')];var _0x5ee563=_0x35cd15?_0x364927[_0x2d6c('0x1f')]:_0x230e47[_0x2d6c('0x20')]+_0x230e47[_0x2d6c('0x1e')];var _0x18560b;if(_0x5ee563>=_0x282f67){_0x5ee563=_0x282f67;_0x18560b=0xc8;}else{_0x18560b=0xce;}_0xbb46f7[_0x2d6c('0x1b')](_0x18560b);return _0xbb46f7['set'](_0x2d6c('0x21'),_0x28fd3f+'-'+_0x5ee563+'/'+_0x282f67)[_0x2d6c('0x22')](_0x364927);}return null;};}function patchUpdates(_0x20ef01){return function(_0x88d801){try{jsonpatch[_0x2d6c('0x23')](_0x88d801,_0x20ef01,!![]);}catch(_0x2a503a){return BPromise[_0x2d6c('0x24')](_0x2a503a);}return _0x88d801[_0x2d6c('0x25')]();};}function saveUpdates(_0x5c31cc,_0x474f26){return function(_0x73e99){if(_0x73e99){return _0x73e99[_0x2d6c('0x26')](_0x5c31cc)[_0x2d6c('0x27')](function(_0x523c2f){return _0x523c2f;});}return null;};}function removeEntity(_0x3e310d,_0x5ce74b){return function(_0x5b3a57){if(_0x5b3a57){return _0x5b3a57['destroy']()[_0x2d6c('0x27')](function(){_0x3e310d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe456d5,_0x5c9140){return function(_0x1aab65){if(!_0x1aab65){_0xe456d5['sendStatus'](0x194);}return _0x1aab65;};}function handleError(_0x27ab4e,_0x5411a4){_0x5411a4=_0x5411a4||0x1f4;return function(_0x308ca5){logger[_0x2d6c('0x28')](_0x308ca5[_0x2d6c('0x29')]);if(_0x308ca5['name']){delete _0x308ca5['name'];}_0x27ab4e[_0x2d6c('0x1b')](_0x5411a4)[_0x2d6c('0x2a')](_0x308ca5);};}exports['index']=function(_0x1989d3,_0x31c1e8){var _0x22d401={},_0x330b1a={},_0x30c1c6={'count':0x0,'rows':[]};var _0x5ee78f=_[_0x2d6c('0x2b')](db[_0x2d6c('0x2c')][_0x2d6c('0x2d')],function(_0x36bcfd){return{'name':_0x36bcfd[_0x2d6c('0x2e')],'type':_0x36bcfd[_0x2d6c('0x2f')]['key']};});_0x330b1a[_0x2d6c('0x30')]=_[_0x2d6c('0x2b')](_0x5ee78f,_0x2d6c('0x31'));_0x330b1a['query']=_[_0x2d6c('0x32')](_0x1989d3[_0x2d6c('0x33')]);_0x330b1a[_0x2d6c('0x34')]=_[_0x2d6c('0x35')](_0x330b1a[_0x2d6c('0x30')],_0x330b1a['query']);_0x22d401[_0x2d6c('0x36')]=_[_0x2d6c('0x35')](_0x330b1a[_0x2d6c('0x30')],qs[_0x2d6c('0x37')](_0x1989d3[_0x2d6c('0x33')][_0x2d6c('0x37')]));_0x22d401['attributes']=_0x22d401[_0x2d6c('0x36')][_0x2d6c('0x38')]?_0x22d401[_0x2d6c('0x36')]:_0x330b1a[_0x2d6c('0x30')];if(!_0x1989d3[_0x2d6c('0x33')][_0x2d6c('0x39')](_0x2d6c('0x3a'))){_0x22d401['limit']=qs[_0x2d6c('0x1e')](_0x1989d3[_0x2d6c('0x33')][_0x2d6c('0x1e')]);_0x22d401[_0x2d6c('0x20')]=qs[_0x2d6c('0x20')](_0x1989d3['query']['offset']);}_0x22d401[_0x2d6c('0x3b')]=qs['sort'](_0x1989d3['query'][_0x2d6c('0x3c')]);_0x22d401[_0x2d6c('0x3d')]=qs[_0x2d6c('0x34')](_[_0x2d6c('0x3e')](_0x1989d3[_0x2d6c('0x33')],_0x330b1a[_0x2d6c('0x34')]),_0x5ee78f);if(_0x1989d3[_0x2d6c('0x33')][_0x2d6c('0x3f')]){_0x22d401[_0x2d6c('0x3d')]=_[_0x2d6c('0x40')](_0x22d401['where'],{'$or':_[_0x2d6c('0x2b')](_0x5ee78f,function(_0x568966){if(_0x568966[_0x2d6c('0x2f')]!==_0x2d6c('0x41')){var _0x17af5c={};_0x17af5c[_0x568966[_0x2d6c('0x31')]]={'$like':'%'+_0x1989d3[_0x2d6c('0x33')]['filter']+'%'};return _0x17af5c;}})});}_0x22d401=_[_0x2d6c('0x40')]({},_0x22d401,_0x1989d3[_0x2d6c('0x42')]);var _0x45000d={'where':_0x22d401[_0x2d6c('0x3d')]};return db[_0x2d6c('0x2c')]['count'](_0x45000d)[_0x2d6c('0x27')](function(_0x5adc16){_0x30c1c6[_0x2d6c('0x1f')]=_0x5adc16;if(_0x1989d3[_0x2d6c('0x33')][_0x2d6c('0x43')]){_0x22d401[_0x2d6c('0x44')]=[{'all':!![]}];}return db[_0x2d6c('0x2c')]['findAll'](_0x22d401);})[_0x2d6c('0x27')](function(_0x1b1449){_0x30c1c6['rows']=_0x1b1449;return _0x30c1c6;})[_0x2d6c('0x27')](respondWithFilteredResult(_0x31c1e8,_0x22d401))['catch'](handleError(_0x31c1e8,null));};exports[_0x2d6c('0x45')]=function(_0x1083e7,_0x361886){var _0x5570a0={'raw':!![],'where':{'id':_0x1083e7['params']['id']}},_0x1167ab={};_0x1167ab[_0x2d6c('0x30')]=_[_0x2d6c('0x32')](db[_0x2d6c('0x2c')][_0x2d6c('0x2d')]);_0x1167ab['query']=_[_0x2d6c('0x32')](_0x1083e7[_0x2d6c('0x33')]);_0x1167ab[_0x2d6c('0x34')]=_[_0x2d6c('0x35')](_0x1167ab['model'],_0x1167ab[_0x2d6c('0x33')]);_0x5570a0[_0x2d6c('0x36')]=_[_0x2d6c('0x35')](_0x1167ab[_0x2d6c('0x30')],qs['fields'](_0x1083e7[_0x2d6c('0x33')][_0x2d6c('0x37')]));_0x5570a0['attributes']=_0x5570a0[_0x2d6c('0x36')][_0x2d6c('0x38')]?_0x5570a0['attributes']:_0x1167ab[_0x2d6c('0x30')];if(_0x1083e7[_0x2d6c('0x33')][_0x2d6c('0x43')]){_0x5570a0[_0x2d6c('0x44')]=[{'all':!![]}];}_0x5570a0=_[_0x2d6c('0x40')]({},_0x5570a0,_0x1083e7['options']);return db[_0x2d6c('0x2c')][_0x2d6c('0x46')](_0x5570a0)[_0x2d6c('0x27')](handleEntityNotFound(_0x361886,null))['then'](respondWithResult(_0x361886,null))[_0x2d6c('0x47')](handleError(_0x361886,null));};exports['create']=function(_0xe0f2aa,_0x462a53){return db[_0x2d6c('0x2c')][_0x2d6c('0x48')](_0xe0f2aa[_0x2d6c('0x49')],{})['then'](respondWithResult(_0x462a53,0xc9))['catch'](handleError(_0x462a53,null));};exports[_0x2d6c('0x26')]=function(_0x202efd,_0x16f42){if(_0x202efd[_0x2d6c('0x49')]['id']){delete _0x202efd['body']['id'];}return db[_0x2d6c('0x2c')][_0x2d6c('0x46')]({'where':{'id':_0x202efd['params']['id']}})['then'](handleEntityNotFound(_0x16f42,null))['then'](saveUpdates(_0x202efd[_0x2d6c('0x49')],null))[_0x2d6c('0x27')](respondWithResult(_0x16f42,null))[_0x2d6c('0x47')](handleError(_0x16f42,null));};exports[_0x2d6c('0x4a')]=function(_0xf32285,_0x951eb8){return db[_0x2d6c('0x2c')][_0x2d6c('0x46')]({'where':{'id':_0xf32285[_0x2d6c('0x4b')]['id']}})[_0x2d6c('0x27')](handleEntityNotFound(_0x951eb8,null))[_0x2d6c('0x27')](removeEntity(_0x951eb8,null))[_0x2d6c('0x47')](handleError(_0x951eb8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c23ccbb..a36f229 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 _0x6f4b=['idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','int_salesforce_fields','salesforce_unique_index'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x6f4b,0x113));var _0xb6f4=function(_0x1f55af,_0x105334){_0x1f55af=_0x1f55af-0x0;var _0x5da1a0=_0x6f4b[_0x1f55af];return _0x5da1a0;};'use strict';var _=require('lodash');var util=require(_0xb6f4('0x0'));var logger=require(_0xb6f4('0x1'))('api');var moment=require(_0xb6f4('0x2'));var BPromise=require(_0xb6f4('0x3'));var rp=require(_0xb6f4('0x4'));var fs=require('fs');var path=require(_0xb6f4('0x5'));var rimraf=require('rimraf');var config=require(_0xb6f4('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0xb6f4('0x7')]=function(_0xa53b39,_0xaa5145){return _0xa53b39[_0xb6f4('0x8')]('SalesforceField',attributes,{'tableName':_0xb6f4('0x9'),'paranoid':![],'indexes':[{'name':_0xb6f4('0xa'),'fields':[_0xb6f4('0xb'),_0xb6f4('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d7e=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','../../config/logger','api','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1d7e,0xe0));var _0xe1d7=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x1d7e[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0xe1d7('0x0'));var util=require('util');var logger=require(_0xe1d7('0x1'))(_0xe1d7('0x2'));var moment=require('moment');var BPromise=require(_0xe1d7('0x3'));var rp=require(_0xe1d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var attributes=require(_0xe1d7('0x7'));module['exports']=function(_0x4dbe04,_0x5f1ca6){return _0x4dbe04['define'](_0xe1d7('0x8'),attributes,{'tableName':_0xe1d7('0x9'),'paranoid':![],'indexes':[{'name':_0xe1d7('0xa'),'fields':[_0xe1d7('0xb'),'FieldId'],'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 9606d7d..53015de 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 _0x84b7=['result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1d42b4,_0x2daa54){var _0xd4de0b=function(_0x2cd33a){while(--_0x2cd33a){_0x1d42b4['push'](_0x1d42b4['shift']());}};_0xd4de0b(++_0x2daa54);}(_0x84b7,0x141));var _0x784b=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x84b7[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x784b('0x0'));var util=require(_0x784b('0x1'));var moment=require('moment');var BPromise=require(_0x784b('0x2'));var rs=require(_0x784b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x784b('0x4'))['db'];var utils=require(_0x784b('0x5'));var logger=require('../../config/logger')(_0x784b('0x6'));var config=require(_0x784b('0x7'));var jayson=require(_0x784b('0x8'));var client=jayson['client'][_0x784b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49f146,_0x3d79ac,_0x291bd3){return new BPromise(function(_0x3f514b,_0x1d7bb2){return client['request'](_0x49f146,_0x291bd3)[_0x784b('0xa')](function(_0x2468b6){logger[_0x784b('0xb')](_0x784b('0xc'),_0x3d79ac,_0x784b('0xd'));logger[_0x784b('0xe')](_0x784b('0xf'),_0x3d79ac,_0x784b('0xd'),JSON[_0x784b('0x10')](_0x2468b6));if(_0x2468b6[_0x784b('0x11')]){if(_0x2468b6[_0x784b('0x11')]['code']===0x1f4){logger[_0x784b('0x11')](_0x784b('0xc'),_0x3d79ac,_0x2468b6[_0x784b('0x11')][_0x784b('0x12')]);return _0x1d7bb2(_0x2468b6[_0x784b('0x11')]['message']);}logger[_0x784b('0x11')]('SalesforceField,\x20%s,\x20%s',_0x3d79ac,_0x2468b6[_0x784b('0x11')]['message']);return _0x3f514b(_0x2468b6[_0x784b('0x11')][_0x784b('0x12')]);}else{logger[_0x784b('0xb')](_0x784b('0xc'),_0x3d79ac,_0x784b('0xd'));_0x3f514b(_0x2468b6[_0x784b('0x13')][_0x784b('0x12')]);}})['catch'](function(_0x378a4b){logger[_0x784b('0x11')](_0x784b('0xc'),_0x3d79ac,_0x378a4b);_0x1d7bb2(_0x378a4b);});});} \ No newline at end of file +var _0xc7bb=['../../config/environment','jayson/promise','client','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xc7bb,0x9a));var _0xbc7b=function(_0x13c720,_0x5b6f31){_0x13c720=_0x13c720-0x0;var _0x36a905=_0xc7bb[_0x13c720];return _0x36a905;};'use strict';var _=require(_0xbc7b('0x0'));var util=require('util');var moment=require(_0xbc7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc7b('0x3'))['db'];var utils=require(_0xbc7b('0x4'));var logger=require('../../config/logger')(_0xbc7b('0x5'));var config=require(_0xbc7b('0x6'));var jayson=require(_0xbc7b('0x7'));var client=jayson[_0xbc7b('0x8')][_0xbc7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451bb0,_0x30a1a3,_0x5c3d96){return new BPromise(function(_0x203295,_0x139b21){return client['request'](_0x451bb0,_0x5c3d96)['then'](function(_0x2aed71){logger[_0xbc7b('0xa')](_0xbc7b('0xb'),_0x30a1a3,_0xbc7b('0xc'));logger[_0xbc7b('0xd')](_0xbc7b('0xe'),_0x30a1a3,'request\x20sent',JSON[_0xbc7b('0xf')](_0x2aed71));if(_0x2aed71['error']){if(_0x2aed71[_0xbc7b('0x10')][_0xbc7b('0x11')]===0x1f4){logger['error'](_0xbc7b('0xb'),_0x30a1a3,_0x2aed71[_0xbc7b('0x10')][_0xbc7b('0x12')]);return _0x139b21(_0x2aed71['error'][_0xbc7b('0x12')]);}logger[_0xbc7b('0x10')](_0xbc7b('0xb'),_0x30a1a3,_0x2aed71['error'][_0xbc7b('0x12')]);return _0x203295(_0x2aed71[_0xbc7b('0x10')][_0xbc7b('0x12')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x30a1a3,'request\x20sent');_0x203295(_0x2aed71[_0xbc7b('0x13')][_0xbc7b('0x12')]);}})['catch'](function(_0x4957d1){logger[_0xbc7b('0x10')]('SalesforceField,\x20%s,\x20%s',_0x30a1a3,_0x4957d1);_0x139b21(_0x4957d1);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 558a241..0b16661 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 _0x222b=['index','show','/:id/configurations','getConfigurations','/:id/fields','post','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0x3a7020,_0x8ef6ae){var _0x5cd963=function(_0x1d0ccf){while(--_0x1d0ccf){_0x3a7020['push'](_0x3a7020['shift']());}};_0x5cd963(++_0x8ef6ae);}(_0x222b,0xee));var _0xb222=function(_0x1f37e1,_0x1b42ea){_0x1f37e1=_0x1f37e1-0x0;var _0x329f45=_0x222b[_0x1f37e1];return _0x329f45;};'use strict';var multer=require(_0xb222('0x0'));var util=require('util');var path=require(_0xb222('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb222('0x2')]();var fs_extra=require(_0xb222('0x3'));var auth=require(_0xb222('0x4'));var interaction=require(_0xb222('0x5'));var config=require('../../config/environment');var controller=require(_0xb222('0x6'));router[_0xb222('0x7')]('/',auth[_0xb222('0x8')](),controller[_0xb222('0x9')]);router[_0xb222('0x7')]('/:id',auth[_0xb222('0x8')](),controller[_0xb222('0xa')]);router[_0xb222('0x7')](_0xb222('0xb'),auth['isAuthenticated'](),controller[_0xb222('0xc')]);router[_0xb222('0x7')](_0xb222('0xd'),auth[_0xb222('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb222('0xe')](_0xb222('0xb'),auth[_0xb222('0x8')](),controller['addConfiguration']);router['put'](_0xb222('0xf'),auth[_0xb222('0x8')](),controller['update']);router[_0xb222('0x10')](_0xb222('0xf'),auth[_0xb222('0x8')](),controller[_0xb222('0x11')]);module[_0xb222('0x12')]=router; \ No newline at end of file +var _0x9b69=['getConfigurations','/:id/fields','post','addConfiguration','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','show','/:id/configurations'];(function(_0x19ecb3,_0xa45bee){var _0x1c510e=function(_0x9440b9){while(--_0x9440b9){_0x19ecb3['push'](_0x19ecb3['shift']());}};_0x1c510e(++_0xa45bee);}(_0x9b69,0x196));var _0x99b6=function(_0x4dbfcd,_0x1b65c5){_0x4dbfcd=_0x4dbfcd-0x0;var _0x2b2e9f=_0x9b69[_0x4dbfcd];return _0x2b2e9f;};'use strict';var multer=require(_0x99b6('0x0'));var util=require('util');var path=require(_0x99b6('0x1'));var timeout=require(_0x99b6('0x2'));var express=require(_0x99b6('0x3'));var router=express[_0x99b6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x99b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x99b6('0x6'));var controller=require(_0x99b6('0x7'));router[_0x99b6('0x8')]('/',auth[_0x99b6('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x99b6('0xa')]);router[_0x99b6('0x8')](_0x99b6('0xb'),auth[_0x99b6('0x9')](),controller[_0x99b6('0xc')]);router[_0x99b6('0x8')](_0x99b6('0xd'),auth[_0x99b6('0x9')](),controller['getFields']);router[_0x99b6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x99b6('0xe')](_0x99b6('0xb'),auth[_0x99b6('0x9')](),controller[_0x99b6('0xf')]);router['put'](_0x99b6('0x10'),auth[_0x99b6('0x9')](),controller['update']);router['delete']('/:id',auth[_0x99b6('0x9')](),controller[_0x99b6('0x11')]);module[_0x99b6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ee4abd8..ccd9bbe 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 _0x6eab=['remoteUri','sequelize','exports','STRING'];(function(_0x564a68,_0x565c3b){var _0x4518ba=function(_0x2e693c){while(--_0x2e693c){_0x564a68['push'](_0x564a68['shift']());}};_0x4518ba(++_0x565c3b);}(_0x6eab,0x1c5));var _0xb6ea=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0x6eab[_0x36bc58];return _0x4a547e;};'use strict';var Sequelize=require(_0xb6ea('0x0'));module[_0xb6ea('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb6ea('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb6ea('0x2')]},'remoteUri':{'type':Sequelize[_0xb6ea('0x2')],'unique':_0xb6ea('0x3')},'serverUrl':{'type':Sequelize[_0xb6ea('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xbc57=['remoteUri','sequelize','exports','STRING','username'];(function(_0x24e5a3,_0x271b96){var _0x84546d=function(_0x495538){while(--_0x495538){_0x24e5a3['push'](_0x24e5a3['shift']());}};_0x84546d(++_0x271b96);}(_0xbc57,0x16e));var _0x7bc5=function(_0x25f8ca,_0x23b450){_0x25f8ca=_0x25f8ca-0x0;var _0x25386e=_0xbc57[_0x25f8ca];return _0x25386e;};'use strict';var Sequelize=require(_0x7bc5('0x0'));module[_0x7bc5('0x1')]={'name':{'type':Sequelize[_0x7bc5('0x2')]},'description':{'type':Sequelize[_0x7bc5('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x7bc5('0x3')},'password':{'type':Sequelize[_0x7bc5('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7bc5('0x2')],'unique':_0x7bc5('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index a87ccc3..b33eedd 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 _0x25ca=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','ServicenowConfiguration','pick','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code','notify','incident_state','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_created_by','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','severity','sla_due','approval','comments_and_work_notes','sys_mod_count','escalation','upon_approval','location','username','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','password','GET','result','log','incident\x20table\x20objects','assign','remove','internalType','label','push','all','TCL:\x20_object','forEach','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ServicenowAccount','fieldName','type','key','model','keys','query','filters','attributes'];(function(_0x5bf55a,_0x493e6a){var _0x1a5e41=function(_0x77d4ed){while(--_0x77d4ed){_0x5bf55a['push'](_0x5bf55a['shift']());}};_0x1a5e41(++_0x493e6a);}(_0x25ca,0x83));var _0xa25c=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x25ca[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0xa25c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa25c('0x1'));var jsonpatch=require(_0xa25c('0x2'));var rp=require(_0xa25c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa25c('0x4'));var path=require(_0xa25c('0x5'));var sox=require(_0xa25c('0x6'));var csv=require(_0xa25c('0x7'));var ejs=require(_0xa25c('0x8'));var fs=require('fs');var fs_extra=require(_0xa25c('0x9'));var _=require('lodash');var squel=require(_0xa25c('0xa'));var crypto=require(_0xa25c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa25c('0xc'));var toCsv=require(_0xa25c('0x7'));var querystring=require(_0xa25c('0xd'));var Papa=require(_0xa25c('0xe'));var Redis=require(_0xa25c('0xf'));var authService=require(_0xa25c('0x10'));var qs=require(_0xa25c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa25c('0x12'))('api');var utils=require(_0xa25c('0x13'));var config=require(_0xa25c('0x14'));var licenseUtil=require(_0xa25c('0x15'));var db=require(_0xa25c('0x16'))['db'];var integrations=require(_0xa25c('0x17'));function respondWithStatusCode(_0x1fc76a,_0x2ef6c8){_0x2ef6c8=_0x2ef6c8||0xcc;return function(_0x4bf4b2){if(_0x4bf4b2){return _0x1fc76a[_0xa25c('0x18')](_0x2ef6c8);}return _0x1fc76a[_0xa25c('0x19')](_0x2ef6c8)[_0xa25c('0x1a')]();};}function respondWithResult(_0x31f30f,_0x23153e){_0x23153e=_0x23153e||0xc8;return function(_0x488934){if(_0x488934){return _0x31f30f[_0xa25c('0x19')](_0x23153e)[_0xa25c('0x1b')](_0x488934);}};}function respondWithFilteredResult(_0x5d682,_0x1e42c8){return function(_0x231101){if(_0x231101){var _0x2bd925=typeof _0x1e42c8[_0xa25c('0x1c')]===_0xa25c('0x1d')&&typeof _0x1e42c8[_0xa25c('0x1e')]===_0xa25c('0x1d');var _0x239727=_0x231101['count'];var _0x29c6ce=_0x2bd925?0x0:_0x1e42c8[_0xa25c('0x1c')];var _0x542a70=_0x2bd925?_0x231101[_0xa25c('0x1f')]:_0x1e42c8['offset']+_0x1e42c8[_0xa25c('0x1e')];var _0x1b044b;if(_0x542a70>=_0x239727){_0x542a70=_0x239727;_0x1b044b=0xc8;}else{_0x1b044b=0xce;}_0x5d682[_0xa25c('0x19')](_0x1b044b);return _0x5d682[_0xa25c('0x20')](_0xa25c('0x21'),_0x29c6ce+'-'+_0x542a70+'/'+_0x239727)[_0xa25c('0x1b')](_0x231101);}return null;};}function patchUpdates(_0x2dc824){return function(_0x1f9fa8){try{jsonpatch[_0xa25c('0x22')](_0x1f9fa8,_0x2dc824,!![]);}catch(_0x2a959e){return BPromise[_0xa25c('0x23')](_0x2a959e);}return _0x1f9fa8[_0xa25c('0x24')]();};}function saveUpdates(_0x593ef6,_0x5d4355){return function(_0xc04864){if(_0xc04864){return _0xc04864[_0xa25c('0x25')](_0x593ef6)[_0xa25c('0x26')](function(_0x205c5f){return _0x205c5f;});}return null;};}function removeEntity(_0x186ed1,_0xa218f5){return function(_0x5c8ce1){if(_0x5c8ce1){return _0x5c8ce1[_0xa25c('0x27')]()[_0xa25c('0x26')](function(){_0x186ed1['status'](0xcc)[_0xa25c('0x1a')]();});}};}function handleEntityNotFound(_0x481ee7,_0x27389e){return function(_0x583ae7){if(!_0x583ae7){_0x481ee7['sendStatus'](0x194);}return _0x583ae7;};}function handleError(_0x300ed5,_0x578b23){_0x578b23=_0x578b23||0x1f4;return function(_0x4af704){logger[_0xa25c('0x28')](_0x4af704['stack']);if(_0x4af704[_0xa25c('0x29')]){delete _0x4af704['name'];}_0x300ed5['status'](_0x578b23)[_0xa25c('0x2a')](_0x4af704);};}exports[_0xa25c('0x2b')]=function(_0x5965bc,_0x21632d){var _0x5cd087={},_0x3a2974={},_0x2f1858={'count':0x0,'rows':[]};var _0x1bcb85=_[_0xa25c('0x2c')](db[_0xa25c('0x2d')]['rawAttributes'],function(_0x16eb62){return{'name':_0x16eb62[_0xa25c('0x2e')],'type':_0x16eb62[_0xa25c('0x2f')][_0xa25c('0x30')]};});_0x3a2974[_0xa25c('0x31')]=_[_0xa25c('0x2c')](_0x1bcb85,_0xa25c('0x29'));_0x3a2974['query']=_[_0xa25c('0x32')](_0x5965bc[_0xa25c('0x33')]);_0x3a2974[_0xa25c('0x34')]=_['intersection'](_0x3a2974['model'],_0x3a2974['query']);_0x5cd087[_0xa25c('0x35')]=_[_0xa25c('0x36')](_0x3a2974[_0xa25c('0x31')],qs[_0xa25c('0x37')](_0x5965bc[_0xa25c('0x33')][_0xa25c('0x37')]));_0x5cd087[_0xa25c('0x35')]=_0x5cd087[_0xa25c('0x35')][_0xa25c('0x38')]?_0x5cd087[_0xa25c('0x35')]:_0x3a2974[_0xa25c('0x31')];if(!_0x5965bc[_0xa25c('0x33')][_0xa25c('0x39')](_0xa25c('0x3a'))){_0x5cd087['limit']=qs[_0xa25c('0x1e')](_0x5965bc['query'][_0xa25c('0x1e')]);_0x5cd087[_0xa25c('0x1c')]=qs[_0xa25c('0x1c')](_0x5965bc['query'][_0xa25c('0x1c')]);}_0x5cd087[_0xa25c('0x3b')]=qs[_0xa25c('0x3c')](_0x5965bc[_0xa25c('0x33')]['sort']);_0x5cd087[_0xa25c('0x3d')]=qs[_0xa25c('0x34')](_['pick'](_0x5965bc[_0xa25c('0x33')],_0x3a2974[_0xa25c('0x34')]),_0x1bcb85);if(_0x5965bc[_0xa25c('0x33')][_0xa25c('0x3e')]){_0x5cd087[_0xa25c('0x3d')]=_[_0xa25c('0x3f')](_0x5cd087[_0xa25c('0x3d')],{'$or':_[_0xa25c('0x2c')](_0x1bcb85,function(_0x36ecbe){if(_0x36ecbe[_0xa25c('0x2f')]!=='VIRTUAL'){var _0x106c28={};_0x106c28[_0x36ecbe[_0xa25c('0x29')]]={'$like':'%'+_0x5965bc['query'][_0xa25c('0x3e')]+'%'};return _0x106c28;}})});}_0x5cd087=_['merge']({},_0x5cd087,_0x5965bc[_0xa25c('0x40')]);var _0x1a84fa={'where':_0x5cd087[_0xa25c('0x3d')]};return db[_0xa25c('0x2d')][_0xa25c('0x1f')](_0x1a84fa)[_0xa25c('0x26')](function(_0x26f46f){_0x2f1858['count']=_0x26f46f;if(_0x5965bc[_0xa25c('0x33')][_0xa25c('0x41')]){_0x5cd087[_0xa25c('0x42')]=[{'all':!![]}];}return db[_0xa25c('0x2d')][_0xa25c('0x43')](_0x5cd087);})[_0xa25c('0x26')](function(_0x29dbd8){_0x2f1858[_0xa25c('0x44')]=_0x29dbd8;return _0x2f1858;})[_0xa25c('0x26')](respondWithFilteredResult(_0x21632d,_0x5cd087))[_0xa25c('0x45')](handleError(_0x21632d,null));};exports[_0xa25c('0x46')]=function(_0x29fc16,_0x3838bb){var _0x1fbffb={'raw':![],'where':{'id':_0x29fc16[_0xa25c('0x47')]['id']}},_0x280ae8={};_0x280ae8[_0xa25c('0x31')]=_[_0xa25c('0x32')](db[_0xa25c('0x2d')][_0xa25c('0x48')]);_0x280ae8['query']=_[_0xa25c('0x32')](_0x29fc16[_0xa25c('0x33')]);_0x280ae8['filters']=_[_0xa25c('0x36')](_0x280ae8[_0xa25c('0x31')],_0x280ae8[_0xa25c('0x33')]);_0x1fbffb[_0xa25c('0x35')]=_[_0xa25c('0x36')](_0x280ae8['model'],qs[_0xa25c('0x37')](_0x29fc16[_0xa25c('0x33')][_0xa25c('0x37')]));_0x1fbffb[_0xa25c('0x35')]=_0x1fbffb[_0xa25c('0x35')][_0xa25c('0x38')]?_0x1fbffb[_0xa25c('0x35')]:_0x280ae8[_0xa25c('0x31')];if(_0x29fc16[_0xa25c('0x33')][_0xa25c('0x41')]){_0x1fbffb['include']=[{'all':!![]}];}_0x1fbffb=_[_0xa25c('0x3f')]({},_0x1fbffb,_0x29fc16[_0xa25c('0x40')]);return db[_0xa25c('0x2d')][_0xa25c('0x49')](_0x1fbffb)[_0xa25c('0x26')](handleEntityNotFound(_0x3838bb,null))[_0xa25c('0x26')](respondWithResult(_0x3838bb,null))['catch'](handleError(_0x3838bb,null));};exports[_0xa25c('0x4a')]=function(_0x48529a,_0xa2c686){return db[_0xa25c('0x2d')][_0xa25c('0x4a')](_0x48529a['body'],{})[_0xa25c('0x26')](respondWithResult(_0xa2c686,0xc9))[_0xa25c('0x45')](handleError(_0xa2c686,null));};exports[_0xa25c('0x25')]=function(_0x4a7290,_0x4ca658){if(_0x4a7290[_0xa25c('0x4b')]['id']){delete _0x4a7290[_0xa25c('0x4b')]['id'];}return db[_0xa25c('0x2d')]['find']({'where':{'id':_0x4a7290[_0xa25c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ca658,null))['then'](saveUpdates(_0x4a7290[_0xa25c('0x4b')],null))['then'](respondWithResult(_0x4ca658,null))[_0xa25c('0x45')](handleError(_0x4ca658,null));};exports['destroy']=function(_0x4f360a,_0x2196e){return db['ServicenowAccount'][_0xa25c('0x49')]({'where':{'id':_0x4f360a['params']['id']}})[_0xa25c('0x26')](handleEntityNotFound(_0x2196e,null))[_0xa25c('0x26')](removeEntity(_0x2196e,null))['catch'](handleError(_0x2196e,null));};exports['getConfigurations']=function(_0x4204d9,_0x5d3aed,_0xa776ca){var _0x1f0764={};var _0x1f3f83={};var _0xd0817;var _0x168ac0;return db['ServicenowAccount']['findOne']({'where':{'id':_0x4204d9[_0xa25c('0x47')]['id']}})[_0xa25c('0x26')](handleEntityNotFound(_0x5d3aed,null))[_0xa25c('0x26')](function(_0x205571){if(_0x205571){_0xd0817=_0x205571;_0x1f3f83[_0xa25c('0x31')]=_[_0xa25c('0x32')](db[_0xa25c('0x4c')][_0xa25c('0x48')]);_0x1f3f83[_0xa25c('0x33')]=_[_0xa25c('0x32')](_0x4204d9['query']);_0x1f3f83[_0xa25c('0x34')]=_[_0xa25c('0x36')](_0x1f3f83[_0xa25c('0x31')],_0x1f3f83[_0xa25c('0x33')]);_0x1f0764[_0xa25c('0x35')]=_[_0xa25c('0x36')](_0x1f3f83[_0xa25c('0x31')],qs[_0xa25c('0x37')](_0x4204d9[_0xa25c('0x33')][_0xa25c('0x37')]));_0x1f0764[_0xa25c('0x35')]=_0x1f0764[_0xa25c('0x35')][_0xa25c('0x38')]?_0x1f0764[_0xa25c('0x35')]:_0x1f3f83[_0xa25c('0x31')];_0x1f0764[_0xa25c('0x3b')]=qs[_0xa25c('0x3c')](_0x4204d9['query'][_0xa25c('0x3c')]);_0x1f0764[_0xa25c('0x3d')]=qs['filters'](_[_0xa25c('0x4d')](_0x4204d9['query'],_0x1f3f83[_0xa25c('0x34')]));if(_0x4204d9[_0xa25c('0x33')]['filter']){_0x1f0764[_0xa25c('0x3d')]=_[_0xa25c('0x3f')](_0x1f0764[_0xa25c('0x3d')],{'$or':_[_0xa25c('0x2c')](_0x1f0764[_0xa25c('0x35')],function(_0x224cc2){var _0x225f5d={};_0x225f5d[_0x224cc2]={'$like':'%'+_0x4204d9[_0xa25c('0x33')]['filter']+'%'};return _0x225f5d;})});}_0x1f0764=_[_0xa25c('0x3f')]({},_0x1f0764,_0x4204d9[_0xa25c('0x40')]);return _0xd0817[_0xa25c('0x4e')](_0x1f0764);}})[_0xa25c('0x26')](function(_0x266216){if(_0x266216){_0x168ac0=_0x266216['length'];if(!_0x4204d9[_0xa25c('0x33')][_0xa25c('0x39')](_0xa25c('0x3a'))){_0x1f0764['limit']=qs[_0xa25c('0x1e')](_0x4204d9[_0xa25c('0x33')][_0xa25c('0x1e')]);_0x1f0764['offset']=qs[_0xa25c('0x1c')](_0x4204d9[_0xa25c('0x33')][_0xa25c('0x1c')]);}return _0xd0817[_0xa25c('0x4e')](_0x1f0764);}})[_0xa25c('0x26')](function(_0x5c2d2f){if(_0x5c2d2f){return _0x5c2d2f?{'count':_0x168ac0,'rows':_0x5c2d2f}:null;}})[_0xa25c('0x26')](respondWithResult(_0x5d3aed,null))[_0xa25c('0x45')](handleError(_0x5d3aed,null));};exports['addConfiguration']=function(_0x41ef93,_0x5aa74d,_0x32a6fa){if(_0x41ef93[_0xa25c('0x4b')]['id']){delete _0x41ef93[_0xa25c('0x4b')]['id'];}return db[_0xa25c('0x2d')][_0xa25c('0x4f')]({'where':{'id':_0x41ef93[_0xa25c('0x47')]['id']}})['then'](handleEntityNotFound(_0x5aa74d,null))['then'](function(_0x5dfca1){if(_0x5dfca1){_0x41ef93['body'][_0xa25c('0x50')]=_0x5dfca1['id'];_0x41ef93['body'][_0xa25c('0x51')]=integrations['getSubjects'](_0x41ef93[_0xa25c('0x4b')][_0xa25c('0x52')],_0x41ef93[_0xa25c('0x4b')][_0xa25c('0x2f')]);_0x41ef93['body'][_0xa25c('0x53')]=integrations[_0xa25c('0x54')](_0x41ef93[_0xa25c('0x4b')][_0xa25c('0x52')],_0x41ef93['body'][_0xa25c('0x2f')]);return db[_0xa25c('0x4c')][_0xa25c('0x4a')](_0x41ef93['body'],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0xa25c('0x55')],'as':_0xa25c('0x53')}]});}return null;})[_0xa25c('0x26')](respondWithResult(_0x5aa74d,null))[_0xa25c('0x45')](handleError(_0x5aa74d,null));};exports[_0xa25c('0x56')]=function(_0x4f1948,_0x26c7f6,_0x24a7fd){var _0x276910=['made_sla','hold_reason',_0xa25c('0x57'),_0xa25c('0x58'),_0xa25c('0x59'),_0xa25c('0x5a'),_0xa25c('0x5b'),'severity',_0xa25c('0x5c')];var _0x2fc4bf=[_0xa25c('0x5d'),_0xa25c('0x5e'),_0xa25c('0x5f'),_0xa25c('0x60'),_0xa25c('0x61'),_0xa25c('0x62'),_0xa25c('0x63'),_0xa25c('0x64'),_0xa25c('0x65'),_0xa25c('0x66'),_0xa25c('0x67'),_0xa25c('0x68'),_0xa25c('0x69'),'user_input',_0xa25c('0x6a'),'sys_domain','state',_0xa25c('0x6b'),_0xa25c('0x57'),'order','calendar_stc','closed_at','cmdb_ci',_0xa25c('0x6c'),_0xa25c('0x6d'),_0xa25c('0x6e'),_0xa25c('0x6f'),_0xa25c('0x70'),_0xa25c('0x71'),_0xa25c('0x72'),_0xa25c('0x73'),'time_worked',_0xa25c('0x74'),_0xa25c('0x75'),_0xa25c('0x76'),_0xa25c('0x77'),_0xa25c('0x78'),_0xa25c('0x79'),_0xa25c('0x7a'),'caller_id',_0xa25c('0x7b'),_0xa25c('0x58'),_0xa25c('0x7c'),_0xa25c('0x7d'),_0xa25c('0x59'),_0xa25c('0x7e'),_0xa25c('0x7f'),_0xa25c('0x80'),_0xa25c('0x81'),_0xa25c('0x82'),_0xa25c('0x83'),_0xa25c('0x84'),_0xa25c('0x85'),'notify',_0xa25c('0x86'),_0xa25c('0x87'),_0xa25c('0x88'),'follow_up',_0xa25c('0x89'),_0xa25c('0x8a'),_0xa25c('0x8b'),_0xa25c('0x8c'),_0xa25c('0x5b'),_0xa25c('0x8d'),_0xa25c('0x8e'),'company',_0xa25c('0x8f'),_0xa25c('0x90'),_0xa25c('0x91'),_0xa25c('0x92'),'comments',_0xa25c('0x93'),_0xa25c('0x94'),_0xa25c('0x95'),'due_date',_0xa25c('0x96'),'reopen_count','sys_tags',_0xa25c('0x97'),_0xa25c('0x98'),'correlation_id',_0xa25c('0x99'),_0xa25c('0x5c')];var _0x40363c='';var _0x49cbad='';var _0x28cf35=[];var _0x17147f='';var _0x404b4e='';var _0x470f2b=[];var _0x1e712b='';var _0x1b5ed6='';var _0x44c883={};var _0x1ae48e='';return db['ServicenowAccount'][_0xa25c('0x4f')]({'where':{'id':_0x4f1948[_0xa25c('0x47')]['id']},'attributes':['id',_0xa25c('0x9a'),'password','email','remoteUri',_0xa25c('0x9b')]})[_0xa25c('0x26')](handleEntityNotFound(_0x26c7f6,null))['then'](function(_0x46f811){if(_0x46f811){_0x1ae48e=_0x46f811[_0xa25c('0x9c')];var _0x551aaf=_0x1ae48e[_0xa25c('0x9d')](-0x1);if(_0x551aaf==='/'){_0x1ae48e=_0x1ae48e[_0xa25c('0x9e')](0x0,_0x1ae48e[_0xa25c('0x9f')](_0x551aaf));}_0x1b5ed6=util['format']('%s/api/now/doc/table/schema/',_0x1ae48e);_0x1e712b=util[_0xa25c('0xa0')](_0xa25c('0xa1'),_0x1ae48e);_0x44c883={'user':_0x46f811['username'],'pass':_0x46f811[_0xa25c('0xa2')]};var _0x35f6ee={'method':_0xa25c('0xa3'),'uri':_0x1b5ed6+'incident?sysparm_display_value=all','auth':_0x44c883,'json':!![]};return rp(_0x35f6ee);}})['then'](function(_0x21124a){if(_0x21124a[_0xa25c('0xa4')][_0xa25c('0x38')]>0x0){_0x40363c=_0x21124a['result'];}console[_0xa25c('0xa5')](_0xa25c('0xa6'),_0x40363c);_0x470f2b=[];_0x49cbad=Object[_0xa25c('0xa7')]([],_0x40363c);_[_0xa25c('0xa8')](_0x49cbad,function(_0x5a6a3a){return!_0x276910['includes'](_0x5a6a3a[_0xa25c('0x29')]);});_0x49cbad['forEach'](function(_0x351aef){var _0x3a9acb=createFieldObject(_0x1e712b,_0x44c883,_0x351aef[_0xa25c('0xa9')],_0x351aef[_0xa25c('0x29')],_0x351aef[_0xa25c('0xaa')],![]);_0x470f2b[_0xa25c('0xab')](_0x3a9acb);});return Promise[_0xa25c('0xac')](_0x470f2b);})[_0xa25c('0x26')](function(_0x503a74){_0x28cf35=_0x503a74;_0x17147f=Object['assign']([],_0x40363c);console[_0xa25c('0xa5')](_0xa25c('0xad'),_0x40363c);_[_0xa25c('0xa8')](_0x17147f,function(_0x518479){return _0x2fc4bf['includes'](_0x518479['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x17147f);_0x470f2b=[];_0x17147f[_0xa25c('0xae')](function(_0x3c83df){var _0x55f25f=createFieldObject(_0x1e712b,_0x44c883,_0x3c83df[_0xa25c('0xa9')],_0x3c83df[_0xa25c('0x29')],_0x3c83df[_0xa25c('0xaa')],!![]);_0x470f2b[_0xa25c('0xab')](_0x55f25f);});return Promise[_0xa25c('0xac')](_0x470f2b);})['then'](function(_0x250bc5){_0x404b4e=_0x250bc5;var _0x1ee6ec=_0x28cf35['concat'](_0x404b4e);return{'count':_0x1ee6ec[_0xa25c('0x38')],'rows':_0x1ee6ec};})[_0xa25c('0x26')](respondWithResult(_0x26c7f6,null))[_0xa25c('0x45')](function(_0x5cfe9c){console[_0xa25c('0xa5')](_0xa25c('0xaf')+_0x5cfe9c);var _0x29627b=_0x4f1948[_0xa25c('0x33')]['test']?0x1f4:_0x5cfe9c[_0xa25c('0xb0')]||0x1f4;logger[_0xa25c('0x28')](_0x5cfe9c['stack']);delete _0x5cfe9c['name'];if(_0x29627b===0x191){_0x29627b=0x190;}_0x26c7f6[_0xa25c('0x19')](_0x29627b)[_0xa25c('0x2a')](_0x4f1948['query']['test']?{'message':_0xa25c('0xb1'),'statusCode':_0x5cfe9c['statusCode']}:_0x5cfe9c);});};function createFieldObject(_0x5b891b,_0x841fd2,_0x75b8ba,_0x499584,_0x6317b6,_0x81f2d4){return new Promise(function(_0x5a7b23,_0x5dc10d){var _0x30515b={'id':_0x499584,'name':_0x6317b6,'custom':_0x81f2d4};if(_0x75b8ba===_0xa25c('0xb2')){_0x30515b['options']=[{'name':'True','value':_0xa25c('0xb3')},{'name':_0xa25c('0xb4'),'value':_0xa25c('0xb5')}];_0x5a7b23(_0x30515b);}else{var _0xd73bc1={'method':_0xa25c('0xa3'),'uri':_0x5b891b+_0xa25c('0xb6')+_0x499584,'auth':_0x841fd2,'json':!![]};return rp(_0xd73bc1)[_0xa25c('0x26')](function(_0x122bc3){var _0x162bb3=[];if(_0x122bc3[_0xa25c('0xa4')]['length']>0x0){_0x122bc3[_0xa25c('0xa4')][_0xa25c('0xae')](function(_0x1402fb){if(_0x1402fb[_0xa25c('0xb7')]==='false'){var _0x5b61df={'name':_0x1402fb[_0xa25c('0xaa')],'value':_0x1402fb[_0xa25c('0xb8')]};_0x162bb3[_0xa25c('0xab')](_0x5b61df);}});}_0x30515b[_0xa25c('0x40')]=_0x162bb3;if(_0x30515b[_0xa25c('0x40')][_0xa25c('0x38')]>0x0){_0x5a7b23(_0x30515b);}else{if(_0x81f2d4==![]){_0x5a7b23();}else{_0x5a7b23(_0x30515b);}}});}});} \ No newline at end of file +var _0x6f24=['slice','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','GET','result','log','incident\x20table\x20objects','includes','forEach','internalType','label','push','all','assign','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','findOne','rawAttributes','getConfigurations','Subjects','getSubjects','channel','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','knowledge','subcategory','close_code','notify','incident_state','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','closed_by','company','reassignment_count','assigned_to','comments','sla_due','sys_tags','escalation','upon_approval','location','category','username','email','remoteUri','serverUrl'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x6f24,0xd3));var _0x46f2=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x6f24[_0x2932cf];return _0x1711dd;};'use strict';var emlformat=require(_0x46f2('0x0'));var rimraf=require(_0x46f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46f2('0x2'));var rp=require('request-promise');var moment=require(_0x46f2('0x3'));var BPromise=require(_0x46f2('0x4'));var Mustache=require(_0x46f2('0x5'));var util=require(_0x46f2('0x6'));var path=require('path');var sox=require(_0x46f2('0x7'));var csv=require(_0x46f2('0x8'));var ejs=require(_0x46f2('0x9'));var fs=require('fs');var fs_extra=require(_0x46f2('0xa'));var _=require(_0x46f2('0xb'));var squel=require(_0x46f2('0xc'));var crypto=require(_0x46f2('0xd'));var jsforce=require(_0x46f2('0xe'));var deskjs=require(_0x46f2('0xf'));var toCsv=require(_0x46f2('0x8'));var querystring=require(_0x46f2('0x10'));var Papa=require('papaparse');var Redis=require(_0x46f2('0x11'));var authService=require(_0x46f2('0x12'));var qs=require(_0x46f2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46f2('0x14'));var logger=require(_0x46f2('0x15'))(_0x46f2('0x16'));var utils=require(_0x46f2('0x17'));var config=require(_0x46f2('0x18'));var licenseUtil=require(_0x46f2('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x46f2('0x1a'));function respondWithStatusCode(_0x5b08e6,_0x3938a5){_0x3938a5=_0x3938a5||0xcc;return function(_0x62ebb8){if(_0x62ebb8){return _0x5b08e6[_0x46f2('0x1b')](_0x3938a5);}return _0x5b08e6[_0x46f2('0x1c')](_0x3938a5)[_0x46f2('0x1d')]();};}function respondWithResult(_0x23996b,_0x32b768){_0x32b768=_0x32b768||0xc8;return function(_0x4adb27){if(_0x4adb27){return _0x23996b['status'](_0x32b768)[_0x46f2('0x1e')](_0x4adb27);}};}function respondWithFilteredResult(_0x2c1e7f,_0x1f729e){return function(_0x35c317){if(_0x35c317){var _0x3cfe17=typeof _0x1f729e['offset']===_0x46f2('0x1f')&&typeof _0x1f729e[_0x46f2('0x20')]==='undefined';var _0x2fa448=_0x35c317[_0x46f2('0x21')];var _0x2e2209=_0x3cfe17?0x0:_0x1f729e[_0x46f2('0x22')];var _0x42340c=_0x3cfe17?_0x35c317[_0x46f2('0x21')]:_0x1f729e[_0x46f2('0x22')]+_0x1f729e[_0x46f2('0x20')];var _0x111b3e;if(_0x42340c>=_0x2fa448){_0x42340c=_0x2fa448;_0x111b3e=0xc8;}else{_0x111b3e=0xce;}_0x2c1e7f[_0x46f2('0x1c')](_0x111b3e);return _0x2c1e7f[_0x46f2('0x23')](_0x46f2('0x24'),_0x2e2209+'-'+_0x42340c+'/'+_0x2fa448)['json'](_0x35c317);}return null;};}function patchUpdates(_0x1b4177){return function(_0x217958){try{jsonpatch[_0x46f2('0x25')](_0x217958,_0x1b4177,!![]);}catch(_0xb610b1){return BPromise[_0x46f2('0x26')](_0xb610b1);}return _0x217958[_0x46f2('0x27')]();};}function saveUpdates(_0x3aa656,_0xae3e61){return function(_0x2cec44){if(_0x2cec44){return _0x2cec44['update'](_0x3aa656)[_0x46f2('0x28')](function(_0x46613e){return _0x46613e;});}return null;};}function removeEntity(_0x12a2e3,_0x1f2003){return function(_0x46792d){if(_0x46792d){return _0x46792d[_0x46f2('0x29')]()['then'](function(){_0x12a2e3['status'](0xcc)[_0x46f2('0x1d')]();});}};}function handleEntityNotFound(_0x2dbe43,_0x30a0d7){return function(_0x29eb45){if(!_0x29eb45){_0x2dbe43[_0x46f2('0x1b')](0x194);}return _0x29eb45;};}function handleError(_0x1d9bde,_0x11a8f8){_0x11a8f8=_0x11a8f8||0x1f4;return function(_0x93ba33){logger[_0x46f2('0x2a')](_0x93ba33[_0x46f2('0x2b')]);if(_0x93ba33[_0x46f2('0x2c')]){delete _0x93ba33[_0x46f2('0x2c')];}_0x1d9bde['status'](_0x11a8f8)[_0x46f2('0x2d')](_0x93ba33);};}exports[_0x46f2('0x2e')]=function(_0x2cd593,_0x293676){var _0x51a940={},_0x4e2daa={},_0x3b66d6={'count':0x0,'rows':[]};var _0x584710=_[_0x46f2('0x2f')](db[_0x46f2('0x30')]['rawAttributes'],function(_0x515234){return{'name':_0x515234[_0x46f2('0x31')],'type':_0x515234[_0x46f2('0x32')][_0x46f2('0x33')]};});_0x4e2daa[_0x46f2('0x34')]=_['map'](_0x584710,_0x46f2('0x2c'));_0x4e2daa[_0x46f2('0x35')]=_['keys'](_0x2cd593[_0x46f2('0x35')]);_0x4e2daa[_0x46f2('0x36')]=_[_0x46f2('0x37')](_0x4e2daa[_0x46f2('0x34')],_0x4e2daa[_0x46f2('0x35')]);_0x51a940[_0x46f2('0x38')]=_['intersection'](_0x4e2daa[_0x46f2('0x34')],qs[_0x46f2('0x39')](_0x2cd593[_0x46f2('0x35')][_0x46f2('0x39')]));_0x51a940['attributes']=_0x51a940[_0x46f2('0x38')][_0x46f2('0x3a')]?_0x51a940[_0x46f2('0x38')]:_0x4e2daa[_0x46f2('0x34')];if(!_0x2cd593['query'][_0x46f2('0x3b')](_0x46f2('0x3c'))){_0x51a940[_0x46f2('0x20')]=qs[_0x46f2('0x20')](_0x2cd593[_0x46f2('0x35')][_0x46f2('0x20')]);_0x51a940[_0x46f2('0x22')]=qs[_0x46f2('0x22')](_0x2cd593[_0x46f2('0x35')]['offset']);}_0x51a940[_0x46f2('0x3d')]=qs[_0x46f2('0x3e')](_0x2cd593[_0x46f2('0x35')][_0x46f2('0x3e')]);_0x51a940[_0x46f2('0x3f')]=qs[_0x46f2('0x36')](_['pick'](_0x2cd593[_0x46f2('0x35')],_0x4e2daa['filters']),_0x584710);if(_0x2cd593[_0x46f2('0x35')]['filter']){_0x51a940[_0x46f2('0x3f')]=_[_0x46f2('0x40')](_0x51a940['where'],{'$or':_[_0x46f2('0x2f')](_0x584710,function(_0x501dca){if(_0x501dca[_0x46f2('0x32')]!=='VIRTUAL'){var _0xacb76b={};_0xacb76b[_0x501dca[_0x46f2('0x2c')]]={'$like':'%'+_0x2cd593[_0x46f2('0x35')][_0x46f2('0x41')]+'%'};return _0xacb76b;}})});}_0x51a940=_['merge']({},_0x51a940,_0x2cd593[_0x46f2('0x42')]);var _0x5e76b5={'where':_0x51a940[_0x46f2('0x3f')]};return db[_0x46f2('0x30')][_0x46f2('0x21')](_0x5e76b5)[_0x46f2('0x28')](function(_0x355832){_0x3b66d6[_0x46f2('0x21')]=_0x355832;if(_0x2cd593['query']['includeAll']){_0x51a940['include']=[{'all':!![]}];}return db[_0x46f2('0x30')][_0x46f2('0x43')](_0x51a940);})[_0x46f2('0x28')](function(_0x4a26ad){_0x3b66d6[_0x46f2('0x44')]=_0x4a26ad;return _0x3b66d6;})['then'](respondWithFilteredResult(_0x293676,_0x51a940))[_0x46f2('0x45')](handleError(_0x293676,null));};exports[_0x46f2('0x46')]=function(_0x200dde,_0x41b484){var _0xce0693={'raw':![],'where':{'id':_0x200dde[_0x46f2('0x47')]['id']}},_0x3cfc4e={};_0x3cfc4e[_0x46f2('0x34')]=_[_0x46f2('0x48')](db[_0x46f2('0x30')]['rawAttributes']);_0x3cfc4e[_0x46f2('0x35')]=_['keys'](_0x200dde[_0x46f2('0x35')]);_0x3cfc4e[_0x46f2('0x36')]=_[_0x46f2('0x37')](_0x3cfc4e[_0x46f2('0x34')],_0x3cfc4e[_0x46f2('0x35')]);_0xce0693[_0x46f2('0x38')]=_[_0x46f2('0x37')](_0x3cfc4e[_0x46f2('0x34')],qs['fields'](_0x200dde['query'][_0x46f2('0x39')]));_0xce0693[_0x46f2('0x38')]=_0xce0693[_0x46f2('0x38')]['length']?_0xce0693['attributes']:_0x3cfc4e[_0x46f2('0x34')];if(_0x200dde['query'][_0x46f2('0x49')]){_0xce0693[_0x46f2('0x4a')]=[{'all':!![]}];}_0xce0693=_[_0x46f2('0x40')]({},_0xce0693,_0x200dde['options']);return db[_0x46f2('0x30')][_0x46f2('0x4b')](_0xce0693)['then'](handleEntityNotFound(_0x41b484,null))['then'](respondWithResult(_0x41b484,null))[_0x46f2('0x45')](handleError(_0x41b484,null));};exports[_0x46f2('0x4c')]=function(_0x1345af,_0xd7e386){return db[_0x46f2('0x30')][_0x46f2('0x4c')](_0x1345af['body'],{})[_0x46f2('0x28')](respondWithResult(_0xd7e386,0xc9))[_0x46f2('0x45')](handleError(_0xd7e386,null));};exports['update']=function(_0x10215f,_0x5de2a8){if(_0x10215f[_0x46f2('0x4d')]['id']){delete _0x10215f[_0x46f2('0x4d')]['id'];}return db[_0x46f2('0x30')]['find']({'where':{'id':_0x10215f[_0x46f2('0x47')]['id']}})['then'](handleEntityNotFound(_0x5de2a8,null))[_0x46f2('0x28')](saveUpdates(_0x10215f[_0x46f2('0x4d')],null))[_0x46f2('0x28')](respondWithResult(_0x5de2a8,null))[_0x46f2('0x45')](handleError(_0x5de2a8,null));};exports[_0x46f2('0x29')]=function(_0x1d5841,_0x4eba06){return db[_0x46f2('0x30')][_0x46f2('0x4b')]({'where':{'id':_0x1d5841[_0x46f2('0x47')]['id']}})[_0x46f2('0x28')](handleEntityNotFound(_0x4eba06,null))[_0x46f2('0x28')](removeEntity(_0x4eba06,null))[_0x46f2('0x45')](handleError(_0x4eba06,null));};exports['getConfigurations']=function(_0x17351e,_0x16dea9,_0x16f70f){var _0x23d655={};var _0x2caaa5={};var _0x27d337;var _0x50909e;return db[_0x46f2('0x30')][_0x46f2('0x4e')]({'where':{'id':_0x17351e[_0x46f2('0x47')]['id']}})[_0x46f2('0x28')](handleEntityNotFound(_0x16dea9,null))[_0x46f2('0x28')](function(_0x505cbd){if(_0x505cbd){_0x27d337=_0x505cbd;_0x2caaa5[_0x46f2('0x34')]=_[_0x46f2('0x48')](db['ServicenowConfiguration'][_0x46f2('0x4f')]);_0x2caaa5[_0x46f2('0x35')]=_[_0x46f2('0x48')](_0x17351e[_0x46f2('0x35')]);_0x2caaa5[_0x46f2('0x36')]=_[_0x46f2('0x37')](_0x2caaa5[_0x46f2('0x34')],_0x2caaa5[_0x46f2('0x35')]);_0x23d655[_0x46f2('0x38')]=_[_0x46f2('0x37')](_0x2caaa5[_0x46f2('0x34')],qs['fields'](_0x17351e[_0x46f2('0x35')][_0x46f2('0x39')]));_0x23d655['attributes']=_0x23d655[_0x46f2('0x38')][_0x46f2('0x3a')]?_0x23d655[_0x46f2('0x38')]:_0x2caaa5['model'];_0x23d655['order']=qs['sort'](_0x17351e['query'][_0x46f2('0x3e')]);_0x23d655['where']=qs['filters'](_['pick'](_0x17351e[_0x46f2('0x35')],_0x2caaa5[_0x46f2('0x36')]));if(_0x17351e[_0x46f2('0x35')][_0x46f2('0x41')]){_0x23d655[_0x46f2('0x3f')]=_['merge'](_0x23d655['where'],{'$or':_[_0x46f2('0x2f')](_0x23d655['attributes'],function(_0x4854f5){var _0x248698={};_0x248698[_0x4854f5]={'$like':'%'+_0x17351e[_0x46f2('0x35')]['filter']+'%'};return _0x248698;})});}_0x23d655=_[_0x46f2('0x40')]({},_0x23d655,_0x17351e[_0x46f2('0x42')]);return _0x27d337[_0x46f2('0x50')](_0x23d655);}})[_0x46f2('0x28')](function(_0x17e9ee){if(_0x17e9ee){_0x50909e=_0x17e9ee[_0x46f2('0x3a')];if(!_0x17351e[_0x46f2('0x35')][_0x46f2('0x3b')]('nolimit')){_0x23d655[_0x46f2('0x20')]=qs['limit'](_0x17351e[_0x46f2('0x35')][_0x46f2('0x20')]);_0x23d655[_0x46f2('0x22')]=qs[_0x46f2('0x22')](_0x17351e[_0x46f2('0x35')][_0x46f2('0x22')]);}return _0x27d337[_0x46f2('0x50')](_0x23d655);}})['then'](function(_0x45365f){if(_0x45365f){return _0x45365f?{'count':_0x50909e,'rows':_0x45365f}:null;}})['then'](respondWithResult(_0x16dea9,null))[_0x46f2('0x45')](handleError(_0x16dea9,null));};exports['addConfiguration']=function(_0x52716f,_0x10e4b6,_0x3ad954){if(_0x52716f['body']['id']){delete _0x52716f[_0x46f2('0x4d')]['id'];}return db['ServicenowAccount'][_0x46f2('0x4e')]({'where':{'id':_0x52716f[_0x46f2('0x47')]['id']}})[_0x46f2('0x28')](handleEntityNotFound(_0x10e4b6,null))[_0x46f2('0x28')](function(_0x1b8717){if(_0x1b8717){_0x52716f['body']['AccountId']=_0x1b8717['id'];_0x52716f[_0x46f2('0x4d')][_0x46f2('0x51')]=integrations[_0x46f2('0x52')](_0x52716f[_0x46f2('0x4d')][_0x46f2('0x53')],_0x52716f['body'][_0x46f2('0x32')]);_0x52716f['body']['Descriptions']=integrations[_0x46f2('0x54')](_0x52716f[_0x46f2('0x4d')][_0x46f2('0x53')],_0x52716f['body'][_0x46f2('0x32')]);return db[_0x46f2('0x55')]['create'](_0x52716f[_0x46f2('0x4d')],{'include':[{'model':db[_0x46f2('0x56')],'as':_0x46f2('0x51')},{'model':db[_0x46f2('0x56')],'as':'Descriptions'}]});}return null;})[_0x46f2('0x28')](respondWithResult(_0x10e4b6,null))[_0x46f2('0x45')](handleError(_0x10e4b6,null));};exports[_0x46f2('0x57')]=function(_0xe0d143,_0x175eff,_0x343a5c){var _0x49f4fb=['made_sla','hold_reason',_0x46f2('0x58'),_0x46f2('0x59'),_0x46f2('0x5a'),_0x46f2('0x5b'),_0x46f2('0x5c'),'severity','category'];var _0x2c64da=[_0x46f2('0x5d'),_0x46f2('0x5e'),_0x46f2('0x5f'),_0x46f2('0x60'),_0x46f2('0x61'),_0x46f2('0x62'),_0x46f2('0x63'),_0x46f2('0x64'),_0x46f2('0x65'),_0x46f2('0x66'),_0x46f2('0x67'),'sys_updated_by',_0x46f2('0x68'),'user_input',_0x46f2('0x69'),_0x46f2('0x6a'),_0x46f2('0x6b'),_0x46f2('0x6c'),_0x46f2('0x58'),'order',_0x46f2('0x6d'),_0x46f2('0x6e'),_0x46f2('0x6f'),_0x46f2('0x70'),'impact',_0x46f2('0x71'),_0x46f2('0x72'),_0x46f2('0x73'),_0x46f2('0x74'),_0x46f2('0x75'),'rfc',_0x46f2('0x76'),_0x46f2('0x77'),_0x46f2('0x78'),_0x46f2('0x79'),_0x46f2('0x7a'),_0x46f2('0x7b'),_0x46f2('0x7c'),_0x46f2('0x7d'),_0x46f2('0x7e'),'approval_set',_0x46f2('0x59'),_0x46f2('0x7f'),'short_description',_0x46f2('0x5a'),_0x46f2('0x80'),_0x46f2('0x81'),_0x46f2('0x82'),_0x46f2('0x83'),_0x46f2('0x84'),'additional_assignee_list',_0x46f2('0x85'),_0x46f2('0x86'),_0x46f2('0x5b'),_0x46f2('0x87'),'close_notes',_0x46f2('0x88'),'follow_up','parent_incident','sys_id','contact_type','reopened_by',_0x46f2('0x5c'),'urgency','problem_id',_0x46f2('0x89'),_0x46f2('0x8a'),'activity_due',_0x46f2('0x8b'),'severity',_0x46f2('0x8c'),_0x46f2('0x8d'),'approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count',_0x46f2('0x8e'),_0x46f2('0x8f'),_0x46f2('0x90'),'correlation_id',_0x46f2('0x91'),_0x46f2('0x92')];var _0xfc853c='';var _0x41cd99='';var _0x423862=[];var _0x46f2ee='';var _0xe4c710='';var _0x15403f=[];var _0x4ad85b='';var _0x41d97e='';var _0x54ea1e={};var _0x150658='';return db[_0x46f2('0x30')][_0x46f2('0x4e')]({'where':{'id':_0xe0d143[_0x46f2('0x47')]['id']},'attributes':['id',_0x46f2('0x93'),'password',_0x46f2('0x94'),_0x46f2('0x95'),_0x46f2('0x96')]})[_0x46f2('0x28')](handleEntityNotFound(_0x175eff,null))[_0x46f2('0x28')](function(_0x473618){if(_0x473618){_0x150658=_0x473618['remoteUri'];var _0x27c9ff=_0x150658[_0x46f2('0x97')](-0x1);if(_0x27c9ff==='/'){_0x150658=_0x150658['substring'](0x0,_0x150658[_0x46f2('0x98')](_0x27c9ff));}_0x41d97e=util['format'](_0x46f2('0x99'),_0x150658);_0x4ad85b=util[_0x46f2('0x9a')](_0x46f2('0x9b'),_0x150658);_0x54ea1e={'user':_0x473618[_0x46f2('0x93')],'pass':_0x473618[_0x46f2('0x9c')]};var _0x258435={'method':_0x46f2('0x9d'),'uri':_0x41d97e+'incident?sysparm_display_value=all','auth':_0x54ea1e,'json':!![]};return rp(_0x258435);}})[_0x46f2('0x28')](function(_0x6ef22d){if(_0x6ef22d[_0x46f2('0x9e')]['length']>0x0){_0xfc853c=_0x6ef22d[_0x46f2('0x9e')];}console[_0x46f2('0x9f')](_0x46f2('0xa0'),_0xfc853c);_0x15403f=[];_0x41cd99=Object['assign']([],_0xfc853c);_['remove'](_0x41cd99,function(_0x40640a){return!_0x49f4fb[_0x46f2('0xa1')](_0x40640a[_0x46f2('0x2c')]);});_0x41cd99[_0x46f2('0xa2')](function(_0x33034d){var _0x16017e=createFieldObject(_0x4ad85b,_0x54ea1e,_0x33034d[_0x46f2('0xa3')],_0x33034d[_0x46f2('0x2c')],_0x33034d[_0x46f2('0xa4')],![]);_0x15403f[_0x46f2('0xa5')](_0x16017e);});return Promise[_0x46f2('0xa6')](_0x15403f);})['then'](function(_0x573b8e){_0x423862=_0x573b8e;_0x46f2ee=Object[_0x46f2('0xa7')]([],_0xfc853c);console[_0x46f2('0x9f')]('TCL:\x20_object',_0xfc853c);_['remove'](_0x46f2ee,function(_0x5d2655){return _0x2c64da[_0x46f2('0xa1')](_0x5d2655[_0x46f2('0x2c')]);});console[_0x46f2('0x9f')](_0x46f2('0xa8'),_0x46f2ee);_0x15403f=[];_0x46f2ee[_0x46f2('0xa2')](function(_0x36fe1d){var _0x2cf99c=createFieldObject(_0x4ad85b,_0x54ea1e,_0x36fe1d['internalType'],_0x36fe1d[_0x46f2('0x2c')],_0x36fe1d[_0x46f2('0xa4')],!![]);_0x15403f[_0x46f2('0xa5')](_0x2cf99c);});return Promise[_0x46f2('0xa6')](_0x15403f);})[_0x46f2('0x28')](function(_0x243e71){_0xe4c710=_0x243e71;var _0x58b353=_0x423862[_0x46f2('0xa9')](_0xe4c710);return{'count':_0x58b353[_0x46f2('0x3a')],'rows':_0x58b353};})['then'](respondWithResult(_0x175eff,null))['catch'](function(_0x3ef40a){console[_0x46f2('0x9f')](_0x46f2('0xaa')+_0x3ef40a);var _0x26a419=_0xe0d143[_0x46f2('0x35')][_0x46f2('0xab')]?0x1f4:_0x3ef40a['statusCode']||0x1f4;logger['error'](_0x3ef40a[_0x46f2('0x2b')]);delete _0x3ef40a['name'];if(_0x26a419===0x191){_0x26a419=0x190;}_0x175eff['status'](_0x26a419)[_0x46f2('0x2d')](_0xe0d143['query'][_0x46f2('0xab')]?{'message':_0x46f2('0xac'),'statusCode':_0x3ef40a[_0x46f2('0xad')]}:_0x3ef40a);});};function createFieldObject(_0x138fda,_0x2ff40d,_0x5b2fdb,_0x2b093c,_0x25c0b5,_0x10273d){return new Promise(function(_0x4d23b4,_0x9a9b2){var _0x3bfb97={'id':_0x2b093c,'name':_0x25c0b5,'custom':_0x10273d};if(_0x5b2fdb===_0x46f2('0xae')){_0x3bfb97[_0x46f2('0x42')]=[{'name':_0x46f2('0xaf'),'value':_0x46f2('0xb0')},{'name':_0x46f2('0xb1'),'value':_0x46f2('0xb2')}];_0x4d23b4(_0x3bfb97);}else{var _0x4ef29a={'method':_0x46f2('0x9d'),'uri':_0x138fda+_0x46f2('0xb3')+_0x2b093c,'auth':_0x2ff40d,'json':!![]};return rp(_0x4ef29a)['then'](function(_0x45bd01){var _0x3f21f4=[];if(_0x45bd01[_0x46f2('0x9e')][_0x46f2('0x3a')]>0x0){_0x45bd01[_0x46f2('0x9e')]['forEach'](function(_0x4a75a1){if(_0x4a75a1[_0x46f2('0xb4')]===_0x46f2('0xb2')){var _0x5e4792={'name':_0x4a75a1[_0x46f2('0xa4')],'value':_0x4a75a1['value']};_0x3f21f4[_0x46f2('0xa5')](_0x5e4792);}});}_0x3bfb97['options']=_0x3f21f4;if(_0x3bfb97[_0x46f2('0x42')]['length']>0x0){_0x4d23b4(_0x3bfb97);}else{if(_0x10273d==![]){_0x4d23b4();}else{_0x4d23b4(_0x3bfb97);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 8ee50ff..dcb2b8d 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 _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4b68bf,_0x49e2c5){var _0x4ed6e2=function(_0x30870a){while(--_0x30870a){_0x4b68bf['push'](_0x4b68bf['shift']());}};_0x4ed6e2(++_0x49e2c5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x8ad6a3,_0x3f9e3e){_0x8ad6a3=_0x8ad6a3-0x0;var _0x147785=_0xbd51[_0x8ad6a3];return _0x147785;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa630=['moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x371b3d,_0x208d00){var _0x133d8b=function(_0x4d1ed0){while(--_0x4d1ed0){_0x371b3d['push'](_0x371b3d['shift']());}};_0x133d8b(++_0x208d00);}(_0xa630,0xbe));var _0x0a63=function(_0x52ecb7,_0x29e390){_0x52ecb7=_0x52ecb7-0x0;var _0x2d4d76=_0xa630[_0x52ecb7];return _0x2d4d76;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));var integrations=require(_0x0a63('0x7'));module[_0x0a63('0x8')]=function(_0x4b7474,_0x2760b0){return _0x4b7474[_0x0a63('0x9')](_0x0a63('0xa'),attributes,{'tableName':_0x0a63('0xb'),'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 a2e6870..49c9d34 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 _0x7bcd=['error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','map','model','include','then','ShowServicenowAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ee8ef,_0x3e47ec){var _0x260a9c=function(_0x1d703d){while(--_0x1d703d){_0x4ee8ef['push'](_0x4ee8ef['shift']());}};_0x260a9c(++_0x3e47ec);}(_0x7bcd,0x19e));var _0xd7bc=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x7bcd[_0x1034ca];return _0x1a023a;};'use strict';var _=require('lodash');var util=require(_0xd7bc('0x0'));var moment=require(_0xd7bc('0x1'));var BPromise=require(_0xd7bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7bc('0x3'));var db=require(_0xd7bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7bc('0x5'))('rpc');var config=require(_0xd7bc('0x6'));var jayson=require(_0xd7bc('0x7'));var client=jayson[_0xd7bc('0x8')][_0xd7bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbb7ee8,_0x3c05e6,_0x14ab94){return new BPromise(function(_0x4283c9,_0x2d146d){return client['request'](_0xbb7ee8,_0x14ab94)['then'](function(_0xd58f8c){logger['info'](_0xd7bc('0xa'),_0x3c05e6,_0xd7bc('0xb'));logger[_0xd7bc('0xc')](_0xd7bc('0xd'),_0x3c05e6,_0xd7bc('0xb'),JSON[_0xd7bc('0xe')](_0xd58f8c));if(_0xd58f8c[_0xd7bc('0xf')]){if(_0xd58f8c[_0xd7bc('0xf')][_0xd7bc('0x10')]===0x1f4){logger['error'](_0xd7bc('0xa'),_0x3c05e6,_0xd58f8c['error'][_0xd7bc('0x11')]);return _0x2d146d(_0xd58f8c[_0xd7bc('0xf')][_0xd7bc('0x11')]);}logger[_0xd7bc('0xf')](_0xd7bc('0xa'),_0x3c05e6,_0xd58f8c[_0xd7bc('0xf')][_0xd7bc('0x11')]);return _0x4283c9(_0xd58f8c[_0xd7bc('0xf')]['message']);}else{logger[_0xd7bc('0x12')](_0xd7bc('0xa'),_0x3c05e6,_0xd7bc('0xb'));_0x4283c9(_0xd58f8c[_0xd7bc('0x13')][_0xd7bc('0x11')]);}})[_0xd7bc('0x14')](function(_0xde557d){logger[_0xd7bc('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x3c05e6,_0xde557d);_0x2d146d(_0xde557d);});});}exports[_0xd7bc('0x15')]=function(_0x234f94){var _0x28038f=this;return new Promise(function(_0x1c8e34,_0x44588e){return db[_0xd7bc('0x16')]['findAll']({'raw':_0x234f94[_0xd7bc('0x17')]?_0x234f94[_0xd7bc('0x17')][_0xd7bc('0x18')]===undefined?!![]:![]:!![],'where':_0x234f94[_0xd7bc('0x17')]?_0x234f94[_0xd7bc('0x17')][_0xd7bc('0x19')]||null:null,'attributes':_0x234f94[_0xd7bc('0x17')]?_0x234f94[_0xd7bc('0x17')][_0xd7bc('0x1a')]||null:null,'limit':_0x234f94['options']?_0x234f94[_0xd7bc('0x17')]['limit']||null:null,'include':_0x234f94['options']?_0x234f94['options']['include']?_[_0xd7bc('0x1b')](_0x234f94[_0xd7bc('0x17')]['include'],function(_0x3e8aa0){return{'model':db[_0x3e8aa0[_0xd7bc('0x1c')]],'as':_0x3e8aa0['as'],'attributes':_0x3e8aa0[_0xd7bc('0x1a')],'include':_0x3e8aa0[_0xd7bc('0x1d')]?_[_0xd7bc('0x1b')](_0x3e8aa0[_0xd7bc('0x1d')],function(_0x2dad0a){return{'model':db[_0x2dad0a[_0xd7bc('0x1c')]],'as':_0x2dad0a['as'],'attributes':_0x2dad0a[_0xd7bc('0x1a')],'include':_0x2dad0a[_0xd7bc('0x1d')]?_[_0xd7bc('0x1b')](_0x2dad0a[_0xd7bc('0x1d')],function(_0x2e8916){return{'model':db[_0x2e8916['model']],'as':_0x2e8916['as'],'attributes':_0x2e8916[_0xd7bc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd7bc('0x1e')](function(_0x2ca6e7){logger['info']('GetServicenowAccount',_0x234f94);logger['debug'](_0xd7bc('0x15'),_0x234f94,JSON[_0xd7bc('0xe')](_0x2ca6e7));_0x1c8e34(_0x2ca6e7);})['catch'](function(_0x52e1e9){logger['error'](_0xd7bc('0x15'),_0x52e1e9[_0xd7bc('0x11')],_0x234f94);_0x44588e(_0x28038f['error'](0x1f4,_0x52e1e9[_0xd7bc('0x11')]));});});};exports[_0xd7bc('0x1f')]=function(_0x3525ba){var _0x44e0ef=this;return new Promise(function(_0x19c2a9,_0x28f8c0){return db['ServicenowAccount'][_0xd7bc('0x20')]({'raw':_0x3525ba['options']?_0x3525ba[_0xd7bc('0x17')][_0xd7bc('0x18')]===undefined?!![]:![]:!![],'where':_0x3525ba[_0xd7bc('0x17')]?_0x3525ba['options'][_0xd7bc('0x19')]||null:null,'attributes':_0x3525ba[_0xd7bc('0x17')]?_0x3525ba[_0xd7bc('0x17')][_0xd7bc('0x1a')]||null:null,'include':_0x3525ba[_0xd7bc('0x17')]?_0x3525ba[_0xd7bc('0x17')][_0xd7bc('0x1d')]?_[_0xd7bc('0x1b')](_0x3525ba['options'][_0xd7bc('0x1d')],function(_0x219ee2){return{'model':db[_0x219ee2[_0xd7bc('0x1c')]],'as':_0x219ee2['as'],'attributes':_0x219ee2[_0xd7bc('0x1a')],'include':_0x219ee2['include']?_['map'](_0x219ee2['include'],function(_0x2c43ba){return{'model':db[_0x2c43ba[_0xd7bc('0x1c')]],'as':_0x2c43ba['as'],'attributes':_0x2c43ba[_0xd7bc('0x1a')],'include':_0x2c43ba[_0xd7bc('0x1d')]?_[_0xd7bc('0x1b')](_0x2c43ba[_0xd7bc('0x1d')],function(_0x32d2f4){return{'model':db[_0x32d2f4[_0xd7bc('0x1c')]],'as':_0x32d2f4['as'],'attributes':_0x32d2f4[_0xd7bc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25b0d3){logger['info'](_0xd7bc('0x1f'),_0x3525ba);logger[_0xd7bc('0xc')]('ShowServicenowAccount',_0x3525ba,JSON['stringify'](_0x25b0d3));_0x19c2a9(_0x25b0d3);})[_0xd7bc('0x14')](function(_0x2a9c90){logger['error'](_0xd7bc('0x1f'),_0x2a9c90[_0xd7bc('0x11')],_0x3525ba);_0x28f8c0(_0x44e0ef[_0xd7bc('0xf')](0x1f4,_0x2a9c90[_0xd7bc('0x11')]));});});}; \ No newline at end of file +var _0xe99e=['request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowServicenowAccount','ServicenowAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x2dbfac,_0x4ba7a2){var _0x4b1f11=function(_0x1635f5){while(--_0x1635f5){_0x2dbfac['push'](_0x2dbfac['shift']());}};_0x4b1f11(++_0x4ba7a2);}(_0xe99e,0x176));var _0xee99=function(_0x13eae2,_0x36d473){_0x13eae2=_0x13eae2-0x0;var _0x7e9cff=_0xe99e[_0x13eae2];return _0x7e9cff;};'use strict';var _=require(_0xee99('0x0'));var util=require(_0xee99('0x1'));var moment=require(_0xee99('0x2'));var BPromise=require(_0xee99('0x3'));var rs=require(_0xee99('0x4'));var fs=require('fs');var Redis=require(_0xee99('0x5'));var db=require(_0xee99('0x6'))['db'];var utils=require(_0xee99('0x7'));var logger=require(_0xee99('0x8'))(_0xee99('0x9'));var config=require('../../config/environment');var jayson=require(_0xee99('0xa'));var client=jayson[_0xee99('0xb')][_0xee99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f3b64,_0x20c246,_0x40970c){return new BPromise(function(_0xffbae,_0x3d7359){return client[_0xee99('0xd')](_0x2f3b64,_0x40970c)['then'](function(_0x5be8d2){logger[_0xee99('0xe')](_0xee99('0xf'),_0x20c246,_0xee99('0x10'));logger[_0xee99('0x11')](_0xee99('0x12'),_0x20c246,_0xee99('0x10'),JSON[_0xee99('0x13')](_0x5be8d2));if(_0x5be8d2[_0xee99('0x14')]){if(_0x5be8d2['error'][_0xee99('0x15')]===0x1f4){logger[_0xee99('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x20c246,_0x5be8d2['error'][_0xee99('0x16')]);return _0x3d7359(_0x5be8d2[_0xee99('0x14')][_0xee99('0x16')]);}logger[_0xee99('0x14')](_0xee99('0xf'),_0x20c246,_0x5be8d2[_0xee99('0x14')][_0xee99('0x16')]);return _0xffbae(_0x5be8d2[_0xee99('0x14')]['message']);}else{logger[_0xee99('0xe')](_0xee99('0xf'),_0x20c246,'request\x20sent');_0xffbae(_0x5be8d2[_0xee99('0x17')][_0xee99('0x16')]);}})['catch'](function(_0x147796){logger[_0xee99('0x14')](_0xee99('0xf'),_0x20c246,_0x147796);_0x3d7359(_0x147796);});});}exports[_0xee99('0x18')]=function(_0x2de773){var _0x33d5dd=this;return new Promise(function(_0x50a4fd,_0x5c21d0){return db['ServicenowAccount'][_0xee99('0x19')]({'raw':_0x2de773[_0xee99('0x1a')]?_0x2de773[_0xee99('0x1a')][_0xee99('0x1b')]===undefined?!![]:![]:!![],'where':_0x2de773[_0xee99('0x1a')]?_0x2de773[_0xee99('0x1a')][_0xee99('0x1c')]||null:null,'attributes':_0x2de773[_0xee99('0x1a')]?_0x2de773[_0xee99('0x1a')][_0xee99('0x1d')]||null:null,'limit':_0x2de773[_0xee99('0x1a')]?_0x2de773['options'][_0xee99('0x1e')]||null:null,'include':_0x2de773[_0xee99('0x1a')]?_0x2de773[_0xee99('0x1a')][_0xee99('0x1f')]?_[_0xee99('0x20')](_0x2de773[_0xee99('0x1a')]['include'],function(_0x1ab548){return{'model':db[_0x1ab548[_0xee99('0x21')]],'as':_0x1ab548['as'],'attributes':_0x1ab548[_0xee99('0x1d')],'include':_0x1ab548['include']?_['map'](_0x1ab548[_0xee99('0x1f')],function(_0x58d6eb){return{'model':db[_0x58d6eb[_0xee99('0x21')]],'as':_0x58d6eb['as'],'attributes':_0x58d6eb['attributes'],'include':_0x58d6eb[_0xee99('0x1f')]?_['map'](_0x58d6eb['include'],function(_0x10ac2a){return{'model':db[_0x10ac2a['model']],'as':_0x10ac2a['as'],'attributes':_0x10ac2a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2185ba){logger[_0xee99('0xe')](_0xee99('0x18'),_0x2de773);logger[_0xee99('0x11')](_0xee99('0x18'),_0x2de773,JSON['stringify'](_0x2185ba));_0x50a4fd(_0x2185ba);})[_0xee99('0x22')](function(_0x440850){logger[_0xee99('0x14')](_0xee99('0x18'),_0x440850[_0xee99('0x16')],_0x2de773);_0x5c21d0(_0x33d5dd[_0xee99('0x14')](0x1f4,_0x440850['message']));});});};exports[_0xee99('0x23')]=function(_0x3c5c8f){var _0x4b031f=this;return new Promise(function(_0x239519,_0x24a6d0){return db[_0xee99('0x24')][_0xee99('0x25')]({'raw':_0x3c5c8f[_0xee99('0x1a')]?_0x3c5c8f[_0xee99('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3c5c8f[_0xee99('0x1a')]?_0x3c5c8f['options']['where']||null:null,'attributes':_0x3c5c8f['options']?_0x3c5c8f['options']['attributes']||null:null,'include':_0x3c5c8f['options']?_0x3c5c8f[_0xee99('0x1a')][_0xee99('0x1f')]?_['map'](_0x3c5c8f[_0xee99('0x1a')][_0xee99('0x1f')],function(_0x10ce2c){return{'model':db[_0x10ce2c[_0xee99('0x21')]],'as':_0x10ce2c['as'],'attributes':_0x10ce2c[_0xee99('0x1d')],'include':_0x10ce2c[_0xee99('0x1f')]?_['map'](_0x10ce2c['include'],function(_0x22495e){return{'model':db[_0x22495e['model']],'as':_0x22495e['as'],'attributes':_0x22495e[_0xee99('0x1d')],'include':_0x22495e[_0xee99('0x1f')]?_[_0xee99('0x20')](_0x22495e[_0xee99('0x1f')],function(_0xdc2d5a){return{'model':db[_0xdc2d5a[_0xee99('0x21')]],'as':_0xdc2d5a['as'],'attributes':_0xdc2d5a[_0xee99('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xee99('0x26')](function(_0x58248a){logger[_0xee99('0xe')](_0xee99('0x23'),_0x3c5c8f);logger['debug']('ShowServicenowAccount',_0x3c5c8f,JSON[_0xee99('0x13')](_0x58248a));_0x239519(_0x58248a);})[_0xee99('0x22')](function(_0x1c786e){logger['error']('ShowServicenowAccount',_0x1c786e[_0xee99('0x16')],_0x3c5c8f);_0x24a6d0(_0x4b031f['error'](0x1f4,_0x1c786e['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 5df0888..5e58abd 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 _0x728c=['get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x728c,0x1f1));var _0xc728=function(_0x5729be,_0xdfd962){_0x5729be=_0x5729be-0x0;var _0x3d758a=_0x728c[_0x5729be];return _0x3d758a;};'use strict';var multer=require(_0xc728('0x0'));var util=require('util');var path=require(_0xc728('0x1'));var timeout=require('connect-timeout');var express=require(_0xc728('0x2'));var router=express['Router']();var fs_extra=require(_0xc728('0x3'));var auth=require(_0xc728('0x4'));var interaction=require(_0xc728('0x5'));var config=require(_0xc728('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0xc728('0x7')]('/',auth['isAuthenticated'](),controller[_0xc728('0x8')]);router['get'](_0xc728('0x9'),auth[_0xc728('0xa')](),controller['show']);router['get'](_0xc728('0xb'),auth[_0xc728('0xa')](),controller[_0xc728('0xc')]);router['get'](_0xc728('0xd'),auth[_0xc728('0xa')](),controller[_0xc728('0xe')]);router['get'](_0xc728('0xf'),auth[_0xc728('0xa')](),controller[_0xc728('0x10')]);router[_0xc728('0x11')]('/',auth[_0xc728('0xa')](),controller[_0xc728('0x12')]);router[_0xc728('0x13')](_0xc728('0x9'),auth[_0xc728('0xa')](),controller[_0xc728('0x14')]);router[_0xc728('0x15')](_0xc728('0x9'),auth[_0xc728('0xa')](),controller[_0xc728('0x16')]);module[_0xc728('0x17')]=router; \ No newline at end of file +var _0x2e16=['post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x4cbc69,_0x5e14fd){var _0x38b555=function(_0x43115c){while(--_0x43115c){_0x4cbc69['push'](_0x4cbc69['shift']());}};_0x38b555(++_0x5e14fd);}(_0x2e16,0x14e));var _0x62e1=function(_0x373ab8,_0x37c418){_0x373ab8=_0x373ab8-0x0;var _0x2b1300=_0x2e16[_0x373ab8];return _0x2b1300;};'use strict';var multer=require(_0x62e1('0x0'));var util=require(_0x62e1('0x1'));var path=require(_0x62e1('0x2'));var timeout=require(_0x62e1('0x3'));var express=require(_0x62e1('0x4'));var router=express[_0x62e1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x62e1('0x6'));var interaction=require(_0x62e1('0x7'));var config=require('../../config/environment');var controller=require(_0x62e1('0x8'));router[_0x62e1('0x9')]('/',auth['isAuthenticated'](),controller[_0x62e1('0xa')]);router[_0x62e1('0x9')]('/:id',auth[_0x62e1('0xb')](),controller[_0x62e1('0xc')]);router[_0x62e1('0x9')](_0x62e1('0xd'),auth[_0x62e1('0xb')](),controller[_0x62e1('0xe')]);router[_0x62e1('0x9')]('/:id/subjects',auth[_0x62e1('0xb')](),controller[_0x62e1('0xf')]);router[_0x62e1('0x9')](_0x62e1('0x10'),auth[_0x62e1('0xb')](),controller[_0x62e1('0x11')]);router[_0x62e1('0x12')]('/',auth[_0x62e1('0xb')](),controller['create']);router['put']('/:id',auth[_0x62e1('0xb')](),controller[_0x62e1('0x13')]);router['delete']('/:id',auth[_0x62e1('0xb')](),controller[_0x62e1('0x14')]);module[_0x62e1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d85747b..cbbd14c 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 _0x2d06=['sequelize','exports','STRING'];(function(_0x53a85b,_0x43dbc8){var _0x50b2fd=function(_0x190124){while(--_0x190124){_0x53a85b['push'](_0x53a85b['shift']());}};_0x50b2fd(++_0x43dbc8);}(_0x2d06,0xe7));var _0x62d0=function(_0x3b9ee1,_0x30c318){_0x3b9ee1=_0x3b9ee1-0x0;var _0x57158d=_0x2d06[_0x3b9ee1];return _0x57158d;};'use strict';var Sequelize=require(_0x62d0('0x0'));module[_0x62d0('0x1')]={'name':{'type':Sequelize[_0x62d0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd794=['sequelize','STRING'];(function(_0x5a895a,_0x3e7d2b){var _0x313a99=function(_0x2f6017){while(--_0x2f6017){_0x5a895a['push'](_0x5a895a['shift']());}};_0x313a99(++_0x3e7d2b);}(_0xd794,0x11a));var _0x4d79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd794[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4d79('0x0'));module['exports']={'name':{'type':Sequelize[_0x4d79('0x1')]},'description':{'type':Sequelize[_0x4d79('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f6b1581..f5fa9b2 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 _0xb64e=['Content-Range','save','then','destroy','sendStatus','error','stack','name','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','count','includeAll','include','findAll','catch','show','find','create','body','update','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set'];(function(_0x5676ec,_0x254e73){var _0x611493=function(_0x20bdc1){while(--_0x20bdc1){_0x5676ec['push'](_0x5676ec['shift']());}};_0x611493(++_0x254e73);}(_0xb64e,0xc2));var _0xeb64=function(_0x449bb1,_0x1a28eb){_0x449bb1=_0x449bb1-0x0;var _0x1cb230=_0xb64e[_0x449bb1];return _0x1cb230;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb64('0x0'));var jsonpatch=require(_0xeb64('0x1'));var rp=require('request-promise');var moment=require(_0xeb64('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xeb64('0x3'));var util=require(_0xeb64('0x4'));var path=require('path');var sox=require(_0xeb64('0x5'));var csv=require(_0xeb64('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb64('0x7'));var _=require('lodash');var squel=require(_0xeb64('0x8'));var crypto=require(_0xeb64('0x9'));var jsforce=require(_0xeb64('0xa'));var deskjs=require(_0xeb64('0xb'));var toCsv=require('to-csv');var querystring=require(_0xeb64('0xc'));var Papa=require(_0xeb64('0xd'));var Redis=require('ioredis');var authService=require(_0xeb64('0xe'));var qs=require(_0xeb64('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb64('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xeb64('0x11'));var config=require(_0xeb64('0x12'));var licenseUtil=require(_0xeb64('0x13'));var db=require(_0xeb64('0x14'))['db'];function respondWithStatusCode(_0x2e108c,_0x3f75f5){_0x3f75f5=_0x3f75f5||0xcc;return function(_0x49792b){if(_0x49792b){return _0x2e108c['sendStatus'](_0x3f75f5);}return _0x2e108c[_0xeb64('0x15')](_0x3f75f5)[_0xeb64('0x16')]();};}function respondWithResult(_0x20515b,_0x12e728){_0x12e728=_0x12e728||0xc8;return function(_0x374120){if(_0x374120){return _0x20515b[_0xeb64('0x15')](_0x12e728)[_0xeb64('0x17')](_0x374120);}};}function respondWithFilteredResult(_0x35c881,_0x460c9d){return function(_0x1114c2){if(_0x1114c2){var _0xd5bf12=typeof _0x460c9d[_0xeb64('0x18')]===_0xeb64('0x19')&&typeof _0x460c9d[_0xeb64('0x1a')]===_0xeb64('0x19');var _0x4dc523=_0x1114c2['count'];var _0x5c5ad4=_0xd5bf12?0x0:_0x460c9d[_0xeb64('0x18')];var _0x84aaa8=_0xd5bf12?_0x1114c2['count']:_0x460c9d[_0xeb64('0x18')]+_0x460c9d['limit'];var _0x253f73;if(_0x84aaa8>=_0x4dc523){_0x84aaa8=_0x4dc523;_0x253f73=0xc8;}else{_0x253f73=0xce;}_0x35c881['status'](_0x253f73);return _0x35c881[_0xeb64('0x1b')](_0xeb64('0x1c'),_0x5c5ad4+'-'+_0x84aaa8+'/'+_0x4dc523)[_0xeb64('0x17')](_0x1114c2);}return null;};}function patchUpdates(_0x4ee7b8){return function(_0x3c5ec8){try{jsonpatch['apply'](_0x3c5ec8,_0x4ee7b8,!![]);}catch(_0x130502){return BPromise['reject'](_0x130502);}return _0x3c5ec8[_0xeb64('0x1d')]();};}function saveUpdates(_0x13a27c,_0x49f1f1){return function(_0x2a5ff7){if(_0x2a5ff7){return _0x2a5ff7['update'](_0x13a27c)[_0xeb64('0x1e')](function(_0x7407f5){return _0x7407f5;});}return null;};}function removeEntity(_0x3eda1f,_0x1dbb05){return function(_0x161065){if(_0x161065){return _0x161065[_0xeb64('0x1f')]()[_0xeb64('0x1e')](function(){_0x3eda1f[_0xeb64('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x783563,_0x307344){return function(_0x1dd211){if(!_0x1dd211){_0x783563[_0xeb64('0x20')](0x194);}return _0x1dd211;};}function handleError(_0x2a7d43,_0x46009d){_0x46009d=_0x46009d||0x1f4;return function(_0x54ed5e){logger[_0xeb64('0x21')](_0x54ed5e[_0xeb64('0x22')]);if(_0x54ed5e[_0xeb64('0x23')]){delete _0x54ed5e[_0xeb64('0x23')];}_0x2a7d43[_0xeb64('0x15')](_0x46009d)['send'](_0x54ed5e);};}exports['index']=function(_0x5198dc,_0xad5411){var _0x1163de={},_0x164fa6={},_0x5e3fe2={'count':0x0,'rows':[]};var _0x3e334b=_[_0xeb64('0x24')](db[_0xeb64('0x25')][_0xeb64('0x26')],function(_0x7f30e7){return{'name':_0x7f30e7[_0xeb64('0x27')],'type':_0x7f30e7[_0xeb64('0x28')]['key']};});_0x164fa6[_0xeb64('0x29')]=_[_0xeb64('0x24')](_0x3e334b,_0xeb64('0x23'));_0x164fa6[_0xeb64('0x2a')]=_[_0xeb64('0x2b')](_0x5198dc['query']);_0x164fa6[_0xeb64('0x2c')]=_[_0xeb64('0x2d')](_0x164fa6[_0xeb64('0x29')],_0x164fa6[_0xeb64('0x2a')]);_0x1163de['attributes']=_[_0xeb64('0x2d')](_0x164fa6[_0xeb64('0x29')],qs['fields'](_0x5198dc[_0xeb64('0x2a')][_0xeb64('0x2e')]));_0x1163de[_0xeb64('0x2f')]=_0x1163de[_0xeb64('0x2f')][_0xeb64('0x30')]?_0x1163de['attributes']:_0x164fa6[_0xeb64('0x29')];if(!_0x5198dc[_0xeb64('0x2a')][_0xeb64('0x31')](_0xeb64('0x32'))){_0x1163de[_0xeb64('0x1a')]=qs['limit'](_0x5198dc[_0xeb64('0x2a')]['limit']);_0x1163de['offset']=qs[_0xeb64('0x18')](_0x5198dc[_0xeb64('0x2a')][_0xeb64('0x18')]);}_0x1163de[_0xeb64('0x33')]=qs[_0xeb64('0x34')](_0x5198dc[_0xeb64('0x2a')]['sort']);_0x1163de['where']=qs[_0xeb64('0x2c')](_[_0xeb64('0x35')](_0x5198dc[_0xeb64('0x2a')],_0x164fa6[_0xeb64('0x2c')]),_0x3e334b);if(_0x5198dc['query'][_0xeb64('0x36')]){_0x1163de['where']=_[_0xeb64('0x37')](_0x1163de[_0xeb64('0x38')],{'$or':_[_0xeb64('0x24')](_0x3e334b,function(_0x3e292a){if(_0x3e292a[_0xeb64('0x28')]!=='VIRTUAL'){var _0x3348ae={};_0x3348ae[_0x3e292a[_0xeb64('0x23')]]={'$like':'%'+_0x5198dc['query'][_0xeb64('0x36')]+'%'};return _0x3348ae;}})});}_0x1163de=_[_0xeb64('0x37')]({},_0x1163de,_0x5198dc[_0xeb64('0x39')]);var _0x9f0e86={'where':_0x1163de[_0xeb64('0x38')]};return db[_0xeb64('0x25')][_0xeb64('0x3a')](_0x9f0e86)['then'](function(_0x460767){_0x5e3fe2[_0xeb64('0x3a')]=_0x460767;if(_0x5198dc[_0xeb64('0x2a')][_0xeb64('0x3b')]){_0x1163de[_0xeb64('0x3c')]=[{'all':!![]}];}return db[_0xeb64('0x25')][_0xeb64('0x3d')](_0x1163de);})['then'](function(_0x3c6214){_0x5e3fe2['rows']=_0x3c6214;return _0x5e3fe2;})['then'](respondWithFilteredResult(_0xad5411,_0x1163de))[_0xeb64('0x3e')](handleError(_0xad5411,null));};exports[_0xeb64('0x3f')]=function(_0x508b9e,_0x302995){var _0xc503d5={'raw':![],'where':{'id':_0x508b9e['params']['id']}},_0x380b6f={};_0x380b6f[_0xeb64('0x29')]=_[_0xeb64('0x2b')](db[_0xeb64('0x25')][_0xeb64('0x26')]);_0x380b6f[_0xeb64('0x2a')]=_['keys'](_0x508b9e[_0xeb64('0x2a')]);_0x380b6f['filters']=_[_0xeb64('0x2d')](_0x380b6f[_0xeb64('0x29')],_0x380b6f[_0xeb64('0x2a')]);_0xc503d5[_0xeb64('0x2f')]=_[_0xeb64('0x2d')](_0x380b6f['model'],qs[_0xeb64('0x2e')](_0x508b9e[_0xeb64('0x2a')][_0xeb64('0x2e')]));_0xc503d5['attributes']=_0xc503d5[_0xeb64('0x2f')][_0xeb64('0x30')]?_0xc503d5[_0xeb64('0x2f')]:_0x380b6f[_0xeb64('0x29')];if(_0x508b9e[_0xeb64('0x2a')][_0xeb64('0x3b')]){_0xc503d5[_0xeb64('0x3c')]=[{'all':!![]}];}_0xc503d5=_[_0xeb64('0x37')]({},_0xc503d5,_0x508b9e[_0xeb64('0x39')]);return db[_0xeb64('0x25')][_0xeb64('0x40')](_0xc503d5)[_0xeb64('0x1e')](handleEntityNotFound(_0x302995,null))[_0xeb64('0x1e')](respondWithResult(_0x302995,null))[_0xeb64('0x3e')](handleError(_0x302995,null));};exports[_0xeb64('0x41')]=function(_0xfea59a,_0x31be01){return db[_0xeb64('0x25')][_0xeb64('0x41')](_0xfea59a[_0xeb64('0x42')],{})[_0xeb64('0x1e')](respondWithResult(_0x31be01,0xc9))[_0xeb64('0x3e')](handleError(_0x31be01,null));};exports[_0xeb64('0x43')]=function(_0x1901e4,_0xaa9504){if(_0x1901e4[_0xeb64('0x42')]['id']){delete _0x1901e4[_0xeb64('0x42')]['id'];}return db[_0xeb64('0x25')][_0xeb64('0x40')]({'where':{'id':_0x1901e4[_0xeb64('0x44')]['id']}})[_0xeb64('0x1e')](handleEntityNotFound(_0xaa9504,null))[_0xeb64('0x1e')](saveUpdates(_0x1901e4['body'],null))[_0xeb64('0x1e')](respondWithResult(_0xaa9504,null))[_0xeb64('0x3e')](handleError(_0xaa9504,null));};exports[_0xeb64('0x1f')]=function(_0x42eea9,_0x2968e6){return db['ServicenowConfiguration'][_0xeb64('0x40')]({'where':{'id':_0x42eea9[_0xeb64('0x44')]['id']}})[_0xeb64('0x1e')](handleEntityNotFound(_0x2968e6,null))['then'](removeEntity(_0x2968e6,null))[_0xeb64('0x3e')](handleError(_0x2968e6,null));};exports[_0xeb64('0x45')]=function(_0x1e2fbd,_0x156046,_0x1ea033){var _0x54413f={};var _0x42e5e6={};var _0x1e136a;var _0x41c2f5;return db['ServicenowConfiguration'][_0xeb64('0x46')]({'where':{'id':_0x1e2fbd[_0xeb64('0x44')]['id']}})[_0xeb64('0x1e')](handleEntityNotFound(_0x156046,null))[_0xeb64('0x1e')](function(_0x22f04b){if(_0x22f04b){_0x1e136a=_0x22f04b;_0x42e5e6[_0xeb64('0x29')]=_[_0xeb64('0x2b')](db[_0xeb64('0x47')][_0xeb64('0x26')]);_0x42e5e6[_0xeb64('0x2a')]=_[_0xeb64('0x2b')](_0x1e2fbd[_0xeb64('0x2a')]);_0x42e5e6['filters']=_[_0xeb64('0x2d')](_0x42e5e6['model'],_0x42e5e6[_0xeb64('0x2a')]);_0x54413f[_0xeb64('0x2f')]=_[_0xeb64('0x2d')](_0x42e5e6[_0xeb64('0x29')],qs[_0xeb64('0x2e')](_0x1e2fbd[_0xeb64('0x2a')][_0xeb64('0x2e')]));_0x54413f[_0xeb64('0x2f')]=_0x54413f[_0xeb64('0x2f')][_0xeb64('0x30')]?_0x54413f['attributes']:_0x42e5e6[_0xeb64('0x29')];_0x54413f[_0xeb64('0x33')]=qs[_0xeb64('0x34')](_0x1e2fbd[_0xeb64('0x2a')][_0xeb64('0x34')]);_0x54413f[_0xeb64('0x38')]=qs[_0xeb64('0x2c')](_[_0xeb64('0x35')](_0x1e2fbd[_0xeb64('0x2a')],_0x42e5e6['filters']));if(_0x1e2fbd[_0xeb64('0x2a')][_0xeb64('0x36')]){_0x54413f[_0xeb64('0x38')]=_[_0xeb64('0x37')](_0x54413f['where'],{'$or':_['map'](_0x54413f[_0xeb64('0x2f')],function(_0x470281){var _0xa53d54={};_0xa53d54[_0x470281]={'$like':'%'+_0x1e2fbd['query'][_0xeb64('0x36')]+'%'};return _0xa53d54;})});}_0x54413f=_[_0xeb64('0x37')]({},_0x54413f,_0x1e2fbd[_0xeb64('0x39')]);return _0x1e136a['getFields'](_0x54413f);}})[_0xeb64('0x1e')](function(_0x422472){if(_0x422472){_0x41c2f5=_0x422472[_0xeb64('0x30')];if(!_0x1e2fbd[_0xeb64('0x2a')][_0xeb64('0x31')](_0xeb64('0x32'))){_0x54413f[_0xeb64('0x1a')]=qs[_0xeb64('0x1a')](_0x1e2fbd['query'][_0xeb64('0x1a')]);_0x54413f[_0xeb64('0x18')]=qs[_0xeb64('0x18')](_0x1e2fbd['query'][_0xeb64('0x18')]);}return _0x1e136a[_0xeb64('0x45')](_0x54413f);}})[_0xeb64('0x1e')](function(_0x5a2235){if(_0x5a2235){return _0x5a2235?{'count':_0x41c2f5,'rows':_0x5a2235}:null;}})[_0xeb64('0x1e')](respondWithResult(_0x156046,null))['catch'](handleError(_0x156046,null));};exports[_0xeb64('0x48')]=function(_0x147c35,_0x868512,_0x41542c){var _0x374cef={};var _0x1fa30b={};var _0x407181;var _0x42be5b;return db[_0xeb64('0x25')]['findOne']({'where':{'id':_0x147c35['params']['id']}})[_0xeb64('0x1e')](handleEntityNotFound(_0x868512,null))[_0xeb64('0x1e')](function(_0x16d789){if(_0x16d789){_0x407181=_0x16d789;_0x1fa30b[_0xeb64('0x29')]=_[_0xeb64('0x2b')](db[_0xeb64('0x47')][_0xeb64('0x26')]);_0x1fa30b[_0xeb64('0x2a')]=_['keys'](_0x147c35[_0xeb64('0x2a')]);_0x1fa30b[_0xeb64('0x2c')]=_[_0xeb64('0x2d')](_0x1fa30b[_0xeb64('0x29')],_0x1fa30b['query']);_0x374cef[_0xeb64('0x2f')]=_[_0xeb64('0x2d')](_0x1fa30b[_0xeb64('0x29')],qs['fields'](_0x147c35[_0xeb64('0x2a')]['fields']));_0x374cef['attributes']=_0x374cef['attributes']['length']?_0x374cef['attributes']:_0x1fa30b[_0xeb64('0x29')];_0x374cef['order']=qs[_0xeb64('0x34')](_0x147c35['query']['sort']);_0x374cef['where']=qs[_0xeb64('0x2c')](_[_0xeb64('0x35')](_0x147c35[_0xeb64('0x2a')],_0x1fa30b[_0xeb64('0x2c')]));if(_0x147c35[_0xeb64('0x2a')][_0xeb64('0x36')]){_0x374cef['where']=_[_0xeb64('0x37')](_0x374cef[_0xeb64('0x38')],{'$or':_[_0xeb64('0x24')](_0x374cef[_0xeb64('0x2f')],function(_0x4bb997){var _0x10c77d={};_0x10c77d[_0x4bb997]={'$like':'%'+_0x147c35[_0xeb64('0x2a')][_0xeb64('0x36')]+'%'};return _0x10c77d;})});}_0x374cef=_['merge']({},_0x374cef,_0x147c35[_0xeb64('0x39')]);return _0x407181['getSubjects'](_0x374cef);}})[_0xeb64('0x1e')](function(_0x1c90c8){if(_0x1c90c8){_0x42be5b=_0x1c90c8[_0xeb64('0x30')];if(!_0x147c35[_0xeb64('0x2a')][_0xeb64('0x31')](_0xeb64('0x32'))){_0x374cef['limit']=qs[_0xeb64('0x1a')](_0x147c35[_0xeb64('0x2a')]['limit']);_0x374cef['offset']=qs[_0xeb64('0x18')](_0x147c35['query'][_0xeb64('0x18')]);}return _0x407181['getSubjects'](_0x374cef);}})[_0xeb64('0x1e')](function(_0x1bf8ec){if(_0x1bf8ec){return _0x1bf8ec?{'count':_0x42be5b,'rows':_0x1bf8ec}:null;}})['then'](respondWithResult(_0x868512,null))[_0xeb64('0x3e')](handleError(_0x868512,null));};exports['getDescriptions']=function(_0x247ce0,_0x6ae0c5,_0x43e769){var _0xee613a={};var _0x4e5e20={};var _0x5df28a;var _0x53012d;return db[_0xeb64('0x25')]['findOne']({'where':{'id':_0x247ce0[_0xeb64('0x44')]['id']}})[_0xeb64('0x1e')](handleEntityNotFound(_0x6ae0c5,null))[_0xeb64('0x1e')](function(_0x415161){if(_0x415161){_0x5df28a=_0x415161;_0x4e5e20['model']=_[_0xeb64('0x2b')](db[_0xeb64('0x47')][_0xeb64('0x26')]);_0x4e5e20[_0xeb64('0x2a')]=_[_0xeb64('0x2b')](_0x247ce0[_0xeb64('0x2a')]);_0x4e5e20[_0xeb64('0x2c')]=_[_0xeb64('0x2d')](_0x4e5e20[_0xeb64('0x29')],_0x4e5e20[_0xeb64('0x2a')]);_0xee613a['attributes']=_[_0xeb64('0x2d')](_0x4e5e20[_0xeb64('0x29')],qs[_0xeb64('0x2e')](_0x247ce0[_0xeb64('0x2a')][_0xeb64('0x2e')]));_0xee613a[_0xeb64('0x2f')]=_0xee613a[_0xeb64('0x2f')][_0xeb64('0x30')]?_0xee613a[_0xeb64('0x2f')]:_0x4e5e20[_0xeb64('0x29')];_0xee613a['order']=qs['sort'](_0x247ce0[_0xeb64('0x2a')]['sort']);_0xee613a[_0xeb64('0x38')]=qs[_0xeb64('0x2c')](_[_0xeb64('0x35')](_0x247ce0[_0xeb64('0x2a')],_0x4e5e20['filters']));if(_0x247ce0[_0xeb64('0x2a')][_0xeb64('0x36')]){_0xee613a[_0xeb64('0x38')]=_[_0xeb64('0x37')](_0xee613a[_0xeb64('0x38')],{'$or':_['map'](_0xee613a['attributes'],function(_0x1e1392){var _0x261533={};_0x261533[_0x1e1392]={'$like':'%'+_0x247ce0[_0xeb64('0x2a')][_0xeb64('0x36')]+'%'};return _0x261533;})});}_0xee613a=_[_0xeb64('0x37')]({},_0xee613a,_0x247ce0['options']);return _0x5df28a[_0xeb64('0x49')](_0xee613a);}})[_0xeb64('0x1e')](function(_0x1d259d){if(_0x1d259d){_0x53012d=_0x1d259d['length'];if(!_0x247ce0['query'][_0xeb64('0x31')]('nolimit')){_0xee613a[_0xeb64('0x1a')]=qs[_0xeb64('0x1a')](_0x247ce0[_0xeb64('0x2a')][_0xeb64('0x1a')]);_0xee613a[_0xeb64('0x18')]=qs[_0xeb64('0x18')](_0x247ce0[_0xeb64('0x2a')]['offset']);}return _0x5df28a[_0xeb64('0x49')](_0xee613a);}})[_0xeb64('0x1e')](function(_0x2749fe){if(_0x2749fe){return _0x2749fe?{'count':_0x53012d,'rows':_0x2749fe}:null;}})[_0xeb64('0x1e')](respondWithResult(_0x6ae0c5,null))[_0xeb64('0x3e')](handleError(_0x6ae0c5,null));}; \ No newline at end of file +var _0x0b32=['includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','getFields','ServicenowField','length','pick','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','filter','where','merge','VIRTUAL','options'];(function(_0xf4502d,_0x162116){var _0x400b73=function(_0x1a0b6a){while(--_0x1a0b6a){_0xf4502d['push'](_0xf4502d['shift']());}};_0x400b73(++_0x162116);}(_0x0b32,0x15f));var _0x20b3=function(_0x3abf61,_0x184426){_0x3abf61=_0x3abf61-0x0;var _0x32501a=_0x0b32[_0x3abf61];return _0x32501a;};'use strict';var emlformat=require(_0x20b3('0x0'));var rimraf=require(_0x20b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20b3('0x2'));var rp=require(_0x20b3('0x3'));var moment=require(_0x20b3('0x4'));var BPromise=require(_0x20b3('0x5'));var Mustache=require(_0x20b3('0x6'));var util=require(_0x20b3('0x7'));var path=require(_0x20b3('0x8'));var sox=require(_0x20b3('0x9'));var csv=require(_0x20b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20b3('0xb'));var _=require('lodash');var squel=require(_0x20b3('0xc'));var crypto=require(_0x20b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x20b3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x20b3('0xf'));var Papa=require('papaparse');var Redis=require(_0x20b3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x20b3('0x11'));var hardwareService=require(_0x20b3('0x12'));var logger=require(_0x20b3('0x13'))(_0x20b3('0x14'));var utils=require('../../config/utils');var config=require(_0x20b3('0x15'));var licenseUtil=require(_0x20b3('0x16'));var db=require(_0x20b3('0x17'))['db'];function respondWithStatusCode(_0x3972ea,_0xa25319){_0xa25319=_0xa25319||0xcc;return function(_0x1b8ef5){if(_0x1b8ef5){return _0x3972ea['sendStatus'](_0xa25319);}return _0x3972ea[_0x20b3('0x18')](_0xa25319)[_0x20b3('0x19')]();};}function respondWithResult(_0x5a44c8,_0x3cec08){_0x3cec08=_0x3cec08||0xc8;return function(_0x30fff3){if(_0x30fff3){return _0x5a44c8[_0x20b3('0x18')](_0x3cec08)[_0x20b3('0x1a')](_0x30fff3);}};}function respondWithFilteredResult(_0x43fe5c,_0x3bcac1){return function(_0x545ba7){if(_0x545ba7){var _0x39e004=typeof _0x3bcac1[_0x20b3('0x1b')]===_0x20b3('0x1c')&&typeof _0x3bcac1[_0x20b3('0x1d')]===_0x20b3('0x1c');var _0x3cc1bd=_0x545ba7[_0x20b3('0x1e')];var _0x4366f1=_0x39e004?0x0:_0x3bcac1[_0x20b3('0x1b')];var _0x438521=_0x39e004?_0x545ba7[_0x20b3('0x1e')]:_0x3bcac1[_0x20b3('0x1b')]+_0x3bcac1[_0x20b3('0x1d')];var _0x383aae;if(_0x438521>=_0x3cc1bd){_0x438521=_0x3cc1bd;_0x383aae=0xc8;}else{_0x383aae=0xce;}_0x43fe5c[_0x20b3('0x18')](_0x383aae);return _0x43fe5c[_0x20b3('0x1f')](_0x20b3('0x20'),_0x4366f1+'-'+_0x438521+'/'+_0x3cc1bd)[_0x20b3('0x1a')](_0x545ba7);}return null;};}function patchUpdates(_0x320512){return function(_0x1433f3){try{jsonpatch[_0x20b3('0x21')](_0x1433f3,_0x320512,!![]);}catch(_0x1608f3){return BPromise[_0x20b3('0x22')](_0x1608f3);}return _0x1433f3[_0x20b3('0x23')]();};}function saveUpdates(_0x47fd79,_0x1b84dc){return function(_0x48ac77){if(_0x48ac77){return _0x48ac77[_0x20b3('0x24')](_0x47fd79)[_0x20b3('0x25')](function(_0x2a12a4){return _0x2a12a4;});}return null;};}function removeEntity(_0x210b47,_0x35a160){return function(_0x27cd1d){if(_0x27cd1d){return _0x27cd1d[_0x20b3('0x26')]()[_0x20b3('0x25')](function(){_0x210b47[_0x20b3('0x18')](0xcc)[_0x20b3('0x19')]();});}};}function handleEntityNotFound(_0x55f55c,_0x3ad5f0){return function(_0x17ed29){if(!_0x17ed29){_0x55f55c[_0x20b3('0x27')](0x194);}return _0x17ed29;};}function handleError(_0x47df3b,_0x15843c){_0x15843c=_0x15843c||0x1f4;return function(_0x432ad9){logger[_0x20b3('0x28')](_0x432ad9[_0x20b3('0x29')]);if(_0x432ad9[_0x20b3('0x2a')]){delete _0x432ad9[_0x20b3('0x2a')];}_0x47df3b[_0x20b3('0x18')](_0x15843c)[_0x20b3('0x2b')](_0x432ad9);};}exports[_0x20b3('0x2c')]=function(_0x4bc2ca,_0x440e4a){var _0x380085={},_0x393ab1={},_0x517666={'count':0x0,'rows':[]};var _0x6720b9=_[_0x20b3('0x2d')](db[_0x20b3('0x2e')]['rawAttributes'],function(_0x33d0ab){return{'name':_0x33d0ab[_0x20b3('0x2f')],'type':_0x33d0ab[_0x20b3('0x30')][_0x20b3('0x31')]};});_0x393ab1[_0x20b3('0x32')]=_[_0x20b3('0x2d')](_0x6720b9,_0x20b3('0x2a'));_0x393ab1[_0x20b3('0x33')]=_[_0x20b3('0x34')](_0x4bc2ca[_0x20b3('0x33')]);_0x393ab1[_0x20b3('0x35')]=_['intersection'](_0x393ab1[_0x20b3('0x32')],_0x393ab1[_0x20b3('0x33')]);_0x380085[_0x20b3('0x36')]=_[_0x20b3('0x37')](_0x393ab1[_0x20b3('0x32')],qs[_0x20b3('0x38')](_0x4bc2ca['query'][_0x20b3('0x38')]));_0x380085[_0x20b3('0x36')]=_0x380085[_0x20b3('0x36')]['length']?_0x380085['attributes']:_0x393ab1[_0x20b3('0x32')];if(!_0x4bc2ca[_0x20b3('0x33')]['hasOwnProperty']('nolimit')){_0x380085[_0x20b3('0x1d')]=qs[_0x20b3('0x1d')](_0x4bc2ca[_0x20b3('0x33')][_0x20b3('0x1d')]);_0x380085['offset']=qs['offset'](_0x4bc2ca[_0x20b3('0x33')][_0x20b3('0x1b')]);}_0x380085[_0x20b3('0x39')]=qs['sort'](_0x4bc2ca[_0x20b3('0x33')][_0x20b3('0x3a')]);_0x380085['where']=qs[_0x20b3('0x35')](_['pick'](_0x4bc2ca[_0x20b3('0x33')],_0x393ab1['filters']),_0x6720b9);if(_0x4bc2ca[_0x20b3('0x33')][_0x20b3('0x3b')]){_0x380085[_0x20b3('0x3c')]=_[_0x20b3('0x3d')](_0x380085[_0x20b3('0x3c')],{'$or':_[_0x20b3('0x2d')](_0x6720b9,function(_0x29b648){if(_0x29b648[_0x20b3('0x30')]!==_0x20b3('0x3e')){var _0xc33c5={};_0xc33c5[_0x29b648[_0x20b3('0x2a')]]={'$like':'%'+_0x4bc2ca['query'][_0x20b3('0x3b')]+'%'};return _0xc33c5;}})});}_0x380085=_[_0x20b3('0x3d')]({},_0x380085,_0x4bc2ca[_0x20b3('0x3f')]);var _0x42c31c={'where':_0x380085[_0x20b3('0x3c')]};return db['ServicenowConfiguration'][_0x20b3('0x1e')](_0x42c31c)[_0x20b3('0x25')](function(_0x518138){_0x517666[_0x20b3('0x1e')]=_0x518138;if(_0x4bc2ca[_0x20b3('0x33')][_0x20b3('0x40')]){_0x380085[_0x20b3('0x41')]=[{'all':!![]}];}return db[_0x20b3('0x2e')][_0x20b3('0x42')](_0x380085);})[_0x20b3('0x25')](function(_0x2d246c){_0x517666[_0x20b3('0x43')]=_0x2d246c;return _0x517666;})[_0x20b3('0x25')](respondWithFilteredResult(_0x440e4a,_0x380085))['catch'](handleError(_0x440e4a,null));};exports['show']=function(_0x5bceb6,_0x4c742d){var _0x367ce6={'raw':![],'where':{'id':_0x5bceb6[_0x20b3('0x44')]['id']}},_0x283722={};_0x283722[_0x20b3('0x32')]=_[_0x20b3('0x34')](db[_0x20b3('0x2e')][_0x20b3('0x45')]);_0x283722[_0x20b3('0x33')]=_['keys'](_0x5bceb6['query']);_0x283722['filters']=_['intersection'](_0x283722['model'],_0x283722[_0x20b3('0x33')]);_0x367ce6[_0x20b3('0x36')]=_['intersection'](_0x283722[_0x20b3('0x32')],qs[_0x20b3('0x38')](_0x5bceb6['query'][_0x20b3('0x38')]));_0x367ce6[_0x20b3('0x36')]=_0x367ce6[_0x20b3('0x36')]['length']?_0x367ce6['attributes']:_0x283722[_0x20b3('0x32')];if(_0x5bceb6['query']['includeAll']){_0x367ce6[_0x20b3('0x41')]=[{'all':!![]}];}_0x367ce6=_[_0x20b3('0x3d')]({},_0x367ce6,_0x5bceb6[_0x20b3('0x3f')]);return db['ServicenowConfiguration'][_0x20b3('0x46')](_0x367ce6)[_0x20b3('0x25')](handleEntityNotFound(_0x4c742d,null))[_0x20b3('0x25')](respondWithResult(_0x4c742d,null))[_0x20b3('0x47')](handleError(_0x4c742d,null));};exports['create']=function(_0xb80f38,_0x5890c5){return db[_0x20b3('0x2e')][_0x20b3('0x48')](_0xb80f38[_0x20b3('0x49')],{})[_0x20b3('0x25')](respondWithResult(_0x5890c5,0xc9))['catch'](handleError(_0x5890c5,null));};exports[_0x20b3('0x24')]=function(_0x30a16f,_0x1d0727){if(_0x30a16f[_0x20b3('0x49')]['id']){delete _0x30a16f[_0x20b3('0x49')]['id'];}return db[_0x20b3('0x2e')]['find']({'where':{'id':_0x30a16f[_0x20b3('0x44')]['id']}})[_0x20b3('0x25')](handleEntityNotFound(_0x1d0727,null))[_0x20b3('0x25')](saveUpdates(_0x30a16f['body'],null))['then'](respondWithResult(_0x1d0727,null))[_0x20b3('0x47')](handleError(_0x1d0727,null));};exports[_0x20b3('0x26')]=function(_0x3ec7c0,_0x7c559b){return db['ServicenowConfiguration'][_0x20b3('0x46')]({'where':{'id':_0x3ec7c0[_0x20b3('0x44')]['id']}})[_0x20b3('0x25')](handleEntityNotFound(_0x7c559b,null))[_0x20b3('0x25')](removeEntity(_0x7c559b,null))[_0x20b3('0x47')](handleError(_0x7c559b,null));};exports[_0x20b3('0x4a')]=function(_0x34fa50,_0x397131,_0x33b143){var _0x955883={};var _0x344ce0={};var _0x4d0320;var _0x24df06;return db[_0x20b3('0x2e')]['findOne']({'where':{'id':_0x34fa50[_0x20b3('0x44')]['id']}})[_0x20b3('0x25')](handleEntityNotFound(_0x397131,null))[_0x20b3('0x25')](function(_0x1c96fb){if(_0x1c96fb){_0x4d0320=_0x1c96fb;_0x344ce0[_0x20b3('0x32')]=_[_0x20b3('0x34')](db[_0x20b3('0x4b')][_0x20b3('0x45')]);_0x344ce0[_0x20b3('0x33')]=_[_0x20b3('0x34')](_0x34fa50[_0x20b3('0x33')]);_0x344ce0[_0x20b3('0x35')]=_[_0x20b3('0x37')](_0x344ce0[_0x20b3('0x32')],_0x344ce0[_0x20b3('0x33')]);_0x955883[_0x20b3('0x36')]=_[_0x20b3('0x37')](_0x344ce0['model'],qs[_0x20b3('0x38')](_0x34fa50[_0x20b3('0x33')][_0x20b3('0x38')]));_0x955883[_0x20b3('0x36')]=_0x955883['attributes'][_0x20b3('0x4c')]?_0x955883['attributes']:_0x344ce0['model'];_0x955883['order']=qs[_0x20b3('0x3a')](_0x34fa50['query'][_0x20b3('0x3a')]);_0x955883[_0x20b3('0x3c')]=qs[_0x20b3('0x35')](_[_0x20b3('0x4d')](_0x34fa50['query'],_0x344ce0[_0x20b3('0x35')]));if(_0x34fa50[_0x20b3('0x33')]['filter']){_0x955883[_0x20b3('0x3c')]=_[_0x20b3('0x3d')](_0x955883[_0x20b3('0x3c')],{'$or':_[_0x20b3('0x2d')](_0x955883['attributes'],function(_0x1d5a19){var _0x2a1e23={};_0x2a1e23[_0x1d5a19]={'$like':'%'+_0x34fa50['query'][_0x20b3('0x3b')]+'%'};return _0x2a1e23;})});}_0x955883=_[_0x20b3('0x3d')]({},_0x955883,_0x34fa50[_0x20b3('0x3f')]);return _0x4d0320[_0x20b3('0x4a')](_0x955883);}})[_0x20b3('0x25')](function(_0x48d357){if(_0x48d357){_0x24df06=_0x48d357['length'];if(!_0x34fa50[_0x20b3('0x33')][_0x20b3('0x4e')](_0x20b3('0x4f'))){_0x955883[_0x20b3('0x1d')]=qs['limit'](_0x34fa50[_0x20b3('0x33')][_0x20b3('0x1d')]);_0x955883[_0x20b3('0x1b')]=qs[_0x20b3('0x1b')](_0x34fa50[_0x20b3('0x33')][_0x20b3('0x1b')]);}return _0x4d0320[_0x20b3('0x4a')](_0x955883);}})[_0x20b3('0x25')](function(_0xff125c){if(_0xff125c){return _0xff125c?{'count':_0x24df06,'rows':_0xff125c}:null;}})[_0x20b3('0x25')](respondWithResult(_0x397131,null))[_0x20b3('0x47')](handleError(_0x397131,null));};exports[_0x20b3('0x50')]=function(_0x3f9f98,_0x2455d2,_0x47bf5d){var _0x15ab77={};var _0x917d82={};var _0x2eb36f;var _0xad82f6;return db[_0x20b3('0x2e')][_0x20b3('0x51')]({'where':{'id':_0x3f9f98[_0x20b3('0x44')]['id']}})[_0x20b3('0x25')](handleEntityNotFound(_0x2455d2,null))[_0x20b3('0x25')](function(_0x481795){if(_0x481795){_0x2eb36f=_0x481795;_0x917d82[_0x20b3('0x32')]=_[_0x20b3('0x34')](db[_0x20b3('0x4b')][_0x20b3('0x45')]);_0x917d82['query']=_[_0x20b3('0x34')](_0x3f9f98['query']);_0x917d82[_0x20b3('0x35')]=_[_0x20b3('0x37')](_0x917d82[_0x20b3('0x32')],_0x917d82[_0x20b3('0x33')]);_0x15ab77[_0x20b3('0x36')]=_['intersection'](_0x917d82[_0x20b3('0x32')],qs[_0x20b3('0x38')](_0x3f9f98[_0x20b3('0x33')][_0x20b3('0x38')]));_0x15ab77[_0x20b3('0x36')]=_0x15ab77[_0x20b3('0x36')][_0x20b3('0x4c')]?_0x15ab77[_0x20b3('0x36')]:_0x917d82[_0x20b3('0x32')];_0x15ab77[_0x20b3('0x39')]=qs[_0x20b3('0x3a')](_0x3f9f98[_0x20b3('0x33')]['sort']);_0x15ab77[_0x20b3('0x3c')]=qs[_0x20b3('0x35')](_[_0x20b3('0x4d')](_0x3f9f98[_0x20b3('0x33')],_0x917d82[_0x20b3('0x35')]));if(_0x3f9f98[_0x20b3('0x33')][_0x20b3('0x3b')]){_0x15ab77[_0x20b3('0x3c')]=_[_0x20b3('0x3d')](_0x15ab77['where'],{'$or':_[_0x20b3('0x2d')](_0x15ab77[_0x20b3('0x36')],function(_0x24e54d){var _0x4bcc81={};_0x4bcc81[_0x24e54d]={'$like':'%'+_0x3f9f98[_0x20b3('0x33')][_0x20b3('0x3b')]+'%'};return _0x4bcc81;})});}_0x15ab77=_[_0x20b3('0x3d')]({},_0x15ab77,_0x3f9f98[_0x20b3('0x3f')]);return _0x2eb36f[_0x20b3('0x50')](_0x15ab77);}})[_0x20b3('0x25')](function(_0x1ac6e4){if(_0x1ac6e4){_0xad82f6=_0x1ac6e4['length'];if(!_0x3f9f98[_0x20b3('0x33')][_0x20b3('0x4e')](_0x20b3('0x4f'))){_0x15ab77['limit']=qs[_0x20b3('0x1d')](_0x3f9f98[_0x20b3('0x33')][_0x20b3('0x1d')]);_0x15ab77['offset']=qs['offset'](_0x3f9f98[_0x20b3('0x33')]['offset']);}return _0x2eb36f[_0x20b3('0x50')](_0x15ab77);}})['then'](function(_0x471882){if(_0x471882){return _0x471882?{'count':_0xad82f6,'rows':_0x471882}:null;}})[_0x20b3('0x25')](respondWithResult(_0x2455d2,null))[_0x20b3('0x47')](handleError(_0x2455d2,null));};exports['getDescriptions']=function(_0x11fe6f,_0x33c6d4,_0x23c631){var _0x168b15={};var _0x204e7e={};var _0x381e18;var _0x3609db;return db[_0x20b3('0x2e')][_0x20b3('0x51')]({'where':{'id':_0x11fe6f['params']['id']}})[_0x20b3('0x25')](handleEntityNotFound(_0x33c6d4,null))[_0x20b3('0x25')](function(_0x23008c){if(_0x23008c){_0x381e18=_0x23008c;_0x204e7e[_0x20b3('0x32')]=_[_0x20b3('0x34')](db[_0x20b3('0x4b')]['rawAttributes']);_0x204e7e[_0x20b3('0x33')]=_[_0x20b3('0x34')](_0x11fe6f[_0x20b3('0x33')]);_0x204e7e[_0x20b3('0x35')]=_['intersection'](_0x204e7e[_0x20b3('0x32')],_0x204e7e[_0x20b3('0x33')]);_0x168b15[_0x20b3('0x36')]=_['intersection'](_0x204e7e[_0x20b3('0x32')],qs[_0x20b3('0x38')](_0x11fe6f['query'][_0x20b3('0x38')]));_0x168b15[_0x20b3('0x36')]=_0x168b15[_0x20b3('0x36')][_0x20b3('0x4c')]?_0x168b15[_0x20b3('0x36')]:_0x204e7e[_0x20b3('0x32')];_0x168b15[_0x20b3('0x39')]=qs[_0x20b3('0x3a')](_0x11fe6f[_0x20b3('0x33')]['sort']);_0x168b15[_0x20b3('0x3c')]=qs[_0x20b3('0x35')](_['pick'](_0x11fe6f[_0x20b3('0x33')],_0x204e7e['filters']));if(_0x11fe6f[_0x20b3('0x33')][_0x20b3('0x3b')]){_0x168b15[_0x20b3('0x3c')]=_[_0x20b3('0x3d')](_0x168b15[_0x20b3('0x3c')],{'$or':_[_0x20b3('0x2d')](_0x168b15[_0x20b3('0x36')],function(_0x137160){var _0x556c8e={};_0x556c8e[_0x137160]={'$like':'%'+_0x11fe6f[_0x20b3('0x33')][_0x20b3('0x3b')]+'%'};return _0x556c8e;})});}_0x168b15=_['merge']({},_0x168b15,_0x11fe6f[_0x20b3('0x3f')]);return _0x381e18[_0x20b3('0x52')](_0x168b15);}})[_0x20b3('0x25')](function(_0x2a2786){if(_0x2a2786){_0x3609db=_0x2a2786[_0x20b3('0x4c')];if(!_0x11fe6f[_0x20b3('0x33')][_0x20b3('0x4e')](_0x20b3('0x4f'))){_0x168b15[_0x20b3('0x1d')]=qs[_0x20b3('0x1d')](_0x11fe6f[_0x20b3('0x33')]['limit']);_0x168b15[_0x20b3('0x1b')]=qs[_0x20b3('0x1b')](_0x11fe6f[_0x20b3('0x33')][_0x20b3('0x1b')]);}return _0x381e18[_0x20b3('0x52')](_0x168b15);}})['then'](function(_0x34c957){if(_0x34c957){return _0x34c957?{'count':_0x3609db,'rows':_0x34c957}:null;}})[_0x20b3('0x25')](respondWithResult(_0x33c6d4,null))[_0x20b3('0x47')](handleError(_0x33c6d4,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 6157d43..49d90d8 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 _0x58cc=['../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5d8832,_0xbd5ca9){var _0x3832d4=function(_0x3d0745){while(--_0x3d0745){_0x5d8832['push'](_0x5d8832['shift']());}};_0x3832d4(++_0xbd5ca9);}(_0x58cc,0x7a));var _0xc58c=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x58cc[_0x96f74c];return _0x379222;};'use strict';var _=require(_0xc58c('0x0'));var util=require(_0xc58c('0x1'));var logger=require(_0xc58c('0x2'))(_0xc58c('0x3'));var moment=require(_0xc58c('0x4'));var BPromise=require(_0xc58c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc58c('0x6'));var rimraf=require(_0xc58c('0x7'));var config=require(_0xc58c('0x8'));var attributes=require(_0xc58c('0x9'));module[_0xc58c('0xa')]=function(_0x3a0b8b,_0x513202){return _0x3a0b8b['define'](_0xc58c('0xb'),attributes,{'tableName':_0xc58c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f40=['path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','request-promise'];(function(_0xb762db,_0x1827e0){var _0x470a9c=function(_0x1edbe4){while(--_0x1edbe4){_0xb762db['push'](_0xb762db['shift']());}};_0x470a9c(++_0x1827e0);}(_0x3f40,0xbb));var _0x03f4=function(_0x2f516a,_0x951217){_0x2f516a=_0x2f516a-0x0;var _0x7e23c5=_0x3f40[_0x2f516a];return _0x7e23c5;};'use strict';var _=require(_0x03f4('0x0'));var util=require(_0x03f4('0x1'));var logger=require(_0x03f4('0x2'))('api');var moment=require(_0x03f4('0x3'));var BPromise=require('bluebird');var rp=require(_0x03f4('0x4'));var fs=require('fs');var path=require(_0x03f4('0x5'));var rimraf=require(_0x03f4('0x6'));var config=require(_0x03f4('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x03f4('0x8')]=function(_0x3b42bb,_0x196b64){return _0x3b42bb[_0x03f4('0x9')](_0x03f4('0xa'),attributes,{'tableName':_0x03f4('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 8071642..20ddbf1 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 _0x2706=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','util'];(function(_0x597532,_0x1ff5d9){var _0x2f173d=function(_0x2dec27){while(--_0x2dec27){_0x597532['push'](_0x597532['shift']());}};_0x2f173d(++_0x1ff5d9);}(_0x2706,0x107));var _0x6270=function(_0x271b39,_0x10b593){_0x271b39=_0x271b39-0x0;var _0x5d50b7=_0x2706[_0x271b39];return _0x5d50b7;};'use strict';var _=require('lodash');var util=require(_0x6270('0x0'));var moment=require(_0x6270('0x1'));var BPromise=require(_0x6270('0x2'));var rs=require(_0x6270('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6270('0x4'))['db'];var utils=require(_0x6270('0x5'));var logger=require(_0x6270('0x6'))(_0x6270('0x7'));var config=require(_0x6270('0x8'));var jayson=require(_0x6270('0x9'));var client=jayson[_0x6270('0xa')][_0x6270('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fac3f,_0x4f700e,_0x2e6a1b){return new BPromise(function(_0x585bc1,_0x35a6e3){return client[_0x6270('0xc')](_0x4fac3f,_0x2e6a1b)[_0x6270('0xd')](function(_0xea69a0){logger[_0x6270('0xe')](_0x6270('0xf'),_0x4f700e,'request\x20sent');logger[_0x6270('0x10')](_0x6270('0x11'),_0x4f700e,_0x6270('0x12'),JSON[_0x6270('0x13')](_0xea69a0));if(_0xea69a0[_0x6270('0x14')]){if(_0xea69a0['error']['code']===0x1f4){logger[_0x6270('0x14')](_0x6270('0xf'),_0x4f700e,_0xea69a0['error']['message']);return _0x35a6e3(_0xea69a0['error'][_0x6270('0x15')]);}logger['error'](_0x6270('0xf'),_0x4f700e,_0xea69a0['error']['message']);return _0x585bc1(_0xea69a0['error'][_0x6270('0x15')]);}else{logger[_0x6270('0xe')](_0x6270('0xf'),_0x4f700e,'request\x20sent');_0x585bc1(_0xea69a0['result'][_0x6270('0x15')]);}})['catch'](function(_0x26ceb9){logger[_0x6270('0x14')](_0x6270('0xf'),_0x4f700e,_0x26ceb9);_0x35a6e3(_0x26ceb9);});});} \ No newline at end of file +var _0x58a0=['http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x58a0,0xce));var _0x058a=function(_0x38dcfe,_0x1b9f72){_0x38dcfe=_0x38dcfe-0x0;var _0x1964d8=_0x58a0[_0x38dcfe];return _0x1964d8;};'use strict';var _=require(_0x058a('0x0'));var util=require(_0x058a('0x1'));var moment=require('moment');var BPromise=require(_0x058a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x058a('0x3'));var db=require(_0x058a('0x4'))['db'];var utils=require(_0x058a('0x5'));var logger=require(_0x058a('0x6'))(_0x058a('0x7'));var config=require('../../config/environment');var jayson=require(_0x058a('0x8'));var client=jayson[_0x058a('0x9')][_0x058a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2015b0,_0x2a204a,_0x54adfe){return new BPromise(function(_0x20f003,_0x17a5af){return client[_0x058a('0xb')](_0x2015b0,_0x54adfe)[_0x058a('0xc')](function(_0x48da09){logger[_0x058a('0xd')](_0x058a('0xe'),_0x2a204a,_0x058a('0xf'));logger[_0x058a('0x10')](_0x058a('0x11'),_0x2a204a,'request\x20sent',JSON[_0x058a('0x12')](_0x48da09));if(_0x48da09[_0x058a('0x13')]){if(_0x48da09[_0x058a('0x13')][_0x058a('0x14')]===0x1f4){logger[_0x058a('0x13')](_0x058a('0xe'),_0x2a204a,_0x48da09[_0x058a('0x13')][_0x058a('0x15')]);return _0x17a5af(_0x48da09[_0x058a('0x13')][_0x058a('0x15')]);}logger[_0x058a('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2a204a,_0x48da09[_0x058a('0x13')][_0x058a('0x15')]);return _0x20f003(_0x48da09[_0x058a('0x13')][_0x058a('0x15')]);}else{logger[_0x058a('0xd')](_0x058a('0xe'),_0x2a204a,'request\x20sent');_0x20f003(_0x48da09[_0x058a('0x16')][_0x058a('0x15')]);}})[_0x058a('0x17')](function(_0x2c786a){logger[_0x058a('0x13')](_0x058a('0xe'),_0x2a204a,_0x2c786a);_0x17a5af(_0x2c786a);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 50727b3..04d7662 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 _0x26ab=['../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','Router','fs-extra'];(function(_0x133cd1,_0x54d129){var _0x10d78b=function(_0x208fc9){while(--_0x208fc9){_0x133cd1['push'](_0x133cd1['shift']());}};_0x10d78b(++_0x54d129);}(_0x26ab,0xf8));var _0xb26a=function(_0x1f8acd,_0x26d834){_0x1f8acd=_0x1f8acd-0x0;var _0xf563d4=_0x26ab[_0x1f8acd];return _0xf563d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb26a('0x0'));var timeout=require(_0xb26a('0x1'));var express=require('express');var router=express[_0xb26a('0x2')]();var fs_extra=require(_0xb26a('0x3'));var auth=require(_0xb26a('0x4'));var interaction=require(_0xb26a('0x5'));var config=require('../../config/environment');var controller=require(_0xb26a('0x6'));router[_0xb26a('0x7')]('/',auth[_0xb26a('0x8')](),controller[_0xb26a('0x9')]);router['get'](_0xb26a('0xa'),auth['isAuthenticated'](),controller[_0xb26a('0xb')]);router[_0xb26a('0xc')]('/',auth['isAuthenticated'](),controller[_0xb26a('0xd')]);router[_0xb26a('0xe')](_0xb26a('0xa'),auth[_0xb26a('0x8')](),controller[_0xb26a('0xf')]);router[_0xb26a('0x10')]('/:id',auth[_0xb26a('0x8')](),controller[_0xb26a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe7f6=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports'];(function(_0x30f4dd,_0x5f3b49){var _0x213e16=function(_0x578450){while(--_0x578450){_0x30f4dd['push'](_0x30f4dd['shift']());}};_0x213e16(++_0x5f3b49);}(_0xe7f6,0x17c));var _0x6e7f=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0xe7f6[_0x39bc44];return _0x2916d8;};'use strict';var multer=require(_0x6e7f('0x0'));var util=require(_0x6e7f('0x1'));var path=require(_0x6e7f('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e7f('0x3'));var router=express[_0x6e7f('0x4')]();var fs_extra=require(_0x6e7f('0x5'));var auth=require(_0x6e7f('0x6'));var interaction=require(_0x6e7f('0x7'));var config=require(_0x6e7f('0x8'));var controller=require(_0x6e7f('0x9'));router[_0x6e7f('0xa')]('/',auth['isAuthenticated'](),controller[_0x6e7f('0xb')]);router['get'](_0x6e7f('0xc'),auth[_0x6e7f('0xd')](),controller['show']);router[_0x6e7f('0xe')]('/',auth[_0x6e7f('0xd')](),controller[_0x6e7f('0xf')]);router[_0x6e7f('0x10')](_0x6e7f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6e7f('0x11')](_0x6e7f('0xc'),auth[_0x6e7f('0xd')](),controller[_0x6e7f('0x12')]);module[_0x6e7f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index d5c5056..4084db7 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 _0x7d04=['customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x1c1eb9,_0x1fc295){var _0x4dfe74=function(_0x1b7cf8){while(--_0x1b7cf8){_0x1c1eb9['push'](_0x1c1eb9['shift']());}};_0x4dfe74(++_0x1fc295);}(_0x7d04,0x1f3));var _0x47d0=function(_0x549b49,_0x449338){_0x549b49=_0x549b49-0x0;var _0x3e520a=_0x7d04[_0x549b49];return _0x3e520a;};'use strict';var Sequelize=require(_0x47d0('0x0'));module[_0x47d0('0x1')]={'type':{'type':Sequelize[_0x47d0('0x2')](_0x47d0('0x3'),_0x47d0('0x4'),_0x47d0('0x5'),'keyValue',_0x47d0('0x6')),'defaultValue':_0x47d0('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x47d0('0x7')]},'keyType':{'type':Sequelize[_0x47d0('0x2')](_0x47d0('0x3'),_0x47d0('0x4'),_0x47d0('0x5'))},'keyContent':{'type':Sequelize[_0x47d0('0x7')]},'idField':{'type':Sequelize[_0x47d0('0x7')]},'nameField':{'type':Sequelize[_0x47d0('0x7')]},'customField':{'type':Sequelize[_0x47d0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4813=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4813,0x7c));var _0x3481=function(_0x2b862a,_0x37a03b){_0x2b862a=_0x2b862a-0x0;var _0x41859e=_0x4813[_0x2b862a];return _0x41859e;};'use strict';var Sequelize=require(_0x3481('0x0'));module[_0x3481('0x1')]={'type':{'type':Sequelize[_0x3481('0x2')](_0x3481('0x3'),'variable',_0x3481('0x4'),_0x3481('0x5'),_0x3481('0x6')),'defaultValue':_0x3481('0x3')},'content':{'type':Sequelize[_0x3481('0x7')]},'key':{'type':Sequelize[_0x3481('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3481('0x3'),_0x3481('0x8'),_0x3481('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3481('0x7')]},'nameField':{'type':Sequelize[_0x3481('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3481('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 0a4f8cd..e67ba4d 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 _0x15e1=['destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','catch','params','options','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then'];(function(_0xa0a6c6,_0x17105a){var _0x45f08d=function(_0x31d188){while(--_0x31d188){_0xa0a6c6['push'](_0xa0a6c6['shift']());}};_0x45f08d(++_0x17105a);}(_0x15e1,0x1e1));var _0x115e=function(_0x59cf14,_0x3ba23e){_0x59cf14=_0x59cf14-0x0;var _0x2e62cb=_0x15e1[_0x59cf14];return _0x2e62cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x115e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x115e('0x1'));var rp=require(_0x115e('0x2'));var moment=require(_0x115e('0x3'));var BPromise=require(_0x115e('0x4'));var Mustache=require(_0x115e('0x5'));var util=require('util');var path=require(_0x115e('0x6'));var sox=require(_0x115e('0x7'));var csv=require(_0x115e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x115e('0x9'));var _=require(_0x115e('0xa'));var squel=require(_0x115e('0xb'));var crypto=require(_0x115e('0xc'));var jsforce=require(_0x115e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x115e('0x8'));var querystring=require(_0x115e('0xe'));var Papa=require('papaparse');var Redis=require(_0x115e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x115e('0x10'));var hardwareService=require(_0x115e('0x11'));var logger=require(_0x115e('0x12'))('api');var utils=require(_0x115e('0x13'));var config=require(_0x115e('0x14'));var licenseUtil=require(_0x115e('0x15'));var db=require(_0x115e('0x16'))['db'];function respondWithStatusCode(_0x209bd8,_0x540ca0){_0x540ca0=_0x540ca0||0xcc;return function(_0x37aef5){if(_0x37aef5){return _0x209bd8[_0x115e('0x17')](_0x540ca0);}return _0x209bd8[_0x115e('0x18')](_0x540ca0)[_0x115e('0x19')]();};}function respondWithResult(_0x288edf,_0x447c02){_0x447c02=_0x447c02||0xc8;return function(_0x57c7d3){if(_0x57c7d3){return _0x288edf[_0x115e('0x18')](_0x447c02)[_0x115e('0x1a')](_0x57c7d3);}};}function respondWithFilteredResult(_0x36a648,_0x1f3e0c){return function(_0x415087){if(_0x415087){var _0x28c4a0=typeof _0x1f3e0c['offset']===_0x115e('0x1b')&&typeof _0x1f3e0c['limit']==='undefined';var _0x3fe44e=_0x415087[_0x115e('0x1c')];var _0x10d278=_0x28c4a0?0x0:_0x1f3e0c['offset'];var _0x388f64=_0x28c4a0?_0x415087[_0x115e('0x1c')]:_0x1f3e0c[_0x115e('0x1d')]+_0x1f3e0c[_0x115e('0x1e')];var _0x5c677a;if(_0x388f64>=_0x3fe44e){_0x388f64=_0x3fe44e;_0x5c677a=0xc8;}else{_0x5c677a=0xce;}_0x36a648[_0x115e('0x18')](_0x5c677a);return _0x36a648['set'](_0x115e('0x1f'),_0x10d278+'-'+_0x388f64+'/'+_0x3fe44e)[_0x115e('0x1a')](_0x415087);}return null;};}function patchUpdates(_0x5c58be){return function(_0x4f3259){try{jsonpatch[_0x115e('0x20')](_0x4f3259,_0x5c58be,!![]);}catch(_0x222b45){return BPromise[_0x115e('0x21')](_0x222b45);}return _0x4f3259[_0x115e('0x22')]();};}function saveUpdates(_0x291a42,_0x551f2d){return function(_0x2e6a46){if(_0x2e6a46){return _0x2e6a46[_0x115e('0x23')](_0x291a42)[_0x115e('0x24')](function(_0x3afb61){return _0x3afb61;});}return null;};}function removeEntity(_0x487e68,_0x37f1b5){return function(_0x30b34c){if(_0x30b34c){return _0x30b34c[_0x115e('0x25')]()[_0x115e('0x24')](function(){_0x487e68[_0x115e('0x18')](0xcc)[_0x115e('0x19')]();});}};}function handleEntityNotFound(_0x36f702,_0x421bcd){return function(_0x5b3294){if(!_0x5b3294){_0x36f702[_0x115e('0x17')](0x194);}return _0x5b3294;};}function handleError(_0x58e12b,_0x4aa064){_0x4aa064=_0x4aa064||0x1f4;return function(_0x68e16b){logger[_0x115e('0x26')](_0x68e16b[_0x115e('0x27')]);if(_0x68e16b['name']){delete _0x68e16b[_0x115e('0x28')];}_0x58e12b[_0x115e('0x18')](_0x4aa064)[_0x115e('0x29')](_0x68e16b);};}exports[_0x115e('0x2a')]=function(_0x244e21,_0x45ff7a){var _0x5cfcce={},_0x108b5b={},_0x3ee6c4={'count':0x0,'rows':[]};var _0x128378=_[_0x115e('0x2b')](db[_0x115e('0x2c')][_0x115e('0x2d')],function(_0x35593d){return{'name':_0x35593d[_0x115e('0x2e')],'type':_0x35593d[_0x115e('0x2f')][_0x115e('0x30')]};});_0x108b5b[_0x115e('0x31')]=_[_0x115e('0x2b')](_0x128378,_0x115e('0x28'));_0x108b5b[_0x115e('0x32')]=_[_0x115e('0x33')](_0x244e21[_0x115e('0x32')]);_0x108b5b[_0x115e('0x34')]=_[_0x115e('0x35')](_0x108b5b['model'],_0x108b5b[_0x115e('0x32')]);_0x5cfcce['attributes']=_['intersection'](_0x108b5b[_0x115e('0x31')],qs[_0x115e('0x36')](_0x244e21[_0x115e('0x32')][_0x115e('0x36')]));_0x5cfcce['attributes']=_0x5cfcce[_0x115e('0x37')][_0x115e('0x38')]?_0x5cfcce[_0x115e('0x37')]:_0x108b5b[_0x115e('0x31')];if(!_0x244e21[_0x115e('0x32')][_0x115e('0x39')](_0x115e('0x3a'))){_0x5cfcce[_0x115e('0x1e')]=qs[_0x115e('0x1e')](_0x244e21[_0x115e('0x32')][_0x115e('0x1e')]);_0x5cfcce[_0x115e('0x1d')]=qs[_0x115e('0x1d')](_0x244e21['query'][_0x115e('0x1d')]);}_0x5cfcce[_0x115e('0x3b')]=qs['sort'](_0x244e21['query'][_0x115e('0x3c')]);_0x5cfcce['where']=qs['filters'](_[_0x115e('0x3d')](_0x244e21['query'],_0x108b5b['filters']),_0x128378);if(_0x244e21[_0x115e('0x32')][_0x115e('0x3e')]){_0x5cfcce[_0x115e('0x3f')]=_[_0x115e('0x40')](_0x5cfcce[_0x115e('0x3f')],{'$or':_[_0x115e('0x2b')](_0x128378,function(_0x10329c){if(_0x10329c[_0x115e('0x2f')]!=='VIRTUAL'){var _0x736359={};_0x736359[_0x10329c[_0x115e('0x28')]]={'$like':'%'+_0x244e21[_0x115e('0x32')]['filter']+'%'};return _0x736359;}})});}_0x5cfcce=_[_0x115e('0x40')]({},_0x5cfcce,_0x244e21['options']);var _0x4a7933={'where':_0x5cfcce[_0x115e('0x3f')]};return db[_0x115e('0x2c')][_0x115e('0x1c')](_0x4a7933)[_0x115e('0x24')](function(_0x45562a){_0x3ee6c4[_0x115e('0x1c')]=_0x45562a;if(_0x244e21[_0x115e('0x32')][_0x115e('0x41')]){_0x5cfcce[_0x115e('0x42')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x5cfcce);})[_0x115e('0x24')](function(_0x4e7928){_0x3ee6c4[_0x115e('0x43')]=_0x4e7928;return _0x3ee6c4;})[_0x115e('0x24')](respondWithFilteredResult(_0x45ff7a,_0x5cfcce))[_0x115e('0x44')](handleError(_0x45ff7a,null));};exports['show']=function(_0x3bb2c2,_0x4f1002){var _0x268889={'raw':!![],'where':{'id':_0x3bb2c2[_0x115e('0x45')]['id']}},_0x31bf18={};_0x31bf18[_0x115e('0x31')]=_['keys'](db[_0x115e('0x2c')][_0x115e('0x2d')]);_0x31bf18[_0x115e('0x32')]=_[_0x115e('0x33')](_0x3bb2c2[_0x115e('0x32')]);_0x31bf18[_0x115e('0x34')]=_['intersection'](_0x31bf18['model'],_0x31bf18[_0x115e('0x32')]);_0x268889[_0x115e('0x37')]=_['intersection'](_0x31bf18[_0x115e('0x31')],qs['fields'](_0x3bb2c2[_0x115e('0x32')][_0x115e('0x36')]));_0x268889[_0x115e('0x37')]=_0x268889[_0x115e('0x37')]['length']?_0x268889[_0x115e('0x37')]:_0x31bf18[_0x115e('0x31')];if(_0x3bb2c2[_0x115e('0x32')][_0x115e('0x41')]){_0x268889['include']=[{'all':!![]}];}_0x268889=_[_0x115e('0x40')]({},_0x268889,_0x3bb2c2[_0x115e('0x46')]);return db['ServicenowField']['find'](_0x268889)[_0x115e('0x24')](handleEntityNotFound(_0x4f1002,null))[_0x115e('0x24')](respondWithResult(_0x4f1002,null))['catch'](handleError(_0x4f1002,null));};exports[_0x115e('0x47')]=function(_0x5d4c21,_0x25088f){return db[_0x115e('0x2c')][_0x115e('0x47')](_0x5d4c21[_0x115e('0x48')],{})[_0x115e('0x24')](respondWithResult(_0x25088f,0xc9))[_0x115e('0x44')](handleError(_0x25088f,null));};exports[_0x115e('0x23')]=function(_0x23ca2b,_0x279f2d){if(_0x23ca2b['body']['id']){delete _0x23ca2b['body']['id'];}return db[_0x115e('0x2c')][_0x115e('0x49')]({'where':{'id':_0x23ca2b['params']['id']}})[_0x115e('0x24')](handleEntityNotFound(_0x279f2d,null))['then'](saveUpdates(_0x23ca2b['body'],null))[_0x115e('0x24')](respondWithResult(_0x279f2d,null))[_0x115e('0x44')](handleError(_0x279f2d,null));};exports[_0x115e('0x25')]=function(_0x5ed401,_0x3d0bd5){return db[_0x115e('0x2c')]['find']({'where':{'id':_0x5ed401[_0x115e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d0bd5,null))[_0x115e('0x24')](removeEntity(_0x3d0bd5,null))[_0x115e('0x44')](handleError(_0x3d0bd5,null));}; \ No newline at end of file +var _0xf4aa=['status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','where','filters','pick','merge','filter','options','include','findAll','rows','catch','show','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0xf4aa,0x100));var _0xaf4a=function(_0x2c2dff,_0x302e28){_0x2c2dff=_0x2c2dff-0x0;var _0x1177a4=_0xf4aa[_0x2c2dff];return _0x1177a4;};'use strict';var emlformat=require(_0xaf4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf4a('0x1'));var jsonpatch=require(_0xaf4a('0x2'));var rp=require(_0xaf4a('0x3'));var moment=require(_0xaf4a('0x4'));var BPromise=require(_0xaf4a('0x5'));var Mustache=require(_0xaf4a('0x6'));var util=require('util');var path=require(_0xaf4a('0x7'));var sox=require(_0xaf4a('0x8'));var csv=require(_0xaf4a('0x9'));var ejs=require(_0xaf4a('0xa'));var fs=require('fs');var fs_extra=require(_0xaf4a('0xb'));var _=require(_0xaf4a('0xc'));var squel=require('squel');var crypto=require(_0xaf4a('0xd'));var jsforce=require(_0xaf4a('0xe'));var deskjs=require(_0xaf4a('0xf'));var toCsv=require(_0xaf4a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaf4a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf4a('0x11'));var logger=require(_0xaf4a('0x12'))(_0xaf4a('0x13'));var utils=require(_0xaf4a('0x14'));var config=require(_0xaf4a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf4a('0x16'))['db'];function respondWithStatusCode(_0x15737f,_0x2e07f3){_0x2e07f3=_0x2e07f3||0xcc;return function(_0x498654){if(_0x498654){return _0x15737f[_0xaf4a('0x17')](_0x2e07f3);}return _0x15737f[_0xaf4a('0x18')](_0x2e07f3)[_0xaf4a('0x19')]();};}function respondWithResult(_0x3820ac,_0x258f0a){_0x258f0a=_0x258f0a||0xc8;return function(_0x304fb4){if(_0x304fb4){return _0x3820ac[_0xaf4a('0x18')](_0x258f0a)[_0xaf4a('0x1a')](_0x304fb4);}};}function respondWithFilteredResult(_0x5b96c1,_0x26d6ad){return function(_0x488e45){if(_0x488e45){var _0x3144d0=typeof _0x26d6ad[_0xaf4a('0x1b')]===_0xaf4a('0x1c')&&typeof _0x26d6ad[_0xaf4a('0x1d')]===_0xaf4a('0x1c');var _0x6b5f95=_0x488e45[_0xaf4a('0x1e')];var _0x23c85a=_0x3144d0?0x0:_0x26d6ad[_0xaf4a('0x1b')];var _0x501dde=_0x3144d0?_0x488e45[_0xaf4a('0x1e')]:_0x26d6ad['offset']+_0x26d6ad['limit'];var _0x4c4173;if(_0x501dde>=_0x6b5f95){_0x501dde=_0x6b5f95;_0x4c4173=0xc8;}else{_0x4c4173=0xce;}_0x5b96c1[_0xaf4a('0x18')](_0x4c4173);return _0x5b96c1['set'](_0xaf4a('0x1f'),_0x23c85a+'-'+_0x501dde+'/'+_0x6b5f95)[_0xaf4a('0x1a')](_0x488e45);}return null;};}function patchUpdates(_0xb47212){return function(_0x27d100){try{jsonpatch['apply'](_0x27d100,_0xb47212,!![]);}catch(_0x3d7aa7){return BPromise['reject'](_0x3d7aa7);}return _0x27d100['save']();};}function saveUpdates(_0xa4c17,_0x330e4b){return function(_0x16008b){if(_0x16008b){return _0x16008b[_0xaf4a('0x20')](_0xa4c17)[_0xaf4a('0x21')](function(_0x2431fa){return _0x2431fa;});}return null;};}function removeEntity(_0x12c89f,_0x100c69){return function(_0x4182db){if(_0x4182db){return _0x4182db[_0xaf4a('0x22')]()[_0xaf4a('0x21')](function(){_0x12c89f[_0xaf4a('0x18')](0xcc)[_0xaf4a('0x19')]();});}};}function handleEntityNotFound(_0x2344b2,_0x4d57a0){return function(_0x318e1b){if(!_0x318e1b){_0x2344b2[_0xaf4a('0x17')](0x194);}return _0x318e1b;};}function handleError(_0xfe3c7f,_0x44a83d){_0x44a83d=_0x44a83d||0x1f4;return function(_0x19e0a9){logger[_0xaf4a('0x23')](_0x19e0a9[_0xaf4a('0x24')]);if(_0x19e0a9[_0xaf4a('0x25')]){delete _0x19e0a9[_0xaf4a('0x25')];}_0xfe3c7f[_0xaf4a('0x18')](_0x44a83d)[_0xaf4a('0x26')](_0x19e0a9);};}exports[_0xaf4a('0x27')]=function(_0x29d714,_0x495bb2){var _0x1cdc70={},_0x31b788={},_0x2592a9={'count':0x0,'rows':[]};var _0x526c70=_[_0xaf4a('0x28')](db[_0xaf4a('0x29')][_0xaf4a('0x2a')],function(_0x33a8aa){return{'name':_0x33a8aa[_0xaf4a('0x2b')],'type':_0x33a8aa[_0xaf4a('0x2c')][_0xaf4a('0x2d')]};});_0x31b788[_0xaf4a('0x2e')]=_[_0xaf4a('0x28')](_0x526c70,'name');_0x31b788[_0xaf4a('0x2f')]=_[_0xaf4a('0x30')](_0x29d714[_0xaf4a('0x2f')]);_0x31b788['filters']=_['intersection'](_0x31b788[_0xaf4a('0x2e')],_0x31b788['query']);_0x1cdc70[_0xaf4a('0x31')]=_[_0xaf4a('0x32')](_0x31b788[_0xaf4a('0x2e')],qs[_0xaf4a('0x33')](_0x29d714['query'][_0xaf4a('0x33')]));_0x1cdc70[_0xaf4a('0x31')]=_0x1cdc70[_0xaf4a('0x31')][_0xaf4a('0x34')]?_0x1cdc70[_0xaf4a('0x31')]:_0x31b788['model'];if(!_0x29d714['query']['hasOwnProperty'](_0xaf4a('0x35'))){_0x1cdc70[_0xaf4a('0x1d')]=qs[_0xaf4a('0x1d')](_0x29d714['query'][_0xaf4a('0x1d')]);_0x1cdc70['offset']=qs[_0xaf4a('0x1b')](_0x29d714[_0xaf4a('0x2f')]['offset']);}_0x1cdc70[_0xaf4a('0x36')]=qs['sort'](_0x29d714[_0xaf4a('0x2f')]['sort']);_0x1cdc70[_0xaf4a('0x37')]=qs[_0xaf4a('0x38')](_[_0xaf4a('0x39')](_0x29d714[_0xaf4a('0x2f')],_0x31b788[_0xaf4a('0x38')]),_0x526c70);if(_0x29d714[_0xaf4a('0x2f')]['filter']){_0x1cdc70[_0xaf4a('0x37')]=_[_0xaf4a('0x3a')](_0x1cdc70[_0xaf4a('0x37')],{'$or':_[_0xaf4a('0x28')](_0x526c70,function(_0x281968){if(_0x281968[_0xaf4a('0x2c')]!=='VIRTUAL'){var _0xc7025e={};_0xc7025e[_0x281968[_0xaf4a('0x25')]]={'$like':'%'+_0x29d714['query'][_0xaf4a('0x3b')]+'%'};return _0xc7025e;}})});}_0x1cdc70=_[_0xaf4a('0x3a')]({},_0x1cdc70,_0x29d714[_0xaf4a('0x3c')]);var _0x2bd36d={'where':_0x1cdc70[_0xaf4a('0x37')]};return db[_0xaf4a('0x29')]['count'](_0x2bd36d)['then'](function(_0x308ba6){_0x2592a9[_0xaf4a('0x1e')]=_0x308ba6;if(_0x29d714[_0xaf4a('0x2f')]['includeAll']){_0x1cdc70[_0xaf4a('0x3d')]=[{'all':!![]}];}return db[_0xaf4a('0x29')][_0xaf4a('0x3e')](_0x1cdc70);})[_0xaf4a('0x21')](function(_0x18576e){_0x2592a9[_0xaf4a('0x3f')]=_0x18576e;return _0x2592a9;})['then'](respondWithFilteredResult(_0x495bb2,_0x1cdc70))[_0xaf4a('0x40')](handleError(_0x495bb2,null));};exports[_0xaf4a('0x41')]=function(_0x2beafa,_0x529079){var _0x17c512={'raw':!![],'where':{'id':_0x2beafa['params']['id']}},_0x4937f9={};_0x4937f9['model']=_[_0xaf4a('0x30')](db[_0xaf4a('0x29')][_0xaf4a('0x2a')]);_0x4937f9[_0xaf4a('0x2f')]=_[_0xaf4a('0x30')](_0x2beafa[_0xaf4a('0x2f')]);_0x4937f9[_0xaf4a('0x38')]=_[_0xaf4a('0x32')](_0x4937f9[_0xaf4a('0x2e')],_0x4937f9[_0xaf4a('0x2f')]);_0x17c512[_0xaf4a('0x31')]=_['intersection'](_0x4937f9[_0xaf4a('0x2e')],qs[_0xaf4a('0x33')](_0x2beafa[_0xaf4a('0x2f')][_0xaf4a('0x33')]));_0x17c512[_0xaf4a('0x31')]=_0x17c512[_0xaf4a('0x31')]['length']?_0x17c512[_0xaf4a('0x31')]:_0x4937f9['model'];if(_0x2beafa[_0xaf4a('0x2f')][_0xaf4a('0x42')]){_0x17c512[_0xaf4a('0x3d')]=[{'all':!![]}];}_0x17c512=_[_0xaf4a('0x3a')]({},_0x17c512,_0x2beafa['options']);return db[_0xaf4a('0x29')][_0xaf4a('0x43')](_0x17c512)[_0xaf4a('0x21')](handleEntityNotFound(_0x529079,null))[_0xaf4a('0x21')](respondWithResult(_0x529079,null))[_0xaf4a('0x40')](handleError(_0x529079,null));};exports['create']=function(_0x442015,_0x5ca0e1){return db[_0xaf4a('0x29')][_0xaf4a('0x44')](_0x442015['body'],{})[_0xaf4a('0x21')](respondWithResult(_0x5ca0e1,0xc9))[_0xaf4a('0x40')](handleError(_0x5ca0e1,null));};exports['update']=function(_0x56d983,_0x5df9ae){if(_0x56d983['body']['id']){delete _0x56d983[_0xaf4a('0x45')]['id'];}return db[_0xaf4a('0x29')][_0xaf4a('0x43')]({'where':{'id':_0x56d983['params']['id']}})['then'](handleEntityNotFound(_0x5df9ae,null))[_0xaf4a('0x21')](saveUpdates(_0x56d983[_0xaf4a('0x45')],null))[_0xaf4a('0x21')](respondWithResult(_0x5df9ae,null))[_0xaf4a('0x40')](handleError(_0x5df9ae,null));};exports[_0xaf4a('0x22')]=function(_0x15f6a0,_0x2db5cf){return db[_0xaf4a('0x29')]['find']({'where':{'id':_0x15f6a0['params']['id']}})[_0xaf4a('0x21')](handleEntityNotFound(_0x2db5cf,null))[_0xaf4a('0x21')](removeEntity(_0x2db5cf,null))[_0xaf4a('0x40')](handleError(_0x2db5cf,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7daaaa7..9e8ef06 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 _0xfe69=['FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','define','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x48b9b8,_0x55704f){var _0x323bc0=function(_0x51d316){while(--_0x51d316){_0x48b9b8['push'](_0x48b9b8['shift']());}};_0x323bc0(++_0x55704f);}(_0xfe69,0x1b3));var _0x9fe6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfe69[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9fe6('0x0'));var util=require(_0x9fe6('0x1'));var logger=require('../../config/logger')(_0x9fe6('0x2'));var moment=require(_0x9fe6('0x3'));var BPromise=require('bluebird');var rp=require(_0x9fe6('0x4'));var fs=require('fs');var path=require(_0x9fe6('0x5'));var rimraf=require(_0x9fe6('0x6'));var config=require(_0x9fe6('0x7'));var attributes=require(_0x9fe6('0x8'));module['exports']=function(_0x15af55,_0x15fbb1){return _0x15af55[_0x9fe6('0x9')]('ServicenowField',attributes,{'tableName':_0x9fe6('0xa'),'paranoid':![],'indexes':[{'name':_0x9fe6('0xb'),'fields':[_0x9fe6('0xc'),_0x9fe6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb973=['request-promise','path','rimraf','./intServicenowField.attributes','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x584ab0,_0x4938d3){var _0x2ec522=function(_0x145506){while(--_0x145506){_0x584ab0['push'](_0x584ab0['shift']());}};_0x2ec522(++_0x4938d3);}(_0xb973,0x1e9));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b97('0x0'));var util=require(_0x3b97('0x1'));var logger=require(_0x3b97('0x2'))(_0x3b97('0x3'));var moment=require(_0x3b97('0x4'));var BPromise=require(_0x3b97('0x5'));var rp=require(_0x3b97('0x6'));var fs=require('fs');var path=require(_0x3b97('0x7'));var rimraf=require(_0x3b97('0x8'));var config=require('../../config/environment');var attributes=require(_0x3b97('0x9'));module['exports']=function(_0x5d61c9,_0x20320b){return _0x5d61c9[_0x3b97('0xa')]('ServicenowField',attributes,{'tableName':_0x3b97('0xb'),'paranoid':![],'indexes':[{'name':_0x3b97('0xc'),'fields':[_0x3b97('0xd'),_0x3b97('0xe')],'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 871193d..3b2b777 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1fa469,_0x5e19b1){var _0x22cc36=function(_0x4939bb){while(--_0x4939bb){_0x1fa469['push'](_0x1fa469['shift']());}};_0x22cc36(++_0x5e19b1);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e85a4,_0x18c3a9){_0x3e85a4=_0x3e85a4-0x0;var _0x21e7d1=_0xaa88[_0x3e85a4];return _0x21e7d1;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\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(_0x481015,_0x5b3e2e){var _0x24a6c5=function(_0x18071c){while(--_0x18071c){_0x481015['push'](_0x481015['shift']());}};_0x24a6c5(++_0x5b3e2e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x51f9a4,_0x350b0e){_0x51f9a4=_0x51f9a4-0x0;var _0x4a95a5=_0xf4eb[_0x51f9a4];return _0x4a95a5;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index cd5860c..bd920ca 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(_0x374257,_0x58bc0f){var _0x3c8265=function(_0x6315e9){while(--_0x6315e9){_0x374257['push'](_0x374257['shift']());}};_0x3c8265(++_0x58bc0f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x3ccda4,_0x3b097b){var _0x4c68d6=function(_0x13753f){while(--_0x13753f){_0x3ccda4['push'](_0x3ccda4['shift']());}};_0x4c68d6(++_0x3b097b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 500438b..7f34f22 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(_0x1825fe,_0x5b7e92){var _0x21fd83=function(_0x441d74){while(--_0x441d74){_0x1825fe['push'](_0x1825fe['shift']());}};_0x21fd83(++_0x5b7e92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x435b49,_0x2b4a15){var _0x13b870=function(_0x1d2f8b){while(--_0x1d2f8b){_0x435b49['push'](_0x435b49['shift']());}};_0x13b870(++_0x2b4a15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 f04c581..7d87350 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 _0x834c=['statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','include','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','endsWith','value','test'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x834c,0x165));var _0xc834=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x834c[_0x3e69ae];return _0x3d7f42;};'use strict';var emlformat=require(_0xc834('0x0'));var rimraf=require(_0xc834('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc834('0x2'));var rp=require(_0xc834('0x3'));var moment=require(_0xc834('0x4'));var BPromise=require(_0xc834('0x5'));var Mustache=require(_0xc834('0x6'));var util=require('util');var path=require(_0xc834('0x7'));var sox=require(_0xc834('0x8'));var csv=require(_0xc834('0x9'));var ejs=require(_0xc834('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc834('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc834('0x9'));var querystring=require(_0xc834('0xc'));var Papa=require('papaparse');var Redis=require(_0xc834('0xd'));var authService=require(_0xc834('0xe'));var qs=require(_0xc834('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc834('0x10'))(_0xc834('0x11'));var utils=require(_0xc834('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc834('0x13'));var db=require(_0xc834('0x14'))['db'];var integrations=require(_0xc834('0x15'));function respondWithStatusCode(_0xab76d1,_0x2a1006){_0x2a1006=_0x2a1006||0xcc;return function(_0x34a5eb){if(_0x34a5eb){return _0xab76d1[_0xc834('0x16')](_0x2a1006);}return _0xab76d1[_0xc834('0x17')](_0x2a1006)[_0xc834('0x18')]();};}function respondWithResult(_0x7f37bd,_0x15b394){_0x15b394=_0x15b394||0xc8;return function(_0x4577f9){if(_0x4577f9){return _0x7f37bd[_0xc834('0x17')](_0x15b394)[_0xc834('0x19')](_0x4577f9);}};}function respondWithFilteredResult(_0x2e103c,_0x1e1a0a){return function(_0x1b0a85){if(_0x1b0a85){var _0x2dced7=typeof _0x1e1a0a[_0xc834('0x1a')]==='undefined'&&typeof _0x1e1a0a[_0xc834('0x1b')]===_0xc834('0x1c');var _0x36687e=_0x1b0a85[_0xc834('0x1d')];var _0xefb666=_0x2dced7?0x0:_0x1e1a0a[_0xc834('0x1a')];var _0x2f95e5=_0x2dced7?_0x1b0a85['count']:_0x1e1a0a['offset']+_0x1e1a0a[_0xc834('0x1b')];var _0x591960;if(_0x2f95e5>=_0x36687e){_0x2f95e5=_0x36687e;_0x591960=0xc8;}else{_0x591960=0xce;}_0x2e103c[_0xc834('0x17')](_0x591960);return _0x2e103c['set'](_0xc834('0x1e'),_0xefb666+'-'+_0x2f95e5+'/'+_0x36687e)[_0xc834('0x19')](_0x1b0a85);}return null;};}function patchUpdates(_0x18f011){return function(_0x480589){try{jsonpatch[_0xc834('0x1f')](_0x480589,_0x18f011,!![]);}catch(_0x57e2a8){return BPromise[_0xc834('0x20')](_0x57e2a8);}return _0x480589['save']();};}function saveUpdates(_0x2d3658,_0x49433d){return function(_0x483459){if(_0x483459){return _0x483459[_0xc834('0x21')](_0x2d3658)[_0xc834('0x22')](function(_0x416133){return _0x416133;});}return null;};}function removeEntity(_0x18a214,_0x4d8c1b){return function(_0x18b67c){if(_0x18b67c){return _0x18b67c[_0xc834('0x23')]()[_0xc834('0x22')](function(){_0x18a214[_0xc834('0x17')](0xcc)[_0xc834('0x18')]();});}};}function handleEntityNotFound(_0x495eb3,_0x1e8c80){return function(_0x52f38e){if(!_0x52f38e){_0x495eb3[_0xc834('0x16')](0x194);}return _0x52f38e;};}function handleError(_0x13eeaa,_0x1447cb){_0x1447cb=_0x1447cb||0x1f4;return function(_0x13899b){logger[_0xc834('0x24')](_0x13899b[_0xc834('0x25')]);if(_0x13899b['name']){delete _0x13899b[_0xc834('0x26')];}_0x13eeaa[_0xc834('0x17')](_0x1447cb)[_0xc834('0x27')](_0x13899b);};}exports[_0xc834('0x28')]=function(_0x15f89c,_0x52af38){var _0x228f81={},_0x5c8825={},_0xbe79d7={'count':0x0,'rows':[]};var _0x23dda6=_[_0xc834('0x29')](db[_0xc834('0x2a')][_0xc834('0x2b')],function(_0x730ff4){return{'name':_0x730ff4[_0xc834('0x2c')],'type':_0x730ff4[_0xc834('0x2d')][_0xc834('0x2e')]};});_0x5c8825[_0xc834('0x2f')]=_[_0xc834('0x29')](_0x23dda6,_0xc834('0x26'));_0x5c8825[_0xc834('0x30')]=_[_0xc834('0x31')](_0x15f89c[_0xc834('0x30')]);_0x5c8825[_0xc834('0x32')]=_[_0xc834('0x33')](_0x5c8825[_0xc834('0x2f')],_0x5c8825[_0xc834('0x30')]);_0x228f81['attributes']=_['intersection'](_0x5c8825['model'],qs[_0xc834('0x34')](_0x15f89c[_0xc834('0x30')][_0xc834('0x34')]));_0x228f81[_0xc834('0x35')]=_0x228f81[_0xc834('0x35')][_0xc834('0x36')]?_0x228f81[_0xc834('0x35')]:_0x5c8825[_0xc834('0x2f')];if(!_0x15f89c[_0xc834('0x30')][_0xc834('0x37')](_0xc834('0x38'))){_0x228f81[_0xc834('0x1b')]=qs[_0xc834('0x1b')](_0x15f89c[_0xc834('0x30')][_0xc834('0x1b')]);_0x228f81[_0xc834('0x1a')]=qs[_0xc834('0x1a')](_0x15f89c[_0xc834('0x30')][_0xc834('0x1a')]);}_0x228f81[_0xc834('0x39')]=qs[_0xc834('0x3a')](_0x15f89c[_0xc834('0x30')][_0xc834('0x3a')]);_0x228f81['where']=qs[_0xc834('0x32')](_[_0xc834('0x3b')](_0x15f89c[_0xc834('0x30')],_0x5c8825[_0xc834('0x32')]),_0x23dda6);if(_0x15f89c['query']['filter']){_0x228f81[_0xc834('0x3c')]=_[_0xc834('0x3d')](_0x228f81['where'],{'$or':_[_0xc834('0x29')](_0x23dda6,function(_0x1105cc){if(_0x1105cc[_0xc834('0x2d')]!==_0xc834('0x3e')){var _0x23455d={};_0x23455d[_0x1105cc[_0xc834('0x26')]]={'$like':'%'+_0x15f89c[_0xc834('0x30')][_0xc834('0x3f')]+'%'};return _0x23455d;}})});}_0x228f81=_[_0xc834('0x3d')]({},_0x228f81,_0x15f89c['options']);var _0x5ca1a3={'where':_0x228f81[_0xc834('0x3c')]};return db[_0xc834('0x2a')][_0xc834('0x1d')](_0x5ca1a3)[_0xc834('0x22')](function(_0x3997a5){_0xbe79d7[_0xc834('0x1d')]=_0x3997a5;if(_0x15f89c[_0xc834('0x30')][_0xc834('0x40')]){_0x228f81['include']=[{'all':!![]}];}return db[_0xc834('0x2a')]['findAll'](_0x228f81);})[_0xc834('0x22')](function(_0x13220c){_0xbe79d7[_0xc834('0x41')]=_0x13220c;return _0xbe79d7;})[_0xc834('0x22')](respondWithFilteredResult(_0x52af38,_0x228f81))[_0xc834('0x42')](handleError(_0x52af38,null));};exports[_0xc834('0x43')]=function(_0x279969,_0x186823){var _0x4f967c={'raw':![],'where':{'id':_0x279969[_0xc834('0x44')]['id']}},_0x1d6db4={};_0x1d6db4[_0xc834('0x2f')]=_[_0xc834('0x31')](db[_0xc834('0x2a')][_0xc834('0x2b')]);_0x1d6db4[_0xc834('0x30')]=_[_0xc834('0x31')](_0x279969[_0xc834('0x30')]);_0x1d6db4[_0xc834('0x32')]=_[_0xc834('0x33')](_0x1d6db4[_0xc834('0x2f')],_0x1d6db4[_0xc834('0x30')]);_0x4f967c[_0xc834('0x35')]=_[_0xc834('0x33')](_0x1d6db4[_0xc834('0x2f')],qs[_0xc834('0x34')](_0x279969['query']['fields']));_0x4f967c[_0xc834('0x35')]=_0x4f967c[_0xc834('0x35')]['length']?_0x4f967c[_0xc834('0x35')]:_0x1d6db4['model'];if(_0x279969['query'][_0xc834('0x40')]){_0x4f967c[_0xc834('0x45')]=[{'all':!![]}];}_0x4f967c=_['merge']({},_0x4f967c,_0x279969[_0xc834('0x46')]);return db[_0xc834('0x2a')][_0xc834('0x47')](_0x4f967c)[_0xc834('0x22')](handleEntityNotFound(_0x186823,null))[_0xc834('0x22')](respondWithResult(_0x186823,null))['catch'](handleError(_0x186823,null));};exports[_0xc834('0x48')]=function(_0x494189,_0x54f2d3){return db['SugarcrmAccount'][_0xc834('0x48')](_0x494189[_0xc834('0x49')],{})[_0xc834('0x22')](respondWithResult(_0x54f2d3,0xc9))[_0xc834('0x42')](handleError(_0x54f2d3,null));};exports['update']=function(_0x58040c,_0x4043ab){if(_0x58040c[_0xc834('0x49')]['id']){delete _0x58040c[_0xc834('0x49')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x58040c[_0xc834('0x44')]['id']}})[_0xc834('0x22')](handleEntityNotFound(_0x4043ab,null))[_0xc834('0x22')](saveUpdates(_0x58040c['body'],null))[_0xc834('0x22')](respondWithResult(_0x4043ab,null))[_0xc834('0x42')](handleError(_0x4043ab,null));};exports[_0xc834('0x23')]=function(_0x40ba88,_0x48c16b){return db[_0xc834('0x2a')][_0xc834('0x47')]({'where':{'id':_0x40ba88[_0xc834('0x44')]['id']}})[_0xc834('0x22')](handleEntityNotFound(_0x48c16b,null))[_0xc834('0x22')](removeEntity(_0x48c16b,null))[_0xc834('0x42')](handleError(_0x48c16b,null));};exports[_0xc834('0x4a')]=function(_0x15a3a0,_0x3a4653,_0x1bfab5){var _0x158cd1={};var _0x1d0f4f={};var _0x3b6a6f;var _0xcc3074;return db[_0xc834('0x2a')][_0xc834('0x4b')]({'where':{'id':_0x15a3a0['params']['id']}})['then'](handleEntityNotFound(_0x3a4653,null))[_0xc834('0x22')](function(_0x8fde65){if(_0x8fde65){_0x3b6a6f=_0x8fde65;_0x1d0f4f[_0xc834('0x2f')]=_[_0xc834('0x31')](db[_0xc834('0x4c')]['rawAttributes']);_0x1d0f4f[_0xc834('0x30')]=_['keys'](_0x15a3a0[_0xc834('0x30')]);_0x1d0f4f[_0xc834('0x32')]=_[_0xc834('0x33')](_0x1d0f4f[_0xc834('0x2f')],_0x1d0f4f['query']);_0x158cd1[_0xc834('0x35')]=_['intersection'](_0x1d0f4f['model'],qs[_0xc834('0x34')](_0x15a3a0['query']['fields']));_0x158cd1['attributes']=_0x158cd1[_0xc834('0x35')][_0xc834('0x36')]?_0x158cd1[_0xc834('0x35')]:_0x1d0f4f['model'];_0x158cd1[_0xc834('0x39')]=qs['sort'](_0x15a3a0[_0xc834('0x30')][_0xc834('0x3a')]);_0x158cd1['where']=qs[_0xc834('0x32')](_[_0xc834('0x3b')](_0x15a3a0['query'],_0x1d0f4f['filters']));if(_0x15a3a0['query']['filter']){_0x158cd1[_0xc834('0x3c')]=_[_0xc834('0x3d')](_0x158cd1[_0xc834('0x3c')],{'$or':_[_0xc834('0x29')](_0x158cd1[_0xc834('0x35')],function(_0x3077e0){var _0x31591e={};_0x31591e[_0x3077e0]={'$like':'%'+_0x15a3a0['query'][_0xc834('0x3f')]+'%'};return _0x31591e;})});}_0x158cd1=_['merge']({},_0x158cd1,_0x15a3a0['options']);return _0x3b6a6f[_0xc834('0x4a')](_0x158cd1);}})[_0xc834('0x22')](function(_0x1f7946){if(_0x1f7946){_0xcc3074=_0x1f7946[_0xc834('0x36')];if(!_0x15a3a0[_0xc834('0x30')]['hasOwnProperty']('nolimit')){_0x158cd1[_0xc834('0x1b')]=qs['limit'](_0x15a3a0['query']['limit']);_0x158cd1[_0xc834('0x1a')]=qs[_0xc834('0x1a')](_0x15a3a0['query']['offset']);}return _0x3b6a6f[_0xc834('0x4a')](_0x158cd1);}})[_0xc834('0x22')](function(_0x2c7e79){if(_0x2c7e79){return _0x2c7e79?{'count':_0xcc3074,'rows':_0x2c7e79}:null;}})[_0xc834('0x22')](respondWithResult(_0x3a4653,null))[_0xc834('0x42')](handleError(_0x3a4653,null));};exports['addConfiguration']=function(_0x5d69b7,_0x251bd4,_0x7012f5){if(_0x5d69b7[_0xc834('0x49')]['id']){delete _0x5d69b7[_0xc834('0x49')]['id'];}return db[_0xc834('0x2a')][_0xc834('0x4b')]({'where':{'id':_0x5d69b7['params']['id']}})['then'](handleEntityNotFound(_0x251bd4,null))[_0xc834('0x22')](function(_0x4d2990){if(_0x4d2990){_0x5d69b7[_0xc834('0x49')]['AccountId']=_0x4d2990['id'];_0x5d69b7[_0xc834('0x49')][_0xc834('0x4d')]=integrations[_0xc834('0x4e')](_0x5d69b7[_0xc834('0x49')][_0xc834('0x4f')],_0x5d69b7[_0xc834('0x49')][_0xc834('0x2d')]);_0x5d69b7[_0xc834('0x49')][_0xc834('0x50')]=integrations[_0xc834('0x51')](_0x5d69b7[_0xc834('0x49')][_0xc834('0x4f')],_0x5d69b7['body'][_0xc834('0x2d')]);return db['SugarcrmConfiguration'][_0xc834('0x48')](_0x5d69b7['body'],{'include':[{'model':db[_0xc834('0x52')],'as':_0xc834('0x4d')},{'model':db[_0xc834('0x52')],'as':_0xc834('0x50')}]});}return null;})['then'](respondWithResult(_0x251bd4,null))[_0xc834('0x42')](handleError(_0x251bd4,null));};exports[_0xc834('0x53')]=function(_0x501079,_0x457ecb,_0x3ae741){var _0x25ffbc='';var _0xb4a781=['id',_0xc834('0x26'),_0xc834('0x54'),_0xc834('0x55'),_0xc834('0x56'),_0xc834('0x57'),_0xc834('0x58'),'duration_minutes',_0xc834('0x59'),_0xc834('0x5a'),_0xc834('0x5b'),_0xc834('0x5c')];return db['SugarcrmAccount'][_0xc834('0x4b')]({'where':{'id':_0x501079['params']['id']},'attributes':['id','username',_0xc834('0x5d'),'remoteUri']})[_0xc834('0x22')](handleEntityNotFound(_0x457ecb,null))[_0xc834('0x22')](function(_0x23f084){if(_0x23f084){_0x25ffbc=_0x23f084[_0xc834('0x5e')];var _0x4116cf=_0x25ffbc[_0xc834('0x5f')](-0x1);if(_0x4116cf==='/'){_0x25ffbc=_0x25ffbc[_0xc834('0x60')](0x0,_0x25ffbc[_0xc834('0x61')](_0x4116cf));}return rp({'method':'POST','uri':util[_0xc834('0x62')](_0xc834('0x63'),_0x25ffbc,_0xc834('0x64')),'json':!![],'form':{'method':_0xc834('0x65'),'input_type':_0xc834('0x66'),'response_type':_0xc834('0x66'),'rest_data':JSON[_0xc834('0x67')]({'user_auth':{'user_name':_0x23f084['username'],'password':_0x23f084[_0xc834('0x5d')],'encryption':_0xc834('0x68')},'application':_0xc834('0x69')})}});}})[_0xc834('0x22')](function(_0x17e7bc){if(_0x17e7bc&&_0x17e7bc[_0xc834('0x26')]!=='Invalid\x20Login'&&_0x17e7bc[_0xc834('0x26')]!==_0xc834('0x6a')){return rp({'method':'POST','uri':util[_0xc834('0x62')](_0xc834('0x63'),_0x25ffbc,_0xc834('0x64')),'json':!![],'form':{'method':_0xc834('0x6b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xc834('0x67')]({'session':_0x17e7bc['id'],'module_name':_0xc834('0x6c')})}})['then'](function(_0xd7cbd6){if(_0xd7cbd6){var _0xe6db27=_[_0xc834('0x6d')](_0xd7cbd6[_0xc834('0x6e')]);_[_0xc834('0x6f')](_0xe6db27,function(_0x97c9b0){return _0xb4a781['includes'](_0x97c9b0['name']);});return{'count':_0xe6db27[_0xc834('0x36')],'rows':_[_0xc834('0x29')](_0xe6db27,function(_0x24e1a0){return{'id':_0x24e1a0['name'],'name':_0x24e1a0['label'],'custom':_[_0xc834('0x70')](_0x24e1a0[_0xc834('0x26')],'_c')?!![]:![],'options':_0x24e1a0[_0xc834('0x46')]?_[_0xc834('0x29')](_['values'](_0x24e1a0[_0xc834('0x46')]),function(_0xdd4158){return{'name':_0xdd4158[_0xc834('0x71')],'value':_0xdd4158['name']};}):[]};})};}})[_0xc834('0x22')](respondWithResult(_0x457ecb,null))[_0xc834('0x42')](function(_0xdb9a20){var _0x36c8f4=_0x501079[_0xc834('0x30')][_0xc834('0x72')]?0x1f4:_0xdb9a20[_0xc834('0x73')]||0x1f4;logger[_0xc834('0x24')](_0xc834('0x74'),_0xc834('0x53'),_0x36c8f4,JSON[_0xc834('0x67')](_0xdb9a20));delete _0xdb9a20[_0xc834('0x26')];if(_0x36c8f4===0x191){_0x36c8f4=0x190;}_0x457ecb[_0xc834('0x17')](_0x36c8f4)['send'](_0x501079[_0xc834('0x30')][_0xc834('0x72')]?{'message':_0xc834('0x75'),'statusCode':_0xdb9a20[_0xc834('0x73')]}:_0xdb9a20);});}else{var _0x1bbfc1=0x1f4;_0x457ecb[_0xc834('0x17')](_0x1bbfc1)[_0xc834('0x27')]({'message':_0xc834('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x916a=['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','../../components/integrations/configuration','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','status','error','stack','name','send','index','SugarcrmAccount','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','then','includeAll','findAll','rows','params','rawAttributes','options','find','catch','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','created_by','description','date_start','parent_id','parent_name','username','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','get_module_fields','Calls','values','module_fields','remove','includes','endsWith','value','test','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto'];(function(_0x25fb3e,_0x39c428){var _0x42112c=function(_0x4f2682){while(--_0x4f2682){_0x25fb3e['push'](_0x25fb3e['shift']());}};_0x42112c(++_0x39c428);}(_0x916a,0x158));var _0xa916=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x916a[_0x5311e8];return _0x582ad8;};'use strict';var emlformat=require(_0xa916('0x0'));var rimraf=require(_0xa916('0x1'));var zipdir=require(_0xa916('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa916('0x3'));var moment=require(_0xa916('0x4'));var BPromise=require(_0xa916('0x5'));var Mustache=require('mustache');var util=require(_0xa916('0x6'));var path=require(_0xa916('0x7'));var sox=require(_0xa916('0x8'));var csv=require(_0xa916('0x9'));var ejs=require(_0xa916('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa916('0xb'));var squel=require('squel');var crypto=require(_0xa916('0xc'));var jsforce=require(_0xa916('0xd'));var deskjs=require(_0xa916('0xe'));var toCsv=require(_0xa916('0x9'));var querystring=require(_0xa916('0xf'));var Papa=require(_0xa916('0x10'));var Redis=require(_0xa916('0x11'));var authService=require(_0xa916('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa916('0x13'));var hardwareService=require(_0xa916('0x14'));var logger=require(_0xa916('0x15'))(_0xa916('0x16'));var utils=require(_0xa916('0x17'));var config=require(_0xa916('0x18'));var licenseUtil=require(_0xa916('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa916('0x1a'));function respondWithStatusCode(_0x4bb860,_0xd2eec5){_0xd2eec5=_0xd2eec5||0xcc;return function(_0x1aeee9){if(_0x1aeee9){return _0x4bb860[_0xa916('0x1b')](_0xd2eec5);}return _0x4bb860['status'](_0xd2eec5)[_0xa916('0x1c')]();};}function respondWithResult(_0xa9e1ca,_0x4cee1e){_0x4cee1e=_0x4cee1e||0xc8;return function(_0x4d0aea){if(_0x4d0aea){return _0xa9e1ca['status'](_0x4cee1e)[_0xa916('0x1d')](_0x4d0aea);}};}function respondWithFilteredResult(_0x190f79,_0x4a9e11){return function(_0x5e7cbd){if(_0x5e7cbd){var _0xb52fed=typeof _0x4a9e11['offset']===_0xa916('0x1e')&&typeof _0x4a9e11[_0xa916('0x1f')]==='undefined';var _0x584298=_0x5e7cbd['count'];var _0x2ddfdd=_0xb52fed?0x0:_0x4a9e11['offset'];var _0x1b5206=_0xb52fed?_0x5e7cbd[_0xa916('0x20')]:_0x4a9e11[_0xa916('0x21')]+_0x4a9e11[_0xa916('0x1f')];var _0x225af4;if(_0x1b5206>=_0x584298){_0x1b5206=_0x584298;_0x225af4=0xc8;}else{_0x225af4=0xce;}_0x190f79['status'](_0x225af4);return _0x190f79[_0xa916('0x22')](_0xa916('0x23'),_0x2ddfdd+'-'+_0x1b5206+'/'+_0x584298)[_0xa916('0x1d')](_0x5e7cbd);}return null;};}function patchUpdates(_0x2cce6c){return function(_0x4adf01){try{jsonpatch[_0xa916('0x24')](_0x4adf01,_0x2cce6c,!![]);}catch(_0x5b1990){return BPromise[_0xa916('0x25')](_0x5b1990);}return _0x4adf01[_0xa916('0x26')]();};}function saveUpdates(_0x34a085,_0xa1d5c2){return function(_0x2574ca){if(_0x2574ca){return _0x2574ca['update'](_0x34a085)['then'](function(_0x17ff51){return _0x17ff51;});}return null;};}function removeEntity(_0x50cdf7,_0x552391){return function(_0x1a775a){if(_0x1a775a){return _0x1a775a['destroy']()['then'](function(){_0x50cdf7[_0xa916('0x27')](0xcc)[_0xa916('0x1c')]();});}};}function handleEntityNotFound(_0x50dfeb,_0x23b458){return function(_0x6ac1ee){if(!_0x6ac1ee){_0x50dfeb[_0xa916('0x1b')](0x194);}return _0x6ac1ee;};}function handleError(_0x47aaa0,_0x5ee37b){_0x5ee37b=_0x5ee37b||0x1f4;return function(_0x782a02){logger[_0xa916('0x28')](_0x782a02[_0xa916('0x29')]);if(_0x782a02[_0xa916('0x2a')]){delete _0x782a02[_0xa916('0x2a')];}_0x47aaa0[_0xa916('0x27')](_0x5ee37b)[_0xa916('0x2b')](_0x782a02);};}exports[_0xa916('0x2c')]=function(_0x1209d7,_0xf7c446){var _0x2d899c={},_0x56c3f8={},_0x3c90f5={'count':0x0,'rows':[]};var _0x2bfa65=_['map'](db[_0xa916('0x2d')]['rawAttributes'],function(_0x37daec){return{'name':_0x37daec[_0xa916('0x2e')],'type':_0x37daec['type']['key']};});_0x56c3f8[_0xa916('0x2f')]=_[_0xa916('0x30')](_0x2bfa65,_0xa916('0x2a'));_0x56c3f8[_0xa916('0x31')]=_[_0xa916('0x32')](_0x1209d7[_0xa916('0x31')]);_0x56c3f8[_0xa916('0x33')]=_[_0xa916('0x34')](_0x56c3f8['model'],_0x56c3f8[_0xa916('0x31')]);_0x2d899c[_0xa916('0x35')]=_['intersection'](_0x56c3f8['model'],qs['fields'](_0x1209d7[_0xa916('0x31')][_0xa916('0x36')]));_0x2d899c[_0xa916('0x35')]=_0x2d899c['attributes'][_0xa916('0x37')]?_0x2d899c[_0xa916('0x35')]:_0x56c3f8['model'];if(!_0x1209d7['query'][_0xa916('0x38')](_0xa916('0x39'))){_0x2d899c[_0xa916('0x1f')]=qs['limit'](_0x1209d7[_0xa916('0x31')][_0xa916('0x1f')]);_0x2d899c[_0xa916('0x21')]=qs[_0xa916('0x21')](_0x1209d7[_0xa916('0x31')][_0xa916('0x21')]);}_0x2d899c[_0xa916('0x3a')]=qs['sort'](_0x1209d7[_0xa916('0x31')][_0xa916('0x3b')]);_0x2d899c[_0xa916('0x3c')]=qs[_0xa916('0x33')](_[_0xa916('0x3d')](_0x1209d7[_0xa916('0x31')],_0x56c3f8['filters']),_0x2bfa65);if(_0x1209d7[_0xa916('0x31')][_0xa916('0x3e')]){_0x2d899c[_0xa916('0x3c')]=_[_0xa916('0x3f')](_0x2d899c[_0xa916('0x3c')],{'$or':_['map'](_0x2bfa65,function(_0x876b91){if(_0x876b91[_0xa916('0x40')]!==_0xa916('0x41')){var _0xd76580={};_0xd76580[_0x876b91[_0xa916('0x2a')]]={'$like':'%'+_0x1209d7[_0xa916('0x31')][_0xa916('0x3e')]+'%'};return _0xd76580;}})});}_0x2d899c=_['merge']({},_0x2d899c,_0x1209d7['options']);var _0x120209={'where':_0x2d899c['where']};return db[_0xa916('0x2d')]['count'](_0x120209)[_0xa916('0x42')](function(_0xd3a18){_0x3c90f5['count']=_0xd3a18;if(_0x1209d7[_0xa916('0x31')][_0xa916('0x43')]){_0x2d899c['include']=[{'all':!![]}];}return db[_0xa916('0x2d')][_0xa916('0x44')](_0x2d899c);})[_0xa916('0x42')](function(_0x7ab0bb){_0x3c90f5[_0xa916('0x45')]=_0x7ab0bb;return _0x3c90f5;})[_0xa916('0x42')](respondWithFilteredResult(_0xf7c446,_0x2d899c))['catch'](handleError(_0xf7c446,null));};exports['show']=function(_0x3b5e75,_0x3737ab){var _0x312378={'raw':![],'where':{'id':_0x3b5e75[_0xa916('0x46')]['id']}},_0x110a5b={};_0x110a5b[_0xa916('0x2f')]=_[_0xa916('0x32')](db['SugarcrmAccount'][_0xa916('0x47')]);_0x110a5b[_0xa916('0x31')]=_[_0xa916('0x32')](_0x3b5e75[_0xa916('0x31')]);_0x110a5b['filters']=_['intersection'](_0x110a5b[_0xa916('0x2f')],_0x110a5b[_0xa916('0x31')]);_0x312378[_0xa916('0x35')]=_[_0xa916('0x34')](_0x110a5b[_0xa916('0x2f')],qs[_0xa916('0x36')](_0x3b5e75[_0xa916('0x31')][_0xa916('0x36')]));_0x312378[_0xa916('0x35')]=_0x312378[_0xa916('0x35')]['length']?_0x312378['attributes']:_0x110a5b['model'];if(_0x3b5e75[_0xa916('0x31')][_0xa916('0x43')]){_0x312378['include']=[{'all':!![]}];}_0x312378=_['merge']({},_0x312378,_0x3b5e75[_0xa916('0x48')]);return db[_0xa916('0x2d')][_0xa916('0x49')](_0x312378)['then'](handleEntityNotFound(_0x3737ab,null))[_0xa916('0x42')](respondWithResult(_0x3737ab,null))[_0xa916('0x4a')](handleError(_0x3737ab,null));};exports[_0xa916('0x4b')]=function(_0x56ce26,_0x303458){return db[_0xa916('0x2d')][_0xa916('0x4b')](_0x56ce26[_0xa916('0x4c')],{})[_0xa916('0x42')](respondWithResult(_0x303458,0xc9))[_0xa916('0x4a')](handleError(_0x303458,null));};exports['update']=function(_0x359d60,_0x523067){if(_0x359d60[_0xa916('0x4c')]['id']){delete _0x359d60['body']['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x359d60[_0xa916('0x46')]['id']}})[_0xa916('0x42')](handleEntityNotFound(_0x523067,null))[_0xa916('0x42')](saveUpdates(_0x359d60[_0xa916('0x4c')],null))[_0xa916('0x42')](respondWithResult(_0x523067,null))['catch'](handleError(_0x523067,null));};exports[_0xa916('0x4d')]=function(_0x3e2458,_0x20cabe){return db[_0xa916('0x2d')][_0xa916('0x49')]({'where':{'id':_0x3e2458[_0xa916('0x46')]['id']}})[_0xa916('0x42')](handleEntityNotFound(_0x20cabe,null))['then'](removeEntity(_0x20cabe,null))['catch'](handleError(_0x20cabe,null));};exports[_0xa916('0x4e')]=function(_0xc4a076,_0xea209c,_0x2f53bc){var _0xf6567d={};var _0x3585d2={};var _0x3844bf;var _0x6373b7;return db[_0xa916('0x2d')][_0xa916('0x4f')]({'where':{'id':_0xc4a076[_0xa916('0x46')]['id']}})[_0xa916('0x42')](handleEntityNotFound(_0xea209c,null))[_0xa916('0x42')](function(_0x5939ed){if(_0x5939ed){_0x3844bf=_0x5939ed;_0x3585d2['model']=_[_0xa916('0x32')](db[_0xa916('0x50')][_0xa916('0x47')]);_0x3585d2[_0xa916('0x31')]=_[_0xa916('0x32')](_0xc4a076['query']);_0x3585d2[_0xa916('0x33')]=_[_0xa916('0x34')](_0x3585d2[_0xa916('0x2f')],_0x3585d2['query']);_0xf6567d[_0xa916('0x35')]=_[_0xa916('0x34')](_0x3585d2[_0xa916('0x2f')],qs[_0xa916('0x36')](_0xc4a076[_0xa916('0x31')]['fields']));_0xf6567d['attributes']=_0xf6567d['attributes'][_0xa916('0x37')]?_0xf6567d['attributes']:_0x3585d2['model'];_0xf6567d[_0xa916('0x3a')]=qs['sort'](_0xc4a076[_0xa916('0x31')][_0xa916('0x3b')]);_0xf6567d[_0xa916('0x3c')]=qs[_0xa916('0x33')](_[_0xa916('0x3d')](_0xc4a076['query'],_0x3585d2[_0xa916('0x33')]));if(_0xc4a076[_0xa916('0x31')][_0xa916('0x3e')]){_0xf6567d[_0xa916('0x3c')]=_['merge'](_0xf6567d[_0xa916('0x3c')],{'$or':_[_0xa916('0x30')](_0xf6567d[_0xa916('0x35')],function(_0x2d6e18){var _0x44f535={};_0x44f535[_0x2d6e18]={'$like':'%'+_0xc4a076[_0xa916('0x31')][_0xa916('0x3e')]+'%'};return _0x44f535;})});}_0xf6567d=_['merge']({},_0xf6567d,_0xc4a076[_0xa916('0x48')]);return _0x3844bf[_0xa916('0x4e')](_0xf6567d);}})[_0xa916('0x42')](function(_0x1a1381){if(_0x1a1381){_0x6373b7=_0x1a1381[_0xa916('0x37')];if(!_0xc4a076[_0xa916('0x31')][_0xa916('0x38')](_0xa916('0x39'))){_0xf6567d[_0xa916('0x1f')]=qs['limit'](_0xc4a076['query'][_0xa916('0x1f')]);_0xf6567d['offset']=qs[_0xa916('0x21')](_0xc4a076[_0xa916('0x31')]['offset']);}return _0x3844bf[_0xa916('0x4e')](_0xf6567d);}})['then'](function(_0x15b442){if(_0x15b442){return _0x15b442?{'count':_0x6373b7,'rows':_0x15b442}:null;}})[_0xa916('0x42')](respondWithResult(_0xea209c,null))['catch'](handleError(_0xea209c,null));};exports[_0xa916('0x51')]=function(_0x8b4091,_0x3e929e,_0x52bc58){if(_0x8b4091['body']['id']){delete _0x8b4091[_0xa916('0x4c')]['id'];}return db[_0xa916('0x2d')][_0xa916('0x4f')]({'where':{'id':_0x8b4091[_0xa916('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e929e,null))[_0xa916('0x42')](function(_0x124e74){if(_0x124e74){_0x8b4091['body'][_0xa916('0x52')]=_0x124e74['id'];_0x8b4091[_0xa916('0x4c')][_0xa916('0x53')]=integrations[_0xa916('0x54')](_0x8b4091['body'][_0xa916('0x55')],_0x8b4091[_0xa916('0x4c')][_0xa916('0x40')]);_0x8b4091[_0xa916('0x4c')][_0xa916('0x56')]=integrations['getDescriptions'](_0x8b4091[_0xa916('0x4c')][_0xa916('0x55')],_0x8b4091[_0xa916('0x4c')][_0xa916('0x40')]);return db['SugarcrmConfiguration']['create'](_0x8b4091[_0xa916('0x4c')],{'include':[{'model':db[_0xa916('0x57')],'as':_0xa916('0x53')},{'model':db[_0xa916('0x57')],'as':_0xa916('0x56')}]});}return null;})[_0xa916('0x42')](respondWithResult(_0x3e929e,null))[_0xa916('0x4a')](handleError(_0x3e929e,null));};exports[_0xa916('0x58')]=function(_0x38fc81,_0x1f70fb,_0x50129d){var _0x47bc00='';var _0x48cb6b=['id',_0xa916('0x2a'),'assigned_user_id',_0xa916('0x59'),_0xa916('0x5a'),_0xa916('0x5b'),'duration_hours','duration_minutes',_0xa916('0x5c'),'parent_type',_0xa916('0x5d'),'direction'];return db[_0xa916('0x2d')]['findOne']({'where':{'id':_0x38fc81[_0xa916('0x46')]['id']},'attributes':['id',_0xa916('0x5e'),'password',_0xa916('0x5f')]})[_0xa916('0x42')](handleEntityNotFound(_0x1f70fb,null))[_0xa916('0x42')](function(_0x453a6d){if(_0x453a6d){_0x47bc00=_0x453a6d[_0xa916('0x5f')];var _0x502a7b=_0x47bc00[_0xa916('0x60')](-0x1);if(_0x502a7b==='/'){_0x47bc00=_0x47bc00[_0xa916('0x61')](0x0,_0x47bc00[_0xa916('0x62')](_0x502a7b));}return rp({'method':_0xa916('0x63'),'uri':util['format'](_0xa916('0x64'),_0x47bc00,_0xa916('0x65')),'json':!![],'form':{'method':_0xa916('0x66'),'input_type':_0xa916('0x67'),'response_type':'JSON','rest_data':JSON[_0xa916('0x68')]({'user_auth':{'user_name':_0x453a6d[_0xa916('0x5e')],'password':_0x453a6d[_0xa916('0x69')],'encryption':'PLAIN'},'application':_0xa916('0x6a')})}});}})['then'](function(_0x244ac5){if(_0x244ac5&&_0x244ac5[_0xa916('0x2a')]!=='Invalid\x20Login'&&_0x244ac5['name']!==_0xa916('0x6b')){return rp({'method':_0xa916('0x63'),'uri':util[_0xa916('0x6c')](_0xa916('0x64'),_0x47bc00,_0xa916('0x65')),'json':!![],'form':{'method':_0xa916('0x6d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x244ac5['id'],'module_name':_0xa916('0x6e')})}})[_0xa916('0x42')](function(_0x2b9b1d){if(_0x2b9b1d){var _0x2a985a=_[_0xa916('0x6f')](_0x2b9b1d[_0xa916('0x70')]);_[_0xa916('0x71')](_0x2a985a,function(_0x41d339){return _0x48cb6b[_0xa916('0x72')](_0x41d339[_0xa916('0x2a')]);});return{'count':_0x2a985a[_0xa916('0x37')],'rows':_[_0xa916('0x30')](_0x2a985a,function(_0x50482c){return{'id':_0x50482c[_0xa916('0x2a')],'name':_0x50482c['label'],'custom':_[_0xa916('0x73')](_0x50482c[_0xa916('0x2a')],'_c')?!![]:![],'options':_0x50482c[_0xa916('0x48')]?_['map'](_['values'](_0x50482c[_0xa916('0x48')]),function(_0x1926b4){return{'name':_0x1926b4[_0xa916('0x74')],'value':_0x1926b4[_0xa916('0x2a')]};}):[]};})};}})[_0xa916('0x42')](respondWithResult(_0x1f70fb,null))[_0xa916('0x4a')](function(_0x336ed8){var _0x198768=_0x38fc81[_0xa916('0x31')][_0xa916('0x75')]?0x1f4:_0x336ed8[_0xa916('0x76')]||0x1f4;logger[_0xa916('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x198768,JSON[_0xa916('0x68')](_0x336ed8));delete _0x336ed8['name'];if(_0x198768===0x191){_0x198768=0x190;}_0x1f70fb[_0xa916('0x27')](_0x198768)[_0xa916('0x2b')](_0x38fc81[_0xa916('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x336ed8['statusCode']}:_0x336ed8);});}else{var _0x436558=0x1f4;_0x1f70fb['status'](_0x436558)[_0xa916('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index c95752d..80b3fdb 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 _0x4333=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','moment','path'];(function(_0x1b1248,_0x37e80a){var _0xe75307=function(_0x21ad19){while(--_0x21ad19){_0x1b1248['push'](_0x1b1248['shift']());}};_0xe75307(++_0x37e80a);}(_0x4333,0x1eb));var _0x3433=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x4333[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require('lodash');var util=require(_0x3433('0x0'));var logger=require(_0x3433('0x1'))('api');var moment=require(_0x3433('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3433('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x3433('0x4'));module[_0x3433('0x5')]=function(_0x583276,_0x193de8){return _0x583276[_0x3433('0x6')](_0x3433('0x7'),attributes,{'tableName':_0x3433('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2613=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api'];(function(_0x1066aa,_0x2ce4a0){var _0x152609=function(_0x4e4b79){while(--_0x4e4b79){_0x1066aa['push'](_0x1066aa['shift']());}};_0x152609(++_0x2ce4a0);}(_0x2613,0xc0));var _0x3261=function(_0x293d0e,_0x2f6dd8){_0x293d0e=_0x293d0e-0x0;var _0x136965=_0x2613[_0x293d0e];return _0x136965;};'use strict';var _=require('lodash');var util=require(_0x3261('0x0'));var logger=require(_0x3261('0x1'))(_0x3261('0x2'));var moment=require(_0x3261('0x3'));var BPromise=require(_0x3261('0x4'));var rp=require(_0x3261('0x5'));var fs=require('fs');var path=require(_0x3261('0x6'));var rimraf=require(_0x3261('0x7'));var config=require(_0x3261('0x8'));var attributes=require(_0x3261('0x9'));var integrations=require(_0x3261('0xa'));module[_0x3261('0xb')]=function(_0x529cd1,_0x1782b2){return _0x529cd1[_0x3261('0xc')](_0x3261('0xd'),attributes,{'tableName':_0x3261('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index b288778..3219308 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 _0x1983=['jayson/promise','client','request','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','limit','include','map','model','attributes','info','ShowSugarcrmAccount','find','where','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x1983,0x1f0));var _0x3198=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x1983[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0x3198('0x0'));var util=require('util');var moment=require(_0x3198('0x1'));var BPromise=require('bluebird');var rs=require(_0x3198('0x2'));var fs=require('fs');var Redis=require(_0x3198('0x3'));var db=require(_0x3198('0x4'))['db'];var utils=require(_0x3198('0x5'));var logger=require(_0x3198('0x6'))(_0x3198('0x7'));var config=require('../../config/environment');var jayson=require(_0x3198('0x8'));var client=jayson[_0x3198('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25745f,_0x198c76,_0x5d9980){return new BPromise(function(_0x20510d,_0x452215){return client[_0x3198('0xa')](_0x25745f,_0x5d9980)[_0x3198('0xb')](function(_0x8ca483){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x198c76,_0x3198('0xc'));logger[_0x3198('0xd')](_0x3198('0xe'),_0x198c76,_0x3198('0xc'),JSON[_0x3198('0xf')](_0x8ca483));if(_0x8ca483['error']){if(_0x8ca483['error'][_0x3198('0x10')]===0x1f4){logger[_0x3198('0x11')](_0x3198('0x12'),_0x198c76,_0x8ca483[_0x3198('0x11')]['message']);return _0x452215(_0x8ca483[_0x3198('0x11')][_0x3198('0x13')]);}logger['error'](_0x3198('0x12'),_0x198c76,_0x8ca483[_0x3198('0x11')]['message']);return _0x20510d(_0x8ca483[_0x3198('0x11')]['message']);}else{logger['info'](_0x3198('0x12'),_0x198c76,_0x3198('0xc'));_0x20510d(_0x8ca483[_0x3198('0x14')][_0x3198('0x13')]);}})['catch'](function(_0x3861c2){logger[_0x3198('0x11')](_0x3198('0x12'),_0x198c76,_0x3861c2);_0x452215(_0x3861c2);});});}exports[_0x3198('0x15')]=function(_0x2c715f){var _0x3f74f7=this;return new Promise(function(_0x35bde3,_0x2b373d){return db[_0x3198('0x16')][_0x3198('0x17')]({'raw':_0x2c715f['options']?_0x2c715f[_0x3198('0x18')][_0x3198('0x19')]===undefined?!![]:![]:!![],'where':_0x2c715f[_0x3198('0x18')]?_0x2c715f[_0x3198('0x18')]['where']||null:null,'attributes':_0x2c715f[_0x3198('0x18')]?_0x2c715f[_0x3198('0x18')]['attributes']||null:null,'limit':_0x2c715f[_0x3198('0x18')]?_0x2c715f[_0x3198('0x18')][_0x3198('0x1a')]||null:null,'include':_0x2c715f['options']?_0x2c715f['options'][_0x3198('0x1b')]?_[_0x3198('0x1c')](_0x2c715f[_0x3198('0x18')]['include'],function(_0x102b77){return{'model':db[_0x102b77[_0x3198('0x1d')]],'as':_0x102b77['as'],'attributes':_0x102b77['attributes'],'include':_0x102b77[_0x3198('0x1b')]?_[_0x3198('0x1c')](_0x102b77[_0x3198('0x1b')],function(_0x5e6b1c){return{'model':db[_0x5e6b1c[_0x3198('0x1d')]],'as':_0x5e6b1c['as'],'attributes':_0x5e6b1c[_0x3198('0x1e')],'include':_0x5e6b1c[_0x3198('0x1b')]?_[_0x3198('0x1c')](_0x5e6b1c['include'],function(_0x447a87){return{'model':db[_0x447a87['model']],'as':_0x447a87['as'],'attributes':_0x447a87[_0x3198('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3198('0xb')](function(_0x5dfd37){logger[_0x3198('0x1f')](_0x3198('0x15'),_0x2c715f);logger[_0x3198('0xd')]('GetSugarcrmAccount',_0x2c715f,JSON[_0x3198('0xf')](_0x5dfd37));_0x35bde3(_0x5dfd37);})['catch'](function(_0x366eda){logger[_0x3198('0x11')](_0x3198('0x15'),_0x366eda[_0x3198('0x13')],_0x2c715f);_0x2b373d(_0x3f74f7[_0x3198('0x11')](0x1f4,_0x366eda[_0x3198('0x13')]));});});};exports[_0x3198('0x20')]=function(_0xa16495){var _0xfa5c4c=this;return new Promise(function(_0x10f44c,_0x159749){return db['SugarcrmAccount'][_0x3198('0x21')]({'raw':_0xa16495[_0x3198('0x18')]?_0xa16495[_0x3198('0x18')][_0x3198('0x19')]===undefined?!![]:![]:!![],'where':_0xa16495[_0x3198('0x18')]?_0xa16495[_0x3198('0x18')][_0x3198('0x22')]||null:null,'attributes':_0xa16495[_0x3198('0x18')]?_0xa16495[_0x3198('0x18')][_0x3198('0x1e')]||null:null,'include':_0xa16495[_0x3198('0x18')]?_0xa16495[_0x3198('0x18')][_0x3198('0x1b')]?_['map'](_0xa16495['options'][_0x3198('0x1b')],function(_0x4ace17){return{'model':db[_0x4ace17[_0x3198('0x1d')]],'as':_0x4ace17['as'],'attributes':_0x4ace17['attributes'],'include':_0x4ace17[_0x3198('0x1b')]?_[_0x3198('0x1c')](_0x4ace17[_0x3198('0x1b')],function(_0x3d8570){return{'model':db[_0x3d8570[_0x3198('0x1d')]],'as':_0x3d8570['as'],'attributes':_0x3d8570[_0x3198('0x1e')],'include':_0x3d8570[_0x3198('0x1b')]?_['map'](_0x3d8570[_0x3198('0x1b')],function(_0x2717b1){return{'model':db[_0x2717b1[_0x3198('0x1d')]],'as':_0x2717b1['as'],'attributes':_0x2717b1[_0x3198('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3198('0xb')](function(_0x4c39c1){logger['info'](_0x3198('0x20'),_0xa16495);logger['debug'](_0x3198('0x20'),_0xa16495,JSON[_0x3198('0xf')](_0x4c39c1));_0x10f44c(_0x4c39c1);})[_0x3198('0x23')](function(_0x4ca863){logger[_0x3198('0x11')]('ShowSugarcrmAccount',_0x4ca863[_0x3198('0x13')],_0xa16495);_0x159749(_0xfa5c4c[_0x3198('0x11')](0x1f4,_0x4ca863[_0x3198('0x13')]));});});}; \ No newline at end of file +var _0xbc56=['error','code','message','info','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','GetSugarcrmAccount','where','ShowSugarcrmAccount','lodash','util','moment','bluebird','../../config/utils','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xbc56,0x72));var _0x6bc5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbc56[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6bc5('0x0'));var util=require(_0x6bc5('0x1'));var moment=require(_0x6bc5('0x2'));var BPromise=require(_0x6bc5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6bc5('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6bc5('0x5'));var client=jayson[_0x6bc5('0x6')][_0x6bc5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x361973,_0x433b6c,_0x489837){return new BPromise(function(_0x53d68b,_0x2f72ec){return client[_0x6bc5('0x8')](_0x361973,_0x489837)[_0x6bc5('0x9')](function(_0x5b9b79){logger['info'](_0x6bc5('0xa'),_0x433b6c,_0x6bc5('0xb'));logger[_0x6bc5('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x433b6c,_0x6bc5('0xb'),JSON[_0x6bc5('0xd')](_0x5b9b79));if(_0x5b9b79[_0x6bc5('0xe')]){if(_0x5b9b79[_0x6bc5('0xe')][_0x6bc5('0xf')]===0x1f4){logger[_0x6bc5('0xe')](_0x6bc5('0xa'),_0x433b6c,_0x5b9b79['error']['message']);return _0x2f72ec(_0x5b9b79[_0x6bc5('0xe')]['message']);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x433b6c,_0x5b9b79['error'][_0x6bc5('0x10')]);return _0x53d68b(_0x5b9b79[_0x6bc5('0xe')][_0x6bc5('0x10')]);}else{logger[_0x6bc5('0x11')](_0x6bc5('0xa'),_0x433b6c,_0x6bc5('0xb'));_0x53d68b(_0x5b9b79[_0x6bc5('0x12')][_0x6bc5('0x10')]);}})[_0x6bc5('0x13')](function(_0x45e75b){logger[_0x6bc5('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x433b6c,_0x45e75b);_0x2f72ec(_0x45e75b);});});}exports['GetSugarcrmAccount']=function(_0x73c258){var _0xaf1440=this;return new Promise(function(_0x6f9ea,_0x2ed4d2){return db[_0x6bc5('0x14')][_0x6bc5('0x15')]({'raw':_0x73c258[_0x6bc5('0x16')]?_0x73c258[_0x6bc5('0x16')][_0x6bc5('0x17')]===undefined?!![]:![]:!![],'where':_0x73c258['options']?_0x73c258[_0x6bc5('0x16')]['where']||null:null,'attributes':_0x73c258['options']?_0x73c258[_0x6bc5('0x16')][_0x6bc5('0x18')]||null:null,'limit':_0x73c258[_0x6bc5('0x16')]?_0x73c258[_0x6bc5('0x16')][_0x6bc5('0x19')]||null:null,'include':_0x73c258[_0x6bc5('0x16')]?_0x73c258['options'][_0x6bc5('0x1a')]?_[_0x6bc5('0x1b')](_0x73c258[_0x6bc5('0x16')]['include'],function(_0x229acc){return{'model':db[_0x229acc[_0x6bc5('0x1c')]],'as':_0x229acc['as'],'attributes':_0x229acc[_0x6bc5('0x18')],'include':_0x229acc[_0x6bc5('0x1a')]?_[_0x6bc5('0x1b')](_0x229acc['include'],function(_0x562917){return{'model':db[_0x562917[_0x6bc5('0x1c')]],'as':_0x562917['as'],'attributes':_0x562917['attributes'],'include':_0x562917[_0x6bc5('0x1a')]?_['map'](_0x562917[_0x6bc5('0x1a')],function(_0xfd5110){return{'model':db[_0xfd5110['model']],'as':_0xfd5110['as'],'attributes':_0xfd5110[_0x6bc5('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cdd70){logger[_0x6bc5('0x11')]('GetSugarcrmAccount',_0x73c258);logger[_0x6bc5('0xc')](_0x6bc5('0x1d'),_0x73c258,JSON[_0x6bc5('0xd')](_0x5cdd70));_0x6f9ea(_0x5cdd70);})[_0x6bc5('0x13')](function(_0xe02feb){logger[_0x6bc5('0xe')](_0x6bc5('0x1d'),_0xe02feb['message'],_0x73c258);_0x2ed4d2(_0xaf1440[_0x6bc5('0xe')](0x1f4,_0xe02feb[_0x6bc5('0x10')]));});});};exports['ShowSugarcrmAccount']=function(_0x22d4e0){var _0xb77af1=this;return new Promise(function(_0x14a360,_0x1264c4){return db[_0x6bc5('0x14')]['find']({'raw':_0x22d4e0['options']?_0x22d4e0[_0x6bc5('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x22d4e0[_0x6bc5('0x16')]?_0x22d4e0[_0x6bc5('0x16')][_0x6bc5('0x1e')]||null:null,'attributes':_0x22d4e0['options']?_0x22d4e0[_0x6bc5('0x16')][_0x6bc5('0x18')]||null:null,'include':_0x22d4e0[_0x6bc5('0x16')]?_0x22d4e0[_0x6bc5('0x16')][_0x6bc5('0x1a')]?_[_0x6bc5('0x1b')](_0x22d4e0['options'][_0x6bc5('0x1a')],function(_0x1c7b13){return{'model':db[_0x1c7b13[_0x6bc5('0x1c')]],'as':_0x1c7b13['as'],'attributes':_0x1c7b13[_0x6bc5('0x18')],'include':_0x1c7b13[_0x6bc5('0x1a')]?_[_0x6bc5('0x1b')](_0x1c7b13[_0x6bc5('0x1a')],function(_0x2fb099){return{'model':db[_0x2fb099[_0x6bc5('0x1c')]],'as':_0x2fb099['as'],'attributes':_0x2fb099['attributes'],'include':_0x2fb099['include']?_['map'](_0x2fb099[_0x6bc5('0x1a')],function(_0x2c3388){return{'model':db[_0x2c3388[_0x6bc5('0x1c')]],'as':_0x2c3388['as'],'attributes':_0x2c3388[_0x6bc5('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d1f5a){logger[_0x6bc5('0x11')](_0x6bc5('0x1f'),_0x22d4e0);logger[_0x6bc5('0xc')](_0x6bc5('0x1f'),_0x22d4e0,JSON[_0x6bc5('0xd')](_0x4d1f5a));_0x14a360(_0x4d1f5a);})[_0x6bc5('0x13')](function(_0x53d854){logger[_0x6bc5('0xe')](_0x6bc5('0x1f'),_0x53d854[_0x6bc5('0x10')],_0x22d4e0);_0x1264c4(_0xb77af1[_0x6bc5('0xe')](0x1f4,_0x53d854[_0x6bc5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index badf6cb..bdde3f2 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 _0xf9ee=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getSubjects','getDescriptions','create','put','update','delete','exports','multer'];(function(_0x5d37d1,_0x2a8a4d){var _0x37683b=function(_0x38a04b){while(--_0x38a04b){_0x5d37d1['push'](_0x5d37d1['shift']());}};_0x37683b(++_0x2a8a4d);}(_0xf9ee,0x1a3));var _0xef9e=function(_0x51293e,_0x74107){_0x51293e=_0x51293e-0x0;var _0x25c15b=_0xf9ee[_0x51293e];return _0x25c15b;};'use strict';var multer=require(_0xef9e('0x0'));var util=require(_0xef9e('0x1'));var path=require('path');var timeout=require(_0xef9e('0x2'));var express=require(_0xef9e('0x3'));var router=express[_0xef9e('0x4')]();var fs_extra=require(_0xef9e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xef9e('0x6'));var config=require(_0xef9e('0x7'));var controller=require(_0xef9e('0x8'));router[_0xef9e('0x9')]('/',auth[_0xef9e('0xa')](),controller['index']);router[_0xef9e('0x9')](_0xef9e('0xb'),auth[_0xef9e('0xa')](),controller[_0xef9e('0xc')]);router[_0xef9e('0x9')](_0xef9e('0xd'),auth[_0xef9e('0xa')](),controller['getFields']);router[_0xef9e('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xef9e('0xe')]);router[_0xef9e('0x9')]('/:id/descriptions',auth[_0xef9e('0xa')](),controller[_0xef9e('0xf')]);router['post']('/',auth[_0xef9e('0xa')](),controller[_0xef9e('0x10')]);router[_0xef9e('0x11')](_0xef9e('0xb'),auth[_0xef9e('0xa')](),controller[_0xef9e('0x12')]);router[_0xef9e('0x13')](_0xef9e('0xb'),auth[_0xef9e('0xa')](),controller['destroy']);module[_0xef9e('0x14')]=router; \ No newline at end of file +var _0x02e6=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x264b79,_0xc62859){var _0x548c85=function(_0x3ca7f0){while(--_0x3ca7f0){_0x264b79['push'](_0x264b79['shift']());}};_0x548c85(++_0xc62859);}(_0x02e6,0x1d0));var _0x602e=function(_0x508483,_0xb23bb1){_0x508483=_0x508483-0x0;var _0x5c5c7b=_0x02e6[_0x508483];return _0x5c5c7b;};'use strict';var multer=require(_0x602e('0x0'));var util=require(_0x602e('0x1'));var path=require(_0x602e('0x2'));var timeout=require(_0x602e('0x3'));var express=require(_0x602e('0x4'));var router=express[_0x602e('0x5')]();var fs_extra=require(_0x602e('0x6'));var auth=require(_0x602e('0x7'));var interaction=require(_0x602e('0x8'));var config=require(_0x602e('0x9'));var controller=require(_0x602e('0xa'));router[_0x602e('0xb')]('/',auth[_0x602e('0xc')](),controller[_0x602e('0xd')]);router[_0x602e('0xb')](_0x602e('0xe'),auth[_0x602e('0xc')](),controller[_0x602e('0xf')]);router[_0x602e('0xb')](_0x602e('0x10'),auth[_0x602e('0xc')](),controller[_0x602e('0x11')]);router[_0x602e('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x602e('0x12')]);router[_0x602e('0xb')](_0x602e('0x13'),auth[_0x602e('0xc')](),controller[_0x602e('0x14')]);router[_0x602e('0x15')]('/',auth[_0x602e('0xc')](),controller[_0x602e('0x16')]);router['put'](_0x602e('0xe'),auth[_0x602e('0xc')](),controller[_0x602e('0x17')]);router[_0x602e('0x18')]('/:id',auth[_0x602e('0xc')](),controller[_0x602e('0x19')]);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 403d6b1..48a2e64 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 _0xcd08=['sequelize','exports','STRING'];(function(_0x2b2e22,_0x252302){var _0x3b550b=function(_0x50e1e0){while(--_0x50e1e0){_0x2b2e22['push'](_0x2b2e22['shift']());}};_0x3b550b(++_0x252302);}(_0xcd08,0x1e6));var _0x8cd0=function(_0x2cbbd2,_0x597405){_0x2cbbd2=_0x2cbbd2-0x0;var _0x326ed1=_0xcd08[_0x2cbbd2];return _0x326ed1;};'use strict';var Sequelize=require(_0x8cd0('0x0'));module[_0x8cd0('0x1')]={'name':{'type':Sequelize[_0x8cd0('0x2')]},'description':{'type':Sequelize[_0x8cd0('0x2')]}}; \ No newline at end of file +var _0xb5d4=['STRING','sequelize'];(function(_0x43a84a,_0x6c500e){var _0x2ed43a=function(_0x8f88c3){while(--_0x8f88c3){_0x43a84a['push'](_0x43a84a['shift']());}};_0x2ed43a(++_0x6c500e);}(_0xb5d4,0xdf));var _0x4b5d=function(_0x567443,_0x2792e3){_0x567443=_0x567443-0x0;var _0x417f6c=_0xb5d4[_0x567443];return _0x417f6c;};'use strict';var Sequelize=require(_0x4b5d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b5d('0x1')]},'description':{'type':Sequelize[_0x4b5d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e1920f1..c4fdebc 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 _0xe8e7=['error','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','merge','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','limit','undefined','count','offset','status','set','json','apply','reject','save','update','then','destroy','end'];(function(_0x2273ae,_0x40069e){var _0x5cc540=function(_0x24b3aa){while(--_0x24b3aa){_0x2273ae['push'](_0x2273ae['shift']());}};_0x5cc540(++_0x40069e);}(_0xe8e7,0x1f1));var _0x7e8e=function(_0x11cc36,_0x318e6b){_0x11cc36=_0x11cc36-0x0;var _0x55a61c=_0xe8e7[_0x11cc36];return _0x55a61c;};'use strict';var emlformat=require(_0x7e8e('0x0'));var rimraf=require(_0x7e8e('0x1'));var zipdir=require(_0x7e8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e8e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e8e('0x4'));var util=require(_0x7e8e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7e8e('0x6'));var ejs=require(_0x7e8e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7e8e('0x8'));var crypto=require(_0x7e8e('0x9'));var jsforce=require(_0x7e8e('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7e8e('0xb'));var Papa=require(_0x7e8e('0xc'));var Redis=require(_0x7e8e('0xd'));var authService=require(_0x7e8e('0xe'));var qs=require(_0x7e8e('0xf'));var as=require(_0x7e8e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e8e('0x11'))(_0x7e8e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7e8e('0x13'))['db'];function respondWithStatusCode(_0x238c96,_0x588569){_0x588569=_0x588569||0xcc;return function(_0x42590e){if(_0x42590e){return _0x238c96[_0x7e8e('0x14')](_0x588569);}return _0x238c96['status'](_0x588569)['end']();};}function respondWithResult(_0x3fee77,_0x23fa49){_0x23fa49=_0x23fa49||0xc8;return function(_0x311098){if(_0x311098){return _0x3fee77['status'](_0x23fa49)['json'](_0x311098);}};}function respondWithFilteredResult(_0x55b013,_0x24681c){return function(_0x598f6e){if(_0x598f6e){var _0x39b0b4=typeof _0x24681c['offset']==='undefined'&&typeof _0x24681c[_0x7e8e('0x15')]===_0x7e8e('0x16');var _0x4950ed=_0x598f6e[_0x7e8e('0x17')];var _0x20c3c2=_0x39b0b4?0x0:_0x24681c[_0x7e8e('0x18')];var _0x2c34ac=_0x39b0b4?_0x598f6e[_0x7e8e('0x17')]:_0x24681c[_0x7e8e('0x18')]+_0x24681c[_0x7e8e('0x15')];var _0x455f8e;if(_0x2c34ac>=_0x4950ed){_0x2c34ac=_0x4950ed;_0x455f8e=0xc8;}else{_0x455f8e=0xce;}_0x55b013[_0x7e8e('0x19')](_0x455f8e);return _0x55b013[_0x7e8e('0x1a')]('Content-Range',_0x20c3c2+'-'+_0x2c34ac+'/'+_0x4950ed)[_0x7e8e('0x1b')](_0x598f6e);}return null;};}function patchUpdates(_0x5c487e){return function(_0x728591){try{jsonpatch[_0x7e8e('0x1c')](_0x728591,_0x5c487e,!![]);}catch(_0x288a23){return BPromise[_0x7e8e('0x1d')](_0x288a23);}return _0x728591[_0x7e8e('0x1e')]();};}function saveUpdates(_0x1dfe16,_0x209f87){return function(_0x299240){if(_0x299240){return _0x299240[_0x7e8e('0x1f')](_0x1dfe16)[_0x7e8e('0x20')](function(_0x15215d){return _0x15215d;});}return null;};}function removeEntity(_0x38dcfd,_0x38e21e){return function(_0x9e8e05){if(_0x9e8e05){return _0x9e8e05[_0x7e8e('0x21')]()[_0x7e8e('0x20')](function(){_0x38dcfd[_0x7e8e('0x19')](0xcc)[_0x7e8e('0x22')]();});}};}function handleEntityNotFound(_0x1ab1bd,_0x263f1e){return function(_0x1ca9dc){if(!_0x1ca9dc){_0x1ab1bd[_0x7e8e('0x14')](0x194);}return _0x1ca9dc;};}function handleError(_0x470595,_0x54e9cf){_0x54e9cf=_0x54e9cf||0x1f4;return function(_0x3ad468){logger[_0x7e8e('0x23')](_0x3ad468['stack']);if(_0x3ad468[_0x7e8e('0x24')]){delete _0x3ad468[_0x7e8e('0x24')];}_0x470595[_0x7e8e('0x19')](_0x54e9cf)[_0x7e8e('0x25')](_0x3ad468);};}exports[_0x7e8e('0x26')]=function(_0x203460,_0x10d394){var _0x1231c0={},_0x502708={},_0x4037a3={'count':0x0,'rows':[]};var _0x4940b6=_['map'](db[_0x7e8e('0x27')][_0x7e8e('0x28')],function(_0x14406e){return{'name':_0x14406e[_0x7e8e('0x29')],'type':_0x14406e['type']['key']};});_0x502708['model']=_[_0x7e8e('0x2a')](_0x4940b6,_0x7e8e('0x24'));_0x502708['query']=_['keys'](_0x203460[_0x7e8e('0x2b')]);_0x502708[_0x7e8e('0x2c')]=_[_0x7e8e('0x2d')](_0x502708[_0x7e8e('0x2e')],_0x502708[_0x7e8e('0x2b')]);_0x1231c0[_0x7e8e('0x2f')]=_[_0x7e8e('0x2d')](_0x502708[_0x7e8e('0x2e')],qs[_0x7e8e('0x30')](_0x203460[_0x7e8e('0x2b')][_0x7e8e('0x30')]));_0x1231c0['attributes']=_0x1231c0[_0x7e8e('0x2f')][_0x7e8e('0x31')]?_0x1231c0['attributes']:_0x502708[_0x7e8e('0x2e')];if(!_0x203460['query'][_0x7e8e('0x32')](_0x7e8e('0x33'))){_0x1231c0[_0x7e8e('0x15')]=qs[_0x7e8e('0x15')](_0x203460[_0x7e8e('0x2b')][_0x7e8e('0x15')]);_0x1231c0[_0x7e8e('0x18')]=qs[_0x7e8e('0x18')](_0x203460['query']['offset']);}_0x1231c0[_0x7e8e('0x34')]=qs[_0x7e8e('0x35')](_0x203460['query'][_0x7e8e('0x35')]);_0x1231c0['where']=qs[_0x7e8e('0x2c')](_[_0x7e8e('0x36')](_0x203460['query'],_0x502708[_0x7e8e('0x2c')]),_0x4940b6);if(_0x203460[_0x7e8e('0x2b')][_0x7e8e('0x37')]){_0x1231c0[_0x7e8e('0x38')]=_['merge'](_0x1231c0[_0x7e8e('0x38')],{'$or':_['map'](_0x4940b6,function(_0x1f7f0c){if(_0x1f7f0c[_0x7e8e('0x39')]!==_0x7e8e('0x3a')){var _0x2c1f7f={};_0x2c1f7f[_0x1f7f0c[_0x7e8e('0x24')]]={'$like':'%'+_0x203460[_0x7e8e('0x2b')][_0x7e8e('0x37')]+'%'};return _0x2c1f7f;}})});}_0x1231c0=_['merge']({},_0x1231c0,_0x203460[_0x7e8e('0x3b')]);var _0x258ceb={'where':_0x1231c0[_0x7e8e('0x38')]};return db['SugarcrmConfiguration'][_0x7e8e('0x17')](_0x258ceb)[_0x7e8e('0x20')](function(_0x4b2a6b){_0x4037a3[_0x7e8e('0x17')]=_0x4b2a6b;if(_0x203460['query'][_0x7e8e('0x3c')]){_0x1231c0[_0x7e8e('0x3d')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x1231c0);})[_0x7e8e('0x20')](function(_0x21d0ec){_0x4037a3[_0x7e8e('0x3e')]=_0x21d0ec;return _0x4037a3;})[_0x7e8e('0x20')](respondWithFilteredResult(_0x10d394,_0x1231c0))[_0x7e8e('0x3f')](handleError(_0x10d394,null));};exports[_0x7e8e('0x40')]=function(_0x4be9ab,_0x58117f){var _0x3b1ab6={'raw':![],'where':{'id':_0x4be9ab[_0x7e8e('0x41')]['id']}},_0x283d96={};_0x283d96[_0x7e8e('0x2e')]=_['keys'](db[_0x7e8e('0x27')][_0x7e8e('0x28')]);_0x283d96[_0x7e8e('0x2b')]=_[_0x7e8e('0x42')](_0x4be9ab[_0x7e8e('0x2b')]);_0x283d96[_0x7e8e('0x2c')]=_[_0x7e8e('0x2d')](_0x283d96[_0x7e8e('0x2e')],_0x283d96[_0x7e8e('0x2b')]);_0x3b1ab6[_0x7e8e('0x2f')]=_[_0x7e8e('0x2d')](_0x283d96[_0x7e8e('0x2e')],qs[_0x7e8e('0x30')](_0x4be9ab[_0x7e8e('0x2b')][_0x7e8e('0x30')]));_0x3b1ab6[_0x7e8e('0x2f')]=_0x3b1ab6[_0x7e8e('0x2f')]['length']?_0x3b1ab6[_0x7e8e('0x2f')]:_0x283d96['model'];if(_0x4be9ab[_0x7e8e('0x2b')][_0x7e8e('0x3c')]){_0x3b1ab6[_0x7e8e('0x3d')]=[{'all':!![]}];}_0x3b1ab6=_[_0x7e8e('0x43')]({},_0x3b1ab6,_0x4be9ab[_0x7e8e('0x3b')]);return db[_0x7e8e('0x27')][_0x7e8e('0x44')](_0x3b1ab6)['then'](handleEntityNotFound(_0x58117f,null))[_0x7e8e('0x20')](respondWithResult(_0x58117f,null))[_0x7e8e('0x3f')](handleError(_0x58117f,null));};exports[_0x7e8e('0x45')]=function(_0x27fd41,_0x1e4b62){return db[_0x7e8e('0x27')]['create'](_0x27fd41[_0x7e8e('0x46')],{})[_0x7e8e('0x20')](respondWithResult(_0x1e4b62,0xc9))[_0x7e8e('0x3f')](handleError(_0x1e4b62,null));};exports[_0x7e8e('0x1f')]=function(_0x5784b2,_0x2aea3c){if(_0x5784b2[_0x7e8e('0x46')]['id']){delete _0x5784b2['body']['id'];}return db[_0x7e8e('0x27')]['find']({'where':{'id':_0x5784b2['params']['id']}})[_0x7e8e('0x20')](handleEntityNotFound(_0x2aea3c,null))[_0x7e8e('0x20')](saveUpdates(_0x5784b2['body'],null))['then'](respondWithResult(_0x2aea3c,null))['catch'](handleError(_0x2aea3c,null));};exports[_0x7e8e('0x21')]=function(_0x37861f,_0x3935c2){return db[_0x7e8e('0x27')]['find']({'where':{'id':_0x37861f['params']['id']}})[_0x7e8e('0x20')](handleEntityNotFound(_0x3935c2,null))['then'](removeEntity(_0x3935c2,null))[_0x7e8e('0x3f')](handleError(_0x3935c2,null));};exports[_0x7e8e('0x47')]=function(_0x5f0c6b,_0x1284c1,_0x314950){var _0x528a69={};var _0x1d6b68={};var _0x40775b;var _0x5a3d8e;return db[_0x7e8e('0x27')][_0x7e8e('0x48')]({'where':{'id':_0x5f0c6b[_0x7e8e('0x41')]['id']}})[_0x7e8e('0x20')](handleEntityNotFound(_0x1284c1,null))[_0x7e8e('0x20')](function(_0x41be22){if(_0x41be22){_0x40775b=_0x41be22;_0x1d6b68['model']=_[_0x7e8e('0x42')](db[_0x7e8e('0x49')][_0x7e8e('0x28')]);_0x1d6b68['query']=_[_0x7e8e('0x42')](_0x5f0c6b['query']);_0x1d6b68['filters']=_['intersection'](_0x1d6b68[_0x7e8e('0x2e')],_0x1d6b68['query']);_0x528a69[_0x7e8e('0x2f')]=_[_0x7e8e('0x2d')](_0x1d6b68[_0x7e8e('0x2e')],qs[_0x7e8e('0x30')](_0x5f0c6b['query']['fields']));_0x528a69[_0x7e8e('0x2f')]=_0x528a69[_0x7e8e('0x2f')][_0x7e8e('0x31')]?_0x528a69[_0x7e8e('0x2f')]:_0x1d6b68[_0x7e8e('0x2e')];_0x528a69['order']=qs[_0x7e8e('0x35')](_0x5f0c6b['query'][_0x7e8e('0x35')]);_0x528a69[_0x7e8e('0x38')]=qs[_0x7e8e('0x2c')](_['pick'](_0x5f0c6b['query'],_0x1d6b68[_0x7e8e('0x2c')]));if(_0x5f0c6b[_0x7e8e('0x2b')][_0x7e8e('0x37')]){_0x528a69[_0x7e8e('0x38')]=_[_0x7e8e('0x43')](_0x528a69[_0x7e8e('0x38')],{'$or':_['map'](_0x528a69[_0x7e8e('0x2f')],function(_0x423f0f){var _0x2d5eb6={};_0x2d5eb6[_0x423f0f]={'$like':'%'+_0x5f0c6b[_0x7e8e('0x2b')][_0x7e8e('0x37')]+'%'};return _0x2d5eb6;})});}_0x528a69=_[_0x7e8e('0x43')]({},_0x528a69,_0x5f0c6b['options']);return _0x40775b['getFields'](_0x528a69);}})[_0x7e8e('0x20')](function(_0x516096){if(_0x516096){_0x5a3d8e=_0x516096[_0x7e8e('0x31')];if(!_0x5f0c6b['query']['hasOwnProperty'](_0x7e8e('0x33'))){_0x528a69[_0x7e8e('0x15')]=qs[_0x7e8e('0x15')](_0x5f0c6b[_0x7e8e('0x2b')]['limit']);_0x528a69[_0x7e8e('0x18')]=qs['offset'](_0x5f0c6b['query'][_0x7e8e('0x18')]);}return _0x40775b[_0x7e8e('0x47')](_0x528a69);}})['then'](function(_0x523b9c){if(_0x523b9c){return _0x523b9c?{'count':_0x5a3d8e,'rows':_0x523b9c}:null;}})[_0x7e8e('0x20')](respondWithResult(_0x1284c1,null))['catch'](handleError(_0x1284c1,null));};exports[_0x7e8e('0x4a')]=function(_0x531b18,_0xf6b114,_0x3f592d){var _0x2da5f0={};var _0x3a4e03={};var _0x5a8716;var _0x36096f;return db[_0x7e8e('0x27')]['findOne']({'where':{'id':_0x531b18[_0x7e8e('0x41')]['id']}})[_0x7e8e('0x20')](handleEntityNotFound(_0xf6b114,null))['then'](function(_0x26c0a3){if(_0x26c0a3){_0x5a8716=_0x26c0a3;_0x3a4e03[_0x7e8e('0x2e')]=_['keys'](db[_0x7e8e('0x49')][_0x7e8e('0x28')]);_0x3a4e03[_0x7e8e('0x2b')]=_[_0x7e8e('0x42')](_0x531b18[_0x7e8e('0x2b')]);_0x3a4e03[_0x7e8e('0x2c')]=_['intersection'](_0x3a4e03['model'],_0x3a4e03[_0x7e8e('0x2b')]);_0x2da5f0['attributes']=_[_0x7e8e('0x2d')](_0x3a4e03['model'],qs[_0x7e8e('0x30')](_0x531b18[_0x7e8e('0x2b')]['fields']));_0x2da5f0[_0x7e8e('0x2f')]=_0x2da5f0[_0x7e8e('0x2f')][_0x7e8e('0x31')]?_0x2da5f0[_0x7e8e('0x2f')]:_0x3a4e03[_0x7e8e('0x2e')];_0x2da5f0[_0x7e8e('0x34')]=qs[_0x7e8e('0x35')](_0x531b18[_0x7e8e('0x2b')][_0x7e8e('0x35')]);_0x2da5f0['where']=qs[_0x7e8e('0x2c')](_[_0x7e8e('0x36')](_0x531b18[_0x7e8e('0x2b')],_0x3a4e03['filters']));if(_0x531b18['query'][_0x7e8e('0x37')]){_0x2da5f0[_0x7e8e('0x38')]=_[_0x7e8e('0x43')](_0x2da5f0[_0x7e8e('0x38')],{'$or':_[_0x7e8e('0x2a')](_0x2da5f0['attributes'],function(_0x5c52ec){var _0x52587a={};_0x52587a[_0x5c52ec]={'$like':'%'+_0x531b18[_0x7e8e('0x2b')][_0x7e8e('0x37')]+'%'};return _0x52587a;})});}_0x2da5f0=_[_0x7e8e('0x43')]({},_0x2da5f0,_0x531b18[_0x7e8e('0x3b')]);return _0x5a8716[_0x7e8e('0x4a')](_0x2da5f0);}})[_0x7e8e('0x20')](function(_0x237046){if(_0x237046){_0x36096f=_0x237046[_0x7e8e('0x31')];if(!_0x531b18[_0x7e8e('0x2b')][_0x7e8e('0x32')](_0x7e8e('0x33'))){_0x2da5f0['limit']=qs[_0x7e8e('0x15')](_0x531b18['query']['limit']);_0x2da5f0[_0x7e8e('0x18')]=qs[_0x7e8e('0x18')](_0x531b18['query'][_0x7e8e('0x18')]);}return _0x5a8716[_0x7e8e('0x4a')](_0x2da5f0);}})[_0x7e8e('0x20')](function(_0xe6aad5){if(_0xe6aad5){return _0xe6aad5?{'count':_0x36096f,'rows':_0xe6aad5}:null;}})[_0x7e8e('0x20')](respondWithResult(_0xf6b114,null))['catch'](handleError(_0xf6b114,null));};exports[_0x7e8e('0x4b')]=function(_0x4cef97,_0xe5575,_0x4cff8e){var _0x4a408f={};var _0x6100f4={};var _0x3cf11f;var _0x38a005;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4cef97[_0x7e8e('0x41')]['id']}})[_0x7e8e('0x20')](handleEntityNotFound(_0xe5575,null))[_0x7e8e('0x20')](function(_0x76db6c){if(_0x76db6c){_0x3cf11f=_0x76db6c;_0x6100f4[_0x7e8e('0x2e')]=_['keys'](db['SugarcrmField'][_0x7e8e('0x28')]);_0x6100f4['query']=_[_0x7e8e('0x42')](_0x4cef97['query']);_0x6100f4[_0x7e8e('0x2c')]=_[_0x7e8e('0x2d')](_0x6100f4['model'],_0x6100f4[_0x7e8e('0x2b')]);_0x4a408f[_0x7e8e('0x2f')]=_['intersection'](_0x6100f4[_0x7e8e('0x2e')],qs['fields'](_0x4cef97[_0x7e8e('0x2b')][_0x7e8e('0x30')]));_0x4a408f[_0x7e8e('0x2f')]=_0x4a408f[_0x7e8e('0x2f')][_0x7e8e('0x31')]?_0x4a408f['attributes']:_0x6100f4[_0x7e8e('0x2e')];_0x4a408f[_0x7e8e('0x34')]=qs[_0x7e8e('0x35')](_0x4cef97['query'][_0x7e8e('0x35')]);_0x4a408f[_0x7e8e('0x38')]=qs['filters'](_[_0x7e8e('0x36')](_0x4cef97[_0x7e8e('0x2b')],_0x6100f4[_0x7e8e('0x2c')]));if(_0x4cef97[_0x7e8e('0x2b')][_0x7e8e('0x37')]){_0x4a408f[_0x7e8e('0x38')]=_[_0x7e8e('0x43')](_0x4a408f[_0x7e8e('0x38')],{'$or':_['map'](_0x4a408f[_0x7e8e('0x2f')],function(_0x54518b){var _0x5bd1c9={};_0x5bd1c9[_0x54518b]={'$like':'%'+_0x4cef97['query'][_0x7e8e('0x37')]+'%'};return _0x5bd1c9;})});}_0x4a408f=_[_0x7e8e('0x43')]({},_0x4a408f,_0x4cef97[_0x7e8e('0x3b')]);return _0x3cf11f[_0x7e8e('0x4b')](_0x4a408f);}})[_0x7e8e('0x20')](function(_0x308f69){if(_0x308f69){_0x38a005=_0x308f69['length'];if(!_0x4cef97[_0x7e8e('0x2b')][_0x7e8e('0x32')](_0x7e8e('0x33'))){_0x4a408f[_0x7e8e('0x15')]=qs[_0x7e8e('0x15')](_0x4cef97[_0x7e8e('0x2b')][_0x7e8e('0x15')]);_0x4a408f[_0x7e8e('0x18')]=qs[_0x7e8e('0x18')](_0x4cef97[_0x7e8e('0x2b')][_0x7e8e('0x18')]);}return _0x3cf11f[_0x7e8e('0x4b')](_0x4a408f);}})['then'](function(_0x43b85c){if(_0x43b85c){return _0x43b85c?{'count':_0x38a005,'rows':_0x43b85c}:null;}})[_0x7e8e('0x20')](respondWithResult(_0xe5575,null))[_0x7e8e('0x3f')](handleError(_0xe5575,null));}; \ No newline at end of file +var _0x4e14=['VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','update','getFields','findOne','SugarcrmField','pick','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','mustache','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x4e14,0x150));var _0x44e1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4e14[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x44e1('0x0'));var jsonpatch=require(_0x44e1('0x1'));var rp=require(_0x44e1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44e1('0x3'));var util=require(_0x44e1('0x4'));var path=require('path');var sox=require(_0x44e1('0x5'));var csv=require(_0x44e1('0x6'));var ejs=require(_0x44e1('0x7'));var fs=require('fs');var fs_extra=require(_0x44e1('0x8'));var _=require(_0x44e1('0x9'));var squel=require(_0x44e1('0xa'));var crypto=require(_0x44e1('0xb'));var jsforce=require(_0x44e1('0xc'));var deskjs=require(_0x44e1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x44e1('0xe'));var Papa=require(_0x44e1('0xf'));var Redis=require(_0x44e1('0x10'));var authService=require(_0x44e1('0x11'));var qs=require(_0x44e1('0x12'));var as=require(_0x44e1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44e1('0x14'))(_0x44e1('0x15'));var utils=require(_0x44e1('0x16'));var config=require(_0x44e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x44e1('0x18'))['db'];function respondWithStatusCode(_0x594368,_0x3e1763){_0x3e1763=_0x3e1763||0xcc;return function(_0x48e5fd){if(_0x48e5fd){return _0x594368[_0x44e1('0x19')](_0x3e1763);}return _0x594368[_0x44e1('0x1a')](_0x3e1763)[_0x44e1('0x1b')]();};}function respondWithResult(_0xa747fa,_0x2292a1){_0x2292a1=_0x2292a1||0xc8;return function(_0x13fce3){if(_0x13fce3){return _0xa747fa['status'](_0x2292a1)['json'](_0x13fce3);}};}function respondWithFilteredResult(_0x26c039,_0x4e56e4){return function(_0x4deda6){if(_0x4deda6){var _0x56b9e9=typeof _0x4e56e4[_0x44e1('0x1c')]===_0x44e1('0x1d')&&typeof _0x4e56e4[_0x44e1('0x1e')]===_0x44e1('0x1d');var _0x5832a5=_0x4deda6[_0x44e1('0x1f')];var _0x807276=_0x56b9e9?0x0:_0x4e56e4[_0x44e1('0x1c')];var _0x42a1e2=_0x56b9e9?_0x4deda6[_0x44e1('0x1f')]:_0x4e56e4[_0x44e1('0x1c')]+_0x4e56e4[_0x44e1('0x1e')];var _0xcab4de;if(_0x42a1e2>=_0x5832a5){_0x42a1e2=_0x5832a5;_0xcab4de=0xc8;}else{_0xcab4de=0xce;}_0x26c039[_0x44e1('0x1a')](_0xcab4de);return _0x26c039[_0x44e1('0x20')]('Content-Range',_0x807276+'-'+_0x42a1e2+'/'+_0x5832a5)['json'](_0x4deda6);}return null;};}function patchUpdates(_0x401104){return function(_0x3b65e3){try{jsonpatch[_0x44e1('0x21')](_0x3b65e3,_0x401104,!![]);}catch(_0x1be162){return BPromise[_0x44e1('0x22')](_0x1be162);}return _0x3b65e3[_0x44e1('0x23')]();};}function saveUpdates(_0x2e88a2,_0x20e577){return function(_0x3b6ee0){if(_0x3b6ee0){return _0x3b6ee0['update'](_0x2e88a2)[_0x44e1('0x24')](function(_0x53f7bf){return _0x53f7bf;});}return null;};}function removeEntity(_0x2f9ef0,_0x29e45b){return function(_0xd8b7d9){if(_0xd8b7d9){return _0xd8b7d9['destroy']()[_0x44e1('0x24')](function(){_0x2f9ef0['status'](0xcc)[_0x44e1('0x1b')]();});}};}function handleEntityNotFound(_0x6df251,_0x223030){return function(_0x3f14f8){if(!_0x3f14f8){_0x6df251[_0x44e1('0x19')](0x194);}return _0x3f14f8;};}function handleError(_0x3a0310,_0x75e049){_0x75e049=_0x75e049||0x1f4;return function(_0x2de014){logger[_0x44e1('0x25')](_0x2de014[_0x44e1('0x26')]);if(_0x2de014[_0x44e1('0x27')]){delete _0x2de014[_0x44e1('0x27')];}_0x3a0310[_0x44e1('0x1a')](_0x75e049)['send'](_0x2de014);};}exports['index']=function(_0x2e9093,_0x213842){var _0x2e7af9={},_0x10fd39={},_0x57ed64={'count':0x0,'rows':[]};var _0x25d443=_[_0x44e1('0x28')](db[_0x44e1('0x29')][_0x44e1('0x2a')],function(_0x34e143){return{'name':_0x34e143['fieldName'],'type':_0x34e143[_0x44e1('0x2b')][_0x44e1('0x2c')]};});_0x10fd39[_0x44e1('0x2d')]=_['map'](_0x25d443,'name');_0x10fd39[_0x44e1('0x2e')]=_[_0x44e1('0x2f')](_0x2e9093[_0x44e1('0x2e')]);_0x10fd39[_0x44e1('0x30')]=_[_0x44e1('0x31')](_0x10fd39[_0x44e1('0x2d')],_0x10fd39['query']);_0x2e7af9[_0x44e1('0x32')]=_['intersection'](_0x10fd39[_0x44e1('0x2d')],qs[_0x44e1('0x33')](_0x2e9093['query'][_0x44e1('0x33')]));_0x2e7af9[_0x44e1('0x32')]=_0x2e7af9['attributes']['length']?_0x2e7af9[_0x44e1('0x32')]:_0x10fd39[_0x44e1('0x2d')];if(!_0x2e9093[_0x44e1('0x2e')][_0x44e1('0x34')](_0x44e1('0x35'))){_0x2e7af9['limit']=qs[_0x44e1('0x1e')](_0x2e9093['query'][_0x44e1('0x1e')]);_0x2e7af9['offset']=qs[_0x44e1('0x1c')](_0x2e9093[_0x44e1('0x2e')]['offset']);}_0x2e7af9[_0x44e1('0x36')]=qs[_0x44e1('0x37')](_0x2e9093[_0x44e1('0x2e')][_0x44e1('0x37')]);_0x2e7af9['where']=qs['filters'](_['pick'](_0x2e9093['query'],_0x10fd39['filters']),_0x25d443);if(_0x2e9093[_0x44e1('0x2e')][_0x44e1('0x38')]){_0x2e7af9[_0x44e1('0x39')]=_[_0x44e1('0x3a')](_0x2e7af9[_0x44e1('0x39')],{'$or':_[_0x44e1('0x28')](_0x25d443,function(_0x4c9678){if(_0x4c9678[_0x44e1('0x2b')]!==_0x44e1('0x3b')){var _0x1bd571={};_0x1bd571[_0x4c9678[_0x44e1('0x27')]]={'$like':'%'+_0x2e9093[_0x44e1('0x2e')][_0x44e1('0x38')]+'%'};return _0x1bd571;}})});}_0x2e7af9=_[_0x44e1('0x3a')]({},_0x2e7af9,_0x2e9093[_0x44e1('0x3c')]);var _0x4b3929={'where':_0x2e7af9[_0x44e1('0x39')]};return db[_0x44e1('0x29')]['count'](_0x4b3929)[_0x44e1('0x24')](function(_0x3ad265){_0x57ed64[_0x44e1('0x1f')]=_0x3ad265;if(_0x2e9093[_0x44e1('0x2e')][_0x44e1('0x3d')]){_0x2e7af9['include']=[{'all':!![]}];}return db[_0x44e1('0x29')][_0x44e1('0x3e')](_0x2e7af9);})[_0x44e1('0x24')](function(_0xbd3ff4){_0x57ed64[_0x44e1('0x3f')]=_0xbd3ff4;return _0x57ed64;})[_0x44e1('0x24')](respondWithFilteredResult(_0x213842,_0x2e7af9))[_0x44e1('0x40')](handleError(_0x213842,null));};exports[_0x44e1('0x41')]=function(_0xec7ae8,_0x2b143f){var _0x3490f0={'raw':![],'where':{'id':_0xec7ae8[_0x44e1('0x42')]['id']}},_0x423866={};_0x423866[_0x44e1('0x2d')]=_[_0x44e1('0x2f')](db[_0x44e1('0x29')][_0x44e1('0x2a')]);_0x423866[_0x44e1('0x2e')]=_[_0x44e1('0x2f')](_0xec7ae8['query']);_0x423866[_0x44e1('0x30')]=_[_0x44e1('0x31')](_0x423866[_0x44e1('0x2d')],_0x423866[_0x44e1('0x2e')]);_0x3490f0[_0x44e1('0x32')]=_[_0x44e1('0x31')](_0x423866[_0x44e1('0x2d')],qs[_0x44e1('0x33')](_0xec7ae8[_0x44e1('0x2e')][_0x44e1('0x33')]));_0x3490f0['attributes']=_0x3490f0[_0x44e1('0x32')][_0x44e1('0x43')]?_0x3490f0[_0x44e1('0x32')]:_0x423866['model'];if(_0xec7ae8[_0x44e1('0x2e')][_0x44e1('0x3d')]){_0x3490f0[_0x44e1('0x44')]=[{'all':!![]}];}_0x3490f0=_[_0x44e1('0x3a')]({},_0x3490f0,_0xec7ae8[_0x44e1('0x3c')]);return db[_0x44e1('0x29')][_0x44e1('0x45')](_0x3490f0)[_0x44e1('0x24')](handleEntityNotFound(_0x2b143f,null))[_0x44e1('0x24')](respondWithResult(_0x2b143f,null))['catch'](handleError(_0x2b143f,null));};exports[_0x44e1('0x46')]=function(_0xc20f65,_0xb60934){return db[_0x44e1('0x29')][_0x44e1('0x46')](_0xc20f65[_0x44e1('0x47')],{})['then'](respondWithResult(_0xb60934,0xc9))[_0x44e1('0x40')](handleError(_0xb60934,null));};exports[_0x44e1('0x48')]=function(_0x1fcec2,_0x27a883){if(_0x1fcec2[_0x44e1('0x47')]['id']){delete _0x1fcec2[_0x44e1('0x47')]['id'];}return db[_0x44e1('0x29')]['find']({'where':{'id':_0x1fcec2[_0x44e1('0x42')]['id']}})[_0x44e1('0x24')](handleEntityNotFound(_0x27a883,null))[_0x44e1('0x24')](saveUpdates(_0x1fcec2[_0x44e1('0x47')],null))[_0x44e1('0x24')](respondWithResult(_0x27a883,null))[_0x44e1('0x40')](handleError(_0x27a883,null));};exports['destroy']=function(_0x3bfd28,_0x2b4993){return db[_0x44e1('0x29')][_0x44e1('0x45')]({'where':{'id':_0x3bfd28['params']['id']}})[_0x44e1('0x24')](handleEntityNotFound(_0x2b4993,null))['then'](removeEntity(_0x2b4993,null))[_0x44e1('0x40')](handleError(_0x2b4993,null));};exports[_0x44e1('0x49')]=function(_0x3618ae,_0x4d2401,_0x9b9c5a){var _0x3ab784={};var _0x42744f={};var _0x2f4386;var _0x55e177;return db['SugarcrmConfiguration'][_0x44e1('0x4a')]({'where':{'id':_0x3618ae[_0x44e1('0x42')]['id']}})[_0x44e1('0x24')](handleEntityNotFound(_0x4d2401,null))[_0x44e1('0x24')](function(_0x4b1644){if(_0x4b1644){_0x2f4386=_0x4b1644;_0x42744f[_0x44e1('0x2d')]=_[_0x44e1('0x2f')](db[_0x44e1('0x4b')]['rawAttributes']);_0x42744f['query']=_[_0x44e1('0x2f')](_0x3618ae['query']);_0x42744f[_0x44e1('0x30')]=_['intersection'](_0x42744f[_0x44e1('0x2d')],_0x42744f[_0x44e1('0x2e')]);_0x3ab784['attributes']=_[_0x44e1('0x31')](_0x42744f[_0x44e1('0x2d')],qs[_0x44e1('0x33')](_0x3618ae[_0x44e1('0x2e')][_0x44e1('0x33')]));_0x3ab784[_0x44e1('0x32')]=_0x3ab784[_0x44e1('0x32')][_0x44e1('0x43')]?_0x3ab784['attributes']:_0x42744f[_0x44e1('0x2d')];_0x3ab784[_0x44e1('0x36')]=qs['sort'](_0x3618ae[_0x44e1('0x2e')][_0x44e1('0x37')]);_0x3ab784['where']=qs['filters'](_[_0x44e1('0x4c')](_0x3618ae[_0x44e1('0x2e')],_0x42744f['filters']));if(_0x3618ae[_0x44e1('0x2e')][_0x44e1('0x38')]){_0x3ab784[_0x44e1('0x39')]=_['merge'](_0x3ab784[_0x44e1('0x39')],{'$or':_[_0x44e1('0x28')](_0x3ab784[_0x44e1('0x32')],function(_0x54f257){var _0x4950f6={};_0x4950f6[_0x54f257]={'$like':'%'+_0x3618ae[_0x44e1('0x2e')][_0x44e1('0x38')]+'%'};return _0x4950f6;})});}_0x3ab784=_['merge']({},_0x3ab784,_0x3618ae[_0x44e1('0x3c')]);return _0x2f4386['getFields'](_0x3ab784);}})[_0x44e1('0x24')](function(_0x478ccf){if(_0x478ccf){_0x55e177=_0x478ccf[_0x44e1('0x43')];if(!_0x3618ae['query'][_0x44e1('0x34')](_0x44e1('0x35'))){_0x3ab784['limit']=qs[_0x44e1('0x1e')](_0x3618ae[_0x44e1('0x2e')][_0x44e1('0x1e')]);_0x3ab784['offset']=qs[_0x44e1('0x1c')](_0x3618ae['query']['offset']);}return _0x2f4386['getFields'](_0x3ab784);}})[_0x44e1('0x24')](function(_0x331940){if(_0x331940){return _0x331940?{'count':_0x55e177,'rows':_0x331940}:null;}})[_0x44e1('0x24')](respondWithResult(_0x4d2401,null))[_0x44e1('0x40')](handleError(_0x4d2401,null));};exports[_0x44e1('0x4d')]=function(_0x41e36e,_0x1878f7,_0x49a7a1){var _0x9645f9={};var _0x2c802d={};var _0x59e001;var _0x57969a;return db['SugarcrmConfiguration'][_0x44e1('0x4a')]({'where':{'id':_0x41e36e['params']['id']}})['then'](handleEntityNotFound(_0x1878f7,null))[_0x44e1('0x24')](function(_0x50e641){if(_0x50e641){_0x59e001=_0x50e641;_0x2c802d[_0x44e1('0x2d')]=_[_0x44e1('0x2f')](db[_0x44e1('0x4b')][_0x44e1('0x2a')]);_0x2c802d[_0x44e1('0x2e')]=_['keys'](_0x41e36e['query']);_0x2c802d[_0x44e1('0x30')]=_[_0x44e1('0x31')](_0x2c802d[_0x44e1('0x2d')],_0x2c802d[_0x44e1('0x2e')]);_0x9645f9[_0x44e1('0x32')]=_[_0x44e1('0x31')](_0x2c802d[_0x44e1('0x2d')],qs['fields'](_0x41e36e['query']['fields']));_0x9645f9[_0x44e1('0x32')]=_0x9645f9[_0x44e1('0x32')]['length']?_0x9645f9[_0x44e1('0x32')]:_0x2c802d['model'];_0x9645f9[_0x44e1('0x36')]=qs[_0x44e1('0x37')](_0x41e36e[_0x44e1('0x2e')][_0x44e1('0x37')]);_0x9645f9[_0x44e1('0x39')]=qs[_0x44e1('0x30')](_['pick'](_0x41e36e['query'],_0x2c802d[_0x44e1('0x30')]));if(_0x41e36e[_0x44e1('0x2e')][_0x44e1('0x38')]){_0x9645f9[_0x44e1('0x39')]=_[_0x44e1('0x3a')](_0x9645f9[_0x44e1('0x39')],{'$or':_['map'](_0x9645f9[_0x44e1('0x32')],function(_0x5ae9e6){var _0x21da6b={};_0x21da6b[_0x5ae9e6]={'$like':'%'+_0x41e36e['query'][_0x44e1('0x38')]+'%'};return _0x21da6b;})});}_0x9645f9=_[_0x44e1('0x3a')]({},_0x9645f9,_0x41e36e[_0x44e1('0x3c')]);return _0x59e001[_0x44e1('0x4d')](_0x9645f9);}})[_0x44e1('0x24')](function(_0x1f556c){if(_0x1f556c){_0x57969a=_0x1f556c[_0x44e1('0x43')];if(!_0x41e36e[_0x44e1('0x2e')][_0x44e1('0x34')]('nolimit')){_0x9645f9[_0x44e1('0x1e')]=qs[_0x44e1('0x1e')](_0x41e36e[_0x44e1('0x2e')]['limit']);_0x9645f9[_0x44e1('0x1c')]=qs[_0x44e1('0x1c')](_0x41e36e[_0x44e1('0x2e')][_0x44e1('0x1c')]);}return _0x59e001[_0x44e1('0x4d')](_0x9645f9);}})[_0x44e1('0x24')](function(_0x3a3acb){if(_0x3a3acb){return _0x3a3acb?{'count':_0x57969a,'rows':_0x3a3acb}:null;}})[_0x44e1('0x24')](respondWithResult(_0x1878f7,null))[_0x44e1('0x40')](handleError(_0x1878f7,null));};exports['getDescriptions']=function(_0x50dd5c,_0x1407e2,_0x56f98d){var _0x3aa09c={};var _0x3d1250={};var _0xe782ef;var _0x3d5b27;return db[_0x44e1('0x29')]['findOne']({'where':{'id':_0x50dd5c['params']['id']}})[_0x44e1('0x24')](handleEntityNotFound(_0x1407e2,null))['then'](function(_0x484de){if(_0x484de){_0xe782ef=_0x484de;_0x3d1250[_0x44e1('0x2d')]=_[_0x44e1('0x2f')](db[_0x44e1('0x4b')][_0x44e1('0x2a')]);_0x3d1250['query']=_[_0x44e1('0x2f')](_0x50dd5c[_0x44e1('0x2e')]);_0x3d1250[_0x44e1('0x30')]=_[_0x44e1('0x31')](_0x3d1250['model'],_0x3d1250[_0x44e1('0x2e')]);_0x3aa09c[_0x44e1('0x32')]=_[_0x44e1('0x31')](_0x3d1250[_0x44e1('0x2d')],qs['fields'](_0x50dd5c[_0x44e1('0x2e')][_0x44e1('0x33')]));_0x3aa09c[_0x44e1('0x32')]=_0x3aa09c[_0x44e1('0x32')]['length']?_0x3aa09c['attributes']:_0x3d1250[_0x44e1('0x2d')];_0x3aa09c['order']=qs[_0x44e1('0x37')](_0x50dd5c[_0x44e1('0x2e')][_0x44e1('0x37')]);_0x3aa09c[_0x44e1('0x39')]=qs[_0x44e1('0x30')](_[_0x44e1('0x4c')](_0x50dd5c[_0x44e1('0x2e')],_0x3d1250[_0x44e1('0x30')]));if(_0x50dd5c['query'][_0x44e1('0x38')]){_0x3aa09c[_0x44e1('0x39')]=_[_0x44e1('0x3a')](_0x3aa09c[_0x44e1('0x39')],{'$or':_['map'](_0x3aa09c[_0x44e1('0x32')],function(_0x1e63f8){var _0x4a19d3={};_0x4a19d3[_0x1e63f8]={'$like':'%'+_0x50dd5c[_0x44e1('0x2e')][_0x44e1('0x38')]+'%'};return _0x4a19d3;})});}_0x3aa09c=_['merge']({},_0x3aa09c,_0x50dd5c['options']);return _0xe782ef[_0x44e1('0x4e')](_0x3aa09c);}})[_0x44e1('0x24')](function(_0xdf7884){if(_0xdf7884){_0x3d5b27=_0xdf7884[_0x44e1('0x43')];if(!_0x50dd5c[_0x44e1('0x2e')]['hasOwnProperty']('nolimit')){_0x3aa09c[_0x44e1('0x1e')]=qs['limit'](_0x50dd5c[_0x44e1('0x2e')][_0x44e1('0x1e')]);_0x3aa09c[_0x44e1('0x1c')]=qs[_0x44e1('0x1c')](_0x50dd5c[_0x44e1('0x2e')][_0x44e1('0x1c')]);}return _0xe782ef[_0x44e1('0x4e')](_0x3aa09c);}})[_0x44e1('0x24')](function(_0x425f65){if(_0x425f65){return _0x425f65?{'count':_0x3d5b27,'rows':_0x425f65}:null;}})[_0x44e1('0x24')](respondWithResult(_0x1407e2,null))['catch'](handleError(_0x1407e2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 254e28c..4d6cd2f 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 _0xbc2f=['lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations'];(function(_0xda6fd4,_0x473b97){var _0x50526a=function(_0x1a88e2){while(--_0x1a88e2){_0xda6fd4['push'](_0xda6fd4['shift']());}};_0x50526a(++_0x473b97);}(_0xbc2f,0x1d6));var _0xfbc2=function(_0x4828cf,_0x7c342a){_0x4828cf=_0x4828cf-0x0;var _0x3ca370=_0xbc2f[_0x4828cf];return _0x3ca370;};'use strict';var _=require(_0xfbc2('0x0'));var util=require('util');var logger=require(_0xfbc2('0x1'))(_0xfbc2('0x2'));var moment=require('moment');var BPromise=require(_0xfbc2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfbc2('0x4'));var config=require(_0xfbc2('0x5'));var attributes=require(_0xfbc2('0x6'));module[_0xfbc2('0x7')]=function(_0x19d9cb,_0x42c6f2){return _0x19d9cb[_0xfbc2('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xfbc2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb087=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb087,0x13c));var _0x7b08=function(_0x589a85,_0xa285d1){_0x589a85=_0x589a85-0x0;var _0x2639dc=_0xb087[_0x589a85];return _0x2639dc;};'use strict';var _=require(_0x7b08('0x0'));var util=require(_0x7b08('0x1'));var logger=require(_0x7b08('0x2'))(_0x7b08('0x3'));var moment=require(_0x7b08('0x4'));var BPromise=require(_0x7b08('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b08('0x6'));var rimraf=require(_0x7b08('0x7'));var config=require(_0x7b08('0x8'));var attributes=require(_0x7b08('0x9'));module[_0x7b08('0xa')]=function(_0x4d1b19,_0x29bb00){return _0x4d1b19['define'](_0x7b08('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index dadd87c..86536e3 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 _0x46e2=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x22a44c,_0x23d679){var _0x57bcf1=function(_0x3cf985){while(--_0x3cf985){_0x22a44c['push'](_0x22a44c['shift']());}};_0x57bcf1(++_0x23d679);}(_0x46e2,0x1d5));var _0x246e=function(_0x2f5bbe,_0x50e428){_0x2f5bbe=_0x2f5bbe-0x0;var _0x284f23=_0x46e2[_0x2f5bbe];return _0x284f23;};'use strict';var _=require(_0x246e('0x0'));var util=require(_0x246e('0x1'));var moment=require('moment');var BPromise=require(_0x246e('0x2'));var rs=require(_0x246e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x246e('0x4'))['db'];var utils=require(_0x246e('0x5'));var logger=require('../../config/logger')(_0x246e('0x6'));var config=require(_0x246e('0x7'));var jayson=require(_0x246e('0x8'));var client=jayson['client'][_0x246e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3eb498,_0x305a60,_0x3c11dc){return new BPromise(function(_0x3182ff,_0x45eca0){return client['request'](_0x3eb498,_0x3c11dc)[_0x246e('0xa')](function(_0x32b35c){logger['info'](_0x246e('0xb'),_0x305a60,_0x246e('0xc'));logger[_0x246e('0xd')](_0x246e('0xe'),_0x305a60,_0x246e('0xc'),JSON['stringify'](_0x32b35c));if(_0x32b35c[_0x246e('0xf')]){if(_0x32b35c[_0x246e('0xf')][_0x246e('0x10')]===0x1f4){logger[_0x246e('0xf')](_0x246e('0xb'),_0x305a60,_0x32b35c[_0x246e('0xf')][_0x246e('0x11')]);return _0x45eca0(_0x32b35c['error'][_0x246e('0x11')]);}logger[_0x246e('0xf')](_0x246e('0xb'),_0x305a60,_0x32b35c['error'][_0x246e('0x11')]);return _0x3182ff(_0x32b35c[_0x246e('0xf')][_0x246e('0x11')]);}else{logger[_0x246e('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x305a60,_0x246e('0xc'));_0x3182ff(_0x32b35c[_0x246e('0x13')][_0x246e('0x11')]);}})['catch'](function(_0x33241b){logger[_0x246e('0xf')](_0x246e('0xb'),_0x305a60,_0x33241b);_0x45eca0(_0x33241b);});});} \ No newline at end of file +var _0x5e57=['info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x5e57,0x199));var _0x75e5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5e57[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x75e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75e5('0x1'));var fs=require('fs');var Redis=require(_0x75e5('0x2'));var db=require(_0x75e5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x75e5('0x4'))('rpc');var config=require(_0x75e5('0x5'));var jayson=require(_0x75e5('0x6'));var client=jayson[_0x75e5('0x7')][_0x75e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43e312,_0x31087a,_0x3a8b82){return new BPromise(function(_0x2cc44e,_0x3923a6){return client['request'](_0x43e312,_0x3a8b82)['then'](function(_0x4e5516){logger[_0x75e5('0x9')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x31087a,_0x75e5('0xa'));logger[_0x75e5('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x31087a,_0x75e5('0xa'),JSON[_0x75e5('0xc')](_0x4e5516));if(_0x4e5516['error']){if(_0x4e5516[_0x75e5('0xd')][_0x75e5('0xe')]===0x1f4){logger[_0x75e5('0xd')](_0x75e5('0xf'),_0x31087a,_0x4e5516[_0x75e5('0xd')][_0x75e5('0x10')]);return _0x3923a6(_0x4e5516[_0x75e5('0xd')][_0x75e5('0x10')]);}logger[_0x75e5('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x31087a,_0x4e5516[_0x75e5('0xd')][_0x75e5('0x10')]);return _0x2cc44e(_0x4e5516[_0x75e5('0xd')][_0x75e5('0x10')]);}else{logger['info'](_0x75e5('0xf'),_0x31087a,_0x75e5('0xa'));_0x2cc44e(_0x4e5516[_0x75e5('0x11')][_0x75e5('0x10')]);}})[_0x75e5('0x12')](function(_0x448497){logger[_0x75e5('0xd')](_0x75e5('0xf'),_0x31087a,_0x448497);_0x3923a6(_0x448497);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 542d9f9..58d7227 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 _0x1664=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update','destroy','multer','connect-timeout'];(function(_0x564a8b,_0xea0c0c){var _0x55292c=function(_0x3bf578){while(--_0x3bf578){_0x564a8b['push'](_0x564a8b['shift']());}};_0x55292c(++_0xea0c0c);}(_0x1664,0x175));var _0x4166=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1664[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x4166('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4166('0x1'));var express=require(_0x4166('0x2'));var router=express['Router']();var fs_extra=require(_0x4166('0x3'));var auth=require(_0x4166('0x4'));var interaction=require(_0x4166('0x5'));var config=require(_0x4166('0x6'));var controller=require('./intSugarcrmField.controller');router[_0x4166('0x7')]('/',auth[_0x4166('0x8')](),controller[_0x4166('0x9')]);router[_0x4166('0x7')](_0x4166('0xa'),auth[_0x4166('0x8')](),controller['show']);router['post']('/',auth[_0x4166('0x8')](),controller[_0x4166('0xb')]);router[_0x4166('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4166('0xd')]);router['delete'](_0x4166('0xa'),auth[_0x4166('0x8')](),controller[_0x4166('0xe')]);module['exports']=router; \ No newline at end of file +var _0xdc63=['path','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports','util'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xdc63,0xcb));var _0x3dc6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xdc63[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require(_0x3dc6('0x0'));var path=require(_0x3dc6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3dc6('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3dc6('0x3'));var config=require(_0x3dc6('0x4'));var controller=require(_0x3dc6('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x3dc6('0x6')]);router[_0x3dc6('0x7')](_0x3dc6('0x8'),auth['isAuthenticated'](),controller[_0x3dc6('0x9')]);router[_0x3dc6('0xa')]('/',auth[_0x3dc6('0xb')](),controller[_0x3dc6('0xc')]);router[_0x3dc6('0xd')]('/:id',auth[_0x3dc6('0xb')](),controller[_0x3dc6('0xe')]);router[_0x3dc6('0xf')](_0x3dc6('0x8'),auth[_0x3dc6('0xb')](),controller['destroy']);module[_0x3dc6('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index b5cd2d9..847ca76 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 _0xb714=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x3c2e0c,_0x62ca5f){var _0xa67634=function(_0x7fe4b5){while(--_0x7fe4b5){_0x3c2e0c['push'](_0x3c2e0c['shift']());}};_0xa67634(++_0x62ca5f);}(_0xb714,0xc4));var _0x4b71=function(_0x5d1df9,_0x4a95bf){_0x5d1df9=_0x5d1df9-0x0;var _0x5d4feb=_0xb714[_0x5d1df9];return _0x5d4feb;};'use strict';var Sequelize=require(_0x4b71('0x0'));module[_0x4b71('0x1')]={'type':{'type':Sequelize[_0x4b71('0x2')](_0x4b71('0x3'),_0x4b71('0x4'),_0x4b71('0x5'),_0x4b71('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x4b71('0x7')]},'key':{'type':Sequelize[_0x4b71('0x7')]},'keyType':{'type':Sequelize[_0x4b71('0x2')](_0x4b71('0x3'),_0x4b71('0x4'),_0x4b71('0x5'))},'keyContent':{'type':Sequelize[_0x4b71('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4b71('0x7')]},'customField':{'type':Sequelize[_0x4b71('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4b71('0x7')]}}; \ No newline at end of file +var _0xb736=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb736,0x88));var _0x6b73=function(_0x2d8eab,_0x7ae493){_0x2d8eab=_0x2d8eab-0x0;var _0x3ba0e8=_0xb736[_0x2d8eab];return _0x3ba0e8;};'use strict';var Sequelize=require(_0x6b73('0x0'));module[_0x6b73('0x1')]={'type':{'type':Sequelize[_0x6b73('0x2')](_0x6b73('0x3'),_0x6b73('0x4'),_0x6b73('0x5'),_0x6b73('0x6'),'picklist'),'defaultValue':_0x6b73('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6b73('0x7')]},'keyType':{'type':Sequelize[_0x6b73('0x2')](_0x6b73('0x3'),_0x6b73('0x4'),_0x6b73('0x5'))},'keyContent':{'type':Sequelize[_0x6b73('0x7')]},'idField':{'type':Sequelize[_0x6b73('0x7')]},'nameField':{'type':Sequelize[_0x6b73('0x7')]},'customField':{'type':Sequelize[_0x6b73('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b73('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a688941..7e8b3f0 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 _0x083b=['../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','options','where','includeAll','include','catch','show','params','find','create','body','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x300b26,_0x3a9b67){var _0x5cb1ae=function(_0x2b8e7f){while(--_0x2b8e7f){_0x300b26['push'](_0x300b26['shift']());}};_0x5cb1ae(++_0x3a9b67);}(_0x083b,0x1d8));var _0xb083=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x083b[_0x4de586];return _0x46baf5;};'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(_0xb083('0x0'));var moment=require('moment');var BPromise=require(_0xb083('0x1'));var Mustache=require(_0xb083('0x2'));var util=require(_0xb083('0x3'));var path=require(_0xb083('0x4'));var sox=require('sox');var csv=require(_0xb083('0x5'));var ejs=require(_0xb083('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb083('0x7'));var squel=require(_0xb083('0x8'));var crypto=require(_0xb083('0x9'));var jsforce=require(_0xb083('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb083('0x5'));var querystring=require('querystring');var Papa=require(_0xb083('0xb'));var Redis=require(_0xb083('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb083('0xd'));var as=require(_0xb083('0xe'));var hardwareService=require(_0xb083('0xf'));var logger=require(_0xb083('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xb083('0x11'));var licenseUtil=require(_0xb083('0x12'));var db=require(_0xb083('0x13'))['db'];function respondWithStatusCode(_0x3231d1,_0x2ac2f6){_0x2ac2f6=_0x2ac2f6||0xcc;return function(_0x339313){if(_0x339313){return _0x3231d1['sendStatus'](_0x2ac2f6);}return _0x3231d1[_0xb083('0x14')](_0x2ac2f6)['end']();};}function respondWithResult(_0x452c1f,_0x2b6f22){_0x2b6f22=_0x2b6f22||0xc8;return function(_0x3ec029){if(_0x3ec029){return _0x452c1f['status'](_0x2b6f22)['json'](_0x3ec029);}};}function respondWithFilteredResult(_0x4145a7,_0x2f206e){return function(_0xd37e1e){if(_0xd37e1e){var _0x2cb925=typeof _0x2f206e[_0xb083('0x15')]===_0xb083('0x16')&&typeof _0x2f206e[_0xb083('0x17')]===_0xb083('0x16');var _0x200e28=_0xd37e1e[_0xb083('0x18')];var _0x22507b=_0x2cb925?0x0:_0x2f206e[_0xb083('0x15')];var _0x5cabda=_0x2cb925?_0xd37e1e[_0xb083('0x18')]:_0x2f206e[_0xb083('0x15')]+_0x2f206e[_0xb083('0x17')];var _0x1165ec;if(_0x5cabda>=_0x200e28){_0x5cabda=_0x200e28;_0x1165ec=0xc8;}else{_0x1165ec=0xce;}_0x4145a7[_0xb083('0x14')](_0x1165ec);return _0x4145a7[_0xb083('0x19')](_0xb083('0x1a'),_0x22507b+'-'+_0x5cabda+'/'+_0x200e28)[_0xb083('0x1b')](_0xd37e1e);}return null;};}function patchUpdates(_0x531201){return function(_0x498bd1){try{jsonpatch[_0xb083('0x1c')](_0x498bd1,_0x531201,!![]);}catch(_0x3c7fb3){return BPromise[_0xb083('0x1d')](_0x3c7fb3);}return _0x498bd1[_0xb083('0x1e')]();};}function saveUpdates(_0x29a117,_0x40b0e9){return function(_0x1f41de){if(_0x1f41de){return _0x1f41de[_0xb083('0x1f')](_0x29a117)[_0xb083('0x20')](function(_0x24358b){return _0x24358b;});}return null;};}function removeEntity(_0x52c40d,_0x2f7a91){return function(_0x13e89a){if(_0x13e89a){return _0x13e89a[_0xb083('0x21')]()[_0xb083('0x20')](function(){_0x52c40d[_0xb083('0x14')](0xcc)[_0xb083('0x22')]();});}};}function handleEntityNotFound(_0x2efacb,_0x4c19de){return function(_0x4555f1){if(!_0x4555f1){_0x2efacb[_0xb083('0x23')](0x194);}return _0x4555f1;};}function handleError(_0x5eabc5,_0x2bcdf2){_0x2bcdf2=_0x2bcdf2||0x1f4;return function(_0xe522f4){logger[_0xb083('0x24')](_0xe522f4['stack']);if(_0xe522f4[_0xb083('0x25')]){delete _0xe522f4[_0xb083('0x25')];}_0x5eabc5[_0xb083('0x14')](_0x2bcdf2)[_0xb083('0x26')](_0xe522f4);};}exports[_0xb083('0x27')]=function(_0x33640d,_0x2c61d2){var _0x1055c0={},_0x12fc4b={},_0x526c28={'count':0x0,'rows':[]};var _0x47a073=_[_0xb083('0x28')](db[_0xb083('0x29')][_0xb083('0x2a')],function(_0x2687a4){return{'name':_0x2687a4[_0xb083('0x2b')],'type':_0x2687a4[_0xb083('0x2c')][_0xb083('0x2d')]};});_0x12fc4b[_0xb083('0x2e')]=_[_0xb083('0x28')](_0x47a073,_0xb083('0x25'));_0x12fc4b[_0xb083('0x2f')]=_[_0xb083('0x30')](_0x33640d[_0xb083('0x2f')]);_0x12fc4b['filters']=_[_0xb083('0x31')](_0x12fc4b[_0xb083('0x2e')],_0x12fc4b[_0xb083('0x2f')]);_0x1055c0[_0xb083('0x32')]=_[_0xb083('0x31')](_0x12fc4b[_0xb083('0x2e')],qs[_0xb083('0x33')](_0x33640d[_0xb083('0x2f')][_0xb083('0x33')]));_0x1055c0[_0xb083('0x32')]=_0x1055c0[_0xb083('0x32')][_0xb083('0x34')]?_0x1055c0[_0xb083('0x32')]:_0x12fc4b[_0xb083('0x2e')];if(!_0x33640d[_0xb083('0x2f')][_0xb083('0x35')](_0xb083('0x36'))){_0x1055c0[_0xb083('0x17')]=qs[_0xb083('0x17')](_0x33640d['query'][_0xb083('0x17')]);_0x1055c0[_0xb083('0x15')]=qs[_0xb083('0x15')](_0x33640d['query'][_0xb083('0x15')]);}_0x1055c0[_0xb083('0x37')]=qs[_0xb083('0x38')](_0x33640d[_0xb083('0x2f')][_0xb083('0x38')]);_0x1055c0['where']=qs[_0xb083('0x39')](_['pick'](_0x33640d[_0xb083('0x2f')],_0x12fc4b[_0xb083('0x39')]),_0x47a073);if(_0x33640d[_0xb083('0x2f')][_0xb083('0x3a')]){_0x1055c0['where']=_[_0xb083('0x3b')](_0x1055c0['where'],{'$or':_[_0xb083('0x28')](_0x47a073,function(_0x539723){if(_0x539723['type']!=='VIRTUAL'){var _0x3963ab={};_0x3963ab[_0x539723['name']]={'$like':'%'+_0x33640d[_0xb083('0x2f')]['filter']+'%'};return _0x3963ab;}})});}_0x1055c0=_[_0xb083('0x3b')]({},_0x1055c0,_0x33640d[_0xb083('0x3c')]);var _0x3ca34b={'where':_0x1055c0[_0xb083('0x3d')]};return db['SugarcrmField'][_0xb083('0x18')](_0x3ca34b)[_0xb083('0x20')](function(_0x6a60f9){_0x526c28['count']=_0x6a60f9;if(_0x33640d[_0xb083('0x2f')][_0xb083('0x3e')]){_0x1055c0[_0xb083('0x3f')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x1055c0);})[_0xb083('0x20')](function(_0x34ccd6){_0x526c28['rows']=_0x34ccd6;return _0x526c28;})[_0xb083('0x20')](respondWithFilteredResult(_0x2c61d2,_0x1055c0))[_0xb083('0x40')](handleError(_0x2c61d2,null));};exports[_0xb083('0x41')]=function(_0x1c86e4,_0x58d131){var _0x18af57={'raw':!![],'where':{'id':_0x1c86e4[_0xb083('0x42')]['id']}},_0x347ee1={};_0x347ee1['model']=_['keys'](db[_0xb083('0x29')][_0xb083('0x2a')]);_0x347ee1[_0xb083('0x2f')]=_[_0xb083('0x30')](_0x1c86e4[_0xb083('0x2f')]);_0x347ee1[_0xb083('0x39')]=_['intersection'](_0x347ee1[_0xb083('0x2e')],_0x347ee1[_0xb083('0x2f')]);_0x18af57[_0xb083('0x32')]=_[_0xb083('0x31')](_0x347ee1[_0xb083('0x2e')],qs[_0xb083('0x33')](_0x1c86e4[_0xb083('0x2f')][_0xb083('0x33')]));_0x18af57['attributes']=_0x18af57[_0xb083('0x32')]['length']?_0x18af57['attributes']:_0x347ee1['model'];if(_0x1c86e4[_0xb083('0x2f')]['includeAll']){_0x18af57[_0xb083('0x3f')]=[{'all':!![]}];}_0x18af57=_[_0xb083('0x3b')]({},_0x18af57,_0x1c86e4[_0xb083('0x3c')]);return db[_0xb083('0x29')][_0xb083('0x43')](_0x18af57)[_0xb083('0x20')](handleEntityNotFound(_0x58d131,null))[_0xb083('0x20')](respondWithResult(_0x58d131,null))[_0xb083('0x40')](handleError(_0x58d131,null));};exports[_0xb083('0x44')]=function(_0xcd50e5,_0x36fd9c){return db[_0xb083('0x29')][_0xb083('0x44')](_0xcd50e5[_0xb083('0x45')],{})[_0xb083('0x20')](respondWithResult(_0x36fd9c,0xc9))[_0xb083('0x40')](handleError(_0x36fd9c,null));};exports['update']=function(_0x2bc5e9,_0x5f3965){if(_0x2bc5e9[_0xb083('0x45')]['id']){delete _0x2bc5e9['body']['id'];}return db[_0xb083('0x29')]['find']({'where':{'id':_0x2bc5e9['params']['id']}})[_0xb083('0x20')](handleEntityNotFound(_0x5f3965,null))[_0xb083('0x20')](saveUpdates(_0x2bc5e9[_0xb083('0x45')],null))['then'](respondWithResult(_0x5f3965,null))['catch'](handleError(_0x5f3965,null));};exports[_0xb083('0x21')]=function(_0xa2e32,_0x9e208c){return db[_0xb083('0x29')][_0xb083('0x43')]({'where':{'id':_0xa2e32[_0xb083('0x42')]['id']}})['then'](handleEntityNotFound(_0x9e208c,null))['then'](removeEntity(_0x9e208c,null))[_0xb083('0x40')](handleError(_0x9e208c,null));}; \ No newline at end of file +var _0xa1e1=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','SugarcrmField','rawAttributes','type','key','query','keys','filters','model'];(function(_0x16916f,_0x1655ee){var _0x536d2a=function(_0x8cdc62){while(--_0x8cdc62){_0x16916f['push'](_0x16916f['shift']());}};_0x536d2a(++_0x1655ee);}(_0xa1e1,0x1d1));var _0x1a1e=function(_0x3ecbe3,_0x30ba42){_0x3ecbe3=_0x3ecbe3-0x0;var _0x38be3e=_0xa1e1[_0x3ecbe3];return _0x38be3e;};'use strict';var emlformat=require(_0x1a1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a1e('0x1'));var jsonpatch=require(_0x1a1e('0x2'));var rp=require(_0x1a1e('0x3'));var moment=require(_0x1a1e('0x4'));var BPromise=require(_0x1a1e('0x5'));var Mustache=require(_0x1a1e('0x6'));var util=require(_0x1a1e('0x7'));var path=require(_0x1a1e('0x8'));var sox=require(_0x1a1e('0x9'));var csv=require(_0x1a1e('0xa'));var ejs=require(_0x1a1e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1a1e('0xc'));var squel=require(_0x1a1e('0xd'));var crypto=require(_0x1a1e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1a1e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1a1e('0x10'));var Papa=require(_0x1a1e('0x11'));var Redis=require(_0x1a1e('0x12'));var authService=require(_0x1a1e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a1e('0x14'));var logger=require(_0x1a1e('0x15'))(_0x1a1e('0x16'));var utils=require('../../config/utils');var config=require(_0x1a1e('0x17'));var licenseUtil=require(_0x1a1e('0x18'));var db=require(_0x1a1e('0x19'))['db'];function respondWithStatusCode(_0xd23bcf,_0x12cc6f){_0x12cc6f=_0x12cc6f||0xcc;return function(_0x44cdb3){if(_0x44cdb3){return _0xd23bcf[_0x1a1e('0x1a')](_0x12cc6f);}return _0xd23bcf[_0x1a1e('0x1b')](_0x12cc6f)['end']();};}function respondWithResult(_0x695291,_0x1e3b4a){_0x1e3b4a=_0x1e3b4a||0xc8;return function(_0x129a0c){if(_0x129a0c){return _0x695291[_0x1a1e('0x1b')](_0x1e3b4a)[_0x1a1e('0x1c')](_0x129a0c);}};}function respondWithFilteredResult(_0x58822d,_0x428c7a){return function(_0x5ba0cf){if(_0x5ba0cf){var _0x2db1ac=typeof _0x428c7a[_0x1a1e('0x1d')]===_0x1a1e('0x1e')&&typeof _0x428c7a[_0x1a1e('0x1f')]===_0x1a1e('0x1e');var _0x2690c9=_0x5ba0cf['count'];var _0x54b48c=_0x2db1ac?0x0:_0x428c7a[_0x1a1e('0x1d')];var _0x2e5557=_0x2db1ac?_0x5ba0cf['count']:_0x428c7a[_0x1a1e('0x1d')]+_0x428c7a['limit'];var _0x4d79e6;if(_0x2e5557>=_0x2690c9){_0x2e5557=_0x2690c9;_0x4d79e6=0xc8;}else{_0x4d79e6=0xce;}_0x58822d[_0x1a1e('0x1b')](_0x4d79e6);return _0x58822d[_0x1a1e('0x20')](_0x1a1e('0x21'),_0x54b48c+'-'+_0x2e5557+'/'+_0x2690c9)[_0x1a1e('0x1c')](_0x5ba0cf);}return null;};}function patchUpdates(_0x337e17){return function(_0x4b3292){try{jsonpatch[_0x1a1e('0x22')](_0x4b3292,_0x337e17,!![]);}catch(_0x295cd3){return BPromise[_0x1a1e('0x23')](_0x295cd3);}return _0x4b3292[_0x1a1e('0x24')]();};}function saveUpdates(_0xf60113,_0x27cdb3){return function(_0x27b525){if(_0x27b525){return _0x27b525[_0x1a1e('0x25')](_0xf60113)[_0x1a1e('0x26')](function(_0xe2b7a5){return _0xe2b7a5;});}return null;};}function removeEntity(_0x37d6f2,_0x28a762){return function(_0x2dd1af){if(_0x2dd1af){return _0x2dd1af[_0x1a1e('0x27')]()[_0x1a1e('0x26')](function(){_0x37d6f2[_0x1a1e('0x1b')](0xcc)[_0x1a1e('0x28')]();});}};}function handleEntityNotFound(_0x9cac84,_0x123c04){return function(_0x50dbea){if(!_0x50dbea){_0x9cac84[_0x1a1e('0x1a')](0x194);}return _0x50dbea;};}function handleError(_0x1fe4be,_0x41e6e2){_0x41e6e2=_0x41e6e2||0x1f4;return function(_0x2b7257){logger[_0x1a1e('0x29')](_0x2b7257[_0x1a1e('0x2a')]);if(_0x2b7257[_0x1a1e('0x2b')]){delete _0x2b7257[_0x1a1e('0x2b')];}_0x1fe4be[_0x1a1e('0x1b')](_0x41e6e2)['send'](_0x2b7257);};}exports['index']=function(_0x30e1df,_0xcae648){var _0x48a6e3={},_0x70e132={},_0x56244d={'count':0x0,'rows':[]};var _0x38a32a=_[_0x1a1e('0x2c')](db[_0x1a1e('0x2d')][_0x1a1e('0x2e')],function(_0x44648d){return{'name':_0x44648d['fieldName'],'type':_0x44648d[_0x1a1e('0x2f')][_0x1a1e('0x30')]};});_0x70e132['model']=_[_0x1a1e('0x2c')](_0x38a32a,_0x1a1e('0x2b'));_0x70e132[_0x1a1e('0x31')]=_[_0x1a1e('0x32')](_0x30e1df[_0x1a1e('0x31')]);_0x70e132[_0x1a1e('0x33')]=_['intersection'](_0x70e132[_0x1a1e('0x34')],_0x70e132[_0x1a1e('0x31')]);_0x48a6e3[_0x1a1e('0x35')]=_[_0x1a1e('0x36')](_0x70e132[_0x1a1e('0x34')],qs['fields'](_0x30e1df[_0x1a1e('0x31')][_0x1a1e('0x37')]));_0x48a6e3[_0x1a1e('0x35')]=_0x48a6e3['attributes'][_0x1a1e('0x38')]?_0x48a6e3[_0x1a1e('0x35')]:_0x70e132[_0x1a1e('0x34')];if(!_0x30e1df[_0x1a1e('0x31')][_0x1a1e('0x39')](_0x1a1e('0x3a'))){_0x48a6e3[_0x1a1e('0x1f')]=qs[_0x1a1e('0x1f')](_0x30e1df[_0x1a1e('0x31')][_0x1a1e('0x1f')]);_0x48a6e3[_0x1a1e('0x1d')]=qs[_0x1a1e('0x1d')](_0x30e1df[_0x1a1e('0x31')]['offset']);}_0x48a6e3['order']=qs['sort'](_0x30e1df['query'][_0x1a1e('0x3b')]);_0x48a6e3['where']=qs[_0x1a1e('0x33')](_[_0x1a1e('0x3c')](_0x30e1df[_0x1a1e('0x31')],_0x70e132[_0x1a1e('0x33')]),_0x38a32a);if(_0x30e1df[_0x1a1e('0x31')][_0x1a1e('0x3d')]){_0x48a6e3[_0x1a1e('0x3e')]=_[_0x1a1e('0x3f')](_0x48a6e3[_0x1a1e('0x3e')],{'$or':_[_0x1a1e('0x2c')](_0x38a32a,function(_0x5d7bba){if(_0x5d7bba['type']!==_0x1a1e('0x40')){var _0x3edbff={};_0x3edbff[_0x5d7bba[_0x1a1e('0x2b')]]={'$like':'%'+_0x30e1df[_0x1a1e('0x31')]['filter']+'%'};return _0x3edbff;}})});}_0x48a6e3=_['merge']({},_0x48a6e3,_0x30e1df[_0x1a1e('0x41')]);var _0x41c837={'where':_0x48a6e3['where']};return db['SugarcrmField']['count'](_0x41c837)[_0x1a1e('0x26')](function(_0x47c8c0){_0x56244d['count']=_0x47c8c0;if(_0x30e1df[_0x1a1e('0x31')]['includeAll']){_0x48a6e3[_0x1a1e('0x42')]=[{'all':!![]}];}return db[_0x1a1e('0x2d')][_0x1a1e('0x43')](_0x48a6e3);})['then'](function(_0x25629b){_0x56244d['rows']=_0x25629b;return _0x56244d;})[_0x1a1e('0x26')](respondWithFilteredResult(_0xcae648,_0x48a6e3))['catch'](handleError(_0xcae648,null));};exports[_0x1a1e('0x44')]=function(_0x24e256,_0x1e36da){var _0x3d4f1c={'raw':!![],'where':{'id':_0x24e256[_0x1a1e('0x45')]['id']}},_0x5609d2={};_0x5609d2[_0x1a1e('0x34')]=_[_0x1a1e('0x32')](db[_0x1a1e('0x2d')][_0x1a1e('0x2e')]);_0x5609d2['query']=_['keys'](_0x24e256[_0x1a1e('0x31')]);_0x5609d2[_0x1a1e('0x33')]=_[_0x1a1e('0x36')](_0x5609d2['model'],_0x5609d2['query']);_0x3d4f1c['attributes']=_['intersection'](_0x5609d2[_0x1a1e('0x34')],qs[_0x1a1e('0x37')](_0x24e256['query'][_0x1a1e('0x37')]));_0x3d4f1c['attributes']=_0x3d4f1c[_0x1a1e('0x35')][_0x1a1e('0x38')]?_0x3d4f1c['attributes']:_0x5609d2[_0x1a1e('0x34')];if(_0x24e256[_0x1a1e('0x31')]['includeAll']){_0x3d4f1c[_0x1a1e('0x42')]=[{'all':!![]}];}_0x3d4f1c=_['merge']({},_0x3d4f1c,_0x24e256[_0x1a1e('0x41')]);return db[_0x1a1e('0x2d')][_0x1a1e('0x46')](_0x3d4f1c)['then'](handleEntityNotFound(_0x1e36da,null))[_0x1a1e('0x26')](respondWithResult(_0x1e36da,null))[_0x1a1e('0x47')](handleError(_0x1e36da,null));};exports[_0x1a1e('0x48')]=function(_0x509faa,_0x3cce45){return db[_0x1a1e('0x2d')][_0x1a1e('0x48')](_0x509faa[_0x1a1e('0x49')],{})[_0x1a1e('0x26')](respondWithResult(_0x3cce45,0xc9))[_0x1a1e('0x47')](handleError(_0x3cce45,null));};exports['update']=function(_0x4f18ef,_0x65208d){if(_0x4f18ef['body']['id']){delete _0x4f18ef[_0x1a1e('0x49')]['id'];}return db[_0x1a1e('0x2d')][_0x1a1e('0x46')]({'where':{'id':_0x4f18ef['params']['id']}})[_0x1a1e('0x26')](handleEntityNotFound(_0x65208d,null))[_0x1a1e('0x26')](saveUpdates(_0x4f18ef['body'],null))[_0x1a1e('0x26')](respondWithResult(_0x65208d,null))[_0x1a1e('0x47')](handleError(_0x65208d,null));};exports[_0x1a1e('0x27')]=function(_0x5e3842,_0x57ce98){return db['SugarcrmField'][_0x1a1e('0x46')]({'where':{'id':_0x5e3842[_0x1a1e('0x45')]['id']}})[_0x1a1e('0x26')](handleEntityNotFound(_0x57ce98,null))[_0x1a1e('0x26')](removeEntity(_0x57ce98,null))['catch'](handleError(_0x57ce98,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c02934e..100daf2 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 _0x085b=['FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x085b,0x139));var _0xb085=function(_0x50da1d,_0x1fa929){_0x50da1d=_0x50da1d-0x0;var _0x30cd08=_0x085b[_0x50da1d];return _0x30cd08;};'use strict';var _=require(_0xb085('0x0'));var util=require(_0xb085('0x1'));var logger=require(_0xb085('0x2'))(_0xb085('0x3'));var moment=require('moment');var BPromise=require(_0xb085('0x4'));var rp=require(_0xb085('0x5'));var fs=require('fs');var path=require(_0xb085('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb085('0x7'));module[_0xb085('0x8')]=function(_0xf2c9dd,_0x599772){return _0xf2c9dd[_0xb085('0x9')](_0xb085('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xb085('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb2e2=['exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xb2e2,0x9c));var _0x2b2e=function(_0x4b8588,_0x57623a){_0x4b8588=_0x4b8588-0x0;var _0x21200c=_0xb2e2[_0x4b8588];return _0x21200c;};'use strict';var _=require(_0x2b2e('0x0'));var util=require('util');var logger=require(_0x2b2e('0x1'))(_0x2b2e('0x2'));var moment=require(_0x2b2e('0x3'));var BPromise=require(_0x2b2e('0x4'));var rp=require(_0x2b2e('0x5'));var fs=require('fs');var path=require(_0x2b2e('0x6'));var rimraf=require('rimraf');var config=require(_0x2b2e('0x7'));var attributes=require(_0x2b2e('0x8'));module[_0x2b2e('0x9')]=function(_0x513ab6,_0x4d3005){return _0x513ab6[_0x2b2e('0xa')](_0x2b2e('0xb'),attributes,{'tableName':_0x2b2e('0xc'),'paranoid':![],'indexes':[{'name':_0x2b2e('0xd'),'fields':['idField',_0x2b2e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index ce5263d..8e2bfda 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 _0x9ad1=['code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x567c2a,_0x48f025){var _0x13006d=function(_0x48db22){while(--_0x48db22){_0x567c2a['push'](_0x567c2a['shift']());}};_0x13006d(++_0x48f025);}(_0x9ad1,0x12f));var _0x19ad=function(_0x19d4a0,_0x3dfe52){_0x19d4a0=_0x19d4a0-0x0;var _0x3a41bf=_0x9ad1[_0x19d4a0];return _0x3a41bf;};'use strict';var _=require('lodash');var util=require(_0x19ad('0x0'));var moment=require(_0x19ad('0x1'));var BPromise=require('bluebird');var rs=require(_0x19ad('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19ad('0x3'))['db'];var utils=require(_0x19ad('0x4'));var logger=require('../../config/logger')(_0x19ad('0x5'));var config=require(_0x19ad('0x6'));var jayson=require(_0x19ad('0x7'));var client=jayson[_0x19ad('0x8')][_0x19ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2aec98,_0x5db151,_0x1e8345){return new BPromise(function(_0x298017,_0x186964){return client[_0x19ad('0xa')](_0x2aec98,_0x1e8345)[_0x19ad('0xb')](function(_0x2cf273){logger[_0x19ad('0xc')](_0x19ad('0xd'),_0x5db151,'request\x20sent');logger[_0x19ad('0xe')](_0x19ad('0xf'),_0x5db151,_0x19ad('0x10'),JSON[_0x19ad('0x11')](_0x2cf273));if(_0x2cf273[_0x19ad('0x12')]){if(_0x2cf273['error'][_0x19ad('0x13')]===0x1f4){logger['error'](_0x19ad('0xd'),_0x5db151,_0x2cf273['error']['message']);return _0x186964(_0x2cf273[_0x19ad('0x12')][_0x19ad('0x14')]);}logger[_0x19ad('0x12')](_0x19ad('0xd'),_0x5db151,_0x2cf273[_0x19ad('0x12')][_0x19ad('0x14')]);return _0x298017(_0x2cf273[_0x19ad('0x12')][_0x19ad('0x14')]);}else{logger[_0x19ad('0xc')](_0x19ad('0xd'),_0x5db151,_0x19ad('0x10'));_0x298017(_0x2cf273[_0x19ad('0x15')][_0x19ad('0x14')]);}})[_0x19ad('0x16')](function(_0x8f78e7){logger[_0x19ad('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x5db151,_0x8f78e7);_0x186964(_0x8f78e7);});});} \ No newline at end of file +var _0xc074=['../../config/utils','rpc','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xfa75b5,_0x5cbe19){var _0x1c1911=function(_0x1e106c){while(--_0x1e106c){_0xfa75b5['push'](_0xfa75b5['shift']());}};_0x1c1911(++_0x5cbe19);}(_0xc074,0x1c8));var _0x4c07=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0xc074[_0x3d13bb];return _0x4b5a1b;};'use strict';var _=require(_0x4c07('0x0'));var util=require(_0x4c07('0x1'));var moment=require(_0x4c07('0x2'));var BPromise=require(_0x4c07('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c07('0x4'));var db=require(_0x4c07('0x5'))['db'];var utils=require(_0x4c07('0x6'));var logger=require('../../config/logger')(_0x4c07('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c07('0x8'));var client=jayson[_0x4c07('0x9')][_0x4c07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeffc5e,_0x2b9aa2,_0x8af41){return new BPromise(function(_0x1330ba,_0x3738cc){return client['request'](_0xeffc5e,_0x8af41)[_0x4c07('0xb')](function(_0x555c0){logger[_0x4c07('0xc')](_0x4c07('0xd'),_0x2b9aa2,_0x4c07('0xe'));logger[_0x4c07('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2b9aa2,_0x4c07('0xe'),JSON[_0x4c07('0x10')](_0x555c0));if(_0x555c0[_0x4c07('0x11')]){if(_0x555c0[_0x4c07('0x11')]['code']===0x1f4){logger[_0x4c07('0x11')](_0x4c07('0xd'),_0x2b9aa2,_0x555c0['error'][_0x4c07('0x12')]);return _0x3738cc(_0x555c0[_0x4c07('0x11')][_0x4c07('0x12')]);}logger['error'](_0x4c07('0xd'),_0x2b9aa2,_0x555c0[_0x4c07('0x11')][_0x4c07('0x12')]);return _0x1330ba(_0x555c0[_0x4c07('0x11')][_0x4c07('0x12')]);}else{logger[_0x4c07('0xc')](_0x4c07('0xd'),_0x2b9aa2,'request\x20sent');_0x1330ba(_0x555c0[_0x4c07('0x13')][_0x4c07('0x12')]);}})[_0x4c07('0x14')](function(_0x5a935c){logger[_0x4c07('0x11')](_0x4c07('0xd'),_0x2b9aa2,_0x5a935c);_0x3738cc(_0x5a935c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 3205302..9b76cc1 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 _0x2828=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','post','put','destroy'];(function(_0x182eb3,_0x31feb6){var _0x30a5ce=function(_0x4439a1){while(--_0x4439a1){_0x182eb3['push'](_0x182eb3['shift']());}};_0x30a5ce(++_0x31feb6);}(_0x2828,0x1dc));var _0x8282=function(_0x1081a3,_0x2ac784){_0x1081a3=_0x1081a3-0x0;var _0x5696a2=_0x2828[_0x1081a3];return _0x5696a2;};'use strict';var multer=require('multer');var util=require(_0x8282('0x0'));var path=require(_0x8282('0x1'));var timeout=require(_0x8282('0x2'));var express=require(_0x8282('0x3'));var router=express[_0x8282('0x4')]();var fs_extra=require(_0x8282('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8282('0x6'));var config=require('../../config/environment');var controller=require(_0x8282('0x7'));router['get']('/',auth[_0x8282('0x8')](),controller[_0x8282('0x9')]);router[_0x8282('0xa')](_0x8282('0xb'),auth[_0x8282('0x8')](),controller['show']);router[_0x8282('0xa')](_0x8282('0xc'),auth[_0x8282('0x8')](),controller[_0x8282('0xd')]);router[_0x8282('0xa')](_0x8282('0xe'),auth[_0x8282('0x8')](),controller['getFields']);router[_0x8282('0xf')]('/',auth[_0x8282('0x8')](),controller['create']);router[_0x8282('0xf')](_0x8282('0xc'),auth[_0x8282('0x8')](),controller['addConfiguration']);router[_0x8282('0x10')](_0x8282('0xb'),auth[_0x8282('0x8')](),controller['update']);router['delete'](_0x8282('0xb'),auth[_0x8282('0x8')](),controller[_0x8282('0x11')]);module[_0x8282('0x12')]=router; \ No newline at end of file +var _0xf120=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post','create','/:id/configurations','put','update'];(function(_0x1001c1,_0x3165e6){var _0x1bc985=function(_0x41efd6){while(--_0x41efd6){_0x1001c1['push'](_0x1001c1['shift']());}};_0x1bc985(++_0x3165e6);}(_0xf120,0x179));var _0x0f12=function(_0xf63585,_0x3cb5a2){_0xf63585=_0xf63585-0x0;var _0x1ea991=_0xf120[_0xf63585];return _0x1ea991;};'use strict';var multer=require('multer');var util=require(_0x0f12('0x0'));var path=require(_0x0f12('0x1'));var timeout=require(_0x0f12('0x2'));var express=require('express');var router=express[_0x0f12('0x3')]();var fs_extra=require(_0x0f12('0x4'));var auth=require(_0x0f12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f12('0x6'));var controller=require(_0x0f12('0x7'));router[_0x0f12('0x8')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xa')]);router[_0x0f12('0x8')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller['show']);router[_0x0f12('0x8')]('/:id/configurations',auth[_0x0f12('0x9')](),controller[_0x0f12('0xc')]);router[_0x0f12('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x0f12('0xd')]);router[_0x0f12('0xe')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xf')]);router[_0x0f12('0xe')](_0x0f12('0x10'),auth[_0x0f12('0x9')](),controller['addConfiguration']);router[_0x0f12('0x11')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller[_0x0f12('0x12')]);router[_0x0f12('0x13')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller[_0x0f12('0x14')]);module[_0x0f12('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index a1953b8..e3f3f0c 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 _0xa54d=['STRING','HelpDesk','sequelize','exports'];(function(_0x174bc8,_0x3d7c6e){var _0x4ebd5f=function(_0x15129f){while(--_0x15129f){_0x174bc8['push'](_0x174bc8['shift']());}};_0x4ebd5f(++_0x3d7c6e);}(_0xa54d,0x13e));var _0xda54=function(_0x1a36a0,_0x59494e){_0x1a36a0=_0x1a36a0-0x0;var _0x4c18f5=_0xa54d[_0x1a36a0];return _0x4c18f5;};'use strict';var Sequelize=require(_0xda54('0x0'));module[_0xda54('0x1')]={'name':{'type':Sequelize[_0xda54('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xda54('0x2')]},'username':{'type':Sequelize[_0xda54('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xda54('0x2')],'allowNull':![],'defaultValue':_0xda54('0x3')},'remoteUri':{'type':Sequelize[_0xda54('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xda54('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xda54('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3d5d=['exports','STRING','HelpDesk','sequelize'];(function(_0x3bd85c,_0x2306f7){var _0x74f3f2=function(_0x5b1ee8){while(--_0x5b1ee8){_0x3bd85c['push'](_0x3bd85c['shift']());}};_0x74f3f2(++_0x2306f7);}(_0x3d5d,0x1cb));var _0xd3d5=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x3d5d[_0x19b84f];return _0x18067b;};'use strict';var Sequelize=require(_0xd3d5('0x0'));module[_0xd3d5('0x1')]={'name':{'type':Sequelize[_0xd3d5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd3d5('0x2')]},'username':{'type':Sequelize[_0xd3d5('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd3d5('0x2')],'allowNull':![],'defaultValue':_0xd3d5('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'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 4e55d2e..3197780 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 _0x3a56=['name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','VtigerAccount','rows','catch','show','params','keys','includeAll','create','body','find','findOne','length','order','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','POST','login','result','token','success','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','label','startsWith','picklistValues','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack'];(function(_0x1aa368,_0x56c31d){var _0x3d9e29=function(_0x32c580){while(--_0x32c580){_0x1aa368['push'](_0x1aa368['shift']());}};_0x3d9e29(++_0x56c31d);}(_0x3a56,0x141));var _0x63a5=function(_0x4ad0f7,_0x1920b0){_0x4ad0f7=_0x4ad0f7-0x0;var _0x30f5c8=_0x3a56[_0x4ad0f7];return _0x30f5c8;};'use strict';var emlformat=require(_0x63a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63a5('0x1'));var jsonpatch=require(_0x63a5('0x2'));var rp=require('request-promise');var moment=require(_0x63a5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x63a5('0x4'));var util=require(_0x63a5('0x5'));var path=require('path');var sox=require(_0x63a5('0x6'));var csv=require(_0x63a5('0x7'));var ejs=require(_0x63a5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63a5('0x9'));var squel=require(_0x63a5('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x63a5('0xb'));var toCsv=require(_0x63a5('0x7'));var querystring=require(_0x63a5('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63a5('0xd'));var as=require(_0x63a5('0xe'));var hardwareService=require(_0x63a5('0xf'));var logger=require(_0x63a5('0x10'))(_0x63a5('0x11'));var utils=require(_0x63a5('0x12'));var config=require(_0x63a5('0x13'));var licenseUtil=require(_0x63a5('0x14'));var db=require(_0x63a5('0x15'))['db'];var integrations=require(_0x63a5('0x16'));function respondWithStatusCode(_0x2c1e33,_0x5b2101){_0x5b2101=_0x5b2101||0xcc;return function(_0x28697b){if(_0x28697b){return _0x2c1e33['sendStatus'](_0x5b2101);}return _0x2c1e33[_0x63a5('0x17')](_0x5b2101)['end']();};}function respondWithResult(_0x339c49,_0x503325){_0x503325=_0x503325||0xc8;return function(_0x4d36d9){if(_0x4d36d9){return _0x339c49['status'](_0x503325)['json'](_0x4d36d9);}};}function respondWithFilteredResult(_0x5372d4,_0xc3c510){return function(_0x32205d){if(_0x32205d){var _0x4cd1fa=typeof _0xc3c510[_0x63a5('0x18')]===_0x63a5('0x19')&&typeof _0xc3c510[_0x63a5('0x1a')]===_0x63a5('0x19');var _0x27c04a=_0x32205d['count'];var _0x3d702a=_0x4cd1fa?0x0:_0xc3c510['offset'];var _0x217e14=_0x4cd1fa?_0x32205d[_0x63a5('0x1b')]:_0xc3c510[_0x63a5('0x18')]+_0xc3c510[_0x63a5('0x1a')];var _0x10b54f;if(_0x217e14>=_0x27c04a){_0x217e14=_0x27c04a;_0x10b54f=0xc8;}else{_0x10b54f=0xce;}_0x5372d4['status'](_0x10b54f);return _0x5372d4['set'](_0x63a5('0x1c'),_0x3d702a+'-'+_0x217e14+'/'+_0x27c04a)[_0x63a5('0x1d')](_0x32205d);}return null;};}function patchUpdates(_0x154836){return function(_0x34470e){try{jsonpatch[_0x63a5('0x1e')](_0x34470e,_0x154836,!![]);}catch(_0x32a5af){return BPromise[_0x63a5('0x1f')](_0x32a5af);}return _0x34470e[_0x63a5('0x20')]();};}function saveUpdates(_0x50082f,_0x3c2464){return function(_0x1763ea){if(_0x1763ea){return _0x1763ea[_0x63a5('0x21')](_0x50082f)[_0x63a5('0x22')](function(_0x393f3c){return _0x393f3c;});}return null;};}function removeEntity(_0x44d482,_0x595f9b){return function(_0x39b76f){if(_0x39b76f){return _0x39b76f[_0x63a5('0x23')]()['then'](function(){_0x44d482[_0x63a5('0x17')](0xcc)[_0x63a5('0x24')]();});}};}function handleEntityNotFound(_0x14d839,_0x27f2c9){return function(_0x1ff8b5){if(!_0x1ff8b5){_0x14d839['sendStatus'](0x194);}return _0x1ff8b5;};}function handleError(_0x176f68,_0x4d2039){_0x4d2039=_0x4d2039||0x1f4;return function(_0x3382b0){logger[_0x63a5('0x25')](_0x3382b0[_0x63a5('0x26')]);if(_0x3382b0[_0x63a5('0x27')]){delete _0x3382b0['name'];}_0x176f68[_0x63a5('0x17')](_0x4d2039)[_0x63a5('0x28')](_0x3382b0);};}exports[_0x63a5('0x29')]=function(_0x177fdb,_0x3e04d0){var _0x135d18={},_0xd8dad0={},_0x5740f4={'count':0x0,'rows':[]};var _0x23ede5=_[_0x63a5('0x2a')](db['VtigerAccount'][_0x63a5('0x2b')],function(_0x20b4b3){return{'name':_0x20b4b3[_0x63a5('0x2c')],'type':_0x20b4b3[_0x63a5('0x2d')][_0x63a5('0x2e')]};});_0xd8dad0['model']=_[_0x63a5('0x2a')](_0x23ede5,_0x63a5('0x27'));_0xd8dad0[_0x63a5('0x2f')]=_['keys'](_0x177fdb['query']);_0xd8dad0[_0x63a5('0x30')]=_[_0x63a5('0x31')](_0xd8dad0[_0x63a5('0x32')],_0xd8dad0[_0x63a5('0x2f')]);_0x135d18[_0x63a5('0x33')]=_[_0x63a5('0x31')](_0xd8dad0['model'],qs[_0x63a5('0x34')](_0x177fdb[_0x63a5('0x2f')][_0x63a5('0x34')]));_0x135d18[_0x63a5('0x33')]=_0x135d18[_0x63a5('0x33')]['length']?_0x135d18[_0x63a5('0x33')]:_0xd8dad0[_0x63a5('0x32')];if(!_0x177fdb[_0x63a5('0x2f')][_0x63a5('0x35')]('nolimit')){_0x135d18[_0x63a5('0x1a')]=qs[_0x63a5('0x1a')](_0x177fdb[_0x63a5('0x2f')][_0x63a5('0x1a')]);_0x135d18[_0x63a5('0x18')]=qs[_0x63a5('0x18')](_0x177fdb[_0x63a5('0x2f')][_0x63a5('0x18')]);}_0x135d18['order']=qs[_0x63a5('0x36')](_0x177fdb[_0x63a5('0x2f')][_0x63a5('0x36')]);_0x135d18[_0x63a5('0x37')]=qs[_0x63a5('0x30')](_[_0x63a5('0x38')](_0x177fdb['query'],_0xd8dad0[_0x63a5('0x30')]),_0x23ede5);if(_0x177fdb[_0x63a5('0x2f')][_0x63a5('0x39')]){_0x135d18[_0x63a5('0x37')]=_['merge'](_0x135d18[_0x63a5('0x37')],{'$or':_[_0x63a5('0x2a')](_0x23ede5,function(_0x441ed){if(_0x441ed['type']!==_0x63a5('0x3a')){var _0x4f5fec={};_0x4f5fec[_0x441ed[_0x63a5('0x27')]]={'$like':'%'+_0x177fdb[_0x63a5('0x2f')][_0x63a5('0x39')]+'%'};return _0x4f5fec;}})});}_0x135d18=_[_0x63a5('0x3b')]({},_0x135d18,_0x177fdb[_0x63a5('0x3c')]);var _0x3eb9a5={'where':_0x135d18[_0x63a5('0x37')]};return db[_0x63a5('0x3d')][_0x63a5('0x1b')](_0x3eb9a5)[_0x63a5('0x22')](function(_0x5f3538){_0x5740f4[_0x63a5('0x1b')]=_0x5f3538;if(_0x177fdb[_0x63a5('0x2f')]['includeAll']){_0x135d18['include']=[{'all':!![]}];}return db[_0x63a5('0x3d')]['findAll'](_0x135d18);})[_0x63a5('0x22')](function(_0x56735e){_0x5740f4[_0x63a5('0x3e')]=_0x56735e;return _0x5740f4;})[_0x63a5('0x22')](respondWithFilteredResult(_0x3e04d0,_0x135d18))[_0x63a5('0x3f')](handleError(_0x3e04d0,null));};exports[_0x63a5('0x40')]=function(_0x1c743e,_0xd1bd23){var _0xf83734={'raw':![],'where':{'id':_0x1c743e[_0x63a5('0x41')]['id']}},_0x22f581={};_0x22f581[_0x63a5('0x32')]=_['keys'](db['VtigerAccount'][_0x63a5('0x2b')]);_0x22f581['query']=_[_0x63a5('0x42')](_0x1c743e['query']);_0x22f581[_0x63a5('0x30')]=_[_0x63a5('0x31')](_0x22f581['model'],_0x22f581[_0x63a5('0x2f')]);_0xf83734[_0x63a5('0x33')]=_['intersection'](_0x22f581[_0x63a5('0x32')],qs[_0x63a5('0x34')](_0x1c743e[_0x63a5('0x2f')][_0x63a5('0x34')]));_0xf83734[_0x63a5('0x33')]=_0xf83734[_0x63a5('0x33')]['length']?_0xf83734['attributes']:_0x22f581['model'];if(_0x1c743e[_0x63a5('0x2f')][_0x63a5('0x43')]){_0xf83734['include']=[{'all':!![]}];}_0xf83734=_['merge']({},_0xf83734,_0x1c743e[_0x63a5('0x3c')]);return db[_0x63a5('0x3d')]['find'](_0xf83734)[_0x63a5('0x22')](handleEntityNotFound(_0xd1bd23,null))[_0x63a5('0x22')](respondWithResult(_0xd1bd23,null))[_0x63a5('0x3f')](handleError(_0xd1bd23,null));};exports[_0x63a5('0x44')]=function(_0x21fe3d,_0x374d78){return db[_0x63a5('0x3d')][_0x63a5('0x44')](_0x21fe3d[_0x63a5('0x45')],{})[_0x63a5('0x22')](respondWithResult(_0x374d78,0xc9))[_0x63a5('0x3f')](handleError(_0x374d78,null));};exports['update']=function(_0x3d1b94,_0x549589){if(_0x3d1b94[_0x63a5('0x45')]['id']){delete _0x3d1b94[_0x63a5('0x45')]['id'];}return db['VtigerAccount'][_0x63a5('0x46')]({'where':{'id':_0x3d1b94[_0x63a5('0x41')]['id']}})['then'](handleEntityNotFound(_0x549589,null))['then'](saveUpdates(_0x3d1b94[_0x63a5('0x45')],null))[_0x63a5('0x22')](respondWithResult(_0x549589,null))['catch'](handleError(_0x549589,null));};exports[_0x63a5('0x23')]=function(_0x2de8b8,_0x363f8c){return db[_0x63a5('0x3d')][_0x63a5('0x46')]({'where':{'id':_0x2de8b8[_0x63a5('0x41')]['id']}})[_0x63a5('0x22')](handleEntityNotFound(_0x363f8c,null))[_0x63a5('0x22')](removeEntity(_0x363f8c,null))[_0x63a5('0x3f')](handleError(_0x363f8c,null));};exports['getConfigurations']=function(_0x3c263f,_0x57e57f,_0x3e3ab5){var _0x507af6={};var _0x7741eb={};var _0x55e0cf;var _0x2694d3;return db['VtigerAccount'][_0x63a5('0x47')]({'where':{'id':_0x3c263f['params']['id']}})[_0x63a5('0x22')](handleEntityNotFound(_0x57e57f,null))[_0x63a5('0x22')](function(_0x245de6){if(_0x245de6){_0x55e0cf=_0x245de6;_0x7741eb[_0x63a5('0x32')]=_[_0x63a5('0x42')](db['VtigerConfiguration']['rawAttributes']);_0x7741eb['query']=_['keys'](_0x3c263f[_0x63a5('0x2f')]);_0x7741eb[_0x63a5('0x30')]=_[_0x63a5('0x31')](_0x7741eb[_0x63a5('0x32')],_0x7741eb['query']);_0x507af6[_0x63a5('0x33')]=_[_0x63a5('0x31')](_0x7741eb[_0x63a5('0x32')],qs[_0x63a5('0x34')](_0x3c263f[_0x63a5('0x2f')]['fields']));_0x507af6[_0x63a5('0x33')]=_0x507af6[_0x63a5('0x33')][_0x63a5('0x48')]?_0x507af6[_0x63a5('0x33')]:_0x7741eb[_0x63a5('0x32')];_0x507af6[_0x63a5('0x49')]=qs[_0x63a5('0x36')](_0x3c263f[_0x63a5('0x2f')][_0x63a5('0x36')]);_0x507af6[_0x63a5('0x37')]=qs[_0x63a5('0x30')](_[_0x63a5('0x38')](_0x3c263f['query'],_0x7741eb[_0x63a5('0x30')]));if(_0x3c263f[_0x63a5('0x2f')]['filter']){_0x507af6[_0x63a5('0x37')]=_[_0x63a5('0x3b')](_0x507af6[_0x63a5('0x37')],{'$or':_[_0x63a5('0x2a')](_0x507af6[_0x63a5('0x33')],function(_0x2a8d38){var _0x2af992={};_0x2af992[_0x2a8d38]={'$like':'%'+_0x3c263f[_0x63a5('0x2f')][_0x63a5('0x39')]+'%'};return _0x2af992;})});}_0x507af6=_[_0x63a5('0x3b')]({},_0x507af6,_0x3c263f[_0x63a5('0x3c')]);return _0x55e0cf[_0x63a5('0x4a')](_0x507af6);}})[_0x63a5('0x22')](function(_0x1abb49){if(_0x1abb49){_0x2694d3=_0x1abb49[_0x63a5('0x48')];if(!_0x3c263f[_0x63a5('0x2f')][_0x63a5('0x35')](_0x63a5('0x4b'))){_0x507af6[_0x63a5('0x1a')]=qs[_0x63a5('0x1a')](_0x3c263f[_0x63a5('0x2f')]['limit']);_0x507af6['offset']=qs[_0x63a5('0x18')](_0x3c263f['query'][_0x63a5('0x18')]);}return _0x55e0cf[_0x63a5('0x4a')](_0x507af6);}})[_0x63a5('0x22')](function(_0x39bbf2){if(_0x39bbf2){return _0x39bbf2?{'count':_0x2694d3,'rows':_0x39bbf2}:null;}})['then'](respondWithResult(_0x57e57f,null))['catch'](handleError(_0x57e57f,null));};exports['addConfiguration']=function(_0x4eecf1,_0x3f0a95,_0x4b6941){if(_0x4eecf1[_0x63a5('0x45')]['id']){delete _0x4eecf1[_0x63a5('0x45')]['id'];}return db[_0x63a5('0x3d')][_0x63a5('0x47')]({'where':{'id':_0x4eecf1[_0x63a5('0x41')]['id']}})[_0x63a5('0x22')](handleEntityNotFound(_0x3f0a95,null))[_0x63a5('0x22')](function(_0x55dd5e){if(_0x55dd5e){_0x4eecf1['body'][_0x63a5('0x4c')]=_0x55dd5e['id'];_0x4eecf1[_0x63a5('0x45')][_0x63a5('0x4d')]=integrations[_0x63a5('0x4e')](_0x4eecf1[_0x63a5('0x45')][_0x63a5('0x4f')],_0x4eecf1[_0x63a5('0x45')][_0x63a5('0x2d')]);_0x4eecf1[_0x63a5('0x45')][_0x63a5('0x50')]=integrations[_0x63a5('0x51')](_0x4eecf1[_0x63a5('0x45')][_0x63a5('0x4f')],_0x4eecf1[_0x63a5('0x45')][_0x63a5('0x2d')]);return db[_0x63a5('0x52')][_0x63a5('0x44')](_0x4eecf1['body'],{'include':[{'model':db[_0x63a5('0x53')],'as':_0x63a5('0x4d')},{'model':db[_0x63a5('0x53')],'as':'Descriptions'}]});}return null;})[_0x63a5('0x22')](respondWithResult(_0x3f0a95,null))[_0x63a5('0x3f')](handleError(_0x3f0a95,null));};var md5=require(_0x63a5('0x54'));exports[_0x63a5('0x55')]=function(_0x2560bc,_0x31ef8c,_0x57e385){var _0x26e456=null;var _0x261ee5=null;var _0x3a3b2a=null;var _0x5c0176=null;var _0x5ea299='';return db[_0x63a5('0x3d')][_0x63a5('0x47')]({'where':{'id':_0x2560bc['params']['id']},'attributes':['id',_0x63a5('0x27'),_0x63a5('0x56'),_0x63a5('0x57'),_0x63a5('0x58'),_0x63a5('0x59'),_0x63a5('0x5a'),_0x63a5('0x5b')]})[_0x63a5('0x22')](handleEntityNotFound(_0x31ef8c,null))[_0x63a5('0x22')](function(_0x86dad0){if(_0x86dad0){_0x26e456=_0x86dad0['username'];_0x261ee5=_0x86dad0['accessKey'];_0x3a3b2a=_0x86dad0['moduleName'];_0x5ea299=_0x86dad0['remoteUri'];var _0x507b06=_0x5ea299[_0x63a5('0x5c')](-0x1);if(_0x507b06==='/'){_0x5ea299=_0x5ea299[_0x63a5('0x5d')](0x0,_0x5ea299[_0x63a5('0x5e')](_0x507b06));}_0x5c0176=util[_0x63a5('0x5f')]('%s/webservice.php',_0x5ea299);var _0x4258cd={'method':_0x63a5('0x60'),'uri':_0x5c0176,'qs':{'operation':_0x63a5('0x61'),'username':_0x86dad0['username']},'json':!![]};return rp(_0x4258cd);}})[_0x63a5('0x22')](function(_0x4e3849){if(_0x4e3849['success']){var _0x493c6a={'method':_0x63a5('0x62'),'uri':_0x5c0176,'form':{'operation':_0x63a5('0x63'),'username':_0x26e456,'accessKey':md5(_0x4e3849[_0x63a5('0x64')][_0x63a5('0x65')]+_0x261ee5)},'json':!![]};return rp(_0x493c6a);}})[_0x63a5('0x22')](function(_0x352bfc){if(_0x352bfc[_0x63a5('0x66')]){var _0x434218={'method':_0x63a5('0x60'),'uri':_0x5c0176,'qs':{'operation':_0x63a5('0x67'),'username':_0x26e456,'sessionName':_0x352bfc[_0x63a5('0x64')][_0x63a5('0x68')],'elementType':_0x3a3b2a},'json':!![]};return rp(_0x434218);}})[_0x63a5('0x22')](function(_0x143e45){if(_0x143e45[_0x63a5('0x66')]){var _0x2a5923=[_0x63a5('0x69'),_0x63a5('0x6a'),_0x63a5('0x6b')];_['remove'](_0x143e45[_0x63a5('0x64')]['fields'],function(_0x22a218){return _0x2a5923[_0x63a5('0x6c')](_0x22a218['type'][_0x63a5('0x27')]);});_[_0x63a5('0x6d')](_0x143e45['result']['fields'],function(_0x46f27e){return _0x46f27e[_0x63a5('0x6e')]==='false';});return{'count':_0x143e45[_0x63a5('0x64')][_0x63a5('0x34')][_0x63a5('0x48')],'rows':_['map'](_0x143e45[_0x63a5('0x64')][_0x63a5('0x34')],function(_0x3d056d){return{'id':_0x3d056d[_0x63a5('0x27')],'name':_0x3d056d[_0x63a5('0x6f')],'custom':_[_0x63a5('0x70')](_0x3d056d[_0x63a5('0x27')],'cf_')?!![]:![],'options':_0x3d056d[_0x63a5('0x2d')][_0x63a5('0x27')]==='picklist'&&_0x3d056d[_0x63a5('0x2d')][_0x63a5('0x71')]['length']>0x0?_[_0x63a5('0x2a')](_0x3d056d[_0x63a5('0x2d')][_0x63a5('0x71')],function(_0xdf9ece){return{'name':_0xdf9ece[_0x63a5('0x6f')],'value':_0xdf9ece['value']};}):[]};})};}})[_0x63a5('0x22')](respondWithResult(_0x31ef8c,null))['catch'](function(_0x198696){console[_0x63a5('0x72')](_0x63a5('0x73')+_0x198696);var _0x422814=_0x2560bc['query'][_0x63a5('0x74')]?0x1f4:_0x198696['statusCode']||0x1f4;logger[_0x63a5('0x25')](_0x63a5('0x75'),_0x63a5('0x55'),_0x422814,JSON['stringify'](_0x198696));delete _0x198696['name'];if(_0x422814===0x191){_0x422814=0x190;}_0x31ef8c['status'](_0x422814)['send'](_0x2560bc['query'][_0x63a5('0x74')]?{'message':_0x63a5('0x76'),'statusCode':_0x198696[_0x63a5('0x77')]}:_0x198696);});}; \ No newline at end of file +var _0x09ff=['accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','describe','sessionName','autogenerated','reference','remove','includes','editable','false','label','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VtigerAccount','fieldName','map','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','channel','VtigerField','Descriptions','md5','getFields','username','moduleName','remoteUri','serverUrl'];(function(_0xbcf90d,_0x1621fc){var _0x179d24=function(_0x38aff6){while(--_0x38aff6){_0xbcf90d['push'](_0xbcf90d['shift']());}};_0x179d24(++_0x1621fc);}(_0x09ff,0x9b));var _0xf09f=function(_0x3e85a7,_0x4557af){_0x3e85a7=_0x3e85a7-0x0;var _0x3b3d82=_0x09ff[_0x3e85a7];return _0x3b3d82;};'use strict';var emlformat=require(_0xf09f('0x0'));var rimraf=require(_0xf09f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf09f('0x2'));var rp=require('request-promise');var moment=require(_0xf09f('0x3'));var BPromise=require(_0xf09f('0x4'));var Mustache=require('mustache');var util=require(_0xf09f('0x5'));var path=require(_0xf09f('0x6'));var sox=require(_0xf09f('0x7'));var csv=require('to-csv');var ejs=require(_0xf09f('0x8'));var fs=require('fs');var fs_extra=require(_0xf09f('0x9'));var _=require(_0xf09f('0xa'));var squel=require('squel');var crypto=require(_0xf09f('0xb'));var jsforce=require(_0xf09f('0xc'));var deskjs=require(_0xf09f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf09f('0xe'));var Papa=require(_0xf09f('0xf'));var Redis=require(_0xf09f('0x10'));var authService=require(_0xf09f('0x11'));var qs=require(_0xf09f('0x12'));var as=require(_0xf09f('0x13'));var hardwareService=require(_0xf09f('0x14'));var logger=require('../../config/logger')(_0xf09f('0x15'));var utils=require(_0xf09f('0x16'));var config=require(_0xf09f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf09f('0x18'));function respondWithStatusCode(_0xf4d4b0,_0x3a99a5){_0x3a99a5=_0x3a99a5||0xcc;return function(_0x3ab43d){if(_0x3ab43d){return _0xf4d4b0['sendStatus'](_0x3a99a5);}return _0xf4d4b0[_0xf09f('0x19')](_0x3a99a5)[_0xf09f('0x1a')]();};}function respondWithResult(_0x2a7a11,_0x1dd0f1){_0x1dd0f1=_0x1dd0f1||0xc8;return function(_0x2e3d97){if(_0x2e3d97){return _0x2a7a11[_0xf09f('0x19')](_0x1dd0f1)[_0xf09f('0x1b')](_0x2e3d97);}};}function respondWithFilteredResult(_0x45ff27,_0x29b16e){return function(_0x45729c){if(_0x45729c){var _0xce3f4d=typeof _0x29b16e[_0xf09f('0x1c')]===_0xf09f('0x1d')&&typeof _0x29b16e['limit']==='undefined';var _0x4d9527=_0x45729c['count'];var _0x1bfe52=_0xce3f4d?0x0:_0x29b16e[_0xf09f('0x1c')];var _0x48ee22=_0xce3f4d?_0x45729c['count']:_0x29b16e[_0xf09f('0x1c')]+_0x29b16e[_0xf09f('0x1e')];var _0x281f2c;if(_0x48ee22>=_0x4d9527){_0x48ee22=_0x4d9527;_0x281f2c=0xc8;}else{_0x281f2c=0xce;}_0x45ff27[_0xf09f('0x19')](_0x281f2c);return _0x45ff27[_0xf09f('0x1f')](_0xf09f('0x20'),_0x1bfe52+'-'+_0x48ee22+'/'+_0x4d9527)[_0xf09f('0x1b')](_0x45729c);}return null;};}function patchUpdates(_0x5e38cc){return function(_0x17ab73){try{jsonpatch[_0xf09f('0x21')](_0x17ab73,_0x5e38cc,!![]);}catch(_0x20253b){return BPromise[_0xf09f('0x22')](_0x20253b);}return _0x17ab73[_0xf09f('0x23')]();};}function saveUpdates(_0x278186,_0x1cd500){return function(_0x584c7c){if(_0x584c7c){return _0x584c7c[_0xf09f('0x24')](_0x278186)[_0xf09f('0x25')](function(_0x374023){return _0x374023;});}return null;};}function removeEntity(_0x150adb,_0x452d34){return function(_0xcbe7f9){if(_0xcbe7f9){return _0xcbe7f9[_0xf09f('0x26')]()[_0xf09f('0x25')](function(){_0x150adb[_0xf09f('0x19')](0xcc)[_0xf09f('0x1a')]();});}};}function handleEntityNotFound(_0x4623bb,_0x37a5ec){return function(_0x15ed03){if(!_0x15ed03){_0x4623bb[_0xf09f('0x27')](0x194);}return _0x15ed03;};}function handleError(_0x4a9628,_0x3710ff){_0x3710ff=_0x3710ff||0x1f4;return function(_0x3af3b5){logger[_0xf09f('0x28')](_0x3af3b5[_0xf09f('0x29')]);if(_0x3af3b5[_0xf09f('0x2a')]){delete _0x3af3b5['name'];}_0x4a9628[_0xf09f('0x19')](_0x3710ff)[_0xf09f('0x2b')](_0x3af3b5);};}exports[_0xf09f('0x2c')]=function(_0x328bbf,_0x3f6eb1){var _0x3ca3e7={},_0x2a2249={},_0x5ef104={'count':0x0,'rows':[]};var _0x4b34a8=_['map'](db[_0xf09f('0x2d')]['rawAttributes'],function(_0x3a0e23){return{'name':_0x3a0e23[_0xf09f('0x2e')],'type':_0x3a0e23['type']['key']};});_0x2a2249['model']=_[_0xf09f('0x2f')](_0x4b34a8,_0xf09f('0x2a'));_0x2a2249[_0xf09f('0x30')]=_[_0xf09f('0x31')](_0x328bbf[_0xf09f('0x30')]);_0x2a2249[_0xf09f('0x32')]=_['intersection'](_0x2a2249[_0xf09f('0x33')],_0x2a2249[_0xf09f('0x30')]);_0x3ca3e7[_0xf09f('0x34')]=_['intersection'](_0x2a2249[_0xf09f('0x33')],qs[_0xf09f('0x35')](_0x328bbf[_0xf09f('0x30')][_0xf09f('0x35')]));_0x3ca3e7[_0xf09f('0x34')]=_0x3ca3e7[_0xf09f('0x34')][_0xf09f('0x36')]?_0x3ca3e7[_0xf09f('0x34')]:_0x2a2249['model'];if(!_0x328bbf[_0xf09f('0x30')]['hasOwnProperty'](_0xf09f('0x37'))){_0x3ca3e7[_0xf09f('0x1e')]=qs[_0xf09f('0x1e')](_0x328bbf[_0xf09f('0x30')]['limit']);_0x3ca3e7[_0xf09f('0x1c')]=qs[_0xf09f('0x1c')](_0x328bbf['query'][_0xf09f('0x1c')]);}_0x3ca3e7[_0xf09f('0x38')]=qs[_0xf09f('0x39')](_0x328bbf['query']['sort']);_0x3ca3e7[_0xf09f('0x3a')]=qs[_0xf09f('0x32')](_['pick'](_0x328bbf['query'],_0x2a2249['filters']),_0x4b34a8);if(_0x328bbf[_0xf09f('0x30')][_0xf09f('0x3b')]){_0x3ca3e7[_0xf09f('0x3a')]=_[_0xf09f('0x3c')](_0x3ca3e7[_0xf09f('0x3a')],{'$or':_[_0xf09f('0x2f')](_0x4b34a8,function(_0x5e9992){if(_0x5e9992[_0xf09f('0x3d')]!==_0xf09f('0x3e')){var _0x477e0c={};_0x477e0c[_0x5e9992[_0xf09f('0x2a')]]={'$like':'%'+_0x328bbf[_0xf09f('0x30')]['filter']+'%'};return _0x477e0c;}})});}_0x3ca3e7=_[_0xf09f('0x3c')]({},_0x3ca3e7,_0x328bbf[_0xf09f('0x3f')]);var _0x227f59={'where':_0x3ca3e7[_0xf09f('0x3a')]};return db[_0xf09f('0x2d')][_0xf09f('0x40')](_0x227f59)[_0xf09f('0x25')](function(_0x2f85bf){_0x5ef104['count']=_0x2f85bf;if(_0x328bbf[_0xf09f('0x30')][_0xf09f('0x41')]){_0x3ca3e7[_0xf09f('0x42')]=[{'all':!![]}];}return db['VtigerAccount'][_0xf09f('0x43')](_0x3ca3e7);})[_0xf09f('0x25')](function(_0x1ab838){_0x5ef104[_0xf09f('0x44')]=_0x1ab838;return _0x5ef104;})[_0xf09f('0x25')](respondWithFilteredResult(_0x3f6eb1,_0x3ca3e7))[_0xf09f('0x45')](handleError(_0x3f6eb1,null));};exports[_0xf09f('0x46')]=function(_0x1bf6a7,_0x4709db){var _0x380a2e={'raw':![],'where':{'id':_0x1bf6a7[_0xf09f('0x47')]['id']}},_0x4c6e85={};_0x4c6e85[_0xf09f('0x33')]=_[_0xf09f('0x31')](db[_0xf09f('0x2d')][_0xf09f('0x48')]);_0x4c6e85['query']=_[_0xf09f('0x31')](_0x1bf6a7['query']);_0x4c6e85[_0xf09f('0x32')]=_[_0xf09f('0x49')](_0x4c6e85['model'],_0x4c6e85[_0xf09f('0x30')]);_0x380a2e['attributes']=_['intersection'](_0x4c6e85['model'],qs[_0xf09f('0x35')](_0x1bf6a7[_0xf09f('0x30')][_0xf09f('0x35')]));_0x380a2e[_0xf09f('0x34')]=_0x380a2e[_0xf09f('0x34')][_0xf09f('0x36')]?_0x380a2e[_0xf09f('0x34')]:_0x4c6e85[_0xf09f('0x33')];if(_0x1bf6a7[_0xf09f('0x30')][_0xf09f('0x41')]){_0x380a2e[_0xf09f('0x42')]=[{'all':!![]}];}_0x380a2e=_['merge']({},_0x380a2e,_0x1bf6a7['options']);return db[_0xf09f('0x2d')][_0xf09f('0x4a')](_0x380a2e)[_0xf09f('0x25')](handleEntityNotFound(_0x4709db,null))['then'](respondWithResult(_0x4709db,null))[_0xf09f('0x45')](handleError(_0x4709db,null));};exports[_0xf09f('0x4b')]=function(_0x1ada43,_0x382d85){return db['VtigerAccount']['create'](_0x1ada43[_0xf09f('0x4c')],{})['then'](respondWithResult(_0x382d85,0xc9))[_0xf09f('0x45')](handleError(_0x382d85,null));};exports['update']=function(_0x57136a,_0x3268db){if(_0x57136a[_0xf09f('0x4c')]['id']){delete _0x57136a['body']['id'];}return db[_0xf09f('0x2d')][_0xf09f('0x4a')]({'where':{'id':_0x57136a[_0xf09f('0x47')]['id']}})[_0xf09f('0x25')](handleEntityNotFound(_0x3268db,null))[_0xf09f('0x25')](saveUpdates(_0x57136a[_0xf09f('0x4c')],null))[_0xf09f('0x25')](respondWithResult(_0x3268db,null))[_0xf09f('0x45')](handleError(_0x3268db,null));};exports[_0xf09f('0x26')]=function(_0x5777e1,_0x268c88){return db[_0xf09f('0x2d')][_0xf09f('0x4a')]({'where':{'id':_0x5777e1['params']['id']}})[_0xf09f('0x25')](handleEntityNotFound(_0x268c88,null))[_0xf09f('0x25')](removeEntity(_0x268c88,null))[_0xf09f('0x45')](handleError(_0x268c88,null));};exports[_0xf09f('0x4d')]=function(_0x1eb8b8,_0x25550c,_0x1a7558){var _0x71fb68={};var _0xebc9cb={};var _0x4c8c89;var _0x3d3106;return db[_0xf09f('0x2d')][_0xf09f('0x4e')]({'where':{'id':_0x1eb8b8[_0xf09f('0x47')]['id']}})['then'](handleEntityNotFound(_0x25550c,null))[_0xf09f('0x25')](function(_0x1973da){if(_0x1973da){_0x4c8c89=_0x1973da;_0xebc9cb[_0xf09f('0x33')]=_[_0xf09f('0x31')](db[_0xf09f('0x4f')][_0xf09f('0x48')]);_0xebc9cb[_0xf09f('0x30')]=_[_0xf09f('0x31')](_0x1eb8b8['query']);_0xebc9cb[_0xf09f('0x32')]=_[_0xf09f('0x49')](_0xebc9cb[_0xf09f('0x33')],_0xebc9cb['query']);_0x71fb68[_0xf09f('0x34')]=_[_0xf09f('0x49')](_0xebc9cb[_0xf09f('0x33')],qs[_0xf09f('0x35')](_0x1eb8b8[_0xf09f('0x30')][_0xf09f('0x35')]));_0x71fb68[_0xf09f('0x34')]=_0x71fb68[_0xf09f('0x34')][_0xf09f('0x36')]?_0x71fb68['attributes']:_0xebc9cb[_0xf09f('0x33')];_0x71fb68[_0xf09f('0x38')]=qs['sort'](_0x1eb8b8[_0xf09f('0x30')][_0xf09f('0x39')]);_0x71fb68['where']=qs[_0xf09f('0x32')](_[_0xf09f('0x50')](_0x1eb8b8['query'],_0xebc9cb['filters']));if(_0x1eb8b8[_0xf09f('0x30')]['filter']){_0x71fb68['where']=_[_0xf09f('0x3c')](_0x71fb68[_0xf09f('0x3a')],{'$or':_[_0xf09f('0x2f')](_0x71fb68['attributes'],function(_0x5738da){var _0x57ee12={};_0x57ee12[_0x5738da]={'$like':'%'+_0x1eb8b8[_0xf09f('0x30')][_0xf09f('0x3b')]+'%'};return _0x57ee12;})});}_0x71fb68=_['merge']({},_0x71fb68,_0x1eb8b8[_0xf09f('0x3f')]);return _0x4c8c89[_0xf09f('0x4d')](_0x71fb68);}})[_0xf09f('0x25')](function(_0x4cdc54){if(_0x4cdc54){_0x3d3106=_0x4cdc54[_0xf09f('0x36')];if(!_0x1eb8b8[_0xf09f('0x30')][_0xf09f('0x51')](_0xf09f('0x37'))){_0x71fb68[_0xf09f('0x1e')]=qs[_0xf09f('0x1e')](_0x1eb8b8['query'][_0xf09f('0x1e')]);_0x71fb68[_0xf09f('0x1c')]=qs[_0xf09f('0x1c')](_0x1eb8b8[_0xf09f('0x30')][_0xf09f('0x1c')]);}return _0x4c8c89[_0xf09f('0x4d')](_0x71fb68);}})[_0xf09f('0x25')](function(_0x302fe6){if(_0x302fe6){return _0x302fe6?{'count':_0x3d3106,'rows':_0x302fe6}:null;}})[_0xf09f('0x25')](respondWithResult(_0x25550c,null))[_0xf09f('0x45')](handleError(_0x25550c,null));};exports[_0xf09f('0x52')]=function(_0x562f71,_0x451811,_0x1d48e9){if(_0x562f71['body']['id']){delete _0x562f71[_0xf09f('0x4c')]['id'];}return db['VtigerAccount'][_0xf09f('0x4e')]({'where':{'id':_0x562f71[_0xf09f('0x47')]['id']}})[_0xf09f('0x25')](handleEntityNotFound(_0x451811,null))[_0xf09f('0x25')](function(_0x2952f6){if(_0x2952f6){_0x562f71[_0xf09f('0x4c')]['AccountId']=_0x2952f6['id'];_0x562f71['body'][_0xf09f('0x53')]=integrations['getSubjects'](_0x562f71['body']['channel'],_0x562f71[_0xf09f('0x4c')][_0xf09f('0x3d')]);_0x562f71['body']['Descriptions']=integrations['getDescriptions'](_0x562f71[_0xf09f('0x4c')][_0xf09f('0x54')],_0x562f71[_0xf09f('0x4c')][_0xf09f('0x3d')]);return db[_0xf09f('0x4f')][_0xf09f('0x4b')](_0x562f71['body'],{'include':[{'model':db[_0xf09f('0x55')],'as':_0xf09f('0x53')},{'model':db[_0xf09f('0x55')],'as':_0xf09f('0x56')}]});}return null;})[_0xf09f('0x25')](respondWithResult(_0x451811,null))['catch'](handleError(_0x451811,null));};var md5=require(_0xf09f('0x57'));exports[_0xf09f('0x58')]=function(_0x41837b,_0x4e9515,_0x1b6fcb){var _0x1806ea=null;var _0x2d7ed8=null;var _0x64050a=null;var _0x5e3d86=null;var _0x3d2f80='';return db[_0xf09f('0x2d')][_0xf09f('0x4e')]({'where':{'id':_0x41837b['params']['id']},'attributes':['id','name',_0xf09f('0x59'),'description',_0xf09f('0x5a'),_0xf09f('0x5b'),_0xf09f('0x5c'),'accessKey']})[_0xf09f('0x25')](handleEntityNotFound(_0x4e9515,null))[_0xf09f('0x25')](function(_0x266b23){if(_0x266b23){_0x1806ea=_0x266b23[_0xf09f('0x59')];_0x2d7ed8=_0x266b23[_0xf09f('0x5d')];_0x64050a=_0x266b23[_0xf09f('0x5a')];_0x3d2f80=_0x266b23[_0xf09f('0x5b')];var _0xbd1834=_0x3d2f80[_0xf09f('0x5e')](-0x1);if(_0xbd1834==='/'){_0x3d2f80=_0x3d2f80[_0xf09f('0x5f')](0x0,_0x3d2f80[_0xf09f('0x60')](_0xbd1834));}_0x5e3d86=util[_0xf09f('0x61')](_0xf09f('0x62'),_0x3d2f80);var _0x48fcf1={'method':_0xf09f('0x63'),'uri':_0x5e3d86,'qs':{'operation':'getchallenge','username':_0x266b23['username']},'json':!![]};return rp(_0x48fcf1);}})[_0xf09f('0x25')](function(_0x4eb3d4){if(_0x4eb3d4[_0xf09f('0x64')]){var _0x391ebb={'method':_0xf09f('0x65'),'uri':_0x5e3d86,'form':{'operation':_0xf09f('0x66'),'username':_0x1806ea,'accessKey':md5(_0x4eb3d4[_0xf09f('0x67')][_0xf09f('0x68')]+_0x2d7ed8)},'json':!![]};return rp(_0x391ebb);}})['then'](function(_0x38f5fb){if(_0x38f5fb[_0xf09f('0x64')]){var _0x2a217b={'method':_0xf09f('0x63'),'uri':_0x5e3d86,'qs':{'operation':_0xf09f('0x69'),'username':_0x1806ea,'sessionName':_0x38f5fb[_0xf09f('0x67')][_0xf09f('0x6a')],'elementType':_0x64050a},'json':!![]};return rp(_0x2a217b);}})[_0xf09f('0x25')](function(_0x193d46){if(_0x193d46[_0xf09f('0x64')]){var _0xad682e=[_0xf09f('0x6b'),_0xf09f('0x6c'),'owner'];_[_0xf09f('0x6d')](_0x193d46[_0xf09f('0x67')]['fields'],function(_0x315522){return _0xad682e[_0xf09f('0x6e')](_0x315522['type'][_0xf09f('0x2a')]);});_[_0xf09f('0x6d')](_0x193d46['result'][_0xf09f('0x35')],function(_0xf4a43b){return _0xf4a43b[_0xf09f('0x6f')]===_0xf09f('0x70');});return{'count':_0x193d46[_0xf09f('0x67')][_0xf09f('0x35')][_0xf09f('0x36')],'rows':_[_0xf09f('0x2f')](_0x193d46[_0xf09f('0x67')][_0xf09f('0x35')],function(_0x58fe39){return{'id':_0x58fe39[_0xf09f('0x2a')],'name':_0x58fe39[_0xf09f('0x71')],'custom':_['startsWith'](_0x58fe39[_0xf09f('0x2a')],_0xf09f('0x72'))?!![]:![],'options':_0x58fe39[_0xf09f('0x3d')][_0xf09f('0x2a')]===_0xf09f('0x73')&&_0x58fe39[_0xf09f('0x3d')][_0xf09f('0x74')][_0xf09f('0x36')]>0x0?_['map'](_0x58fe39['type']['picklistValues'],function(_0x54820a){return{'name':_0x54820a[_0xf09f('0x71')],'value':_0x54820a['value']};}):[]};})};}})[_0xf09f('0x25')](respondWithResult(_0x4e9515,null))[_0xf09f('0x45')](function(_0x23713f){console[_0xf09f('0x75')](_0xf09f('0x76')+_0x23713f);var _0x14f502=_0x41837b[_0xf09f('0x30')]['test']?0x1f4:_0x23713f['statusCode']||0x1f4;logger[_0xf09f('0x28')](_0xf09f('0x77'),'getFields',_0x14f502,JSON[_0xf09f('0x78')](_0x23713f));delete _0x23713f['name'];if(_0x14f502===0x191){_0x14f502=0x190;}_0x4e9515[_0xf09f('0x19')](_0x14f502)[_0xf09f('0x2b')](_0x41837b[_0xf09f('0x30')][_0xf09f('0x79')]?{'message':_0xf09f('0x7a'),'statusCode':_0x23713f[_0xf09f('0x7b')]}:_0x23713f);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 1cd6b6b..afa649a 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 _0x190d=['api','bluebird','path','rimraf','../../config/environment','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x353994,_0x13d629){var _0x120c19=function(_0x551c09){while(--_0x551c09){_0x353994['push'](_0x353994['shift']());}};_0x120c19(++_0x13d629);}(_0x190d,0x6c));var _0xd190=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x190d[_0x4687df];return _0x32eaef;};'use strict';var _=require(_0xd190('0x0'));var util=require(_0xd190('0x1'));var logger=require('../../config/logger')(_0xd190('0x2'));var moment=require('moment');var BPromise=require(_0xd190('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd190('0x4'));var rimraf=require(_0xd190('0x5'));var config=require(_0xd190('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xd190('0x7')]=function(_0x15df4b,_0xba1b1b){return _0x15df4b[_0xd190('0x8')](_0xd190('0x9'),attributes,{'tableName':_0xd190('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9651=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','int_vtiger_accounts'];(function(_0x53778e,_0x2e8efa){var _0x4f6069=function(_0x5d0c2c){while(--_0x5d0c2c){_0x53778e['push'](_0x53778e['shift']());}};_0x4f6069(++_0x2e8efa);}(_0x9651,0x1a0));var _0x1965=function(_0x51e120,_0xb66a96){_0x51e120=_0x51e120-0x0;var _0x1462ac=_0x9651[_0x51e120];return _0x1462ac;};'use strict';var _=require(_0x1965('0x0'));var util=require(_0x1965('0x1'));var logger=require(_0x1965('0x2'))(_0x1965('0x3'));var moment=require('moment');var BPromise=require(_0x1965('0x4'));var rp=require(_0x1965('0x5'));var fs=require('fs');var path=require(_0x1965('0x6'));var rimraf=require(_0x1965('0x7'));var config=require(_0x1965('0x8'));var attributes=require(_0x1965('0x9'));var integrations=require(_0x1965('0xa'));module[_0x1965('0xb')]=function(_0x389afb,_0x33ed82){return _0x389afb['define']('VtigerAccount',attributes,{'tableName':_0x1965('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 543758f..deb51a4 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 _0xda3f=['GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x16a7bc,_0x3ee4fb){var _0x54e51d=function(_0x37aa57){while(--_0x37aa57){_0x16a7bc['push'](_0x16a7bc['shift']());}};_0x54e51d(++_0x3ee4fb);}(_0xda3f,0xec));var _0xfda3=function(_0x29a213,_0x246795){_0x29a213=_0x29a213-0x0;var _0x54aef7=_0xda3f[_0x29a213];return _0x54aef7;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')]({'raw':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4680bf['options']?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'limit':_0x4680bf[_0xfda3('0x17')]?_0x4680bf['options'][_0xfda3('0x1a')]||null:null,'include':_0x4680bf[_0xfda3('0x17')]?_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4680bf[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0xc6fb9a){return{'model':db[_0xc6fb9a[_0xfda3('0x1d')]],'as':_0xc6fb9a['as'],'attributes':_0xc6fb9a['attributes'],'include':_0xc6fb9a[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc6fb9a[_0xfda3('0x1b')],function(_0x4ae9b9){return{'model':db[_0x4ae9b9[_0xfda3('0x1d')]],'as':_0x4ae9b9['as'],'attributes':_0x4ae9b9[_0xfda3('0x19')],'include':_0x4ae9b9[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4ae9b9[_0xfda3('0x1b')],function(_0xad9f7b){return{'model':db[_0xad9f7b['model']],'as':_0xad9f7b['as'],'attributes':_0xad9f7b[_0xfda3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2bef2b){logger[_0xfda3('0x9')](_0xfda3('0x14'),_0x4680bf);logger['debug'](_0xfda3('0x14'),_0x4680bf,JSON[_0xfda3('0xe')](_0x2bef2b));_0x54a7c6(_0x2bef2b);})[_0xfda3('0x13')](function(_0x474992){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0x474992[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6['error'](0x1f4,_0x474992['message']));});});};exports[_0xfda3('0x1e')]=function(_0x4fd277){var _0x4b9d90=this;return new Promise(function(_0x16b4a2,_0x2a5971){return db[_0xfda3('0x15')][_0xfda3('0x1f')]({'raw':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x18')]===undefined?!![]:![]:!![],'where':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')]['where']||null:null,'attributes':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x19')]||null:null,'include':_0x4fd277[_0xfda3('0x17')]?_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0x4fd277[_0xfda3('0x17')][_0xfda3('0x1b')],function(_0x59a1c9){return{'model':db[_0x59a1c9['model']],'as':_0x59a1c9['as'],'attributes':_0x59a1c9[_0xfda3('0x19')],'include':_0x59a1c9[_0xfda3('0x1b')]?_['map'](_0x59a1c9[_0xfda3('0x1b')],function(_0xc861d2){return{'model':db[_0xc861d2[_0xfda3('0x1d')]],'as':_0xc861d2['as'],'attributes':_0xc861d2['attributes'],'include':_0xc861d2[_0xfda3('0x1b')]?_[_0xfda3('0x1c')](_0xc861d2[_0xfda3('0x1b')],function(_0x3151e6){return{'model':db[_0x3151e6[_0xfda3('0x1d')]],'as':_0x3151e6['as'],'attributes':_0x3151e6['attributes']};}):[]};}):[]};}):[]:[]})[_0xfda3('0x8')](function(_0x2d2043){logger[_0xfda3('0x9')]('ShowVtigerAccount',_0x4fd277);logger[_0xfda3('0xc')]('ShowVtigerAccount',_0x4fd277,JSON[_0xfda3('0xe')](_0x2d2043));_0x16b4a2(_0x2d2043);})[_0xfda3('0x13')](function(_0x43a58a){logger[_0xfda3('0xf')](_0xfda3('0x1e'),_0x43a58a[_0xfda3('0x11')],_0x4fd277);_0x2a5971(_0x4b9d90[_0xfda3('0xf')](0x1f4,_0x43a58a[_0xfda3('0x11')]));});});}; \ No newline at end of file +var _0x13f6=['debug','stringify','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x169772,_0x217566){var _0x4ceb71=function(_0x8a8b36){while(--_0x8a8b36){_0x169772['push'](_0x169772['shift']());}};_0x4ceb71(++_0x217566);}(_0x13f6,0x124));var _0x613f=function(_0x22c6c5,_0x5ea632){_0x22c6c5=_0x22c6c5-0x0;var _0x38da93=_0x13f6[_0x22c6c5];return _0x38da93;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')]({'raw':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['where']||null:null,'attributes':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')]['attributes']||null:null,'limit':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')][_0x613f('0x19')]||null:null,'include':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x4f9dae[_0x613f('0x18')]['include'],function(_0x41104e){return{'model':db[_0x41104e[_0x613f('0x1c')]],'as':_0x41104e['as'],'attributes':_0x41104e[_0x613f('0x1d')],'include':_0x41104e[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x41104e['include'],function(_0x30fb15){return{'model':db[_0x30fb15[_0x613f('0x1c')]],'as':_0x30fb15['as'],'attributes':_0x30fb15['attributes'],'include':_0x30fb15[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x30fb15[_0x613f('0x1a')],function(_0x4a878d){return{'model':db[_0x4a878d['model']],'as':_0x4a878d['as'],'attributes':_0x4a878d['attributes']};}):[]};}):[]};}):[]:[]})[_0x613f('0xb')](function(_0x594c28){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x594c28));_0x1e5a11(_0x594c28);})['catch'](function(_0x4cff5d){logger['error'](_0x613f('0x15'),_0x4cff5d[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x4cff5d['message']));});});};exports[_0x613f('0x1e')]=function(_0x439478){var _0xd335a6=this;return new Promise(function(_0x19bb8f,_0x4f8500){return db[_0x613f('0x16')][_0x613f('0x1f')]({'raw':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')][_0x613f('0x20')]===undefined?!![]:![]:!![],'where':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x21')]||null:null,'attributes':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')]['attributes']||null:null,'include':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x439478[_0x613f('0x18')][_0x613f('0x1a')],function(_0x2bceaa){return{'model':db[_0x2bceaa[_0x613f('0x1c')]],'as':_0x2bceaa['as'],'attributes':_0x2bceaa['attributes'],'include':_0x2bceaa[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x2bceaa[_0x613f('0x1a')],function(_0x25b2e4){return{'model':db[_0x25b2e4[_0x613f('0x1c')]],'as':_0x25b2e4['as'],'attributes':_0x25b2e4['attributes'],'include':_0x25b2e4['include']?_['map'](_0x25b2e4[_0x613f('0x1a')],function(_0x72c804){return{'model':db[_0x72c804[_0x613f('0x1c')]],'as':_0x72c804['as'],'attributes':_0x72c804[_0x613f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fc02e){logger[_0x613f('0x13')]('ShowVtigerAccount',_0x439478);logger[_0x613f('0xe')]('ShowVtigerAccount',_0x439478,JSON[_0x613f('0xf')](_0x2fc02e));_0x19bb8f(_0x2fc02e);})['catch'](function(_0x36dfd4){logger['error'](_0x613f('0x1e'),_0x36dfd4[_0x613f('0x12')],_0x439478);_0x4f8500(_0xd335a6[_0x613f('0x10')](0x1f4,_0x36dfd4['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 06d09f3..0972873 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 _0x89ff=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','exports','multer'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x89ff,0x158));var _0xf89f=function(_0xc9b988,_0x429150){_0xc9b988=_0xc9b988-0x0;var _0x5f14fe=_0x89ff[_0xc9b988];return _0x5f14fe;};'use strict';var multer=require(_0xf89f('0x0'));var util=require(_0xf89f('0x1'));var path=require(_0xf89f('0x2'));var timeout=require(_0xf89f('0x3'));var express=require(_0xf89f('0x4'));var router=express[_0xf89f('0x5')]();var fs_extra=require(_0xf89f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf89f('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0xf89f('0x8')]('/',auth['isAuthenticated'](),controller[_0xf89f('0x9')]);router[_0xf89f('0x8')]('/:id',auth[_0xf89f('0xa')](),controller[_0xf89f('0xb')]);router[_0xf89f('0x8')](_0xf89f('0xc'),auth[_0xf89f('0xa')](),controller[_0xf89f('0xd')]);router[_0xf89f('0x8')](_0xf89f('0xe'),auth[_0xf89f('0xa')](),controller['getSubjects']);router[_0xf89f('0x8')](_0xf89f('0xf'),auth['isAuthenticated'](),controller[_0xf89f('0x10')]);router[_0xf89f('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf89f('0x12')](_0xf89f('0x13'),auth[_0xf89f('0xa')](),controller[_0xf89f('0x14')]);router['delete'](_0xf89f('0x13'),auth[_0xf89f('0xa')](),controller[_0xf89f('0x15')]);module[_0xf89f('0x16')]=router; \ No newline at end of file +var _0x4890=['index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x33f6c0,_0x29386c){var _0x11af8e=function(_0x9c2e23){while(--_0x9c2e23){_0x33f6c0['push'](_0x33f6c0['shift']());}};_0x11af8e(++_0x29386c);}(_0x4890,0x1ef));var _0x0489=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x4890[_0x4dab14];return _0xf41aa;};'use strict';var multer=require('multer');var util=require(_0x0489('0x0'));var path=require(_0x0489('0x1'));var timeout=require(_0x0489('0x2'));var express=require(_0x0489('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0489('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0489('0x5'));var controller=require(_0x0489('0x6'));router[_0x0489('0x7')]('/',auth[_0x0489('0x8')](),controller[_0x0489('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0489('0xa')]);router['get'](_0x0489('0xb'),auth[_0x0489('0x8')](),controller['getFields']);router[_0x0489('0x7')](_0x0489('0xc'),auth[_0x0489('0x8')](),controller[_0x0489('0xd')]);router[_0x0489('0x7')](_0x0489('0xe'),auth['isAuthenticated'](),controller[_0x0489('0xf')]);router['post']('/',auth[_0x0489('0x8')](),controller[_0x0489('0x10')]);router['put'](_0x0489('0x11'),auth['isAuthenticated'](),controller[_0x0489('0x12')]);router[_0x0489('0x13')](_0x0489('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0489('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c04763f..e0d468f 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 _0x2db2=['exports','STRING'];(function(_0x4b33d1,_0x2414e1){var _0x9e7221=function(_0x476ecc){while(--_0x476ecc){_0x4b33d1['push'](_0x4b33d1['shift']());}};_0x9e7221(++_0x2414e1);}(_0x2db2,0x1e0));var _0x22db=function(_0x11fc8b,_0x4ee51d){_0x11fc8b=_0x11fc8b-0x0;var _0x4ea86e=_0x2db2[_0x11fc8b];return _0x4ea86e;};'use strict';var Sequelize=require('sequelize');module[_0x22db('0x0')]={'name':{'type':Sequelize[_0x22db('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1816=['exports','STRING','sequelize'];(function(_0x257a5a,_0xa1ebf8){var _0x4ddb07=function(_0x4563df){while(--_0x4563df){_0x257a5a['push'](_0x257a5a['shift']());}};_0x4ddb07(++_0xa1ebf8);}(_0x1816,0x15b));var _0x6181=function(_0x2dda29,_0x55e0c1){_0x2dda29=_0x2dda29-0x0;var _0x233f30=_0x1816[_0x2dda29];return _0x233f30;};'use strict';var Sequelize=require(_0x6181('0x0'));module[_0x6181('0x1')]={'name':{'type':Sequelize[_0x6181('0x2')]},'description':{'type':Sequelize[_0x6181('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 04e4c42..6fe95df 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 _0x12ea=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','map','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getFields','findOne','VtigerField','order','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1afd3b,_0x212a08){var _0x21dd50=function(_0x42fdc2){while(--_0x42fdc2){_0x1afd3b['push'](_0x1afd3b['shift']());}};_0x21dd50(++_0x212a08);}(_0x12ea,0x124));var _0xa12e=function(_0x95c05a,_0x4e9602){_0x95c05a=_0x95c05a-0x0;var _0x4af2c0=_0x12ea[_0x95c05a];return _0x4af2c0;};'use strict';var emlformat=require(_0xa12e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa12e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa12e('0x2'));var Mustache=require(_0xa12e('0x3'));var util=require(_0xa12e('0x4'));var path=require(_0xa12e('0x5'));var sox=require(_0xa12e('0x6'));var csv=require(_0xa12e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa12e('0x8'));var crypto=require('crypto');var jsforce=require(_0xa12e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa12e('0x7'));var querystring=require(_0xa12e('0xa'));var Papa=require(_0xa12e('0xb'));var Redis=require(_0xa12e('0xc'));var authService=require(_0xa12e('0xd'));var qs=require(_0xa12e('0xe'));var as=require(_0xa12e('0xf'));var hardwareService=require(_0xa12e('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xa12e('0x11'));var config=require(_0xa12e('0x12'));var licenseUtil=require(_0xa12e('0x13'));var db=require(_0xa12e('0x14'))['db'];function respondWithStatusCode(_0x41e33,_0x4ada70){_0x4ada70=_0x4ada70||0xcc;return function(_0x33d6f7){if(_0x33d6f7){return _0x41e33[_0xa12e('0x15')](_0x4ada70);}return _0x41e33[_0xa12e('0x16')](_0x4ada70)[_0xa12e('0x17')]();};}function respondWithResult(_0x201b49,_0xfb0947){_0xfb0947=_0xfb0947||0xc8;return function(_0x4be2b6){if(_0x4be2b6){return _0x201b49[_0xa12e('0x16')](_0xfb0947)[_0xa12e('0x18')](_0x4be2b6);}};}function respondWithFilteredResult(_0x4ce875,_0x50184e){return function(_0x34d4ce){if(_0x34d4ce){var _0x3fd09b=typeof _0x50184e[_0xa12e('0x19')]===_0xa12e('0x1a')&&typeof _0x50184e['limit']===_0xa12e('0x1a');var _0x35017a=_0x34d4ce[_0xa12e('0x1b')];var _0x2bc5bd=_0x3fd09b?0x0:_0x50184e[_0xa12e('0x19')];var _0x519623=_0x3fd09b?_0x34d4ce['count']:_0x50184e[_0xa12e('0x19')]+_0x50184e['limit'];var _0x363b95;if(_0x519623>=_0x35017a){_0x519623=_0x35017a;_0x363b95=0xc8;}else{_0x363b95=0xce;}_0x4ce875[_0xa12e('0x16')](_0x363b95);return _0x4ce875[_0xa12e('0x1c')](_0xa12e('0x1d'),_0x2bc5bd+'-'+_0x519623+'/'+_0x35017a)[_0xa12e('0x18')](_0x34d4ce);}return null;};}function patchUpdates(_0x511563){return function(_0x1a8410){try{jsonpatch[_0xa12e('0x1e')](_0x1a8410,_0x511563,!![]);}catch(_0x40face){return BPromise[_0xa12e('0x1f')](_0x40face);}return _0x1a8410['save']();};}function saveUpdates(_0x5180dd,_0x5ca124){return function(_0x41c0e8){if(_0x41c0e8){return _0x41c0e8['update'](_0x5180dd)[_0xa12e('0x20')](function(_0x3a935b){return _0x3a935b;});}return null;};}function removeEntity(_0x6c2cfc,_0x34ba6c){return function(_0x64bf91){if(_0x64bf91){return _0x64bf91[_0xa12e('0x21')]()[_0xa12e('0x20')](function(){_0x6c2cfc[_0xa12e('0x16')](0xcc)[_0xa12e('0x17')]();});}};}function handleEntityNotFound(_0x1d27d1,_0x5cce34){return function(_0x5d331a){if(!_0x5d331a){_0x1d27d1[_0xa12e('0x15')](0x194);}return _0x5d331a;};}function handleError(_0x59fa2a,_0x2d0d8a){_0x2d0d8a=_0x2d0d8a||0x1f4;return function(_0x44cd05){logger[_0xa12e('0x22')](_0x44cd05[_0xa12e('0x23')]);if(_0x44cd05['name']){delete _0x44cd05['name'];}_0x59fa2a['status'](_0x2d0d8a)[_0xa12e('0x24')](_0x44cd05);};}exports[_0xa12e('0x25')]=function(_0x1dd38c,_0x2f15e7){var _0x4f363c={},_0x2e5f83={},_0x51d301={'count':0x0,'rows':[]};var _0x12f265=_['map'](db[_0xa12e('0x26')][_0xa12e('0x27')],function(_0x49c234){return{'name':_0x49c234[_0xa12e('0x28')],'type':_0x49c234[_0xa12e('0x29')][_0xa12e('0x2a')]};});_0x2e5f83[_0xa12e('0x2b')]=_['map'](_0x12f265,_0xa12e('0x2c'));_0x2e5f83['query']=_[_0xa12e('0x2d')](_0x1dd38c[_0xa12e('0x2e')]);_0x2e5f83[_0xa12e('0x2f')]=_[_0xa12e('0x30')](_0x2e5f83['model'],_0x2e5f83[_0xa12e('0x2e')]);_0x4f363c[_0xa12e('0x31')]=_[_0xa12e('0x30')](_0x2e5f83[_0xa12e('0x2b')],qs[_0xa12e('0x32')](_0x1dd38c['query']['fields']));_0x4f363c['attributes']=_0x4f363c['attributes'][_0xa12e('0x33')]?_0x4f363c['attributes']:_0x2e5f83[_0xa12e('0x2b')];if(!_0x1dd38c[_0xa12e('0x2e')][_0xa12e('0x34')]('nolimit')){_0x4f363c[_0xa12e('0x35')]=qs['limit'](_0x1dd38c[_0xa12e('0x2e')][_0xa12e('0x35')]);_0x4f363c[_0xa12e('0x19')]=qs[_0xa12e('0x19')](_0x1dd38c['query'][_0xa12e('0x19')]);}_0x4f363c['order']=qs[_0xa12e('0x36')](_0x1dd38c[_0xa12e('0x2e')][_0xa12e('0x36')]);_0x4f363c[_0xa12e('0x37')]=qs[_0xa12e('0x2f')](_[_0xa12e('0x38')](_0x1dd38c['query'],_0x2e5f83[_0xa12e('0x2f')]),_0x12f265);if(_0x1dd38c[_0xa12e('0x2e')]['filter']){_0x4f363c[_0xa12e('0x37')]=_['merge'](_0x4f363c[_0xa12e('0x37')],{'$or':_[_0xa12e('0x39')](_0x12f265,function(_0x13ea6c){if(_0x13ea6c[_0xa12e('0x29')]!=='VIRTUAL'){var _0x21f39a={};_0x21f39a[_0x13ea6c['name']]={'$like':'%'+_0x1dd38c[_0xa12e('0x2e')][_0xa12e('0x3a')]+'%'};return _0x21f39a;}})});}_0x4f363c=_['merge']({},_0x4f363c,_0x1dd38c[_0xa12e('0x3b')]);var _0x4af4e6={'where':_0x4f363c[_0xa12e('0x37')]};return db[_0xa12e('0x26')][_0xa12e('0x1b')](_0x4af4e6)[_0xa12e('0x20')](function(_0xcf095b){_0x51d301[_0xa12e('0x1b')]=_0xcf095b;if(_0x1dd38c[_0xa12e('0x2e')][_0xa12e('0x3c')]){_0x4f363c[_0xa12e('0x3d')]=[{'all':!![]}];}return db[_0xa12e('0x26')][_0xa12e('0x3e')](_0x4f363c);})['then'](function(_0x48a44f){_0x51d301[_0xa12e('0x3f')]=_0x48a44f;return _0x51d301;})[_0xa12e('0x20')](respondWithFilteredResult(_0x2f15e7,_0x4f363c))[_0xa12e('0x40')](handleError(_0x2f15e7,null));};exports[_0xa12e('0x41')]=function(_0x2e8749,_0x252c97){var _0x3a943e={'raw':![],'where':{'id':_0x2e8749[_0xa12e('0x42')]['id']}},_0x4bc26={};_0x4bc26[_0xa12e('0x2b')]=_[_0xa12e('0x2d')](db[_0xa12e('0x26')]['rawAttributes']);_0x4bc26[_0xa12e('0x2e')]=_['keys'](_0x2e8749['query']);_0x4bc26['filters']=_[_0xa12e('0x30')](_0x4bc26[_0xa12e('0x2b')],_0x4bc26[_0xa12e('0x2e')]);_0x3a943e['attributes']=_[_0xa12e('0x30')](_0x4bc26['model'],qs[_0xa12e('0x32')](_0x2e8749[_0xa12e('0x2e')]['fields']));_0x3a943e[_0xa12e('0x31')]=_0x3a943e['attributes'][_0xa12e('0x33')]?_0x3a943e[_0xa12e('0x31')]:_0x4bc26[_0xa12e('0x2b')];if(_0x2e8749[_0xa12e('0x2e')][_0xa12e('0x3c')]){_0x3a943e[_0xa12e('0x3d')]=[{'all':!![]}];}_0x3a943e=_[_0xa12e('0x43')]({},_0x3a943e,_0x2e8749[_0xa12e('0x3b')]);return db[_0xa12e('0x26')][_0xa12e('0x44')](_0x3a943e)[_0xa12e('0x20')](handleEntityNotFound(_0x252c97,null))['then'](respondWithResult(_0x252c97,null))[_0xa12e('0x40')](handleError(_0x252c97,null));};exports[_0xa12e('0x45')]=function(_0xd3d498,_0x25576e){return db[_0xa12e('0x26')]['create'](_0xd3d498[_0xa12e('0x46')],{})[_0xa12e('0x20')](respondWithResult(_0x25576e,0xc9))[_0xa12e('0x40')](handleError(_0x25576e,null));};exports['update']=function(_0x31bc00,_0x50e2cc){if(_0x31bc00[_0xa12e('0x46')]['id']){delete _0x31bc00[_0xa12e('0x46')]['id'];}return db[_0xa12e('0x26')]['find']({'where':{'id':_0x31bc00['params']['id']}})[_0xa12e('0x20')](handleEntityNotFound(_0x50e2cc,null))[_0xa12e('0x20')](saveUpdates(_0x31bc00[_0xa12e('0x46')],null))[_0xa12e('0x20')](respondWithResult(_0x50e2cc,null))['catch'](handleError(_0x50e2cc,null));};exports[_0xa12e('0x21')]=function(_0x52418c,_0x218b0d){return db['VtigerConfiguration'][_0xa12e('0x44')]({'where':{'id':_0x52418c[_0xa12e('0x42')]['id']}})[_0xa12e('0x20')](handleEntityNotFound(_0x218b0d,null))[_0xa12e('0x20')](removeEntity(_0x218b0d,null))[_0xa12e('0x40')](handleError(_0x218b0d,null));};exports[_0xa12e('0x47')]=function(_0x1586e7,_0x5905ed,_0x5ded6f){var _0x38a5b4={};var _0x4a4896={};var _0x290a16;var _0x380c99;return db[_0xa12e('0x26')][_0xa12e('0x48')]({'where':{'id':_0x1586e7[_0xa12e('0x42')]['id']}})[_0xa12e('0x20')](handleEntityNotFound(_0x5905ed,null))[_0xa12e('0x20')](function(_0x5666ec){if(_0x5666ec){_0x290a16=_0x5666ec;_0x4a4896[_0xa12e('0x2b')]=_[_0xa12e('0x2d')](db[_0xa12e('0x49')][_0xa12e('0x27')]);_0x4a4896[_0xa12e('0x2e')]=_[_0xa12e('0x2d')](_0x1586e7[_0xa12e('0x2e')]);_0x4a4896['filters']=_[_0xa12e('0x30')](_0x4a4896['model'],_0x4a4896[_0xa12e('0x2e')]);_0x38a5b4[_0xa12e('0x31')]=_[_0xa12e('0x30')](_0x4a4896[_0xa12e('0x2b')],qs['fields'](_0x1586e7[_0xa12e('0x2e')][_0xa12e('0x32')]));_0x38a5b4[_0xa12e('0x31')]=_0x38a5b4[_0xa12e('0x31')]['length']?_0x38a5b4[_0xa12e('0x31')]:_0x4a4896['model'];_0x38a5b4[_0xa12e('0x4a')]=qs[_0xa12e('0x36')](_0x1586e7[_0xa12e('0x2e')][_0xa12e('0x36')]);_0x38a5b4[_0xa12e('0x37')]=qs[_0xa12e('0x2f')](_['pick'](_0x1586e7[_0xa12e('0x2e')],_0x4a4896[_0xa12e('0x2f')]));if(_0x1586e7['query'][_0xa12e('0x3a')]){_0x38a5b4['where']=_[_0xa12e('0x43')](_0x38a5b4[_0xa12e('0x37')],{'$or':_[_0xa12e('0x39')](_0x38a5b4['attributes'],function(_0x1368c){var _0x5efc55={};_0x5efc55[_0x1368c]={'$like':'%'+_0x1586e7['query']['filter']+'%'};return _0x5efc55;})});}_0x38a5b4=_['merge']({},_0x38a5b4,_0x1586e7[_0xa12e('0x3b')]);return _0x290a16[_0xa12e('0x47')](_0x38a5b4);}})[_0xa12e('0x20')](function(_0xab1cbb){if(_0xab1cbb){_0x380c99=_0xab1cbb[_0xa12e('0x33')];if(!_0x1586e7['query'][_0xa12e('0x34')](_0xa12e('0x4b'))){_0x38a5b4[_0xa12e('0x35')]=qs[_0xa12e('0x35')](_0x1586e7[_0xa12e('0x2e')][_0xa12e('0x35')]);_0x38a5b4['offset']=qs[_0xa12e('0x19')](_0x1586e7['query']['offset']);}return _0x290a16['getFields'](_0x38a5b4);}})[_0xa12e('0x20')](function(_0x39fa94){if(_0x39fa94){return _0x39fa94?{'count':_0x380c99,'rows':_0x39fa94}:null;}})['then'](respondWithResult(_0x5905ed,null))[_0xa12e('0x40')](handleError(_0x5905ed,null));};exports[_0xa12e('0x4c')]=function(_0x165c4b,_0x5752af,_0x460296){var _0x3c2cb2={};var _0x18e73e={};var _0x5bb812;var _0x1a1828;return db['VtigerConfiguration'][_0xa12e('0x48')]({'where':{'id':_0x165c4b[_0xa12e('0x42')]['id']}})[_0xa12e('0x20')](handleEntityNotFound(_0x5752af,null))['then'](function(_0x2a8065){if(_0x2a8065){_0x5bb812=_0x2a8065;_0x18e73e[_0xa12e('0x2b')]=_['keys'](db[_0xa12e('0x49')]['rawAttributes']);_0x18e73e[_0xa12e('0x2e')]=_[_0xa12e('0x2d')](_0x165c4b['query']);_0x18e73e[_0xa12e('0x2f')]=_[_0xa12e('0x30')](_0x18e73e['model'],_0x18e73e['query']);_0x3c2cb2[_0xa12e('0x31')]=_['intersection'](_0x18e73e[_0xa12e('0x2b')],qs[_0xa12e('0x32')](_0x165c4b['query'][_0xa12e('0x32')]));_0x3c2cb2['attributes']=_0x3c2cb2[_0xa12e('0x31')][_0xa12e('0x33')]?_0x3c2cb2[_0xa12e('0x31')]:_0x18e73e[_0xa12e('0x2b')];_0x3c2cb2[_0xa12e('0x4a')]=qs[_0xa12e('0x36')](_0x165c4b[_0xa12e('0x2e')][_0xa12e('0x36')]);_0x3c2cb2[_0xa12e('0x37')]=qs['filters'](_[_0xa12e('0x38')](_0x165c4b[_0xa12e('0x2e')],_0x18e73e[_0xa12e('0x2f')]));if(_0x165c4b[_0xa12e('0x2e')][_0xa12e('0x3a')]){_0x3c2cb2['where']=_['merge'](_0x3c2cb2[_0xa12e('0x37')],{'$or':_[_0xa12e('0x39')](_0x3c2cb2[_0xa12e('0x31')],function(_0x4dcc9d){var _0x2c5c40={};_0x2c5c40[_0x4dcc9d]={'$like':'%'+_0x165c4b[_0xa12e('0x2e')]['filter']+'%'};return _0x2c5c40;})});}_0x3c2cb2=_[_0xa12e('0x43')]({},_0x3c2cb2,_0x165c4b[_0xa12e('0x3b')]);return _0x5bb812[_0xa12e('0x4c')](_0x3c2cb2);}})[_0xa12e('0x20')](function(_0x51b51c){if(_0x51b51c){_0x1a1828=_0x51b51c[_0xa12e('0x33')];if(!_0x165c4b['query'][_0xa12e('0x34')](_0xa12e('0x4b'))){_0x3c2cb2[_0xa12e('0x35')]=qs[_0xa12e('0x35')](_0x165c4b['query'][_0xa12e('0x35')]);_0x3c2cb2[_0xa12e('0x19')]=qs[_0xa12e('0x19')](_0x165c4b[_0xa12e('0x2e')][_0xa12e('0x19')]);}return _0x5bb812[_0xa12e('0x4c')](_0x3c2cb2);}})[_0xa12e('0x20')](function(_0x2947fe){if(_0x2947fe){return _0x2947fe?{'count':_0x1a1828,'rows':_0x2947fe}:null;}})['then'](respondWithResult(_0x5752af,null))['catch'](handleError(_0x5752af,null));};exports[_0xa12e('0x4d')]=function(_0x3e797c,_0xd91d22,_0x43eb82){var _0x23ef8c={};var _0x2d056d={};var _0x393321;var _0x1f19dd;return db[_0xa12e('0x26')][_0xa12e('0x48')]({'where':{'id':_0x3e797c['params']['id']}})[_0xa12e('0x20')](handleEntityNotFound(_0xd91d22,null))['then'](function(_0x224ddc){if(_0x224ddc){_0x393321=_0x224ddc;_0x2d056d['model']=_[_0xa12e('0x2d')](db['VtigerField'][_0xa12e('0x27')]);_0x2d056d[_0xa12e('0x2e')]=_[_0xa12e('0x2d')](_0x3e797c['query']);_0x2d056d[_0xa12e('0x2f')]=_[_0xa12e('0x30')](_0x2d056d[_0xa12e('0x2b')],_0x2d056d['query']);_0x23ef8c[_0xa12e('0x31')]=_['intersection'](_0x2d056d[_0xa12e('0x2b')],qs[_0xa12e('0x32')](_0x3e797c[_0xa12e('0x2e')][_0xa12e('0x32')]));_0x23ef8c[_0xa12e('0x31')]=_0x23ef8c[_0xa12e('0x31')]['length']?_0x23ef8c[_0xa12e('0x31')]:_0x2d056d[_0xa12e('0x2b')];_0x23ef8c[_0xa12e('0x4a')]=qs['sort'](_0x3e797c[_0xa12e('0x2e')][_0xa12e('0x36')]);_0x23ef8c[_0xa12e('0x37')]=qs[_0xa12e('0x2f')](_['pick'](_0x3e797c[_0xa12e('0x2e')],_0x2d056d[_0xa12e('0x2f')]));if(_0x3e797c['query']['filter']){_0x23ef8c[_0xa12e('0x37')]=_[_0xa12e('0x43')](_0x23ef8c[_0xa12e('0x37')],{'$or':_[_0xa12e('0x39')](_0x23ef8c['attributes'],function(_0x3d9f4d){var _0x2435ea={};_0x2435ea[_0x3d9f4d]={'$like':'%'+_0x3e797c[_0xa12e('0x2e')][_0xa12e('0x3a')]+'%'};return _0x2435ea;})});}_0x23ef8c=_[_0xa12e('0x43')]({},_0x23ef8c,_0x3e797c['options']);return _0x393321[_0xa12e('0x4d')](_0x23ef8c);}})[_0xa12e('0x20')](function(_0x405508){if(_0x405508){_0x1f19dd=_0x405508[_0xa12e('0x33')];if(!_0x3e797c[_0xa12e('0x2e')][_0xa12e('0x34')](_0xa12e('0x4b'))){_0x23ef8c['limit']=qs[_0xa12e('0x35')](_0x3e797c[_0xa12e('0x2e')]['limit']);_0x23ef8c[_0xa12e('0x19')]=qs[_0xa12e('0x19')](_0x3e797c[_0xa12e('0x2e')]['offset']);}return _0x393321[_0xa12e('0x4d')](_0x23ef8c);}})[_0xa12e('0x20')](function(_0x186d00){if(_0x186d00){return _0x186d00?{'count':_0x1f19dd,'rows':_0x186d00}:null;}})[_0xa12e('0x20')](respondWithResult(_0xd91d22,null))[_0xa12e('0x40')](handleError(_0xd91d22,null));}; \ No newline at end of file +var _0x69dd=['show','params','keys','catch','create','body','find','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','length','options','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','VtigerConfiguration','includeAll','include','findAll','rows'];(function(_0x2e6c58,_0x13aa0b){var _0x3b4f8b=function(_0x21148a){while(--_0x21148a){_0x2e6c58['push'](_0x2e6c58['shift']());}};_0x3b4f8b(++_0x13aa0b);}(_0x69dd,0x117));var _0xd69d=function(_0x42f6b1,_0x560c04){_0x42f6b1=_0x42f6b1-0x0;var _0x39b69f=_0x69dd[_0x42f6b1];return _0x39b69f;};'use strict';var emlformat=require(_0xd69d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd69d('0x1'));var jsonpatch=require(_0xd69d('0x2'));var rp=require(_0xd69d('0x3'));var moment=require(_0xd69d('0x4'));var BPromise=require(_0xd69d('0x5'));var Mustache=require(_0xd69d('0x6'));var util=require(_0xd69d('0x7'));var path=require(_0xd69d('0x8'));var sox=require(_0xd69d('0x9'));var csv=require(_0xd69d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd69d('0xb'));var _=require(_0xd69d('0xc'));var squel=require(_0xd69d('0xd'));var crypto=require(_0xd69d('0xe'));var jsforce=require(_0xd69d('0xf'));var deskjs=require(_0xd69d('0x10'));var toCsv=require(_0xd69d('0xa'));var querystring=require(_0xd69d('0x11'));var Papa=require(_0xd69d('0x12'));var Redis=require(_0xd69d('0x13'));var authService=require(_0xd69d('0x14'));var qs=require(_0xd69d('0x15'));var as=require(_0xd69d('0x16'));var hardwareService=require(_0xd69d('0x17'));var logger=require(_0xd69d('0x18'))(_0xd69d('0x19'));var utils=require(_0xd69d('0x1a'));var config=require(_0xd69d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xd69d('0x1c'))['db'];function respondWithStatusCode(_0x553930,_0x1ec84d){_0x1ec84d=_0x1ec84d||0xcc;return function(_0x1fa5bb){if(_0x1fa5bb){return _0x553930[_0xd69d('0x1d')](_0x1ec84d);}return _0x553930[_0xd69d('0x1e')](_0x1ec84d)[_0xd69d('0x1f')]();};}function respondWithResult(_0x2d76e4,_0x5b131c){_0x5b131c=_0x5b131c||0xc8;return function(_0x432807){if(_0x432807){return _0x2d76e4['status'](_0x5b131c)[_0xd69d('0x20')](_0x432807);}};}function respondWithFilteredResult(_0x29d24f,_0x181ee9){return function(_0x38483b){if(_0x38483b){var _0x226f57=typeof _0x181ee9['offset']==='undefined'&&typeof _0x181ee9[_0xd69d('0x21')]==='undefined';var _0x185bf9=_0x38483b[_0xd69d('0x22')];var _0x16a235=_0x226f57?0x0:_0x181ee9[_0xd69d('0x23')];var _0x2023d0=_0x226f57?_0x38483b['count']:_0x181ee9[_0xd69d('0x23')]+_0x181ee9[_0xd69d('0x21')];var _0x480707;if(_0x2023d0>=_0x185bf9){_0x2023d0=_0x185bf9;_0x480707=0xc8;}else{_0x480707=0xce;}_0x29d24f[_0xd69d('0x1e')](_0x480707);return _0x29d24f[_0xd69d('0x24')](_0xd69d('0x25'),_0x16a235+'-'+_0x2023d0+'/'+_0x185bf9)[_0xd69d('0x20')](_0x38483b);}return null;};}function patchUpdates(_0x22116c){return function(_0x150ee4){try{jsonpatch[_0xd69d('0x26')](_0x150ee4,_0x22116c,!![]);}catch(_0x4bdeae){return BPromise[_0xd69d('0x27')](_0x4bdeae);}return _0x150ee4[_0xd69d('0x28')]();};}function saveUpdates(_0x399424,_0xaaad2){return function(_0x2029c1){if(_0x2029c1){return _0x2029c1[_0xd69d('0x29')](_0x399424)[_0xd69d('0x2a')](function(_0x549ee3){return _0x549ee3;});}return null;};}function removeEntity(_0x546885,_0x1aa989){return function(_0x4bdf0c){if(_0x4bdf0c){return _0x4bdf0c[_0xd69d('0x2b')]()[_0xd69d('0x2a')](function(){_0x546885['status'](0xcc)[_0xd69d('0x1f')]();});}};}function handleEntityNotFound(_0x3e7fe7,_0x2b468b){return function(_0x45d4f9){if(!_0x45d4f9){_0x3e7fe7['sendStatus'](0x194);}return _0x45d4f9;};}function handleError(_0x90c01f,_0x396c12){_0x396c12=_0x396c12||0x1f4;return function(_0x39b9fb){logger[_0xd69d('0x2c')](_0x39b9fb[_0xd69d('0x2d')]);if(_0x39b9fb['name']){delete _0x39b9fb[_0xd69d('0x2e')];}_0x90c01f[_0xd69d('0x1e')](_0x396c12)[_0xd69d('0x2f')](_0x39b9fb);};}exports[_0xd69d('0x30')]=function(_0x5d6296,_0x2438ca){var _0x4b0e77={},_0x553e35={},_0x11c47c={'count':0x0,'rows':[]};var _0x43063f=_['map'](db['VtigerConfiguration'][_0xd69d('0x31')],function(_0x341362){return{'name':_0x341362[_0xd69d('0x32')],'type':_0x341362[_0xd69d('0x33')][_0xd69d('0x34')]};});_0x553e35[_0xd69d('0x35')]=_[_0xd69d('0x36')](_0x43063f,'name');_0x553e35[_0xd69d('0x37')]=_['keys'](_0x5d6296[_0xd69d('0x37')]);_0x553e35[_0xd69d('0x38')]=_[_0xd69d('0x39')](_0x553e35[_0xd69d('0x35')],_0x553e35[_0xd69d('0x37')]);_0x4b0e77[_0xd69d('0x3a')]=_['intersection'](_0x553e35[_0xd69d('0x35')],qs[_0xd69d('0x3b')](_0x5d6296[_0xd69d('0x37')][_0xd69d('0x3b')]));_0x4b0e77['attributes']=_0x4b0e77[_0xd69d('0x3a')]['length']?_0x4b0e77[_0xd69d('0x3a')]:_0x553e35[_0xd69d('0x35')];if(!_0x5d6296[_0xd69d('0x37')]['hasOwnProperty'](_0xd69d('0x3c'))){_0x4b0e77[_0xd69d('0x21')]=qs[_0xd69d('0x21')](_0x5d6296[_0xd69d('0x37')][_0xd69d('0x21')]);_0x4b0e77[_0xd69d('0x23')]=qs[_0xd69d('0x23')](_0x5d6296['query'][_0xd69d('0x23')]);}_0x4b0e77[_0xd69d('0x3d')]=qs[_0xd69d('0x3e')](_0x5d6296[_0xd69d('0x37')][_0xd69d('0x3e')]);_0x4b0e77['where']=qs[_0xd69d('0x38')](_[_0xd69d('0x3f')](_0x5d6296[_0xd69d('0x37')],_0x553e35['filters']),_0x43063f);if(_0x5d6296['query'][_0xd69d('0x40')]){_0x4b0e77[_0xd69d('0x41')]=_[_0xd69d('0x42')](_0x4b0e77[_0xd69d('0x41')],{'$or':_[_0xd69d('0x36')](_0x43063f,function(_0x396046){if(_0x396046[_0xd69d('0x33')]!==_0xd69d('0x43')){var _0x5276d9={};_0x5276d9[_0x396046[_0xd69d('0x2e')]]={'$like':'%'+_0x5d6296[_0xd69d('0x37')][_0xd69d('0x40')]+'%'};return _0x5276d9;}})});}_0x4b0e77=_[_0xd69d('0x42')]({},_0x4b0e77,_0x5d6296['options']);var _0x13f80f={'where':_0x4b0e77['where']};return db[_0xd69d('0x44')][_0xd69d('0x22')](_0x13f80f)['then'](function(_0x518081){_0x11c47c[_0xd69d('0x22')]=_0x518081;if(_0x5d6296[_0xd69d('0x37')][_0xd69d('0x45')]){_0x4b0e77[_0xd69d('0x46')]=[{'all':!![]}];}return db[_0xd69d('0x44')][_0xd69d('0x47')](_0x4b0e77);})['then'](function(_0xb90254){_0x11c47c[_0xd69d('0x48')]=_0xb90254;return _0x11c47c;})[_0xd69d('0x2a')](respondWithFilteredResult(_0x2438ca,_0x4b0e77))['catch'](handleError(_0x2438ca,null));};exports[_0xd69d('0x49')]=function(_0x2ed12c,_0x51aeeb){var _0x57fd3e={'raw':![],'where':{'id':_0x2ed12c[_0xd69d('0x4a')]['id']}},_0x2cb5b7={};_0x2cb5b7[_0xd69d('0x35')]=_['keys'](db['VtigerConfiguration'][_0xd69d('0x31')]);_0x2cb5b7[_0xd69d('0x37')]=_[_0xd69d('0x4b')](_0x2ed12c[_0xd69d('0x37')]);_0x2cb5b7['filters']=_[_0xd69d('0x39')](_0x2cb5b7['model'],_0x2cb5b7['query']);_0x57fd3e[_0xd69d('0x3a')]=_['intersection'](_0x2cb5b7[_0xd69d('0x35')],qs[_0xd69d('0x3b')](_0x2ed12c[_0xd69d('0x37')][_0xd69d('0x3b')]));_0x57fd3e[_0xd69d('0x3a')]=_0x57fd3e[_0xd69d('0x3a')]['length']?_0x57fd3e[_0xd69d('0x3a')]:_0x2cb5b7[_0xd69d('0x35')];if(_0x2ed12c[_0xd69d('0x37')][_0xd69d('0x45')]){_0x57fd3e[_0xd69d('0x46')]=[{'all':!![]}];}_0x57fd3e=_[_0xd69d('0x42')]({},_0x57fd3e,_0x2ed12c['options']);return db[_0xd69d('0x44')]['find'](_0x57fd3e)[_0xd69d('0x2a')](handleEntityNotFound(_0x51aeeb,null))[_0xd69d('0x2a')](respondWithResult(_0x51aeeb,null))[_0xd69d('0x4c')](handleError(_0x51aeeb,null));};exports[_0xd69d('0x4d')]=function(_0x325cc3,_0x4077fc){return db[_0xd69d('0x44')][_0xd69d('0x4d')](_0x325cc3[_0xd69d('0x4e')],{})[_0xd69d('0x2a')](respondWithResult(_0x4077fc,0xc9))['catch'](handleError(_0x4077fc,null));};exports[_0xd69d('0x29')]=function(_0xd0bcb2,_0x324a43){if(_0xd0bcb2['body']['id']){delete _0xd0bcb2[_0xd69d('0x4e')]['id'];}return db[_0xd69d('0x44')][_0xd69d('0x4f')]({'where':{'id':_0xd0bcb2[_0xd69d('0x4a')]['id']}})[_0xd69d('0x2a')](handleEntityNotFound(_0x324a43,null))[_0xd69d('0x2a')](saveUpdates(_0xd0bcb2[_0xd69d('0x4e')],null))['then'](respondWithResult(_0x324a43,null))[_0xd69d('0x4c')](handleError(_0x324a43,null));};exports[_0xd69d('0x2b')]=function(_0xb64c3d,_0x1ab0e7){return db[_0xd69d('0x44')][_0xd69d('0x4f')]({'where':{'id':_0xb64c3d[_0xd69d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ab0e7,null))['then'](removeEntity(_0x1ab0e7,null))[_0xd69d('0x4c')](handleError(_0x1ab0e7,null));};exports[_0xd69d('0x50')]=function(_0x39b59b,_0x30856d,_0x37e915){var _0x2c15a7={};var _0x4582dc={};var _0x1c858d;var _0x469845;return db[_0xd69d('0x44')][_0xd69d('0x51')]({'where':{'id':_0x39b59b['params']['id']}})['then'](handleEntityNotFound(_0x30856d,null))[_0xd69d('0x2a')](function(_0x40ce14){if(_0x40ce14){_0x1c858d=_0x40ce14;_0x4582dc[_0xd69d('0x35')]=_[_0xd69d('0x4b')](db[_0xd69d('0x52')]['rawAttributes']);_0x4582dc['query']=_['keys'](_0x39b59b['query']);_0x4582dc[_0xd69d('0x38')]=_[_0xd69d('0x39')](_0x4582dc[_0xd69d('0x35')],_0x4582dc['query']);_0x2c15a7['attributes']=_[_0xd69d('0x39')](_0x4582dc['model'],qs[_0xd69d('0x3b')](_0x39b59b[_0xd69d('0x37')][_0xd69d('0x3b')]));_0x2c15a7[_0xd69d('0x3a')]=_0x2c15a7[_0xd69d('0x3a')]['length']?_0x2c15a7['attributes']:_0x4582dc[_0xd69d('0x35')];_0x2c15a7['order']=qs[_0xd69d('0x3e')](_0x39b59b[_0xd69d('0x37')][_0xd69d('0x3e')]);_0x2c15a7[_0xd69d('0x41')]=qs[_0xd69d('0x38')](_[_0xd69d('0x3f')](_0x39b59b[_0xd69d('0x37')],_0x4582dc['filters']));if(_0x39b59b['query']['filter']){_0x2c15a7['where']=_['merge'](_0x2c15a7[_0xd69d('0x41')],{'$or':_['map'](_0x2c15a7[_0xd69d('0x3a')],function(_0xfd9bf3){var _0x641fed={};_0x641fed[_0xfd9bf3]={'$like':'%'+_0x39b59b[_0xd69d('0x37')][_0xd69d('0x40')]+'%'};return _0x641fed;})});}_0x2c15a7=_['merge']({},_0x2c15a7,_0x39b59b['options']);return _0x1c858d['getFields'](_0x2c15a7);}})[_0xd69d('0x2a')](function(_0x347aab){if(_0x347aab){_0x469845=_0x347aab['length'];if(!_0x39b59b[_0xd69d('0x37')][_0xd69d('0x53')]('nolimit')){_0x2c15a7[_0xd69d('0x21')]=qs[_0xd69d('0x21')](_0x39b59b[_0xd69d('0x37')][_0xd69d('0x21')]);_0x2c15a7['offset']=qs[_0xd69d('0x23')](_0x39b59b[_0xd69d('0x37')][_0xd69d('0x23')]);}return _0x1c858d[_0xd69d('0x50')](_0x2c15a7);}})['then'](function(_0x30f7a2){if(_0x30f7a2){return _0x30f7a2?{'count':_0x469845,'rows':_0x30f7a2}:null;}})[_0xd69d('0x2a')](respondWithResult(_0x30856d,null))['catch'](handleError(_0x30856d,null));};exports[_0xd69d('0x54')]=function(_0x11993c,_0x22c6a5,_0x482c56){var _0x3ebf23={};var _0x2bc0f0={};var _0x2d5f4f;var _0x4b5736;return db[_0xd69d('0x44')][_0xd69d('0x51')]({'where':{'id':_0x11993c[_0xd69d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22c6a5,null))[_0xd69d('0x2a')](function(_0x5469b4){if(_0x5469b4){_0x2d5f4f=_0x5469b4;_0x2bc0f0['model']=_[_0xd69d('0x4b')](db[_0xd69d('0x52')][_0xd69d('0x31')]);_0x2bc0f0[_0xd69d('0x37')]=_[_0xd69d('0x4b')](_0x11993c[_0xd69d('0x37')]);_0x2bc0f0[_0xd69d('0x38')]=_['intersection'](_0x2bc0f0['model'],_0x2bc0f0['query']);_0x3ebf23[_0xd69d('0x3a')]=_['intersection'](_0x2bc0f0[_0xd69d('0x35')],qs[_0xd69d('0x3b')](_0x11993c[_0xd69d('0x37')]['fields']));_0x3ebf23[_0xd69d('0x3a')]=_0x3ebf23[_0xd69d('0x3a')][_0xd69d('0x55')]?_0x3ebf23['attributes']:_0x2bc0f0['model'];_0x3ebf23['order']=qs['sort'](_0x11993c[_0xd69d('0x37')]['sort']);_0x3ebf23[_0xd69d('0x41')]=qs[_0xd69d('0x38')](_['pick'](_0x11993c[_0xd69d('0x37')],_0x2bc0f0[_0xd69d('0x38')]));if(_0x11993c[_0xd69d('0x37')][_0xd69d('0x40')]){_0x3ebf23['where']=_[_0xd69d('0x42')](_0x3ebf23[_0xd69d('0x41')],{'$or':_[_0xd69d('0x36')](_0x3ebf23[_0xd69d('0x3a')],function(_0x1792bf){var _0x1b7b57={};_0x1b7b57[_0x1792bf]={'$like':'%'+_0x11993c['query'][_0xd69d('0x40')]+'%'};return _0x1b7b57;})});}_0x3ebf23=_[_0xd69d('0x42')]({},_0x3ebf23,_0x11993c[_0xd69d('0x56')]);return _0x2d5f4f[_0xd69d('0x54')](_0x3ebf23);}})[_0xd69d('0x2a')](function(_0x5879f3){if(_0x5879f3){_0x4b5736=_0x5879f3[_0xd69d('0x55')];if(!_0x11993c[_0xd69d('0x37')][_0xd69d('0x53')](_0xd69d('0x3c'))){_0x3ebf23['limit']=qs['limit'](_0x11993c[_0xd69d('0x37')][_0xd69d('0x21')]);_0x3ebf23[_0xd69d('0x23')]=qs[_0xd69d('0x23')](_0x11993c[_0xd69d('0x37')]['offset']);}return _0x2d5f4f[_0xd69d('0x54')](_0x3ebf23);}})[_0xd69d('0x2a')](function(_0x276a0c){if(_0x276a0c){return _0x276a0c?{'count':_0x4b5736,'rows':_0x276a0c}:null;}})[_0xd69d('0x2a')](respondWithResult(_0x22c6a5,null))['catch'](handleError(_0x22c6a5,null));};exports[_0xd69d('0x57')]=function(_0x2cb820,_0x47966b,_0x355336){var _0x1f5dcc={};var _0x420669={};var _0x3e0f92;var _0x1d0cd5;return db[_0xd69d('0x44')][_0xd69d('0x51')]({'where':{'id':_0x2cb820[_0xd69d('0x4a')]['id']}})[_0xd69d('0x2a')](handleEntityNotFound(_0x47966b,null))[_0xd69d('0x2a')](function(_0x4bc0f0){if(_0x4bc0f0){_0x3e0f92=_0x4bc0f0;_0x420669[_0xd69d('0x35')]=_['keys'](db[_0xd69d('0x52')]['rawAttributes']);_0x420669[_0xd69d('0x37')]=_['keys'](_0x2cb820[_0xd69d('0x37')]);_0x420669['filters']=_['intersection'](_0x420669[_0xd69d('0x35')],_0x420669[_0xd69d('0x37')]);_0x1f5dcc[_0xd69d('0x3a')]=_[_0xd69d('0x39')](_0x420669[_0xd69d('0x35')],qs[_0xd69d('0x3b')](_0x2cb820['query']['fields']));_0x1f5dcc[_0xd69d('0x3a')]=_0x1f5dcc[_0xd69d('0x3a')][_0xd69d('0x55')]?_0x1f5dcc[_0xd69d('0x3a')]:_0x420669['model'];_0x1f5dcc['order']=qs[_0xd69d('0x3e')](_0x2cb820[_0xd69d('0x37')][_0xd69d('0x3e')]);_0x1f5dcc['where']=qs[_0xd69d('0x38')](_[_0xd69d('0x3f')](_0x2cb820[_0xd69d('0x37')],_0x420669[_0xd69d('0x38')]));if(_0x2cb820[_0xd69d('0x37')][_0xd69d('0x40')]){_0x1f5dcc[_0xd69d('0x41')]=_[_0xd69d('0x42')](_0x1f5dcc['where'],{'$or':_[_0xd69d('0x36')](_0x1f5dcc[_0xd69d('0x3a')],function(_0x80257d){var _0x430de5={};_0x430de5[_0x80257d]={'$like':'%'+_0x2cb820[_0xd69d('0x37')]['filter']+'%'};return _0x430de5;})});}_0x1f5dcc=_[_0xd69d('0x42')]({},_0x1f5dcc,_0x2cb820[_0xd69d('0x56')]);return _0x3e0f92[_0xd69d('0x57')](_0x1f5dcc);}})['then'](function(_0x1f03c1){if(_0x1f03c1){_0x1d0cd5=_0x1f03c1['length'];if(!_0x2cb820[_0xd69d('0x37')]['hasOwnProperty']('nolimit')){_0x1f5dcc[_0xd69d('0x21')]=qs[_0xd69d('0x21')](_0x2cb820['query'][_0xd69d('0x21')]);_0x1f5dcc[_0xd69d('0x23')]=qs[_0xd69d('0x23')](_0x2cb820[_0xd69d('0x37')][_0xd69d('0x23')]);}return _0x3e0f92[_0xd69d('0x57')](_0x1f5dcc);}})[_0xd69d('0x2a')](function(_0x35c9e5){if(_0x35c9e5){return _0x35c9e5?{'count':_0x1d0cd5,'rows':_0x35c9e5}:null;}})['then'](respondWithResult(_0x47966b,null))['catch'](handleError(_0x47966b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 37d7fbc..b6c346b 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 _0x5a39=['../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x5a39,0x139));var _0x95a3=function(_0x10ae61,_0x32bd24){_0x10ae61=_0x10ae61-0x0;var _0x50e889=_0x5a39[_0x10ae61];return _0x50e889;};'use strict';var _=require('lodash');var util=require(_0x95a3('0x0'));var logger=require(_0x95a3('0x1'))(_0x95a3('0x2'));var moment=require('moment');var BPromise=require(_0x95a3('0x3'));var rp=require(_0x95a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95a3('0x5'));var config=require(_0x95a3('0x6'));var attributes=require(_0x95a3('0x7'));module[_0x95a3('0x8')]=function(_0x596336,_0x2f24c7){return _0x596336['define'](_0x95a3('0x9'),attributes,{'tableName':_0x95a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4688=['request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','api','moment'];(function(_0x1e97c4,_0x4da9d8){var _0x13f515=function(_0x4a69c2){while(--_0x4a69c2){_0x1e97c4['push'](_0x1e97c4['shift']());}};_0x13f515(++_0x4da9d8);}(_0x4688,0xee));var _0x8468=function(_0x31ddea,_0x40de6d){_0x31ddea=_0x31ddea-0x0;var _0x12539b=_0x4688[_0x31ddea];return _0x12539b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8468('0x0'));var moment=require(_0x8468('0x1'));var BPromise=require('bluebird');var rp=require(_0x8468('0x2'));var fs=require('fs');var path=require(_0x8468('0x3'));var rimraf=require('rimraf');var config=require(_0x8468('0x4'));var attributes=require(_0x8468('0x5'));module[_0x8468('0x6')]=function(_0x9e7123,_0x153906){return _0x9e7123['define'](_0x8468('0x7'),attributes,{'tableName':'int_vtiger_configurations','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 95db6f4..7bbf7f5 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 _0xfd7b=['jayson/promise','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x438434,_0x36f21f){var _0x3b97c9=function(_0x1ecb7b){while(--_0x1ecb7b){_0x438434['push'](_0x438434['shift']());}};_0x3b97c9(++_0x36f21f);}(_0xfd7b,0x1d9));var _0xbfd7=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xfd7b[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0xbfd7('0x0'));var util=require('util');var moment=require(_0xbfd7('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfd7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbfd7('0x3'))['db'];var utils=require(_0xbfd7('0x4'));var logger=require(_0xbfd7('0x5'))('rpc');var config=require(_0xbfd7('0x6'));var jayson=require(_0xbfd7('0x7'));var client=jayson['client'][_0xbfd7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x113010,_0x49d063,_0x56bb26){return new BPromise(function(_0x56497c,_0x5ceb08){return client[_0xbfd7('0x9')](_0x113010,_0x56bb26)[_0xbfd7('0xa')](function(_0x5d8218){logger['info'](_0xbfd7('0xb'),_0x49d063,_0xbfd7('0xc'));logger[_0xbfd7('0xd')](_0xbfd7('0xe'),_0x49d063,'request\x20sent',JSON['stringify'](_0x5d8218));if(_0x5d8218[_0xbfd7('0xf')]){if(_0x5d8218[_0xbfd7('0xf')]['code']===0x1f4){logger[_0xbfd7('0xf')](_0xbfd7('0xb'),_0x49d063,_0x5d8218[_0xbfd7('0xf')][_0xbfd7('0x10')]);return _0x5ceb08(_0x5d8218[_0xbfd7('0xf')][_0xbfd7('0x10')]);}logger[_0xbfd7('0xf')](_0xbfd7('0xb'),_0x49d063,_0x5d8218[_0xbfd7('0xf')][_0xbfd7('0x10')]);return _0x56497c(_0x5d8218[_0xbfd7('0xf')][_0xbfd7('0x10')]);}else{logger[_0xbfd7('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x49d063,_0xbfd7('0xc'));_0x56497c(_0x5d8218[_0xbfd7('0x12')][_0xbfd7('0x10')]);}})[_0xbfd7('0x13')](function(_0x2671fe){logger[_0xbfd7('0xf')](_0xbfd7('0xb'),_0x49d063,_0x2671fe);_0x5ceb08(_0x2671fe);});});} \ No newline at end of file +var _0xb9ee=['error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','code'];(function(_0x2cea58,_0x153c15){var _0x192933=function(_0x4f1e9b){while(--_0x4f1e9b){_0x2cea58['push'](_0x2cea58['shift']());}};_0x192933(++_0x153c15);}(_0xb9ee,0x16b));var _0xeb9e=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0xb9ee[_0x546aaf];return _0x1cbf6d;};'use strict';var _=require('lodash');var util=require(_0xeb9e('0x0'));var moment=require(_0xeb9e('0x1'));var BPromise=require(_0xeb9e('0x2'));var rs=require(_0xeb9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb9e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb9e('0x5'))(_0xeb9e('0x6'));var config=require(_0xeb9e('0x7'));var jayson=require(_0xeb9e('0x8'));var client=jayson['client'][_0xeb9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2488d1,_0x23f949,_0x4c4ea7){return new BPromise(function(_0x7bfcf0,_0x318a50){return client[_0xeb9e('0xa')](_0x2488d1,_0x4c4ea7)[_0xeb9e('0xb')](function(_0x86a4ff){logger[_0xeb9e('0xc')](_0xeb9e('0xd'),_0x23f949,_0xeb9e('0xe'));logger[_0xeb9e('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x23f949,'request\x20sent',JSON['stringify'](_0x86a4ff));if(_0x86a4ff['error']){if(_0x86a4ff['error'][_0xeb9e('0x10')]===0x1f4){logger['error'](_0xeb9e('0xd'),_0x23f949,_0x86a4ff[_0xeb9e('0x11')][_0xeb9e('0x12')]);return _0x318a50(_0x86a4ff[_0xeb9e('0x11')]['message']);}logger[_0xeb9e('0x11')](_0xeb9e('0xd'),_0x23f949,_0x86a4ff[_0xeb9e('0x11')][_0xeb9e('0x12')]);return _0x7bfcf0(_0x86a4ff['error']['message']);}else{logger['info'](_0xeb9e('0xd'),_0x23f949,'request\x20sent');_0x7bfcf0(_0x86a4ff['result'][_0xeb9e('0x12')]);}})[_0xeb9e('0x13')](function(_0x241677){logger['error'](_0xeb9e('0xd'),_0x23f949,_0x241677);_0x318a50(_0x241677);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 4bcfa59..131dbce 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 _0x964a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer'];(function(_0x4465b3,_0x42f28b){var _0xd5c07=function(_0x4c6dcd){while(--_0x4c6dcd){_0x4465b3['push'](_0x4465b3['shift']());}};_0xd5c07(++_0x42f28b);}(_0x964a,0x142));var _0xa964=function(_0x4cdb90,_0x452672){_0x4cdb90=_0x4cdb90-0x0;var _0x859ab8=_0x964a[_0x4cdb90];return _0x859ab8;};'use strict';var multer=require(_0xa964('0x0'));var util=require(_0xa964('0x1'));var path=require(_0xa964('0x2'));var timeout=require(_0xa964('0x3'));var express=require(_0xa964('0x4'));var router=express['Router']();var fs_extra=require(_0xa964('0x5'));var auth=require(_0xa964('0x6'));var interaction=require(_0xa964('0x7'));var config=require(_0xa964('0x8'));var controller=require('./intVtigerField.controller');router[_0xa964('0x9')]('/',auth[_0xa964('0xa')](),controller[_0xa964('0xb')]);router['get'](_0xa964('0xc'),auth[_0xa964('0xa')](),controller[_0xa964('0xd')]);router[_0xa964('0xe')]('/',auth[_0xa964('0xa')](),controller['create']);router['put'](_0xa964('0xc'),auth[_0xa964('0xa')](),controller[_0xa964('0xf')]);router[_0xa964('0x10')](_0xa964('0xc'),auth[_0xa964('0xa')](),controller[_0xa964('0x11')]);module[_0xa964('0x12')]=router; \ No newline at end of file +var _0x279a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','put','delete','/:id','destroy','exports','multer'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x279a,0x143));var _0xa279=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x279a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa279('0x0'));var util=require(_0xa279('0x1'));var path=require(_0xa279('0x2'));var timeout=require(_0xa279('0x3'));var express=require(_0xa279('0x4'));var router=express['Router']();var fs_extra=require(_0xa279('0x5'));var auth=require(_0xa279('0x6'));var interaction=require(_0xa279('0x7'));var config=require('../../config/environment');var controller=require(_0xa279('0x8'));router[_0xa279('0x9')]('/',auth[_0xa279('0xa')](),controller[_0xa279('0xb')]);router[_0xa279('0x9')]('/:id',auth[_0xa279('0xa')](),controller[_0xa279('0xc')]);router['post']('/',auth[_0xa279('0xa')](),controller['create']);router[_0xa279('0xd')]('/:id',auth[_0xa279('0xa')](),controller['update']);router[_0xa279('0xe')](_0xa279('0xf'),auth[_0xa279('0xa')](),controller[_0xa279('0x10')]);module[_0xa279('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2a6b999..31da514 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 _0x75e6=['customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports','variable'];(function(_0x481c6f,_0x52b011){var _0x36e75d=function(_0x1449ea){while(--_0x1449ea){_0x481c6f['push'](_0x481c6f['shift']());}};_0x36e75d(++_0x52b011);}(_0x75e6,0x165));var _0x675e=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x75e6[_0x4017b0];return _0x5ed4f7;};'use strict';var Sequelize=require(_0x675e('0x0'));module[_0x675e('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x675e('0x2'),_0x675e('0x3'),'keyValue',_0x675e('0x4')),'defaultValue':_0x675e('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x675e('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x675e('0x5'),_0x675e('0x2'),_0x675e('0x3'))},'keyContent':{'type':Sequelize[_0x675e('0x6')]},'idField':{'type':Sequelize[_0x675e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x675e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x675e('0x6')]}}; \ No newline at end of file +var _0x1597=['picklist','STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable','keyValue'];(function(_0xe77289,_0x2dc295){var _0x3ffa81=function(_0x212269){while(--_0x212269){_0xe77289['push'](_0xe77289['shift']());}};_0x3ffa81(++_0x2dc295);}(_0x1597,0xee));var _0x7159=function(_0x5e9396,_0x161fdd){_0x5e9396=_0x5e9396-0x0;var _0x4172e3=_0x1597[_0x5e9396];return _0x4172e3;};'use strict';var Sequelize=require(_0x7159('0x0'));module['exports']={'type':{'type':Sequelize[_0x7159('0x1')](_0x7159('0x2'),'variable',_0x7159('0x3'),_0x7159('0x4'),_0x7159('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7159('0x6')]},'key':{'type':Sequelize[_0x7159('0x6')]},'keyType':{'type':Sequelize[_0x7159('0x1')](_0x7159('0x2'),_0x7159('0x7'),_0x7159('0x3'))},'keyContent':{'type':Sequelize[_0x7159('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7159('0x6')]},'customField':{'type':Sequelize[_0x7159('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7159('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 40d7123..346c6ab 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 _0xf5e9=['util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4b477a,_0x3e3f1e){var _0x291072=function(_0x2539a9){while(--_0x2539a9){_0x4b477a['push'](_0x4b477a['shift']());}};_0x291072(++_0x3e3f1e);}(_0xf5e9,0xd8));var _0x9f5e=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xf5e9[_0x1fa759];return _0x2da9f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f5e('0x0'));var zipdir=require(_0x9f5e('0x1'));var jsonpatch=require(_0x9f5e('0x2'));var rp=require(_0x9f5e('0x3'));var moment=require(_0x9f5e('0x4'));var BPromise=require(_0x9f5e('0x5'));var Mustache=require('mustache');var util=require(_0x9f5e('0x6'));var path=require(_0x9f5e('0x7'));var sox=require(_0x9f5e('0x8'));var csv=require(_0x9f5e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f5e('0xa'));var _=require(_0x9f5e('0xb'));var squel=require('squel');var crypto=require(_0x9f5e('0xc'));var jsforce=require(_0x9f5e('0xd'));var deskjs=require(_0x9f5e('0xe'));var toCsv=require(_0x9f5e('0x9'));var querystring=require(_0x9f5e('0xf'));var Papa=require(_0x9f5e('0x10'));var Redis=require(_0x9f5e('0x11'));var authService=require(_0x9f5e('0x12'));var qs=require(_0x9f5e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f5e('0x14'));var logger=require(_0x9f5e('0x15'))(_0x9f5e('0x16'));var utils=require('../../config/utils');var config=require(_0x9f5e('0x17'));var licenseUtil=require(_0x9f5e('0x18'));var db=require(_0x9f5e('0x19'))['db'];function respondWithStatusCode(_0x121ad9,_0x3b250b){_0x3b250b=_0x3b250b||0xcc;return function(_0x33f9d3){if(_0x33f9d3){return _0x121ad9[_0x9f5e('0x1a')](_0x3b250b);}return _0x121ad9[_0x9f5e('0x1b')](_0x3b250b)[_0x9f5e('0x1c')]();};}function respondWithResult(_0x18c18a,_0x426ae9){_0x426ae9=_0x426ae9||0xc8;return function(_0x533fc8){if(_0x533fc8){return _0x18c18a['status'](_0x426ae9)[_0x9f5e('0x1d')](_0x533fc8);}};}function respondWithFilteredResult(_0x3de501,_0x54ecbc){return function(_0x54eb40){if(_0x54eb40){var _0x153132=typeof _0x54ecbc[_0x9f5e('0x1e')]==='undefined'&&typeof _0x54ecbc[_0x9f5e('0x1f')]===_0x9f5e('0x20');var _0x1302bf=_0x54eb40[_0x9f5e('0x21')];var _0x2b6145=_0x153132?0x0:_0x54ecbc[_0x9f5e('0x1e')];var _0x1399a5=_0x153132?_0x54eb40[_0x9f5e('0x21')]:_0x54ecbc[_0x9f5e('0x1e')]+_0x54ecbc[_0x9f5e('0x1f')];var _0x479ab8;if(_0x1399a5>=_0x1302bf){_0x1399a5=_0x1302bf;_0x479ab8=0xc8;}else{_0x479ab8=0xce;}_0x3de501[_0x9f5e('0x1b')](_0x479ab8);return _0x3de501['set'](_0x9f5e('0x22'),_0x2b6145+'-'+_0x1399a5+'/'+_0x1302bf)[_0x9f5e('0x1d')](_0x54eb40);}return null;};}function patchUpdates(_0x6bc7b3){return function(_0x391abb){try{jsonpatch[_0x9f5e('0x23')](_0x391abb,_0x6bc7b3,!![]);}catch(_0x177cf1){return BPromise[_0x9f5e('0x24')](_0x177cf1);}return _0x391abb[_0x9f5e('0x25')]();};}function saveUpdates(_0x14b3ae,_0x455d01){return function(_0x1aa3c2){if(_0x1aa3c2){return _0x1aa3c2['update'](_0x14b3ae)[_0x9f5e('0x26')](function(_0x312e65){return _0x312e65;});}return null;};}function removeEntity(_0x372aff,_0x573e95){return function(_0x4bfe55){if(_0x4bfe55){return _0x4bfe55[_0x9f5e('0x27')]()[_0x9f5e('0x26')](function(){_0x372aff['status'](0xcc)[_0x9f5e('0x1c')]();});}};}function handleEntityNotFound(_0x10e1ed,_0x381a1e){return function(_0x3fbcc3){if(!_0x3fbcc3){_0x10e1ed[_0x9f5e('0x1a')](0x194);}return _0x3fbcc3;};}function handleError(_0x59b4b8,_0x305801){_0x305801=_0x305801||0x1f4;return function(_0xde5a5c){logger[_0x9f5e('0x28')](_0xde5a5c[_0x9f5e('0x29')]);if(_0xde5a5c[_0x9f5e('0x2a')]){delete _0xde5a5c['name'];}_0x59b4b8[_0x9f5e('0x1b')](_0x305801)[_0x9f5e('0x2b')](_0xde5a5c);};}exports[_0x9f5e('0x2c')]=function(_0x3d47f9,_0x349905){var _0x400736={},_0x35ceea={},_0x561403={'count':0x0,'rows':[]};var _0x2373da=_['map'](db[_0x9f5e('0x2d')][_0x9f5e('0x2e')],function(_0x45c1a9){return{'name':_0x45c1a9[_0x9f5e('0x2f')],'type':_0x45c1a9[_0x9f5e('0x30')][_0x9f5e('0x31')]};});_0x35ceea[_0x9f5e('0x32')]=_[_0x9f5e('0x33')](_0x2373da,_0x9f5e('0x2a'));_0x35ceea[_0x9f5e('0x34')]=_[_0x9f5e('0x35')](_0x3d47f9[_0x9f5e('0x34')]);_0x35ceea[_0x9f5e('0x36')]=_[_0x9f5e('0x37')](_0x35ceea[_0x9f5e('0x32')],_0x35ceea['query']);_0x400736['attributes']=_[_0x9f5e('0x37')](_0x35ceea[_0x9f5e('0x32')],qs[_0x9f5e('0x38')](_0x3d47f9[_0x9f5e('0x34')][_0x9f5e('0x38')]));_0x400736[_0x9f5e('0x39')]=_0x400736[_0x9f5e('0x39')][_0x9f5e('0x3a')]?_0x400736[_0x9f5e('0x39')]:_0x35ceea['model'];if(!_0x3d47f9['query'][_0x9f5e('0x3b')]('nolimit')){_0x400736[_0x9f5e('0x1f')]=qs[_0x9f5e('0x1f')](_0x3d47f9[_0x9f5e('0x34')][_0x9f5e('0x1f')]);_0x400736[_0x9f5e('0x1e')]=qs[_0x9f5e('0x1e')](_0x3d47f9[_0x9f5e('0x34')][_0x9f5e('0x1e')]);}_0x400736['order']=qs[_0x9f5e('0x3c')](_0x3d47f9[_0x9f5e('0x34')][_0x9f5e('0x3c')]);_0x400736[_0x9f5e('0x3d')]=qs[_0x9f5e('0x36')](_[_0x9f5e('0x3e')](_0x3d47f9[_0x9f5e('0x34')],_0x35ceea[_0x9f5e('0x36')]),_0x2373da);if(_0x3d47f9['query'][_0x9f5e('0x3f')]){_0x400736['where']=_['merge'](_0x400736[_0x9f5e('0x3d')],{'$or':_[_0x9f5e('0x33')](_0x2373da,function(_0x49c013){if(_0x49c013[_0x9f5e('0x30')]!=='VIRTUAL'){var _0x308fa2={};_0x308fa2[_0x49c013[_0x9f5e('0x2a')]]={'$like':'%'+_0x3d47f9[_0x9f5e('0x34')][_0x9f5e('0x3f')]+'%'};return _0x308fa2;}})});}_0x400736=_[_0x9f5e('0x40')]({},_0x400736,_0x3d47f9[_0x9f5e('0x41')]);var _0x391161={'where':_0x400736[_0x9f5e('0x3d')]};return db[_0x9f5e('0x2d')][_0x9f5e('0x21')](_0x391161)[_0x9f5e('0x26')](function(_0xca6d93){_0x561403[_0x9f5e('0x21')]=_0xca6d93;if(_0x3d47f9[_0x9f5e('0x34')][_0x9f5e('0x42')]){_0x400736['include']=[{'all':!![]}];}return db['VtigerField'][_0x9f5e('0x43')](_0x400736);})['then'](function(_0x265c2f){_0x561403[_0x9f5e('0x44')]=_0x265c2f;return _0x561403;})[_0x9f5e('0x26')](respondWithFilteredResult(_0x349905,_0x400736))[_0x9f5e('0x45')](handleError(_0x349905,null));};exports['show']=function(_0x28031f,_0xef162e){var _0x3e719e={'raw':!![],'where':{'id':_0x28031f[_0x9f5e('0x46')]['id']}},_0xe12b73={};_0xe12b73[_0x9f5e('0x32')]=_[_0x9f5e('0x35')](db[_0x9f5e('0x2d')]['rawAttributes']);_0xe12b73[_0x9f5e('0x34')]=_['keys'](_0x28031f[_0x9f5e('0x34')]);_0xe12b73[_0x9f5e('0x36')]=_[_0x9f5e('0x37')](_0xe12b73[_0x9f5e('0x32')],_0xe12b73[_0x9f5e('0x34')]);_0x3e719e[_0x9f5e('0x39')]=_[_0x9f5e('0x37')](_0xe12b73['model'],qs[_0x9f5e('0x38')](_0x28031f[_0x9f5e('0x34')]['fields']));_0x3e719e[_0x9f5e('0x39')]=_0x3e719e[_0x9f5e('0x39')][_0x9f5e('0x3a')]?_0x3e719e[_0x9f5e('0x39')]:_0xe12b73[_0x9f5e('0x32')];if(_0x28031f[_0x9f5e('0x34')][_0x9f5e('0x42')]){_0x3e719e['include']=[{'all':!![]}];}_0x3e719e=_[_0x9f5e('0x40')]({},_0x3e719e,_0x28031f[_0x9f5e('0x41')]);return db[_0x9f5e('0x2d')][_0x9f5e('0x47')](_0x3e719e)['then'](handleEntityNotFound(_0xef162e,null))[_0x9f5e('0x26')](respondWithResult(_0xef162e,null))[_0x9f5e('0x45')](handleError(_0xef162e,null));};exports[_0x9f5e('0x48')]=function(_0x1a4dbd,_0x133feb){return db[_0x9f5e('0x2d')][_0x9f5e('0x48')](_0x1a4dbd[_0x9f5e('0x49')],{})[_0x9f5e('0x26')](respondWithResult(_0x133feb,0xc9))[_0x9f5e('0x45')](handleError(_0x133feb,null));};exports['update']=function(_0x55c5dc,_0x5442e6){if(_0x55c5dc[_0x9f5e('0x49')]['id']){delete _0x55c5dc[_0x9f5e('0x49')]['id'];}return db[_0x9f5e('0x2d')]['find']({'where':{'id':_0x55c5dc[_0x9f5e('0x46')]['id']}})[_0x9f5e('0x26')](handleEntityNotFound(_0x5442e6,null))['then'](saveUpdates(_0x55c5dc[_0x9f5e('0x49')],null))[_0x9f5e('0x26')](respondWithResult(_0x5442e6,null))[_0x9f5e('0x45')](handleError(_0x5442e6,null));};exports['destroy']=function(_0xe3f05a,_0x267cc1){return db[_0x9f5e('0x2d')][_0x9f5e('0x47')]({'where':{'id':_0xe3f05a[_0x9f5e('0x46')]['id']}})['then'](handleEntityNotFound(_0x267cc1,null))[_0x9f5e('0x26')](removeEntity(_0x267cc1,null))[_0x9f5e('0x45')](handleError(_0x267cc1,null));}; \ No newline at end of file +var _0xfdd8=['show','params','find','create','update','body','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x326f32,_0x75e3f1){var _0x2b17f5=function(_0x55af71){while(--_0x55af71){_0x326f32['push'](_0x326f32['shift']());}};_0x2b17f5(++_0x75e3f1);}(_0xfdd8,0x169));var _0x8fdd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xfdd8[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x8fdd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8fdd('0x1'));var moment=require(_0x8fdd('0x2'));var BPromise=require(_0x8fdd('0x3'));var Mustache=require(_0x8fdd('0x4'));var util=require('util');var path=require(_0x8fdd('0x5'));var sox=require(_0x8fdd('0x6'));var csv=require(_0x8fdd('0x7'));var ejs=require(_0x8fdd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fdd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8fdd('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8fdd('0xb'));var Papa=require(_0x8fdd('0xc'));var Redis=require(_0x8fdd('0xd'));var authService=require(_0x8fdd('0xe'));var qs=require(_0x8fdd('0xf'));var as=require(_0x8fdd('0x10'));var hardwareService=require(_0x8fdd('0x11'));var logger=require(_0x8fdd('0x12'))(_0x8fdd('0x13'));var utils=require('../../config/utils');var config=require(_0x8fdd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fdd('0x15'))['db'];function respondWithStatusCode(_0x5bce8f,_0x13439c){_0x13439c=_0x13439c||0xcc;return function(_0x4c3160){if(_0x4c3160){return _0x5bce8f['sendStatus'](_0x13439c);}return _0x5bce8f[_0x8fdd('0x16')](_0x13439c)[_0x8fdd('0x17')]();};}function respondWithResult(_0x10ad96,_0x234f1c){_0x234f1c=_0x234f1c||0xc8;return function(_0x192dc6){if(_0x192dc6){return _0x10ad96[_0x8fdd('0x16')](_0x234f1c)[_0x8fdd('0x18')](_0x192dc6);}};}function respondWithFilteredResult(_0x4374e0,_0x3e819b){return function(_0x327915){if(_0x327915){var _0x2e04f8=typeof _0x3e819b[_0x8fdd('0x19')]===_0x8fdd('0x1a')&&typeof _0x3e819b[_0x8fdd('0x1b')]===_0x8fdd('0x1a');var _0x836139=_0x327915[_0x8fdd('0x1c')];var _0x58f555=_0x2e04f8?0x0:_0x3e819b['offset'];var _0x49bf77=_0x2e04f8?_0x327915['count']:_0x3e819b['offset']+_0x3e819b[_0x8fdd('0x1b')];var _0x225fc0;if(_0x49bf77>=_0x836139){_0x49bf77=_0x836139;_0x225fc0=0xc8;}else{_0x225fc0=0xce;}_0x4374e0[_0x8fdd('0x16')](_0x225fc0);return _0x4374e0[_0x8fdd('0x1d')](_0x8fdd('0x1e'),_0x58f555+'-'+_0x49bf77+'/'+_0x836139)['json'](_0x327915);}return null;};}function patchUpdates(_0x490fae){return function(_0x5a1223){try{jsonpatch[_0x8fdd('0x1f')](_0x5a1223,_0x490fae,!![]);}catch(_0x5043a2){return BPromise[_0x8fdd('0x20')](_0x5043a2);}return _0x5a1223['save']();};}function saveUpdates(_0x2d99b5,_0x46e3b7){return function(_0x272cb7){if(_0x272cb7){return _0x272cb7['update'](_0x2d99b5)[_0x8fdd('0x21')](function(_0x131359){return _0x131359;});}return null;};}function removeEntity(_0x356cc8,_0x198b9a){return function(_0x566f47){if(_0x566f47){return _0x566f47[_0x8fdd('0x22')]()['then'](function(){_0x356cc8[_0x8fdd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54ce4f,_0x525c39){return function(_0x52df7e){if(!_0x52df7e){_0x54ce4f['sendStatus'](0x194);}return _0x52df7e;};}function handleError(_0x299edd,_0x52cfe0){_0x52cfe0=_0x52cfe0||0x1f4;return function(_0x3173c5){logger['error'](_0x3173c5[_0x8fdd('0x23')]);if(_0x3173c5[_0x8fdd('0x24')]){delete _0x3173c5[_0x8fdd('0x24')];}_0x299edd[_0x8fdd('0x16')](_0x52cfe0)['send'](_0x3173c5);};}exports[_0x8fdd('0x25')]=function(_0x2336fd,_0x47a7ee){var _0x7f3d6={},_0x376ec5={},_0x11046e={'count':0x0,'rows':[]};var _0x15947d=_[_0x8fdd('0x26')](db[_0x8fdd('0x27')][_0x8fdd('0x28')],function(_0x6592d6){return{'name':_0x6592d6[_0x8fdd('0x29')],'type':_0x6592d6[_0x8fdd('0x2a')][_0x8fdd('0x2b')]};});_0x376ec5[_0x8fdd('0x2c')]=_['map'](_0x15947d,'name');_0x376ec5[_0x8fdd('0x2d')]=_[_0x8fdd('0x2e')](_0x2336fd[_0x8fdd('0x2d')]);_0x376ec5['filters']=_[_0x8fdd('0x2f')](_0x376ec5[_0x8fdd('0x2c')],_0x376ec5['query']);_0x7f3d6[_0x8fdd('0x30')]=_['intersection'](_0x376ec5['model'],qs[_0x8fdd('0x31')](_0x2336fd['query'][_0x8fdd('0x31')]));_0x7f3d6[_0x8fdd('0x30')]=_0x7f3d6[_0x8fdd('0x30')][_0x8fdd('0x32')]?_0x7f3d6['attributes']:_0x376ec5[_0x8fdd('0x2c')];if(!_0x2336fd[_0x8fdd('0x2d')][_0x8fdd('0x33')](_0x8fdd('0x34'))){_0x7f3d6[_0x8fdd('0x1b')]=qs[_0x8fdd('0x1b')](_0x2336fd[_0x8fdd('0x2d')][_0x8fdd('0x1b')]);_0x7f3d6[_0x8fdd('0x19')]=qs['offset'](_0x2336fd['query'][_0x8fdd('0x19')]);}_0x7f3d6['order']=qs[_0x8fdd('0x35')](_0x2336fd[_0x8fdd('0x2d')][_0x8fdd('0x35')]);_0x7f3d6[_0x8fdd('0x36')]=qs[_0x8fdd('0x37')](_[_0x8fdd('0x38')](_0x2336fd[_0x8fdd('0x2d')],_0x376ec5[_0x8fdd('0x37')]),_0x15947d);if(_0x2336fd['query']['filter']){_0x7f3d6[_0x8fdd('0x36')]=_[_0x8fdd('0x39')](_0x7f3d6['where'],{'$or':_[_0x8fdd('0x26')](_0x15947d,function(_0x4fc9df){if(_0x4fc9df[_0x8fdd('0x2a')]!==_0x8fdd('0x3a')){var _0x4441ee={};_0x4441ee[_0x4fc9df['name']]={'$like':'%'+_0x2336fd[_0x8fdd('0x2d')]['filter']+'%'};return _0x4441ee;}})});}_0x7f3d6=_[_0x8fdd('0x39')]({},_0x7f3d6,_0x2336fd[_0x8fdd('0x3b')]);var _0x7f2a47={'where':_0x7f3d6[_0x8fdd('0x36')]};return db[_0x8fdd('0x27')][_0x8fdd('0x1c')](_0x7f2a47)[_0x8fdd('0x21')](function(_0x35f9ee){_0x11046e[_0x8fdd('0x1c')]=_0x35f9ee;if(_0x2336fd['query'][_0x8fdd('0x3c')]){_0x7f3d6[_0x8fdd('0x3d')]=[{'all':!![]}];}return db['VtigerField'][_0x8fdd('0x3e')](_0x7f3d6);})[_0x8fdd('0x21')](function(_0x34fc12){_0x11046e[_0x8fdd('0x3f')]=_0x34fc12;return _0x11046e;})[_0x8fdd('0x21')](respondWithFilteredResult(_0x47a7ee,_0x7f3d6))[_0x8fdd('0x40')](handleError(_0x47a7ee,null));};exports[_0x8fdd('0x41')]=function(_0x5ef5cb,_0x21e74f){var _0x2890d5={'raw':!![],'where':{'id':_0x5ef5cb[_0x8fdd('0x42')]['id']}},_0x15a3f9={};_0x15a3f9['model']=_[_0x8fdd('0x2e')](db['VtigerField'][_0x8fdd('0x28')]);_0x15a3f9['query']=_[_0x8fdd('0x2e')](_0x5ef5cb[_0x8fdd('0x2d')]);_0x15a3f9[_0x8fdd('0x37')]=_[_0x8fdd('0x2f')](_0x15a3f9[_0x8fdd('0x2c')],_0x15a3f9[_0x8fdd('0x2d')]);_0x2890d5[_0x8fdd('0x30')]=_[_0x8fdd('0x2f')](_0x15a3f9[_0x8fdd('0x2c')],qs[_0x8fdd('0x31')](_0x5ef5cb[_0x8fdd('0x2d')]['fields']));_0x2890d5[_0x8fdd('0x30')]=_0x2890d5[_0x8fdd('0x30')]['length']?_0x2890d5[_0x8fdd('0x30')]:_0x15a3f9[_0x8fdd('0x2c')];if(_0x5ef5cb[_0x8fdd('0x2d')]['includeAll']){_0x2890d5[_0x8fdd('0x3d')]=[{'all':!![]}];}_0x2890d5=_[_0x8fdd('0x39')]({},_0x2890d5,_0x5ef5cb[_0x8fdd('0x3b')]);return db[_0x8fdd('0x27')][_0x8fdd('0x43')](_0x2890d5)[_0x8fdd('0x21')](handleEntityNotFound(_0x21e74f,null))[_0x8fdd('0x21')](respondWithResult(_0x21e74f,null))[_0x8fdd('0x40')](handleError(_0x21e74f,null));};exports[_0x8fdd('0x44')]=function(_0x28a6f0,_0x11cd56){return db[_0x8fdd('0x27')][_0x8fdd('0x44')](_0x28a6f0['body'],{})[_0x8fdd('0x21')](respondWithResult(_0x11cd56,0xc9))[_0x8fdd('0x40')](handleError(_0x11cd56,null));};exports[_0x8fdd('0x45')]=function(_0x916140,_0x15058f){if(_0x916140['body']['id']){delete _0x916140[_0x8fdd('0x46')]['id'];}return db['VtigerField'][_0x8fdd('0x43')]({'where':{'id':_0x916140['params']['id']}})[_0x8fdd('0x21')](handleEntityNotFound(_0x15058f,null))['then'](saveUpdates(_0x916140[_0x8fdd('0x46')],null))[_0x8fdd('0x21')](respondWithResult(_0x15058f,null))['catch'](handleError(_0x15058f,null));};exports[_0x8fdd('0x22')]=function(_0x5ef3d8,_0x16d993){return db[_0x8fdd('0x27')][_0x8fdd('0x43')]({'where':{'id':_0x5ef3d8[_0x8fdd('0x42')]['id']}})[_0x8fdd('0x21')](handleEntityNotFound(_0x16d993,null))[_0x8fdd('0x21')](removeEntity(_0x16d993,null))[_0x8fdd('0x40')](handleError(_0x16d993,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index cbe33d5..887f8f0 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 _0x72ef=['rimraf','../../config/environment','define','VtigerField','idField','FieldId','lodash','api','moment','bluebird','request-promise','path'];(function(_0x1bcd61,_0x261cb8){var _0x495ecf=function(_0x1f76c5){while(--_0x1f76c5){_0x1bcd61['push'](_0x1bcd61['shift']());}};_0x495ecf(++_0x261cb8);}(_0x72ef,0xd2));var _0xf72e=function(_0x24c9df,_0x2f9c41){_0x24c9df=_0x24c9df-0x0;var _0x447d0f=_0x72ef[_0x24c9df];return _0x447d0f;};'use strict';var _=require(_0xf72e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf72e('0x1'));var moment=require(_0xf72e('0x2'));var BPromise=require(_0xf72e('0x3'));var rp=require(_0xf72e('0x4'));var fs=require('fs');var path=require(_0xf72e('0x5'));var rimraf=require(_0xf72e('0x6'));var config=require(_0xf72e('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x3d9324,_0x918608){return _0x3d9324[_0xf72e('0x8')](_0xf72e('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xf72e('0xa'),_0xf72e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e5f=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','FieldId','lodash','util','moment'];(function(_0x466ace,_0x2baf83){var _0x1cfcc0=function(_0x2e170c){while(--_0x2e170c){_0x466ace['push'](_0x466ace['shift']());}};_0x1cfcc0(++_0x2baf83);}(_0x6e5f,0x169));var _0xf6e5=function(_0x30eeaa,_0x56e9c7){_0x30eeaa=_0x30eeaa-0x0;var _0x228b9e=_0x6e5f[_0x30eeaa];return _0x228b9e;};'use strict';var _=require(_0xf6e5('0x0'));var util=require(_0xf6e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf6e5('0x2'));var BPromise=require(_0xf6e5('0x3'));var rp=require(_0xf6e5('0x4'));var fs=require('fs');var path=require(_0xf6e5('0x5'));var rimraf=require(_0xf6e5('0x6'));var config=require(_0xf6e5('0x7'));var attributes=require(_0xf6e5('0x8'));module['exports']=function(_0x152ef0,_0x537252){return _0x152ef0[_0xf6e5('0x9')](_0xf6e5('0xa'),attributes,{'tableName':_0xf6e5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xf6e5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index b887511..f32407a 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 _0x0f45=['VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','then','info','debug'];(function(_0x2aded1,_0x921f1f){var _0x4e8e57=function(_0x30809e){while(--_0x30809e){_0x2aded1['push'](_0x2aded1['shift']());}};_0x4e8e57(++_0x921f1f);}(_0x0f45,0x7f));var _0x50f4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x0f45[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x50f4('0x0'));var util=require(_0x50f4('0x1'));var moment=require(_0x50f4('0x2'));var BPromise=require(_0x50f4('0x3'));var rs=require(_0x50f4('0x4'));var fs=require('fs');var Redis=require(_0x50f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x50f4('0x6'));var logger=require('../../config/logger')(_0x50f4('0x7'));var config=require('../../config/environment');var jayson=require(_0x50f4('0x8'));var client=jayson['client'][_0x50f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35d04b,_0x31d988,_0x2d7377){return new BPromise(function(_0x3a72ee,_0x1f8514){return client['request'](_0x35d04b,_0x2d7377)[_0x50f4('0xa')](function(_0xb9b914){logger[_0x50f4('0xb')]('VtigerField,\x20%s,\x20%s',_0x31d988,'request\x20sent');logger[_0x50f4('0xc')](_0x50f4('0xd'),_0x31d988,_0x50f4('0xe'),JSON[_0x50f4('0xf')](_0xb9b914));if(_0xb9b914['error']){if(_0xb9b914[_0x50f4('0x10')]['code']===0x1f4){logger[_0x50f4('0x10')](_0x50f4('0x11'),_0x31d988,_0xb9b914[_0x50f4('0x10')][_0x50f4('0x12')]);return _0x1f8514(_0xb9b914[_0x50f4('0x10')][_0x50f4('0x12')]);}logger['error'](_0x50f4('0x11'),_0x31d988,_0xb9b914[_0x50f4('0x10')][_0x50f4('0x12')]);return _0x3a72ee(_0xb9b914['error'][_0x50f4('0x12')]);}else{logger[_0x50f4('0xb')]('VtigerField,\x20%s,\x20%s',_0x31d988,_0x50f4('0xe'));_0x3a72ee(_0xb9b914['result'][_0x50f4('0x12')]);}})[_0x50f4('0x13')](function(_0x4d00a5){logger[_0x50f4('0x10')](_0x50f4('0x11'),_0x31d988,_0x4d00a5);_0x1f8514(_0x4d00a5);});});} \ No newline at end of file +var _0xb001=['result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent'];(function(_0x3dc008,_0x2866df){var _0x33af86=function(_0x3f37d5){while(--_0x3f37d5){_0x3dc008['push'](_0x3dc008['shift']());}};_0x33af86(++_0x2866df);}(_0xb001,0x7a));var _0x1b00=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb001[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x1b00('0x0'));var util=require('util');var moment=require(_0x1b00('0x1'));var BPromise=require(_0x1b00('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b00('0x3'))['db'];var utils=require(_0x1b00('0x4'));var logger=require('../../config/logger')(_0x1b00('0x5'));var config=require(_0x1b00('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2093f9,_0x2dc615,_0xdaff27){return new BPromise(function(_0x61fc62,_0x6324bf){return client[_0x1b00('0x7')](_0x2093f9,_0xdaff27)[_0x1b00('0x8')](function(_0x5d8eaa){logger['info'](_0x1b00('0x9'),_0x2dc615,'request\x20sent');logger[_0x1b00('0xa')](_0x1b00('0xb'),_0x2dc615,'request\x20sent',JSON[_0x1b00('0xc')](_0x5d8eaa));if(_0x5d8eaa[_0x1b00('0xd')]){if(_0x5d8eaa[_0x1b00('0xd')][_0x1b00('0xe')]===0x1f4){logger[_0x1b00('0xd')](_0x1b00('0x9'),_0x2dc615,_0x5d8eaa[_0x1b00('0xd')][_0x1b00('0xf')]);return _0x6324bf(_0x5d8eaa['error'][_0x1b00('0xf')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x2dc615,_0x5d8eaa[_0x1b00('0xd')]['message']);return _0x61fc62(_0x5d8eaa[_0x1b00('0xd')][_0x1b00('0xf')]);}else{logger[_0x1b00('0x10')](_0x1b00('0x9'),_0x2dc615,_0x1b00('0x11'));_0x61fc62(_0x5d8eaa[_0x1b00('0x12')]['message']);}})[_0x1b00('0x13')](function(_0x13532c){logger[_0x1b00('0xd')](_0x1b00('0x9'),_0x2dc615,_0x13532c);_0x6324bf(_0x13532c);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 07cf7d2..4d30518 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 _0xfafc=['../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x36a434,_0x231dec){var _0x2592b7=function(_0x53d559){while(--_0x53d559){_0x36a434['push'](_0x36a434['shift']());}};_0x2592b7(++_0x231dec);}(_0xfafc,0x13b));var _0xcfaf=function(_0x9dd37c,_0x3e255e){_0x9dd37c=_0x9dd37c-0x0;var _0x2a522c=_0xfafc[_0x9dd37c];return _0x2a522c;};'use strict';var multer=require(_0xcfaf('0x0'));var util=require(_0xcfaf('0x1'));var path=require(_0xcfaf('0x2'));var timeout=require(_0xcfaf('0x3'));var express=require(_0xcfaf('0x4'));var router=express[_0xcfaf('0x5')]();var fs_extra=require(_0xcfaf('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcfaf('0x7'));var controller=require('./intZendeskAccount.controller');router[_0xcfaf('0x8')]('/',auth[_0xcfaf('0x9')](),controller[_0xcfaf('0xa')]);router[_0xcfaf('0x8')](_0xcfaf('0xb'),auth[_0xcfaf('0x9')](),controller[_0xcfaf('0xc')]);router[_0xcfaf('0x8')]('/:id/configurations',auth[_0xcfaf('0x9')](),controller[_0xcfaf('0xd')]);router[_0xcfaf('0x8')](_0xcfaf('0xe'),auth[_0xcfaf('0x9')](),controller[_0xcfaf('0xf')]);router[_0xcfaf('0x10')]('/',auth[_0xcfaf('0x9')](),controller[_0xcfaf('0x11')]);router[_0xcfaf('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xcfaf('0x12')](_0xcfaf('0xb'),auth['isAuthenticated'](),controller[_0xcfaf('0x13')]);router[_0xcfaf('0x14')](_0xcfaf('0xb'),auth[_0xcfaf('0x9')](),controller[_0xcfaf('0x15')]);module[_0xcfaf('0x16')]=router; \ No newline at end of file +var _0xbddb=['/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZendeskAccount.controller','get','index'];(function(_0x466186,_0x2276fb){var _0x1ee9af=function(_0x5dd5f0){while(--_0x5dd5f0){_0x466186['push'](_0x466186['shift']());}};_0x1ee9af(++_0x2276fb);}(_0xbddb,0x11d));var _0xbbdd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbddb[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xbbdd('0x0'));var path=require('path');var timeout=require(_0xbbdd('0x1'));var express=require(_0xbbdd('0x2'));var router=express[_0xbbdd('0x3')]();var fs_extra=require(_0xbbdd('0x4'));var auth=require(_0xbbdd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbbdd('0x6'));router[_0xbbdd('0x7')]('/',auth['isAuthenticated'](),controller[_0xbbdd('0x8')]);router[_0xbbdd('0x7')](_0xbbdd('0x9'),auth[_0xbbdd('0xa')](),controller[_0xbbdd('0xb')]);router['get'](_0xbbdd('0xc'),auth[_0xbbdd('0xa')](),controller['getConfigurations']);router[_0xbbdd('0x7')](_0xbbdd('0xd'),auth[_0xbbdd('0xa')](),controller[_0xbbdd('0xe')]);router[_0xbbdd('0xf')]('/',auth[_0xbbdd('0xa')](),controller[_0xbbdd('0x10')]);router[_0xbbdd('0xf')](_0xbbdd('0xc'),auth[_0xbbdd('0xa')](),controller['addConfiguration']);router[_0xbbdd('0x11')](_0xbbdd('0x9'),auth['isAuthenticated'](),controller[_0xbbdd('0x12')]);router['delete'](_0xbbdd('0x9'),auth['isAuthenticated'](),controller[_0xbbdd('0x13')]);module[_0xbbdd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index aa59be1..af8ffea 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 _0xe1d7=['integrationTab','exports','username','STRING','remoteUri','ENUM','password','token'];(function(_0x29c5ae,_0x51868a){var _0x282767=function(_0x3bdf17){while(--_0x3bdf17){_0x29c5ae['push'](_0x29c5ae['shift']());}};_0x282767(++_0x51868a);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0xaee9b2,_0x4f74cf){_0xaee9b2=_0xaee9b2-0x0;var _0x8c26c1=_0xe1d7[_0xaee9b2];return _0x8c26c1;};'use strict';var Sequelize=require('sequelize');module[_0x7e1d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x7e1d('0x1')},'password':{'type':Sequelize[_0x7e1d('0x2')]},'token':{'type':Sequelize[_0x7e1d('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x7e1d('0x3')},'authType':{'type':Sequelize[_0x7e1d('0x4')](_0x7e1d('0x5'),_0x7e1d('0x6')),'defaultValue':_0x7e1d('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7e1d('0x4')](_0x7e1d('0x7'),'newTab'),'defaultValue':_0x7e1d('0x7')}}; \ No newline at end of file +var _0x7a54=['STRING','username','remoteUri','ENUM','password','integrationTab','sequelize','exports'];(function(_0xa610d2,_0x2cbb63){var _0x76eb4c=function(_0x571340){while(--_0x571340){_0xa610d2['push'](_0xa610d2['shift']());}};_0x76eb4c(++_0x2cbb63);}(_0x7a54,0x106));var _0x47a5=function(_0x5154be,_0x4b7206){_0x5154be=_0x5154be-0x0;var _0x15a5f0=_0x7a54[_0x5154be];return _0x15a5f0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x47a5('0x2')],'unique':_0x47a5('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x47a5('0x2')]},'remoteUri':{'type':Sequelize[_0x47a5('0x2')],'unique':_0x47a5('0x4')},'authType':{'type':Sequelize[_0x47a5('0x5')](_0x47a5('0x6'),'token'),'defaultValue':_0x47a5('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x5')](_0x47a5('0x7'),'newTab'),'defaultValue':_0x47a5('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 40f7f9e..81ea8ec 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 _0xb7e7=['channel','getDescriptions','ZendeskField','Subjects','Descriptions','password','token','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','username','base64','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','ZendeskAccount','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','options','AccountId','getSubjects'];(function(_0xc7c4f9,_0x9c35e3){var _0x1d3cc3=function(_0xc62d8a){while(--_0xc62d8a){_0xc7c4f9['push'](_0xc7c4f9['shift']());}};_0x1d3cc3(++_0x9c35e3);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];var integrations=require(_0x7b7e('0x19'));function respondWithStatusCode(_0x54d8ce,_0x267446){_0x267446=_0x267446||0xcc;return function(_0x430eab){if(_0x430eab){return _0x54d8ce['sendStatus'](_0x267446);}return _0x54d8ce[_0x7b7e('0x1a')](_0x267446)['end']();};}function respondWithResult(_0x4c6011,_0x2889ed){_0x2889ed=_0x2889ed||0xc8;return function(_0xd304f5){if(_0xd304f5){return _0x4c6011[_0x7b7e('0x1a')](_0x2889ed)[_0x7b7e('0x1b')](_0xd304f5);}};}function respondWithFilteredResult(_0x3d2fb2,_0x5703fd){return function(_0x51baf6){if(_0x51baf6){var _0xc7f087=typeof _0x5703fd[_0x7b7e('0x1c')]===_0x7b7e('0x1d')&&typeof _0x5703fd[_0x7b7e('0x1e')]===_0x7b7e('0x1d');var _0x3bf2f0=_0x51baf6[_0x7b7e('0x1f')];var _0x200ef7=_0xc7f087?0x0:_0x5703fd[_0x7b7e('0x1c')];var _0x429a0e=_0xc7f087?_0x51baf6[_0x7b7e('0x1f')]:_0x5703fd[_0x7b7e('0x1c')]+_0x5703fd[_0x7b7e('0x1e')];var _0x3bec7d;if(_0x429a0e>=_0x3bf2f0){_0x429a0e=_0x3bf2f0;_0x3bec7d=0xc8;}else{_0x3bec7d=0xce;}_0x3d2fb2[_0x7b7e('0x1a')](_0x3bec7d);return _0x3d2fb2[_0x7b7e('0x20')](_0x7b7e('0x21'),_0x200ef7+'-'+_0x429a0e+'/'+_0x3bf2f0)['json'](_0x51baf6);}return null;};}function patchUpdates(_0x69262b){return function(_0x43db4f){try{jsonpatch[_0x7b7e('0x22')](_0x43db4f,_0x69262b,!![]);}catch(_0x4c0647){return BPromise[_0x7b7e('0x23')](_0x4c0647);}return _0x43db4f[_0x7b7e('0x24')]();};}function saveUpdates(_0x14243b,_0x200156){return function(_0x2b7211){if(_0x2b7211){return _0x2b7211[_0x7b7e('0x25')](_0x14243b)[_0x7b7e('0x26')](function(_0x10a66a){return _0x10a66a;});}return null;};}function removeEntity(_0x53bbb3,_0x5d6215){return function(_0x4a836a){if(_0x4a836a){return _0x4a836a[_0x7b7e('0x27')]()[_0x7b7e('0x26')](function(){_0x53bbb3[_0x7b7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d3b1,_0x5dadbb){return function(_0x182245){if(!_0x182245){_0x51d3b1[_0x7b7e('0x28')](0x194);}return _0x182245;};}function handleError(_0x16a3c7,_0x7aa71){_0x7aa71=_0x7aa71||0x1f4;return function(_0x3ceaf5){logger['error'](_0x3ceaf5[_0x7b7e('0x29')]);if(_0x3ceaf5[_0x7b7e('0x2a')]){delete _0x3ceaf5['name'];}_0x16a3c7['status'](_0x7aa71)['send'](_0x3ceaf5);};}exports[_0x7b7e('0x2b')]=function(_0x423832,_0x503625){var _0x3db8c4={},_0x51d4b5={},_0x1b4341={'count':0x0,'rows':[]};var _0xb9b6bf=_[_0x7b7e('0x2c')](db['ZendeskAccount'][_0x7b7e('0x2d')],function(_0xe31336){return{'name':_0xe31336[_0x7b7e('0x2e')],'type':_0xe31336[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x51d4b5['model']=_[_0x7b7e('0x2c')](_0xb9b6bf,'name');_0x51d4b5[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x423832[_0x7b7e('0x31')]);_0x51d4b5[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x51d4b5[_0x7b7e('0x35')],_0x51d4b5[_0x7b7e('0x31')]);_0x3db8c4['attributes']=_['intersection'](_0x51d4b5[_0x7b7e('0x35')],qs[_0x7b7e('0x36')](_0x423832['query'][_0x7b7e('0x36')]));_0x3db8c4[_0x7b7e('0x37')]=_0x3db8c4[_0x7b7e('0x37')]['length']?_0x3db8c4[_0x7b7e('0x37')]:_0x51d4b5[_0x7b7e('0x35')];if(!_0x423832[_0x7b7e('0x31')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x3db8c4[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x3db8c4[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}_0x3db8c4[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x423832[_0x7b7e('0x31')]['sort']);_0x3db8c4[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x423832[_0x7b7e('0x31')],_0x51d4b5[_0x7b7e('0x33')]),_0xb9b6bf);if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x3db8c4[_0x7b7e('0x3c')]=_[_0x7b7e('0x3f')](_0x3db8c4[_0x7b7e('0x3c')],{'$or':_['map'](_0xb9b6bf,function(_0x3d6571){if(_0x3d6571[_0x7b7e('0x2f')]!==_0x7b7e('0x40')){var _0x1d43da={};_0x1d43da[_0x3d6571['name']]={'$like':'%'+_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x1d43da;}})});}_0x3db8c4=_[_0x7b7e('0x3f')]({},_0x3db8c4,_0x423832['options']);var _0x4a2888={'where':_0x3db8c4[_0x7b7e('0x3c')]};return db['ZendeskAccount'][_0x7b7e('0x1f')](_0x4a2888)[_0x7b7e('0x26')](function(_0x4de331){_0x1b4341[_0x7b7e('0x1f')]=_0x4de331;if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x41')]){_0x3db8c4[_0x7b7e('0x42')]=[{'all':!![]}];}return db[_0x7b7e('0x43')][_0x7b7e('0x44')](_0x3db8c4);})[_0x7b7e('0x26')](function(_0x1d9bb9){_0x1b4341[_0x7b7e('0x45')]=_0x1d9bb9;return _0x1b4341;})['then'](respondWithFilteredResult(_0x503625,_0x3db8c4))['catch'](handleError(_0x503625,null));};exports[_0x7b7e('0x46')]=function(_0x550ea6,_0x41c8a6){var _0x5e8b5d={'raw':![],'where':{'id':_0x550ea6[_0x7b7e('0x47')]['id']}},_0x48dd74={};_0x48dd74['model']=_[_0x7b7e('0x32')](db['ZendeskAccount'][_0x7b7e('0x2d')]);_0x48dd74[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x550ea6[_0x7b7e('0x31')]);_0x48dd74['filters']=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],_0x48dd74[_0x7b7e('0x31')]);_0x5e8b5d[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],qs['fields'](_0x550ea6['query']['fields']));_0x5e8b5d[_0x7b7e('0x37')]=_0x5e8b5d[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x5e8b5d[_0x7b7e('0x37')]:_0x48dd74[_0x7b7e('0x35')];if(_0x550ea6[_0x7b7e('0x31')]['includeAll']){_0x5e8b5d[_0x7b7e('0x42')]=[{'all':!![]}];}_0x5e8b5d=_[_0x7b7e('0x3f')]({},_0x5e8b5d,_0x550ea6['options']);return db['ZendeskAccount'][_0x7b7e('0x49')](_0x5e8b5d)[_0x7b7e('0x26')](handleEntityNotFound(_0x41c8a6,null))[_0x7b7e('0x26')](respondWithResult(_0x41c8a6,null))[_0x7b7e('0x4a')](handleError(_0x41c8a6,null));};exports[_0x7b7e('0x4b')]=function(_0xb46776,_0x590154){return db[_0x7b7e('0x43')]['create'](_0xb46776[_0x7b7e('0x4c')],{})[_0x7b7e('0x26')](respondWithResult(_0x590154,0xc9))[_0x7b7e('0x4a')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x58e4e6,_0x3b649e){if(_0x58e4e6[_0x7b7e('0x4c')]['id']){delete _0x58e4e6[_0x7b7e('0x4c')]['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x58e4e6['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3b649e,null))[_0x7b7e('0x26')](saveUpdates(_0x58e4e6[_0x7b7e('0x4c')],null))[_0x7b7e('0x26')](respondWithResult(_0x3b649e,null))[_0x7b7e('0x4a')](handleError(_0x3b649e,null));};exports['destroy']=function(_0x1d6d18,_0x29024e){return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x1d6d18[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x29024e,null))[_0x7b7e('0x26')](removeEntity(_0x29024e,null))['catch'](handleError(_0x29024e,null));};exports[_0x7b7e('0x4d')]=function(_0x5d7c89,_0x16730c,_0x766a54){var _0x570303={};var _0x36f1be={};var _0x44e3a0;var _0x16c81d;return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x5d7c89[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x16730c,null))['then'](function(_0xbf044d){if(_0xbf044d){_0x44e3a0=_0xbf044d;_0x36f1be[_0x7b7e('0x35')]=_[_0x7b7e('0x32')](db[_0x7b7e('0x4f')]['rawAttributes']);_0x36f1be['query']=_['keys'](_0x5d7c89[_0x7b7e('0x31')]);_0x36f1be[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x36f1be['model'],_0x36f1be['query']);_0x570303[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x36f1be['model'],qs[_0x7b7e('0x36')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x36')]));_0x570303['attributes']=_0x570303[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x570303['attributes']:_0x36f1be[_0x7b7e('0x35')];_0x570303[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3b')]);_0x570303[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x5d7c89[_0x7b7e('0x31')],_0x36f1be['filters']));if(_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x570303['where']=_[_0x7b7e('0x3f')](_0x570303[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x2c')](_0x570303['attributes'],function(_0x1729e0){var _0x4fc349={};_0x4fc349[_0x1729e0]={'$like':'%'+_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x4fc349;})});}_0x570303=_['merge']({},_0x570303,_0x5d7c89[_0x7b7e('0x50')]);return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})['then'](function(_0x2dcb35){if(_0x2dcb35){_0x16c81d=_0x2dcb35[_0x7b7e('0x48')];if(!_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x38')]('nolimit')){_0x570303[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x570303[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})[_0x7b7e('0x26')](function(_0x5b9010){if(_0x5b9010){return _0x5b9010?{'count':_0x16c81d,'rows':_0x5b9010}:null;}})[_0x7b7e('0x26')](respondWithResult(_0x16730c,null))['catch'](handleError(_0x16730c,null));};exports['addConfiguration']=function(_0x2b105a,_0x7cbe6c,_0x1eb4b1){if(_0x2b105a[_0x7b7e('0x4c')]['id']){delete _0x2b105a['body']['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x2b105a[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x7cbe6c,null))[_0x7b7e('0x26')](function(_0x2b2afd){if(_0x2b2afd){_0x2b105a['body'][_0x7b7e('0x51')]=_0x2b2afd['id'];_0x2b105a['body']['Subjects']=integrations[_0x7b7e('0x52')](_0x2b105a['body'][_0x7b7e('0x53')],_0x2b105a['body'][_0x7b7e('0x2f')]);_0x2b105a[_0x7b7e('0x4c')]['Descriptions']=integrations[_0x7b7e('0x54')](_0x2b105a[_0x7b7e('0x4c')]['channel'],_0x2b105a[_0x7b7e('0x4c')][_0x7b7e('0x2f')]);return db[_0x7b7e('0x4f')][_0x7b7e('0x4b')](_0x2b105a[_0x7b7e('0x4c')],{'include':[{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x56')},{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x57')}]});}return null;})[_0x7b7e('0x26')](respondWithResult(_0x7cbe6c,null))['catch'](handleError(_0x7cbe6c,null));};exports['getFields']=function(_0x34e7df,_0x46ac1f,_0x2c6e3a){var _0x348c77='';return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x34e7df[_0x7b7e('0x47')]['id']},'attributes':['id','username',_0x7b7e('0x58'),_0x7b7e('0x59'),'authType',_0x7b7e('0x5a')]})[_0x7b7e('0x26')](handleEntityNotFound(_0x46ac1f,null))[_0x7b7e('0x26')](function(_0x271318){if(_0x271318){_0x348c77=_0x271318[_0x7b7e('0x5a')];var _0x40f65e=_0x348c77[_0x7b7e('0x5b')](-0x1);if(_0x40f65e==='/'){_0x348c77=_0x348c77[_0x7b7e('0x5c')](0x0,_0x348c77[_0x7b7e('0x5d')](_0x40f65e));}var _0x3b6bc6={'method':_0x7b7e('0x5e'),'uri':util['format'](_0x7b7e('0x5f'),_0x348c77,_0x7b7e('0x60')),'json':!![]};switch(_0x271318[_0x7b7e('0x61')]){case _0x7b7e('0x58'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format'](_0x7b7e('0x65'),_0x271318[_0x7b7e('0x66')],_0x271318[_0x7b7e('0x58')]))['toString'](_0x7b7e('0x67')))};break;case _0x7b7e('0x59'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format']('%s/token:%s',_0x271318['username'],_0x271318[_0x7b7e('0x59')]))[_0x7b7e('0x68')](_0x7b7e('0x67')))};break;default:throw new db['Sequelize'][(_0x7b7e('0x69'))](_0x7b7e('0x6a'));}return rp(_0x3b6bc6);}})[_0x7b7e('0x26')](function(_0x5bf4d1){if(_0x5bf4d1){var _0x2983bf=[_0x7b7e('0x6b'),_0x7b7e('0x6c'),_0x7b7e('0x6d'),'assignee'];_[_0x7b7e('0x6e')](_0x5bf4d1[_0x7b7e('0x60')],function(_0xa52b93){return _0x2983bf[_0x7b7e('0x6f')](_0xa52b93['type']);});return{'count':_0x5bf4d1['ticket_fields'][_0x7b7e('0x48')],'rows':_['map'](_0x5bf4d1[_0x7b7e('0x60')],function(_0x4215b5){return{'id':_0x4215b5['id'],'name':_0x4215b5[_0x7b7e('0x70')]>0x7?_0x4215b5[_0x7b7e('0x71')]:_0x4215b5['type'],'custom':_0x4215b5[_0x7b7e('0x70')]>0x7?!![]:![],'options':_0x4215b5[_0x7b7e('0x72')]?_0x4215b5[_0x7b7e('0x72')]:_0x4215b5[_0x7b7e('0x73')]?_0x4215b5[_0x7b7e('0x73')]:[]};})};}})[_0x7b7e('0x26')](respondWithResult(_0x46ac1f,null))[_0x7b7e('0x4a')](function(_0x372478){var _0x44d8c4=_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?0x1f4:_0x372478[_0x7b7e('0x75')]||0x1f4;logger[_0x7b7e('0x76')](_0x7b7e('0x77'),_0x7b7e('0x78'),_0x44d8c4,JSON[_0x7b7e('0x79')](_0x372478));delete _0x372478['name'];if(_0x44d8c4===0x191){_0x44d8c4=0x190;}_0x46ac1f[_0x7b7e('0x1a')](_0x44d8c4)[_0x7b7e('0x7a')](_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?{'message':_0x7b7e('0x7b'),'statusCode':_0x372478[_0x7b7e('0x75')]}:_0x372478);});}; \ No newline at end of file +var _0x7334=['params','keys','rawAttributes','includeAll','options','find','create','body','destroy','ZendeskConfiguration','pick','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','findOne','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','headers','toString','base64','ValidationError','subject','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','index','map','fieldName','model','name','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','ZendeskAccount','include','findAll','rows','catch','show'];(function(_0x2c7f0b,_0x34d6e7){var _0x258d2e=function(_0x19580f){while(--_0x19580f){_0x2c7f0b['push'](_0x2c7f0b['shift']());}};_0x258d2e(++_0x34d6e7);}(_0x7334,0x184));var _0x4733=function(_0x9c63b2,_0x4e3b96){_0x9c63b2=_0x9c63b2-0x0;var _0x20528c=_0x7334[_0x9c63b2];return _0x20528c;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];var integrations=require(_0x4733('0x1a'));function respondWithStatusCode(_0x100ecd,_0x1c146c){_0x1c146c=_0x1c146c||0xcc;return function(_0x2c0f6b){if(_0x2c0f6b){return _0x100ecd['sendStatus'](_0x1c146c);}return _0x100ecd[_0x4733('0x1b')](_0x1c146c)['end']();};}function respondWithResult(_0x4327f3,_0x1a22e4){_0x1a22e4=_0x1a22e4||0xc8;return function(_0x2e5b1b){if(_0x2e5b1b){return _0x4327f3[_0x4733('0x1b')](_0x1a22e4)[_0x4733('0x1c')](_0x2e5b1b);}};}function respondWithFilteredResult(_0x167016,_0x12f111){return function(_0x9fff){if(_0x9fff){var _0x1920ce=typeof _0x12f111['offset']===_0x4733('0x1d')&&typeof _0x12f111[_0x4733('0x1e')]==='undefined';var _0x444824=_0x9fff[_0x4733('0x1f')];var _0x2aa223=_0x1920ce?0x0:_0x12f111[_0x4733('0x20')];var _0x579f67=_0x1920ce?_0x9fff['count']:_0x12f111[_0x4733('0x20')]+_0x12f111[_0x4733('0x1e')];var _0x50c585;if(_0x579f67>=_0x444824){_0x579f67=_0x444824;_0x50c585=0xc8;}else{_0x50c585=0xce;}_0x167016[_0x4733('0x1b')](_0x50c585);return _0x167016[_0x4733('0x21')](_0x4733('0x22'),_0x2aa223+'-'+_0x579f67+'/'+_0x444824)[_0x4733('0x1c')](_0x9fff);}return null;};}function patchUpdates(_0x493cd3){return function(_0x1232e5){try{jsonpatch[_0x4733('0x23')](_0x1232e5,_0x493cd3,!![]);}catch(_0x5d058d){return BPromise[_0x4733('0x24')](_0x5d058d);}return _0x1232e5[_0x4733('0x25')]();};}function saveUpdates(_0x478e34,_0x15a291){return function(_0x115ce4){if(_0x115ce4){return _0x115ce4[_0x4733('0x26')](_0x478e34)[_0x4733('0x27')](function(_0x3a2542){return _0x3a2542;});}return null;};}function removeEntity(_0x24db74,_0x180049){return function(_0x2bb78f){if(_0x2bb78f){return _0x2bb78f['destroy']()[_0x4733('0x27')](function(){_0x24db74[_0x4733('0x1b')](0xcc)[_0x4733('0x28')]();});}};}function handleEntityNotFound(_0x2cb247,_0x30ee9b){return function(_0x3bd683){if(!_0x3bd683){_0x2cb247[_0x4733('0x29')](0x194);}return _0x3bd683;};}function handleError(_0xc3ab0a,_0x13bc12){_0x13bc12=_0x13bc12||0x1f4;return function(_0x23fe6c){logger['error'](_0x23fe6c[_0x4733('0x2a')]);if(_0x23fe6c['name']){delete _0x23fe6c['name'];}_0xc3ab0a[_0x4733('0x1b')](_0x13bc12)['send'](_0x23fe6c);};}exports[_0x4733('0x2b')]=function(_0x479989,_0x4abc0d){var _0x517c73={},_0x2976b0={},_0x3bfe53={'count':0x0,'rows':[]};var _0x29621e=_[_0x4733('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x50f67e){return{'name':_0x50f67e[_0x4733('0x2d')],'type':_0x50f67e['type']['key']};});_0x2976b0[_0x4733('0x2e')]=_[_0x4733('0x2c')](_0x29621e,_0x4733('0x2f'));_0x2976b0['query']=_['keys'](_0x479989[_0x4733('0x30')]);_0x2976b0[_0x4733('0x31')]=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],_0x2976b0[_0x4733('0x30')]);_0x517c73['attributes']=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x479989[_0x4733('0x30')][_0x4733('0x33')]));_0x517c73['attributes']=_0x517c73['attributes'][_0x4733('0x34')]?_0x517c73[_0x4733('0x35')]:_0x2976b0[_0x4733('0x2e')];if(!_0x479989[_0x4733('0x30')][_0x4733('0x36')]('nolimit')){_0x517c73[_0x4733('0x1e')]=qs[_0x4733('0x1e')](_0x479989[_0x4733('0x30')]['limit']);_0x517c73[_0x4733('0x20')]=qs[_0x4733('0x20')](_0x479989[_0x4733('0x30')][_0x4733('0x20')]);}_0x517c73[_0x4733('0x37')]=qs[_0x4733('0x38')](_0x479989[_0x4733('0x30')][_0x4733('0x38')]);_0x517c73['where']=qs[_0x4733('0x31')](_['pick'](_0x479989[_0x4733('0x30')],_0x2976b0[_0x4733('0x31')]),_0x29621e);if(_0x479989[_0x4733('0x30')][_0x4733('0x39')]){_0x517c73[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x517c73[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x29621e,function(_0x592fc2){if(_0x592fc2[_0x4733('0x3c')]!==_0x4733('0x3d')){var _0x5e12c3={};_0x5e12c3[_0x592fc2[_0x4733('0x2f')]]={'$like':'%'+_0x479989[_0x4733('0x30')]['filter']+'%'};return _0x5e12c3;}})});}_0x517c73=_[_0x4733('0x3b')]({},_0x517c73,_0x479989['options']);var _0x43ac2d={'where':_0x517c73['where']};return db[_0x4733('0x3e')][_0x4733('0x1f')](_0x43ac2d)['then'](function(_0x515720){_0x3bfe53[_0x4733('0x1f')]=_0x515720;if(_0x479989[_0x4733('0x30')]['includeAll']){_0x517c73[_0x4733('0x3f')]=[{'all':!![]}];}return db[_0x4733('0x3e')][_0x4733('0x40')](_0x517c73);})[_0x4733('0x27')](function(_0x3ae58c){_0x3bfe53[_0x4733('0x41')]=_0x3ae58c;return _0x3bfe53;})[_0x4733('0x27')](respondWithFilteredResult(_0x4abc0d,_0x517c73))[_0x4733('0x42')](handleError(_0x4abc0d,null));};exports[_0x4733('0x43')]=function(_0x42e055,_0x444471){var _0x1d32df={'raw':![],'where':{'id':_0x42e055[_0x4733('0x44')]['id']}},_0x191c04={};_0x191c04[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x3e')][_0x4733('0x46')]);_0x191c04['query']=_[_0x4733('0x45')](_0x42e055[_0x4733('0x30')]);_0x191c04[_0x4733('0x31')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],_0x191c04[_0x4733('0x30')]);_0x1d32df[_0x4733('0x35')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x42e055[_0x4733('0x30')][_0x4733('0x33')]));_0x1d32df[_0x4733('0x35')]=_0x1d32df[_0x4733('0x35')]['length']?_0x1d32df['attributes']:_0x191c04[_0x4733('0x2e')];if(_0x42e055[_0x4733('0x30')][_0x4733('0x47')]){_0x1d32df[_0x4733('0x3f')]=[{'all':!![]}];}_0x1d32df=_[_0x4733('0x3b')]({},_0x1d32df,_0x42e055[_0x4733('0x48')]);return db[_0x4733('0x3e')][_0x4733('0x49')](_0x1d32df)[_0x4733('0x27')](handleEntityNotFound(_0x444471,null))[_0x4733('0x27')](respondWithResult(_0x444471,null))['catch'](handleError(_0x444471,null));};exports['create']=function(_0x51e201,_0x521ad3){return db[_0x4733('0x3e')][_0x4733('0x4a')](_0x51e201[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x521ad3,0xc9))[_0x4733('0x42')](handleError(_0x521ad3,null));};exports[_0x4733('0x26')]=function(_0x1c6abf,_0x2484f4){if(_0x1c6abf[_0x4733('0x4b')]['id']){delete _0x1c6abf[_0x4733('0x4b')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x1c6abf[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0x2484f4,null))[_0x4733('0x27')](saveUpdates(_0x1c6abf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x2484f4,null))['catch'](handleError(_0x2484f4,null));};exports[_0x4733('0x4c')]=function(_0x45c9ad,_0x31ae69){return db[_0x4733('0x3e')][_0x4733('0x49')]({'where':{'id':_0x45c9ad[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x31ae69,null))[_0x4733('0x27')](removeEntity(_0x31ae69,null))[_0x4733('0x42')](handleError(_0x31ae69,null));};exports['getConfigurations']=function(_0x31fb69,_0xdb1561,_0x899344){var _0x491fa5={};var _0x2effd2={};var _0x130aee;var _0xafb3f8;return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x31fb69[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0xdb1561,null))[_0x4733('0x27')](function(_0x3b8165){if(_0x3b8165){_0x130aee=_0x3b8165;_0x2effd2[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x4d')]['rawAttributes']);_0x2effd2[_0x4733('0x30')]=_[_0x4733('0x45')](_0x31fb69['query']);_0x2effd2['filters']=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],_0x2effd2[_0x4733('0x30')]);_0x491fa5[_0x4733('0x35')]=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x31fb69[_0x4733('0x30')]['fields']));_0x491fa5['attributes']=_0x491fa5[_0x4733('0x35')]['length']?_0x491fa5[_0x4733('0x35')]:_0x2effd2[_0x4733('0x2e')];_0x491fa5[_0x4733('0x37')]=qs['sort'](_0x31fb69['query']['sort']);_0x491fa5[_0x4733('0x3a')]=qs[_0x4733('0x31')](_[_0x4733('0x4e')](_0x31fb69['query'],_0x2effd2[_0x4733('0x31')]));if(_0x31fb69[_0x4733('0x30')][_0x4733('0x39')]){_0x491fa5[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x491fa5[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x491fa5['attributes'],function(_0x1ed9eb){var _0x2b5eec={};_0x2b5eec[_0x1ed9eb]={'$like':'%'+_0x31fb69['query']['filter']+'%'};return _0x2b5eec;})});}_0x491fa5=_[_0x4733('0x3b')]({},_0x491fa5,_0x31fb69[_0x4733('0x48')]);return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x475dad){if(_0x475dad){_0xafb3f8=_0x475dad[_0x4733('0x34')];if(!_0x31fb69[_0x4733('0x30')][_0x4733('0x36')](_0x4733('0x50'))){_0x491fa5['limit']=qs[_0x4733('0x1e')](_0x31fb69[_0x4733('0x30')][_0x4733('0x1e')]);_0x491fa5['offset']=qs[_0x4733('0x20')](_0x31fb69['query'][_0x4733('0x20')]);}return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x3696d6){if(_0x3696d6){return _0x3696d6?{'count':_0xafb3f8,'rows':_0x3696d6}:null;}})[_0x4733('0x27')](respondWithResult(_0xdb1561,null))[_0x4733('0x42')](handleError(_0xdb1561,null));};exports['addConfiguration']=function(_0x137793,_0x574787,_0x15552d){if(_0x137793[_0x4733('0x4b')]['id']){delete _0x137793['body']['id'];}return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x137793['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x574787,null))[_0x4733('0x27')](function(_0x1a0ebf){if(_0x1a0ebf){_0x137793[_0x4733('0x4b')][_0x4733('0x51')]=_0x1a0ebf['id'];_0x137793[_0x4733('0x4b')][_0x4733('0x52')]=integrations[_0x4733('0x53')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793['body']['type']);_0x137793[_0x4733('0x4b')][_0x4733('0x54')]=integrations[_0x4733('0x55')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793[_0x4733('0x4b')][_0x4733('0x3c')]);return db[_0x4733('0x4d')]['create'](_0x137793[_0x4733('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x4733('0x52')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4733('0x27')](respondWithResult(_0x574787,null))['catch'](handleError(_0x574787,null));};exports[_0x4733('0x56')]=function(_0x523498,_0x4e835b,_0x1a7baf){var _0x5c6083='';return db['ZendeskAccount'][_0x4733('0x57')]({'where':{'id':_0x523498[_0x4733('0x44')]['id']},'attributes':['id',_0x4733('0x58'),'password',_0x4733('0x59'),_0x4733('0x5a'),_0x4733('0x5b')]})[_0x4733('0x27')](handleEntityNotFound(_0x4e835b,null))[_0x4733('0x27')](function(_0x29f4e8){if(_0x29f4e8){_0x5c6083=_0x29f4e8['remoteUri'];var _0x3c9e3b=_0x5c6083[_0x4733('0x5c')](-0x1);if(_0x3c9e3b==='/'){_0x5c6083=_0x5c6083[_0x4733('0x5d')](0x0,_0x5c6083['lastIndexOf'](_0x3c9e3b));}var _0x2c0377={'method':_0x4733('0x5e'),'uri':util[_0x4733('0x5f')](_0x4733('0x60'),_0x5c6083,_0x4733('0x61')),'json':!![]};switch(_0x29f4e8[_0x4733('0x5a')]){case _0x4733('0x62'):_0x2c0377[_0x4733('0x63')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x62')]))[_0x4733('0x64')](_0x4733('0x65')))};break;case _0x4733('0x59'):_0x2c0377['headers']={'Authorization':util[_0x4733('0x5f')]('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s/token:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x59')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x4733('0x66'))]('Unknown\x20authentication\x20type');}return rp(_0x2c0377);}})[_0x4733('0x27')](function(_0x2fe1d3){if(_0x2fe1d3){var _0x59cc5b=[_0x4733('0x67'),'description','group',_0x4733('0x68')];_[_0x4733('0x69')](_0x2fe1d3[_0x4733('0x61')],function(_0x5a067b){return _0x59cc5b['includes'](_0x5a067b[_0x4733('0x3c')]);});return{'count':_0x2fe1d3['ticket_fields'][_0x4733('0x34')],'rows':_[_0x4733('0x2c')](_0x2fe1d3[_0x4733('0x61')],function(_0x42657b){return{'id':_0x42657b['id'],'name':_0x42657b[_0x4733('0x6a')]>0x7?_0x42657b[_0x4733('0x6b')]:_0x42657b['type'],'custom':_0x42657b[_0x4733('0x6a')]>0x7?!![]:![],'options':_0x42657b[_0x4733('0x6c')]?_0x42657b[_0x4733('0x6c')]:_0x42657b[_0x4733('0x6d')]?_0x42657b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x4e835b,null))[_0x4733('0x42')](function(_0x4d87c1){var _0x131595=_0x523498[_0x4733('0x30')][_0x4733('0x6e')]?0x1f4:_0x4d87c1[_0x4733('0x6f')]||0x1f4;logger[_0x4733('0x70')](_0x4733('0x71'),_0x4733('0x56'),_0x131595,JSON['stringify'](_0x4d87c1));delete _0x4d87c1[_0x4733('0x2f')];if(_0x131595===0x191){_0x131595=0x190;}_0x4e835b[_0x4733('0x1b')](_0x131595)['send'](_0x523498['query'][_0x4733('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4d87c1[_0x4733('0x6f')]}:_0x4d87c1);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 062aeff..9fbaa97 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 _0x44e1=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x2fdd00,_0x5e0807){var _0x4e1138=function(_0x1f990b){while(--_0x1f990b){_0x2fdd00['push'](_0x2fdd00['shift']());}};_0x4e1138(++_0x5e0807);}(_0x44e1,0xaa));var _0x144e=function(_0x117395,_0x555417){_0x117395=_0x117395-0x0;var _0x4fc350=_0x44e1[_0x117395];return _0x4fc350;};'use strict';var _=require(_0x144e('0x0'));var util=require(_0x144e('0x1'));var logger=require(_0x144e('0x2'))(_0x144e('0x3'));var moment=require(_0x144e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x144e('0x5'));var rimraf=require('rimraf');var config=require(_0x144e('0x6'));var attributes=require(_0x144e('0x7'));var integrations=require(_0x144e('0x8'));module['exports']=function(_0x187a95,_0x38c2e0){return _0x187a95[_0x144e('0x9')](_0x144e('0xa'),attributes,{'tableName':_0x144e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5018=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x5018,0x1b7));var _0x8501=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x5018[_0x438fe1];return _0x3c8e1b;};'use strict';var _=require(_0x8501('0x0'));var util=require(_0x8501('0x1'));var logger=require(_0x8501('0x2'))(_0x8501('0x3'));var moment=require('moment');var BPromise=require(_0x8501('0x4'));var rp=require(_0x8501('0x5'));var fs=require('fs');var path=require(_0x8501('0x6'));var rimraf=require(_0x8501('0x7'));var config=require(_0x8501('0x8'));var attributes=require(_0x8501('0x9'));var integrations=require(_0x8501('0xa'));module[_0x8501('0xb')]=function(_0x10661,_0x34b852){return _0x10661['define'](_0x8501('0xc'),attributes,{'tableName':_0x8501('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 536308d..58b6a0d 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 _0x2e65=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','findAll','options','raw','where','attributes','limit','model','include','map','debug','GetZendeskAccount','ShowZendeskAccount','find','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e65,0x193));var _0x52e6=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x2e65[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var moment=require(_0x52e6('0x2'));var BPromise=require(_0x52e6('0x3'));var rs=require(_0x52e6('0x4'));var fs=require('fs');var Redis=require(_0x52e6('0x5'));var db=require(_0x52e6('0x6'))['db'];var utils=require(_0x52e6('0x7'));var logger=require('../../config/logger')(_0x52e6('0x8'));var config=require(_0x52e6('0x9'));var jayson=require(_0x52e6('0xa'));var client=jayson[_0x52e6('0xb')][_0x52e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x116651,_0x15e4af,_0x1401a3){return new BPromise(function(_0x27f270,_0x2ab17e){return client['request'](_0x116651,_0x1401a3)[_0x52e6('0xd')](function(_0x1db169){logger['info'](_0x52e6('0xe'),_0x15e4af,'request\x20sent');logger['debug'](_0x52e6('0xf'),_0x15e4af,_0x52e6('0x10'),JSON[_0x52e6('0x11')](_0x1db169));if(_0x1db169[_0x52e6('0x12')]){if(_0x1db169[_0x52e6('0x12')][_0x52e6('0x13')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x2ab17e(_0x1db169['error'][_0x52e6('0x14')]);}logger[_0x52e6('0x12')](_0x52e6('0xe'),_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x27f270(_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);}else{logger[_0x52e6('0x15')](_0x52e6('0xe'),_0x15e4af,_0x52e6('0x10'));_0x27f270(_0x1db169[_0x52e6('0x16')][_0x52e6('0x14')]);}})[_0x52e6('0x17')](function(_0x5c275c){logger['error'](_0x52e6('0xe'),_0x15e4af,_0x5c275c);_0x2ab17e(_0x5c275c);});});}exports['GetZendeskAccount']=function(_0x5363d9){var _0x3a3a47=this;return new Promise(function(_0x3997ed,_0x3631e6){return db['ZendeskAccount'][_0x52e6('0x18')]({'raw':_0x5363d9['options']?_0x5363d9[_0x52e6('0x19')][_0x52e6('0x1a')]===undefined?!![]:![]:!![],'where':_0x5363d9[_0x52e6('0x19')]?_0x5363d9['options'][_0x52e6('0x1b')]||null:null,'attributes':_0x5363d9['options']?_0x5363d9[_0x52e6('0x19')][_0x52e6('0x1c')]||null:null,'limit':_0x5363d9[_0x52e6('0x19')]?_0x5363d9['options'][_0x52e6('0x1d')]||null:null,'include':_0x5363d9[_0x52e6('0x19')]?_0x5363d9['options']['include']?_['map'](_0x5363d9[_0x52e6('0x19')]['include'],function(_0x37a59c){return{'model':db[_0x37a59c[_0x52e6('0x1e')]],'as':_0x37a59c['as'],'attributes':_0x37a59c[_0x52e6('0x1c')],'include':_0x37a59c[_0x52e6('0x1f')]?_[_0x52e6('0x20')](_0x37a59c['include'],function(_0x2d5087){return{'model':db[_0x2d5087['model']],'as':_0x2d5087['as'],'attributes':_0x2d5087[_0x52e6('0x1c')],'include':_0x2d5087[_0x52e6('0x1f')]?_[_0x52e6('0x20')](_0x2d5087[_0x52e6('0x1f')],function(_0x1edc6c){return{'model':db[_0x1edc6c[_0x52e6('0x1e')]],'as':_0x1edc6c['as'],'attributes':_0x1edc6c[_0x52e6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x52e6('0xd')](function(_0x160de2){logger[_0x52e6('0x15')]('GetZendeskAccount',_0x5363d9);logger[_0x52e6('0x21')](_0x52e6('0x22'),_0x5363d9,JSON[_0x52e6('0x11')](_0x160de2));_0x3997ed(_0x160de2);})[_0x52e6('0x17')](function(_0x40821c){logger[_0x52e6('0x12')](_0x52e6('0x22'),_0x40821c['message'],_0x5363d9);_0x3631e6(_0x3a3a47['error'](0x1f4,_0x40821c[_0x52e6('0x14')]));});});};exports[_0x52e6('0x23')]=function(_0x116743){var _0x1e2299=this;return new Promise(function(_0x3554fe,_0x5b0446){return db['ZendeskAccount'][_0x52e6('0x24')]({'raw':_0x116743[_0x52e6('0x19')]?_0x116743[_0x52e6('0x19')][_0x52e6('0x1a')]===undefined?!![]:![]:!![],'where':_0x116743[_0x52e6('0x19')]?_0x116743['options'][_0x52e6('0x1b')]||null:null,'attributes':_0x116743[_0x52e6('0x19')]?_0x116743['options'][_0x52e6('0x1c')]||null:null,'include':_0x116743[_0x52e6('0x19')]?_0x116743[_0x52e6('0x19')][_0x52e6('0x1f')]?_['map'](_0x116743[_0x52e6('0x19')][_0x52e6('0x1f')],function(_0x56994f){return{'model':db[_0x56994f[_0x52e6('0x1e')]],'as':_0x56994f['as'],'attributes':_0x56994f[_0x52e6('0x1c')],'include':_0x56994f['include']?_['map'](_0x56994f[_0x52e6('0x1f')],function(_0x18b561){return{'model':db[_0x18b561[_0x52e6('0x1e')]],'as':_0x18b561['as'],'attributes':_0x18b561['attributes'],'include':_0x18b561[_0x52e6('0x1f')]?_[_0x52e6('0x20')](_0x18b561[_0x52e6('0x1f')],function(_0x167c85){return{'model':db[_0x167c85[_0x52e6('0x1e')]],'as':_0x167c85['as'],'attributes':_0x167c85[_0x52e6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b25b0){logger[_0x52e6('0x15')]('ShowZendeskAccount',_0x116743);logger[_0x52e6('0x21')](_0x52e6('0x23'),_0x116743,JSON[_0x52e6('0x11')](_0x4b25b0));_0x3554fe(_0x4b25b0);})['catch'](function(_0x303524){logger[_0x52e6('0x12')]('ShowZendeskAccount',_0x303524[_0x52e6('0x14')],_0x116743);_0x5b0446(_0x1e2299[_0x52e6('0x12')](0x1f4,_0x303524[_0x52e6('0x14')]));});});}; \ No newline at end of file +var _0xb1fc=['http','request','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ZendeskAccount','findAll','options','raw','limit','include','model','attributes','map','then','GetZendeskAccount','find','where','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x710cf0,_0x2dee3c){var _0x2fb53f=function(_0x47968c){while(--_0x47968c){_0x710cf0['push'](_0x710cf0['shift']());}};_0x2fb53f(++_0x2dee3c);}(_0xb1fc,0xb3));var _0xcb1f=function(_0x55e71e,_0x1034bd){_0x55e71e=_0x55e71e-0x0;var _0x26b638=_0xb1fc[_0x55e71e];return _0x26b638;};'use strict';var _=require(_0xcb1f('0x0'));var util=require(_0xcb1f('0x1'));var moment=require('moment');var BPromise=require(_0xcb1f('0x2'));var rs=require(_0xcb1f('0x3'));var fs=require('fs');var Redis=require(_0xcb1f('0x4'));var db=require(_0xcb1f('0x5'))['db'];var utils=require(_0xcb1f('0x6'));var logger=require(_0xcb1f('0x7'))(_0xcb1f('0x8'));var config=require(_0xcb1f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcb1f('0xa')][_0xcb1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fcf0c,_0x348b02,_0x372433){return new BPromise(function(_0x3a79cb,_0x44281a){return client[_0xcb1f('0xc')](_0x2fcf0c,_0x372433)['then'](function(_0x423aac){logger['info'](_0xcb1f('0xd'),_0x348b02,'request\x20sent');logger[_0xcb1f('0xe')](_0xcb1f('0xf'),_0x348b02,_0xcb1f('0x10'),JSON[_0xcb1f('0x11')](_0x423aac));if(_0x423aac[_0xcb1f('0x12')]){if(_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x13')]===0x1f4){logger[_0xcb1f('0x12')](_0xcb1f('0xd'),_0x348b02,_0x423aac['error'][_0xcb1f('0x14')]);return _0x44281a(_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x14')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x348b02,_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x14')]);return _0x3a79cb(_0x423aac[_0xcb1f('0x12')]['message']);}else{logger[_0xcb1f('0x15')](_0xcb1f('0xd'),_0x348b02,'request\x20sent');_0x3a79cb(_0x423aac[_0xcb1f('0x16')]['message']);}})[_0xcb1f('0x17')](function(_0x1e5873){logger[_0xcb1f('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x348b02,_0x1e5873);_0x44281a(_0x1e5873);});});}exports['GetZendeskAccount']=function(_0x35571e){var _0x1fd659=this;return new Promise(function(_0x887984,_0x1971bb){return db[_0xcb1f('0x18')][_0xcb1f('0x19')]({'raw':_0x35571e[_0xcb1f('0x1a')]?_0x35571e[_0xcb1f('0x1a')][_0xcb1f('0x1b')]===undefined?!![]:![]:!![],'where':_0x35571e[_0xcb1f('0x1a')]?_0x35571e['options']['where']||null:null,'attributes':_0x35571e['options']?_0x35571e[_0xcb1f('0x1a')]['attributes']||null:null,'limit':_0x35571e['options']?_0x35571e[_0xcb1f('0x1a')][_0xcb1f('0x1c')]||null:null,'include':_0x35571e[_0xcb1f('0x1a')]?_0x35571e['options'][_0xcb1f('0x1d')]?_['map'](_0x35571e['options'][_0xcb1f('0x1d')],function(_0x426a0d){return{'model':db[_0x426a0d[_0xcb1f('0x1e')]],'as':_0x426a0d['as'],'attributes':_0x426a0d[_0xcb1f('0x1f')],'include':_0x426a0d[_0xcb1f('0x1d')]?_[_0xcb1f('0x20')](_0x426a0d[_0xcb1f('0x1d')],function(_0x39cafb){return{'model':db[_0x39cafb[_0xcb1f('0x1e')]],'as':_0x39cafb['as'],'attributes':_0x39cafb[_0xcb1f('0x1f')],'include':_0x39cafb[_0xcb1f('0x1d')]?_['map'](_0x39cafb[_0xcb1f('0x1d')],function(_0x3e627b){return{'model':db[_0x3e627b[_0xcb1f('0x1e')]],'as':_0x3e627b['as'],'attributes':_0x3e627b[_0xcb1f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcb1f('0x21')](function(_0x36145d){logger[_0xcb1f('0x15')]('GetZendeskAccount',_0x35571e);logger['debug'](_0xcb1f('0x22'),_0x35571e,JSON[_0xcb1f('0x11')](_0x36145d));_0x887984(_0x36145d);})[_0xcb1f('0x17')](function(_0x4ff551){logger[_0xcb1f('0x12')](_0xcb1f('0x22'),_0x4ff551[_0xcb1f('0x14')],_0x35571e);_0x1971bb(_0x1fd659[_0xcb1f('0x12')](0x1f4,_0x4ff551[_0xcb1f('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x10ad87){var _0xf21389=this;return new Promise(function(_0x43219c,_0x4e1f69){return db[_0xcb1f('0x18')][_0xcb1f('0x23')]({'raw':_0x10ad87[_0xcb1f('0x1a')]?_0x10ad87[_0xcb1f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x10ad87['options']?_0x10ad87[_0xcb1f('0x1a')][_0xcb1f('0x24')]||null:null,'attributes':_0x10ad87[_0xcb1f('0x1a')]?_0x10ad87['options'][_0xcb1f('0x1f')]||null:null,'include':_0x10ad87[_0xcb1f('0x1a')]?_0x10ad87[_0xcb1f('0x1a')][_0xcb1f('0x1d')]?_['map'](_0x10ad87[_0xcb1f('0x1a')]['include'],function(_0x13a384){return{'model':db[_0x13a384[_0xcb1f('0x1e')]],'as':_0x13a384['as'],'attributes':_0x13a384[_0xcb1f('0x1f')],'include':_0x13a384[_0xcb1f('0x1d')]?_['map'](_0x13a384[_0xcb1f('0x1d')],function(_0x3470a8){return{'model':db[_0x3470a8[_0xcb1f('0x1e')]],'as':_0x3470a8['as'],'attributes':_0x3470a8[_0xcb1f('0x1f')],'include':_0x3470a8[_0xcb1f('0x1d')]?_['map'](_0x3470a8[_0xcb1f('0x1d')],function(_0x27ea3e){return{'model':db[_0x27ea3e['model']],'as':_0x27ea3e['as'],'attributes':_0x27ea3e[_0xcb1f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcb1f('0x21')](function(_0x123660){logger['info'](_0xcb1f('0x25'),_0x10ad87);logger['debug'](_0xcb1f('0x25'),_0x10ad87,JSON[_0xcb1f('0x11')](_0x123660));_0x43219c(_0x123660);})['catch'](function(_0x21c6b2){logger['error'](_0xcb1f('0x25'),_0x21c6b2[_0xcb1f('0x14')],_0x10ad87);_0x4e1f69(_0xf21389[_0xcb1f('0x12')](0x1f4,_0x21c6b2['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2a34b00..a666290 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 _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xdd8c65,_0x47ddfe){var _0x5b471a=function(_0x587338){while(--_0x587338){_0xdd8c65['push'](_0xdd8c65['shift']());}};_0x5b471a(++_0x47ddfe);}(_0xac4a,0x13f));var _0xaac4=function(_0x35c02a,_0x720755){_0x35c02a=_0x35c02a-0x0;var _0x505d17=_0xac4a[_0x35c02a];return _0x505d17;};'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['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router; \ No newline at end of file +var _0x4024=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/fields','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update','delete','destroy','exports','multer'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x4024,0x89));var _0x4402=function(_0x149659,_0x5ac475){_0x149659=_0x149659-0x0;var _0x26f766=_0x4024[_0x149659];return _0x26f766;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x4402('0x9')]('/:id/subjects',auth[_0x4402('0x7')](),controller['getSubjects']);router[_0x4402('0x9')]('/:id/descriptions',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['get'](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0xd')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xf')](_0x4402('0xc'),auth[_0x4402('0x7')](),controller[_0x4402('0x10')]);router[_0x4402('0x11')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0x12'),auth[_0x4402('0x7')](),controller[_0x4402('0x15')]);module[_0x4402('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index f109fcd..e0f2012 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 _0xc19a=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc19a,0x10f));var _0xac19=function(_0x2a8699,_0x748056){_0x2a8699=_0x2a8699-0x0;var _0x16e54b=_0xc19a[_0x2a8699];return _0x16e54b;};'use strict';var Sequelize=require(_0xac19('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac19('0x1')]}}; \ No newline at end of file +var _0xd3aa=['sequelize','STRING'];(function(_0x5ee83b,_0x6b72e2){var _0x5bfe0c=function(_0x44fad5){while(--_0x44fad5){_0x5ee83b['push'](_0x5ee83b['shift']());}};_0x5bfe0c(++_0x6b72e2);}(_0xd3aa,0x15a));var _0xad3a=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xd3aa[_0x138f59];return _0x3d114d;};'use strict';var Sequelize=require(_0xad3a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xad3a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 96797af..43d0717 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 _0xedfa=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','find','create','body','getFields','ZendeskField','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x16e1c1,_0x4ea9ff){var _0x4837e3=function(_0x35deb6){while(--_0x35deb6){_0x16e1c1['push'](_0x16e1c1['shift']());}};_0x4837e3(++_0x4ea9ff);}(_0xedfa,0x16f));var _0xaedf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xedfa[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xaedf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaedf('0x1'));var jsonpatch=require(_0xaedf('0x2'));var rp=require('request-promise');var moment=require(_0xaedf('0x3'));var BPromise=require(_0xaedf('0x4'));var Mustache=require(_0xaedf('0x5'));var util=require(_0xaedf('0x6'));var path=require(_0xaedf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaedf('0x8'));var fs=require('fs');var fs_extra=require(_0xaedf('0x9'));var _=require(_0xaedf('0xa'));var squel=require('squel');var crypto=require(_0xaedf('0xb'));var jsforce=require(_0xaedf('0xc'));var deskjs=require(_0xaedf('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaedf('0xe'));var Redis=require('ioredis');var authService=require(_0xaedf('0xf'));var qs=require(_0xaedf('0x10'));var as=require(_0xaedf('0x11'));var hardwareService=require(_0xaedf('0x12'));var logger=require(_0xaedf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xaedf('0x14'));var licenseUtil=require(_0xaedf('0x15'));var db=require(_0xaedf('0x16'))['db'];function respondWithStatusCode(_0x18f9f9,_0x2e0fad){_0x2e0fad=_0x2e0fad||0xcc;return function(_0x34f72b){if(_0x34f72b){return _0x18f9f9[_0xaedf('0x17')](_0x2e0fad);}return _0x18f9f9[_0xaedf('0x18')](_0x2e0fad)['end']();};}function respondWithResult(_0x5acf7b,_0x3ee791){_0x3ee791=_0x3ee791||0xc8;return function(_0x184dd8){if(_0x184dd8){return _0x5acf7b[_0xaedf('0x18')](_0x3ee791)['json'](_0x184dd8);}};}function respondWithFilteredResult(_0xa5ec20,_0x5b7569){return function(_0x35ed99){if(_0x35ed99){var _0x189aff=typeof _0x5b7569[_0xaedf('0x19')]===_0xaedf('0x1a')&&typeof _0x5b7569[_0xaedf('0x1b')]===_0xaedf('0x1a');var _0x351973=_0x35ed99[_0xaedf('0x1c')];var _0x2c8fb4=_0x189aff?0x0:_0x5b7569[_0xaedf('0x19')];var _0x1e03eb=_0x189aff?_0x35ed99['count']:_0x5b7569['offset']+_0x5b7569[_0xaedf('0x1b')];var _0x3c72fa;if(_0x1e03eb>=_0x351973){_0x1e03eb=_0x351973;_0x3c72fa=0xc8;}else{_0x3c72fa=0xce;}_0xa5ec20[_0xaedf('0x18')](_0x3c72fa);return _0xa5ec20[_0xaedf('0x1d')](_0xaedf('0x1e'),_0x2c8fb4+'-'+_0x1e03eb+'/'+_0x351973)[_0xaedf('0x1f')](_0x35ed99);}return null;};}function patchUpdates(_0x42866b){return function(_0x272d56){try{jsonpatch[_0xaedf('0x20')](_0x272d56,_0x42866b,!![]);}catch(_0x1ce6a6){return BPromise[_0xaedf('0x21')](_0x1ce6a6);}return _0x272d56['save']();};}function saveUpdates(_0x5b1288,_0x2ee2e8){return function(_0x28adfb){if(_0x28adfb){return _0x28adfb[_0xaedf('0x22')](_0x5b1288)[_0xaedf('0x23')](function(_0x1e80c4){return _0x1e80c4;});}return null;};}function removeEntity(_0x290557,_0x5e2ee2){return function(_0x2d1453){if(_0x2d1453){return _0x2d1453[_0xaedf('0x24')]()[_0xaedf('0x23')](function(){_0x290557[_0xaedf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b81fb,_0x5476bc){return function(_0xc7089){if(!_0xc7089){_0x3b81fb[_0xaedf('0x17')](0x194);}return _0xc7089;};}function handleError(_0x484c04,_0xe16741){_0xe16741=_0xe16741||0x1f4;return function(_0x802974){logger[_0xaedf('0x25')](_0x802974[_0xaedf('0x26')]);if(_0x802974['name']){delete _0x802974[_0xaedf('0x27')];}_0x484c04[_0xaedf('0x18')](_0xe16741)[_0xaedf('0x28')](_0x802974);};}exports[_0xaedf('0x29')]=function(_0x2961ae,_0x188330){var _0x4d60fd={},_0xd2a19f={},_0x266661={'count':0x0,'rows':[]};var _0x10c302=_[_0xaedf('0x2a')](db[_0xaedf('0x2b')]['rawAttributes'],function(_0x1ee5b3){return{'name':_0x1ee5b3[_0xaedf('0x2c')],'type':_0x1ee5b3[_0xaedf('0x2d')][_0xaedf('0x2e')]};});_0xd2a19f[_0xaedf('0x2f')]=_[_0xaedf('0x2a')](_0x10c302,'name');_0xd2a19f[_0xaedf('0x30')]=_['keys'](_0x2961ae[_0xaedf('0x30')]);_0xd2a19f['filters']=_[_0xaedf('0x31')](_0xd2a19f[_0xaedf('0x2f')],_0xd2a19f[_0xaedf('0x30')]);_0x4d60fd['attributes']=_[_0xaedf('0x31')](_0xd2a19f[_0xaedf('0x2f')],qs[_0xaedf('0x32')](_0x2961ae[_0xaedf('0x30')][_0xaedf('0x32')]));_0x4d60fd[_0xaedf('0x33')]=_0x4d60fd['attributes']['length']?_0x4d60fd[_0xaedf('0x33')]:_0xd2a19f['model'];if(!_0x2961ae[_0xaedf('0x30')][_0xaedf('0x34')](_0xaedf('0x35'))){_0x4d60fd[_0xaedf('0x1b')]=qs[_0xaedf('0x1b')](_0x2961ae['query'][_0xaedf('0x1b')]);_0x4d60fd[_0xaedf('0x19')]=qs['offset'](_0x2961ae[_0xaedf('0x30')][_0xaedf('0x19')]);}_0x4d60fd[_0xaedf('0x36')]=qs[_0xaedf('0x37')](_0x2961ae[_0xaedf('0x30')][_0xaedf('0x37')]);_0x4d60fd[_0xaedf('0x38')]=qs[_0xaedf('0x39')](_[_0xaedf('0x3a')](_0x2961ae[_0xaedf('0x30')],_0xd2a19f['filters']),_0x10c302);if(_0x2961ae[_0xaedf('0x30')][_0xaedf('0x3b')]){_0x4d60fd[_0xaedf('0x38')]=_[_0xaedf('0x3c')](_0x4d60fd['where'],{'$or':_[_0xaedf('0x2a')](_0x10c302,function(_0x24acf1){if(_0x24acf1['type']!==_0xaedf('0x3d')){var _0x1f52f1={};_0x1f52f1[_0x24acf1[_0xaedf('0x27')]]={'$like':'%'+_0x2961ae[_0xaedf('0x30')][_0xaedf('0x3b')]+'%'};return _0x1f52f1;}})});}_0x4d60fd=_[_0xaedf('0x3c')]({},_0x4d60fd,_0x2961ae[_0xaedf('0x3e')]);var _0x427775={'where':_0x4d60fd[_0xaedf('0x38')]};return db['ZendeskConfiguration']['count'](_0x427775)['then'](function(_0x322ae6){_0x266661[_0xaedf('0x1c')]=_0x322ae6;if(_0x2961ae[_0xaedf('0x30')][_0xaedf('0x3f')]){_0x4d60fd[_0xaedf('0x40')]=[{'all':!![]}];}return db[_0xaedf('0x2b')][_0xaedf('0x41')](_0x4d60fd);})[_0xaedf('0x23')](function(_0x4a496c){_0x266661[_0xaedf('0x42')]=_0x4a496c;return _0x266661;})[_0xaedf('0x23')](respondWithFilteredResult(_0x188330,_0x4d60fd))[_0xaedf('0x43')](handleError(_0x188330,null));};exports[_0xaedf('0x44')]=function(_0x2b4a3b,_0x1bc3e5){var _0x55a715={'raw':![],'where':{'id':_0x2b4a3b[_0xaedf('0x45')]['id']}},_0x4be331={};_0x4be331['model']=_['keys'](db[_0xaedf('0x2b')][_0xaedf('0x46')]);_0x4be331[_0xaedf('0x30')]=_[_0xaedf('0x47')](_0x2b4a3b['query']);_0x4be331[_0xaedf('0x39')]=_['intersection'](_0x4be331[_0xaedf('0x2f')],_0x4be331[_0xaedf('0x30')]);_0x55a715[_0xaedf('0x33')]=_[_0xaedf('0x31')](_0x4be331[_0xaedf('0x2f')],qs['fields'](_0x2b4a3b[_0xaedf('0x30')]['fields']));_0x55a715[_0xaedf('0x33')]=_0x55a715[_0xaedf('0x33')][_0xaedf('0x48')]?_0x55a715[_0xaedf('0x33')]:_0x4be331[_0xaedf('0x2f')];if(_0x2b4a3b[_0xaedf('0x30')][_0xaedf('0x3f')]){_0x55a715[_0xaedf('0x40')]=[{'all':!![]}];}_0x55a715=_['merge']({},_0x55a715,_0x2b4a3b['options']);return db[_0xaedf('0x2b')][_0xaedf('0x49')](_0x55a715)['then'](handleEntityNotFound(_0x1bc3e5,null))[_0xaedf('0x23')](respondWithResult(_0x1bc3e5,null))['catch'](handleError(_0x1bc3e5,null));};exports[_0xaedf('0x4a')]=function(_0x141fd1,_0x2fee31){return db[_0xaedf('0x2b')][_0xaedf('0x4a')](_0x141fd1[_0xaedf('0x4b')],{})[_0xaedf('0x23')](respondWithResult(_0x2fee31,0xc9))['catch'](handleError(_0x2fee31,null));};exports[_0xaedf('0x22')]=function(_0x5234da,_0x502574){if(_0x5234da[_0xaedf('0x4b')]['id']){delete _0x5234da[_0xaedf('0x4b')]['id'];}return db[_0xaedf('0x2b')][_0xaedf('0x49')]({'where':{'id':_0x5234da[_0xaedf('0x45')]['id']}})[_0xaedf('0x23')](handleEntityNotFound(_0x502574,null))[_0xaedf('0x23')](saveUpdates(_0x5234da[_0xaedf('0x4b')],null))[_0xaedf('0x23')](respondWithResult(_0x502574,null))[_0xaedf('0x43')](handleError(_0x502574,null));};exports[_0xaedf('0x24')]=function(_0x20d722,_0x422ba2){return db['ZendeskConfiguration']['find']({'where':{'id':_0x20d722[_0xaedf('0x45')]['id']}})[_0xaedf('0x23')](handleEntityNotFound(_0x422ba2,null))[_0xaedf('0x23')](removeEntity(_0x422ba2,null))['catch'](handleError(_0x422ba2,null));};exports[_0xaedf('0x4c')]=function(_0x45ac75,_0x3c3acd,_0x53fc2c){var _0x189946={};var _0x2bb4b1={};var _0x383fb2;var _0x335f28;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x45ac75['params']['id']}})[_0xaedf('0x23')](handleEntityNotFound(_0x3c3acd,null))['then'](function(_0x1b48bf){if(_0x1b48bf){_0x383fb2=_0x1b48bf;_0x2bb4b1[_0xaedf('0x2f')]=_['keys'](db[_0xaedf('0x4d')][_0xaedf('0x46')]);_0x2bb4b1[_0xaedf('0x30')]=_['keys'](_0x45ac75[_0xaedf('0x30')]);_0x2bb4b1[_0xaedf('0x39')]=_[_0xaedf('0x31')](_0x2bb4b1[_0xaedf('0x2f')],_0x2bb4b1[_0xaedf('0x30')]);_0x189946[_0xaedf('0x33')]=_['intersection'](_0x2bb4b1[_0xaedf('0x2f')],qs[_0xaedf('0x32')](_0x45ac75[_0xaedf('0x30')]['fields']));_0x189946['attributes']=_0x189946['attributes'][_0xaedf('0x48')]?_0x189946[_0xaedf('0x33')]:_0x2bb4b1[_0xaedf('0x2f')];_0x189946[_0xaedf('0x36')]=qs['sort'](_0x45ac75[_0xaedf('0x30')][_0xaedf('0x37')]);_0x189946[_0xaedf('0x38')]=qs[_0xaedf('0x39')](_['pick'](_0x45ac75[_0xaedf('0x30')],_0x2bb4b1[_0xaedf('0x39')]));if(_0x45ac75['query'][_0xaedf('0x3b')]){_0x189946[_0xaedf('0x38')]=_[_0xaedf('0x3c')](_0x189946[_0xaedf('0x38')],{'$or':_['map'](_0x189946[_0xaedf('0x33')],function(_0x30a8e4){var _0x212085={};_0x212085[_0x30a8e4]={'$like':'%'+_0x45ac75[_0xaedf('0x30')][_0xaedf('0x3b')]+'%'};return _0x212085;})});}_0x189946=_[_0xaedf('0x3c')]({},_0x189946,_0x45ac75[_0xaedf('0x3e')]);return _0x383fb2[_0xaedf('0x4c')](_0x189946);}})[_0xaedf('0x23')](function(_0x1e408b){if(_0x1e408b){_0x335f28=_0x1e408b[_0xaedf('0x48')];if(!_0x45ac75['query'][_0xaedf('0x34')](_0xaedf('0x35'))){_0x189946[_0xaedf('0x1b')]=qs[_0xaedf('0x1b')](_0x45ac75['query']['limit']);_0x189946[_0xaedf('0x19')]=qs[_0xaedf('0x19')](_0x45ac75[_0xaedf('0x30')][_0xaedf('0x19')]);}return _0x383fb2[_0xaedf('0x4c')](_0x189946);}})['then'](function(_0x31f6dc){if(_0x31f6dc){return _0x31f6dc?{'count':_0x335f28,'rows':_0x31f6dc}:null;}})['then'](respondWithResult(_0x3c3acd,null))[_0xaedf('0x43')](handleError(_0x3c3acd,null));};exports['getSubjects']=function(_0x5053a3,_0xa25d45,_0x48b360){var _0x2553d5={};var _0x385771={};var _0x5db136;var _0x4a2fe9;return db[_0xaedf('0x2b')][_0xaedf('0x4e')]({'where':{'id':_0x5053a3['params']['id']}})[_0xaedf('0x23')](handleEntityNotFound(_0xa25d45,null))[_0xaedf('0x23')](function(_0x157c83){if(_0x157c83){_0x5db136=_0x157c83;_0x385771['model']=_[_0xaedf('0x47')](db[_0xaedf('0x4d')][_0xaedf('0x46')]);_0x385771[_0xaedf('0x30')]=_[_0xaedf('0x47')](_0x5053a3['query']);_0x385771[_0xaedf('0x39')]=_[_0xaedf('0x31')](_0x385771['model'],_0x385771[_0xaedf('0x30')]);_0x2553d5['attributes']=_['intersection'](_0x385771[_0xaedf('0x2f')],qs[_0xaedf('0x32')](_0x5053a3[_0xaedf('0x30')][_0xaedf('0x32')]));_0x2553d5[_0xaedf('0x33')]=_0x2553d5['attributes'][_0xaedf('0x48')]?_0x2553d5[_0xaedf('0x33')]:_0x385771[_0xaedf('0x2f')];_0x2553d5[_0xaedf('0x36')]=qs[_0xaedf('0x37')](_0x5053a3[_0xaedf('0x30')][_0xaedf('0x37')]);_0x2553d5[_0xaedf('0x38')]=qs['filters'](_['pick'](_0x5053a3[_0xaedf('0x30')],_0x385771[_0xaedf('0x39')]));if(_0x5053a3[_0xaedf('0x30')][_0xaedf('0x3b')]){_0x2553d5['where']=_[_0xaedf('0x3c')](_0x2553d5[_0xaedf('0x38')],{'$or':_[_0xaedf('0x2a')](_0x2553d5[_0xaedf('0x33')],function(_0x43658a){var _0xafd044={};_0xafd044[_0x43658a]={'$like':'%'+_0x5053a3[_0xaedf('0x30')][_0xaedf('0x3b')]+'%'};return _0xafd044;})});}_0x2553d5=_['merge']({},_0x2553d5,_0x5053a3[_0xaedf('0x3e')]);return _0x5db136[_0xaedf('0x4f')](_0x2553d5);}})[_0xaedf('0x23')](function(_0xcf9311){if(_0xcf9311){_0x4a2fe9=_0xcf9311['length'];if(!_0x5053a3[_0xaedf('0x30')][_0xaedf('0x34')](_0xaedf('0x35'))){_0x2553d5[_0xaedf('0x1b')]=qs['limit'](_0x5053a3[_0xaedf('0x30')]['limit']);_0x2553d5[_0xaedf('0x19')]=qs[_0xaedf('0x19')](_0x5053a3[_0xaedf('0x30')][_0xaedf('0x19')]);}return _0x5db136[_0xaedf('0x4f')](_0x2553d5);}})['then'](function(_0x43c532){if(_0x43c532){return _0x43c532?{'count':_0x4a2fe9,'rows':_0x43c532}:null;}})[_0xaedf('0x23')](respondWithResult(_0xa25d45,null))['catch'](handleError(_0xa25d45,null));};exports['getDescriptions']=function(_0x2012a4,_0x45fc97,_0x2f085c){var _0x413abd={};var _0x380313={};var _0x2a3e4c;var _0xa9c48f;return db[_0xaedf('0x2b')]['findOne']({'where':{'id':_0x2012a4[_0xaedf('0x45')]['id']}})[_0xaedf('0x23')](handleEntityNotFound(_0x45fc97,null))[_0xaedf('0x23')](function(_0x5bd3bc){if(_0x5bd3bc){_0x2a3e4c=_0x5bd3bc;_0x380313[_0xaedf('0x2f')]=_[_0xaedf('0x47')](db['ZendeskField'][_0xaedf('0x46')]);_0x380313['query']=_[_0xaedf('0x47')](_0x2012a4['query']);_0x380313[_0xaedf('0x39')]=_[_0xaedf('0x31')](_0x380313[_0xaedf('0x2f')],_0x380313[_0xaedf('0x30')]);_0x413abd[_0xaedf('0x33')]=_['intersection'](_0x380313['model'],qs[_0xaedf('0x32')](_0x2012a4[_0xaedf('0x30')]['fields']));_0x413abd['attributes']=_0x413abd[_0xaedf('0x33')][_0xaedf('0x48')]?_0x413abd['attributes']:_0x380313[_0xaedf('0x2f')];_0x413abd['order']=qs[_0xaedf('0x37')](_0x2012a4[_0xaedf('0x30')][_0xaedf('0x37')]);_0x413abd[_0xaedf('0x38')]=qs[_0xaedf('0x39')](_[_0xaedf('0x3a')](_0x2012a4[_0xaedf('0x30')],_0x380313[_0xaedf('0x39')]));if(_0x2012a4['query'][_0xaedf('0x3b')]){_0x413abd['where']=_[_0xaedf('0x3c')](_0x413abd[_0xaedf('0x38')],{'$or':_[_0xaedf('0x2a')](_0x413abd[_0xaedf('0x33')],function(_0x5a7e42){var _0x180798={};_0x180798[_0x5a7e42]={'$like':'%'+_0x2012a4['query']['filter']+'%'};return _0x180798;})});}_0x413abd=_[_0xaedf('0x3c')]({},_0x413abd,_0x2012a4[_0xaedf('0x3e')]);return _0x2a3e4c[_0xaedf('0x50')](_0x413abd);}})[_0xaedf('0x23')](function(_0x336440){if(_0x336440){_0xa9c48f=_0x336440[_0xaedf('0x48')];if(!_0x2012a4[_0xaedf('0x30')]['hasOwnProperty'](_0xaedf('0x35'))){_0x413abd[_0xaedf('0x1b')]=qs[_0xaedf('0x1b')](_0x2012a4[_0xaedf('0x30')][_0xaedf('0x1b')]);_0x413abd[_0xaedf('0x19')]=qs['offset'](_0x2012a4[_0xaedf('0x30')][_0xaedf('0x19')]);}return _0x2a3e4c[_0xaedf('0x50')](_0x413abd);}})[_0xaedf('0x23')](function(_0x5e9896){if(_0x5e9896){return _0x5e9896?{'count':_0xa9c48f,'rows':_0x5e9896}:null;}})['then'](respondWithResult(_0x45fc97,null))[_0xaedf('0x43')](handleError(_0x45fc97,null));};exports[_0xaedf('0x51')]=function(_0x5e4bf0,_0x2ba37a,_0x38c41d){var _0x271580={};var _0x3e05d6={};var _0x3c1dfc;var _0x3b9476;return db[_0xaedf('0x2b')]['findOne']({'where':{'id':_0x5e4bf0[_0xaedf('0x45')]['id']}})[_0xaedf('0x23')](handleEntityNotFound(_0x2ba37a,null))[_0xaedf('0x23')](function(_0x55cfc7){if(_0x55cfc7){_0x3c1dfc=_0x55cfc7;_0x3e05d6[_0xaedf('0x2f')]=_[_0xaedf('0x47')](db[_0xaedf('0x52')][_0xaedf('0x46')]);_0x3e05d6[_0xaedf('0x30')]=_[_0xaedf('0x47')](_0x5e4bf0[_0xaedf('0x30')]);_0x3e05d6[_0xaedf('0x39')]=_[_0xaedf('0x31')](_0x3e05d6[_0xaedf('0x2f')],_0x3e05d6[_0xaedf('0x30')]);_0x271580['attributes']=_['intersection'](_0x3e05d6['model'],qs[_0xaedf('0x32')](_0x5e4bf0[_0xaedf('0x30')][_0xaedf('0x32')]));_0x271580[_0xaedf('0x33')]=_0x271580[_0xaedf('0x33')][_0xaedf('0x48')]?_0x271580['attributes']:_0x3e05d6[_0xaedf('0x2f')];_0x271580['order']=qs[_0xaedf('0x37')](_0x5e4bf0[_0xaedf('0x30')][_0xaedf('0x37')]);_0x271580[_0xaedf('0x38')]=qs[_0xaedf('0x39')](_['pick'](_0x5e4bf0[_0xaedf('0x30')],_0x3e05d6[_0xaedf('0x39')]));if(_0x5e4bf0[_0xaedf('0x30')]['filter']){_0x271580[_0xaedf('0x38')]=_[_0xaedf('0x3c')](_0x271580[_0xaedf('0x38')],{'$or':_[_0xaedf('0x2a')](_0x271580[_0xaedf('0x33')],function(_0x411996){var _0x1adf53={};_0x1adf53[_0x411996]={'$like':'%'+_0x5e4bf0[_0xaedf('0x30')][_0xaedf('0x3b')]+'%'};return _0x1adf53;})});}_0x271580=_['merge']({},_0x271580,_0x5e4bf0[_0xaedf('0x3e')]);return _0x3c1dfc['getTags'](_0x271580);}})[_0xaedf('0x23')](function(_0x37c13c){if(_0x37c13c){_0x3b9476=_0x37c13c[_0xaedf('0x48')];if(!_0x5e4bf0['query'][_0xaedf('0x34')](_0xaedf('0x35'))){_0x271580['limit']=qs[_0xaedf('0x1b')](_0x5e4bf0['query']['limit']);_0x271580[_0xaedf('0x19')]=qs[_0xaedf('0x19')](_0x5e4bf0['query'][_0xaedf('0x19')]);}return _0x3c1dfc[_0xaedf('0x51')](_0x271580);}})[_0xaedf('0x23')](function(_0x135a6d){if(_0x135a6d){return _0x135a6d?{'count':_0x3b9476,'rows':_0x135a6d}:null;}})[_0xaedf('0x23')](respondWithResult(_0x2ba37a,null))[_0xaedf('0x43')](handleError(_0x2ba37a,null));};exports[_0xaedf('0x53')]=function(_0x53a95d,_0x59994f,_0x1e7251){if(_0x53a95d['body']['id']){delete _0x53a95d[_0xaedf('0x4b')]['id'];}return db[_0xaedf('0x2b')]['findOne']({'where':{'id':_0x53a95d[_0xaedf('0x45')]['id']}})[_0xaedf('0x23')](handleEntityNotFound(_0x59994f,null))[_0xaedf('0x23')](function(_0x15b128){if(_0x15b128){return _0x15b128['setTags'](_0x53a95d[_0xaedf('0x4b')][_0xaedf('0x54')]||[]);}return null;})['then'](respondWithResult(_0x59994f,null))['catch'](handleError(_0x59994f,null));}; \ No newline at end of file +var _0x974e=['getTags','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','reject','save','update','then','stack','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','destroy','getFields','findOne','pick','options','getSubjects','ZendeskField','order','getDescriptions'];(function(_0x2aa0e1,_0x5913d4){var _0x10e065=function(_0x492dfe){while(--_0x492dfe){_0x2aa0e1['push'](_0x2aa0e1['shift']());}};_0x10e065(++_0x5913d4);}(_0x974e,0xa9));var _0xe974=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x974e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe974('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe974('0x1'));var rp=require(_0xe974('0x2'));var moment=require(_0xe974('0x3'));var BPromise=require(_0xe974('0x4'));var Mustache=require(_0xe974('0x5'));var util=require(_0xe974('0x6'));var path=require('path');var sox=require(_0xe974('0x7'));var csv=require(_0xe974('0x8'));var ejs=require(_0xe974('0x9'));var fs=require('fs');var fs_extra=require(_0xe974('0xa'));var _=require(_0xe974('0xb'));var squel=require(_0xe974('0xc'));var crypto=require(_0xe974('0xd'));var jsforce=require(_0xe974('0xe'));var deskjs=require(_0xe974('0xf'));var toCsv=require(_0xe974('0x8'));var querystring=require('querystring');var Papa=require(_0xe974('0x10'));var Redis=require(_0xe974('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe974('0x12'));var as=require(_0xe974('0x13'));var hardwareService=require(_0xe974('0x14'));var logger=require(_0xe974('0x15'))(_0xe974('0x16'));var utils=require(_0xe974('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe974('0x18'));var db=require(_0xe974('0x19'))['db'];function respondWithStatusCode(_0x2c2399,_0x364c1e){_0x364c1e=_0x364c1e||0xcc;return function(_0x453240){if(_0x453240){return _0x2c2399[_0xe974('0x1a')](_0x364c1e);}return _0x2c2399[_0xe974('0x1b')](_0x364c1e)[_0xe974('0x1c')]();};}function respondWithResult(_0x522659,_0xfa05ec){_0xfa05ec=_0xfa05ec||0xc8;return function(_0x35a855){if(_0x35a855){return _0x522659[_0xe974('0x1b')](_0xfa05ec)[_0xe974('0x1d')](_0x35a855);}};}function respondWithFilteredResult(_0x4b2203,_0x3294f2){return function(_0xc6b2c8){if(_0xc6b2c8){var _0x2e9aba=typeof _0x3294f2[_0xe974('0x1e')]==='undefined'&&typeof _0x3294f2[_0xe974('0x1f')]===_0xe974('0x20');var _0x38cd52=_0xc6b2c8['count'];var _0xc72aaf=_0x2e9aba?0x0:_0x3294f2[_0xe974('0x1e')];var _0x2d251a=_0x2e9aba?_0xc6b2c8['count']:_0x3294f2[_0xe974('0x1e')]+_0x3294f2[_0xe974('0x1f')];var _0x580265;if(_0x2d251a>=_0x38cd52){_0x2d251a=_0x38cd52;_0x580265=0xc8;}else{_0x580265=0xce;}_0x4b2203[_0xe974('0x1b')](_0x580265);return _0x4b2203[_0xe974('0x21')]('Content-Range',_0xc72aaf+'-'+_0x2d251a+'/'+_0x38cd52)[_0xe974('0x1d')](_0xc6b2c8);}return null;};}function patchUpdates(_0x2726a9){return function(_0x1f2111){try{jsonpatch['apply'](_0x1f2111,_0x2726a9,!![]);}catch(_0x102670){return BPromise[_0xe974('0x22')](_0x102670);}return _0x1f2111[_0xe974('0x23')]();};}function saveUpdates(_0x57638e,_0x66db29){return function(_0x4d633b){if(_0x4d633b){return _0x4d633b[_0xe974('0x24')](_0x57638e)[_0xe974('0x25')](function(_0x36b990){return _0x36b990;});}return null;};}function removeEntity(_0x419bdf,_0x219ce0){return function(_0x7bbbb){if(_0x7bbbb){return _0x7bbbb['destroy']()[_0xe974('0x25')](function(){_0x419bdf[_0xe974('0x1b')](0xcc)[_0xe974('0x1c')]();});}};}function handleEntityNotFound(_0x4bd8e6,_0x43fe4d){return function(_0x2f1435){if(!_0x2f1435){_0x4bd8e6[_0xe974('0x1a')](0x194);}return _0x2f1435;};}function handleError(_0x2ee8cf,_0x410030){_0x410030=_0x410030||0x1f4;return function(_0x3800bb){logger['error'](_0x3800bb[_0xe974('0x26')]);if(_0x3800bb[_0xe974('0x27')]){delete _0x3800bb['name'];}_0x2ee8cf['status'](_0x410030)['send'](_0x3800bb);};}exports['index']=function(_0x13f13e,_0x558032){var _0x2da7ad={},_0x42e6a8={},_0x17bed9={'count':0x0,'rows':[]};var _0x3ad2f8=_[_0xe974('0x28')](db[_0xe974('0x29')][_0xe974('0x2a')],function(_0x43bd73){return{'name':_0x43bd73[_0xe974('0x2b')],'type':_0x43bd73[_0xe974('0x2c')][_0xe974('0x2d')]};});_0x42e6a8['model']=_[_0xe974('0x28')](_0x3ad2f8,_0xe974('0x27'));_0x42e6a8['query']=_[_0xe974('0x2e')](_0x13f13e[_0xe974('0x2f')]);_0x42e6a8[_0xe974('0x30')]=_[_0xe974('0x31')](_0x42e6a8['model'],_0x42e6a8['query']);_0x2da7ad[_0xe974('0x32')]=_['intersection'](_0x42e6a8['model'],qs['fields'](_0x13f13e[_0xe974('0x2f')][_0xe974('0x33')]));_0x2da7ad[_0xe974('0x32')]=_0x2da7ad[_0xe974('0x32')]['length']?_0x2da7ad[_0xe974('0x32')]:_0x42e6a8[_0xe974('0x34')];if(!_0x13f13e['query'][_0xe974('0x35')](_0xe974('0x36'))){_0x2da7ad[_0xe974('0x1f')]=qs['limit'](_0x13f13e[_0xe974('0x2f')][_0xe974('0x1f')]);_0x2da7ad[_0xe974('0x1e')]=qs['offset'](_0x13f13e['query']['offset']);}_0x2da7ad['order']=qs[_0xe974('0x37')](_0x13f13e[_0xe974('0x2f')][_0xe974('0x37')]);_0x2da7ad[_0xe974('0x38')]=qs[_0xe974('0x30')](_['pick'](_0x13f13e[_0xe974('0x2f')],_0x42e6a8['filters']),_0x3ad2f8);if(_0x13f13e['query']['filter']){_0x2da7ad[_0xe974('0x38')]=_[_0xe974('0x39')](_0x2da7ad[_0xe974('0x38')],{'$or':_[_0xe974('0x28')](_0x3ad2f8,function(_0x45bb41){if(_0x45bb41[_0xe974('0x2c')]!==_0xe974('0x3a')){var _0x416330={};_0x416330[_0x45bb41[_0xe974('0x27')]]={'$like':'%'+_0x13f13e[_0xe974('0x2f')][_0xe974('0x3b')]+'%'};return _0x416330;}})});}_0x2da7ad=_[_0xe974('0x39')]({},_0x2da7ad,_0x13f13e['options']);var _0x2ecf49={'where':_0x2da7ad['where']};return db[_0xe974('0x29')]['count'](_0x2ecf49)[_0xe974('0x25')](function(_0x1a8830){_0x17bed9['count']=_0x1a8830;if(_0x13f13e[_0xe974('0x2f')][_0xe974('0x3c')]){_0x2da7ad[_0xe974('0x3d')]=[{'all':!![]}];}return db[_0xe974('0x29')][_0xe974('0x3e')](_0x2da7ad);})[_0xe974('0x25')](function(_0x3aa448){_0x17bed9[_0xe974('0x3f')]=_0x3aa448;return _0x17bed9;})[_0xe974('0x25')](respondWithFilteredResult(_0x558032,_0x2da7ad))[_0xe974('0x40')](handleError(_0x558032,null));};exports[_0xe974('0x41')]=function(_0x32503c,_0x4471ba){var _0x3a3ffa={'raw':![],'where':{'id':_0x32503c['params']['id']}},_0x4fbeb5={};_0x4fbeb5[_0xe974('0x34')]=_['keys'](db['ZendeskConfiguration'][_0xe974('0x2a')]);_0x4fbeb5[_0xe974('0x2f')]=_[_0xe974('0x2e')](_0x32503c[_0xe974('0x2f')]);_0x4fbeb5[_0xe974('0x30')]=_[_0xe974('0x31')](_0x4fbeb5[_0xe974('0x34')],_0x4fbeb5[_0xe974('0x2f')]);_0x3a3ffa['attributes']=_['intersection'](_0x4fbeb5['model'],qs[_0xe974('0x33')](_0x32503c[_0xe974('0x2f')][_0xe974('0x33')]));_0x3a3ffa[_0xe974('0x32')]=_0x3a3ffa[_0xe974('0x32')][_0xe974('0x42')]?_0x3a3ffa[_0xe974('0x32')]:_0x4fbeb5[_0xe974('0x34')];if(_0x32503c[_0xe974('0x2f')][_0xe974('0x3c')]){_0x3a3ffa[_0xe974('0x3d')]=[{'all':!![]}];}_0x3a3ffa=_[_0xe974('0x39')]({},_0x3a3ffa,_0x32503c['options']);return db['ZendeskConfiguration'][_0xe974('0x43')](_0x3a3ffa)[_0xe974('0x25')](handleEntityNotFound(_0x4471ba,null))[_0xe974('0x25')](respondWithResult(_0x4471ba,null))[_0xe974('0x40')](handleError(_0x4471ba,null));};exports[_0xe974('0x44')]=function(_0x556261,_0x621596){return db[_0xe974('0x29')]['create'](_0x556261[_0xe974('0x45')],{})[_0xe974('0x25')](respondWithResult(_0x621596,0xc9))[_0xe974('0x40')](handleError(_0x621596,null));};exports[_0xe974('0x24')]=function(_0x69387a,_0xdbf720){if(_0x69387a[_0xe974('0x45')]['id']){delete _0x69387a[_0xe974('0x45')]['id'];}return db[_0xe974('0x29')]['find']({'where':{'id':_0x69387a[_0xe974('0x46')]['id']}})[_0xe974('0x25')](handleEntityNotFound(_0xdbf720,null))[_0xe974('0x25')](saveUpdates(_0x69387a['body'],null))[_0xe974('0x25')](respondWithResult(_0xdbf720,null))[_0xe974('0x40')](handleError(_0xdbf720,null));};exports[_0xe974('0x47')]=function(_0x320ecb,_0x25274b){return db['ZendeskConfiguration'][_0xe974('0x43')]({'where':{'id':_0x320ecb['params']['id']}})['then'](handleEntityNotFound(_0x25274b,null))[_0xe974('0x25')](removeEntity(_0x25274b,null))[_0xe974('0x40')](handleError(_0x25274b,null));};exports[_0xe974('0x48')]=function(_0xab5b76,_0x1fef6f,_0x53becc){var _0x24b678={};var _0x370ef9={};var _0x57db4e;var _0x116c11;return db['ZendeskConfiguration'][_0xe974('0x49')]({'where':{'id':_0xab5b76[_0xe974('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fef6f,null))[_0xe974('0x25')](function(_0x464dc5){if(_0x464dc5){_0x57db4e=_0x464dc5;_0x370ef9[_0xe974('0x34')]=_[_0xe974('0x2e')](db['ZendeskField'][_0xe974('0x2a')]);_0x370ef9[_0xe974('0x2f')]=_[_0xe974('0x2e')](_0xab5b76['query']);_0x370ef9['filters']=_[_0xe974('0x31')](_0x370ef9[_0xe974('0x34')],_0x370ef9['query']);_0x24b678['attributes']=_[_0xe974('0x31')](_0x370ef9[_0xe974('0x34')],qs[_0xe974('0x33')](_0xab5b76[_0xe974('0x2f')]['fields']));_0x24b678[_0xe974('0x32')]=_0x24b678[_0xe974('0x32')][_0xe974('0x42')]?_0x24b678['attributes']:_0x370ef9[_0xe974('0x34')];_0x24b678['order']=qs[_0xe974('0x37')](_0xab5b76[_0xe974('0x2f')][_0xe974('0x37')]);_0x24b678['where']=qs['filters'](_[_0xe974('0x4a')](_0xab5b76['query'],_0x370ef9[_0xe974('0x30')]));if(_0xab5b76[_0xe974('0x2f')]['filter']){_0x24b678[_0xe974('0x38')]=_[_0xe974('0x39')](_0x24b678[_0xe974('0x38')],{'$or':_[_0xe974('0x28')](_0x24b678[_0xe974('0x32')],function(_0x2deaaf){var _0x3c7de3={};_0x3c7de3[_0x2deaaf]={'$like':'%'+_0xab5b76['query'][_0xe974('0x3b')]+'%'};return _0x3c7de3;})});}_0x24b678=_[_0xe974('0x39')]({},_0x24b678,_0xab5b76[_0xe974('0x4b')]);return _0x57db4e[_0xe974('0x48')](_0x24b678);}})['then'](function(_0x51eb07){if(_0x51eb07){_0x116c11=_0x51eb07['length'];if(!_0xab5b76['query']['hasOwnProperty']('nolimit')){_0x24b678[_0xe974('0x1f')]=qs[_0xe974('0x1f')](_0xab5b76[_0xe974('0x2f')][_0xe974('0x1f')]);_0x24b678['offset']=qs['offset'](_0xab5b76[_0xe974('0x2f')][_0xe974('0x1e')]);}return _0x57db4e[_0xe974('0x48')](_0x24b678);}})[_0xe974('0x25')](function(_0x4e0b8d){if(_0x4e0b8d){return _0x4e0b8d?{'count':_0x116c11,'rows':_0x4e0b8d}:null;}})['then'](respondWithResult(_0x1fef6f,null))[_0xe974('0x40')](handleError(_0x1fef6f,null));};exports[_0xe974('0x4c')]=function(_0x1e17ac,_0x443939,_0x466e81){var _0x3b42da={};var _0x198691={};var _0x9645c3;var _0x2cc22d;return db[_0xe974('0x29')]['findOne']({'where':{'id':_0x1e17ac[_0xe974('0x46')]['id']}})['then'](handleEntityNotFound(_0x443939,null))[_0xe974('0x25')](function(_0x44ee34){if(_0x44ee34){_0x9645c3=_0x44ee34;_0x198691[_0xe974('0x34')]=_[_0xe974('0x2e')](db[_0xe974('0x4d')][_0xe974('0x2a')]);_0x198691[_0xe974('0x2f')]=_[_0xe974('0x2e')](_0x1e17ac[_0xe974('0x2f')]);_0x198691[_0xe974('0x30')]=_['intersection'](_0x198691[_0xe974('0x34')],_0x198691[_0xe974('0x2f')]);_0x3b42da[_0xe974('0x32')]=_[_0xe974('0x31')](_0x198691[_0xe974('0x34')],qs[_0xe974('0x33')](_0x1e17ac[_0xe974('0x2f')][_0xe974('0x33')]));_0x3b42da[_0xe974('0x32')]=_0x3b42da[_0xe974('0x32')][_0xe974('0x42')]?_0x3b42da[_0xe974('0x32')]:_0x198691[_0xe974('0x34')];_0x3b42da[_0xe974('0x4e')]=qs[_0xe974('0x37')](_0x1e17ac['query'][_0xe974('0x37')]);_0x3b42da[_0xe974('0x38')]=qs[_0xe974('0x30')](_['pick'](_0x1e17ac['query'],_0x198691[_0xe974('0x30')]));if(_0x1e17ac[_0xe974('0x2f')][_0xe974('0x3b')]){_0x3b42da[_0xe974('0x38')]=_[_0xe974('0x39')](_0x3b42da[_0xe974('0x38')],{'$or':_[_0xe974('0x28')](_0x3b42da[_0xe974('0x32')],function(_0x47ebe4){var _0x6d54d5={};_0x6d54d5[_0x47ebe4]={'$like':'%'+_0x1e17ac['query'][_0xe974('0x3b')]+'%'};return _0x6d54d5;})});}_0x3b42da=_[_0xe974('0x39')]({},_0x3b42da,_0x1e17ac[_0xe974('0x4b')]);return _0x9645c3[_0xe974('0x4c')](_0x3b42da);}})[_0xe974('0x25')](function(_0x59009c){if(_0x59009c){_0x2cc22d=_0x59009c[_0xe974('0x42')];if(!_0x1e17ac[_0xe974('0x2f')]['hasOwnProperty'](_0xe974('0x36'))){_0x3b42da[_0xe974('0x1f')]=qs[_0xe974('0x1f')](_0x1e17ac[_0xe974('0x2f')][_0xe974('0x1f')]);_0x3b42da[_0xe974('0x1e')]=qs[_0xe974('0x1e')](_0x1e17ac[_0xe974('0x2f')]['offset']);}return _0x9645c3[_0xe974('0x4c')](_0x3b42da);}})[_0xe974('0x25')](function(_0x2c317d){if(_0x2c317d){return _0x2c317d?{'count':_0x2cc22d,'rows':_0x2c317d}:null;}})['then'](respondWithResult(_0x443939,null))[_0xe974('0x40')](handleError(_0x443939,null));};exports['getDescriptions']=function(_0x5b9a61,_0x50b525,_0x5881b9){var _0x3b3760={};var _0x4e594a={};var _0x257338;var _0x85e9ec;return db[_0xe974('0x29')][_0xe974('0x49')]({'where':{'id':_0x5b9a61[_0xe974('0x46')]['id']}})[_0xe974('0x25')](handleEntityNotFound(_0x50b525,null))['then'](function(_0x414cc7){if(_0x414cc7){_0x257338=_0x414cc7;_0x4e594a[_0xe974('0x34')]=_[_0xe974('0x2e')](db[_0xe974('0x4d')][_0xe974('0x2a')]);_0x4e594a[_0xe974('0x2f')]=_[_0xe974('0x2e')](_0x5b9a61[_0xe974('0x2f')]);_0x4e594a[_0xe974('0x30')]=_[_0xe974('0x31')](_0x4e594a[_0xe974('0x34')],_0x4e594a[_0xe974('0x2f')]);_0x3b3760['attributes']=_[_0xe974('0x31')](_0x4e594a[_0xe974('0x34')],qs[_0xe974('0x33')](_0x5b9a61[_0xe974('0x2f')][_0xe974('0x33')]));_0x3b3760['attributes']=_0x3b3760[_0xe974('0x32')][_0xe974('0x42')]?_0x3b3760[_0xe974('0x32')]:_0x4e594a[_0xe974('0x34')];_0x3b3760['order']=qs[_0xe974('0x37')](_0x5b9a61['query'][_0xe974('0x37')]);_0x3b3760[_0xe974('0x38')]=qs[_0xe974('0x30')](_[_0xe974('0x4a')](_0x5b9a61[_0xe974('0x2f')],_0x4e594a[_0xe974('0x30')]));if(_0x5b9a61[_0xe974('0x2f')][_0xe974('0x3b')]){_0x3b3760[_0xe974('0x38')]=_[_0xe974('0x39')](_0x3b3760[_0xe974('0x38')],{'$or':_[_0xe974('0x28')](_0x3b3760[_0xe974('0x32')],function(_0x1ec938){var _0x5ce484={};_0x5ce484[_0x1ec938]={'$like':'%'+_0x5b9a61[_0xe974('0x2f')][_0xe974('0x3b')]+'%'};return _0x5ce484;})});}_0x3b3760=_[_0xe974('0x39')]({},_0x3b3760,_0x5b9a61[_0xe974('0x4b')]);return _0x257338[_0xe974('0x4f')](_0x3b3760);}})['then'](function(_0x242834){if(_0x242834){_0x85e9ec=_0x242834[_0xe974('0x42')];if(!_0x5b9a61['query'][_0xe974('0x35')]('nolimit')){_0x3b3760[_0xe974('0x1f')]=qs[_0xe974('0x1f')](_0x5b9a61[_0xe974('0x2f')][_0xe974('0x1f')]);_0x3b3760[_0xe974('0x1e')]=qs[_0xe974('0x1e')](_0x5b9a61[_0xe974('0x2f')][_0xe974('0x1e')]);}return _0x257338[_0xe974('0x4f')](_0x3b3760);}})[_0xe974('0x25')](function(_0x2b2b38){if(_0x2b2b38){return _0x2b2b38?{'count':_0x85e9ec,'rows':_0x2b2b38}:null;}})[_0xe974('0x25')](respondWithResult(_0x50b525,null))['catch'](handleError(_0x50b525,null));};exports[_0xe974('0x50')]=function(_0x41c7c7,_0x194044,_0x4f6229){var _0x4b113d={};var _0x35e59c={};var _0x19619d;var _0x166498;return db[_0xe974('0x29')]['findOne']({'where':{'id':_0x41c7c7['params']['id']}})[_0xe974('0x25')](handleEntityNotFound(_0x194044,null))[_0xe974('0x25')](function(_0x1fe995){if(_0x1fe995){_0x19619d=_0x1fe995;_0x35e59c[_0xe974('0x34')]=_[_0xe974('0x2e')](db['Tag'][_0xe974('0x2a')]);_0x35e59c['query']=_[_0xe974('0x2e')](_0x41c7c7[_0xe974('0x2f')]);_0x35e59c[_0xe974('0x30')]=_[_0xe974('0x31')](_0x35e59c[_0xe974('0x34')],_0x35e59c[_0xe974('0x2f')]);_0x4b113d[_0xe974('0x32')]=_[_0xe974('0x31')](_0x35e59c[_0xe974('0x34')],qs[_0xe974('0x33')](_0x41c7c7[_0xe974('0x2f')][_0xe974('0x33')]));_0x4b113d['attributes']=_0x4b113d[_0xe974('0x32')]['length']?_0x4b113d['attributes']:_0x35e59c['model'];_0x4b113d[_0xe974('0x4e')]=qs['sort'](_0x41c7c7['query'][_0xe974('0x37')]);_0x4b113d['where']=qs[_0xe974('0x30')](_['pick'](_0x41c7c7[_0xe974('0x2f')],_0x35e59c['filters']));if(_0x41c7c7[_0xe974('0x2f')][_0xe974('0x3b')]){_0x4b113d[_0xe974('0x38')]=_[_0xe974('0x39')](_0x4b113d[_0xe974('0x38')],{'$or':_[_0xe974('0x28')](_0x4b113d[_0xe974('0x32')],function(_0x146355){var _0x51f3e6={};_0x51f3e6[_0x146355]={'$like':'%'+_0x41c7c7[_0xe974('0x2f')][_0xe974('0x3b')]+'%'};return _0x51f3e6;})});}_0x4b113d=_[_0xe974('0x39')]({},_0x4b113d,_0x41c7c7[_0xe974('0x4b')]);return _0x19619d[_0xe974('0x50')](_0x4b113d);}})[_0xe974('0x25')](function(_0x282ae7){if(_0x282ae7){_0x166498=_0x282ae7['length'];if(!_0x41c7c7[_0xe974('0x2f')]['hasOwnProperty'](_0xe974('0x36'))){_0x4b113d['limit']=qs[_0xe974('0x1f')](_0x41c7c7[_0xe974('0x2f')][_0xe974('0x1f')]);_0x4b113d[_0xe974('0x1e')]=qs[_0xe974('0x1e')](_0x41c7c7['query']['offset']);}return _0x19619d['getTags'](_0x4b113d);}})[_0xe974('0x25')](function(_0x2fefe9){if(_0x2fefe9){return _0x2fefe9?{'count':_0x166498,'rows':_0x2fefe9}:null;}})[_0xe974('0x25')](respondWithResult(_0x194044,null))['catch'](handleError(_0x194044,null));};exports[_0xe974('0x51')]=function(_0xc71fb4,_0x192a91,_0x50b66c){if(_0xc71fb4['body']['id']){delete _0xc71fb4[_0xe974('0x45')]['id'];}return db[_0xe974('0x29')][_0xe974('0x49')]({'where':{'id':_0xc71fb4[_0xe974('0x46')]['id']}})[_0xe974('0x25')](handleEntityNotFound(_0x192a91,null))[_0xe974('0x25')](function(_0x7d2046){if(_0x7d2046){return _0x7d2046['setTags'](_0xc71fb4[_0xe974('0x45')][_0xe974('0x52')]||[]);}return null;})[_0xe974('0x25')](respondWithResult(_0x192a91,null))[_0xe974('0x40')](handleError(_0x192a91,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index a883bc1..d027cb6 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 _0x757a=['define','int_zendesk_configurations','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x3e6647,_0x2c0d09){var _0x46bddd=function(_0xad96c0){while(--_0xad96c0){_0x3e6647['push'](_0x3e6647['shift']());}};_0x46bddd(++_0x2c0d09);}(_0x757a,0xde));var _0xa757=function(_0x2e3734,_0x5ece7a){_0x2e3734=_0x2e3734-0x0;var _0x19ef17=_0x757a[_0x2e3734];return _0x19ef17;};'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')]('ZendeskConfiguration',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d25=['api','moment','bluebird','request-promise','path','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger'];(function(_0x3eae7f,_0x33064f){var _0x353603=function(_0x127d6b){while(--_0x127d6b){_0x3eae7f['push'](_0x3eae7f['shift']());}};_0x353603(++_0x33064f);}(_0x7d25,0x8a));var _0x57d2=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x7d25[_0x29d94e];return _0x106237;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'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 f5d8d4b..513e25e 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 _0x0051=['../../config/utils','../../config/logger','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','randomstring','../../mysqldb'];(function(_0x5c9dec,_0x2628c4){var _0x2b7410=function(_0x4d12ac){while(--_0x4d12ac){_0x5c9dec['push'](_0x5c9dec['shift']());}};_0x2b7410(++_0x2628c4);}(_0x0051,0x19e));var _0x1005=function(_0x44db60,_0x4ec8ca){_0x44db60=_0x44db60-0x0;var _0x3fa929=_0x0051[_0x44db60];return _0x3fa929;};'use strict';var _=require(_0x1005('0x0'));var util=require('util');var moment=require(_0x1005('0x1'));var BPromise=require('bluebird');var rs=require(_0x1005('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1005('0x3'))['db'];var utils=require(_0x1005('0x4'));var logger=require(_0x1005('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1005('0x6'));var client=jayson['client'][_0x1005('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x465235,_0x3457b7,_0x553c97){return new BPromise(function(_0x3fda03,_0x3e2b18){return client[_0x1005('0x8')](_0x465235,_0x553c97)[_0x1005('0x9')](function(_0x2e47d2){logger['info'](_0x1005('0xa'),_0x3457b7,_0x1005('0xb'));logger[_0x1005('0xc')](_0x1005('0xd'),_0x3457b7,_0x1005('0xb'),JSON[_0x1005('0xe')](_0x2e47d2));if(_0x2e47d2['error']){if(_0x2e47d2[_0x1005('0xf')][_0x1005('0x10')]===0x1f4){logger[_0x1005('0xf')](_0x1005('0xa'),_0x3457b7,_0x2e47d2[_0x1005('0xf')][_0x1005('0x11')]);return _0x3e2b18(_0x2e47d2['error'][_0x1005('0x11')]);}logger[_0x1005('0xf')](_0x1005('0xa'),_0x3457b7,_0x2e47d2['error'][_0x1005('0x11')]);return _0x3fda03(_0x2e47d2[_0x1005('0xf')][_0x1005('0x11')]);}else{logger[_0x1005('0x12')](_0x1005('0xa'),_0x3457b7,_0x1005('0xb'));_0x3fda03(_0x2e47d2['result'][_0x1005('0x11')]);}})['catch'](function(_0x5549b1){logger[_0x1005('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3457b7,_0x5549b1);_0x3e2b18(_0x5549b1);});});} \ No newline at end of file +var _0x2b26=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xa9bcf1,_0x3e34d7){var _0x445b06=function(_0x14a520){while(--_0x14a520){_0xa9bcf1['push'](_0xa9bcf1['shift']());}};_0x445b06(++_0x3e34d7);}(_0x2b26,0xab));var _0x62b2=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x2b26[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0x62b2('0x0'));var moment=require(_0x62b2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62b2('0x2'))['db'];var utils=require(_0x62b2('0x3'));var logger=require(_0x62b2('0x4'))(_0x62b2('0x5'));var config=require(_0x62b2('0x6'));var jayson=require(_0x62b2('0x7'));var client=jayson['client'][_0x62b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cb3ef,_0x5a128b,_0x36b2d2){return new BPromise(function(_0x4d6cd9,_0x5dbf2f){return client['request'](_0x2cb3ef,_0x36b2d2)[_0x62b2('0x9')](function(_0x3eba52){logger[_0x62b2('0xa')](_0x62b2('0xb'),_0x5a128b,_0x62b2('0xc'));logger[_0x62b2('0xd')](_0x62b2('0xe'),_0x5a128b,'request\x20sent',JSON[_0x62b2('0xf')](_0x3eba52));if(_0x3eba52[_0x62b2('0x10')]){if(_0x3eba52[_0x62b2('0x10')][_0x62b2('0x11')]===0x1f4){logger[_0x62b2('0x10')](_0x62b2('0xb'),_0x5a128b,_0x3eba52[_0x62b2('0x10')][_0x62b2('0x12')]);return _0x5dbf2f(_0x3eba52[_0x62b2('0x10')]['message']);}logger[_0x62b2('0x10')](_0x62b2('0xb'),_0x5a128b,_0x3eba52[_0x62b2('0x10')][_0x62b2('0x12')]);return _0x4d6cd9(_0x3eba52[_0x62b2('0x10')][_0x62b2('0x12')]);}else{logger[_0x62b2('0xa')](_0x62b2('0xb'),_0x5a128b,_0x62b2('0xc'));_0x4d6cd9(_0x3eba52[_0x62b2('0x13')][_0x62b2('0x12')]);}})['catch'](function(_0x497a7f){logger['error'](_0x62b2('0xb'),_0x5a128b,_0x497a7f);_0x5dbf2f(_0x497a7f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index e814568..4a71737 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 _0xa34a=['get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2fb72c,_0x3b46b3){var _0x9ce8b7=function(_0x161a3d){while(--_0x161a3d){_0x2fb72c['push'](_0x2fb72c['shift']());}};_0x9ce8b7(++_0x3b46b3);}(_0xa34a,0x1a3));var _0xaa34=function(_0x34b8f2,_0x1b2243){_0x34b8f2=_0x34b8f2-0x0;var _0x5ab097=_0xa34a[_0x34b8f2];return _0x5ab097;};'use strict';var multer=require('multer');var util=require(_0xaa34('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaa34('0x1'));var router=express[_0xaa34('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xaa34('0x3'));var interaction=require(_0xaa34('0x4'));var config=require(_0xaa34('0x5'));var controller=require('./intZendeskField.controller');router[_0xaa34('0x6')]('/',auth['isAuthenticated'](),controller[_0xaa34('0x7')]);router[_0xaa34('0x6')](_0xaa34('0x8'),auth[_0xaa34('0x9')](),controller[_0xaa34('0xa')]);router['post']('/',auth[_0xaa34('0x9')](),controller[_0xaa34('0xb')]);router[_0xaa34('0xc')]('/:id',auth[_0xaa34('0x9')](),controller[_0xaa34('0xd')]);router[_0xaa34('0xe')]('/:id',auth[_0xaa34('0x9')](),controller[_0xaa34('0xf')]);module[_0xaa34('0x10')]=router; \ No newline at end of file +var _0xc928=['update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','/:id','show','create','put'];(function(_0x1da66d,_0x559d07){var _0x417733=function(_0x3fb377){while(--_0x3fb377){_0x1da66d['push'](_0x1da66d['shift']());}};_0x417733(++_0x559d07);}(_0xc928,0x9c));var _0x8c92=function(_0x2c00e0,_0x18f977){_0x2c00e0=_0x2c00e0-0x0;var _0xc338f0=_0xc928[_0x2c00e0];return _0xc338f0;};'use strict';var multer=require(_0x8c92('0x0'));var util=require(_0x8c92('0x1'));var path=require(_0x8c92('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c92('0x3'));var router=express['Router']();var fs_extra=require(_0x8c92('0x4'));var auth=require(_0x8c92('0x5'));var interaction=require(_0x8c92('0x6'));var config=require('../../config/environment');var controller=require(_0x8c92('0x7'));router[_0x8c92('0x8')]('/',auth[_0x8c92('0x9')](),controller['index']);router[_0x8c92('0x8')](_0x8c92('0xa'),auth[_0x8c92('0x9')](),controller[_0x8c92('0xb')]);router['post']('/',auth[_0x8c92('0x9')](),controller[_0x8c92('0xc')]);router[_0x8c92('0xd')](_0x8c92('0xa'),auth['isAuthenticated'](),controller[_0x8c92('0xe')]);router[_0x8c92('0xf')](_0x8c92('0xa'),auth[_0x8c92('0x9')](),controller[_0x8c92('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 0be81b4..c0c7b62 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 _0xa002=['string','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xa002,0x16a));var _0x2a00=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa002[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x2a00('0x0')]={'type':{'type':Sequelize[_0x2a00('0x1')](_0x2a00('0x2'),'variable',_0x2a00('0x3'),_0x2a00('0x4'),'picklist'),'defaultValue':_0x2a00('0x2')},'content':{'type':Sequelize[_0x2a00('0x5')]},'key':{'type':Sequelize[_0x2a00('0x5')]},'keyType':{'type':Sequelize[_0x2a00('0x1')](_0x2a00('0x2'),'variable',_0x2a00('0x3'))},'keyContent':{'type':Sequelize[_0x2a00('0x5')]},'idField':{'type':Sequelize[_0x2a00('0x5')]},'nameField':{'type':Sequelize[_0x2a00('0x5')]},'customField':{'type':Sequelize[_0x2a00('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a00('0x5')]}}; \ No newline at end of file +var _0xe479=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5144e8,_0x22d0bd){var _0x5ed9ac=function(_0x1f87d5){while(--_0x1f87d5){_0x5144e8['push'](_0x5144e8['shift']());}};_0x5ed9ac(++_0x22d0bd);}(_0xe479,0x6b));var _0x9e47=function(_0x154528,_0x4c28d1){_0x154528=_0x154528-0x0;var _0x1b80a7=_0xe479[_0x154528];return _0x1b80a7;};'use strict';var Sequelize=require(_0x9e47('0x0'));module[_0x9e47('0x1')]={'type':{'type':Sequelize[_0x9e47('0x2')](_0x9e47('0x3'),_0x9e47('0x4'),_0x9e47('0x5'),_0x9e47('0x6'),_0x9e47('0x7')),'defaultValue':_0x9e47('0x3')},'content':{'type':Sequelize[_0x9e47('0x8')]},'key':{'type':Sequelize[_0x9e47('0x8')]},'keyType':{'type':Sequelize[_0x9e47('0x2')](_0x9e47('0x3'),_0x9e47('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9e47('0x8')]},'nameField':{'type':Sequelize[_0x9e47('0x8')]},'customField':{'type':Sequelize[_0x9e47('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e47('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index f52b16b..8ed868e 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 _0x1311=['crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','find','body','destroy','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x37182c,_0x33ea12){var _0x31c5f9=function(_0x2e62fb){while(--_0x2e62fb){_0x37182c['push'](_0x37182c['shift']());}};_0x31c5f9(++_0x33ea12);}(_0x1311,0x1ab));var _0x1131=function(_0x141063,_0x2f7832){_0x141063=_0x141063-0x0;var _0x2ecd3a=_0x1311[_0x141063];return _0x2ecd3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1131('0x0'));var zipdir=require(_0x1131('0x1'));var jsonpatch=require(_0x1131('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1131('0x3'));var util=require('util');var path=require(_0x1131('0x4'));var sox=require(_0x1131('0x5'));var csv=require(_0x1131('0x6'));var ejs=require(_0x1131('0x7'));var fs=require('fs');var fs_extra=require(_0x1131('0x8'));var _=require(_0x1131('0x9'));var squel=require(_0x1131('0xa'));var crypto=require(_0x1131('0xb'));var jsforce=require(_0x1131('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1131('0x6'));var querystring=require('querystring');var Papa=require(_0x1131('0xd'));var Redis=require(_0x1131('0xe'));var authService=require(_0x1131('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1131('0x10'));var hardwareService=require(_0x1131('0x11'));var logger=require(_0x1131('0x12'))(_0x1131('0x13'));var utils=require(_0x1131('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1131('0x15'));var db=require(_0x1131('0x16'))['db'];function respondWithStatusCode(_0xeebda4,_0x5ab707){_0x5ab707=_0x5ab707||0xcc;return function(_0x4c7b4e){if(_0x4c7b4e){return _0xeebda4[_0x1131('0x17')](_0x5ab707);}return _0xeebda4[_0x1131('0x18')](_0x5ab707)['end']();};}function respondWithResult(_0x5354b4,_0x2063df){_0x2063df=_0x2063df||0xc8;return function(_0x113145){if(_0x113145){return _0x5354b4[_0x1131('0x18')](_0x2063df)[_0x1131('0x19')](_0x113145);}};}function respondWithFilteredResult(_0x1d7379,_0x55ea7d){return function(_0x824084){if(_0x824084){var _0x236ccf=typeof _0x55ea7d['offset']===_0x1131('0x1a')&&typeof _0x55ea7d[_0x1131('0x1b')]===_0x1131('0x1a');var _0x328bce=_0x824084[_0x1131('0x1c')];var _0x4a218c=_0x236ccf?0x0:_0x55ea7d[_0x1131('0x1d')];var _0x424873=_0x236ccf?_0x824084[_0x1131('0x1c')]:_0x55ea7d[_0x1131('0x1d')]+_0x55ea7d['limit'];var _0x1f3c5f;if(_0x424873>=_0x328bce){_0x424873=_0x328bce;_0x1f3c5f=0xc8;}else{_0x1f3c5f=0xce;}_0x1d7379[_0x1131('0x18')](_0x1f3c5f);return _0x1d7379[_0x1131('0x1e')](_0x1131('0x1f'),_0x4a218c+'-'+_0x424873+'/'+_0x328bce)['json'](_0x824084);}return null;};}function patchUpdates(_0x4fdb5a){return function(_0xccaa30){try{jsonpatch[_0x1131('0x20')](_0xccaa30,_0x4fdb5a,!![]);}catch(_0x9f4987){return BPromise[_0x1131('0x21')](_0x9f4987);}return _0xccaa30['save']();};}function saveUpdates(_0xf7e5d1,_0x39b3e5){return function(_0x55f551){if(_0x55f551){return _0x55f551[_0x1131('0x22')](_0xf7e5d1)[_0x1131('0x23')](function(_0x121ce3){return _0x121ce3;});}return null;};}function removeEntity(_0x213390,_0x33e1d7){return function(_0x1a0629){if(_0x1a0629){return _0x1a0629['destroy']()['then'](function(){_0x213390[_0x1131('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501d33,_0x1cfcc8){return function(_0x5159b0){if(!_0x5159b0){_0x501d33[_0x1131('0x17')](0x194);}return _0x5159b0;};}function handleError(_0x60cad8,_0x1225bf){_0x1225bf=_0x1225bf||0x1f4;return function(_0x485c7b){logger[_0x1131('0x24')](_0x485c7b['stack']);if(_0x485c7b[_0x1131('0x25')]){delete _0x485c7b[_0x1131('0x25')];}_0x60cad8[_0x1131('0x18')](_0x1225bf)[_0x1131('0x26')](_0x485c7b);};}exports[_0x1131('0x27')]=function(_0xdb15fb,_0x19c413){var _0x3fcd91={},_0x99a086={},_0x5638c1={'count':0x0,'rows':[]};var _0x2cc15a=_[_0x1131('0x28')](db[_0x1131('0x29')][_0x1131('0x2a')],function(_0x2ceace){return{'name':_0x2ceace[_0x1131('0x2b')],'type':_0x2ceace['type'][_0x1131('0x2c')]};});_0x99a086[_0x1131('0x2d')]=_['map'](_0x2cc15a,'name');_0x99a086['query']=_[_0x1131('0x2e')](_0xdb15fb[_0x1131('0x2f')]);_0x99a086[_0x1131('0x30')]=_['intersection'](_0x99a086[_0x1131('0x2d')],_0x99a086[_0x1131('0x2f')]);_0x3fcd91[_0x1131('0x31')]=_[_0x1131('0x32')](_0x99a086[_0x1131('0x2d')],qs[_0x1131('0x33')](_0xdb15fb[_0x1131('0x2f')][_0x1131('0x33')]));_0x3fcd91[_0x1131('0x31')]=_0x3fcd91['attributes'][_0x1131('0x34')]?_0x3fcd91[_0x1131('0x31')]:_0x99a086[_0x1131('0x2d')];if(!_0xdb15fb['query']['hasOwnProperty'](_0x1131('0x35'))){_0x3fcd91[_0x1131('0x1b')]=qs['limit'](_0xdb15fb[_0x1131('0x2f')]['limit']);_0x3fcd91[_0x1131('0x1d')]=qs[_0x1131('0x1d')](_0xdb15fb['query'][_0x1131('0x1d')]);}_0x3fcd91[_0x1131('0x36')]=qs[_0x1131('0x37')](_0xdb15fb[_0x1131('0x2f')][_0x1131('0x37')]);_0x3fcd91[_0x1131('0x38')]=qs['filters'](_[_0x1131('0x39')](_0xdb15fb[_0x1131('0x2f')],_0x99a086[_0x1131('0x30')]),_0x2cc15a);if(_0xdb15fb['query'][_0x1131('0x3a')]){_0x3fcd91[_0x1131('0x38')]=_['merge'](_0x3fcd91[_0x1131('0x38')],{'$or':_[_0x1131('0x28')](_0x2cc15a,function(_0xcff176){if(_0xcff176[_0x1131('0x3b')]!==_0x1131('0x3c')){var _0x1ec6f4={};_0x1ec6f4[_0xcff176[_0x1131('0x25')]]={'$like':'%'+_0xdb15fb[_0x1131('0x2f')][_0x1131('0x3a')]+'%'};return _0x1ec6f4;}})});}_0x3fcd91=_[_0x1131('0x3d')]({},_0x3fcd91,_0xdb15fb['options']);var _0x3d043d={'where':_0x3fcd91[_0x1131('0x38')]};return db['ZendeskField'][_0x1131('0x1c')](_0x3d043d)[_0x1131('0x23')](function(_0x4e47d7){_0x5638c1[_0x1131('0x1c')]=_0x4e47d7;if(_0xdb15fb['query'][_0x1131('0x3e')]){_0x3fcd91['include']=[{'all':!![]}];}return db[_0x1131('0x29')][_0x1131('0x3f')](_0x3fcd91);})[_0x1131('0x23')](function(_0x14792f){_0x5638c1[_0x1131('0x40')]=_0x14792f;return _0x5638c1;})[_0x1131('0x23')](respondWithFilteredResult(_0x19c413,_0x3fcd91))[_0x1131('0x41')](handleError(_0x19c413,null));};exports[_0x1131('0x42')]=function(_0x9b4145,_0x35da76){var _0x2e8408={'raw':!![],'where':{'id':_0x9b4145[_0x1131('0x43')]['id']}},_0x21ff44={};_0x21ff44[_0x1131('0x2d')]=_[_0x1131('0x2e')](db['ZendeskField']['rawAttributes']);_0x21ff44[_0x1131('0x2f')]=_[_0x1131('0x2e')](_0x9b4145[_0x1131('0x2f')]);_0x21ff44[_0x1131('0x30')]=_[_0x1131('0x32')](_0x21ff44[_0x1131('0x2d')],_0x21ff44[_0x1131('0x2f')]);_0x2e8408[_0x1131('0x31')]=_[_0x1131('0x32')](_0x21ff44[_0x1131('0x2d')],qs['fields'](_0x9b4145['query']['fields']));_0x2e8408[_0x1131('0x31')]=_0x2e8408['attributes'][_0x1131('0x34')]?_0x2e8408[_0x1131('0x31')]:_0x21ff44[_0x1131('0x2d')];if(_0x9b4145[_0x1131('0x2f')][_0x1131('0x3e')]){_0x2e8408[_0x1131('0x44')]=[{'all':!![]}];}_0x2e8408=_['merge']({},_0x2e8408,_0x9b4145[_0x1131('0x45')]);return db[_0x1131('0x29')][_0x1131('0x46')](_0x2e8408)[_0x1131('0x23')](handleEntityNotFound(_0x35da76,null))[_0x1131('0x23')](respondWithResult(_0x35da76,null))[_0x1131('0x41')](handleError(_0x35da76,null));};exports['create']=function(_0x30bb8d,_0x4518ff){return db['ZendeskField']['create'](_0x30bb8d[_0x1131('0x47')],{})['then'](respondWithResult(_0x4518ff,0xc9))['catch'](handleError(_0x4518ff,null));};exports[_0x1131('0x22')]=function(_0xa9ed07,_0x33fbbf){if(_0xa9ed07[_0x1131('0x47')]['id']){delete _0xa9ed07[_0x1131('0x47')]['id'];}return db[_0x1131('0x29')][_0x1131('0x46')]({'where':{'id':_0xa9ed07[_0x1131('0x43')]['id']}})[_0x1131('0x23')](handleEntityNotFound(_0x33fbbf,null))['then'](saveUpdates(_0xa9ed07[_0x1131('0x47')],null))['then'](respondWithResult(_0x33fbbf,null))[_0x1131('0x41')](handleError(_0x33fbbf,null));};exports[_0x1131('0x48')]=function(_0x2ebfe6,_0x35ac2c){return db[_0x1131('0x29')][_0x1131('0x46')]({'where':{'id':_0x2ebfe6['params']['id']}})[_0x1131('0x23')](handleEntityNotFound(_0x35ac2c,null))[_0x1131('0x23')](removeEntity(_0x35ac2c,null))[_0x1131('0x41')](handleError(_0x35ac2c,null));}; \ No newline at end of file +var _0x14c5=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','includeAll','include','findAll','rows','rawAttributes','catch','create','body','find','params','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','ZendeskField','type','key','query','keys','filters','intersection','model'];(function(_0x279ab1,_0x527374){var _0x8ba87c=function(_0x2c0898){while(--_0x2c0898){_0x279ab1['push'](_0x279ab1['shift']());}};_0x8ba87c(++_0x527374);}(_0x14c5,0x173));var _0x514c=function(_0x569fe1,_0x238bb8){_0x569fe1=_0x569fe1-0x0;var _0x26d024=_0x14c5[_0x569fe1];return _0x26d024;};'use strict';var emlformat=require(_0x514c('0x0'));var rimraf=require(_0x514c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x514c('0x2'));var moment=require('moment');var BPromise=require(_0x514c('0x3'));var Mustache=require(_0x514c('0x4'));var util=require(_0x514c('0x5'));var path=require(_0x514c('0x6'));var sox=require('sox');var csv=require(_0x514c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x514c('0x8'));var _=require(_0x514c('0x9'));var squel=require('squel');var crypto=require(_0x514c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x514c('0xb'));var toCsv=require('to-csv');var querystring=require(_0x514c('0xc'));var Papa=require(_0x514c('0xd'));var Redis=require(_0x514c('0xe'));var authService=require(_0x514c('0xf'));var qs=require(_0x514c('0x10'));var as=require(_0x514c('0x11'));var hardwareService=require(_0x514c('0x12'));var logger=require(_0x514c('0x13'))('api');var utils=require(_0x514c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x514c('0x15'));var db=require(_0x514c('0x16'))['db'];function respondWithStatusCode(_0x492528,_0xe3a483){_0xe3a483=_0xe3a483||0xcc;return function(_0x4b51f8){if(_0x4b51f8){return _0x492528['sendStatus'](_0xe3a483);}return _0x492528[_0x514c('0x17')](_0xe3a483)[_0x514c('0x18')]();};}function respondWithResult(_0x362fb7,_0x1fc2a3){_0x1fc2a3=_0x1fc2a3||0xc8;return function(_0x7ec2a8){if(_0x7ec2a8){return _0x362fb7[_0x514c('0x17')](_0x1fc2a3)['json'](_0x7ec2a8);}};}function respondWithFilteredResult(_0x1b4829,_0x42e4e9){return function(_0x270f1c){if(_0x270f1c){var _0xf33344=typeof _0x42e4e9[_0x514c('0x19')]===_0x514c('0x1a')&&typeof _0x42e4e9['limit']===_0x514c('0x1a');var _0x5e5870=_0x270f1c[_0x514c('0x1b')];var _0xc9a408=_0xf33344?0x0:_0x42e4e9[_0x514c('0x19')];var _0x173f32=_0xf33344?_0x270f1c[_0x514c('0x1b')]:_0x42e4e9[_0x514c('0x19')]+_0x42e4e9['limit'];var _0x5f3bd2;if(_0x173f32>=_0x5e5870){_0x173f32=_0x5e5870;_0x5f3bd2=0xc8;}else{_0x5f3bd2=0xce;}_0x1b4829[_0x514c('0x17')](_0x5f3bd2);return _0x1b4829[_0x514c('0x1c')](_0x514c('0x1d'),_0xc9a408+'-'+_0x173f32+'/'+_0x5e5870)['json'](_0x270f1c);}return null;};}function patchUpdates(_0x464253){return function(_0x297bc3){try{jsonpatch[_0x514c('0x1e')](_0x297bc3,_0x464253,!![]);}catch(_0xcdea3f){return BPromise['reject'](_0xcdea3f);}return _0x297bc3[_0x514c('0x1f')]();};}function saveUpdates(_0x325376,_0x44c828){return function(_0x23e88b){if(_0x23e88b){return _0x23e88b[_0x514c('0x20')](_0x325376)[_0x514c('0x21')](function(_0x5d6176){return _0x5d6176;});}return null;};}function removeEntity(_0x77823f,_0x3972cb){return function(_0x3a9b8){if(_0x3a9b8){return _0x3a9b8[_0x514c('0x22')]()[_0x514c('0x21')](function(){_0x77823f[_0x514c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53ae0e,_0x5a3144){return function(_0x3fef78){if(!_0x3fef78){_0x53ae0e[_0x514c('0x23')](0x194);}return _0x3fef78;};}function handleError(_0x239c70,_0xfca7cf){_0xfca7cf=_0xfca7cf||0x1f4;return function(_0x421595){logger[_0x514c('0x24')](_0x421595[_0x514c('0x25')]);if(_0x421595['name']){delete _0x421595[_0x514c('0x26')];}_0x239c70[_0x514c('0x17')](_0xfca7cf)[_0x514c('0x27')](_0x421595);};}exports['index']=function(_0xba1de1,_0x37b32a){var _0x5b517c={},_0x4e02cb={},_0x40d460={'count':0x0,'rows':[]};var _0x63c053=_[_0x514c('0x28')](db[_0x514c('0x29')]['rawAttributes'],function(_0x5db2f1){return{'name':_0x5db2f1['fieldName'],'type':_0x5db2f1[_0x514c('0x2a')][_0x514c('0x2b')]};});_0x4e02cb['model']=_[_0x514c('0x28')](_0x63c053,_0x514c('0x26'));_0x4e02cb[_0x514c('0x2c')]=_[_0x514c('0x2d')](_0xba1de1['query']);_0x4e02cb[_0x514c('0x2e')]=_[_0x514c('0x2f')](_0x4e02cb[_0x514c('0x30')],_0x4e02cb['query']);_0x5b517c[_0x514c('0x31')]=_[_0x514c('0x2f')](_0x4e02cb[_0x514c('0x30')],qs[_0x514c('0x32')](_0xba1de1['query'][_0x514c('0x32')]));_0x5b517c[_0x514c('0x31')]=_0x5b517c['attributes'][_0x514c('0x33')]?_0x5b517c[_0x514c('0x31')]:_0x4e02cb['model'];if(!_0xba1de1[_0x514c('0x2c')][_0x514c('0x34')](_0x514c('0x35'))){_0x5b517c[_0x514c('0x36')]=qs[_0x514c('0x36')](_0xba1de1['query'][_0x514c('0x36')]);_0x5b517c['offset']=qs[_0x514c('0x19')](_0xba1de1[_0x514c('0x2c')][_0x514c('0x19')]);}_0x5b517c[_0x514c('0x37')]=qs[_0x514c('0x38')](_0xba1de1[_0x514c('0x2c')][_0x514c('0x38')]);_0x5b517c['where']=qs[_0x514c('0x2e')](_[_0x514c('0x39')](_0xba1de1[_0x514c('0x2c')],_0x4e02cb[_0x514c('0x2e')]),_0x63c053);if(_0xba1de1['query'][_0x514c('0x3a')]){_0x5b517c[_0x514c('0x3b')]=_['merge'](_0x5b517c[_0x514c('0x3b')],{'$or':_[_0x514c('0x28')](_0x63c053,function(_0x28be4b){if(_0x28be4b[_0x514c('0x2a')]!=='VIRTUAL'){var _0x224c51={};_0x224c51[_0x28be4b[_0x514c('0x26')]]={'$like':'%'+_0xba1de1[_0x514c('0x2c')][_0x514c('0x3a')]+'%'};return _0x224c51;}})});}_0x5b517c=_['merge']({},_0x5b517c,_0xba1de1['options']);var _0x41fbb0={'where':_0x5b517c[_0x514c('0x3b')]};return db['ZendeskField'][_0x514c('0x1b')](_0x41fbb0)['then'](function(_0x10769f){_0x40d460[_0x514c('0x1b')]=_0x10769f;if(_0xba1de1[_0x514c('0x2c')][_0x514c('0x3c')]){_0x5b517c[_0x514c('0x3d')]=[{'all':!![]}];}return db[_0x514c('0x29')][_0x514c('0x3e')](_0x5b517c);})[_0x514c('0x21')](function(_0x339bc3){_0x40d460[_0x514c('0x3f')]=_0x339bc3;return _0x40d460;})[_0x514c('0x21')](respondWithFilteredResult(_0x37b32a,_0x5b517c))['catch'](handleError(_0x37b32a,null));};exports['show']=function(_0x3d1162,_0x174f25){var _0x37b2ed={'raw':!![],'where':{'id':_0x3d1162['params']['id']}},_0xb3e23f={};_0xb3e23f['model']=_[_0x514c('0x2d')](db[_0x514c('0x29')][_0x514c('0x40')]);_0xb3e23f['query']=_['keys'](_0x3d1162[_0x514c('0x2c')]);_0xb3e23f[_0x514c('0x2e')]=_[_0x514c('0x2f')](_0xb3e23f[_0x514c('0x30')],_0xb3e23f['query']);_0x37b2ed[_0x514c('0x31')]=_[_0x514c('0x2f')](_0xb3e23f['model'],qs[_0x514c('0x32')](_0x3d1162[_0x514c('0x2c')]['fields']));_0x37b2ed[_0x514c('0x31')]=_0x37b2ed[_0x514c('0x31')][_0x514c('0x33')]?_0x37b2ed['attributes']:_0xb3e23f[_0x514c('0x30')];if(_0x3d1162['query']['includeAll']){_0x37b2ed[_0x514c('0x3d')]=[{'all':!![]}];}_0x37b2ed=_['merge']({},_0x37b2ed,_0x3d1162['options']);return db[_0x514c('0x29')]['find'](_0x37b2ed)[_0x514c('0x21')](handleEntityNotFound(_0x174f25,null))[_0x514c('0x21')](respondWithResult(_0x174f25,null))[_0x514c('0x41')](handleError(_0x174f25,null));};exports[_0x514c('0x42')]=function(_0x55dcae,_0x9832ba){return db[_0x514c('0x29')][_0x514c('0x42')](_0x55dcae['body'],{})[_0x514c('0x21')](respondWithResult(_0x9832ba,0xc9))[_0x514c('0x41')](handleError(_0x9832ba,null));};exports[_0x514c('0x20')]=function(_0x12150d,_0x562066){if(_0x12150d[_0x514c('0x43')]['id']){delete _0x12150d[_0x514c('0x43')]['id'];}return db[_0x514c('0x29')][_0x514c('0x44')]({'where':{'id':_0x12150d[_0x514c('0x45')]['id']}})[_0x514c('0x21')](handleEntityNotFound(_0x562066,null))[_0x514c('0x21')](saveUpdates(_0x12150d['body'],null))[_0x514c('0x21')](respondWithResult(_0x562066,null))[_0x514c('0x41')](handleError(_0x562066,null));};exports['destroy']=function(_0x2b19c1,_0x3b8189){return db[_0x514c('0x29')][_0x514c('0x44')]({'where':{'id':_0x2b19c1[_0x514c('0x45')]['id']}})[_0x514c('0x21')](handleEntityNotFound(_0x3b8189,null))[_0x514c('0x21')](removeEntity(_0x3b8189,null))[_0x514c('0x41')](handleError(_0x3b8189,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 466a93b..4ccdc08 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 _0x85d0=['exports','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','./intZendeskField.attributes'];(function(_0x2903d1,_0x463cb3){var _0x3266a9=function(_0xdec991){while(--_0xdec991){_0x2903d1['push'](_0x2903d1['shift']());}};_0x3266a9(++_0x463cb3);}(_0x85d0,0x157));var _0x085d=function(_0x3ed74e,_0x3d3376){_0x3ed74e=_0x3ed74e-0x0;var _0x5433ce=_0x85d0[_0x3ed74e];return _0x5433ce;};'use strict';var _=require(_0x085d('0x0'));var util=require(_0x085d('0x1'));var logger=require('../../config/logger')(_0x085d('0x2'));var moment=require(_0x085d('0x3'));var BPromise=require(_0x085d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x085d('0x5'));var rimraf=require(_0x085d('0x6'));var config=require('../../config/environment');var attributes=require(_0x085d('0x7'));module[_0x085d('0x8')]=function(_0x32dd3b,_0x4ff50b){return _0x32dd3b['define'](_0x085d('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x085d('0xa'),'fields':[_0x085d('0xb'),_0x085d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b60=['moment','bluebird','../../config/environment','./intZendeskField.attributes','exports','define','FieldId','lodash','util','../../config/logger'];(function(_0x1e4aaf,_0x1a5bdc){var _0x14c2e5=function(_0x18947e){while(--_0x18947e){_0x1e4aaf['push'](_0x1e4aaf['shift']());}};_0x14c2e5(++_0x1a5bdc);}(_0x1b60,0x129));var _0x01b6=function(_0x41ccbb,_0x3771e8){_0x41ccbb=_0x41ccbb-0x0;var _0x519c61=_0x1b60[_0x41ccbb];return _0x519c61;};'use strict';var _=require(_0x01b6('0x0'));var util=require(_0x01b6('0x1'));var logger=require(_0x01b6('0x2'))('api');var moment=require(_0x01b6('0x3'));var BPromise=require(_0x01b6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01b6('0x5'));var attributes=require(_0x01b6('0x6'));module[_0x01b6('0x7')]=function(_0x2f8087,_0x3a2abc){return _0x2f8087[_0x01b6('0x8')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x01b6('0x9')],'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 42d1931..fbc47ee 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 _0x35cc=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x4d7237,_0x4915e7){var _0x30a75a=function(_0x576d65){while(--_0x576d65){_0x4d7237['push'](_0x4d7237['shift']());}};_0x30a75a(++_0x4915e7);}(_0x35cc,0x97));var _0xc35c=function(_0x373e23,_0x42dc04){_0x373e23=_0x373e23-0x0;var _0x34bb05=_0x35cc[_0x373e23];return _0x34bb05;};'use strict';var _=require(_0xc35c('0x0'));var util=require(_0xc35c('0x1'));var moment=require(_0xc35c('0x2'));var BPromise=require(_0xc35c('0x3'));var rs=require(_0xc35c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc35c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc35c('0x6'))(_0xc35c('0x7'));var config=require(_0xc35c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc35c('0x9')][_0xc35c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17350d,_0x13ddde,_0x563e5f){return new BPromise(function(_0x36cd22,_0x3eac7e){return client[_0xc35c('0xb')](_0x17350d,_0x563e5f)[_0xc35c('0xc')](function(_0x44c4f3){logger[_0xc35c('0xd')]('ZendeskField,\x20%s,\x20%s',_0x13ddde,_0xc35c('0xe'));logger['debug'](_0xc35c('0xf'),_0x13ddde,_0xc35c('0xe'),JSON['stringify'](_0x44c4f3));if(_0x44c4f3[_0xc35c('0x10')]){if(_0x44c4f3[_0xc35c('0x10')][_0xc35c('0x11')]===0x1f4){logger[_0xc35c('0x10')](_0xc35c('0x12'),_0x13ddde,_0x44c4f3['error'][_0xc35c('0x13')]);return _0x3eac7e(_0x44c4f3[_0xc35c('0x10')][_0xc35c('0x13')]);}logger['error'](_0xc35c('0x12'),_0x13ddde,_0x44c4f3[_0xc35c('0x10')]['message']);return _0x36cd22(_0x44c4f3[_0xc35c('0x10')][_0xc35c('0x13')]);}else{logger[_0xc35c('0xd')](_0xc35c('0x12'),_0x13ddde,_0xc35c('0xe'));_0x36cd22(_0x44c4f3[_0xc35c('0x14')][_0xc35c('0x13')]);}})[_0xc35c('0x15')](function(_0x52be2){logger[_0xc35c('0x10')]('ZendeskField,\x20%s,\x20%s',_0x13ddde,_0x52be2);_0x3eac7e(_0x52be2);});});} \ No newline at end of file +var _0x8d88=['client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d2d4c,_0x9d1720){var _0x245610=function(_0x22d874){while(--_0x22d874){_0x4d2d4c['push'](_0x4d2d4c['shift']());}};_0x245610(++_0x9d1720);}(_0x8d88,0x1ef));var _0x88d8=function(_0x5e8906,_0x18f1e7){_0x5e8906=_0x5e8906-0x0;var _0x3b6622=_0x8d88[_0x5e8906];return _0x3b6622;};'use strict';var _=require(_0x88d8('0x0'));var util=require(_0x88d8('0x1'));var moment=require(_0x88d8('0x2'));var BPromise=require(_0x88d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88d8('0x4'));var db=require(_0x88d8('0x5'))['db'];var utils=require(_0x88d8('0x6'));var logger=require(_0x88d8('0x7'))(_0x88d8('0x8'));var config=require(_0x88d8('0x9'));var jayson=require(_0x88d8('0xa'));var client=jayson[_0x88d8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x359f0f,_0x1446c8,_0x50a89e){return new BPromise(function(_0x5a5758,_0x224b60){return client[_0x88d8('0xc')](_0x359f0f,_0x50a89e)[_0x88d8('0xd')](function(_0x53a809){logger[_0x88d8('0xe')](_0x88d8('0xf'),_0x1446c8,_0x88d8('0x10'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1446c8,_0x88d8('0x10'),JSON[_0x88d8('0x11')](_0x53a809));if(_0x53a809['error']){if(_0x53a809[_0x88d8('0x12')]['code']===0x1f4){logger[_0x88d8('0x12')](_0x88d8('0xf'),_0x1446c8,_0x53a809['error'][_0x88d8('0x13')]);return _0x224b60(_0x53a809[_0x88d8('0x12')]['message']);}logger[_0x88d8('0x12')](_0x88d8('0xf'),_0x1446c8,_0x53a809[_0x88d8('0x12')]['message']);return _0x5a5758(_0x53a809[_0x88d8('0x12')][_0x88d8('0x13')]);}else{logger[_0x88d8('0xe')](_0x88d8('0xf'),_0x1446c8,'request\x20sent');_0x5a5758(_0x53a809[_0x88d8('0x14')][_0x88d8('0x13')]);}})[_0x88d8('0x15')](function(_0x451be9){logger['error'](_0x88d8('0xf'),_0x1446c8,_0x451be9);_0x224b60(_0x451be9);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 913bfe0..163e8c3 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 _0x8e87=['get','index','/:id','isAuthenticated','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller'];(function(_0x5e626e,_0x56537a){var _0x1e1353=function(_0x2caf4a){while(--_0x2caf4a){_0x5e626e['push'](_0x5e626e['shift']());}};_0x1e1353(++_0x56537a);}(_0x8e87,0x18d));var _0x78e8=function(_0x2866b1,_0x2025e7){_0x2866b1=_0x2866b1-0x0;var _0x47be9e=_0x8e87[_0x2866b1];return _0x47be9e;};'use strict';var multer=require(_0x78e8('0x0'));var util=require(_0x78e8('0x1'));var path=require(_0x78e8('0x2'));var timeout=require(_0x78e8('0x3'));var express=require(_0x78e8('0x4'));var router=express[_0x78e8('0x5')]();var fs_extra=require(_0x78e8('0x6'));var auth=require(_0x78e8('0x7'));var interaction=require(_0x78e8('0x8'));var config=require(_0x78e8('0x9'));var controller=require(_0x78e8('0xa'));router[_0x78e8('0xb')]('/',auth['isAuthenticated'](),controller[_0x78e8('0xc')]);router['get'](_0x78e8('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x78e8('0xb')]('/:id/configurations',auth[_0x78e8('0xe')](),controller['getConfigurations']);router[_0x78e8('0xb')](_0x78e8('0xf'),auth['isAuthenticated'](),controller[_0x78e8('0x10')]);router[_0x78e8('0x11')]('/',auth[_0x78e8('0xe')](),controller[_0x78e8('0x12')]);router[_0x78e8('0x11')](_0x78e8('0x13'),auth['isAuthenticated'](),controller[_0x78e8('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x78e8('0x15')]);router[_0x78e8('0x16')](_0x78e8('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x78e8('0x17')]=router; \ No newline at end of file +var _0xfa39=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','/:id/fields','post','create','/:id/configurations'];(function(_0x20073b,_0x9c031e){var _0x428d14=function(_0x1c6d8b){while(--_0x1c6d8b){_0x20073b['push'](_0x20073b['shift']());}};_0x428d14(++_0x9c031e);}(_0xfa39,0x1d3));var _0x9fa3=function(_0x86337d,_0x2b57c3){_0x86337d=_0x86337d-0x0;var _0x22b2c6=_0xfa39[_0x86337d];return _0x22b2c6;};'use strict';var multer=require(_0x9fa3('0x0'));var util=require(_0x9fa3('0x1'));var path=require(_0x9fa3('0x2'));var timeout=require(_0x9fa3('0x3'));var express=require(_0x9fa3('0x4'));var router=express['Router']();var fs_extra=require(_0x9fa3('0x5'));var auth=require(_0x9fa3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9fa3('0x7'));var controller=require(_0x9fa3('0x8'));router[_0x9fa3('0x9')]('/',auth['isAuthenticated'](),controller[_0x9fa3('0xa')]);router[_0x9fa3('0x9')]('/:id',auth[_0x9fa3('0xb')](),controller['show']);router['get']('/:id/configurations',auth[_0x9fa3('0xb')](),controller['getConfigurations']);router[_0x9fa3('0x9')](_0x9fa3('0xc'),auth[_0x9fa3('0xb')](),controller['getFields']);router[_0x9fa3('0xd')]('/',auth[_0x9fa3('0xb')](),controller[_0x9fa3('0xe')]);router['post'](_0x9fa3('0xf'),auth[_0x9fa3('0xb')](),controller['addConfiguration']);router[_0x9fa3('0x10')](_0x9fa3('0x11'),auth[_0x9fa3('0xb')](),controller[_0x9fa3('0x12')]);router[_0x9fa3('0x13')](_0x9fa3('0x11'),auth[_0x9fa3('0xb')](),controller['destroy']);module[_0x9fa3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 71e59d2..7337659 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 _0xa75b=['sequelize','STRING'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xa75b,0x170));var _0xba75=function(_0x29c451,_0x47fd37){_0x29c451=_0x29c451-0x0;var _0x1390d6=_0xa75b[_0x29c451];return _0x1390d6;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba75('0x1')]},'host':{'type':Sequelize[_0xba75('0x1')]},'zone':{'type':Sequelize[_0xba75('0x1')]},'clientId':{'type':Sequelize[_0xba75('0x1')]},'clientSecret':{'type':Sequelize[_0xba75('0x1')]},'serverUrl':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xba75('0x1')]},'refreshToken':{'type':Sequelize[_0xba75('0x1')]}}; \ No newline at end of file +var _0x9bde=['STRING','exports'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x9bde,0xe1));var _0xe9bd=function(_0x437b90,_0x4f05e0){_0x437b90=_0x437b90-0x0;var _0x54e0a6=_0x9bde[_0x437b90];return _0x54e0a6;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index db10438..1f912d5 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 _0x566c=['Owner','Subject','WhoId','Call_Result','Call_Type','push','display_label','data_type','pick_list_values','statusCode','test','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','refreshToken','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','error','message'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x566c,0x8d));var _0xc566=function(_0x5d9582,_0x4d2047){_0x5d9582=_0x5d9582-0x0;var _0x214c9d=_0x566c[_0x5d9582];return _0x214c9d;};'use strict';var emlformat=require(_0xc566('0x0'));var rimraf=require(_0xc566('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc566('0x2'));var rp=require(_0xc566('0x3'));var moment=require(_0xc566('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc566('0x5'));var util=require(_0xc566('0x6'));var path=require(_0xc566('0x7'));var sox=require(_0xc566('0x8'));var csv=require('to-csv');var ejs=require(_0xc566('0x9'));var fs=require('fs');var fs_extra=require(_0xc566('0xa'));var _=require(_0xc566('0xb'));var squel=require(_0xc566('0xc'));var crypto=require(_0xc566('0xd'));var jsforce=require(_0xc566('0xe'));var deskjs=require(_0xc566('0xf'));var toCsv=require(_0xc566('0x10'));var querystring=require(_0xc566('0x11'));var Papa=require(_0xc566('0x12'));var Redis=require(_0xc566('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc566('0x14'));var as=require(_0xc566('0x15'));var hardwareService=require(_0xc566('0x16'));var logger=require(_0xc566('0x17'))('api');var utils=require(_0xc566('0x18'));var config=require(_0xc566('0x19'));var licenseUtil=require(_0xc566('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc566('0x1b'));function respondWithStatusCode(_0x11b41a,_0x78526f){_0x78526f=_0x78526f||0xcc;return function(_0x311637){if(_0x311637){return _0x11b41a[_0xc566('0x1c')](_0x78526f);}return _0x11b41a[_0xc566('0x1d')](_0x78526f)[_0xc566('0x1e')]();};}function respondWithResult(_0x1c8018,_0x15d3ae){_0x15d3ae=_0x15d3ae||0xc8;return function(_0x9bd2e1){if(_0x9bd2e1){return _0x1c8018[_0xc566('0x1d')](_0x15d3ae)[_0xc566('0x1f')](_0x9bd2e1);}};}function respondWithFilteredResult(_0x569426,_0x124447){return function(_0x314d4d){if(_0x314d4d){var _0x193672=typeof _0x124447['offset']===_0xc566('0x20')&&typeof _0x124447[_0xc566('0x21')]==='undefined';var _0x43a8b3=_0x314d4d[_0xc566('0x22')];var _0xb6e7ef=_0x193672?0x0:_0x124447[_0xc566('0x23')];var _0x15da86=_0x193672?_0x314d4d['count']:_0x124447['offset']+_0x124447[_0xc566('0x21')];var _0x19310d;if(_0x15da86>=_0x43a8b3){_0x15da86=_0x43a8b3;_0x19310d=0xc8;}else{_0x19310d=0xce;}_0x569426['status'](_0x19310d);return _0x569426['set'](_0xc566('0x24'),_0xb6e7ef+'-'+_0x15da86+'/'+_0x43a8b3)[_0xc566('0x1f')](_0x314d4d);}return null;};}function patchUpdates(_0x517331){return function(_0x349fd9){try{jsonpatch[_0xc566('0x25')](_0x349fd9,_0x517331,!![]);}catch(_0x498f8f){return BPromise[_0xc566('0x26')](_0x498f8f);}return _0x349fd9[_0xc566('0x27')]();};}function saveUpdates(_0x54ff65,_0x1b1c5e){return function(_0x23805d){if(_0x23805d){return _0x23805d['update'](_0x54ff65)['then'](function(_0x32e141){return _0x32e141;});}return null;};}function removeEntity(_0x3ad414,_0x4710d8){return function(_0x257614){if(_0x257614){return _0x257614[_0xc566('0x28')]()[_0xc566('0x29')](function(){_0x3ad414[_0xc566('0x1d')](0xcc)[_0xc566('0x1e')]();});}};}function handleEntityNotFound(_0x5a048c,_0x48284d){return function(_0x2fd009){if(!_0x2fd009){_0x5a048c[_0xc566('0x1c')](0x194);}return _0x2fd009;};}function handleError(_0x526f91,_0x30e24e){_0x30e24e=_0x30e24e||0x1f4;return function(_0x4b5157){logger['error'](_0x4b5157[_0xc566('0x2a')]);if(_0x4b5157['name']){delete _0x4b5157[_0xc566('0x2b')];}_0x526f91['status'](_0x30e24e)[_0xc566('0x2c')](_0x4b5157);};}exports[_0xc566('0x2d')]=function(_0x325d1f,_0x406667){var _0x4c78f9={},_0x410ad0={},_0x1ed08a={'count':0x0,'rows':[]};var _0x3f3767=_['map'](db[_0xc566('0x2e')][_0xc566('0x2f')],function(_0x43077e){return{'name':_0x43077e[_0xc566('0x30')],'type':_0x43077e[_0xc566('0x31')][_0xc566('0x32')]};});_0x410ad0[_0xc566('0x33')]=_[_0xc566('0x34')](_0x3f3767,_0xc566('0x2b'));_0x410ad0[_0xc566('0x35')]=_[_0xc566('0x36')](_0x325d1f['query']);_0x410ad0[_0xc566('0x37')]=_[_0xc566('0x38')](_0x410ad0[_0xc566('0x33')],_0x410ad0[_0xc566('0x35')]);_0x4c78f9[_0xc566('0x39')]=_[_0xc566('0x38')](_0x410ad0[_0xc566('0x33')],qs[_0xc566('0x3a')](_0x325d1f[_0xc566('0x35')][_0xc566('0x3a')]));_0x4c78f9[_0xc566('0x39')]=_0x4c78f9[_0xc566('0x39')][_0xc566('0x3b')]?_0x4c78f9[_0xc566('0x39')]:_0x410ad0['model'];if(!_0x325d1f['query'][_0xc566('0x3c')]('nolimit')){_0x4c78f9['limit']=qs[_0xc566('0x21')](_0x325d1f[_0xc566('0x35')]['limit']);_0x4c78f9['offset']=qs[_0xc566('0x23')](_0x325d1f[_0xc566('0x35')][_0xc566('0x23')]);}_0x4c78f9['order']=qs[_0xc566('0x3d')](_0x325d1f['query'][_0xc566('0x3d')]);_0x4c78f9[_0xc566('0x3e')]=qs[_0xc566('0x37')](_[_0xc566('0x3f')](_0x325d1f['query'],_0x410ad0[_0xc566('0x37')]),_0x3f3767);if(_0x325d1f[_0xc566('0x35')][_0xc566('0x40')]){_0x4c78f9[_0xc566('0x3e')]=_['merge'](_0x4c78f9[_0xc566('0x3e')],{'$or':_[_0xc566('0x34')](_0x3f3767,function(_0x380936){if(_0x380936['type']!==_0xc566('0x41')){var _0x6a75b0={};_0x6a75b0[_0x380936[_0xc566('0x2b')]]={'$like':'%'+_0x325d1f[_0xc566('0x35')][_0xc566('0x40')]+'%'};return _0x6a75b0;}})});}_0x4c78f9=_[_0xc566('0x42')]({},_0x4c78f9,_0x325d1f[_0xc566('0x43')]);var _0x6813e3={'where':_0x4c78f9[_0xc566('0x3e')]};return db[_0xc566('0x2e')][_0xc566('0x22')](_0x6813e3)[_0xc566('0x29')](function(_0xb49e06){_0x1ed08a[_0xc566('0x22')]=_0xb49e06;if(_0x325d1f[_0xc566('0x35')][_0xc566('0x44')]){_0x4c78f9[_0xc566('0x45')]=[{'all':!![]}];}return db[_0xc566('0x2e')][_0xc566('0x46')](_0x4c78f9);})[_0xc566('0x29')](function(_0xa4b6e1){_0x1ed08a[_0xc566('0x47')]=_0xa4b6e1;return _0x1ed08a;})[_0xc566('0x29')](respondWithFilteredResult(_0x406667,_0x4c78f9))[_0xc566('0x48')](handleError(_0x406667,null));};exports['show']=function(_0x42b6c3,_0xfa2c12){var _0x5189ea={'raw':![],'where':{'id':_0x42b6c3[_0xc566('0x49')]['id']}},_0x937f0b={};_0x937f0b[_0xc566('0x33')]=_[_0xc566('0x36')](db[_0xc566('0x2e')][_0xc566('0x2f')]);_0x937f0b[_0xc566('0x35')]=_[_0xc566('0x36')](_0x42b6c3[_0xc566('0x35')]);_0x937f0b[_0xc566('0x37')]=_[_0xc566('0x38')](_0x937f0b[_0xc566('0x33')],_0x937f0b['query']);_0x5189ea['attributes']=_['intersection'](_0x937f0b[_0xc566('0x33')],qs[_0xc566('0x3a')](_0x42b6c3[_0xc566('0x35')][_0xc566('0x3a')]));_0x5189ea[_0xc566('0x39')]=_0x5189ea[_0xc566('0x39')][_0xc566('0x3b')]?_0x5189ea[_0xc566('0x39')]:_0x937f0b['model'];if(_0x42b6c3[_0xc566('0x35')]['includeAll']){_0x5189ea[_0xc566('0x45')]=[{'all':!![]}];}_0x5189ea=_['merge']({},_0x5189ea,_0x42b6c3[_0xc566('0x43')]);return db[_0xc566('0x2e')][_0xc566('0x4a')](_0x5189ea)[_0xc566('0x29')](handleEntityNotFound(_0xfa2c12,null))[_0xc566('0x29')](respondWithResult(_0xfa2c12,null))[_0xc566('0x48')](handleError(_0xfa2c12,null));};exports['create']=function(_0x2686f7,_0x92b7df){return db['ZohoAccount'][_0xc566('0x4b')](_0x2686f7[_0xc566('0x4c')],{})[_0xc566('0x29')](respondWithResult(_0x92b7df,0xc9))[_0xc566('0x48')](handleError(_0x92b7df,null));};exports[_0xc566('0x4d')]=function(_0xa99c7e,_0x10462c){if(_0xa99c7e[_0xc566('0x4c')]['id']){delete _0xa99c7e['body']['id'];}return db[_0xc566('0x2e')][_0xc566('0x4a')]({'where':{'id':_0xa99c7e[_0xc566('0x49')]['id']}})[_0xc566('0x29')](handleEntityNotFound(_0x10462c,null))[_0xc566('0x29')](saveUpdates(_0xa99c7e['body'],null))['then'](respondWithResult(_0x10462c,null))[_0xc566('0x48')](handleError(_0x10462c,null));};exports[_0xc566('0x28')]=function(_0x573e61,_0x5c167f){return db[_0xc566('0x2e')][_0xc566('0x4a')]({'where':{'id':_0x573e61[_0xc566('0x49')]['id']}})[_0xc566('0x29')](handleEntityNotFound(_0x5c167f,null))['then'](removeEntity(_0x5c167f,null))['catch'](handleError(_0x5c167f,null));};exports[_0xc566('0x4e')]=function(_0x461f32,_0x21a659,_0x4832e9){var _0x1bf744={};var _0x21cfc8={};var _0x296058;var _0x17d81e;return db[_0xc566('0x2e')][_0xc566('0x4f')]({'where':{'id':_0x461f32[_0xc566('0x49')]['id']}})['then'](handleEntityNotFound(_0x21a659,null))['then'](function(_0x57c088){if(_0x57c088){_0x296058=_0x57c088;_0x21cfc8['model']=_[_0xc566('0x36')](db[_0xc566('0x50')]['rawAttributes']);_0x21cfc8[_0xc566('0x35')]=_['keys'](_0x461f32[_0xc566('0x35')]);_0x21cfc8[_0xc566('0x37')]=_[_0xc566('0x38')](_0x21cfc8['model'],_0x21cfc8[_0xc566('0x35')]);_0x1bf744[_0xc566('0x39')]=_[_0xc566('0x38')](_0x21cfc8[_0xc566('0x33')],qs['fields'](_0x461f32[_0xc566('0x35')]['fields']));_0x1bf744[_0xc566('0x39')]=_0x1bf744[_0xc566('0x39')]['length']?_0x1bf744[_0xc566('0x39')]:_0x21cfc8[_0xc566('0x33')];_0x1bf744[_0xc566('0x51')]=qs['sort'](_0x461f32[_0xc566('0x35')]['sort']);_0x1bf744[_0xc566('0x3e')]=qs['filters'](_[_0xc566('0x3f')](_0x461f32[_0xc566('0x35')],_0x21cfc8[_0xc566('0x37')]));if(_0x461f32[_0xc566('0x35')][_0xc566('0x40')]){_0x1bf744['where']=_[_0xc566('0x42')](_0x1bf744[_0xc566('0x3e')],{'$or':_[_0xc566('0x34')](_0x1bf744['attributes'],function(_0x48d3d5){var _0x46b5f6={};_0x46b5f6[_0x48d3d5]={'$like':'%'+_0x461f32[_0xc566('0x35')][_0xc566('0x40')]+'%'};return _0x46b5f6;})});}_0x1bf744=_['merge']({},_0x1bf744,_0x461f32[_0xc566('0x43')]);return _0x296058[_0xc566('0x4e')](_0x1bf744);}})['then'](function(_0x31a299){if(_0x31a299){_0x17d81e=_0x31a299['length'];if(!_0x461f32[_0xc566('0x35')]['hasOwnProperty'](_0xc566('0x52'))){_0x1bf744[_0xc566('0x21')]=qs['limit'](_0x461f32[_0xc566('0x35')][_0xc566('0x21')]);_0x1bf744[_0xc566('0x23')]=qs[_0xc566('0x23')](_0x461f32['query'][_0xc566('0x23')]);}return _0x296058[_0xc566('0x4e')](_0x1bf744);}})[_0xc566('0x29')](function(_0x476168){if(_0x476168){return _0x476168?{'count':_0x17d81e,'rows':_0x476168}:null;}})[_0xc566('0x29')](respondWithResult(_0x21a659,null))['catch'](handleError(_0x21a659,null));};exports[_0xc566('0x53')]=function(_0x16fd87,_0x427346,_0x107f0b){if(_0x16fd87[_0xc566('0x4c')]['id']){delete _0x16fd87[_0xc566('0x4c')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x16fd87[_0xc566('0x49')]['id']}})[_0xc566('0x29')](handleEntityNotFound(_0x427346,null))[_0xc566('0x29')](function(_0x59dfcf){if(_0x59dfcf){_0x16fd87[_0xc566('0x4c')][_0xc566('0x54')]=_0x59dfcf['id'];_0x16fd87['body'][_0xc566('0x55')]=integrations[_0xc566('0x56')](_0x16fd87[_0xc566('0x4c')]['channel'],_0x16fd87['body'][_0xc566('0x31')]);_0x16fd87[_0xc566('0x4c')][_0xc566('0x57')]=integrations[_0xc566('0x58')](_0x16fd87[_0xc566('0x4c')][_0xc566('0x59')],_0x16fd87[_0xc566('0x4c')]['type']);return db[_0xc566('0x50')][_0xc566('0x4b')](_0x16fd87[_0xc566('0x4c')],{'include':[{'model':db[_0xc566('0x5a')],'as':_0xc566('0x55')},{'model':db[_0xc566('0x5a')],'as':_0xc566('0x57')}]});}return null;})[_0xc566('0x29')](respondWithResult(_0x427346,null))[_0xc566('0x48')](handleError(_0x427346,null));};function getAccessToken(_0x89c7f6){return new Promise(function(_0x34411f,_0x50f6b5){var _0x1c2698;switch(_0x89c7f6[_0xc566('0x5b')]){case'US':_0x1c2698=_0xc566('0x5c');break;case'AU':_0x1c2698=_0xc566('0x5d');break;case'EU':_0x1c2698=_0xc566('0x5e');break;case'IN':_0x1c2698=_0xc566('0x5f');break;case'CN':_0x1c2698=_0xc566('0x60');break;default:_0x1c2698=_0xc566('0x5e');break;}var _0x439a25={'method':_0xc566('0x61'),'uri':_0x1c2698+_0xc566('0x62'),'qs':{'refresh_token':_0x89c7f6['refreshToken'],'client_id':_0x89c7f6[_0xc566('0x63')],'client_secret':_0x89c7f6[_0xc566('0x64')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x439a25)[_0xc566('0x29')](function(_0xf73a96){if(_0xf73a96[_0xc566('0x65')]){_0x34411f(_0xf73a96[_0xc566('0x65')]);}else{_0x50f6b5(_0xc566('0x66'));}})[_0xc566('0x48')](function(_0x668558){_0x50f6b5(_0x668558);});});}exports[_0xc566('0x67')]=function(_0x19965a,_0x208abe,_0x3eaa2d){var _0x377c8a,_0x373454,_0x7affc4,_0x2773fc,_0x4fbe17;return db['ZohoAccount'][_0xc566('0x4f')]({'where':{'id':_0x19965a[_0xc566('0x49')]['id']},'attributes':['id',_0xc566('0x68'),'zone',_0xc566('0x63'),_0xc566('0x64'),_0xc566('0x69'),'code',_0xc566('0x6a')]})[_0xc566('0x29')](handleEntityNotFound(_0x208abe,null))['then'](function(_0x547f63){_0x4fbe17=_0x547f63;_0x377c8a=_0x4fbe17[_0xc566('0x68')];_0x373454=_0x377c8a===_0xc566('0x6b')?'eu':_0xc566('0x6c');_0x7affc4=_0x4fbe17[_0xc566('0x69')];var _0x5e3448=_0x7affc4[_0xc566('0x6d')](-0x1);if(_0x5e3448==='/'||_0x5e3448==='\x5c'||_0x5e3448===':'){_0x7affc4=_0x7affc4['substring'](0x0,_0x7affc4[_0xc566('0x6e')](_0x5e3448));}if(!_0x4fbe17[_0xc566('0x6a')]){throw new Error(_0xc566('0x6f'));}return getAccessToken(_0x4fbe17);})[_0xc566('0x29')](function(_0x22de5a){if(_0x22de5a){return rp({'method':_0xc566('0x70'),'uri':util[_0xc566('0x71')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x373454),'qs':{'module':_0xc566('0x72')},'headers':{'Authorization':_0xc566('0x73')+_0x22de5a},'json':!![]});}})[_0xc566('0x29')](function(_0x53b838){if(_0x53b838){if(_0x53b838[_0xc566('0x74')]&&_0x53b838['response'][_0xc566('0x75')]){throw new Error(_0x53b838[_0xc566('0x74')][_0xc566('0x75')][_0xc566('0x76')]);}var _0x5ef1ec=[];var _0x4fb6c4=[];var _0x4cd45b=[_0xc566('0x77'),_0xc566('0x78'),'Description',_0xc566('0x79'),'Call_Duration',_0xc566('0x7a'),'Call_Start_Time',_0xc566('0x7b')];_0x4fb6c4=_['remove'](_0x53b838['fields'],function(_0xfda5f0){return _0x4cd45b['includes'](_0xfda5f0['api_name']);});for(var _0x56dea4=0x0;_0x56dea4<_0x4fb6c4['length'];_0x56dea4++){if(_0x4fb6c4[_0x56dea4]['system_mandatory']===![]){_0x5ef1ec[_0xc566('0x7c')]({'id':_0x4fb6c4[_0x56dea4]['id'],'name':_0x4fb6c4[_0x56dea4][_0xc566('0x7d')],'custom':_0x4fb6c4[_0x56dea4]['custom_field'],'options':_0x4fb6c4[_0x56dea4][_0xc566('0x7e')]==='picklist'&&_0x4fb6c4[_0x56dea4][_0xc566('0x7f')][_0xc566('0x3b')]>-0x1?_[_0xc566('0x34')](_0x4fb6c4[_0x56dea4]['pick_list_values'],function(_0x42ff4d){return{'name':_0x42ff4d,'value':_0x42ff4d};}):[]});}}return{'count':_0x5ef1ec[_0xc566('0x3b')],'rows':_0x5ef1ec};}else{return{'count':0x0,'rows':[]};}})[_0xc566('0x29')](respondWithResult(_0x208abe,null))[_0xc566('0x48')](function(_0x51cb0e){var _0x20e58d=_0x19965a['query']['test']?0x1f4:_0x51cb0e[_0xc566('0x80')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x20e58d,JSON['stringify'](_0x51cb0e));delete _0x51cb0e[_0xc566('0x2b')];if(_0x20e58d===0x191){_0x20e58d=0x190;}_0x208abe[_0xc566('0x1d')](_0x20e58d)[_0xc566('0x2c')](_0x19965a[_0xc566('0x35')][_0xc566('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x51cb0e[_0xc566('0x80')]}:_0x51cb0e);});}; \ No newline at end of file +var _0x335a=['rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','ZohoConfiguration','pick','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','reject','save','update','then','destroy','error','stack','name','send','ZohoAccount'];(function(_0x167ede,_0x50562c){var _0x2706c3=function(_0x19ec8a){while(--_0x19ec8a){_0x167ede['push'](_0x167ede['shift']());}};_0x2706c3(++_0x50562c);}(_0x335a,0x150));var _0xa335=function(_0x3af4a7,_0x1603d1){_0x3af4a7=_0x3af4a7-0x0;var _0x5d3977=_0x335a[_0x3af4a7];return _0x5d3977;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa335('0x0'));var jsonpatch=require(_0xa335('0x1'));var rp=require(_0xa335('0x2'));var moment=require(_0xa335('0x3'));var BPromise=require(_0xa335('0x4'));var Mustache=require(_0xa335('0x5'));var util=require(_0xa335('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa335('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa335('0x8'));var squel=require(_0xa335('0x9'));var crypto=require(_0xa335('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa335('0xb'));var querystring=require(_0xa335('0xc'));var Papa=require(_0xa335('0xd'));var Redis=require(_0xa335('0xe'));var authService=require(_0xa335('0xf'));var qs=require(_0xa335('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa335('0x11'));var logger=require(_0xa335('0x12'))(_0xa335('0x13'));var utils=require(_0xa335('0x14'));var config=require(_0xa335('0x15'));var licenseUtil=require(_0xa335('0x16'));var db=require(_0xa335('0x17'))['db'];var integrations=require(_0xa335('0x18'));function respondWithStatusCode(_0x33f710,_0x217cb9){_0x217cb9=_0x217cb9||0xcc;return function(_0x56c376){if(_0x56c376){return _0x33f710[_0xa335('0x19')](_0x217cb9);}return _0x33f710['status'](_0x217cb9)[_0xa335('0x1a')]();};}function respondWithResult(_0x5c2b9d,_0x94421e){_0x94421e=_0x94421e||0xc8;return function(_0x539ec5){if(_0x539ec5){return _0x5c2b9d[_0xa335('0x1b')](_0x94421e)['json'](_0x539ec5);}};}function respondWithFilteredResult(_0x43f080,_0x4d7824){return function(_0x56608b){if(_0x56608b){var _0x1e5a40=typeof _0x4d7824[_0xa335('0x1c')]===_0xa335('0x1d')&&typeof _0x4d7824['limit']===_0xa335('0x1d');var _0x2af51e=_0x56608b[_0xa335('0x1e')];var _0x32a3ab=_0x1e5a40?0x0:_0x4d7824[_0xa335('0x1c')];var _0xc7fc6c=_0x1e5a40?_0x56608b[_0xa335('0x1e')]:_0x4d7824[_0xa335('0x1c')]+_0x4d7824[_0xa335('0x1f')];var _0x1b3586;if(_0xc7fc6c>=_0x2af51e){_0xc7fc6c=_0x2af51e;_0x1b3586=0xc8;}else{_0x1b3586=0xce;}_0x43f080['status'](_0x1b3586);return _0x43f080['set']('Content-Range',_0x32a3ab+'-'+_0xc7fc6c+'/'+_0x2af51e)['json'](_0x56608b);}return null;};}function patchUpdates(_0x38acf3){return function(_0x4a7ddf){try{jsonpatch['apply'](_0x4a7ddf,_0x38acf3,!![]);}catch(_0x3e4046){return BPromise[_0xa335('0x20')](_0x3e4046);}return _0x4a7ddf[_0xa335('0x21')]();};}function saveUpdates(_0x52a8c3,_0x4bf0fe){return function(_0x5d1576){if(_0x5d1576){return _0x5d1576[_0xa335('0x22')](_0x52a8c3)[_0xa335('0x23')](function(_0x34e54b){return _0x34e54b;});}return null;};}function removeEntity(_0x433cf7,_0x2f593f){return function(_0x665fd3){if(_0x665fd3){return _0x665fd3[_0xa335('0x24')]()['then'](function(){_0x433cf7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x464888,_0x4ebddf){return function(_0xde4b72){if(!_0xde4b72){_0x464888[_0xa335('0x19')](0x194);}return _0xde4b72;};}function handleError(_0x26c081,_0x4dcac4){_0x4dcac4=_0x4dcac4||0x1f4;return function(_0x4a51a2){logger[_0xa335('0x25')](_0x4a51a2[_0xa335('0x26')]);if(_0x4a51a2[_0xa335('0x27')]){delete _0x4a51a2[_0xa335('0x27')];}_0x26c081[_0xa335('0x1b')](_0x4dcac4)[_0xa335('0x28')](_0x4a51a2);};}exports['index']=function(_0x1f76c5,_0x1ddcd1){var _0x3f2106={},_0xbac2c1={},_0x19207c={'count':0x0,'rows':[]};var _0x388508=_['map'](db[_0xa335('0x29')][_0xa335('0x2a')],function(_0x4b5634){return{'name':_0x4b5634['fieldName'],'type':_0x4b5634[_0xa335('0x2b')][_0xa335('0x2c')]};});_0xbac2c1[_0xa335('0x2d')]=_[_0xa335('0x2e')](_0x388508,'name');_0xbac2c1[_0xa335('0x2f')]=_[_0xa335('0x30')](_0x1f76c5[_0xa335('0x2f')]);_0xbac2c1['filters']=_['intersection'](_0xbac2c1['model'],_0xbac2c1[_0xa335('0x2f')]);_0x3f2106['attributes']=_[_0xa335('0x31')](_0xbac2c1[_0xa335('0x2d')],qs[_0xa335('0x32')](_0x1f76c5[_0xa335('0x2f')][_0xa335('0x32')]));_0x3f2106[_0xa335('0x33')]=_0x3f2106[_0xa335('0x33')][_0xa335('0x34')]?_0x3f2106[_0xa335('0x33')]:_0xbac2c1['model'];if(!_0x1f76c5[_0xa335('0x2f')][_0xa335('0x35')](_0xa335('0x36'))){_0x3f2106[_0xa335('0x1f')]=qs['limit'](_0x1f76c5['query']['limit']);_0x3f2106[_0xa335('0x1c')]=qs['offset'](_0x1f76c5[_0xa335('0x2f')]['offset']);}_0x3f2106[_0xa335('0x37')]=qs[_0xa335('0x38')](_0x1f76c5[_0xa335('0x2f')][_0xa335('0x38')]);_0x3f2106[_0xa335('0x39')]=qs[_0xa335('0x3a')](_['pick'](_0x1f76c5[_0xa335('0x2f')],_0xbac2c1[_0xa335('0x3a')]),_0x388508);if(_0x1f76c5[_0xa335('0x2f')][_0xa335('0x3b')]){_0x3f2106[_0xa335('0x39')]=_[_0xa335('0x3c')](_0x3f2106['where'],{'$or':_[_0xa335('0x2e')](_0x388508,function(_0x3bdcc7){if(_0x3bdcc7[_0xa335('0x2b')]!==_0xa335('0x3d')){var _0x5b0383={};_0x5b0383[_0x3bdcc7[_0xa335('0x27')]]={'$like':'%'+_0x1f76c5['query'][_0xa335('0x3b')]+'%'};return _0x5b0383;}})});}_0x3f2106=_[_0xa335('0x3c')]({},_0x3f2106,_0x1f76c5['options']);var _0x53130c={'where':_0x3f2106['where']};return db[_0xa335('0x29')][_0xa335('0x1e')](_0x53130c)[_0xa335('0x23')](function(_0x98e1dd){_0x19207c[_0xa335('0x1e')]=_0x98e1dd;if(_0x1f76c5[_0xa335('0x2f')][_0xa335('0x3e')]){_0x3f2106['include']=[{'all':!![]}];}return db[_0xa335('0x29')]['findAll'](_0x3f2106);})[_0xa335('0x23')](function(_0x350f23){_0x19207c[_0xa335('0x3f')]=_0x350f23;return _0x19207c;})[_0xa335('0x23')](respondWithFilteredResult(_0x1ddcd1,_0x3f2106))[_0xa335('0x40')](handleError(_0x1ddcd1,null));};exports[_0xa335('0x41')]=function(_0x6319b0,_0x2db91e){var _0x1fe3d2={'raw':![],'where':{'id':_0x6319b0[_0xa335('0x42')]['id']}},_0x1e0050={};_0x1e0050[_0xa335('0x2d')]=_[_0xa335('0x30')](db['ZohoAccount'][_0xa335('0x2a')]);_0x1e0050[_0xa335('0x2f')]=_[_0xa335('0x30')](_0x6319b0[_0xa335('0x2f')]);_0x1e0050[_0xa335('0x3a')]=_['intersection'](_0x1e0050[_0xa335('0x2d')],_0x1e0050[_0xa335('0x2f')]);_0x1fe3d2[_0xa335('0x33')]=_[_0xa335('0x31')](_0x1e0050[_0xa335('0x2d')],qs[_0xa335('0x32')](_0x6319b0[_0xa335('0x2f')]['fields']));_0x1fe3d2[_0xa335('0x33')]=_0x1fe3d2[_0xa335('0x33')][_0xa335('0x34')]?_0x1fe3d2['attributes']:_0x1e0050['model'];if(_0x6319b0['query'][_0xa335('0x3e')]){_0x1fe3d2[_0xa335('0x43')]=[{'all':!![]}];}_0x1fe3d2=_[_0xa335('0x3c')]({},_0x1fe3d2,_0x6319b0['options']);return db[_0xa335('0x29')][_0xa335('0x44')](_0x1fe3d2)[_0xa335('0x23')](handleEntityNotFound(_0x2db91e,null))[_0xa335('0x23')](respondWithResult(_0x2db91e,null))[_0xa335('0x40')](handleError(_0x2db91e,null));};exports['create']=function(_0x3ae0e0,_0x58a02e){return db[_0xa335('0x29')][_0xa335('0x45')](_0x3ae0e0[_0xa335('0x46')],{})[_0xa335('0x23')](respondWithResult(_0x58a02e,0xc9))[_0xa335('0x40')](handleError(_0x58a02e,null));};exports[_0xa335('0x22')]=function(_0x30e00c,_0xba9dc0){if(_0x30e00c['body']['id']){delete _0x30e00c[_0xa335('0x46')]['id'];}return db[_0xa335('0x29')][_0xa335('0x44')]({'where':{'id':_0x30e00c['params']['id']}})[_0xa335('0x23')](handleEntityNotFound(_0xba9dc0,null))['then'](saveUpdates(_0x30e00c['body'],null))[_0xa335('0x23')](respondWithResult(_0xba9dc0,null))[_0xa335('0x40')](handleError(_0xba9dc0,null));};exports[_0xa335('0x24')]=function(_0x1969f0,_0x4ec435){return db[_0xa335('0x29')][_0xa335('0x44')]({'where':{'id':_0x1969f0['params']['id']}})[_0xa335('0x23')](handleEntityNotFound(_0x4ec435,null))['then'](removeEntity(_0x4ec435,null))[_0xa335('0x40')](handleError(_0x4ec435,null));};exports[_0xa335('0x47')]=function(_0x1eca57,_0x3867b2,_0x107ac0){var _0x3272ef={};var _0x413f97={};var _0x545e28;var _0x38b240;return db['ZohoAccount'][_0xa335('0x48')]({'where':{'id':_0x1eca57[_0xa335('0x42')]['id']}})['then'](handleEntityNotFound(_0x3867b2,null))[_0xa335('0x23')](function(_0x3c9df1){if(_0x3c9df1){_0x545e28=_0x3c9df1;_0x413f97[_0xa335('0x2d')]=_[_0xa335('0x30')](db[_0xa335('0x49')][_0xa335('0x2a')]);_0x413f97[_0xa335('0x2f')]=_[_0xa335('0x30')](_0x1eca57['query']);_0x413f97[_0xa335('0x3a')]=_[_0xa335('0x31')](_0x413f97['model'],_0x413f97[_0xa335('0x2f')]);_0x3272ef[_0xa335('0x33')]=_['intersection'](_0x413f97['model'],qs[_0xa335('0x32')](_0x1eca57[_0xa335('0x2f')][_0xa335('0x32')]));_0x3272ef[_0xa335('0x33')]=_0x3272ef['attributes'][_0xa335('0x34')]?_0x3272ef[_0xa335('0x33')]:_0x413f97[_0xa335('0x2d')];_0x3272ef[_0xa335('0x37')]=qs[_0xa335('0x38')](_0x1eca57[_0xa335('0x2f')]['sort']);_0x3272ef['where']=qs[_0xa335('0x3a')](_[_0xa335('0x4a')](_0x1eca57[_0xa335('0x2f')],_0x413f97[_0xa335('0x3a')]));if(_0x1eca57[_0xa335('0x2f')][_0xa335('0x3b')]){_0x3272ef[_0xa335('0x39')]=_['merge'](_0x3272ef['where'],{'$or':_[_0xa335('0x2e')](_0x3272ef[_0xa335('0x33')],function(_0x292fe6){var _0x412c13={};_0x412c13[_0x292fe6]={'$like':'%'+_0x1eca57[_0xa335('0x2f')][_0xa335('0x3b')]+'%'};return _0x412c13;})});}_0x3272ef=_[_0xa335('0x3c')]({},_0x3272ef,_0x1eca57[_0xa335('0x4b')]);return _0x545e28[_0xa335('0x47')](_0x3272ef);}})[_0xa335('0x23')](function(_0x3c43da){if(_0x3c43da){_0x38b240=_0x3c43da[_0xa335('0x34')];if(!_0x1eca57[_0xa335('0x2f')][_0xa335('0x35')]('nolimit')){_0x3272ef[_0xa335('0x1f')]=qs['limit'](_0x1eca57['query'][_0xa335('0x1f')]);_0x3272ef[_0xa335('0x1c')]=qs[_0xa335('0x1c')](_0x1eca57['query'][_0xa335('0x1c')]);}return _0x545e28[_0xa335('0x47')](_0x3272ef);}})[_0xa335('0x23')](function(_0x54abd2){if(_0x54abd2){return _0x54abd2?{'count':_0x38b240,'rows':_0x54abd2}:null;}})[_0xa335('0x23')](respondWithResult(_0x3867b2,null))[_0xa335('0x40')](handleError(_0x3867b2,null));};exports[_0xa335('0x4c')]=function(_0x4002e3,_0x126c1b,_0x1255ff){if(_0x4002e3[_0xa335('0x46')]['id']){delete _0x4002e3[_0xa335('0x46')]['id'];}return db[_0xa335('0x29')][_0xa335('0x48')]({'where':{'id':_0x4002e3[_0xa335('0x42')]['id']}})[_0xa335('0x23')](handleEntityNotFound(_0x126c1b,null))[_0xa335('0x23')](function(_0x1a6619){if(_0x1a6619){_0x4002e3[_0xa335('0x46')][_0xa335('0x4d')]=_0x1a6619['id'];_0x4002e3[_0xa335('0x46')][_0xa335('0x4e')]=integrations[_0xa335('0x4f')](_0x4002e3[_0xa335('0x46')][_0xa335('0x50')],_0x4002e3[_0xa335('0x46')][_0xa335('0x2b')]);_0x4002e3[_0xa335('0x46')][_0xa335('0x51')]=integrations[_0xa335('0x52')](_0x4002e3['body']['channel'],_0x4002e3['body'][_0xa335('0x2b')]);return db['ZohoConfiguration'][_0xa335('0x45')](_0x4002e3['body'],{'include':[{'model':db[_0xa335('0x53')],'as':_0xa335('0x4e')},{'model':db[_0xa335('0x53')],'as':_0xa335('0x51')}]});}return null;})[_0xa335('0x23')](respondWithResult(_0x126c1b,null))['catch'](handleError(_0x126c1b,null));};function getAccessToken(_0x291fc8){return new Promise(function(_0x4eee25,_0x3264ec){var _0x889e07;switch(_0x291fc8[_0xa335('0x54')]){case'US':_0x889e07=_0xa335('0x55');break;case'AU':_0x889e07=_0xa335('0x56');break;case'EU':_0x889e07='https://accounts.zoho.eu';break;case'IN':_0x889e07=_0xa335('0x57');break;case'CN':_0x889e07=_0xa335('0x58');break;default:_0x889e07='https://accounts.zoho.eu';break;}var _0x617e79={'method':_0xa335('0x59'),'uri':_0x889e07+_0xa335('0x5a'),'qs':{'refresh_token':_0x291fc8['refreshToken'],'client_id':_0x291fc8[_0xa335('0x5b')],'client_secret':_0x291fc8[_0xa335('0x5c')],'grant_type':_0xa335('0x5d')},'json':!![]};return rp(_0x617e79)[_0xa335('0x23')](function(_0x50ed6a){if(_0x50ed6a[_0xa335('0x5e')]){_0x4eee25(_0x50ed6a[_0xa335('0x5e')]);}else{_0x3264ec(_0xa335('0x5f'));}})[_0xa335('0x40')](function(_0x520396){_0x3264ec(_0x520396);});});}exports[_0xa335('0x60')]=function(_0x133022,_0x4b1f10,_0x318624){var _0x25bbb1,_0x514b4d,_0x35c887,_0x3da4c6,_0x3cb6cc;return db[_0xa335('0x29')][_0xa335('0x48')]({'where':{'id':_0x133022[_0xa335('0x42')]['id']},'attributes':['id',_0xa335('0x61'),_0xa335('0x54'),_0xa335('0x5b'),_0xa335('0x5c'),_0xa335('0x62'),_0xa335('0x63'),'refreshToken']})[_0xa335('0x23')](handleEntityNotFound(_0x4b1f10,null))['then'](function(_0x4cd500){_0x3cb6cc=_0x4cd500;_0x25bbb1=_0x3cb6cc[_0xa335('0x61')];_0x514b4d=_0x25bbb1===_0xa335('0x64')?'eu':_0xa335('0x65');_0x35c887=_0x3cb6cc[_0xa335('0x62')];var _0x4b6fb6=_0x35c887[_0xa335('0x66')](-0x1);if(_0x4b6fb6==='/'||_0x4b6fb6==='\x5c'||_0x4b6fb6===':'){_0x35c887=_0x35c887[_0xa335('0x67')](0x0,_0x35c887[_0xa335('0x68')](_0x4b6fb6));}if(!_0x3cb6cc['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x3cb6cc);})['then'](function(_0x5d1adc){if(_0x5d1adc){return rp({'method':_0xa335('0x69'),'uri':util[_0xa335('0x6a')](_0xa335('0x6b'),_0x514b4d),'qs':{'module':_0xa335('0x6c')},'headers':{'Authorization':_0xa335('0x6d')+_0x5d1adc},'json':!![]});}})[_0xa335('0x23')](function(_0x469487){if(_0x469487){if(_0x469487[_0xa335('0x6e')]&&_0x469487[_0xa335('0x6e')]['error']){throw new Error(_0x469487[_0xa335('0x6e')][_0xa335('0x25')][_0xa335('0x6f')]);}var _0x3a10c9=[];var _0x40108c=[];var _0x5aca35=['Owner','Subject',_0xa335('0x70'),'WhoId',_0xa335('0x71'),_0xa335('0x72'),_0xa335('0x73'),_0xa335('0x74')];_0x40108c=_[_0xa335('0x75')](_0x469487[_0xa335('0x32')],function(_0x1d6ef4){return _0x5aca35[_0xa335('0x76')](_0x1d6ef4['api_name']);});for(var _0x537b11=0x0;_0x537b11<_0x40108c[_0xa335('0x34')];_0x537b11++){if(_0x40108c[_0x537b11][_0xa335('0x77')]===![]){_0x3a10c9[_0xa335('0x78')]({'id':_0x40108c[_0x537b11]['id'],'name':_0x40108c[_0x537b11]['display_label'],'custom':_0x40108c[_0x537b11]['custom_field'],'options':_0x40108c[_0x537b11]['data_type']===_0xa335('0x79')&&_0x40108c[_0x537b11][_0xa335('0x7a')][_0xa335('0x34')]>-0x1?_[_0xa335('0x2e')](_0x40108c[_0x537b11][_0xa335('0x7a')],function(_0x48c7d8){return{'name':_0x48c7d8,'value':_0x48c7d8};}):[]});}}return{'count':_0x3a10c9[_0xa335('0x34')],'rows':_0x3a10c9};}else{return{'count':0x0,'rows':[]};}})[_0xa335('0x23')](respondWithResult(_0x4b1f10,null))[_0xa335('0x40')](function(_0x33f024){var _0x349ed8=_0x133022[_0xa335('0x2f')]['test']?0x1f4:_0x33f024[_0xa335('0x7b')]||0x1f4;logger['error'](_0xa335('0x7c'),_0xa335('0x60'),_0x349ed8,JSON['stringify'](_0x33f024));delete _0x33f024[_0xa335('0x27')];if(_0x349ed8===0x191){_0x349ed8=0x190;}_0x4b1f10[_0xa335('0x1b')](_0x349ed8)[_0xa335('0x28')](_0x133022['query'][_0xa335('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x33f024[_0xa335('0x7b')]}:_0x33f024);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index afcd4a8..bfe7184 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 _0x3fce=['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','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','zone','host','slice','then','parse','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3fce,0x1cc));var _0xe3fc=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0x3fce[_0x3b632f];return _0x10e788;};'use strict';var _=require(_0xe3fc('0x0'));var util=require(_0xe3fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe3fc('0x2'));var BPromise=require(_0xe3fc('0x3'));var rp=require(_0xe3fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3fc('0x5'));var config=require(_0xe3fc('0x6'));var attributes=require(_0xe3fc('0x7'));var integrations=require(_0xe3fc('0x8'));module[_0xe3fc('0x9')]=function(_0x308cb2,_0x3dc84c){return _0x308cb2[_0xe3fc('0xa')](_0xe3fc('0xb'),attributes,{'tableName':_0xe3fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3e583a,_0x3dccc7,_0x14cace){if(_0x3e583a[_0xe3fc('0xd')]('zone')||_0x3e583a[_0xe3fc('0xd')](_0xe3fc('0xe'))||_0x3e583a[_0xe3fc('0xd')](_0xe3fc('0xf'))||_0x3e583a[_0xe3fc('0xd')](_0xe3fc('0x10'))||_0x3e583a['changed'](_0xe3fc('0x11'))||_0x3e583a[_0xe3fc('0xd')]('host')){var _0x480ff2,_0x47e773;_0x480ff2=_0x3e583a[_0xe3fc('0xe')];var _0x19cfa8=_0x480ff2['slice'](-0x1);if(_0x19cfa8==='/'||_0x19cfa8==='\x5c'||_0x19cfa8===':'){_0x480ff2=_0x480ff2[_0xe3fc('0x12')](0x0,_0x480ff2[_0xe3fc('0x13')](_0x19cfa8));}switch(_0x3e583a['zone']){case'US':_0x47e773='https://accounts.zoho.com';break;case'AU':_0x47e773=_0xe3fc('0x14');break;case'IN':_0x47e773=_0xe3fc('0x15');break;case'CN':_0x47e773=_0xe3fc('0x16');break;default:_0x47e773=_0xe3fc('0x17');break;}var _0x1c7ee1={'method':_0xe3fc('0x18'),'uri':_0x47e773+_0xe3fc('0x19'),'form':{'grant_type':_0xe3fc('0x1a'),'client_id':_0x3e583a[_0xe3fc('0xf')],'client_secret':_0x3e583a[_0xe3fc('0x10')],'redirect_uri':_0x3e583a[_0xe3fc('0xe')],'code':_0x3e583a[_0xe3fc('0x11')]},'headers':{'Content-Type':_0xe3fc('0x1b')}};return rp(_0x1c7ee1)['then'](function(_0x4aa330){var _0x4294a8=JSON['parse'](_0x4aa330);if(_0x4294a8[_0xe3fc('0x1c')]){_0x3e583a[_0xe3fc('0x1d')]=_0x4294a8[_0xe3fc('0x1c')];logger[_0xe3fc('0x1e')](util[_0xe3fc('0x1f')](_0xe3fc('0x20'),_0x3e583a[_0xe3fc('0x21')],_0x3e583a['id']));}else{logger[_0xe3fc('0x22')](util[_0xe3fc('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3e583a['name'],_0x3e583a['id']),util[_0xe3fc('0x23')](_0x4294a8,{'showHidden':![],'depth':null}));}return _0x14cace(null,_0x3dccc7);})[_0xe3fc('0x24')](function(_0x28efb8){logger[_0xe3fc('0x22')](util[_0xe3fc('0x1f')](_0xe3fc('0x25'),_0x3e583a[_0xe3fc('0x21')],_0x3e583a['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x14cace(_0x28efb8);});}else{return _0x14cace(null,_0x3dccc7);}},'beforeUpdate':function(_0x4b8ce0,_0x312eee,_0x11f561){if(_0x4b8ce0['changed'](_0xe3fc('0x26'))||_0x4b8ce0[_0xe3fc('0xd')](_0xe3fc('0xe'))||_0x4b8ce0[_0xe3fc('0xd')](_0xe3fc('0xf'))||_0x4b8ce0[_0xe3fc('0xd')](_0xe3fc('0x10'))||_0x4b8ce0[_0xe3fc('0xd')]('code')||_0x4b8ce0[_0xe3fc('0xd')](_0xe3fc('0x27'))){var _0x53391b,_0x4fc6ba;_0x53391b=_0x4b8ce0[_0xe3fc('0xe')];var _0x2612f2=_0x53391b[_0xe3fc('0x28')](-0x1);if(_0x2612f2==='/'||_0x2612f2==='\x5c'||_0x2612f2===':'){_0x53391b=_0x53391b[_0xe3fc('0x12')](0x0,_0x53391b['lastIndexOf'](_0x2612f2));}switch(_0x4b8ce0[_0xe3fc('0x26')]){case'US':_0x4fc6ba='https://accounts.zoho.com';break;case'AU':_0x4fc6ba='https://accounts.zoho.com.au';break;case'IN':_0x4fc6ba='https://accounts.zoho.in';break;case'CN':_0x4fc6ba=_0xe3fc('0x16');break;default:_0x4fc6ba=_0xe3fc('0x17');break;}var _0x51a55a={'method':_0xe3fc('0x18'),'uri':_0x4fc6ba+_0xe3fc('0x19'),'form':{'grant_type':_0xe3fc('0x1a'),'client_id':_0x4b8ce0[_0xe3fc('0xf')],'client_secret':_0x4b8ce0[_0xe3fc('0x10')],'redirect_uri':_0x4b8ce0[_0xe3fc('0xe')],'code':_0x4b8ce0[_0xe3fc('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x51a55a)[_0xe3fc('0x29')](function(_0x3665cd){var _0xbed39b=JSON[_0xe3fc('0x2a')](_0x3665cd);if(_0xbed39b[_0xe3fc('0x1c')]){_0x4b8ce0[_0xe3fc('0x1d')]=_0xbed39b['refresh_token'];logger[_0xe3fc('0x1e')](util[_0xe3fc('0x1f')](_0xe3fc('0x20'),_0x4b8ce0[_0xe3fc('0x21')],_0x4b8ce0['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4b8ce0['name'],_0x4b8ce0['id']),util[_0xe3fc('0x23')](_0xbed39b,{'showHidden':![],'depth':null}));}return _0x11f561(null,_0x312eee);})[_0xe3fc('0x24')](function(_0x2d6bee){logger[_0xe3fc('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4b8ce0[_0xe3fc('0x21')],_0x4b8ce0['id']),util[_0xe3fc('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x11f561(_0x2d6bee);});}else{return _0x11f561(null,_0x312eee);}}}});}; \ No newline at end of file +var _0xf166=['https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','serverUrl','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','clientSecret','POST','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports','define','ZohoAccount','changed','zone','clientId','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x5e7fcb,_0xaaf409){var _0x31af1a=function(_0x34499e){while(--_0x34499e){_0x5e7fcb['push'](_0x5e7fcb['shift']());}};_0x31af1a(++_0xaaf409);}(_0xf166,0x1e8));var _0x6f16=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf166[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f16('0x0'))('api');var moment=require(_0x6f16('0x1'));var BPromise=require(_0x6f16('0x2'));var rp=require(_0x6f16('0x3'));var fs=require('fs');var path=require(_0x6f16('0x4'));var rimraf=require(_0x6f16('0x5'));var config=require('../../config/environment');var attributes=require(_0x6f16('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x6f16('0x7')]=function(_0x284457,_0x53d975){return _0x284457[_0x6f16('0x8')](_0x6f16('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41c953,_0x230fcf,_0x3dfc69){if(_0x41c953[_0x6f16('0xa')](_0x6f16('0xb'))||_0x41c953[_0x6f16('0xa')]('serverUrl')||_0x41c953[_0x6f16('0xa')](_0x6f16('0xc'))||_0x41c953[_0x6f16('0xa')]('clientSecret')||_0x41c953[_0x6f16('0xa')](_0x6f16('0xd'))||_0x41c953[_0x6f16('0xa')]('host')){var _0x54263d,_0x3899de;_0x54263d=_0x41c953['serverUrl'];var _0x51edc1=_0x54263d[_0x6f16('0xe')](-0x1);if(_0x51edc1==='/'||_0x51edc1==='\x5c'||_0x51edc1===':'){_0x54263d=_0x54263d[_0x6f16('0xf')](0x0,_0x54263d[_0x6f16('0x10')](_0x51edc1));}switch(_0x41c953[_0x6f16('0xb')]){case'US':_0x3899de=_0x6f16('0x11');break;case'AU':_0x3899de=_0x6f16('0x12');break;case'IN':_0x3899de=_0x6f16('0x13');break;case'CN':_0x3899de=_0x6f16('0x14');break;default:_0x3899de=_0x6f16('0x15');break;}var _0x39b985={'method':'POST','uri':_0x3899de+_0x6f16('0x16'),'form':{'grant_type':_0x6f16('0x17'),'client_id':_0x41c953[_0x6f16('0xc')],'client_secret':_0x41c953['clientSecret'],'redirect_uri':_0x41c953[_0x6f16('0x18')],'code':_0x41c953['code']},'headers':{'Content-Type':_0x6f16('0x19')}};return rp(_0x39b985)[_0x6f16('0x1a')](function(_0x39d710){var _0x14fb9a=JSON['parse'](_0x39d710);if(_0x14fb9a[_0x6f16('0x1b')]){_0x41c953[_0x6f16('0x1c')]=_0x14fb9a[_0x6f16('0x1b')];logger[_0x6f16('0x1d')](util[_0x6f16('0x1e')](_0x6f16('0x1f'),_0x41c953[_0x6f16('0x20')],_0x41c953['id']));}else{logger[_0x6f16('0x21')](util[_0x6f16('0x1e')](_0x6f16('0x22'),_0x41c953[_0x6f16('0x20')],_0x41c953['id']),util[_0x6f16('0x23')](_0x14fb9a,{'showHidden':![],'depth':null}));}return _0x3dfc69(null,_0x230fcf);})[_0x6f16('0x24')](function(_0x1c1739){logger[_0x6f16('0x21')](util[_0x6f16('0x1e')](_0x6f16('0x22'),_0x41c953[_0x6f16('0x20')],_0x41c953['id']),util[_0x6f16('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3dfc69(_0x1c1739);});}else{return _0x3dfc69(null,_0x230fcf);}},'beforeUpdate':function(_0x5319e7,_0x4327ec,_0x2986bf){if(_0x5319e7[_0x6f16('0xa')](_0x6f16('0xb'))||_0x5319e7[_0x6f16('0xa')](_0x6f16('0x18'))||_0x5319e7[_0x6f16('0xa')]('clientId')||_0x5319e7[_0x6f16('0xa')](_0x6f16('0x25'))||_0x5319e7['changed'](_0x6f16('0xd'))||_0x5319e7[_0x6f16('0xa')]('host')){var _0x3bb842,_0x58127f;_0x3bb842=_0x5319e7['serverUrl'];var _0xb9b88d=_0x3bb842['slice'](-0x1);if(_0xb9b88d==='/'||_0xb9b88d==='\x5c'||_0xb9b88d===':'){_0x3bb842=_0x3bb842[_0x6f16('0xf')](0x0,_0x3bb842['lastIndexOf'](_0xb9b88d));}switch(_0x5319e7[_0x6f16('0xb')]){case'US':_0x58127f=_0x6f16('0x11');break;case'AU':_0x58127f=_0x6f16('0x12');break;case'IN':_0x58127f=_0x6f16('0x13');break;case'CN':_0x58127f=_0x6f16('0x14');break;default:_0x58127f=_0x6f16('0x15');break;}var _0x4bc884={'method':_0x6f16('0x26'),'uri':_0x58127f+_0x6f16('0x16'),'form':{'grant_type':_0x6f16('0x17'),'client_id':_0x5319e7['clientId'],'client_secret':_0x5319e7['clientSecret'],'redirect_uri':_0x5319e7[_0x6f16('0x18')],'code':_0x5319e7[_0x6f16('0xd')]},'headers':{'Content-Type':_0x6f16('0x19')}};return rp(_0x4bc884)[_0x6f16('0x1a')](function(_0x415fc2){var _0x459b64=JSON['parse'](_0x415fc2);if(_0x459b64[_0x6f16('0x1b')]){_0x5319e7[_0x6f16('0x1c')]=_0x459b64[_0x6f16('0x1b')];logger[_0x6f16('0x1d')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5319e7[_0x6f16('0x20')],_0x5319e7['id']));}else{logger[_0x6f16('0x21')](util[_0x6f16('0x1e')](_0x6f16('0x22'),_0x5319e7['name'],_0x5319e7['id']),util[_0x6f16('0x23')](_0x459b64,{'showHidden':![],'depth':null}));}return _0x2986bf(null,_0x4327ec);})[_0x6f16('0x24')](function(_0x47ba2f){logger[_0x6f16('0x21')](util[_0x6f16('0x1e')](_0x6f16('0x22'),_0x5319e7[_0x6f16('0x20')],_0x5319e7['id']),util[_0x6f16('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x2986bf(_0x47ba2f);});}else{return _0x2986bf(null,_0x4327ec);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index cbb898d..889035d 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 _0x42f4=['model','GetZohoAccount','ShowZohoAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','ZohoAccount','findAll','options','raw','attributes','limit','include','map'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0x42f4,0x19d));var _0x442f=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x42f4[_0x1168a1];return _0xcc5ad8;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11b450,_0x23c5ba,_0x37dfe7){return new BPromise(function(_0x6c0b4b,_0x476480){return client['request'](_0x11b450,_0x37dfe7)[_0x442f('0x9')](function(_0x4e32af){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x23c5ba,_0x442f('0xa'));logger[_0x442f('0xb')](_0x442f('0xc'),_0x23c5ba,_0x442f('0xa'),JSON[_0x442f('0xd')](_0x4e32af));if(_0x4e32af[_0x442f('0xe')]){if(_0x4e32af[_0x442f('0xe')][_0x442f('0xf')]===0x1f4){logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af['error'][_0x442f('0x11')]);return _0x476480(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}logger[_0x442f('0xe')](_0x442f('0x10'),_0x23c5ba,_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);return _0x6c0b4b(_0x4e32af[_0x442f('0xe')][_0x442f('0x11')]);}else{logger[_0x442f('0x12')](_0x442f('0x10'),_0x23c5ba,_0x442f('0xa'));_0x6c0b4b(_0x4e32af[_0x442f('0x13')][_0x442f('0x11')]);}})[_0x442f('0x14')](function(_0x3ff2b1){logger['error'](_0x442f('0x10'),_0x23c5ba,_0x3ff2b1);_0x476480(_0x3ff2b1);});});}exports['GetZohoAccount']=function(_0x54c48a){var _0x5668e0=this;return new Promise(function(_0x5e3dda,_0x1b18fd){return db[_0x442f('0x15')][_0x442f('0x16')]({'raw':_0x54c48a[_0x442f('0x17')]?_0x54c48a[_0x442f('0x17')][_0x442f('0x18')]===undefined?!![]:![]:!![],'where':_0x54c48a['options']?_0x54c48a[_0x442f('0x17')]['where']||null:null,'attributes':_0x54c48a[_0x442f('0x17')]?_0x54c48a[_0x442f('0x17')][_0x442f('0x19')]||null:null,'limit':_0x54c48a['options']?_0x54c48a[_0x442f('0x17')][_0x442f('0x1a')]||null:null,'include':_0x54c48a['options']?_0x54c48a['options'][_0x442f('0x1b')]?_[_0x442f('0x1c')](_0x54c48a[_0x442f('0x17')][_0x442f('0x1b')],function(_0x2a2ae7){return{'model':db[_0x2a2ae7[_0x442f('0x1d')]],'as':_0x2a2ae7['as'],'attributes':_0x2a2ae7[_0x442f('0x19')],'include':_0x2a2ae7[_0x442f('0x1b')]?_[_0x442f('0x1c')](_0x2a2ae7['include'],function(_0x393eed){return{'model':db[_0x393eed[_0x442f('0x1d')]],'as':_0x393eed['as'],'attributes':_0x393eed[_0x442f('0x19')],'include':_0x393eed[_0x442f('0x1b')]?_['map'](_0x393eed[_0x442f('0x1b')],function(_0x268516){return{'model':db[_0x268516[_0x442f('0x1d')]],'as':_0x268516['as'],'attributes':_0x268516[_0x442f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ee478){logger[_0x442f('0x12')](_0x442f('0x1e'),_0x54c48a);logger['debug'](_0x442f('0x1e'),_0x54c48a,JSON['stringify'](_0x5ee478));_0x5e3dda(_0x5ee478);})[_0x442f('0x14')](function(_0x36abd2){logger[_0x442f('0xe')]('GetZohoAccount',_0x36abd2[_0x442f('0x11')],_0x54c48a);_0x1b18fd(_0x5668e0[_0x442f('0xe')](0x1f4,_0x36abd2[_0x442f('0x11')]));});});};exports[_0x442f('0x1f')]=function(_0x3f8aa6){var _0x59d0d8=this;return new Promise(function(_0x487491,_0x3cc574){return db['ZohoAccount'][_0x442f('0x20')]({'raw':_0x3f8aa6[_0x442f('0x17')]?_0x3f8aa6[_0x442f('0x17')][_0x442f('0x18')]===undefined?!![]:![]:!![],'where':_0x3f8aa6[_0x442f('0x17')]?_0x3f8aa6[_0x442f('0x17')][_0x442f('0x21')]||null:null,'attributes':_0x3f8aa6[_0x442f('0x17')]?_0x3f8aa6[_0x442f('0x17')]['attributes']||null:null,'include':_0x3f8aa6[_0x442f('0x17')]?_0x3f8aa6['options'][_0x442f('0x1b')]?_[_0x442f('0x1c')](_0x3f8aa6['options'][_0x442f('0x1b')],function(_0x24477b){return{'model':db[_0x24477b[_0x442f('0x1d')]],'as':_0x24477b['as'],'attributes':_0x24477b[_0x442f('0x19')],'include':_0x24477b[_0x442f('0x1b')]?_['map'](_0x24477b[_0x442f('0x1b')],function(_0x2f3a5b){return{'model':db[_0x2f3a5b[_0x442f('0x1d')]],'as':_0x2f3a5b['as'],'attributes':_0x2f3a5b[_0x442f('0x19')],'include':_0x2f3a5b[_0x442f('0x1b')]?_['map'](_0x2f3a5b[_0x442f('0x1b')],function(_0x31bce1){return{'model':db[_0x31bce1['model']],'as':_0x31bce1['as'],'attributes':_0x31bce1[_0x442f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x442f('0x9')](function(_0x5ef295){logger[_0x442f('0x12')](_0x442f('0x1f'),_0x3f8aa6);logger[_0x442f('0xb')](_0x442f('0x1f'),_0x3f8aa6,JSON[_0x442f('0xd')](_0x5ef295));_0x487491(_0x5ef295);})[_0x442f('0x14')](function(_0x4734a9){logger['error'](_0x442f('0x1f'),_0x4734a9[_0x442f('0x11')],_0x3f8aa6);_0x3cc574(_0x59d0d8['error'](0x1f4,_0x4734a9[_0x442f('0x11')]));});});}; \ No newline at end of file +var _0xda20=['http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetZohoAccount','findAll','options','where','limit','include','model','attributes','map','stringify','ShowZohoAccount','raw','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x59f045,_0x20a4df){var _0xeb20e7=function(_0x83a948){while(--_0x83a948){_0x59f045['push'](_0x59f045['shift']());}};_0xeb20e7(++_0x20a4df);}(_0xda20,0x1d9));var _0x0da2=function(_0x10aa9d,_0x26bea6){_0x10aa9d=_0x10aa9d-0x0;var _0x2fb823=_0xda20[_0x10aa9d];return _0x2fb823;};'use strict';var _=require(_0x0da2('0x0'));var util=require('util');var moment=require(_0x0da2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0da2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0da2('0x3'));var logger=require(_0x0da2('0x4'))('rpc');var config=require(_0x0da2('0x5'));var jayson=require(_0x0da2('0x6'));var client=jayson['client'][_0x0da2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x292ede,_0x166a32,_0x3aa0c5){return new BPromise(function(_0x1e5150,_0x1069a6){return client[_0x0da2('0x8')](_0x292ede,_0x3aa0c5)[_0x0da2('0x9')](function(_0x248bce){logger['info'](_0x0da2('0xa'),_0x166a32,_0x0da2('0xb'));logger[_0x0da2('0xc')](_0x0da2('0xd'),_0x166a32,'request\x20sent',JSON['stringify'](_0x248bce));if(_0x248bce[_0x0da2('0xe')]){if(_0x248bce[_0x0da2('0xe')][_0x0da2('0xf')]===0x1f4){logger[_0x0da2('0xe')](_0x0da2('0xa'),_0x166a32,_0x248bce[_0x0da2('0xe')][_0x0da2('0x10')]);return _0x1069a6(_0x248bce['error'][_0x0da2('0x10')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x166a32,_0x248bce['error'][_0x0da2('0x10')]);return _0x1e5150(_0x248bce['error'][_0x0da2('0x10')]);}else{logger[_0x0da2('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x166a32,_0x0da2('0xb'));_0x1e5150(_0x248bce[_0x0da2('0x12')]['message']);}})[_0x0da2('0x13')](function(_0x192772){logger[_0x0da2('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x166a32,_0x192772);_0x1069a6(_0x192772);});});}exports[_0x0da2('0x14')]=function(_0x395513){var _0x484c1a=this;return new Promise(function(_0x54a235,_0x2e0f4e){return db['ZohoAccount'][_0x0da2('0x15')]({'raw':_0x395513['options']?_0x395513['options']['raw']===undefined?!![]:![]:!![],'where':_0x395513['options']?_0x395513[_0x0da2('0x16')][_0x0da2('0x17')]||null:null,'attributes':_0x395513[_0x0da2('0x16')]?_0x395513['options']['attributes']||null:null,'limit':_0x395513['options']?_0x395513[_0x0da2('0x16')][_0x0da2('0x18')]||null:null,'include':_0x395513[_0x0da2('0x16')]?_0x395513[_0x0da2('0x16')][_0x0da2('0x19')]?_['map'](_0x395513[_0x0da2('0x16')][_0x0da2('0x19')],function(_0x1c3ab0){return{'model':db[_0x1c3ab0[_0x0da2('0x1a')]],'as':_0x1c3ab0['as'],'attributes':_0x1c3ab0[_0x0da2('0x1b')],'include':_0x1c3ab0[_0x0da2('0x19')]?_[_0x0da2('0x1c')](_0x1c3ab0[_0x0da2('0x19')],function(_0x3604d3){return{'model':db[_0x3604d3['model']],'as':_0x3604d3['as'],'attributes':_0x3604d3[_0x0da2('0x1b')],'include':_0x3604d3['include']?_[_0x0da2('0x1c')](_0x3604d3[_0x0da2('0x19')],function(_0x2aa651){return{'model':db[_0x2aa651[_0x0da2('0x1a')]],'as':_0x2aa651['as'],'attributes':_0x2aa651['attributes']};}):[]};}):[]};}):[]:[]})[_0x0da2('0x9')](function(_0x2a931d){logger[_0x0da2('0x11')](_0x0da2('0x14'),_0x395513);logger[_0x0da2('0xc')]('GetZohoAccount',_0x395513,JSON[_0x0da2('0x1d')](_0x2a931d));_0x54a235(_0x2a931d);})['catch'](function(_0x525dc){logger[_0x0da2('0xe')](_0x0da2('0x14'),_0x525dc[_0x0da2('0x10')],_0x395513);_0x2e0f4e(_0x484c1a[_0x0da2('0xe')](0x1f4,_0x525dc[_0x0da2('0x10')]));});});};exports[_0x0da2('0x1e')]=function(_0x3c5460){var _0x1f2b6f=this;return new Promise(function(_0x20d591,_0x3981a5){return db['ZohoAccount']['find']({'raw':_0x3c5460['options']?_0x3c5460[_0x0da2('0x16')][_0x0da2('0x1f')]===undefined?!![]:![]:!![],'where':_0x3c5460['options']?_0x3c5460['options'][_0x0da2('0x17')]||null:null,'attributes':_0x3c5460[_0x0da2('0x16')]?_0x3c5460[_0x0da2('0x16')][_0x0da2('0x1b')]||null:null,'include':_0x3c5460['options']?_0x3c5460[_0x0da2('0x16')]['include']?_[_0x0da2('0x1c')](_0x3c5460[_0x0da2('0x16')][_0x0da2('0x19')],function(_0x3e1ef2){return{'model':db[_0x3e1ef2[_0x0da2('0x1a')]],'as':_0x3e1ef2['as'],'attributes':_0x3e1ef2[_0x0da2('0x1b')],'include':_0x3e1ef2[_0x0da2('0x19')]?_['map'](_0x3e1ef2[_0x0da2('0x19')],function(_0x32036c){return{'model':db[_0x32036c[_0x0da2('0x1a')]],'as':_0x32036c['as'],'attributes':_0x32036c[_0x0da2('0x1b')],'include':_0x32036c[_0x0da2('0x19')]?_[_0x0da2('0x1c')](_0x32036c['include'],function(_0x408b21){return{'model':db[_0x408b21[_0x0da2('0x1a')]],'as':_0x408b21['as'],'attributes':_0x408b21[_0x0da2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0da2('0x9')](function(_0x578299){logger['info'](_0x0da2('0x1e'),_0x3c5460);logger[_0x0da2('0xc')](_0x0da2('0x1e'),_0x3c5460,JSON[_0x0da2('0x1d')](_0x578299));_0x20d591(_0x578299);})[_0x0da2('0x13')](function(_0x124dbc){logger[_0x0da2('0xe')](_0x0da2('0x1e'),_0x124dbc[_0x0da2('0x10')],_0x3c5460);_0x3981a5(_0x1f2b6f['error'](0x1f4,_0x124dbc[_0x0da2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index e17ca6f..0ab34de 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 _0xc2b2=['get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','put','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4617eb,_0x4c4dbb){var _0x1d284e=function(_0x400889){while(--_0x400889){_0x4617eb['push'](_0x4617eb['shift']());}};_0x1d284e(++_0x4c4dbb);}(_0xc2b2,0x188));var _0x2c2b=function(_0x1fcff7,_0x2a2376){_0x1fcff7=_0x1fcff7-0x0;var _0x577bea=_0xc2b2[_0x1fcff7];return _0x577bea;};'use strict';var multer=require(_0x2c2b('0x0'));var util=require('util');var path=require(_0x2c2b('0x1'));var timeout=require(_0x2c2b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c2b('0x3'));var auth=require(_0x2c2b('0x4'));var interaction=require(_0x2c2b('0x5'));var config=require(_0x2c2b('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x2c2b('0x7')]('/',auth['isAuthenticated'](),controller[_0x2c2b('0x8')]);router['get'](_0x2c2b('0x9'),auth[_0x2c2b('0xa')](),controller[_0x2c2b('0xb')]);router['get'](_0x2c2b('0xc'),auth['isAuthenticated'](),controller[_0x2c2b('0xd')]);router[_0x2c2b('0x7')]('/:id/subjects',auth[_0x2c2b('0xa')](),controller[_0x2c2b('0xe')]);router['get'](_0x2c2b('0xf'),auth[_0x2c2b('0xa')](),controller['getDescriptions']);router[_0x2c2b('0x10')]('/',auth[_0x2c2b('0xa')](),controller['create']);router[_0x2c2b('0x11')]('/:id',auth[_0x2c2b('0xa')](),controller[_0x2c2b('0x12')]);router[_0x2c2b('0x13')](_0x2c2b('0x9'),auth[_0x2c2b('0xa')](),controller[_0x2c2b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8ead=['/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields'];(function(_0x5bfb19,_0x56a393){var _0x264bb9=function(_0x2cd624){while(--_0x2cd624){_0x5bfb19['push'](_0x5bfb19['shift']());}};_0x264bb9(++_0x56a393);}(_0x8ead,0x1d1));var _0xd8ea=function(_0x335ed9,_0x17d64a){_0x335ed9=_0x335ed9-0x0;var _0x1e3f81=_0x8ead[_0x335ed9];return _0x1e3f81;};'use strict';var multer=require(_0xd8ea('0x0'));var util=require('util');var path=require(_0xd8ea('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8ea('0x2'));var router=express[_0xd8ea('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd8ea('0x4'));var interaction=require(_0xd8ea('0x5'));var config=require(_0xd8ea('0x6'));var controller=require(_0xd8ea('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8ea('0x8')]);router[_0xd8ea('0x9')](_0xd8ea('0xa'),auth[_0xd8ea('0xb')](),controller[_0xd8ea('0xc')]);router[_0xd8ea('0x9')](_0xd8ea('0xd'),auth['isAuthenticated'](),controller[_0xd8ea('0xe')]);router['get'](_0xd8ea('0xf'),auth[_0xd8ea('0xb')](),controller[_0xd8ea('0x10')]);router[_0xd8ea('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xd8ea('0x11')]);router[_0xd8ea('0x12')]('/',auth[_0xd8ea('0xb')](),controller[_0xd8ea('0x13')]);router[_0xd8ea('0x14')](_0xd8ea('0xa'),auth[_0xd8ea('0xb')](),controller['update']);router[_0xd8ea('0x15')]('/:id',auth[_0xd8ea('0xb')](),controller[_0xd8ea('0x16')]);module[_0xd8ea('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 581ff36..3a20f67 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 _0x9dfe=['nothing','ENUM','contact_lead','STRING','lead','contact'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9dfe,0x105));var _0xe9df=function(_0x640ca1,_0xe3ab50){_0x640ca1=_0x640ca1-0x0;var _0x1e36a0=_0x9dfe[_0x640ca1];return _0x1e36a0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe9df('0x0')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xe9df('0x1'),_0xe9df('0x2'),_0xe9df('0x3')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xe9df('0x4')](_0xe9df('0x5'),_0xe9df('0x2'),'lead'),'defaultValue':_0xe9df('0x5')},'description':{'type':Sequelize[_0xe9df('0x0')]}}; \ No newline at end of file +var _0x5197=['contact','lead','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x5570a6,_0x456794){var _0x21f0e8=function(_0x3c710f){while(--_0x3c710f){_0x5570a6['push'](_0x5570a6['shift']());}};_0x21f0e8(++_0x456794);}(_0x5197,0x145));var _0x7519=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x5197[_0x279d37];return _0x530173;};'use strict';var Sequelize=require(_0x7519('0x0'));module[_0x7519('0x1')]={'name':{'type':Sequelize[_0x7519('0x2')]},'moduleCreate':{'type':Sequelize[_0x7519('0x3')]('lead',_0x7519('0x4'),'nothing'),'defaultValue':_0x7519('0x5')},'moduleSearch':{'type':Sequelize[_0x7519('0x3')](_0x7519('0x6'),_0x7519('0x4'),_0x7519('0x5')),'defaultValue':_0x7519('0x6')},'description':{'type':Sequelize[_0x7519('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index a1eb643..cdeac3f 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 _0x2447=['findAll','rows','catch','show','include','find','body','params','getFields','findOne','ZohoField','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ZohoConfiguration','includeAll'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x2447,0xae));var _0x7244=function(_0x4e1510,_0x10bc70){_0x4e1510=_0x4e1510-0x0;var _0x410751=_0x2447[_0x4e1510];return _0x410751;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7244('0x0'));var jsonpatch=require(_0x7244('0x1'));var rp=require(_0x7244('0x2'));var moment=require(_0x7244('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7244('0x4'));var util=require(_0x7244('0x5'));var path=require(_0x7244('0x6'));var sox=require(_0x7244('0x7'));var csv=require(_0x7244('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7244('0x9'));var squel=require(_0x7244('0xa'));var crypto=require(_0x7244('0xb'));var jsforce=require(_0x7244('0xc'));var deskjs=require(_0x7244('0xd'));var toCsv=require(_0x7244('0x8'));var querystring=require(_0x7244('0xe'));var Papa=require(_0x7244('0xf'));var Redis=require(_0x7244('0x10'));var authService=require(_0x7244('0x11'));var qs=require(_0x7244('0x12'));var as=require(_0x7244('0x13'));var hardwareService=require(_0x7244('0x14'));var logger=require(_0x7244('0x15'))(_0x7244('0x16'));var utils=require(_0x7244('0x17'));var config=require(_0x7244('0x18'));var licenseUtil=require(_0x7244('0x19'));var db=require(_0x7244('0x1a'))['db'];function respondWithStatusCode(_0xb94daf,_0x46e6f3){_0x46e6f3=_0x46e6f3||0xcc;return function(_0x1cd622){if(_0x1cd622){return _0xb94daf[_0x7244('0x1b')](_0x46e6f3);}return _0xb94daf[_0x7244('0x1c')](_0x46e6f3)['end']();};}function respondWithResult(_0xefe92f,_0x381991){_0x381991=_0x381991||0xc8;return function(_0x254222){if(_0x254222){return _0xefe92f['status'](_0x381991)['json'](_0x254222);}};}function respondWithFilteredResult(_0x101960,_0x459f0a){return function(_0x5265da){if(_0x5265da){var _0x176929=typeof _0x459f0a['offset']===_0x7244('0x1d')&&typeof _0x459f0a[_0x7244('0x1e')]===_0x7244('0x1d');var _0x8c6aa6=_0x5265da[_0x7244('0x1f')];var _0x44e671=_0x176929?0x0:_0x459f0a[_0x7244('0x20')];var _0x560300=_0x176929?_0x5265da['count']:_0x459f0a[_0x7244('0x20')]+_0x459f0a[_0x7244('0x1e')];var _0x3c187d;if(_0x560300>=_0x8c6aa6){_0x560300=_0x8c6aa6;_0x3c187d=0xc8;}else{_0x3c187d=0xce;}_0x101960[_0x7244('0x1c')](_0x3c187d);return _0x101960['set'](_0x7244('0x21'),_0x44e671+'-'+_0x560300+'/'+_0x8c6aa6)['json'](_0x5265da);}return null;};}function patchUpdates(_0x152b71){return function(_0x746a62){try{jsonpatch[_0x7244('0x22')](_0x746a62,_0x152b71,!![]);}catch(_0x56ea9e){return BPromise[_0x7244('0x23')](_0x56ea9e);}return _0x746a62[_0x7244('0x24')]();};}function saveUpdates(_0x23f211,_0x4f5981){return function(_0x28ccab){if(_0x28ccab){return _0x28ccab[_0x7244('0x25')](_0x23f211)[_0x7244('0x26')](function(_0x2522aa){return _0x2522aa;});}return null;};}function removeEntity(_0x2853af,_0x54acec){return function(_0x12dba5){if(_0x12dba5){return _0x12dba5[_0x7244('0x27')]()[_0x7244('0x26')](function(){_0x2853af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x103950,_0x4171ad){return function(_0x491d3d){if(!_0x491d3d){_0x103950[_0x7244('0x1b')](0x194);}return _0x491d3d;};}function handleError(_0x49674d,_0x5ae756){_0x5ae756=_0x5ae756||0x1f4;return function(_0xf63d74){logger[_0x7244('0x28')](_0xf63d74[_0x7244('0x29')]);if(_0xf63d74[_0x7244('0x2a')]){delete _0xf63d74[_0x7244('0x2a')];}_0x49674d[_0x7244('0x1c')](_0x5ae756)[_0x7244('0x2b')](_0xf63d74);};}exports[_0x7244('0x2c')]=function(_0x26fd78,_0x3d7ab9){var _0xb169e3={},_0x2e4f45={},_0x528d61={'count':0x0,'rows':[]};var _0x36b064=_[_0x7244('0x2d')](db['ZohoConfiguration'][_0x7244('0x2e')],function(_0x266d02){return{'name':_0x266d02[_0x7244('0x2f')],'type':_0x266d02[_0x7244('0x30')][_0x7244('0x31')]};});_0x2e4f45[_0x7244('0x32')]=_['map'](_0x36b064,_0x7244('0x2a'));_0x2e4f45[_0x7244('0x33')]=_[_0x7244('0x34')](_0x26fd78[_0x7244('0x33')]);_0x2e4f45[_0x7244('0x35')]=_[_0x7244('0x36')](_0x2e4f45[_0x7244('0x32')],_0x2e4f45['query']);_0xb169e3[_0x7244('0x37')]=_[_0x7244('0x36')](_0x2e4f45[_0x7244('0x32')],qs[_0x7244('0x38')](_0x26fd78[_0x7244('0x33')][_0x7244('0x38')]));_0xb169e3[_0x7244('0x37')]=_0xb169e3[_0x7244('0x37')][_0x7244('0x39')]?_0xb169e3['attributes']:_0x2e4f45[_0x7244('0x32')];if(!_0x26fd78[_0x7244('0x33')][_0x7244('0x3a')](_0x7244('0x3b'))){_0xb169e3[_0x7244('0x1e')]=qs[_0x7244('0x1e')](_0x26fd78[_0x7244('0x33')][_0x7244('0x1e')]);_0xb169e3['offset']=qs[_0x7244('0x20')](_0x26fd78[_0x7244('0x33')][_0x7244('0x20')]);}_0xb169e3[_0x7244('0x3c')]=qs[_0x7244('0x3d')](_0x26fd78[_0x7244('0x33')]['sort']);_0xb169e3[_0x7244('0x3e')]=qs[_0x7244('0x35')](_[_0x7244('0x3f')](_0x26fd78[_0x7244('0x33')],_0x2e4f45[_0x7244('0x35')]),_0x36b064);if(_0x26fd78[_0x7244('0x33')][_0x7244('0x40')]){_0xb169e3[_0x7244('0x3e')]=_[_0x7244('0x41')](_0xb169e3[_0x7244('0x3e')],{'$or':_[_0x7244('0x2d')](_0x36b064,function(_0xf8976f){if(_0xf8976f[_0x7244('0x30')]!=='VIRTUAL'){var _0x1e426e={};_0x1e426e[_0xf8976f[_0x7244('0x2a')]]={'$like':'%'+_0x26fd78[_0x7244('0x33')][_0x7244('0x40')]+'%'};return _0x1e426e;}})});}_0xb169e3=_[_0x7244('0x41')]({},_0xb169e3,_0x26fd78[_0x7244('0x42')]);var _0x18d2ac={'where':_0xb169e3[_0x7244('0x3e')]};return db[_0x7244('0x43')][_0x7244('0x1f')](_0x18d2ac)[_0x7244('0x26')](function(_0x4d593d){_0x528d61[_0x7244('0x1f')]=_0x4d593d;if(_0x26fd78['query'][_0x7244('0x44')]){_0xb169e3['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x7244('0x45')](_0xb169e3);})['then'](function(_0x57b296){_0x528d61[_0x7244('0x46')]=_0x57b296;return _0x528d61;})[_0x7244('0x26')](respondWithFilteredResult(_0x3d7ab9,_0xb169e3))[_0x7244('0x47')](handleError(_0x3d7ab9,null));};exports[_0x7244('0x48')]=function(_0x14877c,_0x192d09){var _0xeab9e2={'raw':![],'where':{'id':_0x14877c['params']['id']}},_0xb868f8={};_0xb868f8[_0x7244('0x32')]=_[_0x7244('0x34')](db[_0x7244('0x43')][_0x7244('0x2e')]);_0xb868f8[_0x7244('0x33')]=_[_0x7244('0x34')](_0x14877c[_0x7244('0x33')]);_0xb868f8['filters']=_['intersection'](_0xb868f8[_0x7244('0x32')],_0xb868f8[_0x7244('0x33')]);_0xeab9e2[_0x7244('0x37')]=_[_0x7244('0x36')](_0xb868f8[_0x7244('0x32')],qs[_0x7244('0x38')](_0x14877c[_0x7244('0x33')][_0x7244('0x38')]));_0xeab9e2[_0x7244('0x37')]=_0xeab9e2['attributes'][_0x7244('0x39')]?_0xeab9e2['attributes']:_0xb868f8['model'];if(_0x14877c[_0x7244('0x33')][_0x7244('0x44')]){_0xeab9e2[_0x7244('0x49')]=[{'all':!![]}];}_0xeab9e2=_[_0x7244('0x41')]({},_0xeab9e2,_0x14877c[_0x7244('0x42')]);return db['ZohoConfiguration'][_0x7244('0x4a')](_0xeab9e2)['then'](handleEntityNotFound(_0x192d09,null))[_0x7244('0x26')](respondWithResult(_0x192d09,null))['catch'](handleError(_0x192d09,null));};exports['create']=function(_0x379eab,_0x3fa018){return db[_0x7244('0x43')]['create'](_0x379eab[_0x7244('0x4b')],{})[_0x7244('0x26')](respondWithResult(_0x3fa018,0xc9))[_0x7244('0x47')](handleError(_0x3fa018,null));};exports[_0x7244('0x25')]=function(_0x3aa6bf,_0x477ef2){if(_0x3aa6bf[_0x7244('0x4b')]['id']){delete _0x3aa6bf['body']['id'];}return db[_0x7244('0x43')][_0x7244('0x4a')]({'where':{'id':_0x3aa6bf[_0x7244('0x4c')]['id']}})[_0x7244('0x26')](handleEntityNotFound(_0x477ef2,null))[_0x7244('0x26')](saveUpdates(_0x3aa6bf[_0x7244('0x4b')],null))['then'](respondWithResult(_0x477ef2,null))[_0x7244('0x47')](handleError(_0x477ef2,null));};exports[_0x7244('0x27')]=function(_0x32fa7a,_0x7f7557){return db[_0x7244('0x43')][_0x7244('0x4a')]({'where':{'id':_0x32fa7a['params']['id']}})['then'](handleEntityNotFound(_0x7f7557,null))[_0x7244('0x26')](removeEntity(_0x7f7557,null))[_0x7244('0x47')](handleError(_0x7f7557,null));};exports[_0x7244('0x4d')]=function(_0x68ebcc,_0x57b3ee,_0x2a0f86){var _0x32b9da={};var _0x2f7bd5={};var _0x1c18e8;var _0x400694;return db[_0x7244('0x43')][_0x7244('0x4e')]({'where':{'id':_0x68ebcc[_0x7244('0x4c')]['id']}})[_0x7244('0x26')](handleEntityNotFound(_0x57b3ee,null))[_0x7244('0x26')](function(_0x2d4815){if(_0x2d4815){_0x1c18e8=_0x2d4815;_0x2f7bd5['model']=_['keys'](db[_0x7244('0x4f')]['rawAttributes']);_0x2f7bd5[_0x7244('0x33')]=_[_0x7244('0x34')](_0x68ebcc[_0x7244('0x33')]);_0x2f7bd5[_0x7244('0x35')]=_[_0x7244('0x36')](_0x2f7bd5[_0x7244('0x32')],_0x2f7bd5[_0x7244('0x33')]);_0x32b9da[_0x7244('0x37')]=_[_0x7244('0x36')](_0x2f7bd5['model'],qs['fields'](_0x68ebcc[_0x7244('0x33')]['fields']));_0x32b9da[_0x7244('0x37')]=_0x32b9da[_0x7244('0x37')][_0x7244('0x39')]?_0x32b9da[_0x7244('0x37')]:_0x2f7bd5[_0x7244('0x32')];_0x32b9da['order']=qs[_0x7244('0x3d')](_0x68ebcc[_0x7244('0x33')][_0x7244('0x3d')]);_0x32b9da[_0x7244('0x3e')]=qs['filters'](_[_0x7244('0x3f')](_0x68ebcc[_0x7244('0x33')],_0x2f7bd5[_0x7244('0x35')]));if(_0x68ebcc[_0x7244('0x33')]['filter']){_0x32b9da[_0x7244('0x3e')]=_[_0x7244('0x41')](_0x32b9da[_0x7244('0x3e')],{'$or':_[_0x7244('0x2d')](_0x32b9da[_0x7244('0x37')],function(_0x193f44){var _0x446f13={};_0x446f13[_0x193f44]={'$like':'%'+_0x68ebcc[_0x7244('0x33')][_0x7244('0x40')]+'%'};return _0x446f13;})});}_0x32b9da=_[_0x7244('0x41')]({},_0x32b9da,_0x68ebcc[_0x7244('0x42')]);return _0x1c18e8[_0x7244('0x4d')](_0x32b9da);}})['then'](function(_0x160460){if(_0x160460){_0x400694=_0x160460['length'];if(!_0x68ebcc[_0x7244('0x33')]['hasOwnProperty'](_0x7244('0x3b'))){_0x32b9da[_0x7244('0x1e')]=qs[_0x7244('0x1e')](_0x68ebcc[_0x7244('0x33')][_0x7244('0x1e')]);_0x32b9da[_0x7244('0x20')]=qs[_0x7244('0x20')](_0x68ebcc['query'][_0x7244('0x20')]);}return _0x1c18e8[_0x7244('0x4d')](_0x32b9da);}})['then'](function(_0x20b911){if(_0x20b911){return _0x20b911?{'count':_0x400694,'rows':_0x20b911}:null;}})['then'](respondWithResult(_0x57b3ee,null))[_0x7244('0x47')](handleError(_0x57b3ee,null));};exports['getSubjects']=function(_0x51a14a,_0x1aa893,_0x4bf56b){var _0x3d4903={};var _0x29bf88={};var _0x34dbfe;var _0x43e4d7;return db[_0x7244('0x43')][_0x7244('0x4e')]({'where':{'id':_0x51a14a[_0x7244('0x4c')]['id']}})[_0x7244('0x26')](handleEntityNotFound(_0x1aa893,null))[_0x7244('0x26')](function(_0x1d4440){if(_0x1d4440){_0x34dbfe=_0x1d4440;_0x29bf88['model']=_[_0x7244('0x34')](db['ZohoField'][_0x7244('0x2e')]);_0x29bf88[_0x7244('0x33')]=_['keys'](_0x51a14a[_0x7244('0x33')]);_0x29bf88[_0x7244('0x35')]=_[_0x7244('0x36')](_0x29bf88['model'],_0x29bf88[_0x7244('0x33')]);_0x3d4903[_0x7244('0x37')]=_[_0x7244('0x36')](_0x29bf88[_0x7244('0x32')],qs[_0x7244('0x38')](_0x51a14a['query'][_0x7244('0x38')]));_0x3d4903['attributes']=_0x3d4903[_0x7244('0x37')][_0x7244('0x39')]?_0x3d4903['attributes']:_0x29bf88['model'];_0x3d4903[_0x7244('0x3c')]=qs['sort'](_0x51a14a[_0x7244('0x33')][_0x7244('0x3d')]);_0x3d4903[_0x7244('0x3e')]=qs[_0x7244('0x35')](_[_0x7244('0x3f')](_0x51a14a[_0x7244('0x33')],_0x29bf88['filters']));if(_0x51a14a[_0x7244('0x33')][_0x7244('0x40')]){_0x3d4903['where']=_[_0x7244('0x41')](_0x3d4903[_0x7244('0x3e')],{'$or':_[_0x7244('0x2d')](_0x3d4903[_0x7244('0x37')],function(_0x2310b4){var _0x205201={};_0x205201[_0x2310b4]={'$like':'%'+_0x51a14a['query'][_0x7244('0x40')]+'%'};return _0x205201;})});}_0x3d4903=_[_0x7244('0x41')]({},_0x3d4903,_0x51a14a['options']);return _0x34dbfe['getSubjects'](_0x3d4903);}})[_0x7244('0x26')](function(_0x1e7572){if(_0x1e7572){_0x43e4d7=_0x1e7572[_0x7244('0x39')];if(!_0x51a14a[_0x7244('0x33')][_0x7244('0x3a')](_0x7244('0x3b'))){_0x3d4903[_0x7244('0x1e')]=qs['limit'](_0x51a14a[_0x7244('0x33')][_0x7244('0x1e')]);_0x3d4903[_0x7244('0x20')]=qs[_0x7244('0x20')](_0x51a14a[_0x7244('0x33')][_0x7244('0x20')]);}return _0x34dbfe['getSubjects'](_0x3d4903);}})['then'](function(_0x25769f){if(_0x25769f){return _0x25769f?{'count':_0x43e4d7,'rows':_0x25769f}:null;}})['then'](respondWithResult(_0x1aa893,null))[_0x7244('0x47')](handleError(_0x1aa893,null));};exports[_0x7244('0x50')]=function(_0x280ce9,_0x46266a,_0x3533d9){var _0x26c16a={};var _0x2cdb19={};var _0x3177a4;var _0x48066c;return db[_0x7244('0x43')][_0x7244('0x4e')]({'where':{'id':_0x280ce9['params']['id']}})[_0x7244('0x26')](handleEntityNotFound(_0x46266a,null))[_0x7244('0x26')](function(_0x2f2ffc){if(_0x2f2ffc){_0x3177a4=_0x2f2ffc;_0x2cdb19[_0x7244('0x32')]=_[_0x7244('0x34')](db['ZohoField'][_0x7244('0x2e')]);_0x2cdb19[_0x7244('0x33')]=_[_0x7244('0x34')](_0x280ce9[_0x7244('0x33')]);_0x2cdb19[_0x7244('0x35')]=_[_0x7244('0x36')](_0x2cdb19[_0x7244('0x32')],_0x2cdb19['query']);_0x26c16a[_0x7244('0x37')]=_['intersection'](_0x2cdb19[_0x7244('0x32')],qs[_0x7244('0x38')](_0x280ce9['query'][_0x7244('0x38')]));_0x26c16a['attributes']=_0x26c16a['attributes'][_0x7244('0x39')]?_0x26c16a[_0x7244('0x37')]:_0x2cdb19[_0x7244('0x32')];_0x26c16a[_0x7244('0x3c')]=qs[_0x7244('0x3d')](_0x280ce9[_0x7244('0x33')][_0x7244('0x3d')]);_0x26c16a['where']=qs[_0x7244('0x35')](_[_0x7244('0x3f')](_0x280ce9['query'],_0x2cdb19[_0x7244('0x35')]));if(_0x280ce9[_0x7244('0x33')][_0x7244('0x40')]){_0x26c16a[_0x7244('0x3e')]=_['merge'](_0x26c16a[_0x7244('0x3e')],{'$or':_[_0x7244('0x2d')](_0x26c16a[_0x7244('0x37')],function(_0x1ca01b){var _0x5b065f={};_0x5b065f[_0x1ca01b]={'$like':'%'+_0x280ce9['query']['filter']+'%'};return _0x5b065f;})});}_0x26c16a=_[_0x7244('0x41')]({},_0x26c16a,_0x280ce9['options']);return _0x3177a4[_0x7244('0x50')](_0x26c16a);}})[_0x7244('0x26')](function(_0x16a212){if(_0x16a212){_0x48066c=_0x16a212['length'];if(!_0x280ce9['query'][_0x7244('0x3a')](_0x7244('0x3b'))){_0x26c16a[_0x7244('0x1e')]=qs['limit'](_0x280ce9[_0x7244('0x33')][_0x7244('0x1e')]);_0x26c16a['offset']=qs[_0x7244('0x20')](_0x280ce9[_0x7244('0x33')][_0x7244('0x20')]);}return _0x3177a4[_0x7244('0x50')](_0x26c16a);}})[_0x7244('0x26')](function(_0x56e581){if(_0x56e581){return _0x56e581?{'count':_0x48066c,'rows':_0x56e581}:null;}})['then'](respondWithResult(_0x46266a,null))[_0x7244('0x47')](handleError(_0x46266a,null));}; \ No newline at end of file +var _0x036f=['key','query','intersection','model','attributes','fields','length','order','sort','filters','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','getFields','findOne','ZohoField','pick','nolimit','getSubjects','getDescriptions','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type'];(function(_0x4426b6,_0x253758){var _0xb0a2d9=function(_0x4187e5){while(--_0x4187e5){_0x4426b6['push'](_0x4426b6['shift']());}};_0xb0a2d9(++_0x253758);}(_0x036f,0x11b));var _0xf036=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0x036f[_0x4fa291];return _0x506d9b;};'use strict';var emlformat=require(_0xf036('0x0'));var rimraf=require(_0xf036('0x1'));var zipdir=require(_0xf036('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf036('0x3'));var moment=require('moment');var BPromise=require(_0xf036('0x4'));var Mustache=require(_0xf036('0x5'));var util=require('util');var path=require(_0xf036('0x6'));var sox=require(_0xf036('0x7'));var csv=require(_0xf036('0x8'));var ejs=require(_0xf036('0x9'));var fs=require('fs');var fs_extra=require(_0xf036('0xa'));var _=require(_0xf036('0xb'));var squel=require(_0xf036('0xc'));var crypto=require('crypto');var jsforce=require(_0xf036('0xd'));var deskjs=require(_0xf036('0xe'));var toCsv=require(_0xf036('0x8'));var querystring=require(_0xf036('0xf'));var Papa=require(_0xf036('0x10'));var Redis=require(_0xf036('0x11'));var authService=require(_0xf036('0x12'));var qs=require(_0xf036('0x13'));var as=require(_0xf036('0x14'));var hardwareService=require(_0xf036('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf036('0x16'));var config=require(_0xf036('0x17'));var licenseUtil=require(_0xf036('0x18'));var db=require(_0xf036('0x19'))['db'];function respondWithStatusCode(_0x12e6aa,_0x2f605d){_0x2f605d=_0x2f605d||0xcc;return function(_0x55fc04){if(_0x55fc04){return _0x12e6aa[_0xf036('0x1a')](_0x2f605d);}return _0x12e6aa[_0xf036('0x1b')](_0x2f605d)[_0xf036('0x1c')]();};}function respondWithResult(_0x451d7e,_0x93700d){_0x93700d=_0x93700d||0xc8;return function(_0x13bfff){if(_0x13bfff){return _0x451d7e['status'](_0x93700d)['json'](_0x13bfff);}};}function respondWithFilteredResult(_0x14184f,_0x308bc5){return function(_0x5d8dc1){if(_0x5d8dc1){var _0x22653b=typeof _0x308bc5['offset']===_0xf036('0x1d')&&typeof _0x308bc5[_0xf036('0x1e')]===_0xf036('0x1d');var _0x5598a7=_0x5d8dc1[_0xf036('0x1f')];var _0x5280e7=_0x22653b?0x0:_0x308bc5[_0xf036('0x20')];var _0x1a559c=_0x22653b?_0x5d8dc1['count']:_0x308bc5[_0xf036('0x20')]+_0x308bc5[_0xf036('0x1e')];var _0x167098;if(_0x1a559c>=_0x5598a7){_0x1a559c=_0x5598a7;_0x167098=0xc8;}else{_0x167098=0xce;}_0x14184f[_0xf036('0x1b')](_0x167098);return _0x14184f[_0xf036('0x21')]('Content-Range',_0x5280e7+'-'+_0x1a559c+'/'+_0x5598a7)[_0xf036('0x22')](_0x5d8dc1);}return null;};}function patchUpdates(_0x3eebb1){return function(_0x6f7bb3){try{jsonpatch[_0xf036('0x23')](_0x6f7bb3,_0x3eebb1,!![]);}catch(_0x46f843){return BPromise['reject'](_0x46f843);}return _0x6f7bb3[_0xf036('0x24')]();};}function saveUpdates(_0x1506a9,_0x5858f7){return function(_0x24165c){if(_0x24165c){return _0x24165c[_0xf036('0x25')](_0x1506a9)[_0xf036('0x26')](function(_0x503b23){return _0x503b23;});}return null;};}function removeEntity(_0x479e27,_0x3a920f){return function(_0x16247b){if(_0x16247b){return _0x16247b[_0xf036('0x27')]()[_0xf036('0x26')](function(){_0x479e27['status'](0xcc)[_0xf036('0x1c')]();});}};}function handleEntityNotFound(_0x27ff5f,_0x2ac925){return function(_0xef3a9c){if(!_0xef3a9c){_0x27ff5f[_0xf036('0x1a')](0x194);}return _0xef3a9c;};}function handleError(_0x576507,_0xbfa915){_0xbfa915=_0xbfa915||0x1f4;return function(_0x595f17){logger[_0xf036('0x28')](_0x595f17[_0xf036('0x29')]);if(_0x595f17[_0xf036('0x2a')]){delete _0x595f17[_0xf036('0x2a')];}_0x576507['status'](_0xbfa915)[_0xf036('0x2b')](_0x595f17);};}exports[_0xf036('0x2c')]=function(_0x2d9f39,_0x535ed9){var _0x12dd04={},_0x1d5e77={},_0xfa8fcf={'count':0x0,'rows':[]};var _0x1c8599=_[_0xf036('0x2d')](db[_0xf036('0x2e')][_0xf036('0x2f')],function(_0x216980){return{'name':_0x216980['fieldName'],'type':_0x216980[_0xf036('0x30')][_0xf036('0x31')]};});_0x1d5e77['model']=_[_0xf036('0x2d')](_0x1c8599,'name');_0x1d5e77[_0xf036('0x32')]=_['keys'](_0x2d9f39['query']);_0x1d5e77['filters']=_[_0xf036('0x33')](_0x1d5e77[_0xf036('0x34')],_0x1d5e77[_0xf036('0x32')]);_0x12dd04[_0xf036('0x35')]=_[_0xf036('0x33')](_0x1d5e77[_0xf036('0x34')],qs[_0xf036('0x36')](_0x2d9f39[_0xf036('0x32')][_0xf036('0x36')]));_0x12dd04[_0xf036('0x35')]=_0x12dd04[_0xf036('0x35')][_0xf036('0x37')]?_0x12dd04[_0xf036('0x35')]:_0x1d5e77[_0xf036('0x34')];if(!_0x2d9f39[_0xf036('0x32')]['hasOwnProperty']('nolimit')){_0x12dd04['limit']=qs[_0xf036('0x1e')](_0x2d9f39[_0xf036('0x32')][_0xf036('0x1e')]);_0x12dd04[_0xf036('0x20')]=qs[_0xf036('0x20')](_0x2d9f39[_0xf036('0x32')][_0xf036('0x20')]);}_0x12dd04[_0xf036('0x38')]=qs[_0xf036('0x39')](_0x2d9f39['query']['sort']);_0x12dd04['where']=qs[_0xf036('0x3a')](_['pick'](_0x2d9f39['query'],_0x1d5e77[_0xf036('0x3a')]),_0x1c8599);if(_0x2d9f39['query']['filter']){_0x12dd04['where']=_[_0xf036('0x3b')](_0x12dd04[_0xf036('0x3c')],{'$or':_[_0xf036('0x2d')](_0x1c8599,function(_0x1c3512){if(_0x1c3512[_0xf036('0x30')]!==_0xf036('0x3d')){var _0x3c821b={};_0x3c821b[_0x1c3512[_0xf036('0x2a')]]={'$like':'%'+_0x2d9f39[_0xf036('0x32')][_0xf036('0x3e')]+'%'};return _0x3c821b;}})});}_0x12dd04=_[_0xf036('0x3b')]({},_0x12dd04,_0x2d9f39['options']);var _0x32c350={'where':_0x12dd04[_0xf036('0x3c')]};return db['ZohoConfiguration'][_0xf036('0x1f')](_0x32c350)[_0xf036('0x26')](function(_0x39f374){_0xfa8fcf['count']=_0x39f374;if(_0x2d9f39['query'][_0xf036('0x3f')]){_0x12dd04[_0xf036('0x40')]=[{'all':!![]}];}return db[_0xf036('0x2e')][_0xf036('0x41')](_0x12dd04);})[_0xf036('0x26')](function(_0x19f2fa){_0xfa8fcf[_0xf036('0x42')]=_0x19f2fa;return _0xfa8fcf;})[_0xf036('0x26')](respondWithFilteredResult(_0x535ed9,_0x12dd04))[_0xf036('0x43')](handleError(_0x535ed9,null));};exports[_0xf036('0x44')]=function(_0x2426dc,_0x4e684d){var _0x3d6be6={'raw':![],'where':{'id':_0x2426dc[_0xf036('0x45')]['id']}},_0x265fcd={};_0x265fcd[_0xf036('0x34')]=_[_0xf036('0x46')](db['ZohoConfiguration']['rawAttributes']);_0x265fcd[_0xf036('0x32')]=_[_0xf036('0x46')](_0x2426dc[_0xf036('0x32')]);_0x265fcd['filters']=_[_0xf036('0x33')](_0x265fcd['model'],_0x265fcd[_0xf036('0x32')]);_0x3d6be6['attributes']=_['intersection'](_0x265fcd[_0xf036('0x34')],qs['fields'](_0x2426dc[_0xf036('0x32')][_0xf036('0x36')]));_0x3d6be6[_0xf036('0x35')]=_0x3d6be6['attributes'][_0xf036('0x37')]?_0x3d6be6['attributes']:_0x265fcd[_0xf036('0x34')];if(_0x2426dc[_0xf036('0x32')][_0xf036('0x3f')]){_0x3d6be6['include']=[{'all':!![]}];}_0x3d6be6=_['merge']({},_0x3d6be6,_0x2426dc[_0xf036('0x47')]);return db[_0xf036('0x2e')]['find'](_0x3d6be6)['then'](handleEntityNotFound(_0x4e684d,null))[_0xf036('0x26')](respondWithResult(_0x4e684d,null))[_0xf036('0x43')](handleError(_0x4e684d,null));};exports[_0xf036('0x48')]=function(_0x5bc98e,_0x10b94c){return db[_0xf036('0x2e')][_0xf036('0x48')](_0x5bc98e['body'],{})[_0xf036('0x26')](respondWithResult(_0x10b94c,0xc9))[_0xf036('0x43')](handleError(_0x10b94c,null));};exports[_0xf036('0x25')]=function(_0x272195,_0x1fc073){if(_0x272195['body']['id']){delete _0x272195[_0xf036('0x49')]['id'];}return db[_0xf036('0x2e')][_0xf036('0x4a')]({'where':{'id':_0x272195[_0xf036('0x45')]['id']}})[_0xf036('0x26')](handleEntityNotFound(_0x1fc073,null))[_0xf036('0x26')](saveUpdates(_0x272195[_0xf036('0x49')],null))[_0xf036('0x26')](respondWithResult(_0x1fc073,null))['catch'](handleError(_0x1fc073,null));};exports[_0xf036('0x27')]=function(_0x606277,_0x47c505){return db[_0xf036('0x2e')][_0xf036('0x4a')]({'where':{'id':_0x606277[_0xf036('0x45')]['id']}})[_0xf036('0x26')](handleEntityNotFound(_0x47c505,null))[_0xf036('0x26')](removeEntity(_0x47c505,null))[_0xf036('0x43')](handleError(_0x47c505,null));};exports[_0xf036('0x4b')]=function(_0x4441f3,_0x1af0a1,_0xcb69c5){var _0x5ad98f={};var _0x28a12f={};var _0x1fb27c;var _0xbc747f;return db[_0xf036('0x2e')][_0xf036('0x4c')]({'where':{'id':_0x4441f3[_0xf036('0x45')]['id']}})['then'](handleEntityNotFound(_0x1af0a1,null))[_0xf036('0x26')](function(_0x318875){if(_0x318875){_0x1fb27c=_0x318875;_0x28a12f['model']=_[_0xf036('0x46')](db[_0xf036('0x4d')][_0xf036('0x2f')]);_0x28a12f[_0xf036('0x32')]=_['keys'](_0x4441f3['query']);_0x28a12f[_0xf036('0x3a')]=_[_0xf036('0x33')](_0x28a12f['model'],_0x28a12f['query']);_0x5ad98f['attributes']=_[_0xf036('0x33')](_0x28a12f['model'],qs[_0xf036('0x36')](_0x4441f3[_0xf036('0x32')][_0xf036('0x36')]));_0x5ad98f[_0xf036('0x35')]=_0x5ad98f[_0xf036('0x35')]['length']?_0x5ad98f['attributes']:_0x28a12f['model'];_0x5ad98f[_0xf036('0x38')]=qs[_0xf036('0x39')](_0x4441f3['query'][_0xf036('0x39')]);_0x5ad98f[_0xf036('0x3c')]=qs[_0xf036('0x3a')](_[_0xf036('0x4e')](_0x4441f3[_0xf036('0x32')],_0x28a12f[_0xf036('0x3a')]));if(_0x4441f3[_0xf036('0x32')][_0xf036('0x3e')]){_0x5ad98f[_0xf036('0x3c')]=_[_0xf036('0x3b')](_0x5ad98f[_0xf036('0x3c')],{'$or':_['map'](_0x5ad98f['attributes'],function(_0x1d87c3){var _0x3c0e91={};_0x3c0e91[_0x1d87c3]={'$like':'%'+_0x4441f3[_0xf036('0x32')][_0xf036('0x3e')]+'%'};return _0x3c0e91;})});}_0x5ad98f=_[_0xf036('0x3b')]({},_0x5ad98f,_0x4441f3[_0xf036('0x47')]);return _0x1fb27c[_0xf036('0x4b')](_0x5ad98f);}})[_0xf036('0x26')](function(_0x1d9b32){if(_0x1d9b32){_0xbc747f=_0x1d9b32['length'];if(!_0x4441f3[_0xf036('0x32')]['hasOwnProperty'](_0xf036('0x4f'))){_0x5ad98f[_0xf036('0x1e')]=qs['limit'](_0x4441f3[_0xf036('0x32')]['limit']);_0x5ad98f['offset']=qs[_0xf036('0x20')](_0x4441f3[_0xf036('0x32')][_0xf036('0x20')]);}return _0x1fb27c[_0xf036('0x4b')](_0x5ad98f);}})[_0xf036('0x26')](function(_0x447e54){if(_0x447e54){return _0x447e54?{'count':_0xbc747f,'rows':_0x447e54}:null;}})[_0xf036('0x26')](respondWithResult(_0x1af0a1,null))[_0xf036('0x43')](handleError(_0x1af0a1,null));};exports[_0xf036('0x50')]=function(_0x1545a1,_0x14cdc1,_0x596e59){var _0x317d78={};var _0xd2b54d={};var _0x1b5fc8;var _0x8ee562;return db[_0xf036('0x2e')]['findOne']({'where':{'id':_0x1545a1[_0xf036('0x45')]['id']}})['then'](handleEntityNotFound(_0x14cdc1,null))['then'](function(_0x522aac){if(_0x522aac){_0x1b5fc8=_0x522aac;_0xd2b54d['model']=_['keys'](db['ZohoField'][_0xf036('0x2f')]);_0xd2b54d[_0xf036('0x32')]=_[_0xf036('0x46')](_0x1545a1[_0xf036('0x32')]);_0xd2b54d[_0xf036('0x3a')]=_[_0xf036('0x33')](_0xd2b54d[_0xf036('0x34')],_0xd2b54d['query']);_0x317d78[_0xf036('0x35')]=_[_0xf036('0x33')](_0xd2b54d['model'],qs['fields'](_0x1545a1[_0xf036('0x32')]['fields']));_0x317d78[_0xf036('0x35')]=_0x317d78['attributes'][_0xf036('0x37')]?_0x317d78[_0xf036('0x35')]:_0xd2b54d[_0xf036('0x34')];_0x317d78[_0xf036('0x38')]=qs[_0xf036('0x39')](_0x1545a1['query'][_0xf036('0x39')]);_0x317d78[_0xf036('0x3c')]=qs[_0xf036('0x3a')](_['pick'](_0x1545a1[_0xf036('0x32')],_0xd2b54d[_0xf036('0x3a')]));if(_0x1545a1[_0xf036('0x32')][_0xf036('0x3e')]){_0x317d78['where']=_[_0xf036('0x3b')](_0x317d78[_0xf036('0x3c')],{'$or':_['map'](_0x317d78[_0xf036('0x35')],function(_0x3710a2){var _0x4f5c37={};_0x4f5c37[_0x3710a2]={'$like':'%'+_0x1545a1[_0xf036('0x32')][_0xf036('0x3e')]+'%'};return _0x4f5c37;})});}_0x317d78=_[_0xf036('0x3b')]({},_0x317d78,_0x1545a1['options']);return _0x1b5fc8[_0xf036('0x50')](_0x317d78);}})['then'](function(_0x34a8b0){if(_0x34a8b0){_0x8ee562=_0x34a8b0[_0xf036('0x37')];if(!_0x1545a1['query']['hasOwnProperty'](_0xf036('0x4f'))){_0x317d78['limit']=qs['limit'](_0x1545a1[_0xf036('0x32')][_0xf036('0x1e')]);_0x317d78[_0xf036('0x20')]=qs[_0xf036('0x20')](_0x1545a1[_0xf036('0x32')]['offset']);}return _0x1b5fc8[_0xf036('0x50')](_0x317d78);}})[_0xf036('0x26')](function(_0x29fb91){if(_0x29fb91){return _0x29fb91?{'count':_0x8ee562,'rows':_0x29fb91}:null;}})[_0xf036('0x26')](respondWithResult(_0x14cdc1,null))[_0xf036('0x43')](handleError(_0x14cdc1,null));};exports[_0xf036('0x51')]=function(_0x1c4eea,_0x2b5075,_0x25204b){var _0x3ff88e={};var _0x1f5ba2={};var _0x45368a;var _0x184d90;return db['ZohoConfiguration'][_0xf036('0x4c')]({'where':{'id':_0x1c4eea[_0xf036('0x45')]['id']}})[_0xf036('0x26')](handleEntityNotFound(_0x2b5075,null))['then'](function(_0x3bd591){if(_0x3bd591){_0x45368a=_0x3bd591;_0x1f5ba2[_0xf036('0x34')]=_[_0xf036('0x46')](db['ZohoField']['rawAttributes']);_0x1f5ba2[_0xf036('0x32')]=_[_0xf036('0x46')](_0x1c4eea[_0xf036('0x32')]);_0x1f5ba2[_0xf036('0x3a')]=_[_0xf036('0x33')](_0x1f5ba2[_0xf036('0x34')],_0x1f5ba2['query']);_0x3ff88e['attributes']=_[_0xf036('0x33')](_0x1f5ba2[_0xf036('0x34')],qs[_0xf036('0x36')](_0x1c4eea['query'][_0xf036('0x36')]));_0x3ff88e[_0xf036('0x35')]=_0x3ff88e[_0xf036('0x35')][_0xf036('0x37')]?_0x3ff88e[_0xf036('0x35')]:_0x1f5ba2[_0xf036('0x34')];_0x3ff88e['order']=qs[_0xf036('0x39')](_0x1c4eea[_0xf036('0x32')]['sort']);_0x3ff88e[_0xf036('0x3c')]=qs['filters'](_[_0xf036('0x4e')](_0x1c4eea[_0xf036('0x32')],_0x1f5ba2['filters']));if(_0x1c4eea['query'][_0xf036('0x3e')]){_0x3ff88e[_0xf036('0x3c')]=_['merge'](_0x3ff88e[_0xf036('0x3c')],{'$or':_[_0xf036('0x2d')](_0x3ff88e['attributes'],function(_0x11e1ec){var _0x3a4ead={};_0x3a4ead[_0x11e1ec]={'$like':'%'+_0x1c4eea[_0xf036('0x32')][_0xf036('0x3e')]+'%'};return _0x3a4ead;})});}_0x3ff88e=_[_0xf036('0x3b')]({},_0x3ff88e,_0x1c4eea[_0xf036('0x47')]);return _0x45368a[_0xf036('0x51')](_0x3ff88e);}})[_0xf036('0x26')](function(_0x369cff){if(_0x369cff){_0x184d90=_0x369cff[_0xf036('0x37')];if(!_0x1c4eea[_0xf036('0x32')][_0xf036('0x52')](_0xf036('0x4f'))){_0x3ff88e['limit']=qs[_0xf036('0x1e')](_0x1c4eea[_0xf036('0x32')][_0xf036('0x1e')]);_0x3ff88e[_0xf036('0x20')]=qs[_0xf036('0x20')](_0x1c4eea['query'][_0xf036('0x20')]);}return _0x45368a['getDescriptions'](_0x3ff88e);}})[_0xf036('0x26')](function(_0xc89a73){if(_0xc89a73){return _0xc89a73?{'count':_0x184d90,'rows':_0xc89a73}:null;}})[_0xf036('0x26')](respondWithResult(_0x2b5075,null))[_0xf036('0x43')](handleError(_0x2b5075,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 453446c..9273ea5 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 _0x5e87=['./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util','moment','bluebird','rimraf','../../config/environment'];(function(_0x5c6cbe,_0x362e3f){var _0xd22fd1=function(_0x283d1a){while(--_0x283d1a){_0x5c6cbe['push'](_0x5c6cbe['shift']());}};_0xd22fd1(++_0x362e3f);}(_0x5e87,0x17d));var _0x75e8=function(_0x2a935d,_0x82dfea){_0x2a935d=_0x2a935d-0x0;var _0xc69ae0=_0x5e87[_0x2a935d];return _0xc69ae0;};'use strict';var _=require(_0x75e8('0x0'));var util=require(_0x75e8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75e8('0x2'));var BPromise=require(_0x75e8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x75e8('0x4'));var config=require(_0x75e8('0x5'));var attributes=require(_0x75e8('0x6'));module['exports']=function(_0x19e865,_0x544139){return _0x19e865['define'](_0x75e8('0x7'),attributes,{'tableName':_0x75e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb9d=['exports','define','int_zoho_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xfb9d,0xb7));var _0xdfb9=function(_0x2f0595,_0x35f7bd){_0x2f0595=_0x2f0595-0x0;var _0x400cff=_0xfb9d[_0x2f0595];return _0x400cff;};'use strict';var _=require(_0xdfb9('0x0'));var util=require('util');var logger=require(_0xdfb9('0x1'))('api');var moment=require(_0xdfb9('0x2'));var BPromise=require(_0xdfb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfb9('0x4'));var rimraf=require(_0xdfb9('0x5'));var config=require(_0xdfb9('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0xdfb9('0x7')]=function(_0xeaf73d,_0x438cf1){return _0xeaf73d[_0xdfb9('0x8')]('ZohoConfiguration',attributes,{'tableName':_0xdfb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index d3abede..c7a37ab 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 _0xdf9a=['request\x20sent','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','ZohoConfiguration,\x20%s,\x20%s','debug'];(function(_0x5365ad,_0x41ec9b){var _0x365519=function(_0x5f0cd2){while(--_0x5f0cd2){_0x5365ad['push'](_0x5365ad['shift']());}};_0x365519(++_0x41ec9b);}(_0xdf9a,0x19d));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xadf9('0x0'));var BPromise=require(_0xadf9('0x1'));var rs=require(_0xadf9('0x2'));var fs=require('fs');var Redis=require(_0xadf9('0x3'));var db=require(_0xadf9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xadf9('0x5'))('rpc');var config=require(_0xadf9('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xadf9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5693a3,_0x4d339b,_0x38d6b9){return new BPromise(function(_0x3ca0d7,_0x39e399){return client[_0xadf9('0x8')](_0x5693a3,_0x38d6b9)[_0xadf9('0x9')](function(_0x48f93e){logger['info'](_0xadf9('0xa'),_0x4d339b,'request\x20sent');logger[_0xadf9('0xb')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4d339b,_0xadf9('0xc'),JSON['stringify'](_0x48f93e));if(_0x48f93e[_0xadf9('0xd')]){if(_0x48f93e['error'][_0xadf9('0xe')]===0x1f4){logger[_0xadf9('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x4d339b,_0x48f93e[_0xadf9('0xd')][_0xadf9('0xf')]);return _0x39e399(_0x48f93e[_0xadf9('0xd')][_0xadf9('0xf')]);}logger[_0xadf9('0xd')](_0xadf9('0xa'),_0x4d339b,_0x48f93e[_0xadf9('0xd')]['message']);return _0x3ca0d7(_0x48f93e['error'][_0xadf9('0xf')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4d339b,'request\x20sent');_0x3ca0d7(_0x48f93e['result'][_0xadf9('0xf')]);}})[_0xadf9('0x10')](function(_0x4211fe){logger['error'](_0xadf9('0xa'),_0x4d339b,_0x4211fe);_0x39e399(_0x4211fe);});});} \ No newline at end of file +var _0x5793=['../../mysqldb','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x118ec9,_0xe74cde){var _0xd76db2=function(_0xf280c0){while(--_0xf280c0){_0x118ec9['push'](_0x118ec9['shift']());}};_0xd76db2(++_0xe74cde);}(_0x5793,0xc1));var _0x3579=function(_0x7b3e03,_0x1356a1){_0x7b3e03=_0x7b3e03-0x0;var _0x4ac24a=_0x5793[_0x7b3e03];return _0x4ac24a;};'use strict';var _=require(_0x3579('0x0'));var util=require(_0x3579('0x1'));var moment=require(_0x3579('0x2'));var BPromise=require('bluebird');var rs=require(_0x3579('0x3'));var fs=require('fs');var Redis=require(_0x3579('0x4'));var db=require(_0x3579('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3579('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3579('0x7')][_0x3579('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e1825,_0x3e9a5a,_0x3fedb5){return new BPromise(function(_0x5a511c,_0xfcd214){return client[_0x3579('0x9')](_0x2e1825,_0x3fedb5)[_0x3579('0xa')](function(_0x415a93){logger[_0x3579('0xb')](_0x3579('0xc'),_0x3e9a5a,_0x3579('0xd'));logger[_0x3579('0xe')](_0x3579('0xf'),_0x3e9a5a,_0x3579('0xd'),JSON[_0x3579('0x10')](_0x415a93));if(_0x415a93[_0x3579('0x11')]){if(_0x415a93[_0x3579('0x11')][_0x3579('0x12')]===0x1f4){logger[_0x3579('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x3e9a5a,_0x415a93[_0x3579('0x11')][_0x3579('0x13')]);return _0xfcd214(_0x415a93[_0x3579('0x11')][_0x3579('0x13')]);}logger[_0x3579('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x3e9a5a,_0x415a93[_0x3579('0x11')][_0x3579('0x13')]);return _0x5a511c(_0x415a93['error'][_0x3579('0x13')]);}else{logger['info'](_0x3579('0xc'),_0x3e9a5a,_0x3579('0xd'));_0x5a511c(_0x415a93[_0x3579('0x14')][_0x3579('0x13')]);}})[_0x3579('0x15')](function(_0xc0adc2){logger[_0x3579('0x11')](_0x3579('0xc'),_0x3e9a5a,_0xc0adc2);_0xfcd214(_0xc0adc2);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 49befeb..17d755e 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 _0x0224=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','exports','util'];(function(_0x9324c1,_0x2447eb){var _0x3f4706=function(_0xe0fc01){while(--_0xe0fc01){_0x9324c1['push'](_0x9324c1['shift']());}};_0x3f4706(++_0x2447eb);}(_0x0224,0x19d));var _0x4022=function(_0x509dad,_0x1f995f){_0x509dad=_0x509dad-0x0;var _0x21e122=_0x0224[_0x509dad];return _0x21e122;};'use strict';var multer=require('multer');var util=require(_0x4022('0x0'));var path=require(_0x4022('0x1'));var timeout=require(_0x4022('0x2'));var express=require(_0x4022('0x3'));var router=express[_0x4022('0x4')]();var fs_extra=require(_0x4022('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4022('0x6'));var config=require(_0x4022('0x7'));var controller=require(_0x4022('0x8'));router[_0x4022('0x9')]('/',auth[_0x4022('0xa')](),controller['index']);router[_0x4022('0x9')](_0x4022('0xb'),auth[_0x4022('0xa')](),controller[_0x4022('0xc')]);router[_0x4022('0xd')]('/',auth[_0x4022('0xa')](),controller[_0x4022('0xe')]);router[_0x4022('0xf')](_0x4022('0xb'),auth[_0x4022('0xa')](),controller['update']);router[_0x4022('0x10')](_0x4022('0xb'),auth[_0x4022('0xa')](),controller['destroy']);module[_0x4022('0x11')]=router; \ No newline at end of file +var _0x9626=['put','destroy','exports','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','create'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9626,0xf1));var _0x6962=function(_0x117248,_0x43ed17){_0x117248=_0x117248-0x0;var _0x3e0364=_0x9626[_0x117248];return _0x3e0364;};'use strict';var multer=require('multer');var util=require(_0x6962('0x0'));var path=require('path');var timeout=require(_0x6962('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6962('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x6962('0x3'));var config=require(_0x6962('0x4'));var controller=require(_0x6962('0x5'));router['get']('/',auth[_0x6962('0x6')](),controller[_0x6962('0x7')]);router[_0x6962('0x8')](_0x6962('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6962('0xa')]);router[_0x6962('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6962('0x6')](),controller[_0x6962('0xc')]);module[_0x6962('0xd')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7497a01..9eddc9f 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 _0x851d=['customVariable','exports','ENUM','variable','string','STRING'];(function(_0xdea37f,_0xb7343f){var _0x3870d3=function(_0x16d272){while(--_0x16d272){_0xdea37f['push'](_0xdea37f['shift']());}};_0x3870d3(++_0xb7343f);}(_0x851d,0x15d));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd851('0x0')]={'type':{'type':Sequelize[_0xd851('0x1')]('string',_0xd851('0x2'),'customVariable','keyValue','picklist'),'defaultValue':_0xd851('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd851('0x4')]},'keyType':{'type':Sequelize[_0xd851('0x1')](_0xd851('0x3'),'variable',_0xd851('0x5'))},'keyContent':{'type':Sequelize[_0xd851('0x4')]},'idField':{'type':Sequelize[_0xd851('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd851('0x4')]}}; \ No newline at end of file +var _0x8d5e=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0xf8973d,_0x56a803){var _0x1c46bc=function(_0x455f2d){while(--_0x455f2d){_0xf8973d['push'](_0xf8973d['shift']());}};_0x1c46bc(++_0x56a803);}(_0x8d5e,0x7b));var _0xe8d5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8d5e[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xe8d5('0x0'));module['exports']={'type':{'type':Sequelize[_0xe8d5('0x1')](_0xe8d5('0x2'),_0xe8d5('0x3'),_0xe8d5('0x4'),'keyValue',_0xe8d5('0x5')),'defaultValue':_0xe8d5('0x2')},'content':{'type':Sequelize[_0xe8d5('0x6')]},'key':{'type':Sequelize[_0xe8d5('0x6')]},'keyType':{'type':Sequelize[_0xe8d5('0x1')](_0xe8d5('0x2'),_0xe8d5('0x3'),_0xe8d5('0x4'))},'keyContent':{'type':Sequelize[_0xe8d5('0x6')]},'idField':{'type':Sequelize[_0xe8d5('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe8d5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe8d5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 48143a2..b7f75cf 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 _0x87cb=['squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','sendStatus','stack','send','index','ZohoField','rawAttributes','type','map','name','query','keys','filters','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','fields','length','includeAll','find','create','body','eml-format','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x598c6a,_0x37b849){var _0x1a74ed=function(_0x141ac6){while(--_0x141ac6){_0x598c6a['push'](_0x598c6a['shift']());}};_0x1a74ed(++_0x37b849);}(_0x87cb,0xc3));var _0xb87c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x87cb[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0xb87c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb87c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb87c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb87c('0x3'));var path=require(_0xb87c('0x4'));var sox=require(_0xb87c('0x5'));var csv=require(_0xb87c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb87c('0x7'));var _=require(_0xb87c('0x8'));var squel=require(_0xb87c('0x9'));var crypto=require(_0xb87c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb87c('0xb'));var Papa=require(_0xb87c('0xc'));var Redis=require('ioredis');var authService=require(_0xb87c('0xd'));var qs=require(_0xb87c('0xe'));var as=require(_0xb87c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb87c('0x10'))('api');var utils=require(_0xb87c('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb87c('0x12'))['db'];function respondWithStatusCode(_0x5c381b,_0x4b5899){_0x4b5899=_0x4b5899||0xcc;return function(_0x4a9196){if(_0x4a9196){return _0x5c381b['sendStatus'](_0x4b5899);}return _0x5c381b[_0xb87c('0x13')](_0x4b5899)[_0xb87c('0x14')]();};}function respondWithResult(_0x1ec4f2,_0x143f7c){_0x143f7c=_0x143f7c||0xc8;return function(_0x465adf){if(_0x465adf){return _0x1ec4f2[_0xb87c('0x13')](_0x143f7c)[_0xb87c('0x15')](_0x465adf);}};}function respondWithFilteredResult(_0x35b906,_0x266c90){return function(_0x2932fe){if(_0x2932fe){var _0x589e73=typeof _0x266c90[_0xb87c('0x16')]===_0xb87c('0x17')&&typeof _0x266c90[_0xb87c('0x18')]===_0xb87c('0x17');var _0x3f3aad=_0x2932fe[_0xb87c('0x19')];var _0x2b35f3=_0x589e73?0x0:_0x266c90[_0xb87c('0x16')];var _0x449165=_0x589e73?_0x2932fe[_0xb87c('0x19')]:_0x266c90[_0xb87c('0x16')]+_0x266c90[_0xb87c('0x18')];var _0x5b7b84;if(_0x449165>=_0x3f3aad){_0x449165=_0x3f3aad;_0x5b7b84=0xc8;}else{_0x5b7b84=0xce;}_0x35b906[_0xb87c('0x13')](_0x5b7b84);return _0x35b906[_0xb87c('0x1a')](_0xb87c('0x1b'),_0x2b35f3+'-'+_0x449165+'/'+_0x3f3aad)[_0xb87c('0x15')](_0x2932fe);}return null;};}function patchUpdates(_0x7e15a){return function(_0xcda8f1){try{jsonpatch['apply'](_0xcda8f1,_0x7e15a,!![]);}catch(_0x278a79){return BPromise[_0xb87c('0x1c')](_0x278a79);}return _0xcda8f1['save']();};}function saveUpdates(_0x5bb081,_0x39c639){return function(_0x36bafa){if(_0x36bafa){return _0x36bafa[_0xb87c('0x1d')](_0x5bb081)[_0xb87c('0x1e')](function(_0x479e02){return _0x479e02;});}return null;};}function removeEntity(_0x2340b7,_0x5a0996){return function(_0x42d677){if(_0x42d677){return _0x42d677[_0xb87c('0x1f')]()[_0xb87c('0x1e')](function(){_0x2340b7[_0xb87c('0x13')](0xcc)[_0xb87c('0x14')]();});}};}function handleEntityNotFound(_0x294d43,_0x4741f3){return function(_0x31846b){if(!_0x31846b){_0x294d43[_0xb87c('0x20')](0x194);}return _0x31846b;};}function handleError(_0x46faec,_0x2b95b9){_0x2b95b9=_0x2b95b9||0x1f4;return function(_0x1920c3){logger['error'](_0x1920c3[_0xb87c('0x21')]);if(_0x1920c3['name']){delete _0x1920c3['name'];}_0x46faec[_0xb87c('0x13')](_0x2b95b9)[_0xb87c('0x22')](_0x1920c3);};}exports[_0xb87c('0x23')]=function(_0x37fa05,_0x539816){var _0x5e9ee9={},_0x1bfe73={},_0x5eade0={'count':0x0,'rows':[]};var _0x56c20e=_['map'](db[_0xb87c('0x24')][_0xb87c('0x25')],function(_0x16bb8f){return{'name':_0x16bb8f['fieldName'],'type':_0x16bb8f[_0xb87c('0x26')]['key']};});_0x1bfe73['model']=_[_0xb87c('0x27')](_0x56c20e,_0xb87c('0x28'));_0x1bfe73[_0xb87c('0x29')]=_[_0xb87c('0x2a')](_0x37fa05[_0xb87c('0x29')]);_0x1bfe73[_0xb87c('0x2b')]=_[_0xb87c('0x2c')](_0x1bfe73['model'],_0x1bfe73['query']);_0x5e9ee9[_0xb87c('0x2d')]=_['intersection'](_0x1bfe73[_0xb87c('0x2e')],qs['fields'](_0x37fa05[_0xb87c('0x29')]['fields']));_0x5e9ee9['attributes']=_0x5e9ee9[_0xb87c('0x2d')]['length']?_0x5e9ee9['attributes']:_0x1bfe73['model'];if(!_0x37fa05[_0xb87c('0x29')][_0xb87c('0x2f')](_0xb87c('0x30'))){_0x5e9ee9[_0xb87c('0x18')]=qs[_0xb87c('0x18')](_0x37fa05[_0xb87c('0x29')]['limit']);_0x5e9ee9[_0xb87c('0x16')]=qs[_0xb87c('0x16')](_0x37fa05[_0xb87c('0x29')]['offset']);}_0x5e9ee9[_0xb87c('0x31')]=qs[_0xb87c('0x32')](_0x37fa05[_0xb87c('0x29')][_0xb87c('0x32')]);_0x5e9ee9['where']=qs[_0xb87c('0x2b')](_[_0xb87c('0x33')](_0x37fa05[_0xb87c('0x29')],_0x1bfe73['filters']),_0x56c20e);if(_0x37fa05[_0xb87c('0x29')][_0xb87c('0x34')]){_0x5e9ee9[_0xb87c('0x35')]=_[_0xb87c('0x36')](_0x5e9ee9['where'],{'$or':_[_0xb87c('0x27')](_0x56c20e,function(_0x5c14ad){if(_0x5c14ad['type']!==_0xb87c('0x37')){var _0xb20d40={};_0xb20d40[_0x5c14ad[_0xb87c('0x28')]]={'$like':'%'+_0x37fa05[_0xb87c('0x29')][_0xb87c('0x34')]+'%'};return _0xb20d40;}})});}_0x5e9ee9=_[_0xb87c('0x36')]({},_0x5e9ee9,_0x37fa05['options']);var _0xd506b9={'where':_0x5e9ee9[_0xb87c('0x35')]};return db['ZohoField'][_0xb87c('0x19')](_0xd506b9)[_0xb87c('0x1e')](function(_0x1fd4f8){_0x5eade0[_0xb87c('0x19')]=_0x1fd4f8;if(_0x37fa05[_0xb87c('0x29')]['includeAll']){_0x5e9ee9[_0xb87c('0x38')]=[{'all':!![]}];}return db[_0xb87c('0x24')][_0xb87c('0x39')](_0x5e9ee9);})['then'](function(_0x44f757){_0x5eade0[_0xb87c('0x3a')]=_0x44f757;return _0x5eade0;})[_0xb87c('0x1e')](respondWithFilteredResult(_0x539816,_0x5e9ee9))[_0xb87c('0x3b')](handleError(_0x539816,null));};exports[_0xb87c('0x3c')]=function(_0x3bac1b,_0x296689){var _0x5879cb={'raw':!![],'where':{'id':_0x3bac1b[_0xb87c('0x3d')]['id']}},_0x17a269={};_0x17a269[_0xb87c('0x2e')]=_[_0xb87c('0x2a')](db['ZohoField'][_0xb87c('0x25')]);_0x17a269[_0xb87c('0x29')]=_[_0xb87c('0x2a')](_0x3bac1b[_0xb87c('0x29')]);_0x17a269[_0xb87c('0x2b')]=_[_0xb87c('0x2c')](_0x17a269[_0xb87c('0x2e')],_0x17a269[_0xb87c('0x29')]);_0x5879cb['attributes']=_['intersection'](_0x17a269[_0xb87c('0x2e')],qs[_0xb87c('0x3e')](_0x3bac1b[_0xb87c('0x29')][_0xb87c('0x3e')]));_0x5879cb[_0xb87c('0x2d')]=_0x5879cb[_0xb87c('0x2d')][_0xb87c('0x3f')]?_0x5879cb[_0xb87c('0x2d')]:_0x17a269[_0xb87c('0x2e')];if(_0x3bac1b[_0xb87c('0x29')][_0xb87c('0x40')]){_0x5879cb['include']=[{'all':!![]}];}_0x5879cb=_[_0xb87c('0x36')]({},_0x5879cb,_0x3bac1b['options']);return db['ZohoField'][_0xb87c('0x41')](_0x5879cb)[_0xb87c('0x1e')](handleEntityNotFound(_0x296689,null))[_0xb87c('0x1e')](respondWithResult(_0x296689,null))['catch'](handleError(_0x296689,null));};exports[_0xb87c('0x42')]=function(_0x160178,_0x1ba0ed){return db[_0xb87c('0x24')]['create'](_0x160178['body'],{})[_0xb87c('0x1e')](respondWithResult(_0x1ba0ed,0xc9))[_0xb87c('0x3b')](handleError(_0x1ba0ed,null));};exports[_0xb87c('0x1d')]=function(_0x27a919,_0x125bfa){if(_0x27a919[_0xb87c('0x43')]['id']){delete _0x27a919[_0xb87c('0x43')]['id'];}return db[_0xb87c('0x24')][_0xb87c('0x41')]({'where':{'id':_0x27a919[_0xb87c('0x3d')]['id']}})[_0xb87c('0x1e')](handleEntityNotFound(_0x125bfa,null))[_0xb87c('0x1e')](saveUpdates(_0x27a919[_0xb87c('0x43')],null))[_0xb87c('0x1e')](respondWithResult(_0x125bfa,null))[_0xb87c('0x3b')](handleError(_0x125bfa,null));};exports['destroy']=function(_0x483dcd,_0xa5eb77){return db['ZohoField'][_0xb87c('0x41')]({'where':{'id':_0x483dcd['params']['id']}})[_0xb87c('0x1e')](handleEntityNotFound(_0xa5eb77,null))[_0xb87c('0x1e')](removeEntity(_0xa5eb77,null))[_0xb87c('0x3b')](handleError(_0xa5eb77,null));}; \ No newline at end of file +var _0x1ed7=['json','offset','undefined','count','limit','set','apply','save','update','destroy','then','error','name','index','ZohoField','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2c047f,_0x59ccd1){var _0x5bfdf2=function(_0x4015e3){while(--_0x4015e3){_0x2c047f['push'](_0x2c047f['shift']());}};_0x5bfdf2(++_0x59ccd1);}(_0x1ed7,0x6e));var _0x71ed=function(_0x58775a,_0xec771f){_0x58775a=_0x58775a-0x0;var _0x5626f8=_0x1ed7[_0x58775a];return _0x5626f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x71ed('0x0'));var rp=require(_0x71ed('0x1'));var moment=require(_0x71ed('0x2'));var BPromise=require(_0x71ed('0x3'));var Mustache=require(_0x71ed('0x4'));var util=require('util');var path=require(_0x71ed('0x5'));var sox=require(_0x71ed('0x6'));var csv=require(_0x71ed('0x7'));var ejs=require(_0x71ed('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x71ed('0x9'));var crypto=require(_0x71ed('0xa'));var jsforce=require(_0x71ed('0xb'));var deskjs=require(_0x71ed('0xc'));var toCsv=require(_0x71ed('0x7'));var querystring=require(_0x71ed('0xd'));var Papa=require('papaparse');var Redis=require(_0x71ed('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x71ed('0xf'));var as=require(_0x71ed('0x10'));var hardwareService=require(_0x71ed('0x11'));var logger=require(_0x71ed('0x12'))(_0x71ed('0x13'));var utils=require(_0x71ed('0x14'));var config=require(_0x71ed('0x15'));var licenseUtil=require(_0x71ed('0x16'));var db=require(_0x71ed('0x17'))['db'];function respondWithStatusCode(_0x5f26e3,_0x363084){_0x363084=_0x363084||0xcc;return function(_0x5b40e8){if(_0x5b40e8){return _0x5f26e3[_0x71ed('0x18')](_0x363084);}return _0x5f26e3[_0x71ed('0x19')](_0x363084)['end']();};}function respondWithResult(_0x40557e,_0x16bc2c){_0x16bc2c=_0x16bc2c||0xc8;return function(_0x53d5e0){if(_0x53d5e0){return _0x40557e['status'](_0x16bc2c)[_0x71ed('0x1a')](_0x53d5e0);}};}function respondWithFilteredResult(_0xe01160,_0x26595e){return function(_0x43eb51){if(_0x43eb51){var _0x4b9b72=typeof _0x26595e[_0x71ed('0x1b')]===_0x71ed('0x1c')&&typeof _0x26595e['limit']===_0x71ed('0x1c');var _0x1c0585=_0x43eb51['count'];var _0x4a9f42=_0x4b9b72?0x0:_0x26595e['offset'];var _0x1ce561=_0x4b9b72?_0x43eb51[_0x71ed('0x1d')]:_0x26595e['offset']+_0x26595e[_0x71ed('0x1e')];var _0x255776;if(_0x1ce561>=_0x1c0585){_0x1ce561=_0x1c0585;_0x255776=0xc8;}else{_0x255776=0xce;}_0xe01160[_0x71ed('0x19')](_0x255776);return _0xe01160[_0x71ed('0x1f')]('Content-Range',_0x4a9f42+'-'+_0x1ce561+'/'+_0x1c0585)[_0x71ed('0x1a')](_0x43eb51);}return null;};}function patchUpdates(_0x500c40){return function(_0x24edf7){try{jsonpatch[_0x71ed('0x20')](_0x24edf7,_0x500c40,!![]);}catch(_0x5a41e5){return BPromise['reject'](_0x5a41e5);}return _0x24edf7[_0x71ed('0x21')]();};}function saveUpdates(_0x3f4fac,_0x134e37){return function(_0x5a1c85){if(_0x5a1c85){return _0x5a1c85[_0x71ed('0x22')](_0x3f4fac)['then'](function(_0x3b9775){return _0x3b9775;});}return null;};}function removeEntity(_0x243da8,_0x5a953e){return function(_0x22cfbb){if(_0x22cfbb){return _0x22cfbb[_0x71ed('0x23')]()[_0x71ed('0x24')](function(){_0x243da8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb01ddd,_0x125065){return function(_0x1472ac){if(!_0x1472ac){_0xb01ddd[_0x71ed('0x18')](0x194);}return _0x1472ac;};}function handleError(_0x4afd64,_0x2a72c6){_0x2a72c6=_0x2a72c6||0x1f4;return function(_0x57b5b3){logger[_0x71ed('0x25')](_0x57b5b3['stack']);if(_0x57b5b3[_0x71ed('0x26')]){delete _0x57b5b3[_0x71ed('0x26')];}_0x4afd64['status'](_0x2a72c6)['send'](_0x57b5b3);};}exports[_0x71ed('0x27')]=function(_0xff59b8,_0x3223d7){var _0x22acb4={},_0x4fb283={},_0x503e00={'count':0x0,'rows':[]};var _0x36ccba=_['map'](db[_0x71ed('0x28')]['rawAttributes'],function(_0x36b7c3){return{'name':_0x36b7c3[_0x71ed('0x29')],'type':_0x36b7c3[_0x71ed('0x2a')][_0x71ed('0x2b')]};});_0x4fb283['model']=_[_0x71ed('0x2c')](_0x36ccba,_0x71ed('0x26'));_0x4fb283['query']=_[_0x71ed('0x2d')](_0xff59b8[_0x71ed('0x2e')]);_0x4fb283[_0x71ed('0x2f')]=_[_0x71ed('0x30')](_0x4fb283[_0x71ed('0x31')],_0x4fb283[_0x71ed('0x2e')]);_0x22acb4[_0x71ed('0x32')]=_[_0x71ed('0x30')](_0x4fb283['model'],qs[_0x71ed('0x33')](_0xff59b8[_0x71ed('0x2e')][_0x71ed('0x33')]));_0x22acb4['attributes']=_0x22acb4[_0x71ed('0x32')][_0x71ed('0x34')]?_0x22acb4[_0x71ed('0x32')]:_0x4fb283['model'];if(!_0xff59b8[_0x71ed('0x2e')]['hasOwnProperty']('nolimit')){_0x22acb4[_0x71ed('0x1e')]=qs[_0x71ed('0x1e')](_0xff59b8[_0x71ed('0x2e')]['limit']);_0x22acb4[_0x71ed('0x1b')]=qs[_0x71ed('0x1b')](_0xff59b8[_0x71ed('0x2e')][_0x71ed('0x1b')]);}_0x22acb4['order']=qs[_0x71ed('0x35')](_0xff59b8[_0x71ed('0x2e')][_0x71ed('0x35')]);_0x22acb4[_0x71ed('0x36')]=qs['filters'](_['pick'](_0xff59b8['query'],_0x4fb283[_0x71ed('0x2f')]),_0x36ccba);if(_0xff59b8[_0x71ed('0x2e')][_0x71ed('0x37')]){_0x22acb4[_0x71ed('0x36')]=_[_0x71ed('0x38')](_0x22acb4[_0x71ed('0x36')],{'$or':_[_0x71ed('0x2c')](_0x36ccba,function(_0x530d20){if(_0x530d20['type']!==_0x71ed('0x39')){var _0x301fde={};_0x301fde[_0x530d20[_0x71ed('0x26')]]={'$like':'%'+_0xff59b8[_0x71ed('0x2e')][_0x71ed('0x37')]+'%'};return _0x301fde;}})});}_0x22acb4=_['merge']({},_0x22acb4,_0xff59b8[_0x71ed('0x3a')]);var _0x404383={'where':_0x22acb4['where']};return db[_0x71ed('0x28')][_0x71ed('0x1d')](_0x404383)[_0x71ed('0x24')](function(_0x1387be){_0x503e00[_0x71ed('0x1d')]=_0x1387be;if(_0xff59b8[_0x71ed('0x2e')][_0x71ed('0x3b')]){_0x22acb4[_0x71ed('0x3c')]=[{'all':!![]}];}return db[_0x71ed('0x28')][_0x71ed('0x3d')](_0x22acb4);})['then'](function(_0x17d0dc){_0x503e00['rows']=_0x17d0dc;return _0x503e00;})[_0x71ed('0x24')](respondWithFilteredResult(_0x3223d7,_0x22acb4))[_0x71ed('0x3e')](handleError(_0x3223d7,null));};exports[_0x71ed('0x3f')]=function(_0x530645,_0x18d389){var _0x2fb2e1={'raw':!![],'where':{'id':_0x530645[_0x71ed('0x40')]['id']}},_0x5a3ae3={};_0x5a3ae3[_0x71ed('0x31')]=_['keys'](db[_0x71ed('0x28')][_0x71ed('0x41')]);_0x5a3ae3['query']=_[_0x71ed('0x2d')](_0x530645[_0x71ed('0x2e')]);_0x5a3ae3['filters']=_[_0x71ed('0x30')](_0x5a3ae3['model'],_0x5a3ae3['query']);_0x2fb2e1['attributes']=_[_0x71ed('0x30')](_0x5a3ae3[_0x71ed('0x31')],qs[_0x71ed('0x33')](_0x530645['query'][_0x71ed('0x33')]));_0x2fb2e1[_0x71ed('0x32')]=_0x2fb2e1[_0x71ed('0x32')][_0x71ed('0x34')]?_0x2fb2e1[_0x71ed('0x32')]:_0x5a3ae3[_0x71ed('0x31')];if(_0x530645[_0x71ed('0x2e')]['includeAll']){_0x2fb2e1[_0x71ed('0x3c')]=[{'all':!![]}];}_0x2fb2e1=_[_0x71ed('0x38')]({},_0x2fb2e1,_0x530645[_0x71ed('0x3a')]);return db['ZohoField'][_0x71ed('0x42')](_0x2fb2e1)[_0x71ed('0x24')](handleEntityNotFound(_0x18d389,null))['then'](respondWithResult(_0x18d389,null))[_0x71ed('0x3e')](handleError(_0x18d389,null));};exports['create']=function(_0x3fefb7,_0x56f995){return db[_0x71ed('0x28')]['create'](_0x3fefb7[_0x71ed('0x43')],{})[_0x71ed('0x24')](respondWithResult(_0x56f995,0xc9))['catch'](handleError(_0x56f995,null));};exports['update']=function(_0x2307ac,_0x3d55a3){if(_0x2307ac[_0x71ed('0x43')]['id']){delete _0x2307ac[_0x71ed('0x43')]['id'];}return db[_0x71ed('0x28')][_0x71ed('0x42')]({'where':{'id':_0x2307ac[_0x71ed('0x40')]['id']}})[_0x71ed('0x24')](handleEntityNotFound(_0x3d55a3,null))[_0x71ed('0x24')](saveUpdates(_0x2307ac['body'],null))[_0x71ed('0x24')](respondWithResult(_0x3d55a3,null))[_0x71ed('0x3e')](handleError(_0x3d55a3,null));};exports['destroy']=function(_0x93e7df,_0x171914){return db[_0x71ed('0x28')][_0x71ed('0x42')]({'where':{'id':_0x93e7df['params']['id']}})[_0x71ed('0x24')](handleEntityNotFound(_0x171914,null))['then'](removeEntity(_0x171914,null))['catch'](handleError(_0x171914,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 116186b..0d94e1a 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 _0x4819=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x4819,0xcd));var _0x9481=function(_0x467ed7,_0x5f3c23){_0x467ed7=_0x467ed7-0x0;var _0x4572d2=_0x4819[_0x467ed7];return _0x4572d2;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xd'),_0x9481('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5464=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x3fdd2a,_0x2e6d7a){var _0xb37957=function(_0x270d6e){while(--_0x270d6e){_0x3fdd2a['push'](_0x3fdd2a['shift']());}};_0xb37957(++_0x2e6d7a);}(_0x5464,0x15d));var _0x4546=function(_0x161ed4,_0x4633ee){_0x161ed4=_0x161ed4-0x0;var _0x4b8fbd=_0x5464[_0x161ed4];return _0x4b8fbd;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));module[_0x4546('0x8')]=function(_0x54228a,_0x57391f){return _0x54228a['define'](_0x4546('0x9'),attributes,{'tableName':_0x4546('0xa'),'paranoid':![],'indexes':[{'name':_0x4546('0xb'),'fields':[_0x4546('0xc'),_0x4546('0xd')],'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 3fd0b61..55cbea1 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 _0x29a1=['ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s'];(function(_0x49d40d,_0x30e0ea){var _0x5ec463=function(_0x11bab1){while(--_0x11bab1){_0x49d40d['push'](_0x49d40d['shift']());}};_0x5ec463(++_0x30e0ea);}(_0x29a1,0xba));var _0x129a=function(_0xf7eb02,_0x2c70b9){_0xf7eb02=_0xf7eb02-0x0;var _0x2594ea=_0x29a1[_0xf7eb02];return _0x2594ea;};'use strict';var _=require(_0x129a('0x0'));var util=require(_0x129a('0x1'));var moment=require('moment');var BPromise=require(_0x129a('0x2'));var rs=require(_0x129a('0x3'));var fs=require('fs');var Redis=require(_0x129a('0x4'));var db=require(_0x129a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x129a('0x6'));var config=require('../../config/environment');var jayson=require(_0x129a('0x7'));var client=jayson['client'][_0x129a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x287e4d,_0xd34f6c,_0x5b465e){return new BPromise(function(_0x37171e,_0x1741fa){return client[_0x129a('0x9')](_0x287e4d,_0x5b465e)['then'](function(_0x39e39f){logger[_0x129a('0xa')](_0x129a('0xb'),_0xd34f6c,'request\x20sent');logger['debug'](_0x129a('0xc'),_0xd34f6c,_0x129a('0xd'),JSON['stringify'](_0x39e39f));if(_0x39e39f['error']){if(_0x39e39f[_0x129a('0xe')]['code']===0x1f4){logger[_0x129a('0xe')](_0x129a('0xb'),_0xd34f6c,_0x39e39f[_0x129a('0xe')][_0x129a('0xf')]);return _0x1741fa(_0x39e39f[_0x129a('0xe')][_0x129a('0xf')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0xd34f6c,_0x39e39f[_0x129a('0xe')]['message']);return _0x37171e(_0x39e39f[_0x129a('0xe')][_0x129a('0xf')]);}else{logger[_0x129a('0xa')](_0x129a('0xb'),_0xd34f6c,_0x129a('0xd'));_0x37171e(_0x39e39f[_0x129a('0x10')]['message']);}})[_0x129a('0x11')](function(_0x23da26){logger[_0x129a('0xe')]('ZohoField,\x20%s,\x20%s',_0xd34f6c,_0x23da26);_0x1741fa(_0x23da26);});});} \ No newline at end of file +var _0x0a29=['message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x54c12f,_0x4974f2){var _0x5e7182=function(_0x3b4486){while(--_0x3b4486){_0x54c12f['push'](_0x54c12f['shift']());}};_0x5e7182(++_0x4974f2);}(_0x0a29,0xb8));var _0x90a2=function(_0x3ba1c9,_0xcc1ada){_0x3ba1c9=_0x3ba1c9-0x0;var _0x2dbb40=_0x0a29[_0x3ba1c9];return _0x2dbb40;};'use strict';var _=require('lodash');var util=require(_0x90a2('0x0'));var moment=require(_0x90a2('0x1'));var BPromise=require('bluebird');var rs=require(_0x90a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90a2('0x3'))['db'];var utils=require(_0x90a2('0x4'));var logger=require(_0x90a2('0x5'))(_0x90a2('0x6'));var config=require(_0x90a2('0x7'));var jayson=require(_0x90a2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4720d2,_0x28d4de,_0x2fce99){return new BPromise(function(_0x50ceca,_0x5c30c3){return client[_0x90a2('0x9')](_0x4720d2,_0x2fce99)[_0x90a2('0xa')](function(_0x418193){logger['info'](_0x90a2('0xb'),_0x28d4de,_0x90a2('0xc'));logger['debug'](_0x90a2('0xd'),_0x28d4de,_0x90a2('0xc'),JSON[_0x90a2('0xe')](_0x418193));if(_0x418193[_0x90a2('0xf')]){if(_0x418193[_0x90a2('0xf')]['code']===0x1f4){logger[_0x90a2('0xf')]('ZohoField,\x20%s,\x20%s',_0x28d4de,_0x418193[_0x90a2('0xf')][_0x90a2('0x10')]);return _0x5c30c3(_0x418193[_0x90a2('0xf')][_0x90a2('0x10')]);}logger[_0x90a2('0xf')](_0x90a2('0xb'),_0x28d4de,_0x418193[_0x90a2('0xf')][_0x90a2('0x10')]);return _0x50ceca(_0x418193[_0x90a2('0xf')]['message']);}else{logger[_0x90a2('0x11')](_0x90a2('0xb'),_0x28d4de,_0x90a2('0xc'));_0x50ceca(_0x418193[_0x90a2('0x12')][_0x90a2('0x10')]);}})[_0x90a2('0x13')](function(_0x42663b){logger[_0x90a2('0xf')](_0x90a2('0xb'),_0x28d4de,_0x42663b);_0x5c30c3(_0x42663b);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index f0cc77a..79c7be5 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x592216,_0x2d24b9){var _0x3f8b3f=function(_0x3a96f3){while(--_0x3a96f3){_0x592216['push'](_0x592216['shift']());}};_0x3f8b3f(++_0x2d24b9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xcb91[_0x3430aa];return _0x2ac5c;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x59cc57,_0x22fe08){var _0x7dc88d=function(_0x379599){while(--_0x379599){_0x59cc57['push'](_0x59cc57['shift']());}};_0x7dc88d(++_0x22fe08);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b5fc0,_0x17c17a){_0x3b5fc0=_0x3b5fc0-0x0;var _0x4f93e3=_0xedd9[_0x3b5fc0];return _0x4f93e3;};'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 122f6ad..0373b62 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 _0xba00=['STRING','unique_name_and_version','app.js','BOOLEAN','state','sequelize'];(function(_0x2c2d11,_0x4308ac){var _0x255f24=function(_0x1aa524){while(--_0x1aa524){_0x2c2d11['push'](_0x2c2d11['shift']());}};_0x255f24(++_0x4308ac);}(_0xba00,0x6b));var _0x0ba0=function(_0x91afe6,_0x32ee75){_0x91afe6=_0x91afe6-0x0;var _0x103183=_0xba00[_0x91afe6];return _0x103183;};'use strict';var Sequelize=require(_0x0ba0('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ba0('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x0ba0('0x1')],'allowNull':![],'unique':_0x0ba0('0x2')},'main':{'type':Sequelize[_0x0ba0('0x1')],'defaultValue':_0x0ba0('0x3')},'filename':{'type':Sequelize[_0x0ba0('0x1')]},'path':{'type':Sequelize[_0x0ba0('0x1')]},'type':{'type':Sequelize[_0x0ba0('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x0ba0('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x0ba0('0x1')]},'state':{'type':Sequelize[_0x0ba0('0x1')],'unique':_0x0ba0('0x5')},'description':{'type':Sequelize[_0x0ba0('0x1')]},'title':{'type':Sequelize[_0x0ba0('0x1')]},'remoteUri':{'type':Sequelize[_0x0ba0('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x5199=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x5199,0x115));var _0x9519=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x5199[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0x9519('0x0'));module[_0x9519('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x9519('0x2')],'allowNull':![],'unique':_0x9519('0x3')},'main':{'type':Sequelize[_0x9519('0x2')],'defaultValue':_0x9519('0x4')},'filename':{'type':Sequelize[_0x9519('0x2')]},'path':{'type':Sequelize[_0x9519('0x2')]},'type':{'type':Sequelize[_0x9519('0x2')]},'size':{'type':Sequelize[_0x9519('0x5')]},'active':{'type':Sequelize[_0x9519('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x9519('0x2')]},'logo':{'type':Sequelize[_0x9519('0x2')]},'state':{'type':Sequelize[_0x9519('0x2')],'unique':_0x9519('0x7')},'description':{'type':Sequelize[_0x9519('0x2')]},'title':{'type':Sequelize[_0x9519('0x2')]},'remoteUri':{'type':Sequelize[_0x9519('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 facf8ce..ea9fd60 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 _0x1a37=['stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x1a37,0xb4));var _0x71a3=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x1a37[_0x397cfb];return _0x15fed9;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));}; \ No newline at end of file +var _0x4991=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','Integration','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x1e354d,_0x4cdd11){var _0x25445d=function(_0x2536d4){while(--_0x2536d4){_0x1e354d['push'](_0x1e354d['shift']());}};_0x25445d(++_0x4cdd11);}(_0x4991,0xf7));var _0x1499=function(_0x306cd4,_0x407871){_0x306cd4=_0x306cd4-0x0;var _0x1c3ace=_0x4991[_0x306cd4];return _0x1c3ace;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['Integration'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 1c2ab69..30c1208 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 _0x8da4=['integrations','util','moment','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x3f2f19,_0x2ea0c4){var _0x18f929=function(_0x358d09){while(--_0x358d09){_0x3f2f19['push'](_0x3f2f19['shift']());}};_0x18f929(++_0x2ea0c4);}(_0x8da4,0x177));var _0x48da=function(_0x34c5bf,_0x3cc9ed){_0x34c5bf=_0x34c5bf-0x0;var _0x3dfc47=_0x8da4[_0x34c5bf];return _0x3dfc47;};'use strict';var _=require('lodash');var util=require(_0x48da('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x48da('0x1'));var BPromise=require('bluebird');var rp=require(_0x48da('0x2'));var fs=require('fs');var path=require(_0x48da('0x3'));var rimraf=require(_0x48da('0x4'));var config=require(_0x48da('0x5'));var attributes=require(_0x48da('0x6'));module[_0x48da('0x7')]=function(_0x120b47,_0xcd0510){return _0x120b47[_0x48da('0x8')](_0x48da('0x9'),attributes,{'tableName':_0x48da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a54=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x1a54,0x98));var _0x41a5=function(_0x31d4ad,_0x516716){_0x31d4ad=_0x31d4ad-0x0;var _0x8e7659=_0x1a54[_0x31d4ad];return _0x8e7659;};'use strict';var _=require(_0x41a5('0x0'));var util=require(_0x41a5('0x1'));var logger=require(_0x41a5('0x2'))(_0x41a5('0x3'));var moment=require(_0x41a5('0x4'));var BPromise=require(_0x41a5('0x5'));var rp=require(_0x41a5('0x6'));var fs=require('fs');var path=require(_0x41a5('0x7'));var rimraf=require(_0x41a5('0x8'));var config=require(_0x41a5('0x9'));var attributes=require(_0x41a5('0xa'));module['exports']=function(_0x22f0c0,_0x47130d){return _0x22f0c0['define'](_0x41a5('0xb'),attributes,{'tableName':_0x41a5('0xc'),'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 bb6291c..21b6d06 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 _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x562da9,_0x4f861b){var _0xad275c=function(_0x5c5a99){while(--_0x5c5a99){_0x562da9['push'](_0x562da9['shift']());}};_0xad275c(++_0x4f861b);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x418be9,_0xa6772){_0x418be9=_0x418be9-0x0;var _0x17ba91=_0xc6ac[_0x418be9];return _0x17ba91;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x1a0a89,_0x528456){var _0x3b9474=function(_0x46952d){while(--_0x46952d){_0x1a0a89['push'](_0x1a0a89['shift']());}};_0x3b9474(++_0x528456);}(_0xba34,0x119));var _0x4ba3=function(_0x34c185,_0x3c2865){_0x34c185=_0x34c185-0x0;var _0x62916c=_0xba34[_0x34c185];return _0x62916c;};'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/integrationReport/index.js b/server/api/integrationReport/index.js index d4fe49e..b3fcc28 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 _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5b988d,_0x4b94c1){var _0x57df1c=function(_0x3ed716){while(--_0x3ed716){_0x5b988d['push'](_0x5b988d['shift']());}};_0x57df1c(++_0x4b94c1);}(_0x7880,0x1f4));var _0x0788=function(_0xe3025,_0x686182){_0xe3025=_0xe3025-0x0;var _0x592d0b=_0x7880[_0xe3025];return _0x592d0b;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xdb28,0x106));var _0x8db2=function(_0x370405,_0x116100){_0x370405=_0x370405-0x0;var _0x3b8944=_0xdb28[_0x370405];return _0x3b8944;};'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('./integrationReport.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',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('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 177575c..8d51b64 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 _0xb7bc=['BOOLEAN','TEXT','ENUM','SENDING','exports','STRING','INTEGER','DATE'];(function(_0xf36be,_0x12ed74){var _0x556ea6=function(_0x13825c){while(--_0x13825c){_0xf36be['push'](_0xf36be['shift']());}};_0x556ea6(++_0x12ed74);}(_0xb7bc,0x144));var _0xcb7b=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xb7bc[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require('sequelize');module[_0xcb7b('0x0')]={'integration':{'type':Sequelize[_0xcb7b('0x1')]},'eventChannel':{'type':Sequelize[_0xcb7b('0x1')]},'exitStatus':{'type':Sequelize[_0xcb7b('0x1')]},'ticketId':{'type':Sequelize[_0xcb7b('0x1')]},'integrationId':{'type':Sequelize[_0xcb7b('0x2')]},'contacts':{'type':Sequelize[_0xcb7b('0x1')]},'uniqueid':{'type':Sequelize[_0xcb7b('0x1')]},'calleridnum':{'type':Sequelize[_0xcb7b('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xcb7b('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xcb7b('0x1')]},'agentcalledAt':{'type':Sequelize[_0xcb7b('0x3')]},'agentconnectAt':{'type':Sequelize[_0xcb7b('0x3')]},'holdtime':{'type':Sequelize[_0xcb7b('0x2')]},'agentcomplete':{'type':Sequelize[_0xcb7b('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xcb7b('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xcb7b('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xcb7b('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcb7b('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcb7b('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xcb7b('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xcb7b('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcb7b('0x1')]},'connectedlinename':{'type':Sequelize[_0xcb7b('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcb7b('0x1')]},'context':{'type':Sequelize[_0xcb7b('0x1')]},'exten':{'type':Sequelize[_0xcb7b('0x1')]},'priority':{'type':Sequelize[_0xcb7b('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xcb7b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xcb7b('0x1')]},'destcalleridnum':{'type':Sequelize[_0xcb7b('0x1')]},'destcalleridname':{'type':Sequelize[_0xcb7b('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xcb7b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xcb7b('0x1')]},'destlanguage':{'type':Sequelize[_0xcb7b('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xcb7b('0x1')]},'destpriority':{'type':Sequelize[_0xcb7b('0x1')]},'destuniqueid':{'type':Sequelize[_0xcb7b('0x1')]},'messageId':{'type':Sequelize[_0xcb7b('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xcb7b('0x1')]},'from':{'type':Sequelize[_0xcb7b('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xcb7b('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xcb7b('0x5')]},'status':{'type':Sequelize[_0xcb7b('0x6')]('SENT',_0xcb7b('0x7'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0xcb7b('0x1')]},'app':{'type':Sequelize[_0xcb7b('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xcb7b('0x2')]}}; \ No newline at end of file +var _0x9e56=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED'];(function(_0x45df32,_0xccb2ac){var _0x5f4b2a=function(_0x175f27){while(--_0x175f27){_0x45df32['push'](_0x45df32['shift']());}};_0x5f4b2a(++_0xccb2ac);}(_0x9e56,0x197));var _0x69e5=function(_0x5ade89,_0x2a90b0){_0x5ade89=_0x5ade89-0x0;var _0x272f1f=_0x9e56[_0x5ade89];return _0x272f1f;};'use strict';var Sequelize=require(_0x69e5('0x0'));module[_0x69e5('0x1')]={'integration':{'type':Sequelize[_0x69e5('0x2')]},'eventChannel':{'type':Sequelize[_0x69e5('0x2')]},'exitStatus':{'type':Sequelize[_0x69e5('0x2')]},'ticketId':{'type':Sequelize[_0x69e5('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x69e5('0x2')]},'uniqueid':{'type':Sequelize[_0x69e5('0x2')]},'calleridnum':{'type':Sequelize[_0x69e5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x69e5('0x2')]},'interface':{'type':Sequelize[_0x69e5('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x69e5('0x3')]},'agentconnectAt':{'type':Sequelize[_0x69e5('0x3')]},'holdtime':{'type':Sequelize[_0x69e5('0x4')]},'agentcomplete':{'type':Sequelize[_0x69e5('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x69e5('0x3')]},'talktime':{'type':Sequelize[_0x69e5('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x69e5('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x69e5('0x3')]},'agentdump':{'type':Sequelize[_0x69e5('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x69e5('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x69e5('0x2')]},'channelstate':{'type':Sequelize[_0x69e5('0x4')]},'channelstatedesc':{'type':Sequelize[_0x69e5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x69e5('0x2')]},'connectedlinename':{'type':Sequelize[_0x69e5('0x2')]},'language':{'type':Sequelize[_0x69e5('0x2')]},'accountcode':{'type':Sequelize[_0x69e5('0x2')]},'context':{'type':Sequelize[_0x69e5('0x2')]},'exten':{'type':Sequelize[_0x69e5('0x2')]},'priority':{'type':Sequelize[_0x69e5('0x2')]},'destchannel':{'type':Sequelize[_0x69e5('0x2')]},'destchannelstate':{'type':Sequelize[_0x69e5('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x69e5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x69e5('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x69e5('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x69e5('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x69e5('0x2')]},'destuniqueid':{'type':Sequelize[_0x69e5('0x2')]},'messageId':{'type':Sequelize[_0x69e5('0x2')]},'inReplyTo':{'type':Sequelize[_0x69e5('0x2')]},'subject':{'type':Sequelize[_0x69e5('0x2')]},'from':{'type':Sequelize[_0x69e5('0x2')]},'to':{'type':Sequelize[_0x69e5('0x2')]},'cc':{'type':Sequelize[_0x69e5('0x2')]},'attachment':{'type':Sequelize[_0x69e5('0x6')]},'html':{'type':Sequelize[_0x69e5('0x6')]},'text':{'type':Sequelize[_0x69e5('0x6')]},'status':{'type':Sequelize['ENUM'](_0x69e5('0x7'),_0x69e5('0x8'),_0x69e5('0x9'),_0x69e5('0xa'))},'url':{'type':Sequelize[_0x69e5('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x69e5('0x2')]},'projectId':{'type':Sequelize[_0x69e5('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 5700747..73467cc 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 _0xed25=['fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','describe','rimraf','zip-dir'];(function(_0x62bc17,_0x236ee9){var _0x76cf0c=function(_0x5f4945){while(--_0x5f4945){_0x62bc17['push'](_0x62bc17['shift']());}};_0x76cf0c(++_0x236ee9);}(_0xed25,0x116));var _0x5ed2=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0xed25[_0x38af48];return _0x445384;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ed2('0x0'));var zipdir=require(_0x5ed2('0x1'));var jsonpatch=require(_0x5ed2('0x2'));var rp=require('request-promise');var moment=require(_0x5ed2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5ed2('0x4'));var util=require(_0x5ed2('0x5'));var path=require(_0x5ed2('0x6'));var sox=require(_0x5ed2('0x7'));var csv=require(_0x5ed2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ed2('0x9'));var _=require(_0x5ed2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ed2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5ed2('0xc'));var Redis=require(_0x5ed2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5ed2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ed2('0xf'));var logger=require(_0x5ed2('0x10'))('api');var utils=require(_0x5ed2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x5ed2('0x12'));var db=require(_0x5ed2('0x13'))['db'];function respondWithStatusCode(_0x23ad83,_0x54685b){_0x54685b=_0x54685b||0xcc;return function(_0x4cb1b4){if(_0x4cb1b4){return _0x23ad83[_0x5ed2('0x14')](_0x54685b);}return _0x23ad83[_0x5ed2('0x15')](_0x54685b)[_0x5ed2('0x16')]();};}function respondWithResult(_0x4cd17f,_0x4166ed){_0x4166ed=_0x4166ed||0xc8;return function(_0x35a89b){if(_0x35a89b){return _0x4cd17f[_0x5ed2('0x15')](_0x4166ed)['json'](_0x35a89b);}};}function respondWithFilteredResult(_0x2f49c7,_0x42a0cd){return function(_0x26d1ec){if(_0x26d1ec){var _0x1acb06=typeof _0x42a0cd[_0x5ed2('0x17')]===_0x5ed2('0x18')&&typeof _0x42a0cd[_0x5ed2('0x19')]===_0x5ed2('0x18');var _0xc226b9=_0x26d1ec[_0x5ed2('0x1a')];var _0x1b0d23=_0x1acb06?0x0:_0x42a0cd[_0x5ed2('0x17')];var _0x4043d2=_0x1acb06?_0x26d1ec['count']:_0x42a0cd[_0x5ed2('0x17')]+_0x42a0cd['limit'];var _0x14a6ac;if(_0x4043d2>=_0xc226b9){_0x4043d2=_0xc226b9;_0x14a6ac=0xc8;}else{_0x14a6ac=0xce;}_0x2f49c7[_0x5ed2('0x15')](_0x14a6ac);return _0x2f49c7[_0x5ed2('0x1b')](_0x5ed2('0x1c'),_0x1b0d23+'-'+_0x4043d2+'/'+_0xc226b9)[_0x5ed2('0x1d')](_0x26d1ec);}return null;};}function patchUpdates(_0x1909a6){return function(_0x5c4d31){try{jsonpatch['apply'](_0x5c4d31,_0x1909a6,!![]);}catch(_0x2b163e){return BPromise['reject'](_0x2b163e);}return _0x5c4d31[_0x5ed2('0x1e')]();};}function saveUpdates(_0x3edbd8,_0x345cfd){return function(_0x450c54){if(_0x450c54){return _0x450c54[_0x5ed2('0x1f')](_0x3edbd8)[_0x5ed2('0x20')](function(_0x1c6c5a){return _0x1c6c5a;});}return null;};}function removeEntity(_0x110766,_0xc77382){return function(_0x55834a){if(_0x55834a){return _0x55834a['destroy']()[_0x5ed2('0x20')](function(){_0x110766['status'](0xcc)[_0x5ed2('0x16')]();});}};}function handleEntityNotFound(_0x108117,_0x4289f8){return function(_0x121b74){if(!_0x121b74){_0x108117[_0x5ed2('0x14')](0x194);}return _0x121b74;};}function handleError(_0x5e5486,_0x37c139){_0x37c139=_0x37c139||0x1f4;return function(_0x543d93){logger['error'](_0x543d93[_0x5ed2('0x21')]);if(_0x543d93['name']){delete _0x543d93[_0x5ed2('0x22')];}_0x5e5486[_0x5ed2('0x15')](_0x37c139)[_0x5ed2('0x23')](_0x543d93);};}exports[_0x5ed2('0x24')]=function(_0x2516b2,_0x4339b2){var _0x174fab={},_0x48a778={},_0x245564={'count':0x0,'rows':[]};var _0x4b57d9=_['map'](db[_0x5ed2('0x25')][_0x5ed2('0x26')],function(_0x145f1a){return{'name':_0x145f1a[_0x5ed2('0x27')],'type':_0x145f1a[_0x5ed2('0x28')]['key']};});_0x48a778['model']=_[_0x5ed2('0x29')](_0x4b57d9,_0x5ed2('0x22'));_0x48a778[_0x5ed2('0x2a')]=_[_0x5ed2('0x2b')](_0x2516b2[_0x5ed2('0x2a')]);_0x48a778[_0x5ed2('0x2c')]=_[_0x5ed2('0x2d')](_0x48a778[_0x5ed2('0x2e')],_0x48a778[_0x5ed2('0x2a')]);_0x174fab[_0x5ed2('0x2f')]=_[_0x5ed2('0x2d')](_0x48a778[_0x5ed2('0x2e')],qs[_0x5ed2('0x30')](_0x2516b2['query'][_0x5ed2('0x30')]));_0x174fab['attributes']=_0x174fab['attributes'][_0x5ed2('0x31')]?_0x174fab['attributes']:_0x48a778['model'];if(!_0x2516b2[_0x5ed2('0x2a')]['hasOwnProperty'](_0x5ed2('0x32'))){_0x174fab['limit']=qs[_0x5ed2('0x19')](_0x2516b2[_0x5ed2('0x2a')][_0x5ed2('0x19')]);_0x174fab['offset']=qs[_0x5ed2('0x17')](_0x2516b2[_0x5ed2('0x2a')][_0x5ed2('0x17')]);}_0x174fab[_0x5ed2('0x33')]=qs['sort'](_0x2516b2[_0x5ed2('0x2a')][_0x5ed2('0x34')]);_0x174fab[_0x5ed2('0x35')]=qs['filters'](_[_0x5ed2('0x36')](_0x2516b2[_0x5ed2('0x2a')],_0x48a778['filters']),_0x4b57d9);if(_0x2516b2[_0x5ed2('0x2a')]['filter']){_0x174fab[_0x5ed2('0x35')]=_['merge'](_0x174fab['where'],{'$or':_[_0x5ed2('0x29')](_0x4b57d9,function(_0x21238a){if(_0x21238a[_0x5ed2('0x28')]!==_0x5ed2('0x37')){var _0x10d8e9={};_0x10d8e9[_0x21238a[_0x5ed2('0x22')]]={'$like':'%'+_0x2516b2[_0x5ed2('0x2a')][_0x5ed2('0x38')]+'%'};return _0x10d8e9;}})});}_0x174fab=_[_0x5ed2('0x39')]({},_0x174fab,_0x2516b2[_0x5ed2('0x3a')]);var _0x265f77={'where':_0x174fab['where']};return db[_0x5ed2('0x25')][_0x5ed2('0x1a')](_0x265f77)['then'](function(_0x3ef770){_0x245564[_0x5ed2('0x1a')]=_0x3ef770;if(_0x2516b2['query']['includeAll']){_0x174fab['include']=[{'all':!![]}];}return db[_0x5ed2('0x25')][_0x5ed2('0x3b')](_0x174fab);})[_0x5ed2('0x20')](function(_0x20db45){_0x245564[_0x5ed2('0x3c')]=_0x20db45;return _0x245564;})[_0x5ed2('0x20')](respondWithFilteredResult(_0x4339b2,_0x174fab))[_0x5ed2('0x3d')](handleError(_0x4339b2,null));};exports[_0x5ed2('0x3e')]=function(_0xe6362e,_0x393513){var _0x2f3ead={'raw':![],'where':{'id':_0xe6362e['params']['id']}},_0x35a828={};_0x35a828[_0x5ed2('0x2e')]=_['keys'](db[_0x5ed2('0x25')][_0x5ed2('0x26')]);_0x35a828['query']=_[_0x5ed2('0x2b')](_0xe6362e['query']);_0x35a828['filters']=_[_0x5ed2('0x2d')](_0x35a828[_0x5ed2('0x2e')],_0x35a828[_0x5ed2('0x2a')]);_0x2f3ead[_0x5ed2('0x2f')]=_['intersection'](_0x35a828[_0x5ed2('0x2e')],qs[_0x5ed2('0x30')](_0xe6362e[_0x5ed2('0x2a')][_0x5ed2('0x30')]));_0x2f3ead[_0x5ed2('0x2f')]=_0x2f3ead[_0x5ed2('0x2f')][_0x5ed2('0x31')]?_0x2f3ead[_0x5ed2('0x2f')]:_0x35a828[_0x5ed2('0x2e')];if(_0xe6362e[_0x5ed2('0x2a')][_0x5ed2('0x3f')]){_0x2f3ead[_0x5ed2('0x40')]=[{'all':!![]}];}_0x2f3ead=_[_0x5ed2('0x39')]({},_0x2f3ead,_0xe6362e[_0x5ed2('0x3a')]);return db[_0x5ed2('0x25')][_0x5ed2('0x41')](_0x2f3ead)[_0x5ed2('0x20')](handleEntityNotFound(_0x393513,null))['then'](respondWithResult(_0x393513,null))[_0x5ed2('0x3d')](handleError(_0x393513,null));};exports[_0x5ed2('0x42')]=function(_0x968a49,_0xae71e5){return db['IntegrationReport']['create'](_0x968a49[_0x5ed2('0x43')],{})[_0x5ed2('0x20')](respondWithResult(_0xae71e5,0xc9))[_0x5ed2('0x3d')](handleError(_0xae71e5,null));};exports[_0x5ed2('0x1f')]=function(_0x20bafa,_0x3df78c){if(_0x20bafa[_0x5ed2('0x43')]['id']){delete _0x20bafa[_0x5ed2('0x43')]['id'];}return db[_0x5ed2('0x25')][_0x5ed2('0x41')]({'where':{'id':_0x20bafa[_0x5ed2('0x44')]['id']}})['then'](handleEntityNotFound(_0x3df78c,null))[_0x5ed2('0x20')](saveUpdates(_0x20bafa[_0x5ed2('0x43')],null))[_0x5ed2('0x20')](respondWithResult(_0x3df78c,null))['catch'](handleError(_0x3df78c,null));};exports['destroy']=function(_0x7d1399,_0x5143fb){return db['IntegrationReport'][_0x5ed2('0x41')]({'where':{'id':_0x7d1399[_0x5ed2('0x44')]['id']}})[_0x5ed2('0x20')](handleEntityNotFound(_0x5143fb,null))[_0x5ed2('0x20')](removeEntity(_0x5143fb,null))[_0x5ed2('0x3d')](handleError(_0x5143fb,null));};exports[_0x5ed2('0x45')]=function(_0x547d79,_0x35d1a7){return db[_0x5ed2('0x25')][_0x5ed2('0x45')]()[_0x5ed2('0x20')](respondWithResult(_0x35d1a7,null))['catch'](handleError(_0x35d1a7,null));}; \ No newline at end of file +var _0xaaed=['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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','keys','query','filters','model','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','describe','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1d09b6,_0x1ac12c){var _0x2f1a26=function(_0x27e496){while(--_0x27e496){_0x1d09b6['push'](_0x1d09b6['shift']());}};_0x2f1a26(++_0x1ac12c);}(_0xaaed,0x12e));var _0xdaae=function(_0x188a89,_0x4a7ee6){_0x188a89=_0x188a89-0x0;var _0x14c7b8=_0xaaed[_0x188a89];return _0x14c7b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdaae('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdaae('0x1'));var moment=require(_0xdaae('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xdaae('0x3'));var util=require(_0xdaae('0x4'));var path=require(_0xdaae('0x5'));var sox=require('sox');var csv=require(_0xdaae('0x6'));var ejs=require(_0xdaae('0x7'));var fs=require('fs');var fs_extra=require(_0xdaae('0x8'));var _=require(_0xdaae('0x9'));var squel=require(_0xdaae('0xa'));var crypto=require(_0xdaae('0xb'));var jsforce=require(_0xdaae('0xc'));var deskjs=require(_0xdaae('0xd'));var toCsv=require(_0xdaae('0x6'));var querystring=require(_0xdaae('0xe'));var Papa=require(_0xdaae('0xf'));var Redis=require(_0xdaae('0x10'));var authService=require(_0xdaae('0x11'));var qs=require(_0xdaae('0x12'));var as=require(_0xdaae('0x13'));var hardwareService=require(_0xdaae('0x14'));var logger=require(_0xdaae('0x15'))(_0xdaae('0x16'));var utils=require('../../config/utils');var config=require(_0xdaae('0x17'));var licenseUtil=require(_0xdaae('0x18'));var db=require(_0xdaae('0x19'))['db'];function respondWithStatusCode(_0x5b2dd4,_0x375157){_0x375157=_0x375157||0xcc;return function(_0x5593d0){if(_0x5593d0){return _0x5b2dd4[_0xdaae('0x1a')](_0x375157);}return _0x5b2dd4[_0xdaae('0x1b')](_0x375157)['end']();};}function respondWithResult(_0x156015,_0x3a132f){_0x3a132f=_0x3a132f||0xc8;return function(_0x2331b1){if(_0x2331b1){return _0x156015[_0xdaae('0x1b')](_0x3a132f)[_0xdaae('0x1c')](_0x2331b1);}};}function respondWithFilteredResult(_0x4b77d2,_0x59a001){return function(_0x318d76){if(_0x318d76){var _0x53dbc3=typeof _0x59a001['offset']==='undefined'&&typeof _0x59a001[_0xdaae('0x1d')]===_0xdaae('0x1e');var _0x2f02e4=_0x318d76[_0xdaae('0x1f')];var _0x23fa17=_0x53dbc3?0x0:_0x59a001[_0xdaae('0x20')];var _0x49a75b=_0x53dbc3?_0x318d76[_0xdaae('0x1f')]:_0x59a001[_0xdaae('0x20')]+_0x59a001[_0xdaae('0x1d')];var _0x28e2f6;if(_0x49a75b>=_0x2f02e4){_0x49a75b=_0x2f02e4;_0x28e2f6=0xc8;}else{_0x28e2f6=0xce;}_0x4b77d2[_0xdaae('0x1b')](_0x28e2f6);return _0x4b77d2[_0xdaae('0x21')](_0xdaae('0x22'),_0x23fa17+'-'+_0x49a75b+'/'+_0x2f02e4)['json'](_0x318d76);}return null;};}function patchUpdates(_0x178cef){return function(_0x4c5c39){try{jsonpatch[_0xdaae('0x23')](_0x4c5c39,_0x178cef,!![]);}catch(_0x26f357){return BPromise[_0xdaae('0x24')](_0x26f357);}return _0x4c5c39[_0xdaae('0x25')]();};}function saveUpdates(_0xd38169,_0x237531){return function(_0x1c33c0){if(_0x1c33c0){return _0x1c33c0[_0xdaae('0x26')](_0xd38169)[_0xdaae('0x27')](function(_0x246a3d){return _0x246a3d;});}return null;};}function removeEntity(_0x28bc54,_0x1f5072){return function(_0x4c29a9){if(_0x4c29a9){return _0x4c29a9[_0xdaae('0x28')]()[_0xdaae('0x27')](function(){_0x28bc54[_0xdaae('0x1b')](0xcc)[_0xdaae('0x29')]();});}};}function handleEntityNotFound(_0x3fdd41,_0x140aa4){return function(_0x2f8638){if(!_0x2f8638){_0x3fdd41[_0xdaae('0x1a')](0x194);}return _0x2f8638;};}function handleError(_0x23df6b,_0x51e328){_0x51e328=_0x51e328||0x1f4;return function(_0x344a71){logger[_0xdaae('0x2a')](_0x344a71['stack']);if(_0x344a71[_0xdaae('0x2b')]){delete _0x344a71[_0xdaae('0x2b')];}_0x23df6b['status'](_0x51e328)[_0xdaae('0x2c')](_0x344a71);};}exports[_0xdaae('0x2d')]=function(_0x8ed10c,_0x5b2f7e){var _0x519a34={},_0x4d30e5={},_0x194f98={'count':0x0,'rows':[]};var _0x8d7660=_[_0xdaae('0x2e')](db[_0xdaae('0x2f')][_0xdaae('0x30')],function(_0x15c890){return{'name':_0x15c890[_0xdaae('0x31')],'type':_0x15c890[_0xdaae('0x32')][_0xdaae('0x33')]};});_0x4d30e5['model']=_[_0xdaae('0x2e')](_0x8d7660,_0xdaae('0x2b'));_0x4d30e5['query']=_[_0xdaae('0x34')](_0x8ed10c[_0xdaae('0x35')]);_0x4d30e5[_0xdaae('0x36')]=_['intersection'](_0x4d30e5[_0xdaae('0x37')],_0x4d30e5[_0xdaae('0x35')]);_0x519a34['attributes']=_[_0xdaae('0x38')](_0x4d30e5[_0xdaae('0x37')],qs['fields'](_0x8ed10c[_0xdaae('0x35')]['fields']));_0x519a34[_0xdaae('0x39')]=_0x519a34[_0xdaae('0x39')]['length']?_0x519a34[_0xdaae('0x39')]:_0x4d30e5[_0xdaae('0x37')];if(!_0x8ed10c[_0xdaae('0x35')][_0xdaae('0x3a')](_0xdaae('0x3b'))){_0x519a34[_0xdaae('0x1d')]=qs[_0xdaae('0x1d')](_0x8ed10c['query'][_0xdaae('0x1d')]);_0x519a34['offset']=qs['offset'](_0x8ed10c[_0xdaae('0x35')][_0xdaae('0x20')]);}_0x519a34[_0xdaae('0x3c')]=qs['sort'](_0x8ed10c[_0xdaae('0x35')][_0xdaae('0x3d')]);_0x519a34['where']=qs['filters'](_['pick'](_0x8ed10c['query'],_0x4d30e5[_0xdaae('0x36')]),_0x8d7660);if(_0x8ed10c[_0xdaae('0x35')][_0xdaae('0x3e')]){_0x519a34[_0xdaae('0x3f')]=_[_0xdaae('0x40')](_0x519a34[_0xdaae('0x3f')],{'$or':_[_0xdaae('0x2e')](_0x8d7660,function(_0x2fe38b){if(_0x2fe38b[_0xdaae('0x32')]!=='VIRTUAL'){var _0x170152={};_0x170152[_0x2fe38b[_0xdaae('0x2b')]]={'$like':'%'+_0x8ed10c[_0xdaae('0x35')][_0xdaae('0x3e')]+'%'};return _0x170152;}})});}_0x519a34=_[_0xdaae('0x40')]({},_0x519a34,_0x8ed10c['options']);var _0x53d4c9={'where':_0x519a34[_0xdaae('0x3f')]};return db['IntegrationReport']['count'](_0x53d4c9)[_0xdaae('0x27')](function(_0x1b16bb){_0x194f98[_0xdaae('0x1f')]=_0x1b16bb;if(_0x8ed10c['query'][_0xdaae('0x41')]){_0x519a34[_0xdaae('0x42')]=[{'all':!![]}];}return db['IntegrationReport'][_0xdaae('0x43')](_0x519a34);})[_0xdaae('0x27')](function(_0x50bf7d){_0x194f98['rows']=_0x50bf7d;return _0x194f98;})['then'](respondWithFilteredResult(_0x5b2f7e,_0x519a34))[_0xdaae('0x44')](handleError(_0x5b2f7e,null));};exports[_0xdaae('0x45')]=function(_0x3eed4f,_0x272e05){var _0xa46a59={'raw':![],'where':{'id':_0x3eed4f[_0xdaae('0x46')]['id']}},_0x459a3c={};_0x459a3c[_0xdaae('0x37')]=_['keys'](db['IntegrationReport']['rawAttributes']);_0x459a3c[_0xdaae('0x35')]=_[_0xdaae('0x34')](_0x3eed4f[_0xdaae('0x35')]);_0x459a3c['filters']=_[_0xdaae('0x38')](_0x459a3c['model'],_0x459a3c[_0xdaae('0x35')]);_0xa46a59['attributes']=_['intersection'](_0x459a3c[_0xdaae('0x37')],qs[_0xdaae('0x47')](_0x3eed4f['query'][_0xdaae('0x47')]));_0xa46a59['attributes']=_0xa46a59[_0xdaae('0x39')]['length']?_0xa46a59[_0xdaae('0x39')]:_0x459a3c[_0xdaae('0x37')];if(_0x3eed4f[_0xdaae('0x35')][_0xdaae('0x41')]){_0xa46a59[_0xdaae('0x42')]=[{'all':!![]}];}_0xa46a59=_[_0xdaae('0x40')]({},_0xa46a59,_0x3eed4f[_0xdaae('0x48')]);return db[_0xdaae('0x2f')][_0xdaae('0x49')](_0xa46a59)['then'](handleEntityNotFound(_0x272e05,null))[_0xdaae('0x27')](respondWithResult(_0x272e05,null))[_0xdaae('0x44')](handleError(_0x272e05,null));};exports[_0xdaae('0x4a')]=function(_0x3cfd54,_0x198f78){return db[_0xdaae('0x2f')]['create'](_0x3cfd54[_0xdaae('0x4b')],{})['then'](respondWithResult(_0x198f78,0xc9))[_0xdaae('0x44')](handleError(_0x198f78,null));};exports[_0xdaae('0x26')]=function(_0x7fc5c6,_0x280196){if(_0x7fc5c6[_0xdaae('0x4b')]['id']){delete _0x7fc5c6[_0xdaae('0x4b')]['id'];}return db[_0xdaae('0x2f')]['find']({'where':{'id':_0x7fc5c6[_0xdaae('0x46')]['id']}})[_0xdaae('0x27')](handleEntityNotFound(_0x280196,null))[_0xdaae('0x27')](saveUpdates(_0x7fc5c6['body'],null))['then'](respondWithResult(_0x280196,null))['catch'](handleError(_0x280196,null));};exports[_0xdaae('0x28')]=function(_0x4c1b1e,_0x2c08e7){return db[_0xdaae('0x2f')]['find']({'where':{'id':_0x4c1b1e['params']['id']}})[_0xdaae('0x27')](handleEntityNotFound(_0x2c08e7,null))['then'](removeEntity(_0x2c08e7,null))[_0xdaae('0x44')](handleError(_0x2c08e7,null));};exports['describe']=function(_0x19fc1a,_0x5ddbb3){return db[_0xdaae('0x2f')][_0xdaae('0x4c')]()[_0xdaae('0x27')](respondWithResult(_0x5ddbb3,null))['catch'](handleError(_0x5ddbb3,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 10b25b8..77e006d 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 _0x7803=['IntegrationReport','report_integration','lodash','util','moment','path','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x1884e0,_0x3d1424){var _0xe63f82=function(_0x4073c4){while(--_0x4073c4){_0x1884e0['push'](_0x1884e0['shift']());}};_0xe63f82(++_0x3d1424);}(_0x7803,0x142));var _0x3780=function(_0x30caad,_0x4413be){_0x30caad=_0x30caad-0x0;var _0x3d2723=_0x7803[_0x30caad];return _0x3d2723;};'use strict';var _=require(_0x3780('0x0'));var util=require(_0x3780('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3780('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3780('0x3'));var rimraf=require('rimraf');var config=require(_0x3780('0x4'));var attributes=require(_0x3780('0x5'));module[_0x3780('0x6')]=function(_0x54a872,_0x5a62fc){return _0x54a872[_0x3780('0x7')](_0x3780('0x8'),attributes,{'tableName':_0x3780('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb024=['moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','report_integration','util','api'];(function(_0x111dc3,_0x412ded){var _0x2c6ed1=function(_0x5d2701){while(--_0x5d2701){_0x111dc3['push'](_0x111dc3['shift']());}};_0x2c6ed1(++_0x412ded);}(_0xb024,0xbc));var _0x4b02=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb024[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x4b02('0x0'));var logger=require('../../config/logger')(_0x4b02('0x1'));var moment=require(_0x4b02('0x2'));var BPromise=require(_0x4b02('0x3'));var rp=require(_0x4b02('0x4'));var fs=require('fs');var path=require(_0x4b02('0x5'));var rimraf=require(_0x4b02('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b02('0x7'));module[_0x4b02('0x8')]=function(_0x2a00de,_0xf67e0a){return _0x2a00de['define']('IntegrationReport',attributes,{'tableName':_0x4b02('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 36a2c37..f8b8cc7 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(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2f226b,_0x3ac99d){_0x2f226b=_0x2f226b-0x0;var _0x243dfc=_0xc2c7[_0x2f226b];return _0x243dfc;};'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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4f0ca3,_0x2f501b){var _0xe3e2de=function(_0x1024a4){while(--_0x1024a4){_0x4f0ca3['push'](_0x4f0ca3['shift']());}};_0xe3e2de(++_0x2f501b);}(_0x5fab,0x177));var _0xb5fa=function(_0x1d997f,_0x259b5a){_0x1d997f=_0x1d997f-0x0;var _0x307704=_0x5fab[_0x1d997f];return _0x307704;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ab37ffa..1d41aed 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 _0x3248=['./interval.controller','isAuthenticated','index','get','/:id','/:id/sub_intervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x310d56,_0x581328){var _0x8759c7=function(_0x2eafc5){while(--_0x2eafc5){_0x310d56['push'](_0x310d56['shift']());}};_0x8759c7(++_0x581328);}(_0x3248,0x1b0));var _0x8324=function(_0x35c464,_0x1d976b){_0x35c464=_0x35c464-0x0;var _0xb83aac=_0x3248[_0x35c464];return _0xb83aac;};'use strict';var multer=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var path=require(_0x8324('0x2'));var timeout=require(_0x8324('0x3'));var express=require(_0x8324('0x4'));var router=express[_0x8324('0x5')]();var fs_extra=require(_0x8324('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8324('0x7'));var controller=require(_0x8324('0x8'));router['get']('/',auth[_0x8324('0x9')](),controller[_0x8324('0xa')]);router[_0x8324('0xb')](_0x8324('0xc'),auth[_0x8324('0x9')](),controller['show']);router[_0x8324('0xb')](_0x8324('0xd'),auth[_0x8324('0x9')](),controller['getIntervals']);router['post']('/',auth[_0x8324('0x9')](),controller[_0x8324('0xe')]);router[_0x8324('0xf')]('/:id/sub_intervals',auth[_0x8324('0x9')](),controller[_0x8324('0x10')]);router[_0x8324('0xf')](_0x8324('0x11'),auth[_0x8324('0x9')](),controller[_0x8324('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8324('0x13')]);router['delete']('/:id',auth[_0x8324('0x9')](),controller[_0x8324('0x14')]);module[_0x8324('0x15')]=router; \ No newline at end of file +var _0x8149=['util','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','/:id/sub_intervals','getIntervals','create','post','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','exports','multer'];(function(_0x2a5698,_0x1f82c8){var _0xa039ad=function(_0x1c6054){while(--_0x1c6054){_0x2a5698['push'](_0x2a5698['shift']());}};_0xa039ad(++_0x1f82c8);}(_0x8149,0x1a3));var _0x9814=function(_0x4d24ee,_0x51f503){_0x4d24ee=_0x4d24ee-0x0;var _0x38462a=_0x8149[_0x4d24ee];return _0x38462a;};'use strict';var multer=require(_0x9814('0x0'));var util=require(_0x9814('0x1'));var path=require('path');var timeout=require(_0x9814('0x2'));var express=require(_0x9814('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9814('0x4'));var config=require(_0x9814('0x5'));var controller=require('./interval.controller');router['get']('/',auth[_0x9814('0x6')](),controller['index']);router['get'](_0x9814('0x7'),auth[_0x9814('0x6')](),controller[_0x9814('0x8')]);router[_0x9814('0x9')](_0x9814('0xa'),auth['isAuthenticated'](),controller[_0x9814('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9814('0xc')]);router[_0x9814('0xd')](_0x9814('0xa'),auth['isAuthenticated'](),controller['addInterval']);router[_0x9814('0xd')](_0x9814('0xe'),auth[_0x9814('0x6')](),controller[_0x9814('0xf')]);router['put'](_0x9814('0x7'),auth[_0x9814('0x6')](),controller[_0x9814('0x10')]);router[_0x9814('0x11')](_0x9814('0x7'),auth[_0x9814('0x6')](),controller[_0x9814('0x12')]);module[_0x9814('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index d0f4efd..e44c4e1 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 _0x54c9=['STRING','exports'];(function(_0xe5a8ee,_0x470f8f){var _0x5bd116=function(_0x44e1c1){while(--_0x44e1c1){_0xe5a8ee['push'](_0xe5a8ee['shift']());}};_0x5bd116(++_0x470f8f);}(_0x54c9,0x143));var _0x954c=function(_0x3645f9,_0x4f6bc4){_0x3645f9=_0x3645f9-0x0;var _0x267f99=_0x54c9[_0x3645f9];return _0x267f99;};'use strict';var Sequelize=require('sequelize');module[_0x954c('0x0')]={'name':{'type':Sequelize[_0x954c('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x954c('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x1774=['sequelize','exports','STRING'];(function(_0x537290,_0x1f9e4a){var _0x3a5fb3=function(_0x4bfeb7){while(--_0x4bfeb7){_0x537290['push'](_0x537290['shift']());}};_0x3a5fb3(++_0x1f9e4a);}(_0x1774,0x1bc));var _0x4177=function(_0x197ae6,_0x1430d2){_0x197ae6=_0x197ae6-0x0;var _0x36cd78=_0x1774[_0x197ae6];return _0x36cd78;};'use strict';var Sequelize=require(_0x4177('0x0'));module[_0x4177('0x1')]={'name':{'type':Sequelize[_0x4177('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index b234be3..8315ae0 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 _0x93c1=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Intervals','UserProfileResource','end','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','length','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x49e4c5,_0x1bdc1e){var _0x2a4ceb=function(_0x1091cd){while(--_0x1091cd){_0x49e4c5['push'](_0x49e4c5['shift']());}};_0x2a4ceb(++_0x1bdc1e);}(_0x93c1,0xa7));var _0x193c=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x93c1[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0x193c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x193c('0x1'));var jsonpatch=require(_0x193c('0x2'));var rp=require(_0x193c('0x3'));var moment=require(_0x193c('0x4'));var BPromise=require(_0x193c('0x5'));var Mustache=require(_0x193c('0x6'));var util=require('util');var path=require(_0x193c('0x7'));var sox=require('sox');var csv=require(_0x193c('0x8'));var ejs=require(_0x193c('0x9'));var fs=require('fs');var fs_extra=require(_0x193c('0xa'));var _=require(_0x193c('0xb'));var squel=require('squel');var crypto=require(_0x193c('0xc'));var jsforce=require(_0x193c('0xd'));var deskjs=require(_0x193c('0xe'));var toCsv=require(_0x193c('0x8'));var querystring=require('querystring');var Papa=require(_0x193c('0xf'));var Redis=require('ioredis');var authService=require(_0x193c('0x10'));var qs=require(_0x193c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x193c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x193c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x193c('0x14'));var db=require(_0x193c('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x32d857,_0xeb6e16){_0xeb6e16=_0xeb6e16||0xcc;return function(_0x5e408a){if(_0x5e408a){return _0x32d857[_0x193c('0x16')](_0xeb6e16);}return _0x32d857[_0x193c('0x17')](_0xeb6e16)['end']();};}function respondWithResult(_0x5080c2,_0x4b1ea1){_0x4b1ea1=_0x4b1ea1||0xc8;return function(_0x1f32c9){if(_0x1f32c9){return _0x5080c2['status'](_0x4b1ea1)[_0x193c('0x18')](_0x1f32c9);}};}function respondWithFilteredResult(_0x325edf,_0x3ca58f){return function(_0x329cce){if(_0x329cce){var _0x13d4a4=typeof _0x3ca58f[_0x193c('0x19')]===_0x193c('0x1a')&&typeof _0x3ca58f['limit']===_0x193c('0x1a');var _0x3dba03=_0x329cce[_0x193c('0x1b')];var _0x3493bd=_0x13d4a4?0x0:_0x3ca58f[_0x193c('0x19')];var _0x2604da=_0x13d4a4?_0x329cce[_0x193c('0x1b')]:_0x3ca58f[_0x193c('0x19')]+_0x3ca58f[_0x193c('0x1c')];var _0x594c7f;if(_0x2604da>=_0x3dba03){_0x2604da=_0x3dba03;_0x594c7f=0xc8;}else{_0x594c7f=0xce;}_0x325edf[_0x193c('0x17')](_0x594c7f);return _0x325edf[_0x193c('0x1d')](_0x193c('0x1e'),_0x3493bd+'-'+_0x2604da+'/'+_0x3dba03)['json'](_0x329cce);}return null;};}function patchUpdates(_0x5a10fd){return function(_0x52f876){try{jsonpatch[_0x193c('0x1f')](_0x52f876,_0x5a10fd,!![]);}catch(_0x406eec){return BPromise[_0x193c('0x20')](_0x406eec);}return _0x52f876[_0x193c('0x21')]();};}function saveUpdates(_0x5d1df5,_0x54be18){return function(_0x5576cd){if(_0x5576cd){return _0x5576cd[_0x193c('0x22')](_0x5d1df5)[_0x193c('0x23')](function(_0x449497){return _0x449497;});}return null;};}function removeEntity(_0x2400e9,_0x27215a){return function(_0xfa9d50){if(_0xfa9d50){return _0xfa9d50[_0x193c('0x24')]()['then'](function(){var _0x39866c=_0xfa9d50['get']({'plain':!![]});var _0x1eaa62=_0x193c('0x25');return db[_0x193c('0x26')][_0x193c('0x24')]({'where':{'type':_0x1eaa62,'resourceId':_0x39866c['id']}})[_0x193c('0x23')](function(){return _0xfa9d50;});})[_0x193c('0x23')](function(){_0x2400e9[_0x193c('0x17')](0xcc)[_0x193c('0x27')]();});}};}function handleEntityNotFound(_0x4b823d,_0x1c9c06){return function(_0x1b2883){if(!_0x1b2883){_0x4b823d[_0x193c('0x16')](0x194);}return _0x1b2883;};}function handleError(_0x4de5c9,_0x29d606){_0x29d606=_0x29d606||0x1f4;return function(_0x1d9a47){logger[_0x193c('0x28')](_0x1d9a47[_0x193c('0x29')]);if(_0x1d9a47[_0x193c('0x2a')]){delete _0x1d9a47[_0x193c('0x2a')];}_0x4de5c9[_0x193c('0x17')](_0x29d606)[_0x193c('0x2b')](_0x1d9a47);};}exports[_0x193c('0x2c')]=function(_0x240014,_0x462b8b){var _0x1c4473={},_0x18f4a4={},_0x3abd77={'count':0x0,'rows':[]};var _0x521484=_['map'](db[_0x193c('0x2d')][_0x193c('0x2e')],function(_0x239357){return{'name':_0x239357[_0x193c('0x2f')],'type':_0x239357[_0x193c('0x30')][_0x193c('0x31')]};});_0x18f4a4[_0x193c('0x32')]=_['map'](_0x521484,_0x193c('0x2a'));_0x18f4a4[_0x193c('0x33')]=_[_0x193c('0x34')](_0x240014['query']);_0x18f4a4[_0x193c('0x35')]=_[_0x193c('0x36')](_0x18f4a4[_0x193c('0x32')],_0x18f4a4[_0x193c('0x33')]);_0x1c4473[_0x193c('0x37')]=_[_0x193c('0x36')](_0x18f4a4[_0x193c('0x32')],qs[_0x193c('0x38')](_0x240014[_0x193c('0x33')]['fields']));_0x1c4473[_0x193c('0x37')]=_0x1c4473[_0x193c('0x37')]['length']?_0x1c4473['attributes']:_0x18f4a4[_0x193c('0x32')];if(!_0x240014['query'][_0x193c('0x39')](_0x193c('0x3a'))){_0x1c4473[_0x193c('0x1c')]=qs['limit'](_0x240014[_0x193c('0x33')][_0x193c('0x1c')]);_0x1c4473[_0x193c('0x19')]=qs[_0x193c('0x19')](_0x240014[_0x193c('0x33')][_0x193c('0x19')]);}_0x1c4473[_0x193c('0x3b')]=qs['sort'](_0x240014[_0x193c('0x33')][_0x193c('0x3c')]);_0x1c4473['where']=qs[_0x193c('0x35')](_[_0x193c('0x3d')](_0x240014['query'],_0x18f4a4[_0x193c('0x35')]),_0x521484);if(_0x240014[_0x193c('0x33')][_0x193c('0x3e')]){_0x1c4473[_0x193c('0x3f')]=_['merge'](_0x1c4473[_0x193c('0x3f')],{'$or':_[_0x193c('0x40')](_0x521484,function(_0x3ef48d){if(_0x3ef48d[_0x193c('0x30')]!=='VIRTUAL'){var _0x3e8d44={};_0x3e8d44[_0x3ef48d[_0x193c('0x2a')]]={'$like':'%'+_0x240014[_0x193c('0x33')]['filter']+'%'};return _0x3e8d44;}})});}_0x1c4473=_[_0x193c('0x41')]({},_0x1c4473,_0x240014['options']);var _0x398833={'where':_0x1c4473[_0x193c('0x3f')]};return db[_0x193c('0x2d')][_0x193c('0x1b')](_0x398833)['then'](function(_0x349353){_0x3abd77[_0x193c('0x1b')]=_0x349353;if(_0x240014[_0x193c('0x33')][_0x193c('0x42')]){_0x1c4473[_0x193c('0x43')]=[{'all':!![]}];}return db['Interval'][_0x193c('0x44')](_0x1c4473);})[_0x193c('0x23')](function(_0x1630d7){_0x3abd77[_0x193c('0x45')]=_0x1630d7;return _0x3abd77;})['then'](respondWithFilteredResult(_0x462b8b,_0x1c4473))[_0x193c('0x46')](handleError(_0x462b8b,null));};exports[_0x193c('0x47')]=function(_0x5a04a8,_0x4c6eda){var _0xa8f286={'raw':!![],'where':{'id':_0x5a04a8[_0x193c('0x48')]['id']}},_0x482b5a={};_0x482b5a[_0x193c('0x32')]=_[_0x193c('0x34')](db[_0x193c('0x2d')][_0x193c('0x2e')]);_0x482b5a[_0x193c('0x33')]=_[_0x193c('0x34')](_0x5a04a8[_0x193c('0x33')]);_0x482b5a[_0x193c('0x35')]=_['intersection'](_0x482b5a[_0x193c('0x32')],_0x482b5a[_0x193c('0x33')]);_0xa8f286[_0x193c('0x37')]=_[_0x193c('0x36')](_0x482b5a[_0x193c('0x32')],qs[_0x193c('0x38')](_0x5a04a8[_0x193c('0x33')][_0x193c('0x38')]));_0xa8f286['attributes']=_0xa8f286[_0x193c('0x37')]['length']?_0xa8f286['attributes']:_0x482b5a[_0x193c('0x32')];if(_0x5a04a8[_0x193c('0x33')][_0x193c('0x42')]){_0xa8f286[_0x193c('0x43')]=[{'all':!![]}];}_0xa8f286=_[_0x193c('0x41')]({},_0xa8f286,_0x5a04a8[_0x193c('0x49')]);return db[_0x193c('0x2d')][_0x193c('0x4a')](_0xa8f286)[_0x193c('0x23')](handleEntityNotFound(_0x4c6eda,null))[_0x193c('0x23')](respondWithResult(_0x4c6eda,null))[_0x193c('0x46')](handleError(_0x4c6eda,null));};exports[_0x193c('0x4b')]=function(_0x57fba8,_0x2a7efe){return db[_0x193c('0x2d')][_0x193c('0x4b')](_0x57fba8[_0x193c('0x4c')],{})[_0x193c('0x23')](function(_0x58baef){var _0x26c850=_0x57fba8[_0x193c('0x4d')][_0x193c('0x4e')]({'plain':!![]});if(!_0x26c850)throw new Error(_0x193c('0x4f'));if(_0x26c850[_0x193c('0x50')]===_0x193c('0x4d')){var _0x5adad1=_0x58baef[_0x193c('0x4e')]({'plain':!![]});var _0x2fe61c='Intervals';return db[_0x193c('0x51')][_0x193c('0x4a')]({'where':{'name':_0x2fe61c,'userProfileId':_0x26c850[_0x193c('0x52')]},'raw':!![]})['then'](function(_0x517857){if(_0x517857&&_0x517857[_0x193c('0x53')]===0x0){return db[_0x193c('0x26')][_0x193c('0x4b')]({'name':_0x5adad1[_0x193c('0x2a')],'resourceId':_0x5adad1['id'],'type':_0x517857[_0x193c('0x2a')],'sectionId':_0x517857['id']},{})[_0x193c('0x23')](function(){return _0x58baef;});}else{return _0x58baef;}})[_0x193c('0x46')](function(_0x5bf171){logger[_0x193c('0x28')](_0x193c('0x54'),_0x5bf171);throw _0x5bf171;});}return _0x58baef;})[_0x193c('0x23')](respondWithResult(_0x2a7efe,0xc9))['catch'](handleError(_0x2a7efe,null));};exports['update']=function(_0x4cb984,_0x48d8fd){if(_0x4cb984[_0x193c('0x4c')]['id']){delete _0x4cb984[_0x193c('0x4c')]['id'];}return db[_0x193c('0x2d')][_0x193c('0x4a')]({'where':{'id':_0x4cb984['params']['id']}})[_0x193c('0x23')](handleEntityNotFound(_0x48d8fd,null))[_0x193c('0x23')](saveUpdates(_0x4cb984[_0x193c('0x4c')],null))[_0x193c('0x23')](respondWithResult(_0x48d8fd,null))['catch'](handleError(_0x48d8fd,null));};exports['destroy']=function(_0x454bce,_0x368af7){return db[_0x193c('0x2d')][_0x193c('0x4a')]({'where':{'id':_0x454bce[_0x193c('0x48')]['id']}})[_0x193c('0x23')](handleEntityNotFound(_0x368af7,null))[_0x193c('0x23')](removeEntity(_0x368af7,null))[_0x193c('0x46')](handleError(_0x368af7,null));};exports[_0x193c('0x55')]=function(_0x210c2a,_0x3bee0a,_0x469778){if(_0x210c2a['body']['id']){delete _0x210c2a['body']['id'];}return db['Interval'][_0x193c('0x4a')]({'where':{'id':_0x210c2a[_0x193c('0x48')]['id']}})[_0x193c('0x23')](handleEntityNotFound(_0x3bee0a,null))['then'](function(_0x37c1d0){if(_0x37c1d0){_0x210c2a[_0x193c('0x4c')][_0x193c('0x56')]=_0x37c1d0['id'];return db[_0x193c('0x2d')]['create'](_0x210c2a['body']);}})[_0x193c('0x23')](respondWithResult(_0x3bee0a,null))[_0x193c('0x46')](handleError(_0x3bee0a,null));};exports[_0x193c('0x57')]=function(_0x1f7811,_0xc795ed,_0x158161){var _0x4a5cbd={};var _0x12f2cf={};var _0x161afe;var _0x13bbeb;return db[_0x193c('0x2d')][_0x193c('0x58')]({'where':{'id':_0x1f7811[_0x193c('0x48')]['id']}})[_0x193c('0x23')](handleEntityNotFound(_0xc795ed,null))[_0x193c('0x23')](function(_0x141578){if(_0x141578){_0x161afe=_0x141578;_0x12f2cf['model']=_[_0x193c('0x34')](db[_0x193c('0x2d')][_0x193c('0x2e')]);_0x12f2cf['query']=_['keys'](_0x1f7811[_0x193c('0x33')]);_0x12f2cf['filters']=_[_0x193c('0x36')](_0x12f2cf['model'],_0x12f2cf[_0x193c('0x33')]);_0x4a5cbd[_0x193c('0x37')]=_['intersection'](_0x12f2cf[_0x193c('0x32')],qs[_0x193c('0x38')](_0x1f7811[_0x193c('0x33')][_0x193c('0x38')]));_0x4a5cbd[_0x193c('0x37')]=_0x4a5cbd['attributes']['length']?_0x4a5cbd[_0x193c('0x37')]:_0x12f2cf[_0x193c('0x32')];_0x4a5cbd[_0x193c('0x3b')]=qs['sort'](_0x1f7811['query'][_0x193c('0x3c')]);_0x4a5cbd['where']=qs['filters'](_[_0x193c('0x3d')](_0x1f7811['query'],_0x12f2cf[_0x193c('0x35')]));if(_0x1f7811[_0x193c('0x33')][_0x193c('0x3e')]){_0x4a5cbd['where']=_[_0x193c('0x41')](_0x4a5cbd['where'],{'$or':_[_0x193c('0x40')](_0x4a5cbd[_0x193c('0x37')],function(_0x239e7a){var _0x915caf={};_0x915caf[_0x239e7a]={'$like':'%'+_0x1f7811['query'][_0x193c('0x3e')]+'%'};return _0x915caf;})});}_0x4a5cbd=_[_0x193c('0x41')]({},_0x4a5cbd,_0x1f7811[_0x193c('0x49')]);return _0x161afe['getIntervals'](_0x4a5cbd);}})[_0x193c('0x23')](function(_0xef5c7){if(_0xef5c7){_0x13bbeb=_0xef5c7[_0x193c('0x59')];if(!_0x1f7811[_0x193c('0x33')][_0x193c('0x39')](_0x193c('0x3a'))){_0x4a5cbd[_0x193c('0x1c')]=qs[_0x193c('0x1c')](_0x1f7811[_0x193c('0x33')][_0x193c('0x1c')]);_0x4a5cbd[_0x193c('0x19')]=qs['offset'](_0x1f7811[_0x193c('0x33')][_0x193c('0x19')]);}return _0x161afe[_0x193c('0x57')](_0x4a5cbd);}})[_0x193c('0x23')](function(_0xdb65f3){if(_0xdb65f3){return _0xdb65f3?{'count':_0x13bbeb,'rows':_0xdb65f3}:null;}})[_0x193c('0x23')](respondWithResult(_0xc795ed,null))[_0x193c('0x46')](handleError(_0xc795ed,null));};exports['addIntervals']=function(_0x3234f2,_0x538637,_0x115872){return db['Interval'][_0x193c('0x58')]({'where':{'id':_0x3234f2['params']['id']}})[_0x193c('0x23')](handleEntityNotFound(_0x538637,null))[_0x193c('0x23')](function(_0x447b93){if(_0x447b93){return db[_0x193c('0x5a')][_0x193c('0x5b')](function(_0x5d4abd){return db[_0x193c('0x2d')][_0x193c('0x24')]({'where':{'IntervalId':_0x3234f2[_0x193c('0x48')]['id']},'transaction':_0x5d4abd})['then'](function(_0x49bb4e){var _0x35b865=_[_0x193c('0x40')](_0x3234f2[_0x193c('0x4c')],function(_0x2e4907){delete _0x2e4907['id'];_0x2e4907['IntervalId']=_0x3234f2[_0x193c('0x48')]['id'];return _0x2e4907;});return db['Interval'][_0x193c('0x5c')](_0x35b865,{'transaction':_0x5d4abd});});})[_0x193c('0x23')](function(){return db[_0x193c('0x2d')][_0x193c('0x44')]({'where':{'IntervalId':_0x3234f2[_0x193c('0x48')]['id']}});});}})[_0x193c('0x23')](respondWithResult(_0x538637,null))[_0x193c('0x46')](handleError(_0x538637,null));}; \ No newline at end of file +var _0x9304=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','apply','reject','save','destroy','then','get','Intervals','UserProfileResource','sendStatus','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','params','addInterval','IntervalId','findOne','order','pick','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra'];(function(_0x7f1120,_0x52d609){var _0xff9ab=function(_0x3d7f7d){while(--_0x3d7f7d){_0x7f1120['push'](_0x7f1120['shift']());}};_0xff9ab(++_0x52d609);}(_0x9304,0x1b5));var _0x4930=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9304[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4930('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4930('0x1'));var moment=require(_0x4930('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4930('0x3'));var util=require('util');var path=require(_0x4930('0x4'));var sox=require(_0x4930('0x5'));var csv=require('to-csv');var ejs=require(_0x4930('0x6'));var fs=require('fs');var fs_extra=require(_0x4930('0x7'));var _=require('lodash');var squel=require(_0x4930('0x8'));var crypto=require('crypto');var jsforce=require(_0x4930('0x9'));var deskjs=require(_0x4930('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4930('0xb'));var Papa=require('papaparse');var Redis=require(_0x4930('0xc'));var authService=require(_0x4930('0xd'));var qs=require(_0x4930('0xe'));var as=require(_0x4930('0xf'));var hardwareService=require(_0x4930('0x10'));var logger=require(_0x4930('0x11'))(_0x4930('0x12'));var utils=require('../../config/utils');var config=require(_0x4930('0x13'));var licenseUtil=require(_0x4930('0x14'));var db=require(_0x4930('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4999f0,_0x2c80d0){_0x2c80d0=_0x2c80d0||0xcc;return function(_0xcd4fc4){if(_0xcd4fc4){return _0x4999f0['sendStatus'](_0x2c80d0);}return _0x4999f0[_0x4930('0x16')](_0x2c80d0)[_0x4930('0x17')]();};}function respondWithResult(_0x1df175,_0x485dc9){_0x485dc9=_0x485dc9||0xc8;return function(_0x4c427b){if(_0x4c427b){return _0x1df175['status'](_0x485dc9)[_0x4930('0x18')](_0x4c427b);}};}function respondWithFilteredResult(_0x32c4da,_0x2869d5){return function(_0x1d68bf){if(_0x1d68bf){var _0x5b134b=typeof _0x2869d5[_0x4930('0x19')]==='undefined'&&typeof _0x2869d5['limit']===_0x4930('0x1a');var _0x3dc18f=_0x1d68bf[_0x4930('0x1b')];var _0x2b00d8=_0x5b134b?0x0:_0x2869d5[_0x4930('0x19')];var _0x34e755=_0x5b134b?_0x1d68bf['count']:_0x2869d5[_0x4930('0x19')]+_0x2869d5['limit'];var _0x1c540d;if(_0x34e755>=_0x3dc18f){_0x34e755=_0x3dc18f;_0x1c540d=0xc8;}else{_0x1c540d=0xce;}_0x32c4da[_0x4930('0x16')](_0x1c540d);return _0x32c4da['set']('Content-Range',_0x2b00d8+'-'+_0x34e755+'/'+_0x3dc18f)['json'](_0x1d68bf);}return null;};}function patchUpdates(_0x21ed9d){return function(_0x8c708){try{jsonpatch[_0x4930('0x1c')](_0x8c708,_0x21ed9d,!![]);}catch(_0x56828b){return BPromise[_0x4930('0x1d')](_0x56828b);}return _0x8c708[_0x4930('0x1e')]();};}function saveUpdates(_0x1ddb8c,_0x117f6f){return function(_0x2fdf48){if(_0x2fdf48){return _0x2fdf48['update'](_0x1ddb8c)['then'](function(_0x385a1b){return _0x385a1b;});}return null;};}function removeEntity(_0x1f5074,_0x42a153){return function(_0x205b20){if(_0x205b20){return _0x205b20[_0x4930('0x1f')]()[_0x4930('0x20')](function(){var _0x597092=_0x205b20[_0x4930('0x21')]({'plain':!![]});var _0x499ac3=_0x4930('0x22');return db[_0x4930('0x23')][_0x4930('0x1f')]({'where':{'type':_0x499ac3,'resourceId':_0x597092['id']}})[_0x4930('0x20')](function(){return _0x205b20;});})[_0x4930('0x20')](function(){_0x1f5074[_0x4930('0x16')](0xcc)[_0x4930('0x17')]();});}};}function handleEntityNotFound(_0xe3681,_0x4ea1f1){return function(_0x1267d6){if(!_0x1267d6){_0xe3681[_0x4930('0x24')](0x194);}return _0x1267d6;};}function handleError(_0x220ef0,_0x25ec0e){_0x25ec0e=_0x25ec0e||0x1f4;return function(_0x932e31){logger[_0x4930('0x25')](_0x932e31[_0x4930('0x26')]);if(_0x932e31[_0x4930('0x27')]){delete _0x932e31[_0x4930('0x27')];}_0x220ef0[_0x4930('0x16')](_0x25ec0e)[_0x4930('0x28')](_0x932e31);};}exports[_0x4930('0x29')]=function(_0x244045,_0x22ad32){var _0x37bf92={},_0x55e9f6={},_0x5665bf={'count':0x0,'rows':[]};var _0x33205c=_[_0x4930('0x2a')](db[_0x4930('0x2b')][_0x4930('0x2c')],function(_0x30333d){return{'name':_0x30333d[_0x4930('0x2d')],'type':_0x30333d['type'][_0x4930('0x2e')]};});_0x55e9f6[_0x4930('0x2f')]=_['map'](_0x33205c,_0x4930('0x27'));_0x55e9f6['query']=_['keys'](_0x244045['query']);_0x55e9f6['filters']=_[_0x4930('0x30')](_0x55e9f6[_0x4930('0x2f')],_0x55e9f6[_0x4930('0x31')]);_0x37bf92[_0x4930('0x32')]=_['intersection'](_0x55e9f6['model'],qs[_0x4930('0x33')](_0x244045[_0x4930('0x31')][_0x4930('0x33')]));_0x37bf92[_0x4930('0x32')]=_0x37bf92[_0x4930('0x32')][_0x4930('0x34')]?_0x37bf92[_0x4930('0x32')]:_0x55e9f6[_0x4930('0x2f')];if(!_0x244045[_0x4930('0x31')][_0x4930('0x35')](_0x4930('0x36'))){_0x37bf92[_0x4930('0x37')]=qs['limit'](_0x244045[_0x4930('0x31')][_0x4930('0x37')]);_0x37bf92['offset']=qs['offset'](_0x244045['query'][_0x4930('0x19')]);}_0x37bf92['order']=qs[_0x4930('0x38')](_0x244045[_0x4930('0x31')][_0x4930('0x38')]);_0x37bf92[_0x4930('0x39')]=qs[_0x4930('0x3a')](_['pick'](_0x244045[_0x4930('0x31')],_0x55e9f6[_0x4930('0x3a')]),_0x33205c);if(_0x244045[_0x4930('0x31')][_0x4930('0x3b')]){_0x37bf92[_0x4930('0x39')]=_[_0x4930('0x3c')](_0x37bf92['where'],{'$or':_['map'](_0x33205c,function(_0x63e70c){if(_0x63e70c[_0x4930('0x3d')]!=='VIRTUAL'){var _0x315304={};_0x315304[_0x63e70c[_0x4930('0x27')]]={'$like':'%'+_0x244045['query'][_0x4930('0x3b')]+'%'};return _0x315304;}})});}_0x37bf92=_[_0x4930('0x3c')]({},_0x37bf92,_0x244045[_0x4930('0x3e')]);var _0x3f9fd2={'where':_0x37bf92[_0x4930('0x39')]};return db[_0x4930('0x2b')][_0x4930('0x1b')](_0x3f9fd2)[_0x4930('0x20')](function(_0x250248){_0x5665bf['count']=_0x250248;if(_0x244045[_0x4930('0x31')][_0x4930('0x3f')]){_0x37bf92[_0x4930('0x40')]=[{'all':!![]}];}return db['Interval'][_0x4930('0x41')](_0x37bf92);})['then'](function(_0x4b59fd){_0x5665bf['rows']=_0x4b59fd;return _0x5665bf;})[_0x4930('0x20')](respondWithFilteredResult(_0x22ad32,_0x37bf92))[_0x4930('0x42')](handleError(_0x22ad32,null));};exports[_0x4930('0x43')]=function(_0xee597c,_0x5d34a6){var _0x544b7b={'raw':!![],'where':{'id':_0xee597c['params']['id']}},_0xe8d7b6={};_0xe8d7b6[_0x4930('0x2f')]=_[_0x4930('0x44')](db['Interval']['rawAttributes']);_0xe8d7b6['query']=_[_0x4930('0x44')](_0xee597c[_0x4930('0x31')]);_0xe8d7b6['filters']=_['intersection'](_0xe8d7b6[_0x4930('0x2f')],_0xe8d7b6['query']);_0x544b7b[_0x4930('0x32')]=_['intersection'](_0xe8d7b6['model'],qs[_0x4930('0x33')](_0xee597c[_0x4930('0x31')][_0x4930('0x33')]));_0x544b7b[_0x4930('0x32')]=_0x544b7b['attributes']['length']?_0x544b7b[_0x4930('0x32')]:_0xe8d7b6[_0x4930('0x2f')];if(_0xee597c[_0x4930('0x31')][_0x4930('0x3f')]){_0x544b7b[_0x4930('0x40')]=[{'all':!![]}];}_0x544b7b=_[_0x4930('0x3c')]({},_0x544b7b,_0xee597c['options']);return db[_0x4930('0x2b')]['find'](_0x544b7b)['then'](handleEntityNotFound(_0x5d34a6,null))[_0x4930('0x20')](respondWithResult(_0x5d34a6,null))[_0x4930('0x42')](handleError(_0x5d34a6,null));};exports[_0x4930('0x45')]=function(_0x456bfe,_0x590c7b){return db[_0x4930('0x2b')][_0x4930('0x45')](_0x456bfe[_0x4930('0x46')],{})[_0x4930('0x20')](function(_0x5d7226){var _0x584709=_0x456bfe[_0x4930('0x47')][_0x4930('0x21')]({'plain':!![]});if(!_0x584709)throw new Error(_0x4930('0x48'));if(_0x584709[_0x4930('0x49')]===_0x4930('0x47')){var _0x255a68=_0x5d7226[_0x4930('0x21')]({'plain':!![]});var _0x17b461='Intervals';return db[_0x4930('0x4a')][_0x4930('0x4b')]({'where':{'name':_0x17b461,'userProfileId':_0x584709[_0x4930('0x4c')]},'raw':!![]})[_0x4930('0x20')](function(_0x1f7142){if(_0x1f7142&&_0x1f7142['autoAssociation']===0x0){return db[_0x4930('0x23')]['create']({'name':_0x255a68[_0x4930('0x27')],'resourceId':_0x255a68['id'],'type':_0x1f7142[_0x4930('0x27')],'sectionId':_0x1f7142['id']},{})[_0x4930('0x20')](function(){return _0x5d7226;});}else{return _0x5d7226;}})[_0x4930('0x42')](function(_0x115cc){logger[_0x4930('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x115cc);throw _0x115cc;});}return _0x5d7226;})['then'](respondWithResult(_0x590c7b,0xc9))[_0x4930('0x42')](handleError(_0x590c7b,null));};exports[_0x4930('0x4d')]=function(_0x355f40,_0x15b864){if(_0x355f40[_0x4930('0x46')]['id']){delete _0x355f40[_0x4930('0x46')]['id'];}return db[_0x4930('0x2b')]['find']({'where':{'id':_0x355f40[_0x4930('0x4e')]['id']}})[_0x4930('0x20')](handleEntityNotFound(_0x15b864,null))['then'](saveUpdates(_0x355f40[_0x4930('0x46')],null))[_0x4930('0x20')](respondWithResult(_0x15b864,null))[_0x4930('0x42')](handleError(_0x15b864,null));};exports[_0x4930('0x1f')]=function(_0xce006d,_0x426f60){return db['Interval'][_0x4930('0x4b')]({'where':{'id':_0xce006d[_0x4930('0x4e')]['id']}})[_0x4930('0x20')](handleEntityNotFound(_0x426f60,null))[_0x4930('0x20')](removeEntity(_0x426f60,null))[_0x4930('0x42')](handleError(_0x426f60,null));};exports[_0x4930('0x4f')]=function(_0x3a435c,_0x3e4fbe,_0x2c7aa8){if(_0x3a435c[_0x4930('0x46')]['id']){delete _0x3a435c[_0x4930('0x46')]['id'];}return db[_0x4930('0x2b')][_0x4930('0x4b')]({'where':{'id':_0x3a435c[_0x4930('0x4e')]['id']}})[_0x4930('0x20')](handleEntityNotFound(_0x3e4fbe,null))['then'](function(_0x11fa41){if(_0x11fa41){_0x3a435c['body'][_0x4930('0x50')]=_0x11fa41['id'];return db[_0x4930('0x2b')][_0x4930('0x45')](_0x3a435c[_0x4930('0x46')]);}})[_0x4930('0x20')](respondWithResult(_0x3e4fbe,null))[_0x4930('0x42')](handleError(_0x3e4fbe,null));};exports['getIntervals']=function(_0x49adf1,_0x38f8b9,_0x4bffd9){var _0xbcb7de={};var _0x1b03de={};var _0x1aa1aa;var _0x12c856;return db[_0x4930('0x2b')][_0x4930('0x51')]({'where':{'id':_0x49adf1[_0x4930('0x4e')]['id']}})[_0x4930('0x20')](handleEntityNotFound(_0x38f8b9,null))[_0x4930('0x20')](function(_0xca7e71){if(_0xca7e71){_0x1aa1aa=_0xca7e71;_0x1b03de[_0x4930('0x2f')]=_[_0x4930('0x44')](db[_0x4930('0x2b')][_0x4930('0x2c')]);_0x1b03de[_0x4930('0x31')]=_[_0x4930('0x44')](_0x49adf1[_0x4930('0x31')]);_0x1b03de['filters']=_[_0x4930('0x30')](_0x1b03de[_0x4930('0x2f')],_0x1b03de[_0x4930('0x31')]);_0xbcb7de[_0x4930('0x32')]=_[_0x4930('0x30')](_0x1b03de[_0x4930('0x2f')],qs[_0x4930('0x33')](_0x49adf1[_0x4930('0x31')][_0x4930('0x33')]));_0xbcb7de[_0x4930('0x32')]=_0xbcb7de[_0x4930('0x32')][_0x4930('0x34')]?_0xbcb7de[_0x4930('0x32')]:_0x1b03de[_0x4930('0x2f')];_0xbcb7de[_0x4930('0x52')]=qs[_0x4930('0x38')](_0x49adf1[_0x4930('0x31')][_0x4930('0x38')]);_0xbcb7de[_0x4930('0x39')]=qs[_0x4930('0x3a')](_[_0x4930('0x53')](_0x49adf1[_0x4930('0x31')],_0x1b03de[_0x4930('0x3a')]));if(_0x49adf1[_0x4930('0x31')][_0x4930('0x3b')]){_0xbcb7de[_0x4930('0x39')]=_[_0x4930('0x3c')](_0xbcb7de['where'],{'$or':_['map'](_0xbcb7de[_0x4930('0x32')],function(_0x841c29){var _0x3ae83e={};_0x3ae83e[_0x841c29]={'$like':'%'+_0x49adf1[_0x4930('0x31')][_0x4930('0x3b')]+'%'};return _0x3ae83e;})});}_0xbcb7de=_[_0x4930('0x3c')]({},_0xbcb7de,_0x49adf1[_0x4930('0x3e')]);return _0x1aa1aa['getIntervals'](_0xbcb7de);}})[_0x4930('0x20')](function(_0x47377c){if(_0x47377c){_0x12c856=_0x47377c[_0x4930('0x34')];if(!_0x49adf1[_0x4930('0x31')][_0x4930('0x35')](_0x4930('0x36'))){_0xbcb7de[_0x4930('0x37')]=qs[_0x4930('0x37')](_0x49adf1[_0x4930('0x31')][_0x4930('0x37')]);_0xbcb7de['offset']=qs[_0x4930('0x19')](_0x49adf1[_0x4930('0x31')][_0x4930('0x19')]);}return _0x1aa1aa[_0x4930('0x54')](_0xbcb7de);}})[_0x4930('0x20')](function(_0x191052){if(_0x191052){return _0x191052?{'count':_0x12c856,'rows':_0x191052}:null;}})['then'](respondWithResult(_0x38f8b9,null))['catch'](handleError(_0x38f8b9,null));};exports[_0x4930('0x55')]=function(_0xdf41cf,_0x36c2aa,_0x5e02c0){return db['Interval']['findOne']({'where':{'id':_0xdf41cf[_0x4930('0x4e')]['id']}})['then'](handleEntityNotFound(_0x36c2aa,null))['then'](function(_0x1013a3){if(_0x1013a3){return db[_0x4930('0x56')][_0x4930('0x57')](function(_0x3ff21c){return db[_0x4930('0x2b')][_0x4930('0x1f')]({'where':{'IntervalId':_0xdf41cf[_0x4930('0x4e')]['id']},'transaction':_0x3ff21c})[_0x4930('0x20')](function(_0x1fe60c){var _0x1849e5=_[_0x4930('0x2a')](_0xdf41cf[_0x4930('0x46')],function(_0xe88273){delete _0xe88273['id'];_0xe88273[_0x4930('0x50')]=_0xdf41cf[_0x4930('0x4e')]['id'];return _0xe88273;});return db[_0x4930('0x2b')][_0x4930('0x58')](_0x1849e5,{'transaction':_0x3ff21c});});})['then'](function(){return db[_0x4930('0x2b')][_0x4930('0x41')]({'where':{'IntervalId':_0xdf41cf[_0x4930('0x4e')]['id']}});});}})[_0x4930('0x20')](respondWithResult(_0x36c2aa,null))['catch'](handleError(_0x36c2aa,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index d9b627c..7e694b5 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 _0x3ed4=['Interval','tools_intervals','rewrite','lodash','../../config/logger','api','path','rimraf','../../config/environment','define'];(function(_0x50953e,_0x39fb47){var _0x396fa0=function(_0x30754c){while(--_0x30754c){_0x50953e['push'](_0x50953e['shift']());}};_0x396fa0(++_0x39fb47);}(_0x3ed4,0xdf));var _0x43ed=function(_0x34ef08,_0x3490fc){_0x34ef08=_0x34ef08-0x0;var _0x161a4f=_0x3ed4[_0x34ef08];return _0x161a4f;};'use strict';var _=require(_0x43ed('0x0'));var util=require('util');var logger=require(_0x43ed('0x1'))(_0x43ed('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43ed('0x3'));var rimraf=require(_0x43ed('0x4'));var config=require(_0x43ed('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x407a0e,_0xb3c745){return _0x407a0e[_0x43ed('0x6')](_0x43ed('0x7'),attributes,{'tableName':_0x43ed('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4edcab,_0x19535c){extensions[_0x43ed('0x9')](_0x407a0e,_0x4edcab);},'afterBulkCreate':function(_0x5d655c,_0x40afa6,_0x286ccf){_0x286ccf();extensions['rewrite'](_0x407a0e,_0x5d655c[0x0]);},'afterUpdate':function(_0x222cff,_0x23d12f){extensions['rewrite'](_0x407a0e,_0x222cff);},'afterDestroy':function(_0x129579,_0x17a972){extensions[_0x43ed('0x9')](_0x407a0e,_0x129579);}}});}; \ No newline at end of file +var _0x941b=['define','Interval','rewrite','lodash','util','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x3def1b,_0x56f748){var _0x57340e=function(_0x1e1949){while(--_0x1e1949){_0x3def1b['push'](_0x3def1b['shift']());}};_0x57340e(++_0x56f748);}(_0x941b,0xab));var _0xb941=function(_0x194507,_0x446bcb){_0x194507=_0x194507-0x0;var _0x4ce0ad=_0x941b[_0x194507];return _0x4ce0ad;};'use strict';var _=require(_0xb941('0x0'));var util=require(_0xb941('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb941('0x2'));var rp=require(_0xb941('0x3'));var fs=require('fs');var path=require(_0xb941('0x4'));var rimraf=require('rimraf');var config=require(_0xb941('0x5'));var attributes=require(_0xb941('0x6'));var extensions=require(_0xb941('0x7'));module[_0xb941('0x8')]=function(_0x36a6a1,_0x1b06e8){return _0x36a6a1[_0xb941('0x9')](_0xb941('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x37be32,_0x57b055){extensions[_0xb941('0xb')](_0x36a6a1,_0x37be32);},'afterBulkCreate':function(_0xf96c81,_0x43098b,_0x5f4d65){_0x5f4d65();extensions[_0xb941('0xb')](_0x36a6a1,_0xf96c81[0x0]);},'afterUpdate':function(_0x4fa725,_0x4b5c38){extensions[_0xb941('0xb')](_0x36a6a1,_0x4fa725);},'afterDestroy':function(_0x3bb80f,_0x1b5059){extensions[_0xb941('0xb')](_0x36a6a1,_0x3bb80f);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 944eefb..5fd16f5 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(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_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);});});}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 241c20f..2091e80 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0xa75f9a,_0x32a34f){var _0x2e1698=function(_0x816238){while(--_0x816238){_0xa75f9a['push'](_0xa75f9a['shift']());}};_0x2e1698(++_0x32a34f);}(_0xdb28,0x106));var _0x8db2=function(_0x3d939e,_0xc887){_0x3d939e=_0x3d939e-0x0;var _0x47cf65=_0xdb28[_0x3d939e];return _0x47cf65;};'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 +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x193a6e,_0x45dd00){_0x193a6e=_0x193a6e-0x0;var _0x599a9b=_0x0b0e[_0x193a6e];return _0x599a9b;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6d827ba..0bdfb1f 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 _0x1c77=['headers','x-forwarded-for','connection','remoteAddress','socket','https','api','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body'];(function(_0x5348dd,_0x14d931){var _0x41536a=function(_0x44e9ac){while(--_0x44e9ac){_0x5348dd['push'](_0x5348dd['shift']());}};_0x41536a(++_0x14d931);}(_0x1c77,0x1e5));var _0x71c7=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x1c77[_0x519756];return _0x37047e;};'use strict';var BPromise=require('bluebird');var https=require(_0x71c7('0x0'));var logger=require('../../config/logger')(_0x71c7('0x1'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0xcda29d,_0x16d39c){var _0x4a6c21={'fields':{'project':{'key':_0xcda29d[_0x71c7('0x2')]||_0x71c7('0x3')},'summary':(_0xcda29d[_0x71c7('0x4')]||_0x71c7('0x5'))+_0x71c7('0x6')+_0xcda29d['ip'],'description':_0xcda29d[_0x71c7('0x7')]||JSON[_0x71c7('0x8')](_0xcda29d),'issuetype':{'name':_0xcda29d[_0x71c7('0x9')]||_0x71c7('0xa')}}};_0x4a6c21[_0x71c7('0xb')]['customfield_11500']=_0xcda29d[_0x71c7('0xc')];_0x4a6c21[_0x71c7('0xb')][_0x71c7('0xd')]=_0xcda29d[_0x71c7('0xe')];_0x4a6c21[_0x71c7('0xb')][_0x71c7('0xf')]=_0xcda29d[_0x71c7('0x10')];_0x4a6c21[_0x71c7('0xb')][_0x71c7('0x11')]=_0xcda29d[_0x71c7('0x12')];_0x4a6c21[_0x71c7('0xb')]['customfield_11504']=_0xcda29d[_0x71c7('0x13')];_0x4a6c21[_0x71c7('0xb')][_0x71c7('0x14')]=_0xcda29d['ip'];var _0x44c295={'host':_0x71c7('0x15'),'port':0x1bb,'path':_0x71c7('0x16'),'method':_0x71c7('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x71c7('0x18'),'Authorization':_0x71c7('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x71c7('0x1a')](_0x71c7('0x1b'))}};var _0x1d6c86=JSON[_0x71c7('0x8')](_0x4a6c21);var _0x588de0=https[_0x71c7('0x1c')](_0x44c295,function(_0x42dffd){_0x42dffd[_0x71c7('0x1d')](_0x71c7('0x1e'));var _0x44c103='';_0x42dffd['on'](_0x71c7('0x1f'),function(_0x4451ea){_0x44c103+=_0x4451ea;});_0x42dffd['on'](_0x71c7('0x20'),function(){if(_0x16d39c){return _0x16d39c[_0x71c7('0x21')](_0x42dffd[_0x71c7('0x22')])[_0x71c7('0x23')](JSON[_0x71c7('0x24')](_0x44c103));}});});_0x588de0['on'](_0x71c7('0x25'),function(_0x401ce6){if(_0x16d39c){return _0x16d39c[_0x71c7('0x21')](0x1f4)[_0x71c7('0x23')]({'errors':[{'message':_0x71c7('0x26'),'type':_0x71c7('0x27')}]});}});_0x588de0[_0x71c7('0x28')](_0x1d6c86);_0x588de0['end']();}exports[_0x71c7('0x29')]=openIssue;exports['send']=function(_0x5d1e4a,_0xe98b1a){_0x5d1e4a[_0x71c7('0x2a')]['ip']=_0x5d1e4a[_0x71c7('0x2b')][_0x71c7('0x2c')]||_0x5d1e4a[_0x71c7('0x2d')][_0x71c7('0x2e')]||_0x5d1e4a['socket'][_0x71c7('0x2e')]||_0x5d1e4a[_0x71c7('0x2d')][_0x71c7('0x2f')][_0x71c7('0x2e')];return openIssue(_0x5d1e4a[_0x71c7('0x2a')],_0xe98b1a);}; \ No newline at end of file +var _0xbe85=['customfield_11501','customfield_11502','newToken','name','reason','customfield_10102','/rest/api/2/issue','toString','base64','setEncoding','utf8','end','status','statusCode','parse','error','json','write','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','stringify','fields','customfield_11500'];(function(_0x3992eb,_0x436c9e){var _0x32cab0=function(_0x73a918){while(--_0x73a918){_0x3992eb['push'](_0x3992eb['shift']());}};_0x32cab0(++_0x436c9e);}(_0xbe85,0xf7));var _0x5be8=function(_0xe52c3a,_0xc100c3){_0xe52c3a=_0xe52c3a-0x0;var _0x5a1297=_0xbe85[_0xe52c3a];return _0x5a1297;};'use strict';var BPromise=require(_0x5be8('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x5be8('0x1'));var USERNAME=_0x5be8('0x2');var PASSWORD=_0x5be8('0x3');function openIssue(_0x1a87fb,_0x463ead){var _0x5e9ca7={'fields':{'project':{'key':_0x1a87fb['key']||_0x5be8('0x4')},'summary':(_0x1a87fb[_0x5be8('0x5')]||_0x5be8('0x6'))+_0x5be8('0x7')+_0x1a87fb['ip'],'description':_0x1a87fb[_0x5be8('0x8')]||JSON[_0x5be8('0x9')](_0x1a87fb),'issuetype':{'name':_0x1a87fb['issuetype']||'Bug'}}};_0x5e9ca7[_0x5be8('0xa')][_0x5be8('0xb')]=_0x1a87fb['email'];_0x5e9ca7['fields'][_0x5be8('0xc')]=_0x1a87fb['oldToken'];_0x5e9ca7[_0x5be8('0xa')][_0x5be8('0xd')]=_0x1a87fb[_0x5be8('0xe')];_0x5e9ca7[_0x5be8('0xa')]['customfield_11503']=_0x1a87fb[_0x5be8('0xf')];_0x5e9ca7[_0x5be8('0xa')]['customfield_11504']=_0x1a87fb[_0x5be8('0x10')];_0x5e9ca7[_0x5be8('0xa')][_0x5be8('0x11')]=_0x1a87fb['ip'];var _0x444b0a={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x5be8('0x12'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x5be8('0x13')](_0x5be8('0x14'))}};var _0x2b0449=JSON['stringify'](_0x5e9ca7);var _0x1a4603=https['request'](_0x444b0a,function(_0x4b9391){_0x4b9391[_0x5be8('0x15')](_0x5be8('0x16'));var _0x525b0a='';_0x4b9391['on']('data',function(_0x4abf6a){_0x525b0a+=_0x4abf6a;});_0x4b9391['on'](_0x5be8('0x17'),function(){if(_0x463ead){return _0x463ead[_0x5be8('0x18')](_0x4b9391[_0x5be8('0x19')])['json'](JSON[_0x5be8('0x1a')](_0x525b0a));}});});_0x1a4603['on'](_0x5be8('0x1b'),function(_0x4079b2){if(_0x463ead){return _0x463ead[_0x5be8('0x18')](0x1f4)[_0x5be8('0x1c')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x1a4603[_0x5be8('0x1d')](_0x2b0449);_0x1a4603[_0x5be8('0x17')]();}exports[_0x5be8('0x1e')]=openIssue;exports[_0x5be8('0x1f')]=function(_0x394426,_0x49d852){_0x394426[_0x5be8('0x20')]['ip']=_0x394426['headers'][_0x5be8('0x21')]||_0x394426['connection'][_0x5be8('0x22')]||_0x394426[_0x5be8('0x23')][_0x5be8('0x22')]||_0x394426[_0x5be8('0x24')][_0x5be8('0x23')][_0x5be8('0x22')];return openIssue(_0x394426['body'],_0x49d852);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index ddb6c01..555cb65 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','show','post'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0x9c44=['update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put'];(function(_0xd427e9,_0x154151){var _0x223172=function(_0xf50b27){while(--_0xf50b27){_0xd427e9['push'](_0xd427e9['shift']());}};_0x223172(++_0x154151);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0xf')]);router['delete']('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 7e67715..914a088 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x58e9ff,_0x4a5348){_0x58e9ff=_0x58e9ff-0x0;var _0x7ad799=_0x7a54[_0x58e9ff];return _0x7ad799;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x305c03,_0x2755af){_0x305c03=_0x305c03-0x0;var _0x153e05=_0x7a54[_0x305c03];return _0x153e05;};'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 8c86440..7b04f79 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 _0xc949=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','rawAttributes','intersection','include','find','create','body','params','describe'];(function(_0x4a642b,_0x2068e9){var _0x26f9ed=function(_0x2cf506){while(--_0x2cf506){_0x4a642b['push'](_0x4a642b['shift']());}};_0x26f9ed(++_0x2068e9);}(_0xc949,0x181));var _0x9c94=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xc949[_0x2160a9];return _0xa88cf7;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require('path');var sox=require(_0x9c94('0x7'));var csv=require(_0x9c94('0x8'));var ejs=require(_0x9c94('0x9'));var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x8'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var licenseUtil=require(_0x9c94('0x19'));var db=require(_0x9c94('0x1a'))['db'];function respondWithStatusCode(_0x423adb,_0x30f64e){_0x30f64e=_0x30f64e||0xcc;return function(_0x1e326f){if(_0x1e326f){return _0x423adb[_0x9c94('0x1b')](_0x30f64e);}return _0x423adb[_0x9c94('0x1c')](_0x30f64e)[_0x9c94('0x1d')]();};}function respondWithResult(_0x15c51c,_0x54d956){_0x54d956=_0x54d956||0xc8;return function(_0x9789bc){if(_0x9789bc){return _0x15c51c['status'](_0x54d956)[_0x9c94('0x1e')](_0x9789bc);}};}function respondWithFilteredResult(_0x26e629,_0x4f0013){return function(_0xe52641){if(_0xe52641){var _0x4d6308=typeof _0x4f0013['offset']===_0x9c94('0x1f')&&typeof _0x4f0013['limit']===_0x9c94('0x1f');var _0x33bd19=_0xe52641['count'];var _0x201e04=_0x4d6308?0x0:_0x4f0013[_0x9c94('0x20')];var _0x412804=_0x4d6308?_0xe52641[_0x9c94('0x21')]:_0x4f0013[_0x9c94('0x20')]+_0x4f0013[_0x9c94('0x22')];var _0x3e361c;if(_0x412804>=_0x33bd19){_0x412804=_0x33bd19;_0x3e361c=0xc8;}else{_0x3e361c=0xce;}_0x26e629['status'](_0x3e361c);return _0x26e629[_0x9c94('0x23')](_0x9c94('0x24'),_0x201e04+'-'+_0x412804+'/'+_0x33bd19)['json'](_0xe52641);}return null;};}function patchUpdates(_0x141801){return function(_0x845304){try{jsonpatch[_0x9c94('0x25')](_0x845304,_0x141801,!![]);}catch(_0x326b38){return BPromise[_0x9c94('0x26')](_0x326b38);}return _0x845304[_0x9c94('0x27')]();};}function saveUpdates(_0xadab16,_0x23cdf5){return function(_0x8fe4fb){if(_0x8fe4fb){return _0x8fe4fb[_0x9c94('0x28')](_0xadab16)[_0x9c94('0x29')](function(_0xe9280a){return _0xe9280a;});}return null;};}function removeEntity(_0x44d732,_0x8c0b7f){return function(_0x5b1020){if(_0x5b1020){return _0x5b1020[_0x9c94('0x2a')]()[_0x9c94('0x29')](function(){_0x44d732['status'](0xcc)[_0x9c94('0x1d')]();});}};}function handleEntityNotFound(_0x2c3d25,_0x4795bb){return function(_0x335184){if(!_0x335184){_0x2c3d25[_0x9c94('0x1b')](0x194);}return _0x335184;};}function handleError(_0x4dd38e,_0xc18230){_0xc18230=_0xc18230||0x1f4;return function(_0x45cf4d){logger['error'](_0x45cf4d[_0x9c94('0x2b')]);if(_0x45cf4d['name']){delete _0x45cf4d[_0x9c94('0x2c')];}_0x4dd38e[_0x9c94('0x1c')](_0xc18230)[_0x9c94('0x2d')](_0x45cf4d);};}exports[_0x9c94('0x2e')]=function(_0x1581c0,_0x3f2622){var _0xf30dd1={},_0x561fdc={},_0x5a6b1c={'count':0x0,'rows':[]};var _0xc4a819=_[_0x9c94('0x2f')](db[_0x9c94('0x30')]['rawAttributes'],function(_0x25a6b9){return{'name':_0x25a6b9['fieldName'],'type':_0x25a6b9[_0x9c94('0x31')][_0x9c94('0x32')]};});_0x561fdc[_0x9c94('0x33')]=_['map'](_0xc4a819,'name');_0x561fdc[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x1581c0[_0x9c94('0x34')]);_0x561fdc['filters']=_['intersection'](_0x561fdc['model'],_0x561fdc['query']);_0xf30dd1[_0x9c94('0x36')]=_['intersection'](_0x561fdc[_0x9c94('0x33')],qs[_0x9c94('0x37')](_0x1581c0['query']['fields']));_0xf30dd1[_0x9c94('0x36')]=_0xf30dd1[_0x9c94('0x36')][_0x9c94('0x38')]?_0xf30dd1[_0x9c94('0x36')]:_0x561fdc[_0x9c94('0x33')];if(!_0x1581c0[_0x9c94('0x34')][_0x9c94('0x39')](_0x9c94('0x3a'))){_0xf30dd1[_0x9c94('0x22')]=qs[_0x9c94('0x22')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x22')]);_0xf30dd1[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x20')]);}_0xf30dd1[_0x9c94('0x3b')]=qs[_0x9c94('0x3c')](_0x1581c0['query'][_0x9c94('0x3c')]);_0xf30dd1[_0x9c94('0x3d')]=qs[_0x9c94('0x3e')](_[_0x9c94('0x3f')](_0x1581c0[_0x9c94('0x34')],_0x561fdc[_0x9c94('0x3e')]),_0xc4a819);if(_0x1581c0[_0x9c94('0x34')]['filter']){_0xf30dd1[_0x9c94('0x3d')]=_['merge'](_0xf30dd1[_0x9c94('0x3d')],{'$or':_[_0x9c94('0x2f')](_0xc4a819,function(_0x442d46){if(_0x442d46[_0x9c94('0x31')]!=='VIRTUAL'){var _0x245278={};_0x245278[_0x442d46['name']]={'$like':'%'+_0x1581c0[_0x9c94('0x34')][_0x9c94('0x40')]+'%'};return _0x245278;}})});}_0xf30dd1=_[_0x9c94('0x41')]({},_0xf30dd1,_0x1581c0['options']);var _0x21e9f7={'where':_0xf30dd1['where']};return db[_0x9c94('0x30')]['count'](_0x21e9f7)['then'](function(_0x9a75f0){_0x5a6b1c[_0x9c94('0x21')]=_0x9a75f0;if(_0x1581c0[_0x9c94('0x34')][_0x9c94('0x42')]){_0xf30dd1['include']=[{'all':!![]}];}return db[_0x9c94('0x30')][_0x9c94('0x43')](_0xf30dd1);})[_0x9c94('0x29')](function(_0x360960){_0x5a6b1c['rows']=_0x360960;return _0x5a6b1c;})[_0x9c94('0x29')](respondWithFilteredResult(_0x3f2622,_0xf30dd1))[_0x9c94('0x44')](handleError(_0x3f2622,null));};exports['show']=function(_0x24e74c,_0x3d8b31){var _0x2a5bd5={'raw':!![],'where':{'id':_0x24e74c['params']['id']}},_0x5e6a90={};_0x5e6a90[_0x9c94('0x33')]=_[_0x9c94('0x35')](db[_0x9c94('0x30')][_0x9c94('0x45')]);_0x5e6a90[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x24e74c[_0x9c94('0x34')]);_0x5e6a90[_0x9c94('0x3e')]=_[_0x9c94('0x46')](_0x5e6a90[_0x9c94('0x33')],_0x5e6a90[_0x9c94('0x34')]);_0x2a5bd5['attributes']=_[_0x9c94('0x46')](_0x5e6a90['model'],qs[_0x9c94('0x37')](_0x24e74c[_0x9c94('0x34')][_0x9c94('0x37')]));_0x2a5bd5[_0x9c94('0x36')]=_0x2a5bd5[_0x9c94('0x36')][_0x9c94('0x38')]?_0x2a5bd5[_0x9c94('0x36')]:_0x5e6a90['model'];if(_0x24e74c['query'][_0x9c94('0x42')]){_0x2a5bd5[_0x9c94('0x47')]=[{'all':!![]}];}_0x2a5bd5=_[_0x9c94('0x41')]({},_0x2a5bd5,_0x24e74c['options']);return db[_0x9c94('0x30')][_0x9c94('0x48')](_0x2a5bd5)['then'](handleEntityNotFound(_0x3d8b31,null))['then'](respondWithResult(_0x3d8b31,null))['catch'](handleError(_0x3d8b31,null));};exports['create']=function(_0x2b94e0,_0x5362f4){return db['JscriptyAnswerReport'][_0x9c94('0x49')](_0x2b94e0['body'],{})[_0x9c94('0x29')](respondWithResult(_0x5362f4,0xc9))[_0x9c94('0x44')](handleError(_0x5362f4,null));};exports[_0x9c94('0x28')]=function(_0x205f51,_0x22eaa4){if(_0x205f51['body']['id']){delete _0x205f51[_0x9c94('0x4a')]['id'];}return db[_0x9c94('0x30')][_0x9c94('0x48')]({'where':{'id':_0x205f51[_0x9c94('0x4b')]['id']}})[_0x9c94('0x29')](handleEntityNotFound(_0x22eaa4,null))[_0x9c94('0x29')](saveUpdates(_0x205f51['body'],null))[_0x9c94('0x29')](respondWithResult(_0x22eaa4,null))['catch'](handleError(_0x22eaa4,null));};exports[_0x9c94('0x2a')]=function(_0x38bb48,_0x426c0f){return db['JscriptyAnswerReport'][_0x9c94('0x48')]({'where':{'id':_0x38bb48[_0x9c94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426c0f,null))[_0x9c94('0x29')](removeEntity(_0x426c0f,null))['catch'](handleError(_0x426c0f,null));};exports[_0x9c94('0x4c')]=function(_0x3aa1dd,_0x537c78){return db['JscriptyAnswerReport'][_0x9c94('0x4c')]()['then'](respondWithResult(_0x537c78,null))[_0x9c94('0x44')](handleError(_0x537c78,null));}; \ No newline at end of file +var _0x5785=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5785,0x119));var _0x5578=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x5785[_0x369151];return _0x4292d5;};'use strict';var emlformat=require(_0x5578('0x0'));var rimraf=require(_0x5578('0x1'));var zipdir=require(_0x5578('0x2'));var jsonpatch=require(_0x5578('0x3'));var rp=require(_0x5578('0x4'));var moment=require('moment');var BPromise=require(_0x5578('0x5'));var Mustache=require(_0x5578('0x6'));var util=require(_0x5578('0x7'));var path=require(_0x5578('0x8'));var sox=require(_0x5578('0x9'));var csv=require(_0x5578('0xa'));var ejs=require(_0x5578('0xb'));var fs=require('fs');var fs_extra=require(_0x5578('0xc'));var _=require(_0x5578('0xd'));var squel=require(_0x5578('0xe'));var crypto=require('crypto');var jsforce=require(_0x5578('0xf'));var deskjs=require(_0x5578('0x10'));var toCsv=require(_0x5578('0xa'));var querystring=require('querystring');var Papa=require(_0x5578('0x11'));var Redis=require('ioredis');var authService=require(_0x5578('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5578('0x13'));var hardwareService=require(_0x5578('0x14'));var logger=require(_0x5578('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5578('0x16'));var licenseUtil=require(_0x5578('0x17'));var db=require(_0x5578('0x18'))['db'];function respondWithStatusCode(_0x1506ac,_0x4592df){_0x4592df=_0x4592df||0xcc;return function(_0xa355d3){if(_0xa355d3){return _0x1506ac[_0x5578('0x19')](_0x4592df);}return _0x1506ac[_0x5578('0x1a')](_0x4592df)[_0x5578('0x1b')]();};}function respondWithResult(_0x34bacc,_0x4f6d2a){_0x4f6d2a=_0x4f6d2a||0xc8;return function(_0xe7ea50){if(_0xe7ea50){return _0x34bacc[_0x5578('0x1a')](_0x4f6d2a)[_0x5578('0x1c')](_0xe7ea50);}};}function respondWithFilteredResult(_0x21df98,_0x44ef23){return function(_0xb8e9c8){if(_0xb8e9c8){var _0x3fa05b=typeof _0x44ef23[_0x5578('0x1d')]===_0x5578('0x1e')&&typeof _0x44ef23[_0x5578('0x1f')]==='undefined';var _0x24b5b1=_0xb8e9c8[_0x5578('0x20')];var _0x5db57a=_0x3fa05b?0x0:_0x44ef23['offset'];var _0x3826b9=_0x3fa05b?_0xb8e9c8[_0x5578('0x20')]:_0x44ef23['offset']+_0x44ef23[_0x5578('0x1f')];var _0x2021b6;if(_0x3826b9>=_0x24b5b1){_0x3826b9=_0x24b5b1;_0x2021b6=0xc8;}else{_0x2021b6=0xce;}_0x21df98[_0x5578('0x1a')](_0x2021b6);return _0x21df98[_0x5578('0x21')](_0x5578('0x22'),_0x5db57a+'-'+_0x3826b9+'/'+_0x24b5b1)[_0x5578('0x1c')](_0xb8e9c8);}return null;};}function patchUpdates(_0x3dfadd){return function(_0x3a6b68){try{jsonpatch[_0x5578('0x23')](_0x3a6b68,_0x3dfadd,!![]);}catch(_0x38d06f){return BPromise[_0x5578('0x24')](_0x38d06f);}return _0x3a6b68[_0x5578('0x25')]();};}function saveUpdates(_0x2542eb,_0x10dd37){return function(_0x5d0a54){if(_0x5d0a54){return _0x5d0a54[_0x5578('0x26')](_0x2542eb)['then'](function(_0x208952){return _0x208952;});}return null;};}function removeEntity(_0x2d57b5,_0x394421){return function(_0x199853){if(_0x199853){return _0x199853[_0x5578('0x27')]()[_0x5578('0x28')](function(){_0x2d57b5['status'](0xcc)[_0x5578('0x1b')]();});}};}function handleEntityNotFound(_0x5d2c0c,_0x4c4d89){return function(_0x16cea){if(!_0x16cea){_0x5d2c0c['sendStatus'](0x194);}return _0x16cea;};}function handleError(_0x1d1861,_0x43adbd){_0x43adbd=_0x43adbd||0x1f4;return function(_0x2a752e){logger['error'](_0x2a752e[_0x5578('0x29')]);if(_0x2a752e[_0x5578('0x2a')]){delete _0x2a752e['name'];}_0x1d1861['status'](_0x43adbd)[_0x5578('0x2b')](_0x2a752e);};}exports[_0x5578('0x2c')]=function(_0x807da6,_0x25fb3b){var _0x44f200={},_0x593423={},_0x2d28d5={'count':0x0,'rows':[]};var _0xbe03a3=_[_0x5578('0x2d')](db[_0x5578('0x2e')][_0x5578('0x2f')],function(_0xe44d1b){return{'name':_0xe44d1b[_0x5578('0x30')],'type':_0xe44d1b[_0x5578('0x31')]['key']};});_0x593423['model']=_['map'](_0xbe03a3,_0x5578('0x2a'));_0x593423['query']=_['keys'](_0x807da6[_0x5578('0x32')]);_0x593423['filters']=_[_0x5578('0x33')](_0x593423[_0x5578('0x34')],_0x593423[_0x5578('0x32')]);_0x44f200[_0x5578('0x35')]=_['intersection'](_0x593423[_0x5578('0x34')],qs[_0x5578('0x36')](_0x807da6[_0x5578('0x32')][_0x5578('0x36')]));_0x44f200['attributes']=_0x44f200[_0x5578('0x35')][_0x5578('0x37')]?_0x44f200[_0x5578('0x35')]:_0x593423['model'];if(!_0x807da6[_0x5578('0x32')][_0x5578('0x38')]('nolimit')){_0x44f200[_0x5578('0x1f')]=qs['limit'](_0x807da6[_0x5578('0x32')][_0x5578('0x1f')]);_0x44f200['offset']=qs[_0x5578('0x1d')](_0x807da6[_0x5578('0x32')][_0x5578('0x1d')]);}_0x44f200[_0x5578('0x39')]=qs['sort'](_0x807da6[_0x5578('0x32')][_0x5578('0x3a')]);_0x44f200[_0x5578('0x3b')]=qs[_0x5578('0x3c')](_['pick'](_0x807da6[_0x5578('0x32')],_0x593423[_0x5578('0x3c')]),_0xbe03a3);if(_0x807da6[_0x5578('0x32')]['filter']){_0x44f200[_0x5578('0x3b')]=_['merge'](_0x44f200['where'],{'$or':_[_0x5578('0x2d')](_0xbe03a3,function(_0x2ee835){if(_0x2ee835[_0x5578('0x31')]!=='VIRTUAL'){var _0x55e2be={};_0x55e2be[_0x2ee835[_0x5578('0x2a')]]={'$like':'%'+_0x807da6[_0x5578('0x32')][_0x5578('0x3d')]+'%'};return _0x55e2be;}})});}_0x44f200=_[_0x5578('0x3e')]({},_0x44f200,_0x807da6[_0x5578('0x3f')]);var _0x5a3c64={'where':_0x44f200['where']};return db[_0x5578('0x2e')]['count'](_0x5a3c64)['then'](function(_0x2084a8){_0x2d28d5[_0x5578('0x20')]=_0x2084a8;if(_0x807da6[_0x5578('0x32')][_0x5578('0x40')]){_0x44f200['include']=[{'all':!![]}];}return db[_0x5578('0x2e')][_0x5578('0x41')](_0x44f200);})[_0x5578('0x28')](function(_0xade035){_0x2d28d5[_0x5578('0x42')]=_0xade035;return _0x2d28d5;})['then'](respondWithFilteredResult(_0x25fb3b,_0x44f200))[_0x5578('0x43')](handleError(_0x25fb3b,null));};exports[_0x5578('0x44')]=function(_0x535fdd,_0x410909){var _0x677d99={'raw':!![],'where':{'id':_0x535fdd['params']['id']}},_0x23ee49={};_0x23ee49[_0x5578('0x34')]=_[_0x5578('0x45')](db[_0x5578('0x2e')][_0x5578('0x2f')]);_0x23ee49['query']=_[_0x5578('0x45')](_0x535fdd[_0x5578('0x32')]);_0x23ee49[_0x5578('0x3c')]=_['intersection'](_0x23ee49['model'],_0x23ee49[_0x5578('0x32')]);_0x677d99[_0x5578('0x35')]=_['intersection'](_0x23ee49[_0x5578('0x34')],qs[_0x5578('0x36')](_0x535fdd[_0x5578('0x32')][_0x5578('0x36')]));_0x677d99[_0x5578('0x35')]=_0x677d99[_0x5578('0x35')][_0x5578('0x37')]?_0x677d99['attributes']:_0x23ee49['model'];if(_0x535fdd[_0x5578('0x32')][_0x5578('0x40')]){_0x677d99['include']=[{'all':!![]}];}_0x677d99=_['merge']({},_0x677d99,_0x535fdd[_0x5578('0x3f')]);return db[_0x5578('0x2e')][_0x5578('0x46')](_0x677d99)[_0x5578('0x28')](handleEntityNotFound(_0x410909,null))[_0x5578('0x28')](respondWithResult(_0x410909,null))[_0x5578('0x43')](handleError(_0x410909,null));};exports['create']=function(_0x5bb12c,_0x2ed4f9){return db[_0x5578('0x2e')][_0x5578('0x47')](_0x5bb12c[_0x5578('0x48')],{})[_0x5578('0x28')](respondWithResult(_0x2ed4f9,0xc9))[_0x5578('0x43')](handleError(_0x2ed4f9,null));};exports['update']=function(_0x1da278,_0x4da7bd){if(_0x1da278[_0x5578('0x48')]['id']){delete _0x1da278['body']['id'];}return db['JscriptyAnswerReport'][_0x5578('0x46')]({'where':{'id':_0x1da278[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x4da7bd,null))['then'](saveUpdates(_0x1da278[_0x5578('0x48')],null))[_0x5578('0x28')](respondWithResult(_0x4da7bd,null))[_0x5578('0x43')](handleError(_0x4da7bd,null));};exports[_0x5578('0x27')]=function(_0x4cc550,_0x34c9fd){return db[_0x5578('0x2e')]['find']({'where':{'id':_0x4cc550[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x34c9fd,null))['then'](removeEntity(_0x34c9fd,null))[_0x5578('0x43')](handleError(_0x34c9fd,null));};exports['describe']=function(_0x8fdb59,_0x205275){return db[_0x5578('0x2e')][_0x5578('0x4a')]()[_0x5578('0x28')](respondWithResult(_0x205275,null))[_0x5578('0x43')](handleError(_0x205275,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 19920ae..e486bca 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 _0x2dea=['request-promise','path','rimraf','../../config/environment','JscriptyAnswerReport','lodash','util','api','moment','bluebird'];(function(_0x46f4d6,_0x53ff34){var _0x58797e=function(_0x641d61){while(--_0x641d61){_0x46f4d6['push'](_0x46f4d6['shift']());}};_0x58797e(++_0x53ff34);}(_0x2dea,0x1b3));var _0xa2de=function(_0x546539,_0x44e2b2){_0x546539=_0x546539-0x0;var _0x3b2235=_0x2dea[_0x546539];return _0x3b2235;};'use strict';var _=require(_0xa2de('0x0'));var util=require(_0xa2de('0x1'));var logger=require('../../config/logger')(_0xa2de('0x2'));var moment=require(_0xa2de('0x3'));var BPromise=require(_0xa2de('0x4'));var rp=require(_0xa2de('0x5'));var fs=require('fs');var path=require(_0xa2de('0x6'));var rimraf=require(_0xa2de('0x7'));var config=require(_0xa2de('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x4ee2d8,_0x457a24){return _0x4ee2d8['define'](_0xa2de('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe24d=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7685a3,_0x1625a7){var _0x5b771b=function(_0x23982f){while(--_0x23982f){_0x7685a3['push'](_0x7685a3['shift']());}};_0x5b771b(++_0x1625a7);}(_0xe24d,0x1b7));var _0xde24=function(_0x536460,_0x3dc74a){_0x536460=_0x536460-0x0;var _0x478094=_0xe24d[_0x536460];return _0x478094;};'use strict';var _=require(_0xde24('0x0'));var util=require(_0xde24('0x1'));var logger=require(_0xde24('0x2'))('api');var moment=require(_0xde24('0x3'));var BPromise=require(_0xde24('0x4'));var rp=require(_0xde24('0x5'));var fs=require('fs');var path=require(_0xde24('0x6'));var rimraf=require(_0xde24('0x7'));var config=require(_0xde24('0x8'));var attributes=require(_0xde24('0x9'));module[_0xde24('0xa')]=function(_0x2431a4,_0x417b9b){return _0x2431a4[_0xde24('0xb')](_0xde24('0xc'),attributes,{'tableName':_0xde24('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 91afb39..95f5e72 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 _0x1a69=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise','client','then'];(function(_0x4f3416,_0xe4f03d){var _0x343471=function(_0x8ed357){while(--_0x8ed357){_0x4f3416['push'](_0x4f3416['shift']());}};_0x343471(++_0xe4f03d);}(_0x1a69,0x1ac));var _0x91a6=function(_0x421bc4,_0x75623e){_0x421bc4=_0x421bc4-0x0;var _0x1c1ba2=_0x1a69[_0x421bc4];return _0x1c1ba2;};'use strict';var _=require(_0x91a6('0x0'));var util=require(_0x91a6('0x1'));var moment=require(_0x91a6('0x2'));var BPromise=require(_0x91a6('0x3'));var rs=require(_0x91a6('0x4'));var fs=require('fs');var Redis=require(_0x91a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x91a6('0x6'));var client=jayson[_0x91a6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59d778,_0x551940,_0x518799){return new BPromise(function(_0x5558f4,_0x1d03a3){return client['request'](_0x59d778,_0x518799)[_0x91a6('0x8')](function(_0x3bb575){logger[_0x91a6('0x9')](_0x91a6('0xa'),_0x551940,_0x91a6('0xb'));logger[_0x91a6('0xc')](_0x91a6('0xd'),_0x551940,_0x91a6('0xb'),JSON[_0x91a6('0xe')](_0x3bb575));if(_0x3bb575[_0x91a6('0xf')]){if(_0x3bb575[_0x91a6('0xf')][_0x91a6('0x10')]===0x1f4){logger[_0x91a6('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x551940,_0x3bb575[_0x91a6('0xf')]['message']);return _0x1d03a3(_0x3bb575['error'][_0x91a6('0x11')]);}logger[_0x91a6('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x551940,_0x3bb575[_0x91a6('0xf')][_0x91a6('0x11')]);return _0x5558f4(_0x3bb575[_0x91a6('0xf')][_0x91a6('0x11')]);}else{logger[_0x91a6('0x9')](_0x91a6('0xa'),_0x551940,_0x91a6('0xb'));_0x5558f4(_0x3bb575['result'][_0x91a6('0x11')]);}})[_0x91a6('0x12')](function(_0x3e919b){logger[_0x91a6('0xf')](_0x91a6('0xa'),_0x551940,_0x3e919b);_0x1d03a3(_0x3e919b);});});} \ No newline at end of file +var _0x2d6d=['stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x2d6d,0x66));var _0xd2d6=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x2d6d[_0xdaab62];return _0x13d767;};'use strict';var _=require(_0xd2d6('0x0'));var util=require(_0xd2d6('0x1'));var moment=require(_0xd2d6('0x2'));var BPromise=require(_0xd2d6('0x3'));var rs=require(_0xd2d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd2d6('0x5'));var logger=require(_0xd2d6('0x6'))(_0xd2d6('0x7'));var config=require(_0xd2d6('0x8'));var jayson=require(_0xd2d6('0x9'));var client=jayson[_0xd2d6('0xa')][_0xd2d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24207a,_0x261c64,_0x4cef30){return new BPromise(function(_0x13e031,_0x4b93a6){return client[_0xd2d6('0xc')](_0x24207a,_0x4cef30)['then'](function(_0x4dec6e){logger[_0xd2d6('0xd')](_0xd2d6('0xe'),_0x261c64,_0xd2d6('0xf'));logger[_0xd2d6('0x10')](_0xd2d6('0x11'),_0x261c64,_0xd2d6('0xf'),JSON[_0xd2d6('0x12')](_0x4dec6e));if(_0x4dec6e['error']){if(_0x4dec6e['error'][_0xd2d6('0x13')]===0x1f4){logger[_0xd2d6('0x14')](_0xd2d6('0xe'),_0x261c64,_0x4dec6e[_0xd2d6('0x14')][_0xd2d6('0x15')]);return _0x4b93a6(_0x4dec6e[_0xd2d6('0x14')]['message']);}logger[_0xd2d6('0x14')](_0xd2d6('0xe'),_0x261c64,_0x4dec6e[_0xd2d6('0x14')][_0xd2d6('0x15')]);return _0x13e031(_0x4dec6e['error']['message']);}else{logger[_0xd2d6('0xd')](_0xd2d6('0xe'),_0x261c64,_0xd2d6('0xf'));_0x13e031(_0x4dec6e[_0xd2d6('0x16')][_0xd2d6('0x15')]);}})[_0xd2d6('0x17')](function(_0x58e05f){logger[_0xd2d6('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x261c64,_0x58e05f);_0x4b93a6(_0x58e05f);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 3620936..ee45f63 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 _0xd324=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','/:id','show','get','getSessions','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','update','exports','multer','util','path','express','Router'];(function(_0x2a0fb2,_0x107cb0){var _0x25cea8=function(_0x2f9774){while(--_0x2f9774){_0x2a0fb2['push'](_0x2a0fb2['shift']());}};_0x25cea8(++_0x107cb0);}(_0xd324,0x1c7));var _0x4d32=function(_0x4d7241,_0x32aa1f){_0x4d7241=_0x4d7241-0x0;var _0x59d9e2=_0xd324[_0x4d7241];return _0x59d9e2;};'use strict';var multer=require(_0x4d32('0x0'));var util=require(_0x4d32('0x1'));var path=require(_0x4d32('0x2'));var timeout=require('connect-timeout');var express=require(_0x4d32('0x3'));var router=express[_0x4d32('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4d32('0x5'));var interaction=require(_0x4d32('0x6'));var config=require(_0x4d32('0x7'));var controller=require(_0x4d32('0x8'));router['get']('/',auth[_0x4d32('0x9')](),controller['index']);router['get'](_0x4d32('0xa'),auth[_0x4d32('0x9')](),controller[_0x4d32('0xb')]);router[_0x4d32('0xc')]('/:id/sessions',auth[_0x4d32('0x9')](),controller[_0x4d32('0xd')]);router[_0x4d32('0xc')]('/:id/answers',auth['isAuthenticated'](),controller[_0x4d32('0xe')]);router[_0x4d32('0xc')](_0x4d32('0xf'),auth[_0x4d32('0x9')](),timeout('30s'),controller[_0x4d32('0x10')]);router[_0x4d32('0x11')]('/',auth[_0x4d32('0x9')](),controller[_0x4d32('0x12')]);router[_0x4d32('0x11')](_0x4d32('0x13'),auth[_0x4d32('0x9')](),controller[_0x4d32('0x14')]);router['put']('/:id',auth[_0x4d32('0x9')](),controller[_0x4d32('0x15')]);router['delete'](_0x4d32('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d32('0x16')]=router; \ No newline at end of file +var _0x12bf=['../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','getSessions','/:id/summary','getSummary','post','create','/:id/clone','put','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a09e9,_0x391256){var _0x5e4735=function(_0x23d780){while(--_0x23d780){_0x5a09e9['push'](_0x5a09e9['shift']());}};_0x5e4735(++_0x391256);}(_0x12bf,0x7e));var _0xf12b=function(_0x5a72f0,_0x1d9c39){_0x5a72f0=_0x5a72f0-0x0;var _0xae0fef=_0x12bf[_0x5a72f0];return _0xae0fef;};'use strict';var multer=require(_0xf12b('0x0'));var util=require('util');var path=require(_0xf12b('0x1'));var timeout=require('connect-timeout');var express=require(_0xf12b('0x2'));var router=express['Router']();var fs_extra=require(_0xf12b('0x3'));var auth=require(_0xf12b('0x4'));var interaction=require(_0xf12b('0x5'));var config=require(_0xf12b('0x6'));var controller=require(_0xf12b('0x7'));router['get']('/',auth[_0xf12b('0x8')](),controller[_0xf12b('0x9')]);router[_0xf12b('0xa')](_0xf12b('0xb'),auth[_0xf12b('0x8')](),controller[_0xf12b('0xc')]);router[_0xf12b('0xa')]('/:id/sessions',auth['isAuthenticated'](),controller[_0xf12b('0xd')]);router[_0xf12b('0xa')]('/:id/answers',auth[_0xf12b('0x8')](),controller['getAnswers']);router[_0xf12b('0xa')](_0xf12b('0xe'),auth[_0xf12b('0x8')](),timeout('30s'),controller[_0xf12b('0xf')]);router[_0xf12b('0x10')]('/',auth['isAuthenticated'](),controller[_0xf12b('0x11')]);router[_0xf12b('0x10')](_0xf12b('0x12'),auth[_0xf12b('0x8')](),controller['clone']);router[_0xf12b('0x13')](_0xf12b('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf12b('0x14')](_0xf12b('0xb'),auth[_0xf12b('0x8')](),controller[_0xf12b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 5250fc4..ff58726 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 _0xf1af=['format','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x3805e9,_0x33a4ed){var _0x207e20=function(_0x293840){while(--_0x293840){_0x3805e9['push'](_0x3805e9['shift']());}};_0x207e20(++_0x33a4ed);}(_0xf1af,0x19c));var _0xff1a=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0xf1af[_0x26da89];return _0xc95b7b;};'use strict';var Sequelize=require(_0xff1a('0x0'));var _=require(_0xff1a('0x1'));var util=require(_0xff1a('0x2'));module[_0xff1a('0x3')]={'name':{'type':Sequelize[_0xff1a('0x4')],'unique':_0xff1a('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xff1a('0x6')](_0xff1a('0x7')),'set':function(_0x5a1c04){if(_[_0xff1a('0x8')](_0x5a1c04)){this[_0xff1a('0x9')](_0xff1a('0xa'),JSON[_0xff1a('0xb')](_0x5a1c04));}else if(_[_0xff1a('0xc')](_0x5a1c04)){this['setDataValue']('formData',_0x5a1c04);}else{this['setDataValue'](_0xff1a('0xa'),util[_0xff1a('0xd')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xff1a('0xe')](_0xff1a('0x5'))||'',this[_0xff1a('0xe')](_0xff1a('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xff1a('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x11d4=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0x11d4,0xaf));var _0x411d=function(_0x128183,_0x1a4462){_0x128183=_0x128183-0x0;var _0x5b8e27=_0x11d4[_0x128183];return _0x5b8e27;};'use strict';var Sequelize=require(_0x411d('0x0'));var _=require(_0x411d('0x1'));var util=require('util');module[_0x411d('0x2')]={'name':{'type':Sequelize[_0x411d('0x3')],'unique':_0x411d('0x4')},'description':{'type':Sequelize[_0x411d('0x3')]},'formData':{'type':Sequelize[_0x411d('0x5')](_0x411d('0x6')),'set':function(_0x8f53ae){if(_[_0x411d('0x7')](_0x8f53ae)){this['setDataValue'](_0x411d('0x8'),JSON[_0x411d('0x9')](_0x8f53ae));}else if(_[_0x411d('0xa')](_0x8f53ae)){this[_0x411d('0xb')](_0x411d('0x8'),_0x8f53ae);}else{this['setDataValue']('formData',util[_0x411d('0xc')](_0x411d('0xd'),this['getDataValue'](_0x411d('0x4'))||'',this[_0x411d('0xe')](_0x411d('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x411d('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x411d('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 84a02f4..b03f255 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 _0x4d4b=['startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','sendStatus','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Projects','destroy','error','name','map','JscriptyProject','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','include','findAll','catch','show','params','create','body','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','options','omit','createdAt','updatedAt','autoAssociation','UserProfileResource','getSessions','findOne','JscriptySessionReport','pick','ProjectId','rows','JscriptyAnswerReport','number','toString','indexOf','getSummary'];(function(_0x40b9aa,_0x169044){var _0x5b795b=function(_0x36bd95){while(--_0x36bd95){_0x40b9aa['push'](_0x40b9aa['shift']());}};_0x5b795b(++_0x169044);}(_0x4d4b,0xf5));var _0xb4d4=function(_0x4df7c3,_0x15040c){_0x4df7c3=_0x4df7c3-0x0;var _0x5a3e28=_0x4d4b[_0x4df7c3];return _0x5a3e28;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb4d4('0x0'));var jsonpatch=require(_0xb4d4('0x1'));var rp=require(_0xb4d4('0x2'));var moment=require(_0xb4d4('0x3'));var BPromise=require(_0xb4d4('0x4'));var Mustache=require(_0xb4d4('0x5'));var util=require(_0xb4d4('0x6'));var path=require(_0xb4d4('0x7'));var sox=require(_0xb4d4('0x8'));var csv=require(_0xb4d4('0x9'));var ejs=require(_0xb4d4('0xa'));var fs=require('fs');var fs_extra=require(_0xb4d4('0xb'));var _=require(_0xb4d4('0xc'));var squel=require(_0xb4d4('0xd'));var crypto=require(_0xb4d4('0xe'));var jsforce=require(_0xb4d4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb4d4('0x9'));var querystring=require(_0xb4d4('0x10'));var Papa=require(_0xb4d4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb4d4('0x12'));var as=require(_0xb4d4('0x13'));var hardwareService=require(_0xb4d4('0x14'));var logger=require(_0xb4d4('0x15'))('api');var utils=require(_0xb4d4('0x16'));var config=require(_0xb4d4('0x17'));var licenseUtil=require(_0xb4d4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x254a71,_0x1d4ec1){_0x1d4ec1=_0x1d4ec1||0xcc;return function(_0x2ebb97){if(_0x2ebb97){return _0x254a71['sendStatus'](_0x1d4ec1);}return _0x254a71['status'](_0x1d4ec1)[_0xb4d4('0x19')]();};}function respondWithResult(_0x4a8ebe,_0x406c7a){_0x406c7a=_0x406c7a||0xc8;return function(_0x10cdd1){if(_0x10cdd1){return _0x4a8ebe[_0xb4d4('0x1a')](_0x406c7a)[_0xb4d4('0x1b')](_0x10cdd1);}};}function respondWithFilteredResult(_0x1daaea,_0x150d7d){return function(_0x325e6e){if(_0x325e6e){var _0x330f25=typeof _0x150d7d['offset']==='undefined'&&typeof _0x150d7d['limit']==='undefined';var _0x39c63a=_0x325e6e[_0xb4d4('0x1c')];var _0x48f292=_0x330f25?0x0:_0x150d7d[_0xb4d4('0x1d')];var _0x2b4485=_0x330f25?_0x325e6e[_0xb4d4('0x1c')]:_0x150d7d[_0xb4d4('0x1d')]+_0x150d7d[_0xb4d4('0x1e')];var _0x4468c6;if(_0x2b4485>=_0x39c63a){_0x2b4485=_0x39c63a;_0x4468c6=0xc8;}else{_0x4468c6=0xce;}_0x1daaea['status'](_0x4468c6);return _0x1daaea[_0xb4d4('0x1f')](_0xb4d4('0x20'),_0x48f292+'-'+_0x2b4485+'/'+_0x39c63a)[_0xb4d4('0x1b')](_0x325e6e);}return null;};}function patchUpdates(_0xbef624){return function(_0x4eb87a){try{jsonpatch[_0xb4d4('0x21')](_0x4eb87a,_0xbef624,!![]);}catch(_0x48c2a3){return BPromise[_0xb4d4('0x22')](_0x48c2a3);}return _0x4eb87a[_0xb4d4('0x23')]();};}function saveUpdates(_0x466753,_0x12326f){return function(_0x31fc5d){if(_0x31fc5d){return _0x31fc5d[_0xb4d4('0x24')](_0x466753)[_0xb4d4('0x25')](function(_0x9a515e){return _0x9a515e;});}return null;};}function removeEntity(_0x1d671e,_0x216db6){return function(_0x22f7c9){if(_0x22f7c9){return _0x22f7c9['destroy']()[_0xb4d4('0x25')](function(){var _0x30dd88=_0x22f7c9[_0xb4d4('0x26')]({'plain':!![]});var _0x46363e=_0xb4d4('0x27');return db['UserProfileResource'][_0xb4d4('0x28')]({'where':{'type':_0x46363e,'resourceId':_0x30dd88['id']}})[_0xb4d4('0x25')](function(){return _0x22f7c9;});})[_0xb4d4('0x25')](function(){_0x1d671e[_0xb4d4('0x1a')](0xcc)[_0xb4d4('0x19')]();});}};}function handleEntityNotFound(_0x1d39aa,_0x438a56){return function(_0x579a73){if(!_0x579a73){_0x1d39aa['sendStatus'](0x194);}return _0x579a73;};}function handleError(_0x37b716,_0x46eba3){_0x46eba3=_0x46eba3||0x1f4;return function(_0x1638a8){logger[_0xb4d4('0x29')](_0x1638a8['stack']);if(_0x1638a8['name']){delete _0x1638a8[_0xb4d4('0x2a')];}_0x37b716[_0xb4d4('0x1a')](_0x46eba3)['send'](_0x1638a8);};}exports['index']=function(_0xfae27d,_0x1020bf){var _0xb0ac38={},_0x34a721={},_0x94e9a7={'count':0x0,'rows':[]};var _0x5cca25=_[_0xb4d4('0x2b')](db[_0xb4d4('0x2c')][_0xb4d4('0x2d')],function(_0x15144f){return{'name':_0x15144f['fieldName'],'type':_0x15144f[_0xb4d4('0x2e')]['key']};});_0x34a721['model']=_[_0xb4d4('0x2b')](_0x5cca25,_0xb4d4('0x2a'));_0x34a721[_0xb4d4('0x2f')]=_[_0xb4d4('0x30')](_0xfae27d['query']);_0x34a721[_0xb4d4('0x31')]=_[_0xb4d4('0x32')](_0x34a721[_0xb4d4('0x33')],_0x34a721['query']);_0xb0ac38[_0xb4d4('0x34')]=_[_0xb4d4('0x32')](_0x34a721[_0xb4d4('0x33')],qs[_0xb4d4('0x35')](_0xfae27d[_0xb4d4('0x2f')][_0xb4d4('0x35')]));_0xb0ac38['attributes']=_0xb0ac38[_0xb4d4('0x34')][_0xb4d4('0x36')]?_0xb0ac38[_0xb4d4('0x34')]:_0x34a721[_0xb4d4('0x33')];if(!_0xfae27d[_0xb4d4('0x2f')][_0xb4d4('0x37')](_0xb4d4('0x38'))){_0xb0ac38['limit']=qs[_0xb4d4('0x1e')](_0xfae27d[_0xb4d4('0x2f')][_0xb4d4('0x1e')]);_0xb0ac38[_0xb4d4('0x1d')]=qs[_0xb4d4('0x1d')](_0xfae27d[_0xb4d4('0x2f')][_0xb4d4('0x1d')]);}_0xb0ac38[_0xb4d4('0x39')]=qs['sort'](_0xfae27d[_0xb4d4('0x2f')][_0xb4d4('0x3a')]);_0xb0ac38[_0xb4d4('0x3b')]=qs['filters'](_['pick'](_0xfae27d[_0xb4d4('0x2f')],_0x34a721[_0xb4d4('0x31')]),_0x5cca25);if(_0xfae27d[_0xb4d4('0x2f')][_0xb4d4('0x3c')]){_0xb0ac38['where']=_['merge'](_0xb0ac38['where'],{'$or':_['map'](_0x5cca25,function(_0x48ec52){if(_0x48ec52[_0xb4d4('0x2e')]!=='VIRTUAL'){var _0x4df8b2={};_0x4df8b2[_0x48ec52[_0xb4d4('0x2a')]]={'$like':'%'+_0xfae27d[_0xb4d4('0x2f')][_0xb4d4('0x3c')]+'%'};return _0x4df8b2;}})});}_0xb0ac38=_[_0xb4d4('0x3d')]({},_0xb0ac38,_0xfae27d['options']);var _0x4486b4={'where':_0xb0ac38['where']};return db['JscriptyProject'][_0xb4d4('0x1c')](_0x4486b4)[_0xb4d4('0x25')](function(_0x2303c1){_0x94e9a7[_0xb4d4('0x1c')]=_0x2303c1;if(_0xfae27d[_0xb4d4('0x2f')]['includeAll']){_0xb0ac38[_0xb4d4('0x3e')]=[{'all':!![]}];}return db[_0xb4d4('0x2c')][_0xb4d4('0x3f')](_0xb0ac38);})[_0xb4d4('0x25')](function(_0x49b221){_0x94e9a7['rows']=_0x49b221;return _0x94e9a7;})['then'](respondWithFilteredResult(_0x1020bf,_0xb0ac38))[_0xb4d4('0x40')](handleError(_0x1020bf,null));};exports[_0xb4d4('0x41')]=function(_0x4902d1,_0x3cb35f){var _0x34575f={'raw':![],'where':{'id':_0x4902d1[_0xb4d4('0x42')]['id']}},_0x153cf3={};_0x153cf3[_0xb4d4('0x33')]=_['keys'](db[_0xb4d4('0x2c')][_0xb4d4('0x2d')]);_0x153cf3[_0xb4d4('0x2f')]=_['keys'](_0x4902d1[_0xb4d4('0x2f')]);_0x153cf3['filters']=_['intersection'](_0x153cf3[_0xb4d4('0x33')],_0x153cf3['query']);_0x34575f[_0xb4d4('0x34')]=_['intersection'](_0x153cf3['model'],qs[_0xb4d4('0x35')](_0x4902d1['query']['fields']));_0x34575f[_0xb4d4('0x34')]=_0x34575f[_0xb4d4('0x34')]['length']?_0x34575f[_0xb4d4('0x34')]:_0x153cf3['model'];if(_0x4902d1['query']['includeAll']){_0x34575f[_0xb4d4('0x3e')]=[{'all':!![]}];}_0x34575f=_['merge']({},_0x34575f,_0x4902d1['options']);return db[_0xb4d4('0x2c')]['find'](_0x34575f)['then'](handleEntityNotFound(_0x3cb35f,null))['then'](respondWithResult(_0x3cb35f,null))['catch'](handleError(_0x3cb35f,null));};exports['create']=function(_0x495da5,_0x472d01){return db[_0xb4d4('0x2c')][_0xb4d4('0x43')](_0x495da5[_0xb4d4('0x44')],{})[_0xb4d4('0x25')](function(_0x577528){var _0x421b95=_0x495da5[_0xb4d4('0x45')]['get']({'plain':!![]});if(!_0x421b95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x421b95[_0xb4d4('0x46')]==='user'){var _0x2c5e95=_0x577528[_0xb4d4('0x26')]({'plain':!![]});var _0x23d4a9=_0xb4d4('0x27');return db[_0xb4d4('0x47')][_0xb4d4('0x48')]({'where':{'name':_0x23d4a9,'userProfileId':_0x421b95[_0xb4d4('0x49')]},'raw':!![]})[_0xb4d4('0x25')](function(_0xcde004){if(_0xcde004&&_0xcde004['autoAssociation']===0x0){return db['UserProfileResource'][_0xb4d4('0x43')]({'name':_0x2c5e95[_0xb4d4('0x2a')],'resourceId':_0x2c5e95['id'],'type':_0xcde004[_0xb4d4('0x2a')],'sectionId':_0xcde004['id']},{})[_0xb4d4('0x25')](function(){return _0x577528;});}else{return _0x577528;}})[_0xb4d4('0x40')](function(_0x43e599){logger[_0xb4d4('0x29')](_0xb4d4('0x4a'),_0x43e599);throw _0x43e599;});}return _0x577528;})[_0xb4d4('0x25')](respondWithResult(_0x472d01,0xc9))[_0xb4d4('0x40')](handleError(_0x472d01,null));};exports[_0xb4d4('0x4b')]=function(_0x5abacc,_0xc6c103){var _0x3ad3f1={'where':{'id':_0x5abacc[_0xb4d4('0x42')]['id']}},_0x582e20={};_0x582e20[_0xb4d4('0x33')]=_[_0xb4d4('0x30')](db[_0xb4d4('0x2c')][_0xb4d4('0x2d')]);_0x3ad3f1[_0xb4d4('0x34')]=_[_0xb4d4('0x32')](_0x582e20[_0xb4d4('0x33')],qs[_0xb4d4('0x35')](_0x5abacc[_0xb4d4('0x2f')][_0xb4d4('0x35')]));_0x3ad3f1['attributes']=_0x3ad3f1[_0xb4d4('0x34')][_0xb4d4('0x36')]?_0x3ad3f1['attributes']:_0x582e20[_0xb4d4('0x33')];if(_0x5abacc[_0xb4d4('0x2f')][_0xb4d4('0x4c')]){_0x3ad3f1[_0xb4d4('0x3e')]=[{'all':!![]}];}_0x3ad3f1=_[_0xb4d4('0x3d')]({},_0x3ad3f1,_0x5abacc[_0xb4d4('0x4d')]);return db[_0xb4d4('0x2c')][_0xb4d4('0x48')](_0x3ad3f1)[_0xb4d4('0x25')](handleEntityNotFound(_0xc6c103,null))[_0xb4d4('0x25')](function(_0x59aa26){if(_0x59aa26){var _0x36ae23=_0x59aa26['get']({'plain':!![]});_0x36ae23=qs[_0xb4d4('0x4e')](_0x36ae23,['id',_0xb4d4('0x4f'),'updatedAt']);_0x5abacc[_0xb4d4('0x44')]=_['omit'](_0x5abacc['body'],['id',_0xb4d4('0x4f'),_0xb4d4('0x50')]);return db[_0xb4d4('0x2c')][_0xb4d4('0x43')](_[_0xb4d4('0x3d')](_0x36ae23,_0x5abacc[_0xb4d4('0x44')]),{'include':_0x5abacc[_0xb4d4('0x2f')][_0xb4d4('0x4c')]?[{'all':!![]}]:undefined})[_0xb4d4('0x25')](function(_0x5b5b7c){var _0x22f088=_0x5abacc[_0xb4d4('0x45')][_0xb4d4('0x26')]({'plain':!![]});if(!_0x22f088)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22f088[_0xb4d4('0x46')]===_0xb4d4('0x45')){var _0x3c35a5=_0x5b5b7c[_0xb4d4('0x26')]({'plain':!![]});var _0xdc7ad=_0xb4d4('0x27');return db[_0xb4d4('0x47')]['find']({'where':{'name':_0xdc7ad,'userProfileId':_0x22f088[_0xb4d4('0x49')]},'raw':!![]})[_0xb4d4('0x25')](function(_0x4560ef){if(_0x4560ef&&_0x4560ef[_0xb4d4('0x51')]===0x0){return db[_0xb4d4('0x52')][_0xb4d4('0x43')]({'name':_0x3c35a5[_0xb4d4('0x2a')],'resourceId':_0x3c35a5['id'],'type':_0x4560ef[_0xb4d4('0x2a')],'sectionId':_0x4560ef['id']},{})[_0xb4d4('0x25')](function(){return _0x5b5b7c;});}else{return _0x5b5b7c;}})[_0xb4d4('0x40')](function(_0x4c7672){logger[_0xb4d4('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7672);throw _0x4c7672;});}return _0x5b5b7c;});}})['then'](respondWithResult(_0xc6c103,0xc9))[_0xb4d4('0x40')](handleError(_0xc6c103,null));};exports[_0xb4d4('0x24')]=function(_0x2ff148,_0xd94ddb){if(_0x2ff148[_0xb4d4('0x44')]['id']){delete _0x2ff148[_0xb4d4('0x44')]['id'];}return db[_0xb4d4('0x2c')][_0xb4d4('0x48')]({'where':{'id':_0x2ff148['params']['id']}})[_0xb4d4('0x25')](handleEntityNotFound(_0xd94ddb,null))['then'](saveUpdates(_0x2ff148[_0xb4d4('0x44')],null))['then'](respondWithResult(_0xd94ddb,null))[_0xb4d4('0x40')](handleError(_0xd94ddb,null));};exports[_0xb4d4('0x28')]=function(_0x5036d1,_0x10537d){return db[_0xb4d4('0x2c')][_0xb4d4('0x48')]({'where':{'id':_0x5036d1[_0xb4d4('0x42')]['id']}})['then'](handleEntityNotFound(_0x10537d,null))[_0xb4d4('0x25')](removeEntity(_0x10537d,null))['catch'](handleError(_0x10537d,null));};exports[_0xb4d4('0x53')]=function(_0x3581ff,_0x11d5dc,_0x134698){var _0x21fa37={'raw':!![],'where':{}};var _0x59f514={};var _0x5bda4d={'count':0x0,'rows':[]};return db[_0xb4d4('0x2c')][_0xb4d4('0x54')]({'where':{'id':_0x3581ff[_0xb4d4('0x42')]['id']}})['then'](handleEntityNotFound(_0x11d5dc,null))[_0xb4d4('0x25')](function(_0x325732){if(_0x325732){_0x59f514['model']=_[_0xb4d4('0x30')](db[_0xb4d4('0x55')]['rawAttributes']);_0x59f514[_0xb4d4('0x2f')]=_[_0xb4d4('0x30')](_0x3581ff[_0xb4d4('0x2f')]);_0x59f514[_0xb4d4('0x31')]=_[_0xb4d4('0x32')](_0x59f514['model'],_0x59f514[_0xb4d4('0x2f')]);_0x21fa37[_0xb4d4('0x34')]=_[_0xb4d4('0x32')](_0x59f514[_0xb4d4('0x33')],qs[_0xb4d4('0x35')](_0x3581ff[_0xb4d4('0x2f')][_0xb4d4('0x35')]));_0x21fa37[_0xb4d4('0x34')]=_0x21fa37[_0xb4d4('0x34')][_0xb4d4('0x36')]?_0x21fa37['attributes']:_0x59f514[_0xb4d4('0x33')];if(!_0x3581ff[_0xb4d4('0x2f')][_0xb4d4('0x37')](_0xb4d4('0x38'))){_0x21fa37[_0xb4d4('0x1e')]=qs['limit'](_0x3581ff[_0xb4d4('0x2f')][_0xb4d4('0x1e')]);_0x21fa37[_0xb4d4('0x1d')]=qs[_0xb4d4('0x1d')](_0x3581ff['query'][_0xb4d4('0x1d')]);}_0x21fa37['order']=qs[_0xb4d4('0x3a')](_0x3581ff[_0xb4d4('0x2f')]['sort']);_0x21fa37['where']=qs[_0xb4d4('0x31')](_[_0xb4d4('0x56')](_0x3581ff[_0xb4d4('0x2f')],_0x59f514[_0xb4d4('0x31')]));_0x21fa37['where'][_0xb4d4('0x57')]=_0x325732['id'];if(_0x3581ff[_0xb4d4('0x2f')][_0xb4d4('0x3c')]){_0x21fa37[_0xb4d4('0x3b')]=_[_0xb4d4('0x3d')](_0x21fa37['where'],{'$or':_[_0xb4d4('0x2b')](_0x21fa37['attributes'],function(_0x563628){var _0x15b7e9={};_0x15b7e9[_0x563628]={'$like':'%'+_0x3581ff['query'][_0xb4d4('0x3c')]+'%'};return _0x15b7e9;})});}_0x21fa37=_[_0xb4d4('0x3d')]({},_0x21fa37,_0x3581ff['options']);return db['JscriptySessionReport'][_0xb4d4('0x1c')]({'where':_0x21fa37[_0xb4d4('0x3b')]})[_0xb4d4('0x25')](function(_0x54656c){_0x5bda4d[_0xb4d4('0x1c')]=_0x54656c;if(_0x3581ff[_0xb4d4('0x2f')][_0xb4d4('0x4c')]){_0x21fa37[_0xb4d4('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xb4d4('0x3f')](_0x21fa37);})['then'](function(_0x3a0acc){_0x5bda4d[_0xb4d4('0x58')]=_0x3a0acc;return _0x5bda4d;});}})[_0xb4d4('0x25')](respondWithFilteredResult(_0x11d5dc,_0x21fa37))['catch'](handleError(_0x11d5dc,null));};exports['getAnswers']=function(_0x51c925,_0x45e703,_0x2d2175){var _0x455c3b={'raw':!![],'where':{}};var _0x3c44e7={};var _0x4ae5c5={'count':0x0,'rows':[]};return db[_0xb4d4('0x2c')]['findOne']({'where':{'id':_0x51c925['params']['id']}})['then'](handleEntityNotFound(_0x45e703,null))[_0xb4d4('0x25')](function(_0x176f49){if(_0x176f49){_0x3c44e7[_0xb4d4('0x33')]=_[_0xb4d4('0x30')](db[_0xb4d4('0x59')][_0xb4d4('0x2d')]);_0x3c44e7[_0xb4d4('0x2f')]=_[_0xb4d4('0x30')](_0x51c925['query']);_0x3c44e7[_0xb4d4('0x31')]=_[_0xb4d4('0x32')](_0x3c44e7[_0xb4d4('0x33')],_0x3c44e7[_0xb4d4('0x2f')]);_0x455c3b[_0xb4d4('0x34')]=_[_0xb4d4('0x32')](_0x3c44e7[_0xb4d4('0x33')],qs[_0xb4d4('0x35')](_0x51c925[_0xb4d4('0x2f')][_0xb4d4('0x35')]));_0x455c3b['attributes']=_0x455c3b['attributes'][_0xb4d4('0x36')]?_0x455c3b[_0xb4d4('0x34')]:_0x3c44e7['model'];if(!_0x51c925[_0xb4d4('0x2f')]['hasOwnProperty'](_0xb4d4('0x38'))){_0x455c3b['limit']=qs[_0xb4d4('0x1e')](_0x51c925[_0xb4d4('0x2f')][_0xb4d4('0x1e')]);_0x455c3b[_0xb4d4('0x1d')]=qs['offset'](_0x51c925[_0xb4d4('0x2f')][_0xb4d4('0x1d')]);}_0x455c3b[_0xb4d4('0x39')]=qs[_0xb4d4('0x3a')](_0x51c925[_0xb4d4('0x2f')][_0xb4d4('0x3a')]);_0x455c3b[_0xb4d4('0x3b')]=qs[_0xb4d4('0x31')](_[_0xb4d4('0x56')](_0x51c925[_0xb4d4('0x2f')],_0x3c44e7['filters']));_0x455c3b[_0xb4d4('0x3b')][_0xb4d4('0x57')]=_0x176f49['id'];if(_0x51c925[_0xb4d4('0x2f')]['filter']){_0x455c3b['where']=_[_0xb4d4('0x3d')](_0x455c3b[_0xb4d4('0x3b')],{'$or':_['map'](_0x455c3b['attributes'],function(_0x3bf056){var _0x3ddc93={};_0x3ddc93[_0x3bf056]={'$like':'%'+_0x51c925[_0xb4d4('0x2f')][_0xb4d4('0x3c')]+'%'};return _0x3ddc93;})});}_0x455c3b=_[_0xb4d4('0x3d')]({},_0x455c3b,_0x51c925['options']);return db[_0xb4d4('0x59')][_0xb4d4('0x1c')]({'where':_0x455c3b[_0xb4d4('0x3b')]})[_0xb4d4('0x25')](function(_0x48b207){_0x4ae5c5[_0xb4d4('0x1c')]=_0x48b207;if(_0x51c925[_0xb4d4('0x2f')]['includeAll']){_0x455c3b[_0xb4d4('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x455c3b);})[_0xb4d4('0x25')](function(_0x10e1b1){_0x4ae5c5[_0xb4d4('0x58')]=_0x10e1b1;return _0x4ae5c5;});}})[_0xb4d4('0x25')](respondWithFilteredResult(_0x45e703,_0x455c3b))[_0xb4d4('0x40')](handleError(_0x45e703,null));};function char(_0xe3324a){return _0xb4d4('0x5a')===typeof _0xe3324a?String['fromCharCode'][_0xb4d4('0x21')](null,arguments):_0xe3324a;}function needsEncapsulation(_0x4f6a74){return!!_0x4f6a74&&(_0x4f6a74[_0xb4d4('0x5b')]()[_0xb4d4('0x5c')](char(0xd))>=0x0||_0x4f6a74[_0xb4d4('0x5b')]()[_0xb4d4('0x5c')](char(0xa))>=0x0||_0x4f6a74[_0xb4d4('0x5b')]()[_0xb4d4('0x5c')](char(0x2c))>=0x0||_0x4f6a74[_0xb4d4('0x5b')]()[_0xb4d4('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x4cca27){var _0x21b794=char(0x22),_0x2bb5d0='\x5c'+char(0x22),_0x1799bd=_0x4cca27[_0xb4d4('0x5b')]()['replace'](new RegExp(_0x21b794,'g'),_0x2bb5d0);return _0x21b794+_0x1799bd+_0x21b794;}exports[_0xb4d4('0x5d')]=function(_0x3ac223,_0x44ba3b,_0x4ef629){var _0x11dddc,_0x1661bb;var _0x447278={'where':{'ProjectId':_0x3ac223['params']['id']}};if(_0x3ac223[_0xb4d4('0x2f')][_0xb4d4('0x5e')]){_0x447278['where'][_0xb4d4('0x5f')]=JSON['parse'](_0x3ac223['query'][_0xb4d4('0x5e')]);}return db[_0xb4d4('0x55')][_0xb4d4('0x3f')](_0x447278)[_0xb4d4('0x25')](handleEntityNotFound(_0x44ba3b,null))[_0xb4d4('0x25')](function(_0x3d5b54){if(_0x3d5b54){_0x11dddc=_0x3d5b54;return db[_0xb4d4('0x60')]['findAll']({'where':{'SessionId':{'$in':_[_0xb4d4('0x2b')](_0x11dddc,'id')},'ProjectId':_0x3ac223['params']['id']},'order':_0xb4d4('0x61')});}})[_0xb4d4('0x25')](handleEntityNotFound(_0x44ba3b,null))[_0xb4d4('0x25')](function(_0x5182cd){if(_0x5182cd){_0x1661bb=_0x5182cd;var _0x46a746={};for(var _0x112266=0x0,_0x26d804=_0x1661bb['length'];_0x112266<_0x26d804;_0x112266++){if(!_0x46a746[_0xb4d4('0x37')](_0x1661bb[_0x112266][_0xb4d4('0x62')])){_0x46a746[_0x1661bb[_0x112266]['questionId']]=needsEncapsulation(_0x1661bb[_0x112266]['question'])?encapsulate(_0x1661bb[_0x112266][_0xb4d4('0x63')]):_0x1661bb[_0x112266][_0xb4d4('0x63')];}}var _0x5c71e4=[],_0x42200d={};for(var _0x167d59=0x0,_0x2f61c3=_0x11dddc[_0xb4d4('0x36')];_0x167d59<_0x2f61c3;_0x167d59++){_0x42200d={'ProjectId':_0x3ac223['params']['id'],'SessionId':_0x11dddc[_0x167d59]['id'],'StartTime':moment(_0x11dddc[_0x167d59]['starttime'])[_0xb4d4('0x64')](_0xb4d4('0x65'))};for(var _0x1de3be=0x0,_0x4ba679=_0x1661bb['length'];_0x1de3be<_0x4ba679;_0x1de3be++){if(_0x1661bb[_0x1de3be][_0xb4d4('0x66')]==_0x11dddc[_0x167d59]['id']&&_0x46a746['hasOwnProperty'](_0x1661bb[_0x1de3be][_0xb4d4('0x62')])){_0x42200d[_0x46a746[_0x1661bb[_0x1de3be]['questionId']]]=_0x1661bb[_0x1de3be][_0xb4d4('0x67')];}}for(var _0x4e129c in _0x46a746){if(!_0x42200d[_0xb4d4('0x37')](_0x46a746[_0x4e129c])){_0x42200d[_0x46a746[_0x4e129c]]=null;}}_0x5c71e4['push'](_0x42200d);}return _0x5c71e4;}})[_0xb4d4('0x25')](function(_0x300e48){if(!_['isEmpty'](_0x300e48)){var _0x3e8cec=toCsv(_0x300e48);var _0x343edc=Date[_0xb4d4('0x68')]();fs[_0xb4d4('0x69')](util[_0xb4d4('0x64')](_0xb4d4('0x6a'),_0x3ac223[_0xb4d4('0x42')]['id'],_0x343edc),_0x3e8cec);_0x44ba3b[_0xb4d4('0x6b')](_0xb4d4('0x6c'),'attachment;\x20filename='+util[_0xb4d4('0x64')](_0xb4d4('0x6d'),_0x3ac223[_0xb4d4('0x42')]['id'],_0x343edc));_0x44ba3b[_0xb4d4('0x6b')](_0xb4d4('0x6e'),'text/csv');return _0x44ba3b[_0xb4d4('0x6f')](util[_0xb4d4('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x3ac223[_0xb4d4('0x42')]['id'],_0x343edc));}else{return _0x44ba3b[_0xb4d4('0x70')](0xcc);}})[_0xb4d4('0x40')](handleError(_0x44ba3b,null));}; \ No newline at end of file +var _0xb7e7=['intersection','includeAll','include','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','findAll','rows','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','setHeader','Content-disposition','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','destroy','error','name','send','index','JscriptyProject','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','show','params','keys','rawAttributes'];(function(_0x3e90d9,_0x4eaae){var _0x384db4=function(_0x136b5f){while(--_0x136b5f){_0x3e90d9['push'](_0x3e90d9['shift']());}};_0x384db4(++_0x4eaae);}(_0xb7e7,0x121));var _0x7b7e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb7e7[_0x122096];return _0x3d1966;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){var _0x22598e=_0x5d6215[_0x7b7e('0x27')]({'plain':!![]});var _0x483c6f='Projects';return db['UserProfileResource'][_0x7b7e('0x28')]({'where':{'type':_0x483c6f,'resourceId':_0x22598e['id']}})[_0x7b7e('0x26')](function(){return _0x5d6215;});})[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x48fad1,_0x6a1e71){return function(_0x21a15){if(!_0x21a15){_0x48fad1['sendStatus'](0x194);}return _0x21a15;};}function handleError(_0x57b9da,_0x4e5de7){_0x4e5de7=_0x4e5de7||0x1f4;return function(_0x12ef0b){logger[_0x7b7e('0x29')](_0x12ef0b['stack']);if(_0x12ef0b[_0x7b7e('0x2a')]){delete _0x12ef0b['name'];}_0x57b9da[_0x7b7e('0x1b')](_0x4e5de7)[_0x7b7e('0x2b')](_0x12ef0b);};}exports[_0x7b7e('0x2c')]=function(_0x5515ca,_0x3960b8){var _0xe31336={},_0x35602a={},_0x326dd2={'count':0x0,'rows':[]};var _0x33f9a1=_['map'](db[_0x7b7e('0x2d')]['rawAttributes'],function(_0x23a453){return{'name':_0x23a453[_0x7b7e('0x2e')],'type':_0x23a453[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x35602a[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x33f9a1,_0x7b7e('0x2a'));_0x35602a['query']=_['keys'](_0x5515ca[_0x7b7e('0x33')]);_0x35602a[_0x7b7e('0x34')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],_0x35602a[_0x7b7e('0x33')]);_0xe31336[_0x7b7e('0x35')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0xe31336[_0x7b7e('0x35')]=_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0xe31336[_0x7b7e('0x35')]:_0x35602a[_0x7b7e('0x31')];if(!_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0xe31336[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1f')]);_0xe31336['offset']=qs[_0x7b7e('0x1d')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1d')]);}_0xe31336[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3b')]);_0xe31336[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_[_0x7b7e('0x3d')](_0x5515ca['query'],_0x35602a[_0x7b7e('0x34')]),_0x33f9a1);if(_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]){_0xe31336[_0x7b7e('0x3c')]=_['merge'](_0xe31336[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x32')](_0x33f9a1,function(_0x3d5280){if(_0x3d5280['type']!=='VIRTUAL'){var _0x22651e={};_0x22651e[_0x3d5280['name']]={'$like':'%'+_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x22651e;}})});}_0xe31336=_['merge']({},_0xe31336,_0x5515ca[_0x7b7e('0x3f')]);var _0x2074d1={'where':_0xe31336[_0x7b7e('0x3c')]};return db[_0x7b7e('0x2d')][_0x7b7e('0x20')](_0x2074d1)[_0x7b7e('0x26')](function(_0xc888e4){_0x326dd2[_0x7b7e('0x20')]=_0xc888e4;if(_0x5515ca[_0x7b7e('0x33')]['includeAll']){_0xe31336['include']=[{'all':!![]}];}return db[_0x7b7e('0x2d')]['findAll'](_0xe31336);})[_0x7b7e('0x26')](function(_0x5e8b5d){_0x326dd2['rows']=_0x5e8b5d;return _0x326dd2;})[_0x7b7e('0x26')](respondWithFilteredResult(_0x3960b8,_0xe31336))['catch'](handleError(_0x3960b8,null));};exports[_0x7b7e('0x40')]=function(_0x52051c,_0xa8521d){var _0x3e58be={'raw':![],'where':{'id':_0x52051c[_0x7b7e('0x41')]['id']}},_0x7ea84c={};_0x7ea84c['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x2d')][_0x7b7e('0x43')]);_0x7ea84c[_0x7b7e('0x33')]=_[_0x7b7e('0x42')](_0x52051c[_0x7b7e('0x33')]);_0x7ea84c['filters']=_['intersection'](_0x7ea84c['model'],_0x7ea84c[_0x7b7e('0x33')]);_0x3e58be[_0x7b7e('0x35')]=_[_0x7b7e('0x44')](_0x7ea84c[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x52051c[_0x7b7e('0x33')]['fields']));_0x3e58be[_0x7b7e('0x35')]=_0x3e58be[_0x7b7e('0x35')]['length']?_0x3e58be['attributes']:_0x7ea84c[_0x7b7e('0x31')];if(_0x52051c[_0x7b7e('0x33')][_0x7b7e('0x45')]){_0x3e58be[_0x7b7e('0x46')]=[{'all':!![]}];}_0x3e58be=_[_0x7b7e('0x47')]({},_0x3e58be,_0x52051c[_0x7b7e('0x3f')]);return db['JscriptyProject'][_0x7b7e('0x48')](_0x3e58be)['then'](handleEntityNotFound(_0xa8521d,null))[_0x7b7e('0x26')](respondWithResult(_0xa8521d,null))[_0x7b7e('0x49')](handleError(_0xa8521d,null));};exports[_0x7b7e('0x4a')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x2d')][_0x7b7e('0x4a')](_0x5874e2[_0x7b7e('0x4b')],{})[_0x7b7e('0x26')](function(_0x1f9d0f){var _0x5cce7c=_0x5874e2[_0x7b7e('0x4c')][_0x7b7e('0x27')]({'plain':!![]});if(!_0x5cce7c)throw new Error(_0x7b7e('0x4d'));if(_0x5cce7c[_0x7b7e('0x4e')]===_0x7b7e('0x4c')){var _0x5a9697=_0x1f9d0f[_0x7b7e('0x27')]({'plain':!![]});var _0x29024e=_0x7b7e('0x4f');return db[_0x7b7e('0x50')][_0x7b7e('0x48')]({'where':{'name':_0x29024e,'userProfileId':_0x5cce7c[_0x7b7e('0x51')]},'raw':!![]})[_0x7b7e('0x26')](function(_0x4a7be0){if(_0x4a7be0&&_0x4a7be0[_0x7b7e('0x52')]===0x0){return db['UserProfileResource'][_0x7b7e('0x4a')]({'name':_0x5a9697[_0x7b7e('0x2a')],'resourceId':_0x5a9697['id'],'type':_0x4a7be0['name'],'sectionId':_0x4a7be0['id']},{})[_0x7b7e('0x26')](function(){return _0x1f9d0f;});}else{return _0x1f9d0f;}})[_0x7b7e('0x49')](function(_0x16c81d){logger[_0x7b7e('0x29')](_0x7b7e('0x53'),_0x16c81d);throw _0x16c81d;});}return _0x1f9d0f;})[_0x7b7e('0x26')](respondWithResult(_0x58e4e6,0xc9))[_0x7b7e('0x49')](handleError(_0x58e4e6,null));};exports['clone']=function(_0xbf044d,_0x3ff731){var _0x96752e={'where':{'id':_0xbf044d['params']['id']}},_0x24481a={};_0x24481a['model']=_['keys'](db[_0x7b7e('0x2d')][_0x7b7e('0x43')]);_0x96752e[_0x7b7e('0x35')]=_['intersection'](_0x24481a['model'],qs[_0x7b7e('0x36')](_0xbf044d[_0x7b7e('0x33')]['fields']));_0x96752e[_0x7b7e('0x35')]=_0x96752e[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0x96752e['attributes']:_0x24481a[_0x7b7e('0x31')];if(_0xbf044d[_0x7b7e('0x33')]['includeAll']){_0x96752e[_0x7b7e('0x46')]=[{'all':!![]}];}_0x96752e=_[_0x7b7e('0x47')]({},_0x96752e,_0xbf044d[_0x7b7e('0x3f')]);return db[_0x7b7e('0x2d')][_0x7b7e('0x48')](_0x96752e)[_0x7b7e('0x26')](handleEntityNotFound(_0x3ff731,null))[_0x7b7e('0x26')](function(_0x2d1908){if(_0x2d1908){var _0x45fff9=_0x2d1908['get']({'plain':!![]});_0x45fff9=qs[_0x7b7e('0x54')](_0x45fff9,['id',_0x7b7e('0x55'),'updatedAt']);_0xbf044d[_0x7b7e('0x4b')]=_[_0x7b7e('0x54')](_0xbf044d[_0x7b7e('0x4b')],['id','createdAt',_0x7b7e('0x56')]);return db['JscriptyProject'][_0x7b7e('0x4a')](_[_0x7b7e('0x47')](_0x45fff9,_0xbf044d['body']),{'include':_0xbf044d[_0x7b7e('0x33')][_0x7b7e('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x2dcb35){var _0x369103=_0xbf044d[_0x7b7e('0x4c')][_0x7b7e('0x27')]({'plain':!![]});if(!_0x369103)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x369103[_0x7b7e('0x4e')]===_0x7b7e('0x4c')){var _0x2e11b1=_0x2dcb35[_0x7b7e('0x27')]({'plain':!![]});var _0x2dc7ad=_0x7b7e('0x4f');return db[_0x7b7e('0x50')][_0x7b7e('0x48')]({'where':{'name':_0x2dc7ad,'userProfileId':_0x369103[_0x7b7e('0x51')]},'raw':!![]})[_0x7b7e('0x26')](function(_0x5b9010){if(_0x5b9010&&_0x5b9010[_0x7b7e('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x2e11b1[_0x7b7e('0x2a')],'resourceId':_0x2e11b1['id'],'type':_0x5b9010[_0x7b7e('0x2a')],'sectionId':_0x5b9010['id']},{})[_0x7b7e('0x26')](function(){return _0x2dcb35;});}else{return _0x2dcb35;}})[_0x7b7e('0x49')](function(_0x5cd4ae){logger[_0x7b7e('0x29')](_0x7b7e('0x53'),_0x5cd4ae);throw _0x5cd4ae;});}return _0x2dcb35;});}})[_0x7b7e('0x26')](respondWithResult(_0x3ff731,0xc9))[_0x7b7e('0x49')](handleError(_0x3ff731,null));};exports[_0x7b7e('0x25')]=function(_0x2b2afd,_0x4e485c){if(_0x2b2afd[_0x7b7e('0x4b')]['id']){delete _0x2b2afd['body']['id'];}return db['JscriptyProject'][_0x7b7e('0x48')]({'where':{'id':_0x2b2afd['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x4e485c,null))['then'](saveUpdates(_0x2b2afd[_0x7b7e('0x4b')],null))[_0x7b7e('0x26')](respondWithResult(_0x4e485c,null))['catch'](handleError(_0x4e485c,null));};exports[_0x7b7e('0x28')]=function(_0x2da71e,_0x57e88f){return db[_0x7b7e('0x2d')][_0x7b7e('0x48')]({'where':{'id':_0x2da71e[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x57e88f,null))[_0x7b7e('0x26')](removeEntity(_0x57e88f,null))[_0x7b7e('0x49')](handleError(_0x57e88f,null));};exports[_0x7b7e('0x57')]=function(_0x3f8f8f,_0x457365,_0x17e5ba){var _0x589b02={'raw':!![],'where':{}};var _0x59ecf9={};var _0x34e7df={'count':0x0,'rows':[]};return db[_0x7b7e('0x2d')][_0x7b7e('0x58')]({'where':{'id':_0x3f8f8f[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x457365,null))[_0x7b7e('0x26')](function(_0x385f0c){if(_0x385f0c){_0x59ecf9['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x59')]['rawAttributes']);_0x59ecf9[_0x7b7e('0x33')]=_[_0x7b7e('0x42')](_0x3f8f8f[_0x7b7e('0x33')]);_0x59ecf9[_0x7b7e('0x34')]=_[_0x7b7e('0x44')](_0x59ecf9[_0x7b7e('0x31')],_0x59ecf9[_0x7b7e('0x33')]);_0x589b02[_0x7b7e('0x35')]=_[_0x7b7e('0x44')](_0x59ecf9[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x3f8f8f['query'][_0x7b7e('0x36')]));_0x589b02[_0x7b7e('0x35')]=_0x589b02[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0x589b02[_0x7b7e('0x35')]:_0x59ecf9[_0x7b7e('0x31')];if(!_0x3f8f8f[_0x7b7e('0x33')]['hasOwnProperty'](_0x7b7e('0x39'))){_0x589b02[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x3f8f8f['query'][_0x7b7e('0x1f')]);_0x589b02[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x3f8f8f[_0x7b7e('0x33')][_0x7b7e('0x1d')]);}_0x589b02['order']=qs['sort'](_0x3f8f8f['query'][_0x7b7e('0x3b')]);_0x589b02[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_['pick'](_0x3f8f8f[_0x7b7e('0x33')],_0x59ecf9[_0x7b7e('0x34')]));_0x589b02[_0x7b7e('0x3c')]['ProjectId']=_0x385f0c['id'];if(_0x3f8f8f[_0x7b7e('0x33')][_0x7b7e('0x3e')]){_0x589b02[_0x7b7e('0x3c')]=_[_0x7b7e('0x47')](_0x589b02['where'],{'$or':_[_0x7b7e('0x32')](_0x589b02[_0x7b7e('0x35')],function(_0xa52b93){var _0x259f6e={};_0x259f6e[_0xa52b93]={'$like':'%'+_0x3f8f8f['query']['filter']+'%'};return _0x259f6e;})});}_0x589b02=_[_0x7b7e('0x47')]({},_0x589b02,_0x3f8f8f['options']);return db[_0x7b7e('0x59')][_0x7b7e('0x20')]({'where':_0x589b02[_0x7b7e('0x3c')]})[_0x7b7e('0x26')](function(_0x480319){_0x34e7df[_0x7b7e('0x20')]=_0x480319;if(_0x3f8f8f[_0x7b7e('0x33')][_0x7b7e('0x45')]){_0x589b02[_0x7b7e('0x46')]=[{'all':!![]}];}return db[_0x7b7e('0x59')][_0x7b7e('0x5a')](_0x589b02);})[_0x7b7e('0x26')](function(_0x372478){_0x34e7df[_0x7b7e('0x5b')]=_0x372478;return _0x34e7df;});}})[_0x7b7e('0x26')](respondWithFilteredResult(_0x457365,_0x589b02))[_0x7b7e('0x49')](handleError(_0x457365,null));};exports[_0x7b7e('0x5c')]=function(_0xbdc4b9,_0x24189a,_0x391343){var _0x28e2e9={'raw':!![],'where':{}};var _0x57d925={};var _0x3f4d00={'count':0x0,'rows':[]};return db[_0x7b7e('0x2d')][_0x7b7e('0x58')]({'where':{'id':_0xbdc4b9[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x24189a,null))[_0x7b7e('0x26')](function(_0x2bf2da){if(_0x2bf2da){_0x57d925['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x5d')][_0x7b7e('0x43')]);_0x57d925[_0x7b7e('0x33')]=_[_0x7b7e('0x42')](_0xbdc4b9['query']);_0x57d925['filters']=_[_0x7b7e('0x44')](_0x57d925[_0x7b7e('0x31')],_0x57d925[_0x7b7e('0x33')]);_0x28e2e9[_0x7b7e('0x35')]=_[_0x7b7e('0x44')](_0x57d925[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0xbdc4b9[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0x28e2e9[_0x7b7e('0x35')]=_0x28e2e9['attributes'][_0x7b7e('0x37')]?_0x28e2e9[_0x7b7e('0x35')]:_0x57d925[_0x7b7e('0x31')];if(!_0xbdc4b9[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x28e2e9[_0x7b7e('0x1f')]=qs['limit'](_0xbdc4b9[_0x7b7e('0x33')]['limit']);_0x28e2e9[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0xbdc4b9['query'][_0x7b7e('0x1d')]);}_0x28e2e9[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0xbdc4b9[_0x7b7e('0x33')][_0x7b7e('0x3b')]);_0x28e2e9['where']=qs[_0x7b7e('0x34')](_['pick'](_0xbdc4b9['query'],_0x57d925[_0x7b7e('0x34')]));_0x28e2e9[_0x7b7e('0x3c')][_0x7b7e('0x5e')]=_0x2bf2da['id'];if(_0xbdc4b9[_0x7b7e('0x33')]['filter']){_0x28e2e9[_0x7b7e('0x3c')]=_['merge'](_0x28e2e9[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x32')](_0x28e2e9[_0x7b7e('0x35')],function(_0x1e71ab){var _0x11d615={};_0x11d615[_0x1e71ab]={'$like':'%'+_0xbdc4b9[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x11d615;})});}_0x28e2e9=_['merge']({},_0x28e2e9,_0xbdc4b9[_0x7b7e('0x3f')]);return db[_0x7b7e('0x5d')]['count']({'where':_0x28e2e9[_0x7b7e('0x3c')]})[_0x7b7e('0x26')](function(_0x102129){_0x3f4d00[_0x7b7e('0x20')]=_0x102129;if(_0xbdc4b9[_0x7b7e('0x33')][_0x7b7e('0x45')]){_0x28e2e9[_0x7b7e('0x46')]=[{'all':!![]}];}return db[_0x7b7e('0x5d')][_0x7b7e('0x5a')](_0x28e2e9);})[_0x7b7e('0x26')](function(_0x4395c7){_0x3f4d00[_0x7b7e('0x5b')]=_0x4395c7;return _0x3f4d00;});}})[_0x7b7e('0x26')](respondWithFilteredResult(_0x24189a,_0x28e2e9))[_0x7b7e('0x49')](handleError(_0x24189a,null));};function char(_0x12d0cb){return _0x7b7e('0x5f')===typeof _0x12d0cb?String[_0x7b7e('0x60')][_0x7b7e('0x23')](null,arguments):_0x12d0cb;}function needsEncapsulation(_0x45a690){return!!_0x45a690&&(_0x45a690[_0x7b7e('0x61')]()[_0x7b7e('0x62')](char(0xd))>=0x0||_0x45a690[_0x7b7e('0x61')]()['indexOf'](char(0xa))>=0x0||_0x45a690[_0x7b7e('0x61')]()[_0x7b7e('0x62')](char(0x2c))>=0x0||_0x45a690['toString']()[_0x7b7e('0x62')](char(0x22))>=0x0);}function encapsulate(_0x4b7f96){var _0x4e0883=char(0x22),_0x1871d2='\x5c'+char(0x22),_0x538874=_0x4b7f96['toString']()[_0x7b7e('0x63')](new RegExp(_0x4e0883,'g'),_0x1871d2);return _0x4e0883+_0x538874+_0x4e0883;}exports[_0x7b7e('0x64')]=function(_0x130c62,_0x531ab1,_0x35b5c5){var _0x5a3a14,_0x2a6fdd;var _0x3b92e0={'where':{'ProjectId':_0x130c62[_0x7b7e('0x41')]['id']}};if(_0x130c62[_0x7b7e('0x33')][_0x7b7e('0x65')]){_0x3b92e0[_0x7b7e('0x3c')][_0x7b7e('0x66')]=JSON['parse'](_0x130c62[_0x7b7e('0x33')][_0x7b7e('0x65')]);}return db[_0x7b7e('0x59')]['findAll'](_0x3b92e0)[_0x7b7e('0x26')](handleEntityNotFound(_0x531ab1,null))[_0x7b7e('0x26')](function(_0x5d8068){if(_0x5d8068){_0x5a3a14=_0x5d8068;return db[_0x7b7e('0x67')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x5a3a14,'id')},'ProjectId':_0x130c62[_0x7b7e('0x41')]['id']},'order':_0x7b7e('0x68')});}})['then'](handleEntityNotFound(_0x531ab1,null))[_0x7b7e('0x26')](function(_0x5ab8a7){if(_0x5ab8a7){_0x2a6fdd=_0x5ab8a7;var _0x4c7158={};for(var _0x5c0d1c=0x0,_0x10682b=_0x2a6fdd[_0x7b7e('0x37')];_0x5c0d1c<_0x10682b;_0x5c0d1c++){if(!_0x4c7158[_0x7b7e('0x38')](_0x2a6fdd[_0x5c0d1c][_0x7b7e('0x69')])){_0x4c7158[_0x2a6fdd[_0x5c0d1c][_0x7b7e('0x69')]]=needsEncapsulation(_0x2a6fdd[_0x5c0d1c][_0x7b7e('0x6a')])?encapsulate(_0x2a6fdd[_0x5c0d1c][_0x7b7e('0x6a')]):_0x2a6fdd[_0x5c0d1c]['question'];}}var _0x3cd173=[],_0x1e2bb7={};for(var _0x3cc9bd=0x0,_0x968056=_0x5a3a14[_0x7b7e('0x37')];_0x3cc9bd<_0x968056;_0x3cc9bd++){_0x1e2bb7={'ProjectId':_0x130c62[_0x7b7e('0x41')]['id'],'SessionId':_0x5a3a14[_0x3cc9bd]['id'],'StartTime':moment(_0x5a3a14[_0x3cc9bd][_0x7b7e('0x66')])[_0x7b7e('0x6b')](_0x7b7e('0x6c'))};for(var _0x254c76=0x0,_0x2f9f24=_0x2a6fdd[_0x7b7e('0x37')];_0x254c76<_0x2f9f24;_0x254c76++){if(_0x2a6fdd[_0x254c76]['SessionId']==_0x5a3a14[_0x3cc9bd]['id']&&_0x4c7158['hasOwnProperty'](_0x2a6fdd[_0x254c76][_0x7b7e('0x69')])){_0x1e2bb7[_0x4c7158[_0x2a6fdd[_0x254c76][_0x7b7e('0x69')]]]=_0x2a6fdd[_0x254c76][_0x7b7e('0x6d')];}}for(var _0x40f2fb in _0x4c7158){if(!_0x1e2bb7[_0x7b7e('0x38')](_0x4c7158[_0x40f2fb])){_0x1e2bb7[_0x4c7158[_0x40f2fb]]=null;}}_0x3cd173[_0x7b7e('0x6e')](_0x1e2bb7);}return _0x3cd173;}})[_0x7b7e('0x26')](function(_0x11795e){if(!_[_0x7b7e('0x6f')](_0x11795e)){var _0x845b44=toCsv(_0x11795e);var _0x1dfd0d=Date[_0x7b7e('0x70')]();fs['writeFileSync'](util[_0x7b7e('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x130c62[_0x7b7e('0x41')]['id'],_0x1dfd0d),_0x845b44);_0x531ab1[_0x7b7e('0x71')](_0x7b7e('0x72'),'attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x130c62[_0x7b7e('0x41')]['id'],_0x1dfd0d));_0x531ab1[_0x7b7e('0x71')](_0x7b7e('0x73'),_0x7b7e('0x74'));return _0x531ab1[_0x7b7e('0x75')](util[_0x7b7e('0x6b')](_0x7b7e('0x76'),_0x130c62[_0x7b7e('0x41')]['id'],_0x1dfd0d));}else{return _0x531ab1[_0x7b7e('0x19')](0xcc);}})[_0x7b7e('0x49')](handleError(_0x531ab1,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index a1210b1..042ad06 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 _0xe9e8=['rimraf','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56a5b7,_0x526bf0){var _0xe02aa5=function(_0x17514e){while(--_0x17514e){_0x56a5b7['push'](_0x56a5b7['shift']());}};_0xe02aa5(++_0x526bf0);}(_0xe9e8,0x179));var _0x8e9e=function(_0x16113a,_0x4a2923){_0x16113a=_0x16113a-0x0;var _0x425edd=_0xe9e8[_0x16113a];return _0x425edd;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require(_0x8e9e('0x2'))(_0x8e9e('0x3'));var moment=require(_0x8e9e('0x4'));var BPromise=require(_0x8e9e('0x5'));var rp=require(_0x8e9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e9e('0x8'));module[_0x8e9e('0x9')]=function(_0x3b5e8d,_0x5de00e){return _0x3b5e8d['define'](_0x8e9e('0xa'),attributes,{'tableName':_0x8e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2086=['./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x7f287d,_0xe3b36e){var _0x21514f=function(_0x2e392e){while(--_0x2e392e){_0x7f287d['push'](_0x7f287d['shift']());}};_0x21514f(++_0xe3b36e);}(_0x2086,0x124));var _0x6208=function(_0x2d39a3,_0x48a411){_0x2d39a3=_0x2d39a3-0x0;var _0x394985=_0x2086[_0x2d39a3];return _0x394985;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var logger=require(_0x6208('0x2'))(_0x6208('0x3'));var moment=require(_0x6208('0x4'));var BPromise=require(_0x6208('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6208('0x6'));var rimraf=require(_0x6208('0x7'));var config=require('../../config/environment');var attributes=require(_0x6208('0x8'));module[_0x6208('0x9')]=function(_0x38bc4d,_0xb3cf2a){return _0x38bc4d[_0x6208('0xa')]('JscriptyProject',attributes,{'tableName':_0x6208('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index d091f80..115ae4f 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x5b05de,_0x441400){var _0x1dbd07=function(_0x2ebed2){while(--_0x2ebed2){_0x5b05de['push'](_0x5b05de['shift']());}};_0x1dbd07(++_0x441400);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5d838b,_0x266b51){var _0x17a26f=function(_0x59b459){while(--_0x59b459){_0x5d838b['push'](_0x5d838b['shift']());}};_0x17a26f(++_0x266b51);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2e9887,_0xa6180){_0x2e9887=_0x2e9887-0x0;var _0x648abb=_0xb43b[_0x2e9887];return _0x648abb;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index d4a49f0..a25e4d9 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 _0xcfa3=['Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x455555,_0x2147fd){var _0x3cb183=function(_0x516a72){while(--_0x516a72){_0x455555['push'](_0x455555['shift']());}};_0x3cb183(++_0x2147fd);}(_0xcfa3,0x15d));var _0x3cfa=function(_0x391c8c,_0x54a397){_0x391c8c=_0x391c8c-0x0;var _0x2e6dac=_0xcfa3[_0x391c8c];return _0x2e6dac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3cfa('0x0'));var timeout=require(_0x3cfa('0x1'));var express=require(_0x3cfa('0x2'));var router=express[_0x3cfa('0x3')]();var fs_extra=require(_0x3cfa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3cfa('0x5'));var config=require(_0x3cfa('0x6'));var controller=require(_0x3cfa('0x7'));router[_0x3cfa('0x8')]('/',auth['isAuthenticated'](),controller[_0x3cfa('0x9')]);router[_0x3cfa('0x8')](_0x3cfa('0xa'),auth[_0x3cfa('0xb')](),controller[_0x3cfa('0xc')]);router['get'](_0x3cfa('0xd'),auth[_0x3cfa('0xb')](),controller[_0x3cfa('0xe')]);router[_0x3cfa('0xf')]('/',auth[_0x3cfa('0xb')](),controller[_0x3cfa('0x10')]);router[_0x3cfa('0x11')](_0x3cfa('0xd'),auth[_0x3cfa('0xb')](),controller[_0x3cfa('0x12')]);router[_0x3cfa('0x13')]('/:id',auth[_0x3cfa('0xb')](),controller[_0x3cfa('0x14')]);module[_0x3cfa('0x15')]=router; \ No newline at end of file +var _0x16ed=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x2f462f,_0x2c0bde){var _0x2717a9=function(_0x19b796){while(--_0x19b796){_0x2f462f['push'](_0x2f462f['shift']());}};_0x2717a9(++_0x2c0bde);}(_0x16ed,0x1cc));var _0xd16e=function(_0x5eacaf,_0xdea236){_0x5eacaf=_0x5eacaf-0x0;var _0x5c7f7f=_0x16ed[_0x5eacaf];return _0x5c7f7f;};'use strict';var multer=require('multer');var util=require(_0xd16e('0x0'));var path=require(_0xd16e('0x1'));var timeout=require(_0xd16e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd16e('0x3'));var auth=require(_0xd16e('0x4'));var interaction=require(_0xd16e('0x5'));var config=require(_0xd16e('0x6'));var controller=require(_0xd16e('0x7'));router[_0xd16e('0x8')]('/',auth[_0xd16e('0x9')](),controller['index']);router[_0xd16e('0x8')](_0xd16e('0xa'),auth[_0xd16e('0x9')](),controller[_0xd16e('0xb')]);router['get'](_0xd16e('0xc'),auth[_0xd16e('0x9')](),controller[_0xd16e('0xd')]);router[_0xd16e('0xe')]('/',auth[_0xd16e('0x9')](),controller['create']);router[_0xd16e('0xf')](_0xd16e('0xc'),auth[_0xd16e('0x9')](),controller[_0xd16e('0x10')]);router[_0xd16e('0x11')](_0xd16e('0xc'),auth[_0xd16e('0x9')](),controller[_0xd16e('0x12')]);module[_0xd16e('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 4c1bd23..031a23f 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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x489820,_0x8246ec){_0x489820=_0x489820-0x0;var _0x3f405a=_0x7a54[_0x489820];return _0x3f405a;};'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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x39eafb,_0x37201c){_0x39eafb=_0x39eafb-0x0;var _0x40146e=_0x7a54[_0x39eafb];return _0x40146e;};'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 b24b375..1ac823c 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 _0xd497=['Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','map','JscriptyQuestionReport','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','catch','show','params','keys','rawAttributes','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count'];(function(_0x4b87a3,_0x3a698c){var _0x334112=function(_0x3e8fb0){while(--_0x3e8fb0){_0x4b87a3['push'](_0x4b87a3['shift']());}};_0x334112(++_0x3a698c);}(_0xd497,0x196));var _0x7d49=function(_0x3c1172,_0x111172){_0x3c1172=_0x3c1172-0x0;var _0x530bb6=_0xd497[_0x3c1172];return _0x530bb6;};'use strict';var emlformat=require(_0x7d49('0x0'));var rimraf=require(_0x7d49('0x1'));var zipdir=require(_0x7d49('0x2'));var jsonpatch=require(_0x7d49('0x3'));var rp=require('request-promise');var moment=require(_0x7d49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d49('0x5'));var util=require(_0x7d49('0x6'));var path=require(_0x7d49('0x7'));var sox=require(_0x7d49('0x8'));var csv=require(_0x7d49('0x9'));var ejs=require(_0x7d49('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d49('0xb'));var squel=require(_0x7d49('0xc'));var crypto=require(_0x7d49('0xd'));var jsforce=require(_0x7d49('0xe'));var deskjs=require(_0x7d49('0xf'));var toCsv=require(_0x7d49('0x9'));var querystring=require(_0x7d49('0x10'));var Papa=require('papaparse');var Redis=require(_0x7d49('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7d49('0x12'));var as=require(_0x7d49('0x13'));var hardwareService=require(_0x7d49('0x14'));var logger=require(_0x7d49('0x15'))(_0x7d49('0x16'));var utils=require(_0x7d49('0x17'));var config=require(_0x7d49('0x18'));var licenseUtil=require(_0x7d49('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4389b7,_0x3d0424){_0x3d0424=_0x3d0424||0xcc;return function(_0x44c4e7){if(_0x44c4e7){return _0x4389b7['sendStatus'](_0x3d0424);}return _0x4389b7[_0x7d49('0x1a')](_0x3d0424)[_0x7d49('0x1b')]();};}function respondWithResult(_0x22d32d,_0x464bee){_0x464bee=_0x464bee||0xc8;return function(_0x59952d){if(_0x59952d){return _0x22d32d[_0x7d49('0x1a')](_0x464bee)['json'](_0x59952d);}};}function respondWithFilteredResult(_0x4d2879,_0x35a43d){return function(_0x26df77){if(_0x26df77){var _0x42de1a=typeof _0x35a43d[_0x7d49('0x1c')]===_0x7d49('0x1d')&&typeof _0x35a43d[_0x7d49('0x1e')]==='undefined';var _0x5637d1=_0x26df77[_0x7d49('0x1f')];var _0x5468f5=_0x42de1a?0x0:_0x35a43d['offset'];var _0x200a7a=_0x42de1a?_0x26df77[_0x7d49('0x1f')]:_0x35a43d[_0x7d49('0x1c')]+_0x35a43d[_0x7d49('0x1e')];var _0x1bbf2e;if(_0x200a7a>=_0x5637d1){_0x200a7a=_0x5637d1;_0x1bbf2e=0xc8;}else{_0x1bbf2e=0xce;}_0x4d2879[_0x7d49('0x1a')](_0x1bbf2e);return _0x4d2879['set'](_0x7d49('0x20'),_0x5468f5+'-'+_0x200a7a+'/'+_0x5637d1)['json'](_0x26df77);}return null;};}function patchUpdates(_0x26a2e3){return function(_0x5b6a62){try{jsonpatch[_0x7d49('0x21')](_0x5b6a62,_0x26a2e3,!![]);}catch(_0x344f2f){return BPromise[_0x7d49('0x22')](_0x344f2f);}return _0x5b6a62[_0x7d49('0x23')]();};}function saveUpdates(_0x49d2e4,_0x21c315){return function(_0x435498){if(_0x435498){return _0x435498[_0x7d49('0x24')](_0x49d2e4)['then'](function(_0x2e813c){return _0x2e813c;});}return null;};}function removeEntity(_0x56cf31,_0x28ba67){return function(_0xae7907){if(_0xae7907){return _0xae7907[_0x7d49('0x25')]()[_0x7d49('0x26')](function(){_0x56cf31[_0x7d49('0x1a')](0xcc)[_0x7d49('0x1b')]();});}};}function handleEntityNotFound(_0xe5f94f,_0x35881c){return function(_0xec79ac){if(!_0xec79ac){_0xe5f94f[_0x7d49('0x27')](0x194);}return _0xec79ac;};}function handleError(_0x45eca8,_0x4fa9a){_0x4fa9a=_0x4fa9a||0x1f4;return function(_0x5911a1){logger[_0x7d49('0x28')](_0x5911a1[_0x7d49('0x29')]);if(_0x5911a1[_0x7d49('0x2a')]){delete _0x5911a1['name'];}_0x45eca8[_0x7d49('0x1a')](_0x4fa9a)['send'](_0x5911a1);};}exports['index']=function(_0x17bb94,_0x2e73cd){var _0xfc2655={},_0x5f0aee={},_0xb9dade={'count':0x0,'rows':[]};var _0x5f989c=_[_0x7d49('0x2b')](db[_0x7d49('0x2c')]['rawAttributes'],function(_0x50a136){return{'name':_0x50a136['fieldName'],'type':_0x50a136['type'][_0x7d49('0x2d')]};});_0x5f0aee[_0x7d49('0x2e')]=_['map'](_0x5f989c,'name');_0x5f0aee[_0x7d49('0x2f')]=_['keys'](_0x17bb94[_0x7d49('0x2f')]);_0x5f0aee[_0x7d49('0x30')]=_[_0x7d49('0x31')](_0x5f0aee[_0x7d49('0x2e')],_0x5f0aee[_0x7d49('0x2f')]);_0xfc2655[_0x7d49('0x32')]=_[_0x7d49('0x31')](_0x5f0aee[_0x7d49('0x2e')],qs['fields'](_0x17bb94['query'][_0x7d49('0x33')]));_0xfc2655[_0x7d49('0x32')]=_0xfc2655['attributes'][_0x7d49('0x34')]?_0xfc2655[_0x7d49('0x32')]:_0x5f0aee[_0x7d49('0x2e')];if(!_0x17bb94[_0x7d49('0x2f')]['hasOwnProperty']('nolimit')){_0xfc2655[_0x7d49('0x1e')]=qs[_0x7d49('0x1e')](_0x17bb94[_0x7d49('0x2f')]['limit']);_0xfc2655[_0x7d49('0x1c')]=qs[_0x7d49('0x1c')](_0x17bb94['query'][_0x7d49('0x1c')]);}_0xfc2655[_0x7d49('0x35')]=qs['sort'](_0x17bb94[_0x7d49('0x2f')][_0x7d49('0x36')]);_0xfc2655[_0x7d49('0x37')]=qs[_0x7d49('0x30')](_[_0x7d49('0x38')](_0x17bb94[_0x7d49('0x2f')],_0x5f0aee[_0x7d49('0x30')]),_0x5f989c);if(_0x17bb94['query'][_0x7d49('0x39')]){_0xfc2655[_0x7d49('0x37')]=_[_0x7d49('0x3a')](_0xfc2655[_0x7d49('0x37')],{'$or':_[_0x7d49('0x2b')](_0x5f989c,function(_0x425220){if(_0x425220[_0x7d49('0x3b')]!==_0x7d49('0x3c')){var _0x555db6={};_0x555db6[_0x425220[_0x7d49('0x2a')]]={'$like':'%'+_0x17bb94[_0x7d49('0x2f')][_0x7d49('0x39')]+'%'};return _0x555db6;}})});}_0xfc2655=_[_0x7d49('0x3a')]({},_0xfc2655,_0x17bb94[_0x7d49('0x3d')]);var _0x126db1={'where':_0xfc2655[_0x7d49('0x37')]};return db[_0x7d49('0x2c')]['count'](_0x126db1)[_0x7d49('0x26')](function(_0x51c4ce){_0xb9dade['count']=_0x51c4ce;if(_0x17bb94[_0x7d49('0x2f')]['includeAll']){_0xfc2655['include']=[{'all':!![]}];}return db[_0x7d49('0x2c')]['findAll'](_0xfc2655);})[_0x7d49('0x26')](function(_0x2580c0){_0xb9dade[_0x7d49('0x3e')]=_0x2580c0;return _0xb9dade;})[_0x7d49('0x26')](respondWithFilteredResult(_0x2e73cd,_0xfc2655))[_0x7d49('0x3f')](handleError(_0x2e73cd,null));};exports[_0x7d49('0x40')]=function(_0x21e903,_0x3019fd){var _0x54b769={'raw':!![],'where':{'id':_0x21e903[_0x7d49('0x41')]['id']}},_0x47aa39={};_0x47aa39[_0x7d49('0x2e')]=_[_0x7d49('0x42')](db[_0x7d49('0x2c')][_0x7d49('0x43')]);_0x47aa39[_0x7d49('0x2f')]=_[_0x7d49('0x42')](_0x21e903[_0x7d49('0x2f')]);_0x47aa39['filters']=_['intersection'](_0x47aa39['model'],_0x47aa39[_0x7d49('0x2f')]);_0x54b769[_0x7d49('0x32')]=_['intersection'](_0x47aa39[_0x7d49('0x2e')],qs[_0x7d49('0x33')](_0x21e903[_0x7d49('0x2f')][_0x7d49('0x33')]));_0x54b769[_0x7d49('0x32')]=_0x54b769[_0x7d49('0x32')][_0x7d49('0x34')]?_0x54b769['attributes']:_0x47aa39[_0x7d49('0x2e')];if(_0x21e903[_0x7d49('0x2f')]['includeAll']){_0x54b769[_0x7d49('0x44')]=[{'all':!![]}];}_0x54b769=_[_0x7d49('0x3a')]({},_0x54b769,_0x21e903[_0x7d49('0x3d')]);return db[_0x7d49('0x2c')][_0x7d49('0x45')](_0x54b769)[_0x7d49('0x26')](handleEntityNotFound(_0x3019fd,null))[_0x7d49('0x26')](respondWithResult(_0x3019fd,null))['catch'](handleError(_0x3019fd,null));};exports[_0x7d49('0x46')]=function(_0x4f178a,_0x51a7de){return db[_0x7d49('0x2c')][_0x7d49('0x46')](_0x4f178a[_0x7d49('0x47')],{})[_0x7d49('0x26')](respondWithResult(_0x51a7de,0xc9))[_0x7d49('0x3f')](handleError(_0x51a7de,null));};exports['update']=function(_0x35f021,_0x3647e3){if(_0x35f021['body']['id']){delete _0x35f021[_0x7d49('0x47')]['id'];}return db[_0x7d49('0x2c')][_0x7d49('0x45')]({'where':{'id':_0x35f021[_0x7d49('0x41')]['id']}})['then'](handleEntityNotFound(_0x3647e3,null))[_0x7d49('0x26')](saveUpdates(_0x35f021['body'],null))[_0x7d49('0x26')](respondWithResult(_0x3647e3,null))[_0x7d49('0x3f')](handleError(_0x3647e3,null));};exports[_0x7d49('0x25')]=function(_0x2ccb2c,_0x559d68){return db[_0x7d49('0x2c')][_0x7d49('0x45')]({'where':{'id':_0x2ccb2c[_0x7d49('0x41')]['id']}})[_0x7d49('0x26')](handleEntityNotFound(_0x559d68,null))[_0x7d49('0x26')](removeEntity(_0x559d68,null))[_0x7d49('0x3f')](handleError(_0x559d68,null));};exports[_0x7d49('0x48')]=function(_0x5b95f6,_0x3c90a2){return db[_0x7d49('0x2c')][_0x7d49('0x48')]()[_0x7d49('0x26')](respondWithResult(_0x3c90a2,null))['catch'](handleError(_0x3c90a2,null));}; \ No newline at end of file +var _0x75f6=['options','includeAll','findAll','rows','show','params','include','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','save','update','then','sendStatus','error','name','send','index','JscriptyQuestionReport','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type'];(function(_0x181bc7,_0x51894e){var _0x4af28b=function(_0x50ddbb){while(--_0x50ddbb){_0x181bc7['push'](_0x181bc7['shift']());}};_0x4af28b(++_0x51894e);}(_0x75f6,0x130));var _0x675f=function(_0x45c5ff,_0xb7535b){_0x45c5ff=_0x45c5ff-0x0;var _0x56a497=_0x75f6[_0x45c5ff];return _0x56a497;};'use strict';var emlformat=require(_0x675f('0x0'));var rimraf=require(_0x675f('0x1'));var zipdir=require(_0x675f('0x2'));var jsonpatch=require(_0x675f('0x3'));var rp=require(_0x675f('0x4'));var moment=require('moment');var BPromise=require(_0x675f('0x5'));var Mustache=require('mustache');var util=require(_0x675f('0x6'));var path=require(_0x675f('0x7'));var sox=require(_0x675f('0x8'));var csv=require(_0x675f('0x9'));var ejs=require(_0x675f('0xa'));var fs=require('fs');var fs_extra=require(_0x675f('0xb'));var _=require(_0x675f('0xc'));var squel=require(_0x675f('0xd'));var crypto=require(_0x675f('0xe'));var jsforce=require(_0x675f('0xf'));var deskjs=require(_0x675f('0x10'));var toCsv=require(_0x675f('0x9'));var querystring=require(_0x675f('0x11'));var Papa=require(_0x675f('0x12'));var Redis=require(_0x675f('0x13'));var authService=require(_0x675f('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x675f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x675f('0x16'));var licenseUtil=require(_0x675f('0x17'));var db=require(_0x675f('0x18'))['db'];function respondWithStatusCode(_0xdfa00c,_0x1ca984){_0x1ca984=_0x1ca984||0xcc;return function(_0x364269){if(_0x364269){return _0xdfa00c['sendStatus'](_0x1ca984);}return _0xdfa00c[_0x675f('0x19')](_0x1ca984)[_0x675f('0x1a')]();};}function respondWithResult(_0x292a5a,_0x3460b1){_0x3460b1=_0x3460b1||0xc8;return function(_0x4d38a2){if(_0x4d38a2){return _0x292a5a[_0x675f('0x19')](_0x3460b1)[_0x675f('0x1b')](_0x4d38a2);}};}function respondWithFilteredResult(_0x53b6e1,_0xd62375){return function(_0x3ef8ba){if(_0x3ef8ba){var _0x157818=typeof _0xd62375[_0x675f('0x1c')]===_0x675f('0x1d')&&typeof _0xd62375['limit']===_0x675f('0x1d');var _0x259935=_0x3ef8ba[_0x675f('0x1e')];var _0x252eac=_0x157818?0x0:_0xd62375['offset'];var _0x6a8f71=_0x157818?_0x3ef8ba[_0x675f('0x1e')]:_0xd62375[_0x675f('0x1c')]+_0xd62375[_0x675f('0x1f')];var _0x2308f5;if(_0x6a8f71>=_0x259935){_0x6a8f71=_0x259935;_0x2308f5=0xc8;}else{_0x2308f5=0xce;}_0x53b6e1['status'](_0x2308f5);return _0x53b6e1[_0x675f('0x20')]('Content-Range',_0x252eac+'-'+_0x6a8f71+'/'+_0x259935)[_0x675f('0x1b')](_0x3ef8ba);}return null;};}function patchUpdates(_0x5d0927){return function(_0x48ca09){try{jsonpatch['apply'](_0x48ca09,_0x5d0927,!![]);}catch(_0x4d9bd3){return BPromise['reject'](_0x4d9bd3);}return _0x48ca09[_0x675f('0x21')]();};}function saveUpdates(_0x3fcc8d,_0x50fc95){return function(_0x4a1184){if(_0x4a1184){return _0x4a1184[_0x675f('0x22')](_0x3fcc8d)[_0x675f('0x23')](function(_0x2c4c39){return _0x2c4c39;});}return null;};}function removeEntity(_0x1b66ee,_0x598e1f){return function(_0x5c3e70){if(_0x5c3e70){return _0x5c3e70['destroy']()[_0x675f('0x23')](function(){_0x1b66ee[_0x675f('0x19')](0xcc)[_0x675f('0x1a')]();});}};}function handleEntityNotFound(_0x21fe4b,_0x56a87d){return function(_0x438077){if(!_0x438077){_0x21fe4b[_0x675f('0x24')](0x194);}return _0x438077;};}function handleError(_0x255bf1,_0x1b0c9b){_0x1b0c9b=_0x1b0c9b||0x1f4;return function(_0x2eff85){logger[_0x675f('0x25')](_0x2eff85['stack']);if(_0x2eff85['name']){delete _0x2eff85[_0x675f('0x26')];}_0x255bf1[_0x675f('0x19')](_0x1b0c9b)[_0x675f('0x27')](_0x2eff85);};}exports[_0x675f('0x28')]=function(_0x205b85,_0x5e99a0){var _0x57bd8f={},_0x75edc1={},_0x24b5a5={'count':0x0,'rows':[]};var _0xf35534=_['map'](db[_0x675f('0x29')][_0x675f('0x2a')],function(_0x3e1b7c){return{'name':_0x3e1b7c['fieldName'],'type':_0x3e1b7c['type'][_0x675f('0x2b')]};});_0x75edc1[_0x675f('0x2c')]=_[_0x675f('0x2d')](_0xf35534,_0x675f('0x26'));_0x75edc1[_0x675f('0x2e')]=_[_0x675f('0x2f')](_0x205b85[_0x675f('0x2e')]);_0x75edc1[_0x675f('0x30')]=_[_0x675f('0x31')](_0x75edc1[_0x675f('0x2c')],_0x75edc1[_0x675f('0x2e')]);_0x57bd8f[_0x675f('0x32')]=_[_0x675f('0x31')](_0x75edc1[_0x675f('0x2c')],qs[_0x675f('0x33')](_0x205b85[_0x675f('0x2e')]['fields']));_0x57bd8f[_0x675f('0x32')]=_0x57bd8f[_0x675f('0x32')][_0x675f('0x34')]?_0x57bd8f[_0x675f('0x32')]:_0x75edc1[_0x675f('0x2c')];if(!_0x205b85[_0x675f('0x2e')][_0x675f('0x35')]('nolimit')){_0x57bd8f[_0x675f('0x1f')]=qs[_0x675f('0x1f')](_0x205b85[_0x675f('0x2e')][_0x675f('0x1f')]);_0x57bd8f[_0x675f('0x1c')]=qs['offset'](_0x205b85['query'][_0x675f('0x1c')]);}_0x57bd8f[_0x675f('0x36')]=qs[_0x675f('0x37')](_0x205b85['query'][_0x675f('0x37')]);_0x57bd8f[_0x675f('0x38')]=qs['filters'](_[_0x675f('0x39')](_0x205b85[_0x675f('0x2e')],_0x75edc1['filters']),_0xf35534);if(_0x205b85['query'][_0x675f('0x3a')]){_0x57bd8f[_0x675f('0x38')]=_[_0x675f('0x3b')](_0x57bd8f['where'],{'$or':_[_0x675f('0x2d')](_0xf35534,function(_0x1fa153){if(_0x1fa153[_0x675f('0x3c')]!=='VIRTUAL'){var _0x4428d2={};_0x4428d2[_0x1fa153[_0x675f('0x26')]]={'$like':'%'+_0x205b85['query'][_0x675f('0x3a')]+'%'};return _0x4428d2;}})});}_0x57bd8f=_[_0x675f('0x3b')]({},_0x57bd8f,_0x205b85[_0x675f('0x3d')]);var _0x4befb3={'where':_0x57bd8f[_0x675f('0x38')]};return db['JscriptyQuestionReport'][_0x675f('0x1e')](_0x4befb3)[_0x675f('0x23')](function(_0x21649a){_0x24b5a5[_0x675f('0x1e')]=_0x21649a;if(_0x205b85[_0x675f('0x2e')][_0x675f('0x3e')]){_0x57bd8f['include']=[{'all':!![]}];}return db[_0x675f('0x29')][_0x675f('0x3f')](_0x57bd8f);})['then'](function(_0x394411){_0x24b5a5[_0x675f('0x40')]=_0x394411;return _0x24b5a5;})[_0x675f('0x23')](respondWithFilteredResult(_0x5e99a0,_0x57bd8f))['catch'](handleError(_0x5e99a0,null));};exports[_0x675f('0x41')]=function(_0x14f9e6,_0x1ba4e8){var _0x518b19={'raw':!![],'where':{'id':_0x14f9e6[_0x675f('0x42')]['id']}},_0x3dbc24={};_0x3dbc24[_0x675f('0x2c')]=_[_0x675f('0x2f')](db[_0x675f('0x29')][_0x675f('0x2a')]);_0x3dbc24[_0x675f('0x2e')]=_[_0x675f('0x2f')](_0x14f9e6[_0x675f('0x2e')]);_0x3dbc24['filters']=_[_0x675f('0x31')](_0x3dbc24[_0x675f('0x2c')],_0x3dbc24[_0x675f('0x2e')]);_0x518b19[_0x675f('0x32')]=_[_0x675f('0x31')](_0x3dbc24[_0x675f('0x2c')],qs[_0x675f('0x33')](_0x14f9e6[_0x675f('0x2e')]['fields']));_0x518b19[_0x675f('0x32')]=_0x518b19[_0x675f('0x32')]['length']?_0x518b19[_0x675f('0x32')]:_0x3dbc24[_0x675f('0x2c')];if(_0x14f9e6[_0x675f('0x2e')][_0x675f('0x3e')]){_0x518b19[_0x675f('0x43')]=[{'all':!![]}];}_0x518b19=_[_0x675f('0x3b')]({},_0x518b19,_0x14f9e6['options']);return db[_0x675f('0x29')]['find'](_0x518b19)[_0x675f('0x23')](handleEntityNotFound(_0x1ba4e8,null))[_0x675f('0x23')](respondWithResult(_0x1ba4e8,null))[_0x675f('0x44')](handleError(_0x1ba4e8,null));};exports[_0x675f('0x45')]=function(_0x4969a7,_0x3d5784){return db['JscriptyQuestionReport'][_0x675f('0x45')](_0x4969a7[_0x675f('0x46')],{})[_0x675f('0x23')](respondWithResult(_0x3d5784,0xc9))[_0x675f('0x44')](handleError(_0x3d5784,null));};exports[_0x675f('0x22')]=function(_0x2603d4,_0xe8c7c1){if(_0x2603d4[_0x675f('0x46')]['id']){delete _0x2603d4['body']['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x2603d4[_0x675f('0x42')]['id']}})[_0x675f('0x23')](handleEntityNotFound(_0xe8c7c1,null))[_0x675f('0x23')](saveUpdates(_0x2603d4[_0x675f('0x46')],null))[_0x675f('0x23')](respondWithResult(_0xe8c7c1,null))[_0x675f('0x44')](handleError(_0xe8c7c1,null));};exports[_0x675f('0x47')]=function(_0x20ab44,_0x14feeb){return db[_0x675f('0x29')]['find']({'where':{'id':_0x20ab44['params']['id']}})[_0x675f('0x23')](handleEntityNotFound(_0x14feeb,null))[_0x675f('0x23')](removeEntity(_0x14feeb,null))['catch'](handleError(_0x14feeb,null));};exports[_0x675f('0x48')]=function(_0x5f5197,_0x2ece96){return db[_0x675f('0x29')]['describe']()[_0x675f('0x23')](respondWithResult(_0x2ece96,null))[_0x675f('0x44')](handleError(_0x2ece96,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 6100d2d..27e9094 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 _0xee39=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0xee39,0x1d8));var _0x9ee3=function(_0x2da595,_0xf817cf){_0x2da595=_0x2da595-0x0;var _0x2e18b8=_0xee39[_0x2da595];return _0x2e18b8;};'use strict';var _=require('lodash');var util=require(_0x9ee3('0x0'));var logger=require(_0x9ee3('0x1'))(_0x9ee3('0x2'));var moment=require(_0x9ee3('0x3'));var BPromise=require(_0x9ee3('0x4'));var rp=require(_0x9ee3('0x5'));var fs=require('fs');var path=require(_0x9ee3('0x6'));var rimraf=require(_0x9ee3('0x7'));var config=require(_0x9ee3('0x8'));var attributes=require(_0x9ee3('0x9'));module[_0x9ee3('0xa')]=function(_0x5be2d5,_0x3de01c){return _0x5be2d5[_0x9ee3('0xb')](_0x9ee3('0xc'),attributes,{'tableName':_0x9ee3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb511=['rimraf','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb511,0x1e6));var _0x1b51=function(_0x2b0e13,_0x42ddc8){_0x2b0e13=_0x2b0e13-0x0;var _0x566712=_0xb511[_0x2b0e13];return _0x566712;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))(_0x1b51('0x3'));var moment=require(_0x1b51('0x4'));var BPromise=require(_0x1b51('0x5'));var rp=require(_0x1b51('0x6'));var fs=require('fs');var path=require(_0x1b51('0x7'));var rimraf=require(_0x1b51('0x8'));var config=require('../../config/environment');var attributes=require(_0x1b51('0x9'));module[_0x1b51('0xa')]=function(_0x20778b,_0x50de82){return _0x20778b['define'](_0x1b51('0xb'),attributes,{'tableName':_0x1b51('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 61d67fd..d804716 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 _0x23fe=['info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x2a440a,_0x13023c){var _0x395c4a=function(_0x350d3e){while(--_0x350d3e){_0x2a440a['push'](_0x2a440a['shift']());}};_0x395c4a(++_0x13023c);}(_0x23fe,0x112));var _0xe23f=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x23fe[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0xe23f('0x0'));var util=require(_0xe23f('0x1'));var moment=require(_0xe23f('0x2'));var BPromise=require('bluebird');var rs=require(_0xe23f('0x3'));var fs=require('fs');var Redis=require(_0xe23f('0x4'));var db=require(_0xe23f('0x5'))['db'];var utils=require(_0xe23f('0x6'));var logger=require(_0xe23f('0x7'))(_0xe23f('0x8'));var config=require(_0xe23f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe23f('0xa')][_0xe23f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x509485,_0x220583,_0x157d6d){return new BPromise(function(_0x363496,_0x41c0a9){return client[_0xe23f('0xc')](_0x509485,_0x157d6d)[_0xe23f('0xd')](function(_0x25b523){logger[_0xe23f('0xe')](_0xe23f('0xf'),_0x220583,_0xe23f('0x10'));logger[_0xe23f('0x11')](_0xe23f('0x12'),_0x220583,_0xe23f('0x10'),JSON['stringify'](_0x25b523));if(_0x25b523[_0xe23f('0x13')]){if(_0x25b523['error'][_0xe23f('0x14')]===0x1f4){logger[_0xe23f('0x13')](_0xe23f('0xf'),_0x220583,_0x25b523[_0xe23f('0x13')][_0xe23f('0x15')]);return _0x41c0a9(_0x25b523[_0xe23f('0x13')][_0xe23f('0x15')]);}logger[_0xe23f('0x13')](_0xe23f('0xf'),_0x220583,_0x25b523[_0xe23f('0x13')][_0xe23f('0x15')]);return _0x363496(_0x25b523[_0xe23f('0x13')][_0xe23f('0x15')]);}else{logger[_0xe23f('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x220583,'request\x20sent');_0x363496(_0x25b523[_0xe23f('0x16')][_0xe23f('0x15')]);}})[_0xe23f('0x17')](function(_0x5b9b29){logger[_0xe23f('0x13')](_0xe23f('0xf'),_0x220583,_0x5b9b29);_0x41c0a9(_0x5b9b29);});});} \ No newline at end of file +var _0x5d89=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5d89,0x10f));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x95d8('0x0'));var moment=require(_0x95d8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95d8('0x2'));var db=require(_0x95d8('0x3'))['db'];var utils=require(_0x95d8('0x4'));var logger=require(_0x95d8('0x5'))(_0x95d8('0x6'));var config=require(_0x95d8('0x7'));var jayson=require(_0x95d8('0x8'));var client=jayson[_0x95d8('0x9')][_0x95d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e3e26,_0x41634c,_0x324be4){return new BPromise(function(_0x456baf,_0x5c31e2){return client[_0x95d8('0xb')](_0x7e3e26,_0x324be4)[_0x95d8('0xc')](function(_0x178e38){logger[_0x95d8('0xd')](_0x95d8('0xe'),_0x41634c,_0x95d8('0xf'));logger['debug'](_0x95d8('0x10'),_0x41634c,_0x95d8('0xf'),JSON[_0x95d8('0x11')](_0x178e38));if(_0x178e38[_0x95d8('0x12')]){if(_0x178e38['error'][_0x95d8('0x13')]===0x1f4){logger[_0x95d8('0x12')](_0x95d8('0xe'),_0x41634c,_0x178e38[_0x95d8('0x12')][_0x95d8('0x14')]);return _0x5c31e2(_0x178e38[_0x95d8('0x12')][_0x95d8('0x14')]);}logger['error'](_0x95d8('0xe'),_0x41634c,_0x178e38['error'][_0x95d8('0x14')]);return _0x456baf(_0x178e38['error'][_0x95d8('0x14')]);}else{logger[_0x95d8('0xd')](_0x95d8('0xe'),_0x41634c,_0x95d8('0xf'));_0x456baf(_0x178e38[_0x95d8('0x15')][_0x95d8('0x14')]);}})[_0x95d8('0x16')](function(_0x48ff15){logger[_0x95d8('0x12')](_0x95d8('0xe'),_0x41634c,_0x48ff15);_0x5c31e2(_0x48ff15);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index d461b7e..c29b5d1 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 _0xa786=['get','isAuthenticated','index','describe','show','/:id/questions','getQuestions','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller'];(function(_0x14261e,_0x177aad){var _0x50704d=function(_0x41dffe){while(--_0x41dffe){_0x14261e['push'](_0x14261e['shift']());}};_0x50704d(++_0x177aad);}(_0xa786,0x12b));var _0x6a78=function(_0x2e18b9,_0x3b2126){_0x2e18b9=_0x2e18b9-0x0;var _0x419443=_0xa786[_0x2e18b9];return _0x419443;};'use strict';var multer=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var path=require(_0x6a78('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a78('0x3'));var router=express[_0x6a78('0x4')]();var fs_extra=require(_0x6a78('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a78('0x6'));var config=require(_0x6a78('0x7'));var controller=require(_0x6a78('0x8'));router[_0x6a78('0x9')]('/',auth[_0x6a78('0xa')](),controller[_0x6a78('0xb')]);router[_0x6a78('0x9')]('/describe',auth[_0x6a78('0xa')](),controller[_0x6a78('0xc')]);router[_0x6a78('0x9')]('/:id',auth[_0x6a78('0xa')](),controller[_0x6a78('0xd')]);router[_0x6a78('0x9')](_0x6a78('0xe'),auth[_0x6a78('0xa')](),controller[_0x6a78('0xf')]);router[_0x6a78('0x10')]('/',auth['isAuthenticated'](),controller[_0x6a78('0x11')]);router[_0x6a78('0x12')]('/:id',auth[_0x6a78('0xa')](),controller[_0x6a78('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6a78('0x14')]);module[_0x6a78('0x15')]=router; \ No newline at end of file +var _0x4ac2=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller'];(function(_0x257191,_0x56895d){var _0x19e7de=function(_0x56d6fe){while(--_0x56d6fe){_0x257191['push'](_0x257191['shift']());}};_0x19e7de(++_0x56895d);}(_0x4ac2,0x137));var _0x24ac=function(_0x2f28b7,_0x973180){_0x2f28b7=_0x2f28b7-0x0;var _0x51e3b8=_0x4ac2[_0x2f28b7];return _0x51e3b8;};'use strict';var multer=require(_0x24ac('0x0'));var util=require(_0x24ac('0x1'));var path=require(_0x24ac('0x2'));var timeout=require(_0x24ac('0x3'));var express=require('express');var router=express[_0x24ac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x24ac('0x5'));var interaction=require(_0x24ac('0x6'));var config=require(_0x24ac('0x7'));var controller=require(_0x24ac('0x8'));router[_0x24ac('0x9')]('/',auth[_0x24ac('0xa')](),controller[_0x24ac('0xb')]);router['get'](_0x24ac('0xc'),auth[_0x24ac('0xa')](),controller['describe']);router[_0x24ac('0x9')](_0x24ac('0xd'),auth[_0x24ac('0xa')](),controller[_0x24ac('0xe')]);router[_0x24ac('0x9')]('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router[_0x24ac('0xf')]('/',auth[_0x24ac('0xa')](),controller[_0x24ac('0x10')]);router[_0x24ac('0x11')](_0x24ac('0xd'),auth[_0x24ac('0xa')](),controller['update']);router[_0x24ac('0x12')](_0x24ac('0xd'),auth[_0x24ac('0xa')](),controller[_0x24ac('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index afac748..1e0f5ce 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 _0xf6ff=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','starttime','endtime'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf6ff,0x11b));var _0xff6f=function(_0x3e0163,_0x305eac){_0x3e0163=_0x3e0163-0x0;var _0x3dff0b=_0xf6ff[_0x3e0163];return _0x3dff0b;};'use strict';var moment=require(_0xff6f('0x0'));var Sequelize=require(_0xff6f('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xff6f('0x2')],'set':function(_0x3bf59f){this['setDataValue'](_0xff6f('0x3'),_0x3bf59f);this['setDataValue'](_0xff6f('0x4'),moment()['format'](_0xff6f('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xff6f('0x6')]},'queue':{'type':Sequelize[_0xff6f('0x6')]},'uniqueid':{'type':Sequelize[_0xff6f('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xff6f('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xfd82=['setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfd82,0x138));var _0x2fd8=function(_0xd0825d,_0x3d707b){_0xd0825d=_0xd0825d-0x0;var _0x300b58=_0xfd82[_0xd0825d];return _0x300b58;};'use strict';var moment=require(_0x2fd8('0x0'));var Sequelize=require(_0x2fd8('0x1'));module[_0x2fd8('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x563174){this[_0x2fd8('0x3')](_0x2fd8('0x4'),_0x563174);this['setDataValue'](_0x2fd8('0x5'),moment()['format'](_0x2fd8('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2fd8('0x7')]},'projectname':{'type':Sequelize[_0x2fd8('0x7')]},'queue':{'type':Sequelize[_0x2fd8('0x7')]},'uniqueid':{'type':Sequelize[_0x2fd8('0x7')]},'calleridname':{'type':Sequelize[_0x2fd8('0x7')]},'calleridnum':{'type':Sequelize[_0x2fd8('0x7')]},'completed':{'type':Sequelize[_0x2fd8('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 13850ba..14dddff 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 _0x6034=['../../config/environment','../../mysqldb','status','offset','undefined','count','set','apply','save','update','then','destroy','sendStatus','error','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','include','options','find','catch','create','body','describe','findOne','SessionId','JscriptyQuestionReport','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api'];(function(_0x46d063,_0x33116e){var _0x54b3f0=function(_0x53d062){while(--_0x53d062){_0x46d063['push'](_0x46d063['shift']());}};_0x54b3f0(++_0x33116e);}(_0x6034,0x155));var _0x4603=function(_0x45bde6,_0x1db09f){_0x45bde6=_0x45bde6-0x0;var _0x10e4a4=_0x6034[_0x45bde6];return _0x10e4a4;};'use strict';var emlformat=require(_0x4603('0x0'));var rimraf=require(_0x4603('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4603('0x2'));var rp=require(_0x4603('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4603('0x4'));var util=require('util');var path=require(_0x4603('0x5'));var sox=require(_0x4603('0x6'));var csv=require(_0x4603('0x7'));var ejs=require(_0x4603('0x8'));var fs=require('fs');var fs_extra=require(_0x4603('0x9'));var _=require('lodash');var squel=require(_0x4603('0xa'));var crypto=require(_0x4603('0xb'));var jsforce=require(_0x4603('0xc'));var deskjs=require(_0x4603('0xd'));var toCsv=require(_0x4603('0x7'));var querystring=require('querystring');var Papa=require(_0x4603('0xe'));var Redis=require(_0x4603('0xf'));var authService=require(_0x4603('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4603('0x11'))(_0x4603('0x12'));var utils=require('../../config/utils');var config=require(_0x4603('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4603('0x14'))['db'];function respondWithStatusCode(_0x210d72,_0x27c000){_0x27c000=_0x27c000||0xcc;return function(_0x38c90d){if(_0x38c90d){return _0x210d72['sendStatus'](_0x27c000);}return _0x210d72[_0x4603('0x15')](_0x27c000)['end']();};}function respondWithResult(_0x1ae171,_0x1754c2){_0x1754c2=_0x1754c2||0xc8;return function(_0x47fdb5){if(_0x47fdb5){return _0x1ae171[_0x4603('0x15')](_0x1754c2)['json'](_0x47fdb5);}};}function respondWithFilteredResult(_0x5eb52f,_0x52d80d){return function(_0x59ba5a){if(_0x59ba5a){var _0x502dc4=typeof _0x52d80d[_0x4603('0x16')]===_0x4603('0x17')&&typeof _0x52d80d['limit']===_0x4603('0x17');var _0x4be3f7=_0x59ba5a[_0x4603('0x18')];var _0x5503f9=_0x502dc4?0x0:_0x52d80d['offset'];var _0x50ee53=_0x502dc4?_0x59ba5a[_0x4603('0x18')]:_0x52d80d[_0x4603('0x16')]+_0x52d80d['limit'];var _0xacb25b;if(_0x50ee53>=_0x4be3f7){_0x50ee53=_0x4be3f7;_0xacb25b=0xc8;}else{_0xacb25b=0xce;}_0x5eb52f['status'](_0xacb25b);return _0x5eb52f[_0x4603('0x19')]('Content-Range',_0x5503f9+'-'+_0x50ee53+'/'+_0x4be3f7)['json'](_0x59ba5a);}return null;};}function patchUpdates(_0x4e5e15){return function(_0x494d59){try{jsonpatch[_0x4603('0x1a')](_0x494d59,_0x4e5e15,!![]);}catch(_0x166cd3){return BPromise['reject'](_0x166cd3);}return _0x494d59[_0x4603('0x1b')]();};}function saveUpdates(_0x12d34e,_0x1b4514){return function(_0x1ca13d){if(_0x1ca13d){return _0x1ca13d[_0x4603('0x1c')](_0x12d34e)[_0x4603('0x1d')](function(_0x385cfc){return _0x385cfc;});}return null;};}function removeEntity(_0x248e43,_0xb603ea){return function(_0x2a152c){if(_0x2a152c){return _0x2a152c[_0x4603('0x1e')]()['then'](function(){_0x248e43[_0x4603('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389625,_0x4b8e45){return function(_0x5bfaf8){if(!_0x5bfaf8){_0x389625[_0x4603('0x1f')](0x194);}return _0x5bfaf8;};}function handleError(_0x22292e,_0x16724f){_0x16724f=_0x16724f||0x1f4;return function(_0x151db5){logger[_0x4603('0x20')](_0x151db5['stack']);if(_0x151db5['name']){delete _0x151db5[_0x4603('0x21')];}_0x22292e[_0x4603('0x15')](_0x16724f)['send'](_0x151db5);};}exports[_0x4603('0x22')]=function(_0x164a51,_0x3a7472){var _0x25a920={},_0x135ba4={},_0xb3882f={'count':0x0,'rows':[]};var _0x4c22cb=_[_0x4603('0x23')](db[_0x4603('0x24')][_0x4603('0x25')],function(_0x4ceffa){return{'name':_0x4ceffa[_0x4603('0x26')],'type':_0x4ceffa[_0x4603('0x27')][_0x4603('0x28')]};});_0x135ba4['model']=_['map'](_0x4c22cb,_0x4603('0x21'));_0x135ba4[_0x4603('0x29')]=_[_0x4603('0x2a')](_0x164a51[_0x4603('0x29')]);_0x135ba4[_0x4603('0x2b')]=_[_0x4603('0x2c')](_0x135ba4[_0x4603('0x2d')],_0x135ba4['query']);_0x25a920[_0x4603('0x2e')]=_[_0x4603('0x2c')](_0x135ba4['model'],qs[_0x4603('0x2f')](_0x164a51[_0x4603('0x29')][_0x4603('0x2f')]));_0x25a920[_0x4603('0x2e')]=_0x25a920[_0x4603('0x2e')][_0x4603('0x30')]?_0x25a920['attributes']:_0x135ba4[_0x4603('0x2d')];if(!_0x164a51[_0x4603('0x29')][_0x4603('0x31')]('nolimit')){_0x25a920[_0x4603('0x32')]=qs[_0x4603('0x32')](_0x164a51['query'][_0x4603('0x32')]);_0x25a920['offset']=qs[_0x4603('0x16')](_0x164a51['query'][_0x4603('0x16')]);}_0x25a920[_0x4603('0x33')]=qs[_0x4603('0x34')](_0x164a51['query'][_0x4603('0x34')]);_0x25a920[_0x4603('0x35')]=qs['filters'](_[_0x4603('0x36')](_0x164a51[_0x4603('0x29')],_0x135ba4[_0x4603('0x2b')]),_0x4c22cb);if(_0x164a51[_0x4603('0x29')][_0x4603('0x37')]){_0x25a920[_0x4603('0x35')]=_[_0x4603('0x38')](_0x25a920[_0x4603('0x35')],{'$or':_[_0x4603('0x23')](_0x4c22cb,function(_0x5349c1){if(_0x5349c1[_0x4603('0x27')]!==_0x4603('0x39')){var _0x264186={};_0x264186[_0x5349c1['name']]={'$like':'%'+_0x164a51['query'][_0x4603('0x37')]+'%'};return _0x264186;}})});}_0x25a920=_[_0x4603('0x38')]({},_0x25a920,_0x164a51['options']);var _0x58c37d={'where':_0x25a920['where']};return db[_0x4603('0x24')][_0x4603('0x18')](_0x58c37d)[_0x4603('0x1d')](function(_0x44aec8){_0xb3882f[_0x4603('0x18')]=_0x44aec8;if(_0x164a51['query'][_0x4603('0x3a')]){_0x25a920['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x25a920);})[_0x4603('0x1d')](function(_0x174f8e){_0xb3882f[_0x4603('0x3b')]=_0x174f8e;return _0xb3882f;})[_0x4603('0x1d')](respondWithFilteredResult(_0x3a7472,_0x25a920))['catch'](handleError(_0x3a7472,null));};exports[_0x4603('0x3c')]=function(_0x23d02e,_0x3b22bb){var _0x125320={'raw':!![],'where':{'id':_0x23d02e[_0x4603('0x3d')]['id']}},_0x2db932={};_0x2db932[_0x4603('0x2d')]=_[_0x4603('0x2a')](db['JscriptySessionReport'][_0x4603('0x25')]);_0x2db932[_0x4603('0x29')]=_['keys'](_0x23d02e['query']);_0x2db932[_0x4603('0x2b')]=_[_0x4603('0x2c')](_0x2db932[_0x4603('0x2d')],_0x2db932[_0x4603('0x29')]);_0x125320[_0x4603('0x2e')]=_['intersection'](_0x2db932['model'],qs[_0x4603('0x2f')](_0x23d02e['query'][_0x4603('0x2f')]));_0x125320[_0x4603('0x2e')]=_0x125320[_0x4603('0x2e')][_0x4603('0x30')]?_0x125320[_0x4603('0x2e')]:_0x2db932[_0x4603('0x2d')];if(_0x23d02e[_0x4603('0x29')][_0x4603('0x3a')]){_0x125320[_0x4603('0x3e')]=[{'all':!![]}];}_0x125320=_[_0x4603('0x38')]({},_0x125320,_0x23d02e[_0x4603('0x3f')]);return db[_0x4603('0x24')][_0x4603('0x40')](_0x125320)[_0x4603('0x1d')](handleEntityNotFound(_0x3b22bb,null))[_0x4603('0x1d')](respondWithResult(_0x3b22bb,null))[_0x4603('0x41')](handleError(_0x3b22bb,null));};exports[_0x4603('0x42')]=function(_0x59e6bc,_0x37fc99){return db['JscriptySessionReport'][_0x4603('0x42')](_0x59e6bc['body'],{})['then'](respondWithResult(_0x37fc99,0xc9))['catch'](handleError(_0x37fc99,null));};exports[_0x4603('0x1c')]=function(_0x4fd4a5,_0x1ac66c){if(_0x4fd4a5[_0x4603('0x43')]['id']){delete _0x4fd4a5['body']['id'];}return db[_0x4603('0x24')][_0x4603('0x40')]({'where':{'id':_0x4fd4a5['params']['id']}})[_0x4603('0x1d')](handleEntityNotFound(_0x1ac66c,null))[_0x4603('0x1d')](saveUpdates(_0x4fd4a5[_0x4603('0x43')],null))[_0x4603('0x1d')](respondWithResult(_0x1ac66c,null))[_0x4603('0x41')](handleError(_0x1ac66c,null));};exports[_0x4603('0x1e')]=function(_0x4b3c90,_0x1be1e9){return db['JscriptySessionReport'][_0x4603('0x40')]({'where':{'id':_0x4b3c90[_0x4603('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1be1e9,null))[_0x4603('0x1d')](removeEntity(_0x1be1e9,null))[_0x4603('0x41')](handleError(_0x1be1e9,null));};exports['describe']=function(_0x1c67c1,_0x3477cc){return db[_0x4603('0x24')][_0x4603('0x44')]()['then'](respondWithResult(_0x3477cc,null))['catch'](handleError(_0x3477cc,null));};exports['getQuestions']=function(_0x5be136,_0x5180f1,_0x1ba452){var _0x22e605={'raw':!![],'where':{}};var _0x130f99={};var _0x4526c1={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4603('0x45')]({'where':{'id':_0x5be136[_0x4603('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5180f1,null))[_0x4603('0x1d')](function(_0x32fb06){if(_0x32fb06){_0x130f99['model']=_['keys'](db['JscriptyQuestionReport'][_0x4603('0x25')]);_0x130f99[_0x4603('0x29')]=_[_0x4603('0x2a')](_0x5be136[_0x4603('0x29')]);_0x130f99['filters']=_[_0x4603('0x2c')](_0x130f99['model'],_0x130f99[_0x4603('0x29')]);_0x22e605[_0x4603('0x2e')]=_[_0x4603('0x2c')](_0x130f99[_0x4603('0x2d')],qs['fields'](_0x5be136[_0x4603('0x29')]['fields']));_0x22e605[_0x4603('0x2e')]=_0x22e605['attributes']['length']?_0x22e605[_0x4603('0x2e')]:_0x130f99['model'];if(!_0x5be136['query'][_0x4603('0x31')]('nolimit')){_0x22e605[_0x4603('0x32')]=qs[_0x4603('0x32')](_0x5be136[_0x4603('0x29')][_0x4603('0x32')]);_0x22e605[_0x4603('0x16')]=qs['offset'](_0x5be136[_0x4603('0x29')][_0x4603('0x16')]);}_0x22e605[_0x4603('0x33')]=qs[_0x4603('0x34')](_0x5be136['query'][_0x4603('0x34')]);_0x22e605[_0x4603('0x35')]=qs[_0x4603('0x2b')](_[_0x4603('0x36')](_0x5be136[_0x4603('0x29')],_0x130f99[_0x4603('0x2b')]));_0x22e605['where'][_0x4603('0x46')]=_0x32fb06['id'];if(_0x5be136[_0x4603('0x29')]['filter']){_0x22e605[_0x4603('0x35')]=_[_0x4603('0x38')](_0x22e605[_0x4603('0x35')],{'$or':_[_0x4603('0x23')](_0x22e605['attributes'],function(_0x59d006){var _0x14f7f0={};_0x14f7f0[_0x59d006]={'$like':'%'+_0x5be136[_0x4603('0x29')][_0x4603('0x37')]+'%'};return _0x14f7f0;})});}_0x22e605=_[_0x4603('0x38')]({},_0x22e605,_0x5be136[_0x4603('0x3f')]);return db[_0x4603('0x47')][_0x4603('0x18')]({'where':_0x22e605[_0x4603('0x35')]})[_0x4603('0x1d')](function(_0x48bb5f){_0x4526c1[_0x4603('0x18')]=_0x48bb5f;if(_0x5be136[_0x4603('0x29')][_0x4603('0x3a')]){_0x22e605[_0x4603('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x22e605);})[_0x4603('0x1d')](function(_0x9abe86){_0x4526c1[_0x4603('0x3b')]=_0x9abe86;return _0x4526c1;});}})['then'](respondWithFilteredResult(_0x5180f1,_0x22e605))['catch'](handleError(_0x5180f1,null));}; \ No newline at end of file +var _0xbee8=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','options','JscriptySessionReport','includeAll','include','rows','catch','params','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','order','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x57562e,_0x460cfe){var _0x521e14=function(_0x2275cc){while(--_0x2275cc){_0x57562e['push'](_0x57562e['shift']());}};_0x521e14(++_0x460cfe);}(_0xbee8,0x128));var _0x8bee=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0xbee8[_0x3b5ad9];return _0x611ae9;};'use strict';var emlformat=require(_0x8bee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bee('0x1'));var jsonpatch=require(_0x8bee('0x2'));var rp=require(_0x8bee('0x3'));var moment=require(_0x8bee('0x4'));var BPromise=require(_0x8bee('0x5'));var Mustache=require('mustache');var util=require(_0x8bee('0x6'));var path=require(_0x8bee('0x7'));var sox=require(_0x8bee('0x8'));var csv=require('to-csv');var ejs=require(_0x8bee('0x9'));var fs=require('fs');var fs_extra=require(_0x8bee('0xa'));var _=require(_0x8bee('0xb'));var squel=require('squel');var crypto=require(_0x8bee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8bee('0xd'));var toCsv=require(_0x8bee('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8bee('0xf'));var authService=require(_0x8bee('0x10'));var qs=require(_0x8bee('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bee('0x12'));var logger=require(_0x8bee('0x13'))(_0x8bee('0x14'));var utils=require(_0x8bee('0x15'));var config=require(_0x8bee('0x16'));var licenseUtil=require(_0x8bee('0x17'));var db=require(_0x8bee('0x18'))['db'];function respondWithStatusCode(_0x145852,_0x4e98d1){_0x4e98d1=_0x4e98d1||0xcc;return function(_0xac337d){if(_0xac337d){return _0x145852[_0x8bee('0x19')](_0x4e98d1);}return _0x145852['status'](_0x4e98d1)['end']();};}function respondWithResult(_0x15d2e7,_0x565504){_0x565504=_0x565504||0xc8;return function(_0x591a29){if(_0x591a29){return _0x15d2e7[_0x8bee('0x1a')](_0x565504)[_0x8bee('0x1b')](_0x591a29);}};}function respondWithFilteredResult(_0x4ed9ba,_0x57a560){return function(_0x5e1d3c){if(_0x5e1d3c){var _0x2de8fc=typeof _0x57a560[_0x8bee('0x1c')]==='undefined'&&typeof _0x57a560['limit']===_0x8bee('0x1d');var _0x36a17b=_0x5e1d3c[_0x8bee('0x1e')];var _0x454c78=_0x2de8fc?0x0:_0x57a560[_0x8bee('0x1c')];var _0x2f6fa5=_0x2de8fc?_0x5e1d3c['count']:_0x57a560[_0x8bee('0x1c')]+_0x57a560[_0x8bee('0x1f')];var _0x54b168;if(_0x2f6fa5>=_0x36a17b){_0x2f6fa5=_0x36a17b;_0x54b168=0xc8;}else{_0x54b168=0xce;}_0x4ed9ba['status'](_0x54b168);return _0x4ed9ba[_0x8bee('0x20')](_0x8bee('0x21'),_0x454c78+'-'+_0x2f6fa5+'/'+_0x36a17b)[_0x8bee('0x1b')](_0x5e1d3c);}return null;};}function patchUpdates(_0x3108f9){return function(_0x28ba34){try{jsonpatch['apply'](_0x28ba34,_0x3108f9,!![]);}catch(_0x811551){return BPromise['reject'](_0x811551);}return _0x28ba34['save']();};}function saveUpdates(_0x325dcc,_0xa61d94){return function(_0xb2636e){if(_0xb2636e){return _0xb2636e[_0x8bee('0x22')](_0x325dcc)[_0x8bee('0x23')](function(_0x3314e4){return _0x3314e4;});}return null;};}function removeEntity(_0x1c860f,_0x59cb0a){return function(_0x4613db){if(_0x4613db){return _0x4613db[_0x8bee('0x24')]()[_0x8bee('0x23')](function(){_0x1c860f['status'](0xcc)[_0x8bee('0x25')]();});}};}function handleEntityNotFound(_0x587f4c,_0x5c78ff){return function(_0x1b015c){if(!_0x1b015c){_0x587f4c[_0x8bee('0x19')](0x194);}return _0x1b015c;};}function handleError(_0x246c53,_0x4652e9){_0x4652e9=_0x4652e9||0x1f4;return function(_0x426d2d){logger[_0x8bee('0x26')](_0x426d2d[_0x8bee('0x27')]);if(_0x426d2d[_0x8bee('0x28')]){delete _0x426d2d[_0x8bee('0x28')];}_0x246c53['status'](_0x4652e9)[_0x8bee('0x29')](_0x426d2d);};}exports[_0x8bee('0x2a')]=function(_0x563215,_0x5a682){var _0x40abe4={},_0x4abea9={},_0x1300c3={'count':0x0,'rows':[]};var _0x3074fa=_[_0x8bee('0x2b')](db['JscriptySessionReport'][_0x8bee('0x2c')],function(_0x5f5bf1){return{'name':_0x5f5bf1[_0x8bee('0x2d')],'type':_0x5f5bf1[_0x8bee('0x2e')]['key']};});_0x4abea9['model']=_['map'](_0x3074fa,_0x8bee('0x28'));_0x4abea9[_0x8bee('0x2f')]=_[_0x8bee('0x30')](_0x563215['query']);_0x4abea9[_0x8bee('0x31')]=_[_0x8bee('0x32')](_0x4abea9[_0x8bee('0x33')],_0x4abea9[_0x8bee('0x2f')]);_0x40abe4['attributes']=_[_0x8bee('0x32')](_0x4abea9[_0x8bee('0x33')],qs[_0x8bee('0x34')](_0x563215[_0x8bee('0x2f')][_0x8bee('0x34')]));_0x40abe4[_0x8bee('0x35')]=_0x40abe4[_0x8bee('0x35')][_0x8bee('0x36')]?_0x40abe4[_0x8bee('0x35')]:_0x4abea9[_0x8bee('0x33')];if(!_0x563215[_0x8bee('0x2f')]['hasOwnProperty']('nolimit')){_0x40abe4[_0x8bee('0x1f')]=qs['limit'](_0x563215[_0x8bee('0x2f')][_0x8bee('0x1f')]);_0x40abe4[_0x8bee('0x1c')]=qs[_0x8bee('0x1c')](_0x563215[_0x8bee('0x2f')]['offset']);}_0x40abe4['order']=qs[_0x8bee('0x37')](_0x563215[_0x8bee('0x2f')]['sort']);_0x40abe4[_0x8bee('0x38')]=qs['filters'](_[_0x8bee('0x39')](_0x563215[_0x8bee('0x2f')],_0x4abea9[_0x8bee('0x31')]),_0x3074fa);if(_0x563215['query'][_0x8bee('0x3a')]){_0x40abe4['where']=_[_0x8bee('0x3b')](_0x40abe4[_0x8bee('0x38')],{'$or':_[_0x8bee('0x2b')](_0x3074fa,function(_0x4098f5){if(_0x4098f5[_0x8bee('0x2e')]!==_0x8bee('0x3c')){var _0x52428b={};_0x52428b[_0x4098f5[_0x8bee('0x28')]]={'$like':'%'+_0x563215[_0x8bee('0x2f')][_0x8bee('0x3a')]+'%'};return _0x52428b;}})});}_0x40abe4=_[_0x8bee('0x3b')]({},_0x40abe4,_0x563215[_0x8bee('0x3d')]);var _0x47a61b={'where':_0x40abe4['where']};return db[_0x8bee('0x3e')][_0x8bee('0x1e')](_0x47a61b)['then'](function(_0x3d7ce3){_0x1300c3[_0x8bee('0x1e')]=_0x3d7ce3;if(_0x563215[_0x8bee('0x2f')][_0x8bee('0x3f')]){_0x40abe4[_0x8bee('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x40abe4);})['then'](function(_0x48852b){_0x1300c3[_0x8bee('0x41')]=_0x48852b;return _0x1300c3;})[_0x8bee('0x23')](respondWithFilteredResult(_0x5a682,_0x40abe4))[_0x8bee('0x42')](handleError(_0x5a682,null));};exports['show']=function(_0x15a31d,_0x174030){var _0x1ec96d={'raw':!![],'where':{'id':_0x15a31d[_0x8bee('0x43')]['id']}},_0x3cb4b5={};_0x3cb4b5[_0x8bee('0x33')]=_[_0x8bee('0x30')](db[_0x8bee('0x3e')][_0x8bee('0x2c')]);_0x3cb4b5[_0x8bee('0x2f')]=_['keys'](_0x15a31d[_0x8bee('0x2f')]);_0x3cb4b5[_0x8bee('0x31')]=_['intersection'](_0x3cb4b5[_0x8bee('0x33')],_0x3cb4b5[_0x8bee('0x2f')]);_0x1ec96d[_0x8bee('0x35')]=_[_0x8bee('0x32')](_0x3cb4b5['model'],qs['fields'](_0x15a31d[_0x8bee('0x2f')][_0x8bee('0x34')]));_0x1ec96d[_0x8bee('0x35')]=_0x1ec96d[_0x8bee('0x35')]['length']?_0x1ec96d[_0x8bee('0x35')]:_0x3cb4b5['model'];if(_0x15a31d[_0x8bee('0x2f')][_0x8bee('0x3f')]){_0x1ec96d[_0x8bee('0x40')]=[{'all':!![]}];}_0x1ec96d=_[_0x8bee('0x3b')]({},_0x1ec96d,_0x15a31d['options']);return db[_0x8bee('0x3e')][_0x8bee('0x44')](_0x1ec96d)['then'](handleEntityNotFound(_0x174030,null))['then'](respondWithResult(_0x174030,null))['catch'](handleError(_0x174030,null));};exports[_0x8bee('0x45')]=function(_0x2f3337,_0x1827b9){return db[_0x8bee('0x3e')][_0x8bee('0x45')](_0x2f3337[_0x8bee('0x46')],{})[_0x8bee('0x23')](respondWithResult(_0x1827b9,0xc9))[_0x8bee('0x42')](handleError(_0x1827b9,null));};exports[_0x8bee('0x22')]=function(_0x14bc03,_0x2fc0c2){if(_0x14bc03[_0x8bee('0x46')]['id']){delete _0x14bc03['body']['id'];}return db[_0x8bee('0x3e')][_0x8bee('0x44')]({'where':{'id':_0x14bc03[_0x8bee('0x43')]['id']}})[_0x8bee('0x23')](handleEntityNotFound(_0x2fc0c2,null))[_0x8bee('0x23')](saveUpdates(_0x14bc03[_0x8bee('0x46')],null))[_0x8bee('0x23')](respondWithResult(_0x2fc0c2,null))[_0x8bee('0x42')](handleError(_0x2fc0c2,null));};exports[_0x8bee('0x24')]=function(_0x324522,_0x58a0f9){return db[_0x8bee('0x3e')]['find']({'where':{'id':_0x324522[_0x8bee('0x43')]['id']}})[_0x8bee('0x23')](handleEntityNotFound(_0x58a0f9,null))[_0x8bee('0x23')](removeEntity(_0x58a0f9,null))[_0x8bee('0x42')](handleError(_0x58a0f9,null));};exports['describe']=function(_0x20bf19,_0xf809de){return db[_0x8bee('0x3e')][_0x8bee('0x47')]()[_0x8bee('0x23')](respondWithResult(_0xf809de,null))['catch'](handleError(_0xf809de,null));};exports[_0x8bee('0x48')]=function(_0xa4ecae,_0x3a2f6d,_0x57d3ce){var _0x2cc3a7={'raw':!![],'where':{}};var _0xff8f6d={};var _0x36e294={'count':0x0,'rows':[]};return db[_0x8bee('0x3e')][_0x8bee('0x49')]({'where':{'id':_0xa4ecae[_0x8bee('0x43')]['id']}})[_0x8bee('0x23')](handleEntityNotFound(_0x3a2f6d,null))[_0x8bee('0x23')](function(_0x427ebd){if(_0x427ebd){_0xff8f6d[_0x8bee('0x33')]=_['keys'](db[_0x8bee('0x4a')]['rawAttributes']);_0xff8f6d[_0x8bee('0x2f')]=_[_0x8bee('0x30')](_0xa4ecae[_0x8bee('0x2f')]);_0xff8f6d[_0x8bee('0x31')]=_[_0x8bee('0x32')](_0xff8f6d[_0x8bee('0x33')],_0xff8f6d[_0x8bee('0x2f')]);_0x2cc3a7[_0x8bee('0x35')]=_[_0x8bee('0x32')](_0xff8f6d[_0x8bee('0x33')],qs[_0x8bee('0x34')](_0xa4ecae[_0x8bee('0x2f')][_0x8bee('0x34')]));_0x2cc3a7[_0x8bee('0x35')]=_0x2cc3a7[_0x8bee('0x35')][_0x8bee('0x36')]?_0x2cc3a7['attributes']:_0xff8f6d['model'];if(!_0xa4ecae['query'][_0x8bee('0x4b')](_0x8bee('0x4c'))){_0x2cc3a7[_0x8bee('0x1f')]=qs[_0x8bee('0x1f')](_0xa4ecae[_0x8bee('0x2f')][_0x8bee('0x1f')]);_0x2cc3a7[_0x8bee('0x1c')]=qs[_0x8bee('0x1c')](_0xa4ecae[_0x8bee('0x2f')][_0x8bee('0x1c')]);}_0x2cc3a7[_0x8bee('0x4d')]=qs[_0x8bee('0x37')](_0xa4ecae[_0x8bee('0x2f')][_0x8bee('0x37')]);_0x2cc3a7['where']=qs['filters'](_['pick'](_0xa4ecae[_0x8bee('0x2f')],_0xff8f6d[_0x8bee('0x31')]));_0x2cc3a7[_0x8bee('0x38')]['SessionId']=_0x427ebd['id'];if(_0xa4ecae[_0x8bee('0x2f')]['filter']){_0x2cc3a7[_0x8bee('0x38')]=_[_0x8bee('0x3b')](_0x2cc3a7['where'],{'$or':_[_0x8bee('0x2b')](_0x2cc3a7['attributes'],function(_0x8d7542){var _0x2df13a={};_0x2df13a[_0x8d7542]={'$like':'%'+_0xa4ecae[_0x8bee('0x2f')][_0x8bee('0x3a')]+'%'};return _0x2df13a;})});}_0x2cc3a7=_['merge']({},_0x2cc3a7,_0xa4ecae[_0x8bee('0x3d')]);return db[_0x8bee('0x4a')][_0x8bee('0x1e')]({'where':_0x2cc3a7[_0x8bee('0x38')]})[_0x8bee('0x23')](function(_0x410b7d){_0x36e294[_0x8bee('0x1e')]=_0x410b7d;if(_0xa4ecae[_0x8bee('0x2f')]['includeAll']){_0x2cc3a7[_0x8bee('0x40')]=[{'all':!![]}];}return db[_0x8bee('0x4a')][_0x8bee('0x4e')](_0x2cc3a7);})[_0x8bee('0x23')](function(_0x585eae){_0x36e294[_0x8bee('0x41')]=_0x585eae;return _0x36e294;});}})[_0x8bee('0x23')](respondWithFilteredResult(_0x3a2f6d,_0x2cc3a7))[_0x8bee('0x42')](handleError(_0x3a2f6d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 56b15d2..8211006 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 _0x1623=['lodash','api','moment','bluebird','request-promise','path','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions'];(function(_0x252b52,_0xf5f5fe){var _0x2396b3=function(_0x24557b){while(--_0x24557b){_0x252b52['push'](_0x252b52['shift']());}};_0x2396b3(++_0xf5f5fe);}(_0x1623,0xab));var _0x3162=function(_0x27f819,_0x16f787){_0x27f819=_0x27f819-0x0;var _0x3312b9=_0x1623[_0x27f819];return _0x3312b9;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1db9=['JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x4f2039,_0x528e8e){var _0x9643db=function(_0x12cc2e){while(--_0x12cc2e){_0x4f2039['push'](_0x4f2039['shift']());}};_0x9643db(++_0x528e8e);}(_0x1db9,0x176));var _0x91db=function(_0x104e8e,_0x1f02e3){_0x104e8e=_0x104e8e-0x0;var _0xdc8a87=_0x1db9[_0x104e8e];return _0xdc8a87;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91db('0x6'));var rimraf=require(_0x91db('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x91db('0x8')]=function(_0x4b3f5c,_0x5e69d9){return _0x4b3f5c[_0x91db('0x9')](_0x91db('0xa'),attributes,{'tableName':_0x91db('0xb'),'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 c0c4be0..c52503e 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 _0x8ace=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3e3ed3,_0x31132a){var _0x2de30c=function(_0x4d0900){while(--_0x4d0900){_0x3e3ed3['push'](_0x3e3ed3['shift']());}};_0x2de30c(++_0x31132a);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x46e3ff,_0x50ca39){_0x46e3ff=_0x46e3ff-0x0;var _0x4bf847=_0x8ace[_0x46e3ff];return _0x4bf847;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});} \ No newline at end of file +var _0x3d04=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','info'];(function(_0x16ed10,_0x328f2f){var _0x25dd0f=function(_0x9b2ed){while(--_0x9b2ed){_0x16ed10['push'](_0x16ed10['shift']());}};_0x25dd0f(++_0x328f2f);}(_0x3d04,0xbe));var _0x43d0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3d04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var BPromise=require(_0x43d0('0x3'));var rs=require(_0x43d0('0x4'));var fs=require('fs');var Redis=require(_0x43d0('0x5'));var db=require(_0x43d0('0x6'))['db'];var utils=require(_0x43d0('0x7'));var logger=require('../../config/logger')(_0x43d0('0x8'));var config=require(_0x43d0('0x9'));var jayson=require(_0x43d0('0xa'));var client=jayson[_0x43d0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484271,_0x50919e,_0x5efb95){return new BPromise(function(_0x457550,_0x3344d3){return client[_0x43d0('0xc')](_0x484271,_0x5efb95)[_0x43d0('0xd')](function(_0x44a763){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'),JSON[_0x43d0('0xf')](_0x44a763));if(_0x44a763[_0x43d0('0x10')]){if(_0x44a763[_0x43d0('0x10')]['code']===0x1f4){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x44a763['error'][_0x43d0('0x12')]);return _0x3344d3(_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);}logger['error'](_0x43d0('0x11'),_0x50919e,_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);return _0x457550(_0x44a763['error'][_0x43d0('0x12')]);}else{logger[_0x43d0('0x13')](_0x43d0('0x11'),_0x50919e,_0x43d0('0xe'));_0x457550(_0x44a763[_0x43d0('0x14')]['message']);}})['catch'](function(_0x1e91a7){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x1e91a7);_0x3344d3(_0x1e91a7);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 8b2c4c1..2f299c8 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 _0xa3e6=['../../components/interaction/service','./license.controller','get','index','put','/:id','update','exports','multer','path','express','Router','fs-extra'];(function(_0xb784f0,_0x2aec66){var _0x542c17=function(_0x220087){while(--_0x220087){_0xb784f0['push'](_0xb784f0['shift']());}};_0x542c17(++_0x2aec66);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x32e46a,_0x36d462){_0x32e46a=_0x32e46a-0x0;var _0x2363b9=_0xa3e6[_0x32e46a];return _0x2363b9;};'use strict';var multer=require(_0x6a3e('0x0'));var util=require('util');var path=require(_0x6a3e('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a3e('0x2'));var router=express[_0x6a3e('0x3')]();var fs_extra=require(_0x6a3e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6a3e('0x5'));var config=require('../../config/environment');var controller=require(_0x6a3e('0x6'));router[_0x6a3e('0x7')]('/',controller[_0x6a3e('0x8')]);router[_0x6a3e('0x9')](_0x6a3e('0xa'),auth['isAuthenticated'](),controller[_0x6a3e('0xb')]);module[_0x6a3e('0xc')]=router; \ No newline at end of file +var _0xabcb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xabcb,0xf9));var _0xbabc=function(_0x23b27b,_0x35a7ec){_0x23b27b=_0x23b27b-0x0;var _0x5b47fb=_0xabcb[_0x23b27b];return _0x5b47fb;};'use strict';var multer=require('multer');var util=require(_0xbabc('0x0'));var path=require(_0xbabc('0x1'));var timeout=require(_0xbabc('0x2'));var express=require(_0xbabc('0x3'));var router=express[_0xbabc('0x4')]();var fs_extra=require(_0xbabc('0x5'));var auth=require(_0xbabc('0x6'));var interaction=require(_0xbabc('0x7'));var config=require(_0xbabc('0x8'));var controller=require(_0xbabc('0x9'));router[_0xbabc('0xa')]('/',controller[_0xbabc('0xb')]);router[_0xbabc('0xc')](_0xbabc('0xd'),auth[_0xbabc('0xe')](),controller[_0xbabc('0xf')]);module[_0xbabc('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 81a36cb..ec1ff60 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 _0x155d=['STRING','exports'];(function(_0x3b47e9,_0x3e3d65){var _0x871d28=function(_0x507655){while(--_0x507655){_0x3b47e9['push'](_0x3b47e9['shift']());}};_0x871d28(++_0x3e3d65);}(_0x155d,0xef));var _0xd155=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x155d[_0x5eaa0b];return _0x28b295;};'use strict';var Sequelize=require('sequelize');module[_0xd155('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xd155('0x1')]},'data2':{'type':Sequelize[_0xd155('0x1')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x356f=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x44bf28,_0x1b590f){var _0x5f5a80=function(_0x3b9f94){while(--_0x3b9f94){_0x44bf28['push'](_0x44bf28['shift']());}};_0x5f5a80(++_0x1b590f);}(_0x356f,0x85));var _0xf356=function(_0xc233c9,_0x3baa8e){_0xc233c9=_0xc233c9-0x0;var _0x5ba72a=_0x356f[_0xc233c9];return _0x5ba72a;};'use strict';var Sequelize=require(_0xf356('0x0'));module[_0xf356('0x1')]={'license':{'type':Sequelize[_0xf356('0x2')]},'data1':{'type':Sequelize[_0xf356('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xf356('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 1e236a3..344f712 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 _0x5fc3=['mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','model','keys','License','query','intersection','attributes','fields','merge','options','getLicense','catch','body','find','params','checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x5fc3[_0x119b3e];return _0x1169ae;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}var utilLicense=require('../../config/license/util');exports[_0x35fc('0x28')]=function(_0x645eac,_0x383837){var _0x9f3c8a={'raw':!![],'where':{'id':0x1}},_0x3735da={};_0x3735da[_0x35fc('0x29')]=_[_0x35fc('0x2a')](db[_0x35fc('0x2b')]['rawAttributes']);_0x3735da[_0x35fc('0x2c')]=_[_0x35fc('0x2a')](_0x645eac[_0x35fc('0x2c')]);_0x3735da['filters']=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],_0x3735da[_0x35fc('0x2c')]);_0x9f3c8a[_0x35fc('0x2e')]=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],qs[_0x35fc('0x2f')](_0x645eac[_0x35fc('0x2c')][_0x35fc('0x2f')]));_0x9f3c8a[_0x35fc('0x2e')]=_0x9f3c8a['attributes']['length']?_0x9f3c8a[_0x35fc('0x2e')]:_0x3735da['model'];_0x9f3c8a=_[_0x35fc('0x30')]({},_0x9f3c8a,_0x645eac[_0x35fc('0x31')]);return utilLicense[_0x35fc('0x32')](_0x9f3c8a)[_0x35fc('0x24')](respondWithResult(_0x383837,null))[_0x35fc('0x33')](handleError(_0x383837,null));};exports[_0x35fc('0x23')]=function(_0x4e43b4,_0x3fe193){if(_0x4e43b4[_0x35fc('0x34')]['id']){delete _0x4e43b4[_0x35fc('0x34')]['id'];}return db[_0x35fc('0x2b')][_0x35fc('0x35')]({'where':{'id':_0x4e43b4[_0x35fc('0x36')]['id']}})['then'](handleEntityNotFound(_0x3fe193,null))[_0x35fc('0x24')](function(_0x38193d){var _0x1fecdf=_0x38193d['get']({'plain':!![]});return utilLicense[_0x35fc('0x37')](_0x1fecdf,_0x4e43b4['body'][_0x35fc('0x38')]);})[_0x35fc('0x24')](function(_0x266a11){if(!_0x266a11[_0x35fc('0x39')]){return saveUpdates(_0x4e43b4['body'],null);}return _0x266a11;})['then'](respondWithResult(_0x3fe193,null))['catch'](handleError(_0x3fe193,null));}; \ No newline at end of file +var _0xc4aa=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','eml-format','rimraf'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}var utilLicense=require(_0xac4a('0x15'));exports[_0xac4a('0x2a')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={'raw':!![],'where':{'id':0x1}},_0x47f49c={};_0x47f49c[_0xac4a('0x2b')]=_[_0xac4a('0x2c')](db[_0xac4a('0x2d')]['rawAttributes']);_0x47f49c['query']=_[_0xac4a('0x2c')](_0x2772fe[_0xac4a('0x2e')]);_0x47f49c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x47f49c[_0xac4a('0x2b')],_0x47f49c['query']);_0x4a5a9e[_0xac4a('0x31')]=_['intersection'](_0x47f49c[_0xac4a('0x2b')],qs['fields'](_0x2772fe[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x4a5a9e[_0xac4a('0x31')]=_0x4a5a9e[_0xac4a('0x31')][_0xac4a('0x33')]?_0x4a5a9e[_0xac4a('0x31')]:_0x47f49c[_0xac4a('0x2b')];_0x4a5a9e=_[_0xac4a('0x34')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x35')]);return utilLicense[_0xac4a('0x36')](_0x4a5a9e)[_0xac4a('0x24')](respondWithResult(_0x116700,null))[_0xac4a('0x37')](handleError(_0x116700,null));};exports[_0xac4a('0x23')]=function(_0x1a9d4e,_0x5634e2){if(_0x1a9d4e[_0xac4a('0x38')]['id']){delete _0x1a9d4e[_0xac4a('0x38')]['id'];}return db['License'][_0xac4a('0x39')]({'where':{'id':_0x1a9d4e[_0xac4a('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5634e2,null))['then'](function(_0x11f0be){var _0x1ba096=_0x11f0be[_0xac4a('0x3b')]({'plain':!![]});return utilLicense[_0xac4a('0x3c')](_0x1ba096,_0x1a9d4e['body'][_0xac4a('0x3d')]);})[_0xac4a('0x24')](function(_0x4e7630){if(!_0x4e7630[_0xac4a('0x3e')]){return saveUpdates(_0x1a9d4e[_0xac4a('0x38')],null);}return _0x4e7630;})[_0xac4a('0x24')](respondWithResult(_0x5634e2,null))['catch'](handleError(_0x5634e2,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f681fee..f0d5a18 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 _0x5d00=['bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','util','api','moment'];(function(_0x53424b,_0x225f8c){var _0x39159b=function(_0x313041){while(--_0x313041){_0x53424b['push'](_0x53424b['shift']());}};_0x39159b(++_0x225f8c);}(_0x5d00,0xcc));var _0x05d0=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x5d00[_0x479509];return _0x382da8;};'use strict';var _=require(_0x05d0('0x0'));var util=require(_0x05d0('0x1'));var logger=require('../../config/logger')(_0x05d0('0x2'));var moment=require(_0x05d0('0x3'));var BPromise=require(_0x05d0('0x4'));var rp=require(_0x05d0('0x5'));var fs=require('fs');var path=require(_0x05d0('0x6'));var rimraf=require(_0x05d0('0x7'));var config=require(_0x05d0('0x8'));var attributes=require(_0x05d0('0x9'));module[_0x05d0('0xa')]=function(_0x3a5300,_0x1348e5){return _0x3a5300[_0x05d0('0xb')]('License',attributes,{'tableName':_0x05d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x529f=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger','api','moment','bluebird'];(function(_0xec9c4e,_0x1f3b34){var _0x49cf7b=function(_0x34c86d){while(--_0x34c86d){_0xec9c4e['push'](_0xec9c4e['shift']());}};_0x49cf7b(++_0x1f3b34);}(_0x529f,0x159));var _0xf529=function(_0x51c2e1,_0xf7af1){_0x51c2e1=_0x51c2e1-0x0;var _0x328439=_0x529f[_0x51c2e1];return _0x328439;};'use strict';var _=require(_0xf529('0x0'));var util=require('util');var logger=require(_0xf529('0x1'))(_0xf529('0x2'));var moment=require(_0xf529('0x3'));var BPromise=require(_0xf529('0x4'));var rp=require(_0xf529('0x5'));var fs=require('fs');var path=require(_0xf529('0x6'));var rimraf=require(_0xf529('0x7'));var config=require(_0xf529('0x8'));var attributes=require(_0xf529('0x9'));module[_0xf529('0xa')]=function(_0xb6291f,_0x5835d2){return _0xb6291f[_0xf529('0xb')](_0xf529('0xc'),attributes,{'tableName':_0xf529('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 323cd3a..dc9c28d 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 _0x1caf=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x220030,_0x347b32){var _0x14682e=function(_0x5d3574){while(--_0x5d3574){_0x220030['push'](_0x220030['shift']());}};_0x14682e(++_0x347b32);}(_0x1caf,0x104));var _0xf1ca=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1caf[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xf1ca('0x0'));var util=require(_0xf1ca('0x1'));var moment=require(_0xf1ca('0x2'));var BPromise=require(_0xf1ca('0x3'));var rs=require(_0xf1ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1ca('0x5'))['db'];var utils=require(_0xf1ca('0x6'));var logger=require(_0xf1ca('0x7'))(_0xf1ca('0x8'));var config=require('../../config/environment');var jayson=require(_0xf1ca('0x9'));var client=jayson['client'][_0xf1ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477d18,_0x5b592a,_0x550f7f){return new BPromise(function(_0xaea42c,_0x35cd4c){return client[_0xf1ca('0xb')](_0x477d18,_0x550f7f)[_0xf1ca('0xc')](function(_0x112a48){logger[_0xf1ca('0xd')](_0xf1ca('0xe'),_0x5b592a,_0xf1ca('0xf'));logger[_0xf1ca('0x10')](_0xf1ca('0x11'),_0x5b592a,'request\x20sent',JSON[_0xf1ca('0x12')](_0x112a48));if(_0x112a48['error']){if(_0x112a48[_0xf1ca('0x13')][_0xf1ca('0x14')]===0x1f4){logger[_0xf1ca('0x13')](_0xf1ca('0xe'),_0x5b592a,_0x112a48['error'][_0xf1ca('0x15')]);return _0x35cd4c(_0x112a48['error'][_0xf1ca('0x15')]);}logger[_0xf1ca('0x13')](_0xf1ca('0xe'),_0x5b592a,_0x112a48['error'][_0xf1ca('0x15')]);return _0xaea42c(_0x112a48[_0xf1ca('0x13')][_0xf1ca('0x15')]);}else{logger[_0xf1ca('0xd')](_0xf1ca('0xe'),_0x5b592a,_0xf1ca('0xf'));_0xaea42c(_0x112a48[_0xf1ca('0x16')][_0xf1ca('0x15')]);}})[_0xf1ca('0x17')](function(_0x27ff25){logger[_0xf1ca('0x13')](_0xf1ca('0xe'),_0x5b592a,_0x27ff25);_0x35cd4c(_0x27ff25);});});} \ No newline at end of file +var _0x3583=['License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x3583,0xef));var _0x3358=function(_0x9ca4e8,_0x5e8317){_0x9ca4e8=_0x9ca4e8-0x0;var _0x5bb6f9=_0x3583[_0x9ca4e8];return _0x5bb6f9;};'use strict';var _=require('lodash');var util=require(_0x3358('0x0'));var moment=require(_0x3358('0x1'));var BPromise=require(_0x3358('0x2'));var rs=require(_0x3358('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3358('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3358('0x5'))(_0x3358('0x6'));var config=require(_0x3358('0x7'));var jayson=require(_0x3358('0x8'));var client=jayson[_0x3358('0x9')][_0x3358('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c839a,_0x28e9db,_0x48457a){return new BPromise(function(_0x4a3e3e,_0x6ace59){return client['request'](_0x4c839a,_0x48457a)[_0x3358('0xb')](function(_0x4f2b40){logger[_0x3358('0xc')](_0x3358('0xd'),_0x28e9db,_0x3358('0xe'));logger['debug'](_0x3358('0xf'),_0x28e9db,_0x3358('0xe'),JSON[_0x3358('0x10')](_0x4f2b40));if(_0x4f2b40['error']){if(_0x4f2b40[_0x3358('0x11')]['code']===0x1f4){logger['error'](_0x3358('0xd'),_0x28e9db,_0x4f2b40[_0x3358('0x11')]['message']);return _0x6ace59(_0x4f2b40[_0x3358('0x11')]['message']);}logger[_0x3358('0x11')](_0x3358('0xd'),_0x28e9db,_0x4f2b40[_0x3358('0x11')][_0x3358('0x12')]);return _0x4a3e3e(_0x4f2b40[_0x3358('0x11')][_0x3358('0x12')]);}else{logger[_0x3358('0xc')](_0x3358('0xd'),_0x28e9db,'request\x20sent');_0x4a3e3e(_0x4f2b40[_0x3358('0x13')][_0x3358('0x12')]);}})[_0x3358('0x14')](function(_0x253cd0){logger[_0x3358('0x11')]('License,\x20%s,\x20%s',_0x28e9db,_0x253cd0);_0x6ace59(_0x253cd0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index a81e394..23e5bdf 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 _0x1e48=['/:id/verify','verifySmtp','getAgents','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send','/:id/users','put','update','removeDispositions','delete','/:id/canned_answers','removeSmtp','destroy','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages'];(function(_0x55ac96,_0x27f4c4){var _0x1d85ba=function(_0x424db9){while(--_0x424db9){_0x55ac96['push'](_0x55ac96['shift']());}};_0x1d85ba(++_0x27f4c4);}(_0x1e48,0x1eb));var _0x81e4=function(_0x21cc3f,_0x4ac3e5){_0x21cc3f=_0x21cc3f-0x0;var _0x1a311c=_0x1e48[_0x21cc3f];return _0x1a311c;};'use strict';var multer=require(_0x81e4('0x0'));var util=require(_0x81e4('0x1'));var path=require(_0x81e4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x81e4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x81e4('0x4'));var interaction=require(_0x81e4('0x5'));var config=require(_0x81e4('0x6'));var controller=require(_0x81e4('0x7'));router[_0x81e4('0x8')]('/',auth['isAuthenticated'](),controller[_0x81e4('0x9')]);router[_0x81e4('0x8')](_0x81e4('0xa'),auth[_0x81e4('0xb')](),controller['describe']);router['get'](_0x81e4('0xc'),auth[_0x81e4('0xb')](),controller[_0x81e4('0xd')]);router['get'](_0x81e4('0xe'),auth[_0x81e4('0xb')](),controller[_0x81e4('0xf')]);router[_0x81e4('0x8')]('/:id/canned_answers',auth[_0x81e4('0xb')](),controller['getAnswers']);router[_0x81e4('0x8')](_0x81e4('0x10'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x11')]);router[_0x81e4('0x8')](_0x81e4('0x12'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x13')]);router[_0x81e4('0x8')](_0x81e4('0x14'),auth['isAuthenticated'](),controller[_0x81e4('0x15')]);router[_0x81e4('0x8')](_0x81e4('0x16'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x17')]);router[_0x81e4('0x8')](_0x81e4('0x18'),auth['isAuthenticated'](),controller[_0x81e4('0x19')]);router['get'](_0x81e4('0x1a'),auth['isAuthenticated'](),controller[_0x81e4('0x1b')]);router[_0x81e4('0x8')]('/:id/users',auth[_0x81e4('0xb')](),controller[_0x81e4('0x1c')]);router['post']('/:id/dispositions',auth[_0x81e4('0xb')](),controller['addDisposition']);router[_0x81e4('0x1d')]('/:id/canned_answers',auth[_0x81e4('0xb')](),controller[_0x81e4('0x1e')]);router[_0x81e4('0x1d')]('/',auth['isAuthenticated'](),controller[_0x81e4('0x1f')]);router[_0x81e4('0x1d')](_0x81e4('0x10'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x20')]);router['post'](_0x81e4('0x12'),auth['isAuthenticated'](),controller[_0x81e4('0x21')]);router[_0x81e4('0x1d')](_0x81e4('0x14'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x22')]);router[_0x81e4('0x1d')](_0x81e4('0x16'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x23')]);router[_0x81e4('0x1d')]('/:id/send',auth[_0x81e4('0xb')](),controller[_0x81e4('0x24')]);router[_0x81e4('0x1d')](_0x81e4('0x25'),auth['isAuthenticated'](),controller['addAgents']);router[_0x81e4('0x26')](_0x81e4('0xc'),auth['isAuthenticated'](),controller[_0x81e4('0x27')]);router['delete']('/:id/dispositions',auth[_0x81e4('0xb')](),controller[_0x81e4('0x28')]);router[_0x81e4('0x29')](_0x81e4('0x2a'),auth[_0x81e4('0xb')](),controller['removeAnswers']);router[_0x81e4('0x29')]('/:id/in_servers',auth['isAuthenticated'](),controller['removeImap']);router[_0x81e4('0x29')](_0x81e4('0x12'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x2b')]);router[_0x81e4('0x29')]('/:id',auth[_0x81e4('0xb')](),controller[_0x81e4('0x2c')]);router[_0x81e4('0x29')](_0x81e4('0x25'),auth[_0x81e4('0xb')](),controller[_0x81e4('0x2d')]);module[_0x81e4('0x2e')]=router; \ No newline at end of file +var _0xebc1=['removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeAnswers','removeImap','removeSmtp','destroy'];(function(_0x23780a,_0x1eb92d){var _0x14d7d5=function(_0x4b3ee3){while(--_0x4b3ee3){_0x23780a['push'](_0x23780a['shift']());}};_0x14d7d5(++_0x1eb92d);}(_0xebc1,0x1a2));var _0x1ebc=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0xebc1[_0x4de877];return _0xb2cfeb;};'use strict';var multer=require('multer');var util=require(_0x1ebc('0x0'));var path=require(_0x1ebc('0x1'));var timeout=require(_0x1ebc('0x2'));var express=require(_0x1ebc('0x3'));var router=express['Router']();var fs_extra=require(_0x1ebc('0x4'));var auth=require(_0x1ebc('0x5'));var interaction=require(_0x1ebc('0x6'));var config=require(_0x1ebc('0x7'));var controller=require(_0x1ebc('0x8'));router['get']('/',auth[_0x1ebc('0x9')](),controller[_0x1ebc('0xa')]);router[_0x1ebc('0xb')](_0x1ebc('0xc'),auth['isAuthenticated'](),controller[_0x1ebc('0xd')]);router['get'](_0x1ebc('0xe'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0xf')]);router[_0x1ebc('0xb')](_0x1ebc('0x10'),auth['isAuthenticated'](),controller[_0x1ebc('0x11')]);router['get'](_0x1ebc('0x12'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x13')]);router[_0x1ebc('0xb')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x1ebc('0x14')]);router['get'](_0x1ebc('0x15'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x16')]);router[_0x1ebc('0xb')](_0x1ebc('0x17'),auth['isAuthenticated'](),controller[_0x1ebc('0x18')]);router[_0x1ebc('0xb')](_0x1ebc('0x19'),auth['isAuthenticated'](),controller[_0x1ebc('0x1a')]);router[_0x1ebc('0xb')](_0x1ebc('0x1b'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x1c')]);router[_0x1ebc('0xb')](_0x1ebc('0x1d'),auth[_0x1ebc('0x9')](),controller['verifySmtp']);router[_0x1ebc('0xb')](_0x1ebc('0x1e'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x1f')]);router[_0x1ebc('0x20')]('/:id/dispositions',auth[_0x1ebc('0x9')](),controller['addDisposition']);router[_0x1ebc('0x20')](_0x1ebc('0x12'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x21')]);router[_0x1ebc('0x20')]('/',auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x22')]);router[_0x1ebc('0x20')](_0x1ebc('0x23'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x24')]);router[_0x1ebc('0x20')]('/:id/out_servers',auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x25')]);router[_0x1ebc('0x20')](_0x1ebc('0x17'),auth['isAuthenticated'](),controller[_0x1ebc('0x26')]);router[_0x1ebc('0x20')](_0x1ebc('0x19'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x27')]);router[_0x1ebc('0x20')](_0x1ebc('0x28'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x29')]);router[_0x1ebc('0x20')]('/:id/users',auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x2a')]);router[_0x1ebc('0x2b')](_0x1ebc('0xe'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x2c')]);router[_0x1ebc('0x2d')](_0x1ebc('0x10'),auth[_0x1ebc('0x9')](),controller['removeDispositions']);router['delete'](_0x1ebc('0x12'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x2e')]);router[_0x1ebc('0x2d')](_0x1ebc('0x23'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x2f')]);router[_0x1ebc('0x2d')](_0x1ebc('0x15'),auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x30')]);router[_0x1ebc('0x2d')]('/:id',auth[_0x1ebc('0x9')](),controller[_0x1ebc('0x31')]);router[_0x1ebc('0x2d')](_0x1ebc('0x1e'),auth['isAuthenticated'](),controller[_0x1ebc('0x32')]);module[_0x1ebc('0x33')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7edeaea..6dbec22 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 _0x45d1=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x5b58d6,_0x3043cd){var _0x13e026=function(_0x18d2a6){while(--_0x18d2a6){_0x5b58d6['push'](_0x5b58d6['shift']());}};_0x13e026(++_0x3043cd);}(_0x45d1,0x1cb));var _0x145d=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x45d1[_0x25d386];return _0x857f4a;};'use strict';var Sequelize=require(_0x145d('0x0'));module[_0x145d('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x145d('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x145d('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x145d('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x145d('0x4')]},'markAsUnread':{'type':Sequelize[_0x145d('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x145d('0x2')],'allowNull':![],'defaultValue':_0x145d('0x5')},'fontSize':{'type':Sequelize[_0x145d('0x6')](0x2)[_0x145d('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x145d('0x4')],'defaultValue':function(){return _0x145d('0x8');}},'notificationSound':{'type':Sequelize[_0x145d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x145d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x145d('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x145d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x145d('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x145d('0xa'),'set':function(_0x470c3e){if(!_0x470c3e)this[_0x145d('0xb')](_0x145d('0xc'),null);this['setDataValue'](_0x145d('0xd'),_0x470c3e);}}}; \ No newline at end of file +var _0x29d4=['TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','BOOLEAN'];(function(_0x2ddac1,_0x31a3ed){var _0x366b41=function(_0x151e01){while(--_0x151e01){_0x2ddac1['push'](_0x2ddac1['shift']());}};_0x366b41(++_0x31a3ed);}(_0x29d4,0x1a1));var _0x429d=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x29d4[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0x429d('0x0'));module['exports']={'description':{'type':Sequelize[_0x429d('0x1')]},'name':{'type':Sequelize[_0x429d('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x429d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x429d('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x429d('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x429d('0x3')]},'markAsUnread':{'type':Sequelize[_0x429d('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x429d('0x1')],'allowNull':![],'defaultValue':_0x429d('0x4')},'fontSize':{'type':Sequelize[_0x429d('0x5')](0x2)[_0x429d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x429d('0x3')],'defaultValue':function(){return _0x429d('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x429d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x429d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x429d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x429d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x429d('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x429d('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x429d('0x9'),'set':function(_0x2fd1ca){if(!_0x2fd1ca)this[_0x429d('0xa')]('mandatoryDispositionPauseId',null);this[_0x429d('0xa')](_0x429d('0xb'),_0x2fd1ca);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 3541ed1..2f210b7 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 _0x8def=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','undefined','Content-Range','apply','reject','update','destroy','MailAccounts','UserProfileResource','then','sendStatus','name','index','Imap','MailServerOut','Smtp','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','options','MailAccount','count','include','findAll','rows','show','params','MailServerIn','mandatoryDispositionPause','includeAll','find','body','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','merge','removeAnswers','email','ListId','active','description','isNil','cservice','cauthentication','user','pass','authentication','host','port','service','cuser','password','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','pick','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','stack','finally','send','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','defaults','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','addAgents','spread','emit','removeAgents','isArray','User','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3149c3,_0x5689e0){var _0x1990d3=function(_0x82f7a6){while(--_0x82f7a6){_0x3149c3['push'](_0x3149c3['shift']());}};_0x1990d3(++_0x5689e0);}(_0x8def,0x18e));var _0xf8de=function(_0x18c277,_0x2fb86f){_0x18c277=_0x18c277-0x0;var _0x1f92a3=_0x8def[_0x18c277];return _0x1f92a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf8de('0x0'));var zipdir=require(_0xf8de('0x1'));var jsonpatch=require(_0xf8de('0x2'));var rp=require(_0xf8de('0x3'));var moment=require(_0xf8de('0x4'));var BPromise=require(_0xf8de('0x5'));var Mustache=require(_0xf8de('0x6'));var util=require(_0xf8de('0x7'));var path=require(_0xf8de('0x8'));var sox=require(_0xf8de('0x9'));var csv=require(_0xf8de('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8de('0xb'));var _=require(_0xf8de('0xc'));var squel=require(_0xf8de('0xd'));var crypto=require(_0xf8de('0xe'));var jsforce=require(_0xf8de('0xf'));var deskjs=require(_0xf8de('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf8de('0x11'));var Papa=require(_0xf8de('0x12'));var htmlToText=require(_0xf8de('0x13'));var juice=require('juice');var Redis=require(_0xf8de('0x14'));var authService=require(_0xf8de('0x15'));var qs=require(_0xf8de('0x16'));var as=require(_0xf8de('0x17'));var hardwareService=require(_0xf8de('0x18'));var logger=require(_0xf8de('0x19'))('api');var utils=require(_0xf8de('0x1a'));var config=require(_0xf8de('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8de('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xf8de('0x1d'),'port':0x18eb});var socket=require(_0xf8de('0x1e'))(new Redis(config['redis']));require(_0xf8de('0x1f'))[_0xf8de('0x20')](socket);var jayson=require(_0xf8de('0x21'));var client=jayson[_0xf8de('0x22')][_0xf8de('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x43952f,_0x1d378e,_0xd38a98,_0x298719){return new BPromise(function(_0x143ece,_0x320cc0){var _0x852b48=_0x298719||client;return _0x852b48[_0xf8de('0x24')](_0x43952f,_0xd38a98)['then'](function(_0x4f5dc8){logger[_0xf8de('0x25')]('MailAccount,\x20%s,\x20%s',_0x1d378e,'request\x20sent');logger['debug'](_0xf8de('0x26'),_0x1d378e,_0xf8de('0x27'),JSON[_0xf8de('0x28')](_0x4f5dc8));if(_0x4f5dc8['error']){if(_0x4f5dc8['error']['code']===0x1f4){logger[_0xf8de('0x29')](_0xf8de('0x2a'),_0x1d378e,_0x4f5dc8[_0xf8de('0x29')]['message']);return _0x320cc0(_0x4f5dc8[_0xf8de('0x29')][_0xf8de('0x2b')]);}logger[_0xf8de('0x29')](_0xf8de('0x2a'),_0x1d378e,_0x4f5dc8[_0xf8de('0x29')][_0xf8de('0x2b')]);return _0x143ece(_0x4f5dc8[_0xf8de('0x29')][_0xf8de('0x2b')]);}else{logger[_0xf8de('0x25')](_0xf8de('0x2a'),_0x1d378e,_0xf8de('0x27'));_0x143ece(_0x4f5dc8[_0xf8de('0x2c')][_0xf8de('0x2b')]);}})[_0xf8de('0x2d')](function(_0x37e1d7){logger['error']('MailAccount,\x20%s,\x20%s',_0x1d378e,_0x37e1d7);_0x320cc0(_0x37e1d7);});});}function respondWithStatusCode(_0xfba5b4,_0x5808dd){_0x5808dd=_0x5808dd||0xcc;return function(_0x1a4329){if(_0x1a4329){return _0xfba5b4['sendStatus'](_0x5808dd);}return _0xfba5b4[_0xf8de('0x2e')](_0x5808dd)['end']();};}function respondWithResult(_0x52f115,_0x4fc06e){_0x4fc06e=_0x4fc06e||0xc8;return function(_0x249f84){if(_0x249f84){return _0x52f115[_0xf8de('0x2e')](_0x4fc06e)[_0xf8de('0x2f')](_0x249f84);}};}function respondWithFilteredResult(_0x4b1822,_0x579bef){return function(_0x385ae6){if(_0x385ae6){var _0x25d6aa=typeof _0x579bef[_0xf8de('0x30')]==='undefined'&&typeof _0x579bef[_0xf8de('0x31')]===_0xf8de('0x32');var _0x116fca=_0x385ae6['count'];var _0x6f1a25=_0x25d6aa?0x0:_0x579bef['offset'];var _0x4532cd=_0x25d6aa?_0x385ae6['count']:_0x579bef[_0xf8de('0x30')]+_0x579bef[_0xf8de('0x31')];var _0x4f17a3;if(_0x4532cd>=_0x116fca){_0x4532cd=_0x116fca;_0x4f17a3=0xc8;}else{_0x4f17a3=0xce;}_0x4b1822['status'](_0x4f17a3);return _0x4b1822['set'](_0xf8de('0x33'),_0x6f1a25+'-'+_0x4532cd+'/'+_0x116fca)[_0xf8de('0x2f')](_0x385ae6);}return null;};}function patchUpdates(_0x35957d){return function(_0x2a1c38){try{jsonpatch[_0xf8de('0x34')](_0x2a1c38,_0x35957d,!![]);}catch(_0x213ca0){return BPromise[_0xf8de('0x35')](_0x213ca0);}return _0x2a1c38['save']();};}function saveUpdates(_0x316d4b,_0x1b05ae){return function(_0x2c4de1){if(_0x2c4de1){return _0x2c4de1[_0xf8de('0x36')](_0x316d4b)['then'](function(_0x35bdd0){return _0x35bdd0;});}return null;};}function removeEntity(_0x3fe242,_0x17c354){return function(_0x25d3c4){if(_0x25d3c4){return _0x25d3c4[_0xf8de('0x37')]()['then'](function(){var _0x12a59b=_0x25d3c4['get']({'plain':!![]});var _0x59654d=_0xf8de('0x38');return db[_0xf8de('0x39')][_0xf8de('0x37')]({'where':{'type':_0x59654d,'resourceId':_0x12a59b['id']}})[_0xf8de('0x3a')](function(){return _0x25d3c4;});})[_0xf8de('0x3a')](function(){_0x3fe242['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c0552,_0x157cd6){return function(_0x495e1a){if(!_0x495e1a){_0x4c0552[_0xf8de('0x3b')](0x194);}return _0x495e1a;};}function handleError(_0x83bb1c,_0xcebf29){_0xcebf29=_0xcebf29||0x1f4;return function(_0xa974f8){logger[_0xf8de('0x29')](_0xa974f8['stack']);if(_0xa974f8['name']){delete _0xa974f8[_0xf8de('0x3c')];}_0x83bb1c[_0xf8de('0x2e')](_0xcebf29)['send'](_0xa974f8);};}exports[_0xf8de('0x3d')]=function(_0x5d3d66,_0x447dc2){var _0x3466a9={'include':[{'model':db['MailServerIn'],'as':_0xf8de('0x3e')},{'model':db[_0xf8de('0x3f')],'as':_0xf8de('0x40')},{'model':db[_0xf8de('0x41')],'as':'mandatoryDispositionPause'}]},_0x8de1d4={},_0x32d7c3={'count':0x0,'rows':[]};var _0x5c2175=_[_0xf8de('0x42')](db['MailAccount'][_0xf8de('0x43')],function(_0x195bd0){return{'name':_0x195bd0[_0xf8de('0x44')],'type':_0x195bd0[_0xf8de('0x45')][_0xf8de('0x46')]};});_0x8de1d4[_0xf8de('0x47')]=_[_0xf8de('0x42')](_0x5c2175,_0xf8de('0x3c'));_0x8de1d4[_0xf8de('0x48')]=_[_0xf8de('0x49')](_0x5d3d66[_0xf8de('0x48')]);_0x8de1d4['filters']=_[_0xf8de('0x4a')](_0x8de1d4[_0xf8de('0x47')],_0x8de1d4[_0xf8de('0x48')]);_0x3466a9[_0xf8de('0x4b')]=_[_0xf8de('0x4a')](_0x8de1d4['model'],qs[_0xf8de('0x4c')](_0x5d3d66[_0xf8de('0x48')][_0xf8de('0x4c')]));_0x3466a9['attributes']=_0x3466a9[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x3466a9[_0xf8de('0x4b')]:_0x8de1d4[_0xf8de('0x47')];if(!_0x5d3d66['query'][_0xf8de('0x4e')](_0xf8de('0x4f'))){_0x3466a9['limit']=qs[_0xf8de('0x31')](_0x5d3d66['query']['limit']);_0x3466a9[_0xf8de('0x30')]=qs[_0xf8de('0x30')](_0x5d3d66[_0xf8de('0x48')][_0xf8de('0x30')]);}_0x3466a9[_0xf8de('0x50')]=qs[_0xf8de('0x51')](_0x5d3d66[_0xf8de('0x48')][_0xf8de('0x51')]);_0x3466a9[_0xf8de('0x52')]=qs['filters'](_['pick'](_0x5d3d66[_0xf8de('0x48')],_0x8de1d4[_0xf8de('0x53')]),_0x5c2175);if(_0x5d3d66[_0xf8de('0x48')]['filter']){_0x3466a9['where']=_['merge'](_0x3466a9['where'],{'$or':_[_0xf8de('0x42')](_0x5c2175,function(_0x403399){if(_0x403399[_0xf8de('0x45')]!==_0xf8de('0x54')){var _0x5e297f={};_0x5e297f[_0x403399[_0xf8de('0x3c')]]={'$like':'%'+_0x5d3d66[_0xf8de('0x48')][_0xf8de('0x55')]+'%'};return _0x5e297f;}})});}_0x3466a9=_['merge']({},_0x3466a9,_0x5d3d66[_0xf8de('0x56')]);var _0x3c895a={'where':_0x3466a9[_0xf8de('0x52')]};return db[_0xf8de('0x57')][_0xf8de('0x58')](_0x3c895a)[_0xf8de('0x3a')](function(_0x4545d9){_0x32d7c3[_0xf8de('0x58')]=_0x4545d9;if(_0x5d3d66[_0xf8de('0x48')]['includeAll']){_0x3466a9[_0xf8de('0x59')]=[{'all':!![]}];}return db[_0xf8de('0x57')][_0xf8de('0x5a')](_0x3466a9);})[_0xf8de('0x3a')](function(_0x579d96){_0x32d7c3[_0xf8de('0x5b')]=_0x579d96;return _0x32d7c3;})[_0xf8de('0x3a')](respondWithFilteredResult(_0x447dc2,_0x3466a9))[_0xf8de('0x2d')](handleError(_0x447dc2,null));};exports[_0xf8de('0x5c')]=function(_0x24cae8,_0x2603d3){var _0x3b1b5c={'raw':![],'where':{'id':_0x24cae8[_0xf8de('0x5d')]['id']},'include':[{'model':db[_0xf8de('0x5e')],'as':_0xf8de('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xf8de('0x41')],'as':_0xf8de('0x5f')}]},_0x2c9d4a={};_0x2c9d4a[_0xf8de('0x47')]=_[_0xf8de('0x49')](db[_0xf8de('0x57')][_0xf8de('0x43')]);_0x2c9d4a[_0xf8de('0x48')]=_[_0xf8de('0x49')](_0x24cae8[_0xf8de('0x48')]);_0x2c9d4a[_0xf8de('0x53')]=_['intersection'](_0x2c9d4a[_0xf8de('0x47')],_0x2c9d4a['query']);_0x3b1b5c[_0xf8de('0x4b')]=_[_0xf8de('0x4a')](_0x2c9d4a['model'],qs[_0xf8de('0x4c')](_0x24cae8['query'][_0xf8de('0x4c')]));_0x3b1b5c['attributes']=_0x3b1b5c[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x3b1b5c[_0xf8de('0x4b')]:_0x2c9d4a['model'];if(_0x24cae8[_0xf8de('0x48')][_0xf8de('0x60')]){_0x3b1b5c[_0xf8de('0x59')]=[{'all':!![]}];}_0x3b1b5c=_['merge']({},_0x3b1b5c,_0x24cae8[_0xf8de('0x56')]);return db[_0xf8de('0x57')][_0xf8de('0x61')](_0x3b1b5c)[_0xf8de('0x3a')](handleEntityNotFound(_0x2603d3,null))[_0xf8de('0x3a')](respondWithResult(_0x2603d3,null))[_0xf8de('0x2d')](handleError(_0x2603d3,null));};exports[_0xf8de('0x36')]=function(_0x27690c,_0x3a03c7){if(_0x27690c[_0xf8de('0x62')]['id']){delete _0x27690c[_0xf8de('0x62')]['id'];}return db[_0xf8de('0x57')][_0xf8de('0x61')]({'where':{'id':_0x27690c[_0xf8de('0x5d')]['id']},'include':[{'model':db[_0xf8de('0x5e')],'as':_0xf8de('0x3e')},{'model':db[_0xf8de('0x3f')],'as':_0xf8de('0x40')},{'model':db['Pause'],'as':_0xf8de('0x5f')}]})[_0xf8de('0x3a')](handleEntityNotFound(_0x3a03c7,null))[_0xf8de('0x3a')](saveUpdates(_0x27690c[_0xf8de('0x62')],null))['then'](function(_0x323e72){if(_0x323e72&&_0x27690c[_0xf8de('0x62')][_0xf8de('0x3e')]){return db['MailServerIn'][_0xf8de('0x36')](_0x27690c['body']['Imap'],{'where':{'MailAccountId':_0x323e72['id']}})[_0xf8de('0x3a')](function(){return _0x323e72;});}return _0x323e72;})['then'](function(_0x26b464){if(_0x26b464&&_0x27690c['body']['Smtp']){return db['MailServerOut'][_0xf8de('0x36')](_0x27690c[_0xf8de('0x62')][_0xf8de('0x40')],{'where':{'MailAccountId':_0x26b464['id']}})[_0xf8de('0x3a')](function(){return _0x26b464;});}return _0x26b464;})['then'](respondWithResult(_0x3a03c7,null))[_0xf8de('0x2d')](handleError(_0x3a03c7,null));};exports[_0xf8de('0x63')]=function(_0x44ffe9,_0x2b59f6){return db['MailAccount'][_0xf8de('0x63')]()[_0xf8de('0x3a')](respondWithResult(_0x2b59f6,null))[_0xf8de('0x2d')](handleError(_0x2b59f6,null));};exports[_0xf8de('0x64')]=function(_0x2ec4eb,_0xd1cbcc,_0x50ccc5){if(_0x2ec4eb[_0xf8de('0x62')]['id']){delete _0x2ec4eb[_0xf8de('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2ec4eb['params']['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0xd1cbcc,null))[_0xf8de('0x3a')](function(_0x457f4f){if(_0x457f4f){_0x2ec4eb[_0xf8de('0x62')][_0xf8de('0x65')]=_0x457f4f['id'];return db[_0xf8de('0x66')]['create'](_0x2ec4eb[_0xf8de('0x62')]);}})[_0xf8de('0x3a')](respondWithResult(_0xd1cbcc,null))[_0xf8de('0x2d')](handleError(_0xd1cbcc,null));};exports[_0xf8de('0x67')]=function(_0x4da744,_0x9dcef,_0x242ab1){var _0x15e77b={'raw':![],'where':{}};var _0x5ed989={};var _0x32ac12={'count':0x0,'rows':[]};return db['MailAccount'][_0xf8de('0x68')]({'where':{'id':_0x4da744['params']['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x9dcef,null))['then'](function(_0x27516d){if(_0x27516d){_0x5ed989['model']=_['keys'](db['Disposition'][_0xf8de('0x43')]);_0x5ed989[_0xf8de('0x48')]=_['keys'](_0x4da744[_0xf8de('0x48')]);_0x5ed989[_0xf8de('0x53')]=_[_0xf8de('0x4a')](_0x5ed989[_0xf8de('0x47')],_0x5ed989[_0xf8de('0x48')]);_0x15e77b['attributes']=_[_0xf8de('0x4a')](_0x5ed989['model'],qs[_0xf8de('0x4c')](_0x4da744['query']['fields']));_0x15e77b['attributes']=_0x15e77b[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x15e77b['attributes']:_0x5ed989[_0xf8de('0x47')];if(!_0x4da744[_0xf8de('0x48')][_0xf8de('0x4e')](_0xf8de('0x4f'))){_0x15e77b[_0xf8de('0x31')]=qs[_0xf8de('0x31')](_0x4da744[_0xf8de('0x48')][_0xf8de('0x31')]);_0x15e77b['offset']=qs[_0xf8de('0x30')](_0x4da744[_0xf8de('0x48')][_0xf8de('0x30')]);}_0x15e77b[_0xf8de('0x50')]=qs[_0xf8de('0x51')](_0x4da744[_0xf8de('0x48')][_0xf8de('0x51')]);_0x15e77b[_0xf8de('0x52')]=qs[_0xf8de('0x53')](_['pick'](_0x4da744[_0xf8de('0x48')],_0x5ed989['filters']));_0x15e77b[_0xf8de('0x52')][_0xf8de('0x65')]=_0x27516d['id'];if(_0x4da744[_0xf8de('0x48')][_0xf8de('0x55')]){_0x15e77b[_0xf8de('0x52')]=_['merge'](_0x15e77b['where'],{'$or':_[_0xf8de('0x42')](_0x15e77b[_0xf8de('0x4b')],function(_0x2548fe){var _0x5b8c84={};_0x5b8c84[_0x2548fe]={'$like':'%'+_0x4da744[_0xf8de('0x48')][_0xf8de('0x55')]+'%'};return _0x5b8c84;})});}_0x15e77b=_['merge']({},_0x15e77b,_0x4da744[_0xf8de('0x56')]);return db[_0xf8de('0x66')]['count']({'where':_0x15e77b[_0xf8de('0x52')]})['then'](function(_0x43d4b0){_0x32ac12[_0xf8de('0x58')]=_0x43d4b0;if(_0x4da744[_0xf8de('0x48')][_0xf8de('0x60')]){_0x15e77b[_0xf8de('0x59')]=[{'all':!![]}];}return db[_0xf8de('0x66')][_0xf8de('0x5a')](_0x15e77b);})[_0xf8de('0x3a')](function(_0x1bbe1a){_0x32ac12[_0xf8de('0x5b')]=_0x1bbe1a;return _0x32ac12;});}})[_0xf8de('0x3a')](respondWithFilteredResult(_0x9dcef,_0x15e77b))[_0xf8de('0x2d')](handleError(_0x9dcef,null));};exports[_0xf8de('0x69')]=function(_0x5141d1,_0x541666,_0x42a474){return db['MailAccount'][_0xf8de('0x61')]({'where':{'id':_0x5141d1[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x541666,null))[_0xf8de('0x3a')](function(_0x5ec61f){if(_0x5ec61f){return _0x5ec61f[_0xf8de('0x69')](_0x5141d1['query'][_0xf8de('0x6a')]);}})['then'](respondWithStatusCode(_0x541666,null))[_0xf8de('0x2d')](handleError(_0x541666,null));};exports[_0xf8de('0x6b')]=function(_0x2b4858,_0x1244ad,_0x5f32fa){if(_0x2b4858[_0xf8de('0x62')]['id']){delete _0x2b4858[_0xf8de('0x62')]['id'];}return db[_0xf8de('0x57')][_0xf8de('0x61')]({'where':{'id':_0x2b4858[_0xf8de('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1244ad,null))[_0xf8de('0x3a')](function(_0x678d6d){if(_0x678d6d){_0x2b4858[_0xf8de('0x62')][_0xf8de('0x65')]=_0x678d6d['id'];return db[_0xf8de('0x6c')][_0xf8de('0x6d')](_0x2b4858[_0xf8de('0x62')]);}})[_0xf8de('0x3a')](respondWithResult(_0x1244ad,null))[_0xf8de('0x2d')](handleError(_0x1244ad,null));};exports[_0xf8de('0x6e')]=function(_0x5339e4,_0x318e7,_0x262a29){var _0x553b68={'raw':![],'where':{}};var _0xa474f0={};var _0x51cef0={'count':0x0,'rows':[]};return db['MailAccount'][_0xf8de('0x68')]({'where':{'id':_0x5339e4['params']['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x318e7,null))['then'](function(_0x4fe29d){if(_0x4fe29d){_0xa474f0[_0xf8de('0x47')]=_['keys'](db[_0xf8de('0x6c')]['rawAttributes']);_0xa474f0['query']=_[_0xf8de('0x49')](_0x5339e4[_0xf8de('0x48')]);_0xa474f0[_0xf8de('0x53')]=_[_0xf8de('0x4a')](_0xa474f0[_0xf8de('0x47')],_0xa474f0[_0xf8de('0x48')]);_0x553b68['attributes']=_[_0xf8de('0x4a')](_0xa474f0[_0xf8de('0x47')],qs['fields'](_0x5339e4[_0xf8de('0x48')][_0xf8de('0x4c')]));_0x553b68['attributes']=_0x553b68[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x553b68['attributes']:_0xa474f0[_0xf8de('0x47')];if(!_0x5339e4[_0xf8de('0x48')][_0xf8de('0x4e')](_0xf8de('0x4f'))){_0x553b68[_0xf8de('0x31')]=qs[_0xf8de('0x31')](_0x5339e4[_0xf8de('0x48')][_0xf8de('0x31')]);_0x553b68[_0xf8de('0x30')]=qs[_0xf8de('0x30')](_0x5339e4[_0xf8de('0x48')][_0xf8de('0x30')]);}_0x553b68[_0xf8de('0x50')]=qs[_0xf8de('0x51')](_0x5339e4[_0xf8de('0x48')][_0xf8de('0x51')]);_0x553b68['where']=qs['filters'](_['pick'](_0x5339e4[_0xf8de('0x48')],_0xa474f0[_0xf8de('0x53')]));_0x553b68[_0xf8de('0x52')]['MailAccountId']=_0x4fe29d['id'];if(_0x5339e4[_0xf8de('0x48')][_0xf8de('0x55')]){_0x553b68[_0xf8de('0x52')]=_[_0xf8de('0x6f')](_0x553b68[_0xf8de('0x52')],{'$or':_['map'](_0x553b68[_0xf8de('0x4b')],function(_0x5bfa31){var _0x54f98c={};_0x54f98c[_0x5bfa31]={'$like':'%'+_0x5339e4[_0xf8de('0x48')]['filter']+'%'};return _0x54f98c;})});}_0x553b68=_['merge']({},_0x553b68,_0x5339e4[_0xf8de('0x56')]);return db['CannedAnswer']['count']({'where':_0x553b68[_0xf8de('0x52')]})[_0xf8de('0x3a')](function(_0x398620){_0x51cef0[_0xf8de('0x58')]=_0x398620;if(_0x5339e4[_0xf8de('0x48')]['includeAll']){_0x553b68['include']=[{'all':!![]}];}return db[_0xf8de('0x6c')][_0xf8de('0x5a')](_0x553b68);})[_0xf8de('0x3a')](function(_0x3d7d4a){_0x51cef0[_0xf8de('0x5b')]=_0x3d7d4a;return _0x51cef0;});}})[_0xf8de('0x3a')](respondWithFilteredResult(_0x318e7,_0x553b68))[_0xf8de('0x2d')](handleError(_0x318e7,null));};exports[_0xf8de('0x70')]=function(_0x5673d7,_0x20deb4,_0x30db06){return db[_0xf8de('0x57')]['find']({'where':{'id':_0x5673d7[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x20deb4,null))[_0xf8de('0x3a')](function(_0x3563ad){if(_0x3563ad){return _0x3563ad[_0xf8de('0x70')](_0x5673d7[_0xf8de('0x48')][_0xf8de('0x6a')]);}})['then'](respondWithStatusCode(_0x20deb4,null))['catch'](handleError(_0x20deb4,null));};exports[_0xf8de('0x6d')]=function(_0x4280b5,_0x505022){var _0x34cf8a={'name':_0x4280b5['body'][_0xf8de('0x3c')],'key':_0x4280b5[_0xf8de('0x62')][_0xf8de('0x46')],'email':_0x4280b5[_0xf8de('0x62')][_0xf8de('0x71')],'ListId':_0x4280b5[_0xf8de('0x62')][_0xf8de('0x72')],'active':!_['isNil'](_0x4280b5[_0xf8de('0x62')][_0xf8de('0x73')])?_0x4280b5['body'][_0xf8de('0x73')]:!![],'description':_0x4280b5['body'][_0xf8de('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0xf8de('0x75')](_0x4280b5[_0xf8de('0x62')][_0xf8de('0x76')])){if(_0x4280b5[_0xf8de('0x62')][_0xf8de('0x77')]){_0x34cf8a[_0xf8de('0x3e')][_0xf8de('0x78')]=_0x34cf8a[_0xf8de('0x40')][_0xf8de('0x78')]=_0x4280b5[_0xf8de('0x62')]['cuser'];_0x34cf8a['Imap']['password']=_0x34cf8a[_0xf8de('0x40')][_0xf8de('0x79')]=_0x4280b5[_0xf8de('0x62')]['cpassword'];}else{_0x34cf8a[_0xf8de('0x3e')][_0xf8de('0x7a')]=_0x34cf8a[_0xf8de('0x40')][_0xf8de('0x7a')]=![];}_0x34cf8a[_0xf8de('0x3e')]['host']=_0x4280b5[_0xf8de('0x62')][_0xf8de('0x3e')][_0xf8de('0x7b')];_0x34cf8a[_0xf8de('0x3e')]['port']=_0x4280b5['body'][_0xf8de('0x3e')][_0xf8de('0x7c')];_0x34cf8a[_0xf8de('0x40')][_0xf8de('0x7b')]=_0x4280b5[_0xf8de('0x62')][_0xf8de('0x40')][_0xf8de('0x7b')];_0x34cf8a[_0xf8de('0x40')][_0xf8de('0x7c')]=_0x4280b5[_0xf8de('0x62')][_0xf8de('0x40')]['port'];}else{_0x34cf8a[_0xf8de('0x3e')]['service']=_0x34cf8a['Smtp'][_0xf8de('0x7d')]=_0x4280b5[_0xf8de('0x62')][_0xf8de('0x76')];_0x34cf8a[_0xf8de('0x3e')][_0xf8de('0x78')]=_0x34cf8a[_0xf8de('0x40')][_0xf8de('0x78')]=_0x4280b5[_0xf8de('0x62')][_0xf8de('0x7e')];_0x34cf8a[_0xf8de('0x3e')][_0xf8de('0x7f')]=_0x34cf8a[_0xf8de('0x40')][_0xf8de('0x79')]=_0x4280b5[_0xf8de('0x62')][_0xf8de('0x80')];}return db[_0xf8de('0x57')][_0xf8de('0x6d')](_0x34cf8a,{'include':[{'model':db[_0xf8de('0x3f')],'as':_0xf8de('0x40')},{'model':db[_0xf8de('0x5e')],'as':'Imap'}]})[_0xf8de('0x3a')](function(_0x368dfc){var _0x16295b=_0x4280b5[_0xf8de('0x78')][_0xf8de('0x81')]({'plain':!![]});if(!_0x16295b)throw new Error(_0xf8de('0x82'));if(_0x16295b['role']==='user'){var _0x5116dd=_0x368dfc[_0xf8de('0x81')]({'plain':!![]});return db[_0xf8de('0x83')][_0xf8de('0x61')]({'where':{'name':_0xf8de('0x38'),'userProfileId':_0x16295b[_0xf8de('0x84')]},'raw':!![]})['then'](function(_0x115438){if(_0x115438&&_0x115438[_0xf8de('0x85')]===0x0){return db[_0xf8de('0x39')][_0xf8de('0x6d')]({'name':_0x5116dd['name'],'resourceId':_0x5116dd['id'],'type':_0x115438[_0xf8de('0x3c')],'sectionId':_0x115438['id']},{})['then'](function(){return _0x368dfc;});}else{return _0x368dfc;}})['catch'](function(_0x40c6ec){logger[_0xf8de('0x29')](_0xf8de('0x86'),_0x40c6ec);throw _0x40c6ec;});}return _0x368dfc;})['then'](respondWithResult(_0x505022,0xc9))['catch'](handleError(_0x505022,null));};exports[_0xf8de('0x87')]=function(_0x4311fc,_0x2ab8a4,_0x313844){return db[_0xf8de('0x57')][_0xf8de('0x68')]({'where':{'id':_0x4311fc['params']['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x2ab8a4,null))[_0xf8de('0x3a')](function(_0x66bd82){if(_0x66bd82){return _0x66bd82[_0xf8de('0x87')]();}return null;})[_0xf8de('0x3a')](respondWithResult(_0x2ab8a4,null))[_0xf8de('0x2d')](handleError(_0x2ab8a4,null));};exports[_0xf8de('0x88')]=function(_0x5225a4,_0x34bda8,_0x470b4e){if(_0x5225a4[_0xf8de('0x62')]['id']){delete _0x5225a4[_0xf8de('0x62')]['id'];}return db[_0xf8de('0x57')][_0xf8de('0x61')]({'where':{'id':_0x5225a4[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x34bda8,null))['then'](function(_0x2281bf){if(_0x2281bf){_0x5225a4[_0xf8de('0x62')][_0xf8de('0x65')]=_0x2281bf['id'];return db[_0xf8de('0x5e')][_0xf8de('0x6d')](_0x5225a4[_0xf8de('0x62')]);}})[_0xf8de('0x3a')](respondWithResult(_0x34bda8,null))[_0xf8de('0x2d')](handleError(_0x34bda8,null));};exports[_0xf8de('0x89')]=function(_0x1b7c91,_0x3210e8,_0x4f6ad2){return db[_0xf8de('0x57')][_0xf8de('0x68')]({'where':{'id':_0x1b7c91[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x3210e8,null))[_0xf8de('0x3a')](function(_0x486e46){if(_0x486e46){return _0x486e46[_0xf8de('0x8a')](null);}return null;})[_0xf8de('0x3a')](respondWithStatusCode(_0x3210e8,null))['catch'](handleError(_0x3210e8,null));};exports[_0xf8de('0x8b')]=function(_0x2acc0d,_0x17c728,_0x1e60c6){return db[_0xf8de('0x57')][_0xf8de('0x68')]({'where':{'id':_0x2acc0d[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x17c728,null))[_0xf8de('0x3a')](function(_0x4a9db0){if(_0x4a9db0){return _0x4a9db0[_0xf8de('0x8b')]();}return null;})[_0xf8de('0x3a')](respondWithResult(_0x17c728,null))[_0xf8de('0x2d')](handleError(_0x17c728,null));};exports[_0xf8de('0x8c')]=function(_0x4a91e4,_0x2204bd,_0x5a238b){if(_0x4a91e4[_0xf8de('0x62')]['id']){delete _0x4a91e4[_0xf8de('0x62')]['id'];}return db[_0xf8de('0x57')]['find']({'where':{'id':_0x4a91e4[_0xf8de('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2204bd,null))[_0xf8de('0x3a')](function(_0x1e5c51){if(_0x1e5c51){_0x4a91e4[_0xf8de('0x62')][_0xf8de('0x65')]=_0x1e5c51['id'];return db[_0xf8de('0x3f')][_0xf8de('0x6d')](_0x4a91e4['body']);}})['then'](respondWithResult(_0x2204bd,null))[_0xf8de('0x2d')](handleError(_0x2204bd,null));};exports[_0xf8de('0x8d')]=function(_0x3c353d,_0x19cc4d,_0x555a6d){return db['MailAccount'][_0xf8de('0x68')]({'where':{'id':_0x3c353d[_0xf8de('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19cc4d,null))[_0xf8de('0x3a')](function(_0xa2d517){if(_0xa2d517){return _0xa2d517[_0xf8de('0x8e')](null);}return null;})[_0xf8de('0x3a')](respondWithStatusCode(_0x19cc4d,null))['catch'](handleError(_0x19cc4d,null));};exports[_0xf8de('0x8f')]=function(_0x102676,_0x5e72e4,_0x307370){return db[_0xf8de('0x90')][_0xf8de('0x61')]({'where':{'id':_0x102676[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x5e72e4,null))[_0xf8de('0x3a')](function(_0x4aa7c6){if(_0x4aa7c6){return _0x4aa7c6[_0xf8de('0x8f')](_0x102676[_0xf8de('0x62')][_0xf8de('0x6a')],_[_0xf8de('0x91')](_0x102676['body'],[_0xf8de('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x5e72e4,null))['catch'](handleError(_0x5e72e4,null));};exports[_0xf8de('0x92')]=function(_0x323e01,_0x8f0afa,_0x52dda4){var _0x1f312b={'raw':![],'where':{}};var _0x1239cb={};var _0x436a5a={'count':0x0,'rows':[]};return db[_0xf8de('0x57')][_0xf8de('0x68')]({'where':{'id':_0x323e01['params']['id']}})['then'](handleEntityNotFound(_0x8f0afa,null))[_0xf8de('0x3a')](function(_0x1f00ff){if(_0x1f00ff){_0x1239cb['model']=_['keys'](db[_0xf8de('0x90')][_0xf8de('0x43')]);_0x1239cb[_0xf8de('0x48')]=_[_0xf8de('0x49')](_0x323e01[_0xf8de('0x48')]);_0x1239cb['filters']=_[_0xf8de('0x4a')](_0x1239cb[_0xf8de('0x47')],_0x1239cb[_0xf8de('0x48')]);_0x1f312b[_0xf8de('0x4b')]=_[_0xf8de('0x4a')](_0x1239cb[_0xf8de('0x47')],qs[_0xf8de('0x4c')](_0x323e01['query']['fields']));_0x1f312b[_0xf8de('0x4b')]=_0x1f312b[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x1f312b[_0xf8de('0x4b')]:_0x1239cb['model'];if(!_0x323e01[_0xf8de('0x48')][_0xf8de('0x4e')](_0xf8de('0x4f'))){_0x1f312b['limit']=qs['limit'](_0x323e01['query'][_0xf8de('0x31')]);_0x1f312b[_0xf8de('0x30')]=qs['offset'](_0x323e01[_0xf8de('0x48')][_0xf8de('0x30')]);}_0x1f312b[_0xf8de('0x50')]=qs[_0xf8de('0x51')](_0x323e01[_0xf8de('0x48')]['sort']);_0x1f312b['where']=qs[_0xf8de('0x53')](_[_0xf8de('0x93')](_0x323e01[_0xf8de('0x48')],_0x1239cb[_0xf8de('0x53')]));_0x1f312b['where'][_0xf8de('0x65')]=_0x1f00ff['id'];if(_0x323e01['query']['filter']){_0x1f312b['where']=_[_0xf8de('0x6f')](_0x1f312b[_0xf8de('0x52')],{'$or':_[_0xf8de('0x42')](_0x1f312b[_0xf8de('0x4b')],function(_0x2e29be){var _0x5287af={};_0x5287af[_0x2e29be]={'$like':'%'+_0x323e01['query']['filter']+'%'};return _0x5287af;})});}_0x1f312b=_[_0xf8de('0x6f')]({},_0x1f312b,_0x323e01['options']);return db[_0xf8de('0x90')][_0xf8de('0x58')]({'where':_0x1f312b['where']})[_0xf8de('0x3a')](function(_0x2c2ddb){_0x436a5a[_0xf8de('0x58')]=_0x2c2ddb;if(_0x323e01[_0xf8de('0x48')][_0xf8de('0x60')]){_0x1f312b[_0xf8de('0x59')]=[{'model':db[_0xf8de('0x94')],'as':_0xf8de('0x95'),'required':![]},{'model':db['User'],'as':_0xf8de('0x96'),'attributes':['name','fullname',_0xf8de('0x97')],'required':![]},{'model':db[_0xf8de('0x98')],'as':_0xf8de('0x99'),'attributes':['id',_0xf8de('0x3c'),_0xf8de('0x9a')],'where':_0x323e01[_0xf8de('0x48')][_0xf8de('0x9b')]?{'id':_0x323e01['query']['tag']}:undefined,'required':_0x323e01['query'][_0xf8de('0x9b')]?!![]:![]}];}return db[_0xf8de('0x90')][_0xf8de('0x5a')](_0x1f312b);})[_0xf8de('0x3a')](function(_0x4f7c20){_0x436a5a['rows']=_0x4f7c20;return _0x436a5a;});}})[_0xf8de('0x3a')](respondWithFilteredResult(_0x8f0afa,_0x1f312b))['catch'](handleError(_0x8f0afa,null));};exports[_0xf8de('0x9c')]=function addApplications(_0x5314ce,_0x1c3b52){var _0x20e617=_0x5314ce[_0xf8de('0x5d')]['id'];var _0xcd6d78=_0x5314ce[_0xf8de('0x62')];var _0x3d5044=0xc8;var _0x17a85f=null;return db[_0xf8de('0x9d')][_0xf8de('0x9e')]({'isolationLevel':db[_0xf8de('0x9d')][_0xf8de('0x9f')]['ISOLATION_LEVELS'][_0xf8de('0xa0')]},function(_0x443816){return db[_0xf8de('0x57')][_0xf8de('0x68')]({'where':{'id':_0x20e617},'transaction':_0x443816})[_0xf8de('0x3a')](function(_0x40622f){if(_0x40622f){return db[_0xf8de('0xa1')][_0xf8de('0x37')]({'where':{'MailAccountId':_0x20e617},'transaction':_0x443816})[_0xf8de('0x3a')](function(){var _0xb2f1a6=_[_0xf8de('0x42')](_0xcd6d78,function(_0x27ea92){_0x27ea92[_0xf8de('0x65')]=_0x20e617;return _0x27ea92;});return db[_0xf8de('0xa1')]['bulkCreate'](_0xb2f1a6,{'transaction':_0x443816});});}else{_0x3d5044=0x194;_0x17a85f=[];}});})['then'](function(){if(_0x3d5044!==0x194){return db['MailApplication'][_0xf8de('0xa2')]({'where':{'MailAccountId':_0x20e617},'order':_0xf8de('0xa3')})[_0xf8de('0x3a')](function(_0x2c0476){_0x17a85f=_0x2c0476;});}})[_0xf8de('0x2d')](function(_0x5b5761){_0x3d5044=0x1f4;logger[_0xf8de('0x29')](_0x5b5761[_0xf8de('0xa4')]);if(_0x5b5761['name']){delete _0x5b5761[_0xf8de('0x3c')];}_0x17a85f=_0x5b5761;})[_0xf8de('0xa5')](function(){if(_0x17a85f===null){_0x1c3b52[_0xf8de('0x3b')](_0x3d5044);}else{if(_0x3d5044===0x1f4){_0x1c3b52[_0xf8de('0x2e')](_0x3d5044)[_0xf8de('0xa6')](_0x17a85f);}else{_0x1c3b52[_0xf8de('0x2e')](_0x3d5044)[_0xf8de('0x2f')](_0x17a85f);}}});};exports['getApplications']=function(_0x42984c,_0x2306e3,_0x3f0c9b){var _0x33c26c={};var _0x113d32={};var _0x10ec5c;var _0x2c269e;return db[_0xf8de('0x57')]['findOne']({'where':{'id':_0x42984c[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x2306e3,null))[_0xf8de('0x3a')](function(_0x128f93){if(_0x128f93){_0x10ec5c=_0x128f93;_0x113d32[_0xf8de('0x47')]=_[_0xf8de('0x49')](db[_0xf8de('0xa1')][_0xf8de('0x43')]);_0x113d32[_0xf8de('0x48')]=_['keys'](_0x42984c[_0xf8de('0x48')]);_0x113d32['filters']=_['intersection'](_0x113d32[_0xf8de('0x47')],_0x113d32[_0xf8de('0x48')]);_0x33c26c[_0xf8de('0x4b')]=_[_0xf8de('0x4a')](_0x113d32[_0xf8de('0x47')],qs[_0xf8de('0x4c')](_0x42984c[_0xf8de('0x48')][_0xf8de('0x4c')]));_0x33c26c[_0xf8de('0x4b')]=_0x33c26c[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x33c26c[_0xf8de('0x4b')]:_0x113d32[_0xf8de('0x47')];_0x33c26c[_0xf8de('0x50')]=qs[_0xf8de('0x51')](_0x42984c[_0xf8de('0x48')][_0xf8de('0x51')]);_0x33c26c[_0xf8de('0x52')]=qs[_0xf8de('0x53')](_[_0xf8de('0x93')](_0x42984c['query'],_0x113d32[_0xf8de('0x53')]));if(_0x42984c[_0xf8de('0x48')][_0xf8de('0x55')]){_0x33c26c[_0xf8de('0x52')]=_['merge'](_0x33c26c[_0xf8de('0x52')],{'$or':_[_0xf8de('0x42')](_0x33c26c[_0xf8de('0x4b')],function(_0x5bb0d4){var _0x4ccb97={};_0x4ccb97[_0x5bb0d4]={'$like':'%'+_0x42984c[_0xf8de('0x48')][_0xf8de('0x55')]+'%'};return _0x4ccb97;})});}_0x33c26c=_[_0xf8de('0x6f')]({},_0x33c26c,_0x42984c[_0xf8de('0x56')]);return _0x10ec5c[_0xf8de('0xa7')](_0x33c26c);}})[_0xf8de('0x3a')](function(_0x4abaed){if(_0x4abaed){_0x2c269e=_0x4abaed[_0xf8de('0x4d')];if(!_0x42984c[_0xf8de('0x48')][_0xf8de('0x4e')](_0xf8de('0x4f'))){_0x33c26c[_0xf8de('0x31')]=qs[_0xf8de('0x31')](_0x42984c[_0xf8de('0x48')][_0xf8de('0x31')]);_0x33c26c[_0xf8de('0x30')]=qs['offset'](_0x42984c[_0xf8de('0x48')]['offset']);}return _0x10ec5c['getApplications'](_0x33c26c);}})[_0xf8de('0x3a')](function(_0x589155){if(_0x589155){return _0x589155?{'count':_0x2c269e,'rows':_0x589155}:null;}})['then'](respondWithResult(_0x2306e3,null))[_0xf8de('0x2d')](handleError(_0x2306e3,null));};exports[_0xf8de('0xa8')]=function(_0x2084d4,_0x30879d,_0x428e4e){var _0x51d3e2={'raw':!![],'where':{}};var _0x3a2e87={};var _0x43e388={'count':0x0,'rows':[]};return db[_0xf8de('0x57')][_0xf8de('0x68')]({'where':{'id':_0x2084d4[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x30879d,null))[_0xf8de('0x3a')](function(_0x4f88d0){if(_0x4f88d0){_0x3a2e87[_0xf8de('0x47')]=_[_0xf8de('0x49')](db[_0xf8de('0xa9')]['rawAttributes']);_0x3a2e87[_0xf8de('0x48')]=_['keys'](_0x2084d4['query']);_0x3a2e87[_0xf8de('0x53')]=_['intersection'](_0x3a2e87[_0xf8de('0x47')],_0x3a2e87[_0xf8de('0x48')]);_0x51d3e2['attributes']=_[_0xf8de('0x4a')](_0x3a2e87[_0xf8de('0x47')],qs['fields'](_0x2084d4[_0xf8de('0x48')][_0xf8de('0x4c')]));_0x51d3e2['attributes']=_0x51d3e2[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x51d3e2[_0xf8de('0x4b')]:_0x3a2e87[_0xf8de('0x47')];if(!_0x2084d4[_0xf8de('0x48')]['hasOwnProperty']('nolimit')){_0x51d3e2[_0xf8de('0x31')]=qs['limit'](_0x2084d4['query'][_0xf8de('0x31')]);_0x51d3e2[_0xf8de('0x30')]=qs[_0xf8de('0x30')](_0x2084d4[_0xf8de('0x48')]['offset']);}_0x51d3e2['order']=qs[_0xf8de('0x51')](_0x2084d4[_0xf8de('0x48')]['sort']);_0x51d3e2[_0xf8de('0x52')]=qs[_0xf8de('0x53')](_['pick'](_0x2084d4[_0xf8de('0x48')],_0x3a2e87[_0xf8de('0x53')]));_0x51d3e2[_0xf8de('0x52')]['MailAccountId']=_0x4f88d0['id'];if(_0x2084d4[_0xf8de('0x48')][_0xf8de('0x55')]){_0x51d3e2[_0xf8de('0x52')]=_[_0xf8de('0x6f')](_0x51d3e2[_0xf8de('0x52')],{'$or':_[_0xf8de('0x42')](_0x51d3e2[_0xf8de('0x4b')],function(_0x2702f3){var _0x5513d9={};_0x5513d9[_0x2702f3]={'$like':'%'+_0x2084d4['query'][_0xf8de('0x55')]+'%'};return _0x5513d9;})});}if(_0x2084d4[_0xf8de('0x48')][_0xf8de('0xaa')]){var _0xeaff83=_0x2084d4[_0xf8de('0x48')][_0xf8de('0xaa')][_0xf8de('0xab')](',');var _0x551459={};_0x551459[_0xeaff83[0x0]]={'$gte':moment(_0xeaff83[0x1])['format'](_0xf8de('0xac'))};_0x51d3e2[_0xf8de('0x52')]=_[_0xf8de('0x6f')](_0x51d3e2['where'],_0x551459);}_0x51d3e2=_[_0xf8de('0x6f')]({},_0x51d3e2,_0x2084d4[_0xf8de('0x56')]);return db[_0xf8de('0xa9')][_0xf8de('0x58')]({'where':_0x51d3e2[_0xf8de('0x52')]})[_0xf8de('0x3a')](function(_0x4f2258){_0x43e388['count']=_0x4f2258;if(_0x2084d4['query'][_0xf8de('0x60')]){_0x51d3e2[_0xf8de('0x59')]=[{'all':!![]}];}return db[_0xf8de('0xa9')][_0xf8de('0x5a')](_0x51d3e2);})[_0xf8de('0x3a')](function(_0x3a1935){if(_0x2084d4['query'][_0xf8de('0xad')]===_0xf8de('0xae')){for(var _0x26f16f=0x0;_0x26f16f<_0x3a1935[_0xf8de('0x4d')];_0x26f16f++){_0x3a1935[_0x26f16f][_0xf8de('0x62')]=juice(_0x3a1935[_0x26f16f][_0xf8de('0x62')]);}}_0x43e388[_0xf8de('0x5b')]=_0x3a1935;return _0x43e388;});}})[_0xf8de('0x3a')](respondWithFilteredResult(_0x30879d,_0x51d3e2))[_0xf8de('0x2d')](handleError(_0x30879d,null));};exports[_0xf8de('0xa6')]=function(_0x4dbc9e,_0x292cf5,_0x784f04){var _0xf632f8,_0x5e0df0={},_0x12ac02;if(_0x4dbc9e[_0xf8de('0x62')]['to']){_0x12ac02=_0x4dbc9e['body']['to'][_0xf8de('0xab')](',')[0x0];}return db[_0xf8de('0x57')][_0xf8de('0x61')]({'where':{'id':_0x4dbc9e[_0xf8de('0x5d')]['id']},'include':[{'model':db[_0xf8de('0xaf')],'as':_0xf8de('0xb0'),'include':[{'model':db['CmContact'],'as':_0xf8de('0xb1'),'where':{'email':_0x12ac02},'limit':0x1,'order':[[_0xf8de('0xb2'),_0xf8de('0xb3')]]}]},{'model':db[_0xf8de('0x3f')],'as':_0xf8de('0x40'),'raw':!![]}]})[_0xf8de('0x3a')](handleEntityNotFound(_0x292cf5,null))[_0xf8de('0x3a')](function(_0x16c751){if(_0x16c751){_0xf632f8=_0x16c751;if(_0x16c751[_0xf8de('0x40')]){if(_[_0xf8de('0x75')](_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xb4')])){_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xb4')]=util[_0xf8de('0xb5')](_0xf8de('0xb6'),_0x16c751[_0xf8de('0x3c')],_0x16c751['email']||_0x16c751['Smtp'][_0xf8de('0x78')]);}if(_0x4dbc9e['body']['attachments']&&_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xb7')]['length']){for(var _0x3892a8=0x0;_0x3892a8<_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xb7')][_0xf8de('0x4d')];_0x3892a8+=0x1){_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xb7')][_0x3892a8]={'filename':_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xb7')][_0x3892a8][_0xf8de('0x3c')],'path':path[_0xf8de('0xb8')](config[_0xf8de('0xb9')],_0xf8de('0xba'),_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xb7')][_0x3892a8][_0xf8de('0xbb')])};}}var _0x1239ad={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x16c751[_0xf8de('0x40')]['service'])){if(_0x16c751[_0xf8de('0x40')]['authentication']){_0x1239ad['auth']={'user':_0x16c751[_0xf8de('0x40')][_0xf8de('0x78')],'pass':_0x16c751['Smtp']['pass']};}_0x1239ad[_0xf8de('0x7b')]=_0x16c751['Smtp'][_0xf8de('0x7b')];_0x1239ad['port']=_0x16c751[_0xf8de('0x40')]['port'];_0x1239ad[_0xf8de('0xbc')]=_0x16c751[_0xf8de('0x40')][_0xf8de('0xbc')];}else{_0x1239ad['service']=_0x16c751[_0xf8de('0x40')][_0xf8de('0x7d')];_0x1239ad[_0xf8de('0xbd')]={'user':_0x16c751[_0xf8de('0x40')]['user'],'pass':_0x16c751['Smtp'][_0xf8de('0x79')]};}return respondWithRpcPromise(_0xf8de('0xbe'),_0xf8de('0xbf'),{'account':_0x1239ad,'message':_0x4dbc9e['body']});}else{throw new Error(_0xf8de('0xc0'));}}})['then'](function(_0x1a79b7){if(_0x1a79b7){_0x5e0df0=_0x1a79b7;if(_0xf632f8[_0xf8de('0xb0')]){if(_0xf632f8[_0xf8de('0xb0')]['Contacts'][_0xf8de('0x4d')]){return _0xf632f8[_0xf8de('0xb0')]['Contacts'][0x0];}else{return db[_0xf8de('0x94')][_0xf8de('0x6d')](_[_0xf8de('0xc1')](_0x4dbc9e[_0xf8de('0x62')],{'firstName':_0x4dbc9e['body']['to'],'email':_0x4dbc9e[_0xf8de('0x62')]['to'],'phone':_0x4dbc9e['body']['to'],'ListId':_0xf632f8[_0xf8de('0x72')]}));}}else{throw new Error(_0xf8de('0xc0'));}}})[_0xf8de('0x3a')](function(_0x14a665){if(_0x14a665){var _0x5b36d5={'UserId':_0x4dbc9e[_0xf8de('0x78')]['id'],'ContactId':_0x14a665['id'],'MailAccountId':_0xf632f8['id'],'inReplyTo':_0x5e0df0[_0xf8de('0xc2')],'to':_0x4dbc9e[_0xf8de('0x62')]['from'],'cc':_0x4dbc9e[_0xf8de('0x62')]['cc'],'subject':_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xc3')],'attach':_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xc4')],'firstMsgDirection':_0xf8de('0xc5'),'lastMsgAt':moment()[_0xf8de('0xb5')](_0xf8de('0xac')),'lastMsgDirection':_0xf8de('0xc5'),'Messages':[_[_0xf8de('0x6f')](_0x4dbc9e['body'],{'messageId':_0x5e0df0[_0xf8de('0xc2')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xf632f8['id'],'UserId':_0x4dbc9e[_0xf8de('0x78')]['id'],'ContactId':_0x14a665['id']})]};if(_0x4dbc9e[_0xf8de('0x62')][_0xf8de('0xc6')]){_0x5b36d5=_[_0xf8de('0x6f')](_0x5b36d5,_0x4dbc9e[_0xf8de('0x62')]['Interaction']);}return db['MailInteraction'][_0xf8de('0x6d')](_0x5b36d5,{'include':[{'model':db[_0xf8de('0xa9')],'as':_0xf8de('0xc7')}]});}})[_0xf8de('0x3a')](respondWithResult(_0x292cf5,null))[_0xf8de('0x2d')](handleError(_0x292cf5,null));};exports['verifySmtp']=function(_0x5b6a95,_0x21c736,_0x438243){return db[_0xf8de('0x57')][_0xf8de('0x61')]({'where':{'id':_0x5b6a95[_0xf8de('0x5d')]['id']},'include':[{'model':db[_0xf8de('0x3f')],'as':_0xf8de('0x40'),'raw':!![]}]})[_0xf8de('0x3a')](handleEntityNotFound(_0x21c736,null))[_0xf8de('0x3a')](function(_0x1ca140){if(_0x1ca140&&_0x1ca140['Smtp']){var _0x9c7f48={'id':_0x1ca140['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1ca140['Smtp'][_0xf8de('0x7d')]){_0x9c7f48[_0xf8de('0x7d')]=_0x1ca140[_0xf8de('0x40')]['service'];}else{_0x9c7f48['host']=_0x1ca140[_0xf8de('0x40')][_0xf8de('0x7b')];_0x9c7f48[_0xf8de('0x7c')]=_0x1ca140['Smtp']['port'];_0x9c7f48['secure']=_0x1ca140[_0xf8de('0x40')][_0xf8de('0xbc')];}if(_0x1ca140[_0xf8de('0x40')][_0xf8de('0x7a')]){_0x9c7f48[_0xf8de('0xbd')]={'user':_0x1ca140[_0xf8de('0x40')][_0xf8de('0x78')],'pass':_0x1ca140[_0xf8de('0x40')]['pass']};}return respondWithRpcPromise(_0xf8de('0xc8'),_0xf8de('0xc9'),{'account':_0x9c7f48});}})[_0xf8de('0x3a')](respondWithResult(_0x21c736,null))[_0xf8de('0x2d')](handleError(_0x21c736,null));};exports[_0xf8de('0x37')]=function(_0x4c6a8e,_0x23aa1a){return db[_0xf8de('0x57')][_0xf8de('0x61')]({'where':{'id':_0x4c6a8e[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x23aa1a,null))[_0xf8de('0x3a')](function(_0x19b715){if(_0x19b715&&_0x19b715[_0xf8de('0x7d')]){throw new db[(_0xf8de('0xca'))][(_0xf8de('0xcb'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x19b715;})['then'](removeEntity(_0x23aa1a,null))[_0xf8de('0x2d')](handleError(_0x23aa1a,null));};exports[_0xf8de('0xcc')]=function(_0x4ba8e0,_0x277a9d,_0x430fac){return db['MailAccount']['find']({'where':{'id':_0x4ba8e0[_0xf8de('0x5d')]['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x277a9d,null))[_0xf8de('0x3a')](function(_0x141b09){if(_0x141b09){return _0x141b09[_0xf8de('0xcc')](_0x4ba8e0['body'][_0xf8de('0x6a')],_[_0xf8de('0x91')](_0x4ba8e0[_0xf8de('0x62')],[_0xf8de('0x6a'),'id'])||{})[_0xf8de('0xcd')](function(_0x562c68){for(var _0x31a00d=0x0;_0x31a00d<_0x4ba8e0[_0xf8de('0x62')][_0xf8de('0x6a')][_0xf8de('0x4d')];_0x31a00d+=0x1){socket[_0xf8de('0xce')]('userMailAccount:save',{'UserId':Number(_0x4ba8e0[_0xf8de('0x62')]['ids'][_0x31a00d]),'MailAccountId':Number(_0x4ba8e0[_0xf8de('0x5d')]['id'])});}return _0x562c68;});}})['then'](respondWithResult(_0x277a9d,null))['catch'](handleError(_0x277a9d,null));};exports[_0xf8de('0xcf')]=function(_0x21fd76,_0x1d8533,_0x4fc39e){return db[_0xf8de('0x57')][_0xf8de('0x61')]({'where':{'id':_0x21fd76['params']['id']}})['then'](handleEntityNotFound(_0x1d8533,null))[_0xf8de('0x3a')](function(_0x583e6a){if(_0x583e6a){return _0x583e6a[_0xf8de('0xcf')](_0x21fd76[_0xf8de('0x48')][_0xf8de('0x6a')])[_0xf8de('0x3a')](function(){if(_[_0xf8de('0xd0')](_0x21fd76[_0xf8de('0x48')][_0xf8de('0x6a')])){for(var _0x423c7d=0x0;_0x423c7d<_0x21fd76['query'][_0xf8de('0x6a')][_0xf8de('0x4d')];_0x423c7d+=0x1){socket[_0xf8de('0xce')]('userMailAccount:remove',{'UserId':Number(_0x21fd76[_0xf8de('0x48')][_0xf8de('0x6a')][_0x423c7d]),'MailAccountId':Number(_0x21fd76['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x21fd76[_0xf8de('0x48')]['ids']),'MailAccountId':Number(_0x21fd76[_0xf8de('0x5d')]['id'])});}});}})[_0xf8de('0x3a')](respondWithStatusCode(_0x1d8533,null))[_0xf8de('0x2d')](handleError(_0x1d8533,null));};exports['getAgents']=function(_0x39ce24,_0x2518f4,_0x2c73f3){var _0x391802={};var _0x126cdc={};var _0x43f40e;var _0x3346f2;return db[_0xf8de('0x57')][_0xf8de('0x68')]({'where':{'id':_0x39ce24['params']['id']}})[_0xf8de('0x3a')](handleEntityNotFound(_0x2518f4,null))[_0xf8de('0x3a')](function(_0x62bb8f){if(_0x62bb8f){_0x43f40e=_0x62bb8f;_0x126cdc['model']=_[_0xf8de('0x49')](db[_0xf8de('0xd1')][_0xf8de('0x43')]);_0x126cdc['query']=_[_0xf8de('0x49')](_0x39ce24[_0xf8de('0x48')]);_0x126cdc[_0xf8de('0x53')]=_[_0xf8de('0x4a')](_0x126cdc[_0xf8de('0x47')],_0x126cdc[_0xf8de('0x48')]);_0x391802[_0xf8de('0x4b')]=_['intersection'](_0x126cdc[_0xf8de('0x47')],qs[_0xf8de('0x4c')](_0x39ce24[_0xf8de('0x48')][_0xf8de('0x4c')]));_0x391802['attributes']=_0x391802[_0xf8de('0x4b')][_0xf8de('0x4d')]?_0x391802[_0xf8de('0x4b')]:_0x126cdc[_0xf8de('0x47')];_0x391802[_0xf8de('0x50')]=qs['sort'](_0x39ce24[_0xf8de('0x48')][_0xf8de('0x51')]);_0x391802[_0xf8de('0x52')]=qs[_0xf8de('0x53')](_[_0xf8de('0x93')](_0x39ce24[_0xf8de('0x48')],_0x126cdc['filters']));if(_0x39ce24[_0xf8de('0x48')][_0xf8de('0x55')]){_0x391802[_0xf8de('0x52')]=_[_0xf8de('0x6f')](_0x391802[_0xf8de('0x52')],{'$or':_[_0xf8de('0x42')](_0x391802[_0xf8de('0x4b')],function(_0x5d781a){var _0xcd5b09={};_0xcd5b09[_0x5d781a]={'$like':'%'+_0x39ce24[_0xf8de('0x48')]['filter']+'%'};return _0xcd5b09;})});}_0x391802=_[_0xf8de('0x6f')]({},_0x391802,_0x39ce24[_0xf8de('0x56')]);return _0x43f40e[_0xf8de('0xd2')](_0x391802);}})[_0xf8de('0x3a')](function(_0x1de722){if(_0x1de722){_0x3346f2=_0x1de722[_0xf8de('0x4d')];if(!_0x39ce24[_0xf8de('0x48')][_0xf8de('0x4e')](_0xf8de('0x4f'))){_0x391802[_0xf8de('0x31')]=qs['limit'](_0x39ce24[_0xf8de('0x48')][_0xf8de('0x31')]);_0x391802[_0xf8de('0x30')]=qs[_0xf8de('0x30')](_0x39ce24[_0xf8de('0x48')]['offset']);}return _0x43f40e[_0xf8de('0xd2')](_0x391802);}})[_0xf8de('0x3a')](function(_0x5fa702){if(_0x5fa702){return _0x5fa702?{'count':_0x3346f2,'rows':_0x5fa702}:null;}})[_0xf8de('0x3a')](respondWithResult(_0x2518f4,null))[_0xf8de('0x2d')](handleError(_0x2518f4,null));}; \ No newline at end of file +var _0xa153=['MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','update','body','find','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','length','hasOwnProperty','sort','removeDispositions','ids','addAnswer','pick','CannedAnswer','findAll','removeAnswers','email','ListId','isNil','active','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','password','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','finally','sendStatus','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','updatedAt','DESC','from','attachments','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','format','Interaction','verifySmtp','VerifySmtp','Sequelize','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','end','limit','undefined','count','offset','set','json','apply','reject','save','then','destroy','get','MailAccounts','stack','name','send','index','MailServerIn','Imap'];(function(_0x49bb08,_0x5e51ec){var _0x992beb=function(_0x3ca477){while(--_0x3ca477){_0x49bb08['push'](_0x49bb08['shift']());}};_0x992beb(++_0x5e51ec);}(_0xa153,0x85));var _0x3a15=function(_0x53d0a5,_0xd46702){_0x53d0a5=_0x53d0a5-0x0;var _0x5d3bde=_0xa153[_0x53d0a5];return _0x5d3bde;};'use strict';var emlformat=require(_0x3a15('0x0'));var rimraf=require(_0x3a15('0x1'));var zipdir=require(_0x3a15('0x2'));var jsonpatch=require(_0x3a15('0x3'));var rp=require(_0x3a15('0x4'));var moment=require(_0x3a15('0x5'));var BPromise=require(_0x3a15('0x6'));var Mustache=require(_0x3a15('0x7'));var util=require(_0x3a15('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3a15('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a15('0xa'));var squel=require(_0x3a15('0xb'));var crypto=require(_0x3a15('0xc'));var jsforce=require(_0x3a15('0xd'));var deskjs=require(_0x3a15('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a15('0xf'));var Papa=require(_0x3a15('0x10'));var htmlToText=require(_0x3a15('0x11'));var juice=require(_0x3a15('0x12'));var Redis=require(_0x3a15('0x13'));var authService=require(_0x3a15('0x14'));var qs=require(_0x3a15('0x15'));var as=require(_0x3a15('0x16'));var hardwareService=require(_0x3a15('0x17'));var logger=require('../../config/logger')(_0x3a15('0x18'));var utils=require(_0x3a15('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3a15('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3a15('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3a15('0x1c'))(new Redis(config['redis']));require(_0x3a15('0x1d'))[_0x3a15('0x1e')](socket);var jayson=require(_0x3a15('0x1f'));var client=jayson['client'][_0x3a15('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x174d15,_0x16582d,_0x239133,_0x2aec0a){return new BPromise(function(_0x5a8111,_0x4f29fd){var _0x5cbfcb=_0x2aec0a||client;return _0x5cbfcb[_0x3a15('0x21')](_0x174d15,_0x239133)['then'](function(_0x5ab036){logger[_0x3a15('0x22')](_0x3a15('0x23'),_0x16582d,_0x3a15('0x24'));logger[_0x3a15('0x25')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x16582d,_0x3a15('0x24'),JSON['stringify'](_0x5ab036));if(_0x5ab036['error']){if(_0x5ab036[_0x3a15('0x26')]['code']===0x1f4){logger[_0x3a15('0x26')](_0x3a15('0x23'),_0x16582d,_0x5ab036[_0x3a15('0x26')]['message']);return _0x4f29fd(_0x5ab036[_0x3a15('0x26')][_0x3a15('0x27')]);}logger[_0x3a15('0x26')](_0x3a15('0x23'),_0x16582d,_0x5ab036[_0x3a15('0x26')][_0x3a15('0x27')]);return _0x5a8111(_0x5ab036[_0x3a15('0x26')]['message']);}else{logger[_0x3a15('0x22')](_0x3a15('0x23'),_0x16582d,_0x3a15('0x24'));_0x5a8111(_0x5ab036[_0x3a15('0x28')][_0x3a15('0x27')]);}})[_0x3a15('0x29')](function(_0x46bfa7){logger['error'](_0x3a15('0x23'),_0x16582d,_0x46bfa7);_0x4f29fd(_0x46bfa7);});});}function respondWithStatusCode(_0x5a9796,_0x472ad5){_0x472ad5=_0x472ad5||0xcc;return function(_0x544e1b){if(_0x544e1b){return _0x5a9796['sendStatus'](_0x472ad5);}return _0x5a9796[_0x3a15('0x2a')](_0x472ad5)[_0x3a15('0x2b')]();};}function respondWithResult(_0x512d2f,_0x58df94){_0x58df94=_0x58df94||0xc8;return function(_0x4d7064){if(_0x4d7064){return _0x512d2f[_0x3a15('0x2a')](_0x58df94)['json'](_0x4d7064);}};}function respondWithFilteredResult(_0xf7ebf4,_0x62abe6){return function(_0x28b16d){if(_0x28b16d){var _0x2f329c=typeof _0x62abe6['offset']==='undefined'&&typeof _0x62abe6[_0x3a15('0x2c')]===_0x3a15('0x2d');var _0x52d7c3=_0x28b16d[_0x3a15('0x2e')];var _0xec9f97=_0x2f329c?0x0:_0x62abe6['offset'];var _0x23e237=_0x2f329c?_0x28b16d[_0x3a15('0x2e')]:_0x62abe6[_0x3a15('0x2f')]+_0x62abe6[_0x3a15('0x2c')];var _0x3a33e8;if(_0x23e237>=_0x52d7c3){_0x23e237=_0x52d7c3;_0x3a33e8=0xc8;}else{_0x3a33e8=0xce;}_0xf7ebf4['status'](_0x3a33e8);return _0xf7ebf4[_0x3a15('0x30')]('Content-Range',_0xec9f97+'-'+_0x23e237+'/'+_0x52d7c3)[_0x3a15('0x31')](_0x28b16d);}return null;};}function patchUpdates(_0x4977cf){return function(_0x16e1b4){try{jsonpatch[_0x3a15('0x32')](_0x16e1b4,_0x4977cf,!![]);}catch(_0x566c6d){return BPromise[_0x3a15('0x33')](_0x566c6d);}return _0x16e1b4[_0x3a15('0x34')]();};}function saveUpdates(_0x287548,_0x6f1a87){return function(_0xe22236){if(_0xe22236){return _0xe22236['update'](_0x287548)[_0x3a15('0x35')](function(_0x5d3faf){return _0x5d3faf;});}return null;};}function removeEntity(_0x42b496,_0x551fe8){return function(_0x1558f1){if(_0x1558f1){return _0x1558f1[_0x3a15('0x36')]()[_0x3a15('0x35')](function(){var _0x55a77a=_0x1558f1[_0x3a15('0x37')]({'plain':!![]});var _0x29ac68=_0x3a15('0x38');return db['UserProfileResource'][_0x3a15('0x36')]({'where':{'type':_0x29ac68,'resourceId':_0x55a77a['id']}})[_0x3a15('0x35')](function(){return _0x1558f1;});})[_0x3a15('0x35')](function(){_0x42b496[_0x3a15('0x2a')](0xcc)[_0x3a15('0x2b')]();});}};}function handleEntityNotFound(_0x1bd0ed,_0x2c8daa){return function(_0xe3e221){if(!_0xe3e221){_0x1bd0ed['sendStatus'](0x194);}return _0xe3e221;};}function handleError(_0x5e61a3,_0x5ad76a){_0x5ad76a=_0x5ad76a||0x1f4;return function(_0x2e0953){logger[_0x3a15('0x26')](_0x2e0953[_0x3a15('0x39')]);if(_0x2e0953['name']){delete _0x2e0953[_0x3a15('0x3a')];}_0x5e61a3[_0x3a15('0x2a')](_0x5ad76a)[_0x3a15('0x3b')](_0x2e0953);};}exports[_0x3a15('0x3c')]=function(_0xe66dde,_0xa69e93){var _0x3dbca1={'include':[{'model':db[_0x3a15('0x3d')],'as':_0x3a15('0x3e')},{'model':db[_0x3a15('0x3f')],'as':_0x3a15('0x40')},{'model':db[_0x3a15('0x41')],'as':_0x3a15('0x42')}]},_0x7c2beb={},_0x9a7bef={'count':0x0,'rows':[]};var _0x5e64e3=_[_0x3a15('0x43')](db[_0x3a15('0x44')][_0x3a15('0x45')],function(_0x2d4f0d){return{'name':_0x2d4f0d[_0x3a15('0x46')],'type':_0x2d4f0d[_0x3a15('0x47')][_0x3a15('0x48')]};});_0x7c2beb[_0x3a15('0x49')]=_[_0x3a15('0x43')](_0x5e64e3,'name');_0x7c2beb[_0x3a15('0x4a')]=_[_0x3a15('0x4b')](_0xe66dde[_0x3a15('0x4a')]);_0x7c2beb['filters']=_[_0x3a15('0x4c')](_0x7c2beb[_0x3a15('0x49')],_0x7c2beb[_0x3a15('0x4a')]);_0x3dbca1[_0x3a15('0x4d')]=_[_0x3a15('0x4c')](_0x7c2beb[_0x3a15('0x49')],qs[_0x3a15('0x4e')](_0xe66dde[_0x3a15('0x4a')][_0x3a15('0x4e')]));_0x3dbca1[_0x3a15('0x4d')]=_0x3dbca1['attributes']['length']?_0x3dbca1[_0x3a15('0x4d')]:_0x7c2beb['model'];if(!_0xe66dde[_0x3a15('0x4a')]['hasOwnProperty'](_0x3a15('0x4f'))){_0x3dbca1[_0x3a15('0x2c')]=qs['limit'](_0xe66dde[_0x3a15('0x4a')][_0x3a15('0x2c')]);_0x3dbca1['offset']=qs['offset'](_0xe66dde['query']['offset']);}_0x3dbca1[_0x3a15('0x50')]=qs['sort'](_0xe66dde[_0x3a15('0x4a')]['sort']);_0x3dbca1[_0x3a15('0x51')]=qs[_0x3a15('0x52')](_['pick'](_0xe66dde[_0x3a15('0x4a')],_0x7c2beb[_0x3a15('0x52')]),_0x5e64e3);if(_0xe66dde[_0x3a15('0x4a')][_0x3a15('0x53')]){_0x3dbca1[_0x3a15('0x51')]=_[_0x3a15('0x54')](_0x3dbca1[_0x3a15('0x51')],{'$or':_[_0x3a15('0x43')](_0x5e64e3,function(_0x254ade){if(_0x254ade[_0x3a15('0x47')]!==_0x3a15('0x55')){var _0x2a7343={};_0x2a7343[_0x254ade[_0x3a15('0x3a')]]={'$like':'%'+_0xe66dde[_0x3a15('0x4a')][_0x3a15('0x53')]+'%'};return _0x2a7343;}})});}_0x3dbca1=_['merge']({},_0x3dbca1,_0xe66dde[_0x3a15('0x56')]);var _0x401d7e={'where':_0x3dbca1['where']};return db[_0x3a15('0x44')][_0x3a15('0x2e')](_0x401d7e)[_0x3a15('0x35')](function(_0x3ea9fb){_0x9a7bef[_0x3a15('0x2e')]=_0x3ea9fb;if(_0xe66dde[_0x3a15('0x4a')][_0x3a15('0x57')]){_0x3dbca1[_0x3a15('0x58')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x3dbca1);})['then'](function(_0x551664){_0x9a7bef[_0x3a15('0x59')]=_0x551664;return _0x9a7bef;})[_0x3a15('0x35')](respondWithFilteredResult(_0xa69e93,_0x3dbca1))[_0x3a15('0x29')](handleError(_0xa69e93,null));};exports['show']=function(_0x4ab90a,_0x569f6d){var _0x3cd291={'raw':![],'where':{'id':_0x4ab90a['params']['id']},'include':[{'model':db[_0x3a15('0x3d')],'as':_0x3a15('0x3e')},{'model':db[_0x3a15('0x3f')],'as':_0x3a15('0x40')},{'model':db[_0x3a15('0x41')],'as':'mandatoryDispositionPause'}]},_0x1a8895={};_0x1a8895[_0x3a15('0x49')]=_[_0x3a15('0x4b')](db['MailAccount']['rawAttributes']);_0x1a8895['query']=_[_0x3a15('0x4b')](_0x4ab90a['query']);_0x1a8895[_0x3a15('0x52')]=_[_0x3a15('0x4c')](_0x1a8895['model'],_0x1a8895[_0x3a15('0x4a')]);_0x3cd291[_0x3a15('0x4d')]=_[_0x3a15('0x4c')](_0x1a8895[_0x3a15('0x49')],qs[_0x3a15('0x4e')](_0x4ab90a['query'][_0x3a15('0x4e')]));_0x3cd291[_0x3a15('0x4d')]=_0x3cd291[_0x3a15('0x4d')]['length']?_0x3cd291[_0x3a15('0x4d')]:_0x1a8895[_0x3a15('0x49')];if(_0x4ab90a[_0x3a15('0x4a')]['includeAll']){_0x3cd291['include']=[{'all':!![]}];}_0x3cd291=_['merge']({},_0x3cd291,_0x4ab90a[_0x3a15('0x56')]);return db[_0x3a15('0x44')]['find'](_0x3cd291)[_0x3a15('0x35')](handleEntityNotFound(_0x569f6d,null))[_0x3a15('0x35')](respondWithResult(_0x569f6d,null))[_0x3a15('0x29')](handleError(_0x569f6d,null));};exports[_0x3a15('0x5a')]=function(_0x30a3ad,_0x1cfa7c){if(_0x30a3ad[_0x3a15('0x5b')]['id']){delete _0x30a3ad[_0x3a15('0x5b')]['id'];}return db[_0x3a15('0x44')][_0x3a15('0x5c')]({'where':{'id':_0x30a3ad[_0x3a15('0x5d')]['id']},'include':[{'model':db[_0x3a15('0x3d')],'as':'Imap'},{'model':db[_0x3a15('0x3f')],'as':_0x3a15('0x40')},{'model':db[_0x3a15('0x41')],'as':_0x3a15('0x42')}]})[_0x3a15('0x35')](handleEntityNotFound(_0x1cfa7c,null))[_0x3a15('0x35')](saveUpdates(_0x30a3ad[_0x3a15('0x5b')],null))['then'](function(_0x143617){if(_0x143617&&_0x30a3ad[_0x3a15('0x5b')]['Imap']){return db[_0x3a15('0x3d')]['update'](_0x30a3ad[_0x3a15('0x5b')][_0x3a15('0x3e')],{'where':{'MailAccountId':_0x143617['id']}})['then'](function(){return _0x143617;});}return _0x143617;})['then'](function(_0x2dd92b){if(_0x2dd92b&&_0x30a3ad[_0x3a15('0x5b')]['Smtp']){return db['MailServerOut'][_0x3a15('0x5a')](_0x30a3ad[_0x3a15('0x5b')]['Smtp'],{'where':{'MailAccountId':_0x2dd92b['id']}})[_0x3a15('0x35')](function(){return _0x2dd92b;});}return _0x2dd92b;})[_0x3a15('0x35')](respondWithResult(_0x1cfa7c,null))[_0x3a15('0x29')](handleError(_0x1cfa7c,null));};exports[_0x3a15('0x5e')]=function(_0x5d22a0,_0x45ff33){return db[_0x3a15('0x44')]['describe']()[_0x3a15('0x35')](respondWithResult(_0x45ff33,null))['catch'](handleError(_0x45ff33,null));};exports[_0x3a15('0x5f')]=function(_0x24dd17,_0x2daff1,_0x1ed77e){if(_0x24dd17[_0x3a15('0x5b')]['id']){delete _0x24dd17['body']['id'];}return db[_0x3a15('0x44')]['find']({'where':{'id':_0x24dd17[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x2daff1,null))[_0x3a15('0x35')](function(_0xe29dc7){if(_0xe29dc7){_0x24dd17[_0x3a15('0x5b')][_0x3a15('0x60')]=_0xe29dc7['id'];return db[_0x3a15('0x61')][_0x3a15('0x62')](_0x24dd17[_0x3a15('0x5b')]);}})[_0x3a15('0x35')](respondWithResult(_0x2daff1,null))['catch'](handleError(_0x2daff1,null));};exports[_0x3a15('0x63')]=function(_0x2825d2,_0x545fd3,_0x23f467){var _0x379a36={'raw':![],'where':{}};var _0x1f96bd={};var _0x40fde1={'count':0x0,'rows':[]};return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x2825d2[_0x3a15('0x5d')]['id']}})['then'](handleEntityNotFound(_0x545fd3,null))['then'](function(_0x4a1d20){if(_0x4a1d20){_0x1f96bd[_0x3a15('0x49')]=_[_0x3a15('0x4b')](db[_0x3a15('0x61')][_0x3a15('0x45')]);_0x1f96bd[_0x3a15('0x4a')]=_['keys'](_0x2825d2['query']);_0x1f96bd[_0x3a15('0x52')]=_[_0x3a15('0x4c')](_0x1f96bd[_0x3a15('0x49')],_0x1f96bd[_0x3a15('0x4a')]);_0x379a36[_0x3a15('0x4d')]=_[_0x3a15('0x4c')](_0x1f96bd['model'],qs[_0x3a15('0x4e')](_0x2825d2[_0x3a15('0x4a')][_0x3a15('0x4e')]));_0x379a36['attributes']=_0x379a36['attributes'][_0x3a15('0x65')]?_0x379a36[_0x3a15('0x4d')]:_0x1f96bd[_0x3a15('0x49')];if(!_0x2825d2[_0x3a15('0x4a')][_0x3a15('0x66')](_0x3a15('0x4f'))){_0x379a36['limit']=qs[_0x3a15('0x2c')](_0x2825d2[_0x3a15('0x4a')][_0x3a15('0x2c')]);_0x379a36[_0x3a15('0x2f')]=qs['offset'](_0x2825d2['query']['offset']);}_0x379a36[_0x3a15('0x50')]=qs['sort'](_0x2825d2[_0x3a15('0x4a')][_0x3a15('0x67')]);_0x379a36['where']=qs['filters'](_['pick'](_0x2825d2['query'],_0x1f96bd[_0x3a15('0x52')]));_0x379a36[_0x3a15('0x51')][_0x3a15('0x60')]=_0x4a1d20['id'];if(_0x2825d2[_0x3a15('0x4a')][_0x3a15('0x53')]){_0x379a36[_0x3a15('0x51')]=_[_0x3a15('0x54')](_0x379a36['where'],{'$or':_['map'](_0x379a36[_0x3a15('0x4d')],function(_0x472fdb){var _0x3d66f1={};_0x3d66f1[_0x472fdb]={'$like':'%'+_0x2825d2[_0x3a15('0x4a')][_0x3a15('0x53')]+'%'};return _0x3d66f1;})});}_0x379a36=_['merge']({},_0x379a36,_0x2825d2[_0x3a15('0x56')]);return db[_0x3a15('0x61')][_0x3a15('0x2e')]({'where':_0x379a36[_0x3a15('0x51')]})[_0x3a15('0x35')](function(_0x68ea4c){_0x40fde1['count']=_0x68ea4c;if(_0x2825d2[_0x3a15('0x4a')]['includeAll']){_0x379a36[_0x3a15('0x58')]=[{'all':!![]}];}return db[_0x3a15('0x61')]['findAll'](_0x379a36);})['then'](function(_0x379c95){_0x40fde1['rows']=_0x379c95;return _0x40fde1;});}})[_0x3a15('0x35')](respondWithFilteredResult(_0x545fd3,_0x379a36))[_0x3a15('0x29')](handleError(_0x545fd3,null));};exports['removeDispositions']=function(_0x3816a6,_0x3bbf25,_0x7c4ff7){return db[_0x3a15('0x44')][_0x3a15('0x5c')]({'where':{'id':_0x3816a6[_0x3a15('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3bbf25,null))[_0x3a15('0x35')](function(_0x496e7a){if(_0x496e7a){return _0x496e7a[_0x3a15('0x68')](_0x3816a6[_0x3a15('0x4a')][_0x3a15('0x69')]);}})[_0x3a15('0x35')](respondWithStatusCode(_0x3bbf25,null))[_0x3a15('0x29')](handleError(_0x3bbf25,null));};exports[_0x3a15('0x6a')]=function(_0x114643,_0x33c877,_0x962d7d){if(_0x114643[_0x3a15('0x5b')]['id']){delete _0x114643[_0x3a15('0x5b')]['id'];}return db[_0x3a15('0x44')][_0x3a15('0x5c')]({'where':{'id':_0x114643[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x33c877,null))[_0x3a15('0x35')](function(_0x5ff14c){if(_0x5ff14c){_0x114643[_0x3a15('0x5b')]['MailAccountId']=_0x5ff14c['id'];return db['CannedAnswer'][_0x3a15('0x62')](_0x114643[_0x3a15('0x5b')]);}})[_0x3a15('0x35')](respondWithResult(_0x33c877,null))[_0x3a15('0x29')](handleError(_0x33c877,null));};exports['getAnswers']=function(_0x55fb27,_0x139799,_0x47f804){var _0x3ab96d={'raw':![],'where':{}};var _0x6e8b74={};var _0x15c629={'count':0x0,'rows':[]};return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x55fb27[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x139799,null))[_0x3a15('0x35')](function(_0x135373){if(_0x135373){_0x6e8b74[_0x3a15('0x49')]=_[_0x3a15('0x4b')](db['CannedAnswer']['rawAttributes']);_0x6e8b74['query']=_[_0x3a15('0x4b')](_0x55fb27['query']);_0x6e8b74['filters']=_[_0x3a15('0x4c')](_0x6e8b74[_0x3a15('0x49')],_0x6e8b74['query']);_0x3ab96d[_0x3a15('0x4d')]=_[_0x3a15('0x4c')](_0x6e8b74['model'],qs[_0x3a15('0x4e')](_0x55fb27[_0x3a15('0x4a')][_0x3a15('0x4e')]));_0x3ab96d[_0x3a15('0x4d')]=_0x3ab96d[_0x3a15('0x4d')]['length']?_0x3ab96d[_0x3a15('0x4d')]:_0x6e8b74['model'];if(!_0x55fb27[_0x3a15('0x4a')]['hasOwnProperty'](_0x3a15('0x4f'))){_0x3ab96d[_0x3a15('0x2c')]=qs[_0x3a15('0x2c')](_0x55fb27[_0x3a15('0x4a')]['limit']);_0x3ab96d[_0x3a15('0x2f')]=qs[_0x3a15('0x2f')](_0x55fb27[_0x3a15('0x4a')][_0x3a15('0x2f')]);}_0x3ab96d['order']=qs['sort'](_0x55fb27[_0x3a15('0x4a')][_0x3a15('0x67')]);_0x3ab96d[_0x3a15('0x51')]=qs[_0x3a15('0x52')](_[_0x3a15('0x6b')](_0x55fb27[_0x3a15('0x4a')],_0x6e8b74[_0x3a15('0x52')]));_0x3ab96d[_0x3a15('0x51')]['MailAccountId']=_0x135373['id'];if(_0x55fb27[_0x3a15('0x4a')][_0x3a15('0x53')]){_0x3ab96d[_0x3a15('0x51')]=_['merge'](_0x3ab96d[_0x3a15('0x51')],{'$or':_[_0x3a15('0x43')](_0x3ab96d[_0x3a15('0x4d')],function(_0x13e1eb){var _0x487255={};_0x487255[_0x13e1eb]={'$like':'%'+_0x55fb27[_0x3a15('0x4a')]['filter']+'%'};return _0x487255;})});}_0x3ab96d=_['merge']({},_0x3ab96d,_0x55fb27[_0x3a15('0x56')]);return db[_0x3a15('0x6c')]['count']({'where':_0x3ab96d[_0x3a15('0x51')]})[_0x3a15('0x35')](function(_0x584b1a){_0x15c629['count']=_0x584b1a;if(_0x55fb27[_0x3a15('0x4a')]['includeAll']){_0x3ab96d[_0x3a15('0x58')]=[{'all':!![]}];}return db[_0x3a15('0x6c')][_0x3a15('0x6d')](_0x3ab96d);})[_0x3a15('0x35')](function(_0x2d07e7){_0x15c629[_0x3a15('0x59')]=_0x2d07e7;return _0x15c629;});}})[_0x3a15('0x35')](respondWithFilteredResult(_0x139799,_0x3ab96d))[_0x3a15('0x29')](handleError(_0x139799,null));};exports['removeAnswers']=function(_0x183bd1,_0x2a404d,_0x1e8522){return db[_0x3a15('0x44')]['find']({'where':{'id':_0x183bd1[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x2a404d,null))[_0x3a15('0x35')](function(_0x2cadc2){if(_0x2cadc2){return _0x2cadc2[_0x3a15('0x6e')](_0x183bd1[_0x3a15('0x4a')][_0x3a15('0x69')]);}})[_0x3a15('0x35')](respondWithStatusCode(_0x2a404d,null))[_0x3a15('0x29')](handleError(_0x2a404d,null));};exports['create']=function(_0x542b93,_0xc6826c){var _0x1db14f={'name':_0x542b93[_0x3a15('0x5b')][_0x3a15('0x3a')],'key':_0x542b93[_0x3a15('0x5b')]['key'],'email':_0x542b93['body'][_0x3a15('0x6f')],'ListId':_0x542b93[_0x3a15('0x5b')][_0x3a15('0x70')],'active':!_[_0x3a15('0x71')](_0x542b93['body'][_0x3a15('0x72')])?_0x542b93[_0x3a15('0x5b')][_0x3a15('0x72')]:!![],'description':_0x542b93[_0x3a15('0x5b')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x3a15('0x71')](_0x542b93['body'][_0x3a15('0x73')])){if(_0x542b93[_0x3a15('0x5b')][_0x3a15('0x74')]){_0x1db14f[_0x3a15('0x3e')][_0x3a15('0x75')]=_0x1db14f[_0x3a15('0x40')]['user']=_0x542b93[_0x3a15('0x5b')][_0x3a15('0x76')];_0x1db14f[_0x3a15('0x3e')]['password']=_0x1db14f[_0x3a15('0x40')][_0x3a15('0x77')]=_0x542b93['body'][_0x3a15('0x78')];}else{_0x1db14f[_0x3a15('0x3e')][_0x3a15('0x79')]=_0x1db14f[_0x3a15('0x40')][_0x3a15('0x79')]=![];}_0x1db14f['Imap']['host']=_0x542b93['body'][_0x3a15('0x3e')][_0x3a15('0x7a')];_0x1db14f[_0x3a15('0x3e')][_0x3a15('0x7b')]=_0x542b93[_0x3a15('0x5b')]['Imap'][_0x3a15('0x7b')];_0x1db14f[_0x3a15('0x40')]['host']=_0x542b93['body'][_0x3a15('0x40')]['host'];_0x1db14f['Smtp'][_0x3a15('0x7b')]=_0x542b93[_0x3a15('0x5b')][_0x3a15('0x40')][_0x3a15('0x7b')];}else{_0x1db14f[_0x3a15('0x3e')][_0x3a15('0x7c')]=_0x1db14f['Smtp'][_0x3a15('0x7c')]=_0x542b93[_0x3a15('0x5b')][_0x3a15('0x73')];_0x1db14f[_0x3a15('0x3e')][_0x3a15('0x75')]=_0x1db14f[_0x3a15('0x40')][_0x3a15('0x75')]=_0x542b93[_0x3a15('0x5b')][_0x3a15('0x76')];_0x1db14f[_0x3a15('0x3e')][_0x3a15('0x7d')]=_0x1db14f['Smtp'][_0x3a15('0x77')]=_0x542b93[_0x3a15('0x5b')][_0x3a15('0x78')];}return db[_0x3a15('0x44')][_0x3a15('0x62')](_0x1db14f,{'include':[{'model':db[_0x3a15('0x3f')],'as':_0x3a15('0x40')},{'model':db[_0x3a15('0x3d')],'as':_0x3a15('0x3e')}]})['then'](function(_0x56bb49){var _0x2ac2da=_0x542b93[_0x3a15('0x75')][_0x3a15('0x37')]({'plain':!![]});if(!_0x2ac2da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ac2da['role']===_0x3a15('0x75')){var _0x4d250c=_0x56bb49[_0x3a15('0x37')]({'plain':!![]});return db[_0x3a15('0x7e')]['find']({'where':{'name':_0x3a15('0x38'),'userProfileId':_0x2ac2da[_0x3a15('0x7f')]},'raw':!![]})[_0x3a15('0x35')](function(_0x1a7900){if(_0x1a7900&&_0x1a7900['autoAssociation']===0x0){return db[_0x3a15('0x80')]['create']({'name':_0x4d250c[_0x3a15('0x3a')],'resourceId':_0x4d250c['id'],'type':_0x1a7900['name'],'sectionId':_0x1a7900['id']},{})[_0x3a15('0x35')](function(){return _0x56bb49;});}else{return _0x56bb49;}})[_0x3a15('0x29')](function(_0x100135){logger['error'](_0x3a15('0x81'),_0x100135);throw _0x100135;});}return _0x56bb49;})[_0x3a15('0x35')](respondWithResult(_0xc6826c,0xc9))['catch'](handleError(_0xc6826c,null));};exports[_0x3a15('0x82')]=function(_0x143d5f,_0x2634b1,_0x3a46e8){return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x143d5f[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x2634b1,null))[_0x3a15('0x35')](function(_0x18b497){if(_0x18b497){return _0x18b497[_0x3a15('0x82')]();}return null;})[_0x3a15('0x35')](respondWithResult(_0x2634b1,null))['catch'](handleError(_0x2634b1,null));};exports[_0x3a15('0x83')]=function(_0x46a506,_0xa3cd78,_0x46e1d2){if(_0x46a506[_0x3a15('0x5b')]['id']){delete _0x46a506[_0x3a15('0x5b')]['id'];}return db[_0x3a15('0x44')][_0x3a15('0x5c')]({'where':{'id':_0x46a506['params']['id']}})['then'](handleEntityNotFound(_0xa3cd78,null))[_0x3a15('0x35')](function(_0xaf8e31){if(_0xaf8e31){_0x46a506[_0x3a15('0x5b')]['MailAccountId']=_0xaf8e31['id'];return db[_0x3a15('0x3d')][_0x3a15('0x62')](_0x46a506['body']);}})[_0x3a15('0x35')](respondWithResult(_0xa3cd78,null))[_0x3a15('0x29')](handleError(_0xa3cd78,null));};exports[_0x3a15('0x84')]=function(_0x404a74,_0x3c3816,_0x4b7d64){return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x404a74[_0x3a15('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3c3816,null))[_0x3a15('0x35')](function(_0x3dfa4b){if(_0x3dfa4b){return _0x3dfa4b[_0x3a15('0x85')](null);}return null;})[_0x3a15('0x35')](respondWithStatusCode(_0x3c3816,null))['catch'](handleError(_0x3c3816,null));};exports['getSmtp']=function(_0x516504,_0xbf18c6,_0x2a36ba){return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x516504[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0xbf18c6,null))[_0x3a15('0x35')](function(_0xfed073){if(_0xfed073){return _0xfed073[_0x3a15('0x86')]();}return null;})[_0x3a15('0x35')](respondWithResult(_0xbf18c6,null))['catch'](handleError(_0xbf18c6,null));};exports['addSmtp']=function(_0x346fa6,_0x220d93,_0x56f5a2){if(_0x346fa6['body']['id']){delete _0x346fa6['body']['id'];}return db[_0x3a15('0x44')][_0x3a15('0x5c')]({'where':{'id':_0x346fa6[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x220d93,null))['then'](function(_0x841ebe){if(_0x841ebe){_0x346fa6[_0x3a15('0x5b')][_0x3a15('0x60')]=_0x841ebe['id'];return db[_0x3a15('0x3f')]['create'](_0x346fa6[_0x3a15('0x5b')]);}})[_0x3a15('0x35')](respondWithResult(_0x220d93,null))['catch'](handleError(_0x220d93,null));};exports[_0x3a15('0x87')]=function(_0xb601cc,_0x33a582,_0xd8e651){return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0xb601cc['params']['id']}})['then'](handleEntityNotFound(_0x33a582,null))[_0x3a15('0x35')](function(_0x11d8f5){if(_0x11d8f5){return _0x11d8f5['setSmtp'](null);}return null;})[_0x3a15('0x35')](respondWithStatusCode(_0x33a582,null))['catch'](handleError(_0x33a582,null));};exports[_0x3a15('0x88')]=function(_0x5c3e48,_0xc63df,_0x542c4c){return db[_0x3a15('0x89')][_0x3a15('0x5c')]({'where':{'id':_0x5c3e48['params']['id']}})['then'](handleEntityNotFound(_0xc63df,null))[_0x3a15('0x35')](function(_0x55c27f){if(_0x55c27f){return _0x55c27f[_0x3a15('0x88')](_0x5c3e48[_0x3a15('0x5b')]['ids'],_[_0x3a15('0x8a')](_0x5c3e48[_0x3a15('0x5b')],[_0x3a15('0x69'),'id'])||{});}})[_0x3a15('0x35')](respondWithResult(_0xc63df,null))['catch'](handleError(_0xc63df,null));};exports[_0x3a15('0x8b')]=function(_0x80359a,_0x6c29b7,_0xe3d233){var _0x94cb4f={'raw':![],'where':{}};var _0x432b99={};var _0x160ecd={'count':0x0,'rows':[]};return db[_0x3a15('0x44')]['findOne']({'where':{'id':_0x80359a[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x6c29b7,null))[_0x3a15('0x35')](function(_0x5bd46f){if(_0x5bd46f){_0x432b99[_0x3a15('0x49')]=_[_0x3a15('0x4b')](db[_0x3a15('0x89')]['rawAttributes']);_0x432b99[_0x3a15('0x4a')]=_['keys'](_0x80359a['query']);_0x432b99[_0x3a15('0x52')]=_[_0x3a15('0x4c')](_0x432b99['model'],_0x432b99['query']);_0x94cb4f[_0x3a15('0x4d')]=_['intersection'](_0x432b99['model'],qs[_0x3a15('0x4e')](_0x80359a[_0x3a15('0x4a')][_0x3a15('0x4e')]));_0x94cb4f[_0x3a15('0x4d')]=_0x94cb4f['attributes'][_0x3a15('0x65')]?_0x94cb4f[_0x3a15('0x4d')]:_0x432b99[_0x3a15('0x49')];if(!_0x80359a[_0x3a15('0x4a')][_0x3a15('0x66')](_0x3a15('0x4f'))){_0x94cb4f[_0x3a15('0x2c')]=qs[_0x3a15('0x2c')](_0x80359a['query'][_0x3a15('0x2c')]);_0x94cb4f[_0x3a15('0x2f')]=qs[_0x3a15('0x2f')](_0x80359a[_0x3a15('0x4a')][_0x3a15('0x2f')]);}_0x94cb4f[_0x3a15('0x50')]=qs[_0x3a15('0x67')](_0x80359a['query'][_0x3a15('0x67')]);_0x94cb4f[_0x3a15('0x51')]=qs['filters'](_[_0x3a15('0x6b')](_0x80359a['query'],_0x432b99[_0x3a15('0x52')]));_0x94cb4f[_0x3a15('0x51')][_0x3a15('0x60')]=_0x5bd46f['id'];if(_0x80359a['query'][_0x3a15('0x53')]){_0x94cb4f['where']=_[_0x3a15('0x54')](_0x94cb4f[_0x3a15('0x51')],{'$or':_[_0x3a15('0x43')](_0x94cb4f[_0x3a15('0x4d')],function(_0x1fa2ff){var _0x4b43ce={};_0x4b43ce[_0x1fa2ff]={'$like':'%'+_0x80359a[_0x3a15('0x4a')][_0x3a15('0x53')]+'%'};return _0x4b43ce;})});}_0x94cb4f=_[_0x3a15('0x54')]({},_0x94cb4f,_0x80359a[_0x3a15('0x56')]);return db['MailInteraction'][_0x3a15('0x2e')]({'where':_0x94cb4f['where']})[_0x3a15('0x35')](function(_0x175907){_0x160ecd[_0x3a15('0x2e')]=_0x175907;if(_0x80359a[_0x3a15('0x4a')]['includeAll']){_0x94cb4f[_0x3a15('0x58')]=[{'model':db[_0x3a15('0x8c')],'as':_0x3a15('0x8d'),'required':![]},{'model':db[_0x3a15('0x8e')],'as':_0x3a15('0x8f'),'attributes':[_0x3a15('0x3a'),'fullname',_0x3a15('0x90')],'required':![]},{'model':db[_0x3a15('0x91')],'as':_0x3a15('0x92'),'attributes':['id',_0x3a15('0x3a'),_0x3a15('0x93')],'where':_0x80359a[_0x3a15('0x4a')][_0x3a15('0x94')]?{'id':_0x80359a[_0x3a15('0x4a')][_0x3a15('0x94')]}:undefined,'required':_0x80359a['query']['tag']?!![]:![]}];}return db[_0x3a15('0x89')][_0x3a15('0x6d')](_0x94cb4f);})[_0x3a15('0x35')](function(_0x4c5d5f){_0x160ecd[_0x3a15('0x59')]=_0x4c5d5f;return _0x160ecd;});}})[_0x3a15('0x35')](respondWithFilteredResult(_0x6c29b7,_0x94cb4f))[_0x3a15('0x29')](handleError(_0x6c29b7,null));};exports[_0x3a15('0x95')]=function addApplications(_0xad6d6f,_0x1c99e0){var _0x131d0a=_0xad6d6f[_0x3a15('0x5d')]['id'];var _0x391519=_0xad6d6f[_0x3a15('0x5b')];var _0x3cff2e=0xc8;var _0x270d22=null;return db[_0x3a15('0x96')][_0x3a15('0x97')]({'isolationLevel':db[_0x3a15('0x96')]['Transaction'][_0x3a15('0x98')][_0x3a15('0x99')]},function(_0x3eafcb){return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x131d0a},'transaction':_0x3eafcb})[_0x3a15('0x35')](function(_0x368991){if(_0x368991){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x131d0a},'transaction':_0x3eafcb})[_0x3a15('0x35')](function(){var _0x564e43=_[_0x3a15('0x43')](_0x391519,function(_0x1b5301){_0x1b5301[_0x3a15('0x60')]=_0x131d0a;return _0x1b5301;});return db['MailApplication']['bulkCreate'](_0x564e43,{'transaction':_0x3eafcb});});}else{_0x3cff2e=0x194;_0x270d22=[];}});})[_0x3a15('0x35')](function(){if(_0x3cff2e!==0x194){return db[_0x3a15('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x131d0a},'order':'priority'})[_0x3a15('0x35')](function(_0x3a4d42){_0x270d22=_0x3a4d42;});}})[_0x3a15('0x29')](function(_0x2488c7){_0x3cff2e=0x1f4;logger['error'](_0x2488c7[_0x3a15('0x39')]);if(_0x2488c7[_0x3a15('0x3a')]){delete _0x2488c7[_0x3a15('0x3a')];}_0x270d22=_0x2488c7;})[_0x3a15('0x9b')](function(){if(_0x270d22===null){_0x1c99e0[_0x3a15('0x9c')](_0x3cff2e);}else{if(_0x3cff2e===0x1f4){_0x1c99e0[_0x3a15('0x2a')](_0x3cff2e)['send'](_0x270d22);}else{_0x1c99e0[_0x3a15('0x2a')](_0x3cff2e)[_0x3a15('0x31')](_0x270d22);}}});};exports[_0x3a15('0x9d')]=function(_0x1a5f0f,_0x1284f2,_0x5a29bf){var _0x38992a={};var _0xb4112f={};var _0x4d4e44;var _0x5b94ce;return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x1a5f0f[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x1284f2,null))[_0x3a15('0x35')](function(_0x23fa5e){if(_0x23fa5e){_0x4d4e44=_0x23fa5e;_0xb4112f[_0x3a15('0x49')]=_[_0x3a15('0x4b')](db['MailApplication'][_0x3a15('0x45')]);_0xb4112f[_0x3a15('0x4a')]=_[_0x3a15('0x4b')](_0x1a5f0f[_0x3a15('0x4a')]);_0xb4112f[_0x3a15('0x52')]=_[_0x3a15('0x4c')](_0xb4112f['model'],_0xb4112f[_0x3a15('0x4a')]);_0x38992a[_0x3a15('0x4d')]=_[_0x3a15('0x4c')](_0xb4112f[_0x3a15('0x49')],qs[_0x3a15('0x4e')](_0x1a5f0f[_0x3a15('0x4a')][_0x3a15('0x4e')]));_0x38992a[_0x3a15('0x4d')]=_0x38992a[_0x3a15('0x4d')][_0x3a15('0x65')]?_0x38992a['attributes']:_0xb4112f[_0x3a15('0x49')];_0x38992a[_0x3a15('0x50')]=qs[_0x3a15('0x67')](_0x1a5f0f[_0x3a15('0x4a')][_0x3a15('0x67')]);_0x38992a[_0x3a15('0x51')]=qs['filters'](_[_0x3a15('0x6b')](_0x1a5f0f[_0x3a15('0x4a')],_0xb4112f[_0x3a15('0x52')]));if(_0x1a5f0f[_0x3a15('0x4a')][_0x3a15('0x53')]){_0x38992a[_0x3a15('0x51')]=_[_0x3a15('0x54')](_0x38992a['where'],{'$or':_[_0x3a15('0x43')](_0x38992a['attributes'],function(_0x7bd49){var _0x18d8fe={};_0x18d8fe[_0x7bd49]={'$like':'%'+_0x1a5f0f[_0x3a15('0x4a')][_0x3a15('0x53')]+'%'};return _0x18d8fe;})});}_0x38992a=_['merge']({},_0x38992a,_0x1a5f0f[_0x3a15('0x56')]);return _0x4d4e44[_0x3a15('0x9d')](_0x38992a);}})[_0x3a15('0x35')](function(_0x2cf20b){if(_0x2cf20b){_0x5b94ce=_0x2cf20b[_0x3a15('0x65')];if(!_0x1a5f0f['query']['hasOwnProperty'](_0x3a15('0x4f'))){_0x38992a[_0x3a15('0x2c')]=qs[_0x3a15('0x2c')](_0x1a5f0f[_0x3a15('0x4a')]['limit']);_0x38992a[_0x3a15('0x2f')]=qs[_0x3a15('0x2f')](_0x1a5f0f[_0x3a15('0x4a')][_0x3a15('0x2f')]);}return _0x4d4e44['getApplications'](_0x38992a);}})[_0x3a15('0x35')](function(_0xb7001d){if(_0xb7001d){return _0xb7001d?{'count':_0x5b94ce,'rows':_0xb7001d}:null;}})[_0x3a15('0x35')](respondWithResult(_0x1284f2,null))['catch'](handleError(_0x1284f2,null));};exports[_0x3a15('0x9e')]=function(_0x99c11f,_0x1d3e9c,_0x2b54b3){var _0x1bda4b={'raw':!![],'where':{}};var _0x49a4b8={};var _0x15e065={'count':0x0,'rows':[]};return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x99c11f[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x1d3e9c,null))[_0x3a15('0x35')](function(_0x18e759){if(_0x18e759){_0x49a4b8[_0x3a15('0x49')]=_[_0x3a15('0x4b')](db['MailMessage'][_0x3a15('0x45')]);_0x49a4b8[_0x3a15('0x4a')]=_[_0x3a15('0x4b')](_0x99c11f['query']);_0x49a4b8[_0x3a15('0x52')]=_[_0x3a15('0x4c')](_0x49a4b8[_0x3a15('0x49')],_0x49a4b8[_0x3a15('0x4a')]);_0x1bda4b[_0x3a15('0x4d')]=_[_0x3a15('0x4c')](_0x49a4b8['model'],qs[_0x3a15('0x4e')](_0x99c11f[_0x3a15('0x4a')][_0x3a15('0x4e')]));_0x1bda4b['attributes']=_0x1bda4b[_0x3a15('0x4d')][_0x3a15('0x65')]?_0x1bda4b['attributes']:_0x49a4b8[_0x3a15('0x49')];if(!_0x99c11f['query'][_0x3a15('0x66')](_0x3a15('0x4f'))){_0x1bda4b[_0x3a15('0x2c')]=qs[_0x3a15('0x2c')](_0x99c11f[_0x3a15('0x4a')]['limit']);_0x1bda4b['offset']=qs['offset'](_0x99c11f['query'][_0x3a15('0x2f')]);}_0x1bda4b[_0x3a15('0x50')]=qs[_0x3a15('0x67')](_0x99c11f[_0x3a15('0x4a')][_0x3a15('0x67')]);_0x1bda4b[_0x3a15('0x51')]=qs['filters'](_[_0x3a15('0x6b')](_0x99c11f[_0x3a15('0x4a')],_0x49a4b8[_0x3a15('0x52')]));_0x1bda4b[_0x3a15('0x51')][_0x3a15('0x60')]=_0x18e759['id'];if(_0x99c11f[_0x3a15('0x4a')][_0x3a15('0x53')]){_0x1bda4b[_0x3a15('0x51')]=_[_0x3a15('0x54')](_0x1bda4b['where'],{'$or':_[_0x3a15('0x43')](_0x1bda4b[_0x3a15('0x4d')],function(_0x5d5370){var _0x21ea63={};_0x21ea63[_0x5d5370]={'$like':'%'+_0x99c11f[_0x3a15('0x4a')][_0x3a15('0x53')]+'%'};return _0x21ea63;})});}if(_0x99c11f[_0x3a15('0x4a')]['$gte']){var _0x31f05f=_0x99c11f['query'][_0x3a15('0x9f')][_0x3a15('0xa0')](',');var _0x225f8c={};_0x225f8c[_0x31f05f[0x0]]={'$gte':moment(_0x31f05f[0x1])['format'](_0x3a15('0xa1'))};_0x1bda4b[_0x3a15('0x51')]=_['merge'](_0x1bda4b[_0x3a15('0x51')],_0x225f8c);}_0x1bda4b=_['merge']({},_0x1bda4b,_0x99c11f[_0x3a15('0x56')]);return db[_0x3a15('0xa2')][_0x3a15('0x2e')]({'where':_0x1bda4b[_0x3a15('0x51')]})[_0x3a15('0x35')](function(_0x2d2414){_0x15e065[_0x3a15('0x2e')]=_0x2d2414;if(_0x99c11f[_0x3a15('0x4a')][_0x3a15('0x57')]){_0x1bda4b[_0x3a15('0x58')]=[{'all':!![]}];}return db[_0x3a15('0xa2')][_0x3a15('0x6d')](_0x1bda4b);})[_0x3a15('0x35')](function(_0x4cd078){if(_0x99c11f[_0x3a15('0x4a')][_0x3a15('0xa3')]===_0x3a15('0xa4')){for(var _0x31c060=0x0;_0x31c060<_0x4cd078[_0x3a15('0x65')];_0x31c060++){_0x4cd078[_0x31c060]['body']=juice(_0x4cd078[_0x31c060][_0x3a15('0x5b')]);}}_0x15e065[_0x3a15('0x59')]=_0x4cd078;return _0x15e065;});}})[_0x3a15('0x35')](respondWithFilteredResult(_0x1d3e9c,_0x1bda4b))[_0x3a15('0x29')](handleError(_0x1d3e9c,null));};exports[_0x3a15('0x3b')]=function(_0x75df59,_0x46406d,_0x12124a){var _0x59fc46,_0x3f8910={},_0x4a0935;if(_0x75df59[_0x3a15('0x5b')]['to']){_0x4a0935=_0x75df59[_0x3a15('0x5b')]['to'][_0x3a15('0xa0')](',')[0x0];}return db[_0x3a15('0x44')][_0x3a15('0x5c')]({'where':{'id':_0x75df59[_0x3a15('0x5d')]['id']},'include':[{'model':db[_0x3a15('0xa5')],'as':_0x3a15('0xa6'),'include':[{'model':db[_0x3a15('0x8c')],'as':'Contacts','where':{'email':_0x4a0935},'limit':0x1,'order':[[_0x3a15('0xa7'),_0x3a15('0xa8')]]}]},{'model':db['MailServerOut'],'as':_0x3a15('0x40'),'raw':!![]}]})[_0x3a15('0x35')](handleEntityNotFound(_0x46406d,null))['then'](function(_0x372271){if(_0x372271){_0x59fc46=_0x372271;if(_0x372271['Smtp']){if(_[_0x3a15('0x71')](_0x75df59['body'][_0x3a15('0xa9')])){_0x75df59[_0x3a15('0x5b')][_0x3a15('0xa9')]=util['format']('%s\x20<%s>',_0x372271[_0x3a15('0x3a')],_0x372271[_0x3a15('0x6f')]||_0x372271[_0x3a15('0x40')][_0x3a15('0x75')]);}if(_0x75df59['body'][_0x3a15('0xaa')]&&_0x75df59[_0x3a15('0x5b')]['attachments'][_0x3a15('0x65')]){for(var _0x36a586=0x0;_0x36a586<_0x75df59[_0x3a15('0x5b')]['attachments'][_0x3a15('0x65')];_0x36a586+=0x1){_0x75df59[_0x3a15('0x5b')][_0x3a15('0xaa')][_0x36a586]={'filename':_0x75df59[_0x3a15('0x5b')][_0x3a15('0xaa')][_0x36a586][_0x3a15('0x3a')],'path':path['join'](config[_0x3a15('0xab')],_0x3a15('0xac'),_0x75df59[_0x3a15('0x5b')][_0x3a15('0xaa')][_0x36a586][_0x3a15('0xad')])};}}var _0xcec3eb={'tls':{'rejectUnauthorized':![]}};if(_[_0x3a15('0x71')](_0x372271['Smtp']['service'])){if(_0x372271['Smtp'][_0x3a15('0x79')]){_0xcec3eb[_0x3a15('0xae')]={'user':_0x372271[_0x3a15('0x40')][_0x3a15('0x75')],'pass':_0x372271[_0x3a15('0x40')][_0x3a15('0x77')]};}_0xcec3eb[_0x3a15('0x7a')]=_0x372271['Smtp'][_0x3a15('0x7a')];_0xcec3eb['port']=_0x372271['Smtp']['port'];_0xcec3eb['secure']=_0x372271[_0x3a15('0x40')][_0x3a15('0xaf')];}else{_0xcec3eb[_0x3a15('0x7c')]=_0x372271[_0x3a15('0x40')][_0x3a15('0x7c')];_0xcec3eb[_0x3a15('0xae')]={'user':_0x372271[_0x3a15('0x40')]['user'],'pass':_0x372271['Smtp'][_0x3a15('0x77')]};}return respondWithRpcPromise(_0x3a15('0xb0'),'sendMail',{'account':_0xcec3eb,'message':_0x75df59[_0x3a15('0x5b')]});}else{throw new Error(_0x3a15('0xb1'));}}})[_0x3a15('0x35')](function(_0x2032b1){if(_0x2032b1){_0x3f8910=_0x2032b1;if(_0x59fc46[_0x3a15('0xa6')]){if(_0x59fc46['List'][_0x3a15('0xb2')][_0x3a15('0x65')]){return _0x59fc46[_0x3a15('0xa6')][_0x3a15('0xb2')][0x0];}else{return db['CmContact'][_0x3a15('0x62')](_[_0x3a15('0x1b')](_0x75df59['body'],{'firstName':_0x75df59[_0x3a15('0x5b')]['to'],'email':_0x75df59[_0x3a15('0x5b')]['to'],'phone':_0x75df59[_0x3a15('0x5b')]['to'],'ListId':_0x59fc46['ListId']}));}}else{throw new Error(_0x3a15('0xb1'));}}})[_0x3a15('0x35')](function(_0x67d30d){if(_0x67d30d){var _0xaf6c9a={'UserId':_0x75df59[_0x3a15('0x75')]['id'],'ContactId':_0x67d30d['id'],'MailAccountId':_0x59fc46['id'],'inReplyTo':_0x3f8910[_0x3a15('0xb3')],'to':_0x75df59[_0x3a15('0x5b')]['from'],'cc':_0x75df59[_0x3a15('0x5b')]['cc'],'subject':_0x75df59['body'][_0x3a15('0xb4')],'attach':_0x75df59[_0x3a15('0x5b')][_0x3a15('0xb5')],'firstMsgDirection':_0x3a15('0xb6'),'lastMsgAt':moment()['format'](_0x3a15('0xa1')),'lastMsgDirection':_0x3a15('0xb6'),'Messages':[_[_0x3a15('0x54')](_0x75df59['body'],{'messageId':_0x3f8910[_0x3a15('0xb3')],'sentAt':moment()[_0x3a15('0xb7')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x59fc46['id'],'UserId':_0x75df59[_0x3a15('0x75')]['id'],'ContactId':_0x67d30d['id']})]};if(_0x75df59['body'][_0x3a15('0xb8')]){_0xaf6c9a=_[_0x3a15('0x54')](_0xaf6c9a,_0x75df59['body'][_0x3a15('0xb8')]);}return db[_0x3a15('0x89')]['create'](_0xaf6c9a,{'include':[{'model':db[_0x3a15('0xa2')],'as':'Messages'}]});}})[_0x3a15('0x35')](respondWithResult(_0x46406d,null))[_0x3a15('0x29')](handleError(_0x46406d,null));};exports[_0x3a15('0xb9')]=function(_0x5e87f2,_0x50ae59,_0x4ed822){return db['MailAccount'][_0x3a15('0x5c')]({'where':{'id':_0x5e87f2[_0x3a15('0x5d')]['id']},'include':[{'model':db[_0x3a15('0x3f')],'as':'Smtp','raw':!![]}]})[_0x3a15('0x35')](handleEntityNotFound(_0x50ae59,null))[_0x3a15('0x35')](function(_0x5cd1e9){if(_0x5cd1e9&&_0x5cd1e9['Smtp']){var _0x820087={'id':_0x5cd1e9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5cd1e9[_0x3a15('0x40')][_0x3a15('0x7c')]){_0x820087['service']=_0x5cd1e9[_0x3a15('0x40')][_0x3a15('0x7c')];}else{_0x820087['host']=_0x5cd1e9[_0x3a15('0x40')][_0x3a15('0x7a')];_0x820087['port']=_0x5cd1e9['Smtp'][_0x3a15('0x7b')];_0x820087['secure']=_0x5cd1e9['Smtp'][_0x3a15('0xaf')];}if(_0x5cd1e9[_0x3a15('0x40')][_0x3a15('0x79')]){_0x820087[_0x3a15('0xae')]={'user':_0x5cd1e9['Smtp']['user'],'pass':_0x5cd1e9[_0x3a15('0x40')][_0x3a15('0x77')]};}return respondWithRpcPromise(_0x3a15('0xba'),_0x3a15('0xb9'),{'account':_0x820087});}})[_0x3a15('0x35')](respondWithResult(_0x50ae59,null))[_0x3a15('0x29')](handleError(_0x50ae59,null));};exports[_0x3a15('0x36')]=function(_0x246814,_0x335238){return db['MailAccount'][_0x3a15('0x5c')]({'where':{'id':_0x246814[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x335238,null))[_0x3a15('0x35')](function(_0x10e8c7){if(_0x10e8c7&&_0x10e8c7[_0x3a15('0x7c')]){throw new db[(_0x3a15('0xbb'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x10e8c7;})[_0x3a15('0x35')](removeEntity(_0x335238,null))[_0x3a15('0x29')](handleError(_0x335238,null));};exports[_0x3a15('0xbc')]=function(_0x269f51,_0x5d0d50,_0x4c4e57){return db['MailAccount'][_0x3a15('0x5c')]({'where':{'id':_0x269f51[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x5d0d50,null))[_0x3a15('0x35')](function(_0x293740){if(_0x293740){return _0x293740[_0x3a15('0xbc')](_0x269f51[_0x3a15('0x5b')]['ids'],_[_0x3a15('0x8a')](_0x269f51['body'],[_0x3a15('0x69'),'id'])||{})[_0x3a15('0xbd')](function(_0x44c02e){for(var _0x3747cc=0x0;_0x3747cc<_0x269f51[_0x3a15('0x5b')][_0x3a15('0x69')][_0x3a15('0x65')];_0x3747cc+=0x1){socket['emit'](_0x3a15('0xbe'),{'UserId':Number(_0x269f51[_0x3a15('0x5b')][_0x3a15('0x69')][_0x3747cc]),'MailAccountId':Number(_0x269f51['params']['id'])});}return _0x44c02e;});}})['then'](respondWithResult(_0x5d0d50,null))[_0x3a15('0x29')](handleError(_0x5d0d50,null));};exports[_0x3a15('0xbf')]=function(_0x1d1e92,_0x489135,_0x43a08c){return db[_0x3a15('0x44')][_0x3a15('0x5c')]({'where':{'id':_0x1d1e92[_0x3a15('0x5d')]['id']}})['then'](handleEntityNotFound(_0x489135,null))[_0x3a15('0x35')](function(_0x8f3e43){if(_0x8f3e43){return _0x8f3e43[_0x3a15('0xbf')](_0x1d1e92[_0x3a15('0x4a')][_0x3a15('0x69')])[_0x3a15('0x35')](function(){if(_[_0x3a15('0xc0')](_0x1d1e92[_0x3a15('0x4a')][_0x3a15('0x69')])){for(var _0x3e5971=0x0;_0x3e5971<_0x1d1e92['query'][_0x3a15('0x69')][_0x3a15('0x65')];_0x3e5971+=0x1){socket[_0x3a15('0xc1')](_0x3a15('0xc2'),{'UserId':Number(_0x1d1e92[_0x3a15('0x4a')]['ids'][_0x3e5971]),'MailAccountId':Number(_0x1d1e92[_0x3a15('0x5d')]['id'])});}}else{socket['emit'](_0x3a15('0xc2'),{'UserId':Number(_0x1d1e92['query'][_0x3a15('0x69')]),'MailAccountId':Number(_0x1d1e92[_0x3a15('0x5d')]['id'])});}});}})[_0x3a15('0x35')](respondWithStatusCode(_0x489135,null))[_0x3a15('0x29')](handleError(_0x489135,null));};exports[_0x3a15('0xc3')]=function(_0x3bfd47,_0x416c0d,_0x7f75b2){var _0x146369={};var _0x3c604b={};var _0x2ca5b3;var _0x27c5ff;return db[_0x3a15('0x44')][_0x3a15('0x64')]({'where':{'id':_0x3bfd47[_0x3a15('0x5d')]['id']}})[_0x3a15('0x35')](handleEntityNotFound(_0x416c0d,null))[_0x3a15('0x35')](function(_0x31dd22){if(_0x31dd22){_0x2ca5b3=_0x31dd22;_0x3c604b['model']=_[_0x3a15('0x4b')](db['User'][_0x3a15('0x45')]);_0x3c604b[_0x3a15('0x4a')]=_['keys'](_0x3bfd47[_0x3a15('0x4a')]);_0x3c604b['filters']=_['intersection'](_0x3c604b[_0x3a15('0x49')],_0x3c604b[_0x3a15('0x4a')]);_0x146369['attributes']=_['intersection'](_0x3c604b['model'],qs[_0x3a15('0x4e')](_0x3bfd47[_0x3a15('0x4a')][_0x3a15('0x4e')]));_0x146369['attributes']=_0x146369[_0x3a15('0x4d')]['length']?_0x146369[_0x3a15('0x4d')]:_0x3c604b[_0x3a15('0x49')];_0x146369[_0x3a15('0x50')]=qs['sort'](_0x3bfd47[_0x3a15('0x4a')][_0x3a15('0x67')]);_0x146369[_0x3a15('0x51')]=qs[_0x3a15('0x52')](_[_0x3a15('0x6b')](_0x3bfd47[_0x3a15('0x4a')],_0x3c604b[_0x3a15('0x52')]));if(_0x3bfd47[_0x3a15('0x4a')]['filter']){_0x146369[_0x3a15('0x51')]=_[_0x3a15('0x54')](_0x146369[_0x3a15('0x51')],{'$or':_[_0x3a15('0x43')](_0x146369[_0x3a15('0x4d')],function(_0xc22bf4){var _0xf1698c={};_0xf1698c[_0xc22bf4]={'$like':'%'+_0x3bfd47[_0x3a15('0x4a')][_0x3a15('0x53')]+'%'};return _0xf1698c;})});}_0x146369=_[_0x3a15('0x54')]({},_0x146369,_0x3bfd47['options']);return _0x2ca5b3[_0x3a15('0xc3')](_0x146369);}})[_0x3a15('0x35')](function(_0x386e71){if(_0x386e71){_0x27c5ff=_0x386e71[_0x3a15('0x65')];if(!_0x3bfd47[_0x3a15('0x4a')][_0x3a15('0x66')](_0x3a15('0x4f'))){_0x146369['limit']=qs[_0x3a15('0x2c')](_0x3bfd47[_0x3a15('0x4a')][_0x3a15('0x2c')]);_0x146369[_0x3a15('0x2f')]=qs['offset'](_0x3bfd47['query'][_0x3a15('0x2f')]);}return _0x2ca5b3['getAgents'](_0x146369);}})['then'](function(_0x48e582){if(_0x48e582){return _0x48e582?{'count':_0x27c5ff,'rows':_0x48e582}:null;}})[_0x3a15('0x35')](respondWithResult(_0x416c0d,null))[_0x3a15('0x29')](handleError(_0x416c0d,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 3d8be68..4b64a7f 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 _0xca93=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xca93,0x123));var _0x3ca9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xca93[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x3ca9('0x0'));var MailAccount=require(_0x3ca9('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3ca9('0x2'),'afterUpdate':_0x3ca9('0x3'),'afterDestroy':_0x3ca9('0x4')};function emitEvent(_0x1194ed){return function(_0x20c6ee,_0x33f6c8,_0x193c99){MailAccountEvents['emit'](_0x1194ed+':'+_0x20c6ee['id'],_0x20c6ee);MailAccountEvents[_0x3ca9('0x5')](_0x1194ed,_0x20c6ee);_0x193c99(null);};}for(var e in events){if(events[_0x3ca9('0x6')](e)){var event=events[e];MailAccount[_0x3ca9('0x7')](e,emitEvent(event));}}module[_0x3ca9('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xcb1a=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0xcb1a,0xb6));var _0xacb1=function(_0xd278ff,_0x4af6df){_0xd278ff=_0xd278ff-0x0;var _0x39008b=_0xcb1a[_0xd278ff];return _0x39008b;};'use strict';var EventEmitter=require(_0xacb1('0x0'));var MailAccount=require(_0xacb1('0x1'))['db'][_0xacb1('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xacb1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xacb1('0x4')};function emitEvent(_0x5248c7){return function(_0x3015ce,_0x1356be,_0x5e4f72){MailAccountEvents[_0xacb1('0x5')](_0x5248c7+':'+_0x3015ce['id'],_0x3015ce);MailAccountEvents[_0xacb1('0x5')](_0x5248c7,_0x3015ce);_0x5e4f72(null);};}for(var e in events){if(events[_0xacb1('0x6')](e)){var event=events[e];MailAccount[_0xacb1('0x7')](e,emitEvent(event));}}module[_0xacb1('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5134327..121d214 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 _0x9ed9=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fcfd8,_0xb70c35){var _0x5943d2=function(_0x1b1f32){while(--_0x1b1f32){_0x1fcfd8['push'](_0x1fcfd8['shift']());}};_0x5943d2(++_0xb70c35);}(_0x9ed9,0x1a9));var _0x99ed=function(_0x521565,_0x1591bd){_0x521565=_0x521565-0x0;var _0x1dfc7e=_0x9ed9[_0x521565];return _0x1dfc7e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x99ed('0x0'))(_0x99ed('0x1'));var moment=require(_0x99ed('0x2'));var BPromise=require(_0x99ed('0x3'));var rp=require(_0x99ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x99ed('0x5'));module[_0x99ed('0x6')]=function(_0x505242,_0x37d4b2){return _0x505242[_0x99ed('0x7')](_0x99ed('0x8'),attributes,{'tableName':_0x99ed('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1068=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts','lodash','util'];(function(_0x5b013d,_0xc7691c){var _0x2b6eef=function(_0x3143ca){while(--_0x3143ca){_0x5b013d['push'](_0x5b013d['shift']());}};_0x2b6eef(++_0xc7691c);}(_0x1068,0x66));var _0x8106=function(_0x506874,_0x8d3e78){_0x506874=_0x506874-0x0;var _0x451ccf=_0x1068[_0x506874];return _0x451ccf;};'use strict';var _=require(_0x8106('0x0'));var util=require(_0x8106('0x1'));var logger=require(_0x8106('0x2'))('api');var moment=require(_0x8106('0x3'));var BPromise=require(_0x8106('0x4'));var rp=require(_0x8106('0x5'));var fs=require('fs');var path=require(_0x8106('0x6'));var rimraf=require(_0x8106('0x7'));var config=require(_0x8106('0x8'));var attributes=require(_0x8106('0x9'));module[_0x8106('0xa')]=function(_0x1c8924,_0x250cf4){return _0x1c8924['define'](_0x8106('0xb'),attributes,{'tableName':_0x8106('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index f346a81..f39b0e4 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 _0xca60=['autoclose','push','close','*,*,*,*','length','create','contact','messageId','subject','attach','format','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','originTo','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','debug','stringify','ShowMailAccount','find','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','Contacts','DESC','MailApplication','Applications','Smtp','List','omit','applications','orderBy','priority','asc'];(function(_0x2e24d4,_0x3cad21){var _0x4888ee=function(_0x2a5ba6){while(--_0x2a5ba6){_0x2e24d4['push'](_0x2e24d4['shift']());}};_0x4888ee(++_0x3cad21);}(_0xca60,0x88));var _0x0ca6=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0xca60[_0x40f9a0];return _0x3e3144;};'use strict';var _=require(_0x0ca6('0x0'));var util=require(_0x0ca6('0x1'));var moment=require(_0x0ca6('0x2'));var BPromise=require(_0x0ca6('0x3'));var rs=require(_0x0ca6('0x4'));var fs=require('fs');var Redis=require(_0x0ca6('0x5'));var db=require(_0x0ca6('0x6'))['db'];var utils=require(_0x0ca6('0x7'));var logger=require(_0x0ca6('0x8'))(_0x0ca6('0x9'));var config=require(_0x0ca6('0xa'));var jayson=require(_0x0ca6('0xb'));var client=jayson[_0x0ca6('0xc')]['http']({'port':0x232c});config[_0x0ca6('0xd')]=_[_0x0ca6('0xe')](config[_0x0ca6('0xd')],{'host':_0x0ca6('0xf'),'port':0x18eb});var socket=require(_0x0ca6('0x10'))(new Redis(config[_0x0ca6('0xd')]));require(_0x0ca6('0x11'))[_0x0ca6('0x12')](socket);function respondWithRpcPromise(_0x41a2d2,_0x27d5b5,_0x4b2f29){return new BPromise(function(_0x1cd482,_0x34b554){return client[_0x0ca6('0x13')](_0x41a2d2,_0x4b2f29)[_0x0ca6('0x14')](function(_0x1ba853){logger[_0x0ca6('0x15')](_0x0ca6('0x16'),_0x27d5b5,_0x0ca6('0x17'));logger['debug'](_0x0ca6('0x18'),_0x27d5b5,'request\x20sent',JSON['stringify'](_0x1ba853));if(_0x1ba853[_0x0ca6('0x19')]){if(_0x1ba853['error'][_0x0ca6('0x1a')]===0x1f4){logger[_0x0ca6('0x19')](_0x0ca6('0x16'),_0x27d5b5,_0x1ba853[_0x0ca6('0x19')][_0x0ca6('0x1b')]);return _0x34b554(_0x1ba853[_0x0ca6('0x19')][_0x0ca6('0x1b')]);}logger[_0x0ca6('0x19')](_0x0ca6('0x16'),_0x27d5b5,_0x1ba853['error'][_0x0ca6('0x1b')]);return _0x1cd482(_0x1ba853[_0x0ca6('0x19')][_0x0ca6('0x1b')]);}else{logger[_0x0ca6('0x15')](_0x0ca6('0x16'),_0x27d5b5,'request\x20sent');_0x1cd482(_0x1ba853['result'][_0x0ca6('0x1b')]);}})[_0x0ca6('0x1c')](function(_0x23396b){logger[_0x0ca6('0x19')]('MailAccount,\x20%s,\x20%s',_0x27d5b5,_0x23396b);_0x34b554(_0x23396b);});});}exports[_0x0ca6('0x1d')]=function(_0x4dd674){var _0x1c83c4=this;return new Promise(function(_0x4ac83e,_0x197af2){return db[_0x0ca6('0x1e')][_0x0ca6('0x1f')]({'raw':_0x4dd674['options']?_0x4dd674[_0x0ca6('0x20')][_0x0ca6('0x21')]===undefined?!![]:![]:!![],'where':_0x4dd674['options']?_0x4dd674[_0x0ca6('0x20')][_0x0ca6('0x22')]||null:null,'attributes':_0x4dd674[_0x0ca6('0x20')]?_0x4dd674['options'][_0x0ca6('0x23')]||null:null,'limit':_0x4dd674['options']?_0x4dd674[_0x0ca6('0x20')]['limit']||null:null,'include':_0x4dd674[_0x0ca6('0x20')]?_0x4dd674['options'][_0x0ca6('0x24')]?_['map'](_0x4dd674[_0x0ca6('0x20')][_0x0ca6('0x24')],function(_0x23f8a9){return{'model':db[_0x23f8a9[_0x0ca6('0x25')]],'as':_0x23f8a9['as'],'attributes':_0x23f8a9['attributes'],'include':_0x23f8a9[_0x0ca6('0x24')]?_[_0x0ca6('0x26')](_0x23f8a9['include'],function(_0xc0150f){return{'model':db[_0xc0150f['model']],'as':_0xc0150f['as'],'attributes':_0xc0150f['attributes'],'include':_0xc0150f[_0x0ca6('0x24')]?_[_0x0ca6('0x26')](_0xc0150f[_0x0ca6('0x24')],function(_0x4b006e){return{'model':db[_0x4b006e[_0x0ca6('0x25')]],'as':_0x4b006e['as'],'attributes':_0x4b006e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ca6('0x14')](function(_0x2933e6){logger[_0x0ca6('0x15')](_0x0ca6('0x1d'),_0x4dd674);logger[_0x0ca6('0x27')](_0x0ca6('0x1d'),_0x4dd674,JSON[_0x0ca6('0x28')](_0x2933e6));_0x4ac83e(_0x2933e6);})[_0x0ca6('0x1c')](function(_0x25dc6f){logger['error']('GetMailAccount',_0x25dc6f[_0x0ca6('0x1b')],_0x4dd674);_0x197af2(_0x1c83c4[_0x0ca6('0x19')](0x1f4,_0x25dc6f['message']));});});};exports[_0x0ca6('0x29')]=function(_0x35f135){var _0x525a08=this;return new Promise(function(_0x24ed1b,_0x25b6a0){return db[_0x0ca6('0x1e')][_0x0ca6('0x2a')]({'raw':_0x35f135[_0x0ca6('0x20')]?_0x35f135['options'][_0x0ca6('0x21')]===undefined?!![]:![]:!![],'where':_0x35f135[_0x0ca6('0x20')]?_0x35f135['options'][_0x0ca6('0x22')]||null:null,'attributes':_0x35f135[_0x0ca6('0x20')]?_0x35f135[_0x0ca6('0x20')]['attributes']||null:null,'include':_0x35f135['options']?_0x35f135['options'][_0x0ca6('0x24')]?_[_0x0ca6('0x26')](_0x35f135[_0x0ca6('0x20')]['include'],function(_0x1b4047){return{'model':db[_0x1b4047[_0x0ca6('0x25')]],'as':_0x1b4047['as'],'attributes':_0x1b4047[_0x0ca6('0x23')],'include':_0x1b4047[_0x0ca6('0x24')]?_[_0x0ca6('0x26')](_0x1b4047[_0x0ca6('0x24')],function(_0x422cf8){return{'model':db[_0x422cf8[_0x0ca6('0x25')]],'as':_0x422cf8['as'],'attributes':_0x422cf8[_0x0ca6('0x23')],'include':_0x422cf8[_0x0ca6('0x24')]?_[_0x0ca6('0x26')](_0x422cf8[_0x0ca6('0x24')],function(_0x22c09f){return{'model':db[_0x22c09f[_0x0ca6('0x25')]],'as':_0x22c09f['as'],'attributes':_0x22c09f[_0x0ca6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0ca6('0x14')](function(_0x5a5cd7){logger[_0x0ca6('0x15')](_0x0ca6('0x29'),_0x35f135);logger['debug'](_0x0ca6('0x29'),_0x35f135,JSON[_0x0ca6('0x28')](_0x5a5cd7));_0x24ed1b(_0x5a5cd7);})[_0x0ca6('0x1c')](function(_0xe8b50d){logger[_0x0ca6('0x19')](_0x0ca6('0x29'),_0xe8b50d[_0x0ca6('0x1b')],_0x35f135);_0x25b6a0(_0x525a08[_0x0ca6('0x19')](0x1f4,_0xe8b50d[_0x0ca6('0x1b')]));});});};exports[_0x0ca6('0x2b')]=function(_0x4a6bfc){var _0x1c8f5a=this;return new Promise(function(_0x372270,_0x4c5ece){var _0x296bf8={'body':_0x4a6bfc[_0x0ca6('0x2c')],'channel':_0x0ca6('0x2d')};var _0x25e16e=_['difference'](_[_0x0ca6('0x2e')](db[_0x0ca6('0x2f')][_0x0ca6('0x30')]),[_0x0ca6('0x31'),_0x0ca6('0x32'),_0x0ca6('0x33'),'ListId']);var _0x3e0880=![];if(_0x4a6bfc['body']['id']){delete _0x4a6bfc[_0x0ca6('0x2c')]['id'];}if(_['isNil'](_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x34')])){return _0x4c5ece(_0x1c8f5a[_0x0ca6('0x19')](0x1f4,_0x0ca6('0x35')));}if(_[_0x0ca6('0x36')](_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x2c')])||_0x4a6bfc[_0x0ca6('0x2c')]['body']===''){return _0x4c5ece(_0x1c8f5a[_0x0ca6('0x19')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x37')])){return _0x4c5ece(_0x1c8f5a[_0x0ca6('0x19')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25e16e));}if(!_[_0x0ca6('0x38')](_0x25e16e,_0x4a6bfc[_0x0ca6('0x2c')]['mapKey'])){return _0x4c5ece(_0x1c8f5a[_0x0ca6('0x19')](0x1f4,_0x0ca6('0x39')+_0x25e16e));}var _0x53e5b7={};_0x53e5b7[_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x37')]]=_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x34')];return db[_0x0ca6('0x1e')][_0x0ca6('0x2a')]({'where':{'id':_0x4a6bfc[_0x0ca6('0x3a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0ca6('0x2f')],'as':_0x0ca6('0x3b'),'where':_0x53e5b7,'limit':0x1,'order':[[_0x0ca6('0x32'),_0x0ca6('0x3c')]]}]},{'model':db[_0x0ca6('0x3d')],'as':_0x0ca6('0x3e')},{'model':db['MailServerOut'],'as':_0x0ca6('0x3f')}]})[_0x0ca6('0x14')](function(_0x5d7af8){if(_0x5d7af8&&_0x5d7af8[_0x0ca6('0x40')]){var _0x94e3a2=_0x5d7af8['get']({'plain':!![]});_0x296bf8['account']=_[_0x0ca6('0x41')](_0x94e3a2,[_0x0ca6('0x3e'),_0x0ca6('0x40')]);_0x296bf8[_0x0ca6('0x42')]=_0x94e3a2[_0x0ca6('0x3e')];_0x296bf8['list']=_0x94e3a2[_0x0ca6('0x40')];_0x296bf8['applications']=_[_0x0ca6('0x43')](_0x296bf8[_0x0ca6('0x42')],[_0x0ca6('0x44')],[_0x0ca6('0x45')]);if(_0x296bf8['account']&&_0x296bf8['account'][_0x0ca6('0x46')]){_0x296bf8[_0x0ca6('0x42')][_0x0ca6('0x47')]({'id':0x0,'priority':_0x296bf8[_0x0ca6('0x42')]['length']+0x1,'app':_0x0ca6('0x48'),'appdata':_0x0ca6('0x46'),'interval':_0x0ca6('0x49')});}if(_0x296bf8[_0x0ca6('0x3a')][_0x0ca6('0x3e')]){delete _0x296bf8[_0x0ca6('0x3a')]['Applications'];}if(_0x296bf8['account'][_0x0ca6('0x40')]){delete _0x296bf8[_0x0ca6('0x3a')][_0x0ca6('0x40')];}if(_0x94e3a2['List'][_0x0ca6('0x3b')][_0x0ca6('0x4a')]){return _0x94e3a2[_0x0ca6('0x40')][_0x0ca6('0x3b')][0x0];}var _0x248d07=_[_0x0ca6('0xe')](_0x4a6bfc['body'],{'firstName':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x34')],'ListId':_0x94e3a2['ListId']});_0x248d07[_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x37')]]=_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x34')];return db['CmContact'][_0x0ca6('0x4b')](_0x248d07);}else{throw new Error('List\x20not\x20found');}})[_0x0ca6('0x14')](function(_0x2cdcc6){_0x296bf8[_0x0ca6('0x4c')]=_0x2cdcc6;if(_0x2cdcc6){if(!_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x4d')]){_0x4a6bfc[_0x0ca6('0x2c')]['message'][_0x0ca6('0x4d')]=rs['generate']()+'\x20'+_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x34')];}var _0xdfa851={'ContactId':_0x2cdcc6['id'],'MailAccountId':_0x4a6bfc[_0x0ca6('0x3a')]['id'],'inReplyTo':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x4d')],'to':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x34')],'cc':_0x4a6bfc['body']['message']['cc'],'subject':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x4e')],'attach':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x4f')],'lastMsgAt':moment()[_0x0ca6('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x0ca6('0x51')][_0x0ca6('0x2a')]({'where':{'closed':![],'MailAccountId':_0x4a6bfc['account']['id']},'include':[{'model':db[_0x0ca6('0x52')],'as':_0x0ca6('0x53'),'attributes':[_0x0ca6('0x4d')],'where':{'messageId':_0x4a6bfc['body']['message']['inReplyTo']}}]})[_0x0ca6('0x14')](function(_0x5b74ef){if(_0x5b74ef){return[_0x5b74ef,![]];}return db[_0x0ca6('0x51')][_0x0ca6('0x4b')](_0xdfa851)[_0x0ca6('0x14')](function(_0x3233f7){return[_0x3233f7,!![]];});});}else{throw new Error(_0x0ca6('0x54'));}})[_0x0ca6('0x55')](function(_0x644d21,_0x500c25){if(_0x644d21){_0x3e0880=_0x500c25;if(!_0x500c25){return _0x644d21['update']({'inReplyTo':_0x4a6bfc[_0x0ca6('0x2c')]['message'][_0x0ca6('0x4d')],'to':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')]['from'],'cc':_0x4a6bfc[_0x0ca6('0x2c')]['message']['cc'],'subject':_0x4a6bfc[_0x0ca6('0x2c')]['message'][_0x0ca6('0x4e')],'attach':_0x644d21[_0x0ca6('0x4f')]?_0x644d21[_0x0ca6('0x4f')]:_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')]['attach'],'substatus':null,'substatusAt':moment()[_0x0ca6('0x50')](_0x0ca6('0x56')),'lastMsgAt':moment()[_0x0ca6('0x50')](_0x0ca6('0x56')),'lastMsgDirection':'in'});}else{return _0x644d21;}}})[_0x0ca6('0x14')](function(_0x38fbde){_0x296bf8[_0x0ca6('0x57')]=_0x38fbde[_0x0ca6('0x58')]({'plain':!![]});_0x296bf8[_0x0ca6('0x57')][_0x0ca6('0x59')]=_0x3e0880;return db[_0x0ca6('0x52')]['create']({'body':_0x4a6bfc['body']['body'],'MailAccountId':_0x4a6bfc[_0x0ca6('0x3a')]['id'],'MailInteractionId':_0x38fbde['id'],'direction':'in','ContactId':_0x296bf8[_0x0ca6('0x4c')]['id'],'messageId':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x4d')],'from':_0x4a6bfc['body'][_0x0ca6('0x1b')][_0x0ca6('0x34')],'to':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')]['to'],'cc':_0x4a6bfc['body'][_0x0ca6('0x1b')]['cc'],'subject':_0x4a6bfc['body'][_0x0ca6('0x1b')]['subject'],'attach':_0x4a6bfc['body'][_0x0ca6('0x1b')][_0x0ca6('0x4f')],'Attachments':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')]['attachments'],'originTo':_0x4a6bfc['body']['message'][_0x0ca6('0x5a')],'originCc':_0x4a6bfc[_0x0ca6('0x2c')]['message'][_0x0ca6('0x5b')],'bcc':_0x4a6bfc['body'][_0x0ca6('0x1b')][_0x0ca6('0x5c')],'ChatWebsiteId':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')]['ChatWebsiteId']||null,'originChannel':_0x4a6bfc[_0x0ca6('0x2c')][_0x0ca6('0x1b')][_0x0ca6('0x5d')]||_0x0ca6('0x5e'),'ChatOfflineMessageId':_0x4a6bfc['body'][_0x0ca6('0x1b')][_0x0ca6('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0x0ca6('0x60')}]});})[_0x0ca6('0x14')](function(_0x4fa223){_0x296bf8[_0x0ca6('0x1b')]=_0x4fa223;if(_0x296bf8[_0x0ca6('0x57')][_0x0ca6('0x61')]){return db['User'][_0x0ca6('0x2a')]({'attributes':['id','name'],'where':{'id':_0x296bf8[_0x0ca6('0x57')][_0x0ca6('0x61')]}})[_0x0ca6('0x14')](function(_0x275c21){if(_0x275c21){_0x296bf8[_0x0ca6('0x42')][_0x0ca6('0x62')]({'id':0x0,'priority':0x0,'app':_0x0ca6('0x63'),'appdata':_0x275c21['name']+','+(_0x296bf8['account'][_0x0ca6('0x64')]||0xa),'interval':_0x0ca6('0x49')});}return respondWithRpcPromise('Start',_0x0ca6('0x65'),_0x296bf8);});}return respondWithRpcPromise(_0x0ca6('0x66'),_0x0ca6('0x65'),_0x296bf8);})[_0x0ca6('0x14')](function(_0x4110b5){_0x372270(_0x4110b5);})[_0x0ca6('0x1c')](function(_0x3428c8){_0x4c5ece(_0x1c8f5a[_0x0ca6('0x19')](0x1f4,_0x3428c8[_0x0ca6('0x1b')]));});});}; \ No newline at end of file +var _0xf555=['spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','MailMessage','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','options','raw','where','attributes','include','map','model','catch','ShowMailAccount','debug','NotifyMailAccount','mail','keys','createdAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','find','CmList','List','CmContact','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','account','omit','applications','list','priority','asc','autoclose','length','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found'];(function(_0x144911,_0x220397){var _0x14d21a=function(_0x3042ef){while(--_0x3042ef){_0x144911['push'](_0x144911['shift']());}};_0x14d21a(++_0x220397);}(_0xf555,0xf4));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f55('0x0'));var util=require(_0x5f55('0x1'));var moment=require(_0x5f55('0x2'));var BPromise=require(_0x5f55('0x3'));var rs=require(_0x5f55('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f55('0x5'));var logger=require(_0x5f55('0x6'))(_0x5f55('0x7'));var config=require(_0x5f55('0x8'));var jayson=require(_0x5f55('0x9'));var client=jayson[_0x5f55('0xa')][_0x5f55('0xb')]({'port':0x232c});config[_0x5f55('0xc')]=_[_0x5f55('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5f55('0xe'))(new Redis(config[_0x5f55('0xc')]));require(_0x5f55('0xf'))[_0x5f55('0x10')](socket);function respondWithRpcPromise(_0x322576,_0x551f98,_0x266290){return new BPromise(function(_0x9d51f,_0x581f7b){return client[_0x5f55('0x11')](_0x322576,_0x266290)[_0x5f55('0x12')](function(_0x40f5b6){logger[_0x5f55('0x13')]('MailAccount,\x20%s,\x20%s',_0x551f98,_0x5f55('0x14'));logger['debug'](_0x5f55('0x15'),_0x551f98,_0x5f55('0x14'),JSON[_0x5f55('0x16')](_0x40f5b6));if(_0x40f5b6[_0x5f55('0x17')]){if(_0x40f5b6[_0x5f55('0x17')][_0x5f55('0x18')]===0x1f4){logger[_0x5f55('0x17')](_0x5f55('0x19'),_0x551f98,_0x40f5b6[_0x5f55('0x17')][_0x5f55('0x1a')]);return _0x581f7b(_0x40f5b6[_0x5f55('0x17')][_0x5f55('0x1a')]);}logger[_0x5f55('0x17')](_0x5f55('0x19'),_0x551f98,_0x40f5b6[_0x5f55('0x17')][_0x5f55('0x1a')]);return _0x9d51f(_0x40f5b6['error']['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x551f98,_0x5f55('0x14'));_0x9d51f(_0x40f5b6[_0x5f55('0x1b')]['message']);}})['catch'](function(_0x1a161f){logger['error'](_0x5f55('0x19'),_0x551f98,_0x1a161f);_0x581f7b(_0x1a161f);});});}exports[_0x5f55('0x1c')]=function(_0x40a248){var _0xe5a974=this;return new Promise(function(_0x5eef58,_0x6425e4){return db['MailAccount']['findAll']({'raw':_0x40a248[_0x5f55('0x1d')]?_0x40a248[_0x5f55('0x1d')][_0x5f55('0x1e')]===undefined?!![]:![]:!![],'where':_0x40a248['options']?_0x40a248[_0x5f55('0x1d')][_0x5f55('0x1f')]||null:null,'attributes':_0x40a248[_0x5f55('0x1d')]?_0x40a248['options'][_0x5f55('0x20')]||null:null,'limit':_0x40a248['options']?_0x40a248['options']['limit']||null:null,'include':_0x40a248['options']?_0x40a248['options'][_0x5f55('0x21')]?_[_0x5f55('0x22')](_0x40a248[_0x5f55('0x1d')]['include'],function(_0x4959da){return{'model':db[_0x4959da['model']],'as':_0x4959da['as'],'attributes':_0x4959da[_0x5f55('0x20')],'include':_0x4959da[_0x5f55('0x21')]?_[_0x5f55('0x22')](_0x4959da[_0x5f55('0x21')],function(_0x5c4089){return{'model':db[_0x5c4089[_0x5f55('0x23')]],'as':_0x5c4089['as'],'attributes':_0x5c4089[_0x5f55('0x20')],'include':_0x5c4089[_0x5f55('0x21')]?_[_0x5f55('0x22')](_0x5c4089[_0x5f55('0x21')],function(_0x4356ea){return{'model':db[_0x4356ea[_0x5f55('0x23')]],'as':_0x4356ea['as'],'attributes':_0x4356ea[_0x5f55('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ccb6a){logger['info']('GetMailAccount',_0x40a248);logger['debug']('GetMailAccount',_0x40a248,JSON[_0x5f55('0x16')](_0x3ccb6a));_0x5eef58(_0x3ccb6a);})[_0x5f55('0x24')](function(_0x62738f){logger[_0x5f55('0x17')]('GetMailAccount',_0x62738f[_0x5f55('0x1a')],_0x40a248);_0x6425e4(_0xe5a974[_0x5f55('0x17')](0x1f4,_0x62738f['message']));});});};exports[_0x5f55('0x25')]=function(_0x1e60e5){var _0x3082ba=this;return new Promise(function(_0x1604de,_0x3065ce){return db['MailAccount']['find']({'raw':_0x1e60e5[_0x5f55('0x1d')]?_0x1e60e5[_0x5f55('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1e60e5[_0x5f55('0x1d')]?_0x1e60e5['options'][_0x5f55('0x1f')]||null:null,'attributes':_0x1e60e5['options']?_0x1e60e5['options'][_0x5f55('0x20')]||null:null,'include':_0x1e60e5[_0x5f55('0x1d')]?_0x1e60e5[_0x5f55('0x1d')][_0x5f55('0x21')]?_[_0x5f55('0x22')](_0x1e60e5['options'][_0x5f55('0x21')],function(_0x225876){return{'model':db[_0x225876[_0x5f55('0x23')]],'as':_0x225876['as'],'attributes':_0x225876['attributes'],'include':_0x225876[_0x5f55('0x21')]?_['map'](_0x225876[_0x5f55('0x21')],function(_0x3fc847){return{'model':db[_0x3fc847[_0x5f55('0x23')]],'as':_0x3fc847['as'],'attributes':_0x3fc847[_0x5f55('0x20')],'include':_0x3fc847[_0x5f55('0x21')]?_[_0x5f55('0x22')](_0x3fc847[_0x5f55('0x21')],function(_0x2ad494){return{'model':db[_0x2ad494[_0x5f55('0x23')]],'as':_0x2ad494['as'],'attributes':_0x2ad494[_0x5f55('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c3921){logger[_0x5f55('0x13')]('ShowMailAccount',_0x1e60e5);logger[_0x5f55('0x26')](_0x5f55('0x25'),_0x1e60e5,JSON['stringify'](_0x5c3921));_0x1604de(_0x5c3921);})[_0x5f55('0x24')](function(_0x41477a){logger[_0x5f55('0x17')](_0x5f55('0x25'),_0x41477a[_0x5f55('0x1a')],_0x1e60e5);_0x3065ce(_0x3082ba[_0x5f55('0x17')](0x1f4,_0x41477a['message']));});});};exports[_0x5f55('0x27')]=function(_0x202e77){var _0x4dff72=this;return new Promise(function(_0x133f01,_0xa60781){var _0x13b854={'body':_0x202e77['body'],'channel':_0x5f55('0x28')};var _0x533ecd=_['difference'](_[_0x5f55('0x29')](db['CmContact']['rawAttributes']),[_0x5f55('0x2a'),'updatedAt',_0x5f55('0x2b'),_0x5f55('0x2c')]);var _0x29ca5c=![];if(_0x202e77[_0x5f55('0x2d')]['id']){delete _0x202e77[_0x5f55('0x2d')]['id'];}if(_[_0x5f55('0x2e')](_0x202e77[_0x5f55('0x2d')][_0x5f55('0x2f')])){return _0xa60781(_0x4dff72[_0x5f55('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x202e77[_0x5f55('0x2d')][_0x5f55('0x2d')])||_0x202e77[_0x5f55('0x2d')]['body']===''){return _0xa60781(_0x4dff72['error'](0x1f4,_0x5f55('0x30')));}if(_['isNil'](_0x202e77[_0x5f55('0x2d')][_0x5f55('0x31')])){return _0xa60781(_0x4dff72[_0x5f55('0x17')](0x1f4,_0x5f55('0x32')+_0x533ecd));}if(!_['includes'](_0x533ecd,_0x202e77[_0x5f55('0x2d')]['mapKey'])){return _0xa60781(_0x4dff72[_0x5f55('0x17')](0x1f4,_0x5f55('0x33')+_0x533ecd));}var _0x5ad6ed={};_0x5ad6ed[_0x202e77[_0x5f55('0x2d')][_0x5f55('0x31')]]=_0x202e77[_0x5f55('0x2d')][_0x5f55('0x2f')];return db[_0x5f55('0x34')][_0x5f55('0x35')]({'where':{'id':_0x202e77['account']['id']},'include':[{'model':db[_0x5f55('0x36')],'as':_0x5f55('0x37'),'include':[{'model':db[_0x5f55('0x38')],'as':_0x5f55('0x39'),'where':_0x5ad6ed,'limit':0x1,'order':[[_0x5f55('0x3a'),_0x5f55('0x3b')]]}]},{'model':db['MailApplication'],'as':_0x5f55('0x3c')},{'model':db[_0x5f55('0x3d')],'as':_0x5f55('0x3e')}]})[_0x5f55('0x12')](function(_0x3efcfd){if(_0x3efcfd&&_0x3efcfd[_0x5f55('0x37')]){var _0x56c05d=_0x3efcfd['get']({'plain':!![]});_0x13b854[_0x5f55('0x3f')]=_[_0x5f55('0x40')](_0x56c05d,[_0x5f55('0x3c'),_0x5f55('0x37')]);_0x13b854[_0x5f55('0x41')]=_0x56c05d[_0x5f55('0x3c')];_0x13b854[_0x5f55('0x42')]=_0x56c05d['List'];_0x13b854[_0x5f55('0x41')]=_['orderBy'](_0x13b854[_0x5f55('0x41')],[_0x5f55('0x43')],[_0x5f55('0x44')]);if(_0x13b854['account']&&_0x13b854[_0x5f55('0x3f')][_0x5f55('0x45')]){_0x13b854[_0x5f55('0x41')]['push']({'id':0x0,'priority':_0x13b854[_0x5f55('0x41')][_0x5f55('0x46')]+0x1,'app':'close','appdata':_0x5f55('0x45'),'interval':'*,*,*,*'});}if(_0x13b854[_0x5f55('0x3f')][_0x5f55('0x3c')]){delete _0x13b854[_0x5f55('0x3f')][_0x5f55('0x3c')];}if(_0x13b854[_0x5f55('0x3f')][_0x5f55('0x37')]){delete _0x13b854[_0x5f55('0x3f')][_0x5f55('0x37')];}if(_0x56c05d['List'][_0x5f55('0x39')]['length']){return _0x56c05d['List']['Contacts'][0x0];}var _0x13b796=_['defaults'](_0x202e77[_0x5f55('0x2d')],{'firstName':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x2f')],'ListId':_0x56c05d['ListId']});_0x13b796[_0x202e77[_0x5f55('0x2d')][_0x5f55('0x31')]]=_0x202e77[_0x5f55('0x2d')][_0x5f55('0x2f')];return db[_0x5f55('0x38')][_0x5f55('0x47')](_0x13b796);}else{throw new Error(_0x5f55('0x48'));}})[_0x5f55('0x12')](function(_0x15f7ea){_0x13b854[_0x5f55('0x49')]=_0x15f7ea;if(_0x15f7ea){if(!_0x202e77['body'][_0x5f55('0x1a')][_0x5f55('0x4a')]){_0x202e77[_0x5f55('0x2d')]['message'][_0x5f55('0x4a')]=rs[_0x5f55('0x4b')]()+'\x20'+_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x2f')];}var _0x5e6968={'ContactId':_0x15f7ea['id'],'MailAccountId':_0x202e77['account']['id'],'inReplyTo':_0x202e77[_0x5f55('0x2d')]['message'][_0x5f55('0x4a')],'to':_0x202e77['body'][_0x5f55('0x1a')]['from'],'cc':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')]['cc'],'subject':_0x202e77[_0x5f55('0x2d')]['message'][_0x5f55('0x4c')],'attach':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x4d')],'lastMsgAt':moment()[_0x5f55('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x5f55('0x35')]({'where':{'closed':![],'MailAccountId':_0x202e77[_0x5f55('0x3f')]['id']},'include':[{'model':db['MailMessage'],'as':_0x5f55('0x4f'),'attributes':[_0x5f55('0x4a')],'where':{'messageId':_0x202e77['body']['message'][_0x5f55('0x50')]}}]})[_0x5f55('0x12')](function(_0x12dff0){if(_0x12dff0){return[_0x12dff0,![]];}return db[_0x5f55('0x51')][_0x5f55('0x47')](_0x5e6968)[_0x5f55('0x12')](function(_0xe1eed5){return[_0xe1eed5,!![]];});});}else{throw new Error(_0x5f55('0x52'));}})[_0x5f55('0x53')](function(_0x21c593,_0x30c2b8){if(_0x21c593){_0x29ca5c=_0x30c2b8;if(!_0x30c2b8){return _0x21c593[_0x5f55('0x54')]({'inReplyTo':_0x202e77['body'][_0x5f55('0x1a')]['messageId'],'to':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')]['from'],'cc':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')]['cc'],'subject':_0x202e77['body'][_0x5f55('0x1a')][_0x5f55('0x4c')],'attach':_0x21c593[_0x5f55('0x4d')]?_0x21c593[_0x5f55('0x4d')]:_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x5f55('0x4e')](_0x5f55('0x55')),'lastMsgAt':moment()['format'](_0x5f55('0x55')),'lastMsgDirection':'in'});}else{return _0x21c593;}}})[_0x5f55('0x12')](function(_0x40ce2c){_0x13b854[_0x5f55('0x56')]=_0x40ce2c[_0x5f55('0x57')]({'plain':!![]});_0x13b854[_0x5f55('0x56')][_0x5f55('0x58')]=_0x29ca5c;return db[_0x5f55('0x59')][_0x5f55('0x47')]({'body':_0x202e77[_0x5f55('0x2d')]['body'],'MailAccountId':_0x202e77[_0x5f55('0x3f')]['id'],'MailInteractionId':_0x40ce2c['id'],'direction':'in','ContactId':_0x13b854['contact']['id'],'messageId':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x4a')],'from':_0x202e77['body'][_0x5f55('0x1a')][_0x5f55('0x2f')],'to':_0x202e77[_0x5f55('0x2d')]['message']['to'],'cc':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')]['cc'],'subject':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x4c')],'attach':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x4d')],'Attachments':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x5a')],'originTo':_0x202e77['body'][_0x5f55('0x1a')][_0x5f55('0x5b')],'originCc':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x5c')],'bcc':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x5d')],'ChatWebsiteId':_0x202e77['body'][_0x5f55('0x1a')][_0x5f55('0x5e')]||null,'originChannel':_0x202e77[_0x5f55('0x2d')]['message'][_0x5f55('0x5f')]||_0x5f55('0x60'),'ChatOfflineMessageId':_0x202e77[_0x5f55('0x2d')][_0x5f55('0x1a')][_0x5f55('0x61')]||null},{'include':[{'model':db[_0x5f55('0x62')],'as':_0x5f55('0x63')}]});})[_0x5f55('0x12')](function(_0x58969b){_0x13b854[_0x5f55('0x1a')]=_0x58969b;if(_0x13b854[_0x5f55('0x56')][_0x5f55('0x64')]){return db[_0x5f55('0x65')][_0x5f55('0x35')]({'attributes':['id',_0x5f55('0x66')],'where':{'id':_0x13b854['interaction'][_0x5f55('0x64')]}})[_0x5f55('0x12')](function(_0x1ea0f5){if(_0x1ea0f5){_0x13b854[_0x5f55('0x41')][_0x5f55('0x67')]({'id':0x0,'priority':0x0,'app':_0x5f55('0x68'),'appdata':_0x1ea0f5[_0x5f55('0x66')]+','+(_0x13b854[_0x5f55('0x3f')][_0x5f55('0x69')]||0xa),'interval':_0x5f55('0x6a')});}return respondWithRpcPromise(_0x5f55('0x6b'),_0x5f55('0x6c'),_0x13b854);});}return respondWithRpcPromise('Start',_0x5f55('0x6c'),_0x13b854);})[_0x5f55('0x12')](function(_0x1bec72){_0x133f01(_0x1bec72);})[_0x5f55('0x24')](function(_0x3f312a){_0xa60781(_0x4dff72[_0x5f55('0x17')](0x1f4,_0x3f312a[_0x5f55('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f2532d9..0a703d6 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 _0xf100=['mailAccount:','./mailAccount.events','save','remove','update','emit','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf100,0x119));var _0x0f10=function(_0x2241c6,_0x1290ae){_0x2241c6=_0x2241c6-0x0;var _0x2d0e44=_0xf100[_0x2241c6];return _0x2d0e44;};'use strict';var MailAccountEvents=require(_0x0f10('0x0'));var events=[_0x0f10('0x1'),_0x0f10('0x2'),_0x0f10('0x3')];function createListener(_0x594466,_0x24ceae){return function(_0x5af9b0){_0x24ceae[_0x0f10('0x4')](_0x594466,_0x5af9b0);};}function removeListener(_0x3c2ef8,_0x430b38){return function(){MailAccountEvents['removeListener'](_0x3c2ef8,_0x430b38);};}exports[_0x0f10('0x5')]=function(_0x1f6361){for(var _0x17f8c5=0x0,_0x47f77d=events[_0x0f10('0x6')];_0x17f8c5<_0x47f77d;_0x17f8c5++){var _0xcd555c=events[_0x17f8c5];var _0x43b03d=createListener(_0x0f10('0x7')+_0xcd555c,_0x1f6361);MailAccountEvents['on'](_0xcd555c,_0x43b03d);}}; \ No newline at end of file +var _0x5879=['register','mailAccount:','./mailAccount.events','save','remove','update','removeListener'];(function(_0x1b6f03,_0xac9a3c){var _0x3e2144=function(_0xabb1d){while(--_0xabb1d){_0x1b6f03['push'](_0x1b6f03['shift']());}};_0x3e2144(++_0xac9a3c);}(_0x5879,0xdb));var _0x9587=function(_0x427895,_0x24cb7c){_0x427895=_0x427895-0x0;var _0x59d714=_0x5879[_0x427895];return _0x59d714;};'use strict';var MailAccountEvents=require(_0x9587('0x0'));var events=[_0x9587('0x1'),_0x9587('0x2'),_0x9587('0x3')];function createListener(_0x2bb439,_0xb3fbfe){return function(_0x463363){_0xb3fbfe['emit'](_0x2bb439,_0x463363);};}function removeListener(_0x63f5e8,_0x5b5c55){return function(){MailAccountEvents[_0x9587('0x4')](_0x63f5e8,_0x5b5c55);};}exports[_0x9587('0x5')]=function(_0x387eed){for(var _0x1f922f=0x0,_0x4430c5=events['length'];_0x1f922f<_0x4430c5;_0x1f922f++){var _0xc5892d=events[_0x1f922f];var _0xa2bcbe=createListener(_0x9587('0x6')+_0xc5892d,_0x387eed);MailAccountEvents['on'](_0xc5892d,_0xa2bcbe);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 73a05f8..da2ef2e 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 _0x8f8b=['../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x8f8b,0x108));var _0xb8f8=function(_0x1e4d85,_0x37cbe1){_0x1e4d85=_0x1e4d85-0x0;var _0x75e229=_0x8f8b[_0x1e4d85];return _0x75e229;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb8f8('0x0'));var timeout=require(_0xb8f8('0x1'));var express=require(_0xb8f8('0x2'));var router=express['Router']();var fs_extra=require(_0xb8f8('0x3'));var auth=require(_0xb8f8('0x4'));var interaction=require(_0xb8f8('0x5'));var config=require(_0xb8f8('0x6'));var controller=require('./mailApplication.controller');router[_0xb8f8('0x7')](_0xb8f8('0x8'),auth[_0xb8f8('0x9')](),controller[_0xb8f8('0xa')]);router[_0xb8f8('0xb')]('/:id',auth[_0xb8f8('0x9')](),controller[_0xb8f8('0xc')]);router[_0xb8f8('0xd')](_0xb8f8('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xb8f8('0xe')]=router; \ No newline at end of file +var _0xebb5=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id','update','delete','destroy','util','path','connect-timeout'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xebb5,0xc0));var _0x5ebb=function(_0x42f42e,_0xac6141){_0x42f42e=_0x42f42e-0x0;var _0x88e725=_0xebb5[_0x42f42e];return _0x88e725;};'use strict';var multer=require('multer');var util=require(_0x5ebb('0x0'));var path=require(_0x5ebb('0x1'));var timeout=require(_0x5ebb('0x2'));var express=require(_0x5ebb('0x3'));var router=express[_0x5ebb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ebb('0x5'));var interaction=require(_0x5ebb('0x6'));var config=require(_0x5ebb('0x7'));var controller=require('./mailApplication.controller');router[_0x5ebb('0x8')]('/:id',auth[_0x5ebb('0x9')](),controller[_0x5ebb('0xa')]);router['put'](_0x5ebb('0xb'),auth[_0x5ebb('0x9')](),controller[_0x5ebb('0xc')]);router[_0x5ebb('0xd')](_0x5ebb('0xb'),auth[_0x5ebb('0x9')](),controller[_0x5ebb('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ce2ff74..49edd7d 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 _0x7628=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7628,0x18f));var _0x8762=function(_0x4b4dbd,_0x2ba28a){_0x4b4dbd=_0x4b4dbd-0x0;var _0x591334=_0x7628[_0x4b4dbd];return _0x591334;};'use strict';var Sequelize=require(_0x8762('0x0'));module[_0x8762('0x1')]={'priority':{'type':Sequelize[_0x8762('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8762('0x3')},'appdata':{'type':Sequelize[_0x8762('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8762('0x5')],'defaultValue':_0x8762('0x6')}}; \ No newline at end of file +var _0x8599=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x8599,0x16d));var _0x9859=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8599[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x9859('0x0'));module[_0x9859('0x1')]={'priority':{'type':Sequelize[_0x9859('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9859('0x3')},'appdata':{'type':Sequelize[_0x9859('0x4')]()},'description':{'type':Sequelize[_0x9859('0x5')]},'interval':{'type':Sequelize[_0x9859('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 2d868c7..efe9faa 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 _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x5d0792,_0x486759){var _0x2885a6=function(_0x5da30c){while(--_0x5da30c){_0x5d0792['push'](_0x5d0792['shift']());}};_0x2885a6(++_0x486759);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x3ca8c5,_0x31b80c){var _0x2c5c75=function(_0x2ec689){while(--_0x2ec689){_0x3ca8c5['push'](_0x3ca8c5['shift']());}};_0x2c5c75(++_0x31b80c);}(_0xac4a,0x13f));var _0xaac4=function(_0x4ab71d,_0x481a69){_0x4ab71d=_0x4ab71d-0x0;var _0x37195e=_0xac4a[_0x4ab71d];return _0x37195e;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 48a4387..03e7d1d 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 _0x0666=['request-promise','path','rimraf','./mailApplication.attributes','exports','mail_applications','utf8mb4','lodash','util','../../config/logger','bluebird'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x0666,0x96));var _0x6066=function(_0x202a76,_0x52775d){_0x202a76=_0x202a76-0x0;var _0xa6433b=_0x0666[_0x202a76];return _0xa6433b;};'use strict';var _=require(_0x6066('0x0'));var util=require(_0x6066('0x1'));var logger=require(_0x6066('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6066('0x3'));var rp=require(_0x6066('0x4'));var fs=require('fs');var path=require(_0x6066('0x5'));var rimraf=require(_0x6066('0x6'));var config=require('../../config/environment');var attributes=require(_0x6066('0x7'));module[_0x6066('0x8')]=function(_0x4ef10c,_0x4f1adb){return _0x4ef10c['define']('MailApplication',attributes,{'tableName':_0x6066('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6066('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x948a=['MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x948a,0xf4));var _0xa948=function(_0x59bdce,_0x494721){_0x59bdce=_0x59bdce-0x0;var _0x5e0444=_0x948a[_0x59bdce];return _0x5e0444;};'use strict';var _=require(_0xa948('0x0'));var util=require(_0xa948('0x1'));var logger=require(_0xa948('0x2'))(_0xa948('0x3'));var moment=require(_0xa948('0x4'));var BPromise=require(_0xa948('0x5'));var rp=require(_0xa948('0x6'));var fs=require('fs');var path=require(_0xa948('0x7'));var rimraf=require(_0xa948('0x8'));var config=require(_0xa948('0x9'));var attributes=require('./mailApplication.attributes');module[_0xa948('0xa')]=function(_0x4e7980,_0x519e60){return _0x4e7980[_0xa948('0xb')](_0xa948('0xc'),attributes,{'tableName':_0xa948('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa948('0xe'),'collate':_0xa948('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c3cd807..f1aa4ef 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 _0x7cfd=['raw','where','attributes','limit','stringify','lodash','util','ioredis','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','debug','error','code','MailApplication,\x20%s,\x20%s','message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0x7cfd,0x164));var _0xd7cf=function(_0x31edd7,_0x3c0b1d){_0x31edd7=_0x31edd7-0x0;var _0x75056a=_0x7cfd[_0x31edd7];return _0x75056a;};'use strict';var _=require(_0xd7cf('0x0'));var util=require(_0xd7cf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7cf('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd7cf('0x3'))(_0xd7cf('0x4'));var config=require('../../config/environment');var jayson=require(_0xd7cf('0x5'));var client=jayson[_0xd7cf('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48f632,_0x105b66,_0x65ef97){return new BPromise(function(_0x5c07e9,_0xe95132){return client['request'](_0x48f632,_0x65ef97)[_0xd7cf('0x7')](function(_0x5257f1){logger['info']('MailApplication,\x20%s,\x20%s',_0x105b66,_0xd7cf('0x8'));logger[_0xd7cf('0x9')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x105b66,_0xd7cf('0x8'),JSON['stringify'](_0x5257f1));if(_0x5257f1['error']){if(_0x5257f1[_0xd7cf('0xa')][_0xd7cf('0xb')]===0x1f4){logger['error'](_0xd7cf('0xc'),_0x105b66,_0x5257f1[_0xd7cf('0xa')][_0xd7cf('0xd')]);return _0xe95132(_0x5257f1[_0xd7cf('0xa')][_0xd7cf('0xd')]);}logger[_0xd7cf('0xa')](_0xd7cf('0xc'),_0x105b66,_0x5257f1[_0xd7cf('0xa')][_0xd7cf('0xd')]);return _0x5c07e9(_0x5257f1[_0xd7cf('0xa')][_0xd7cf('0xd')]);}else{logger[_0xd7cf('0xe')](_0xd7cf('0xc'),_0x105b66,_0xd7cf('0x8'));_0x5c07e9(_0x5257f1[_0xd7cf('0xf')]['message']);}})[_0xd7cf('0x10')](function(_0x20ea08){logger['error'](_0xd7cf('0xc'),_0x105b66,_0x20ea08);_0xe95132(_0x20ea08);});});}exports[_0xd7cf('0x11')]=function(_0x4e4284){var _0x575e30=this;return new Promise(function(_0x33434a,_0x42410f){return db[_0xd7cf('0x12')][_0xd7cf('0x13')](_0x4e4284[_0xd7cf('0x14')],{'raw':_0x4e4284[_0xd7cf('0x15')]?_0x4e4284[_0xd7cf('0x15')][_0xd7cf('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e4284[_0xd7cf('0x15')]?_0x4e4284[_0xd7cf('0x15')][_0xd7cf('0x17')]||null:null,'attributes':_0x4e4284['options']?_0x4e4284[_0xd7cf('0x15')][_0xd7cf('0x18')]||null:null,'limit':_0x4e4284[_0xd7cf('0x15')]?_0x4e4284[_0xd7cf('0x15')][_0xd7cf('0x19')]||null:null})[_0xd7cf('0x7')](function(_0x384daa){logger[_0xd7cf('0xe')](_0xd7cf('0x11'),_0x4e4284);logger[_0xd7cf('0x9')](_0xd7cf('0x11'),_0x4e4284,JSON[_0xd7cf('0x1a')](_0x384daa));_0x33434a(_0x384daa);})[_0xd7cf('0x10')](function(_0x5454a4){logger[_0xd7cf('0xa')](_0xd7cf('0x11'),_0x5454a4['message'],_0x4e4284);_0x42410f(_0x575e30[_0xd7cf('0xa')](0x1f4,_0x5454a4['message']));});});}; \ No newline at end of file +var _0xbd7b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailApplication','update','options','raw','attributes','then','UpdateMailApplication','catch','util'];(function(_0x1163c3,_0x3aedc6){var _0x7a7cb5=function(_0x2e4054){while(--_0x2e4054){_0x1163c3['push'](_0x1163c3['shift']());}};_0x7a7cb5(++_0x3aedc6);}(_0xbd7b,0x1ec));var _0xbbd7=function(_0x188128,_0xc8a300){_0x188128=_0x188128-0x0;var _0x367d22=_0xbd7b[_0x188128];return _0x367d22;};'use strict';var _=require('lodash');var util=require(_0xbbd7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbd7('0x1'));var fs=require('fs');var Redis=require(_0xbbd7('0x2'));var db=require(_0xbbd7('0x3'))['db'];var utils=require(_0xbbd7('0x4'));var logger=require(_0xbbd7('0x5'))(_0xbbd7('0x6'));var config=require('../../config/environment');var jayson=require(_0xbbd7('0x7'));var client=jayson[_0xbbd7('0x8')][_0xbbd7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41d1f3,_0xd52a6d,_0x13a6f6){return new BPromise(function(_0x2846e4,_0x2ffaaf){return client[_0xbbd7('0xa')](_0x41d1f3,_0x13a6f6)['then'](function(_0x313998){logger[_0xbbd7('0xb')](_0xbbd7('0xc'),_0xd52a6d,_0xbbd7('0xd'));logger[_0xbbd7('0xe')](_0xbbd7('0xf'),_0xd52a6d,_0xbbd7('0xd'),JSON[_0xbbd7('0x10')](_0x313998));if(_0x313998['error']){if(_0x313998[_0xbbd7('0x11')][_0xbbd7('0x12')]===0x1f4){logger[_0xbbd7('0x11')](_0xbbd7('0xc'),_0xd52a6d,_0x313998[_0xbbd7('0x11')][_0xbbd7('0x13')]);return _0x2ffaaf(_0x313998[_0xbbd7('0x11')][_0xbbd7('0x13')]);}logger[_0xbbd7('0x11')]('MailApplication,\x20%s,\x20%s',_0xd52a6d,_0x313998[_0xbbd7('0x11')][_0xbbd7('0x13')]);return _0x2846e4(_0x313998[_0xbbd7('0x11')]['message']);}else{logger['info'](_0xbbd7('0xc'),_0xd52a6d,_0xbbd7('0xd'));_0x2846e4(_0x313998[_0xbbd7('0x14')][_0xbbd7('0x13')]);}})['catch'](function(_0x132b73){logger['error'](_0xbbd7('0xc'),_0xd52a6d,_0x132b73);_0x2ffaaf(_0x132b73);});});}exports['UpdateMailApplication']=function(_0x203a0c){var _0x242293=this;return new Promise(function(_0xf4e511,_0x39d202){return db[_0xbbd7('0x15')][_0xbbd7('0x16')](_0x203a0c['body'],{'raw':_0x203a0c['options']?_0x203a0c[_0xbbd7('0x17')][_0xbbd7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x203a0c[_0xbbd7('0x17')]?_0x203a0c[_0xbbd7('0x17')]['where']||null:null,'attributes':_0x203a0c[_0xbbd7('0x17')]?_0x203a0c[_0xbbd7('0x17')][_0xbbd7('0x19')]||null:null,'limit':_0x203a0c[_0xbbd7('0x17')]?_0x203a0c[_0xbbd7('0x17')]['limit']||null:null})[_0xbbd7('0x1a')](function(_0x1f954d){logger[_0xbbd7('0xb')](_0xbbd7('0x1b'),_0x203a0c);logger[_0xbbd7('0xe')]('UpdateMailApplication',_0x203a0c,JSON[_0xbbd7('0x10')](_0x1f954d));_0xf4e511(_0x1f954d);})[_0xbbd7('0x1c')](function(_0x529e24){logger[_0xbbd7('0x11')](_0xbbd7('0x1b'),_0x529e24[_0xbbd7('0x13')],_0x203a0c);_0x39d202(_0x242293[_0xbbd7('0x11')](0x1f4,_0x529e24['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index e39d7f0..ea833df 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 _0xbf42=['/:id/tags','mailinteraction:addtags','addTags','tracked','mail','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post'];(function(_0x2cae4d,_0xfa29c){var _0x49ab43=function(_0x25067e){while(--_0x25067e){_0x2cae4d['push'](_0x2cae4d['shift']());}};_0x49ab43(++_0xfa29c);}(_0xbf42,0x112));var _0x2bf4=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xbf42[_0x511bd1];return _0x4c48ec;};'use strict';var express=require(_0x2bf4('0x0'));var router=express[_0x2bf4('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x2bf4('0x2'));router['get']('/',auth[_0x2bf4('0x3')](),controller[_0x2bf4('0x4')]);router[_0x2bf4('0x5')](_0x2bf4('0x6'),auth[_0x2bf4('0x3')](),controller[_0x2bf4('0x7')]);router[_0x2bf4('0x5')](_0x2bf4('0x8'),auth['isAuthenticated'](),controller[_0x2bf4('0x9')]);router['get'](_0x2bf4('0xa'),auth[_0x2bf4('0x3')](),controller[_0x2bf4('0xb')]);router['get'](_0x2bf4('0xc'),auth[_0x2bf4('0x3')](),controller['download']);router[_0x2bf4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2bf4('0xa'),auth[_0x2bf4('0x3')](),controller['addMessage']);router[_0x2bf4('0xd')](_0x2bf4('0xe'),auth[_0x2bf4('0x3')](),interaction['tracked']('mail',_0x2bf4('0xf')),controller[_0x2bf4('0x10')]);router['put'](_0x2bf4('0x8'),auth[_0x2bf4('0x3')](),interaction[_0x2bf4('0x11')](_0x2bf4('0x12'),'mailinteraction:update'),controller[_0x2bf4('0x13')]);router['delete']('/:id',auth[_0x2bf4('0x3')](),interaction[_0x2bf4('0x11')](_0x2bf4('0x12'),_0x2bf4('0x14')),controller[_0x2bf4('0x15')]);router[_0x2bf4('0x16')](_0x2bf4('0xe'),auth[_0x2bf4('0x3')](),controller[_0x2bf4('0x17')]);module['exports']=router; \ No newline at end of file +var _0x8688=['delete','mailinteraction:destroy','destroy','Router','../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','addTags','put','mail','mailinteraction:update','update'];(function(_0x14e5a3,_0x30271b){var _0x4eba04=function(_0x3970b0){while(--_0x3970b0){_0x14e5a3['push'](_0x14e5a3['shift']());}};_0x4eba04(++_0x30271b);}(_0x8688,0xc0));var _0x8868=function(_0x1f5027,_0x40d879){_0x1f5027=_0x1f5027-0x0;var _0x555e56=_0x8688[_0x1f5027];return _0x555e56;};'use strict';var express=require('express');var router=express[_0x8868('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x8868('0x1'));var controller=require('./mailInteraction.controller');router[_0x8868('0x2')]('/',auth['isAuthenticated'](),controller[_0x8868('0x3')]);router[_0x8868('0x2')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8868('0x4'),auth[_0x8868('0x5')](),controller['show']);router[_0x8868('0x2')](_0x8868('0x6'),auth[_0x8868('0x5')](),controller['getMessages']);router[_0x8868('0x2')](_0x8868('0x7'),auth[_0x8868('0x5')](),controller[_0x8868('0x8')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8868('0x9')](_0x8868('0x6'),auth[_0x8868('0x5')](),controller[_0x8868('0xa')]);router['post'](_0x8868('0xb'),auth[_0x8868('0x5')](),interaction[_0x8868('0xc')]('mail','mailinteraction:addtags'),controller[_0x8868('0xd')]);router[_0x8868('0xe')](_0x8868('0x4'),auth[_0x8868('0x5')](),interaction['tracked'](_0x8868('0xf'),_0x8868('0x10')),controller[_0x8868('0x11')]);router[_0x8868('0x12')]('/:id',auth[_0x8868('0x5')](),interaction[_0x8868('0xc')](_0x8868('0xf'),_0x8868('0x13')),controller[_0x8868('0x14')]);router[_0x8868('0x12')](_0x8868('0xb'),auth[_0x8868('0x5')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 451bde4..1f02b40 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 _0x9a30=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','out','ENUM','sequelize'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x9a30,0x170));var _0x09a3=function(_0x51bc79,_0x51505f){_0x51bc79=_0x51bc79-0x0;var _0x1e487c=_0x9a30[_0x51bc79];return _0x1e487c;};'use strict';var Sequelize=require(_0x09a3('0x0'));var iconv=require(_0x09a3('0x1'));module[_0x09a3('0x2')]={'closed':{'type':Sequelize[_0x09a3('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x09a3('0x4')]},'disposition':{'type':Sequelize[_0x09a3('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x09a3('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x09a3('0x5')](0x1fe)},'to':{'type':Sequelize[_0x09a3('0x5')]},'cc':{'type':Sequelize[_0x09a3('0x6')]('long')},'subject':{'type':Sequelize[_0x09a3('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x09a3('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x09a3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x09a3('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x09a3('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x09a3('0x8')]('in',_0x09a3('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x09a3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4369=['long','ENUM','out','sequelize','iconv','BOOLEAN','DATE','STRING','TEXT'];(function(_0x461e4e,_0x455785){var _0x52c1d8=function(_0x52060a){while(--_0x52060a){_0x461e4e['push'](_0x461e4e['shift']());}};_0x52c1d8(++_0x455785);}(_0x4369,0x108));var _0x9436=function(_0x3b8f2e,_0x5a99a8){_0x3b8f2e=_0x3b8f2e-0x0;var _0x1433d5=_0x4369[_0x3b8f2e];return _0x1433d5;};'use strict';var Sequelize=require(_0x9436('0x0'));var iconv=require(_0x9436('0x1'));module['exports']={'closed':{'type':Sequelize[_0x9436('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9436('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9436('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9436('0x4')]},'inReplyTo':{'type':Sequelize[_0x9436('0x4')](0x1fe)},'to':{'type':Sequelize[_0x9436('0x4')]},'cc':{'type':Sequelize[_0x9436('0x5')](_0x9436('0x6'))},'subject':{'type':Sequelize[_0x9436('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9436('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9436('0x7')]('in',_0x9436('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9436('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 04cfaad..14bb576 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 _0xe469=['i.MailAccountId\x20IN\x20?','role','sequelize','toString','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','all','show','params','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','Tag','findAll','emit','mailInteractionTags:save','removeTags','unix','join','files','tmp','root','server','transcript-%d-%s.zip','attachments','Attachment','Messages','bcc','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','lastMsgText','catch','index','MailInteraction','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','MailAccountId','concat','createdAt','$gte','parse','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','i.id','order','DESC','t.id\x20IN\x20?','resolve','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL'];(function(_0x291fc4,_0x39bf93){var _0x6f8a72=function(_0x53feec){while(--_0x53feec){_0x291fc4['push'](_0x291fc4['shift']());}};_0x6f8a72(++_0x39bf93);}(_0xe469,0x14b));var _0x9e46=function(_0x3a841d,_0x151ba7){_0x3a841d=_0x3a841d-0x0;var _0x55ef7d=_0xe469[_0x3a841d];return _0x55ef7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e46('0x0'));var zipdir=require(_0x9e46('0x1'));var moment=require('moment');var BPromise=require(_0x9e46('0x2'));var util=require('util');var path=require(_0x9e46('0x3'));var fs=require('fs');var _=require(_0x9e46('0x4'));var squel=require(_0x9e46('0x5'));var juice=require(_0x9e46('0x6'));var Redis=require(_0x9e46('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x9e46('0x8'));var logger=require(_0x9e46('0x9'))('api');var config=require(_0x9e46('0xa'));var db=require(_0x9e46('0xb'))['db'];var htmlEntities=require('html-entities');config[_0x9e46('0xc')]=_[_0x9e46('0xd')](config['redis'],{'host':_0x9e46('0xe'),'port':0x18eb});var socket=require(_0x9e46('0xf'))(new Redis(config[_0x9e46('0xc')]));require(_0x9e46('0x10'))[_0x9e46('0x11')](socket);function respondWithStatusCode(_0x5e863c,_0x389f5d){_0x389f5d=_0x389f5d||0xcc;return function(_0x395034){if(_0x395034){return _0x5e863c[_0x9e46('0x12')](_0x389f5d);}return _0x5e863c[_0x9e46('0x13')](_0x389f5d)[_0x9e46('0x14')]();};}function respondWithResult(_0x32fc41,_0xdf2546){_0xdf2546=_0xdf2546||0xc8;return function(_0x31ea0f){if(_0x31ea0f){return _0x32fc41[_0x9e46('0x13')](_0xdf2546)['json'](_0x31ea0f);}};}function respondWithFilteredResult(_0x1c4018,_0x6d5c5e){return function(_0x4edb02){if(_0x4edb02){var _0x3a0125=typeof _0x6d5c5e['offset']===_0x9e46('0x15')&&typeof _0x6d5c5e[_0x9e46('0x16')]===_0x9e46('0x15');var _0x58073f=_0x4edb02[_0x9e46('0x17')];var _0xaa92ac=_0x3a0125?0x0:_0x6d5c5e['offset'];var _0x53039d=_0x3a0125?_0x4edb02[_0x9e46('0x17')]:_0x6d5c5e[_0x9e46('0x18')]+_0x6d5c5e[_0x9e46('0x16')];var _0x20c35f;if(_0x53039d>=_0x58073f){_0x53039d=_0x58073f;_0x20c35f=0xc8;}else{_0x20c35f=0xce;}_0x1c4018[_0x9e46('0x13')](_0x20c35f);return _0x1c4018[_0x9e46('0x19')](_0x9e46('0x1a'),_0xaa92ac+'-'+_0x53039d+'/'+_0x58073f)[_0x9e46('0x1b')](_0x4edb02);}return null;};}function saveUpdates(_0x89d54){return function(_0x352727){if(_0x352727){return _0x352727[_0x9e46('0x1c')](_0x89d54)[_0x9e46('0x1d')](function(_0x14cdbd){return _0x14cdbd;});}return null;};}function removeEntity(_0x3c1c7d){return function(_0x47ac44){if(_0x47ac44){return _0x47ac44[_0x9e46('0x1e')]()[_0x9e46('0x1d')](function(){_0x3c1c7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb4a1fc){return function(_0x239e9a){if(!_0x239e9a){_0xb4a1fc[_0x9e46('0x12')](0x194);}return _0x239e9a;};}function handleError(_0x393cf6,_0x3af98c){_0x3af98c=_0x3af98c||0x1f4;return function(_0x21a7d8){logger[_0x9e46('0x1f')](_0x21a7d8[_0x9e46('0x20')]);if(_0x21a7d8[_0x9e46('0x21')]){delete _0x21a7d8[_0x9e46('0x21')];}_0x393cf6['status'](_0x3af98c)[_0x9e46('0x22')](_0x21a7d8);};}function getInteractionUsers(_0x30c840,_0xd97e3f){return new BPromise(function(_0x2fe90d,_0x4ef569){try{if(_0xd97e3f[_0x30c840['id']]){_0x30c840[_0x9e46('0x23')]=_[_0x9e46('0x24')](_0xd97e3f[_0x30c840['id']],function(_0x5aa6fc){return{'id':_0x5aa6fc['id'],'fullname':_0x5aa6fc[_0x9e46('0x25')]};});}}catch(_0x45f54a){_0x4ef569(_0x45f54a);}_0x2fe90d(_0x30c840);});}function getInteractionTags(_0x268684,_0x12f4c1){return new BPromise(function(_0x2da333,_0x414d65){try{if(_0x268684[_0x9e46('0x26')]){_0x268684[_0x9e46('0x27')]=[];_0x268684['TagIds'][_0x9e46('0x28')](',')[_0x9e46('0x29')](function(_0x249583){_0x268684[_0x9e46('0x27')][_0x9e46('0x2a')](_0x12f4c1[_0x249583]);});}delete _0x268684[_0x9e46('0x26')];}catch(_0x5dde6e){_0x414d65(_0x5dde6e);}_0x2da333(_0x268684);});}function getLastMessageText(_0x33408e){return new BPromise(function(_0x156305,_0x23ffc4){return db[_0x9e46('0x2b')][_0x9e46('0x2c')]({'where':{'$and':[{'MailInteractionId':_0x33408e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9e46('0x2d')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9e46('0x2e')],'order':'-id','raw':!![]})[_0x9e46('0x1d')](function(_0x3f4359){if(_0x3f4359&&_0x3f4359[_0x9e46('0x2e')]){_0x33408e[_0x9e46('0x2f')]=_['trimStart'](_0x3f4359[_0x9e46('0x2e')]);}_0x156305(_0x33408e);})[_0x9e46('0x30')](function(_0xfe30e2){_0x23ffc4(_0xfe30e2);});});}function updateMailInteraction(_0x1e7e0e,_0x2a566a,_0x2b58d5,_0x253e46){return new BPromise(function(_0x543700,_0xb57ab8){return getInteractionUsers(_0x1e7e0e,_0x2b58d5)[_0x9e46('0x1d')](function(_0x2b656d){return getInteractionTags(_0x2b656d,_0x2a566a);})['then'](function(_0x48cd80){if(_0x253e46){_0x543700(getLastMessageText(_0x48cd80));}else{_0x543700(_0x48cd80);}})[_0x9e46('0x30')](function(_0x276496){_0xb57ab8(_0x276496);});});}exports[_0x9e46('0x31')]=function(_0xcbcd18,_0xd87a27){var _0x140cbb={},_0x15a94d={},_0xf606d7={'count':0x0,'rows':[]};var _0x507083=_[_0x9e46('0x24')](db[_0x9e46('0x32')][_0x9e46('0x33')],function(_0x45d2fa){return{'name':_0x45d2fa['fieldName'],'type':_0x45d2fa[_0x9e46('0x34')]['key']};});_0x15a94d[_0x9e46('0x35')]=_[_0x9e46('0x24')](_0x507083,_0x9e46('0x21'));_0x15a94d[_0x9e46('0x36')]=_[_0x9e46('0x37')](_0xcbcd18[_0x9e46('0x36')]);_0x15a94d[_0x9e46('0x38')]=_[_0x9e46('0x39')](_0x15a94d[_0x9e46('0x35')],_0x15a94d[_0x9e46('0x36')]);_0x140cbb[_0x9e46('0x3a')]=_[_0x9e46('0x39')](_0x15a94d[_0x9e46('0x35')],qs['fields'](_0xcbcd18['query']['fields']));_0x140cbb[_0x9e46('0x3a')]=_0x140cbb['attributes'][_0x9e46('0x3b')]?_0x140cbb[_0x9e46('0x3a')]:_0x15a94d[_0x9e46('0x35')];if(!_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x3c')](_0x9e46('0x3d'))){_0x140cbb[_0x9e46('0x16')]=qs[_0x9e46('0x16')](_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x16')]);_0x140cbb[_0x9e46('0x18')]=qs[_0x9e46('0x18')](_0xcbcd18['query'][_0x9e46('0x18')]);}_0x140cbb['order']=qs[_0x9e46('0x3e')](_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x3e')]);_0x140cbb[_0x9e46('0x3f')]=qs['filters'](_[_0x9e46('0x40')](_0xcbcd18[_0x9e46('0x36')],_0x15a94d[_0x9e46('0x38')]),_0x507083);var _0x5d7ec0=[];var _0x34088a=squel[_0x9e46('0x41')]()['field']('id')[_0x9e46('0x42')](_0x9e46('0x21'))[_0x9e46('0x42')]('color')[_0x9e46('0x43')](_0x9e46('0x44'));var _0x46e79b=squel[_0x9e46('0x41')]()['field'](_0x9e46('0x45'))[_0x9e46('0x42')](_0x9e46('0x46'))['field'](_0x9e46('0x47'))['from'](_0x9e46('0x48'),'ui')['left_join'](_0x9e46('0x49'),'u',_0x9e46('0x4a'));var _0x376d6f=squel[_0x9e46('0x41')]()[_0x9e46('0x43')](_0x9e46('0x4b'),'i')[_0x9e46('0x4c')](_0x9e46('0x4d'),'c',_0x9e46('0x4e'))[_0x9e46('0x4c')]('users','o',_0x9e46('0x4f'))[_0x9e46('0x4c')]('mail_accounts','a',_0x9e46('0x50'))['left_join'](_0x9e46('0x51'),'me','me.MailInteractionId\x20=\x20i.id')[_0x9e46('0x4c')](_0x9e46('0x52'),'it',_0x9e46('0x53'))['left_join'](_0x9e46('0x44'),'t',_0x9e46('0x54'));var _0x1602a9=squel[_0x9e46('0x55')]();var _0x470702=[];var _0x49c79f=squel['expr']();var _0x2100cd;if(_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x56')]){_0x2100cd=as[_0x9e46('0x57')](_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x56')]);var _0x40abb6=_0x2100cd[_0x9e46('0x58')];for(var _0x5095a6=0x0;_0x5095a6<_0x2100cd['conditions']['length'];_0x5095a6++){var _0x1ae7c3=_0x2100cd[_0x9e46('0x59')][_0x5095a6];var _0x34b300='i';var _0x3242fd=_[_0x9e46('0x5a')](_0x507083,[_0x9e46('0x21'),_0x1ae7c3[_0x9e46('0x42')]]);if(!_0x3242fd){switch(_0x1ae7c3[_0x9e46('0x42')]){case _0x9e46('0x5b'):if(_0x1ae7c3['value']==0x1){_0x376d6f['having']('`'+_0x1ae7c3[_0x9e46('0x42')]+_0x9e46('0x5c'));}else{_0x376d6f[_0x9e46('0x5d')]('`'+_0x1ae7c3[_0x9e46('0x42')]+_0x9e46('0x5e'));}break;case _0x9e46('0x5f'):if(_0x1ae7c3[_0x9e46('0x60')]==='$substring'){if(_0x1ae7c3[_0x9e46('0x61')]['split']('\x20')[_0x9e46('0x3b')]>0x1){_0x1602a9[_0x40abb6](_0x9e46('0x62'),qs['getFullTextValue'](_0x1ae7c3[_0x9e46('0x61')]),null);}else{var _0x54003e='%'+_0x1ae7c3[_0x9e46('0x61')]+'%';_0x1602a9[_0x40abb6](_0x9e46('0x63'),_0x54003e,_0x54003e,_0x54003e);}}else{_0x3242fd=_['find'](_0x507083,[_0x9e46('0x21'),_0x9e46('0x64')]);_0x1ae7c3[_0x9e46('0x42')]=_0x9e46('0x64');_0x4a8421=as[_0x9e46('0x65')](_0x34b300,_0x3242fd[_0x9e46('0x34')],_0x1ae7c3);_0x1602a9[_0x40abb6](_0x4a8421[_0x9e46('0x66')],_0x4a8421[_0x9e46('0x61')][_0x9e46('0x67')],_0x4a8421[_0x9e46('0x61')]['end']);}break;case'Tag':var _0x1b22c0=_0x1ae7c3[_0x9e46('0x61')][_0x9e46('0x28')](',')[_0x9e46('0x24')](function(_0x5bd364){return Number(_0x5bd364);});_0x1b22c0['forEach'](function(_0x4751e5){_0x49c79f['or'](_0x9e46('0x68'),'%,'+_0x4751e5+',%');});_0x470702=_['union'](_0x470702,_0x1b22c0);break;case _0x9e46('0x69'):if(_0x1ae7c3[_0x9e46('0x60')]===_0x9e46('0x6a')){_0x1602a9[_0x40abb6](_0x9e46('0x6b'),'%'+_0x1ae7c3['value']+'%',null);}else{_0x3242fd=_[_0x9e46('0x5a')](_0x507083,['name',_0x9e46('0x6c')]);_0x1ae7c3['field']=_0x9e46('0x6c');_0x4a8421=as[_0x9e46('0x65')](_0x34b300,_0x3242fd[_0x9e46('0x34')],_0x1ae7c3);_0x1602a9[_0x40abb6](_0x4a8421['text'],_0x4a8421['value'][_0x9e46('0x67')],_0x4a8421['value'][_0x9e46('0x14')]);}break;case _0x9e46('0x2e'):_0x4a8421=as['buildExpression']('me',null,_0x1ae7c3);_0x1602a9[_0x40abb6](_0x4a8421[_0x9e46('0x66')],_0x4a8421[_0x9e46('0x61')][_0x9e46('0x67')],_0x4a8421[_0x9e46('0x61')][_0x9e46('0x14')]);break;}}else{var _0x4a8421=as['buildExpression'](_0x34b300,_0x3242fd[_0x9e46('0x34')],_0x1ae7c3);_0x1602a9[_0x40abb6](_0x4a8421[_0x9e46('0x66')],_0x4a8421[_0x9e46('0x61')][_0x9e46('0x67')],_0x4a8421[_0x9e46('0x61')][_0x9e46('0x14')]);}}}else{var _0x4af8ff=_(_0xcbcd18[_0x9e46('0x36')])[_0x9e46('0x37')]()['map'](function(_0x23fd6c){return _[_0x9e46('0x6d')](_0x507083,[_0x9e46('0x21'),_0x23fd6c])?_0x23fd6c:undefined;})[_0x9e46('0x6e')]()[_0x9e46('0x61')]();if(!_[_0x9e46('0x6f')](_0x4af8ff)){_0x4af8ff[_0x9e46('0x29')](function(_0x262cb5){if(_0x262cb5===_0x9e46('0x70')){_0x376d6f['where']('i.MailAccountId\x20IN\x20?',[][_0x9e46('0x71')](_0xcbcd18[_0x9e46('0x36')][_0x262cb5]));}else if(_0x262cb5===_0x9e46('0x72')){var _0x5c91c0=JSON['parse'](_0xcbcd18[_0x9e46('0x36')][_0x262cb5])[_0x9e46('0x73')];var _0x5672f5=JSON[_0x9e46('0x74')](_0xcbcd18[_0x9e46('0x36')][_0x262cb5])['$lte'];_0x376d6f[_0x9e46('0x3f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5c91c0,_0x5672f5);}else{if(_0xcbcd18[_0x9e46('0x36')][_0x262cb5]===_0x9e46('0x75')){_0x376d6f[_0x9e46('0x3f')]('i.'+_0x262cb5+'\x20IS\x20NULL');}else{_0x376d6f[_0x9e46('0x3f')]('i.'+_0x262cb5+_0x9e46('0x76'),_0xcbcd18[_0x9e46('0x36')][_0x262cb5]);}}});}if(_0xcbcd18['query']['read']){if(_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x77')]==0x1){_0x376d6f[_0x9e46('0x5d')](_0x9e46('0x78'));}else{_0x376d6f[_0x9e46('0x5d')](_0x9e46('0x79'));}}if(_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x7a')]){_0x470702=_[_0x9e46('0x7b')](_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x7a')])?_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x7a')]:new Array(_0xcbcd18['query'][_0x9e46('0x7a')]);_0x470702['forEach'](function(_0x481ff0){_0x49c79f['or'](_0x9e46('0x68'),'%,'+_0x481ff0+',%');});}if(_0xcbcd18['query'][_0x9e46('0x7c')]){var _0x47d5cf=_0xcbcd18[_0x9e46('0x36')]['filter'][_0x9e46('0x7d')]('\x5c','\x5c\x5c')[_0x9e46('0x7d')](/'/g,'\x27\x27');if(qs[_0x9e46('0x7e')](_0x47d5cf)){_0x1602a9['or']('i.id\x20LIKE\x20?',_0x47d5cf+'%');}else if(qs[_0x9e46('0x7f')](_0x47d5cf)){_0x1602a9['or'](_0x9e46('0x80'),_0x47d5cf+'%');}else{_0x1602a9['or'](_0x9e46('0x81'),qs[_0x9e46('0x82')](_0x47d5cf))['or'](_0x9e46('0x83'),qs[_0x9e46('0x82')](_0x47d5cf));}}}_0x376d6f[_0x9e46('0x3f')](_0x1602a9);_0x376d6f[_0x9e46('0x84')]('i.id');var _0x245bf={'type':db['Sequelize']['QueryTypes'][_0x9e46('0x85')],'raw':!![]};var _0x317716=_0x376d6f['clone']();_0x317716[_0x9e46('0x42')](_0x9e46('0x86'));_0x317716[_0x9e46('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9e46('0x5b'));if(_0x140cbb[_0x9e46('0x87')]){_0x140cbb['order'][_0x9e46('0x29')](function(_0x40bbdc){var _0x249fc6=_0x40bbdc[0x0]==='contactName'?_0x40bbdc[0x0]:'i.'+_0x40bbdc[0x0];_0x376d6f[_0x9e46('0x87')](_0x249fc6,_0x40bbdc[0x1]===_0x9e46('0x88')?![]:!![]);});}if(!_[_0x9e46('0x6f')](_0x470702)){_0x376d6f[_0x9e46('0x5d')](_0x49c79f);_0x317716[_0x9e46('0x3f')](_0x9e46('0x89'),_0x470702);}BPromise[_0x9e46('0x8a')]()[_0x9e46('0x1d')](function(){if(!_0x2100cd){if(_0xcbcd18[_0x9e46('0x36')][_0x9e46('0x70')])return;_0x317716[_0x9e46('0x3f')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x376d6f['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xcbcd18[_0x9e46('0x8b')]['role']!==_0x9e46('0x8c'))return;return _0xcbcd18['user'][_0x9e46('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e229a){if(_[_0x9e46('0x6f')](_0x2e229a)){_0x317716['where']('i.MailAccountId\x20IS\x20NULL');_0x376d6f['where'](_0x9e46('0x8e'));}else{_0x317716[_0x9e46('0x3f')](_0x9e46('0x8f'),_[_0x9e46('0x24')](_0x2e229a,'id'));_0x376d6f[_0x9e46('0x3f')](_0x9e46('0x8f'),_[_0x9e46('0x24')](_0x2e229a,'id'));}});})[_0x9e46('0x1d')](function(){if(_0xcbcd18[_0x9e46('0x8b')][_0x9e46('0x90')]===_0x9e46('0x8c')&&!_0x2100cd&&!_0xcbcd18['query'][_0x9e46('0x70')])return[];return db[_0x9e46('0x91')][_0x9e46('0x36')](_0x317716[_0x9e46('0x92')](),_0x245bf);})[_0x9e46('0x1d')](function(_0x2ea69d){_0xf606d7['count']=_0x2ea69d['length'];if(_0xf606d7['count']===0x0)return[];return db[_0x9e46('0x91')][_0x9e46('0x36')](_0x34088a['toString'](),_0x245bf)[_0x9e46('0x1d')](function(_0x18866f){_0x5d7ec0=_['keyBy'](_0x18866f,'id');_0x245bf=_[_0x9e46('0x93')](_0x245bf,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xcbcd18['query'][_0x9e46('0x94')]){_0x140cbb[_0x9e46('0x3a')][_0x9e46('0x29')](function(_0x5d7fe2){_0x376d6f[_0x9e46('0x42')]('i.'+_0x5d7fe2);});}else{_0x376d6f[_0x9e46('0x42')](_0x9e46('0x95'),'unreadMessages');_0x376d6f['field']('a.key','Account.key');_0x376d6f[_0x9e46('0x42')](_0x9e46('0x96'),_0x9e46('0x97'));_0x376d6f[_0x9e46('0x42')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x9e46('0x98'));_0x376d6f['field'](_0x9e46('0x86'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0x99'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0x9a'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0x9b'));_0x376d6f['field'](_0x9e46('0x9c'));_0x376d6f['field'](_0x9e46('0x9d'));_0x376d6f['field'](_0x9e46('0x9e'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0x9f'));_0x376d6f['field']('i.subject');_0x376d6f[_0x9e46('0x42')]('i.disposition');_0x376d6f[_0x9e46('0x42')]('i.secondDisposition');_0x376d6f[_0x9e46('0x42')](_0x9e46('0xa0'));_0x376d6f['field'](_0x9e46('0xa1'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0xa2'));_0x376d6f['field'](_0x9e46('0xa3'));_0x376d6f['field'](_0x9e46('0xa4'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0xa5'));_0x376d6f['field']('c.firstName',_0x9e46('0xa6'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0xa7'),_0x9e46('0xa8'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0xa9'),_0x9e46('0xaa'));_0x376d6f['field'](_0x9e46('0xab'),'Contact.phone');_0x376d6f[_0x9e46('0x42')](_0x9e46('0xac'),_0x9e46('0xad'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0xae'),_0x9e46('0xaf'));_0x376d6f[_0x9e46('0x42')]('o.fullname',_0x9e46('0xb0'));_0x376d6f['field'](_0x9e46('0xb1'),_0x9e46('0xb2'));_0x376d6f[_0x9e46('0x42')](_0x9e46('0xb3'),'TagIds');}if(_0x140cbb[_0x9e46('0x16')])_0x376d6f[_0x9e46('0x16')](_0x140cbb[_0x9e46('0x16')]);if(_0x140cbb[_0x9e46('0x18')])_0x376d6f[_0x9e46('0x18')](_0x140cbb['offset']);return db[_0x9e46('0x91')][_0x9e46('0x36')](_0x376d6f[_0x9e46('0x92')](),_0x245bf);})[_0x9e46('0x1d')](function(_0x50b65d){if(_0x50b65d[_0x9e46('0x3b')]>0x0)_0x46e79b[_0x9e46('0x3f')](_0x9e46('0xb4'),_[_0x9e46('0x24')](_0x50b65d,'id'));return db[_0x9e46('0x91')][_0x9e46('0x36')](_0x46e79b[_0x9e46('0x92')](),_0x245bf)['then'](function(_0x425695){var _0x183a1f=_[_0x9e46('0xb5')](_0x425695,_0x9e46('0xb6'));var _0x1d287c=[];return db['Setting'][_0x9e46('0x2c')]({'attributes':[_0x9e46('0xb7')],'raw':!![]})[_0x9e46('0x1d')](function(_0x16a6a5){var _0x41b3a7=_0x16a6a5[_0x9e46('0xb7')];_0x50b65d[_0x9e46('0x29')](function(_0x4efbf2){_0x1d287c[_0x9e46('0x2a')](updateMailInteraction(_0x4efbf2,_0x5d7ec0,_0x183a1f,_0x41b3a7));});return BPromise[_0x9e46('0xb8')](_0x1d287c);});});});})['then'](function(_0x9e8d0a){_0xf606d7['rows']=_0x9e8d0a;return _0xf606d7;})[_0x9e46('0x1d')](respondWithFilteredResult(_0xd87a27,_0x140cbb))[_0x9e46('0x30')](handleError(_0xd87a27,null));};exports[_0x9e46('0xb9')]=function(_0x17288e,_0x2c0a60){var _0x13b122={'raw':![],'where':{'id':_0x17288e[_0x9e46('0xba')]['id']}},_0x286ccf={};_0x286ccf[_0x9e46('0x35')]=_[_0x9e46('0x37')](db[_0x9e46('0x32')][_0x9e46('0x33')]);_0x286ccf[_0x9e46('0x36')]=_[_0x9e46('0x37')](_0x17288e['query']);_0x286ccf[_0x9e46('0x38')]=_[_0x9e46('0x39')](_0x286ccf[_0x9e46('0x35')],_0x286ccf[_0x9e46('0x36')]);_0x13b122[_0x9e46('0x3a')]=_[_0x9e46('0x39')](_0x286ccf[_0x9e46('0x35')],qs[_0x9e46('0x94')](_0x17288e['query'][_0x9e46('0x94')]));_0x13b122[_0x9e46('0x3a')]=_0x13b122['attributes'][_0x9e46('0x3b')]?_0x13b122[_0x9e46('0x3a')]:_0x286ccf[_0x9e46('0x35')];if(_0x17288e[_0x9e46('0x36')][_0x9e46('0xbb')]){_0x13b122[_0x9e46('0xbc')]=[{'all':!![]}];}_0x13b122=_[_0x9e46('0x93')]({},_0x13b122,_0x17288e[_0x9e46('0xbd')]);return db[_0x9e46('0x32')]['find'](_0x13b122)['then'](handleEntityNotFound(_0x2c0a60,null))[_0x9e46('0x1d')](respondWithResult(_0x2c0a60,null))[_0x9e46('0x30')](handleError(_0x2c0a60,null));};exports[_0x9e46('0xbe')]=function(_0x335938,_0x24346c){return db[_0x9e46('0x32')][_0x9e46('0xbe')](_0x335938[_0x9e46('0xbf')],{})[_0x9e46('0x1d')](respondWithResult(_0x24346c,0xc9))[_0x9e46('0x30')](handleError(_0x24346c,null));};exports[_0x9e46('0x1c')]=function(_0x3159e9,_0x283172){if(_0x3159e9['body']['id']){delete _0x3159e9[_0x9e46('0xbf')]['id'];}return db[_0x9e46('0x32')][_0x9e46('0x5a')]({'where':{'id':_0x3159e9['params']['id']}})[_0x9e46('0x1d')](handleEntityNotFound(_0x283172,null))[_0x9e46('0x1d')](saveUpdates(_0x3159e9['body'],null))[_0x9e46('0x1d')](respondWithResult(_0x283172,null))['catch'](handleError(_0x283172,null));};exports[_0x9e46('0x1e')]=function(_0x5eda40,_0x580e54){return db['MailInteraction'][_0x9e46('0x5a')]({'where':{'id':_0x5eda40[_0x9e46('0xba')]['id']}})[_0x9e46('0x1d')](handleEntityNotFound(_0x580e54,null))[_0x9e46('0x1d')](removeEntity(_0x580e54,null))[_0x9e46('0x30')](handleError(_0x580e54,null));};exports[_0x9e46('0xc0')]=function(_0x3c8397,_0x4798ec){return db[_0x9e46('0x32')][_0x9e46('0xc0')]()[_0x9e46('0x1d')](respondWithResult(_0x4798ec,null))[_0x9e46('0x30')](handleError(_0x4798ec,null));};exports[_0x9e46('0xc1')]=function(_0x5b89d4,_0x4099b5){return db[_0x9e46('0x2b')]['find']({'where':{'id':_0x5b89d4[_0x9e46('0xba')]['id']}})[_0x9e46('0x1d')](handleEntityNotFound(_0x4099b5,null))[_0x9e46('0x1d')](function(_0x7e2338){if(_0x7e2338){return _0x7e2338['addMessage'](_0x5b89d4[_0x9e46('0xbf')][_0x9e46('0xc2')],_[_0x9e46('0xc3')](_0x5b89d4[_0x9e46('0xbf')],[_0x9e46('0xc2'),'id'])||{});}})['then'](respondWithResult(_0x4099b5,null))[_0x9e46('0x30')](handleError(_0x4099b5,null));};exports[_0x9e46('0xc4')]=function(_0x222736,_0x421c02){var _0x367679={'raw':![],'where':{}};var _0x440c99={};var _0x18ee50={'count':0x0,'rows':[]};return db[_0x9e46('0x32')][_0x9e46('0x2c')]({'where':{'id':_0x222736[_0x9e46('0xba')]['id']}})['then'](handleEntityNotFound(_0x421c02,null))[_0x9e46('0x1d')](function(_0xe8090e){if(_0xe8090e){_0x440c99[_0x9e46('0x35')]=_['keys'](db[_0x9e46('0x2b')]['rawAttributes']);_0x440c99[_0x9e46('0x36')]=_[_0x9e46('0x37')](_0x222736[_0x9e46('0x36')]);_0x440c99['filters']=_[_0x9e46('0x39')](_0x440c99[_0x9e46('0x35')],_0x440c99[_0x9e46('0x36')]);_0x367679[_0x9e46('0x3a')]=_[_0x9e46('0x39')](_0x440c99[_0x9e46('0x35')],qs['fields'](_0x222736[_0x9e46('0x36')]['fields']));_0x367679['attributes']=_0x367679[_0x9e46('0x3a')][_0x9e46('0x3b')]?_0x367679[_0x9e46('0x3a')]:_0x440c99[_0x9e46('0x35')];if(!_0x222736[_0x9e46('0x36')][_0x9e46('0x3c')](_0x9e46('0x3d'))){_0x367679[_0x9e46('0x16')]=qs[_0x9e46('0x16')](_0x222736[_0x9e46('0x36')][_0x9e46('0x16')]);_0x367679[_0x9e46('0x18')]=qs[_0x9e46('0x18')](_0x222736[_0x9e46('0x36')][_0x9e46('0x18')]);}_0x367679[_0x9e46('0x87')]=qs['sort'](_0x222736[_0x9e46('0x36')][_0x9e46('0x3e')]);_0x367679[_0x9e46('0x3f')]=qs[_0x9e46('0x38')](_[_0x9e46('0x40')](_0x222736[_0x9e46('0x36')],_0x440c99['filters']));_0x367679['where'][_0x9e46('0xb6')]=_0xe8090e['id'];if(_0x222736['query']['filter']){_0x367679[_0x9e46('0x3f')]=_[_0x9e46('0x93')](_0x367679[_0x9e46('0x3f')],{'$or':_[_0x9e46('0x24')](_0x367679[_0x9e46('0x3a')],function(_0x2577bc){var _0x4fe092={};_0x4fe092[_0x2577bc]={'$like':'%'+_0x222736['query'][_0x9e46('0x7c')]+'%'};return _0x4fe092;})});}if(_0x222736[_0x9e46('0x36')][_0x9e46('0x73')]){var _0x5b7184=_0x222736['query'][_0x9e46('0x73')][_0x9e46('0x28')](',');var _0x29d620={};_0x29d620[_0x5b7184[0x0]]={'$gte':moment(_0x5b7184[0x1])[_0x9e46('0xc5')](_0x9e46('0xc6'))};_0x367679['where']=_[_0x9e46('0x93')](_0x367679[_0x9e46('0x3f')],_0x29d620);}_0x367679=_['merge']({},_0x367679,_0x222736[_0x9e46('0xbd')]);return db['MailMessage'][_0x9e46('0x17')]({'where':_0x367679[_0x9e46('0x3f')]})['then'](function(_0x1780ce){_0x18ee50['count']=_0x1780ce;if(_0x222736['query'][_0x9e46('0xbb')]){_0x367679[_0x9e46('0xbc')]=[{'all':!![]}];}return db[_0x9e46('0x2b')]['findAll'](_0x367679);})[_0x9e46('0x1d')](function(_0xf108e4){if(_0x222736['query'][_0x9e46('0xc7')]===_0x9e46('0xc8')){for(var _0x492c69=0x0;_0x492c69<_0xf108e4[_0x9e46('0x3b')];_0x492c69++){_0xf108e4[_0x492c69]['body']=juice(_0xf108e4[_0x492c69]['body']);}}_0x18ee50[_0x9e46('0xc9')]=_0xf108e4;return _0x18ee50;});}})[_0x9e46('0x1d')](respondWithFilteredResult(_0x421c02,_0x367679))[_0x9e46('0x30')](handleError(_0x421c02,null));};exports[_0x9e46('0xca')]=function(_0x5ec468,_0x53625d){return db['MailInteraction']['find']({'where':{'id':_0x5ec468[_0x9e46('0xba')]['id']}})[_0x9e46('0x1d')](handleEntityNotFound(_0x53625d,null))[_0x9e46('0x1d')](function(_0x4b62ef){if(_0x4b62ef){return _0x4b62ef[_0x9e46('0xcb')](_0x5ec468[_0x9e46('0xbf')]['ids'],_['omit'](_0x5ec468[_0x9e46('0xbf')],[_0x9e46('0xc2'),'id'])||{})['spread'](function(){return db[_0x9e46('0xcc')][_0x9e46('0xcd')]({'attributes':['id',_0x9e46('0x21'),'color'],'where':{'id':_0x5ec468[_0x9e46('0xbf')]['ids']}});})[_0x9e46('0x1d')](function(_0x25a72e){socket[_0x9e46('0xce')](_0x9e46('0xcf'),{'id':Number(_0x5ec468[_0x9e46('0xba')]['id']),'tags':_0x25a72e||[]});return{'id':Number(_0x5ec468[_0x9e46('0xba')]['id']),'tags':_0x25a72e||[]};});}})['then'](respondWithResult(_0x53625d,null))[_0x9e46('0x30')](handleError(_0x53625d,null));};exports[_0x9e46('0xd0')]=function(_0x47cf4a,_0x56a0dd){return db['MailInteraction'][_0x9e46('0x5a')]({'where':{'id':_0x47cf4a['params']['id']}})[_0x9e46('0x1d')](handleEntityNotFound(_0x56a0dd,null))['then'](function(_0x694560){if(_0x694560){return _0x694560[_0x9e46('0xd0')](_0x47cf4a[_0x9e46('0x36')][_0x9e46('0xc2')]);}})[_0x9e46('0x1d')](respondWithStatusCode(_0x56a0dd,null))[_0x9e46('0x30')](handleError(_0x56a0dd,null));};exports['download']=function(_0x2f8ec6,_0x346455){var _0xb37e8f=moment()[_0x9e46('0xd1')]()[_0x9e46('0x92')]();var _0x3b8448=path[_0x9e46('0xd2')](config['root'],'server',_0x9e46('0xd3'),_0x9e46('0xd4'));var _0x20adfc=path[_0x9e46('0xd2')](config[_0x9e46('0xd5')],_0x9e46('0xd6'),'files','attachments');var _0x287304=path[_0x9e46('0xd2')](_0x3b8448,_0xb37e8f);var _0x37409e=util['format'](_0x9e46('0xd7'),_0x2f8ec6[_0x9e46('0xba')]['id'],_0xb37e8f);var _0x10413c=path['join'](_0x3b8448,_0x37409e);var _0x3ca4ba=[];if(_0x2f8ec6[_0x9e46('0x36')][_0x9e46('0xd8')]){_0x3ca4ba[_0x9e46('0x2a')]({'model':db[_0x9e46('0xd9')],'as':'Attachments','raw':!![]});}var _0x4bb80f=[{'model':db[_0x9e46('0x2b')],'as':_0x9e46('0xda'),'attributes':['id',_0x9e46('0xbf'),'from','to','cc',_0x9e46('0xdb'),'subject',_0x9e46('0x72')],'where':{'secret':![]},'order':qs[_0x9e46('0x3e')]('id'),'include':_0x3ca4ba}];return db[_0x9e46('0x32')][_0x9e46('0x5a')]({'where':{'id':_0x2f8ec6['params']['id']},'include':_0x4bb80f})[_0x9e46('0x1d')](handleEntityNotFound(_0x346455,null))[_0x9e46('0x1d')](function(_0xa31158){if(_0xa31158&&_0xa31158[_0x9e46('0xda')]){var _0x31f4c7=_0xa31158[_0x9e46('0xdc')]({'plain':!![]});fs[_0x9e46('0xdd')](_0x287304);return BPromise[_0x9e46('0xde')](_0x31f4c7[_0x9e46('0xda')],function(_0x216595,_0x2c2bba){var _0x223d77={'from':_0x216595[_0x9e46('0x43')],'to':_0x216595['to'],'subject':_0x216595[_0x9e46('0xdf')],'html':htmlEntities[_0x9e46('0xe0')](_0x216595[_0x9e46('0xbf')]),'headers':{'Date':moment(_0x216595[_0x9e46('0x72')])[_0x9e46('0xc5')](_0x9e46('0xe1'))},'attachments':[]};if(_0x216595['cc']){_0x223d77[_0x9e46('0xe2')]['Cc']=_0x216595['cc'];}if(_0x216595[_0x9e46('0xdb')]){_0x223d77[_0x9e46('0xe2')][_0x9e46('0xe3')]=_0x216595[_0x9e46('0xdb')];}return new BPromise(function(_0x437314,_0x2cee28){if(_0x216595[_0x9e46('0xe4')]){for(var _0xf119e7=0x0;_0xf119e7<_0x216595[_0x9e46('0xe4')][_0x9e46('0x3b')];_0xf119e7++){var _0x3e12a4=_0x216595['Attachments'][_0xf119e7];var _0x55baf1=path[_0x9e46('0xd2')](_0x20adfc,_0x3e12a4[_0x9e46('0xe5')]);if(fs[_0x9e46('0xe6')](_0x55baf1)){_0x223d77[_0x9e46('0xd8')][_0x9e46('0x2a')]({'name':_0x3e12a4['name'],'contentType':_0x3e12a4[_0x9e46('0x34')],'data':fs[_0x9e46('0xe7')](_0x55baf1)});}}}emlformat[_0x9e46('0xe8')](_0x223d77,function(_0x4327fa,_0x642b8d){if(_0x4327fa)return _0x2cee28(_0x4327fa);fs[_0x9e46('0xe9')](path[_0x9e46('0xd2')](_0x287304,util[_0x9e46('0xc5')](_0x9e46('0xea'),_0x2c2bba)),_0x642b8d);return _0x437314(_0x642b8d);});});})[_0x9e46('0x1d')](function(){return new BPromise(function(_0x18a5e2,_0x330f37){zipdir(_0x287304,{'saveTo':_0x10413c},function(_0x93b489,_0x56f162){if(_0x93b489)return _0x330f37(_0x93b489);return _0x18a5e2(_0x56f162);});})['then'](function(){return new BPromise(function(_0x453946,_0x20d288){rimraf(_0x287304,function(_0x4e889f){if(_0x4e889f)_0x20d288(_0x4e889f);return _0x453946();});});})[_0x9e46('0x1d')](function(){return _0x346455[_0x9e46('0xeb')](_0x10413c,_0x37409e,function(_0x184040){if(!_0x184040)fs[_0x9e46('0xec')](_0x10413c);});});});}else{return _0x346455['sendStatus'](0xc8);}})['catch'](handleError(_0x346455,null));}; \ No newline at end of file +var _0x6843=['ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.disposition','i.secondDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','enableEmailPreview','all','show','includeAll','include','merge','create','body','update','params','describe','addMessage','omit','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','Tag','findAll','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','Attachments','Messages','bcc','createdAt','get','subject','decode','headers','Bcc','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','then','name','send','Users','map','fullname','Tags','forEach','push','TagIds','MailMessage','findOne','plainBody','trimStart','catch','MailInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','having','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x6843,0x85));var _0x3684=function(_0x35fbce,_0x4629b6){_0x35fbce=_0x35fbce-0x0;var _0x3f40dc=_0x6843[_0x35fbce];return _0x3f40dc;};'use strict';var emlformat=require(_0x3684('0x0'));var rimraf=require(_0x3684('0x1'));var zipdir=require('zip-dir');var moment=require(_0x3684('0x2'));var BPromise=require(_0x3684('0x3'));var util=require(_0x3684('0x4'));var path=require(_0x3684('0x5'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require('juice');var Redis=require(_0x3684('0x6'));var qs=require(_0x3684('0x7'));var as=require(_0x3684('0x8'));var logger=require(_0x3684('0x9'))(_0x3684('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0x3684('0xb')]=_[_0x3684('0xc')](config['redis'],{'host':_0x3684('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3684('0xb')]));require(_0x3684('0xe'))[_0x3684('0xf')](socket);function respondWithStatusCode(_0xb6cc29,_0x2d5296){_0x2d5296=_0x2d5296||0xcc;return function(_0x47a0df){if(_0x47a0df){return _0xb6cc29[_0x3684('0x10')](_0x2d5296);}return _0xb6cc29[_0x3684('0x11')](_0x2d5296)[_0x3684('0x12')]();};}function respondWithResult(_0x430ce6,_0x2a1bc9){_0x2a1bc9=_0x2a1bc9||0xc8;return function(_0x523bc9){if(_0x523bc9){return _0x430ce6[_0x3684('0x11')](_0x2a1bc9)[_0x3684('0x13')](_0x523bc9);}};}function respondWithFilteredResult(_0x27a548,_0x40cb80){return function(_0x2dbe5a){if(_0x2dbe5a){var _0x32dd14=typeof _0x40cb80['offset']===_0x3684('0x14')&&typeof _0x40cb80[_0x3684('0x15')]===_0x3684('0x14');var _0x38c945=_0x2dbe5a[_0x3684('0x16')];var _0x2c9fa0=_0x32dd14?0x0:_0x40cb80['offset'];var _0x5ced71=_0x32dd14?_0x2dbe5a['count']:_0x40cb80[_0x3684('0x17')]+_0x40cb80['limit'];var _0x373420;if(_0x5ced71>=_0x38c945){_0x5ced71=_0x38c945;_0x373420=0xc8;}else{_0x373420=0xce;}_0x27a548[_0x3684('0x11')](_0x373420);return _0x27a548[_0x3684('0x18')](_0x3684('0x19'),_0x2c9fa0+'-'+_0x5ced71+'/'+_0x38c945)[_0x3684('0x13')](_0x2dbe5a);}return null;};}function saveUpdates(_0x4585ba){return function(_0x4d5a3c){if(_0x4d5a3c){return _0x4d5a3c['update'](_0x4585ba)['then'](function(_0x210008){return _0x210008;});}return null;};}function removeEntity(_0x4f97cc){return function(_0x4b5867){if(_0x4b5867){return _0x4b5867[_0x3684('0x1a')]()[_0x3684('0x1b')](function(){_0x4f97cc[_0x3684('0x11')](0xcc)[_0x3684('0x12')]();});}};}function handleEntityNotFound(_0x1e76da){return function(_0x2ff1ae){if(!_0x2ff1ae){_0x1e76da[_0x3684('0x10')](0x194);}return _0x2ff1ae;};}function handleError(_0x43b850,_0xc9f896){_0xc9f896=_0xc9f896||0x1f4;return function(_0x24984f){logger['error'](_0x24984f['stack']);if(_0x24984f[_0x3684('0x1c')]){delete _0x24984f[_0x3684('0x1c')];}_0x43b850[_0x3684('0x11')](_0xc9f896)[_0x3684('0x1d')](_0x24984f);};}function getInteractionUsers(_0x2d08ec,_0x147764){return new BPromise(function(_0x44fe8c,_0x79b8ff){try{if(_0x147764[_0x2d08ec['id']]){_0x2d08ec[_0x3684('0x1e')]=_[_0x3684('0x1f')](_0x147764[_0x2d08ec['id']],function(_0x413443){return{'id':_0x413443['id'],'fullname':_0x413443[_0x3684('0x20')]};});}}catch(_0x39620a){_0x79b8ff(_0x39620a);}_0x44fe8c(_0x2d08ec);});}function getInteractionTags(_0x4bb274,_0x204a95){return new BPromise(function(_0x53aeab,_0x1a9cf7){try{if(_0x4bb274['TagIds']){_0x4bb274[_0x3684('0x21')]=[];_0x4bb274['TagIds']['split'](',')[_0x3684('0x22')](function(_0x202e75){_0x4bb274[_0x3684('0x21')][_0x3684('0x23')](_0x204a95[_0x202e75]);});}delete _0x4bb274[_0x3684('0x24')];}catch(_0x59f255){_0x1a9cf7(_0x59f255);}_0x53aeab(_0x4bb274);});}function getLastMessageText(_0x5b3c85){return new BPromise(function(_0x242ab0,_0x315626){return db[_0x3684('0x25')][_0x3684('0x26')]({'where':{'$and':[{'MailInteractionId':_0x5b3c85['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x3684('0x27')],'order':'-id','raw':!![]})[_0x3684('0x1b')](function(_0x2e86f7){if(_0x2e86f7&&_0x2e86f7[_0x3684('0x27')]){_0x5b3c85['lastMsgText']=_[_0x3684('0x28')](_0x2e86f7[_0x3684('0x27')]);}_0x242ab0(_0x5b3c85);})[_0x3684('0x29')](function(_0x57bfdd){_0x315626(_0x57bfdd);});});}function updateMailInteraction(_0xb89aaa,_0x293ceb,_0x18cd55,_0x4bde24){return new BPromise(function(_0x5eb7e2,_0x380af5){return getInteractionUsers(_0xb89aaa,_0x18cd55)[_0x3684('0x1b')](function(_0x595a81){return getInteractionTags(_0x595a81,_0x293ceb);})[_0x3684('0x1b')](function(_0x5d175d){if(_0x4bde24){_0x5eb7e2(getLastMessageText(_0x5d175d));}else{_0x5eb7e2(_0x5d175d);}})[_0x3684('0x29')](function(_0x1f7953){_0x380af5(_0x1f7953);});});}exports['index']=function(_0x23e139,_0x4317b7){var _0x1eec02={},_0xfa2f62={},_0x540a21={'count':0x0,'rows':[]};var _0x164594=_[_0x3684('0x1f')](db[_0x3684('0x2a')][_0x3684('0x2b')],function(_0x139127){return{'name':_0x139127[_0x3684('0x2c')],'type':_0x139127[_0x3684('0x2d')][_0x3684('0x2e')]};});_0xfa2f62[_0x3684('0x2f')]=_[_0x3684('0x1f')](_0x164594,_0x3684('0x1c'));_0xfa2f62[_0x3684('0x30')]=_[_0x3684('0x31')](_0x23e139['query']);_0xfa2f62[_0x3684('0x32')]=_[_0x3684('0x33')](_0xfa2f62['model'],_0xfa2f62['query']);_0x1eec02[_0x3684('0x34')]=_[_0x3684('0x33')](_0xfa2f62['model'],qs['fields'](_0x23e139[_0x3684('0x30')]['fields']));_0x1eec02['attributes']=_0x1eec02['attributes'][_0x3684('0x35')]?_0x1eec02[_0x3684('0x34')]:_0xfa2f62[_0x3684('0x2f')];if(!_0x23e139[_0x3684('0x30')][_0x3684('0x36')]('nolimit')){_0x1eec02[_0x3684('0x15')]=qs[_0x3684('0x15')](_0x23e139[_0x3684('0x30')][_0x3684('0x15')]);_0x1eec02['offset']=qs[_0x3684('0x17')](_0x23e139[_0x3684('0x30')]['offset']);}_0x1eec02[_0x3684('0x37')]=qs[_0x3684('0x38')](_0x23e139[_0x3684('0x30')][_0x3684('0x38')]);_0x1eec02['where']=qs[_0x3684('0x32')](_[_0x3684('0x39')](_0x23e139[_0x3684('0x30')],_0xfa2f62[_0x3684('0x32')]),_0x164594);var _0x587b22=[];var _0x3e0cd8=squel['select']()[_0x3684('0x3a')]('id')[_0x3684('0x3a')]('name')[_0x3684('0x3a')]('color')[_0x3684('0x3b')](_0x3684('0x3c'));var _0x1dc14d=squel['select']()['field'](_0x3684('0x3d'))[_0x3684('0x3a')](_0x3684('0x3e'))['field'](_0x3684('0x3f'))[_0x3684('0x3b')](_0x3684('0x40'),'ui')[_0x3684('0x41')](_0x3684('0x42'),'u',_0x3684('0x43'));var _0x30672f=squel[_0x3684('0x44')]()[_0x3684('0x3b')](_0x3684('0x45'),'i')['left_join'](_0x3684('0x46'),'c',_0x3684('0x47'))[_0x3684('0x41')](_0x3684('0x42'),'o',_0x3684('0x48'))[_0x3684('0x41')](_0x3684('0x49'),'a',_0x3684('0x4a'))[_0x3684('0x41')](_0x3684('0x4b'),'me','me.MailInteractionId\x20=\x20i.id')[_0x3684('0x41')](_0x3684('0x4c'),'it',_0x3684('0x4d'))[_0x3684('0x41')](_0x3684('0x3c'),'t',_0x3684('0x4e'));var _0x41af3d=squel['expr']();var _0x42f1ca=[];var _0x2306d1=squel[_0x3684('0x4f')]();var _0x2d4439;if(_0x23e139['query'][_0x3684('0x50')]){_0x2d4439=as['parseSearch'](_0x23e139[_0x3684('0x30')][_0x3684('0x50')]);var _0x5a998d=_0x2d4439[_0x3684('0x51')];for(var _0x2b9eac=0x0;_0x2b9eac<_0x2d4439[_0x3684('0x52')]['length'];_0x2b9eac++){var _0x2d4fe2=_0x2d4439[_0x3684('0x52')][_0x2b9eac];var _0x22a56a='i';var _0xb8ba4f=_[_0x3684('0x53')](_0x164594,['name',_0x2d4fe2[_0x3684('0x3a')]]);if(!_0xb8ba4f){switch(_0x2d4fe2[_0x3684('0x3a')]){case'unreadMessages':if(_0x2d4fe2[_0x3684('0x54')]==0x1){_0x30672f[_0x3684('0x55')]('`'+_0x2d4fe2[_0x3684('0x3a')]+'`\x20=\x200');}else{_0x30672f['having']('`'+_0x2d4fe2[_0x3684('0x3a')]+'`\x20>\x200');}break;case _0x3684('0x56'):if(_0x2d4fe2[_0x3684('0x57')]==='$substring'){if(_0x2d4fe2['value'][_0x3684('0x58')]('\x20')[_0x3684('0x35')]>0x1){_0x41af3d[_0x5a998d](_0x3684('0x59'),qs['getFullTextValue'](_0x2d4fe2[_0x3684('0x54')]),null);}else{var _0x9d8249='%'+_0x2d4fe2['value']+'%';_0x41af3d[_0x5a998d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x9d8249,_0x9d8249,_0x9d8249);}}else{_0xb8ba4f=_[_0x3684('0x53')](_0x164594,['name',_0x3684('0x5a')]);_0x2d4fe2[_0x3684('0x3a')]=_0x3684('0x5a');_0x1cd613=as[_0x3684('0x5b')](_0x22a56a,_0xb8ba4f['type'],_0x2d4fe2);_0x41af3d[_0x5a998d](_0x1cd613[_0x3684('0x5c')],_0x1cd613[_0x3684('0x54')][_0x3684('0x5d')],_0x1cd613[_0x3684('0x54')][_0x3684('0x12')]);}break;case'Tag':var _0x250830=_0x2d4fe2[_0x3684('0x54')][_0x3684('0x58')](',')[_0x3684('0x1f')](function(_0x2acf84){return Number(_0x2acf84);});_0x250830['forEach'](function(_0x376b25){_0x2306d1['or'](_0x3684('0x5e'),'%,'+_0x376b25+',%');});_0x42f1ca=_[_0x3684('0x5f')](_0x42f1ca,_0x250830);break;case _0x3684('0x60'):if(_0x2d4fe2[_0x3684('0x57')]===_0x3684('0x61')){_0x41af3d[_0x5a998d](_0x3684('0x62'),'%'+_0x2d4fe2[_0x3684('0x54')]+'%',null);}else{_0xb8ba4f=_[_0x3684('0x53')](_0x164594,['name',_0x3684('0x63')]);_0x2d4fe2[_0x3684('0x3a')]='UserId';_0x1cd613=as[_0x3684('0x5b')](_0x22a56a,_0xb8ba4f['type'],_0x2d4fe2);_0x41af3d[_0x5a998d](_0x1cd613[_0x3684('0x5c')],_0x1cd613['value']['start'],_0x1cd613[_0x3684('0x54')][_0x3684('0x12')]);}break;case'plainBody':_0x1cd613=as['buildExpression']('me',null,_0x2d4fe2);_0x41af3d[_0x5a998d](_0x1cd613['text'],_0x1cd613[_0x3684('0x54')][_0x3684('0x5d')],_0x1cd613[_0x3684('0x54')][_0x3684('0x12')]);break;}}else{var _0x1cd613=as[_0x3684('0x5b')](_0x22a56a,_0xb8ba4f[_0x3684('0x2d')],_0x2d4fe2);_0x41af3d[_0x5a998d](_0x1cd613[_0x3684('0x5c')],_0x1cd613[_0x3684('0x54')][_0x3684('0x5d')],_0x1cd613[_0x3684('0x54')][_0x3684('0x12')]);}}}else{var _0x566fee=_(_0x23e139[_0x3684('0x30')])[_0x3684('0x31')]()[_0x3684('0x1f')](function(_0x85964d){return _['some'](_0x164594,[_0x3684('0x1c'),_0x85964d])?_0x85964d:undefined;})[_0x3684('0x64')]()[_0x3684('0x54')]();if(!_[_0x3684('0x65')](_0x566fee)){_0x566fee[_0x3684('0x22')](function(_0x58ef24){if(_0x58ef24===_0x3684('0x66')){_0x30672f[_0x3684('0x67')](_0x3684('0x68'),[][_0x3684('0x69')](_0x23e139[_0x3684('0x30')][_0x58ef24]));}else if(_0x58ef24==='createdAt'){var _0x31e5a1=JSON['parse'](_0x23e139[_0x3684('0x30')][_0x58ef24])[_0x3684('0x6a')];var _0x1b3ba9=JSON[_0x3684('0x6b')](_0x23e139[_0x3684('0x30')][_0x58ef24])['$lte'];_0x30672f[_0x3684('0x67')](_0x3684('0x6c'),_0x31e5a1,_0x1b3ba9);}else{if(_0x23e139[_0x3684('0x30')][_0x58ef24]===_0x3684('0x6d')){_0x30672f['where']('i.'+_0x58ef24+_0x3684('0x6e'));}else{_0x30672f[_0x3684('0x67')]('i.'+_0x58ef24+_0x3684('0x6f'),_0x23e139['query'][_0x58ef24]);}}});}if(_0x23e139[_0x3684('0x30')][_0x3684('0x70')]){if(_0x23e139[_0x3684('0x30')][_0x3684('0x70')]==0x1){_0x30672f[_0x3684('0x55')](_0x3684('0x71'));}else{_0x30672f[_0x3684('0x55')](_0x3684('0x72'));}}if(_0x23e139[_0x3684('0x30')][_0x3684('0x73')]){_0x42f1ca=_[_0x3684('0x74')](_0x23e139[_0x3684('0x30')][_0x3684('0x73')])?_0x23e139[_0x3684('0x30')]['tag']:new Array(_0x23e139[_0x3684('0x30')][_0x3684('0x73')]);_0x42f1ca[_0x3684('0x22')](function(_0x572e16){_0x2306d1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x572e16+',%');});}if(_0x23e139[_0x3684('0x30')]['filter']){var _0x75844d=_0x23e139[_0x3684('0x30')][_0x3684('0x75')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x3684('0x76')](_0x75844d)){_0x41af3d['or'](_0x3684('0x77'),_0x75844d+'%');}else if(qs[_0x3684('0x78')](_0x75844d)){_0x41af3d['or']('c.email\x20LIKE\x20?',_0x75844d+'%');}else{_0x41af3d['or'](_0x3684('0x79'),qs[_0x3684('0x7a')](_0x75844d))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3684('0x7a')](_0x75844d));}}}_0x30672f[_0x3684('0x67')](_0x41af3d);_0x30672f['group'](_0x3684('0x7b'));var _0x5d4025={'type':db[_0x3684('0x7c')][_0x3684('0x7d')][_0x3684('0x7e')],'raw':!![]};var _0x5658b8=_0x30672f[_0x3684('0x7f')]();_0x5658b8[_0x3684('0x3a')](_0x3684('0x7b'));_0x5658b8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1eec02[_0x3684('0x37')]){_0x1eec02[_0x3684('0x37')][_0x3684('0x22')](function(_0x4fd9ff){var _0x1a0d7d=_0x4fd9ff[0x0]===_0x3684('0x80')?_0x4fd9ff[0x0]:'i.'+_0x4fd9ff[0x0];_0x30672f[_0x3684('0x37')](_0x1a0d7d,_0x4fd9ff[0x1]===_0x3684('0x81')?![]:!![]);});}if(!_[_0x3684('0x65')](_0x42f1ca)){_0x30672f[_0x3684('0x55')](_0x2306d1);_0x5658b8[_0x3684('0x67')]('t.id\x20IN\x20?',_0x42f1ca);}BPromise[_0x3684('0x82')]()[_0x3684('0x1b')](function(){if(!_0x2d4439){if(_0x23e139['query'][_0x3684('0x66')])return;_0x5658b8[_0x3684('0x67')](_0x3684('0x83'));_0x30672f['where'](_0x3684('0x83'));return;}if(_0x23e139[_0x3684('0x84')][_0x3684('0x85')]!==_0x3684('0x86'))return;return _0x23e139[_0x3684('0x84')][_0x3684('0x87')]({'attributes':['id'],'raw':!![]})[_0x3684('0x1b')](function(_0x8aac73){if(_[_0x3684('0x65')](_0x8aac73)){_0x5658b8[_0x3684('0x67')](_0x3684('0x88'));_0x30672f['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x5658b8[_0x3684('0x67')](_0x3684('0x68'),_[_0x3684('0x1f')](_0x8aac73,'id'));_0x30672f['where'](_0x3684('0x68'),_[_0x3684('0x1f')](_0x8aac73,'id'));}});})['then'](function(){if(_0x23e139[_0x3684('0x84')]['role']===_0x3684('0x86')&&!_0x2d4439&&!_0x23e139[_0x3684('0x30')]['MailAccountId'])return[];return db[_0x3684('0x89')][_0x3684('0x30')](_0x5658b8[_0x3684('0x8a')](),_0x5d4025);})[_0x3684('0x1b')](function(_0x2d884e){_0x540a21[_0x3684('0x16')]=_0x2d884e[_0x3684('0x35')];if(_0x540a21['count']===0x0)return[];return db[_0x3684('0x89')][_0x3684('0x30')](_0x3e0cd8[_0x3684('0x8a')](),_0x5d4025)['then'](function(_0x48e939){_0x587b22=_[_0x3684('0x8b')](_0x48e939,'id');_0x5d4025=_['merge'](_0x5d4025,{'model':db[_0x3684('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23e139[_0x3684('0x30')][_0x3684('0x8c')]){_0x1eec02['attributes'][_0x3684('0x22')](function(_0x544443){_0x30672f['field']('i.'+_0x544443);});}else{_0x30672f[_0x3684('0x3a')](_0x3684('0x8d'),_0x3684('0x8e'));_0x30672f[_0x3684('0x3a')]('a.key',_0x3684('0x8f'));_0x30672f[_0x3684('0x3a')](_0x3684('0x90'),_0x3684('0x91'));_0x30672f[_0x3684('0x3a')](_0x3684('0x92'),_0x3684('0x80'));_0x30672f[_0x3684('0x3a')](_0x3684('0x7b'));_0x30672f['field'](_0x3684('0x93'));_0x30672f[_0x3684('0x3a')]('i.updatedAt');_0x30672f[_0x3684('0x3a')](_0x3684('0x94'));_0x30672f[_0x3684('0x3a')](_0x3684('0x95'));_0x30672f['field']('i.attach');_0x30672f['field'](_0x3684('0x96'));_0x30672f[_0x3684('0x3a')]('i.lastMsgDirection');_0x30672f['field']('i.subject');_0x30672f[_0x3684('0x3a')](_0x3684('0x97'));_0x30672f[_0x3684('0x3a')](_0x3684('0x98'));_0x30672f[_0x3684('0x3a')]('i.thirdDisposition');_0x30672f[_0x3684('0x3a')](_0x3684('0x99'));_0x30672f[_0x3684('0x3a')]('i.to');_0x30672f[_0x3684('0x3a')](_0x3684('0x9a'));_0x30672f[_0x3684('0x3a')](_0x3684('0x9b'));_0x30672f[_0x3684('0x3a')](_0x3684('0x9c'));_0x30672f['field'](_0x3684('0x9d'),'Contact.firstName');_0x30672f[_0x3684('0x3a')](_0x3684('0x9e'),_0x3684('0x9f'));_0x30672f[_0x3684('0x3a')]('c.email','Contact.email');_0x30672f[_0x3684('0x3a')]('c.phone','Contact.phone');_0x30672f[_0x3684('0x3a')](_0x3684('0xa0'),_0x3684('0xa1'));_0x30672f[_0x3684('0x3a')](_0x3684('0xa2'),_0x3684('0xa3'));_0x30672f[_0x3684('0x3a')](_0x3684('0xa4'),_0x3684('0xa5'));_0x30672f[_0x3684('0x3a')](_0x3684('0xa6'),_0x3684('0xa7'));_0x30672f[_0x3684('0x3a')](_0x3684('0xa8'),_0x3684('0x24'));}if(_0x1eec02[_0x3684('0x15')])_0x30672f[_0x3684('0x15')](_0x1eec02[_0x3684('0x15')]);if(_0x1eec02[_0x3684('0x17')])_0x30672f['offset'](_0x1eec02['offset']);return db['sequelize'][_0x3684('0x30')](_0x30672f[_0x3684('0x8a')](),_0x5d4025);})[_0x3684('0x1b')](function(_0x3950ae){if(_0x3950ae['length']>0x0)_0x1dc14d[_0x3684('0x67')]('ui.MailInteractionId\x20IN\x20?',_[_0x3684('0x1f')](_0x3950ae,'id'));return db[_0x3684('0x89')][_0x3684('0x30')](_0x1dc14d[_0x3684('0x8a')](),_0x5d4025)[_0x3684('0x1b')](function(_0x4ab4e1){var _0xa4c26c=_[_0x3684('0xa9')](_0x4ab4e1,_0x3684('0xaa'));var _0x4d561c=[];return db[_0x3684('0xab')][_0x3684('0x26')]({'attributes':[_0x3684('0xac')],'raw':!![]})['then'](function(_0x370efa){var _0x4e7c93=_0x370efa[_0x3684('0xac')];_0x3950ae['forEach'](function(_0x527213){_0x4d561c['push'](updateMailInteraction(_0x527213,_0x587b22,_0xa4c26c,_0x4e7c93));});return BPromise[_0x3684('0xad')](_0x4d561c);});});});})['then'](function(_0x2c9775){_0x540a21['rows']=_0x2c9775;return _0x540a21;})[_0x3684('0x1b')](respondWithFilteredResult(_0x4317b7,_0x1eec02))[_0x3684('0x29')](handleError(_0x4317b7,null));};exports[_0x3684('0xae')]=function(_0x19984e,_0x1d0bcb){var _0x379a95={'raw':![],'where':{'id':_0x19984e['params']['id']}},_0x282764={};_0x282764['model']=_['keys'](db['MailInteraction'][_0x3684('0x2b')]);_0x282764[_0x3684('0x30')]=_['keys'](_0x19984e['query']);_0x282764[_0x3684('0x32')]=_[_0x3684('0x33')](_0x282764[_0x3684('0x2f')],_0x282764[_0x3684('0x30')]);_0x379a95[_0x3684('0x34')]=_[_0x3684('0x33')](_0x282764['model'],qs[_0x3684('0x8c')](_0x19984e[_0x3684('0x30')][_0x3684('0x8c')]));_0x379a95[_0x3684('0x34')]=_0x379a95['attributes'][_0x3684('0x35')]?_0x379a95[_0x3684('0x34')]:_0x282764['model'];if(_0x19984e[_0x3684('0x30')][_0x3684('0xaf')]){_0x379a95[_0x3684('0xb0')]=[{'all':!![]}];}_0x379a95=_[_0x3684('0xb1')]({},_0x379a95,_0x19984e['options']);return db[_0x3684('0x2a')][_0x3684('0x53')](_0x379a95)[_0x3684('0x1b')](handleEntityNotFound(_0x1d0bcb,null))[_0x3684('0x1b')](respondWithResult(_0x1d0bcb,null))[_0x3684('0x29')](handleError(_0x1d0bcb,null));};exports[_0x3684('0xb2')]=function(_0x33ef14,_0x432cbc){return db[_0x3684('0x2a')][_0x3684('0xb2')](_0x33ef14[_0x3684('0xb3')],{})[_0x3684('0x1b')](respondWithResult(_0x432cbc,0xc9))[_0x3684('0x29')](handleError(_0x432cbc,null));};exports[_0x3684('0xb4')]=function(_0x1eac63,_0xf28dd6){if(_0x1eac63[_0x3684('0xb3')]['id']){delete _0x1eac63['body']['id'];}return db[_0x3684('0x2a')][_0x3684('0x53')]({'where':{'id':_0x1eac63[_0x3684('0xb5')]['id']}})[_0x3684('0x1b')](handleEntityNotFound(_0xf28dd6,null))['then'](saveUpdates(_0x1eac63[_0x3684('0xb3')],null))['then'](respondWithResult(_0xf28dd6,null))[_0x3684('0x29')](handleError(_0xf28dd6,null));};exports[_0x3684('0x1a')]=function(_0x5a231d,_0x4bd9a2){return db[_0x3684('0x2a')][_0x3684('0x53')]({'where':{'id':_0x5a231d['params']['id']}})['then'](handleEntityNotFound(_0x4bd9a2,null))['then'](removeEntity(_0x4bd9a2,null))[_0x3684('0x29')](handleError(_0x4bd9a2,null));};exports[_0x3684('0xb6')]=function(_0x24a9c1,_0x1cccc5){return db[_0x3684('0x2a')][_0x3684('0xb6')]()[_0x3684('0x1b')](respondWithResult(_0x1cccc5,null))[_0x3684('0x29')](handleError(_0x1cccc5,null));};exports[_0x3684('0xb7')]=function(_0x2c2f74,_0x2f0c3a){return db[_0x3684('0x25')][_0x3684('0x53')]({'where':{'id':_0x2c2f74[_0x3684('0xb5')]['id']}})[_0x3684('0x1b')](handleEntityNotFound(_0x2f0c3a,null))['then'](function(_0x18e406){if(_0x18e406){return _0x18e406[_0x3684('0xb7')](_0x2c2f74[_0x3684('0xb3')]['ids'],_[_0x3684('0xb8')](_0x2c2f74[_0x3684('0xb3')],[_0x3684('0xb9'),'id'])||{});}})[_0x3684('0x1b')](respondWithResult(_0x2f0c3a,null))[_0x3684('0x29')](handleError(_0x2f0c3a,null));};exports[_0x3684('0xba')]=function(_0x10b2ab,_0x11355d){var _0x5a9480={'raw':![],'where':{}};var _0x10c100={};var _0x50914c={'count':0x0,'rows':[]};return db['MailInteraction'][_0x3684('0x26')]({'where':{'id':_0x10b2ab['params']['id']}})['then'](handleEntityNotFound(_0x11355d,null))[_0x3684('0x1b')](function(_0x25f7d2){if(_0x25f7d2){_0x10c100[_0x3684('0x2f')]=_[_0x3684('0x31')](db[_0x3684('0x25')][_0x3684('0x2b')]);_0x10c100['query']=_[_0x3684('0x31')](_0x10b2ab[_0x3684('0x30')]);_0x10c100[_0x3684('0x32')]=_['intersection'](_0x10c100[_0x3684('0x2f')],_0x10c100[_0x3684('0x30')]);_0x5a9480[_0x3684('0x34')]=_['intersection'](_0x10c100[_0x3684('0x2f')],qs[_0x3684('0x8c')](_0x10b2ab['query'][_0x3684('0x8c')]));_0x5a9480[_0x3684('0x34')]=_0x5a9480['attributes'][_0x3684('0x35')]?_0x5a9480[_0x3684('0x34')]:_0x10c100[_0x3684('0x2f')];if(!_0x10b2ab[_0x3684('0x30')]['hasOwnProperty']('nolimit')){_0x5a9480[_0x3684('0x15')]=qs[_0x3684('0x15')](_0x10b2ab[_0x3684('0x30')][_0x3684('0x15')]);_0x5a9480[_0x3684('0x17')]=qs['offset'](_0x10b2ab[_0x3684('0x30')][_0x3684('0x17')]);}_0x5a9480['order']=qs[_0x3684('0x38')](_0x10b2ab[_0x3684('0x30')][_0x3684('0x38')]);_0x5a9480[_0x3684('0x67')]=qs[_0x3684('0x32')](_[_0x3684('0x39')](_0x10b2ab[_0x3684('0x30')],_0x10c100[_0x3684('0x32')]));_0x5a9480[_0x3684('0x67')][_0x3684('0xaa')]=_0x25f7d2['id'];if(_0x10b2ab[_0x3684('0x30')]['filter']){_0x5a9480[_0x3684('0x67')]=_[_0x3684('0xb1')](_0x5a9480[_0x3684('0x67')],{'$or':_['map'](_0x5a9480[_0x3684('0x34')],function(_0x5d3d55){var _0x10c40a={};_0x10c40a[_0x5d3d55]={'$like':'%'+_0x10b2ab['query'][_0x3684('0x75')]+'%'};return _0x10c40a;})});}if(_0x10b2ab['query']['$gte']){var _0x9031b4=_0x10b2ab[_0x3684('0x30')][_0x3684('0x6a')][_0x3684('0x58')](',');var _0xd3dcdc={};_0xd3dcdc[_0x9031b4[0x0]]={'$gte':moment(_0x9031b4[0x1])[_0x3684('0xbb')](_0x3684('0xbc'))};_0x5a9480[_0x3684('0x67')]=_[_0x3684('0xb1')](_0x5a9480[_0x3684('0x67')],_0xd3dcdc);}_0x5a9480=_[_0x3684('0xb1')]({},_0x5a9480,_0x10b2ab['options']);return db[_0x3684('0x25')][_0x3684('0x16')]({'where':_0x5a9480[_0x3684('0x67')]})[_0x3684('0x1b')](function(_0x32b309){_0x50914c[_0x3684('0x16')]=_0x32b309;if(_0x10b2ab[_0x3684('0x30')][_0x3684('0xaf')]){_0x5a9480[_0x3684('0xb0')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x5a9480);})['then'](function(_0x3a1448){if(_0x10b2ab['query'][_0x3684('0xbd')]===_0x3684('0xbe')){for(var _0x1fda24=0x0;_0x1fda24<_0x3a1448[_0x3684('0x35')];_0x1fda24++){_0x3a1448[_0x1fda24][_0x3684('0xb3')]=juice(_0x3a1448[_0x1fda24][_0x3684('0xb3')]);}}_0x50914c[_0x3684('0xbf')]=_0x3a1448;return _0x50914c;});}})[_0x3684('0x1b')](respondWithFilteredResult(_0x11355d,_0x5a9480))[_0x3684('0x29')](handleError(_0x11355d,null));};exports[_0x3684('0xc0')]=function(_0x1740b6,_0xc8792a){return db['MailInteraction'][_0x3684('0x53')]({'where':{'id':_0x1740b6[_0x3684('0xb5')]['id']}})[_0x3684('0x1b')](handleEntityNotFound(_0xc8792a,null))['then'](function(_0xe6422b){if(_0xe6422b){return _0xe6422b[_0x3684('0xc1')](_0x1740b6[_0x3684('0xb3')]['ids'],_['omit'](_0x1740b6['body'],['ids','id'])||{})['spread'](function(){return db[_0x3684('0xc2')][_0x3684('0xc3')]({'attributes':['id',_0x3684('0x1c'),_0x3684('0xc4')],'where':{'id':_0x1740b6['body'][_0x3684('0xb9')]}});})[_0x3684('0x1b')](function(_0x3a52da){socket[_0x3684('0xc5')](_0x3684('0xc6'),{'id':Number(_0x1740b6[_0x3684('0xb5')]['id']),'tags':_0x3a52da||[]});return{'id':Number(_0x1740b6[_0x3684('0xb5')]['id']),'tags':_0x3a52da||[]};});}})[_0x3684('0x1b')](respondWithResult(_0xc8792a,null))[_0x3684('0x29')](handleError(_0xc8792a,null));};exports[_0x3684('0xc7')]=function(_0x1200da,_0x5b62b3){return db['MailInteraction'][_0x3684('0x53')]({'where':{'id':_0x1200da['params']['id']}})[_0x3684('0x1b')](handleEntityNotFound(_0x5b62b3,null))[_0x3684('0x1b')](function(_0x9b84a1){if(_0x9b84a1){return _0x9b84a1[_0x3684('0xc7')](_0x1200da[_0x3684('0x30')][_0x3684('0xb9')]);}})[_0x3684('0x1b')](respondWithStatusCode(_0x5b62b3,null))['catch'](handleError(_0x5b62b3,null));};exports[_0x3684('0xc8')]=function(_0x274a05,_0x25560f){var _0x568d80=moment()[_0x3684('0xc9')]()[_0x3684('0x8a')]();var _0x2aebb5=path[_0x3684('0xca')](config[_0x3684('0xcb')],'server',_0x3684('0xcc'),_0x3684('0xcd'));var _0xe8b0b8=path[_0x3684('0xca')](config[_0x3684('0xcb')],_0x3684('0xce'),_0x3684('0xcc'),'attachments');var _0x42b834=path['join'](_0x2aebb5,_0x568d80);var _0x566799=util[_0x3684('0xbb')]('transcript-%d-%s.zip',_0x274a05[_0x3684('0xb5')]['id'],_0x568d80);var _0x2ae014=path['join'](_0x2aebb5,_0x566799);var _0x2850bd=[];if(_0x274a05['query'][_0x3684('0xcf')]){_0x2850bd['push']({'model':db['Attachment'],'as':_0x3684('0xd0'),'raw':!![]});}var _0x472790=[{'model':db[_0x3684('0x25')],'as':_0x3684('0xd1'),'attributes':['id',_0x3684('0xb3'),_0x3684('0x3b'),'to','cc',_0x3684('0xd2'),'subject',_0x3684('0xd3')],'where':{'secret':![]},'order':qs[_0x3684('0x38')]('id'),'include':_0x2850bd}];return db[_0x3684('0x2a')]['find']({'where':{'id':_0x274a05['params']['id']},'include':_0x472790})[_0x3684('0x1b')](handleEntityNotFound(_0x25560f,null))['then'](function(_0x34b0dc){if(_0x34b0dc&&_0x34b0dc['Messages']){var _0x5cab04=_0x34b0dc[_0x3684('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x42b834);return BPromise['each'](_0x5cab04[_0x3684('0xd1')],function(_0x398395,_0x5a2953){var _0x482837={'from':_0x398395[_0x3684('0x3b')],'to':_0x398395['to'],'subject':_0x398395[_0x3684('0xd5')],'html':htmlEntities[_0x3684('0xd6')](_0x398395[_0x3684('0xb3')]),'headers':{'Date':moment(_0x398395[_0x3684('0xd3')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x398395['cc']){_0x482837[_0x3684('0xd7')]['Cc']=_0x398395['cc'];}if(_0x398395[_0x3684('0xd2')]){_0x482837[_0x3684('0xd7')][_0x3684('0xd8')]=_0x398395[_0x3684('0xd2')];}return new BPromise(function(_0x46a15a,_0x2905c4){if(_0x398395[_0x3684('0xd0')]){for(var _0x164a97=0x0;_0x164a97<_0x398395[_0x3684('0xd0')][_0x3684('0x35')];_0x164a97++){var _0x2a19c7=_0x398395['Attachments'][_0x164a97];var _0x55c67b=path[_0x3684('0xca')](_0xe8b0b8,_0x2a19c7[_0x3684('0xd9')]);if(fs[_0x3684('0xda')](_0x55c67b)){_0x482837[_0x3684('0xcf')][_0x3684('0x23')]({'name':_0x2a19c7['name'],'contentType':_0x2a19c7[_0x3684('0x2d')],'data':fs[_0x3684('0xdb')](_0x55c67b)});}}}emlformat[_0x3684('0xdc')](_0x482837,function(_0x51eba9,_0x202744){if(_0x51eba9)return _0x2905c4(_0x51eba9);fs['writeFileSync'](path[_0x3684('0xca')](_0x42b834,util['format'](_0x3684('0xdd'),_0x5a2953)),_0x202744);return _0x46a15a(_0x202744);});});})[_0x3684('0x1b')](function(){return new BPromise(function(_0xef567d,_0x1a8bac){zipdir(_0x42b834,{'saveTo':_0x2ae014},function(_0x146a49,_0x56411e){if(_0x146a49)return _0x1a8bac(_0x146a49);return _0xef567d(_0x56411e);});})[_0x3684('0x1b')](function(){return new BPromise(function(_0x325c0e,_0x42d69c){rimraf(_0x42b834,function(_0x39e63f){if(_0x39e63f)_0x42d69c(_0x39e63f);return _0x325c0e();});});})[_0x3684('0x1b')](function(){return _0x25560f[_0x3684('0xc8')](_0x2ae014,_0x566799,function(_0x5b5a44){if(!_0x5b5a44)fs[_0x3684('0xde')](_0x2ae014);});});});}else{return _0x25560f[_0x3684('0x10')](0xc8);}})['catch'](handleError(_0x25560f,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 61c83a6..70fb966 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 _0xa1db=['findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x1e0d29,_0x1f5fab){var _0x4d395c=function(_0x30533d){while(--_0x30533d){_0x1e0d29['push'](_0x1e0d29['shift']());}};_0x4d395c(++_0x1f5fab);}(_0xa1db,0x15a));var _0xba1d=function(_0x4814a7,_0x1a084d){_0x4814a7=_0x4814a7-0x0;var _0x406700=_0xa1db[_0x4814a7];return _0x406700;};'use strict';var EventEmitter=require(_0xba1d('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xba1d('0x1')];var MailMessage=require(_0xba1d('0x2'))['db'][_0xba1d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xba1d('0x4')](0x0);var events={'afterCreate':_0xba1d('0x5'),'afterUpdate':_0xba1d('0x6'),'afterDestroy':_0xba1d('0x7')};function emitEvent(_0x3d7805){return function(_0x2ed2b9,_0xc525f9,_0x54c5b1){_0x2ed2b9[_0xba1d('0x8')]({'attributes':['id'],'raw':!![]})[_0xba1d('0x9')](function(_0x51cdbd){_0x2ed2b9[_0xba1d('0xa')]('Users',_0x51cdbd['map'](function(_0x22753a){return{'id':_0x22753a['id']};}));return MailMessage[_0xba1d('0xb')]({'where':{'MailInteractionId':_0x2ed2b9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xba1d('0x9')](function(_0x4c1f7d){_0x2ed2b9[_0xba1d('0xa')](_0xba1d('0xc'),_0x4c1f7d['length']);MailInteractionEvents[_0xba1d('0xd')](_0x3d7805+':'+_0x2ed2b9['id'],_0x2ed2b9);MailInteractionEvents[_0xba1d('0xd')](_0x3d7805,_0x2ed2b9);_0x54c5b1(null);})[_0xba1d('0xe')](_0x54c5b1(null));};}for(var e in events){if(events[_0xba1d('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xba1d('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x8202=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length'];(function(_0x223b88,_0x294ff0){var _0x5b68c5=function(_0xbfbbc6){while(--_0xbfbbc6){_0x223b88['push'](_0x223b88['shift']());}};_0x5b68c5(++_0x294ff0);}(_0x8202,0x1ba));var _0x2820=function(_0x3e577,_0x2bcf5f){_0x3e577=_0x3e577-0x0;var _0x140487=_0x8202[_0x3e577];return _0x140487;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x2820('0x0'))['db'][_0x2820('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2820('0x2')](0x0);var events={'afterCreate':_0x2820('0x3'),'afterUpdate':_0x2820('0x4'),'afterDestroy':_0x2820('0x5')};function emitEvent(_0x377b11){return function(_0x26b909,_0x19efb3,_0x1af1d8){_0x26b909[_0x2820('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4e570b){_0x26b909[_0x2820('0x7')](_0x2820('0x8'),_0x4e570b[_0x2820('0x9')](function(_0x6ae46){return{'id':_0x6ae46['id']};}));return MailMessage[_0x2820('0xa')]({'where':{'MailInteractionId':_0x26b909['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2820('0xb')](function(_0xbbd5fb){_0x26b909[_0x2820('0x7')](_0x2820('0xc'),_0xbbd5fb[_0x2820('0xd')]);MailInteractionEvents[_0x2820('0xe')](_0x377b11+':'+_0x26b909['id'],_0x26b909);MailInteractionEvents[_0x2820('0xe')](_0x377b11,_0x26b909);_0x1af1d8(null);})[_0x2820('0xf')](_0x1af1d8(null));};}for(var e in events){if(events[_0x2820('0x10')](e)){var event=events[e];MailInteraction[_0x2820('0x11')](e,emitEvent(event));}}module[_0x2820('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index ce2b254..16721da 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 _0xaea0=['substatus','format','closedAt','changed','substatusAt','YYYY-MM-DD\x20HH:mm:ss','models','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','mail_interactions','fti_mail_interactions','subject','FULLTEXT'];(function(_0x11ba71,_0x3d9aee){var _0x248f78=function(_0x173dea){while(--_0x173dea){_0x11ba71['push'](_0x11ba71['shift']());}};_0x248f78(++_0x3d9aee);}(_0xaea0,0x11e));var _0x0aea=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0xaea0[_0xa1e3ca];return _0x5005ab;};'use strict';var _=require(_0x0aea('0x0'));var util=require(_0x0aea('0x1'));var logger=require(_0x0aea('0x2'))(_0x0aea('0x3'));var moment=require(_0x0aea('0x4'));var BPromise=require(_0x0aea('0x5'));var rp=require(_0x0aea('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0aea('0x7'));var attributes=require(_0x0aea('0x8'));module['exports']=function(_0x13a790,_0x101bff){return _0x13a790['define']('MailInteraction',attributes,{'tableName':_0x0aea('0x9'),'paranoid':![],'indexes':[{'name':_0x0aea('0xa'),'fields':[_0x0aea('0xb'),'to'],'type':_0x0aea('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3a1395,_0x3a79dc,_0x343fa1){if(_0x3a1395[_0x0aea('0xd')]){_0x3a1395['substatusAt']=moment()[_0x0aea('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3a1395['closed']){_0x3a1395[_0x0aea('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x343fa1(null,_0x3a79dc);},'beforeUpdate':function(_0x5cb805,_0x4cd238,_0x41c8b8){if(_0x5cb805[_0x0aea('0x10')](_0x0aea('0xd'))){_0x5cb805[_0x0aea('0x11')]=_0x5cb805[_0x0aea('0xd')]?moment()[_0x0aea('0xe')](_0x0aea('0x12')):null;}if(_0x5cb805[_0x0aea('0x10')]('closed')){_0x5cb805[_0x0aea('0xf')]=moment()[_0x0aea('0xe')](_0x0aea('0x12'));_0x5cb805[_0x0aea('0xd')]=null;_0x5cb805[_0x0aea('0x11')]=null;}_0x41c8b8(null,_0x5cb805);},'afterUpdate':function(_0x46f104,_0x396f56,_0x3e3b5c){var _0x53668b=_0x13a790[_0x0aea('0x13')];var _0x2d98ec=_0x46f104['get']({'plain':!![]});if(_0x2d98ec['closed']){return _0x53668b['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x2d98ec['id']}})[_0x0aea('0x14')](function(){_0x3e3b5c();})[_0x0aea('0x15')](function(_0x23f926){_0x3e3b5c(_0x23f926);});}else{_0x3e3b5c();}}},'charset':_0x0aea('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8290=['path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise'];(function(_0x19ce19,_0x27d96d){var _0x398c75=function(_0x5e5f28){while(--_0x5e5f28){_0x19ce19['push'](_0x19ce19['shift']());}};_0x398c75(++_0x27d96d);}(_0x8290,0x164));var _0x0829=function(_0x38578a,_0x39b7a7){_0x38578a=_0x38578a-0x0;var _0x3ca93b=_0x8290[_0x38578a];return _0x3ca93b;};'use strict';var _=require(_0x0829('0x0'));var util=require(_0x0829('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0829('0x2'));var rp=require(_0x0829('0x3'));var fs=require('fs');var path=require(_0x0829('0x4'));var rimraf=require(_0x0829('0x5'));var config=require(_0x0829('0x6'));var attributes=require(_0x0829('0x7'));module[_0x0829('0x8')]=function(_0x4d787d,_0x2c6d97){return _0x4d787d['define'](_0x0829('0x9'),attributes,{'tableName':_0x0829('0xa'),'paranoid':![],'indexes':[{'name':_0x0829('0xb'),'fields':['subject','to'],'type':_0x0829('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x125a69,_0x599a51,_0x541241){if(_0x125a69[_0x0829('0xd')]){_0x125a69[_0x0829('0xe')]=moment()[_0x0829('0xf')](_0x0829('0x10'));}if(_0x125a69[_0x0829('0x11')]){_0x125a69[_0x0829('0x12')]=moment()['format'](_0x0829('0x10'));}_0x541241(null,_0x599a51);},'beforeUpdate':function(_0x42936a,_0x52d3b5,_0x32b12b){if(_0x42936a['changed'](_0x0829('0xd'))){_0x42936a['substatusAt']=_0x42936a[_0x0829('0xd')]?moment()[_0x0829('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x42936a[_0x0829('0x13')](_0x0829('0x11'))){_0x42936a[_0x0829('0x12')]=moment()['format'](_0x0829('0x10'));_0x42936a[_0x0829('0xd')]=null;_0x42936a[_0x0829('0xe')]=null;}_0x32b12b(null,_0x42936a);},'afterUpdate':function(_0x387a3e,_0x2dcfb2,_0xbffcf8){var _0x1511f8=_0x4d787d['models'];var _0x4e78cc=_0x387a3e[_0x0829('0x14')]({'plain':!![]});if(_0x4e78cc[_0x0829('0x11')]){return _0x1511f8['MailMessage'][_0x0829('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x4e78cc['id']}})['then'](function(){_0xbffcf8();})['catch'](function(_0x40518a){_0xbffcf8(_0x40518a);});}else{_0xbffcf8();}}},'charset':_0x0829('0x16'),'collate':_0x0829('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 32faa10..4f995cb 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 _0x9906=['jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1f7789,_0x2be96a){var _0x58ac59=function(_0x5c6d8f){while(--_0x5c6d8f){_0x1f7789['push'](_0x1f7789['shift']());}};_0x58ac59(++_0x2be96a);}(_0x9906,0x1f1));var _0x6990=function(_0x38633c,_0x2444dc){_0x38633c=_0x38633c-0x0;var _0x3b2404=_0x9906[_0x38633c];return _0x3b2404;};'use strict';var _=require(_0x6990('0x0'));var util=require(_0x6990('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6990('0x2'));var fs=require('fs');var Redis=require(_0x6990('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6990('0x4'));var logger=require(_0x6990('0x5'))(_0x6990('0x6'));var config=require('../../config/environment');var jayson=require(_0x6990('0x7'));var client=jayson[_0x6990('0x8')][_0x6990('0x9')]({'port':0x232a});config['redis']=_[_0x6990('0xa')](config[_0x6990('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6990('0xc'))(new Redis(config[_0x6990('0xb')]));require(_0x6990('0xd'))['register'](socket);function respondWithRpcPromise(_0x2681cf,_0x51b028,_0x44d597){return new BPromise(function(_0x5afdfe,_0x412a0d){return client[_0x6990('0xe')](_0x2681cf,_0x44d597)[_0x6990('0xf')](function(_0x17f9b3){logger[_0x6990('0x10')](_0x6990('0x11'),_0x51b028,_0x6990('0x12'));logger[_0x6990('0x13')](_0x6990('0x14'),_0x51b028,_0x6990('0x12'),JSON[_0x6990('0x15')](_0x17f9b3));if(_0x17f9b3['error']){if(_0x17f9b3[_0x6990('0x16')][_0x6990('0x17')]===0x1f4){logger[_0x6990('0x16')]('MailInteraction,\x20%s,\x20%s',_0x51b028,_0x17f9b3[_0x6990('0x16')][_0x6990('0x18')]);return _0x412a0d(_0x17f9b3[_0x6990('0x16')][_0x6990('0x18')]);}logger[_0x6990('0x16')](_0x6990('0x11'),_0x51b028,_0x17f9b3[_0x6990('0x16')]['message']);return _0x5afdfe(_0x17f9b3['error'][_0x6990('0x18')]);}else{logger[_0x6990('0x10')](_0x6990('0x11'),_0x51b028,_0x6990('0x12'));_0x5afdfe(_0x17f9b3[_0x6990('0x19')][_0x6990('0x18')]);}})[_0x6990('0x1a')](function(_0x31cba5){logger[_0x6990('0x16')]('MailInteraction,\x20%s,\x20%s',_0x51b028,_0x31cba5);_0x412a0d(_0x31cba5);});});}exports[_0x6990('0x1b')]=function(_0x20dff8){var _0x57c9ad=this;return new Promise(function(_0x595c8e,_0x3e6044){return db[_0x6990('0x1c')]['update'](_0x20dff8[_0x6990('0x1d')],{'raw':_0x20dff8[_0x6990('0x1e')]?_0x20dff8[_0x6990('0x1e')][_0x6990('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20dff8['options']?_0x20dff8[_0x6990('0x1e')][_0x6990('0x20')]||null:null,'attributes':_0x20dff8[_0x6990('0x1e')]?_0x20dff8[_0x6990('0x1e')][_0x6990('0x21')]||null:null,'limit':_0x20dff8['options']?_0x20dff8['options'][_0x6990('0x22')]||null:null})['then'](function(_0x2d639f){logger[_0x6990('0x10')]('UpdateMailInteraction',_0x20dff8);logger[_0x6990('0x13')](_0x6990('0x1b'),_0x20dff8,JSON[_0x6990('0x15')](_0x2d639f));_0x595c8e(_0x2d639f);})[_0x6990('0x1a')](function(_0x36fd42){logger[_0x6990('0x16')](_0x6990('0x1b'),_0x36fd42[_0x6990('0x18')],_0x20dff8);_0x3e6044(_0x57c9ad[_0x6990('0x16')](0x1f4,_0x36fd42[_0x6990('0x18')]));});});};exports[_0x6990('0x23')]=function(_0x191aad){return new Promise(function(_0x4177ee,_0x4736fe){return db[_0x6990('0x1c')][_0x6990('0x24')]({'where':_0x191aad[_0x6990('0x1e')]?_0x191aad[_0x6990('0x1e')][_0x6990('0x20')]||null:null})[_0x6990('0xf')](function(_0x57e073){if(_0x57e073){return _0x57e073[_0x6990('0x25')](_0x191aad['body']['ids'],_[_0x6990('0x26')](_0x191aad[_0x6990('0x1d')],[_0x6990('0x27'),'id'])||{});}})[_0x6990('0x28')](function(_0x2b44ca){logger[_0x6990('0x10')](_0x6990('0x29'),_0x191aad);logger[_0x6990('0x13')](_0x6990('0x29'),_0x191aad,JSON[_0x6990('0x15')](_0x2b44ca));_0x4177ee(_0x2b44ca);})[_0x6990('0x1a')](function(_0xe8a957){logger['error']('AddTags',_0xe8a957['message'],_0x191aad);_0x4736fe(_this['error'](0x1f4,_0xe8a957[_0x6990('0x18')]));});});}; \ No newline at end of file +var _0x1fd9=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateMailInteraction','MailInteraction','update','body','options','attributes','limit','find','where','addTags','ids','omit','AddTags'];(function(_0x405385,_0x56f573){var _0x43837b=function(_0x30e20e){while(--_0x30e20e){_0x405385['push'](_0x405385['shift']());}};_0x43837b(++_0x56f573);}(_0x1fd9,0x19b));var _0x91fd=function(_0x50a38b,_0x1d6de3){_0x50a38b=_0x50a38b-0x0;var _0x2c9110=_0x1fd9[_0x50a38b];return _0x2c9110;};'use strict';var _=require(_0x91fd('0x0'));var util=require(_0x91fd('0x1'));var moment=require(_0x91fd('0x2'));var BPromise=require(_0x91fd('0x3'));var rs=require(_0x91fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x91fd('0x5'));var logger=require(_0x91fd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x91fd('0x7'));var client=jayson[_0x91fd('0x8')][_0x91fd('0x9')]({'port':0x232a});config[_0x91fd('0xa')]=_[_0x91fd('0xb')](config[_0x91fd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x91fd('0xc'))(new Redis(config['redis']));require(_0x91fd('0xd'))[_0x91fd('0xe')](socket);function respondWithRpcPromise(_0x434256,_0x14f69c,_0x5b4d56){return new BPromise(function(_0x4f711a,_0x1ce670){return client[_0x91fd('0xf')](_0x434256,_0x5b4d56)[_0x91fd('0x10')](function(_0x17d900){logger['info'](_0x91fd('0x11'),_0x14f69c,_0x91fd('0x12'));logger[_0x91fd('0x13')](_0x91fd('0x14'),_0x14f69c,_0x91fd('0x12'),JSON[_0x91fd('0x15')](_0x17d900));if(_0x17d900[_0x91fd('0x16')]){if(_0x17d900['error'][_0x91fd('0x17')]===0x1f4){logger[_0x91fd('0x16')]('MailInteraction,\x20%s,\x20%s',_0x14f69c,_0x17d900[_0x91fd('0x16')]['message']);return _0x1ce670(_0x17d900['error'][_0x91fd('0x18')]);}logger['error'](_0x91fd('0x11'),_0x14f69c,_0x17d900[_0x91fd('0x16')][_0x91fd('0x18')]);return _0x4f711a(_0x17d900[_0x91fd('0x16')]['message']);}else{logger[_0x91fd('0x19')](_0x91fd('0x11'),_0x14f69c,_0x91fd('0x12'));_0x4f711a(_0x17d900[_0x91fd('0x1a')]['message']);}})['catch'](function(_0x3110b4){logger[_0x91fd('0x16')]('MailInteraction,\x20%s,\x20%s',_0x14f69c,_0x3110b4);_0x1ce670(_0x3110b4);});});}exports[_0x91fd('0x1b')]=function(_0x4aa404){var _0x4cd402=this;return new Promise(function(_0x7aefe,_0x1b9d01){return db[_0x91fd('0x1c')][_0x91fd('0x1d')](_0x4aa404[_0x91fd('0x1e')],{'raw':_0x4aa404[_0x91fd('0x1f')]?_0x4aa404['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aa404[_0x91fd('0x1f')]?_0x4aa404[_0x91fd('0x1f')]['where']||null:null,'attributes':_0x4aa404[_0x91fd('0x1f')]?_0x4aa404[_0x91fd('0x1f')][_0x91fd('0x20')]||null:null,'limit':_0x4aa404['options']?_0x4aa404['options'][_0x91fd('0x21')]||null:null})['then'](function(_0x584dd2){logger[_0x91fd('0x19')](_0x91fd('0x1b'),_0x4aa404);logger['debug'](_0x91fd('0x1b'),_0x4aa404,JSON[_0x91fd('0x15')](_0x584dd2));_0x7aefe(_0x584dd2);})['catch'](function(_0x4e9f3a){logger['error'](_0x91fd('0x1b'),_0x4e9f3a[_0x91fd('0x18')],_0x4aa404);_0x1b9d01(_0x4cd402[_0x91fd('0x16')](0x1f4,_0x4e9f3a['message']));});});};exports['AddTagsToMailInteraction']=function(_0x13f28d){return new Promise(function(_0x4747dd,_0x45c7e0){return db[_0x91fd('0x1c')][_0x91fd('0x22')]({'where':_0x13f28d[_0x91fd('0x1f')]?_0x13f28d['options'][_0x91fd('0x23')]||null:null})['then'](function(_0x1d1205){if(_0x1d1205){return _0x1d1205[_0x91fd('0x24')](_0x13f28d['body'][_0x91fd('0x25')],_[_0x91fd('0x26')](_0x13f28d['body'],[_0x91fd('0x25'),'id'])||{});}})['spread'](function(_0x32c248){logger[_0x91fd('0x19')](_0x91fd('0x27'),_0x13f28d);logger['debug'](_0x91fd('0x27'),_0x13f28d,JSON[_0x91fd('0x15')](_0x32c248));_0x4747dd(_0x32c248);})[_0x91fd('0x28')](function(_0x59ed57){logger[_0x91fd('0x16')]('AddTags',_0x59ed57[_0x91fd('0x18')],_0x13f28d);_0x45c7e0(_this['error'](0x1f4,_0x59ed57[_0x91fd('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 83a78a3..aa3e380 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 _0xb936=['./mailInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x3a9f47,_0x206f4a){var _0x2bdda2=function(_0x9806aa){while(--_0x9806aa){_0x3a9f47['push'](_0x3a9f47['shift']());}};_0x2bdda2(++_0x206f4a);}(_0xb936,0x7e));var _0x6b93=function(_0x24e842,_0x458f85){_0x24e842=_0x24e842-0x0;var _0x4ad97e=_0xb936[_0x24e842];return _0x4ad97e;};'use strict';var MailInteractionEvents=require(_0x6b93('0x0'));var events=[_0x6b93('0x1'),_0x6b93('0x2'),'update'];function createListener(_0x38f552,_0xc5b6a2){return function(_0x1a02cd){_0xc5b6a2[_0x6b93('0x3')](_0x38f552,_0x1a02cd);};}function removeListener(_0x42c099,_0x5dab44){return function(){MailInteractionEvents[_0x6b93('0x4')](_0x42c099,_0x5dab44);};}exports[_0x6b93('0x5')]=function(_0x4f9a0c){for(var _0x4ef669=0x0,_0x23079c=events[_0x6b93('0x6')];_0x4ef669<_0x23079c;_0x4ef669++){var _0x20c577=events[_0x4ef669];var _0x552603=createListener('mailInteraction:'+_0x20c577,_0x4f9a0c);MailInteractionEvents['on'](_0x20c577,_0x552603);}}; \ No newline at end of file +var _0x369e=['emit','removeListener','register','length','mailInteraction:','save','remove'];(function(_0x543f70,_0x4d1373){var _0x19dd8c=function(_0x6ddf98){while(--_0x6ddf98){_0x543f70['push'](_0x543f70['shift']());}};_0x19dd8c(++_0x4d1373);}(_0x369e,0xf3));var _0xe369=function(_0x8956eb,_0x3ee779){_0x8956eb=_0x8956eb-0x0;var _0x14fbee=_0x369e[_0x8956eb];return _0x14fbee;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xe369('0x0'),_0xe369('0x1'),'update'];function createListener(_0xf116d2,_0x3acda5){return function(_0x45b342){_0x3acda5[_0xe369('0x2')](_0xf116d2,_0x45b342);};}function removeListener(_0x31730f,_0x2fcf66){return function(){MailInteractionEvents[_0xe369('0x3')](_0x31730f,_0x2fcf66);};}exports[_0xe369('0x4')]=function(_0x4d9491){for(var _0x415771=0x0,_0x469efe=events[_0xe369('0x5')];_0x415771<_0x469efe;_0x415771++){var _0x1d5388=events[_0x415771];var _0x31d6d8=createListener(_0xe369('0x6')+_0x1d5388,_0x4d9491);MailInteractionEvents['on'](_0x1d5388,_0x31d6d8);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 8e10596..0f561e2 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 _0xf485=['accept','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','get','/describe','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','create','put'];(function(_0x3e51f2,_0x23350d){var _0xa5c0e6=function(_0x41de04){while(--_0x41de04){_0x3e51f2['push'](_0x3e51f2['shift']());}};_0xa5c0e6(++_0x23350d);}(_0xf485,0xd1));var _0x5f48=function(_0x13d251,_0x100c82){_0x13d251=_0x13d251-0x0;var _0x514d79=_0xf485[_0x13d251];return _0x514d79;};'use strict';var multer=require(_0x5f48('0x0'));var util=require(_0x5f48('0x1'));var path=require(_0x5f48('0x2'));var timeout=require(_0x5f48('0x3'));var express=require(_0x5f48('0x4'));var router=express[_0x5f48('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5f48('0x6'));var interaction=require(_0x5f48('0x7'));var config=require('../../config/environment');var controller=require(_0x5f48('0x8'));router['get']('/',auth[_0x5f48('0x9')](),controller['index']);router[_0x5f48('0xa')](_0x5f48('0xb'),auth[_0x5f48('0x9')](),controller['describe']);router[_0x5f48('0xa')](_0x5f48('0xc'),auth[_0x5f48('0x9')](),controller['show']);router[_0x5f48('0xa')](_0x5f48('0xd'),auth[_0x5f48('0x9')](),controller[_0x5f48('0xe')]);router[_0x5f48('0xf')]('/',auth['isAuthenticated'](),interaction[_0x5f48('0x10')](_0x5f48('0x11'),_0x5f48('0x12')),controller[_0x5f48('0x13')]);router[_0x5f48('0x14')](_0x5f48('0xc'),auth[_0x5f48('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x5f48('0x9')](),controller[_0x5f48('0x15')]);router['put']('/:id/reject',auth[_0x5f48('0x9')](),controller['reject']);router[_0x5f48('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5566=['post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','describe','/:id','/:id/download','download'];(function(_0x34725d,_0x46ab85){var _0xe32dad=function(_0x403a76){while(--_0x403a76){_0x34725d['push'](_0x34725d['shift']());}};_0xe32dad(++_0x46ab85);}(_0x5566,0x179));var _0x6556=function(_0x4662c1,_0x5f5d1a){_0x4662c1=_0x4662c1-0x0;var _0x5e780f=_0x5566[_0x4662c1];return _0x5e780f;};'use strict';var multer=require(_0x6556('0x0'));var util=require('util');var path=require(_0x6556('0x1'));var timeout=require(_0x6556('0x2'));var express=require(_0x6556('0x3'));var router=express['Router']();var fs_extra=require(_0x6556('0x4'));var auth=require(_0x6556('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6556('0x6'));var controller=require(_0x6556('0x7'));router['get']('/',auth[_0x6556('0x8')](),controller[_0x6556('0x9')]);router[_0x6556('0xa')]('/describe',auth[_0x6556('0x8')](),controller[_0x6556('0xb')]);router['get'](_0x6556('0xc'),auth[_0x6556('0x8')](),controller['show']);router['get'](_0x6556('0xd'),auth[_0x6556('0x8')](),controller[_0x6556('0xe')]);router[_0x6556('0xf')]('/',auth[_0x6556('0x8')](),interaction[_0x6556('0x10')](_0x6556('0x11'),_0x6556('0x12')),controller[_0x6556('0x13')]);router[_0x6556('0x14')](_0x6556('0xc'),auth['isAuthenticated'](),controller[_0x6556('0x15')]);router['put'](_0x6556('0x16'),auth[_0x6556('0x8')](),controller[_0x6556('0x17')]);router[_0x6556('0x14')](_0x6556('0x18'),auth['isAuthenticated'](),controller[_0x6556('0x19')]);router[_0x6556('0x1a')](_0x6556('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6556('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index f110fa4..236530a 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 _0xea92=['medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email','sequelize','lodash','exports','TEXT','long'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xea92,0x95));var _0x2ea9=function(_0x5a0fae,_0x54d862){_0x5a0fae=_0x5a0fae-0x0;var _0xa2bde2=_0xea92[_0x5a0fae];return _0xa2bde2;};'use strict';var Sequelize=require(_0x2ea9('0x0'));var _=require(_0x2ea9('0x1'));module[_0x2ea9('0x2')]={'body':{'type':Sequelize[_0x2ea9('0x3')](_0x2ea9('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2ea9('0x5'))},'read':{'type':Sequelize[_0x2ea9('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2ea9('0x7')]('in','out'),'defaultValue':_0x2ea9('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x2ea9('0x9')]},'to':{'type':Sequelize['TEXT'](_0x2ea9('0x4'))},'cc':{'type':Sequelize[_0x2ea9('0x3')](_0x2ea9('0x4'))},'bcc':{'type':Sequelize[_0x2ea9('0x3')](_0x2ea9('0x4'))},'subject':{'type':Sequelize[_0x2ea9('0x3')]},'sentAt':{'type':Sequelize[_0x2ea9('0xa')]},'attach':{'type':Sequelize[_0x2ea9('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2ea9('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2ea9('0xa')]},'originTo':{'type':Sequelize[_0x2ea9('0x3')](_0x2ea9('0x4'))},'originCc':{'type':Sequelize[_0x2ea9('0x3')](_0x2ea9('0x4'))},'originChannel':{'type':Sequelize[_0x2ea9('0x7')]('Email',_0x2ea9('0xc')),'defaultValue':_0x2ea9('0xd'),'allowNull':![]}}; \ No newline at end of file +var _0x212f=['DATE','INTEGER','ENUM','Email','Chat','sequelize','lodash','exports','TEXT','long','BOOLEAN','STRING'];(function(_0x57f628,_0x1966e5){var _0x5cbe79=function(_0x24cb71){while(--_0x24cb71){_0x57f628['push'](_0x57f628['shift']());}};_0x5cbe79(++_0x1966e5);}(_0x212f,0x1e5));var _0xf212=function(_0xdbfa37,_0x13d690){_0xdbfa37=_0xdbfa37-0x0;var _0x3dc4e8=_0x212f[_0xdbfa37];return _0x3dc4e8;};'use strict';var Sequelize=require(_0xf212('0x0'));var _=require(_0xf212('0x1'));module[_0xf212('0x2')]={'body':{'type':Sequelize[_0xf212('0x3')](_0xf212('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf212('0x3')]('medium')},'read':{'type':Sequelize[_0xf212('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xf212('0x6')]},'to':{'type':Sequelize[_0xf212('0x3')](_0xf212('0x4'))},'cc':{'type':Sequelize[_0xf212('0x3')](_0xf212('0x4'))},'bcc':{'type':Sequelize[_0xf212('0x3')]('long')},'subject':{'type':Sequelize[_0xf212('0x3')]},'sentAt':{'type':Sequelize[_0xf212('0x7')]},'attach':{'type':Sequelize[_0xf212('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf212('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0xf212('0x4'))},'originCc':{'type':Sequelize[_0xf212('0x3')](_0xf212('0x4'))},'originChannel':{'type':Sequelize[_0xf212('0x9')](_0xf212('0xa'),_0xf212('0xb')),'defaultValue':_0xf212('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index bfc0ec4..7f24021 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 _0x5cce=['fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','VIRTUAL','includeAll','include','rows','params','rawAttributes','find','body','describe','create','direction','out','secret','findOne','MailAccountId','List','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','pass','user','attachments','join','root','server/files/attachments','Contacts','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','download','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','MailMessage','fieldName','type','model','query','keys','intersection','attributes'];(function(_0x5f23b9,_0x5e006f){var _0x2b7d54=function(_0x2f0395){while(--_0x2f0395){_0x5f23b9['push'](_0x5f23b9['shift']());}};_0x2b7d54(++_0x5e006f);}(_0x5cce,0x66));var _0xe5cc=function(_0x74c475,_0x527bbb){_0x74c475=_0x74c475-0x0;var _0x5e2730=_0x5cce[_0x74c475];return _0x5e2730;};'use strict';var emlformat=require(_0xe5cc('0x0'));var moment=require(_0xe5cc('0x1'));var BPromise=require('bluebird');var util=require(_0xe5cc('0x2'));var path=require(_0xe5cc('0x3'));var fs=require('fs');var _=require(_0xe5cc('0x4'));var Redis=require(_0xe5cc('0x5'));var htmlToText=require(_0xe5cc('0x6'));var qs=require(_0xe5cc('0x7'));var logger=require(_0xe5cc('0x8'))(_0xe5cc('0x9'));var interaction_log=require('../../config/logger')(_0xe5cc('0xa'));var config=require(_0xe5cc('0xb'));var db=require(_0xe5cc('0xc'))['db'];config[_0xe5cc('0xd')]=_[_0xe5cc('0xe')](config[_0xe5cc('0xd')],{'host':_0xe5cc('0xf'),'port':0x18eb});var socket=require(_0xe5cc('0x10'))(new Redis(config[_0xe5cc('0xd')]));var htmlEntities=require(_0xe5cc('0x11'));require(_0xe5cc('0x12'))[_0xe5cc('0x13')](socket);var jayson=require(_0xe5cc('0x14'));var client=jayson[_0xe5cc('0x15')]['http']({'port':0x232c});var client9003=jayson['client'][_0xe5cc('0x16')]({'port':0x232b});var client9002=jayson[_0xe5cc('0x15')][_0xe5cc('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x567ba5,_0x4062f1,_0x15cf33,_0x744506){return new BPromise(function(_0x58bc9e,_0x551137){var _0x421fa7=_0x744506||client;return _0x421fa7[_0xe5cc('0x17')](_0x567ba5,_0x15cf33)[_0xe5cc('0x18')](function(_0x14711a){logger[_0xe5cc('0x19')](_0xe5cc('0x1a'),_0x4062f1,_0xe5cc('0x1b'));logger[_0xe5cc('0x1c')](_0xe5cc('0x1d'),_0x4062f1,_0xe5cc('0x1b'),JSON[_0xe5cc('0x1e')](_0x14711a));if(_0x14711a[_0xe5cc('0x1f')]){if(_0x14711a[_0xe5cc('0x1f')][_0xe5cc('0x20')]===0x1f4){logger['error'](_0xe5cc('0x1a'),_0x4062f1,_0x14711a[_0xe5cc('0x1f')]['message']);return _0x551137(_0x14711a[_0xe5cc('0x1f')][_0xe5cc('0x21')]);}logger['error'](_0xe5cc('0x1a'),_0x4062f1,_0x14711a['error']['message']);return _0x58bc9e(_0x14711a[_0xe5cc('0x1f')][_0xe5cc('0x21')]);}else{logger[_0xe5cc('0x19')](_0xe5cc('0x1a'),_0x4062f1,_0xe5cc('0x1b'));_0x58bc9e(_0x14711a[_0xe5cc('0x22')]['message']);}})[_0xe5cc('0x23')](function(_0x27cd0a){logger[_0xe5cc('0x1f')](_0xe5cc('0x1a'),_0x4062f1,_0x27cd0a);_0x551137(_0x27cd0a);});});}function respondWithResult(_0x56951e,_0x13c94c){_0x13c94c=_0x13c94c||0xc8;return function(_0x42de6d){if(_0x42de6d){return _0x56951e[_0xe5cc('0x24')](_0x13c94c)['json'](_0x42de6d);}};}function respondWithFilteredResult(_0x173c89,_0x4b8411){return function(_0x2c51ef){if(_0x2c51ef){var _0x379f7b=typeof _0x4b8411[_0xe5cc('0x25')]===_0xe5cc('0x26')&&typeof _0x4b8411[_0xe5cc('0x27')]===_0xe5cc('0x26');var _0x38454c=_0x2c51ef[_0xe5cc('0x28')];var _0x5dd5a3=_0x379f7b?0x0:_0x4b8411['offset'];var _0x5812a5=_0x379f7b?_0x2c51ef[_0xe5cc('0x28')]:_0x4b8411['offset']+_0x4b8411['limit'];var _0x4f041a;if(_0x5812a5>=_0x38454c){_0x5812a5=_0x38454c;_0x4f041a=0xc8;}else{_0x4f041a=0xce;}_0x173c89['status'](_0x4f041a);return _0x173c89['set'](_0xe5cc('0x29'),_0x5dd5a3+'-'+_0x5812a5+'/'+_0x38454c)[_0xe5cc('0x2a')](_0x2c51ef);}return null;};}function saveUpdates(_0x44f650){return function(_0x39b9e5){if(_0x39b9e5){return _0x39b9e5[_0xe5cc('0x2b')](_0x44f650)['then'](function(_0x58373a){return _0x58373a;});}return null;};}function removeEntity(_0x37fd34){return function(_0x59470a){if(_0x59470a){return _0x59470a[_0xe5cc('0x2c')]()[_0xe5cc('0x18')](function(){_0x37fd34['status'](0xcc)[_0xe5cc('0x2d')]();});}};}function handleEntityNotFound(_0x41dd1a){return function(_0x8b1edc){if(!_0x8b1edc){_0x41dd1a[_0xe5cc('0x2e')](0x194);}return _0x8b1edc;};}function handleError(_0x141860,_0x24992f){_0x24992f=_0x24992f||0x1f4;return function(_0x3eeb3f){logger[_0xe5cc('0x1f')](_0x3eeb3f[_0xe5cc('0x2f')]);if(_0x3eeb3f[_0xe5cc('0x30')]){delete _0x3eeb3f[_0xe5cc('0x30')];}_0x141860[_0xe5cc('0x24')](_0x24992f)[_0xe5cc('0x31')](_0x3eeb3f);};}exports['index']=function(_0x58f085,_0x478dab){var _0x2087f5={},_0x2d8a9d={},_0x49fcbd={'count':0x0,'rows':[]};var _0x12472e=_['map'](db[_0xe5cc('0x32')]['rawAttributes'],function(_0x42dac2){return{'name':_0x42dac2[_0xe5cc('0x33')],'type':_0x42dac2[_0xe5cc('0x34')]['key']};});_0x2d8a9d[_0xe5cc('0x35')]=_['map'](_0x12472e,_0xe5cc('0x30'));_0x2d8a9d[_0xe5cc('0x36')]=_[_0xe5cc('0x37')](_0x58f085[_0xe5cc('0x36')]);_0x2d8a9d['filters']=_[_0xe5cc('0x38')](_0x2d8a9d['model'],_0x2d8a9d[_0xe5cc('0x36')]);_0x2087f5[_0xe5cc('0x39')]=_[_0xe5cc('0x38')](_0x2d8a9d[_0xe5cc('0x35')],qs[_0xe5cc('0x3a')](_0x58f085[_0xe5cc('0x36')]['fields']));_0x2087f5[_0xe5cc('0x39')]=_0x2087f5[_0xe5cc('0x39')][_0xe5cc('0x3b')]?_0x2087f5[_0xe5cc('0x39')]:_0x2d8a9d[_0xe5cc('0x35')];if(!_0x58f085['query'][_0xe5cc('0x3c')](_0xe5cc('0x3d'))){_0x2087f5['limit']=qs[_0xe5cc('0x27')](_0x58f085[_0xe5cc('0x36')][_0xe5cc('0x27')]);_0x2087f5['offset']=qs[_0xe5cc('0x25')](_0x58f085[_0xe5cc('0x36')][_0xe5cc('0x25')]);}_0x2087f5[_0xe5cc('0x3e')]=qs[_0xe5cc('0x3f')](_0x58f085[_0xe5cc('0x36')][_0xe5cc('0x3f')]);_0x2087f5['where']=qs[_0xe5cc('0x40')](_['pick'](_0x58f085['query'],_0x2d8a9d[_0xe5cc('0x40')]),_0x12472e);if(_0x58f085[_0xe5cc('0x36')][_0xe5cc('0x41')]){_0x2087f5[_0xe5cc('0x42')]=_[_0xe5cc('0x43')](_0x2087f5[_0xe5cc('0x42')],{'$or':_[_0xe5cc('0x44')](_0x12472e,function(_0x42a0c8){if(_0x42a0c8[_0xe5cc('0x34')]!==_0xe5cc('0x45')){var _0x3db168={};_0x3db168[_0x42a0c8[_0xe5cc('0x30')]]={'$like':'%'+_0x58f085[_0xe5cc('0x36')]['filter']+'%'};return _0x3db168;}})});}_0x2087f5=_[_0xe5cc('0x43')]({},_0x2087f5,_0x58f085['options']);var _0x508425={'where':_0x2087f5[_0xe5cc('0x42')]};return db['MailMessage']['count'](_0x508425)['then'](function(_0x17fb84){_0x49fcbd['count']=_0x17fb84;if(_0x58f085[_0xe5cc('0x36')][_0xe5cc('0x46')]){_0x2087f5[_0xe5cc('0x47')]=[{'all':!![]}];}return db[_0xe5cc('0x32')]['findAll'](_0x2087f5);})[_0xe5cc('0x18')](function(_0x4e48ad){_0x49fcbd[_0xe5cc('0x48')]=_0x4e48ad;return _0x49fcbd;})[_0xe5cc('0x18')](respondWithFilteredResult(_0x478dab,_0x2087f5))['catch'](handleError(_0x478dab,null));};exports['show']=function(_0xf8c820,_0x212a8a){var _0x2b2e29={'raw':!![],'where':{'id':_0xf8c820[_0xe5cc('0x49')]['id']}},_0x24b72f={};_0x24b72f[_0xe5cc('0x35')]=_[_0xe5cc('0x37')](db[_0xe5cc('0x32')][_0xe5cc('0x4a')]);_0x24b72f[_0xe5cc('0x36')]=_['keys'](_0xf8c820[_0xe5cc('0x36')]);_0x24b72f['filters']=_[_0xe5cc('0x38')](_0x24b72f['model'],_0x24b72f[_0xe5cc('0x36')]);_0x2b2e29[_0xe5cc('0x39')]=_[_0xe5cc('0x38')](_0x24b72f['model'],qs[_0xe5cc('0x3a')](_0xf8c820[_0xe5cc('0x36')][_0xe5cc('0x3a')]));_0x2b2e29['attributes']=_0x2b2e29['attributes'][_0xe5cc('0x3b')]?_0x2b2e29[_0xe5cc('0x39')]:_0x24b72f[_0xe5cc('0x35')];if(_0xf8c820[_0xe5cc('0x36')][_0xe5cc('0x46')]){_0x2b2e29[_0xe5cc('0x47')]=[{'all':!![]}];}_0x2b2e29=_[_0xe5cc('0x43')]({},_0x2b2e29,_0xf8c820['options']);return db[_0xe5cc('0x32')][_0xe5cc('0x4b')](_0x2b2e29)['then'](handleEntityNotFound(_0x212a8a,null))[_0xe5cc('0x18')](respondWithResult(_0x212a8a,null))[_0xe5cc('0x23')](handleError(_0x212a8a,null));};exports[_0xe5cc('0x2b')]=function(_0x1490c5,_0x34e77a){if(_0x1490c5['body']['id']){delete _0x1490c5[_0xe5cc('0x4c')]['id'];}return db[_0xe5cc('0x32')]['find']({'where':{'id':_0x1490c5['params']['id']}})['then'](handleEntityNotFound(_0x34e77a,null))[_0xe5cc('0x18')](saveUpdates(_0x1490c5[_0xe5cc('0x4c')],null))['then'](respondWithResult(_0x34e77a,null))['catch'](handleError(_0x34e77a,null));};exports['destroy']=function(_0x336736,_0x591bf1){return db[_0xe5cc('0x32')][_0xe5cc('0x4b')]({'where':{'id':_0x336736[_0xe5cc('0x49')]['id']}})['then'](handleEntityNotFound(_0x591bf1,null))['then'](removeEntity(_0x591bf1,null))[_0xe5cc('0x23')](handleError(_0x591bf1,null));};exports['describe']=function(_0x2a20c0,_0x4a61df){return db[_0xe5cc('0x32')][_0xe5cc('0x4d')]()[_0xe5cc('0x18')](respondWithResult(_0x4a61df,null))['catch'](handleError(_0x4a61df,null));};exports['create']=function(_0x51b98b,_0x225831){return db['MailMessage'][_0xe5cc('0x4e')](_0x51b98b[_0xe5cc('0x4c')])['then'](function(_0x27d374){if(_0x27d374){if(_0x27d374[_0xe5cc('0x4f')]===_0xe5cc('0x50')&&!_0x27d374[_0xe5cc('0x51')]){var _0x1a1c0b,_0x2a62e6,_0x2f6dc4;if(_0x51b98b[_0xe5cc('0x4c')]['to']){_0x2a62e6=_0x51b98b[_0xe5cc('0x4c')]['to']['split'](',')[0x0];}return db['MailAccount'][_0xe5cc('0x52')]({'where':{'id':_0x27d374[_0xe5cc('0x53')]},'include':[{'model':db['CmList'],'as':_0xe5cc('0x54'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x2a62e6},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xe5cc('0x55')],'as':_0xe5cc('0x56'),'raw':!![]}]})[_0xe5cc('0x18')](function(_0x459fc8){_0x1a1c0b=_0x459fc8;if(_0x1a1c0b&&_0x1a1c0b[_0xe5cc('0x56')]){var _0x18c4cf={'tls':{'rejectUnauthorized':![]}};if(_[_0xe5cc('0x57')](_0x1a1c0b[_0xe5cc('0x56')][_0xe5cc('0x58')])){_0x18c4cf[_0xe5cc('0x59')]=_0x1a1c0b[_0xe5cc('0x56')][_0xe5cc('0x59')];_0x18c4cf[_0xe5cc('0x5a')]=_0x1a1c0b['Smtp'][_0xe5cc('0x5a')];_0x18c4cf[_0xe5cc('0x5b')]=_0x1a1c0b['Smtp'][_0xe5cc('0x5b')];if(_0x1a1c0b['Smtp'][_0xe5cc('0x5c')]){_0x18c4cf['auth']={'user':_0x1a1c0b[_0xe5cc('0x56')]['user'],'pass':_0x1a1c0b[_0xe5cc('0x56')][_0xe5cc('0x5d')]};}}else{_0x18c4cf[_0xe5cc('0x58')]=_0x1a1c0b[_0xe5cc('0x56')][_0xe5cc('0x58')];_0x18c4cf['auth']={'user':_0x1a1c0b[_0xe5cc('0x56')][_0xe5cc('0x5e')],'pass':_0x1a1c0b[_0xe5cc('0x56')][_0xe5cc('0x5d')]};_0x18c4cf[_0xe5cc('0x5b')]=_0x1a1c0b[_0xe5cc('0x56')]['secure'];}if(_0x51b98b['body'][_0xe5cc('0x5f')]&&_0x51b98b[_0xe5cc('0x4c')][_0xe5cc('0x5f')][_0xe5cc('0x3b')]){for(var _0x1bdc6c=0x0;_0x1bdc6c<_0x51b98b[_0xe5cc('0x4c')][_0xe5cc('0x5f')]['length'];_0x1bdc6c+=0x1){_0x51b98b[_0xe5cc('0x4c')][_0xe5cc('0x5f')][_0x1bdc6c]={'filename':_0x51b98b[_0xe5cc('0x4c')][_0xe5cc('0x5f')][_0x1bdc6c][_0xe5cc('0x30')],'path':path[_0xe5cc('0x60')](config[_0xe5cc('0x61')],_0xe5cc('0x62'),_0x51b98b['body']['attachments'][_0x1bdc6c]['basename'])};}}_0x2f6dc4={'account':_0x18c4cf,'message':_0x51b98b['body']};return;}})[_0xe5cc('0x18')](function(){if(_0x1a1c0b[_0xe5cc('0x54')]){if(_0x1a1c0b[_0xe5cc('0x54')][_0xe5cc('0x63')][_0xe5cc('0x3b')]){return _0x1a1c0b['List'][_0xe5cc('0x63')][0x0];}else{return db['CmContact'][_0xe5cc('0x4e')](_[_0xe5cc('0xe')](_0x51b98b[_0xe5cc('0x4c')],{'firstName':_0x51b98b[_0xe5cc('0x4c')]['to'],'email':_0x51b98b[_0xe5cc('0x4c')]['to'],'phone':_0x51b98b[_0xe5cc('0x4c')]['to'],'ListId':_0x1a1c0b['ListId']}));}}else{throw new Error(_0xe5cc('0x64'));}})[_0xe5cc('0x18')](function(){if(_0x2f6dc4){return respondWithRpcPromise('SendMail',_0xe5cc('0x65'),_0x2f6dc4,client9003)[_0xe5cc('0x18')](function(_0x20c90b){return _0x27d374['update']({'read':!![],'messageId':_0x20c90b[_0xe5cc('0x66')],'sentAt':moment()[_0xe5cc('0x67')](_0xe5cc('0x68'))});})['catch'](function(_0xeb8447){logger[_0xe5cc('0x1f')]('%s',JSON['stringify'](_0xeb8447));return _0x27d374;});}return _0x27d374;});}return _0x27d374;}})['then'](respondWithResult(_0x225831,0xc9))['catch'](handleError(_0x225831,null));};exports['accept']=function(_0x5f8e6d,_0x5d9a1d){var _0x31d923={'agent':{},'channel':_0xe5cc('0x69')};if(_0x5f8e6d[_0xe5cc('0x4c')]['id']){delete _0x5f8e6d[_0xe5cc('0x4c')]['id'];}_0x5f8e6d[_0xe5cc('0x4c')][_0xe5cc('0x6a')]=!![];_0x5f8e6d['body']['readAt']=moment()[_0xe5cc('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f8e6d[_0xe5cc('0x4c')]['UserId']=_0x5f8e6d['body'][_0xe5cc('0x6b')]||_0x5f8e6d[_0xe5cc('0x5e')]['id'];_0x31d923[_0xe5cc('0x6c')]['id']=_0x5f8e6d[_0xe5cc('0x4c')][_0xe5cc('0x6b')];return db[_0xe5cc('0x32')]['find']({'where':{'id':_0x5f8e6d['params']['id'],'UserId':null}})[_0xe5cc('0x18')](handleEntityNotFound(_0x5d9a1d,null))[_0xe5cc('0x18')](saveUpdates(_0x5f8e6d[_0xe5cc('0x4c')],null))[_0xe5cc('0x18')](function(_0x3930c8){if(_0x3930c8){_0x31d923[_0xe5cc('0x21')]=_0x3930c8[_0xe5cc('0x6d')]({'plain':!![]});return db[_0xe5cc('0x6e')][_0xe5cc('0x4b')]({'where':{'id':_0x3930c8[_0xe5cc('0x6f')]}});}return null;})[_0xe5cc('0x18')](handleEntityNotFound(_0x5d9a1d,null))['then'](function(_0xee77b5){if(_0xee77b5){return _0xee77b5[_0xe5cc('0x2b')]({'UserId':_0x5f8e6d[_0xe5cc('0x4c')][_0xe5cc('0x6b')],'read1stAt':_[_0xe5cc('0x57')](_0xee77b5[_0xe5cc('0x70')])?moment()['format'](_0xe5cc('0x68')):undefined});}return null;})[_0xe5cc('0x18')](function(_0x5b2f3c){if(_0x5b2f3c){_0x31d923[_0xe5cc('0x71')]=_0x5b2f3c['get']({'plain':!![]});interaction_log[_0xe5cc('0x19')](_0xe5cc('0x72'),_0x5f8e6d['user']['id'],_0x5f8e6d[_0xe5cc('0x5e')][_0xe5cc('0x30')],_0x5f8e6d[_0xe5cc('0x5e')]['role'],_0x31d923[_0xe5cc('0x71')]['id'],_0x5f8e6d[_0xe5cc('0x4c')]?JSON[_0xe5cc('0x1e')](_0x5f8e6d[_0xe5cc('0x4c')]):_0xe5cc('0x73'));return respondWithRpcPromise(_0xe5cc('0x74'),_0xe5cc('0x75'),_0x31d923);}return null;})['then'](function(_0x3fea33){var _0xf204ed=_0xe5cc('0x76')+_0x3fea33[_0xe5cc('0x21')][_0xe5cc('0x77')];return db[_0xe5cc('0x78')][_0xe5cc('0x36')](_0xf204ed,{'type':db[_0xe5cc('0x79')][_0xe5cc('0x7a')][_0xe5cc('0x7b')],'raw':!![]})['then'](function(_0xeed0c){return _0xeed0c;});})['then'](function(_0x15f392){if(_0x15f392){_0x31d923['message'][_0xe5cc('0x7c')]=_0x15f392[0x0];if(!_0x5f8e6d['body']['UserId'])return;return db['User'][_0xe5cc('0x4b')]({'where':{'id':_0x5f8e6d['body']['UserId'],'role':_0xe5cc('0x6c')},'attributes':['id','name',_0xe5cc('0x7d'),_0xe5cc('0x7e'),_0xe5cc('0x7f')],'raw':!![]});}return null;})[_0xe5cc('0x18')](function(_0xa1c3ce){if(!_0xa1c3ce)return null;_0x31d923[_0xe5cc('0x21')][_0xe5cc('0x6c')]=_0xa1c3ce;return _0x31d923;})[_0xe5cc('0x18')](function(_0xaeb70e){if(_0xaeb70e){if(_0x5f8e6d['body']['manual']){_0x31d923[_0xe5cc('0x21')][_0xe5cc('0x80')]=util[_0xe5cc('0x67')](_0xe5cc('0x81'),_0x5f8e6d[_0xe5cc('0x5e')][_0xe5cc('0x30')]);_0x31d923[_0xe5cc('0x21')]['channel']=_0x31d923[_0xe5cc('0x82')];_0x31d923[_0xe5cc('0x21')][_0xe5cc('0x83')]=_0x31d923[_0xe5cc('0x82')];_0x31d923[_0xe5cc('0x21')][_0xe5cc('0x84')]=_0xe5cc('0x85');_0x31d923[_0xe5cc('0x21')]['body']=htmlToText[_0xe5cc('0x86')](_0x31d923[_0xe5cc('0x21')][_0xe5cc('0x4c')]);return respondWithRpcPromise(_0xe5cc('0x87'),_0xe5cc('0x87'),{'event':_0xe5cc('0x88'),'message':_0x31d923[_0xe5cc('0x21')]},client9002)[_0xe5cc('0x18')](function(){return _0x31d923;});}return _0x31d923;}return null;})[_0xe5cc('0x18')](respondWithResult(_0x5d9a1d,null))['catch'](handleError(_0x5d9a1d,null));};exports[_0xe5cc('0x89')]=function(_0x3f74d4,_0x1c6147){var _0x4a9938={'agent':{},'channel':_0xe5cc('0x69')};if(_0x3f74d4[_0xe5cc('0x4c')]['id']){delete _0x3f74d4[_0xe5cc('0x4c')]['id'];}_0x3f74d4['body'][_0xe5cc('0x6b')]=_0x3f74d4[_0xe5cc('0x4c')][_0xe5cc('0x6b')]||_0x3f74d4['user']['id'];_0x4a9938[_0xe5cc('0x6c')]['id']=_0x3f74d4[_0xe5cc('0x4c')][_0xe5cc('0x6b')];return db[_0xe5cc('0x32')][_0xe5cc('0x4b')]({'where':{'id':_0x3f74d4[_0xe5cc('0x49')]['id'],'UserId':null}})[_0xe5cc('0x18')](handleEntityNotFound(_0x1c6147,null))[_0xe5cc('0x18')](function(_0xcce3ce){if(_0xcce3ce){_0x4a9938['message']=_0xcce3ce[_0xe5cc('0x6d')]({'plain':!![]});return db[_0xe5cc('0x6e')][_0xe5cc('0x4b')]({'where':{'id':_0xcce3ce[_0xe5cc('0x6f')]}});}return null;})[_0xe5cc('0x18')](handleEntityNotFound(_0x1c6147,null))[_0xe5cc('0x18')](function(_0x5bd02f){if(_0x5bd02f){_0x4a9938['interaction']=_0x5bd02f[_0xe5cc('0x6d')]({'plain':!![]});interaction_log[_0xe5cc('0x19')](_0xe5cc('0x8a'),_0x3f74d4['user']['id'],_0x3f74d4[_0xe5cc('0x5e')][_0xe5cc('0x30')],_0x3f74d4[_0xe5cc('0x5e')]['role'],_0x4a9938[_0xe5cc('0x71')]['id'],_0x3f74d4[_0xe5cc('0x4c')]?JSON[_0xe5cc('0x1e')](_0x3f74d4[_0xe5cc('0x4c')]):_0xe5cc('0x73'));return respondWithRpcPromise('RejectMessage',_0xe5cc('0x8b'),_0x4a9938);}return null;})[_0xe5cc('0x18')](function(_0x3d371a){var _0x311432=_0xe5cc('0x76')+_0x3d371a['message']['ContactId'];return db[_0xe5cc('0x78')]['query'](_0x311432,{'type':db['Sequelize'][_0xe5cc('0x7a')][_0xe5cc('0x7b')],'raw':!![]})[_0xe5cc('0x18')](function(_0x5d3fea){return _0x5d3fea;});})[_0xe5cc('0x18')](function(_0x10ab55){if(_0x10ab55){_0x4a9938[_0xe5cc('0x21')][_0xe5cc('0x7c')]=_0x10ab55[0x0];if(!_0x3f74d4[_0xe5cc('0x4c')][_0xe5cc('0x6b')])return;return db['User'][_0xe5cc('0x4b')]({'where':{'id':_0x3f74d4['body']['UserId'],'role':_0xe5cc('0x6c')},'attributes':['id',_0xe5cc('0x30'),'fullname',_0xe5cc('0x7e'),_0xe5cc('0x7f')],'raw':!![]});}return null;})[_0xe5cc('0x18')](function(_0x288e69){if(!_0x288e69)return null;_0x4a9938[_0xe5cc('0x21')][_0xe5cc('0x6c')]=_0x288e69;return _0x4a9938;})[_0xe5cc('0x18')](function(_0x41a8f6){if(_0x41a8f6){_0x41a8f6[_0xe5cc('0x21')][_0xe5cc('0x80')]=util[_0xe5cc('0x67')](_0xe5cc('0x81'),_0x3f74d4[_0xe5cc('0x5e')][_0xe5cc('0x30')]);_0x41a8f6[_0xe5cc('0x21')]['channel']=_0x4a9938['channel'];_0x41a8f6[_0xe5cc('0x21')]['motionChannel']=_0x4a9938['channel'];_0x41a8f6[_0xe5cc('0x21')][_0xe5cc('0x84')]=_0xe5cc('0x89');_0x41a8f6['message'][_0xe5cc('0x4c')]=htmlToText[_0xe5cc('0x86')](_0x4a9938[_0xe5cc('0x21')][_0xe5cc('0x4c')]);respondWithRpcPromise('EventManager',_0xe5cc('0x87'),{'event':_0xe5cc('0x8c'),'message':_0x41a8f6['message']},client9002);return _0x4a9938;}return null;})[_0xe5cc('0x18')](respondWithResult(_0x1c6147,null))[_0xe5cc('0x23')](handleError(_0x1c6147,null));};exports[_0xe5cc('0x8d')]=function(_0x2a35e3,_0x694319){var _0x41d921=moment()['unix']()[_0xe5cc('0x8e')]();var _0xfa682=path[_0xe5cc('0x60')](config['root'],'server',_0xe5cc('0x8f'),_0xe5cc('0x90'));var _0x4c31da=path[_0xe5cc('0x60')](config[_0xe5cc('0x61')],_0xe5cc('0x91'),_0xe5cc('0x8f'),_0xe5cc('0x5f'));var _0x382267=util['format'](_0xe5cc('0x92'),_0x41d921);return db[_0xe5cc('0x32')][_0xe5cc('0x4b')]({'where':{'id':_0x2a35e3['params']['id']},'attributes':['id',_0xe5cc('0x4c'),_0xe5cc('0x93'),'to','cc',_0xe5cc('0x94'),_0xe5cc('0x95'),_0xe5cc('0x96')],'include':_0x2a35e3[_0xe5cc('0x36')][_0xe5cc('0x5f')]?[{'model':db['Attachment'],'as':_0xe5cc('0x97')}]:undefined})[_0xe5cc('0x18')](handleEntityNotFound(_0x694319,null))[_0xe5cc('0x18')](function(_0x63d788){if(_0x63d788){var _0x5ce8bb=_0x63d788;var _0x5777b9={'from':_0x5ce8bb[_0xe5cc('0x93')],'to':_0x5ce8bb['to'],'subject':_0x5ce8bb['subject'],'html':htmlEntities['decode'](_0x5ce8bb[_0xe5cc('0x4c')]),'headers':{'Date':moment(_0x5ce8bb['createdAt'])[_0xe5cc('0x67')](_0xe5cc('0x98'))},'attachments':[]};if(_0x63d788['cc']){_0x5777b9[_0xe5cc('0x99')]['Cc']=_0x63d788['cc'];}if(_0x63d788[_0xe5cc('0x94')]){_0x5777b9[_0xe5cc('0x99')][_0xe5cc('0x9a')]=_0x63d788[_0xe5cc('0x94')];}return new BPromise(function(_0x383bca,_0x3e8741){if(_0x63d788[_0xe5cc('0x97')]){for(var _0x3114b1=0x0;_0x3114b1<_0x63d788['Attachments']['length'];_0x3114b1++){var _0xaf1ac0=_0x63d788['Attachments'][_0x3114b1];var _0x3256e0=path[_0xe5cc('0x60')](_0x4c31da,_0xaf1ac0[_0xe5cc('0x9b')]);if(fs[_0xe5cc('0x9c')](_0x3256e0)){_0x5777b9[_0xe5cc('0x5f')]['push']({'name':_0xaf1ac0['name'],'contentType':_0xaf1ac0['type'],'data':fs['readFileSync'](_0x3256e0)});}}}emlformat[_0xe5cc('0x9d')](_0x5777b9,function(_0x1c5ae5,_0x1acf67){if(_0x1c5ae5)return _0x3e8741(_0x1c5ae5);fs[_0xe5cc('0x9e')](path[_0xe5cc('0x60')](_0xfa682,_0x382267),_0x1acf67);return _0x383bca(_0x1acf67);});});}})['then'](function(_0x40fd3d){if(_0x40fd3d){return _0x694319[_0xe5cc('0x8d')](path[_0xe5cc('0x60')](_0xfa682,_0x382267),_0x382267,function(_0x57fdaf){if(!_0x57fdaf)fs[_0xe5cc('0x9f')](path[_0xe5cc('0x60')](_0xfa682,_0x382267));});}})['catch'](handleError(_0x694319,null));}; \ No newline at end of file +var _0x9dda=['get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','ContactId','sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','motionChannel','rejectmessage','download','toString','server','files','tmp','join','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','unlinkSync','eml-format','bluebird','util','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','length','find','body','params','describe','create','direction','secret','MailAccount','findOne','MailAccountId','List','updatedAt','DESC','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','Contacts','CmContact','defaults','ListId','List\x20not\x20found','SendMail','sendMail','format','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent'];(function(_0x13a8e3,_0x577462){var _0x271f48=function(_0x5ba5c7){while(--_0x5ba5c7){_0x13a8e3['push'](_0x13a8e3['shift']());}};_0x271f48(++_0x577462);}(_0x9dda,0x176));var _0xa9dd=function(_0xb1bbbd,_0x2ca431){_0xb1bbbd=_0xb1bbbd-0x0;var _0x1bc5da=_0x9dda[_0xb1bbbd];return _0x1bc5da;};'use strict';var emlformat=require(_0xa9dd('0x0'));var moment=require('moment');var BPromise=require(_0xa9dd('0x1'));var util=require(_0xa9dd('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xa9dd('0x3'));var htmlToText=require(_0xa9dd('0x4'));var qs=require(_0xa9dd('0x5'));var logger=require(_0xa9dd('0x6'))('api');var interaction_log=require(_0xa9dd('0x6'))('mail-interactions');var config=require(_0xa9dd('0x7'));var db=require(_0xa9dd('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa9dd('0x9'),'port':0x18eb});var socket=require(_0xa9dd('0xa'))(new Redis(config['redis']));var htmlEntities=require(_0xa9dd('0xb'));require(_0xa9dd('0xc'))[_0xa9dd('0xd')](socket);var jayson=require(_0xa9dd('0xe'));var client=jayson[_0xa9dd('0xf')]['http']({'port':0x232c});var client9003=jayson['client'][_0xa9dd('0x10')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16b439,_0x578598,_0x4c24bd,_0x40bb8c){return new BPromise(function(_0x425d47,_0x58e4f3){var _0x41a4c2=_0x40bb8c||client;return _0x41a4c2[_0xa9dd('0x11')](_0x16b439,_0x4c24bd)['then'](function(_0x3884ac){logger['info'](_0xa9dd('0x12'),_0x578598,'request\x20sent');logger['debug'](_0xa9dd('0x13'),_0x578598,_0xa9dd('0x14'),JSON[_0xa9dd('0x15')](_0x3884ac));if(_0x3884ac[_0xa9dd('0x16')]){if(_0x3884ac[_0xa9dd('0x16')][_0xa9dd('0x17')]===0x1f4){logger['error'](_0xa9dd('0x12'),_0x578598,_0x3884ac[_0xa9dd('0x16')][_0xa9dd('0x18')]);return _0x58e4f3(_0x3884ac['error'][_0xa9dd('0x18')]);}logger['error'](_0xa9dd('0x12'),_0x578598,_0x3884ac[_0xa9dd('0x16')][_0xa9dd('0x18')]);return _0x425d47(_0x3884ac[_0xa9dd('0x16')]['message']);}else{logger[_0xa9dd('0x19')]('MailMessage,\x20%s,\x20%s',_0x578598,'request\x20sent');_0x425d47(_0x3884ac[_0xa9dd('0x1a')]['message']);}})[_0xa9dd('0x1b')](function(_0x531863){logger['error']('MailMessage,\x20%s,\x20%s',_0x578598,_0x531863);_0x58e4f3(_0x531863);});});}function respondWithResult(_0x5065fe,_0x2bee66){_0x2bee66=_0x2bee66||0xc8;return function(_0x21e090){if(_0x21e090){return _0x5065fe[_0xa9dd('0x1c')](_0x2bee66)[_0xa9dd('0x1d')](_0x21e090);}};}function respondWithFilteredResult(_0x13962a,_0xca1759){return function(_0x2f58d2){if(_0x2f58d2){var _0x395b6c=typeof _0xca1759[_0xa9dd('0x1e')]===_0xa9dd('0x1f')&&typeof _0xca1759[_0xa9dd('0x20')]===_0xa9dd('0x1f');var _0x4b1514=_0x2f58d2[_0xa9dd('0x21')];var _0x62f5af=_0x395b6c?0x0:_0xca1759[_0xa9dd('0x1e')];var _0x57fff8=_0x395b6c?_0x2f58d2[_0xa9dd('0x21')]:_0xca1759[_0xa9dd('0x1e')]+_0xca1759[_0xa9dd('0x20')];var _0x417010;if(_0x57fff8>=_0x4b1514){_0x57fff8=_0x4b1514;_0x417010=0xc8;}else{_0x417010=0xce;}_0x13962a['status'](_0x417010);return _0x13962a[_0xa9dd('0x22')](_0xa9dd('0x23'),_0x62f5af+'-'+_0x57fff8+'/'+_0x4b1514)[_0xa9dd('0x1d')](_0x2f58d2);}return null;};}function saveUpdates(_0x5a2bba){return function(_0x3860e1){if(_0x3860e1){return _0x3860e1[_0xa9dd('0x24')](_0x5a2bba)['then'](function(_0x30afde){return _0x30afde;});}return null;};}function removeEntity(_0x1faa72){return function(_0xff0833){if(_0xff0833){return _0xff0833['destroy']()[_0xa9dd('0x25')](function(){_0x1faa72[_0xa9dd('0x1c')](0xcc)[_0xa9dd('0x26')]();});}};}function handleEntityNotFound(_0x4863d5){return function(_0x872944){if(!_0x872944){_0x4863d5[_0xa9dd('0x27')](0x194);}return _0x872944;};}function handleError(_0x31de93,_0x56b497){_0x56b497=_0x56b497||0x1f4;return function(_0x2ad4e7){logger['error'](_0x2ad4e7[_0xa9dd('0x28')]);if(_0x2ad4e7['name']){delete _0x2ad4e7[_0xa9dd('0x29')];}_0x31de93[_0xa9dd('0x1c')](_0x56b497)[_0xa9dd('0x2a')](_0x2ad4e7);};}exports[_0xa9dd('0x2b')]=function(_0x5669cd,_0x29fef1){var _0x5d298f={},_0x7d237={},_0x4a318f={'count':0x0,'rows':[]};var _0x42925c=_[_0xa9dd('0x2c')](db[_0xa9dd('0x2d')][_0xa9dd('0x2e')],function(_0x665959){return{'name':_0x665959[_0xa9dd('0x2f')],'type':_0x665959[_0xa9dd('0x30')]['key']};});_0x7d237[_0xa9dd('0x31')]=_['map'](_0x42925c,_0xa9dd('0x29'));_0x7d237['query']=_[_0xa9dd('0x32')](_0x5669cd[_0xa9dd('0x33')]);_0x7d237[_0xa9dd('0x34')]=_[_0xa9dd('0x35')](_0x7d237[_0xa9dd('0x31')],_0x7d237[_0xa9dd('0x33')]);_0x5d298f['attributes']=_[_0xa9dd('0x35')](_0x7d237[_0xa9dd('0x31')],qs[_0xa9dd('0x36')](_0x5669cd[_0xa9dd('0x33')][_0xa9dd('0x36')]));_0x5d298f['attributes']=_0x5d298f[_0xa9dd('0x37')]['length']?_0x5d298f[_0xa9dd('0x37')]:_0x7d237['model'];if(!_0x5669cd[_0xa9dd('0x33')][_0xa9dd('0x38')](_0xa9dd('0x39'))){_0x5d298f[_0xa9dd('0x20')]=qs[_0xa9dd('0x20')](_0x5669cd[_0xa9dd('0x33')][_0xa9dd('0x20')]);_0x5d298f[_0xa9dd('0x1e')]=qs['offset'](_0x5669cd[_0xa9dd('0x33')]['offset']);}_0x5d298f[_0xa9dd('0x3a')]=qs[_0xa9dd('0x3b')](_0x5669cd[_0xa9dd('0x33')][_0xa9dd('0x3b')]);_0x5d298f[_0xa9dd('0x3c')]=qs[_0xa9dd('0x34')](_[_0xa9dd('0x3d')](_0x5669cd[_0xa9dd('0x33')],_0x7d237[_0xa9dd('0x34')]),_0x42925c);if(_0x5669cd[_0xa9dd('0x33')][_0xa9dd('0x3e')]){_0x5d298f['where']=_[_0xa9dd('0x3f')](_0x5d298f[_0xa9dd('0x3c')],{'$or':_[_0xa9dd('0x2c')](_0x42925c,function(_0x2c1b34){if(_0x2c1b34[_0xa9dd('0x30')]!==_0xa9dd('0x40')){var _0x3a08f2={};_0x3a08f2[_0x2c1b34[_0xa9dd('0x29')]]={'$like':'%'+_0x5669cd['query'][_0xa9dd('0x3e')]+'%'};return _0x3a08f2;}})});}_0x5d298f=_[_0xa9dd('0x3f')]({},_0x5d298f,_0x5669cd[_0xa9dd('0x41')]);var _0x1cbbff={'where':_0x5d298f['where']};return db[_0xa9dd('0x2d')]['count'](_0x1cbbff)[_0xa9dd('0x25')](function(_0x99d515){_0x4a318f['count']=_0x99d515;if(_0x5669cd[_0xa9dd('0x33')][_0xa9dd('0x42')]){_0x5d298f[_0xa9dd('0x43')]=[{'all':!![]}];}return db['MailMessage'][_0xa9dd('0x44')](_0x5d298f);})[_0xa9dd('0x25')](function(_0x491c47){_0x4a318f['rows']=_0x491c47;return _0x4a318f;})[_0xa9dd('0x25')](respondWithFilteredResult(_0x29fef1,_0x5d298f))[_0xa9dd('0x1b')](handleError(_0x29fef1,null));};exports[_0xa9dd('0x45')]=function(_0x56463b,_0xb11ce2){var _0x33aed4={'raw':!![],'where':{'id':_0x56463b['params']['id']}},_0x5748e0={};_0x5748e0['model']=_[_0xa9dd('0x32')](db[_0xa9dd('0x2d')][_0xa9dd('0x2e')]);_0x5748e0[_0xa9dd('0x33')]=_[_0xa9dd('0x32')](_0x56463b[_0xa9dd('0x33')]);_0x5748e0[_0xa9dd('0x34')]=_['intersection'](_0x5748e0[_0xa9dd('0x31')],_0x5748e0[_0xa9dd('0x33')]);_0x33aed4['attributes']=_[_0xa9dd('0x35')](_0x5748e0['model'],qs['fields'](_0x56463b['query']['fields']));_0x33aed4['attributes']=_0x33aed4[_0xa9dd('0x37')][_0xa9dd('0x46')]?_0x33aed4['attributes']:_0x5748e0[_0xa9dd('0x31')];if(_0x56463b[_0xa9dd('0x33')][_0xa9dd('0x42')]){_0x33aed4[_0xa9dd('0x43')]=[{'all':!![]}];}_0x33aed4=_[_0xa9dd('0x3f')]({},_0x33aed4,_0x56463b[_0xa9dd('0x41')]);return db[_0xa9dd('0x2d')][_0xa9dd('0x47')](_0x33aed4)[_0xa9dd('0x25')](handleEntityNotFound(_0xb11ce2,null))[_0xa9dd('0x25')](respondWithResult(_0xb11ce2,null))[_0xa9dd('0x1b')](handleError(_0xb11ce2,null));};exports[_0xa9dd('0x24')]=function(_0x29c9aa,_0x518b96){if(_0x29c9aa[_0xa9dd('0x48')]['id']){delete _0x29c9aa[_0xa9dd('0x48')]['id'];}return db['MailMessage'][_0xa9dd('0x47')]({'where':{'id':_0x29c9aa['params']['id']}})[_0xa9dd('0x25')](handleEntityNotFound(_0x518b96,null))['then'](saveUpdates(_0x29c9aa['body'],null))[_0xa9dd('0x25')](respondWithResult(_0x518b96,null))[_0xa9dd('0x1b')](handleError(_0x518b96,null));};exports['destroy']=function(_0x2cdb06,_0x4c88a1){return db['MailMessage'][_0xa9dd('0x47')]({'where':{'id':_0x2cdb06[_0xa9dd('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c88a1,null))[_0xa9dd('0x25')](removeEntity(_0x4c88a1,null))['catch'](handleError(_0x4c88a1,null));};exports[_0xa9dd('0x4a')]=function(_0x5c9769,_0xa202e3){return db['MailMessage'][_0xa9dd('0x4a')]()[_0xa9dd('0x25')](respondWithResult(_0xa202e3,null))[_0xa9dd('0x1b')](handleError(_0xa202e3,null));};exports[_0xa9dd('0x4b')]=function(_0x35b17d,_0x2664da){return db[_0xa9dd('0x2d')][_0xa9dd('0x4b')](_0x35b17d[_0xa9dd('0x48')])[_0xa9dd('0x25')](function(_0x169bd1){if(_0x169bd1){if(_0x169bd1[_0xa9dd('0x4c')]==='out'&&!_0x169bd1[_0xa9dd('0x4d')]){var _0x298e8c,_0x5d40e9,_0x5ec44b;if(_0x35b17d[_0xa9dd('0x48')]['to']){_0x5d40e9=_0x35b17d[_0xa9dd('0x48')]['to']['split'](',')[0x0];}return db[_0xa9dd('0x4e')][_0xa9dd('0x4f')]({'where':{'id':_0x169bd1[_0xa9dd('0x50')]},'include':[{'model':db['CmList'],'as':_0xa9dd('0x51'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x5d40e9},'limit':0x1,'order':[[_0xa9dd('0x52'),_0xa9dd('0x53')]]}]},{'model':db['MailServerOut'],'as':_0xa9dd('0x54'),'raw':!![]}]})[_0xa9dd('0x25')](function(_0x20d8ef){_0x298e8c=_0x20d8ef;if(_0x298e8c&&_0x298e8c[_0xa9dd('0x54')]){var _0x1cb87b={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x298e8c[_0xa9dd('0x54')][_0xa9dd('0x55')])){_0x1cb87b[_0xa9dd('0x56')]=_0x298e8c[_0xa9dd('0x54')]['host'];_0x1cb87b[_0xa9dd('0x57')]=_0x298e8c[_0xa9dd('0x54')]['port'];_0x1cb87b[_0xa9dd('0x58')]=_0x298e8c[_0xa9dd('0x54')][_0xa9dd('0x58')];if(_0x298e8c[_0xa9dd('0x54')][_0xa9dd('0x59')]){_0x1cb87b[_0xa9dd('0x5a')]={'user':_0x298e8c['Smtp'][_0xa9dd('0x5b')],'pass':_0x298e8c['Smtp'][_0xa9dd('0x5c')]};}}else{_0x1cb87b[_0xa9dd('0x55')]=_0x298e8c['Smtp']['service'];_0x1cb87b[_0xa9dd('0x5a')]={'user':_0x298e8c['Smtp'][_0xa9dd('0x5b')],'pass':_0x298e8c[_0xa9dd('0x54')]['pass']};_0x1cb87b['secure']=_0x298e8c[_0xa9dd('0x54')][_0xa9dd('0x58')];}if(_0x35b17d[_0xa9dd('0x48')][_0xa9dd('0x5d')]&&_0x35b17d[_0xa9dd('0x48')]['attachments'][_0xa9dd('0x46')]){for(var _0x204652=0x0;_0x204652<_0x35b17d[_0xa9dd('0x48')]['attachments'][_0xa9dd('0x46')];_0x204652+=0x1){_0x35b17d[_0xa9dd('0x48')][_0xa9dd('0x5d')][_0x204652]={'filename':_0x35b17d['body'][_0xa9dd('0x5d')][_0x204652]['name'],'path':path['join'](config[_0xa9dd('0x5e')],_0xa9dd('0x5f'),_0x35b17d[_0xa9dd('0x48')][_0xa9dd('0x5d')][_0x204652][_0xa9dd('0x60')])};}}_0x5ec44b={'account':_0x1cb87b,'message':_0x35b17d[_0xa9dd('0x48')]};return;}})[_0xa9dd('0x25')](function(){if(_0x298e8c[_0xa9dd('0x51')]){if(_0x298e8c[_0xa9dd('0x51')]['Contacts'][_0xa9dd('0x46')]){return _0x298e8c['List'][_0xa9dd('0x61')][0x0];}else{return db[_0xa9dd('0x62')]['create'](_[_0xa9dd('0x63')](_0x35b17d[_0xa9dd('0x48')],{'firstName':_0x35b17d[_0xa9dd('0x48')]['to'],'email':_0x35b17d[_0xa9dd('0x48')]['to'],'phone':_0x35b17d[_0xa9dd('0x48')]['to'],'ListId':_0x298e8c[_0xa9dd('0x64')]}));}}else{throw new Error(_0xa9dd('0x65'));}})[_0xa9dd('0x25')](function(){if(_0x5ec44b){return respondWithRpcPromise(_0xa9dd('0x66'),_0xa9dd('0x67'),_0x5ec44b,client9003)[_0xa9dd('0x25')](function(_0x444cb1){return _0x169bd1[_0xa9dd('0x24')]({'read':!![],'messageId':_0x444cb1['messageId'],'sentAt':moment()[_0xa9dd('0x68')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x481882){logger[_0xa9dd('0x16')]('%s',JSON[_0xa9dd('0x15')](_0x481882));return _0x169bd1;});}return _0x169bd1;});}return _0x169bd1;}})[_0xa9dd('0x25')](respondWithResult(_0x2664da,0xc9))['catch'](handleError(_0x2664da,null));};exports[_0xa9dd('0x69')]=function(_0x4d7647,_0x1c8b8b){var _0x1582db={'agent':{},'channel':_0xa9dd('0x6a')};if(_0x4d7647[_0xa9dd('0x48')]['id']){delete _0x4d7647[_0xa9dd('0x48')]['id'];}_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x6b')]=!![];_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x6c')]=moment()[_0xa9dd('0x68')](_0xa9dd('0x6d'));_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x6e')]=_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x6e')]||_0x4d7647[_0xa9dd('0x5b')]['id'];_0x1582db[_0xa9dd('0x6f')]['id']=_0x4d7647[_0xa9dd('0x48')]['UserId'];return db[_0xa9dd('0x2d')][_0xa9dd('0x47')]({'where':{'id':_0x4d7647[_0xa9dd('0x49')]['id'],'UserId':null}})[_0xa9dd('0x25')](handleEntityNotFound(_0x1c8b8b,null))[_0xa9dd('0x25')](saveUpdates(_0x4d7647[_0xa9dd('0x48')],null))[_0xa9dd('0x25')](function(_0x16799d){if(_0x16799d){_0x1582db[_0xa9dd('0x18')]=_0x16799d[_0xa9dd('0x70')]({'plain':!![]});return db[_0xa9dd('0x71')]['find']({'where':{'id':_0x16799d[_0xa9dd('0x72')]}});}return null;})[_0xa9dd('0x25')](handleEntityNotFound(_0x1c8b8b,null))[_0xa9dd('0x25')](function(_0x19c1d5){if(_0x19c1d5){return _0x19c1d5[_0xa9dd('0x24')]({'UserId':_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x6e')],'read1stAt':_['isNil'](_0x19c1d5[_0xa9dd('0x73')])?moment()[_0xa9dd('0x68')](_0xa9dd('0x6d')):undefined});}return null;})[_0xa9dd('0x25')](function(_0x5a7986){if(_0x5a7986){_0x1582db['interaction']=_0x5a7986[_0xa9dd('0x70')]({'plain':!![]});interaction_log[_0xa9dd('0x19')](_0xa9dd('0x74'),_0x4d7647[_0xa9dd('0x5b')]['id'],_0x4d7647[_0xa9dd('0x5b')][_0xa9dd('0x29')],_0x4d7647[_0xa9dd('0x5b')][_0xa9dd('0x75')],_0x1582db[_0xa9dd('0x76')]['id'],_0x4d7647[_0xa9dd('0x48')]?JSON[_0xa9dd('0x15')](_0x4d7647['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1582db);}return null;})['then'](function(_0x55967f){var _0x55aa43='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55967f['message'][_0xa9dd('0x77')];return db[_0xa9dd('0x78')][_0xa9dd('0x33')](_0x55aa43,{'type':db['Sequelize']['QueryTypes'][_0xa9dd('0x79')],'raw':!![]})[_0xa9dd('0x25')](function(_0x33745f){return _0x33745f;});})[_0xa9dd('0x25')](function(_0x1aadb2){if(_0x1aadb2){_0x1582db[_0xa9dd('0x18')][_0xa9dd('0x7a')]=_0x1aadb2[0x0];if(!_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x6e')])return;return db[_0xa9dd('0x7b')]['find']({'where':{'id':_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x6e')],'role':_0xa9dd('0x6f')},'attributes':['id',_0xa9dd('0x29'),_0xa9dd('0x7c'),_0xa9dd('0x7d'),_0xa9dd('0x7e')],'raw':!![]});}return null;})[_0xa9dd('0x25')](function(_0x23ba2a){if(!_0x23ba2a)return null;_0x1582db['message'][_0xa9dd('0x6f')]=_0x23ba2a;return _0x1582db;})[_0xa9dd('0x25')](function(_0x27bf45){if(_0x27bf45){if(_0x4d7647[_0xa9dd('0x48')][_0xa9dd('0x7f')]){_0x1582db[_0xa9dd('0x18')][_0xa9dd('0x80')]=util[_0xa9dd('0x68')](_0xa9dd('0x81'),_0x4d7647[_0xa9dd('0x5b')]['name']);_0x1582db['message'][_0xa9dd('0x82')]=_0x1582db['channel'];_0x1582db['message']['motionChannel']=_0x1582db['channel'];_0x1582db[_0xa9dd('0x18')][_0xa9dd('0x83')]=_0xa9dd('0x69');_0x1582db[_0xa9dd('0x18')]['body']=htmlToText[_0xa9dd('0x84')](_0x1582db[_0xa9dd('0x18')][_0xa9dd('0x48')]);return respondWithRpcPromise('EventManager',_0xa9dd('0x85'),{'event':_0xa9dd('0x86'),'message':_0x1582db[_0xa9dd('0x18')]},client9002)['then'](function(){return _0x1582db;});}return _0x1582db;}return null;})[_0xa9dd('0x25')](respondWithResult(_0x1c8b8b,null))[_0xa9dd('0x1b')](handleError(_0x1c8b8b,null));};exports[_0xa9dd('0x87')]=function(_0x3a4220,_0x5c7a4e){var _0xac7776={'agent':{},'channel':_0xa9dd('0x6a')};if(_0x3a4220[_0xa9dd('0x48')]['id']){delete _0x3a4220[_0xa9dd('0x48')]['id'];}_0x3a4220[_0xa9dd('0x48')][_0xa9dd('0x6e')]=_0x3a4220[_0xa9dd('0x48')][_0xa9dd('0x6e')]||_0x3a4220['user']['id'];_0xac7776[_0xa9dd('0x6f')]['id']=_0x3a4220[_0xa9dd('0x48')][_0xa9dd('0x6e')];return db[_0xa9dd('0x2d')][_0xa9dd('0x47')]({'where':{'id':_0x3a4220[_0xa9dd('0x49')]['id'],'UserId':null}})[_0xa9dd('0x25')](handleEntityNotFound(_0x5c7a4e,null))['then'](function(_0x4ba33e){if(_0x4ba33e){_0xac7776[_0xa9dd('0x18')]=_0x4ba33e[_0xa9dd('0x70')]({'plain':!![]});return db[_0xa9dd('0x71')][_0xa9dd('0x47')]({'where':{'id':_0x4ba33e[_0xa9dd('0x72')]}});}return null;})[_0xa9dd('0x25')](handleEntityNotFound(_0x5c7a4e,null))[_0xa9dd('0x25')](function(_0x558c60){if(_0x558c60){_0xac7776['interaction']=_0x558c60[_0xa9dd('0x70')]({'plain':!![]});interaction_log[_0xa9dd('0x19')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a4220[_0xa9dd('0x5b')]['id'],_0x3a4220[_0xa9dd('0x5b')]['name'],_0x3a4220[_0xa9dd('0x5b')][_0xa9dd('0x75')],_0xac7776['interaction']['id'],_0x3a4220[_0xa9dd('0x48')]?JSON[_0xa9dd('0x15')](_0x3a4220[_0xa9dd('0x48')]):_0xa9dd('0x88'));return respondWithRpcPromise(_0xa9dd('0x89'),_0xa9dd('0x8a'),_0xac7776);}return null;})['then'](function(_0x69faf8){var _0x3f20ce=_0xa9dd('0x8b')+_0x69faf8[_0xa9dd('0x18')][_0xa9dd('0x77')];return db['sequelize'][_0xa9dd('0x33')](_0x3f20ce,{'type':db[_0xa9dd('0x8c')]['QueryTypes'][_0xa9dd('0x79')],'raw':!![]})[_0xa9dd('0x25')](function(_0x1bd2de){return _0x1bd2de;});})[_0xa9dd('0x25')](function(_0x297794){if(_0x297794){_0xac7776[_0xa9dd('0x18')][_0xa9dd('0x7a')]=_0x297794[0x0];if(!_0x3a4220[_0xa9dd('0x48')][_0xa9dd('0x6e')])return;return db[_0xa9dd('0x7b')]['find']({'where':{'id':_0x3a4220[_0xa9dd('0x48')][_0xa9dd('0x6e')],'role':_0xa9dd('0x6f')},'attributes':['id',_0xa9dd('0x29'),_0xa9dd('0x7c'),_0xa9dd('0x7d'),_0xa9dd('0x7e')],'raw':!![]});}return null;})[_0xa9dd('0x25')](function(_0x4dd221){if(!_0x4dd221)return null;_0xac7776[_0xa9dd('0x18')][_0xa9dd('0x6f')]=_0x4dd221;return _0xac7776;})['then'](function(_0x14184f){if(_0x14184f){_0x14184f[_0xa9dd('0x18')]['interface']=util[_0xa9dd('0x68')](_0xa9dd('0x81'),_0x3a4220[_0xa9dd('0x5b')][_0xa9dd('0x29')]);_0x14184f[_0xa9dd('0x18')]['channel']=_0xac7776[_0xa9dd('0x82')];_0x14184f[_0xa9dd('0x18')][_0xa9dd('0x8d')]=_0xac7776['channel'];_0x14184f[_0xa9dd('0x18')][_0xa9dd('0x83')]=_0xa9dd('0x87');_0x14184f[_0xa9dd('0x18')]['body']=htmlToText[_0xa9dd('0x84')](_0xac7776[_0xa9dd('0x18')][_0xa9dd('0x48')]);respondWithRpcPromise(_0xa9dd('0x85'),_0xa9dd('0x85'),{'event':_0xa9dd('0x8e'),'message':_0x14184f[_0xa9dd('0x18')]},client9002);return _0xac7776;}return null;})[_0xa9dd('0x25')](respondWithResult(_0x5c7a4e,null))[_0xa9dd('0x1b')](handleError(_0x5c7a4e,null));};exports[_0xa9dd('0x8f')]=function(_0x50a876,_0x8e235b){var _0x1ad819=moment()['unix']()[_0xa9dd('0x90')]();var _0x28b2a8=path['join'](config[_0xa9dd('0x5e')],_0xa9dd('0x91'),_0xa9dd('0x92'),_0xa9dd('0x93'));var _0x3df60c=path[_0xa9dd('0x94')](config['root'],_0xa9dd('0x91'),_0xa9dd('0x92'),'attachments');var _0x445a79=util[_0xa9dd('0x68')](_0xa9dd('0x95'),_0x1ad819);return db[_0xa9dd('0x2d')][_0xa9dd('0x47')]({'where':{'id':_0x50a876['params']['id']},'attributes':['id',_0xa9dd('0x48'),_0xa9dd('0x96'),'to','cc',_0xa9dd('0x97'),_0xa9dd('0x98'),_0xa9dd('0x99')],'include':_0x50a876['query']['attachments']?[{'model':db['Attachment'],'as':_0xa9dd('0x9a')}]:undefined})['then'](handleEntityNotFound(_0x8e235b,null))[_0xa9dd('0x25')](function(_0x1d91a9){if(_0x1d91a9){var _0x4cbc8f=_0x1d91a9;var _0x5e99c5={'from':_0x4cbc8f[_0xa9dd('0x96')],'to':_0x4cbc8f['to'],'subject':_0x4cbc8f[_0xa9dd('0x98')],'html':htmlEntities[_0xa9dd('0x9b')](_0x4cbc8f[_0xa9dd('0x48')]),'headers':{'Date':moment(_0x4cbc8f[_0xa9dd('0x99')])[_0xa9dd('0x68')](_0xa9dd('0x9c'))},'attachments':[]};if(_0x1d91a9['cc']){_0x5e99c5[_0xa9dd('0x9d')]['Cc']=_0x1d91a9['cc'];}if(_0x1d91a9[_0xa9dd('0x97')]){_0x5e99c5[_0xa9dd('0x9d')][_0xa9dd('0x9e')]=_0x1d91a9['bcc'];}return new BPromise(function(_0x770a02,_0x18cf45){if(_0x1d91a9[_0xa9dd('0x9a')]){for(var _0x118b73=0x0;_0x118b73<_0x1d91a9[_0xa9dd('0x9a')]['length'];_0x118b73++){var _0x170b30=_0x1d91a9['Attachments'][_0x118b73];var _0x3b311f=path['join'](_0x3df60c,_0x170b30[_0xa9dd('0x60')]);if(fs[_0xa9dd('0x9f')](_0x3b311f)){_0x5e99c5['attachments']['push']({'name':_0x170b30['name'],'contentType':_0x170b30[_0xa9dd('0x30')],'data':fs[_0xa9dd('0xa0')](_0x3b311f)});}}}emlformat['build'](_0x5e99c5,function(_0x501c01,_0x21b5eb){if(_0x501c01)return _0x18cf45(_0x501c01);fs['writeFileSync'](path[_0xa9dd('0x94')](_0x28b2a8,_0x445a79),_0x21b5eb);return _0x770a02(_0x21b5eb);});});}})[_0xa9dd('0x25')](function(_0x47e655){if(_0x47e655){return _0x8e235b[_0xa9dd('0x8f')](path[_0xa9dd('0x94')](_0x28b2a8,_0x445a79),_0x445a79,function(_0x56c375){if(!_0x56c375)fs[_0xa9dd('0xa1')](path[_0xa9dd('0x94')](_0x28b2a8,_0x445a79));});}})['catch'](handleError(_0x8e235b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 218a631..b9563c7 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 _0x5466=['events','../../mysqldb','MailMessage','setMaxListeners','update','emit','hook'];(function(_0x316cb5,_0x1fdf71){var _0x441d33=function(_0x13ecc1){while(--_0x13ecc1){_0x316cb5['push'](_0x316cb5['shift']());}};_0x441d33(++_0x1fdf71);}(_0x5466,0x142));var _0x6546=function(_0x4876bd,_0x43f5ef){_0x4876bd=_0x4876bd-0x0;var _0x3d2f58=_0x5466[_0x4876bd];return _0x3d2f58;};'use strict';var EventEmitter=require(_0x6546('0x0'));var MailMessage=require(_0x6546('0x1'))['db'][_0x6546('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6546('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6546('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b9a6e){return function(_0x29966f,_0x491f3f,_0x289d4e){MailMessageEvents[_0x6546('0x5')](_0x2b9a6e+':'+_0x29966f['id'],_0x29966f);MailMessageEvents['emit'](_0x2b9a6e,_0x29966f);_0x289d4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x6546('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x3b57=['save','update','remove','emit','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x4fe566,_0x93c45f){var _0x5e38e0=function(_0x419f46){while(--_0x419f46){_0x4fe566['push'](_0x4fe566['shift']());}};_0x5e38e0(++_0x93c45f);}(_0x3b57,0x95));var _0x73b5=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x3b57[_0x54d4a8];return _0x3b321b;};'use strict';var EventEmitter=require(_0x73b5('0x0'));var MailMessage=require(_0x73b5('0x1'))['db'][_0x73b5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x73b5('0x3')](0x0);var events={'afterCreate':_0x73b5('0x4'),'afterUpdate':_0x73b5('0x5'),'afterDestroy':_0x73b5('0x6')};function emitEvent(_0x325d98){return function(_0x48bd6c,_0x5a7745,_0x4d22b7){MailMessageEvents[_0x73b5('0x7')](_0x325d98+':'+_0x48bd6c['id'],_0x48bd6c);MailMessageEvents[_0x73b5('0x7')](_0x325d98,_0x48bd6c);_0x4d22b7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x73b5('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 d4a8255..43577e1 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 _0x5ad3=['createdAt','toLowerCase','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','html-to-text','rimraf','../../config/environment','exports','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','isNil','MailInteraction','findOne','MailInteractionId','update'];(function(_0x84f3d,_0x1cfcc9){var _0x3902d4=function(_0x39acb9){while(--_0x39acb9){_0x84f3d['push'](_0x84f3d['shift']());}};_0x3902d4(++_0x1cfcc9);}(_0x5ad3,0xd0));var _0x35ad=function(_0x38782c,_0x5c9fef){_0x38782c=_0x38782c-0x0;var _0x3708bf=_0x5ad3[_0x38782c];return _0x3708bf;};'use strict';var _=require(_0x35ad('0x0'));var util=require('util');var logger=require(_0x35ad('0x1'))(_0x35ad('0x2'));var moment=require('moment');var BPromise=require(_0x35ad('0x3'));var rp=require(_0x35ad('0x4'));var htmlToText=require(_0x35ad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35ad('0x6'));var config=require(_0x35ad('0x7'));var attributes=require('./mailMessage.attributes');module[_0x35ad('0x8')]=function(_0x21afe2,_0x4ea485){return _0x21afe2['define'](_0x35ad('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x35ad('0xa'),'fields':[_0x35ad('0xa')]},{'name':_0x35ad('0xb'),'fields':[_0x35ad('0xc'),'subject'],'type':_0x35ad('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2fa6aa,_0x224be2,_0x23c5fa){if(_0x2fa6aa[_0x35ad('0xe')]){_0x2fa6aa['plainBody']=htmlToText[_0x35ad('0xf')](_0x2fa6aa[_0x35ad('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x23c5fa(null,_0x224be2);},'afterCreate':function(_0x86f8ad,_0x2571b9,_0x1f2bc9){var _0x4f2d0d=_0x21afe2[_0x35ad('0x10')];var _0x9d2892=_0x86f8ad[_0x35ad('0x11')]({'plain':!![]});if(_0x9d2892[_0x35ad('0x12')]['toLowerCase']()==='in'||_0x9d2892[_0x35ad('0x12')]['toLowerCase']()==='out'&&!_0x9d2892['secret']&&!_[_0x35ad('0x13')](_0x9d2892['UserId'])){_0x4f2d0d[_0x35ad('0x14')][_0x35ad('0x15')]({'where':{'id':_0x9d2892[_0x35ad('0x16')]}})['then'](function(_0x714119){if(_0x714119){_0x714119[_0x35ad('0x17')]({'lastMsgAt':_0x9d2892[_0x35ad('0x18')],'lastMsgDirection':_0x9d2892[_0x35ad('0x12')][_0x35ad('0x19')]()});}})[_0x35ad('0x1a')](function(_0x18db6c){console['error'](_0x18db6c);});}_0x1f2bc9();}},'charset':_0x35ad('0x1b'),'collate':_0x35ad('0x1c')});}; \ No newline at end of file +var _0xe26f=['FULLTEXT','body','fromString','get','direction','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','plainBody'];(function(_0x15d98e,_0x16d51d){var _0x191cf0=function(_0x187e1c){while(--_0x187e1c){_0x15d98e['push'](_0x15d98e['shift']());}};_0x191cf0(++_0x16d51d);}(_0xe26f,0x1df));var _0xfe26=function(_0x14b4ed,_0x35e3b9){_0x14b4ed=_0x14b4ed-0x0;var _0x386aa4=_0xe26f[_0x14b4ed];return _0x386aa4;};'use strict';var _=require(_0xfe26('0x0'));var util=require(_0xfe26('0x1'));var logger=require(_0xfe26('0x2'))('api');var moment=require(_0xfe26('0x3'));var BPromise=require(_0xfe26('0x4'));var rp=require(_0xfe26('0x5'));var htmlToText=require(_0xfe26('0x6'));var fs=require('fs');var path=require(_0xfe26('0x7'));var rimraf=require(_0xfe26('0x8'));var config=require(_0xfe26('0x9'));var attributes=require(_0xfe26('0xa'));module[_0xfe26('0xb')]=function(_0xba98b4,_0x1cd6f9){return _0xba98b4[_0xfe26('0xc')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfe26('0xd')]},{'name':_0xfe26('0xe'),'fields':[_0xfe26('0xf'),'subject'],'type':_0xfe26('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x191c03,_0x33b1e4,_0x3c3b2e){if(_0x191c03[_0xfe26('0x11')]){_0x191c03[_0xfe26('0xf')]=htmlToText[_0xfe26('0x12')](_0x191c03[_0xfe26('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3c3b2e(null,_0x33b1e4);},'afterCreate':function(_0x44d1a9,_0x3761df,_0x187e2b){var _0x4d9c26=_0xba98b4['models'];var _0xaa101=_0x44d1a9[_0xfe26('0x13')]({'plain':!![]});if(_0xaa101[_0xfe26('0x14')]['toLowerCase']()==='in'||_0xaa101[_0xfe26('0x14')]['toLowerCase']()===_0xfe26('0x15')&&!_0xaa101[_0xfe26('0x16')]&&!_[_0xfe26('0x17')](_0xaa101[_0xfe26('0x18')])){_0x4d9c26['MailInteraction'][_0xfe26('0x19')]({'where':{'id':_0xaa101[_0xfe26('0x1a')]}})[_0xfe26('0x1b')](function(_0x4b5772){if(_0x4b5772){_0x4b5772[_0xfe26('0x1c')]({'lastMsgAt':_0xaa101[_0xfe26('0x1d')],'lastMsgDirection':_0xaa101[_0xfe26('0x14')]['toLowerCase']()});}})['catch'](function(_0x1571f8){console[_0xfe26('0x1e')](_0x1571f8);});}_0x187e2b();}},'charset':_0xfe26('0x1f'),'collate':_0xfe26('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index e1ae844..c4b116b 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 _0x1c9a=['raw','CreateMailMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','MailMessage','create','options'];(function(_0x28b6b6,_0x2b6571){var _0x34dc9b=function(_0xf2fff8){while(--_0xf2fff8){_0x28b6b6['push'](_0x28b6b6['shift']());}};_0x34dc9b(++_0x2b6571);}(_0x1c9a,0x98));var _0xa1c9=function(_0x2bbf3c,_0x265e51){_0x2bbf3c=_0x2bbf3c-0x0;var _0x3363b4=_0x1c9a[_0x2bbf3c];return _0x3363b4;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});config['redis']=_[_0xa1c9('0xa')](config[_0xa1c9('0xb')],{'host':_0xa1c9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1c9('0xb')]));require(_0xa1c9('0xd'))[_0xa1c9('0xe')](socket);function respondWithRpcPromise(_0x1efbab,_0x493cf6,_0x27b020){return new BPromise(function(_0x4437f2,_0x29e24a){return client[_0xa1c9('0xf')](_0x1efbab,_0x27b020)[_0xa1c9('0x10')](function(_0xbb76ef){logger[_0xa1c9('0x11')](_0xa1c9('0x12'),_0x493cf6,_0xa1c9('0x13'));logger[_0xa1c9('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x493cf6,_0xa1c9('0x13'),JSON[_0xa1c9('0x15')](_0xbb76ef));if(_0xbb76ef[_0xa1c9('0x16')]){if(_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x17')]===0x1f4){logger['error'](_0xa1c9('0x12'),_0x493cf6,_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);return _0x29e24a(_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);}logger[_0xa1c9('0x16')](_0xa1c9('0x12'),_0x493cf6,_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);return _0x4437f2(_0xbb76ef[_0xa1c9('0x16')]['message']);}else{logger[_0xa1c9('0x11')](_0xa1c9('0x12'),_0x493cf6,_0xa1c9('0x13'));_0x4437f2(_0xbb76ef['result'][_0xa1c9('0x18')]);}})['catch'](function(_0x21cd35){logger[_0xa1c9('0x16')](_0xa1c9('0x12'),_0x493cf6,_0x21cd35);_0x29e24a(_0x21cd35);});});}exports['CreateMailMessage']=function(_0x3a1110){var _0x46b1e4=this;return new Promise(function(_0x128732,_0x4edf37){return db[_0xa1c9('0x19')][_0xa1c9('0x1a')](_0x3a1110['body'],{'raw':_0x3a1110[_0xa1c9('0x1b')]?_0x3a1110[_0xa1c9('0x1b')][_0xa1c9('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x29f1b1){logger[_0xa1c9('0x11')](_0xa1c9('0x1d'),_0x3a1110);logger[_0xa1c9('0x14')](_0xa1c9('0x1d'),_0x3a1110,JSON['stringify'](_0x29f1b1));_0x128732(_0x29f1b1);})['catch'](function(_0x200749){logger['error'](_0xa1c9('0x1d'),_0x200749[_0xa1c9('0x18')],_0x3a1110);_0x4edf37(_0x46b1e4[_0xa1c9('0x16')](0x1f4,_0x200749[_0xa1c9('0x18')]));});});}; \ No newline at end of file +var _0xf4f4=['message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','then','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x53fb38,_0x2918ee){var _0x1d516f=function(_0xc60b63){while(--_0xc60b63){_0x53fb38['push'](_0x53fb38['shift']());}};_0x1d516f(++_0x2918ee);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x4b2471,_0xedb897){_0x4b2471=_0x4b2471-0x0;var _0x7a8c13=_0xf4f4[_0x4b2471];return _0x7a8c13;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});config[_0x4f4f('0xb')]=_[_0x4f4f('0xc')](config[_0x4f4f('0xb')],{'host':_0x4f4f('0xd'),'port':0x18eb});var socket=require(_0x4f4f('0xe'))(new Redis(config['redis']));require(_0x4f4f('0xf'))[_0x4f4f('0x10')](socket);function respondWithRpcPromise(_0x39e36b,_0x2d86d1,_0x116f22){return new BPromise(function(_0x11940f,_0x87a9a2){return client[_0x4f4f('0x11')](_0x39e36b,_0x116f22)['then'](function(_0x5956c6){logger[_0x4f4f('0x12')](_0x4f4f('0x13'),_0x2d86d1,_0x4f4f('0x14'));logger[_0x4f4f('0x15')](_0x4f4f('0x16'),_0x2d86d1,_0x4f4f('0x14'),JSON['stringify'](_0x5956c6));if(_0x5956c6[_0x4f4f('0x17')]){if(_0x5956c6['error'][_0x4f4f('0x18')]===0x1f4){logger[_0x4f4f('0x17')](_0x4f4f('0x13'),_0x2d86d1,_0x5956c6[_0x4f4f('0x17')]['message']);return _0x87a9a2(_0x5956c6[_0x4f4f('0x17')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2d86d1,_0x5956c6[_0x4f4f('0x17')][_0x4f4f('0x19')]);return _0x11940f(_0x5956c6[_0x4f4f('0x17')][_0x4f4f('0x19')]);}else{logger[_0x4f4f('0x12')](_0x4f4f('0x13'),_0x2d86d1,_0x4f4f('0x14'));_0x11940f(_0x5956c6[_0x4f4f('0x1a')][_0x4f4f('0x19')]);}})[_0x4f4f('0x1b')](function(_0x32b549){logger[_0x4f4f('0x17')]('MailMessage,\x20%s,\x20%s',_0x2d86d1,_0x32b549);_0x87a9a2(_0x32b549);});});}exports[_0x4f4f('0x1c')]=function(_0x4622c2){var _0x2f84e5=this;return new Promise(function(_0x201c60,_0x302a79){return db[_0x4f4f('0x1d')][_0x4f4f('0x1e')](_0x4622c2[_0x4f4f('0x1f')],{'raw':_0x4622c2[_0x4f4f('0x20')]?_0x4622c2[_0x4f4f('0x20')][_0x4f4f('0x21')]===undefined?!![]:![]:!![]})[_0x4f4f('0x22')](function(_0x17984d){logger[_0x4f4f('0x12')]('CreateMailMessage',_0x4622c2);logger['debug']('CreateMailMessage',_0x4622c2,JSON[_0x4f4f('0x23')](_0x17984d));_0x201c60(_0x17984d);})[_0x4f4f('0x1b')](function(_0x5186ac){logger[_0x4f4f('0x17')](_0x4f4f('0x1c'),_0x5186ac[_0x4f4f('0x19')],_0x4622c2);_0x302a79(_0x2f84e5[_0x4f4f('0x17')](0x1f4,_0x5186ac[_0x4f4f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 74efa11..93341ba 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 _0x4deb=['./mailMessage.events','save','update','removeListener','register','length','mailMessage:'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x4deb,0x17a));var _0xb4de=function(_0x5c2bef,_0x16806e){_0x5c2bef=_0x5c2bef-0x0;var _0xd60cc1=_0x4deb[_0x5c2bef];return _0xd60cc1;};'use strict';var MailMessageEvents=require(_0xb4de('0x0'));var events=[_0xb4de('0x1'),'remove',_0xb4de('0x2')];function createListener(_0x464235,_0xde1e44){return function(_0x30f751){_0xde1e44['emit'](_0x464235,_0x30f751);};}function removeListener(_0x21e86c,_0x2ec52b){return function(){MailMessageEvents[_0xb4de('0x3')](_0x21e86c,_0x2ec52b);};}exports[_0xb4de('0x4')]=function(_0x58d73e){for(var _0xa4b739=0x0,_0x1d3865=events[_0xb4de('0x5')];_0xa4b739<_0x1d3865;_0xa4b739++){var _0x46eb88=events[_0xa4b739];var _0x2b3c39=createListener(_0xb4de('0x6')+_0x46eb88,_0x58d73e);MailMessageEvents['on'](_0x46eb88,_0x2b3c39);}}; \ No newline at end of file +var _0xbf94=['remove','update','emit','removeListener','length','mailMessage:','./mailMessage.events','save'];(function(_0x47d193,_0x3d630b){var _0x442d26=function(_0x492730){while(--_0x492730){_0x47d193['push'](_0x47d193['shift']());}};_0x442d26(++_0x3d630b);}(_0xbf94,0x146));var _0x4bf9=function(_0x4f3713,_0x278efe){_0x4f3713=_0x4f3713-0x0;var _0x7f7e93=_0xbf94[_0x4f3713];return _0x7f7e93;};'use strict';var MailMessageEvents=require(_0x4bf9('0x0'));var events=[_0x4bf9('0x1'),_0x4bf9('0x2'),_0x4bf9('0x3')];function createListener(_0x4bad03,_0xbeac45){return function(_0x482f22){_0xbeac45[_0x4bf9('0x4')](_0x4bad03,_0x482f22);};}function removeListener(_0x5d0350,_0x20f685){return function(){MailMessageEvents[_0x4bf9('0x5')](_0x5d0350,_0x20f685);};}exports['register']=function(_0x1ef7f1){for(var _0x5a2932=0x0,_0xa6de4b=events[_0x4bf9('0x6')];_0x5a2932<_0xa6de4b;_0x5a2932++){var _0x42283a=events[_0x5a2932];var _0xd169c1=createListener(_0x4bf9('0x7')+_0x42283a,_0x1ef7f1);MailMessageEvents['on'](_0x42283a,_0xd169c1);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 1a04dbf..a64cd8a 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 _0xacd8=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams'];(function(_0x41f4d2,_0x15f046){var _0x3b3881=function(_0x3b3b56){while(--_0x3b3b56){_0x41f4d2['push'](_0x41f4d2['shift']());}};_0x3b3881(++_0x15f046);}(_0xacd8,0x157));var _0x8acd=function(_0x11ed0e,_0x6a39ef){_0x11ed0e=_0x11ed0e-0x0;var _0x58756b=_0xacd8[_0x11ed0e];return _0x58756b;};'use strict';var multer=require('multer');var util=require(_0x8acd('0x0'));var path=require(_0x8acd('0x1'));var timeout=require(_0x8acd('0x2'));var express=require(_0x8acd('0x3'));var router=express[_0x8acd('0x4')]();var fs_extra=require(_0x8acd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8acd('0x6'));var config=require(_0x8acd('0x7'));var controller=require(_0x8acd('0x8'));router[_0x8acd('0x9')]('/',auth[_0x8acd('0xa')](),controller['index']);router[_0x8acd('0x9')](_0x8acd('0xb'),auth[_0x8acd('0xa')](),controller[_0x8acd('0xc')]);router[_0x8acd('0x9')](_0x8acd('0xd'),auth[_0x8acd('0xa')](),controller[_0x8acd('0xe')]);router['get'](_0x8acd('0xf'),auth[_0x8acd('0xa')](),controller['getMembers']);router[_0x8acd('0x9')](_0x8acd('0x10'),auth[_0x8acd('0xa')](),controller[_0x8acd('0x11')]);router[_0x8acd('0x9')](_0x8acd('0x12'),auth[_0x8acd('0xa')](),controller[_0x8acd('0x13')]);router[_0x8acd('0x14')]('/',auth[_0x8acd('0xa')](),controller[_0x8acd('0x15')]);router['post'](_0x8acd('0x10'),auth[_0x8acd('0xa')](),controller[_0x8acd('0x16')]);router['post'](_0x8acd('0x12'),auth[_0x8acd('0xa')](),controller[_0x8acd('0x17')]);router[_0x8acd('0x18')](_0x8acd('0xd'),auth[_0x8acd('0xa')](),controller['update']);router['delete'](_0x8acd('0xd'),auth[_0x8acd('0xa')](),controller[_0x8acd('0x19')]);router[_0x8acd('0x1a')](_0x8acd('0x10'),auth[_0x8acd('0xa')](),controller[_0x8acd('0x1b')]);router[_0x8acd('0x1a')]('/:id/users',auth[_0x8acd('0xa')](),controller[_0x8acd('0x1c')]);module[_0x8acd('0x1d')]=router; \ No newline at end of file +var _0x3236=['getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0xc3f0e,_0x39c9e0){var _0x66a7bc=function(_0x316ff6){while(--_0x316ff6){_0xc3f0e['push'](_0xc3f0e['shift']());}};_0x66a7bc(++_0x39c9e0);}(_0x3236,0x1e7));var _0x6323=function(_0x7dbadb,_0x5d2a9a){_0x7dbadb=_0x7dbadb-0x0;var _0xf8cc5a=_0x3236[_0x7dbadb];return _0xf8cc5a;};'use strict';var multer=require('multer');var util=require(_0x6323('0x0'));var path=require('path');var timeout=require(_0x6323('0x1'));var express=require(_0x6323('0x2'));var router=express[_0x6323('0x3')]();var fs_extra=require(_0x6323('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6323('0x5'));var config=require(_0x6323('0x6'));var controller=require('./mailQueue.controller');router[_0x6323('0x7')]('/',auth[_0x6323('0x8')](),controller['index']);router['get'](_0x6323('0x9'),auth[_0x6323('0x8')](),controller['describe']);router[_0x6323('0x7')](_0x6323('0xa'),auth[_0x6323('0x8')](),controller[_0x6323('0xb')]);router[_0x6323('0x7')](_0x6323('0xc'),auth[_0x6323('0x8')](),controller[_0x6323('0xd')]);router[_0x6323('0x7')](_0x6323('0xe'),auth[_0x6323('0x8')](),controller[_0x6323('0xf')]);router['get'](_0x6323('0x10'),auth[_0x6323('0x8')](),controller[_0x6323('0x11')]);router[_0x6323('0x12')]('/',auth[_0x6323('0x8')](),controller[_0x6323('0x13')]);router[_0x6323('0x12')](_0x6323('0xe'),auth[_0x6323('0x8')](),controller[_0x6323('0x14')]);router[_0x6323('0x12')](_0x6323('0x10'),auth[_0x6323('0x8')](),controller[_0x6323('0x15')]);router[_0x6323('0x16')](_0x6323('0xa'),auth[_0x6323('0x8')](),controller[_0x6323('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6323('0x18')]);router[_0x6323('0x19')](_0x6323('0xe'),auth[_0x6323('0x8')](),controller[_0x6323('0x1a')]);router[_0x6323('0x19')]('/:id/users',auth[_0x6323('0x8')](),controller['removeAgents']);module[_0x6323('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 2e5c9c6..b1c4390 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 _0x15e0=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0xc1164b,_0x48bb06){var _0x171878=function(_0x3857a6){while(--_0x3857a6){_0xc1164b['push'](_0xc1164b['shift']());}};_0x171878(++_0x48bb06);}(_0x15e0,0x118));var _0x015e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x15e0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x015e('0x0'));module[_0x015e('0x1')]={'name':{'type':Sequelize[_0x015e('0x2')],'unique':_0x015e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x015e('0x2')]},'timeout':{'type':Sequelize[_0x015e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x015e('0x5'),_0x015e('0x6'),_0x015e('0x7'))}}; \ No newline at end of file +var _0x3624=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0xfc8a4a,_0x350c20){var _0x1eed08=function(_0x13faf4){while(--_0x13faf4){_0xfc8a4a['push'](_0xfc8a4a['shift']());}};_0x1eed08(++_0x350c20);}(_0x3624,0x80));var _0x4362=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0x3624[_0x158f01];return _0x5ef74e;};'use strict';var Sequelize=require(_0x4362('0x0'));module[_0x4362('0x1')]={'name':{'type':Sequelize[_0x4362('0x2')],'unique':_0x4362('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4362('0x2')]},'timeout':{'type':Sequelize[_0x4362('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4362('0x5')](_0x4362('0x6'),_0x4362('0x7'),_0x4362('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 5968b40..75b27f8 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 _0x1cbb=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','reject','save','then','destroy','MailQueues','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','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','update','describe','getMembers','UserMailQueue','MailQueueId','User','agent','mailPause','updatedAt','format','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','includes','all','union','compact','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3b7c7a,_0x4bf58e){var _0x385977=function(_0x4f819b){while(--_0x4f819b){_0x3b7c7a['push'](_0x3b7c7a['shift']());}};_0x385977(++_0x4bf58e);}(_0x1cbb,0x18f));var _0xb1cb=function(_0x4ccdc4,_0x9d26d7){_0x4ccdc4=_0x4ccdc4-0x0;var _0x5d06cf=_0x1cbb[_0x4ccdc4];return _0x5d06cf;};'use strict';var emlformat=require(_0xb1cb('0x0'));var rimraf=require(_0xb1cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1cb('0x2'));var rp=require(_0xb1cb('0x3'));var moment=require(_0xb1cb('0x4'));var BPromise=require(_0xb1cb('0x5'));var Mustache=require(_0xb1cb('0x6'));var util=require('util');var path=require(_0xb1cb('0x7'));var sox=require(_0xb1cb('0x8'));var csv=require(_0xb1cb('0x9'));var ejs=require(_0xb1cb('0xa'));var fs=require('fs');var fs_extra=require(_0xb1cb('0xb'));var _=require(_0xb1cb('0xc'));var squel=require(_0xb1cb('0xd'));var crypto=require(_0xb1cb('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1cb('0x9'));var querystring=require(_0xb1cb('0xf'));var Papa=require(_0xb1cb('0x10'));var Redis=require(_0xb1cb('0x11'));var authService=require(_0xb1cb('0x12'));var qs=require(_0xb1cb('0x13'));var as=require(_0xb1cb('0x14'));var hardwareService=require(_0xb1cb('0x15'));var logger=require(_0xb1cb('0x16'))(_0xb1cb('0x17'));var utils=require(_0xb1cb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb1cb('0x19'));var db=require(_0xb1cb('0x1a'))['db'];config[_0xb1cb('0x1b')]=_['defaults'](config['redis'],{'host':_0xb1cb('0x1c'),'port':0x18eb});var socket=require(_0xb1cb('0x1d'))(new Redis(config[_0xb1cb('0x1b')]));require(_0xb1cb('0x1e'))[_0xb1cb('0x1f')](socket);function respondWithStatusCode(_0x25c4bb,_0xd7bbb4){_0xd7bbb4=_0xd7bbb4||0xcc;return function(_0x4e2ff1){if(_0x4e2ff1){return _0x25c4bb[_0xb1cb('0x20')](_0xd7bbb4);}return _0x25c4bb['status'](_0xd7bbb4)[_0xb1cb('0x21')]();};}function respondWithResult(_0x30cc90,_0xb21125){_0xb21125=_0xb21125||0xc8;return function(_0x2be72b){if(_0x2be72b){return _0x30cc90[_0xb1cb('0x22')](_0xb21125)[_0xb1cb('0x23')](_0x2be72b);}};}function respondWithFilteredResult(_0x24fe9a,_0x55d6ad){return function(_0x12487f){if(_0x12487f){var _0x1a551e=typeof _0x55d6ad[_0xb1cb('0x24')]===_0xb1cb('0x25')&&typeof _0x55d6ad['limit']===_0xb1cb('0x25');var _0xb18ce9=_0x12487f[_0xb1cb('0x26')];var _0x3a67be=_0x1a551e?0x0:_0x55d6ad[_0xb1cb('0x24')];var _0x5696dc=_0x1a551e?_0x12487f['count']:_0x55d6ad[_0xb1cb('0x24')]+_0x55d6ad[_0xb1cb('0x27')];var _0x16cb46;if(_0x5696dc>=_0xb18ce9){_0x5696dc=_0xb18ce9;_0x16cb46=0xc8;}else{_0x16cb46=0xce;}_0x24fe9a['status'](_0x16cb46);return _0x24fe9a['set']('Content-Range',_0x3a67be+'-'+_0x5696dc+'/'+_0xb18ce9)[_0xb1cb('0x23')](_0x12487f);}return null;};}function patchUpdates(_0x59555c){return function(_0x56b834){try{jsonpatch['apply'](_0x56b834,_0x59555c,!![]);}catch(_0x4ed274){return BPromise[_0xb1cb('0x28')](_0x4ed274);}return _0x56b834[_0xb1cb('0x29')]();};}function saveUpdates(_0x174331,_0x31d4f7){return function(_0x3e8da0){if(_0x3e8da0){return _0x3e8da0['update'](_0x174331)[_0xb1cb('0x2a')](function(_0xe6e782){return _0xe6e782;});}return null;};}function removeEntity(_0x5a7e74,_0x1f4ae3){return function(_0xb17ad6){if(_0xb17ad6){return _0xb17ad6[_0xb1cb('0x2b')]()[_0xb1cb('0x2a')](function(){var _0x253d1b=_0xb17ad6['get']({'plain':!![]});var _0x57bf4c=_0xb1cb('0x2c');return db['UserProfileResource'][_0xb1cb('0x2b')]({'where':{'type':_0x57bf4c,'resourceId':_0x253d1b['id']}})[_0xb1cb('0x2a')](function(){return _0xb17ad6;});})[_0xb1cb('0x2a')](function(){_0x5a7e74['status'](0xcc)[_0xb1cb('0x21')]();});}};}function handleEntityNotFound(_0x100471,_0xf08c34){return function(_0x1ced8a){if(!_0x1ced8a){_0x100471[_0xb1cb('0x20')](0x194);}return _0x1ced8a;};}function handleError(_0x3dda90,_0x343892){_0x343892=_0x343892||0x1f4;return function(_0x388134){logger[_0xb1cb('0x2d')](_0x388134[_0xb1cb('0x2e')]);if(_0x388134[_0xb1cb('0x2f')]){delete _0x388134[_0xb1cb('0x2f')];}_0x3dda90[_0xb1cb('0x22')](_0x343892)[_0xb1cb('0x30')](_0x388134);};}exports['index']=function(_0x2eac6e,_0x1dbf6e){var _0x49bf35={},_0x3a6f0f={},_0xbc9bd2={'count':0x0,'rows':[]};var _0x58fbf6=_['map'](db[_0xb1cb('0x31')][_0xb1cb('0x32')],function(_0x585068){return{'name':_0x585068[_0xb1cb('0x33')],'type':_0x585068[_0xb1cb('0x34')][_0xb1cb('0x35')]};});_0x3a6f0f['model']=_[_0xb1cb('0x36')](_0x58fbf6,'name');_0x3a6f0f[_0xb1cb('0x37')]=_[_0xb1cb('0x38')](_0x2eac6e[_0xb1cb('0x37')]);_0x3a6f0f[_0xb1cb('0x39')]=_['intersection'](_0x3a6f0f[_0xb1cb('0x3a')],_0x3a6f0f[_0xb1cb('0x37')]);_0x49bf35[_0xb1cb('0x3b')]=_[_0xb1cb('0x3c')](_0x3a6f0f[_0xb1cb('0x3a')],qs[_0xb1cb('0x3d')](_0x2eac6e[_0xb1cb('0x37')][_0xb1cb('0x3d')]));_0x49bf35[_0xb1cb('0x3b')]=_0x49bf35['attributes'][_0xb1cb('0x3e')]?_0x49bf35[_0xb1cb('0x3b')]:_0x3a6f0f[_0xb1cb('0x3a')];if(!_0x2eac6e['query'][_0xb1cb('0x3f')](_0xb1cb('0x40'))){_0x49bf35[_0xb1cb('0x27')]=qs[_0xb1cb('0x27')](_0x2eac6e[_0xb1cb('0x37')][_0xb1cb('0x27')]);_0x49bf35[_0xb1cb('0x24')]=qs[_0xb1cb('0x24')](_0x2eac6e['query'][_0xb1cb('0x24')]);}_0x49bf35[_0xb1cb('0x41')]=qs[_0xb1cb('0x42')](_0x2eac6e[_0xb1cb('0x37')][_0xb1cb('0x42')]);_0x49bf35[_0xb1cb('0x43')]=qs[_0xb1cb('0x39')](_[_0xb1cb('0x44')](_0x2eac6e[_0xb1cb('0x37')],_0x3a6f0f[_0xb1cb('0x39')]),_0x58fbf6);if(_0x2eac6e[_0xb1cb('0x37')]['filter']){_0x49bf35[_0xb1cb('0x43')]=_[_0xb1cb('0x45')](_0x49bf35[_0xb1cb('0x43')],{'$or':_[_0xb1cb('0x36')](_0x58fbf6,function(_0x51a2e8){if(_0x51a2e8[_0xb1cb('0x34')]!==_0xb1cb('0x46')){var _0x31bd5b={};_0x31bd5b[_0x51a2e8[_0xb1cb('0x2f')]]={'$like':'%'+_0x2eac6e[_0xb1cb('0x37')][_0xb1cb('0x47')]+'%'};return _0x31bd5b;}})});}_0x49bf35=_[_0xb1cb('0x45')]({},_0x49bf35,_0x2eac6e['options']);var _0xae3d41={'where':_0x49bf35[_0xb1cb('0x43')]};return db[_0xb1cb('0x31')][_0xb1cb('0x26')](_0xae3d41)[_0xb1cb('0x2a')](function(_0x21cf3b){_0xbc9bd2['count']=_0x21cf3b;if(_0x2eac6e['query'][_0xb1cb('0x48')]){_0x49bf35[_0xb1cb('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0xb1cb('0x4a')](_0x49bf35);})[_0xb1cb('0x2a')](function(_0x168acd){_0xbc9bd2[_0xb1cb('0x4b')]=_0x168acd;return _0xbc9bd2;})[_0xb1cb('0x2a')](respondWithFilteredResult(_0x1dbf6e,_0x49bf35))[_0xb1cb('0x4c')](handleError(_0x1dbf6e,null));};exports[_0xb1cb('0x4d')]=function(_0x49eb3f,_0x3273e8){var _0x453c2f={'raw':!![],'where':{'id':_0x49eb3f[_0xb1cb('0x4e')]['id']}},_0x563e56={};_0x563e56[_0xb1cb('0x3a')]=_['keys'](db[_0xb1cb('0x31')][_0xb1cb('0x32')]);_0x563e56['query']=_['keys'](_0x49eb3f[_0xb1cb('0x37')]);_0x563e56[_0xb1cb('0x39')]=_[_0xb1cb('0x3c')](_0x563e56['model'],_0x563e56['query']);_0x453c2f[_0xb1cb('0x3b')]=_[_0xb1cb('0x3c')](_0x563e56[_0xb1cb('0x3a')],qs[_0xb1cb('0x3d')](_0x49eb3f[_0xb1cb('0x37')][_0xb1cb('0x3d')]));_0x453c2f['attributes']=_0x453c2f[_0xb1cb('0x3b')]['length']?_0x453c2f[_0xb1cb('0x3b')]:_0x563e56[_0xb1cb('0x3a')];if(_0x49eb3f[_0xb1cb('0x37')][_0xb1cb('0x48')]){_0x453c2f[_0xb1cb('0x49')]=[{'all':!![]}];}_0x453c2f=_['merge']({},_0x453c2f,_0x49eb3f[_0xb1cb('0x4f')]);return db[_0xb1cb('0x31')][_0xb1cb('0x50')](_0x453c2f)['then'](handleEntityNotFound(_0x3273e8,null))[_0xb1cb('0x2a')](respondWithResult(_0x3273e8,null))['catch'](handleError(_0x3273e8,null));};exports['create']=function(_0x4c8587,_0x2e1305){return db['MailQueue'][_0xb1cb('0x51')](_0x4c8587[_0xb1cb('0x52')],{})[_0xb1cb('0x2a')](function(_0x49d71a){var _0x46b00d=_0x4c8587[_0xb1cb('0x53')][_0xb1cb('0x54')]({'plain':!![]});if(!_0x46b00d)throw new Error(_0xb1cb('0x55'));if(_0x46b00d[_0xb1cb('0x56')]===_0xb1cb('0x53')){var _0x8a25ca=_0x49d71a[_0xb1cb('0x54')]({'plain':!![]});var _0x4351e7=_0xb1cb('0x2c');return db[_0xb1cb('0x57')][_0xb1cb('0x50')]({'where':{'name':_0x4351e7,'userProfileId':_0x46b00d[_0xb1cb('0x58')]},'raw':!![]})[_0xb1cb('0x2a')](function(_0x25e3f2){if(_0x25e3f2&&_0x25e3f2['autoAssociation']===0x0){return db['UserProfileResource'][_0xb1cb('0x51')]({'name':_0x8a25ca[_0xb1cb('0x2f')],'resourceId':_0x8a25ca['id'],'type':_0x25e3f2['name'],'sectionId':_0x25e3f2['id']},{})['then'](function(){return _0x49d71a;});}else{return _0x49d71a;}})[_0xb1cb('0x4c')](function(_0x36ad1b){logger[_0xb1cb('0x2d')](_0xb1cb('0x59'),_0x36ad1b);throw _0x36ad1b;});}return _0x49d71a;})[_0xb1cb('0x2a')](respondWithResult(_0x2e1305,0xc9))[_0xb1cb('0x4c')](handleError(_0x2e1305,null));};exports[_0xb1cb('0x5a')]=function(_0xd05172,_0x48f68b){if(_0xd05172[_0xb1cb('0x52')]['id']){delete _0xd05172[_0xb1cb('0x52')]['id'];}return db[_0xb1cb('0x31')][_0xb1cb('0x50')]({'where':{'id':_0xd05172[_0xb1cb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48f68b,null))[_0xb1cb('0x2a')](saveUpdates(_0xd05172['body'],null))[_0xb1cb('0x2a')](respondWithResult(_0x48f68b,null))[_0xb1cb('0x4c')](handleError(_0x48f68b,null));};exports[_0xb1cb('0x2b')]=function(_0x49e1e2,_0x48dd52){return db['MailQueue']['find']({'where':{'id':_0x49e1e2['params']['id']}})['then'](handleEntityNotFound(_0x48dd52,null))['then'](removeEntity(_0x48dd52,null))['catch'](handleError(_0x48dd52,null));};exports['describe']=function(_0x2537e9,_0x564b9d){return db['MailQueue'][_0xb1cb('0x5b')]()['then'](respondWithResult(_0x564b9d,null))['catch'](handleError(_0x564b9d,null));};exports[_0xb1cb('0x5c')]=function(_0x204ccd,_0x681530,_0x288d95){var _0x5d0b0c={'raw':!![],'where':{}},_0x527d09={},_0x43e6f2;return db['MailQueue']['findOne']({'where':{'id':_0x204ccd['params']['id']}})[_0xb1cb('0x2a')](handleEntityNotFound(_0x681530,null))[_0xb1cb('0x2a')](function(_0xbb87ce){if(_0xbb87ce){_0x43e6f2=_0xbb87ce[_0xb1cb('0x54')]({'plain':!![]});_0x527d09[_0xb1cb('0x3a')]=_[_0xb1cb('0x38')](db[_0xb1cb('0x5d')][_0xb1cb('0x32')]);_0x527d09['query']=_[_0xb1cb('0x38')](_0x204ccd[_0xb1cb('0x37')]);_0x527d09[_0xb1cb('0x39')]=_[_0xb1cb('0x3c')](_0x527d09[_0xb1cb('0x3a')],_0x527d09[_0xb1cb('0x37')]);_0x5d0b0c[_0xb1cb('0x3b')]=_[_0xb1cb('0x3c')](_0x527d09[_0xb1cb('0x3a')],qs[_0xb1cb('0x3d')](_0x204ccd[_0xb1cb('0x37')][_0xb1cb('0x3d')]));_0x5d0b0c['attributes']=_0x5d0b0c['attributes']['length']?_0x5d0b0c[_0xb1cb('0x3b')]:_0x527d09[_0xb1cb('0x3a')];if(!_0x204ccd[_0xb1cb('0x37')][_0xb1cb('0x3f')](_0xb1cb('0x40'))){_0x5d0b0c['limit']=qs['limit'](_0x204ccd[_0xb1cb('0x37')][_0xb1cb('0x27')]);_0x5d0b0c['offset']=qs[_0xb1cb('0x24')](_0x204ccd[_0xb1cb('0x37')]['offset']);}_0x5d0b0c[_0xb1cb('0x41')]=qs['sort'](_0x204ccd[_0xb1cb('0x37')]['sort']);_0x5d0b0c[_0xb1cb('0x43')]=qs[_0xb1cb('0x39')](_[_0xb1cb('0x44')](_0x204ccd[_0xb1cb('0x37')],_0x527d09['filters']));_0x5d0b0c[_0xb1cb('0x43')][_0xb1cb('0x5e')]=_0xbb87ce['id'];if(_0x204ccd['query'][_0xb1cb('0x47')]){_0x5d0b0c[_0xb1cb('0x43')]=_['merge'](_0x5d0b0c[_0xb1cb('0x43')],{'$or':_[_0xb1cb('0x36')](_0x5d0b0c[_0xb1cb('0x3b')],function(_0x23835){var _0x13a02f={};_0x13a02f[_0x23835]={'$like':'%'+_0x204ccd[_0xb1cb('0x37')][_0xb1cb('0x47')]+'%'};return _0x13a02f;})});}_0x5d0b0c=_[_0xb1cb('0x45')]({},_0x5d0b0c,_0x204ccd[_0xb1cb('0x4f')]);return db[_0xb1cb('0x5d')][_0xb1cb('0x4a')](_0x5d0b0c);}})[_0xb1cb('0x2a')](function(_0x3f8ec0){if(_0x3f8ec0){return db[_0xb1cb('0x5f')]['findAndCountAll']({'where':{'id':_[_0xb1cb('0x36')](_0x3f8ec0,'UserId'),'role':_0xb1cb('0x60')},'attributes':['id',_0xb1cb('0x2f'),_0xb1cb('0x61'),_0xb1cb('0x62'),'createdAt']});}})['then'](function(_0x135b4f){if(_0x135b4f){return{'count':_0x135b4f[_0xb1cb('0x26')],'rows':_['map'](_0x135b4f['rows'],function(_0x33b395){return{'membername':_0x33b395[_0xb1cb('0x2f')],'UserId':_0x33b395['id'],'queue_name':_0x43e6f2[_0xb1cb('0x2f')],'MailQueueId':_0x43e6f2['id'],'interface':util[_0xb1cb('0x63')]('%s/%s','SIP',_0x33b395[_0xb1cb('0x2f')]),'penalty':0x0,'paused':_0x33b395[_0xb1cb('0x61')],'createdAt':_0x33b395['createdAt'],'updatedAt':_0x33b395[_0xb1cb('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb1cb('0x2a')](respondWithFilteredResult(_0x681530,_0x5d0b0c))[_0xb1cb('0x4c')](handleError(_0x681530,null));};exports[_0xb1cb('0x64')]=function(_0x1627e8,_0x3ed047,_0xc4a30a){var _0x3ffdeb={};var _0x29bb5b={};var _0x4a43ab;var _0x5e1d50;return db[_0xb1cb('0x31')][_0xb1cb('0x65')]({'where':{'id':_0x1627e8['params']['id']}})['then'](handleEntityNotFound(_0x3ed047,null))[_0xb1cb('0x2a')](function(_0x3cf3f2){if(_0x3cf3f2){_0x4a43ab=_0x3cf3f2;_0x29bb5b[_0xb1cb('0x3a')]=_[_0xb1cb('0x38')](db[_0xb1cb('0x66')][_0xb1cb('0x32')]);_0x29bb5b[_0xb1cb('0x37')]=_[_0xb1cb('0x38')](_0x1627e8['query']);_0x29bb5b[_0xb1cb('0x39')]=_[_0xb1cb('0x3c')](_0x29bb5b['model'],_0x29bb5b[_0xb1cb('0x37')]);_0x3ffdeb['attributes']=_[_0xb1cb('0x3c')](_0x29bb5b[_0xb1cb('0x3a')],qs[_0xb1cb('0x3d')](_0x1627e8[_0xb1cb('0x37')]['fields']));_0x3ffdeb[_0xb1cb('0x3b')]=_0x3ffdeb[_0xb1cb('0x3b')][_0xb1cb('0x3e')]?_0x3ffdeb[_0xb1cb('0x3b')]:_0x29bb5b[_0xb1cb('0x3a')];_0x3ffdeb['order']=qs[_0xb1cb('0x42')](_0x1627e8[_0xb1cb('0x37')][_0xb1cb('0x42')]);_0x3ffdeb[_0xb1cb('0x43')]=qs[_0xb1cb('0x39')](_['pick'](_0x1627e8[_0xb1cb('0x37')],_0x29bb5b[_0xb1cb('0x39')]));if(_0x1627e8[_0xb1cb('0x37')]['filter']){_0x3ffdeb['where']=_['merge'](_0x3ffdeb[_0xb1cb('0x43')],{'$or':_[_0xb1cb('0x36')](_0x3ffdeb['attributes'],function(_0x10ffc7){var _0x13ded1={};_0x13ded1[_0x10ffc7]={'$like':'%'+_0x1627e8[_0xb1cb('0x37')][_0xb1cb('0x47')]+'%'};return _0x13ded1;})});}_0x3ffdeb=_[_0xb1cb('0x45')]({},_0x3ffdeb,_0x1627e8[_0xb1cb('0x4f')]);return _0x4a43ab[_0xb1cb('0x64')](_0x3ffdeb);}})[_0xb1cb('0x2a')](function(_0xc80013){if(_0xc80013){_0x5e1d50=_0xc80013[_0xb1cb('0x3e')];if(!_0x1627e8['query'][_0xb1cb('0x3f')]('nolimit')){_0x3ffdeb[_0xb1cb('0x27')]=qs[_0xb1cb('0x27')](_0x1627e8[_0xb1cb('0x37')][_0xb1cb('0x27')]);_0x3ffdeb[_0xb1cb('0x24')]=qs[_0xb1cb('0x24')](_0x1627e8[_0xb1cb('0x37')][_0xb1cb('0x24')]);}return _0x4a43ab[_0xb1cb('0x64')](_0x3ffdeb);}})['then'](function(_0x3f098e){if(_0x3f098e){return _0x3f098e?{'count':_0x5e1d50,'rows':_0x3f098e}:null;}})[_0xb1cb('0x2a')](respondWithResult(_0x3ed047,null))[_0xb1cb('0x4c')](handleError(_0x3ed047,null));};exports[_0xb1cb('0x67')]=function(_0x468ff4,_0xabcba8,_0x442dab){var _0x2ba3aa=_0x468ff4[_0xb1cb('0x52')][_0xb1cb('0x68')];return db[_0xb1cb('0x66')][_0xb1cb('0x4a')]({'where':{'id':_0x2ba3aa},'attributes':['id'],'include':[{'model':db[_0xb1cb('0x5f')],'as':_0xb1cb('0x69'),'attributes':['id',_0xb1cb('0x2f'),'online',_0xb1cb('0x6a'),_0xb1cb('0x6b')],'raw':!![]}]})['then'](function(_0x38568b){if(_0x38568b){var _0x5e3368=_[_0xb1cb('0x6c')](_0x38568b,function(_0x39121e){var _0x48c9fb=_0x39121e['get']({'plain':!![]});return _0x48c9fb[_0xb1cb('0x69')];});return db['MailQueue']['find']({'where':{'id':_0x468ff4[_0xb1cb('0x4e')]['id']}})['then'](function(_0x9c589c){return db[_0xb1cb('0x6d')]['transaction'](function(_0x5c5b2f){return _0x9c589c['addTeams'](_0x2ba3aa,{'transaction':_0x5c5b2f})[_0xb1cb('0x2a')](function(){return BPromise[_0xb1cb('0x6e')](_0x5e3368,function(_0x246a7d){return db[_0xb1cb('0x5d')][_0xb1cb('0x6f')]({'where':{'UserId':_0x246a7d['id'],'MailQueueId':_0x468ff4[_0xb1cb('0x4e')]['id']},'transaction':_0x5c5b2f});});})[_0xb1cb('0x2a')](function(){_0x5e3368[_0xb1cb('0x70')](function(_0x458908){socket[_0xb1cb('0x71')]('userMailQueue:save',{'UserId':_0x458908['id'],'MailQueueId':_0x9c589c['id']});});});});});}})['then'](respondWithStatusCode(_0xabcba8,null))[_0xb1cb('0x4c')](handleError(_0xabcba8,null));};exports[_0xb1cb('0x72')]=function(_0x4a4c75,_0x10cd87,_0x147af2){return db[_0xb1cb('0x66')]['findAll']({'where':{'id':_0x4a4c75[_0xb1cb('0x37')][_0xb1cb('0x68')]},'attributes':['id'],'include':[{'model':db[_0xb1cb('0x5f')],'as':_0xb1cb('0x69'),'attributes':['id'],'raw':!![]}]})[_0xb1cb('0x2a')](handleEntityNotFound(_0x10cd87,null))['then'](function(_0x5b4ca6){var _0x255cc9=_['map'](_0x5b4ca6,'id');var _0x57eb16=[];var _0x3fe7e6=[];var _0x5d9d86=squel[_0xb1cb('0x73')]();_0x5d9d86[_0xb1cb('0x74')](_0xb1cb('0x75'))['from'](_0xb1cb('0x76'),'tq')['join'](_0xb1cb('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb1cb('0x43')](_0xb1cb('0x78'),_0x4a4c75[_0xb1cb('0x4e')]['id']);for(var _0x1b8fc6=0x0;_0x1b8fc6<_0x5b4ca6['length'];_0x1b8fc6+=0x1){let _0x4c742e=_0x5b4ca6[_0x1b8fc6];for(var _0x3f84e2=0x0;_0x3f84e2<_0x4c742e['Agents']['length'];_0x3f84e2+=0x1){let _0x6da22f=_0x4c742e[_0xb1cb('0x69')][_0x3f84e2];var _0x2c87fd=_0x5d9d86['clone']();_0x2c87fd[_0xb1cb('0x43')](_0xb1cb('0x79'),_0x6da22f['id']);_0x3fe7e6[_0xb1cb('0x7a')](db['sequelize']['query'](_0x2c87fd['toString'](),{'type':db[_0xb1cb('0x6d')][_0xb1cb('0x7b')]['SELECT']})[_0xb1cb('0x2a')](function(_0x4997b2){if(_0x4997b2[_0xb1cb('0x3e')]===0x1){return _0x6da22f['id'];}else{var _0x32552d=_['every'](_[_0xb1cb('0x36')](_0x4997b2,'TeamId'),function(_0x430835){return _[_0xb1cb('0x7c')](_0x255cc9,_0x430835);});if(_0x32552d){return _0x6da22f['id'];}}}));}}return BPromise[_0xb1cb('0x7d')](_0x3fe7e6)[_0xb1cb('0x2a')](function(_0x4d85de){_0x57eb16=_(_0x57eb16)[_0xb1cb('0x7e')](_0x4d85de)[_0xb1cb('0x7f')]()['value']();return db[_0xb1cb('0x31')][_0xb1cb('0x50')]({'where':{'id':_0x4a4c75[_0xb1cb('0x4e')]['id']}})[_0xb1cb('0x2a')](function(_0x94e8c4){return db['sequelize'][_0xb1cb('0x80')](function(_0x4ef52a){return _0x94e8c4[_0xb1cb('0x72')](_0x4a4c75[_0xb1cb('0x37')]['ids'],{'transaction':_0x4ef52a})[_0xb1cb('0x2a')](function(){if(!_[_0xb1cb('0x81')](_0x57eb16)){return _0x94e8c4[_0xb1cb('0x82')](_0x57eb16,{'transaction':_0x4ef52a});}})['then'](function(){_0x57eb16[_0xb1cb('0x70')](function(_0x5a3c52){socket[_0xb1cb('0x71')](_0xb1cb('0x83'),{'UserId':_0x5a3c52,'MailQueueId':_0x94e8c4['id']});});});});});});})[_0xb1cb('0x2a')](respondWithStatusCode(_0x10cd87,null))[_0xb1cb('0x4c')](handleError(_0x10cd87,null));};exports[_0xb1cb('0x84')]=function(_0x3631d0,_0x413fae,_0x437652){return db['MailQueue']['find']({'where':{'id':_0x3631d0['params']['id']}})[_0xb1cb('0x2a')](handleEntityNotFound(_0x413fae,null))['then'](function(_0x3aed69){if(_0x3aed69){return _0x3aed69[_0xb1cb('0x84')](_0x3631d0[_0xb1cb('0x52')][_0xb1cb('0x68')],_[_0xb1cb('0x85')](_0x3631d0[_0xb1cb('0x52')],[_0xb1cb('0x68'),'id'])||{})['spread'](function(_0x1c95f4){for(var _0x28f0e3=0x0;_0x28f0e3<_0x3631d0[_0xb1cb('0x52')][_0xb1cb('0x68')][_0xb1cb('0x3e')];_0x28f0e3+=0x1){socket[_0xb1cb('0x71')]('userMailQueue:save',{'UserId':Number(_0x3631d0['body'][_0xb1cb('0x68')][_0x28f0e3]),'MailQueueId':Number(_0x3631d0[_0xb1cb('0x4e')]['id'])});}return _0x1c95f4;});}})[_0xb1cb('0x2a')](respondWithResult(_0x413fae,null))[_0xb1cb('0x4c')](handleError(_0x413fae,null));};exports[_0xb1cb('0x82')]=function(_0xb86666,_0x265849,_0x293fcf){return db[_0xb1cb('0x31')]['find']({'where':{'id':_0xb86666[_0xb1cb('0x4e')]['id']}})[_0xb1cb('0x2a')](handleEntityNotFound(_0x265849,null))[_0xb1cb('0x2a')](function(_0x515104){if(_0x515104){return _0x515104[_0xb1cb('0x82')](_0xb86666[_0xb1cb('0x37')][_0xb1cb('0x68')])[_0xb1cb('0x2a')](function(){if(_['isArray'](_0xb86666[_0xb1cb('0x37')][_0xb1cb('0x68')])){for(var _0x5af6d9=0x0;_0x5af6d9<_0xb86666[_0xb1cb('0x37')][_0xb1cb('0x68')][_0xb1cb('0x3e')];_0x5af6d9+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0xb86666[_0xb1cb('0x37')]['ids'][_0x5af6d9]),'MailQueueId':Number(_0xb86666['params']['id'])});}}else{socket[_0xb1cb('0x71')](_0xb1cb('0x83'),{'UserId':Number(_0xb86666['query'][_0xb1cb('0x68')]),'MailQueueId':Number(_0xb86666[_0xb1cb('0x4e')]['id'])});}});}})[_0xb1cb('0x2a')](respondWithStatusCode(_0x265849,null))[_0xb1cb('0x4c')](handleError(_0x265849,null));};exports[_0xb1cb('0x86')]=function(_0x328599,_0x482f64,_0x4490ee){var _0x5f121f={};var _0x5f4c03={};var _0x72ea1c;var _0x10488d;return db['MailQueue'][_0xb1cb('0x65')]({'where':{'id':_0x328599[_0xb1cb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x482f64,null))[_0xb1cb('0x2a')](function(_0x42b319){if(_0x42b319){_0x72ea1c=_0x42b319;_0x5f4c03['model']=_[_0xb1cb('0x38')](db[_0xb1cb('0x5f')][_0xb1cb('0x32')]);_0x5f4c03[_0xb1cb('0x37')]=_[_0xb1cb('0x38')](_0x328599['query']);_0x5f4c03['filters']=_['intersection'](_0x5f4c03['model'],_0x5f4c03['query']);_0x5f121f[_0xb1cb('0x3b')]=_['intersection'](_0x5f4c03[_0xb1cb('0x3a')],qs['fields'](_0x328599[_0xb1cb('0x37')]['fields']));_0x5f121f[_0xb1cb('0x3b')]=_0x5f121f[_0xb1cb('0x3b')][_0xb1cb('0x3e')]?_0x5f121f[_0xb1cb('0x3b')]:_0x5f4c03[_0xb1cb('0x3a')];_0x5f121f['order']=qs[_0xb1cb('0x42')](_0x328599['query'][_0xb1cb('0x42')]);_0x5f121f[_0xb1cb('0x43')]=qs['filters'](_[_0xb1cb('0x44')](_0x328599[_0xb1cb('0x37')],_0x5f4c03[_0xb1cb('0x39')]));if(_0x328599['query']['filter']){_0x5f121f[_0xb1cb('0x43')]=_['merge'](_0x5f121f[_0xb1cb('0x43')],{'$or':_[_0xb1cb('0x36')](_0x5f121f['attributes'],function(_0x19250c){var _0x45c2c6={};_0x45c2c6[_0x19250c]={'$like':'%'+_0x328599['query'][_0xb1cb('0x47')]+'%'};return _0x45c2c6;})});}_0x5f121f=_[_0xb1cb('0x45')]({},_0x5f121f,_0x328599[_0xb1cb('0x4f')]);return _0x72ea1c[_0xb1cb('0x86')](_0x5f121f);}})['then'](function(_0x4cbc14){if(_0x4cbc14){_0x10488d=_0x4cbc14[_0xb1cb('0x3e')];if(!_0x328599[_0xb1cb('0x37')]['hasOwnProperty'](_0xb1cb('0x40'))){_0x5f121f[_0xb1cb('0x27')]=qs[_0xb1cb('0x27')](_0x328599[_0xb1cb('0x37')]['limit']);_0x5f121f[_0xb1cb('0x24')]=qs[_0xb1cb('0x24')](_0x328599[_0xb1cb('0x37')][_0xb1cb('0x24')]);}return _0x72ea1c['getAgents'](_0x5f121f);}})[_0xb1cb('0x2a')](function(_0x3efebd){if(_0x3efebd){return _0x3efebd?{'count':_0x10488d,'rows':_0x3efebd}:null;}})[_0xb1cb('0x2a')](respondWithResult(_0x482f64,null))[_0xb1cb('0x4c')](handleError(_0x482f64,null));}; \ No newline at end of file +var _0x75f0=['socket.io-emitter','./mailQueue.socket','register','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','MailQueues','destroy','sendStatus','error','name','send','index','map','MailQueue','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','where','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','user','get','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','order','sort','pick','findAll','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','includes','all','union','isEmpty','addAgents','omit','spread','removeAgents','isArray','emit','userMailQueue:remove','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x75f0,0x196));var _0x075f=function(_0x12587b,_0x1136a6){_0x12587b=_0x12587b-0x0;var _0x417527=_0x75f0[_0x12587b];return _0x417527;};'use strict';var emlformat=require(_0x075f('0x0'));var rimraf=require(_0x075f('0x1'));var zipdir=require(_0x075f('0x2'));var jsonpatch=require(_0x075f('0x3'));var rp=require(_0x075f('0x4'));var moment=require(_0x075f('0x5'));var BPromise=require(_0x075f('0x6'));var Mustache=require(_0x075f('0x7'));var util=require(_0x075f('0x8'));var path=require('path');var sox=require(_0x075f('0x9'));var csv=require(_0x075f('0xa'));var ejs=require(_0x075f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x075f('0xc'));var crypto=require('crypto');var jsforce=require(_0x075f('0xd'));var deskjs=require(_0x075f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x075f('0xf'));var Papa=require(_0x075f('0x10'));var Redis=require(_0x075f('0x11'));var authService=require(_0x075f('0x12'));var qs=require(_0x075f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x075f('0x14'))(_0x075f('0x15'));var utils=require(_0x075f('0x16'));var config=require(_0x075f('0x17'));var licenseUtil=require(_0x075f('0x18'));var db=require(_0x075f('0x19'))['db'];config[_0x075f('0x1a')]=_[_0x075f('0x1b')](config[_0x075f('0x1a')],{'host':_0x075f('0x1c'),'port':0x18eb});var socket=require(_0x075f('0x1d'))(new Redis(config[_0x075f('0x1a')]));require(_0x075f('0x1e'))[_0x075f('0x1f')](socket);function respondWithStatusCode(_0x26df3d,_0x247f86){_0x247f86=_0x247f86||0xcc;return function(_0x90f647){if(_0x90f647){return _0x26df3d['sendStatus'](_0x247f86);}return _0x26df3d[_0x075f('0x20')](_0x247f86)['end']();};}function respondWithResult(_0x4c33f2,_0x371510){_0x371510=_0x371510||0xc8;return function(_0x4549e5){if(_0x4549e5){return _0x4c33f2[_0x075f('0x20')](_0x371510)['json'](_0x4549e5);}};}function respondWithFilteredResult(_0x26e52d,_0x1d6a08){return function(_0x55a625){if(_0x55a625){var _0x4cc5ab=typeof _0x1d6a08[_0x075f('0x21')]==='undefined'&&typeof _0x1d6a08['limit']===_0x075f('0x22');var _0x25a655=_0x55a625[_0x075f('0x23')];var _0x190e90=_0x4cc5ab?0x0:_0x1d6a08[_0x075f('0x21')];var _0xf39d65=_0x4cc5ab?_0x55a625[_0x075f('0x23')]:_0x1d6a08[_0x075f('0x21')]+_0x1d6a08[_0x075f('0x24')];var _0x85f244;if(_0xf39d65>=_0x25a655){_0xf39d65=_0x25a655;_0x85f244=0xc8;}else{_0x85f244=0xce;}_0x26e52d[_0x075f('0x20')](_0x85f244);return _0x26e52d['set'](_0x075f('0x25'),_0x190e90+'-'+_0xf39d65+'/'+_0x25a655)[_0x075f('0x26')](_0x55a625);}return null;};}function patchUpdates(_0x14f5b7){return function(_0x166576){try{jsonpatch[_0x075f('0x27')](_0x166576,_0x14f5b7,!![]);}catch(_0x303dcc){return BPromise[_0x075f('0x28')](_0x303dcc);}return _0x166576[_0x075f('0x29')]();};}function saveUpdates(_0x167e19,_0x5ec53a){return function(_0x1141de){if(_0x1141de){return _0x1141de[_0x075f('0x2a')](_0x167e19)[_0x075f('0x2b')](function(_0x508a8c){return _0x508a8c;});}return null;};}function removeEntity(_0x30186b,_0x5c284b){return function(_0xdae214){if(_0xdae214){return _0xdae214['destroy']()[_0x075f('0x2b')](function(){var _0x546529=_0xdae214['get']({'plain':!![]});var _0x4ed286=_0x075f('0x2c');return db['UserProfileResource'][_0x075f('0x2d')]({'where':{'type':_0x4ed286,'resourceId':_0x546529['id']}})[_0x075f('0x2b')](function(){return _0xdae214;});})[_0x075f('0x2b')](function(){_0x30186b[_0x075f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520f5b,_0x2005bd){return function(_0x186e99){if(!_0x186e99){_0x520f5b[_0x075f('0x2e')](0x194);}return _0x186e99;};}function handleError(_0x4c65b2,_0x39f644){_0x39f644=_0x39f644||0x1f4;return function(_0x4006d8){logger[_0x075f('0x2f')](_0x4006d8['stack']);if(_0x4006d8[_0x075f('0x30')]){delete _0x4006d8[_0x075f('0x30')];}_0x4c65b2[_0x075f('0x20')](_0x39f644)[_0x075f('0x31')](_0x4006d8);};}exports[_0x075f('0x32')]=function(_0x19db94,_0x119613){var _0x2916e0={},_0x65b3e0={},_0x486237={'count':0x0,'rows':[]};var _0x3e466d=_[_0x075f('0x33')](db[_0x075f('0x34')]['rawAttributes'],function(_0x1cd883){return{'name':_0x1cd883[_0x075f('0x35')],'type':_0x1cd883[_0x075f('0x36')][_0x075f('0x37')]};});_0x65b3e0[_0x075f('0x38')]=_['map'](_0x3e466d,_0x075f('0x30'));_0x65b3e0['query']=_[_0x075f('0x39')](_0x19db94[_0x075f('0x3a')]);_0x65b3e0[_0x075f('0x3b')]=_[_0x075f('0x3c')](_0x65b3e0['model'],_0x65b3e0[_0x075f('0x3a')]);_0x2916e0[_0x075f('0x3d')]=_[_0x075f('0x3c')](_0x65b3e0[_0x075f('0x38')],qs[_0x075f('0x3e')](_0x19db94[_0x075f('0x3a')]['fields']));_0x2916e0[_0x075f('0x3d')]=_0x2916e0['attributes'][_0x075f('0x3f')]?_0x2916e0[_0x075f('0x3d')]:_0x65b3e0['model'];if(!_0x19db94[_0x075f('0x3a')]['hasOwnProperty']('nolimit')){_0x2916e0['limit']=qs[_0x075f('0x24')](_0x19db94[_0x075f('0x3a')][_0x075f('0x24')]);_0x2916e0[_0x075f('0x21')]=qs['offset'](_0x19db94[_0x075f('0x3a')]['offset']);}_0x2916e0['order']=qs['sort'](_0x19db94[_0x075f('0x3a')]['sort']);_0x2916e0[_0x075f('0x40')]=qs[_0x075f('0x3b')](_['pick'](_0x19db94[_0x075f('0x3a')],_0x65b3e0[_0x075f('0x3b')]),_0x3e466d);if(_0x19db94[_0x075f('0x3a')][_0x075f('0x41')]){_0x2916e0[_0x075f('0x40')]=_['merge'](_0x2916e0['where'],{'$or':_[_0x075f('0x33')](_0x3e466d,function(_0x2f4c2c){if(_0x2f4c2c[_0x075f('0x36')]!==_0x075f('0x42')){var _0x37f483={};_0x37f483[_0x2f4c2c[_0x075f('0x30')]]={'$like':'%'+_0x19db94['query'][_0x075f('0x41')]+'%'};return _0x37f483;}})});}_0x2916e0=_[_0x075f('0x43')]({},_0x2916e0,_0x19db94['options']);var _0x3df4ec={'where':_0x2916e0['where']};return db['MailQueue'][_0x075f('0x23')](_0x3df4ec)[_0x075f('0x2b')](function(_0x58c594){_0x486237[_0x075f('0x23')]=_0x58c594;if(_0x19db94['query'][_0x075f('0x44')]){_0x2916e0[_0x075f('0x45')]=[{'all':!![]}];}return db[_0x075f('0x34')]['findAll'](_0x2916e0);})[_0x075f('0x2b')](function(_0x4f4a18){_0x486237[_0x075f('0x46')]=_0x4f4a18;return _0x486237;})[_0x075f('0x2b')](respondWithFilteredResult(_0x119613,_0x2916e0))[_0x075f('0x47')](handleError(_0x119613,null));};exports[_0x075f('0x48')]=function(_0x2cd669,_0x1a1724){var _0x300a80={'raw':!![],'where':{'id':_0x2cd669[_0x075f('0x49')]['id']}},_0x5a5c4d={};_0x5a5c4d[_0x075f('0x38')]=_[_0x075f('0x39')](db[_0x075f('0x34')][_0x075f('0x4a')]);_0x5a5c4d['query']=_['keys'](_0x2cd669[_0x075f('0x3a')]);_0x5a5c4d[_0x075f('0x3b')]=_[_0x075f('0x3c')](_0x5a5c4d[_0x075f('0x38')],_0x5a5c4d['query']);_0x300a80[_0x075f('0x3d')]=_[_0x075f('0x3c')](_0x5a5c4d[_0x075f('0x38')],qs[_0x075f('0x3e')](_0x2cd669[_0x075f('0x3a')][_0x075f('0x3e')]));_0x300a80[_0x075f('0x3d')]=_0x300a80['attributes'][_0x075f('0x3f')]?_0x300a80['attributes']:_0x5a5c4d[_0x075f('0x38')];if(_0x2cd669[_0x075f('0x3a')][_0x075f('0x44')]){_0x300a80[_0x075f('0x45')]=[{'all':!![]}];}_0x300a80=_[_0x075f('0x43')]({},_0x300a80,_0x2cd669[_0x075f('0x4b')]);return db[_0x075f('0x34')][_0x075f('0x4c')](_0x300a80)[_0x075f('0x2b')](handleEntityNotFound(_0x1a1724,null))[_0x075f('0x2b')](respondWithResult(_0x1a1724,null))[_0x075f('0x47')](handleError(_0x1a1724,null));};exports[_0x075f('0x4d')]=function(_0x4211aa,_0x455fe4){return db[_0x075f('0x34')][_0x075f('0x4d')](_0x4211aa[_0x075f('0x4e')],{})[_0x075f('0x2b')](function(_0x11f77e){var _0x439c37=_0x4211aa[_0x075f('0x4f')][_0x075f('0x50')]({'plain':!![]});if(!_0x439c37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x439c37[_0x075f('0x51')]===_0x075f('0x4f')){var _0x3834a9=_0x11f77e[_0x075f('0x50')]({'plain':!![]});var _0x40fe3a=_0x075f('0x2c');return db['UserProfileSection'][_0x075f('0x4c')]({'where':{'name':_0x40fe3a,'userProfileId':_0x439c37[_0x075f('0x52')]},'raw':!![]})['then'](function(_0x7f5d1f){if(_0x7f5d1f&&_0x7f5d1f[_0x075f('0x53')]===0x0){return db[_0x075f('0x54')][_0x075f('0x4d')]({'name':_0x3834a9[_0x075f('0x30')],'resourceId':_0x3834a9['id'],'type':_0x7f5d1f[_0x075f('0x30')],'sectionId':_0x7f5d1f['id']},{})[_0x075f('0x2b')](function(){return _0x11f77e;});}else{return _0x11f77e;}})[_0x075f('0x47')](function(_0x5ecc16){logger[_0x075f('0x2f')](_0x075f('0x55'),_0x5ecc16);throw _0x5ecc16;});}return _0x11f77e;})['then'](respondWithResult(_0x455fe4,0xc9))[_0x075f('0x47')](handleError(_0x455fe4,null));};exports[_0x075f('0x2a')]=function(_0x45457e,_0x43a8bd){if(_0x45457e[_0x075f('0x4e')]['id']){delete _0x45457e[_0x075f('0x4e')]['id'];}return db['MailQueue'][_0x075f('0x4c')]({'where':{'id':_0x45457e[_0x075f('0x49')]['id']}})[_0x075f('0x2b')](handleEntityNotFound(_0x43a8bd,null))[_0x075f('0x2b')](saveUpdates(_0x45457e[_0x075f('0x4e')],null))[_0x075f('0x2b')](respondWithResult(_0x43a8bd,null))[_0x075f('0x47')](handleError(_0x43a8bd,null));};exports['destroy']=function(_0x3b6dd4,_0x43f892){return db['MailQueue'][_0x075f('0x4c')]({'where':{'id':_0x3b6dd4[_0x075f('0x49')]['id']}})[_0x075f('0x2b')](handleEntityNotFound(_0x43f892,null))[_0x075f('0x2b')](removeEntity(_0x43f892,null))[_0x075f('0x47')](handleError(_0x43f892,null));};exports[_0x075f('0x56')]=function(_0x4bf915,_0x38905d){return db[_0x075f('0x34')][_0x075f('0x56')]()[_0x075f('0x2b')](respondWithResult(_0x38905d,null))[_0x075f('0x47')](handleError(_0x38905d,null));};exports[_0x075f('0x57')]=function(_0x456499,_0x484055,_0x37d9d2){var _0x53bf7c={'raw':!![],'where':{}},_0x50d56f={},_0x3227b2;return db[_0x075f('0x34')][_0x075f('0x58')]({'where':{'id':_0x456499['params']['id']}})['then'](handleEntityNotFound(_0x484055,null))['then'](function(_0x924878){if(_0x924878){_0x3227b2=_0x924878[_0x075f('0x50')]({'plain':!![]});_0x50d56f[_0x075f('0x38')]=_[_0x075f('0x39')](db[_0x075f('0x59')][_0x075f('0x4a')]);_0x50d56f[_0x075f('0x3a')]=_['keys'](_0x456499[_0x075f('0x3a')]);_0x50d56f[_0x075f('0x3b')]=_[_0x075f('0x3c')](_0x50d56f[_0x075f('0x38')],_0x50d56f[_0x075f('0x3a')]);_0x53bf7c[_0x075f('0x3d')]=_[_0x075f('0x3c')](_0x50d56f['model'],qs[_0x075f('0x3e')](_0x456499[_0x075f('0x3a')]['fields']));_0x53bf7c[_0x075f('0x3d')]=_0x53bf7c[_0x075f('0x3d')][_0x075f('0x3f')]?_0x53bf7c['attributes']:_0x50d56f[_0x075f('0x38')];if(!_0x456499[_0x075f('0x3a')][_0x075f('0x5a')](_0x075f('0x5b'))){_0x53bf7c[_0x075f('0x24')]=qs[_0x075f('0x24')](_0x456499['query']['limit']);_0x53bf7c[_0x075f('0x21')]=qs[_0x075f('0x21')](_0x456499[_0x075f('0x3a')][_0x075f('0x21')]);}_0x53bf7c[_0x075f('0x5c')]=qs[_0x075f('0x5d')](_0x456499[_0x075f('0x3a')]['sort']);_0x53bf7c[_0x075f('0x40')]=qs[_0x075f('0x3b')](_[_0x075f('0x5e')](_0x456499[_0x075f('0x3a')],_0x50d56f[_0x075f('0x3b')]));_0x53bf7c[_0x075f('0x40')]['MailQueueId']=_0x924878['id'];if(_0x456499[_0x075f('0x3a')][_0x075f('0x41')]){_0x53bf7c[_0x075f('0x40')]=_[_0x075f('0x43')](_0x53bf7c[_0x075f('0x40')],{'$or':_[_0x075f('0x33')](_0x53bf7c['attributes'],function(_0xc530f){var _0x45dc13={};_0x45dc13[_0xc530f]={'$like':'%'+_0x456499['query'][_0x075f('0x41')]+'%'};return _0x45dc13;})});}_0x53bf7c=_[_0x075f('0x43')]({},_0x53bf7c,_0x456499[_0x075f('0x4b')]);return db['UserMailQueue'][_0x075f('0x5f')](_0x53bf7c);}})[_0x075f('0x2b')](function(_0x16344f){if(_0x16344f){return db[_0x075f('0x60')][_0x075f('0x61')]({'where':{'id':_[_0x075f('0x33')](_0x16344f,_0x075f('0x62')),'role':'agent'},'attributes':['id','name',_0x075f('0x63'),_0x075f('0x64'),_0x075f('0x65')]});}})['then'](function(_0xf7eff5){if(_0xf7eff5){return{'count':_0xf7eff5[_0x075f('0x23')],'rows':_[_0x075f('0x33')](_0xf7eff5[_0x075f('0x46')],function(_0x3a3e41){return{'membername':_0x3a3e41[_0x075f('0x30')],'UserId':_0x3a3e41['id'],'queue_name':_0x3227b2[_0x075f('0x30')],'MailQueueId':_0x3227b2['id'],'interface':util[_0x075f('0x66')](_0x075f('0x67'),_0x075f('0x68'),_0x3a3e41[_0x075f('0x30')]),'penalty':0x0,'paused':_0x3a3e41['mailPause'],'createdAt':_0x3a3e41[_0x075f('0x65')],'updatedAt':_0x3a3e41[_0x075f('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x484055,_0x53bf7c))['catch'](handleError(_0x484055,null));};exports['getTeams']=function(_0x144cd6,_0x2b9b3e,_0x3a2b21){var _0x59cc61={};var _0x4034af={};var _0x52e1b8;var _0x300d56;return db[_0x075f('0x34')][_0x075f('0x58')]({'where':{'id':_0x144cd6[_0x075f('0x49')]['id']}})[_0x075f('0x2b')](handleEntityNotFound(_0x2b9b3e,null))[_0x075f('0x2b')](function(_0xd0e5c8){if(_0xd0e5c8){_0x52e1b8=_0xd0e5c8;_0x4034af[_0x075f('0x38')]=_['keys'](db[_0x075f('0x69')]['rawAttributes']);_0x4034af['query']=_['keys'](_0x144cd6[_0x075f('0x3a')]);_0x4034af[_0x075f('0x3b')]=_[_0x075f('0x3c')](_0x4034af[_0x075f('0x38')],_0x4034af[_0x075f('0x3a')]);_0x59cc61['attributes']=_[_0x075f('0x3c')](_0x4034af[_0x075f('0x38')],qs[_0x075f('0x3e')](_0x144cd6[_0x075f('0x3a')][_0x075f('0x3e')]));_0x59cc61[_0x075f('0x3d')]=_0x59cc61['attributes'][_0x075f('0x3f')]?_0x59cc61['attributes']:_0x4034af[_0x075f('0x38')];_0x59cc61[_0x075f('0x5c')]=qs['sort'](_0x144cd6['query']['sort']);_0x59cc61[_0x075f('0x40')]=qs[_0x075f('0x3b')](_[_0x075f('0x5e')](_0x144cd6[_0x075f('0x3a')],_0x4034af['filters']));if(_0x144cd6[_0x075f('0x3a')][_0x075f('0x41')]){_0x59cc61[_0x075f('0x40')]=_[_0x075f('0x43')](_0x59cc61[_0x075f('0x40')],{'$or':_['map'](_0x59cc61[_0x075f('0x3d')],function(_0x521729){var _0x479c5c={};_0x479c5c[_0x521729]={'$like':'%'+_0x144cd6[_0x075f('0x3a')][_0x075f('0x41')]+'%'};return _0x479c5c;})});}_0x59cc61=_[_0x075f('0x43')]({},_0x59cc61,_0x144cd6['options']);return _0x52e1b8[_0x075f('0x6a')](_0x59cc61);}})[_0x075f('0x2b')](function(_0x5cd259){if(_0x5cd259){_0x300d56=_0x5cd259[_0x075f('0x3f')];if(!_0x144cd6[_0x075f('0x3a')][_0x075f('0x5a')](_0x075f('0x5b'))){_0x59cc61['limit']=qs[_0x075f('0x24')](_0x144cd6[_0x075f('0x3a')][_0x075f('0x24')]);_0x59cc61[_0x075f('0x21')]=qs['offset'](_0x144cd6[_0x075f('0x3a')]['offset']);}return _0x52e1b8[_0x075f('0x6a')](_0x59cc61);}})[_0x075f('0x2b')](function(_0x5a7de3){if(_0x5a7de3){return _0x5a7de3?{'count':_0x300d56,'rows':_0x5a7de3}:null;}})[_0x075f('0x2b')](respondWithResult(_0x2b9b3e,null))[_0x075f('0x47')](handleError(_0x2b9b3e,null));};exports[_0x075f('0x6b')]=function(_0x35838d,_0x316ad2,_0xbbcfc0){var _0x27b1cc=_0x35838d[_0x075f('0x4e')][_0x075f('0x6c')];return db['Team'][_0x075f('0x5f')]({'where':{'id':_0x27b1cc},'attributes':['id'],'include':[{'model':db[_0x075f('0x60')],'as':_0x075f('0x6d'),'attributes':['id',_0x075f('0x30'),_0x075f('0x6e'),_0x075f('0x6f'),_0x075f('0x70')],'raw':!![]}]})[_0x075f('0x2b')](function(_0xcebd6b){if(_0xcebd6b){var _0x3d84ae=_[_0x075f('0x71')](_0xcebd6b,function(_0x20ed74){var _0x483107=_0x20ed74[_0x075f('0x50')]({'plain':!![]});return _0x483107['Agents'];});return db[_0x075f('0x34')][_0x075f('0x4c')]({'where':{'id':_0x35838d[_0x075f('0x49')]['id']}})[_0x075f('0x2b')](function(_0xe67866){return db['sequelize'][_0x075f('0x72')](function(_0x220f00){return _0xe67866['addTeams'](_0x27b1cc,{'transaction':_0x220f00})['then'](function(){return BPromise[_0x075f('0x73')](_0x3d84ae,function(_0x3c8bf5){return db[_0x075f('0x59')][_0x075f('0x74')]({'where':{'UserId':_0x3c8bf5['id'],'MailQueueId':_0x35838d[_0x075f('0x49')]['id']},'transaction':_0x220f00});});})['then'](function(){_0x3d84ae[_0x075f('0x75')](function(_0x49379c){socket['emit'](_0x075f('0x76'),{'UserId':_0x49379c['id'],'MailQueueId':_0xe67866['id']});});});});});}})['then'](respondWithStatusCode(_0x316ad2,null))[_0x075f('0x47')](handleError(_0x316ad2,null));};exports[_0x075f('0x77')]=function(_0x14a12f,_0x3b2df8,_0xe90d2b){return db[_0x075f('0x69')]['findAll']({'where':{'id':_0x14a12f[_0x075f('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x075f('0x60')],'as':_0x075f('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x075f('0x2b')](handleEntityNotFound(_0x3b2df8,null))[_0x075f('0x2b')](function(_0x6d141c){var _0x1933a2=_[_0x075f('0x33')](_0x6d141c,'id');var _0x7b55ea=[];var _0x3be878=[];var _0x4f876e=squel[_0x075f('0x78')]();_0x4f876e[_0x075f('0x79')](_0x075f('0x7a'))[_0x075f('0x7b')](_0x075f('0x7c'),'tq')['join'](_0x075f('0x7d'),'ut',_0x075f('0x7e'))[_0x075f('0x40')](_0x075f('0x7f'),_0x14a12f[_0x075f('0x49')]['id']);for(var _0x1a12a0=0x0;_0x1a12a0<_0x6d141c[_0x075f('0x3f')];_0x1a12a0+=0x1){let _0x5c41de=_0x6d141c[_0x1a12a0];for(var _0x4f59e1=0x0;_0x4f59e1<_0x5c41de[_0x075f('0x6d')][_0x075f('0x3f')];_0x4f59e1+=0x1){let _0x501783=_0x5c41de[_0x075f('0x6d')][_0x4f59e1];var _0x153122=_0x4f876e[_0x075f('0x80')]();_0x153122[_0x075f('0x40')]('ut.UserId\x20=\x20?',_0x501783['id']);_0x3be878[_0x075f('0x81')](db['sequelize'][_0x075f('0x3a')](_0x153122['toString'](),{'type':db[_0x075f('0x82')][_0x075f('0x83')][_0x075f('0x84')]})['then'](function(_0x10c62d){if(_0x10c62d[_0x075f('0x3f')]===0x1){return _0x501783['id'];}else{var _0x14862c=_[_0x075f('0x85')](_[_0x075f('0x33')](_0x10c62d,'TeamId'),function(_0x44b13d){return _[_0x075f('0x86')](_0x1933a2,_0x44b13d);});if(_0x14862c){return _0x501783['id'];}}}));}}return BPromise[_0x075f('0x87')](_0x3be878)['then'](function(_0x35bcd6){_0x7b55ea=_(_0x7b55ea)[_0x075f('0x88')](_0x35bcd6)['compact']()['value']();return db['MailQueue'][_0x075f('0x4c')]({'where':{'id':_0x14a12f['params']['id']}})[_0x075f('0x2b')](function(_0x5d03ac){return db[_0x075f('0x82')][_0x075f('0x72')](function(_0x4bd346){return _0x5d03ac[_0x075f('0x77')](_0x14a12f['query']['ids'],{'transaction':_0x4bd346})[_0x075f('0x2b')](function(){if(!_[_0x075f('0x89')](_0x7b55ea)){return _0x5d03ac['removeAgents'](_0x7b55ea,{'transaction':_0x4bd346});}})[_0x075f('0x2b')](function(){_0x7b55ea['forEach'](function(_0x37d5f9){socket['emit']('userMailQueue:remove',{'UserId':_0x37d5f9,'MailQueueId':_0x5d03ac['id']});});});});});});})['then'](respondWithStatusCode(_0x3b2df8,null))[_0x075f('0x47')](handleError(_0x3b2df8,null));};exports[_0x075f('0x8a')]=function(_0x307758,_0x3f0588,_0x482aa2){return db[_0x075f('0x34')][_0x075f('0x4c')]({'where':{'id':_0x307758[_0x075f('0x49')]['id']}})[_0x075f('0x2b')](handleEntityNotFound(_0x3f0588,null))[_0x075f('0x2b')](function(_0x4968f8){if(_0x4968f8){return _0x4968f8['addAgents'](_0x307758[_0x075f('0x4e')][_0x075f('0x6c')],_[_0x075f('0x8b')](_0x307758['body'],[_0x075f('0x6c'),'id'])||{})[_0x075f('0x8c')](function(_0x2bccb7){for(var _0x1c4f40=0x0;_0x1c4f40<_0x307758[_0x075f('0x4e')][_0x075f('0x6c')][_0x075f('0x3f')];_0x1c4f40+=0x1){socket['emit'](_0x075f('0x76'),{'UserId':Number(_0x307758[_0x075f('0x4e')]['ids'][_0x1c4f40]),'MailQueueId':Number(_0x307758[_0x075f('0x49')]['id'])});}return _0x2bccb7;});}})[_0x075f('0x2b')](respondWithResult(_0x3f0588,null))[_0x075f('0x47')](handleError(_0x3f0588,null));};exports[_0x075f('0x8d')]=function(_0x55e0c6,_0x47b5b4,_0x3dac92){return db[_0x075f('0x34')][_0x075f('0x4c')]({'where':{'id':_0x55e0c6[_0x075f('0x49')]['id']}})['then'](handleEntityNotFound(_0x47b5b4,null))[_0x075f('0x2b')](function(_0x2e4244){if(_0x2e4244){return _0x2e4244[_0x075f('0x8d')](_0x55e0c6[_0x075f('0x3a')]['ids'])[_0x075f('0x2b')](function(){if(_[_0x075f('0x8e')](_0x55e0c6[_0x075f('0x3a')]['ids'])){for(var _0x4e702d=0x0;_0x4e702d<_0x55e0c6[_0x075f('0x3a')][_0x075f('0x6c')][_0x075f('0x3f')];_0x4e702d+=0x1){socket[_0x075f('0x8f')]('userMailQueue:remove',{'UserId':Number(_0x55e0c6['query'][_0x075f('0x6c')][_0x4e702d]),'MailQueueId':Number(_0x55e0c6[_0x075f('0x49')]['id'])});}}else{socket['emit'](_0x075f('0x90'),{'UserId':Number(_0x55e0c6[_0x075f('0x3a')][_0x075f('0x6c')]),'MailQueueId':Number(_0x55e0c6[_0x075f('0x49')]['id'])});}});}})[_0x075f('0x2b')](respondWithStatusCode(_0x47b5b4,null))[_0x075f('0x47')](handleError(_0x47b5b4,null));};exports['getAgents']=function(_0x173568,_0x1409e2,_0x5762c6){var _0x10134b={};var _0x5e3876={};var _0x37cb5a;var _0x1521a4;return db[_0x075f('0x34')][_0x075f('0x58')]({'where':{'id':_0x173568[_0x075f('0x49')]['id']}})[_0x075f('0x2b')](handleEntityNotFound(_0x1409e2,null))[_0x075f('0x2b')](function(_0x5e6566){if(_0x5e6566){_0x37cb5a=_0x5e6566;_0x5e3876['model']=_[_0x075f('0x39')](db[_0x075f('0x60')][_0x075f('0x4a')]);_0x5e3876[_0x075f('0x3a')]=_[_0x075f('0x39')](_0x173568['query']);_0x5e3876['filters']=_['intersection'](_0x5e3876['model'],_0x5e3876[_0x075f('0x3a')]);_0x10134b[_0x075f('0x3d')]=_[_0x075f('0x3c')](_0x5e3876[_0x075f('0x38')],qs['fields'](_0x173568[_0x075f('0x3a')][_0x075f('0x3e')]));_0x10134b[_0x075f('0x3d')]=_0x10134b['attributes'][_0x075f('0x3f')]?_0x10134b[_0x075f('0x3d')]:_0x5e3876[_0x075f('0x38')];_0x10134b[_0x075f('0x5c')]=qs[_0x075f('0x5d')](_0x173568[_0x075f('0x3a')][_0x075f('0x5d')]);_0x10134b[_0x075f('0x40')]=qs['filters'](_['pick'](_0x173568[_0x075f('0x3a')],_0x5e3876[_0x075f('0x3b')]));if(_0x173568[_0x075f('0x3a')][_0x075f('0x41')]){_0x10134b[_0x075f('0x40')]=_[_0x075f('0x43')](_0x10134b[_0x075f('0x40')],{'$or':_['map'](_0x10134b[_0x075f('0x3d')],function(_0x354acd){var _0x244d8e={};_0x244d8e[_0x354acd]={'$like':'%'+_0x173568[_0x075f('0x3a')][_0x075f('0x41')]+'%'};return _0x244d8e;})});}_0x10134b=_['merge']({},_0x10134b,_0x173568['options']);return _0x37cb5a['getAgents'](_0x10134b);}})[_0x075f('0x2b')](function(_0x4a83a3){if(_0x4a83a3){_0x1521a4=_0x4a83a3[_0x075f('0x3f')];if(!_0x173568[_0x075f('0x3a')][_0x075f('0x5a')](_0x075f('0x5b'))){_0x10134b[_0x075f('0x24')]=qs[_0x075f('0x24')](_0x173568['query'][_0x075f('0x24')]);_0x10134b[_0x075f('0x21')]=qs['offset'](_0x173568[_0x075f('0x3a')][_0x075f('0x21')]);}return _0x37cb5a['getAgents'](_0x10134b);}})['then'](function(_0x1a37ac){if(_0x1a37ac){return _0x1a37ac?{'count':_0x1521a4,'rows':_0x1a37ac}:null;}})['then'](respondWithResult(_0x1409e2,null))[_0x075f('0x47')](handleError(_0x1409e2,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 9ace691..6b3d197 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 _0x713e=['hook','exports','../../mysqldb','remove','emit'];(function(_0x31ed43,_0x5eb756){var _0x1e0aaf=function(_0x52ccd0){while(--_0x52ccd0){_0x31ed43['push'](_0x31ed43['shift']());}};_0x1e0aaf(++_0x5eb756);}(_0x713e,0x75));var _0xe713=function(_0x953701,_0x5d2bf2){_0x953701=_0x953701-0x0;var _0x5a2c8f=_0x713e[_0x953701];return _0x5a2c8f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xe713('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe713('0x1')};function emitEvent(_0x20e6fa){return function(_0xefb1e4,_0x5012ea,_0x2f55b8){MailQueueEvents[_0xe713('0x2')](_0x20e6fa+':'+_0xefb1e4['id'],_0xefb1e4);MailQueueEvents[_0xe713('0x2')](_0x20e6fa,_0xefb1e4);_0x2f55b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xe713('0x3')](e,emitEvent(event));}}module[_0xe713('0x4')]=MailQueueEvents; \ No newline at end of file +var _0x4bed=['../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3b69e3,_0x40bb88){var _0x1f5b5e=function(_0x4fdd01){while(--_0x4fdd01){_0x3b69e3['push'](_0x3b69e3['shift']());}};_0x1f5b5e(++_0x40bb88);}(_0x4bed,0xb4));var _0xd4be=function(_0x5251c3,_0x290dbe){_0x5251c3=_0x5251c3-0x0;var _0x424b08=_0x4bed[_0x5251c3];return _0x424b08;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xd4be('0x0'))['db'][_0xd4be('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd4be('0x2')](0x0);var events={'afterCreate':_0xd4be('0x3'),'afterUpdate':_0xd4be('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d7a66){return function(_0x156b1e,_0x4b092d,_0x24bea2){MailQueueEvents['emit'](_0x4d7a66+':'+_0x156b1e['id'],_0x156b1e);MailQueueEvents[_0xd4be('0x5')](_0x4d7a66,_0x156b1e);_0x24bea2(null);};}for(var e in events){if(events[_0xd4be('0x6')](e)){var event=events[e];MailQueue[_0xd4be('0x7')](e,emitEvent(event));}}module[_0xd4be('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 0194b65..159962d 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 _0xafdd=['exports','define','MailQueue','mail_queues','lodash','util','moment','bluebird','path','../../config/environment','./mailQueue.attributes'];(function(_0x1ebe72,_0x61bd5c){var _0xf0d90b=function(_0xc77db4){while(--_0xc77db4){_0x1ebe72['push'](_0x1ebe72['shift']());}};_0xf0d90b(++_0x61bd5c);}(_0xafdd,0x67));var _0xdafd=function(_0x5bd152,_0x4adb1b){_0x5bd152=_0x5bd152-0x0;var _0x36fcfe=_0xafdd[_0x5bd152];return _0x36fcfe;};'use strict';var _=require(_0xdafd('0x0'));var util=require(_0xdafd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdafd('0x2'));var BPromise=require(_0xdafd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdafd('0x4'));var rimraf=require('rimraf');var config=require(_0xdafd('0x5'));var attributes=require(_0xdafd('0x6'));module[_0xdafd('0x7')]=function(_0x3161be,_0x4e44d0){return _0x3161be[_0xdafd('0x8')](_0xdafd('0x9'),attributes,{'tableName':_0xdafd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec50=['./mailQueue.attributes','define','MailQueue','mail_queues','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x297f01,_0x673b54){var _0xb752f6=function(_0x2f6f1b){while(--_0x2f6f1b){_0x297f01['push'](_0x297f01['shift']());}};_0xb752f6(++_0x673b54);}(_0xec50,0xa9));var _0x0ec5=function(_0x30c30d,_0x11af19){_0x30c30d=_0x30c30d-0x0;var _0x148de0=_0xec50[_0x30c30d];return _0x148de0;};'use strict';var _=require('lodash');var util=require(_0x0ec5('0x0'));var logger=require('../../config/logger')(_0x0ec5('0x1'));var moment=require(_0x0ec5('0x2'));var BPromise=require(_0x0ec5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ec5('0x4'));var rimraf=require(_0x0ec5('0x5'));var config=require(_0x0ec5('0x6'));var attributes=require(_0x0ec5('0x7'));module['exports']=function(_0x552f0a,_0x109079){return _0x552f0a[_0x0ec5('0x8')](_0x0ec5('0x9'),attributes,{'tableName':_0x0ec5('0xa'),'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 1dec4eb..119ad0c 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 _0x997a=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','MailQueue,\x20%s,\x20%s','info','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','MailQueue','find','ShowMailQueue','stringify','util','moment','bluebird','ioredis'];(function(_0x55301a,_0x497662){var _0x2e92e9=function(_0x735b5b){while(--_0x735b5b){_0x55301a['push'](_0x55301a['shift']());}};_0x2e92e9(++_0x497662);}(_0x997a,0x1e8));var _0xa997=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x997a[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xa997('0x0'));var moment=require(_0xa997('0x1'));var BPromise=require(_0xa997('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa997('0x3'));var db=require(_0xa997('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa997('0x5'))('rpc');var config=require(_0xa997('0x6'));var jayson=require(_0xa997('0x7'));var client=jayson[_0xa997('0x8')][_0xa997('0x9')]({'port':0x232a});config[_0xa997('0xa')]=_['defaults'](config[_0xa997('0xa')],{'host':_0xa997('0xb'),'port':0x18eb});var socket=require(_0xa997('0xc'))(new Redis(config[_0xa997('0xa')]));require(_0xa997('0xd'))[_0xa997('0xe')](socket);function respondWithRpcPromise(_0x16723a,_0x29e738,_0x4137da){return new BPromise(function(_0x584179,_0x3aeb3d){return client[_0xa997('0xf')](_0x16723a,_0x4137da)[_0xa997('0x10')](function(_0x4447b7){logger['info']('MailQueue,\x20%s,\x20%s',_0x29e738,'request\x20sent');logger['debug'](_0xa997('0x11'),_0x29e738,_0xa997('0x12'),JSON['stringify'](_0x4447b7));if(_0x4447b7[_0xa997('0x13')]){if(_0x4447b7['error'][_0xa997('0x14')]===0x1f4){logger[_0xa997('0x13')]('MailQueue,\x20%s,\x20%s',_0x29e738,_0x4447b7[_0xa997('0x13')][_0xa997('0x15')]);return _0x3aeb3d(_0x4447b7[_0xa997('0x13')][_0xa997('0x15')]);}logger[_0xa997('0x13')](_0xa997('0x16'),_0x29e738,_0x4447b7['error'][_0xa997('0x15')]);return _0x584179(_0x4447b7[_0xa997('0x13')][_0xa997('0x15')]);}else{logger[_0xa997('0x17')]('MailQueue,\x20%s,\x20%s',_0x29e738,_0xa997('0x12'));_0x584179(_0x4447b7[_0xa997('0x18')][_0xa997('0x15')]);}})[_0xa997('0x19')](function(_0x98d459){logger[_0xa997('0x13')](_0xa997('0x16'),_0x29e738,_0x98d459);_0x3aeb3d(_0x98d459);});});}exports[_0xa997('0x1a')]=function(_0x449fa8){var _0xaf4a73=this;return new Promise(function(_0x2c51ef,_0x37f37a){return db['MailQueue'][_0xa997('0x1b')]({'raw':_0x449fa8[_0xa997('0x1c')]?_0x449fa8[_0xa997('0x1c')][_0xa997('0x1d')]===undefined?!![]:![]:!![],'where':_0x449fa8['options']?_0x449fa8[_0xa997('0x1c')][_0xa997('0x1e')]||null:null,'attributes':_0x449fa8[_0xa997('0x1c')]?_0x449fa8[_0xa997('0x1c')][_0xa997('0x1f')]||null:null,'limit':_0x449fa8[_0xa997('0x1c')]?_0x449fa8[_0xa997('0x1c')][_0xa997('0x20')]||null:null,'include':_0x449fa8['options']?_0x449fa8[_0xa997('0x1c')][_0xa997('0x21')]?_[_0xa997('0x22')](_0x449fa8[_0xa997('0x1c')]['include'],function(_0x14b189){return{'model':db[_0x14b189['model']],'as':_0x14b189['as'],'attributes':_0x14b189['attributes'],'include':_0x14b189[_0xa997('0x21')]?_[_0xa997('0x22')](_0x14b189[_0xa997('0x21')],function(_0xfefc95){return{'model':db[_0xfefc95[_0xa997('0x23')]],'as':_0xfefc95['as'],'attributes':_0xfefc95[_0xa997('0x1f')],'include':_0xfefc95[_0xa997('0x21')]?_[_0xa997('0x22')](_0xfefc95['include'],function(_0x3eba27){return{'model':db[_0x3eba27[_0xa997('0x23')]],'as':_0x3eba27['as'],'attributes':_0x3eba27[_0xa997('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa997('0x10')](function(_0x2c626f){logger[_0xa997('0x17')](_0xa997('0x1a'),_0x449fa8);logger[_0xa997('0x24')](_0xa997('0x1a'),_0x449fa8,JSON['stringify'](_0x2c626f));_0x2c51ef(_0x2c626f);})[_0xa997('0x19')](function(_0x87f36a){logger[_0xa997('0x13')](_0xa997('0x1a'),_0x87f36a[_0xa997('0x15')],_0x449fa8);_0x37f37a(_0xaf4a73[_0xa997('0x13')](0x1f4,_0x87f36a[_0xa997('0x15')]));});});};exports['ShowMailQueue']=function(_0xd336d4){var _0x239d47=this;return new Promise(function(_0x5a18a0,_0x2eb143){return db[_0xa997('0x25')][_0xa997('0x26')]({'raw':_0xd336d4['options']?_0xd336d4['options']['raw']===undefined?!![]:![]:!![],'where':_0xd336d4[_0xa997('0x1c')]?_0xd336d4[_0xa997('0x1c')][_0xa997('0x1e')]||null:null,'attributes':_0xd336d4[_0xa997('0x1c')]?_0xd336d4[_0xa997('0x1c')][_0xa997('0x1f')]||null:null,'include':_0xd336d4[_0xa997('0x1c')]?_0xd336d4[_0xa997('0x1c')][_0xa997('0x21')]?_['map'](_0xd336d4[_0xa997('0x1c')][_0xa997('0x21')],function(_0x242392){return{'model':db[_0x242392[_0xa997('0x23')]],'as':_0x242392['as'],'attributes':_0x242392['attributes'],'include':_0x242392[_0xa997('0x21')]?_[_0xa997('0x22')](_0x242392[_0xa997('0x21')],function(_0x233edf){return{'model':db[_0x233edf['model']],'as':_0x233edf['as'],'attributes':_0x233edf['attributes'],'include':_0x233edf[_0xa997('0x21')]?_[_0xa997('0x22')](_0x233edf[_0xa997('0x21')],function(_0x30820b){return{'model':db[_0x30820b[_0xa997('0x23')]],'as':_0x30820b['as'],'attributes':_0x30820b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c8f55){logger['info']('ShowMailQueue',_0xd336d4);logger[_0xa997('0x24')](_0xa997('0x27'),_0xd336d4,JSON[_0xa997('0x28')](_0x4c8f55));_0x5a18a0(_0x4c8f55);})[_0xa997('0x19')](function(_0x3cbf86){logger[_0xa997('0x13')]('ShowMailQueue',_0x3cbf86[_0xa997('0x15')],_0xd336d4);_0x2eb143(_0x239d47['error'](0x1f4,_0x3cbf86[_0xa997('0x15')]));});});}; \ No newline at end of file +var _0x2ab6=['result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','map','include','model','info','ShowMailQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s','message','request\x20sent'];(function(_0x3306d8,_0x11d42a){var _0x39e559=function(_0x1443dd){while(--_0x1443dd){_0x3306d8['push'](_0x3306d8['shift']());}};_0x39e559(++_0x11d42a);}(_0x2ab6,0x19e));var _0x62ab=function(_0x24bc48,_0x1e5cba){_0x24bc48=_0x24bc48-0x0;var _0x52e578=_0x2ab6[_0x24bc48];return _0x52e578;};'use strict';var _=require(_0x62ab('0x0'));var util=require('util');var moment=require(_0x62ab('0x1'));var BPromise=require(_0x62ab('0x2'));var rs=require(_0x62ab('0x3'));var fs=require('fs');var Redis=require(_0x62ab('0x4'));var db=require(_0x62ab('0x5'))['db'];var utils=require(_0x62ab('0x6'));var logger=require(_0x62ab('0x7'))(_0x62ab('0x8'));var config=require(_0x62ab('0x9'));var jayson=require(_0x62ab('0xa'));var client=jayson['client'][_0x62ab('0xb')]({'port':0x232a});config[_0x62ab('0xc')]=_[_0x62ab('0xd')](config[_0x62ab('0xc')],{'host':_0x62ab('0xe'),'port':0x18eb});var socket=require(_0x62ab('0xf'))(new Redis(config[_0x62ab('0xc')]));require('./mailQueue.socket')[_0x62ab('0x10')](socket);function respondWithRpcPromise(_0x325a2c,_0x259789,_0x5ca0f1){return new BPromise(function(_0x4e71b2,_0x5e399c){return client[_0x62ab('0x11')](_0x325a2c,_0x5ca0f1)[_0x62ab('0x12')](function(_0x410dbb){logger['info']('MailQueue,\x20%s,\x20%s',_0x259789,'request\x20sent');logger[_0x62ab('0x13')](_0x62ab('0x14'),_0x259789,'request\x20sent',JSON[_0x62ab('0x15')](_0x410dbb));if(_0x410dbb[_0x62ab('0x16')]){if(_0x410dbb[_0x62ab('0x16')]['code']===0x1f4){logger[_0x62ab('0x16')](_0x62ab('0x17'),_0x259789,_0x410dbb[_0x62ab('0x16')][_0x62ab('0x18')]);return _0x5e399c(_0x410dbb[_0x62ab('0x16')][_0x62ab('0x18')]);}logger[_0x62ab('0x16')](_0x62ab('0x17'),_0x259789,_0x410dbb[_0x62ab('0x16')]['message']);return _0x4e71b2(_0x410dbb[_0x62ab('0x16')][_0x62ab('0x18')]);}else{logger['info'](_0x62ab('0x17'),_0x259789,_0x62ab('0x19'));_0x4e71b2(_0x410dbb[_0x62ab('0x1a')][_0x62ab('0x18')]);}})[_0x62ab('0x1b')](function(_0xf4361a){logger[_0x62ab('0x16')](_0x62ab('0x17'),_0x259789,_0xf4361a);_0x5e399c(_0xf4361a);});});}exports[_0x62ab('0x1c')]=function(_0x2f39ca){var _0x2b27fa=this;return new Promise(function(_0x154299,_0x32d7c1){return db[_0x62ab('0x1d')][_0x62ab('0x1e')]({'raw':_0x2f39ca[_0x62ab('0x1f')]?_0x2f39ca[_0x62ab('0x1f')][_0x62ab('0x20')]===undefined?!![]:![]:!![],'where':_0x2f39ca['options']?_0x2f39ca['options'][_0x62ab('0x21')]||null:null,'attributes':_0x2f39ca[_0x62ab('0x1f')]?_0x2f39ca['options'][_0x62ab('0x22')]||null:null,'limit':_0x2f39ca['options']?_0x2f39ca[_0x62ab('0x1f')]['limit']||null:null,'include':_0x2f39ca[_0x62ab('0x1f')]?_0x2f39ca[_0x62ab('0x1f')]['include']?_[_0x62ab('0x23')](_0x2f39ca[_0x62ab('0x1f')][_0x62ab('0x24')],function(_0x5975c2){return{'model':db[_0x5975c2[_0x62ab('0x25')]],'as':_0x5975c2['as'],'attributes':_0x5975c2[_0x62ab('0x22')],'include':_0x5975c2['include']?_[_0x62ab('0x23')](_0x5975c2[_0x62ab('0x24')],function(_0x2d00f1){return{'model':db[_0x2d00f1['model']],'as':_0x2d00f1['as'],'attributes':_0x2d00f1['attributes'],'include':_0x2d00f1['include']?_[_0x62ab('0x23')](_0x2d00f1[_0x62ab('0x24')],function(_0x573b32){return{'model':db[_0x573b32[_0x62ab('0x25')]],'as':_0x573b32['as'],'attributes':_0x573b32[_0x62ab('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dfbcc){logger[_0x62ab('0x26')]('GetMailQueue',_0x2f39ca);logger[_0x62ab('0x13')]('GetMailQueue',_0x2f39ca,JSON['stringify'](_0x5dfbcc));_0x154299(_0x5dfbcc);})[_0x62ab('0x1b')](function(_0x92d353){logger['error'](_0x62ab('0x1c'),_0x92d353[_0x62ab('0x18')],_0x2f39ca);_0x32d7c1(_0x2b27fa[_0x62ab('0x16')](0x1f4,_0x92d353[_0x62ab('0x18')]));});});};exports[_0x62ab('0x27')]=function(_0x35ed71){var _0x45274c=this;return new Promise(function(_0x21a869,_0x27d9ff){return db[_0x62ab('0x1d')]['find']({'raw':_0x35ed71['options']?_0x35ed71[_0x62ab('0x1f')][_0x62ab('0x20')]===undefined?!![]:![]:!![],'where':_0x35ed71[_0x62ab('0x1f')]?_0x35ed71[_0x62ab('0x1f')][_0x62ab('0x21')]||null:null,'attributes':_0x35ed71[_0x62ab('0x1f')]?_0x35ed71[_0x62ab('0x1f')][_0x62ab('0x22')]||null:null,'include':_0x35ed71['options']?_0x35ed71[_0x62ab('0x1f')][_0x62ab('0x24')]?_['map'](_0x35ed71[_0x62ab('0x1f')]['include'],function(_0x452ae3){return{'model':db[_0x452ae3['model']],'as':_0x452ae3['as'],'attributes':_0x452ae3['attributes'],'include':_0x452ae3[_0x62ab('0x24')]?_[_0x62ab('0x23')](_0x452ae3[_0x62ab('0x24')],function(_0x2051ee){return{'model':db[_0x2051ee[_0x62ab('0x25')]],'as':_0x2051ee['as'],'attributes':_0x2051ee['attributes'],'include':_0x2051ee[_0x62ab('0x24')]?_[_0x62ab('0x23')](_0x2051ee[_0x62ab('0x24')],function(_0x13c5df){return{'model':db[_0x13c5df[_0x62ab('0x25')]],'as':_0x13c5df['as'],'attributes':_0x13c5df[_0x62ab('0x22')]};}):[]};}):[]};}):[]:[]})[_0x62ab('0x12')](function(_0x42ebd1){logger[_0x62ab('0x26')](_0x62ab('0x27'),_0x35ed71);logger['debug'](_0x62ab('0x27'),_0x35ed71,JSON[_0x62ab('0x15')](_0x42ebd1));_0x21a869(_0x42ebd1);})['catch'](function(_0x51def2){logger[_0x62ab('0x16')](_0x62ab('0x27'),_0x51def2[_0x62ab('0x18')],_0x35ed71);_0x27d9ff(_0x45274c['error'](0x1f4,_0x51def2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c00cbb2..c552bc5 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 _0x6d1a=['remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0x574de6,_0x558a28){var _0x4008d9=function(_0xd5b327){while(--_0xd5b327){_0x574de6['push'](_0x574de6['shift']());}};_0x4008d9(++_0x558a28);}(_0x6d1a,0x1c0));var _0xa6d1=function(_0x8a0967,_0x1a413e){_0x8a0967=_0x8a0967-0x0;var _0x30f1e3=_0x6d1a[_0x8a0967];return _0x30f1e3;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xa6d1('0x0'),_0xa6d1('0x1')];function createListener(_0x466e30,_0x2a18cb){return function(_0x155f65){_0x2a18cb[_0xa6d1('0x2')](_0x466e30,_0x155f65);};}function removeListener(_0x400321,_0x12bc60){return function(){MailQueueEvents[_0xa6d1('0x3')](_0x400321,_0x12bc60);};}exports[_0xa6d1('0x4')]=function(_0x5d6d9e){for(var _0x5c5f20=0x0,_0x53543e=events[_0xa6d1('0x5')];_0x5c5f20<_0x53543e;_0x5c5f20++){var _0x1fb153=events[_0x5c5f20];var _0x4b7153=createListener(_0xa6d1('0x6')+_0x1fb153,_0x5d6d9e);MailQueueEvents['on'](_0x1fb153,_0x4b7153);}}; \ No newline at end of file +var _0xc540=['register','length','mailQueue:','update','emit'];(function(_0x28edfe,_0xb3b013){var _0x90669a=function(_0x1272a){while(--_0x1272a){_0x28edfe['push'](_0x28edfe['shift']());}};_0x90669a(++_0xb3b013);}(_0xc540,0x184));var _0x0c54=function(_0x2321d7,_0x3d50ca){_0x2321d7=_0x2321d7-0x0;var _0x5146ee=_0xc540[_0x2321d7];return _0x5146ee;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save','remove',_0x0c54('0x0')];function createListener(_0x498249,_0xea5a4c){return function(_0x32e023){_0xea5a4c[_0x0c54('0x1')](_0x498249,_0x32e023);};}function removeListener(_0x4d4f38,_0xb6113e){return function(){MailQueueEvents['removeListener'](_0x4d4f38,_0xb6113e);};}exports[_0x0c54('0x2')]=function(_0x1fd2e0){for(var _0x354647=0x0,_0xd1bfc5=events[_0x0c54('0x3')];_0x354647<_0xd1bfc5;_0x354647++){var _0x90e1b0=events[_0x354647];var _0x4067ac=createListener(_0x0c54('0x4')+_0x90e1b0,_0x1fd2e0);MailQueueEvents['on'](_0x90e1b0,_0x4067ac);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5d55767..b86944d 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 _0xccb4=['describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x10e6cf,_0x40b29a){var _0x3d6130=function(_0x249be9){while(--_0x249be9){_0x10e6cf['push'](_0x10e6cf['shift']());}};_0x3d6130(++_0x40b29a);}(_0xccb4,0x73));var _0x4ccb=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xccb4[_0x58afd5];return _0x3e503b;};'use strict';var multer=require(_0x4ccb('0x0'));var util=require(_0x4ccb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4ccb('0x2'));var router=express[_0x4ccb('0x3')]();var fs_extra=require(_0x4ccb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4ccb('0x5'));var config=require('../../config/environment');var controller=require(_0x4ccb('0x6'));router[_0x4ccb('0x7')]('/',auth[_0x4ccb('0x8')](),controller[_0x4ccb('0x9')]);router[_0x4ccb('0x7')](_0x4ccb('0xa'),auth[_0x4ccb('0x8')](),controller[_0x4ccb('0xb')]);router[_0x4ccb('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4ccb('0xc')]);router[_0x4ccb('0xd')]('/',auth['isAuthenticated'](),controller[_0x4ccb('0xe')]);router[_0x4ccb('0xf')](_0x4ccb('0x10'),auth[_0x4ccb('0x8')](),controller[_0x4ccb('0x11')]);router[_0x4ccb('0x12')]('/:id',auth[_0x4ccb('0x8')](),controller[_0x4ccb('0x13')]);module[_0x4ccb('0x14')]=router; \ No newline at end of file +var _0x4a31=['multer','util','path','express','Router','fs-extra','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','describe','post','update','delete','/:id','destroy','exports'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x4a31,0x17a));var _0x14a3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a31[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x14a3('0x0'));var util=require(_0x14a3('0x1'));var path=require(_0x14a3('0x2'));var timeout=require('connect-timeout');var express=require(_0x14a3('0x3'));var router=express[_0x14a3('0x4')]();var fs_extra=require(_0x14a3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x14a3('0x6'));var controller=require(_0x14a3('0x7'));router['get']('/',auth[_0x14a3('0x8')](),controller[_0x14a3('0x9')]);router[_0x14a3('0xa')]('/describe',auth[_0x14a3('0x8')](),controller[_0x14a3('0xb')]);router[_0x14a3('0xa')]('/:id',auth[_0x14a3('0x8')](),controller['show']);router[_0x14a3('0xc')]('/',auth[_0x14a3('0x8')](),controller['create']);router['put']('/:id',auth[_0x14a3('0x8')](),controller[_0x14a3('0xd')]);router[_0x14a3('0xe')](_0x14a3('0xf'),auth[_0x14a3('0x8')](),controller[_0x14a3('0x10')]);module[_0x14a3('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 0ebe80a..75a5222 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 _0x2e15=['STRING','DATE','exports'];(function(_0x5c044d,_0xbda471){var _0xf4abdb=function(_0x31fc79){while(--_0x31fc79){_0x5c044d['push'](_0x5c044d['shift']());}};_0xf4abdb(++_0xbda471);}(_0x2e15,0xda));var _0x52e1=function(_0x519401,_0x3c39ab){_0x519401=_0x519401-0x0;var _0x11e911=_0x2e15[_0x519401];return _0x11e911;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x52e1('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x52e1('0x1')]},'joinAt':{'type':Sequelize[_0x52e1('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x52e1('0x2')]},'exitAt':{'type':Sequelize[_0x52e1('0x2')]},'reason':{'type':Sequelize[_0x52e1('0x1')]}}; \ No newline at end of file +var _0xb97b=['sequelize','exports','STRING','DATE'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xb97b,0xd8));var _0xbb97=function(_0x601cf7,_0x36e56d){_0x601cf7=_0x601cf7-0x0;var _0x4de216=_0xb97b[_0x601cf7];return _0x4de216;};'use strict';var moment=require('moment');var Sequelize=require(_0xbb97('0x0'));module[_0xbb97('0x1')]={'uniqueid':{'type':Sequelize[_0xbb97('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbb97('0x3')]},'leaveAt':{'type':Sequelize[_0xbb97('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbb97('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 362addd..b9a40bd 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 _0xed1c=['rows','catch','show','MailQueueReport','create','body','params','find','describe','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','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','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x432e98,_0x58e917){var _0xbafb66=function(_0x36dc91){while(--_0x36dc91){_0x432e98['push'](_0x432e98['shift']());}};_0xbafb66(++_0x58e917);}(_0xed1c,0xe4));var _0xced1=function(_0x2cf575,_0x1ef69d){_0x2cf575=_0x2cf575-0x0;var _0x3f4ec0=_0xed1c[_0x2cf575];return _0x3f4ec0;};'use strict';var emlformat=require(_0xced1('0x0'));var rimraf=require(_0xced1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xced1('0x2'));var Mustache=require(_0xced1('0x3'));var util=require(_0xced1('0x4'));var path=require('path');var sox=require(_0xced1('0x5'));var csv=require(_0xced1('0x6'));var ejs=require(_0xced1('0x7'));var fs=require('fs');var fs_extra=require(_0xced1('0x8'));var _=require('lodash');var squel=require(_0xced1('0x9'));var crypto=require(_0xced1('0xa'));var jsforce=require(_0xced1('0xb'));var deskjs=require(_0xced1('0xc'));var toCsv=require(_0xced1('0x6'));var querystring=require(_0xced1('0xd'));var Papa=require(_0xced1('0xe'));var Redis=require(_0xced1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xced1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xced1('0x11'));var logger=require(_0xced1('0x12'))(_0xced1('0x13'));var utils=require(_0xced1('0x14'));var config=require(_0xced1('0x15'));var licenseUtil=require(_0xced1('0x16'));var db=require(_0xced1('0x17'))['db'];function respondWithStatusCode(_0x5e5637,_0x118f69){_0x118f69=_0x118f69||0xcc;return function(_0x2a5cd6){if(_0x2a5cd6){return _0x5e5637[_0xced1('0x18')](_0x118f69);}return _0x5e5637[_0xced1('0x19')](_0x118f69)['end']();};}function respondWithResult(_0xdaaea7,_0x31a32c){_0x31a32c=_0x31a32c||0xc8;return function(_0x54cba9){if(_0x54cba9){return _0xdaaea7[_0xced1('0x19')](_0x31a32c)[_0xced1('0x1a')](_0x54cba9);}};}function respondWithFilteredResult(_0x3708b1,_0x32100b){return function(_0x47baec){if(_0x47baec){var _0x5560af=typeof _0x32100b[_0xced1('0x1b')]===_0xced1('0x1c')&&typeof _0x32100b[_0xced1('0x1d')]===_0xced1('0x1c');var _0x3e53bd=_0x47baec[_0xced1('0x1e')];var _0x5a563a=_0x5560af?0x0:_0x32100b['offset'];var _0x2a92c8=_0x5560af?_0x47baec[_0xced1('0x1e')]:_0x32100b[_0xced1('0x1b')]+_0x32100b['limit'];var _0x1eac14;if(_0x2a92c8>=_0x3e53bd){_0x2a92c8=_0x3e53bd;_0x1eac14=0xc8;}else{_0x1eac14=0xce;}_0x3708b1[_0xced1('0x19')](_0x1eac14);return _0x3708b1[_0xced1('0x1f')]('Content-Range',_0x5a563a+'-'+_0x2a92c8+'/'+_0x3e53bd)[_0xced1('0x1a')](_0x47baec);}return null;};}function patchUpdates(_0x42b146){return function(_0x23ded4){try{jsonpatch['apply'](_0x23ded4,_0x42b146,!![]);}catch(_0x138c8b){return BPromise[_0xced1('0x20')](_0x138c8b);}return _0x23ded4[_0xced1('0x21')]();};}function saveUpdates(_0x5f1474,_0x4dab56){return function(_0x1d3884){if(_0x1d3884){return _0x1d3884[_0xced1('0x22')](_0x5f1474)[_0xced1('0x23')](function(_0x20dcb4){return _0x20dcb4;});}return null;};}function removeEntity(_0x210d7e,_0x49c8b9){return function(_0x14f47e){if(_0x14f47e){return _0x14f47e[_0xced1('0x24')]()['then'](function(){_0x210d7e['status'](0xcc)[_0xced1('0x25')]();});}};}function handleEntityNotFound(_0x258c9a,_0x3af9c0){return function(_0x3912fe){if(!_0x3912fe){_0x258c9a[_0xced1('0x18')](0x194);}return _0x3912fe;};}function handleError(_0x25b6e7,_0x50c543){_0x50c543=_0x50c543||0x1f4;return function(_0x181f6e){logger[_0xced1('0x26')](_0x181f6e[_0xced1('0x27')]);if(_0x181f6e[_0xced1('0x28')]){delete _0x181f6e[_0xced1('0x28')];}_0x25b6e7[_0xced1('0x19')](_0x50c543)[_0xced1('0x29')](_0x181f6e);};}exports['index']=function(_0x15c4f4,_0x4ef64e){var _0x45cb03={},_0x2c2269={},_0x6dc558={'count':0x0,'rows':[]};var _0x176215=_['map'](db['MailQueueReport'][_0xced1('0x2a')],function(_0x15117b){return{'name':_0x15117b[_0xced1('0x2b')],'type':_0x15117b['type']['key']};});_0x2c2269['model']=_[_0xced1('0x2c')](_0x176215,_0xced1('0x28'));_0x2c2269[_0xced1('0x2d')]=_[_0xced1('0x2e')](_0x15c4f4['query']);_0x2c2269[_0xced1('0x2f')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],_0x2c2269[_0xced1('0x2d')]);_0x45cb03[_0xced1('0x32')]=_[_0xced1('0x30')](_0x2c2269[_0xced1('0x31')],qs['fields'](_0x15c4f4['query'][_0xced1('0x33')]));_0x45cb03[_0xced1('0x32')]=_0x45cb03[_0xced1('0x32')][_0xced1('0x34')]?_0x45cb03[_0xced1('0x32')]:_0x2c2269[_0xced1('0x31')];if(!_0x15c4f4['query']['hasOwnProperty']('nolimit')){_0x45cb03['limit']=qs[_0xced1('0x1d')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1d')]);_0x45cb03[_0xced1('0x1b')]=qs[_0xced1('0x1b')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x1b')]);}_0x45cb03[_0xced1('0x35')]=qs[_0xced1('0x36')](_0x15c4f4[_0xced1('0x2d')][_0xced1('0x36')]);_0x45cb03[_0xced1('0x37')]=qs[_0xced1('0x2f')](_['pick'](_0x15c4f4[_0xced1('0x2d')],_0x2c2269[_0xced1('0x2f')]),_0x176215);if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]){_0x45cb03[_0xced1('0x37')]=_[_0xced1('0x39')](_0x45cb03['where'],{'$or':_[_0xced1('0x2c')](_0x176215,function(_0x3f3632){if(_0x3f3632[_0xced1('0x3a')]!==_0xced1('0x3b')){var _0x282361={};_0x282361[_0x3f3632[_0xced1('0x28')]]={'$like':'%'+_0x15c4f4[_0xced1('0x2d')][_0xced1('0x38')]+'%'};return _0x282361;}})});}_0x45cb03=_[_0xced1('0x39')]({},_0x45cb03,_0x15c4f4[_0xced1('0x3c')]);var _0x1e119c={'where':_0x45cb03['where']};return db['MailQueueReport'][_0xced1('0x1e')](_0x1e119c)[_0xced1('0x23')](function(_0x1887a3){_0x6dc558['count']=_0x1887a3;if(_0x15c4f4[_0xced1('0x2d')][_0xced1('0x3d')]){_0x45cb03[_0xced1('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0xced1('0x3f')](_0x45cb03);})[_0xced1('0x23')](function(_0x5a01f6){_0x6dc558[_0xced1('0x40')]=_0x5a01f6;return _0x6dc558;})['then'](respondWithFilteredResult(_0x4ef64e,_0x45cb03))[_0xced1('0x41')](handleError(_0x4ef64e,null));};exports[_0xced1('0x42')]=function(_0x4f99df,_0x1ddaea){var _0x172a7e={'raw':!![],'where':{'id':_0x4f99df['params']['id']}},_0xdb8e8e={};_0xdb8e8e[_0xced1('0x31')]=_[_0xced1('0x2e')](db['MailQueueReport'][_0xced1('0x2a')]);_0xdb8e8e['query']=_['keys'](_0x4f99df[_0xced1('0x2d')]);_0xdb8e8e['filters']=_[_0xced1('0x30')](_0xdb8e8e[_0xced1('0x31')],_0xdb8e8e[_0xced1('0x2d')]);_0x172a7e['attributes']=_[_0xced1('0x30')](_0xdb8e8e['model'],qs[_0xced1('0x33')](_0x4f99df[_0xced1('0x2d')][_0xced1('0x33')]));_0x172a7e[_0xced1('0x32')]=_0x172a7e['attributes'][_0xced1('0x34')]?_0x172a7e[_0xced1('0x32')]:_0xdb8e8e['model'];if(_0x4f99df[_0xced1('0x2d')][_0xced1('0x3d')]){_0x172a7e['include']=[{'all':!![]}];}_0x172a7e=_[_0xced1('0x39')]({},_0x172a7e,_0x4f99df[_0xced1('0x3c')]);return db[_0xced1('0x43')]['find'](_0x172a7e)[_0xced1('0x23')](handleEntityNotFound(_0x1ddaea,null))[_0xced1('0x23')](respondWithResult(_0x1ddaea,null))[_0xced1('0x41')](handleError(_0x1ddaea,null));};exports[_0xced1('0x44')]=function(_0x376619,_0x528cd5){return db[_0xced1('0x43')]['create'](_0x376619[_0xced1('0x45')],{})[_0xced1('0x23')](respondWithResult(_0x528cd5,0xc9))[_0xced1('0x41')](handleError(_0x528cd5,null));};exports[_0xced1('0x22')]=function(_0x412693,_0x38aa3b){if(_0x412693['body']['id']){delete _0x412693[_0xced1('0x45')]['id'];}return db[_0xced1('0x43')]['find']({'where':{'id':_0x412693[_0xced1('0x46')]['id']}})['then'](handleEntityNotFound(_0x38aa3b,null))['then'](saveUpdates(_0x412693[_0xced1('0x45')],null))[_0xced1('0x23')](respondWithResult(_0x38aa3b,null))[_0xced1('0x41')](handleError(_0x38aa3b,null));};exports[_0xced1('0x24')]=function(_0x4f0183,_0x1090bc){return db[_0xced1('0x43')][_0xced1('0x47')]({'where':{'id':_0x4f0183['params']['id']}})['then'](handleEntityNotFound(_0x1090bc,null))[_0xced1('0x23')](removeEntity(_0x1090bc,null))[_0xced1('0x41')](handleError(_0x1090bc,null));};exports[_0xced1('0x48')]=function(_0x226b3e,_0x4b460e){return db['MailQueueReport']['describe']()[_0xced1('0x23')](respondWithResult(_0x4b460e,null))[_0xced1('0x41')](handleError(_0x4b460e,null));}; \ No newline at end of file +var _0x9f0e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2d09fb,_0x26dea9){_0x2d09fb=_0x2d09fb-0x0;var _0x248ac6=_0x9f0e[_0x2d09fb];return _0x248ac6;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':!![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['MailQueueReport'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['MailQueueReport'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index bc1ce17..51aba17 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 _0x9fb5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util'];(function(_0x32e8f2,_0x33cff3){var _0xefd2e6=function(_0x524abd){while(--_0x524abd){_0x32e8f2['push'](_0x32e8f2['shift']());}};_0xefd2e6(++_0x33cff3);}(_0x9fb5,0x11c));var _0x59fb=function(_0x3e6925,_0x4c7f02){_0x3e6925=_0x3e6925-0x0;var _0xfd626a=_0x9fb5[_0x3e6925];return _0xfd626a;};'use strict';var _=require('lodash');var util=require(_0x59fb('0x0'));var logger=require(_0x59fb('0x1'))(_0x59fb('0x2'));var moment=require(_0x59fb('0x3'));var BPromise=require(_0x59fb('0x4'));var rp=require(_0x59fb('0x5'));var fs=require('fs');var path=require(_0x59fb('0x6'));var rimraf=require(_0x59fb('0x7'));var config=require(_0x59fb('0x8'));var attributes=require(_0x59fb('0x9'));module[_0x59fb('0xa')]=function(_0x30fa28,_0x52d63d){return _0x30fa28[_0x59fb('0xb')](_0x59fb('0xc'),attributes,{'tableName':_0x59fb('0xd'),'paranoid':![],'indexes':[{'name':_0x59fb('0xe'),'fields':[_0x59fb('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c8a=['../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x323c30,_0x4588ea){var _0xae64dc=function(_0x32beac){while(--_0x32beac){_0x323c30['push'](_0x323c30['shift']());}};_0xae64dc(++_0x4588ea);}(_0x1c8a,0x111));var _0xa1c8=function(_0x4134b5,_0x30caf1){_0x4134b5=_0x4134b5-0x0;var _0x9cf962=_0x1c8a[_0x4134b5];return _0x9cf962;};'use strict';var _=require(_0xa1c8('0x0'));var util=require(_0xa1c8('0x1'));var logger=require(_0xa1c8('0x2'))('api');var moment=require(_0xa1c8('0x3'));var BPromise=require(_0xa1c8('0x4'));var rp=require(_0xa1c8('0x5'));var fs=require('fs');var path=require(_0xa1c8('0x6'));var rimraf=require('rimraf');var config=require(_0xa1c8('0x7'));var attributes=require(_0xa1c8('0x8'));module[_0xa1c8('0x9')]=function(_0x4ec9fb,_0x33743c){return _0x4ec9fb[_0xa1c8('0xa')](_0xa1c8('0xb'),attributes,{'tableName':_0xa1c8('0xc'),'paranoid':![],'indexes':[{'name':_0xa1c8('0xd'),'fields':[_0xa1c8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index a8b49d0..2448fe2 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x205da6,_0x24410c){var _0x18e116=function(_0x55b4bf){while(--_0x55b4bf){_0x205da6['push'](_0x205da6['shift']());}};_0x18e116(++_0x24410c);}(_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 moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2b19ed,_0x2aebbd){var _0x304885=function(_0x46d402){while(--_0x46d402){_0x2b19ed['push'](_0x2b19ed['shift']());}};_0x304885(++_0x2aebbd);}(_0xadb5,0xad));var _0x5adb=function(_0x23cc55,_0x424e9a){_0x23cc55=_0x23cc55-0x0;var _0x6b237c=_0xadb5[_0x23cc55];return _0x6b237c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index a4d99b1..04abb12 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f5a27,_0x541ea2){var _0x2299f9=function(_0x2bd16c){while(--_0x2bd16c){_0x1f5a27['push'](_0x1f5a27['shift']());}};_0x2299f9(++_0x541ea2);}(_0xe706,0xa3));var _0x6e70=function(_0x2bf5d1,_0x14e28f){_0x2bf5d1=_0x2bf5d1-0x0;var _0x3472c6=_0xe706[_0x2bf5d1];return _0x3472c6;};'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(_0x59d769,_0x3bbc94){var _0x29f394=function(_0x27e279){while(--_0x27e279){_0x59d769['push'](_0x59d769['shift']());}};_0x29f394(++_0x3bbc94);}(_0x70e0,0x17b));var _0x070e=function(_0x3e9092,_0x2b7060){_0x3e9092=_0x3e9092-0x0;var _0x47e452=_0x70e0[_0x3e9092];return _0x47e452;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 123ae98..1dbbf20 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 _0xa902=['BOOLEAN','INBOX','INTEGER','sequelize','exports','STRING'];(function(_0x1b1604,_0x368535){var _0x57918d=function(_0x176c51){while(--_0x176c51){_0x1b1604['push'](_0x1b1604['shift']());}};_0x57918d(++_0x368535);}(_0xa902,0x8d));var _0x2a90=function(_0x146a6b,_0x204330){_0x146a6b=_0x146a6b-0x0;var _0x40bf25=_0xa902[_0x146a6b];return _0x40bf25;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'description':{'type':Sequelize[_0x2a90('0x2')]},'host':{'type':Sequelize[_0x2a90('0x2')]},'authentication':{'type':Sequelize[_0x2a90('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2a90('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2a90('0x2')],'defaultValue':_0x2a90('0x4')},'connTimeout':{'type':Sequelize[_0x2a90('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x2a90('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x2a90('0x2')]}}; \ No newline at end of file +var _0x1d2d=['sequelize','exports','STRING','BOOLEAN','INBOX','INTEGER'];(function(_0x576886,_0x182d1c){var _0x42472f=function(_0x24dd86){while(--_0x24dd86){_0x576886['push'](_0x576886['shift']());}};_0x42472f(++_0x182d1c);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x50ec19,_0x402228){_0x50ec19=_0x50ec19-0x0;var _0x48770b=_0x1d2d[_0x50ec19];return _0x48770b;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module[_0xd1d2('0x1')]={'description':{'type':Sequelize[_0xd1d2('0x2')]},'host':{'type':Sequelize[_0xd1d2('0x2')]},'authentication':{'type':Sequelize[_0xd1d2('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd1d2('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd1d2('0x2')],'defaultValue':_0xd1d2('0x4')},'connTimeout':{'type':Sequelize[_0xd1d2('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd1d2('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd1d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index a4951af..6f09ea7 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 _0x9bed=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in','lodash'];(function(_0x56aa01,_0x41013e){var _0x1a9cd1=function(_0x14a77c){while(--_0x14a77c){_0x56aa01['push'](_0x56aa01['shift']());}};_0x1a9cd1(++_0x41013e);}(_0x9bed,0x137));var _0xd9be=function(_0x5c6ccb,_0x1612e9){_0x5c6ccb=_0x5c6ccb-0x0;var _0x587f11=_0x9bed[_0x5c6ccb];return _0x587f11;};'use strict';var _=require(_0xd9be('0x0'));var util=require(_0xd9be('0x1'));var logger=require(_0xd9be('0x2'))(_0xd9be('0x3'));var moment=require(_0xd9be('0x4'));var BPromise=require(_0xd9be('0x5'));var rp=require(_0xd9be('0x6'));var fs=require('fs');var path=require(_0xd9be('0x7'));var rimraf=require(_0xd9be('0x8'));var config=require(_0xd9be('0x9'));var attributes=require(_0xd9be('0xa'));module['exports']=function(_0x3a8bfc,_0x58afb5){return _0x3a8bfc['define'](_0xd9be('0xb'),attributes,{'tableName':_0xd9be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x188b=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','bluebird','path','rimraf','./mailServerIn.attributes','exports','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x188b,0xb6));var _0xb188=function(_0x367721,_0x327d7a){_0x367721=_0x367721-0x0;var _0x310ec3=_0x188b[_0x367721];return _0x310ec3;};'use strict';var _=require(_0xb188('0x0'));var util=require(_0xb188('0x1'));var logger=require(_0xb188('0x2'))(_0xb188('0x3'));var moment=require('moment');var BPromise=require(_0xb188('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb188('0x5'));var rimraf=require(_0xb188('0x6'));var config=require('../../config/environment');var attributes=require(_0xb188('0x7'));module[_0xb188('0x8')]=function(_0x140f17,_0xab885b){return _0x140f17[_0xb188('0x9')](_0xb188('0xa'),attributes,{'tableName':_0xb188('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 8481b8f..747fddd 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 _0x53f7=['model','include','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailServerIn','options','raw','where','attributes','limit','map'];(function(_0x5cdacf,_0x7c82b1){var _0xa68a8b=function(_0x4b3818){while(--_0x4b3818){_0x5cdacf['push'](_0x5cdacf['shift']());}};_0xa68a8b(++_0x7c82b1);}(_0x53f7,0x12c));var _0x753f=function(_0x28cddc,_0x1be16d){_0x28cddc=_0x28cddc-0x0;var _0x5ce855=_0x53f7[_0x28cddc];return _0x5ce855;};'use strict';var _=require(_0x753f('0x0'));var util=require(_0x753f('0x1'));var moment=require(_0x753f('0x2'));var BPromise=require(_0x753f('0x3'));var rs=require(_0x753f('0x4'));var fs=require('fs');var Redis=require(_0x753f('0x5'));var db=require(_0x753f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x753f('0x7'))(_0x753f('0x8'));var config=require(_0x753f('0x9'));var jayson=require(_0x753f('0xa'));var client=jayson[_0x753f('0xb')][_0x753f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f51bd,_0x44109e,_0x2a4cbf){return new BPromise(function(_0x564ef6,_0x4a608a){return client['request'](_0x3f51bd,_0x2a4cbf)[_0x753f('0xd')](function(_0x165ee7){logger[_0x753f('0xe')](_0x753f('0xf'),_0x44109e,_0x753f('0x10'));logger[_0x753f('0x11')](_0x753f('0x12'),_0x44109e,_0x753f('0x10'),JSON[_0x753f('0x13')](_0x165ee7));if(_0x165ee7['error']){if(_0x165ee7[_0x753f('0x14')]['code']===0x1f4){logger[_0x753f('0x14')](_0x753f('0xf'),_0x44109e,_0x165ee7[_0x753f('0x14')][_0x753f('0x15')]);return _0x4a608a(_0x165ee7[_0x753f('0x14')]['message']);}logger[_0x753f('0x14')](_0x753f('0xf'),_0x44109e,_0x165ee7[_0x753f('0x14')]['message']);return _0x564ef6(_0x165ee7[_0x753f('0x14')][_0x753f('0x15')]);}else{logger[_0x753f('0xe')](_0x753f('0xf'),_0x44109e,_0x753f('0x10'));_0x564ef6(_0x165ee7[_0x753f('0x16')]['message']);}})['catch'](function(_0x20f89a){logger[_0x753f('0x14')](_0x753f('0xf'),_0x44109e,_0x20f89a);_0x4a608a(_0x20f89a);});});}exports[_0x753f('0x17')]=function(_0x39e35b){var _0x4d1c44=this;return new Promise(function(_0x21aa9b,_0x583fa0){return db['MailServerIn']['findAll']({'raw':_0x39e35b[_0x753f('0x18')]?_0x39e35b['options'][_0x753f('0x19')]===undefined?!![]:![]:!![],'where':_0x39e35b['options']?_0x39e35b['options'][_0x753f('0x1a')]||null:null,'attributes':_0x39e35b[_0x753f('0x18')]?_0x39e35b['options'][_0x753f('0x1b')]||null:null,'limit':_0x39e35b['options']?_0x39e35b[_0x753f('0x18')][_0x753f('0x1c')]||null:null,'include':_0x39e35b[_0x753f('0x18')]?_0x39e35b['options']['include']?_[_0x753f('0x1d')](_0x39e35b[_0x753f('0x18')]['include'],function(_0x5d3621){return{'model':db[_0x5d3621[_0x753f('0x1e')]],'as':_0x5d3621['as'],'attributes':_0x5d3621[_0x753f('0x1b')],'include':_0x5d3621['include']?_[_0x753f('0x1d')](_0x5d3621[_0x753f('0x1f')],function(_0x4c1673){return{'model':db[_0x4c1673['model']],'as':_0x4c1673['as'],'attributes':_0x4c1673[_0x753f('0x1b')],'include':_0x4c1673['include']?_[_0x753f('0x1d')](_0x4c1673[_0x753f('0x1f')],function(_0x24fa71){return{'model':db[_0x24fa71['model']],'as':_0x24fa71['as'],'attributes':_0x24fa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x753f('0xd')](function(_0x43ab0e){logger[_0x753f('0xe')](_0x753f('0x17'),_0x39e35b);logger[_0x753f('0x11')](_0x753f('0x17'),_0x39e35b,JSON[_0x753f('0x13')](_0x43ab0e));_0x21aa9b(_0x43ab0e);})[_0x753f('0x20')](function(_0x22947a){logger[_0x753f('0x14')](_0x753f('0x17'),_0x22947a['message'],_0x39e35b);_0x583fa0(_0x4d1c44[_0x753f('0x14')](0x1f4,_0x22947a[_0x753f('0x15')]));});});}; \ No newline at end of file +var _0x252f=['lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','findAll','raw','options','where','attributes','include','map','model','GetMailServerIn'];(function(_0x580e5b,_0x2dc1cd){var _0x26d485=function(_0x3fbfb9){while(--_0x3fbfb9){_0x580e5b['push'](_0x580e5b['shift']());}};_0x26d485(++_0x2dc1cd);}(_0x252f,0xd0));var _0xf252=function(_0x2c8f05,_0x3b5b37){_0x2c8f05=_0x2c8f05-0x0;var _0x3a48fd=_0x252f[_0x2c8f05];return _0x3a48fd;};'use strict';var _=require(_0xf252('0x0'));var util=require(_0xf252('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf252('0x2'));var fs=require('fs');var Redis=require(_0xf252('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf252('0x4'))(_0xf252('0x5'));var config=require(_0xf252('0x6'));var jayson=require(_0xf252('0x7'));var client=jayson[_0xf252('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fad52,_0x18282c,_0x271d94){return new BPromise(function(_0xc8ae97,_0x25e8af){return client['request'](_0x3fad52,_0x271d94)[_0xf252('0x9')](function(_0x352951){logger['info'](_0xf252('0xa'),_0x18282c,'request\x20sent');logger[_0xf252('0xb')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x18282c,_0xf252('0xc'),JSON[_0xf252('0xd')](_0x352951));if(_0x352951[_0xf252('0xe')]){if(_0x352951[_0xf252('0xe')]['code']===0x1f4){logger[_0xf252('0xe')](_0xf252('0xa'),_0x18282c,_0x352951[_0xf252('0xe')][_0xf252('0xf')]);return _0x25e8af(_0x352951[_0xf252('0xe')][_0xf252('0xf')]);}logger['error'](_0xf252('0xa'),_0x18282c,_0x352951[_0xf252('0xe')][_0xf252('0xf')]);return _0xc8ae97(_0x352951['error'][_0xf252('0xf')]);}else{logger[_0xf252('0x10')](_0xf252('0xa'),_0x18282c,_0xf252('0xc'));_0xc8ae97(_0x352951['result'][_0xf252('0xf')]);}})['catch'](function(_0x32a8e9){logger[_0xf252('0xe')](_0xf252('0xa'),_0x18282c,_0x32a8e9);_0x25e8af(_0x32a8e9);});});}exports['GetMailServerIn']=function(_0x4f6bd5){var _0x1d98dd=this;return new Promise(function(_0x34ce46,_0x2a8497){return db['MailServerIn'][_0xf252('0x11')]({'raw':_0x4f6bd5['options']?_0x4f6bd5['options'][_0xf252('0x12')]===undefined?!![]:![]:!![],'where':_0x4f6bd5[_0xf252('0x13')]?_0x4f6bd5[_0xf252('0x13')][_0xf252('0x14')]||null:null,'attributes':_0x4f6bd5['options']?_0x4f6bd5[_0xf252('0x13')][_0xf252('0x15')]||null:null,'limit':_0x4f6bd5[_0xf252('0x13')]?_0x4f6bd5[_0xf252('0x13')]['limit']||null:null,'include':_0x4f6bd5['options']?_0x4f6bd5[_0xf252('0x13')][_0xf252('0x16')]?_[_0xf252('0x17')](_0x4f6bd5['options'][_0xf252('0x16')],function(_0x2ba040){return{'model':db[_0x2ba040[_0xf252('0x18')]],'as':_0x2ba040['as'],'attributes':_0x2ba040['attributes'],'include':_0x2ba040[_0xf252('0x16')]?_[_0xf252('0x17')](_0x2ba040[_0xf252('0x16')],function(_0x36f8a5){return{'model':db[_0x36f8a5[_0xf252('0x18')]],'as':_0x36f8a5['as'],'attributes':_0x36f8a5[_0xf252('0x15')],'include':_0x36f8a5['include']?_[_0xf252('0x17')](_0x36f8a5[_0xf252('0x16')],function(_0x2c6073){return{'model':db[_0x2c6073[_0xf252('0x18')]],'as':_0x2c6073['as'],'attributes':_0x2c6073[_0xf252('0x15')]};}):[]};}):[]};}):[]:[]})[_0xf252('0x9')](function(_0x147111){logger[_0xf252('0x10')](_0xf252('0x19'),_0x4f6bd5);logger[_0xf252('0xb')]('GetMailServerIn',_0x4f6bd5,JSON[_0xf252('0xd')](_0x147111));_0x34ce46(_0x147111);})['catch'](function(_0x534c98){logger[_0xf252('0xe')](_0xf252('0x19'),_0x534c98['message'],_0x4f6bd5);_0x2a8497(_0x1d98dd['error'](0x1f4,_0x534c98['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index df75e83..ec0fea6 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(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 157c406..32362f7 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 _0x9a7f=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x9a7f,0x10c));var _0xf9a7=function(_0x410135,_0xfd7ce8){_0x410135=_0x410135-0x0;var _0x2e24ae=_0x9a7f[_0x410135];return _0x2e24ae;};'use strict';var Sequelize=require(_0xf9a7('0x0'));module[_0xf9a7('0x1')]={'description':{'type':Sequelize[_0xf9a7('0x2')]},'host':{'type':Sequelize[_0xf9a7('0x2')]},'user':{'type':Sequelize[_0xf9a7('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf9a7('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xf9a7('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xed9b=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x11181f,_0x136213){var _0x226b3d=function(_0x5d4657){while(--_0x5d4657){_0x11181f['push'](_0x11181f['shift']());}};_0x226b3d(++_0x136213);}(_0xed9b,0xd2));var _0xbed9=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xed9b[_0xa79977];return _0x109f10;};'use strict';var Sequelize=require('sequelize');module[_0xbed9('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xbed9('0x1')]},'pass':{'type':Sequelize[_0xbed9('0x1')]},'port':{'type':Sequelize[_0xbed9('0x2')]},'secure':{'type':Sequelize[_0xbed9('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xbed9('0x1')]},'authentication':{'type':Sequelize[_0xbed9('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 90cb7c1..e945342 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 _0xf5e2=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','MailServerOut','findAll','catch','show','params','keys','find','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes'];(function(_0x2816b7,_0x5a22e1){var _0x5ad1d2=function(_0x5aeb12){while(--_0x5aeb12){_0x2816b7['push'](_0x2816b7['shift']());}};_0x5ad1d2(++_0x5a22e1);}(_0xf5e2,0x183));var _0x2f5e=function(_0x44d75f,_0xe216ee){_0x44d75f=_0x44d75f-0x0;var _0x467ba7=_0xf5e2[_0x44d75f];return _0x467ba7;};'use strict';var emlformat=require(_0x2f5e('0x0'));var rimraf=require(_0x2f5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f5e('0x2'));var rp=require(_0x2f5e('0x3'));var moment=require(_0x2f5e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f5e('0x5'));var util=require(_0x2f5e('0x6'));var path=require(_0x2f5e('0x7'));var sox=require('sox');var csv=require(_0x2f5e('0x8'));var ejs=require(_0x2f5e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f5e('0xa'));var squel=require(_0x2f5e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2f5e('0xc'));var toCsv=require(_0x2f5e('0x8'));var querystring=require(_0x2f5e('0xd'));var Papa=require(_0x2f5e('0xe'));var Redis=require('ioredis');var authService=require(_0x2f5e('0xf'));var qs=require(_0x2f5e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f5e('0x11'));var logger=require(_0x2f5e('0x12'))(_0x2f5e('0x13'));var utils=require(_0x2f5e('0x14'));var config=require(_0x2f5e('0x15'));var licenseUtil=require(_0x2f5e('0x16'));var db=require(_0x2f5e('0x17'))['db'];function respondWithStatusCode(_0x565e9d,_0x3172a5){_0x3172a5=_0x3172a5||0xcc;return function(_0x14dc7d){if(_0x14dc7d){return _0x565e9d[_0x2f5e('0x18')](_0x3172a5);}return _0x565e9d['status'](_0x3172a5)[_0x2f5e('0x19')]();};}function respondWithResult(_0x14042f,_0x2371a2){_0x2371a2=_0x2371a2||0xc8;return function(_0x7412c1){if(_0x7412c1){return _0x14042f[_0x2f5e('0x1a')](_0x2371a2)['json'](_0x7412c1);}};}function respondWithFilteredResult(_0x3b817a,_0x5003c1){return function(_0x436c2d){if(_0x436c2d){var _0x108d49=typeof _0x5003c1[_0x2f5e('0x1b')]===_0x2f5e('0x1c')&&typeof _0x5003c1['limit']===_0x2f5e('0x1c');var _0x37fb10=_0x436c2d[_0x2f5e('0x1d')];var _0x5a3818=_0x108d49?0x0:_0x5003c1[_0x2f5e('0x1b')];var _0x3bb7ba=_0x108d49?_0x436c2d[_0x2f5e('0x1d')]:_0x5003c1['offset']+_0x5003c1[_0x2f5e('0x1e')];var _0x3a9270;if(_0x3bb7ba>=_0x37fb10){_0x3bb7ba=_0x37fb10;_0x3a9270=0xc8;}else{_0x3a9270=0xce;}_0x3b817a['status'](_0x3a9270);return _0x3b817a[_0x2f5e('0x1f')](_0x2f5e('0x20'),_0x5a3818+'-'+_0x3bb7ba+'/'+_0x37fb10)[_0x2f5e('0x21')](_0x436c2d);}return null;};}function patchUpdates(_0x18a54a){return function(_0x53d2d9){try{jsonpatch['apply'](_0x53d2d9,_0x18a54a,!![]);}catch(_0x5a3ffc){return BPromise['reject'](_0x5a3ffc);}return _0x53d2d9['save']();};}function saveUpdates(_0x1faabc,_0x4dfd19){return function(_0x33cab0){if(_0x33cab0){return _0x33cab0['update'](_0x1faabc)['then'](function(_0x26a6ce){return _0x26a6ce;});}return null;};}function removeEntity(_0x3a2227,_0x3302eb){return function(_0x2d8434){if(_0x2d8434){return _0x2d8434[_0x2f5e('0x22')]()[_0x2f5e('0x23')](function(){_0x3a2227['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdf8175,_0xdffa63){return function(_0x523ca7){if(!_0x523ca7){_0xdf8175[_0x2f5e('0x18')](0x194);}return _0x523ca7;};}function handleError(_0x2fec9f,_0x46b496){_0x46b496=_0x46b496||0x1f4;return function(_0x1f8cec){logger[_0x2f5e('0x24')](_0x1f8cec[_0x2f5e('0x25')]);if(_0x1f8cec[_0x2f5e('0x26')]){delete _0x1f8cec[_0x2f5e('0x26')];}_0x2fec9f[_0x2f5e('0x1a')](_0x46b496)[_0x2f5e('0x27')](_0x1f8cec);};}exports[_0x2f5e('0x28')]=function(_0x564f19,_0x2323d7){var _0xa34eb1={},_0x3e2990={},_0x572062={'count':0x0,'rows':[]};var _0x28cd92=_[_0x2f5e('0x29')](db['MailServerOut'][_0x2f5e('0x2a')],function(_0x2cf4c8){return{'name':_0x2cf4c8[_0x2f5e('0x2b')],'type':_0x2cf4c8['type'][_0x2f5e('0x2c')]};});_0x3e2990[_0x2f5e('0x2d')]=_[_0x2f5e('0x29')](_0x28cd92,'name');_0x3e2990[_0x2f5e('0x2e')]=_['keys'](_0x564f19[_0x2f5e('0x2e')]);_0x3e2990[_0x2f5e('0x2f')]=_[_0x2f5e('0x30')](_0x3e2990[_0x2f5e('0x2d')],_0x3e2990['query']);_0xa34eb1['attributes']=_[_0x2f5e('0x30')](_0x3e2990[_0x2f5e('0x2d')],qs['fields'](_0x564f19[_0x2f5e('0x2e')][_0x2f5e('0x31')]));_0xa34eb1['attributes']=_0xa34eb1[_0x2f5e('0x32')][_0x2f5e('0x33')]?_0xa34eb1['attributes']:_0x3e2990[_0x2f5e('0x2d')];if(!_0x564f19[_0x2f5e('0x2e')][_0x2f5e('0x34')](_0x2f5e('0x35'))){_0xa34eb1[_0x2f5e('0x1e')]=qs['limit'](_0x564f19[_0x2f5e('0x2e')][_0x2f5e('0x1e')]);_0xa34eb1[_0x2f5e('0x1b')]=qs['offset'](_0x564f19[_0x2f5e('0x2e')][_0x2f5e('0x1b')]);}_0xa34eb1[_0x2f5e('0x36')]=qs['sort'](_0x564f19[_0x2f5e('0x2e')][_0x2f5e('0x37')]);_0xa34eb1[_0x2f5e('0x38')]=qs[_0x2f5e('0x2f')](_[_0x2f5e('0x39')](_0x564f19['query'],_0x3e2990[_0x2f5e('0x2f')]),_0x28cd92);if(_0x564f19['query'][_0x2f5e('0x3a')]){_0xa34eb1[_0x2f5e('0x38')]=_[_0x2f5e('0x3b')](_0xa34eb1[_0x2f5e('0x38')],{'$or':_[_0x2f5e('0x29')](_0x28cd92,function(_0x30d318){if(_0x30d318[_0x2f5e('0x3c')]!=='VIRTUAL'){var _0x86e6c={};_0x86e6c[_0x30d318[_0x2f5e('0x26')]]={'$like':'%'+_0x564f19['query'][_0x2f5e('0x3a')]+'%'};return _0x86e6c;}})});}_0xa34eb1=_[_0x2f5e('0x3b')]({},_0xa34eb1,_0x564f19[_0x2f5e('0x3d')]);var _0x55e66f={'where':_0xa34eb1[_0x2f5e('0x38')]};return db['MailServerOut']['count'](_0x55e66f)[_0x2f5e('0x23')](function(_0x383b2c){_0x572062[_0x2f5e('0x1d')]=_0x383b2c;if(_0x564f19[_0x2f5e('0x2e')][_0x2f5e('0x3e')]){_0xa34eb1[_0x2f5e('0x3f')]=[{'all':!![]}];}return db[_0x2f5e('0x40')][_0x2f5e('0x41')](_0xa34eb1);})[_0x2f5e('0x23')](function(_0x29a47d){_0x572062['rows']=_0x29a47d;return _0x572062;})[_0x2f5e('0x23')](respondWithFilteredResult(_0x2323d7,_0xa34eb1))[_0x2f5e('0x42')](handleError(_0x2323d7,null));};exports[_0x2f5e('0x43')]=function(_0x284c55,_0x38f26e){var _0x340e2e={'raw':!![],'where':{'id':_0x284c55[_0x2f5e('0x44')]['id']}},_0x1e8eb4={};_0x1e8eb4[_0x2f5e('0x2d')]=_[_0x2f5e('0x45')](db['MailServerOut']['rawAttributes']);_0x1e8eb4[_0x2f5e('0x2e')]=_[_0x2f5e('0x45')](_0x284c55[_0x2f5e('0x2e')]);_0x1e8eb4[_0x2f5e('0x2f')]=_[_0x2f5e('0x30')](_0x1e8eb4[_0x2f5e('0x2d')],_0x1e8eb4[_0x2f5e('0x2e')]);_0x340e2e[_0x2f5e('0x32')]=_[_0x2f5e('0x30')](_0x1e8eb4[_0x2f5e('0x2d')],qs['fields'](_0x284c55['query'][_0x2f5e('0x31')]));_0x340e2e[_0x2f5e('0x32')]=_0x340e2e[_0x2f5e('0x32')]['length']?_0x340e2e[_0x2f5e('0x32')]:_0x1e8eb4[_0x2f5e('0x2d')];if(_0x284c55[_0x2f5e('0x2e')][_0x2f5e('0x3e')]){_0x340e2e[_0x2f5e('0x3f')]=[{'all':!![]}];}_0x340e2e=_[_0x2f5e('0x3b')]({},_0x340e2e,_0x284c55[_0x2f5e('0x3d')]);return db['MailServerOut'][_0x2f5e('0x46')](_0x340e2e)['then'](handleEntityNotFound(_0x38f26e,null))[_0x2f5e('0x23')](respondWithResult(_0x38f26e,null))[_0x2f5e('0x42')](handleError(_0x38f26e,null));};exports['create']=function(_0x3e1c8e,_0x59aff1){return db[_0x2f5e('0x40')]['create'](_0x3e1c8e[_0x2f5e('0x47')],{})[_0x2f5e('0x23')](respondWithResult(_0x59aff1,0xc9))[_0x2f5e('0x42')](handleError(_0x59aff1,null));};exports[_0x2f5e('0x48')]=function(_0x4523cd,_0x57a877){if(_0x4523cd[_0x2f5e('0x47')]['id']){delete _0x4523cd[_0x2f5e('0x47')]['id'];}return db[_0x2f5e('0x40')]['find']({'where':{'id':_0x4523cd[_0x2f5e('0x44')]['id']}})[_0x2f5e('0x23')](handleEntityNotFound(_0x57a877,null))[_0x2f5e('0x23')](saveUpdates(_0x4523cd[_0x2f5e('0x47')],null))[_0x2f5e('0x23')](respondWithResult(_0x57a877,null))[_0x2f5e('0x42')](handleError(_0x57a877,null));};exports[_0x2f5e('0x22')]=function(_0x40a866,_0x24644a){return db[_0x2f5e('0x40')][_0x2f5e('0x46')]({'where':{'id':_0x40a866[_0x2f5e('0x44')]['id']}})['then'](handleEntityNotFound(_0x24644a,null))['then'](removeEntity(_0x24644a,null))[_0x2f5e('0x42')](handleError(_0x24644a,null));}; \ No newline at end of file +var _0xbbfa=['merge','options','MailServerOut','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','update','body','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0xbbfa,0x1b9));var _0xabbf=function(_0x28fd11,_0xb7b5ca){_0x28fd11=_0x28fd11-0x0;var _0x51caa0=_0xbbfa[_0x28fd11];return _0x51caa0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xabbf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xabbf('0x1'));var BPromise=require(_0xabbf('0x2'));var Mustache=require(_0xabbf('0x3'));var util=require(_0xabbf('0x4'));var path=require(_0xabbf('0x5'));var sox=require(_0xabbf('0x6'));var csv=require('to-csv');var ejs=require(_0xabbf('0x7'));var fs=require('fs');var fs_extra=require(_0xabbf('0x8'));var _=require(_0xabbf('0x9'));var squel=require(_0xabbf('0xa'));var crypto=require(_0xabbf('0xb'));var jsforce=require(_0xabbf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xabbf('0xd'));var querystring=require(_0xabbf('0xe'));var Papa=require(_0xabbf('0xf'));var Redis=require(_0xabbf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xabbf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabbf('0x12'));var logger=require('../../config/logger')(_0xabbf('0x13'));var utils=require(_0xabbf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xabbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce6846,_0x2ac67d){_0x2ac67d=_0x2ac67d||0xcc;return function(_0x352618){if(_0x352618){return _0xce6846[_0xabbf('0x16')](_0x2ac67d);}return _0xce6846[_0xabbf('0x17')](_0x2ac67d)[_0xabbf('0x18')]();};}function respondWithResult(_0xcd03e,_0x561cd4){_0x561cd4=_0x561cd4||0xc8;return function(_0x21051d){if(_0x21051d){return _0xcd03e[_0xabbf('0x17')](_0x561cd4)[_0xabbf('0x19')](_0x21051d);}};}function respondWithFilteredResult(_0x5b0821,_0x37282d){return function(_0x24da0f){if(_0x24da0f){var _0x6ea3ca=typeof _0x37282d[_0xabbf('0x1a')]===_0xabbf('0x1b')&&typeof _0x37282d[_0xabbf('0x1c')]===_0xabbf('0x1b');var _0x189f34=_0x24da0f[_0xabbf('0x1d')];var _0x5f5a7d=_0x6ea3ca?0x0:_0x37282d[_0xabbf('0x1a')];var _0x27fad2=_0x6ea3ca?_0x24da0f['count']:_0x37282d[_0xabbf('0x1a')]+_0x37282d[_0xabbf('0x1c')];var _0x4c9b73;if(_0x27fad2>=_0x189f34){_0x27fad2=_0x189f34;_0x4c9b73=0xc8;}else{_0x4c9b73=0xce;}_0x5b0821[_0xabbf('0x17')](_0x4c9b73);return _0x5b0821[_0xabbf('0x1e')](_0xabbf('0x1f'),_0x5f5a7d+'-'+_0x27fad2+'/'+_0x189f34)['json'](_0x24da0f);}return null;};}function patchUpdates(_0x2ee579){return function(_0x5d804f){try{jsonpatch[_0xabbf('0x20')](_0x5d804f,_0x2ee579,!![]);}catch(_0xa2c031){return BPromise[_0xabbf('0x21')](_0xa2c031);}return _0x5d804f[_0xabbf('0x22')]();};}function saveUpdates(_0x317e8f,_0x4491a6){return function(_0x1d5836){if(_0x1d5836){return _0x1d5836['update'](_0x317e8f)[_0xabbf('0x23')](function(_0x4afa15){return _0x4afa15;});}return null;};}function removeEntity(_0x466ce9,_0x37b81a){return function(_0x30422c){if(_0x30422c){return _0x30422c[_0xabbf('0x24')]()[_0xabbf('0x23')](function(){_0x466ce9[_0xabbf('0x17')](0xcc)[_0xabbf('0x18')]();});}};}function handleEntityNotFound(_0x293b68,_0x516375){return function(_0x338ea8){if(!_0x338ea8){_0x293b68[_0xabbf('0x16')](0x194);}return _0x338ea8;};}function handleError(_0x1cf7c6,_0x48d3bd){_0x48d3bd=_0x48d3bd||0x1f4;return function(_0x3a11e2){logger['error'](_0x3a11e2['stack']);if(_0x3a11e2[_0xabbf('0x25')]){delete _0x3a11e2[_0xabbf('0x25')];}_0x1cf7c6[_0xabbf('0x17')](_0x48d3bd)[_0xabbf('0x26')](_0x3a11e2);};}exports['index']=function(_0x51cde1,_0x9b2512){var _0x3a0287={},_0xd3b1e0={},_0x4c06df={'count':0x0,'rows':[]};var _0x5d8336=_[_0xabbf('0x27')](db['MailServerOut']['rawAttributes'],function(_0xd968d1){return{'name':_0xd968d1[_0xabbf('0x28')],'type':_0xd968d1[_0xabbf('0x29')][_0xabbf('0x2a')]};});_0xd3b1e0[_0xabbf('0x2b')]=_[_0xabbf('0x27')](_0x5d8336,_0xabbf('0x25'));_0xd3b1e0[_0xabbf('0x2c')]=_['keys'](_0x51cde1[_0xabbf('0x2c')]);_0xd3b1e0[_0xabbf('0x2d')]=_['intersection'](_0xd3b1e0[_0xabbf('0x2b')],_0xd3b1e0[_0xabbf('0x2c')]);_0x3a0287[_0xabbf('0x2e')]=_[_0xabbf('0x2f')](_0xd3b1e0[_0xabbf('0x2b')],qs[_0xabbf('0x30')](_0x51cde1[_0xabbf('0x2c')][_0xabbf('0x30')]));_0x3a0287['attributes']=_0x3a0287[_0xabbf('0x2e')][_0xabbf('0x31')]?_0x3a0287[_0xabbf('0x2e')]:_0xd3b1e0[_0xabbf('0x2b')];if(!_0x51cde1[_0xabbf('0x2c')][_0xabbf('0x32')](_0xabbf('0x33'))){_0x3a0287[_0xabbf('0x1c')]=qs[_0xabbf('0x1c')](_0x51cde1['query'][_0xabbf('0x1c')]);_0x3a0287[_0xabbf('0x1a')]=qs['offset'](_0x51cde1[_0xabbf('0x2c')][_0xabbf('0x1a')]);}_0x3a0287['order']=qs[_0xabbf('0x34')](_0x51cde1['query']['sort']);_0x3a0287[_0xabbf('0x35')]=qs['filters'](_[_0xabbf('0x36')](_0x51cde1['query'],_0xd3b1e0[_0xabbf('0x2d')]),_0x5d8336);if(_0x51cde1[_0xabbf('0x2c')][_0xabbf('0x37')]){_0x3a0287[_0xabbf('0x35')]=_['merge'](_0x3a0287[_0xabbf('0x35')],{'$or':_[_0xabbf('0x27')](_0x5d8336,function(_0x2afdf5){if(_0x2afdf5[_0xabbf('0x29')]!=='VIRTUAL'){var _0x361adf={};_0x361adf[_0x2afdf5[_0xabbf('0x25')]]={'$like':'%'+_0x51cde1[_0xabbf('0x2c')][_0xabbf('0x37')]+'%'};return _0x361adf;}})});}_0x3a0287=_[_0xabbf('0x38')]({},_0x3a0287,_0x51cde1[_0xabbf('0x39')]);var _0x1cb267={'where':_0x3a0287[_0xabbf('0x35')]};return db[_0xabbf('0x3a')][_0xabbf('0x1d')](_0x1cb267)[_0xabbf('0x23')](function(_0x502196){_0x4c06df[_0xabbf('0x1d')]=_0x502196;if(_0x51cde1[_0xabbf('0x2c')]['includeAll']){_0x3a0287[_0xabbf('0x3b')]=[{'all':!![]}];}return db[_0xabbf('0x3a')][_0xabbf('0x3c')](_0x3a0287);})['then'](function(_0x3aeea5){_0x4c06df[_0xabbf('0x3d')]=_0x3aeea5;return _0x4c06df;})['then'](respondWithFilteredResult(_0x9b2512,_0x3a0287))[_0xabbf('0x3e')](handleError(_0x9b2512,null));};exports[_0xabbf('0x3f')]=function(_0x58f7ea,_0xed6458){var _0x3f88a4={'raw':!![],'where':{'id':_0x58f7ea[_0xabbf('0x40')]['id']}},_0x2fd791={};_0x2fd791[_0xabbf('0x2b')]=_[_0xabbf('0x41')](db[_0xabbf('0x3a')][_0xabbf('0x42')]);_0x2fd791[_0xabbf('0x2c')]=_['keys'](_0x58f7ea[_0xabbf('0x2c')]);_0x2fd791['filters']=_['intersection'](_0x2fd791[_0xabbf('0x2b')],_0x2fd791[_0xabbf('0x2c')]);_0x3f88a4[_0xabbf('0x2e')]=_[_0xabbf('0x2f')](_0x2fd791[_0xabbf('0x2b')],qs[_0xabbf('0x30')](_0x58f7ea[_0xabbf('0x2c')][_0xabbf('0x30')]));_0x3f88a4[_0xabbf('0x2e')]=_0x3f88a4[_0xabbf('0x2e')][_0xabbf('0x31')]?_0x3f88a4[_0xabbf('0x2e')]:_0x2fd791[_0xabbf('0x2b')];if(_0x58f7ea[_0xabbf('0x2c')]['includeAll']){_0x3f88a4['include']=[{'all':!![]}];}_0x3f88a4=_[_0xabbf('0x38')]({},_0x3f88a4,_0x58f7ea[_0xabbf('0x39')]);return db[_0xabbf('0x3a')][_0xabbf('0x43')](_0x3f88a4)['then'](handleEntityNotFound(_0xed6458,null))['then'](respondWithResult(_0xed6458,null))[_0xabbf('0x3e')](handleError(_0xed6458,null));};exports['create']=function(_0x59e466,_0x1c760f){return db[_0xabbf('0x3a')][_0xabbf('0x44')](_0x59e466['body'],{})[_0xabbf('0x23')](respondWithResult(_0x1c760f,0xc9))[_0xabbf('0x3e')](handleError(_0x1c760f,null));};exports[_0xabbf('0x45')]=function(_0x1b1b2d,_0x48fedd){if(_0x1b1b2d[_0xabbf('0x46')]['id']){delete _0x1b1b2d[_0xabbf('0x46')]['id'];}return db['MailServerOut'][_0xabbf('0x43')]({'where':{'id':_0x1b1b2d[_0xabbf('0x40')]['id']}})[_0xabbf('0x23')](handleEntityNotFound(_0x48fedd,null))[_0xabbf('0x23')](saveUpdates(_0x1b1b2d[_0xabbf('0x46')],null))[_0xabbf('0x23')](respondWithResult(_0x48fedd,null))[_0xabbf('0x3e')](handleError(_0x48fedd,null));};exports[_0xabbf('0x24')]=function(_0x4f9a81,_0xb113ff){return db[_0xabbf('0x3a')]['find']({'where':{'id':_0x4f9a81[_0xabbf('0x40')]['id']}})[_0xabbf('0x23')](handleEntityNotFound(_0xb113ff,null))[_0xabbf('0x23')](removeEntity(_0xb113ff,null))[_0xabbf('0x3e')](handleError(_0xb113ff,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 81f8d4e..81949d5 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 _0xec0a=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','api','moment','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec0a,0x124));var _0xaec0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xec0a[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xaec0('0x0'));var util=require(_0xaec0('0x1'));var logger=require('../../config/logger')(_0xaec0('0x2'));var moment=require(_0xaec0('0x3'));var BPromise=require('bluebird');var rp=require(_0xaec0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaec0('0x5'));var config=require(_0xaec0('0x6'));var attributes=require(_0xaec0('0x7'));module[_0xaec0('0x8')]=function(_0x535b33,_0x45e779){return _0x535b33[_0xaec0('0x9')]('MailServerOut',attributes,{'tableName':_0xaec0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03c5=['path','rimraf','../../config/environment','./mailServerOut.attributes','define','mail_servers_out','lodash','../../config/logger','moment','bluebird'];(function(_0x100f9e,_0x8da0f1){var _0x596a61=function(_0x156227){while(--_0x156227){_0x100f9e['push'](_0x100f9e['shift']());}};_0x596a61(++_0x8da0f1);}(_0x03c5,0x1dc));var _0x503c=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x03c5[_0x4a6cf8];return _0x22205e;};'use strict';var _=require(_0x503c('0x0'));var util=require('util');var logger=require(_0x503c('0x1'))('api');var moment=require(_0x503c('0x2'));var BPromise=require(_0x503c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x503c('0x4'));var rimraf=require(_0x503c('0x5'));var config=require(_0x503c('0x6'));var attributes=require(_0x503c('0x7'));module['exports']=function(_0x50e08f,_0x2574c4){return _0x50e08f[_0x503c('0x8')]('MailServerOut',attributes,{'tableName':_0x503c('0x9'),'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 3839cd0..df0f24e 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3b602d,_0xb37512){var _0x58e400=function(_0x2a1c69){while(--_0x2a1c69){_0x3b602d['push'](_0x3b602d['shift']());}};_0x58e400(++_0xb37512);}(_0x5f2f,0x73));var _0xf5f2=function(_0x29b265,_0x2c2d01){_0x29b265=_0x29b265-0x0;var _0x157c16=_0x5f2f[_0x29b265];return _0x157c16;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2fa0d8,_0x1a805c){var _0x51612b=function(_0x3db7bc){while(--_0x3db7bc){_0x2fa0d8['push'](_0x2fa0d8['shift']());}};_0x51612b(++_0x1a805c);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc78672,_0x253698){_0xc78672=_0xc78672-0x0;var _0x17162c=_0x5f2f[_0xc78672];return _0x17162c;};'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 73d2eb4..a9f380a 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 _0xaaf1=['./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x513537,_0x1d1248){var _0x38bbbf=function(_0x161254){while(--_0x161254){_0x513537['push'](_0x513537['shift']());}};_0x38bbbf(++_0x1d1248);}(_0xaaf1,0x80));var _0x1aaf=function(_0x38badc,_0xd85c78){_0x38badc=_0x38badc-0x0;var _0x184117=_0xaaf1[_0x38badc];return _0x184117;};'use strict';var multer=require(_0x1aaf('0x0'));var util=require(_0x1aaf('0x1'));var path=require(_0x1aaf('0x2'));var timeout=require(_0x1aaf('0x3'));var express=require(_0x1aaf('0x4'));var router=express[_0x1aaf('0x5')]();var fs_extra=require(_0x1aaf('0x6'));var auth=require(_0x1aaf('0x7'));var interaction=require(_0x1aaf('0x8'));var config=require(_0x1aaf('0x9'));var controller=require(_0x1aaf('0xa'));router[_0x1aaf('0xb')]('/',auth[_0x1aaf('0xc')](),controller[_0x1aaf('0xd')]);router[_0x1aaf('0xb')](_0x1aaf('0xe'),auth[_0x1aaf('0xc')](),controller[_0x1aaf('0xf')]);router[_0x1aaf('0xb')](_0x1aaf('0x10'),auth['isAuthenticated'](),controller[_0x1aaf('0x11')]);router[_0x1aaf('0x12')]('/',auth['isAuthenticated'](),controller[_0x1aaf('0x13')]);router[_0x1aaf('0x14')](_0x1aaf('0x10'),auth[_0x1aaf('0xc')](),controller[_0x1aaf('0x15')]);router[_0x1aaf('0x16')](_0x1aaf('0x10'),auth[_0x1aaf('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x80e2=['../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x286090,_0x19e45b){var _0x2ba4e3=function(_0xdb8139){while(--_0xdb8139){_0x286090['push'](_0x286090['shift']());}};_0x2ba4e3(++_0x19e45b);}(_0x80e2,0x1da));var _0x280e=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x80e2[_0x498334];return _0x13bb70;};'use strict';var multer=require(_0x280e('0x0'));var util=require(_0x280e('0x1'));var path=require(_0x280e('0x2'));var timeout=require(_0x280e('0x3'));var express=require(_0x280e('0x4'));var router=express[_0x280e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x280e('0x6'));var controller=require(_0x280e('0x7'));router[_0x280e('0x8')]('/',auth['isAuthenticated'](),controller[_0x280e('0x9')]);router[_0x280e('0x8')](_0x280e('0xa'),auth[_0x280e('0xb')](),controller['describe']);router[_0x280e('0x8')](_0x280e('0xc'),auth['isAuthenticated'](),controller[_0x280e('0xd')]);router[_0x280e('0xe')]('/',auth[_0x280e('0xb')](),controller[_0x280e('0xf')]);router[_0x280e('0x10')](_0x280e('0xc'),auth[_0x280e('0xb')](),controller[_0x280e('0x11')]);router[_0x280e('0x12')]('/:id',auth[_0x280e('0xb')](),controller[_0x280e('0x13')]);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 12e075e..12e794d 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 _0x1b20=['exports','STRING'];(function(_0x19fce5,_0x3414ad){var _0x2be1f2=function(_0x4fd05a){while(--_0x4fd05a){_0x19fce5['push'](_0x19fce5['shift']());}};_0x2be1f2(++_0x3414ad);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0x01b2('0x0')]={'name':{'type':Sequelize[_0x01b2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x02a7=['exports','STRING'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x02a7,0x7a));var _0x702a=function(_0x16ea09,_0x59600f){_0x16ea09=_0x16ea09-0x0;var _0x69da82=_0x02a7[_0x16ea09];return _0x69da82;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x702a('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 3d47c81..e867813 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 _0x6913=['../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','then','destroy','sendStatus','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x59fb26,_0x8d3b65){var _0xcca2ea=function(_0x3d5ee0){while(--_0x3d5ee0){_0x59fb26['push'](_0x59fb26['shift']());}};_0xcca2ea(++_0x8d3b65);}(_0x6913,0xcb));var _0x3691=function(_0x13dce2,_0xca43c4){_0x13dce2=_0x13dce2-0x0;var _0x1a2fb3=_0x6913[_0x13dce2];return _0x1a2fb3;};'use strict';var emlformat=require(_0x3691('0x0'));var rimraf=require(_0x3691('0x1'));var zipdir=require(_0x3691('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3691('0x3'));var Mustache=require(_0x3691('0x4'));var util=require(_0x3691('0x5'));var path=require(_0x3691('0x6'));var sox=require('sox');var csv=require(_0x3691('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3691('0x8'));var _=require('lodash');var squel=require(_0x3691('0x9'));var crypto=require(_0x3691('0xa'));var jsforce=require(_0x3691('0xb'));var deskjs=require(_0x3691('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3691('0xd'));var Papa=require(_0x3691('0xe'));var Redis=require(_0x3691('0xf'));var authService=require(_0x3691('0x10'));var qs=require(_0x3691('0x11'));var as=require(_0x3691('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3691('0x13'))(_0x3691('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3691('0x15'));var db=require(_0x3691('0x16'))['db'];function respondWithStatusCode(_0x41abc0,_0x272678){_0x272678=_0x272678||0xcc;return function(_0x2fdf26){if(_0x2fdf26){return _0x41abc0['sendStatus'](_0x272678);}return _0x41abc0[_0x3691('0x17')](_0x272678)[_0x3691('0x18')]();};}function respondWithResult(_0x3c7a40,_0x50ada5){_0x50ada5=_0x50ada5||0xc8;return function(_0x41540f){if(_0x41540f){return _0x3c7a40[_0x3691('0x17')](_0x50ada5)[_0x3691('0x19')](_0x41540f);}};}function respondWithFilteredResult(_0x53e482,_0x5562de){return function(_0x5673a9){if(_0x5673a9){var _0x36c1bb=typeof _0x5562de[_0x3691('0x1a')]==='undefined'&&typeof _0x5562de[_0x3691('0x1b')]==='undefined';var _0x2d0abc=_0x5673a9[_0x3691('0x1c')];var _0x5366e1=_0x36c1bb?0x0:_0x5562de[_0x3691('0x1a')];var _0x264500=_0x36c1bb?_0x5673a9['count']:_0x5562de[_0x3691('0x1a')]+_0x5562de[_0x3691('0x1b')];var _0x5639fb;if(_0x264500>=_0x2d0abc){_0x264500=_0x2d0abc;_0x5639fb=0xc8;}else{_0x5639fb=0xce;}_0x53e482[_0x3691('0x17')](_0x5639fb);return _0x53e482[_0x3691('0x1d')](_0x3691('0x1e'),_0x5366e1+'-'+_0x264500+'/'+_0x2d0abc)['json'](_0x5673a9);}return null;};}function patchUpdates(_0x575757){return function(_0x108ebe){try{jsonpatch['apply'](_0x108ebe,_0x575757,!![]);}catch(_0x51c312){return BPromise['reject'](_0x51c312);}return _0x108ebe[_0x3691('0x1f')]();};}function saveUpdates(_0xe86af3,_0x1dc73d){return function(_0x18f518){if(_0x18f518){return _0x18f518['update'](_0xe86af3)[_0x3691('0x20')](function(_0x4c9e41){return _0x4c9e41;});}return null;};}function removeEntity(_0x9c59bf,_0x5c0b22){return function(_0x552c61){if(_0x552c61){return _0x552c61[_0x3691('0x21')]()[_0x3691('0x20')](function(){_0x9c59bf[_0x3691('0x17')](0xcc)[_0x3691('0x18')]();});}};}function handleEntityNotFound(_0x5542dd,_0x52374b){return function(_0x12cc71){if(!_0x12cc71){_0x5542dd[_0x3691('0x22')](0x194);}return _0x12cc71;};}function handleError(_0x4aa789,_0x3a8fd0){_0x3a8fd0=_0x3a8fd0||0x1f4;return function(_0x24c08e){logger['error'](_0x24c08e[_0x3691('0x23')]);if(_0x24c08e['name']){delete _0x24c08e[_0x3691('0x24')];}_0x4aa789['status'](_0x3a8fd0)[_0x3691('0x25')](_0x24c08e);};}exports[_0x3691('0x26')]=function(_0x3c213a,_0x1315d2){var _0x29d0c2={},_0x1f2712={},_0x4568af={'count':0x0,'rows':[]};var _0x3b509a=_[_0x3691('0x27')](db[_0x3691('0x28')][_0x3691('0x29')],function(_0x5180c2){return{'name':_0x5180c2[_0x3691('0x2a')],'type':_0x5180c2[_0x3691('0x2b')][_0x3691('0x2c')]};});_0x1f2712[_0x3691('0x2d')]=_[_0x3691('0x27')](_0x3b509a,_0x3691('0x24'));_0x1f2712[_0x3691('0x2e')]=_[_0x3691('0x2f')](_0x3c213a['query']);_0x1f2712[_0x3691('0x30')]=_['intersection'](_0x1f2712[_0x3691('0x2d')],_0x1f2712[_0x3691('0x2e')]);_0x29d0c2[_0x3691('0x31')]=_[_0x3691('0x32')](_0x1f2712[_0x3691('0x2d')],qs[_0x3691('0x33')](_0x3c213a[_0x3691('0x2e')][_0x3691('0x33')]));_0x29d0c2[_0x3691('0x31')]=_0x29d0c2[_0x3691('0x31')][_0x3691('0x34')]?_0x29d0c2[_0x3691('0x31')]:_0x1f2712[_0x3691('0x2d')];if(!_0x3c213a[_0x3691('0x2e')][_0x3691('0x35')](_0x3691('0x36'))){_0x29d0c2[_0x3691('0x1b')]=qs[_0x3691('0x1b')](_0x3c213a['query'][_0x3691('0x1b')]);_0x29d0c2[_0x3691('0x1a')]=qs[_0x3691('0x1a')](_0x3c213a[_0x3691('0x2e')][_0x3691('0x1a')]);}_0x29d0c2['order']=qs[_0x3691('0x37')](_0x3c213a[_0x3691('0x2e')][_0x3691('0x37')]);_0x29d0c2[_0x3691('0x38')]=qs[_0x3691('0x30')](_[_0x3691('0x39')](_0x3c213a['query'],_0x1f2712[_0x3691('0x30')]),_0x3b509a);if(_0x3c213a['query']['filter']){_0x29d0c2[_0x3691('0x38')]=_[_0x3691('0x3a')](_0x29d0c2[_0x3691('0x38')],{'$or':_['map'](_0x3b509a,function(_0x688524){if(_0x688524[_0x3691('0x2b')]!==_0x3691('0x3b')){var _0x53534b={};_0x53534b[_0x688524['name']]={'$like':'%'+_0x3c213a[_0x3691('0x2e')][_0x3691('0x3c')]+'%'};return _0x53534b;}})});}_0x29d0c2=_[_0x3691('0x3a')]({},_0x29d0c2,_0x3c213a[_0x3691('0x3d')]);var _0x19a1bf={'where':_0x29d0c2[_0x3691('0x38')]};return db[_0x3691('0x28')]['count'](_0x19a1bf)[_0x3691('0x20')](function(_0x273a5f){_0x4568af['count']=_0x273a5f;if(_0x3c213a['query'][_0x3691('0x3e')]){_0x29d0c2[_0x3691('0x3f')]=[{'all':!![]}];}return db[_0x3691('0x28')][_0x3691('0x40')](_0x29d0c2);})[_0x3691('0x20')](function(_0x48d344){_0x4568af[_0x3691('0x41')]=_0x48d344;return _0x4568af;})[_0x3691('0x20')](respondWithFilteredResult(_0x1315d2,_0x29d0c2))[_0x3691('0x42')](handleError(_0x1315d2,null));};exports[_0x3691('0x43')]=function(_0x30683c,_0x105696){var _0x3a56f0={'raw':!![],'where':{'id':_0x30683c[_0x3691('0x44')]['id']}},_0x47913f={};_0x47913f[_0x3691('0x2d')]=_[_0x3691('0x2f')](db['MailSubstatus'][_0x3691('0x29')]);_0x47913f[_0x3691('0x2e')]=_[_0x3691('0x2f')](_0x30683c['query']);_0x47913f[_0x3691('0x30')]=_[_0x3691('0x32')](_0x47913f[_0x3691('0x2d')],_0x47913f[_0x3691('0x2e')]);_0x3a56f0['attributes']=_[_0x3691('0x32')](_0x47913f[_0x3691('0x2d')],qs[_0x3691('0x33')](_0x30683c[_0x3691('0x2e')]['fields']));_0x3a56f0[_0x3691('0x31')]=_0x3a56f0[_0x3691('0x31')][_0x3691('0x34')]?_0x3a56f0[_0x3691('0x31')]:_0x47913f[_0x3691('0x2d')];if(_0x30683c[_0x3691('0x2e')]['includeAll']){_0x3a56f0[_0x3691('0x3f')]=[{'all':!![]}];}_0x3a56f0=_[_0x3691('0x3a')]({},_0x3a56f0,_0x30683c[_0x3691('0x3d')]);return db['MailSubstatus']['find'](_0x3a56f0)[_0x3691('0x20')](handleEntityNotFound(_0x105696,null))[_0x3691('0x20')](respondWithResult(_0x105696,null))['catch'](handleError(_0x105696,null));};exports['create']=function(_0x59581a,_0x15cc57){return db[_0x3691('0x28')][_0x3691('0x45')](_0x59581a[_0x3691('0x46')],{})[_0x3691('0x20')](respondWithResult(_0x15cc57,0xc9))['catch'](handleError(_0x15cc57,null));};exports[_0x3691('0x47')]=function(_0x5f22cf,_0x1096e7){if(_0x5f22cf[_0x3691('0x46')]['id']){delete _0x5f22cf[_0x3691('0x46')]['id'];}return db[_0x3691('0x28')]['find']({'where':{'id':_0x5f22cf['params']['id']}})[_0x3691('0x20')](handleEntityNotFound(_0x1096e7,null))[_0x3691('0x20')](saveUpdates(_0x5f22cf[_0x3691('0x46')],null))[_0x3691('0x20')](respondWithResult(_0x1096e7,null))[_0x3691('0x42')](handleError(_0x1096e7,null));};exports[_0x3691('0x21')]=function(_0x39221d,_0x576908){return db[_0x3691('0x28')][_0x3691('0x48')]({'where':{'id':_0x39221d['params']['id']}})[_0x3691('0x20')](handleEntityNotFound(_0x576908,null))[_0x3691('0x20')](removeEntity(_0x576908,null))[_0x3691('0x42')](handleError(_0x576908,null));};exports[_0x3691('0x49')]=function(_0x14d80a,_0x2f4071){return db[_0x3691('0x28')][_0x3691('0x49')]()[_0x3691('0x20')](respondWithResult(_0x2f4071,null))[_0x3691('0x42')](handleError(_0x2f4071,null));}; \ No newline at end of file +var _0xa490=['apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xa490,0x108));var _0x0a49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa490[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a49('0x0'));var zipdir=require(_0x0a49('0x1'));var jsonpatch=require(_0x0a49('0x2'));var rp=require(_0x0a49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a49('0x4'));var util=require(_0x0a49('0x5'));var path=require(_0x0a49('0x6'));var sox=require(_0x0a49('0x7'));var csv=require(_0x0a49('0x8'));var ejs=require(_0x0a49('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0a49('0xa'));var crypto=require('crypto');var jsforce=require(_0x0a49('0xb'));var deskjs=require(_0x0a49('0xc'));var toCsv=require(_0x0a49('0x8'));var querystring=require('querystring');var Papa=require(_0x0a49('0xd'));var Redis=require(_0x0a49('0xe'));var authService=require(_0x0a49('0xf'));var qs=require(_0x0a49('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a49('0x11'))(_0x0a49('0x12'));var utils=require('../../config/utils');var config=require(_0x0a49('0x13'));var licenseUtil=require(_0x0a49('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6e5f35,_0x4cefb7){_0x4cefb7=_0x4cefb7||0xcc;return function(_0x496499){if(_0x496499){return _0x6e5f35['sendStatus'](_0x4cefb7);}return _0x6e5f35[_0x0a49('0x15')](_0x4cefb7)[_0x0a49('0x16')]();};}function respondWithResult(_0xe6caef,_0xf473eb){_0xf473eb=_0xf473eb||0xc8;return function(_0x10e190){if(_0x10e190){return _0xe6caef[_0x0a49('0x15')](_0xf473eb)[_0x0a49('0x17')](_0x10e190);}};}function respondWithFilteredResult(_0x991dc,_0x5b3c1a){return function(_0x1d1b93){if(_0x1d1b93){var _0x36c89f=typeof _0x5b3c1a['offset']===_0x0a49('0x18')&&typeof _0x5b3c1a[_0x0a49('0x19')]===_0x0a49('0x18');var _0x9ab4fe=_0x1d1b93[_0x0a49('0x1a')];var _0x351834=_0x36c89f?0x0:_0x5b3c1a[_0x0a49('0x1b')];var _0x21dd8d=_0x36c89f?_0x1d1b93[_0x0a49('0x1a')]:_0x5b3c1a['offset']+_0x5b3c1a[_0x0a49('0x19')];var _0x545127;if(_0x21dd8d>=_0x9ab4fe){_0x21dd8d=_0x9ab4fe;_0x545127=0xc8;}else{_0x545127=0xce;}_0x991dc[_0x0a49('0x15')](_0x545127);return _0x991dc['set']('Content-Range',_0x351834+'-'+_0x21dd8d+'/'+_0x9ab4fe)[_0x0a49('0x17')](_0x1d1b93);}return null;};}function patchUpdates(_0x4f2819){return function(_0x4b9197){try{jsonpatch[_0x0a49('0x1c')](_0x4b9197,_0x4f2819,!![]);}catch(_0x472d58){return BPromise['reject'](_0x472d58);}return _0x4b9197[_0x0a49('0x1d')]();};}function saveUpdates(_0xdeb407,_0x272002){return function(_0x20f9c6){if(_0x20f9c6){return _0x20f9c6[_0x0a49('0x1e')](_0xdeb407)[_0x0a49('0x1f')](function(_0x487c09){return _0x487c09;});}return null;};}function removeEntity(_0x52372f,_0x31adfa){return function(_0x473dd2){if(_0x473dd2){return _0x473dd2[_0x0a49('0x20')]()['then'](function(){_0x52372f[_0x0a49('0x15')](0xcc)[_0x0a49('0x16')]();});}};}function handleEntityNotFound(_0x125609,_0x49ea93){return function(_0x158479){if(!_0x158479){_0x125609[_0x0a49('0x21')](0x194);}return _0x158479;};}function handleError(_0x401f66,_0x3d453b){_0x3d453b=_0x3d453b||0x1f4;return function(_0x5f4c9c){logger[_0x0a49('0x22')](_0x5f4c9c[_0x0a49('0x23')]);if(_0x5f4c9c['name']){delete _0x5f4c9c[_0x0a49('0x24')];}_0x401f66[_0x0a49('0x15')](_0x3d453b)[_0x0a49('0x25')](_0x5f4c9c);};}exports[_0x0a49('0x26')]=function(_0x1c75ad,_0x519c37){var _0x3a1799={},_0x4d848e={},_0xc0a520={'count':0x0,'rows':[]};var _0x5a684a=_[_0x0a49('0x27')](db[_0x0a49('0x28')][_0x0a49('0x29')],function(_0x13f44a){return{'name':_0x13f44a[_0x0a49('0x2a')],'type':_0x13f44a[_0x0a49('0x2b')][_0x0a49('0x2c')]};});_0x4d848e[_0x0a49('0x2d')]=_[_0x0a49('0x27')](_0x5a684a,_0x0a49('0x24'));_0x4d848e[_0x0a49('0x2e')]=_[_0x0a49('0x2f')](_0x1c75ad[_0x0a49('0x2e')]);_0x4d848e[_0x0a49('0x30')]=_['intersection'](_0x4d848e['model'],_0x4d848e[_0x0a49('0x2e')]);_0x3a1799[_0x0a49('0x31')]=_[_0x0a49('0x32')](_0x4d848e['model'],qs[_0x0a49('0x33')](_0x1c75ad[_0x0a49('0x2e')][_0x0a49('0x33')]));_0x3a1799[_0x0a49('0x31')]=_0x3a1799[_0x0a49('0x31')][_0x0a49('0x34')]?_0x3a1799[_0x0a49('0x31')]:_0x4d848e[_0x0a49('0x2d')];if(!_0x1c75ad[_0x0a49('0x2e')][_0x0a49('0x35')]('nolimit')){_0x3a1799[_0x0a49('0x19')]=qs['limit'](_0x1c75ad[_0x0a49('0x2e')]['limit']);_0x3a1799[_0x0a49('0x1b')]=qs[_0x0a49('0x1b')](_0x1c75ad['query'][_0x0a49('0x1b')]);}_0x3a1799[_0x0a49('0x36')]=qs[_0x0a49('0x37')](_0x1c75ad[_0x0a49('0x2e')][_0x0a49('0x37')]);_0x3a1799[_0x0a49('0x38')]=qs[_0x0a49('0x30')](_[_0x0a49('0x39')](_0x1c75ad[_0x0a49('0x2e')],_0x4d848e[_0x0a49('0x30')]),_0x5a684a);if(_0x1c75ad[_0x0a49('0x2e')][_0x0a49('0x3a')]){_0x3a1799[_0x0a49('0x38')]=_['merge'](_0x3a1799['where'],{'$or':_['map'](_0x5a684a,function(_0x218a9c){if(_0x218a9c[_0x0a49('0x2b')]!==_0x0a49('0x3b')){var _0x3880c8={};_0x3880c8[_0x218a9c[_0x0a49('0x24')]]={'$like':'%'+_0x1c75ad[_0x0a49('0x2e')][_0x0a49('0x3a')]+'%'};return _0x3880c8;}})});}_0x3a1799=_[_0x0a49('0x3c')]({},_0x3a1799,_0x1c75ad[_0x0a49('0x3d')]);var _0x1a6b67={'where':_0x3a1799['where']};return db[_0x0a49('0x28')]['count'](_0x1a6b67)[_0x0a49('0x1f')](function(_0x300df5){_0xc0a520['count']=_0x300df5;if(_0x1c75ad['query'][_0x0a49('0x3e')]){_0x3a1799[_0x0a49('0x3f')]=[{'all':!![]}];}return db[_0x0a49('0x28')][_0x0a49('0x40')](_0x3a1799);})['then'](function(_0x49a6db){_0xc0a520[_0x0a49('0x41')]=_0x49a6db;return _0xc0a520;})['then'](respondWithFilteredResult(_0x519c37,_0x3a1799))[_0x0a49('0x42')](handleError(_0x519c37,null));};exports[_0x0a49('0x43')]=function(_0x26fa2a,_0x5583a6){var _0x2a3359={'raw':!![],'where':{'id':_0x26fa2a[_0x0a49('0x44')]['id']}},_0x268faa={};_0x268faa[_0x0a49('0x2d')]=_[_0x0a49('0x2f')](db[_0x0a49('0x28')][_0x0a49('0x29')]);_0x268faa['query']=_['keys'](_0x26fa2a['query']);_0x268faa[_0x0a49('0x30')]=_[_0x0a49('0x32')](_0x268faa[_0x0a49('0x2d')],_0x268faa['query']);_0x2a3359['attributes']=_[_0x0a49('0x32')](_0x268faa['model'],qs[_0x0a49('0x33')](_0x26fa2a[_0x0a49('0x2e')][_0x0a49('0x33')]));_0x2a3359['attributes']=_0x2a3359['attributes'][_0x0a49('0x34')]?_0x2a3359[_0x0a49('0x31')]:_0x268faa[_0x0a49('0x2d')];if(_0x26fa2a[_0x0a49('0x2e')][_0x0a49('0x3e')]){_0x2a3359[_0x0a49('0x3f')]=[{'all':!![]}];}_0x2a3359=_[_0x0a49('0x3c')]({},_0x2a3359,_0x26fa2a[_0x0a49('0x3d')]);return db[_0x0a49('0x28')][_0x0a49('0x45')](_0x2a3359)['then'](handleEntityNotFound(_0x5583a6,null))[_0x0a49('0x1f')](respondWithResult(_0x5583a6,null))[_0x0a49('0x42')](handleError(_0x5583a6,null));};exports[_0x0a49('0x46')]=function(_0x594cbd,_0xe3c87d){return db[_0x0a49('0x28')][_0x0a49('0x46')](_0x594cbd[_0x0a49('0x47')],{})[_0x0a49('0x1f')](respondWithResult(_0xe3c87d,0xc9))['catch'](handleError(_0xe3c87d,null));};exports[_0x0a49('0x1e')]=function(_0x4402c6,_0x2dfb1b){if(_0x4402c6[_0x0a49('0x47')]['id']){delete _0x4402c6['body']['id'];}return db[_0x0a49('0x28')][_0x0a49('0x45')]({'where':{'id':_0x4402c6[_0x0a49('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dfb1b,null))[_0x0a49('0x1f')](saveUpdates(_0x4402c6[_0x0a49('0x47')],null))[_0x0a49('0x1f')](respondWithResult(_0x2dfb1b,null))[_0x0a49('0x42')](handleError(_0x2dfb1b,null));};exports[_0x0a49('0x20')]=function(_0x3951c1,_0x53ad4f){return db[_0x0a49('0x28')]['find']({'where':{'id':_0x3951c1['params']['id']}})['then'](handleEntityNotFound(_0x53ad4f,null))[_0x0a49('0x1f')](removeEntity(_0x53ad4f,null))[_0x0a49('0x42')](handleError(_0x53ad4f,null));};exports['describe']=function(_0x4d1578,_0x203198){return db['MailSubstatus'][_0x0a49('0x48')]()['then'](respondWithResult(_0x203198,null))['catch'](handleError(_0x203198,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 158c577..df51aab 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 _0xd10d=['hook','exports','../../mysqldb','MailSubstatus','emit'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0xd10d,0xed));var _0xdd10=function(_0x37dbbb,_0x1909de){_0x37dbbb=_0x37dbbb-0x0;var _0x10068f=_0xd10d[_0x37dbbb];return _0x10068f;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xdd10('0x0'))['db'][_0xdd10('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x1cdfc6){return function(_0x44609c,_0x2150c3,_0x4ffd25){MailSubstatusEvents[_0xdd10('0x2')](_0x1cdfc6+':'+_0x44609c['id'],_0x44609c);MailSubstatusEvents[_0xdd10('0x2')](_0x1cdfc6,_0x44609c);_0x4ffd25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xdd10('0x3')](e,emitEvent(event));}}module[_0xdd10('0x4')]=MailSubstatusEvents; \ No newline at end of file +var _0x2abc=['events','../../mysqldb','MailSubstatus','update','emit','hook','exports'];(function(_0x10cb39,_0x4f2f75){var _0x8699a5=function(_0x4f5bb3){while(--_0x4f5bb3){_0x10cb39['push'](_0x10cb39['shift']());}};_0x8699a5(++_0x4f2f75);}(_0x2abc,0x16c));var _0xc2ab=function(_0x45d492,_0x32e4b0){_0x45d492=_0x45d492-0x0;var _0x5ee410=_0x2abc[_0x45d492];return _0x5ee410;};'use strict';var EventEmitter=require(_0xc2ab('0x0'));var MailSubstatus=require(_0xc2ab('0x1'))['db'][_0xc2ab('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xc2ab('0x3')};function emitEvent(_0x1d23af){return function(_0x164e9f,_0x160ff5,_0x139a8c){MailSubstatusEvents['emit'](_0x1d23af+':'+_0x164e9f['id'],_0x164e9f);MailSubstatusEvents[_0xc2ab('0x4')](_0x1d23af,_0x164e9f);_0x139a8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xc2ab('0x5')](e,emitEvent(event));}}module[_0xc2ab('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index b57c93c..6f8755e 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 _0x6210=['_previousDataValues','name','then','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus'];(function(_0x4b05c8,_0x4cd837){var _0x310600=function(_0x37ef62){while(--_0x37ef62){_0x4b05c8['push'](_0x4b05c8['shift']());}};_0x310600(++_0x4cd837);}(_0x6210,0x1a7));var _0x0621=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6210[_0x19950b];return _0x3c6b41;};'use strict';var attributes=require(_0x0621('0x0'));module[_0x0621('0x1')]=function(_0x1b5247){var _0x1a7ead=_0x1b5247[_0x0621('0x2')];return _0x1b5247[_0x0621('0x3')](_0x0621('0x4'),attributes,{'tableName':_0x0621('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x43b02d,_0x4c7d76,_0x40dd3d){return _0x1a7ead[_0x0621('0x6')][_0x0621('0x7')]({'value':_0x43b02d['name']},{'where':{'field':_0x0621('0x8'),'value':_0x43b02d[_0x0621('0x9')][_0x0621('0xa')]}})[_0x0621('0xb')](function(){_0x40dd3d();})['catch'](function(_0x4d14df){_0x40dd3d(_0x4d14df);});}}});}; \ No newline at end of file +var _0x3347=['MailSubstatus','Condition','update','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','define'];(function(_0x1b2e34,_0x8d3ab5){var _0x13c2b9=function(_0x1d4bb3){while(--_0x1d4bb3){_0x1b2e34['push'](_0x1b2e34['shift']());}};_0x13c2b9(++_0x8d3ab5);}(_0x3347,0x10b));var _0x7334=function(_0x579db3,_0x382176){_0x579db3=_0x579db3-0x0;var _0x2befab=_0x3347[_0x579db3];return _0x2befab;};'use strict';var attributes=require(_0x7334('0x0'));module[_0x7334('0x1')]=function(_0x41d7bf){var _0x57593d=_0x41d7bf['models'];return _0x41d7bf[_0x7334('0x2')](_0x7334('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x37aa38,_0x49da6f,_0x4164b1){return _0x57593d[_0x7334('0x4')][_0x7334('0x5')]({'value':_0x37aa38[_0x7334('0x6')]},{'where':{'field':_0x7334('0x7'),'value':_0x37aa38['_previousDataValues'][_0x7334('0x6')]}})[_0x7334('0x8')](function(){_0x4164b1();})[_0x7334('0x9')](function(_0x135b74){_0x4164b1(_0x135b74);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index a3a5509..857be6a 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 _0xfbff=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','message','MailSubstatus,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x322efb,_0x539552){var _0x4245ca=function(_0x456790){while(--_0x456790){_0x322efb['push'](_0x322efb['shift']());}};_0x4245ca(++_0x539552);}(_0xfbff,0xaf));var _0xffbf=function(_0x1b5d5f,_0x5ed766){_0x1b5d5f=_0x1b5d5f-0x0;var _0x3c9347=_0xfbff[_0x1b5d5f];return _0x3c9347;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xffbf('0x0'));var BPromise=require(_0xffbf('0x1'));var rs=require(_0xffbf('0x2'));var fs=require('fs');var Redis=require(_0xffbf('0x3'));var db=require(_0xffbf('0x4'))['db'];var utils=require(_0xffbf('0x5'));var logger=require('../../config/logger')(_0xffbf('0x6'));var config=require(_0xffbf('0x7'));var jayson=require(_0xffbf('0x8'));var client=jayson['client'][_0xffbf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x465a8f,_0x5bd7c5,_0x26f75d){return new BPromise(function(_0xc33bae,_0x4de9e9){return client[_0xffbf('0xa')](_0x465a8f,_0x26f75d)[_0xffbf('0xb')](function(_0x38fc90){logger[_0xffbf('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x5bd7c5,_0xffbf('0xd'));logger[_0xffbf('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5bd7c5,_0xffbf('0xd'),JSON['stringify'](_0x38fc90));if(_0x38fc90[_0xffbf('0xf')]){if(_0x38fc90[_0xffbf('0xf')]['code']===0x1f4){logger[_0xffbf('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x5bd7c5,_0x38fc90[_0xffbf('0xf')][_0xffbf('0x10')]);return _0x4de9e9(_0x38fc90[_0xffbf('0xf')][_0xffbf('0x10')]);}logger[_0xffbf('0xf')](_0xffbf('0x11'),_0x5bd7c5,_0x38fc90[_0xffbf('0xf')][_0xffbf('0x10')]);return _0xc33bae(_0x38fc90[_0xffbf('0xf')][_0xffbf('0x10')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5bd7c5,_0xffbf('0xd'));_0xc33bae(_0x38fc90[_0xffbf('0x12')][_0xffbf('0x10')]);}})[_0xffbf('0x13')](function(_0x500b9b){logger[_0xffbf('0xf')](_0xffbf('0x11'),_0x5bd7c5,_0x500b9b);_0x4de9e9(_0x500b9b);});});} \ No newline at end of file +var _0x37f0=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x35af2b,_0x4a2210){var _0x470109=function(_0x320489){while(--_0x320489){_0x35af2b['push'](_0x35af2b['shift']());}};_0x470109(++_0x4a2210);}(_0x37f0,0xfe));var _0x037f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x37f0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x037f('0x0'));var util=require(_0x037f('0x1'));var moment=require(_0x037f('0x2'));var BPromise=require(_0x037f('0x3'));var rs=require(_0x037f('0x4'));var fs=require('fs');var Redis=require(_0x037f('0x5'));var db=require(_0x037f('0x6'))['db'];var utils=require(_0x037f('0x7'));var logger=require(_0x037f('0x8'))(_0x037f('0x9'));var config=require('../../config/environment');var jayson=require(_0x037f('0xa'));var client=jayson[_0x037f('0xb')][_0x037f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x126f24,_0x50d82a,_0x3af908){return new BPromise(function(_0x1f93f1,_0x1f345d){return client[_0x037f('0xd')](_0x126f24,_0x3af908)['then'](function(_0x429c4e){logger[_0x037f('0xe')](_0x037f('0xf'),_0x50d82a,'request\x20sent');logger['debug'](_0x037f('0x10'),_0x50d82a,_0x037f('0x11'),JSON[_0x037f('0x12')](_0x429c4e));if(_0x429c4e[_0x037f('0x13')]){if(_0x429c4e[_0x037f('0x13')][_0x037f('0x14')]===0x1f4){logger[_0x037f('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x50d82a,_0x429c4e[_0x037f('0x13')][_0x037f('0x15')]);return _0x1f345d(_0x429c4e[_0x037f('0x13')][_0x037f('0x15')]);}logger['error'](_0x037f('0xf'),_0x50d82a,_0x429c4e[_0x037f('0x13')][_0x037f('0x15')]);return _0x1f93f1(_0x429c4e[_0x037f('0x13')][_0x037f('0x15')]);}else{logger[_0x037f('0xe')](_0x037f('0xf'),_0x50d82a,_0x037f('0x11'));_0x1f93f1(_0x429c4e['result'][_0x037f('0x15')]);}})[_0x037f('0x16')](function(_0x56e87c){logger[_0x037f('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x50d82a,_0x56e87c);_0x1f345d(_0x56e87c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b68422f..8e95c6a 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 _0x71cf=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','post','update'];(function(_0x45a91c,_0x56541f){var _0x587932=function(_0x24efce){while(--_0x24efce){_0x45a91c['push'](_0x45a91c['shift']());}};_0x587932(++_0x56541f);}(_0x71cf,0x13f));var _0xf71c=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x71cf[_0x456a4b];return _0x42957c;};'use strict';var multer=require(_0xf71c('0x0'));var util=require(_0xf71c('0x1'));var path=require(_0xf71c('0x2'));var timeout=require(_0xf71c('0x3'));var express=require(_0xf71c('0x4'));var router=express[_0xf71c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf71c('0x6'));var config=require(_0xf71c('0x7'));var controller=require(_0xf71c('0x8'));router[_0xf71c('0x9')]('/',auth['isAuthenticated'](),controller[_0xf71c('0xa')]);router[_0xf71c('0x9')](_0xf71c('0xb'),auth[_0xf71c('0xc')](),controller[_0xf71c('0xd')]);router[_0xf71c('0x9')]('/:id',auth[_0xf71c('0xc')](),controller[_0xf71c('0xe')]);router[_0xf71c('0xf')]('/',auth[_0xf71c('0xc')](),controller['create']);router['put']('/:id',auth[_0xf71c('0xc')](),controller[_0xf71c('0x10')]);router[_0xf71c('0x11')](_0xf71c('0x12'),auth[_0xf71c('0xc')](),controller[_0xf71c('0x13')]);module[_0xf71c('0x14')]=router; \ No newline at end of file +var _0x1e2d=['get','/describe','post','create','put','/:id','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailTransferReport.controller','isAuthenticated'];(function(_0xe5d690,_0x32d83e){var _0x49b633=function(_0x4468c4){while(--_0x4468c4){_0xe5d690['push'](_0xe5d690['shift']());}};_0x49b633(++_0x32d83e);}(_0x1e2d,0xc3));var _0xd1e2=function(_0xf55b85,_0x59c6f2){_0xf55b85=_0xf55b85-0x0;var _0x453186=_0x1e2d[_0xf55b85];return _0x453186;};'use strict';var multer=require('multer');var util=require(_0xd1e2('0x0'));var path=require(_0xd1e2('0x1'));var timeout=require(_0xd1e2('0x2'));var express=require(_0xd1e2('0x3'));var router=express[_0xd1e2('0x4')]();var fs_extra=require(_0xd1e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd1e2('0x6'));var config=require('../../config/environment');var controller=require(_0xd1e2('0x7'));router['get']('/',auth[_0xd1e2('0x8')](),controller['index']);router[_0xd1e2('0x9')](_0xd1e2('0xa'),auth[_0xd1e2('0x8')](),controller['describe']);router['get']('/:id',auth[_0xd1e2('0x8')](),controller['show']);router[_0xd1e2('0xb')]('/',auth['isAuthenticated'](),controller[_0xd1e2('0xc')]);router[_0xd1e2('0xd')](_0xd1e2('0xe'),auth[_0xd1e2('0x8')](),controller[_0xd1e2('0xf')]);router['delete'](_0xd1e2('0xe'),auth[_0xd1e2('0x8')](),controller[_0xd1e2('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a29fb54..3959c66 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3cd2fd,_0x13e6a8){_0x3cd2fd=_0x3cd2fd-0x0;var _0x5626ba=_0xb43b[_0x3cd2fd];return _0x5626ba;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x409251,_0x40f525){var _0x216f47=function(_0x517895){while(--_0x517895){_0x409251['push'](_0x409251['shift']());}};_0x216f47(++_0x40f525);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 376d704..5a3e8b3 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 _0x9e23=['params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','destroy','end','sendStatus','error','name','send','index','map','MailTransferReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','fields','options','create','body','update','find'];(function(_0x38e438,_0x30cd37){var _0xd85571=function(_0x326d82){while(--_0x326d82){_0x38e438['push'](_0x38e438['shift']());}};_0xd85571(++_0x30cd37);}(_0x9e23,0x174));var _0x39e2=function(_0x55218b,_0x4f17f6){_0x55218b=_0x55218b-0x0;var _0x2872c7=_0x9e23[_0x55218b];return _0x2872c7;};'use strict';var emlformat=require(_0x39e2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x39e2('0x1'));var rp=require(_0x39e2('0x2'));var moment=require(_0x39e2('0x3'));var BPromise=require(_0x39e2('0x4'));var Mustache=require(_0x39e2('0x5'));var util=require(_0x39e2('0x6'));var path=require(_0x39e2('0x7'));var sox=require(_0x39e2('0x8'));var csv=require(_0x39e2('0x9'));var ejs=require(_0x39e2('0xa'));var fs=require('fs');var fs_extra=require(_0x39e2('0xb'));var _=require(_0x39e2('0xc'));var squel=require(_0x39e2('0xd'));var crypto=require(_0x39e2('0xe'));var jsforce=require(_0x39e2('0xf'));var deskjs=require(_0x39e2('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x39e2('0x11'));var Redis=require(_0x39e2('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x39e2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39e2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x39e2('0x15'));var licenseUtil=require(_0x39e2('0x16'));var db=require(_0x39e2('0x17'))['db'];function respondWithStatusCode(_0xee6c39,_0x3173ac){_0x3173ac=_0x3173ac||0xcc;return function(_0x214f73){if(_0x214f73){return _0xee6c39['sendStatus'](_0x3173ac);}return _0xee6c39['status'](_0x3173ac)['end']();};}function respondWithResult(_0x47ace4,_0x48b6ae){_0x48b6ae=_0x48b6ae||0xc8;return function(_0x36caa8){if(_0x36caa8){return _0x47ace4[_0x39e2('0x18')](_0x48b6ae)['json'](_0x36caa8);}};}function respondWithFilteredResult(_0x224450,_0x114901){return function(_0x4ef58d){if(_0x4ef58d){var _0x630bae=typeof _0x114901[_0x39e2('0x19')]==='undefined'&&typeof _0x114901[_0x39e2('0x1a')]===_0x39e2('0x1b');var _0x134410=_0x4ef58d[_0x39e2('0x1c')];var _0xdce365=_0x630bae?0x0:_0x114901[_0x39e2('0x19')];var _0x5028d6=_0x630bae?_0x4ef58d[_0x39e2('0x1c')]:_0x114901[_0x39e2('0x19')]+_0x114901[_0x39e2('0x1a')];var _0x242b97;if(_0x5028d6>=_0x134410){_0x5028d6=_0x134410;_0x242b97=0xc8;}else{_0x242b97=0xce;}_0x224450[_0x39e2('0x18')](_0x242b97);return _0x224450[_0x39e2('0x1d')](_0x39e2('0x1e'),_0xdce365+'-'+_0x5028d6+'/'+_0x134410)[_0x39e2('0x1f')](_0x4ef58d);}return null;};}function patchUpdates(_0x5c1657){return function(_0x3ab454){try{jsonpatch['apply'](_0x3ab454,_0x5c1657,!![]);}catch(_0x335cc2){return BPromise[_0x39e2('0x20')](_0x335cc2);}return _0x3ab454[_0x39e2('0x21')]();};}function saveUpdates(_0x15d5e8,_0x4e0403){return function(_0x3d8469){if(_0x3d8469){return _0x3d8469['update'](_0x15d5e8)['then'](function(_0x4410f5){return _0x4410f5;});}return null;};}function removeEntity(_0x52328d,_0x5190a){return function(_0x3ab4e6){if(_0x3ab4e6){return _0x3ab4e6[_0x39e2('0x22')]()['then'](function(){_0x52328d[_0x39e2('0x18')](0xcc)[_0x39e2('0x23')]();});}};}function handleEntityNotFound(_0x3e60a7,_0x2c61dc){return function(_0x7e2152){if(!_0x7e2152){_0x3e60a7[_0x39e2('0x24')](0x194);}return _0x7e2152;};}function handleError(_0x29e8ee,_0x190b62){_0x190b62=_0x190b62||0x1f4;return function(_0x1ae9f5){logger[_0x39e2('0x25')](_0x1ae9f5['stack']);if(_0x1ae9f5[_0x39e2('0x26')]){delete _0x1ae9f5[_0x39e2('0x26')];}_0x29e8ee[_0x39e2('0x18')](_0x190b62)[_0x39e2('0x27')](_0x1ae9f5);};}exports[_0x39e2('0x28')]=function(_0x4cd53e,_0x2af6b1){var _0x340612={},_0x20a873={},_0x40a255={'count':0x0,'rows':[]};var _0x5be8fd=_[_0x39e2('0x29')](db[_0x39e2('0x2a')][_0x39e2('0x2b')],function(_0x3ed9d1){return{'name':_0x3ed9d1['fieldName'],'type':_0x3ed9d1[_0x39e2('0x2c')]['key']};});_0x20a873[_0x39e2('0x2d')]=_[_0x39e2('0x29')](_0x5be8fd,_0x39e2('0x26'));_0x20a873[_0x39e2('0x2e')]=_[_0x39e2('0x2f')](_0x4cd53e[_0x39e2('0x2e')]);_0x20a873[_0x39e2('0x30')]=_[_0x39e2('0x31')](_0x20a873['model'],_0x20a873[_0x39e2('0x2e')]);_0x340612[_0x39e2('0x32')]=_[_0x39e2('0x31')](_0x20a873[_0x39e2('0x2d')],qs['fields'](_0x4cd53e[_0x39e2('0x2e')]['fields']));_0x340612[_0x39e2('0x32')]=_0x340612[_0x39e2('0x32')][_0x39e2('0x33')]?_0x340612['attributes']:_0x20a873[_0x39e2('0x2d')];if(!_0x4cd53e['query'][_0x39e2('0x34')](_0x39e2('0x35'))){_0x340612[_0x39e2('0x1a')]=qs[_0x39e2('0x1a')](_0x4cd53e[_0x39e2('0x2e')][_0x39e2('0x1a')]);_0x340612['offset']=qs[_0x39e2('0x19')](_0x4cd53e[_0x39e2('0x2e')]['offset']);}_0x340612[_0x39e2('0x36')]=qs[_0x39e2('0x37')](_0x4cd53e['query'][_0x39e2('0x37')]);_0x340612[_0x39e2('0x38')]=qs['filters'](_['pick'](_0x4cd53e[_0x39e2('0x2e')],_0x20a873[_0x39e2('0x30')]),_0x5be8fd);if(_0x4cd53e[_0x39e2('0x2e')][_0x39e2('0x39')]){_0x340612[_0x39e2('0x38')]=_['merge'](_0x340612[_0x39e2('0x38')],{'$or':_[_0x39e2('0x29')](_0x5be8fd,function(_0x1fab44){if(_0x1fab44[_0x39e2('0x2c')]!==_0x39e2('0x3a')){var _0xf36b55={};_0xf36b55[_0x1fab44['name']]={'$like':'%'+_0x4cd53e['query'][_0x39e2('0x39')]+'%'};return _0xf36b55;}})});}_0x340612=_[_0x39e2('0x3b')]({},_0x340612,_0x4cd53e['options']);var _0x4f25ae={'where':_0x340612[_0x39e2('0x38')]};return db[_0x39e2('0x2a')]['count'](_0x4f25ae)[_0x39e2('0x3c')](function(_0x331f67){_0x40a255[_0x39e2('0x1c')]=_0x331f67;if(_0x4cd53e['query'][_0x39e2('0x3d')]){_0x340612[_0x39e2('0x3e')]=[{'all':!![]}];}return db[_0x39e2('0x2a')][_0x39e2('0x3f')](_0x340612);})[_0x39e2('0x3c')](function(_0x4cb0b5){_0x40a255[_0x39e2('0x40')]=_0x4cb0b5;return _0x40a255;})[_0x39e2('0x3c')](respondWithFilteredResult(_0x2af6b1,_0x340612))[_0x39e2('0x41')](handleError(_0x2af6b1,null));};exports['show']=function(_0x2151c4,_0x3677b3){var _0x238a8d={'raw':!![],'where':{'id':_0x2151c4['params']['id']}},_0x1f330d={};_0x1f330d[_0x39e2('0x2d')]=_[_0x39e2('0x2f')](db[_0x39e2('0x2a')][_0x39e2('0x2b')]);_0x1f330d[_0x39e2('0x2e')]=_[_0x39e2('0x2f')](_0x2151c4[_0x39e2('0x2e')]);_0x1f330d[_0x39e2('0x30')]=_[_0x39e2('0x31')](_0x1f330d[_0x39e2('0x2d')],_0x1f330d[_0x39e2('0x2e')]);_0x238a8d[_0x39e2('0x32')]=_[_0x39e2('0x31')](_0x1f330d[_0x39e2('0x2d')],qs[_0x39e2('0x42')](_0x2151c4[_0x39e2('0x2e')][_0x39e2('0x42')]));_0x238a8d[_0x39e2('0x32')]=_0x238a8d['attributes'][_0x39e2('0x33')]?_0x238a8d[_0x39e2('0x32')]:_0x1f330d[_0x39e2('0x2d')];if(_0x2151c4[_0x39e2('0x2e')]['includeAll']){_0x238a8d[_0x39e2('0x3e')]=[{'all':!![]}];}_0x238a8d=_[_0x39e2('0x3b')]({},_0x238a8d,_0x2151c4[_0x39e2('0x43')]);return db[_0x39e2('0x2a')]['find'](_0x238a8d)['then'](handleEntityNotFound(_0x3677b3,null))[_0x39e2('0x3c')](respondWithResult(_0x3677b3,null))['catch'](handleError(_0x3677b3,null));};exports['create']=function(_0x6b03d8,_0x1851d1){return db['MailTransferReport'][_0x39e2('0x44')](_0x6b03d8[_0x39e2('0x45')],{})[_0x39e2('0x3c')](respondWithResult(_0x1851d1,0xc9))[_0x39e2('0x41')](handleError(_0x1851d1,null));};exports[_0x39e2('0x46')]=function(_0x3ed559,_0x5a729d){if(_0x3ed559[_0x39e2('0x45')]['id']){delete _0x3ed559['body']['id'];}return db[_0x39e2('0x2a')][_0x39e2('0x47')]({'where':{'id':_0x3ed559[_0x39e2('0x48')]['id']}})[_0x39e2('0x3c')](handleEntityNotFound(_0x5a729d,null))['then'](saveUpdates(_0x3ed559[_0x39e2('0x45')],null))['then'](respondWithResult(_0x5a729d,null))['catch'](handleError(_0x5a729d,null));};exports[_0x39e2('0x22')]=function(_0x28b6ed,_0x1247a5){return db['MailTransferReport']['find']({'where':{'id':_0x28b6ed['params']['id']}})['then'](handleEntityNotFound(_0x1247a5,null))[_0x39e2('0x3c')](removeEntity(_0x1247a5,null))[_0x39e2('0x41')](handleError(_0x1247a5,null));};exports[_0x39e2('0x49')]=function(_0x7a8a57,_0x24d2e6){return db['MailTransferReport'][_0x39e2('0x49')]()[_0x39e2('0x3c')](respondWithResult(_0x24d2e6,null))[_0x39e2('0x41')](handleError(_0x24d2e6,null));}; \ No newline at end of file +var _0x3b81=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','error','stack','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','include','create','body','find','params','catch','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x4a02f7,_0x26d1bb){var _0x400bdd=function(_0x29cded){while(--_0x29cded){_0x4a02f7['push'](_0x4a02f7['shift']());}};_0x400bdd(++_0x26d1bb);}(_0x3b81,0x171));var _0x13b8=function(_0x23aa8d,_0x521c66){_0x23aa8d=_0x23aa8d-0x0;var _0x5114fd=_0x3b81[_0x23aa8d];return _0x5114fd;};'use strict';var emlformat=require(_0x13b8('0x0'));var rimraf=require(_0x13b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13b8('0x2'));var rp=require(_0x13b8('0x3'));var moment=require(_0x13b8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x13b8('0x5'));var util=require(_0x13b8('0x6'));var path=require(_0x13b8('0x7'));var sox=require(_0x13b8('0x8'));var csv=require(_0x13b8('0x9'));var ejs=require(_0x13b8('0xa'));var fs=require('fs');var fs_extra=require(_0x13b8('0xb'));var _=require(_0x13b8('0xc'));var squel=require(_0x13b8('0xd'));var crypto=require(_0x13b8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x13b8('0xf'));var toCsv=require(_0x13b8('0x9'));var querystring=require(_0x13b8('0x10'));var Papa=require(_0x13b8('0x11'));var Redis=require('ioredis');var authService=require(_0x13b8('0x12'));var qs=require(_0x13b8('0x13'));var as=require(_0x13b8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x13b8('0x15'));var utils=require(_0x13b8('0x16'));var config=require(_0x13b8('0x17'));var licenseUtil=require(_0x13b8('0x18'));var db=require(_0x13b8('0x19'))['db'];function respondWithStatusCode(_0x1e6a05,_0x3f388b){_0x3f388b=_0x3f388b||0xcc;return function(_0x4ec0bf){if(_0x4ec0bf){return _0x1e6a05['sendStatus'](_0x3f388b);}return _0x1e6a05[_0x13b8('0x1a')](_0x3f388b)[_0x13b8('0x1b')]();};}function respondWithResult(_0x6ba67b,_0x32a067){_0x32a067=_0x32a067||0xc8;return function(_0x5ea13c){if(_0x5ea13c){return _0x6ba67b['status'](_0x32a067)[_0x13b8('0x1c')](_0x5ea13c);}};}function respondWithFilteredResult(_0x354842,_0x547b2c){return function(_0x28c6bf){if(_0x28c6bf){var _0x432ec1=typeof _0x547b2c['offset']===_0x13b8('0x1d')&&typeof _0x547b2c[_0x13b8('0x1e')]===_0x13b8('0x1d');var _0xeaf260=_0x28c6bf['count'];var _0x24984f=_0x432ec1?0x0:_0x547b2c[_0x13b8('0x1f')];var _0x102631=_0x432ec1?_0x28c6bf[_0x13b8('0x20')]:_0x547b2c[_0x13b8('0x1f')]+_0x547b2c['limit'];var _0x128e99;if(_0x102631>=_0xeaf260){_0x102631=_0xeaf260;_0x128e99=0xc8;}else{_0x128e99=0xce;}_0x354842[_0x13b8('0x1a')](_0x128e99);return _0x354842['set'](_0x13b8('0x21'),_0x24984f+'-'+_0x102631+'/'+_0xeaf260)[_0x13b8('0x1c')](_0x28c6bf);}return null;};}function patchUpdates(_0x361e1d){return function(_0x2172eb){try{jsonpatch[_0x13b8('0x22')](_0x2172eb,_0x361e1d,!![]);}catch(_0x3dc57c){return BPromise[_0x13b8('0x23')](_0x3dc57c);}return _0x2172eb[_0x13b8('0x24')]();};}function saveUpdates(_0x168805,_0x28792e){return function(_0x3eb053){if(_0x3eb053){return _0x3eb053[_0x13b8('0x25')](_0x168805)['then'](function(_0x4ac5e5){return _0x4ac5e5;});}return null;};}function removeEntity(_0x340268,_0x121dd0){return function(_0x3c108a){if(_0x3c108a){return _0x3c108a['destroy']()[_0x13b8('0x26')](function(){_0x340268['status'](0xcc)[_0x13b8('0x1b')]();});}};}function handleEntityNotFound(_0x2b91ba,_0x1f959e){return function(_0x1b27aa){if(!_0x1b27aa){_0x2b91ba['sendStatus'](0x194);}return _0x1b27aa;};}function handleError(_0x7efd8e,_0x12bf46){_0x12bf46=_0x12bf46||0x1f4;return function(_0x3db28e){logger[_0x13b8('0x27')](_0x3db28e[_0x13b8('0x28')]);if(_0x3db28e['name']){delete _0x3db28e['name'];}_0x7efd8e[_0x13b8('0x1a')](_0x12bf46)[_0x13b8('0x29')](_0x3db28e);};}exports[_0x13b8('0x2a')]=function(_0x1e893d,_0x2caf82){var _0x5c971a={},_0x19ec4b={},_0xaf5e2d={'count':0x0,'rows':[]};var _0x927242=_[_0x13b8('0x2b')](db[_0x13b8('0x2c')][_0x13b8('0x2d')],function(_0x3f3f75){return{'name':_0x3f3f75[_0x13b8('0x2e')],'type':_0x3f3f75[_0x13b8('0x2f')][_0x13b8('0x30')]};});_0x19ec4b[_0x13b8('0x31')]=_['map'](_0x927242,_0x13b8('0x32'));_0x19ec4b[_0x13b8('0x33')]=_[_0x13b8('0x34')](_0x1e893d[_0x13b8('0x33')]);_0x19ec4b[_0x13b8('0x35')]=_[_0x13b8('0x36')](_0x19ec4b['model'],_0x19ec4b[_0x13b8('0x33')]);_0x5c971a[_0x13b8('0x37')]=_[_0x13b8('0x36')](_0x19ec4b[_0x13b8('0x31')],qs[_0x13b8('0x38')](_0x1e893d['query']['fields']));_0x5c971a[_0x13b8('0x37')]=_0x5c971a[_0x13b8('0x37')][_0x13b8('0x39')]?_0x5c971a['attributes']:_0x19ec4b[_0x13b8('0x31')];if(!_0x1e893d['query'][_0x13b8('0x3a')](_0x13b8('0x3b'))){_0x5c971a[_0x13b8('0x1e')]=qs[_0x13b8('0x1e')](_0x1e893d[_0x13b8('0x33')]['limit']);_0x5c971a[_0x13b8('0x1f')]=qs[_0x13b8('0x1f')](_0x1e893d[_0x13b8('0x33')][_0x13b8('0x1f')]);}_0x5c971a[_0x13b8('0x3c')]=qs['sort'](_0x1e893d[_0x13b8('0x33')][_0x13b8('0x3d')]);_0x5c971a[_0x13b8('0x3e')]=qs['filters'](_[_0x13b8('0x3f')](_0x1e893d[_0x13b8('0x33')],_0x19ec4b[_0x13b8('0x35')]),_0x927242);if(_0x1e893d['query'][_0x13b8('0x40')]){_0x5c971a['where']=_[_0x13b8('0x41')](_0x5c971a[_0x13b8('0x3e')],{'$or':_[_0x13b8('0x2b')](_0x927242,function(_0x3c27c5){if(_0x3c27c5[_0x13b8('0x2f')]!=='VIRTUAL'){var _0x3f900d={};_0x3f900d[_0x3c27c5[_0x13b8('0x32')]]={'$like':'%'+_0x1e893d['query'][_0x13b8('0x40')]+'%'};return _0x3f900d;}})});}_0x5c971a=_[_0x13b8('0x41')]({},_0x5c971a,_0x1e893d['options']);var _0x16af12={'where':_0x5c971a['where']};return db[_0x13b8('0x2c')]['count'](_0x16af12)[_0x13b8('0x26')](function(_0x2eef24){_0xaf5e2d[_0x13b8('0x20')]=_0x2eef24;if(_0x1e893d[_0x13b8('0x33')][_0x13b8('0x42')]){_0x5c971a['include']=[{'all':!![]}];}return db[_0x13b8('0x2c')][_0x13b8('0x43')](_0x5c971a);})[_0x13b8('0x26')](function(_0x3faf64){_0xaf5e2d[_0x13b8('0x44')]=_0x3faf64;return _0xaf5e2d;})[_0x13b8('0x26')](respondWithFilteredResult(_0x2caf82,_0x5c971a))['catch'](handleError(_0x2caf82,null));};exports['show']=function(_0x464520,_0x3739c8){var _0x1b2a09={'raw':!![],'where':{'id':_0x464520['params']['id']}},_0x45d200={};_0x45d200[_0x13b8('0x31')]=_[_0x13b8('0x34')](db[_0x13b8('0x2c')][_0x13b8('0x2d')]);_0x45d200['query']=_['keys'](_0x464520[_0x13b8('0x33')]);_0x45d200['filters']=_['intersection'](_0x45d200['model'],_0x45d200[_0x13b8('0x33')]);_0x1b2a09[_0x13b8('0x37')]=_['intersection'](_0x45d200['model'],qs[_0x13b8('0x38')](_0x464520[_0x13b8('0x33')][_0x13b8('0x38')]));_0x1b2a09[_0x13b8('0x37')]=_0x1b2a09['attributes'][_0x13b8('0x39')]?_0x1b2a09[_0x13b8('0x37')]:_0x45d200[_0x13b8('0x31')];if(_0x464520[_0x13b8('0x33')]['includeAll']){_0x1b2a09[_0x13b8('0x45')]=[{'all':!![]}];}_0x1b2a09=_['merge']({},_0x1b2a09,_0x464520['options']);return db['MailTransferReport']['find'](_0x1b2a09)[_0x13b8('0x26')](handleEntityNotFound(_0x3739c8,null))[_0x13b8('0x26')](respondWithResult(_0x3739c8,null))['catch'](handleError(_0x3739c8,null));};exports['create']=function(_0x4634e5,_0x377de0){return db['MailTransferReport'][_0x13b8('0x46')](_0x4634e5[_0x13b8('0x47')],{})[_0x13b8('0x26')](respondWithResult(_0x377de0,0xc9))['catch'](handleError(_0x377de0,null));};exports['update']=function(_0x1440e8,_0x263cca){if(_0x1440e8[_0x13b8('0x47')]['id']){delete _0x1440e8[_0x13b8('0x47')]['id'];}return db['MailTransferReport'][_0x13b8('0x48')]({'where':{'id':_0x1440e8[_0x13b8('0x49')]['id']}})[_0x13b8('0x26')](handleEntityNotFound(_0x263cca,null))[_0x13b8('0x26')](saveUpdates(_0x1440e8[_0x13b8('0x47')],null))['then'](respondWithResult(_0x263cca,null))[_0x13b8('0x4a')](handleError(_0x263cca,null));};exports[_0x13b8('0x4b')]=function(_0x2f0664,_0x2eb5d7){return db[_0x13b8('0x2c')][_0x13b8('0x48')]({'where':{'id':_0x2f0664[_0x13b8('0x49')]['id']}})[_0x13b8('0x26')](handleEntityNotFound(_0x2eb5d7,null))[_0x13b8('0x26')](removeEntity(_0x2eb5d7,null))[_0x13b8('0x4a')](handleError(_0x2eb5d7,null));};exports[_0x13b8('0x4c')]=function(_0x3f5675,_0x11e149){return db[_0x13b8('0x2c')][_0x13b8('0x4c')]()[_0x13b8('0x26')](respondWithResult(_0x11e149,null))[_0x13b8('0x4a')](handleError(_0x11e149,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f07499b..35b86da 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 _0xc2d6=['../../config/environment','./mailTransferReport.attributes','define','report_mail_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x50bd25,_0x1491a9){var _0x3863c9=function(_0x501348){while(--_0x501348){_0x50bd25['push'](_0x50bd25['shift']());}};_0x3863c9(++_0x1491a9);}(_0xc2d6,0x171));var _0x6c2d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc2d6[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x6c2d('0x0'));var logger=require(_0x6c2d('0x1'))(_0x6c2d('0x2'));var moment=require(_0x6c2d('0x3'));var BPromise=require(_0x6c2d('0x4'));var rp=require(_0x6c2d('0x5'));var fs=require('fs');var path=require(_0x6c2d('0x6'));var rimraf=require(_0x6c2d('0x7'));var config=require(_0x6c2d('0x8'));var attributes=require(_0x6c2d('0x9'));module['exports']=function(_0x1141f7,_0x3cf33f){return _0x1141f7[_0x6c2d('0xa')]('MailTransferReport',attributes,{'tableName':_0x6c2d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6c2d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3148=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x3148,0x1d3));var _0x8314=function(_0x4441b1,_0x17bf98){_0x4441b1=_0x4441b1-0x0;var _0x3d510f=_0x3148[_0x4441b1];return _0x3d510f;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var logger=require('../../config/logger')(_0x8314('0x2'));var moment=require(_0x8314('0x3'));var BPromise=require(_0x8314('0x4'));var rp=require(_0x8314('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var attributes=require(_0x8314('0x8'));module[_0x8314('0x9')]=function(_0x18a30b,_0x9cb271){return _0x18a30b[_0x8314('0xa')]('MailTransferReport',attributes,{'tableName':_0x8314('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8314('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index a5120e4..ee6da61 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 _0x45fd=['util','moment','../../mysqldb','rpc','../../config/environment','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x42835a,_0x5259a7){var _0xa4f23b=function(_0xcb787d){while(--_0xcb787d){_0x42835a['push'](_0x42835a['shift']());}};_0xa4f23b(++_0x5259a7);}(_0x45fd,0xfc));var _0xd45f=function(_0x4262af,_0x577ceb){_0x4262af=_0x4262af-0x0;var _0x57ebc7=_0x45fd[_0x4262af];return _0x57ebc7;};'use strict';var _=require('lodash');var util=require(_0xd45f('0x0'));var moment=require(_0xd45f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd45f('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd45f('0x3'));var config=require(_0xd45f('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd45f('0x5')][_0xd45f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2923f0,_0x260223,_0x3ee45f){return new BPromise(function(_0x594e50,_0x4d21af){return client['request'](_0x2923f0,_0x3ee45f)[_0xd45f('0x7')](function(_0x14912d){logger[_0xd45f('0x8')](_0xd45f('0x9'),_0x260223,_0xd45f('0xa'));logger[_0xd45f('0xb')](_0xd45f('0xc'),_0x260223,_0xd45f('0xa'),JSON['stringify'](_0x14912d));if(_0x14912d[_0xd45f('0xd')]){if(_0x14912d[_0xd45f('0xd')][_0xd45f('0xe')]===0x1f4){logger[_0xd45f('0xd')](_0xd45f('0x9'),_0x260223,_0x14912d['error'][_0xd45f('0xf')]);return _0x4d21af(_0x14912d[_0xd45f('0xd')]['message']);}logger[_0xd45f('0xd')](_0xd45f('0x9'),_0x260223,_0x14912d[_0xd45f('0xd')]['message']);return _0x594e50(_0x14912d[_0xd45f('0xd')][_0xd45f('0xf')]);}else{logger[_0xd45f('0x8')]('MailTransferReport,\x20%s,\x20%s',_0x260223,_0xd45f('0xa'));_0x594e50(_0x14912d[_0xd45f('0x10')][_0xd45f('0xf')]);}})[_0xd45f('0x11')](function(_0x56c319){logger[_0xd45f('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x260223,_0x56c319);_0x4d21af(_0x56c319);});});} \ No newline at end of file +var _0x6c8d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1d6648,_0x2cfb42){var _0x25eb13=function(_0x315bf7){while(--_0x315bf7){_0x1d6648['push'](_0x1d6648['shift']());}};_0x25eb13(++_0x2cfb42);}(_0x6c8d,0x1f4));var _0xd6c8=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6c8d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd6c8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd6c8('0x1'));var rs=require(_0xd6c8('0x2'));var fs=require('fs');var Redis=require(_0xd6c8('0x3'));var db=require(_0xd6c8('0x4'))['db'];var utils=require(_0xd6c8('0x5'));var logger=require(_0xd6c8('0x6'))('rpc');var config=require(_0xd6c8('0x7'));var jayson=require(_0xd6c8('0x8'));var client=jayson[_0xd6c8('0x9')][_0xd6c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227555,_0xdf6040,_0x478c81){return new BPromise(function(_0xfa3fdf,_0x31adad){return client[_0xd6c8('0xb')](_0x227555,_0x478c81)[_0xd6c8('0xc')](function(_0x1b9d3b){logger[_0xd6c8('0xd')](_0xd6c8('0xe'),_0xdf6040,_0xd6c8('0xf'));logger[_0xd6c8('0x10')](_0xd6c8('0x11'),_0xdf6040,_0xd6c8('0xf'),JSON[_0xd6c8('0x12')](_0x1b9d3b));if(_0x1b9d3b[_0xd6c8('0x13')]){if(_0x1b9d3b[_0xd6c8('0x13')][_0xd6c8('0x14')]===0x1f4){logger[_0xd6c8('0x13')]('MailTransferReport,\x20%s,\x20%s',_0xdf6040,_0x1b9d3b[_0xd6c8('0x13')][_0xd6c8('0x15')]);return _0x31adad(_0x1b9d3b[_0xd6c8('0x13')][_0xd6c8('0x15')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0xdf6040,_0x1b9d3b[_0xd6c8('0x13')][_0xd6c8('0x15')]);return _0xfa3fdf(_0x1b9d3b[_0xd6c8('0x13')][_0xd6c8('0x15')]);}else{logger['info'](_0xd6c8('0xe'),_0xdf6040,'request\x20sent');_0xfa3fdf(_0x1b9d3b[_0xd6c8('0x16')][_0xd6c8('0x15')]);}})[_0xd6c8('0x17')](function(_0x26a354){logger['error'](_0xd6c8('0xe'),_0xdf6040,_0x26a354);_0x31adad(_0x26a354);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f6e3e75..3c81588 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 _0xe8f2=['describe','show','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe'];(function(_0x2cd702,_0xf04156){var _0x383b7e=function(_0x3ee4b0){while(--_0x3ee4b0){_0x2cd702['push'](_0x2cd702['shift']());}};_0x383b7e(++_0xf04156);}(_0xe8f2,0x169));var _0x2e8f=function(_0xe5a44d,_0x214505){_0xe5a44d=_0xe5a44d-0x0;var _0x5d8b85=_0xe8f2[_0xe5a44d];return _0x5d8b85;};'use strict';var multer=require('multer');var util=require(_0x2e8f('0x0'));var path=require(_0x2e8f('0x1'));var timeout=require(_0x2e8f('0x2'));var express=require(_0x2e8f('0x3'));var router=express['Router']();var fs_extra=require(_0x2e8f('0x4'));var auth=require(_0x2e8f('0x5'));var interaction=require(_0x2e8f('0x6'));var config=require(_0x2e8f('0x7'));var controller=require(_0x2e8f('0x8'));router[_0x2e8f('0x9')]('/',auth[_0x2e8f('0xa')](),controller[_0x2e8f('0xb')]);router[_0x2e8f('0x9')](_0x2e8f('0xc'),auth[_0x2e8f('0xa')](),controller[_0x2e8f('0xd')]);router[_0x2e8f('0x9')]('/:id',auth[_0x2e8f('0xa')](),controller[_0x2e8f('0xe')]);router[_0x2e8f('0xf')]('/',auth[_0x2e8f('0xa')](),controller[_0x2e8f('0x10')]);router[_0x2e8f('0x11')](_0x2e8f('0x12'),auth[_0x2e8f('0xa')](),controller['update']);router[_0x2e8f('0x13')](_0x2e8f('0x12'),auth['isAuthenticated'](),controller[_0x2e8f('0x14')]);module[_0x2e8f('0x15')]=router; \ No newline at end of file +var _0x53b8=['describe','show','post','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x53b8,0x182));var _0x853b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x53b8[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x853b('0x0'));var util=require(_0x853b('0x1'));var path=require('path');var timeout=require(_0x853b('0x2'));var express=require(_0x853b('0x3'));var router=express[_0x853b('0x4')]();var fs_extra=require(_0x853b('0x5'));var auth=require(_0x853b('0x6'));var interaction=require(_0x853b('0x7'));var config=require('../../config/environment');var controller=require(_0x853b('0x8'));router[_0x853b('0x9')]('/',auth[_0x853b('0xa')](),controller[_0x853b('0xb')]);router[_0x853b('0x9')](_0x853b('0xc'),auth[_0x853b('0xa')](),controller[_0x853b('0xd')]);router[_0x853b('0x9')]('/:id',auth[_0x853b('0xa')](),controller[_0x853b('0xe')]);router[_0x853b('0xf')]('/',auth[_0x853b('0xa')](),controller[_0x853b('0x10')]);router['put'](_0x853b('0x11'),auth[_0x853b('0xa')](),controller['update']);router[_0x853b('0x12')](_0x853b('0x11'),auth[_0x853b('0xa')](),controller[_0x853b('0x13')]);module[_0x853b('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 4a92db9..3c4d975 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 _0x552f=['seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff'];(function(_0x50fffc,_0x131334){var _0x4c1995=function(_0x2e605a){while(--_0x2e605a){_0x50fffc['push'](_0x50fffc['shift']());}};_0x4c1995(++_0x131334);}(_0x552f,0x117));var _0xf552=function(_0x9b7a64,_0x38d4a8){_0x9b7a64=_0x9b7a64-0x0;var _0x33fd98=_0x552f[_0x9b7a64];return _0x33fd98;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf552('0x0'));module[_0xf552('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf552('0x2')],'defaultValue':_0xf552('0x3'),'comment':_0xf552('0x4')},'duration':{'type':Sequelize[_0xf552('0x5')]},'enterAt':{'type':Sequelize[_0xf552('0x6')]},'exitAt':{'type':Sequelize[_0xf552('0x6')],'set':function(_0x327941){var _0x5611af=moment(_0x327941);var _0x235337=moment(this['getDataValue'](_0xf552('0x7')));var _0x398aeb=_0x5611af[_0xf552('0x8')](_0x235337,_0xf552('0x9'));this[_0xf552('0xa')](_0xf552('0xb'),_0x327941);this[_0xf552('0xa')](_0xf552('0xc'),_0x398aeb>=0x0?_0x398aeb:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xf552('0xd')},'data2':{'type':Sequelize[_0xf552('0x2')],'comment':_0xf552('0xe')},'data3':{'type':Sequelize[_0xf552('0x2')],'comment':_0xf552('0xf')},'data4':{'type':Sequelize[_0xf552('0x2')],'comment':_0xf552('0x10')},'data5':{'type':Sequelize[_0xf552('0x2')],'comment':_0xf552('0x11')},'role':{'type':Sequelize[_0xf552('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2225=['enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0x9391df,_0x2bebda){var _0x59255b=function(_0x1db709){while(--_0x1db709){_0x9391df['push'](_0x9391df['shift']());}};_0x59255b(++_0x2bebda);}(_0x2225,0xb6));var _0x5222=function(_0x5d8b71,_0x48bc35){_0x5d8b71=_0x5d8b71-0x0;var _0x19eb4b=_0x2225[_0x5d8b71];return _0x19eb4b;};'use strict';var Sequelize=require(_0x5222('0x0'));var moment=require('moment');module[_0x5222('0x1')]={'channel':{'type':Sequelize[_0x5222('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5222('0x2')],'defaultValue':_0x5222('0x3'),'comment':_0x5222('0x4')},'duration':{'type':Sequelize[_0x5222('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5222('0x6')],'set':function(_0x5b4130){var _0x3e87bd=moment(_0x5b4130);var _0x113240=moment(this[_0x5222('0x7')](_0x5222('0x8')));var _0x375a0e=_0x3e87bd[_0x5222('0x9')](_0x113240,_0x5222('0xa'));this[_0x5222('0xb')](_0x5222('0xc'),_0x5b4130);this[_0x5222('0xb')](_0x5222('0xd'),_0x375a0e>=0x0?_0x375a0e:null);}},'data1':{'type':Sequelize[_0x5222('0x2')],'comment':_0x5222('0xe')},'data2':{'type':Sequelize[_0x5222('0x2')],'comment':_0x5222('0xf')},'data3':{'type':Sequelize[_0x5222('0x2')],'comment':_0x5222('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0x5222('0x11')},'data5':{'type':Sequelize[_0x5222('0x2')],'comment':_0x5222('0x12')},'role':{'type':Sequelize[_0x5222('0x2')]},'internal':{'type':Sequelize[_0x5222('0x5')]},'uniqueid':{'type':Sequelize[_0x5222('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index b86d1ab..3608090 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xedd9,0xfc));var _0x9edd=function(_0x55e2c0,_0x25ade0){_0x55e2c0=_0x55e2c0-0x0;var _0x440712=_0xedd9[_0x55e2c0];return _0x440712;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x3ba061,_0x3ec05b){var _0x4b7e8b=function(_0x4dd276){while(--_0x4dd276){_0x3ba061['push'](_0x3ba061['shift']());}};_0x4b7e8b(++_0x3ec05b);}(_0x3e74,0x175));var _0x43e7=function(_0x23d539,_0x8b05c1){_0x23d539=_0x23d539-0x0;var _0x1a25ad=_0x3e74[_0x23d539];return _0x1a25ad;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 2d615f3..ce988bd 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 _0x63b0=['membername_interface','membername','../../config/logger','api','request-promise','path','../../config/environment','./memberReport.attributes','MemberReport','report_member'];(function(_0x4ebe99,_0x17deb0){var _0x4cb9aa=function(_0x214982){while(--_0x214982){_0x4ebe99['push'](_0x4ebe99['shift']());}};_0x4cb9aa(++_0x17deb0);}(_0x63b0,0x192));var _0x063b=function(_0x2b7e29,_0x119c21){_0x2b7e29=_0x2b7e29-0x0;var _0x5e1848=_0x63b0[_0x2b7e29];return _0x5e1848;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x063b('0x0'))(_0x063b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x063b('0x2'));var fs=require('fs');var path=require(_0x063b('0x3'));var rimraf=require('rimraf');var config=require(_0x063b('0x4'));var attributes=require(_0x063b('0x5'));module['exports']=function(_0x5d5389,_0xa764b7){return _0x5d5389['define'](_0x063b('0x6'),attributes,{'tableName':_0x063b('0x7'),'paranoid':![],'indexes':[{'name':_0x063b('0x8'),'fields':[_0x063b('0x9'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4771=['../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x294915,_0x5b1945){var _0x3e8250=function(_0x1bd83e){while(--_0x1bd83e){_0x294915['push'](_0x294915['shift']());}};_0x3e8250(++_0x5b1945);}(_0x4771,0x1d9));var _0x1477=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x4771[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x1477('0x0'));var util=require(_0x1477('0x1'));var logger=require(_0x1477('0x2'))(_0x1477('0x3'));var moment=require('moment');var BPromise=require(_0x1477('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1477('0x5'));var rimraf=require(_0x1477('0x6'));var config=require(_0x1477('0x7'));var attributes=require(_0x1477('0x8'));module[_0x1477('0x9')]=function(_0x59f54e,_0x526f3b){return _0x59f54e['define'](_0x1477('0xa'),attributes,{'tableName':_0x1477('0xb'),'paranoid':![],'indexes':[{'name':_0x1477('0xc'),'fields':[_0x1477('0xd'),_0x1477('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 03da37e..2438397 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 _0x96fd=['model','map','CreateMemberReport','MemberReport','body','update','raw','UpdateMemberReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','findAll','options','where','attributes','limit','include'];(function(_0x24505b,_0x278856){var _0x5e405f=function(_0x5d47cd){while(--_0x5d47cd){_0x24505b['push'](_0x24505b['shift']());}};_0x5e405f(++_0x278856);}(_0x96fd,0x1e9));var _0xd96f=function(_0x38d06a,_0x235a32){_0x38d06a=_0x38d06a-0x0;var _0x1cc756=_0x96fd[_0x38d06a];return _0x1cc756;};'use strict';var _=require('lodash');var util=require(_0xd96f('0x0'));var moment=require('moment');var BPromise=require(_0xd96f('0x1'));var rs=require(_0xd96f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd96f('0x3'))['db'];var utils=require(_0xd96f('0x4'));var logger=require(_0xd96f('0x5'))(_0xd96f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd96f('0x7'));var client=jayson[_0xd96f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6000a,_0x446862,_0x3ae72a){return new BPromise(function(_0xb32b34,_0x10a4f3){return client[_0xd96f('0x9')](_0xe6000a,_0x3ae72a)[_0xd96f('0xa')](function(_0x1f1543){logger[_0xd96f('0xb')](_0xd96f('0xc'),_0x446862,_0xd96f('0xd'));logger[_0xd96f('0xe')](_0xd96f('0xf'),_0x446862,_0xd96f('0xd'),JSON[_0xd96f('0x10')](_0x1f1543));if(_0x1f1543[_0xd96f('0x11')]){if(_0x1f1543[_0xd96f('0x11')][_0xd96f('0x12')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x446862,_0x1f1543[_0xd96f('0x11')][_0xd96f('0x13')]);return _0x10a4f3(_0x1f1543['error']['message']);}logger[_0xd96f('0x11')](_0xd96f('0xc'),_0x446862,_0x1f1543[_0xd96f('0x11')][_0xd96f('0x13')]);return _0xb32b34(_0x1f1543[_0xd96f('0x11')][_0xd96f('0x13')]);}else{logger[_0xd96f('0xb')](_0xd96f('0xc'),_0x446862,_0xd96f('0xd'));_0xb32b34(_0x1f1543[_0xd96f('0x14')]['message']);}})[_0xd96f('0x15')](function(_0x569e1){logger['error'](_0xd96f('0xc'),_0x446862,_0x569e1);_0x10a4f3(_0x569e1);});});}exports[_0xd96f('0x16')]=function(_0x45c990){var _0x15d2d5=this;return new Promise(function(_0x7663e3,_0x1f1c2e){return db['MemberReport'][_0xd96f('0x17')]({'raw':_0x45c990[_0xd96f('0x18')]?_0x45c990[_0xd96f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x45c990[_0xd96f('0x18')]?_0x45c990[_0xd96f('0x18')][_0xd96f('0x19')]||null:null,'attributes':_0x45c990[_0xd96f('0x18')]?_0x45c990[_0xd96f('0x18')][_0xd96f('0x1a')]||null:null,'limit':_0x45c990[_0xd96f('0x18')]?_0x45c990['options'][_0xd96f('0x1b')]||null:null,'include':_0x45c990[_0xd96f('0x18')]?_0x45c990['options'][_0xd96f('0x1c')]?_['map'](_0x45c990[_0xd96f('0x18')]['include'],function(_0x5ade3f){return{'model':db[_0x5ade3f[_0xd96f('0x1d')]],'as':_0x5ade3f['as'],'attributes':_0x5ade3f['attributes'],'include':_0x5ade3f['include']?_[_0xd96f('0x1e')](_0x5ade3f[_0xd96f('0x1c')],function(_0x1b4b26){return{'model':db[_0x1b4b26[_0xd96f('0x1d')]],'as':_0x1b4b26['as'],'attributes':_0x1b4b26[_0xd96f('0x1a')],'include':_0x1b4b26[_0xd96f('0x1c')]?_['map'](_0x1b4b26[_0xd96f('0x1c')],function(_0x24d81a){return{'model':db[_0x24d81a[_0xd96f('0x1d')]],'as':_0x24d81a['as'],'attributes':_0x24d81a[_0xd96f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd96f('0xa')](function(_0x3725cd){logger[_0xd96f('0xb')](_0xd96f('0x16'),_0x45c990);logger[_0xd96f('0xe')](_0xd96f('0x16'),_0x45c990,JSON[_0xd96f('0x10')](_0x3725cd));_0x7663e3(_0x3725cd);})[_0xd96f('0x15')](function(_0x1e2ade){logger[_0xd96f('0x11')](_0xd96f('0x16'),_0x1e2ade[_0xd96f('0x13')],_0x45c990);_0x1f1c2e(_0x15d2d5[_0xd96f('0x11')](0x1f4,_0x1e2ade[_0xd96f('0x13')]));});});};exports[_0xd96f('0x1f')]=function(_0x1738dd){var _0x497b02=this;return new Promise(function(_0x3abf3d,_0x390863){return db[_0xd96f('0x20')]['create'](_0x1738dd[_0xd96f('0x21')],{'raw':_0x1738dd[_0xd96f('0x18')]?_0x1738dd[_0xd96f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xd96f('0xa')](function(_0x5cea25){logger[_0xd96f('0xb')]('CreateMemberReport',_0x1738dd);logger[_0xd96f('0xe')](_0xd96f('0x1f'),_0x1738dd,JSON[_0xd96f('0x10')](_0x5cea25));_0x3abf3d(_0x5cea25);})[_0xd96f('0x15')](function(_0x239506){logger[_0xd96f('0x11')](_0xd96f('0x1f'),_0x239506['message'],_0x1738dd);_0x390863(_0x497b02['error'](0x1f4,_0x239506[_0xd96f('0x13')]));});});};exports['UpdateMemberReport']=function(_0x541b33){var _0x56fa1d=this;return new Promise(function(_0x38c05f,_0x31db2c){return db[_0xd96f('0x20')][_0xd96f('0x22')](_0x541b33['body'],{'raw':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x19')]||null:null,'attributes':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x1a')]||null:null,'limit':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x1b')]||null:null})['then'](function(_0x13579f){logger[_0xd96f('0xb')](_0xd96f('0x24'),_0x541b33);logger[_0xd96f('0xe')]('UpdateMemberReport',_0x541b33,JSON[_0xd96f('0x10')](_0x13579f));_0x38c05f(_0x13579f);})[_0xd96f('0x15')](function(_0x7dff88){logger[_0xd96f('0x11')]('UpdateMemberReport',_0x7dff88['message'],_0x541b33);_0x31db2c(_0x56fa1d[_0xd96f('0x11')](0x1f4,_0x7dff88[_0xd96f('0x13')]));});});}; \ No newline at end of file +var _0x55c1=['raw','where','attributes','include','map','model','then','debug','GetMemberReport','CreateMemberReport','create','stringify','catch','UpdateMemberReport','update','body','limit','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','message','MemberReport','findAll','options'];(function(_0x50a5eb,_0x179e83){var _0x321ee4=function(_0x4dc99c){while(--_0x4dc99c){_0x50a5eb['push'](_0x50a5eb['shift']());}};_0x321ee4(++_0x179e83);}(_0x55c1,0x1e5));var _0x155c=function(_0x3376bd,_0x4fdb2a){_0x3376bd=_0x3376bd-0x0;var _0x587b0b=_0x55c1[_0x3376bd];return _0x587b0b;};'use strict';var _=require(_0x155c('0x0'));var util=require(_0x155c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x155c('0x2'));var db=require(_0x155c('0x3'))['db'];var utils=require(_0x155c('0x4'));var logger=require(_0x155c('0x5'))(_0x155c('0x6'));var config=require('../../config/environment');var jayson=require(_0x155c('0x7'));var client=jayson[_0x155c('0x8')][_0x155c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4df902,_0x1cdd2f,_0x25b08a){return new BPromise(function(_0x22ed0d,_0x5f4274){return client['request'](_0x4df902,_0x25b08a)['then'](function(_0x330e12){logger[_0x155c('0xa')](_0x155c('0xb'),_0x1cdd2f,_0x155c('0xc'));logger['debug'](_0x155c('0xd'),_0x1cdd2f,_0x155c('0xc'),JSON['stringify'](_0x330e12));if(_0x330e12[_0x155c('0xe')]){if(_0x330e12[_0x155c('0xe')]['code']===0x1f4){logger[_0x155c('0xe')](_0x155c('0xb'),_0x1cdd2f,_0x330e12['error'][_0x155c('0xf')]);return _0x5f4274(_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);}logger['error'](_0x155c('0xb'),_0x1cdd2f,_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);return _0x22ed0d(_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);}else{logger['info'](_0x155c('0xb'),_0x1cdd2f,_0x155c('0xc'));_0x22ed0d(_0x330e12['result'][_0x155c('0xf')]);}})['catch'](function(_0x4570e2){logger[_0x155c('0xe')](_0x155c('0xb'),_0x1cdd2f,_0x4570e2);_0x5f4274(_0x4570e2);});});}exports['GetMemberReport']=function(_0xe800de){var _0x13667b=this;return new Promise(function(_0x224a3d,_0x2f0099){return db[_0x155c('0x10')][_0x155c('0x11')]({'raw':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x13')]===undefined?!![]:![]:!![],'where':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x14')]||null:null,'attributes':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x15')]||null:null,'limit':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')]['limit']||null:null,'include':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x16')]?_[_0x155c('0x17')](_0xe800de[_0x155c('0x12')][_0x155c('0x16')],function(_0x4b6d0d){return{'model':db[_0x4b6d0d['model']],'as':_0x4b6d0d['as'],'attributes':_0x4b6d0d[_0x155c('0x15')],'include':_0x4b6d0d[_0x155c('0x16')]?_[_0x155c('0x17')](_0x4b6d0d[_0x155c('0x16')],function(_0x41e24d){return{'model':db[_0x41e24d[_0x155c('0x18')]],'as':_0x41e24d['as'],'attributes':_0x41e24d[_0x155c('0x15')],'include':_0x41e24d[_0x155c('0x16')]?_[_0x155c('0x17')](_0x41e24d[_0x155c('0x16')],function(_0x36be3d){return{'model':db[_0x36be3d[_0x155c('0x18')]],'as':_0x36be3d['as'],'attributes':_0x36be3d[_0x155c('0x15')]};}):[]};}):[]};}):[]:[]})[_0x155c('0x19')](function(_0x115143){logger[_0x155c('0xa')]('GetMemberReport',_0xe800de);logger[_0x155c('0x1a')]('GetMemberReport',_0xe800de,JSON['stringify'](_0x115143));_0x224a3d(_0x115143);})['catch'](function(_0x47c89d){logger[_0x155c('0xe')](_0x155c('0x1b'),_0x47c89d[_0x155c('0xf')],_0xe800de);_0x2f0099(_0x13667b['error'](0x1f4,_0x47c89d[_0x155c('0xf')]));});});};exports[_0x155c('0x1c')]=function(_0x32e5b8){var _0x595d47=this;return new Promise(function(_0x5a0ddf,_0x4ad8b4){return db[_0x155c('0x10')][_0x155c('0x1d')](_0x32e5b8['body'],{'raw':_0x32e5b8[_0x155c('0x12')]?_0x32e5b8[_0x155c('0x12')][_0x155c('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x2a84e7){logger['info'](_0x155c('0x1c'),_0x32e5b8);logger[_0x155c('0x1a')]('CreateMemberReport',_0x32e5b8,JSON[_0x155c('0x1e')](_0x2a84e7));_0x5a0ddf(_0x2a84e7);})[_0x155c('0x1f')](function(_0x5d575f){logger[_0x155c('0xe')](_0x155c('0x1c'),_0x5d575f['message'],_0x32e5b8);_0x4ad8b4(_0x595d47[_0x155c('0xe')](0x1f4,_0x5d575f[_0x155c('0xf')]));});});};exports[_0x155c('0x20')]=function(_0x306572){var _0x31a174=this;return new Promise(function(_0x2dc388,_0x3ec5fc){return db[_0x155c('0x10')][_0x155c('0x21')](_0x306572[_0x155c('0x22')],{'raw':_0x306572[_0x155c('0x12')]?_0x306572['options'][_0x155c('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306572[_0x155c('0x12')]?_0x306572[_0x155c('0x12')]['where']||null:null,'attributes':_0x306572[_0x155c('0x12')]?_0x306572[_0x155c('0x12')]['attributes']||null:null,'limit':_0x306572['options']?_0x306572[_0x155c('0x12')][_0x155c('0x23')]||null:null})[_0x155c('0x19')](function(_0x5ab939){logger[_0x155c('0xa')](_0x155c('0x20'),_0x306572);logger[_0x155c('0x1a')]('UpdateMemberReport',_0x306572,JSON[_0x155c('0x1e')](_0x5ab939));_0x2dc388(_0x5ab939);})['catch'](function(_0x3453a7){logger[_0x155c('0xe')](_0x155c('0x20'),_0x3453a7['message'],_0x306572);_0x3ec5fc(_0x31a174['error'](0x1f4,_0x3453a7[_0x155c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4c29c42..5666203 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 _0xe27b=['Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','index','exports','util','path','connect-timeout','express'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xe27b,0xf9));var _0xbe27=function(_0x297409,_0x13847c){_0x297409=_0x297409-0x0;var _0x468764=_0xe27b[_0x297409];return _0x468764;};'use strict';var multer=require('multer');var util=require(_0xbe27('0x0'));var path=require(_0xbe27('0x1'));var timeout=require(_0xbe27('0x2'));var express=require(_0xbe27('0x3'));var router=express[_0xbe27('0x4')]();var fs_extra=require(_0xbe27('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbe27('0x6'));var config=require(_0xbe27('0x7'));var controller=require(_0xbe27('0x8'));router['get']('/',controller[_0xbe27('0x9')]);module[_0xbe27('0xa')]=router; \ No newline at end of file +var _0xdd9e=['index','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0xdd9e,0x1e2));var _0xedd9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdd9e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xedd9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xedd9('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xedd9('0x2'));var auth=require(_0xedd9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xedd9('0x4'));var controller=require(_0xedd9('0x5'));router['get']('/',controller[_0xedd9('0x6')]);module[_0xedd9('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 b13b77b..7429d88 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 _0xf81d=['sequelize'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0xf81d,0x1e3));var _0xdf81=function(_0x3c1c71,_0x30f389){_0x3c1c71=_0x3c1c71-0x0;var _0x2b1d5c=_0xf81d[_0x3c1c71];return _0x2b1d5c;};'use strict';var Sequelize=require(_0xdf81('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0x999b=['exports','STRING','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x999b,0x1d6));var _0xb999=function(_0x5141c1,_0x4bb2b4){_0x5141c1=_0x5141c1-0x0;var _0x117dc3=_0x999b[_0x5141c1];return _0x117dc3;};'use strict';var Sequelize=require(_0xb999('0x0'));module[_0xb999('0x1')]={'version':{'type':Sequelize[_0xb999('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 6dc3654..1313ae5 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 _0x1fa1=['Migration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','sort','where','pick','filters','filter','merge','VIRTUAL','include','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','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','destroy','then','error','stack','name','index'];(function(_0x45816b,_0x141afe){var _0x1eca67=function(_0x43562e){while(--_0x43562e){_0x45816b['push'](_0x45816b['shift']());}};_0x1eca67(++_0x141afe);}(_0x1fa1,0x18b));var _0x11fa=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x1fa1[_0x281e5e];return _0x5a22d2;};'use strict';var emlformat=require(_0x11fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11fa('0x1'));var jsonpatch=require(_0x11fa('0x2'));var rp=require(_0x11fa('0x3'));var moment=require(_0x11fa('0x4'));var BPromise=require(_0x11fa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x11fa('0x6'));var csv=require('to-csv');var ejs=require(_0x11fa('0x7'));var fs=require('fs');var fs_extra=require(_0x11fa('0x8'));var _=require(_0x11fa('0x9'));var squel=require(_0x11fa('0xa'));var crypto=require(_0x11fa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x11fa('0xc'));var toCsv=require(_0x11fa('0xd'));var querystring=require('querystring');var Papa=require(_0x11fa('0xe'));var Redis=require(_0x11fa('0xf'));var authService=require(_0x11fa('0x10'));var qs=require(_0x11fa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x11fa('0x12'))(_0x11fa('0x13'));var utils=require(_0x11fa('0x14'));var config=require(_0x11fa('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x11fa('0x16'))['db'];function respondWithStatusCode(_0x54e376,_0x5b756c){_0x5b756c=_0x5b756c||0xcc;return function(_0x2366be){if(_0x2366be){return _0x54e376[_0x11fa('0x17')](_0x5b756c);}return _0x54e376[_0x11fa('0x18')](_0x5b756c)[_0x11fa('0x19')]();};}function respondWithResult(_0xb5e12c,_0x224bda){_0x224bda=_0x224bda||0xc8;return function(_0x5a5b4a){if(_0x5a5b4a){return _0xb5e12c['status'](_0x224bda)[_0x11fa('0x1a')](_0x5a5b4a);}};}function respondWithFilteredResult(_0x2b9a0a,_0x308d75){return function(_0x2b53fd){if(_0x2b53fd){var _0x44b351=typeof _0x308d75[_0x11fa('0x1b')]===_0x11fa('0x1c')&&typeof _0x308d75['limit']===_0x11fa('0x1c');var _0x2d8d91=_0x2b53fd[_0x11fa('0x1d')];var _0x3a1c0d=_0x44b351?0x0:_0x308d75[_0x11fa('0x1b')];var _0x4f10b7=_0x44b351?_0x2b53fd[_0x11fa('0x1d')]:_0x308d75['offset']+_0x308d75[_0x11fa('0x1e')];var _0x400a69;if(_0x4f10b7>=_0x2d8d91){_0x4f10b7=_0x2d8d91;_0x400a69=0xc8;}else{_0x400a69=0xce;}_0x2b9a0a[_0x11fa('0x18')](_0x400a69);return _0x2b9a0a[_0x11fa('0x1f')](_0x11fa('0x20'),_0x3a1c0d+'-'+_0x4f10b7+'/'+_0x2d8d91)[_0x11fa('0x1a')](_0x2b53fd);}return null;};}function patchUpdates(_0x164b29){return function(_0x28e9c7){try{jsonpatch['apply'](_0x28e9c7,_0x164b29,!![]);}catch(_0x9cd962){return BPromise['reject'](_0x9cd962);}return _0x28e9c7['save']();};}function saveUpdates(_0x146028,_0x35ef3d){return function(_0x574046){if(_0x574046){return _0x574046['update'](_0x146028)['then'](function(_0x388875){return _0x388875;});}return null;};}function removeEntity(_0x54494f,_0x544edc){return function(_0x5e27c4){if(_0x5e27c4){return _0x5e27c4[_0x11fa('0x21')]()[_0x11fa('0x22')](function(){_0x54494f[_0x11fa('0x18')](0xcc)[_0x11fa('0x19')]();});}};}function handleEntityNotFound(_0x530c13,_0x388b53){return function(_0x33ebab){if(!_0x33ebab){_0x530c13['sendStatus'](0x194);}return _0x33ebab;};}function handleError(_0x4909ea,_0x218b09){_0x218b09=_0x218b09||0x1f4;return function(_0x1a186b){logger[_0x11fa('0x23')](_0x1a186b[_0x11fa('0x24')]);if(_0x1a186b[_0x11fa('0x25')]){delete _0x1a186b[_0x11fa('0x25')];}_0x4909ea[_0x11fa('0x18')](_0x218b09)['send'](_0x1a186b);};}exports[_0x11fa('0x26')]=function(_0x323da6,_0x4b9bb2){var _0x28be0e={},_0x5a65c7={},_0x5b8923={'count':0x0,'rows':[]};var _0x5c557c=_['map'](db[_0x11fa('0x27')][_0x11fa('0x28')],function(_0x1081cb){return{'name':_0x1081cb[_0x11fa('0x29')],'type':_0x1081cb[_0x11fa('0x2a')][_0x11fa('0x2b')]};});_0x5a65c7[_0x11fa('0x2c')]=_[_0x11fa('0x2d')](_0x5c557c,_0x11fa('0x25'));_0x5a65c7[_0x11fa('0x2e')]=_[_0x11fa('0x2f')](_0x323da6[_0x11fa('0x2e')]);_0x5a65c7['filters']=_[_0x11fa('0x30')](_0x5a65c7['model'],_0x5a65c7[_0x11fa('0x2e')]);_0x28be0e[_0x11fa('0x31')]=_['intersection'](_0x5a65c7[_0x11fa('0x2c')],qs[_0x11fa('0x32')](_0x323da6[_0x11fa('0x2e')][_0x11fa('0x32')]));_0x28be0e[_0x11fa('0x31')]=_0x28be0e[_0x11fa('0x31')][_0x11fa('0x33')]?_0x28be0e['attributes']:_0x5a65c7['model'];if(!_0x323da6[_0x11fa('0x2e')]['hasOwnProperty']('nolimit')){_0x28be0e['limit']=qs[_0x11fa('0x1e')](_0x323da6['query'][_0x11fa('0x1e')]);_0x28be0e[_0x11fa('0x1b')]=qs['offset'](_0x323da6['query'][_0x11fa('0x1b')]);}_0x28be0e['order']=qs[_0x11fa('0x34')](_0x323da6[_0x11fa('0x2e')]['sort']);_0x28be0e[_0x11fa('0x35')]=qs['filters'](_[_0x11fa('0x36')](_0x323da6[_0x11fa('0x2e')],_0x5a65c7[_0x11fa('0x37')]),_0x5c557c);if(_0x323da6['query'][_0x11fa('0x38')]){_0x28be0e[_0x11fa('0x35')]=_[_0x11fa('0x39')](_0x28be0e['where'],{'$or':_['map'](_0x5c557c,function(_0x3c7538){if(_0x3c7538[_0x11fa('0x2a')]!==_0x11fa('0x3a')){var _0x5add93={};_0x5add93[_0x3c7538[_0x11fa('0x25')]]={'$like':'%'+_0x323da6[_0x11fa('0x2e')][_0x11fa('0x38')]+'%'};return _0x5add93;}})});}_0x28be0e=_['merge']({},_0x28be0e,_0x323da6['options']);var _0x165a2e={'where':_0x28be0e[_0x11fa('0x35')]};return db[_0x11fa('0x27')][_0x11fa('0x1d')](_0x165a2e)['then'](function(_0x4e033f){_0x5b8923[_0x11fa('0x1d')]=_0x4e033f;if(_0x323da6[_0x11fa('0x2e')]['includeAll']){_0x28be0e[_0x11fa('0x3b')]=[{'all':!![]}];}return db[_0x11fa('0x27')][_0x11fa('0x3c')](_0x28be0e);})[_0x11fa('0x22')](function(_0xfa1738){_0x5b8923[_0x11fa('0x3d')]=_0xfa1738;return _0x5b8923;})[_0x11fa('0x22')](respondWithFilteredResult(_0x4b9bb2,_0x28be0e))['catch'](handleError(_0x4b9bb2,null));}; \ No newline at end of file +var _0xe443=['index','Migration','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name'];(function(_0x9f3af,_0x2f7508){var _0x4112aa=function(_0x2d8c4b){while(--_0x2d8c4b){_0x9f3af['push'](_0x9f3af['shift']());}};_0x4112aa(++_0x2f7508);}(_0xe443,0x14e));var _0x3e44=function(_0x1de6f2,_0x425a0a){_0x1de6f2=_0x1de6f2-0x0;var _0x48127e=_0xe443[_0x1de6f2];return _0x48127e;};'use strict';var emlformat=require(_0x3e44('0x0'));var rimraf=require(_0x3e44('0x1'));var zipdir=require(_0x3e44('0x2'));var jsonpatch=require(_0x3e44('0x3'));var rp=require('request-promise');var moment=require(_0x3e44('0x4'));var BPromise=require(_0x3e44('0x5'));var Mustache=require(_0x3e44('0x6'));var util=require(_0x3e44('0x7'));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(_0x3e44('0x8'));var squel=require(_0x3e44('0x9'));var crypto=require(_0x3e44('0xa'));var jsforce=require(_0x3e44('0xb'));var deskjs=require(_0x3e44('0xc'));var toCsv=require(_0x3e44('0xd'));var querystring=require(_0x3e44('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e44('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e44('0x10'));var logger=require(_0x3e44('0x11'))(_0x3e44('0x12'));var utils=require(_0x3e44('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3e44('0x14'))['db'];function respondWithStatusCode(_0x5ddb17,_0x52c436){_0x52c436=_0x52c436||0xcc;return function(_0x4274ac){if(_0x4274ac){return _0x5ddb17['sendStatus'](_0x52c436);}return _0x5ddb17[_0x3e44('0x15')](_0x52c436)[_0x3e44('0x16')]();};}function respondWithResult(_0x3ef2e1,_0x434711){_0x434711=_0x434711||0xc8;return function(_0x22d2db){if(_0x22d2db){return _0x3ef2e1[_0x3e44('0x15')](_0x434711)[_0x3e44('0x17')](_0x22d2db);}};}function respondWithFilteredResult(_0x4781a2,_0x2ff6ec){return function(_0x35e77a){if(_0x35e77a){var _0x330f06=typeof _0x2ff6ec[_0x3e44('0x18')]===_0x3e44('0x19')&&typeof _0x2ff6ec[_0x3e44('0x1a')]===_0x3e44('0x19');var _0x2fb458=_0x35e77a[_0x3e44('0x1b')];var _0x5ab00c=_0x330f06?0x0:_0x2ff6ec[_0x3e44('0x18')];var _0x2007d7=_0x330f06?_0x35e77a[_0x3e44('0x1b')]:_0x2ff6ec[_0x3e44('0x18')]+_0x2ff6ec[_0x3e44('0x1a')];var _0x3bab4a;if(_0x2007d7>=_0x2fb458){_0x2007d7=_0x2fb458;_0x3bab4a=0xc8;}else{_0x3bab4a=0xce;}_0x4781a2['status'](_0x3bab4a);return _0x4781a2[_0x3e44('0x1c')](_0x3e44('0x1d'),_0x5ab00c+'-'+_0x2007d7+'/'+_0x2fb458)[_0x3e44('0x17')](_0x35e77a);}return null;};}function patchUpdates(_0x46d7f2){return function(_0x3f0cb8){try{jsonpatch[_0x3e44('0x1e')](_0x3f0cb8,_0x46d7f2,!![]);}catch(_0x2f4016){return BPromise['reject'](_0x2f4016);}return _0x3f0cb8[_0x3e44('0x1f')]();};}function saveUpdates(_0x464197,_0x5138ff){return function(_0x210b34){if(_0x210b34){return _0x210b34[_0x3e44('0x20')](_0x464197)[_0x3e44('0x21')](function(_0x1675b3){return _0x1675b3;});}return null;};}function removeEntity(_0x43a41f,_0x43671a){return function(_0x1ac9c0){if(_0x1ac9c0){return _0x1ac9c0[_0x3e44('0x22')]()[_0x3e44('0x21')](function(){_0x43a41f[_0x3e44('0x15')](0xcc)[_0x3e44('0x16')]();});}};}function handleEntityNotFound(_0x4b7251,_0x1ce057){return function(_0x34c373){if(!_0x34c373){_0x4b7251[_0x3e44('0x23')](0x194);}return _0x34c373;};}function handleError(_0x2df98e,_0x234597){_0x234597=_0x234597||0x1f4;return function(_0x400d10){logger[_0x3e44('0x24')](_0x400d10['stack']);if(_0x400d10[_0x3e44('0x25')]){delete _0x400d10['name'];}_0x2df98e[_0x3e44('0x15')](_0x234597)['send'](_0x400d10);};}exports[_0x3e44('0x26')]=function(_0x2f4713,_0x15c696){var _0x13075e={},_0x3a2e60={},_0x4a1128={'count':0x0,'rows':[]};var _0x4bef3c=_['map'](db[_0x3e44('0x27')]['rawAttributes'],function(_0x83bb7){return{'name':_0x83bb7[_0x3e44('0x28')],'type':_0x83bb7[_0x3e44('0x29')][_0x3e44('0x2a')]};});_0x3a2e60['model']=_[_0x3e44('0x2b')](_0x4bef3c,_0x3e44('0x25'));_0x3a2e60[_0x3e44('0x2c')]=_[_0x3e44('0x2d')](_0x2f4713['query']);_0x3a2e60[_0x3e44('0x2e')]=_[_0x3e44('0x2f')](_0x3a2e60[_0x3e44('0x30')],_0x3a2e60[_0x3e44('0x2c')]);_0x13075e[_0x3e44('0x31')]=_['intersection'](_0x3a2e60[_0x3e44('0x30')],qs['fields'](_0x2f4713['query']['fields']));_0x13075e['attributes']=_0x13075e[_0x3e44('0x31')]['length']?_0x13075e[_0x3e44('0x31')]:_0x3a2e60[_0x3e44('0x30')];if(!_0x2f4713[_0x3e44('0x2c')][_0x3e44('0x32')]('nolimit')){_0x13075e[_0x3e44('0x1a')]=qs['limit'](_0x2f4713['query']['limit']);_0x13075e[_0x3e44('0x18')]=qs['offset'](_0x2f4713[_0x3e44('0x2c')][_0x3e44('0x18')]);}_0x13075e[_0x3e44('0x33')]=qs[_0x3e44('0x34')](_0x2f4713['query'][_0x3e44('0x34')]);_0x13075e['where']=qs[_0x3e44('0x2e')](_['pick'](_0x2f4713[_0x3e44('0x2c')],_0x3a2e60[_0x3e44('0x2e')]),_0x4bef3c);if(_0x2f4713[_0x3e44('0x2c')][_0x3e44('0x35')]){_0x13075e[_0x3e44('0x36')]=_[_0x3e44('0x37')](_0x13075e[_0x3e44('0x36')],{'$or':_[_0x3e44('0x2b')](_0x4bef3c,function(_0x3a7c4e){if(_0x3a7c4e[_0x3e44('0x29')]!==_0x3e44('0x38')){var _0x2ef1a6={};_0x2ef1a6[_0x3a7c4e[_0x3e44('0x25')]]={'$like':'%'+_0x2f4713['query'][_0x3e44('0x35')]+'%'};return _0x2ef1a6;}})});}_0x13075e=_[_0x3e44('0x37')]({},_0x13075e,_0x2f4713[_0x3e44('0x39')]);var _0x134def={'where':_0x13075e['where']};return db['Migration'][_0x3e44('0x1b')](_0x134def)['then'](function(_0x391637){_0x4a1128[_0x3e44('0x1b')]=_0x391637;if(_0x2f4713[_0x3e44('0x2c')]['includeAll']){_0x13075e[_0x3e44('0x3a')]=[{'all':!![]}];}return db[_0x3e44('0x27')][_0x3e44('0x3b')](_0x13075e);})[_0x3e44('0x21')](function(_0x2aadb9){_0x4a1128[_0x3e44('0x3c')]=_0x2aadb9;return _0x4a1128;})['then'](respondWithFilteredResult(_0x15c696,_0x13075e))[_0x3e44('0x3d')](handleError(_0x15c696,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 0a7839f..d392c80 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 _0xa130=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util'];(function(_0x4046c9,_0x190e34){var _0x245230=function(_0x95a4c){while(--_0x95a4c){_0x4046c9['push'](_0x4046c9['shift']());}};_0x245230(++_0x190e34);}(_0xa130,0xfa));var _0x0a13=function(_0x29b14b,_0x5820d1){_0x29b14b=_0x29b14b-0x0;var _0x19ead2=_0xa130[_0x29b14b];return _0x19ead2;};'use strict';var _=require(_0x0a13('0x0'));var util=require(_0x0a13('0x1'));var logger=require('../../config/logger')(_0x0a13('0x2'));var moment=require(_0x0a13('0x3'));var BPromise=require(_0x0a13('0x4'));var rp=require(_0x0a13('0x5'));var fs=require('fs');var path=require(_0x0a13('0x6'));var rimraf=require(_0x0a13('0x7'));var config=require(_0x0a13('0x8'));var attributes=require(_0x0a13('0x9'));module[_0x0a13('0xa')]=function(_0x33d43d,_0x3264df){return _0x33d43d[_0x0a13('0xb')](_0x0a13('0xc'),attributes,{'tableName':_0x0a13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e89=['path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','api','bluebird','request-promise'];(function(_0x3a890d,_0x3e8680){var _0x38e48b=function(_0x140e38){while(--_0x140e38){_0x3a890d['push'](_0x3a890d['shift']());}};_0x38e48b(++_0x3e8680);}(_0x8e89,0xe3));var _0x98e8=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x8e89[_0x53afa6];return _0x51f86a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x98e8('0x0'));var moment=require('moment');var BPromise=require(_0x98e8('0x1'));var rp=require(_0x98e8('0x2'));var fs=require('fs');var path=require(_0x98e8('0x3'));var rimraf=require(_0x98e8('0x4'));var config=require(_0x98e8('0x5'));var attributes=require(_0x98e8('0x6'));module[_0x98e8('0x7')]=function(_0x53cf8a,_0x1663c3){return _0x53cf8a[_0x98e8('0x8')]('Migration',attributes,{'tableName':_0x98e8('0x9'),'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 51642be..32e2ac1 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 _0x33a4=['rpc','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x1a21ed,_0x28c221){var _0x2a5187=function(_0x26da4e){while(--_0x26da4e){_0x1a21ed['push'](_0x1a21ed['shift']());}};_0x2a5187(++_0x28c221);}(_0x33a4,0x88));var _0x433a=function(_0x5f11d3,_0x238978){_0x5f11d3=_0x5f11d3-0x0;var _0x1cdb64=_0x33a4[_0x5f11d3];return _0x1cdb64;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var moment=require('moment');var BPromise=require(_0x433a('0x1'));var rs=require(_0x433a('0x2'));var fs=require('fs');var Redis=require(_0x433a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x433a('0x4'));var config=require(_0x433a('0x5'));var jayson=require(_0x433a('0x6'));var client=jayson[_0x433a('0x7')][_0x433a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcc88,_0x422eb9,_0x58e65c){return new BPromise(function(_0x2c2404,_0x3156ec){return client[_0x433a('0x9')](_0x4fcc88,_0x58e65c)[_0x433a('0xa')](function(_0x4c1057){logger['info'](_0x433a('0xb'),_0x422eb9,_0x433a('0xc'));logger[_0x433a('0xd')](_0x433a('0xe'),_0x422eb9,_0x433a('0xc'),JSON['stringify'](_0x4c1057));if(_0x4c1057['error']){if(_0x4c1057[_0x433a('0xf')][_0x433a('0x10')]===0x1f4){logger[_0x433a('0xf')](_0x433a('0xb'),_0x422eb9,_0x4c1057['error'][_0x433a('0x11')]);return _0x3156ec(_0x4c1057[_0x433a('0xf')]['message']);}logger[_0x433a('0xf')]('Migration,\x20%s,\x20%s',_0x422eb9,_0x4c1057[_0x433a('0xf')][_0x433a('0x11')]);return _0x2c2404(_0x4c1057[_0x433a('0xf')]['message']);}else{logger['info'](_0x433a('0xb'),_0x422eb9,_0x433a('0xc'));_0x2c2404(_0x4c1057[_0x433a('0x12')][_0x433a('0x11')]);}})[_0x433a('0x13')](function(_0x4df77a){logger['error'](_0x433a('0xb'),_0x422eb9,_0x4df77a);_0x3156ec(_0x4df77a);});});} \ No newline at end of file +var _0xe6d7=['client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x5173b3,_0x26273d){var _0x16d4d7=function(_0x205197){while(--_0x205197){_0x5173b3['push'](_0x5173b3['shift']());}};_0x16d4d7(++_0x26273d);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x16697e,_0x112bf8){_0x16697e=_0x16697e-0x0;var _0x218ede=_0xe6d7[_0x16697e];return _0x218ede;};'use strict';var _=require('lodash');var util=require(_0x7e6d('0x0'));var moment=require('moment');var BPromise=require(_0x7e6d('0x1'));var rs=require(_0x7e6d('0x2'));var fs=require('fs');var Redis=require(_0x7e6d('0x3'));var db=require(_0x7e6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e6d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e6d('0x6'));var client=jayson[_0x7e6d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x344697,_0x146e9e,_0x3a7cfe){return new BPromise(function(_0x30eb06,_0x44d906){return client[_0x7e6d('0x8')](_0x344697,_0x3a7cfe)[_0x7e6d('0x9')](function(_0x2ffe91){logger[_0x7e6d('0xa')](_0x7e6d('0xb'),_0x146e9e,'request\x20sent');logger[_0x7e6d('0xc')](_0x7e6d('0xd'),_0x146e9e,_0x7e6d('0xe'),JSON[_0x7e6d('0xf')](_0x2ffe91));if(_0x2ffe91['error']){if(_0x2ffe91[_0x7e6d('0x10')][_0x7e6d('0x11')]===0x1f4){logger['error'](_0x7e6d('0xb'),_0x146e9e,_0x2ffe91[_0x7e6d('0x10')][_0x7e6d('0x12')]);return _0x44d906(_0x2ffe91[_0x7e6d('0x10')][_0x7e6d('0x12')]);}logger[_0x7e6d('0x10')](_0x7e6d('0xb'),_0x146e9e,_0x2ffe91[_0x7e6d('0x10')][_0x7e6d('0x12')]);return _0x30eb06(_0x2ffe91[_0x7e6d('0x10')]['message']);}else{logger['info'](_0x7e6d('0xb'),_0x146e9e,_0x7e6d('0xe'));_0x30eb06(_0x2ffe91['result'][_0x7e6d('0x12')]);}})['catch'](function(_0x169144){logger[_0x7e6d('0x10')](_0x7e6d('0xb'),_0x146e9e,_0x169144);_0x44d906(_0x169144);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 46121d4..b913673 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 _0x3759=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0xc6f172,_0x15c2c8){var _0x230711=function(_0x352367){while(--_0x352367){_0xc6f172['push'](_0xc6f172['shift']());}};_0x230711(++_0x15c2c8);}(_0x3759,0x131));var _0x9375=function(_0x3e6610,_0x4fbf0d){_0x3e6610=_0x3e6610-0x0;var _0x634048=_0x3759[_0x3e6610];return _0x634048;};'use strict';var multer=require(_0x9375('0x0'));var util=require(_0x9375('0x1'));var path=require(_0x9375('0x2'));var timeout=require(_0x9375('0x3'));var express=require(_0x9375('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9375('0x5'));var interaction=require(_0x9375('0x6'));var config=require('../../config/environment');var controller=require(_0x9375('0x7'));router[_0x9375('0x8')]('/',auth['isAuthenticated'](),controller[_0x9375('0x9')]);router[_0x9375('0x8')](_0x9375('0xa'),auth[_0x9375('0xb')](),controller[_0x9375('0xc')]);router[_0x9375('0xd')]('/',auth[_0x9375('0xb')](),controller[_0x9375('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9375('0xf')]);router[_0x9375('0x10')](_0x9375('0xa'),auth['isAuthenticated'](),controller[_0x9375('0x11')]);module[_0x9375('0x12')]=router; \ No newline at end of file +var _0xff01=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff01,0xb7));var _0x1ff0=function(_0x45db6a,_0x2a2ab9){_0x45db6a=_0x45db6a-0x0;var _0x10a891=_0xff01[_0x45db6a];return _0x10a891;};'use strict';var multer=require(_0x1ff0('0x0'));var util=require(_0x1ff0('0x1'));var path=require('path');var timeout=require(_0x1ff0('0x2'));var express=require('express');var router=express[_0x1ff0('0x3')]();var fs_extra=require(_0x1ff0('0x4'));var auth=require(_0x1ff0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1ff0('0x6'));var controller=require('./network.controller');router[_0x1ff0('0x7')]('/',auth['isAuthenticated'](),controller[_0x1ff0('0x8')]);router['get']('/:id',auth[_0x1ff0('0x9')](),controller[_0x1ff0('0xa')]);router['post']('/',auth[_0x1ff0('0x9')](),controller[_0x1ff0('0xb')]);router[_0x1ff0('0xc')](_0x1ff0('0xd'),auth[_0x1ff0('0x9')](),controller['update']);router[_0x1ff0('0xe')]('/:id',auth[_0x1ff0('0x9')](),controller[_0x1ff0('0xf')]);module[_0x1ff0('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 5c6b7d6..1927bd8 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 _0x9a5a=['exports','stun','turn','STRING','sequelize'];(function(_0x4b0503,_0x15ef22){var _0x276965=function(_0x3b9916){while(--_0x3b9916){_0x4b0503['push'](_0x4b0503['shift']());}};_0x276965(++_0x15ef22);}(_0x9a5a,0x117));var _0xa9a5=function(_0x2c0a82,_0xd51866){_0x2c0a82=_0x2c0a82-0x0;var _0x2dba66=_0x9a5a[_0x2c0a82];return _0x2dba66;};'use strict';var Sequelize=require(_0xa9a5('0x0'));module[_0xa9a5('0x1')]={'type':{'type':Sequelize['ENUM']('localnet','externip',_0xa9a5('0x2'),_0xa9a5('0x3'))},'value':{'type':Sequelize[_0xa9a5('0x4')]},'username':{'type':Sequelize[_0xa9a5('0x4')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x41b1=['localnet','externip','turn','STRING','exports','ENUM'];(function(_0x398936,_0x51566e){var _0x3cfe2b=function(_0x5bb43e){while(--_0x5bb43e){_0x398936['push'](_0x398936['shift']());}};_0x3cfe2b(++_0x51566e);}(_0x41b1,0xd0));var _0x141b=function(_0x520e16,_0x545cb6){_0x520e16=_0x520e16-0x0;var _0x4771b5=_0x41b1[_0x520e16];return _0x4771b5;};'use strict';var Sequelize=require('sequelize');module[_0x141b('0x0')]={'type':{'type':Sequelize[_0x141b('0x1')](_0x141b('0x2'),_0x141b('0x3'),'stun',_0x141b('0x4'))},'value':{'type':Sequelize[_0x141b('0x5')]},'username':{'type':Sequelize[_0x141b('0x5')]},'password':{'type':Sequelize[_0x141b('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 7d6d769..d468918 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 _0xa9dc=['catch','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','destroy','sendStatus','stack','name','Network','rawAttributes','key','model','map','query','filters','intersection','length','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','keys','fields','include','find','create','sequelize','transaction','body','findAll','type','readFileSync','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','toUpperCase','server/files/templates/stun_multiple.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2e48f3,_0x46f38e){var _0x43a622=function(_0x1c3d8a){while(--_0x1c3d8a){_0x2e48f3['push'](_0x2e48f3['shift']());}};_0x43a622(++_0x46f38e);}(_0xa9dc,0xb0));var _0xca9d=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xa9dc[_0x45f951];return _0x24756c;};'use strict';var emlformat=require(_0xca9d('0x0'));var rimraf=require(_0xca9d('0x1'));var zipdir=require(_0xca9d('0x2'));var jsonpatch=require(_0xca9d('0x3'));var rp=require(_0xca9d('0x4'));var moment=require('moment');var BPromise=require(_0xca9d('0x5'));var Mustache=require(_0xca9d('0x6'));var util=require(_0xca9d('0x7'));var path=require(_0xca9d('0x8'));var sox=require(_0xca9d('0x9'));var csv=require(_0xca9d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca9d('0xb'));var _=require('lodash');var squel=require(_0xca9d('0xc'));var crypto=require(_0xca9d('0xd'));var jsforce=require(_0xca9d('0xe'));var deskjs=require(_0xca9d('0xf'));var toCsv=require(_0xca9d('0xa'));var querystring=require('querystring');var Papa=require(_0xca9d('0x10'));var Redis=require(_0xca9d('0x11'));var authService=require(_0xca9d('0x12'));var qs=require(_0xca9d('0x13'));var as=require(_0xca9d('0x14'));var hardwareService=require(_0xca9d('0x15'));var logger=require(_0xca9d('0x16'))(_0xca9d('0x17'));var utils=require('../../config/utils');var config=require(_0xca9d('0x18'));var licenseUtil=require(_0xca9d('0x19'));var db=require(_0xca9d('0x1a'))['db'];var jayson=require(_0xca9d('0x1b'));var client=jayson[_0xca9d('0x1c')][_0xca9d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3e12bc,_0x1aee20,_0x56c0b8,_0x10d920){return new BPromise(function(_0x4b3763,_0x57ed2b){var _0x2b7e1f=_0x10d920||client;return _0x2b7e1f[_0xca9d('0x1e')](_0x3e12bc,_0x56c0b8)[_0xca9d('0x1f')](function(_0xb546da){logger['info'](_0xca9d('0x20'),_0x1aee20,_0xca9d('0x21'));logger[_0xca9d('0x22')]('Network,\x20%s,\x20%s,\x20%s',_0x1aee20,'request\x20sent',JSON[_0xca9d('0x23')](_0xb546da));if(_0xb546da['error']){if(_0xb546da[_0xca9d('0x24')][_0xca9d('0x25')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x1aee20,_0xb546da[_0xca9d('0x24')][_0xca9d('0x26')]);return _0x57ed2b(_0xb546da[_0xca9d('0x24')]['message']);}logger[_0xca9d('0x24')](_0xca9d('0x20'),_0x1aee20,_0xb546da[_0xca9d('0x24')][_0xca9d('0x26')]);return _0x4b3763(_0xb546da['error'][_0xca9d('0x26')]);}else{logger['info'](_0xca9d('0x20'),_0x1aee20,_0xca9d('0x21'));_0x4b3763(_0xb546da[_0xca9d('0x27')][_0xca9d('0x26')]);}})[_0xca9d('0x28')](function(_0x50c474){logger[_0xca9d('0x24')](_0xca9d('0x20'),_0x1aee20,_0x50c474);_0x57ed2b(_0x50c474);});});}function respondWithStatusCode(_0x2b190e,_0x15099f){_0x15099f=_0x15099f||0xcc;return function(_0x5304b0){if(_0x5304b0){return _0x2b190e['sendStatus'](_0x15099f);}return _0x2b190e['status'](_0x15099f)[_0xca9d('0x29')]();};}function respondWithResult(_0x567706,_0x4ceb08){_0x4ceb08=_0x4ceb08||0xc8;return function(_0x326b68){if(_0x326b68){return _0x567706['status'](_0x4ceb08)[_0xca9d('0x2a')](_0x326b68);}};}function respondWithFilteredResult(_0x2ab94f,_0x322c4b){return function(_0x25e621){if(_0x25e621){var _0x2bd7b8=typeof _0x322c4b[_0xca9d('0x2b')]===_0xca9d('0x2c')&&typeof _0x322c4b[_0xca9d('0x2d')]==='undefined';var _0x4979bc=_0x25e621[_0xca9d('0x2e')];var _0x799038=_0x2bd7b8?0x0:_0x322c4b[_0xca9d('0x2b')];var _0x3ee7fb=_0x2bd7b8?_0x25e621[_0xca9d('0x2e')]:_0x322c4b[_0xca9d('0x2b')]+_0x322c4b[_0xca9d('0x2d')];var _0x3c5328;if(_0x3ee7fb>=_0x4979bc){_0x3ee7fb=_0x4979bc;_0x3c5328=0xc8;}else{_0x3c5328=0xce;}_0x2ab94f[_0xca9d('0x2f')](_0x3c5328);return _0x2ab94f[_0xca9d('0x30')](_0xca9d('0x31'),_0x799038+'-'+_0x3ee7fb+'/'+_0x4979bc)[_0xca9d('0x2a')](_0x25e621);}return null;};}function patchUpdates(_0x5982c3){return function(_0x4cf32d){try{jsonpatch['apply'](_0x4cf32d,_0x5982c3,!![]);}catch(_0x4f630a){return BPromise['reject'](_0x4f630a);}return _0x4cf32d[_0xca9d('0x32')]();};}function saveUpdates(_0x3cd8ba,_0x4e3284){return function(_0x58eb38){if(_0x58eb38){return _0x58eb38[_0xca9d('0x33')](_0x3cd8ba)[_0xca9d('0x1f')](function(_0x1ac768){return _0x1ac768;});}return null;};}function removeEntity(_0x396ab1,_0x31fb6d){return function(_0x3c6e4f){if(_0x3c6e4f){return _0x3c6e4f[_0xca9d('0x34')]()[_0xca9d('0x1f')](function(){_0x396ab1[_0xca9d('0x2f')](0xcc)[_0xca9d('0x29')]();});}};}function handleEntityNotFound(_0x32a319,_0x11a261){return function(_0x5835e6){if(!_0x5835e6){_0x32a319[_0xca9d('0x35')](0x194);}return _0x5835e6;};}function handleError(_0x290d60,_0x2cdfc5){_0x2cdfc5=_0x2cdfc5||0x1f4;return function(_0x18968b){logger[_0xca9d('0x24')](_0x18968b[_0xca9d('0x36')]);if(_0x18968b[_0xca9d('0x37')]){delete _0x18968b[_0xca9d('0x37')];}_0x290d60['status'](_0x2cdfc5)['send'](_0x18968b);};}exports['index']=function(_0x5180a6,_0x399adb){var _0x3ddf61={},_0x43cd9e={},_0x274533={'count':0x0,'rows':[]};var _0x39462c=_['map'](db[_0xca9d('0x38')][_0xca9d('0x39')],function(_0x29191b){return{'name':_0x29191b['fieldName'],'type':_0x29191b['type'][_0xca9d('0x3a')]};});_0x43cd9e[_0xca9d('0x3b')]=_[_0xca9d('0x3c')](_0x39462c,_0xca9d('0x37'));_0x43cd9e['query']=_['keys'](_0x5180a6[_0xca9d('0x3d')]);_0x43cd9e[_0xca9d('0x3e')]=_[_0xca9d('0x3f')](_0x43cd9e[_0xca9d('0x3b')],_0x43cd9e[_0xca9d('0x3d')]);_0x3ddf61['attributes']=_[_0xca9d('0x3f')](_0x43cd9e[_0xca9d('0x3b')],qs['fields'](_0x5180a6['query']['fields']));_0x3ddf61['attributes']=_0x3ddf61['attributes'][_0xca9d('0x40')]?_0x3ddf61[_0xca9d('0x41')]:_0x43cd9e[_0xca9d('0x3b')];if(!_0x5180a6['query'][_0xca9d('0x42')](_0xca9d('0x43'))){_0x3ddf61['limit']=qs[_0xca9d('0x2d')](_0x5180a6[_0xca9d('0x3d')][_0xca9d('0x2d')]);_0x3ddf61[_0xca9d('0x2b')]=qs['offset'](_0x5180a6[_0xca9d('0x3d')][_0xca9d('0x2b')]);}_0x3ddf61['order']=qs[_0xca9d('0x44')](_0x5180a6['query'][_0xca9d('0x44')]);_0x3ddf61['where']=qs['filters'](_[_0xca9d('0x45')](_0x5180a6[_0xca9d('0x3d')],_0x43cd9e['filters']),_0x39462c);if(_0x5180a6[_0xca9d('0x3d')][_0xca9d('0x46')]){_0x3ddf61[_0xca9d('0x47')]=_[_0xca9d('0x48')](_0x3ddf61['where'],{'$or':_[_0xca9d('0x3c')](_0x39462c,function(_0x45a6b1){if(_0x45a6b1['type']!==_0xca9d('0x49')){var _0x317e4d={};_0x317e4d[_0x45a6b1['name']]={'$like':'%'+_0x5180a6['query'][_0xca9d('0x46')]+'%'};return _0x317e4d;}})});}_0x3ddf61=_[_0xca9d('0x48')]({},_0x3ddf61,_0x5180a6[_0xca9d('0x4a')]);var _0x9a30e4={'where':_0x3ddf61[_0xca9d('0x47')]};return db[_0xca9d('0x38')]['count'](_0x9a30e4)['then'](function(_0x31f3ea){_0x274533[_0xca9d('0x2e')]=_0x31f3ea;if(_0x5180a6[_0xca9d('0x3d')][_0xca9d('0x4b')]){_0x3ddf61['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x3ddf61);})[_0xca9d('0x1f')](function(_0xdb8efd){_0x274533[_0xca9d('0x4c')]=_0xdb8efd;return _0x274533;})[_0xca9d('0x1f')](respondWithFilteredResult(_0x399adb,_0x3ddf61))[_0xca9d('0x28')](handleError(_0x399adb,null));};exports[_0xca9d('0x4d')]=function(_0x53586b,_0x78bc1a){var _0x3d82d1={'raw':!![],'where':{'id':_0x53586b[_0xca9d('0x4e')]['id']}},_0x1f3e91={};_0x1f3e91[_0xca9d('0x3b')]=_[_0xca9d('0x4f')](db[_0xca9d('0x38')]['rawAttributes']);_0x1f3e91[_0xca9d('0x3d')]=_[_0xca9d('0x4f')](_0x53586b['query']);_0x1f3e91['filters']=_[_0xca9d('0x3f')](_0x1f3e91['model'],_0x1f3e91[_0xca9d('0x3d')]);_0x3d82d1[_0xca9d('0x41')]=_[_0xca9d('0x3f')](_0x1f3e91[_0xca9d('0x3b')],qs['fields'](_0x53586b[_0xca9d('0x3d')][_0xca9d('0x50')]));_0x3d82d1[_0xca9d('0x41')]=_0x3d82d1[_0xca9d('0x41')][_0xca9d('0x40')]?_0x3d82d1[_0xca9d('0x41')]:_0x1f3e91[_0xca9d('0x3b')];if(_0x53586b[_0xca9d('0x3d')][_0xca9d('0x4b')]){_0x3d82d1[_0xca9d('0x51')]=[{'all':!![]}];}_0x3d82d1=_[_0xca9d('0x48')]({},_0x3d82d1,_0x53586b[_0xca9d('0x4a')]);return db[_0xca9d('0x38')][_0xca9d('0x52')](_0x3d82d1)['then'](handleEntityNotFound(_0x78bc1a,null))[_0xca9d('0x1f')](respondWithResult(_0x78bc1a,null))[_0xca9d('0x28')](handleError(_0x78bc1a,null));};exports[_0xca9d('0x53')]=function(_0x249e27,_0x3ca486,_0x214369){var _0x33f974;return db[_0xca9d('0x54')][_0xca9d('0x55')](function(_0x3e904f){return db[_0xca9d('0x38')][_0xca9d('0x53')](_0x249e27[_0xca9d('0x56')],{'raw':!![]})[_0xca9d('0x1f')](function(_0x4a8b34){_0x33f974=_0x4a8b34;return db['Network'][_0xca9d('0x57')]({'where':{'type':_0x249e27['body'][_0xca9d('0x58')]},'raw':!![]});})[_0xca9d('0x1f')](function(_0x496c81){if(_0x33f974[_0xca9d('0x58')]['toUpperCase']()=='STUN'){var _0x50997a=fs[_0xca9d('0x59')](path['join'](config[_0xca9d('0x5a')],'server/files/templates/stun_multiple.ejs'),_0xca9d('0x5b'));var _0x4519df=ejs[_0xca9d('0x5c')](_0x50997a,{'networks':_0x496c81||[]});fs[_0xca9d('0x5d')](_0xca9d('0x5e'),_0x4519df);return respondWithRpcPromise(_0xca9d('0x5f'),_0xca9d('0x53'),{'module':_0xca9d('0x60')});}else if(_0x33f974[_0xca9d('0x58')]['toUpperCase']()==_0xca9d('0x61')){var _0x297f94=fs['readFileSync'](path[_0xca9d('0x62')](config[_0xca9d('0x5a')],_0xca9d('0x63')),_0xca9d('0x5b'));var _0x4a8538=ejs[_0xca9d('0x5c')](_0x297f94,{'networks':_0x496c81||[]});fs[_0xca9d('0x5d')](_0xca9d('0x64'),_0x4a8538);return respondWithRpcPromise('Reload',_0xca9d('0x53'),{'module':_0xca9d('0x60')});}else{var _0x4e95b8=fs[_0xca9d('0x59')](path[_0xca9d('0x62')](config['root'],_0xca9d('0x65')),'utf8');var _0x3bf080=ejs[_0xca9d('0x5c')](_0x4e95b8,{'networks':_0x496c81||[]});fs[_0xca9d('0x5d')](util[_0xca9d('0x66')](_0xca9d('0x67'),_0x249e27['body']['type'][_0xca9d('0x68')]()),_0x3bf080);return respondWithRpcPromise(_0xca9d('0x5f'),_0xca9d('0x53'),{'module':_0xca9d('0x69')});}return null;})[_0xca9d('0x1f')](function(){return _0x33f974;});})['then'](respondWithResult(_0x3ca486,0xc9))['catch'](handleError(_0x3ca486,null));};exports[_0xca9d('0x33')]=function(_0x381903,_0x357d34,_0x4c0d23){var _0x1ec053;return db[_0xca9d('0x54')][_0xca9d('0x55')](function(_0x514cd7){return db[_0xca9d('0x38')][_0xca9d('0x52')]({'where':{'id':_0x381903['params']['id']}})['then'](handleEntityNotFound(_0x357d34,null))[_0xca9d('0x1f')](saveUpdates(_0x381903[_0xca9d('0x56')],null))[_0xca9d('0x1f')](function(_0x5ad3b1){if(_0x5ad3b1){_0x1ec053=_0x5ad3b1;return db[_0xca9d('0x38')][_0xca9d('0x57')]({'where':{'type':_0x1ec053[_0xca9d('0x58')]},'raw':!![]});}return null;})[_0xca9d('0x1f')](function(_0x1ec9c2){if(_0x1ec053[_0xca9d('0x58')][_0xca9d('0x6a')]()=='STUN'){var _0x250ad1=fs[_0xca9d('0x59')](path[_0xca9d('0x62')](config[_0xca9d('0x5a')],'server/files/templates/stun_multiple.ejs'),_0xca9d('0x5b'));var _0x3b8441=ejs[_0xca9d('0x5c')](_0x250ad1,{'networks':_0x1ec9c2||[]});fs[_0xca9d('0x5d')](_0xca9d('0x5e'),_0x3b8441);return respondWithRpcPromise(_0xca9d('0x5f'),_0xca9d('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x1ec053[_0xca9d('0x58')][_0xca9d('0x6a')]()=='TURN'){var _0xfa93a8=fs[_0xca9d('0x59')](path[_0xca9d('0x62')](config[_0xca9d('0x5a')],_0xca9d('0x63')),'utf8');var _0x5a591c=ejs[_0xca9d('0x5c')](_0xfa93a8,{'networks':_0x1ec9c2||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x5a591c);return respondWithRpcPromise(_0xca9d('0x5f'),_0xca9d('0x33'),{'module':'res_stun_monitor.so'});}else{var _0x1e7c7e=fs[_0xca9d('0x59')](path['join'](config[_0xca9d('0x5a')],_0xca9d('0x65')),'utf8');var _0x154b4a=ejs[_0xca9d('0x5c')](_0x1e7c7e,{'networks':_0x1ec9c2||[]});fs['writeFileSync'](util['format'](_0xca9d('0x67'),_0x381903[_0xca9d('0x56')][_0xca9d('0x58')]['toLowerCase']()),_0x154b4a);return respondWithRpcPromise(_0xca9d('0x5f'),_0xca9d('0x33'),{'module':_0xca9d('0x69')});}return null;})[_0xca9d('0x1f')](function(_0x3b3a78){if(_0x3b3a78){return _0x1ec053;}return null;});})[_0xca9d('0x1f')](respondWithResult(_0x357d34,null))[_0xca9d('0x28')](handleError(_0x357d34,null));};exports['destroy']=function(_0x22230f,_0x306e98,_0x52f17a){var _0x45a55d;return db[_0xca9d('0x38')][_0xca9d('0x52')]({'where':{'id':_0x22230f['params']['id']}})['then'](function(_0xb74e3f){_0x45a55d=_0xb74e3f;return _0xb74e3f;})[_0xca9d('0x1f')](handleEntityNotFound(_0x306e98,null))[_0xca9d('0x1f')](removeEntity(_0x306e98,null))['then'](function(){if(_0x45a55d){return db[_0xca9d('0x38')][_0xca9d('0x57')]({'where':{'type':_0x45a55d[_0xca9d('0x58')]},'raw':!![]});}})[_0xca9d('0x1f')](function(_0x25a794){if(_0x45a55d[_0xca9d('0x58')][_0xca9d('0x6a')]()=='STUN'){var _0xd5a7f5=fs[_0xca9d('0x59')](path[_0xca9d('0x62')](config[_0xca9d('0x5a')],_0xca9d('0x6b')),_0xca9d('0x5b'));var _0x261c7a=ejs[_0xca9d('0x5c')](_0xd5a7f5,{'networks':_0x25a794||[]});fs['writeFileSync'](_0xca9d('0x5e'),_0x261c7a);return respondWithRpcPromise(_0xca9d('0x5f'),_0xca9d('0x34'),{'module':_0xca9d('0x60')});}else if(_0x45a55d['type']['toUpperCase']()==_0xca9d('0x61')){var _0x31bf4f=fs[_0xca9d('0x59')](path[_0xca9d('0x62')](config[_0xca9d('0x5a')],_0xca9d('0x63')),'utf8');var _0x3139a8=ejs['render'](_0x31bf4f,{'networks':_0x25a794||[]});fs[_0xca9d('0x5d')](_0xca9d('0x64'),_0x3139a8);return respondWithRpcPromise(_0xca9d('0x5f'),_0xca9d('0x34'),{'module':_0xca9d('0x60')});}else{var _0x482f51=fs[_0xca9d('0x59')](path[_0xca9d('0x62')](config[_0xca9d('0x5a')],_0xca9d('0x65')),'utf8');var _0x528e95=ejs['render'](_0x482f51,{'networks':_0x25a794||[]});fs[_0xca9d('0x5d')](util[_0xca9d('0x66')](_0xca9d('0x67'),_0x22230f[_0xca9d('0x56')][_0xca9d('0x58')][_0xca9d('0x68')]()),_0x528e95);return respondWithRpcPromise('Reload',_0xca9d('0x34'),{'module':_0xca9d('0x69')});}return null;})[_0xca9d('0x28')](handleError(_0x306e98,null));}; \ No newline at end of file +var _0xa2cf=['attributes','intersection','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','options','includeAll','show','params','fields','merge','find','create','transaction','body','findAll','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','client','request','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','update','then','destroy','stack','name','index','map','Network','fieldName','type','key','model','query','keys','filters'];(function(_0x231c2c,_0x285a1a){var _0x32989a=function(_0x3341a8){while(--_0x3341a8){_0x231c2c['push'](_0x231c2c['shift']());}};_0x32989a(++_0x285a1a);}(_0xa2cf,0x15c));var _0xfa2c=function(_0x40c04b,_0x3e9a0a){_0x40c04b=_0x40c04b-0x0;var _0x562aaa=_0xa2cf[_0x40c04b];return _0x562aaa;};'use strict';var emlformat=require(_0xfa2c('0x0'));var rimraf=require(_0xfa2c('0x1'));var zipdir=require(_0xfa2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa2c('0x3'));var moment=require(_0xfa2c('0x4'));var BPromise=require(_0xfa2c('0x5'));var Mustache=require(_0xfa2c('0x6'));var util=require(_0xfa2c('0x7'));var path=require(_0xfa2c('0x8'));var sox=require(_0xfa2c('0x9'));var csv=require(_0xfa2c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa2c('0xb'));var _=require(_0xfa2c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfa2c('0xd'));var deskjs=require(_0xfa2c('0xe'));var toCsv=require(_0xfa2c('0xa'));var querystring=require(_0xfa2c('0xf'));var Papa=require(_0xfa2c('0x10'));var Redis=require('ioredis');var authService=require(_0xfa2c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfa2c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa2c('0x13'))(_0xfa2c('0x14'));var utils=require(_0xfa2c('0x15'));var config=require(_0xfa2c('0x16'));var licenseUtil=require(_0xfa2c('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xfa2c('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4091b2,_0x3605ff,_0x105582,_0x1ef93c){return new BPromise(function(_0x26e208,_0x2fa9cb){var _0x200858=_0x1ef93c||client;return _0x200858[_0xfa2c('0x19')](_0x4091b2,_0x105582)['then'](function(_0x443fdd){logger[_0xfa2c('0x1a')](_0xfa2c('0x1b'),_0x3605ff,_0xfa2c('0x1c'));logger['debug'](_0xfa2c('0x1d'),_0x3605ff,_0xfa2c('0x1c'),JSON['stringify'](_0x443fdd));if(_0x443fdd['error']){if(_0x443fdd[_0xfa2c('0x1e')][_0xfa2c('0x1f')]===0x1f4){logger[_0xfa2c('0x1e')](_0xfa2c('0x1b'),_0x3605ff,_0x443fdd[_0xfa2c('0x1e')][_0xfa2c('0x20')]);return _0x2fa9cb(_0x443fdd[_0xfa2c('0x1e')]['message']);}logger[_0xfa2c('0x1e')](_0xfa2c('0x1b'),_0x3605ff,_0x443fdd[_0xfa2c('0x1e')][_0xfa2c('0x20')]);return _0x26e208(_0x443fdd['error'][_0xfa2c('0x20')]);}else{logger[_0xfa2c('0x1a')](_0xfa2c('0x1b'),_0x3605ff,_0xfa2c('0x1c'));_0x26e208(_0x443fdd[_0xfa2c('0x21')]['message']);}})[_0xfa2c('0x22')](function(_0x588237){logger[_0xfa2c('0x1e')](_0xfa2c('0x1b'),_0x3605ff,_0x588237);_0x2fa9cb(_0x588237);});});}function respondWithStatusCode(_0x5e29aa,_0x1f5a09){_0x1f5a09=_0x1f5a09||0xcc;return function(_0x3a630b){if(_0x3a630b){return _0x5e29aa[_0xfa2c('0x23')](_0x1f5a09);}return _0x5e29aa[_0xfa2c('0x24')](_0x1f5a09)[_0xfa2c('0x25')]();};}function respondWithResult(_0x2a0812,_0x43dbae){_0x43dbae=_0x43dbae||0xc8;return function(_0xde5a3a){if(_0xde5a3a){return _0x2a0812['status'](_0x43dbae)[_0xfa2c('0x26')](_0xde5a3a);}};}function respondWithFilteredResult(_0x2ca781,_0x33035a){return function(_0x2cfb17){if(_0x2cfb17){var _0x1bb22c=typeof _0x33035a['offset']===_0xfa2c('0x27')&&typeof _0x33035a['limit']===_0xfa2c('0x27');var _0x410fbd=_0x2cfb17[_0xfa2c('0x28')];var _0x11dfa7=_0x1bb22c?0x0:_0x33035a[_0xfa2c('0x29')];var _0x3e0f68=_0x1bb22c?_0x2cfb17['count']:_0x33035a[_0xfa2c('0x29')]+_0x33035a[_0xfa2c('0x2a')];var _0x43f351;if(_0x3e0f68>=_0x410fbd){_0x3e0f68=_0x410fbd;_0x43f351=0xc8;}else{_0x43f351=0xce;}_0x2ca781['status'](_0x43f351);return _0x2ca781[_0xfa2c('0x2b')]('Content-Range',_0x11dfa7+'-'+_0x3e0f68+'/'+_0x410fbd)[_0xfa2c('0x26')](_0x2cfb17);}return null;};}function patchUpdates(_0x102988){return function(_0x1f9307){try{jsonpatch[_0xfa2c('0x2c')](_0x1f9307,_0x102988,!![]);}catch(_0x540d2a){return BPromise['reject'](_0x540d2a);}return _0x1f9307['save']();};}function saveUpdates(_0x4e7007,_0x399140){return function(_0x1b0628){if(_0x1b0628){return _0x1b0628[_0xfa2c('0x2d')](_0x4e7007)[_0xfa2c('0x2e')](function(_0x1a6372){return _0x1a6372;});}return null;};}function removeEntity(_0xdb1d52,_0x47dbf4){return function(_0x4a4f27){if(_0x4a4f27){return _0x4a4f27[_0xfa2c('0x2f')]()[_0xfa2c('0x2e')](function(){_0xdb1d52[_0xfa2c('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cd4e1,_0x297ab1){return function(_0x38a313){if(!_0x38a313){_0x2cd4e1[_0xfa2c('0x23')](0x194);}return _0x38a313;};}function handleError(_0x33ff49,_0x1210d5){_0x1210d5=_0x1210d5||0x1f4;return function(_0x508789){logger['error'](_0x508789[_0xfa2c('0x30')]);if(_0x508789[_0xfa2c('0x31')]){delete _0x508789['name'];}_0x33ff49[_0xfa2c('0x24')](_0x1210d5)['send'](_0x508789);};}exports[_0xfa2c('0x32')]=function(_0x2b31dc,_0x59357b){var _0x555616={},_0x1c077a={},_0x36e8f9={'count':0x0,'rows':[]};var _0x5f02a2=_[_0xfa2c('0x33')](db[_0xfa2c('0x34')]['rawAttributes'],function(_0x5cf3d6){return{'name':_0x5cf3d6[_0xfa2c('0x35')],'type':_0x5cf3d6[_0xfa2c('0x36')][_0xfa2c('0x37')]};});_0x1c077a[_0xfa2c('0x38')]=_[_0xfa2c('0x33')](_0x5f02a2,_0xfa2c('0x31'));_0x1c077a[_0xfa2c('0x39')]=_[_0xfa2c('0x3a')](_0x2b31dc[_0xfa2c('0x39')]);_0x1c077a[_0xfa2c('0x3b')]=_['intersection'](_0x1c077a[_0xfa2c('0x38')],_0x1c077a[_0xfa2c('0x39')]);_0x555616[_0xfa2c('0x3c')]=_[_0xfa2c('0x3d')](_0x1c077a[_0xfa2c('0x38')],qs['fields'](_0x2b31dc['query']['fields']));_0x555616[_0xfa2c('0x3c')]=_0x555616[_0xfa2c('0x3c')][_0xfa2c('0x3e')]?_0x555616[_0xfa2c('0x3c')]:_0x1c077a[_0xfa2c('0x38')];if(!_0x2b31dc[_0xfa2c('0x39')][_0xfa2c('0x3f')](_0xfa2c('0x40'))){_0x555616[_0xfa2c('0x2a')]=qs[_0xfa2c('0x2a')](_0x2b31dc[_0xfa2c('0x39')][_0xfa2c('0x2a')]);_0x555616[_0xfa2c('0x29')]=qs['offset'](_0x2b31dc[_0xfa2c('0x39')][_0xfa2c('0x29')]);}_0x555616[_0xfa2c('0x41')]=qs['sort'](_0x2b31dc[_0xfa2c('0x39')]['sort']);_0x555616['where']=qs[_0xfa2c('0x3b')](_[_0xfa2c('0x42')](_0x2b31dc[_0xfa2c('0x39')],_0x1c077a[_0xfa2c('0x3b')]),_0x5f02a2);if(_0x2b31dc[_0xfa2c('0x39')][_0xfa2c('0x43')]){_0x555616['where']=_['merge'](_0x555616[_0xfa2c('0x44')],{'$or':_[_0xfa2c('0x33')](_0x5f02a2,function(_0x142d31){if(_0x142d31['type']!==_0xfa2c('0x45')){var _0x1b7436={};_0x1b7436[_0x142d31[_0xfa2c('0x31')]]={'$like':'%'+_0x2b31dc[_0xfa2c('0x39')][_0xfa2c('0x43')]+'%'};return _0x1b7436;}})});}_0x555616=_['merge']({},_0x555616,_0x2b31dc[_0xfa2c('0x46')]);var _0x32443={'where':_0x555616[_0xfa2c('0x44')]};return db[_0xfa2c('0x34')]['count'](_0x32443)[_0xfa2c('0x2e')](function(_0x2b6bdd){_0x36e8f9[_0xfa2c('0x28')]=_0x2b6bdd;if(_0x2b31dc['query'][_0xfa2c('0x47')]){_0x555616['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x555616);})[_0xfa2c('0x2e')](function(_0x26f292){_0x36e8f9['rows']=_0x26f292;return _0x36e8f9;})[_0xfa2c('0x2e')](respondWithFilteredResult(_0x59357b,_0x555616))[_0xfa2c('0x22')](handleError(_0x59357b,null));};exports[_0xfa2c('0x48')]=function(_0x100076,_0x14dad9){var _0x532386={'raw':!![],'where':{'id':_0x100076[_0xfa2c('0x49')]['id']}},_0x201913={};_0x201913[_0xfa2c('0x38')]=_[_0xfa2c('0x3a')](db[_0xfa2c('0x34')]['rawAttributes']);_0x201913[_0xfa2c('0x39')]=_[_0xfa2c('0x3a')](_0x100076[_0xfa2c('0x39')]);_0x201913['filters']=_[_0xfa2c('0x3d')](_0x201913[_0xfa2c('0x38')],_0x201913[_0xfa2c('0x39')]);_0x532386[_0xfa2c('0x3c')]=_[_0xfa2c('0x3d')](_0x201913[_0xfa2c('0x38')],qs[_0xfa2c('0x4a')](_0x100076[_0xfa2c('0x39')][_0xfa2c('0x4a')]));_0x532386[_0xfa2c('0x3c')]=_0x532386[_0xfa2c('0x3c')][_0xfa2c('0x3e')]?_0x532386['attributes']:_0x201913[_0xfa2c('0x38')];if(_0x100076[_0xfa2c('0x39')]['includeAll']){_0x532386['include']=[{'all':!![]}];}_0x532386=_[_0xfa2c('0x4b')]({},_0x532386,_0x100076[_0xfa2c('0x46')]);return db[_0xfa2c('0x34')][_0xfa2c('0x4c')](_0x532386)[_0xfa2c('0x2e')](handleEntityNotFound(_0x14dad9,null))['then'](respondWithResult(_0x14dad9,null))[_0xfa2c('0x22')](handleError(_0x14dad9,null));};exports[_0xfa2c('0x4d')]=function(_0x43a76e,_0x2b7ece,_0x4b7605){var _0x49ec5c;return db['sequelize'][_0xfa2c('0x4e')](function(_0x1784cf){return db[_0xfa2c('0x34')][_0xfa2c('0x4d')](_0x43a76e[_0xfa2c('0x4f')],{'raw':!![]})['then'](function(_0x346fc8){_0x49ec5c=_0x346fc8;return db[_0xfa2c('0x34')][_0xfa2c('0x50')]({'where':{'type':_0x43a76e[_0xfa2c('0x4f')][_0xfa2c('0x36')]},'raw':!![]});})[_0xfa2c('0x2e')](function(_0x23b8d7){if(_0x49ec5c[_0xfa2c('0x36')]['toUpperCase']()==_0xfa2c('0x51')){var _0x420db7=fs[_0xfa2c('0x52')](path['join'](config[_0xfa2c('0x53')],_0xfa2c('0x54')),_0xfa2c('0x55'));var _0x38207f=ejs[_0xfa2c('0x56')](_0x420db7,{'networks':_0x23b8d7||[]});fs[_0xfa2c('0x57')](_0xfa2c('0x58'),_0x38207f);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x4d'),{'module':_0xfa2c('0x5a')});}else if(_0x49ec5c[_0xfa2c('0x36')][_0xfa2c('0x5b')]()==_0xfa2c('0x5c')){var _0x48c26b=fs[_0xfa2c('0x52')](path[_0xfa2c('0x5d')](config[_0xfa2c('0x53')],_0xfa2c('0x5e')),_0xfa2c('0x55'));var _0x3d13fc=ejs[_0xfa2c('0x56')](_0x48c26b,{'networks':_0x23b8d7||[]});fs[_0xfa2c('0x57')](_0xfa2c('0x5f'),_0x3d13fc);return respondWithRpcPromise('Reload',_0xfa2c('0x4d'),{'module':_0xfa2c('0x5a')});}else{var _0x5c06bc=fs[_0xfa2c('0x52')](path[_0xfa2c('0x5d')](config[_0xfa2c('0x53')],_0xfa2c('0x60')),_0xfa2c('0x55'));var _0x541e51=ejs['render'](_0x5c06bc,{'networks':_0x23b8d7||[]});fs[_0xfa2c('0x57')](util[_0xfa2c('0x61')](_0xfa2c('0x62'),_0x43a76e[_0xfa2c('0x4f')][_0xfa2c('0x36')][_0xfa2c('0x63')]()),_0x541e51);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x4d'),{'module':_0xfa2c('0x64')});}return null;})[_0xfa2c('0x2e')](function(){return _0x49ec5c;});})[_0xfa2c('0x2e')](respondWithResult(_0x2b7ece,0xc9))[_0xfa2c('0x22')](handleError(_0x2b7ece,null));};exports['update']=function(_0x571476,_0x290b7d,_0x1adbd2){var _0x4ff9fb;return db[_0xfa2c('0x65')][_0xfa2c('0x4e')](function(_0x2db125){return db[_0xfa2c('0x34')][_0xfa2c('0x4c')]({'where':{'id':_0x571476[_0xfa2c('0x49')]['id']}})[_0xfa2c('0x2e')](handleEntityNotFound(_0x290b7d,null))[_0xfa2c('0x2e')](saveUpdates(_0x571476[_0xfa2c('0x4f')],null))['then'](function(_0x4d07fe){if(_0x4d07fe){_0x4ff9fb=_0x4d07fe;return db[_0xfa2c('0x34')]['findAll']({'where':{'type':_0x4ff9fb['type']},'raw':!![]});}return null;})[_0xfa2c('0x2e')](function(_0x1d532f){if(_0x4ff9fb[_0xfa2c('0x36')][_0xfa2c('0x5b')]()==_0xfa2c('0x51')){var _0x1f473f=fs[_0xfa2c('0x52')](path['join'](config[_0xfa2c('0x53')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x2ce311=ejs[_0xfa2c('0x56')](_0x1f473f,{'networks':_0x1d532f||[]});fs[_0xfa2c('0x57')](_0xfa2c('0x58'),_0x2ce311);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x2d'),{'module':_0xfa2c('0x5a')});}else if(_0x4ff9fb[_0xfa2c('0x36')]['toUpperCase']()==_0xfa2c('0x5c')){var _0x14eb0e=fs[_0xfa2c('0x52')](path[_0xfa2c('0x5d')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x20f324=ejs['render'](_0x14eb0e,{'networks':_0x1d532f||[]});fs['writeFileSync'](_0xfa2c('0x5f'),_0x20f324);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x2d'),{'module':_0xfa2c('0x5a')});}else{var _0x289c64=fs['readFileSync'](path[_0xfa2c('0x5d')](config[_0xfa2c('0x53')],_0xfa2c('0x60')),'utf8');var _0x1877ab=ejs[_0xfa2c('0x56')](_0x289c64,{'networks':_0x1d532f||[]});fs['writeFileSync'](util[_0xfa2c('0x61')](_0xfa2c('0x62'),_0x571476[_0xfa2c('0x4f')][_0xfa2c('0x36')][_0xfa2c('0x63')]()),_0x1877ab);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x2d'),{'module':_0xfa2c('0x64')});}return null;})['then'](function(_0x3bc71d){if(_0x3bc71d){return _0x4ff9fb;}return null;});})['then'](respondWithResult(_0x290b7d,null))[_0xfa2c('0x22')](handleError(_0x290b7d,null));};exports['destroy']=function(_0x593722,_0x304481,_0xa790a8){var _0x5648ad;return db[_0xfa2c('0x34')][_0xfa2c('0x4c')]({'where':{'id':_0x593722[_0xfa2c('0x49')]['id']}})[_0xfa2c('0x2e')](function(_0x4bf5b0){_0x5648ad=_0x4bf5b0;return _0x4bf5b0;})['then'](handleEntityNotFound(_0x304481,null))[_0xfa2c('0x2e')](removeEntity(_0x304481,null))[_0xfa2c('0x2e')](function(){if(_0x5648ad){return db['Network'][_0xfa2c('0x50')]({'where':{'type':_0x5648ad[_0xfa2c('0x36')]},'raw':!![]});}})[_0xfa2c('0x2e')](function(_0x11fd91){if(_0x5648ad[_0xfa2c('0x36')][_0xfa2c('0x5b')]()==_0xfa2c('0x51')){var _0x4ad9c5=fs[_0xfa2c('0x52')](path[_0xfa2c('0x5d')](config[_0xfa2c('0x53')],_0xfa2c('0x54')),_0xfa2c('0x55'));var _0x3d9d01=ejs['render'](_0x4ad9c5,{'networks':_0x11fd91||[]});fs[_0xfa2c('0x57')](_0xfa2c('0x58'),_0x3d9d01);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x2f'),{'module':_0xfa2c('0x5a')});}else if(_0x5648ad[_0xfa2c('0x36')]['toUpperCase']()==_0xfa2c('0x5c')){var _0x5dc469=fs[_0xfa2c('0x52')](path['join'](config[_0xfa2c('0x53')],'server/files/templates/turn_multiple.ejs'),_0xfa2c('0x55'));var _0x270743=ejs[_0xfa2c('0x56')](_0x5dc469,{'networks':_0x11fd91||[]});fs[_0xfa2c('0x57')](_0xfa2c('0x5f'),_0x270743);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x2f'),{'module':_0xfa2c('0x5a')});}else{var _0x287fc1=fs[_0xfa2c('0x52')](path[_0xfa2c('0x5d')](config['root'],'server/files/templates/network.ejs'),_0xfa2c('0x55'));var _0x4e6aaa=ejs[_0xfa2c('0x56')](_0x287fc1,{'networks':_0x11fd91||[]});fs['writeFileSync'](util[_0xfa2c('0x61')]('/etc/asterisk/sip_xcally_%s.conf',_0x593722['body']['type']['toLowerCase']()),_0x4e6aaa);return respondWithRpcPromise(_0xfa2c('0x59'),_0xfa2c('0x2f'),{'module':'chan_sip.so'});}return null;})[_0xfa2c('0x22')](handleError(_0x304481,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index fd3a56e..f7e3d0c 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 _0x01fe=['../../config/environment','exports','define','Network','network','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3d3fa5,_0x5be144){var _0x5a1a7a=function(_0x2949ee){while(--_0x2949ee){_0x3d3fa5['push'](_0x3d3fa5['shift']());}};_0x5a1a7a(++_0x5be144);}(_0x01fe,0x102));var _0xe01f=function(_0x324101,_0x12e190){_0x324101=_0x324101-0x0;var _0x3088cd=_0x01fe[_0x324101];return _0x3088cd;};'use strict';var _=require(_0xe01f('0x0'));var util=require('util');var logger=require(_0xe01f('0x1'))(_0xe01f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe01f('0x3'));var fs=require('fs');var path=require(_0xe01f('0x4'));var rimraf=require(_0xe01f('0x5'));var config=require(_0xe01f('0x6'));var attributes=require('./network.attributes');module[_0xe01f('0x7')]=function(_0x574969,_0x3effc4){return _0x574969[_0xe01f('0x8')](_0xe01f('0x9'),attributes,{'tableName':_0xe01f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6324=['define','network','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x25ac34,_0x1ca0b0){var _0x13c217=function(_0x616d07){while(--_0x616d07){_0x25ac34['push'](_0x25ac34['shift']());}};_0x13c217(++_0x1ca0b0);}(_0x6324,0x142));var _0x4632=function(_0x2b5d39,_0x55a5f2){_0x2b5d39=_0x2b5d39-0x0;var _0x3917c4=_0x6324[_0x2b5d39];return _0x3917c4;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var moment=require('moment');var BPromise=require(_0x4632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4632('0x5'));var rimraf=require('rimraf');var config=require(_0x4632('0x6'));var attributes=require('./network.attributes');module[_0x4632('0x7')]=function(_0x24aba6,_0x1f3077){return _0x24aba6[_0x4632('0x8')]('Network',attributes,{'tableName':_0x4632('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index ff9f0d3..4d7937d 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x4eaac5,_0x40c4ac){_0x4eaac5=_0x4eaac5-0x0;var _0x1cab7a=_0x7a54[_0x4eaac5];return _0x1cab7a;};'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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5f4dad,_0x4e5b70){var _0x4060dd=function(_0x1a2d34){while(--_0x1a2d34){_0x5f4dad['push'](_0x5f4dad['shift']());}};_0x4060dd(++_0x4e5b70);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index ce95d18..66e6380 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 _0x8739=['delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','post','create','/:id/dispositions','/:id/notify','notify','/:id/applications','addApplications','/:id/users','addAgents','/:id/send','put'];(function(_0x42e611,_0x478ece){var _0x18b584=function(_0x90799b){while(--_0x90799b){_0x42e611['push'](_0x42e611['shift']());}};_0x18b584(++_0x478ece);}(_0x8739,0x1e7));var _0x9873=function(_0x3f2aa4,_0x3181e0){_0x3f2aa4=_0x3f2aa4-0x0;var _0x272bd9=_0x8739[_0x3f2aa4];return _0x272bd9;};'use strict';var multer=require(_0x9873('0x0'));var util=require(_0x9873('0x1'));var path=require('path');var timeout=require(_0x9873('0x2'));var express=require(_0x9873('0x3'));var router=express['Router']();var fs_extra=require(_0x9873('0x4'));var auth=require(_0x9873('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9873('0x6'));var controller=require(_0x9873('0x7'));router[_0x9873('0x8')]('/',auth['isAuthenticated'](),controller[_0x9873('0x9')]);router[_0x9873('0x8')](_0x9873('0xa'),auth[_0x9873('0xb')](),controller[_0x9873('0xc')]);router[_0x9873('0x8')](_0x9873('0xd'),auth[_0x9873('0xb')](),controller['show']);router[_0x9873('0x8')]('/:id/dispositions',auth[_0x9873('0xb')](),controller[_0x9873('0xe')]);router[_0x9873('0x8')](_0x9873('0xf'),auth[_0x9873('0xb')](),controller[_0x9873('0x10')]);router[_0x9873('0x8')]('/:id/applications',auth[_0x9873('0xb')](),controller[_0x9873('0x11')]);router[_0x9873('0x8')](_0x9873('0x12'),auth[_0x9873('0xb')](),controller[_0x9873('0x13')]);router[_0x9873('0x8')]('/:id/users',auth[_0x9873('0xb')](),controller['getAgents']);router[_0x9873('0x14')]('/',auth[_0x9873('0xb')](),controller[_0x9873('0x15')]);router[_0x9873('0x14')](_0x9873('0x16'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x9873('0xf'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x9873('0x14')](_0x9873('0x17'),controller[_0x9873('0x18')]);router['post'](_0x9873('0x19'),auth[_0x9873('0xb')](),controller[_0x9873('0x1a')]);router[_0x9873('0x14')](_0x9873('0x1b'),auth[_0x9873('0xb')](),controller[_0x9873('0x1c')]);router[_0x9873('0x14')](_0x9873('0x1d'),auth[_0x9873('0xb')](),controller['send']);router[_0x9873('0x1e')](_0x9873('0xd'),auth[_0x9873('0xb')](),controller['update']);router[_0x9873('0x1f')](_0x9873('0xd'),auth[_0x9873('0xb')](),controller[_0x9873('0x20')]);router[_0x9873('0x1f')](_0x9873('0x16'),auth['isAuthenticated'](),controller[_0x9873('0x21')]);router['delete'](_0x9873('0xf'),auth['isAuthenticated'](),controller[_0x9873('0x22')]);router[_0x9873('0x1f')]('/:id/users',auth[_0x9873('0xb')](),controller[_0x9873('0x23')]);module[_0x9873('0x24')]=router; \ No newline at end of file +var _0x5fc9=['post','create','addAnswer','addApplications','/:id/users','addAgents','/:id/send','put','update','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x5fc9,0x1e1));var _0x95fc=function(_0x591def,_0x58d2e1){_0x591def=_0x591def-0x0;var _0x1e0f1c=_0x5fc9[_0x591def];return _0x1e0f1c;};'use strict';var multer=require(_0x95fc('0x0'));var util=require(_0x95fc('0x1'));var path=require(_0x95fc('0x2'));var timeout=require(_0x95fc('0x3'));var express=require(_0x95fc('0x4'));var router=express[_0x95fc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x95fc('0x6'));var interaction=require(_0x95fc('0x7'));var config=require(_0x95fc('0x8'));var controller=require(_0x95fc('0x9'));router[_0x95fc('0xa')]('/',auth[_0x95fc('0xb')](),controller[_0x95fc('0xc')]);router['get'](_0x95fc('0xd'),auth[_0x95fc('0xb')](),controller[_0x95fc('0xe')]);router[_0x95fc('0xa')](_0x95fc('0xf'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x10')]);router[_0x95fc('0xa')](_0x95fc('0x11'),auth['isAuthenticated'](),controller[_0x95fc('0x12')]);router[_0x95fc('0xa')](_0x95fc('0x13'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x14')]);router[_0x95fc('0xa')](_0x95fc('0x15'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x16')]);router[_0x95fc('0xa')](_0x95fc('0x17'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x18')]);router[_0x95fc('0xa')]('/:id/users',auth[_0x95fc('0xb')](),controller[_0x95fc('0x19')]);router[_0x95fc('0x1a')]('/',auth[_0x95fc('0xb')](),controller[_0x95fc('0x1b')]);router[_0x95fc('0x1a')]('/:id/dispositions',auth[_0x95fc('0xb')](),controller['addDisposition']);router['post'](_0x95fc('0x13'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x1c')]);router[_0x95fc('0x1a')]('/:id/notify',controller['notify']);router[_0x95fc('0x1a')](_0x95fc('0x15'),auth['isAuthenticated'](),controller[_0x95fc('0x1d')]);router['post'](_0x95fc('0x1e'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x1f')]);router[_0x95fc('0x1a')](_0x95fc('0x20'),auth[_0x95fc('0xb')](),controller['send']);router[_0x95fc('0x21')](_0x95fc('0xf'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x22')]);router[_0x95fc('0x23')](_0x95fc('0xf'),auth[_0x95fc('0xb')](),controller['destroy']);router[_0x95fc('0x23')](_0x95fc('0x11'),auth[_0x95fc('0xb')](),controller['removeDispositions']);router[_0x95fc('0x23')](_0x95fc('0x13'),auth[_0x95fc('0xb')](),controller[_0x95fc('0x24')]);router[_0x95fc('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x95fc('0x25')]);module[_0x95fc('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index fe246d8..732277c 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 _0xe9c7=['mandatoryDisposition','sequelize','randomstring','STRING','name','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','mandatoryDispositionPauseId','setDataValue'];(function(_0x2a0824,_0x21d97a){var _0x1a78f7=function(_0x517c4a){while(--_0x517c4a){_0x2a0824['push'](_0x2a0824['shift']());}};_0x1a78f7(++_0x21d97a);}(_0xe9c7,0x139));var _0x7e9c=function(_0x5c1222,_0x52c6a5){_0x5c1222=_0x5c1222-0x0;var _0x2aa574=_0xe9c7[_0x5c1222];return _0x2aa574;};'use strict';var Sequelize=require(_0x7e9c('0x0'));var rs=require(_0x7e9c('0x1'));module['exports']={'name':{'type':Sequelize[_0x7e9c('0x2')],'unique':_0x7e9c('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x7e9c('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7e9c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7e9c('0x4')],'defaultValue':function(){return _0x7e9c('0x5');}},'notificationSound':{'type':Sequelize[_0x7e9c('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7e9c('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7e9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7e9c('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7e9c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7e9c('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x7e9c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7e9c('0x6')],'defaultValue':![],'comment':_0x7e9c('0x9'),'set':function(_0x494ea8){if(!_0x494ea8)this['setDataValue'](_0x7e9c('0xa'),null);this[_0x7e9c('0xb')](_0x7e9c('0xc'),_0x494ea8);}}}; \ No newline at end of file +var _0xdfe1=['exports','STRING','name','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x3aa817,_0x3853c0){var _0x45600c=function(_0x8db643){while(--_0x8db643){_0x3aa817['push'](_0x3aa817['shift']());}};_0x45600c(++_0x3853c0);}(_0xdfe1,0x16b));var _0x1dfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfe1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x1dfe('0x0')]={'name':{'type':Sequelize[_0x1dfe('0x1')],'unique':_0x1dfe('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1dfe('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1dfe('0x3')]();}},'replyUri':{'type':Sequelize[_0x1dfe('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1dfe('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1dfe('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1dfe('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1dfe('0x1')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1dfe('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1dfe('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1dfe('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1dfe('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1dfe('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x1dfe('0x4')],'defaultValue':![],'comment':_0x1dfe('0x7'),'set':function(_0x118301){if(!_0x118301)this['setDataValue'](_0x1dfe('0x8'),null);this[_0x1dfe('0x9')](_0x1dfe('0xa'),_0x118301);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 3ad80f9..ea82870 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 _0x9135=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','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','OpenchannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','applications','list','List','priority','account','contact','firstName','threadId','OpenchannelInteraction','externalUrl','lastName','messageId','interaction','created','autoclose','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','send','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','push','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9135,0x185));var _0x5913=function(_0x5825c1,_0x5a4958){_0x5825c1=_0x5825c1-0x0;var _0xc04c7e=_0x9135[_0x5825c1];return _0xc04c7e;};'use strict';var emlformat=require(_0x5913('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5913('0x1'));var jsonpatch=require(_0x5913('0x2'));var rp=require('request-promise');var moment=require(_0x5913('0x3'));var BPromise=require(_0x5913('0x4'));var Mustache=require(_0x5913('0x5'));var util=require(_0x5913('0x6'));var path=require(_0x5913('0x7'));var sox=require(_0x5913('0x8'));var csv=require(_0x5913('0x9'));var ejs=require(_0x5913('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5913('0xb'));var squel=require(_0x5913('0xc'));var crypto=require('crypto');var jsforce=require(_0x5913('0xd'));var deskjs=require(_0x5913('0xe'));var toCsv=require(_0x5913('0x9'));var querystring=require(_0x5913('0xf'));var Papa=require('papaparse');var Redis=require(_0x5913('0x10'));var authService=require(_0x5913('0x11'));var qs=require(_0x5913('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5913('0x13'));var logger=require(_0x5913('0x14'))(_0x5913('0x15'));var utils=require(_0x5913('0x16'));var config=require(_0x5913('0x17'));var licenseUtil=require(_0x5913('0x18'));var db=require(_0x5913('0x19'))['db'];config[_0x5913('0x1a')]=_[_0x5913('0x1b')](config[_0x5913('0x1a')],{'host':_0x5913('0x1c'),'port':0x18eb});var socket=require(_0x5913('0x1d'))(new Redis(config[_0x5913('0x1a')]));require(_0x5913('0x1e'))[_0x5913('0x1f')](socket);var jayson=require(_0x5913('0x20'));var client=jayson[_0x5913('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x5913('0x21')][_0x5913('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x562b86,_0x5d4456,_0x46f137,_0x10f287){return new BPromise(function(_0x4c392f,_0x1b77ae){var _0x5e1a33=_0x10f287||client;return _0x5e1a33[_0x5913('0x23')](_0x562b86,_0x46f137)[_0x5913('0x24')](function(_0x2fb2fc){logger['info'](_0x5913('0x25'),_0x5d4456,_0x5913('0x26'));logger[_0x5913('0x27')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5d4456,_0x5913('0x26'),JSON[_0x5913('0x28')](_0x2fb2fc));if(_0x2fb2fc[_0x5913('0x29')]){if(_0x2fb2fc['error'][_0x5913('0x2a')]===0x1f4){logger[_0x5913('0x29')](_0x5913('0x25'),_0x5d4456,_0x2fb2fc[_0x5913('0x29')][_0x5913('0x2b')]);return _0x1b77ae(_0x2fb2fc[_0x5913('0x29')]['message']);}logger['error'](_0x5913('0x25'),_0x5d4456,_0x2fb2fc[_0x5913('0x29')][_0x5913('0x2b')]);return _0x4c392f(_0x2fb2fc[_0x5913('0x29')][_0x5913('0x2b')]);}else{logger[_0x5913('0x2c')](_0x5913('0x25'),_0x5d4456,_0x5913('0x26'));_0x4c392f(_0x2fb2fc[_0x5913('0x2d')][_0x5913('0x2b')]);}})[_0x5913('0x2e')](function(_0x415dde){logger['error'](_0x5913('0x25'),_0x5d4456,_0x415dde);_0x1b77ae(_0x415dde);});});}function respondWithStatusCode(_0x4dc782,_0x471546){_0x471546=_0x471546||0xcc;return function(_0x54ac8f){if(_0x54ac8f){return _0x4dc782[_0x5913('0x2f')](_0x471546);}return _0x4dc782[_0x5913('0x30')](_0x471546)[_0x5913('0x31')]();};}function respondWithResult(_0x244534,_0x3005af){_0x3005af=_0x3005af||0xc8;return function(_0x25164f){if(_0x25164f){return _0x244534[_0x5913('0x30')](_0x3005af)[_0x5913('0x32')](_0x25164f);}};}function respondWithFilteredResult(_0x3e9e86,_0xd095c3){return function(_0x9e1862){if(_0x9e1862){var _0x303d9a=typeof _0xd095c3[_0x5913('0x33')]===_0x5913('0x34')&&typeof _0xd095c3[_0x5913('0x35')]==='undefined';var _0x54c465=_0x9e1862['count'];var _0x399d3d=_0x303d9a?0x0:_0xd095c3[_0x5913('0x33')];var _0x23882d=_0x303d9a?_0x9e1862[_0x5913('0x36')]:_0xd095c3[_0x5913('0x33')]+_0xd095c3[_0x5913('0x35')];var _0x560fde;if(_0x23882d>=_0x54c465){_0x23882d=_0x54c465;_0x560fde=0xc8;}else{_0x560fde=0xce;}_0x3e9e86[_0x5913('0x30')](_0x560fde);return _0x3e9e86[_0x5913('0x37')](_0x5913('0x38'),_0x399d3d+'-'+_0x23882d+'/'+_0x54c465)[_0x5913('0x32')](_0x9e1862);}return null;};}function patchUpdates(_0x2d119a){return function(_0x424801){try{jsonpatch[_0x5913('0x39')](_0x424801,_0x2d119a,!![]);}catch(_0x563006){return BPromise['reject'](_0x563006);}return _0x424801[_0x5913('0x3a')]();};}function saveUpdates(_0x1c8e93,_0x38c9cb){return function(_0x563e80){if(_0x563e80){return _0x563e80[_0x5913('0x3b')](_0x1c8e93)[_0x5913('0x24')](function(_0x49fe9b){return _0x49fe9b;});}return null;};}function removeEntity(_0x202370,_0x9d4f51){return function(_0x116068){if(_0x116068){return _0x116068[_0x5913('0x3c')]()['then'](function(){var _0x4cfbb6=_0x116068[_0x5913('0x3d')]({'plain':!![]});var _0x12dc92=_0x5913('0x3e');return db[_0x5913('0x3f')][_0x5913('0x3c')]({'where':{'type':_0x12dc92,'resourceId':_0x4cfbb6['id']}})[_0x5913('0x24')](function(){return _0x116068;});})[_0x5913('0x24')](function(){_0x202370[_0x5913('0x30')](0xcc)[_0x5913('0x31')]();});}};}function handleEntityNotFound(_0x873898,_0x573a69){return function(_0x414584){if(!_0x414584){_0x873898[_0x5913('0x2f')](0x194);}return _0x414584;};}function handleError(_0x2dea48,_0x44328d){_0x44328d=_0x44328d||0x1f4;return function(_0x3fc6d4){logger[_0x5913('0x29')](_0x3fc6d4[_0x5913('0x40')]);if(_0x3fc6d4[_0x5913('0x41')]){delete _0x3fc6d4[_0x5913('0x41')];}_0x2dea48[_0x5913('0x30')](_0x44328d)['send'](_0x3fc6d4);};}exports['index']=function(_0x472c72,_0x1e26f2){var _0x3cc206={'include':[{'model':db[_0x5913('0x42')],'as':_0x5913('0x43')}]},_0x11f9f8={},_0x25c679={'count':0x0,'rows':[]};var _0x2a3e37=_[_0x5913('0x44')](db[_0x5913('0x45')][_0x5913('0x46')],function(_0x87c14){return{'name':_0x87c14['fieldName'],'type':_0x87c14[_0x5913('0x47')]['key']};});_0x11f9f8[_0x5913('0x48')]=_['map'](_0x2a3e37,_0x5913('0x41'));_0x11f9f8[_0x5913('0x49')]=_[_0x5913('0x4a')](_0x472c72['query']);_0x11f9f8[_0x5913('0x4b')]=_[_0x5913('0x4c')](_0x11f9f8[_0x5913('0x48')],_0x11f9f8[_0x5913('0x49')]);_0x3cc206['attributes']=_['intersection'](_0x11f9f8[_0x5913('0x48')],qs[_0x5913('0x4d')](_0x472c72[_0x5913('0x49')]['fields']));_0x3cc206[_0x5913('0x4e')]=_0x3cc206[_0x5913('0x4e')]['length']?_0x3cc206[_0x5913('0x4e')]:_0x11f9f8[_0x5913('0x48')];if(!_0x472c72[_0x5913('0x49')][_0x5913('0x4f')](_0x5913('0x50'))){_0x3cc206[_0x5913('0x35')]=qs[_0x5913('0x35')](_0x472c72[_0x5913('0x49')][_0x5913('0x35')]);_0x3cc206[_0x5913('0x33')]=qs[_0x5913('0x33')](_0x472c72[_0x5913('0x49')][_0x5913('0x33')]);}_0x3cc206['order']=qs[_0x5913('0x51')](_0x472c72[_0x5913('0x49')]['sort']);_0x3cc206[_0x5913('0x52')]=qs[_0x5913('0x4b')](_[_0x5913('0x53')](_0x472c72[_0x5913('0x49')],_0x11f9f8[_0x5913('0x4b')]),_0x2a3e37);if(_0x472c72['query'][_0x5913('0x54')]){_0x3cc206[_0x5913('0x52')]=_[_0x5913('0x55')](_0x3cc206[_0x5913('0x52')],{'$or':_[_0x5913('0x44')](_0x2a3e37,function(_0x26a8b2){if(_0x26a8b2[_0x5913('0x47')]!==_0x5913('0x56')){var _0x3038d1={};_0x3038d1[_0x26a8b2[_0x5913('0x41')]]={'$like':'%'+_0x472c72[_0x5913('0x49')][_0x5913('0x54')]+'%'};return _0x3038d1;}})});}_0x3cc206=_[_0x5913('0x55')]({},_0x3cc206,_0x472c72[_0x5913('0x57')]);var _0x219b19={'where':_0x3cc206[_0x5913('0x52')]};return db[_0x5913('0x45')][_0x5913('0x36')](_0x219b19)[_0x5913('0x24')](function(_0x534477){_0x25c679['count']=_0x534477;if(_0x472c72[_0x5913('0x49')][_0x5913('0x58')]){_0x3cc206[_0x5913('0x59')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x5913('0x5a')](_0x3cc206);})[_0x5913('0x24')](function(_0x374b59){_0x25c679['rows']=_0x374b59;return _0x25c679;})['then'](respondWithFilteredResult(_0x1e26f2,_0x3cc206))[_0x5913('0x2e')](handleError(_0x1e26f2,null));};exports[_0x5913('0x5b')]=function(_0x3c7b4c,_0x16d4fb){var _0x549c29={'raw':![],'where':{'id':_0x3c7b4c[_0x5913('0x5c')]['id']},'include':[{'model':db[_0x5913('0x42')],'as':_0x5913('0x43')}]},_0x37f29e={};_0x37f29e[_0x5913('0x48')]=_[_0x5913('0x4a')](db[_0x5913('0x45')]['rawAttributes']);_0x37f29e['query']=_[_0x5913('0x4a')](_0x3c7b4c[_0x5913('0x49')]);_0x37f29e[_0x5913('0x4b')]=_[_0x5913('0x4c')](_0x37f29e[_0x5913('0x48')],_0x37f29e[_0x5913('0x49')]);_0x549c29[_0x5913('0x4e')]=_[_0x5913('0x4c')](_0x37f29e['model'],qs[_0x5913('0x4d')](_0x3c7b4c[_0x5913('0x49')][_0x5913('0x4d')]));_0x549c29['attributes']=_0x549c29['attributes'][_0x5913('0x5d')]?_0x549c29[_0x5913('0x4e')]:_0x37f29e[_0x5913('0x48')];if(_0x3c7b4c[_0x5913('0x49')][_0x5913('0x58')]){_0x549c29[_0x5913('0x59')]=[{'all':!![]}];}_0x549c29=_[_0x5913('0x55')]({},_0x549c29,_0x3c7b4c[_0x5913('0x57')]);return db[_0x5913('0x45')][_0x5913('0x5e')](_0x549c29)[_0x5913('0x24')](handleEntityNotFound(_0x16d4fb,null))['then'](respondWithResult(_0x16d4fb,null))['catch'](handleError(_0x16d4fb,null));};exports[_0x5913('0x5f')]=function(_0x2bc8d9,_0x14a597){return db['OpenchannelAccount'][_0x5913('0x5f')](_0x2bc8d9[_0x5913('0x60')],{})[_0x5913('0x24')](function(_0x22e93c){var _0x9552de=_0x2bc8d9[_0x5913('0x61')][_0x5913('0x3d')]({'plain':!![]});if(!_0x9552de)throw new Error(_0x5913('0x62'));if(_0x9552de[_0x5913('0x63')]===_0x5913('0x61')){var _0x25955b=_0x22e93c[_0x5913('0x3d')]({'plain':!![]});var _0x141fde=_0x5913('0x3e');return db[_0x5913('0x64')]['find']({'where':{'name':_0x141fde,'userProfileId':_0x9552de[_0x5913('0x65')]},'raw':!![]})[_0x5913('0x24')](function(_0x4e462c){if(_0x4e462c&&_0x4e462c[_0x5913('0x66')]===0x0){return db[_0x5913('0x3f')]['create']({'name':_0x25955b[_0x5913('0x41')],'resourceId':_0x25955b['id'],'type':_0x4e462c[_0x5913('0x41')],'sectionId':_0x4e462c['id']},{})[_0x5913('0x24')](function(){return _0x22e93c;});}else{return _0x22e93c;}})[_0x5913('0x2e')](function(_0x5af3fe){logger[_0x5913('0x29')](_0x5913('0x67'),_0x5af3fe);throw _0x5af3fe;});}return _0x22e93c;})[_0x5913('0x24')](respondWithResult(_0x14a597,0xc9))[_0x5913('0x2e')](handleError(_0x14a597,null));};exports[_0x5913('0x3b')]=function(_0x29db8a,_0x4ec2cc){if(_0x29db8a[_0x5913('0x60')]['id']){delete _0x29db8a[_0x5913('0x60')]['id'];}return db[_0x5913('0x45')][_0x5913('0x5e')]({'where':{'id':_0x29db8a[_0x5913('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x5913('0x43')}]})['then'](handleEntityNotFound(_0x4ec2cc,null))['then'](saveUpdates(_0x29db8a[_0x5913('0x60')],null))[_0x5913('0x24')](respondWithResult(_0x4ec2cc,null))[_0x5913('0x2e')](handleError(_0x4ec2cc,null));};exports['destroy']=function(_0x1da289,_0x635298){return db['OpenchannelAccount'][_0x5913('0x5e')]({'where':{'id':_0x1da289['params']['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x635298,null))[_0x5913('0x24')](removeEntity(_0x635298,null))[_0x5913('0x2e')](handleError(_0x635298,null));};exports['describe']=function(_0x190918,_0x1427bd){return db['OpenchannelAccount'][_0x5913('0x68')]()['then'](respondWithResult(_0x1427bd,null))[_0x5913('0x2e')](handleError(_0x1427bd,null));};exports[_0x5913('0x69')]=function(_0x2396e5,_0x5bf936,_0x395270){if(_0x2396e5['body']['id']){delete _0x2396e5[_0x5913('0x60')]['id'];}return db[_0x5913('0x45')]['find']({'where':{'id':_0x2396e5[_0x5913('0x5c')]['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x5bf936,null))[_0x5913('0x24')](function(_0x302ad6){if(_0x302ad6){_0x2396e5['body'][_0x5913('0x6a')]=_0x302ad6['id'];return db[_0x5913('0x6b')][_0x5913('0x5f')](_0x2396e5[_0x5913('0x60')]);}})['then'](respondWithResult(_0x5bf936,null))[_0x5913('0x2e')](handleError(_0x5bf936,null));};exports[_0x5913('0x6c')]=function(_0x3aac42,_0x527d25,_0xea257c){var _0x2aac31={'raw':![],'where':{}};var _0x30d827={};var _0x5b2cf3={'count':0x0,'rows':[]};return db[_0x5913('0x45')][_0x5913('0x6d')]({'where':{'id':_0x3aac42['params']['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x527d25,null))['then'](function(_0x2e8139){if(_0x2e8139){_0x30d827[_0x5913('0x48')]=_[_0x5913('0x4a')](db[_0x5913('0x6b')][_0x5913('0x46')]);_0x30d827[_0x5913('0x49')]=_[_0x5913('0x4a')](_0x3aac42['query']);_0x30d827[_0x5913('0x4b')]=_[_0x5913('0x4c')](_0x30d827[_0x5913('0x48')],_0x30d827[_0x5913('0x49')]);_0x2aac31[_0x5913('0x4e')]=_[_0x5913('0x4c')](_0x30d827['model'],qs['fields'](_0x3aac42[_0x5913('0x49')][_0x5913('0x4d')]));_0x2aac31[_0x5913('0x4e')]=_0x2aac31['attributes'][_0x5913('0x5d')]?_0x2aac31[_0x5913('0x4e')]:_0x30d827[_0x5913('0x48')];if(!_0x3aac42[_0x5913('0x49')]['hasOwnProperty'](_0x5913('0x50'))){_0x2aac31[_0x5913('0x35')]=qs[_0x5913('0x35')](_0x3aac42[_0x5913('0x49')][_0x5913('0x35')]);_0x2aac31[_0x5913('0x33')]=qs[_0x5913('0x33')](_0x3aac42['query'][_0x5913('0x33')]);}_0x2aac31['order']=qs[_0x5913('0x51')](_0x3aac42[_0x5913('0x49')][_0x5913('0x51')]);_0x2aac31[_0x5913('0x52')]=qs['filters'](_[_0x5913('0x53')](_0x3aac42[_0x5913('0x49')],_0x30d827[_0x5913('0x4b')]));_0x2aac31[_0x5913('0x52')][_0x5913('0x6a')]=_0x2e8139['id'];if(_0x3aac42[_0x5913('0x49')][_0x5913('0x54')]){_0x2aac31[_0x5913('0x52')]=_['merge'](_0x2aac31[_0x5913('0x52')],{'$or':_[_0x5913('0x44')](_0x2aac31['attributes'],function(_0x55b8d5){var _0x3ee9b3={};_0x3ee9b3[_0x55b8d5]={'$like':'%'+_0x3aac42[_0x5913('0x49')][_0x5913('0x54')]+'%'};return _0x3ee9b3;})});}_0x2aac31=_[_0x5913('0x55')]({},_0x2aac31,_0x3aac42['options']);return db[_0x5913('0x6b')][_0x5913('0x36')]({'where':_0x2aac31['where']})[_0x5913('0x24')](function(_0x24dca1){_0x5b2cf3[_0x5913('0x36')]=_0x24dca1;if(_0x3aac42[_0x5913('0x49')][_0x5913('0x58')]){_0x2aac31[_0x5913('0x59')]=[{'all':!![]}];}return db[_0x5913('0x6b')][_0x5913('0x5a')](_0x2aac31);})[_0x5913('0x24')](function(_0x103649){_0x5b2cf3[_0x5913('0x6e')]=_0x103649;return _0x5b2cf3;});}})[_0x5913('0x24')](respondWithFilteredResult(_0x527d25,_0x2aac31))[_0x5913('0x2e')](handleError(_0x527d25,null));};exports[_0x5913('0x6f')]=function(_0x1b0824,_0x412cb9,_0x4fefe4){return db['OpenchannelAccount'][_0x5913('0x5e')]({'where':{'id':_0x1b0824[_0x5913('0x5c')]['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x412cb9,null))[_0x5913('0x24')](function(_0x1b5279){if(_0x1b5279){return _0x1b5279[_0x5913('0x6f')](_0x1b0824[_0x5913('0x49')][_0x5913('0x70')]);}})['then'](respondWithStatusCode(_0x412cb9,null))[_0x5913('0x2e')](handleError(_0x412cb9,null));};exports[_0x5913('0x71')]=function(_0x3f04e7,_0x27cbe0,_0x296bd0){if(_0x3f04e7[_0x5913('0x60')]['id']){delete _0x3f04e7[_0x5913('0x60')]['id'];}return db[_0x5913('0x45')][_0x5913('0x5e')]({'where':{'id':_0x3f04e7[_0x5913('0x5c')]['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x27cbe0,null))[_0x5913('0x24')](function(_0xdd90bb){if(_0xdd90bb){_0x3f04e7[_0x5913('0x60')]['OpenchannelAccountId']=_0xdd90bb['id'];return db['CannedAnswer'][_0x5913('0x5f')](_0x3f04e7['body']);}})[_0x5913('0x24')](respondWithResult(_0x27cbe0,null))[_0x5913('0x2e')](handleError(_0x27cbe0,null));};exports[_0x5913('0x72')]=function(_0x48e215,_0xfdd674,_0x9e1be){var _0x21883b={'raw':![],'where':{}};var _0x281f40={};var _0x52ac53={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5913('0x6d')]({'where':{'id':_0x48e215[_0x5913('0x5c')]['id']}})[_0x5913('0x24')](handleEntityNotFound(_0xfdd674,null))[_0x5913('0x24')](function(_0x5e3218){if(_0x5e3218){_0x281f40[_0x5913('0x48')]=_['keys'](db[_0x5913('0x73')]['rawAttributes']);_0x281f40['query']=_[_0x5913('0x4a')](_0x48e215['query']);_0x281f40[_0x5913('0x4b')]=_[_0x5913('0x4c')](_0x281f40[_0x5913('0x48')],_0x281f40[_0x5913('0x49')]);_0x21883b['attributes']=_['intersection'](_0x281f40[_0x5913('0x48')],qs[_0x5913('0x4d')](_0x48e215['query'][_0x5913('0x4d')]));_0x21883b['attributes']=_0x21883b[_0x5913('0x4e')][_0x5913('0x5d')]?_0x21883b[_0x5913('0x4e')]:_0x281f40[_0x5913('0x48')];if(!_0x48e215[_0x5913('0x49')]['hasOwnProperty']('nolimit')){_0x21883b[_0x5913('0x35')]=qs['limit'](_0x48e215['query'][_0x5913('0x35')]);_0x21883b['offset']=qs[_0x5913('0x33')](_0x48e215[_0x5913('0x49')][_0x5913('0x33')]);}_0x21883b[_0x5913('0x74')]=qs[_0x5913('0x51')](_0x48e215[_0x5913('0x49')][_0x5913('0x51')]);_0x21883b[_0x5913('0x52')]=qs[_0x5913('0x4b')](_[_0x5913('0x53')](_0x48e215[_0x5913('0x49')],_0x281f40[_0x5913('0x4b')]));_0x21883b['where'][_0x5913('0x6a')]=_0x5e3218['id'];if(_0x48e215['query'][_0x5913('0x54')]){_0x21883b['where']=_[_0x5913('0x55')](_0x21883b['where'],{'$or':_[_0x5913('0x44')](_0x21883b[_0x5913('0x4e')],function(_0x5b3e25){var _0xe59e24={};_0xe59e24[_0x5b3e25]={'$like':'%'+_0x48e215[_0x5913('0x49')][_0x5913('0x54')]+'%'};return _0xe59e24;})});}_0x21883b=_[_0x5913('0x55')]({},_0x21883b,_0x48e215['options']);return db[_0x5913('0x73')][_0x5913('0x36')]({'where':_0x21883b[_0x5913('0x52')]})[_0x5913('0x24')](function(_0x14d4fd){_0x52ac53[_0x5913('0x36')]=_0x14d4fd;if(_0x48e215[_0x5913('0x49')]['includeAll']){_0x21883b[_0x5913('0x59')]=[{'all':!![]}];}return db[_0x5913('0x73')][_0x5913('0x5a')](_0x21883b);})[_0x5913('0x24')](function(_0x16a9d0){_0x52ac53['rows']=_0x16a9d0;return _0x52ac53;});}})[_0x5913('0x24')](respondWithFilteredResult(_0xfdd674,_0x21883b))['catch'](handleError(_0xfdd674,null));};exports['removeAnswers']=function(_0x42a45e,_0x4b91bc,_0x3b349c){return db[_0x5913('0x45')][_0x5913('0x5e')]({'where':{'id':_0x42a45e[_0x5913('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b91bc,null))[_0x5913('0x24')](function(_0x8670cd){if(_0x8670cd){return _0x8670cd[_0x5913('0x75')](_0x42a45e[_0x5913('0x49')][_0x5913('0x70')]);}})[_0x5913('0x24')](respondWithStatusCode(_0x4b91bc,null))['catch'](handleError(_0x4b91bc,null));};exports['notify']=function(_0x37fe2b,_0x14971f,_0x5800ba){var _0x29d5ca={'body':_0x37fe2b[_0x5913('0x60')],'channel':_0x5913('0x76')};var _0x2e49da=[];var _0xf453b=[];var _0x1f2e85={};var _0x1bfb11=![];return db[_0x5913('0x77')][_0x5913('0x68')]()[_0x5913('0x24')](function(_0x32d534){if(!_0x32d534){throw new db[(_0x5913('0x78'))]['ValidationError'](_0x5913('0x79'));}_0x2e49da=_[_0x5913('0x7a')](_[_0x5913('0x4a')](_0x32d534),['createdAt','updatedAt']);_0xf453b=_[_0x5913('0x7a')](_['keys'](_0x32d534),[_0x5913('0x7b'),_0x5913('0x7c'),'CompanyId',_0x5913('0x7d')]);if(_0x37fe2b[_0x5913('0x60')]['id']){delete _0x37fe2b['body']['id'];}if(_[_0x5913('0x7e')](_0x37fe2b[_0x5913('0x60')][_0x5913('0x7f')])){throw new db[(_0x5913('0x78'))][(_0x5913('0x80'))](_0x5913('0x81'));}if(_[_0x5913('0x7e')](_0x37fe2b[_0x5913('0x60')][_0x5913('0x60')])||_0x37fe2b[_0x5913('0x60')]['body']===''){throw new db[(_0x5913('0x78'))]['ValidationError'](_0x5913('0x82'));}if(_[_0x5913('0x7e')](_0x37fe2b['body'][_0x5913('0x83')])){throw new db['Sequelize'][(_0x5913('0x80'))](_0x5913('0x84')+_0xf453b);}if(!_[_0x5913('0x85')](_0xf453b,_0x37fe2b[_0x5913('0x60')][_0x5913('0x83')])){throw new db['Sequelize'][(_0x5913('0x80'))](_0x5913('0x86')+_0xf453b);}_0x1f2e85[_0x37fe2b['body'][_0x5913('0x83')]]=_0x37fe2b[_0x5913('0x60')][_0x5913('0x7f')];})['then'](function(){return db[_0x5913('0x45')]['find']({'where':{'id':_0x37fe2b[_0x5913('0x5c')]['id']},'include':[{'model':db[_0x5913('0x87')],'as':'List','include':[{'model':db[_0x5913('0x77')],'as':_0x5913('0x88'),'where':_0x1f2e85,'limit':0x1,'order':[[_0x5913('0x7c'),_0x5913('0x89')]]}]},{'model':db['OpenchannelApplication'],'as':_0x5913('0x8a')}]});})['then'](handleEntityNotFound(_0x14971f,null))['then'](function(_0x3ee112){if(_0x3ee112&&_0x3ee112['List']){_0x29d5ca['account']=_0x3ee112;_0x29d5ca[_0x5913('0x8b')]=_0x3ee112[_0x5913('0x8a')];_0x29d5ca[_0x5913('0x8c')]=_0x3ee112[_0x5913('0x8d')];_0x29d5ca['applications']=_['orderBy'](_0x29d5ca['applications'],[_0x5913('0x8e')],['asc']);if(_0x29d5ca[_0x5913('0x8f')][_0x5913('0x8a')]){delete _0x29d5ca[_0x5913('0x8f')][_0x5913('0x8a')];}if(_0x29d5ca[_0x5913('0x8f')]['List']&&_0x29d5ca['account']['List'][_0x5913('0x88')][_0x5913('0x5d')]){return _0x29d5ca[_0x5913('0x8f')][_0x5913('0x8d')][_0x5913('0x88')][0x0];}var _0x7b2418=_['defaults'](_0x37fe2b['body'],{'firstName':_0x37fe2b[_0x5913('0x60')][_0x5913('0x7f')],'ListId':_0x3ee112['ListId']});_0x7b2418[_0x37fe2b[_0x5913('0x60')]['mapKey']]=_0x37fe2b[_0x5913('0x60')][_0x5913('0x7f')];return db[_0x5913('0x77')][_0x5913('0x5f')](_0x7b2418,{'fields':_0x2e49da,'raw':!![]});}})[_0x5913('0x24')](handleEntityNotFound(_0x14971f,null))[_0x5913('0x24')](function(_0x4db98a){_0x29d5ca[_0x5913('0x90')]=_0x4db98a;if(_0x4db98a){var _0x4a205a={'ContactId':_0x4db98a['id'],'OpenchannelAccountId':_0x37fe2b[_0x5913('0x5c')]['id'],'from':(_0x4db98a[_0x5913('0x91')]||'')+'\x20'+(_0x4db98a['lastName']||'')};var _0x42f011={'OpenchannelAccountId':_0x37fe2b['params']['id'],'closed':![]};if(_0x37fe2b[_0x5913('0x60')][_0x5913('0x92')]){_0x42f011[_0x5913('0x92')]=_0x37fe2b[_0x5913('0x60')]['threadId'];return db[_0x5913('0x93')][_0x5913('0x5e')]({'where':_0x42f011})[_0x5913('0x24')](function(_0x159e0){if(_0x159e0){return[_0x159e0,![]];}_0x4a205a[_0x5913('0x92')]=_0x37fe2b[_0x5913('0x60')][_0x5913('0x92')];_0x4a205a['externalUrl']=_0x37fe2b[_0x5913('0x60')][_0x5913('0x94')];return db[_0x5913('0x93')][_0x5913('0x5f')](_0x4a205a)[_0x5913('0x24')](function(_0x44a193){return[_0x44a193,!![]];});});}else{_0x42f011[_0x5913('0x92')]=null;}_0x42f011['ContactId']=_0x4db98a['id'];return db[_0x5913('0x93')]['find']({'where':_0x42f011})[_0x5913('0x24')](function(_0x74ccf2){if(_0x74ccf2){return[_0x74ccf2,![]];}return db[_0x5913('0x93')][_0x5913('0x5f')](_0x4a205a)[_0x5913('0x24')](function(_0x3acac8){return[_0x3acac8,!![]];});});}})['spread'](function(_0x7a7bf0,_0x5a8f62){if(_0x7a7bf0){_0x1bfb11=_0x5a8f62;if(!_0x5a8f62){var _0x3bb223={'from':(_0x29d5ca[_0x5913('0x90')][_0x5913('0x91')]||'')+'\x20'+(_0x29d5ca[_0x5913('0x90')][_0x5913('0x95')]||'')};if(_0x37fe2b[_0x5913('0x60')][_0x5913('0x92')]&&_0x37fe2b[_0x5913('0x60')][_0x5913('0x96')]&&_0x37fe2b['body'][_0x5913('0x92')]!=_0x37fe2b[_0x5913('0x60')][_0x5913('0x96')]){_0x3bb223['threadId']=_0x37fe2b['body'][_0x5913('0x96')];}return _0x7a7bf0[_0x5913('0x3b')](_0x3bb223);}else{return _0x7a7bf0;}}})[_0x5913('0x24')](function(_0x4408c1){_0x29d5ca[_0x5913('0x97')]=_0x4408c1[_0x5913('0x3d')]({'plain':!![]});_0x29d5ca[_0x5913('0x97')][_0x5913('0x98')]=_0x1bfb11;if(_0x29d5ca[_0x5913('0x97')]['created']){if(_0x29d5ca[_0x5913('0x8f')][_0x5913('0x99')]){_0x29d5ca[_0x5913('0x8b')]['push']({'id':0x0,'priority':_0x29d5ca['applications'][_0x5913('0x5d')]+0x1,'app':_0x5913('0x9a'),'appdata':_0x5913('0x9b'),'interval':'*,*,*,*'});}}return db[_0x5913('0x9c')][_0x5913('0x5f')]({'body':_0x37fe2b['body'][_0x5913('0x60')],'OpenchannelAccountId':_0x37fe2b[_0x5913('0x5c')]['id'],'OpenchannelInteractionId':_0x4408c1['id'],'direction':'in','ContactId':_0x29d5ca[_0x5913('0x90')]['id'],'AttachmentId':_0x37fe2b[_0x5913('0x60')][_0x5913('0x9d')]});})['then'](function(_0x55f6a6){_0x29d5ca[_0x5913('0x2b')]=_0x55f6a6;if(_0x29d5ca['interaction'][_0x5913('0x9e')]){return db[_0x5913('0x9f')][_0x5913('0x5e')]({'attributes':['id',_0x5913('0x41')],'where':{'id':_0x29d5ca[_0x5913('0x97')][_0x5913('0x9e')]}})[_0x5913('0x24')](function(_0x123ad3){if(_0x123ad3){_0x29d5ca[_0x5913('0x8b')][_0x5913('0xa0')]({'id':0x0,'priority':0x0,'app':_0x5913('0xa1'),'appdata':_0x123ad3['name']+','+(_0x29d5ca[_0x5913('0x8f')][_0x5913('0xa2')]||0xa),'interval':_0x5913('0xa3')});_0x29d5ca[_0x5913('0xa4')]=![];}return respondWithRpcPromise(_0x5913('0xa5'),_0x5913('0xa6'),_0x29d5ca);});}return respondWithRpcPromise(_0x5913('0xa5'),_0x5913('0xa6'),_0x29d5ca);})[_0x5913('0x24')](function(_0x2161c2){respondWithRpcPromise(_0x5913('0xa7'),_0x5913('0xa7'),{'event':_0x5913('0xa8'),'message':_0x2161c2},client9002);return _0x2161c2;})['then'](respondWithResult(_0x14971f,null))[_0x5913('0x2e')](handleError(_0x14971f,null));};exports[_0x5913('0xa9')]=function(_0x5e9b62,_0x27f049){var _0x26bf10=_0x5e9b62['params']['id'];var _0x50adaa=_0x5e9b62['body'];var _0x25251c=0xc8;var _0x20dbad=null;return db[_0x5913('0xaa')][_0x5913('0xab')]({'isolationLevel':db[_0x5913('0xaa')]['Transaction']['ISOLATION_LEVELS'][_0x5913('0xac')]},function(_0x216b56){return db[_0x5913('0x45')][_0x5913('0x6d')]({'where':{'id':_0x26bf10},'transaction':_0x216b56})[_0x5913('0x24')](function(_0x11ae38){if(_0x11ae38){return db[_0x5913('0xad')]['destroy']({'where':{'OpenchannelAccountId':_0x26bf10},'transaction':_0x216b56})[_0x5913('0x24')](function(){var _0x3369e0=_[_0x5913('0x44')](_0x50adaa,function(_0xab90e9){_0xab90e9[_0x5913('0x6a')]=_0x26bf10;return _0xab90e9;});return db[_0x5913('0xad')][_0x5913('0xae')](_0x3369e0,{'transaction':_0x216b56});});}else{_0x25251c=0x194;_0x20dbad=[];}});})['then'](function(){if(_0x25251c!==0x194){return db[_0x5913('0xad')][_0x5913('0xaf')]({'where':{'OpenchannelAccountId':_0x26bf10},'order':_0x5913('0x8e')})[_0x5913('0x24')](function(_0x2747d5){_0x20dbad=_0x2747d5;});}})[_0x5913('0x2e')](function(_0x4e422d){_0x25251c=0x1f4;logger[_0x5913('0x29')](_0x4e422d[_0x5913('0x40')]);if(_0x4e422d['name']){delete _0x4e422d[_0x5913('0x41')];}_0x20dbad=_0x4e422d;})['finally'](function(){if(_0x20dbad===null){_0x27f049[_0x5913('0x2f')](_0x25251c);}else{if(_0x25251c===0x1f4){_0x27f049['status'](_0x25251c)[_0x5913('0xb0')](_0x20dbad);}else{_0x27f049[_0x5913('0x30')](_0x25251c)[_0x5913('0x32')](_0x20dbad);}}});};exports[_0x5913('0xb1')]=function(_0x4e7c42,_0x535bf7,_0x1dcd0a){var _0x3f58c4={};var _0x2404d3={};var _0xd24b04;var _0x4b81e0;return db[_0x5913('0x45')]['findOne']({'where':{'id':_0x4e7c42['params']['id']}})['then'](handleEntityNotFound(_0x535bf7,null))['then'](function(_0x3d43c9){if(_0x3d43c9){_0xd24b04=_0x3d43c9;_0x2404d3[_0x5913('0x48')]=_[_0x5913('0x4a')](db[_0x5913('0xad')][_0x5913('0x46')]);_0x2404d3[_0x5913('0x49')]=_[_0x5913('0x4a')](_0x4e7c42[_0x5913('0x49')]);_0x2404d3[_0x5913('0x4b')]=_[_0x5913('0x4c')](_0x2404d3[_0x5913('0x48')],_0x2404d3[_0x5913('0x49')]);_0x3f58c4[_0x5913('0x4e')]=_[_0x5913('0x4c')](_0x2404d3['model'],qs[_0x5913('0x4d')](_0x4e7c42[_0x5913('0x49')][_0x5913('0x4d')]));_0x3f58c4[_0x5913('0x4e')]=_0x3f58c4['attributes'][_0x5913('0x5d')]?_0x3f58c4[_0x5913('0x4e')]:_0x2404d3[_0x5913('0x48')];_0x3f58c4['order']=qs[_0x5913('0x51')](_0x4e7c42[_0x5913('0x49')][_0x5913('0x51')]);_0x3f58c4['where']=qs[_0x5913('0x4b')](_[_0x5913('0x53')](_0x4e7c42[_0x5913('0x49')],_0x2404d3['filters']));if(_0x4e7c42[_0x5913('0x49')][_0x5913('0x54')]){_0x3f58c4[_0x5913('0x52')]=_['merge'](_0x3f58c4['where'],{'$or':_['map'](_0x3f58c4['attributes'],function(_0x400176){var _0x1e49fd={};_0x1e49fd[_0x400176]={'$like':'%'+_0x4e7c42[_0x5913('0x49')]['filter']+'%'};return _0x1e49fd;})});}_0x3f58c4=_['merge']({},_0x3f58c4,_0x4e7c42['options']);return _0xd24b04[_0x5913('0xb1')](_0x3f58c4);}})[_0x5913('0x24')](function(_0x13ef91){if(_0x13ef91){_0x4b81e0=_0x13ef91['length'];if(!_0x4e7c42[_0x5913('0x49')][_0x5913('0x4f')](_0x5913('0x50'))){_0x3f58c4[_0x5913('0x35')]=qs['limit'](_0x4e7c42[_0x5913('0x49')][_0x5913('0x35')]);_0x3f58c4[_0x5913('0x33')]=qs[_0x5913('0x33')](_0x4e7c42['query'][_0x5913('0x33')]);}return _0xd24b04[_0x5913('0xb1')](_0x3f58c4);}})['then'](function(_0x1ab5bb){if(_0x1ab5bb){return _0x1ab5bb?{'count':_0x4b81e0,'rows':_0x1ab5bb}:null;}})[_0x5913('0x24')](respondWithResult(_0x535bf7,null))[_0x5913('0x2e')](handleError(_0x535bf7,null));};exports[_0x5913('0xb2')]=function(_0x25160b,_0xa75c0c,_0x1a545d){var _0x5dc9b7={'raw':![],'where':{}};var _0x310275={};var _0xf21dc5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5913('0x6d')]({'where':{'id':_0x25160b[_0x5913('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa75c0c,null))[_0x5913('0x24')](function(_0x26293f){if(_0x26293f){_0x310275[_0x5913('0x48')]=_[_0x5913('0x4a')](db['OpenchannelInteraction'][_0x5913('0x46')]);_0x310275[_0x5913('0x49')]=_['keys'](_0x25160b['query']);_0x310275[_0x5913('0x4b')]=_[_0x5913('0x4c')](_0x310275[_0x5913('0x48')],_0x310275[_0x5913('0x49')]);_0x5dc9b7['attributes']=_['intersection'](_0x310275[_0x5913('0x48')],qs[_0x5913('0x4d')](_0x25160b[_0x5913('0x49')]['fields']));_0x5dc9b7[_0x5913('0x4e')]=_0x5dc9b7[_0x5913('0x4e')]['length']?_0x5dc9b7[_0x5913('0x4e')]:_0x310275[_0x5913('0x48')];if(!_0x25160b[_0x5913('0x49')][_0x5913('0x4f')](_0x5913('0x50'))){_0x5dc9b7['limit']=qs[_0x5913('0x35')](_0x25160b[_0x5913('0x49')]['limit']);_0x5dc9b7[_0x5913('0x33')]=qs[_0x5913('0x33')](_0x25160b[_0x5913('0x49')][_0x5913('0x33')]);}_0x5dc9b7['order']=qs[_0x5913('0x51')](_0x25160b[_0x5913('0x49')]['sort']);_0x5dc9b7[_0x5913('0x52')]=qs['filters'](_[_0x5913('0x53')](_0x25160b[_0x5913('0x49')],_0x310275[_0x5913('0x4b')]));_0x5dc9b7[_0x5913('0x52')][_0x5913('0x6a')]=_0x26293f['id'];if(_0x25160b[_0x5913('0x49')][_0x5913('0x54')]){_0x5dc9b7['where']=_['merge'](_0x5dc9b7[_0x5913('0x52')],{'$or':_[_0x5913('0x44')](_0x5dc9b7['attributes'],function(_0x5dc568){var _0x5d21a8={};_0x5d21a8[_0x5dc568]={'$like':'%'+_0x25160b[_0x5913('0x49')][_0x5913('0x54')]+'%'};return _0x5d21a8;})});}_0x5dc9b7=_[_0x5913('0x55')]({},_0x5dc9b7,_0x25160b[_0x5913('0x57')]);return db[_0x5913('0x93')][_0x5913('0x36')]({'where':_0x5dc9b7[_0x5913('0x52')]})[_0x5913('0x24')](function(_0x1819f5){_0xf21dc5[_0x5913('0x36')]=_0x1819f5;if(_0x25160b[_0x5913('0x49')]['includeAll']){_0x5dc9b7[_0x5913('0x59')]=[{'model':db['CmContact'],'as':_0x5913('0xb3'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x5913('0x41'),_0x5913('0xb4'),_0x5913('0xb5')],'required':![]},{'model':db[_0x5913('0xb6')],'as':_0x5913('0xb7'),'attributes':['id',_0x5913('0x41'),_0x5913('0xb8')],'where':_0x25160b[_0x5913('0x49')][_0x5913('0xb9')]?{'id':_0x25160b[_0x5913('0x49')][_0x5913('0xb9')]}:undefined,'required':_0x25160b[_0x5913('0x49')][_0x5913('0xb9')]?!![]:![]}];}return db[_0x5913('0x93')][_0x5913('0x5a')](_0x5dc9b7);})['then'](function(_0x14a572){_0xf21dc5['rows']=_0x14a572;return _0xf21dc5;});}})[_0x5913('0x24')](respondWithFilteredResult(_0xa75c0c,_0x5dc9b7))['catch'](handleError(_0xa75c0c,null));};exports['addAgents']=function(_0x42d78e,_0x448205,_0x4061b1){return db[_0x5913('0x45')]['find']({'where':{'id':_0x42d78e['params']['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x448205,null))[_0x5913('0x24')](function(_0x58155d){if(_0x58155d){return _0x58155d[_0x5913('0xba')](_0x42d78e[_0x5913('0x60')]['ids'],_[_0x5913('0xbb')](_0x42d78e[_0x5913('0x60')],[_0x5913('0x70'),'id'])||{})[_0x5913('0xbc')](function(_0x2b30a4){for(var _0x4f16b1=0x0;_0x4f16b1<_0x42d78e['body'][_0x5913('0x70')]['length'];_0x4f16b1+=0x1){socket[_0x5913('0xbd')](_0x5913('0xbe'),{'UserId':Number(_0x42d78e[_0x5913('0x60')]['ids'][_0x4f16b1]),'OpenchannelAccountId':Number(_0x42d78e[_0x5913('0x5c')]['id'])});}return _0x2b30a4;});}})[_0x5913('0x24')](respondWithResult(_0x448205,null))['catch'](handleError(_0x448205,null));};exports[_0x5913('0xbf')]=function(_0x221f49,_0xc1c1e9,_0x3fdd84){return db[_0x5913('0x45')][_0x5913('0x5e')]({'where':{'id':_0x221f49[_0x5913('0x5c')]['id']}})[_0x5913('0x24')](handleEntityNotFound(_0xc1c1e9,null))[_0x5913('0x24')](function(_0x2a86ab){if(_0x2a86ab){return _0x2a86ab['removeAgents'](_0x221f49['query']['ids'])[_0x5913('0x24')](function(){if(_[_0x5913('0xc0')](_0x221f49[_0x5913('0x49')][_0x5913('0x70')])){for(var _0x35de7d=0x0;_0x35de7d<_0x221f49['query']['ids'][_0x5913('0x5d')];_0x35de7d+=0x1){socket['emit'](_0x5913('0xc1'),{'UserId':Number(_0x221f49[_0x5913('0x49')]['ids'][_0x35de7d]),'OpenchannelAccountId':Number(_0x221f49[_0x5913('0x5c')]['id'])});}}else{socket[_0x5913('0xbd')]('userOpenchannelAccount:remove',{'UserId':Number(_0x221f49[_0x5913('0x49')][_0x5913('0x70')]),'OpenchannelAccountId':Number(_0x221f49[_0x5913('0x5c')]['id'])});}});}})[_0x5913('0x24')](respondWithStatusCode(_0xc1c1e9,null))[_0x5913('0x2e')](handleError(_0xc1c1e9,null));};exports[_0x5913('0xc2')]=function(_0x2f77c8,_0x117c93,_0x2186c0){var _0x507fb6={};var _0x4004eb={};var _0x4b57dc;var _0x39cfa2;return db['OpenchannelAccount'][_0x5913('0x6d')]({'where':{'id':_0x2f77c8[_0x5913('0x5c')]['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x117c93,null))[_0x5913('0x24')](function(_0x5be0e0){if(_0x5be0e0){_0x4b57dc=_0x5be0e0;_0x4004eb[_0x5913('0x48')]=_[_0x5913('0x4a')](db[_0x5913('0x9f')][_0x5913('0x46')]);_0x4004eb[_0x5913('0x49')]=_[_0x5913('0x4a')](_0x2f77c8[_0x5913('0x49')]);_0x4004eb['filters']=_[_0x5913('0x4c')](_0x4004eb[_0x5913('0x48')],_0x4004eb[_0x5913('0x49')]);_0x507fb6[_0x5913('0x4e')]=_['intersection'](_0x4004eb['model'],qs[_0x5913('0x4d')](_0x2f77c8[_0x5913('0x49')]['fields']));_0x507fb6[_0x5913('0x4e')]=_0x507fb6['attributes'][_0x5913('0x5d')]?_0x507fb6[_0x5913('0x4e')]:_0x4004eb['model'];_0x507fb6[_0x5913('0x74')]=qs[_0x5913('0x51')](_0x2f77c8[_0x5913('0x49')][_0x5913('0x51')]);_0x507fb6[_0x5913('0x52')]=qs[_0x5913('0x4b')](_['pick'](_0x2f77c8[_0x5913('0x49')],_0x4004eb['filters']));if(_0x2f77c8[_0x5913('0x49')][_0x5913('0x54')]){_0x507fb6['where']=_[_0x5913('0x55')](_0x507fb6['where'],{'$or':_[_0x5913('0x44')](_0x507fb6[_0x5913('0x4e')],function(_0x2e6417){var _0x39fc8f={};_0x39fc8f[_0x2e6417]={'$like':'%'+_0x2f77c8[_0x5913('0x49')][_0x5913('0x54')]+'%'};return _0x39fc8f;})});}_0x507fb6=_[_0x5913('0x55')]({},_0x507fb6,_0x2f77c8[_0x5913('0x57')]);return _0x4b57dc[_0x5913('0xc2')](_0x507fb6);}})[_0x5913('0x24')](function(_0x4d7a7a){if(_0x4d7a7a){_0x39cfa2=_0x4d7a7a['length'];if(!_0x2f77c8[_0x5913('0x49')]['hasOwnProperty'](_0x5913('0x50'))){_0x507fb6['limit']=qs[_0x5913('0x35')](_0x2f77c8['query'][_0x5913('0x35')]);_0x507fb6['offset']=qs['offset'](_0x2f77c8['query'][_0x5913('0x33')]);}return _0x4b57dc[_0x5913('0xc2')](_0x507fb6);}})[_0x5913('0x24')](function(_0x2dbe6d){if(_0x2dbe6d){return _0x2dbe6d?{'count':_0x39cfa2,'rows':_0x2dbe6d}:null;}})[_0x5913('0x24')](respondWithResult(_0x117c93,null))['catch'](handleError(_0x117c93,null));};exports[_0x5913('0xb0')]=function(_0x5a389e,_0x6991d9,_0x1ecf6f){var _0x291505,_0x66f0d2,_0xa2911b;if(_['isNil'](_0x5a389e[_0x5913('0x60')][_0x5913('0x60')])||_0x5a389e[_0x5913('0x60')][_0x5913('0x60')]===''){throw new db['Sequelize'][(_0x5913('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5913('0x7e')](_0x5a389e['body']['to'])){}_0x291505=_0x5a389e[_0x5913('0x60')]['to'];return db[_0x5913('0x45')][_0x5913('0x6d')]({'where':{'id':_0x5a389e[_0x5913('0x5c')]['id']}})[_0x5913('0x24')](handleEntityNotFound(_0x6991d9,null))[_0x5913('0x24')](function(_0xea738d){if(_0xea738d){return db['OpenchannelAccount'][_0x5913('0x5e')]({'where':{'id':_0xea738d['id']},'include':[{'model':db[_0x5913('0x87')],'as':_0x5913('0x8d'),'include':[{'model':db[_0x5913('0x77')],'as':_0x5913('0x88'),'where':{[_0xea738d[_0x5913('0x83')]]:_0x291505},'limit':0x1,'order':[[_0x5913('0x7c'),_0x5913('0x89')]]}]}]})[_0x5913('0x24')](handleEntityNotFound(_0x6991d9,null))[_0x5913('0x24')](function(_0x38690){if(_0x38690&&_0x38690[_0x5913('0x8d')]){_0x66f0d2=_0x38690[_0x5913('0x3d')]({'plain':!![]});if(_0x66f0d2[_0x5913('0x8d')]&&_0x66f0d2['List'][_0x5913('0x88')]['length']){return _0x66f0d2['List'][_0x5913('0x88')][0x0];}return db[_0x5913('0x77')][_0x5913('0x5f')](_['defaults'](_0x5a389e[_0x5913('0x60')],{'firstName':_0x291505,[_0x38690['mapKey']]:_0x291505,'phone':_0x291505,'ListId':_0x66f0d2[_0x5913('0x7d')]}));}})['then'](handleEntityNotFound(_0x6991d9,null))[_0x5913('0x24')](function(_0x240269){if(_0x240269){_0xa2911b=_0x240269;return db[_0x5913('0x93')][_0x5913('0x5e')]({'where':{'ContactId':_0xa2911b['id'],'closed':![],'OpenchannelAccountId':_0x66f0d2['id']}})['then'](function(_0x3e8d69){if(_0x3e8d69){return[_0x3e8d69,![]];}return db[_0x5913('0x93')][_0x5913('0x5f')]({'UserId':_0x5a389e['user']['id'],'ContactId':_0xa2911b['id'],'OpenchannelAccountId':_0x66f0d2['id'],'lastMsgDirection':_0x5913('0xc3'),'Messages':[_[_0x5913('0x55')](_0x5a389e[_0x5913('0x60')],{'read':![],'body':_0x5a389e[_0x5913('0x60')]['body'],'OpenchannelAccountId':_0x66f0d2['id'],'UserId':_0x5a389e[_0x5913('0x61')]['id'],'ContactId':_0xa2911b['id']})]},{'include':[{'model':db[_0x5913('0x9c')],'as':_0x5913('0xc4')}]})[_0x5913('0x24')](function(_0x4cdd68){return[_0x4cdd68,!![]];});});}})[_0x5913('0xbc')](function(_0x26ea2b,_0x3d4d1b){if(_0x3d4d1b){return _0x26ea2b;}return db[_0x5913('0x9c')]['create'](_[_0x5913('0x55')](_0x5a389e['body'],{'read':![],'body':_0x5a389e[_0x5913('0x60')][_0x5913('0x60')],'OpenchannelAccountId':_0x66f0d2['id'],'OpenchannelInteractionId':_0x26ea2b['id'],'UserId':_0x5a389e[_0x5913('0x61')]['id'],'ContactId':_0xa2911b['id']}))[_0x5913('0x24')](function(_0x9cc9a0){_0x26ea2b['dataValues']['Messages']=[];_0x26ea2b['dataValues'][_0x5913('0xc4')][_0x5913('0xc5')](_0x9cc9a0[_0x5913('0xc6')]);return _0x26ea2b;});});}})[_0x5913('0x24')](respondWithResult(_0x6991d9,null))['catch'](handleError(_0x6991d9,null));}; \ No newline at end of file +var _0xf20e=['orderBy','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','nolimit','getInteractions','Contact','User','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','end','name','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','keys','query','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','OpenchannelAccount','includeAll','include','findAll','rows','show','intersection','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','options','removeDispositions','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list'];(function(_0x736eb,_0x345088){var _0x30ea13=function(_0xbdab7c){while(--_0xbdab7c){_0x736eb['push'](_0x736eb['shift']());}};_0x30ea13(++_0x345088);}(_0xf20e,0x1c8));var _0xef20=function(_0x4ef826,_0x2e0ac8){_0x4ef826=_0x4ef826-0x0;var _0x154b8=_0xf20e[_0x4ef826];return _0x154b8;};'use strict';var emlformat=require(_0xef20('0x0'));var rimraf=require(_0xef20('0x1'));var zipdir=require(_0xef20('0x2'));var jsonpatch=require(_0xef20('0x3'));var rp=require(_0xef20('0x4'));var moment=require(_0xef20('0x5'));var BPromise=require(_0xef20('0x6'));var Mustache=require(_0xef20('0x7'));var util=require(_0xef20('0x8'));var path=require('path');var sox=require(_0xef20('0x9'));var csv=require(_0xef20('0xa'));var ejs=require(_0xef20('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef20('0xc'));var squel=require(_0xef20('0xd'));var crypto=require(_0xef20('0xe'));var jsforce=require(_0xef20('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xef20('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xef20('0x11'));var qs=require(_0xef20('0x12'));var as=require(_0xef20('0x13'));var hardwareService=require(_0xef20('0x14'));var logger=require(_0xef20('0x15'))(_0xef20('0x16'));var utils=require(_0xef20('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xef20('0x18'));var db=require(_0xef20('0x19'))['db'];config['redis']=_[_0xef20('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef20('0x1b')]));require(_0xef20('0x1c'))[_0xef20('0x1d')](socket);var jayson=require(_0xef20('0x1e'));var client=jayson[_0xef20('0x1f')][_0xef20('0x20')]({'port':0x232c});var client9002=jayson[_0xef20('0x1f')][_0xef20('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x49a9e3,_0x528e23,_0x374252,_0x4110de){return new BPromise(function(_0xb10e48,_0x57f0db){var _0x331b23=_0x4110de||client;return _0x331b23[_0xef20('0x21')](_0x49a9e3,_0x374252)[_0xef20('0x22')](function(_0x80c929){logger[_0xef20('0x23')](_0xef20('0x24'),_0x528e23,_0xef20('0x25'));logger[_0xef20('0x26')](_0xef20('0x27'),_0x528e23,_0xef20('0x25'),JSON['stringify'](_0x80c929));if(_0x80c929[_0xef20('0x28')]){if(_0x80c929['error'][_0xef20('0x29')]===0x1f4){logger[_0xef20('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x528e23,_0x80c929[_0xef20('0x28')][_0xef20('0x2a')]);return _0x57f0db(_0x80c929['error']['message']);}logger[_0xef20('0x28')](_0xef20('0x24'),_0x528e23,_0x80c929[_0xef20('0x28')][_0xef20('0x2a')]);return _0xb10e48(_0x80c929[_0xef20('0x28')][_0xef20('0x2a')]);}else{logger[_0xef20('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x528e23,_0xef20('0x25'));_0xb10e48(_0x80c929[_0xef20('0x2b')][_0xef20('0x2a')]);}})[_0xef20('0x2c')](function(_0x5bd13c){logger['error'](_0xef20('0x24'),_0x528e23,_0x5bd13c);_0x57f0db(_0x5bd13c);});});}function respondWithStatusCode(_0xe9b785,_0x526543){_0x526543=_0x526543||0xcc;return function(_0x2e39b6){if(_0x2e39b6){return _0xe9b785[_0xef20('0x2d')](_0x526543);}return _0xe9b785[_0xef20('0x2e')](_0x526543)['end']();};}function respondWithResult(_0x541ee5,_0x1f038d){_0x1f038d=_0x1f038d||0xc8;return function(_0x449cc0){if(_0x449cc0){return _0x541ee5['status'](_0x1f038d)[_0xef20('0x2f')](_0x449cc0);}};}function respondWithFilteredResult(_0x120e6f,_0x25309f){return function(_0x1932dd){if(_0x1932dd){var _0x3437dd=typeof _0x25309f[_0xef20('0x30')]===_0xef20('0x31')&&typeof _0x25309f[_0xef20('0x32')]===_0xef20('0x31');var _0x45b85e=_0x1932dd['count'];var _0x24ef2f=_0x3437dd?0x0:_0x25309f[_0xef20('0x30')];var _0x2c2f37=_0x3437dd?_0x1932dd[_0xef20('0x33')]:_0x25309f['offset']+_0x25309f['limit'];var _0x512c99;if(_0x2c2f37>=_0x45b85e){_0x2c2f37=_0x45b85e;_0x512c99=0xc8;}else{_0x512c99=0xce;}_0x120e6f[_0xef20('0x2e')](_0x512c99);return _0x120e6f[_0xef20('0x34')](_0xef20('0x35'),_0x24ef2f+'-'+_0x2c2f37+'/'+_0x45b85e)['json'](_0x1932dd);}return null;};}function patchUpdates(_0x23de07){return function(_0x5c8ee2){try{jsonpatch[_0xef20('0x36')](_0x5c8ee2,_0x23de07,!![]);}catch(_0x5aae42){return BPromise[_0xef20('0x37')](_0x5aae42);}return _0x5c8ee2[_0xef20('0x38')]();};}function saveUpdates(_0x29ed01,_0x2bcd8a){return function(_0x3716fc){if(_0x3716fc){return _0x3716fc[_0xef20('0x39')](_0x29ed01)[_0xef20('0x22')](function(_0x18d488){return _0x18d488;});}return null;};}function removeEntity(_0x189f3e,_0x26ad2e){return function(_0x521f43){if(_0x521f43){return _0x521f43[_0xef20('0x3a')]()[_0xef20('0x22')](function(){var _0x48c810=_0x521f43[_0xef20('0x3b')]({'plain':!![]});var _0x4b40a6=_0xef20('0x3c');return db['UserProfileResource']['destroy']({'where':{'type':_0x4b40a6,'resourceId':_0x48c810['id']}})[_0xef20('0x22')](function(){return _0x521f43;});})[_0xef20('0x22')](function(){_0x189f3e['status'](0xcc)[_0xef20('0x3d')]();});}};}function handleEntityNotFound(_0xf33b9a,_0x57eab5){return function(_0x3b958b){if(!_0x3b958b){_0xf33b9a[_0xef20('0x2d')](0x194);}return _0x3b958b;};}function handleError(_0x3df173,_0x33ceb0){_0x33ceb0=_0x33ceb0||0x1f4;return function(_0x12e3b2){logger[_0xef20('0x28')](_0x12e3b2['stack']);if(_0x12e3b2[_0xef20('0x3e')]){delete _0x12e3b2[_0xef20('0x3e')];}_0x3df173[_0xef20('0x2e')](_0x33ceb0)['send'](_0x12e3b2);};}exports['index']=function(_0x310b52,_0x51735b){var _0x2d4272={'include':[{'model':db[_0xef20('0x3f')],'as':_0xef20('0x40')}]},_0xe99828={},_0x2afa95={'count':0x0,'rows':[]};var _0x4b72cb=_[_0xef20('0x41')](db['OpenchannelAccount'][_0xef20('0x42')],function(_0x3ad5a4){return{'name':_0x3ad5a4[_0xef20('0x43')],'type':_0x3ad5a4[_0xef20('0x44')]['key']};});_0xe99828[_0xef20('0x45')]=_['map'](_0x4b72cb,_0xef20('0x3e'));_0xe99828['query']=_[_0xef20('0x46')](_0x310b52[_0xef20('0x47')]);_0xe99828['filters']=_['intersection'](_0xe99828['model'],_0xe99828[_0xef20('0x47')]);_0x2d4272[_0xef20('0x48')]=_['intersection'](_0xe99828[_0xef20('0x45')],qs[_0xef20('0x49')](_0x310b52[_0xef20('0x47')][_0xef20('0x49')]));_0x2d4272['attributes']=_0x2d4272[_0xef20('0x48')][_0xef20('0x4a')]?_0x2d4272['attributes']:_0xe99828['model'];if(!_0x310b52[_0xef20('0x47')]['hasOwnProperty']('nolimit')){_0x2d4272[_0xef20('0x32')]=qs['limit'](_0x310b52[_0xef20('0x47')][_0xef20('0x32')]);_0x2d4272['offset']=qs[_0xef20('0x30')](_0x310b52[_0xef20('0x47')][_0xef20('0x30')]);}_0x2d4272['order']=qs[_0xef20('0x4b')](_0x310b52['query'][_0xef20('0x4b')]);_0x2d4272[_0xef20('0x4c')]=qs[_0xef20('0x4d')](_[_0xef20('0x4e')](_0x310b52[_0xef20('0x47')],_0xe99828[_0xef20('0x4d')]),_0x4b72cb);if(_0x310b52[_0xef20('0x47')][_0xef20('0x4f')]){_0x2d4272[_0xef20('0x4c')]=_[_0xef20('0x50')](_0x2d4272[_0xef20('0x4c')],{'$or':_[_0xef20('0x41')](_0x4b72cb,function(_0x438956){if(_0x438956[_0xef20('0x44')]!==_0xef20('0x51')){var _0x1a57c4={};_0x1a57c4[_0x438956[_0xef20('0x3e')]]={'$like':'%'+_0x310b52[_0xef20('0x47')][_0xef20('0x4f')]+'%'};return _0x1a57c4;}})});}_0x2d4272=_[_0xef20('0x50')]({},_0x2d4272,_0x310b52['options']);var _0x335518={'where':_0x2d4272[_0xef20('0x4c')]};return db[_0xef20('0x52')]['count'](_0x335518)['then'](function(_0x108c48){_0x2afa95[_0xef20('0x33')]=_0x108c48;if(_0x310b52['query'][_0xef20('0x53')]){_0x2d4272[_0xef20('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xef20('0x55')](_0x2d4272);})[_0xef20('0x22')](function(_0x4a1623){_0x2afa95[_0xef20('0x56')]=_0x4a1623;return _0x2afa95;})[_0xef20('0x22')](respondWithFilteredResult(_0x51735b,_0x2d4272))[_0xef20('0x2c')](handleError(_0x51735b,null));};exports[_0xef20('0x57')]=function(_0x4b59c4,_0x20dfd4){var _0x2ebc99={'raw':![],'where':{'id':_0x4b59c4['params']['id']},'include':[{'model':db['Pause'],'as':_0xef20('0x40')}]},_0x43148b={};_0x43148b[_0xef20('0x45')]=_[_0xef20('0x46')](db[_0xef20('0x52')][_0xef20('0x42')]);_0x43148b[_0xef20('0x47')]=_[_0xef20('0x46')](_0x4b59c4[_0xef20('0x47')]);_0x43148b[_0xef20('0x4d')]=_[_0xef20('0x58')](_0x43148b[_0xef20('0x45')],_0x43148b['query']);_0x2ebc99[_0xef20('0x48')]=_['intersection'](_0x43148b[_0xef20('0x45')],qs[_0xef20('0x49')](_0x4b59c4[_0xef20('0x47')][_0xef20('0x49')]));_0x2ebc99['attributes']=_0x2ebc99[_0xef20('0x48')]['length']?_0x2ebc99[_0xef20('0x48')]:_0x43148b[_0xef20('0x45')];if(_0x4b59c4[_0xef20('0x47')][_0xef20('0x53')]){_0x2ebc99['include']=[{'all':!![]}];}_0x2ebc99=_[_0xef20('0x50')]({},_0x2ebc99,_0x4b59c4['options']);return db['OpenchannelAccount'][_0xef20('0x59')](_0x2ebc99)[_0xef20('0x22')](handleEntityNotFound(_0x20dfd4,null))[_0xef20('0x22')](respondWithResult(_0x20dfd4,null))[_0xef20('0x2c')](handleError(_0x20dfd4,null));};exports['create']=function(_0x59045c,_0x45a89c){return db[_0xef20('0x52')]['create'](_0x59045c[_0xef20('0x5a')],{})[_0xef20('0x22')](function(_0x480f41){var _0x413282=_0x59045c[_0xef20('0x5b')][_0xef20('0x3b')]({'plain':!![]});if(!_0x413282)throw new Error(_0xef20('0x5c'));if(_0x413282[_0xef20('0x5d')]==='user'){var _0x2d7475=_0x480f41[_0xef20('0x3b')]({'plain':!![]});var _0x102020=_0xef20('0x3c');return db[_0xef20('0x5e')][_0xef20('0x59')]({'where':{'name':_0x102020,'userProfileId':_0x413282[_0xef20('0x5f')]},'raw':!![]})[_0xef20('0x22')](function(_0x2959f9){if(_0x2959f9&&_0x2959f9['autoAssociation']===0x0){return db[_0xef20('0x60')][_0xef20('0x61')]({'name':_0x2d7475['name'],'resourceId':_0x2d7475['id'],'type':_0x2959f9['name'],'sectionId':_0x2959f9['id']},{})[_0xef20('0x22')](function(){return _0x480f41;});}else{return _0x480f41;}})['catch'](function(_0x4f5ef4){logger[_0xef20('0x28')](_0xef20('0x62'),_0x4f5ef4);throw _0x4f5ef4;});}return _0x480f41;})[_0xef20('0x22')](respondWithResult(_0x45a89c,0xc9))[_0xef20('0x2c')](handleError(_0x45a89c,null));};exports[_0xef20('0x39')]=function(_0x48e08e,_0x3d4a21){if(_0x48e08e[_0xef20('0x5a')]['id']){delete _0x48e08e[_0xef20('0x5a')]['id'];}return db['OpenchannelAccount'][_0xef20('0x59')]({'where':{'id':_0x48e08e['params']['id']},'include':[{'model':db[_0xef20('0x3f')],'as':_0xef20('0x40')}]})[_0xef20('0x22')](handleEntityNotFound(_0x3d4a21,null))[_0xef20('0x22')](saveUpdates(_0x48e08e[_0xef20('0x5a')],null))[_0xef20('0x22')](respondWithResult(_0x3d4a21,null))[_0xef20('0x2c')](handleError(_0x3d4a21,null));};exports[_0xef20('0x3a')]=function(_0x2a0952,_0x4b43f3){return db[_0xef20('0x52')]['find']({'where':{'id':_0x2a0952[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x4b43f3,null))[_0xef20('0x22')](removeEntity(_0x4b43f3,null))[_0xef20('0x2c')](handleError(_0x4b43f3,null));};exports[_0xef20('0x64')]=function(_0x3d82e8,_0x6ef7b0){return db[_0xef20('0x52')][_0xef20('0x64')]()[_0xef20('0x22')](respondWithResult(_0x6ef7b0,null))[_0xef20('0x2c')](handleError(_0x6ef7b0,null));};exports[_0xef20('0x65')]=function(_0x154bbe,_0x3ef7f3,_0x137bd5){if(_0x154bbe['body']['id']){delete _0x154bbe[_0xef20('0x5a')]['id'];}return db['OpenchannelAccount'][_0xef20('0x59')]({'where':{'id':_0x154bbe[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x3ef7f3,null))[_0xef20('0x22')](function(_0x21039b){if(_0x21039b){_0x154bbe[_0xef20('0x5a')][_0xef20('0x66')]=_0x21039b['id'];return db[_0xef20('0x67')][_0xef20('0x61')](_0x154bbe['body']);}})[_0xef20('0x22')](respondWithResult(_0x3ef7f3,null))[_0xef20('0x2c')](handleError(_0x3ef7f3,null));};exports[_0xef20('0x68')]=function(_0x42512e,_0x40c326,_0x4215a7){var _0x711269={'raw':![],'where':{}};var _0x32c047={};var _0x5750fb={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xef20('0x69')]({'where':{'id':_0x42512e[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x40c326,null))[_0xef20('0x22')](function(_0x2eb2e0){if(_0x2eb2e0){_0x32c047['model']=_[_0xef20('0x46')](db['Disposition']['rawAttributes']);_0x32c047[_0xef20('0x47')]=_['keys'](_0x42512e[_0xef20('0x47')]);_0x32c047['filters']=_[_0xef20('0x58')](_0x32c047['model'],_0x32c047['query']);_0x711269[_0xef20('0x48')]=_[_0xef20('0x58')](_0x32c047[_0xef20('0x45')],qs[_0xef20('0x49')](_0x42512e[_0xef20('0x47')]['fields']));_0x711269[_0xef20('0x48')]=_0x711269[_0xef20('0x48')][_0xef20('0x4a')]?_0x711269[_0xef20('0x48')]:_0x32c047[_0xef20('0x45')];if(!_0x42512e[_0xef20('0x47')][_0xef20('0x6a')]('nolimit')){_0x711269['limit']=qs[_0xef20('0x32')](_0x42512e['query'][_0xef20('0x32')]);_0x711269[_0xef20('0x30')]=qs[_0xef20('0x30')](_0x42512e['query'][_0xef20('0x30')]);}_0x711269[_0xef20('0x6b')]=qs[_0xef20('0x4b')](_0x42512e[_0xef20('0x47')][_0xef20('0x4b')]);_0x711269[_0xef20('0x4c')]=qs[_0xef20('0x4d')](_[_0xef20('0x4e')](_0x42512e[_0xef20('0x47')],_0x32c047[_0xef20('0x4d')]));_0x711269['where'][_0xef20('0x66')]=_0x2eb2e0['id'];if(_0x42512e['query'][_0xef20('0x4f')]){_0x711269[_0xef20('0x4c')]=_[_0xef20('0x50')](_0x711269[_0xef20('0x4c')],{'$or':_[_0xef20('0x41')](_0x711269[_0xef20('0x48')],function(_0x157b4d){var _0xd7ba8a={};_0xd7ba8a[_0x157b4d]={'$like':'%'+_0x42512e[_0xef20('0x47')]['filter']+'%'};return _0xd7ba8a;})});}_0x711269=_[_0xef20('0x50')]({},_0x711269,_0x42512e[_0xef20('0x6c')]);return db['Disposition'][_0xef20('0x33')]({'where':_0x711269['where']})['then'](function(_0x166817){_0x5750fb[_0xef20('0x33')]=_0x166817;if(_0x42512e[_0xef20('0x47')]['includeAll']){_0x711269['include']=[{'all':!![]}];}return db[_0xef20('0x67')]['findAll'](_0x711269);})[_0xef20('0x22')](function(_0xefc860){_0x5750fb['rows']=_0xefc860;return _0x5750fb;});}})[_0xef20('0x22')](respondWithFilteredResult(_0x40c326,_0x711269))[_0xef20('0x2c')](handleError(_0x40c326,null));};exports['removeDispositions']=function(_0x8e0214,_0x52f634,_0x242afb){return db[_0xef20('0x52')][_0xef20('0x59')]({'where':{'id':_0x8e0214[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x52f634,null))[_0xef20('0x22')](function(_0x540483){if(_0x540483){return _0x540483[_0xef20('0x6d')](_0x8e0214['query']['ids']);}})[_0xef20('0x22')](respondWithStatusCode(_0x52f634,null))[_0xef20('0x2c')](handleError(_0x52f634,null));};exports['addAnswer']=function(_0x2b05e9,_0x43fef2,_0x1ac370){if(_0x2b05e9['body']['id']){delete _0x2b05e9['body']['id'];}return db[_0xef20('0x52')][_0xef20('0x59')]({'where':{'id':_0x2b05e9[_0xef20('0x63')]['id']}})['then'](handleEntityNotFound(_0x43fef2,null))[_0xef20('0x22')](function(_0x39242a){if(_0x39242a){_0x2b05e9['body'][_0xef20('0x66')]=_0x39242a['id'];return db[_0xef20('0x6e')][_0xef20('0x61')](_0x2b05e9[_0xef20('0x5a')]);}})[_0xef20('0x22')](respondWithResult(_0x43fef2,null))[_0xef20('0x2c')](handleError(_0x43fef2,null));};exports['getAnswers']=function(_0x22aa4d,_0x5e476e,_0x2b769c){var _0x205761={'raw':![],'where':{}};var _0x35b1ce={};var _0x1ede35={'count':0x0,'rows':[]};return db[_0xef20('0x52')]['findOne']({'where':{'id':_0x22aa4d[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x5e476e,null))['then'](function(_0x4a565d){if(_0x4a565d){_0x35b1ce[_0xef20('0x45')]=_[_0xef20('0x46')](db[_0xef20('0x6e')][_0xef20('0x42')]);_0x35b1ce[_0xef20('0x47')]=_[_0xef20('0x46')](_0x22aa4d[_0xef20('0x47')]);_0x35b1ce['filters']=_[_0xef20('0x58')](_0x35b1ce[_0xef20('0x45')],_0x35b1ce[_0xef20('0x47')]);_0x205761[_0xef20('0x48')]=_['intersection'](_0x35b1ce[_0xef20('0x45')],qs[_0xef20('0x49')](_0x22aa4d[_0xef20('0x47')][_0xef20('0x49')]));_0x205761[_0xef20('0x48')]=_0x205761[_0xef20('0x48')][_0xef20('0x4a')]?_0x205761['attributes']:_0x35b1ce[_0xef20('0x45')];if(!_0x22aa4d[_0xef20('0x47')]['hasOwnProperty']('nolimit')){_0x205761[_0xef20('0x32')]=qs[_0xef20('0x32')](_0x22aa4d[_0xef20('0x47')][_0xef20('0x32')]);_0x205761[_0xef20('0x30')]=qs['offset'](_0x22aa4d['query'][_0xef20('0x30')]);}_0x205761['order']=qs[_0xef20('0x4b')](_0x22aa4d[_0xef20('0x47')]['sort']);_0x205761['where']=qs[_0xef20('0x4d')](_[_0xef20('0x4e')](_0x22aa4d['query'],_0x35b1ce['filters']));_0x205761[_0xef20('0x4c')][_0xef20('0x66')]=_0x4a565d['id'];if(_0x22aa4d['query']['filter']){_0x205761[_0xef20('0x4c')]=_['merge'](_0x205761[_0xef20('0x4c')],{'$or':_[_0xef20('0x41')](_0x205761[_0xef20('0x48')],function(_0xe9af7c){var _0x2d4ecf={};_0x2d4ecf[_0xe9af7c]={'$like':'%'+_0x22aa4d['query'][_0xef20('0x4f')]+'%'};return _0x2d4ecf;})});}_0x205761=_[_0xef20('0x50')]({},_0x205761,_0x22aa4d[_0xef20('0x6c')]);return db[_0xef20('0x6e')][_0xef20('0x33')]({'where':_0x205761[_0xef20('0x4c')]})[_0xef20('0x22')](function(_0x5c6602){_0x1ede35[_0xef20('0x33')]=_0x5c6602;if(_0x22aa4d[_0xef20('0x47')]['includeAll']){_0x205761['include']=[{'all':!![]}];}return db[_0xef20('0x6e')][_0xef20('0x55')](_0x205761);})[_0xef20('0x22')](function(_0x5aef7c){_0x1ede35[_0xef20('0x56')]=_0x5aef7c;return _0x1ede35;});}})[_0xef20('0x22')](respondWithFilteredResult(_0x5e476e,_0x205761))[_0xef20('0x2c')](handleError(_0x5e476e,null));};exports['removeAnswers']=function(_0x44f902,_0x3ffa31,_0x2554bf){return db['OpenchannelAccount']['find']({'where':{'id':_0x44f902[_0xef20('0x63')]['id']}})['then'](handleEntityNotFound(_0x3ffa31,null))[_0xef20('0x22')](function(_0x401d56){if(_0x401d56){return _0x401d56[_0xef20('0x6f')](_0x44f902[_0xef20('0x47')][_0xef20('0x70')]);}})[_0xef20('0x22')](respondWithStatusCode(_0x3ffa31,null))[_0xef20('0x2c')](handleError(_0x3ffa31,null));};exports[_0xef20('0x71')]=function(_0x25dd10,_0xb33f80,_0x5b9bae){var _0x4ee010={'body':_0x25dd10['body'],'channel':_0xef20('0x72')};var _0x365984=[];var _0xb524c6=[];var _0x1e19f2={};var _0x2116ec=![];return db[_0xef20('0x73')]['describe']()[_0xef20('0x22')](function(_0x1baed7){if(!_0x1baed7){throw new db[(_0xef20('0x74'))][(_0xef20('0x75'))](_0xef20('0x76'));}_0x365984=_[_0xef20('0x77')](_['keys'](_0x1baed7),[_0xef20('0x78'),_0xef20('0x79')]);_0xb524c6=_[_0xef20('0x77')](_[_0xef20('0x46')](_0x1baed7),['createdAt',_0xef20('0x79'),_0xef20('0x7a'),_0xef20('0x7b')]);if(_0x25dd10[_0xef20('0x5a')]['id']){delete _0x25dd10['body']['id'];}if(_[_0xef20('0x7c')](_0x25dd10[_0xef20('0x5a')]['from'])){throw new db[(_0xef20('0x74'))]['ValidationError'](_0xef20('0x7d'));}if(_[_0xef20('0x7c')](_0x25dd10[_0xef20('0x5a')][_0xef20('0x5a')])||_0x25dd10['body']['body']===''){throw new db[(_0xef20('0x74'))][(_0xef20('0x75'))](_0xef20('0x7e'));}if(_[_0xef20('0x7c')](_0x25dd10[_0xef20('0x5a')]['mapKey'])){throw new db['Sequelize'][(_0xef20('0x75'))](_0xef20('0x7f')+_0xb524c6);}if(!_[_0xef20('0x80')](_0xb524c6,_0x25dd10[_0xef20('0x5a')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xef20('0x81')+_0xb524c6);}_0x1e19f2[_0x25dd10[_0xef20('0x5a')][_0xef20('0x82')]]=_0x25dd10[_0xef20('0x5a')][_0xef20('0x83')];})[_0xef20('0x22')](function(){return db[_0xef20('0x52')][_0xef20('0x59')]({'where':{'id':_0x25dd10[_0xef20('0x63')]['id']},'include':[{'model':db[_0xef20('0x84')],'as':_0xef20('0x85'),'include':[{'model':db[_0xef20('0x73')],'as':_0xef20('0x86'),'where':_0x1e19f2,'limit':0x1,'order':[[_0xef20('0x79'),_0xef20('0x87')]]}]},{'model':db[_0xef20('0x88')],'as':_0xef20('0x89')}]});})['then'](handleEntityNotFound(_0xb33f80,null))['then'](function(_0x5af878){if(_0x5af878&&_0x5af878[_0xef20('0x85')]){_0x4ee010[_0xef20('0x8a')]=_0x5af878;_0x4ee010[_0xef20('0x8b')]=_0x5af878['Applications'];_0x4ee010[_0xef20('0x8c')]=_0x5af878[_0xef20('0x85')];_0x4ee010[_0xef20('0x8b')]=_[_0xef20('0x8d')](_0x4ee010['applications'],['priority'],['asc']);if(_0x4ee010['account'][_0xef20('0x89')]){delete _0x4ee010['account']['Applications'];}if(_0x4ee010[_0xef20('0x8a')][_0xef20('0x85')]&&_0x4ee010[_0xef20('0x8a')]['List'][_0xef20('0x86')][_0xef20('0x4a')]){return _0x4ee010[_0xef20('0x8a')]['List'][_0xef20('0x86')][0x0];}var _0x5685db=_[_0xef20('0x1a')](_0x25dd10[_0xef20('0x5a')],{'firstName':_0x25dd10[_0xef20('0x5a')][_0xef20('0x83')],'ListId':_0x5af878[_0xef20('0x7b')]});_0x5685db[_0x25dd10[_0xef20('0x5a')][_0xef20('0x82')]]=_0x25dd10[_0xef20('0x5a')][_0xef20('0x83')];return db[_0xef20('0x73')][_0xef20('0x61')](_0x5685db,{'fields':_0x365984,'raw':!![]});}})[_0xef20('0x22')](handleEntityNotFound(_0xb33f80,null))[_0xef20('0x22')](function(_0x4239bc){_0x4ee010['contact']=_0x4239bc;if(_0x4239bc){var _0x53f16c={'ContactId':_0x4239bc['id'],'OpenchannelAccountId':_0x25dd10['params']['id'],'from':(_0x4239bc[_0xef20('0x8e')]||'')+'\x20'+(_0x4239bc[_0xef20('0x8f')]||'')};var _0x3414e6={'OpenchannelAccountId':_0x25dd10['params']['id'],'closed':![]};if(_0x25dd10[_0xef20('0x5a')][_0xef20('0x90')]){_0x3414e6[_0xef20('0x90')]=_0x25dd10[_0xef20('0x5a')][_0xef20('0x90')];return db[_0xef20('0x91')][_0xef20('0x59')]({'where':_0x3414e6})['then'](function(_0x4965f9){if(_0x4965f9){return[_0x4965f9,![]];}_0x53f16c[_0xef20('0x90')]=_0x25dd10[_0xef20('0x5a')][_0xef20('0x90')];_0x53f16c[_0xef20('0x92')]=_0x25dd10[_0xef20('0x5a')][_0xef20('0x92')];return db[_0xef20('0x91')][_0xef20('0x61')](_0x53f16c)[_0xef20('0x22')](function(_0x1307ee){return[_0x1307ee,!![]];});});}else{_0x3414e6[_0xef20('0x90')]=null;}_0x3414e6[_0xef20('0x93')]=_0x4239bc['id'];return db[_0xef20('0x91')]['find']({'where':_0x3414e6})[_0xef20('0x22')](function(_0x16e8be){if(_0x16e8be){return[_0x16e8be,![]];}return db['OpenchannelInteraction'][_0xef20('0x61')](_0x53f16c)[_0xef20('0x22')](function(_0x211190){return[_0x211190,!![]];});});}})[_0xef20('0x94')](function(_0x484946,_0x6a60ff){if(_0x484946){_0x2116ec=_0x6a60ff;if(!_0x6a60ff){var _0x2b97fd={'from':(_0x4ee010['contact'][_0xef20('0x8e')]||'')+'\x20'+(_0x4ee010[_0xef20('0x95')][_0xef20('0x8f')]||'')};if(_0x25dd10[_0xef20('0x5a')][_0xef20('0x90')]&&_0x25dd10[_0xef20('0x5a')]['messageId']&&_0x25dd10['body'][_0xef20('0x90')]!=_0x25dd10[_0xef20('0x5a')][_0xef20('0x96')]){_0x2b97fd[_0xef20('0x90')]=_0x25dd10[_0xef20('0x5a')][_0xef20('0x96')];}return _0x484946[_0xef20('0x39')](_0x2b97fd);}else{return _0x484946;}}})[_0xef20('0x22')](function(_0x15a3b8){_0x4ee010[_0xef20('0x97')]=_0x15a3b8[_0xef20('0x3b')]({'plain':!![]});_0x4ee010[_0xef20('0x97')][_0xef20('0x98')]=_0x2116ec;if(_0x4ee010[_0xef20('0x97')][_0xef20('0x98')]){if(_0x4ee010[_0xef20('0x8a')][_0xef20('0x99')]){_0x4ee010[_0xef20('0x8b')][_0xef20('0x9a')]({'id':0x0,'priority':_0x4ee010['applications'][_0xef20('0x4a')]+0x1,'app':_0xef20('0x9b'),'appdata':_0xef20('0x9c'),'interval':_0xef20('0x9d')});}}return db[_0xef20('0x9e')][_0xef20('0x61')]({'body':_0x25dd10[_0xef20('0x5a')][_0xef20('0x5a')],'OpenchannelAccountId':_0x25dd10['params']['id'],'OpenchannelInteractionId':_0x15a3b8['id'],'direction':'in','ContactId':_0x4ee010[_0xef20('0x95')]['id'],'AttachmentId':_0x25dd10[_0xef20('0x5a')][_0xef20('0x9f')]});})[_0xef20('0x22')](function(_0x317ba3){_0x4ee010['message']=_0x317ba3;if(_0x4ee010[_0xef20('0x97')][_0xef20('0xa0')]){return db['User'][_0xef20('0x59')]({'attributes':['id','name'],'where':{'id':_0x4ee010['interaction'][_0xef20('0xa0')]}})[_0xef20('0x22')](function(_0x336428){if(_0x336428){_0x4ee010[_0xef20('0x8b')][_0xef20('0xa1')]({'id':0x0,'priority':0x0,'app':_0xef20('0xa2'),'appdata':_0x336428[_0xef20('0x3e')]+','+(_0x4ee010[_0xef20('0x8a')][_0xef20('0xa3')]||0xa),'interval':_0xef20('0x9d')});_0x4ee010[_0xef20('0xa4')]=![];}return respondWithRpcPromise('Start',_0xef20('0xa5'),_0x4ee010);});}return respondWithRpcPromise('Start',_0xef20('0xa5'),_0x4ee010);})[_0xef20('0x22')](function(_0x1a5611){respondWithRpcPromise(_0xef20('0xa6'),_0xef20('0xa6'),{'event':_0xef20('0x71'),'message':_0x1a5611},client9002);return _0x1a5611;})[_0xef20('0x22')](respondWithResult(_0xb33f80,null))[_0xef20('0x2c')](handleError(_0xb33f80,null));};exports[_0xef20('0xa7')]=function(_0x296c8a,_0x4742d2){var _0x374ad8=_0x296c8a[_0xef20('0x63')]['id'];var _0xd8c28f=_0x296c8a[_0xef20('0x5a')];var _0x1b1176=0xc8;var _0x271d5e=null;return db[_0xef20('0xa8')][_0xef20('0xa9')]({'isolationLevel':db[_0xef20('0xa8')][_0xef20('0xaa')]['ISOLATION_LEVELS'][_0xef20('0xab')]},function(_0x5b7519){return db['OpenchannelAccount'][_0xef20('0x69')]({'where':{'id':_0x374ad8},'transaction':_0x5b7519})[_0xef20('0x22')](function(_0x3500da){if(_0x3500da){return db[_0xef20('0x88')][_0xef20('0x3a')]({'where':{'OpenchannelAccountId':_0x374ad8},'transaction':_0x5b7519})['then'](function(){var _0x4c7627=_[_0xef20('0x41')](_0xd8c28f,function(_0x4b7056){_0x4b7056[_0xef20('0x66')]=_0x374ad8;return _0x4b7056;});return db[_0xef20('0x88')][_0xef20('0xac')](_0x4c7627,{'transaction':_0x5b7519});});}else{_0x1b1176=0x194;_0x271d5e=[];}});})[_0xef20('0x22')](function(){if(_0x1b1176!==0x194){return db[_0xef20('0x88')][_0xef20('0xad')]({'where':{'OpenchannelAccountId':_0x374ad8},'order':_0xef20('0xae')})[_0xef20('0x22')](function(_0x3b2b31){_0x271d5e=_0x3b2b31;});}})['catch'](function(_0x35777c){_0x1b1176=0x1f4;logger[_0xef20('0x28')](_0x35777c['stack']);if(_0x35777c[_0xef20('0x3e')]){delete _0x35777c[_0xef20('0x3e')];}_0x271d5e=_0x35777c;})[_0xef20('0xaf')](function(){if(_0x271d5e===null){_0x4742d2[_0xef20('0x2d')](_0x1b1176);}else{if(_0x1b1176===0x1f4){_0x4742d2[_0xef20('0x2e')](_0x1b1176)['send'](_0x271d5e);}else{_0x4742d2[_0xef20('0x2e')](_0x1b1176)['json'](_0x271d5e);}}});};exports['getApplications']=function(_0x35b385,_0x5e5c0c,_0x2083a0){var _0x255bc9={};var _0xba1d57={};var _0x372ab2;var _0x55595d;return db['OpenchannelAccount'][_0xef20('0x69')]({'where':{'id':_0x35b385[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x5e5c0c,null))[_0xef20('0x22')](function(_0x1019fd){if(_0x1019fd){_0x372ab2=_0x1019fd;_0xba1d57[_0xef20('0x45')]=_['keys'](db[_0xef20('0x88')][_0xef20('0x42')]);_0xba1d57[_0xef20('0x47')]=_[_0xef20('0x46')](_0x35b385[_0xef20('0x47')]);_0xba1d57['filters']=_[_0xef20('0x58')](_0xba1d57[_0xef20('0x45')],_0xba1d57[_0xef20('0x47')]);_0x255bc9[_0xef20('0x48')]=_[_0xef20('0x58')](_0xba1d57['model'],qs['fields'](_0x35b385[_0xef20('0x47')]['fields']));_0x255bc9[_0xef20('0x48')]=_0x255bc9[_0xef20('0x48')][_0xef20('0x4a')]?_0x255bc9['attributes']:_0xba1d57['model'];_0x255bc9[_0xef20('0x6b')]=qs[_0xef20('0x4b')](_0x35b385[_0xef20('0x47')][_0xef20('0x4b')]);_0x255bc9['where']=qs[_0xef20('0x4d')](_[_0xef20('0x4e')](_0x35b385[_0xef20('0x47')],_0xba1d57[_0xef20('0x4d')]));if(_0x35b385[_0xef20('0x47')][_0xef20('0x4f')]){_0x255bc9[_0xef20('0x4c')]=_['merge'](_0x255bc9[_0xef20('0x4c')],{'$or':_[_0xef20('0x41')](_0x255bc9['attributes'],function(_0xcb5c5f){var _0x3d92cd={};_0x3d92cd[_0xcb5c5f]={'$like':'%'+_0x35b385['query'][_0xef20('0x4f')]+'%'};return _0x3d92cd;})});}_0x255bc9=_[_0xef20('0x50')]({},_0x255bc9,_0x35b385[_0xef20('0x6c')]);return _0x372ab2[_0xef20('0xb0')](_0x255bc9);}})[_0xef20('0x22')](function(_0x424287){if(_0x424287){_0x55595d=_0x424287['length'];if(!_0x35b385[_0xef20('0x47')][_0xef20('0x6a')](_0xef20('0xb1'))){_0x255bc9[_0xef20('0x32')]=qs[_0xef20('0x32')](_0x35b385['query'][_0xef20('0x32')]);_0x255bc9[_0xef20('0x30')]=qs[_0xef20('0x30')](_0x35b385['query'][_0xef20('0x30')]);}return _0x372ab2['getApplications'](_0x255bc9);}})[_0xef20('0x22')](function(_0x17d352){if(_0x17d352){return _0x17d352?{'count':_0x55595d,'rows':_0x17d352}:null;}})[_0xef20('0x22')](respondWithResult(_0x5e5c0c,null))[_0xef20('0x2c')](handleError(_0x5e5c0c,null));};exports[_0xef20('0xb2')]=function(_0x12ce6e,_0x2ecb35,_0x56edc4){var _0x250a5a={'raw':![],'where':{}};var _0x3500ef={};var _0x59b5fc={'count':0x0,'rows':[]};return db[_0xef20('0x52')][_0xef20('0x69')]({'where':{'id':_0x12ce6e[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x2ecb35,null))[_0xef20('0x22')](function(_0x170517){if(_0x170517){_0x3500ef[_0xef20('0x45')]=_[_0xef20('0x46')](db['OpenchannelInteraction'][_0xef20('0x42')]);_0x3500ef[_0xef20('0x47')]=_[_0xef20('0x46')](_0x12ce6e['query']);_0x3500ef[_0xef20('0x4d')]=_[_0xef20('0x58')](_0x3500ef[_0xef20('0x45')],_0x3500ef['query']);_0x250a5a[_0xef20('0x48')]=_[_0xef20('0x58')](_0x3500ef['model'],qs[_0xef20('0x49')](_0x12ce6e[_0xef20('0x47')][_0xef20('0x49')]));_0x250a5a['attributes']=_0x250a5a[_0xef20('0x48')][_0xef20('0x4a')]?_0x250a5a[_0xef20('0x48')]:_0x3500ef[_0xef20('0x45')];if(!_0x12ce6e['query']['hasOwnProperty'](_0xef20('0xb1'))){_0x250a5a[_0xef20('0x32')]=qs['limit'](_0x12ce6e['query']['limit']);_0x250a5a[_0xef20('0x30')]=qs[_0xef20('0x30')](_0x12ce6e[_0xef20('0x47')][_0xef20('0x30')]);}_0x250a5a['order']=qs[_0xef20('0x4b')](_0x12ce6e[_0xef20('0x47')][_0xef20('0x4b')]);_0x250a5a[_0xef20('0x4c')]=qs[_0xef20('0x4d')](_[_0xef20('0x4e')](_0x12ce6e[_0xef20('0x47')],_0x3500ef[_0xef20('0x4d')]));_0x250a5a[_0xef20('0x4c')]['OpenchannelAccountId']=_0x170517['id'];if(_0x12ce6e[_0xef20('0x47')]['filter']){_0x250a5a[_0xef20('0x4c')]=_[_0xef20('0x50')](_0x250a5a[_0xef20('0x4c')],{'$or':_[_0xef20('0x41')](_0x250a5a['attributes'],function(_0x5d0b52){var _0x439274={};_0x439274[_0x5d0b52]={'$like':'%'+_0x12ce6e[_0xef20('0x47')]['filter']+'%'};return _0x439274;})});}_0x250a5a=_[_0xef20('0x50')]({},_0x250a5a,_0x12ce6e['options']);return db[_0xef20('0x91')][_0xef20('0x33')]({'where':_0x250a5a[_0xef20('0x4c')]})[_0xef20('0x22')](function(_0x5b9fac){_0x59b5fc[_0xef20('0x33')]=_0x5b9fac;if(_0x12ce6e[_0xef20('0x47')][_0xef20('0x53')]){_0x250a5a[_0xef20('0x54')]=[{'model':db[_0xef20('0x73')],'as':_0xef20('0xb3'),'required':![]},{'model':db[_0xef20('0xb4')],'as':_0xef20('0xb5'),'attributes':['name',_0xef20('0xb6'),_0xef20('0xb7')],'required':![]},{'model':db['Tag'],'as':_0xef20('0xb8'),'attributes':['id','name',_0xef20('0xb9')],'where':_0x12ce6e[_0xef20('0x47')][_0xef20('0xba')]?{'id':_0x12ce6e[_0xef20('0x47')][_0xef20('0xba')]}:undefined,'required':_0x12ce6e['query'][_0xef20('0xba')]?!![]:![]}];}return db[_0xef20('0x91')][_0xef20('0x55')](_0x250a5a);})[_0xef20('0x22')](function(_0x3a5f16){_0x59b5fc['rows']=_0x3a5f16;return _0x59b5fc;});}})['then'](respondWithFilteredResult(_0x2ecb35,_0x250a5a))[_0xef20('0x2c')](handleError(_0x2ecb35,null));};exports[_0xef20('0xbb')]=function(_0x41e290,_0x5d4e96,_0x318623){return db[_0xef20('0x52')]['find']({'where':{'id':_0x41e290[_0xef20('0x63')]['id']}})['then'](handleEntityNotFound(_0x5d4e96,null))['then'](function(_0x2b396a){if(_0x2b396a){return _0x2b396a[_0xef20('0xbb')](_0x41e290[_0xef20('0x5a')][_0xef20('0x70')],_[_0xef20('0xbc')](_0x41e290[_0xef20('0x5a')],[_0xef20('0x70'),'id'])||{})[_0xef20('0x94')](function(_0xeadeb8){for(var _0x10d2d=0x0;_0x10d2d<_0x41e290[_0xef20('0x5a')][_0xef20('0x70')][_0xef20('0x4a')];_0x10d2d+=0x1){socket[_0xef20('0xbd')](_0xef20('0xbe'),{'UserId':Number(_0x41e290['body'][_0xef20('0x70')][_0x10d2d]),'OpenchannelAccountId':Number(_0x41e290[_0xef20('0x63')]['id'])});}return _0xeadeb8;});}})[_0xef20('0x22')](respondWithResult(_0x5d4e96,null))[_0xef20('0x2c')](handleError(_0x5d4e96,null));};exports[_0xef20('0xbf')]=function(_0x3202a1,_0x2386e5,_0x306738){return db[_0xef20('0x52')][_0xef20('0x59')]({'where':{'id':_0x3202a1[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x2386e5,null))['then'](function(_0x4ff387){if(_0x4ff387){return _0x4ff387[_0xef20('0xbf')](_0x3202a1[_0xef20('0x47')][_0xef20('0x70')])[_0xef20('0x22')](function(){if(_[_0xef20('0xc0')](_0x3202a1['query']['ids'])){for(var _0x529450=0x0;_0x529450<_0x3202a1[_0xef20('0x47')][_0xef20('0x70')][_0xef20('0x4a')];_0x529450+=0x1){socket['emit'](_0xef20('0xc1'),{'UserId':Number(_0x3202a1[_0xef20('0x47')][_0xef20('0x70')][_0x529450]),'OpenchannelAccountId':Number(_0x3202a1[_0xef20('0x63')]['id'])});}}else{socket[_0xef20('0xbd')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3202a1[_0xef20('0x47')][_0xef20('0x70')]),'OpenchannelAccountId':Number(_0x3202a1[_0xef20('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x2386e5,null))['catch'](handleError(_0x2386e5,null));};exports[_0xef20('0xc2')]=function(_0xc5852c,_0x17fb89,_0x481d35){var _0x1972a2={};var _0x7d8065={};var _0x55b715;var _0x128f83;return db[_0xef20('0x52')]['findOne']({'where':{'id':_0xc5852c[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x17fb89,null))[_0xef20('0x22')](function(_0xd32b08){if(_0xd32b08){_0x55b715=_0xd32b08;_0x7d8065[_0xef20('0x45')]=_[_0xef20('0x46')](db[_0xef20('0xb4')][_0xef20('0x42')]);_0x7d8065[_0xef20('0x47')]=_[_0xef20('0x46')](_0xc5852c[_0xef20('0x47')]);_0x7d8065['filters']=_[_0xef20('0x58')](_0x7d8065['model'],_0x7d8065[_0xef20('0x47')]);_0x1972a2[_0xef20('0x48')]=_[_0xef20('0x58')](_0x7d8065[_0xef20('0x45')],qs[_0xef20('0x49')](_0xc5852c[_0xef20('0x47')][_0xef20('0x49')]));_0x1972a2[_0xef20('0x48')]=_0x1972a2[_0xef20('0x48')][_0xef20('0x4a')]?_0x1972a2[_0xef20('0x48')]:_0x7d8065[_0xef20('0x45')];_0x1972a2[_0xef20('0x6b')]=qs[_0xef20('0x4b')](_0xc5852c['query'][_0xef20('0x4b')]);_0x1972a2[_0xef20('0x4c')]=qs['filters'](_['pick'](_0xc5852c[_0xef20('0x47')],_0x7d8065[_0xef20('0x4d')]));if(_0xc5852c['query'][_0xef20('0x4f')]){_0x1972a2[_0xef20('0x4c')]=_[_0xef20('0x50')](_0x1972a2['where'],{'$or':_[_0xef20('0x41')](_0x1972a2[_0xef20('0x48')],function(_0xffb28d){var _0x22a8e9={};_0x22a8e9[_0xffb28d]={'$like':'%'+_0xc5852c[_0xef20('0x47')][_0xef20('0x4f')]+'%'};return _0x22a8e9;})});}_0x1972a2=_[_0xef20('0x50')]({},_0x1972a2,_0xc5852c[_0xef20('0x6c')]);return _0x55b715[_0xef20('0xc2')](_0x1972a2);}})[_0xef20('0x22')](function(_0x3673ba){if(_0x3673ba){_0x128f83=_0x3673ba[_0xef20('0x4a')];if(!_0xc5852c['query']['hasOwnProperty'](_0xef20('0xb1'))){_0x1972a2[_0xef20('0x32')]=qs[_0xef20('0x32')](_0xc5852c[_0xef20('0x47')][_0xef20('0x32')]);_0x1972a2['offset']=qs[_0xef20('0x30')](_0xc5852c['query'][_0xef20('0x30')]);}return _0x55b715['getAgents'](_0x1972a2);}})[_0xef20('0x22')](function(_0x43fd81){if(_0x43fd81){return _0x43fd81?{'count':_0x128f83,'rows':_0x43fd81}:null;}})['then'](respondWithResult(_0x17fb89,null))[_0xef20('0x2c')](handleError(_0x17fb89,null));};exports[_0xef20('0xc3')]=function(_0x1cea66,_0x2197f6,_0x3ec3e8){var _0x366e98,_0x1eea50,_0x2afd83;if(_[_0xef20('0x7c')](_0x1cea66[_0xef20('0x5a')]['body'])||_0x1cea66[_0xef20('0x5a')][_0xef20('0x5a')]===''){throw new db['Sequelize'][(_0xef20('0x75'))](_0xef20('0x7e'));}if(_[_0xef20('0x7c')](_0x1cea66['body']['to'])){}_0x366e98=_0x1cea66['body']['to'];return db['OpenchannelAccount'][_0xef20('0x69')]({'where':{'id':_0x1cea66[_0xef20('0x63')]['id']}})[_0xef20('0x22')](handleEntityNotFound(_0x2197f6,null))[_0xef20('0x22')](function(_0xd36288){if(_0xd36288){return db[_0xef20('0x52')][_0xef20('0x59')]({'where':{'id':_0xd36288['id']},'include':[{'model':db[_0xef20('0x84')],'as':_0xef20('0x85'),'include':[{'model':db[_0xef20('0x73')],'as':'Contacts','where':{[_0xd36288[_0xef20('0x82')]]:_0x366e98},'limit':0x1,'order':[[_0xef20('0x79'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x2197f6,null))[_0xef20('0x22')](function(_0x32a835){if(_0x32a835&&_0x32a835[_0xef20('0x85')]){_0x1eea50=_0x32a835[_0xef20('0x3b')]({'plain':!![]});if(_0x1eea50['List']&&_0x1eea50[_0xef20('0x85')]['Contacts'][_0xef20('0x4a')]){return _0x1eea50['List'][_0xef20('0x86')][0x0];}return db['CmContact'][_0xef20('0x61')](_[_0xef20('0x1a')](_0x1cea66[_0xef20('0x5a')],{'firstName':_0x366e98,[_0x32a835[_0xef20('0x82')]]:_0x366e98,'phone':_0x366e98,'ListId':_0x1eea50[_0xef20('0x7b')]}));}})[_0xef20('0x22')](handleEntityNotFound(_0x2197f6,null))[_0xef20('0x22')](function(_0x48c5e5){if(_0x48c5e5){_0x2afd83=_0x48c5e5;return db['OpenchannelInteraction'][_0xef20('0x59')]({'where':{'ContactId':_0x2afd83['id'],'closed':![],'OpenchannelAccountId':_0x1eea50['id']}})[_0xef20('0x22')](function(_0x1c1d8d){if(_0x1c1d8d){return[_0x1c1d8d,![]];}return db[_0xef20('0x91')][_0xef20('0x61')]({'UserId':_0x1cea66[_0xef20('0x5b')]['id'],'ContactId':_0x2afd83['id'],'OpenchannelAccountId':_0x1eea50['id'],'lastMsgDirection':_0xef20('0xc4'),'Messages':[_[_0xef20('0x50')](_0x1cea66[_0xef20('0x5a')],{'read':![],'body':_0x1cea66[_0xef20('0x5a')][_0xef20('0x5a')],'OpenchannelAccountId':_0x1eea50['id'],'UserId':_0x1cea66[_0xef20('0x5b')]['id'],'ContactId':_0x2afd83['id']})]},{'include':[{'model':db[_0xef20('0x9e')],'as':_0xef20('0xc5')}]})['then'](function(_0x4b1b17){return[_0x4b1b17,!![]];});});}})[_0xef20('0x94')](function(_0x3be533,_0x3e8cf4){if(_0x3e8cf4){return _0x3be533;}return db[_0xef20('0x9e')][_0xef20('0x61')](_['merge'](_0x1cea66[_0xef20('0x5a')],{'read':![],'body':_0x1cea66['body'][_0xef20('0x5a')],'OpenchannelAccountId':_0x1eea50['id'],'OpenchannelInteractionId':_0x3be533['id'],'UserId':_0x1cea66[_0xef20('0x5b')]['id'],'ContactId':_0x2afd83['id']}))['then'](function(_0x59f22b){_0x3be533['dataValues'][_0xef20('0xc5')]=[];_0x3be533[_0xef20('0xc6')][_0xef20('0xc5')][_0xef20('0x9a')](_0x59f22b['dataValues']);return _0x3be533;});});}})[_0xef20('0x22')](respondWithResult(_0x2197f6,null))[_0xef20('0x2c')](handleError(_0x2197f6,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1d16bdc..cef8b7d 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 _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x668b,0x140));var _0xb668=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x668b[_0x14e9f0];return _0xa63f7e;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x10be49,_0x1af9a3){var _0x3bd308=function(_0x3bf1c3){while(--_0x3bf1c3){_0x10be49['push'](_0x10be49['shift']());}};_0x3bd308(++_0x1af9a3);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 821c38b..46179c8 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(_0x4e4edb,_0xe57451){var _0x137d87=function(_0xa14aa8){while(--_0xa14aa8){_0x4e4edb['push'](_0x4e4edb['shift']());}};_0x137d87(++_0xe57451);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x2d1455,_0x35e047){var _0xe97154=function(_0xd6204b){while(--_0xd6204b){_0x2d1455['push'](_0x2d1455['shift']());}};_0xe97154(++_0x35e047);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 9d1c289..ea9a000 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 _0x93e6=['request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','localhost','redis','./openchannelAccount.socket','register'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x93e6,0x11e));var _0x693e=function(_0x516510,_0x48f18a){_0x516510=_0x516510-0x0;var _0x5c5246=_0x93e6[_0x516510];return _0x5c5246;};'use strict';var _=require(_0x693e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x693e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x693e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x693e('0x3'));var logger=require(_0x693e('0x4'))(_0x693e('0x5'));var config=require('../../config/environment');var jayson=require(_0x693e('0x6'));var client=jayson[_0x693e('0x7')][_0x693e('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x693e('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x693e('0xa')]));require(_0x693e('0xb'))[_0x693e('0xc')](socket);function respondWithRpcPromise(_0x546dc7,_0x47438b,_0x4bba81){return new BPromise(function(_0x1b5922,_0x5cefdb){return client[_0x693e('0xd')](_0x546dc7,_0x4bba81)['then'](function(_0x4f30e9){logger[_0x693e('0xe')](_0x693e('0xf'),_0x47438b,_0x693e('0x10'));logger[_0x693e('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x47438b,_0x693e('0x10'),JSON[_0x693e('0x12')](_0x4f30e9));if(_0x4f30e9[_0x693e('0x13')]){if(_0x4f30e9[_0x693e('0x13')][_0x693e('0x14')]===0x1f4){logger[_0x693e('0x13')](_0x693e('0xf'),_0x47438b,_0x4f30e9['error'][_0x693e('0x15')]);return _0x5cefdb(_0x4f30e9[_0x693e('0x13')][_0x693e('0x15')]);}logger['error'](_0x693e('0xf'),_0x47438b,_0x4f30e9[_0x693e('0x13')][_0x693e('0x15')]);return _0x1b5922(_0x4f30e9[_0x693e('0x13')][_0x693e('0x15')]);}else{logger[_0x693e('0xe')](_0x693e('0xf'),_0x47438b,'request\x20sent');_0x1b5922(_0x4f30e9['result']['message']);}})[_0x693e('0x16')](function(_0x11407a){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x47438b,_0x11407a);_0x5cefdb(_0x11407a);});});} \ No newline at end of file +var _0x2884=['randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x35d586,_0x43094a){var _0x4288ae=function(_0x3d8544){while(--_0x3d8544){_0x35d586['push'](_0x35d586['shift']());}};_0x4288ae(++_0x43094a);}(_0x2884,0x1eb));var _0x4288=function(_0xcb785d,_0x29e22d){_0xcb785d=_0xcb785d-0x0;var _0x6e8faf=_0x2884[_0xcb785d];return _0x6e8faf;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4288('0x9')](config['redis'],{'host':_0x4288('0xa'),'port':0x18eb});var socket=require(_0x4288('0xb'))(new Redis(config['redis']));require(_0x4288('0xc'))[_0x4288('0xd')](socket);function respondWithRpcPromise(_0x41794a,_0x55c9ee,_0x55a4f7){return new BPromise(function(_0x5c0e2d,_0x42a234){return client[_0x4288('0xe')](_0x41794a,_0x55a4f7)[_0x4288('0xf')](function(_0x2445eb){logger[_0x4288('0x10')](_0x4288('0x11'),_0x55c9ee,'request\x20sent');logger[_0x4288('0x12')](_0x4288('0x13'),_0x55c9ee,_0x4288('0x14'),JSON[_0x4288('0x15')](_0x2445eb));if(_0x2445eb['error']){if(_0x2445eb[_0x4288('0x16')][_0x4288('0x17')]===0x1f4){logger['error'](_0x4288('0x11'),_0x55c9ee,_0x2445eb['error'][_0x4288('0x18')]);return _0x42a234(_0x2445eb['error'][_0x4288('0x18')]);}logger[_0x4288('0x16')](_0x4288('0x11'),_0x55c9ee,_0x2445eb[_0x4288('0x16')][_0x4288('0x18')]);return _0x5c0e2d(_0x2445eb[_0x4288('0x16')][_0x4288('0x18')]);}else{logger[_0x4288('0x10')](_0x4288('0x11'),_0x55c9ee,'request\x20sent');_0x5c0e2d(_0x2445eb[_0x4288('0x19')][_0x4288('0x18')]);}})['catch'](function(_0x479d52){logger['error'](_0x4288('0x11'),_0x55c9ee,_0x479d52);_0x42a234(_0x479d52);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3b057cd..0a4b635 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 _0xe74e=['removeListener','openchannelAccount:','save','remove','update','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe74e,0x10a));var _0xee74=function(_0x15eb68,_0x4bb543){_0x15eb68=_0x15eb68-0x0;var _0x18a1bd=_0xe74e[_0x15eb68];return _0x18a1bd;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xee74('0x0'),_0xee74('0x1'),_0xee74('0x2')];function createListener(_0x1ff525,_0x45c54d){return function(_0x38a0bd){_0x45c54d[_0xee74('0x3')](_0x1ff525,_0x38a0bd);};}function removeListener(_0x175615,_0xc652f2){return function(){OpenchannelAccountEvents[_0xee74('0x4')](_0x175615,_0xc652f2);};}exports['register']=function(_0x483d0a){for(var _0xbb9d43=0x0,_0x242ac6=events['length'];_0xbb9d43<_0x242ac6;_0xbb9d43++){var _0x58fa11=events[_0xbb9d43];var _0x11c67e=createListener(_0xee74('0x5')+_0x58fa11,_0x483d0a);OpenchannelAccountEvents['on'](_0x58fa11,_0x11c67e);}}; \ No newline at end of file +var _0x8a9d=['register','length','openchannelAccount:','./openchannelAccount.events','save','update','removeListener'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x8a9d[_0x2a5099];return _0x2802f1;};'use strict';var OpenchannelAccountEvents=require(_0xd8a9('0x0'));var events=[_0xd8a9('0x1'),'remove',_0xd8a9('0x2')];function createListener(_0x91259,_0x502276){return function(_0x32b520){_0x502276['emit'](_0x91259,_0x32b520);};}function removeListener(_0x5ee117,_0x1b6f39){return function(){OpenchannelAccountEvents[_0xd8a9('0x3')](_0x5ee117,_0x1b6f39);};}exports[_0xd8a9('0x4')]=function(_0x5f56e6){for(var _0x2645b2=0x0,_0x37b86d=events[_0xd8a9('0x5')];_0x2645b2<_0x37b86d;_0x2645b2++){var _0x5610b7=events[_0x2645b2];var _0x5c3949=createListener(_0xd8a9('0x6')+_0x5610b7,_0x5f56e6);OpenchannelAccountEvents['on'](_0x5610b7,_0x5c3949);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8a78daa..cf53b34 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 _0xf13d=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4bda8d,_0x3d4141){var _0x38e2b4=function(_0x5a5233){while(--_0x5a5233){_0x4bda8d['push'](_0x4bda8d['shift']());}};_0x38e2b4(++_0x3d4141);}(_0xf13d,0xdd));var _0xdf13=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf13d[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0xdf13('0x0'));var util=require(_0xdf13('0x1'));var path=require(_0xdf13('0x2'));var timeout=require(_0xdf13('0x3'));var express=require(_0xdf13('0x4'));var router=express[_0xdf13('0x5')]();var fs_extra=require(_0xdf13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdf13('0x7'));var config=require(_0xdf13('0x8'));var controller=require(_0xdf13('0x9'));router[_0xdf13('0xa')]('/',auth[_0xdf13('0xb')](),controller[_0xdf13('0xc')]);router[_0xdf13('0xa')](_0xdf13('0xd'),auth[_0xdf13('0xb')](),controller['show']);router['post']('/',auth[_0xdf13('0xb')](),controller[_0xdf13('0xe')]);router[_0xdf13('0xf')](_0xdf13('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xdf13('0x10')](_0xdf13('0xd'),auth[_0xdf13('0xb')](),controller[_0xdf13('0x11')]);module[_0xdf13('0x12')]=router; \ No newline at end of file +var _0x448f=['create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x558010,_0x4a71e6){var _0x3b9dba=function(_0x2ad97a){while(--_0x2ad97a){_0x558010['push'](_0x558010['shift']());}};_0x3b9dba(++_0x4a71e6);}(_0x448f,0x1b9));var _0xf448=function(_0x22d7e6,_0xa620e7){_0x22d7e6=_0x22d7e6-0x0;var _0x72bc58=_0x448f[_0x22d7e6];return _0x72bc58;};'use strict';var multer=require(_0xf448('0x0'));var util=require(_0xf448('0x1'));var path=require(_0xf448('0x2'));var timeout=require(_0xf448('0x3'));var express=require(_0xf448('0x4'));var router=express['Router']();var fs_extra=require(_0xf448('0x5'));var auth=require(_0xf448('0x6'));var interaction=require(_0xf448('0x7'));var config=require('../../config/environment');var controller=require(_0xf448('0x8'));router[_0xf448('0x9')]('/',auth[_0xf448('0xa')](),controller[_0xf448('0xb')]);router[_0xf448('0x9')](_0xf448('0xc'),auth[_0xf448('0xa')](),controller[_0xf448('0xd')]);router[_0xf448('0xe')]('/',auth[_0xf448('0xa')](),controller[_0xf448('0xf')]);router['put'](_0xf448('0xc'),auth[_0xf448('0xa')](),controller[_0xf448('0x10')]);router[_0xf448('0x11')](_0xf448('0xc'),auth[_0xf448('0xa')](),controller[_0xf448('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 1348264..91297f9 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 _0x83d4=['sequelize','exports','noop','TEXT','STRING'];(function(_0x3e1a8d,_0x358f94){var _0x285b6c=function(_0x59b957){while(--_0x59b957){_0x3e1a8d['push'](_0x3e1a8d['shift']());}};_0x285b6c(++_0x358f94);}(_0x83d4,0x195));var _0x483d=function(_0x2d4bc3,_0x557413){_0x2d4bc3=_0x2d4bc3-0x0;var _0x575b81=_0x83d4[_0x2d4bc3];return _0x575b81;};'use strict';var Sequelize=require(_0x483d('0x0'));module[_0x483d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x483d('0x2')},'appdata':{'type':Sequelize[_0x483d('0x3')]()},'description':{'type':Sequelize[_0x483d('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd9ab=['sequelize','INTEGER','STRING','TEXT'];(function(_0x5518ea,_0x2b9b01){var _0x5315c5=function(_0x6554b5){while(--_0x6554b5){_0x5518ea['push'](_0x5518ea['shift']());}};_0x5315c5(++_0x2b9b01);}(_0xd9ab,0x188));var _0xbd9a=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xd9ab[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0xbd9a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbd9a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbd9a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbd9a('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbd9a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b29d3b0..481628a 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 _0xe0d9=['api','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x26a5a0,_0x42b80c){var _0x574b6d=function(_0x257661){while(--_0x257661){_0x26a5a0['push'](_0x26a5a0['shift']());}};_0x574b6d(++_0x42b80c);}(_0xe0d9,0x115));var _0x9e0d=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0xe0d9[_0x380307];return _0x9ea14b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e0d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9e0d('0x1'));var moment=require(_0x9e0d('0x2'));var BPromise=require(_0x9e0d('0x3'));var Mustache=require('mustache');var util=require(_0x9e0d('0x4'));var path=require('path');var sox=require(_0x9e0d('0x5'));var csv=require(_0x9e0d('0x6'));var ejs=require(_0x9e0d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e0d('0x8'));var squel=require(_0x9e0d('0x9'));var crypto=require(_0x9e0d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9e0d('0xb'));var toCsv=require(_0x9e0d('0x6'));var querystring=require(_0x9e0d('0xc'));var Papa=require(_0x9e0d('0xd'));var Redis=require(_0x9e0d('0xe'));var authService=require(_0x9e0d('0xf'));var qs=require(_0x9e0d('0x10'));var as=require(_0x9e0d('0x11'));var hardwareService=require(_0x9e0d('0x12'));var logger=require('../../config/logger')(_0x9e0d('0x13'));var utils=require('../../config/utils');var config=require(_0x9e0d('0x14'));var licenseUtil=require(_0x9e0d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1584a1,_0x5e9040){_0x5e9040=_0x5e9040||0xcc;return function(_0x5114da){if(_0x5114da){return _0x1584a1['sendStatus'](_0x5e9040);}return _0x1584a1[_0x9e0d('0x16')](_0x5e9040)[_0x9e0d('0x17')]();};}function respondWithResult(_0x24d3b7,_0x4a5dba){_0x4a5dba=_0x4a5dba||0xc8;return function(_0x10ff02){if(_0x10ff02){return _0x24d3b7[_0x9e0d('0x16')](_0x4a5dba)['json'](_0x10ff02);}};}function respondWithFilteredResult(_0x1b05c0,_0x1b5836){return function(_0x5bef6e){if(_0x5bef6e){var _0x52df8c=typeof _0x1b5836[_0x9e0d('0x18')]==='undefined'&&typeof _0x1b5836[_0x9e0d('0x19')]===_0x9e0d('0x1a');var _0x361e84=_0x5bef6e['count'];var _0x33f4ec=_0x52df8c?0x0:_0x1b5836['offset'];var _0x56bb7e=_0x52df8c?_0x5bef6e[_0x9e0d('0x1b')]:_0x1b5836[_0x9e0d('0x18')]+_0x1b5836[_0x9e0d('0x19')];var _0x447570;if(_0x56bb7e>=_0x361e84){_0x56bb7e=_0x361e84;_0x447570=0xc8;}else{_0x447570=0xce;}_0x1b05c0[_0x9e0d('0x16')](_0x447570);return _0x1b05c0[_0x9e0d('0x1c')](_0x9e0d('0x1d'),_0x33f4ec+'-'+_0x56bb7e+'/'+_0x361e84)[_0x9e0d('0x1e')](_0x5bef6e);}return null;};}function patchUpdates(_0x2badf7){return function(_0x2a1243){try{jsonpatch[_0x9e0d('0x1f')](_0x2a1243,_0x2badf7,!![]);}catch(_0x547243){return BPromise['reject'](_0x547243);}return _0x2a1243[_0x9e0d('0x20')]();};}function saveUpdates(_0x340921,_0x766c68){return function(_0x17fc65){if(_0x17fc65){return _0x17fc65[_0x9e0d('0x21')](_0x340921)[_0x9e0d('0x22')](function(_0x50c863){return _0x50c863;});}return null;};}function removeEntity(_0x1e446f,_0x719cfe){return function(_0x4a58f1){if(_0x4a58f1){return _0x4a58f1['destroy']()[_0x9e0d('0x22')](function(){_0x1e446f[_0x9e0d('0x16')](0xcc)[_0x9e0d('0x17')]();});}};}function handleEntityNotFound(_0x5248ea,_0x427ac3){return function(_0x1fdeb7){if(!_0x1fdeb7){_0x5248ea[_0x9e0d('0x23')](0x194);}return _0x1fdeb7;};}function handleError(_0x1f8ef7,_0x147555){_0x147555=_0x147555||0x1f4;return function(_0xca6759){logger[_0x9e0d('0x24')](_0xca6759[_0x9e0d('0x25')]);if(_0xca6759['name']){delete _0xca6759[_0x9e0d('0x26')];}_0x1f8ef7['status'](_0x147555)['send'](_0xca6759);};}exports[_0x9e0d('0x27')]=function(_0x401f87,_0x57e785){var _0x2b9b0={},_0x1bacd5={},_0x2e5c5b={'count':0x0,'rows':[]};var _0x39d316=_[_0x9e0d('0x28')](db[_0x9e0d('0x29')]['rawAttributes'],function(_0x2a45e1){return{'name':_0x2a45e1[_0x9e0d('0x2a')],'type':_0x2a45e1[_0x9e0d('0x2b')][_0x9e0d('0x2c')]};});_0x1bacd5[_0x9e0d('0x2d')]=_[_0x9e0d('0x28')](_0x39d316,_0x9e0d('0x26'));_0x1bacd5[_0x9e0d('0x2e')]=_[_0x9e0d('0x2f')](_0x401f87[_0x9e0d('0x2e')]);_0x1bacd5[_0x9e0d('0x30')]=_[_0x9e0d('0x31')](_0x1bacd5[_0x9e0d('0x2d')],_0x1bacd5[_0x9e0d('0x2e')]);_0x2b9b0[_0x9e0d('0x32')]=_[_0x9e0d('0x31')](_0x1bacd5[_0x9e0d('0x2d')],qs[_0x9e0d('0x33')](_0x401f87[_0x9e0d('0x2e')][_0x9e0d('0x33')]));_0x2b9b0[_0x9e0d('0x32')]=_0x2b9b0[_0x9e0d('0x32')][_0x9e0d('0x34')]?_0x2b9b0[_0x9e0d('0x32')]:_0x1bacd5['model'];if(!_0x401f87[_0x9e0d('0x2e')]['hasOwnProperty'](_0x9e0d('0x35'))){_0x2b9b0[_0x9e0d('0x19')]=qs[_0x9e0d('0x19')](_0x401f87['query'][_0x9e0d('0x19')]);_0x2b9b0['offset']=qs[_0x9e0d('0x18')](_0x401f87[_0x9e0d('0x2e')]['offset']);}_0x2b9b0[_0x9e0d('0x36')]=qs[_0x9e0d('0x37')](_0x401f87[_0x9e0d('0x2e')][_0x9e0d('0x37')]);_0x2b9b0['where']=qs[_0x9e0d('0x30')](_[_0x9e0d('0x38')](_0x401f87[_0x9e0d('0x2e')],_0x1bacd5[_0x9e0d('0x30')]),_0x39d316);if(_0x401f87['query'][_0x9e0d('0x39')]){_0x2b9b0['where']=_[_0x9e0d('0x3a')](_0x2b9b0[_0x9e0d('0x3b')],{'$or':_[_0x9e0d('0x28')](_0x39d316,function(_0x1606a9){if(_0x1606a9[_0x9e0d('0x2b')]!==_0x9e0d('0x3c')){var _0x41c041={};_0x41c041[_0x1606a9[_0x9e0d('0x26')]]={'$like':'%'+_0x401f87['query'][_0x9e0d('0x39')]+'%'};return _0x41c041;}})});}_0x2b9b0=_['merge']({},_0x2b9b0,_0x401f87[_0x9e0d('0x3d')]);var _0x3b700d={'where':_0x2b9b0[_0x9e0d('0x3b')]};return db[_0x9e0d('0x29')][_0x9e0d('0x1b')](_0x3b700d)['then'](function(_0x247dfe){_0x2e5c5b[_0x9e0d('0x1b')]=_0x247dfe;if(_0x401f87[_0x9e0d('0x2e')][_0x9e0d('0x3e')]){_0x2b9b0[_0x9e0d('0x3f')]=[{'all':!![]}];}return db[_0x9e0d('0x29')][_0x9e0d('0x40')](_0x2b9b0);})['then'](function(_0x2f3ef5){_0x2e5c5b[_0x9e0d('0x41')]=_0x2f3ef5;return _0x2e5c5b;})[_0x9e0d('0x22')](respondWithFilteredResult(_0x57e785,_0x2b9b0))[_0x9e0d('0x42')](handleError(_0x57e785,null));};exports[_0x9e0d('0x43')]=function(_0x5f2e84,_0x256d1){var _0x786690={'raw':!![],'where':{'id':_0x5f2e84[_0x9e0d('0x44')]['id']}},_0x34c6b6={};_0x34c6b6[_0x9e0d('0x2d')]=_[_0x9e0d('0x2f')](db[_0x9e0d('0x29')][_0x9e0d('0x45')]);_0x34c6b6['query']=_[_0x9e0d('0x2f')](_0x5f2e84['query']);_0x34c6b6[_0x9e0d('0x30')]=_[_0x9e0d('0x31')](_0x34c6b6[_0x9e0d('0x2d')],_0x34c6b6[_0x9e0d('0x2e')]);_0x786690[_0x9e0d('0x32')]=_[_0x9e0d('0x31')](_0x34c6b6[_0x9e0d('0x2d')],qs[_0x9e0d('0x33')](_0x5f2e84[_0x9e0d('0x2e')][_0x9e0d('0x33')]));_0x786690[_0x9e0d('0x32')]=_0x786690['attributes']['length']?_0x786690[_0x9e0d('0x32')]:_0x34c6b6[_0x9e0d('0x2d')];if(_0x5f2e84[_0x9e0d('0x2e')][_0x9e0d('0x3e')]){_0x786690[_0x9e0d('0x3f')]=[{'all':!![]}];}_0x786690=_[_0x9e0d('0x3a')]({},_0x786690,_0x5f2e84['options']);return db[_0x9e0d('0x29')][_0x9e0d('0x46')](_0x786690)[_0x9e0d('0x22')](handleEntityNotFound(_0x256d1,null))['then'](respondWithResult(_0x256d1,null))[_0x9e0d('0x42')](handleError(_0x256d1,null));};exports[_0x9e0d('0x47')]=function(_0x401f43,_0x88e91b){return db[_0x9e0d('0x29')]['create'](_0x401f43[_0x9e0d('0x48')],{})[_0x9e0d('0x22')](respondWithResult(_0x88e91b,0xc9))[_0x9e0d('0x42')](handleError(_0x88e91b,null));};exports[_0x9e0d('0x21')]=function(_0x5cfbde,_0x3d8767){if(_0x5cfbde[_0x9e0d('0x48')]['id']){delete _0x5cfbde[_0x9e0d('0x48')]['id'];}return db[_0x9e0d('0x29')]['find']({'where':{'id':_0x5cfbde[_0x9e0d('0x44')]['id']}})[_0x9e0d('0x22')](handleEntityNotFound(_0x3d8767,null))['then'](saveUpdates(_0x5cfbde[_0x9e0d('0x48')],null))[_0x9e0d('0x22')](respondWithResult(_0x3d8767,null))['catch'](handleError(_0x3d8767,null));};exports[_0x9e0d('0x49')]=function(_0x2186c1,_0x43524e){return db[_0x9e0d('0x29')][_0x9e0d('0x46')]({'where':{'id':_0x2186c1[_0x9e0d('0x44')]['id']}})[_0x9e0d('0x22')](handleEntityNotFound(_0x43524e,null))['then'](removeEntity(_0x43524e,null))['catch'](handleError(_0x43524e,null));}; \ No newline at end of file +var _0x2f86=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys'];(function(_0x382a75,_0x3abdae){var _0x379de5=function(_0x5b1887){while(--_0x5b1887){_0x382a75['push'](_0x382a75['shift']());}};_0x379de5(++_0x3abdae);}(_0x2f86,0xf8));var _0x62f8=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x2f86[_0x2ec461];return _0x28603d;};'use strict';var emlformat=require(_0x62f8('0x0'));var rimraf=require(_0x62f8('0x1'));var zipdir=require(_0x62f8('0x2'));var jsonpatch=require(_0x62f8('0x3'));var rp=require(_0x62f8('0x4'));var moment=require(_0x62f8('0x5'));var BPromise=require(_0x62f8('0x6'));var Mustache=require(_0x62f8('0x7'));var util=require(_0x62f8('0x8'));var path=require(_0x62f8('0x9'));var sox=require(_0x62f8('0xa'));var csv=require('to-csv');var ejs=require(_0x62f8('0xb'));var fs=require('fs');var fs_extra=require(_0x62f8('0xc'));var _=require(_0x62f8('0xd'));var squel=require(_0x62f8('0xe'));var crypto=require(_0x62f8('0xf'));var jsforce=require(_0x62f8('0x10'));var deskjs=require(_0x62f8('0x11'));var toCsv=require(_0x62f8('0x12'));var querystring=require('querystring');var Papa=require(_0x62f8('0x13'));var Redis=require(_0x62f8('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x62f8('0x15'));var hardwareService=require(_0x62f8('0x16'));var logger=require(_0x62f8('0x17'))('api');var utils=require(_0x62f8('0x18'));var config=require(_0x62f8('0x19'));var licenseUtil=require(_0x62f8('0x1a'));var db=require(_0x62f8('0x1b'))['db'];function respondWithStatusCode(_0x5c6312,_0x5b59a5){_0x5b59a5=_0x5b59a5||0xcc;return function(_0x283085){if(_0x283085){return _0x5c6312[_0x62f8('0x1c')](_0x5b59a5);}return _0x5c6312['status'](_0x5b59a5)[_0x62f8('0x1d')]();};}function respondWithResult(_0x3b1da1,_0x554826){_0x554826=_0x554826||0xc8;return function(_0x3076ed){if(_0x3076ed){return _0x3b1da1[_0x62f8('0x1e')](_0x554826)[_0x62f8('0x1f')](_0x3076ed);}};}function respondWithFilteredResult(_0x516491,_0x35f07a){return function(_0x303c45){if(_0x303c45){var _0x20eedd=typeof _0x35f07a[_0x62f8('0x20')]==='undefined'&&typeof _0x35f07a[_0x62f8('0x21')]==='undefined';var _0x3d9d44=_0x303c45[_0x62f8('0x22')];var _0x174ad8=_0x20eedd?0x0:_0x35f07a[_0x62f8('0x20')];var _0x1d4495=_0x20eedd?_0x303c45[_0x62f8('0x22')]:_0x35f07a[_0x62f8('0x20')]+_0x35f07a[_0x62f8('0x21')];var _0x5020b7;if(_0x1d4495>=_0x3d9d44){_0x1d4495=_0x3d9d44;_0x5020b7=0xc8;}else{_0x5020b7=0xce;}_0x516491[_0x62f8('0x1e')](_0x5020b7);return _0x516491[_0x62f8('0x23')](_0x62f8('0x24'),_0x174ad8+'-'+_0x1d4495+'/'+_0x3d9d44)[_0x62f8('0x1f')](_0x303c45);}return null;};}function patchUpdates(_0x24c6fe){return function(_0x583a33){try{jsonpatch[_0x62f8('0x25')](_0x583a33,_0x24c6fe,!![]);}catch(_0xd36c7a){return BPromise[_0x62f8('0x26')](_0xd36c7a);}return _0x583a33['save']();};}function saveUpdates(_0x521ee1,_0x1f683a){return function(_0x3f51cb){if(_0x3f51cb){return _0x3f51cb[_0x62f8('0x27')](_0x521ee1)[_0x62f8('0x28')](function(_0x1b7873){return _0x1b7873;});}return null;};}function removeEntity(_0x202b9a,_0x30cafd){return function(_0x196b14){if(_0x196b14){return _0x196b14[_0x62f8('0x29')]()['then'](function(){_0x202b9a['status'](0xcc)[_0x62f8('0x1d')]();});}};}function handleEntityNotFound(_0x5bb87e,_0x5eee7f){return function(_0x12d9fc){if(!_0x12d9fc){_0x5bb87e['sendStatus'](0x194);}return _0x12d9fc;};}function handleError(_0x2b5e02,_0x2852e6){_0x2852e6=_0x2852e6||0x1f4;return function(_0x1461fb){logger[_0x62f8('0x2a')](_0x1461fb['stack']);if(_0x1461fb[_0x62f8('0x2b')]){delete _0x1461fb[_0x62f8('0x2b')];}_0x2b5e02['status'](_0x2852e6)[_0x62f8('0x2c')](_0x1461fb);};}exports['index']=function(_0x6f9637,_0xc56206){var _0x442c24={},_0x142f85={},_0x24e3e2={'count':0x0,'rows':[]};var _0x39bed6=_['map'](db[_0x62f8('0x2d')][_0x62f8('0x2e')],function(_0x5589ac){return{'name':_0x5589ac[_0x62f8('0x2f')],'type':_0x5589ac[_0x62f8('0x30')]['key']};});_0x142f85[_0x62f8('0x31')]=_['map'](_0x39bed6,_0x62f8('0x2b'));_0x142f85[_0x62f8('0x32')]=_[_0x62f8('0x33')](_0x6f9637[_0x62f8('0x32')]);_0x142f85[_0x62f8('0x34')]=_[_0x62f8('0x35')](_0x142f85['model'],_0x142f85[_0x62f8('0x32')]);_0x442c24[_0x62f8('0x36')]=_[_0x62f8('0x35')](_0x142f85[_0x62f8('0x31')],qs[_0x62f8('0x37')](_0x6f9637['query']['fields']));_0x442c24['attributes']=_0x442c24[_0x62f8('0x36')][_0x62f8('0x38')]?_0x442c24[_0x62f8('0x36')]:_0x142f85[_0x62f8('0x31')];if(!_0x6f9637['query']['hasOwnProperty'](_0x62f8('0x39'))){_0x442c24['limit']=qs[_0x62f8('0x21')](_0x6f9637[_0x62f8('0x32')][_0x62f8('0x21')]);_0x442c24[_0x62f8('0x20')]=qs['offset'](_0x6f9637[_0x62f8('0x32')][_0x62f8('0x20')]);}_0x442c24[_0x62f8('0x3a')]=qs[_0x62f8('0x3b')](_0x6f9637[_0x62f8('0x32')][_0x62f8('0x3b')]);_0x442c24[_0x62f8('0x3c')]=qs[_0x62f8('0x34')](_[_0x62f8('0x3d')](_0x6f9637[_0x62f8('0x32')],_0x142f85[_0x62f8('0x34')]),_0x39bed6);if(_0x6f9637[_0x62f8('0x32')][_0x62f8('0x3e')]){_0x442c24[_0x62f8('0x3c')]=_['merge'](_0x442c24['where'],{'$or':_['map'](_0x39bed6,function(_0x9abdc4){if(_0x9abdc4[_0x62f8('0x30')]!=='VIRTUAL'){var _0x4b1e8d={};_0x4b1e8d[_0x9abdc4[_0x62f8('0x2b')]]={'$like':'%'+_0x6f9637[_0x62f8('0x32')][_0x62f8('0x3e')]+'%'};return _0x4b1e8d;}})});}_0x442c24=_['merge']({},_0x442c24,_0x6f9637[_0x62f8('0x3f')]);var _0xe35ea7={'where':_0x442c24['where']};return db['OpenchannelApplication']['count'](_0xe35ea7)[_0x62f8('0x28')](function(_0xd11b1c){_0x24e3e2[_0x62f8('0x22')]=_0xd11b1c;if(_0x6f9637[_0x62f8('0x32')][_0x62f8('0x40')]){_0x442c24[_0x62f8('0x41')]=[{'all':!![]}];}return db[_0x62f8('0x2d')][_0x62f8('0x42')](_0x442c24);})[_0x62f8('0x28')](function(_0xcee1ce){_0x24e3e2[_0x62f8('0x43')]=_0xcee1ce;return _0x24e3e2;})[_0x62f8('0x28')](respondWithFilteredResult(_0xc56206,_0x442c24))[_0x62f8('0x44')](handleError(_0xc56206,null));};exports[_0x62f8('0x45')]=function(_0x7d2a59,_0x56ad2f){var _0x176fe9={'raw':!![],'where':{'id':_0x7d2a59[_0x62f8('0x46')]['id']}},_0x56c40c={};_0x56c40c[_0x62f8('0x31')]=_['keys'](db[_0x62f8('0x2d')][_0x62f8('0x2e')]);_0x56c40c[_0x62f8('0x32')]=_[_0x62f8('0x33')](_0x7d2a59[_0x62f8('0x32')]);_0x56c40c[_0x62f8('0x34')]=_[_0x62f8('0x35')](_0x56c40c[_0x62f8('0x31')],_0x56c40c['query']);_0x176fe9['attributes']=_[_0x62f8('0x35')](_0x56c40c['model'],qs[_0x62f8('0x37')](_0x7d2a59[_0x62f8('0x32')][_0x62f8('0x37')]));_0x176fe9[_0x62f8('0x36')]=_0x176fe9[_0x62f8('0x36')]['length']?_0x176fe9['attributes']:_0x56c40c[_0x62f8('0x31')];if(_0x7d2a59['query'][_0x62f8('0x40')]){_0x176fe9[_0x62f8('0x41')]=[{'all':!![]}];}_0x176fe9=_[_0x62f8('0x47')]({},_0x176fe9,_0x7d2a59['options']);return db[_0x62f8('0x2d')][_0x62f8('0x48')](_0x176fe9)[_0x62f8('0x28')](handleEntityNotFound(_0x56ad2f,null))[_0x62f8('0x28')](respondWithResult(_0x56ad2f,null))['catch'](handleError(_0x56ad2f,null));};exports[_0x62f8('0x49')]=function(_0x542c88,_0x255f6f){return db[_0x62f8('0x2d')][_0x62f8('0x49')](_0x542c88[_0x62f8('0x4a')],{})[_0x62f8('0x28')](respondWithResult(_0x255f6f,0xc9))['catch'](handleError(_0x255f6f,null));};exports[_0x62f8('0x27')]=function(_0xcafc5d,_0xbcd9d5){if(_0xcafc5d[_0x62f8('0x4a')]['id']){delete _0xcafc5d[_0x62f8('0x4a')]['id'];}return db[_0x62f8('0x2d')]['find']({'where':{'id':_0xcafc5d[_0x62f8('0x46')]['id']}})['then'](handleEntityNotFound(_0xbcd9d5,null))['then'](saveUpdates(_0xcafc5d['body'],null))[_0x62f8('0x28')](respondWithResult(_0xbcd9d5,null))[_0x62f8('0x44')](handleError(_0xbcd9d5,null));};exports[_0x62f8('0x29')]=function(_0x3d7ca2,_0x624ab2){return db[_0x62f8('0x2d')][_0x62f8('0x48')]({'where':{'id':_0x3d7ca2['params']['id']}})['then'](handleEntityNotFound(_0x624ab2,null))[_0x62f8('0x28')](removeEntity(_0x624ab2,null))[_0x62f8('0x44')](handleError(_0x624ab2,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a566a3d..5d87627 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 _0x7bbf=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1b2347,_0xf558ef){var _0x3c012c=function(_0x321df2){while(--_0x321df2){_0x1b2347['push'](_0x1b2347['shift']());}};_0x3c012c(++_0xf558ef);}(_0x7bbf,0x14c));var _0xf7bb=function(_0x3aa5d2,_0x583d77){_0x3aa5d2=_0x3aa5d2-0x0;var _0x257549=_0x7bbf[_0x3aa5d2];return _0x257549;};'use strict';var _=require(_0xf7bb('0x0'));var util=require(_0xf7bb('0x1'));var logger=require('../../config/logger')(_0xf7bb('0x2'));var moment=require(_0xf7bb('0x3'));var BPromise=require(_0xf7bb('0x4'));var rp=require(_0xf7bb('0x5'));var fs=require('fs');var path=require(_0xf7bb('0x6'));var rimraf=require(_0xf7bb('0x7'));var config=require(_0xf7bb('0x8'));var attributes=require(_0xf7bb('0x9'));module[_0xf7bb('0xa')]=function(_0x43992e,_0xaa8ea8){return _0x43992e['define'](_0xf7bb('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf7bb('0xc')});}; \ No newline at end of file +var _0x4284=['path','rimraf','../../config/environment','exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x1dee8a,_0x5ec249){var _0x35816e=function(_0x451a99){while(--_0x451a99){_0x1dee8a['push'](_0x1dee8a['shift']());}};_0x35816e(++_0x5ec249);}(_0x4284,0x10c));var _0x4428=function(_0x4d5aa6,_0x1a28d2){_0x4d5aa6=_0x4d5aa6-0x0;var _0x40f4c2=_0x4284[_0x4d5aa6];return _0x40f4c2;};'use strict';var _=require(_0x4428('0x0'));var util=require(_0x4428('0x1'));var logger=require('../../config/logger')(_0x4428('0x2'));var moment=require('moment');var BPromise=require(_0x4428('0x3'));var rp=require(_0x4428('0x4'));var fs=require('fs');var path=require(_0x4428('0x5'));var rimraf=require(_0x4428('0x6'));var config=require(_0x4428('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x4428('0x8')]=function(_0x1ef649,_0x6e0bdb){return _0x1ef649[_0x4428('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x4428('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4428('0xb'),'collate':_0x4428('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 0bea5bb..a6141a6 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 _0xaf2e=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','attributes','limit','debug','stringify','lodash'];(function(_0x1d094c,_0x168326){var _0x1e6250=function(_0x148b77){while(--_0x148b77){_0x1d094c['push'](_0x1d094c['shift']());}};_0x1e6250(++_0x168326);}(_0xaf2e,0x10d));var _0xeaf2=function(_0x159e10,_0x4cdbe8){_0x159e10=_0x159e10-0x0;var _0xbc6280=_0xaf2e[_0x159e10];return _0xbc6280;};'use strict';var _=require(_0xeaf2('0x0'));var util=require(_0xeaf2('0x1'));var moment=require(_0xeaf2('0x2'));var BPromise=require(_0xeaf2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaf2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaf2('0x5'))(_0xeaf2('0x6'));var config=require(_0xeaf2('0x7'));var jayson=require(_0xeaf2('0x8'));var client=jayson['client'][_0xeaf2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578eeb,_0x3830af,_0x557854){return new BPromise(function(_0xfe63bc,_0x82c3bd){return client['request'](_0x578eeb,_0x557854)[_0xeaf2('0xa')](function(_0xd63bc3){logger[_0xeaf2('0xb')](_0xeaf2('0xc'),_0x3830af,_0xeaf2('0xd'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3830af,_0xeaf2('0xd'),JSON['stringify'](_0xd63bc3));if(_0xd63bc3[_0xeaf2('0xe')]){if(_0xd63bc3[_0xeaf2('0xe')][_0xeaf2('0xf')]===0x1f4){logger[_0xeaf2('0xe')](_0xeaf2('0xc'),_0x3830af,_0xd63bc3[_0xeaf2('0xe')][_0xeaf2('0x10')]);return _0x82c3bd(_0xd63bc3[_0xeaf2('0xe')]['message']);}logger[_0xeaf2('0xe')](_0xeaf2('0xc'),_0x3830af,_0xd63bc3['error'][_0xeaf2('0x10')]);return _0xfe63bc(_0xd63bc3[_0xeaf2('0xe')][_0xeaf2('0x10')]);}else{logger[_0xeaf2('0xb')](_0xeaf2('0xc'),_0x3830af,_0xeaf2('0xd'));_0xfe63bc(_0xd63bc3[_0xeaf2('0x11')][_0xeaf2('0x10')]);}})[_0xeaf2('0x12')](function(_0x563d05){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x3830af,_0x563d05);_0x82c3bd(_0x563d05);});});}exports[_0xeaf2('0x13')]=function(_0x54f3d9){var _0x50ed23=this;return new Promise(function(_0x2edda6,_0x637131){return db[_0xeaf2('0x14')]['update'](_0x54f3d9[_0xeaf2('0x15')],{'raw':_0x54f3d9[_0xeaf2('0x16')]?_0x54f3d9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54f3d9[_0xeaf2('0x16')]?_0x54f3d9[_0xeaf2('0x16')]['where']||null:null,'attributes':_0x54f3d9['options']?_0x54f3d9[_0xeaf2('0x16')][_0xeaf2('0x17')]||null:null,'limit':_0x54f3d9[_0xeaf2('0x16')]?_0x54f3d9['options'][_0xeaf2('0x18')]||null:null})[_0xeaf2('0xa')](function(_0x262921){logger[_0xeaf2('0xb')](_0xeaf2('0x13'),_0x54f3d9);logger[_0xeaf2('0x19')](_0xeaf2('0x13'),_0x54f3d9,JSON[_0xeaf2('0x1a')](_0x262921));_0x2edda6(_0x262921);})[_0xeaf2('0x12')](function(_0x229790){logger['error']('UpdateOpenchannelApplication',_0x229790[_0xeaf2('0x10')],_0x54f3d9);_0x637131(_0x50ed23['error'](0x1f4,_0x229790[_0xeaf2('0x10')]));});});}; \ No newline at end of file +var _0x15ba=['raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options'];(function(_0xd015bd,_0x2757e9){var _0x3fdd9a=function(_0x32c654){while(--_0x32c654){_0xd015bd['push'](_0xd015bd['shift']());}};_0x3fdd9a(++_0x2757e9);}(_0x15ba,0x185));var _0xa15b=function(_0x28da10,_0x29470c){_0x28da10=_0x28da10-0x0;var _0x298372=_0x15ba[_0x28da10];return _0x298372;};'use strict';var _=require(_0xa15b('0x0'));var util=require(_0xa15b('0x1'));var moment=require(_0xa15b('0x2'));var BPromise=require(_0xa15b('0x3'));var rs=require(_0xa15b('0x4'));var fs=require('fs');var Redis=require(_0xa15b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa15b('0x6'));var logger=require(_0xa15b('0x7'))(_0xa15b('0x8'));var config=require(_0xa15b('0x9'));var jayson=require(_0xa15b('0xa'));var client=jayson[_0xa15b('0xb')][_0xa15b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xefa43e,_0x11c2ab,_0x4f68ec){return new BPromise(function(_0x1c4e17,_0x456f73){return client[_0xa15b('0xd')](_0xefa43e,_0x4f68ec)[_0xa15b('0xe')](function(_0x12771c){logger[_0xa15b('0xf')](_0xa15b('0x10'),_0x11c2ab,'request\x20sent');logger[_0xa15b('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x11c2ab,_0xa15b('0x12'),JSON['stringify'](_0x12771c));if(_0x12771c[_0xa15b('0x13')]){if(_0x12771c['error']['code']===0x1f4){logger[_0xa15b('0x13')](_0xa15b('0x10'),_0x11c2ab,_0x12771c[_0xa15b('0x13')]['message']);return _0x456f73(_0x12771c[_0xa15b('0x13')][_0xa15b('0x14')]);}logger[_0xa15b('0x13')](_0xa15b('0x10'),_0x11c2ab,_0x12771c[_0xa15b('0x13')][_0xa15b('0x14')]);return _0x1c4e17(_0x12771c['error']['message']);}else{logger[_0xa15b('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x11c2ab,_0xa15b('0x12'));_0x1c4e17(_0x12771c[_0xa15b('0x15')][_0xa15b('0x14')]);}})[_0xa15b('0x16')](function(_0xa8cdde){logger[_0xa15b('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x11c2ab,_0xa8cdde);_0x456f73(_0xa8cdde);});});}exports[_0xa15b('0x17')]=function(_0x29531d){var _0x131c73=this;return new Promise(function(_0xd496f,_0x4969b0){return db[_0xa15b('0x18')][_0xa15b('0x19')](_0x29531d['body'],{'raw':_0x29531d[_0xa15b('0x1a')]?_0x29531d[_0xa15b('0x1a')][_0xa15b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29531d[_0xa15b('0x1a')]?_0x29531d[_0xa15b('0x1a')][_0xa15b('0x1c')]||null:null,'attributes':_0x29531d[_0xa15b('0x1a')]?_0x29531d[_0xa15b('0x1a')][_0xa15b('0x1d')]||null:null,'limit':_0x29531d[_0xa15b('0x1a')]?_0x29531d[_0xa15b('0x1a')][_0xa15b('0x1e')]||null:null})[_0xa15b('0xe')](function(_0x276f2e){logger[_0xa15b('0xf')](_0xa15b('0x17'),_0x29531d);logger[_0xa15b('0x11')](_0xa15b('0x17'),_0x29531d,JSON[_0xa15b('0x1f')](_0x276f2e));_0xd496f(_0x276f2e);})[_0xa15b('0x16')](function(_0x52e0fd){logger[_0xa15b('0x13')](_0xa15b('0x17'),_0x52e0fd[_0xa15b('0x14')],_0x29531d);_0x4969b0(_0x131c73[_0xa15b('0x13')](0x1f4,_0x52e0fd[_0xa15b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 71d9341..f37a43f 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 _0x9241=['../../config/environment','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','addTags','put','/:id','openchannelinteraction:update','update','openchannel','destroy','removeTags','exports','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x18beb7,_0x142463){var _0x15f7c4=function(_0x94e022){while(--_0x94e022){_0x18beb7['push'](_0x18beb7['shift']());}};_0x15f7c4(++_0x142463);}(_0x9241,0x174));var _0x1924=function(_0x196a62,_0x9dcb89){_0x196a62=_0x196a62-0x0;var _0x161b99=_0x9241[_0x196a62];return _0x161b99;};'use strict';var multer=require('multer');var util=require(_0x1924('0x0'));var path=require(_0x1924('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1924('0x2')]();var fs_extra=require(_0x1924('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1924('0x4'));var config=require(_0x1924('0x5'));var controller=require('./openchannelInteraction.controller');router[_0x1924('0x6')]('/',auth[_0x1924('0x7')](),controller[_0x1924('0x8')]);router[_0x1924('0x6')](_0x1924('0x9'),auth['isAuthenticated'](),controller[_0x1924('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x1924('0x7')](),controller[_0x1924('0xb')]);router['get'](_0x1924('0xc'),auth[_0x1924('0x7')](),controller[_0x1924('0xd')]);router[_0x1924('0xe')]('/',auth['isAuthenticated'](),controller[_0x1924('0xf')]);router['post'](_0x1924('0x10'),auth[_0x1924('0x7')](),controller[_0x1924('0x11')]);router[_0x1924('0xe')](_0x1924('0x12'),auth[_0x1924('0x7')](),interaction[_0x1924('0x13')]('openchannel','openchannelinteraction:addtags'),controller[_0x1924('0x14')]);router[_0x1924('0x15')](_0x1924('0x16'),auth['isAuthenticated'](),interaction[_0x1924('0x13')]('openchannel',_0x1924('0x17')),controller[_0x1924('0x18')]);router['delete'](_0x1924('0x16'),auth[_0x1924('0x7')](),interaction[_0x1924('0x13')](_0x1924('0x19'),'openchannelinteraction:destroy'),controller[_0x1924('0x1a')]);router['delete'](_0x1924('0x12'),auth[_0x1924('0x7')](),controller[_0x1924('0x1b')]);module[_0x1924('0x1c')]=router; \ No newline at end of file +var _0xd9e5=['/:id/tags','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete'];(function(_0x2acb25,_0x15c7e7){var _0x576ab0=function(_0x3924aa){while(--_0x3924aa){_0x2acb25['push'](_0x2acb25['shift']());}};_0x576ab0(++_0x15c7e7);}(_0xd9e5,0x102));var _0x5d9e=function(_0x43fa10,_0x272d95){_0x43fa10=_0x43fa10-0x0;var _0x5a7206=_0xd9e5[_0x43fa10];return _0x5a7206;};'use strict';var multer=require(_0x5d9e('0x0'));var util=require('util');var path=require(_0x5d9e('0x1'));var timeout=require(_0x5d9e('0x2'));var express=require(_0x5d9e('0x3'));var router=express[_0x5d9e('0x4')]();var fs_extra=require(_0x5d9e('0x5'));var auth=require(_0x5d9e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d9e('0x7'));var controller=require(_0x5d9e('0x8'));router['get']('/',auth[_0x5d9e('0x9')](),controller['index']);router[_0x5d9e('0xa')](_0x5d9e('0xb'),auth[_0x5d9e('0x9')](),controller[_0x5d9e('0xc')]);router['get'](_0x5d9e('0xd'),auth['isAuthenticated'](),controller[_0x5d9e('0xe')]);router[_0x5d9e('0xa')]('/:id/messages',auth[_0x5d9e('0x9')](),controller[_0x5d9e('0xf')]);router['get'](_0x5d9e('0x10'),auth[_0x5d9e('0x9')](),controller[_0x5d9e('0x11')]);router['post']('/',auth[_0x5d9e('0x9')](),controller[_0x5d9e('0x12')]);router[_0x5d9e('0x13')]('/:id/messages',auth[_0x5d9e('0x9')](),controller['addMessage']);router[_0x5d9e('0x13')]('/:id/tags',auth[_0x5d9e('0x9')](),interaction[_0x5d9e('0x14')](_0x5d9e('0x15'),_0x5d9e('0x16')),controller[_0x5d9e('0x17')]);router[_0x5d9e('0x18')](_0x5d9e('0xd'),auth[_0x5d9e('0x9')](),interaction['tracked'](_0x5d9e('0x15'),_0x5d9e('0x19')),controller[_0x5d9e('0x1a')]);router['delete'](_0x5d9e('0xd'),auth[_0x5d9e('0x9')](),interaction[_0x5d9e('0x14')](_0x5d9e('0x15'),_0x5d9e('0x1b')),controller[_0x5d9e('0x1c')]);router[_0x5d9e('0x1d')](_0x5d9e('0x1e'),auth[_0x5d9e('0x9')](),controller[_0x5d9e('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 32fba88..2085d66 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 _0x8d0e=['DATE','STRING','out','sequelize','exports','BOOLEAN'];(function(_0x35f937,_0x535967){var _0x17287d=function(_0xe2d0f3){while(--_0xe2d0f3){_0x35f937['push'](_0x35f937['shift']());}};_0x17287d(++_0x535967);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x394002,_0x4fdae2){_0x394002=_0x394002-0x0;var _0x4c4350=_0x8d0e[_0x394002];return _0x4c4350;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'closed':{'type':Sequelize[_0xe8d0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe8d0('0x3')]},'disposition':{'type':Sequelize[_0xe8d0('0x4')]},'secondDisposition':{'type':Sequelize[_0xe8d0('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe8d0('0x4')]},'note':{'type':Sequelize[_0xe8d0('0x4')]},'read1stAt':{'type':Sequelize[_0xe8d0('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xe8d0('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe8d0('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe8d0('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xe8d0('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x061c=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x061c,0xc0));var _0xc061=function(_0x461409,_0x2d1d2d){_0x461409=_0x461409-0x0;var _0x536de4=_0x061c[_0x461409];return _0x536de4;};'use strict';var Sequelize=require(_0xc061('0x0'));module[_0xc061('0x1')]={'closed':{'type':Sequelize[_0xc061('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc061('0x3')]},'disposition':{'type':Sequelize[_0xc061('0x4')]},'secondDisposition':{'type':Sequelize[_0xc061('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc061('0x4')]},'note':{'type':Sequelize[_0xc061('0x4')]},'read1stAt':{'type':Sequelize[_0xc061('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc061('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc061('0x5')]('in',_0xc061('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc061('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xc061('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 60cc2f9..d3566ad 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 _0x18a5=['removeTags','download','join','root','server','tmp','files','CmContact','lastName','Attachment','Messages','Account','Owner','get','mkdirSync','Openchannel','N.A.','createdAt','closedAt','format','disposition','threadId','Public','basename','existsSync','createReadStream','direction','out','System','firstName','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','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','localhost','./openchannelInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','fullname','split','forEach','Tags','push','TagIds','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.id','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','start','Tag','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','show','params','include','merge','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','color','openchannelInteractionTags:save'];(function(_0x48e563,_0x1e2f8b){var _0x66e3fa=function(_0x47acb1){while(--_0x47acb1){_0x48e563['push'](_0x48e563['shift']());}};_0x66e3fa(++_0x1e2f8b);}(_0x18a5,0x114));var _0x518a=function(_0x502858,_0x1f7768){_0x502858=_0x502858-0x0;var _0x14c489=_0x18a5[_0x502858];return _0x14c489;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x518a('0x0'));var zipdir=require(_0x518a('0x1'));var jsonpatch=require(_0x518a('0x2'));var rp=require('request-promise');var moment=require(_0x518a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x518a('0x4'));var util=require(_0x518a('0x5'));var path=require(_0x518a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x518a('0x7'));var _=require(_0x518a('0x8'));var squel=require(_0x518a('0x9'));var crypto=require(_0x518a('0xa'));var jsforce=require(_0x518a('0xb'));var deskjs=require(_0x518a('0xc'));var toCsv=require(_0x518a('0xd'));var querystring=require('querystring');var Papa=require(_0x518a('0xe'));var Redis=require(_0x518a('0xf'));var authService=require(_0x518a('0x10'));var qs=require(_0x518a('0x11'));var as=require(_0x518a('0x12'));var pdf=require(_0x518a('0x13'));var hardwareService=require(_0x518a('0x14'));var logger=require(_0x518a('0x15'))(_0x518a('0x16'));var utils=require(_0x518a('0x17'));var config=require(_0x518a('0x18'));var licenseUtil=require(_0x518a('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x518a('0x1a')],{'host':_0x518a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x518a('0x1a')]));require(_0x518a('0x1c'))[_0x518a('0x1d')](socket);function respondWithStatusCode(_0x499b1f,_0x53a593){_0x53a593=_0x53a593||0xcc;return function(_0x42c89c){if(_0x42c89c){return _0x499b1f[_0x518a('0x1e')](_0x53a593);}return _0x499b1f['status'](_0x53a593)['end']();};}function respondWithResult(_0x175cd5,_0x28d9d0){_0x28d9d0=_0x28d9d0||0xc8;return function(_0x52af08){if(_0x52af08){return _0x175cd5[_0x518a('0x1f')](_0x28d9d0)[_0x518a('0x20')](_0x52af08);}};}function respondWithFilteredResult(_0x29719f,_0x5a20ae){return function(_0x104065){if(_0x104065){var _0x472fb5=typeof _0x5a20ae['offset']===_0x518a('0x21')&&typeof _0x5a20ae[_0x518a('0x22')]===_0x518a('0x21');var _0x56d99c=_0x104065[_0x518a('0x23')];var _0x54a3dc=_0x472fb5?0x0:_0x5a20ae[_0x518a('0x24')];var _0x2ce1e3=_0x472fb5?_0x104065[_0x518a('0x23')]:_0x5a20ae[_0x518a('0x24')]+_0x5a20ae[_0x518a('0x22')];var _0x3f3c48;if(_0x2ce1e3>=_0x56d99c){_0x2ce1e3=_0x56d99c;_0x3f3c48=0xc8;}else{_0x3f3c48=0xce;}_0x29719f['status'](_0x3f3c48);return _0x29719f[_0x518a('0x25')]('Content-Range',_0x54a3dc+'-'+_0x2ce1e3+'/'+_0x56d99c)[_0x518a('0x20')](_0x104065);}return null;};}function patchUpdates(_0x34640c){return function(_0x5c0903){try{jsonpatch[_0x518a('0x26')](_0x5c0903,_0x34640c,!![]);}catch(_0x4594e8){return BPromise[_0x518a('0x27')](_0x4594e8);}return _0x5c0903[_0x518a('0x28')]();};}function saveUpdates(_0x331d98,_0x13b4c5){return function(_0x5b36be){if(_0x5b36be){return _0x5b36be[_0x518a('0x29')](_0x331d98)['then'](function(_0x475d30){return _0x475d30;});}return null;};}function removeEntity(_0x9bb7c,_0x59d7c7){return function(_0x4658ec){if(_0x4658ec){return _0x4658ec[_0x518a('0x2a')]()[_0x518a('0x2b')](function(){_0x9bb7c[_0x518a('0x1f')](0xcc)[_0x518a('0x2c')]();});}};}function handleEntityNotFound(_0x2ed0c3,_0x9f58e7){return function(_0x40e495){if(!_0x40e495){_0x2ed0c3[_0x518a('0x1e')](0x194);}return _0x40e495;};}function handleError(_0x2c1483,_0x1ac7f7){_0x1ac7f7=_0x1ac7f7||0x1f4;return function(_0x1ead5f){logger[_0x518a('0x2d')](_0x1ead5f[_0x518a('0x2e')]);if(_0x1ead5f[_0x518a('0x2f')]){delete _0x1ead5f[_0x518a('0x2f')];}_0x2c1483[_0x518a('0x1f')](_0x1ac7f7)[_0x518a('0x30')](_0x1ead5f);};}function getInteractionUsers(_0x324fcd,_0x3ccb67){return new BPromise(function(_0x21048d,_0x360670){try{if(_0x3ccb67[_0x324fcd['id']]){_0x324fcd['Users']=_[_0x518a('0x31')](_0x3ccb67[_0x324fcd['id']],function(_0x5c5af6){return{'id':_0x5c5af6['id'],'fullname':_0x5c5af6[_0x518a('0x32')]};});}}catch(_0x5d9bac){_0x360670(_0x5d9bac);}_0x21048d(_0x324fcd);});}function getInteractionTags(_0x28ac7b,_0x10dbd6){return new BPromise(function(_0x1fba77,_0x297d4f){try{if(_0x28ac7b['TagIds']){_0x28ac7b['Tags']=[];_0x28ac7b['TagIds'][_0x518a('0x33')](',')[_0x518a('0x34')](function(_0x207616){_0x28ac7b[_0x518a('0x35')][_0x518a('0x36')](_0x10dbd6[_0x207616]);});}delete _0x28ac7b[_0x518a('0x37')];}catch(_0x5daa5e){_0x297d4f(_0x5daa5e);}_0x1fba77(_0x28ac7b);});}function updateOpenchannelInteraction(_0x438011,_0x93e3b8,_0x6bfb15){return new BPromise(function(_0x57e7,_0x529e48){return getInteractionUsers(_0x438011,_0x6bfb15)['then'](function(_0x4cc885){return getInteractionTags(_0x4cc885,_0x93e3b8);})[_0x518a('0x2b')](function(_0xabf944){_0x57e7(_0xabf944);})[_0x518a('0x38')](function(_0x571b1b){_0x529e48(_0x571b1b);});});}exports[_0x518a('0x39')]=function(_0x3d6b58,_0x18f573){var _0x189b5b={},_0x417b66={},_0x5ecf2e={'count':0x0,'rows':[]};var _0x423a01=_['map'](db[_0x518a('0x3a')][_0x518a('0x3b')],function(_0x32715b){return{'name':_0x32715b[_0x518a('0x3c')],'type':_0x32715b[_0x518a('0x3d')][_0x518a('0x3e')]};});_0x417b66['model']=_[_0x518a('0x31')](_0x423a01,_0x518a('0x2f'));_0x417b66[_0x518a('0x3f')]=_['keys'](_0x3d6b58[_0x518a('0x3f')]);_0x417b66['filters']=_['intersection'](_0x417b66[_0x518a('0x40')],_0x417b66[_0x518a('0x3f')]);_0x189b5b['attributes']=_[_0x518a('0x41')](_0x417b66[_0x518a('0x40')],qs['fields'](_0x3d6b58['query'][_0x518a('0x42')]));_0x189b5b[_0x518a('0x43')]=_0x189b5b[_0x518a('0x43')]['length']?_0x189b5b[_0x518a('0x43')]:_0x417b66['model'];if(!_0x3d6b58[_0x518a('0x3f')][_0x518a('0x44')](_0x518a('0x45'))){_0x189b5b[_0x518a('0x22')]=qs[_0x518a('0x22')](_0x3d6b58[_0x518a('0x3f')][_0x518a('0x22')]);_0x189b5b[_0x518a('0x24')]=qs['offset'](_0x3d6b58[_0x518a('0x3f')][_0x518a('0x24')]);}_0x189b5b[_0x518a('0x46')]=qs[_0x518a('0x47')](_0x3d6b58[_0x518a('0x3f')][_0x518a('0x47')]);_0x189b5b['where']=qs[_0x518a('0x48')](_[_0x518a('0x49')](_0x3d6b58[_0x518a('0x3f')],_0x417b66[_0x518a('0x48')]),_0x423a01);var _0x33361b=[];var _0x4dfbb2=squel[_0x518a('0x4a')]()['field']('id')[_0x518a('0x4b')]('name')['field']('color')[_0x518a('0x4c')](_0x518a('0x4d'));var _0x573703=squel[_0x518a('0x4a')]()[_0x518a('0x4b')](_0x518a('0x4e'))['field']('u.fullname')[_0x518a('0x4b')]('ui.OpenchannelInteractionId')[_0x518a('0x4c')]('user_has_openchannel_interactions','ui')[_0x518a('0x4f')](_0x518a('0x50'),'u',_0x518a('0x51'));var _0x3b680b=squel[_0x518a('0x4a')]()[_0x518a('0x4c')](_0x518a('0x52'),'i')[_0x518a('0x4f')](_0x518a('0x53'),'c',_0x518a('0x54'))[_0x518a('0x4f')](_0x518a('0x50'),'o','o.id\x20=\x20i.UserId')[_0x518a('0x4f')](_0x518a('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x518a('0x4f')](_0x518a('0x56'),'me',_0x518a('0x57'))[_0x518a('0x4f')](_0x518a('0x58'),'it',_0x518a('0x59'))[_0x518a('0x4f')](_0x518a('0x4d'),'t',_0x518a('0x5a'));var _0x38cc95=squel[_0x518a('0x5b')]();var _0x336fd8=[];var _0xcd8468=squel['expr']();var _0x1aec0b;if(_0x3d6b58[_0x518a('0x3f')]['search']){_0x1aec0b=as['parseSearch'](_0x3d6b58[_0x518a('0x3f')][_0x518a('0x5c')]);var _0x3c50ff=_0x1aec0b['sqlOperator'];for(var _0x168ace=0x0;_0x168ace<_0x1aec0b[_0x518a('0x5d')]['length'];_0x168ace++){var _0x493db8=_0x1aec0b[_0x518a('0x5d')][_0x168ace];var _0x190c66='i';var _0x105daf=_['find'](_0x423a01,[_0x518a('0x2f'),_0x493db8['field']]);if(!_0x105daf){switch(_0x493db8[_0x518a('0x4b')]){case _0x518a('0x5e'):if(_0x493db8[_0x518a('0x5f')]==0x1){_0x3b680b[_0x518a('0x60')]('`'+_0x493db8['field']+_0x518a('0x61'));}else{_0x3b680b['having']('`'+_0x493db8[_0x518a('0x4b')]+_0x518a('0x62'));}break;case _0x518a('0x63'):if(_0x493db8['operator']==='$substring'){if(_0x493db8[_0x518a('0x5f')][_0x518a('0x33')]('\x20')[_0x518a('0x64')]>0x1){_0x38cc95[_0x3c50ff](_0x518a('0x65'),qs[_0x518a('0x66')](_0x493db8[_0x518a('0x5f')]),null);}else{var _0x5c3724='%'+_0x493db8['value']+'%';_0x38cc95[_0x3c50ff](_0x518a('0x67'),_0x5c3724,_0x5c3724,_0x5c3724);}}else{_0x105daf=_[_0x518a('0x68')](_0x423a01,[_0x518a('0x2f'),'ContactId']);_0x493db8[_0x518a('0x4b')]='ContactId';_0x1f0159=as[_0x518a('0x69')](_0x190c66,_0x105daf['type'],_0x493db8);_0x38cc95[_0x3c50ff](_0x1f0159[_0x518a('0x6a')],_0x1f0159[_0x518a('0x5f')][_0x518a('0x6b')],_0x1f0159[_0x518a('0x5f')]['end']);}break;case _0x518a('0x6c'):var _0x3cb6a2=_0x493db8[_0x518a('0x5f')]['split'](',')[_0x518a('0x31')](function(_0x21108b){return Number(_0x21108b);});_0x3cb6a2['forEach'](function(_0x1561af){_0xcd8468['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1561af+',%');});_0x336fd8=_[_0x518a('0x6d')](_0x336fd8,_0x3cb6a2);break;case _0x518a('0x6e'):if(_0x493db8[_0x518a('0x6f')]===_0x518a('0x70')){_0x38cc95[_0x3c50ff](_0x518a('0x71'),'%'+_0x493db8[_0x518a('0x5f')]+'%',null);}else{_0x105daf=_[_0x518a('0x68')](_0x423a01,['name',_0x518a('0x72')]);_0x493db8['field']='UserId';_0x1f0159=as[_0x518a('0x69')](_0x190c66,_0x105daf[_0x518a('0x3d')],_0x493db8);_0x38cc95[_0x3c50ff](_0x1f0159['text'],_0x1f0159[_0x518a('0x5f')][_0x518a('0x6b')],_0x1f0159[_0x518a('0x5f')]['end']);}break;case _0x518a('0x73'):_0x1f0159=as[_0x518a('0x69')]('me',null,_0x493db8);_0x38cc95[_0x3c50ff](_0x1f0159[_0x518a('0x6a')],_0x1f0159['value'][_0x518a('0x6b')],_0x1f0159[_0x518a('0x5f')]['end']);break;}}else{var _0x1f0159=as[_0x518a('0x69')](_0x190c66,_0x105daf[_0x518a('0x3d')],_0x493db8);_0x38cc95[_0x3c50ff](_0x1f0159['text'],_0x1f0159[_0x518a('0x5f')]['start'],_0x1f0159[_0x518a('0x5f')]['end']);}}}else{var _0x3777e7=_(_0x3d6b58['query'])[_0x518a('0x74')]()[_0x518a('0x31')](function(_0x2388b6){return _[_0x518a('0x75')](_0x423a01,[_0x518a('0x2f'),_0x2388b6])?_0x2388b6:undefined;})[_0x518a('0x76')]()[_0x518a('0x5f')]();if(!_[_0x518a('0x77')](_0x3777e7)){_0x3777e7[_0x518a('0x34')](function(_0x490b1c){if(_0x490b1c===_0x518a('0x78')){_0x3b680b[_0x518a('0x79')](_0x518a('0x7a'),[][_0x518a('0x7b')](_0x3d6b58[_0x518a('0x3f')][_0x490b1c]));}else if(_0x490b1c==='createdAt'){var _0x4e2e3d=JSON[_0x518a('0x7c')](_0x3d6b58[_0x518a('0x3f')][_0x490b1c])[_0x518a('0x7d')];var _0xb207dc=JSON[_0x518a('0x7c')](_0x3d6b58[_0x518a('0x3f')][_0x490b1c])['$lte'];_0x3b680b[_0x518a('0x79')](_0x518a('0x7e'),_0x4e2e3d,_0xb207dc);}else{if(_0x3d6b58[_0x518a('0x3f')][_0x490b1c]===_0x518a('0x7f')){_0x3b680b['where']('i.'+_0x490b1c+_0x518a('0x80'));}else{_0x3b680b[_0x518a('0x79')]('i.'+_0x490b1c+_0x518a('0x81'),_0x3d6b58[_0x518a('0x3f')][_0x490b1c]);}}});}if(_0x3d6b58['query'][_0x518a('0x82')]){if(_0x3d6b58['query'][_0x518a('0x82')]==0x1){_0x3b680b['having'](_0x518a('0x83'));}else{_0x3b680b[_0x518a('0x60')](_0x518a('0x84'));}}if(_0x3d6b58[_0x518a('0x3f')][_0x518a('0x85')]){_0x336fd8=_['isArray'](_0x3d6b58['query'][_0x518a('0x85')])?_0x3d6b58[_0x518a('0x3f')][_0x518a('0x85')]:new Array(_0x3d6b58[_0x518a('0x3f')][_0x518a('0x85')]);_0x336fd8[_0x518a('0x34')](function(_0x11e87){_0xcd8468['or'](_0x518a('0x86'),'%,'+_0x11e87+',%');});}if(_0x3d6b58[_0x518a('0x3f')][_0x518a('0x87')]){var _0x3c8b49=_0x3d6b58[_0x518a('0x3f')]['filter'][_0x518a('0x88')]('\x5c','\x5c\x5c')[_0x518a('0x88')](/'/g,'\x27\x27');if(qs[_0x518a('0x89')](_0x3c8b49)){_0x38cc95['or'](_0x518a('0x8a'),_0x3c8b49+'%');}else{_0x38cc95['or'](_0x518a('0x8b'),qs[_0x518a('0x66')](_0x3c8b49))['or'](_0x518a('0x8c'),_0x3c8b49+'%')['or'](_0x518a('0x8d'),_0x3c8b49+'%');}}}_0x3b680b[_0x518a('0x79')](_0x38cc95);_0x3b680b['group'](_0x518a('0x8e'));var _0x1e6b2d={'type':db['Sequelize']['QueryTypes'][_0x518a('0x8f')],'raw':!![]};var _0x5775c=_0x3b680b['clone']();_0x5775c[_0x518a('0x4b')](_0x518a('0x8e'));_0x5775c[_0x518a('0x4b')](_0x518a('0x90'),_0x518a('0x5e'));if(_0x189b5b[_0x518a('0x46')]){_0x189b5b['order']['forEach'](function(_0x430a2f){var _0x4592a7=_0x430a2f[0x0]===_0x518a('0x91')?_0x430a2f[0x0]:'i.'+_0x430a2f[0x0];_0x3b680b['order'](_0x4592a7,_0x430a2f[0x1]===_0x518a('0x92')?![]:!![]);});}if(!_[_0x518a('0x77')](_0x336fd8)){_0x3b680b[_0x518a('0x60')](_0xcd8468);_0x5775c['where'](_0x518a('0x93'),_0x336fd8);}BPromise[_0x518a('0x94')]()[_0x518a('0x2b')](function(){if(!_0x1aec0b){if(_0x3d6b58['query'][_0x518a('0x78')])return;_0x5775c[_0x518a('0x79')](_0x518a('0x95'));_0x3b680b['where'](_0x518a('0x95'));return;}if(_0x3d6b58[_0x518a('0x96')]['role']!==_0x518a('0x97'))return;return _0x3d6b58[_0x518a('0x96')][_0x518a('0x98')]({'attributes':['id'],'raw':!![]})[_0x518a('0x2b')](function(_0x3e2b9b){if(_[_0x518a('0x77')](_0x3e2b9b)){_0x5775c[_0x518a('0x79')](_0x518a('0x99'));_0x3b680b[_0x518a('0x79')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5775c[_0x518a('0x79')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x518a('0x31')](_0x3e2b9b,'id'));_0x3b680b['where'](_0x518a('0x7a'),_[_0x518a('0x31')](_0x3e2b9b,'id'));}});})[_0x518a('0x2b')](function(){if(_0x3d6b58[_0x518a('0x96')][_0x518a('0x9a')]===_0x518a('0x97')&&!_0x1aec0b&&!_0x3d6b58[_0x518a('0x3f')]['OpenchannelAccountId'])return[];return db[_0x518a('0x9b')][_0x518a('0x3f')](_0x5775c['toString'](),_0x1e6b2d);})['then'](function(_0x5e7e33){_0x5ecf2e['count']=_0x5e7e33[_0x518a('0x64')];if(_0x5ecf2e['count']===0x0)return[];return db[_0x518a('0x9b')][_0x518a('0x3f')](_0x4dfbb2[_0x518a('0x9c')](),_0x1e6b2d)['then'](function(_0x46f570){_0x33361b=_[_0x518a('0x9d')](_0x46f570,'id');_0x1e6b2d=_['merge'](_0x1e6b2d,{'model':db[_0x518a('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d6b58[_0x518a('0x3f')][_0x518a('0x42')]){_0x189b5b[_0x518a('0x43')][_0x518a('0x34')](function(_0x301f24){_0x3b680b['field']('i.'+_0x301f24);});}else{_0x3b680b['field'](_0x518a('0x90'),'unreadMessages');_0x3b680b['field'](_0x518a('0x9e'),_0x518a('0x9f'));_0x3b680b[_0x518a('0x4b')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x3b680b['field'](_0x518a('0xa0'),_0x518a('0x91'));_0x3b680b[_0x518a('0x4b')](_0x518a('0xa1'));_0x3b680b['field'](_0x518a('0xa2'),_0x518a('0xa3'));_0x3b680b[_0x518a('0x4b')](_0x518a('0xa4'),_0x518a('0xa5'));_0x3b680b[_0x518a('0x4b')](_0x518a('0xa6'),_0x518a('0xa7'));_0x3b680b[_0x518a('0x4b')](_0x518a('0xa8'),_0x518a('0xa9'));_0x3b680b['field'](_0x518a('0xaa'),_0x518a('0xab'));_0x3b680b[_0x518a('0x4b')]('c.fax',_0x518a('0xac'));_0x3b680b[_0x518a('0x4b')](_0x518a('0xad'),_0x518a('0xae'));_0x3b680b[_0x518a('0x4b')](_0x518a('0xaf'),'Owner.internal');_0x3b680b[_0x518a('0x4b')](_0x518a('0xb0'),_0x518a('0x37'));}if(_0x189b5b[_0x518a('0x22')])_0x3b680b['limit'](_0x189b5b[_0x518a('0x22')]);if(_0x189b5b['offset'])_0x3b680b['offset'](_0x189b5b[_0x518a('0x24')]);return db['sequelize'][_0x518a('0x3f')](_0x3b680b[_0x518a('0x9c')](),_0x1e6b2d);})[_0x518a('0x2b')](function(_0x62f3b7){if(_0x62f3b7['length']>0x0)_0x573703[_0x518a('0x79')](_0x518a('0xb1'),_[_0x518a('0x31')](_0x62f3b7,'id'));return db[_0x518a('0x9b')][_0x518a('0x3f')](_0x573703[_0x518a('0x9c')](),_0x1e6b2d)[_0x518a('0x2b')](function(_0x5cdd27){var _0x54b076=_[_0x518a('0xb2')](_0x5cdd27,_0x518a('0xb3'));var _0x4c67f2=[];_0x62f3b7['forEach'](function(_0x5032c6){_0x4c67f2[_0x518a('0x36')](updateOpenchannelInteraction(_0x5032c6,_0x33361b,_0x54b076));});return BPromise['all'](_0x4c67f2);});});})[_0x518a('0x2b')](function(_0x8b14cc){_0x5ecf2e[_0x518a('0xb4')]=_0x8b14cc;return _0x5ecf2e;})[_0x518a('0x2b')](respondWithFilteredResult(_0x18f573,_0x189b5b))[_0x518a('0x38')](handleError(_0x18f573,null));};exports[_0x518a('0xb5')]=function(_0x535c10,_0x3c50f0){var _0xd29ce={};if(_0x535c10[_0x518a('0x3f')][_0x518a('0x3d')]&&_0x535c10[_0x518a('0x3f')]['type']===_0x518a('0x4c')){_0xd29ce[_0x518a('0x4c')]=_0x535c10['params']['id'];}else{_0xd29ce['id']=_0x535c10[_0x518a('0xb6')]['id'];}var _0x45e428={'raw':![],'where':_0xd29ce},_0x414d54={};_0x414d54[_0x518a('0x40')]=_[_0x518a('0x74')](db[_0x518a('0x3a')]['rawAttributes']);_0x414d54[_0x518a('0x3f')]=_[_0x518a('0x74')](_0x535c10[_0x518a('0x3f')]);_0x414d54[_0x518a('0x48')]=_[_0x518a('0x41')](_0x414d54[_0x518a('0x40')],_0x414d54[_0x518a('0x3f')]);_0x45e428[_0x518a('0x43')]=_[_0x518a('0x41')](_0x414d54['model'],qs[_0x518a('0x42')](_0x535c10[_0x518a('0x3f')][_0x518a('0x42')]));_0x45e428[_0x518a('0x43')]=_0x45e428['attributes'][_0x518a('0x64')]?_0x45e428[_0x518a('0x43')]:_0x414d54[_0x518a('0x40')];if(_0x535c10[_0x518a('0x3f')]['includeAll']){_0x45e428[_0x518a('0xb7')]=[{'all':!![]}];}_0x45e428=_[_0x518a('0xb8')]({},_0x45e428,_0x535c10[_0x518a('0xb9')]);return db[_0x518a('0x3a')][_0x518a('0x68')](_0x45e428)['then'](handleEntityNotFound(_0x3c50f0,null))[_0x518a('0x2b')](respondWithResult(_0x3c50f0,null))[_0x518a('0x38')](handleError(_0x3c50f0,null));};exports['create']=function(_0x20e255,_0x553707){return db[_0x518a('0x3a')][_0x518a('0xba')](_0x20e255['body'],{})[_0x518a('0x2b')](respondWithResult(_0x553707,0xc9))[_0x518a('0x38')](handleError(_0x553707,null));};exports['update']=function(_0x2e6b6f,_0x518193){if(_0x2e6b6f[_0x518a('0x73')]['id']){delete _0x2e6b6f['body']['id'];}return db[_0x518a('0x3a')]['find']({'where':{'id':_0x2e6b6f[_0x518a('0xb6')]['id']}})['then'](handleEntityNotFound(_0x518193,null))[_0x518a('0x2b')](saveUpdates(_0x2e6b6f[_0x518a('0x73')],null))[_0x518a('0x2b')](respondWithResult(_0x518193,null))['catch'](handleError(_0x518193,null));};exports[_0x518a('0x2a')]=function(_0x592fc6,_0x303f10){return db[_0x518a('0x3a')][_0x518a('0x68')]({'where':{'id':_0x592fc6[_0x518a('0xb6')]['id']}})['then'](handleEntityNotFound(_0x303f10,null))[_0x518a('0x2b')](removeEntity(_0x303f10,null))[_0x518a('0x38')](handleError(_0x303f10,null));};exports['describe']=function(_0x38f765,_0x5de78a){return db[_0x518a('0x3a')][_0x518a('0xbb')]()[_0x518a('0x2b')](respondWithResult(_0x5de78a,null))[_0x518a('0x38')](handleError(_0x5de78a,null));};exports[_0x518a('0xbc')]=function(_0x1ee7b1,_0x41de62,_0x5e0149){return db[_0x518a('0xbd')][_0x518a('0x68')]({'where':{'id':_0x1ee7b1[_0x518a('0xb6')]['id']}})[_0x518a('0x2b')](handleEntityNotFound(_0x41de62,null))[_0x518a('0x2b')](function(_0x10450f){if(_0x10450f){return _0x10450f[_0x518a('0xbc')](_0x1ee7b1[_0x518a('0x73')][_0x518a('0xbe')],_[_0x518a('0xbf')](_0x1ee7b1[_0x518a('0x73')],[_0x518a('0xbe'),'id'])||{});}})[_0x518a('0x2b')](respondWithResult(_0x41de62,null))['catch'](handleError(_0x41de62,null));};exports[_0x518a('0xc0')]=function(_0x166e16,_0xe1bf49,_0x36e834){var _0x2437fa={'raw':![],'where':{}};var _0x37b91e={};var _0x197eac={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x518a('0xc1')]({'where':{'id':_0x166e16[_0x518a('0xb6')]['id']}})['then'](handleEntityNotFound(_0xe1bf49,null))[_0x518a('0x2b')](function(_0x1a0fcb){if(_0x1a0fcb){_0x37b91e[_0x518a('0x40')]=_[_0x518a('0x74')](db[_0x518a('0xbd')][_0x518a('0x3b')]);_0x37b91e[_0x518a('0x3f')]=_[_0x518a('0x74')](_0x166e16[_0x518a('0x3f')]);_0x37b91e['filters']=_[_0x518a('0x41')](_0x37b91e['model'],_0x37b91e[_0x518a('0x3f')]);_0x2437fa['attributes']=_[_0x518a('0x41')](_0x37b91e[_0x518a('0x40')],qs[_0x518a('0x42')](_0x166e16[_0x518a('0x3f')][_0x518a('0x42')]));_0x2437fa[_0x518a('0x43')]=_0x2437fa[_0x518a('0x43')][_0x518a('0x64')]?_0x2437fa[_0x518a('0x43')]:_0x37b91e['model'];if(!_0x166e16[_0x518a('0x3f')]['hasOwnProperty'](_0x518a('0x45'))){_0x2437fa[_0x518a('0x22')]=qs['limit'](_0x166e16[_0x518a('0x3f')]['limit']);_0x2437fa[_0x518a('0x24')]=qs[_0x518a('0x24')](_0x166e16[_0x518a('0x3f')][_0x518a('0x24')]);}_0x2437fa[_0x518a('0x46')]=qs[_0x518a('0x47')](_0x166e16[_0x518a('0x3f')]['sort']);_0x2437fa[_0x518a('0x79')]=qs[_0x518a('0x48')](_[_0x518a('0x49')](_0x166e16[_0x518a('0x3f')],_0x37b91e[_0x518a('0x48')]));_0x2437fa[_0x518a('0x79')][_0x518a('0xb3')]=_0x1a0fcb['id'];if(_0x166e16[_0x518a('0x3f')][_0x518a('0x87')]){_0x2437fa['where']=_[_0x518a('0xb8')](_0x2437fa[_0x518a('0x79')],{'$or':_[_0x518a('0x31')](_0x2437fa['attributes'],function(_0x22cba1){var _0x39097c={};_0x39097c[_0x22cba1]={'$like':'%'+_0x166e16[_0x518a('0x3f')]['filter']+'%'};return _0x39097c;})});}if(_0x166e16[_0x518a('0x3f')][_0x518a('0x7d')]){var _0x212e4a=_0x166e16[_0x518a('0x3f')][_0x518a('0x7d')][_0x518a('0x33')](',');var _0x4abf2a={};_0x4abf2a[_0x212e4a[0x0]]={'$gte':moment(_0x212e4a[0x1])['format'](_0x518a('0xc2'))};_0x2437fa[_0x518a('0x79')]=_['merge'](_0x2437fa[_0x518a('0x79')],_0x4abf2a);}_0x2437fa=_[_0x518a('0xb8')]({},_0x2437fa,_0x166e16[_0x518a('0xb9')]);return db[_0x518a('0xbd')][_0x518a('0x23')]({'where':_0x2437fa[_0x518a('0x79')]})[_0x518a('0x2b')](function(_0x2aba7e){_0x197eac[_0x518a('0x23')]=_0x2aba7e;if(_0x166e16[_0x518a('0x3f')]['includeAll']){_0x2437fa[_0x518a('0xb7')]=[{'all':!![]}];}return db[_0x518a('0xbd')][_0x518a('0xc3')](_0x2437fa);})['then'](function(_0xa6b33a){_0x197eac[_0x518a('0xb4')]=_0xa6b33a;return _0x197eac;});}})[_0x518a('0x2b')](respondWithFilteredResult(_0xe1bf49,_0x2437fa))[_0x518a('0x38')](handleError(_0xe1bf49,null));};exports['addTags']=function(_0x197b6c,_0x4f78b6,_0x4b2155){return db[_0x518a('0x3a')][_0x518a('0x68')]({'where':{'id':_0x197b6c[_0x518a('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4f78b6,null))[_0x518a('0x2b')](function(_0x50da78){if(_0x50da78){return _0x50da78[_0x518a('0xc4')](_0x197b6c[_0x518a('0x73')]['ids'],_[_0x518a('0xbf')](_0x197b6c[_0x518a('0x73')],['ids','id'])||{})[_0x518a('0xc5')](function(){return db[_0x518a('0x6c')]['findAll']({'attributes':['id',_0x518a('0x2f'),_0x518a('0xc6')],'where':{'id':_0x197b6c[_0x518a('0x73')][_0x518a('0xbe')]}});})[_0x518a('0x2b')](function(_0x431606){socket['emit'](_0x518a('0xc7'),{'id':Number(_0x197b6c[_0x518a('0xb6')]['id']),'tags':_0x431606||[]});return{'id':Number(_0x197b6c['params']['id']),'tags':_0x431606||[]};});}})[_0x518a('0x2b')](respondWithResult(_0x4f78b6,null))[_0x518a('0x38')](handleError(_0x4f78b6,null));};exports['removeTags']=function(_0x2bd1a3,_0x5269f5,_0x1a936e){return db[_0x518a('0x3a')][_0x518a('0x68')]({'where':{'id':_0x2bd1a3[_0x518a('0xb6')]['id']}})[_0x518a('0x2b')](handleEntityNotFound(_0x5269f5,null))[_0x518a('0x2b')](function(_0x337958){if(_0x337958){return _0x337958[_0x518a('0xc8')](_0x2bd1a3[_0x518a('0x3f')][_0x518a('0xbe')]);}})[_0x518a('0x2b')](respondWithStatusCode(_0x5269f5,null))[_0x518a('0x38')](handleError(_0x5269f5,null));};exports[_0x518a('0xc9')]=function(_0x3261a3,_0x33824a){var _0x1dea30=moment()['unix']()['toString']();var _0x3efdfc=path[_0x518a('0xca')](config[_0x518a('0xcb')],_0x518a('0xcc'),'files',_0x518a('0xcd'));var _0x5a9112=path[_0x518a('0xca')](config[_0x518a('0xcb')],_0x518a('0xcc'),_0x518a('0xce'),'attachments');var _0x24d7d=path[_0x518a('0xca')](_0x3efdfc,_0x1dea30);var _0x4e1588=util['format']('transcript-%d-%s.zip',_0x3261a3['params']['id'],_0x1dea30);var _0x55a7f1=path[_0x518a('0xca')](_0x3efdfc,_0x4e1588);var _0x2aa800=[];_0x2aa800[_0x518a('0x36')]({'model':db[_0x518a('0x6e')],'as':_0x518a('0x6e'),'attributes':['id',_0x518a('0x32')],'raw':!![]});_0x2aa800[_0x518a('0x36')]({'model':db[_0x518a('0xcf')],'as':_0x518a('0x63'),'attributes':['id','firstName',_0x518a('0xd0')],'raw':!![]});if(_0x3261a3[_0x518a('0x3f')]['attachments']){_0x2aa800[_0x518a('0x36')]({'model':db['Attachment'],'as':_0x518a('0xd1'),'raw':!![]});}var _0xb0bad3=[{'model':db['OpenchannelMessage'],'as':_0x518a('0xd2'),'attributes':['id','body','createdAt','direction','secret','read'],'include':_0x2aa800}];_0xb0bad3[_0x518a('0x36')]({'model':db['OpenchannelAccount'],'as':_0x518a('0xd3'),'attributes':['id',_0x518a('0x2f')]});_0xb0bad3[_0x518a('0x36')]({'model':db['User'],'as':_0x518a('0xd4'),'attributes':['id','fullname']});return db[_0x518a('0x3a')][_0x518a('0x68')]({'where':{'id':_0x3261a3[_0x518a('0xb6')]['id']},'include':_0xb0bad3})[_0x518a('0x2b')](handleEntityNotFound(_0x33824a,null))['then'](function(_0x46f528){if(_0x46f528){var _0x3558bb=_0x46f528[_0x518a('0xd5')]({'plain':!![]});fs[_0x518a('0xd6')](_0x24d7d);var _0xb6adc7={'channel':_0x518a('0xd7'),'account':_0x3558bb[_0x518a('0xd3')]['name'],'agent':_0x3558bb[_0x518a('0xd4')]?_0x3558bb[_0x518a('0xd4')][_0x518a('0x32')]:_0x518a('0xd8'),'createdAt':moment(_0x3558bb[_0x518a('0xd9')])['format'](_0x518a('0xc2'))['toString'](),'closedAt':_0x3558bb['closed']?moment(_0x3558bb[_0x518a('0xda')])[_0x518a('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')[_0x518a('0x9c')]():'','disposition':_0x3558bb[_0x518a('0xdc')],'visibility':_0x3558bb[_0x518a('0xdd')]?_0x518a('0xde'):'Private','messages':_(_0x3558bb['Messages'])[_0x518a('0x87')]({'secret':![]})[_0x518a('0x31')](function(_0x38afca){if(_0x38afca['Attachment']){var _0x51b595=path[_0x518a('0xca')](_0x5a9112,_0x38afca[_0x518a('0xd1')][_0x518a('0xdf')]);if(fs[_0x518a('0xe0')](_0x51b595)){fs[_0x518a('0xe1')](_0x51b595)['pipe'](fs['createWriteStream'](path[_0x518a('0xca')](_0x24d7d,_0x38afca[_0x518a('0xd1')][_0x518a('0xdf')])));}}return{'date':moment(_0x38afca[_0x518a('0xd9')])[_0x518a('0xdb')](_0x518a('0xc2'))['toString'](),'sender':_0x38afca[_0x518a('0xe2')]===_0x518a('0xe3')?_0x38afca['User']?_0x38afca[_0x518a('0x6e')]['fullname']:_0x518a('0xe4'):_0x38afca[_0x518a('0x63')][_0x518a('0xe5')]+(_0x38afca[_0x518a('0x63')][_0x518a('0xd0')]?'\x20'+_0x38afca['Contact'][_0x518a('0xd0')]:''),'body':_0x38afca[_0x518a('0xd1')]?_0x38afca['Attachment'][_0x518a('0xdf')]:_0x38afca[_0x518a('0x73')],'direction':_0x38afca[_0x518a('0xe2')]===_0x518a('0xe3')?'A':'C','secret':_0x38afca[_0x518a('0xe6')],'read':_0x38afca[_0x518a('0x82')],'attachment':_0x38afca[_0x518a('0xd1')]};})[_0x518a('0x5f')]()};return ejs[_0x518a('0xe7')](path['join'](config[_0x518a('0xcb')],_0x518a('0xcc'),'views',_0x518a('0xe8')),{'interaction':_0xb6adc7})[_0x518a('0x2b')](function(_0x4b9680){var _0x3abd7c=path[_0x518a('0xca')](_0x24d7d,_0x518a('0xe9')+_0x3558bb['id']+'-'+_0x1dea30+_0x518a('0xea'));var _0x1e315e={'path':_0x3abd7c,'channel':_0x518a('0xd7'),'interactionId':_0x3558bb['id']};return pdf[_0x518a('0xeb')](_0x4b9680,_0x1e315e);})['then'](function(){return new BPromise(function(_0x311277,_0x5cae47){zipdir(_0x24d7d,{'saveTo':_0x55a7f1},function(_0x238220,_0x16623a){if(_0x238220)return _0x5cae47(_0x238220);return _0x311277(_0x16623a);});})['then'](function(){return new BPromise(function(_0x14c6b1,_0x2315b7){rimraf(_0x24d7d,function(_0x37be6d){if(_0x37be6d)_0x2315b7(_0x37be6d);return _0x14c6b1();});});})['then'](function(){return _0x33824a[_0x518a('0xc9')](_0x55a7f1,_0x4e1588,function(_0x10b7a3){if(_0x10b7a3){console[_0x518a('0xec')](_0x518a('0xed'),_0x10b7a3);}else{fs['unlinkSync'](_0x55a7f1);}});});});}else{return _0x33824a[_0x518a('0x1e')](0xc8);}})[_0x518a('0x38')](handleError(_0x33824a,null));}; \ No newline at end of file +var _0x01d3=['i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','role','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','params','includeAll','include','options','create','update','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','color','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','threadId','Private','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/export/pdf','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','stack','name','send','Users','map','TagIds','Tags','split','catch','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','select','field','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','users','openchannel_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','`\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)','ContactId','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','compact','isEmpty','forEach','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','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','i.from\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone'];(function(_0xdfda79,_0x25dd79){var _0x21df8f=function(_0x402ca0){while(--_0x402ca0){_0xdfda79['push'](_0xdfda79['shift']());}};_0x21df8f(++_0x25dd79);}(_0x01d3,0x66));var _0x301d=function(_0x532668,_0x8b883){_0x532668=_0x532668-0x0;var _0x2087b4=_0x01d3[_0x532668];return _0x2087b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x301d('0x0'));var zipdir=require(_0x301d('0x1'));var jsonpatch=require(_0x301d('0x2'));var rp=require(_0x301d('0x3'));var moment=require(_0x301d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x301d('0x5'));var util=require(_0x301d('0x6'));var path=require(_0x301d('0x7'));var sox=require(_0x301d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x301d('0x9'));var _=require('lodash');var squel=require(_0x301d('0xa'));var crypto=require(_0x301d('0xb'));var jsforce=require(_0x301d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x301d('0xd'));var querystring=require('querystring');var Papa=require(_0x301d('0xe'));var Redis=require('ioredis');var authService=require(_0x301d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x301d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x301d('0x11'));var utils=require('../../config/utils');var config=require(_0x301d('0x12'));var licenseUtil=require(_0x301d('0x13'));var db=require(_0x301d('0x14'))['db'];config[_0x301d('0x15')]=_['defaults'](config[_0x301d('0x15')],{'host':_0x301d('0x16'),'port':0x18eb});var socket=require(_0x301d('0x17'))(new Redis(config[_0x301d('0x15')]));require(_0x301d('0x18'))[_0x301d('0x19')](socket);function respondWithStatusCode(_0x21a5bf,_0x9e348a){_0x9e348a=_0x9e348a||0xcc;return function(_0x237871){if(_0x237871){return _0x21a5bf[_0x301d('0x1a')](_0x9e348a);}return _0x21a5bf[_0x301d('0x1b')](_0x9e348a)[_0x301d('0x1c')]();};}function respondWithResult(_0x5e70b6,_0x488a3c){_0x488a3c=_0x488a3c||0xc8;return function(_0x2f1b7a){if(_0x2f1b7a){return _0x5e70b6['status'](_0x488a3c)[_0x301d('0x1d')](_0x2f1b7a);}};}function respondWithFilteredResult(_0x5b86cc,_0x300a6d){return function(_0x295316){if(_0x295316){var _0x230f86=typeof _0x300a6d[_0x301d('0x1e')]==='undefined'&&typeof _0x300a6d['limit']===_0x301d('0x1f');var _0xaf5939=_0x295316[_0x301d('0x20')];var _0x706ef4=_0x230f86?0x0:_0x300a6d[_0x301d('0x1e')];var _0x3bb1f4=_0x230f86?_0x295316['count']:_0x300a6d[_0x301d('0x1e')]+_0x300a6d[_0x301d('0x21')];var _0x35af0e;if(_0x3bb1f4>=_0xaf5939){_0x3bb1f4=_0xaf5939;_0x35af0e=0xc8;}else{_0x35af0e=0xce;}_0x5b86cc[_0x301d('0x1b')](_0x35af0e);return _0x5b86cc[_0x301d('0x22')](_0x301d('0x23'),_0x706ef4+'-'+_0x3bb1f4+'/'+_0xaf5939)[_0x301d('0x1d')](_0x295316);}return null;};}function patchUpdates(_0x1c2698){return function(_0x5d6001){try{jsonpatch[_0x301d('0x24')](_0x5d6001,_0x1c2698,!![]);}catch(_0x178233){return BPromise['reject'](_0x178233);}return _0x5d6001[_0x301d('0x25')]();};}function saveUpdates(_0x50c1ed,_0x3091cf){return function(_0x28718c){if(_0x28718c){return _0x28718c['update'](_0x50c1ed)[_0x301d('0x26')](function(_0x2a98b6){return _0x2a98b6;});}return null;};}function removeEntity(_0x97b67f,_0x411979){return function(_0x5a5b0f){if(_0x5a5b0f){return _0x5a5b0f['destroy']()[_0x301d('0x26')](function(){_0x97b67f[_0x301d('0x1b')](0xcc)[_0x301d('0x1c')]();});}};}function handleEntityNotFound(_0x56c240,_0x1ad19d){return function(_0x55f479){if(!_0x55f479){_0x56c240[_0x301d('0x1a')](0x194);}return _0x55f479;};}function handleError(_0x4488a2,_0x595aa7){_0x595aa7=_0x595aa7||0x1f4;return function(_0x242d03){logger['error'](_0x242d03[_0x301d('0x27')]);if(_0x242d03[_0x301d('0x28')]){delete _0x242d03[_0x301d('0x28')];}_0x4488a2['status'](_0x595aa7)[_0x301d('0x29')](_0x242d03);};}function getInteractionUsers(_0xc8477c,_0xea257){return new BPromise(function(_0x3ca9ae,_0x183cbc){try{if(_0xea257[_0xc8477c['id']]){_0xc8477c[_0x301d('0x2a')]=_[_0x301d('0x2b')](_0xea257[_0xc8477c['id']],function(_0x1c4bac){return{'id':_0x1c4bac['id'],'fullname':_0x1c4bac['fullname']};});}}catch(_0x429c22){_0x183cbc(_0x429c22);}_0x3ca9ae(_0xc8477c);});}function getInteractionTags(_0x1aa970,_0x40d09b){return new BPromise(function(_0x331e3e,_0x423c54){try{if(_0x1aa970[_0x301d('0x2c')]){_0x1aa970[_0x301d('0x2d')]=[];_0x1aa970[_0x301d('0x2c')][_0x301d('0x2e')](',')['forEach'](function(_0x31d70a){_0x1aa970[_0x301d('0x2d')]['push'](_0x40d09b[_0x31d70a]);});}delete _0x1aa970[_0x301d('0x2c')];}catch(_0x2fd4e3){_0x423c54(_0x2fd4e3);}_0x331e3e(_0x1aa970);});}function updateOpenchannelInteraction(_0x10a86b,_0x4c7e86,_0x5a9f86){return new BPromise(function(_0x485b9e,_0x658883){return getInteractionUsers(_0x10a86b,_0x5a9f86)[_0x301d('0x26')](function(_0x5d2fd1){return getInteractionTags(_0x5d2fd1,_0x4c7e86);})['then'](function(_0x4086f7){_0x485b9e(_0x4086f7);})[_0x301d('0x2f')](function(_0x16930d){_0x658883(_0x16930d);});});}exports['index']=function(_0x25dda6,_0x4f5bff){var _0x5ee0fc={},_0x3c7b3e={},_0x2007d3={'count':0x0,'rows':[]};var _0x569e05=_['map'](db[_0x301d('0x30')][_0x301d('0x31')],function(_0x3f02e1){return{'name':_0x3f02e1[_0x301d('0x32')],'type':_0x3f02e1[_0x301d('0x33')]['key']};});_0x3c7b3e[_0x301d('0x34')]=_['map'](_0x569e05,_0x301d('0x28'));_0x3c7b3e[_0x301d('0x35')]=_[_0x301d('0x36')](_0x25dda6[_0x301d('0x35')]);_0x3c7b3e[_0x301d('0x37')]=_['intersection'](_0x3c7b3e['model'],_0x3c7b3e[_0x301d('0x35')]);_0x5ee0fc[_0x301d('0x38')]=_[_0x301d('0x39')](_0x3c7b3e[_0x301d('0x34')],qs[_0x301d('0x3a')](_0x25dda6['query'][_0x301d('0x3a')]));_0x5ee0fc[_0x301d('0x38')]=_0x5ee0fc[_0x301d('0x38')]['length']?_0x5ee0fc['attributes']:_0x3c7b3e[_0x301d('0x34')];if(!_0x25dda6[_0x301d('0x35')]['hasOwnProperty'](_0x301d('0x3b'))){_0x5ee0fc[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x25dda6['query'][_0x301d('0x21')]);_0x5ee0fc[_0x301d('0x1e')]=qs[_0x301d('0x1e')](_0x25dda6[_0x301d('0x35')][_0x301d('0x1e')]);}_0x5ee0fc[_0x301d('0x3c')]=qs[_0x301d('0x3d')](_0x25dda6[_0x301d('0x35')][_0x301d('0x3d')]);_0x5ee0fc[_0x301d('0x3e')]=qs[_0x301d('0x37')](_['pick'](_0x25dda6[_0x301d('0x35')],_0x3c7b3e['filters']),_0x569e05);var _0x3cc249=[];var _0xe808cc=squel[_0x301d('0x3f')]()[_0x301d('0x40')]('id')[_0x301d('0x40')]('name')[_0x301d('0x40')]('color')['from'](_0x301d('0x41'));var _0x1cfad7=squel[_0x301d('0x3f')]()['field'](_0x301d('0x42'))[_0x301d('0x40')](_0x301d('0x43'))['field'](_0x301d('0x44'))[_0x301d('0x45')](_0x301d('0x46'),'ui')['left_join'](_0x301d('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x11c5eb=squel['select']()[_0x301d('0x45')](_0x301d('0x48'),'i')[_0x301d('0x49')](_0x301d('0x4a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x301d('0x49')](_0x301d('0x47'),'o',_0x301d('0x4b'))[_0x301d('0x49')](_0x301d('0x4c'),'a',_0x301d('0x4d'))[_0x301d('0x49')]('openchannel_messages','me',_0x301d('0x4e'))[_0x301d('0x49')](_0x301d('0x4f'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x301d('0x49')](_0x301d('0x41'),'t',_0x301d('0x50'));var _0xa52fad=squel['expr']();var _0xd0dbd8=[];var _0x33199c=squel[_0x301d('0x51')]();var _0x4bb5c7;if(_0x25dda6[_0x301d('0x35')][_0x301d('0x52')]){_0x4bb5c7=as[_0x301d('0x53')](_0x25dda6[_0x301d('0x35')]['search']);var _0x1b8f93=_0x4bb5c7[_0x301d('0x54')];for(var _0x4951ae=0x0;_0x4951ae<_0x4bb5c7[_0x301d('0x55')][_0x301d('0x56')];_0x4951ae++){var _0x36aebb=_0x4bb5c7['conditions'][_0x4951ae];var _0x1850ee='i';var _0x408ad2=_[_0x301d('0x57')](_0x569e05,[_0x301d('0x28'),_0x36aebb[_0x301d('0x40')]]);if(!_0x408ad2){switch(_0x36aebb[_0x301d('0x40')]){case _0x301d('0x58'):if(_0x36aebb['value']==0x1){_0x11c5eb[_0x301d('0x59')]('`'+_0x36aebb[_0x301d('0x40')]+_0x301d('0x5a'));}else{_0x11c5eb[_0x301d('0x59')]('`'+_0x36aebb['field']+_0x301d('0x5b'));}break;case _0x301d('0x5c'):if(_0x36aebb[_0x301d('0x5d')]===_0x301d('0x5e')){if(_0x36aebb[_0x301d('0x5f')]['split']('\x20')[_0x301d('0x56')]>0x1){_0xa52fad[_0x1b8f93](_0x301d('0x60'),qs['getFullTextValue'](_0x36aebb[_0x301d('0x5f')]),null);}else{var _0x3417d2='%'+_0x36aebb[_0x301d('0x5f')]+'%';_0xa52fad[_0x1b8f93]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3417d2,_0x3417d2,_0x3417d2);}}else{_0x408ad2=_[_0x301d('0x57')](_0x569e05,[_0x301d('0x28'),_0x301d('0x61')]);_0x36aebb[_0x301d('0x40')]=_0x301d('0x61');_0x1b673c=as['buildExpression'](_0x1850ee,_0x408ad2[_0x301d('0x33')],_0x36aebb);_0xa52fad[_0x1b8f93](_0x1b673c[_0x301d('0x62')],_0x1b673c[_0x301d('0x5f')][_0x301d('0x63')],_0x1b673c['value']['end']);}break;case'Tag':var _0x2cedf7=_0x36aebb['value'][_0x301d('0x2e')](',')[_0x301d('0x2b')](function(_0x1ca383){return Number(_0x1ca383);});_0x2cedf7['forEach'](function(_0x4654d2){_0x33199c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4654d2+',%');});_0xd0dbd8=_['union'](_0xd0dbd8,_0x2cedf7);break;case _0x301d('0x64'):if(_0x36aebb[_0x301d('0x5d')]===_0x301d('0x5e')){_0xa52fad[_0x1b8f93](_0x301d('0x65'),'%'+_0x36aebb[_0x301d('0x5f')]+'%',null);}else{_0x408ad2=_['find'](_0x569e05,[_0x301d('0x28'),_0x301d('0x66')]);_0x36aebb[_0x301d('0x40')]=_0x301d('0x66');_0x1b673c=as['buildExpression'](_0x1850ee,_0x408ad2[_0x301d('0x33')],_0x36aebb);_0xa52fad[_0x1b8f93](_0x1b673c[_0x301d('0x62')],_0x1b673c[_0x301d('0x5f')]['start'],_0x1b673c[_0x301d('0x5f')][_0x301d('0x1c')]);}break;case _0x301d('0x67'):_0x1b673c=as[_0x301d('0x68')]('me',null,_0x36aebb);_0xa52fad[_0x1b8f93](_0x1b673c[_0x301d('0x62')],_0x1b673c[_0x301d('0x5f')][_0x301d('0x63')],_0x1b673c[_0x301d('0x5f')][_0x301d('0x1c')]);break;}}else{var _0x1b673c=as[_0x301d('0x68')](_0x1850ee,_0x408ad2['type'],_0x36aebb);_0xa52fad[_0x1b8f93](_0x1b673c['text'],_0x1b673c['value'][_0x301d('0x63')],_0x1b673c[_0x301d('0x5f')]['end']);}}}else{var _0x164775=_(_0x25dda6['query'])['keys']()[_0x301d('0x2b')](function(_0x4339be){return _[_0x301d('0x69')](_0x569e05,[_0x301d('0x28'),_0x4339be])?_0x4339be:undefined;})[_0x301d('0x6a')]()[_0x301d('0x5f')]();if(!_[_0x301d('0x6b')](_0x164775)){_0x164775[_0x301d('0x6c')](function(_0x5e54f1){if(_0x5e54f1===_0x301d('0x6d')){_0x11c5eb[_0x301d('0x3e')](_0x301d('0x6e'),[][_0x301d('0x6f')](_0x25dda6['query'][_0x5e54f1]));}else if(_0x5e54f1===_0x301d('0x70')){var _0x5a704b=JSON[_0x301d('0x71')](_0x25dda6['query'][_0x5e54f1])[_0x301d('0x72')];var _0x283c58=JSON[_0x301d('0x71')](_0x25dda6['query'][_0x5e54f1])['$lte'];_0x11c5eb['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a704b,_0x283c58);}else{if(_0x25dda6['query'][_0x5e54f1]===_0x301d('0x73')){_0x11c5eb[_0x301d('0x3e')]('i.'+_0x5e54f1+_0x301d('0x74'));}else{_0x11c5eb[_0x301d('0x3e')]('i.'+_0x5e54f1+_0x301d('0x75'),_0x25dda6[_0x301d('0x35')][_0x5e54f1]);}}});}if(_0x25dda6[_0x301d('0x35')][_0x301d('0x76')]){if(_0x25dda6[_0x301d('0x35')][_0x301d('0x76')]==0x1){_0x11c5eb[_0x301d('0x59')](_0x301d('0x77'));}else{_0x11c5eb[_0x301d('0x59')](_0x301d('0x78'));}}if(_0x25dda6[_0x301d('0x35')]['tag']){_0xd0dbd8=_[_0x301d('0x79')](_0x25dda6[_0x301d('0x35')]['tag'])?_0x25dda6[_0x301d('0x35')][_0x301d('0x7a')]:new Array(_0x25dda6[_0x301d('0x35')][_0x301d('0x7a')]);_0xd0dbd8[_0x301d('0x6c')](function(_0x176f38){_0x33199c['or'](_0x301d('0x7b'),'%,'+_0x176f38+',%');});}if(_0x25dda6[_0x301d('0x35')][_0x301d('0x7c')]){var _0x1b320f=_0x25dda6['query'][_0x301d('0x7c')]['replace']('\x5c','\x5c\x5c')[_0x301d('0x7d')](/'/g,'\x27\x27');if(qs[_0x301d('0x7e')](_0x1b320f)){_0xa52fad['or'](_0x301d('0x7f'),_0x1b320f+'%');}else{_0xa52fad['or'](_0x301d('0x80'),qs[_0x301d('0x81')](_0x1b320f))['or'](_0x301d('0x82'),_0x1b320f+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1b320f+'%');}}}_0x11c5eb[_0x301d('0x3e')](_0xa52fad);_0x11c5eb[_0x301d('0x83')]('i.id');var _0x3f3cba={'type':db[_0x301d('0x84')][_0x301d('0x85')][_0x301d('0x86')],'raw':!![]};var _0x21c15a=_0x11c5eb[_0x301d('0x87')]();_0x21c15a[_0x301d('0x40')](_0x301d('0x88'));_0x21c15a[_0x301d('0x40')](_0x301d('0x89'),_0x301d('0x58'));if(_0x5ee0fc[_0x301d('0x3c')]){_0x5ee0fc[_0x301d('0x3c')][_0x301d('0x6c')](function(_0x1fa683){var _0x15ecb3=_0x1fa683[0x0]==='contactName'?_0x1fa683[0x0]:'i.'+_0x1fa683[0x0];_0x11c5eb['order'](_0x15ecb3,_0x1fa683[0x1]===_0x301d('0x8a')?![]:!![]);});}if(!_[_0x301d('0x6b')](_0xd0dbd8)){_0x11c5eb['having'](_0x33199c);_0x21c15a['where'](_0x301d('0x8b'),_0xd0dbd8);}BPromise[_0x301d('0x8c')]()[_0x301d('0x26')](function(){if(!_0x4bb5c7){if(_0x25dda6['query']['OpenchannelAccountId'])return;_0x21c15a['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x11c5eb[_0x301d('0x3e')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x25dda6['user'][_0x301d('0x8d')]!==_0x301d('0x8e'))return;return _0x25dda6[_0x301d('0x8f')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x301d('0x26')](function(_0x35cfd5){if(_[_0x301d('0x6b')](_0x35cfd5)){_0x21c15a[_0x301d('0x3e')](_0x301d('0x90'));_0x11c5eb[_0x301d('0x3e')](_0x301d('0x90'));}else{_0x21c15a[_0x301d('0x3e')](_0x301d('0x6e'),_[_0x301d('0x2b')](_0x35cfd5,'id'));_0x11c5eb[_0x301d('0x3e')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x301d('0x2b')](_0x35cfd5,'id'));}});})['then'](function(){if(_0x25dda6[_0x301d('0x8f')][_0x301d('0x8d')]===_0x301d('0x8e')&&!_0x4bb5c7&&!_0x25dda6[_0x301d('0x35')][_0x301d('0x6d')])return[];return db[_0x301d('0x91')][_0x301d('0x35')](_0x21c15a[_0x301d('0x92')](),_0x3f3cba);})['then'](function(_0x4cbe94){_0x2007d3[_0x301d('0x20')]=_0x4cbe94[_0x301d('0x56')];if(_0x2007d3['count']===0x0)return[];return db[_0x301d('0x91')][_0x301d('0x35')](_0xe808cc['toString'](),_0x3f3cba)[_0x301d('0x26')](function(_0x1a29de){_0x3cc249=_[_0x301d('0x93')](_0x1a29de,'id');_0x3f3cba=_[_0x301d('0x94')](_0x3f3cba,{'model':db[_0x301d('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x25dda6['query']['fields']){_0x5ee0fc[_0x301d('0x38')][_0x301d('0x6c')](function(_0x2e7fc7){_0x11c5eb[_0x301d('0x40')]('i.'+_0x2e7fc7);});}else{_0x11c5eb[_0x301d('0x40')](_0x301d('0x89'),_0x301d('0x58'));_0x11c5eb['field'](_0x301d('0x95'),_0x301d('0x96'));_0x11c5eb[_0x301d('0x40')](_0x301d('0x97'),_0x301d('0x98'));_0x11c5eb[_0x301d('0x40')](_0x301d('0x99'),_0x301d('0x9a'));_0x11c5eb[_0x301d('0x40')](_0x301d('0x9b'));_0x11c5eb[_0x301d('0x40')](_0x301d('0x9c'),_0x301d('0x9d'));_0x11c5eb[_0x301d('0x40')](_0x301d('0x9e'),_0x301d('0x9f'));_0x11c5eb[_0x301d('0x40')](_0x301d('0xa0'),'Contact.email');_0x11c5eb[_0x301d('0x40')](_0x301d('0xa1'),'Contact.phone');_0x11c5eb[_0x301d('0x40')]('c.mobile',_0x301d('0xa2'));_0x11c5eb['field'](_0x301d('0xa3'),_0x301d('0xa4'));_0x11c5eb['field']('o.fullname',_0x301d('0xa5'));_0x11c5eb[_0x301d('0x40')](_0x301d('0xa6'),'Owner.internal');_0x11c5eb[_0x301d('0x40')](_0x301d('0xa7'),_0x301d('0x2c'));}if(_0x5ee0fc[_0x301d('0x21')])_0x11c5eb['limit'](_0x5ee0fc[_0x301d('0x21')]);if(_0x5ee0fc[_0x301d('0x1e')])_0x11c5eb[_0x301d('0x1e')](_0x5ee0fc[_0x301d('0x1e')]);return db[_0x301d('0x91')][_0x301d('0x35')](_0x11c5eb['toString'](),_0x3f3cba);})[_0x301d('0x26')](function(_0x3fb2dc){if(_0x3fb2dc['length']>0x0)_0x1cfad7['where'](_0x301d('0xa8'),_[_0x301d('0x2b')](_0x3fb2dc,'id'));return db[_0x301d('0x91')][_0x301d('0x35')](_0x1cfad7[_0x301d('0x92')](),_0x3f3cba)[_0x301d('0x26')](function(_0x5e743b){var _0x5343f3=_[_0x301d('0xa9')](_0x5e743b,_0x301d('0xaa'));var _0x337df8=[];_0x3fb2dc[_0x301d('0x6c')](function(_0x31331b){_0x337df8[_0x301d('0xab')](updateOpenchannelInteraction(_0x31331b,_0x3cc249,_0x5343f3));});return BPromise[_0x301d('0xac')](_0x337df8);});});})[_0x301d('0x26')](function(_0x34bc8a){_0x2007d3[_0x301d('0xad')]=_0x34bc8a;return _0x2007d3;})['then'](respondWithFilteredResult(_0x4f5bff,_0x5ee0fc))[_0x301d('0x2f')](handleError(_0x4f5bff,null));};exports['show']=function(_0x5014cb,_0x2ed551){var _0x3e85b8={};if(_0x5014cb['query'][_0x301d('0x33')]&&_0x5014cb['query'][_0x301d('0x33')]===_0x301d('0x45')){_0x3e85b8[_0x301d('0x45')]=_0x5014cb[_0x301d('0xae')]['id'];}else{_0x3e85b8['id']=_0x5014cb['params']['id'];}var _0x1e68ce={'raw':![],'where':_0x3e85b8},_0x5b37e0={};_0x5b37e0[_0x301d('0x34')]=_[_0x301d('0x36')](db['OpenchannelInteraction'][_0x301d('0x31')]);_0x5b37e0[_0x301d('0x35')]=_[_0x301d('0x36')](_0x5014cb['query']);_0x5b37e0[_0x301d('0x37')]=_['intersection'](_0x5b37e0['model'],_0x5b37e0['query']);_0x1e68ce[_0x301d('0x38')]=_[_0x301d('0x39')](_0x5b37e0[_0x301d('0x34')],qs[_0x301d('0x3a')](_0x5014cb[_0x301d('0x35')][_0x301d('0x3a')]));_0x1e68ce[_0x301d('0x38')]=_0x1e68ce[_0x301d('0x38')][_0x301d('0x56')]?_0x1e68ce[_0x301d('0x38')]:_0x5b37e0['model'];if(_0x5014cb[_0x301d('0x35')][_0x301d('0xaf')]){_0x1e68ce[_0x301d('0xb0')]=[{'all':!![]}];}_0x1e68ce=_[_0x301d('0x94')]({},_0x1e68ce,_0x5014cb[_0x301d('0xb1')]);return db['OpenchannelInteraction'][_0x301d('0x57')](_0x1e68ce)[_0x301d('0x26')](handleEntityNotFound(_0x2ed551,null))[_0x301d('0x26')](respondWithResult(_0x2ed551,null))[_0x301d('0x2f')](handleError(_0x2ed551,null));};exports['create']=function(_0x11b06e,_0x402007){return db[_0x301d('0x30')][_0x301d('0xb2')](_0x11b06e['body'],{})['then'](respondWithResult(_0x402007,0xc9))[_0x301d('0x2f')](handleError(_0x402007,null));};exports[_0x301d('0xb3')]=function(_0x3094ad,_0x4d0fb3){if(_0x3094ad[_0x301d('0x67')]['id']){delete _0x3094ad[_0x301d('0x67')]['id'];}return db[_0x301d('0x30')]['find']({'where':{'id':_0x3094ad[_0x301d('0xae')]['id']}})[_0x301d('0x26')](handleEntityNotFound(_0x4d0fb3,null))[_0x301d('0x26')](saveUpdates(_0x3094ad[_0x301d('0x67')],null))[_0x301d('0x26')](respondWithResult(_0x4d0fb3,null))[_0x301d('0x2f')](handleError(_0x4d0fb3,null));};exports[_0x301d('0xb4')]=function(_0x59e169,_0x1cd4c3){return db[_0x301d('0x30')]['find']({'where':{'id':_0x59e169[_0x301d('0xae')]['id']}})[_0x301d('0x26')](handleEntityNotFound(_0x1cd4c3,null))[_0x301d('0x26')](removeEntity(_0x1cd4c3,null))['catch'](handleError(_0x1cd4c3,null));};exports[_0x301d('0xb5')]=function(_0x464de1,_0x3cccc6){return db[_0x301d('0x30')][_0x301d('0xb5')]()['then'](respondWithResult(_0x3cccc6,null))[_0x301d('0x2f')](handleError(_0x3cccc6,null));};exports[_0x301d('0xb6')]=function(_0x2f22a8,_0x50a9fc,_0x3526b6){return db[_0x301d('0xb7')][_0x301d('0x57')]({'where':{'id':_0x2f22a8[_0x301d('0xae')]['id']}})['then'](handleEntityNotFound(_0x50a9fc,null))[_0x301d('0x26')](function(_0x22baee){if(_0x22baee){return _0x22baee['addMessage'](_0x2f22a8['body']['ids'],_['omit'](_0x2f22a8['body'],[_0x301d('0xb8'),'id'])||{});}})['then'](respondWithResult(_0x50a9fc,null))['catch'](handleError(_0x50a9fc,null));};exports[_0x301d('0xb9')]=function(_0x21f324,_0x1ac41d,_0x2d8fc4){var _0x1c67d7={'raw':![],'where':{}};var _0x1e1275={};var _0x4a38a4={'count':0x0,'rows':[]};return db[_0x301d('0x30')][_0x301d('0xba')]({'where':{'id':_0x21f324['params']['id']}})[_0x301d('0x26')](handleEntityNotFound(_0x1ac41d,null))[_0x301d('0x26')](function(_0x3b5164){if(_0x3b5164){_0x1e1275[_0x301d('0x34')]=_[_0x301d('0x36')](db[_0x301d('0xb7')][_0x301d('0x31')]);_0x1e1275['query']=_[_0x301d('0x36')](_0x21f324[_0x301d('0x35')]);_0x1e1275[_0x301d('0x37')]=_[_0x301d('0x39')](_0x1e1275[_0x301d('0x34')],_0x1e1275[_0x301d('0x35')]);_0x1c67d7[_0x301d('0x38')]=_[_0x301d('0x39')](_0x1e1275[_0x301d('0x34')],qs[_0x301d('0x3a')](_0x21f324[_0x301d('0x35')][_0x301d('0x3a')]));_0x1c67d7[_0x301d('0x38')]=_0x1c67d7[_0x301d('0x38')][_0x301d('0x56')]?_0x1c67d7['attributes']:_0x1e1275[_0x301d('0x34')];if(!_0x21f324[_0x301d('0x35')][_0x301d('0xbb')](_0x301d('0x3b'))){_0x1c67d7[_0x301d('0x21')]=qs['limit'](_0x21f324[_0x301d('0x35')][_0x301d('0x21')]);_0x1c67d7['offset']=qs['offset'](_0x21f324[_0x301d('0x35')][_0x301d('0x1e')]);}_0x1c67d7[_0x301d('0x3c')]=qs[_0x301d('0x3d')](_0x21f324[_0x301d('0x35')][_0x301d('0x3d')]);_0x1c67d7[_0x301d('0x3e')]=qs[_0x301d('0x37')](_['pick'](_0x21f324[_0x301d('0x35')],_0x1e1275['filters']));_0x1c67d7[_0x301d('0x3e')]['OpenchannelInteractionId']=_0x3b5164['id'];if(_0x21f324[_0x301d('0x35')][_0x301d('0x7c')]){_0x1c67d7[_0x301d('0x3e')]=_[_0x301d('0x94')](_0x1c67d7['where'],{'$or':_['map'](_0x1c67d7[_0x301d('0x38')],function(_0x5786a4){var _0x38803d={};_0x38803d[_0x5786a4]={'$like':'%'+_0x21f324[_0x301d('0x35')][_0x301d('0x7c')]+'%'};return _0x38803d;})});}if(_0x21f324[_0x301d('0x35')][_0x301d('0x72')]){var _0x39c214=_0x21f324['query'][_0x301d('0x72')][_0x301d('0x2e')](',');var _0x5cbca6={};_0x5cbca6[_0x39c214[0x0]]={'$gte':moment(_0x39c214[0x1])[_0x301d('0xbc')](_0x301d('0xbd'))};_0x1c67d7[_0x301d('0x3e')]=_['merge'](_0x1c67d7[_0x301d('0x3e')],_0x5cbca6);}_0x1c67d7=_[_0x301d('0x94')]({},_0x1c67d7,_0x21f324['options']);return db[_0x301d('0xb7')]['count']({'where':_0x1c67d7[_0x301d('0x3e')]})[_0x301d('0x26')](function(_0x93e6c){_0x4a38a4['count']=_0x93e6c;if(_0x21f324['query'][_0x301d('0xaf')]){_0x1c67d7['include']=[{'all':!![]}];}return db[_0x301d('0xb7')][_0x301d('0xbe')](_0x1c67d7);})[_0x301d('0x26')](function(_0x5cfc51){_0x4a38a4[_0x301d('0xad')]=_0x5cfc51;return _0x4a38a4;});}})[_0x301d('0x26')](respondWithFilteredResult(_0x1ac41d,_0x1c67d7))['catch'](handleError(_0x1ac41d,null));};exports[_0x301d('0xbf')]=function(_0x3c99c8,_0x58135a,_0x1b8136){return db['OpenchannelInteraction'][_0x301d('0x57')]({'where':{'id':_0x3c99c8[_0x301d('0xae')]['id']}})[_0x301d('0x26')](handleEntityNotFound(_0x58135a,null))[_0x301d('0x26')](function(_0x5a540c){if(_0x5a540c){return _0x5a540c[_0x301d('0xc0')](_0x3c99c8['body'][_0x301d('0xb8')],_[_0x301d('0xc1')](_0x3c99c8[_0x301d('0x67')],['ids','id'])||{})[_0x301d('0xc2')](function(){return db['Tag'][_0x301d('0xbe')]({'attributes':['id',_0x301d('0x28'),_0x301d('0xc3')],'where':{'id':_0x3c99c8[_0x301d('0x67')][_0x301d('0xb8')]}});})[_0x301d('0x26')](function(_0x545daf){socket['emit'](_0x301d('0xc4'),{'id':Number(_0x3c99c8['params']['id']),'tags':_0x545daf||[]});return{'id':Number(_0x3c99c8['params']['id']),'tags':_0x545daf||[]};});}})[_0x301d('0x26')](respondWithResult(_0x58135a,null))[_0x301d('0x2f')](handleError(_0x58135a,null));};exports[_0x301d('0xc5')]=function(_0x2730dd,_0x4fbce1,_0x2acf69){return db['OpenchannelInteraction'][_0x301d('0x57')]({'where':{'id':_0x2730dd['params']['id']}})[_0x301d('0x26')](handleEntityNotFound(_0x4fbce1,null))['then'](function(_0x4ac562){if(_0x4ac562){return _0x4ac562[_0x301d('0xc5')](_0x2730dd[_0x301d('0x35')][_0x301d('0xb8')]);}})[_0x301d('0x26')](respondWithStatusCode(_0x4fbce1,null))[_0x301d('0x2f')](handleError(_0x4fbce1,null));};exports[_0x301d('0xc6')]=function(_0x49e13c,_0x253b48){var _0x131518=moment()[_0x301d('0xc7')]()['toString']();var _0x37812e=path[_0x301d('0xc8')](config[_0x301d('0xc9')],_0x301d('0xca'),_0x301d('0xcb'),_0x301d('0xcc'));var _0x3a15fa=path[_0x301d('0xc8')](config['root'],'server','files',_0x301d('0xcd'));var _0x8b4ddb=path['join'](_0x37812e,_0x131518);var _0x1de70a=util['format'](_0x301d('0xce'),_0x49e13c['params']['id'],_0x131518);var _0xed8f60=path[_0x301d('0xc8')](_0x37812e,_0x1de70a);var _0x370b4d=[];_0x370b4d[_0x301d('0xab')]({'model':db[_0x301d('0x64')],'as':_0x301d('0x64'),'attributes':['id',_0x301d('0xcf')],'raw':!![]});_0x370b4d[_0x301d('0xab')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0x301d('0xd0')],'raw':!![]});if(_0x49e13c[_0x301d('0x35')]['attachments']){_0x370b4d[_0x301d('0xab')]({'model':db[_0x301d('0xd1')],'as':_0x301d('0xd1'),'raw':!![]});}var _0x56a984=[{'model':db[_0x301d('0xb7')],'as':_0x301d('0xd2'),'attributes':['id','body',_0x301d('0x70'),_0x301d('0xd3'),_0x301d('0xd4'),'read'],'include':_0x370b4d}];_0x56a984[_0x301d('0xab')]({'model':db[_0x301d('0xd5')],'as':_0x301d('0xd6'),'attributes':['id',_0x301d('0x28')]});_0x56a984['push']({'model':db[_0x301d('0x64')],'as':_0x301d('0xd7'),'attributes':['id',_0x301d('0xcf')]});return db[_0x301d('0x30')][_0x301d('0x57')]({'where':{'id':_0x49e13c[_0x301d('0xae')]['id']},'include':_0x56a984})[_0x301d('0x26')](handleEntityNotFound(_0x253b48,null))['then'](function(_0x50daf4){if(_0x50daf4){var _0x20f05d=_0x50daf4[_0x301d('0xd8')]({'plain':!![]});fs[_0x301d('0xd9')](_0x8b4ddb);var _0x4750eb={'channel':'Openchannel','account':_0x20f05d[_0x301d('0xd6')]['name'],'agent':_0x20f05d['Owner']?_0x20f05d[_0x301d('0xd7')][_0x301d('0xcf')]:_0x301d('0xda'),'createdAt':moment(_0x20f05d[_0x301d('0x70')])['format'](_0x301d('0xbd'))[_0x301d('0x92')](),'closedAt':_0x20f05d['closed']?moment(_0x20f05d[_0x301d('0xdb')])[_0x301d('0xbc')](_0x301d('0xbd'))['toString']():'','disposition':_0x20f05d[_0x301d('0xdc')],'visibility':_0x20f05d[_0x301d('0xdd')]?'Public':_0x301d('0xde'),'messages':_(_0x20f05d['Messages'])[_0x301d('0x7c')]({'secret':![]})[_0x301d('0x2b')](function(_0x23699b){if(_0x23699b['Attachment']){var _0x38db18=path[_0x301d('0xc8')](_0x3a15fa,_0x23699b['Attachment'][_0x301d('0xdf')]);if(fs[_0x301d('0xe0')](_0x38db18)){fs['createReadStream'](_0x38db18)[_0x301d('0xe1')](fs[_0x301d('0xe2')](path[_0x301d('0xc8')](_0x8b4ddb,_0x23699b['Attachment']['basename'])));}}return{'date':moment(_0x23699b[_0x301d('0x70')])[_0x301d('0xbc')](_0x301d('0xbd'))['toString'](),'sender':_0x23699b['direction']===_0x301d('0xe3')?_0x23699b[_0x301d('0x64')]?_0x23699b[_0x301d('0x64')][_0x301d('0xcf')]:_0x301d('0xe4'):_0x23699b[_0x301d('0x5c')]['firstName']+(_0x23699b[_0x301d('0x5c')][_0x301d('0xd0')]?'\x20'+_0x23699b[_0x301d('0x5c')][_0x301d('0xd0')]:''),'body':_0x23699b['Attachment']?_0x23699b[_0x301d('0xd1')][_0x301d('0xdf')]:_0x23699b['body'],'direction':_0x23699b[_0x301d('0xd3')]===_0x301d('0xe3')?'A':'C','secret':_0x23699b[_0x301d('0xd4')],'read':_0x23699b['read'],'attachment':_0x23699b[_0x301d('0xd1')]};})['value']()};return ejs[_0x301d('0xe5')](path['join'](config[_0x301d('0xc9')],'server',_0x301d('0xe6'),_0x301d('0xe7')),{'interaction':_0x4750eb})[_0x301d('0x26')](function(_0x42fb01){var _0x38eea3=path[_0x301d('0xc8')](_0x8b4ddb,_0x301d('0xe8')+_0x20f05d['id']+'-'+_0x131518+_0x301d('0xe9'));var _0x1e41e3={'path':_0x38eea3,'channel':'Openchannel','interactionId':_0x20f05d['id']};return pdf[_0x301d('0xea')](_0x42fb01,_0x1e41e3);})[_0x301d('0x26')](function(){return new BPromise(function(_0x5c335c,_0x2ed5fb){zipdir(_0x8b4ddb,{'saveTo':_0xed8f60},function(_0x409518,_0x48e15a){if(_0x409518)return _0x2ed5fb(_0x409518);return _0x5c335c(_0x48e15a);});})[_0x301d('0x26')](function(){return new BPromise(function(_0xc63a6a,_0x534e13){rimraf(_0x8b4ddb,function(_0x3672e8){if(_0x3672e8)_0x534e13(_0x3672e8);return _0xc63a6a();});});})[_0x301d('0x26')](function(){return _0x253b48['download'](_0xed8f60,_0x1de70a,function(_0x5d211e){if(_0x5d211e){console[_0x301d('0xeb')](_0x301d('0xec'),_0x5d211e);}else{fs[_0x301d('0xed')](_0xed8f60);}});});});}else{return _0x253b48[_0x301d('0x1a')](0xc8);}})[_0x301d('0x2f')](handleError(_0x253b48,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 786ca59..3ea1f87 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 _0x0851=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events'];(function(_0x1a3a92,_0x448ebd){var _0xeaea35=function(_0x52ea34){while(--_0x52ea34){_0x1a3a92['push'](_0x1a3a92['shift']());}};_0xeaea35(++_0x448ebd);}(_0x0851,0x1bf));var _0x1085=function(_0x34520d,_0x31419e){_0x34520d=_0x34520d-0x0;var _0x8b8eb=_0x0851[_0x34520d];return _0x8b8eb;};'use strict';var EventEmitter=require(_0x1085('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x1085('0x1'))['db'][_0x1085('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1085('0x3')](0x0);var events={'afterCreate':_0x1085('0x4'),'afterUpdate':'update','afterDestroy':_0x1085('0x5')};function emitEvent(_0x1b9d03){return function(_0x58a448,_0x5b355d,_0xbaecb7){_0x58a448[_0x1085('0x6')]({'attributes':['id'],'raw':!![]})[_0x1085('0x7')](function(_0x149f81){_0x58a448[_0x1085('0x8')]('Users',_0x149f81[_0x1085('0x9')](function(_0x5114ba){return{'id':_0x5114ba['id']};}));return OpenchannelMessage[_0x1085('0xa')]({'where':{'OpenchannelInteractionId':_0x58a448['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1085('0x7')](function(_0x42be2e){_0x58a448[_0x1085('0x8')](_0x1085('0xb'),_0x42be2e['length']);OpenchannelInteractionEvents['emit'](_0x1b9d03+':'+_0x58a448['id'],_0x58a448);OpenchannelInteractionEvents[_0x1085('0xc')](_0x1b9d03,_0x58a448);_0xbaecb7(null);})[_0x1085('0xd')](_0xbaecb7(null));};}for(var e in events){if(events[_0x1085('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x1085('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x672a=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x672a,0xb5));var _0xa672=function(_0x1c90bd,_0x48dedc){_0x1c90bd=_0x1c90bd-0x0;var _0x36327e=_0x672a[_0x1c90bd];return _0x36327e;};'use strict';var EventEmitter=require(_0xa672('0x0'));var OpenchannelInteraction=require(_0xa672('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0xa672('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xa672('0x3')](0x0);var events={'afterCreate':_0xa672('0x4'),'afterUpdate':_0xa672('0x5'),'afterDestroy':_0xa672('0x6')};function emitEvent(_0x2532d4){return function(_0x538e2b,_0x29f0e3,_0x1e46bb){_0x538e2b[_0xa672('0x7')]({'attributes':['id'],'raw':!![]})[_0xa672('0x8')](function(_0x455bcb){_0x538e2b[_0xa672('0x9')]('Users',_0x455bcb[_0xa672('0xa')](function(_0x6b3f4){return{'id':_0x6b3f4['id']};}));return OpenchannelMessage[_0xa672('0xb')]({'where':{'OpenchannelInteractionId':_0x538e2b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa672('0x8')](function(_0x426c76){_0x538e2b[_0xa672('0x9')](_0xa672('0xc'),_0x426c76[_0xa672('0xd')]);OpenchannelInteractionEvents[_0xa672('0xe')](_0x2532d4+':'+_0x538e2b['id'],_0x538e2b);OpenchannelInteractionEvents[_0xa672('0xe')](_0x2532d4,_0x538e2b);_0x1e46bb(null);})['catch'](_0x1e46bb(null));};}for(var e in events){if(events[_0xa672('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xa672('0x10')](e,emitEvent(event));}}module[_0xa672('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 7381171..86653f9 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 _0x8b52=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','closed','closedAt'];(function(_0x559dbf,_0x249d39){var _0x578eb7=function(_0x18389e){while(--_0x18389e){_0x559dbf['push'](_0x559dbf['shift']());}};_0x578eb7(++_0x249d39);}(_0x8b52,0x151));var _0x28b5=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8b52[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var logger=require(_0x28b5('0x2'))('api');var moment=require(_0x28b5('0x3'));var BPromise=require(_0x28b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28b5('0x5'));var rimraf=require(_0x28b5('0x6'));var config=require(_0x28b5('0x7'));var attributes=require(_0x28b5('0x8'));module[_0x28b5('0x9')]=function(_0x17c21a,_0x42573d){return _0x17c21a[_0x28b5('0xa')](_0x28b5('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x28b5('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4ff1ab,_0x323caa,_0x293876){if(_0x4ff1ab['changed'](_0x28b5('0xd'))){_0x4ff1ab[_0x28b5('0xe')]=moment()['format'](_0x28b5('0xf'));}_0x293876(null,_0x4ff1ab);}}});}; \ No newline at end of file +var _0xf7c7=['rimraf','../../config/environment','./openchannelInteraction.attributes','exports','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x57fe5b,_0x331519){var _0x571731=function(_0x9ccd08){while(--_0x9ccd08){_0x57fe5b['push'](_0x57fe5b['shift']());}};_0x571731(++_0x331519);}(_0xf7c7,0x1d3));var _0x7f7c=function(_0x2236af,_0x50ab11){_0x2236af=_0x2236af-0x0;var _0x10942c=_0xf7c7[_0x2236af];return _0x10942c;};'use strict';var _=require(_0x7f7c('0x0'));var util=require(_0x7f7c('0x1'));var logger=require(_0x7f7c('0x2'))(_0x7f7c('0x3'));var moment=require(_0x7f7c('0x4'));var BPromise=require(_0x7f7c('0x5'));var rp=require(_0x7f7c('0x6'));var fs=require('fs');var path=require(_0x7f7c('0x7'));var rimraf=require(_0x7f7c('0x8'));var config=require(_0x7f7c('0x9'));var attributes=require(_0x7f7c('0xa'));module[_0x7f7c('0xb')]=function(_0x4e682f,_0x488e06){return _0x4e682f['define']('OpenchannelInteraction',attributes,{'tableName':_0x7f7c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f7c('0xd'),'collate':_0x7f7c('0xe'),'hooks':{'beforeUpdate':function(_0x449e36,_0x11224c,_0x14b626){if(_0x449e36[_0x7f7c('0xf')]('closed')){_0x449e36[_0x7f7c('0x10')]=moment()[_0x7f7c('0x11')](_0x7f7c('0x12'));}_0x14b626(null,_0x449e36);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index ede88c6..3908e5d 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 _0xd2cd=['register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','attributes','limit','stringify','AddTagsToOpenchannelInteraction','find','where','addTags','body','ids','spread','AddTags','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','./openchannelInteraction.socket'];(function(_0x5a1322,_0x566c20){var _0x15080f=function(_0x532edd){while(--_0x532edd){_0x5a1322['push'](_0x5a1322['shift']());}};_0x15080f(++_0x566c20);}(_0xd2cd,0x1a2));var _0xdd2c=function(_0x434db2,_0x113541){_0x434db2=_0x434db2-0x0;var _0x4e9284=_0xd2cd[_0x434db2];return _0x4e9284;};'use strict';var _=require(_0xdd2c('0x0'));var util=require('util');var moment=require(_0xdd2c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd2c('0x3'));var logger=require(_0xdd2c('0x4'))(_0xdd2c('0x5'));var config=require(_0xdd2c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdd2c('0x7')]['http']({'port':0x232a});config[_0xdd2c('0x8')]=_[_0xdd2c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd2c('0x8')]));require(_0xdd2c('0xa'))[_0xdd2c('0xb')](socket);function respondWithRpcPromise(_0x148a38,_0x186a90,_0x238e86){return new BPromise(function(_0x29f00c,_0x346be9){return client[_0xdd2c('0xc')](_0x148a38,_0x238e86)[_0xdd2c('0xd')](function(_0x1ebc4f){logger[_0xdd2c('0xe')](_0xdd2c('0xf'),_0x186a90,'request\x20sent');logger[_0xdd2c('0x10')](_0xdd2c('0x11'),_0x186a90,'request\x20sent',JSON['stringify'](_0x1ebc4f));if(_0x1ebc4f['error']){if(_0x1ebc4f[_0xdd2c('0x12')][_0xdd2c('0x13')]===0x1f4){logger[_0xdd2c('0x12')](_0xdd2c('0xf'),_0x186a90,_0x1ebc4f['error'][_0xdd2c('0x14')]);return _0x346be9(_0x1ebc4f[_0xdd2c('0x12')][_0xdd2c('0x14')]);}logger[_0xdd2c('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x186a90,_0x1ebc4f[_0xdd2c('0x12')][_0xdd2c('0x14')]);return _0x29f00c(_0x1ebc4f['error'][_0xdd2c('0x14')]);}else{logger['info'](_0xdd2c('0xf'),_0x186a90,_0xdd2c('0x15'));_0x29f00c(_0x1ebc4f[_0xdd2c('0x16')][_0xdd2c('0x14')]);}})[_0xdd2c('0x17')](function(_0x14cf42){logger['error'](_0xdd2c('0xf'),_0x186a90,_0x14cf42);_0x346be9(_0x14cf42);});});}exports[_0xdd2c('0x18')]=function(_0xabcd24){var _0x49cbb6=this;return new Promise(function(_0x3e3703,_0x12a909){return db[_0xdd2c('0x19')]['update'](_0xabcd24['body'],{'raw':_0xabcd24[_0xdd2c('0x1a')]?_0xabcd24[_0xdd2c('0x1a')][_0xdd2c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xabcd24[_0xdd2c('0x1a')]?_0xabcd24[_0xdd2c('0x1a')]['where']||null:null,'attributes':_0xabcd24[_0xdd2c('0x1a')]?_0xabcd24[_0xdd2c('0x1a')][_0xdd2c('0x1c')]||null:null,'limit':_0xabcd24[_0xdd2c('0x1a')]?_0xabcd24[_0xdd2c('0x1a')][_0xdd2c('0x1d')]||null:null})['then'](function(_0x33a952){logger[_0xdd2c('0xe')]('UpdateOpenchannelInteraction',_0xabcd24);logger[_0xdd2c('0x10')](_0xdd2c('0x18'),_0xabcd24,JSON[_0xdd2c('0x1e')](_0x33a952));_0x3e3703(_0x33a952);})[_0xdd2c('0x17')](function(_0x4d6d9d){logger[_0xdd2c('0x12')](_0xdd2c('0x18'),_0x4d6d9d[_0xdd2c('0x14')],_0xabcd24);_0x12a909(_0x49cbb6[_0xdd2c('0x12')](0x1f4,_0x4d6d9d['message']));});});};exports[_0xdd2c('0x1f')]=function(_0x289e1f){return new Promise(function(_0x110b5e,_0xccdded){return db[_0xdd2c('0x19')][_0xdd2c('0x20')]({'where':_0x289e1f[_0xdd2c('0x1a')]?_0x289e1f[_0xdd2c('0x1a')][_0xdd2c('0x21')]||null:null})[_0xdd2c('0xd')](function(_0x5ec602){if(_0x5ec602){return _0x5ec602[_0xdd2c('0x22')](_0x289e1f[_0xdd2c('0x23')][_0xdd2c('0x24')],_['omit'](_0x289e1f[_0xdd2c('0x23')],['ids','id'])||{});}})[_0xdd2c('0x25')](function(_0x303453){logger[_0xdd2c('0xe')](_0xdd2c('0x26'),_0x289e1f);logger[_0xdd2c('0x10')](_0xdd2c('0x26'),_0x289e1f,JSON[_0xdd2c('0x1e')](_0x303453));_0x110b5e(_0x303453);})[_0xdd2c('0x17')](function(_0x3ec68e){logger[_0xdd2c('0x12')](_0xdd2c('0x26'),_0x3ec68e[_0xdd2c('0x14')],_0x289e1f);_0xccdded(_this[_0xdd2c('0x12')](0x1f4,_0x3ec68e[_0xdd2c('0x14')]));});});}; \ No newline at end of file +var _0x1ccd=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','addTags','omit','ids','AddTags','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ccd,0x124));var _0xd1cc=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x1ccd[_0x35fb56];return _0x2fd52c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd1cc('0x0'));var BPromise=require(_0xd1cc('0x1'));var rs=require(_0xd1cc('0x2'));var fs=require('fs');var Redis=require(_0xd1cc('0x3'));var db=require(_0xd1cc('0x4'))['db'];var utils=require(_0xd1cc('0x5'));var logger=require(_0xd1cc('0x6'))(_0xd1cc('0x7'));var config=require(_0xd1cc('0x8'));var jayson=require(_0xd1cc('0x9'));var client=jayson['client'][_0xd1cc('0xa')]({'port':0x232a});config[_0xd1cc('0xb')]=_[_0xd1cc('0xc')](config[_0xd1cc('0xb')],{'host':_0xd1cc('0xd'),'port':0x18eb});var socket=require(_0xd1cc('0xe'))(new Redis(config[_0xd1cc('0xb')]));require(_0xd1cc('0xf'))[_0xd1cc('0x10')](socket);function respondWithRpcPromise(_0x110475,_0xa18c6,_0x2713e4){return new BPromise(function(_0x2d126d,_0x55ecd3){return client[_0xd1cc('0x11')](_0x110475,_0x2713e4)[_0xd1cc('0x12')](function(_0x472e9f){logger[_0xd1cc('0x13')](_0xd1cc('0x14'),_0xa18c6,_0xd1cc('0x15'));logger[_0xd1cc('0x16')](_0xd1cc('0x17'),_0xa18c6,_0xd1cc('0x15'),JSON[_0xd1cc('0x18')](_0x472e9f));if(_0x472e9f[_0xd1cc('0x19')]){if(_0x472e9f['error'][_0xd1cc('0x1a')]===0x1f4){logger['error'](_0xd1cc('0x14'),_0xa18c6,_0x472e9f['error'][_0xd1cc('0x1b')]);return _0x55ecd3(_0x472e9f[_0xd1cc('0x19')]['message']);}logger['error'](_0xd1cc('0x14'),_0xa18c6,_0x472e9f[_0xd1cc('0x19')][_0xd1cc('0x1b')]);return _0x2d126d(_0x472e9f[_0xd1cc('0x19')]['message']);}else{logger[_0xd1cc('0x13')](_0xd1cc('0x14'),_0xa18c6,_0xd1cc('0x15'));_0x2d126d(_0x472e9f['result'][_0xd1cc('0x1b')]);}})[_0xd1cc('0x1c')](function(_0x3be5fb){logger['error'](_0xd1cc('0x14'),_0xa18c6,_0x3be5fb);_0x55ecd3(_0x3be5fb);});});}exports['UpdateOpenchannelInteraction']=function(_0x33581e){var _0x28d171=this;return new Promise(function(_0x5a9a8b,_0x1f71e6){return db[_0xd1cc('0x1d')][_0xd1cc('0x1e')](_0x33581e[_0xd1cc('0x1f')],{'raw':_0x33581e['options']?_0x33581e[_0xd1cc('0x20')][_0xd1cc('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33581e[_0xd1cc('0x20')]?_0x33581e[_0xd1cc('0x20')][_0xd1cc('0x22')]||null:null,'attributes':_0x33581e[_0xd1cc('0x20')]?_0x33581e['options'][_0xd1cc('0x23')]||null:null,'limit':_0x33581e[_0xd1cc('0x20')]?_0x33581e[_0xd1cc('0x20')][_0xd1cc('0x24')]||null:null})['then'](function(_0x362d8b){logger[_0xd1cc('0x13')]('UpdateOpenchannelInteraction',_0x33581e);logger[_0xd1cc('0x16')](_0xd1cc('0x25'),_0x33581e,JSON[_0xd1cc('0x18')](_0x362d8b));_0x5a9a8b(_0x362d8b);})[_0xd1cc('0x1c')](function(_0x51ff40){logger['error'](_0xd1cc('0x25'),_0x51ff40['message'],_0x33581e);_0x1f71e6(_0x28d171['error'](0x1f4,_0x51ff40[_0xd1cc('0x1b')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x272be2){return new Promise(function(_0x103123,_0x3bda8e){return db[_0xd1cc('0x1d')]['find']({'where':_0x272be2[_0xd1cc('0x20')]?_0x272be2[_0xd1cc('0x20')][_0xd1cc('0x22')]||null:null})[_0xd1cc('0x12')](function(_0xa4ea){if(_0xa4ea){return _0xa4ea[_0xd1cc('0x26')](_0x272be2[_0xd1cc('0x1f')]['ids'],_[_0xd1cc('0x27')](_0x272be2[_0xd1cc('0x1f')],[_0xd1cc('0x28'),'id'])||{});}})['spread'](function(_0x3b4912){logger[_0xd1cc('0x13')](_0xd1cc('0x29'),_0x272be2);logger[_0xd1cc('0x16')](_0xd1cc('0x29'),_0x272be2,JSON[_0xd1cc('0x18')](_0x3b4912));_0x103123(_0x3b4912);})[_0xd1cc('0x1c')](function(_0x11bda2){logger[_0xd1cc('0x19')]('AddTags',_0x11bda2[_0xd1cc('0x1b')],_0x272be2);_0x3bda8e(_this['error'](0x1f4,_0x11bda2[_0xd1cc('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0f51a42..ca43d48 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 _0xc075=['register','./openchannelInteraction.events','update','removeListener'];(function(_0x3a82d,_0x350a16){var _0x2282fc=function(_0x48e36e){while(--_0x48e36e){_0x3a82d['push'](_0x3a82d['shift']());}};_0x2282fc(++_0x350a16);}(_0xc075,0x155));var _0x5c07=function(_0x1fc2a2,_0x3ab698){_0x1fc2a2=_0x1fc2a2-0x0;var _0x54c0b8=_0xc075[_0x1fc2a2];return _0x54c0b8;};'use strict';var OpenchannelInteractionEvents=require(_0x5c07('0x0'));var events=['save','remove',_0x5c07('0x1')];function createListener(_0x588a7f,_0x387b2d){return function(_0x2e0f1b){_0x387b2d['emit'](_0x588a7f,_0x2e0f1b);};}function removeListener(_0x5c1cf0,_0x217fd4){return function(){OpenchannelInteractionEvents[_0x5c07('0x2')](_0x5c1cf0,_0x217fd4);};}exports[_0x5c07('0x3')]=function(_0x4e4fcd){for(var _0x1f6e42=0x0,_0x14d736=events['length'];_0x1f6e42<_0x14d736;_0x1f6e42++){var _0x2720d2=events[_0x1f6e42];var _0x492a69=createListener('openchannelInteraction:'+_0x2720d2,_0x4e4fcd);OpenchannelInteractionEvents['on'](_0x2720d2,_0x492a69);}}; \ No newline at end of file +var _0xa0fc=['./openchannelInteraction.events','remove','emit','length','openchannelInteraction:'];(function(_0x13250a,_0x353858){var _0x25b0bf=function(_0x3af994){while(--_0x3af994){_0x13250a['push'](_0x13250a['shift']());}};_0x25b0bf(++_0x353858);}(_0xa0fc,0x13b));var _0xca0f=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa0fc[_0x5c351c];return _0x26f3b3;};'use strict';var OpenchannelInteractionEvents=require(_0xca0f('0x0'));var events=['save',_0xca0f('0x1'),'update'];function createListener(_0x50bbed,_0x2ccca2){return function(_0x59c3fe){_0x2ccca2[_0xca0f('0x2')](_0x50bbed,_0x59c3fe);};}function removeListener(_0x1f4d4a,_0x457da1){return function(){OpenchannelInteractionEvents['removeListener'](_0x1f4d4a,_0x457da1);};}exports['register']=function(_0x3c70e6){for(var _0x1cad3a=0x0,_0x128c29=events[_0xca0f('0x3')];_0x1cad3a<_0x128c29;_0x1cad3a++){var _0x1468cd=events[_0x1cad3a];var _0x188fca=createListener(_0xca0f('0x4')+_0x1468cd,_0x3c70e6);OpenchannelInteractionEvents['on'](_0x1468cd,_0x188fca);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index fa92d02..5890d1c 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0xe706,0xa3));var _0x6e70=function(_0x409d51,_0x1f0de6){_0x409d51=_0x409d51-0x0;var _0x13eb4b=_0xe706[_0x409d51];return _0x13eb4b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index e802eee..ed77690 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 _0x94d2=['medium','BOOLEAN','ENUM','DATE','STRING','TEXT'];(function(_0x16ecad,_0x205047){var _0x313ff7=function(_0x58b16a){while(--_0x58b16a){_0x16ecad['push'](_0x16ecad['shift']());}};_0x313ff7(++_0x205047);}(_0x94d2,0x1cd));var _0x294d=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x94d2[_0x2cc569];return _0x1bfc2e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x294d('0x0')](_0x294d('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x294d('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x294d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x294d('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x294d('0x4')]},'providerName':{'type':Sequelize[_0x294d('0x5')]},'providerResponse':{'type':Sequelize[_0x294d('0x0')]}}; \ No newline at end of file +var _0xc692=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x145866,_0x2ec598){var _0x3858c8=function(_0x2868c7){while(--_0x2868c7){_0x145866['push'](_0x145866['shift']());}};_0x3858c8(++_0x2ec598);}(_0xc692,0x15f));var _0x2c69=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xc692[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x2c69('0x0'));module[_0x2c69('0x1')]={'body':{'type':Sequelize[_0x2c69('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2c69('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2c69('0x4')]('in',_0x2c69('0x5')),'defaultValue':_0x2c69('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2c69('0x6')]},'providerName':{'type':Sequelize[_0x2c69('0x7')]},'providerResponse':{'type':Sequelize[_0x2c69('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index ed27447..d925956 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 _0xf577=['EventManager','acceptmessage','openchannel-interactions','openchannel','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','email','motionChannel','event','rejectmessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','hasOwnProperty','order','sort','pick','merge','VIRTUAL','options','where','includeAll','rows','keys','fields','length','find','create','body','params','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel'];(function(_0x531809,_0x44d228){var _0x5a31ce=function(_0x43f899){while(--_0x43f899){_0x531809['push'](_0x531809['shift']());}};_0x5a31ce(++_0x44d228);}(_0xf577,0x8f));var _0x7f57=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xf577[_0x4c445a];return _0x2f611c;};'use strict';var emlformat=require(_0x7f57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f57('0x1'));var jsonpatch=require(_0x7f57('0x2'));var rp=require('request-promise');var moment=require(_0x7f57('0x3'));var BPromise=require(_0x7f57('0x4'));var Mustache=require(_0x7f57('0x5'));var util=require('util');var path=require(_0x7f57('0x6'));var sox=require(_0x7f57('0x7'));var csv=require('to-csv');var ejs=require(_0x7f57('0x8'));var fs=require('fs');var fs_extra=require(_0x7f57('0x9'));var _=require(_0x7f57('0xa'));var squel=require('squel');var crypto=require(_0x7f57('0xb'));var jsforce=require(_0x7f57('0xc'));var deskjs=require(_0x7f57('0xd'));var toCsv=require(_0x7f57('0xe'));var querystring=require(_0x7f57('0xf'));var Papa=require(_0x7f57('0x10'));var Redis=require('ioredis');var authService=require(_0x7f57('0x11'));var qs=require(_0x7f57('0x12'));var as=require(_0x7f57('0x13'));var hardwareService=require(_0x7f57('0x14'));var logger=require(_0x7f57('0x15'))(_0x7f57('0x16'));var utils=require(_0x7f57('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7f57('0x18'));var db=require(_0x7f57('0x19'))['db'];config[_0x7f57('0x1a')]=_[_0x7f57('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7f57('0x1c'))(new Redis(config[_0x7f57('0x1a')]));require(_0x7f57('0x1d'))[_0x7f57('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7f57('0x1f')][_0x7f57('0x20')]({'port':0x232c});var client9002=jayson[_0x7f57('0x1f')][_0x7f57('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1a0740,_0x5deb58,_0xbe7f46,_0x5d1562){return new BPromise(function(_0x29e21f,_0x476a8f){var _0xff7613=_0x5d1562||client;return _0xff7613[_0x7f57('0x21')](_0x1a0740,_0xbe7f46)[_0x7f57('0x22')](function(_0x2b6c03){logger[_0x7f57('0x23')](_0x7f57('0x24'),_0x5deb58,'request\x20sent');logger[_0x7f57('0x25')](_0x7f57('0x26'),_0x5deb58,_0x7f57('0x27'),JSON[_0x7f57('0x28')](_0x2b6c03));if(_0x2b6c03['error']){if(_0x2b6c03[_0x7f57('0x29')][_0x7f57('0x2a')]===0x1f4){logger[_0x7f57('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x5deb58,_0x2b6c03[_0x7f57('0x29')]['message']);return _0x476a8f(_0x2b6c03['error'][_0x7f57('0x2b')]);}logger[_0x7f57('0x29')](_0x7f57('0x24'),_0x5deb58,_0x2b6c03['error'][_0x7f57('0x2b')]);return _0x29e21f(_0x2b6c03[_0x7f57('0x29')]['message']);}else{logger[_0x7f57('0x23')](_0x7f57('0x24'),_0x5deb58,_0x7f57('0x27'));_0x29e21f(_0x2b6c03[_0x7f57('0x2c')]['message']);}})[_0x7f57('0x2d')](function(_0x21a604){logger[_0x7f57('0x29')](_0x7f57('0x24'),_0x5deb58,_0x21a604);_0x476a8f(_0x21a604);});});}function respondWithStatusCode(_0x138e69,_0x50a11b){_0x50a11b=_0x50a11b||0xcc;return function(_0x13322a){if(_0x13322a){return _0x138e69[_0x7f57('0x2e')](_0x50a11b);}return _0x138e69[_0x7f57('0x2f')](_0x50a11b)[_0x7f57('0x30')]();};}function respondWithResult(_0x8e7584,_0x406979){_0x406979=_0x406979||0xc8;return function(_0x178aec){if(_0x178aec){return _0x8e7584[_0x7f57('0x2f')](_0x406979)[_0x7f57('0x31')](_0x178aec);}};}function respondWithFilteredResult(_0xeb9aa3,_0x1c23bf){return function(_0x1c022d){if(_0x1c022d){var _0x1eedf7=typeof _0x1c23bf['offset']===_0x7f57('0x32')&&typeof _0x1c23bf[_0x7f57('0x33')]===_0x7f57('0x32');var _0x16f4a9=_0x1c022d[_0x7f57('0x34')];var _0x5a3037=_0x1eedf7?0x0:_0x1c23bf[_0x7f57('0x35')];var _0x57676a=_0x1eedf7?_0x1c022d[_0x7f57('0x34')]:_0x1c23bf[_0x7f57('0x35')]+_0x1c23bf[_0x7f57('0x33')];var _0x3b3a0a;if(_0x57676a>=_0x16f4a9){_0x57676a=_0x16f4a9;_0x3b3a0a=0xc8;}else{_0x3b3a0a=0xce;}_0xeb9aa3[_0x7f57('0x2f')](_0x3b3a0a);return _0xeb9aa3[_0x7f57('0x36')](_0x7f57('0x37'),_0x5a3037+'-'+_0x57676a+'/'+_0x16f4a9)[_0x7f57('0x31')](_0x1c022d);}return null;};}function patchUpdates(_0x4f8ba6){return function(_0x52e56c){try{jsonpatch[_0x7f57('0x38')](_0x52e56c,_0x4f8ba6,!![]);}catch(_0xc49bae){return BPromise[_0x7f57('0x39')](_0xc49bae);}return _0x52e56c[_0x7f57('0x3a')]();};}function saveUpdates(_0xafd923,_0x302910){return function(_0x4280a4){if(_0x4280a4){return _0x4280a4[_0x7f57('0x3b')](_0xafd923)[_0x7f57('0x22')](function(_0x1b9bb0){return _0x1b9bb0;});}return null;};}function removeEntity(_0x2700dc,_0x552709){return function(_0x571fea){if(_0x571fea){return _0x571fea[_0x7f57('0x3c')]()['then'](function(){_0x2700dc[_0x7f57('0x2f')](0xcc)[_0x7f57('0x30')]();});}};}function handleEntityNotFound(_0x127c0c,_0x199743){return function(_0x50d3b7){if(!_0x50d3b7){_0x127c0c[_0x7f57('0x2e')](0x194);}return _0x50d3b7;};}function handleError(_0x1343e7,_0x5b2bdc){_0x5b2bdc=_0x5b2bdc||0x1f4;return function(_0x2cd979){logger['error'](_0x2cd979[_0x7f57('0x3d')]);if(_0x2cd979[_0x7f57('0x3e')]){delete _0x2cd979[_0x7f57('0x3e')];}_0x1343e7[_0x7f57('0x2f')](_0x5b2bdc)[_0x7f57('0x3f')](_0x2cd979);};}exports[_0x7f57('0x40')]=function(_0x5dcc9e,_0x3b6d6b){var _0xb1f6fe={},_0x544055={},_0x577217={'count':0x0,'rows':[]};var _0x54413d=_[_0x7f57('0x41')](db[_0x7f57('0x42')][_0x7f57('0x43')],function(_0x27f985){return{'name':_0x27f985['fieldName'],'type':_0x27f985[_0x7f57('0x44')][_0x7f57('0x45')]};});_0x544055[_0x7f57('0x46')]=_[_0x7f57('0x41')](_0x54413d,_0x7f57('0x3e'));_0x544055['query']=_['keys'](_0x5dcc9e[_0x7f57('0x47')]);_0x544055[_0x7f57('0x48')]=_[_0x7f57('0x49')](_0x544055['model'],_0x544055[_0x7f57('0x47')]);_0xb1f6fe[_0x7f57('0x4a')]=_[_0x7f57('0x49')](_0x544055['model'],qs['fields'](_0x5dcc9e[_0x7f57('0x47')]['fields']));_0xb1f6fe[_0x7f57('0x4a')]=_0xb1f6fe[_0x7f57('0x4a')]['length']?_0xb1f6fe[_0x7f57('0x4a')]:_0x544055[_0x7f57('0x46')];if(!_0x5dcc9e[_0x7f57('0x47')][_0x7f57('0x4b')]('nolimit')){_0xb1f6fe[_0x7f57('0x33')]=qs[_0x7f57('0x33')](_0x5dcc9e['query'][_0x7f57('0x33')]);_0xb1f6fe[_0x7f57('0x35')]=qs[_0x7f57('0x35')](_0x5dcc9e[_0x7f57('0x47')][_0x7f57('0x35')]);}_0xb1f6fe[_0x7f57('0x4c')]=qs[_0x7f57('0x4d')](_0x5dcc9e['query'][_0x7f57('0x4d')]);_0xb1f6fe['where']=qs[_0x7f57('0x48')](_[_0x7f57('0x4e')](_0x5dcc9e[_0x7f57('0x47')],_0x544055['filters']),_0x54413d);if(_0x5dcc9e[_0x7f57('0x47')]['filter']){_0xb1f6fe['where']=_[_0x7f57('0x4f')](_0xb1f6fe['where'],{'$or':_[_0x7f57('0x41')](_0x54413d,function(_0x49a8e4){if(_0x49a8e4[_0x7f57('0x44')]!==_0x7f57('0x50')){var _0xf4c97f={};_0xf4c97f[_0x49a8e4['name']]={'$like':'%'+_0x5dcc9e['query']['filter']+'%'};return _0xf4c97f;}})});}_0xb1f6fe=_['merge']({},_0xb1f6fe,_0x5dcc9e[_0x7f57('0x51')]);var _0x49b62b={'where':_0xb1f6fe[_0x7f57('0x52')]};return db[_0x7f57('0x42')]['count'](_0x49b62b)[_0x7f57('0x22')](function(_0x3ca0b0){_0x577217[_0x7f57('0x34')]=_0x3ca0b0;if(_0x5dcc9e[_0x7f57('0x47')][_0x7f57('0x53')]){_0xb1f6fe['include']=[{'all':!![]}];}return db[_0x7f57('0x42')]['findAll'](_0xb1f6fe);})[_0x7f57('0x22')](function(_0x5d3f69){_0x577217[_0x7f57('0x54')]=_0x5d3f69;return _0x577217;})['then'](respondWithFilteredResult(_0x3b6d6b,_0xb1f6fe))[_0x7f57('0x2d')](handleError(_0x3b6d6b,null));};exports['show']=function(_0x373400,_0x57fbd0){var _0x896255={'raw':!![],'where':{'id':_0x373400['params']['id']}},_0x131399={};_0x131399[_0x7f57('0x46')]=_['keys'](db[_0x7f57('0x42')][_0x7f57('0x43')]);_0x131399[_0x7f57('0x47')]=_[_0x7f57('0x55')](_0x373400[_0x7f57('0x47')]);_0x131399[_0x7f57('0x48')]=_[_0x7f57('0x49')](_0x131399['model'],_0x131399[_0x7f57('0x47')]);_0x896255[_0x7f57('0x4a')]=_[_0x7f57('0x49')](_0x131399[_0x7f57('0x46')],qs[_0x7f57('0x56')](_0x373400['query']['fields']));_0x896255[_0x7f57('0x4a')]=_0x896255[_0x7f57('0x4a')][_0x7f57('0x57')]?_0x896255[_0x7f57('0x4a')]:_0x131399[_0x7f57('0x46')];if(_0x373400[_0x7f57('0x47')][_0x7f57('0x53')]){_0x896255['include']=[{'all':!![]}];}_0x896255=_[_0x7f57('0x4f')]({},_0x896255,_0x373400[_0x7f57('0x51')]);return db[_0x7f57('0x42')][_0x7f57('0x58')](_0x896255)[_0x7f57('0x22')](handleEntityNotFound(_0x57fbd0,null))[_0x7f57('0x22')](respondWithResult(_0x57fbd0,null))[_0x7f57('0x2d')](handleError(_0x57fbd0,null));};exports[_0x7f57('0x59')]=function(_0x3761fc,_0x465793){return db[_0x7f57('0x42')][_0x7f57('0x59')](_0x3761fc['body'],{})[_0x7f57('0x22')](respondWithResult(_0x465793,0xc9))[_0x7f57('0x2d')](handleError(_0x465793,null));};exports[_0x7f57('0x3b')]=function(_0x54e2ca,_0x997ed1){if(_0x54e2ca[_0x7f57('0x5a')]['id']){delete _0x54e2ca[_0x7f57('0x5a')]['id'];}return db['OpenchannelMessage'][_0x7f57('0x58')]({'where':{'id':_0x54e2ca[_0x7f57('0x5b')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x997ed1,null))[_0x7f57('0x22')](saveUpdates(_0x54e2ca[_0x7f57('0x5a')],null))[_0x7f57('0x22')](respondWithResult(_0x997ed1,null))['catch'](handleError(_0x997ed1,null));};exports['destroy']=function(_0x1fed2b,_0x3bbe61){return db[_0x7f57('0x42')][_0x7f57('0x58')]({'where':{'id':_0x1fed2b['params']['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x3bbe61,null))[_0x7f57('0x22')](removeEntity(_0x3bbe61,null))[_0x7f57('0x2d')](handleError(_0x3bbe61,null));};exports[_0x7f57('0x5c')]=function(_0x3ba232,_0x2f08bc){return db[_0x7f57('0x42')]['describe']()[_0x7f57('0x22')](respondWithResult(_0x2f08bc,null))[_0x7f57('0x2d')](handleError(_0x2f08bc,null));};var interaction_log=require(_0x7f57('0x15'))('openchannel-interactions');exports[_0x7f57('0x5d')]=function(_0x572ac6,_0x25c198,_0x33d187){var _0x16143c={'agent':{},'channel':'openchannel'};if(_0x572ac6[_0x7f57('0x5a')]['id']){delete _0x572ac6['body']['id'];}_0x572ac6[_0x7f57('0x5a')][_0x7f57('0x5e')]=!![];_0x572ac6[_0x7f57('0x5a')]['readAt']=moment()[_0x7f57('0x5f')](_0x7f57('0x60'));_0x572ac6[_0x7f57('0x5a')][_0x7f57('0x61')]=_0x572ac6[_0x7f57('0x5a')]['UserId']||_0x572ac6['user']['id'];_0x16143c[_0x7f57('0x62')]['id']=_0x572ac6['body'][_0x7f57('0x61')];return db[_0x7f57('0x42')][_0x7f57('0x58')]({'where':{'id':_0x572ac6[_0x7f57('0x5b')]['id'],'UserId':null}})[_0x7f57('0x22')](handleEntityNotFound(_0x25c198,null))[_0x7f57('0x22')](saveUpdates(_0x572ac6[_0x7f57('0x5a')],null))[_0x7f57('0x22')](function(_0x7d9b54){if(_0x7d9b54){_0x16143c[_0x7f57('0x2b')]=_0x7d9b54['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x7f57('0x58')]({'where':{'id':_0x7d9b54['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x25c198,null))[_0x7f57('0x22')](function(_0x4b9ed6){if(_0x4b9ed6){return _0x4b9ed6[_0x7f57('0x3b')]({'UserId':_0x572ac6['body'][_0x7f57('0x61')],'read1stAt':_['isNil'](_0x4b9ed6['read1stAt'])?moment()['format'](_0x7f57('0x60')):undefined});}return null;})[_0x7f57('0x22')](function(_0x4c641a){if(_0x4c641a){_0x16143c[_0x7f57('0x63')]=_0x4c641a[_0x7f57('0x64')]({'plain':!![]});interaction_log[_0x7f57('0x23')](_0x7f57('0x65'),_0x572ac6[_0x7f57('0x66')]['id'],_0x572ac6['user'][_0x7f57('0x3e')],_0x572ac6[_0x7f57('0x66')][_0x7f57('0x67')],_0x16143c['interaction']['id'],_0x572ac6[_0x7f57('0x5a')]?JSON[_0x7f57('0x28')](_0x572ac6[_0x7f57('0x5a')]):_0x7f57('0x68'));return respondWithRpcPromise(_0x7f57('0x69'),_0x7f57('0x6a'),_0x16143c);}return null;})[_0x7f57('0x22')](function(_0x2fc895){var _0x24cd3b=_0x7f57('0x6b')+_0x2fc895[_0x7f57('0x2b')][_0x7f57('0x6c')];return db['sequelize'][_0x7f57('0x47')](_0x24cd3b,{'type':db[_0x7f57('0x6d')]['QueryTypes'][_0x7f57('0x6e')],'raw':!![]})['then'](function(_0x149541){return _0x149541;});})['then'](function(_0x1bd0a9){if(_0x1bd0a9){_0x16143c[_0x7f57('0x2b')][_0x7f57('0x6f')]=_0x1bd0a9[0x0];if(!_0x572ac6['body'][_0x7f57('0x61')])return;return db[_0x7f57('0x70')][_0x7f57('0x58')]({'where':{'id':_0x572ac6[_0x7f57('0x5a')][_0x7f57('0x61')],'role':_0x7f57('0x62')},'attributes':['id',_0x7f57('0x3e'),_0x7f57('0x71'),'email',_0x7f57('0x72')],'raw':!![]});}return null;})[_0x7f57('0x22')](function(_0x4ed7a5){if(!_0x4ed7a5)return null;_0x16143c[_0x7f57('0x2b')]['agent']=_0x4ed7a5;return _0x16143c;})[_0x7f57('0x22')](function(_0x966782){if(_0x966782){if(_0x572ac6[_0x7f57('0x5a')][_0x7f57('0x73')]){_0x16143c[_0x7f57('0x2b')][_0x7f57('0x74')]=util[_0x7f57('0x5f')](_0x7f57('0x75'),_0x572ac6[_0x7f57('0x66')][_0x7f57('0x3e')]);_0x16143c[_0x7f57('0x2b')]['channel']=_0x16143c['channel'];_0x16143c[_0x7f57('0x2b')]['motionChannel']=_0x16143c[_0x7f57('0x76')];_0x16143c[_0x7f57('0x2b')]['event']=_0x7f57('0x5d');return respondWithRpcPromise('EventManager',_0x7f57('0x77'),{'event':_0x7f57('0x78'),'message':_0x16143c[_0x7f57('0x2b')]},client9002)['then'](function(){return _0x16143c;});}return _0x16143c;}return null;})[_0x7f57('0x22')](respondWithResult(_0x25c198,null))[_0x7f57('0x2d')](handleError(_0x25c198,null));};var interaction_log=require(_0x7f57('0x15'))(_0x7f57('0x79'));exports['reject']=function(_0x141c4e,_0x428ce8,_0x387ec3){var _0x57d396={'agent':{},'channel':_0x7f57('0x7a')};if(_0x141c4e['body']['id']){delete _0x141c4e['body']['id'];}_0x141c4e[_0x7f57('0x5a')][_0x7f57('0x61')]=_0x141c4e[_0x7f57('0x5a')][_0x7f57('0x61')]||_0x141c4e[_0x7f57('0x66')]['id'];_0x57d396[_0x7f57('0x62')]['id']=_0x141c4e[_0x7f57('0x5a')]['UserId'];return db[_0x7f57('0x42')][_0x7f57('0x58')]({'where':{'id':_0x141c4e[_0x7f57('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x428ce8,null))['then'](function(_0x532c87){if(_0x532c87){_0x57d396[_0x7f57('0x2b')]=_0x532c87[_0x7f57('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x7f57('0x58')]({'where':{'id':_0x532c87[_0x7f57('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x428ce8,null))['then'](function(_0x462a8f){if(_0x462a8f){_0x57d396[_0x7f57('0x63')]=_0x462a8f['get']({'plain':!![]});interaction_log[_0x7f57('0x23')](_0x7f57('0x7c'),_0x141c4e[_0x7f57('0x66')]['id'],_0x141c4e[_0x7f57('0x66')][_0x7f57('0x3e')],_0x141c4e[_0x7f57('0x66')]['role'],_0x57d396[_0x7f57('0x63')]['id'],_0x141c4e[_0x7f57('0x5a')]?JSON[_0x7f57('0x28')](_0x141c4e[_0x7f57('0x5a')]):'null');return respondWithRpcPromise(_0x7f57('0x7d'),'rejectMessage',_0x57d396);}return null;})[_0x7f57('0x22')](function(_0x5be506){var _0x4502e9=_0x7f57('0x6b')+_0x5be506['message'][_0x7f57('0x6c')];return db[_0x7f57('0x7e')][_0x7f57('0x47')](_0x4502e9,{'type':db['Sequelize']['QueryTypes'][_0x7f57('0x6e')],'raw':!![]})['then'](function(_0x2e87ec){return _0x2e87ec;});})['then'](function(_0x532021){if(_0x532021){_0x57d396[_0x7f57('0x2b')][_0x7f57('0x6f')]=_0x532021[0x0];if(!_0x141c4e[_0x7f57('0x5a')]['UserId'])return;return db[_0x7f57('0x70')][_0x7f57('0x58')]({'where':{'id':_0x141c4e[_0x7f57('0x5a')][_0x7f57('0x61')],'role':_0x7f57('0x62')},'attributes':['id','name',_0x7f57('0x71'),_0x7f57('0x7f'),'internal'],'raw':!![]});}return null;})[_0x7f57('0x22')](function(_0x254c8a){if(!_0x254c8a)return null;_0x57d396[_0x7f57('0x2b')][_0x7f57('0x62')]=_0x254c8a;return _0x57d396;})[_0x7f57('0x22')](function(_0x1dbe2d){if(_0x1dbe2d){_0x1dbe2d[_0x7f57('0x2b')][_0x7f57('0x74')]=util[_0x7f57('0x5f')](_0x7f57('0x75'),_0x141c4e[_0x7f57('0x66')][_0x7f57('0x3e')]);_0x1dbe2d[_0x7f57('0x2b')][_0x7f57('0x76')]=_0x57d396[_0x7f57('0x76')];_0x1dbe2d['message'][_0x7f57('0x80')]=_0x57d396[_0x7f57('0x76')];_0x1dbe2d[_0x7f57('0x2b')][_0x7f57('0x81')]=_0x7f57('0x39');respondWithRpcPromise(_0x7f57('0x77'),_0x7f57('0x77'),{'event':_0x7f57('0x82'),'message':_0x1dbe2d['message']},client9002);return _0x57d396;}return null;})[_0x7f57('0x22')](respondWithResult(_0x428ce8,null))['catch'](handleError(_0x428ce8,null));}; \ No newline at end of file +var _0xb066=['read','readAt','format','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','openchannel-interactions','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','email','reject','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','error','code','message','info','status','end','json','undefined','offset','limit','set','Content-Range','save','update','destroy','sendStatus','name','send','map','OpenchannelMessage','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','show','params','rawAttributes','create','body','find','catch','describe'];(function(_0x1c4831,_0x3ff74a){var _0x1e6a6d=function(_0x434896){while(--_0x434896){_0x1c4831['push'](_0x1c4831['shift']());}};_0x1e6a6d(++_0x3ff74a);}(_0xb066,0xac));var _0x6b06=function(_0x48f31c,_0x294778){_0x48f31c=_0x48f31c-0x0;var _0x47153d=_0xb066[_0x48f31c];return _0x47153d;};'use strict';var emlformat=require(_0x6b06('0x0'));var rimraf=require(_0x6b06('0x1'));var zipdir=require(_0x6b06('0x2'));var jsonpatch=require(_0x6b06('0x3'));var rp=require(_0x6b06('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6b06('0x5'));var util=require(_0x6b06('0x6'));var path=require(_0x6b06('0x7'));var sox=require(_0x6b06('0x8'));var csv=require(_0x6b06('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b06('0xa'));var _=require(_0x6b06('0xb'));var squel=require(_0x6b06('0xc'));var crypto=require('crypto');var jsforce=require(_0x6b06('0xd'));var deskjs=require(_0x6b06('0xe'));var toCsv=require(_0x6b06('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6b06('0xf'));var qs=require(_0x6b06('0x10'));var as=require(_0x6b06('0x11'));var hardwareService=require(_0x6b06('0x12'));var logger=require(_0x6b06('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6b06('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b06('0x15'))['db'];config[_0x6b06('0x16')]=_[_0x6b06('0x17')](config['redis'],{'host':_0x6b06('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b06('0x16')]));require(_0x6b06('0x19'))['register'](socket);var jayson=require(_0x6b06('0x1a'));var client=jayson[_0x6b06('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x6b06('0x1b')][_0x6b06('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x28a7f6,_0x54f3f2,_0x180a6c,_0x224fc5){return new BPromise(function(_0x951eac,_0x293b5b){var _0x5a5ec0=_0x224fc5||client;return _0x5a5ec0[_0x6b06('0x1d')](_0x28a7f6,_0x180a6c)[_0x6b06('0x1e')](function(_0x1c290c){logger['info'](_0x6b06('0x1f'),_0x54f3f2,'request\x20sent');logger[_0x6b06('0x20')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x54f3f2,'request\x20sent',JSON['stringify'](_0x1c290c));if(_0x1c290c[_0x6b06('0x21')]){if(_0x1c290c[_0x6b06('0x21')][_0x6b06('0x22')]===0x1f4){logger['error'](_0x6b06('0x1f'),_0x54f3f2,_0x1c290c[_0x6b06('0x21')][_0x6b06('0x23')]);return _0x293b5b(_0x1c290c[_0x6b06('0x21')][_0x6b06('0x23')]);}logger['error'](_0x6b06('0x1f'),_0x54f3f2,_0x1c290c[_0x6b06('0x21')]['message']);return _0x951eac(_0x1c290c[_0x6b06('0x21')][_0x6b06('0x23')]);}else{logger[_0x6b06('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x54f3f2,'request\x20sent');_0x951eac(_0x1c290c['result']['message']);}})['catch'](function(_0x5dfbd1){logger[_0x6b06('0x21')](_0x6b06('0x1f'),_0x54f3f2,_0x5dfbd1);_0x293b5b(_0x5dfbd1);});});}function respondWithStatusCode(_0x995477,_0x4a8527){_0x4a8527=_0x4a8527||0xcc;return function(_0xe0c22c){if(_0xe0c22c){return _0x995477['sendStatus'](_0x4a8527);}return _0x995477[_0x6b06('0x25')](_0x4a8527)[_0x6b06('0x26')]();};}function respondWithResult(_0x29b5dd,_0x5facdf){_0x5facdf=_0x5facdf||0xc8;return function(_0x1f640e){if(_0x1f640e){return _0x29b5dd[_0x6b06('0x25')](_0x5facdf)[_0x6b06('0x27')](_0x1f640e);}};}function respondWithFilteredResult(_0x3382f0,_0x26b9a0){return function(_0x5c0a49){if(_0x5c0a49){var _0x45057e=typeof _0x26b9a0['offset']==='undefined'&&typeof _0x26b9a0['limit']===_0x6b06('0x28');var _0x248a1e=_0x5c0a49['count'];var _0x5c2993=_0x45057e?0x0:_0x26b9a0[_0x6b06('0x29')];var _0x41d9e1=_0x45057e?_0x5c0a49['count']:_0x26b9a0['offset']+_0x26b9a0[_0x6b06('0x2a')];var _0x40f52b;if(_0x41d9e1>=_0x248a1e){_0x41d9e1=_0x248a1e;_0x40f52b=0xc8;}else{_0x40f52b=0xce;}_0x3382f0[_0x6b06('0x25')](_0x40f52b);return _0x3382f0[_0x6b06('0x2b')](_0x6b06('0x2c'),_0x5c2993+'-'+_0x41d9e1+'/'+_0x248a1e)['json'](_0x5c0a49);}return null;};}function patchUpdates(_0x5d6073){return function(_0x56f243){try{jsonpatch['apply'](_0x56f243,_0x5d6073,!![]);}catch(_0x25b772){return BPromise['reject'](_0x25b772);}return _0x56f243[_0x6b06('0x2d')]();};}function saveUpdates(_0x300a29,_0x5de758){return function(_0x31baf7){if(_0x31baf7){return _0x31baf7[_0x6b06('0x2e')](_0x300a29)[_0x6b06('0x1e')](function(_0x189538){return _0x189538;});}return null;};}function removeEntity(_0x368090,_0x1c67e2){return function(_0x409a64){if(_0x409a64){return _0x409a64[_0x6b06('0x2f')]()[_0x6b06('0x1e')](function(){_0x368090[_0x6b06('0x25')](0xcc)[_0x6b06('0x26')]();});}};}function handleEntityNotFound(_0x46caab,_0x50002c){return function(_0x5cfb03){if(!_0x5cfb03){_0x46caab[_0x6b06('0x30')](0x194);}return _0x5cfb03;};}function handleError(_0x195a6f,_0x4a777b){_0x4a777b=_0x4a777b||0x1f4;return function(_0x33a1d0){logger[_0x6b06('0x21')](_0x33a1d0['stack']);if(_0x33a1d0[_0x6b06('0x31')]){delete _0x33a1d0[_0x6b06('0x31')];}_0x195a6f['status'](_0x4a777b)[_0x6b06('0x32')](_0x33a1d0);};}exports['index']=function(_0xf87cd3,_0x3ccded){var _0x59484d={},_0x5c2982={},_0xc0e1b0={'count':0x0,'rows':[]};var _0x331383=_[_0x6b06('0x33')](db[_0x6b06('0x34')]['rawAttributes'],function(_0x46612d){return{'name':_0x46612d[_0x6b06('0x35')],'type':_0x46612d[_0x6b06('0x36')][_0x6b06('0x37')]};});_0x5c2982[_0x6b06('0x38')]=_[_0x6b06('0x33')](_0x331383,_0x6b06('0x31'));_0x5c2982[_0x6b06('0x39')]=_['keys'](_0xf87cd3['query']);_0x5c2982['filters']=_[_0x6b06('0x3a')](_0x5c2982['model'],_0x5c2982[_0x6b06('0x39')]);_0x59484d['attributes']=_[_0x6b06('0x3a')](_0x5c2982[_0x6b06('0x38')],qs[_0x6b06('0x3b')](_0xf87cd3['query'][_0x6b06('0x3b')]));_0x59484d[_0x6b06('0x3c')]=_0x59484d[_0x6b06('0x3c')][_0x6b06('0x3d')]?_0x59484d[_0x6b06('0x3c')]:_0x5c2982['model'];if(!_0xf87cd3[_0x6b06('0x39')][_0x6b06('0x3e')](_0x6b06('0x3f'))){_0x59484d[_0x6b06('0x2a')]=qs['limit'](_0xf87cd3[_0x6b06('0x39')][_0x6b06('0x2a')]);_0x59484d[_0x6b06('0x29')]=qs[_0x6b06('0x29')](_0xf87cd3[_0x6b06('0x39')][_0x6b06('0x29')]);}_0x59484d[_0x6b06('0x40')]=qs[_0x6b06('0x41')](_0xf87cd3[_0x6b06('0x39')][_0x6b06('0x41')]);_0x59484d['where']=qs[_0x6b06('0x42')](_['pick'](_0xf87cd3[_0x6b06('0x39')],_0x5c2982['filters']),_0x331383);if(_0xf87cd3[_0x6b06('0x39')][_0x6b06('0x43')]){_0x59484d[_0x6b06('0x44')]=_['merge'](_0x59484d[_0x6b06('0x44')],{'$or':_[_0x6b06('0x33')](_0x331383,function(_0x3f8897){if(_0x3f8897['type']!==_0x6b06('0x45')){var _0x5ee0dd={};_0x5ee0dd[_0x3f8897['name']]={'$like':'%'+_0xf87cd3[_0x6b06('0x39')]['filter']+'%'};return _0x5ee0dd;}})});}_0x59484d=_[_0x6b06('0x46')]({},_0x59484d,_0xf87cd3[_0x6b06('0x47')]);var _0x50ba06={'where':_0x59484d[_0x6b06('0x44')]};return db[_0x6b06('0x34')][_0x6b06('0x48')](_0x50ba06)['then'](function(_0x30b9f1){_0xc0e1b0[_0x6b06('0x48')]=_0x30b9f1;if(_0xf87cd3['query'][_0x6b06('0x49')]){_0x59484d[_0x6b06('0x4a')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6b06('0x4b')](_0x59484d);})[_0x6b06('0x1e')](function(_0xc14c6){_0xc0e1b0['rows']=_0xc14c6;return _0xc0e1b0;})[_0x6b06('0x1e')](respondWithFilteredResult(_0x3ccded,_0x59484d))['catch'](handleError(_0x3ccded,null));};exports[_0x6b06('0x4c')]=function(_0x3cea67,_0x32e2c4){var _0x29f780={'raw':!![],'where':{'id':_0x3cea67[_0x6b06('0x4d')]['id']}},_0x1fcc98={};_0x1fcc98[_0x6b06('0x38')]=_['keys'](db['OpenchannelMessage'][_0x6b06('0x4e')]);_0x1fcc98[_0x6b06('0x39')]=_['keys'](_0x3cea67[_0x6b06('0x39')]);_0x1fcc98['filters']=_[_0x6b06('0x3a')](_0x1fcc98['model'],_0x1fcc98[_0x6b06('0x39')]);_0x29f780[_0x6b06('0x3c')]=_[_0x6b06('0x3a')](_0x1fcc98['model'],qs[_0x6b06('0x3b')](_0x3cea67[_0x6b06('0x39')][_0x6b06('0x3b')]));_0x29f780[_0x6b06('0x3c')]=_0x29f780['attributes']['length']?_0x29f780[_0x6b06('0x3c')]:_0x1fcc98['model'];if(_0x3cea67[_0x6b06('0x39')][_0x6b06('0x49')]){_0x29f780[_0x6b06('0x4a')]=[{'all':!![]}];}_0x29f780=_[_0x6b06('0x46')]({},_0x29f780,_0x3cea67[_0x6b06('0x47')]);return db[_0x6b06('0x34')]['find'](_0x29f780)[_0x6b06('0x1e')](handleEntityNotFound(_0x32e2c4,null))[_0x6b06('0x1e')](respondWithResult(_0x32e2c4,null))['catch'](handleError(_0x32e2c4,null));};exports['create']=function(_0x5c8468,_0x33ccd1){return db[_0x6b06('0x34')][_0x6b06('0x4f')](_0x5c8468[_0x6b06('0x50')],{})[_0x6b06('0x1e')](respondWithResult(_0x33ccd1,0xc9))['catch'](handleError(_0x33ccd1,null));};exports['update']=function(_0x30942c,_0x239d61){if(_0x30942c[_0x6b06('0x50')]['id']){delete _0x30942c['body']['id'];}return db[_0x6b06('0x34')][_0x6b06('0x51')]({'where':{'id':_0x30942c[_0x6b06('0x4d')]['id']}})[_0x6b06('0x1e')](handleEntityNotFound(_0x239d61,null))[_0x6b06('0x1e')](saveUpdates(_0x30942c[_0x6b06('0x50')],null))[_0x6b06('0x1e')](respondWithResult(_0x239d61,null))['catch'](handleError(_0x239d61,null));};exports[_0x6b06('0x2f')]=function(_0x253b95,_0x5de78b){return db[_0x6b06('0x34')][_0x6b06('0x51')]({'where':{'id':_0x253b95[_0x6b06('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5de78b,null))[_0x6b06('0x1e')](removeEntity(_0x5de78b,null))[_0x6b06('0x52')](handleError(_0x5de78b,null));};exports[_0x6b06('0x53')]=function(_0x106b4e,_0x3bf5ac){return db[_0x6b06('0x34')]['describe']()[_0x6b06('0x1e')](respondWithResult(_0x3bf5ac,null))['catch'](handleError(_0x3bf5ac,null));};var interaction_log=require(_0x6b06('0x13'))('openchannel-interactions');exports['accept']=function(_0x11b5a9,_0x5b4902,_0x58011a){var _0x5d85d9={'agent':{},'channel':'openchannel'};if(_0x11b5a9[_0x6b06('0x50')]['id']){delete _0x11b5a9[_0x6b06('0x50')]['id'];}_0x11b5a9[_0x6b06('0x50')][_0x6b06('0x54')]=!![];_0x11b5a9[_0x6b06('0x50')][_0x6b06('0x55')]=moment()[_0x6b06('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x11b5a9[_0x6b06('0x50')]['UserId']=_0x11b5a9[_0x6b06('0x50')][_0x6b06('0x57')]||_0x11b5a9[_0x6b06('0x58')]['id'];_0x5d85d9[_0x6b06('0x59')]['id']=_0x11b5a9[_0x6b06('0x50')][_0x6b06('0x57')];return db[_0x6b06('0x34')]['find']({'where':{'id':_0x11b5a9[_0x6b06('0x4d')]['id'],'UserId':null}})[_0x6b06('0x1e')](handleEntityNotFound(_0x5b4902,null))[_0x6b06('0x1e')](saveUpdates(_0x11b5a9[_0x6b06('0x50')],null))[_0x6b06('0x1e')](function(_0x5ab361){if(_0x5ab361){_0x5d85d9[_0x6b06('0x23')]=_0x5ab361[_0x6b06('0x5a')]({'plain':!![]});return db['OpenchannelInteraction'][_0x6b06('0x51')]({'where':{'id':_0x5ab361[_0x6b06('0x5b')]}});}return null;})[_0x6b06('0x1e')](handleEntityNotFound(_0x5b4902,null))['then'](function(_0x4a8b73){if(_0x4a8b73){return _0x4a8b73[_0x6b06('0x2e')]({'UserId':_0x11b5a9[_0x6b06('0x50')][_0x6b06('0x57')],'read1stAt':_[_0x6b06('0x5c')](_0x4a8b73[_0x6b06('0x5d')])?moment()[_0x6b06('0x56')](_0x6b06('0x5e')):undefined});}return null;})[_0x6b06('0x1e')](function(_0x884060){if(_0x884060){_0x5d85d9[_0x6b06('0x5f')]=_0x884060[_0x6b06('0x5a')]({'plain':!![]});interaction_log[_0x6b06('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11b5a9[_0x6b06('0x58')]['id'],_0x11b5a9[_0x6b06('0x58')][_0x6b06('0x31')],_0x11b5a9[_0x6b06('0x58')][_0x6b06('0x60')],_0x5d85d9[_0x6b06('0x5f')]['id'],_0x11b5a9['body']?JSON[_0x6b06('0x61')](_0x11b5a9[_0x6b06('0x50')]):_0x6b06('0x62'));return respondWithRpcPromise(_0x6b06('0x63'),_0x6b06('0x64'),_0x5d85d9);}return null;})[_0x6b06('0x1e')](function(_0x52e500){var _0x2ab12f=_0x6b06('0x65')+_0x52e500[_0x6b06('0x23')][_0x6b06('0x66')];return db[_0x6b06('0x67')][_0x6b06('0x39')](_0x2ab12f,{'type':db[_0x6b06('0x68')][_0x6b06('0x69')][_0x6b06('0x6a')],'raw':!![]})[_0x6b06('0x1e')](function(_0x1580d3){return _0x1580d3;});})[_0x6b06('0x1e')](function(_0x55116d){if(_0x55116d){_0x5d85d9[_0x6b06('0x23')][_0x6b06('0x6b')]=_0x55116d[0x0];if(!_0x11b5a9[_0x6b06('0x50')]['UserId'])return;return db[_0x6b06('0x6c')]['find']({'where':{'id':_0x11b5a9[_0x6b06('0x50')][_0x6b06('0x57')],'role':'agent'},'attributes':['id',_0x6b06('0x31'),_0x6b06('0x6d'),'email',_0x6b06('0x6e')],'raw':!![]});}return null;})[_0x6b06('0x1e')](function(_0x4c9add){if(!_0x4c9add)return null;_0x5d85d9['message'][_0x6b06('0x59')]=_0x4c9add;return _0x5d85d9;})[_0x6b06('0x1e')](function(_0x5162d5){if(_0x5162d5){if(_0x11b5a9[_0x6b06('0x50')][_0x6b06('0x6f')]){_0x5d85d9[_0x6b06('0x23')][_0x6b06('0x70')]=util[_0x6b06('0x56')](_0x6b06('0x71'),_0x11b5a9[_0x6b06('0x58')]['name']);_0x5d85d9[_0x6b06('0x23')]['channel']=_0x5d85d9[_0x6b06('0x72')];_0x5d85d9['message'][_0x6b06('0x73')]=_0x5d85d9[_0x6b06('0x72')];_0x5d85d9[_0x6b06('0x23')][_0x6b06('0x74')]=_0x6b06('0x75');return respondWithRpcPromise(_0x6b06('0x76'),_0x6b06('0x76'),{'event':_0x6b06('0x77'),'message':_0x5d85d9[_0x6b06('0x23')]},client9002)[_0x6b06('0x1e')](function(){return _0x5d85d9;});}return _0x5d85d9;}return null;})['then'](respondWithResult(_0x5b4902,null))[_0x6b06('0x52')](handleError(_0x5b4902,null));};var interaction_log=require(_0x6b06('0x13'))(_0x6b06('0x78'));exports['reject']=function(_0x332393,_0x2be1e0,_0x46217e){var _0xe44616={'agent':{},'channel':_0x6b06('0x79')};if(_0x332393[_0x6b06('0x50')]['id']){delete _0x332393[_0x6b06('0x50')]['id'];}_0x332393[_0x6b06('0x50')]['UserId']=_0x332393[_0x6b06('0x50')][_0x6b06('0x57')]||_0x332393[_0x6b06('0x58')]['id'];_0xe44616[_0x6b06('0x59')]['id']=_0x332393[_0x6b06('0x50')]['UserId'];return db[_0x6b06('0x34')]['find']({'where':{'id':_0x332393[_0x6b06('0x4d')]['id'],'UserId':null}})[_0x6b06('0x1e')](handleEntityNotFound(_0x2be1e0,null))[_0x6b06('0x1e')](function(_0x4d82e6){if(_0x4d82e6){_0xe44616['message']=_0x4d82e6['get']({'plain':!![]});return db[_0x6b06('0x7a')][_0x6b06('0x51')]({'where':{'id':_0x4d82e6[_0x6b06('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x2be1e0,null))[_0x6b06('0x1e')](function(_0x2f12db){if(_0x2f12db){_0xe44616[_0x6b06('0x5f')]=_0x2f12db[_0x6b06('0x5a')]({'plain':!![]});interaction_log[_0x6b06('0x24')](_0x6b06('0x7b'),_0x332393[_0x6b06('0x58')]['id'],_0x332393[_0x6b06('0x58')]['name'],_0x332393[_0x6b06('0x58')][_0x6b06('0x60')],_0xe44616['interaction']['id'],_0x332393['body']?JSON['stringify'](_0x332393[_0x6b06('0x50')]):_0x6b06('0x62'));return respondWithRpcPromise('RejectMessage',_0x6b06('0x7c'),_0xe44616);}return null;})[_0x6b06('0x1e')](function(_0x51db65){var _0x4fab5e=_0x6b06('0x65')+_0x51db65[_0x6b06('0x23')][_0x6b06('0x66')];return db['sequelize'][_0x6b06('0x39')](_0x4fab5e,{'type':db[_0x6b06('0x68')]['QueryTypes']['SELECT'],'raw':!![]})[_0x6b06('0x1e')](function(_0x44d548){return _0x44d548;});})[_0x6b06('0x1e')](function(_0x3dc973){if(_0x3dc973){_0xe44616[_0x6b06('0x23')]['contact']=_0x3dc973[0x0];if(!_0x332393[_0x6b06('0x50')]['UserId'])return;return db['User'][_0x6b06('0x51')]({'where':{'id':_0x332393['body'][_0x6b06('0x57')],'role':_0x6b06('0x59')},'attributes':['id',_0x6b06('0x31'),_0x6b06('0x6d'),_0x6b06('0x7d'),_0x6b06('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2e9976){if(!_0x2e9976)return null;_0xe44616[_0x6b06('0x23')][_0x6b06('0x59')]=_0x2e9976;return _0xe44616;})['then'](function(_0x42c907){if(_0x42c907){_0x42c907[_0x6b06('0x23')][_0x6b06('0x70')]=util[_0x6b06('0x56')](_0x6b06('0x71'),_0x332393['user']['name']);_0x42c907[_0x6b06('0x23')][_0x6b06('0x72')]=_0xe44616[_0x6b06('0x72')];_0x42c907[_0x6b06('0x23')][_0x6b06('0x73')]=_0xe44616[_0x6b06('0x72')];_0x42c907[_0x6b06('0x23')]['event']=_0x6b06('0x7e');respondWithRpcPromise('EventManager','EventManager',{'event':_0x6b06('0x7f'),'message':_0x42c907[_0x6b06('0x23')]},client9002);return _0xe44616;}return null;})['then'](respondWithResult(_0x2be1e0,null))[_0x6b06('0x52')](handleError(_0x2be1e0,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 2608ce8..e75c42b 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 _0x5e2d=['OpenchannelMessage','setMaxListeners','save','update','emit','hasOwnProperty','../../mysqldb'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x5e2d,0x6f));var _0xd5e2=function(_0x3e3f8c,_0x574523){_0x3e3f8c=_0x3e3f8c-0x0;var _0x3714ab=_0x5e2d[_0x3e3f8c];return _0x3714ab;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xd5e2('0x0'))['db'][_0xd5e2('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd5e2('0x2')](0x0);var events={'afterCreate':_0xd5e2('0x3'),'afterUpdate':_0xd5e2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x576533){return function(_0x3f2976,_0x520b09,_0x494814){OpenchannelMessageEvents[_0xd5e2('0x5')](_0x576533+':'+_0x3f2976['id'],_0x3f2976);OpenchannelMessageEvents[_0xd5e2('0x5')](_0x576533,_0x3f2976);_0x494814(null);};}for(var e in events){if(events[_0xd5e2('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xf97e=['exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0xf97e,0x141));var _0xef97=function(_0x517c2e,_0x3d4bf3){_0x517c2e=_0x517c2e-0x0;var _0x5d4029=_0xf97e[_0x517c2e];return _0x5d4029;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xef97('0x0'))['db'][_0xef97('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xef97('0x2')](0x0);var events={'afterCreate':_0xef97('0x3'),'afterUpdate':_0xef97('0x4'),'afterDestroy':_0xef97('0x5')};function emitEvent(_0x6e4659){return function(_0x4d60c6,_0x133d55,_0x3aad98){OpenchannelMessageEvents['emit'](_0x6e4659+':'+_0x4d60c6['id'],_0x4d60c6);OpenchannelMessageEvents[_0xef97('0x6')](_0x6e4659,_0x4d60c6);_0x3aad98(null);};}for(var e in events){if(events[_0xef97('0x7')](e)){var event=events[e];OpenchannelMessage[_0xef97('0x8')](e,emitEvent(event));}}module[_0xef97('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index f42d5c6..55b13f5 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 _0x4213=['describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','Contact','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch'];(function(_0x3e7b67,_0x2f6f3f){var _0x40de5f=function(_0x38792c){while(--_0x38792c){_0x3e7b67['push'](_0x3e7b67['shift']());}};_0x40de5f(++_0x2f6f3f);}(_0x4213,0x77));var _0x3421=function(_0x25a0e5,_0x4ea577){_0x25a0e5=_0x25a0e5-0x0;var _0x30c109=_0x4213[_0x25a0e5];return _0x30c109;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3421('0x7'));var config=require('../../config/environment');var attributes=require(_0x3421('0x8'));module[_0x3421('0x9')]=function(_0x2155f8,_0x2a04e0){return _0x2155f8['define'](_0x3421('0xa'),attributes,{'tableName':_0x3421('0xb'),'paranoid':![],'indexes':[{'name':_0x3421('0xc'),'fields':[_0x3421('0xd')],'type':_0x3421('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ddfce,_0x1f20cf,_0x58d511){var _0x4ff986=_0x2155f8[_0x3421('0xf')];var _0x4b9d24=_0x4ddfce[_0x3421('0x10')]({'plain':!![]});if(_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()==='in'||_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()===_0x3421('0x13')&&!_0x4b9d24[_0x3421('0x14')]&&!_['isNil'](_0x4b9d24[_0x3421('0x15')])){_0x4ff986[_0x3421('0x16')][_0x3421('0x17')]({'where':{'id':_0x4b9d24[_0x3421('0x18')]}})[_0x3421('0x19')](function(_0x3f4672){if(_0x3f4672){_0x3f4672[_0x3421('0x1a')]({'lastMsgAt':_0x4b9d24['createdAt'],'lastMsgDirection':_0x4b9d24[_0x3421('0x11')]['toLowerCase']()});}})[_0x3421('0x1b')](function(_0x5257ad){console['error'](_0x5257ad);});}if(_0x4b9d24[_0x3421('0x11')]==='out'&&!_0x4b9d24[_0x3421('0x14')]){var _0x23694b;_0x4ff986['CmContact'][_0x3421('0x1c')]()[_0x3421('0x19')](function(_0x130d3c){return _0x4ff986[_0x3421('0x1d')][_0x3421('0x1e')]({'where':{'id':_0x4b9d24[_0x3421('0x1f')]},'include':[{'model':_0x4ff986[_0x3421('0x16')],'as':_0x3421('0x20'),'where':{'id':_0x4b9d24[_0x3421('0x18')]},'limit':0x1,'include':[{'model':_0x4ff986[_0x3421('0x21')],'as':_0x3421('0x22'),'attributes':_['keys'](_0x130d3c)}]}]});})[_0x3421('0x19')](function(_0x4b59a5){_0x23694b=_0x4b59a5['get']({'plain':!![]});if(_0x23694b&&_0x23694b['replyUri']){logger[_0x3421('0x23')](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x26')](_0x3421('0x27'),_0x4b9d24['id'],_0x23694b[_0x3421('0x28')]));if(_0x23694b[_0x3421('0x20')]&&_0x23694b[_0x3421('0x20')][_0x3421('0x29')]){_0x4b9d24[_0x3421('0x2a')]=_['omit'](_0x23694b['Interactions'][0x0],'Contact');_0x4b9d24[_0x3421('0x22')]=_0x23694b[_0x3421('0x20')][0x0][_0x3421('0x22')];}var _0x1f20cf={'method':'POST','uri':encodeURI(_0x23694b[_0x3421('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f20cf['method']){case _0x3421('0x2b'):_0x1f20cf['qs']=_0x4b9d24;break;case'POST':_0x1f20cf[_0x3421('0xd')]=_0x4b9d24;break;}return rp(_0x1f20cf)[_0x3421('0x19')](function(_0x36d75f){logger[_0x3421('0x23')](_0x3421('0x24'),'afterCreate',util[_0x3421('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4b9d24['id'],_0x23694b['replyUri']));if(_0x36d75f[_0x3421('0xd')]['threadId']&&_0x36d75f['body'][_0x3421('0x2c')]!=_0x4b9d24['Interaction'][_0x3421('0x2c')]){return _0x4ff986['OpenchannelInteraction'][_0x3421('0x1a')]({'threadId':_0x36d75f[_0x3421('0xd')]['threadId']},{'logging':!![],'where':{'id':_0x4b9d24[_0x3421('0x2a')]['id']}});}else{return;}})[_0x3421('0x19')](function(){return _0x4ddfce[_0x3421('0x1a')]({'read':!![]});})['catch'](function(_0x3a89b6){logger['error'](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x2d')](_0x3a89b6,{'showHidden':![],'depth':null}));_0x58d511();});}else{_0x58d511();}})[_0x3421('0x2e')](function(){_0x58d511();});}else{_0x58d511();}}},'charset':_0x3421('0x2f'),'collate':_0x3421('0x30')});}; \ No newline at end of file +var _0x1775=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','Interaction','omit','POST','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x292c82,_0x53828b){var _0x552fb4=function(_0xd79f27){while(--_0xd79f27){_0x292c82['push'](_0x292c82['shift']());}};_0x552fb4(++_0x53828b);}(_0x1775,0x1db));var _0x5177=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1775[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'paranoid':![],'indexes':[{'name':_0x5177('0xe'),'fields':[_0x5177('0xf')],'type':_0x5177('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e5a3b,_0x2c23d8,_0x206035){var _0x5bdca9=_0x2c5c42['models'];var _0x13c7f6=_0x2e5a3b[_0x5177('0x11')]({'plain':!![]});if(_0x13c7f6[_0x5177('0x12')][_0x5177('0x13')]()==='in'||_0x13c7f6[_0x5177('0x12')]['toLowerCase']()===_0x5177('0x14')&&!_0x13c7f6[_0x5177('0x15')]&&!_[_0x5177('0x16')](_0x13c7f6[_0x5177('0x17')])){_0x5bdca9[_0x5177('0x18')][_0x5177('0x19')]({'where':{'id':_0x13c7f6[_0x5177('0x1a')]}})[_0x5177('0x1b')](function(_0x3e6224){if(_0x3e6224){_0x3e6224[_0x5177('0x1c')]({'lastMsgAt':_0x13c7f6[_0x5177('0x1d')],'lastMsgDirection':_0x13c7f6[_0x5177('0x12')][_0x5177('0x13')]()});}})[_0x5177('0x1e')](function(_0x1b32e6){console[_0x5177('0x1f')](_0x1b32e6);});}if(_0x13c7f6[_0x5177('0x12')]===_0x5177('0x14')&&!_0x13c7f6[_0x5177('0x15')]){var _0x50ce2c;_0x5bdca9[_0x5177('0x20')][_0x5177('0x21')]()[_0x5177('0x1b')](function(_0x1b4102){return _0x5bdca9['OpenchannelAccount'][_0x5177('0x22')]({'where':{'id':_0x13c7f6[_0x5177('0x23')]},'include':[{'model':_0x5bdca9[_0x5177('0x18')],'as':'Interactions','where':{'id':_0x13c7f6[_0x5177('0x1a')]},'limit':0x1,'include':[{'model':_0x5bdca9['CmContact'],'as':_0x5177('0x24'),'attributes':_[_0x5177('0x25')](_0x1b4102)}]}]});})[_0x5177('0x1b')](function(_0x27b732){_0x50ce2c=_0x27b732[_0x5177('0x11')]({'plain':!![]});if(_0x50ce2c&&_0x50ce2c[_0x5177('0x26')]){logger[_0x5177('0x27')](_0x5177('0x28'),_0x5177('0x29'),util[_0x5177('0x2a')](_0x5177('0x2b'),_0x13c7f6['id'],_0x50ce2c[_0x5177('0x26')]));if(_0x50ce2c['Interactions']&&_0x50ce2c[_0x5177('0x2c')]['length']){_0x13c7f6[_0x5177('0x2d')]=_[_0x5177('0x2e')](_0x50ce2c[_0x5177('0x2c')][0x0],_0x5177('0x24'));_0x13c7f6['Contact']=_0x50ce2c[_0x5177('0x2c')][0x0]['Contact'];}var _0x2c23d8={'method':_0x5177('0x2f'),'uri':encodeURI(_0x50ce2c[_0x5177('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2c23d8['method']){case _0x5177('0x30'):_0x2c23d8['qs']=_0x13c7f6;break;case'POST':_0x2c23d8[_0x5177('0xf')]=_0x13c7f6;break;}return rp(_0x2c23d8)[_0x5177('0x1b')](function(_0x58846c){logger[_0x5177('0x27')](_0x5177('0x28'),_0x5177('0x29'),util[_0x5177('0x2a')](_0x5177('0x31'),_0x13c7f6['id'],_0x50ce2c[_0x5177('0x26')]));if(_0x58846c['body']['threadId']&&_0x58846c[_0x5177('0xf')][_0x5177('0x32')]!=_0x13c7f6[_0x5177('0x2d')][_0x5177('0x32')]){return _0x5bdca9[_0x5177('0x18')][_0x5177('0x1c')]({'threadId':_0x58846c[_0x5177('0xf')][_0x5177('0x32')]},{'logging':!![],'where':{'id':_0x13c7f6['Interaction']['id']}});}else{return;}})[_0x5177('0x1b')](function(){return _0x2e5a3b[_0x5177('0x1c')]({'read':!![]});})['catch'](function(_0x32bea9){logger['error'](_0x5177('0x28'),_0x5177('0x29'),util[_0x5177('0x33')](_0x32bea9,{'showHidden':![],'depth':null}));_0x206035();});}else{_0x206035();}})['finally'](function(){_0x206035();});}else{_0x206035();}}},'charset':'utf8mb4','collate':_0x5177('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 274073a..b176202 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0xb47dc0,_0x407032){var _0x57f0b0=function(_0x11c030){while(--_0x11c030){_0xb47dc0['push'](_0xb47dc0['shift']());}};_0x57f0b0(++_0x407032);}(_0xdb28,0x106));var _0x8db2=function(_0x3f548f,_0x22aa84){_0x3f548f=_0x3f548f-0x0;var _0x4cefbe=_0xdb28[_0x3f548f];return _0x4cefbe;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x4186ae,_0x5548e5){var _0x31d4b0=function(_0xf394a9){while(--_0xf394a9){_0x4186ae['push'](_0x4186ae['shift']());}};_0x31d4b0(++_0x5548e5);}(_0xdb28,0x106));var _0x8db2=function(_0x149ae2,_0x476312){_0x149ae2=_0x149ae2-0x0;var _0x58850d=_0xdb28[_0x149ae2];return _0x58850d;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index cb4e247..c2b33b6 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 _0x0e26=['removeListener','length','openchannelMessage:','save','remove','emit'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x0e26,0x19b));var _0x60e2=function(_0x51e0a9,_0x4af364){_0x51e0a9=_0x51e0a9-0x0;var _0xf332b6=_0x0e26[_0x51e0a9];return _0xf332b6;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x60e2('0x0'),_0x60e2('0x1'),'update'];function createListener(_0x10e9b3,_0x2eb9c3){return function(_0x2cca54){_0x2eb9c3[_0x60e2('0x2')](_0x10e9b3,_0x2cca54);};}function removeListener(_0x431bba,_0x2c63c0){return function(){OpenchannelMessageEvents[_0x60e2('0x3')](_0x431bba,_0x2c63c0);};}exports['register']=function(_0x3fc7fb){for(var _0x35393b=0x0,_0x36e315=events[_0x60e2('0x4')];_0x35393b<_0x36e315;_0x35393b++){var _0x110845=events[_0x35393b];var _0x2e1583=createListener(_0x60e2('0x5')+_0x110845,_0x3fc7fb);OpenchannelMessageEvents['on'](_0x110845,_0x2e1583);}}; \ No newline at end of file +var _0xad07=['update','register','length','./openchannelMessage.events'];(function(_0x42f22b,_0x3825f1){var _0x33ff65=function(_0x3d2147){while(--_0x3d2147){_0x42f22b['push'](_0x42f22b['shift']());}};_0x33ff65(++_0x3825f1);}(_0xad07,0x1ab));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0x7ad0('0x0'));var events=['save','remove',_0x7ad0('0x1')];function createListener(_0x50f764,_0x12939a){return function(_0x1f2b27){_0x12939a['emit'](_0x50f764,_0x1f2b27);};}function removeListener(_0x42e596,_0x1301e2){return function(){OpenchannelMessageEvents['removeListener'](_0x42e596,_0x1301e2);};}exports[_0x7ad0('0x2')]=function(_0x345bf5){for(var _0x5a31f6=0x0,_0x462f81=events[_0x7ad0('0x3')];_0x5a31f6<_0x462f81;_0x5a31f6++){var _0x1a9ed2=events[_0x5a31f6];var _0x2c3e0f=createListener('openchannelMessage:'+_0x1a9ed2,_0x345bf5);OpenchannelMessageEvents['on'](_0x1a9ed2,_0x2c3e0f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 936d009..32fb635 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 _0x4c1e=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents'];(function(_0x3bf668,_0x2de931){var _0x48759c=function(_0x125f7c){while(--_0x125f7c){_0x3bf668['push'](_0x3bf668['shift']());}};_0x48759c(++_0x2de931);}(_0x4c1e,0x15d));var _0xe4c1=function(_0x547adb,_0x393007){_0x547adb=_0x547adb-0x0;var _0xcc20e6=_0x4c1e[_0x547adb];return _0xcc20e6;};'use strict';var multer=require(_0xe4c1('0x0'));var util=require(_0xe4c1('0x1'));var path=require(_0xe4c1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe4c1('0x3')]();var fs_extra=require(_0xe4c1('0x4'));var auth=require(_0xe4c1('0x5'));var interaction=require(_0xe4c1('0x6'));var config=require(_0xe4c1('0x7'));var controller=require('./openchannelQueue.controller');router[_0xe4c1('0x8')]('/',auth[_0xe4c1('0x9')](),controller[_0xe4c1('0xa')]);router[_0xe4c1('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe4c1('0xb')]);router[_0xe4c1('0x8')](_0xe4c1('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe4c1('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xe4c1('0xd')]);router[_0xe4c1('0x8')](_0xe4c1('0xe'),auth[_0xe4c1('0x9')](),controller[_0xe4c1('0xf')]);router[_0xe4c1('0x8')](_0xe4c1('0x10'),auth[_0xe4c1('0x9')](),controller[_0xe4c1('0x11')]);router[_0xe4c1('0x12')]('/',auth[_0xe4c1('0x9')](),controller[_0xe4c1('0x13')]);router[_0xe4c1('0x12')](_0xe4c1('0xe'),auth[_0xe4c1('0x9')](),controller[_0xe4c1('0x14')]);router[_0xe4c1('0x12')]('/:id/users',auth[_0xe4c1('0x9')](),controller[_0xe4c1('0x15')]);router[_0xe4c1('0x16')](_0xe4c1('0xc'),auth[_0xe4c1('0x9')](),controller[_0xe4c1('0x17')]);router[_0xe4c1('0x18')](_0xe4c1('0xc'),auth['isAuthenticated'](),controller[_0xe4c1('0x19')]);router['delete']('/:id/teams',auth[_0xe4c1('0x9')](),controller[_0xe4c1('0x1a')]);router['delete'](_0xe4c1('0x10'),auth['isAuthenticated'](),controller[_0xe4c1('0x1b')]);module[_0xe4c1('0x1c')]=router; \ No newline at end of file +var _0xfb03=['show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x24aa5c,_0x12f878){var _0x4cd76e=function(_0x2ef8c6){while(--_0x2ef8c6){_0x24aa5c['push'](_0x24aa5c['shift']());}};_0x4cd76e(++_0x12f878);}(_0xfb03,0x68));var _0x3fb0=function(_0x4a3bd2,_0x20c3cc){_0x4a3bd2=_0x4a3bd2-0x0;var _0x2ccfc9=_0xfb03[_0x4a3bd2];return _0x2ccfc9;};'use strict';var multer=require(_0x3fb0('0x0'));var util=require(_0x3fb0('0x1'));var path=require(_0x3fb0('0x2'));var timeout=require(_0x3fb0('0x3'));var express=require(_0x3fb0('0x4'));var router=express[_0x3fb0('0x5')]();var fs_extra=require(_0x3fb0('0x6'));var auth=require(_0x3fb0('0x7'));var interaction=require(_0x3fb0('0x8'));var config=require(_0x3fb0('0x9'));var controller=require(_0x3fb0('0xa'));router[_0x3fb0('0xb')]('/',auth['isAuthenticated'](),controller[_0x3fb0('0xc')]);router['get'](_0x3fb0('0xd'),auth[_0x3fb0('0xe')](),controller['describe']);router['get'](_0x3fb0('0xf'),auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x10')]);router[_0x3fb0('0xb')](_0x3fb0('0x11'),auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x12')]);router['get'](_0x3fb0('0x13'),auth['isAuthenticated'](),controller[_0x3fb0('0x14')]);router[_0x3fb0('0xb')](_0x3fb0('0x15'),auth[_0x3fb0('0xe')](),controller['getAgents']);router[_0x3fb0('0x16')]('/',auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x17')]);router[_0x3fb0('0x16')](_0x3fb0('0x13'),auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x18')]);router[_0x3fb0('0x16')](_0x3fb0('0x15'),auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x19')]);router['put'](_0x3fb0('0xf'),auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x1a')]);router[_0x3fb0('0x1b')](_0x3fb0('0xf'),auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x1c')]);router[_0x3fb0('0x1b')](_0x3fb0('0x13'),auth[_0x3fb0('0xe')](),controller['removeTeams']);router['delete'](_0x3fb0('0x15'),auth[_0x3fb0('0xe')](),controller[_0x3fb0('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index cebe78e..7722490 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 _0xf9da=['ENUM','rrmemory','beepall','sequelize','INTEGER'];(function(_0xd7bae9,_0x53ce66){var _0x3048fe=function(_0x4f49b6){while(--_0x4f49b6){_0xd7bae9['push'](_0xd7bae9['shift']());}};_0x3048fe(++_0x53ce66);}(_0xf9da,0x184));var _0xaf9d=function(_0x4577fb,_0x44c995){_0x4577fb=_0x4577fb-0x0;var _0x3be79e=_0xf9da[_0x4577fb];return _0x3be79e;};'use strict';var Sequelize=require(_0xaf9d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaf9d('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaf9d('0x2')](_0xaf9d('0x3'),_0xaf9d('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x666d=['ENUM','beepall','sequelize','STRING','name','INTEGER'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x666d,0x6e));var _0xd666=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x666d[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xd666('0x0'));module['exports']={'name':{'type':Sequelize[_0xd666('0x1')],'unique':_0xd666('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd666('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd666('0x4')]('rrmemory',_0xd666('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 7a3d27c..f35b201 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 _0xa54b=['rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','options','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','openchannelPause','getTeams','hasOwnProperty','addTeams','ids','Team','User','Agents','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','transaction','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','order','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','count','includeAll','include','findAll'];(function(_0x4c7a89,_0x2423dd){var _0x2e38db=function(_0x3f136c){while(--_0x3f136c){_0x4c7a89['push'](_0x4c7a89['shift']());}};_0x2e38db(++_0x2423dd);}(_0xa54b,0x1ed));var _0xba54=function(_0x186d3c,_0x18ec51){_0x186d3c=_0x186d3c-0x0;var _0x15b6ff=_0xa54b[_0x186d3c];return _0x15b6ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba54('0x0'));var jsonpatch=require(_0xba54('0x1'));var rp=require(_0xba54('0x2'));var moment=require(_0xba54('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xba54('0x4'));var util=require(_0xba54('0x5'));var path=require(_0xba54('0x6'));var sox=require(_0xba54('0x7'));var csv=require(_0xba54('0x8'));var ejs=require(_0xba54('0x9'));var fs=require('fs');var fs_extra=require(_0xba54('0xa'));var _=require('lodash');var squel=require(_0xba54('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba54('0xc'));var toCsv=require(_0xba54('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba54('0xd'));var authService=require(_0xba54('0xe'));var qs=require(_0xba54('0xf'));var as=require(_0xba54('0x10'));var hardwareService=require(_0xba54('0x11'));var logger=require(_0xba54('0x12'))(_0xba54('0x13'));var utils=require('../../config/utils');var config=require(_0xba54('0x14'));var licenseUtil=require(_0xba54('0x15'));var db=require(_0xba54('0x16'))['db'];config[_0xba54('0x17')]=_['defaults'](config[_0xba54('0x17')],{'host':_0xba54('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba54('0x17')]));require('./openchannelQueue.socket')[_0xba54('0x19')](socket);function respondWithStatusCode(_0x458b3d,_0x53b6cf){_0x53b6cf=_0x53b6cf||0xcc;return function(_0x152d97){if(_0x152d97){return _0x458b3d[_0xba54('0x1a')](_0x53b6cf);}return _0x458b3d['status'](_0x53b6cf)[_0xba54('0x1b')]();};}function respondWithResult(_0x4b0cca,_0x5317bf){_0x5317bf=_0x5317bf||0xc8;return function(_0x1c0e28){if(_0x1c0e28){return _0x4b0cca['status'](_0x5317bf)[_0xba54('0x1c')](_0x1c0e28);}};}function respondWithFilteredResult(_0x21d471,_0x28dda1){return function(_0x4a3d64){if(_0x4a3d64){var _0x1d807f=typeof _0x28dda1[_0xba54('0x1d')]===_0xba54('0x1e')&&typeof _0x28dda1[_0xba54('0x1f')]==='undefined';var _0x55f8ec=_0x4a3d64['count'];var _0xb12218=_0x1d807f?0x0:_0x28dda1['offset'];var _0x56d755=_0x1d807f?_0x4a3d64['count']:_0x28dda1[_0xba54('0x1d')]+_0x28dda1[_0xba54('0x1f')];var _0x48daef;if(_0x56d755>=_0x55f8ec){_0x56d755=_0x55f8ec;_0x48daef=0xc8;}else{_0x48daef=0xce;}_0x21d471[_0xba54('0x20')](_0x48daef);return _0x21d471[_0xba54('0x21')](_0xba54('0x22'),_0xb12218+'-'+_0x56d755+'/'+_0x55f8ec)['json'](_0x4a3d64);}return null;};}function patchUpdates(_0x48d385){return function(_0x58c883){try{jsonpatch[_0xba54('0x23')](_0x58c883,_0x48d385,!![]);}catch(_0x169344){return BPromise[_0xba54('0x24')](_0x169344);}return _0x58c883[_0xba54('0x25')]();};}function saveUpdates(_0x137586,_0x567d37){return function(_0x1047cd){if(_0x1047cd){return _0x1047cd[_0xba54('0x26')](_0x137586)[_0xba54('0x27')](function(_0x21b74d){return _0x21b74d;});}return null;};}function removeEntity(_0x2b7267,_0x86b22a){return function(_0xeec48f){if(_0xeec48f){return _0xeec48f[_0xba54('0x28')]()['then'](function(){var _0x59f710=_0xeec48f[_0xba54('0x29')]({'plain':!![]});var _0x5abc7e=_0xba54('0x2a');return db[_0xba54('0x2b')]['destroy']({'where':{'type':_0x5abc7e,'resourceId':_0x59f710['id']}})[_0xba54('0x27')](function(){return _0xeec48f;});})['then'](function(){_0x2b7267[_0xba54('0x20')](0xcc)[_0xba54('0x1b')]();});}};}function handleEntityNotFound(_0x46f09b,_0x1d0a04){return function(_0x2c221a){if(!_0x2c221a){_0x46f09b[_0xba54('0x1a')](0x194);}return _0x2c221a;};}function handleError(_0x1e08c6,_0x3b84ee){_0x3b84ee=_0x3b84ee||0x1f4;return function(_0x1ae2d8){logger['error'](_0x1ae2d8[_0xba54('0x2c')]);if(_0x1ae2d8['name']){delete _0x1ae2d8[_0xba54('0x2d')];}_0x1e08c6[_0xba54('0x20')](_0x3b84ee)[_0xba54('0x2e')](_0x1ae2d8);};}exports[_0xba54('0x2f')]=function(_0x1ed6cb,_0x422ded){var _0x4fef52={},_0x1eb42c={},_0xb97698={'count':0x0,'rows':[]};var _0x8785bb=_[_0xba54('0x30')](db[_0xba54('0x31')][_0xba54('0x32')],function(_0x4f61dc){return{'name':_0x4f61dc[_0xba54('0x33')],'type':_0x4f61dc['type'][_0xba54('0x34')]};});_0x1eb42c[_0xba54('0x35')]=_[_0xba54('0x30')](_0x8785bb,_0xba54('0x2d'));_0x1eb42c[_0xba54('0x36')]=_[_0xba54('0x37')](_0x1ed6cb[_0xba54('0x36')]);_0x1eb42c[_0xba54('0x38')]=_[_0xba54('0x39')](_0x1eb42c[_0xba54('0x35')],_0x1eb42c[_0xba54('0x36')]);_0x4fef52[_0xba54('0x3a')]=_[_0xba54('0x39')](_0x1eb42c['model'],qs[_0xba54('0x3b')](_0x1ed6cb[_0xba54('0x36')][_0xba54('0x3b')]));_0x4fef52[_0xba54('0x3a')]=_0x4fef52[_0xba54('0x3a')][_0xba54('0x3c')]?_0x4fef52['attributes']:_0x1eb42c[_0xba54('0x35')];if(!_0x1ed6cb[_0xba54('0x36')]['hasOwnProperty'](_0xba54('0x3d'))){_0x4fef52['limit']=qs[_0xba54('0x1f')](_0x1ed6cb['query'][_0xba54('0x1f')]);_0x4fef52[_0xba54('0x1d')]=qs[_0xba54('0x1d')](_0x1ed6cb[_0xba54('0x36')]['offset']);}_0x4fef52['order']=qs[_0xba54('0x3e')](_0x1ed6cb[_0xba54('0x36')][_0xba54('0x3e')]);_0x4fef52[_0xba54('0x3f')]=qs[_0xba54('0x38')](_['pick'](_0x1ed6cb['query'],_0x1eb42c[_0xba54('0x38')]),_0x8785bb);if(_0x1ed6cb[_0xba54('0x36')][_0xba54('0x40')]){_0x4fef52[_0xba54('0x3f')]=_[_0xba54('0x41')](_0x4fef52[_0xba54('0x3f')],{'$or':_[_0xba54('0x30')](_0x8785bb,function(_0x5ddaf1){if(_0x5ddaf1[_0xba54('0x42')]!=='VIRTUAL'){var _0x26e9d8={};_0x26e9d8[_0x5ddaf1['name']]={'$like':'%'+_0x1ed6cb[_0xba54('0x36')]['filter']+'%'};return _0x26e9d8;}})});}_0x4fef52=_[_0xba54('0x41')]({},_0x4fef52,_0x1ed6cb['options']);var _0x2f5db1={'where':_0x4fef52[_0xba54('0x3f')]};return db['OpenchannelQueue'][_0xba54('0x43')](_0x2f5db1)[_0xba54('0x27')](function(_0x51334a){_0xb97698[_0xba54('0x43')]=_0x51334a;if(_0x1ed6cb[_0xba54('0x36')][_0xba54('0x44')]){_0x4fef52[_0xba54('0x45')]=[{'all':!![]}];}return db[_0xba54('0x31')][_0xba54('0x46')](_0x4fef52);})[_0xba54('0x27')](function(_0x16c2fe){_0xb97698[_0xba54('0x47')]=_0x16c2fe;return _0xb97698;})['then'](respondWithFilteredResult(_0x422ded,_0x4fef52))[_0xba54('0x48')](handleError(_0x422ded,null));};exports[_0xba54('0x49')]=function(_0x12eae6,_0x5410e0){var _0x4ed836={'raw':!![],'where':{'id':_0x12eae6[_0xba54('0x4a')]['id']}},_0x146d1c={};_0x146d1c[_0xba54('0x35')]=_[_0xba54('0x37')](db[_0xba54('0x31')]['rawAttributes']);_0x146d1c[_0xba54('0x36')]=_[_0xba54('0x37')](_0x12eae6[_0xba54('0x36')]);_0x146d1c[_0xba54('0x38')]=_['intersection'](_0x146d1c[_0xba54('0x35')],_0x146d1c[_0xba54('0x36')]);_0x4ed836['attributes']=_[_0xba54('0x39')](_0x146d1c[_0xba54('0x35')],qs[_0xba54('0x3b')](_0x12eae6[_0xba54('0x36')]['fields']));_0x4ed836[_0xba54('0x3a')]=_0x4ed836[_0xba54('0x3a')][_0xba54('0x3c')]?_0x4ed836[_0xba54('0x3a')]:_0x146d1c[_0xba54('0x35')];if(_0x12eae6[_0xba54('0x36')][_0xba54('0x44')]){_0x4ed836['include']=[{'all':!![]}];}_0x4ed836=_[_0xba54('0x41')]({},_0x4ed836,_0x12eae6['options']);return db[_0xba54('0x31')]['find'](_0x4ed836)[_0xba54('0x27')](handleEntityNotFound(_0x5410e0,null))['then'](respondWithResult(_0x5410e0,null))[_0xba54('0x48')](handleError(_0x5410e0,null));};exports[_0xba54('0x4b')]=function(_0xd5ea6c,_0x15ce80){return db[_0xba54('0x31')][_0xba54('0x4b')](_0xd5ea6c['body'],{})['then'](function(_0x6303c0){var _0x300092=_0xd5ea6c['user'][_0xba54('0x29')]({'plain':!![]});if(!_0x300092)throw new Error(_0xba54('0x4c'));if(_0x300092[_0xba54('0x4d')]===_0xba54('0x4e')){var _0xf7a7dc=_0x6303c0[_0xba54('0x29')]({'plain':!![]});var _0x39e0a0=_0xba54('0x2a');return db[_0xba54('0x4f')][_0xba54('0x50')]({'where':{'name':_0x39e0a0,'userProfileId':_0x300092['userProfileId']},'raw':!![]})[_0xba54('0x27')](function(_0x40f129){if(_0x40f129&&_0x40f129[_0xba54('0x51')]===0x0){return db[_0xba54('0x2b')][_0xba54('0x4b')]({'name':_0xf7a7dc[_0xba54('0x2d')],'resourceId':_0xf7a7dc['id'],'type':_0x40f129[_0xba54('0x2d')],'sectionId':_0x40f129['id']},{})[_0xba54('0x27')](function(){return _0x6303c0;});}else{return _0x6303c0;}})[_0xba54('0x48')](function(_0x35d6b9){logger[_0xba54('0x52')](_0xba54('0x53'),_0x35d6b9);throw _0x35d6b9;});}return _0x6303c0;})[_0xba54('0x27')](respondWithResult(_0x15ce80,0xc9))[_0xba54('0x48')](handleError(_0x15ce80,null));};exports['update']=function(_0x57d947,_0x19b539){if(_0x57d947[_0xba54('0x54')]['id']){delete _0x57d947['body']['id'];}return db[_0xba54('0x31')][_0xba54('0x50')]({'where':{'id':_0x57d947['params']['id']}})[_0xba54('0x27')](handleEntityNotFound(_0x19b539,null))[_0xba54('0x27')](saveUpdates(_0x57d947[_0xba54('0x54')],null))[_0xba54('0x27')](respondWithResult(_0x19b539,null))[_0xba54('0x48')](handleError(_0x19b539,null));};exports[_0xba54('0x28')]=function(_0x9903b2,_0x527c66){return db[_0xba54('0x31')]['find']({'where':{'id':_0x9903b2[_0xba54('0x4a')]['id']}})['then'](handleEntityNotFound(_0x527c66,null))['then'](removeEntity(_0x527c66,null))['catch'](handleError(_0x527c66,null));};exports[_0xba54('0x55')]=function(_0x3bd189,_0x68de43){return db['OpenchannelQueue'][_0xba54('0x55')]()[_0xba54('0x27')](respondWithResult(_0x68de43,null))[_0xba54('0x48')](handleError(_0x68de43,null));};exports[_0xba54('0x56')]=function(_0x23b7a7,_0x543a21,_0x14835b){var _0x2987d8={'raw':!![],'where':{}},_0x2d7e7d={},_0x4bc552;return db[_0xba54('0x31')][_0xba54('0x57')]({'where':{'id':_0x23b7a7[_0xba54('0x4a')]['id']}})[_0xba54('0x27')](handleEntityNotFound(_0x543a21,null))[_0xba54('0x27')](function(_0x58e036){if(_0x58e036){_0x4bc552=_0x58e036[_0xba54('0x29')]({'plain':!![]});_0x2d7e7d['model']=_['keys'](db[_0xba54('0x58')][_0xba54('0x32')]);_0x2d7e7d[_0xba54('0x36')]=_[_0xba54('0x37')](_0x23b7a7[_0xba54('0x36')]);_0x2d7e7d['filters']=_[_0xba54('0x39')](_0x2d7e7d[_0xba54('0x35')],_0x2d7e7d[_0xba54('0x36')]);_0x2987d8[_0xba54('0x3a')]=_[_0xba54('0x39')](_0x2d7e7d[_0xba54('0x35')],qs[_0xba54('0x3b')](_0x23b7a7[_0xba54('0x36')][_0xba54('0x3b')]));_0x2987d8[_0xba54('0x3a')]=_0x2987d8[_0xba54('0x3a')][_0xba54('0x3c')]?_0x2987d8[_0xba54('0x3a')]:_0x2d7e7d[_0xba54('0x35')];if(!_0x23b7a7[_0xba54('0x36')]['hasOwnProperty'](_0xba54('0x3d'))){_0x2987d8[_0xba54('0x1f')]=qs[_0xba54('0x1f')](_0x23b7a7[_0xba54('0x36')][_0xba54('0x1f')]);_0x2987d8['offset']=qs[_0xba54('0x1d')](_0x23b7a7[_0xba54('0x36')][_0xba54('0x1d')]);}_0x2987d8['order']=qs[_0xba54('0x3e')](_0x23b7a7[_0xba54('0x36')]['sort']);_0x2987d8[_0xba54('0x3f')]=qs[_0xba54('0x38')](_[_0xba54('0x59')](_0x23b7a7[_0xba54('0x36')],_0x2d7e7d[_0xba54('0x38')]));_0x2987d8['where'][_0xba54('0x5a')]=_0x58e036['id'];if(_0x23b7a7[_0xba54('0x36')][_0xba54('0x40')]){_0x2987d8[_0xba54('0x3f')]=_[_0xba54('0x41')](_0x2987d8['where'],{'$or':_[_0xba54('0x30')](_0x2987d8[_0xba54('0x3a')],function(_0x199a00){var _0x180d90={};_0x180d90[_0x199a00]={'$like':'%'+_0x23b7a7['query'][_0xba54('0x40')]+'%'};return _0x180d90;})});}_0x2987d8=_[_0xba54('0x41')]({},_0x2987d8,_0x23b7a7[_0xba54('0x5b')]);return db[_0xba54('0x58')][_0xba54('0x46')](_0x2987d8);}})[_0xba54('0x27')](function(_0x21379d){if(_0x21379d){return db['User'][_0xba54('0x5c')]({'where':{'id':_[_0xba54('0x30')](_0x21379d,'UserId'),'role':_0xba54('0x5d')},'attributes':['id',_0xba54('0x2d'),'openchannelPause',_0xba54('0x5e'),'createdAt']});}})[_0xba54('0x27')](function(_0x557a71){if(_0x557a71){return{'count':_0x557a71[_0xba54('0x43')],'rows':_['map'](_0x557a71[_0xba54('0x47')],function(_0x4201aa){return{'membername':_0x4201aa[_0xba54('0x2d')],'UserId':_0x4201aa['id'],'queue_name':_0x4bc552[_0xba54('0x2d')],'OpenchannelQueueId':_0x4bc552['id'],'interface':util[_0xba54('0x5f')](_0xba54('0x60'),_0xba54('0x61'),_0x4201aa['name']),'penalty':0x0,'paused':_0x4201aa[_0xba54('0x62')],'createdAt':_0x4201aa['createdAt'],'updatedAt':_0x4201aa[_0xba54('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x543a21,_0x2987d8))['catch'](handleError(_0x543a21,null));};exports[_0xba54('0x63')]=function(_0x1d252c,_0x25e61a,_0x18cb62){var _0x10324f={};var _0x32611c={};var _0x1a6c16;var _0x2f46eb;return db[_0xba54('0x31')]['findOne']({'where':{'id':_0x1d252c[_0xba54('0x4a')]['id']}})[_0xba54('0x27')](handleEntityNotFound(_0x25e61a,null))[_0xba54('0x27')](function(_0x4e569d){if(_0x4e569d){_0x1a6c16=_0x4e569d;_0x32611c[_0xba54('0x35')]=_[_0xba54('0x37')](db['Team'][_0xba54('0x32')]);_0x32611c[_0xba54('0x36')]=_[_0xba54('0x37')](_0x1d252c[_0xba54('0x36')]);_0x32611c[_0xba54('0x38')]=_[_0xba54('0x39')](_0x32611c['model'],_0x32611c['query']);_0x10324f['attributes']=_[_0xba54('0x39')](_0x32611c[_0xba54('0x35')],qs[_0xba54('0x3b')](_0x1d252c[_0xba54('0x36')][_0xba54('0x3b')]));_0x10324f['attributes']=_0x10324f[_0xba54('0x3a')][_0xba54('0x3c')]?_0x10324f['attributes']:_0x32611c[_0xba54('0x35')];_0x10324f['order']=qs[_0xba54('0x3e')](_0x1d252c[_0xba54('0x36')][_0xba54('0x3e')]);_0x10324f[_0xba54('0x3f')]=qs['filters'](_[_0xba54('0x59')](_0x1d252c[_0xba54('0x36')],_0x32611c[_0xba54('0x38')]));if(_0x1d252c['query'][_0xba54('0x40')]){_0x10324f[_0xba54('0x3f')]=_[_0xba54('0x41')](_0x10324f['where'],{'$or':_['map'](_0x10324f[_0xba54('0x3a')],function(_0x4f90fc){var _0x59f771={};_0x59f771[_0x4f90fc]={'$like':'%'+_0x1d252c[_0xba54('0x36')]['filter']+'%'};return _0x59f771;})});}_0x10324f=_[_0xba54('0x41')]({},_0x10324f,_0x1d252c[_0xba54('0x5b')]);return _0x1a6c16[_0xba54('0x63')](_0x10324f);}})[_0xba54('0x27')](function(_0x3da994){if(_0x3da994){_0x2f46eb=_0x3da994[_0xba54('0x3c')];if(!_0x1d252c[_0xba54('0x36')][_0xba54('0x64')](_0xba54('0x3d'))){_0x10324f[_0xba54('0x1f')]=qs[_0xba54('0x1f')](_0x1d252c[_0xba54('0x36')]['limit']);_0x10324f[_0xba54('0x1d')]=qs[_0xba54('0x1d')](_0x1d252c[_0xba54('0x36')][_0xba54('0x1d')]);}return _0x1a6c16[_0xba54('0x63')](_0x10324f);}})[_0xba54('0x27')](function(_0x292c2c){if(_0x292c2c){return _0x292c2c?{'count':_0x2f46eb,'rows':_0x292c2c}:null;}})[_0xba54('0x27')](respondWithResult(_0x25e61a,null))[_0xba54('0x48')](handleError(_0x25e61a,null));};exports[_0xba54('0x65')]=function(_0x2e1af7,_0x2d0805,_0x370d0b){var _0x4cba08=_0x2e1af7['body'][_0xba54('0x66')];return db[_0xba54('0x67')][_0xba54('0x46')]({'where':{'id':_0x4cba08},'attributes':['id'],'include':[{'model':db[_0xba54('0x68')],'as':_0xba54('0x69'),'attributes':['id',_0xba54('0x2d'),'online',_0xba54('0x6a'),_0xba54('0x6b')],'raw':!![]}]})[_0xba54('0x27')](function(_0x2fe87e){if(_0x2fe87e){var _0x234f7b=_[_0xba54('0x6c')](_0x2fe87e,function(_0x4bb59d){var _0x4d9224=_0x4bb59d['get']({'plain':!![]});return _0x4d9224[_0xba54('0x69')];});return db[_0xba54('0x31')]['find']({'where':{'id':_0x2e1af7[_0xba54('0x4a')]['id']}})[_0xba54('0x27')](function(_0x53bd1d){return db['sequelize']['transaction'](function(_0x410e2f){return _0x53bd1d['addTeams'](_0x4cba08,{'transaction':_0x410e2f})['then'](function(){return BPromise[_0xba54('0x6d')](_0x234f7b,function(_0x23c3c5){return db['UserOpenchannelQueue'][_0xba54('0x6e')]({'where':{'UserId':_0x23c3c5['id'],'OpenchannelQueueId':_0x2e1af7['params']['id']},'transaction':_0x410e2f});});})[_0xba54('0x27')](function(){_0x234f7b[_0xba54('0x6f')](function(_0x45399c){socket[_0xba54('0x70')](_0xba54('0x71'),{'UserId':_0x45399c['id'],'OpenchannelQueueId':_0x53bd1d['id']});});});});});}})[_0xba54('0x27')](respondWithStatusCode(_0x2d0805,null))['catch'](handleError(_0x2d0805,null));};exports['removeTeams']=function(_0x22bbbd,_0x2faa8d,_0x2629d2){return db[_0xba54('0x67')]['findAll']({'where':{'id':_0x22bbbd['query'][_0xba54('0x66')]},'attributes':['id'],'include':[{'model':db[_0xba54('0x68')],'as':_0xba54('0x69'),'attributes':['id'],'raw':!![]}]})[_0xba54('0x27')](handleEntityNotFound(_0x2faa8d,null))[_0xba54('0x27')](function(_0x4ee88c){var _0x36d742=_[_0xba54('0x30')](_0x4ee88c,'id');var _0x27facb=[];var _0x356eee=[];var _0x193bcb=squel[_0xba54('0x72')]();_0x193bcb[_0xba54('0x73')](_0xba54('0x74'))['from'](_0xba54('0x75'),'tq')[_0xba54('0x76')]('user_has_teams','ut',_0xba54('0x77'))[_0xba54('0x3f')](_0xba54('0x78'),_0x22bbbd[_0xba54('0x4a')]['id']);for(var _0x38d875=0x0;_0x38d875<_0x4ee88c[_0xba54('0x3c')];_0x38d875+=0x1){let _0x16a85a=_0x4ee88c[_0x38d875];for(var _0x1f6189=0x0;_0x1f6189<_0x16a85a[_0xba54('0x69')][_0xba54('0x3c')];_0x1f6189+=0x1){let _0x47fd71=_0x16a85a[_0xba54('0x69')][_0x1f6189];var _0x1126a5=_0x193bcb['clone']();_0x1126a5[_0xba54('0x3f')](_0xba54('0x79'),_0x47fd71['id']);_0x356eee['push'](db[_0xba54('0x7a')][_0xba54('0x36')](_0x1126a5[_0xba54('0x7b')](),{'type':db[_0xba54('0x7a')][_0xba54('0x7c')][_0xba54('0x7d')]})[_0xba54('0x27')](function(_0x3b7daa){if(_0x3b7daa[_0xba54('0x3c')]===0x1){return _0x47fd71['id'];}else{var _0x5ec1ae=_[_0xba54('0x7e')](_[_0xba54('0x30')](_0x3b7daa,_0xba54('0x7f')),function(_0x2e6022){return _[_0xba54('0x80')](_0x36d742,_0x2e6022);});if(_0x5ec1ae){return _0x47fd71['id'];}}}));}}return BPromise['all'](_0x356eee)['then'](function(_0x5de774){_0x27facb=_(_0x27facb)[_0xba54('0x81')](_0x5de774)['compact']()[_0xba54('0x82')]();return db[_0xba54('0x31')][_0xba54('0x50')]({'where':{'id':_0x22bbbd[_0xba54('0x4a')]['id']}})[_0xba54('0x27')](function(_0x50cfb8){return db[_0xba54('0x7a')][_0xba54('0x83')](function(_0x59a52b){return _0x50cfb8[_0xba54('0x84')](_0x22bbbd['query']['ids'],{'transaction':_0x59a52b})[_0xba54('0x27')](function(){if(!_[_0xba54('0x85')](_0x27facb)){return _0x50cfb8[_0xba54('0x86')](_0x27facb,{'transaction':_0x59a52b});}})[_0xba54('0x27')](function(){_0x27facb[_0xba54('0x6f')](function(_0xd14933){socket[_0xba54('0x70')](_0xba54('0x87'),{'UserId':_0xd14933,'OpenchannelQueueId':_0x50cfb8['id']});});});});});});})[_0xba54('0x27')](respondWithStatusCode(_0x2faa8d,null))['catch'](handleError(_0x2faa8d,null));};exports['addAgents']=function(_0x4c83ef,_0x5cb4e5,_0x14e76c){return db['OpenchannelQueue'][_0xba54('0x50')]({'where':{'id':_0x4c83ef[_0xba54('0x4a')]['id']}})[_0xba54('0x27')](handleEntityNotFound(_0x5cb4e5,null))[_0xba54('0x27')](function(_0x1f7e52){if(_0x1f7e52){return _0x1f7e52['addAgents'](_0x4c83ef[_0xba54('0x54')][_0xba54('0x66')],_[_0xba54('0x88')](_0x4c83ef[_0xba54('0x54')],[_0xba54('0x66'),'id'])||{})[_0xba54('0x89')](function(_0x42da88){for(var _0xd474d=0x0;_0xd474d<_0x4c83ef[_0xba54('0x54')][_0xba54('0x66')][_0xba54('0x3c')];_0xd474d+=0x1){socket[_0xba54('0x70')]('userOpenchannelQueue:save',{'UserId':Number(_0x4c83ef['body'][_0xba54('0x66')][_0xd474d]),'OpenchannelQueueId':Number(_0x4c83ef[_0xba54('0x4a')]['id'])});}return _0x42da88;});}})[_0xba54('0x27')](respondWithResult(_0x5cb4e5,null))[_0xba54('0x48')](handleError(_0x5cb4e5,null));};exports[_0xba54('0x86')]=function(_0xb38517,_0x6afcd9,_0x224a7a){return db[_0xba54('0x31')][_0xba54('0x50')]({'where':{'id':_0xb38517[_0xba54('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6afcd9,null))[_0xba54('0x27')](function(_0x190ab3){if(_0x190ab3){return _0x190ab3['removeAgents'](_0xb38517[_0xba54('0x36')][_0xba54('0x66')])['then'](function(){if(_[_0xba54('0x8a')](_0xb38517['query'][_0xba54('0x66')])){for(var _0x3999df=0x0;_0x3999df<_0xb38517[_0xba54('0x36')][_0xba54('0x66')]['length'];_0x3999df+=0x1){socket[_0xba54('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0xb38517[_0xba54('0x36')][_0xba54('0x66')][_0x3999df]),'OpenchannelQueueId':Number(_0xb38517['params']['id'])});}}else{socket[_0xba54('0x70')](_0xba54('0x87'),{'UserId':Number(_0xb38517[_0xba54('0x36')][_0xba54('0x66')]),'OpenchannelQueueId':Number(_0xb38517[_0xba54('0x4a')]['id'])});}});}})[_0xba54('0x27')](respondWithStatusCode(_0x6afcd9,null))[_0xba54('0x48')](handleError(_0x6afcd9,null));};exports[_0xba54('0x8b')]=function(_0x3e8f00,_0x45ffab,_0x1d8ac7){var _0x3d3a99={};var _0x4ae02b={};var _0xa38a2;var _0x18f6c7;return db[_0xba54('0x31')]['findOne']({'where':{'id':_0x3e8f00[_0xba54('0x4a')]['id']}})[_0xba54('0x27')](handleEntityNotFound(_0x45ffab,null))[_0xba54('0x27')](function(_0x45e88a){if(_0x45e88a){_0xa38a2=_0x45e88a;_0x4ae02b[_0xba54('0x35')]=_['keys'](db[_0xba54('0x68')][_0xba54('0x32')]);_0x4ae02b[_0xba54('0x36')]=_[_0xba54('0x37')](_0x3e8f00['query']);_0x4ae02b['filters']=_[_0xba54('0x39')](_0x4ae02b[_0xba54('0x35')],_0x4ae02b[_0xba54('0x36')]);_0x3d3a99[_0xba54('0x3a')]=_[_0xba54('0x39')](_0x4ae02b['model'],qs['fields'](_0x3e8f00[_0xba54('0x36')]['fields']));_0x3d3a99[_0xba54('0x3a')]=_0x3d3a99[_0xba54('0x3a')]['length']?_0x3d3a99[_0xba54('0x3a')]:_0x4ae02b[_0xba54('0x35')];_0x3d3a99[_0xba54('0x8c')]=qs[_0xba54('0x3e')](_0x3e8f00[_0xba54('0x36')][_0xba54('0x3e')]);_0x3d3a99[_0xba54('0x3f')]=qs['filters'](_[_0xba54('0x59')](_0x3e8f00[_0xba54('0x36')],_0x4ae02b[_0xba54('0x38')]));if(_0x3e8f00[_0xba54('0x36')][_0xba54('0x40')]){_0x3d3a99[_0xba54('0x3f')]=_['merge'](_0x3d3a99['where'],{'$or':_[_0xba54('0x30')](_0x3d3a99[_0xba54('0x3a')],function(_0x48dee0){var _0x237ccb={};_0x237ccb[_0x48dee0]={'$like':'%'+_0x3e8f00[_0xba54('0x36')][_0xba54('0x40')]+'%'};return _0x237ccb;})});}_0x3d3a99=_['merge']({},_0x3d3a99,_0x3e8f00[_0xba54('0x5b')]);return _0xa38a2[_0xba54('0x8b')](_0x3d3a99);}})[_0xba54('0x27')](function(_0x442ebf){if(_0x442ebf){_0x18f6c7=_0x442ebf['length'];if(!_0x3e8f00[_0xba54('0x36')][_0xba54('0x64')](_0xba54('0x3d'))){_0x3d3a99[_0xba54('0x1f')]=qs[_0xba54('0x1f')](_0x3e8f00[_0xba54('0x36')][_0xba54('0x1f')]);_0x3d3a99[_0xba54('0x1d')]=qs['offset'](_0x3e8f00[_0xba54('0x36')][_0xba54('0x1d')]);}return _0xa38a2[_0xba54('0x8b')](_0x3d3a99);}})[_0xba54('0x27')](function(_0xd9b6aa){if(_0xd9b6aa){return _0xd9b6aa?{'count':_0x18f6c7,'rows':_0xd9b6aa}:null;}})[_0xba54('0x27')](respondWithResult(_0x45ffab,null))['catch'](handleError(_0x45ffab,null));}; \ No newline at end of file +var _0x59fe=['findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','map','OpenchannelQueue','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','rows','catch','show','params','rawAttributes','length','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','pick','OpenchannelQueueId','UserOpenchannelQueue','findAll','User','UserId','agent','openchannelPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each'];(function(_0x46d0f9,_0x1125ef){var _0xc8c043=function(_0x1c850c){while(--_0x1c850c){_0x46d0f9['push'](_0x46d0f9['shift']());}};_0xc8c043(++_0x1125ef);}(_0x59fe,0xa0));var _0xe59f=function(_0x280805,_0x25cf27){_0x280805=_0x280805-0x0;var _0x4a4e3f=_0x59fe[_0x280805];return _0x4a4e3f;};'use strict';var emlformat=require(_0xe59f('0x0'));var rimraf=require(_0xe59f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe59f('0x2'));var moment=require(_0xe59f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe59f('0x4'));var util=require(_0xe59f('0x5'));var path=require('path');var sox=require(_0xe59f('0x6'));var csv=require(_0xe59f('0x7'));var ejs=require(_0xe59f('0x8'));var fs=require('fs');var fs_extra=require(_0xe59f('0x9'));var _=require(_0xe59f('0xa'));var squel=require(_0xe59f('0xb'));var crypto=require('crypto');var jsforce=require(_0xe59f('0xc'));var deskjs=require(_0xe59f('0xd'));var toCsv=require(_0xe59f('0x7'));var querystring=require(_0xe59f('0xe'));var Papa=require(_0xe59f('0xf'));var Redis=require(_0xe59f('0x10'));var authService=require(_0xe59f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe59f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe59f('0x13'));var config=require(_0xe59f('0x14'));var licenseUtil=require(_0xe59f('0x15'));var db=require('../../mysqldb')['db'];config[_0xe59f('0x16')]=_[_0xe59f('0x17')](config[_0xe59f('0x16')],{'host':_0xe59f('0x18'),'port':0x18eb});var socket=require(_0xe59f('0x19'))(new Redis(config[_0xe59f('0x16')]));require(_0xe59f('0x1a'))[_0xe59f('0x1b')](socket);function respondWithStatusCode(_0x5f3b4e,_0xc597b7){_0xc597b7=_0xc597b7||0xcc;return function(_0x486aed){if(_0x486aed){return _0x5f3b4e[_0xe59f('0x1c')](_0xc597b7);}return _0x5f3b4e['status'](_0xc597b7)[_0xe59f('0x1d')]();};}function respondWithResult(_0x5223bf,_0x2842d9){_0x2842d9=_0x2842d9||0xc8;return function(_0xbc778d){if(_0xbc778d){return _0x5223bf[_0xe59f('0x1e')](_0x2842d9)[_0xe59f('0x1f')](_0xbc778d);}};}function respondWithFilteredResult(_0x524f13,_0x12ee45){return function(_0x4398c2){if(_0x4398c2){var _0x13d82b=typeof _0x12ee45[_0xe59f('0x20')]===_0xe59f('0x21')&&typeof _0x12ee45[_0xe59f('0x22')]===_0xe59f('0x21');var _0xc4eeaf=_0x4398c2[_0xe59f('0x23')];var _0x22f2a5=_0x13d82b?0x0:_0x12ee45['offset'];var _0x405356=_0x13d82b?_0x4398c2[_0xe59f('0x23')]:_0x12ee45[_0xe59f('0x20')]+_0x12ee45['limit'];var _0x573204;if(_0x405356>=_0xc4eeaf){_0x405356=_0xc4eeaf;_0x573204=0xc8;}else{_0x573204=0xce;}_0x524f13['status'](_0x573204);return _0x524f13['set'](_0xe59f('0x24'),_0x22f2a5+'-'+_0x405356+'/'+_0xc4eeaf)['json'](_0x4398c2);}return null;};}function patchUpdates(_0x2e9f16){return function(_0x1cb8cf){try{jsonpatch['apply'](_0x1cb8cf,_0x2e9f16,!![]);}catch(_0x5a140f){return BPromise['reject'](_0x5a140f);}return _0x1cb8cf[_0xe59f('0x25')]();};}function saveUpdates(_0xd18718,_0xfb9dde){return function(_0x5c8f53){if(_0x5c8f53){return _0x5c8f53['update'](_0xd18718)[_0xe59f('0x26')](function(_0x2e719c){return _0x2e719c;});}return null;};}function removeEntity(_0x414c5d,_0x563e6e){return function(_0x41ee68){if(_0x41ee68){return _0x41ee68[_0xe59f('0x27')]()[_0xe59f('0x26')](function(){var _0x277a53=_0x41ee68[_0xe59f('0x28')]({'plain':!![]});var _0x50f5e6=_0xe59f('0x29');return db[_0xe59f('0x2a')][_0xe59f('0x27')]({'where':{'type':_0x50f5e6,'resourceId':_0x277a53['id']}})['then'](function(){return _0x41ee68;});})[_0xe59f('0x26')](function(){_0x414c5d[_0xe59f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40db22,_0x2e9b8e){return function(_0x52077b){if(!_0x52077b){_0x40db22[_0xe59f('0x1c')](0x194);}return _0x52077b;};}function handleError(_0x444ebd,_0xaf935f){_0xaf935f=_0xaf935f||0x1f4;return function(_0xb3aef7){logger[_0xe59f('0x2b')](_0xb3aef7[_0xe59f('0x2c')]);if(_0xb3aef7[_0xe59f('0x2d')]){delete _0xb3aef7[_0xe59f('0x2d')];}_0x444ebd[_0xe59f('0x1e')](_0xaf935f)['send'](_0xb3aef7);};}exports['index']=function(_0x2dd038,_0x2d7dfc){var _0x4a81d5={},_0x8d3307={},_0x2853ca={'count':0x0,'rows':[]};var _0x5c3fe9=_[_0xe59f('0x2e')](db[_0xe59f('0x2f')]['rawAttributes'],function(_0x5f2723){return{'name':_0x5f2723[_0xe59f('0x30')],'type':_0x5f2723[_0xe59f('0x31')]['key']};});_0x8d3307['model']=_[_0xe59f('0x2e')](_0x5c3fe9,'name');_0x8d3307[_0xe59f('0x32')]=_[_0xe59f('0x33')](_0x2dd038[_0xe59f('0x32')]);_0x8d3307[_0xe59f('0x34')]=_[_0xe59f('0x35')](_0x8d3307[_0xe59f('0x36')],_0x8d3307[_0xe59f('0x32')]);_0x4a81d5[_0xe59f('0x37')]=_[_0xe59f('0x35')](_0x8d3307[_0xe59f('0x36')],qs[_0xe59f('0x38')](_0x2dd038[_0xe59f('0x32')][_0xe59f('0x38')]));_0x4a81d5[_0xe59f('0x37')]=_0x4a81d5[_0xe59f('0x37')]['length']?_0x4a81d5[_0xe59f('0x37')]:_0x8d3307[_0xe59f('0x36')];if(!_0x2dd038[_0xe59f('0x32')][_0xe59f('0x39')](_0xe59f('0x3a'))){_0x4a81d5[_0xe59f('0x22')]=qs['limit'](_0x2dd038[_0xe59f('0x32')][_0xe59f('0x22')]);_0x4a81d5['offset']=qs['offset'](_0x2dd038[_0xe59f('0x32')]['offset']);}_0x4a81d5[_0xe59f('0x3b')]=qs[_0xe59f('0x3c')](_0x2dd038[_0xe59f('0x32')]['sort']);_0x4a81d5[_0xe59f('0x3d')]=qs[_0xe59f('0x34')](_['pick'](_0x2dd038['query'],_0x8d3307[_0xe59f('0x34')]),_0x5c3fe9);if(_0x2dd038[_0xe59f('0x32')]['filter']){_0x4a81d5[_0xe59f('0x3d')]=_['merge'](_0x4a81d5[_0xe59f('0x3d')],{'$or':_[_0xe59f('0x2e')](_0x5c3fe9,function(_0x5d8d2f){if(_0x5d8d2f['type']!==_0xe59f('0x3e')){var _0x197b27={};_0x197b27[_0x5d8d2f[_0xe59f('0x2d')]]={'$like':'%'+_0x2dd038['query'][_0xe59f('0x3f')]+'%'};return _0x197b27;}})});}_0x4a81d5=_[_0xe59f('0x40')]({},_0x4a81d5,_0x2dd038[_0xe59f('0x41')]);var _0x585de3={'where':_0x4a81d5[_0xe59f('0x3d')]};return db[_0xe59f('0x2f')][_0xe59f('0x23')](_0x585de3)[_0xe59f('0x26')](function(_0x3cb145){_0x2853ca[_0xe59f('0x23')]=_0x3cb145;if(_0x2dd038[_0xe59f('0x32')]['includeAll']){_0x4a81d5['include']=[{'all':!![]}];}return db[_0xe59f('0x2f')]['findAll'](_0x4a81d5);})[_0xe59f('0x26')](function(_0x57387e){_0x2853ca[_0xe59f('0x42')]=_0x57387e;return _0x2853ca;})['then'](respondWithFilteredResult(_0x2d7dfc,_0x4a81d5))[_0xe59f('0x43')](handleError(_0x2d7dfc,null));};exports[_0xe59f('0x44')]=function(_0x1c143d,_0x4649b7){var _0x3a94e7={'raw':!![],'where':{'id':_0x1c143d[_0xe59f('0x45')]['id']}},_0x505195={};_0x505195['model']=_[_0xe59f('0x33')](db[_0xe59f('0x2f')][_0xe59f('0x46')]);_0x505195[_0xe59f('0x32')]=_[_0xe59f('0x33')](_0x1c143d[_0xe59f('0x32')]);_0x505195[_0xe59f('0x34')]=_['intersection'](_0x505195['model'],_0x505195[_0xe59f('0x32')]);_0x3a94e7[_0xe59f('0x37')]=_['intersection'](_0x505195['model'],qs[_0xe59f('0x38')](_0x1c143d[_0xe59f('0x32')][_0xe59f('0x38')]));_0x3a94e7[_0xe59f('0x37')]=_0x3a94e7[_0xe59f('0x37')][_0xe59f('0x47')]?_0x3a94e7[_0xe59f('0x37')]:_0x505195[_0xe59f('0x36')];if(_0x1c143d['query'][_0xe59f('0x48')]){_0x3a94e7[_0xe59f('0x49')]=[{'all':!![]}];}_0x3a94e7=_['merge']({},_0x3a94e7,_0x1c143d[_0xe59f('0x41')]);return db['OpenchannelQueue']['find'](_0x3a94e7)['then'](handleEntityNotFound(_0x4649b7,null))[_0xe59f('0x26')](respondWithResult(_0x4649b7,null))['catch'](handleError(_0x4649b7,null));};exports['create']=function(_0x322edf,_0xc01129){return db[_0xe59f('0x2f')][_0xe59f('0x4a')](_0x322edf['body'],{})[_0xe59f('0x26')](function(_0x10fc0b){var _0x5e4099=_0x322edf[_0xe59f('0x4b')][_0xe59f('0x28')]({'plain':!![]});if(!_0x5e4099)throw new Error(_0xe59f('0x4c'));if(_0x5e4099[_0xe59f('0x4d')]===_0xe59f('0x4b')){var _0x46f895=_0x10fc0b['get']({'plain':!![]});var _0x2a914c=_0xe59f('0x29');return db['UserProfileSection'][_0xe59f('0x4e')]({'where':{'name':_0x2a914c,'userProfileId':_0x5e4099[_0xe59f('0x4f')]},'raw':!![]})[_0xe59f('0x26')](function(_0xdbf7a4){if(_0xdbf7a4&&_0xdbf7a4['autoAssociation']===0x0){return db[_0xe59f('0x2a')][_0xe59f('0x4a')]({'name':_0x46f895['name'],'resourceId':_0x46f895['id'],'type':_0xdbf7a4['name'],'sectionId':_0xdbf7a4['id']},{})['then'](function(){return _0x10fc0b;});}else{return _0x10fc0b;}})[_0xe59f('0x43')](function(_0x4a978b){logger[_0xe59f('0x2b')](_0xe59f('0x50'),_0x4a978b);throw _0x4a978b;});}return _0x10fc0b;})['then'](respondWithResult(_0xc01129,0xc9))[_0xe59f('0x43')](handleError(_0xc01129,null));};exports[_0xe59f('0x51')]=function(_0x319bfb,_0x5ef876){if(_0x319bfb[_0xe59f('0x52')]['id']){delete _0x319bfb['body']['id'];}return db[_0xe59f('0x2f')]['find']({'where':{'id':_0x319bfb[_0xe59f('0x45')]['id']}})[_0xe59f('0x26')](handleEntityNotFound(_0x5ef876,null))[_0xe59f('0x26')](saveUpdates(_0x319bfb[_0xe59f('0x52')],null))[_0xe59f('0x26')](respondWithResult(_0x5ef876,null))['catch'](handleError(_0x5ef876,null));};exports[_0xe59f('0x27')]=function(_0x51eb50,_0x10eba3){return db[_0xe59f('0x2f')][_0xe59f('0x4e')]({'where':{'id':_0x51eb50[_0xe59f('0x45')]['id']}})['then'](handleEntityNotFound(_0x10eba3,null))[_0xe59f('0x26')](removeEntity(_0x10eba3,null))[_0xe59f('0x43')](handleError(_0x10eba3,null));};exports[_0xe59f('0x53')]=function(_0x3d943a,_0x311e93){return db[_0xe59f('0x2f')]['describe']()['then'](respondWithResult(_0x311e93,null))['catch'](handleError(_0x311e93,null));};exports[_0xe59f('0x54')]=function(_0x5c11dd,_0x8948a5,_0xf288e7){var _0x48bd93={'raw':!![],'where':{}},_0x207d27={},_0x2ea7de;return db[_0xe59f('0x2f')][_0xe59f('0x55')]({'where':{'id':_0x5c11dd['params']['id']}})[_0xe59f('0x26')](handleEntityNotFound(_0x8948a5,null))[_0xe59f('0x26')](function(_0x30e840){if(_0x30e840){_0x2ea7de=_0x30e840[_0xe59f('0x28')]({'plain':!![]});_0x207d27[_0xe59f('0x36')]=_[_0xe59f('0x33')](db['UserOpenchannelQueue'][_0xe59f('0x46')]);_0x207d27['query']=_[_0xe59f('0x33')](_0x5c11dd[_0xe59f('0x32')]);_0x207d27['filters']=_[_0xe59f('0x35')](_0x207d27[_0xe59f('0x36')],_0x207d27[_0xe59f('0x32')]);_0x48bd93[_0xe59f('0x37')]=_[_0xe59f('0x35')](_0x207d27[_0xe59f('0x36')],qs[_0xe59f('0x38')](_0x5c11dd[_0xe59f('0x32')][_0xe59f('0x38')]));_0x48bd93[_0xe59f('0x37')]=_0x48bd93[_0xe59f('0x37')][_0xe59f('0x47')]?_0x48bd93[_0xe59f('0x37')]:_0x207d27[_0xe59f('0x36')];if(!_0x5c11dd[_0xe59f('0x32')][_0xe59f('0x39')]('nolimit')){_0x48bd93['limit']=qs['limit'](_0x5c11dd[_0xe59f('0x32')][_0xe59f('0x22')]);_0x48bd93[_0xe59f('0x20')]=qs['offset'](_0x5c11dd[_0xe59f('0x32')]['offset']);}_0x48bd93[_0xe59f('0x3b')]=qs[_0xe59f('0x3c')](_0x5c11dd['query']['sort']);_0x48bd93[_0xe59f('0x3d')]=qs[_0xe59f('0x34')](_[_0xe59f('0x56')](_0x5c11dd['query'],_0x207d27[_0xe59f('0x34')]));_0x48bd93[_0xe59f('0x3d')][_0xe59f('0x57')]=_0x30e840['id'];if(_0x5c11dd[_0xe59f('0x32')]['filter']){_0x48bd93[_0xe59f('0x3d')]=_[_0xe59f('0x40')](_0x48bd93[_0xe59f('0x3d')],{'$or':_[_0xe59f('0x2e')](_0x48bd93['attributes'],function(_0x4b7fe5){var _0x443f19={};_0x443f19[_0x4b7fe5]={'$like':'%'+_0x5c11dd[_0xe59f('0x32')][_0xe59f('0x3f')]+'%'};return _0x443f19;})});}_0x48bd93=_[_0xe59f('0x40')]({},_0x48bd93,_0x5c11dd[_0xe59f('0x41')]);return db[_0xe59f('0x58')][_0xe59f('0x59')](_0x48bd93);}})['then'](function(_0x2ab400){if(_0x2ab400){return db[_0xe59f('0x5a')]['findAndCountAll']({'where':{'id':_[_0xe59f('0x2e')](_0x2ab400,_0xe59f('0x5b')),'role':_0xe59f('0x5c')},'attributes':['id',_0xe59f('0x2d'),_0xe59f('0x5d'),_0xe59f('0x5e'),_0xe59f('0x5f')]});}})[_0xe59f('0x26')](function(_0x54b85a){if(_0x54b85a){return{'count':_0x54b85a[_0xe59f('0x23')],'rows':_['map'](_0x54b85a[_0xe59f('0x42')],function(_0x157e40){return{'membername':_0x157e40[_0xe59f('0x2d')],'UserId':_0x157e40['id'],'queue_name':_0x2ea7de[_0xe59f('0x2d')],'OpenchannelQueueId':_0x2ea7de['id'],'interface':util['format']('%s/%s',_0xe59f('0x60'),_0x157e40[_0xe59f('0x2d')]),'penalty':0x0,'paused':_0x157e40[_0xe59f('0x5d')],'createdAt':_0x157e40[_0xe59f('0x5f')],'updatedAt':_0x157e40[_0xe59f('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe59f('0x26')](respondWithFilteredResult(_0x8948a5,_0x48bd93))[_0xe59f('0x43')](handleError(_0x8948a5,null));};exports[_0xe59f('0x61')]=function(_0xee44cc,_0x10b4a0,_0x539532){var _0x428033={};var _0x2a2779={};var _0x4b8868;var _0x32b7da;return db[_0xe59f('0x2f')][_0xe59f('0x55')]({'where':{'id':_0xee44cc['params']['id']}})[_0xe59f('0x26')](handleEntityNotFound(_0x10b4a0,null))[_0xe59f('0x26')](function(_0x13b852){if(_0x13b852){_0x4b8868=_0x13b852;_0x2a2779[_0xe59f('0x36')]=_[_0xe59f('0x33')](db[_0xe59f('0x62')][_0xe59f('0x46')]);_0x2a2779[_0xe59f('0x32')]=_[_0xe59f('0x33')](_0xee44cc[_0xe59f('0x32')]);_0x2a2779[_0xe59f('0x34')]=_[_0xe59f('0x35')](_0x2a2779[_0xe59f('0x36')],_0x2a2779[_0xe59f('0x32')]);_0x428033[_0xe59f('0x37')]=_[_0xe59f('0x35')](_0x2a2779['model'],qs['fields'](_0xee44cc[_0xe59f('0x32')][_0xe59f('0x38')]));_0x428033['attributes']=_0x428033[_0xe59f('0x37')][_0xe59f('0x47')]?_0x428033[_0xe59f('0x37')]:_0x2a2779[_0xe59f('0x36')];_0x428033['order']=qs[_0xe59f('0x3c')](_0xee44cc[_0xe59f('0x32')]['sort']);_0x428033[_0xe59f('0x3d')]=qs['filters'](_['pick'](_0xee44cc[_0xe59f('0x32')],_0x2a2779[_0xe59f('0x34')]));if(_0xee44cc[_0xe59f('0x32')][_0xe59f('0x3f')]){_0x428033[_0xe59f('0x3d')]=_[_0xe59f('0x40')](_0x428033[_0xe59f('0x3d')],{'$or':_[_0xe59f('0x2e')](_0x428033[_0xe59f('0x37')],function(_0x286235){var _0x1f8904={};_0x1f8904[_0x286235]={'$like':'%'+_0xee44cc[_0xe59f('0x32')][_0xe59f('0x3f')]+'%'};return _0x1f8904;})});}_0x428033=_[_0xe59f('0x40')]({},_0x428033,_0xee44cc[_0xe59f('0x41')]);return _0x4b8868[_0xe59f('0x61')](_0x428033);}})[_0xe59f('0x26')](function(_0x1f9a2d){if(_0x1f9a2d){_0x32b7da=_0x1f9a2d[_0xe59f('0x47')];if(!_0xee44cc['query'][_0xe59f('0x39')](_0xe59f('0x3a'))){_0x428033[_0xe59f('0x22')]=qs['limit'](_0xee44cc[_0xe59f('0x32')][_0xe59f('0x22')]);_0x428033[_0xe59f('0x20')]=qs['offset'](_0xee44cc['query']['offset']);}return _0x4b8868[_0xe59f('0x61')](_0x428033);}})[_0xe59f('0x26')](function(_0x3d085b){if(_0x3d085b){return _0x3d085b?{'count':_0x32b7da,'rows':_0x3d085b}:null;}})[_0xe59f('0x26')](respondWithResult(_0x10b4a0,null))['catch'](handleError(_0x10b4a0,null));};exports[_0xe59f('0x63')]=function(_0x57935c,_0x2b1e28,_0x347252){var _0x2d3fb4=_0x57935c[_0xe59f('0x52')][_0xe59f('0x64')];return db[_0xe59f('0x62')][_0xe59f('0x59')]({'where':{'id':_0x2d3fb4},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe59f('0x65'),'attributes':['id',_0xe59f('0x2d'),_0xe59f('0x66'),_0xe59f('0x67'),_0xe59f('0x68')],'raw':!![]}]})[_0xe59f('0x26')](function(_0xfbdfbf){if(_0xfbdfbf){var _0x1b1277=_['flatMap'](_0xfbdfbf,function(_0x62902c){var _0x26186f=_0x62902c[_0xe59f('0x28')]({'plain':!![]});return _0x26186f[_0xe59f('0x65')];});return db[_0xe59f('0x2f')]['find']({'where':{'id':_0x57935c[_0xe59f('0x45')]['id']}})['then'](function(_0x196156){return db[_0xe59f('0x69')][_0xe59f('0x6a')](function(_0x14dbf5){return _0x196156[_0xe59f('0x63')](_0x2d3fb4,{'transaction':_0x14dbf5})[_0xe59f('0x26')](function(){return BPromise[_0xe59f('0x6b')](_0x1b1277,function(_0xc381cc){return db['UserOpenchannelQueue'][_0xe59f('0x6c')]({'where':{'UserId':_0xc381cc['id'],'OpenchannelQueueId':_0x57935c[_0xe59f('0x45')]['id']},'transaction':_0x14dbf5});});})['then'](function(){_0x1b1277[_0xe59f('0x6d')](function(_0x2b0790){socket[_0xe59f('0x6e')](_0xe59f('0x6f'),{'UserId':_0x2b0790['id'],'OpenchannelQueueId':_0x196156['id']});});});});});}})[_0xe59f('0x26')](respondWithStatusCode(_0x2b1e28,null))[_0xe59f('0x43')](handleError(_0x2b1e28,null));};exports[_0xe59f('0x70')]=function(_0x5a3f45,_0x3131f9,_0x3831d5){return db[_0xe59f('0x62')][_0xe59f('0x59')]({'where':{'id':_0x5a3f45[_0xe59f('0x32')][_0xe59f('0x64')]},'attributes':['id'],'include':[{'model':db[_0xe59f('0x5a')],'as':_0xe59f('0x65'),'attributes':['id'],'raw':!![]}]})[_0xe59f('0x26')](handleEntityNotFound(_0x3131f9,null))[_0xe59f('0x26')](function(_0x428762){var _0xada164=_['map'](_0x428762,'id');var _0x1549f5=[];var _0x2ea0d9=[];var _0x39338a=squel[_0xe59f('0x71')]();_0x39338a[_0xe59f('0x72')](_0xe59f('0x73'))[_0xe59f('0x74')](_0xe59f('0x75'),'tq')[_0xe59f('0x76')]('user_has_teams','ut',_0xe59f('0x77'))['where']('OpenchannelQueueId\x20=\x20?',_0x5a3f45[_0xe59f('0x45')]['id']);for(var _0x5a32aa=0x0;_0x5a32aa<_0x428762[_0xe59f('0x47')];_0x5a32aa+=0x1){let _0x5635c3=_0x428762[_0x5a32aa];for(var _0x20bc7f=0x0;_0x20bc7f<_0x5635c3[_0xe59f('0x65')][_0xe59f('0x47')];_0x20bc7f+=0x1){let _0x48f82b=_0x5635c3[_0xe59f('0x65')][_0x20bc7f];var _0x47d7fe=_0x39338a['clone']();_0x47d7fe[_0xe59f('0x3d')]('ut.UserId\x20=\x20?',_0x48f82b['id']);_0x2ea0d9[_0xe59f('0x78')](db[_0xe59f('0x69')][_0xe59f('0x32')](_0x47d7fe[_0xe59f('0x79')](),{'type':db[_0xe59f('0x69')][_0xe59f('0x7a')][_0xe59f('0x7b')]})[_0xe59f('0x26')](function(_0x26e6f4){if(_0x26e6f4['length']===0x1){return _0x48f82b['id'];}else{var _0x547efa=_[_0xe59f('0x7c')](_['map'](_0x26e6f4,_0xe59f('0x7d')),function(_0x3f3d98){return _[_0xe59f('0x7e')](_0xada164,_0x3f3d98);});if(_0x547efa){return _0x48f82b['id'];}}}));}}return BPromise[_0xe59f('0x7f')](_0x2ea0d9)[_0xe59f('0x26')](function(_0x2022d0){_0x1549f5=_(_0x1549f5)['union'](_0x2022d0)['compact']()[_0xe59f('0x80')]();return db['OpenchannelQueue'][_0xe59f('0x4e')]({'where':{'id':_0x5a3f45['params']['id']}})[_0xe59f('0x26')](function(_0x4d9c3d){return db['sequelize']['transaction'](function(_0x3569e){return _0x4d9c3d[_0xe59f('0x70')](_0x5a3f45['query'][_0xe59f('0x64')],{'transaction':_0x3569e})[_0xe59f('0x26')](function(){if(!_['isEmpty'](_0x1549f5)){return _0x4d9c3d['removeAgents'](_0x1549f5,{'transaction':_0x3569e});}})[_0xe59f('0x26')](function(){_0x1549f5[_0xe59f('0x6d')](function(_0x3b1340){socket[_0xe59f('0x6e')](_0xe59f('0x81'),{'UserId':_0x3b1340,'OpenchannelQueueId':_0x4d9c3d['id']});});});});});});})['then'](respondWithStatusCode(_0x3131f9,null))['catch'](handleError(_0x3131f9,null));};exports[_0xe59f('0x82')]=function(_0x51a442,_0x279c8e,_0x43a88f){return db['OpenchannelQueue']['find']({'where':{'id':_0x51a442[_0xe59f('0x45')]['id']}})[_0xe59f('0x26')](handleEntityNotFound(_0x279c8e,null))['then'](function(_0x127dd1){if(_0x127dd1){return _0x127dd1[_0xe59f('0x82')](_0x51a442[_0xe59f('0x52')]['ids'],_[_0xe59f('0x83')](_0x51a442[_0xe59f('0x52')],[_0xe59f('0x64'),'id'])||{})[_0xe59f('0x84')](function(_0x1dbc7e){for(var _0x3ebd53=0x0;_0x3ebd53<_0x51a442['body'][_0xe59f('0x64')]['length'];_0x3ebd53+=0x1){socket[_0xe59f('0x6e')](_0xe59f('0x6f'),{'UserId':Number(_0x51a442['body']['ids'][_0x3ebd53]),'OpenchannelQueueId':Number(_0x51a442[_0xe59f('0x45')]['id'])});}return _0x1dbc7e;});}})[_0xe59f('0x26')](respondWithResult(_0x279c8e,null))[_0xe59f('0x43')](handleError(_0x279c8e,null));};exports['removeAgents']=function(_0x3d92b3,_0x16ffcb,_0x595c2c){return db[_0xe59f('0x2f')][_0xe59f('0x4e')]({'where':{'id':_0x3d92b3[_0xe59f('0x45')]['id']}})[_0xe59f('0x26')](handleEntityNotFound(_0x16ffcb,null))[_0xe59f('0x26')](function(_0x3e56f9){if(_0x3e56f9){return _0x3e56f9['removeAgents'](_0x3d92b3['query'][_0xe59f('0x64')])[_0xe59f('0x26')](function(){if(_['isArray'](_0x3d92b3[_0xe59f('0x32')][_0xe59f('0x64')])){for(var _0x586125=0x0;_0x586125<_0x3d92b3[_0xe59f('0x32')]['ids']['length'];_0x586125+=0x1){socket[_0xe59f('0x6e')](_0xe59f('0x81'),{'UserId':Number(_0x3d92b3[_0xe59f('0x32')][_0xe59f('0x64')][_0x586125]),'OpenchannelQueueId':Number(_0x3d92b3[_0xe59f('0x45')]['id'])});}}else{socket[_0xe59f('0x6e')](_0xe59f('0x81'),{'UserId':Number(_0x3d92b3['query'][_0xe59f('0x64')]),'OpenchannelQueueId':Number(_0x3d92b3['params']['id'])});}});}})[_0xe59f('0x26')](respondWithStatusCode(_0x16ffcb,null))[_0xe59f('0x43')](handleError(_0x16ffcb,null));};exports[_0xe59f('0x85')]=function(_0x5c5733,_0x8c7677,_0x5e6ee1){var _0x75c22f={};var _0x424030={};var _0x15bd79;var _0x2e01f5;return db[_0xe59f('0x2f')][_0xe59f('0x55')]({'where':{'id':_0x5c5733[_0xe59f('0x45')]['id']}})[_0xe59f('0x26')](handleEntityNotFound(_0x8c7677,null))[_0xe59f('0x26')](function(_0x1d3d6d){if(_0x1d3d6d){_0x15bd79=_0x1d3d6d;_0x424030[_0xe59f('0x36')]=_[_0xe59f('0x33')](db[_0xe59f('0x5a')][_0xe59f('0x46')]);_0x424030[_0xe59f('0x32')]=_['keys'](_0x5c5733[_0xe59f('0x32')]);_0x424030[_0xe59f('0x34')]=_[_0xe59f('0x35')](_0x424030[_0xe59f('0x36')],_0x424030['query']);_0x75c22f[_0xe59f('0x37')]=_['intersection'](_0x424030['model'],qs[_0xe59f('0x38')](_0x5c5733[_0xe59f('0x32')][_0xe59f('0x38')]));_0x75c22f['attributes']=_0x75c22f[_0xe59f('0x37')]['length']?_0x75c22f[_0xe59f('0x37')]:_0x424030[_0xe59f('0x36')];_0x75c22f[_0xe59f('0x3b')]=qs['sort'](_0x5c5733[_0xe59f('0x32')]['sort']);_0x75c22f[_0xe59f('0x3d')]=qs['filters'](_[_0xe59f('0x56')](_0x5c5733[_0xe59f('0x32')],_0x424030[_0xe59f('0x34')]));if(_0x5c5733[_0xe59f('0x32')][_0xe59f('0x3f')]){_0x75c22f[_0xe59f('0x3d')]=_[_0xe59f('0x40')](_0x75c22f[_0xe59f('0x3d')],{'$or':_[_0xe59f('0x2e')](_0x75c22f[_0xe59f('0x37')],function(_0x1c1cd9){var _0x3edc6d={};_0x3edc6d[_0x1c1cd9]={'$like':'%'+_0x5c5733[_0xe59f('0x32')][_0xe59f('0x3f')]+'%'};return _0x3edc6d;})});}_0x75c22f=_[_0xe59f('0x40')]({},_0x75c22f,_0x5c5733[_0xe59f('0x41')]);return _0x15bd79['getAgents'](_0x75c22f);}})[_0xe59f('0x26')](function(_0x4eb06b){if(_0x4eb06b){_0x2e01f5=_0x4eb06b['length'];if(!_0x5c5733[_0xe59f('0x32')][_0xe59f('0x39')](_0xe59f('0x3a'))){_0x75c22f[_0xe59f('0x22')]=qs[_0xe59f('0x22')](_0x5c5733[_0xe59f('0x32')][_0xe59f('0x22')]);_0x75c22f[_0xe59f('0x20')]=qs[_0xe59f('0x20')](_0x5c5733[_0xe59f('0x32')]['offset']);}return _0x15bd79['getAgents'](_0x75c22f);}})[_0xe59f('0x26')](function(_0x2aa995){if(_0x2aa995){return _0x2aa995?{'count':_0x2e01f5,'rows':_0x2aa995}:null;}})[_0xe59f('0x26')](respondWithResult(_0x8c7677,null))[_0xe59f('0x43')](handleError(_0x8c7677,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 2102343..b67be01 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 _0x8e5a=['hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','emit','hasOwnProperty'];(function(_0x44601e,_0x5bc0f7){var _0x5131a8=function(_0x1beae2){while(--_0x1beae2){_0x44601e['push'](_0x44601e['shift']());}};_0x5131a8(++_0x5bc0f7);}(_0x8e5a,0x1c1));var _0xa8e5=function(_0x58ca44,_0x52e09d){_0x58ca44=_0x58ca44-0x0;var _0xe5d5ea=_0x8e5a[_0x58ca44];return _0xe5d5ea;};'use strict';var EventEmitter=require(_0xa8e5('0x0'));var OpenchannelQueue=require(_0xa8e5('0x1'))['db'][_0xa8e5('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa8e5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3075ab){return function(_0x20e030,_0x3c1135,_0x3e1cc3){OpenchannelQueueEvents[_0xa8e5('0x4')](_0x3075ab+':'+_0x20e030['id'],_0x20e030);OpenchannelQueueEvents['emit'](_0x3075ab,_0x20e030);_0x3e1cc3(null);};}for(var e in events){if(events[_0xa8e5('0x5')](e)){var event=events[e];OpenchannelQueue[_0xa8e5('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x0c3c=['../../mysqldb','OpenchannelQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x3fdae4,_0x16182d){var _0x5c4538=function(_0x26c46d){while(--_0x26c46d){_0x3fdae4['push'](_0x3fdae4['shift']());}};_0x5c4538(++_0x16182d);}(_0x0c3c,0x1a6));var _0xc0c3=function(_0x27a900,_0x1cc305){_0x27a900=_0x27a900-0x0;var _0xea9b1f=_0x0c3c[_0x27a900];return _0xea9b1f;};'use strict';var EventEmitter=require(_0xc0c3('0x0'));var OpenchannelQueue=require(_0xc0c3('0x1'))['db'][_0xc0c3('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc0c3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0c3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c55b2){return function(_0xf98ee8,_0x2cf923,_0x2b6f19){OpenchannelQueueEvents[_0xc0c3('0x5')](_0x4c55b2+':'+_0xf98ee8['id'],_0xf98ee8);OpenchannelQueueEvents[_0xc0c3('0x5')](_0x4c55b2,_0xf98ee8);_0x2b6f19(null);};}for(var e in events){if(events[_0xc0c3('0x6')](e)){var event=events[e];OpenchannelQueue[_0xc0c3('0x7')](e,emitEvent(event));}}module[_0xc0c3('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index bc33d05..ac17f16 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 _0x8849=['request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','lodash','util','../../config/logger','api','bluebird'];(function(_0x6cb0be,_0x34de00){var _0x2be8ba=function(_0x432778){while(--_0x432778){_0x6cb0be['push'](_0x6cb0be['shift']());}};_0x2be8ba(++_0x34de00);}(_0x8849,0xdf));var _0x9884=function(_0x4c84ef,_0x4e13fb){_0x4c84ef=_0x4c84ef-0x0;var _0x4470ee=_0x8849[_0x4c84ef];return _0x4470ee;};'use strict';var _=require(_0x9884('0x0'));var util=require(_0x9884('0x1'));var logger=require(_0x9884('0x2'))(_0x9884('0x3'));var moment=require('moment');var BPromise=require(_0x9884('0x4'));var rp=require(_0x9884('0x5'));var fs=require('fs');var path=require(_0x9884('0x6'));var rimraf=require(_0x9884('0x7'));var config=require(_0x9884('0x8'));var attributes=require(_0x9884('0x9'));module['exports']=function(_0x4c81c0,_0x24683f){return _0x4c81c0[_0x9884('0xa')](_0x9884('0xb'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4021=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util'];(function(_0x50c5d5,_0x4ef853){var _0x466c90=function(_0xa7f60f){while(--_0xa7f60f){_0x50c5d5['push'](_0x50c5d5['shift']());}};_0x466c90(++_0x4ef853);}(_0x4021,0x1ec));var _0x1402=function(_0x446f11,_0x95cf21){_0x446f11=_0x446f11-0x0;var _0x385cb5=_0x4021[_0x446f11];return _0x385cb5;};'use strict';var _=require(_0x1402('0x0'));var util=require(_0x1402('0x1'));var logger=require(_0x1402('0x2'))('api');var moment=require(_0x1402('0x3'));var BPromise=require(_0x1402('0x4'));var rp=require(_0x1402('0x5'));var fs=require('fs');var path=require(_0x1402('0x6'));var rimraf=require(_0x1402('0x7'));var config=require(_0x1402('0x8'));var attributes=require(_0x1402('0x9'));module[_0x1402('0xa')]=function(_0x7ffa6b,_0xd4d4f5){return _0x7ffa6b[_0x1402('0xb')](_0x1402('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 98700fb..5c9de00 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 _0xa6e4=['http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','ShowOpenchannelQueue','find','lodash','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa6e4,0x16b));var _0x4a6e=function(_0x5dce1a,_0x3d39a9){_0x5dce1a=_0x5dce1a-0x0;var _0x889321=_0xa6e4[_0x5dce1a];return _0x889321;};'use strict';var _=require(_0x4a6e('0x0'));var util=require('util');var moment=require(_0x4a6e('0x1'));var BPromise=require(_0x4a6e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a6e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a6e('0x4'))('rpc');var config=require(_0x4a6e('0x5'));var jayson=require(_0x4a6e('0x6'));var client=jayson['client'][_0x4a6e('0x7')]({'port':0x232a});config['redis']=_[_0x4a6e('0x8')](config['redis'],{'host':_0x4a6e('0x9'),'port':0x18eb});var socket=require(_0x4a6e('0xa'))(new Redis(config[_0x4a6e('0xb')]));require('./openchannelQueue.socket')[_0x4a6e('0xc')](socket);function respondWithRpcPromise(_0x573263,_0x39a430,_0x120e97){return new BPromise(function(_0x52679f,_0x5a02a8){return client[_0x4a6e('0xd')](_0x573263,_0x120e97)[_0x4a6e('0xe')](function(_0x26bfb2){logger[_0x4a6e('0xf')](_0x4a6e('0x10'),_0x39a430,_0x4a6e('0x11'));logger[_0x4a6e('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x39a430,'request\x20sent',JSON[_0x4a6e('0x13')](_0x26bfb2));if(_0x26bfb2[_0x4a6e('0x14')]){if(_0x26bfb2[_0x4a6e('0x14')][_0x4a6e('0x15')]===0x1f4){logger[_0x4a6e('0x14')](_0x4a6e('0x10'),_0x39a430,_0x26bfb2[_0x4a6e('0x14')][_0x4a6e('0x16')]);return _0x5a02a8(_0x26bfb2[_0x4a6e('0x14')][_0x4a6e('0x16')]);}logger['error'](_0x4a6e('0x10'),_0x39a430,_0x26bfb2['error']['message']);return _0x52679f(_0x26bfb2[_0x4a6e('0x14')][_0x4a6e('0x16')]);}else{logger['info'](_0x4a6e('0x10'),_0x39a430,_0x4a6e('0x11'));_0x52679f(_0x26bfb2[_0x4a6e('0x17')][_0x4a6e('0x16')]);}})[_0x4a6e('0x18')](function(_0x3afde2){logger['error'](_0x4a6e('0x10'),_0x39a430,_0x3afde2);_0x5a02a8(_0x3afde2);});});}exports[_0x4a6e('0x19')]=function(_0x187d5a){var _0x58c1b1=this;return new Promise(function(_0x3f9da1,_0x4202a1){return db[_0x4a6e('0x1a')][_0x4a6e('0x1b')]({'raw':_0x187d5a[_0x4a6e('0x1c')]?_0x187d5a[_0x4a6e('0x1c')][_0x4a6e('0x1d')]===undefined?!![]:![]:!![],'where':_0x187d5a[_0x4a6e('0x1c')]?_0x187d5a['options'][_0x4a6e('0x1e')]||null:null,'attributes':_0x187d5a[_0x4a6e('0x1c')]?_0x187d5a[_0x4a6e('0x1c')][_0x4a6e('0x1f')]||null:null,'limit':_0x187d5a[_0x4a6e('0x1c')]?_0x187d5a[_0x4a6e('0x1c')]['limit']||null:null,'include':_0x187d5a[_0x4a6e('0x1c')]?_0x187d5a['options'][_0x4a6e('0x20')]?_[_0x4a6e('0x21')](_0x187d5a[_0x4a6e('0x1c')][_0x4a6e('0x20')],function(_0x500af2){return{'model':db[_0x500af2[_0x4a6e('0x22')]],'as':_0x500af2['as'],'attributes':_0x500af2[_0x4a6e('0x1f')],'include':_0x500af2[_0x4a6e('0x20')]?_[_0x4a6e('0x21')](_0x500af2[_0x4a6e('0x20')],function(_0x46404b){return{'model':db[_0x46404b[_0x4a6e('0x22')]],'as':_0x46404b['as'],'attributes':_0x46404b['attributes'],'include':_0x46404b['include']?_[_0x4a6e('0x21')](_0x46404b['include'],function(_0x27a406){return{'model':db[_0x27a406['model']],'as':_0x27a406['as'],'attributes':_0x27a406['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a6e('0xe')](function(_0x68c0cc){logger[_0x4a6e('0xf')](_0x4a6e('0x19'),_0x187d5a);logger[_0x4a6e('0x12')](_0x4a6e('0x19'),_0x187d5a,JSON[_0x4a6e('0x13')](_0x68c0cc));_0x3f9da1(_0x68c0cc);})['catch'](function(_0x230d70){logger[_0x4a6e('0x14')](_0x4a6e('0x19'),_0x230d70[_0x4a6e('0x16')],_0x187d5a);_0x4202a1(_0x58c1b1['error'](0x1f4,_0x230d70[_0x4a6e('0x16')]));});});};exports[_0x4a6e('0x23')]=function(_0x1f075d){var _0x504d11=this;return new Promise(function(_0x1117eb,_0x14137c){return db[_0x4a6e('0x1a')][_0x4a6e('0x24')]({'raw':_0x1f075d[_0x4a6e('0x1c')]?_0x1f075d[_0x4a6e('0x1c')][_0x4a6e('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f075d[_0x4a6e('0x1c')]?_0x1f075d[_0x4a6e('0x1c')]['where']||null:null,'attributes':_0x1f075d['options']?_0x1f075d[_0x4a6e('0x1c')]['attributes']||null:null,'include':_0x1f075d[_0x4a6e('0x1c')]?_0x1f075d['options'][_0x4a6e('0x20')]?_['map'](_0x1f075d[_0x4a6e('0x1c')]['include'],function(_0x361ef9){return{'model':db[_0x361ef9[_0x4a6e('0x22')]],'as':_0x361ef9['as'],'attributes':_0x361ef9['attributes'],'include':_0x361ef9[_0x4a6e('0x20')]?_[_0x4a6e('0x21')](_0x361ef9[_0x4a6e('0x20')],function(_0x39fee8){return{'model':db[_0x39fee8['model']],'as':_0x39fee8['as'],'attributes':_0x39fee8[_0x4a6e('0x1f')],'include':_0x39fee8[_0x4a6e('0x20')]?_['map'](_0x39fee8[_0x4a6e('0x20')],function(_0x2aa815){return{'model':db[_0x2aa815[_0x4a6e('0x22')]],'as':_0x2aa815['as'],'attributes':_0x2aa815[_0x4a6e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4a6e('0xe')](function(_0x312c86){logger['info'](_0x4a6e('0x23'),_0x1f075d);logger[_0x4a6e('0x12')](_0x4a6e('0x23'),_0x1f075d,JSON[_0x4a6e('0x13')](_0x312c86));_0x1117eb(_0x312c86);})[_0x4a6e('0x18')](function(_0x5edb5a){logger['error'](_0x4a6e('0x23'),_0x5edb5a[_0x4a6e('0x16')],_0x1f075d);_0x14137c(_0x504d11[_0x4a6e('0x14')](0x1f4,_0x5edb5a['message']));});});}; \ No newline at end of file +var _0x40b7=['map','model','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x4a94d4,_0x2c04f8){var _0x55dbba=function(_0x726614){while(--_0x726614){_0x4a94d4['push'](_0x4a94d4['shift']());}};_0x55dbba(++_0x2c04f8);}(_0x40b7,0x1f2));var _0x740b=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x40b7[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x740b('0x0'));var util=require(_0x740b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x740b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x740b('0x3'))['db'];var utils=require(_0x740b('0x4'));var logger=require(_0x740b('0x5'))(_0x740b('0x6'));var config=require(_0x740b('0x7'));var jayson=require(_0x740b('0x8'));var client=jayson[_0x740b('0x9')][_0x740b('0xa')]({'port':0x232a});config[_0x740b('0xb')]=_[_0x740b('0xc')](config[_0x740b('0xb')],{'host':_0x740b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x740b('0xb')]));require(_0x740b('0xe'))[_0x740b('0xf')](socket);function respondWithRpcPromise(_0x27341c,_0x2bc48d,_0x245211){return new BPromise(function(_0x11753c,_0x2a1fd5){return client[_0x740b('0x10')](_0x27341c,_0x245211)[_0x740b('0x11')](function(_0x12eaa8){logger[_0x740b('0x12')](_0x740b('0x13'),_0x2bc48d,_0x740b('0x14'));logger[_0x740b('0x15')](_0x740b('0x16'),_0x2bc48d,_0x740b('0x14'),JSON['stringify'](_0x12eaa8));if(_0x12eaa8[_0x740b('0x17')]){if(_0x12eaa8['error']['code']===0x1f4){logger[_0x740b('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x2bc48d,_0x12eaa8[_0x740b('0x17')][_0x740b('0x18')]);return _0x2a1fd5(_0x12eaa8[_0x740b('0x17')]['message']);}logger[_0x740b('0x17')](_0x740b('0x13'),_0x2bc48d,_0x12eaa8[_0x740b('0x17')][_0x740b('0x18')]);return _0x11753c(_0x12eaa8[_0x740b('0x17')][_0x740b('0x18')]);}else{logger[_0x740b('0x12')](_0x740b('0x13'),_0x2bc48d,_0x740b('0x14'));_0x11753c(_0x12eaa8[_0x740b('0x19')][_0x740b('0x18')]);}})[_0x740b('0x1a')](function(_0x1a8890){logger['error'](_0x740b('0x13'),_0x2bc48d,_0x1a8890);_0x2a1fd5(_0x1a8890);});});}exports[_0x740b('0x1b')]=function(_0x441494){var _0x50d393=this;return new Promise(function(_0x2e5a5f,_0x7eae03){return db['OpenchannelQueue'][_0x740b('0x1c')]({'raw':_0x441494['options']?_0x441494[_0x740b('0x1d')][_0x740b('0x1e')]===undefined?!![]:![]:!![],'where':_0x441494['options']?_0x441494['options'][_0x740b('0x1f')]||null:null,'attributes':_0x441494[_0x740b('0x1d')]?_0x441494[_0x740b('0x1d')][_0x740b('0x20')]||null:null,'limit':_0x441494['options']?_0x441494[_0x740b('0x1d')][_0x740b('0x21')]||null:null,'include':_0x441494[_0x740b('0x1d')]?_0x441494[_0x740b('0x1d')][_0x740b('0x22')]?_[_0x740b('0x23')](_0x441494['options']['include'],function(_0x46f08f){return{'model':db[_0x46f08f[_0x740b('0x24')]],'as':_0x46f08f['as'],'attributes':_0x46f08f['attributes'],'include':_0x46f08f[_0x740b('0x22')]?_[_0x740b('0x23')](_0x46f08f[_0x740b('0x22')],function(_0x1bfc78){return{'model':db[_0x1bfc78[_0x740b('0x24')]],'as':_0x1bfc78['as'],'attributes':_0x1bfc78[_0x740b('0x20')],'include':_0x1bfc78[_0x740b('0x22')]?_[_0x740b('0x23')](_0x1bfc78[_0x740b('0x22')],function(_0x26b833){return{'model':db[_0x26b833[_0x740b('0x24')]],'as':_0x26b833['as'],'attributes':_0x26b833[_0x740b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x740b('0x11')](function(_0x164c8a){logger[_0x740b('0x12')](_0x740b('0x1b'),_0x441494);logger['debug'](_0x740b('0x1b'),_0x441494,JSON[_0x740b('0x25')](_0x164c8a));_0x2e5a5f(_0x164c8a);})[_0x740b('0x1a')](function(_0x416528){logger['error'](_0x740b('0x1b'),_0x416528[_0x740b('0x18')],_0x441494);_0x7eae03(_0x50d393[_0x740b('0x17')](0x1f4,_0x416528['message']));});});};exports[_0x740b('0x26')]=function(_0x261903){var _0x30827a=this;return new Promise(function(_0x3afaed,_0x13be07){return db[_0x740b('0x27')][_0x740b('0x28')]({'raw':_0x261903[_0x740b('0x1d')]?_0x261903[_0x740b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x261903[_0x740b('0x1d')]?_0x261903[_0x740b('0x1d')][_0x740b('0x1f')]||null:null,'attributes':_0x261903[_0x740b('0x1d')]?_0x261903[_0x740b('0x1d')]['attributes']||null:null,'include':_0x261903[_0x740b('0x1d')]?_0x261903[_0x740b('0x1d')]['include']?_[_0x740b('0x23')](_0x261903[_0x740b('0x1d')][_0x740b('0x22')],function(_0xf34d39){return{'model':db[_0xf34d39[_0x740b('0x24')]],'as':_0xf34d39['as'],'attributes':_0xf34d39[_0x740b('0x20')],'include':_0xf34d39[_0x740b('0x22')]?_[_0x740b('0x23')](_0xf34d39[_0x740b('0x22')],function(_0x3a6527){return{'model':db[_0x3a6527[_0x740b('0x24')]],'as':_0x3a6527['as'],'attributes':_0x3a6527[_0x740b('0x20')],'include':_0x3a6527['include']?_[_0x740b('0x23')](_0x3a6527[_0x740b('0x22')],function(_0x20efb4){return{'model':db[_0x20efb4['model']],'as':_0x20efb4['as'],'attributes':_0x20efb4[_0x740b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e5774){logger['info'](_0x740b('0x26'),_0x261903);logger[_0x740b('0x15')](_0x740b('0x26'),_0x261903,JSON[_0x740b('0x25')](_0x5e5774));_0x3afaed(_0x5e5774);})[_0x740b('0x1a')](function(_0x1cf650){logger[_0x740b('0x17')]('ShowOpenchannelQueue',_0x1cf650['message'],_0x261903);_0x13be07(_0x30827a[_0x740b('0x17')](0x1f4,_0x1cf650[_0x740b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 9a32824..6e4b628 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 _0x53b5=['length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register'];(function(_0x28cda9,_0x52e9d1){var _0x5019fb=function(_0x10ab27){while(--_0x10ab27){_0x28cda9['push'](_0x28cda9['shift']());}};_0x5019fb(++_0x52e9d1);}(_0x53b5,0x11a));var _0x553b=function(_0x5ab2eb,_0x3df78a){_0x5ab2eb=_0x5ab2eb-0x0;var _0xae166=_0x53b5[_0x5ab2eb];return _0xae166;};'use strict';var OpenchannelQueueEvents=require(_0x553b('0x0'));var events=['save',_0x553b('0x1'),_0x553b('0x2')];function createListener(_0x9e2c64,_0x8a4b24){return function(_0x572a2d){_0x8a4b24[_0x553b('0x3')](_0x9e2c64,_0x572a2d);};}function removeListener(_0x30719c,_0x39d5a4){return function(){OpenchannelQueueEvents[_0x553b('0x4')](_0x30719c,_0x39d5a4);};}exports[_0x553b('0x5')]=function(_0x1ac0d3){for(var _0xeee3c0=0x0,_0x481c8c=events[_0x553b('0x6')];_0xeee3c0<_0x481c8c;_0xeee3c0++){var _0x28d050=events[_0xeee3c0];var _0x284801=createListener(_0x553b('0x7')+_0x28d050,_0x1ac0d3);OpenchannelQueueEvents['on'](_0x28d050,_0x284801);}}; \ No newline at end of file +var _0x23f4=['remove','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x50d882,_0x590501){var _0x59190a=function(_0xdd8db9){while(--_0xdd8db9){_0x50d882['push'](_0x50d882['shift']());}};_0x59190a(++_0x590501);}(_0x23f4,0x15e));var _0x423f=function(_0x8c2261,_0x38fe47){_0x8c2261=_0x8c2261-0x0;var _0x201182=_0x23f4[_0x8c2261];return _0x201182;};'use strict';var OpenchannelQueueEvents=require(_0x423f('0x0'));var events=[_0x423f('0x1'),_0x423f('0x2'),'update'];function createListener(_0x1547df,_0x5a13a9){return function(_0x3bde83){_0x5a13a9[_0x423f('0x3')](_0x1547df,_0x3bde83);};}function removeListener(_0x327c04,_0x4cc787){return function(){OpenchannelQueueEvents[_0x423f('0x4')](_0x327c04,_0x4cc787);};}exports[_0x423f('0x5')]=function(_0x1cbb90){for(var _0x819866=0x0,_0x4be6d8=events[_0x423f('0x6')];_0x819866<_0x4be6d8;_0x819866++){var _0x2f233a=events[_0x819866];var _0x2c4749=createListener(_0x423f('0x7')+_0x2f233a,_0x1cbb90);OpenchannelQueueEvents['on'](_0x2f233a,_0x2c4749);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index e937cfe..0b4f3f9 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 _0x8e21=['put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0x41e8b6,_0x306cc2){var _0x13f112=function(_0x484f85){while(--_0x484f85){_0x41e8b6['push'](_0x41e8b6['shift']());}};_0x13f112(++_0x306cc2);}(_0x8e21,0x1b4));var _0x18e2=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x8e21[_0xf34109];return _0x570bfc;};'use strict';var multer=require(_0x18e2('0x0'));var util=require(_0x18e2('0x1'));var path=require(_0x18e2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x18e2('0x3')]();var fs_extra=require(_0x18e2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x18e2('0x5'));var config=require(_0x18e2('0x6'));var controller=require(_0x18e2('0x7'));router['get']('/',auth[_0x18e2('0x8')](),controller[_0x18e2('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x18e2('0xa')](_0x18e2('0xb'),auth[_0x18e2('0x8')](),controller['show']);router[_0x18e2('0xc')]('/',auth['isAuthenticated'](),controller[_0x18e2('0xd')]);router[_0x18e2('0xe')](_0x18e2('0xb'),auth['isAuthenticated'](),controller[_0x18e2('0xf')]);router[_0x18e2('0x10')]('/:id',auth[_0x18e2('0x8')](),controller[_0x18e2('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb364=['/:id','post','create','update','delete','exports','path','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb364,0x11e));var _0x4b36=function(_0x10aabe,_0x1c4c58){_0x10aabe=_0x10aabe-0x0;var _0x4a475a=_0xb364[_0x10aabe];return _0x4a475a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b36('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4b36('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4b36('0x2'));var interaction=require(_0x4b36('0x3'));var config=require('../../config/environment');var controller=require(_0x4b36('0x4'));router[_0x4b36('0x5')]('/',auth[_0x4b36('0x6')](),controller['index']);router[_0x4b36('0x5')]('/describe',auth[_0x4b36('0x6')](),controller[_0x4b36('0x7')]);router[_0x4b36('0x5')](_0x4b36('0x8'),auth[_0x4b36('0x6')](),controller['show']);router[_0x4b36('0x9')]('/',auth[_0x4b36('0x6')](),controller[_0x4b36('0xa')]);router['put'](_0x4b36('0x8'),auth[_0x4b36('0x6')](),controller[_0x4b36('0xb')]);router[_0x4b36('0xc')](_0x4b36('0x8'),auth[_0x4b36('0x6')](),controller['destroy']);module[_0x4b36('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 4861494..ca09734 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 _0x3aa1=['exports','DATE','STRING','sequelize'];(function(_0x4ea728,_0x3ba8a8){var _0x290764=function(_0x35f0e0){while(--_0x35f0e0){_0x4ea728['push'](_0x4ea728['shift']());}};_0x290764(++_0x3ba8a8);}(_0x3aa1,0xdb));var _0x13aa=function(_0x148b0a,_0x406541){_0x148b0a=_0x148b0a-0x0;var _0x3c8523=_0x3aa1[_0x148b0a];return _0x3c8523;};'use strict';var moment=require('moment');var Sequelize=require(_0x13aa('0x0'));module[_0x13aa('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x13aa('0x2')]},'leaveAt':{'type':Sequelize[_0x13aa('0x2')]},'acceptAt':{'type':Sequelize[_0x13aa('0x2')]},'exitAt':{'type':Sequelize[_0x13aa('0x2')]},'reason':{'type':Sequelize[_0x13aa('0x3')]}}; \ No newline at end of file +var _0xaf55=['exports','STRING','DATE','moment','sequelize'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xaf55,0x1a2));var _0x5af5=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xaf55[_0xbf8ebe];return _0x1e25e8;};'use strict';var moment=require(_0x5af5('0x0'));var Sequelize=require(_0x5af5('0x1'));module[_0x5af5('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5af5('0x3')]},'joinAt':{'type':Sequelize[_0x5af5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5af5('0x4')]},'exitAt':{'type':Sequelize[_0x5af5('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index e072e0d..51d1bf0 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 _0x9160=['describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','OpenchannelQueueReport','findAll','rows','catch','show','create','body','find','params'];(function(_0x455bbc,_0x415cd2){var _0x24773d=function(_0x3f50f5){while(--_0x3f50f5){_0x455bbc['push'](_0x455bbc['shift']());}};_0x24773d(++_0x415cd2);}(_0x9160,0x97));var _0x0916=function(_0xb3fdc1,_0x3e39e6){_0xb3fdc1=_0xb3fdc1-0x0;var _0x4348b5=_0x9160[_0xb3fdc1];return _0x4348b5;};'use strict';var emlformat=require(_0x0916('0x0'));var rimraf=require(_0x0916('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0916('0x2'));var moment=require(_0x0916('0x3'));var BPromise=require(_0x0916('0x4'));var Mustache=require('mustache');var util=require(_0x0916('0x5'));var path=require(_0x0916('0x6'));var sox=require('sox');var csv=require(_0x0916('0x7'));var ejs=require(_0x0916('0x8'));var fs=require('fs');var fs_extra=require(_0x0916('0x9'));var _=require(_0x0916('0xa'));var squel=require(_0x0916('0xb'));var crypto=require(_0x0916('0xc'));var jsforce=require(_0x0916('0xd'));var deskjs=require(_0x0916('0xe'));var toCsv=require(_0x0916('0x7'));var querystring=require(_0x0916('0xf'));var Papa=require(_0x0916('0x10'));var Redis=require(_0x0916('0x11'));var authService=require(_0x0916('0x12'));var qs=require(_0x0916('0x13'));var as=require(_0x0916('0x14'));var hardwareService=require(_0x0916('0x15'));var logger=require(_0x0916('0x16'))(_0x0916('0x17'));var utils=require(_0x0916('0x18'));var config=require(_0x0916('0x19'));var licenseUtil=require(_0x0916('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b3fd1,_0x281633){_0x281633=_0x281633||0xcc;return function(_0x3861f7){if(_0x3861f7){return _0x3b3fd1['sendStatus'](_0x281633);}return _0x3b3fd1[_0x0916('0x1b')](_0x281633)['end']();};}function respondWithResult(_0x9b5aff,_0x10b80e){_0x10b80e=_0x10b80e||0xc8;return function(_0x54f788){if(_0x54f788){return _0x9b5aff['status'](_0x10b80e)[_0x0916('0x1c')](_0x54f788);}};}function respondWithFilteredResult(_0x2df6c6,_0x242b75){return function(_0x21e149){if(_0x21e149){var _0x38e910=typeof _0x242b75[_0x0916('0x1d')]==='undefined'&&typeof _0x242b75['limit']===_0x0916('0x1e');var _0x35a204=_0x21e149[_0x0916('0x1f')];var _0xedd28c=_0x38e910?0x0:_0x242b75['offset'];var _0x45521a=_0x38e910?_0x21e149[_0x0916('0x1f')]:_0x242b75[_0x0916('0x1d')]+_0x242b75[_0x0916('0x20')];var _0x318ca1;if(_0x45521a>=_0x35a204){_0x45521a=_0x35a204;_0x318ca1=0xc8;}else{_0x318ca1=0xce;}_0x2df6c6[_0x0916('0x1b')](_0x318ca1);return _0x2df6c6['set'](_0x0916('0x21'),_0xedd28c+'-'+_0x45521a+'/'+_0x35a204)[_0x0916('0x1c')](_0x21e149);}return null;};}function patchUpdates(_0x36da4d){return function(_0xd9b251){try{jsonpatch[_0x0916('0x22')](_0xd9b251,_0x36da4d,!![]);}catch(_0x11e8b9){return BPromise['reject'](_0x11e8b9);}return _0xd9b251[_0x0916('0x23')]();};}function saveUpdates(_0x4867a6,_0x58682e){return function(_0x33a016){if(_0x33a016){return _0x33a016[_0x0916('0x24')](_0x4867a6)[_0x0916('0x25')](function(_0x22201d){return _0x22201d;});}return null;};}function removeEntity(_0x351385,_0x4afcf8){return function(_0x29b56e){if(_0x29b56e){return _0x29b56e[_0x0916('0x26')]()[_0x0916('0x25')](function(){_0x351385[_0x0916('0x1b')](0xcc)[_0x0916('0x27')]();});}};}function handleEntityNotFound(_0x2455cd,_0x15eced){return function(_0x57124c){if(!_0x57124c){_0x2455cd['sendStatus'](0x194);}return _0x57124c;};}function handleError(_0x35409f,_0x19ee32){_0x19ee32=_0x19ee32||0x1f4;return function(_0x1f28e9){logger['error'](_0x1f28e9[_0x0916('0x28')]);if(_0x1f28e9[_0x0916('0x29')]){delete _0x1f28e9[_0x0916('0x29')];}_0x35409f['status'](_0x19ee32)[_0x0916('0x2a')](_0x1f28e9);};}exports[_0x0916('0x2b')]=function(_0x4d32d1,_0x53f10d){var _0x2772d9={},_0x59eb49={},_0x5a6685={'count':0x0,'rows':[]};var _0x5e246f=_['map'](db['OpenchannelQueueReport']['rawAttributes'],function(_0x69087d){return{'name':_0x69087d['fieldName'],'type':_0x69087d[_0x0916('0x2c')][_0x0916('0x2d')]};});_0x59eb49[_0x0916('0x2e')]=_[_0x0916('0x2f')](_0x5e246f,_0x0916('0x29'));_0x59eb49[_0x0916('0x30')]=_[_0x0916('0x31')](_0x4d32d1[_0x0916('0x30')]);_0x59eb49[_0x0916('0x32')]=_[_0x0916('0x33')](_0x59eb49[_0x0916('0x2e')],_0x59eb49['query']);_0x2772d9[_0x0916('0x34')]=_[_0x0916('0x33')](_0x59eb49[_0x0916('0x2e')],qs[_0x0916('0x35')](_0x4d32d1[_0x0916('0x30')][_0x0916('0x35')]));_0x2772d9['attributes']=_0x2772d9[_0x0916('0x34')][_0x0916('0x36')]?_0x2772d9['attributes']:_0x59eb49[_0x0916('0x2e')];if(!_0x4d32d1[_0x0916('0x30')][_0x0916('0x37')](_0x0916('0x38'))){_0x2772d9[_0x0916('0x20')]=qs[_0x0916('0x20')](_0x4d32d1[_0x0916('0x30')][_0x0916('0x20')]);_0x2772d9[_0x0916('0x1d')]=qs[_0x0916('0x1d')](_0x4d32d1[_0x0916('0x30')]['offset']);}_0x2772d9[_0x0916('0x39')]=qs[_0x0916('0x3a')](_0x4d32d1[_0x0916('0x30')][_0x0916('0x3a')]);_0x2772d9['where']=qs[_0x0916('0x32')](_[_0x0916('0x3b')](_0x4d32d1[_0x0916('0x30')],_0x59eb49[_0x0916('0x32')]),_0x5e246f);if(_0x4d32d1[_0x0916('0x30')][_0x0916('0x3c')]){_0x2772d9['where']=_['merge'](_0x2772d9[_0x0916('0x3d')],{'$or':_['map'](_0x5e246f,function(_0x31c4ca){if(_0x31c4ca[_0x0916('0x2c')]!=='VIRTUAL'){var _0x56587b={};_0x56587b[_0x31c4ca[_0x0916('0x29')]]={'$like':'%'+_0x4d32d1[_0x0916('0x30')][_0x0916('0x3c')]+'%'};return _0x56587b;}})});}_0x2772d9=_[_0x0916('0x3e')]({},_0x2772d9,_0x4d32d1[_0x0916('0x3f')]);var _0x2bee25={'where':_0x2772d9[_0x0916('0x3d')]};return db['OpenchannelQueueReport'][_0x0916('0x1f')](_0x2bee25)['then'](function(_0x5204e2){_0x5a6685[_0x0916('0x1f')]=_0x5204e2;if(_0x4d32d1[_0x0916('0x30')]['includeAll']){_0x2772d9[_0x0916('0x40')]=[{'all':!![]}];}return db[_0x0916('0x41')][_0x0916('0x42')](_0x2772d9);})[_0x0916('0x25')](function(_0x293839){_0x5a6685[_0x0916('0x43')]=_0x293839;return _0x5a6685;})['then'](respondWithFilteredResult(_0x53f10d,_0x2772d9))[_0x0916('0x44')](handleError(_0x53f10d,null));};exports[_0x0916('0x45')]=function(_0x4cecb8,_0x3a3a54){var _0x2336d1={'raw':!![],'where':{'id':_0x4cecb8['params']['id']}},_0x293b81={};_0x293b81[_0x0916('0x2e')]=_[_0x0916('0x31')](db[_0x0916('0x41')]['rawAttributes']);_0x293b81[_0x0916('0x30')]=_[_0x0916('0x31')](_0x4cecb8['query']);_0x293b81[_0x0916('0x32')]=_[_0x0916('0x33')](_0x293b81[_0x0916('0x2e')],_0x293b81[_0x0916('0x30')]);_0x2336d1[_0x0916('0x34')]=_['intersection'](_0x293b81[_0x0916('0x2e')],qs['fields'](_0x4cecb8[_0x0916('0x30')][_0x0916('0x35')]));_0x2336d1[_0x0916('0x34')]=_0x2336d1['attributes'][_0x0916('0x36')]?_0x2336d1[_0x0916('0x34')]:_0x293b81[_0x0916('0x2e')];if(_0x4cecb8[_0x0916('0x30')]['includeAll']){_0x2336d1[_0x0916('0x40')]=[{'all':!![]}];}_0x2336d1=_[_0x0916('0x3e')]({},_0x2336d1,_0x4cecb8[_0x0916('0x3f')]);return db[_0x0916('0x41')]['find'](_0x2336d1)[_0x0916('0x25')](handleEntityNotFound(_0x3a3a54,null))[_0x0916('0x25')](respondWithResult(_0x3a3a54,null))[_0x0916('0x44')](handleError(_0x3a3a54,null));};exports['create']=function(_0x5549d7,_0xcc0786){return db[_0x0916('0x41')][_0x0916('0x46')](_0x5549d7['body'],{})['then'](respondWithResult(_0xcc0786,0xc9))[_0x0916('0x44')](handleError(_0xcc0786,null));};exports[_0x0916('0x24')]=function(_0x3cee89,_0x191bf2){if(_0x3cee89[_0x0916('0x47')]['id']){delete _0x3cee89[_0x0916('0x47')]['id'];}return db[_0x0916('0x41')][_0x0916('0x48')]({'where':{'id':_0x3cee89[_0x0916('0x49')]['id']}})[_0x0916('0x25')](handleEntityNotFound(_0x191bf2,null))['then'](saveUpdates(_0x3cee89[_0x0916('0x47')],null))[_0x0916('0x25')](respondWithResult(_0x191bf2,null))['catch'](handleError(_0x191bf2,null));};exports['destroy']=function(_0x51ddf9,_0x13db75){return db[_0x0916('0x41')][_0x0916('0x48')]({'where':{'id':_0x51ddf9['params']['id']}})[_0x0916('0x25')](handleEntityNotFound(_0x13db75,null))[_0x0916('0x25')](removeEntity(_0x13db75,null))['catch'](handleError(_0x13db75,null));};exports['describe']=function(_0x575451,_0x22d3c4){return db[_0x0916('0x41')][_0x0916('0x4a')]()[_0x0916('0x25')](respondWithResult(_0x22d3c4,null))['catch'](handleError(_0x22d3c4,null));}; \ No newline at end of file +var _0x8d8b=['offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x28214f,_0x2ee26e){var _0x5ac3cc=function(_0x197770){while(--_0x197770){_0x28214f['push'](_0x28214f['shift']());}};_0x5ac3cc(++_0x2ee26e);}(_0x8d8b,0x109));var _0xb8d8=function(_0x164567,_0x359365){_0x164567=_0x164567-0x0;var _0x87a092=_0x8d8b[_0x164567];return _0x87a092;};'use strict';var emlformat=require(_0xb8d8('0x0'));var rimraf=require(_0xb8d8('0x1'));var zipdir=require(_0xb8d8('0x2'));var jsonpatch=require(_0xb8d8('0x3'));var rp=require(_0xb8d8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb8d8('0x5'));var path=require(_0xb8d8('0x6'));var sox=require(_0xb8d8('0x7'));var csv=require(_0xb8d8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8d8('0x9'));var _=require(_0xb8d8('0xa'));var squel=require(_0xb8d8('0xb'));var crypto=require(_0xb8d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb8d8('0xd'));var toCsv=require(_0xb8d8('0x8'));var querystring=require(_0xb8d8('0xe'));var Papa=require(_0xb8d8('0xf'));var Redis=require('ioredis');var authService=require(_0xb8d8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb8d8('0x11'));var hardwareService=require(_0xb8d8('0x12'));var logger=require('../../config/logger')(_0xb8d8('0x13'));var utils=require(_0xb8d8('0x14'));var config=require(_0xb8d8('0x15'));var licenseUtil=require(_0xb8d8('0x16'));var db=require(_0xb8d8('0x17'))['db'];function respondWithStatusCode(_0x5612d0,_0x371750){_0x371750=_0x371750||0xcc;return function(_0xd31431){if(_0xd31431){return _0x5612d0['sendStatus'](_0x371750);}return _0x5612d0[_0xb8d8('0x18')](_0x371750)[_0xb8d8('0x19')]();};}function respondWithResult(_0x5c7624,_0x1dd3db){_0x1dd3db=_0x1dd3db||0xc8;return function(_0x59db78){if(_0x59db78){return _0x5c7624[_0xb8d8('0x18')](_0x1dd3db)[_0xb8d8('0x1a')](_0x59db78);}};}function respondWithFilteredResult(_0x559768,_0x1c0ef2){return function(_0x3a5a06){if(_0x3a5a06){var _0x16cdf4=typeof _0x1c0ef2[_0xb8d8('0x1b')]===_0xb8d8('0x1c')&&typeof _0x1c0ef2['limit']==='undefined';var _0x6c7d52=_0x3a5a06[_0xb8d8('0x1d')];var _0x4b7cf8=_0x16cdf4?0x0:_0x1c0ef2[_0xb8d8('0x1b')];var _0x547c49=_0x16cdf4?_0x3a5a06[_0xb8d8('0x1d')]:_0x1c0ef2[_0xb8d8('0x1b')]+_0x1c0ef2[_0xb8d8('0x1e')];var _0x4173ef;if(_0x547c49>=_0x6c7d52){_0x547c49=_0x6c7d52;_0x4173ef=0xc8;}else{_0x4173ef=0xce;}_0x559768[_0xb8d8('0x18')](_0x4173ef);return _0x559768['set'](_0xb8d8('0x1f'),_0x4b7cf8+'-'+_0x547c49+'/'+_0x6c7d52)[_0xb8d8('0x1a')](_0x3a5a06);}return null;};}function patchUpdates(_0x1eea97){return function(_0x4b7c70){try{jsonpatch['apply'](_0x4b7c70,_0x1eea97,!![]);}catch(_0x16f4d6){return BPromise[_0xb8d8('0x20')](_0x16f4d6);}return _0x4b7c70[_0xb8d8('0x21')]();};}function saveUpdates(_0x262d87,_0x15a71a){return function(_0x458d92){if(_0x458d92){return _0x458d92[_0xb8d8('0x22')](_0x262d87)[_0xb8d8('0x23')](function(_0x3de212){return _0x3de212;});}return null;};}function removeEntity(_0x30886b,_0xd79e19){return function(_0x3a1814){if(_0x3a1814){return _0x3a1814[_0xb8d8('0x24')]()[_0xb8d8('0x23')](function(){_0x30886b[_0xb8d8('0x18')](0xcc)[_0xb8d8('0x19')]();});}};}function handleEntityNotFound(_0x5c0b1a,_0x94d3d6){return function(_0x1950f6){if(!_0x1950f6){_0x5c0b1a['sendStatus'](0x194);}return _0x1950f6;};}function handleError(_0x1a1ae0,_0x20e8ae){_0x20e8ae=_0x20e8ae||0x1f4;return function(_0x39a1b0){logger[_0xb8d8('0x25')](_0x39a1b0[_0xb8d8('0x26')]);if(_0x39a1b0[_0xb8d8('0x27')]){delete _0x39a1b0[_0xb8d8('0x27')];}_0x1a1ae0[_0xb8d8('0x18')](_0x20e8ae)[_0xb8d8('0x28')](_0x39a1b0);};}exports['index']=function(_0x31c54e,_0x5574aa){var _0x504d21={},_0x4c5925={},_0x4fdf89={'count':0x0,'rows':[]};var _0x5c7437=_[_0xb8d8('0x29')](db[_0xb8d8('0x2a')][_0xb8d8('0x2b')],function(_0x27ba45){return{'name':_0x27ba45[_0xb8d8('0x2c')],'type':_0x27ba45[_0xb8d8('0x2d')][_0xb8d8('0x2e')]};});_0x4c5925[_0xb8d8('0x2f')]=_[_0xb8d8('0x29')](_0x5c7437,_0xb8d8('0x27'));_0x4c5925[_0xb8d8('0x30')]=_[_0xb8d8('0x31')](_0x31c54e['query']);_0x4c5925[_0xb8d8('0x32')]=_[_0xb8d8('0x33')](_0x4c5925[_0xb8d8('0x2f')],_0x4c5925[_0xb8d8('0x30')]);_0x504d21[_0xb8d8('0x34')]=_['intersection'](_0x4c5925[_0xb8d8('0x2f')],qs['fields'](_0x31c54e[_0xb8d8('0x30')][_0xb8d8('0x35')]));_0x504d21[_0xb8d8('0x34')]=_0x504d21['attributes'][_0xb8d8('0x36')]?_0x504d21['attributes']:_0x4c5925[_0xb8d8('0x2f')];if(!_0x31c54e[_0xb8d8('0x30')]['hasOwnProperty'](_0xb8d8('0x37'))){_0x504d21[_0xb8d8('0x1e')]=qs[_0xb8d8('0x1e')](_0x31c54e[_0xb8d8('0x30')][_0xb8d8('0x1e')]);_0x504d21['offset']=qs[_0xb8d8('0x1b')](_0x31c54e[_0xb8d8('0x30')][_0xb8d8('0x1b')]);}_0x504d21['order']=qs[_0xb8d8('0x38')](_0x31c54e['query']['sort']);_0x504d21[_0xb8d8('0x39')]=qs[_0xb8d8('0x32')](_[_0xb8d8('0x3a')](_0x31c54e['query'],_0x4c5925[_0xb8d8('0x32')]),_0x5c7437);if(_0x31c54e['query'][_0xb8d8('0x3b')]){_0x504d21[_0xb8d8('0x39')]=_[_0xb8d8('0x3c')](_0x504d21['where'],{'$or':_[_0xb8d8('0x29')](_0x5c7437,function(_0x575b17){if(_0x575b17[_0xb8d8('0x2d')]!=='VIRTUAL'){var _0x2da3f8={};_0x2da3f8[_0x575b17[_0xb8d8('0x27')]]={'$like':'%'+_0x31c54e[_0xb8d8('0x30')]['filter']+'%'};return _0x2da3f8;}})});}_0x504d21=_[_0xb8d8('0x3c')]({},_0x504d21,_0x31c54e[_0xb8d8('0x3d')]);var _0x8bab56={'where':_0x504d21['where']};return db['OpenchannelQueueReport'][_0xb8d8('0x1d')](_0x8bab56)[_0xb8d8('0x23')](function(_0x27f936){_0x4fdf89[_0xb8d8('0x1d')]=_0x27f936;if(_0x31c54e[_0xb8d8('0x30')][_0xb8d8('0x3e')]){_0x504d21[_0xb8d8('0x3f')]=[{'all':!![]}];}return db[_0xb8d8('0x2a')][_0xb8d8('0x40')](_0x504d21);})['then'](function(_0x25b2f2){_0x4fdf89[_0xb8d8('0x41')]=_0x25b2f2;return _0x4fdf89;})[_0xb8d8('0x23')](respondWithFilteredResult(_0x5574aa,_0x504d21))[_0xb8d8('0x42')](handleError(_0x5574aa,null));};exports[_0xb8d8('0x43')]=function(_0x2e6a53,_0x17aba7){var _0x5a2ffe={'raw':!![],'where':{'id':_0x2e6a53['params']['id']}},_0x1f17ab={};_0x1f17ab[_0xb8d8('0x2f')]=_[_0xb8d8('0x31')](db['OpenchannelQueueReport'][_0xb8d8('0x2b')]);_0x1f17ab[_0xb8d8('0x30')]=_[_0xb8d8('0x31')](_0x2e6a53[_0xb8d8('0x30')]);_0x1f17ab['filters']=_[_0xb8d8('0x33')](_0x1f17ab['model'],_0x1f17ab[_0xb8d8('0x30')]);_0x5a2ffe[_0xb8d8('0x34')]=_[_0xb8d8('0x33')](_0x1f17ab[_0xb8d8('0x2f')],qs['fields'](_0x2e6a53['query'][_0xb8d8('0x35')]));_0x5a2ffe[_0xb8d8('0x34')]=_0x5a2ffe[_0xb8d8('0x34')]['length']?_0x5a2ffe[_0xb8d8('0x34')]:_0x1f17ab[_0xb8d8('0x2f')];if(_0x2e6a53[_0xb8d8('0x30')][_0xb8d8('0x3e')]){_0x5a2ffe[_0xb8d8('0x3f')]=[{'all':!![]}];}_0x5a2ffe=_[_0xb8d8('0x3c')]({},_0x5a2ffe,_0x2e6a53[_0xb8d8('0x3d')]);return db['OpenchannelQueueReport'][_0xb8d8('0x44')](_0x5a2ffe)[_0xb8d8('0x23')](handleEntityNotFound(_0x17aba7,null))[_0xb8d8('0x23')](respondWithResult(_0x17aba7,null))[_0xb8d8('0x42')](handleError(_0x17aba7,null));};exports[_0xb8d8('0x45')]=function(_0x6a30c5,_0xe1d64c){return db['OpenchannelQueueReport'][_0xb8d8('0x45')](_0x6a30c5[_0xb8d8('0x46')],{})['then'](respondWithResult(_0xe1d64c,0xc9))[_0xb8d8('0x42')](handleError(_0xe1d64c,null));};exports[_0xb8d8('0x22')]=function(_0x38601b,_0x27f120){if(_0x38601b[_0xb8d8('0x46')]['id']){delete _0x38601b['body']['id'];}return db[_0xb8d8('0x2a')][_0xb8d8('0x44')]({'where':{'id':_0x38601b['params']['id']}})[_0xb8d8('0x23')](handleEntityNotFound(_0x27f120,null))[_0xb8d8('0x23')](saveUpdates(_0x38601b[_0xb8d8('0x46')],null))['then'](respondWithResult(_0x27f120,null))[_0xb8d8('0x42')](handleError(_0x27f120,null));};exports[_0xb8d8('0x24')]=function(_0x4119e0,_0x11ac3f){return db[_0xb8d8('0x2a')][_0xb8d8('0x44')]({'where':{'id':_0x4119e0[_0xb8d8('0x47')]['id']}})[_0xb8d8('0x23')](handleEntityNotFound(_0x11ac3f,null))[_0xb8d8('0x23')](removeEntity(_0x11ac3f,null))['catch'](handleError(_0x11ac3f,null));};exports[_0xb8d8('0x48')]=function(_0x5eb9e5,_0x569026){return db[_0xb8d8('0x2a')][_0xb8d8('0x48')]()[_0xb8d8('0x23')](respondWithResult(_0x569026,null))[_0xb8d8('0x42')](handleError(_0x569026,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index fb3e82e..df04edd 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0xbffca4,_0xae4a62){var _0x8c5546=function(_0x1e3f42){while(--_0x1e3f42){_0xbffca4['push'](_0xbffca4['shift']());}};_0x8c5546(++_0xae4a62);}(_0xe14b,0x93));var _0xbe14=function(_0x5a25ef,_0x502e6d){_0x5a25ef=_0x5a25ef-0x0;var _0x4d81ad=_0xe14b[_0x5a25ef];return _0x4d81ad;};'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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x1bc605,_0xfc4dc7){var _0x5e21de=function(_0x50c379){while(--_0x50c379){_0x1bc605['push'](_0x1bc605['shift']());}};_0x5e21de(++_0xfc4dc7);}(_0x7a54,0x106));var _0x47a5=function(_0x4207ea,_0x5352ea){_0x4207ea=_0x4207ea-0x0;var _0x198e89=_0x7a54[_0x4207ea];return _0x198e89;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index b6fab9c..87a657f 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 _0x9d5b=['message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','where','limit','info','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x23c60c,_0x589b3d){var _0x38651b=function(_0x284621){while(--_0x284621){_0x23c60c['push'](_0x23c60c['shift']());}};_0x38651b(++_0x589b3d);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x18e434,_0x4f047c){_0x18e434=_0x18e434-0x0;var _0x200988=_0x9d5b[_0x18e434];return _0x200988;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var moment=require(_0xb9d5('0x1'));var BPromise=require(_0xb9d5('0x2'));var rs=require(_0xb9d5('0x3'));var fs=require('fs');var Redis=require(_0xb9d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9d5('0x5'));var logger=require('../../config/logger')(_0xb9d5('0x6'));var config=require(_0xb9d5('0x7'));var jayson=require(_0xb9d5('0x8'));var client=jayson[_0xb9d5('0x9')][_0xb9d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5144c7,_0x1ddb78,_0x35cf2){return new BPromise(function(_0x4dc4be,_0x2d3f66){return client[_0xb9d5('0xb')](_0x5144c7,_0x35cf2)[_0xb9d5('0xc')](function(_0x94e766){logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));logger['debug'](_0xb9d5('0xf'),_0x1ddb78,_0xb9d5('0xe'),JSON[_0xb9d5('0x10')](_0x94e766));if(_0x94e766[_0xb9d5('0x11')]){if(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x12')]===0x1f4){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);return _0x2d3f66(_0x94e766[_0xb9d5('0x11')]['message']);}logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x94e766['error'][_0xb9d5('0x13')]);return _0x4dc4be(_0x94e766[_0xb9d5('0x11')][_0xb9d5('0x13')]);}else{logger['info'](_0xb9d5('0xd'),_0x1ddb78,_0xb9d5('0xe'));_0x4dc4be(_0x94e766[_0xb9d5('0x14')][_0xb9d5('0x13')]);}})[_0xb9d5('0x15')](function(_0x321a77){logger[_0xb9d5('0x11')](_0xb9d5('0xd'),_0x1ddb78,_0x321a77);_0x2d3f66(_0x321a77);});});}exports[_0xb9d5('0x16')]=function(_0x436002){var _0x248cb3=this;return new Promise(function(_0xf2c261,_0x2f8df6){return db[_0xb9d5('0x17')]['create'](_0x436002[_0xb9d5('0x18')],{'raw':_0x436002[_0xb9d5('0x19')]?_0x436002[_0xb9d5('0x19')][_0xb9d5('0x1a')]===undefined?!![]:![]:!![]})[_0xb9d5('0xc')](function(_0x457d69){logger['info'](_0xb9d5('0x16'),_0x436002);logger['debug'](_0xb9d5('0x16'),_0x436002,JSON[_0xb9d5('0x10')](_0x457d69));_0xf2c261(_0x457d69);})[_0xb9d5('0x15')](function(_0x13fc35){logger[_0xb9d5('0x11')](_0xb9d5('0x16'),_0x13fc35[_0xb9d5('0x13')],_0x436002);_0x2f8df6(_0x248cb3[_0xb9d5('0x11')](0x1f4,_0x13fc35['message']));});});};exports[_0xb9d5('0x1b')]=function(_0x30b06f){var _0x5508c6=this;return new Promise(function(_0x1c0b89,_0x25ebf2){return db[_0xb9d5('0x17')]['update'](_0x30b06f[_0xb9d5('0x18')],{'raw':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f[_0xb9d5('0x19')][_0xb9d5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f[_0xb9d5('0x19')][_0xb9d5('0x1c')]||null:null,'attributes':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f[_0xb9d5('0x19')]['attributes']||null:null,'limit':_0x30b06f[_0xb9d5('0x19')]?_0x30b06f['options'][_0xb9d5('0x1d')]||null:null})[_0xb9d5('0xc')](function(_0x1de8e6){logger[_0xb9d5('0x1e')](_0xb9d5('0x1b'),_0x30b06f);logger[_0xb9d5('0x1f')](_0xb9d5('0x1b'),_0x30b06f,JSON[_0xb9d5('0x10')](_0x1de8e6));_0x1c0b89(_0x1de8e6);})[_0xb9d5('0x15')](function(_0x385701){logger[_0xb9d5('0x11')](_0xb9d5('0x1b'),_0x385701[_0xb9d5('0x13')],_0x30b06f);_0x25ebf2(_0x5508c6[_0xb9d5('0x11')](0x1f4,_0x385701[_0xb9d5('0x13')]));});});}; \ No newline at end of file +var _0x8603=['create','options','raw','debug','stringify','UpdateOpenchannelQueueReport','where','attributes','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x8603,0x190));var _0x3860=function(_0x481f54,_0x3d47d9){_0x481f54=_0x481f54-0x0;var _0x288091=_0x8603[_0x481f54];return _0x288091;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}exports[_0x3860('0x12')]=function(_0x45b799){var _0x4b6b15=this;return new Promise(function(_0x4863bd,_0x373b06){return db[_0x3860('0x13')][_0x3860('0x14')](_0x45b799['body'],{'raw':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x16')]===undefined?!![]:![]:!![]})[_0x3860('0x9')](function(_0x20a5b0){logger[_0x3860('0xf')](_0x3860('0x12'),_0x45b799);logger[_0x3860('0x17')](_0x3860('0x12'),_0x45b799,JSON[_0x3860('0x18')](_0x20a5b0));_0x4863bd(_0x20a5b0);})[_0x3860('0x11')](function(_0x2e0b6e){logger[_0x3860('0xd')](_0x3860('0x12'),_0x2e0b6e[_0x3860('0xe')],_0x45b799);_0x373b06(_0x4b6b15['error'](0x1f4,_0x2e0b6e[_0x3860('0xe')]));});});};exports[_0x3860('0x19')]=function(_0x2b91f2){var _0x301e03=this;return new Promise(function(_0x20bb1e,_0x56a6d1){return db[_0x3860('0x13')]['update'](_0x2b91f2['body'],{'raw':_0x2b91f2[_0x3860('0x15')]?_0x2b91f2[_0x3860('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b91f2['options']?_0x2b91f2['options'][_0x3860('0x1a')]||null:null,'attributes':_0x2b91f2[_0x3860('0x15')]?_0x2b91f2[_0x3860('0x15')][_0x3860('0x1b')]||null:null,'limit':_0x2b91f2[_0x3860('0x15')]?_0x2b91f2[_0x3860('0x15')]['limit']||null:null})['then'](function(_0x389bd0){logger[_0x3860('0xf')]('UpdateOpenchannelQueueReport',_0x2b91f2);logger[_0x3860('0x17')](_0x3860('0x19'),_0x2b91f2,JSON[_0x3860('0x18')](_0x389bd0));_0x20bb1e(_0x389bd0);})[_0x3860('0x11')](function(_0x3628f7){logger['error'](_0x3860('0x19'),_0x3628f7[_0x3860('0xe')],_0x2b91f2);_0x56a6d1(_0x301e03[_0x3860('0xd')](0x1f4,_0x3628f7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 158faca..cc80380 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 _0x02d9=['express','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3cc8ae,_0x5a5724){var _0x3d42e6=function(_0x58a51f){while(--_0x58a51f){_0x3cc8ae['push'](_0x3cc8ae['shift']());}};_0x3d42e6(++_0x5a5724);}(_0x02d9,0xd9));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('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x902d('0x5'));var config=require(_0x902d('0x6'));var controller=require(_0x902d('0x7'));router[_0x902d('0x8')]('/',auth[_0x902d('0x9')](),controller['index']);router['get'](_0x902d('0xa'),auth[_0x902d('0x9')](),controller[_0x902d('0xb')]);router[_0x902d('0x8')](_0x902d('0xc'),auth[_0x902d('0x9')](),controller['show']);router[_0x902d('0xd')]('/',auth[_0x902d('0x9')](),controller[_0x902d('0xe')]);router[_0x902d('0xf')]('/:id',auth[_0x902d('0x9')](),controller[_0x902d('0x10')]);router[_0x902d('0x11')](_0x902d('0xc'),auth[_0x902d('0x9')](),controller[_0x902d('0x12')]);module[_0x902d('0x13')]=router; \ No newline at end of file +var _0xdf86=['get','/:id','show','put','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','/describe'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xdf86,0x196));var _0x6df8=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0xdf86[_0x2ab365];return _0x49fef3;};'use strict';var multer=require(_0x6df8('0x0'));var util=require(_0x6df8('0x1'));var path=require('path');var timeout=require(_0x6df8('0x2'));var express=require(_0x6df8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6df8('0x4'));var config=require(_0x6df8('0x5'));var controller=require(_0x6df8('0x6'));router['get']('/',auth[_0x6df8('0x7')](),controller[_0x6df8('0x8')]);router['get'](_0x6df8('0x9'),auth[_0x6df8('0x7')](),controller['describe']);router[_0x6df8('0xa')](_0x6df8('0xb'),auth[_0x6df8('0x7')](),controller[_0x6df8('0xc')]);router['post']('/',auth[_0x6df8('0x7')](),controller['create']);router[_0x6df8('0xd')](_0x6df8('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6df8('0x7')](),controller[_0x6df8('0xe')]);module[_0x6df8('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 53765cd..b9b4339 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5aa17c,_0x5892b1){var _0x1d886b=function(_0x2f5bf7){while(--_0x2f5bf7){_0x5aa17c['push'](_0x5aa17c['shift']());}};_0x1d886b(++_0x5892b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x16aa70,_0x5b1f73){var _0x11875f=function(_0x18c7be){while(--_0x18c7be){_0x16aa70['push'](_0x16aa70['shift']());}};_0x11875f(++_0x5b1f73);}(_0x54ef,0x112));var _0xf54e=function(_0x12854b,_0x1c767a){_0x12854b=_0x12854b-0x0;var _0x5f2056=_0x54ef[_0x12854b];return _0x5f2056;};'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 894b2b7..7979b8d 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 _0x7ad8=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','error','name','send','index','map','OpenchannelTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','length','includeAll','include','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra'];(function(_0x47b80a,_0x14ccc0){var _0x35d4e8=function(_0x1ac2d7){while(--_0x1ac2d7){_0x47b80a['push'](_0x47b80a['shift']());}};_0x35d4e8(++_0x14ccc0);}(_0x7ad8,0x1ee));var _0x87ad=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7ad8[_0x139a3c];return _0x2b375b;};'use strict';var emlformat=require(_0x87ad('0x0'));var rimraf=require(_0x87ad('0x1'));var zipdir=require(_0x87ad('0x2'));var jsonpatch=require(_0x87ad('0x3'));var rp=require(_0x87ad('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87ad('0x5'));var util=require(_0x87ad('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x87ad('0x7'));var ejs=require(_0x87ad('0x8'));var fs=require('fs');var fs_extra=require(_0x87ad('0x9'));var _=require('lodash');var squel=require(_0x87ad('0xa'));var crypto=require(_0x87ad('0xb'));var jsforce=require(_0x87ad('0xc'));var deskjs=require(_0x87ad('0xd'));var toCsv=require('to-csv');var querystring=require(_0x87ad('0xe'));var Papa=require('papaparse');var Redis=require(_0x87ad('0xf'));var authService=require(_0x87ad('0x10'));var qs=require(_0x87ad('0x11'));var as=require(_0x87ad('0x12'));var hardwareService=require(_0x87ad('0x13'));var logger=require('../../config/logger')(_0x87ad('0x14'));var utils=require(_0x87ad('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x87ad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x514353,_0x235c56){_0x235c56=_0x235c56||0xcc;return function(_0x409ac4){if(_0x409ac4){return _0x514353[_0x87ad('0x17')](_0x235c56);}return _0x514353[_0x87ad('0x18')](_0x235c56)[_0x87ad('0x19')]();};}function respondWithResult(_0x439eef,_0xd0adad){_0xd0adad=_0xd0adad||0xc8;return function(_0x10c312){if(_0x10c312){return _0x439eef[_0x87ad('0x18')](_0xd0adad)[_0x87ad('0x1a')](_0x10c312);}};}function respondWithFilteredResult(_0x5a5a85,_0x577386){return function(_0x1b6c12){if(_0x1b6c12){var _0x180881=typeof _0x577386[_0x87ad('0x1b')]===_0x87ad('0x1c')&&typeof _0x577386[_0x87ad('0x1d')]==='undefined';var _0x2599cf=_0x1b6c12[_0x87ad('0x1e')];var _0x40cc11=_0x180881?0x0:_0x577386[_0x87ad('0x1b')];var _0x1180b2=_0x180881?_0x1b6c12[_0x87ad('0x1e')]:_0x577386['offset']+_0x577386[_0x87ad('0x1d')];var _0x16029b;if(_0x1180b2>=_0x2599cf){_0x1180b2=_0x2599cf;_0x16029b=0xc8;}else{_0x16029b=0xce;}_0x5a5a85['status'](_0x16029b);return _0x5a5a85['set'](_0x87ad('0x1f'),_0x40cc11+'-'+_0x1180b2+'/'+_0x2599cf)['json'](_0x1b6c12);}return null;};}function patchUpdates(_0x101980){return function(_0x16673a){try{jsonpatch[_0x87ad('0x20')](_0x16673a,_0x101980,!![]);}catch(_0x23403a){return BPromise['reject'](_0x23403a);}return _0x16673a[_0x87ad('0x21')]();};}function saveUpdates(_0x5d2bea,_0x5b50ba){return function(_0x13d229){if(_0x13d229){return _0x13d229['update'](_0x5d2bea)[_0x87ad('0x22')](function(_0x36274d){return _0x36274d;});}return null;};}function removeEntity(_0x39bd02,_0x5f48c9){return function(_0xd80d40){if(_0xd80d40){return _0xd80d40['destroy']()['then'](function(){_0x39bd02[_0x87ad('0x18')](0xcc)[_0x87ad('0x19')]();});}};}function handleEntityNotFound(_0x13a183,_0x4730d7){return function(_0x2f105e){if(!_0x2f105e){_0x13a183[_0x87ad('0x17')](0x194);}return _0x2f105e;};}function handleError(_0x51ca8f,_0x55638b){_0x55638b=_0x55638b||0x1f4;return function(_0x1fd8c1){logger[_0x87ad('0x23')](_0x1fd8c1['stack']);if(_0x1fd8c1[_0x87ad('0x24')]){delete _0x1fd8c1[_0x87ad('0x24')];}_0x51ca8f[_0x87ad('0x18')](_0x55638b)[_0x87ad('0x25')](_0x1fd8c1);};}exports[_0x87ad('0x26')]=function(_0x465646,_0x39cdac){var _0x335234={},_0xea4669={},_0x1cc4fb={'count':0x0,'rows':[]};var _0x56b880=_[_0x87ad('0x27')](db[_0x87ad('0x28')]['rawAttributes'],function(_0x40cea2){return{'name':_0x40cea2[_0x87ad('0x29')],'type':_0x40cea2[_0x87ad('0x2a')]['key']};});_0xea4669[_0x87ad('0x2b')]=_[_0x87ad('0x27')](_0x56b880,_0x87ad('0x24'));_0xea4669[_0x87ad('0x2c')]=_[_0x87ad('0x2d')](_0x465646[_0x87ad('0x2c')]);_0xea4669[_0x87ad('0x2e')]=_[_0x87ad('0x2f')](_0xea4669[_0x87ad('0x2b')],_0xea4669[_0x87ad('0x2c')]);_0x335234[_0x87ad('0x30')]=_[_0x87ad('0x2f')](_0xea4669['model'],qs[_0x87ad('0x31')](_0x465646[_0x87ad('0x2c')]['fields']));_0x335234[_0x87ad('0x30')]=_0x335234['attributes']['length']?_0x335234[_0x87ad('0x30')]:_0xea4669[_0x87ad('0x2b')];if(!_0x465646[_0x87ad('0x2c')][_0x87ad('0x32')](_0x87ad('0x33'))){_0x335234[_0x87ad('0x1d')]=qs[_0x87ad('0x1d')](_0x465646[_0x87ad('0x2c')][_0x87ad('0x1d')]);_0x335234[_0x87ad('0x1b')]=qs[_0x87ad('0x1b')](_0x465646[_0x87ad('0x2c')]['offset']);}_0x335234['order']=qs['sort'](_0x465646[_0x87ad('0x2c')][_0x87ad('0x34')]);_0x335234['where']=qs[_0x87ad('0x2e')](_[_0x87ad('0x35')](_0x465646[_0x87ad('0x2c')],_0xea4669[_0x87ad('0x2e')]),_0x56b880);if(_0x465646[_0x87ad('0x2c')][_0x87ad('0x36')]){_0x335234[_0x87ad('0x37')]=_['merge'](_0x335234[_0x87ad('0x37')],{'$or':_[_0x87ad('0x27')](_0x56b880,function(_0x13898b){if(_0x13898b['type']!==_0x87ad('0x38')){var _0x45e127={};_0x45e127[_0x13898b[_0x87ad('0x24')]]={'$like':'%'+_0x465646[_0x87ad('0x2c')][_0x87ad('0x36')]+'%'};return _0x45e127;}})});}_0x335234=_[_0x87ad('0x39')]({},_0x335234,_0x465646[_0x87ad('0x3a')]);var _0x1059f7={'where':_0x335234[_0x87ad('0x37')]};return db['OpenchannelTransferReport']['count'](_0x1059f7)[_0x87ad('0x22')](function(_0x1e48fd){_0x1cc4fb[_0x87ad('0x1e')]=_0x1e48fd;if(_0x465646[_0x87ad('0x2c')]['includeAll']){_0x335234['include']=[{'all':!![]}];}return db[_0x87ad('0x28')][_0x87ad('0x3b')](_0x335234);})['then'](function(_0x351bfa){_0x1cc4fb[_0x87ad('0x3c')]=_0x351bfa;return _0x1cc4fb;})[_0x87ad('0x22')](respondWithFilteredResult(_0x39cdac,_0x335234))[_0x87ad('0x3d')](handleError(_0x39cdac,null));};exports[_0x87ad('0x3e')]=function(_0x4ce843,_0x15071f){var _0x5ae58c={'raw':!![],'where':{'id':_0x4ce843[_0x87ad('0x3f')]['id']}},_0x939d98={};_0x939d98[_0x87ad('0x2b')]=_[_0x87ad('0x2d')](db[_0x87ad('0x28')]['rawAttributes']);_0x939d98[_0x87ad('0x2c')]=_[_0x87ad('0x2d')](_0x4ce843['query']);_0x939d98['filters']=_['intersection'](_0x939d98[_0x87ad('0x2b')],_0x939d98[_0x87ad('0x2c')]);_0x5ae58c[_0x87ad('0x30')]=_[_0x87ad('0x2f')](_0x939d98[_0x87ad('0x2b')],qs[_0x87ad('0x31')](_0x4ce843['query'][_0x87ad('0x31')]));_0x5ae58c[_0x87ad('0x30')]=_0x5ae58c[_0x87ad('0x30')][_0x87ad('0x40')]?_0x5ae58c[_0x87ad('0x30')]:_0x939d98[_0x87ad('0x2b')];if(_0x4ce843[_0x87ad('0x2c')][_0x87ad('0x41')]){_0x5ae58c[_0x87ad('0x42')]=[{'all':!![]}];}_0x5ae58c=_['merge']({},_0x5ae58c,_0x4ce843[_0x87ad('0x3a')]);return db[_0x87ad('0x28')]['find'](_0x5ae58c)[_0x87ad('0x22')](handleEntityNotFound(_0x15071f,null))[_0x87ad('0x22')](respondWithResult(_0x15071f,null))['catch'](handleError(_0x15071f,null));};exports[_0x87ad('0x43')]=function(_0xccdf2f,_0x52814f){return db[_0x87ad('0x28')]['create'](_0xccdf2f[_0x87ad('0x44')],{})[_0x87ad('0x22')](respondWithResult(_0x52814f,0xc9))[_0x87ad('0x3d')](handleError(_0x52814f,null));};exports['update']=function(_0x32767c,_0x79e80a){if(_0x32767c['body']['id']){delete _0x32767c[_0x87ad('0x44')]['id'];}return db[_0x87ad('0x28')]['find']({'where':{'id':_0x32767c[_0x87ad('0x3f')]['id']}})[_0x87ad('0x22')](handleEntityNotFound(_0x79e80a,null))[_0x87ad('0x22')](saveUpdates(_0x32767c['body'],null))[_0x87ad('0x22')](respondWithResult(_0x79e80a,null))['catch'](handleError(_0x79e80a,null));};exports[_0x87ad('0x45')]=function(_0x2f523e,_0x2e00af){return db[_0x87ad('0x28')][_0x87ad('0x46')]({'where':{'id':_0x2f523e[_0x87ad('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2e00af,null))[_0x87ad('0x22')](removeEntity(_0x2e00af,null))['catch'](handleError(_0x2e00af,null));};exports['describe']=function(_0x5692d7,_0x416d06){return db[_0x87ad('0x28')][_0x87ad('0x47')]()[_0x87ad('0x22')](respondWithResult(_0x416d06,null))[_0x87ad('0x3d')](handleError(_0x416d06,null));}; \ No newline at end of file +var _0x8e2a=['../../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','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','show','params','fields','length','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x353643,_0x568495){var _0x394b32=function(_0x3924ae){while(--_0x3924ae){_0x353643['push'](_0x353643['shift']());}};_0x394b32(++_0x568495);}(_0x8e2a,0x1ee));var _0xa8e2=function(_0x4cce7e,_0x1a1050){_0x4cce7e=_0x4cce7e-0x0;var _0x4eaf71=_0x8e2a[_0x4cce7e];return _0x4eaf71;};'use strict';var emlformat=require(_0xa8e2('0x0'));var rimraf=require(_0xa8e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa8e2('0x2'));var moment=require(_0xa8e2('0x3'));var BPromise=require(_0xa8e2('0x4'));var Mustache=require(_0xa8e2('0x5'));var util=require(_0xa8e2('0x6'));var path=require(_0xa8e2('0x7'));var sox=require(_0xa8e2('0x8'));var csv=require(_0xa8e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8e2('0xa'));var _=require('lodash');var squel=require(_0xa8e2('0xb'));var crypto=require(_0xa8e2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa8e2('0x9'));var querystring=require(_0xa8e2('0xd'));var Papa=require(_0xa8e2('0xe'));var Redis=require(_0xa8e2('0xf'));var authService=require(_0xa8e2('0x10'));var qs=require(_0xa8e2('0x11'));var as=require(_0xa8e2('0x12'));var hardwareService=require(_0xa8e2('0x13'));var logger=require('../../config/logger')(_0xa8e2('0x14'));var utils=require('../../config/utils');var config=require(_0xa8e2('0x15'));var licenseUtil=require(_0xa8e2('0x16'));var db=require(_0xa8e2('0x17'))['db'];function respondWithStatusCode(_0xb20f55,_0x215806){_0x215806=_0x215806||0xcc;return function(_0x383d43){if(_0x383d43){return _0xb20f55[_0xa8e2('0x18')](_0x215806);}return _0xb20f55[_0xa8e2('0x19')](_0x215806)[_0xa8e2('0x1a')]();};}function respondWithResult(_0x2762b3,_0x34331d){_0x34331d=_0x34331d||0xc8;return function(_0x364850){if(_0x364850){return _0x2762b3[_0xa8e2('0x19')](_0x34331d)[_0xa8e2('0x1b')](_0x364850);}};}function respondWithFilteredResult(_0x5e7592,_0xbe1e65){return function(_0x45e9ee){if(_0x45e9ee){var _0x42854a=typeof _0xbe1e65[_0xa8e2('0x1c')]===_0xa8e2('0x1d')&&typeof _0xbe1e65[_0xa8e2('0x1e')]===_0xa8e2('0x1d');var _0x59d4fd=_0x45e9ee['count'];var _0x38ac78=_0x42854a?0x0:_0xbe1e65[_0xa8e2('0x1c')];var _0xfb322f=_0x42854a?_0x45e9ee[_0xa8e2('0x1f')]:_0xbe1e65[_0xa8e2('0x1c')]+_0xbe1e65[_0xa8e2('0x1e')];var _0x33a29f;if(_0xfb322f>=_0x59d4fd){_0xfb322f=_0x59d4fd;_0x33a29f=0xc8;}else{_0x33a29f=0xce;}_0x5e7592[_0xa8e2('0x19')](_0x33a29f);return _0x5e7592[_0xa8e2('0x20')](_0xa8e2('0x21'),_0x38ac78+'-'+_0xfb322f+'/'+_0x59d4fd)[_0xa8e2('0x1b')](_0x45e9ee);}return null;};}function patchUpdates(_0x23a546){return function(_0x4fe4c3){try{jsonpatch[_0xa8e2('0x22')](_0x4fe4c3,_0x23a546,!![]);}catch(_0x476ad7){return BPromise[_0xa8e2('0x23')](_0x476ad7);}return _0x4fe4c3[_0xa8e2('0x24')]();};}function saveUpdates(_0x341ae3,_0x1549b0){return function(_0x11f5e1){if(_0x11f5e1){return _0x11f5e1[_0xa8e2('0x25')](_0x341ae3)[_0xa8e2('0x26')](function(_0x2f7f63){return _0x2f7f63;});}return null;};}function removeEntity(_0x186194,_0x1c0451){return function(_0x453cf1){if(_0x453cf1){return _0x453cf1[_0xa8e2('0x27')]()['then'](function(){_0x186194['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b0cd8,_0x2c895c){return function(_0xbd22f0){if(!_0xbd22f0){_0x3b0cd8[_0xa8e2('0x18')](0x194);}return _0xbd22f0;};}function handleError(_0x5f42e4,_0x1ff7f8){_0x1ff7f8=_0x1ff7f8||0x1f4;return function(_0x55d39b){logger['error'](_0x55d39b['stack']);if(_0x55d39b[_0xa8e2('0x28')]){delete _0x55d39b['name'];}_0x5f42e4['status'](_0x1ff7f8)[_0xa8e2('0x29')](_0x55d39b);};}exports[_0xa8e2('0x2a')]=function(_0x580427,_0xa6519b){var _0xbbce92={},_0x5aa243={},_0xc5804a={'count':0x0,'rows':[]};var _0x3b6fde=_[_0xa8e2('0x2b')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x1eae5d){return{'name':_0x1eae5d['fieldName'],'type':_0x1eae5d[_0xa8e2('0x2c')][_0xa8e2('0x2d')]};});_0x5aa243[_0xa8e2('0x2e')]=_['map'](_0x3b6fde,_0xa8e2('0x28'));_0x5aa243['query']=_[_0xa8e2('0x2f')](_0x580427[_0xa8e2('0x30')]);_0x5aa243[_0xa8e2('0x31')]=_[_0xa8e2('0x32')](_0x5aa243['model'],_0x5aa243[_0xa8e2('0x30')]);_0xbbce92[_0xa8e2('0x33')]=_[_0xa8e2('0x32')](_0x5aa243[_0xa8e2('0x2e')],qs['fields'](_0x580427[_0xa8e2('0x30')]['fields']));_0xbbce92['attributes']=_0xbbce92[_0xa8e2('0x33')]['length']?_0xbbce92[_0xa8e2('0x33')]:_0x5aa243[_0xa8e2('0x2e')];if(!_0x580427[_0xa8e2('0x30')][_0xa8e2('0x34')](_0xa8e2('0x35'))){_0xbbce92[_0xa8e2('0x1e')]=qs[_0xa8e2('0x1e')](_0x580427[_0xa8e2('0x30')][_0xa8e2('0x1e')]);_0xbbce92[_0xa8e2('0x1c')]=qs[_0xa8e2('0x1c')](_0x580427[_0xa8e2('0x30')]['offset']);}_0xbbce92[_0xa8e2('0x36')]=qs[_0xa8e2('0x37')](_0x580427[_0xa8e2('0x30')][_0xa8e2('0x37')]);_0xbbce92[_0xa8e2('0x38')]=qs['filters'](_[_0xa8e2('0x39')](_0x580427[_0xa8e2('0x30')],_0x5aa243[_0xa8e2('0x31')]),_0x3b6fde);if(_0x580427[_0xa8e2('0x30')][_0xa8e2('0x3a')]){_0xbbce92[_0xa8e2('0x38')]=_[_0xa8e2('0x3b')](_0xbbce92[_0xa8e2('0x38')],{'$or':_['map'](_0x3b6fde,function(_0x56a222){if(_0x56a222[_0xa8e2('0x2c')]!=='VIRTUAL'){var _0x5c263a={};_0x5c263a[_0x56a222[_0xa8e2('0x28')]]={'$like':'%'+_0x580427[_0xa8e2('0x30')]['filter']+'%'};return _0x5c263a;}})});}_0xbbce92=_['merge']({},_0xbbce92,_0x580427[_0xa8e2('0x3c')]);var _0x41625e={'where':_0xbbce92[_0xa8e2('0x38')]};return db[_0xa8e2('0x3d')][_0xa8e2('0x1f')](_0x41625e)[_0xa8e2('0x26')](function(_0x39713e){_0xc5804a['count']=_0x39713e;if(_0x580427['query'][_0xa8e2('0x3e')]){_0xbbce92['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xa8e2('0x3f')](_0xbbce92);})[_0xa8e2('0x26')](function(_0x3e3bd5){_0xc5804a[_0xa8e2('0x40')]=_0x3e3bd5;return _0xc5804a;})[_0xa8e2('0x26')](respondWithFilteredResult(_0xa6519b,_0xbbce92))[_0xa8e2('0x41')](handleError(_0xa6519b,null));};exports[_0xa8e2('0x42')]=function(_0x449ac0,_0x1de9d6){var _0x47d063={'raw':!![],'where':{'id':_0x449ac0[_0xa8e2('0x43')]['id']}},_0x1c21c7={};_0x1c21c7['model']=_[_0xa8e2('0x2f')](db['OpenchannelTransferReport']['rawAttributes']);_0x1c21c7[_0xa8e2('0x30')]=_[_0xa8e2('0x2f')](_0x449ac0[_0xa8e2('0x30')]);_0x1c21c7['filters']=_[_0xa8e2('0x32')](_0x1c21c7[_0xa8e2('0x2e')],_0x1c21c7['query']);_0x47d063['attributes']=_['intersection'](_0x1c21c7[_0xa8e2('0x2e')],qs[_0xa8e2('0x44')](_0x449ac0[_0xa8e2('0x30')][_0xa8e2('0x44')]));_0x47d063[_0xa8e2('0x33')]=_0x47d063[_0xa8e2('0x33')][_0xa8e2('0x45')]?_0x47d063['attributes']:_0x1c21c7[_0xa8e2('0x2e')];if(_0x449ac0[_0xa8e2('0x30')][_0xa8e2('0x3e')]){_0x47d063['include']=[{'all':!![]}];}_0x47d063=_[_0xa8e2('0x3b')]({},_0x47d063,_0x449ac0['options']);return db[_0xa8e2('0x3d')][_0xa8e2('0x46')](_0x47d063)['then'](handleEntityNotFound(_0x1de9d6,null))['then'](respondWithResult(_0x1de9d6,null))[_0xa8e2('0x41')](handleError(_0x1de9d6,null));};exports['create']=function(_0x4c7b42,_0x2a7a0c){return db['OpenchannelTransferReport'][_0xa8e2('0x47')](_0x4c7b42[_0xa8e2('0x48')],{})[_0xa8e2('0x26')](respondWithResult(_0x2a7a0c,0xc9))['catch'](handleError(_0x2a7a0c,null));};exports[_0xa8e2('0x25')]=function(_0x2d9959,_0x38f985){if(_0x2d9959['body']['id']){delete _0x2d9959[_0xa8e2('0x48')]['id'];}return db['OpenchannelTransferReport'][_0xa8e2('0x46')]({'where':{'id':_0x2d9959[_0xa8e2('0x43')]['id']}})[_0xa8e2('0x26')](handleEntityNotFound(_0x38f985,null))[_0xa8e2('0x26')](saveUpdates(_0x2d9959['body'],null))[_0xa8e2('0x26')](respondWithResult(_0x38f985,null))[_0xa8e2('0x41')](handleError(_0x38f985,null));};exports['destroy']=function(_0xdd35ee,_0x309684){return db[_0xa8e2('0x3d')]['find']({'where':{'id':_0xdd35ee[_0xa8e2('0x43')]['id']}})[_0xa8e2('0x26')](handleEntityNotFound(_0x309684,null))[_0xa8e2('0x26')](removeEntity(_0x309684,null))[_0xa8e2('0x41')](handleError(_0x309684,null));};exports['describe']=function(_0x3c8c67,_0x250c3e){return db[_0xa8e2('0x3d')]['describe']()[_0xa8e2('0x26')](respondWithResult(_0x250c3e,null))[_0xa8e2('0x41')](handleError(_0x250c3e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 5fa9e12..0a10638 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 _0xda9d=['report_openchannel_transfer','uniqueid','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport'];(function(_0x475ed8,_0x15f91a){var _0x144a90=function(_0x2d4053){while(--_0x2d4053){_0x475ed8['push'](_0x475ed8['shift']());}};_0x144a90(++_0x15f91a);}(_0xda9d,0x1f1));var _0xdda9=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xda9d[_0x18a436];return _0x5c2cf8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdda9('0x0'))(_0xdda9('0x1'));var moment=require(_0xdda9('0x2'));var BPromise=require('bluebird');var rp=require(_0xdda9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdda9('0x4'));var config=require(_0xdda9('0x5'));var attributes=require(_0xdda9('0x6'));module[_0xdda9('0x7')]=function(_0x17f5e0,_0x387e5d){return _0x17f5e0['define'](_0xdda9('0x8'),attributes,{'tableName':_0xdda9('0x9'),'paranoid':![],'indexes':[{'name':_0xdda9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa853=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','define','report_openchannel_transfer','uniqueid','lodash'];(function(_0x34c11d,_0xba83d0){var _0x5f2f15=function(_0x40551f){while(--_0x40551f){_0x34c11d['push'](_0x34c11d['shift']());}};_0x5f2f15(++_0xba83d0);}(_0xa853,0x77));var _0x3a85=function(_0x4c03e6,_0x33fde0){_0x4c03e6=_0x4c03e6-0x0;var _0x49e7dd=_0xa853[_0x4c03e6];return _0x49e7dd;};'use strict';var _=require(_0x3a85('0x0'));var util=require(_0x3a85('0x1'));var logger=require(_0x3a85('0x2'))(_0x3a85('0x3'));var moment=require('moment');var BPromise=require(_0x3a85('0x4'));var rp=require(_0x3a85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a85('0x6'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x27f36b,_0x46b4d1){return _0x27f36b[_0x3a85('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0x3a85('0x8'),'paranoid':![],'indexes':[{'name':_0x3a85('0x9'),'fields':[_0x3a85('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index a8346a0..668b737 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 _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x16aadf,_0x5ae6f3){var _0x30fad9=function(_0x1cf8f1){while(--_0x1cf8f1){_0x16aadf['push'](_0x16aadf['shift']());}};_0x30fad9(++_0x5ae6f3);}(_0xda19,0xd5));var _0x9da1=function(_0x5bd9d5,_0x433033){_0x5bd9d5=_0x5bd9d5-0x0;var _0x1afbf8=_0xda19[_0x5bd9d5];return _0x1afbf8;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file +var _0x61df=['request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x256beb,_0x2eb9cc){var _0xca7dd1=function(_0x18cbe6){while(--_0x18cbe6){_0x256beb['push'](_0x256beb['shift']());}};_0xca7dd1(++_0x2eb9cc);}(_0x61df,0xbd));var _0xf61d=function(_0x299d5,_0x24d5a8){_0x299d5=_0x299d5-0x0;var _0x1f7ae1=_0x61df[_0x299d5];return _0x1f7ae1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf61d('0x0'));var rs=require(_0xf61d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf61d('0x2'))['db'];var utils=require(_0xf61d('0x3'));var logger=require('../../config/logger')(_0xf61d('0x4'));var config=require(_0xf61d('0x5'));var jayson=require(_0xf61d('0x6'));var client=jayson[_0xf61d('0x7')][_0xf61d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ac0ec,_0x5f0981,_0x42b382){return new BPromise(function(_0x49523e,_0x32ad93){return client[_0xf61d('0x9')](_0x3ac0ec,_0x42b382)[_0xf61d('0xa')](function(_0x1a5f29){logger[_0xf61d('0xb')](_0xf61d('0xc'),_0x5f0981,_0xf61d('0xd'));logger[_0xf61d('0xe')](_0xf61d('0xf'),_0x5f0981,_0xf61d('0xd'),JSON[_0xf61d('0x10')](_0x1a5f29));if(_0x1a5f29[_0xf61d('0x11')]){if(_0x1a5f29['error'][_0xf61d('0x12')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x5f0981,_0x1a5f29[_0xf61d('0x11')]['message']);return _0x32ad93(_0x1a5f29['error']['message']);}logger[_0xf61d('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5f0981,_0x1a5f29['error'][_0xf61d('0x13')]);return _0x49523e(_0x1a5f29[_0xf61d('0x11')][_0xf61d('0x13')]);}else{logger[_0xf61d('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5f0981,_0xf61d('0xd'));_0x49523e(_0x1a5f29[_0xf61d('0x14')][_0xf61d('0x13')]);}})[_0xf61d('0x15')](function(_0x51405a){logger['error'](_0xf61d('0xc'),_0x5f0981,_0x51405a);_0x32ad93(_0x51405a);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2f3af5a..f59eab1 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 _0x7502=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','exports','multer','util','path'];(function(_0x5c3432,_0x46c2b2){var _0x2985cd=function(_0x4f24e6){while(--_0x4f24e6){_0x5c3432['push'](_0x5c3432['shift']());}};_0x2985cd(++_0x46c2b2);}(_0x7502,0x11e));var _0x2750=function(_0x562165,_0x4444a4){_0x562165=_0x562165-0x0;var _0x31beb8=_0x7502[_0x562165];return _0x31beb8;};'use strict';var multer=require(_0x2750('0x0'));var util=require(_0x2750('0x1'));var path=require(_0x2750('0x2'));var timeout=require(_0x2750('0x3'));var express=require(_0x2750('0x4'));var router=express['Router']();var fs_extra=require(_0x2750('0x5'));var auth=require(_0x2750('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2750('0x7'));var controller=require('./pause.controller');router[_0x2750('0x8')]('/',auth[_0x2750('0x9')](),controller['index']);router[_0x2750('0x8')](_0x2750('0xa'),auth[_0x2750('0x9')](),controller[_0x2750('0xb')]);router[_0x2750('0xc')]('/',auth[_0x2750('0x9')](),controller['create']);router[_0x2750('0xd')](_0x2750('0xa'),auth[_0x2750('0x9')](),controller[_0x2750('0xe')]);router[_0x2750('0xf')](_0x2750('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x2750('0x10')]=router; \ No newline at end of file +var _0x712f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','delete','destroy','util','path'];(function(_0x2b45d3,_0x54fb9f){var _0x48a09d=function(_0xe8dce4){while(--_0xe8dce4){_0x2b45d3['push'](_0x2b45d3['shift']());}};_0x48a09d(++_0x54fb9f);}(_0x712f,0x1de));var _0xf712=function(_0x469906,_0x40e3d6){_0x469906=_0x469906-0x0;var _0x143198=_0x712f[_0x469906];return _0x143198;};'use strict';var multer=require('multer');var util=require(_0xf712('0x0'));var path=require(_0xf712('0x1'));var timeout=require('connect-timeout');var express=require(_0xf712('0x2'));var router=express[_0xf712('0x3')]();var fs_extra=require(_0xf712('0x4'));var auth=require(_0xf712('0x5'));var interaction=require(_0xf712('0x6'));var config=require(_0xf712('0x7'));var controller=require(_0xf712('0x8'));router[_0xf712('0x9')]('/',auth[_0xf712('0xa')](),controller['index']);router['get'](_0xf712('0xb'),auth[_0xf712('0xa')](),controller[_0xf712('0xc')]);router[_0xf712('0xd')]('/',auth[_0xf712('0xa')](),controller['create']);router['put'](_0xf712('0xb'),auth[_0xf712('0xa')](),controller['update']);router[_0xf712('0xe')](_0xf712('0xb'),auth['isAuthenticated'](),controller[_0xf712('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index b705a25..18ed048 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 _0xa293=['name','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa293,0xad));var _0x3a29=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xa293[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3a29('0x0')],'unique':_0x3a29('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x3a29('0x0')]}}; \ No newline at end of file +var _0x326b=['STRING','name','sequelize'];(function(_0x5e407c,_0x37f409){var _0x57c62b=function(_0x22659b){while(--_0x22659b){_0x5e407c['push'](_0x5e407c['shift']());}};_0x57c62b(++_0x37f409);}(_0x326b,0x13d));var _0xb326=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0x326b[_0x5a6961];return _0x4af0a6;};'use strict';var Sequelize=require(_0xb326('0x0'));module['exports']={'name':{'type':Sequelize[_0xb326('0x1')],'unique':_0xb326('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6581e56..13ef87a 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 _0xb260=['limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Pause','includeAll','include','findAll','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x2b029b,_0x42780c){var _0x1b6a04=function(_0x3c867b){while(--_0x3c867b){_0x2b029b['push'](_0x2b029b['shift']());}};_0x1b6a04(++_0x42780c);}(_0xb260,0xd9));var _0x0b26=function(_0x25cb0f,_0x38976c){_0x25cb0f=_0x25cb0f-0x0;var _0x4b23c8=_0xb260[_0x25cb0f];return _0x4b23c8;};'use strict';var emlformat=require(_0x0b26('0x0'));var rimraf=require(_0x0b26('0x1'));var zipdir=require(_0x0b26('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b26('0x3'));var moment=require(_0x0b26('0x4'));var BPromise=require(_0x0b26('0x5'));var Mustache=require(_0x0b26('0x6'));var util=require(_0x0b26('0x7'));var path=require(_0x0b26('0x8'));var sox=require(_0x0b26('0x9'));var csv=require(_0x0b26('0xa'));var ejs=require(_0x0b26('0xb'));var fs=require('fs');var fs_extra=require(_0x0b26('0xc'));var _=require('lodash');var squel=require(_0x0b26('0xd'));var crypto=require(_0x0b26('0xe'));var jsforce=require(_0x0b26('0xf'));var deskjs=require(_0x0b26('0x10'));var toCsv=require(_0x0b26('0xa'));var querystring=require(_0x0b26('0x11'));var Papa=require(_0x0b26('0x12'));var Redis=require('ioredis');var authService=require(_0x0b26('0x13'));var qs=require(_0x0b26('0x14'));var as=require(_0x0b26('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b26('0x16'))(_0x0b26('0x17'));var utils=require('../../config/utils');var config=require(_0x0b26('0x18'));var licenseUtil=require(_0x0b26('0x19'));var db=require(_0x0b26('0x1a'))['db'];function respondWithStatusCode(_0x3204ef,_0x2b3ee3){_0x2b3ee3=_0x2b3ee3||0xcc;return function(_0x13351d){if(_0x13351d){return _0x3204ef[_0x0b26('0x1b')](_0x2b3ee3);}return _0x3204ef[_0x0b26('0x1c')](_0x2b3ee3)['end']();};}function respondWithResult(_0x1fdca1,_0x3672ea){_0x3672ea=_0x3672ea||0xc8;return function(_0x4cb2d9){if(_0x4cb2d9){return _0x1fdca1['status'](_0x3672ea)[_0x0b26('0x1d')](_0x4cb2d9);}};}function respondWithFilteredResult(_0x525d1f,_0x5e81c9){return function(_0x10b467){if(_0x10b467){var _0x41bc3c=typeof _0x5e81c9[_0x0b26('0x1e')]===_0x0b26('0x1f')&&typeof _0x5e81c9[_0x0b26('0x20')]===_0x0b26('0x1f');var _0x234a9=_0x10b467[_0x0b26('0x21')];var _0x42cd70=_0x41bc3c?0x0:_0x5e81c9['offset'];var _0x5f4db6=_0x41bc3c?_0x10b467[_0x0b26('0x21')]:_0x5e81c9['offset']+_0x5e81c9['limit'];var _0x326e8d;if(_0x5f4db6>=_0x234a9){_0x5f4db6=_0x234a9;_0x326e8d=0xc8;}else{_0x326e8d=0xce;}_0x525d1f[_0x0b26('0x1c')](_0x326e8d);return _0x525d1f['set'](_0x0b26('0x22'),_0x42cd70+'-'+_0x5f4db6+'/'+_0x234a9)[_0x0b26('0x1d')](_0x10b467);}return null;};}function patchUpdates(_0x230984){return function(_0x146898){try{jsonpatch[_0x0b26('0x23')](_0x146898,_0x230984,!![]);}catch(_0xef3bfe){return BPromise[_0x0b26('0x24')](_0xef3bfe);}return _0x146898[_0x0b26('0x25')]();};}function saveUpdates(_0x47ee2b,_0x3ee3bb){return function(_0x215e54){if(_0x215e54){return _0x215e54[_0x0b26('0x26')](_0x47ee2b)[_0x0b26('0x27')](function(_0x5de29d){return _0x5de29d;});}return null;};}function removeEntity(_0x263856,_0x198cc6){return function(_0x393e64){if(_0x393e64){return _0x393e64[_0x0b26('0x28')]()['then'](function(){var _0x119e96=_0x393e64[_0x0b26('0x29')]({'plain':!![]});var _0x5733ec=_0x0b26('0x2a');return db[_0x0b26('0x2b')]['destroy']({'where':{'type':_0x5733ec,'resourceId':_0x119e96['id']}})[_0x0b26('0x27')](function(){return _0x393e64;});})['then'](function(){_0x263856['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19592a,_0x350915){return function(_0x58b0ae){if(!_0x58b0ae){_0x19592a['sendStatus'](0x194);}return _0x58b0ae;};}function handleError(_0x2f60da,_0x273fcc){_0x273fcc=_0x273fcc||0x1f4;return function(_0x453156){logger[_0x0b26('0x2c')](_0x453156[_0x0b26('0x2d')]);if(_0x453156[_0x0b26('0x2e')]){delete _0x453156[_0x0b26('0x2e')];}_0x2f60da[_0x0b26('0x1c')](_0x273fcc)['send'](_0x453156);};}exports['index']=function(_0x396a3f,_0x9f8ff6){var _0x23f461={},_0x40d3a1={},_0x2cc0e0={'count':0x0,'rows':[]};var _0x15c03c=_[_0x0b26('0x2f')](db['Pause'][_0x0b26('0x30')],function(_0x1a90e3){return{'name':_0x1a90e3[_0x0b26('0x31')],'type':_0x1a90e3[_0x0b26('0x32')][_0x0b26('0x33')]};});_0x40d3a1[_0x0b26('0x34')]=_[_0x0b26('0x2f')](_0x15c03c,'name');_0x40d3a1['query']=_[_0x0b26('0x35')](_0x396a3f['query']);_0x40d3a1[_0x0b26('0x36')]=_[_0x0b26('0x37')](_0x40d3a1[_0x0b26('0x34')],_0x40d3a1[_0x0b26('0x38')]);_0x23f461[_0x0b26('0x39')]=_[_0x0b26('0x37')](_0x40d3a1[_0x0b26('0x34')],qs[_0x0b26('0x3a')](_0x396a3f[_0x0b26('0x38')][_0x0b26('0x3a')]));_0x23f461['attributes']=_0x23f461[_0x0b26('0x39')][_0x0b26('0x3b')]?_0x23f461[_0x0b26('0x39')]:_0x40d3a1[_0x0b26('0x34')];if(!_0x396a3f[_0x0b26('0x38')][_0x0b26('0x3c')](_0x0b26('0x3d'))){_0x23f461['limit']=qs[_0x0b26('0x20')](_0x396a3f['query'][_0x0b26('0x20')]);_0x23f461['offset']=qs[_0x0b26('0x1e')](_0x396a3f[_0x0b26('0x38')][_0x0b26('0x1e')]);}_0x23f461[_0x0b26('0x3e')]=qs['sort'](_0x396a3f[_0x0b26('0x38')][_0x0b26('0x3f')]);_0x23f461[_0x0b26('0x40')]=qs[_0x0b26('0x36')](_[_0x0b26('0x41')](_0x396a3f['query'],_0x40d3a1[_0x0b26('0x36')]),_0x15c03c);if(_0x396a3f[_0x0b26('0x38')][_0x0b26('0x42')]){_0x23f461[_0x0b26('0x40')]=_[_0x0b26('0x43')](_0x23f461[_0x0b26('0x40')],{'$or':_[_0x0b26('0x2f')](_0x15c03c,function(_0x57843d){if(_0x57843d[_0x0b26('0x32')]!=='VIRTUAL'){var _0x2db837={};_0x2db837[_0x57843d['name']]={'$like':'%'+_0x396a3f[_0x0b26('0x38')][_0x0b26('0x42')]+'%'};return _0x2db837;}})});}_0x23f461=_[_0x0b26('0x43')]({},_0x23f461,_0x396a3f[_0x0b26('0x44')]);var _0x64ea34={'where':_0x23f461[_0x0b26('0x40')]};return db[_0x0b26('0x45')]['count'](_0x64ea34)['then'](function(_0x16ffb8){_0x2cc0e0[_0x0b26('0x21')]=_0x16ffb8;if(_0x396a3f['query'][_0x0b26('0x46')]){_0x23f461[_0x0b26('0x47')]=[{'all':!![]}];}return db[_0x0b26('0x45')][_0x0b26('0x48')](_0x23f461);})[_0x0b26('0x27')](function(_0x400ac8){_0x2cc0e0['rows']=_0x400ac8;return _0x2cc0e0;})[_0x0b26('0x27')](respondWithFilteredResult(_0x9f8ff6,_0x23f461))[_0x0b26('0x49')](handleError(_0x9f8ff6,null));};exports['show']=function(_0x4b7293,_0x562a7d){var _0x350bc2={'raw':!![],'where':{'id':_0x4b7293[_0x0b26('0x4a')]['id']}},_0xf410d3={};_0xf410d3['model']=_[_0x0b26('0x35')](db[_0x0b26('0x45')][_0x0b26('0x30')]);_0xf410d3['query']=_[_0x0b26('0x35')](_0x4b7293[_0x0b26('0x38')]);_0xf410d3[_0x0b26('0x36')]=_[_0x0b26('0x37')](_0xf410d3[_0x0b26('0x34')],_0xf410d3['query']);_0x350bc2[_0x0b26('0x39')]=_[_0x0b26('0x37')](_0xf410d3[_0x0b26('0x34')],qs['fields'](_0x4b7293[_0x0b26('0x38')][_0x0b26('0x3a')]));_0x350bc2[_0x0b26('0x39')]=_0x350bc2['attributes'][_0x0b26('0x3b')]?_0x350bc2['attributes']:_0xf410d3[_0x0b26('0x34')];if(_0x4b7293['query'][_0x0b26('0x46')]){_0x350bc2[_0x0b26('0x47')]=[{'all':!![]}];}_0x350bc2=_[_0x0b26('0x43')]({},_0x350bc2,_0x4b7293[_0x0b26('0x44')]);return db[_0x0b26('0x45')]['find'](_0x350bc2)[_0x0b26('0x27')](handleEntityNotFound(_0x562a7d,null))[_0x0b26('0x27')](respondWithResult(_0x562a7d,null))[_0x0b26('0x49')](handleError(_0x562a7d,null));};exports[_0x0b26('0x4b')]=function(_0x2e3f1e,_0x365b7c){return db[_0x0b26('0x45')]['create'](_0x2e3f1e[_0x0b26('0x4c')],{})['then'](function(_0x4fd5e1){var _0x5978af=_0x2e3f1e['user']['get']({'plain':!![]});if(!_0x5978af)throw new Error(_0x0b26('0x4d'));if(_0x5978af['role']===_0x0b26('0x4e')){var _0x527327=_0x4fd5e1[_0x0b26('0x29')]({'plain':!![]});var _0x7b9fe8=_0x0b26('0x2a');return db[_0x0b26('0x4f')][_0x0b26('0x50')]({'where':{'name':_0x7b9fe8,'userProfileId':_0x5978af[_0x0b26('0x51')]},'raw':!![]})[_0x0b26('0x27')](function(_0x573cc1){if(_0x573cc1&&_0x573cc1[_0x0b26('0x52')]===0x0){return db[_0x0b26('0x2b')][_0x0b26('0x4b')]({'name':_0x527327[_0x0b26('0x2e')],'resourceId':_0x527327['id'],'type':_0x573cc1[_0x0b26('0x2e')],'sectionId':_0x573cc1['id']},{})[_0x0b26('0x27')](function(){return _0x4fd5e1;});}else{return _0x4fd5e1;}})[_0x0b26('0x49')](function(_0x25345c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25345c);throw _0x25345c;});}return _0x4fd5e1;})['then'](respondWithResult(_0x365b7c,0xc9))['catch'](handleError(_0x365b7c,null));};exports[_0x0b26('0x26')]=function(_0x285f95,_0x5085cf){if(_0x285f95['body']['id']){delete _0x285f95[_0x0b26('0x4c')]['id'];}return db[_0x0b26('0x45')][_0x0b26('0x50')]({'where':{'id':_0x285f95['params']['id']}})['then'](handleEntityNotFound(_0x5085cf,null))['then'](saveUpdates(_0x285f95[_0x0b26('0x4c')],null))[_0x0b26('0x27')](respondWithResult(_0x5085cf,null))['catch'](handleError(_0x5085cf,null));};exports[_0x0b26('0x28')]=function(_0x1393cc,_0x379e2e){return db[_0x0b26('0x45')]['find']({'where':{'id':_0x1393cc['params']['id']}})[_0x0b26('0x27')](handleEntityNotFound(_0x379e2e,null))[_0x0b26('0x27')](removeEntity(_0x379e2e,null))[_0x0b26('0x49')](handleError(_0x379e2e,null));}; \ No newline at end of file +var _0x3ec0=['fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x1f2f61,_0x586f2f){var _0x10dabc=function(_0x3233b5){while(--_0x3233b5){_0x1f2f61['push'](_0x1f2f61['shift']());}};_0x10dabc(++_0x586f2f);}(_0x3ec0,0x6e));var _0x03ec=function(_0x33f0be,_0x503a46){_0x33f0be=_0x33f0be-0x0;var _0x14aa07=_0x3ec0[_0x33f0be];return _0x14aa07;};'use strict';var emlformat=require(_0x03ec('0x0'));var rimraf=require(_0x03ec('0x1'));var zipdir=require(_0x03ec('0x2'));var jsonpatch=require(_0x03ec('0x3'));var rp=require(_0x03ec('0x4'));var moment=require(_0x03ec('0x5'));var BPromise=require(_0x03ec('0x6'));var Mustache=require('mustache');var util=require(_0x03ec('0x7'));var path=require(_0x03ec('0x8'));var sox=require(_0x03ec('0x9'));var csv=require('to-csv');var ejs=require(_0x03ec('0xa'));var fs=require('fs');var fs_extra=require(_0x03ec('0xb'));var _=require(_0x03ec('0xc'));var squel=require(_0x03ec('0xd'));var crypto=require(_0x03ec('0xe'));var jsforce=require(_0x03ec('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x03ec('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03ec('0x11'));var authService=require(_0x03ec('0x12'));var qs=require(_0x03ec('0x13'));var as=require(_0x03ec('0x14'));var hardwareService=require(_0x03ec('0x15'));var logger=require(_0x03ec('0x16'))(_0x03ec('0x17'));var utils=require(_0x03ec('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x03ec('0x19'));var db=require(_0x03ec('0x1a'))['db'];function respondWithStatusCode(_0x57c282,_0x506cbb){_0x506cbb=_0x506cbb||0xcc;return function(_0x20bbcb){if(_0x20bbcb){return _0x57c282[_0x03ec('0x1b')](_0x506cbb);}return _0x57c282[_0x03ec('0x1c')](_0x506cbb)[_0x03ec('0x1d')]();};}function respondWithResult(_0x130a41,_0x5885fb){_0x5885fb=_0x5885fb||0xc8;return function(_0x5c2964){if(_0x5c2964){return _0x130a41[_0x03ec('0x1c')](_0x5885fb)['json'](_0x5c2964);}};}function respondWithFilteredResult(_0x341188,_0x35bc01){return function(_0x222254){if(_0x222254){var _0x17efda=typeof _0x35bc01[_0x03ec('0x1e')]===_0x03ec('0x1f')&&typeof _0x35bc01[_0x03ec('0x20')]==='undefined';var _0x4a7235=_0x222254[_0x03ec('0x21')];var _0x41670f=_0x17efda?0x0:_0x35bc01[_0x03ec('0x1e')];var _0x481d23=_0x17efda?_0x222254[_0x03ec('0x21')]:_0x35bc01[_0x03ec('0x1e')]+_0x35bc01[_0x03ec('0x20')];var _0x4b9768;if(_0x481d23>=_0x4a7235){_0x481d23=_0x4a7235;_0x4b9768=0xc8;}else{_0x4b9768=0xce;}_0x341188[_0x03ec('0x1c')](_0x4b9768);return _0x341188['set'](_0x03ec('0x22'),_0x41670f+'-'+_0x481d23+'/'+_0x4a7235)[_0x03ec('0x23')](_0x222254);}return null;};}function patchUpdates(_0x31ef73){return function(_0x4ef8f1){try{jsonpatch[_0x03ec('0x24')](_0x4ef8f1,_0x31ef73,!![]);}catch(_0x1b0f0c){return BPromise[_0x03ec('0x25')](_0x1b0f0c);}return _0x4ef8f1[_0x03ec('0x26')]();};}function saveUpdates(_0x5a1604,_0x415e04){return function(_0xf314f6){if(_0xf314f6){return _0xf314f6[_0x03ec('0x27')](_0x5a1604)[_0x03ec('0x28')](function(_0xdf340d){return _0xdf340d;});}return null;};}function removeEntity(_0x51d645,_0x5a7e45){return function(_0x40c658){if(_0x40c658){return _0x40c658[_0x03ec('0x29')]()[_0x03ec('0x28')](function(){var _0x41d174=_0x40c658['get']({'plain':!![]});var _0x19bcb4=_0x03ec('0x2a');return db[_0x03ec('0x2b')]['destroy']({'where':{'type':_0x19bcb4,'resourceId':_0x41d174['id']}})['then'](function(){return _0x40c658;});})[_0x03ec('0x28')](function(){_0x51d645[_0x03ec('0x1c')](0xcc)[_0x03ec('0x1d')]();});}};}function handleEntityNotFound(_0x984781,_0x348651){return function(_0x13be2b){if(!_0x13be2b){_0x984781[_0x03ec('0x1b')](0x194);}return _0x13be2b;};}function handleError(_0x36a420,_0x2c0c9b){_0x2c0c9b=_0x2c0c9b||0x1f4;return function(_0x494b7d){logger[_0x03ec('0x2c')](_0x494b7d[_0x03ec('0x2d')]);if(_0x494b7d[_0x03ec('0x2e')]){delete _0x494b7d[_0x03ec('0x2e')];}_0x36a420[_0x03ec('0x1c')](_0x2c0c9b)[_0x03ec('0x2f')](_0x494b7d);};}exports[_0x03ec('0x30')]=function(_0x5d5eae,_0x178249){var _0x169e2f={},_0x5b53f8={},_0xd27674={'count':0x0,'rows':[]};var _0x66e4e6=_[_0x03ec('0x31')](db[_0x03ec('0x32')]['rawAttributes'],function(_0x40ae3c){return{'name':_0x40ae3c[_0x03ec('0x33')],'type':_0x40ae3c[_0x03ec('0x34')][_0x03ec('0x35')]};});_0x5b53f8[_0x03ec('0x36')]=_[_0x03ec('0x31')](_0x66e4e6,_0x03ec('0x2e'));_0x5b53f8[_0x03ec('0x37')]=_[_0x03ec('0x38')](_0x5d5eae['query']);_0x5b53f8[_0x03ec('0x39')]=_[_0x03ec('0x3a')](_0x5b53f8[_0x03ec('0x36')],_0x5b53f8[_0x03ec('0x37')]);_0x169e2f[_0x03ec('0x3b')]=_[_0x03ec('0x3a')](_0x5b53f8[_0x03ec('0x36')],qs['fields'](_0x5d5eae['query'][_0x03ec('0x3c')]));_0x169e2f['attributes']=_0x169e2f['attributes'][_0x03ec('0x3d')]?_0x169e2f[_0x03ec('0x3b')]:_0x5b53f8[_0x03ec('0x36')];if(!_0x5d5eae[_0x03ec('0x37')]['hasOwnProperty'](_0x03ec('0x3e'))){_0x169e2f['limit']=qs[_0x03ec('0x20')](_0x5d5eae['query'][_0x03ec('0x20')]);_0x169e2f['offset']=qs[_0x03ec('0x1e')](_0x5d5eae['query'][_0x03ec('0x1e')]);}_0x169e2f[_0x03ec('0x3f')]=qs[_0x03ec('0x40')](_0x5d5eae[_0x03ec('0x37')][_0x03ec('0x40')]);_0x169e2f[_0x03ec('0x41')]=qs[_0x03ec('0x39')](_['pick'](_0x5d5eae['query'],_0x5b53f8[_0x03ec('0x39')]),_0x66e4e6);if(_0x5d5eae[_0x03ec('0x37')][_0x03ec('0x42')]){_0x169e2f[_0x03ec('0x41')]=_[_0x03ec('0x43')](_0x169e2f['where'],{'$or':_[_0x03ec('0x31')](_0x66e4e6,function(_0x19a9bf){if(_0x19a9bf[_0x03ec('0x34')]!==_0x03ec('0x44')){var _0x4376a8={};_0x4376a8[_0x19a9bf['name']]={'$like':'%'+_0x5d5eae[_0x03ec('0x37')][_0x03ec('0x42')]+'%'};return _0x4376a8;}})});}_0x169e2f=_[_0x03ec('0x43')]({},_0x169e2f,_0x5d5eae[_0x03ec('0x45')]);var _0x5e17f={'where':_0x169e2f['where']};return db['Pause'][_0x03ec('0x21')](_0x5e17f)[_0x03ec('0x28')](function(_0x2b51f1){_0xd27674['count']=_0x2b51f1;if(_0x5d5eae['query'][_0x03ec('0x46')]){_0x169e2f[_0x03ec('0x47')]=[{'all':!![]}];}return db['Pause'][_0x03ec('0x48')](_0x169e2f);})[_0x03ec('0x28')](function(_0xe257fc){_0xd27674[_0x03ec('0x49')]=_0xe257fc;return _0xd27674;})[_0x03ec('0x28')](respondWithFilteredResult(_0x178249,_0x169e2f))['catch'](handleError(_0x178249,null));};exports['show']=function(_0x56644c,_0x3f7333){var _0x6dc29e={'raw':!![],'where':{'id':_0x56644c[_0x03ec('0x4a')]['id']}},_0x4d8886={};_0x4d8886[_0x03ec('0x36')]=_[_0x03ec('0x38')](db[_0x03ec('0x32')][_0x03ec('0x4b')]);_0x4d8886[_0x03ec('0x37')]=_['keys'](_0x56644c['query']);_0x4d8886[_0x03ec('0x39')]=_[_0x03ec('0x3a')](_0x4d8886[_0x03ec('0x36')],_0x4d8886[_0x03ec('0x37')]);_0x6dc29e[_0x03ec('0x3b')]=_[_0x03ec('0x3a')](_0x4d8886[_0x03ec('0x36')],qs[_0x03ec('0x3c')](_0x56644c[_0x03ec('0x37')][_0x03ec('0x3c')]));_0x6dc29e[_0x03ec('0x3b')]=_0x6dc29e[_0x03ec('0x3b')]['length']?_0x6dc29e['attributes']:_0x4d8886['model'];if(_0x56644c[_0x03ec('0x37')][_0x03ec('0x46')]){_0x6dc29e[_0x03ec('0x47')]=[{'all':!![]}];}_0x6dc29e=_[_0x03ec('0x43')]({},_0x6dc29e,_0x56644c[_0x03ec('0x45')]);return db[_0x03ec('0x32')][_0x03ec('0x4c')](_0x6dc29e)[_0x03ec('0x28')](handleEntityNotFound(_0x3f7333,null))[_0x03ec('0x28')](respondWithResult(_0x3f7333,null))['catch'](handleError(_0x3f7333,null));};exports[_0x03ec('0x4d')]=function(_0x5ef225,_0x535d08){return db[_0x03ec('0x32')][_0x03ec('0x4d')](_0x5ef225[_0x03ec('0x4e')],{})[_0x03ec('0x28')](function(_0x27262e){var _0x137ebf=_0x5ef225[_0x03ec('0x4f')]['get']({'plain':!![]});if(!_0x137ebf)throw new Error(_0x03ec('0x50'));if(_0x137ebf['role']===_0x03ec('0x4f')){var _0x241c5a=_0x27262e['get']({'plain':!![]});var _0x5d5626=_0x03ec('0x2a');return db[_0x03ec('0x51')][_0x03ec('0x4c')]({'where':{'name':_0x5d5626,'userProfileId':_0x137ebf[_0x03ec('0x52')]},'raw':!![]})[_0x03ec('0x28')](function(_0x4add30){if(_0x4add30&&_0x4add30['autoAssociation']===0x0){return db[_0x03ec('0x2b')]['create']({'name':_0x241c5a[_0x03ec('0x2e')],'resourceId':_0x241c5a['id'],'type':_0x4add30[_0x03ec('0x2e')],'sectionId':_0x4add30['id']},{})[_0x03ec('0x28')](function(){return _0x27262e;});}else{return _0x27262e;}})[_0x03ec('0x53')](function(_0x5926b5){logger[_0x03ec('0x2c')](_0x03ec('0x54'),_0x5926b5);throw _0x5926b5;});}return _0x27262e;})[_0x03ec('0x28')](respondWithResult(_0x535d08,0xc9))[_0x03ec('0x53')](handleError(_0x535d08,null));};exports[_0x03ec('0x27')]=function(_0x43a5b3,_0x13ea10){if(_0x43a5b3[_0x03ec('0x4e')]['id']){delete _0x43a5b3['body']['id'];}return db[_0x03ec('0x32')][_0x03ec('0x4c')]({'where':{'id':_0x43a5b3[_0x03ec('0x4a')]['id']}})[_0x03ec('0x28')](handleEntityNotFound(_0x13ea10,null))['then'](saveUpdates(_0x43a5b3[_0x03ec('0x4e')],null))[_0x03ec('0x28')](respondWithResult(_0x13ea10,null))[_0x03ec('0x53')](handleError(_0x13ea10,null));};exports[_0x03ec('0x29')]=function(_0x2d6d34,_0x3048cd){return db[_0x03ec('0x32')][_0x03ec('0x4c')]({'where':{'id':_0x2d6d34[_0x03ec('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3048cd,null))[_0x03ec('0x28')](removeEntity(_0x3048cd,null))['catch'](handleError(_0x3048cd,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4ff14bf..bf54908 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x5bc59d,_0x45978d){var _0x39510f=function(_0x1a3c71){while(--_0x1a3c71){_0x5bc59d['push'](_0x5bc59d['shift']());}};_0x39510f(++_0x45978d);}(_0xabce,0x103));var _0xeabc=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xabce[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x3aecbf,_0x1bcaa4){var _0x26135d=function(_0x17e626){while(--_0x17e626){_0x3aecbf['push'](_0x3aecbf['shift']());}};_0x26135d(++_0x1bcaa4);}(_0x814b,0x1a2));var _0xb814=function(_0x2d3ab3,_0x47d90b){_0x2d3ab3=_0x2d3ab3-0x0;var _0x321f9e=_0x814b[_0x2d3ab3];return _0x321f9e;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 106355d..1dde204 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x674d41,_0x4ef581){var _0xf84117=function(_0x359fcb){while(--_0x359fcb){_0x674d41['push'](_0x674d41['shift']());}};_0xf84117(++_0x4ef581);}(_0x7a54,0x106));var _0x47a5=function(_0xc1109b,_0x3c3e68){_0xc1109b=_0xc1109b-0x0;var _0x52d301=_0x7a54[_0xc1109b];return _0x52d301;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x446220,_0x15cd51){var _0x4cb845=function(_0x205875){while(--_0x205875){_0x446220['push'](_0x446220['shift']());}};_0x4cb845(++_0x15cd51);}(_0xb10b,0x12a));var _0xbb10=function(_0x465a22,_0x6bfa46){_0x465a22=_0x465a22-0x0;var _0x5ad9da=_0xb10b[_0x465a22];return _0x5ad9da;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 2472237..f878915 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 _0x9a19=['index','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated'];(function(_0x4fe6e9,_0x36f0ae){var _0x4ef329=function(_0x4c35b8){while(--_0x4c35b8){_0x4fe6e9['push'](_0x4fe6e9['shift']());}};_0x4ef329(++_0x36f0ae);}(_0x9a19,0x114));var _0x99a1=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9a19[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/webhook',controller['webhookGet']);router['get'](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller['show']);router['get'](_0x99a1('0xe'),auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);var upload=multer({'storage':multer[_0x99a1('0x10')]({'destination':function(_0x1551a1,_0x537032,_0x28ee99){_0x28ee99(null,path[_0x99a1('0x11')](config[_0x99a1('0x12')],_0x99a1('0x13')));},'filename':function(_0x2c68dd,_0x1bc7aa,_0x2ff655){_0x1bc7aa[_0x99a1('0x14')]=_0x1bc7aa[_0x99a1('0x14')][_0x99a1('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ff655(null,util[_0x99a1('0x16')](_0x99a1('0x17'),path[_0x99a1('0x18')](_0x1bc7aa[_0x99a1('0x14')],path[_0x99a1('0x19')](_0x1bc7aa['originalname'])),Date[_0x99a1('0x1a')](),path[_0x99a1('0x19')](_0x1bc7aa[_0x99a1('0x14')])));}})});router[_0x99a1('0x1b')]('/',upload[_0x99a1('0x1c')](_0x99a1('0x1d')),controller[_0x99a1('0x1e')]);router['post']('/webhook',controller[_0x99a1('0x1f')]);router[_0x99a1('0x20')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x21')]);router[_0x99a1('0x22')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x22')]);module[_0x99a1('0x23')]=router; \ No newline at end of file +var _0x303a=['show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook'];(function(_0x16cce2,_0xf470d4){var _0x213186=function(_0x5dd339){while(--_0x5dd339){_0x16cce2['push'](_0x16cce2['shift']());}};_0x213186(++_0xf470d4);}(_0x303a,0x1a0));var _0xa303=function(_0x20be6c,_0x544e09){_0x20be6c=_0x20be6c-0x0;var _0x117c8d=_0x303a[_0x20be6c];return _0x117c8d;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),controller['webhookGet']);router['get']('/:id',auth[_0xa303('0xa')](),controller[_0xa303('0xd')]);router['get'](_0xa303('0xe'),auth['isAuthenticated'](),controller[_0xa303('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29cd60,_0x17dfcd,_0x382cfd){_0x382cfd(null,path[_0xa303('0x10')](config['root'],_0xa303('0x11')));},'filename':function(_0x4c0169,_0xf5df1e,_0x43a054){_0xf5df1e[_0xa303('0x12')]=_0xf5df1e['originalname'][_0xa303('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43a054(null,util[_0xa303('0x14')](_0xa303('0x15'),path[_0xa303('0x16')](_0xf5df1e[_0xa303('0x12')],path[_0xa303('0x17')](_0xf5df1e[_0xa303('0x12')])),Date[_0xa303('0x18')](),path['extname'](_0xf5df1e[_0xa303('0x12')])));}})});router[_0xa303('0x19')]('/',upload[_0xa303('0x1a')](_0xa303('0x1b')),controller[_0xa303('0x1c')]);router[_0xa303('0x19')]('/webhook',controller[_0xa303('0x1d')]);router['put'](_0xa303('0x1e'),auth['isAuthenticated'](),controller[_0xa303('0x1f')]);router['delete'](_0xa303('0x1e'),auth[_0xa303('0xa')](),controller[_0xa303('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 1d655ed..f867add 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 _0xd15e=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','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'];(function(_0x5e8423,_0xb71ab3){var _0x3786af=function(_0xaa32e3){while(--_0xaa32e3){_0x5e8423['push'](_0x5e8423['shift']());}};_0x3786af(++_0xb71ab3);}(_0xd15e,0x14d));var _0xed15=function(_0xc925b7,_0x2a5f6a){_0xc925b7=_0xc925b7-0x0;var _0x276e3f=_0xd15e[_0xc925b7];return _0x276e3f;};'use strict';var Sequelize=require(_0xed15('0x0'));module[_0xed15('0x1')]={'name':{'type':Sequelize[_0xed15('0x2')]},'type':{'type':Sequelize[_0xed15('0x3')](_0xed15('0x4'),_0xed15('0x5'))},'description':{'type':Sequelize[_0xed15('0x6')]},'version':{'type':Sequelize[_0xed15('0x6')]},'path':{'type':Sequelize[_0xed15('0x2')],'comment':_0xed15('0x7')},'active':{'type':Sequelize[_0xed15('0x8')],'defaultValue':0x0,'comment':_0xed15('0x9')},'sidebar':{'type':Sequelize['ENUM'](_0xed15('0xa'),_0xed15('0xb'),_0xed15('0xc'),_0xed15('0xd')),'defaultValue':_0xed15('0xc'),'comment':_0xed15('0xe')},'icon':{'type':Sequelize[_0xed15('0x2')]},'adminUrl':{'type':Sequelize[_0xed15('0x2')]},'agentUrl':{'type':Sequelize[_0xed15('0x2')]},'scriptName':{'type':Sequelize[_0xed15('0x2')]},'scriptPath':{'type':Sequelize[_0xed15('0x2')]}}; \ No newline at end of file +var _0x4288=['never','always','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly'];(function(_0x38588c,_0x2cce09){var _0xea7540=function(_0x2731a1){while(--_0x2731a1){_0x38588c['push'](_0x38588c['shift']());}};_0xea7540(++_0x2cce09);}(_0x4288,0x178));var _0x8428=function(_0x3e17c4,_0x41b284){_0x3e17c4=_0x3e17c4-0x0;var _0x388f5a=_0x4288[_0x3e17c4];return _0x388f5a;};'use strict';var Sequelize=require('sequelize');module[_0x8428('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8428('0x1')](_0x8428('0x2'),_0x8428('0x3'))},'description':{'type':Sequelize[_0x8428('0x4')]},'version':{'type':Sequelize[_0x8428('0x4')]},'path':{'type':Sequelize[_0x8428('0x5')],'comment':_0x8428('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8428('0x7')},'sidebar':{'type':Sequelize[_0x8428('0x1')]('adminOnly',_0x8428('0x8'),'always',_0x8428('0x9')),'defaultValue':_0x8428('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x8428('0x5')]},'adminUrl':{'type':Sequelize[_0x8428('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x8428('0x5')]},'scriptPath':{'type':Sequelize[_0x8428('0x5')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5ee9915..7179a77 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 _0xef6b=['format','basename','zip','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','error','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','admin','test','Warning:\x20admin\x20view\x20not\x20specified','agent','scriptName','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','update','delete','webhookGet','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','content-type','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','then','destroy','get','Plugins','UserProfileResource','stack','name','send','index','Plugin','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','find','download','join','root'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0xef6b,0x1b8));var _0xbef6=function(_0x48be74,_0x4c773f){_0x48be74=_0x48be74-0x0;var _0xde3cad=_0xef6b[_0x48be74];return _0xde3cad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbef6('0x0'));var zipdir=require(_0xbef6('0x1'));var jsonpatch=require(_0xbef6('0x2'));var rp=require(_0xbef6('0x3'));var moment=require(_0xbef6('0x4'));var BPromise=require(_0xbef6('0x5'));var Mustache=require(_0xbef6('0x6'));var util=require(_0xbef6('0x7'));var path=require(_0xbef6('0x8'));var sox=require(_0xbef6('0x9'));var csv=require(_0xbef6('0xa'));var ejs=require(_0xbef6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbef6('0xc'));var squel=require(_0xbef6('0xd'));var crypto=require(_0xbef6('0xe'));var jsforce=require(_0xbef6('0xf'));var deskjs=require(_0xbef6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbef6('0x11'));var Papa=require(_0xbef6('0x12'));var extract=require(_0xbef6('0x13'));var rimraf=require(_0xbef6('0x0'));var archiver=require(_0xbef6('0x14'));var Redis=require(_0xbef6('0x15'));var authService=require(_0xbef6('0x16'));var qs=require(_0xbef6('0x17'));var as=require(_0xbef6('0x18'));var hardwareService=require(_0xbef6('0x19'));var logger=require(_0xbef6('0x1a'))('api');var utils=require(_0xbef6('0x1b'));var config=require(_0xbef6('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbef6('0x1d')]=_[_0xbef6('0x1e')](config[_0xbef6('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xbef6('0x1f'))(new Redis(config[_0xbef6('0x1d')]));require('./plugin.socket')[_0xbef6('0x20')](socket);function respondWithStatusCode(_0x335da8,_0x120026){_0x120026=_0x120026||0xcc;return function(_0x53af15){if(_0x53af15){return _0x335da8[_0xbef6('0x21')](_0x120026);}return _0x335da8['status'](_0x120026)[_0xbef6('0x22')]();};}function respondWithResult(_0x39e355,_0x8ea8b2){_0x8ea8b2=_0x8ea8b2||0xc8;return function(_0xe3559){if(_0xe3559){return _0x39e355['status'](_0x8ea8b2)['json'](_0xe3559);}};}function respondWithFilteredResult(_0x5d9982,_0x420369){return function(_0x24e01b){if(_0x24e01b){var _0x1e2c8a=typeof _0x420369[_0xbef6('0x23')]===_0xbef6('0x24')&&typeof _0x420369[_0xbef6('0x25')]===_0xbef6('0x24');var _0x4959ee=_0x24e01b[_0xbef6('0x26')];var _0x19d2fe=_0x1e2c8a?0x0:_0x420369[_0xbef6('0x23')];var _0xef3abb=_0x1e2c8a?_0x24e01b['count']:_0x420369[_0xbef6('0x23')]+_0x420369['limit'];var _0x2bd1a8;if(_0xef3abb>=_0x4959ee){_0xef3abb=_0x4959ee;_0x2bd1a8=0xc8;}else{_0x2bd1a8=0xce;}_0x5d9982[_0xbef6('0x27')](_0x2bd1a8);return _0x5d9982[_0xbef6('0x28')](_0xbef6('0x29'),_0x19d2fe+'-'+_0xef3abb+'/'+_0x4959ee)[_0xbef6('0x2a')](_0x24e01b);}return null;};}function patchUpdates(_0x61882d){return function(_0x3e9705){try{jsonpatch[_0xbef6('0x2b')](_0x3e9705,_0x61882d,!![]);}catch(_0x4cab84){return BPromise['reject'](_0x4cab84);}return _0x3e9705['save']();};}function saveUpdates(_0x2e6c42,_0x104494){return function(_0x188188){if(_0x188188){return _0x188188['update'](_0x2e6c42)[_0xbef6('0x2c')](function(_0x75bb76){return _0x75bb76;});}return null;};}function removeEntity(_0x24c558,_0x215ad4){return function(_0xfa2857){if(_0xfa2857){return _0xfa2857[_0xbef6('0x2d')]()[_0xbef6('0x2c')](function(){var _0xec6bfd=_0xfa2857[_0xbef6('0x2e')]({'plain':!![]});var _0x595ddb=_0xbef6('0x2f');return db[_0xbef6('0x30')][_0xbef6('0x2d')]({'where':{'type':_0x595ddb,'resourceId':_0xec6bfd['id']}})[_0xbef6('0x2c')](function(){return _0xfa2857;});})[_0xbef6('0x2c')](function(){_0x24c558[_0xbef6('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e85b,_0x2b7692){return function(_0xc74aaa){if(!_0xc74aaa){_0x28e85b[_0xbef6('0x21')](0x194);}return _0xc74aaa;};}function handleError(_0x274124,_0x3a5112){_0x3a5112=_0x3a5112||0x1f4;return function(_0x53ab90){logger['error'](_0x53ab90[_0xbef6('0x31')]);if(_0x53ab90[_0xbef6('0x32')]){delete _0x53ab90[_0xbef6('0x32')];}_0x274124[_0xbef6('0x27')](_0x3a5112)[_0xbef6('0x33')](_0x53ab90);};}exports[_0xbef6('0x34')]=function(_0x22e2ba,_0x4f49e4){var _0x22b9f8={},_0x3cceb4={},_0x49dbdc={'count':0x0,'rows':[]};var _0x54ef75=_['map'](db[_0xbef6('0x35')][_0xbef6('0x36')],function(_0x15b5ff){return{'name':_0x15b5ff[_0xbef6('0x37')],'type':_0x15b5ff[_0xbef6('0x38')]['key']};});_0x3cceb4[_0xbef6('0x39')]=_['map'](_0x54ef75,'name');_0x3cceb4['query']=_['keys'](_0x22e2ba[_0xbef6('0x3a')]);_0x3cceb4['filters']=_[_0xbef6('0x3b')](_0x3cceb4['model'],_0x3cceb4[_0xbef6('0x3a')]);_0x22b9f8['attributes']=_[_0xbef6('0x3b')](_0x3cceb4[_0xbef6('0x39')],qs['fields'](_0x22e2ba['query'][_0xbef6('0x3c')]));_0x22b9f8[_0xbef6('0x3d')]=_0x22b9f8[_0xbef6('0x3d')][_0xbef6('0x3e')]?_0x22b9f8[_0xbef6('0x3d')]:_0x3cceb4['model'];if(!_0x22e2ba[_0xbef6('0x3a')][_0xbef6('0x3f')](_0xbef6('0x40'))){_0x22b9f8[_0xbef6('0x25')]=qs[_0xbef6('0x25')](_0x22e2ba[_0xbef6('0x3a')][_0xbef6('0x25')]);_0x22b9f8[_0xbef6('0x23')]=qs['offset'](_0x22e2ba[_0xbef6('0x3a')][_0xbef6('0x23')]);}_0x22b9f8[_0xbef6('0x41')]=qs[_0xbef6('0x42')](_0x22e2ba[_0xbef6('0x3a')][_0xbef6('0x42')]);_0x22b9f8[_0xbef6('0x43')]=qs[_0xbef6('0x44')](_['pick'](_0x22e2ba['query'],_0x3cceb4['filters']),_0x54ef75);if(_0x22e2ba['query'][_0xbef6('0x45')]){_0x22b9f8[_0xbef6('0x43')]=_[_0xbef6('0x46')](_0x22b9f8[_0xbef6('0x43')],{'$or':_[_0xbef6('0x47')](_0x54ef75,function(_0x8d0689){if(_0x8d0689['type']!==_0xbef6('0x48')){var _0x21ec78={};_0x21ec78[_0x8d0689['name']]={'$like':'%'+_0x22e2ba['query'][_0xbef6('0x45')]+'%'};return _0x21ec78;}})});}_0x22b9f8=_['merge']({},_0x22b9f8,_0x22e2ba[_0xbef6('0x49')]);var _0x43c73a={'where':_0x22b9f8[_0xbef6('0x43')]};return db[_0xbef6('0x35')]['count'](_0x43c73a)[_0xbef6('0x2c')](function(_0x4cc3c5){_0x49dbdc[_0xbef6('0x26')]=_0x4cc3c5;if(_0x22e2ba[_0xbef6('0x3a')][_0xbef6('0x4a')]){_0x22b9f8['include']=[{'all':!![]}];}return db[_0xbef6('0x35')][_0xbef6('0x4b')](_0x22b9f8);})[_0xbef6('0x2c')](function(_0x5aea98){_0x49dbdc[_0xbef6('0x4c')]=_0x5aea98;return _0x49dbdc;})[_0xbef6('0x2c')](respondWithFilteredResult(_0x4f49e4,_0x22b9f8))[_0xbef6('0x4d')](handleError(_0x4f49e4,null));};exports['show']=function(_0x1215d6,_0x50bf56){var _0x1b7739={'raw':!![],'where':{'id':_0x1215d6[_0xbef6('0x4e')]['id']}},_0x20975b={};_0x20975b[_0xbef6('0x39')]=_[_0xbef6('0x4f')](db[_0xbef6('0x35')][_0xbef6('0x36')]);_0x20975b['query']=_[_0xbef6('0x4f')](_0x1215d6[_0xbef6('0x3a')]);_0x20975b['filters']=_['intersection'](_0x20975b['model'],_0x20975b[_0xbef6('0x3a')]);_0x1b7739[_0xbef6('0x3d')]=_[_0xbef6('0x3b')](_0x20975b[_0xbef6('0x39')],qs[_0xbef6('0x3c')](_0x1215d6[_0xbef6('0x3a')][_0xbef6('0x3c')]));_0x1b7739[_0xbef6('0x3d')]=_0x1b7739[_0xbef6('0x3d')][_0xbef6('0x3e')]?_0x1b7739[_0xbef6('0x3d')]:_0x20975b[_0xbef6('0x39')];if(_0x1215d6['query'][_0xbef6('0x4a')]){_0x1b7739[_0xbef6('0x50')]=[{'all':!![]}];}_0x1b7739=_[_0xbef6('0x46')]({},_0x1b7739,_0x1215d6[_0xbef6('0x49')]);return db[_0xbef6('0x35')][_0xbef6('0x51')](_0x1b7739)['then'](handleEntityNotFound(_0x50bf56,null))['then'](respondWithResult(_0x50bf56,null))['catch'](handleError(_0x50bf56,null));};exports[_0xbef6('0x52')]=function(_0x4e3f91,_0x589c10,_0x325910){return db[_0xbef6('0x35')][_0xbef6('0x51')]({'where':{'id':_0x4e3f91['params']['id']},'attributes':['name','path'],'raw':!![]})[_0xbef6('0x2c')](handleEntityNotFound(_0x589c10,null))[_0xbef6('0x2c')](function(_0x4006f2){if(_0x4006f2){var _0x50e058=path[_0xbef6('0x53')](config[_0xbef6('0x54')],'server/files/plugins',util[_0xbef6('0x55')]('%s.zip',path[_0xbef6('0x56')](_0x4006f2[_0xbef6('0x8')])));var _0x152d65=fs['createWriteStream'](_0x50e058);var _0x5a69f3=archiver(_0xbef6('0x57'),{'zlib':{'level':0x9}});_0x5a69f3['on']('warning',function(_0x4f6e19){if(_0x4f6e19[_0xbef6('0x58')]==='ENOENT'){logger['error'](_0x4f6e19);}else{throw new db[(_0xbef6('0x59'))][(_0xbef6('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x5a69f3['on']('error',function(_0x33c45a){throw new db[(_0xbef6('0x59'))]['Error'](_0xbef6('0x5b'));});_0x5a69f3['pipe'](_0x152d65);_0x5a69f3[_0xbef6('0x5c')](_0xbef6('0x5d'),{'cwd':path[_0xbef6('0x53')](config[_0xbef6('0x54')],_0xbef6('0x5e'),path['dirname'](_0x4006f2[_0xbef6('0x8')])),'ignore':[path['join'](path[_0xbef6('0x56')](_0x4006f2[_0xbef6('0x8')]),_0xbef6('0x5f')),path[_0xbef6('0x53')](path[_0xbef6('0x56')](_0x4006f2[_0xbef6('0x8')]),_0xbef6('0x60'))],'nodir':!![]})['finalize']();_0x152d65['on'](_0xbef6('0x61'),function(){if(!fs[_0xbef6('0x62')](_0x50e058)){throw new db[(_0xbef6('0x59'))][(_0xbef6('0x5a'))](_0xbef6('0x63'));}return _0x589c10['download'](_0x50e058,util[_0xbef6('0x55')](_0xbef6('0x64'),path[_0xbef6('0x56')](_0x4006f2[_0xbef6('0x8')])),function(_0x2a0ffc){if(_0x2a0ffc){throw new db[(_0xbef6('0x59'))]['Error'](_0xbef6('0x65'));}fs[_0xbef6('0x66')](_0x50e058);logger['info'](_0xbef6('0x67'));logger['info'](_0xbef6('0x68'));});});}return null;})[_0xbef6('0x4d')](handleError(_0x589c10,null));};exports[_0xbef6('0x69')]=function(_0x2992aa,_0x52875e,_0x1315d0){var _0x141dd3=path[_0xbef6('0x56')](_0x2992aa[_0xbef6('0x6a')][_0xbef6('0x6b')],path['extname'](_0x2992aa[_0xbef6('0x6a')][_0xbef6('0x6b')]));var _0x203ff7=path[_0xbef6('0x53')](config[_0xbef6('0x54')],'server/files/plugins',_0x2992aa[_0xbef6('0x6a')][_0xbef6('0x6b')]);var _0x51a7ad=path[_0xbef6('0x53')](config[_0xbef6('0x54')],_0xbef6('0x5e'),_0x141dd3);logger[_0xbef6('0x6c')](_0xbef6('0x6d'),_0x203ff7);logger['info'](_0xbef6('0x6e'),_0x51a7ad);try{fs[_0xbef6('0x6f')](_0x203ff7,parseInt(_0xbef6('0x70'),0x8));extract(_0x203ff7,{'dir':_0x51a7ad},function(_0x3b4773){if(_0x3b4773){logger['error'](_0x3b4773);handleError(_0x3b4773,!![]);};var _0x4df8c7=fs[_0xbef6('0x71')](_0x51a7ad);if(_0x4df8c7[_0xbef6('0x3e')]>0x1){removeReferences(_0x203ff7,_0x51a7ad);logger[_0xbef6('0x72')](_0xbef6('0x73'));return _0x1315d0(new Error(_0xbef6('0x73')));}var _0x8448ab=fs[_0xbef6('0x74')](path[_0xbef6('0x53')](_0x51a7ad,_0x4df8c7[0x0]));if(_0x8448ab[_0xbef6('0x75')]()){removeReferences(_0x203ff7,_0x51a7ad);logger['error']('Invalid\x20plugin\x20structure');return _0x1315d0(new Error('Invalid\x20plugin\x20structure'));}if(_0x8448ab[_0xbef6('0x76')]()){var _0x3f2bd0=fs[_0xbef6('0x71')](path[_0xbef6('0x53')](_0x51a7ad,_0x4df8c7[0x0]));if(_0x3f2bd0[_0xbef6('0x3e')]===0x0){removeReferences(_0x203ff7,_0x51a7ad);logger[_0xbef6('0x72')](_0xbef6('0x73'));return _0x1315d0(new Error(_0xbef6('0x73')));}var _0x2b1f71=_0x3f2bd0[_0xbef6('0x77')](function(_0x4d1f02){return _0x4d1f02===_0xbef6('0x78');});if(!_0x2b1f71){return _0x1315d0(new Error('Plugin\x20manifest\x20missing'));}var _0x40fde0=fs[_0xbef6('0x79')](path['join'](_0x51a7ad,_0x4df8c7[0x0],_0xbef6('0x78')));var _0x32cc32=JSON[_0xbef6('0x7a')](_0x40fde0);if(_0xbef6('0x24')==typeof _0x32cc32[_0xbef6('0x32')]){return _0x1315d0(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x32cc32['type']){return _0x1315d0(new Error(_0xbef6('0x7b')));}if(_0xbef6('0x24')==typeof _0x32cc32[_0xbef6('0x7c')]){return _0x1315d0(new Error(_0xbef6('0x7d')));}if('undefined'==typeof _0x32cc32['parameters']){return _0x1315d0(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x32cc32[_0xbef6('0x38')]==='html'){if('undefined'==typeof _0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')]){return _0x1315d0(new Error(_0xbef6('0x80')));}if(_0xbef6('0x24')==typeof _0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')]['admin']&&_0xbef6('0x24')==typeof _0x32cc32[_0xbef6('0x7e')]['views']['agent']){return _0x1315d0(new Error(_0xbef6('0x81')));}}else if(_0x32cc32[_0xbef6('0x38')]===_0xbef6('0x82')){if(_0xbef6('0x24')==typeof _0x32cc32['parameters']['scriptName']){return _0x1315d0(new Error(_0xbef6('0x83')));}if(_0xbef6('0x24')==typeof _0x32cc32[_0xbef6('0x7e')][_0xbef6('0x84')]){return _0x1315d0(new Error(_0xbef6('0x85')));}}else{return _0x1315d0(new Error(_0xbef6('0x86')));}var _0x2cf86e=_0x32cc32[_0xbef6('0x32')];var _0x2524e0=_0x32cc32[_0xbef6('0x87')];var _0x2dcfde=_0x32cc32[_0xbef6('0x38')];var _0x8404d7=_0x32cc32[_0xbef6('0x88')]?_0x32cc32['sidebar']:_0xbef6('0x89');var _0x36a25a=_0x32cc32[_0xbef6('0x8a')]?_0x32cc32[_0xbef6('0x8a')]:_0xbef6('0x8b');var _0x8168ca='';var _0x3c5093='';var _0x1c52ff='';var _0x40f3c9='';var _0x54ff87=_0x32cc32[_0xbef6('0x7c')];if(_0x2dcfde===_0xbef6('0x8c')){if(_0xbef6('0x24')!=typeof _0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')][_0xbef6('0x8d')]){var _0xfb8225=_0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xbef6('0x8e')](_0xfb8225)){_0x8168ca=path[_0xbef6('0x53')]('plugins',_0x141dd3,_0x4df8c7[0x0],_0xfb8225);}else{_0x8168ca=_0xfb8225;}}else{logger[_0xbef6('0x6c')](_0xbef6('0x8f'));}if('undefined'!=typeof _0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')][_0xbef6('0x90')]){var _0x5eeb61=_0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5eeb61)){_0x3c5093=path[_0xbef6('0x53')]('plugins',_0x141dd3,_0x4df8c7[0x0],_0x5eeb61);}else{_0x3c5093=_0x5eeb61;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2dcfde===_0xbef6('0x82')){_0x1c52ff=_0x32cc32['parameters'][_0xbef6('0x91')];_0x40f3c9=_0x32cc32[_0xbef6('0x7e')][_0xbef6('0x84')];if(_0xbef6('0x24')!=typeof _0x32cc32[_0xbef6('0x7e')]['views']){if(_0xbef6('0x24')!=typeof _0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')]['admin']){var _0xfb8225=_0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')][_0xbef6('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xbef6('0x8e')](_0xfb8225)){_0x8168ca=path[_0xbef6('0x53')](_0xbef6('0x92'),_0x141dd3,_0x4df8c7[0x0],_0xfb8225);}else{_0x8168ca=_0xfb8225;}}if(_0xbef6('0x24')!=typeof _0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')]['agent']){var _0x5eeb61=_0x32cc32[_0xbef6('0x7e')][_0xbef6('0x7f')][_0xbef6('0x90')];if(!/^(f|ht)tps?:\/\//i[_0xbef6('0x8e')](_0x5eeb61)){_0x3c5093=path['join'](_0xbef6('0x92'),_0x141dd3,_0x4df8c7[0x0],_0x5eeb61);}else{_0x3c5093=_0x5eeb61;}}}}var _0x4c3b59={'name':_0x2cf86e,'description':_0x2524e0,'path':path[_0xbef6('0x53')](_0x141dd3,_0x4df8c7[0x0]),'type':_0x2dcfde,'sidebar':_0x8404d7,'icon':_0x36a25a,'adminUrl':_0x8168ca,'agentUrl':_0x3c5093,'scriptName':_0x1c52ff,'scriptPath':_0x40f3c9,'version':_0x54ff87};removeReferences(_0x203ff7,null);return db['Plugin'][_0xbef6('0x93')](_0x4c3b59)[_0xbef6('0x2c')](function(_0x360960){var _0x38e25c={'role':_0x2992aa[_0xbef6('0x94')][_0xbef6('0x95')],'userProfileId':_0x2992aa[_0xbef6('0x94')][_0xbef6('0x96')]};if(!_0x38e25c)throw new Error(_0xbef6('0x97'));if(_0x38e25c[_0xbef6('0x95')]===_0xbef6('0x98')){var _0x49edd9=_0x360960[_0xbef6('0x2e')]({'plain':!![]});return db[_0xbef6('0x99')][_0xbef6('0x51')]({'where':{'name':'Plugins','userProfileId':_0x38e25c[_0xbef6('0x96')]},'raw':!![]})[_0xbef6('0x2c')](function(_0x4482b1){if(_0x4482b1&&_0x4482b1[_0xbef6('0x9a')]===0x0){return db[_0xbef6('0x30')][_0xbef6('0x93')]({'name':_0x49edd9[_0xbef6('0x32')],'resourceId':_0x49edd9['id'],'type':_0x4482b1['name'],'sectionId':_0x4482b1['id']},{})[_0xbef6('0x2c')](function(){return _0x360960;});}else{return _0x360960;}})[_0xbef6('0x4d')](function(_0x22c661){logger['error'](_0xbef6('0x9b'),_0x22c661);throw _0x22c661;});}return _0x360960;})[_0xbef6('0x2c')](respondWithResult(_0x52875e,null))['catch'](handleError(_0x52875e,null));}});}catch(_0x3037fb){_0x52875e[_0xbef6('0x27')](0x1f4)['send'](_0x3037fb);}};function removeReferences(_0x536d7d,_0x43c677){try{if(_0x536d7d){fs['unlinkSync'](_0x536d7d);logger['info']('Zip\x20archive\x20removed');}if(_0x43c677){rimraf(_0x43c677,function(){});logger['info'](_0xbef6('0x9c'));}}catch(_0x22204b){logger[_0xbef6('0x72')](_0x22204b);}}exports[_0xbef6('0x9d')]=function(_0x2c33cf,_0x3d8904,_0x291d01){return db[_0xbef6('0x35')][_0xbef6('0x51')]({'where':{'id':_0x2c33cf['params']['id']}})[_0xbef6('0x2c')](handleEntityNotFound(_0x3d8904,null))[_0xbef6('0x2c')](saveUpdates(_0x2c33cf[_0xbef6('0x94')],null))[_0xbef6('0x2c')](respondWithResult(_0x3d8904,null))[_0xbef6('0x4d')](handleError(_0x3d8904,null));};exports[_0xbef6('0x9e')]=function(_0x12d544,_0x3f97ff,_0x36d3f8){return db[_0xbef6('0x35')][_0xbef6('0x51')]({'where':{'id':_0x12d544['params']['id']}})[_0xbef6('0x2c')](function(_0x261b2e){if(_0x261b2e){return _0x261b2e[_0xbef6('0x2d')]();}})['then'](function(_0x476097){rimraf(path[_0xbef6('0x53')](config[_0xbef6('0x54')],_0xbef6('0x5e'),path['dirname'](_0x476097['path'])),function(){});return _0x476097;})[_0xbef6('0x2c')](handleEntityNotFound(_0x3f97ff,null))[_0xbef6('0x2c')](respondWithStatusCode(_0x3f97ff,null))[_0xbef6('0x4d')](handleError(_0x3f97ff,null));};exports[_0xbef6('0x9f')]=function(_0x5a1d53,_0x4a41c3,_0x1f960e){return BPromise['resolve']()['then'](function(){if(!_0x5a1d53[_0xbef6('0x3a')][_0xbef6('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5a1d53[_0xbef6('0x3a')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x488338=_0x5a1d53['query'][_0xbef6('0xa0')]?_0x5a1d53['query'][_0xbef6('0xa0')]+':'+_0x5a1d53[_0xbef6('0x3a')][_0xbef6('0xa1')]:_0xbef6('0xa2')+_0x5a1d53[_0xbef6('0x3a')][_0xbef6('0xa1')];var _0x30bb57=_0x5a1d53[_0xbef6('0x3a')]['json']?_0x5a1d53['query']['json']:!![];var _0xa44764=_0x5a1d53[_0xbef6('0x3a')][_0xbef6('0xa3')]?_0x5a1d53['query'][_0xbef6('0xa3')]:null;var _0x2b0cb4={'method':_0x5a1d53[_0xbef6('0xa4')],'uri':util[_0xbef6('0x55')](_0xbef6('0xa5'),_0x488338,_0x5a1d53[_0xbef6('0x3a')]['path']),'json':_0x30bb57,'resolveWithFullResponse':!![],'encoding':_0xa44764,'qs':_0x5a1d53[_0xbef6('0x3a')]};if(_0x5a1d53[_0xbef6('0xa6')]){_0x2b0cb4['headers']=_0x5a1d53[_0xbef6('0xa6')];if(_0x2b0cb4[_0xbef6('0xa6')][_0xbef6('0xa7')]){delete _0x2b0cb4[_0xbef6('0xa6')]['content-length'];}}if(_0x2b0cb4['headers']['content-type']){delete _0x2b0cb4['headers']['content-type'];}return rp(_0x2b0cb4);})[_0xbef6('0x2c')](function(_0x3a1e2a){if(_0x3a1e2a){_0x4a41c3['set'](_0x3a1e2a[_0xbef6('0xa6')]);logger[_0xbef6('0x6c')](_0x3a1e2a[_0xbef6('0x94')]);if(_[_0xbef6('0xa8')](_0x5a1d53[_0xbef6('0x3a')][_0xbef6('0x8')],_0xbef6('0x52'))&&_0x3a1e2a[_0xbef6('0xa9')]==0x1f4){return _0x4a41c3[_0xbef6('0x21')](_0x3a1e2a['statusCode']);}else{return _0x4a41c3[_0xbef6('0x27')](_0x3a1e2a[_0xbef6('0xa9')])[_0xbef6('0x33')](_0x3a1e2a[_0xbef6('0x94')]);}}else{return _0x4a41c3[_0xbef6('0x21')](0xc8);}})[_0xbef6('0x4d')](handleError(_0x4a41c3,null));};exports[_0xbef6('0xaa')]=function(_0x203e77,_0x455fbb,_0xff01b7){return BPromise[_0xbef6('0xab')]()['then'](function(){if(!_0x203e77[_0xbef6('0x3a')][_0xbef6('0x8')]){throw new Error(_0xbef6('0xac'));}if(!_0x203e77[_0xbef6('0x3a')][_0xbef6('0xa1')]){throw new Error(_0xbef6('0xad'));}var _0x53555d=_0x203e77[_0xbef6('0x3a')][_0xbef6('0xa0')]?_0x203e77['query'][_0xbef6('0xa0')]+':'+_0x203e77[_0xbef6('0x3a')][_0xbef6('0xa1')]:'http://localhost:'+_0x203e77[_0xbef6('0x3a')][_0xbef6('0xa1')];var _0x5e4c35=_0x203e77[_0xbef6('0x3a')][_0xbef6('0x2a')]?_0x203e77[_0xbef6('0x3a')]['json']:!![];var _0x3cf408=_0x203e77['query']['encoding']?_0x203e77[_0xbef6('0x3a')][_0xbef6('0xa3')]:null;var _0x3298c0={'method':_0x203e77[_0xbef6('0xa4')],'uri':util[_0xbef6('0x55')]('%s%s',_0x53555d,_0x203e77[_0xbef6('0x3a')][_0xbef6('0x8')]),'json':_0x5e4c35,'resolveWithFullResponse':!![],'encoding':_0x3cf408,'body':_0x203e77['body']};if(_0x203e77[_0xbef6('0xa6')]){_0x3298c0[_0xbef6('0xa6')]=_0x203e77[_0xbef6('0xa6')];if(_0x3298c0[_0xbef6('0xa6')][_0xbef6('0xa7')]){delete _0x3298c0['headers'][_0xbef6('0xa7')];}}if(_0x3298c0['headers'][_0xbef6('0xae')]){delete _0x3298c0[_0xbef6('0xa6')][_0xbef6('0xae')];}return rp(_0x3298c0);})[_0xbef6('0x2c')](function(_0x37087b){if(_0x37087b){_0x455fbb['set'](_0x37087b[_0xbef6('0xa6')]);logger['info'](_0x37087b[_0xbef6('0x94')]);return _0x455fbb['status'](_0x37087b[_0xbef6('0xa9')])[_0xbef6('0x33')](_0x37087b[_0xbef6('0x94')]);}else{return _0x455fbb['sendStatus'](0xc8);}})[_0xbef6('0x4d')](handleError(_0x455fbb,null));}; \ No newline at end of file +var _0xfd0d=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','UserProfileResource','stack','name','index','Plugin','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','params','find','download','join','root','format','%s.zip','basename','createWriteStream','zip','warning','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','server/files/plugins','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','upload','extname','file','filename','0777','readdirSync','length','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','version','parameters','html','views','admin','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','%s%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','extract-zip','rimraf','archiver','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','./plugin.socket','register','sendStatus','status'];(function(_0x1d43cb,_0x4aac5d){var _0x39010d=function(_0x1bbdd3){while(--_0x1bbdd3){_0x1d43cb['push'](_0x1d43cb['shift']());}};_0x39010d(++_0x4aac5d);}(_0xfd0d,0x126));var _0xdfd0=function(_0xc88e50,_0x350dbf){_0xc88e50=_0xc88e50-0x0;var _0x4c657c=_0xfd0d[_0xc88e50];return _0x4c657c;};'use strict';var emlformat=require(_0xdfd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfd0('0x1'));var jsonpatch=require(_0xdfd0('0x2'));var rp=require(_0xdfd0('0x3'));var moment=require('moment');var BPromise=require(_0xdfd0('0x4'));var Mustache=require(_0xdfd0('0x5'));var util=require('util');var path=require(_0xdfd0('0x6'));var sox=require(_0xdfd0('0x7'));var csv=require(_0xdfd0('0x8'));var ejs=require(_0xdfd0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdfd0('0xa'));var crypto=require(_0xdfd0('0xb'));var jsforce=require(_0xdfd0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdfd0('0x8'));var querystring=require(_0xdfd0('0xd'));var Papa=require(_0xdfd0('0xe'));var extract=require(_0xdfd0('0xf'));var rimraf=require(_0xdfd0('0x10'));var archiver=require(_0xdfd0('0x11'));var Redis=require(_0xdfd0('0x12'));var authService=require(_0xdfd0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdfd0('0x14'));var hardwareService=require(_0xdfd0('0x15'));var logger=require(_0xdfd0('0x16'))(_0xdfd0('0x17'));var utils=require(_0xdfd0('0x18'));var config=require(_0xdfd0('0x19'));var licenseUtil=require(_0xdfd0('0x1a'));var db=require(_0xdfd0('0x1b'))['db'];config['redis']=_[_0xdfd0('0x1c')](config[_0xdfd0('0x1d')],{'host':_0xdfd0('0x1e'),'port':0x18eb});var socket=require(_0xdfd0('0x1f'))(new Redis(config['redis']));require(_0xdfd0('0x20'))[_0xdfd0('0x21')](socket);function respondWithStatusCode(_0x3e2214,_0x285903){_0x285903=_0x285903||0xcc;return function(_0x24eb1b){if(_0x24eb1b){return _0x3e2214[_0xdfd0('0x22')](_0x285903);}return _0x3e2214[_0xdfd0('0x23')](_0x285903)['end']();};}function respondWithResult(_0x2c114a,_0x49c4c5){_0x49c4c5=_0x49c4c5||0xc8;return function(_0x50ff27){if(_0x50ff27){return _0x2c114a[_0xdfd0('0x23')](_0x49c4c5)['json'](_0x50ff27);}};}function respondWithFilteredResult(_0x226211,_0x5b1caf){return function(_0x22a778){if(_0x22a778){var _0x4dcdd2=typeof _0x5b1caf[_0xdfd0('0x24')]===_0xdfd0('0x25')&&typeof _0x5b1caf[_0xdfd0('0x26')]==='undefined';var _0x299a24=_0x22a778[_0xdfd0('0x27')];var _0x1f7938=_0x4dcdd2?0x0:_0x5b1caf[_0xdfd0('0x24')];var _0x1f8caf=_0x4dcdd2?_0x22a778[_0xdfd0('0x27')]:_0x5b1caf[_0xdfd0('0x24')]+_0x5b1caf['limit'];var _0x1b5a8e;if(_0x1f8caf>=_0x299a24){_0x1f8caf=_0x299a24;_0x1b5a8e=0xc8;}else{_0x1b5a8e=0xce;}_0x226211[_0xdfd0('0x23')](_0x1b5a8e);return _0x226211[_0xdfd0('0x28')](_0xdfd0('0x29'),_0x1f7938+'-'+_0x1f8caf+'/'+_0x299a24)[_0xdfd0('0x2a')](_0x22a778);}return null;};}function patchUpdates(_0x2634c1){return function(_0x2c024e){try{jsonpatch[_0xdfd0('0x2b')](_0x2c024e,_0x2634c1,!![]);}catch(_0x3916fa){return BPromise[_0xdfd0('0x2c')](_0x3916fa);}return _0x2c024e['save']();};}function saveUpdates(_0x2512af,_0x27fbe2){return function(_0x4155e9){if(_0x4155e9){return _0x4155e9['update'](_0x2512af)[_0xdfd0('0x2d')](function(_0x16cd09){return _0x16cd09;});}return null;};}function removeEntity(_0x15203b,_0x2bb5a7){return function(_0x5bf4b4){if(_0x5bf4b4){return _0x5bf4b4[_0xdfd0('0x2e')]()[_0xdfd0('0x2d')](function(){var _0x3cf26f=_0x5bf4b4['get']({'plain':!![]});var _0x41e171='Plugins';return db[_0xdfd0('0x2f')][_0xdfd0('0x2e')]({'where':{'type':_0x41e171,'resourceId':_0x3cf26f['id']}})['then'](function(){return _0x5bf4b4;});})[_0xdfd0('0x2d')](function(){_0x15203b[_0xdfd0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec0fb,_0x3f1781){return function(_0x449f88){if(!_0x449f88){_0x5ec0fb['sendStatus'](0x194);}return _0x449f88;};}function handleError(_0x5a6444,_0x2427ed){_0x2427ed=_0x2427ed||0x1f4;return function(_0x253931){logger['error'](_0x253931[_0xdfd0('0x30')]);if(_0x253931['name']){delete _0x253931[_0xdfd0('0x31')];}_0x5a6444[_0xdfd0('0x23')](_0x2427ed)['send'](_0x253931);};}exports[_0xdfd0('0x32')]=function(_0x230bbf,_0xbb9214){var _0x56c25d={},_0x2e2a68={},_0xaac9fb={'count':0x0,'rows':[]};var _0xa323d4=_['map'](db[_0xdfd0('0x33')][_0xdfd0('0x34')],function(_0x3e5489){return{'name':_0x3e5489[_0xdfd0('0x35')],'type':_0x3e5489[_0xdfd0('0x36')][_0xdfd0('0x37')]};});_0x2e2a68['model']=_[_0xdfd0('0x38')](_0xa323d4,_0xdfd0('0x31'));_0x2e2a68[_0xdfd0('0x39')]=_[_0xdfd0('0x3a')](_0x230bbf[_0xdfd0('0x39')]);_0x2e2a68[_0xdfd0('0x3b')]=_[_0xdfd0('0x3c')](_0x2e2a68[_0xdfd0('0x3d')],_0x2e2a68[_0xdfd0('0x39')]);_0x56c25d[_0xdfd0('0x3e')]=_[_0xdfd0('0x3c')](_0x2e2a68[_0xdfd0('0x3d')],qs[_0xdfd0('0x3f')](_0x230bbf['query']['fields']));_0x56c25d[_0xdfd0('0x3e')]=_0x56c25d['attributes']['length']?_0x56c25d[_0xdfd0('0x3e')]:_0x2e2a68['model'];if(!_0x230bbf[_0xdfd0('0x39')][_0xdfd0('0x40')](_0xdfd0('0x41'))){_0x56c25d['limit']=qs[_0xdfd0('0x26')](_0x230bbf[_0xdfd0('0x39')][_0xdfd0('0x26')]);_0x56c25d[_0xdfd0('0x24')]=qs[_0xdfd0('0x24')](_0x230bbf[_0xdfd0('0x39')][_0xdfd0('0x24')]);}_0x56c25d[_0xdfd0('0x42')]=qs[_0xdfd0('0x43')](_0x230bbf['query'][_0xdfd0('0x43')]);_0x56c25d['where']=qs[_0xdfd0('0x3b')](_[_0xdfd0('0x44')](_0x230bbf[_0xdfd0('0x39')],_0x2e2a68[_0xdfd0('0x3b')]),_0xa323d4);if(_0x230bbf[_0xdfd0('0x39')][_0xdfd0('0x45')]){_0x56c25d[_0xdfd0('0x46')]=_[_0xdfd0('0x47')](_0x56c25d[_0xdfd0('0x46')],{'$or':_['map'](_0xa323d4,function(_0x18472e){if(_0x18472e['type']!=='VIRTUAL'){var _0x559953={};_0x559953[_0x18472e[_0xdfd0('0x31')]]={'$like':'%'+_0x230bbf[_0xdfd0('0x39')][_0xdfd0('0x45')]+'%'};return _0x559953;}})});}_0x56c25d=_[_0xdfd0('0x47')]({},_0x56c25d,_0x230bbf[_0xdfd0('0x48')]);var _0x1c2874={'where':_0x56c25d['where']};return db[_0xdfd0('0x33')][_0xdfd0('0x27')](_0x1c2874)[_0xdfd0('0x2d')](function(_0x1e7954){_0xaac9fb[_0xdfd0('0x27')]=_0x1e7954;if(_0x230bbf[_0xdfd0('0x39')][_0xdfd0('0x49')]){_0x56c25d[_0xdfd0('0x4a')]=[{'all':!![]}];}return db[_0xdfd0('0x33')][_0xdfd0('0x4b')](_0x56c25d);})['then'](function(_0x317893){_0xaac9fb['rows']=_0x317893;return _0xaac9fb;})[_0xdfd0('0x2d')](respondWithFilteredResult(_0xbb9214,_0x56c25d))[_0xdfd0('0x4c')](handleError(_0xbb9214,null));};exports['show']=function(_0x8576d7,_0x549ca0){var _0x2d4646={'raw':!![],'where':{'id':_0x8576d7[_0xdfd0('0x4d')]['id']}},_0x397e92={};_0x397e92[_0xdfd0('0x3d')]=_[_0xdfd0('0x3a')](db['Plugin'][_0xdfd0('0x34')]);_0x397e92[_0xdfd0('0x39')]=_[_0xdfd0('0x3a')](_0x8576d7['query']);_0x397e92[_0xdfd0('0x3b')]=_[_0xdfd0('0x3c')](_0x397e92[_0xdfd0('0x3d')],_0x397e92['query']);_0x2d4646[_0xdfd0('0x3e')]=_['intersection'](_0x397e92['model'],qs[_0xdfd0('0x3f')](_0x8576d7['query']['fields']));_0x2d4646[_0xdfd0('0x3e')]=_0x2d4646[_0xdfd0('0x3e')]['length']?_0x2d4646['attributes']:_0x397e92['model'];if(_0x8576d7['query'][_0xdfd0('0x49')]){_0x2d4646[_0xdfd0('0x4a')]=[{'all':!![]}];}_0x2d4646=_[_0xdfd0('0x47')]({},_0x2d4646,_0x8576d7[_0xdfd0('0x48')]);return db['Plugin'][_0xdfd0('0x4e')](_0x2d4646)['then'](handleEntityNotFound(_0x549ca0,null))['then'](respondWithResult(_0x549ca0,null))[_0xdfd0('0x4c')](handleError(_0x549ca0,null));};exports[_0xdfd0('0x4f')]=function(_0x13ebe9,_0x5558a3,_0x5f8667){return db['Plugin']['find']({'where':{'id':_0x13ebe9[_0xdfd0('0x4d')]['id']},'attributes':[_0xdfd0('0x31'),'path'],'raw':!![]})[_0xdfd0('0x2d')](handleEntityNotFound(_0x5558a3,null))[_0xdfd0('0x2d')](function(_0x28d31f){if(_0x28d31f){var _0x443f04=path[_0xdfd0('0x50')](config[_0xdfd0('0x51')],'server/files/plugins',util[_0xdfd0('0x52')](_0xdfd0('0x53'),path[_0xdfd0('0x54')](_0x28d31f['path'])));var _0x43a05f=fs[_0xdfd0('0x55')](_0x443f04);var _0x42efa2=archiver(_0xdfd0('0x56'),{'zlib':{'level':0x9}});_0x42efa2['on'](_0xdfd0('0x57'),function(_0x2a8728){if(_0x2a8728['code']==='ENOENT'){logger[_0xdfd0('0x58')](_0x2a8728);}else{throw new db[(_0xdfd0('0x59'))][(_0xdfd0('0x5a'))](_0xdfd0('0x5b'));}});_0x42efa2['on'](_0xdfd0('0x58'),function(_0x37a366){throw new db[(_0xdfd0('0x59'))][(_0xdfd0('0x5a'))](_0xdfd0('0x5b'));});_0x42efa2[_0xdfd0('0x5c')](_0x43a05f);_0x42efa2['glob']('**/*',{'cwd':path[_0xdfd0('0x50')](config['root'],_0xdfd0('0x5d'),path['dirname'](_0x28d31f['path'])),'ignore':[path[_0xdfd0('0x50')](path[_0xdfd0('0x54')](_0x28d31f[_0xdfd0('0x6')]),_0xdfd0('0x5e')),path['join'](path[_0xdfd0('0x54')](_0x28d31f[_0xdfd0('0x6')]),_0xdfd0('0x5f'))],'nodir':!![]})[_0xdfd0('0x60')]();_0x43a05f['on']('close',function(){if(!fs[_0xdfd0('0x61')](_0x443f04)){throw new db[(_0xdfd0('0x59'))][(_0xdfd0('0x5a'))](_0xdfd0('0x62'));}return _0x5558a3['download'](_0x443f04,util[_0xdfd0('0x52')]('%s.zip',path['basename'](_0x28d31f[_0xdfd0('0x6')])),function(_0x110fe7){if(_0x110fe7){throw new db['Sequelize'][(_0xdfd0('0x5a'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xdfd0('0x63')](_0x443f04);logger[_0xdfd0('0x64')]('Download\x20completed');logger[_0xdfd0('0x64')](_0xdfd0('0x65'));});});}return null;})[_0xdfd0('0x4c')](handleError(_0x5558a3,null));};exports[_0xdfd0('0x66')]=function(_0x4d69d0,_0x2d76d3,_0xcad2a2){var _0x2d3778=path[_0xdfd0('0x54')](_0x4d69d0['file']['filename'],path[_0xdfd0('0x67')](_0x4d69d0[_0xdfd0('0x68')][_0xdfd0('0x69')]));var _0x1efa2c=path[_0xdfd0('0x50')](config[_0xdfd0('0x51')],_0xdfd0('0x5d'),_0x4d69d0[_0xdfd0('0x68')]['filename']);var _0xfc1660=path['join'](config[_0xdfd0('0x51')],'server/files/plugins',_0x2d3778);logger[_0xdfd0('0x64')]('Plugin\x20upload\x20filepath:\x20%s',_0x1efa2c);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0xfc1660);try{fs['chmodSync'](_0x1efa2c,parseInt(_0xdfd0('0x6a'),0x8));extract(_0x1efa2c,{'dir':_0xfc1660},function(_0x431f59){if(_0x431f59){logger[_0xdfd0('0x58')](_0x431f59);handleError(_0x431f59,!![]);};var _0x1313d4=fs[_0xdfd0('0x6b')](_0xfc1660);if(_0x1313d4[_0xdfd0('0x6c')]>0x1){removeReferences(_0x1efa2c,_0xfc1660);logger['error'](_0xdfd0('0x6d'));return _0xcad2a2(new Error('Invalid\x20plugin\x20structure'));}var _0x5db5cf=fs['lstatSync'](path[_0xdfd0('0x50')](_0xfc1660,_0x1313d4[0x0]));if(_0x5db5cf[_0xdfd0('0x6e')]()){removeReferences(_0x1efa2c,_0xfc1660);logger['error']('Invalid\x20plugin\x20structure');return _0xcad2a2(new Error(_0xdfd0('0x6d')));}if(_0x5db5cf[_0xdfd0('0x6f')]()){var _0x28a92c=fs['readdirSync'](path[_0xdfd0('0x50')](_0xfc1660,_0x1313d4[0x0]));if(_0x28a92c['length']===0x0){removeReferences(_0x1efa2c,_0xfc1660);logger[_0xdfd0('0x58')](_0xdfd0('0x6d'));return _0xcad2a2(new Error('Invalid\x20plugin\x20structure'));}var _0x296a94=_0x28a92c[_0xdfd0('0x70')](function(_0x3fde08){return _0x3fde08===_0xdfd0('0x71');});if(!_0x296a94){return _0xcad2a2(new Error(_0xdfd0('0x72')));}var _0x32677e=fs[_0xdfd0('0x73')](path[_0xdfd0('0x50')](_0xfc1660,_0x1313d4[0x0],_0xdfd0('0x71')));var _0x7fdcd0=JSON[_0xdfd0('0x74')](_0x32677e);if(_0xdfd0('0x25')==typeof _0x7fdcd0[_0xdfd0('0x31')]){return _0xcad2a2(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xdfd0('0x25')==typeof _0x7fdcd0[_0xdfd0('0x36')]){return _0xcad2a2(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xdfd0('0x25')==typeof _0x7fdcd0[_0xdfd0('0x75')]){return _0xcad2a2(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xdfd0('0x25')==typeof _0x7fdcd0[_0xdfd0('0x76')]){return _0xcad2a2(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x7fdcd0[_0xdfd0('0x36')]===_0xdfd0('0x77')){if(_0xdfd0('0x25')==typeof _0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x78')]){return _0xcad2a2(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xdfd0('0x25')==typeof _0x7fdcd0[_0xdfd0('0x76')]['views'][_0xdfd0('0x79')]&&_0xdfd0('0x25')==typeof _0x7fdcd0['parameters']['views']['agent']){return _0xcad2a2(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x7fdcd0[_0xdfd0('0x36')]===_0xdfd0('0x7a')){if('undefined'==typeof _0x7fdcd0[_0xdfd0('0x76')]['scriptName']){return _0xcad2a2(new Error(_0xdfd0('0x7b')));}if('undefined'==typeof _0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x7c')]){return _0xcad2a2(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xcad2a2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x436361=_0x7fdcd0['name'];var _0x2d519f=_0x7fdcd0[_0xdfd0('0x7d')];var _0x1166e7=_0x7fdcd0[_0xdfd0('0x36')];var _0x222b07=_0x7fdcd0[_0xdfd0('0x7e')]?_0x7fdcd0[_0xdfd0('0x7e')]:_0xdfd0('0x7f');var _0x3229b7=_0x7fdcd0[_0xdfd0('0x80')]?_0x7fdcd0['icon']:_0xdfd0('0x81');var _0x5efdc7='';var _0x4a957a='';var _0x459f15='';var _0xc5e112='';var _0x1949cc=_0x7fdcd0[_0xdfd0('0x75')];if(_0x1166e7===_0xdfd0('0x77')){if('undefined'!=typeof _0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x78')]['admin']){var _0x264d32=_0x7fdcd0['parameters'][_0xdfd0('0x78')][_0xdfd0('0x79')];if(!/^(f|ht)tps?:\/\//i[_0xdfd0('0x82')](_0x264d32)){_0x5efdc7=path[_0xdfd0('0x50')](_0xdfd0('0x83'),_0x2d3778,_0x1313d4[0x0],_0x264d32);}else{_0x5efdc7=_0x264d32;}}else{logger[_0xdfd0('0x64')](_0xdfd0('0x84'));}if(_0xdfd0('0x25')!=typeof _0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x78')][_0xdfd0('0x85')]){var _0x2e9359=_0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x78')][_0xdfd0('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xdfd0('0x82')](_0x2e9359)){_0x4a957a=path[_0xdfd0('0x50')](_0xdfd0('0x83'),_0x2d3778,_0x1313d4[0x0],_0x2e9359);}else{_0x4a957a=_0x2e9359;}}else{logger['info'](_0xdfd0('0x86'));}}else if(_0x1166e7===_0xdfd0('0x7a')){_0x459f15=_0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x87')];_0xc5e112=_0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x7c')];if(_0xdfd0('0x25')!=typeof _0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x78')]){if(_0xdfd0('0x25')!=typeof _0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x78')]['admin']){var _0x264d32=_0x7fdcd0[_0xdfd0('0x76')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xdfd0('0x82')](_0x264d32)){_0x5efdc7=path[_0xdfd0('0x50')](_0xdfd0('0x83'),_0x2d3778,_0x1313d4[0x0],_0x264d32);}else{_0x5efdc7=_0x264d32;}}if(_0xdfd0('0x25')!=typeof _0x7fdcd0[_0xdfd0('0x76')][_0xdfd0('0x78')]['agent']){var _0x2e9359=_0x7fdcd0['parameters'][_0xdfd0('0x78')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2e9359)){_0x4a957a=path[_0xdfd0('0x50')](_0xdfd0('0x83'),_0x2d3778,_0x1313d4[0x0],_0x2e9359);}else{_0x4a957a=_0x2e9359;}}}}var _0x262f3e={'name':_0x436361,'description':_0x2d519f,'path':path[_0xdfd0('0x50')](_0x2d3778,_0x1313d4[0x0]),'type':_0x1166e7,'sidebar':_0x222b07,'icon':_0x3229b7,'adminUrl':_0x5efdc7,'agentUrl':_0x4a957a,'scriptName':_0x459f15,'scriptPath':_0xc5e112,'version':_0x1949cc};removeReferences(_0x1efa2c,null);return db[_0xdfd0('0x33')][_0xdfd0('0x88')](_0x262f3e)['then'](function(_0x2f23a0){var _0x2fd1bb={'role':_0x4d69d0[_0xdfd0('0x89')]['role'],'userProfileId':_0x4d69d0[_0xdfd0('0x89')][_0xdfd0('0x8a')]};if(!_0x2fd1bb)throw new Error(_0xdfd0('0x8b'));if(_0x2fd1bb['role']==='user'){var _0x3b4611=_0x2f23a0['get']({'plain':!![]});return db[_0xdfd0('0x8c')][_0xdfd0('0x4e')]({'where':{'name':_0xdfd0('0x8d'),'userProfileId':_0x2fd1bb[_0xdfd0('0x8a')]},'raw':!![]})[_0xdfd0('0x2d')](function(_0x520197){if(_0x520197&&_0x520197[_0xdfd0('0x8e')]===0x0){return db[_0xdfd0('0x2f')][_0xdfd0('0x88')]({'name':_0x3b4611['name'],'resourceId':_0x3b4611['id'],'type':_0x520197['name'],'sectionId':_0x520197['id']},{})[_0xdfd0('0x2d')](function(){return _0x2f23a0;});}else{return _0x2f23a0;}})[_0xdfd0('0x4c')](function(_0x2c165d){logger[_0xdfd0('0x58')](_0xdfd0('0x8f'),_0x2c165d);throw _0x2c165d;});}return _0x2f23a0;})['then'](respondWithResult(_0x2d76d3,null))[_0xdfd0('0x4c')](handleError(_0x2d76d3,null));}});}catch(_0x129efa){_0x2d76d3[_0xdfd0('0x23')](0x1f4)[_0xdfd0('0x90')](_0x129efa);}};function removeReferences(_0x2b97af,_0x4c7977){try{if(_0x2b97af){fs[_0xdfd0('0x63')](_0x2b97af);logger[_0xdfd0('0x64')](_0xdfd0('0x91'));}if(_0x4c7977){rimraf(_0x4c7977,function(){});logger[_0xdfd0('0x64')](_0xdfd0('0x92'));}}catch(_0x2ef927){logger['error'](_0x2ef927);}}exports[_0xdfd0('0x93')]=function(_0x5f34d7,_0x137825,_0x4e90f2){return db[_0xdfd0('0x33')][_0xdfd0('0x4e')]({'where':{'id':_0x5f34d7[_0xdfd0('0x4d')]['id']}})[_0xdfd0('0x2d')](handleEntityNotFound(_0x137825,null))[_0xdfd0('0x2d')](saveUpdates(_0x5f34d7[_0xdfd0('0x89')],null))[_0xdfd0('0x2d')](respondWithResult(_0x137825,null))[_0xdfd0('0x4c')](handleError(_0x137825,null));};exports[_0xdfd0('0x94')]=function(_0x436722,_0x49a064,_0x327b6e){return db['Plugin']['find']({'where':{'id':_0x436722[_0xdfd0('0x4d')]['id']}})[_0xdfd0('0x2d')](function(_0x5a826f){if(_0x5a826f){return _0x5a826f[_0xdfd0('0x2e')]();}})[_0xdfd0('0x2d')](function(_0x1a5880){rimraf(path[_0xdfd0('0x50')](config[_0xdfd0('0x51')],_0xdfd0('0x5d'),path[_0xdfd0('0x95')](_0x1a5880[_0xdfd0('0x6')])),function(){});return _0x1a5880;})[_0xdfd0('0x2d')](handleEntityNotFound(_0x49a064,null))[_0xdfd0('0x2d')](respondWithStatusCode(_0x49a064,null))[_0xdfd0('0x4c')](handleError(_0x49a064,null));};exports['webhookGet']=function(_0x27046a,_0x5f1377,_0x42d824){return BPromise[_0xdfd0('0x96')]()['then'](function(){if(!_0x27046a[_0xdfd0('0x39')][_0xdfd0('0x6')]){throw new Error(_0xdfd0('0x97'));}if(!_0x27046a[_0xdfd0('0x39')]['port']){throw new Error(_0xdfd0('0x98'));}var _0x31c289=_0x27046a[_0xdfd0('0x39')]['hostname']?_0x27046a[_0xdfd0('0x39')][_0xdfd0('0x99')]+':'+_0x27046a['query']['port']:_0xdfd0('0x9a')+_0x27046a[_0xdfd0('0x39')][_0xdfd0('0x9b')];var _0x4558ad=_0x27046a[_0xdfd0('0x39')][_0xdfd0('0x2a')]?_0x27046a[_0xdfd0('0x39')]['json']:!![];var _0x9a2ec5=_0x27046a['query'][_0xdfd0('0x9c')]?_0x27046a['query'][_0xdfd0('0x9c')]:null;var _0x38ae82={'method':_0x27046a[_0xdfd0('0x9d')],'uri':util[_0xdfd0('0x52')]('%s%s',_0x31c289,_0x27046a[_0xdfd0('0x39')][_0xdfd0('0x6')]),'json':_0x4558ad,'resolveWithFullResponse':!![],'encoding':_0x9a2ec5,'qs':_0x27046a[_0xdfd0('0x39')]};if(_0x27046a['headers']){_0x38ae82['headers']=_0x27046a['headers'];if(_0x38ae82[_0xdfd0('0x9e')][_0xdfd0('0x9f')]){delete _0x38ae82['headers']['content-length'];}}if(_0x38ae82[_0xdfd0('0x9e')][_0xdfd0('0xa0')]){delete _0x38ae82[_0xdfd0('0x9e')][_0xdfd0('0xa0')];}return rp(_0x38ae82);})[_0xdfd0('0x2d')](function(_0x3ffc80){if(_0x3ffc80){_0x5f1377['set'](_0x3ffc80['headers']);logger['info'](_0x3ffc80[_0xdfd0('0x89')]);if(_[_0xdfd0('0xa1')](_0x27046a[_0xdfd0('0x39')][_0xdfd0('0x6')],'download')&&_0x3ffc80['statusCode']==0x1f4){return _0x5f1377[_0xdfd0('0x22')](_0x3ffc80['statusCode']);}else{return _0x5f1377[_0xdfd0('0x23')](_0x3ffc80[_0xdfd0('0xa2')])[_0xdfd0('0x90')](_0x3ffc80['body']);}}else{return _0x5f1377[_0xdfd0('0x22')](0xc8);}})['catch'](handleError(_0x5f1377,null));};exports[_0xdfd0('0xa3')]=function(_0x53ad3f,_0xd1b96,_0x93013d){return BPromise['resolve']()[_0xdfd0('0x2d')](function(){if(!_0x53ad3f[_0xdfd0('0x39')][_0xdfd0('0x6')]){throw new Error(_0xdfd0('0x97'));}if(!_0x53ad3f['query'][_0xdfd0('0x9b')]){throw new Error(_0xdfd0('0x98'));}var _0x5bafd2=_0x53ad3f['query'][_0xdfd0('0x99')]?_0x53ad3f[_0xdfd0('0x39')][_0xdfd0('0x99')]+':'+_0x53ad3f[_0xdfd0('0x39')][_0xdfd0('0x9b')]:_0xdfd0('0x9a')+_0x53ad3f['query'][_0xdfd0('0x9b')];var _0x2162b6=_0x53ad3f[_0xdfd0('0x39')][_0xdfd0('0x2a')]?_0x53ad3f[_0xdfd0('0x39')][_0xdfd0('0x2a')]:!![];var _0x40c066=_0x53ad3f['query'][_0xdfd0('0x9c')]?_0x53ad3f[_0xdfd0('0x39')][_0xdfd0('0x9c')]:null;var _0x120771={'method':_0x53ad3f[_0xdfd0('0x9d')],'uri':util[_0xdfd0('0x52')](_0xdfd0('0xa4'),_0x5bafd2,_0x53ad3f['query'][_0xdfd0('0x6')]),'json':_0x2162b6,'resolveWithFullResponse':!![],'encoding':_0x40c066,'body':_0x53ad3f['body']};if(_0x53ad3f[_0xdfd0('0x9e')]){_0x120771['headers']=_0x53ad3f['headers'];if(_0x120771[_0xdfd0('0x9e')][_0xdfd0('0x9f')]){delete _0x120771[_0xdfd0('0x9e')][_0xdfd0('0x9f')];}}if(_0x120771['headers'][_0xdfd0('0xa0')]){delete _0x120771[_0xdfd0('0x9e')][_0xdfd0('0xa0')];}return rp(_0x120771);})[_0xdfd0('0x2d')](function(_0x1857e4){if(_0x1857e4){_0xd1b96[_0xdfd0('0x28')](_0x1857e4['headers']);logger[_0xdfd0('0x64')](_0x1857e4[_0xdfd0('0x89')]);return _0xd1b96['status'](_0x1857e4[_0xdfd0('0xa2')])[_0xdfd0('0x90')](_0x1857e4[_0xdfd0('0x89')]);}else{return _0xd1b96['sendStatus'](0xc8);}})[_0xdfd0('0x4c')](handleError(_0xd1b96,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index cf192b0..6abf81c 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 _0xf693=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x2a3338,_0x1b92bd){var _0x21ff53=function(_0x67d8c7){while(--_0x67d8c7){_0x2a3338['push'](_0x2a3338['shift']());}};_0x21ff53(++_0x1b92bd);}(_0xf693,0x181));var _0x3f69=function(_0x43e5bd,_0x382145){_0x43e5bd=_0x43e5bd-0x0;var _0x314cab=_0xf693[_0x43e5bd];return _0x314cab;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x3f69('0x0'))['db'][_0x3f69('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x3f69('0x2')](0x0);var events={'afterCreate':_0x3f69('0x3'),'afterUpdate':_0x3f69('0x4'),'afterDestroy':_0x3f69('0x5')};function emitEvent(_0x414ca5){return function(_0x527646,_0xf2fdd8,_0x300282){PluginEvents[_0x3f69('0x6')](_0x414ca5+':'+_0x527646['id'],_0x527646);PluginEvents[_0x3f69('0x6')](_0x414ca5,_0x527646);_0x300282(null);};}for(var e in events){if(events[_0x3f69('0x7')](e)){var event=events[e];Plugin[_0x3f69('0x8')](e,emitEvent(event));}}module[_0x3f69('0x9')]=PluginEvents; \ No newline at end of file +var _0xa751=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','update'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa751,0x175));var _0x1a75=function(_0x5603ee,_0x36e74c){_0x5603ee=_0x5603ee-0x0;var _0x38ce84=_0xa751[_0x5603ee];return _0x38ce84;};'use strict';var EventEmitter=require(_0x1a75('0x0'));var Plugin=require(_0x1a75('0x1'))['db'][_0x1a75('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x1a75('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a75('0x4'),'afterDestroy':'remove'};function emitEvent(_0x31db55){return function(_0x95fa7,_0x2ea393,_0x4ebf37){PluginEvents[_0x1a75('0x5')](_0x31db55+':'+_0x95fa7['id'],_0x95fa7);PluginEvents[_0x1a75('0x5')](_0x31db55,_0x95fa7);_0x4ebf37(null);};}for(var e in events){if(events[_0x1a75('0x6')](e)){var event=events[e];Plugin[_0x1a75('0x7')](e,emitEvent(event));}}module[_0x1a75('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 299c311..d93bb9b 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 _0x771d=['rimraf','../../config/environment','./plugin.attributes','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x771d,0xd5));var _0xd771=function(_0x807a46,_0x3149dc){_0x807a46=_0x807a46-0x0;var _0x5e4606=_0x771d[_0x807a46];return _0x5e4606;};'use strict';var _=require(_0xd771('0x0'));var util=require(_0xd771('0x1'));var logger=require(_0xd771('0x2'))(_0xd771('0x3'));var moment=require(_0xd771('0x4'));var BPromise=require(_0xd771('0x5'));var rp=require(_0xd771('0x6'));var fs=require('fs');var path=require(_0xd771('0x7'));var rimraf=require(_0xd771('0x8'));var config=require(_0xd771('0x9'));var attributes=require(_0xd771('0xa'));module['exports']=function(_0x57c610,_0x13c601){return _0x57c610['define'](_0xd771('0xb'),attributes,{'tableName':_0xd771('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4874=['Plugin','util','../../config/logger','api','moment','bluebird','path','rimraf','./plugin.attributes'];(function(_0x1a03ec,_0x275076){var _0x7400b1=function(_0x29e344){while(--_0x29e344){_0x1a03ec['push'](_0x1a03ec['shift']());}};_0x7400b1(++_0x275076);}(_0x4874,0x17b));var _0x4487=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x4874[_0x4b73a2];return _0x383c66;};'use strict';var _=require('lodash');var util=require(_0x4487('0x0'));var logger=require(_0x4487('0x1'))(_0x4487('0x2'));var moment=require(_0x4487('0x3'));var BPromise=require(_0x4487('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4487('0x5'));var rimraf=require(_0x4487('0x6'));var config=require('../../config/environment');var attributes=require(_0x4487('0x7'));module['exports']=function(_0x1111a2,_0x1ac5e5){return _0x1111a2['define'](_0x4487('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 54fd052..53596bf 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 _0x7caa=['message','info','request\x20sent','result','catch','CreatePlugin','Plugin','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c87dc,_0x139292){var _0x2b78ec=function(_0x1bb48a){while(--_0x1bb48a){_0x2c87dc['push'](_0x2c87dc['shift']());}};_0x2b78ec(++_0x139292);}(_0x7caa,0xdc));var _0xa7ca=function(_0x55ce84,_0x380f28){_0x55ce84=_0x55ce84-0x0;var _0x409c7c=_0x7caa[_0x55ce84];return _0x409c7c;};'use strict';var _=require(_0xa7ca('0x0'));var util=require(_0xa7ca('0x1'));var moment=require('moment');var BPromise=require(_0xa7ca('0x2'));var rs=require(_0xa7ca('0x3'));var fs=require('fs');var Redis=require(_0xa7ca('0x4'));var db=require(_0xa7ca('0x5'))['db'];var utils=require(_0xa7ca('0x6'));var logger=require(_0xa7ca('0x7'))(_0xa7ca('0x8'));var config=require(_0xa7ca('0x9'));var jayson=require(_0xa7ca('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa7ca('0xb')](config[_0xa7ca('0xc')],{'host':_0xa7ca('0xd'),'port':0x18eb});var socket=require(_0xa7ca('0xe'))(new Redis(config[_0xa7ca('0xc')]));require(_0xa7ca('0xf'))[_0xa7ca('0x10')](socket);function respondWithRpcPromise(_0x28d670,_0x5709c7,_0x480f9a){return new BPromise(function(_0x23493f,_0x31bb49){return client[_0xa7ca('0x11')](_0x28d670,_0x480f9a)[_0xa7ca('0x12')](function(_0xcd428){logger['info'](_0xa7ca('0x13'),_0x5709c7,'request\x20sent');logger[_0xa7ca('0x14')](_0xa7ca('0x15'),_0x5709c7,'request\x20sent',JSON[_0xa7ca('0x16')](_0xcd428));if(_0xcd428[_0xa7ca('0x17')]){if(_0xcd428['error'][_0xa7ca('0x18')]===0x1f4){logger[_0xa7ca('0x17')]('Plugin,\x20%s,\x20%s',_0x5709c7,_0xcd428[_0xa7ca('0x17')][_0xa7ca('0x19')]);return _0x31bb49(_0xcd428[_0xa7ca('0x17')][_0xa7ca('0x19')]);}logger[_0xa7ca('0x17')](_0xa7ca('0x13'),_0x5709c7,_0xcd428[_0xa7ca('0x17')][_0xa7ca('0x19')]);return _0x23493f(_0xcd428[_0xa7ca('0x17')][_0xa7ca('0x19')]);}else{logger[_0xa7ca('0x1a')](_0xa7ca('0x13'),_0x5709c7,_0xa7ca('0x1b'));_0x23493f(_0xcd428[_0xa7ca('0x1c')][_0xa7ca('0x19')]);}})[_0xa7ca('0x1d')](function(_0xaf4965){logger['error'](_0xa7ca('0x13'),_0x5709c7,_0xaf4965);_0x31bb49(_0xaf4965);});});}exports[_0xa7ca('0x1e')]=function(_0x2535d1){var _0xa17d1e=this;return new Promise(function(_0x5d71c0,_0x5dec17){return db[_0xa7ca('0x1f')]['create'](_0x2535d1[_0xa7ca('0x20')],{'raw':_0x2535d1['options']?_0x2535d1[_0xa7ca('0x21')][_0xa7ca('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x52697f){logger[_0xa7ca('0x1a')](_0xa7ca('0x1e'),_0x2535d1);logger[_0xa7ca('0x14')]('CreatePlugin',_0x2535d1,JSON[_0xa7ca('0x16')](_0x52697f));_0x5d71c0(_0x52697f);})['catch'](function(_0x48057a){logger[_0xa7ca('0x17')](_0xa7ca('0x1e'),_0x48057a[_0xa7ca('0x19')],_0x2535d1);_0x5dec17(_0xa17d1e[_0xa7ca('0x17')](0x1f4,_0x48057a['message']));});});}; \ No newline at end of file +var _0xebda=['http','redis','localhost','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','create','body','options','raw','CreatePlugin','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xebda,0xa9));var _0xaebd=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xebda[_0x3e112d];return _0x531c31;};'use strict';var _=require('lodash');var util=require(_0xaebd('0x0'));var moment=require(_0xaebd('0x1'));var BPromise=require(_0xaebd('0x2'));var rs=require(_0xaebd('0x3'));var fs=require('fs');var Redis=require(_0xaebd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaebd('0x5'));var logger=require(_0xaebd('0x6'))(_0xaebd('0x7'));var config=require(_0xaebd('0x8'));var jayson=require(_0xaebd('0x9'));var client=jayson[_0xaebd('0xa')][_0xaebd('0xb')]({'port':0x232a});config[_0xaebd('0xc')]=_['defaults'](config[_0xaebd('0xc')],{'host':_0xaebd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaebd('0xc')]));require(_0xaebd('0xe'))['register'](socket);function respondWithRpcPromise(_0x25e7e7,_0x3ccb52,_0x15902d){return new BPromise(function(_0x31c3db,_0x414f7f){return client[_0xaebd('0xf')](_0x25e7e7,_0x15902d)[_0xaebd('0x10')](function(_0x2dba91){logger[_0xaebd('0x11')](_0xaebd('0x12'),_0x3ccb52,_0xaebd('0x13'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x3ccb52,_0xaebd('0x13'),JSON[_0xaebd('0x14')](_0x2dba91));if(_0x2dba91[_0xaebd('0x15')]){if(_0x2dba91[_0xaebd('0x15')][_0xaebd('0x16')]===0x1f4){logger[_0xaebd('0x15')](_0xaebd('0x12'),_0x3ccb52,_0x2dba91[_0xaebd('0x15')][_0xaebd('0x17')]);return _0x414f7f(_0x2dba91[_0xaebd('0x15')]['message']);}logger[_0xaebd('0x15')](_0xaebd('0x12'),_0x3ccb52,_0x2dba91[_0xaebd('0x15')][_0xaebd('0x17')]);return _0x31c3db(_0x2dba91['error'][_0xaebd('0x17')]);}else{logger['info'](_0xaebd('0x12'),_0x3ccb52,_0xaebd('0x13'));_0x31c3db(_0x2dba91['result'][_0xaebd('0x17')]);}})[_0xaebd('0x18')](function(_0x539f1e){logger['error']('Plugin,\x20%s,\x20%s',_0x3ccb52,_0x539f1e);_0x414f7f(_0x539f1e);});});}exports['CreatePlugin']=function(_0x579ac3){var _0x33df65=this;return new Promise(function(_0x210453,_0x202319){return db['Plugin'][_0xaebd('0x19')](_0x579ac3[_0xaebd('0x1a')],{'raw':_0x579ac3[_0xaebd('0x1b')]?_0x579ac3['options'][_0xaebd('0x1c')]===undefined?!![]:![]:!![]})[_0xaebd('0x10')](function(_0x43baeb){logger[_0xaebd('0x11')](_0xaebd('0x1d'),_0x579ac3);logger['debug'](_0xaebd('0x1d'),_0x579ac3,JSON['stringify'](_0x43baeb));_0x210453(_0x43baeb);})[_0xaebd('0x18')](function(_0x59289a){logger[_0xaebd('0x15')](_0xaebd('0x1d'),_0x59289a[_0xaebd('0x17')],_0x579ac3);_0x202319(_0x33df65['error'](0x1f4,_0x59289a['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 2452dc0..34f7737 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 _0xa346=['plugin:','update','emit','removeListener','register','length'];(function(_0x5c4d30,_0x2bc47a){var _0x120851=function(_0x458736){while(--_0x458736){_0x5c4d30['push'](_0x5c4d30['shift']());}};_0x120851(++_0x2bc47a);}(_0xa346,0x1f3));var _0x6a34=function(_0x27ff03,_0x2e1ff9){_0x27ff03=_0x27ff03-0x0;var _0x578b98=_0xa346[_0x27ff03];return _0x578b98;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove',_0x6a34('0x0')];function createListener(_0x362969,_0x7a48ec){return function(_0x40b104){_0x7a48ec[_0x6a34('0x1')](_0x362969,_0x40b104);};}function removeListener(_0x211925,_0x44c541){return function(){PluginEvents[_0x6a34('0x2')](_0x211925,_0x44c541);};}exports[_0x6a34('0x3')]=function(_0x2b4012){for(var _0x2f42e5=0x0,_0x3622bb=events[_0x6a34('0x4')];_0x2f42e5<_0x3622bb;_0x2f42e5++){var _0x107a6e=events[_0x2f42e5];var _0x2b36dc=createListener(_0x6a34('0x5')+_0x107a6e,_0x2b4012);PluginEvents['on'](_0x107a6e,_0x2b36dc);}}; \ No newline at end of file +var _0xcfee=['register','length','plugin:','save','update','emit','removeListener'];(function(_0x10124b,_0x4239d9){var _0x21b319=function(_0x48d06a){while(--_0x48d06a){_0x10124b['push'](_0x10124b['shift']());}};_0x21b319(++_0x4239d9);}(_0xcfee,0x73));var _0xecfe=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xcfee[_0x2e4e19];return _0x9ba20b;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xecfe('0x0'),'remove',_0xecfe('0x1')];function createListener(_0x546476,_0x404d36){return function(_0x5cc9b7){_0x404d36[_0xecfe('0x2')](_0x546476,_0x5cc9b7);};}function removeListener(_0x4080be,_0x47fbd2){return function(){PluginEvents[_0xecfe('0x3')](_0x4080be,_0x47fbd2);};}exports[_0xecfe('0x4')]=function(_0x364827){for(var _0x4e13a1=0x0,_0x3f812=events[_0xecfe('0x5')];_0x4e13a1<_0x3f812;_0x4e13a1++){var _0x3abc83=events[_0x4e13a1];var _0x4e9b73=createListener(_0xecfe('0x6')+_0x3abc83,_0x364827);PluginEvents['on'](_0x3abc83,_0x4e9b73);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 07cb7b2..e9fa8f8 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(_0x35ab1a,_0x105930){var _0x6c5e1f=function(_0x19eb20){while(--_0x19eb20){_0x35ab1a['push'](_0x35ab1a['shift']());}};_0x6c5e1f(++_0x105930);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x27d6ff,_0x1f507c){var _0x9239aa=function(_0x27f9aa){while(--_0x27f9aa){_0x27d6ff['push'](_0x27d6ff['shift']());}};_0x9239aa(++_0x1f507c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 7521cdd..c46a07d 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 _0xca66=['reject','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','script','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','Unknown\x20status','destroy','lodash','api','path','child_process','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0xca66,0x8b));var _0x6ca6=function(_0x180014,_0x3fd65c){_0x180014=_0x180014-0x0;var _0x3e5a52=_0xca66[_0x180014];return _0x3e5a52;};'use strict';var _=require(_0x6ca6('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x6ca6('0x1'));var path=require(_0x6ca6('0x2'));var exec=require(_0x6ca6('0x3'))['exec'];var BPromise=require(_0x6ca6('0x4'));function handleEntityNotFound(_0x4b1a10,_0x3ab489){return function(_0x5569aa){if(!_0x5569aa){_0x4b1a10[_0x6ca6('0x5')](0x194);;}return _0x5569aa;};}function respondWithResult(_0x27d8c6,_0x34836f){_0x34836f=_0x34836f||0xc8;return function(_0x44019c){if(_0x44019c){return _0x27d8c6[_0x6ca6('0x6')](_0x34836f)[_0x6ca6('0x7')](_0x44019c);}return null;};}function handleError(_0x27d280,_0x4f5651){_0x4f5651=_0x4f5651||0x1f4;return function(_0xf69e0f){logger[_0x6ca6('0x8')](_0xf69e0f[_0x6ca6('0x9')]);if(_0xf69e0f[_0x6ca6('0xa')]){delete _0xf69e0f[_0x6ca6('0xa')];}_0x27d280[_0x6ca6('0x6')](_0x4f5651)[_0x6ca6('0xb')](_0xf69e0f);};}function execChildProcess(){return new BPromise(function(_0x55a626,_0x38678e){exec(_0x6ca6('0xc'),function(_0x25d276,_0x46b795,_0x444243){logger[_0x6ca6('0xd')](_0x46b795);logger['info'](_0x444243);if(_0x25d276){logger[_0x6ca6('0x8')](_0x25d276);return _0x38678e(_0x25d276);}return _0x55a626(_0x46b795);});});}exports[_0x6ca6('0xe')]=function(_0x55238b,_0x412986){return pm2[_0x6ca6('0xf')]()[_0x6ca6('0x10')](function(_0x3570f1){if(_0x3570f1){var _0xc774c=_[_0x6ca6('0x11')](_0x3570f1,function(_0x4c053a){return _0x4c053a['name']==='express'||_0x4c053a[_0x6ca6('0xa')]===_0x6ca6('0x12');});return{'rows':_0xc774c,'count':_0xc774c[_0x6ca6('0x13')]};}return null;})[_0x6ca6('0x10')](respondWithResult(_0x412986,null))[_0x6ca6('0x14')](handleError(_0x412986,null));};exports[_0x6ca6('0x15')]=function(_0x25dc6c,_0x4f056d){return pm2[_0x6ca6('0x16')](_0x25dc6c[_0x6ca6('0x17')]['id'])[_0x6ca6('0x10')](respondWithResult(_0x4f056d,null))[_0x6ca6('0x10')](handleEntityNotFound(_0x4f056d,null))[_0x6ca6('0x14')](handleError(_0x4f056d,null));};exports[_0x6ca6('0x18')]=function(_0x16a3d7,_0x251072){if(_0x16a3d7[_0x6ca6('0x19')][_0x6ca6('0xa')]&&_0x16a3d7[_0x6ca6('0x19')]['script']){var _0x28a982=path[_0x6ca6('0x1a')](__dirname,_0x6ca6('0x1b'),_0x16a3d7[_0x6ca6('0x19')][_0x6ca6('0x1c')]);var _0x438694=process['cwd']();process[_0x6ca6('0x1d')](path[_0x6ca6('0x1e')](_0x28a982));return execChildProcess()['then'](function(_0x4927c1){process[_0x6ca6('0x1d')](_0x438694);return pm2[_0x6ca6('0x1f')]({'name':_0x16a3d7[_0x6ca6('0x19')][_0x6ca6('0xa')],'script':_0x28a982});})[_0x6ca6('0x10')](function(_0x541122){pm2[_0x6ca6('0x20')]();return _0x541122[0x0];})[_0x6ca6('0x10')](respondWithResult(_0x251072,0xc9))[_0x6ca6('0x14')](handleError(_0x251072,null));}else{return _0x251072[_0x6ca6('0x6')](0x1f4)[_0x6ca6('0xb')]({'message':_0x6ca6('0x21')});}};exports[_0x6ca6('0x22')]=function(_0x2a1e2d,_0x516daf){if(_0x2a1e2d['body']['id']){delete _0x2a1e2d[_0x6ca6('0x19')]['id'];}var _0x9467bd={'online':_0x6ca6('0x23'),'stopped':_0x6ca6('0x24')};if(_0x9467bd['hasOwnProperty'](_0x2a1e2d['body'][_0x6ca6('0x6')])){return pm2[_0x9467bd[_0x2a1e2d['body']['status']]](_0x2a1e2d[_0x6ca6('0x17')]['id'])[_0x6ca6('0x10')](respondWithResult(_0x516daf,0xc8))['catch'](handleError(_0x516daf,null));}else{return _0x516daf[_0x6ca6('0x6')](0x1f4)[_0x6ca6('0xb')]({'message':_0x6ca6('0x25')});}};exports[_0x6ca6('0x26')]=function(_0x484411,_0x28af50){if(_0x484411[_0x6ca6('0x19')]['id']){delete _0x484411[_0x6ca6('0x19')]['id'];}if(_0x484411[_0x6ca6('0x17')]['id']){return pm2['delete'](_0x484411[_0x6ca6('0x17')]['id'])[_0x6ca6('0x10')](function(_0x3c4af8){pm2[_0x6ca6('0x20')]();return _0x3c4af8[0x0];})['then'](respondWithResult(_0x28af50,null))['catch'](handleError(_0x28af50,null));}else{return _0x28af50['status'](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xe706=['dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','index','express','motion2','then','catch','params','create','body','script','join','../../files/plugins','cwd'];(function(_0x50f743,_0x26d5df){var _0xedbecf=function(_0x21f088){while(--_0x21f088){_0x50f743['push'](_0x50f743['shift']());}};_0xedbecf(++_0x26d5df);}(_0xe706,0xa3));var _0x6e70=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0xe706[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0x6e70('0x0'));var pm2=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var path=require(_0x6e70('0x3'));var exec=require(_0x6e70('0x4'))[_0x6e70('0x5')];var BPromise=require(_0x6e70('0x6'));function handleEntityNotFound(_0x142c27,_0x2164a4){return function(_0x376a8d){if(!_0x376a8d){_0x142c27[_0x6e70('0x7')](0x194);;}return _0x376a8d;};}function respondWithResult(_0x1b0389,_0x4381d1){_0x4381d1=_0x4381d1||0xc8;return function(_0x36357b){if(_0x36357b){return _0x1b0389[_0x6e70('0x8')](_0x4381d1)[_0x6e70('0x9')](_0x36357b);}return null;};}function handleError(_0x188ed3,_0x3c4843){_0x3c4843=_0x3c4843||0x1f4;return function(_0x449b48){logger[_0x6e70('0xa')](_0x449b48[_0x6e70('0xb')]);if(_0x449b48[_0x6e70('0xc')]){delete _0x449b48[_0x6e70('0xc')];}_0x188ed3[_0x6e70('0x8')](_0x3c4843)[_0x6e70('0xd')](_0x449b48);};}function execChildProcess(){return new BPromise(function(_0x37b3e0,_0x4600f9){exec('npm\x20install',function(_0x47f6b2,_0x3594c1,_0x15a1a5){logger[_0x6e70('0xe')](_0x3594c1);logger[_0x6e70('0xe')](_0x15a1a5);if(_0x47f6b2){logger[_0x6e70('0xa')](_0x47f6b2);return _0x4600f9(_0x47f6b2);}return _0x37b3e0(_0x3594c1);});});}exports[_0x6e70('0xf')]=function(_0xa1eb74,_0x181005){return pm2['list']()['then'](function(_0x48bc72){if(_0x48bc72){var _0x257e81=_['reject'](_0x48bc72,function(_0x53aed0){return _0x53aed0[_0x6e70('0xc')]===_0x6e70('0x10')||_0x53aed0['name']===_0x6e70('0x11');});return{'rows':_0x257e81,'count':_0x257e81['length']};}return null;})[_0x6e70('0x12')](respondWithResult(_0x181005,null))[_0x6e70('0x13')](handleError(_0x181005,null));};exports['show']=function(_0x49029f,_0x3bd572){return pm2['describe'](_0x49029f[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](respondWithResult(_0x3bd572,null))['then'](handleEntityNotFound(_0x3bd572,null))['catch'](handleError(_0x3bd572,null));};exports[_0x6e70('0x15')]=function(_0x208e21,_0x2368eb){if(_0x208e21[_0x6e70('0x16')][_0x6e70('0xc')]&&_0x208e21[_0x6e70('0x16')][_0x6e70('0x17')]){var _0x44a49f=path[_0x6e70('0x18')](__dirname,_0x6e70('0x19'),_0x208e21['body'][_0x6e70('0x17')]);var _0x344b65=process[_0x6e70('0x1a')]();process['chdir'](path[_0x6e70('0x1b')](_0x44a49f));return execChildProcess()[_0x6e70('0x12')](function(_0x3337a6){process['chdir'](_0x344b65);return pm2[_0x6e70('0x1c')]({'name':_0x208e21['body']['name'],'script':_0x44a49f});})['then'](function(_0x41e352){pm2[_0x6e70('0x1d')]();return _0x41e352[0x0];})['then'](respondWithResult(_0x2368eb,0xc9))[_0x6e70('0x13')](handleError(_0x2368eb,null));}else{return _0x2368eb[_0x6e70('0x8')](0x1f4)['send']({'message':_0x6e70('0x1e')});}};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){if(_0x2bb231['body']['id']){delete _0x2bb231[_0x6e70('0x16')]['id'];}var _0x3af17f={'online':_0x6e70('0x20'),'stopped':_0x6e70('0x21')};if(_0x3af17f[_0x6e70('0x22')](_0x2bb231['body'][_0x6e70('0x8')])){return pm2[_0x3af17f[_0x2bb231[_0x6e70('0x16')][_0x6e70('0x8')]]](_0x2bb231[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](respondWithResult(_0x4a67ac,0xc8))[_0x6e70('0x13')](handleError(_0x4a67ac,null));}else{return _0x4a67ac[_0x6e70('0x8')](0x1f4)[_0x6e70('0xd')]({'message':_0x6e70('0x23')});}};exports[_0x6e70('0x24')]=function(_0x4b1229,_0x1b27d8){if(_0x4b1229['body']['id']){delete _0x4b1229[_0x6e70('0x16')]['id'];}if(_0x4b1229['params']['id']){return pm2[_0x6e70('0x25')](_0x4b1229[_0x6e70('0x14')]['id'])[_0x6e70('0x12')](function(_0x56f6f7){pm2[_0x6e70('0x1d')]();return _0x56f6f7[0x0];})[_0x6e70('0x12')](respondWithResult(_0x1b27d8,null))['catch'](handleError(_0x1b27d8,null));}else{return _0x1b27d8[_0x6e70('0x8')](0x1f4)[_0x6e70('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index a85865f..4a0c61a 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 _0x2aec=['isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents'];(function(_0x126d6e,_0x455ea2){var _0x3825dd=function(_0x121ec0){while(--_0x121ec0){_0x126d6e['push'](_0x126d6e['shift']());}};_0x3825dd(++_0x455ea2);}(_0x2aec,0x9f));var _0xc2ae=function(_0x283bfd,_0x1c8a3e){_0x283bfd=_0x283bfd-0x0;var _0x2222c6=_0x2aec[_0x283bfd];return _0x2222c6;};'use strict';var express=require(_0xc2ae('0x0'));var router=express[_0xc2ae('0x1')]();var auth=require(_0xc2ae('0x2'));var controller=require(_0xc2ae('0x3'));router[_0xc2ae('0x4')](_0xc2ae('0x5'),auth[_0xc2ae('0x6')](),controller[_0xc2ae('0x7')]);router[_0xc2ae('0x4')](_0xc2ae('0x8'),auth[_0xc2ae('0x6')](),controller[_0xc2ae('0x9')]);module[_0xc2ae('0xa')]=router; \ No newline at end of file +var _0xa34d=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','Router'];(function(_0x55e677,_0x4a1157){var _0x5d0798=function(_0x65a609){while(--_0x65a609){_0x55e677['push'](_0x55e677['shift']());}};_0x5d0798(++_0x4a1157);}(_0xa34d,0xa9));var _0xda34=function(_0x111758,_0x2d25ff){_0x111758=_0x111758-0x0;var _0x44c8b5=_0xa34d[_0x111758];return _0x44c8b5;};'use strict';var express=require('express');var router=express[_0xda34('0x0')]();var auth=require(_0xda34('0x1'));var controller=require(_0xda34('0x2'));router[_0xda34('0x3')](_0xda34('0x4'),auth[_0xda34('0x5')](),controller[_0xda34('0x6')]);router[_0xda34('0x3')](_0xda34('0x7'),auth[_0xda34('0x5')](),controller[_0xda34('0x8')]);module[_0xda34('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 5cfbfa9..4c0e2cf 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 _0xcaa7=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','busy','find','pick','filter','queue','length','some','internal','toString','UserId','accountcode','online','voiceStatus','loggedInDb','User','Pause','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','mailPause','smsPause','voicePause','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','userpic','lastPauseAt','pauseType','chatPause','openchannelPause','whatsappPause','faxPause','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','resolve','rawAttributes','fieldName','type','query','role','agent','raw','user','userProfileId','nolimit','sort','UserProfile','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','whatsapp','channel','Invalid\x20channel','toLowerCase','Queue','key','getOptions','QueueCampaigns','getResources','all','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','offset','limit','undefined','count','set','Content-Range','json','stack','name','status','send','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','merge','voice','startCase','Queues','format'];(function(_0x55c574,_0x5271aa){var _0x53978b=function(_0x507be3){while(--_0x507be3){_0x55c574['push'](_0x55c574['shift']());}};_0x53978b(++_0x5271aa);}(_0xcaa7,0x1a5));var _0x7caa=function(_0x533a05,_0x353d89){_0x533a05=_0x533a05-0x0;var _0x3a1c1a=_0xcaa7[_0x533a05];return _0x3a1c1a;};'use strict';var util=require(_0x7caa('0x0'));var _=require(_0x7caa('0x1'));var jayson=require('jayson/promise');var qs=require(_0x7caa('0x2'));var logger=require(_0x7caa('0x3'))(_0x7caa('0x4'));var db=require(_0x7caa('0x5'))['db'];var amiClient=jayson['client'][_0x7caa('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x7caa('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x828576,_0x3900ae){return function(_0x6ab9f3){if(_0x6ab9f3){var _0x260c8a=typeof _0x3900ae[_0x7caa('0x7')]==='undefined'&&typeof _0x3900ae[_0x7caa('0x8')]===_0x7caa('0x9');var _0x166914=_0x6ab9f3[_0x7caa('0xa')];var _0x13e90a=_0x260c8a?0x0:_0x3900ae[_0x7caa('0x7')];var _0x5c03e1=_0x260c8a?_0x6ab9f3[_0x7caa('0xa')]:_0x3900ae[_0x7caa('0x7')]+_0x3900ae['limit'];var _0x28e9a5;if(_0x5c03e1>=_0x166914){_0x5c03e1=_0x166914;_0x28e9a5=0xc8;}else{_0x28e9a5=0xce;}_0x828576['status'](_0x28e9a5);return _0x828576[_0x7caa('0xb')](_0x7caa('0xc'),_0x13e90a+'-'+_0x5c03e1+'/'+_0x166914)[_0x7caa('0xd')](_0x6ab9f3);}return null;};}function handleError(_0x4ee311,_0x353d63){_0x353d63=_0x353d63||0x1f4;return function(_0xa845c2){logger['error'](_0xa845c2[_0x7caa('0xe')]);if(_0xa845c2['name']){delete _0xa845c2[_0x7caa('0xf')];}_0x4ee311[_0x7caa('0x10')](_0x353d63)[_0x7caa('0x11')](_0xa845c2);};}function getRealtimeAgents(){return new Promise(function(_0x1ef716,_0x2ad617){return amiClient[_0x7caa('0x12')](_0x7caa('0x13'),{})['then'](function(_0x2b184d){if(_0x2b184d[_0x7caa('0x14')])throw new Error(_0x7caa('0x15'));var _0x13bac1=_0x2b184d[_0x7caa('0x16')];return routingClient['request'](_0x7caa('0x13'),{})[_0x7caa('0x17')](function(_0x4ab6ca){if(_0x4ab6ca['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x3e2fb5=_0x4ab6ca[_0x7caa('0x16')];return _0x1ef716(_[_0x7caa('0x18')]({},_0x13bac1,_0x3e2fb5));});})['catch'](function(_0x186bec){_0x2ad617(_0x186bec);});});}function getRealtimeQueues(_0x45eadc,_0x20fbeb){return new Promise(function(_0x174bc5,_0xe2b377){var _0x5d4b02=_0x20fbeb===_0x7caa('0x19')?amiClient:routingClient;return _0x5d4b02[_0x7caa('0x12')](_[_0x7caa('0x1a')](_0x20fbeb)+_0x7caa('0x1b'),_0x45eadc)[_0x7caa('0x17')](function(_0x4ae2d3){if(_0x4ae2d3[_0x7caa('0x14')])throw new Error(util[_0x7caa('0x1c')](_0x7caa('0x1d'),_0x20fbeb));return _0x174bc5(_0x4ae2d3[_0x7caa('0x16')]);})[_0x7caa('0x1e')](function(_0x4a4a8a){_0xe2b377(_0x4a4a8a);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2a83a5,_0x2912d2){return amiClient['request'](_0x7caa('0x1f'),{})[_0x7caa('0x17')](function(_0x1455a3){if(_0x1455a3['error'])throw new Error(_0x7caa('0x20'));return _0x2a83a5(_0x1455a3['result']);})[_0x7caa('0x1e')](function(_0x1aa4fe){_0x2912d2(_0x1aa4fe);});});}function initializeQueues(_0x544fb6,_0x559065,_0x16d73e,_0xeca9d5){var _0x350d69=[_0x7caa('0x21'),_0x7caa('0x22'),_0x7caa('0x23'),_0x7caa('0x24'),_0x7caa('0x25')];if(_0x16d73e===_0x7caa('0x19')&&_0xeca9d5===_0x7caa('0x26')){_0x350d69[_0x7caa('0x27')](_0x7caa('0x28'),_0x7caa('0x29'),_0x7caa('0x2a'),_0x7caa('0x2b'),_0x7caa('0x2c'),'Trunk','startPredictive',_0x7caa('0x2d'),_0x7caa('0x2e'),'erlangCallToSecond',_0x7caa('0x2f'),_0x7caa('0x30'),_0x7caa('0x31'),_0x7caa('0x32'),'dialPredictiveIntervalMinThreshold',_0x7caa('0x33'),_0x7caa('0x34'),_0x7caa('0x35'),_0x7caa('0x36'),_0x7caa('0x37'),_0x7caa('0x38'),'predictiveIntervalAvgTalktime');}return _0x544fb6[_0x7caa('0x39')](function(_0x285b1c){var _0xc6685=_0x285b1c[_0x7caa('0x3a')]({'plain':!![]});_0xc6685[_0x7caa('0x3b')]=[];_0xc6685[_0x7caa('0x25')]=0x0;_0xc6685['loggedInDb']=0x0;_0xc6685[_0x7caa('0x21')]=0x0;_0xc6685[_0x7caa('0x22')]=0x0;_0xc6685[_0x7caa('0x23')]=0x0;if(_0x16d73e===_0x7caa('0x19')){_0xc6685[_0x7caa('0x24')]=0x0;_0xc6685[_0x7caa('0x3c')]=0x0;if(_0xeca9d5===_0x7caa('0x26')){_0xc6685['pTalking']=0x0;_0xc6685[_0x7caa('0x29')]=0x0;}}var _0x44703b=_[_0x7caa('0x3d')](_0x559065,['id',_0xc6685['id']]);if(_0x44703b)_[_0x7caa('0x18')](_0xc6685,_[_0x7caa('0x3e')](_0x44703b,_0x350d69));return _0xc6685;});}function updateAgentVoiceStatus(_0x330a16,_0x284b0d,_0x1afba0){var _0x4c3709=_[_0x7caa('0x3f')](_0x1afba0,[_0x7caa('0x40'),_0x284b0d[_0x7caa('0xf')]]);if(_0x4c3709[_0x7caa('0x41')]===0x0)return _0x330a16[_0x7caa('0x3c')]=!![];if(_[_0x7caa('0x42')](_0x4c3709,['connectedlinenum',_0x330a16[_0x7caa('0x43')][_0x7caa('0x44')]()]))return _0x330a16[_0x7caa('0x24')]=!![];if(!_0x330a16[_0x7caa('0x24')])return _0x330a16[_0x7caa('0x3c')]=!![];}function getVoiceQueueAgents(_0x4e5d5a,_0x1547f6,_0xa1b72e,_0xeaf082){var _0x481732=_[_0x7caa('0x3d')](_0x1547f6,['id',_0x4e5d5a['id']]);if(!_0x481732)return _0x4e5d5a;return _0x481732['getMembers']({'raw':!![]})[_0x7caa('0x17')](function(_0x11fa1a){for(var _0x5d5cd5=0x0;_0x5d5cd5<_0x11fa1a[_0x7caa('0x41')];_0x5d5cd5++){var _0x951c44=_[_0x7caa('0x3d')](_0xa1b72e,['id',_0x11fa1a[_0x5d5cd5]['UserId']]);if(!_0x951c44){_0x951c44={'id':_0x11fa1a[_0x5d5cd5][_0x7caa('0x45')],'name':_0x11fa1a[_0x5d5cd5]['UserId'],'accountcode':'','online':![]};}var _0x4a8113={'id':_0x951c44['id'],'name':_0x951c44[_0x7caa('0xf')],'internal':_0x951c44[_0x7caa('0x46')],'online':Boolean(_0x951c44[_0x7caa('0x47')]),'paused':Boolean(_0x11fa1a[_0x5d5cd5][_0x7caa('0x25')])};if(_0x951c44[_0x7caa('0x48')]===_0x7caa('0x24'))updateAgentVoiceStatus(_0x4a8113,_0x4e5d5a,_0xeaf082);if(_0x4a8113[_0x7caa('0x47')])_0x4e5d5a[_0x7caa('0x49')]++;if(_0x4a8113['busy'])_0x4e5d5a[_0x7caa('0x3c')]++;if(_0x4a8113['paused']&&!_0x4a8113[_0x7caa('0x3c')]&&!_0x4a8113[_0x7caa('0x24')])_0x4e5d5a[_0x7caa('0x25')]++;_0x4e5d5a[_0x7caa('0x3b')][_0x7caa('0x27')](_0x4a8113);}return _0x4e5d5a;});}function getQueueAgents(_0x336cf7,_0x2521ec,_0x56db20){var _0x20fce1=_0x7caa('0x4a')+_[_0x7caa('0x1a')](_0x56db20)+'Queue';var _0x1cbd6f=_0x56db20+_0x7caa('0x4b');return db[_0x20fce1][_0x7caa('0x4c')]({'where':{[_[_0x7caa('0x1a')](_0x56db20)+_0x7caa('0x4d')]:_0x336cf7['id']},'raw':!![]})['then'](function(_0xf97540){for(var _0x2d37ad=0x0;_0x2d37ad<_0xf97540['length'];_0x2d37ad++){var _0x189f67=_[_0x7caa('0x3d')](_0x2521ec,['id',_0xf97540[_0x2d37ad]['UserId']]);if(!_0x189f67){_0x189f67={'id':_0xf97540[_0x2d37ad][_0x7caa('0x45')],'name':_0xf97540[_0x2d37ad]['UserId'],'online':![],['pauseField']:![]};}var _0x20e620={'id':_0x189f67['id'],'name':_0x189f67[_0x7caa('0xf')],'online':Boolean(_0x189f67[_0x7caa('0x47')]),'paused':Boolean(_0x189f67[_0x1cbd6f])};if(_0x20e620[_0x7caa('0x47')])_0x336cf7[_0x7caa('0x49')]++;_0x336cf7['agents'][_0x7caa('0x27')](_0x20e620);}return _0x336cf7;});}function isIdle(_0x258fab){return _0x258fab===_0x7caa('0x4e')||_0x258fab===_0x7caa('0x4f')||_0x258fab===_0x7caa('0x50')||_0x258fab===_0x7caa('0x51')||_[_0x7caa('0x52')](_0x258fab);}function isAgentPaused(_0x4a337a,_0x2075fe){var _0x537279=[_0x4a337a['chatPause'],_0x4a337a['faxPause'],_0x4a337a[_0x7caa('0x53')],_0x4a337a['openchannelPause'],_0x4a337a[_0x7caa('0x54')],_0x4a337a['voicePause'],_0x4a337a['whatsappPause']];if(!_0x2075fe)return _['every'](_0x537279);var _0x523f39=_[_0x7caa('0x3f')](_0x537279);return _0x523f39[_0x7caa('0x41')]>0x0&&_0x523f39[_0x7caa('0x41')]<_0x537279['length']?!![]:![];}function isAgentIdle(_0x9fa8cd){if(_0x9fa8cd[_0x7caa('0x48')]!=='idle'&&_0x9fa8cd[_0x7caa('0x55')]){_0x9fa8cd[_0x7caa('0x48')]=_0x7caa('0x56');return![];}return _[_0x7caa('0x57')]([_0x9fa8cd[_0x7caa('0x58')],_0x9fa8cd[_0x7caa('0x59')],_0x9fa8cd[_0x7caa('0x5a')],_0x9fa8cd[_0x7caa('0x5b')],_0x9fa8cd[_0x7caa('0x5c')],_0x9fa8cd[_0x7caa('0x48')],_0x9fa8cd[_0x7caa('0x5d')]],isIdle);}function getAgentStatus(_0x2ad83b){var _0x3c6d5f=_0x7caa('0x4f');if(isAgentPaused(_0x2ad83b))_0x3c6d5f=_0x7caa('0x56');else if(isAgentPaused(_0x2ad83b,!![]))_0x3c6d5f=_0x7caa('0x5e');else if(isAgentIdle(_0x2ad83b))_0x3c6d5f=_0x7caa('0x4e');else _0x3c6d5f='busy';return _0x3c6d5f;}exports['getAgents']=function(_0x327526,_0x1c58de){var _0x50e4ac={'count':0x0,'rows':[]},_0x366186={},_0x5196db,_0x3f14e1,_0x40e5f1=[_0x7caa('0x5f'),_0x7caa('0x47'),'lastLoginAt',_0x7caa('0x60'),_0x7caa('0x61'),_0x7caa('0x60'),'internal','address',_0x7caa('0x62'),_0x7caa('0x63'),_0x7caa('0x53'),'smsPause',_0x7caa('0x64'),_0x7caa('0x65'),_0x7caa('0x55'),'chatCapacity',_0x7caa('0x66'),_0x7caa('0x67'),'smsCapacity',_0x7caa('0x68'),_0x7caa('0x69'),_0x7caa('0x6a'),_0x7caa('0x6b'),'mailCurrentCapacity',_0x7caa('0x6c'),_0x7caa('0x6d'),'faxCurrentCapacity',_0x7caa('0x58'),_0x7caa('0x5b'),_0x7caa('0x5a'),_0x7caa('0x5c'),_0x7caa('0x5d'),_0x7caa('0x59'),_0x7caa('0x48'),_0x7caa('0x6e'),'openchannelStatusTime',_0x7caa('0x6f'),'smsStatusTime',_0x7caa('0x70'),_0x7caa('0x71'),_0x7caa('0x72'),_0x7caa('0x40'),_0x7caa('0x73'),_0x7caa('0x74'),_0x7caa('0x75'),'phoneBarEnableAutomaticScreenRecording','routealias'],_0x31f00f=[_0x7caa('0x62'),_0x7caa('0x63'),_0x7caa('0x53'),'smsPause',_0x7caa('0x64'),'faxPause',_0x7caa('0x55'),_0x7caa('0x47')];Promise[_0x7caa('0x76')]()['then'](function(){var _0x4d26a1=_[_0x7caa('0x39')](db[_0x7caa('0x4a')][_0x7caa('0x77')],function(_0x56a068){return{'name':_0x56a068[_0x7caa('0x78')],'type':_0x56a068[_0x7caa('0x79')]['key']};});_0x327526[_0x7caa('0x7a')][_0x7caa('0x7b')]=_0x7caa('0x7c');_0x327526[_0x7caa('0x7a')][_0x7caa('0x47')]=!![];_0x366186=qs['getOptions'](_0x4d26a1,_0x327526);_0x366186[_0x7caa('0x7d')]=!![];if(_0x327526[_0x7caa('0x7e')][_0x7caa('0x7b')]===_0x7caa('0x7e')){var _0x438c26={'params':{'id':_0x327526[_0x7caa('0x7e')][_0x7caa('0x7f')]},'query':{'section':_0x7caa('0x13'),'role':_0x7caa('0x7c'),'online':!![],'nolimit':_0x327526['query'][_0x7caa('0x80')],'sort':_0x327526[_0x7caa('0x7a')][_0x7caa('0x81')],'filter':_0x327526[_0x7caa('0x7a')]['filter']},'raw':!![]};return db[_0x7caa('0x82')]['getResources'](_0x438c26);}return db[_0x7caa('0x4a')]['findAndCountAll'](_0x366186);})[_0x7caa('0x17')](function(_0x129246){_0x50e4ac[_0x7caa('0xa')]=_0x129246[_0x7caa('0xa')];_0x5196db=_0x129246[_0x7caa('0x83')];return getRealtimeAgents();})[_0x7caa('0x17')](function(_0x21efaa){_0x3f14e1=_0x21efaa['rows'];return _0x5196db[_0x7caa('0x39')](function(_0x31414a){var _0xdbeed0=_[_0x7caa('0x3d')](_0x3f14e1,['id',_0x31414a['id']]);if(_0xdbeed0)_[_0x7caa('0x18')](_0x31414a,_[_0x7caa('0x3e')](_[_0x7caa('0x84')](_0xdbeed0,_0x31f00f),_0x40e5f1));_0x31414a[_0x7caa('0x85')]=getAgentStatus(_0x31414a);return _0x31414a;});})['then'](function(_0x5bd3ea){if(_0x327526[_0x7caa('0x7a')][_0x7caa('0x86')]){var _0x96968b=_['filter'](_0x5bd3ea,[_0x7caa('0x85'),_0x327526[_0x7caa('0x7a')][_0x7caa('0x86')]]);if(_0x327526[_0x7caa('0x7a')][_0x7caa('0x87')]){_0x96968b=_[_0x7caa('0x3f')](_0x96968b,['pauseType',_0x327526[_0x7caa('0x7a')][_0x7caa('0x87')]]);}}_0x50e4ac[_0x7caa('0x83')]=_0x96968b||_0x5bd3ea;return _0x50e4ac;})['then'](respondWithFilteredResult(_0x1c58de,_0x366186))[_0x7caa('0x1e')](handleError(_0x1c58de,null));};exports[_0x7caa('0x88')]=function(_0x5718a6,_0x843d5d){var _0x3097e6=[_0x7caa('0x89'),_0x7caa('0x8a'),_0x7caa('0x8b'),'openchannel','fax',_0x7caa('0x8c'),'voice'];var _0x3e46f6={'count':0x0,'rows':[]},_0x151ac6={},_0x2cac9e,_0x2c898a,_0x32e2b3,_0x1e0ba9,_0x176601;Promise[_0x7caa('0x76')]()[_0x7caa('0x17')](function(){if(_0x5718a6[_0x7caa('0x7a')][_0x7caa('0x8d')]){if(!_['includes'](_0x3097e6,_0x5718a6['query'][_0x7caa('0x8d')]['toLowerCase']()))throw new Error(_0x7caa('0x8e'));_0x2cac9e=_0x5718a6[_0x7caa('0x7a')][_0x7caa('0x8d')][_0x7caa('0x8f')]();}var _0x476270=_[_0x7caa('0x1a')](_0x2cac9e)+_0x7caa('0x90');var _0x28b232=_[_0x7caa('0x39')](db[_0x476270][_0x7caa('0x77')],function(_0x161d25){return{'name':_0x161d25['fieldName'],'type':_0x161d25[_0x7caa('0x79')][_0x7caa('0x91')]};});_0x151ac6=qs[_0x7caa('0x92')](_0x28b232,_0x5718a6);if(_0x5718a6[_0x7caa('0x7e')][_0x7caa('0x7b')]===_0x7caa('0x7e')){var _0x21316a={'params':{'id':_0x5718a6[_0x7caa('0x7e')][_0x7caa('0x7f')]},'query':{'section':_0x2cac9e===_0x7caa('0x19')&&_0x5718a6[_0x7caa('0x7a')][_0x7caa('0x79')]==='outbound'?_0x7caa('0x93'):_[_0x7caa('0x1a')](_0x2cac9e)+_0x7caa('0x1b'),'type':_0x5718a6[_0x7caa('0x7a')][_0x7caa('0x79')],'nolimit':!![],'sort':_0x7caa('0xf'),'filter':_0x5718a6[_0x7caa('0x7a')][_0x7caa('0x3f')]}};return db[_0x7caa('0x82')][_0x7caa('0x94')](_0x21316a);}return db[_0x476270]['findAndCountAll'](_0x151ac6);})[_0x7caa('0x17')](function(_0x4477a4){_0x3e46f6['count']=_0x4477a4[_0x7caa('0xa')];_0x2c898a=_0x4477a4[_0x7caa('0x83')];return getRealtimeQueues(_0x5718a6,_0x2cac9e);})[_0x7caa('0x17')](function(_0x21aaa0){_0x1e0ba9=_0x21aaa0[_0x7caa('0x83')];return getRealtimeAgents();})[_0x7caa('0x17')](function(_0x33eae0){_0x32e2b3=_0x33eae0[_0x7caa('0x83')];if(_0x2cac9e!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x7caa('0x17')](function(_0x5799cb){_0x176601=_0x5799cb?_0x5799cb[_0x7caa('0x83')]:[];return initializeQueues(_0x2c898a,_0x1e0ba9,_0x2cac9e,_0x5718a6[_0x7caa('0x7a')]['type']);})[_0x7caa('0x17')](function(_0x1609e6){var _0x30a3ca=_0x1609e6[_0x7caa('0x39')](function(_0x80db4c){if(_0x2cac9e==='voice')return getVoiceQueueAgents(_0x80db4c,_0x2c898a,_0x32e2b3,_0x176601);else return getQueueAgents(_0x80db4c,_0x32e2b3,_0x2cac9e);});return Promise[_0x7caa('0x95')](_0x30a3ca);})['then'](function(_0x343696){_0x3e46f6[_0x7caa('0x83')]=_0x343696;return _0x3e46f6;})[_0x7caa('0x17')](respondWithFilteredResult(_0x843d5d,_0x151ac6))['catch'](handleError(_0x843d5d,null));}; \ No newline at end of file +var _0x3ec1=['query','agent','getOptions','user','role','userProfileId','sort','filter','UserProfile','getResources','rows','omit','globalStatus','pauseTypeFilter','mail','openchannel','fax','whatsapp','channel','includes','toLowerCase','Invalid\x20channel','Queue','fieldName','key','QueueCampaigns','findAndCountAll','util','lodash','jayson/promise','../../components/parsers/qs','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','paused','loggedIn','busy','outbound','find','pick','queue','length','some','connectedlinenum','internal','toString','UserId','accountcode','online','push','User','Pause','findAll','QueueId','loggedInDb','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','voicePause','voiceStatus','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','getAgents','userpic','lastPauseAt','pauseType','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatus','mailStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','map','rawAttributes','type'];(function(_0x486f1d,_0x90c2b5){var _0x5a2c2d=function(_0x1a5f79){while(--_0x1a5f79){_0x486f1d['push'](_0x486f1d['shift']());}};_0x5a2c2d(++_0x90c2b5);}(_0x3ec1,0x153));var _0x13ec=function(_0x3b3486,_0x5bd71){_0x3b3486=_0x3b3486-0x0;var _0x5db197=_0x3ec1[_0x3b3486];return _0x5db197;};'use strict';var util=require(_0x13ec('0x0'));var _=require(_0x13ec('0x1'));var jayson=require(_0x13ec('0x2'));var qs=require(_0x13ec('0x3'));var logger=require('../../config/logger')(_0x13ec('0x4'));var db=require(_0x13ec('0x5'))['db'];var amiClient=jayson[_0x13ec('0x6')][_0x13ec('0x7')]({'port':0x232a});var routingClient=jayson[_0x13ec('0x6')][_0x13ec('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x5d3a09,_0xe25bef){return function(_0x51021a){if(_0x51021a){var _0x2bebbb=typeof _0xe25bef[_0x13ec('0x8')]===_0x13ec('0x9')&&typeof _0xe25bef[_0x13ec('0xa')]===_0x13ec('0x9');var _0x545398=_0x51021a[_0x13ec('0xb')];var _0x43a376=_0x2bebbb?0x0:_0xe25bef['offset'];var _0x5754ba=_0x2bebbb?_0x51021a[_0x13ec('0xb')]:_0xe25bef[_0x13ec('0x8')]+_0xe25bef[_0x13ec('0xa')];var _0x4f9e47;if(_0x5754ba>=_0x545398){_0x5754ba=_0x545398;_0x4f9e47=0xc8;}else{_0x4f9e47=0xce;}_0x5d3a09[_0x13ec('0xc')](_0x4f9e47);return _0x5d3a09[_0x13ec('0xd')](_0x13ec('0xe'),_0x43a376+'-'+_0x5754ba+'/'+_0x545398)[_0x13ec('0xf')](_0x51021a);}return null;};}function handleError(_0x42e7ec,_0x5689c4){_0x5689c4=_0x5689c4||0x1f4;return function(_0x4eea39){logger[_0x13ec('0x10')](_0x4eea39[_0x13ec('0x11')]);if(_0x4eea39[_0x13ec('0x12')]){delete _0x4eea39[_0x13ec('0x12')];}_0x42e7ec[_0x13ec('0xc')](_0x5689c4)['send'](_0x4eea39);};}function getRealtimeAgents(){return new Promise(function(_0x409237,_0x4b0b9b){return amiClient[_0x13ec('0x13')](_0x13ec('0x14'),{})[_0x13ec('0x15')](function(_0xa53ef){if(_0xa53ef['error'])throw new Error(_0x13ec('0x16'));var _0x31d58d=_0xa53ef[_0x13ec('0x17')];return routingClient[_0x13ec('0x13')](_0x13ec('0x14'),{})[_0x13ec('0x15')](function(_0x4f540f){if(_0x4f540f[_0x13ec('0x10')])throw new Error(_0x13ec('0x18'));var _0xb91799=_0x4f540f['result'];return _0x409237(_[_0x13ec('0x19')]({},_0x31d58d,_0xb91799));});})['catch'](function(_0x8a5446){_0x4b0b9b(_0x8a5446);});});}function getRealtimeQueues(_0x2b5377,_0x1d50bb){return new Promise(function(_0x3e3761,_0x19c611){var _0x8dd815=_0x1d50bb===_0x13ec('0x1a')?amiClient:routingClient;return _0x8dd815[_0x13ec('0x13')](_[_0x13ec('0x1b')](_0x1d50bb)+_0x13ec('0x1c'),_0x2b5377)[_0x13ec('0x15')](function(_0x3e1782){if(_0x3e1782[_0x13ec('0x10')])throw new Error(util[_0x13ec('0x1d')](_0x13ec('0x1e'),_0x1d50bb));return _0x3e3761(_0x3e1782['result']);})[_0x13ec('0x1f')](function(_0x281a7f){_0x19c611(_0x281a7f);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x98f710,_0x5b08b8){return amiClient[_0x13ec('0x13')](_0x13ec('0x20'),{})[_0x13ec('0x15')](function(_0x56fdfd){if(_0x56fdfd['error'])throw new Error(_0x13ec('0x21'));return _0x98f710(_0x56fdfd[_0x13ec('0x17')]);})[_0x13ec('0x1f')](function(_0xe7af82){_0x5b08b8(_0xe7af82);});});}function initializeQueues(_0x5330d7,_0x273903,_0x1eeeaa,_0x5683b5){var _0x3c0b6e=['loggedIn',_0x13ec('0x22'),_0x13ec('0x23'),_0x13ec('0x24'),'paused'];if(_0x1eeeaa===_0x13ec('0x1a')&&_0x5683b5==='outbound'){_0x3c0b6e['push'](_0x13ec('0x25'),_0x13ec('0x26'),_0x13ec('0x27'),_0x13ec('0x28'),_0x13ec('0x29'),_0x13ec('0x2a'),_0x13ec('0x2b'),'startProgressive',_0x13ec('0x2c'),_0x13ec('0x2d'),_0x13ec('0x2e'),_0x13ec('0x2f'),_0x13ec('0x30'),_0x13ec('0x31'),_0x13ec('0x32'),_0x13ec('0x33'),_0x13ec('0x34'),_0x13ec('0x35'),'predictiveIntervalDroppedCallsTimeout',_0x13ec('0x36'),_0x13ec('0x37'),_0x13ec('0x38'));}return _0x5330d7['map'](function(_0x4860a1){var _0x20e7a4=_0x4860a1[_0x13ec('0x39')]({'plain':!![]});_0x20e7a4[_0x13ec('0x3a')]=[];_0x20e7a4[_0x13ec('0x3b')]=0x0;_0x20e7a4['loggedInDb']=0x0;_0x20e7a4[_0x13ec('0x3c')]=0x0;_0x20e7a4[_0x13ec('0x22')]=0x0;_0x20e7a4[_0x13ec('0x23')]=0x0;if(_0x1eeeaa===_0x13ec('0x1a')){_0x20e7a4[_0x13ec('0x24')]=0x0;_0x20e7a4[_0x13ec('0x3d')]=0x0;if(_0x5683b5===_0x13ec('0x3e')){_0x20e7a4[_0x13ec('0x25')]=0x0;_0x20e7a4['originated']=0x0;}}var _0x59f607=_[_0x13ec('0x3f')](_0x273903,['id',_0x20e7a4['id']]);if(_0x59f607)_['merge'](_0x20e7a4,_[_0x13ec('0x40')](_0x59f607,_0x3c0b6e));return _0x20e7a4;});}function updateAgentVoiceStatus(_0x599bba,_0x3aa061,_0x4f8f7a){var _0x1d11c7=_['filter'](_0x4f8f7a,[_0x13ec('0x41'),_0x3aa061[_0x13ec('0x12')]]);if(_0x1d11c7[_0x13ec('0x42')]===0x0)return _0x599bba['busy']=!![];if(_[_0x13ec('0x43')](_0x1d11c7,[_0x13ec('0x44'),_0x599bba[_0x13ec('0x45')][_0x13ec('0x46')]()]))return _0x599bba[_0x13ec('0x24')]=!![];if(!_0x599bba[_0x13ec('0x24')])return _0x599bba[_0x13ec('0x3d')]=!![];}function getVoiceQueueAgents(_0x39f8f2,_0x518f1b,_0x4bea80,_0x5d5119){var _0x5dd035=_[_0x13ec('0x3f')](_0x518f1b,['id',_0x39f8f2['id']]);if(!_0x5dd035)return _0x39f8f2;return _0x5dd035['getMembers']({'raw':!![]})['then'](function(_0x1564f6){for(var _0x169930=0x0;_0x169930<_0x1564f6[_0x13ec('0x42')];_0x169930++){var _0x269851=_[_0x13ec('0x3f')](_0x4bea80,['id',_0x1564f6[_0x169930]['UserId']]);if(!_0x269851){_0x269851={'id':_0x1564f6[_0x169930][_0x13ec('0x47')],'name':_0x1564f6[_0x169930][_0x13ec('0x47')],'accountcode':'','online':![]};}var _0x5b33c4={'id':_0x269851['id'],'name':_0x269851[_0x13ec('0x12')],'internal':_0x269851[_0x13ec('0x48')],'online':Boolean(_0x269851[_0x13ec('0x49')]),'paused':Boolean(_0x1564f6[_0x169930][_0x13ec('0x3b')])};if(_0x269851['voiceStatus']==='talking')updateAgentVoiceStatus(_0x5b33c4,_0x39f8f2,_0x5d5119);if(_0x5b33c4['online'])_0x39f8f2['loggedInDb']++;if(_0x5b33c4[_0x13ec('0x3d')])_0x39f8f2['busy']++;if(_0x5b33c4[_0x13ec('0x3b')]&&!_0x5b33c4[_0x13ec('0x3d')]&&!_0x5b33c4[_0x13ec('0x24')])_0x39f8f2[_0x13ec('0x3b')]++;_0x39f8f2[_0x13ec('0x3a')][_0x13ec('0x4a')](_0x5b33c4);}return _0x39f8f2;});}function getQueueAgents(_0x487753,_0x56b4f6,_0x13e104){var _0x36b062=_0x13ec('0x4b')+_[_0x13ec('0x1b')](_0x13e104)+'Queue';var _0x511282=_0x13e104+_0x13ec('0x4c');return db[_0x36b062][_0x13ec('0x4d')]({'where':{[_[_0x13ec('0x1b')](_0x13e104)+_0x13ec('0x4e')]:_0x487753['id']},'raw':!![]})[_0x13ec('0x15')](function(_0x27ca86){for(var _0x54e85d=0x0;_0x54e85d<_0x27ca86['length'];_0x54e85d++){var _0x5e8dad=_[_0x13ec('0x3f')](_0x56b4f6,['id',_0x27ca86[_0x54e85d][_0x13ec('0x47')]]);if(!_0x5e8dad){_0x5e8dad={'id':_0x27ca86[_0x54e85d][_0x13ec('0x47')],'name':_0x27ca86[_0x54e85d][_0x13ec('0x47')],'online':![],['pauseField']:![]};}var _0x2a10d8={'id':_0x5e8dad['id'],'name':_0x5e8dad[_0x13ec('0x12')],'online':Boolean(_0x5e8dad[_0x13ec('0x49')]),'paused':Boolean(_0x5e8dad[_0x511282])};if(_0x2a10d8['online'])_0x487753[_0x13ec('0x4f')]++;_0x487753['agents'][_0x13ec('0x4a')](_0x2a10d8);}return _0x487753;});}function isIdle(_0x5876da){return _0x5876da===_0x13ec('0x50')||_0x5876da===_0x13ec('0x51')||_0x5876da===_0x13ec('0x52')||_0x5876da===_0x13ec('0x53')||_[_0x13ec('0x54')](_0x5876da);}function isAgentPaused(_0x103c26,_0x141331){var _0xcf9b79=[_0x103c26[_0x13ec('0x55')],_0x103c26[_0x13ec('0x56')],_0x103c26[_0x13ec('0x57')],_0x103c26[_0x13ec('0x58')],_0x103c26[_0x13ec('0x59')],_0x103c26['voicePause'],_0x103c26[_0x13ec('0x5a')]];if(!_0x141331)return _[_0x13ec('0x5b')](_0xcf9b79);var _0x37f376=_['filter'](_0xcf9b79);return _0x37f376[_0x13ec('0x42')]>0x0&&_0x37f376[_0x13ec('0x42')]<_0xcf9b79['length']?!![]:![];}function isAgentIdle(_0x4033a8){if(_0x4033a8['voiceStatus']!==_0x13ec('0x50')&&_0x4033a8[_0x13ec('0x5c')]){_0x4033a8[_0x13ec('0x5d')]=_0x13ec('0x5e');return![];}return _['every']([_0x4033a8['chatStatus'],_0x4033a8[_0x13ec('0x5f')],_0x4033a8['mailStatus'],_0x4033a8[_0x13ec('0x60')],_0x4033a8[_0x13ec('0x61')],_0x4033a8['voiceStatus'],_0x4033a8[_0x13ec('0x62')]],isIdle);}function getAgentStatus(_0x302d86){var _0x311616='unknown';if(isAgentPaused(_0x302d86))_0x311616=_0x13ec('0x5e');else if(isAgentPaused(_0x302d86,!![]))_0x311616='*pause';else if(isAgentIdle(_0x302d86))_0x311616=_0x13ec('0x50');else _0x311616=_0x13ec('0x3d');return _0x311616;}exports[_0x13ec('0x63')]=function(_0x5c3434,_0x57914d){var _0x53c0b3={'count':0x0,'rows':[]},_0x25d8f6={},_0x5bbe0f,_0x57013b,_0x17a78c=[_0x13ec('0x64'),_0x13ec('0x49'),'lastLoginAt',_0x13ec('0x65'),_0x13ec('0x66'),_0x13ec('0x65'),_0x13ec('0x45'),_0x13ec('0x67'),'chatPause',_0x13ec('0x58'),'mailPause',_0x13ec('0x59'),'whatsappPause',_0x13ec('0x56'),_0x13ec('0x5c'),_0x13ec('0x68'),_0x13ec('0x69'),_0x13ec('0x6a'),_0x13ec('0x6b'),_0x13ec('0x6c'),_0x13ec('0x6d'),_0x13ec('0x6e'),_0x13ec('0x6f'),_0x13ec('0x70'),_0x13ec('0x71'),_0x13ec('0x72'),'faxCurrentCapacity',_0x13ec('0x73'),'openchannelStatus',_0x13ec('0x74'),'smsStatus',_0x13ec('0x62'),'faxStatus',_0x13ec('0x5d'),'chatStatusTime',_0x13ec('0x75'),_0x13ec('0x76'),_0x13ec('0x77'),_0x13ec('0x78'),'faxStatusTime',_0x13ec('0x79'),'queue',_0x13ec('0x7a'),'screenrecording',_0x13ec('0x7b'),_0x13ec('0x7c'),'routealias'],_0x963177=[_0x13ec('0x55'),'openchannelPause',_0x13ec('0x57'),_0x13ec('0x59'),'whatsappPause','faxPause',_0x13ec('0x5c'),_0x13ec('0x49')];Promise[_0x13ec('0x7d')]()[_0x13ec('0x15')](function(){var _0x4a0ba0=_[_0x13ec('0x7e')](db[_0x13ec('0x4b')][_0x13ec('0x7f')],function(_0x638466){return{'name':_0x638466['fieldName'],'type':_0x638466[_0x13ec('0x80')]['key']};});_0x5c3434[_0x13ec('0x81')]['role']=_0x13ec('0x82');_0x5c3434['query'][_0x13ec('0x49')]=!![];_0x25d8f6=qs[_0x13ec('0x83')](_0x4a0ba0,_0x5c3434);_0x25d8f6['raw']=!![];if(_0x5c3434[_0x13ec('0x84')][_0x13ec('0x85')]==='user'){var _0x12416b={'params':{'id':_0x5c3434[_0x13ec('0x84')][_0x13ec('0x86')]},'query':{'section':_0x13ec('0x14'),'role':_0x13ec('0x82'),'online':!![],'nolimit':_0x5c3434['query']['nolimit'],'sort':_0x5c3434['query'][_0x13ec('0x87')],'filter':_0x5c3434[_0x13ec('0x81')][_0x13ec('0x88')]},'raw':!![]};return db[_0x13ec('0x89')][_0x13ec('0x8a')](_0x12416b);}return db[_0x13ec('0x4b')]['findAndCountAll'](_0x25d8f6);})[_0x13ec('0x15')](function(_0x25d570){_0x53c0b3[_0x13ec('0xb')]=_0x25d570['count'];_0x5bbe0f=_0x25d570[_0x13ec('0x8b')];return getRealtimeAgents();})['then'](function(_0xfa78c7){_0x57013b=_0xfa78c7[_0x13ec('0x8b')];return _0x5bbe0f[_0x13ec('0x7e')](function(_0x132a52){var _0x208db8=_['find'](_0x57013b,['id',_0x132a52['id']]);if(_0x208db8)_[_0x13ec('0x19')](_0x132a52,_[_0x13ec('0x40')](_[_0x13ec('0x8c')](_0x208db8,_0x963177),_0x17a78c));_0x132a52[_0x13ec('0x8d')]=getAgentStatus(_0x132a52);return _0x132a52;});})[_0x13ec('0x15')](function(_0x4ccd0c){if(_0x5c3434[_0x13ec('0x81')]['globalStatusFilter']){var _0x47ee3a=_[_0x13ec('0x88')](_0x4ccd0c,[_0x13ec('0x8d'),_0x5c3434[_0x13ec('0x81')]['globalStatusFilter']]);if(_0x5c3434[_0x13ec('0x81')][_0x13ec('0x8e')]){_0x47ee3a=_[_0x13ec('0x88')](_0x47ee3a,['pauseType',_0x5c3434[_0x13ec('0x81')][_0x13ec('0x8e')]]);}}_0x53c0b3[_0x13ec('0x8b')]=_0x47ee3a||_0x4ccd0c;return _0x53c0b3;})[_0x13ec('0x15')](respondWithFilteredResult(_0x57914d,_0x25d8f6))[_0x13ec('0x1f')](handleError(_0x57914d,null));};exports['getQueues']=function(_0x4cdab7,_0x43c328){var _0x7a8570=[_0x13ec('0x8f'),'chat','sms',_0x13ec('0x90'),_0x13ec('0x91'),_0x13ec('0x92'),_0x13ec('0x1a')];var _0x2ff63a={'count':0x0,'rows':[]},_0x481a7b={},_0x50bf38,_0x574fff,_0x1abff0,_0x394cd1,_0x588025;Promise['resolve']()['then'](function(){if(_0x4cdab7[_0x13ec('0x81')][_0x13ec('0x93')]){if(!_[_0x13ec('0x94')](_0x7a8570,_0x4cdab7[_0x13ec('0x81')][_0x13ec('0x93')][_0x13ec('0x95')]()))throw new Error(_0x13ec('0x96'));_0x50bf38=_0x4cdab7[_0x13ec('0x81')][_0x13ec('0x93')][_0x13ec('0x95')]();}var _0x317b51=_[_0x13ec('0x1b')](_0x50bf38)+_0x13ec('0x97');var _0x6d51db=_[_0x13ec('0x7e')](db[_0x317b51][_0x13ec('0x7f')],function(_0x8cfce0){return{'name':_0x8cfce0[_0x13ec('0x98')],'type':_0x8cfce0[_0x13ec('0x80')][_0x13ec('0x99')]};});_0x481a7b=qs[_0x13ec('0x83')](_0x6d51db,_0x4cdab7);if(_0x4cdab7[_0x13ec('0x84')][_0x13ec('0x85')]===_0x13ec('0x84')){var _0x37a5ce={'params':{'id':_0x4cdab7[_0x13ec('0x84')]['userProfileId']},'query':{'section':_0x50bf38===_0x13ec('0x1a')&&_0x4cdab7[_0x13ec('0x81')][_0x13ec('0x80')]==='outbound'?_0x13ec('0x9a'):_['startCase'](_0x50bf38)+_0x13ec('0x1c'),'type':_0x4cdab7['query']['type'],'nolimit':!![],'sort':'name','filter':_0x4cdab7[_0x13ec('0x81')][_0x13ec('0x88')]}};return db[_0x13ec('0x89')]['getResources'](_0x37a5ce);}return db[_0x317b51][_0x13ec('0x9b')](_0x481a7b);})['then'](function(_0x5334c7){_0x2ff63a['count']=_0x5334c7[_0x13ec('0xb')];_0x574fff=_0x5334c7['rows'];return getRealtimeQueues(_0x4cdab7,_0x50bf38);})[_0x13ec('0x15')](function(_0x22839c){_0x394cd1=_0x22839c[_0x13ec('0x8b')];return getRealtimeAgents();})[_0x13ec('0x15')](function(_0x10c0e2){_0x1abff0=_0x10c0e2[_0x13ec('0x8b')];if(_0x50bf38!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x192eaf){_0x588025=_0x192eaf?_0x192eaf[_0x13ec('0x8b')]:[];return initializeQueues(_0x574fff,_0x394cd1,_0x50bf38,_0x4cdab7[_0x13ec('0x81')]['type']);})[_0x13ec('0x15')](function(_0x51c849){var _0x4ba7b8=_0x51c849['map'](function(_0x4b04ae){if(_0x50bf38===_0x13ec('0x1a'))return getVoiceQueueAgents(_0x4b04ae,_0x574fff,_0x1abff0,_0x588025);else return getQueueAgents(_0x4b04ae,_0x1abff0,_0x50bf38);});return Promise['all'](_0x4ba7b8);})['then'](function(_0x90413c){_0x2ff63a[_0x13ec('0x8b')]=_0x90413c;return _0x2ff63a;})[_0x13ec('0x15')](respondWithFilteredResult(_0x43c328,_0x481a7b))[_0x13ec('0x1f')](handleError(_0x43c328,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 7363c4c..cd450a4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1c8b6b,_0x4d3cac){var _0x4dd870=function(_0x17bea4){while(--_0x17bea4){_0x1c8b6b['push'](_0x1c8b6b['shift']());}};_0x4dd870(++_0x4d3cac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xcb91[_0x22c684];return _0x39fcbb;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3688d5,_0x51d2b7){var _0x3013c4=function(_0x5b3b4c){while(--_0x5b3b4c){_0x3688d5['push'](_0x3688d5['shift']());}};_0x3013c4(++_0x51d2b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 9647611..82424dc 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 _0x6a83=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x506b51,_0x2d2b6d){var _0xca5779=function(_0x5f0fcb){while(--_0x5f0fcb){_0x506b51['push'](_0x506b51['shift']());}};_0xca5779(++_0x2d2b6d);}(_0x6a83,0xd2));var _0x36a8=function(_0x119bc8,_0x285f10){_0x119bc8=_0x119bc8-0x0;var _0x4628d3=_0x6a83[_0x119bc8];return _0x4628d3;};'use strict';var Sequelize=require(_0x36a8('0x0'));module[_0x36a8('0x1')]={'state':{'type':Sequelize[_0x36a8('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x36a8('0x3')]},'scheduledat':{'type':Sequelize[_0x36a8('0x4')]},'uniqueid':{'type':Sequelize[_0x36a8('0x3')]},'starttime':{'type':Sequelize[_0x36a8('0x4')]},'responsetime':{'type':Sequelize[_0x36a8('0x4')]},'ringtime':{'type':Sequelize[_0x36a8('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x36a8('0x3')]},'campaigntype':{'type':Sequelize[_0x36a8('0x3')]},'membername':{'type':Sequelize[_0x36a8('0x3')]}}; \ No newline at end of file +var _0x25fa=['DATE','sequelize','INTEGER','STRING'];(function(_0x49f0a2,_0x38ea3b){var _0x58c278=function(_0x133f7d){while(--_0x133f7d){_0x49f0a2['push'](_0x49f0a2['shift']());}};_0x58c278(++_0x38ea3b);}(_0x25fa,0x109));var _0xa25f=function(_0x1cb37a,_0x3f2255){_0x1cb37a=_0x1cb37a-0x0;var _0x2d1e9d=_0x25fa[_0x1cb37a];return _0x2d1e9d;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'state':{'type':Sequelize[_0xa25f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa25f('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xa25f('0x2')]},'starttime':{'type':Sequelize[_0xa25f('0x3')]},'responsetime':{'type':Sequelize[_0xa25f('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xa25f('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ebc41e8..524f766 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 _0x2f02=['ReportAgentPreview','report_agent_preview','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x15a4d7,_0x18d1f8){var _0x458ecc=function(_0x3a7570){while(--_0x3a7570){_0x15a4d7['push'](_0x15a4d7['shift']());}};_0x458ecc(++_0x18d1f8);}(_0x2f02,0x160));var _0x22f0=function(_0x46b832,_0x454e18){_0x46b832=_0x46b832-0x0;var _0x42b328=_0x2f02[_0x46b832];return _0x42b328;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x22f0('0x0'));var moment=require(_0x22f0('0x1'));var BPromise=require(_0x22f0('0x2'));var rp=require(_0x22f0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22f0('0x4'));var config=require(_0x22f0('0x5'));var attributes=require('./reportAgentPreview.attributes');module[_0x22f0('0x6')]=function(_0x4c180a,_0xca4841){return _0x4c180a[_0x22f0('0x7')](_0x22f0('0x8'),attributes,{'tableName':_0x22f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef66=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2f41a1,_0xedc7cb){var _0xea1f3e=function(_0x2b0944){while(--_0x2b0944){_0x2f41a1['push'](_0x2f41a1['shift']());}};_0xea1f3e(++_0xedc7cb);}(_0xef66,0x171));var _0x6ef6=function(_0x35506f,_0x1dc2ff){_0x35506f=_0x35506f-0x0;var _0x19a782=_0xef66[_0x35506f];return _0x19a782;};'use strict';var _=require(_0x6ef6('0x0'));var util=require(_0x6ef6('0x1'));var logger=require('../../config/logger')(_0x6ef6('0x2'));var moment=require(_0x6ef6('0x3'));var BPromise=require(_0x6ef6('0x4'));var rp=require(_0x6ef6('0x5'));var fs=require('fs');var path=require(_0x6ef6('0x6'));var rimraf=require('rimraf');var config=require(_0x6ef6('0x7'));var attributes=require(_0x6ef6('0x8'));module[_0x6ef6('0x9')]=function(_0x47b073,_0x488cca){return _0x47b073[_0x6ef6('0xa')](_0x6ef6('0xb'),attributes,{'tableName':_0x6ef6('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 470bca0..b7418c8 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 _0x4205=['result','catch','ReportAgentPreview','create','body','options','raw','debug','CreateReportAgentPreview','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x351de3,_0x56856e){var _0x4e43eb=function(_0x34f1af){while(--_0x34f1af){_0x351de3['push'](_0x351de3['shift']());}};_0x4e43eb(++_0x56856e);}(_0x4205,0x105));var _0x5420=function(_0x46452c,_0x8dd7b3){_0x46452c=_0x46452c-0x0;var _0x254113=_0x4205[_0x46452c];return _0x254113;};'use strict';var _=require(_0x5420('0x0'));var util=require(_0x5420('0x1'));var moment=require('moment');var BPromise=require(_0x5420('0x2'));var rs=require(_0x5420('0x3'));var fs=require('fs');var Redis=require(_0x5420('0x4'));var db=require(_0x5420('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5420('0x6'))('rpc');var config=require(_0x5420('0x7'));var jayson=require(_0x5420('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1966,_0x1cedf4,_0x425bcf){return new BPromise(function(_0x2a9a6c,_0x169a63){return client[_0x5420('0x9')](_0x3a1966,_0x425bcf)[_0x5420('0xa')](function(_0x2ec337){logger[_0x5420('0xb')](_0x5420('0xc'),_0x1cedf4,_0x5420('0xd'));logger['debug'](_0x5420('0xe'),_0x1cedf4,_0x5420('0xd'),JSON[_0x5420('0xf')](_0x2ec337));if(_0x2ec337['error']){if(_0x2ec337[_0x5420('0x10')][_0x5420('0x11')]===0x1f4){logger[_0x5420('0x10')](_0x5420('0xc'),_0x1cedf4,_0x2ec337[_0x5420('0x10')][_0x5420('0x12')]);return _0x169a63(_0x2ec337[_0x5420('0x10')]['message']);}logger['error'](_0x5420('0xc'),_0x1cedf4,_0x2ec337[_0x5420('0x10')][_0x5420('0x12')]);return _0x2a9a6c(_0x2ec337[_0x5420('0x10')][_0x5420('0x12')]);}else{logger[_0x5420('0xb')](_0x5420('0xc'),_0x1cedf4,_0x5420('0xd'));_0x2a9a6c(_0x2ec337[_0x5420('0x13')][_0x5420('0x12')]);}})[_0x5420('0x14')](function(_0x236ec4){logger[_0x5420('0x10')](_0x5420('0xc'),_0x1cedf4,_0x236ec4);_0x169a63(_0x236ec4);});});}exports['CreateReportAgentPreview']=function(_0x97fd45){var _0xd22582=this;return new Promise(function(_0x515a51,_0x34849d){return db[_0x5420('0x15')][_0x5420('0x16')](_0x97fd45[_0x5420('0x17')],{'raw':_0x97fd45[_0x5420('0x18')]?_0x97fd45[_0x5420('0x18')][_0x5420('0x19')]===undefined?!![]:![]:!![]})[_0x5420('0xa')](function(_0x3d5d40){logger[_0x5420('0xb')]('CreateReportAgentPreview',_0x97fd45);logger[_0x5420('0x1a')]('CreateReportAgentPreview',_0x97fd45,JSON['stringify'](_0x3d5d40));_0x515a51(_0x3d5d40);})['catch'](function(_0x9572d0){logger[_0x5420('0x10')](_0x5420('0x1b'),_0x9572d0[_0x5420('0x12')],_0x97fd45);_0x34849d(_0xd22582[_0x5420('0x10')](0x1f4,_0x9572d0[_0x5420('0x12')]));});});}; \ No newline at end of file +var _0x1fa2=['code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','then','debug','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x347f4e,_0x51235d){var _0x32164d=function(_0x2d5248){while(--_0x2d5248){_0x347f4e['push'](_0x347f4e['shift']());}};_0x32164d(++_0x51235d);}(_0x1fa2,0x150));var _0x21fa=function(_0x51e321,_0x155914){_0x51e321=_0x51e321-0x0;var _0x251cbd=_0x1fa2[_0x51e321];return _0x251cbd;};'use strict';var _=require(_0x21fa('0x0'));var util=require(_0x21fa('0x1'));var moment=require(_0x21fa('0x2'));var BPromise=require(_0x21fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x21fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x21fa('0x5'))(_0x21fa('0x6'));var config=require(_0x21fa('0x7'));var jayson=require(_0x21fa('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c1542,_0x253a4b,_0x895c4c){return new BPromise(function(_0x410463,_0x2686c5){return client[_0x21fa('0x9')](_0x5c1542,_0x895c4c)['then'](function(_0x330ff3){logger['info'](_0x21fa('0xa'),_0x253a4b,_0x21fa('0xb'));logger['debug'](_0x21fa('0xc'),_0x253a4b,'request\x20sent',JSON[_0x21fa('0xd')](_0x330ff3));if(_0x330ff3[_0x21fa('0xe')]){if(_0x330ff3[_0x21fa('0xe')][_0x21fa('0xf')]===0x1f4){logger[_0x21fa('0xe')](_0x21fa('0xa'),_0x253a4b,_0x330ff3[_0x21fa('0xe')][_0x21fa('0x10')]);return _0x2686c5(_0x330ff3[_0x21fa('0xe')]['message']);}logger[_0x21fa('0xe')](_0x21fa('0xa'),_0x253a4b,_0x330ff3[_0x21fa('0xe')][_0x21fa('0x10')]);return _0x410463(_0x330ff3[_0x21fa('0xe')]['message']);}else{logger[_0x21fa('0x11')](_0x21fa('0xa'),_0x253a4b,_0x21fa('0xb'));_0x410463(_0x330ff3[_0x21fa('0x12')][_0x21fa('0x10')]);}})[_0x21fa('0x13')](function(_0x30f41f){logger[_0x21fa('0xe')](_0x21fa('0xa'),_0x253a4b,_0x30f41f);_0x2686c5(_0x30f41f);});});}exports[_0x21fa('0x14')]=function(_0x20f35e){var _0x20577f=this;return new Promise(function(_0x593122,_0x35e3bb){return db[_0x21fa('0x15')][_0x21fa('0x16')](_0x20f35e[_0x21fa('0x17')],{'raw':_0x20f35e[_0x21fa('0x18')]?_0x20f35e['options']['raw']===undefined?!![]:![]:!![]})[_0x21fa('0x19')](function(_0x4f3f82){logger[_0x21fa('0x11')](_0x21fa('0x14'),_0x20f35e);logger[_0x21fa('0x1a')]('CreateReportAgentPreview',_0x20f35e,JSON[_0x21fa('0xd')](_0x4f3f82));_0x593122(_0x4f3f82);})[_0x21fa('0x13')](function(_0x8747a2){logger[_0x21fa('0xe')](_0x21fa('0x14'),_0x8747a2[_0x21fa('0x10')],_0x20f35e);_0x35e3bb(_0x20577f['error'](0x1f4,_0x8747a2[_0x21fa('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index be1d78c..4f67cd8 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 _0xcc89=['voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','agents','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0xcc89,0x17b));var _0x9cc8=function(_0x951c84,_0x818fcb){_0x951c84=_0x951c84-0x0;var _0x356dfe=_0xcc89[_0x951c84];return _0x356dfe;};'use strict';var multer=require('multer');var util=require(_0x9cc8('0x0'));var path=require(_0x9cc8('0x1'));var express=require(_0x9cc8('0x2'));var router=express[_0x9cc8('0x3')]();var auth=require(_0x9cc8('0x4'));var controller=require(_0x9cc8('0x5'));router[_0x9cc8('0x6')]('/voice/channels',auth['isAuthenticated'](),controller['voiceChannels']);router[_0x9cc8('0x6')](_0x9cc8('0x7'),auth['isAuthenticated'](),controller[_0x9cc8('0x8')]);router[_0x9cc8('0x6')](_0x9cc8('0x9'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0xb')]);router[_0x9cc8('0x6')](_0x9cc8('0xc'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0xd')]);router['get'](_0x9cc8('0xe'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0xf')]);router[_0x9cc8('0x6')]('/mail/queues',auth['isAuthenticated'](),controller[_0x9cc8('0x10')]);router['get'](_0x9cc8('0x11'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x12')]);router[_0x9cc8('0x6')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x9cc8('0x13')]);router[_0x9cc8('0x6')](_0x9cc8('0x14'),auth['isAuthenticated'](),controller[_0x9cc8('0x15')]);router[_0x9cc8('0x6')](_0x9cc8('0x16'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x17')]);router[_0x9cc8('0x6')]('/fax/queues',auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x18')]);router[_0x9cc8('0x6')](_0x9cc8('0x19'),auth[_0x9cc8('0xa')](),controller['voiceQueuesPreview']);router['get'](_0x9cc8('0x1a'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x1b')]);router[_0x9cc8('0x6')](_0x9cc8('0x1c'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x1d')]);router['get'](_0x9cc8('0x1e'),auth[_0x9cc8('0xa')](),controller['voiceQueuesChannelHangup']);router['get'](_0x9cc8('0x1f'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x20')]);router['get'](_0x9cc8('0x21'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x22')]);router[_0x9cc8('0x23')]('/voice/queues/:id',auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x24')]);router['get'](_0x9cc8('0x25'),auth['isAuthenticated'](),controller[_0x9cc8('0x26')]);router[_0x9cc8('0x6')](_0x9cc8('0x27'),auth[_0x9cc8('0xa')](),controller['outboundChannels']);router['get']('/agents',auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x28')]);router['put']('/agents/:id/capacity',auth[_0x9cc8('0xa')](),controller['agentCapacity']);router['get'](_0x9cc8('0x29'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x2a')]);router[_0x9cc8('0x6')](_0x9cc8('0x2b'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x2c')]);router[_0x9cc8('0x6')](_0x9cc8('0x2d'),auth[_0x9cc8('0xa')](),controller['campaigns']);router[_0x9cc8('0x6')](_0x9cc8('0x2e'),auth[_0x9cc8('0xa')](),controller['faxAccounts']);router['get']('/chat/queues/waitinginteractions',auth[_0x9cc8('0xa')](),controller['chatQueuesWaitingInteractions']);router[_0x9cc8('0x6')](_0x9cc8('0x2f'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x30')]);router[_0x9cc8('0x6')](_0x9cc8('0x31'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x32')]);router[_0x9cc8('0x6')](_0x9cc8('0x33'),auth['isAuthenticated'](),controller[_0x9cc8('0x34')]);router['get'](_0x9cc8('0x35'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x36')]);router[_0x9cc8('0x6')](_0x9cc8('0x37'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x38')]);router[_0x9cc8('0x6')]('/fax/queues/waitinginteractions',auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x39')]);router[_0x9cc8('0x3a')](_0x9cc8('0x3b'),auth['isAuthenticated'](),controller[_0x9cc8('0x3c')](_0x9cc8('0x3d')));router['get'](_0x9cc8('0x3e'),auth['isAuthenticated'](),controller[_0x9cc8('0x3f')]);router[_0x9cc8('0x3a')]('/chat/queues/:id/notify',auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x3c')](_0x9cc8('0x40')));router[_0x9cc8('0x6')](_0x9cc8('0x41'),auth['isAuthenticated'](),controller[_0x9cc8('0x42')]);router[_0x9cc8('0x3a')](_0x9cc8('0x43'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x3c')](_0x9cc8('0x44')));router[_0x9cc8('0x6')]('/fax/queues/:id',auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x45')]);router['post'](_0x9cc8('0x46'),auth[_0x9cc8('0xa')](),controller['queueNotify'](_0x9cc8('0x47')));router[_0x9cc8('0x6')](_0x9cc8('0x48'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x49')]);router['post']('/sms/queues/:id/notify',auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x3c')]('sms'));router[_0x9cc8('0x3a')](_0x9cc8('0x4a'),auth[_0x9cc8('0xa')](),controller[_0x9cc8('0x3c')]('whatsapp'));router[_0x9cc8('0x6')](_0x9cc8('0x4b'),auth[_0x9cc8('0xa')](),controller['showSmsQueues']);router[_0x9cc8('0x6')](_0x9cc8('0x4c'),auth[_0x9cc8('0xa')](),controller['showWhatsappQueues']);router[_0x9cc8('0x3a')]('/agents/:id/notify',auth['isAuthenticated'](),controller['agentNotify']);module[_0x9cc8('0x4d')]=router; \ No newline at end of file +var _0x9ced=['/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/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','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','openchannelQueues'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x9ced,0x18d));var _0xd9ce=function(_0x6e5ca9,_0x581255){_0x6e5ca9=_0x6e5ca9-0x0;var _0x39ecf8=_0x9ced[_0x6e5ca9];return _0x39ecf8;};'use strict';var multer=require(_0xd9ce('0x0'));var util=require(_0xd9ce('0x1'));var path=require('path');var express=require(_0xd9ce('0x2'));var router=express['Router']();var auth=require(_0xd9ce('0x3'));var controller=require(_0xd9ce('0x4'));router['get'](_0xd9ce('0x5'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x7')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x8')]);router[_0xd9ce('0x9')](_0xd9ce('0xa'),auth[_0xd9ce('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0xd9ce('0x9')](_0xd9ce('0xb'),auth[_0xd9ce('0x6')](),controller['voiceQueues']);router[_0xd9ce('0x9')](_0xd9ce('0xc'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0xd')]);router[_0xd9ce('0x9')](_0xd9ce('0xe'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0xf')]);router[_0xd9ce('0x9')](_0xd9ce('0x10'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0xd9ce('0x9')]('/openchannel/queues',auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x11')]);router['get'](_0xd9ce('0x12'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x13')]);router[_0xd9ce('0x9')](_0xd9ce('0x14'),auth['isAuthenticated'](),controller[_0xd9ce('0x15')]);router[_0xd9ce('0x9')](_0xd9ce('0x16'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x17')]);router[_0xd9ce('0x9')](_0xd9ce('0x18'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x19')]);router[_0xd9ce('0x9')](_0xd9ce('0x1a'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x1b')]);router[_0xd9ce('0x9')]('/voice/queues/channels/:uniqueid',auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x1c')]);router['get'](_0xd9ce('0x1d'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x1e')]);router[_0xd9ce('0x9')](_0xd9ce('0x1f'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x20')]);router[_0xd9ce('0x9')](_0xd9ce('0x21'),auth[_0xd9ce('0x6')](),controller['showVoiceQueues']);router[_0xd9ce('0x22')]('/voice/queues/:id',auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x23')]);router[_0xd9ce('0x9')](_0xd9ce('0x24'),auth[_0xd9ce('0x6')](),controller['outbound']);router[_0xd9ce('0x9')](_0xd9ce('0x25'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x26')]);router[_0xd9ce('0x9')](_0xd9ce('0x27'),auth['isAuthenticated'](),controller[_0xd9ce('0x28')]);router[_0xd9ce('0x22')](_0xd9ce('0x29'),auth[_0xd9ce('0x6')](),controller['agentCapacity']);router[_0xd9ce('0x9')](_0xd9ce('0x2a'),auth['isAuthenticated'](),controller['telephones']);router[_0xd9ce('0x9')]('/trunks',auth['isAuthenticated'](),controller[_0xd9ce('0x2b')]);router['get'](_0xd9ce('0x2c'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x2d')]);router[_0xd9ce('0x9')](_0xd9ce('0x2e'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x2f')]);router[_0xd9ce('0x9')]('/chat/queues/waitinginteractions',auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x30')]);router[_0xd9ce('0x9')](_0xd9ce('0x31'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x32')]);router[_0xd9ce('0x9')](_0xd9ce('0x33'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x34')]);router['get'](_0xd9ce('0x35'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x36')]);router['get']('/sms/queues/waitinginteractions',auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x37')]);router['get'](_0xd9ce('0x38'),auth['isAuthenticated'](),controller[_0xd9ce('0x39')]);router[_0xd9ce('0x9')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xd9ce('0x3a')]);router['post'](_0xd9ce('0x3b'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x3c')](_0xd9ce('0x3d')));router[_0xd9ce('0x9')](_0xd9ce('0x3e'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x3f')]);router[_0xd9ce('0x40')](_0xd9ce('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0xd9ce('0x42')));router[_0xd9ce('0x9')](_0xd9ce('0x43'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x44')]);router[_0xd9ce('0x40')](_0xd9ce('0x45'),auth['isAuthenticated'](),controller[_0xd9ce('0x3c')](_0xd9ce('0x46')));router['get'](_0xd9ce('0x47'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x48')]);router[_0xd9ce('0x40')](_0xd9ce('0x49'),auth['isAuthenticated'](),controller[_0xd9ce('0x3c')](_0xd9ce('0x4a')));router[_0xd9ce('0x9')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0xd9ce('0x4b')]);router[_0xd9ce('0x40')](_0xd9ce('0x4c'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x3c')]('sms'));router[_0xd9ce('0x40')](_0xd9ce('0x4d'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x3c')]('whatsapp'));router['get'](_0xd9ce('0x4e'),auth[_0xd9ce('0x6')](),controller[_0xd9ce('0x4f')]);router[_0xd9ce('0x9')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0xd9ce('0x40')](_0xd9ce('0x50'),auth['isAuthenticated'](),controller[_0xd9ce('0x51')]);module[_0xd9ce('0x52')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 70f9d27..c7c7488 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 _0x7c09=['update','MessageId','agent','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','catch','status','json','sendStatus','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User'];(function(_0x32a379,_0x26242a){var _0x3de943=function(_0x284c22){while(--_0x284c22){_0x32a379['push'](_0x32a379['shift']());}};_0x3de943(++_0x26242a);}(_0x7c09,0x102));var _0x97c0=function(_0x1fab02,_0x2bf715){_0x1fab02=_0x1fab02-0x0;var _0x15b12d=_0x7c09[_0x1fab02];return _0x15b12d;};'use strict';var BPromise=require('bluebird');var moment=require(_0x97c0('0x0'));var _=require(_0x97c0('0x1'));var util=require('util');var db=require(_0x97c0('0x2'))['db'];var logger=require(_0x97c0('0x3'))(_0x97c0('0x4'));var jayson=require(_0x97c0('0x5'));var amiClient=jayson[_0x97c0('0x6')][_0x97c0('0x7')]({'port':0x232a});var mailClient=jayson[_0x97c0('0x6')]['http']({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){var _0x57661a=_0x2c19fa?_0x2c19fa:amiClient;return _0x57661a[_0x97c0('0x8')](_0x46fdd9,_0x42c6c7)['then'](function(_0x2d5507){if(_0x2d5507[_0x97c0('0x9')]){if(_0x2d5507['error']['code']===0x1f4){return _0x293785(_0x2d5507[_0x97c0('0x9')][_0x97c0('0xa')]);}return _0x109bc8(_0x2d5507[_0x97c0('0x9')][_0x97c0('0xa')]);}else{_0x109bc8(_0x2d5507[_0x97c0('0xb')]);}})[_0x97c0('0xc')](function(_0x7fc93){_0x293785(_0x7fc93);});});}function respondWithResult(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xc8;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0xd')](_0x9ca3c1)[_0x97c0('0xe')](_0x2ecf34);}return _0x39a3b4[_0x97c0('0xf')](0x194);};}function handleError(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0x1f4;return function(_0x15b336){logger[_0x97c0('0x9')](_0x15b336['stack']);if(_0x15b336[_0x97c0('0x10')]){delete _0x15b336[_0x97c0('0x10')];}_0x514782[_0x97c0('0xd')](_0x3f2fc2)[_0x97c0('0x11')](_0x15b336);};}function findById(_0x482be5){return function(_0x13d46e){if(!_['isNil'](_0x482be5)&&!_[_0x97c0('0x12')](_0x13d46e)&&!_[_0x97c0('0x12')](_0x13d46e['rows'])){return _[_0x97c0('0x13')](_0x13d46e[_0x97c0('0x14')],function(_0x179d43){return _0x179d43['id']==_0x482be5;});}return null;};}exports[_0x97c0('0x15')]=function(_0x183e2e,_0x3e7a52){return respondWithRpcPromise(_0x97c0('0x16'),_0x183e2e[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x3e7a52,null))[_0x97c0('0xc')](handleError(_0x3e7a52,null));};exports['voiceChannelMixMonitor']=function(_0x554122,_0x2b74a2){return respondWithRpcPromise(_0x97c0('0x19'),_[_0x97c0('0x1a')](_0x554122['query'],_0x554122[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x2b74a2,null))[_0x97c0('0xc')](handleError(_0x2b74a2,null));};exports[_0x97c0('0x1c')]=function(_0x30fba2,_0x3a0bfb){return respondWithRpcPromise(_0x97c0('0x1d'),_['merge'](_0x30fba2[_0x97c0('0x17')],_0x30fba2[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x3a0bfb,null))[_0x97c0('0xc')](handleError(_0x3a0bfb,null));};exports['voiceQueues']=function(_0x2bda6c,_0x14cada){return respondWithRpcPromise('VoiceQueues',_0x2bda6c[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x14cada,null))[_0x97c0('0xc')](handleError(_0x14cada,null));};exports['showVoiceQueues']=function(_0x4f11ba,_0x51f258){return respondWithRpcPromise(_0x97c0('0x1e'),_0x4f11ba[_0x97c0('0x17')])[_0x97c0('0x18')](findById(_0x4f11ba[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x51f258,null))[_0x97c0('0xc')](handleError(_0x51f258,null));};exports['updateVoiceQueue']=function(_0x10e47e,_0x1c183f){return respondWithRpcPromise(_0x97c0('0x1f'),_['merge'](_0x10e47e[_0x97c0('0x20')],_0x10e47e[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x1c183f,null))[_0x97c0('0xc')](handleError(_0x1c183f,null));};exports[_0x97c0('0x21')]=function(_0x5c4e4e,_0x59abbb){return respondWithRpcPromise(_0x97c0('0x22'),_[_0x97c0('0x1a')](_0x5c4e4e[_0x97c0('0x17')],_0x5c4e4e['params']))[_0x97c0('0x18')](respondWithResult(_0x59abbb,null))[_0x97c0('0xc')](handleError(_0x59abbb,null));};exports['voiceQueuesChannels']=function(_0x30147b,_0x22833e){return respondWithRpcPromise(_0x97c0('0x23'),_0x30147b[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x22833e,null))[_0x97c0('0xc')](handleError(_0x22833e,null));};exports[_0x97c0('0x24')]=function(_0x1a6c4b,_0x30b927){return respondWithRpcPromise(_0x97c0('0x25'),_[_0x97c0('0x1a')](_0x1a6c4b[_0x97c0('0x17')],_0x1a6c4b[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x30b927,null))[_0x97c0('0xc')](handleError(_0x30b927,null));};exports['voiceQueuesChannelHangup']=function(_0x292560,_0x1548b6){return respondWithRpcPromise(_0x97c0('0x26'),_[_0x97c0('0x1a')](_0x292560[_0x97c0('0x17')],_0x292560[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x1548b6,null))[_0x97c0('0xc')](handleError(_0x1548b6,null));};exports['voiceQueuesChannelRedirect']=function(_0xd72d47,_0x4bf42a){return respondWithRpcPromise(_0x97c0('0x27'),_[_0x97c0('0x1a')](_0xd72d47[_0x97c0('0x17')],_0xd72d47[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x4bf42a,null))[_0x97c0('0xc')](handleError(_0x4bf42a,null));};exports[_0x97c0('0x28')]=function(_0x225ca4,_0x38f37a){return respondWithRpcPromise(_0x97c0('0x29'),_0x225ca4[_0x97c0('0x17')])['then'](respondWithResult(_0x38f37a,null))[_0x97c0('0xc')](handleError(_0x38f37a,null));};exports[_0x97c0('0x2a')]=function(_0x4d47b1,_0x137ee1){return respondWithRpcPromise(_0x97c0('0x2b'),_0x4d47b1[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x137ee1,null))['catch'](handleError(_0x137ee1,null));};exports[_0x97c0('0x2c')]=function(_0x4f1629,_0x1acf31){var _0x64cfcd;return respondWithRpcPromise('Agents',_0x4f1629[_0x97c0('0x17')])[_0x97c0('0x18')](function(_0xd728dd){_0x64cfcd=_0xd728dd;return respondWithRpcPromise(_0x97c0('0x2d'),_0x4f1629[_0x97c0('0x17')],routingClient);})[_0x97c0('0x18')](function(_0x36b3d0){return _[_0x97c0('0x1a')]({},_0x36b3d0,_0x64cfcd);})[_0x97c0('0x18')](respondWithResult(_0x1acf31,null))[_0x97c0('0xc')](handleError(_0x1acf31,null));};exports[_0x97c0('0x2e')]=function(_0x2cca4c,_0x1351d2){if(_0x2cca4c['body']&&_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')]&&_0x2cca4c[_0x97c0('0x30')]&&_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')]){for(var _0x375ebc in _0x2cca4c[_0x97c0('0x20')]['interaction']){if(_0x2cca4c['body'][_0x97c0('0x2f')][_0x97c0('0x31')](_0x375ebc)){db[_0x97c0('0x32')][_0x97c0('0x33')]({'where':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2cca4c['body'][_0x97c0('0x2f')][_0x375ebc]&&_0x2cca4c['body']['interaction'][_0x375ebc][_0x97c0('0x34')]?{'$notIn':_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')][_0x375ebc]}:{'$ne':null}}})[_0x97c0('0x18')](function(_0x2f538b){var _0x483656=moment()[_0x97c0('0x35')](_0x97c0('0x36'));for(var _0x342eeb=0x0,_0x10a8ea=_0x2f538b[_0x97c0('0x34')];_0x342eeb<_0x10a8ea;_0x342eeb+=0x1){_0x2f538b[_0x342eeb][_0x97c0('0x37')]({'exitAt':_0x483656});}});for(var _0x444e41=0x0;_0x444e41<_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')][_0x375ebc][_0x97c0('0x34')];_0x444e41+=0x1){db['MemberReport'][_0x97c0('0x38')]({'where':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')],'type':_0x97c0('0x39'),'uniqueid':_0x2cca4c['body']['interaction'][_0x375ebc][_0x444e41],'exitAt':null},'defaults':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')],'interface':_[_0x97c0('0x12')](_0x2cca4c['user'][_0x97c0('0x3a')])?util[_0x97c0('0x35')](_0x97c0('0x3b'),_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')]):_0x2cca4c['user'][_0x97c0('0x3a')],'type':_0x97c0('0x39'),'enterAt':moment()[_0x97c0('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x2cca4c[_0x97c0('0x30')]['internal'],'uniqueid':_0x2cca4c['body'][_0x97c0('0x2f')][_0x375ebc][_0x444e41]}});}}}}return respondWithRpcPromise(_0x97c0('0x3c'),{'id':_0x2cca4c[_0x97c0('0x1b')]['id'],'capacity':_0x2cca4c['body']['capacity']},routingClient)['then'](respondWithResult(_0x1351d2,null))[_0x97c0('0xc')](handleError(_0x1351d2,null));};exports[_0x97c0('0x3d')]=function(_0x3afef4,_0xdb2767){return respondWithRpcPromise(_0x97c0('0x3e'),_0x3afef4[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0xdb2767,null))['catch'](handleError(_0xdb2767,null));};exports[_0x97c0('0x3f')]=function(_0x3f074b,_0x20cd9c){return respondWithRpcPromise(_0x97c0('0x40'),_0x3f074b[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x20cd9c,null))['catch'](handleError(_0x20cd9c,null));};exports[_0x97c0('0x41')]=function(_0x86a497,_0x4fbc1e){return respondWithRpcPromise(_0x97c0('0x42'),_0x86a497[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x4fbc1e,null))[_0x97c0('0xc')](handleError(_0x4fbc1e,null));};exports[_0x97c0('0x43')]=function(_0x18992d,_0x47298f){return respondWithRpcPromise('ChatQueues',_0x18992d[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x47298f,null))[_0x97c0('0xc')](handleError(_0x47298f,null));};exports[_0x97c0('0x44')]=function(_0x154317,_0x2f1571){return respondWithRpcPromise(_0x97c0('0x45'),_0x154317[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](findById(_0x154317[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x2f1571,null))[_0x97c0('0xc')](handleError(_0x2f1571,null));};exports[_0x97c0('0x46')]=function(_0x57766f,_0x771495){return respondWithRpcPromise(_0x97c0('0x47'),_0x57766f[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x771495,null))[_0x97c0('0xc')](handleError(_0x771495,null));};exports[_0x97c0('0x48')]=function(_0x481f5b,_0x18a6c0){return respondWithRpcPromise(_0x97c0('0x47'),_0x481f5b['query'],routingClient)[_0x97c0('0x18')](findById(_0x481f5b[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x18a6c0,null))['catch'](handleError(_0x18a6c0,null));};exports[_0x97c0('0x49')]=function(_0x4c4fb2,_0x25c750){return respondWithRpcPromise(_0x97c0('0x4a'),_0x4c4fb2[_0x97c0('0x17')],mailClient)[_0x97c0('0x18')](respondWithResult(_0x25c750,null))[_0x97c0('0xc')](handleError(_0x25c750,null));};exports[_0x97c0('0x4b')]=function(_0x52643e,_0x3349df){return respondWithRpcPromise(_0x97c0('0x4c'),_0x52643e[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x3349df,null))['catch'](handleError(_0x3349df,null));};exports[_0x97c0('0x4d')]=function(_0x3795db,_0x102f68){return respondWithRpcPromise(_0x97c0('0x4c'),_0x3795db['query'],routingClient)[_0x97c0('0x18')](findById(_0x3795db[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x102f68,null))[_0x97c0('0xc')](handleError(_0x102f68,null));};exports['smsQueues']=function(_0x32881c,_0x3c4c27){return respondWithRpcPromise(_0x97c0('0x4e'),_0x32881c['query'],routingClient)[_0x97c0('0x18')](respondWithResult(_0x3c4c27,null))[_0x97c0('0xc')](handleError(_0x3c4c27,null));};exports[_0x97c0('0x4f')]=function(_0x32e392,_0x373c34){return respondWithRpcPromise(_0x97c0('0x4e'),_0x32e392[_0x97c0('0x17')],routingClient)['then'](findById(_0x32e392['params']['id']))[_0x97c0('0x18')](respondWithResult(_0x373c34,null))[_0x97c0('0xc')](handleError(_0x373c34,null));};exports['whatsappQueues']=function(_0x366a01,_0x5a4738){return respondWithRpcPromise('WhatsappQueues',_0x366a01[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x5a4738,null))[_0x97c0('0xc')](handleError(_0x5a4738,null));};exports[_0x97c0('0x50')]=function(_0x56be23,_0x496336){return respondWithRpcPromise('WhatsappQueues',_0x56be23[_0x97c0('0x17')],routingClient)['then'](findById(_0x56be23[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x496336,null))[_0x97c0('0xc')](handleError(_0x496336,null));};exports[_0x97c0('0x51')]=function(_0x400a8d,_0x321460){return respondWithRpcPromise(_0x97c0('0x52'),_0x400a8d[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x321460,null))[_0x97c0('0xc')](handleError(_0x321460,null));};exports[_0x97c0('0x53')]=function(_0x536f72,_0x1c1182){return respondWithRpcPromise(_0x97c0('0x52'),_0x536f72[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](findById(_0x536f72[_0x97c0('0x1b')]['id']))['then'](respondWithResult(_0x1c1182,null))[_0x97c0('0xc')](handleError(_0x1c1182,null));};exports[_0x97c0('0x54')]=function(_0x579f54,_0x4116c9){return respondWithRpcPromise(_0x97c0('0x55'),_0x579f54[_0x97c0('0x17')])['then'](respondWithResult(_0x4116c9,null))[_0x97c0('0xc')](handleError(_0x4116c9,null));};exports[_0x97c0('0x56')]=function(_0x10f1aa,_0x165c72){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x10f1aa['query'],routingClient)['then'](respondWithResult(_0x165c72,null))[_0x97c0('0xc')](handleError(_0x165c72,null));};exports[_0x97c0('0x57')]=function(_0x442bba,_0x41f8e7){return respondWithRpcPromise(_0x97c0('0x58'),_0x442bba[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x41f8e7,null))[_0x97c0('0xc')](handleError(_0x41f8e7,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x52d9d9,_0x199abc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x52d9d9['query'],routingClient)['then'](respondWithResult(_0x199abc,null))[_0x97c0('0xc')](handleError(_0x199abc,null));};exports[_0x97c0('0x59')]=function(_0x123a99,_0x30968e){return respondWithRpcPromise(_0x97c0('0x5a'),_0x123a99['query'],routingClient)['then'](function(_0x35ced3){if(_0x123a99[_0x97c0('0x17')][_0x97c0('0x5b')]!==undefined){var _0x3a8ac0=_(_0x35ced3['rows'])[_0x97c0('0x5c')]([_0x123a99['query'][_0x97c0('0x5b')],_0x123a99[_0x97c0('0x1b')]['id']])[_0x97c0('0x5d')](_0x97c0('0x5e'))[_0x97c0('0x5f')]()[_0x97c0('0x60')]();return _0x35ced3[_0x97c0('0x14')][_0x97c0('0x5c')](function(_0x465a92){return _0x3a8ac0[_0x97c0('0x61')](_0x465a92['queue_id'])>-0x1;});}else{return _0x35ced3[_0x97c0('0x14')]['filter'](function(_0x5b8ebd){return _0x5b8ebd[_0x97c0('0x5e')]===parseInt(_0x123a99[_0x97c0('0x1b')]['id']);});}})['then'](respondWithResult(_0x30968e,null))[_0x97c0('0xc')](handleError(_0x30968e,null));};exports['smsQueuesWaitingInteractions']=function(_0x1f2380,_0x24a81c){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1f2380[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x24a81c,null))['catch'](handleError(_0x24a81c,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xab71f4,_0x12bb6e){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0xab71f4[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x12bb6e,null))[_0x97c0('0xc')](handleError(_0x12bb6e,null));};exports[_0x97c0('0x62')]=function(_0x41b864,_0x11db50){return respondWithRpcPromise(_0x97c0('0x63'),_0x41b864[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x11db50,null))[_0x97c0('0xc')](handleError(_0x11db50,null));};exports['queueNotify']=function(_0x597cd1){return function(_0x4062f8,_0x4f9307){var _0x3f69a6,_0x15f953;var _0x567e15=_[_0x97c0('0x64')](_0x597cd1);var _0x344d5f=_0x597cd1===_0x97c0('0x65')?_0x97c0('0x66'):_0x97c0('0x67');return db[_0x567e15+'Queue'][_0x97c0('0x68')]({'raw':!![],'where':{'id':_0x4062f8[_0x97c0('0x1b')]['id']}})[_0x97c0('0x18')](function(_0x58e7c0){if(_[_0x97c0('0x12')](_0x58e7c0)){throw new Error(_0x567e15+_0x97c0('0x69'));}_0x3f69a6=_0x58e7c0;return db[_0x567e15+_0x97c0('0x6a')][_0x97c0('0x68')]({'where':{'id':_0x4062f8['body'][_0x97c0('0x6b')]},'include':[{'model':db[_0x567e15+_0x97c0('0x6c')],'as':_0x97c0('0x6c')},{'model':db[_0x567e15+_0x344d5f],'as':_0x97c0('0x67')}]});})[_0x97c0('0x18')](function(_0x5828f7){if(_[_0x97c0('0x12')](_0x5828f7)){throw new Error(_0x567e15+_0x97c0('0x6d'));}_0x15f953=_0x5828f7;return _0x5828f7['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x372415={'uniqueid':_0x597cd1+'.'+_0x15f953['id']+'.'+_0x15f953[_0x97c0('0x6c')]['id'],'FromUserId':_0x4062f8[_0x97c0('0x30')]['id'],'type':'queue'};_0x372415[_0x567e15+'MessageId']=_0x15f953['id'];_0x372415[_0x567e15+_0x97c0('0x6e')]=_0x15f953['Interaction']['id'];_0x372415[_0x97c0('0x6f')+_0x567e15+_0x344d5f+'Id']=_0x15f953[_0x97c0('0x67')]['id'];_0x372415['To'+_0x567e15+_0x97c0('0x70')]=_0x3f69a6['id'];return db[_0x567e15+_0x97c0('0x71')][_0x97c0('0x72')](_0x372415);})[_0x97c0('0x18')](function(){return respondWithRpcPromise(_0x97c0('0x73'),{'channel':_0x597cd1,'interaction':_0x15f953['Interaction'],'message':_0x15f953,'account':_0x15f953[_0x97c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0x97c0('0x74'),'appdata':_0x3f69a6[_0x97c0('0x10')]+','+(_0x15f953[_0x97c0('0x67')][_0x97c0('0x75')]||0x12c),'interval':_0x97c0('0x76')}]},routingClient);})[_0x97c0('0x18')](respondWithResult(_0x4f9307,null))[_0x97c0('0xc')](handleError(_0x4f9307,null));};};exports[_0x97c0('0x77')]=function(_0x15b27f,_0x1cc32c){var _0x1b2e52,_0x3c4c8e;if(_[_0x97c0('0x12')](_0x15b27f['body'][_0x97c0('0x78')])){throw new Error(_0x97c0('0x79'));}var _0x2f9ffe=_0x15b27f[_0x97c0('0x20')]['channel'];var _0x1eb0c7=_[_0x97c0('0x64')](_0x2f9ffe);var _0x6b955=_0x2f9ffe===_0x97c0('0x65')?_0x97c0('0x66'):_0x97c0('0x67');return db[_0x97c0('0x7a')]['findOne']({'raw':!![],'where':{'id':_0x15b27f[_0x97c0('0x1b')]['id'],'role':'agent'}})[_0x97c0('0x18')](function(_0x1822b5){if(_[_0x97c0('0x12')](_0x1822b5)){throw new Error('Agent\x20not\x20found');}_0x1b2e52=_0x1822b5;return db[_0x1eb0c7+_0x97c0('0x6a')][_0x97c0('0x68')]({'where':{'id':_0x15b27f[_0x97c0('0x20')][_0x97c0('0x6b')]},'include':[{'model':db[_0x1eb0c7+_0x97c0('0x6c')],'as':'Interaction'},{'model':db[_0x1eb0c7+_0x6b955],'as':_0x97c0('0x67')}]});})['then'](function(_0x2db5b0){if(_[_0x97c0('0x12')](_0x2db5b0)){throw new Error(_0x1eb0c7+'\x20Message\x20not\x20found');}_0x3c4c8e=_0x2db5b0;return _0x2db5b0[_0x97c0('0x7b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x97c0('0x18')](function(){var _0x1419cd={'uniqueid':_0x2f9ffe+'.'+_0x3c4c8e['id']+'.'+_0x3c4c8e[_0x97c0('0x6c')]['id'],'FromUserId':_0x15b27f[_0x97c0('0x30')]['id'],'type':_0x97c0('0x74'),'ToUserId':_0x1b2e52['id']};_0x1419cd[_0x1eb0c7+_0x97c0('0x7c')]=_0x3c4c8e['id'];_0x1419cd[_0x1eb0c7+_0x97c0('0x6e')]=_0x3c4c8e['Interaction']['id'];_0x1419cd[_0x97c0('0x6f')+_0x1eb0c7+_0x6b955+'Id']=_0x3c4c8e[_0x97c0('0x67')]['id'];return db[_0x1eb0c7+_0x97c0('0x71')]['create'](_0x1419cd);})['then'](function(){return respondWithRpcPromise(_0x97c0('0x73'),{'channel':_0x2f9ffe,'interaction':_0x3c4c8e[_0x97c0('0x6c')],'message':_0x3c4c8e,'account':_0x3c4c8e[_0x97c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0x97c0('0x7d'),'appdata':_0x1b2e52[_0x97c0('0x10')]+','+(_0x3c4c8e[_0x97c0('0x67')][_0x97c0('0x7e')]||0x12c),'interval':_0x97c0('0x76')}]},routingClient);})[_0x97c0('0x18')](respondWithResult(_0x1cc32c,null))[_0x97c0('0xc')](handleError(_0x1cc32c,null));}; \ No newline at end of file +var _0xf494=['WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','MessageId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','messageId','update','InteractionId','From','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','message','status','json','sendStatus','stack','name','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xf494,0x1c6));var _0x4f49=function(_0x1b619d,_0x4fd4bf){_0x1b619d=_0x1b619d-0x0;var _0x410690=_0xf494[_0x1b619d];return _0x410690;};'use strict';var BPromise=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));var _=require(_0x4f49('0x2'));var util=require('util');var db=require(_0x4f49('0x3'))['db'];var logger=require(_0x4f49('0x4'))(_0x4f49('0x5'));var jayson=require(_0x4f49('0x6'));var amiClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232a});var mailClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232b});var routingClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){var _0x31a725=_0x58e9a0?_0x58e9a0:amiClient;return _0x31a725[_0x4f49('0x9')](_0x42b0e8,_0x5eb186)[_0x4f49('0xa')](function(_0x174d0d){if(_0x174d0d[_0x4f49('0xb')]){if(_0x174d0d[_0x4f49('0xb')]['code']===0x1f4){return _0x327bd5(_0x174d0d[_0x4f49('0xb')][_0x4f49('0xc')]);}return _0x169c95(_0x174d0d['error'][_0x4f49('0xc')]);}else{_0x169c95(_0x174d0d['result']);}})['catch'](function(_0x4b9cd3){_0x327bd5(_0x4b9cd3);});});}function respondWithResult(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xc8;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0xd')](_0x4bf89f)[_0x4f49('0xe')](_0x1e1c37);}return _0x12527d[_0x4f49('0xf')](0x194);};}function handleError(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0x1f4;return function(_0xfdb477){logger['error'](_0xfdb477[_0x4f49('0x10')]);if(_0xfdb477[_0x4f49('0x11')]){delete _0xfdb477[_0x4f49('0x11')];}_0x1a0f1e['status'](_0x2f0131)['send'](_0xfdb477);};}function findById(_0x2f0a0d){return function(_0x2ecaaa){if(!_[_0x4f49('0x12')](_0x2f0a0d)&&!_['isNil'](_0x2ecaaa)&&!_[_0x4f49('0x12')](_0x2ecaaa[_0x4f49('0x13')])){return _[_0x4f49('0x14')](_0x2ecaaa['rows'],function(_0x5bb23b){return _0x5bb23b['id']==_0x2f0a0d;});}return null;};}exports['voiceChannels']=function(_0x47f1e8,_0xb2081a){return respondWithRpcPromise(_0x4f49('0x15'),_0x47f1e8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0xb2081a,null))['catch'](handleError(_0xb2081a,null));};exports[_0x4f49('0x17')]=function(_0x2aed27,_0x197a49){return respondWithRpcPromise(_0x4f49('0x18'),_[_0x4f49('0x19')](_0x2aed27['query'],_0x2aed27[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x197a49,null))[_0x4f49('0x1b')](handleError(_0x197a49,null));};exports['voiceChannelStopMixMonitor']=function(_0x40755e,_0x1d70a7){return respondWithRpcPromise(_0x4f49('0x1c'),_[_0x4f49('0x19')](_0x40755e[_0x4f49('0x16')],_0x40755e[_0x4f49('0x1a')]))['then'](respondWithResult(_0x1d70a7,null))['catch'](handleError(_0x1d70a7,null));};exports[_0x4f49('0x1d')]=function(_0x429de7,_0x4fedbb){return respondWithRpcPromise(_0x4f49('0x1e'),_0x429de7[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x4fedbb,null))['catch'](handleError(_0x4fedbb,null));};exports[_0x4f49('0x1f')]=function(_0x2eed1c,_0x298785){return respondWithRpcPromise(_0x4f49('0x1e'),_0x2eed1c[_0x4f49('0x16')])[_0x4f49('0xa')](findById(_0x2eed1c['params']['id']))['then'](respondWithResult(_0x298785,null))[_0x4f49('0x1b')](handleError(_0x298785,null));};exports[_0x4f49('0x20')]=function(_0x605c91,_0x560050){return respondWithRpcPromise(_0x4f49('0x21'),_[_0x4f49('0x19')](_0x605c91[_0x4f49('0x22')],_0x605c91['params']))['then'](respondWithResult(_0x560050,null))[_0x4f49('0x1b')](handleError(_0x560050,null));};exports[_0x4f49('0x23')]=function(_0x7a6ea0,_0x5e7076){return respondWithRpcPromise(_0x4f49('0x24'),_[_0x4f49('0x19')](_0x7a6ea0[_0x4f49('0x16')],_0x7a6ea0[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x5e7076,null))[_0x4f49('0x1b')](handleError(_0x5e7076,null));};exports[_0x4f49('0x25')]=function(_0x45ae19,_0x1f38d3){return respondWithRpcPromise(_0x4f49('0x26'),_0x45ae19[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f38d3,null))[_0x4f49('0x1b')](handleError(_0x1f38d3,null));};exports[_0x4f49('0x27')]=function(_0x135d17,_0x97ef98){return respondWithRpcPromise(_0x4f49('0x28'),_[_0x4f49('0x19')](_0x135d17[_0x4f49('0x16')],_0x135d17['params']))[_0x4f49('0xa')](respondWithResult(_0x97ef98,null))[_0x4f49('0x1b')](handleError(_0x97ef98,null));};exports[_0x4f49('0x29')]=function(_0x1cb3cc,_0x1c3af8){return respondWithRpcPromise(_0x4f49('0x2a'),_[_0x4f49('0x19')](_0x1cb3cc[_0x4f49('0x16')],_0x1cb3cc[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x1c3af8,null))[_0x4f49('0x1b')](handleError(_0x1c3af8,null));};exports[_0x4f49('0x2b')]=function(_0x3ec6c4,_0x4d2d57){return respondWithRpcPromise(_0x4f49('0x2c'),_[_0x4f49('0x19')](_0x3ec6c4[_0x4f49('0x16')],_0x3ec6c4[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x4d2d57,null))[_0x4f49('0x1b')](handleError(_0x4d2d57,null));};exports[_0x4f49('0x2d')]=function(_0x25fdf8,_0x10bfc4){return respondWithRpcPromise(_0x4f49('0x2e'),_0x25fdf8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x10bfc4,null))[_0x4f49('0x1b')](handleError(_0x10bfc4,null));};exports[_0x4f49('0x2f')]=function(_0x4e3f72,_0x802f20){return respondWithRpcPromise(_0x4f49('0x30'),_0x4e3f72['query'])[_0x4f49('0xa')](respondWithResult(_0x802f20,null))[_0x4f49('0x1b')](handleError(_0x802f20,null));};exports['agents']=function(_0x29e762,_0x1dd1a6){var _0x2548ad;return respondWithRpcPromise(_0x4f49('0x31'),_0x29e762[_0x4f49('0x16')])[_0x4f49('0xa')](function(_0x29e910){_0x2548ad=_0x29e910;return respondWithRpcPromise('Agents',_0x29e762['query'],routingClient);})['then'](function(_0x15e4b3){return _[_0x4f49('0x19')]({},_0x15e4b3,_0x2548ad);})[_0x4f49('0xa')](respondWithResult(_0x1dd1a6,null))[_0x4f49('0x1b')](handleError(_0x1dd1a6,null));};exports[_0x4f49('0x32')]=function(_0x1ecf6c,_0x38aff8){if(_0x1ecf6c[_0x4f49('0x22')]&&_0x1ecf6c[_0x4f49('0x22')]['interaction']&&_0x1ecf6c['user']&&_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]){for(var _0x159642 in _0x1ecf6c['body'][_0x4f49('0x34')]){if(_0x1ecf6c['body']['interaction'][_0x4f49('0x35')](_0x159642)){db[_0x4f49('0x36')][_0x4f49('0x37')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'exitAt':null,'uniqueid':_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642]&&_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')]?{'$notIn':_0x1ecf6c[_0x4f49('0x22')]['interaction'][_0x159642]}:{'$ne':null}}})[_0x4f49('0xa')](function(_0x1e5f0b){var _0x33bb04=moment()[_0x4f49('0x3a')](_0x4f49('0x3b'));for(var _0x1c41e4=0x0,_0xe66867=_0x1e5f0b[_0x4f49('0x39')];_0x1c41e4<_0xe66867;_0x1c41e4+=0x1){_0x1e5f0b[_0x1c41e4][_0x4f49('0x3c')]({'exitAt':_0x33bb04});}});for(var _0x157a55=0x0;_0x157a55<_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')];_0x157a55+=0x1){db['MemberReport'][_0x4f49('0x3d')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'uniqueid':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x34')][_0x159642][_0x157a55],'exitAt':null},'defaults':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'interface':_[_0x4f49('0x12')](_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')])?util[_0x4f49('0x3a')](_0x4f49('0x3f'),_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]):_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')],'type':_0x4f49('0x38'),'enterAt':moment()[_0x4f49('0x3a')](_0x4f49('0x3b')),'role':_0x4f49('0x40'),'internal':_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x41')],'uniqueid':_0x1ecf6c['body']['interaction'][_0x159642][_0x157a55]}});}}}}return respondWithRpcPromise(_0x4f49('0x42'),{'id':_0x1ecf6c[_0x4f49('0x1a')]['id'],'capacity':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x43')]},routingClient)[_0x4f49('0xa')](respondWithResult(_0x38aff8,null))[_0x4f49('0x1b')](handleError(_0x38aff8,null));};exports[_0x4f49('0x44')]=function(_0x51c756,_0x6637f4){return respondWithRpcPromise('Telephones',_0x51c756[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x6637f4,null))[_0x4f49('0x1b')](handleError(_0x6637f4,null));};exports[_0x4f49('0x45')]=function(_0x586095,_0x342980){return respondWithRpcPromise('Trunks',_0x586095['query'])[_0x4f49('0xa')](respondWithResult(_0x342980,null))[_0x4f49('0x1b')](handleError(_0x342980,null));};exports[_0x4f49('0x46')]=function(_0x26ae33,_0x56375a){return respondWithRpcPromise('Campaigns',_0x26ae33[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x56375a,null))['catch'](handleError(_0x56375a,null));};exports[_0x4f49('0x47')]=function(_0x5b50bc,_0x5a929a){return respondWithRpcPromise(_0x4f49('0x48'),_0x5b50bc['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5a929a,null))['catch'](handleError(_0x5a929a,null));};exports[_0x4f49('0x49')]=function(_0x38a640,_0x2472c9){return respondWithRpcPromise(_0x4f49('0x48'),_0x38a640[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x38a640[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x2472c9,null))['catch'](handleError(_0x2472c9,null));};exports[_0x4f49('0x4a')]=function(_0x51f57e,_0x213608){return respondWithRpcPromise(_0x4f49('0x4b'),_0x51f57e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x213608,null))[_0x4f49('0x1b')](handleError(_0x213608,null));};exports[_0x4f49('0x4c')]=function(_0x553981,_0x426c50){return respondWithRpcPromise(_0x4f49('0x4b'),_0x553981['query'],routingClient)['then'](findById(_0x553981[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x426c50,null))[_0x4f49('0x1b')](handleError(_0x426c50,null));};exports[_0x4f49('0x4d')]=function(_0x19a788,_0x4af08d){return respondWithRpcPromise(_0x4f49('0x4e'),_0x19a788['query'],mailClient)[_0x4f49('0xa')](respondWithResult(_0x4af08d,null))[_0x4f49('0x1b')](handleError(_0x4af08d,null));};exports[_0x4f49('0x4f')]=function(_0x4aae7c,_0x1dade6){return respondWithRpcPromise(_0x4f49('0x50'),_0x4aae7c[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x1dade6,null))['catch'](handleError(_0x1dade6,null));};exports[_0x4f49('0x51')]=function(_0x269564,_0x5e6898){return respondWithRpcPromise(_0x4f49('0x50'),_0x269564[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x269564[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x5e6898,null))[_0x4f49('0x1b')](handleError(_0x5e6898,null));};exports[_0x4f49('0x52')]=function(_0x30fc21,_0x519721){return respondWithRpcPromise(_0x4f49('0x53'),_0x30fc21[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x519721,null))[_0x4f49('0x1b')](handleError(_0x519721,null));};exports[_0x4f49('0x54')]=function(_0x26b022,_0x335875){return respondWithRpcPromise('SmsQueues',_0x26b022[_0x4f49('0x16')],routingClient)['then'](findById(_0x26b022[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x335875,null))[_0x4f49('0x1b')](handleError(_0x335875,null));};exports[_0x4f49('0x55')]=function(_0xc7743e,_0x3f2f3f){return respondWithRpcPromise(_0x4f49('0x56'),_0xc7743e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x3f2f3f,null))[_0x4f49('0x1b')](handleError(_0x3f2f3f,null));};exports['showWhatsappQueues']=function(_0x2f9f2e,_0x141554){return respondWithRpcPromise(_0x4f49('0x56'),_0x2f9f2e[_0x4f49('0x16')],routingClient)['then'](findById(_0x2f9f2e['params']['id']))[_0x4f49('0xa')](respondWithResult(_0x141554,null))['catch'](handleError(_0x141554,null));};exports[_0x4f49('0x57')]=function(_0x287705,_0x43bdde){return respondWithRpcPromise(_0x4f49('0x58'),_0x287705[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x43bdde,null))[_0x4f49('0x1b')](handleError(_0x43bdde,null));};exports[_0x4f49('0x59')]=function(_0x3823f0,_0x3e9b47){return respondWithRpcPromise(_0x4f49('0x58'),_0x3823f0[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x3823f0[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x3e9b47,null))[_0x4f49('0x1b')](handleError(_0x3e9b47,null));};exports[_0x4f49('0x5a')]=function(_0x753863,_0x1f9161){return respondWithRpcPromise(_0x4f49('0x5b'),_0x753863[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f9161,null))[_0x4f49('0x1b')](handleError(_0x1f9161,null));};exports[_0x4f49('0x5c')]=function(_0x2d0990,_0x49a79d){return respondWithRpcPromise(_0x4f49('0x5d'),_0x2d0990['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x49a79d,null))[_0x4f49('0x1b')](handleError(_0x49a79d,null));};exports[_0x4f49('0x5e')]=function(_0x3c0f69,_0x26de18){return respondWithRpcPromise(_0x4f49('0x5f'),_0x3c0f69[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x26de18,null))[_0x4f49('0x1b')](handleError(_0x26de18,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x4b6ef4,_0x539e21){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4b6ef4[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x539e21,null))[_0x4f49('0x1b')](handleError(_0x539e21,null));};exports[_0x4f49('0x60')]=function(_0x1fc88a,_0x5a8b1c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1fc88a[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](function(_0x4bdd1b){if(_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')]!==undefined){var _0x5c824f=_(_0x4bdd1b[_0x4f49('0x13')])['filter']([_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')],_0x1fc88a['params']['id']])[_0x4f49('0x62')](_0x4f49('0x63'))[_0x4f49('0x64')]()[_0x4f49('0x65')]();return _0x4bdd1b[_0x4f49('0x13')][_0x4f49('0x66')](function(_0x5f0dbf){return _0x5c824f[_0x4f49('0x67')](_0x5f0dbf['queue_id'])>-0x1;});}else{return _0x4bdd1b[_0x4f49('0x13')]['filter'](function(_0x50c06e){return _0x50c06e['queue_id']===parseInt(_0x1fc88a[_0x4f49('0x1a')]['id']);});}})[_0x4f49('0xa')](respondWithResult(_0x5a8b1c,null))[_0x4f49('0x1b')](handleError(_0x5a8b1c,null));};exports[_0x4f49('0x68')]=function(_0x47af99,_0x39024d){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x47af99[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x39024d,null))[_0x4f49('0x1b')](handleError(_0x39024d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x4938a6,_0x329a49){return respondWithRpcPromise(_0x4f49('0x69'),_0x4938a6[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x329a49,null))[_0x4f49('0x1b')](handleError(_0x329a49,null));};exports[_0x4f49('0x6a')]=function(_0x5c33c9,_0x5d52ae){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5c33c9[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5d52ae,null))[_0x4f49('0x1b')](handleError(_0x5d52ae,null));};exports[_0x4f49('0x6b')]=function(_0x1643fc){return function(_0x517144,_0x15b7e4){var _0x1b922e,_0x29de92;var _0x58d07e=_[_0x4f49('0x6c')](_0x1643fc);var _0x34843a=_0x1643fc===_0x4f49('0x6d')?_0x4f49('0x6e'):'Account';return db[_0x58d07e+_0x4f49('0x6f')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x517144[_0x4f49('0x1a')]['id']}})[_0x4f49('0xa')](function(_0x389679){if(_['isNil'](_0x389679)){throw new Error(_0x58d07e+_0x4f49('0x71'));}_0x1b922e=_0x389679;return db[_0x58d07e+_0x4f49('0x72')]['findOne']({'where':{'id':_0x517144[_0x4f49('0x22')]['messageId']},'include':[{'model':db[_0x58d07e+_0x4f49('0x73')],'as':'Interaction'},{'model':db[_0x58d07e+_0x34843a],'as':_0x4f49('0x74')}]});})[_0x4f49('0xa')](function(_0x2ef19e){if(_[_0x4f49('0x12')](_0x2ef19e)){throw new Error(_0x58d07e+_0x4f49('0x75'));}_0x29de92=_0x2ef19e;return _0x2ef19e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4f49('0xa')](function(){var _0x1f3556={'uniqueid':_0x1643fc+'.'+_0x29de92['id']+'.'+_0x29de92[_0x4f49('0x73')]['id'],'FromUserId':_0x517144[_0x4f49('0x33')]['id'],'type':'queue'};_0x1f3556[_0x58d07e+_0x4f49('0x76')]=_0x29de92['id'];_0x1f3556[_0x58d07e+'InteractionId']=_0x29de92[_0x4f49('0x73')]['id'];_0x1f3556['From'+_0x58d07e+_0x34843a+'Id']=_0x29de92[_0x4f49('0x74')]['id'];_0x1f3556['To'+_0x58d07e+_0x4f49('0x77')]=_0x1b922e['id'];return db[_0x58d07e+_0x4f49('0x78')][_0x4f49('0x79')](_0x1f3556);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x1643fc,'interaction':_0x29de92[_0x4f49('0x73')],'message':_0x29de92,'account':_0x29de92[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4f49('0x7b'),'appdata':_0x1b922e[_0x4f49('0x11')]+','+(_0x29de92['Account'][_0x4f49('0x7c')]||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x15b7e4,null))[_0x4f49('0x1b')](handleError(_0x15b7e4,null));};};exports[_0x4f49('0x7e')]=function(_0x24b033,_0x55b28b){var _0x2ec42b,_0x20a0d4;if(_[_0x4f49('0x12')](_0x24b033[_0x4f49('0x22')]['channel'])){throw new Error(_0x4f49('0x7f'));}var _0x57567a=_0x24b033[_0x4f49('0x22')][_0x4f49('0x80')];var _0x5c5d2=_[_0x4f49('0x6c')](_0x57567a);var _0x4cfb48=_0x57567a===_0x4f49('0x6d')?_0x4f49('0x6e'):_0x4f49('0x74');return db[_0x4f49('0x81')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x24b033[_0x4f49('0x1a')]['id'],'role':_0x4f49('0x40')}})[_0x4f49('0xa')](function(_0x355787){if(_[_0x4f49('0x12')](_0x355787)){throw new Error(_0x4f49('0x82'));}_0x2ec42b=_0x355787;return db[_0x5c5d2+_0x4f49('0x72')][_0x4f49('0x70')]({'where':{'id':_0x24b033[_0x4f49('0x22')][_0x4f49('0x83')]},'include':[{'model':db[_0x5c5d2+_0x4f49('0x73')],'as':_0x4f49('0x73')},{'model':db[_0x5c5d2+_0x4cfb48],'as':_0x4f49('0x74')}]});})['then'](function(_0x1979ef){if(_[_0x4f49('0x12')](_0x1979ef)){throw new Error(_0x5c5d2+_0x4f49('0x75'));}_0x20a0d4=_0x1979ef;return _0x1979ef[_0x4f49('0x84')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x225e63={'uniqueid':_0x57567a+'.'+_0x20a0d4['id']+'.'+_0x20a0d4[_0x4f49('0x73')]['id'],'FromUserId':_0x24b033['user']['id'],'type':_0x4f49('0x7b'),'ToUserId':_0x2ec42b['id']};_0x225e63[_0x5c5d2+'MessageId']=_0x20a0d4['id'];_0x225e63[_0x5c5d2+_0x4f49('0x85')]=_0x20a0d4[_0x4f49('0x73')]['id'];_0x225e63[_0x4f49('0x86')+_0x5c5d2+_0x4cfb48+'Id']=_0x20a0d4[_0x4f49('0x74')]['id'];return db[_0x5c5d2+_0x4f49('0x78')][_0x4f49('0x79')](_0x225e63);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x57567a,'interaction':_0x20a0d4[_0x4f49('0x73')],'message':_0x20a0d4,'account':_0x20a0d4[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2ec42b['name']+','+(_0x20a0d4[_0x4f49('0x74')]['agentTransferTimeout']||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x55b28b,null))['catch'](handleError(_0x55b28b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 2b0e1e7..74e4352 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 _0x5362=['fs-extra','../../components/auth/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3cc82b,_0x259747){var _0x4d2e83=function(_0x485795){while(--_0x485795){_0x3cc82b['push'](_0x3cc82b['shift']());}};_0x4d2e83(++_0x259747);}(_0x5362,0xaa));var _0x2536=function(_0x1d8d83,_0x5c58da){_0x1d8d83=_0x1d8d83-0x0;var _0x13a3a5=_0x5362[_0x1d8d83];return _0x13a3a5;};'use strict';var multer=require(_0x2536('0x0'));var util=require(_0x2536('0x1'));var path=require(_0x2536('0x2'));var timeout=require(_0x2536('0x3'));var express=require(_0x2536('0x4'));var router=express[_0x2536('0x5')]();var fs_extra=require(_0x2536('0x6'));var auth=require(_0x2536('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2536('0x8'));router[_0x2536('0x9')]('/',auth[_0x2536('0xa')](),controller[_0x2536('0xb')]);router[_0x2536('0x9')](_0x2536('0xc'),auth['isAuthenticated'](),controller[_0x2536('0xd')]);router[_0x2536('0x9')](_0x2536('0xe'),auth[_0x2536('0xa')](),controller['run']);router[_0x2536('0xf')]('/',auth['isAuthenticated'](),controller[_0x2536('0x10')]);router[_0x2536('0x11')](_0x2536('0xc'),auth['isAuthenticated'](),controller[_0x2536('0x12')]);router[_0x2536('0x13')](_0x2536('0xc'),auth[_0x2536('0xa')](),controller[_0x2536('0x14')]);module[_0x2536('0x15')]=router; \ No newline at end of file +var _0x6a69=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/run','run','post'];(function(_0x4d275d,_0x4073e6){var _0x357e89=function(_0x404229){while(--_0x404229){_0x4d275d['push'](_0x4d275d['shift']());}};_0x357e89(++_0x4073e6);}(_0x6a69,0x131));var _0x96a6=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x6a69[_0x245afe];return _0x4eefde;};'use strict';var multer=require(_0x96a6('0x0'));var util=require(_0x96a6('0x1'));var path=require(_0x96a6('0x2'));var timeout=require(_0x96a6('0x3'));var express=require(_0x96a6('0x4'));var router=express['Router']();var fs_extra=require(_0x96a6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x96a6('0x6'));var config=require(_0x96a6('0x7'));var controller=require('./schedule.controller');router[_0x96a6('0x8')]('/',auth[_0x96a6('0x9')](),controller['index']);router[_0x96a6('0x8')](_0x96a6('0xa'),auth[_0x96a6('0x9')](),controller[_0x96a6('0xb')]);router[_0x96a6('0x8')](_0x96a6('0xc'),auth[_0x96a6('0x9')](),controller[_0x96a6('0xd')]);router[_0x96a6('0xe')]('/',auth['isAuthenticated'](),controller[_0x96a6('0xf')]);router['put'](_0x96a6('0xa'),auth[_0x96a6('0x9')](),controller[_0x96a6('0x10')]);router[_0x96a6('0x11')](_0x96a6('0xa'),auth['isAuthenticated'](),controller[_0x96a6('0x12')]);module[_0x96a6('0x13')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2200f51..bd5abd5 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 _0x4520=['ENUM','quarters','months','weeks','minutes','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER'];(function(_0x19a054,_0x425971){var _0x453c7a=function(_0x51e196){while(--_0x51e196){_0x19a054['push'](_0x19a054['shift']());}};_0x453c7a(++_0x425971);}(_0x4520,0xf0));var _0x0452=function(_0x3f882b,_0x2225b9){_0x3f882b=_0x3f882b-0x0;var _0x545495=_0x4520[_0x3f882b];return _0x545495;};'use strict';var Sequelize=require(_0x0452('0x0'));module[_0x0452('0x1')]={'name':{'type':Sequelize[_0x0452('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0452('0x2')]},'active':{'type':Sequelize[_0x0452('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0452('0x2')],'allowNull':![],'defaultValue':_0x0452('0x4')},'startAt':{'type':Sequelize[_0x0452('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x0452('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0452('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0452('0x7')]('years',_0x0452('0x8'),_0x0452('0x9'),_0x0452('0xa'),'days','hours',_0x0452('0xb')),'allowNull':![],'defaultValue':_0x0452('0xc')},'output':{'type':Sequelize[_0x0452('0x7')](_0x0452('0xd'),_0x0452('0xe'),_0x0452('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x0452('0x10'),_0x0452('0x11')),'allowNull':![],'defaultValue':_0x0452('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x0452('0x2')]},'cc':{'type':Sequelize[_0x0452('0x12')]},'bcc':{'type':Sequelize[_0x0452('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9a00=['quarters','months','weeks','days','hours','minutes','csv','xlsx','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x15a8e1,_0x21e63d){var _0x185130=function(_0x53fa48){while(--_0x53fa48){_0x15a8e1['push'](_0x15a8e1['shift']());}};_0x185130(++_0x21e63d);}(_0x9a00,0xbe));var _0x09a0=function(_0x212f45,_0x1d876c){_0x212f45=_0x212f45-0x0;var _0x383417=_0x9a00[_0x212f45];return _0x383417;};'use strict';var Sequelize=require('sequelize');module[_0x09a0('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x09a0('0x1')]},'active':{'type':Sequelize[_0x09a0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x09a0('0x1')],'allowNull':![],'defaultValue':_0x09a0('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x09a0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x09a0('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x09a0('0x6')](_0x09a0('0x7'),_0x09a0('0x8'),_0x09a0('0x9'),_0x09a0('0xa'),_0x09a0('0xb'),_0x09a0('0xc'),_0x09a0('0xd')),'allowNull':![],'defaultValue':_0x09a0('0xb')},'output':{'type':Sequelize['ENUM'](_0x09a0('0xe'),'pdf',_0x09a0('0xf')),'allowNull':![],'defaultValue':_0x09a0('0xe')},'type':{'type':Sequelize[_0x09a0('0x6')](_0x09a0('0x10'),'default'),'allowNull':![],'defaultValue':_0x09a0('0x10')},'sendMail':{'type':Sequelize[_0x09a0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x09a0('0x1')]},'cc':{'type':Sequelize[_0x09a0('0x11')]},'bcc':{'type':Sequelize[_0x09a0('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x09a0('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index c875240..acc39e6 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 _0xddc0=['fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','Scheduler','UserProfileResource','stack','name','index','rawAttributes'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xddc0,0x7b));var _0x0ddc=function(_0x22c50e,_0x4ea131){_0x22c50e=_0x22c50e-0x0;var _0x500f85=_0xddc0[_0x22c50e];return _0x500f85;};'use strict';var emlformat=require(_0x0ddc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ddc('0x1'));var jsonpatch=require(_0x0ddc('0x2'));var rp=require('request-promise');var moment=require(_0x0ddc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0ddc('0x4'));var path=require(_0x0ddc('0x5'));var sox=require(_0x0ddc('0x6'));var csv=require(_0x0ddc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ddc('0x8'));var _=require(_0x0ddc('0x9'));var squel=require(_0x0ddc('0xa'));var crypto=require(_0x0ddc('0xb'));var jsforce=require(_0x0ddc('0xc'));var deskjs=require(_0x0ddc('0xd'));var toCsv=require(_0x0ddc('0x7'));var querystring=require(_0x0ddc('0xe'));var Papa=require(_0x0ddc('0xf'));var Redis=require(_0x0ddc('0x10'));var authService=require(_0x0ddc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ddc('0x12'))(_0x0ddc('0x13'));var utils=require(_0x0ddc('0x14'));var config=require(_0x0ddc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ddc('0x16'))['db'];function respondWithStatusCode(_0x58a455,_0x56a1e6){_0x56a1e6=_0x56a1e6||0xcc;return function(_0x3683d2){if(_0x3683d2){return _0x58a455[_0x0ddc('0x17')](_0x56a1e6);}return _0x58a455['status'](_0x56a1e6)[_0x0ddc('0x18')]();};}function respondWithResult(_0x3c2b1d,_0x4e294a){_0x4e294a=_0x4e294a||0xc8;return function(_0x2e29b0){if(_0x2e29b0){return _0x3c2b1d[_0x0ddc('0x19')](_0x4e294a)[_0x0ddc('0x1a')](_0x2e29b0);}};}function respondWithFilteredResult(_0x4abcff,_0x2f6936){return function(_0x18da79){if(_0x18da79){var _0x87c36a=typeof _0x2f6936[_0x0ddc('0x1b')]===_0x0ddc('0x1c')&&typeof _0x2f6936[_0x0ddc('0x1d')]==='undefined';var _0x320258=_0x18da79[_0x0ddc('0x1e')];var _0x3ff67a=_0x87c36a?0x0:_0x2f6936[_0x0ddc('0x1b')];var _0x315116=_0x87c36a?_0x18da79[_0x0ddc('0x1e')]:_0x2f6936['offset']+_0x2f6936[_0x0ddc('0x1d')];var _0x34c513;if(_0x315116>=_0x320258){_0x315116=_0x320258;_0x34c513=0xc8;}else{_0x34c513=0xce;}_0x4abcff[_0x0ddc('0x19')](_0x34c513);return _0x4abcff[_0x0ddc('0x1f')](_0x0ddc('0x20'),_0x3ff67a+'-'+_0x315116+'/'+_0x320258)[_0x0ddc('0x1a')](_0x18da79);}return null;};}function patchUpdates(_0x4e72ae){return function(_0x281adc){try{jsonpatch['apply'](_0x281adc,_0x4e72ae,!![]);}catch(_0xcafd17){return BPromise[_0x0ddc('0x21')](_0xcafd17);}return _0x281adc['save']();};}function saveUpdates(_0xd7a48,_0xe7bfcd){return function(_0x49b3c0){if(_0x49b3c0){return _0x49b3c0[_0x0ddc('0x22')](_0xd7a48)[_0x0ddc('0x23')](function(_0x334503){return _0x334503;});}return null;};}function removeEntity(_0x351e06,_0x8482cc){return function(_0x5d7290){if(_0x5d7290){return _0x5d7290[_0x0ddc('0x24')]()['then'](function(){var _0x31861d=_0x5d7290['get']({'plain':!![]});var _0x41bcbd=_0x0ddc('0x25');return db[_0x0ddc('0x26')]['destroy']({'where':{'type':_0x41bcbd,'resourceId':_0x31861d['id']}})['then'](function(){return _0x5d7290;});})[_0x0ddc('0x23')](function(){_0x351e06[_0x0ddc('0x19')](0xcc)[_0x0ddc('0x18')]();});}};}function handleEntityNotFound(_0x54d60b,_0x41cd6a){return function(_0x38f3f1){if(!_0x38f3f1){_0x54d60b[_0x0ddc('0x17')](0x194);}return _0x38f3f1;};}function handleError(_0x39a7b7,_0x4ede0b){_0x4ede0b=_0x4ede0b||0x1f4;return function(_0x390248){logger['error'](_0x390248[_0x0ddc('0x27')]);if(_0x390248[_0x0ddc('0x28')]){delete _0x390248[_0x0ddc('0x28')];}_0x39a7b7['status'](_0x4ede0b)['send'](_0x390248);};}exports[_0x0ddc('0x29')]=function(_0x5e8d53,_0x11d0fe){var _0x49877b={},_0x47ce14={},_0x19917e={'count':0x0,'rows':[]};var _0x6ddd87=_['map'](db['Schedule'][_0x0ddc('0x2a')],function(_0x4cdf6e){return{'name':_0x4cdf6e[_0x0ddc('0x2b')],'type':_0x4cdf6e['type']['key']};});_0x47ce14[_0x0ddc('0x2c')]=_[_0x0ddc('0x2d')](_0x6ddd87,_0x0ddc('0x28'));_0x47ce14[_0x0ddc('0x2e')]=_[_0x0ddc('0x2f')](_0x5e8d53['query']);_0x47ce14['filters']=_[_0x0ddc('0x30')](_0x47ce14['model'],_0x47ce14[_0x0ddc('0x2e')]);_0x49877b[_0x0ddc('0x31')]=_[_0x0ddc('0x30')](_0x47ce14[_0x0ddc('0x2c')],qs[_0x0ddc('0x32')](_0x5e8d53['query'][_0x0ddc('0x32')]));_0x49877b['attributes']=_0x49877b[_0x0ddc('0x31')][_0x0ddc('0x33')]?_0x49877b[_0x0ddc('0x31')]:_0x47ce14[_0x0ddc('0x2c')];if(!_0x5e8d53[_0x0ddc('0x2e')][_0x0ddc('0x34')](_0x0ddc('0x35'))){_0x49877b[_0x0ddc('0x1d')]=qs[_0x0ddc('0x1d')](_0x5e8d53[_0x0ddc('0x2e')][_0x0ddc('0x1d')]);_0x49877b['offset']=qs[_0x0ddc('0x1b')](_0x5e8d53[_0x0ddc('0x2e')][_0x0ddc('0x1b')]);}_0x49877b[_0x0ddc('0x36')]=qs[_0x0ddc('0x37')](_0x5e8d53['query'][_0x0ddc('0x37')]);_0x49877b['where']=qs[_0x0ddc('0x38')](_['pick'](_0x5e8d53[_0x0ddc('0x2e')],_0x47ce14[_0x0ddc('0x38')]),_0x6ddd87);if(_0x5e8d53['query'][_0x0ddc('0x39')]){_0x49877b[_0x0ddc('0x3a')]=_[_0x0ddc('0x3b')](_0x49877b[_0x0ddc('0x3a')],{'$or':_[_0x0ddc('0x2d')](_0x6ddd87,function(_0x1c20cd){if(_0x1c20cd[_0x0ddc('0x3c')]!==_0x0ddc('0x3d')){var _0x25e1f3={};_0x25e1f3[_0x1c20cd[_0x0ddc('0x28')]]={'$like':'%'+_0x5e8d53[_0x0ddc('0x2e')][_0x0ddc('0x39')]+'%'};return _0x25e1f3;}})});}_0x49877b=_[_0x0ddc('0x3b')]({},_0x49877b,_0x5e8d53[_0x0ddc('0x3e')]);var _0x1fa7ee={'where':_0x49877b[_0x0ddc('0x3a')]};return db[_0x0ddc('0x3f')][_0x0ddc('0x1e')](_0x1fa7ee)[_0x0ddc('0x23')](function(_0x470550){_0x19917e[_0x0ddc('0x1e')]=_0x470550;if(_0x5e8d53[_0x0ddc('0x2e')][_0x0ddc('0x40')]){_0x49877b[_0x0ddc('0x41')]=[{'all':!![]}];}return db[_0x0ddc('0x3f')][_0x0ddc('0x42')](_0x49877b);})[_0x0ddc('0x23')](function(_0x3e486d){_0x19917e[_0x0ddc('0x43')]=_0x3e486d;return _0x19917e;})[_0x0ddc('0x23')](respondWithFilteredResult(_0x11d0fe,_0x49877b))[_0x0ddc('0x44')](handleError(_0x11d0fe,null));};exports[_0x0ddc('0x45')]=function(_0x3d3c53,_0x6f4c1e){var _0x4bda55={'raw':![],'where':{'id':_0x3d3c53[_0x0ddc('0x46')]['id']}},_0x3346ef={};_0x3346ef[_0x0ddc('0x2c')]=_[_0x0ddc('0x2f')](db[_0x0ddc('0x3f')][_0x0ddc('0x2a')]);_0x3346ef[_0x0ddc('0x2e')]=_[_0x0ddc('0x2f')](_0x3d3c53[_0x0ddc('0x2e')]);_0x3346ef['filters']=_[_0x0ddc('0x30')](_0x3346ef['model'],_0x3346ef[_0x0ddc('0x2e')]);_0x4bda55[_0x0ddc('0x31')]=_[_0x0ddc('0x30')](_0x3346ef[_0x0ddc('0x2c')],qs['fields'](_0x3d3c53['query']['fields']));_0x4bda55['attributes']=_0x4bda55[_0x0ddc('0x31')]['length']?_0x4bda55[_0x0ddc('0x31')]:_0x3346ef['model'];if(_0x3d3c53['query'][_0x0ddc('0x40')]){_0x4bda55[_0x0ddc('0x41')]=[{'all':!![]}];}_0x4bda55=_[_0x0ddc('0x3b')]({},_0x4bda55,_0x3d3c53[_0x0ddc('0x3e')]);return db[_0x0ddc('0x3f')]['find'](_0x4bda55)[_0x0ddc('0x23')](handleEntityNotFound(_0x6f4c1e,null))[_0x0ddc('0x23')](respondWithResult(_0x6f4c1e,null))[_0x0ddc('0x44')](handleError(_0x6f4c1e,null));};exports[_0x0ddc('0x47')]=function(_0x39f102,_0x2a1190){return db[_0x0ddc('0x3f')]['create'](_0x39f102[_0x0ddc('0x48')],{})[_0x0ddc('0x23')](function(_0x156978){var _0x18fbf8=_0x39f102[_0x0ddc('0x49')][_0x0ddc('0x4a')]({'plain':!![]});if(!_0x18fbf8)throw new Error(_0x0ddc('0x4b'));if(_0x18fbf8['role']==='user'){var _0x434385=_0x156978[_0x0ddc('0x4a')]({'plain':!![]});var _0x5e3412=_0x0ddc('0x25');return db[_0x0ddc('0x4c')][_0x0ddc('0x4d')]({'where':{'name':_0x5e3412,'userProfileId':_0x18fbf8[_0x0ddc('0x4e')]},'raw':!![]})[_0x0ddc('0x23')](function(_0xc1b5c6){if(_0xc1b5c6&&_0xc1b5c6[_0x0ddc('0x4f')]===0x0){return db[_0x0ddc('0x26')]['create']({'name':_0x434385[_0x0ddc('0x28')],'resourceId':_0x434385['id'],'type':_0xc1b5c6[_0x0ddc('0x28')],'sectionId':_0xc1b5c6['id']},{})[_0x0ddc('0x23')](function(){return _0x156978;});}else{return _0x156978;}})[_0x0ddc('0x44')](function(_0x390718){logger[_0x0ddc('0x50')](_0x0ddc('0x51'),_0x390718);throw _0x390718;});}return _0x156978;})['then'](respondWithResult(_0x2a1190,0xc9))[_0x0ddc('0x44')](handleError(_0x2a1190,null));};exports[_0x0ddc('0x22')]=function(_0x2d3777,_0x2dc892){if(_0x2d3777['body']['id']){delete _0x2d3777[_0x0ddc('0x48')]['id'];}return db[_0x0ddc('0x3f')][_0x0ddc('0x4d')]({'where':{'id':_0x2d3777[_0x0ddc('0x46')]['id']}})[_0x0ddc('0x23')](handleEntityNotFound(_0x2dc892,null))[_0x0ddc('0x23')](saveUpdates(_0x2d3777['body'],null))['then'](respondWithResult(_0x2dc892,null))[_0x0ddc('0x44')](handleError(_0x2dc892,null));};exports[_0x0ddc('0x24')]=function(_0x5761a4,_0x34e9bb){return db[_0x0ddc('0x3f')][_0x0ddc('0x4d')]({'where':{'id':_0x5761a4[_0x0ddc('0x46')]['id']}})['then'](handleEntityNotFound(_0x34e9bb,null))['then'](removeEntity(_0x34e9bb,null))[_0x0ddc('0x44')](handleError(_0x34e9bb,null));};exports[_0x0ddc('0x52')]=function(_0x3e976d,_0x42ca38,_0x5a2c24){var _0x2d7a6b=require('../../config/schedule');return db[_0x0ddc('0x3f')]['find']({'where':{'id':_0x3e976d['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x42ca38,null))['then'](function(){_0x2d7a6b[_0x0ddc('0x52')](_0x3e976d[_0x0ddc('0x46')]['id']);})[_0x0ddc('0x23')](respondWithStatusCode(_0x42ca38,null))['catch'](handleError(_0x42ca38,null));}; \ No newline at end of file +var _0x6d32=['merge','type','VIRTUAL','options','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','user','UserProfileSection','autoAssociation','error','params','run','../../config/schedule','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','sendStatus','name','send','index','map','Schedule','rawAttributes','key','model','query','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter'];(function(_0x1018ca,_0x3edaa8){var _0xdd0844=function(_0x5e9e11){while(--_0x5e9e11){_0x1018ca['push'](_0x1018ca['shift']());}};_0xdd0844(++_0x3edaa8);}(_0x6d32,0x1c9));var _0x26d3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d32[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x26d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26d3('0x1'));var jsonpatch=require(_0x26d3('0x2'));var rp=require(_0x26d3('0x3'));var moment=require(_0x26d3('0x4'));var BPromise=require(_0x26d3('0x5'));var Mustache=require(_0x26d3('0x6'));var util=require(_0x26d3('0x7'));var path=require(_0x26d3('0x8'));var sox=require(_0x26d3('0x9'));var csv=require(_0x26d3('0xa'));var ejs=require(_0x26d3('0xb'));var fs=require('fs');var fs_extra=require(_0x26d3('0xc'));var _=require(_0x26d3('0xd'));var squel=require(_0x26d3('0xe'));var crypto=require(_0x26d3('0xf'));var jsforce=require(_0x26d3('0x10'));var deskjs=require(_0x26d3('0x11'));var toCsv=require(_0x26d3('0xa'));var querystring=require('querystring');var Papa=require(_0x26d3('0x12'));var Redis=require(_0x26d3('0x13'));var authService=require(_0x26d3('0x14'));var qs=require(_0x26d3('0x15'));var as=require(_0x26d3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26d3('0x17'))(_0x26d3('0x18'));var utils=require(_0x26d3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x26d3('0x1a'));var db=require(_0x26d3('0x1b'))['db'];function respondWithStatusCode(_0x29216c,_0x3eed87){_0x3eed87=_0x3eed87||0xcc;return function(_0x40cd4e){if(_0x40cd4e){return _0x29216c['sendStatus'](_0x3eed87);}return _0x29216c[_0x26d3('0x1c')](_0x3eed87)[_0x26d3('0x1d')]();};}function respondWithResult(_0x1cfc31,_0x8d8d68){_0x8d8d68=_0x8d8d68||0xc8;return function(_0x2c9fad){if(_0x2c9fad){return _0x1cfc31[_0x26d3('0x1c')](_0x8d8d68)[_0x26d3('0x1e')](_0x2c9fad);}};}function respondWithFilteredResult(_0x4dd835,_0x509f47){return function(_0x27d17e){if(_0x27d17e){var _0x3e6a84=typeof _0x509f47[_0x26d3('0x1f')]===_0x26d3('0x20')&&typeof _0x509f47[_0x26d3('0x21')]===_0x26d3('0x20');var _0x3c27d3=_0x27d17e[_0x26d3('0x22')];var _0x2aaf67=_0x3e6a84?0x0:_0x509f47['offset'];var _0x87647d=_0x3e6a84?_0x27d17e[_0x26d3('0x22')]:_0x509f47[_0x26d3('0x1f')]+_0x509f47[_0x26d3('0x21')];var _0x543b26;if(_0x87647d>=_0x3c27d3){_0x87647d=_0x3c27d3;_0x543b26=0xc8;}else{_0x543b26=0xce;}_0x4dd835[_0x26d3('0x1c')](_0x543b26);return _0x4dd835[_0x26d3('0x23')](_0x26d3('0x24'),_0x2aaf67+'-'+_0x87647d+'/'+_0x3c27d3)[_0x26d3('0x1e')](_0x27d17e);}return null;};}function patchUpdates(_0x1e03cb){return function(_0x467678){try{jsonpatch[_0x26d3('0x25')](_0x467678,_0x1e03cb,!![]);}catch(_0x524cd1){return BPromise[_0x26d3('0x26')](_0x524cd1);}return _0x467678[_0x26d3('0x27')]();};}function saveUpdates(_0x4ff609,_0x3b7a4c){return function(_0x50b220){if(_0x50b220){return _0x50b220[_0x26d3('0x28')](_0x4ff609)[_0x26d3('0x29')](function(_0xff15da){return _0xff15da;});}return null;};}function removeEntity(_0x4e753c,_0x51a1b3){return function(_0x5c9a7a){if(_0x5c9a7a){return _0x5c9a7a['destroy']()[_0x26d3('0x29')](function(){var _0x447e06=_0x5c9a7a[_0x26d3('0x2a')]({'plain':!![]});var _0x1f466c=_0x26d3('0x2b');return db[_0x26d3('0x2c')][_0x26d3('0x2d')]({'where':{'type':_0x1f466c,'resourceId':_0x447e06['id']}})[_0x26d3('0x29')](function(){return _0x5c9a7a;});})[_0x26d3('0x29')](function(){_0x4e753c[_0x26d3('0x1c')](0xcc)[_0x26d3('0x1d')]();});}};}function handleEntityNotFound(_0x3881a2,_0x195675){return function(_0x26c500){if(!_0x26c500){_0x3881a2[_0x26d3('0x2e')](0x194);}return _0x26c500;};}function handleError(_0x352adf,_0x2d830d){_0x2d830d=_0x2d830d||0x1f4;return function(_0x136e07){logger['error'](_0x136e07['stack']);if(_0x136e07[_0x26d3('0x2f')]){delete _0x136e07[_0x26d3('0x2f')];}_0x352adf[_0x26d3('0x1c')](_0x2d830d)[_0x26d3('0x30')](_0x136e07);};}exports[_0x26d3('0x31')]=function(_0x164c5f,_0x28c65b){var _0x849bab={},_0x1e06cc={},_0x2c423e={'count':0x0,'rows':[]};var _0x2c9bf2=_[_0x26d3('0x32')](db[_0x26d3('0x33')][_0x26d3('0x34')],function(_0x4a158b){return{'name':_0x4a158b['fieldName'],'type':_0x4a158b['type'][_0x26d3('0x35')]};});_0x1e06cc[_0x26d3('0x36')]=_[_0x26d3('0x32')](_0x2c9bf2,_0x26d3('0x2f'));_0x1e06cc['query']=_['keys'](_0x164c5f[_0x26d3('0x37')]);_0x1e06cc['filters']=_['intersection'](_0x1e06cc[_0x26d3('0x36')],_0x1e06cc[_0x26d3('0x37')]);_0x849bab[_0x26d3('0x38')]=_[_0x26d3('0x39')](_0x1e06cc[_0x26d3('0x36')],qs[_0x26d3('0x3a')](_0x164c5f[_0x26d3('0x37')]['fields']));_0x849bab[_0x26d3('0x38')]=_0x849bab[_0x26d3('0x38')]['length']?_0x849bab['attributes']:_0x1e06cc[_0x26d3('0x36')];if(!_0x164c5f[_0x26d3('0x37')]['hasOwnProperty'](_0x26d3('0x3b'))){_0x849bab[_0x26d3('0x21')]=qs[_0x26d3('0x21')](_0x164c5f[_0x26d3('0x37')][_0x26d3('0x21')]);_0x849bab['offset']=qs['offset'](_0x164c5f[_0x26d3('0x37')][_0x26d3('0x1f')]);}_0x849bab['order']=qs[_0x26d3('0x3c')](_0x164c5f[_0x26d3('0x37')][_0x26d3('0x3c')]);_0x849bab[_0x26d3('0x3d')]=qs[_0x26d3('0x3e')](_[_0x26d3('0x3f')](_0x164c5f['query'],_0x1e06cc[_0x26d3('0x3e')]),_0x2c9bf2);if(_0x164c5f[_0x26d3('0x37')][_0x26d3('0x40')]){_0x849bab[_0x26d3('0x3d')]=_[_0x26d3('0x41')](_0x849bab['where'],{'$or':_[_0x26d3('0x32')](_0x2c9bf2,function(_0x50142c){if(_0x50142c[_0x26d3('0x42')]!==_0x26d3('0x43')){var _0x4ab009={};_0x4ab009[_0x50142c[_0x26d3('0x2f')]]={'$like':'%'+_0x164c5f[_0x26d3('0x37')]['filter']+'%'};return _0x4ab009;}})});}_0x849bab=_[_0x26d3('0x41')]({},_0x849bab,_0x164c5f[_0x26d3('0x44')]);var _0x26c18c={'where':_0x849bab['where']};return db[_0x26d3('0x33')][_0x26d3('0x22')](_0x26c18c)[_0x26d3('0x29')](function(_0x469267){_0x2c423e[_0x26d3('0x22')]=_0x469267;if(_0x164c5f[_0x26d3('0x37')]['includeAll']){_0x849bab[_0x26d3('0x45')]=[{'all':!![]}];}return db[_0x26d3('0x33')][_0x26d3('0x46')](_0x849bab);})[_0x26d3('0x29')](function(_0x2f8b3f){_0x2c423e[_0x26d3('0x47')]=_0x2f8b3f;return _0x2c423e;})[_0x26d3('0x29')](respondWithFilteredResult(_0x28c65b,_0x849bab))[_0x26d3('0x48')](handleError(_0x28c65b,null));};exports[_0x26d3('0x49')]=function(_0x15178a,_0x308c01){var _0x2e8876={'raw':![],'where':{'id':_0x15178a['params']['id']}},_0x2d3d71={};_0x2d3d71[_0x26d3('0x36')]=_[_0x26d3('0x4a')](db[_0x26d3('0x33')][_0x26d3('0x34')]);_0x2d3d71['query']=_[_0x26d3('0x4a')](_0x15178a[_0x26d3('0x37')]);_0x2d3d71[_0x26d3('0x3e')]=_['intersection'](_0x2d3d71['model'],_0x2d3d71[_0x26d3('0x37')]);_0x2e8876['attributes']=_['intersection'](_0x2d3d71[_0x26d3('0x36')],qs[_0x26d3('0x3a')](_0x15178a['query'][_0x26d3('0x3a')]));_0x2e8876[_0x26d3('0x38')]=_0x2e8876['attributes'][_0x26d3('0x4b')]?_0x2e8876[_0x26d3('0x38')]:_0x2d3d71[_0x26d3('0x36')];if(_0x15178a[_0x26d3('0x37')][_0x26d3('0x4c')]){_0x2e8876[_0x26d3('0x45')]=[{'all':!![]}];}_0x2e8876=_[_0x26d3('0x41')]({},_0x2e8876,_0x15178a[_0x26d3('0x44')]);return db['Schedule'][_0x26d3('0x4d')](_0x2e8876)[_0x26d3('0x29')](handleEntityNotFound(_0x308c01,null))['then'](respondWithResult(_0x308c01,null))[_0x26d3('0x48')](handleError(_0x308c01,null));};exports[_0x26d3('0x4e')]=function(_0x13de91,_0x3a0f38){return db[_0x26d3('0x33')][_0x26d3('0x4e')](_0x13de91[_0x26d3('0x4f')],{})[_0x26d3('0x29')](function(_0xcfaea8){var _0x3ba752=_0x13de91[_0x26d3('0x50')][_0x26d3('0x2a')]({'plain':!![]});if(!_0x3ba752)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ba752['role']===_0x26d3('0x50')){var _0x23418b=_0xcfaea8[_0x26d3('0x2a')]({'plain':!![]});var _0x5dec11=_0x26d3('0x2b');return db[_0x26d3('0x51')][_0x26d3('0x4d')]({'where':{'name':_0x5dec11,'userProfileId':_0x3ba752['userProfileId']},'raw':!![]})[_0x26d3('0x29')](function(_0x284393){if(_0x284393&&_0x284393[_0x26d3('0x52')]===0x0){return db[_0x26d3('0x2c')]['create']({'name':_0x23418b[_0x26d3('0x2f')],'resourceId':_0x23418b['id'],'type':_0x284393[_0x26d3('0x2f')],'sectionId':_0x284393['id']},{})[_0x26d3('0x29')](function(){return _0xcfaea8;});}else{return _0xcfaea8;}})[_0x26d3('0x48')](function(_0x15d6a6){logger[_0x26d3('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15d6a6);throw _0x15d6a6;});}return _0xcfaea8;})[_0x26d3('0x29')](respondWithResult(_0x3a0f38,0xc9))[_0x26d3('0x48')](handleError(_0x3a0f38,null));};exports[_0x26d3('0x28')]=function(_0x40d637,_0x48998d){if(_0x40d637[_0x26d3('0x4f')]['id']){delete _0x40d637[_0x26d3('0x4f')]['id'];}return db[_0x26d3('0x33')][_0x26d3('0x4d')]({'where':{'id':_0x40d637[_0x26d3('0x54')]['id']}})[_0x26d3('0x29')](handleEntityNotFound(_0x48998d,null))['then'](saveUpdates(_0x40d637[_0x26d3('0x4f')],null))[_0x26d3('0x29')](respondWithResult(_0x48998d,null))[_0x26d3('0x48')](handleError(_0x48998d,null));};exports[_0x26d3('0x2d')]=function(_0x25e617,_0x26f1fd){return db[_0x26d3('0x33')]['find']({'where':{'id':_0x25e617[_0x26d3('0x54')]['id']}})[_0x26d3('0x29')](handleEntityNotFound(_0x26f1fd,null))[_0x26d3('0x29')](removeEntity(_0x26f1fd,null))[_0x26d3('0x48')](handleError(_0x26f1fd,null));};exports[_0x26d3('0x55')]=function(_0x2c358f,_0x1bdd92,_0x2859f7){var _0x1e6fd8=require(_0x26d3('0x56'));return db[_0x26d3('0x33')][_0x26d3('0x4d')]({'where':{'id':_0x2c358f['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1bdd92,null))['then'](function(){_0x1e6fd8['run'](_0x2c358f['params']['id']);})[_0x26d3('0x29')](respondWithStatusCode(_0x1bdd92,null))['catch'](handleError(_0x1bdd92,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index ad688c4..3de3ea1 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 _0xede8=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash'];(function(_0x41cb05,_0x5a7ede){var _0x5ed8da=function(_0x376e84){while(--_0x376e84){_0x41cb05['push'](_0x41cb05['shift']());}};_0x5ed8da(++_0x5a7ede);}(_0xede8,0x179));var _0x8ede=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xede8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x8ede('0x0'));var util=require(_0x8ede('0x1'));var logger=require(_0x8ede('0x2'))(_0x8ede('0x3'));var moment=require('moment');var BPromise=require(_0x8ede('0x4'));var rp=require(_0x8ede('0x5'));var fs=require('fs');var path=require(_0x8ede('0x6'));var rimraf=require(_0x8ede('0x7'));var config=require(_0x8ede('0x8'));var attributes=require(_0x8ede('0x9'));module[_0x8ede('0xa')]=function(_0x481e63,_0x51bddb){return _0x481e63[_0x8ede('0xb')](_0x8ede('0xc'),attributes,{'tableName':_0x8ede('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b46=['define','Schedule','tools_schedules','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x57e2fa,_0x1fa53){var _0x48979d=function(_0x2900c3){while(--_0x2900c3){_0x57e2fa['push'](_0x57e2fa['shift']());}};_0x48979d(++_0x1fa53);}(_0x1b46,0x1cb));var _0x61b4=function(_0x2852d4,_0x293759){_0x2852d4=_0x2852d4-0x0;var _0x1d66d7=_0x1b46[_0x2852d4];return _0x1d66d7;};'use strict';var _=require(_0x61b4('0x0'));var util=require(_0x61b4('0x1'));var logger=require(_0x61b4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x61b4('0x3'));var rp=require(_0x61b4('0x4'));var fs=require('fs');var path=require(_0x61b4('0x5'));var rimraf=require(_0x61b4('0x6'));var config=require(_0x61b4('0x7'));var attributes=require('./schedule.attributes');module[_0x61b4('0x8')]=function(_0x5a1528,_0x3f2561){return _0x5a1528[_0x61b4('0x9')](_0x61b4('0xa'),attributes,{'tableName':_0x61b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1b54db4..b57200e 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 _0x1763=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util'];(function(_0xdaf8a7,_0x366b59){var _0x30e0d3=function(_0x1b9eaa){while(--_0x1b9eaa){_0xdaf8a7['push'](_0xdaf8a7['shift']());}};_0x30e0d3(++_0x366b59);}(_0x1763,0x154));var _0x3176=function(_0x26ce99,_0x51c44a){_0x26ce99=_0x26ce99-0x0;var _0x69dd3d=_0x1763[_0x26ce99];return _0x69dd3d;};'use strict';var _=require(_0x3176('0x0'));var util=require(_0x3176('0x1'));var moment=require(_0x3176('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3176('0x3'));var db=require(_0x3176('0x4'))['db'];var utils=require(_0x3176('0x5'));var logger=require(_0x3176('0x6'))(_0x3176('0x7'));var config=require('../../config/environment');var jayson=require(_0x3176('0x8'));var client=jayson[_0x3176('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4791d1,_0xcc7a9d,_0x45d07c){return new BPromise(function(_0x258a37,_0x54a17b){return client['request'](_0x4791d1,_0x45d07c)[_0x3176('0xa')](function(_0x208e61){logger[_0x3176('0xb')](_0x3176('0xc'),_0xcc7a9d,_0x3176('0xd'));logger[_0x3176('0xe')](_0x3176('0xf'),_0xcc7a9d,_0x3176('0xd'),JSON['stringify'](_0x208e61));if(_0x208e61[_0x3176('0x10')]){if(_0x208e61['error']['code']===0x1f4){logger[_0x3176('0x10')](_0x3176('0xc'),_0xcc7a9d,_0x208e61['error'][_0x3176('0x11')]);return _0x54a17b(_0x208e61['error']['message']);}logger['error']('Schedule,\x20%s,\x20%s',_0xcc7a9d,_0x208e61['error'][_0x3176('0x11')]);return _0x258a37(_0x208e61[_0x3176('0x10')]['message']);}else{logger['info']('Schedule,\x20%s,\x20%s',_0xcc7a9d,_0x3176('0xd'));_0x258a37(_0x208e61[_0x3176('0x12')][_0x3176('0x11')]);}})['catch'](function(_0x38c509){logger[_0x3176('0x10')]('Schedule,\x20%s,\x20%s',_0xcc7a9d,_0x38c509);_0x54a17b(_0x38c509);});});} \ No newline at end of file +var _0xa98d=['rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3136fe,_0x3018e4){var _0x3fb328=function(_0x4fee6a){while(--_0x4fee6a){_0x3136fe['push'](_0x3136fe['shift']());}};_0x3fb328(++_0x3018e4);}(_0xa98d,0x170));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xda98('0x0'));var moment=require(_0xda98('0x1'));var BPromise=require(_0xda98('0x2'));var rs=require(_0xda98('0x3'));var fs=require('fs');var Redis=require(_0xda98('0x4'));var db=require(_0xda98('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda98('0x6'));var config=require(_0xda98('0x7'));var jayson=require(_0xda98('0x8'));var client=jayson[_0xda98('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e129a,_0x5a013f,_0x43df33){return new BPromise(function(_0x62f9f2,_0x1a779f){return client[_0xda98('0xa')](_0x5e129a,_0x43df33)[_0xda98('0xb')](function(_0x4472f6){logger[_0xda98('0xc')](_0xda98('0xd'),_0x5a013f,_0xda98('0xe'));logger[_0xda98('0xf')](_0xda98('0x10'),_0x5a013f,_0xda98('0xe'),JSON[_0xda98('0x11')](_0x4472f6));if(_0x4472f6[_0xda98('0x12')]){if(_0x4472f6[_0xda98('0x12')][_0xda98('0x13')]===0x1f4){logger['error'](_0xda98('0xd'),_0x5a013f,_0x4472f6[_0xda98('0x12')][_0xda98('0x14')]);return _0x1a779f(_0x4472f6[_0xda98('0x12')]['message']);}logger[_0xda98('0x12')](_0xda98('0xd'),_0x5a013f,_0x4472f6['error']['message']);return _0x62f9f2(_0x4472f6[_0xda98('0x12')][_0xda98('0x14')]);}else{logger['info'](_0xda98('0xd'),_0x5a013f,'request\x20sent');_0x62f9f2(_0x4472f6['result'][_0xda98('0x14')]);}})[_0xda98('0x15')](function(_0x50dbc4){logger[_0xda98('0x12')](_0xda98('0xd'),_0x5a013f,_0x50dbc4);_0x1a779f(_0x50dbc4);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 25a0e26..1ac6869 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 _0xda3f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','util','path'];(function(_0x573d31,_0x4e58dd){var _0x22076e=function(_0xe5f74e){while(--_0xe5f74e){_0x573d31['push'](_0x573d31['shift']());}};_0x22076e(++_0x4e58dd);}(_0xda3f,0x173));var _0xfda3=function(_0x2e8662,_0x2439e3){_0x2e8662=_0x2e8662-0x0;var _0x1ce213=_0xda3f[_0x2e8662];return _0x1ce213;};'use strict';var multer=require(_0xfda3('0x0'));var util=require(_0xfda3('0x1'));var path=require(_0xfda3('0x2'));var timeout=require(_0xfda3('0x3'));var express=require(_0xfda3('0x4'));var router=express[_0xfda3('0x5')]();var fs_extra=require(_0xfda3('0x6'));var auth=require(_0xfda3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfda3('0x8'));router[_0xfda3('0x9')]('/',auth[_0xfda3('0xa')](),controller[_0xfda3('0xb')]);router['get'](_0xfda3('0xc'),auth[_0xfda3('0xa')](),controller['describe']);router['get'](_0xfda3('0xd'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);router[_0xfda3('0x9')](_0xfda3('0xf'),auth[_0xfda3('0xa')](),controller[_0xfda3('0x10')]);router[_0xfda3('0x11')]('/',auth[_0xfda3('0xa')](),controller['create']);router[_0xfda3('0x12')](_0xfda3('0xd'),auth['isAuthenticated'](),controller[_0xfda3('0x13')]);router[_0xfda3('0x14')](_0xfda3('0xd'),auth[_0xfda3('0xa')](),controller[_0xfda3('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe1c8=['download','post','create','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x1be1f6,_0x5e7089){var _0x2bd577=function(_0x210461){while(--_0x210461){_0x1be1f6['push'](_0x1be1f6['shift']());}};_0x2bd577(++_0x5e7089);}(_0xe1c8,0x85));var _0x8e1c=function(_0x2d08b3,_0x1be2e0){_0x2d08b3=_0x2d08b3-0x0;var _0x3dee25=_0xe1c8[_0x2d08b3];return _0x3dee25;};'use strict';var multer=require('multer');var util=require(_0x8e1c('0x0'));var path=require(_0x8e1c('0x1'));var timeout=require('connect-timeout');var express=require(_0x8e1c('0x2'));var router=express[_0x8e1c('0x3')]();var fs_extra=require(_0x8e1c('0x4'));var auth=require(_0x8e1c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x8e1c('0x6')]('/',auth[_0x8e1c('0x7')](),controller[_0x8e1c('0x8')]);router[_0x8e1c('0x6')](_0x8e1c('0x9'),auth[_0x8e1c('0x7')](),controller[_0x8e1c('0xa')]);router[_0x8e1c('0x6')](_0x8e1c('0xb'),auth[_0x8e1c('0x7')](),controller[_0x8e1c('0xc')]);router[_0x8e1c('0x6')](_0x8e1c('0xd'),auth['isAuthenticated'](),controller[_0x8e1c('0xe')]);router[_0x8e1c('0xf')]('/',auth[_0x8e1c('0x7')](),controller[_0x8e1c('0x10')]);router['put'](_0x8e1c('0xb'),auth[_0x8e1c('0x7')](),controller[_0x8e1c('0x11')]);router[_0x8e1c('0x12')](_0x8e1c('0xb'),auth[_0x8e1c('0x7')](),controller[_0x8e1c('0x13')]);module[_0x8e1c('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b90dfca..7ff3dfd 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 _0x80e0=['MM-DD-YYYY\x20HH:mm','toString','closedAt','format','createdAt','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','subtract','duration','DATE'];(function(_0x595894,_0x306141){var _0x41ce87=function(_0x39f166){while(--_0x39f166){_0x595894['push'](_0x595894['shift']());}};_0x41ce87(++_0x306141);}(_0x80e0,0x9d));var _0x080e=function(_0x380350,_0x11195a){_0x380350=_0x380350-0x0;var _0x4cac0c=_0x80e0[_0x380350];return _0x4cac0c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0x080e('0x0'));var config=require(_0x080e('0x1'));module[_0x080e('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x080e('0x3')](_0x080e('0x4'))?path[_0x080e('0x5')](this['getDataValue'](_0x080e('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x080e('0x6')]},'channel':{'type':Sequelize[_0x080e('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x4b61b7){var _0x5583f7=_0x4b61b7[_0x080e('0x7')](/\\/g,'/');this['setDataValue'](_0x080e('0x4'),_0x5583f7);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x080e('0x8')],'set':function(_0x1241ec){this[_0x080e('0x9')](_0x080e('0xa'),moment()[_0x080e('0xb')](_0x1241ec,'ms'));this['setDataValue']('closedAt',moment());this[_0x080e('0x9')](_0x080e('0xc'),_0x1241ec);}},'startedAt':{'type':Sequelize[_0x080e('0xd')],'get':function(){return moment(this[_0x080e('0x3')]('startedAt'))['format'](_0x080e('0xe'))[_0x080e('0xf')]();}},'closedAt':{'type':Sequelize[_0x080e('0xd')],'get':function(){return moment(this['getDataValue'](_0x080e('0x10')))[_0x080e('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x080e('0x12')))[_0x080e('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x080e('0xd')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x080e('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x080e('0xf')]();}}}; \ No newline at end of file +var _0x63d4=['moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','sequelize'];(function(_0x193db3,_0x16104e){var _0x1e8068=function(_0x5c49a6){while(--_0x5c49a6){_0x193db3['push'](_0x193db3['shift']());}};_0x1e8068(++_0x16104e);}(_0x63d4,0x117));var _0x463d=function(_0x5e72bb,_0x54edb2){_0x5e72bb=_0x5e72bb-0x0;var _0x6351d3=_0x63d4[_0x5e72bb];return _0x6351d3;};'use strict';var Sequelize=require(_0x463d('0x0'));var moment=require(_0x463d('0x1'));var path=require(_0x463d('0x2'));var config=require('../../config/environment');module[_0x463d('0x3')]={'format':{'type':Sequelize[_0x463d('0x4')],'get':function(){return this[_0x463d('0x5')](_0x463d('0x6'))?path[_0x463d('0x7')](this['getDataValue'](_0x463d('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x463d('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x463d('0x8')],'set':function(_0xb5e1b1){var _0x2635aa=_0xb5e1b1[_0x463d('0x9')](/\\/g,'/');this[_0x463d('0xa')]('value',_0x2635aa);}},'rating':{'type':Sequelize[_0x463d('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x42b27e){this[_0x463d('0xa')](_0x463d('0xc'),moment()[_0x463d('0xd')](_0x42b27e,'ms'));this['setDataValue']('closedAt',moment());this[_0x463d('0xa')]('duration',_0x42b27e);}},'startedAt':{'type':Sequelize[_0x463d('0xe')],'get':function(){return moment(this[_0x463d('0x5')](_0x463d('0xc')))[_0x463d('0xf')](_0x463d('0x10'))[_0x463d('0x11')]();}},'closedAt':{'type':Sequelize[_0x463d('0xe')],'get':function(){return moment(this['getDataValue'](_0x463d('0x12')))[_0x463d('0xf')](_0x463d('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0x463d('0xe')],'get':function(){return moment(this[_0x463d('0x5')](_0x463d('0x13')))[_0x463d('0xf')](_0x463d('0x10'))[_0x463d('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x463d('0x5')]('updatedAt'))[_0x463d('0xf')](_0x463d('0x10'))[_0x463d('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 1363f58..606b2f5 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 _0xb4c7=['rawAttributes','fieldName','type','format','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','ValidationError','download','filename','extname','unlink','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording'];(function(_0x31b137,_0xa54c07){var _0x35a4f8=function(_0x28e248){while(--_0x28e248){_0x31b137['push'](_0x31b137['shift']());}};_0x35a4f8(++_0xa54c07);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5a14c4,_0x10b3c5){_0x5a14c4=_0x5a14c4-0x0;var _0x3344a8=_0xb4c7[_0x5a14c4];return _0x3344a8;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['differenceBy'](_[_0x7b4c('0x30')](_0x3544bc,_0x7b4c('0x2d')),[_0x7b4c('0x35')]);_0x3585cd[_0x7b4c('0x36')]=_['keys'](_0x2552f9[_0x7b4c('0x36')]);_0x3585cd[_0x7b4c('0x37')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_[_0x7b4c('0x3a')](_0x3585cd[_0x7b4c('0x38')],qs['fields'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x39')][_0x7b4c('0x3c')]?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9['query']['hasOwnProperty'](_0x7b4c('0x3d'))){_0x9a799b[_0x7b4c('0x22')]=qs['limit'](_0x2552f9[_0x7b4c('0x36')]['limit']);_0x9a799b['offset']=qs[_0x7b4c('0x1f')](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3e')]=qs['sort'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3f')]);_0x9a799b[_0x7b4c('0x40')]=qs[_0x7b4c('0x37')](_[_0x7b4c('0x41')](_0x2552f9[_0x7b4c('0x36')],_0x3585cd[_0x7b4c('0x37')]),_0x3544bc);if(_0x2552f9['query']['filter']){_0x9a799b[_0x7b4c('0x40')]=_[_0x7b4c('0x42')](_0x9a799b[_0x7b4c('0x40')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0xb8486d){if(_0xb8486d['type']!==_0x7b4c('0x43')){var _0x902367={};_0x902367[_0xb8486d[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x44')]+'%'};return _0x902367;}})});}_0x9a799b=_[_0x7b4c('0x42')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x45')]);var _0x1080fc={'where':_0x9a799b[_0x7b4c('0x40')]};return db['ScreenRecording'][_0x7b4c('0x21')](_0x1080fc)['then'](function(_0x2a3a74){_0x130ace['count']=_0x2a3a74;if(_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x9a799b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7b4c('0x47')](_0x9a799b);})[_0x7b4c('0x29')](function(_0x1def44){_0x130ace[_0x7b4c('0x48')]=_0x1def44;return _0x130ace;})['then'](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x49')](handleError(_0x3e4a46,null));};exports[_0x7b4c('0x4a')]=function(_0x100774,_0x5d4ed8){var _0x45ad59={'raw':![],'where':{'id':_0x100774['params']['id']}},_0x4b4757={};_0x4b4757[_0x7b4c('0x38')]=_['keys'](db[_0x7b4c('0x31')][_0x7b4c('0x32')]);_0x4b4757[_0x7b4c('0x36')]=_[_0x7b4c('0x4b')](_0x100774[_0x7b4c('0x36')]);_0x4b4757[_0x7b4c('0x37')]=_[_0x7b4c('0x3a')](_0x4b4757[_0x7b4c('0x38')],_0x4b4757[_0x7b4c('0x36')]);_0x45ad59['attributes']=_[_0x7b4c('0x3a')](_0x4b4757['model'],qs['fields'](_0x100774[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x45ad59['attributes']=_0x45ad59['attributes'][_0x7b4c('0x3c')]?_0x45ad59[_0x7b4c('0x39')]:_0x4b4757[_0x7b4c('0x38')];if(_0x100774[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x45ad59[_0x7b4c('0x4c')]=[{'all':!![]}];}_0x45ad59=_[_0x7b4c('0x42')]({},_0x45ad59,_0x100774[_0x7b4c('0x45')]);return db['ScreenRecording'][_0x7b4c('0x4d')](_0x45ad59)[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4ed8,null))[_0x7b4c('0x29')](respondWithResult(_0x5d4ed8,null))[_0x7b4c('0x49')](handleError(_0x5d4ed8,null));};exports[_0x7b4c('0x4e')]=function(_0x379f15,_0x11a6f9){return db[_0x7b4c('0x31')][_0x7b4c('0x4e')](_0x379f15['body'],{})['then'](respondWithResult(_0x11a6f9,0xc9))[_0x7b4c('0x49')](handleError(_0x11a6f9,null));};exports[_0x7b4c('0x28')]=function(_0x97eadf,_0x5d4192){if(_0x97eadf[_0x7b4c('0x4f')]['id']){delete _0x97eadf[_0x7b4c('0x4f')]['id'];}delete _0x97eadf['body'][_0x7b4c('0x50')];delete _0x97eadf['body'][_0x7b4c('0x51')];delete _0x97eadf['body'][_0x7b4c('0x52')];delete _0x97eadf['body'][_0x7b4c('0x53')];return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x97eadf['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4192,null))[_0x7b4c('0x29')](saveUpdates(_0x97eadf[_0x7b4c('0x4f')],null))['then'](respondWithResult(_0x5d4192,null))['catch'](handleError(_0x5d4192,null));};exports[_0x7b4c('0x54')]=function(_0x1c118a,_0x4cbf1b){return db['ScreenRecording'][_0x7b4c('0x54')]()[_0x7b4c('0x29')](respondWithResult(_0x4cbf1b,null))[_0x7b4c('0x49')](handleError(_0x4cbf1b,null));};exports['download']=function(_0x1d017d,_0x2f009a,_0x4aaf57){var _0x484e80=require(_0x7b4c('0x55'));var _0x4d8491=![];var _0x59db20={};if(_0x1d017d[_0x7b4c('0x36')]['type']&&_0x1d017d['query'][_0x7b4c('0x34')]===_0x7b4c('0x56')){_0x59db20[_0x7b4c('0x56')]=_0x1d017d[_0x7b4c('0x57')]['id'];}else{_0x59db20['id']=_0x1d017d['params']['id'];}return db['ScreenRecording'][_0x7b4c('0x4d')]({'where':_0x59db20,'attributes':['id',_0x7b4c('0x53')],'raw':!![]})[_0x7b4c('0x29')](handleEntityNotFound(_0x2f009a,null))['then'](function(_0x255262){if(_0x255262){var _0x3d81fb=path[_0x7b4c('0x58')](config['root'],_0x7b4c('0x59'),_0x255262[_0x7b4c('0x53')]);var _0x529803=util[_0x7b4c('0x35')](_0x7b4c('0x5a'),_0x3d81fb);if(fs[_0x7b4c('0x5b')](_0x529803)){_0x4d8491=!![];return _0x484e80[_0x7b4c('0x5c')](_0x529803,_0x3d81fb,config[_0x7b4c('0x5d')][_0x7b4c('0x5e')])[_0x7b4c('0x29')](function(){return _0x255262;});}return _0x255262;}})['then'](function(_0x4443d0){if(_0x4443d0){var _0x2dc79a=path['join'](config[_0x7b4c('0x5f')],_0x7b4c('0x59'),_0x4443d0[_0x7b4c('0x53')]);if(!fs[_0x7b4c('0x5b')](_0x2dc79a)){throw new db['Sequelize'][(_0x7b4c('0x60'))]('ScreenRecording\x20not\x20found');}if(_0x4443d0['filename']){return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,_0x4443d0[_0x7b4c('0x62')]+path[_0x7b4c('0x63')](_0x2dc79a),function(){if(_0x4d8491){fs[_0x7b4c('0x64')](_0x2dc79a);}});}else{return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,function(_0x5b24f6){if(_0x4d8491){fs['unlink'](_0x2dc79a);}});}}})[_0x7b4c('0x49')](function(_0x3c84af){if(_0x3c84af[_0x7b4c('0x65')]==='ScreenRecording\x20not\x20found'){_0x2f009a[_0x7b4c('0x1c')](0x194)[_0x7b4c('0x2e')](_0x7b4c('0x66'));}else{return handleError(_0x2f009a,null);}});};exports['destroy']=function(_0x222b47,_0x3b2144){return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x222b47[_0x7b4c('0x57')]['id']}})[_0x7b4c('0x29')](function(_0x4ac03e){if(_[_0x7b4c('0x67')](_0x4ac03e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ac03e;})[_0x7b4c('0x29')](function(_0x11ae6e){var _0x3a3713=path['join'](config['root'],_0x7b4c('0x59'),_0x11ae6e[_0x7b4c('0x53')]);logger[_0x7b4c('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x3a3713);if(!_[_0x7b4c('0x67')](_0x11ae6e['value'])&&fs[_0x7b4c('0x5b')](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}_0x3a3713=_0x3a3713+'.cypher';if(!_[_0x7b4c('0x67')](_0x11ae6e[_0x7b4c('0x53')])&&fs['existsSync'](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}return _0x11ae6e;})[_0x7b4c('0x29')](function(_0x2befd7){if(!_0x2befd7)throw new InternalError();return _0x2befd7[_0x7b4c('0x2a')]();})[_0x7b4c('0x29')](function(){_0x3b2144['status'](0xcc)[_0x7b4c('0x1d')]();})[_0x7b4c('0x49')](handleError(_0x3b2144,null));}; \ No newline at end of file +var _0x55ca=['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','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','moment','bluebird','util','path'];(function(_0x57742b,_0x502683){var _0x3d91e9=function(_0x4130b9){while(--_0x4130b9){_0x57742b['push'](_0x57742b['shift']());}};_0x3d91e9(++_0x502683);}(_0x55ca,0x126));var _0xa55c=function(_0x326b39,_0x4143c9){_0x326b39=_0x326b39-0x0;var _0x5b62d1=_0x55ca[_0x326b39];return _0x5b62d1;};'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('0x2d')](_['map'](_0x201941,_0xa55c('0x25')),[_0xa55c('0x2e')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2f')]);_0x22f6b6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2f')]);_0x1377b0[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x22f6b6['model'],qs['fields'](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x1377b0['attributes']=_0x1377b0[_0xa55c('0x33')][_0xa55c('0x35')]?_0x1377b0[_0xa55c('0x33')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2f')][_0xa55c('0x36')](_0xa55c('0x37'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa['query']['limit']);_0x1377b0['offset']=qs[_0xa55c('0x1a')](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x1a')]);}_0x1377b0['order']=qs[_0xa55c('0x38')](_0x906caa['query'][_0xa55c('0x38')]);_0x1377b0['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x39')](_0x906caa[_0xa55c('0x2f')],_0x22f6b6['filters']),_0x201941);if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3a')]){_0x1377b0['where']=_[_0xa55c('0x3b')](_0x1377b0[_0xa55c('0x3c')],{'$or':_['map'](_0x201941,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2a')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x25')]]={'$like':'%'+_0x906caa['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x3b3308={'where':_0x1377b0[_0xa55c('0x3c')]};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x3b3308)[_0xa55c('0x20')](function(_0x56d17c){_0x1b8388[_0xa55c('0x1d')]=_0x56d17c;if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x386e34){_0x1b8388['rows']=_0x386e34;return _0x1b8388;})['then'](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x40')](handleError(_0x5d940d,null));};exports[_0xa55c('0x41')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':![],'where':{'id':_0x496920[_0xa55c('0x42')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x2c')]=_[_0xa55c('0x30')](db['ScreenRecording'][_0xa55c('0x43')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x2c')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x34')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x33')]['length']?_0x508bd3[_0xa55c('0x33')]:_0x5f25f7[_0xa55c('0x2c')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3e')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3b')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x29')][_0xa55c('0x44')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x20')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x40')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x29')][_0xa55c('0x45')](_0x46f839['body'],{})[_0xa55c('0x20')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x1f')]=function(_0x213100,_0x194a79){if(_0x213100['body']['id']){delete _0x213100[_0xa55c('0x46')]['id'];}delete _0x213100[_0xa55c('0x46')]['duration'];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x47')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x48')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x49')];return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x213100[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x194a79,null))['then'](saveUpdates(_0x213100[_0xa55c('0x46')],null))[_0xa55c('0x20')](respondWithResult(_0x194a79,null))[_0xa55c('0x40')](handleError(_0x194a79,null));};exports['describe']=function(_0x4c3095,_0x35bf0a){return db['ScreenRecording'][_0xa55c('0x4a')]()['then'](respondWithResult(_0x35bf0a,null))[_0xa55c('0x40')](handleError(_0x35bf0a,null));};exports[_0xa55c('0x4b')]=function(_0x181802,_0x3f9313,_0x2ecf79){var _0x5b1cf3=require(_0xa55c('0x4c'));var _0x4607ca=![];var _0x4b85cc={};if(_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]&&_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]==='uniqueid'){_0x4b85cc['uniqueid']=_0x181802[_0xa55c('0x42')]['id'];}else{_0x4b85cc['id']=_0x181802[_0xa55c('0x42')]['id'];}return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':_0x4b85cc,'attributes':['id','value'],'raw':!![]})[_0xa55c('0x20')](handleEntityNotFound(_0x3f9313,null))['then'](function(_0x2742e4){if(_0x2742e4){var _0x437ced=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x2742e4['value']);var _0x1cb73b=util['format'](_0xa55c('0x50'),_0x437ced);if(fs[_0xa55c('0x51')](_0x1cb73b)){_0x4607ca=!![];return _0x5b1cf3[_0xa55c('0x52')](_0x1cb73b,_0x437ced,config[_0xa55c('0x53')][_0xa55c('0x54')])[_0xa55c('0x20')](function(){return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x20')](function(_0x53e2be){if(_0x53e2be){var _0x450567=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x53e2be[_0xa55c('0x49')]);if(!fs['existsSync'](_0x450567)){throw new db[(_0xa55c('0x55'))][(_0xa55c('0x56'))](_0xa55c('0x57'));}if(_0x53e2be[_0xa55c('0x58')]){return _0x3f9313[_0xa55c('0x4b')](_0x450567,_0x53e2be['filename']+path[_0xa55c('0x59')](_0x450567),function(){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}else{return _0x3f9313[_0xa55c('0x4b')](_0x450567,function(_0x16d9b2){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}}})['catch'](function(_0x419fc3){if(_0x419fc3['message']===_0xa55c('0x57')){_0x3f9313['status'](0x194)[_0xa55c('0x26')]('Not\x20found');}else{return handleError(_0x3f9313,null);}});};exports[_0xa55c('0x5b')]=function(_0x1333da,_0x21d6b4){return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x1333da[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](function(_0x2f2226){if(_[_0xa55c('0x5c')](_0x2f2226)){throw new ReferenceError(_0xa55c('0x5d'));}return _0x2f2226;})['then'](function(_0x150a07){var _0x311bb9=path['join'](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x150a07[_0xa55c('0x49')]);logger[_0xa55c('0x5e')](_0xa55c('0x5f'),_0x311bb9);if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger['info'](_0xa55c('0x60')+_0x311bb9+_0xa55c('0x61'));fs[_0xa55c('0x62')](_0x311bb9);}_0x311bb9=_0x311bb9+_0xa55c('0x63');if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger[_0xa55c('0x5e')](_0xa55c('0x60')+_0x311bb9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa55c('0x62')](_0x311bb9);}return _0x150a07;})[_0xa55c('0x20')](function(_0x40c56a){if(!_0x40c56a)throw new InternalError();return _0x40c56a[_0xa55c('0x5b')]();})[_0xa55c('0x20')](function(){_0x21d6b4[_0xa55c('0x18')](0xcc)[_0xa55c('0x21')]();})[_0xa55c('0x40')](handleError(_0x21d6b4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 31563c9..f87d743 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 _0xd51d=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xd51d,0x1b5));var _0xdd51=function(_0x407aa1,_0x48d57d){_0x407aa1=_0x407aa1-0x0;var _0x1eb43c=_0xd51d[_0x407aa1];return _0x1eb43c;};'use strict';var _=require(_0xdd51('0x0'));var util=require(_0xdd51('0x1'));var logger=require(_0xdd51('0x2'))(_0xdd51('0x3'));var moment=require(_0xdd51('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd51('0x5'));var rimraf=require(_0xdd51('0x6'));var config=require(_0xdd51('0x7'));var attributes=require(_0xdd51('0x8'));module[_0xdd51('0x9')]=function(_0xe36d05,_0x25797e){return _0xe36d05[_0xdd51('0xa')](_0xdd51('0xb'),attributes,{'tableName':_0xdd51('0xc'),'paranoid':![],'indexes':[{'name':_0xdd51('0xd'),'fields':[_0xdd51('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3bee=['bluebird','request-promise','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment'];(function(_0x5d9546,_0x5bfa9f){var _0x5bbed4=function(_0x343f36){while(--_0x343f36){_0x5d9546['push'](_0x5d9546['shift']());}};_0x5bbed4(++_0x5bfa9f);}(_0x3bee,0x167));var _0xe3be=function(_0x46e7e8,_0x6e6582){_0x46e7e8=_0x46e7e8-0x0;var _0x3b554a=_0x3bee[_0x46e7e8];return _0x3b554a;};'use strict';var _=require(_0xe3be('0x0'));var util=require(_0xe3be('0x1'));var logger=require(_0xe3be('0x2'))(_0xe3be('0x3'));var moment=require(_0xe3be('0x4'));var BPromise=require(_0xe3be('0x5'));var rp=require(_0xe3be('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3be('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3be('0x8'));module[_0xe3be('0x9')]=function(_0x344be4,_0x10bfe6){return _0x344be4[_0xe3be('0xa')](_0xe3be('0xb'),attributes,{'tableName':_0xe3be('0xc'),'paranoid':![],'indexes':[{'name':_0xe3be('0xd'),'fields':[_0xe3be('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 8c8cd0b..24aa200 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 _0x99c5=['code','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error'];(function(_0xc26e6d,_0x2886f0){var _0x4f49f0=function(_0xa1f8d2){while(--_0xa1f8d2){_0xc26e6d['push'](_0xc26e6d['shift']());}};_0x4f49f0(++_0x2886f0);}(_0x99c5,0x136));var _0x599c=function(_0x5ebe34,_0x421337){_0x5ebe34=_0x5ebe34-0x0;var _0x36a3ee=_0x99c5[_0x5ebe34];return _0x36a3ee;};'use strict';var _=require(_0x599c('0x0'));var util=require(_0x599c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x599c('0x2'));var fs=require('fs');var Redis=require(_0x599c('0x3'));var db=require(_0x599c('0x4'))['db'];var utils=require(_0x599c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x599c('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd42359,_0x902742,_0x35966e){return new BPromise(function(_0x251c8c,_0x604038){return client[_0x599c('0x7')](_0xd42359,_0x35966e)[_0x599c('0x8')](function(_0x3d9a90){logger['info'](_0x599c('0x9'),_0x902742,_0x599c('0xa'));logger[_0x599c('0xb')](_0x599c('0xc'),_0x902742,'request\x20sent',JSON['stringify'](_0x3d9a90));if(_0x3d9a90['error']){if(_0x3d9a90[_0x599c('0xd')][_0x599c('0xe')]===0x1f4){logger['error'](_0x599c('0x9'),_0x902742,_0x3d9a90['error']['message']);return _0x604038(_0x3d9a90['error'][_0x599c('0xf')]);}logger[_0x599c('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x902742,_0x3d9a90[_0x599c('0xd')][_0x599c('0xf')]);return _0x251c8c(_0x3d9a90[_0x599c('0xd')][_0x599c('0xf')]);}else{logger[_0x599c('0x10')](_0x599c('0x9'),_0x902742,'request\x20sent');_0x251c8c(_0x3d9a90[_0x599c('0x11')][_0x599c('0xf')]);}})['catch'](function(_0x28f3b4){logger[_0x599c('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x902742,_0x28f3b4);_0x604038(_0x28f3b4);});});} \ No newline at end of file +var _0xa7a5=['code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error'];(function(_0x5c423d,_0x699ec8){var _0x23ad2e=function(_0x151c65){while(--_0x151c65){_0x5c423d['push'](_0x5c423d['shift']());}};_0x23ad2e(++_0x699ec8);}(_0xa7a5,0x1a6));var _0x5a7a=function(_0x5119a0,_0x3e080a){_0x5119a0=_0x5119a0-0x0;var _0x3fffe5=_0xa7a5[_0x5119a0];return _0x3fffe5;};'use strict';var _=require('lodash');var util=require(_0x5a7a('0x0'));var moment=require(_0x5a7a('0x1'));var BPromise=require(_0x5a7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a7a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5a7a('0x4'))(_0x5a7a('0x5'));var config=require(_0x5a7a('0x6'));var jayson=require(_0x5a7a('0x7'));var client=jayson[_0x5a7a('0x8')][_0x5a7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41ffdf,_0x4241c4,_0x15a496){return new BPromise(function(_0x6a3d9a,_0x29b090){return client[_0x5a7a('0xa')](_0x41ffdf,_0x15a496)[_0x5a7a('0xb')](function(_0x243d6c){logger[_0x5a7a('0xc')](_0x5a7a('0xd'),_0x4241c4,_0x5a7a('0xe'));logger[_0x5a7a('0xf')](_0x5a7a('0x10'),_0x4241c4,_0x5a7a('0xe'),JSON['stringify'](_0x243d6c));if(_0x243d6c[_0x5a7a('0x11')]){if(_0x243d6c['error'][_0x5a7a('0x12')]===0x1f4){logger[_0x5a7a('0x11')](_0x5a7a('0xd'),_0x4241c4,_0x243d6c['error'][_0x5a7a('0x13')]);return _0x29b090(_0x243d6c['error'][_0x5a7a('0x13')]);}logger[_0x5a7a('0x11')](_0x5a7a('0xd'),_0x4241c4,_0x243d6c[_0x5a7a('0x11')][_0x5a7a('0x13')]);return _0x6a3d9a(_0x243d6c[_0x5a7a('0x11')][_0x5a7a('0x13')]);}else{logger[_0x5a7a('0xc')](_0x5a7a('0xd'),_0x4241c4,_0x5a7a('0xe'));_0x6a3d9a(_0x243d6c[_0x5a7a('0x14')][_0x5a7a('0x13')]);}})[_0x5a7a('0x15')](function(_0x3c7fbe){logger[_0x5a7a('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4241c4,_0x3c7fbe);_0x29b090(_0x3c7fbe);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 7deb44f..b300436 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 _0xeb3d=['get','isAuthenticated','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','extname','originalname','post','single','file','addLogo','logologin','server/files/images/logos/','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller'];(function(_0x582bd4,_0x20fb2e){var _0x3d1991=function(_0x42174d){while(--_0x42174d){_0x582bd4['push'](_0x582bd4['shift']());}};_0x3d1991(++_0x20fb2e);}(_0xeb3d,0xf4));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdeb3('0x0'));var util=require(_0xdeb3('0x1'));var path=require(_0xdeb3('0x2'));var timeout=require('connect-timeout');var express=require(_0xdeb3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdeb3('0x4'));var interaction=require(_0xdeb3('0x5'));var config=require(_0xdeb3('0x6'));var controller=require(_0xdeb3('0x7'));router[_0xdeb3('0x8')]('/',auth[_0xdeb3('0x9')](),controller['index']);router['get'](_0xdeb3('0xa'),controller[_0xdeb3('0xb')]);router['get'](_0xdeb3('0xc'),controller[_0xdeb3('0xd')]);router['get'](_0xdeb3('0xe'),controller['getLogo']);router[_0xdeb3('0x8')](_0xdeb3('0xf'),controller['getLogoLogin']);router[_0xdeb3('0x8')](_0xdeb3('0x10'),controller[_0xdeb3('0x11')]);router['get'](_0xdeb3('0x12'),controller[_0xdeb3('0x13')]);router['get'](_0xdeb3('0x14'),controller[_0xdeb3('0x15')]);var upload=multer({'storage':multer[_0xdeb3('0x16')]({'destination':function(_0x44f144,_0xcba76a,_0x38a88e){_0x38a88e(null,path[_0xdeb3('0x17')](config[_0xdeb3('0x18')],'server/files/images/logos/'));},'filename':function(_0x59e7a4,_0x29ad3d,_0x267024){_0x267024(null,util[_0xdeb3('0x19')](_0xdeb3('0x1a'),'logo',path[_0xdeb3('0x1b')](_0x29ad3d[_0xdeb3('0x1c')])));}})});router[_0xdeb3('0x1d')](_0xdeb3('0xe'),upload[_0xdeb3('0x1e')](_0xdeb3('0x1f')),controller[_0xdeb3('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x13d4ba,_0xcff481,_0x2dfe87){_0x2dfe87(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x17da24,_0x5d362d,_0x9d47ad){_0x9d47ad(null,util[_0xdeb3('0x19')](_0xdeb3('0x1a'),_0xdeb3('0x21'),path[_0xdeb3('0x1b')](_0x5d362d[_0xdeb3('0x1c')])));}})});router[_0xdeb3('0x1d')]('/:id/logo_login',upload['single']('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xdeb3('0x16')]({'destination':function(_0x3afc8e,_0x880e89,_0x3381bd){_0x3381bd(null,path[_0xdeb3('0x17')](config[_0xdeb3('0x18')],_0xdeb3('0x22')));},'filename':function(_0x142eb6,_0x38d515,_0x386ac0){_0x386ac0(null,util[_0xdeb3('0x19')]('%s%s',_0xdeb3('0x23'),path[_0xdeb3('0x1b')](_0x38d515[_0xdeb3('0x1c')])));}})});router[_0xdeb3('0x1d')]('/:id/preferred',upload['single']('file'),controller[_0xdeb3('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d38a5,_0x215d7a,_0x30ea7a){_0x30ea7a(null,path['join'](config[_0xdeb3('0x18')],'server/files/images/logos/'));},'filename':function(_0x35245b,_0x2726d8,_0x530c2f){_0x530c2f(null,util[_0xdeb3('0x19')](_0xdeb3('0x1a'),_0xdeb3('0x25'),path[_0xdeb3('0x1b')](_0x2726d8[_0xdeb3('0x1c')])));}})});router[_0xdeb3('0x1d')](_0xdeb3('0x14'),upload[_0xdeb3('0x1e')]('file'),controller[_0xdeb3('0x26')]);router[_0xdeb3('0x27')](_0xdeb3('0xc'),auth[_0xdeb3('0x9')](),controller[_0xdeb3('0x28')]);module[_0xdeb3('0x29')]=router; \ No newline at end of file +var _0x54b5=['addLogo','diskStorage','/:id/logo_login','file','addLogoLogin','format','preferred','addPreferred','originalname','addFavicon','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id','/:id/logo','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','%s%s','logo','extname','post','single'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0x54b5,0x190));var _0x554b=function(_0x3680d3,_0x32bd1e){_0x3680d3=_0x3680d3-0x0;var _0x3d007d=_0x54b5[_0x3680d3];return _0x3d007d;};'use strict';var multer=require(_0x554b('0x0'));var util=require(_0x554b('0x1'));var path=require(_0x554b('0x2'));var timeout=require(_0x554b('0x3'));var express=require('express');var router=express[_0x554b('0x4')]();var fs_extra=require(_0x554b('0x5'));var auth=require(_0x554b('0x6'));var interaction=require(_0x554b('0x7'));var config=require(_0x554b('0x8'));var controller=require(_0x554b('0x9'));router[_0x554b('0xa')]('/',auth[_0x554b('0xb')](),controller['index']);router[_0x554b('0xa')](_0x554b('0xc'),controller[_0x554b('0xd')]);router[_0x554b('0xa')](_0x554b('0xe'),controller['show']);router[_0x554b('0xa')](_0x554b('0xf'),controller['getLogo']);router[_0x554b('0xa')]('/:id/logo_login',controller[_0x554b('0x10')]);router[_0x554b('0xa')](_0x554b('0x11'),controller['gdpr']);router[_0x554b('0xa')](_0x554b('0x12'),controller[_0x554b('0x13')]);router[_0x554b('0xa')](_0x554b('0x14'),controller[_0x554b('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34c2c0,_0x132fe1,_0x4a5238){_0x4a5238(null,path[_0x554b('0x16')](config[_0x554b('0x17')],_0x554b('0x18')));},'filename':function(_0x2bcee9,_0x2981df,_0x5e2abe){_0x5e2abe(null,util['format'](_0x554b('0x19'),_0x554b('0x1a'),path[_0x554b('0x1b')](_0x2981df['originalname'])));}})});router[_0x554b('0x1c')](_0x554b('0xf'),upload[_0x554b('0x1d')]('file'),controller[_0x554b('0x1e')]);var upload=multer({'storage':multer[_0x554b('0x1f')]({'destination':function(_0x34d049,_0x4ca72b,_0x5a9576){_0x5a9576(null,path[_0x554b('0x16')](config[_0x554b('0x17')],'server/files/images/logos/'));},'filename':function(_0x5b342c,_0x2da3eb,_0x57738a){_0x57738a(null,util['format'](_0x554b('0x19'),'logologin',path[_0x554b('0x1b')](_0x2da3eb['originalname'])));}})});router[_0x554b('0x1c')](_0x554b('0x20'),upload['single'](_0x554b('0x21')),controller[_0x554b('0x22')]);var upload=multer({'storage':multer[_0x554b('0x1f')]({'destination':function(_0x5c1e38,_0x19400d,_0x14204a){_0x14204a(null,path[_0x554b('0x16')](config[_0x554b('0x17')],'server/files/images/logos/'));},'filename':function(_0xbfce81,_0x25293c,_0x5ed3f8){_0x5ed3f8(null,util[_0x554b('0x23')](_0x554b('0x19'),_0x554b('0x24'),path[_0x554b('0x1b')](_0x25293c['originalname'])));}})});router[_0x554b('0x1c')](_0x554b('0x12'),upload[_0x554b('0x1d')]('file'),controller[_0x554b('0x25')]);var upload=multer({'storage':multer[_0x554b('0x1f')]({'destination':function(_0x578a4c,_0x12bc30,_0x3d7af7){_0x3d7af7(null,path['join'](config[_0x554b('0x17')],_0x554b('0x18')));},'filename':function(_0x5a409,_0x458747,_0x30cae0){_0x30cae0(null,util[_0x554b('0x23')](_0x554b('0x19'),'favicon',path[_0x554b('0x1b')](_0x458747[_0x554b('0x26')])));}})});router[_0x554b('0x1c')](_0x554b('0x14'),upload['single'](_0x554b('0x21')),controller[_0x554b('0x27')]);router[_0x554b('0x28')](_0x554b('0xe'),auth[_0x554b('0xb')](),controller[_0x554b('0x29')]);module[_0x554b('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7171ed1..0d1fcaf 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 _0xf2f8=['exports','min_internal','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0xf2f8,0x96));var _0x8f2f=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xf2f8[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require('sequelize');module[_0x8f2f('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8f2f('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x8f2f('0x2')](0xb),'unique':_0x8f2f('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8f2f('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x8f2f('0x4')},'logo':{'type':Sequelize[_0x8f2f('0x5')]},'defaultLogo':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8f2f('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8f2f('0x5')]},'turnaddr':{'type':Sequelize[_0x8f2f('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x8f2f('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x8f2f('0x5')],'defaultValue':_0x8f2f('0x7')},'enableEmailPreview':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8f2f('0x5')],'defaultValue':_0x8f2f('0x8')},'chatTimeout':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8f2f('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8f2f('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8f2f('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8f2f('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8f2f('0x5')]},'sentiment':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x8f2f('0x5')]},'language':{'type':Sequelize[_0x8f2f('0x5')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x8f2f('0x2')](0x2)[_0x8f2f('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x8f2f('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8f2f('0x2')](0x2)[_0x8f2f('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8f2f('0x2')](0x2)[_0x8f2f('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8f2f('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x8f2f('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x21e4=['alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x21e4,0x141));var _0x421e=function(_0x382cf1,_0x4c611b){_0x382cf1=_0x382cf1-0x0;var _0xbaa8a1=_0x21e4[_0x382cf1];return _0xbaa8a1;};'use strict';var Sequelize=require(_0x421e('0x0'));module[_0x421e('0x1')]={'min_internal':{'type':Sequelize[_0x421e('0x2')](0xb),'unique':_0x421e('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x421e('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x421e('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x421e('0x5')],'defaultValue':_0x421e('0x6')},'logo':{'type':Sequelize[_0x421e('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x421e('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x421e('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x421e('0x5')]},'turnaddr':{'type':Sequelize[_0x421e('0x5')]},'turnusername':{'type':Sequelize[_0x421e('0x5')]},'turnpassword':{'type':Sequelize[_0x421e('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x421e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x421e('0x5')],'defaultValue':_0x421e('0x8')},'enableEmailPreview':{'type':Sequelize[_0x421e('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x421e('0x5')],'defaultValue':_0x421e('0x9')},'chatTimeout':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x421e('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x421e('0x5')]},'defaultFavicon':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x421e('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x421e('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x421e('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x421e('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x421e('0x2')]},'sentimentRegion':{'type':Sequelize[_0x421e('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x421e('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x421e('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x421e('0x2')](0x2)[_0x421e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x421e('0x2')](0x2)[_0x421e('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x421e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x421e('0x2')](0x2)[_0x421e('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x421e('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x421e('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x421e('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index d6cb661..abafd3a 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 _0xf84a=['catch','sendStatus','status','end','limit','count','offset','Content-Range','json','apply','reject','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Setting','includeAll','include','findAll','rows','show','keys','find','update','body','params','addLogo','file','filename','addLogoLogin','getLicense','logo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','loginLogo','defaultLoginLogo','default','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','result','message'];(function(_0x387eb2,_0x5c1199){var _0x41a3c2=function(_0x3deb5d){while(--_0x3deb5d){_0x387eb2['push'](_0x387eb2['shift']());}};_0x41a3c2(++_0x5c1199);}(_0xf84a,0x1c7));var _0xaf84=function(_0x5e1d26,_0x5bc5de){_0x5e1d26=_0x5e1d26-0x0;var _0x26f14f=_0xf84a[_0x5e1d26];return _0x26f14f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf84('0x0'));var zipdir=require(_0xaf84('0x1'));var jsonpatch=require(_0xaf84('0x2'));var rp=require(_0xaf84('0x3'));var moment=require(_0xaf84('0x4'));var BPromise=require(_0xaf84('0x5'));var Mustache=require(_0xaf84('0x6'));var util=require('util');var path=require('path');var sox=require(_0xaf84('0x7'));var csv=require(_0xaf84('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf84('0x9'));var squel=require(_0xaf84('0xa'));var crypto=require(_0xaf84('0xb'));var jsforce=require(_0xaf84('0xc'));var deskjs=require(_0xaf84('0xd'));var toCsv=require(_0xaf84('0x8'));var querystring=require('querystring');var Papa=require(_0xaf84('0xe'));var Redis=require('ioredis');var authService=require(_0xaf84('0xf'));var qs=require(_0xaf84('0x10'));var as=require(_0xaf84('0x11'));var hardwareService=require(_0xaf84('0x12'));var logger=require(_0xaf84('0x13'))(_0xaf84('0x14'));var utils=require(_0xaf84('0x15'));var config=require(_0xaf84('0x16'));var licenseUtil=require(_0xaf84('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xaf84('0x18'));var client=jayson[_0xaf84('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484397,_0x2879ad,_0x593e4f,_0x58a74d){return new BPromise(function(_0x5783c9,_0x223f2c){var _0x5f4408=_0x58a74d||client;return _0x5f4408[_0xaf84('0x1a')](_0x484397,_0x593e4f)[_0xaf84('0x1b')](function(_0x3f77eb){logger[_0xaf84('0x1c')](_0xaf84('0x1d'),_0x2879ad,_0xaf84('0x1e'));logger[_0xaf84('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x2879ad,_0xaf84('0x1e'),JSON[_0xaf84('0x20')](_0x3f77eb));if(_0x3f77eb[_0xaf84('0x21')]){if(_0x3f77eb[_0xaf84('0x21')][_0xaf84('0x22')]===0x1f4){logger[_0xaf84('0x21')](_0xaf84('0x1d'),_0x2879ad,_0x3f77eb['error']['message']);return _0x223f2c(_0x3f77eb[_0xaf84('0x21')]['message']);}logger['error'](_0xaf84('0x1d'),_0x2879ad,_0x3f77eb['error']['message']);return _0x5783c9(_0x3f77eb[_0xaf84('0x21')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x2879ad,_0xaf84('0x1e'));_0x5783c9(_0x3f77eb[_0xaf84('0x23')][_0xaf84('0x24')]);}})[_0xaf84('0x25')](function(_0x540b99){logger['error'](_0xaf84('0x1d'),_0x2879ad,_0x540b99);_0x223f2c(_0x540b99);});});}function respondWithStatusCode(_0x1b67ac,_0x5c2894){_0x5c2894=_0x5c2894||0xcc;return function(_0x32e612){if(_0x32e612){return _0x1b67ac[_0xaf84('0x26')](_0x5c2894);}return _0x1b67ac[_0xaf84('0x27')](_0x5c2894)[_0xaf84('0x28')]();};}function respondWithResult(_0x4634bb,_0x5cdad1){_0x5cdad1=_0x5cdad1||0xc8;return function(_0x2b173c){if(_0x2b173c){return _0x4634bb[_0xaf84('0x27')](_0x5cdad1)['json'](_0x2b173c);}};}function respondWithFilteredResult(_0x1f8d47,_0x58b8c9){return function(_0x46b26d){if(_0x46b26d){var _0x9de7ef=typeof _0x58b8c9['offset']==='undefined'&&typeof _0x58b8c9[_0xaf84('0x29')]==='undefined';var _0x125590=_0x46b26d[_0xaf84('0x2a')];var _0x38fe68=_0x9de7ef?0x0:_0x58b8c9[_0xaf84('0x2b')];var _0x380549=_0x9de7ef?_0x46b26d[_0xaf84('0x2a')]:_0x58b8c9['offset']+_0x58b8c9['limit'];var _0x2273b5;if(_0x380549>=_0x125590){_0x380549=_0x125590;_0x2273b5=0xc8;}else{_0x2273b5=0xce;}_0x1f8d47[_0xaf84('0x27')](_0x2273b5);return _0x1f8d47['set'](_0xaf84('0x2c'),_0x38fe68+'-'+_0x380549+'/'+_0x125590)[_0xaf84('0x2d')](_0x46b26d);}return null;};}function patchUpdates(_0x2802ee){return function(_0x4c7e1e){try{jsonpatch[_0xaf84('0x2e')](_0x4c7e1e,_0x2802ee,!![]);}catch(_0x13055a){return BPromise[_0xaf84('0x2f')](_0x13055a);}return _0x4c7e1e['save']();};}function saveUpdates(_0x2554b4,_0x1e302e){return function(_0xcc1032){if(_0xcc1032){return _0xcc1032['update'](_0x2554b4)[_0xaf84('0x1b')](function(_0x344cca){return _0x344cca;});}return null;};}function removeEntity(_0x382a5e,_0x145ce3){return function(_0x343fe8){if(_0x343fe8){return _0x343fe8['destroy']()[_0xaf84('0x1b')](function(){_0x382a5e[_0xaf84('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6147,_0x5607fd){return function(_0x5cebc9){if(!_0x5cebc9){_0x5e6147[_0xaf84('0x26')](0x194);}return _0x5cebc9;};}function handleError(_0x5dbc43,_0x5592e4){_0x5592e4=_0x5592e4||0x1f4;return function(_0x4dd023){logger[_0xaf84('0x21')](_0x4dd023[_0xaf84('0x30')]);if(_0x4dd023[_0xaf84('0x31')]){delete _0x4dd023[_0xaf84('0x31')];}_0x5dbc43['status'](_0x5592e4)[_0xaf84('0x32')](_0x4dd023);};}exports[_0xaf84('0x33')]=function(_0x4b6ba1,_0x56f013){var _0x18ac16={},_0x3e7989={},_0x43c1a3={'count':0x0,'rows':[]};var _0xebc0d8=_['map'](db['Setting'][_0xaf84('0x34')],function(_0x55e6c2){return{'name':_0x55e6c2['fieldName'],'type':_0x55e6c2[_0xaf84('0x35')][_0xaf84('0x36')]};});_0x3e7989[_0xaf84('0x37')]=_[_0xaf84('0x38')](_0xebc0d8,'name');_0x3e7989[_0xaf84('0x39')]=_['keys'](_0x4b6ba1[_0xaf84('0x39')]);_0x3e7989[_0xaf84('0x3a')]=_[_0xaf84('0x3b')](_0x3e7989[_0xaf84('0x37')],_0x3e7989[_0xaf84('0x39')]);_0x18ac16[_0xaf84('0x3c')]=_[_0xaf84('0x3b')](_0x3e7989['model'],qs[_0xaf84('0x3d')](_0x4b6ba1['query'][_0xaf84('0x3d')]));_0x18ac16[_0xaf84('0x3c')]=_0x18ac16[_0xaf84('0x3c')][_0xaf84('0x3e')]?_0x18ac16['attributes']:_0x3e7989[_0xaf84('0x37')];if(!_0x4b6ba1['query']['hasOwnProperty'](_0xaf84('0x3f'))){_0x18ac16[_0xaf84('0x29')]=qs[_0xaf84('0x29')](_0x4b6ba1[_0xaf84('0x39')]['limit']);_0x18ac16[_0xaf84('0x2b')]=qs['offset'](_0x4b6ba1[_0xaf84('0x39')][_0xaf84('0x2b')]);}_0x18ac16[_0xaf84('0x40')]=qs[_0xaf84('0x41')](_0x4b6ba1[_0xaf84('0x39')]['sort']);_0x18ac16['where']=qs[_0xaf84('0x3a')](_['pick'](_0x4b6ba1['query'],_0x3e7989[_0xaf84('0x3a')]),_0xebc0d8);if(_0x4b6ba1[_0xaf84('0x39')]['filter']){_0x18ac16[_0xaf84('0x42')]=_[_0xaf84('0x43')](_0x18ac16[_0xaf84('0x42')],{'$or':_[_0xaf84('0x38')](_0xebc0d8,function(_0x1198d6){if(_0x1198d6['type']!==_0xaf84('0x44')){var _0x77708={};_0x77708[_0x1198d6[_0xaf84('0x31')]]={'$like':'%'+_0x4b6ba1['query'][_0xaf84('0x45')]+'%'};return _0x77708;}})});}_0x18ac16=_['merge']({},_0x18ac16,_0x4b6ba1[_0xaf84('0x46')]);var _0x32ecbb={'where':_0x18ac16[_0xaf84('0x42')]};return db[_0xaf84('0x47')]['count'](_0x32ecbb)[_0xaf84('0x1b')](function(_0x885e0){_0x43c1a3[_0xaf84('0x2a')]=_0x885e0;if(_0x4b6ba1[_0xaf84('0x39')][_0xaf84('0x48')]){_0x18ac16[_0xaf84('0x49')]=[{'all':!![]}];}return db['Setting'][_0xaf84('0x4a')](_0x18ac16);})['then'](function(_0x3d07a3){_0x43c1a3[_0xaf84('0x4b')]=_0x3d07a3;return _0x43c1a3;})['then'](respondWithFilteredResult(_0x56f013,_0x18ac16))[_0xaf84('0x25')](handleError(_0x56f013,null));};exports[_0xaf84('0x4c')]=function(_0x4d8783,_0x3462ab){var _0x54ae8b={'raw':![],'where':{'id':_0x4d8783['params']['id']}},_0x267acd={};_0x267acd[_0xaf84('0x37')]=_['keys'](db[_0xaf84('0x47')][_0xaf84('0x34')]);_0x267acd[_0xaf84('0x39')]=_[_0xaf84('0x4d')](_0x4d8783['query']);_0x267acd[_0xaf84('0x3a')]=_[_0xaf84('0x3b')](_0x267acd[_0xaf84('0x37')],_0x267acd[_0xaf84('0x39')]);_0x54ae8b[_0xaf84('0x3c')]=_['intersection'](_0x267acd[_0xaf84('0x37')],qs[_0xaf84('0x3d')](_0x4d8783[_0xaf84('0x39')]['fields']));_0x54ae8b[_0xaf84('0x3c')]=_0x54ae8b[_0xaf84('0x3c')][_0xaf84('0x3e')]?_0x54ae8b[_0xaf84('0x3c')]:_0x267acd[_0xaf84('0x37')];if(_0x4d8783[_0xaf84('0x39')][_0xaf84('0x48')]){_0x54ae8b[_0xaf84('0x49')]=[{'all':!![]}];}_0x54ae8b=_[_0xaf84('0x43')]({},_0x54ae8b,_0x4d8783[_0xaf84('0x46')]);return db['Setting'][_0xaf84('0x4e')](_0x54ae8b)[_0xaf84('0x1b')](handleEntityNotFound(_0x3462ab,null))[_0xaf84('0x1b')](respondWithResult(_0x3462ab,null))[_0xaf84('0x25')](handleError(_0x3462ab,null));};exports[_0xaf84('0x4f')]=function(_0xf8b553,_0x55c9fc){if(_0xf8b553['body']['id']){delete _0xf8b553[_0xaf84('0x50')]['id'];}return db[_0xaf84('0x47')]['find']({'where':{'id':_0xf8b553[_0xaf84('0x51')]['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x55c9fc,null))[_0xaf84('0x1b')](saveUpdates(_0xf8b553['body'],null))['then'](respondWithResult(_0x55c9fc,null))['catch'](handleError(_0x55c9fc,null));};exports[_0xaf84('0x52')]=function(_0x282bf0,_0x11ff5f,_0x282807){if(_0x282bf0[_0xaf84('0x53')]&&_0x282bf0[_0xaf84('0x53')][_0xaf84('0x54')]){_0x282bf0[_0xaf84('0x50')]['logo']=_0x282bf0[_0xaf84('0x53')][_0xaf84('0x54')];}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x282bf0['params']['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x11ff5f,null))['then'](saveUpdates(_0x282bf0[_0xaf84('0x50')],null))[_0xaf84('0x1b')](respondWithResult(_0x11ff5f,null))[_0xaf84('0x25')](handleError(_0x11ff5f,null));};exports[_0xaf84('0x55')]=function(_0xd6e140,_0x881f25,_0x1ea8ff){if(_0xd6e140[_0xaf84('0x53')]&&_0xd6e140[_0xaf84('0x53')]['filename']){_0xd6e140[_0xaf84('0x50')]['loginLogo']=_0xd6e140[_0xaf84('0x53')][_0xaf84('0x54')];}return db[_0xaf84('0x47')]['find']({'where':{'id':_0xd6e140[_0xaf84('0x51')]['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x881f25,null))['then'](saveUpdates(_0xd6e140[_0xaf84('0x50')],null))['then'](respondWithResult(_0x881f25,null))['catch'](handleError(_0x881f25,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x332c45,_0x1f6ada,_0x49a677){var _0x2d5ab3='server/files/images/logos';var _0x7256f7={'custom':![]};return utilLicense[_0xaf84('0x56')]()[_0xaf84('0x1b')](function(_0x13feaf){if(_0x13feaf){_0x7256f7=_0x13feaf;}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x332c45['params']['id']},'attributes':[_0xaf84('0x57'),'loginLogo',_0xaf84('0x58'),_0xaf84('0x59'),_0xaf84('0x5a'),'defaultLoginLogo','defaultPreferred',_0xaf84('0x5b')],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x1f6ada,null))['then'](function(_0x191a7d){if(_0x191a7d){var _0x2b7826=_0x191a7d[_0xaf84('0x57')]&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x2d5ab3,_[_0xaf84('0x5f')](_0x191a7d[_0xaf84('0x57')])))?path['join'](config['root'],_0x2d5ab3,_[_0xaf84('0x5f')](_0x191a7d[_0xaf84('0x57')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x2d5ab3,_[_0xaf84('0x5f')]('default_logo.svg'));var _0xab55dc='default'+_[_0xaf84('0x60')](_0xaf84('0x57'));if(_0x191a7d[_0xab55dc]||!_0x7256f7[_0xaf84('0x61')]){_0x2b7826=path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x2d5ab3,_[_0xaf84('0x5f')](_0xaf84('0x62')));}if(!fs['existsSync'](_0x2b7826)){throw new db[(_0xaf84('0x63'))][(_0xaf84('0x64'))](_[_0xaf84('0x60')]('logo')+_0xaf84('0x65'));}return _0x1f6ada[_0xaf84('0x66')](_0x2b7826);}})[_0xaf84('0x25')](handleError(_0x1f6ada,null));};var utilLicense=require(_0xaf84('0x17'));exports[_0xaf84('0x67')]=function(_0x13d6fc,_0x264431,_0x2656db){var _0x55ce87=_0xaf84('0x68');var _0x47586a={'custom':![]};return utilLicense[_0xaf84('0x56')]()[_0xaf84('0x1b')](function(_0x3e86ea){if(_0x3e86ea){_0x47586a=_0x3e86ea;}return db[_0xaf84('0x47')][_0xaf84('0x4e')]({'where':{'id':_0x13d6fc[_0xaf84('0x51')]['id']},'attributes':[_0xaf84('0x57'),_0xaf84('0x69'),_0xaf84('0x58'),'favicon',_0xaf84('0x5a'),_0xaf84('0x6a'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x264431,null))['then'](function(_0x800770){if(_0x800770){var _0x25dbf6=_0x800770['loginLogo']&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')](_0x800770['loginLogo'])))?path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')](_0x800770[_0xaf84('0x69')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')]('default_loginLogo.svg'));var _0xde9b58=_0xaf84('0x6b')+_[_0xaf84('0x60')](_0xaf84('0x69'));if(_0x800770[_0xde9b58]||!_0x47586a[_0xaf84('0x61')]){_0x25dbf6=path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x55ce87,_[_0xaf84('0x5f')](_0xaf84('0x6c')));}if(!fs['existsSync'](_0x25dbf6)){throw new db[(_0xaf84('0x63'))][(_0xaf84('0x64'))](_[_0xaf84('0x60')](_0xaf84('0x69'))+'\x20not\x20found');}return _0x264431[_0xaf84('0x66')](_0x25dbf6);}})[_0xaf84('0x25')](handleError(_0x264431,null));};exports[_0xaf84('0x6d')]=function(_0xdb6977,_0x55b3ed){return db[_0xaf84('0x47')][_0xaf84('0x4e')]({'where':{'id':_0xdb6977['params']['id']},'attributes':[_0xaf84('0x6e')]})[_0xaf84('0x1b')](respondWithResult(_0x55b3ed,null))[_0xaf84('0x25')](handleError(_0x55b3ed,null));};exports[_0xaf84('0x6f')]=function(_0x3c086a,_0x179881,_0xad4ac9){if(_0x3c086a[_0xaf84('0x53')]&&_0x3c086a[_0xaf84('0x53')][_0xaf84('0x54')]){_0x3c086a[_0xaf84('0x50')][_0xaf84('0x58')]=_0x3c086a[_0xaf84('0x53')]['filename'];}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x3c086a['params']['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x179881,null))['then'](saveUpdates(_0x3c086a[_0xaf84('0x50')],null))['then'](respondWithResult(_0x179881,null))['catch'](handleError(_0x179881,null));};var utilLicense=require(_0xaf84('0x17'));exports[_0xaf84('0x70')]=function(_0x609210,_0x49ac99,_0x6250c9){var _0x10dd8b=_0xaf84('0x68');var _0x41e307={'custom':![]};return utilLicense[_0xaf84('0x56')]()['then'](function(_0x4042a8){if(_0x4042a8){_0x41e307=_0x4042a8;}return db['Setting'][_0xaf84('0x4e')]({'where':{'id':_0x609210['params']['id']},'attributes':[_0xaf84('0x57'),_0xaf84('0x69'),_0xaf84('0x58'),_0xaf84('0x59'),'defaultLogo',_0xaf84('0x6a'),_0xaf84('0x71'),_0xaf84('0x5b')],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x49ac99,null))[_0xaf84('0x1b')](function(_0x260f6c){if(_0x260f6c){var _0x34a41e=_0x260f6c['preferred']&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x10dd8b,_['toLower'](_0x260f6c['preferred'])))?path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x10dd8b,_[_0xaf84('0x5f')](_0x260f6c[_0xaf84('0x58')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x10dd8b,_[_0xaf84('0x5f')](_0xaf84('0x72')));var _0x1ff642=_0xaf84('0x6b')+_[_0xaf84('0x60')](_0xaf84('0x58'));if(_0x260f6c[_0x1ff642]||!_0x41e307[_0xaf84('0x61')]||!_0x41e307[_0xaf84('0x58')]){_0x34a41e=path['join'](config[_0xaf84('0x5e')],_0x10dd8b,_[_0xaf84('0x5f')](_0xaf84('0x72')));}if(!fs[_0xaf84('0x5c')](_0x34a41e)){throw new db[(_0xaf84('0x63'))][(_0xaf84('0x64'))](_[_0xaf84('0x60')](_0xaf84('0x58'))+_0xaf84('0x65'));}return _0x49ac99['download'](_0x34a41e);}})[_0xaf84('0x25')](handleError(_0x49ac99,null));};exports[_0xaf84('0x73')]=function(_0x36c50d,_0x100c98,_0x180eef){if(_0x36c50d[_0xaf84('0x53')]&&_0x36c50d[_0xaf84('0x53')][_0xaf84('0x54')]){_0x36c50d['body'][_0xaf84('0x59')]=_0x36c50d[_0xaf84('0x53')]['filename'];}return db[_0xaf84('0x47')]['find']({'where':{'id':_0x36c50d[_0xaf84('0x51')]['id']}})[_0xaf84('0x1b')](handleEntityNotFound(_0x100c98,null))['then'](saveUpdates(_0x36c50d['body'],null))[_0xaf84('0x1b')](respondWithResult(_0x100c98,null))[_0xaf84('0x25')](handleError(_0x100c98,null));};var utilLicense=require(_0xaf84('0x17'));exports[_0xaf84('0x74')]=function(_0x140918,_0x83601,_0x3a601e){var _0x260988=_0xaf84('0x68');var _0x10b9da={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x4450fe){if(_0x4450fe){_0x10b9da=_0x4450fe;}return db[_0xaf84('0x47')][_0xaf84('0x4e')]({'where':{'id':_0x140918[_0xaf84('0x51')]['id']},'attributes':['logo',_0xaf84('0x69'),_0xaf84('0x58'),_0xaf84('0x59'),_0xaf84('0x5a'),_0xaf84('0x6a'),_0xaf84('0x71'),'defaultFavicon'],'raw':!![]});})[_0xaf84('0x1b')](handleEntityNotFound(_0x83601,null))[_0xaf84('0x1b')](function(_0x2bad7f){if(_0x2bad7f){var _0x287086=_0x2bad7f[_0xaf84('0x59')]&&fs[_0xaf84('0x5c')](path[_0xaf84('0x5d')](config['root'],_0x260988,_[_0xaf84('0x5f')](_0x2bad7f[_0xaf84('0x59')])))?path['join'](config[_0xaf84('0x5e')],_0x260988,_['toLower'](_0x2bad7f[_0xaf84('0x59')])):path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x260988,_[_0xaf84('0x5f')](_0xaf84('0x75')));var _0x2e9539=_0xaf84('0x6b')+_['upperFirst'](_0xaf84('0x59'));if(_0x2bad7f[_0x2e9539]||!_0x10b9da[_0xaf84('0x61')]){_0x287086=path[_0xaf84('0x5d')](config[_0xaf84('0x5e')],_0x260988,_['toLower']('default_favicon.ico'));}if(!fs[_0xaf84('0x5c')](_0x287086)){throw new db[(_0xaf84('0x63'))]['ValidationError'](_[_0xaf84('0x60')](_0xaf84('0x59'))+_0xaf84('0x65'));}return _0x83601['download'](_0x287086);}})[_0xaf84('0x25')](handleError(_0x83601,null));};exports[_0xaf84('0x76')]=function(_0x530800,_0x2c0bf1){var _0x5e2a61={'offset':moment()[_0xaf84('0x77')]()};_0x5e2a61[_0xaf84('0x78')]=moment()[_0xaf84('0x77')](_0x5e2a61[_0xaf84('0x2b')])[_0xaf84('0x79')](_0xaf84('0x7a'));return _0x2c0bf1[_0xaf84('0x27')](0xc8)[_0xaf84('0x32')](_0x5e2a61);}; \ No newline at end of file +var _0x5e85=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','sendStatus','stack','name','index','map','Setting','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','favicon','default_loginLogo.svg','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x11dc6c,_0x21bdfe){var _0xddae9c=function(_0x11f846){while(--_0x11f846){_0x11dc6c['push'](_0x11dc6c['shift']());}};_0xddae9c(++_0x21bdfe);}(_0x5e85,0x161));var _0x55e8=function(_0x395c18,_0x3eb640){_0x395c18=_0x395c18-0x0;var _0x570132=_0x5e85[_0x395c18];return _0x570132;};'use strict';var emlformat=require(_0x55e8('0x0'));var rimraf=require(_0x55e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x55e8('0x2'));var moment=require('moment');var BPromise=require(_0x55e8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x55e8('0x4'));var sox=require(_0x55e8('0x5'));var csv=require('to-csv');var ejs=require(_0x55e8('0x6'));var fs=require('fs');var fs_extra=require(_0x55e8('0x7'));var _=require(_0x55e8('0x8'));var squel=require(_0x55e8('0x9'));var crypto=require(_0x55e8('0xa'));var jsforce=require(_0x55e8('0xb'));var deskjs=require(_0x55e8('0xc'));var toCsv=require(_0x55e8('0xd'));var querystring=require(_0x55e8('0xe'));var Papa=require(_0x55e8('0xf'));var Redis=require(_0x55e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x55e8('0x11'));var as=require(_0x55e8('0x12'));var hardwareService=require(_0x55e8('0x13'));var logger=require(_0x55e8('0x14'))(_0x55e8('0x15'));var utils=require(_0x55e8('0x16'));var config=require(_0x55e8('0x17'));var licenseUtil=require(_0x55e8('0x18'));var db=require(_0x55e8('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x55e8('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57ab00,_0x45889e,_0x33c09b,_0xf1a1da){return new BPromise(function(_0x5a2cb8,_0x39a715){var _0x177b74=_0xf1a1da||client;return _0x177b74['request'](_0x57ab00,_0x33c09b)[_0x55e8('0x1b')](function(_0x2e9e16){logger[_0x55e8('0x1c')](_0x55e8('0x1d'),_0x45889e,'request\x20sent');logger[_0x55e8('0x1e')](_0x55e8('0x1f'),_0x45889e,_0x55e8('0x20'),JSON[_0x55e8('0x21')](_0x2e9e16));if(_0x2e9e16[_0x55e8('0x22')]){if(_0x2e9e16['error'][_0x55e8('0x23')]===0x1f4){logger[_0x55e8('0x22')](_0x55e8('0x1d'),_0x45889e,_0x2e9e16[_0x55e8('0x22')][_0x55e8('0x24')]);return _0x39a715(_0x2e9e16[_0x55e8('0x22')]['message']);}logger[_0x55e8('0x22')]('Setting,\x20%s,\x20%s',_0x45889e,_0x2e9e16['error']['message']);return _0x5a2cb8(_0x2e9e16[_0x55e8('0x22')][_0x55e8('0x24')]);}else{logger[_0x55e8('0x1c')](_0x55e8('0x1d'),_0x45889e,_0x55e8('0x20'));_0x5a2cb8(_0x2e9e16[_0x55e8('0x25')][_0x55e8('0x24')]);}})['catch'](function(_0x4a4be7){logger['error']('Setting,\x20%s,\x20%s',_0x45889e,_0x4a4be7);_0x39a715(_0x4a4be7);});});}function respondWithStatusCode(_0x3de897,_0x21225a){_0x21225a=_0x21225a||0xcc;return function(_0x13d48f){if(_0x13d48f){return _0x3de897['sendStatus'](_0x21225a);}return _0x3de897[_0x55e8('0x26')](_0x21225a)[_0x55e8('0x27')]();};}function respondWithResult(_0xd5b5af,_0x26b46a){_0x26b46a=_0x26b46a||0xc8;return function(_0x415032){if(_0x415032){return _0xd5b5af['status'](_0x26b46a)[_0x55e8('0x28')](_0x415032);}};}function respondWithFilteredResult(_0x58c56d,_0x39bee5){return function(_0x44d775){if(_0x44d775){var _0x3cf6f3=typeof _0x39bee5[_0x55e8('0x29')]===_0x55e8('0x2a')&&typeof _0x39bee5[_0x55e8('0x2b')]===_0x55e8('0x2a');var _0xdd6d7b=_0x44d775['count'];var _0x3be122=_0x3cf6f3?0x0:_0x39bee5[_0x55e8('0x29')];var _0x1954e3=_0x3cf6f3?_0x44d775[_0x55e8('0x2c')]:_0x39bee5['offset']+_0x39bee5[_0x55e8('0x2b')];var _0x4cbe52;if(_0x1954e3>=_0xdd6d7b){_0x1954e3=_0xdd6d7b;_0x4cbe52=0xc8;}else{_0x4cbe52=0xce;}_0x58c56d[_0x55e8('0x26')](_0x4cbe52);return _0x58c56d[_0x55e8('0x2d')]('Content-Range',_0x3be122+'-'+_0x1954e3+'/'+_0xdd6d7b)['json'](_0x44d775);}return null;};}function patchUpdates(_0x5b5526){return function(_0x57dd5b){try{jsonpatch['apply'](_0x57dd5b,_0x5b5526,!![]);}catch(_0x560d32){return BPromise[_0x55e8('0x2e')](_0x560d32);}return _0x57dd5b['save']();};}function saveUpdates(_0x3dcb78,_0x236496){return function(_0x3c3624){if(_0x3c3624){return _0x3c3624[_0x55e8('0x2f')](_0x3dcb78)[_0x55e8('0x1b')](function(_0x23d064){return _0x23d064;});}return null;};}function removeEntity(_0x1c2fd2,_0x2ecd40){return function(_0x3fd282){if(_0x3fd282){return _0x3fd282[_0x55e8('0x30')]()[_0x55e8('0x1b')](function(){_0x1c2fd2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec9db,_0x258c5f){return function(_0x44524c){if(!_0x44524c){_0x4ec9db[_0x55e8('0x31')](0x194);}return _0x44524c;};}function handleError(_0xb55b64,_0x5f9d36){_0x5f9d36=_0x5f9d36||0x1f4;return function(_0x3260ff){logger[_0x55e8('0x22')](_0x3260ff[_0x55e8('0x32')]);if(_0x3260ff[_0x55e8('0x33')]){delete _0x3260ff[_0x55e8('0x33')];}_0xb55b64[_0x55e8('0x26')](_0x5f9d36)['send'](_0x3260ff);};}exports[_0x55e8('0x34')]=function(_0x3fcfcb,_0x364ce3){var _0x5f0ad3={},_0x14556c={},_0x480129={'count':0x0,'rows':[]};var _0x2e1155=_[_0x55e8('0x35')](db[_0x55e8('0x36')][_0x55e8('0x37')],function(_0x481035){return{'name':_0x481035[_0x55e8('0x38')],'type':_0x481035[_0x55e8('0x39')]['key']};});_0x14556c[_0x55e8('0x3a')]=_[_0x55e8('0x35')](_0x2e1155,'name');_0x14556c['query']=_[_0x55e8('0x3b')](_0x3fcfcb['query']);_0x14556c[_0x55e8('0x3c')]=_[_0x55e8('0x3d')](_0x14556c[_0x55e8('0x3a')],_0x14556c[_0x55e8('0x3e')]);_0x5f0ad3[_0x55e8('0x3f')]=_[_0x55e8('0x3d')](_0x14556c[_0x55e8('0x3a')],qs['fields'](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x40')]));_0x5f0ad3[_0x55e8('0x3f')]=_0x5f0ad3['attributes'][_0x55e8('0x41')]?_0x5f0ad3[_0x55e8('0x3f')]:_0x14556c[_0x55e8('0x3a')];if(!_0x3fcfcb['query'][_0x55e8('0x42')]('nolimit')){_0x5f0ad3[_0x55e8('0x2b')]=qs[_0x55e8('0x2b')](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x2b')]);_0x5f0ad3[_0x55e8('0x29')]=qs[_0x55e8('0x29')](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x29')]);}_0x5f0ad3[_0x55e8('0x43')]=qs[_0x55e8('0x44')](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x44')]);_0x5f0ad3[_0x55e8('0x45')]=qs[_0x55e8('0x3c')](_[_0x55e8('0x46')](_0x3fcfcb[_0x55e8('0x3e')],_0x14556c[_0x55e8('0x3c')]),_0x2e1155);if(_0x3fcfcb[_0x55e8('0x3e')]['filter']){_0x5f0ad3[_0x55e8('0x45')]=_[_0x55e8('0x47')](_0x5f0ad3[_0x55e8('0x45')],{'$or':_[_0x55e8('0x35')](_0x2e1155,function(_0x2faae0){if(_0x2faae0[_0x55e8('0x39')]!==_0x55e8('0x48')){var _0x50e5b2={};_0x50e5b2[_0x2faae0['name']]={'$like':'%'+_0x3fcfcb['query']['filter']+'%'};return _0x50e5b2;}})});}_0x5f0ad3=_[_0x55e8('0x47')]({},_0x5f0ad3,_0x3fcfcb[_0x55e8('0x49')]);var _0x333e58={'where':_0x5f0ad3[_0x55e8('0x45')]};return db[_0x55e8('0x36')][_0x55e8('0x2c')](_0x333e58)[_0x55e8('0x1b')](function(_0x4a6969){_0x480129[_0x55e8('0x2c')]=_0x4a6969;if(_0x3fcfcb['query'][_0x55e8('0x4a')]){_0x5f0ad3['include']=[{'all':!![]}];}return db[_0x55e8('0x36')]['findAll'](_0x5f0ad3);})['then'](function(_0x23af0c){_0x480129[_0x55e8('0x4b')]=_0x23af0c;return _0x480129;})[_0x55e8('0x1b')](respondWithFilteredResult(_0x364ce3,_0x5f0ad3))[_0x55e8('0x4c')](handleError(_0x364ce3,null));};exports[_0x55e8('0x4d')]=function(_0x4d3628,_0x29a246){var _0x4c1e78={'raw':![],'where':{'id':_0x4d3628[_0x55e8('0x4e')]['id']}},_0x5e9fdc={};_0x5e9fdc[_0x55e8('0x3a')]=_[_0x55e8('0x3b')](db[_0x55e8('0x36')][_0x55e8('0x37')]);_0x5e9fdc['query']=_[_0x55e8('0x3b')](_0x4d3628[_0x55e8('0x3e')]);_0x5e9fdc[_0x55e8('0x3c')]=_[_0x55e8('0x3d')](_0x5e9fdc[_0x55e8('0x3a')],_0x5e9fdc[_0x55e8('0x3e')]);_0x4c1e78[_0x55e8('0x3f')]=_[_0x55e8('0x3d')](_0x5e9fdc[_0x55e8('0x3a')],qs['fields'](_0x4d3628[_0x55e8('0x3e')][_0x55e8('0x40')]));_0x4c1e78[_0x55e8('0x3f')]=_0x4c1e78[_0x55e8('0x3f')][_0x55e8('0x41')]?_0x4c1e78['attributes']:_0x5e9fdc['model'];if(_0x4d3628[_0x55e8('0x3e')][_0x55e8('0x4a')]){_0x4c1e78[_0x55e8('0x4f')]=[{'all':!![]}];}_0x4c1e78=_['merge']({},_0x4c1e78,_0x4d3628[_0x55e8('0x49')]);return db['Setting'][_0x55e8('0x50')](_0x4c1e78)[_0x55e8('0x1b')](handleEntityNotFound(_0x29a246,null))['then'](respondWithResult(_0x29a246,null))[_0x55e8('0x4c')](handleError(_0x29a246,null));};exports['update']=function(_0x3cd180,_0x269d17){if(_0x3cd180['body']['id']){delete _0x3cd180['body']['id'];}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x3cd180[_0x55e8('0x4e')]['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x269d17,null))[_0x55e8('0x1b')](saveUpdates(_0x3cd180[_0x55e8('0x51')],null))[_0x55e8('0x1b')](respondWithResult(_0x269d17,null))[_0x55e8('0x4c')](handleError(_0x269d17,null));};exports[_0x55e8('0x52')]=function(_0x58fc8e,_0x36baa8,_0x19793e){if(_0x58fc8e['file']&&_0x58fc8e[_0x55e8('0x53')][_0x55e8('0x54')]){_0x58fc8e['body'][_0x55e8('0x55')]=_0x58fc8e[_0x55e8('0x53')][_0x55e8('0x54')];}return db[_0x55e8('0x36')]['find']({'where':{'id':_0x58fc8e['params']['id']}})['then'](handleEntityNotFound(_0x36baa8,null))[_0x55e8('0x1b')](saveUpdates(_0x58fc8e[_0x55e8('0x51')],null))['then'](respondWithResult(_0x36baa8,null))[_0x55e8('0x4c')](handleError(_0x36baa8,null));};exports[_0x55e8('0x56')]=function(_0x19c97c,_0x50f5e3,_0x3ded51){if(_0x19c97c[_0x55e8('0x53')]&&_0x19c97c[_0x55e8('0x53')][_0x55e8('0x54')]){_0x19c97c[_0x55e8('0x51')][_0x55e8('0x57')]=_0x19c97c['file'][_0x55e8('0x54')];}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x19c97c['params']['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x50f5e3,null))[_0x55e8('0x1b')](saveUpdates(_0x19c97c['body'],null))['then'](respondWithResult(_0x50f5e3,null))[_0x55e8('0x4c')](handleError(_0x50f5e3,null));};var utilLicense=require('../../config/license/util');exports[_0x55e8('0x58')]=function(_0x12eb15,_0x52e250,_0x5ea1f5){var _0x27f6cf=_0x55e8('0x59');var _0x5413b4={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x7bd431){if(_0x7bd431){_0x5413b4=_0x7bd431;}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x12eb15[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),_0x55e8('0x57'),_0x55e8('0x5a'),'favicon',_0x55e8('0x5b'),_0x55e8('0x5c'),_0x55e8('0x5d'),_0x55e8('0x5e')],'raw':!![]});})[_0x55e8('0x1b')](handleEntityNotFound(_0x52e250,null))['then'](function(_0xdc1e34){if(_0xdc1e34){var _0x2feeaa=_0xdc1e34[_0x55e8('0x55')]&&fs['existsSync'](path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_['toLower'](_0xdc1e34['logo'])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_[_0x55e8('0x61')](_0xdc1e34[_0x55e8('0x55')])):path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_[_0x55e8('0x61')](_0x55e8('0x62')));var _0x319dea=_0x55e8('0x63')+_[_0x55e8('0x64')](_0x55e8('0x55'));if(_0xdc1e34[_0x319dea]||!_0x5413b4[_0x55e8('0x65')]){_0x2feeaa=path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_[_0x55e8('0x61')](_0x55e8('0x62')));}if(!fs[_0x55e8('0x66')](_0x2feeaa)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_[_0x55e8('0x64')](_0x55e8('0x55'))+_0x55e8('0x69'));}return _0x52e250[_0x55e8('0x6a')](_0x2feeaa);}})[_0x55e8('0x4c')](handleError(_0x52e250,null));};var utilLicense=require(_0x55e8('0x18'));exports[_0x55e8('0x6b')]=function(_0x137e2f,_0x35bd40,_0x3897df){var _0x586021=_0x55e8('0x59');var _0x4db8bc={'custom':![]};return utilLicense[_0x55e8('0x6c')]()[_0x55e8('0x1b')](function(_0x56c627){if(_0x56c627){_0x4db8bc=_0x56c627;}return db['Setting'][_0x55e8('0x50')]({'where':{'id':_0x137e2f[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),_0x55e8('0x57'),_0x55e8('0x5a'),_0x55e8('0x6d'),_0x55e8('0x5b'),_0x55e8('0x5c'),_0x55e8('0x5d'),_0x55e8('0x5e')],'raw':!![]});})[_0x55e8('0x1b')](handleEntityNotFound(_0x35bd40,null))[_0x55e8('0x1b')](function(_0x1d507e){if(_0x1d507e){var _0x3f119d=_0x1d507e[_0x55e8('0x57')]&&fs[_0x55e8('0x66')](path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x586021,_[_0x55e8('0x61')](_0x1d507e[_0x55e8('0x57')])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x586021,_[_0x55e8('0x61')](_0x1d507e[_0x55e8('0x57')])):path['join'](config['root'],_0x586021,_[_0x55e8('0x61')](_0x55e8('0x6e')));var _0x1c0195=_0x55e8('0x63')+_[_0x55e8('0x64')](_0x55e8('0x57'));if(_0x1d507e[_0x1c0195]||!_0x4db8bc[_0x55e8('0x65')]){_0x3f119d=path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x586021,_[_0x55e8('0x61')](_0x55e8('0x6e')));}if(!fs[_0x55e8('0x66')](_0x3f119d)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_[_0x55e8('0x64')]('loginLogo')+'\x20not\x20found');}return _0x35bd40[_0x55e8('0x6a')](_0x3f119d);}})[_0x55e8('0x4c')](handleError(_0x35bd40,null));};exports['gdpr']=function(_0x4c0ed5,_0x400916){return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x4c0ed5[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x6f')]})[_0x55e8('0x1b')](respondWithResult(_0x400916,null))[_0x55e8('0x4c')](handleError(_0x400916,null));};exports[_0x55e8('0x70')]=function(_0x1c7726,_0x10eb93,_0x499997){if(_0x1c7726[_0x55e8('0x53')]&&_0x1c7726[_0x55e8('0x53')][_0x55e8('0x54')]){_0x1c7726[_0x55e8('0x51')][_0x55e8('0x5a')]=_0x1c7726[_0x55e8('0x53')][_0x55e8('0x54')];}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x1c7726[_0x55e8('0x4e')]['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x10eb93,null))['then'](saveUpdates(_0x1c7726['body'],null))[_0x55e8('0x1b')](respondWithResult(_0x10eb93,null))[_0x55e8('0x4c')](handleError(_0x10eb93,null));};var utilLicense=require(_0x55e8('0x18'));exports[_0x55e8('0x71')]=function(_0x5ef2e9,_0x5de839,_0x2d8678){var _0x364f87=_0x55e8('0x59');var _0x44a9d5={'custom':![]};return utilLicense[_0x55e8('0x6c')]()[_0x55e8('0x1b')](function(_0x551a78){if(_0x551a78){_0x44a9d5=_0x551a78;}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x5ef2e9[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),_0x55e8('0x57'),_0x55e8('0x5a'),'favicon','defaultLogo',_0x55e8('0x5c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5de839,null))[_0x55e8('0x1b')](function(_0x370414){if(_0x370414){var _0x431f63=_0x370414[_0x55e8('0x5a')]&&fs[_0x55e8('0x66')](path['join'](config[_0x55e8('0x60')],_0x364f87,_[_0x55e8('0x61')](_0x370414['preferred'])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x364f87,_['toLower'](_0x370414[_0x55e8('0x5a')])):path['join'](config['root'],_0x364f87,_['toLower']('default_preferred.png'));var _0x4b2083='default'+_[_0x55e8('0x64')](_0x55e8('0x5a'));if(_0x370414[_0x4b2083]||!_0x44a9d5[_0x55e8('0x65')]||!_0x44a9d5[_0x55e8('0x5a')]){_0x431f63=path['join'](config[_0x55e8('0x60')],_0x364f87,_[_0x55e8('0x61')](_0x55e8('0x72')));}if(!fs[_0x55e8('0x66')](_0x431f63)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_['upperFirst'](_0x55e8('0x5a'))+_0x55e8('0x69'));}return _0x5de839[_0x55e8('0x6a')](_0x431f63);}})[_0x55e8('0x4c')](handleError(_0x5de839,null));};exports[_0x55e8('0x73')]=function(_0x31ce11,_0x2df4dc,_0x5cab19){if(_0x31ce11[_0x55e8('0x53')]&&_0x31ce11[_0x55e8('0x53')][_0x55e8('0x54')]){_0x31ce11[_0x55e8('0x51')]['favicon']=_0x31ce11['file'][_0x55e8('0x54')];}return db[_0x55e8('0x36')]['find']({'where':{'id':_0x31ce11[_0x55e8('0x4e')]['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x2df4dc,null))[_0x55e8('0x1b')](saveUpdates(_0x31ce11[_0x55e8('0x51')],null))[_0x55e8('0x1b')](respondWithResult(_0x2df4dc,null))['catch'](handleError(_0x2df4dc,null));};var utilLicense=require('../../config/license/util');exports[_0x55e8('0x74')]=function(_0x19f914,_0x50bc0f,_0x57cda2){var _0x51569f=_0x55e8('0x59');var _0x1efa23={'custom':![]};return utilLicense[_0x55e8('0x6c')]()[_0x55e8('0x1b')](function(_0x5a2387){if(_0x5a2387){_0x1efa23=_0x5a2387;}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x19f914[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),'loginLogo',_0x55e8('0x5a'),_0x55e8('0x6d'),'defaultLogo',_0x55e8('0x5c'),'defaultPreferred',_0x55e8('0x5e')],'raw':!![]});})[_0x55e8('0x1b')](handleEntityNotFound(_0x50bc0f,null))[_0x55e8('0x1b')](function(_0x34adac){if(_0x34adac){var _0x99a62d=_0x34adac[_0x55e8('0x6d')]&&fs[_0x55e8('0x66')](path['join'](config[_0x55e8('0x60')],_0x51569f,_['toLower'](_0x34adac['favicon'])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x51569f,_[_0x55e8('0x61')](_0x34adac['favicon'])):path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x51569f,_[_0x55e8('0x61')]('default_favicon.ico'));var _0x43c309=_0x55e8('0x63')+_[_0x55e8('0x64')](_0x55e8('0x6d'));if(_0x34adac[_0x43c309]||!_0x1efa23[_0x55e8('0x65')]){_0x99a62d=path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x51569f,_['toLower'](_0x55e8('0x75')));}if(!fs[_0x55e8('0x66')](_0x99a62d)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_[_0x55e8('0x64')](_0x55e8('0x6d'))+'\x20not\x20found');}return _0x50bc0f['download'](_0x99a62d);}})[_0x55e8('0x4c')](handleError(_0x50bc0f,null));};exports['getDate']=function(_0x271a70,_0x5b2a85){var _0x5b9484={'offset':moment()[_0x55e8('0x76')]()};_0x5b9484[_0x55e8('0x77')]=moment()['utcOffset'](_0x5b9484[_0x55e8('0x29')])[_0x55e8('0x78')](_0x55e8('0x79'));return _0x5b2a85['status'](0xc8)[_0x55e8('0x7a')](_0x5b9484);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 6238c6b..fa68322 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(_0x4e33c0,_0x555fda){var _0x1f7aa3=function(_0x2b688b){while(--_0x2b688b){_0x4e33c0['push'](_0x4e33c0['shift']());}};_0x1f7aa3(++_0x555fda);}(_0x3e74,0x175));var _0x43e7=function(_0x4bf217,_0x30f96e){_0x4bf217=_0x4bf217-0x0;var _0x3dee9f=_0x3e74[_0x4bf217];return _0x3dee9f;};'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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x507b84,_0x3c1a7e){var _0x3dced8=function(_0x42e785){while(--_0x42e785){_0x507b84['push'](_0x507b84['shift']());}};_0x3dced8(++_0x3c1a7e);}(_0xe14b,0x93));var _0xbe14=function(_0x134954,_0x44f3eb){_0x134954=_0x134954-0x0;var _0x513335=_0xe14b[_0x134954];return _0x513335;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index f478728..29dcbef 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 _0x4a96=['rpc','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','options','where','attributes','include','map','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3cf6b4,_0x595162){var _0x1862a4=function(_0x103cdb){while(--_0x103cdb){_0x3cf6b4['push'](_0x3cf6b4['shift']());}};_0x1862a4(++_0x595162);}(_0x4a96,0x18b));var _0x64a9=function(_0xa004e9,_0x254d97){_0xa004e9=_0xa004e9-0x0;var _0x2fc8a9=_0x4a96[_0xa004e9];return _0x2fc8a9;};'use strict';var _=require(_0x64a9('0x0'));var util=require(_0x64a9('0x1'));var moment=require(_0x64a9('0x2'));var BPromise=require(_0x64a9('0x3'));var rs=require(_0x64a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64a9('0x5'))['db'];var utils=require(_0x64a9('0x6'));var logger=require(_0x64a9('0x7'))(_0x64a9('0x8'));var config=require('../../config/environment');var jayson=require(_0x64a9('0x9'));var client=jayson[_0x64a9('0xa')][_0x64a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x337454,_0x3ba9fc,_0xa6a131){return new BPromise(function(_0x142982,_0x98c297){return client[_0x64a9('0xc')](_0x337454,_0xa6a131)['then'](function(_0x4792ae){logger[_0x64a9('0xd')](_0x64a9('0xe'),_0x3ba9fc,_0x64a9('0xf'));logger[_0x64a9('0x10')](_0x64a9('0x11'),_0x3ba9fc,'request\x20sent',JSON[_0x64a9('0x12')](_0x4792ae));if(_0x4792ae[_0x64a9('0x13')]){if(_0x4792ae['error'][_0x64a9('0x14')]===0x1f4){logger[_0x64a9('0x13')]('Setting,\x20%s,\x20%s',_0x3ba9fc,_0x4792ae[_0x64a9('0x13')][_0x64a9('0x15')]);return _0x98c297(_0x4792ae['error'][_0x64a9('0x15')]);}logger['error'](_0x64a9('0xe'),_0x3ba9fc,_0x4792ae[_0x64a9('0x13')][_0x64a9('0x15')]);return _0x142982(_0x4792ae[_0x64a9('0x13')][_0x64a9('0x15')]);}else{logger['info'](_0x64a9('0xe'),_0x3ba9fc,_0x64a9('0xf'));_0x142982(_0x4792ae['result'][_0x64a9('0x15')]);}})[_0x64a9('0x16')](function(_0x53014b){logger[_0x64a9('0x13')](_0x64a9('0xe'),_0x3ba9fc,_0x53014b);_0x98c297(_0x53014b);});});}exports[_0x64a9('0x17')]=function(_0x5447fa){var _0x3279ac=this;return new Promise(function(_0x4a0ac6,_0x4308cb){return db[_0x64a9('0x18')]['find']({'raw':_0x5447fa['options']?_0x5447fa[_0x64a9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5447fa[_0x64a9('0x19')]?_0x5447fa[_0x64a9('0x19')][_0x64a9('0x1a')]||null:null,'attributes':_0x5447fa[_0x64a9('0x19')]?_0x5447fa[_0x64a9('0x19')][_0x64a9('0x1b')]||null:null,'include':_0x5447fa['options']?_0x5447fa[_0x64a9('0x19')][_0x64a9('0x1c')]?_[_0x64a9('0x1d')](_0x5447fa[_0x64a9('0x19')][_0x64a9('0x1c')],function(_0x121b13){return{'model':db[_0x121b13['model']],'as':_0x121b13['as'],'attributes':_0x121b13[_0x64a9('0x1b')],'include':_0x121b13[_0x64a9('0x1c')]?_[_0x64a9('0x1d')](_0x121b13[_0x64a9('0x1c')],function(_0x4cd292){return{'model':db[_0x4cd292['model']],'as':_0x4cd292['as'],'attributes':_0x4cd292[_0x64a9('0x1b')],'include':_0x4cd292[_0x64a9('0x1c')]?_[_0x64a9('0x1d')](_0x4cd292[_0x64a9('0x1c')],function(_0x25cf9b){return{'model':db[_0x25cf9b['model']],'as':_0x25cf9b['as'],'attributes':_0x25cf9b[_0x64a9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x64a9('0x1e')](function(_0x3c1faa){logger[_0x64a9('0xd')](_0x64a9('0x17'),_0x5447fa);logger[_0x64a9('0x10')](_0x64a9('0x17'),_0x5447fa,JSON[_0x64a9('0x12')](_0x3c1faa));_0x4a0ac6(_0x3c1faa);})[_0x64a9('0x16')](function(_0x13095a){logger['error']('ShowSetting',_0x13095a[_0x64a9('0x15')],_0x5447fa);_0x4308cb(_0x3279ac[_0x64a9('0x13')](0x1f4,_0x13095a[_0x64a9('0x15')]));});});}; \ No newline at end of file +var _0x78be=['then','info','request\x20sent','debug','stringify','error','message','Setting,\x20%s,\x20%s','result','catch','Setting','options','raw','where','attributes','map','model','include','ShowSetting','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x1ef48d,_0x203c73){var _0x450096=function(_0x1df6b9){while(--_0x1df6b9){_0x1ef48d['push'](_0x1ef48d['shift']());}};_0x450096(++_0x203c73);}(_0x78be,0x15d));var _0xe78b=function(_0xed412d,_0x525948){_0xed412d=_0xed412d-0x0;var _0x3a18ba=_0x78be[_0xed412d];return _0x3a18ba;};'use strict';var _=require(_0xe78b('0x0'));var util=require(_0xe78b('0x1'));var moment=require(_0xe78b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe78b('0x3'))['db'];var utils=require(_0xe78b('0x4'));var logger=require(_0xe78b('0x5'))(_0xe78b('0x6'));var config=require(_0xe78b('0x7'));var jayson=require(_0xe78b('0x8'));var client=jayson['client'][_0xe78b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x328116,_0xf8d06d,_0x190f57){return new BPromise(function(_0x565df7,_0x106cc8){return client[_0xe78b('0xa')](_0x328116,_0x190f57)[_0xe78b('0xb')](function(_0x38c5c7){logger[_0xe78b('0xc')]('Setting,\x20%s,\x20%s',_0xf8d06d,_0xe78b('0xd'));logger[_0xe78b('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0xf8d06d,'request\x20sent',JSON[_0xe78b('0xf')](_0x38c5c7));if(_0x38c5c7['error']){if(_0x38c5c7[_0xe78b('0x10')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0xf8d06d,_0x38c5c7[_0xe78b('0x10')][_0xe78b('0x11')]);return _0x106cc8(_0x38c5c7[_0xe78b('0x10')][_0xe78b('0x11')]);}logger[_0xe78b('0x10')](_0xe78b('0x12'),_0xf8d06d,_0x38c5c7['error']['message']);return _0x565df7(_0x38c5c7['error']['message']);}else{logger[_0xe78b('0xc')](_0xe78b('0x12'),_0xf8d06d,_0xe78b('0xd'));_0x565df7(_0x38c5c7[_0xe78b('0x13')][_0xe78b('0x11')]);}})[_0xe78b('0x14')](function(_0xbc5c87){logger[_0xe78b('0x10')]('Setting,\x20%s,\x20%s',_0xf8d06d,_0xbc5c87);_0x106cc8(_0xbc5c87);});});}exports['ShowSetting']=function(_0x2eee67){var _0x42c2c2=this;return new Promise(function(_0x101c74,_0x7474e0){return db[_0xe78b('0x15')]['find']({'raw':_0x2eee67[_0xe78b('0x16')]?_0x2eee67[_0xe78b('0x16')][_0xe78b('0x17')]===undefined?!![]:![]:!![],'where':_0x2eee67['options']?_0x2eee67[_0xe78b('0x16')][_0xe78b('0x18')]||null:null,'attributes':_0x2eee67['options']?_0x2eee67[_0xe78b('0x16')][_0xe78b('0x19')]||null:null,'include':_0x2eee67[_0xe78b('0x16')]?_0x2eee67[_0xe78b('0x16')]['include']?_[_0xe78b('0x1a')](_0x2eee67['options']['include'],function(_0x595fd4){return{'model':db[_0x595fd4[_0xe78b('0x1b')]],'as':_0x595fd4['as'],'attributes':_0x595fd4[_0xe78b('0x19')],'include':_0x595fd4[_0xe78b('0x1c')]?_[_0xe78b('0x1a')](_0x595fd4[_0xe78b('0x1c')],function(_0x29d34c){return{'model':db[_0x29d34c['model']],'as':_0x29d34c['as'],'attributes':_0x29d34c[_0xe78b('0x19')],'include':_0x29d34c[_0xe78b('0x1c')]?_[_0xe78b('0x1a')](_0x29d34c['include'],function(_0xb981ae){return{'model':db[_0xb981ae['model']],'as':_0xb981ae['as'],'attributes':_0xb981ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xe78b('0xb')](function(_0x2c4839){logger[_0xe78b('0xc')]('ShowSetting',_0x2eee67);logger[_0xe78b('0xe')](_0xe78b('0x1d'),_0x2eee67,JSON[_0xe78b('0xf')](_0x2c4839));_0x101c74(_0x2c4839);})[_0xe78b('0x14')](function(_0x3d92aa){logger[_0xe78b('0x10')](_0xe78b('0x1d'),_0x3d92aa[_0xe78b('0x11')],_0x2eee67);_0x7474e0(_0x42c2c2['error'](0x1f4,_0x3d92aa[_0xe78b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d9f487b..9fb556e 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 _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2dafad,_0x5e8cb1){_0x2dafad=_0x2dafad-0x0;var _0x22c4cf=_0x1cb9[_0x2dafad];return _0x22c4cf;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x306081,_0x2cc909){var _0x5b4f09=function(_0xbf3311){while(--_0xbf3311){_0x306081['push'](_0x306081['shift']());}};_0x5b4f09(++_0x2cc909);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 5462630..f10df2e 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 _0x432c=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','twilio','skebby','clicksend','plivo','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1c7a9b,_0x7bdcb3){var _0xe450a4=function(_0x1c0c49){while(--_0x1c0c49){_0x1c7a9b['push'](_0x1c7a9b['shift']());}};_0xe450a4(++_0x7bdcb3);}(_0x432c,0x1e4));var _0xc432=function(_0x1e1e97,_0x17267e){_0x1e1e97=_0x1e1e97-0x0;var _0x2ab971=_0x432c[_0x1e1e97];return _0x2ab971;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xc432('0x0')]={'name':{'type':Sequelize[_0xc432('0x1')],'unique':_0xc432('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xc432('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc432('0x1')]},'type':{'type':Sequelize['ENUM'](_0xc432('0x3'),_0xc432('0x4'),'connectel',_0xc432('0x5'),_0xc432('0x6'),'clickatell','bandwidth',_0xc432('0x7'),_0xc432('0x8'),_0xc432('0x9'))},'accountSid':{'type':Sequelize[_0xc432('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc432('0x1')]},'smsMethod':{'type':Sequelize[_0xc432('0xa')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc432('0x1')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xc432('0x1')]},'accountId':{'type':Sequelize[_0xc432('0x1')]},'senderString':{'type':Sequelize[_0xc432('0x1')]},'deliveryReport':{'type':Sequelize[_0xc432('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xc432('0x1')]},'notificationTemplate':{'type':Sequelize[_0xc432('0xc')],'defaultValue':function(){return _0xc432('0xd');}},'notificationSound':{'type':Sequelize[_0xc432('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc432('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc432('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc432('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc432('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc432('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc432('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc432('0xe')],'comment':_0xc432('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc432('0x10'),'set':function(_0x442ade){if(!_0x442ade)this[_0xc432('0x11')](_0xc432('0x12'),null);this['setDataValue'](_0xc432('0x13'),_0x442ade);}}}; \ No newline at end of file +var _0x2a99=['randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x518392,_0x25ac70){var _0x344e59=function(_0xa99198){while(--_0xa99198){_0x518392['push'](_0x518392['shift']());}};_0x344e59(++_0x25ac70);}(_0x2a99,0x1a1));var _0x92a9=function(_0x2694f6,_0x31b042){_0x2694f6=_0x2694f6-0x0;var _0x13ab43=_0x2a99[_0x2694f6];return _0x13ab43;};'use strict';var Sequelize=require(_0x92a9('0x0'));var rs=require(_0x92a9('0x1'));module[_0x92a9('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x92a9('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x92a9('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x92a9('0x4')],'defaultValue':function(){return rs[_0x92a9('0x5')]();}},'phone':{'type':Sequelize[_0x92a9('0x4')]},'type':{'type':Sequelize[_0x92a9('0x6')](_0x92a9('0x7'),_0x92a9('0x8'),_0x92a9('0x9'),_0x92a9('0xa'),_0x92a9('0xb'),'clickatell',_0x92a9('0xc'),'csc','infobip',_0x92a9('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x92a9('0x4')]},'authToken':{'type':Sequelize[_0x92a9('0x4')]},'smsMethod':{'type':Sequelize[_0x92a9('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x92a9('0x4')]},'password':{'type':Sequelize[_0x92a9('0x4')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x92a9('0x4')]},'accountId':{'type':Sequelize[_0x92a9('0x4')]},'senderString':{'type':Sequelize[_0x92a9('0x4')]},'deliveryReport':{'type':Sequelize[_0x92a9('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x92a9('0x4')]},'notificationTemplate':{'type':Sequelize[_0x92a9('0xf')],'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[_0x92a9('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x92a9('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x92a9('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x92a9('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x92a9('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x92a9('0x10')],'comment':_0x92a9('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x92a9('0xe')],'defaultValue':![],'comment':_0x92a9('0x12'),'set':function(_0x6db2e8){if(!_0x6db2e8)this[_0x92a9('0x13')](_0x92a9('0x14'),null);this[_0x92a9('0x13')](_0x92a9('0x15'),_0x6db2e8);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ef5ada5..ce9ab0e 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 _0x366d=['ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','sender','text','connectel','from','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','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','list','omit','CmContact','contact','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','bulkCreate','priority','finally','getApplications','Contact','fullname','Tag','Tags','tag','to\x20is\x20mandatory','List','out','dataValues','SmsAccount,\x20%s,\x20%s,\x20%s','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','SmsAccount','includeAll','include','findAll','rows','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','rawAttributes','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','account','orderBy','asc','Applications','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId'];(function(_0x1ffb74,_0x53f149){var _0x4b8237=function(_0x45992c){while(--_0x45992c){_0x1ffb74['push'](_0x1ffb74['shift']());}};_0x4b8237(++_0x53f149);}(_0x366d,0x14e));var _0xd366=function(_0x2f2721,_0xeccd73){_0x2f2721=_0x2f2721-0x0;var _0x1b661=_0x366d[_0x2f2721];return _0x1b661;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd366('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd366('0x1'));var rp=require(_0xd366('0x2'));var moment=require(_0xd366('0x3'));var BPromise=require(_0xd366('0x4'));var Mustache=require(_0xd366('0x5'));var util=require('util');var path=require(_0xd366('0x6'));var sox=require(_0xd366('0x7'));var csv=require(_0xd366('0x8'));var ejs=require(_0xd366('0x9'));var fs=require('fs');var fs_extra=require(_0xd366('0xa'));var _=require(_0xd366('0xb'));var squel=require(_0xd366('0xc'));var crypto=require(_0xd366('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd366('0x8'));var querystring=require(_0xd366('0xe'));var Papa=require(_0xd366('0xf'));var Redis=require(_0xd366('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd366('0x11'));var as=require(_0xd366('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd366('0x13'))(_0xd366('0x14'));var utils=require('../../config/utils');var config=require(_0xd366('0x15'));var licenseUtil=require(_0xd366('0x16'));var db=require('../../mysqldb')['db'];config[_0xd366('0x17')]=_[_0xd366('0x18')](config[_0xd366('0x17')],{'host':_0xd366('0x19'),'port':0x18eb});var socket=require(_0xd366('0x1a'))(new Redis(config['redis']));require(_0xd366('0x1b'))[_0xd366('0x1c')](socket);var jayson=require(_0xd366('0x1d'));var client=jayson[_0xd366('0x1e')][_0xd366('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1c9517,_0x369a20,_0x2adf8e,_0x46a76e){return new BPromise(function(_0x3c8d92,_0x40312f){var _0x5f6e0d=_0x46a76e||client;return _0x5f6e0d[_0xd366('0x20')](_0x1c9517,_0x2adf8e)['then'](function(_0x6e6d0a){logger[_0xd366('0x21')](_0xd366('0x22'),_0x369a20,_0xd366('0x23'));logger[_0xd366('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x369a20,_0xd366('0x23'),JSON[_0xd366('0x25')](_0x6e6d0a));if(_0x6e6d0a[_0xd366('0x26')]){if(_0x6e6d0a[_0xd366('0x26')][_0xd366('0x27')]===0x1f4){logger[_0xd366('0x26')]('SmsAccount,\x20%s,\x20%s',_0x369a20,_0x6e6d0a[_0xd366('0x26')]['message']);return _0x40312f(_0x6e6d0a[_0xd366('0x26')][_0xd366('0x28')]);}logger[_0xd366('0x26')](_0xd366('0x22'),_0x369a20,_0x6e6d0a['error'][_0xd366('0x28')]);return _0x3c8d92(_0x6e6d0a[_0xd366('0x26')]['message']);}else{logger['info'](_0xd366('0x22'),_0x369a20,_0xd366('0x23'));_0x3c8d92(_0x6e6d0a[_0xd366('0x29')][_0xd366('0x28')]);}})[_0xd366('0x2a')](function(_0x2c3948){logger[_0xd366('0x26')]('SmsAccount,\x20%s,\x20%s',_0x369a20,_0x2c3948);_0x40312f(_0x2c3948);});});}function respondWithStatusCode(_0x237be8,_0x20f5eb){_0x20f5eb=_0x20f5eb||0xcc;return function(_0x3dd9c6){if(_0x3dd9c6){return _0x237be8[_0xd366('0x2b')](_0x20f5eb);}return _0x237be8['status'](_0x20f5eb)['end']();};}function respondWithResult(_0x3a747a,_0x113d8a){_0x113d8a=_0x113d8a||0xc8;return function(_0x39d94a){if(_0x39d94a){return _0x3a747a[_0xd366('0x2c')](_0x113d8a)[_0xd366('0x2d')](_0x39d94a);}};}function respondWithFilteredResult(_0x386d26,_0x17310b){return function(_0x2fd4c6){if(_0x2fd4c6){var _0x198285=typeof _0x17310b['offset']===_0xd366('0x2e')&&typeof _0x17310b[_0xd366('0x2f')]===_0xd366('0x2e');var _0x4a03d6=_0x2fd4c6['count'];var _0x881ed0=_0x198285?0x0:_0x17310b[_0xd366('0x30')];var _0x5dcc0f=_0x198285?_0x2fd4c6[_0xd366('0x31')]:_0x17310b['offset']+_0x17310b['limit'];var _0x1985fc;if(_0x5dcc0f>=_0x4a03d6){_0x5dcc0f=_0x4a03d6;_0x1985fc=0xc8;}else{_0x1985fc=0xce;}_0x386d26[_0xd366('0x2c')](_0x1985fc);return _0x386d26[_0xd366('0x32')](_0xd366('0x33'),_0x881ed0+'-'+_0x5dcc0f+'/'+_0x4a03d6)[_0xd366('0x2d')](_0x2fd4c6);}return null;};}function patchUpdates(_0x4c2949){return function(_0x457486){try{jsonpatch['apply'](_0x457486,_0x4c2949,!![]);}catch(_0x1ce3f4){return BPromise[_0xd366('0x34')](_0x1ce3f4);}return _0x457486[_0xd366('0x35')]();};}function saveUpdates(_0x110a13,_0x3369cb){return function(_0x2b4ab5){if(_0x2b4ab5){return _0x2b4ab5['update'](_0x110a13)[_0xd366('0x36')](function(_0x3c2578){return _0x3c2578;});}return null;};}function removeEntity(_0x1c5f2a,_0xd9b69b){return function(_0x283106){if(_0x283106){return _0x283106[_0xd366('0x37')]()['then'](function(){var _0x3749db=_0x283106[_0xd366('0x38')]({'plain':!![]});var _0x388c36=_0xd366('0x39');return db[_0xd366('0x3a')][_0xd366('0x37')]({'where':{'type':_0x388c36,'resourceId':_0x3749db['id']}})[_0xd366('0x36')](function(){return _0x283106;});})[_0xd366('0x36')](function(){_0x1c5f2a[_0xd366('0x2c')](0xcc)[_0xd366('0x3b')]();});}};}function handleEntityNotFound(_0x58f82b,_0x311aa0){return function(_0x33cc93){if(!_0x33cc93){_0x58f82b['sendStatus'](0x194);}return _0x33cc93;};}function handleError(_0x484fb2,_0x4c5f14){_0x4c5f14=_0x4c5f14||0x1f4;return function(_0x365a8d){logger[_0xd366('0x26')](_0x365a8d[_0xd366('0x3c')]);if(_0x365a8d[_0xd366('0x3d')]){delete _0x365a8d[_0xd366('0x3d')];}_0x484fb2[_0xd366('0x2c')](_0x4c5f14)[_0xd366('0x3e')](_0x365a8d);};}exports['index']=function(_0xbdfb8a,_0x353886){var _0x5052a3={'include':[{'model':db[_0xd366('0x3f')],'as':_0xd366('0x40')}]},_0x31b458={},_0x6a55bf={'count':0x0,'rows':[]};var _0x687084=_[_0xd366('0x41')](db['SmsAccount']['rawAttributes'],function(_0x27eda5){return{'name':_0x27eda5[_0xd366('0x42')],'type':_0x27eda5['type'][_0xd366('0x43')]};});_0x31b458[_0xd366('0x44')]=_[_0xd366('0x41')](_0x687084,'name');_0x31b458[_0xd366('0x45')]=_[_0xd366('0x46')](_0xbdfb8a[_0xd366('0x45')]);_0x31b458[_0xd366('0x47')]=_[_0xd366('0x48')](_0x31b458[_0xd366('0x44')],_0x31b458['query']);_0x5052a3[_0xd366('0x49')]=_[_0xd366('0x48')](_0x31b458[_0xd366('0x44')],qs[_0xd366('0x4a')](_0xbdfb8a['query'][_0xd366('0x4a')]));_0x5052a3[_0xd366('0x49')]=_0x5052a3[_0xd366('0x49')]['length']?_0x5052a3['attributes']:_0x31b458[_0xd366('0x44')];if(!_0xbdfb8a[_0xd366('0x45')][_0xd366('0x4b')](_0xd366('0x4c'))){_0x5052a3[_0xd366('0x2f')]=qs[_0xd366('0x2f')](_0xbdfb8a[_0xd366('0x45')]['limit']);_0x5052a3[_0xd366('0x30')]=qs[_0xd366('0x30')](_0xbdfb8a[_0xd366('0x45')][_0xd366('0x30')]);}_0x5052a3[_0xd366('0x4d')]=qs['sort'](_0xbdfb8a['query'][_0xd366('0x4e')]);_0x5052a3['where']=qs[_0xd366('0x47')](_[_0xd366('0x4f')](_0xbdfb8a[_0xd366('0x45')],_0x31b458[_0xd366('0x47')]),_0x687084);if(_0xbdfb8a['query'][_0xd366('0x50')]){_0x5052a3[_0xd366('0x51')]=_[_0xd366('0x52')](_0x5052a3[_0xd366('0x51')],{'$or':_[_0xd366('0x41')](_0x687084,function(_0x451d49){if(_0x451d49[_0xd366('0x53')]!=='VIRTUAL'){var _0x29afaf={};_0x29afaf[_0x451d49[_0xd366('0x3d')]]={'$like':'%'+_0xbdfb8a[_0xd366('0x45')][_0xd366('0x50')]+'%'};return _0x29afaf;}})});}_0x5052a3=_['merge']({},_0x5052a3,_0xbdfb8a[_0xd366('0x54')]);var _0xbf3ca1={'where':_0x5052a3[_0xd366('0x51')]};return db[_0xd366('0x55')][_0xd366('0x31')](_0xbf3ca1)['then'](function(_0x323957){_0x6a55bf[_0xd366('0x31')]=_0x323957;if(_0xbdfb8a[_0xd366('0x45')][_0xd366('0x56')]){_0x5052a3[_0xd366('0x57')]=[{'all':!![]}];}return db[_0xd366('0x55')][_0xd366('0x58')](_0x5052a3);})[_0xd366('0x36')](function(_0x525e89){_0x6a55bf[_0xd366('0x59')]=_0x525e89;return _0x6a55bf;})[_0xd366('0x36')](respondWithFilteredResult(_0x353886,_0x5052a3))[_0xd366('0x2a')](handleError(_0x353886,null));};exports['show']=function(_0x3719cd,_0x3852f7){var _0x395959={'raw':![],'where':{'id':_0x3719cd[_0xd366('0x5a')]['id']},'include':[{'model':db[_0xd366('0x3f')],'as':_0xd366('0x40')}]},_0x2ed8f6={};_0x2ed8f6[_0xd366('0x44')]=_[_0xd366('0x46')](db[_0xd366('0x55')]['rawAttributes']);_0x2ed8f6[_0xd366('0x45')]=_[_0xd366('0x46')](_0x3719cd[_0xd366('0x45')]);_0x2ed8f6[_0xd366('0x47')]=_[_0xd366('0x48')](_0x2ed8f6[_0xd366('0x44')],_0x2ed8f6[_0xd366('0x45')]);_0x395959[_0xd366('0x49')]=_['intersection'](_0x2ed8f6[_0xd366('0x44')],qs[_0xd366('0x4a')](_0x3719cd['query'][_0xd366('0x4a')]));_0x395959[_0xd366('0x49')]=_0x395959[_0xd366('0x49')][_0xd366('0x5b')]?_0x395959[_0xd366('0x49')]:_0x2ed8f6[_0xd366('0x44')];if(_0x3719cd[_0xd366('0x45')][_0xd366('0x56')]){_0x395959[_0xd366('0x57')]=[{'all':!![]}];}_0x395959=_[_0xd366('0x52')]({},_0x395959,_0x3719cd[_0xd366('0x54')]);return db[_0xd366('0x55')][_0xd366('0x5c')](_0x395959)[_0xd366('0x36')](handleEntityNotFound(_0x3852f7,null))[_0xd366('0x36')](respondWithResult(_0x3852f7,null))[_0xd366('0x2a')](handleError(_0x3852f7,null));};exports[_0xd366('0x5d')]=function(_0x18a82e,_0x30fa88){return db['SmsAccount'][_0xd366('0x5d')](_0x18a82e[_0xd366('0x5e')],{})[_0xd366('0x36')](function(_0x49b944){var _0x341209=_0x18a82e['user'][_0xd366('0x38')]({'plain':!![]});if(!_0x341209)throw new Error(_0xd366('0x5f'));if(_0x341209[_0xd366('0x60')]===_0xd366('0x61')){var _0x45826b=_0x49b944[_0xd366('0x38')]({'plain':!![]});var _0x26039c=_0xd366('0x39');return db['UserProfileSection'][_0xd366('0x5c')]({'where':{'name':_0x26039c,'userProfileId':_0x341209[_0xd366('0x62')]},'raw':!![]})[_0xd366('0x36')](function(_0x501483){if(_0x501483&&_0x501483[_0xd366('0x63')]===0x0){return db[_0xd366('0x3a')]['create']({'name':_0x45826b[_0xd366('0x3d')],'resourceId':_0x45826b['id'],'type':_0x501483[_0xd366('0x3d')],'sectionId':_0x501483['id']},{})[_0xd366('0x36')](function(){return _0x49b944;});}else{return _0x49b944;}})[_0xd366('0x2a')](function(_0x319cb7){logger[_0xd366('0x26')](_0xd366('0x64'),_0x319cb7);throw _0x319cb7;});}return _0x49b944;})[_0xd366('0x36')](respondWithResult(_0x30fa88,0xc9))['catch'](handleError(_0x30fa88,null));};exports[_0xd366('0x65')]=function(_0x158c1c,_0x31c763){if(_0x158c1c[_0xd366('0x5e')]['id']){delete _0x158c1c[_0xd366('0x5e')]['id'];}return db[_0xd366('0x55')][_0xd366('0x5c')]({'where':{'id':_0x158c1c[_0xd366('0x5a')]['id']},'include':[{'model':db[_0xd366('0x3f')],'as':_0xd366('0x40')}]})['then'](handleEntityNotFound(_0x31c763,null))[_0xd366('0x36')](saveUpdates(_0x158c1c[_0xd366('0x5e')],null))[_0xd366('0x36')](respondWithResult(_0x31c763,null))[_0xd366('0x2a')](handleError(_0x31c763,null));};exports[_0xd366('0x37')]=function(_0x36826e,_0x1852f3){return db[_0xd366('0x55')][_0xd366('0x5c')]({'where':{'id':_0x36826e[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x1852f3,null))[_0xd366('0x36')](removeEntity(_0x1852f3,null))[_0xd366('0x2a')](handleError(_0x1852f3,null));};exports['describe']=function(_0x213256,_0x2259ef){return db[_0xd366('0x55')][_0xd366('0x66')]()[_0xd366('0x36')](respondWithResult(_0x2259ef,null))['catch'](handleError(_0x2259ef,null));};exports[_0xd366('0x67')]=function(_0x454e9f,_0x4bc880,_0x1aeba8){if(_0x454e9f[_0xd366('0x5e')]['id']){delete _0x454e9f[_0xd366('0x5e')]['id'];}return db[_0xd366('0x55')]['find']({'where':{'id':_0x454e9f[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x4bc880,null))[_0xd366('0x36')](function(_0x2b1aa8){if(_0x2b1aa8){_0x454e9f[_0xd366('0x5e')][_0xd366('0x68')]=_0x2b1aa8['id'];return db[_0xd366('0x69')][_0xd366('0x5d')](_0x454e9f[_0xd366('0x5e')]);}})[_0xd366('0x36')](respondWithResult(_0x4bc880,null))[_0xd366('0x2a')](handleError(_0x4bc880,null));};exports['getDispositions']=function(_0x3e59b3,_0x18e7ca,_0x2891f3){var _0x4512a7={'raw':![],'where':{}};var _0x30d25e={};var _0x1d843c={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x3e59b3['params']['id']}})['then'](handleEntityNotFound(_0x18e7ca,null))[_0xd366('0x36')](function(_0x2127f8){if(_0x2127f8){_0x30d25e[_0xd366('0x44')]=_[_0xd366('0x46')](db['Disposition'][_0xd366('0x6a')]);_0x30d25e[_0xd366('0x45')]=_[_0xd366('0x46')](_0x3e59b3[_0xd366('0x45')]);_0x30d25e[_0xd366('0x47')]=_[_0xd366('0x48')](_0x30d25e[_0xd366('0x44')],_0x30d25e[_0xd366('0x45')]);_0x4512a7['attributes']=_[_0xd366('0x48')](_0x30d25e[_0xd366('0x44')],qs[_0xd366('0x4a')](_0x3e59b3[_0xd366('0x45')][_0xd366('0x4a')]));_0x4512a7[_0xd366('0x49')]=_0x4512a7['attributes'][_0xd366('0x5b')]?_0x4512a7['attributes']:_0x30d25e[_0xd366('0x44')];if(!_0x3e59b3['query']['hasOwnProperty'](_0xd366('0x4c'))){_0x4512a7['limit']=qs[_0xd366('0x2f')](_0x3e59b3[_0xd366('0x45')][_0xd366('0x2f')]);_0x4512a7[_0xd366('0x30')]=qs[_0xd366('0x30')](_0x3e59b3[_0xd366('0x45')][_0xd366('0x30')]);}_0x4512a7['order']=qs[_0xd366('0x4e')](_0x3e59b3[_0xd366('0x45')][_0xd366('0x4e')]);_0x4512a7[_0xd366('0x51')]=qs[_0xd366('0x47')](_[_0xd366('0x4f')](_0x3e59b3[_0xd366('0x45')],_0x30d25e[_0xd366('0x47')]));_0x4512a7[_0xd366('0x51')][_0xd366('0x68')]=_0x2127f8['id'];if(_0x3e59b3[_0xd366('0x45')]['filter']){_0x4512a7['where']=_[_0xd366('0x52')](_0x4512a7[_0xd366('0x51')],{'$or':_['map'](_0x4512a7[_0xd366('0x49')],function(_0x2698df){var _0x4446a3={};_0x4446a3[_0x2698df]={'$like':'%'+_0x3e59b3[_0xd366('0x45')]['filter']+'%'};return _0x4446a3;})});}_0x4512a7=_[_0xd366('0x52')]({},_0x4512a7,_0x3e59b3['options']);return db[_0xd366('0x69')]['count']({'where':_0x4512a7[_0xd366('0x51')]})[_0xd366('0x36')](function(_0x55eaee){_0x1d843c[_0xd366('0x31')]=_0x55eaee;if(_0x3e59b3['query'][_0xd366('0x56')]){_0x4512a7[_0xd366('0x57')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4512a7);})[_0xd366('0x36')](function(_0x5baa54){_0x1d843c[_0xd366('0x59')]=_0x5baa54;return _0x1d843c;});}})['then'](respondWithFilteredResult(_0x18e7ca,_0x4512a7))[_0xd366('0x2a')](handleError(_0x18e7ca,null));};exports[_0xd366('0x6b')]=function(_0x371854,_0x307693,_0x495f0c){return db['SmsAccount']['find']({'where':{'id':_0x371854[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x307693,null))[_0xd366('0x36')](function(_0x5edc20){if(_0x5edc20){return _0x5edc20[_0xd366('0x6b')](_0x371854[_0xd366('0x45')][_0xd366('0x6c')]);}})['then'](respondWithStatusCode(_0x307693,null))[_0xd366('0x2a')](handleError(_0x307693,null));};exports[_0xd366('0x6d')]=function(_0x3cbaa0,_0x47115c,_0x47eb84){if(_0x3cbaa0[_0xd366('0x5e')]['id']){delete _0x3cbaa0[_0xd366('0x5e')]['id'];}return db[_0xd366('0x55')][_0xd366('0x5c')]({'where':{'id':_0x3cbaa0['params']['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x47115c,null))['then'](function(_0x4085ce){if(_0x4085ce){_0x3cbaa0[_0xd366('0x5e')][_0xd366('0x68')]=_0x4085ce['id'];return db[_0xd366('0x6e')][_0xd366('0x5d')](_0x3cbaa0['body']);}})[_0xd366('0x36')](respondWithResult(_0x47115c,null))['catch'](handleError(_0x47115c,null));};exports[_0xd366('0x6f')]=function(_0x1bba6b,_0x32254c,_0x46be30){var _0x2db64f={'raw':![],'where':{}};var _0x45f427={};var _0x5a8b4e={'count':0x0,'rows':[]};return db[_0xd366('0x55')][_0xd366('0x70')]({'where':{'id':_0x1bba6b[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x32254c,null))[_0xd366('0x36')](function(_0x59e9a1){if(_0x59e9a1){_0x45f427[_0xd366('0x44')]=_[_0xd366('0x46')](db[_0xd366('0x6e')][_0xd366('0x6a')]);_0x45f427['query']=_['keys'](_0x1bba6b['query']);_0x45f427[_0xd366('0x47')]=_['intersection'](_0x45f427[_0xd366('0x44')],_0x45f427['query']);_0x2db64f[_0xd366('0x49')]=_[_0xd366('0x48')](_0x45f427['model'],qs['fields'](_0x1bba6b[_0xd366('0x45')][_0xd366('0x4a')]));_0x2db64f[_0xd366('0x49')]=_0x2db64f[_0xd366('0x49')]['length']?_0x2db64f['attributes']:_0x45f427[_0xd366('0x44')];if(!_0x1bba6b[_0xd366('0x45')][_0xd366('0x4b')](_0xd366('0x4c'))){_0x2db64f[_0xd366('0x2f')]=qs[_0xd366('0x2f')](_0x1bba6b[_0xd366('0x45')]['limit']);_0x2db64f[_0xd366('0x30')]=qs[_0xd366('0x30')](_0x1bba6b[_0xd366('0x45')]['offset']);}_0x2db64f['order']=qs[_0xd366('0x4e')](_0x1bba6b[_0xd366('0x45')][_0xd366('0x4e')]);_0x2db64f[_0xd366('0x51')]=qs[_0xd366('0x47')](_[_0xd366('0x4f')](_0x1bba6b[_0xd366('0x45')],_0x45f427[_0xd366('0x47')]));_0x2db64f[_0xd366('0x51')][_0xd366('0x68')]=_0x59e9a1['id'];if(_0x1bba6b[_0xd366('0x45')][_0xd366('0x50')]){_0x2db64f[_0xd366('0x51')]=_[_0xd366('0x52')](_0x2db64f[_0xd366('0x51')],{'$or':_[_0xd366('0x41')](_0x2db64f['attributes'],function(_0x3ff5ed){var _0x3ee8ba={};_0x3ee8ba[_0x3ff5ed]={'$like':'%'+_0x1bba6b['query'][_0xd366('0x50')]+'%'};return _0x3ee8ba;})});}_0x2db64f=_[_0xd366('0x52')]({},_0x2db64f,_0x1bba6b[_0xd366('0x54')]);return db[_0xd366('0x6e')]['count']({'where':_0x2db64f[_0xd366('0x51')]})[_0xd366('0x36')](function(_0x75873f){_0x5a8b4e['count']=_0x75873f;if(_0x1bba6b[_0xd366('0x45')][_0xd366('0x56')]){_0x2db64f[_0xd366('0x57')]=[{'all':!![]}];}return db[_0xd366('0x6e')]['findAll'](_0x2db64f);})[_0xd366('0x36')](function(_0x3713f5){_0x5a8b4e[_0xd366('0x59')]=_0x3713f5;return _0x5a8b4e;});}})[_0xd366('0x36')](respondWithFilteredResult(_0x32254c,_0x2db64f))[_0xd366('0x2a')](handleError(_0x32254c,null));};exports[_0xd366('0x71')]=function(_0x2bf857,_0x4fda04,_0x37e7fb){return db['SmsAccount'][_0xd366('0x5c')]({'where':{'id':_0x2bf857[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x4fda04,null))[_0xd366('0x36')](function(_0x565ff1){if(_0x565ff1){return _0x565ff1[_0xd366('0x71')](_0x2bf857[_0xd366('0x45')]['ids']);}})[_0xd366('0x36')](respondWithStatusCode(_0x4fda04,null))[_0xd366('0x2a')](handleError(_0x4fda04,null));};exports[_0xd366('0x72')]=function(_0xcbae8f,_0x5d2860,_0x47e694){var _0x30bfa0={'channel':_0xd366('0x73')};var _0xd00e30=[];var _0x49d008=[];var _0xdd6d42={};return db[_0xd366('0x55')]['find']({'where':{'id':_0xcbae8f['params']['id']},'include':[{'model':db[_0xd366('0x74')],'as':'Applications'}]})[_0xd366('0x36')](handleEntityNotFound(_0x5d2860,null))['then'](function(_0x336a8e){_0x30bfa0[_0xd366('0x75')]=_0x336a8e;_0x30bfa0['applications']=_[_0xd366('0x76')](_0x336a8e['Applications'],['priority'],[_0xd366('0x77')]);if(_0x30bfa0[_0xd366('0x75')][_0xd366('0x78')]){delete _0x30bfa0[_0xd366('0x75')]['Applications'];}return db['CmContact'][_0xd366('0x66')]();})[_0xd366('0x36')](function(_0x3bc10a){if(!_0x3bc10a){throw new db[(_0xd366('0x79'))][(_0xd366('0x7a'))](_0xd366('0x7b'));}_0xd00e30=_[_0xd366('0x7c')](_['keys'](_0x3bc10a),[_0xd366('0x7d'),_0xd366('0x7e')]);_0x49d008=_[_0xd366('0x7c')](_['keys'](_0x3bc10a),[_0xd366('0x7d'),_0xd366('0x7e'),_0xd366('0x7f'),_0xd366('0x80')]);_0x30bfa0[_0xd366('0x5e')]={'mapKey':_0xd366('0x81')};if(_0x30bfa0['account'][_0xd366('0x53')]){switch(_0x30bfa0[_0xd366('0x75')][_0xd366('0x53')]){case _0xd366('0x82'):_0x30bfa0[_0xd366('0x5e')]['from']=_0xcbae8f['body'][_0xd366('0x83')];_0x30bfa0[_0xd366('0x5e')]['body']=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x84')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x85')]=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x86')];break;case _0xd366('0x87'):_0x30bfa0[_0xd366('0x5e')]['from']='+'+_0xcbae8f[_0xd366('0x5e')][_0xd366('0x88')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')]=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x89')];break;case _0xd366('0x8a'):_0x30bfa0['body'][_0xd366('0x8b')]=_0xcbae8f['body']['from'];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')]=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x28')];break;case _0xd366('0x8c'):_0x30bfa0[_0xd366('0x5e')]['from']=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x8b')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')]=_0xcbae8f['body'][_0xd366('0x5e')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x85')]=_0xcbae8f['body'][_0xd366('0x8d')];break;case _0xd366('0x8e'):_0x30bfa0[_0xd366('0x5e')]['from']=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x83')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')]=_0xcbae8f['body'][_0xd366('0x8f')];_0x30bfa0['body'][_0xd366('0x85')]=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x90')];break;case _0xd366('0x91'):_0x30bfa0[_0xd366('0x5e')][_0xd366('0x8b')]='+'+_0xcbae8f[_0xd366('0x5e')]['results'][0x0][_0xd366('0x8b')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')]=_0xcbae8f['body'][_0xd366('0x92')][0x0][_0xd366('0x89')];_0x30bfa0[_0xd366('0x5e')]['messageId']=_0xcbae8f['body']['results'][0x0][_0xd366('0x85')];break;case _0xd366('0x93'):_0x30bfa0[_0xd366('0x5e')]['from']=_0xcbae8f['body'][_0xd366('0x94')];_0x30bfa0['body'][_0xd366('0x5e')]=_0xcbae8f[_0xd366('0x5e')]['segmentedMessage']['message'];break;case _0xd366('0x95'):_0x30bfa0[_0xd366('0x5e')]['from']=_0xcbae8f['body'][_0xd366('0x96')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')]=_0xcbae8f['body'][_0xd366('0x89')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x85')]=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x97')];break;case _0xd366('0x98'):_0x30bfa0[_0xd366('0x5e')]['messageId']=_0xcbae8f[_0xd366('0x5e')][0x0][_0xd366('0x28')]['id'];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x8b')]=_0xcbae8f[_0xd366('0x5e')][0x0][_0xd366('0x28')]['from'];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')]=_0xcbae8f[_0xd366('0x5e')][0x0][_0xd366('0x28')]['text'];break;case _0xd366('0x99'):_0x30bfa0[_0xd366('0x5e')]['from']=_0xcbae8f[_0xd366('0x5e')][_0xd366('0x8b')];_0x30bfa0['body'][_0xd366('0x5e')]=_0xcbae8f['body'][_0xd366('0x28')];_0x30bfa0[_0xd366('0x5e')][_0xd366('0x85')]=_0xcbae8f[_0xd366('0x5e')]['refid'];break;}}if(_0x30bfa0[_0xd366('0x5e')]['id']){delete _0x30bfa0['body']['id'];}if(_[_0xd366('0x9a')](_0x30bfa0[_0xd366('0x5e')][_0xd366('0x8b')])){throw new db[(_0xd366('0x79'))]['ValidationError'](_0xd366('0x9b'));}if(_[_0xd366('0x9a')](_0x30bfa0[_0xd366('0x5e')]['body'])||_0x30bfa0['body'][_0xd366('0x5e')]===''){throw new db[(_0xd366('0x79'))][(_0xd366('0x7a'))](_0xd366('0x9c'));}if(_[_0xd366('0x9a')](_0x30bfa0[_0xd366('0x5e')][_0xd366('0x9d')])){throw new db[(_0xd366('0x79'))][(_0xd366('0x7a'))](_0xd366('0x9e')+_0x49d008);}if(!_[_0xd366('0x9f')](_0x49d008,_0x30bfa0[_0xd366('0x5e')][_0xd366('0x9d')])){throw new db[(_0xd366('0x79'))][(_0xd366('0x7a'))](_0xd366('0xa0')+_0x49d008);}_0xdd6d42[_0x30bfa0[_0xd366('0x5e')][_0xd366('0x9d')]]=_0x30bfa0[_0xd366('0x5e')][_0xd366('0x8b')];return db[_0xd366('0xa1')][_0xd366('0x5c')]({'where':{'id':_0x30bfa0['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0xd366('0xa2'),'where':_0xdd6d42,'limit':0x1,'order':[[_0xd366('0x7e'),'DESC']]}]});})[_0xd366('0x36')](handleEntityNotFound(_0x5d2860,null))[_0xd366('0x36')](function(_0x15453f){if(_0x15453f){_0x30bfa0[_0xd366('0xa3')]=_[_0xd366('0xa4')](_0x15453f,['Contacts']);if(_0x15453f[_0xd366('0xa2')][_0xd366('0x5b')]){return _0x15453f[_0xd366('0xa2')][0x0];}var _0x398934=_[_0xd366('0x18')](_0x30bfa0[_0xd366('0x5e')],{'firstName':_0x30bfa0[_0xd366('0x5e')][_0xd366('0x8b')],'ListId':_0x15453f['id']});_0x398934[_0x30bfa0['body']['mapKey']]=_0x30bfa0[_0xd366('0x5e')]['from'];return db[_0xd366('0xa5')][_0xd366('0x5d')](_0x398934,{'fields':_0xd00e30,'raw':!![]});}})['then'](handleEntityNotFound(_0x5d2860,null))[_0xd366('0x36')](function(_0xd25505){if(_0xd25505){_0x30bfa0[_0xd366('0xa6')]=_0xd25505;var _0x39d057={'ContactId':_0xd25505['id'],'phone':_0x30bfa0[_0xd366('0x5e')][_0xd366('0x8b')],'SmsAccountId':_0xcbae8f[_0xd366('0x5a')]['id']};var _0x2ac69a={'ContactId':_0xd25505['id'],'SmsAccountId':_0xcbae8f[_0xd366('0x5a')]['id'],'closed':![]};return db[_0xd366('0xa7')][_0xd366('0x5c')]({'where':_0x2ac69a})[_0xd366('0x36')](function(_0x144262){if(_0x144262){return[_0x144262,![]];}return db[_0xd366('0xa7')][_0xd366('0x5d')](_0x39d057)[_0xd366('0x36')](function(_0x236e74){return[_0x236e74,!![]];});});}})[_0xd366('0xa8')](function(_0x3c727e,_0x14d78f){_0x30bfa0['interaction']=_0x3c727e[_0xd366('0x38')]({'plain':!![]});_0x30bfa0[_0xd366('0xa9')][_0xd366('0xaa')]=![];if(_0x14d78f){if(_0x30bfa0[_0xd366('0x75')][_0xd366('0xab')]){_0x30bfa0['applications'][_0xd366('0xac')]({'id':0x0,'priority':_0x30bfa0[_0xd366('0xad')]['length']+0x1,'app':_0xd366('0xae'),'appdata':'unmanaged','interval':_0xd366('0xaf')});}_0x30bfa0[_0xd366('0xa9')]['created']=!![];}return db[_0xd366('0xb0')][_0xd366('0x5d')]({'phone':_0x30bfa0[_0xd366('0x5e')][_0xd366('0x8b')],'messageId':_0x30bfa0[_0xd366('0x5e')][_0xd366('0x85')],'body':_0x30bfa0[_0xd366('0x5e')][_0xd366('0x5e')],'SmsAccountId':_0xcbae8f['params']['id'],'SmsInteractionId':_0x3c727e['id'],'direction':'in','ContactId':_0x3c727e[_0xd366('0xb1')],'AttachmentId':_0x30bfa0['body']['AttachmentId']});})['then'](function(_0x3892bf){_0x30bfa0[_0xd366('0x28')]=_0x3892bf;if(_0x30bfa0[_0xd366('0xa9')][_0xd366('0xb2')]){return db[_0xd366('0xb3')]['find']({'attributes':['id',_0xd366('0x3d')],'where':{'id':_0x30bfa0[_0xd366('0xa9')][_0xd366('0xb2')]}})[_0xd366('0x36')](function(_0x58180a){if(_0x58180a){_0x30bfa0[_0xd366('0xad')][_0xd366('0xb4')]({'id':0x0,'priority':0x0,'app':_0xd366('0xb5'),'appdata':_0x58180a[_0xd366('0x3d')]+','+(_0x30bfa0[_0xd366('0x75')][_0xd366('0xb6')]||0xa),'interval':_0xd366('0xaf')});}return respondWithRpcPromise('Start',_0xd366('0xb7'),_0x30bfa0);});}return respondWithRpcPromise(_0xd366('0xb8'),'startRouting',_0x30bfa0);})[_0xd366('0x36')](function(_0x17f33f){if(_0x17f33f){var _0x33d7dc=0xc8;var _0x2fe01b=_0xd366('0xb9');logger[_0xd366('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2fe01b,_0x33d7dc,_0xd366('0xba'));logger[_0xd366('0x24')](_0xd366('0xbb'),_0x2fe01b,_0x33d7dc,'entity\x20found',JSON['stringify'](_0x17f33f));if(_0x30bfa0[_0xd366('0x75')][_0xd366('0x53')]==='twilio'){return _0x5d2860[_0xd366('0x2c')](_0x33d7dc)[_0xd366('0x32')](_0xd366('0xbc'),'text/xml')[_0xd366('0x3e')](_0xd366('0xbd'));}else{return _0x5d2860['status'](_0x33d7dc)[_0xd366('0x2d')](_0x17f33f);}}})['catch'](handleError(_0x5d2860,null));};exports[_0xd366('0xbe')]=function(_0x19335a,_0x3c19e1){var _0x4b9817=_0x19335a['params']['id'];var _0x51ba90=_0x19335a[_0xd366('0x5e')];var _0xa85497=0xc8;var _0x275cfa=null;return db[_0xd366('0xbf')][_0xd366('0xc0')]({'isolationLevel':db[_0xd366('0xbf')][_0xd366('0xc1')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x19be95){return db['SmsAccount'][_0xd366('0x70')]({'where':{'id':_0x4b9817},'transaction':_0x19be95})['then'](function(_0x1c012c){if(_0x1c012c){return db['SmsApplication'][_0xd366('0x37')]({'where':{'SmsAccountId':_0x4b9817},'transaction':_0x19be95})['then'](function(){var _0x318bf1=_[_0xd366('0x41')](_0x51ba90,function(_0x38b60b){_0x38b60b[_0xd366('0x68')]=_0x4b9817;return _0x38b60b;});return db['SmsApplication'][_0xd366('0xc2')](_0x318bf1,{'transaction':_0x19be95});});}else{_0xa85497=0x194;_0x275cfa=[];}});})[_0xd366('0x36')](function(){if(_0xa85497!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x4b9817},'order':_0xd366('0xc3')})[_0xd366('0x36')](function(_0xac8fab){_0x275cfa=_0xac8fab;});}})['catch'](function(_0x500bd4){_0xa85497=0x1f4;logger[_0xd366('0x26')](_0x500bd4['stack']);if(_0x500bd4[_0xd366('0x3d')]){delete _0x500bd4['name'];}_0x275cfa=_0x500bd4;})[_0xd366('0xc4')](function(){if(_0x275cfa===null){_0x3c19e1['sendStatus'](_0xa85497);}else{if(_0xa85497===0x1f4){_0x3c19e1['status'](_0xa85497)['send'](_0x275cfa);}else{_0x3c19e1[_0xd366('0x2c')](_0xa85497)[_0xd366('0x2d')](_0x275cfa);}}});};exports[_0xd366('0xc5')]=function(_0x52fb26,_0x38e568,_0x2e5470){var _0x8e0f22={};var _0x22b4b7={};var _0x4aad90;var _0x22c670;return db['SmsAccount']['findOne']({'where':{'id':_0x52fb26[_0xd366('0x5a')]['id']}})['then'](handleEntityNotFound(_0x38e568,null))['then'](function(_0x3b6019){if(_0x3b6019){_0x4aad90=_0x3b6019;_0x22b4b7[_0xd366('0x44')]=_[_0xd366('0x46')](db[_0xd366('0x74')]['rawAttributes']);_0x22b4b7['query']=_[_0xd366('0x46')](_0x52fb26['query']);_0x22b4b7[_0xd366('0x47')]=_[_0xd366('0x48')](_0x22b4b7[_0xd366('0x44')],_0x22b4b7[_0xd366('0x45')]);_0x8e0f22[_0xd366('0x49')]=_[_0xd366('0x48')](_0x22b4b7['model'],qs[_0xd366('0x4a')](_0x52fb26[_0xd366('0x45')][_0xd366('0x4a')]));_0x8e0f22[_0xd366('0x49')]=_0x8e0f22[_0xd366('0x49')][_0xd366('0x5b')]?_0x8e0f22['attributes']:_0x22b4b7[_0xd366('0x44')];_0x8e0f22['order']=qs[_0xd366('0x4e')](_0x52fb26[_0xd366('0x45')]['sort']);_0x8e0f22[_0xd366('0x51')]=qs[_0xd366('0x47')](_[_0xd366('0x4f')](_0x52fb26['query'],_0x22b4b7[_0xd366('0x47')]));if(_0x52fb26[_0xd366('0x45')]['filter']){_0x8e0f22[_0xd366('0x51')]=_[_0xd366('0x52')](_0x8e0f22[_0xd366('0x51')],{'$or':_['map'](_0x8e0f22[_0xd366('0x49')],function(_0x440eca){var _0x181980={};_0x181980[_0x440eca]={'$like':'%'+_0x52fb26['query'][_0xd366('0x50')]+'%'};return _0x181980;})});}_0x8e0f22=_[_0xd366('0x52')]({},_0x8e0f22,_0x52fb26['options']);return _0x4aad90['getApplications'](_0x8e0f22);}})[_0xd366('0x36')](function(_0x474ec2){if(_0x474ec2){_0x22c670=_0x474ec2[_0xd366('0x5b')];if(!_0x52fb26[_0xd366('0x45')]['hasOwnProperty'](_0xd366('0x4c'))){_0x8e0f22[_0xd366('0x2f')]=qs['limit'](_0x52fb26['query']['limit']);_0x8e0f22[_0xd366('0x30')]=qs[_0xd366('0x30')](_0x52fb26[_0xd366('0x45')][_0xd366('0x30')]);}return _0x4aad90['getApplications'](_0x8e0f22);}})[_0xd366('0x36')](function(_0x521432){if(_0x521432){return _0x521432?{'count':_0x22c670,'rows':_0x521432}:null;}})[_0xd366('0x36')](respondWithResult(_0x38e568,null))[_0xd366('0x2a')](handleError(_0x38e568,null));};exports['getInteractions']=function(_0x5a3c7a,_0x15c713,_0x427a08){var _0x160099={'raw':![],'where':{}};var _0x3c6d5c={};var _0x48920c={'count':0x0,'rows':[]};return db[_0xd366('0x55')]['findOne']({'where':{'id':_0x5a3c7a[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x15c713,null))['then'](function(_0x596158){if(_0x596158){_0x3c6d5c[_0xd366('0x44')]=_[_0xd366('0x46')](db['SmsInteraction']['rawAttributes']);_0x3c6d5c[_0xd366('0x45')]=_['keys'](_0x5a3c7a[_0xd366('0x45')]);_0x3c6d5c['filters']=_[_0xd366('0x48')](_0x3c6d5c['model'],_0x3c6d5c['query']);_0x160099[_0xd366('0x49')]=_[_0xd366('0x48')](_0x3c6d5c[_0xd366('0x44')],qs[_0xd366('0x4a')](_0x5a3c7a[_0xd366('0x45')][_0xd366('0x4a')]));_0x160099[_0xd366('0x49')]=_0x160099['attributes'][_0xd366('0x5b')]?_0x160099['attributes']:_0x3c6d5c[_0xd366('0x44')];if(!_0x5a3c7a[_0xd366('0x45')][_0xd366('0x4b')](_0xd366('0x4c'))){_0x160099[_0xd366('0x2f')]=qs[_0xd366('0x2f')](_0x5a3c7a[_0xd366('0x45')][_0xd366('0x2f')]);_0x160099[_0xd366('0x30')]=qs[_0xd366('0x30')](_0x5a3c7a[_0xd366('0x45')][_0xd366('0x30')]);}_0x160099['order']=qs[_0xd366('0x4e')](_0x5a3c7a[_0xd366('0x45')][_0xd366('0x4e')]);_0x160099['where']=qs['filters'](_['pick'](_0x5a3c7a[_0xd366('0x45')],_0x3c6d5c[_0xd366('0x47')]));_0x160099[_0xd366('0x51')][_0xd366('0x68')]=_0x596158['id'];if(_0x5a3c7a[_0xd366('0x45')][_0xd366('0x50')]){_0x160099[_0xd366('0x51')]=_[_0xd366('0x52')](_0x160099[_0xd366('0x51')],{'$or':_[_0xd366('0x41')](_0x160099['attributes'],function(_0x27b620){var _0x3fdbff={};_0x3fdbff[_0x27b620]={'$like':'%'+_0x5a3c7a[_0xd366('0x45')][_0xd366('0x50')]+'%'};return _0x3fdbff;})});}_0x160099=_[_0xd366('0x52')]({},_0x160099,_0x5a3c7a[_0xd366('0x54')]);return db[_0xd366('0xa7')][_0xd366('0x31')]({'where':_0x160099[_0xd366('0x51')]})['then'](function(_0x990383){_0x48920c[_0xd366('0x31')]=_0x990383;if(_0x5a3c7a[_0xd366('0x45')]['includeAll']){_0x160099[_0xd366('0x57')]=[{'model':db['CmContact'],'as':_0xd366('0xc6'),'required':![]},{'model':db[_0xd366('0xb3')],'as':'Owner','attributes':['name',_0xd366('0xc7'),'internal'],'required':![]},{'model':db[_0xd366('0xc8')],'as':_0xd366('0xc9'),'attributes':['id',_0xd366('0x3d'),'color'],'where':_0x5a3c7a[_0xd366('0x45')][_0xd366('0xca')]?{'id':_0x5a3c7a[_0xd366('0x45')][_0xd366('0xca')]}:undefined,'required':_0x5a3c7a[_0xd366('0x45')][_0xd366('0xca')]?!![]:![]}];}return db['SmsInteraction'][_0xd366('0x58')](_0x160099);})[_0xd366('0x36')](function(_0x429316){_0x48920c['rows']=_0x429316;return _0x48920c;});}})[_0xd366('0x36')](respondWithFilteredResult(_0x15c713,_0x160099))[_0xd366('0x2a')](handleError(_0x15c713,null));};exports[_0xd366('0x3e')]=function(_0x59f859,_0x3eba75,_0x42286a){var _0x1858d2,_0x5948fa,_0xba3556;if(_[_0xd366('0x9a')](_0x59f859[_0xd366('0x5e')]['body'])||_0x59f859[_0xd366('0x5e')]['body']===''){throw new db['Sequelize'][(_0xd366('0x7a'))](_0xd366('0x9c'));}if(_['isNil'](_0x59f859[_0xd366('0x5e')]['to'])){throw new db[(_0xd366('0x79'))]['ValidationError'](_0xd366('0xcb'));}_0x1858d2=_0x59f859[_0xd366('0x5e')]['to'];return db['SmsAccount'][_0xd366('0x5c')]({'where':{'id':_0x59f859[_0xd366('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xd366('0xcc'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x1858d2},'limit':0x1,'order':[[_0xd366('0x7e'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x3eba75,null))[_0xd366('0x36')](function(_0x3c43cc){if(_0x3c43cc&&_0x3c43cc['List']){_0x5948fa=_0x3c43cc[_0xd366('0x38')]({'plain':!![]});if(_0x5948fa['List']&&_0x5948fa[_0xd366('0xcc')]['Contacts'][_0xd366('0x5b')]){return _0x5948fa[_0xd366('0xcc')][_0xd366('0xa2')][0x0];}return db[_0xd366('0xa5')]['create'](_[_0xd366('0x18')](_0x59f859[_0xd366('0x5e')],{'firstName':_0x1858d2,'mobile':_0x1858d2,'phone':_0x1858d2,'ListId':_0x5948fa[_0xd366('0x80')]}));}})['then'](handleEntityNotFound(_0x3eba75,null))[_0xd366('0x36')](function(_0x25da70){if(_0x25da70){_0xba3556=_0x25da70;return db[_0xd366('0xa7')][_0xd366('0x5c')]({'where':{'ContactId':_0xba3556['id'],'closed':![],'SmsAccountId':_0x5948fa['id']}})[_0xd366('0x36')](function(_0x29161){if(_0x29161){return[_0x29161,![]];}return db['SmsInteraction'][_0xd366('0x5d')]({'UserId':_0x59f859['user']['id'],'ContactId':_0xba3556['id'],'SmsAccountId':_0x5948fa['id'],'phone':_0x1858d2,'firstMsgDirection':_0xd366('0xcd'),'Messages':[_[_0xd366('0x52')](_0x59f859['body'],{'read':![],'body':_0x59f859['body']['body'],'phone':_0x1858d2,'SmsAccountId':_0x5948fa['id'],'UserId':_0x59f859[_0xd366('0x61')]['id'],'ContactId':_0xba3556['id']})]},{'include':[{'model':db[_0xd366('0xb0')],'as':'Messages'}]})['then'](function(_0x2f1f19){return[_0x2f1f19,!![]];});});}})[_0xd366('0xa8')](function(_0x4baa02,_0x466822){if(_0x466822){return _0x4baa02;}return db[_0xd366('0xb0')][_0xd366('0x5d')](_[_0xd366('0x52')](_0x59f859[_0xd366('0x5e')],{'read':![],'body':_0x59f859[_0xd366('0x5e')]['body'],'phone':_0x1858d2,'SmsAccountId':_0x5948fa['id'],'SmsInteractionId':_0x4baa02['id'],'UserId':_0x59f859[_0xd366('0x61')]['id'],'ContactId':_0xba3556['id']}))[_0xd366('0x36')](function(_0x2ee4d7){_0x4baa02['dataValues']['Messages']=[];_0x4baa02[_0xd366('0xce')]['Messages'][_0xd366('0xac')](_0x2ee4d7[_0xd366('0xce')]);return _0x4baa02;});})['then'](respondWithResult(_0x3eba75,null))[_0xd366('0x2a')](handleError(_0x3eba75,null));};exports[_0xd366('0x2c')]=function(_0x894c24,_0xd45939,_0x3c433c){if(_0x894c24[_0xd366('0x5e')]['id']){delete _0x894c24['body']['id'];}var _0xaa2ce5,_0x1bbbe5,_0x294218;return db[_0xd366('0x55')]['find']({'where':{'id':_0x894c24['params']['id']}})[_0xd366('0x36')](handleEntityNotFound(_0xd45939,null))[_0xd366('0x36')](function(_0x4f7518){if(_0x4f7518){_0x294218=_0x4f7518;logger[_0xd366('0x24')](_0xd366('0xcf'),'status','received\x20delivery\x20report\x20from',_0x4f7518['type'],util['inspect'](_0x894c24[_0xd366('0x5e')],{'showHidden':![],'depth':null}));switch(_0x4f7518[_0xd366('0x53')]){case _0xd366('0x87'):if(_0x894c24['body']['skebby_dispatch_id']&&_0x894c24['body'][_0xd366('0x2c')]){_0x1bbbe5=_0x894c24[_0xd366('0x5e')][_0xd366('0x2c')];return db[_0xd366('0xb0')][_0xd366('0x5c')]({'where':{'messageId':_0x894c24[_0xd366('0x5e')][_0xd366('0xd0')]}});}break;case _0xd366('0x8a'):if(_0x894c24['body'][_0xd366('0xd1')]&&_0x894c24[_0xd366('0x5e')]['statusInt']){_0x1bbbe5=_0x894c24[_0xd366('0x5e')][_0xd366('0xd2')];return db[_0xd366('0xb0')][_0xd366('0x5c')]({'where':{'messageId':_0x894c24['body'][_0xd366('0xd1')]}});}break;case _0xd366('0x8c'):if(_0x894c24[_0xd366('0x5e')]['message_id']&&_0x894c24[_0xd366('0x5e')][_0xd366('0xd3')]){_0x1bbbe5=_0x894c24[_0xd366('0x5e')]['status_code'];return db[_0xd366('0xb0')]['find']({'where':{'messageId':_0x894c24[_0xd366('0x5e')][_0xd366('0x8d')]}});}break;case'infobip':var _0x523823=_0x894c24[_0xd366('0x5e')][_0xd366('0x92')][0x0];if(_0x523823[_0xd366('0x85')]&&_0x523823[_0xd366('0x2c')][_0xd366('0xd4')]===_0xd366('0xd5')){_0x1bbbe5=_0x523823[_0xd366('0x2c')][_0xd366('0xd4')];return db[_0xd366('0xb0')][_0xd366('0x5c')]({'where':{'messageId':_0x523823['messageId']}});}break;case _0xd366('0x95'):if(_0x894c24[_0xd366('0x5e')][_0xd366('0x85')]&&_0x894c24['body']['status']){_0x1bbbe5=_0x894c24[_0xd366('0x5e')][_0xd366('0x2c')];return db['SmsMessage'][_0xd366('0x5c')]({'where':{'messageId':_0x894c24[_0xd366('0x5e')][_0xd366('0x85')]}});}break;case _0xd366('0x98'):if(_0x894c24[_0xd366('0x5e')][0x0][_0xd366('0x28')]['id']){_0x1bbbe5=_0x894c24[_0xd366('0x5e')][0x0][_0xd366('0x53')];return db['SmsMessage'][_0xd366('0x5c')]({'where':{'messageId':_0x894c24[_0xd366('0x5e')][0x0][_0xd366('0x28')]['id']}});}break;case _0xd366('0x99'):if(_0x894c24[_0xd366('0x5e')]['redif']&&_0x894c24[_0xd366('0x5e')][_0xd366('0x2c')]){_0x1bbbe5=_0x894c24[_0xd366('0x5e')][_0xd366('0x2c')];return db[_0xd366('0xb0')]['find']({'where':{'messageId':_0x894c24[_0xd366('0x5e')]['redif']}});}break;}}})[_0xd366('0x36')](handleEntityNotFound(_0xd45939,null))[_0xd366('0x36')](function(_0x544b03){if(_0x544b03){_0xaa2ce5=_0x544b03;switch(_0x294218[_0xd366('0x53')]){case _0xd366('0x87'):if(_0x1bbbe5==='DELIVERED'){return _0xaa2ce5[_0xd366('0x65')]({'read':!![]});}else{logger[_0xd366('0x26')](_0xd366('0xcf'),_0xd366('0x2c'),'skebby',util[_0xd366('0xd6')](_0x894c24[_0xd366('0x5e')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1bbbe5==='1'){return _0xaa2ce5[_0xd366('0x65')]({'read':!![]});}else{logger[_0xd366('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd366('0x2c'),'skebby',util[_0xd366('0xd6')](_0x894c24['body'],{'showHidden':![],'depth':null}));}break;case _0xd366('0x8c'):if(!_0x894c24[_0xd366('0x5e')][_0xd366('0xd7')]&&_0x1bbbe5>=0xc8&&_0x1bbbe5<=0xce){return _0xaa2ce5[_0xd366('0x65')]({'read':!![]});}else{logger[_0xd366('0x26')](_0xd366('0xcf'),_0xd366('0x2c'),_0xd366('0x8c'),util[_0xd366('0xd6')](_0x894c24['body'],{'showHidden':![],'depth':null}));}break;case _0xd366('0x91'):var _0x4f5f7f=_0x894c24[_0xd366('0x5e')][_0xd366('0x92')][0x0];if(_0x4f5f7f[_0xd366('0x2c')][_0xd366('0xd4')]===_0xd366('0xd5')){return _0xaa2ce5[_0xd366('0x65')]({'read':!![]});}else{logger[_0xd366('0x26')](_0xd366('0xcf'),_0xd366('0x2c'),_0xd366('0x91'),util['inspect'](_0x894c24[_0xd366('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd366('0x95'):if(_0x1bbbe5==_0xd366('0xd8')||_0x1bbbe5==_0xd366('0xd9')){return _0xaa2ce5[_0xd366('0x65')]({'read':!![]});}else{logger['error'](_0xd366('0xcf'),_0xd366('0x2c'),'clickatell',util[_0xd366('0xd6')](_0x894c24[_0xd366('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xd366('0x98'):if(_0x1bbbe5==_0xd366('0xda')){return _0xaa2ce5['update']({'read':!![]});}else{logger[_0xd366('0x26')](_0xd366('0xcf'),_0xd366('0x2c'),_0xd366('0x98'),util[_0xd366('0xd6')](_0x894c24['body'],{'showHidden':![],'depth':null}));}break;case _0xd366('0x99'):if(_0x1bbbe5===_0xd366('0xdb')||_0x1bbbe5===_0xd366('0xdc')){return _0xaa2ce5[_0xd366('0x65')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd366('0x2c'),_0xd366('0x99'),util[_0xd366('0xd6')](_0x894c24[_0xd366('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0xaa2ce5;}})['then'](respondWithResult(_0xd45939,null))[_0xd366('0x2a')](handleError(_0xd45939,null));};exports[_0xd366('0xdd')]=function(_0x529042,_0x3aeb66,_0x1e47f0){var _0x39722e,_0x1c6131,_0x5e1a0e;return db[_0xd366('0x55')][_0xd366('0x5c')]({'where':{'id':_0x529042[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x3aeb66,null))[_0xd366('0x36')](function(_0x1e1938){if(_0x1e1938){_0x5e1a0e=_0x1e1938;logger['debug'](_0xd366('0xcf'),_0xd366('0x2c'),_0xd366('0xde'),_0x1e1938['type'],util[_0xd366('0xd6')](_0x529042[_0xd366('0x45')],{'showHidden':![],'depth':null}));switch(_0x1e1938['type']){case _0xd366('0x93'):if(_0x529042[_0xd366('0x45')][_0xd366('0xdf')]&&_0x529042['query'][_0xd366('0xe0')]){_0x1c6131=_0x529042[_0xd366('0x45')][_0xd366('0xe0')];return db['SmsMessage'][_0xd366('0x5c')]({'where':{'messageId':_0x529042[_0xd366('0x45')][_0xd366('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x3aeb66,null))[_0xd366('0x36')](function(_0x2bfd56){if(_0x2bfd56){_0x39722e=_0x2bfd56;switch(_0x5e1a0e[_0xd366('0x53')]){case'csc':if(_0x1c6131==='2'||_0x1c6131==='6'){return _0x39722e['update']({'read':!![]});}else{logger[_0xd366('0x26')](_0xd366('0xcf'),_0xd366('0x2c'),'csc',util[_0xd366('0xd6')](_0x529042['query'],{'showHidden':![],'depth':null}));};break;}return _0x39722e;}})[_0xd366('0x36')](respondWithResult(_0x3aeb66,null))[_0xd366('0x2a')](handleError(_0x3aeb66,null));};exports[_0xd366('0xe1')]=function(_0x37114e,_0x40dc3a,_0x5ce9cf){return db[_0xd366('0x55')][_0xd366('0x5c')]({'where':{'id':_0x37114e[_0xd366('0x5a')]['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x40dc3a,null))['then'](function(_0x34bd84){if(_0x34bd84){return _0x34bd84['addAgents'](_0x37114e[_0xd366('0x5e')]['ids'],_['omit'](_0x37114e[_0xd366('0x5e')],[_0xd366('0x6c'),'id'])||{})['spread'](function(_0x424475){for(var _0x175967=0x0;_0x175967<_0x37114e[_0xd366('0x5e')][_0xd366('0x6c')][_0xd366('0x5b')];_0x175967+=0x1){socket[_0xd366('0xe2')]('userSmsAccount:save',{'UserId':Number(_0x37114e[_0xd366('0x5e')][_0xd366('0x6c')][_0x175967]),'SmsAccountId':Number(_0x37114e[_0xd366('0x5a')]['id'])});}return _0x424475;});}})[_0xd366('0x36')](respondWithResult(_0x40dc3a,null))[_0xd366('0x2a')](handleError(_0x40dc3a,null));};exports['removeAgents']=function(_0x1b3e66,_0x570cef,_0x2fdccb){return db[_0xd366('0x55')][_0xd366('0x5c')]({'where':{'id':_0x1b3e66['params']['id']}})[_0xd366('0x36')](handleEntityNotFound(_0x570cef,null))[_0xd366('0x36')](function(_0x56d99f){if(_0x56d99f){return _0x56d99f[_0xd366('0xe3')](_0x1b3e66[_0xd366('0x45')][_0xd366('0x6c')])[_0xd366('0x36')](function(){if(_[_0xd366('0xe4')](_0x1b3e66[_0xd366('0x45')][_0xd366('0x6c')])){for(var _0x200924=0x0;_0x200924<_0x1b3e66[_0xd366('0x45')][_0xd366('0x6c')][_0xd366('0x5b')];_0x200924+=0x1){socket['emit'](_0xd366('0xe5'),{'UserId':Number(_0x1b3e66[_0xd366('0x45')][_0xd366('0x6c')][_0x200924]),'SmsAccountId':Number(_0x1b3e66['params']['id'])});}}else{socket[_0xd366('0xe2')](_0xd366('0xe5'),{'UserId':Number(_0x1b3e66[_0xd366('0x45')][_0xd366('0x6c')]),'SmsAccountId':Number(_0x1b3e66[_0xd366('0x5a')]['id'])});}});}})[_0xd366('0x36')](respondWithStatusCode(_0x570cef,null))[_0xd366('0x2a')](handleError(_0x570cef,null));};exports[_0xd366('0xe6')]=function(_0x736852,_0x40fc55,_0x522501){var _0x24c295={};var _0x445885={};var _0x507d1f;var _0x42a312;return db[_0xd366('0x55')][_0xd366('0x70')]({'where':{'id':_0x736852['params']['id']}})['then'](handleEntityNotFound(_0x40fc55,null))[_0xd366('0x36')](function(_0x2209b7){if(_0x2209b7){_0x507d1f=_0x2209b7;_0x445885[_0xd366('0x44')]=_['keys'](db[_0xd366('0xb3')][_0xd366('0x6a')]);_0x445885[_0xd366('0x45')]=_[_0xd366('0x46')](_0x736852[_0xd366('0x45')]);_0x445885[_0xd366('0x47')]=_[_0xd366('0x48')](_0x445885[_0xd366('0x44')],_0x445885[_0xd366('0x45')]);_0x24c295[_0xd366('0x49')]=_[_0xd366('0x48')](_0x445885[_0xd366('0x44')],qs[_0xd366('0x4a')](_0x736852[_0xd366('0x45')]['fields']));_0x24c295[_0xd366('0x49')]=_0x24c295[_0xd366('0x49')]['length']?_0x24c295['attributes']:_0x445885['model'];_0x24c295[_0xd366('0x4d')]=qs[_0xd366('0x4e')](_0x736852[_0xd366('0x45')][_0xd366('0x4e')]);_0x24c295[_0xd366('0x51')]=qs[_0xd366('0x47')](_['pick'](_0x736852[_0xd366('0x45')],_0x445885[_0xd366('0x47')]));if(_0x736852['query'][_0xd366('0x50')]){_0x24c295['where']=_[_0xd366('0x52')](_0x24c295[_0xd366('0x51')],{'$or':_[_0xd366('0x41')](_0x24c295[_0xd366('0x49')],function(_0x2fc4b1){var _0x3ec620={};_0x3ec620[_0x2fc4b1]={'$like':'%'+_0x736852[_0xd366('0x45')]['filter']+'%'};return _0x3ec620;})});}_0x24c295=_[_0xd366('0x52')]({},_0x24c295,_0x736852[_0xd366('0x54')]);return _0x507d1f[_0xd366('0xe6')](_0x24c295);}})[_0xd366('0x36')](function(_0x29cb73){if(_0x29cb73){_0x42a312=_0x29cb73[_0xd366('0x5b')];if(!_0x736852[_0xd366('0x45')][_0xd366('0x4b')](_0xd366('0x4c'))){_0x24c295[_0xd366('0x2f')]=qs[_0xd366('0x2f')](_0x736852[_0xd366('0x45')]['limit']);_0x24c295[_0xd366('0x30')]=qs[_0xd366('0x30')](_0x736852[_0xd366('0x45')]['offset']);}return _0x507d1f['getAgents'](_0x24c295);}})[_0xd366('0x36')](function(_0x2f8a20){if(_0x2f8a20){return _0x2f8a20?{'count':_0x42a312,'rows':_0x2f8a20}:null;}})[_0xd366('0x36')](respondWithResult(_0x40fc55,null))[_0xd366('0x2a')](handleError(_0x40fc55,null));}; \ No newline at end of file +var _0xcdf2=['code','error','message','info','result','catch','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','status','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','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','addDisposition','Disposition','findOne','SmsAccountId','removeDispositions','ids','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','describe','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','MessageSid','sender','text','connectel','clicksend','messageId','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','bandwidth','refid','isNil','Sequelize','ValidationError','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','list','omit','contact','SmsInteraction','interaction','created','close','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','stack','finally','getApplications','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','spread','dataValues','Messages','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','message_id','status_code','DELIVERED','intelepeer','redif','error_code','groupName','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','zip-dir','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/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','./smsAccount.socket','register','client','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ee8e1,_0x12bb31){var _0x1467b9=function(_0x35d0ff){while(--_0x35d0ff){_0x5ee8e1['push'](_0x5ee8e1['shift']());}};_0x1467b9(++_0x12bb31);}(_0xcdf2,0xbf));var _0x2cdf=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0xcdf2[_0x35af23];return _0x340506;};'use strict';var emlformat=require(_0x2cdf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cdf('0x1'));var jsonpatch=require(_0x2cdf('0x2'));var rp=require(_0x2cdf('0x3'));var moment=require(_0x2cdf('0x4'));var BPromise=require(_0x2cdf('0x5'));var Mustache=require(_0x2cdf('0x6'));var util=require(_0x2cdf('0x7'));var path=require(_0x2cdf('0x8'));var sox=require(_0x2cdf('0x9'));var csv=require(_0x2cdf('0xa'));var ejs=require(_0x2cdf('0xb'));var fs=require('fs');var fs_extra=require(_0x2cdf('0xc'));var _=require(_0x2cdf('0xd'));var squel=require(_0x2cdf('0xe'));var crypto=require('crypto');var jsforce=require(_0x2cdf('0xf'));var deskjs=require(_0x2cdf('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2cdf('0x11'));var Papa=require(_0x2cdf('0x12'));var Redis=require(_0x2cdf('0x13'));var authService=require(_0x2cdf('0x14'));var qs=require(_0x2cdf('0x15'));var as=require(_0x2cdf('0x16'));var hardwareService=require(_0x2cdf('0x17'));var logger=require(_0x2cdf('0x18'))(_0x2cdf('0x19'));var utils=require(_0x2cdf('0x1a'));var config=require(_0x2cdf('0x1b'));var licenseUtil=require(_0x2cdf('0x1c'));var db=require(_0x2cdf('0x1d'))['db'];config[_0x2cdf('0x1e')]=_['defaults'](config[_0x2cdf('0x1e')],{'host':_0x2cdf('0x1f'),'port':0x18eb});var socket=require(_0x2cdf('0x20'))(new Redis(config[_0x2cdf('0x1e')]));require(_0x2cdf('0x21'))[_0x2cdf('0x22')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2cdf('0x23')][_0x2cdf('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x20c9ec,_0x480bb6,_0x3cc7dd,_0xd8bd68){return new BPromise(function(_0x32dde8,_0x3742a1){var _0x27b31c=_0xd8bd68||client;return _0x27b31c[_0x2cdf('0x25')](_0x20c9ec,_0x3cc7dd)[_0x2cdf('0x26')](function(_0x5546e6){logger['info'](_0x2cdf('0x27'),_0x480bb6,_0x2cdf('0x28'));logger[_0x2cdf('0x29')](_0x2cdf('0x2a'),_0x480bb6,_0x2cdf('0x28'),JSON[_0x2cdf('0x2b')](_0x5546e6));if(_0x5546e6['error']){if(_0x5546e6['error'][_0x2cdf('0x2c')]===0x1f4){logger['error'](_0x2cdf('0x27'),_0x480bb6,_0x5546e6[_0x2cdf('0x2d')][_0x2cdf('0x2e')]);return _0x3742a1(_0x5546e6[_0x2cdf('0x2d')]['message']);}logger[_0x2cdf('0x2d')](_0x2cdf('0x27'),_0x480bb6,_0x5546e6['error'][_0x2cdf('0x2e')]);return _0x32dde8(_0x5546e6[_0x2cdf('0x2d')][_0x2cdf('0x2e')]);}else{logger[_0x2cdf('0x2f')](_0x2cdf('0x27'),_0x480bb6,_0x2cdf('0x28'));_0x32dde8(_0x5546e6[_0x2cdf('0x30')][_0x2cdf('0x2e')]);}})[_0x2cdf('0x31')](function(_0x41c9b3){logger[_0x2cdf('0x2d')](_0x2cdf('0x27'),_0x480bb6,_0x41c9b3);_0x3742a1(_0x41c9b3);});});}function respondWithStatusCode(_0x1048c3,_0x4c9f9d){_0x4c9f9d=_0x4c9f9d||0xcc;return function(_0x15b8be){if(_0x15b8be){return _0x1048c3[_0x2cdf('0x32')](_0x4c9f9d);}return _0x1048c3['status'](_0x4c9f9d)[_0x2cdf('0x33')]();};}function respondWithResult(_0x1e4de7,_0xc1f2e0){_0xc1f2e0=_0xc1f2e0||0xc8;return function(_0xebf1f5){if(_0xebf1f5){return _0x1e4de7['status'](_0xc1f2e0)[_0x2cdf('0x34')](_0xebf1f5);}};}function respondWithFilteredResult(_0x34d1e4,_0x49f9a7){return function(_0x24a57f){if(_0x24a57f){var _0xbe3a1c=typeof _0x49f9a7[_0x2cdf('0x35')]===_0x2cdf('0x36')&&typeof _0x49f9a7[_0x2cdf('0x37')]===_0x2cdf('0x36');var _0x1d7b9f=_0x24a57f[_0x2cdf('0x38')];var _0x25e468=_0xbe3a1c?0x0:_0x49f9a7[_0x2cdf('0x35')];var _0x213eac=_0xbe3a1c?_0x24a57f[_0x2cdf('0x38')]:_0x49f9a7[_0x2cdf('0x35')]+_0x49f9a7[_0x2cdf('0x37')];var _0x4265a5;if(_0x213eac>=_0x1d7b9f){_0x213eac=_0x1d7b9f;_0x4265a5=0xc8;}else{_0x4265a5=0xce;}_0x34d1e4['status'](_0x4265a5);return _0x34d1e4[_0x2cdf('0x39')](_0x2cdf('0x3a'),_0x25e468+'-'+_0x213eac+'/'+_0x1d7b9f)[_0x2cdf('0x34')](_0x24a57f);}return null;};}function patchUpdates(_0x3ba43a){return function(_0x37294a){try{jsonpatch['apply'](_0x37294a,_0x3ba43a,!![]);}catch(_0xfe4549){return BPromise[_0x2cdf('0x3b')](_0xfe4549);}return _0x37294a[_0x2cdf('0x3c')]();};}function saveUpdates(_0x403f84,_0x5b4cd6){return function(_0x329be3){if(_0x329be3){return _0x329be3[_0x2cdf('0x3d')](_0x403f84)['then'](function(_0x37a359){return _0x37a359;});}return null;};}function removeEntity(_0x339ff1,_0x4b6900){return function(_0x45c41c){if(_0x45c41c){return _0x45c41c[_0x2cdf('0x3e')]()['then'](function(){var _0x571100=_0x45c41c[_0x2cdf('0x3f')]({'plain':!![]});var _0x5f28cb=_0x2cdf('0x40');return db[_0x2cdf('0x41')][_0x2cdf('0x3e')]({'where':{'type':_0x5f28cb,'resourceId':_0x571100['id']}})[_0x2cdf('0x26')](function(){return _0x45c41c;});})[_0x2cdf('0x26')](function(){_0x339ff1[_0x2cdf('0x42')](0xcc)[_0x2cdf('0x33')]();});}};}function handleEntityNotFound(_0x40b341,_0x5c9f77){return function(_0x42c393){if(!_0x42c393){_0x40b341[_0x2cdf('0x32')](0x194);}return _0x42c393;};}function handleError(_0x246ec1,_0x4849c4){_0x4849c4=_0x4849c4||0x1f4;return function(_0x2e8dfd){logger['error'](_0x2e8dfd['stack']);if(_0x2e8dfd[_0x2cdf('0x43')]){delete _0x2e8dfd[_0x2cdf('0x43')];}_0x246ec1['status'](_0x4849c4)[_0x2cdf('0x44')](_0x2e8dfd);};}exports[_0x2cdf('0x45')]=function(_0x5c073d,_0x315bd9){var _0x4d8970={'include':[{'model':db[_0x2cdf('0x46')],'as':_0x2cdf('0x47')}]},_0x4657eb={},_0x4f586b={'count':0x0,'rows':[]};var _0x588724=_['map'](db[_0x2cdf('0x48')][_0x2cdf('0x49')],function(_0x11d095){return{'name':_0x11d095['fieldName'],'type':_0x11d095[_0x2cdf('0x4a')]['key']};});_0x4657eb['model']=_[_0x2cdf('0x4b')](_0x588724,_0x2cdf('0x43'));_0x4657eb[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x5c073d[_0x2cdf('0x4c')]);_0x4657eb[_0x2cdf('0x4e')]=_[_0x2cdf('0x4f')](_0x4657eb[_0x2cdf('0x50')],_0x4657eb[_0x2cdf('0x4c')]);_0x4d8970[_0x2cdf('0x51')]=_[_0x2cdf('0x4f')](_0x4657eb[_0x2cdf('0x50')],qs[_0x2cdf('0x52')](_0x5c073d[_0x2cdf('0x4c')][_0x2cdf('0x52')]));_0x4d8970['attributes']=_0x4d8970[_0x2cdf('0x51')][_0x2cdf('0x53')]?_0x4d8970[_0x2cdf('0x51')]:_0x4657eb[_0x2cdf('0x50')];if(!_0x5c073d[_0x2cdf('0x4c')][_0x2cdf('0x54')](_0x2cdf('0x55'))){_0x4d8970[_0x2cdf('0x37')]=qs['limit'](_0x5c073d['query'][_0x2cdf('0x37')]);_0x4d8970[_0x2cdf('0x35')]=qs[_0x2cdf('0x35')](_0x5c073d[_0x2cdf('0x4c')]['offset']);}_0x4d8970[_0x2cdf('0x56')]=qs[_0x2cdf('0x57')](_0x5c073d[_0x2cdf('0x4c')][_0x2cdf('0x57')]);_0x4d8970[_0x2cdf('0x58')]=qs['filters'](_[_0x2cdf('0x59')](_0x5c073d[_0x2cdf('0x4c')],_0x4657eb[_0x2cdf('0x4e')]),_0x588724);if(_0x5c073d[_0x2cdf('0x4c')][_0x2cdf('0x5a')]){_0x4d8970[_0x2cdf('0x58')]=_['merge'](_0x4d8970[_0x2cdf('0x58')],{'$or':_['map'](_0x588724,function(_0x59ef31){if(_0x59ef31[_0x2cdf('0x4a')]!==_0x2cdf('0x5b')){var _0x49a347={};_0x49a347[_0x59ef31[_0x2cdf('0x43')]]={'$like':'%'+_0x5c073d['query'][_0x2cdf('0x5a')]+'%'};return _0x49a347;}})});}_0x4d8970=_[_0x2cdf('0x5c')]({},_0x4d8970,_0x5c073d[_0x2cdf('0x5d')]);var _0x224fca={'where':_0x4d8970[_0x2cdf('0x58')]};return db['SmsAccount'][_0x2cdf('0x38')](_0x224fca)[_0x2cdf('0x26')](function(_0x209488){_0x4f586b[_0x2cdf('0x38')]=_0x209488;if(_0x5c073d['query'][_0x2cdf('0x5e')]){_0x4d8970[_0x2cdf('0x5f')]=[{'all':!![]}];}return db['SmsAccount'][_0x2cdf('0x60')](_0x4d8970);})[_0x2cdf('0x26')](function(_0x7f8fbb){_0x4f586b[_0x2cdf('0x61')]=_0x7f8fbb;return _0x4f586b;})[_0x2cdf('0x26')](respondWithFilteredResult(_0x315bd9,_0x4d8970))[_0x2cdf('0x31')](handleError(_0x315bd9,null));};exports[_0x2cdf('0x62')]=function(_0x48cfbb,_0x2212b5){var _0x145aed={'raw':![],'where':{'id':_0x48cfbb[_0x2cdf('0x63')]['id']},'include':[{'model':db[_0x2cdf('0x46')],'as':_0x2cdf('0x47')}]},_0x2291f4={};_0x2291f4[_0x2cdf('0x50')]=_['keys'](db[_0x2cdf('0x48')][_0x2cdf('0x49')]);_0x2291f4[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x48cfbb['query']);_0x2291f4[_0x2cdf('0x4e')]=_[_0x2cdf('0x4f')](_0x2291f4[_0x2cdf('0x50')],_0x2291f4['query']);_0x145aed[_0x2cdf('0x51')]=_[_0x2cdf('0x4f')](_0x2291f4[_0x2cdf('0x50')],qs['fields'](_0x48cfbb[_0x2cdf('0x4c')]['fields']));_0x145aed[_0x2cdf('0x51')]=_0x145aed[_0x2cdf('0x51')][_0x2cdf('0x53')]?_0x145aed[_0x2cdf('0x51')]:_0x2291f4[_0x2cdf('0x50')];if(_0x48cfbb[_0x2cdf('0x4c')]['includeAll']){_0x145aed[_0x2cdf('0x5f')]=[{'all':!![]}];}_0x145aed=_[_0x2cdf('0x5c')]({},_0x145aed,_0x48cfbb['options']);return db[_0x2cdf('0x48')][_0x2cdf('0x64')](_0x145aed)['then'](handleEntityNotFound(_0x2212b5,null))['then'](respondWithResult(_0x2212b5,null))[_0x2cdf('0x31')](handleError(_0x2212b5,null));};exports[_0x2cdf('0x65')]=function(_0x359956,_0x4b6cdd){return db[_0x2cdf('0x48')][_0x2cdf('0x65')](_0x359956[_0x2cdf('0x66')],{})['then'](function(_0x72c876){var _0x54edfb=_0x359956[_0x2cdf('0x67')]['get']({'plain':!![]});if(!_0x54edfb)throw new Error(_0x2cdf('0x68'));if(_0x54edfb[_0x2cdf('0x69')]===_0x2cdf('0x67')){var _0x5a71dd=_0x72c876[_0x2cdf('0x3f')]({'plain':!![]});var _0x5de2a1=_0x2cdf('0x40');return db[_0x2cdf('0x6a')][_0x2cdf('0x64')]({'where':{'name':_0x5de2a1,'userProfileId':_0x54edfb[_0x2cdf('0x6b')]},'raw':!![]})['then'](function(_0x16e138){if(_0x16e138&&_0x16e138[_0x2cdf('0x6c')]===0x0){return db[_0x2cdf('0x41')][_0x2cdf('0x65')]({'name':_0x5a71dd[_0x2cdf('0x43')],'resourceId':_0x5a71dd['id'],'type':_0x16e138[_0x2cdf('0x43')],'sectionId':_0x16e138['id']},{})[_0x2cdf('0x26')](function(){return _0x72c876;});}else{return _0x72c876;}})[_0x2cdf('0x31')](function(_0x41e7f2){logger[_0x2cdf('0x2d')](_0x2cdf('0x6d'),_0x41e7f2);throw _0x41e7f2;});}return _0x72c876;})[_0x2cdf('0x26')](respondWithResult(_0x4b6cdd,0xc9))['catch'](handleError(_0x4b6cdd,null));};exports[_0x2cdf('0x3d')]=function(_0x339f52,_0x3ed052){if(_0x339f52[_0x2cdf('0x66')]['id']){delete _0x339f52[_0x2cdf('0x66')]['id'];}return db[_0x2cdf('0x48')][_0x2cdf('0x64')]({'where':{'id':_0x339f52[_0x2cdf('0x63')]['id']},'include':[{'model':db[_0x2cdf('0x46')],'as':_0x2cdf('0x47')}]})[_0x2cdf('0x26')](handleEntityNotFound(_0x3ed052,null))[_0x2cdf('0x26')](saveUpdates(_0x339f52[_0x2cdf('0x66')],null))[_0x2cdf('0x26')](respondWithResult(_0x3ed052,null))[_0x2cdf('0x31')](handleError(_0x3ed052,null));};exports[_0x2cdf('0x3e')]=function(_0x442ae1,_0x620126){return db[_0x2cdf('0x48')][_0x2cdf('0x64')]({'where':{'id':_0x442ae1[_0x2cdf('0x63')]['id']}})['then'](handleEntityNotFound(_0x620126,null))[_0x2cdf('0x26')](removeEntity(_0x620126,null))[_0x2cdf('0x31')](handleError(_0x620126,null));};exports['describe']=function(_0x3f8769,_0x353223){return db[_0x2cdf('0x48')]['describe']()[_0x2cdf('0x26')](respondWithResult(_0x353223,null))['catch'](handleError(_0x353223,null));};exports[_0x2cdf('0x6e')]=function(_0x56daa0,_0x575c56,_0x5247ec){if(_0x56daa0[_0x2cdf('0x66')]['id']){delete _0x56daa0['body']['id'];}return db[_0x2cdf('0x48')][_0x2cdf('0x64')]({'where':{'id':_0x56daa0[_0x2cdf('0x63')]['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0x575c56,null))[_0x2cdf('0x26')](function(_0x48c23c){if(_0x48c23c){_0x56daa0[_0x2cdf('0x66')]['SmsAccountId']=_0x48c23c['id'];return db[_0x2cdf('0x6f')]['create'](_0x56daa0[_0x2cdf('0x66')]);}})[_0x2cdf('0x26')](respondWithResult(_0x575c56,null))[_0x2cdf('0x31')](handleError(_0x575c56,null));};exports['getDispositions']=function(_0x2c5728,_0x1ca6e1,_0x57781d){var _0x2853e2={'raw':![],'where':{}};var _0x4ae385={};var _0x4fa287={'count':0x0,'rows':[]};return db[_0x2cdf('0x48')][_0x2cdf('0x70')]({'where':{'id':_0x2c5728[_0x2cdf('0x63')]['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0x1ca6e1,null))[_0x2cdf('0x26')](function(_0x51d820){if(_0x51d820){_0x4ae385[_0x2cdf('0x50')]=_[_0x2cdf('0x4d')](db[_0x2cdf('0x6f')]['rawAttributes']);_0x4ae385[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x2c5728[_0x2cdf('0x4c')]);_0x4ae385[_0x2cdf('0x4e')]=_[_0x2cdf('0x4f')](_0x4ae385[_0x2cdf('0x50')],_0x4ae385[_0x2cdf('0x4c')]);_0x2853e2[_0x2cdf('0x51')]=_['intersection'](_0x4ae385[_0x2cdf('0x50')],qs[_0x2cdf('0x52')](_0x2c5728[_0x2cdf('0x4c')][_0x2cdf('0x52')]));_0x2853e2[_0x2cdf('0x51')]=_0x2853e2[_0x2cdf('0x51')][_0x2cdf('0x53')]?_0x2853e2[_0x2cdf('0x51')]:_0x4ae385['model'];if(!_0x2c5728[_0x2cdf('0x4c')][_0x2cdf('0x54')](_0x2cdf('0x55'))){_0x2853e2[_0x2cdf('0x37')]=qs['limit'](_0x2c5728[_0x2cdf('0x4c')]['limit']);_0x2853e2[_0x2cdf('0x35')]=qs['offset'](_0x2c5728[_0x2cdf('0x4c')][_0x2cdf('0x35')]);}_0x2853e2[_0x2cdf('0x56')]=qs[_0x2cdf('0x57')](_0x2c5728[_0x2cdf('0x4c')][_0x2cdf('0x57')]);_0x2853e2[_0x2cdf('0x58')]=qs[_0x2cdf('0x4e')](_['pick'](_0x2c5728['query'],_0x4ae385[_0x2cdf('0x4e')]));_0x2853e2['where'][_0x2cdf('0x71')]=_0x51d820['id'];if(_0x2c5728[_0x2cdf('0x4c')][_0x2cdf('0x5a')]){_0x2853e2[_0x2cdf('0x58')]=_[_0x2cdf('0x5c')](_0x2853e2[_0x2cdf('0x58')],{'$or':_[_0x2cdf('0x4b')](_0x2853e2[_0x2cdf('0x51')],function(_0x3b55f2){var _0x18bdd3={};_0x18bdd3[_0x3b55f2]={'$like':'%'+_0x2c5728['query']['filter']+'%'};return _0x18bdd3;})});}_0x2853e2=_[_0x2cdf('0x5c')]({},_0x2853e2,_0x2c5728[_0x2cdf('0x5d')]);return db[_0x2cdf('0x6f')][_0x2cdf('0x38')]({'where':_0x2853e2['where']})[_0x2cdf('0x26')](function(_0x551439){_0x4fa287[_0x2cdf('0x38')]=_0x551439;if(_0x2c5728[_0x2cdf('0x4c')]['includeAll']){_0x2853e2[_0x2cdf('0x5f')]=[{'all':!![]}];}return db[_0x2cdf('0x6f')][_0x2cdf('0x60')](_0x2853e2);})[_0x2cdf('0x26')](function(_0x274742){_0x4fa287[_0x2cdf('0x61')]=_0x274742;return _0x4fa287;});}})[_0x2cdf('0x26')](respondWithFilteredResult(_0x1ca6e1,_0x2853e2))[_0x2cdf('0x31')](handleError(_0x1ca6e1,null));};exports[_0x2cdf('0x72')]=function(_0x544208,_0xec647,_0x546435){return db[_0x2cdf('0x48')][_0x2cdf('0x64')]({'where':{'id':_0x544208[_0x2cdf('0x63')]['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0xec647,null))[_0x2cdf('0x26')](function(_0x24e993){if(_0x24e993){return _0x24e993[_0x2cdf('0x72')](_0x544208[_0x2cdf('0x4c')][_0x2cdf('0x73')]);}})['then'](respondWithStatusCode(_0xec647,null))['catch'](handleError(_0xec647,null));};exports['addAnswer']=function(_0x2b569f,_0x4fee95,_0x44a43d){if(_0x2b569f['body']['id']){delete _0x2b569f[_0x2cdf('0x66')]['id'];}return db['SmsAccount'][_0x2cdf('0x64')]({'where':{'id':_0x2b569f[_0x2cdf('0x63')]['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0x4fee95,null))['then'](function(_0x1d2897){if(_0x1d2897){_0x2b569f['body'][_0x2cdf('0x71')]=_0x1d2897['id'];return db['CannedAnswer'][_0x2cdf('0x65')](_0x2b569f[_0x2cdf('0x66')]);}})[_0x2cdf('0x26')](respondWithResult(_0x4fee95,null))[_0x2cdf('0x31')](handleError(_0x4fee95,null));};exports['getAnswers']=function(_0x4cad8f,_0x13b14c,_0x545009){var _0x10ae03={'raw':![],'where':{}};var _0x1cdca3={};var _0x1721e1={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2cdf('0x70')]({'where':{'id':_0x4cad8f['params']['id']}})['then'](handleEntityNotFound(_0x13b14c,null))[_0x2cdf('0x26')](function(_0x3738cb){if(_0x3738cb){_0x1cdca3[_0x2cdf('0x50')]=_['keys'](db['CannedAnswer'][_0x2cdf('0x49')]);_0x1cdca3['query']=_[_0x2cdf('0x4d')](_0x4cad8f[_0x2cdf('0x4c')]);_0x1cdca3[_0x2cdf('0x4e')]=_[_0x2cdf('0x4f')](_0x1cdca3[_0x2cdf('0x50')],_0x1cdca3[_0x2cdf('0x4c')]);_0x10ae03['attributes']=_[_0x2cdf('0x4f')](_0x1cdca3[_0x2cdf('0x50')],qs['fields'](_0x4cad8f[_0x2cdf('0x4c')][_0x2cdf('0x52')]));_0x10ae03[_0x2cdf('0x51')]=_0x10ae03['attributes'][_0x2cdf('0x53')]?_0x10ae03[_0x2cdf('0x51')]:_0x1cdca3[_0x2cdf('0x50')];if(!_0x4cad8f['query'][_0x2cdf('0x54')](_0x2cdf('0x55'))){_0x10ae03[_0x2cdf('0x37')]=qs[_0x2cdf('0x37')](_0x4cad8f['query'][_0x2cdf('0x37')]);_0x10ae03[_0x2cdf('0x35')]=qs[_0x2cdf('0x35')](_0x4cad8f[_0x2cdf('0x4c')][_0x2cdf('0x35')]);}_0x10ae03['order']=qs['sort'](_0x4cad8f[_0x2cdf('0x4c')]['sort']);_0x10ae03[_0x2cdf('0x58')]=qs[_0x2cdf('0x4e')](_['pick'](_0x4cad8f['query'],_0x1cdca3[_0x2cdf('0x4e')]));_0x10ae03['where'][_0x2cdf('0x71')]=_0x3738cb['id'];if(_0x4cad8f[_0x2cdf('0x4c')][_0x2cdf('0x5a')]){_0x10ae03[_0x2cdf('0x58')]=_[_0x2cdf('0x5c')](_0x10ae03['where'],{'$or':_[_0x2cdf('0x4b')](_0x10ae03[_0x2cdf('0x51')],function(_0x128f82){var _0x1a9054={};_0x1a9054[_0x128f82]={'$like':'%'+_0x4cad8f[_0x2cdf('0x4c')][_0x2cdf('0x5a')]+'%'};return _0x1a9054;})});}_0x10ae03=_['merge']({},_0x10ae03,_0x4cad8f[_0x2cdf('0x5d')]);return db['CannedAnswer']['count']({'where':_0x10ae03[_0x2cdf('0x58')]})[_0x2cdf('0x26')](function(_0x3880f4){_0x1721e1[_0x2cdf('0x38')]=_0x3880f4;if(_0x4cad8f[_0x2cdf('0x4c')][_0x2cdf('0x5e')]){_0x10ae03['include']=[{'all':!![]}];}return db[_0x2cdf('0x74')][_0x2cdf('0x60')](_0x10ae03);})[_0x2cdf('0x26')](function(_0x157599){_0x1721e1[_0x2cdf('0x61')]=_0x157599;return _0x1721e1;});}})[_0x2cdf('0x26')](respondWithFilteredResult(_0x13b14c,_0x10ae03))[_0x2cdf('0x31')](handleError(_0x13b14c,null));};exports[_0x2cdf('0x75')]=function(_0x291c06,_0x5375cf,_0x257479){return db[_0x2cdf('0x48')]['find']({'where':{'id':_0x291c06[_0x2cdf('0x63')]['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0x5375cf,null))[_0x2cdf('0x26')](function(_0x134262){if(_0x134262){return _0x134262[_0x2cdf('0x75')](_0x291c06[_0x2cdf('0x4c')][_0x2cdf('0x73')]);}})[_0x2cdf('0x26')](respondWithStatusCode(_0x5375cf,null))['catch'](handleError(_0x5375cf,null));};exports[_0x2cdf('0x76')]=function(_0xa904ac,_0x51ddd9,_0x291de5){var _0xa1429e={'channel':_0x2cdf('0x77')};var _0x143e68=[];var _0x129b2d=[];var _0x51ec83={};return db['SmsAccount']['find']({'where':{'id':_0xa904ac[_0x2cdf('0x63')]['id']},'include':[{'model':db[_0x2cdf('0x78')],'as':_0x2cdf('0x79')}]})[_0x2cdf('0x26')](handleEntityNotFound(_0x51ddd9,null))[_0x2cdf('0x26')](function(_0x88e318){_0xa1429e[_0x2cdf('0x7a')]=_0x88e318;_0xa1429e[_0x2cdf('0x7b')]=_[_0x2cdf('0x7c')](_0x88e318[_0x2cdf('0x79')],[_0x2cdf('0x7d')],['asc']);if(_0xa1429e[_0x2cdf('0x7a')][_0x2cdf('0x79')]){delete _0xa1429e[_0x2cdf('0x7a')][_0x2cdf('0x79')];}return db['CmContact'][_0x2cdf('0x7e')]();})[_0x2cdf('0x26')](function(_0xcb41e1){if(!_0xcb41e1){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x143e68=_[_0x2cdf('0x7f')](_[_0x2cdf('0x4d')](_0xcb41e1),[_0x2cdf('0x80'),_0x2cdf('0x81')]);_0x129b2d=_[_0x2cdf('0x7f')](_[_0x2cdf('0x4d')](_0xcb41e1),[_0x2cdf('0x80'),_0x2cdf('0x81'),_0x2cdf('0x82'),_0x2cdf('0x83')]);_0xa1429e[_0x2cdf('0x66')]={'mapKey':_0x2cdf('0x84')};if(_0xa1429e[_0x2cdf('0x7a')][_0x2cdf('0x4a')]){switch(_0xa1429e[_0x2cdf('0x7a')][_0x2cdf('0x4a')]){case _0x2cdf('0x85'):_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x87')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x66')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x88')];_0xa1429e[_0x2cdf('0x66')]['messageId']=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x89')];break;case'skebby':_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')]='+'+_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x8a')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x66')]=_0xa904ac['body'][_0x2cdf('0x8b')];break;case _0x2cdf('0x8c'):_0xa1429e['body']['from']=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x86')];_0xa1429e[_0x2cdf('0x66')]['body']=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x2e')];break;case _0x2cdf('0x8d'):_0xa1429e['body'][_0x2cdf('0x86')]=_0xa904ac['body'][_0x2cdf('0x86')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x66')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x66')];_0xa1429e['body'][_0x2cdf('0x8e')]=_0xa904ac[_0x2cdf('0x66')]['message_id'];break;case _0x2cdf('0x8f'):_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')]=_0xa904ac['body'][_0x2cdf('0x87')];_0xa1429e[_0x2cdf('0x66')]['body']=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x90')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x8e')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x91')];break;case _0x2cdf('0x92'):_0xa1429e[_0x2cdf('0x66')]['from']='+'+_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x93')][0x0][_0x2cdf('0x86')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x66')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x93')][0x0][_0x2cdf('0x8b')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x8e')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x93')][0x0][_0x2cdf('0x8e')];break;case _0x2cdf('0x94'):_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x95')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x66')]=_0xa904ac[_0x2cdf('0x66')]['segmentedMessage'][_0x2cdf('0x2e')];break;case _0x2cdf('0x96'):_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x97')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x66')]=_0xa904ac[_0x2cdf('0x66')][_0x2cdf('0x8b')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x8e')]=_0xa904ac[_0x2cdf('0x66')]['replyMessageId'];break;case _0x2cdf('0x98'):_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x8e')]=_0xa904ac[_0x2cdf('0x66')][0x0][_0x2cdf('0x2e')]['id'];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')]=_0xa904ac[_0x2cdf('0x66')][0x0][_0x2cdf('0x2e')]['from'];_0xa1429e['body'][_0x2cdf('0x66')]=_0xa904ac[_0x2cdf('0x66')][0x0]['message'][_0x2cdf('0x8b')];break;case'intelepeer':_0xa1429e[_0x2cdf('0x66')]['from']=_0xa904ac['body'][_0x2cdf('0x86')];_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x66')]=_0xa904ac['body'][_0x2cdf('0x2e')];_0xa1429e[_0x2cdf('0x66')]['messageId']=_0xa904ac['body'][_0x2cdf('0x99')];break;}}if(_0xa1429e[_0x2cdf('0x66')]['id']){delete _0xa1429e['body']['id'];}if(_[_0x2cdf('0x9a')](_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')])){throw new db[(_0x2cdf('0x9b'))][(_0x2cdf('0x9c'))]('from\x20is\x20mandatory');}if(_[_0x2cdf('0x9a')](_0xa1429e[_0x2cdf('0x66')]['body'])||_0xa1429e['body'][_0x2cdf('0x66')]===''){throw new db[(_0x2cdf('0x9b'))][(_0x2cdf('0x9c'))](_0x2cdf('0x9d'));}if(_[_0x2cdf('0x9a')](_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x9e')])){throw new db[(_0x2cdf('0x9b'))]['ValidationError'](_0x2cdf('0x9f')+_0x129b2d);}if(!_[_0x2cdf('0xa0')](_0x129b2d,_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x9e')])){throw new db[(_0x2cdf('0x9b'))][(_0x2cdf('0x9c'))](_0x2cdf('0xa1')+_0x129b2d);}_0x51ec83[_0xa1429e[_0x2cdf('0x66')]['mapKey']]=_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')];return db[_0x2cdf('0xa2')][_0x2cdf('0x64')]({'where':{'id':_0xa1429e[_0x2cdf('0x7a')][_0x2cdf('0x83')]},'include':[{'model':db['CmContact'],'as':_0x2cdf('0xa3'),'where':_0x51ec83,'limit':0x1,'order':[['updatedAt',_0x2cdf('0xa4')]]}]});})[_0x2cdf('0x26')](handleEntityNotFound(_0x51ddd9,null))[_0x2cdf('0x26')](function(_0x336161){if(_0x336161){_0xa1429e[_0x2cdf('0xa5')]=_[_0x2cdf('0xa6')](_0x336161,[_0x2cdf('0xa3')]);if(_0x336161[_0x2cdf('0xa3')][_0x2cdf('0x53')]){return _0x336161[_0x2cdf('0xa3')][0x0];}var _0x420a4d=_['defaults'](_0xa1429e[_0x2cdf('0x66')],{'firstName':_0xa1429e['body'][_0x2cdf('0x86')],'ListId':_0x336161['id']});_0x420a4d[_0xa1429e['body']['mapKey']]=_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')];return db['CmContact'][_0x2cdf('0x65')](_0x420a4d,{'fields':_0x143e68,'raw':!![]});}})[_0x2cdf('0x26')](handleEntityNotFound(_0x51ddd9,null))[_0x2cdf('0x26')](function(_0x134ea8){if(_0x134ea8){_0xa1429e[_0x2cdf('0xa7')]=_0x134ea8;var _0x47a38f={'ContactId':_0x134ea8['id'],'phone':_0xa1429e[_0x2cdf('0x66')][_0x2cdf('0x86')],'SmsAccountId':_0xa904ac[_0x2cdf('0x63')]['id']};var _0x2ccd33={'ContactId':_0x134ea8['id'],'SmsAccountId':_0xa904ac[_0x2cdf('0x63')]['id'],'closed':![]};return db[_0x2cdf('0xa8')][_0x2cdf('0x64')]({'where':_0x2ccd33})['then'](function(_0x1792f4){if(_0x1792f4){return[_0x1792f4,![]];}return db[_0x2cdf('0xa8')][_0x2cdf('0x65')](_0x47a38f)[_0x2cdf('0x26')](function(_0x52e21f){return[_0x52e21f,!![]];});});}})['spread'](function(_0x5e8ed0,_0x1abbcc){_0xa1429e[_0x2cdf('0xa9')]=_0x5e8ed0[_0x2cdf('0x3f')]({'plain':!![]});_0xa1429e[_0x2cdf('0xa9')][_0x2cdf('0xaa')]=![];if(_0x1abbcc){if(_0xa1429e['account']['autoclose']){_0xa1429e[_0x2cdf('0x7b')]['push']({'id':0x0,'priority':_0xa1429e['applications'][_0x2cdf('0x53')]+0x1,'app':_0x2cdf('0xab'),'appdata':'unmanaged','interval':_0x2cdf('0xac')});}_0xa1429e[_0x2cdf('0xa9')][_0x2cdf('0xaa')]=!![];}return db[_0x2cdf('0xad')][_0x2cdf('0x65')]({'phone':_0xa1429e[_0x2cdf('0x66')]['from'],'messageId':_0xa1429e['body'][_0x2cdf('0x8e')],'body':_0xa1429e[_0x2cdf('0x66')]['body'],'SmsAccountId':_0xa904ac[_0x2cdf('0x63')]['id'],'SmsInteractionId':_0x5e8ed0['id'],'direction':'in','ContactId':_0x5e8ed0[_0x2cdf('0xae')],'AttachmentId':_0xa1429e[_0x2cdf('0x66')]['AttachmentId']});})['then'](function(_0x2e1c66){_0xa1429e[_0x2cdf('0x2e')]=_0x2e1c66;if(_0xa1429e[_0x2cdf('0xa9')][_0x2cdf('0xaf')]){return db[_0x2cdf('0xb0')]['find']({'attributes':['id','name'],'where':{'id':_0xa1429e[_0x2cdf('0xa9')][_0x2cdf('0xaf')]}})[_0x2cdf('0x26')](function(_0x170f21){if(_0x170f21){_0xa1429e[_0x2cdf('0x7b')][_0x2cdf('0xb1')]({'id':0x0,'priority':0x0,'app':_0x2cdf('0xb2'),'appdata':_0x170f21[_0x2cdf('0x43')]+','+(_0xa1429e[_0x2cdf('0x7a')]['waitForTheAssignedAgent']||0xa),'interval':_0x2cdf('0xac')});}return respondWithRpcPromise(_0x2cdf('0xb3'),_0x2cdf('0xb4'),_0xa1429e);});}return respondWithRpcPromise(_0x2cdf('0xb3'),'startRouting',_0xa1429e);})[_0x2cdf('0x26')](function(_0x115117){if(_0x115117){var _0x53044d=0xc8;var _0x17fd36=_0x2cdf('0xb5');logger[_0x2cdf('0x2f')](_0x2cdf('0x2a'),_0x17fd36,_0x53044d,'entity\x20found');logger[_0x2cdf('0x29')](_0x2cdf('0xb6'),_0x17fd36,_0x53044d,_0x2cdf('0xb7'),JSON[_0x2cdf('0x2b')](_0x115117));if(_0xa1429e['account'][_0x2cdf('0x4a')]===_0x2cdf('0x85')){return _0x51ddd9['status'](_0x53044d)[_0x2cdf('0x39')](_0x2cdf('0xb8'),'text/xml')[_0x2cdf('0x44')](_0x2cdf('0xb9'));}else{return _0x51ddd9['status'](_0x53044d)['json'](_0x115117);}}})[_0x2cdf('0x31')](handleError(_0x51ddd9,null));};exports[_0x2cdf('0xba')]=function(_0x25a353,_0x22063a){var _0x23acae=_0x25a353[_0x2cdf('0x63')]['id'];var _0x4333bb=_0x25a353[_0x2cdf('0x66')];var _0x216eee=0xc8;var _0x380e93=null;return db[_0x2cdf('0xbb')][_0x2cdf('0xbc')]({'isolationLevel':db['sequelize'][_0x2cdf('0xbd')][_0x2cdf('0xbe')]['READ_COMMITTED']},function(_0x1058b8){return db[_0x2cdf('0x48')][_0x2cdf('0x70')]({'where':{'id':_0x23acae},'transaction':_0x1058b8})[_0x2cdf('0x26')](function(_0xa1fc12){if(_0xa1fc12){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x23acae},'transaction':_0x1058b8})['then'](function(){var _0xd66a29=_[_0x2cdf('0x4b')](_0x4333bb,function(_0x26a01f){_0x26a01f[_0x2cdf('0x71')]=_0x23acae;return _0x26a01f;});return db['SmsApplication']['bulkCreate'](_0xd66a29,{'transaction':_0x1058b8});});}else{_0x216eee=0x194;_0x380e93=[];}});})[_0x2cdf('0x26')](function(){if(_0x216eee!==0x194){return db[_0x2cdf('0x78')][_0x2cdf('0xbf')]({'where':{'SmsAccountId':_0x23acae},'order':_0x2cdf('0x7d')})[_0x2cdf('0x26')](function(_0x5cb4f4){_0x380e93=_0x5cb4f4;});}})['catch'](function(_0x116911){_0x216eee=0x1f4;logger[_0x2cdf('0x2d')](_0x116911[_0x2cdf('0xc0')]);if(_0x116911[_0x2cdf('0x43')]){delete _0x116911['name'];}_0x380e93=_0x116911;})[_0x2cdf('0xc1')](function(){if(_0x380e93===null){_0x22063a[_0x2cdf('0x32')](_0x216eee);}else{if(_0x216eee===0x1f4){_0x22063a[_0x2cdf('0x42')](_0x216eee)[_0x2cdf('0x44')](_0x380e93);}else{_0x22063a[_0x2cdf('0x42')](_0x216eee)[_0x2cdf('0x34')](_0x380e93);}}});};exports[_0x2cdf('0xc2')]=function(_0x28c802,_0x252b1d,_0x3d66d4){var _0x57f4d3={};var _0x41b4bd={};var _0x40b504;var _0x4d840e;return db['SmsAccount'][_0x2cdf('0x70')]({'where':{'id':_0x28c802[_0x2cdf('0x63')]['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0x252b1d,null))[_0x2cdf('0x26')](function(_0x212157){if(_0x212157){_0x40b504=_0x212157;_0x41b4bd[_0x2cdf('0x50')]=_['keys'](db['SmsApplication'][_0x2cdf('0x49')]);_0x41b4bd[_0x2cdf('0x4c')]=_['keys'](_0x28c802[_0x2cdf('0x4c')]);_0x41b4bd[_0x2cdf('0x4e')]=_[_0x2cdf('0x4f')](_0x41b4bd['model'],_0x41b4bd[_0x2cdf('0x4c')]);_0x57f4d3[_0x2cdf('0x51')]=_[_0x2cdf('0x4f')](_0x41b4bd[_0x2cdf('0x50')],qs[_0x2cdf('0x52')](_0x28c802['query'][_0x2cdf('0x52')]));_0x57f4d3[_0x2cdf('0x51')]=_0x57f4d3[_0x2cdf('0x51')][_0x2cdf('0x53')]?_0x57f4d3[_0x2cdf('0x51')]:_0x41b4bd['model'];_0x57f4d3[_0x2cdf('0x56')]=qs['sort'](_0x28c802[_0x2cdf('0x4c')][_0x2cdf('0x57')]);_0x57f4d3[_0x2cdf('0x58')]=qs[_0x2cdf('0x4e')](_['pick'](_0x28c802[_0x2cdf('0x4c')],_0x41b4bd[_0x2cdf('0x4e')]));if(_0x28c802['query']['filter']){_0x57f4d3['where']=_[_0x2cdf('0x5c')](_0x57f4d3[_0x2cdf('0x58')],{'$or':_[_0x2cdf('0x4b')](_0x57f4d3['attributes'],function(_0x3d58bb){var _0x2e09db={};_0x2e09db[_0x3d58bb]={'$like':'%'+_0x28c802[_0x2cdf('0x4c')]['filter']+'%'};return _0x2e09db;})});}_0x57f4d3=_[_0x2cdf('0x5c')]({},_0x57f4d3,_0x28c802[_0x2cdf('0x5d')]);return _0x40b504[_0x2cdf('0xc2')](_0x57f4d3);}})[_0x2cdf('0x26')](function(_0x4bf8d2){if(_0x4bf8d2){_0x4d840e=_0x4bf8d2['length'];if(!_0x28c802[_0x2cdf('0x4c')][_0x2cdf('0x54')](_0x2cdf('0x55'))){_0x57f4d3[_0x2cdf('0x37')]=qs[_0x2cdf('0x37')](_0x28c802[_0x2cdf('0x4c')]['limit']);_0x57f4d3[_0x2cdf('0x35')]=qs[_0x2cdf('0x35')](_0x28c802[_0x2cdf('0x4c')][_0x2cdf('0x35')]);}return _0x40b504[_0x2cdf('0xc2')](_0x57f4d3);}})[_0x2cdf('0x26')](function(_0xaa0cc3){if(_0xaa0cc3){return _0xaa0cc3?{'count':_0x4d840e,'rows':_0xaa0cc3}:null;}})['then'](respondWithResult(_0x252b1d,null))[_0x2cdf('0x31')](handleError(_0x252b1d,null));};exports[_0x2cdf('0xc3')]=function(_0x1b92b5,_0x1041b2,_0x18cda4){var _0xe78955={'raw':![],'where':{}};var _0x105bff={};var _0x3519ee={'count':0x0,'rows':[]};return db[_0x2cdf('0x48')][_0x2cdf('0x70')]({'where':{'id':_0x1b92b5[_0x2cdf('0x63')]['id']}})['then'](handleEntityNotFound(_0x1041b2,null))['then'](function(_0x417d80){if(_0x417d80){_0x105bff[_0x2cdf('0x50')]=_['keys'](db[_0x2cdf('0xa8')]['rawAttributes']);_0x105bff['query']=_[_0x2cdf('0x4d')](_0x1b92b5[_0x2cdf('0x4c')]);_0x105bff[_0x2cdf('0x4e')]=_[_0x2cdf('0x4f')](_0x105bff[_0x2cdf('0x50')],_0x105bff[_0x2cdf('0x4c')]);_0xe78955[_0x2cdf('0x51')]=_[_0x2cdf('0x4f')](_0x105bff[_0x2cdf('0x50')],qs['fields'](_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0x52')]));_0xe78955[_0x2cdf('0x51')]=_0xe78955['attributes']['length']?_0xe78955['attributes']:_0x105bff[_0x2cdf('0x50')];if(!_0x1b92b5[_0x2cdf('0x4c')]['hasOwnProperty'](_0x2cdf('0x55'))){_0xe78955['limit']=qs[_0x2cdf('0x37')](_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0x37')]);_0xe78955['offset']=qs[_0x2cdf('0x35')](_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0x35')]);}_0xe78955[_0x2cdf('0x56')]=qs[_0x2cdf('0x57')](_0x1b92b5['query'][_0x2cdf('0x57')]);_0xe78955[_0x2cdf('0x58')]=qs[_0x2cdf('0x4e')](_[_0x2cdf('0x59')](_0x1b92b5['query'],_0x105bff[_0x2cdf('0x4e')]));_0xe78955[_0x2cdf('0x58')]['SmsAccountId']=_0x417d80['id'];if(_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0x5a')]){_0xe78955[_0x2cdf('0x58')]=_[_0x2cdf('0x5c')](_0xe78955['where'],{'$or':_[_0x2cdf('0x4b')](_0xe78955['attributes'],function(_0x19f11b){var _0x3167a7={};_0x3167a7[_0x19f11b]={'$like':'%'+_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0x5a')]+'%'};return _0x3167a7;})});}_0xe78955=_[_0x2cdf('0x5c')]({},_0xe78955,_0x1b92b5['options']);return db[_0x2cdf('0xa8')][_0x2cdf('0x38')]({'where':_0xe78955[_0x2cdf('0x58')]})['then'](function(_0x34b234){_0x3519ee[_0x2cdf('0x38')]=_0x34b234;if(_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0x5e')]){_0xe78955[_0x2cdf('0x5f')]=[{'model':db[_0x2cdf('0xc4')],'as':_0x2cdf('0xc5'),'required':![]},{'model':db[_0x2cdf('0xb0')],'as':_0x2cdf('0xc6'),'attributes':['name',_0x2cdf('0xc7'),_0x2cdf('0xc8')],'required':![]},{'model':db[_0x2cdf('0xc9')],'as':_0x2cdf('0xca'),'attributes':['id','name',_0x2cdf('0xcb')],'where':_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0xcc')]?{'id':_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0xcc')]}:undefined,'required':_0x1b92b5[_0x2cdf('0x4c')][_0x2cdf('0xcc')]?!![]:![]}];}return db[_0x2cdf('0xa8')][_0x2cdf('0x60')](_0xe78955);})[_0x2cdf('0x26')](function(_0x2d0bcf){_0x3519ee['rows']=_0x2d0bcf;return _0x3519ee;});}})[_0x2cdf('0x26')](respondWithFilteredResult(_0x1041b2,_0xe78955))[_0x2cdf('0x31')](handleError(_0x1041b2,null));};exports[_0x2cdf('0x44')]=function(_0x355ca7,_0x2eea4b,_0x1cf4bd){var _0x49ac47,_0x12e9c0,_0x4a33b7;if(_[_0x2cdf('0x9a')](_0x355ca7[_0x2cdf('0x66')][_0x2cdf('0x66')])||_0x355ca7[_0x2cdf('0x66')]['body']===''){throw new db[(_0x2cdf('0x9b'))][(_0x2cdf('0x9c'))](_0x2cdf('0x9d'));}if(_[_0x2cdf('0x9a')](_0x355ca7['body']['to'])){throw new db[(_0x2cdf('0x9b'))][(_0x2cdf('0x9c'))](_0x2cdf('0xcd'));}_0x49ac47=_0x355ca7[_0x2cdf('0x66')]['to'];return db[_0x2cdf('0x48')]['find']({'where':{'id':_0x355ca7[_0x2cdf('0x63')]['id']},'include':[{'model':db[_0x2cdf('0xa2')],'as':_0x2cdf('0xce'),'include':[{'model':db[_0x2cdf('0xc4')],'as':_0x2cdf('0xa3'),'where':{'mobile':_0x49ac47},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x2cdf('0x26')](handleEntityNotFound(_0x2eea4b,null))[_0x2cdf('0x26')](function(_0x12782f){if(_0x12782f&&_0x12782f['List']){_0x12e9c0=_0x12782f[_0x2cdf('0x3f')]({'plain':!![]});if(_0x12e9c0['List']&&_0x12e9c0[_0x2cdf('0xce')][_0x2cdf('0xa3')][_0x2cdf('0x53')]){return _0x12e9c0['List'][_0x2cdf('0xa3')][0x0];}return db[_0x2cdf('0xc4')][_0x2cdf('0x65')](_['defaults'](_0x355ca7['body'],{'firstName':_0x49ac47,'mobile':_0x49ac47,'phone':_0x49ac47,'ListId':_0x12e9c0[_0x2cdf('0x83')]}));}})[_0x2cdf('0x26')](handleEntityNotFound(_0x2eea4b,null))[_0x2cdf('0x26')](function(_0x38900b){if(_0x38900b){_0x4a33b7=_0x38900b;return db[_0x2cdf('0xa8')]['find']({'where':{'ContactId':_0x4a33b7['id'],'closed':![],'SmsAccountId':_0x12e9c0['id']}})['then'](function(_0xd1f0b3){if(_0xd1f0b3){return[_0xd1f0b3,![]];}return db['SmsInteraction']['create']({'UserId':_0x355ca7[_0x2cdf('0x67')]['id'],'ContactId':_0x4a33b7['id'],'SmsAccountId':_0x12e9c0['id'],'phone':_0x49ac47,'firstMsgDirection':'out','Messages':[_[_0x2cdf('0x5c')](_0x355ca7[_0x2cdf('0x66')],{'read':![],'body':_0x355ca7[_0x2cdf('0x66')][_0x2cdf('0x66')],'phone':_0x49ac47,'SmsAccountId':_0x12e9c0['id'],'UserId':_0x355ca7[_0x2cdf('0x67')]['id'],'ContactId':_0x4a33b7['id']})]},{'include':[{'model':db[_0x2cdf('0xad')],'as':'Messages'}]})[_0x2cdf('0x26')](function(_0x513be4){return[_0x513be4,!![]];});});}})[_0x2cdf('0xcf')](function(_0x40f22f,_0x12634b){if(_0x12634b){return _0x40f22f;}return db['SmsMessage'][_0x2cdf('0x65')](_['merge'](_0x355ca7['body'],{'read':![],'body':_0x355ca7[_0x2cdf('0x66')][_0x2cdf('0x66')],'phone':_0x49ac47,'SmsAccountId':_0x12e9c0['id'],'SmsInteractionId':_0x40f22f['id'],'UserId':_0x355ca7[_0x2cdf('0x67')]['id'],'ContactId':_0x4a33b7['id']}))[_0x2cdf('0x26')](function(_0x1c002b){_0x40f22f[_0x2cdf('0xd0')]['Messages']=[];_0x40f22f[_0x2cdf('0xd0')][_0x2cdf('0xd1')][_0x2cdf('0xd2')](_0x1c002b[_0x2cdf('0xd0')]);return _0x40f22f;});})['then'](respondWithResult(_0x2eea4b,null))[_0x2cdf('0x31')](handleError(_0x2eea4b,null));};exports[_0x2cdf('0x42')]=function(_0x4fa7d6,_0x27bc7e,_0x5ac7f2){if(_0x4fa7d6[_0x2cdf('0x66')]['id']){delete _0x4fa7d6[_0x2cdf('0x66')]['id'];}var _0x30b576,_0x59389c,_0x15576e;return db[_0x2cdf('0x48')][_0x2cdf('0x64')]({'where':{'id':_0x4fa7d6['params']['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0x27bc7e,null))['then'](function(_0x3610b3){if(_0x3610b3){_0x15576e=_0x3610b3;logger[_0x2cdf('0x29')](_0x2cdf('0x2a'),'status',_0x2cdf('0xd3'),_0x3610b3[_0x2cdf('0x4a')],util[_0x2cdf('0xd4')](_0x4fa7d6[_0x2cdf('0x66')],{'showHidden':![],'depth':null}));switch(_0x3610b3['type']){case _0x2cdf('0xd5'):if(_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0xd6')]&&_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0x42')]){_0x59389c=_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0x42')];return db['SmsMessage'][_0x2cdf('0x64')]({'where':{'messageId':_0x4fa7d6['body'][_0x2cdf('0xd6')]}});}break;case _0x2cdf('0x8c'):if(_0x4fa7d6[_0x2cdf('0x66')]['requestid']&&_0x4fa7d6[_0x2cdf('0x66')]['statusInt']){_0x59389c=_0x4fa7d6['body']['statusInt'];return db['SmsMessage'][_0x2cdf('0x64')]({'where':{'messageId':_0x4fa7d6['body']['requestid']}});}break;case _0x2cdf('0x8d'):if(_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0xd7')]&&_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0xd8')]){_0x59389c=_0x4fa7d6['body'][_0x2cdf('0xd8')];return db[_0x2cdf('0xad')][_0x2cdf('0x64')]({'where':{'messageId':_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0xd7')]}});}break;case _0x2cdf('0x92'):var _0x14c548=_0x4fa7d6[_0x2cdf('0x66')]['results'][0x0];if(_0x14c548[_0x2cdf('0x8e')]&&_0x14c548[_0x2cdf('0x42')]['groupName']===_0x2cdf('0xd9')){_0x59389c=_0x14c548['status']['groupName'];return db[_0x2cdf('0xad')][_0x2cdf('0x64')]({'where':{'messageId':_0x14c548[_0x2cdf('0x8e')]}});}break;case _0x2cdf('0x96'):if(_0x4fa7d6[_0x2cdf('0x66')]['messageId']&&_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0x42')]){_0x59389c=_0x4fa7d6[_0x2cdf('0x66')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0x8e')]}});}break;case'bandwidth':if(_0x4fa7d6['body'][0x0]['message']['id']){_0x59389c=_0x4fa7d6[_0x2cdf('0x66')][0x0][_0x2cdf('0x4a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4fa7d6[_0x2cdf('0x66')][0x0][_0x2cdf('0x2e')]['id']}});}break;case _0x2cdf('0xda'):if(_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0xdb')]&&_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0x42')]){_0x59389c=_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0x42')];return db['SmsMessage']['find']({'where':{'messageId':_0x4fa7d6[_0x2cdf('0x66')][_0x2cdf('0xdb')]}});}break;}}})[_0x2cdf('0x26')](handleEntityNotFound(_0x27bc7e,null))[_0x2cdf('0x26')](function(_0x468b37){if(_0x468b37){_0x30b576=_0x468b37;switch(_0x15576e[_0x2cdf('0x4a')]){case _0x2cdf('0xd5'):if(_0x59389c===_0x2cdf('0xd9')){return _0x30b576[_0x2cdf('0x3d')]({'read':!![]});}else{logger['error'](_0x2cdf('0x2a'),_0x2cdf('0x42'),_0x2cdf('0xd5'),util[_0x2cdf('0xd4')](_0x4fa7d6[_0x2cdf('0x66')],{'showHidden':![],'depth':null}));}break;case _0x2cdf('0x8c'):if(_0x59389c==='1'){return _0x30b576[_0x2cdf('0x3d')]({'read':!![]});}else{logger[_0x2cdf('0x2d')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2cdf('0x42'),_0x2cdf('0xd5'),util[_0x2cdf('0xd4')](_0x4fa7d6[_0x2cdf('0x66')],{'showHidden':![],'depth':null}));}break;case _0x2cdf('0x8d'):if(!_0x4fa7d6['body'][_0x2cdf('0xdc')]&&_0x59389c>=0xc8&&_0x59389c<=0xce){return _0x30b576['update']({'read':!![]});}else{logger[_0x2cdf('0x2d')](_0x2cdf('0x2a'),_0x2cdf('0x42'),'clicksend',util[_0x2cdf('0xd4')](_0x4fa7d6[_0x2cdf('0x66')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x19d9f0=_0x4fa7d6['body'][_0x2cdf('0x93')][0x0];if(_0x19d9f0[_0x2cdf('0x42')][_0x2cdf('0xdd')]==='DELIVERED'){return _0x30b576[_0x2cdf('0x3d')]({'read':!![]});}else{logger[_0x2cdf('0x2d')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x2cdf('0xd4')](_0x4fa7d6['body'],{'showHidden':![],'depth':null}));}break;case _0x2cdf('0x96'):if(_0x59389c=='DELIVERED_TO_GATEWAY'||_0x59389c=='RECEIVED_BY_RECIPIENT'){return _0x30b576[_0x2cdf('0x3d')]({'read':!![]});}else{logger[_0x2cdf('0x2d')](_0x2cdf('0x2a'),_0x2cdf('0x42'),'clickatell',util[_0x2cdf('0xd4')](_0x4fa7d6[_0x2cdf('0x66')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x59389c==_0x2cdf('0xde')){return _0x30b576['update']({'read':!![]});}else{logger[_0x2cdf('0x2d')](_0x2cdf('0x2a'),_0x2cdf('0x42'),_0x2cdf('0x98'),util[_0x2cdf('0xd4')](_0x4fa7d6['body'],{'showHidden':![],'depth':null}));}break;case _0x2cdf('0xda'):if(_0x59389c===_0x2cdf('0xdf')||_0x59389c===_0x2cdf('0xe0')){return _0x30b576[_0x2cdf('0x3d')]({'read':!![]});}else{logger[_0x2cdf('0x2d')](_0x2cdf('0x2a'),_0x2cdf('0x42'),_0x2cdf('0xda'),util[_0x2cdf('0xd4')](_0x4fa7d6[_0x2cdf('0x66')],{'showHidden':![],'depth':null}));}break;}return _0x30b576;}})[_0x2cdf('0x26')](respondWithResult(_0x27bc7e,null))[_0x2cdf('0x31')](handleError(_0x27bc7e,null));};exports[_0x2cdf('0xe1')]=function(_0x1f02a2,_0x8b2b09,_0x436bb4){var _0x1ca025,_0x38b1ce,_0x1166ce;return db[_0x2cdf('0x48')][_0x2cdf('0x64')]({'where':{'id':_0x1f02a2[_0x2cdf('0x63')]['id']}})[_0x2cdf('0x26')](handleEntityNotFound(_0x8b2b09,null))[_0x2cdf('0x26')](function(_0xe840f3){if(_0xe840f3){_0x1166ce=_0xe840f3;logger[_0x2cdf('0x29')](_0x2cdf('0x2a'),_0x2cdf('0x42'),_0x2cdf('0xd3'),_0xe840f3[_0x2cdf('0x4a')],util[_0x2cdf('0xd4')](_0x1f02a2['query'],{'showHidden':![],'depth':null}));switch(_0xe840f3[_0x2cdf('0x4a')]){case _0x2cdf('0x94'):if(_0x1f02a2[_0x2cdf('0x4c')]['message-id']&&_0x1f02a2[_0x2cdf('0x4c')][_0x2cdf('0xe2')]){_0x38b1ce=_0x1f02a2[_0x2cdf('0x4c')]['state'];return db[_0x2cdf('0xad')][_0x2cdf('0x64')]({'where':{'messageId':_0x1f02a2[_0x2cdf('0x4c')][_0x2cdf('0xe3')]}});}break;}}})['then'](handleEntityNotFound(_0x8b2b09,null))[_0x2cdf('0x26')](function(_0x2e9c8a){if(_0x2e9c8a){_0x1ca025=_0x2e9c8a;switch(_0x1166ce[_0x2cdf('0x4a')]){case _0x2cdf('0x94'):if(_0x38b1ce==='2'||_0x38b1ce==='6'){return _0x1ca025[_0x2cdf('0x3d')]({'read':!![]});}else{logger[_0x2cdf('0x2d')](_0x2cdf('0x2a'),_0x2cdf('0x42'),_0x2cdf('0x94'),util[_0x2cdf('0xd4')](_0x1f02a2[_0x2cdf('0x4c')],{'showHidden':![],'depth':null}));};break;}return _0x1ca025;}})[_0x2cdf('0x26')](respondWithResult(_0x8b2b09,null))[_0x2cdf('0x31')](handleError(_0x8b2b09,null));};exports[_0x2cdf('0xe4')]=function(_0x3e74ec,_0x1e7f01,_0x5e45ce){return db['SmsAccount'][_0x2cdf('0x64')]({'where':{'id':_0x3e74ec['params']['id']}})['then'](handleEntityNotFound(_0x1e7f01,null))[_0x2cdf('0x26')](function(_0x5cff37){if(_0x5cff37){return _0x5cff37[_0x2cdf('0xe4')](_0x3e74ec[_0x2cdf('0x66')][_0x2cdf('0x73')],_[_0x2cdf('0xa6')](_0x3e74ec[_0x2cdf('0x66')],[_0x2cdf('0x73'),'id'])||{})[_0x2cdf('0xcf')](function(_0x1e37bc){for(var _0x4d5fee=0x0;_0x4d5fee<_0x3e74ec[_0x2cdf('0x66')][_0x2cdf('0x73')][_0x2cdf('0x53')];_0x4d5fee+=0x1){socket['emit'](_0x2cdf('0xe5'),{'UserId':Number(_0x3e74ec['body']['ids'][_0x4d5fee]),'SmsAccountId':Number(_0x3e74ec[_0x2cdf('0x63')]['id'])});}return _0x1e37bc;});}})[_0x2cdf('0x26')](respondWithResult(_0x1e7f01,null))[_0x2cdf('0x31')](handleError(_0x1e7f01,null));};exports[_0x2cdf('0xe6')]=function(_0x25a4e2,_0x3f6cef,_0xa80f72){return db['SmsAccount'][_0x2cdf('0x64')]({'where':{'id':_0x25a4e2[_0x2cdf('0x63')]['id']}})['then'](handleEntityNotFound(_0x3f6cef,null))[_0x2cdf('0x26')](function(_0x455d03){if(_0x455d03){return _0x455d03['removeAgents'](_0x25a4e2[_0x2cdf('0x4c')][_0x2cdf('0x73')])[_0x2cdf('0x26')](function(){if(_[_0x2cdf('0xe7')](_0x25a4e2[_0x2cdf('0x4c')][_0x2cdf('0x73')])){for(var _0x6e589b=0x0;_0x6e589b<_0x25a4e2[_0x2cdf('0x4c')][_0x2cdf('0x73')]['length'];_0x6e589b+=0x1){socket[_0x2cdf('0xe8')]('userSmsAccount:remove',{'UserId':Number(_0x25a4e2[_0x2cdf('0x4c')][_0x2cdf('0x73')][_0x6e589b]),'SmsAccountId':Number(_0x25a4e2['params']['id'])});}}else{socket[_0x2cdf('0xe8')](_0x2cdf('0xe9'),{'UserId':Number(_0x25a4e2[_0x2cdf('0x4c')][_0x2cdf('0x73')]),'SmsAccountId':Number(_0x25a4e2['params']['id'])});}});}})[_0x2cdf('0x26')](respondWithStatusCode(_0x3f6cef,null))[_0x2cdf('0x31')](handleError(_0x3f6cef,null));};exports[_0x2cdf('0xea')]=function(_0x50b681,_0x485e25,_0xf326b){var _0x59a99e={};var _0x175112={};var _0xb38da4;var _0x5d82f6;return db[_0x2cdf('0x48')]['findOne']({'where':{'id':_0x50b681[_0x2cdf('0x63')]['id']}})['then'](handleEntityNotFound(_0x485e25,null))[_0x2cdf('0x26')](function(_0x241ee9){if(_0x241ee9){_0xb38da4=_0x241ee9;_0x175112[_0x2cdf('0x50')]=_[_0x2cdf('0x4d')](db['User'][_0x2cdf('0x49')]);_0x175112[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x50b681[_0x2cdf('0x4c')]);_0x175112[_0x2cdf('0x4e')]=_['intersection'](_0x175112[_0x2cdf('0x50')],_0x175112[_0x2cdf('0x4c')]);_0x59a99e['attributes']=_['intersection'](_0x175112[_0x2cdf('0x50')],qs[_0x2cdf('0x52')](_0x50b681[_0x2cdf('0x4c')][_0x2cdf('0x52')]));_0x59a99e[_0x2cdf('0x51')]=_0x59a99e[_0x2cdf('0x51')][_0x2cdf('0x53')]?_0x59a99e[_0x2cdf('0x51')]:_0x175112[_0x2cdf('0x50')];_0x59a99e[_0x2cdf('0x56')]=qs[_0x2cdf('0x57')](_0x50b681[_0x2cdf('0x4c')]['sort']);_0x59a99e[_0x2cdf('0x58')]=qs[_0x2cdf('0x4e')](_[_0x2cdf('0x59')](_0x50b681[_0x2cdf('0x4c')],_0x175112['filters']));if(_0x50b681[_0x2cdf('0x4c')]['filter']){_0x59a99e[_0x2cdf('0x58')]=_[_0x2cdf('0x5c')](_0x59a99e[_0x2cdf('0x58')],{'$or':_['map'](_0x59a99e[_0x2cdf('0x51')],function(_0x1847df){var _0xf761a9={};_0xf761a9[_0x1847df]={'$like':'%'+_0x50b681['query'][_0x2cdf('0x5a')]+'%'};return _0xf761a9;})});}_0x59a99e=_['merge']({},_0x59a99e,_0x50b681[_0x2cdf('0x5d')]);return _0xb38da4[_0x2cdf('0xea')](_0x59a99e);}})[_0x2cdf('0x26')](function(_0x5f075d){if(_0x5f075d){_0x5d82f6=_0x5f075d[_0x2cdf('0x53')];if(!_0x50b681[_0x2cdf('0x4c')][_0x2cdf('0x54')](_0x2cdf('0x55'))){_0x59a99e['limit']=qs[_0x2cdf('0x37')](_0x50b681[_0x2cdf('0x4c')][_0x2cdf('0x37')]);_0x59a99e[_0x2cdf('0x35')]=qs[_0x2cdf('0x35')](_0x50b681[_0x2cdf('0x4c')][_0x2cdf('0x35')]);}return _0xb38da4['getAgents'](_0x59a99e);}})[_0x2cdf('0x26')](function(_0x51faeb){if(_0x51faeb){return _0x51faeb?{'count':_0x5d82f6,'rows':_0x51faeb}:null;}})[_0x2cdf('0x26')](respondWithResult(_0x485e25,null))['catch'](handleError(_0x485e25,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 4b28696..da1ef60 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 _0x4c2a=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x4c2a,0x1b5));var _0xa4c2=function(_0x28c12e,_0x3d853c){_0x28c12e=_0x28c12e-0x0;var _0x2a48f1=_0x4c2a[_0x28c12e];return _0x2a48f1;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xa4c2('0x0'))['db'][_0xa4c2('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa4c2('0x2')](0x0);var events={'afterCreate':_0xa4c2('0x3'),'afterUpdate':_0xa4c2('0x4'),'afterDestroy':_0xa4c2('0x5')};function emitEvent(_0x382e9e){return function(_0x5ab89f,_0x2d3563,_0x301f06){SmsAccountEvents[_0xa4c2('0x6')](_0x382e9e+':'+_0x5ab89f['id'],_0x5ab89f);SmsAccountEvents['emit'](_0x382e9e,_0x5ab89f);_0x301f06(null);};}for(var e in events){if(events[_0xa4c2('0x7')](e)){var event=events[e];SmsAccount[_0xa4c2('0x8')](e,emitEvent(event));}}module[_0xa4c2('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x9786=['../../mysqldb','SmsAccount','save','update','remove','emit','events'];(function(_0x2975ac,_0x378cb7){var _0x250b94=function(_0x3154ca){while(--_0x3154ca){_0x2975ac['push'](_0x2975ac['shift']());}};_0x250b94(++_0x378cb7);}(_0x9786,0x19c));var _0x6978=function(_0x418d43,_0x3e08e5){_0x418d43=_0x418d43-0x0;var _0x249974=_0x9786[_0x418d43];return _0x249974;};'use strict';var EventEmitter=require(_0x6978('0x0'));var SmsAccount=require(_0x6978('0x1'))['db'][_0x6978('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6978('0x3'),'afterUpdate':_0x6978('0x4'),'afterDestroy':_0x6978('0x5')};function emitEvent(_0x4f8df5){return function(_0x1431d1,_0x2d756a,_0x4cac5e){SmsAccountEvents[_0x6978('0x6')](_0x4f8df5+':'+_0x1431d1['id'],_0x1431d1);SmsAccountEvents[_0x6978('0x6')](_0x4f8df5,_0x1431d1);_0x4cac5e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](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 9f44045..c06a709 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 _0x3ffc=['request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','api','moment','bluebird'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x3ffc,0x168));var _0xc3ff=function(_0x20a822,_0x5dc295){_0x20a822=_0x20a822-0x0;var _0x3775d1=_0x3ffc[_0x20a822];return _0x3775d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc3ff('0x0'));var moment=require(_0xc3ff('0x1'));var BPromise=require(_0xc3ff('0x2'));var rp=require(_0xc3ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ff('0x4'));var config=require(_0xc3ff('0x5'));var attributes=require(_0xc3ff('0x6'));module[_0xc3ff('0x7')]=function(_0x19528f,_0x52c0f8){return _0x19528f[_0xc3ff('0x8')](_0xc3ff('0x9'),attributes,{'tableName':_0xc3ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x441c=['./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','api','bluebird','rimraf'];(function(_0xa3fe52,_0x14e5ed){var _0x29f0ec=function(_0x590105){while(--_0x590105){_0xa3fe52['push'](_0xa3fe52['shift']());}};_0x29f0ec(++_0x14e5ed);}(_0x441c,0x188));var _0xc441=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x441c[_0x125ff8];return _0x2d9ef;};'use strict';var _=require('lodash');var util=require(_0xc441('0x0'));var logger=require('../../config/logger')(_0xc441('0x1'));var moment=require('moment');var BPromise=require(_0xc441('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc441('0x3'));var config=require('../../config/environment');var attributes=require(_0xc441('0x4'));module[_0xc441('0x5')]=function(_0x4c6769,_0x4c48ed){return _0x4c6769[_0xc441('0x6')](_0xc441('0x7'),attributes,{'tableName':_0xc441('0x8'),'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 a6390f7..3c4ecb9 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 _0x596a=['./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','where','map','include','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x178f32,_0x45b718){var _0x5187fb=function(_0x5ae10f){while(--_0x5ae10f){_0x178f32['push'](_0x178f32['shift']());}};_0x5187fb(++_0x45b718);}(_0x596a,0xaa));var _0xa596=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x596a[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xa596('0x0'));var util=require('util');var moment=require(_0xa596('0x1'));var BPromise=require(_0xa596('0x2'));var rs=require(_0xa596('0x3'));var fs=require('fs');var Redis=require(_0xa596('0x4'));var db=require(_0xa596('0x5'))['db'];var utils=require(_0xa596('0x6'));var logger=require('../../config/logger')(_0xa596('0x7'));var config=require(_0xa596('0x8'));var jayson=require(_0xa596('0x9'));var client=jayson[_0xa596('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa596('0xb')](config[_0xa596('0xc')],{'host':_0xa596('0xd'),'port':0x18eb});var socket=require(_0xa596('0xe'))(new Redis(config['redis']));require(_0xa596('0xf'))['register'](socket);function respondWithRpcPromise(_0x58767b,_0x2b9e6d,_0x5495e0){return new BPromise(function(_0x5250db,_0x8ead7e){return client[_0xa596('0x10')](_0x58767b,_0x5495e0)[_0xa596('0x11')](function(_0x1524e3){logger['info'](_0xa596('0x12'),_0x2b9e6d,_0xa596('0x13'));logger[_0xa596('0x14')](_0xa596('0x15'),_0x2b9e6d,'request\x20sent',JSON[_0xa596('0x16')](_0x1524e3));if(_0x1524e3[_0xa596('0x17')]){if(_0x1524e3[_0xa596('0x17')]['code']===0x1f4){logger['error'](_0xa596('0x12'),_0x2b9e6d,_0x1524e3['error'][_0xa596('0x18')]);return _0x8ead7e(_0x1524e3[_0xa596('0x17')]['message']);}logger[_0xa596('0x17')](_0xa596('0x12'),_0x2b9e6d,_0x1524e3['error'][_0xa596('0x18')]);return _0x5250db(_0x1524e3[_0xa596('0x17')][_0xa596('0x18')]);}else{logger[_0xa596('0x19')](_0xa596('0x12'),_0x2b9e6d,_0xa596('0x13'));_0x5250db(_0x1524e3[_0xa596('0x1a')][_0xa596('0x18')]);}})[_0xa596('0x1b')](function(_0xe75975){logger[_0xa596('0x17')](_0xa596('0x12'),_0x2b9e6d,_0xe75975);_0x8ead7e(_0xe75975);});});}exports[_0xa596('0x1c')]=function(_0x2f25cc){var _0x53404d=this;return new Promise(function(_0x504876,_0x4088a4){return db[_0xa596('0x1d')][_0xa596('0x1e')]({'raw':_0x2f25cc[_0xa596('0x1f')]?_0x2f25cc[_0xa596('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2f25cc['options']?_0x2f25cc['options'][_0xa596('0x20')]||null:null,'attributes':_0x2f25cc[_0xa596('0x1f')]?_0x2f25cc[_0xa596('0x1f')]['attributes']||null:null,'include':_0x2f25cc[_0xa596('0x1f')]?_0x2f25cc[_0xa596('0x1f')]['include']?_[_0xa596('0x21')](_0x2f25cc['options'][_0xa596('0x22')],function(_0x367482){return{'model':db[_0x367482[_0xa596('0x23')]],'as':_0x367482['as'],'attributes':_0x367482[_0xa596('0x24')],'include':_0x367482[_0xa596('0x22')]?_['map'](_0x367482[_0xa596('0x22')],function(_0x16c8dc){return{'model':db[_0x16c8dc[_0xa596('0x23')]],'as':_0x16c8dc['as'],'attributes':_0x16c8dc[_0xa596('0x24')],'include':_0x16c8dc[_0xa596('0x22')]?_[_0xa596('0x21')](_0x16c8dc['include'],function(_0x21e2c1){return{'model':db[_0x21e2c1[_0xa596('0x23')]],'as':_0x21e2c1['as'],'attributes':_0x21e2c1[_0xa596('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc6d906){logger[_0xa596('0x19')]('ShowSmsAccount',_0x2f25cc);logger[_0xa596('0x14')]('ShowSmsAccount',_0x2f25cc,JSON[_0xa596('0x16')](_0xc6d906));_0x504876(_0xc6d906);})[_0xa596('0x1b')](function(_0x54db66){logger[_0xa596('0x17')](_0xa596('0x1c'),_0x54db66[_0xa596('0x18')],_0x2f25cc);_0x4088a4(_0x53404d[_0xa596('0x17')](0x1f4,_0x54db66[_0xa596('0x18')]));});});}; \ No newline at end of file +var _0xa6a3=['jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSmsAccount','find','options','raw','where','attributes','include','map','model','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x5a1826,_0x181546){var _0x2d8b8a=function(_0x16312){while(--_0x16312){_0x5a1826['push'](_0x5a1826['shift']());}};_0x2d8b8a(++_0x181546);}(_0xa6a3,0xf4));var _0x3a6a=function(_0x3e8bf8,_0x4e76d6){_0x3e8bf8=_0x3e8bf8-0x0;var _0x3391ce=_0xa6a3[_0x3e8bf8];return _0x3391ce;};'use strict';var _=require('lodash');var util=require(_0x3a6a('0x0'));var moment=require(_0x3a6a('0x1'));var BPromise=require(_0x3a6a('0x2'));var rs=require(_0x3a6a('0x3'));var fs=require('fs');var Redis=require(_0x3a6a('0x4'));var db=require(_0x3a6a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a6a('0x6'));var config=require(_0x3a6a('0x7'));var jayson=require(_0x3a6a('0x8'));var client=jayson[_0x3a6a('0x9')][_0x3a6a('0xa')]({'port':0x232a});config[_0x3a6a('0xb')]=_[_0x3a6a('0xc')](config[_0x3a6a('0xb')],{'host':_0x3a6a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a6a('0xb')]));require('./smsAccount.socket')[_0x3a6a('0xe')](socket);function respondWithRpcPromise(_0x358108,_0x474e18,_0x5c4e03){return new BPromise(function(_0x44d08a,_0x1990f5){return client[_0x3a6a('0xf')](_0x358108,_0x5c4e03)[_0x3a6a('0x10')](function(_0x58f4d8){logger[_0x3a6a('0x11')](_0x3a6a('0x12'),_0x474e18,_0x3a6a('0x13'));logger[_0x3a6a('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x474e18,_0x3a6a('0x13'),JSON['stringify'](_0x58f4d8));if(_0x58f4d8[_0x3a6a('0x15')]){if(_0x58f4d8[_0x3a6a('0x15')][_0x3a6a('0x16')]===0x1f4){logger[_0x3a6a('0x15')](_0x3a6a('0x12'),_0x474e18,_0x58f4d8[_0x3a6a('0x15')][_0x3a6a('0x17')]);return _0x1990f5(_0x58f4d8[_0x3a6a('0x15')][_0x3a6a('0x17')]);}logger[_0x3a6a('0x15')](_0x3a6a('0x12'),_0x474e18,_0x58f4d8[_0x3a6a('0x15')][_0x3a6a('0x17')]);return _0x44d08a(_0x58f4d8[_0x3a6a('0x15')]['message']);}else{logger[_0x3a6a('0x11')](_0x3a6a('0x12'),_0x474e18,_0x3a6a('0x13'));_0x44d08a(_0x58f4d8[_0x3a6a('0x18')]['message']);}})[_0x3a6a('0x19')](function(_0x58a063){logger[_0x3a6a('0x15')]('SmsAccount,\x20%s,\x20%s',_0x474e18,_0x58a063);_0x1990f5(_0x58a063);});});}exports[_0x3a6a('0x1a')]=function(_0xe9f043){var _0x5748c6=this;return new Promise(function(_0x4e559c,_0x48e1b1){return db['SmsAccount'][_0x3a6a('0x1b')]({'raw':_0xe9f043[_0x3a6a('0x1c')]?_0xe9f043[_0x3a6a('0x1c')][_0x3a6a('0x1d')]===undefined?!![]:![]:!![],'where':_0xe9f043['options']?_0xe9f043[_0x3a6a('0x1c')][_0x3a6a('0x1e')]||null:null,'attributes':_0xe9f043[_0x3a6a('0x1c')]?_0xe9f043[_0x3a6a('0x1c')][_0x3a6a('0x1f')]||null:null,'include':_0xe9f043[_0x3a6a('0x1c')]?_0xe9f043['options'][_0x3a6a('0x20')]?_[_0x3a6a('0x21')](_0xe9f043[_0x3a6a('0x1c')][_0x3a6a('0x20')],function(_0x422e49){return{'model':db[_0x422e49[_0x3a6a('0x22')]],'as':_0x422e49['as'],'attributes':_0x422e49[_0x3a6a('0x1f')],'include':_0x422e49[_0x3a6a('0x20')]?_[_0x3a6a('0x21')](_0x422e49[_0x3a6a('0x20')],function(_0x510abc){return{'model':db[_0x510abc['model']],'as':_0x510abc['as'],'attributes':_0x510abc[_0x3a6a('0x1f')],'include':_0x510abc[_0x3a6a('0x20')]?_[_0x3a6a('0x21')](_0x510abc[_0x3a6a('0x20')],function(_0x1ee4e4){return{'model':db[_0x1ee4e4['model']],'as':_0x1ee4e4['as'],'attributes':_0x1ee4e4[_0x3a6a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e960e){logger[_0x3a6a('0x11')](_0x3a6a('0x1a'),_0xe9f043);logger['debug'](_0x3a6a('0x1a'),_0xe9f043,JSON[_0x3a6a('0x23')](_0x2e960e));_0x4e559c(_0x2e960e);})[_0x3a6a('0x19')](function(_0x232140){logger[_0x3a6a('0x15')]('ShowSmsAccount',_0x232140[_0x3a6a('0x17')],_0xe9f043);_0x48e1b1(_0x5748c6[_0x3a6a('0x15')](0x1f4,_0x232140[_0x3a6a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8d877eb..6b89b4a 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 e659078..6b1e99d 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x4a77d1,_0x293d0b){var _0x4cf5ef=function(_0x123801){while(--_0x123801){_0x4a77d1['push'](_0x4a77d1['shift']());}};_0x4cf5ef(++_0x293d0b);}(_0x008c,0x188));var _0xc008=function(_0x1b3ddb,_0x190f99){_0x1b3ddb=_0x1b3ddb-0x0;var _0x3b952d=_0x008c[_0x1b3ddb];return _0x3b952d;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x3091ee,_0x225a1b){var _0x90900f=function(_0xd0f3db){while(--_0xd0f3db){_0x3091ee['push'](_0x3091ee['shift']());}};_0x90900f(++_0x225a1b);}(_0x55ca,0x126));var _0xa55c=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0x55ca[_0x479650];return _0x26b288;};'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['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 83c1c5e..2c78835 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 _0xf08a=['STRING','noop','*,*,*,*'];(function(_0xfd91f4,_0x55cba2){var _0x3b9e40=function(_0x4b0af0){while(--_0x4b0af0){_0xfd91f4['push'](_0xfd91f4['shift']());}};_0x3b9e40(++_0x55cba2);}(_0xf08a,0x12f));var _0xaf08=function(_0x21ebc9,_0x45dc99){_0x21ebc9=_0x21ebc9-0x0;var _0x100b1b=_0xf08a[_0x21ebc9];return _0x100b1b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xaf08('0x0')],'allowNull':![],'defaultValue':_0xaf08('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xaf08('0x0')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xaf08('0x2')}}; \ No newline at end of file +var _0x52f4=['noop','sequelize','INTEGER','STRING'];(function(_0x364079,_0x45d151){var _0x44210f=function(_0x4062f2){while(--_0x4062f2){_0x364079['push'](_0x364079['shift']());}};_0x44210f(++_0x45d151);}(_0x52f4,0xb5));var _0x452f=function(_0x2036c2,_0x41c64e){_0x2036c2=_0x2036c2-0x0;var _0x227f58=_0x52f4[_0x2036c2];return _0x227f58;};'use strict';var Sequelize=require(_0x452f('0x0'));module['exports']={'priority':{'type':Sequelize[_0x452f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x452f('0x2')],'allowNull':![],'defaultValue':_0x452f('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x452f('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 15d2df8..2e82a37 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 _0x6f0c=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x49cbb1,_0x338617){var _0x3d08d3=function(_0x19296b){while(--_0x19296b){_0x49cbb1['push'](_0x49cbb1['shift']());}};_0x3d08d3(++_0x338617);}(_0x6f0c,0x1b5));var _0xc6f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f0c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc6f0('0x0'));var rp=require(_0xc6f0('0x1'));var moment=require(_0xc6f0('0x2'));var BPromise=require(_0xc6f0('0x3'));var Mustache=require(_0xc6f0('0x4'));var util=require('util');var path=require(_0xc6f0('0x5'));var sox=require(_0xc6f0('0x6'));var csv=require(_0xc6f0('0x7'));var ejs=require(_0xc6f0('0x8'));var fs=require('fs');var fs_extra=require(_0xc6f0('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc6f0('0xa'));var jsforce=require(_0xc6f0('0xb'));var deskjs=require(_0xc6f0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc6f0('0xd'));var Papa=require(_0xc6f0('0xe'));var Redis=require('ioredis');var authService=require(_0xc6f0('0xf'));var qs=require(_0xc6f0('0x10'));var as=require(_0xc6f0('0x11'));var hardwareService=require(_0xc6f0('0x12'));var logger=require(_0xc6f0('0x13'))('api');var utils=require(_0xc6f0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc6f0('0x15'));var db=require(_0xc6f0('0x16'))['db'];function respondWithStatusCode(_0x4309f5,_0x1a9c29){_0x1a9c29=_0x1a9c29||0xcc;return function(_0x191686){if(_0x191686){return _0x4309f5[_0xc6f0('0x17')](_0x1a9c29);}return _0x4309f5[_0xc6f0('0x18')](_0x1a9c29)[_0xc6f0('0x19')]();};}function respondWithResult(_0x4d9965,_0x1bfadf){_0x1bfadf=_0x1bfadf||0xc8;return function(_0x9dbacb){if(_0x9dbacb){return _0x4d9965[_0xc6f0('0x18')](_0x1bfadf)[_0xc6f0('0x1a')](_0x9dbacb);}};}function respondWithFilteredResult(_0x3fd838,_0x1820af){return function(_0x6e9528){if(_0x6e9528){var _0x1ba1fd=typeof _0x1820af['offset']===_0xc6f0('0x1b')&&typeof _0x1820af[_0xc6f0('0x1c')]===_0xc6f0('0x1b');var _0xf87acb=_0x6e9528[_0xc6f0('0x1d')];var _0x1029b7=_0x1ba1fd?0x0:_0x1820af[_0xc6f0('0x1e')];var _0x38d198=_0x1ba1fd?_0x6e9528['count']:_0x1820af['offset']+_0x1820af[_0xc6f0('0x1c')];var _0x150898;if(_0x38d198>=_0xf87acb){_0x38d198=_0xf87acb;_0x150898=0xc8;}else{_0x150898=0xce;}_0x3fd838[_0xc6f0('0x18')](_0x150898);return _0x3fd838[_0xc6f0('0x1f')](_0xc6f0('0x20'),_0x1029b7+'-'+_0x38d198+'/'+_0xf87acb)[_0xc6f0('0x1a')](_0x6e9528);}return null;};}function patchUpdates(_0x10c600){return function(_0x483efd){try{jsonpatch[_0xc6f0('0x21')](_0x483efd,_0x10c600,!![]);}catch(_0x1c1274){return BPromise[_0xc6f0('0x22')](_0x1c1274);}return _0x483efd[_0xc6f0('0x23')]();};}function saveUpdates(_0x133d4e,_0x57e449){return function(_0x722af){if(_0x722af){return _0x722af[_0xc6f0('0x24')](_0x133d4e)['then'](function(_0x3155aa){return _0x3155aa;});}return null;};}function removeEntity(_0x17bd08,_0x3cadc6){return function(_0x5d4179){if(_0x5d4179){return _0x5d4179['destroy']()[_0xc6f0('0x25')](function(){_0x17bd08[_0xc6f0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f8455,_0x3ad31a){return function(_0x29bbd8){if(!_0x29bbd8){_0x9f8455[_0xc6f0('0x17')](0x194);}return _0x29bbd8;};}function handleError(_0x4494ad,_0xbac3e0){_0xbac3e0=_0xbac3e0||0x1f4;return function(_0x3e7d13){logger[_0xc6f0('0x26')](_0x3e7d13['stack']);if(_0x3e7d13['name']){delete _0x3e7d13[_0xc6f0('0x27')];}_0x4494ad['status'](_0xbac3e0)[_0xc6f0('0x28')](_0x3e7d13);};}exports[_0xc6f0('0x29')]=function(_0x3a5479,_0x49530e){var _0xc1ca9b={},_0x5d39c4={},_0x5e2414={'count':0x0,'rows':[]};var _0x485980=_[_0xc6f0('0x2a')](db[_0xc6f0('0x2b')][_0xc6f0('0x2c')],function(_0x21015b){return{'name':_0x21015b[_0xc6f0('0x2d')],'type':_0x21015b['type'][_0xc6f0('0x2e')]};});_0x5d39c4[_0xc6f0('0x2f')]=_[_0xc6f0('0x2a')](_0x485980,_0xc6f0('0x27'));_0x5d39c4['query']=_[_0xc6f0('0x30')](_0x3a5479[_0xc6f0('0x31')]);_0x5d39c4['filters']=_[_0xc6f0('0x32')](_0x5d39c4[_0xc6f0('0x2f')],_0x5d39c4[_0xc6f0('0x31')]);_0xc1ca9b[_0xc6f0('0x33')]=_[_0xc6f0('0x32')](_0x5d39c4[_0xc6f0('0x2f')],qs['fields'](_0x3a5479[_0xc6f0('0x31')][_0xc6f0('0x34')]));_0xc1ca9b[_0xc6f0('0x33')]=_0xc1ca9b[_0xc6f0('0x33')][_0xc6f0('0x35')]?_0xc1ca9b[_0xc6f0('0x33')]:_0x5d39c4['model'];if(!_0x3a5479[_0xc6f0('0x31')]['hasOwnProperty'](_0xc6f0('0x36'))){_0xc1ca9b[_0xc6f0('0x1c')]=qs[_0xc6f0('0x1c')](_0x3a5479[_0xc6f0('0x31')]['limit']);_0xc1ca9b['offset']=qs[_0xc6f0('0x1e')](_0x3a5479[_0xc6f0('0x31')][_0xc6f0('0x1e')]);}_0xc1ca9b[_0xc6f0('0x37')]=qs[_0xc6f0('0x38')](_0x3a5479[_0xc6f0('0x31')]['sort']);_0xc1ca9b[_0xc6f0('0x39')]=qs[_0xc6f0('0x3a')](_[_0xc6f0('0x3b')](_0x3a5479[_0xc6f0('0x31')],_0x5d39c4[_0xc6f0('0x3a')]),_0x485980);if(_0x3a5479['query'][_0xc6f0('0x3c')]){_0xc1ca9b['where']=_[_0xc6f0('0x3d')](_0xc1ca9b[_0xc6f0('0x39')],{'$or':_[_0xc6f0('0x2a')](_0x485980,function(_0x23d07f){if(_0x23d07f[_0xc6f0('0x3e')]!==_0xc6f0('0x3f')){var _0x4c551b={};_0x4c551b[_0x23d07f[_0xc6f0('0x27')]]={'$like':'%'+_0x3a5479[_0xc6f0('0x31')]['filter']+'%'};return _0x4c551b;}})});}_0xc1ca9b=_[_0xc6f0('0x3d')]({},_0xc1ca9b,_0x3a5479[_0xc6f0('0x40')]);var _0x416a98={'where':_0xc1ca9b[_0xc6f0('0x39')]};return db[_0xc6f0('0x2b')][_0xc6f0('0x1d')](_0x416a98)[_0xc6f0('0x25')](function(_0x45223c){_0x5e2414['count']=_0x45223c;if(_0x3a5479[_0xc6f0('0x31')][_0xc6f0('0x41')]){_0xc1ca9b[_0xc6f0('0x42')]=[{'all':!![]}];}return db[_0xc6f0('0x2b')][_0xc6f0('0x43')](_0xc1ca9b);})['then'](function(_0x373a7a){_0x5e2414[_0xc6f0('0x44')]=_0x373a7a;return _0x5e2414;})['then'](respondWithFilteredResult(_0x49530e,_0xc1ca9b))[_0xc6f0('0x45')](handleError(_0x49530e,null));};exports[_0xc6f0('0x46')]=function(_0x4569bd,_0x328da9){var _0x1d9dee={'raw':!![],'where':{'id':_0x4569bd[_0xc6f0('0x47')]['id']}},_0x3091f7={};_0x3091f7[_0xc6f0('0x2f')]=_[_0xc6f0('0x30')](db[_0xc6f0('0x2b')]['rawAttributes']);_0x3091f7[_0xc6f0('0x31')]=_[_0xc6f0('0x30')](_0x4569bd[_0xc6f0('0x31')]);_0x3091f7[_0xc6f0('0x3a')]=_[_0xc6f0('0x32')](_0x3091f7[_0xc6f0('0x2f')],_0x3091f7[_0xc6f0('0x31')]);_0x1d9dee[_0xc6f0('0x33')]=_[_0xc6f0('0x32')](_0x3091f7[_0xc6f0('0x2f')],qs[_0xc6f0('0x34')](_0x4569bd[_0xc6f0('0x31')]['fields']));_0x1d9dee[_0xc6f0('0x33')]=_0x1d9dee[_0xc6f0('0x33')][_0xc6f0('0x35')]?_0x1d9dee[_0xc6f0('0x33')]:_0x3091f7['model'];if(_0x4569bd[_0xc6f0('0x31')][_0xc6f0('0x41')]){_0x1d9dee[_0xc6f0('0x42')]=[{'all':!![]}];}_0x1d9dee=_['merge']({},_0x1d9dee,_0x4569bd[_0xc6f0('0x40')]);return db[_0xc6f0('0x2b')][_0xc6f0('0x48')](_0x1d9dee)[_0xc6f0('0x25')](handleEntityNotFound(_0x328da9,null))[_0xc6f0('0x25')](respondWithResult(_0x328da9,null))[_0xc6f0('0x45')](handleError(_0x328da9,null));};exports[_0xc6f0('0x49')]=function(_0x131031,_0x4e6868){return db[_0xc6f0('0x2b')]['create'](_0x131031[_0xc6f0('0x4a')],{})['then'](respondWithResult(_0x4e6868,0xc9))['catch'](handleError(_0x4e6868,null));};exports[_0xc6f0('0x24')]=function(_0x2d7d2c,_0x344a59){if(_0x2d7d2c[_0xc6f0('0x4a')]['id']){delete _0x2d7d2c[_0xc6f0('0x4a')]['id'];}return db['SmsApplication'][_0xc6f0('0x48')]({'where':{'id':_0x2d7d2c['params']['id']}})[_0xc6f0('0x25')](handleEntityNotFound(_0x344a59,null))[_0xc6f0('0x25')](saveUpdates(_0x2d7d2c[_0xc6f0('0x4a')],null))[_0xc6f0('0x25')](respondWithResult(_0x344a59,null))[_0xc6f0('0x45')](handleError(_0x344a59,null));};exports[_0xc6f0('0x4b')]=function(_0x11d2bf,_0x17d1d0){return db[_0xc6f0('0x2b')][_0xc6f0('0x48')]({'where':{'id':_0x11d2bf[_0xc6f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x17d1d0,null))['then'](removeEntity(_0x17d1d0,null))[_0xc6f0('0x45')](handleError(_0x17d1d0,null));}; \ No newline at end of file +var _0x252b=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','reject','save','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','then','includeAll','findAll','catch','params','include','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x252b,0x11a));var _0xb252=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0x252b[_0x138836];return _0x322688;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb252('0x0'));var zipdir=require(_0xb252('0x1'));var jsonpatch=require(_0xb252('0x2'));var rp=require(_0xb252('0x3'));var moment=require(_0xb252('0x4'));var BPromise=require(_0xb252('0x5'));var Mustache=require(_0xb252('0x6'));var util=require('util');var path=require(_0xb252('0x7'));var sox=require(_0xb252('0x8'));var csv=require(_0xb252('0x9'));var ejs=require(_0xb252('0xa'));var fs=require('fs');var fs_extra=require(_0xb252('0xb'));var _=require(_0xb252('0xc'));var squel=require(_0xb252('0xd'));var crypto=require('crypto');var jsforce=require(_0xb252('0xe'));var deskjs=require(_0xb252('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb252('0x10'));var Papa=require(_0xb252('0x11'));var Redis=require(_0xb252('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb252('0x13'));var as=require(_0xb252('0x14'));var hardwareService=require(_0xb252('0x15'));var logger=require(_0xb252('0x16'))('api');var utils=require(_0xb252('0x17'));var config=require(_0xb252('0x18'));var licenseUtil=require(_0xb252('0x19'));var db=require(_0xb252('0x1a'))['db'];function respondWithStatusCode(_0x5c5e00,_0x489e44){_0x489e44=_0x489e44||0xcc;return function(_0x34e760){if(_0x34e760){return _0x5c5e00[_0xb252('0x1b')](_0x489e44);}return _0x5c5e00[_0xb252('0x1c')](_0x489e44)['end']();};}function respondWithResult(_0x53b870,_0x2012d7){_0x2012d7=_0x2012d7||0xc8;return function(_0x460957){if(_0x460957){return _0x53b870['status'](_0x2012d7)[_0xb252('0x1d')](_0x460957);}};}function respondWithFilteredResult(_0x1ad738,_0x335414){return function(_0x55e75d){if(_0x55e75d){var _0x1fd904=typeof _0x335414['offset']==='undefined'&&typeof _0x335414[_0xb252('0x1e')]===_0xb252('0x1f');var _0x43c326=_0x55e75d['count'];var _0x488aa3=_0x1fd904?0x0:_0x335414[_0xb252('0x20')];var _0x4e9c9f=_0x1fd904?_0x55e75d['count']:_0x335414['offset']+_0x335414[_0xb252('0x1e')];var _0xcfc6e3;if(_0x4e9c9f>=_0x43c326){_0x4e9c9f=_0x43c326;_0xcfc6e3=0xc8;}else{_0xcfc6e3=0xce;}_0x1ad738[_0xb252('0x1c')](_0xcfc6e3);return _0x1ad738[_0xb252('0x21')](_0xb252('0x22'),_0x488aa3+'-'+_0x4e9c9f+'/'+_0x43c326)[_0xb252('0x1d')](_0x55e75d);}return null;};}function patchUpdates(_0xa6b458){return function(_0x48e935){try{jsonpatch['apply'](_0x48e935,_0xa6b458,!![]);}catch(_0x3d7a2c){return BPromise[_0xb252('0x23')](_0x3d7a2c);}return _0x48e935[_0xb252('0x24')]();};}function saveUpdates(_0x50bb5f,_0x40d34e){return function(_0x3112f9){if(_0x3112f9){return _0x3112f9['update'](_0x50bb5f)['then'](function(_0x46a79c){return _0x46a79c;});}return null;};}function removeEntity(_0x28b3ec,_0x3a5206){return function(_0x1f2b5c){if(_0x1f2b5c){return _0x1f2b5c['destroy']()['then'](function(){_0x28b3ec[_0xb252('0x1c')](0xcc)[_0xb252('0x25')]();});}};}function handleEntityNotFound(_0x5c9894,_0x2761dd){return function(_0x54ec81){if(!_0x54ec81){_0x5c9894[_0xb252('0x1b')](0x194);}return _0x54ec81;};}function handleError(_0x30001e,_0x2088ee){_0x2088ee=_0x2088ee||0x1f4;return function(_0x5bcbed){logger[_0xb252('0x26')](_0x5bcbed[_0xb252('0x27')]);if(_0x5bcbed[_0xb252('0x28')]){delete _0x5bcbed['name'];}_0x30001e[_0xb252('0x1c')](_0x2088ee)['send'](_0x5bcbed);};}exports[_0xb252('0x29')]=function(_0x1c5263,_0x398ea3){var _0x3d335b={},_0x1ec7fb={},_0x5255ed={'count':0x0,'rows':[]};var _0x1d1ab1=_[_0xb252('0x2a')](db[_0xb252('0x2b')][_0xb252('0x2c')],function(_0x1dc97d){return{'name':_0x1dc97d[_0xb252('0x2d')],'type':_0x1dc97d['type'][_0xb252('0x2e')]};});_0x1ec7fb[_0xb252('0x2f')]=_[_0xb252('0x2a')](_0x1d1ab1,_0xb252('0x28'));_0x1ec7fb[_0xb252('0x30')]=_[_0xb252('0x31')](_0x1c5263['query']);_0x1ec7fb[_0xb252('0x32')]=_['intersection'](_0x1ec7fb[_0xb252('0x2f')],_0x1ec7fb[_0xb252('0x30')]);_0x3d335b[_0xb252('0x33')]=_[_0xb252('0x34')](_0x1ec7fb['model'],qs['fields'](_0x1c5263[_0xb252('0x30')][_0xb252('0x35')]));_0x3d335b['attributes']=_0x3d335b[_0xb252('0x33')][_0xb252('0x36')]?_0x3d335b[_0xb252('0x33')]:_0x1ec7fb[_0xb252('0x2f')];if(!_0x1c5263[_0xb252('0x30')]['hasOwnProperty']('nolimit')){_0x3d335b[_0xb252('0x1e')]=qs['limit'](_0x1c5263[_0xb252('0x30')][_0xb252('0x1e')]);_0x3d335b[_0xb252('0x20')]=qs[_0xb252('0x20')](_0x1c5263[_0xb252('0x30')][_0xb252('0x20')]);}_0x3d335b[_0xb252('0x37')]=qs['sort'](_0x1c5263[_0xb252('0x30')][_0xb252('0x38')]);_0x3d335b['where']=qs[_0xb252('0x32')](_[_0xb252('0x39')](_0x1c5263[_0xb252('0x30')],_0x1ec7fb['filters']),_0x1d1ab1);if(_0x1c5263[_0xb252('0x30')]['filter']){_0x3d335b[_0xb252('0x3a')]=_[_0xb252('0x3b')](_0x3d335b[_0xb252('0x3a')],{'$or':_['map'](_0x1d1ab1,function(_0x156732){if(_0x156732[_0xb252('0x3c')]!==_0xb252('0x3d')){var _0x2c2329={};_0x2c2329[_0x156732[_0xb252('0x28')]]={'$like':'%'+_0x1c5263['query'][_0xb252('0x3e')]+'%'};return _0x2c2329;}})});}_0x3d335b=_[_0xb252('0x3b')]({},_0x3d335b,_0x1c5263[_0xb252('0x3f')]);var _0x486711={'where':_0x3d335b[_0xb252('0x3a')]};return db[_0xb252('0x2b')][_0xb252('0x40')](_0x486711)[_0xb252('0x41')](function(_0x4991b2){_0x5255ed[_0xb252('0x40')]=_0x4991b2;if(_0x1c5263[_0xb252('0x30')][_0xb252('0x42')]){_0x3d335b['include']=[{'all':!![]}];}return db[_0xb252('0x2b')][_0xb252('0x43')](_0x3d335b);})[_0xb252('0x41')](function(_0x3b051f){_0x5255ed['rows']=_0x3b051f;return _0x5255ed;})['then'](respondWithFilteredResult(_0x398ea3,_0x3d335b))[_0xb252('0x44')](handleError(_0x398ea3,null));};exports['show']=function(_0x153b1b,_0x359208){var _0x257534={'raw':!![],'where':{'id':_0x153b1b[_0xb252('0x45')]['id']}},_0x2bdceb={};_0x2bdceb[_0xb252('0x2f')]=_[_0xb252('0x31')](db[_0xb252('0x2b')][_0xb252('0x2c')]);_0x2bdceb[_0xb252('0x30')]=_[_0xb252('0x31')](_0x153b1b[_0xb252('0x30')]);_0x2bdceb['filters']=_[_0xb252('0x34')](_0x2bdceb[_0xb252('0x2f')],_0x2bdceb[_0xb252('0x30')]);_0x257534[_0xb252('0x33')]=_[_0xb252('0x34')](_0x2bdceb['model'],qs[_0xb252('0x35')](_0x153b1b[_0xb252('0x30')][_0xb252('0x35')]));_0x257534['attributes']=_0x257534[_0xb252('0x33')]['length']?_0x257534[_0xb252('0x33')]:_0x2bdceb[_0xb252('0x2f')];if(_0x153b1b[_0xb252('0x30')][_0xb252('0x42')]){_0x257534[_0xb252('0x46')]=[{'all':!![]}];}_0x257534=_['merge']({},_0x257534,_0x153b1b[_0xb252('0x3f')]);return db[_0xb252('0x2b')][_0xb252('0x47')](_0x257534)['then'](handleEntityNotFound(_0x359208,null))[_0xb252('0x41')](respondWithResult(_0x359208,null))[_0xb252('0x44')](handleError(_0x359208,null));};exports[_0xb252('0x48')]=function(_0x46a876,_0x849140){return db[_0xb252('0x2b')]['create'](_0x46a876[_0xb252('0x49')],{})['then'](respondWithResult(_0x849140,0xc9))[_0xb252('0x44')](handleError(_0x849140,null));};exports[_0xb252('0x4a')]=function(_0x147cdb,_0x19dd68){if(_0x147cdb[_0xb252('0x49')]['id']){delete _0x147cdb[_0xb252('0x49')]['id'];}return db['SmsApplication'][_0xb252('0x47')]({'where':{'id':_0x147cdb[_0xb252('0x45')]['id']}})[_0xb252('0x41')](handleEntityNotFound(_0x19dd68,null))[_0xb252('0x41')](saveUpdates(_0x147cdb[_0xb252('0x49')],null))[_0xb252('0x41')](respondWithResult(_0x19dd68,null))[_0xb252('0x44')](handleError(_0x19dd68,null));};exports[_0xb252('0x4b')]=function(_0x21b0e3,_0x318037){return db['SmsApplication'][_0xb252('0x47')]({'where':{'id':_0x21b0e3[_0xb252('0x45')]['id']}})[_0xb252('0x41')](handleEntityNotFound(_0x318037,null))[_0xb252('0x41')](removeEntity(_0x318037,null))[_0xb252('0x44')](handleError(_0x318037,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index d7a9df4..cb8887f 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 _0x72b1=['path','rimraf','./smsApplication.attributes','exports','SmsApplication','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x72b1,0x16e));var _0x172b=function(_0x5aaefa,_0xe377d6){_0x5aaefa=_0x5aaefa-0x0;var _0x149c83=_0x72b1[_0x5aaefa];return _0x149c83;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var BPromise=require(_0x172b('0x4'));var rp=require(_0x172b('0x5'));var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require(_0x172b('0x7'));var config=require('../../config/environment');var attributes=require(_0x172b('0x8'));module[_0x172b('0x9')]=function(_0x475fd6,_0x222624){return _0x475fd6['define'](_0x172b('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x172b('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf39f=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0x237e8e,_0x21c83d){var _0x12c37f=function(_0x5c6f2d){while(--_0x5c6f2d){_0x237e8e['push'](_0x237e8e['shift']());}};_0x12c37f(++_0x21c83d);}(_0xf39f,0x1e6));var _0xff39=function(_0x400a79,_0x2cde89){_0x400a79=_0x400a79-0x0;var _0x1fc7be=_0xf39f[_0x400a79];return _0x1fc7be;};'use strict';var _=require(_0xff39('0x0'));var util=require(_0xff39('0x1'));var logger=require(_0xff39('0x2'))('api');var moment=require('moment');var BPromise=require(_0xff39('0x3'));var rp=require(_0xff39('0x4'));var fs=require('fs');var path=require(_0xff39('0x5'));var rimraf=require(_0xff39('0x6'));var config=require(_0xff39('0x7'));var attributes=require(_0xff39('0x8'));module[_0xff39('0x9')]=function(_0x31779e,_0x31482b){return _0x31779e[_0xff39('0xa')](_0xff39('0xb'),attributes,{'tableName':_0xff39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xff39('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 3d15a23..4f8cd11 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 _0x4813=['lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x1e1149,_0x2e9a39){var _0x2d006c=function(_0xa5b0df){while(--_0xa5b0df){_0x1e1149['push'](_0x1e1149['shift']());}};_0x2d006c(++_0x2e9a39);}(_0x4813,0xdc));var _0x3481=function(_0x2b9635,_0x569328){_0x2b9635=_0x2b9635-0x0;var _0x3611aa=_0x4813[_0x2b9635];return _0x3611aa;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var moment=require(_0x3481('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3481('0x2'));var db=require(_0x3481('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3481('0x4'))(_0x3481('0x5'));var config=require(_0x3481('0x6'));var jayson=require(_0x3481('0x7'));var client=jayson[_0x3481('0x8')][_0x3481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x369c3b,_0x54a2c8,_0x4d23ef){return new BPromise(function(_0x41592f,_0x527c3c){return client[_0x3481('0xa')](_0x369c3b,_0x4d23ef)[_0x3481('0xb')](function(_0x39b6c4){logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));logger[_0x3481('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x54a2c8,'request\x20sent',JSON[_0x3481('0x10')](_0x39b6c4));if(_0x39b6c4[_0x3481('0x11')]){if(_0x39b6c4[_0x3481('0x11')][_0x3481('0x12')]===0x1f4){logger[_0x3481('0x11')]('SmsApplication,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);return _0x527c3c(_0x39b6c4[_0x3481('0x11')][_0x3481('0x13')]);}logger[_0x3481('0x11')]('SmsApplication,\x20%s,\x20%s',_0x54a2c8,_0x39b6c4['error'][_0x3481('0x13')]);return _0x41592f(_0x39b6c4[_0x3481('0x11')]['message']);}else{logger[_0x3481('0xc')](_0x3481('0xd'),_0x54a2c8,_0x3481('0xe'));_0x41592f(_0x39b6c4[_0x3481('0x14')][_0x3481('0x13')]);}})[_0x3481('0x15')](function(_0x2a3981){logger['error'](_0x3481('0xd'),_0x54a2c8,_0x2a3981);_0x527c3c(_0x2a3981);});});} \ No newline at end of file +var _0x639a=['debug','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent'];(function(_0x1ea56a,_0x310632){var _0x2d0ae2=function(_0x42f0b6){while(--_0x42f0b6){_0x1ea56a['push'](_0x1ea56a['shift']());}};_0x2d0ae2(++_0x310632);}(_0x639a,0x1e8));var _0xa639=function(_0x342f31,_0x3ba4b1){_0x342f31=_0x342f31-0x0;var _0x5355ab=_0x639a[_0x342f31];return _0x5355ab;};'use strict';var _=require(_0xa639('0x0'));var util=require(_0xa639('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa639('0x2'));var fs=require('fs');var Redis=require(_0xa639('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa639('0x4'));var logger=require(_0xa639('0x5'))(_0xa639('0x6'));var config=require(_0xa639('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa639('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x276815,_0x38b779,_0x277b76){return new BPromise(function(_0x2f4bce,_0x41a185){return client['request'](_0x276815,_0x277b76)[_0xa639('0x9')](function(_0x16d090){logger[_0xa639('0xa')]('SmsApplication,\x20%s,\x20%s',_0x38b779,_0xa639('0xb'));logger[_0xa639('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x38b779,_0xa639('0xb'),JSON[_0xa639('0xd')](_0x16d090));if(_0x16d090['error']){if(_0x16d090[_0xa639('0xe')][_0xa639('0xf')]===0x1f4){logger['error'](_0xa639('0x10'),_0x38b779,_0x16d090[_0xa639('0xe')][_0xa639('0x11')]);return _0x41a185(_0x16d090[_0xa639('0xe')][_0xa639('0x11')]);}logger[_0xa639('0xe')](_0xa639('0x10'),_0x38b779,_0x16d090['error'][_0xa639('0x11')]);return _0x2f4bce(_0x16d090[_0xa639('0xe')][_0xa639('0x11')]);}else{logger[_0xa639('0xa')](_0xa639('0x10'),_0x38b779,_0xa639('0xb'));_0x2f4bce(_0x16d090[_0xa639('0x12')][_0xa639('0x11')]);}})[_0xa639('0x13')](function(_0x58eded){logger[_0xa639('0xe')](_0xa639('0x10'),_0x38b779,_0x58eded);_0x41a185(_0x58eded);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 02d05f7..3f96989 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 _0x6cb4=['./smsInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','create','post','/:id/messages','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f9457,_0x3dcf40){var _0x3270c4=function(_0x400ff0){while(--_0x400ff0){_0x1f9457['push'](_0x1f9457['shift']());}};_0x3270c4(++_0x3dcf40);}(_0x6cb4,0xff));var _0x46cb=function(_0x15fa26,_0x5103f2){_0x15fa26=_0x15fa26-0x0;var _0x2e1a1c=_0x6cb4[_0x15fa26];return _0x2e1a1c;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xb')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0xf')]);router[_0x46cb('0xb')]('/:id/messages',auth[_0x46cb('0xa')](),controller[_0x46cb('0x10')]);router['get'](_0x46cb('0x11'),auth[_0x46cb('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x46cb('0x12')]);router[_0x46cb('0x13')](_0x46cb('0x14'),auth[_0x46cb('0xa')](),controller['addMessage']);router[_0x46cb('0x13')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')](_0x46cb('0x17'),_0x46cb('0x18')),controller[_0x46cb('0x19')]);router[_0x46cb('0x1a')](_0x46cb('0xe'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')]('sms',_0x46cb('0x1b')),controller['update']);router[_0x46cb('0x1c')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x46cb('0x17'),_0x46cb('0x1d')),controller[_0x46cb('0x1e')]);router[_0x46cb('0x1c')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),controller[_0x46cb('0x1f')]);module[_0x46cb('0x20')]=router; \ No newline at end of file +var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x1bc791,_0x3a4e99){var _0x40fd03=function(_0x52ce12){while(--_0x52ce12){_0x1bc791['push'](_0x1bc791['shift']());}};_0x40fd03(++_0x3a4e99);}(_0x0972,0x64));var _0x2097=function(_0x22ff4f,_0x5da946){_0x22ff4f=_0x22ff4f-0x0;var _0x55b17f=_0x0972[_0x22ff4f];return _0x55b17f;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 0f5a009..f171842 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 _0x6208=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x4b2910,_0x5272c9){var _0x1efc6e=function(_0x3f4aa8){while(--_0x3f4aa8){_0x4b2910['push'](_0x4b2910['shift']());}};_0x1efc6e(++_0x5272c9);}(_0x6208,0x17d));var _0x8620=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0x6208[_0x7185f7];return _0x182e45;};'use strict';var Sequelize=require(_0x8620('0x0'));var moment=require('moment');module[_0x8620('0x1')]={'closed':{'type':Sequelize[_0x8620('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8620('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8620('0x3')]},'note':{'type':Sequelize[_0x8620('0x3')]},'phone':{'type':Sequelize[_0x8620('0x3')]},'read1stAt':{'type':Sequelize[_0x8620('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x8620('0x5')]('in',_0x8620('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8620('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8620('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8620('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xeff8=['BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0xc1dd50,_0x20c4cc){var _0x4e75f4=function(_0xd2c1e5){while(--_0xd2c1e5){_0xc1dd50['push'](_0xc1dd50['shift']());}};_0x4e75f4(++_0x20c4cc);}(_0xeff8,0x186));var _0x8eff=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xeff8[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0x8eff('0x0'));var moment=require(_0x8eff('0x1'));module['exports']={'closed':{'type':Sequelize[_0x8eff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8eff('0x3')]},'disposition':{'type':Sequelize[_0x8eff('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8eff('0x4')]},'note':{'type':Sequelize[_0x8eff('0x4')]},'phone':{'type':Sequelize[_0x8eff('0x4')]},'read1stAt':{'type':Sequelize[_0x8eff('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8eff('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8eff('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8eff('0x6')]('in',_0x8eff('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 35a1923..7bef4be 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 _0x759d=['User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','i.SmsAccountId\x20IN\x20?','parse','$gte','$lte','read','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','isEmpty','i.SmsAccountId\x20IS\x20NULL','SmsAccountId','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','length','options','create','body','describe','addMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','includeAll','include','findAll','rows','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','createdAt','secret','SmsAccount','Owner','get','mkdirSync','Account','closed','closedAt','disposition','out','direction','renderFile','views','transcript-','.pdf','Sms','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','fullname','TagIds','forEach','Tags','push','catch','SmsInteraction','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','sms_interactions','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?'];(function(_0x172298,_0x542449){var _0x44856d=function(_0xa648ba){while(--_0xa648ba){_0x172298['push'](_0x172298['shift']());}};_0x44856d(++_0x542449);}(_0x759d,0x74));var _0xd759=function(_0x88ba28,_0x554d72){_0x88ba28=_0x88ba28-0x0;var _0x8aed57=_0x759d[_0x88ba28];return _0x8aed57;};'use strict';var emlformat=require(_0xd759('0x0'));var rimraf=require(_0xd759('0x1'));var zipdir=require(_0xd759('0x2'));var jsonpatch=require(_0xd759('0x3'));var rp=require(_0xd759('0x4'));var moment=require(_0xd759('0x5'));var BPromise=require(_0xd759('0x6'));var Mustache=require(_0xd759('0x7'));var util=require('util');var path=require(_0xd759('0x8'));var sox=require('sox');var csv=require(_0xd759('0x9'));var ejs=require(_0xd759('0xa'));var fs=require('fs');var fs_extra=require(_0xd759('0xb'));var _=require('lodash');var squel=require(_0xd759('0xc'));var crypto=require(_0xd759('0xd'));var jsforce=require(_0xd759('0xe'));var deskjs=require(_0xd759('0xf'));var toCsv=require(_0xd759('0x9'));var querystring=require(_0xd759('0x10'));var Papa=require(_0xd759('0x11'));var Redis=require(_0xd759('0x12'));var authService=require(_0xd759('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd759('0x14'));var pdf=require(_0xd759('0x15'));var hardwareService=require(_0xd759('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd759('0x17'));var licenseUtil=require(_0xd759('0x18'));var db=require('../../mysqldb')['db'];config[_0xd759('0x19')]=_[_0xd759('0x1a')](config[_0xd759('0x19')],{'host':_0xd759('0x1b'),'port':0x18eb});var socket=require(_0xd759('0x1c'))(new Redis(config[_0xd759('0x19')]));require('./smsInteraction.socket')[_0xd759('0x1d')](socket);function respondWithStatusCode(_0x1d6028,_0x7f4283){_0x7f4283=_0x7f4283||0xcc;return function(_0x247fc9){if(_0x247fc9){return _0x1d6028[_0xd759('0x1e')](_0x7f4283);}return _0x1d6028[_0xd759('0x1f')](_0x7f4283)[_0xd759('0x20')]();};}function respondWithResult(_0x2a7341,_0x110959){_0x110959=_0x110959||0xc8;return function(_0x136e2f){if(_0x136e2f){return _0x2a7341[_0xd759('0x1f')](_0x110959)['json'](_0x136e2f);}};}function respondWithFilteredResult(_0x34bb35,_0x1242ba){return function(_0x15f52d){if(_0x15f52d){var _0x34bb84=typeof _0x1242ba[_0xd759('0x21')]===_0xd759('0x22')&&typeof _0x1242ba['limit']===_0xd759('0x22');var _0x20759a=_0x15f52d[_0xd759('0x23')];var _0x3f7c3f=_0x34bb84?0x0:_0x1242ba[_0xd759('0x21')];var _0x47081e=_0x34bb84?_0x15f52d[_0xd759('0x23')]:_0x1242ba[_0xd759('0x21')]+_0x1242ba['limit'];var _0x4b9194;if(_0x47081e>=_0x20759a){_0x47081e=_0x20759a;_0x4b9194=0xc8;}else{_0x4b9194=0xce;}_0x34bb35['status'](_0x4b9194);return _0x34bb35[_0xd759('0x24')]('Content-Range',_0x3f7c3f+'-'+_0x47081e+'/'+_0x20759a)['json'](_0x15f52d);}return null;};}function patchUpdates(_0x38915e){return function(_0x2b2b1b){try{jsonpatch[_0xd759('0x25')](_0x2b2b1b,_0x38915e,!![]);}catch(_0x5c2aa3){return BPromise[_0xd759('0x26')](_0x5c2aa3);}return _0x2b2b1b[_0xd759('0x27')]();};}function saveUpdates(_0x33242d,_0x3a9761){return function(_0x5a90c2){if(_0x5a90c2){return _0x5a90c2[_0xd759('0x28')](_0x33242d)['then'](function(_0x21e0de){return _0x21e0de;});}return null;};}function removeEntity(_0x13998f,_0x57f175){return function(_0x1d3ed5){if(_0x1d3ed5){return _0x1d3ed5[_0xd759('0x29')]()[_0xd759('0x2a')](function(){_0x13998f['status'](0xcc)[_0xd759('0x20')]();});}};}function handleEntityNotFound(_0x1f0137,_0x322b58){return function(_0x567a8b){if(!_0x567a8b){_0x1f0137[_0xd759('0x1e')](0x194);}return _0x567a8b;};}function handleError(_0x510cad,_0x40ecc4){_0x40ecc4=_0x40ecc4||0x1f4;return function(_0x5d173f){logger[_0xd759('0x2b')](_0x5d173f[_0xd759('0x2c')]);if(_0x5d173f[_0xd759('0x2d')]){delete _0x5d173f[_0xd759('0x2d')];}_0x510cad[_0xd759('0x1f')](_0x40ecc4)[_0xd759('0x2e')](_0x5d173f);};}function getInteractionUsers(_0x56570e,_0x518d3a){return new BPromise(function(_0x51f64a,_0x220c69){try{if(_0x518d3a[_0x56570e['id']]){_0x56570e['Users']=_[_0xd759('0x2f')](_0x518d3a[_0x56570e['id']],function(_0x21d5a1){return{'id':_0x21d5a1['id'],'fullname':_0x21d5a1[_0xd759('0x30')]};});}}catch(_0x1835d0){_0x220c69(_0x1835d0);}_0x51f64a(_0x56570e);});}function getInteractionTags(_0x478b1b,_0xc82de2){return new BPromise(function(_0x18a2a7,_0x3e1bb9){try{if(_0x478b1b[_0xd759('0x31')]){_0x478b1b['Tags']=[];_0x478b1b[_0xd759('0x31')]['split'](',')[_0xd759('0x32')](function(_0x81867f){_0x478b1b[_0xd759('0x33')][_0xd759('0x34')](_0xc82de2[_0x81867f]);});}delete _0x478b1b[_0xd759('0x31')];}catch(_0x363e9c){_0x3e1bb9(_0x363e9c);}_0x18a2a7(_0x478b1b);});}function updateSmsInteraction(_0xaed6bc,_0x52e19a,_0x4577e3){return new BPromise(function(_0xc733a6,_0xb480a9){return getInteractionUsers(_0xaed6bc,_0x4577e3)['then'](function(_0x1cc4dc){return getInteractionTags(_0x1cc4dc,_0x52e19a);})[_0xd759('0x2a')](function(_0xd11c70){_0xc733a6(_0xd11c70);})[_0xd759('0x35')](function(_0x61cd31){_0xb480a9(_0x61cd31);});});}exports['index']=function(_0x795089,_0x3f6a54){var _0x4a78b3={},_0x5e4d69={},_0x8330bb={'count':0x0,'rows':[]};var _0x49a66b=_[_0xd759('0x2f')](db[_0xd759('0x36')][_0xd759('0x37')],function(_0x17ef07){return{'name':_0x17ef07[_0xd759('0x38')],'type':_0x17ef07['type'][_0xd759('0x39')]};});_0x5e4d69['model']=_[_0xd759('0x2f')](_0x49a66b,_0xd759('0x2d'));_0x5e4d69[_0xd759('0x3a')]=_[_0xd759('0x3b')](_0x795089[_0xd759('0x3a')]);_0x5e4d69[_0xd759('0x3c')]=_['intersection'](_0x5e4d69[_0xd759('0x3d')],_0x5e4d69[_0xd759('0x3a')]);_0x4a78b3[_0xd759('0x3e')]=_[_0xd759('0x3f')](_0x5e4d69[_0xd759('0x3d')],qs[_0xd759('0x40')](_0x795089['query'][_0xd759('0x40')]));_0x4a78b3[_0xd759('0x3e')]=_0x4a78b3[_0xd759('0x3e')]['length']?_0x4a78b3['attributes']:_0x5e4d69['model'];if(!_0x795089[_0xd759('0x3a')][_0xd759('0x41')](_0xd759('0x42'))){_0x4a78b3['limit']=qs['limit'](_0x795089['query'][_0xd759('0x43')]);_0x4a78b3['offset']=qs[_0xd759('0x21')](_0x795089[_0xd759('0x3a')][_0xd759('0x21')]);}_0x4a78b3[_0xd759('0x44')]=qs[_0xd759('0x45')](_0x795089['query'][_0xd759('0x45')]);_0x4a78b3[_0xd759('0x46')]=qs[_0xd759('0x3c')](_[_0xd759('0x47')](_0x795089[_0xd759('0x3a')],_0x5e4d69[_0xd759('0x3c')]),_0x49a66b);var _0x34182c=[];var _0x4af841=squel[_0xd759('0x48')]()[_0xd759('0x49')]('id')[_0xd759('0x49')](_0xd759('0x2d'))[_0xd759('0x49')](_0xd759('0x4a'))['from']('tools_tags');var _0x164ecb=squel[_0xd759('0x48')]()[_0xd759('0x49')](_0xd759('0x4b'))[_0xd759('0x49')](_0xd759('0x4c'))[_0xd759('0x49')](_0xd759('0x4d'))['from'](_0xd759('0x4e'),'ui')[_0xd759('0x4f')](_0xd759('0x50'),'u',_0xd759('0x51'));var _0x30a08d=squel['select']()[_0xd759('0x52')](_0xd759('0x53'),'i')[_0xd759('0x4f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xd759('0x50'),'o','o.id\x20=\x20i.UserId')[_0xd759('0x4f')](_0xd759('0x54'),'a',_0xd759('0x55'))['left_join'](_0xd759('0x56'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xd759('0x4f')](_0xd759('0x57'),'it',_0xd759('0x58'))[_0xd759('0x4f')](_0xd759('0x59'),'t',_0xd759('0x5a'));var _0x3dcc1d=squel[_0xd759('0x5b')]();var _0x4f6238=[];var _0x309f92=squel[_0xd759('0x5b')]();var _0x2a4473;if(_0x795089['query'][_0xd759('0x5c')]){_0x2a4473=as[_0xd759('0x5d')](_0x795089[_0xd759('0x3a')][_0xd759('0x5c')]);var _0x2b3240=_0x2a4473[_0xd759('0x5e')];for(var _0x440584=0x0;_0x440584<_0x2a4473[_0xd759('0x5f')]['length'];_0x440584++){var _0x250736=_0x2a4473[_0xd759('0x5f')][_0x440584];var _0x1dd459='i';var _0x4c890c=_[_0xd759('0x60')](_0x49a66b,[_0xd759('0x2d'),_0x250736['field']]);if(!_0x4c890c){switch(_0x250736[_0xd759('0x49')]){case _0xd759('0x61'):if(_0x250736[_0xd759('0x62')]==0x1){_0x30a08d[_0xd759('0x63')]('`'+_0x250736[_0xd759('0x49')]+_0xd759('0x64'));}else{_0x30a08d[_0xd759('0x63')]('`'+_0x250736[_0xd759('0x49')]+_0xd759('0x65'));}break;case _0xd759('0x66'):if(_0x250736[_0xd759('0x67')]===_0xd759('0x68')){if(_0x250736[_0xd759('0x62')][_0xd759('0x69')]('\x20')['length']>0x1){_0x3dcc1d[_0x2b3240](_0xd759('0x6a'),qs[_0xd759('0x6b')](_0x250736['value']),null);}else{var _0x2b4dac='%'+_0x250736[_0xd759('0x62')]+'%';_0x3dcc1d[_0x2b3240]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2b4dac,_0x2b4dac,_0x2b4dac);}}else{_0x4c890c=_['find'](_0x49a66b,[_0xd759('0x2d'),_0xd759('0x6c')]);_0x250736[_0xd759('0x49')]=_0xd759('0x6c');_0x381ae0=as['buildExpression'](_0x1dd459,_0x4c890c[_0xd759('0x6d')],_0x250736);_0x3dcc1d[_0x2b3240](_0x381ae0[_0xd759('0x6e')],_0x381ae0['value'][_0xd759('0x6f')],_0x381ae0[_0xd759('0x62')][_0xd759('0x20')]);}break;case'Tag':var _0x3aae6d=_0x250736[_0xd759('0x62')][_0xd759('0x69')](',')[_0xd759('0x2f')](function(_0x3c18ac){return Number(_0x3c18ac);});_0x3aae6d['forEach'](function(_0x3a84f0){_0x309f92['or'](_0xd759('0x70'),'%,'+_0x3a84f0+',%');});_0x4f6238=_['union'](_0x4f6238,_0x3aae6d);break;case _0xd759('0x71'):if(_0x250736[_0xd759('0x67')]===_0xd759('0x68')){_0x3dcc1d[_0x2b3240](_0xd759('0x72'),'%'+_0x250736['value']+'%',null);}else{_0x4c890c=_[_0xd759('0x60')](_0x49a66b,[_0xd759('0x2d'),_0xd759('0x73')]);_0x250736[_0xd759('0x49')]=_0xd759('0x73');_0x381ae0=as['buildExpression'](_0x1dd459,_0x4c890c[_0xd759('0x6d')],_0x250736);_0x3dcc1d[_0x2b3240](_0x381ae0['text'],_0x381ae0[_0xd759('0x62')][_0xd759('0x6f')],_0x381ae0[_0xd759('0x62')][_0xd759('0x20')]);}break;case'body':_0x381ae0=as[_0xd759('0x74')]('me',null,_0x250736);_0x3dcc1d[_0x2b3240](_0x381ae0[_0xd759('0x6e')],_0x381ae0[_0xd759('0x62')][_0xd759('0x6f')],_0x381ae0[_0xd759('0x62')][_0xd759('0x20')]);break;}}else{var _0x381ae0=as[_0xd759('0x74')](_0x1dd459,_0x4c890c[_0xd759('0x6d')],_0x250736);_0x3dcc1d[_0x2b3240](_0x381ae0['text'],_0x381ae0[_0xd759('0x62')][_0xd759('0x6f')],_0x381ae0[_0xd759('0x62')]['end']);}}}else{var _0x5c0053=_(_0x795089[_0xd759('0x3a')])[_0xd759('0x3b')]()[_0xd759('0x2f')](function(_0x43c023){return _['some'](_0x49a66b,['name',_0x43c023])?_0x43c023:undefined;})['compact']()[_0xd759('0x62')]();if(!_['isEmpty'](_0x5c0053)){_0x5c0053[_0xd759('0x32')](function(_0x40de15){if(_0x40de15==='SmsAccountId'){_0x30a08d[_0xd759('0x46')](_0xd759('0x75'),[]['concat'](_0x795089[_0xd759('0x3a')][_0x40de15]));}else if(_0x40de15==='createdAt'){var _0x2c1a58=JSON[_0xd759('0x76')](_0x795089['query'][_0x40de15])[_0xd759('0x77')];var _0x196446=JSON[_0xd759('0x76')](_0x795089[_0xd759('0x3a')][_0x40de15])[_0xd759('0x78')];_0x30a08d[_0xd759('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2c1a58,_0x196446);}else{if(_0x795089['query'][_0x40de15]==='null'){_0x30a08d[_0xd759('0x46')]('i.'+_0x40de15+'\x20IS\x20NULL');}else{_0x30a08d[_0xd759('0x46')]('i.'+_0x40de15+'\x20=\x20?',_0x795089[_0xd759('0x3a')][_0x40de15]);}}});}if(_0x795089['query'][_0xd759('0x79')]){if(_0x795089[_0xd759('0x3a')]['read']==0x1){_0x30a08d[_0xd759('0x63')]('`unreadMessages`\x20=\x200');}else{_0x30a08d['having']('`unreadMessages`\x20>\x200');}}if(_0x795089[_0xd759('0x3a')][_0xd759('0x7a')]){_0x4f6238=_[_0xd759('0x7b')](_0x795089['query'][_0xd759('0x7a')])?_0x795089[_0xd759('0x3a')][_0xd759('0x7a')]:new Array(_0x795089[_0xd759('0x3a')]['tag']);_0x4f6238[_0xd759('0x32')](function(_0x5935e4){_0x309f92['or'](_0xd759('0x70'),'%,'+_0x5935e4+',%');});}if(_0x795089[_0xd759('0x3a')][_0xd759('0x7c')]){var _0x12a7e0=_0x795089[_0xd759('0x3a')][_0xd759('0x7c')][_0xd759('0x7d')]('\x5c','\x5c\x5c')[_0xd759('0x7d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x12a7e0)){_0x3dcc1d['or'](_0xd759('0x7e'),_0x12a7e0+'%')['or']('i.phone\x20LIKE\x20?',_0x12a7e0+'%');}else{_0x3dcc1d['or'](_0xd759('0x7f'),qs[_0xd759('0x6b')](_0x12a7e0))['or'](_0xd759('0x80'),_0x12a7e0+'%');}}}_0x30a08d[_0xd759('0x46')](_0x3dcc1d);_0x30a08d[_0xd759('0x81')]('i.id');var _0x294c39={'type':db[_0xd759('0x82')]['QueryTypes'][_0xd759('0x83')],'raw':!![]};var _0x52bf78=_0x30a08d[_0xd759('0x84')]();_0x52bf78[_0xd759('0x49')](_0xd759('0x85'));_0x52bf78[_0xd759('0x49')](_0xd759('0x86'),'unreadMessages');if(_0x4a78b3['order']){_0x4a78b3[_0xd759('0x44')][_0xd759('0x32')](function(_0x53dbdd){var _0x589aee=_0x53dbdd[0x0]===_0xd759('0x87')?_0x53dbdd[0x0]:'i.'+_0x53dbdd[0x0];_0x30a08d['order'](_0x589aee,_0x53dbdd[0x1]===_0xd759('0x88')?![]:!![]);});}if(!_['isEmpty'](_0x4f6238)){_0x30a08d['having'](_0x309f92);_0x52bf78['where'](_0xd759('0x89'),_0x4f6238);}BPromise[_0xd759('0x8a')]()[_0xd759('0x2a')](function(){if(!_0x2a4473){if(_0x795089[_0xd759('0x3a')]['SmsAccountId'])return;_0x52bf78[_0xd759('0x46')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x30a08d[_0xd759('0x46')](_0xd759('0x8b'));return;}if(_0x795089[_0xd759('0x8c')][_0xd759('0x8d')]!==_0xd759('0x8e'))return;return _0x795089['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xd759('0x2a')](function(_0x8e3a37){if(_[_0xd759('0x8f')](_0x8e3a37)){_0x52bf78[_0xd759('0x46')](_0xd759('0x90'));_0x30a08d[_0xd759('0x46')](_0xd759('0x90'));}else{_0x52bf78[_0xd759('0x46')](_0xd759('0x75'),_[_0xd759('0x2f')](_0x8e3a37,'id'));_0x30a08d[_0xd759('0x46')](_0xd759('0x75'),_[_0xd759('0x2f')](_0x8e3a37,'id'));}});})[_0xd759('0x2a')](function(){if(_0x795089[_0xd759('0x8c')][_0xd759('0x8d')]===_0xd759('0x8e')&&!_0x2a4473&&!_0x795089['query'][_0xd759('0x91')])return[];return db[_0xd759('0x92')][_0xd759('0x3a')](_0x52bf78['toString'](),_0x294c39);})[_0xd759('0x2a')](function(_0x237ae8){_0x8330bb[_0xd759('0x23')]=_0x237ae8['length'];if(_0x8330bb[_0xd759('0x23')]===0x0)return[];return db[_0xd759('0x92')][_0xd759('0x3a')](_0x4af841['toString'](),_0x294c39)['then'](function(_0x24dce7){_0x34182c=_[_0xd759('0x93')](_0x24dce7,'id');_0x294c39=_[_0xd759('0x94')](_0x294c39,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x795089['query'][_0xd759('0x40')]){_0x4a78b3['attributes'][_0xd759('0x32')](function(_0x4aa068){_0x30a08d[_0xd759('0x49')]('i.'+_0x4aa068);});}else{_0x30a08d[_0xd759('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd759('0x61'));_0x30a08d['field'](_0xd759('0x95'),_0xd759('0x96'));_0x30a08d[_0xd759('0x49')]('a.mandatoryDisposition',_0xd759('0x97'));_0x30a08d[_0xd759('0x49')](_0xd759('0x98'),_0xd759('0x87'));_0x30a08d[_0xd759('0x49')](_0xd759('0x99'));_0x30a08d['field']('c.firstName',_0xd759('0x9a'));_0x30a08d['field'](_0xd759('0x9b'),'Contact.lastName');_0x30a08d[_0xd759('0x49')](_0xd759('0x9c'),_0xd759('0x9d'));_0x30a08d['field'](_0xd759('0x9e'),'Contact.phone');_0x30a08d[_0xd759('0x49')](_0xd759('0x9f'),_0xd759('0xa0'));_0x30a08d['field'](_0xd759('0xa1'),'Contact.fax');_0x30a08d[_0xd759('0x49')](_0xd759('0xa2'),_0xd759('0xa3'));_0x30a08d[_0xd759('0x49')](_0xd759('0xa4'),_0xd759('0xa5'));_0x30a08d[_0xd759('0x49')](_0xd759('0xa6'),_0xd759('0x31'));}if(_0x4a78b3['limit'])_0x30a08d['limit'](_0x4a78b3[_0xd759('0x43')]);if(_0x4a78b3[_0xd759('0x21')])_0x30a08d['offset'](_0x4a78b3[_0xd759('0x21')]);return db[_0xd759('0x92')][_0xd759('0x3a')](_0x30a08d[_0xd759('0xa7')](),_0x294c39);})[_0xd759('0x2a')](function(_0x2ba36a){if(_0x2ba36a['length']>0x0)_0x164ecb['where'](_0xd759('0xa8'),_[_0xd759('0x2f')](_0x2ba36a,'id'));return db[_0xd759('0x92')]['query'](_0x164ecb[_0xd759('0xa7')](),_0x294c39)[_0xd759('0x2a')](function(_0x2a3b4c){var _0x1c5af7=_[_0xd759('0xa9')](_0x2a3b4c,_0xd759('0xaa'));var _0xc8d5b3=[];_0x2ba36a[_0xd759('0x32')](function(_0x455bd2){_0xc8d5b3[_0xd759('0x34')](updateSmsInteraction(_0x455bd2,_0x34182c,_0x1c5af7));});return BPromise[_0xd759('0xab')](_0xc8d5b3);});});})[_0xd759('0x2a')](function(_0x17ea74){_0x8330bb['rows']=_0x17ea74;return _0x8330bb;})[_0xd759('0x2a')](respondWithFilteredResult(_0x3f6a54,_0x4a78b3))['catch'](handleError(_0x3f6a54,null));};exports[_0xd759('0xac')]=function(_0x3e3c56,_0x514067){var _0x2e3cf7={'raw':![],'where':{'id':_0x3e3c56[_0xd759('0xad')]['id']}},_0x1cd6fc={};_0x1cd6fc[_0xd759('0x3d')]=_[_0xd759('0x3b')](db[_0xd759('0x36')][_0xd759('0x37')]);_0x1cd6fc[_0xd759('0x3a')]=_[_0xd759('0x3b')](_0x3e3c56[_0xd759('0x3a')]);_0x1cd6fc[_0xd759('0x3c')]=_['intersection'](_0x1cd6fc[_0xd759('0x3d')],_0x1cd6fc['query']);_0x2e3cf7[_0xd759('0x3e')]=_[_0xd759('0x3f')](_0x1cd6fc[_0xd759('0x3d')],qs[_0xd759('0x40')](_0x3e3c56[_0xd759('0x3a')]['fields']));_0x2e3cf7[_0xd759('0x3e')]=_0x2e3cf7[_0xd759('0x3e')][_0xd759('0xae')]?_0x2e3cf7[_0xd759('0x3e')]:_0x1cd6fc[_0xd759('0x3d')];if(_0x3e3c56[_0xd759('0x3a')]['includeAll']){_0x2e3cf7['include']=[{'all':!![]}];}_0x2e3cf7=_[_0xd759('0x94')]({},_0x2e3cf7,_0x3e3c56[_0xd759('0xaf')]);return db[_0xd759('0x36')][_0xd759('0x60')](_0x2e3cf7)[_0xd759('0x2a')](handleEntityNotFound(_0x514067,null))[_0xd759('0x2a')](respondWithResult(_0x514067,null))[_0xd759('0x35')](handleError(_0x514067,null));};exports[_0xd759('0xb0')]=function(_0x2baeb1,_0x26b7cd){return db[_0xd759('0x36')][_0xd759('0xb0')](_0x2baeb1['body'],{})[_0xd759('0x2a')](respondWithResult(_0x26b7cd,0xc9))[_0xd759('0x35')](handleError(_0x26b7cd,null));};exports[_0xd759('0x28')]=function(_0x4ccb2f,_0x3ee851){if(_0x4ccb2f['body']['id']){delete _0x4ccb2f[_0xd759('0xb1')]['id'];}return db[_0xd759('0x36')]['find']({'where':{'id':_0x4ccb2f[_0xd759('0xad')]['id']}})[_0xd759('0x2a')](handleEntityNotFound(_0x3ee851,null))[_0xd759('0x2a')](saveUpdates(_0x4ccb2f[_0xd759('0xb1')],null))[_0xd759('0x2a')](respondWithResult(_0x3ee851,null))[_0xd759('0x35')](handleError(_0x3ee851,null));};exports[_0xd759('0x29')]=function(_0x59d268,_0xc4212f){return db['SmsInteraction'][_0xd759('0x60')]({'where':{'id':_0x59d268[_0xd759('0xad')]['id']}})['then'](handleEntityNotFound(_0xc4212f,null))['then'](removeEntity(_0xc4212f,null))[_0xd759('0x35')](handleError(_0xc4212f,null));};exports['describe']=function(_0x4c0957,_0x267a20){return db[_0xd759('0x36')][_0xd759('0xb2')]()[_0xd759('0x2a')](respondWithResult(_0x267a20,null))[_0xd759('0x35')](handleError(_0x267a20,null));};exports[_0xd759('0xb3')]=function(_0x81b48d,_0x2f992c,_0x5b357b){return db['SmsMessage'][_0xd759('0x60')]({'where':{'id':_0x81b48d[_0xd759('0xad')]['id']}})[_0xd759('0x2a')](handleEntityNotFound(_0x2f992c,null))[_0xd759('0x2a')](function(_0x29daf8){if(_0x29daf8){return _0x29daf8[_0xd759('0xb3')](_0x81b48d[_0xd759('0xb1')][_0xd759('0xb4')],_[_0xd759('0xb5')](_0x81b48d[_0xd759('0xb1')],[_0xd759('0xb4'),'id'])||{});}})[_0xd759('0x2a')](respondWithResult(_0x2f992c,null))[_0xd759('0x35')](handleError(_0x2f992c,null));};exports[_0xd759('0xb6')]=function(_0x1c7888,_0x4e2841,_0x44b1c3){var _0xd9b2d3={'raw':![],'where':{}};var _0x523108={};var _0x57782c={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x1c7888[_0xd759('0xad')]['id']}})['then'](handleEntityNotFound(_0x4e2841,null))[_0xd759('0x2a')](function(_0x530aa2){if(_0x530aa2){_0x523108[_0xd759('0x3d')]=_[_0xd759('0x3b')](db['SmsMessage'][_0xd759('0x37')]);_0x523108[_0xd759('0x3a')]=_['keys'](_0x1c7888[_0xd759('0x3a')]);_0x523108[_0xd759('0x3c')]=_[_0xd759('0x3f')](_0x523108['model'],_0x523108[_0xd759('0x3a')]);_0xd9b2d3[_0xd759('0x3e')]=_[_0xd759('0x3f')](_0x523108[_0xd759('0x3d')],qs[_0xd759('0x40')](_0x1c7888[_0xd759('0x3a')][_0xd759('0x40')]));_0xd9b2d3[_0xd759('0x3e')]=_0xd9b2d3[_0xd759('0x3e')]['length']?_0xd9b2d3[_0xd759('0x3e')]:_0x523108['model'];if(!_0x1c7888[_0xd759('0x3a')][_0xd759('0x41')](_0xd759('0x42'))){_0xd9b2d3[_0xd759('0x43')]=qs['limit'](_0x1c7888[_0xd759('0x3a')][_0xd759('0x43')]);_0xd9b2d3[_0xd759('0x21')]=qs['offset'](_0x1c7888[_0xd759('0x3a')][_0xd759('0x21')]);}_0xd9b2d3['order']=qs['sort'](_0x1c7888[_0xd759('0x3a')]['sort']);_0xd9b2d3[_0xd759('0x46')]=qs[_0xd759('0x3c')](_['pick'](_0x1c7888[_0xd759('0x3a')],_0x523108['filters']));_0xd9b2d3[_0xd759('0x46')][_0xd759('0xaa')]=_0x530aa2['id'];if(_0x1c7888['query'][_0xd759('0x7c')]){_0xd9b2d3[_0xd759('0x46')]=_[_0xd759('0x94')](_0xd9b2d3['where'],{'$or':_[_0xd759('0x2f')](_0xd9b2d3[_0xd759('0x3e')],function(_0x333e34){var _0xf6547c={};_0xf6547c[_0x333e34]={'$like':'%'+_0x1c7888[_0xd759('0x3a')][_0xd759('0x7c')]+'%'};return _0xf6547c;})});}if(_0x1c7888['query'][_0xd759('0x77')]){var _0x45a6dc=_0x1c7888[_0xd759('0x3a')][_0xd759('0x77')][_0xd759('0x69')](',');var _0x252065={};_0x252065[_0x45a6dc[0x0]]={'$gte':moment(_0x45a6dc[0x1])[_0xd759('0xb7')](_0xd759('0xb8'))};_0xd9b2d3['where']=_[_0xd759('0x94')](_0xd9b2d3['where'],_0x252065);}_0xd9b2d3=_[_0xd759('0x94')]({},_0xd9b2d3,_0x1c7888[_0xd759('0xaf')]);return db[_0xd759('0xb9')][_0xd759('0x23')]({'where':_0xd9b2d3[_0xd759('0x46')]})['then'](function(_0x581f90){_0x57782c[_0xd759('0x23')]=_0x581f90;if(_0x1c7888[_0xd759('0x3a')][_0xd759('0xba')]){_0xd9b2d3[_0xd759('0xbb')]=[{'all':!![]}];}return db['SmsMessage'][_0xd759('0xbc')](_0xd9b2d3);})[_0xd759('0x2a')](function(_0x368414){_0x57782c[_0xd759('0xbd')]=_0x368414;return _0x57782c;});}})[_0xd759('0x2a')](respondWithFilteredResult(_0x4e2841,_0xd9b2d3))[_0xd759('0x35')](handleError(_0x4e2841,null));};exports[_0xd759('0xbe')]=function(_0x1f93b7,_0x424d1d,_0x24739b){return db[_0xd759('0x36')][_0xd759('0x60')]({'where':{'id':_0x1f93b7[_0xd759('0xad')]['id']}})[_0xd759('0x2a')](handleEntityNotFound(_0x424d1d,null))[_0xd759('0x2a')](function(_0x4d334b){if(_0x4d334b){return _0x4d334b[_0xd759('0xbf')](_0x1f93b7[_0xd759('0xb1')]['ids'],_[_0xd759('0xb5')](_0x1f93b7[_0xd759('0xb1')],[_0xd759('0xb4'),'id'])||{})[_0xd759('0xc0')](function(){return db[_0xd759('0xc1')][_0xd759('0xbc')]({'attributes':['id',_0xd759('0x2d'),_0xd759('0x4a')],'where':{'id':_0x1f93b7[_0xd759('0xb1')][_0xd759('0xb4')]}});})[_0xd759('0x2a')](function(_0x25931a){socket[_0xd759('0xc2')](_0xd759('0xc3'),{'id':Number(_0x1f93b7[_0xd759('0xad')]['id']),'tags':_0x25931a||[]});return{'id':Number(_0x1f93b7['params']['id']),'tags':_0x25931a||[]};});}})[_0xd759('0x2a')](respondWithResult(_0x424d1d,null))[_0xd759('0x35')](handleError(_0x424d1d,null));};exports[_0xd759('0xc4')]=function(_0x47162e,_0x321a85,_0x29e18f){return db[_0xd759('0x36')][_0xd759('0x60')]({'where':{'id':_0x47162e[_0xd759('0xad')]['id']}})['then'](handleEntityNotFound(_0x321a85,null))[_0xd759('0x2a')](function(_0x1f0233){if(_0x1f0233){return _0x1f0233['removeTags'](_0x47162e[_0xd759('0x3a')][_0xd759('0xb4')]);}})[_0xd759('0x2a')](respondWithStatusCode(_0x321a85,null))[_0xd759('0x35')](handleError(_0x321a85,null));};exports[_0xd759('0xc5')]=function(_0x3c9532,_0x157b87){var _0x44519c=moment()[_0xd759('0xc6')]()[_0xd759('0xa7')]();var _0x2bcdc5=path['join'](config[_0xd759('0xc7')],_0xd759('0xc8'),_0xd759('0xc9'),'tmp');var _0x1cf7b9=path[_0xd759('0xca')](config['root'],_0xd759('0xc8'),_0xd759('0xc9'),_0xd759('0xcb'));var _0x2531b6=path[_0xd759('0xca')](_0x2bcdc5,_0x44519c);var _0x3af677=util[_0xd759('0xb7')](_0xd759('0xcc'),_0x3c9532[_0xd759('0xad')]['id'],_0x44519c);var _0x571250=path['join'](_0x2bcdc5,_0x3af677);var _0x26f3a7=[];_0x26f3a7[_0xd759('0x34')]({'model':db['User'],'as':_0xd759('0x71'),'attributes':['id',_0xd759('0x30')],'raw':!![]});_0x26f3a7[_0xd759('0x34')]({'model':db[_0xd759('0xcd')],'as':_0xd759('0x66'),'attributes':['id',_0xd759('0xce'),_0xd759('0xcf')],'raw':!![]});var _0x1fce0b=[{'model':db['SmsMessage'],'as':_0xd759('0xd0'),'attributes':['id',_0xd759('0xb1'),_0xd759('0xd1'),'direction',_0xd759('0xd2'),'read'],'include':_0x26f3a7}];_0x1fce0b[_0xd759('0x34')]({'model':db[_0xd759('0xd3')],'as':'Account','attributes':['id',_0xd759('0x2d')]});_0x1fce0b[_0xd759('0x34')]({'model':db[_0xd759('0x71')],'as':_0xd759('0xd4'),'attributes':['id',_0xd759('0x30')]});return db[_0xd759('0x36')]['find']({'where':{'id':_0x3c9532['params']['id']},'include':_0x1fce0b})[_0xd759('0x2a')](handleEntityNotFound(_0x157b87,null))['then'](function(_0x449119){if(_0x449119){var _0x372775=_0x449119[_0xd759('0xd5')]({'plain':!![]});fs[_0xd759('0xd6')](_0x2531b6);var _0x5581ac={'channel':'Sms','account':_0x372775[_0xd759('0xd7')]['name'],'agent':_0x372775[_0xd759('0xd4')]?_0x372775['Owner'][_0xd759('0x30')]:'N.A.','createdAt':moment(_0x372775[_0xd759('0xd1')])[_0xd759('0xb7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd759('0xa7')](),'closedAt':_0x372775[_0xd759('0xd8')]?moment(_0x372775[_0xd759('0xd9')])[_0xd759('0xb7')](_0xd759('0xb8'))[_0xd759('0xa7')]():'','disposition':_0x372775[_0xd759('0xda')],'messages':_(_0x372775[_0xd759('0xd0')])['filter']({'secret':![]})[_0xd759('0x2f')](function(_0x92efaa){return{'date':moment(_0x92efaa[_0xd759('0xd1')])[_0xd759('0xb7')](_0xd759('0xb8'))[_0xd759('0xa7')](),'sender':_0x92efaa['direction']===_0xd759('0xdb')?_0x92efaa[_0xd759('0x71')]?_0x92efaa[_0xd759('0x71')][_0xd759('0x30')]:'System':_0x92efaa['Contact'][_0xd759('0xce')]+(_0x92efaa[_0xd759('0x66')][_0xd759('0xcf')]?'\x20'+_0x92efaa[_0xd759('0x66')][_0xd759('0xcf')]:''),'body':_0x92efaa[_0xd759('0xb1')],'direction':_0x92efaa[_0xd759('0xdc')]===_0xd759('0xdb')?'A':'C','secret':_0x92efaa[_0xd759('0xd2')],'read':_0x92efaa[_0xd759('0x79')]};})[_0xd759('0x62')]()};return ejs[_0xd759('0xdd')](path[_0xd759('0xca')](config[_0xd759('0xc7')],_0xd759('0xc8'),_0xd759('0xde'),'downloadInteraction.ejs'),{'interaction':_0x5581ac})[_0xd759('0x2a')](function(_0x5122e0){var _0x110604=path[_0xd759('0xca')](_0x2531b6,_0xd759('0xdf')+_0x372775['id']+'-'+_0x44519c+_0xd759('0xe0'));var _0x32a955={'path':_0x110604,'channel':_0xd759('0xe1'),'interactionId':_0x372775['id']};return pdf[_0xd759('0xe2')](_0x5122e0,_0x32a955);})[_0xd759('0x2a')](function(){return new BPromise(function(_0x2c6e0c,_0x517402){zipdir(_0x2531b6,{'saveTo':_0x571250},function(_0x225d10,_0x3bd5cb){if(_0x225d10)return _0x517402(_0x225d10);return _0x2c6e0c(_0x3bd5cb);});})[_0xd759('0x2a')](function(){return new BPromise(function(_0x4fa7bf,_0x27570d){rimraf(_0x2531b6,function(_0x5d893c){if(_0x5d893c)_0x27570d(_0x5d893c);return _0x4fa7bf();});});})[_0xd759('0x2a')](function(){return _0x157b87[_0xd759('0xc5')](_0x571250,_0x3af677,function(_0xaaefcc){if(_0xaaefcc){console[_0xd759('0xe3')](_0xd759('0xe4'),_0xaaefcc);}else{fs['unlinkSync'](_0x571250);}});});});}else{return _0x157b87[_0xd759('0x1e')](0xc8);}})[_0xd759('0x35')](handleError(_0x157b87,null));}; \ No newline at end of file +var _0x0daa=['status','end','undefined','limit','offset','count','json','apply','reject','save','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','parseSearch','search','sqlOperator','conditions','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','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','isEmpty','i.SmsAccountId\x20IN\x20?','concat','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','SmsInteraction','rawAttributes','includeAll','include','options','create','addMessage','SmsMessage','ids','omit','getMessages','sort','$gte','format','findAll','addTags','spread','smsInteractionTags:save','removeTags','unix','join','root','files','tmp','server','CmContact','firstName','lastName','Messages','createdAt','secret','SmsAccount','Account','Owner','get','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','direction','out','renderFile','transcript-','download','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus'];(function(_0xe850e8,_0x3f0e95){var _0x2532ac=function(_0x36663e){while(--_0x36663e){_0xe850e8['push'](_0xe850e8['shift']());}};_0x2532ac(++_0x3f0e95);}(_0x0daa,0x1a9));var _0xa0da=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0daa[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa0da('0x0'));var jsonpatch=require(_0xa0da('0x1'));var rp=require(_0xa0da('0x2'));var moment=require(_0xa0da('0x3'));var BPromise=require(_0xa0da('0x4'));var Mustache=require(_0xa0da('0x5'));var util=require(_0xa0da('0x6'));var path=require(_0xa0da('0x7'));var sox=require('sox');var csv=require(_0xa0da('0x8'));var ejs=require(_0xa0da('0x9'));var fs=require('fs');var fs_extra=require(_0xa0da('0xa'));var _=require(_0xa0da('0xb'));var squel=require('squel');var crypto=require(_0xa0da('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa0da('0xd'));var toCsv=require(_0xa0da('0x8'));var querystring=require(_0xa0da('0xe'));var Papa=require(_0xa0da('0xf'));var Redis=require(_0xa0da('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa0da('0x11'));var as=require(_0xa0da('0x12'));var pdf=require(_0xa0da('0x13'));var hardwareService=require(_0xa0da('0x14'));var logger=require(_0xa0da('0x15'))(_0xa0da('0x16'));var utils=require(_0xa0da('0x17'));var config=require(_0xa0da('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0da('0x19'))['db'];config['redis']=_[_0xa0da('0x1a')](config['redis'],{'host':_0xa0da('0x1b'),'port':0x18eb});var socket=require(_0xa0da('0x1c'))(new Redis(config[_0xa0da('0x1d')]));require(_0xa0da('0x1e'))[_0xa0da('0x1f')](socket);function respondWithStatusCode(_0xb76864,_0x51928a){_0x51928a=_0x51928a||0xcc;return function(_0xcc6158){if(_0xcc6158){return _0xb76864[_0xa0da('0x20')](_0x51928a);}return _0xb76864[_0xa0da('0x21')](_0x51928a)[_0xa0da('0x22')]();};}function respondWithResult(_0x1aa558,_0x439d36){_0x439d36=_0x439d36||0xc8;return function(_0x3167e1){if(_0x3167e1){return _0x1aa558[_0xa0da('0x21')](_0x439d36)['json'](_0x3167e1);}};}function respondWithFilteredResult(_0x450d04,_0x34f11d){return function(_0x18db58){if(_0x18db58){var _0x82316c=typeof _0x34f11d['offset']===_0xa0da('0x23')&&typeof _0x34f11d[_0xa0da('0x24')]==='undefined';var _0xea2d2f=_0x18db58['count'];var _0x6ce85f=_0x82316c?0x0:_0x34f11d[_0xa0da('0x25')];var _0x289f66=_0x82316c?_0x18db58[_0xa0da('0x26')]:_0x34f11d['offset']+_0x34f11d[_0xa0da('0x24')];var _0x4e5256;if(_0x289f66>=_0xea2d2f){_0x289f66=_0xea2d2f;_0x4e5256=0xc8;}else{_0x4e5256=0xce;}_0x450d04[_0xa0da('0x21')](_0x4e5256);return _0x450d04['set']('Content-Range',_0x6ce85f+'-'+_0x289f66+'/'+_0xea2d2f)[_0xa0da('0x27')](_0x18db58);}return null;};}function patchUpdates(_0x3bceb2){return function(_0x5372ba){try{jsonpatch[_0xa0da('0x28')](_0x5372ba,_0x3bceb2,!![]);}catch(_0x1e1a9e){return BPromise[_0xa0da('0x29')](_0x1e1a9e);}return _0x5372ba[_0xa0da('0x2a')]();};}function saveUpdates(_0xce476f,_0x4f366e){return function(_0x2fce8d){if(_0x2fce8d){return _0x2fce8d[_0xa0da('0x2b')](_0xce476f)[_0xa0da('0x2c')](function(_0x34bb67){return _0x34bb67;});}return null;};}function removeEntity(_0x280a52,_0x16298b){return function(_0xc54c00){if(_0xc54c00){return _0xc54c00[_0xa0da('0x2d')]()[_0xa0da('0x2c')](function(){_0x280a52['status'](0xcc)[_0xa0da('0x22')]();});}};}function handleEntityNotFound(_0x298e47,_0x52acdc){return function(_0x17555a){if(!_0x17555a){_0x298e47[_0xa0da('0x20')](0x194);}return _0x17555a;};}function handleError(_0x6c131b,_0x170508){_0x170508=_0x170508||0x1f4;return function(_0x51e40d){logger[_0xa0da('0x2e')](_0x51e40d['stack']);if(_0x51e40d[_0xa0da('0x2f')]){delete _0x51e40d[_0xa0da('0x2f')];}_0x6c131b['status'](_0x170508)[_0xa0da('0x30')](_0x51e40d);};}function getInteractionUsers(_0x59dac7,_0x5e8f38){return new BPromise(function(_0x398983,_0x39b7b8){try{if(_0x5e8f38[_0x59dac7['id']]){_0x59dac7[_0xa0da('0x31')]=_[_0xa0da('0x32')](_0x5e8f38[_0x59dac7['id']],function(_0x15f328){return{'id':_0x15f328['id'],'fullname':_0x15f328[_0xa0da('0x33')]};});}}catch(_0x5f3214){_0x39b7b8(_0x5f3214);}_0x398983(_0x59dac7);});}function getInteractionTags(_0xc0ed6f,_0xf80d43){return new BPromise(function(_0x5684bc,_0x4d0d71){try{if(_0xc0ed6f[_0xa0da('0x34')]){_0xc0ed6f[_0xa0da('0x35')]=[];_0xc0ed6f[_0xa0da('0x34')][_0xa0da('0x36')](',')[_0xa0da('0x37')](function(_0x20e5a2){_0xc0ed6f['Tags'][_0xa0da('0x38')](_0xf80d43[_0x20e5a2]);});}delete _0xc0ed6f[_0xa0da('0x34')];}catch(_0x470ffa){_0x4d0d71(_0x470ffa);}_0x5684bc(_0xc0ed6f);});}function updateSmsInteraction(_0x582279,_0x4d3f2d,_0x468028){return new BPromise(function(_0x46fdbc,_0xc23a53){return getInteractionUsers(_0x582279,_0x468028)[_0xa0da('0x2c')](function(_0x2cb5d0){return getInteractionTags(_0x2cb5d0,_0x4d3f2d);})[_0xa0da('0x2c')](function(_0x58fba){_0x46fdbc(_0x58fba);})[_0xa0da('0x39')](function(_0x32d466){_0xc23a53(_0x32d466);});});}exports[_0xa0da('0x3a')]=function(_0x5157ef,_0x33bb39){var _0x5a2ab0={},_0x10edfa={},_0x49a37e={'count':0x0,'rows':[]};var _0x1ee4e9=_['map'](db['SmsInteraction']['rawAttributes'],function(_0x5bbb76){return{'name':_0x5bbb76[_0xa0da('0x3b')],'type':_0x5bbb76['type'][_0xa0da('0x3c')]};});_0x10edfa[_0xa0da('0x3d')]=_['map'](_0x1ee4e9,'name');_0x10edfa[_0xa0da('0x3e')]=_['keys'](_0x5157ef[_0xa0da('0x3e')]);_0x10edfa['filters']=_[_0xa0da('0x3f')](_0x10edfa[_0xa0da('0x3d')],_0x10edfa['query']);_0x5a2ab0[_0xa0da('0x40')]=_[_0xa0da('0x3f')](_0x10edfa[_0xa0da('0x3d')],qs[_0xa0da('0x41')](_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x41')]));_0x5a2ab0['attributes']=_0x5a2ab0[_0xa0da('0x40')][_0xa0da('0x42')]?_0x5a2ab0['attributes']:_0x10edfa['model'];if(!_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x43')](_0xa0da('0x44'))){_0x5a2ab0['limit']=qs[_0xa0da('0x24')](_0x5157ef[_0xa0da('0x3e')]['limit']);_0x5a2ab0[_0xa0da('0x25')]=qs[_0xa0da('0x25')](_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x25')]);}_0x5a2ab0[_0xa0da('0x45')]=qs['sort'](_0x5157ef[_0xa0da('0x3e')]['sort']);_0x5a2ab0[_0xa0da('0x46')]=qs['filters'](_[_0xa0da('0x47')](_0x5157ef[_0xa0da('0x3e')],_0x10edfa[_0xa0da('0x48')]),_0x1ee4e9);var _0x4b874a=[];var _0x5df882=squel[_0xa0da('0x49')]()[_0xa0da('0x4a')]('id')[_0xa0da('0x4a')](_0xa0da('0x2f'))[_0xa0da('0x4a')](_0xa0da('0x4b'))['from'](_0xa0da('0x4c'));var _0x517050=squel[_0xa0da('0x49')]()[_0xa0da('0x4a')](_0xa0da('0x4d'))[_0xa0da('0x4a')](_0xa0da('0x4e'))[_0xa0da('0x4a')](_0xa0da('0x4f'))['from']('user_has_sms_interactions','ui')['left_join'](_0xa0da('0x50'),'u',_0xa0da('0x51'));var _0xc599d=squel[_0xa0da('0x49')]()['from'](_0xa0da('0x52'),'i')[_0xa0da('0x53')](_0xa0da('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xa0da('0x50'),'o',_0xa0da('0x55'))[_0xa0da('0x53')](_0xa0da('0x56'),'a','a.id\x20=\x20i.SmsAccountId')[_0xa0da('0x53')](_0xa0da('0x57'),'me',_0xa0da('0x58'))[_0xa0da('0x53')](_0xa0da('0x59'),'it',_0xa0da('0x5a'))[_0xa0da('0x53')](_0xa0da('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x48bdd9=squel['expr']();var _0x337294=[];var _0xabfbe7=squel['expr']();var _0x31822c;if(_0x5157ef[_0xa0da('0x3e')]['search']){_0x31822c=as[_0xa0da('0x5b')](_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x5c')]);var _0x49907a=_0x31822c[_0xa0da('0x5d')];for(var _0x1e0428=0x0;_0x1e0428<_0x31822c[_0xa0da('0x5e')]['length'];_0x1e0428++){var _0x1a2853=_0x31822c[_0xa0da('0x5e')][_0x1e0428];var _0x1d1912='i';var _0x21f7e3=_['find'](_0x1ee4e9,[_0xa0da('0x2f'),_0x1a2853[_0xa0da('0x4a')]]);if(!_0x21f7e3){switch(_0x1a2853[_0xa0da('0x4a')]){case _0xa0da('0x5f'):if(_0x1a2853[_0xa0da('0x60')]==0x1){_0xc599d[_0xa0da('0x61')]('`'+_0x1a2853['field']+_0xa0da('0x62'));}else{_0xc599d[_0xa0da('0x61')]('`'+_0x1a2853[_0xa0da('0x4a')]+_0xa0da('0x63'));}break;case _0xa0da('0x64'):if(_0x1a2853[_0xa0da('0x65')]==='$substring'){if(_0x1a2853[_0xa0da('0x60')][_0xa0da('0x36')]('\x20')[_0xa0da('0x42')]>0x1){_0x48bdd9[_0x49907a](_0xa0da('0x66'),qs[_0xa0da('0x67')](_0x1a2853[_0xa0da('0x60')]),null);}else{var _0x4340b7='%'+_0x1a2853[_0xa0da('0x60')]+'%';_0x48bdd9[_0x49907a](_0xa0da('0x68'),_0x4340b7,_0x4340b7,_0x4340b7);}}else{_0x21f7e3=_['find'](_0x1ee4e9,[_0xa0da('0x2f'),_0xa0da('0x69')]);_0x1a2853[_0xa0da('0x4a')]='ContactId';_0x49f065=as[_0xa0da('0x6a')](_0x1d1912,_0x21f7e3[_0xa0da('0x6b')],_0x1a2853);_0x48bdd9[_0x49907a](_0x49f065[_0xa0da('0x6c')],_0x49f065['value'][_0xa0da('0x6d')],_0x49f065[_0xa0da('0x60')][_0xa0da('0x22')]);}break;case _0xa0da('0x6e'):var _0x77796b=_0x1a2853['value']['split'](',')[_0xa0da('0x32')](function(_0xa82b91){return Number(_0xa82b91);});_0x77796b['forEach'](function(_0x2b1905){_0xabfbe7['or'](_0xa0da('0x6f'),'%,'+_0x2b1905+',%');});_0x337294=_[_0xa0da('0x70')](_0x337294,_0x77796b);break;case _0xa0da('0x71'):if(_0x1a2853['operator']===_0xa0da('0x72')){_0x48bdd9[_0x49907a](_0xa0da('0x73'),'%'+_0x1a2853['value']+'%',null);}else{_0x21f7e3=_[_0xa0da('0x74')](_0x1ee4e9,[_0xa0da('0x2f'),_0xa0da('0x75')]);_0x1a2853[_0xa0da('0x4a')]=_0xa0da('0x75');_0x49f065=as[_0xa0da('0x6a')](_0x1d1912,_0x21f7e3[_0xa0da('0x6b')],_0x1a2853);_0x48bdd9[_0x49907a](_0x49f065['text'],_0x49f065['value'][_0xa0da('0x6d')],_0x49f065[_0xa0da('0x60')][_0xa0da('0x22')]);}break;case _0xa0da('0x76'):_0x49f065=as['buildExpression']('me',null,_0x1a2853);_0x48bdd9[_0x49907a](_0x49f065[_0xa0da('0x6c')],_0x49f065[_0xa0da('0x60')][_0xa0da('0x6d')],_0x49f065[_0xa0da('0x60')][_0xa0da('0x22')]);break;}}else{var _0x49f065=as[_0xa0da('0x6a')](_0x1d1912,_0x21f7e3[_0xa0da('0x6b')],_0x1a2853);_0x48bdd9[_0x49907a](_0x49f065[_0xa0da('0x6c')],_0x49f065[_0xa0da('0x60')][_0xa0da('0x6d')],_0x49f065[_0xa0da('0x60')][_0xa0da('0x22')]);}}}else{var _0xf722ea=_(_0x5157ef[_0xa0da('0x3e')])[_0xa0da('0x77')]()[_0xa0da('0x32')](function(_0x2d23d3){return _[_0xa0da('0x78')](_0x1ee4e9,[_0xa0da('0x2f'),_0x2d23d3])?_0x2d23d3:undefined;})['compact']()[_0xa0da('0x60')]();if(!_[_0xa0da('0x79')](_0xf722ea)){_0xf722ea['forEach'](function(_0x3243b2){if(_0x3243b2==='SmsAccountId'){_0xc599d[_0xa0da('0x46')](_0xa0da('0x7a'),[][_0xa0da('0x7b')](_0x5157ef[_0xa0da('0x3e')][_0x3243b2]));}else if(_0x3243b2==='createdAt'){var _0x25f96a=JSON['parse'](_0x5157ef[_0xa0da('0x3e')][_0x3243b2])['$gte'];var _0xea7e0c=JSON['parse'](_0x5157ef['query'][_0x3243b2])[_0xa0da('0x7c')];_0xc599d['where'](_0xa0da('0x7d'),_0x25f96a,_0xea7e0c);}else{if(_0x5157ef[_0xa0da('0x3e')][_0x3243b2]===_0xa0da('0x7e')){_0xc599d[_0xa0da('0x46')]('i.'+_0x3243b2+_0xa0da('0x7f'));}else{_0xc599d[_0xa0da('0x46')]('i.'+_0x3243b2+'\x20=\x20?',_0x5157ef[_0xa0da('0x3e')][_0x3243b2]);}}});}if(_0x5157ef['query'][_0xa0da('0x80')]){if(_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x80')]==0x1){_0xc599d[_0xa0da('0x61')](_0xa0da('0x81'));}else{_0xc599d[_0xa0da('0x61')](_0xa0da('0x82'));}}if(_0x5157ef['query'][_0xa0da('0x83')]){_0x337294=_['isArray'](_0x5157ef['query']['tag'])?_0x5157ef['query'][_0xa0da('0x83')]:new Array(_0x5157ef[_0xa0da('0x3e')]['tag']);_0x337294[_0xa0da('0x37')](function(_0x3da696){_0xabfbe7['or'](_0xa0da('0x6f'),'%,'+_0x3da696+',%');});}if(_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x84')]){var _0x4a50fa=_0x5157ef['query'][_0xa0da('0x84')][_0xa0da('0x85')]('\x5c','\x5c\x5c')[_0xa0da('0x85')](/'/g,'\x27\x27');if(qs[_0xa0da('0x86')](_0x4a50fa)){_0x48bdd9['or'](_0xa0da('0x87'),_0x4a50fa+'%')['or'](_0xa0da('0x88'),_0x4a50fa+'%');}else{_0x48bdd9['or'](_0xa0da('0x89'),qs[_0xa0da('0x67')](_0x4a50fa))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4a50fa+'%');}}}_0xc599d[_0xa0da('0x46')](_0x48bdd9);_0xc599d['group'](_0xa0da('0x8a'));var _0x50c428={'type':db[_0xa0da('0x8b')][_0xa0da('0x8c')][_0xa0da('0x8d')],'raw':!![]};var _0x52e88a=_0xc599d[_0xa0da('0x8e')]();_0x52e88a[_0xa0da('0x4a')]('i.id');_0x52e88a['field'](_0xa0da('0x8f'),_0xa0da('0x5f'));if(_0x5a2ab0[_0xa0da('0x45')]){_0x5a2ab0[_0xa0da('0x45')][_0xa0da('0x37')](function(_0x471829){var _0x13a982=_0x471829[0x0]===_0xa0da('0x90')?_0x471829[0x0]:'i.'+_0x471829[0x0];_0xc599d[_0xa0da('0x45')](_0x13a982,_0x471829[0x1]===_0xa0da('0x91')?![]:!![]);});}if(!_[_0xa0da('0x79')](_0x337294)){_0xc599d[_0xa0da('0x61')](_0xabfbe7);_0x52e88a[_0xa0da('0x46')](_0xa0da('0x92'),_0x337294);}BPromise['resolve']()[_0xa0da('0x2c')](function(){if(!_0x31822c){if(_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x93')])return;_0x52e88a[_0xa0da('0x46')](_0xa0da('0x94'));_0xc599d['where'](_0xa0da('0x94'));return;}if(_0x5157ef[_0xa0da('0x95')][_0xa0da('0x96')]!==_0xa0da('0x97'))return;return _0x5157ef[_0xa0da('0x95')][_0xa0da('0x98')]({'attributes':['id'],'raw':!![]})[_0xa0da('0x2c')](function(_0x623513){if(_[_0xa0da('0x79')](_0x623513)){_0x52e88a[_0xa0da('0x46')](_0xa0da('0x99'));_0xc599d[_0xa0da('0x46')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x52e88a[_0xa0da('0x46')](_0xa0da('0x7a'),_[_0xa0da('0x32')](_0x623513,'id'));_0xc599d['where']('i.SmsAccountId\x20IN\x20?',_[_0xa0da('0x32')](_0x623513,'id'));}});})[_0xa0da('0x2c')](function(){if(_0x5157ef['user'][_0xa0da('0x96')]==='agent'&&!_0x31822c&&!_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x93')])return[];return db['sequelize'][_0xa0da('0x3e')](_0x52e88a['toString'](),_0x50c428);})['then'](function(_0xcbf59c){_0x49a37e[_0xa0da('0x26')]=_0xcbf59c['length'];if(_0x49a37e[_0xa0da('0x26')]===0x0)return[];return db[_0xa0da('0x9a')]['query'](_0x5df882['toString'](),_0x50c428)[_0xa0da('0x2c')](function(_0x8afe24){_0x4b874a=_[_0xa0da('0x9b')](_0x8afe24,'id');_0x50c428=_[_0xa0da('0x9c')](_0x50c428,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5157ef[_0xa0da('0x3e')][_0xa0da('0x41')]){_0x5a2ab0[_0xa0da('0x40')]['forEach'](function(_0x5d790b){_0xc599d[_0xa0da('0x4a')]('i.'+_0x5d790b);});}else{_0xc599d['field'](_0xa0da('0x8f'),'unreadMessages');_0xc599d['field'](_0xa0da('0x9d'),_0xa0da('0x9e'));_0xc599d[_0xa0da('0x4a')](_0xa0da('0x9f'),_0xa0da('0xa0'));_0xc599d[_0xa0da('0x4a')](_0xa0da('0xa1'),'contactName');_0xc599d[_0xa0da('0x4a')](_0xa0da('0xa2'));_0xc599d[_0xa0da('0x4a')](_0xa0da('0xa3'),'Contact.firstName');_0xc599d[_0xa0da('0x4a')]('c.lastName','Contact.lastName');_0xc599d['field'](_0xa0da('0xa4'),'Contact.email');_0xc599d['field'](_0xa0da('0xa5'),'Contact.phone');_0xc599d['field'](_0xa0da('0xa6'),_0xa0da('0xa7'));_0xc599d[_0xa0da('0x4a')]('c.fax',_0xa0da('0xa8'));_0xc599d[_0xa0da('0x4a')](_0xa0da('0xa9'),_0xa0da('0xaa'));_0xc599d[_0xa0da('0x4a')](_0xa0da('0xab'),_0xa0da('0xac'));_0xc599d['field'](_0xa0da('0xad'),'TagIds');}if(_0x5a2ab0['limit'])_0xc599d[_0xa0da('0x24')](_0x5a2ab0[_0xa0da('0x24')]);if(_0x5a2ab0['offset'])_0xc599d[_0xa0da('0x25')](_0x5a2ab0[_0xa0da('0x25')]);return db['sequelize'][_0xa0da('0x3e')](_0xc599d[_0xa0da('0xae')](),_0x50c428);})['then'](function(_0x3f49f9){if(_0x3f49f9[_0xa0da('0x42')]>0x0)_0x517050['where'](_0xa0da('0xaf'),_['map'](_0x3f49f9,'id'));return db[_0xa0da('0x9a')][_0xa0da('0x3e')](_0x517050[_0xa0da('0xae')](),_0x50c428)[_0xa0da('0x2c')](function(_0x15b45c){var _0x398855=_[_0xa0da('0xb0')](_0x15b45c,_0xa0da('0xb1'));var _0x6db909=[];_0x3f49f9[_0xa0da('0x37')](function(_0x174aac){_0x6db909[_0xa0da('0x38')](updateSmsInteraction(_0x174aac,_0x4b874a,_0x398855));});return BPromise[_0xa0da('0xb2')](_0x6db909);});});})[_0xa0da('0x2c')](function(_0x5e5821){_0x49a37e['rows']=_0x5e5821;return _0x49a37e;})[_0xa0da('0x2c')](respondWithFilteredResult(_0x33bb39,_0x5a2ab0))[_0xa0da('0x39')](handleError(_0x33bb39,null));};exports[_0xa0da('0xb3')]=function(_0x3ba193,_0xf9b398){var _0x56dc0e={'raw':![],'where':{'id':_0x3ba193[_0xa0da('0xb4')]['id']}},_0x5acb2f={};_0x5acb2f['model']=_['keys'](db[_0xa0da('0xb5')][_0xa0da('0xb6')]);_0x5acb2f['query']=_[_0xa0da('0x77')](_0x3ba193[_0xa0da('0x3e')]);_0x5acb2f[_0xa0da('0x48')]=_[_0xa0da('0x3f')](_0x5acb2f[_0xa0da('0x3d')],_0x5acb2f['query']);_0x56dc0e['attributes']=_[_0xa0da('0x3f')](_0x5acb2f[_0xa0da('0x3d')],qs[_0xa0da('0x41')](_0x3ba193[_0xa0da('0x3e')][_0xa0da('0x41')]));_0x56dc0e[_0xa0da('0x40')]=_0x56dc0e[_0xa0da('0x40')][_0xa0da('0x42')]?_0x56dc0e['attributes']:_0x5acb2f[_0xa0da('0x3d')];if(_0x3ba193[_0xa0da('0x3e')][_0xa0da('0xb7')]){_0x56dc0e[_0xa0da('0xb8')]=[{'all':!![]}];}_0x56dc0e=_['merge']({},_0x56dc0e,_0x3ba193[_0xa0da('0xb9')]);return db[_0xa0da('0xb5')][_0xa0da('0x74')](_0x56dc0e)[_0xa0da('0x2c')](handleEntityNotFound(_0xf9b398,null))[_0xa0da('0x2c')](respondWithResult(_0xf9b398,null))['catch'](handleError(_0xf9b398,null));};exports['create']=function(_0x1c937b,_0x4e5514){return db[_0xa0da('0xb5')][_0xa0da('0xba')](_0x1c937b['body'],{})[_0xa0da('0x2c')](respondWithResult(_0x4e5514,0xc9))[_0xa0da('0x39')](handleError(_0x4e5514,null));};exports['update']=function(_0x14c0c6,_0x3f61f4){if(_0x14c0c6[_0xa0da('0x76')]['id']){delete _0x14c0c6[_0xa0da('0x76')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x14c0c6[_0xa0da('0xb4')]['id']}})[_0xa0da('0x2c')](handleEntityNotFound(_0x3f61f4,null))[_0xa0da('0x2c')](saveUpdates(_0x14c0c6[_0xa0da('0x76')],null))[_0xa0da('0x2c')](respondWithResult(_0x3f61f4,null))[_0xa0da('0x39')](handleError(_0x3f61f4,null));};exports[_0xa0da('0x2d')]=function(_0x12b2c2,_0x5c7aeb){return db[_0xa0da('0xb5')]['find']({'where':{'id':_0x12b2c2[_0xa0da('0xb4')]['id']}})[_0xa0da('0x2c')](handleEntityNotFound(_0x5c7aeb,null))['then'](removeEntity(_0x5c7aeb,null))[_0xa0da('0x39')](handleError(_0x5c7aeb,null));};exports['describe']=function(_0x4166c9,_0x4c8a53){return db['SmsInteraction']['describe']()[_0xa0da('0x2c')](respondWithResult(_0x4c8a53,null))[_0xa0da('0x39')](handleError(_0x4c8a53,null));};exports[_0xa0da('0xbb')]=function(_0x44f3d5,_0x3ab57f,_0x5745e2){return db[_0xa0da('0xbc')][_0xa0da('0x74')]({'where':{'id':_0x44f3d5['params']['id']}})[_0xa0da('0x2c')](handleEntityNotFound(_0x3ab57f,null))[_0xa0da('0x2c')](function(_0x323d8b){if(_0x323d8b){return _0x323d8b[_0xa0da('0xbb')](_0x44f3d5[_0xa0da('0x76')][_0xa0da('0xbd')],_[_0xa0da('0xbe')](_0x44f3d5['body'],[_0xa0da('0xbd'),'id'])||{});}})[_0xa0da('0x2c')](respondWithResult(_0x3ab57f,null))[_0xa0da('0x39')](handleError(_0x3ab57f,null));};exports[_0xa0da('0xbf')]=function(_0x258737,_0x5d5ee2,_0x13f305){var _0x161fdf={'raw':![],'where':{}};var _0x480c83={};var _0x414036={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x258737[_0xa0da('0xb4')]['id']}})[_0xa0da('0x2c')](handleEntityNotFound(_0x5d5ee2,null))[_0xa0da('0x2c')](function(_0x402fd8){if(_0x402fd8){_0x480c83[_0xa0da('0x3d')]=_[_0xa0da('0x77')](db[_0xa0da('0xbc')][_0xa0da('0xb6')]);_0x480c83[_0xa0da('0x3e')]=_[_0xa0da('0x77')](_0x258737[_0xa0da('0x3e')]);_0x480c83[_0xa0da('0x48')]=_[_0xa0da('0x3f')](_0x480c83[_0xa0da('0x3d')],_0x480c83['query']);_0x161fdf[_0xa0da('0x40')]=_['intersection'](_0x480c83[_0xa0da('0x3d')],qs[_0xa0da('0x41')](_0x258737[_0xa0da('0x3e')][_0xa0da('0x41')]));_0x161fdf[_0xa0da('0x40')]=_0x161fdf['attributes'][_0xa0da('0x42')]?_0x161fdf['attributes']:_0x480c83[_0xa0da('0x3d')];if(!_0x258737[_0xa0da('0x3e')]['hasOwnProperty'](_0xa0da('0x44'))){_0x161fdf[_0xa0da('0x24')]=qs[_0xa0da('0x24')](_0x258737['query']['limit']);_0x161fdf['offset']=qs['offset'](_0x258737[_0xa0da('0x3e')][_0xa0da('0x25')]);}_0x161fdf[_0xa0da('0x45')]=qs['sort'](_0x258737[_0xa0da('0x3e')][_0xa0da('0xc0')]);_0x161fdf['where']=qs[_0xa0da('0x48')](_[_0xa0da('0x47')](_0x258737['query'],_0x480c83['filters']));_0x161fdf[_0xa0da('0x46')][_0xa0da('0xb1')]=_0x402fd8['id'];if(_0x258737[_0xa0da('0x3e')][_0xa0da('0x84')]){_0x161fdf[_0xa0da('0x46')]=_[_0xa0da('0x9c')](_0x161fdf[_0xa0da('0x46')],{'$or':_[_0xa0da('0x32')](_0x161fdf['attributes'],function(_0x3a78fd){var _0x5adecb={};_0x5adecb[_0x3a78fd]={'$like':'%'+_0x258737['query'][_0xa0da('0x84')]+'%'};return _0x5adecb;})});}if(_0x258737[_0xa0da('0x3e')][_0xa0da('0xc1')]){var _0x3ef3a2=_0x258737[_0xa0da('0x3e')]['$gte'][_0xa0da('0x36')](',');var _0x4310fc={};_0x4310fc[_0x3ef3a2[0x0]]={'$gte':moment(_0x3ef3a2[0x1])[_0xa0da('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x161fdf['where']=_['merge'](_0x161fdf['where'],_0x4310fc);}_0x161fdf=_[_0xa0da('0x9c')]({},_0x161fdf,_0x258737[_0xa0da('0xb9')]);return db['SmsMessage'][_0xa0da('0x26')]({'where':_0x161fdf[_0xa0da('0x46')]})[_0xa0da('0x2c')](function(_0x5537cb){_0x414036[_0xa0da('0x26')]=_0x5537cb;if(_0x258737[_0xa0da('0x3e')][_0xa0da('0xb7')]){_0x161fdf[_0xa0da('0xb8')]=[{'all':!![]}];}return db[_0xa0da('0xbc')][_0xa0da('0xc3')](_0x161fdf);})[_0xa0da('0x2c')](function(_0x3f976b){_0x414036['rows']=_0x3f976b;return _0x414036;});}})[_0xa0da('0x2c')](respondWithFilteredResult(_0x5d5ee2,_0x161fdf))[_0xa0da('0x39')](handleError(_0x5d5ee2,null));};exports[_0xa0da('0xc4')]=function(_0x2a6bfc,_0x3bd043,_0x2349bc){return db['SmsInteraction'][_0xa0da('0x74')]({'where':{'id':_0x2a6bfc[_0xa0da('0xb4')]['id']}})[_0xa0da('0x2c')](handleEntityNotFound(_0x3bd043,null))[_0xa0da('0x2c')](function(_0x2cb95b){if(_0x2cb95b){return _0x2cb95b['setTags'](_0x2a6bfc['body'][_0xa0da('0xbd')],_['omit'](_0x2a6bfc[_0xa0da('0x76')],[_0xa0da('0xbd'),'id'])||{})[_0xa0da('0xc5')](function(){return db[_0xa0da('0x6e')][_0xa0da('0xc3')]({'attributes':['id','name',_0xa0da('0x4b')],'where':{'id':_0x2a6bfc['body'][_0xa0da('0xbd')]}});})[_0xa0da('0x2c')](function(_0x26fb24){socket['emit'](_0xa0da('0xc6'),{'id':Number(_0x2a6bfc['params']['id']),'tags':_0x26fb24||[]});return{'id':Number(_0x2a6bfc['params']['id']),'tags':_0x26fb24||[]};});}})['then'](respondWithResult(_0x3bd043,null))[_0xa0da('0x39')](handleError(_0x3bd043,null));};exports[_0xa0da('0xc7')]=function(_0x140a35,_0x2a67d7,_0x40604d){return db['SmsInteraction'][_0xa0da('0x74')]({'where':{'id':_0x140a35[_0xa0da('0xb4')]['id']}})['then'](handleEntityNotFound(_0x2a67d7,null))[_0xa0da('0x2c')](function(_0x127925){if(_0x127925){return _0x127925['removeTags'](_0x140a35[_0xa0da('0x3e')]['ids']);}})[_0xa0da('0x2c')](respondWithStatusCode(_0x2a67d7,null))['catch'](handleError(_0x2a67d7,null));};exports['download']=function(_0x19ad9f,_0x169caf){var _0x26eb67=moment()[_0xa0da('0xc8')]()[_0xa0da('0xae')]();var _0x3dbbce=path[_0xa0da('0xc9')](config[_0xa0da('0xca')],'server',_0xa0da('0xcb'),_0xa0da('0xcc'));var _0x57add1=path['join'](config[_0xa0da('0xca')],_0xa0da('0xcd'),_0xa0da('0xcb'),'attachments');var _0x39c85d=path[_0xa0da('0xc9')](_0x3dbbce,_0x26eb67);var _0x5551b8=util[_0xa0da('0xc2')]('transcript-%d-%s.zip',_0x19ad9f[_0xa0da('0xb4')]['id'],_0x26eb67);var _0x194fc1=path[_0xa0da('0xc9')](_0x3dbbce,_0x5551b8);var _0x42c40d=[];_0x42c40d[_0xa0da('0x38')]({'model':db['User'],'as':_0xa0da('0x71'),'attributes':['id',_0xa0da('0x33')],'raw':!![]});_0x42c40d[_0xa0da('0x38')]({'model':db[_0xa0da('0xce')],'as':_0xa0da('0x64'),'attributes':['id',_0xa0da('0xcf'),_0xa0da('0xd0')],'raw':!![]});var _0x3ad4d5=[{'model':db['SmsMessage'],'as':_0xa0da('0xd1'),'attributes':['id','body',_0xa0da('0xd2'),'direction',_0xa0da('0xd3'),_0xa0da('0x80')],'include':_0x42c40d}];_0x3ad4d5[_0xa0da('0x38')]({'model':db[_0xa0da('0xd4')],'as':_0xa0da('0xd5'),'attributes':['id','name']});_0x3ad4d5[_0xa0da('0x38')]({'model':db[_0xa0da('0x71')],'as':_0xa0da('0xd6'),'attributes':['id',_0xa0da('0x33')]});return db['SmsInteraction'][_0xa0da('0x74')]({'where':{'id':_0x19ad9f[_0xa0da('0xb4')]['id']},'include':_0x3ad4d5})['then'](handleEntityNotFound(_0x169caf,null))[_0xa0da('0x2c')](function(_0x4d2220){if(_0x4d2220){var _0x500a08=_0x4d2220[_0xa0da('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x39c85d);var _0x55cd92={'channel':_0xa0da('0xd8'),'account':_0x500a08['Account'][_0xa0da('0x2f')],'agent':_0x500a08['Owner']?_0x500a08[_0xa0da('0xd6')]['fullname']:_0xa0da('0xd9'),'createdAt':moment(_0x500a08['createdAt'])['format'](_0xa0da('0xda'))['toString'](),'closedAt':_0x500a08['closed']?moment(_0x500a08[_0xa0da('0xdb')])[_0xa0da('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x500a08[_0xa0da('0xdc')],'messages':_(_0x500a08[_0xa0da('0xd1')])[_0xa0da('0x84')]({'secret':![]})[_0xa0da('0x32')](function(_0x1e95d2){return{'date':moment(_0x1e95d2['createdAt'])[_0xa0da('0xc2')](_0xa0da('0xda'))[_0xa0da('0xae')](),'sender':_0x1e95d2[_0xa0da('0xdd')]===_0xa0da('0xde')?_0x1e95d2['User']?_0x1e95d2[_0xa0da('0x71')]['fullname']:'System':_0x1e95d2[_0xa0da('0x64')]['firstName']+(_0x1e95d2[_0xa0da('0x64')][_0xa0da('0xd0')]?'\x20'+_0x1e95d2[_0xa0da('0x64')][_0xa0da('0xd0')]:''),'body':_0x1e95d2[_0xa0da('0x76')],'direction':_0x1e95d2[_0xa0da('0xdd')]===_0xa0da('0xde')?'A':'C','secret':_0x1e95d2[_0xa0da('0xd3')],'read':_0x1e95d2['read']};})[_0xa0da('0x60')]()};return ejs[_0xa0da('0xdf')](path[_0xa0da('0xc9')](config['root'],_0xa0da('0xcd'),'views','downloadInteraction.ejs'),{'interaction':_0x55cd92})[_0xa0da('0x2c')](function(_0x4c8ddd){var _0x3a42b3=path['join'](_0x39c85d,_0xa0da('0xe0')+_0x500a08['id']+'-'+_0x26eb67+'.pdf');var _0x406e61={'path':_0x3a42b3,'channel':'Sms','interactionId':_0x500a08['id']};return pdf['createPdfFromHTML'](_0x4c8ddd,_0x406e61);})[_0xa0da('0x2c')](function(){return new BPromise(function(_0x30c062,_0x7aff8a){zipdir(_0x39c85d,{'saveTo':_0x194fc1},function(_0x28735f,_0x36f46a){if(_0x28735f)return _0x7aff8a(_0x28735f);return _0x30c062(_0x36f46a);});})[_0xa0da('0x2c')](function(){return new BPromise(function(_0x2a8fdc,_0x338a7c){rimraf(_0x39c85d,function(_0x1c9044){if(_0x1c9044)_0x338a7c(_0x1c9044);return _0x2a8fdc();});});})[_0xa0da('0x2c')](function(){return _0x169caf[_0xa0da('0xe1')](_0x194fc1,_0x5551b8,function(_0x1054e3){if(_0x1054e3){console[_0xa0da('0xe2')](_0xa0da('0xe3'),_0x1054e3);}else{fs[_0xa0da('0xe4')](_0x194fc1);}});});});}else{return _0x169caf[_0xa0da('0x20')](0xc8);}})[_0xa0da('0x39')](handleError(_0x169caf,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index bf8c5e9..e77f7fd 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 _0x2032=['Users','map','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','SmsInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x2032,0xd9));var _0x2203=function(_0x3f7fb3,_0x1e9293){_0x3f7fb3=_0x3f7fb3-0x0;var _0x520d93=_0x2032[_0x3f7fb3];return _0x520d93;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var SmsMessage=require(_0x2203('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2203('0x2')](0x0);var events={'afterCreate':_0x2203('0x3'),'afterUpdate':'update','afterDestroy':_0x2203('0x4')};function emitEvent(_0x880dcd){return function(_0x44ccfd,_0x201796,_0x3f7ba1){_0x44ccfd[_0x2203('0x5')]({'attributes':['id'],'raw':!![]})[_0x2203('0x6')](function(_0x2676aa){_0x44ccfd[_0x2203('0x7')](_0x2203('0x8'),_0x2676aa[_0x2203('0x9')](function(_0x5ecf9e){return{'id':_0x5ecf9e['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x44ccfd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2203('0x6')](function(_0x549908){_0x44ccfd[_0x2203('0x7')](_0x2203('0xa'),_0x549908[_0x2203('0xb')]);SmsInteractionEvents['emit'](_0x880dcd+':'+_0x44ccfd['id'],_0x44ccfd);SmsInteractionEvents[_0x2203('0xc')](_0x880dcd,_0x44ccfd);_0x3f7ba1(null);})['catch'](_0x3f7ba1(null));};}for(var e in events){if(events[_0x2203('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x2203('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0xf4f4=['findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0xa3e7c,_0x419ca4){_0xa3e7c=_0xa3e7c-0x0;var _0x56be84=_0xf4f4[_0xa3e7c];return _0x56be84;};'use strict';var EventEmitter=require(_0x4f4f('0x0'));var SmsInteraction=require(_0x4f4f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4f4f('0x1'))['db'][_0x4f4f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4f4f('0x3')](0x0);var events={'afterCreate':_0x4f4f('0x4'),'afterUpdate':_0x4f4f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a752b){return function(_0x593952,_0x3f274d,_0x132d5c){_0x593952[_0x4f4f('0x6')]({'attributes':['id'],'raw':!![]})[_0x4f4f('0x7')](function(_0x3c4877){_0x593952[_0x4f4f('0x8')](_0x4f4f('0x9'),_0x3c4877[_0x4f4f('0xa')](function(_0x48f6b9){return{'id':_0x48f6b9['id']};}));return SmsMessage[_0x4f4f('0xb')]({'where':{'SmsInteractionId':_0x593952['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4f('0x7')](function(_0x39e36b){_0x593952[_0x4f4f('0x8')](_0x4f4f('0xc'),_0x39e36b[_0x4f4f('0xd')]);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b+':'+_0x593952['id'],_0x593952);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b,_0x593952);_0x132d5c(null);})['catch'](_0x132d5c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4f4f('0xf')](e,emitEvent(event));}}module[_0x4f4f('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 0bcc602..63d2215 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 _0xb1d4=['changed','closed','closedAt','format','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions'];(function(_0x27a8b5,_0x3ceeac){var _0x5f0755=function(_0x568ff7){while(--_0x568ff7){_0x27a8b5['push'](_0x27a8b5['shift']());}};_0x5f0755(++_0x3ceeac);}(_0xb1d4,0x104));var _0x4b1d=function(_0x4dd943,_0x5f379e){_0x4dd943=_0x4dd943-0x0;var _0x4e06ee=_0xb1d4[_0x4dd943];return _0x4e06ee;};'use strict';var _=require('lodash');var util=require(_0x4b1d('0x0'));var logger=require('../../config/logger')(_0x4b1d('0x1'));var moment=require(_0x4b1d('0x2'));var BPromise=require(_0x4b1d('0x3'));var rp=require(_0x4b1d('0x4'));var fs=require('fs');var path=require(_0x4b1d('0x5'));var rimraf=require(_0x4b1d('0x6'));var config=require(_0x4b1d('0x7'));var attributes=require(_0x4b1d('0x8'));module['exports']=function(_0x185ac1,_0x3cccce){return _0x185ac1[_0x4b1d('0x9')](_0x4b1d('0xa'),attributes,{'tableName':_0x4b1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4fce33,_0x5e7660,_0x39b4ce){if(_0x4fce33[_0x4b1d('0xc')](_0x4b1d('0xd'))){_0x4fce33[_0x4b1d('0xe')]=moment()[_0x4b1d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x39b4ce(null,_0x4fce33);}}});}; \ No newline at end of file +var _0x3efc=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction'];(function(_0x29a64c,_0x775ec7){var _0x1f2395=function(_0x5ad378){while(--_0x5ad378){_0x29a64c['push'](_0x29a64c['shift']());}};_0x1f2395(++_0x775ec7);}(_0x3efc,0x1b8));var _0xc3ef=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3efc[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xc3ef('0x0'));var util=require(_0xc3ef('0x1'));var logger=require(_0xc3ef('0x2'))('api');var moment=require(_0xc3ef('0x3'));var BPromise=require('bluebird');var rp=require(_0xc3ef('0x4'));var fs=require('fs');var path=require(_0xc3ef('0x5'));var rimraf=require(_0xc3ef('0x6'));var config=require(_0xc3ef('0x7'));var attributes=require(_0xc3ef('0x8'));module['exports']=function(_0x24da5c,_0x527134){return _0x24da5c['define'](_0xc3ef('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c9459,_0x1e5a87,_0x88c07){if(_0x3c9459[_0xc3ef('0xa')](_0xc3ef('0xb'))){_0x3c9459[_0xc3ef('0xc')]=moment()[_0xc3ef('0xd')](_0xc3ef('0xe'));}_0x88c07(null,_0x3c9459);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a503cbd..76ed086 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 _0x71a6=['SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info'];(function(_0x142d3e,_0x353e86){var _0x493084=function(_0x14aa15){while(--_0x14aa15){_0x142d3e['push'](_0x142d3e['shift']());}};_0x493084(++_0x353e86);}(_0x71a6,0x1bb));var _0x671a=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x71a6[_0x53d172];return _0x1bd0a2;};'use strict';var _=require(_0x671a('0x0'));var util=require('util');var moment=require(_0x671a('0x1'));var BPromise=require(_0x671a('0x2'));var rs=require(_0x671a('0x3'));var fs=require('fs');var Redis=require(_0x671a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x671a('0x5'));var logger=require(_0x671a('0x6'))(_0x671a('0x7'));var config=require(_0x671a('0x8'));var jayson=require(_0x671a('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x671a('0xa')]=_[_0x671a('0xb')](config['redis'],{'host':_0x671a('0xc'),'port':0x18eb});var socket=require(_0x671a('0xd'))(new Redis(config['redis']));require(_0x671a('0xe'))[_0x671a('0xf')](socket);function respondWithRpcPromise(_0x23d8dd,_0x2421d8,_0x59913d){return new BPromise(function(_0xfb2155,_0x1ed513){return client[_0x671a('0x10')](_0x23d8dd,_0x59913d)[_0x671a('0x11')](function(_0x125a34){logger[_0x671a('0x12')](_0x671a('0x13'),_0x2421d8,_0x671a('0x14'));logger[_0x671a('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2421d8,_0x671a('0x14'),JSON[_0x671a('0x16')](_0x125a34));if(_0x125a34['error']){if(_0x125a34[_0x671a('0x17')][_0x671a('0x18')]===0x1f4){logger[_0x671a('0x17')](_0x671a('0x13'),_0x2421d8,_0x125a34[_0x671a('0x17')][_0x671a('0x19')]);return _0x1ed513(_0x125a34['error'][_0x671a('0x19')]);}logger[_0x671a('0x17')](_0x671a('0x13'),_0x2421d8,_0x125a34[_0x671a('0x17')]['message']);return _0xfb2155(_0x125a34[_0x671a('0x17')][_0x671a('0x19')]);}else{logger[_0x671a('0x12')](_0x671a('0x13'),_0x2421d8,_0x671a('0x14'));_0xfb2155(_0x125a34[_0x671a('0x1a')][_0x671a('0x19')]);}})[_0x671a('0x1b')](function(_0x406bd6){logger[_0x671a('0x17')](_0x671a('0x13'),_0x2421d8,_0x406bd6);_0x1ed513(_0x406bd6);});});}exports[_0x671a('0x1c')]=function(_0x13c8ac){var _0x2893a4=this;return new Promise(function(_0x3c457a,_0x4f314a){return db[_0x671a('0x1d')][_0x671a('0x1e')](_0x13c8ac[_0x671a('0x1f')],{'raw':_0x13c8ac[_0x671a('0x20')]?_0x13c8ac[_0x671a('0x20')][_0x671a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13c8ac[_0x671a('0x20')]?_0x13c8ac[_0x671a('0x20')][_0x671a('0x22')]||null:null,'attributes':_0x13c8ac[_0x671a('0x20')]?_0x13c8ac['options']['attributes']||null:null,'limit':_0x13c8ac[_0x671a('0x20')]?_0x13c8ac[_0x671a('0x20')][_0x671a('0x23')]||null:null})['then'](function(_0x5809b6){logger[_0x671a('0x12')](_0x671a('0x1c'),_0x13c8ac);logger[_0x671a('0x15')](_0x671a('0x1c'),_0x13c8ac,JSON[_0x671a('0x16')](_0x5809b6));_0x3c457a(_0x5809b6);})[_0x671a('0x1b')](function(_0xabf4ac){logger[_0x671a('0x17')](_0x671a('0x1c'),_0xabf4ac[_0x671a('0x19')],_0x13c8ac);_0x4f314a(_0x2893a4[_0x671a('0x17')](0x1f4,_0xabf4ac['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x5e4e15){return new Promise(function(_0x546fa0,_0xdef538){return db['SmsInteraction'][_0x671a('0x24')]({'where':_0x5e4e15['options']?_0x5e4e15[_0x671a('0x20')]['where']||null:null})[_0x671a('0x11')](function(_0x5d7b65){if(_0x5d7b65){return _0x5d7b65[_0x671a('0x25')](_0x5e4e15[_0x671a('0x1f')][_0x671a('0x26')],_[_0x671a('0x27')](_0x5e4e15[_0x671a('0x1f')],[_0x671a('0x26'),'id'])||{});}})[_0x671a('0x28')](function(_0x18223c){logger['info'](_0x671a('0x29'),_0x5e4e15);logger['debug'](_0x671a('0x29'),_0x5e4e15,JSON['stringify'](_0x18223c));_0x546fa0(_0x18223c);})[_0x671a('0x1b')](function(_0xe7384f){logger[_0x671a('0x17')](_0x671a('0x29'),_0xe7384f[_0x671a('0x19')],_0x5e4e15);_0xdef538(_this[_0x671a('0x17')](0x1f4,_0xe7384f[_0x671a('0x19')]));});});}; \ No newline at end of file +var _0x5372=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','request','then','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','SmsInteraction,\x20%s,\x20%s','message','info','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','limit','stringify','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5372,0x1ed));var _0x2537=function(_0x66dd2a,_0x3a7420){_0x66dd2a=_0x66dd2a-0x0;var _0x3924ec=_0x5372[_0x66dd2a];return _0x3924ec;};'use strict';var _=require(_0x2537('0x0'));var util=require(_0x2537('0x1'));var moment=require(_0x2537('0x2'));var BPromise=require('bluebird');var rs=require(_0x2537('0x3'));var fs=require('fs');var Redis=require(_0x2537('0x4'));var db=require(_0x2537('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2537('0x6'))('rpc');var config=require(_0x2537('0x7'));var jayson=require(_0x2537('0x8'));var client=jayson[_0x2537('0x9')][_0x2537('0xa')]({'port':0x232a});config['redis']=_[_0x2537('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2537('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5323c0,_0x39b97b,_0x2e1961){return new BPromise(function(_0x169e6e,_0x4f9d75){return client[_0x2537('0xd')](_0x5323c0,_0x2e1961)[_0x2537('0xe')](function(_0x48ed29){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x39b97b,'request\x20sent');logger[_0x2537('0xf')](_0x2537('0x10'),_0x39b97b,_0x2537('0x11'),JSON['stringify'](_0x48ed29));if(_0x48ed29['error']){if(_0x48ed29['error'][_0x2537('0x12')]===0x1f4){logger[_0x2537('0x13')](_0x2537('0x14'),_0x39b97b,_0x48ed29[_0x2537('0x13')][_0x2537('0x15')]);return _0x4f9d75(_0x48ed29[_0x2537('0x13')][_0x2537('0x15')]);}logger[_0x2537('0x13')](_0x2537('0x14'),_0x39b97b,_0x48ed29[_0x2537('0x13')][_0x2537('0x15')]);return _0x169e6e(_0x48ed29[_0x2537('0x13')]['message']);}else{logger[_0x2537('0x16')](_0x2537('0x14'),_0x39b97b,_0x2537('0x11'));_0x169e6e(_0x48ed29['result'][_0x2537('0x15')]);}})[_0x2537('0x17')](function(_0x2ab95f){logger[_0x2537('0x13')](_0x2537('0x14'),_0x39b97b,_0x2ab95f);_0x4f9d75(_0x2ab95f);});});}exports[_0x2537('0x18')]=function(_0x54b8c2){var _0xb33758=this;return new Promise(function(_0x22b68c,_0x305c31){return db[_0x2537('0x19')]['update'](_0x54b8c2[_0x2537('0x1a')],{'raw':_0x54b8c2[_0x2537('0x1b')]?_0x54b8c2[_0x2537('0x1b')][_0x2537('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54b8c2[_0x2537('0x1b')]?_0x54b8c2['options']['where']||null:null,'attributes':_0x54b8c2[_0x2537('0x1b')]?_0x54b8c2[_0x2537('0x1b')][_0x2537('0x1d')]||null:null,'limit':_0x54b8c2[_0x2537('0x1b')]?_0x54b8c2[_0x2537('0x1b')][_0x2537('0x1e')]||null:null})[_0x2537('0xe')](function(_0x5296ad){logger['info'](_0x2537('0x18'),_0x54b8c2);logger[_0x2537('0xf')](_0x2537('0x18'),_0x54b8c2,JSON[_0x2537('0x1f')](_0x5296ad));_0x22b68c(_0x5296ad);})[_0x2537('0x17')](function(_0x232ac7){logger[_0x2537('0x13')](_0x2537('0x18'),_0x232ac7['message'],_0x54b8c2);_0x305c31(_0xb33758[_0x2537('0x13')](0x1f4,_0x232ac7[_0x2537('0x15')]));});});};exports[_0x2537('0x20')]=function(_0x4e9bb1){return new Promise(function(_0x508168,_0x10692b){return db[_0x2537('0x19')][_0x2537('0x21')]({'where':_0x4e9bb1['options']?_0x4e9bb1[_0x2537('0x1b')]['where']||null:null})[_0x2537('0xe')](function(_0x4919ed){if(_0x4919ed){return _0x4919ed[_0x2537('0x22')](_0x4e9bb1[_0x2537('0x1a')][_0x2537('0x23')],_['omit'](_0x4e9bb1[_0x2537('0x1a')],[_0x2537('0x23'),'id'])||{});}})[_0x2537('0x24')](function(_0x46e1f8){logger[_0x2537('0x16')](_0x2537('0x25'),_0x4e9bb1);logger[_0x2537('0xf')]('AddTags',_0x4e9bb1,JSON['stringify'](_0x46e1f8));_0x508168(_0x46e1f8);})[_0x2537('0x17')](function(_0x4bf4c1){logger[_0x2537('0x13')](_0x2537('0x25'),_0x4bf4c1[_0x2537('0x15')],_0x4e9bb1);_0x10692b(_this[_0x2537('0x13')](0x1f4,_0x4bf4c1[_0x2537('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0126f93..adc5009 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 _0xc09a=['save','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xc09a,0x126));var _0xac09=function(_0x1cf2b9,_0x5d5b1a){_0x1cf2b9=_0x1cf2b9-0x0;var _0x364fb9=_0xc09a[_0x1cf2b9];return _0x364fb9;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xac09('0x0'),'remove',_0xac09('0x1')];function createListener(_0x201b61,_0x5b5d32){return function(_0x5eca49){_0x5b5d32[_0xac09('0x2')](_0x201b61,_0x5eca49);};}function removeListener(_0x16f2b9,_0x56cb3e){return function(){SmsInteractionEvents[_0xac09('0x3')](_0x16f2b9,_0x56cb3e);};}exports[_0xac09('0x4')]=function(_0x5118a0){for(var _0x593049=0x0,_0x386d7a=events[_0xac09('0x5')];_0x593049<_0x386d7a;_0x593049++){var _0x1019df=events[_0x593049];var _0x45f7c4=createListener(_0xac09('0x6')+_0x1019df,_0x5118a0);SmsInteractionEvents['on'](_0x1019df,_0x45f7c4);}}; \ No newline at end of file +var _0x91ed=['./smsInteraction.events','save','remove','update','emit','register'];(function(_0xe8d29e,_0x38b185){var _0x120570=function(_0x2c1a17){while(--_0x2c1a17){_0xe8d29e['push'](_0xe8d29e['shift']());}};_0x120570(++_0x38b185);}(_0x91ed,0xe4));var _0xd91e=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x91ed[_0x49b207];return _0x2dc8fa;};'use strict';var SmsInteractionEvents=require(_0xd91e('0x0'));var events=[_0xd91e('0x1'),_0xd91e('0x2'),_0xd91e('0x3')];function createListener(_0x4689a3,_0x38ecc5){return function(_0x40f4fa){_0x38ecc5[_0xd91e('0x4')](_0x4689a3,_0x40f4fa);};}function removeListener(_0xd7ca02,_0x531af0){return function(){SmsInteractionEvents['removeListener'](_0xd7ca02,_0x531af0);};}exports[_0xd91e('0x5')]=function(_0x16261d){for(var _0xc923c0=0x0,_0x1f9228=events['length'];_0xc923c0<_0x1f9228;_0xc923c0++){var _0x43b7c9=events[_0xc923c0];var _0x4aaea1=createListener('smsInteraction:'+_0x43b7c9,_0x16261d);SmsInteractionEvents['on'](_0x43b7c9,_0x4aaea1);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index eec8327..bd6143f 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 _0x6bf1=['create','post','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked','smsmessage:create'];(function(_0x54a24b,_0x423b2b){var _0x3c8bec=function(_0xfc3221){while(--_0xfc3221){_0x54a24b['push'](_0x54a24b['shift']());}};_0x3c8bec(++_0x423b2b);}(_0x6bf1,0xed));var _0x16bf=function(_0x4503f6,_0x3babaf){_0x4503f6=_0x4503f6-0x0;var _0x2277d1=_0x6bf1[_0x4503f6];return _0x2277d1;};'use strict';var multer=require(_0x16bf('0x0'));var util=require(_0x16bf('0x1'));var path=require('path');var timeout=require(_0x16bf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x16bf('0x3'));var auth=require(_0x16bf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x16bf('0x5'));var controller=require(_0x16bf('0x6'));router['get']('/',auth[_0x16bf('0x7')](),controller[_0x16bf('0x8')]);router[_0x16bf('0x9')](_0x16bf('0xa'),auth[_0x16bf('0x7')](),controller[_0x16bf('0xb')]);router[_0x16bf('0x9')](_0x16bf('0xc'),auth[_0x16bf('0x7')](),controller['show']);router['post']('/',auth[_0x16bf('0x7')](),interaction[_0x16bf('0xd')]('sms',_0x16bf('0xe')),controller[_0x16bf('0xf')]);router[_0x16bf('0x10')](_0x16bf('0x11'),controller[_0x16bf('0x12')]);router['put'](_0x16bf('0xc'),auth[_0x16bf('0x7')](),controller[_0x16bf('0x13')]);router[_0x16bf('0x14')](_0x16bf('0x15'),auth['isAuthenticated'](),controller[_0x16bf('0x16')]);router['put'](_0x16bf('0x17'),auth[_0x16bf('0x7')](),controller[_0x16bf('0x18')]);router[_0x16bf('0x19')](_0x16bf('0xc'),auth[_0x16bf('0x7')](),controller[_0x16bf('0x1a')]);module[_0x16bf('0x1b')]=router; \ No newline at end of file +var _0x6611=['status','put','/:id','/:id/accept','accept','/:id/reject','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','get','describe','show','post','tracked','sms','create','/:id/status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6611,0x1bb));var _0x1661=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6611[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x1661('0x0'));var path=require(_0x1661('0x1'));var timeout=require('connect-timeout');var express=require(_0x1661('0x2'));var router=express[_0x1661('0x3')]();var fs_extra=require(_0x1661('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1661('0x5'));var config=require(_0x1661('0x6'));var controller=require(_0x1661('0x7'));router['get']('/',auth[_0x1661('0x8')](),controller['index']);router[_0x1661('0x9')]('/describe',auth[_0x1661('0x8')](),controller[_0x1661('0xa')]);router[_0x1661('0x9')]('/:id',auth[_0x1661('0x8')](),controller[_0x1661('0xb')]);router[_0x1661('0xc')]('/',auth[_0x1661('0x8')](),interaction[_0x1661('0xd')](_0x1661('0xe'),'smsmessage:create'),controller[_0x1661('0xf')]);router[_0x1661('0xc')](_0x1661('0x10'),controller[_0x1661('0x11')]);router[_0x1661('0x12')](_0x1661('0x13'),auth[_0x1661('0x8')](),controller['update']);router['put'](_0x1661('0x14'),auth[_0x1661('0x8')](),controller[_0x1661('0x15')]);router['put'](_0x1661('0x16'),auth[_0x1661('0x8')](),controller['reject']);router['delete'](_0x1661('0x13'),auth['isAuthenticated'](),controller['destroy']);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 9abc5d0..de4bdfb 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 _0x686d=['medium','BOOLEAN','STRING','TEXT','sequelize','exports'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0x686d,0x172));var _0xd686=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x686d[_0x3fc97b];return _0x3a0c82;};'use strict';var Sequelize=require(_0xd686('0x0'));module[_0xd686('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd686('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd686('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd686('0x4')](0xbe)},'phone':{'type':Sequelize[_0xd686('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xd686('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd686('0x5')]}}; \ No newline at end of file +var _0x7e81=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0xaefe7e,_0x2796a9){var _0x2fcbab=function(_0x21eb20){while(--_0x21eb20){_0xaefe7e['push'](_0xaefe7e['shift']());}};_0x2fcbab(++_0x2796a9);}(_0x7e81,0xc5));var _0x17e8=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7e81[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x17e8('0x0'));module[_0x17e8('0x1')]={'body':{'type':Sequelize[_0x17e8('0x2')](_0x17e8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x17e8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x17e8('0x5')]('in',_0x17e8('0x6')),'defaultValue':_0x17e8('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x17e8('0x7')](0xbe)},'phone':{'type':Sequelize[_0x17e8('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x17e8('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x17e8('0x7')]},'providerResponse':{'type':Sequelize[_0x17e8('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 2fcbd6e..6d964fe 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 _0x1042=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','agent','fullname','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','User','motionChannel','rejectmessage','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\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','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','includeAll','include','rows','show','params','create','body','find','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null'];(function(_0x12c45e,_0x356bc9){var _0x1ac5a8=function(_0x1f87e4){while(--_0x1f87e4){_0x12c45e['push'](_0x12c45e['shift']());}};_0x1ac5a8(++_0x356bc9);}(_0x1042,0x1de));var _0x2104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1042[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2104('0x0'));var rimraf=require(_0x2104('0x1'));var zipdir=require(_0x2104('0x2'));var jsonpatch=require(_0x2104('0x3'));var rp=require(_0x2104('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2104('0x5'));var util=require(_0x2104('0x6'));var path=require(_0x2104('0x7'));var sox=require(_0x2104('0x8'));var csv=require(_0x2104('0x9'));var ejs=require(_0x2104('0xa'));var fs=require('fs');var fs_extra=require(_0x2104('0xb'));var _=require(_0x2104('0xc'));var squel=require('squel');var crypto=require(_0x2104('0xd'));var jsforce=require(_0x2104('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2104('0x9'));var querystring=require(_0x2104('0xf'));var Papa=require(_0x2104('0x10'));var Redis=require(_0x2104('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2104('0x12'));var as=require(_0x2104('0x13'));var hardwareService=require(_0x2104('0x14'));var logger=require(_0x2104('0x15'))(_0x2104('0x16'));var utils=require('../../config/utils');var config=require(_0x2104('0x17'));var licenseUtil=require(_0x2104('0x18'));var db=require(_0x2104('0x19'))['db'];config['redis']=_[_0x2104('0x1a')](config['redis'],{'host':_0x2104('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2104('0x1c')]));require(_0x2104('0x1d'))[_0x2104('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2104('0x1f')][_0x2104('0x20')]({'port':0x232c});var client9002=jayson[_0x2104('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a1779,_0x143a4d,_0x2d9fba,_0x5d0ca6){return new BPromise(function(_0x3fea9b,_0x153430){var _0x2c3011=_0x5d0ca6||client;return _0x2c3011[_0x2104('0x21')](_0x2a1779,_0x2d9fba)[_0x2104('0x22')](function(_0x4b5319){logger[_0x2104('0x23')](_0x2104('0x24'),_0x143a4d,_0x2104('0x25'));logger['debug'](_0x2104('0x26'),_0x143a4d,'request\x20sent',JSON[_0x2104('0x27')](_0x4b5319));if(_0x4b5319['error']){if(_0x4b5319[_0x2104('0x28')][_0x2104('0x29')]===0x1f4){logger[_0x2104('0x28')]('SmsMessage,\x20%s,\x20%s',_0x143a4d,_0x4b5319[_0x2104('0x28')][_0x2104('0x2a')]);return _0x153430(_0x4b5319['error'][_0x2104('0x2a')]);}logger[_0x2104('0x28')]('SmsMessage,\x20%s,\x20%s',_0x143a4d,_0x4b5319[_0x2104('0x28')][_0x2104('0x2a')]);return _0x3fea9b(_0x4b5319[_0x2104('0x28')][_0x2104('0x2a')]);}else{logger['info'](_0x2104('0x24'),_0x143a4d,_0x2104('0x25'));_0x3fea9b(_0x4b5319[_0x2104('0x2b')][_0x2104('0x2a')]);}})[_0x2104('0x2c')](function(_0x56fc04){logger['error'](_0x2104('0x24'),_0x143a4d,_0x56fc04);_0x153430(_0x56fc04);});});}function respondWithStatusCode(_0x58d7c4,_0x377f59){_0x377f59=_0x377f59||0xcc;return function(_0x2eb316){if(_0x2eb316){return _0x58d7c4[_0x2104('0x2d')](_0x377f59);}return _0x58d7c4[_0x2104('0x2e')](_0x377f59)[_0x2104('0x2f')]();};}function respondWithResult(_0x185f44,_0xf2e9fd){_0xf2e9fd=_0xf2e9fd||0xc8;return function(_0x175bd8){if(_0x175bd8){return _0x185f44[_0x2104('0x2e')](_0xf2e9fd)[_0x2104('0x30')](_0x175bd8);}};}function respondWithFilteredResult(_0x525723,_0x4269cf){return function(_0x1110b8){if(_0x1110b8){var _0x4c03a2=typeof _0x4269cf[_0x2104('0x31')]===_0x2104('0x32')&&typeof _0x4269cf[_0x2104('0x33')]==='undefined';var _0x2f11e0=_0x1110b8[_0x2104('0x34')];var _0x4cc61e=_0x4c03a2?0x0:_0x4269cf[_0x2104('0x31')];var _0xa4018e=_0x4c03a2?_0x1110b8['count']:_0x4269cf[_0x2104('0x31')]+_0x4269cf['limit'];var _0x442229;if(_0xa4018e>=_0x2f11e0){_0xa4018e=_0x2f11e0;_0x442229=0xc8;}else{_0x442229=0xce;}_0x525723[_0x2104('0x2e')](_0x442229);return _0x525723[_0x2104('0x35')](_0x2104('0x36'),_0x4cc61e+'-'+_0xa4018e+'/'+_0x2f11e0)[_0x2104('0x30')](_0x1110b8);}return null;};}function patchUpdates(_0x5a621f){return function(_0x1964ea){try{jsonpatch['apply'](_0x1964ea,_0x5a621f,!![]);}catch(_0x17d438){return BPromise[_0x2104('0x37')](_0x17d438);}return _0x1964ea[_0x2104('0x38')]();};}function saveUpdates(_0x35335e,_0x128804){return function(_0xd7f39a){if(_0xd7f39a){return _0xd7f39a[_0x2104('0x39')](_0x35335e)[_0x2104('0x22')](function(_0x4ee41a){return _0x4ee41a;});}return null;};}function removeEntity(_0x5ed689,_0x19b669){return function(_0x5b3597){if(_0x5b3597){return _0x5b3597[_0x2104('0x3a')]()[_0x2104('0x22')](function(){_0x5ed689[_0x2104('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4177a8,_0x5c0400){return function(_0x521266){if(!_0x521266){_0x4177a8[_0x2104('0x2d')](0x194);}return _0x521266;};}function handleError(_0x49b04c,_0x433371){_0x433371=_0x433371||0x1f4;return function(_0x57b509){logger['error'](_0x57b509[_0x2104('0x3b')]);if(_0x57b509['name']){delete _0x57b509[_0x2104('0x3c')];}_0x49b04c[_0x2104('0x2e')](_0x433371)[_0x2104('0x3d')](_0x57b509);};}exports[_0x2104('0x3e')]=function(_0x5e1dd3,_0x4cbc92){var _0x125985={},_0x12b419={},_0x521b12={'count':0x0,'rows':[]};var _0x346f2c=_['map'](db[_0x2104('0x3f')][_0x2104('0x40')],function(_0x40ab90){return{'name':_0x40ab90[_0x2104('0x41')],'type':_0x40ab90[_0x2104('0x42')][_0x2104('0x43')]};});_0x12b419[_0x2104('0x44')]=_[_0x2104('0x45')](_0x346f2c,_0x2104('0x3c'));_0x12b419[_0x2104('0x46')]=_[_0x2104('0x47')](_0x5e1dd3[_0x2104('0x46')]);_0x12b419['filters']=_[_0x2104('0x48')](_0x12b419['model'],_0x12b419[_0x2104('0x46')]);_0x125985[_0x2104('0x49')]=_[_0x2104('0x48')](_0x12b419[_0x2104('0x44')],qs[_0x2104('0x4a')](_0x5e1dd3[_0x2104('0x46')][_0x2104('0x4a')]));_0x125985[_0x2104('0x49')]=_0x125985['attributes'][_0x2104('0x4b')]?_0x125985[_0x2104('0x49')]:_0x12b419[_0x2104('0x44')];if(!_0x5e1dd3[_0x2104('0x46')][_0x2104('0x4c')](_0x2104('0x4d'))){_0x125985[_0x2104('0x33')]=qs['limit'](_0x5e1dd3[_0x2104('0x46')][_0x2104('0x33')]);_0x125985[_0x2104('0x31')]=qs[_0x2104('0x31')](_0x5e1dd3[_0x2104('0x46')]['offset']);}_0x125985[_0x2104('0x4e')]=qs[_0x2104('0x4f')](_0x5e1dd3[_0x2104('0x46')][_0x2104('0x4f')]);_0x125985[_0x2104('0x50')]=qs['filters'](_[_0x2104('0x51')](_0x5e1dd3[_0x2104('0x46')],_0x12b419[_0x2104('0x52')]),_0x346f2c);if(_0x5e1dd3[_0x2104('0x46')]['filter']){_0x125985['where']=_[_0x2104('0x53')](_0x125985[_0x2104('0x50')],{'$or':_[_0x2104('0x45')](_0x346f2c,function(_0x208d24){if(_0x208d24[_0x2104('0x42')]!=='VIRTUAL'){var _0x2703a2={};_0x2703a2[_0x208d24['name']]={'$like':'%'+_0x5e1dd3[_0x2104('0x46')][_0x2104('0x54')]+'%'};return _0x2703a2;}})});}_0x125985=_[_0x2104('0x53')]({},_0x125985,_0x5e1dd3['options']);var _0x4cef6b={'where':_0x125985[_0x2104('0x50')]};return db[_0x2104('0x3f')][_0x2104('0x34')](_0x4cef6b)['then'](function(_0x56e1a5){_0x521b12['count']=_0x56e1a5;if(_0x5e1dd3['query'][_0x2104('0x55')]){_0x125985[_0x2104('0x56')]=[{'all':!![]}];}return db[_0x2104('0x3f')]['findAll'](_0x125985);})[_0x2104('0x22')](function(_0x4bd0e7){_0x521b12[_0x2104('0x57')]=_0x4bd0e7;return _0x521b12;})['then'](respondWithFilteredResult(_0x4cbc92,_0x125985))['catch'](handleError(_0x4cbc92,null));};exports[_0x2104('0x58')]=function(_0x5e96bf,_0xe123c8){var _0x2563aa={'raw':!![],'where':{'id':_0x5e96bf[_0x2104('0x59')]['id']}},_0x405b0e={};_0x405b0e['model']=_[_0x2104('0x47')](db[_0x2104('0x3f')][_0x2104('0x40')]);_0x405b0e[_0x2104('0x46')]=_['keys'](_0x5e96bf[_0x2104('0x46')]);_0x405b0e[_0x2104('0x52')]=_['intersection'](_0x405b0e[_0x2104('0x44')],_0x405b0e['query']);_0x2563aa[_0x2104('0x49')]=_[_0x2104('0x48')](_0x405b0e[_0x2104('0x44')],qs['fields'](_0x5e96bf[_0x2104('0x46')][_0x2104('0x4a')]));_0x2563aa['attributes']=_0x2563aa[_0x2104('0x49')][_0x2104('0x4b')]?_0x2563aa[_0x2104('0x49')]:_0x405b0e[_0x2104('0x44')];if(_0x5e96bf[_0x2104('0x46')]['includeAll']){_0x2563aa[_0x2104('0x56')]=[{'all':!![]}];}_0x2563aa=_[_0x2104('0x53')]({},_0x2563aa,_0x5e96bf['options']);return db[_0x2104('0x3f')]['find'](_0x2563aa)[_0x2104('0x22')](handleEntityNotFound(_0xe123c8,null))[_0x2104('0x22')](respondWithResult(_0xe123c8,null))[_0x2104('0x2c')](handleError(_0xe123c8,null));};exports[_0x2104('0x5a')]=function(_0x5077d,_0xbc1768){return db[_0x2104('0x3f')][_0x2104('0x5a')](_0x5077d[_0x2104('0x5b')],{})['then'](respondWithResult(_0xbc1768,0xc9))['catch'](handleError(_0xbc1768,null));};exports[_0x2104('0x39')]=function(_0x29b501,_0x1f2253){if(_0x29b501[_0x2104('0x5b')]['id']){delete _0x29b501[_0x2104('0x5b')]['id'];}return db[_0x2104('0x3f')][_0x2104('0x5c')]({'where':{'id':_0x29b501[_0x2104('0x59')]['id']}})[_0x2104('0x22')](handleEntityNotFound(_0x1f2253,null))[_0x2104('0x22')](saveUpdates(_0x29b501[_0x2104('0x5b')],null))[_0x2104('0x22')](respondWithResult(_0x1f2253,null))['catch'](handleError(_0x1f2253,null));};exports[_0x2104('0x3a')]=function(_0x7df614,_0x39d36c){return db[_0x2104('0x3f')][_0x2104('0x5c')]({'where':{'id':_0x7df614[_0x2104('0x59')]['id']}})[_0x2104('0x22')](handleEntityNotFound(_0x39d36c,null))[_0x2104('0x22')](removeEntity(_0x39d36c,null))[_0x2104('0x2c')](handleError(_0x39d36c,null));};exports[_0x2104('0x5d')]=function(_0x266897,_0x229863){return db[_0x2104('0x3f')][_0x2104('0x5d')]()[_0x2104('0x22')](respondWithResult(_0x229863,null))[_0x2104('0x2c')](handleError(_0x229863,null));};var interaction_log=require(_0x2104('0x15'))(_0x2104('0x5e'));exports[_0x2104('0x5f')]=function(_0x4bff5c,_0x396938,_0x2547d6){var _0x284ce9={'agent':{},'channel':'sms'};if(_0x4bff5c['body']['id']){delete _0x4bff5c[_0x2104('0x5b')]['id'];}_0x4bff5c[_0x2104('0x5b')][_0x2104('0x60')]=!![];_0x4bff5c[_0x2104('0x5b')][_0x2104('0x61')]=moment()[_0x2104('0x62')](_0x2104('0x63'));_0x4bff5c[_0x2104('0x5b')][_0x2104('0x64')]=_0x4bff5c[_0x2104('0x5b')][_0x2104('0x64')]||_0x4bff5c[_0x2104('0x65')]['id'];_0x284ce9['agent']['id']=_0x4bff5c[_0x2104('0x5b')][_0x2104('0x64')];return db[_0x2104('0x3f')]['find']({'where':{'id':_0x4bff5c[_0x2104('0x59')]['id'],'UserId':null}})[_0x2104('0x22')](handleEntityNotFound(_0x396938,null))[_0x2104('0x22')](saveUpdates(_0x4bff5c[_0x2104('0x5b')],null))[_0x2104('0x22')](function(_0x53c743){if(_0x53c743){_0x284ce9['message']=_0x53c743[_0x2104('0x66')]({'plain':!![]});return db[_0x2104('0x67')]['find']({'where':{'id':_0x53c743[_0x2104('0x68')]}});}return null;})[_0x2104('0x22')](handleEntityNotFound(_0x396938,null))['then'](function(_0x47a52a){if(_0x47a52a){return _0x47a52a['update']({'UserId':_0x4bff5c[_0x2104('0x5b')][_0x2104('0x64')],'read1stAt':_['isNil'](_0x47a52a[_0x2104('0x69')])?moment()[_0x2104('0x62')](_0x2104('0x63')):undefined});}return null;})[_0x2104('0x22')](function(_0x4bd0b3){if(_0x4bd0b3){_0x284ce9[_0x2104('0x6a')]=_0x4bd0b3[_0x2104('0x66')]({'plain':!![]});interaction_log[_0x2104('0x23')](_0x2104('0x6b'),_0x4bff5c[_0x2104('0x65')]['id'],_0x4bff5c['user'][_0x2104('0x3c')],_0x4bff5c[_0x2104('0x65')][_0x2104('0x6c')],_0x284ce9[_0x2104('0x6a')]['id'],_0x4bff5c[_0x2104('0x5b')]?JSON['stringify'](_0x4bff5c[_0x2104('0x5b')]):_0x2104('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x2104('0x6e'),_0x284ce9);}return null;})[_0x2104('0x22')](function(_0x46f97e){var _0x57316d=_0x2104('0x6f')+_0x46f97e[_0x2104('0x2a')][_0x2104('0x70')];return db[_0x2104('0x71')][_0x2104('0x46')](_0x57316d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x588812){return _0x588812;});})[_0x2104('0x22')](function(_0x99d224){if(_0x99d224){_0x284ce9['message'][_0x2104('0x72')]=_0x99d224[0x0];if(!_0x4bff5c[_0x2104('0x5b')][_0x2104('0x64')])return;return db['User'][_0x2104('0x5c')]({'where':{'id':_0x4bff5c[_0x2104('0x5b')]['UserId'],'role':_0x2104('0x73')},'attributes':['id',_0x2104('0x3c'),_0x2104('0x74'),'email',_0x2104('0x75')],'raw':!![]});}return null;})[_0x2104('0x22')](function(_0xf6cefd){if(!_0xf6cefd)return null;_0x284ce9[_0x2104('0x2a')]['agent']=_0xf6cefd;return _0x284ce9;})[_0x2104('0x22')](function(_0x39e028){if(_0x39e028){if(_0x4bff5c[_0x2104('0x5b')]['manual']){_0x284ce9['message'][_0x2104('0x76')]=util[_0x2104('0x62')](_0x2104('0x77'),_0x4bff5c[_0x2104('0x65')]['name']);_0x284ce9[_0x2104('0x2a')]['channel']=_0x284ce9[_0x2104('0x78')];_0x284ce9[_0x2104('0x2a')]['motionChannel']=_0x284ce9['channel'];_0x284ce9[_0x2104('0x2a')][_0x2104('0x79')]=_0x2104('0x5f');return respondWithRpcPromise(_0x2104('0x7a'),_0x2104('0x7a'),{'event':_0x2104('0x7b'),'message':_0x284ce9[_0x2104('0x2a')]},client9002)['then'](function(){return _0x284ce9;});}return _0x284ce9;}return null;})['then'](respondWithResult(_0x396938,null))[_0x2104('0x2c')](handleError(_0x396938,null));};var interaction_log=require(_0x2104('0x15'))(_0x2104('0x5e'));exports[_0x2104('0x37')]=function(_0x5efda2,_0x4b5cab,_0x555195){var _0x2b4bc2={'agent':{},'channel':'sms'};if(_0x5efda2[_0x2104('0x5b')]['id']){delete _0x5efda2[_0x2104('0x5b')]['id'];}_0x5efda2[_0x2104('0x5b')][_0x2104('0x64')]=_0x5efda2[_0x2104('0x5b')][_0x2104('0x64')]||_0x5efda2[_0x2104('0x65')]['id'];_0x2b4bc2[_0x2104('0x73')]['id']=_0x5efda2[_0x2104('0x5b')][_0x2104('0x64')];return db[_0x2104('0x3f')][_0x2104('0x5c')]({'where':{'id':_0x5efda2['params']['id'],'UserId':null}})[_0x2104('0x22')](handleEntityNotFound(_0x4b5cab,null))[_0x2104('0x22')](function(_0xeeec34){if(_0xeeec34){_0x2b4bc2[_0x2104('0x2a')]=_0xeeec34[_0x2104('0x66')]({'plain':!![]});return db[_0x2104('0x67')][_0x2104('0x5c')]({'where':{'id':_0xeeec34['SmsInteractionId']}});}return null;})[_0x2104('0x22')](handleEntityNotFound(_0x4b5cab,null))[_0x2104('0x22')](function(_0x541719){if(_0x541719){_0x2b4bc2['interaction']=_0x541719['get']({'plain':!![]});interaction_log[_0x2104('0x23')](_0x2104('0x7c'),_0x5efda2['user']['id'],_0x5efda2['user'][_0x2104('0x3c')],_0x5efda2[_0x2104('0x65')][_0x2104('0x6c')],_0x2b4bc2[_0x2104('0x6a')]['id'],_0x5efda2[_0x2104('0x5b')]?JSON['stringify'](_0x5efda2['body']):_0x2104('0x6d'));return respondWithRpcPromise('RejectMessage',_0x2104('0x7d'),_0x2b4bc2);}return null;})['then'](function(_0x460fc0){var _0x326946='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x460fc0['message'][_0x2104('0x70')];return db[_0x2104('0x71')][_0x2104('0x46')](_0x326946,{'type':db[_0x2104('0x7e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2104('0x22')](function(_0x434c19){return _0x434c19;});})['then'](function(_0xf74a39){if(_0xf74a39){_0x2b4bc2[_0x2104('0x2a')][_0x2104('0x72')]=_0xf74a39[0x0];if(!_0x5efda2[_0x2104('0x5b')]['UserId'])return;return db[_0x2104('0x7f')][_0x2104('0x5c')]({'where':{'id':_0x5efda2['body']['UserId'],'role':_0x2104('0x73')},'attributes':['id',_0x2104('0x3c'),_0x2104('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x2104('0x22')](function(_0x2e15fd){if(!_0x2e15fd)return null;_0x2b4bc2['message'][_0x2104('0x73')]=_0x2e15fd;return _0x2b4bc2;})[_0x2104('0x22')](function(_0x3575dd){if(_0x3575dd){_0x3575dd[_0x2104('0x2a')][_0x2104('0x76')]=util['format'](_0x2104('0x77'),_0x5efda2[_0x2104('0x65')][_0x2104('0x3c')]);_0x3575dd[_0x2104('0x2a')]['channel']=_0x2b4bc2[_0x2104('0x78')];_0x3575dd[_0x2104('0x2a')][_0x2104('0x80')]=_0x2b4bc2[_0x2104('0x78')];_0x3575dd[_0x2104('0x2a')][_0x2104('0x79')]=_0x2104('0x37');respondWithRpcPromise(_0x2104('0x7a'),_0x2104('0x7a'),{'event':_0x2104('0x81'),'message':_0x3575dd[_0x2104('0x2a')]},client9002);return _0x2b4bc2;}return null;})[_0x2104('0x22')](respondWithResult(_0x4b5cab,null))['catch'](handleError(_0x4b5cab,null));};exports[_0x2104('0x2e')]=function(_0x8dc325,_0xdab1c5,_0x3ff90f){if(_0x8dc325[_0x2104('0x5b')]['id']){delete _0x8dc325[_0x2104('0x5b')]['id'];}var _0xc9b6c1;return db[_0x2104('0x3f')][_0x2104('0x5c')]({'where':{'id':_0x8dc325[_0x2104('0x59')]['id']}})[_0x2104('0x22')](handleEntityNotFound(_0xdab1c5,null))[_0x2104('0x22')](function(_0x5a801a){if(_0x5a801a){_0xc9b6c1=_0x5a801a;return db['SmsAccount'][_0x2104('0x5c')]({'where':{'id':_0x5a801a[_0x2104('0x82')]}});}})[_0x2104('0x22')](handleEntityNotFound(_0xdab1c5,null))[_0x2104('0x22')](function(_0x1e64f7){if(_0x1e64f7){logger[_0x2104('0x83')](_0x2104('0x26'),_0x2104('0x2e'),_0x2104('0x84'),_0x1e64f7['type'],util[_0x2104('0x85')](_0x8dc325[_0x2104('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1e64f7[_0x2104('0x42')]){case _0x2104('0x86'):if(_0x8dc325['body'][_0x2104('0x87')]&&_0x8dc325[_0x2104('0x5b')][_0x2104('0x87')]===_0xc9b6c1['messageId']){return _0xc9b6c1['update']({'read':!![]});}else{logger[_0x2104('0x28')](_0x2104('0x88'),_0x2104('0x2e'),_0x2104('0x86'),util[_0x2104('0x85')](_0x8dc325['body'],{'showHidden':![],'depth':null}));}break;case _0x2104('0x89'):if(_0x8dc325[_0x2104('0x5b')][_0x2104('0x8a')]&&_0x8dc325[_0x2104('0x5b')][_0x2104('0x8a')]===_0xc9b6c1[_0x2104('0x8b')]&&_[_0x2104('0x8c')]([_0x2104('0x8d'),_0x2104('0x8e')],_0x8dc325['body'][_0x2104('0x8f')])>=0x0){return _0xc9b6c1[_0x2104('0x39')]({'read':!![]});}else{logger[_0x2104('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2104('0x2e'),'plivio',util[_0x2104('0x85')](_0x8dc325['body'],{'showHidden':![],'depth':null}));}break;case _0x2104('0x90'):var _0x4eb108=_0x8dc325[_0x2104('0x5b')]['results'][0x0];if(_0x4eb108[_0x2104('0x2e')][_0x2104('0x91')]===_0x2104('0x92')){return _0xc9b6c1['update']({'read':!![]});}else{logger[_0x2104('0x28')](_0x2104('0x88'),_0x2104('0x2e'),_0x2104('0x90'),util[_0x2104('0x85')](_0x8dc325[_0x2104('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0xc9b6c1;}})[_0x2104('0x22')](respondWithResult(_0xdab1c5,null))[_0x2104('0x2c')](handleError(_0xdab1c5,null));}; \ No newline at end of file +var _0x87e5=['describe','sms-interactions','accept','sms','read','readAt','format','UserId','agent','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','SELECT','contact','User','internal','rejectmessage','SmsAccountId','inspect','twilio','MessageSid','plivo','MessageUUID','messageId','indexOf','sent','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','reject','update','destroy','stack','name','send','map','SmsMessage','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','includeAll','include','findAll','rows','show','length','merge','options','find','create','body','params'];(function(_0x5dccb3,_0x513c15){var _0x7aa66e=function(_0x57e740){while(--_0x57e740){_0x5dccb3['push'](_0x5dccb3['shift']());}};_0x7aa66e(++_0x513c15);}(_0x87e5,0xc1));var _0x587e=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0x87e5[_0x151553];return _0x1a0ad6;};'use strict';var emlformat=require(_0x587e('0x0'));var rimraf=require(_0x587e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x587e('0x2'));var rp=require(_0x587e('0x3'));var moment=require('moment');var BPromise=require(_0x587e('0x4'));var Mustache=require(_0x587e('0x5'));var util=require(_0x587e('0x6'));var path=require(_0x587e('0x7'));var sox=require(_0x587e('0x8'));var csv=require(_0x587e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x587e('0xa'));var _=require(_0x587e('0xb'));var squel=require(_0x587e('0xc'));var crypto=require(_0x587e('0xd'));var jsforce=require(_0x587e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x587e('0xf'));var qs=require(_0x587e('0x10'));var as=require(_0x587e('0x11'));var hardwareService=require(_0x587e('0x12'));var logger=require(_0x587e('0x13'))(_0x587e('0x14'));var utils=require(_0x587e('0x15'));var config=require(_0x587e('0x16'));var licenseUtil=require(_0x587e('0x17'));var db=require(_0x587e('0x18'))['db'];config['redis']=_[_0x587e('0x19')](config[_0x587e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x587e('0x1a')]));require('./smsMessage.socket')[_0x587e('0x1b')](socket);var jayson=require(_0x587e('0x1c'));var client=jayson[_0x587e('0x1d')][_0x587e('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x168dfa,_0x4898ee,_0x24d442,_0x579d4c){return new BPromise(function(_0x21636d,_0x3491ee){var _0x66907=_0x579d4c||client;return _0x66907[_0x587e('0x1f')](_0x168dfa,_0x24d442)[_0x587e('0x20')](function(_0xa40e02){logger[_0x587e('0x21')]('SmsMessage,\x20%s,\x20%s',_0x4898ee,_0x587e('0x22'));logger[_0x587e('0x23')](_0x587e('0x24'),_0x4898ee,_0x587e('0x22'),JSON[_0x587e('0x25')](_0xa40e02));if(_0xa40e02['error']){if(_0xa40e02[_0x587e('0x26')]['code']===0x1f4){logger['error'](_0x587e('0x27'),_0x4898ee,_0xa40e02[_0x587e('0x26')][_0x587e('0x28')]);return _0x3491ee(_0xa40e02['error'][_0x587e('0x28')]);}logger[_0x587e('0x26')](_0x587e('0x27'),_0x4898ee,_0xa40e02[_0x587e('0x26')][_0x587e('0x28')]);return _0x21636d(_0xa40e02[_0x587e('0x26')][_0x587e('0x28')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4898ee,'request\x20sent');_0x21636d(_0xa40e02['result'][_0x587e('0x28')]);}})[_0x587e('0x29')](function(_0x4a9fc2){logger['error'](_0x587e('0x27'),_0x4898ee,_0x4a9fc2);_0x3491ee(_0x4a9fc2);});});}function respondWithStatusCode(_0x4c40af,_0x3d7159){_0x3d7159=_0x3d7159||0xcc;return function(_0x580794){if(_0x580794){return _0x4c40af[_0x587e('0x2a')](_0x3d7159);}return _0x4c40af['status'](_0x3d7159)[_0x587e('0x2b')]();};}function respondWithResult(_0x263f5d,_0x2776cb){_0x2776cb=_0x2776cb||0xc8;return function(_0xced0da){if(_0xced0da){return _0x263f5d['status'](_0x2776cb)[_0x587e('0x2c')](_0xced0da);}};}function respondWithFilteredResult(_0x44034,_0x180293){return function(_0xda20f){if(_0xda20f){var _0x1a0dbb=typeof _0x180293[_0x587e('0x2d')]===_0x587e('0x2e')&&typeof _0x180293['limit']===_0x587e('0x2e');var _0x232452=_0xda20f[_0x587e('0x2f')];var _0x1cd659=_0x1a0dbb?0x0:_0x180293['offset'];var _0x42ded6=_0x1a0dbb?_0xda20f[_0x587e('0x2f')]:_0x180293[_0x587e('0x2d')]+_0x180293[_0x587e('0x30')];var _0x37dc1d;if(_0x42ded6>=_0x232452){_0x42ded6=_0x232452;_0x37dc1d=0xc8;}else{_0x37dc1d=0xce;}_0x44034[_0x587e('0x31')](_0x37dc1d);return _0x44034[_0x587e('0x32')](_0x587e('0x33'),_0x1cd659+'-'+_0x42ded6+'/'+_0x232452)[_0x587e('0x2c')](_0xda20f);}return null;};}function patchUpdates(_0x450e96){return function(_0x3275da){try{jsonpatch['apply'](_0x3275da,_0x450e96,!![]);}catch(_0x4079b3){return BPromise[_0x587e('0x34')](_0x4079b3);}return _0x3275da['save']();};}function saveUpdates(_0x1bd262,_0x39c198){return function(_0x423562){if(_0x423562){return _0x423562[_0x587e('0x35')](_0x1bd262)[_0x587e('0x20')](function(_0x57f2d9){return _0x57f2d9;});}return null;};}function removeEntity(_0x623c68,_0x372f10){return function(_0x53bf4d){if(_0x53bf4d){return _0x53bf4d[_0x587e('0x36')]()[_0x587e('0x20')](function(){_0x623c68[_0x587e('0x31')](0xcc)[_0x587e('0x2b')]();});}};}function handleEntityNotFound(_0x36e93d,_0x2081e8){return function(_0x456d5d){if(!_0x456d5d){_0x36e93d[_0x587e('0x2a')](0x194);}return _0x456d5d;};}function handleError(_0x5405da,_0x2f6c54){_0x2f6c54=_0x2f6c54||0x1f4;return function(_0x42e655){logger[_0x587e('0x26')](_0x42e655[_0x587e('0x37')]);if(_0x42e655[_0x587e('0x38')]){delete _0x42e655[_0x587e('0x38')];}_0x5405da[_0x587e('0x31')](_0x2f6c54)[_0x587e('0x39')](_0x42e655);};}exports['index']=function(_0x31cb56,_0x3b8ba0){var _0x1e6f7f={},_0x24a328={},_0x274dbe={'count':0x0,'rows':[]};var _0x555110=_[_0x587e('0x3a')](db[_0x587e('0x3b')]['rawAttributes'],function(_0x4a1a92){return{'name':_0x4a1a92[_0x587e('0x3c')],'type':_0x4a1a92['type']['key']};});_0x24a328[_0x587e('0x3d')]=_['map'](_0x555110,_0x587e('0x38'));_0x24a328[_0x587e('0x3e')]=_[_0x587e('0x3f')](_0x31cb56[_0x587e('0x3e')]);_0x24a328['filters']=_[_0x587e('0x40')](_0x24a328[_0x587e('0x3d')],_0x24a328['query']);_0x1e6f7f[_0x587e('0x41')]=_['intersection'](_0x24a328[_0x587e('0x3d')],qs[_0x587e('0x42')](_0x31cb56['query'][_0x587e('0x42')]));_0x1e6f7f[_0x587e('0x41')]=_0x1e6f7f['attributes']['length']?_0x1e6f7f[_0x587e('0x41')]:_0x24a328[_0x587e('0x3d')];if(!_0x31cb56[_0x587e('0x3e')][_0x587e('0x43')](_0x587e('0x44'))){_0x1e6f7f[_0x587e('0x30')]=qs[_0x587e('0x30')](_0x31cb56['query'][_0x587e('0x30')]);_0x1e6f7f['offset']=qs[_0x587e('0x2d')](_0x31cb56['query'][_0x587e('0x2d')]);}_0x1e6f7f['order']=qs[_0x587e('0x45')](_0x31cb56[_0x587e('0x3e')]['sort']);_0x1e6f7f[_0x587e('0x46')]=qs[_0x587e('0x47')](_['pick'](_0x31cb56['query'],_0x24a328['filters']),_0x555110);if(_0x31cb56[_0x587e('0x3e')][_0x587e('0x48')]){_0x1e6f7f[_0x587e('0x46')]=_['merge'](_0x1e6f7f[_0x587e('0x46')],{'$or':_['map'](_0x555110,function(_0x56f20c){if(_0x56f20c[_0x587e('0x49')]!==_0x587e('0x4a')){var _0x53da9e={};_0x53da9e[_0x56f20c[_0x587e('0x38')]]={'$like':'%'+_0x31cb56[_0x587e('0x3e')][_0x587e('0x48')]+'%'};return _0x53da9e;}})});}_0x1e6f7f=_['merge']({},_0x1e6f7f,_0x31cb56['options']);var _0x2ab3ed={'where':_0x1e6f7f[_0x587e('0x46')]};return db[_0x587e('0x3b')][_0x587e('0x2f')](_0x2ab3ed)[_0x587e('0x20')](function(_0x5cb7d6){_0x274dbe['count']=_0x5cb7d6;if(_0x31cb56[_0x587e('0x3e')][_0x587e('0x4b')]){_0x1e6f7f[_0x587e('0x4c')]=[{'all':!![]}];}return db[_0x587e('0x3b')][_0x587e('0x4d')](_0x1e6f7f);})['then'](function(_0x76f93d){_0x274dbe[_0x587e('0x4e')]=_0x76f93d;return _0x274dbe;})['then'](respondWithFilteredResult(_0x3b8ba0,_0x1e6f7f))[_0x587e('0x29')](handleError(_0x3b8ba0,null));};exports[_0x587e('0x4f')]=function(_0x180431,_0x5ef2a2){var _0x3e2716={'raw':!![],'where':{'id':_0x180431['params']['id']}},_0x1a0019={};_0x1a0019['model']=_[_0x587e('0x3f')](db[_0x587e('0x3b')]['rawAttributes']);_0x1a0019[_0x587e('0x3e')]=_['keys'](_0x180431[_0x587e('0x3e')]);_0x1a0019[_0x587e('0x47')]=_[_0x587e('0x40')](_0x1a0019[_0x587e('0x3d')],_0x1a0019[_0x587e('0x3e')]);_0x3e2716['attributes']=_[_0x587e('0x40')](_0x1a0019['model'],qs['fields'](_0x180431[_0x587e('0x3e')][_0x587e('0x42')]));_0x3e2716[_0x587e('0x41')]=_0x3e2716[_0x587e('0x41')][_0x587e('0x50')]?_0x3e2716['attributes']:_0x1a0019[_0x587e('0x3d')];if(_0x180431['query'][_0x587e('0x4b')]){_0x3e2716[_0x587e('0x4c')]=[{'all':!![]}];}_0x3e2716=_[_0x587e('0x51')]({},_0x3e2716,_0x180431[_0x587e('0x52')]);return db[_0x587e('0x3b')][_0x587e('0x53')](_0x3e2716)[_0x587e('0x20')](handleEntityNotFound(_0x5ef2a2,null))[_0x587e('0x20')](respondWithResult(_0x5ef2a2,null))['catch'](handleError(_0x5ef2a2,null));};exports[_0x587e('0x54')]=function(_0x19d2e3,_0x50d5ce){return db[_0x587e('0x3b')][_0x587e('0x54')](_0x19d2e3[_0x587e('0x55')],{})['then'](respondWithResult(_0x50d5ce,0xc9))['catch'](handleError(_0x50d5ce,null));};exports[_0x587e('0x35')]=function(_0x27aaaa,_0x314cc0){if(_0x27aaaa['body']['id']){delete _0x27aaaa[_0x587e('0x55')]['id'];}return db['SmsMessage'][_0x587e('0x53')]({'where':{'id':_0x27aaaa[_0x587e('0x56')]['id']}})[_0x587e('0x20')](handleEntityNotFound(_0x314cc0,null))['then'](saveUpdates(_0x27aaaa[_0x587e('0x55')],null))[_0x587e('0x20')](respondWithResult(_0x314cc0,null))[_0x587e('0x29')](handleError(_0x314cc0,null));};exports[_0x587e('0x36')]=function(_0x571303,_0xdcd2af){return db[_0x587e('0x3b')]['find']({'where':{'id':_0x571303[_0x587e('0x56')]['id']}})['then'](handleEntityNotFound(_0xdcd2af,null))[_0x587e('0x20')](removeEntity(_0xdcd2af,null))[_0x587e('0x29')](handleError(_0xdcd2af,null));};exports[_0x587e('0x57')]=function(_0x3c855b,_0x56e334){return db[_0x587e('0x3b')][_0x587e('0x57')]()[_0x587e('0x20')](respondWithResult(_0x56e334,null))['catch'](handleError(_0x56e334,null));};var interaction_log=require('../../config/logger')(_0x587e('0x58'));exports[_0x587e('0x59')]=function(_0x4685a3,_0x231f74,_0x218ad1){var _0x21cf43={'agent':{},'channel':_0x587e('0x5a')};if(_0x4685a3[_0x587e('0x55')]['id']){delete _0x4685a3[_0x587e('0x55')]['id'];}_0x4685a3[_0x587e('0x55')][_0x587e('0x5b')]=!![];_0x4685a3['body'][_0x587e('0x5c')]=moment()[_0x587e('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4685a3[_0x587e('0x55')][_0x587e('0x5e')]=_0x4685a3[_0x587e('0x55')][_0x587e('0x5e')]||_0x4685a3['user']['id'];_0x21cf43[_0x587e('0x5f')]['id']=_0x4685a3[_0x587e('0x55')][_0x587e('0x5e')];return db[_0x587e('0x3b')]['find']({'where':{'id':_0x4685a3[_0x587e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x231f74,null))[_0x587e('0x20')](saveUpdates(_0x4685a3[_0x587e('0x55')],null))['then'](function(_0x51a0bd){if(_0x51a0bd){_0x21cf43['message']=_0x51a0bd['get']({'plain':!![]});return db['SmsInteraction'][_0x587e('0x53')]({'where':{'id':_0x51a0bd[_0x587e('0x60')]}});}return null;})[_0x587e('0x20')](handleEntityNotFound(_0x231f74,null))[_0x587e('0x20')](function(_0x1b1209){if(_0x1b1209){return _0x1b1209[_0x587e('0x35')]({'UserId':_0x4685a3[_0x587e('0x55')][_0x587e('0x5e')],'read1stAt':_[_0x587e('0x61')](_0x1b1209[_0x587e('0x62')])?moment()[_0x587e('0x5d')](_0x587e('0x63')):undefined});}return null;})['then'](function(_0x512676){if(_0x512676){_0x21cf43[_0x587e('0x64')]=_0x512676[_0x587e('0x65')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4685a3[_0x587e('0x66')]['id'],_0x4685a3[_0x587e('0x66')][_0x587e('0x38')],_0x4685a3[_0x587e('0x66')][_0x587e('0x67')],_0x21cf43['interaction']['id'],_0x4685a3['body']?JSON[_0x587e('0x25')](_0x4685a3[_0x587e('0x55')]):_0x587e('0x68'));return respondWithRpcPromise('AcceptMessage',_0x587e('0x69'),_0x21cf43);}return null;})[_0x587e('0x20')](function(_0x435417){var _0x122dae=_0x587e('0x6a')+_0x435417[_0x587e('0x28')][_0x587e('0x6b')];return db[_0x587e('0x6c')][_0x587e('0x3e')](_0x122dae,{'type':db['Sequelize'][_0x587e('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x166edf){return _0x166edf;});})[_0x587e('0x20')](function(_0x3428e2){if(_0x3428e2){_0x21cf43[_0x587e('0x28')]['contact']=_0x3428e2[0x0];if(!_0x4685a3[_0x587e('0x55')][_0x587e('0x5e')])return;return db['User'][_0x587e('0x53')]({'where':{'id':_0x4685a3[_0x587e('0x55')]['UserId'],'role':_0x587e('0x5f')},'attributes':['id',_0x587e('0x38'),_0x587e('0x6e'),_0x587e('0x6f'),'internal'],'raw':!![]});}return null;})[_0x587e('0x20')](function(_0x2b527d){if(!_0x2b527d)return null;_0x21cf43[_0x587e('0x28')][_0x587e('0x5f')]=_0x2b527d;return _0x21cf43;})[_0x587e('0x20')](function(_0xa280d5){if(_0xa280d5){if(_0x4685a3[_0x587e('0x55')][_0x587e('0x70')]){_0x21cf43[_0x587e('0x28')]['interface']=util[_0x587e('0x5d')](_0x587e('0x71'),_0x4685a3[_0x587e('0x66')][_0x587e('0x38')]);_0x21cf43['message'][_0x587e('0x72')]=_0x21cf43[_0x587e('0x72')];_0x21cf43['message'][_0x587e('0x73')]=_0x21cf43['channel'];_0x21cf43[_0x587e('0x28')][_0x587e('0x74')]=_0x587e('0x59');return respondWithRpcPromise(_0x587e('0x75'),'EventManager',{'event':_0x587e('0x76'),'message':_0x21cf43['message']},client9002)['then'](function(){return _0x21cf43;});}return _0x21cf43;}return null;})[_0x587e('0x20')](respondWithResult(_0x231f74,null))[_0x587e('0x29')](handleError(_0x231f74,null));};var interaction_log=require(_0x587e('0x13'))('sms-interactions');exports[_0x587e('0x34')]=function(_0x36e4c5,_0x370bde,_0x593e5b){var _0x46bbd6={'agent':{},'channel':'sms'};if(_0x36e4c5[_0x587e('0x55')]['id']){delete _0x36e4c5[_0x587e('0x55')]['id'];}_0x36e4c5['body'][_0x587e('0x5e')]=_0x36e4c5[_0x587e('0x55')][_0x587e('0x5e')]||_0x36e4c5[_0x587e('0x66')]['id'];_0x46bbd6[_0x587e('0x5f')]['id']=_0x36e4c5[_0x587e('0x55')][_0x587e('0x5e')];return db[_0x587e('0x3b')]['find']({'where':{'id':_0x36e4c5[_0x587e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x370bde,null))[_0x587e('0x20')](function(_0x1a7200){if(_0x1a7200){_0x46bbd6['message']=_0x1a7200[_0x587e('0x65')]({'plain':!![]});return db[_0x587e('0x77')][_0x587e('0x53')]({'where':{'id':_0x1a7200[_0x587e('0x60')]}});}return null;})[_0x587e('0x20')](handleEntityNotFound(_0x370bde,null))['then'](function(_0x7ba4df){if(_0x7ba4df){_0x46bbd6['interaction']=_0x7ba4df[_0x587e('0x65')]({'plain':!![]});interaction_log['info'](_0x587e('0x78'),_0x36e4c5[_0x587e('0x66')]['id'],_0x36e4c5['user'][_0x587e('0x38')],_0x36e4c5[_0x587e('0x66')]['role'],_0x46bbd6[_0x587e('0x64')]['id'],_0x36e4c5[_0x587e('0x55')]?JSON[_0x587e('0x25')](_0x36e4c5[_0x587e('0x55')]):_0x587e('0x68'));return respondWithRpcPromise('RejectMessage',_0x587e('0x79'),_0x46bbd6);}return null;})[_0x587e('0x20')](function(_0x1309d){var _0x9d472b=_0x587e('0x6a')+_0x1309d[_0x587e('0x28')][_0x587e('0x6b')];return db['sequelize']['query'](_0x9d472b,{'type':db[_0x587e('0x7a')]['QueryTypes'][_0x587e('0x7b')],'raw':!![]})[_0x587e('0x20')](function(_0x17cf77){return _0x17cf77;});})[_0x587e('0x20')](function(_0x44dfd7){if(_0x44dfd7){_0x46bbd6[_0x587e('0x28')][_0x587e('0x7c')]=_0x44dfd7[0x0];if(!_0x36e4c5[_0x587e('0x55')]['UserId'])return;return db[_0x587e('0x7d')]['find']({'where':{'id':_0x36e4c5[_0x587e('0x55')]['UserId'],'role':_0x587e('0x5f')},'attributes':['id',_0x587e('0x38'),_0x587e('0x6e'),_0x587e('0x6f'),_0x587e('0x7e')],'raw':!![]});}return null;})[_0x587e('0x20')](function(_0x498bfc){if(!_0x498bfc)return null;_0x46bbd6[_0x587e('0x28')][_0x587e('0x5f')]=_0x498bfc;return _0x46bbd6;})[_0x587e('0x20')](function(_0x5b9640){if(_0x5b9640){_0x5b9640['message']['interface']=util[_0x587e('0x5d')](_0x587e('0x71'),_0x36e4c5[_0x587e('0x66')][_0x587e('0x38')]);_0x5b9640['message'][_0x587e('0x72')]=_0x46bbd6[_0x587e('0x72')];_0x5b9640[_0x587e('0x28')][_0x587e('0x73')]=_0x46bbd6['channel'];_0x5b9640['message'][_0x587e('0x74')]=_0x587e('0x34');respondWithRpcPromise(_0x587e('0x75'),_0x587e('0x75'),{'event':_0x587e('0x7f'),'message':_0x5b9640[_0x587e('0x28')]},client9002);return _0x46bbd6;}return null;})[_0x587e('0x20')](respondWithResult(_0x370bde,null))[_0x587e('0x29')](handleError(_0x370bde,null));};exports[_0x587e('0x31')]=function(_0x3642f6,_0x2b0f1c,_0x43ff7c){if(_0x3642f6[_0x587e('0x55')]['id']){delete _0x3642f6[_0x587e('0x55')]['id'];}var _0x1f011f;return db[_0x587e('0x3b')][_0x587e('0x53')]({'where':{'id':_0x3642f6[_0x587e('0x56')]['id']}})[_0x587e('0x20')](handleEntityNotFound(_0x2b0f1c,null))[_0x587e('0x20')](function(_0x52117e){if(_0x52117e){_0x1f011f=_0x52117e;return db['SmsAccount'][_0x587e('0x53')]({'where':{'id':_0x52117e[_0x587e('0x80')]}});}})[_0x587e('0x20')](handleEntityNotFound(_0x2b0f1c,null))[_0x587e('0x20')](function(_0x11deaf){if(_0x11deaf){logger[_0x587e('0x23')](_0x587e('0x24'),'status','received\x20delivery\x20report\x20from',_0x11deaf[_0x587e('0x49')],util[_0x587e('0x81')](_0x3642f6[_0x587e('0x55')],{'showHidden':![],'depth':null}));switch(_0x11deaf[_0x587e('0x49')]){case _0x587e('0x82'):if(_0x3642f6[_0x587e('0x55')][_0x587e('0x83')]&&_0x3642f6[_0x587e('0x55')][_0x587e('0x83')]===_0x1f011f['messageId']){return _0x1f011f[_0x587e('0x35')]({'read':!![]});}else{logger[_0x587e('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x587e('0x31'),'twilio',util[_0x587e('0x81')](_0x3642f6['body'],{'showHidden':![],'depth':null}));}break;case _0x587e('0x84'):if(_0x3642f6[_0x587e('0x55')]['MessageUUID']&&_0x3642f6['body'][_0x587e('0x85')]===_0x1f011f[_0x587e('0x86')]&&_[_0x587e('0x87')]([_0x587e('0x88'),'delivered'],_0x3642f6[_0x587e('0x55')]['Status'])>=0x0){return _0x1f011f[_0x587e('0x35')]({'read':!![]});}else{logger['error'](_0x587e('0x89'),'status',_0x587e('0x8a'),util[_0x587e('0x81')](_0x3642f6[_0x587e('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x476e0f=_0x3642f6['body']['results'][0x0];if(_0x476e0f[_0x587e('0x31')]['groupName']==='DELIVERED'){return _0x1f011f['update']({'read':!![]});}else{logger[_0x587e('0x26')](_0x587e('0x89'),'status',_0x587e('0x8b'),util[_0x587e('0x81')](_0x3642f6['body'],{'showHidden':![],'depth':null}));}break;}return _0x1f011f;}})[_0x587e('0x20')](respondWithResult(_0x2b0f1c,null))[_0x587e('0x29')](handleError(_0x2b0f1c,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d6974ac..0b9bf5f 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 _0xcecd=['SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0xae7aec,_0x517740){var _0x4c4915=function(_0x573924){while(--_0x573924){_0xae7aec['push'](_0xae7aec['shift']());}};_0x4c4915(++_0x517740);}(_0xcecd,0x126));var _0xdcec=function(_0x2ea818,_0xd67551){_0x2ea818=_0x2ea818-0x0;var _0x370338=_0xcecd[_0x2ea818];return _0x370338;};'use strict';var EventEmitter=require(_0xdcec('0x0'));var SmsMessage=require(_0xdcec('0x1'))['db'][_0xdcec('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdcec('0x3')](0x0);var events={'afterCreate':_0xdcec('0x4'),'afterUpdate':_0xdcec('0x5'),'afterDestroy':'remove'};function emitEvent(_0x13c6b6){return function(_0x2713be,_0x5d0d9a,_0x3d66ee){SmsMessageEvents[_0xdcec('0x6')](_0x13c6b6+':'+_0x2713be['id'],_0x2713be);SmsMessageEvents[_0xdcec('0x6')](_0x13c6b6,_0x2713be);_0x3d66ee(null);};}for(var e in events){if(events[_0xdcec('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xa4b0=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x5ae82b,_0x35b124){var _0x571ab8=function(_0x546e6b){while(--_0x546e6b){_0x5ae82b['push'](_0x5ae82b['shift']());}};_0x571ab8(++_0x35b124);}(_0xa4b0,0x191));var _0x0a4b=function(_0x43a7ba,_0x23ff1c){_0x43a7ba=_0x43a7ba-0x0;var _0xe35392=_0xa4b0[_0x43a7ba];return _0xe35392;};'use strict';var EventEmitter=require(_0x0a4b('0x0'));var SmsMessage=require(_0x0a4b('0x1'))['db'][_0x0a4b('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0a4b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a4b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x294564){return function(_0x945f2c,_0x535030,_0x5ea07a){SmsMessageEvents[_0x0a4b('0x5')](_0x294564+':'+_0x945f2c['id'],_0x945f2c);SmsMessageEvents[_0x0a4b('0x5')](_0x294564,_0x945f2c);_0x5ea07a(null);};}for(var e in events){if(events[_0x0a4b('0x6')](e)){var event=events[e];SmsMessage[_0x0a4b('0x7')](e,emitEvent(event));}}module[_0x0a4b('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index fc84fd2..cb0c9da 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 _0x5cc0=['messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','GET','user_key','session_key','total_sent','internal_order_id','skebby','connectel','senderString','POST','deliveryReport','read','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','sender','timestamp','keys','sort','apiKey','createHash','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','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_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage'];(function(_0x505b1,_0x3f2a5d){var _0x6f5380=function(_0x439bda){while(--_0x439bda){_0x505b1['push'](_0x505b1['shift']());}};_0x6f5380(++_0x3f2a5d);}(_0x5cc0,0x162));var _0x05cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05cc('0x0'));var util=require('util');var logger=require(_0x05cc('0x1'))('api');var moment=require(_0x05cc('0x2'));var BPromise=require(_0x05cc('0x3'));var rp=require(_0x05cc('0x4'));var fs=require('fs');var path=require(_0x05cc('0x5'));var rimraf=require(_0x05cc('0x6'));var config=require(_0x05cc('0x7'));var attributes=require(_0x05cc('0x8'));module[_0x05cc('0x9')]=function(_0x39a178,_0x33b261){return _0x39a178[_0x05cc('0xa')](_0x05cc('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x05cc('0xc'),'fields':[_0x05cc('0xc')]},{'name':_0x05cc('0xd'),'fields':[_0x05cc('0xe')],'type':_0x05cc('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcb033c,_0x5c7e21,_0x54b4ee){var _0x5e9af0=_0x39a178['models'];var _0xfaa4b9=_0xcb033c[_0x05cc('0x10')]({'plain':!![]});if(_0xfaa4b9[_0x05cc('0x11')][_0x05cc('0x12')]()==='in'||_0xfaa4b9[_0x05cc('0x11')][_0x05cc('0x12')]()===_0x05cc('0x13')&&!_0xfaa4b9[_0x05cc('0x14')]&&!_[_0x05cc('0x15')](_0xfaa4b9['UserId'])&&!_[_0x05cc('0x15')](_0xfaa4b9[_0x05cc('0x16')])){_0x5e9af0[_0x05cc('0x17')][_0x05cc('0x18')]({'where':{'id':_0xfaa4b9[_0x05cc('0x16')]}})['then'](function(_0x5939e5){if(_0x5939e5){_0x5939e5['update']({'lastMsgAt':_0xfaa4b9[_0x05cc('0x19')],'lastMsgDirection':_0xfaa4b9[_0x05cc('0x11')][_0x05cc('0x12')]()});}})[_0x05cc('0x1a')](function(_0x1bfc17){console[_0x05cc('0x1b')](_0x1bfc17);});}if(_0xfaa4b9[_0x05cc('0x11')]===_0x05cc('0x13')&&!_0xfaa4b9[_0x05cc('0x14')]){var _0x52ea7d;_0x5e9af0[_0x05cc('0x1c')][_0x05cc('0x1d')]({'where':{'id':_0xfaa4b9[_0x05cc('0x1e')]},'raw':!![]})[_0x05cc('0x1f')](function(_0x390d87){_0x52ea7d=_0x390d87;if(_0x52ea7d&&_0x52ea7d[_0x05cc('0x20')]){switch(_0x52ea7d['type']){case'twilio':var _0x4e96d5=require('twilio');if(_0x52ea7d[_0x05cc('0x21')]&&_0x52ea7d[_0x05cc('0x22')]&&_0x52ea7d[_0x05cc('0x23')]){var _0x208ed8=new _0x4e96d5(_0x52ea7d['accountSid'],_0x52ea7d[_0x05cc('0x22')]);_0x208ed8['messages'][_0x05cc('0x24')]({'body':_0xfaa4b9[_0x05cc('0xe')],'to':_0xfaa4b9['phone'],'from':_0x52ea7d['phone'],'statusCallback':_0x52ea7d[_0x05cc('0x25')]+_0x05cc('0x26')+_0xfaa4b9['id']+_0x05cc('0x27')+_0x52ea7d[_0x05cc('0x28')]})['then'](function(_0x341113){if(_0x341113[_0x05cc('0x29')]){return _0xcb033c[_0x05cc('0x2a')]({'messageId':_0x341113['sid']});}})[_0x05cc('0x1a')](function(_0x340f9b){logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),'twilio',util[_0x05cc('0x2d')](_0x340f9b,{'showHidden':![],'depth':null}));});}else{logger[_0x05cc('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05cc('0x2c'),'twilio',_0x05cc('0x2e'));}break;case'skebby':var _0x50102a=_0x05cc('0x2f');if(_0x52ea7d['username']&&_0x52ea7d[_0x05cc('0x30')]){var _0x30242d={'recipient':[_0xfaa4b9['phone']],'message':_0xfaa4b9[_0x05cc('0xe')],'message_type':_0x52ea7d[_0x05cc('0x31')]};if(_0x52ea7d['smsMethod']&&_0x52ea7d[_0x05cc('0x31')]!=='SI'){_0x30242d['sender']=_0x52ea7d['phone'];}var _0x4a8085={'url':_0x50102a+_0x05cc('0x32')+_0x52ea7d[_0x05cc('0x33')]+'&password='+_0x52ea7d[_0x05cc('0x30')],'method':_0x05cc('0x34')};rp(_0x4a8085)[_0x05cc('0x1f')](function(_0x320195){var _0x6b88e5=_0x320195['split'](';');var _0xf0568b={'user_key':_0x6b88e5[0x0],'session_key':_0x6b88e5[0x1]};_0x4a8085={'url':_0x50102a+'sms','method':'POST','headers':{'user_key':_0xf0568b[_0x05cc('0x35')],'Session_key':_0xf0568b[_0x05cc('0x36')]},'json':!![],'body':_0x30242d};return rp(_0x4a8085);})['then'](function(_0x5b2792){if(_0x5b2792[_0x05cc('0x37')]>=0x1){var _0x213ac8={'messageId':_0x5b2792[_0x05cc('0x38')]};if(_0x52ea7d[_0x05cc('0x31')]!=='GP'||!_0x52ea7d['deliveryReport']){_0x213ac8['read']=!![];}return _0xcb033c[_0x05cc('0x2a')](_0x213ac8);}else{return logger['error'](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x39'),util[_0x05cc('0x2d')](_0x5b2792,{'showHidden':![],'depth':null}));}})[_0x05cc('0x1a')](function(_0x558fe3){return logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),'skebby',util[_0x05cc('0x2d')](_0x558fe3,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05cc('0x2c'),_0x05cc('0x39'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x05cc('0x3a'):if(_0x52ea7d['authToken']){var _0x38f269={'recipient':_0xfaa4b9[_0x05cc('0x23')],'message':_0xfaa4b9['body'],'sender':_0x52ea7d[_0x05cc('0x3b')]||_0x52ea7d['phone'],'authorization':_0x52ea7d[_0x05cc('0x22')]};var _0x5c7e21={'method':_0x05cc('0x3c'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x38f269,'json':!![]};rp(_0x5c7e21)[_0x05cc('0x1f')](function(_0x13e00a){var _0x38ee67={'messageId':_0x13e00a['requestid']};if(!_0x52ea7d[_0x05cc('0x3d')]){_0x38ee67[_0x05cc('0x3e')]=!![];}return _0xcb033c['update'](_0x38ee67);})[_0x05cc('0x1a')](function(_0x2e7dcf){logger[_0x05cc('0x1b')](_0x05cc('0x2b'),'afterCreate',_0x05cc('0x3a'),util[_0x05cc('0x2d')](_0x2e7dcf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x3a'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x52ea7d['username']&&_0x52ea7d['password']){var _0x38f269={'messages':[{'source':_0x05cc('0x3f'),'to':_0xfaa4b9['phone'],'body':_0xfaa4b9[_0x05cc('0xe')],'from':_0x52ea7d[_0x05cc('0x3b')]||_0x52ea7d[_0x05cc('0x23')]}]};var _0x27e4a7=util[_0x05cc('0x40')](_0x05cc('0x41'),_0x52ea7d[_0x05cc('0x33')],_0x52ea7d[_0x05cc('0x30')]);var _0x5c7e21={'method':_0x05cc('0x3c'),'uri':_0x05cc('0x42'),'body':_0x38f269,'headers':{'Authorization':util['format'](_0x05cc('0x43'),new Buffer(_0x27e4a7)[_0x05cc('0x44')](_0x05cc('0x45')))},'json':!![]};rp(_0x5c7e21)[_0x05cc('0x1f')](function(_0x1b6421){if(_0x1b6421[_0x05cc('0x46')]>=0xc8&&_0x1b6421[_0x05cc('0x46')]<=0xce){if(_0x1b6421['data']&&_0x1b6421[_0x05cc('0x47')][_0x05cc('0x48')]>0x0){var _0x39ea1b=_[_0x05cc('0x49')](_0x1b6421['data'][_0x05cc('0x4a')]);var _0xd2d9b8={'messageId':_0x39ea1b[_0x05cc('0x4b')]};if(!_0x52ea7d[_0x05cc('0x3d')]){_0xd2d9b8['read']=!![];}return _0xcb033c['update'](_0xd2d9b8);}else{logger['error'](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x4c'),util['inspect'](_0x1b6421,{'showHidden':![],'depth':null}));}}else{logger[_0x05cc('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05cc('0x2c'),'clickSend',util['inspect'](_0x1b6421,{'showHidden':![],'depth':null}));}})[_0x05cc('0x1a')](function(_0xa5687a){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x05cc('0x4c'),util[_0x05cc('0x2d')](_0xa5687a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x4c'),_0x05cc('0x4d'));}break;case _0x05cc('0x4e'):if(_0x52ea7d[_0x05cc('0x4f')]&&_0x52ea7d[_0x05cc('0x22')]){var _0x38f269={'dst':_0xfaa4b9[_0x05cc('0x23')],'text':_0xfaa4b9[_0x05cc('0xe')],'src':_0x52ea7d['senderString']||_0x52ea7d[_0x05cc('0x23')],'url':_0x52ea7d['remote']+'/api/sms/messages/'+_0xfaa4b9['id']+_0x05cc('0x27')+_0x52ea7d[_0x05cc('0x28')]};var _0x27e4a7=util[_0x05cc('0x40')]('%s:%s',_0x52ea7d['authId'],_0x52ea7d[_0x05cc('0x22')]);var _0x5c7e21={'method':_0x05cc('0x3c'),'uri':util['format'](_0x05cc('0x50'),_0x52ea7d[_0x05cc('0x4f')]),'body':_0x38f269,'headers':{'Authorization':util['format'](_0x05cc('0x43'),new Buffer(_0x27e4a7)[_0x05cc('0x44')](_0x05cc('0x45')))},'json':!![]};rp(_0x5c7e21)['then'](function(_0x152dcd){var _0x2b685e={'messageId':_0x152dcd['message_uuid'][0x0]};return _0xcb033c[_0x05cc('0x2a')](_0x2b685e);})[_0x05cc('0x1a')](function(_0x46bd5f){logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x4e'),util[_0x05cc('0x2d')](_0x46bd5f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0x05cc('0x51'));}break;case'infobip':if(_0x52ea7d[_0x05cc('0x33')]&&_0x52ea7d['password']){if(_0x52ea7d[_0x05cc('0x52')]){var _0x49edc4={'method':_0x05cc('0x3c'),'uri':_0x52ea7d['baseUrl']+_0x05cc('0x53'),'body':{'username':_0x52ea7d[_0x05cc('0x33')],'password':_0x52ea7d[_0x05cc('0x30')]},'json':!![]};return rp(_0x49edc4)[_0x05cc('0x1f')](function(_0x33a884){var _0x134ba0={'method':'POST','uri':_0x52ea7d[_0x05cc('0x52')]+_0x05cc('0x54'),'body':{'messages':[{'from':_0x52ea7d[_0x05cc('0x23')],'destinations':[{'to':_0xfaa4b9[_0x05cc('0x23')]}],'text':_0xfaa4b9[_0x05cc('0xe')],'notifyUrl':_0x52ea7d[_0x05cc('0x25')]+_0x05cc('0x26')+_0xfaa4b9['id']+_0x05cc('0x27')+_0x52ea7d[_0x05cc('0x28')],'notifyContentType':_0x05cc('0x55'),'callbackData':_0x52ea7d[_0x05cc('0x23')]+';'+_0xfaa4b9[_0x05cc('0xe')]}]},'headers':{'Authorization':_0x05cc('0x56')+_0x33a884['token']},'json':!![]};return rp(_0x134ba0)['then'](function(_0x20155d){if(_0x20155d[_0x05cc('0x4a')]){var _0x48365a={'messageId':_0x20155d[_0x05cc('0x4a')][0x0][_0x05cc('0xc')]};if(!_0x52ea7d[_0x05cc('0x3d')]){_0x48365a[_0x05cc('0x3e')]=!![];}return _0xcb033c[_0x05cc('0x2a')](_0x48365a);}else{return logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x57'),util[_0x05cc('0x2d')](_0x20155d,{'showHidden':![],'depth':null}));}});})[_0x05cc('0x1a')](function(_0x37499c){return logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x57'),util[_0x05cc('0x2d')](_0x37499c,{'showHidden':![],'depth':null}));});}else{logger[_0x05cc('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05cc('0x2c'),_0x05cc('0x57'),_0x05cc('0x58'));}}else{logger[_0x05cc('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x05cc('0x57'),_0x05cc('0x4d'));}break;case _0x05cc('0x59'):var _0x58a7c7=require(_0x05cc('0x5a'));if(_0x52ea7d['apiKey']){var _0x19026c={};_0x19026c['login']=_0x52ea7d[_0x05cc('0x33')];_0x19026c['phone']=_0xfaa4b9['phone'];_0x19026c[_0x05cc('0x5b')]=_0x52ea7d[_0x05cc('0x23')];_0x19026c['text']=_0xfaa4b9[_0x05cc('0xe')];_0x19026c[_0x05cc('0x5c')]=+new Date();var _0x5a5038='';var _0x493139='';var _0x38c9f1=Object[_0x05cc('0x5d')](_0x19026c);_0x38c9f1[_0x05cc('0x5e')]();for(var _0x17aea1=0x0;_0x17aea1<_0x38c9f1['length'];_0x17aea1++){if(_0x5a5038!=''){_0x5a5038+='&';}_0x5a5038+=_0x38c9f1[_0x17aea1]+'='+encodeURIComponent(_0x19026c[_0x38c9f1[_0x17aea1]]);_0x493139+=_0x19026c[_0x38c9f1[_0x17aea1]];}_0x493139+=_0x52ea7d[_0x05cc('0x5f')];_0x493139=_0x58a7c7[_0x05cc('0x60')]('md5')[_0x05cc('0x2a')](_0x493139)[_0x05cc('0x61')](_0x05cc('0x62'));if(_0x5a5038!==''){_0x5a5038+='&';}_0x5a5038+=_0x05cc('0x63')+_0x493139;var _0x4a8085={'method':_0x05cc('0x34'),'uri':_0x52ea7d['baseUrl']+'/external/get/send.php?'+_0x5a5038,'json':!![]};return rp(_0x4a8085)[_0x05cc('0x1f')](function(_0x34caea){var _0x1dc99e=Object['keys'](_0x34caea);if(_0x34caea[_0x1dc99e[0x0]][_0x05cc('0x1b')]&&parseInt(_0x34caea[_0x1dc99e[0x0]][_0x05cc('0x1b')])===0x0){var _0x1b6d57={'messageId':_0x34caea[_0x1dc99e[0x0]][_0x05cc('0x64')]};if(!_0x52ea7d[_0x05cc('0x3d')]){_0x1b6d57['read']=!![];}return _0xcb033c[_0x05cc('0x2a')](_0x1b6d57);}else{return logger[_0x05cc('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05cc('0x2c'),_0x05cc('0x59'),util[_0x05cc('0x2d')](_0x34caea['error'],{'showHidden':![],'depth':null}));}})[_0x05cc('0x1a')](function(_0x2b4930){return logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x59'),util[_0x05cc('0x2d')](_0x2b4930,{'showHidden':![],'depth':null}));});}else{logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x59'),_0x05cc('0x65'));}break;case _0x05cc('0x66'):if(_0x52ea7d[_0x05cc('0x5f')]){var _0x4a7038={'method':_0x05cc('0x3c'),'uri':_0x05cc('0x67'),'headers':{'Authorization':_0x52ea7d[_0x05cc('0x5f')]},'body':{'content':_0xfaa4b9[_0x05cc('0xe')],'to':[_0xfaa4b9[_0x05cc('0x23')]],'from':_0x52ea7d['phone'],'binary':![],'clientMessageId':_0x05cc('0x68'),'charset':_0x05cc('0x69')},'json':!![]};rp(_0x4a7038)[_0x05cc('0x1f')](function(_0x244ca6){if(!_0x244ca6[_0x05cc('0x1b')]){var _0x5c7608={'messageId':_0x244ca6['messages'][0x0][_0x05cc('0x6a')]};if(!_0x52ea7d[_0x05cc('0x3d')]){_0x5c7608[_0x05cc('0x3e')]=!![];}return _0xcb033c['update'](_0x5c7608);}else{return logger[_0x05cc('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05cc('0x2c'),_0x05cc('0x66'),util[_0x05cc('0x2d')](_0x244ca6[_0x05cc('0x1b')],{'showHidden':![],'depth':null}));}})[_0x05cc('0x1a')](function(_0x401d01){return logger['error'](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x66'),util[_0x05cc('0x2d')](_0x401d01,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x66'),_0x05cc('0x65'));}break;case'bandwidth':if(_0x52ea7d[_0x05cc('0x33')]&&_0x52ea7d[_0x05cc('0x30')]){var _0x27e4a7=util['format'](_0x05cc('0x41'),_0x52ea7d[_0x05cc('0x33')],_0x52ea7d[_0x05cc('0x30')]);var _0x5c7e21={'method':_0x05cc('0x3c'),'uri':_0x05cc('0x6b')+_0x52ea7d[_0x05cc('0x6c')]+_0x05cc('0x6d'),'body':{'to':[_0xfaa4b9[_0x05cc('0x23')]],'text':_0xfaa4b9['body'],'from':_0x52ea7d['phone'],'applicationId':_0x52ea7d['applicationId']},'headers':{'Authorization':util['format'](_0x05cc('0x43'),new Buffer(_0x27e4a7)[_0x05cc('0x44')](_0x05cc('0x45')))},'json':!![]};rp(_0x5c7e21)[_0x05cc('0x1f')](function(_0x5cdd7f){if(_0x5cdd7f['id']){var _0x33f225={'messageId':_0x5cdd7f['id']};return _0xcb033c[_0x05cc('0x2a')](_0x33f225);}else{logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),'bandwidth',util[_0x05cc('0x2d')](_0x5cdd7f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x17a785){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05cc('0x2c'),_0x05cc('0x6e'),util[_0x05cc('0x2d')](_0x17a785,{'showHidden':![],'depth':null}));});}else{logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x6e'),_0x05cc('0x4d'));}break;case _0x05cc('0x6f'):if(_0x52ea7d[_0x05cc('0x5f')]){var _0x3cf564={};var _0x4a8085={'method':'POST','uri':_0x05cc('0x70'),'headers':{'Authorization':_0x05cc('0x71')+_0x52ea7d[_0x05cc('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x52ea7d[_0x05cc('0x23')],'to':_0xfaa4b9['phone'],'text':_0xfaa4b9[_0x05cc('0xe')]},'json':!![]};return rp(_0x4a8085)['then'](function(_0x9e0eb1){if(_0x9e0eb1[_0x05cc('0x72')]==0xca){_0x3cf564[_0x05cc('0x73')]=_0x9e0eb1;var _0x1fcd97={'method':'POST','uri':_0x05cc('0x74'),'headers':{'Authorization':_0x05cc('0x71')+_0x52ea7d[_0x05cc('0x5f')],'Content-Type':_0x05cc('0x55')},'body':{'refid':_0x3cf564[_0x05cc('0x73')][_0x05cc('0x75')]},'json':!![]};return rp(_0x1fcd97)[_0x05cc('0x1f')](function(_0x57e1ce){_0x3cf564[_0x05cc('0x76')]=_0x57e1ce;var _0x1788c7={'messageId':_0x3cf564[_0x05cc('0x73')][_0x05cc('0x75')],'read':!![]};return _0xcb033c[_0x05cc('0x2a')](_0x1788c7);});}else{return logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),'intelepeer',util[_0x05cc('0x2d')](_0x9e0eb1,{'showHidden':![],'depth':null}));}})[_0x05cc('0x1a')](function(_0x355bf8){return logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),_0x05cc('0x6f'),util[_0x05cc('0x2d')](_0x355bf8,{'showHidden':![],'depth':null}));});}else{return logger[_0x05cc('0x1b')](_0x05cc('0x2b'),_0x05cc('0x2c'),'intelepeer',_0x05cc('0x77'));}break;}}})[_0x05cc('0x78')](function(){_0x54b4ee();});}else{_0x54b4ee();}}},'charset':'utf8mb4','collate':_0x05cc('0x79')});}; \ No newline at end of file +var _0x97d9=['./smsMessage.attributes','exports','define','SmsMessage','fti_sms_messages','FULLTEXT','models','get','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','SmsInteraction','findOne','update','createdAt','direction','catch','error','SmsAccount','find','then','type','twilio','accountSid','authToken','messages','body','phone','remote','/api/sms/messages/','/status?token=','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','clicksend','xCALLY\x20Motion','senderString','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','clickSend','authId','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','sender','timestamp','length','createHash','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','%s:%s','https://messaging.bandwidth.com/api/v2/users/','accountId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xce00ca,_0x5b8f00){var _0x595d7a=function(_0x3cd65d){while(--_0x3cd65d){_0xce00ca['push'](_0xce00ca['shift']());}};_0x595d7a(++_0x5b8f00);}(_0x97d9,0x1e1));var _0x997d=function(_0x109360,_0x921bf8){_0x109360=_0x109360-0x0;var _0x3f05ea=_0x97d9[_0x109360];return _0x3f05ea;};'use strict';var _=require('lodash');var util=require(_0x997d('0x0'));var logger=require(_0x997d('0x1'))(_0x997d('0x2'));var moment=require(_0x997d('0x3'));var BPromise=require('bluebird');var rp=require(_0x997d('0x4'));var fs=require('fs');var path=require(_0x997d('0x5'));var rimraf=require(_0x997d('0x6'));var config=require('../../config/environment');var attributes=require(_0x997d('0x7'));module[_0x997d('0x8')]=function(_0x2fa919,_0x5aecb6){return _0x2fa919[_0x997d('0x9')](_0x997d('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x997d('0xb'),'fields':['body'],'type':_0x997d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58e858,_0x11d754,_0x401fd5){var _0x57c6a1=_0x2fa919[_0x997d('0xd')];var _0x4b6917=_0x58e858[_0x997d('0xe')]({'plain':!![]});if(_0x4b6917['direction'][_0x997d('0xf')]()==='in'||_0x4b6917['direction'][_0x997d('0xf')]()===_0x997d('0x10')&&!_0x4b6917[_0x997d('0x11')]&&!_['isNil'](_0x4b6917[_0x997d('0x12')])&&!_[_0x997d('0x13')](_0x4b6917[_0x997d('0x14')])){_0x57c6a1[_0x997d('0x15')][_0x997d('0x16')]({'where':{'id':_0x4b6917[_0x997d('0x14')]}})['then'](function(_0x7e5f8d){if(_0x7e5f8d){_0x7e5f8d[_0x997d('0x17')]({'lastMsgAt':_0x4b6917[_0x997d('0x18')],'lastMsgDirection':_0x4b6917[_0x997d('0x19')][_0x997d('0xf')]()});}})[_0x997d('0x1a')](function(_0x1a8780){console[_0x997d('0x1b')](_0x1a8780);});}if(_0x4b6917[_0x997d('0x19')]===_0x997d('0x10')&&!_0x4b6917[_0x997d('0x11')]){var _0x11acbc;_0x57c6a1[_0x997d('0x1c')][_0x997d('0x1d')]({'where':{'id':_0x4b6917['SmsAccountId']},'raw':!![]})[_0x997d('0x1e')](function(_0x2839f2){_0x11acbc=_0x2839f2;if(_0x11acbc&&_0x11acbc[_0x997d('0x1f')]){switch(_0x11acbc['type']){case _0x997d('0x20'):var _0x55ae3e=require(_0x997d('0x20'));if(_0x11acbc[_0x997d('0x21')]&&_0x11acbc['authToken']&&_0x11acbc['phone']){var _0xaa4580=new _0x55ae3e(_0x11acbc[_0x997d('0x21')],_0x11acbc[_0x997d('0x22')]);_0xaa4580[_0x997d('0x23')]['create']({'body':_0x4b6917[_0x997d('0x24')],'to':_0x4b6917[_0x997d('0x25')],'from':_0x11acbc[_0x997d('0x25')],'statusCallback':_0x11acbc[_0x997d('0x26')]+_0x997d('0x27')+_0x4b6917['id']+_0x997d('0x28')+_0x11acbc['token']})[_0x997d('0x1e')](function(_0x49d3e8){if(_0x49d3e8[_0x997d('0x29')]){return _0x58e858['update']({'messageId':_0x49d3e8[_0x997d('0x29')]});}})[_0x997d('0x1a')](function(_0x27b3b0){logger[_0x997d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),_0x997d('0x20'),util[_0x997d('0x2b')](_0x27b3b0,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'twilio',_0x997d('0x2d'));}break;case _0x997d('0x2e'):var _0x2d7398=_0x997d('0x2f');if(_0x11acbc[_0x997d('0x30')]&&_0x11acbc[_0x997d('0x31')]){var _0xe53128={'recipient':[_0x4b6917[_0x997d('0x25')]],'message':_0x4b6917[_0x997d('0x24')],'message_type':_0x11acbc['smsMethod']};if(_0x11acbc[_0x997d('0x32')]&&_0x11acbc['smsMethod']!=='SI'){_0xe53128['sender']=_0x11acbc[_0x997d('0x25')];}var _0x33ab11={'url':_0x2d7398+'login?username='+_0x11acbc[_0x997d('0x30')]+_0x997d('0x33')+_0x11acbc[_0x997d('0x31')],'method':_0x997d('0x34')};rp(_0x33ab11)[_0x997d('0x1e')](function(_0x57d83a){var _0x1bd93d=_0x57d83a[_0x997d('0x35')](';');var _0x5ce8a2={'user_key':_0x1bd93d[0x0],'session_key':_0x1bd93d[0x1]};_0x33ab11={'url':_0x2d7398+_0x997d('0x36'),'method':_0x997d('0x37'),'headers':{'user_key':_0x5ce8a2[_0x997d('0x38')],'Session_key':_0x5ce8a2[_0x997d('0x39')]},'json':!![],'body':_0xe53128};return rp(_0x33ab11);})['then'](function(_0x2d2c88){if(_0x2d2c88[_0x997d('0x3a')]>=0x1){var _0x3985db={'messageId':_0x2d2c88[_0x997d('0x3b')]};if(_0x11acbc[_0x997d('0x32')]!=='GP'||!_0x11acbc[_0x997d('0x3c')]){_0x3985db[_0x997d('0x3d')]=!![];}return _0x58e858[_0x997d('0x17')](_0x3985db);}else{return logger['error'](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x2e'),util[_0x997d('0x2b')](_0x2d2c88,{'showHidden':![],'depth':null}));}})[_0x997d('0x1a')](function(_0x302c24){return logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x2e'),util[_0x997d('0x2b')](_0x302c24,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'skebby',_0x997d('0x3e'));}break;case'connectel':if(_0x11acbc[_0x997d('0x22')]){var _0x3e957a={'recipient':_0x4b6917[_0x997d('0x25')],'message':_0x4b6917[_0x997d('0x24')],'sender':_0x11acbc['senderString']||_0x11acbc['phone'],'authorization':_0x11acbc[_0x997d('0x22')]};var _0x11d754={'method':_0x997d('0x37'),'uri':_0x997d('0x3f'),'body':_0x3e957a,'json':!![]};rp(_0x11d754)['then'](function(_0x18846c){var _0x51f17d={'messageId':_0x18846c[_0x997d('0x40')]};if(!_0x11acbc[_0x997d('0x3c')]){_0x51f17d['read']=!![];}return _0x58e858[_0x997d('0x17')](_0x51f17d);})[_0x997d('0x1a')](function(_0x99180c){logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x41'),util['inspect'](_0x99180c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x997d('0x2c'),'afterCreate',_0x997d('0x41'),'Missing\x20parameters:\x20authToken');}break;case _0x997d('0x42'):if(_0x11acbc[_0x997d('0x30')]&&_0x11acbc['password']){var _0x3e957a={'messages':[{'source':_0x997d('0x43'),'to':_0x4b6917[_0x997d('0x25')],'body':_0x4b6917[_0x997d('0x24')],'from':_0x11acbc[_0x997d('0x44')]||_0x11acbc['phone']}]};var _0xa4772f=util[_0x997d('0x45')]('%s:%s',_0x11acbc['username'],_0x11acbc[_0x997d('0x31')]);var _0x11d754={'method':_0x997d('0x37'),'uri':_0x997d('0x46'),'body':_0x3e957a,'headers':{'Authorization':util['format'](_0x997d('0x47'),new Buffer(_0xa4772f)['toString'](_0x997d('0x48')))},'json':!![]};rp(_0x11d754)[_0x997d('0x1e')](function(_0x12aa83){if(_0x12aa83[_0x997d('0x49')]>=0xc8&&_0x12aa83[_0x997d('0x49')]<=0xce){if(_0x12aa83[_0x997d('0x4a')]&&_0x12aa83[_0x997d('0x4a')][_0x997d('0x4b')]>0x0){var _0x359130=_['head'](_0x12aa83['data']['messages']);var _0x5df2ca={'messageId':_0x359130['message_id']};if(!_0x11acbc['deliveryReport']){_0x5df2ca[_0x997d('0x3d')]=!![];}return _0x58e858[_0x997d('0x17')](_0x5df2ca);}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x4c'),util[_0x997d('0x2b')](_0x12aa83,{'showHidden':![],'depth':null}));}}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x4c'),util[_0x997d('0x2b')](_0x12aa83,{'showHidden':![],'depth':null}));}})[_0x997d('0x1a')](function(_0x1e1e0f){logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x4c'),util['inspect'](_0x1e1e0f,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x997d('0x4c'),_0x997d('0x3e'));}break;case'plivo':if(_0x11acbc[_0x997d('0x4d')]&&_0x11acbc[_0x997d('0x22')]){var _0x3e957a={'dst':_0x4b6917[_0x997d('0x25')],'text':_0x4b6917['body'],'src':_0x11acbc[_0x997d('0x44')]||_0x11acbc[_0x997d('0x25')],'url':_0x11acbc[_0x997d('0x26')]+_0x997d('0x27')+_0x4b6917['id']+'/status?token='+_0x11acbc['token']};var _0xa4772f=util[_0x997d('0x45')]('%s:%s',_0x11acbc['authId'],_0x11acbc[_0x997d('0x22')]);var _0x11d754={'method':_0x997d('0x37'),'uri':util[_0x997d('0x45')]('https://api.plivo.com/v1/Account/%s/Message/',_0x11acbc['authId']),'body':_0x3e957a,'headers':{'Authorization':util['format'](_0x997d('0x47'),new Buffer(_0xa4772f)[_0x997d('0x4e')]('base64'))},'json':!![]};rp(_0x11d754)[_0x997d('0x1e')](function(_0x5b7b55){var _0x189e5b={'messageId':_0x5b7b55[_0x997d('0x4f')][0x0]};return _0x58e858[_0x997d('0x17')](_0x189e5b);})[_0x997d('0x1a')](function(_0x240b51){logger[_0x997d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),_0x997d('0x50'),util[_0x997d('0x2b')](_0x240b51,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'plivo',_0x997d('0x51'));}break;case'infobip':if(_0x11acbc[_0x997d('0x30')]&&_0x11acbc[_0x997d('0x31')]){if(_0x11acbc[_0x997d('0x52')]){var _0x29f6c1={'method':_0x997d('0x37'),'uri':_0x11acbc['baseUrl']+_0x997d('0x53'),'body':{'username':_0x11acbc[_0x997d('0x30')],'password':_0x11acbc['password']},'json':!![]};return rp(_0x29f6c1)[_0x997d('0x1e')](function(_0x278578){var _0x1e366c={'method':_0x997d('0x37'),'uri':_0x11acbc[_0x997d('0x52')]+_0x997d('0x54'),'body':{'messages':[{'from':_0x11acbc['phone'],'destinations':[{'to':_0x4b6917['phone']}],'text':_0x4b6917['body'],'notifyUrl':_0x11acbc['remote']+_0x997d('0x27')+_0x4b6917['id']+_0x997d('0x28')+_0x11acbc[_0x997d('0x55')],'notifyContentType':_0x997d('0x56'),'callbackData':_0x11acbc['phone']+';'+_0x4b6917[_0x997d('0x24')]}]},'headers':{'Authorization':_0x997d('0x57')+_0x278578[_0x997d('0x55')]},'json':!![]};return rp(_0x1e366c)[_0x997d('0x1e')](function(_0x31fa98){if(_0x31fa98[_0x997d('0x23')]){var _0x3ddf54={'messageId':_0x31fa98[_0x997d('0x23')][0x0]['messageId']};if(!_0x11acbc['deliveryReport']){_0x3ddf54['read']=!![];}return _0x58e858[_0x997d('0x17')](_0x3ddf54);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),_0x997d('0x58'),util['inspect'](_0x31fa98,{'showHidden':![],'depth':null}));}});})[_0x997d('0x1a')](function(_0x55f67d){return logger[_0x997d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),'infobip',util[_0x997d('0x2b')](_0x55f67d,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x58'),_0x997d('0x59'));}}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'infobip',_0x997d('0x3e'));}break;case _0x997d('0x5a'):var _0x4266c9=require('crypto');if(_0x11acbc[_0x997d('0x5b')]){var _0x1faf76={};_0x1faf76[_0x997d('0x5c')]=_0x11acbc[_0x997d('0x30')];_0x1faf76[_0x997d('0x25')]=_0x4b6917[_0x997d('0x25')];_0x1faf76[_0x997d('0x5d')]=_0x11acbc[_0x997d('0x25')];_0x1faf76['text']=_0x4b6917[_0x997d('0x24')];_0x1faf76[_0x997d('0x5e')]=+new Date();var _0x1706e9='';var _0x446459='';var _0xc37ddd=Object['keys'](_0x1faf76);_0xc37ddd['sort']();for(var _0xa34671=0x0;_0xa34671<_0xc37ddd[_0x997d('0x5f')];_0xa34671++){if(_0x1706e9!=''){_0x1706e9+='&';}_0x1706e9+=_0xc37ddd[_0xa34671]+'='+encodeURIComponent(_0x1faf76[_0xc37ddd[_0xa34671]]);_0x446459+=_0x1faf76[_0xc37ddd[_0xa34671]];}_0x446459+=_0x11acbc[_0x997d('0x5b')];_0x446459=_0x4266c9[_0x997d('0x60')]('md5')['update'](_0x446459)[_0x997d('0x61')](_0x997d('0x62'));if(_0x1706e9!==''){_0x1706e9+='&';}_0x1706e9+=_0x997d('0x63')+_0x446459;var _0x33ab11={'method':_0x997d('0x34'),'uri':_0x11acbc[_0x997d('0x52')]+_0x997d('0x64')+_0x1706e9,'json':!![]};return rp(_0x33ab11)[_0x997d('0x1e')](function(_0x45b41f){var _0x4fad41=Object[_0x997d('0x65')](_0x45b41f);if(_0x45b41f[_0x4fad41[0x0]][_0x997d('0x1b')]&&parseInt(_0x45b41f[_0x4fad41[0x0]][_0x997d('0x1b')])===0x0){var _0x4c0248={'messageId':_0x45b41f[_0x4fad41[0x0]][_0x997d('0x66')]};if(!_0x11acbc['deliveryReport']){_0x4c0248[_0x997d('0x3d')]=!![];}return _0x58e858[_0x997d('0x17')](_0x4c0248);}else{return logger[_0x997d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),_0x997d('0x5a'),util[_0x997d('0x2b')](_0x45b41f[_0x997d('0x1b')],{'showHidden':![],'depth':null}));}})[_0x997d('0x1a')](function(_0x59e7fe){return logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'csc',util[_0x997d('0x2b')](_0x59e7fe,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'csc',_0x997d('0x67'));}break;case _0x997d('0x68'):if(_0x11acbc[_0x997d('0x5b')]){var _0x48f9d9={'method':_0x997d('0x37'),'uri':_0x997d('0x69'),'headers':{'Authorization':_0x11acbc[_0x997d('0x5b')]},'body':{'content':_0x4b6917[_0x997d('0x24')],'to':[_0x4b6917[_0x997d('0x25')]],'from':_0x11acbc[_0x997d('0x25')],'binary':![],'clientMessageId':_0x997d('0x6a'),'charset':'UTF-8'},'json':!![]};rp(_0x48f9d9)[_0x997d('0x1e')](function(_0x16553d){if(!_0x16553d[_0x997d('0x1b')]){var _0x7a27f3={'messageId':_0x16553d['messages'][0x0][_0x997d('0x6b')]};if(!_0x11acbc[_0x997d('0x3c')]){_0x7a27f3[_0x997d('0x3d')]=!![];}return _0x58e858[_0x997d('0x17')](_0x7a27f3);}else{return logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'clickatell',util[_0x997d('0x2b')](_0x16553d[_0x997d('0x1b')],{'showHidden':![],'depth':null}));}})[_0x997d('0x1a')](function(_0x1f826b){return logger[_0x997d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),_0x997d('0x68'),util['inspect'](_0x1f826b,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'clickatell',_0x997d('0x67'));}break;case'bandwidth':if(_0x11acbc[_0x997d('0x30')]&&_0x11acbc[_0x997d('0x31')]){var _0xa4772f=util[_0x997d('0x45')](_0x997d('0x6c'),_0x11acbc['username'],_0x11acbc[_0x997d('0x31')]);var _0x11d754={'method':'POST','uri':_0x997d('0x6d')+_0x11acbc[_0x997d('0x6e')]+'/messages','body':{'to':[_0x4b6917[_0x997d('0x25')]],'text':_0x4b6917[_0x997d('0x24')],'from':_0x11acbc[_0x997d('0x25')],'applicationId':_0x11acbc['applicationId']},'headers':{'Authorization':util[_0x997d('0x45')](_0x997d('0x47'),new Buffer(_0xa4772f)['toString'](_0x997d('0x48')))},'json':!![]};rp(_0x11d754)['then'](function(_0x348d64){if(_0x348d64['id']){var _0x5a7eb3={'messageId':_0x348d64['id']};return _0x58e858['update'](_0x5a7eb3);}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),'bandwidth',util['inspect'](_0x348d64,{'showHidden':![],'depth':null}));}})[_0x997d('0x1a')](function(_0x73c8e4){logger[_0x997d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),_0x997d('0x6f'),util[_0x997d('0x2b')](_0x73c8e4,{'showHidden':![],'depth':null}));});}else{logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x6f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x997d('0x70'):if(_0x11acbc['apiKey']){var _0x310c11={};var _0x33ab11={'method':_0x997d('0x37'),'uri':_0x997d('0x71'),'headers':{'Authorization':_0x997d('0x72')+_0x11acbc[_0x997d('0x5b')],'Content-Type':_0x997d('0x56')},'body':{'from':_0x11acbc['phone'],'to':_0x4b6917['phone'],'text':_0x4b6917[_0x997d('0x24')]},'json':!![]};return rp(_0x33ab11)['then'](function(_0x4ca4b9){if(_0x4ca4b9['code']==0xca){_0x310c11[_0x997d('0x73')]=_0x4ca4b9;var _0x1b399a={'method':_0x997d('0x37'),'uri':_0x997d('0x74'),'headers':{'Authorization':_0x997d('0x72')+_0x11acbc['apiKey'],'Content-Type':_0x997d('0x56')},'body':{'refid':_0x310c11['message'][_0x997d('0x75')]},'json':!![]};return rp(_0x1b399a)[_0x997d('0x1e')](function(_0x130211){_0x310c11[_0x997d('0x76')]=_0x130211;var _0x29a1f4={'messageId':_0x310c11['message'][_0x997d('0x75')],'read':!![]};return _0x58e858[_0x997d('0x17')](_0x29a1f4);});}else{return logger['error'](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x70'),util[_0x997d('0x2b')](_0x4ca4b9,{'showHidden':![],'depth':null}));}})[_0x997d('0x1a')](function(_0x11d1b2){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x997d('0x2a'),'intelepeer',util['inspect'](_0x11d1b2,{'showHidden':![],'depth':null}));});}else{return logger[_0x997d('0x1b')](_0x997d('0x2c'),_0x997d('0x2a'),_0x997d('0x70'),_0x997d('0x77'));}break;}}})[_0x997d('0x78')](function(){_0x401fd5();});}else{_0x401fd5();}}},'charset':'utf8mb4','collate':_0x997d('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index a958282..c92cd4f 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 _0xd820=['error','message','CreateSmsMessage','create','body','options','raw','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3dfb00,_0x26ff95){var _0x568f23=function(_0x5d722d){while(--_0x5d722d){_0x3dfb00['push'](_0x3dfb00['shift']());}};_0x568f23(++_0x26ff95);}(_0xd820,0x101));var _0x0d82=function(_0x5f56c0,_0x2d9513){_0x5f56c0=_0x5f56c0-0x0;var _0x1a5e10=_0xd820[_0x5f56c0];return _0x1a5e10;};'use strict';var _=require(_0x0d82('0x0'));var util=require(_0x0d82('0x1'));var moment=require(_0x0d82('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d82('0x3'));var fs=require('fs');var Redis=require(_0x0d82('0x4'));var db=require(_0x0d82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d82('0x6'))(_0x0d82('0x7'));var config=require(_0x0d82('0x8'));var jayson=require(_0x0d82('0x9'));var client=jayson[_0x0d82('0xa')]['http']({'port':0x232a});config[_0x0d82('0xb')]=_[_0x0d82('0xc')](config[_0x0d82('0xb')],{'host':_0x0d82('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d82('0xb')]));require('./smsMessage.socket')[_0x0d82('0xe')](socket);function respondWithRpcPromise(_0x8bea26,_0x47fd97,_0x544e34){return new BPromise(function(_0x2f14ec,_0x2a91eb){return client[_0x0d82('0xf')](_0x8bea26,_0x544e34)[_0x0d82('0x10')](function(_0x3350b1){logger[_0x0d82('0x11')](_0x0d82('0x12'),_0x47fd97,_0x0d82('0x13'));logger[_0x0d82('0x14')](_0x0d82('0x15'),_0x47fd97,_0x0d82('0x13'),JSON['stringify'](_0x3350b1));if(_0x3350b1['error']){if(_0x3350b1['error']['code']===0x1f4){logger[_0x0d82('0x16')](_0x0d82('0x12'),_0x47fd97,_0x3350b1[_0x0d82('0x16')][_0x0d82('0x17')]);return _0x2a91eb(_0x3350b1[_0x0d82('0x16')]['message']);}logger[_0x0d82('0x16')]('SmsMessage,\x20%s,\x20%s',_0x47fd97,_0x3350b1[_0x0d82('0x16')][_0x0d82('0x17')]);return _0x2f14ec(_0x3350b1['error'][_0x0d82('0x17')]);}else{logger[_0x0d82('0x11')](_0x0d82('0x12'),_0x47fd97,_0x0d82('0x13'));_0x2f14ec(_0x3350b1['result'][_0x0d82('0x17')]);}})['catch'](function(_0x260040){logger[_0x0d82('0x16')]('SmsMessage,\x20%s,\x20%s',_0x47fd97,_0x260040);_0x2a91eb(_0x260040);});});}exports[_0x0d82('0x18')]=function(_0x290c1b){var _0x3e3ecd=this;return new Promise(function(_0x59d44d,_0x3e0a4f){return db['SmsMessage'][_0x0d82('0x19')](_0x290c1b[_0x0d82('0x1a')],{'raw':_0x290c1b[_0x0d82('0x1b')]?_0x290c1b[_0x0d82('0x1b')][_0x0d82('0x1c')]===undefined?!![]:![]:!![]})[_0x0d82('0x10')](function(_0x1a45a2){logger['info']('CreateSmsMessage',_0x290c1b);logger[_0x0d82('0x14')]('CreateSmsMessage',_0x290c1b,JSON[_0x0d82('0x1d')](_0x1a45a2));_0x59d44d(_0x1a45a2);})[_0x0d82('0x1e')](function(_0x5175e7){logger[_0x0d82('0x16')](_0x0d82('0x18'),_0x5175e7[_0x0d82('0x17')],_0x290c1b);_0x3e0a4f(_0x3e3ecd['error'](0x1f4,_0x5175e7[_0x0d82('0x17')]));});});}; \ No newline at end of file +var _0x10a8=['message','info','CreateSmsMessage','SmsMessage','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x10a8,0x1b5));var _0x810a=function(_0xf45844,_0x494086){_0xf45844=_0xf45844-0x0;var _0x5c0b97=_0x10a8[_0xf45844];return _0x5c0b97;};'use strict';var _=require(_0x810a('0x0'));var util=require(_0x810a('0x1'));var moment=require('moment');var BPromise=require(_0x810a('0x2'));var rs=require(_0x810a('0x3'));var fs=require('fs');var Redis=require(_0x810a('0x4'));var db=require(_0x810a('0x5'))['db'];var utils=require(_0x810a('0x6'));var logger=require(_0x810a('0x7'))(_0x810a('0x8'));var config=require('../../config/environment');var jayson=require(_0x810a('0x9'));var client=jayson[_0x810a('0xa')][_0x810a('0xb')]({'port':0x232a});config[_0x810a('0xc')]=_['defaults'](config[_0x810a('0xc')],{'host':_0x810a('0xd'),'port':0x18eb});var socket=require(_0x810a('0xe'))(new Redis(config[_0x810a('0xc')]));require(_0x810a('0xf'))[_0x810a('0x10')](socket);function respondWithRpcPromise(_0x268711,_0x9351a,_0x101076){return new BPromise(function(_0x3c1cf2,_0x2a260d){return client[_0x810a('0x11')](_0x268711,_0x101076)[_0x810a('0x12')](function(_0x5e7278){logger['info'](_0x810a('0x13'),_0x9351a,_0x810a('0x14'));logger[_0x810a('0x15')](_0x810a('0x16'),_0x9351a,_0x810a('0x14'),JSON['stringify'](_0x5e7278));if(_0x5e7278[_0x810a('0x17')]){if(_0x5e7278['error'][_0x810a('0x18')]===0x1f4){logger[_0x810a('0x17')](_0x810a('0x13'),_0x9351a,_0x5e7278[_0x810a('0x17')]['message']);return _0x2a260d(_0x5e7278['error'][_0x810a('0x19')]);}logger[_0x810a('0x17')](_0x810a('0x13'),_0x9351a,_0x5e7278['error']['message']);return _0x3c1cf2(_0x5e7278[_0x810a('0x17')]['message']);}else{logger[_0x810a('0x1a')](_0x810a('0x13'),_0x9351a,_0x810a('0x14'));_0x3c1cf2(_0x5e7278['result']['message']);}})['catch'](function(_0x38c9c0){logger[_0x810a('0x17')]('SmsMessage,\x20%s,\x20%s',_0x9351a,_0x38c9c0);_0x2a260d(_0x38c9c0);});});}exports[_0x810a('0x1b')]=function(_0x3dcee8){var _0x42df34=this;return new Promise(function(_0x4ba0ba,_0x5813cd){return db[_0x810a('0x1c')][_0x810a('0x1d')](_0x3dcee8['body'],{'raw':_0x3dcee8[_0x810a('0x1e')]?_0x3dcee8['options'][_0x810a('0x1f')]===undefined?!![]:![]:!![]})[_0x810a('0x12')](function(_0x5e9ec5){logger['info'](_0x810a('0x1b'),_0x3dcee8);logger[_0x810a('0x15')](_0x810a('0x1b'),_0x3dcee8,JSON[_0x810a('0x20')](_0x5e9ec5));_0x4ba0ba(_0x5e9ec5);})['catch'](function(_0x509347){logger[_0x810a('0x17')](_0x810a('0x1b'),_0x509347[_0x810a('0x19')],_0x3dcee8);_0x5813cd(_0x42df34[_0x810a('0x17')](0x1f4,_0x509347[_0x810a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 7eef8e2..e46f38c 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 _0xaf27=['removeListener','register','smsMessage:','./smsMessage.events','save','update'];(function(_0x1084a5,_0x579890){var _0xf18360=function(_0x595ade){while(--_0x595ade){_0x1084a5['push'](_0x1084a5['shift']());}};_0xf18360(++_0x579890);}(_0xaf27,0x105));var _0x7af2=function(_0x3dcae6,_0x24652e){_0x3dcae6=_0x3dcae6-0x0;var _0x24fc25=_0xaf27[_0x3dcae6];return _0x24fc25;};'use strict';var SmsMessageEvents=require(_0x7af2('0x0'));var events=[_0x7af2('0x1'),'remove',_0x7af2('0x2')];function createListener(_0x207ad3,_0x23ccc5){return function(_0x5ea15d){_0x23ccc5['emit'](_0x207ad3,_0x5ea15d);};}function removeListener(_0x31f7da,_0x54464e){return function(){SmsMessageEvents[_0x7af2('0x3')](_0x31f7da,_0x54464e);};}exports[_0x7af2('0x4')]=function(_0x21c8ef){for(var _0x48ed1d=0x0,_0x4f3ffe=events['length'];_0x48ed1d<_0x4f3ffe;_0x48ed1d++){var _0x66ea39=events[_0x48ed1d];var _0xdc86ff=createListener(_0x7af2('0x5')+_0x66ea39,_0x21c8ef);SmsMessageEvents['on'](_0x66ea39,_0xdc86ff);}}; \ No newline at end of file +var _0xef8f=['./smsMessage.events','save','remove','emit','length','smsMessage:'];(function(_0x1ad07b,_0x551d55){var _0x2c447f=function(_0x43340b){while(--_0x43340b){_0x1ad07b['push'](_0x1ad07b['shift']());}};_0x2c447f(++_0x551d55);}(_0xef8f,0xe4));var _0xfef8=function(_0x232ba4,_0x1eb213){_0x232ba4=_0x232ba4-0x0;var _0x3849b2=_0xef8f[_0x232ba4];return _0x3849b2;};'use strict';var SmsMessageEvents=require(_0xfef8('0x0'));var events=[_0xfef8('0x1'),_0xfef8('0x2'),'update'];function createListener(_0x79db89,_0x1383ea){return function(_0x39a58f){_0x1383ea[_0xfef8('0x3')](_0x79db89,_0x39a58f);};}function removeListener(_0x2234da,_0x5ad5b0){return function(){SmsMessageEvents['removeListener'](_0x2234da,_0x5ad5b0);};}exports['register']=function(_0xe2084c){for(var _0x2cb1df=0x0,_0x4759ed=events[_0xfef8('0x4')];_0x2cb1df<_0x4759ed;_0x2cb1df++){var _0x52b8d4=events[_0x2cb1df];var _0x1c0dfa=createListener(_0xfef8('0x5')+_0x52b8d4,_0xe2084c);SmsMessageEvents['on'](_0x52b8d4,_0x1c0dfa);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 7e14082..bcb2357 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 _0x3cce=['Router','fs-extra','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put','update','destroy','removeTeams','delete','removeAgents','util','path','express'];(function(_0x36ab38,_0x99bd6d){var _0x2cf764=function(_0x6eb012){while(--_0x6eb012){_0x36ab38['push'](_0x36ab38['shift']());}};_0x2cf764(++_0x99bd6d);}(_0x3cce,0x11b));var _0xe3cc=function(_0x58fc5e,_0x25c858){_0x58fc5e=_0x58fc5e-0x0;var _0x175778=_0x3cce[_0x58fc5e];return _0x175778;};'use strict';var multer=require('multer');var util=require(_0xe3cc('0x0'));var path=require(_0xe3cc('0x1'));var timeout=require('connect-timeout');var express=require(_0xe3cc('0x2'));var router=express[_0xe3cc('0x3')]();var fs_extra=require(_0xe3cc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe3cc('0x5'));var config=require('../../config/environment');var controller=require(_0xe3cc('0x6'));router[_0xe3cc('0x7')]('/',auth[_0xe3cc('0x8')](),controller[_0xe3cc('0x9')]);router[_0xe3cc('0x7')](_0xe3cc('0xa'),auth[_0xe3cc('0x8')](),controller['describe']);router['get']('/:id',auth[_0xe3cc('0x8')](),controller[_0xe3cc('0xb')]);router[_0xe3cc('0x7')](_0xe3cc('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0xe3cc('0x7')](_0xe3cc('0xd'),auth[_0xe3cc('0x8')](),controller[_0xe3cc('0xe')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xe3cc('0xf')]);router[_0xe3cc('0x10')]('/',auth[_0xe3cc('0x8')](),controller[_0xe3cc('0x11')]);router[_0xe3cc('0x10')]('/:id/teams',auth[_0xe3cc('0x8')](),controller[_0xe3cc('0x12')]);router[_0xe3cc('0x10')](_0xe3cc('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0xe3cc('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe3cc('0x15')]);router['delete']('/:id',auth[_0xe3cc('0x8')](),controller[_0xe3cc('0x16')]);router['delete'](_0xe3cc('0xd'),auth['isAuthenticated'](),controller[_0xe3cc('0x17')]);router[_0xe3cc('0x18')](_0xe3cc('0x13'),auth[_0xe3cc('0x8')](),controller[_0xe3cc('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2dc8=['index','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x2dc8,0xb4));var _0x82dc=function(_0x5ec09a,_0x35b386){_0x5ec09a=_0x5ec09a-0x0;var _0x1f3c39=_0x2dc8[_0x5ec09a];return _0x1f3c39;};'use strict';var multer=require(_0x82dc('0x0'));var util=require(_0x82dc('0x1'));var path=require(_0x82dc('0x2'));var timeout=require(_0x82dc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x82dc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82dc('0x5'));var config=require(_0x82dc('0x6'));var controller=require('./smsQueue.controller');router[_0x82dc('0x7')]('/',auth[_0x82dc('0x8')](),controller[_0x82dc('0x9')]);router[_0x82dc('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x82dc('0xa')]);router[_0x82dc('0x7')](_0x82dc('0xb'),auth[_0x82dc('0x8')](),controller['show']);router[_0x82dc('0x7')]('/:id/members',auth[_0x82dc('0x8')](),controller[_0x82dc('0xc')]);router[_0x82dc('0x7')](_0x82dc('0xd'),auth['isAuthenticated'](),controller[_0x82dc('0xe')]);router['get'](_0x82dc('0xf'),auth['isAuthenticated'](),controller[_0x82dc('0x10')]);router[_0x82dc('0x11')]('/',auth['isAuthenticated'](),controller[_0x82dc('0x12')]);router[_0x82dc('0x11')](_0x82dc('0xd'),auth['isAuthenticated'](),controller[_0x82dc('0x13')]);router[_0x82dc('0x11')](_0x82dc('0xf'),auth['isAuthenticated'](),controller['addAgents']);router[_0x82dc('0x14')](_0x82dc('0xb'),auth[_0x82dc('0x8')](),controller[_0x82dc('0x15')]);router[_0x82dc('0x16')](_0x82dc('0xb'),auth[_0x82dc('0x8')](),controller[_0x82dc('0x17')]);router[_0x82dc('0x16')](_0x82dc('0xd'),auth[_0x82dc('0x8')](),controller[_0x82dc('0x18')]);router[_0x82dc('0x16')]('/:id/users',auth[_0x82dc('0x8')](),controller[_0x82dc('0x19')]);module[_0x82dc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index f0970f5..bf99abc 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 _0x6ae8=['STRING','rrmemory','beepall','roundrobin','exports','name'];(function(_0x42b9f2,_0x3af552){var _0x4e408d=function(_0x59878e){while(--_0x59878e){_0x42b9f2['push'](_0x42b9f2['shift']());}};_0x4e408d(++_0x3af552);}(_0x6ae8,0x76));var _0x86ae=function(_0x1c581f,_0x444b11){_0x1c581f=_0x1c581f-0x0;var _0x38f732=_0x6ae8[_0x1c581f];return _0x38f732;};'use strict';var Sequelize=require('sequelize');module[_0x86ae('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x86ae('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x86ae('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x86ae('0x3'),_0x86ae('0x4'),_0x86ae('0x5'))}}; \ No newline at end of file +var _0xeee1=['ENUM','roundrobin','sequelize','STRING','name'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0xeee1,0xb6));var _0x1eee=function(_0x403cff,_0x252057){_0x403cff=_0x403cff-0x0;var _0x466f23=_0xeee1[_0x403cff];return _0x466f23;};'use strict';var Sequelize=require(_0x1eee('0x0'));module['exports']={'name':{'type':Sequelize[_0x1eee('0x1')],'unique':_0x1eee('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1eee('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1eee('0x3')]('rrmemory','beepall',_0x1eee('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 9ef09af..0c3fe52 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 _0xb120=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','ids','Agents','flatMap','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userSmsQueue:remove','getAgents','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb120,0x7f));var _0x0b12=function(_0x82edec,_0x38043a){_0x82edec=_0x82edec-0x0;var _0x23f7d8=_0xb120[_0x82edec];return _0x23f7d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b12('0x0'));var zipdir=require(_0x0b12('0x1'));var jsonpatch=require(_0x0b12('0x2'));var rp=require(_0x0b12('0x3'));var moment=require('moment');var BPromise=require(_0x0b12('0x4'));var Mustache=require(_0x0b12('0x5'));var util=require(_0x0b12('0x6'));var path=require(_0x0b12('0x7'));var sox=require(_0x0b12('0x8'));var csv=require(_0x0b12('0x9'));var ejs=require(_0x0b12('0xa'));var fs=require('fs');var fs_extra=require(_0x0b12('0xb'));var _=require(_0x0b12('0xc'));var squel=require(_0x0b12('0xd'));var crypto=require(_0x0b12('0xe'));var jsforce=require(_0x0b12('0xf'));var deskjs=require(_0x0b12('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0b12('0x11'));var Papa=require(_0x0b12('0x12'));var Redis=require(_0x0b12('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0b12('0x14'));var as=require(_0x0b12('0x15'));var hardwareService=require(_0x0b12('0x16'));var logger=require(_0x0b12('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b12('0x18'));var db=require(_0x0b12('0x19'))['db'];config['redis']=_[_0x0b12('0x1a')](config['redis'],{'host':_0x0b12('0x1b'),'port':0x18eb});var socket=require(_0x0b12('0x1c'))(new Redis(config['redis']));require(_0x0b12('0x1d'))[_0x0b12('0x1e')](socket);function respondWithStatusCode(_0x5a69a0,_0x3f80e4){_0x3f80e4=_0x3f80e4||0xcc;return function(_0x3093c9){if(_0x3093c9){return _0x5a69a0[_0x0b12('0x1f')](_0x3f80e4);}return _0x5a69a0[_0x0b12('0x20')](_0x3f80e4)[_0x0b12('0x21')]();};}function respondWithResult(_0x429890,_0x19a1a7){_0x19a1a7=_0x19a1a7||0xc8;return function(_0xd60eb0){if(_0xd60eb0){return _0x429890[_0x0b12('0x20')](_0x19a1a7)[_0x0b12('0x22')](_0xd60eb0);}};}function respondWithFilteredResult(_0x35a5e,_0x2e83f6){return function(_0x2fb0b6){if(_0x2fb0b6){var _0x240ce6=typeof _0x2e83f6[_0x0b12('0x23')]===_0x0b12('0x24')&&typeof _0x2e83f6[_0x0b12('0x25')]===_0x0b12('0x24');var _0x1222c6=_0x2fb0b6[_0x0b12('0x26')];var _0x2ece66=_0x240ce6?0x0:_0x2e83f6[_0x0b12('0x23')];var _0x44d3b2=_0x240ce6?_0x2fb0b6['count']:_0x2e83f6[_0x0b12('0x23')]+_0x2e83f6[_0x0b12('0x25')];var _0x2ed93f;if(_0x44d3b2>=_0x1222c6){_0x44d3b2=_0x1222c6;_0x2ed93f=0xc8;}else{_0x2ed93f=0xce;}_0x35a5e['status'](_0x2ed93f);return _0x35a5e[_0x0b12('0x27')](_0x0b12('0x28'),_0x2ece66+'-'+_0x44d3b2+'/'+_0x1222c6)['json'](_0x2fb0b6);}return null;};}function patchUpdates(_0xc2916f){return function(_0x2d60a9){try{jsonpatch[_0x0b12('0x29')](_0x2d60a9,_0xc2916f,!![]);}catch(_0x433112){return BPromise[_0x0b12('0x2a')](_0x433112);}return _0x2d60a9[_0x0b12('0x2b')]();};}function saveUpdates(_0x211986,_0xf040f6){return function(_0x58000f){if(_0x58000f){return _0x58000f[_0x0b12('0x2c')](_0x211986)[_0x0b12('0x2d')](function(_0x33b67e){return _0x33b67e;});}return null;};}function removeEntity(_0x19a70d,_0x382f00){return function(_0x2449b8){if(_0x2449b8){return _0x2449b8[_0x0b12('0x2e')]()[_0x0b12('0x2d')](function(){var _0x38d4b0=_0x2449b8[_0x0b12('0x2f')]({'plain':!![]});var _0x1f61f2=_0x0b12('0x30');return db[_0x0b12('0x31')][_0x0b12('0x2e')]({'where':{'type':_0x1f61f2,'resourceId':_0x38d4b0['id']}})['then'](function(){return _0x2449b8;});})[_0x0b12('0x2d')](function(){_0x19a70d[_0x0b12('0x20')](0xcc)[_0x0b12('0x21')]();});}};}function handleEntityNotFound(_0x406cb9,_0x165812){return function(_0x4b67b9){if(!_0x4b67b9){_0x406cb9[_0x0b12('0x1f')](0x194);}return _0x4b67b9;};}function handleError(_0x24f095,_0x5c1e03){_0x5c1e03=_0x5c1e03||0x1f4;return function(_0x36b22e){logger['error'](_0x36b22e[_0x0b12('0x32')]);if(_0x36b22e[_0x0b12('0x33')]){delete _0x36b22e[_0x0b12('0x33')];}_0x24f095[_0x0b12('0x20')](_0x5c1e03)[_0x0b12('0x34')](_0x36b22e);};}exports[_0x0b12('0x35')]=function(_0x4ce434,_0x30598a){var _0x57dc12={},_0x1624dc={},_0x1c390b={'count':0x0,'rows':[]};var _0x2834ac=_['map'](db[_0x0b12('0x36')][_0x0b12('0x37')],function(_0x5820f3){return{'name':_0x5820f3[_0x0b12('0x38')],'type':_0x5820f3[_0x0b12('0x39')][_0x0b12('0x3a')]};});_0x1624dc[_0x0b12('0x3b')]=_['map'](_0x2834ac,_0x0b12('0x33'));_0x1624dc[_0x0b12('0x3c')]=_[_0x0b12('0x3d')](_0x4ce434[_0x0b12('0x3c')]);_0x1624dc['filters']=_[_0x0b12('0x3e')](_0x1624dc['model'],_0x1624dc[_0x0b12('0x3c')]);_0x57dc12['attributes']=_['intersection'](_0x1624dc[_0x0b12('0x3b')],qs[_0x0b12('0x3f')](_0x4ce434[_0x0b12('0x3c')]['fields']));_0x57dc12['attributes']=_0x57dc12[_0x0b12('0x40')][_0x0b12('0x41')]?_0x57dc12['attributes']:_0x1624dc['model'];if(!_0x4ce434['query'][_0x0b12('0x42')](_0x0b12('0x43'))){_0x57dc12[_0x0b12('0x25')]=qs[_0x0b12('0x25')](_0x4ce434[_0x0b12('0x3c')]['limit']);_0x57dc12[_0x0b12('0x23')]=qs[_0x0b12('0x23')](_0x4ce434[_0x0b12('0x3c')][_0x0b12('0x23')]);}_0x57dc12[_0x0b12('0x44')]=qs[_0x0b12('0x45')](_0x4ce434[_0x0b12('0x3c')]['sort']);_0x57dc12['where']=qs[_0x0b12('0x46')](_[_0x0b12('0x47')](_0x4ce434['query'],_0x1624dc[_0x0b12('0x46')]),_0x2834ac);if(_0x4ce434[_0x0b12('0x3c')][_0x0b12('0x48')]){_0x57dc12[_0x0b12('0x49')]=_[_0x0b12('0x4a')](_0x57dc12['where'],{'$or':_[_0x0b12('0x4b')](_0x2834ac,function(_0x33e9c6){if(_0x33e9c6['type']!==_0x0b12('0x4c')){var _0x1fbad1={};_0x1fbad1[_0x33e9c6[_0x0b12('0x33')]]={'$like':'%'+_0x4ce434['query'][_0x0b12('0x48')]+'%'};return _0x1fbad1;}})});}_0x57dc12=_['merge']({},_0x57dc12,_0x4ce434['options']);var _0x4aa382={'where':_0x57dc12[_0x0b12('0x49')]};return db[_0x0b12('0x36')][_0x0b12('0x26')](_0x4aa382)['then'](function(_0x131583){_0x1c390b[_0x0b12('0x26')]=_0x131583;if(_0x4ce434[_0x0b12('0x3c')][_0x0b12('0x4d')]){_0x57dc12[_0x0b12('0x4e')]=[{'all':!![]}];}return db[_0x0b12('0x36')][_0x0b12('0x4f')](_0x57dc12);})[_0x0b12('0x2d')](function(_0x2c5106){_0x1c390b['rows']=_0x2c5106;return _0x1c390b;})[_0x0b12('0x2d')](respondWithFilteredResult(_0x30598a,_0x57dc12))[_0x0b12('0x50')](handleError(_0x30598a,null));};exports[_0x0b12('0x51')]=function(_0xe75923,_0x5cbfee){var _0x2887c2={'raw':!![],'where':{'id':_0xe75923[_0x0b12('0x52')]['id']}},_0x5e21c0={};_0x5e21c0[_0x0b12('0x3b')]=_[_0x0b12('0x3d')](db[_0x0b12('0x36')][_0x0b12('0x37')]);_0x5e21c0[_0x0b12('0x3c')]=_[_0x0b12('0x3d')](_0xe75923['query']);_0x5e21c0[_0x0b12('0x46')]=_['intersection'](_0x5e21c0[_0x0b12('0x3b')],_0x5e21c0[_0x0b12('0x3c')]);_0x2887c2[_0x0b12('0x40')]=_['intersection'](_0x5e21c0[_0x0b12('0x3b')],qs[_0x0b12('0x3f')](_0xe75923['query'][_0x0b12('0x3f')]));_0x2887c2[_0x0b12('0x40')]=_0x2887c2[_0x0b12('0x40')][_0x0b12('0x41')]?_0x2887c2[_0x0b12('0x40')]:_0x5e21c0['model'];if(_0xe75923['query'][_0x0b12('0x4d')]){_0x2887c2['include']=[{'all':!![]}];}_0x2887c2=_['merge']({},_0x2887c2,_0xe75923[_0x0b12('0x53')]);return db[_0x0b12('0x36')][_0x0b12('0x54')](_0x2887c2)[_0x0b12('0x2d')](handleEntityNotFound(_0x5cbfee,null))[_0x0b12('0x2d')](respondWithResult(_0x5cbfee,null))[_0x0b12('0x50')](handleError(_0x5cbfee,null));};exports['create']=function(_0x129292,_0x5d2dc7){return db[_0x0b12('0x36')]['create'](_0x129292[_0x0b12('0x55')],{})[_0x0b12('0x2d')](function(_0x2dafcf){var _0x1589cb=_0x129292['user']['get']({'plain':!![]});if(!_0x1589cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1589cb[_0x0b12('0x56')]===_0x0b12('0x57')){var _0x2f3d20=_0x2dafcf[_0x0b12('0x2f')]({'plain':!![]});var _0x3beea6=_0x0b12('0x30');return db[_0x0b12('0x58')][_0x0b12('0x54')]({'where':{'name':_0x3beea6,'userProfileId':_0x1589cb[_0x0b12('0x59')]},'raw':!![]})[_0x0b12('0x2d')](function(_0x3a2813){if(_0x3a2813&&_0x3a2813[_0x0b12('0x5a')]===0x0){return db[_0x0b12('0x31')]['create']({'name':_0x2f3d20[_0x0b12('0x33')],'resourceId':_0x2f3d20['id'],'type':_0x3a2813[_0x0b12('0x33')],'sectionId':_0x3a2813['id']},{})[_0x0b12('0x2d')](function(){return _0x2dafcf;});}else{return _0x2dafcf;}})['catch'](function(_0x2ef5ef){logger[_0x0b12('0x5b')](_0x0b12('0x5c'),_0x2ef5ef);throw _0x2ef5ef;});}return _0x2dafcf;})[_0x0b12('0x2d')](respondWithResult(_0x5d2dc7,0xc9))['catch'](handleError(_0x5d2dc7,null));};exports[_0x0b12('0x2c')]=function(_0x1dbdae,_0x4afefc){if(_0x1dbdae[_0x0b12('0x55')]['id']){delete _0x1dbdae[_0x0b12('0x55')]['id'];}return db['SmsQueue'][_0x0b12('0x54')]({'where':{'id':_0x1dbdae['params']['id']}})[_0x0b12('0x2d')](handleEntityNotFound(_0x4afefc,null))[_0x0b12('0x2d')](saveUpdates(_0x1dbdae[_0x0b12('0x55')],null))[_0x0b12('0x2d')](respondWithResult(_0x4afefc,null))[_0x0b12('0x50')](handleError(_0x4afefc,null));};exports[_0x0b12('0x2e')]=function(_0x1d3160,_0x29ba31){return db['SmsQueue'][_0x0b12('0x54')]({'where':{'id':_0x1d3160[_0x0b12('0x52')]['id']}})['then'](handleEntityNotFound(_0x29ba31,null))[_0x0b12('0x2d')](removeEntity(_0x29ba31,null))['catch'](handleError(_0x29ba31,null));};exports[_0x0b12('0x5d')]=function(_0x34ff2f,_0x13bfd0){return db[_0x0b12('0x36')][_0x0b12('0x5d')]()[_0x0b12('0x2d')](respondWithResult(_0x13bfd0,null))[_0x0b12('0x50')](handleError(_0x13bfd0,null));};exports[_0x0b12('0x5e')]=function(_0x193cf,_0x2c1bc3,_0x568901){var _0x216cec={'raw':!![],'where':{}},_0x3148a0={},_0x1bb195;return db[_0x0b12('0x36')][_0x0b12('0x5f')]({'where':{'id':_0x193cf['params']['id']}})[_0x0b12('0x2d')](handleEntityNotFound(_0x2c1bc3,null))[_0x0b12('0x2d')](function(_0x9189f6){if(_0x9189f6){_0x1bb195=_0x9189f6[_0x0b12('0x2f')]({'plain':!![]});_0x3148a0['model']=_[_0x0b12('0x3d')](db[_0x0b12('0x60')][_0x0b12('0x37')]);_0x3148a0[_0x0b12('0x3c')]=_[_0x0b12('0x3d')](_0x193cf[_0x0b12('0x3c')]);_0x3148a0['filters']=_[_0x0b12('0x3e')](_0x3148a0[_0x0b12('0x3b')],_0x3148a0[_0x0b12('0x3c')]);_0x216cec[_0x0b12('0x40')]=_[_0x0b12('0x3e')](_0x3148a0[_0x0b12('0x3b')],qs[_0x0b12('0x3f')](_0x193cf['query']['fields']));_0x216cec['attributes']=_0x216cec[_0x0b12('0x40')][_0x0b12('0x41')]?_0x216cec['attributes']:_0x3148a0[_0x0b12('0x3b')];if(!_0x193cf['query'][_0x0b12('0x42')](_0x0b12('0x43'))){_0x216cec[_0x0b12('0x25')]=qs[_0x0b12('0x25')](_0x193cf[_0x0b12('0x3c')][_0x0b12('0x25')]);_0x216cec['offset']=qs[_0x0b12('0x23')](_0x193cf[_0x0b12('0x3c')][_0x0b12('0x23')]);}_0x216cec['order']=qs[_0x0b12('0x45')](_0x193cf[_0x0b12('0x3c')][_0x0b12('0x45')]);_0x216cec['where']=qs['filters'](_[_0x0b12('0x47')](_0x193cf[_0x0b12('0x3c')],_0x3148a0[_0x0b12('0x46')]));_0x216cec[_0x0b12('0x49')][_0x0b12('0x61')]=_0x9189f6['id'];if(_0x193cf['query'][_0x0b12('0x48')]){_0x216cec[_0x0b12('0x49')]=_['merge'](_0x216cec[_0x0b12('0x49')],{'$or':_['map'](_0x216cec['attributes'],function(_0x2f8075){var _0x4ec12f={};_0x4ec12f[_0x2f8075]={'$like':'%'+_0x193cf['query'][_0x0b12('0x48')]+'%'};return _0x4ec12f;})});}_0x216cec=_['merge']({},_0x216cec,_0x193cf[_0x0b12('0x53')]);return db['UserSmsQueue'][_0x0b12('0x4f')](_0x216cec);}})[_0x0b12('0x2d')](function(_0x4080ce){if(_0x4080ce){return db[_0x0b12('0x62')][_0x0b12('0x63')]({'where':{'id':_[_0x0b12('0x4b')](_0x4080ce,'UserId'),'role':_0x0b12('0x64')},'attributes':['id','name',_0x0b12('0x65'),_0x0b12('0x66'),_0x0b12('0x67')]});}})['then'](function(_0x1040e2){if(_0x1040e2){return{'count':_0x1040e2[_0x0b12('0x26')],'rows':_['map'](_0x1040e2[_0x0b12('0x68')],function(_0x179990){return{'membername':_0x179990[_0x0b12('0x33')],'UserId':_0x179990['id'],'queue_name':_0x1bb195[_0x0b12('0x33')],'SmsQueueId':_0x1bb195['id'],'interface':util[_0x0b12('0x69')](_0x0b12('0x6a'),'SIP',_0x179990[_0x0b12('0x33')]),'penalty':0x0,'paused':_0x179990[_0x0b12('0x65')],'createdAt':_0x179990[_0x0b12('0x67')],'updatedAt':_0x179990['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b12('0x2d')](respondWithFilteredResult(_0x2c1bc3,_0x216cec))[_0x0b12('0x50')](handleError(_0x2c1bc3,null));};exports[_0x0b12('0x6b')]=function(_0x2b315e,_0x2404d1,_0x4330ec){var _0x4fd87b={};var _0x45c1cb={};var _0x1404ec;var _0xb6c051;return db[_0x0b12('0x36')]['findOne']({'where':{'id':_0x2b315e['params']['id']}})['then'](handleEntityNotFound(_0x2404d1,null))[_0x0b12('0x2d')](function(_0xe3c617){if(_0xe3c617){_0x1404ec=_0xe3c617;_0x45c1cb[_0x0b12('0x3b')]=_['keys'](db[_0x0b12('0x6c')][_0x0b12('0x37')]);_0x45c1cb['query']=_[_0x0b12('0x3d')](_0x2b315e[_0x0b12('0x3c')]);_0x45c1cb[_0x0b12('0x46')]=_[_0x0b12('0x3e')](_0x45c1cb[_0x0b12('0x3b')],_0x45c1cb[_0x0b12('0x3c')]);_0x4fd87b['attributes']=_[_0x0b12('0x3e')](_0x45c1cb['model'],qs[_0x0b12('0x3f')](_0x2b315e[_0x0b12('0x3c')][_0x0b12('0x3f')]));_0x4fd87b[_0x0b12('0x40')]=_0x4fd87b['attributes'][_0x0b12('0x41')]?_0x4fd87b[_0x0b12('0x40')]:_0x45c1cb[_0x0b12('0x3b')];_0x4fd87b[_0x0b12('0x44')]=qs['sort'](_0x2b315e[_0x0b12('0x3c')]['sort']);_0x4fd87b['where']=qs['filters'](_[_0x0b12('0x47')](_0x2b315e[_0x0b12('0x3c')],_0x45c1cb[_0x0b12('0x46')]));if(_0x2b315e['query'][_0x0b12('0x48')]){_0x4fd87b[_0x0b12('0x49')]=_['merge'](_0x4fd87b['where'],{'$or':_['map'](_0x4fd87b[_0x0b12('0x40')],function(_0x168458){var _0x2b5fd6={};_0x2b5fd6[_0x168458]={'$like':'%'+_0x2b315e[_0x0b12('0x3c')]['filter']+'%'};return _0x2b5fd6;})});}_0x4fd87b=_[_0x0b12('0x4a')]({},_0x4fd87b,_0x2b315e[_0x0b12('0x53')]);return _0x1404ec[_0x0b12('0x6b')](_0x4fd87b);}})[_0x0b12('0x2d')](function(_0x20645f){if(_0x20645f){_0xb6c051=_0x20645f[_0x0b12('0x41')];if(!_0x2b315e[_0x0b12('0x3c')][_0x0b12('0x42')]('nolimit')){_0x4fd87b[_0x0b12('0x25')]=qs[_0x0b12('0x25')](_0x2b315e[_0x0b12('0x3c')][_0x0b12('0x25')]);_0x4fd87b['offset']=qs[_0x0b12('0x23')](_0x2b315e[_0x0b12('0x3c')]['offset']);}return _0x1404ec[_0x0b12('0x6b')](_0x4fd87b);}})[_0x0b12('0x2d')](function(_0x55e312){if(_0x55e312){return _0x55e312?{'count':_0xb6c051,'rows':_0x55e312}:null;}})[_0x0b12('0x2d')](respondWithResult(_0x2404d1,null))['catch'](handleError(_0x2404d1,null));};exports[_0x0b12('0x6d')]=function(_0xe08c66,_0x71306a,_0x250e79){var _0x155494=_0xe08c66['body'][_0x0b12('0x6e')];return db[_0x0b12('0x6c')][_0x0b12('0x4f')]({'where':{'id':_0x155494},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0b12('0x6f'),'attributes':['id',_0x0b12('0x33'),'online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x3ce470){if(_0x3ce470){var _0x42204b=_[_0x0b12('0x70')](_0x3ce470,function(_0x2f2437){var _0xb28998=_0x2f2437[_0x0b12('0x2f')]({'plain':!![]});return _0xb28998[_0x0b12('0x6f')];});return db['SmsQueue'][_0x0b12('0x54')]({'where':{'id':_0xe08c66['params']['id']}})[_0x0b12('0x2d')](function(_0x12d200){return db['sequelize'][_0x0b12('0x71')](function(_0x2d1818){return _0x12d200[_0x0b12('0x6d')](_0x155494,{'transaction':_0x2d1818})[_0x0b12('0x2d')](function(){return BPromise['each'](_0x42204b,function(_0x493aad){return db[_0x0b12('0x60')][_0x0b12('0x72')]({'where':{'UserId':_0x493aad['id'],'SmsQueueId':_0xe08c66[_0x0b12('0x52')]['id']},'transaction':_0x2d1818});});})[_0x0b12('0x2d')](function(){_0x42204b[_0x0b12('0x73')](function(_0x2c4839){socket[_0x0b12('0x74')](_0x0b12('0x75'),{'UserId':_0x2c4839['id'],'SmsQueueId':_0x12d200['id']});});});});});}})[_0x0b12('0x2d')](respondWithStatusCode(_0x71306a,null))[_0x0b12('0x50')](handleError(_0x71306a,null));};exports[_0x0b12('0x76')]=function(_0x44eb3a,_0x229386,_0x4f6134){return db[_0x0b12('0x6c')][_0x0b12('0x4f')]({'where':{'id':_0x44eb3a[_0x0b12('0x3c')][_0x0b12('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x0b12('0x62')],'as':_0x0b12('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x0b12('0x2d')](handleEntityNotFound(_0x229386,null))[_0x0b12('0x2d')](function(_0x2f31a2){var _0x555e6b=_[_0x0b12('0x4b')](_0x2f31a2,'id');var _0x1b8228=[];var _0x1c5f78=[];var _0x486161=squel[_0x0b12('0x77')]();_0x486161['field'](_0x0b12('0x78'))[_0x0b12('0x79')](_0x0b12('0x7a'),'tq')[_0x0b12('0x7b')](_0x0b12('0x7c'),'ut',_0x0b12('0x7d'))[_0x0b12('0x49')]('SmsQueueId\x20=\x20?',_0x44eb3a[_0x0b12('0x52')]['id']);for(var _0x359b1d=0x0;_0x359b1d<_0x2f31a2[_0x0b12('0x41')];_0x359b1d+=0x1){let _0x4bdc6b=_0x2f31a2[_0x359b1d];for(var _0x5b348e=0x0;_0x5b348e<_0x4bdc6b[_0x0b12('0x6f')][_0x0b12('0x41')];_0x5b348e+=0x1){let _0x53ea24=_0x4bdc6b['Agents'][_0x5b348e];var _0x503d78=_0x486161[_0x0b12('0x7e')]();_0x503d78[_0x0b12('0x49')](_0x0b12('0x7f'),_0x53ea24['id']);_0x1c5f78[_0x0b12('0x80')](db[_0x0b12('0x81')][_0x0b12('0x3c')](_0x503d78[_0x0b12('0x82')](),{'type':db[_0x0b12('0x81')][_0x0b12('0x83')][_0x0b12('0x84')]})['then'](function(_0x29d8f1){if(_0x29d8f1['length']===0x1){return _0x53ea24['id'];}else{var _0x2f8019=_[_0x0b12('0x85')](_[_0x0b12('0x4b')](_0x29d8f1,_0x0b12('0x86')),function(_0x99dec5){return _[_0x0b12('0x87')](_0x555e6b,_0x99dec5);});if(_0x2f8019){return _0x53ea24['id'];}}}));}}return BPromise['all'](_0x1c5f78)[_0x0b12('0x2d')](function(_0x16e9f1){_0x1b8228=_(_0x1b8228)['union'](_0x16e9f1)[_0x0b12('0x88')]()[_0x0b12('0x89')]();return db[_0x0b12('0x36')][_0x0b12('0x54')]({'where':{'id':_0x44eb3a[_0x0b12('0x52')]['id']}})[_0x0b12('0x2d')](function(_0x3b32cf){return db[_0x0b12('0x81')][_0x0b12('0x71')](function(_0xfaa33f){return _0x3b32cf[_0x0b12('0x76')](_0x44eb3a[_0x0b12('0x3c')][_0x0b12('0x6e')],{'transaction':_0xfaa33f})[_0x0b12('0x2d')](function(){if(!_[_0x0b12('0x8a')](_0x1b8228)){return _0x3b32cf[_0x0b12('0x8b')](_0x1b8228,{'transaction':_0xfaa33f});}})[_0x0b12('0x2d')](function(){_0x1b8228[_0x0b12('0x73')](function(_0x10effa){socket[_0x0b12('0x74')]('userSmsQueue:remove',{'UserId':_0x10effa,'SmsQueueId':_0x3b32cf['id']});});});});});});})['then'](respondWithStatusCode(_0x229386,null))[_0x0b12('0x50')](handleError(_0x229386,null));};exports[_0x0b12('0x8c')]=function(_0x77c089,_0x14c73a,_0x3c314a){return db[_0x0b12('0x36')][_0x0b12('0x54')]({'where':{'id':_0x77c089[_0x0b12('0x52')]['id']}})[_0x0b12('0x2d')](handleEntityNotFound(_0x14c73a,null))[_0x0b12('0x2d')](function(_0x324ed2){if(_0x324ed2){return _0x324ed2[_0x0b12('0x8c')](_0x77c089[_0x0b12('0x55')][_0x0b12('0x6e')],_[_0x0b12('0x8d')](_0x77c089[_0x0b12('0x55')],[_0x0b12('0x6e'),'id'])||{})[_0x0b12('0x8e')](function(_0x309a0c){for(var _0x5d3f80=0x0;_0x5d3f80<_0x77c089[_0x0b12('0x55')][_0x0b12('0x6e')][_0x0b12('0x41')];_0x5d3f80+=0x1){socket['emit'](_0x0b12('0x75'),{'UserId':Number(_0x77c089[_0x0b12('0x55')][_0x0b12('0x6e')][_0x5d3f80]),'SmsQueueId':Number(_0x77c089[_0x0b12('0x52')]['id'])});}return _0x309a0c;});}})['then'](respondWithResult(_0x14c73a,null))['catch'](handleError(_0x14c73a,null));};exports[_0x0b12('0x8b')]=function(_0x48a89e,_0x51a620,_0x375af4){return db[_0x0b12('0x36')][_0x0b12('0x54')]({'where':{'id':_0x48a89e['params']['id']}})[_0x0b12('0x2d')](handleEntityNotFound(_0x51a620,null))[_0x0b12('0x2d')](function(_0x5ca537){if(_0x5ca537){return _0x5ca537[_0x0b12('0x8b')](_0x48a89e['query']['ids'])['then'](function(){if(_['isArray'](_0x48a89e[_0x0b12('0x3c')]['ids'])){for(var _0x3a4f1f=0x0;_0x3a4f1f<_0x48a89e[_0x0b12('0x3c')][_0x0b12('0x6e')][_0x0b12('0x41')];_0x3a4f1f+=0x1){socket[_0x0b12('0x74')](_0x0b12('0x8f'),{'UserId':Number(_0x48a89e[_0x0b12('0x3c')][_0x0b12('0x6e')][_0x3a4f1f]),'SmsQueueId':Number(_0x48a89e[_0x0b12('0x52')]['id'])});}}else{socket[_0x0b12('0x74')](_0x0b12('0x8f'),{'UserId':Number(_0x48a89e['query'][_0x0b12('0x6e')]),'SmsQueueId':Number(_0x48a89e['params']['id'])});}});}})[_0x0b12('0x2d')](respondWithStatusCode(_0x51a620,null))[_0x0b12('0x50')](handleError(_0x51a620,null));};exports[_0x0b12('0x90')]=function(_0x220d8f,_0x492010,_0x52c8a8){var _0x1a7442={};var _0x379abb={};var _0x2a874e;var _0xf9bae8;return db['SmsQueue'][_0x0b12('0x5f')]({'where':{'id':_0x220d8f[_0x0b12('0x52')]['id']}})[_0x0b12('0x2d')](handleEntityNotFound(_0x492010,null))[_0x0b12('0x2d')](function(_0x20bfd7){if(_0x20bfd7){_0x2a874e=_0x20bfd7;_0x379abb[_0x0b12('0x3b')]=_['keys'](db[_0x0b12('0x62')]['rawAttributes']);_0x379abb[_0x0b12('0x3c')]=_[_0x0b12('0x3d')](_0x220d8f[_0x0b12('0x3c')]);_0x379abb['filters']=_[_0x0b12('0x3e')](_0x379abb[_0x0b12('0x3b')],_0x379abb[_0x0b12('0x3c')]);_0x1a7442['attributes']=_[_0x0b12('0x3e')](_0x379abb['model'],qs[_0x0b12('0x3f')](_0x220d8f[_0x0b12('0x3c')][_0x0b12('0x3f')]));_0x1a7442[_0x0b12('0x40')]=_0x1a7442['attributes'][_0x0b12('0x41')]?_0x1a7442[_0x0b12('0x40')]:_0x379abb[_0x0b12('0x3b')];_0x1a7442[_0x0b12('0x44')]=qs[_0x0b12('0x45')](_0x220d8f[_0x0b12('0x3c')][_0x0b12('0x45')]);_0x1a7442[_0x0b12('0x49')]=qs[_0x0b12('0x46')](_[_0x0b12('0x47')](_0x220d8f[_0x0b12('0x3c')],_0x379abb[_0x0b12('0x46')]));if(_0x220d8f['query'][_0x0b12('0x48')]){_0x1a7442['where']=_[_0x0b12('0x4a')](_0x1a7442[_0x0b12('0x49')],{'$or':_[_0x0b12('0x4b')](_0x1a7442[_0x0b12('0x40')],function(_0x465938){var _0x3ca795={};_0x3ca795[_0x465938]={'$like':'%'+_0x220d8f[_0x0b12('0x3c')]['filter']+'%'};return _0x3ca795;})});}_0x1a7442=_[_0x0b12('0x4a')]({},_0x1a7442,_0x220d8f[_0x0b12('0x53')]);return _0x2a874e['getAgents'](_0x1a7442);}})[_0x0b12('0x2d')](function(_0x5cc7fc){if(_0x5cc7fc){_0xf9bae8=_0x5cc7fc[_0x0b12('0x41')];if(!_0x220d8f[_0x0b12('0x3c')][_0x0b12('0x42')]('nolimit')){_0x1a7442['limit']=qs[_0x0b12('0x25')](_0x220d8f[_0x0b12('0x3c')][_0x0b12('0x25')]);_0x1a7442[_0x0b12('0x23')]=qs[_0x0b12('0x23')](_0x220d8f[_0x0b12('0x3c')]['offset']);}return _0x2a874e[_0x0b12('0x90')](_0x1a7442);}})['then'](function(_0x5118fe){if(_0x5118fe){return _0x5118fe?{'count':_0xf9bae8,'rows':_0x5118fe}:null;}})[_0x0b12('0x2d')](respondWithResult(_0x492010,null))['catch'](handleError(_0x492010,null));}; \ No newline at end of file +var _0x7e27=['intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','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','describe','findOne','UserSmsQueue','nolimit','order','SmsQueueId','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','createdAt','Team','getTeams','ids','User','voicePause','flatMap','Agents','sequelize','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','./smsQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','get','SmsQueues','destroy','end','error','stack','name','send','map','SmsQueue','rawAttributes','type','model','query','keys','filters'];(function(_0x1818a1,_0x1e1ae5){var _0x27adb7=function(_0x466e63){while(--_0x466e63){_0x1818a1['push'](_0x1818a1['shift']());}};_0x27adb7(++_0x1e1ae5);}(_0x7e27,0xdd));var _0x77e2=function(_0x16256b,_0x15c956){_0x16256b=_0x16256b-0x0;var _0x548935=_0x7e27[_0x16256b];return _0x548935;};'use strict';var emlformat=require(_0x77e2('0x0'));var rimraf=require(_0x77e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77e2('0x2'));var rp=require(_0x77e2('0x3'));var moment=require(_0x77e2('0x4'));var BPromise=require(_0x77e2('0x5'));var Mustache=require('mustache');var util=require(_0x77e2('0x6'));var path=require(_0x77e2('0x7'));var sox=require(_0x77e2('0x8'));var csv=require('to-csv');var ejs=require(_0x77e2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77e2('0xa'));var squel=require(_0x77e2('0xb'));var crypto=require('crypto');var jsforce=require(_0x77e2('0xc'));var deskjs=require(_0x77e2('0xd'));var toCsv=require(_0x77e2('0xe'));var querystring=require(_0x77e2('0xf'));var Papa=require(_0x77e2('0x10'));var Redis=require(_0x77e2('0x11'));var authService=require(_0x77e2('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77e2('0x13'));var logger=require('../../config/logger')(_0x77e2('0x14'));var utils=require(_0x77e2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x77e2('0x16'))['db'];config[_0x77e2('0x17')]=_['defaults'](config[_0x77e2('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77e2('0x17')]));require(_0x77e2('0x18'))[_0x77e2('0x19')](socket);function respondWithStatusCode(_0x33e820,_0x20276){_0x20276=_0x20276||0xcc;return function(_0x50f06e){if(_0x50f06e){return _0x33e820[_0x77e2('0x1a')](_0x20276);}return _0x33e820[_0x77e2('0x1b')](_0x20276)['end']();};}function respondWithResult(_0x46fb81,_0x134fee){_0x134fee=_0x134fee||0xc8;return function(_0x349627){if(_0x349627){return _0x46fb81[_0x77e2('0x1b')](_0x134fee)[_0x77e2('0x1c')](_0x349627);}};}function respondWithFilteredResult(_0x2322f9,_0x36e520){return function(_0x36b995){if(_0x36b995){var _0x42459a=typeof _0x36e520[_0x77e2('0x1d')]==='undefined'&&typeof _0x36e520[_0x77e2('0x1e')]===_0x77e2('0x1f');var _0x2c419d=_0x36b995[_0x77e2('0x20')];var _0x3774b3=_0x42459a?0x0:_0x36e520[_0x77e2('0x1d')];var _0x1a5415=_0x42459a?_0x36b995[_0x77e2('0x20')]:_0x36e520[_0x77e2('0x1d')]+_0x36e520[_0x77e2('0x1e')];var _0x31b817;if(_0x1a5415>=_0x2c419d){_0x1a5415=_0x2c419d;_0x31b817=0xc8;}else{_0x31b817=0xce;}_0x2322f9['status'](_0x31b817);return _0x2322f9[_0x77e2('0x21')](_0x77e2('0x22'),_0x3774b3+'-'+_0x1a5415+'/'+_0x2c419d)['json'](_0x36b995);}return null;};}function patchUpdates(_0x2d30d3){return function(_0x5eef40){try{jsonpatch['apply'](_0x5eef40,_0x2d30d3,!![]);}catch(_0x843208){return BPromise['reject'](_0x843208);}return _0x5eef40[_0x77e2('0x23')]();};}function saveUpdates(_0x1c8f39,_0x20eda4){return function(_0x5b5844){if(_0x5b5844){return _0x5b5844['update'](_0x1c8f39)[_0x77e2('0x24')](function(_0x5a7256){return _0x5a7256;});}return null;};}function removeEntity(_0x104860,_0x370dca){return function(_0x44ba24){if(_0x44ba24){return _0x44ba24['destroy']()[_0x77e2('0x24')](function(){var _0x3413aa=_0x44ba24[_0x77e2('0x25')]({'plain':!![]});var _0xa2a50f=_0x77e2('0x26');return db['UserProfileResource'][_0x77e2('0x27')]({'where':{'type':_0xa2a50f,'resourceId':_0x3413aa['id']}})[_0x77e2('0x24')](function(){return _0x44ba24;});})['then'](function(){_0x104860[_0x77e2('0x1b')](0xcc)[_0x77e2('0x28')]();});}};}function handleEntityNotFound(_0x2acae2,_0x11c9f7){return function(_0x586919){if(!_0x586919){_0x2acae2['sendStatus'](0x194);}return _0x586919;};}function handleError(_0x1e6f40,_0x5002b3){_0x5002b3=_0x5002b3||0x1f4;return function(_0x4e5996){logger[_0x77e2('0x29')](_0x4e5996[_0x77e2('0x2a')]);if(_0x4e5996[_0x77e2('0x2b')]){delete _0x4e5996[_0x77e2('0x2b')];}_0x1e6f40['status'](_0x5002b3)[_0x77e2('0x2c')](_0x4e5996);};}exports['index']=function(_0x598a4e,_0x551e4d){var _0x2b9918={},_0x58dcb0={},_0x5ad13e={'count':0x0,'rows':[]};var _0x53d01a=_[_0x77e2('0x2d')](db[_0x77e2('0x2e')][_0x77e2('0x2f')],function(_0xc4044b){return{'name':_0xc4044b['fieldName'],'type':_0xc4044b[_0x77e2('0x30')]['key']};});_0x58dcb0[_0x77e2('0x31')]=_['map'](_0x53d01a,_0x77e2('0x2b'));_0x58dcb0[_0x77e2('0x32')]=_[_0x77e2('0x33')](_0x598a4e[_0x77e2('0x32')]);_0x58dcb0[_0x77e2('0x34')]=_[_0x77e2('0x35')](_0x58dcb0[_0x77e2('0x31')],_0x58dcb0['query']);_0x2b9918[_0x77e2('0x36')]=_[_0x77e2('0x35')](_0x58dcb0[_0x77e2('0x31')],qs[_0x77e2('0x37')](_0x598a4e[_0x77e2('0x32')][_0x77e2('0x37')]));_0x2b9918[_0x77e2('0x36')]=_0x2b9918[_0x77e2('0x36')][_0x77e2('0x38')]?_0x2b9918[_0x77e2('0x36')]:_0x58dcb0[_0x77e2('0x31')];if(!_0x598a4e[_0x77e2('0x32')][_0x77e2('0x39')]('nolimit')){_0x2b9918[_0x77e2('0x1e')]=qs[_0x77e2('0x1e')](_0x598a4e[_0x77e2('0x32')]['limit']);_0x2b9918['offset']=qs[_0x77e2('0x1d')](_0x598a4e[_0x77e2('0x32')][_0x77e2('0x1d')]);}_0x2b9918['order']=qs['sort'](_0x598a4e[_0x77e2('0x32')][_0x77e2('0x3a')]);_0x2b9918[_0x77e2('0x3b')]=qs[_0x77e2('0x34')](_[_0x77e2('0x3c')](_0x598a4e[_0x77e2('0x32')],_0x58dcb0[_0x77e2('0x34')]),_0x53d01a);if(_0x598a4e[_0x77e2('0x32')][_0x77e2('0x3d')]){_0x2b9918['where']=_[_0x77e2('0x3e')](_0x2b9918[_0x77e2('0x3b')],{'$or':_[_0x77e2('0x2d')](_0x53d01a,function(_0x5dd7c0){if(_0x5dd7c0[_0x77e2('0x30')]!==_0x77e2('0x3f')){var _0x467442={};_0x467442[_0x5dd7c0[_0x77e2('0x2b')]]={'$like':'%'+_0x598a4e[_0x77e2('0x32')][_0x77e2('0x3d')]+'%'};return _0x467442;}})});}_0x2b9918=_[_0x77e2('0x3e')]({},_0x2b9918,_0x598a4e[_0x77e2('0x40')]);var _0x54e415={'where':_0x2b9918[_0x77e2('0x3b')]};return db[_0x77e2('0x2e')]['count'](_0x54e415)[_0x77e2('0x24')](function(_0x37d61e){_0x5ad13e[_0x77e2('0x20')]=_0x37d61e;if(_0x598a4e[_0x77e2('0x32')][_0x77e2('0x41')]){_0x2b9918[_0x77e2('0x42')]=[{'all':!![]}];}return db['SmsQueue'][_0x77e2('0x43')](_0x2b9918);})[_0x77e2('0x24')](function(_0x199eeb){_0x5ad13e[_0x77e2('0x44')]=_0x199eeb;return _0x5ad13e;})[_0x77e2('0x24')](respondWithFilteredResult(_0x551e4d,_0x2b9918))[_0x77e2('0x45')](handleError(_0x551e4d,null));};exports['show']=function(_0x131c48,_0x16d838){var _0x9ef1fd={'raw':!![],'where':{'id':_0x131c48[_0x77e2('0x46')]['id']}},_0x460d87={};_0x460d87[_0x77e2('0x31')]=_['keys'](db[_0x77e2('0x2e')][_0x77e2('0x2f')]);_0x460d87[_0x77e2('0x32')]=_[_0x77e2('0x33')](_0x131c48['query']);_0x460d87[_0x77e2('0x34')]=_[_0x77e2('0x35')](_0x460d87[_0x77e2('0x31')],_0x460d87[_0x77e2('0x32')]);_0x9ef1fd[_0x77e2('0x36')]=_[_0x77e2('0x35')](_0x460d87[_0x77e2('0x31')],qs[_0x77e2('0x37')](_0x131c48['query'][_0x77e2('0x37')]));_0x9ef1fd[_0x77e2('0x36')]=_0x9ef1fd[_0x77e2('0x36')][_0x77e2('0x38')]?_0x9ef1fd['attributes']:_0x460d87[_0x77e2('0x31')];if(_0x131c48['query'][_0x77e2('0x41')]){_0x9ef1fd[_0x77e2('0x42')]=[{'all':!![]}];}_0x9ef1fd=_['merge']({},_0x9ef1fd,_0x131c48['options']);return db['SmsQueue'][_0x77e2('0x47')](_0x9ef1fd)[_0x77e2('0x24')](handleEntityNotFound(_0x16d838,null))[_0x77e2('0x24')](respondWithResult(_0x16d838,null))[_0x77e2('0x45')](handleError(_0x16d838,null));};exports[_0x77e2('0x48')]=function(_0x4be720,_0x4b5d53){return db[_0x77e2('0x2e')][_0x77e2('0x48')](_0x4be720[_0x77e2('0x49')],{})[_0x77e2('0x24')](function(_0x25eaca){var _0x2e090a=_0x4be720[_0x77e2('0x4a')][_0x77e2('0x25')]({'plain':!![]});if(!_0x2e090a)throw new Error(_0x77e2('0x4b'));if(_0x2e090a[_0x77e2('0x4c')]===_0x77e2('0x4a')){var _0x4b06a4=_0x25eaca['get']({'plain':!![]});var _0x7bfad2=_0x77e2('0x26');return db[_0x77e2('0x4d')][_0x77e2('0x47')]({'where':{'name':_0x7bfad2,'userProfileId':_0x2e090a[_0x77e2('0x4e')]},'raw':!![]})[_0x77e2('0x24')](function(_0x3cef16){if(_0x3cef16&&_0x3cef16[_0x77e2('0x4f')]===0x0){return db[_0x77e2('0x50')][_0x77e2('0x48')]({'name':_0x4b06a4[_0x77e2('0x2b')],'resourceId':_0x4b06a4['id'],'type':_0x3cef16[_0x77e2('0x2b')],'sectionId':_0x3cef16['id']},{})[_0x77e2('0x24')](function(){return _0x25eaca;});}else{return _0x25eaca;}})[_0x77e2('0x45')](function(_0x7e8881){logger[_0x77e2('0x29')](_0x77e2('0x51'),_0x7e8881);throw _0x7e8881;});}return _0x25eaca;})[_0x77e2('0x24')](respondWithResult(_0x4b5d53,0xc9))[_0x77e2('0x45')](handleError(_0x4b5d53,null));};exports[_0x77e2('0x52')]=function(_0x8858e0,_0x3d0171){if(_0x8858e0[_0x77e2('0x49')]['id']){delete _0x8858e0[_0x77e2('0x49')]['id'];}return db[_0x77e2('0x2e')]['find']({'where':{'id':_0x8858e0[_0x77e2('0x46')]['id']}})[_0x77e2('0x24')](handleEntityNotFound(_0x3d0171,null))[_0x77e2('0x24')](saveUpdates(_0x8858e0[_0x77e2('0x49')],null))[_0x77e2('0x24')](respondWithResult(_0x3d0171,null))[_0x77e2('0x45')](handleError(_0x3d0171,null));};exports['destroy']=function(_0x3a45d1,_0x429b54){return db[_0x77e2('0x2e')][_0x77e2('0x47')]({'where':{'id':_0x3a45d1['params']['id']}})['then'](handleEntityNotFound(_0x429b54,null))[_0x77e2('0x24')](removeEntity(_0x429b54,null))[_0x77e2('0x45')](handleError(_0x429b54,null));};exports[_0x77e2('0x53')]=function(_0x411abe,_0x28a94c){return db[_0x77e2('0x2e')][_0x77e2('0x53')]()['then'](respondWithResult(_0x28a94c,null))[_0x77e2('0x45')](handleError(_0x28a94c,null));};exports['getMembers']=function(_0x5e884b,_0xd50b68,_0x13c098){var _0x3f4196={'raw':!![],'where':{}},_0x45d83e={},_0x521192;return db[_0x77e2('0x2e')][_0x77e2('0x54')]({'where':{'id':_0x5e884b['params']['id']}})['then'](handleEntityNotFound(_0xd50b68,null))[_0x77e2('0x24')](function(_0x2f465d){if(_0x2f465d){_0x521192=_0x2f465d[_0x77e2('0x25')]({'plain':!![]});_0x45d83e[_0x77e2('0x31')]=_[_0x77e2('0x33')](db[_0x77e2('0x55')][_0x77e2('0x2f')]);_0x45d83e[_0x77e2('0x32')]=_[_0x77e2('0x33')](_0x5e884b[_0x77e2('0x32')]);_0x45d83e['filters']=_[_0x77e2('0x35')](_0x45d83e[_0x77e2('0x31')],_0x45d83e['query']);_0x3f4196[_0x77e2('0x36')]=_['intersection'](_0x45d83e[_0x77e2('0x31')],qs[_0x77e2('0x37')](_0x5e884b[_0x77e2('0x32')][_0x77e2('0x37')]));_0x3f4196['attributes']=_0x3f4196['attributes']['length']?_0x3f4196[_0x77e2('0x36')]:_0x45d83e[_0x77e2('0x31')];if(!_0x5e884b['query'][_0x77e2('0x39')](_0x77e2('0x56'))){_0x3f4196[_0x77e2('0x1e')]=qs[_0x77e2('0x1e')](_0x5e884b[_0x77e2('0x32')][_0x77e2('0x1e')]);_0x3f4196[_0x77e2('0x1d')]=qs['offset'](_0x5e884b[_0x77e2('0x32')][_0x77e2('0x1d')]);}_0x3f4196[_0x77e2('0x57')]=qs[_0x77e2('0x3a')](_0x5e884b['query'][_0x77e2('0x3a')]);_0x3f4196[_0x77e2('0x3b')]=qs[_0x77e2('0x34')](_[_0x77e2('0x3c')](_0x5e884b[_0x77e2('0x32')],_0x45d83e[_0x77e2('0x34')]));_0x3f4196[_0x77e2('0x3b')][_0x77e2('0x58')]=_0x2f465d['id'];if(_0x5e884b[_0x77e2('0x32')][_0x77e2('0x3d')]){_0x3f4196[_0x77e2('0x3b')]=_[_0x77e2('0x3e')](_0x3f4196[_0x77e2('0x3b')],{'$or':_[_0x77e2('0x2d')](_0x3f4196[_0x77e2('0x36')],function(_0x5cf203){var _0x4a17d4={};_0x4a17d4[_0x5cf203]={'$like':'%'+_0x5e884b[_0x77e2('0x32')][_0x77e2('0x3d')]+'%'};return _0x4a17d4;})});}_0x3f4196=_['merge']({},_0x3f4196,_0x5e884b[_0x77e2('0x40')]);return db[_0x77e2('0x55')]['findAll'](_0x3f4196);}})[_0x77e2('0x24')](function(_0x3150c4){if(_0x3150c4){return db['User'][_0x77e2('0x59')]({'where':{'id':_[_0x77e2('0x2d')](_0x3150c4,_0x77e2('0x5a')),'role':_0x77e2('0x5b')},'attributes':['id','name','smsPause',_0x77e2('0x5c'),'createdAt']});}})[_0x77e2('0x24')](function(_0x2dc339){if(_0x2dc339){return{'count':_0x2dc339[_0x77e2('0x20')],'rows':_[_0x77e2('0x2d')](_0x2dc339[_0x77e2('0x44')],function(_0x45c330){return{'membername':_0x45c330['name'],'UserId':_0x45c330['id'],'queue_name':_0x521192[_0x77e2('0x2b')],'SmsQueueId':_0x521192['id'],'interface':util[_0x77e2('0x5d')](_0x77e2('0x5e'),'SIP',_0x45c330[_0x77e2('0x2b')]),'penalty':0x0,'paused':_0x45c330['smsPause'],'createdAt':_0x45c330[_0x77e2('0x5f')],'updatedAt':_0x45c330[_0x77e2('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xd50b68,_0x3f4196))[_0x77e2('0x45')](handleError(_0xd50b68,null));};exports['getTeams']=function(_0x516a91,_0x34bbab,_0x4a7652){var _0xd9f26a={};var _0x154028={};var _0x2e5e8f;var _0x4ed4f5;return db['SmsQueue'][_0x77e2('0x54')]({'where':{'id':_0x516a91[_0x77e2('0x46')]['id']}})['then'](handleEntityNotFound(_0x34bbab,null))[_0x77e2('0x24')](function(_0x289d4c){if(_0x289d4c){_0x2e5e8f=_0x289d4c;_0x154028[_0x77e2('0x31')]=_[_0x77e2('0x33')](db[_0x77e2('0x60')][_0x77e2('0x2f')]);_0x154028[_0x77e2('0x32')]=_['keys'](_0x516a91[_0x77e2('0x32')]);_0x154028[_0x77e2('0x34')]=_[_0x77e2('0x35')](_0x154028['model'],_0x154028[_0x77e2('0x32')]);_0xd9f26a[_0x77e2('0x36')]=_['intersection'](_0x154028[_0x77e2('0x31')],qs[_0x77e2('0x37')](_0x516a91[_0x77e2('0x32')][_0x77e2('0x37')]));_0xd9f26a[_0x77e2('0x36')]=_0xd9f26a[_0x77e2('0x36')][_0x77e2('0x38')]?_0xd9f26a['attributes']:_0x154028[_0x77e2('0x31')];_0xd9f26a['order']=qs[_0x77e2('0x3a')](_0x516a91[_0x77e2('0x32')][_0x77e2('0x3a')]);_0xd9f26a['where']=qs[_0x77e2('0x34')](_[_0x77e2('0x3c')](_0x516a91[_0x77e2('0x32')],_0x154028['filters']));if(_0x516a91[_0x77e2('0x32')][_0x77e2('0x3d')]){_0xd9f26a[_0x77e2('0x3b')]=_[_0x77e2('0x3e')](_0xd9f26a[_0x77e2('0x3b')],{'$or':_[_0x77e2('0x2d')](_0xd9f26a[_0x77e2('0x36')],function(_0x27cb6e){var _0x206b5f={};_0x206b5f[_0x27cb6e]={'$like':'%'+_0x516a91[_0x77e2('0x32')]['filter']+'%'};return _0x206b5f;})});}_0xd9f26a=_[_0x77e2('0x3e')]({},_0xd9f26a,_0x516a91[_0x77e2('0x40')]);return _0x2e5e8f[_0x77e2('0x61')](_0xd9f26a);}})[_0x77e2('0x24')](function(_0xe6cef4){if(_0xe6cef4){_0x4ed4f5=_0xe6cef4['length'];if(!_0x516a91[_0x77e2('0x32')][_0x77e2('0x39')](_0x77e2('0x56'))){_0xd9f26a[_0x77e2('0x1e')]=qs[_0x77e2('0x1e')](_0x516a91[_0x77e2('0x32')][_0x77e2('0x1e')]);_0xd9f26a[_0x77e2('0x1d')]=qs[_0x77e2('0x1d')](_0x516a91['query'][_0x77e2('0x1d')]);}return _0x2e5e8f['getTeams'](_0xd9f26a);}})[_0x77e2('0x24')](function(_0x26dc55){if(_0x26dc55){return _0x26dc55?{'count':_0x4ed4f5,'rows':_0x26dc55}:null;}})['then'](respondWithResult(_0x34bbab,null))[_0x77e2('0x45')](handleError(_0x34bbab,null));};exports['addTeams']=function(_0x22a38e,_0x388e77,_0x5a3cde){var _0x11efd4=_0x22a38e[_0x77e2('0x49')][_0x77e2('0x62')];return db['Team'][_0x77e2('0x43')]({'where':{'id':_0x11efd4},'attributes':['id'],'include':[{'model':db[_0x77e2('0x63')],'as':'Agents','attributes':['id','name','online',_0x77e2('0x64'),'interface'],'raw':!![]}]})['then'](function(_0x11609d){if(_0x11609d){var _0x259b4e=_[_0x77e2('0x65')](_0x11609d,function(_0x5db76d){var _0x5a384e=_0x5db76d[_0x77e2('0x25')]({'plain':!![]});return _0x5a384e[_0x77e2('0x66')];});return db[_0x77e2('0x2e')][_0x77e2('0x47')]({'where':{'id':_0x22a38e[_0x77e2('0x46')]['id']}})[_0x77e2('0x24')](function(_0x334154){return db[_0x77e2('0x67')]['transaction'](function(_0x43ecf1){return _0x334154[_0x77e2('0x68')](_0x11efd4,{'transaction':_0x43ecf1})['then'](function(){return BPromise[_0x77e2('0x69')](_0x259b4e,function(_0x3abe2d){return db[_0x77e2('0x55')][_0x77e2('0x6a')]({'where':{'UserId':_0x3abe2d['id'],'SmsQueueId':_0x22a38e['params']['id']},'transaction':_0x43ecf1});});})[_0x77e2('0x24')](function(){_0x259b4e[_0x77e2('0x6b')](function(_0xa25c6c){socket[_0x77e2('0x6c')](_0x77e2('0x6d'),{'UserId':_0xa25c6c['id'],'SmsQueueId':_0x334154['id']});});});});});}})[_0x77e2('0x24')](respondWithStatusCode(_0x388e77,null))['catch'](handleError(_0x388e77,null));};exports[_0x77e2('0x6e')]=function(_0x503499,_0x1eeb91,_0x39e5af){return db[_0x77e2('0x60')][_0x77e2('0x43')]({'where':{'id':_0x503499[_0x77e2('0x32')][_0x77e2('0x62')]},'attributes':['id'],'include':[{'model':db[_0x77e2('0x63')],'as':_0x77e2('0x66'),'attributes':['id'],'raw':!![]}]})[_0x77e2('0x24')](handleEntityNotFound(_0x1eeb91,null))[_0x77e2('0x24')](function(_0x1d1afb){var _0x505f27=_['map'](_0x1d1afb,'id');var _0xb1aea2=[];var _0x4f8f04=[];var _0x5842ac=squel[_0x77e2('0x6f')]();_0x5842ac[_0x77e2('0x70')](_0x77e2('0x71'))[_0x77e2('0x72')]('team_has_sms_queues','tq')[_0x77e2('0x73')]('user_has_teams','ut',_0x77e2('0x74'))[_0x77e2('0x3b')](_0x77e2('0x75'),_0x503499['params']['id']);for(var _0x27d35d=0x0;_0x27d35d<_0x1d1afb['length'];_0x27d35d+=0x1){let _0x55363f=_0x1d1afb[_0x27d35d];for(var _0x3169e1=0x0;_0x3169e1<_0x55363f[_0x77e2('0x66')]['length'];_0x3169e1+=0x1){let _0x3556c3=_0x55363f[_0x77e2('0x66')][_0x3169e1];var _0xf711f7=_0x5842ac[_0x77e2('0x76')]();_0xf711f7[_0x77e2('0x3b')](_0x77e2('0x77'),_0x3556c3['id']);_0x4f8f04[_0x77e2('0x78')](db[_0x77e2('0x67')]['query'](_0xf711f7[_0x77e2('0x79')](),{'type':db[_0x77e2('0x67')]['QueryTypes'][_0x77e2('0x7a')]})[_0x77e2('0x24')](function(_0x5705b9){if(_0x5705b9[_0x77e2('0x38')]===0x1){return _0x3556c3['id'];}else{var _0x9990be=_[_0x77e2('0x7b')](_[_0x77e2('0x2d')](_0x5705b9,_0x77e2('0x7c')),function(_0xc6d249){return _[_0x77e2('0x7d')](_0x505f27,_0xc6d249);});if(_0x9990be){return _0x3556c3['id'];}}}));}}return BPromise[_0x77e2('0x7e')](_0x4f8f04)[_0x77e2('0x24')](function(_0x34e386){_0xb1aea2=_(_0xb1aea2)[_0x77e2('0x7f')](_0x34e386)['compact']()[_0x77e2('0x80')]();return db[_0x77e2('0x2e')]['find']({'where':{'id':_0x503499[_0x77e2('0x46')]['id']}})['then'](function(_0x463e7a){return db['sequelize'][_0x77e2('0x81')](function(_0x458dda){return _0x463e7a['removeTeams'](_0x503499[_0x77e2('0x32')][_0x77e2('0x62')],{'transaction':_0x458dda})[_0x77e2('0x24')](function(){if(!_[_0x77e2('0x82')](_0xb1aea2)){return _0x463e7a[_0x77e2('0x83')](_0xb1aea2,{'transaction':_0x458dda});}})[_0x77e2('0x24')](function(){_0xb1aea2[_0x77e2('0x6b')](function(_0x41ac9e){socket['emit'](_0x77e2('0x84'),{'UserId':_0x41ac9e,'SmsQueueId':_0x463e7a['id']});});});});});});})[_0x77e2('0x24')](respondWithStatusCode(_0x1eeb91,null))[_0x77e2('0x45')](handleError(_0x1eeb91,null));};exports['addAgents']=function(_0x5edfae,_0x40165e,_0x24cffd){return db[_0x77e2('0x2e')][_0x77e2('0x47')]({'where':{'id':_0x5edfae[_0x77e2('0x46')]['id']}})['then'](handleEntityNotFound(_0x40165e,null))[_0x77e2('0x24')](function(_0x3844bc){if(_0x3844bc){return _0x3844bc[_0x77e2('0x85')](_0x5edfae[_0x77e2('0x49')][_0x77e2('0x62')],_[_0x77e2('0x86')](_0x5edfae['body'],[_0x77e2('0x62'),'id'])||{})['spread'](function(_0x593002){for(var _0x5f169e=0x0;_0x5f169e<_0x5edfae['body'][_0x77e2('0x62')][_0x77e2('0x38')];_0x5f169e+=0x1){socket[_0x77e2('0x6c')](_0x77e2('0x6d'),{'UserId':Number(_0x5edfae[_0x77e2('0x49')]['ids'][_0x5f169e]),'SmsQueueId':Number(_0x5edfae[_0x77e2('0x46')]['id'])});}return _0x593002;});}})['then'](respondWithResult(_0x40165e,null))['catch'](handleError(_0x40165e,null));};exports['removeAgents']=function(_0x1ecbfe,_0x22c2bb,_0x1c986f){return db[_0x77e2('0x2e')][_0x77e2('0x47')]({'where':{'id':_0x1ecbfe[_0x77e2('0x46')]['id']}})['then'](handleEntityNotFound(_0x22c2bb,null))[_0x77e2('0x24')](function(_0x5acbae){if(_0x5acbae){return _0x5acbae[_0x77e2('0x83')](_0x1ecbfe[_0x77e2('0x32')][_0x77e2('0x62')])[_0x77e2('0x24')](function(){if(_[_0x77e2('0x87')](_0x1ecbfe[_0x77e2('0x32')][_0x77e2('0x62')])){for(var _0x1c3c38=0x0;_0x1c3c38<_0x1ecbfe[_0x77e2('0x32')]['ids']['length'];_0x1c3c38+=0x1){socket[_0x77e2('0x6c')](_0x77e2('0x84'),{'UserId':Number(_0x1ecbfe[_0x77e2('0x32')][_0x77e2('0x62')][_0x1c3c38]),'SmsQueueId':Number(_0x1ecbfe[_0x77e2('0x46')]['id'])});}}else{socket[_0x77e2('0x6c')](_0x77e2('0x84'),{'UserId':Number(_0x1ecbfe[_0x77e2('0x32')]['ids']),'SmsQueueId':Number(_0x1ecbfe[_0x77e2('0x46')]['id'])});}});}})[_0x77e2('0x24')](respondWithStatusCode(_0x22c2bb,null))[_0x77e2('0x45')](handleError(_0x22c2bb,null));};exports[_0x77e2('0x88')]=function(_0x2db27d,_0x1f0492,_0x149941){var _0x4f1768={};var _0x427839={};var _0x3cc6ce;var _0xd91a40;return db[_0x77e2('0x2e')][_0x77e2('0x54')]({'where':{'id':_0x2db27d[_0x77e2('0x46')]['id']}})[_0x77e2('0x24')](handleEntityNotFound(_0x1f0492,null))[_0x77e2('0x24')](function(_0x4ad2f4){if(_0x4ad2f4){_0x3cc6ce=_0x4ad2f4;_0x427839[_0x77e2('0x31')]=_['keys'](db[_0x77e2('0x63')][_0x77e2('0x2f')]);_0x427839[_0x77e2('0x32')]=_[_0x77e2('0x33')](_0x2db27d['query']);_0x427839[_0x77e2('0x34')]=_[_0x77e2('0x35')](_0x427839[_0x77e2('0x31')],_0x427839[_0x77e2('0x32')]);_0x4f1768[_0x77e2('0x36')]=_['intersection'](_0x427839[_0x77e2('0x31')],qs[_0x77e2('0x37')](_0x2db27d[_0x77e2('0x32')]['fields']));_0x4f1768[_0x77e2('0x36')]=_0x4f1768[_0x77e2('0x36')][_0x77e2('0x38')]?_0x4f1768[_0x77e2('0x36')]:_0x427839[_0x77e2('0x31')];_0x4f1768[_0x77e2('0x57')]=qs[_0x77e2('0x3a')](_0x2db27d[_0x77e2('0x32')][_0x77e2('0x3a')]);_0x4f1768['where']=qs[_0x77e2('0x34')](_[_0x77e2('0x3c')](_0x2db27d['query'],_0x427839[_0x77e2('0x34')]));if(_0x2db27d['query'][_0x77e2('0x3d')]){_0x4f1768[_0x77e2('0x3b')]=_['merge'](_0x4f1768['where'],{'$or':_[_0x77e2('0x2d')](_0x4f1768[_0x77e2('0x36')],function(_0x417a9f){var _0x465f6a={};_0x465f6a[_0x417a9f]={'$like':'%'+_0x2db27d[_0x77e2('0x32')]['filter']+'%'};return _0x465f6a;})});}_0x4f1768=_[_0x77e2('0x3e')]({},_0x4f1768,_0x2db27d['options']);return _0x3cc6ce['getAgents'](_0x4f1768);}})[_0x77e2('0x24')](function(_0x4f97c7){if(_0x4f97c7){_0xd91a40=_0x4f97c7[_0x77e2('0x38')];if(!_0x2db27d[_0x77e2('0x32')][_0x77e2('0x39')](_0x77e2('0x56'))){_0x4f1768[_0x77e2('0x1e')]=qs[_0x77e2('0x1e')](_0x2db27d[_0x77e2('0x32')][_0x77e2('0x1e')]);_0x4f1768[_0x77e2('0x1d')]=qs[_0x77e2('0x1d')](_0x2db27d[_0x77e2('0x32')][_0x77e2('0x1d')]);}return _0x3cc6ce[_0x77e2('0x88')](_0x4f1768);}})['then'](function(_0x26daa7){if(_0x26daa7){return _0x26daa7?{'count':_0xd91a40,'rows':_0x26daa7}:null;}})['then'](respondWithResult(_0x1f0492,null))[_0x77e2('0x45')](handleError(_0x1f0492,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 287f005..8c5c82e 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 _0xab11=['remove','emit','hook','exports','SmsQueue','save','update'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xab11,0xba));var _0x1ab1=function(_0x303f8b,_0x4b9bcc){_0x303f8b=_0x303f8b-0x0;var _0x303277=_0xab11[_0x303f8b];return _0x303277;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x1ab1('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ab1('0x1'),'afterUpdate':_0x1ab1('0x2'),'afterDestroy':_0x1ab1('0x3')};function emitEvent(_0x301ddf){return function(_0x12f8a4,_0x23b774,_0x294787){SmsQueueEvents['emit'](_0x301ddf+':'+_0x12f8a4['id'],_0x12f8a4);SmsQueueEvents[_0x1ab1('0x4')](_0x301ddf,_0x12f8a4);_0x294787(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x1ab1('0x5')](e,emitEvent(event));}}module[_0x1ab1('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x98e0=['remove','emit','hook','exports','events','setMaxListeners','save'];(function(_0x3a6ae9,_0x4b9f10){var _0x34c58f=function(_0x1a20ee){while(--_0x1a20ee){_0x3a6ae9['push'](_0x3a6ae9['shift']());}};_0x34c58f(++_0x4b9f10);}(_0x98e0,0xa5));var _0x098e=function(_0x5bc607,_0xa01d3b){_0x5bc607=_0x5bc607-0x0;var _0x23b10b=_0x98e0[_0x5bc607];return _0x23b10b;};'use strict';var EventEmitter=require(_0x098e('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x098e('0x1')](0x0);var events={'afterCreate':_0x098e('0x2'),'afterUpdate':'update','afterDestroy':_0x098e('0x3')};function emitEvent(_0xfa0f44){return function(_0x35eaac,_0x5a728b,_0x1e3643){SmsQueueEvents[_0x098e('0x4')](_0xfa0f44+':'+_0x35eaac['id'],_0x35eaac);SmsQueueEvents[_0x098e('0x4')](_0xfa0f44,_0x35eaac);_0x1e3643(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x098e('0x5')](e,emitEvent(event));}}module[_0x098e('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 0168876..e5ee11f 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 _0x6009=['exports','SmsQueue','sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsQueue.attributes'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x6009,0x9f));var _0x9600=function(_0x5137dd,_0x55c6cb){_0x5137dd=_0x5137dd-0x0;var _0x11dea6=_0x6009[_0x5137dd];return _0x11dea6;};'use strict';var _=require(_0x9600('0x0'));var util=require('util');var logger=require(_0x9600('0x1'))(_0x9600('0x2'));var moment=require(_0x9600('0x3'));var BPromise=require(_0x9600('0x4'));var rp=require(_0x9600('0x5'));var fs=require('fs');var path=require(_0x9600('0x6'));var rimraf=require('rimraf');var config=require(_0x9600('0x7'));var attributes=require(_0x9600('0x8'));module[_0x9600('0x9')]=function(_0x38f80e,_0x555bf7){return _0x38f80e['define'](_0x9600('0xa'),attributes,{'tableName':_0x9600('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e89=['path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x434cc8,_0x3491fa){var _0x168291=function(_0x1ab405){while(--_0x1ab405){_0x434cc8['push'](_0x434cc8['shift']());}};_0x168291(++_0x3491fa);}(_0x6e89,0xb0));var _0x96e8=function(_0x1a3242,_0x13c827){_0x1a3242=_0x1a3242-0x0;var _0x54b2f8=_0x6e89[_0x1a3242];return _0x54b2f8;};'use strict';var _=require(_0x96e8('0x0'));var util=require(_0x96e8('0x1'));var logger=require(_0x96e8('0x2'))(_0x96e8('0x3'));var moment=require(_0x96e8('0x4'));var BPromise=require('bluebird');var rp=require(_0x96e8('0x5'));var fs=require('fs');var path=require(_0x96e8('0x6'));var rimraf=require(_0x96e8('0x7'));var config=require(_0x96e8('0x8'));var attributes=require(_0x96e8('0x9'));module[_0x96e8('0xa')]=function(_0x320e7b,_0x36f5a5){return _0x320e7b[_0x96e8('0xb')](_0x96e8('0xc'),attributes,{'tableName':_0x96e8('0xd'),'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 d5096e5..dda78c0 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 _0x35a5=['map','include','model','attributes','ShowSmsQueue','SmsQueue','find','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetSmsQueue','findAll','options','raw','where'];(function(_0x5b1669,_0x211c0c){var _0x21e5fe=function(_0x7a796){while(--_0x7a796){_0x5b1669['push'](_0x5b1669['shift']());}};_0x21e5fe(++_0x211c0c);}(_0x35a5,0x1b7));var _0x535a=function(_0x2f1d41,_0x3bd614){_0x2f1d41=_0x2f1d41-0x0;var _0x49d294=_0x35a5[_0x2f1d41];return _0x49d294;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x535a('0x0'));var rs=require(_0x535a('0x1'));var fs=require('fs');var Redis=require(_0x535a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x535a('0x3'));var logger=require(_0x535a('0x4'))(_0x535a('0x5'));var config=require(_0x535a('0x6'));var jayson=require(_0x535a('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x535a('0x8')](config[_0x535a('0x9')],{'host':_0x535a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x535a('0x9')]));require('./smsQueue.socket')[_0x535a('0xb')](socket);function respondWithRpcPromise(_0x4aeefa,_0x255844,_0x1f3cf5){return new BPromise(function(_0x3729e5,_0xa5793c){return client[_0x535a('0xc')](_0x4aeefa,_0x1f3cf5)[_0x535a('0xd')](function(_0x35a06a){logger['info'](_0x535a('0xe'),_0x255844,_0x535a('0xf'));logger[_0x535a('0x10')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x255844,_0x535a('0xf'),JSON[_0x535a('0x11')](_0x35a06a));if(_0x35a06a['error']){if(_0x35a06a[_0x535a('0x12')][_0x535a('0x13')]===0x1f4){logger['error'](_0x535a('0xe'),_0x255844,_0x35a06a['error'][_0x535a('0x14')]);return _0xa5793c(_0x35a06a[_0x535a('0x12')]['message']);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x255844,_0x35a06a[_0x535a('0x12')][_0x535a('0x14')]);return _0x3729e5(_0x35a06a[_0x535a('0x12')][_0x535a('0x14')]);}else{logger[_0x535a('0x15')](_0x535a('0xe'),_0x255844,_0x535a('0xf'));_0x3729e5(_0x35a06a[_0x535a('0x16')][_0x535a('0x14')]);}})[_0x535a('0x17')](function(_0x50c176){logger[_0x535a('0x12')](_0x535a('0xe'),_0x255844,_0x50c176);_0xa5793c(_0x50c176);});});}exports[_0x535a('0x18')]=function(_0x539844){var _0x374e6f=this;return new Promise(function(_0xa77372,_0x2bf81b){return db['SmsQueue'][_0x535a('0x19')]({'raw':_0x539844[_0x535a('0x1a')]?_0x539844[_0x535a('0x1a')][_0x535a('0x1b')]===undefined?!![]:![]:!![],'where':_0x539844['options']?_0x539844[_0x535a('0x1a')][_0x535a('0x1c')]||null:null,'attributes':_0x539844[_0x535a('0x1a')]?_0x539844[_0x535a('0x1a')]['attributes']||null:null,'limit':_0x539844[_0x535a('0x1a')]?_0x539844[_0x535a('0x1a')]['limit']||null:null,'include':_0x539844[_0x535a('0x1a')]?_0x539844[_0x535a('0x1a')]['include']?_[_0x535a('0x1d')](_0x539844[_0x535a('0x1a')][_0x535a('0x1e')],function(_0x482d49){return{'model':db[_0x482d49[_0x535a('0x1f')]],'as':_0x482d49['as'],'attributes':_0x482d49[_0x535a('0x20')],'include':_0x482d49[_0x535a('0x1e')]?_[_0x535a('0x1d')](_0x482d49[_0x535a('0x1e')],function(_0x1568f6){return{'model':db[_0x1568f6['model']],'as':_0x1568f6['as'],'attributes':_0x1568f6[_0x535a('0x20')],'include':_0x1568f6[_0x535a('0x1e')]?_['map'](_0x1568f6[_0x535a('0x1e')],function(_0x2e0d40){return{'model':db[_0x2e0d40[_0x535a('0x1f')]],'as':_0x2e0d40['as'],'attributes':_0x2e0d40['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27d84f){logger[_0x535a('0x15')]('GetSmsQueue',_0x539844);logger['debug'](_0x535a('0x18'),_0x539844,JSON['stringify'](_0x27d84f));_0xa77372(_0x27d84f);})[_0x535a('0x17')](function(_0x5d9c5c){logger[_0x535a('0x12')]('GetSmsQueue',_0x5d9c5c[_0x535a('0x14')],_0x539844);_0x2bf81b(_0x374e6f[_0x535a('0x12')](0x1f4,_0x5d9c5c[_0x535a('0x14')]));});});};exports[_0x535a('0x21')]=function(_0x389ec5){var _0xecf606=this;return new Promise(function(_0x25046b,_0x355cfe){return db[_0x535a('0x22')][_0x535a('0x23')]({'raw':_0x389ec5[_0x535a('0x1a')]?_0x389ec5['options'][_0x535a('0x1b')]===undefined?!![]:![]:!![],'where':_0x389ec5[_0x535a('0x1a')]?_0x389ec5[_0x535a('0x1a')][_0x535a('0x1c')]||null:null,'attributes':_0x389ec5['options']?_0x389ec5[_0x535a('0x1a')][_0x535a('0x20')]||null:null,'include':_0x389ec5[_0x535a('0x1a')]?_0x389ec5['options'][_0x535a('0x1e')]?_[_0x535a('0x1d')](_0x389ec5[_0x535a('0x1a')]['include'],function(_0x5de6c0){return{'model':db[_0x5de6c0[_0x535a('0x1f')]],'as':_0x5de6c0['as'],'attributes':_0x5de6c0[_0x535a('0x20')],'include':_0x5de6c0[_0x535a('0x1e')]?_['map'](_0x5de6c0[_0x535a('0x1e')],function(_0x115e08){return{'model':db[_0x115e08[_0x535a('0x1f')]],'as':_0x115e08['as'],'attributes':_0x115e08[_0x535a('0x20')],'include':_0x115e08[_0x535a('0x1e')]?_[_0x535a('0x1d')](_0x115e08[_0x535a('0x1e')],function(_0xc79037){return{'model':db[_0xc79037['model']],'as':_0xc79037['as'],'attributes':_0xc79037[_0x535a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x535a('0xd')](function(_0x4dc639){logger[_0x535a('0x15')]('ShowSmsQueue',_0x389ec5);logger[_0x535a('0x10')]('ShowSmsQueue',_0x389ec5,JSON[_0x535a('0x11')](_0x4dc639));_0x25046b(_0x4dc639);})[_0x535a('0x17')](function(_0x1291d7){logger['error']('ShowSmsQueue',_0x1291d7[_0x535a('0x14')],_0x389ec5);_0x355cfe(_0xecf606[_0x535a('0x12')](0x1f4,_0x1291d7[_0x535a('0x14')]));});});}; \ No newline at end of file +var _0x8706=['map','model','GetSmsQueue','debug','catch','find','raw','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','SmsQueue','findAll','options','where','attributes','limit','include'];(function(_0x17211b,_0x5a652b){var _0x278395=function(_0x1e28c6){while(--_0x1e28c6){_0x17211b['push'](_0x17211b['shift']());}};_0x278395(++_0x5a652b);}(_0x8706,0x80));var _0x6870=function(_0x379ee5,_0x336c42){_0x379ee5=_0x379ee5-0x0;var _0x114694=_0x8706[_0x379ee5];return _0x114694;};'use strict';var _=require(_0x6870('0x0'));var util=require(_0x6870('0x1'));var moment=require(_0x6870('0x2'));var BPromise=require(_0x6870('0x3'));var rs=require(_0x6870('0x4'));var fs=require('fs');var Redis=require(_0x6870('0x5'));var db=require(_0x6870('0x6'))['db'];var utils=require(_0x6870('0x7'));var logger=require('../../config/logger')(_0x6870('0x8'));var config=require(_0x6870('0x9'));var jayson=require(_0x6870('0xa'));var client=jayson[_0x6870('0xb')][_0x6870('0xc')]({'port':0x232a});config[_0x6870('0xd')]=_['defaults'](config[_0x6870('0xd')],{'host':_0x6870('0xe'),'port':0x18eb});var socket=require(_0x6870('0xf'))(new Redis(config['redis']));require(_0x6870('0x10'))['register'](socket);function respondWithRpcPromise(_0x140ba3,_0x4139fd,_0x5d41e1){return new BPromise(function(_0x595baf,_0x644be6){return client[_0x6870('0x11')](_0x140ba3,_0x5d41e1)[_0x6870('0x12')](function(_0x44ec87){logger[_0x6870('0x13')](_0x6870('0x14'),_0x4139fd,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x4139fd,_0x6870('0x15'),JSON[_0x6870('0x16')](_0x44ec87));if(_0x44ec87['error']){if(_0x44ec87[_0x6870('0x17')]['code']===0x1f4){logger[_0x6870('0x17')](_0x6870('0x14'),_0x4139fd,_0x44ec87['error'][_0x6870('0x18')]);return _0x644be6(_0x44ec87[_0x6870('0x17')][_0x6870('0x18')]);}logger[_0x6870('0x17')](_0x6870('0x14'),_0x4139fd,_0x44ec87[_0x6870('0x17')][_0x6870('0x18')]);return _0x595baf(_0x44ec87[_0x6870('0x17')][_0x6870('0x18')]);}else{logger[_0x6870('0x13')]('SmsQueue,\x20%s,\x20%s',_0x4139fd,'request\x20sent');_0x595baf(_0x44ec87['result'][_0x6870('0x18')]);}})['catch'](function(_0x5ca193){logger[_0x6870('0x17')](_0x6870('0x14'),_0x4139fd,_0x5ca193);_0x644be6(_0x5ca193);});});}exports['GetSmsQueue']=function(_0x2a02e1){var _0x20cbc0=this;return new Promise(function(_0x547efb,_0x2ab713){return db[_0x6870('0x19')][_0x6870('0x1a')]({'raw':_0x2a02e1['options']?_0x2a02e1['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a02e1[_0x6870('0x1b')]?_0x2a02e1[_0x6870('0x1b')][_0x6870('0x1c')]||null:null,'attributes':_0x2a02e1['options']?_0x2a02e1[_0x6870('0x1b')][_0x6870('0x1d')]||null:null,'limit':_0x2a02e1[_0x6870('0x1b')]?_0x2a02e1[_0x6870('0x1b')][_0x6870('0x1e')]||null:null,'include':_0x2a02e1['options']?_0x2a02e1['options'][_0x6870('0x1f')]?_[_0x6870('0x20')](_0x2a02e1[_0x6870('0x1b')][_0x6870('0x1f')],function(_0x1f6866){return{'model':db[_0x1f6866['model']],'as':_0x1f6866['as'],'attributes':_0x1f6866[_0x6870('0x1d')],'include':_0x1f6866[_0x6870('0x1f')]?_[_0x6870('0x20')](_0x1f6866['include'],function(_0x18991d){return{'model':db[_0x18991d['model']],'as':_0x18991d['as'],'attributes':_0x18991d[_0x6870('0x1d')],'include':_0x18991d['include']?_[_0x6870('0x20')](_0x18991d['include'],function(_0x5bad3d){return{'model':db[_0x5bad3d[_0x6870('0x21')]],'as':_0x5bad3d['as'],'attributes':_0x5bad3d[_0x6870('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6870('0x12')](function(_0x315802){logger[_0x6870('0x13')](_0x6870('0x22'),_0x2a02e1);logger[_0x6870('0x23')](_0x6870('0x22'),_0x2a02e1,JSON[_0x6870('0x16')](_0x315802));_0x547efb(_0x315802);})[_0x6870('0x24')](function(_0x3302b3){logger['error'](_0x6870('0x22'),_0x3302b3['message'],_0x2a02e1);_0x2ab713(_0x20cbc0[_0x6870('0x17')](0x1f4,_0x3302b3[_0x6870('0x18')]));});});};exports['ShowSmsQueue']=function(_0x446011){var _0x5381ba=this;return new Promise(function(_0x342b96,_0x4155e4){return db[_0x6870('0x19')][_0x6870('0x25')]({'raw':_0x446011['options']?_0x446011[_0x6870('0x1b')][_0x6870('0x26')]===undefined?!![]:![]:!![],'where':_0x446011[_0x6870('0x1b')]?_0x446011[_0x6870('0x1b')][_0x6870('0x1c')]||null:null,'attributes':_0x446011[_0x6870('0x1b')]?_0x446011['options'][_0x6870('0x1d')]||null:null,'include':_0x446011['options']?_0x446011['options'][_0x6870('0x1f')]?_[_0x6870('0x20')](_0x446011[_0x6870('0x1b')]['include'],function(_0x2ef7c3){return{'model':db[_0x2ef7c3[_0x6870('0x21')]],'as':_0x2ef7c3['as'],'attributes':_0x2ef7c3[_0x6870('0x1d')],'include':_0x2ef7c3[_0x6870('0x1f')]?_[_0x6870('0x20')](_0x2ef7c3['include'],function(_0x13dcdd){return{'model':db[_0x13dcdd[_0x6870('0x21')]],'as':_0x13dcdd['as'],'attributes':_0x13dcdd[_0x6870('0x1d')],'include':_0x13dcdd[_0x6870('0x1f')]?_[_0x6870('0x20')](_0x13dcdd[_0x6870('0x1f')],function(_0x388e31){return{'model':db[_0x388e31[_0x6870('0x21')]],'as':_0x388e31['as'],'attributes':_0x388e31[_0x6870('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6870('0x12')](function(_0x32078c){logger[_0x6870('0x13')](_0x6870('0x27'),_0x446011);logger[_0x6870('0x23')](_0x6870('0x27'),_0x446011,JSON['stringify'](_0x32078c));_0x342b96(_0x32078c);})[_0x6870('0x24')](function(_0x2d42c4){logger[_0x6870('0x17')](_0x6870('0x27'),_0x2d42c4[_0x6870('0x18')],_0x446011);_0x4155e4(_0x5381ba[_0x6870('0x17')](0x1f4,_0x2d42c4[_0x6870('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 4359417..cde7992 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 _0xaee8=['length','./smsQueue.events','save','remove','update','emit','register'];(function(_0x1c339c,_0x2be44c){var _0x157e18=function(_0x53b297){while(--_0x53b297){_0x1c339c['push'](_0x1c339c['shift']());}};_0x157e18(++_0x2be44c);}(_0xaee8,0xb7));var _0x8aee=function(_0xa65ffb,_0x53dd5b){_0xa65ffb=_0xa65ffb-0x0;var _0x491769=_0xaee8[_0xa65ffb];return _0x491769;};'use strict';var SmsQueueEvents=require(_0x8aee('0x0'));var events=[_0x8aee('0x1'),_0x8aee('0x2'),_0x8aee('0x3')];function createListener(_0x5cfdcf,_0x586cf1){return function(_0x58160c){_0x586cf1[_0x8aee('0x4')](_0x5cfdcf,_0x58160c);};}function removeListener(_0xef9d71,_0xe2663e){return function(){SmsQueueEvents['removeListener'](_0xef9d71,_0xe2663e);};}exports[_0x8aee('0x5')]=function(_0x5b1d15){for(var _0x53f47b=0x0,_0x400cd9=events[_0x8aee('0x6')];_0x53f47b<_0x400cd9;_0x53f47b++){var _0x219d4f=events[_0x53f47b];var _0x1ed11f=createListener('smsQueue:'+_0x219d4f,_0x5b1d15);SmsQueueEvents['on'](_0x219d4f,_0x1ed11f);}}; \ No newline at end of file +var _0x8742=['smsQueue:','remove','update','emit','removeListener','length'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x8742,0xaf));var _0x2874=function(_0x30414b,_0x3d7fab){_0x30414b=_0x30414b-0x0;var _0x5df517=_0x8742[_0x30414b];return _0x5df517;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x2874('0x0'),_0x2874('0x1')];function createListener(_0x263ff8,_0x3d0945){return function(_0x420b22){_0x3d0945[_0x2874('0x2')](_0x263ff8,_0x420b22);};}function removeListener(_0x3ade98,_0x417c6e){return function(){SmsQueueEvents[_0x2874('0x3')](_0x3ade98,_0x417c6e);};}exports['register']=function(_0x246e1b){for(var _0x757e5d=0x0,_0x1dfbf8=events[_0x2874('0x4')];_0x757e5d<_0x1dfbf8;_0x757e5d++){var _0xcc5742=events[_0x757e5d];var _0x329001=createListener(_0x2874('0x5')+_0xcc5742,_0x246e1b);SmsQueueEvents['on'](_0xcc5742,_0x329001);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 16b5cbd..b88b213 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 _0x2409=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','/:id','isAuthenticated','post','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2bddf9,_0x22c873){var _0x3f3ae9=function(_0x2d91ac){while(--_0x2d91ac){_0x2bddf9['push'](_0x2bddf9['shift']());}};_0x3f3ae9(++_0x22c873);}(_0x2409,0x128));var _0x9240=function(_0x5dac1d,_0x50f69a){_0x5dac1d=_0x5dac1d-0x0;var _0x69241b=_0x2409[_0x5dac1d];return _0x69241b;};'use strict';var multer=require(_0x9240('0x0'));var util=require(_0x9240('0x1'));var path=require(_0x9240('0x2'));var timeout=require(_0x9240('0x3'));var express=require(_0x9240('0x4'));var router=express[_0x9240('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9240('0x6'));var interaction=require(_0x9240('0x7'));var config=require(_0x9240('0x8'));var controller=require(_0x9240('0x9'));router[_0x9240('0xa')]('/',auth['isAuthenticated'](),controller[_0x9240('0xb')]);router[_0x9240('0xa')](_0x9240('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9240('0xd'),auth[_0x9240('0xe')](),controller['show']);router[_0x9240('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9240('0x10')]('/:id',auth[_0x9240('0xe')](),controller[_0x9240('0x11')]);router[_0x9240('0x12')](_0x9240('0xd'),auth[_0x9240('0xe')](),controller[_0x9240('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe6a5=['index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xe6a5,0x13b));var _0x5e6a=function(_0x56ef12,_0x58e16e){_0x56ef12=_0x56ef12-0x0;var _0x5ebc30=_0xe6a5[_0x56ef12];return _0x5ebc30;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5e6a('0x0'));var express=require(_0x5e6a('0x1'));var router=express[_0x5e6a('0x2')]();var fs_extra=require(_0x5e6a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5e6a('0x4'));var config=require('../../config/environment');var controller=require(_0x5e6a('0x5'));router[_0x5e6a('0x6')]('/',auth[_0x5e6a('0x7')](),controller[_0x5e6a('0x8')]);router[_0x5e6a('0x6')](_0x5e6a('0x9'),auth[_0x5e6a('0x7')](),controller[_0x5e6a('0xa')]);router[_0x5e6a('0x6')](_0x5e6a('0xb'),auth[_0x5e6a('0x7')](),controller['show']);router[_0x5e6a('0xc')]('/',auth['isAuthenticated'](),controller[_0x5e6a('0xd')]);router[_0x5e6a('0xe')]('/:id',auth[_0x5e6a('0x7')](),controller[_0x5e6a('0xf')]);router[_0x5e6a('0x10')](_0x5e6a('0xb'),auth[_0x5e6a('0x7')](),controller[_0x5e6a('0x11')]);module[_0x5e6a('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 7046604..5012776 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 _0x7564=['STRING','DATE','moment'];(function(_0x613122,_0x30e6ef){var _0x5b8413=function(_0x1ae7c4){while(--_0x1ae7c4){_0x613122['push'](_0x613122['shift']());}};_0x5b8413(++_0x30e6ef);}(_0x7564,0xaa));var _0x4756=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7564[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require(_0x4756('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4756('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4756('0x2')]},'acceptAt':{'type':Sequelize[_0x4756('0x2')]},'exitAt':{'type':Sequelize[_0x4756('0x2')]},'reason':{'type':Sequelize[_0x4756('0x1')]}}; \ No newline at end of file +var _0x3059=['DATE','moment','exports','STRING'];(function(_0x5cf969,_0x37a1c9){var _0x3235a0=function(_0x3189dd){while(--_0x3189dd){_0x5cf969['push'](_0x5cf969['shift']());}};_0x3235a0(++_0x37a1c9);}(_0x3059,0x1a9));var _0x9305=function(_0x1d245f,_0x1058bb){_0x1d245f=_0x1d245f-0x0;var _0x540387=_0x3059[_0x1d245f];return _0x540387;};'use strict';var moment=require(_0x9305('0x0'));var Sequelize=require('sequelize');module[_0x9305('0x1')]={'uniqueid':{'type':Sequelize[_0x9305('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9305('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9305('0x3')]},'exitAt':{'type':Sequelize[_0x9305('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 917781d..995b6cb 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 _0x9e48=['papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','intersection','query','attributes','model','fields','hasOwnProperty','sort','where','pick','filters','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9e48,0xcf));var _0x89e4=function(_0x3ed70a,_0x18c849){_0x3ed70a=_0x3ed70a-0x0;var _0x2add57=_0x9e48[_0x3ed70a];return _0x2add57;};'use strict';var emlformat=require(_0x89e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89e4('0x1'));var jsonpatch=require(_0x89e4('0x2'));var rp=require(_0x89e4('0x3'));var moment=require(_0x89e4('0x4'));var BPromise=require(_0x89e4('0x5'));var Mustache=require(_0x89e4('0x6'));var util=require(_0x89e4('0x7'));var path=require('path');var sox=require(_0x89e4('0x8'));var csv=require('to-csv');var ejs=require(_0x89e4('0x9'));var fs=require('fs');var fs_extra=require(_0x89e4('0xa'));var _=require('lodash');var squel=require(_0x89e4('0xb'));var crypto=require(_0x89e4('0xc'));var jsforce=require(_0x89e4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x89e4('0xe'));var querystring=require('querystring');var Papa=require(_0x89e4('0xf'));var Redis=require(_0x89e4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89e4('0x11'));var logger=require(_0x89e4('0x12'))(_0x89e4('0x13'));var utils=require(_0x89e4('0x14'));var config=require(_0x89e4('0x15'));var licenseUtil=require(_0x89e4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x430642,_0x9a977e){_0x9a977e=_0x9a977e||0xcc;return function(_0x4a2ac9){if(_0x4a2ac9){return _0x430642['sendStatus'](_0x9a977e);}return _0x430642[_0x89e4('0x17')](_0x9a977e)[_0x89e4('0x18')]();};}function respondWithResult(_0x907942,_0x2102a8){_0x2102a8=_0x2102a8||0xc8;return function(_0x2e9039){if(_0x2e9039){return _0x907942[_0x89e4('0x17')](_0x2102a8)[_0x89e4('0x19')](_0x2e9039);}};}function respondWithFilteredResult(_0x4ca105,_0x158968){return function(_0x593215){if(_0x593215){var _0x46a183=typeof _0x158968[_0x89e4('0x1a')]==='undefined'&&typeof _0x158968[_0x89e4('0x1b')]===_0x89e4('0x1c');var _0x44fead=_0x593215[_0x89e4('0x1d')];var _0x3a3c7b=_0x46a183?0x0:_0x158968['offset'];var _0x2aeea3=_0x46a183?_0x593215[_0x89e4('0x1d')]:_0x158968[_0x89e4('0x1a')]+_0x158968[_0x89e4('0x1b')];var _0x4b64a9;if(_0x2aeea3>=_0x44fead){_0x2aeea3=_0x44fead;_0x4b64a9=0xc8;}else{_0x4b64a9=0xce;}_0x4ca105[_0x89e4('0x17')](_0x4b64a9);return _0x4ca105[_0x89e4('0x1e')](_0x89e4('0x1f'),_0x3a3c7b+'-'+_0x2aeea3+'/'+_0x44fead)[_0x89e4('0x19')](_0x593215);}return null;};}function patchUpdates(_0xeac19a){return function(_0x57fe61){try{jsonpatch[_0x89e4('0x20')](_0x57fe61,_0xeac19a,!![]);}catch(_0x40a85e){return BPromise[_0x89e4('0x21')](_0x40a85e);}return _0x57fe61[_0x89e4('0x22')]();};}function saveUpdates(_0x36b699,_0x2f4e12){return function(_0x5244b0){if(_0x5244b0){return _0x5244b0[_0x89e4('0x23')](_0x36b699)['then'](function(_0x367bb6){return _0x367bb6;});}return null;};}function removeEntity(_0x29c800,_0x21dc25){return function(_0x26613c){if(_0x26613c){return _0x26613c['destroy']()[_0x89e4('0x24')](function(){_0x29c800[_0x89e4('0x17')](0xcc)[_0x89e4('0x18')]();});}};}function handleEntityNotFound(_0x5e0fc4,_0xdfd701){return function(_0x18c386){if(!_0x18c386){_0x5e0fc4[_0x89e4('0x25')](0x194);}return _0x18c386;};}function handleError(_0x2f5da4,_0x482128){_0x482128=_0x482128||0x1f4;return function(_0x1abe9c){logger['error'](_0x1abe9c[_0x89e4('0x26')]);if(_0x1abe9c[_0x89e4('0x27')]){delete _0x1abe9c[_0x89e4('0x27')];}_0x2f5da4[_0x89e4('0x17')](_0x482128)[_0x89e4('0x28')](_0x1abe9c);};}exports[_0x89e4('0x29')]=function(_0x26fa88,_0x36f250){var _0x1d4c47={},_0x15c625={},_0x2a7154={'count':0x0,'rows':[]};var _0x1bdd82=_[_0x89e4('0x2a')](db[_0x89e4('0x2b')][_0x89e4('0x2c')],function(_0x340b65){return{'name':_0x340b65[_0x89e4('0x2d')],'type':_0x340b65[_0x89e4('0x2e')]['key']};});_0x15c625['model']=_[_0x89e4('0x2a')](_0x1bdd82,'name');_0x15c625['query']=_['keys'](_0x26fa88['query']);_0x15c625['filters']=_[_0x89e4('0x2f')](_0x15c625['model'],_0x15c625[_0x89e4('0x30')]);_0x1d4c47[_0x89e4('0x31')]=_['intersection'](_0x15c625[_0x89e4('0x32')],qs[_0x89e4('0x33')](_0x26fa88[_0x89e4('0x30')]['fields']));_0x1d4c47[_0x89e4('0x31')]=_0x1d4c47[_0x89e4('0x31')]['length']?_0x1d4c47[_0x89e4('0x31')]:_0x15c625[_0x89e4('0x32')];if(!_0x26fa88[_0x89e4('0x30')][_0x89e4('0x34')]('nolimit')){_0x1d4c47['limit']=qs[_0x89e4('0x1b')](_0x26fa88['query'][_0x89e4('0x1b')]);_0x1d4c47[_0x89e4('0x1a')]=qs[_0x89e4('0x1a')](_0x26fa88[_0x89e4('0x30')][_0x89e4('0x1a')]);}_0x1d4c47['order']=qs[_0x89e4('0x35')](_0x26fa88['query'][_0x89e4('0x35')]);_0x1d4c47[_0x89e4('0x36')]=qs['filters'](_[_0x89e4('0x37')](_0x26fa88[_0x89e4('0x30')],_0x15c625[_0x89e4('0x38')]),_0x1bdd82);if(_0x26fa88['query'][_0x89e4('0x39')]){_0x1d4c47[_0x89e4('0x36')]=_['merge'](_0x1d4c47[_0x89e4('0x36')],{'$or':_[_0x89e4('0x2a')](_0x1bdd82,function(_0x506a4a){if(_0x506a4a[_0x89e4('0x2e')]!==_0x89e4('0x3a')){var _0x24a83c={};_0x24a83c[_0x506a4a[_0x89e4('0x27')]]={'$like':'%'+_0x26fa88[_0x89e4('0x30')][_0x89e4('0x39')]+'%'};return _0x24a83c;}})});}_0x1d4c47=_['merge']({},_0x1d4c47,_0x26fa88[_0x89e4('0x3b')]);var _0x545ca6={'where':_0x1d4c47[_0x89e4('0x36')]};return db[_0x89e4('0x2b')][_0x89e4('0x1d')](_0x545ca6)[_0x89e4('0x24')](function(_0x5cde1e){_0x2a7154[_0x89e4('0x1d')]=_0x5cde1e;if(_0x26fa88[_0x89e4('0x30')]['includeAll']){_0x1d4c47[_0x89e4('0x3c')]=[{'all':!![]}];}return db[_0x89e4('0x2b')][_0x89e4('0x3d')](_0x1d4c47);})['then'](function(_0x1f9da3){_0x2a7154[_0x89e4('0x3e')]=_0x1f9da3;return _0x2a7154;})[_0x89e4('0x24')](respondWithFilteredResult(_0x36f250,_0x1d4c47))[_0x89e4('0x3f')](handleError(_0x36f250,null));};exports[_0x89e4('0x40')]=function(_0x46f8e0,_0x13aa11){var _0x27110={'raw':!![],'where':{'id':_0x46f8e0[_0x89e4('0x41')]['id']}},_0x1a2530={};_0x1a2530[_0x89e4('0x32')]=_[_0x89e4('0x42')](db[_0x89e4('0x2b')][_0x89e4('0x2c')]);_0x1a2530['query']=_[_0x89e4('0x42')](_0x46f8e0[_0x89e4('0x30')]);_0x1a2530[_0x89e4('0x38')]=_[_0x89e4('0x2f')](_0x1a2530['model'],_0x1a2530[_0x89e4('0x30')]);_0x27110['attributes']=_['intersection'](_0x1a2530[_0x89e4('0x32')],qs[_0x89e4('0x33')](_0x46f8e0[_0x89e4('0x30')][_0x89e4('0x33')]));_0x27110[_0x89e4('0x31')]=_0x27110[_0x89e4('0x31')][_0x89e4('0x43')]?_0x27110[_0x89e4('0x31')]:_0x1a2530['model'];if(_0x46f8e0['query'][_0x89e4('0x44')]){_0x27110[_0x89e4('0x3c')]=[{'all':!![]}];}_0x27110=_[_0x89e4('0x45')]({},_0x27110,_0x46f8e0[_0x89e4('0x3b')]);return db[_0x89e4('0x2b')][_0x89e4('0x46')](_0x27110)['then'](handleEntityNotFound(_0x13aa11,null))[_0x89e4('0x24')](respondWithResult(_0x13aa11,null))['catch'](handleError(_0x13aa11,null));};exports[_0x89e4('0x47')]=function(_0x466e9a,_0x2df70e){return db['SmsQueueReport'][_0x89e4('0x47')](_0x466e9a[_0x89e4('0x48')],{})[_0x89e4('0x24')](respondWithResult(_0x2df70e,0xc9))[_0x89e4('0x3f')](handleError(_0x2df70e,null));};exports[_0x89e4('0x23')]=function(_0x54f451,_0x315dda){if(_0x54f451[_0x89e4('0x48')]['id']){delete _0x54f451['body']['id'];}return db[_0x89e4('0x2b')][_0x89e4('0x46')]({'where':{'id':_0x54f451[_0x89e4('0x41')]['id']}})[_0x89e4('0x24')](handleEntityNotFound(_0x315dda,null))[_0x89e4('0x24')](saveUpdates(_0x54f451[_0x89e4('0x48')],null))['then'](respondWithResult(_0x315dda,null))['catch'](handleError(_0x315dda,null));};exports['destroy']=function(_0x4a00a9,_0x2c79df){return db['SmsQueueReport'][_0x89e4('0x46')]({'where':{'id':_0x4a00a9[_0x89e4('0x41')]['id']}})[_0x89e4('0x24')](handleEntityNotFound(_0x2c79df,null))['then'](removeEntity(_0x2c79df,null))[_0x89e4('0x3f')](handleError(_0x2c79df,null));};exports[_0x89e4('0x49')]=function(_0x3a3526,_0x219543){return db[_0x89e4('0x2b')][_0x89e4('0x49')]()[_0x89e4('0x24')](respondWithResult(_0x219543,null))[_0x89e4('0x3f')](handleError(_0x219543,null));}; \ No newline at end of file +var _0x9b60=['map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','rows','show','params','keys','includeAll','include','find','create','body','catch','destroy','describe','rimraf','zip-dir','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','end','error','stack','name','index'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9b60,0x1ca));var _0x09b6=function(_0x41ff08,_0x57ef86){_0x41ff08=_0x41ff08-0x0;var _0x58019c=_0x9b60[_0x41ff08];return _0x58019c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09b6('0x0'));var zipdir=require(_0x09b6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x09b6('0x2'));var Mustache=require(_0x09b6('0x3'));var util=require(_0x09b6('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x09b6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09b6('0x6'));var _=require(_0x09b6('0x7'));var squel=require(_0x09b6('0x8'));var crypto=require(_0x09b6('0x9'));var jsforce=require(_0x09b6('0xa'));var deskjs=require(_0x09b6('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x09b6('0xc'));var Redis=require(_0x09b6('0xd'));var authService=require(_0x09b6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x09b6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09b6('0x10'))(_0x09b6('0x11'));var utils=require(_0x09b6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x09b6('0x13'));var db=require(_0x09b6('0x14'))['db'];function respondWithStatusCode(_0x2cae6b,_0x1f787e){_0x1f787e=_0x1f787e||0xcc;return function(_0x1f0e69){if(_0x1f0e69){return _0x2cae6b[_0x09b6('0x15')](_0x1f787e);}return _0x2cae6b[_0x09b6('0x16')](_0x1f787e)['end']();};}function respondWithResult(_0x403350,_0x262d03){_0x262d03=_0x262d03||0xc8;return function(_0x1e8257){if(_0x1e8257){return _0x403350[_0x09b6('0x16')](_0x262d03)[_0x09b6('0x17')](_0x1e8257);}};}function respondWithFilteredResult(_0x32140a,_0x466ab1){return function(_0x266119){if(_0x266119){var _0x452f8a=typeof _0x466ab1[_0x09b6('0x18')]==='undefined'&&typeof _0x466ab1[_0x09b6('0x19')]===_0x09b6('0x1a');var _0x26a0c5=_0x266119[_0x09b6('0x1b')];var _0x36e671=_0x452f8a?0x0:_0x466ab1[_0x09b6('0x18')];var _0x558a29=_0x452f8a?_0x266119[_0x09b6('0x1b')]:_0x466ab1['offset']+_0x466ab1[_0x09b6('0x19')];var _0x3db875;if(_0x558a29>=_0x26a0c5){_0x558a29=_0x26a0c5;_0x3db875=0xc8;}else{_0x3db875=0xce;}_0x32140a[_0x09b6('0x16')](_0x3db875);return _0x32140a[_0x09b6('0x1c')](_0x09b6('0x1d'),_0x36e671+'-'+_0x558a29+'/'+_0x26a0c5)[_0x09b6('0x17')](_0x266119);}return null;};}function patchUpdates(_0x10e220){return function(_0x2124d6){try{jsonpatch['apply'](_0x2124d6,_0x10e220,!![]);}catch(_0xb49e38){return BPromise[_0x09b6('0x1e')](_0xb49e38);}return _0x2124d6[_0x09b6('0x1f')]();};}function saveUpdates(_0xf3d227,_0x341a1){return function(_0x11d796){if(_0x11d796){return _0x11d796[_0x09b6('0x20')](_0xf3d227)[_0x09b6('0x21')](function(_0x5ea94e){return _0x5ea94e;});}return null;};}function removeEntity(_0x37c787,_0x15ccd7){return function(_0x156305){if(_0x156305){return _0x156305['destroy']()[_0x09b6('0x21')](function(){_0x37c787[_0x09b6('0x16')](0xcc)[_0x09b6('0x22')]();});}};}function handleEntityNotFound(_0x14602b,_0x2b8216){return function(_0x28bb0c){if(!_0x28bb0c){_0x14602b['sendStatus'](0x194);}return _0x28bb0c;};}function handleError(_0x3c6424,_0x5a8ad5){_0x5a8ad5=_0x5a8ad5||0x1f4;return function(_0x655a78){logger[_0x09b6('0x23')](_0x655a78[_0x09b6('0x24')]);if(_0x655a78[_0x09b6('0x25')]){delete _0x655a78[_0x09b6('0x25')];}_0x3c6424[_0x09b6('0x16')](_0x5a8ad5)['send'](_0x655a78);};}exports[_0x09b6('0x26')]=function(_0x4f60e1,_0x463065){var _0x111cf3={},_0x5cd612={},_0x286c33={'count':0x0,'rows':[]};var _0x225d7b=_[_0x09b6('0x27')](db[_0x09b6('0x28')][_0x09b6('0x29')],function(_0x38f991){return{'name':_0x38f991[_0x09b6('0x2a')],'type':_0x38f991[_0x09b6('0x2b')][_0x09b6('0x2c')]};});_0x5cd612[_0x09b6('0x2d')]=_[_0x09b6('0x27')](_0x225d7b,_0x09b6('0x25'));_0x5cd612[_0x09b6('0x2e')]=_['keys'](_0x4f60e1[_0x09b6('0x2e')]);_0x5cd612[_0x09b6('0x2f')]=_[_0x09b6('0x30')](_0x5cd612['model'],_0x5cd612['query']);_0x111cf3[_0x09b6('0x31')]=_[_0x09b6('0x30')](_0x5cd612[_0x09b6('0x2d')],qs['fields'](_0x4f60e1['query'][_0x09b6('0x32')]));_0x111cf3[_0x09b6('0x31')]=_0x111cf3[_0x09b6('0x31')][_0x09b6('0x33')]?_0x111cf3[_0x09b6('0x31')]:_0x5cd612[_0x09b6('0x2d')];if(!_0x4f60e1[_0x09b6('0x2e')]['hasOwnProperty']('nolimit')){_0x111cf3[_0x09b6('0x19')]=qs[_0x09b6('0x19')](_0x4f60e1['query'][_0x09b6('0x19')]);_0x111cf3['offset']=qs['offset'](_0x4f60e1[_0x09b6('0x2e')][_0x09b6('0x18')]);}_0x111cf3[_0x09b6('0x34')]=qs[_0x09b6('0x35')](_0x4f60e1['query'][_0x09b6('0x35')]);_0x111cf3[_0x09b6('0x36')]=qs[_0x09b6('0x2f')](_[_0x09b6('0x37')](_0x4f60e1[_0x09b6('0x2e')],_0x5cd612['filters']),_0x225d7b);if(_0x4f60e1[_0x09b6('0x2e')][_0x09b6('0x38')]){_0x111cf3[_0x09b6('0x36')]=_['merge'](_0x111cf3[_0x09b6('0x36')],{'$or':_[_0x09b6('0x27')](_0x225d7b,function(_0x37ed00){if(_0x37ed00[_0x09b6('0x2b')]!=='VIRTUAL'){var _0x1c51fe={};_0x1c51fe[_0x37ed00[_0x09b6('0x25')]]={'$like':'%'+_0x4f60e1[_0x09b6('0x2e')]['filter']+'%'};return _0x1c51fe;}})});}_0x111cf3=_[_0x09b6('0x39')]({},_0x111cf3,_0x4f60e1[_0x09b6('0x3a')]);var _0x2a4758={'where':_0x111cf3[_0x09b6('0x36')]};return db['SmsQueueReport'][_0x09b6('0x1b')](_0x2a4758)[_0x09b6('0x21')](function(_0x4b4907){_0x286c33[_0x09b6('0x1b')]=_0x4b4907;if(_0x4f60e1[_0x09b6('0x2e')]['includeAll']){_0x111cf3['include']=[{'all':!![]}];}return db[_0x09b6('0x28')]['findAll'](_0x111cf3);})[_0x09b6('0x21')](function(_0x496611){_0x286c33[_0x09b6('0x3b')]=_0x496611;return _0x286c33;})[_0x09b6('0x21')](respondWithFilteredResult(_0x463065,_0x111cf3))['catch'](handleError(_0x463065,null));};exports[_0x09b6('0x3c')]=function(_0x1b63f9,_0x3f018d){var _0x3311ec={'raw':!![],'where':{'id':_0x1b63f9[_0x09b6('0x3d')]['id']}},_0x20b035={};_0x20b035[_0x09b6('0x2d')]=_[_0x09b6('0x3e')](db[_0x09b6('0x28')]['rawAttributes']);_0x20b035['query']=_[_0x09b6('0x3e')](_0x1b63f9['query']);_0x20b035[_0x09b6('0x2f')]=_[_0x09b6('0x30')](_0x20b035[_0x09b6('0x2d')],_0x20b035[_0x09b6('0x2e')]);_0x3311ec[_0x09b6('0x31')]=_['intersection'](_0x20b035[_0x09b6('0x2d')],qs[_0x09b6('0x32')](_0x1b63f9[_0x09b6('0x2e')][_0x09b6('0x32')]));_0x3311ec[_0x09b6('0x31')]=_0x3311ec[_0x09b6('0x31')][_0x09b6('0x33')]?_0x3311ec['attributes']:_0x20b035[_0x09b6('0x2d')];if(_0x1b63f9[_0x09b6('0x2e')][_0x09b6('0x3f')]){_0x3311ec[_0x09b6('0x40')]=[{'all':!![]}];}_0x3311ec=_[_0x09b6('0x39')]({},_0x3311ec,_0x1b63f9[_0x09b6('0x3a')]);return db[_0x09b6('0x28')][_0x09b6('0x41')](_0x3311ec)[_0x09b6('0x21')](handleEntityNotFound(_0x3f018d,null))[_0x09b6('0x21')](respondWithResult(_0x3f018d,null))['catch'](handleError(_0x3f018d,null));};exports['create']=function(_0x4e4f73,_0x4ab677){return db['SmsQueueReport'][_0x09b6('0x42')](_0x4e4f73[_0x09b6('0x43')],{})['then'](respondWithResult(_0x4ab677,0xc9))[_0x09b6('0x44')](handleError(_0x4ab677,null));};exports['update']=function(_0x362678,_0x3f68da){if(_0x362678['body']['id']){delete _0x362678['body']['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x362678[_0x09b6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3f68da,null))[_0x09b6('0x21')](saveUpdates(_0x362678[_0x09b6('0x43')],null))[_0x09b6('0x21')](respondWithResult(_0x3f68da,null))['catch'](handleError(_0x3f68da,null));};exports[_0x09b6('0x45')]=function(_0x24731,_0x50da4c){return db[_0x09b6('0x28')][_0x09b6('0x41')]({'where':{'id':_0x24731[_0x09b6('0x3d')]['id']}})[_0x09b6('0x21')](handleEntityNotFound(_0x50da4c,null))[_0x09b6('0x21')](removeEntity(_0x50da4c,null))[_0x09b6('0x44')](handleError(_0x50da4c,null));};exports['describe']=function(_0x298436,_0x4b4b42){return db['SmsQueueReport'][_0x09b6('0x46')]()[_0x09b6('0x21')](respondWithResult(_0x4b4b42,null))['catch'](handleError(_0x4b4b42,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index c2916c3..42a4dcb 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(_0x29a753,_0x5ce67d){var _0x5d78c7=function(_0x2659dd){while(--_0x2659dd){_0x29a753['push'](_0x29a753['shift']());}};_0x5d78c7(++_0x5ce67d);}(_0xe706,0xa3));var _0x6e70=function(_0x192add,_0x4490e4){_0x192add=_0x192add-0x0;var _0x1b9d9d=_0xe706[_0x192add];return _0x1b9d9d;};'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 _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0xd12e24,_0x386534){var _0x446e94=function(_0x6f1a90){while(--_0x6f1a90){_0xd12e24['push'](_0xd12e24['shift']());}};_0x446e94(++_0x386534);}(_0x70e0,0x17b));var _0x070e=function(_0x51a3b5,_0x461201){_0x51a3b5=_0x51a3b5-0x0;var _0x5e8354=_0x70e0[_0x51a3b5];return _0x5e8354;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 525008d..927e342 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 _0x065e=['stringify','code','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','UpdateSmsQueueReport','update','raw','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x065e,0x1c3));var _0xe065=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x065e[_0x1cd47d];return _0x29d52f;};'use strict';var _=require(_0xe065('0x0'));var util=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe065('0x4'));var db=require(_0xe065('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe065('0x6'));var config=require(_0xe065('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35d00d,_0x55cb54,_0x202411){return new BPromise(function(_0xc75cb5,_0x291de1){return client[_0xe065('0x8')](_0x35d00d,_0x202411)[_0xe065('0x9')](function(_0x2efd24){logger[_0xe065('0xa')](_0xe065('0xb'),_0x55cb54,'request\x20sent');logger['debug'](_0xe065('0xc'),_0x55cb54,_0xe065('0xd'),JSON[_0xe065('0xe')](_0x2efd24));if(_0x2efd24['error']){if(_0x2efd24['error'][_0xe065('0xf')]===0x1f4){logger[_0xe065('0x10')](_0xe065('0xb'),_0x55cb54,_0x2efd24[_0xe065('0x10')][_0xe065('0x11')]);return _0x291de1(_0x2efd24[_0xe065('0x10')][_0xe065('0x11')]);}logger['error'](_0xe065('0xb'),_0x55cb54,_0x2efd24['error'][_0xe065('0x11')]);return _0xc75cb5(_0x2efd24[_0xe065('0x10')][_0xe065('0x11')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x55cb54,_0xe065('0xd'));_0xc75cb5(_0x2efd24[_0xe065('0x12')]['message']);}})[_0xe065('0x13')](function(_0x4142ff){logger[_0xe065('0x10')](_0xe065('0xb'),_0x55cb54,_0x4142ff);_0x291de1(_0x4142ff);});});}exports[_0xe065('0x14')]=function(_0x177064){var _0x57095d=this;return new Promise(function(_0x58a10a,_0x5afb04){return db[_0xe065('0x15')]['create'](_0x177064[_0xe065('0x16')],{'raw':_0x177064[_0xe065('0x17')]?_0x177064[_0xe065('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xe065('0x9')](function(_0x1077c6){logger[_0xe065('0xa')](_0xe065('0x14'),_0x177064);logger['debug'](_0xe065('0x14'),_0x177064,JSON['stringify'](_0x1077c6));_0x58a10a(_0x1077c6);})['catch'](function(_0x455e63){logger[_0xe065('0x10')](_0xe065('0x14'),_0x455e63[_0xe065('0x11')],_0x177064);_0x5afb04(_0x57095d[_0xe065('0x10')](0x1f4,_0x455e63[_0xe065('0x11')]));});});};exports[_0xe065('0x18')]=function(_0x35e0b3){var _0x3300aa=this;return new Promise(function(_0x544113,_0x1a0172){return db[_0xe065('0x15')][_0xe065('0x19')](_0x35e0b3[_0xe065('0x16')],{'raw':_0x35e0b3[_0xe065('0x17')]?_0x35e0b3['options'][_0xe065('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e0b3['options']?_0x35e0b3[_0xe065('0x17')][_0xe065('0x1b')]||null:null,'attributes':_0x35e0b3[_0xe065('0x17')]?_0x35e0b3[_0xe065('0x17')][_0xe065('0x1c')]||null:null,'limit':_0x35e0b3['options']?_0x35e0b3['options'][_0xe065('0x1d')]||null:null})['then'](function(_0x92fc6c){logger[_0xe065('0xa')](_0xe065('0x18'),_0x35e0b3);logger[_0xe065('0x1e')](_0xe065('0x18'),_0x35e0b3,JSON[_0xe065('0xe')](_0x92fc6c));_0x544113(_0x92fc6c);})[_0xe065('0x13')](function(_0x139b66){logger[_0xe065('0x10')](_0xe065('0x18'),_0x139b66['message'],_0x35e0b3);_0x1a0172(_0x3300aa['error'](0x1f4,_0x139b66[_0xe065('0x11')]));});});}; \ No newline at end of file +var _0x8f15=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','catch','create','body','options','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','SmsQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x330cdb,_0x5f23fb){var _0x90b98d=function(_0x56eb29){while(--_0x56eb29){_0x330cdb['push'](_0x330cdb['shift']());}};_0x90b98d(++_0x5f23fb);}(_0x8f15,0x1d7));var _0x58f1=function(_0x155f08,_0x266370){_0x155f08=_0x155f08-0x0;var _0x1f3b11=_0x8f15[_0x155f08];return _0x1f3b11;};'use strict';var _=require(_0x58f1('0x0'));var util=require(_0x58f1('0x1'));var moment=require(_0x58f1('0x2'));var BPromise=require(_0x58f1('0x3'));var rs=require(_0x58f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58f1('0x5'))['db'];var utils=require(_0x58f1('0x6'));var logger=require(_0x58f1('0x7'))(_0x58f1('0x8'));var config=require(_0x58f1('0x9'));var jayson=require(_0x58f1('0xa'));var client=jayson[_0x58f1('0xb')][_0x58f1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a7dce,_0x8366f7,_0x22827c){return new BPromise(function(_0x394c9d,_0x12e6d4){return client[_0x58f1('0xd')](_0x3a7dce,_0x22827c)[_0x58f1('0xe')](function(_0x348cd5){logger[_0x58f1('0xf')](_0x58f1('0x10'),_0x8366f7,_0x58f1('0x11'));logger[_0x58f1('0x12')](_0x58f1('0x13'),_0x8366f7,_0x58f1('0x11'),JSON['stringify'](_0x348cd5));if(_0x348cd5[_0x58f1('0x14')]){if(_0x348cd5[_0x58f1('0x14')]['code']===0x1f4){logger[_0x58f1('0x14')](_0x58f1('0x10'),_0x8366f7,_0x348cd5[_0x58f1('0x14')]['message']);return _0x12e6d4(_0x348cd5['error'][_0x58f1('0x15')]);}logger['error'](_0x58f1('0x10'),_0x8366f7,_0x348cd5[_0x58f1('0x14')][_0x58f1('0x15')]);return _0x394c9d(_0x348cd5[_0x58f1('0x14')][_0x58f1('0x15')]);}else{logger[_0x58f1('0xf')](_0x58f1('0x10'),_0x8366f7,'request\x20sent');_0x394c9d(_0x348cd5['result']['message']);}})[_0x58f1('0x16')](function(_0x522839){logger[_0x58f1('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x8366f7,_0x522839);_0x12e6d4(_0x522839);});});}exports['CreateSmsQueueReport']=function(_0x267566){var _0x2103a7=this;return new Promise(function(_0x385ce2,_0x2c76ad){return db['SmsQueueReport'][_0x58f1('0x17')](_0x267566[_0x58f1('0x18')],{'raw':_0x267566[_0x58f1('0x19')]?_0x267566[_0x58f1('0x19')][_0x58f1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x11baf3){logger[_0x58f1('0xf')]('CreateSmsQueueReport',_0x267566);logger[_0x58f1('0x12')](_0x58f1('0x1b'),_0x267566,JSON[_0x58f1('0x1c')](_0x11baf3));_0x385ce2(_0x11baf3);})[_0x58f1('0x16')](function(_0x2c300d){logger[_0x58f1('0x14')](_0x58f1('0x1b'),_0x2c300d[_0x58f1('0x15')],_0x267566);_0x2c76ad(_0x2103a7[_0x58f1('0x14')](0x1f4,_0x2c300d[_0x58f1('0x15')]));});});};exports[_0x58f1('0x1d')]=function(_0x2e7bf3){var _0x2a5466=this;return new Promise(function(_0x1485e2,_0x145ba0){return db[_0x58f1('0x1e')]['update'](_0x2e7bf3[_0x58f1('0x18')],{'raw':_0x2e7bf3[_0x58f1('0x19')]?_0x2e7bf3[_0x58f1('0x19')][_0x58f1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e7bf3[_0x58f1('0x19')]?_0x2e7bf3[_0x58f1('0x19')][_0x58f1('0x1f')]||null:null,'attributes':_0x2e7bf3['options']?_0x2e7bf3['options'][_0x58f1('0x20')]||null:null,'limit':_0x2e7bf3[_0x58f1('0x19')]?_0x2e7bf3[_0x58f1('0x19')][_0x58f1('0x21')]||null:null})['then'](function(_0xacd4e9){logger[_0x58f1('0xf')](_0x58f1('0x1d'),_0x2e7bf3);logger[_0x58f1('0x12')](_0x58f1('0x1d'),_0x2e7bf3,JSON[_0x58f1('0x1c')](_0xacd4e9));_0x1485e2(_0xacd4e9);})[_0x58f1('0x16')](function(_0x119f37){logger[_0x58f1('0x14')](_0x58f1('0x1d'),_0x119f37[_0x58f1('0x15')],_0x2e7bf3);_0x145ba0(_0x2a5466['error'](0x1f4,_0x119f37[_0x58f1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 549eb77..0c4b587 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 _0xf2ca=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','delete'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2ec5b9,_0x56e0a3){_0x2ec5b9=_0x2ec5b9-0x0;var _0x10dcea=_0xf2ca[_0x2ec5b9];return _0x10dcea;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./smsTransferReport.controller');router[_0xaf2c('0x9')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0x9')]('/describe',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xc')]);router['get'](_0xaf2c('0xd'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['post']('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaf2c('0x11')](_0xaf2c('0xd'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x12')]);module[_0xaf2c('0x13')]=router; \ No newline at end of file +var _0x950a=['/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','index','describe'];(function(_0x66bcfe,_0x4abe28){var _0x48227a=function(_0x36e2dd){while(--_0x36e2dd){_0x66bcfe['push'](_0x66bcfe['shift']());}};_0x48227a(++_0x4abe28);}(_0x950a,0x111));var _0xa950=function(_0x320ce3,_0x1a50d4){_0x320ce3=_0x320ce3-0x0;var _0x3e6d02=_0x950a[_0x320ce3];return _0x3e6d02;};'use strict';var multer=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var path=require(_0xa950('0x2'));var timeout=require(_0xa950('0x3'));var express=require('express');var router=express[_0xa950('0x4')]();var fs_extra=require(_0xa950('0x5'));var auth=require(_0xa950('0x6'));var interaction=require(_0xa950('0x7'));var config=require('../../config/environment');var controller=require(_0xa950('0x8'));router[_0xa950('0x9')]('/',auth['isAuthenticated'](),controller[_0xa950('0xa')]);router[_0xa950('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa950('0xb')]);router[_0xa950('0x9')](_0xa950('0xc'),auth[_0xa950('0xd')](),controller[_0xa950('0xe')]);router[_0xa950('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa950('0xc'),auth['isAuthenticated'](),controller[_0xa950('0x10')]);router[_0xa950('0x11')](_0xa950('0xc'),auth['isAuthenticated'](),controller[_0xa950('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a325d53..c5034bc 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4d36e6,_0x42f416){var _0x309040=function(_0xc75d90){while(--_0xc75d90){_0x4d36e6['push'](_0x4d36e6['shift']());}};_0x309040(++_0x42f416);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x00bb[_0x47a7d0];return _0xb9bd08;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 235286d..45ac704 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 _0x8619=['util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x8619,0x13a));var _0x9861=function(_0x1a1b4a,_0x2be990){_0x1a1b4a=_0x1a1b4a-0x0;var _0x4bc942=_0x8619[_0x1a1b4a];return _0x4bc942;};'use strict';var emlformat=require(_0x9861('0x0'));var rimraf=require(_0x9861('0x1'));var zipdir=require(_0x9861('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9861('0x3'));var moment=require(_0x9861('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9861('0x5'));var util=require(_0x9861('0x6'));var path=require(_0x9861('0x7'));var sox=require(_0x9861('0x8'));var csv=require('to-csv');var ejs=require(_0x9861('0x9'));var fs=require('fs');var fs_extra=require(_0x9861('0xa'));var _=require(_0x9861('0xb'));var squel=require(_0x9861('0xc'));var crypto=require(_0x9861('0xd'));var jsforce=require(_0x9861('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9861('0xf'));var Papa=require(_0x9861('0x10'));var Redis=require(_0x9861('0x11'));var authService=require(_0x9861('0x12'));var qs=require(_0x9861('0x13'));var as=require(_0x9861('0x14'));var hardwareService=require(_0x9861('0x15'));var logger=require(_0x9861('0x16'))(_0x9861('0x17'));var utils=require(_0x9861('0x18'));var config=require(_0x9861('0x19'));var licenseUtil=require(_0x9861('0x1a'));var db=require(_0x9861('0x1b'))['db'];function respondWithStatusCode(_0x5411fe,_0xace510){_0xace510=_0xace510||0xcc;return function(_0x115bae){if(_0x115bae){return _0x5411fe['sendStatus'](_0xace510);}return _0x5411fe[_0x9861('0x1c')](_0xace510)[_0x9861('0x1d')]();};}function respondWithResult(_0x95dc45,_0x3b9b70){_0x3b9b70=_0x3b9b70||0xc8;return function(_0x4755c5){if(_0x4755c5){return _0x95dc45[_0x9861('0x1c')](_0x3b9b70)['json'](_0x4755c5);}};}function respondWithFilteredResult(_0x50385f,_0x3cb69a){return function(_0x2be388){if(_0x2be388){var _0x41a7be=typeof _0x3cb69a[_0x9861('0x1e')]===_0x9861('0x1f')&&typeof _0x3cb69a[_0x9861('0x20')]==='undefined';var _0x16ab2f=_0x2be388[_0x9861('0x21')];var _0x2531dd=_0x41a7be?0x0:_0x3cb69a[_0x9861('0x1e')];var _0x39694a=_0x41a7be?_0x2be388['count']:_0x3cb69a[_0x9861('0x1e')]+_0x3cb69a[_0x9861('0x20')];var _0x3a560f;if(_0x39694a>=_0x16ab2f){_0x39694a=_0x16ab2f;_0x3a560f=0xc8;}else{_0x3a560f=0xce;}_0x50385f[_0x9861('0x1c')](_0x3a560f);return _0x50385f['set'](_0x9861('0x22'),_0x2531dd+'-'+_0x39694a+'/'+_0x16ab2f)[_0x9861('0x23')](_0x2be388);}return null;};}function patchUpdates(_0x171502){return function(_0x538ef4){try{jsonpatch[_0x9861('0x24')](_0x538ef4,_0x171502,!![]);}catch(_0x3b1ba0){return BPromise['reject'](_0x3b1ba0);}return _0x538ef4[_0x9861('0x25')]();};}function saveUpdates(_0x3471c6,_0xdc64f5){return function(_0x53483f){if(_0x53483f){return _0x53483f[_0x9861('0x26')](_0x3471c6)['then'](function(_0x2fa16f){return _0x2fa16f;});}return null;};}function removeEntity(_0x4bbf50,_0x26a268){return function(_0x20ff27){if(_0x20ff27){return _0x20ff27['destroy']()[_0x9861('0x27')](function(){_0x4bbf50[_0x9861('0x1c')](0xcc)[_0x9861('0x1d')]();});}};}function handleEntityNotFound(_0x1701ed,_0x41351e){return function(_0x47eae0){if(!_0x47eae0){_0x1701ed[_0x9861('0x28')](0x194);}return _0x47eae0;};}function handleError(_0x111245,_0x39e690){_0x39e690=_0x39e690||0x1f4;return function(_0x7d2305){logger[_0x9861('0x29')](_0x7d2305[_0x9861('0x2a')]);if(_0x7d2305['name']){delete _0x7d2305[_0x9861('0x2b')];}_0x111245[_0x9861('0x1c')](_0x39e690)[_0x9861('0x2c')](_0x7d2305);};}exports[_0x9861('0x2d')]=function(_0x617a30,_0x3a0ce4){var _0x5dd734={},_0x6d77f2={},_0x5947c5={'count':0x0,'rows':[]};var _0x1272f9=_[_0x9861('0x2e')](db[_0x9861('0x2f')][_0x9861('0x30')],function(_0x3d96a7){return{'name':_0x3d96a7[_0x9861('0x31')],'type':_0x3d96a7[_0x9861('0x32')]['key']};});_0x6d77f2[_0x9861('0x33')]=_['map'](_0x1272f9,'name');_0x6d77f2[_0x9861('0x34')]=_[_0x9861('0x35')](_0x617a30[_0x9861('0x34')]);_0x6d77f2['filters']=_['intersection'](_0x6d77f2[_0x9861('0x33')],_0x6d77f2[_0x9861('0x34')]);_0x5dd734[_0x9861('0x36')]=_[_0x9861('0x37')](_0x6d77f2[_0x9861('0x33')],qs['fields'](_0x617a30[_0x9861('0x34')][_0x9861('0x38')]));_0x5dd734[_0x9861('0x36')]=_0x5dd734[_0x9861('0x36')]['length']?_0x5dd734[_0x9861('0x36')]:_0x6d77f2[_0x9861('0x33')];if(!_0x617a30[_0x9861('0x34')][_0x9861('0x39')](_0x9861('0x3a'))){_0x5dd734[_0x9861('0x20')]=qs['limit'](_0x617a30[_0x9861('0x34')][_0x9861('0x20')]);_0x5dd734['offset']=qs['offset'](_0x617a30[_0x9861('0x34')][_0x9861('0x1e')]);}_0x5dd734[_0x9861('0x3b')]=qs[_0x9861('0x3c')](_0x617a30[_0x9861('0x34')][_0x9861('0x3c')]);_0x5dd734[_0x9861('0x3d')]=qs[_0x9861('0x3e')](_[_0x9861('0x3f')](_0x617a30[_0x9861('0x34')],_0x6d77f2[_0x9861('0x3e')]),_0x1272f9);if(_0x617a30['query']['filter']){_0x5dd734['where']=_[_0x9861('0x40')](_0x5dd734[_0x9861('0x3d')],{'$or':_[_0x9861('0x2e')](_0x1272f9,function(_0x407080){if(_0x407080['type']!==_0x9861('0x41')){var _0x384ce6={};_0x384ce6[_0x407080[_0x9861('0x2b')]]={'$like':'%'+_0x617a30[_0x9861('0x34')]['filter']+'%'};return _0x384ce6;}})});}_0x5dd734=_[_0x9861('0x40')]({},_0x5dd734,_0x617a30['options']);var _0x1f41ca={'where':_0x5dd734[_0x9861('0x3d')]};return db[_0x9861('0x2f')][_0x9861('0x21')](_0x1f41ca)[_0x9861('0x27')](function(_0x34a8c5){_0x5947c5[_0x9861('0x21')]=_0x34a8c5;if(_0x617a30[_0x9861('0x34')][_0x9861('0x42')]){_0x5dd734[_0x9861('0x43')]=[{'all':!![]}];}return db[_0x9861('0x2f')][_0x9861('0x44')](_0x5dd734);})[_0x9861('0x27')](function(_0x39dfc7){_0x5947c5[_0x9861('0x45')]=_0x39dfc7;return _0x5947c5;})[_0x9861('0x27')](respondWithFilteredResult(_0x3a0ce4,_0x5dd734))[_0x9861('0x46')](handleError(_0x3a0ce4,null));};exports[_0x9861('0x47')]=function(_0x43797a,_0x89d2e1){var _0x4103dc={'raw':!![],'where':{'id':_0x43797a[_0x9861('0x48')]['id']}},_0x580fc7={};_0x580fc7[_0x9861('0x33')]=_[_0x9861('0x35')](db['SmsTransferReport'][_0x9861('0x30')]);_0x580fc7[_0x9861('0x34')]=_[_0x9861('0x35')](_0x43797a[_0x9861('0x34')]);_0x580fc7['filters']=_[_0x9861('0x37')](_0x580fc7[_0x9861('0x33')],_0x580fc7[_0x9861('0x34')]);_0x4103dc['attributes']=_['intersection'](_0x580fc7[_0x9861('0x33')],qs[_0x9861('0x38')](_0x43797a['query'][_0x9861('0x38')]));_0x4103dc[_0x9861('0x36')]=_0x4103dc[_0x9861('0x36')][_0x9861('0x49')]?_0x4103dc['attributes']:_0x580fc7['model'];if(_0x43797a[_0x9861('0x34')][_0x9861('0x42')]){_0x4103dc[_0x9861('0x43')]=[{'all':!![]}];}_0x4103dc=_[_0x9861('0x40')]({},_0x4103dc,_0x43797a[_0x9861('0x4a')]);return db['SmsTransferReport'][_0x9861('0x4b')](_0x4103dc)[_0x9861('0x27')](handleEntityNotFound(_0x89d2e1,null))[_0x9861('0x27')](respondWithResult(_0x89d2e1,null))['catch'](handleError(_0x89d2e1,null));};exports[_0x9861('0x4c')]=function(_0x4ab2c6,_0x997290){return db[_0x9861('0x2f')][_0x9861('0x4c')](_0x4ab2c6[_0x9861('0x4d')],{})['then'](respondWithResult(_0x997290,0xc9))['catch'](handleError(_0x997290,null));};exports[_0x9861('0x26')]=function(_0x5eadc5,_0x46a425){if(_0x5eadc5[_0x9861('0x4d')]['id']){delete _0x5eadc5['body']['id'];}return db[_0x9861('0x2f')]['find']({'where':{'id':_0x5eadc5[_0x9861('0x48')]['id']}})[_0x9861('0x27')](handleEntityNotFound(_0x46a425,null))['then'](saveUpdates(_0x5eadc5[_0x9861('0x4d')],null))['then'](respondWithResult(_0x46a425,null))[_0x9861('0x46')](handleError(_0x46a425,null));};exports[_0x9861('0x4e')]=function(_0x33ae0a,_0x5777d8){return db[_0x9861('0x2f')][_0x9861('0x4b')]({'where':{'id':_0x33ae0a[_0x9861('0x48')]['id']}})[_0x9861('0x27')](handleEntityNotFound(_0x5777d8,null))[_0x9861('0x27')](removeEntity(_0x5777d8,null))['catch'](handleError(_0x5777d8,null));};exports['describe']=function(_0x1392dc,_0x163276){return db[_0x9861('0x2f')][_0x9861('0x4f')]()[_0x9861('0x27')](respondWithResult(_0x163276,null))[_0x9861('0x46')](handleError(_0x163276,null));}; \ No newline at end of file +var _0xb3ce=['find','params','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','SmsTransferReport','includeAll','include','rows','catch','show','length','create','body'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb3ce,0x1cb));var _0xeb3c=function(_0x3450cb,_0x308b1c){_0x3450cb=_0x3450cb-0x0;var _0x5ee598=_0xb3ce[_0x3450cb];return _0x5ee598;};'use strict';var emlformat=require(_0xeb3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb3c('0x1'));var jsonpatch=require(_0xeb3c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb3c('0x3'));var Mustache=require(_0xeb3c('0x4'));var util=require('util');var path=require(_0xeb3c('0x5'));var sox=require(_0xeb3c('0x6'));var csv=require('to-csv');var ejs=require(_0xeb3c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb3c('0x8'));var squel=require(_0xeb3c('0x9'));var crypto=require(_0xeb3c('0xa'));var jsforce=require(_0xeb3c('0xb'));var deskjs=require(_0xeb3c('0xc'));var toCsv=require(_0xeb3c('0xd'));var querystring=require(_0xeb3c('0xe'));var Papa=require(_0xeb3c('0xf'));var Redis=require(_0xeb3c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeb3c('0x11'));var as=require(_0xeb3c('0x12'));var hardwareService=require(_0xeb3c('0x13'));var logger=require(_0xeb3c('0x14'))(_0xeb3c('0x15'));var utils=require('../../config/utils');var config=require(_0xeb3c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57b0d1,_0x17e0e8){_0x17e0e8=_0x17e0e8||0xcc;return function(_0x4b6209){if(_0x4b6209){return _0x57b0d1[_0xeb3c('0x17')](_0x17e0e8);}return _0x57b0d1[_0xeb3c('0x18')](_0x17e0e8)[_0xeb3c('0x19')]();};}function respondWithResult(_0x5c99cc,_0x1ca8f8){_0x1ca8f8=_0x1ca8f8||0xc8;return function(_0x3e18e8){if(_0x3e18e8){return _0x5c99cc[_0xeb3c('0x18')](_0x1ca8f8)[_0xeb3c('0x1a')](_0x3e18e8);}};}function respondWithFilteredResult(_0x2f91bb,_0x28a730){return function(_0xa749a9){if(_0xa749a9){var _0x3518ad=typeof _0x28a730['offset']===_0xeb3c('0x1b')&&typeof _0x28a730[_0xeb3c('0x1c')]==='undefined';var _0x38b2ea=_0xa749a9['count'];var _0x548233=_0x3518ad?0x0:_0x28a730['offset'];var _0x42320c=_0x3518ad?_0xa749a9[_0xeb3c('0x1d')]:_0x28a730[_0xeb3c('0x1e')]+_0x28a730[_0xeb3c('0x1c')];var _0x2097e7;if(_0x42320c>=_0x38b2ea){_0x42320c=_0x38b2ea;_0x2097e7=0xc8;}else{_0x2097e7=0xce;}_0x2f91bb[_0xeb3c('0x18')](_0x2097e7);return _0x2f91bb[_0xeb3c('0x1f')]('Content-Range',_0x548233+'-'+_0x42320c+'/'+_0x38b2ea)[_0xeb3c('0x1a')](_0xa749a9);}return null;};}function patchUpdates(_0x5017a2){return function(_0x4f9bbf){try{jsonpatch[_0xeb3c('0x20')](_0x4f9bbf,_0x5017a2,!![]);}catch(_0x88c9ad){return BPromise[_0xeb3c('0x21')](_0x88c9ad);}return _0x4f9bbf['save']();};}function saveUpdates(_0x5e278e,_0x8ce61c){return function(_0x51bfd9){if(_0x51bfd9){return _0x51bfd9[_0xeb3c('0x22')](_0x5e278e)['then'](function(_0x3271d3){return _0x3271d3;});}return null;};}function removeEntity(_0x67e9ff,_0x2a3b8d){return function(_0x4b0229){if(_0x4b0229){return _0x4b0229[_0xeb3c('0x23')]()[_0xeb3c('0x24')](function(){_0x67e9ff[_0xeb3c('0x18')](0xcc)[_0xeb3c('0x19')]();});}};}function handleEntityNotFound(_0x4be875,_0x2395a0){return function(_0x12c7ee){if(!_0x12c7ee){_0x4be875[_0xeb3c('0x17')](0x194);}return _0x12c7ee;};}function handleError(_0x57d4bd,_0x175e2d){_0x175e2d=_0x175e2d||0x1f4;return function(_0x14fdd5){logger[_0xeb3c('0x25')](_0x14fdd5[_0xeb3c('0x26')]);if(_0x14fdd5[_0xeb3c('0x27')]){delete _0x14fdd5['name'];}_0x57d4bd[_0xeb3c('0x18')](_0x175e2d)[_0xeb3c('0x28')](_0x14fdd5);};}exports[_0xeb3c('0x29')]=function(_0x9ee746,_0x15a49a){var _0x4d6f21={},_0x3bccd4={},_0x2dd042={'count':0x0,'rows':[]};var _0x44ad5f=_[_0xeb3c('0x2a')](db['SmsTransferReport'][_0xeb3c('0x2b')],function(_0x12943c){return{'name':_0x12943c[_0xeb3c('0x2c')],'type':_0x12943c[_0xeb3c('0x2d')][_0xeb3c('0x2e')]};});_0x3bccd4[_0xeb3c('0x2f')]=_[_0xeb3c('0x2a')](_0x44ad5f,'name');_0x3bccd4[_0xeb3c('0x30')]=_[_0xeb3c('0x31')](_0x9ee746[_0xeb3c('0x30')]);_0x3bccd4['filters']=_[_0xeb3c('0x32')](_0x3bccd4[_0xeb3c('0x2f')],_0x3bccd4['query']);_0x4d6f21['attributes']=_[_0xeb3c('0x32')](_0x3bccd4[_0xeb3c('0x2f')],qs[_0xeb3c('0x33')](_0x9ee746[_0xeb3c('0x30')][_0xeb3c('0x33')]));_0x4d6f21['attributes']=_0x4d6f21[_0xeb3c('0x34')]['length']?_0x4d6f21[_0xeb3c('0x34')]:_0x3bccd4['model'];if(!_0x9ee746[_0xeb3c('0x30')][_0xeb3c('0x35')](_0xeb3c('0x36'))){_0x4d6f21['limit']=qs[_0xeb3c('0x1c')](_0x9ee746['query']['limit']);_0x4d6f21[_0xeb3c('0x1e')]=qs['offset'](_0x9ee746[_0xeb3c('0x30')]['offset']);}_0x4d6f21[_0xeb3c('0x37')]=qs['sort'](_0x9ee746[_0xeb3c('0x30')][_0xeb3c('0x38')]);_0x4d6f21[_0xeb3c('0x39')]=qs['filters'](_[_0xeb3c('0x3a')](_0x9ee746[_0xeb3c('0x30')],_0x3bccd4[_0xeb3c('0x3b')]),_0x44ad5f);if(_0x9ee746[_0xeb3c('0x30')][_0xeb3c('0x3c')]){_0x4d6f21[_0xeb3c('0x39')]=_[_0xeb3c('0x3d')](_0x4d6f21[_0xeb3c('0x39')],{'$or':_[_0xeb3c('0x2a')](_0x44ad5f,function(_0x40632c){if(_0x40632c[_0xeb3c('0x2d')]!==_0xeb3c('0x3e')){var _0x332a9b={};_0x332a9b[_0x40632c[_0xeb3c('0x27')]]={'$like':'%'+_0x9ee746[_0xeb3c('0x30')]['filter']+'%'};return _0x332a9b;}})});}_0x4d6f21=_[_0xeb3c('0x3d')]({},_0x4d6f21,_0x9ee746[_0xeb3c('0x3f')]);var _0x449860={'where':_0x4d6f21[_0xeb3c('0x39')]};return db[_0xeb3c('0x40')]['count'](_0x449860)[_0xeb3c('0x24')](function(_0x4b0531){_0x2dd042['count']=_0x4b0531;if(_0x9ee746[_0xeb3c('0x30')][_0xeb3c('0x41')]){_0x4d6f21[_0xeb3c('0x42')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x4d6f21);})[_0xeb3c('0x24')](function(_0xc889e7){_0x2dd042[_0xeb3c('0x43')]=_0xc889e7;return _0x2dd042;})[_0xeb3c('0x24')](respondWithFilteredResult(_0x15a49a,_0x4d6f21))[_0xeb3c('0x44')](handleError(_0x15a49a,null));};exports[_0xeb3c('0x45')]=function(_0x16d6fb,_0x18fc4){var _0x1444eb={'raw':!![],'where':{'id':_0x16d6fb['params']['id']}},_0x4e12db={};_0x4e12db[_0xeb3c('0x2f')]=_[_0xeb3c('0x31')](db[_0xeb3c('0x40')]['rawAttributes']);_0x4e12db[_0xeb3c('0x30')]=_[_0xeb3c('0x31')](_0x16d6fb['query']);_0x4e12db[_0xeb3c('0x3b')]=_['intersection'](_0x4e12db[_0xeb3c('0x2f')],_0x4e12db['query']);_0x1444eb['attributes']=_[_0xeb3c('0x32')](_0x4e12db[_0xeb3c('0x2f')],qs[_0xeb3c('0x33')](_0x16d6fb[_0xeb3c('0x30')][_0xeb3c('0x33')]));_0x1444eb[_0xeb3c('0x34')]=_0x1444eb['attributes'][_0xeb3c('0x46')]?_0x1444eb[_0xeb3c('0x34')]:_0x4e12db[_0xeb3c('0x2f')];if(_0x16d6fb['query'][_0xeb3c('0x41')]){_0x1444eb['include']=[{'all':!![]}];}_0x1444eb=_[_0xeb3c('0x3d')]({},_0x1444eb,_0x16d6fb[_0xeb3c('0x3f')]);return db[_0xeb3c('0x40')]['find'](_0x1444eb)['then'](handleEntityNotFound(_0x18fc4,null))[_0xeb3c('0x24')](respondWithResult(_0x18fc4,null))['catch'](handleError(_0x18fc4,null));};exports[_0xeb3c('0x47')]=function(_0x29b3be,_0x3f5633){return db[_0xeb3c('0x40')][_0xeb3c('0x47')](_0x29b3be[_0xeb3c('0x48')],{})[_0xeb3c('0x24')](respondWithResult(_0x3f5633,0xc9))[_0xeb3c('0x44')](handleError(_0x3f5633,null));};exports[_0xeb3c('0x22')]=function(_0x148665,_0x161f5d){if(_0x148665[_0xeb3c('0x48')]['id']){delete _0x148665[_0xeb3c('0x48')]['id'];}return db['SmsTransferReport'][_0xeb3c('0x49')]({'where':{'id':_0x148665[_0xeb3c('0x4a')]['id']}})[_0xeb3c('0x24')](handleEntityNotFound(_0x161f5d,null))[_0xeb3c('0x24')](saveUpdates(_0x148665[_0xeb3c('0x48')],null))['then'](respondWithResult(_0x161f5d,null))[_0xeb3c('0x44')](handleError(_0x161f5d,null));};exports['destroy']=function(_0x29b34a,_0x189c47){return db[_0xeb3c('0x40')][_0xeb3c('0x49')]({'where':{'id':_0x29b34a[_0xeb3c('0x4a')]['id']}})[_0xeb3c('0x24')](handleEntityNotFound(_0x189c47,null))[_0xeb3c('0x24')](removeEntity(_0x189c47,null))['catch'](handleError(_0x189c47,null));};exports[_0xeb3c('0x4b')]=function(_0x5d2a24,_0x532273){return db[_0xeb3c('0x40')][_0xeb3c('0x4b')]()[_0xeb3c('0x24')](respondWithResult(_0x532273,null))[_0xeb3c('0x44')](handleError(_0x532273,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 22cf9c3..4b6b6dd 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 _0x10c4=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x4063da,_0x5b9eec){var _0x26b774=function(_0x5f4fb0){while(--_0x5f4fb0){_0x4063da['push'](_0x4063da['shift']());}};_0x26b774(++_0x5b9eec);}(_0x10c4,0x16b));var _0x410c=function(_0x32a59a,_0x2c4e71){_0x32a59a=_0x32a59a-0x0;var _0x202913=_0x10c4[_0x32a59a];return _0x202913;};'use strict';var _=require(_0x410c('0x0'));var util=require('util');var logger=require(_0x410c('0x1'))(_0x410c('0x2'));var moment=require(_0x410c('0x3'));var BPromise=require(_0x410c('0x4'));var rp=require(_0x410c('0x5'));var fs=require('fs');var path=require(_0x410c('0x6'));var rimraf=require('rimraf');var config=require(_0x410c('0x7'));var attributes=require(_0x410c('0x8'));module[_0x410c('0x9')]=function(_0xff4178,_0xa9bd5d){return _0xff4178[_0x410c('0xa')](_0x410c('0xb'),attributes,{'tableName':_0x410c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x410c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4262=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./smsTransferReport.attributes','exports','define'];(function(_0x27a8e1,_0xbfecea){var _0x2e4d37=function(_0x286cee){while(--_0x286cee){_0x27a8e1['push'](_0x27a8e1['shift']());}};_0x2e4d37(++_0xbfecea);}(_0x4262,0x15f));var _0x2426=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4262[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x2426('0x0'));var util=require(_0x2426('0x1'));var logger=require(_0x2426('0x2'))('api');var moment=require(_0x2426('0x3'));var BPromise=require('bluebird');var rp=require(_0x2426('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2426('0x5'));var attributes=require(_0x2426('0x6'));module[_0x2426('0x7')]=function(_0x127500,_0x4a6553){return _0x127500[_0x2426('0x8')](_0x2426('0x9'),attributes,{'tableName':_0x2426('0xa'),'paranoid':![],'indexes':[{'name':_0x2426('0xb'),'fields':[_0x2426('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 99eefd0..e7540c6 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 _0x581a=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message'];(function(_0x1a3d45,_0x32cebb){var _0x2ce713=function(_0x3feab0){while(--_0x3feab0){_0x1a3d45['push'](_0x1a3d45['shift']());}};_0x2ce713(++_0x32cebb);}(_0x581a,0x127));var _0xa581=function(_0xf0eb06,_0x244374){_0xf0eb06=_0xf0eb06-0x0;var _0x54c20c=_0x581a[_0xf0eb06];return _0x54c20c;};'use strict';var _=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var moment=require('moment');var BPromise=require(_0xa581('0x2'));var rs=require(_0xa581('0x3'));var fs=require('fs');var Redis=require(_0xa581('0x4'));var db=require(_0xa581('0x5'))['db'];var utils=require(_0xa581('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa581('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa581('0x8')][_0xa581('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17c679,_0x2e59cc,_0x35f6b9){return new BPromise(function(_0x1875a5,_0x465916){return client[_0xa581('0xa')](_0x17c679,_0x35f6b9)[_0xa581('0xb')](function(_0x32a44a){logger[_0xa581('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x2e59cc,_0xa581('0xd'));logger[_0xa581('0xe')](_0xa581('0xf'),_0x2e59cc,_0xa581('0xd'),JSON[_0xa581('0x10')](_0x32a44a));if(_0x32a44a[_0xa581('0x11')]){if(_0x32a44a[_0xa581('0x11')]['code']===0x1f4){logger[_0xa581('0x11')](_0xa581('0x12'),_0x2e59cc,_0x32a44a[_0xa581('0x11')][_0xa581('0x13')]);return _0x465916(_0x32a44a[_0xa581('0x11')]['message']);}logger[_0xa581('0x11')](_0xa581('0x12'),_0x2e59cc,_0x32a44a[_0xa581('0x11')][_0xa581('0x13')]);return _0x1875a5(_0x32a44a['error']['message']);}else{logger[_0xa581('0xc')](_0xa581('0x12'),_0x2e59cc,_0xa581('0xd'));_0x1875a5(_0x32a44a[_0xa581('0x14')][_0xa581('0x13')]);}})['catch'](function(_0x2aa492){logger[_0xa581('0x11')](_0xa581('0x12'),_0x2e59cc,_0x2aa492);_0x465916(_0x2aa492);});});} \ No newline at end of file +var _0x1e19=['rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x207bc7,_0x3ea48e){var _0xe5a3c0=function(_0x97f3b1){while(--_0x97f3b1){_0x207bc7['push'](_0x207bc7['shift']());}};_0xe5a3c0(++_0x3ea48e);}(_0x1e19,0x1c9));var _0x91e1=function(_0x343aa1,_0x443588){_0x343aa1=_0x343aa1-0x0;var _0x145484=_0x1e19[_0x343aa1];return _0x145484;};'use strict';var _=require(_0x91e1('0x0'));var util=require(_0x91e1('0x1'));var moment=require(_0x91e1('0x2'));var BPromise=require(_0x91e1('0x3'));var rs=require(_0x91e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x91e1('0x5'));var config=require(_0x91e1('0x6'));var jayson=require(_0x91e1('0x7'));var client=jayson[_0x91e1('0x8')][_0x91e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54c3ce,_0x24c076,_0x5b3df7){return new BPromise(function(_0x15f4c8,_0x3a9caa){return client[_0x91e1('0xa')](_0x54c3ce,_0x5b3df7)[_0x91e1('0xb')](function(_0x19abb2){logger['info'](_0x91e1('0xc'),_0x24c076,_0x91e1('0xd'));logger['debug'](_0x91e1('0xe'),_0x24c076,_0x91e1('0xd'),JSON[_0x91e1('0xf')](_0x19abb2));if(_0x19abb2[_0x91e1('0x10')]){if(_0x19abb2[_0x91e1('0x10')]['code']===0x1f4){logger['error'](_0x91e1('0xc'),_0x24c076,_0x19abb2[_0x91e1('0x10')][_0x91e1('0x11')]);return _0x3a9caa(_0x19abb2[_0x91e1('0x10')][_0x91e1('0x11')]);}logger[_0x91e1('0x10')](_0x91e1('0xc'),_0x24c076,_0x19abb2[_0x91e1('0x10')]['message']);return _0x15f4c8(_0x19abb2[_0x91e1('0x10')][_0x91e1('0x11')]);}else{logger[_0x91e1('0x12')](_0x91e1('0xc'),_0x24c076,_0x91e1('0xd'));_0x15f4c8(_0x19abb2[_0x91e1('0x13')]['message']);}})[_0x91e1('0x14')](function(_0x4fc580){logger[_0x91e1('0x10')](_0x91e1('0xc'),_0x24c076,_0x4fc580);_0x3a9caa(_0x4fc580);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 28e277e..9de3b09 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 _0x80ab=['/:id/download','diskStorage','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','single','put','/:id','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index'];(function(_0x3cac41,_0x4d40e2){var _0x47e10d=function(_0x453255){while(--_0x453255){_0x3cac41['push'](_0x3cac41['shift']());}};_0x47e10d(++_0x4d40e2);}(_0x80ab,0xb7));var _0xb80a=function(_0x5d4f5c,_0x205efd){_0x5d4f5c=_0x5d4f5c-0x0;var _0x5daf6e=_0x80ab[_0x5d4f5c];return _0x5daf6e;};'use strict';var multer=require(_0xb80a('0x0'));var util=require('util');var path=require(_0xb80a('0x1'));var timeout=require(_0xb80a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb80a('0x3'));var interaction=require(_0xb80a('0x4'));var config=require('../../config/environment');var controller=require(_0xb80a('0x5'));router[_0xb80a('0x6')]('/',auth[_0xb80a('0x7')](),controller[_0xb80a('0x8')]);router[_0xb80a('0x6')]('/:id',auth[_0xb80a('0x7')](),controller['show']);router[_0xb80a('0x6')](_0xb80a('0x9'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xb80a('0xa')]({'destination':function(_0x507283,_0x160bac,_0x506955){_0x506955(null,path['join'](config[_0xb80a('0xb')],_0xb80a('0xc')));},'filename':function(_0x5acc81,_0x42e2cf,_0x5e6493){_0x42e2cf[_0xb80a('0xd')]=_0x42e2cf['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e6493(null,util[_0xb80a('0xe')](_0xb80a('0xf'),path['basename'](_0x42e2cf[_0xb80a('0xd')],path[_0xb80a('0x10')](_0x42e2cf[_0xb80a('0xd')])),Date[_0xb80a('0x11')](),path[_0xb80a('0x10')](_0x42e2cf[_0xb80a('0xd')])));}})});router['post']('/',upload[_0xb80a('0x12')]('file'),controller['create']);router[_0xb80a('0x13')](_0xb80a('0x14'),auth[_0xb80a('0x7')](),controller[_0xb80a('0x15')]);router[_0xb80a('0x16')]('/:id',auth[_0xb80a('0x7')](),controller['delete']);module[_0xb80a('0x17')]=router; \ No newline at end of file +var _0x7c58=['get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller'];(function(_0x40fff1,_0x2d3344){var _0x34df23=function(_0x2e2875){while(--_0x2e2875){_0x40fff1['push'](_0x40fff1['shift']());}};_0x34df23(++_0x2d3344);}(_0x7c58,0x104));var _0x87c5=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x7c58[_0x40a825];return _0x273a54;};'use strict';var multer=require(_0x87c5('0x0'));var util=require(_0x87c5('0x1'));var path=require(_0x87c5('0x2'));var timeout=require(_0x87c5('0x3'));var express=require(_0x87c5('0x4'));var router=express[_0x87c5('0x5')]();var fs_extra=require(_0x87c5('0x6'));var auth=require(_0x87c5('0x7'));var interaction=require(_0x87c5('0x8'));var config=require('../../config/environment');var controller=require(_0x87c5('0x9'));router[_0x87c5('0xa')]('/',auth[_0x87c5('0xb')](),controller[_0x87c5('0xc')]);router[_0x87c5('0xa')](_0x87c5('0xd'),auth[_0x87c5('0xb')](),controller[_0x87c5('0xe')]);router[_0x87c5('0xa')](_0x87c5('0xf'),auth[_0x87c5('0xb')](),controller[_0x87c5('0x10')]);var upload=multer({'storage':multer[_0x87c5('0x11')]({'destination':function(_0x372e38,_0x3b3b14,_0x58f2a0){_0x58f2a0(null,path[_0x87c5('0x12')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x6bbd19,_0xa33859,_0xc1f862){_0xa33859[_0x87c5('0x13')]=_0xa33859['originalname'][_0x87c5('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc1f862(null,util[_0x87c5('0x15')](_0x87c5('0x16'),path[_0x87c5('0x17')](_0xa33859[_0x87c5('0x13')],path[_0x87c5('0x18')](_0xa33859[_0x87c5('0x13')])),Date['now'](),path['extname'](_0xa33859['originalname'])));}})});router[_0x87c5('0x19')]('/',upload[_0x87c5('0x1a')](_0x87c5('0x1b')),controller['create']);router['put']('/:id',auth[_0x87c5('0xb')](),controller['update']);router[_0x87c5('0x1c')](_0x87c5('0xd'),auth[_0x87c5('0xb')](),controller['delete']);module[_0x87c5('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 39a0041..7cdeaab 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 _0x139c=['INTEGER','STRING','BIGINT'];(function(_0x1a55d7,_0x3cd1ed){var _0x38785b=function(_0x46a012){while(--_0x46a012){_0x1a55d7['push'](_0x1a55d7['shift']());}};_0x38785b(++_0x3cd1ed);}(_0x139c,0xfa));var _0xc139=function(_0x56e23d,_0x55dcfc){_0x56e23d=_0x56e23d-0x0;var _0x35d2ce=_0x139c[_0x56e23d];return _0x35d2ce;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xc139('0x0')]},'display_name':{'type':Sequelize[_0xc139('0x0')],'defaultValue':''},'description':{'type':Sequelize[_0xc139('0x0')]},'original_format':{'type':Sequelize[_0xc139('0x0')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xc139('0x1')]},'original_channelCount':{'type':Sequelize[_0xc139('0x2')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xc139('0x2')]},'converted_format':{'type':Sequelize[_0xc139('0x0')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xc139('0x1')]},'converted_channelCount':{'type':Sequelize[_0xc139('0x2')]},'converted_bitRate':{'type':Sequelize[_0xc139('0x1')]},'converted_sampleRate':{'type':Sequelize[_0xc139('0x2')]}}; \ No newline at end of file +var _0x7a05=['exports','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x17262f,_0x3c7ef2){var _0x28d050=function(_0x211f88){while(--_0x211f88){_0x17262f['push'](_0x17262f['shift']());}};_0x28d050(++_0x3c7ef2);}(_0x7a05,0x19d));var _0x57a0=function(_0x34bf1d,_0x4f87f9){_0x34bf1d=_0x34bf1d-0x0;var _0x2a56a3=_0x7a05[_0x34bf1d];return _0x2a56a3;};'use strict';var Sequelize=require(_0x57a0('0x0'));module[_0x57a0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x57a0('0x2')]},'display_name':{'type':Sequelize[_0x57a0('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x57a0('0x2')]},'original_format':{'type':Sequelize[_0x57a0('0x2')]},'original_duration':{'type':Sequelize[_0x57a0('0x3')]},'original_sampleCount':{'type':Sequelize[_0x57a0('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x57a0('0x4')]},'original_sampleRate':{'type':Sequelize[_0x57a0('0x5')]},'converted_format':{'type':Sequelize[_0x57a0('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x57a0('0x4')]},'converted_channelCount':{'type':Sequelize[_0x57a0('0x5')]},'converted_bitRate':{'type':Sequelize[_0x57a0('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x57a0('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index d32be63..b477075 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 _0xb9f4=['extname','file','filename','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_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','start','send','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','map','Sound','fieldName','model','query','keys','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show','rawAttributes','intersection','length','include','find','catch','download','params','save_name','existsSync','join','server/files/sounds/converted','Sequelize','root','format','%s.%s','converted_format','create','basename','originalname'];(function(_0x5e2056,_0x538173){var _0x45ea82=function(_0x5c7ff2){while(--_0x5c7ff2){_0x5e2056['push'](_0x5e2056['shift']());}};_0x45ea82(++_0x538173);}(_0xb9f4,0x11b));var _0x4b9f=function(_0xc9fe84,_0x5b3fd9){_0xc9fe84=_0xc9fe84-0x0;var _0x1e1dbd=_0xb9f4[_0xc9fe84];return _0x1e1dbd;};'use strict';var emlformat=require(_0x4b9f('0x0'));var rimraf=require(_0x4b9f('0x1'));var zipdir=require(_0x4b9f('0x2'));var jsonpatch=require(_0x4b9f('0x3'));var rp=require(_0x4b9f('0x4'));var moment=require(_0x4b9f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4b9f('0x6'));var util=require(_0x4b9f('0x7'));var path=require(_0x4b9f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4b9f('0x9'));var fs=require('fs');var fs_extra=require(_0x4b9f('0xa'));var _=require(_0x4b9f('0xb'));var squel=require('squel');var crypto=require(_0x4b9f('0xc'));var jsforce=require(_0x4b9f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4b9f('0xe'));var querystring=require(_0x4b9f('0xf'));var Papa=require(_0x4b9f('0x10'));var Redis=require('ioredis');var authService=require(_0x4b9f('0x11'));var qs=require(_0x4b9f('0x12'));var as=require(_0x4b9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b9f('0x14'))(_0x4b9f('0x15'));var utils=require(_0x4b9f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b9f('0x17'))['db'];function respondWithStatusCode(_0x45cfd5,_0x44e790){_0x44e790=_0x44e790||0xcc;return function(_0x4f36b3){if(_0x4f36b3){return _0x45cfd5[_0x4b9f('0x18')](_0x44e790);}return _0x45cfd5[_0x4b9f('0x19')](_0x44e790)['end']();};}function respondWithResult(_0x1922be,_0x516c3b){_0x516c3b=_0x516c3b||0xc8;return function(_0x4a8fa2){if(_0x4a8fa2){return _0x1922be['status'](_0x516c3b)[_0x4b9f('0x1a')](_0x4a8fa2);}};}function respondWithFilteredResult(_0x949d3f,_0x5367cd){return function(_0x1f6d2f){if(_0x1f6d2f){var _0x1cb9ae=typeof _0x5367cd[_0x4b9f('0x1b')]===_0x4b9f('0x1c')&&typeof _0x5367cd[_0x4b9f('0x1d')]===_0x4b9f('0x1c');var _0x8861a9=_0x1f6d2f[_0x4b9f('0x1e')];var _0x5f27ef=_0x1cb9ae?0x0:_0x5367cd['offset'];var _0x213e7c=_0x1cb9ae?_0x1f6d2f[_0x4b9f('0x1e')]:_0x5367cd[_0x4b9f('0x1b')]+_0x5367cd[_0x4b9f('0x1d')];var _0xa31b48;if(_0x213e7c>=_0x8861a9){_0x213e7c=_0x8861a9;_0xa31b48=0xc8;}else{_0xa31b48=0xce;}_0x949d3f[_0x4b9f('0x19')](_0xa31b48);return _0x949d3f['set'](_0x4b9f('0x1f'),_0x5f27ef+'-'+_0x213e7c+'/'+_0x8861a9)['json'](_0x1f6d2f);}return null;};}function patchUpdates(_0x12d0d6){return function(_0x5a313e){try{jsonpatch[_0x4b9f('0x20')](_0x5a313e,_0x12d0d6,!![]);}catch(_0x2088cc){return BPromise[_0x4b9f('0x21')](_0x2088cc);}return _0x5a313e[_0x4b9f('0x22')]();};}function saveUpdates(_0x7f9c9a,_0x25127d){return function(_0x39ede3){if(_0x39ede3){return _0x39ede3['update'](_0x7f9c9a)[_0x4b9f('0x23')](function(_0xa3d92a){return _0xa3d92a;});}return null;};}function removeEntity(_0x1766bf,_0x81878f){return function(_0x20fb24){if(_0x20fb24){return _0x20fb24[_0x4b9f('0x24')]()[_0x4b9f('0x23')](function(){var _0x78c11d=_0x20fb24[_0x4b9f('0x25')]({'plain':!![]});var _0x5b7b62=_0x4b9f('0x26');return db[_0x4b9f('0x27')]['destroy']({'where':{'type':_0x5b7b62,'resourceId':_0x78c11d['id']}})[_0x4b9f('0x23')](function(){return _0x20fb24;});})[_0x4b9f('0x23')](function(){_0x1766bf[_0x4b9f('0x19')](0xcc)[_0x4b9f('0x28')]();});}};}function handleEntityNotFound(_0xcc3015,_0x305790){return function(_0x5026bb){if(!_0x5026bb){_0xcc3015[_0x4b9f('0x18')](0x194);}return _0x5026bb;};}function handleError(_0x24f8b5,_0x4be5a9){_0x4be5a9=_0x4be5a9||0x1f4;return function(_0x30098f){logger[_0x4b9f('0x29')](_0x30098f[_0x4b9f('0x2a')]);if(_0x30098f[_0x4b9f('0x2b')]){delete _0x30098f[_0x4b9f('0x2b')];}_0x24f8b5['status'](_0x4be5a9)['send'](_0x30098f);};}exports['index']=function(_0x33919e,_0x5eeb2d){var _0x1e1f49={},_0x192bf8={},_0x5b1bec={'count':0x0,'rows':[]};var _0x377a2b=_[_0x4b9f('0x2c')](db[_0x4b9f('0x2d')]['rawAttributes'],function(_0x1fa44d){return{'name':_0x1fa44d[_0x4b9f('0x2e')],'type':_0x1fa44d['type']['key']};});_0x192bf8[_0x4b9f('0x2f')]=_[_0x4b9f('0x2c')](_0x377a2b,_0x4b9f('0x2b'));_0x192bf8[_0x4b9f('0x30')]=_[_0x4b9f('0x31')](_0x33919e[_0x4b9f('0x30')]);_0x192bf8['filters']=_['intersection'](_0x192bf8['model'],_0x192bf8[_0x4b9f('0x30')]);_0x1e1f49[_0x4b9f('0x32')]=_['intersection'](_0x192bf8[_0x4b9f('0x2f')],qs['fields'](_0x33919e[_0x4b9f('0x30')][_0x4b9f('0x33')]));_0x1e1f49['attributes']=_0x1e1f49[_0x4b9f('0x32')]['length']?_0x1e1f49[_0x4b9f('0x32')]:_0x192bf8['model'];if(!_0x33919e['query'][_0x4b9f('0x34')](_0x4b9f('0x35'))){_0x1e1f49[_0x4b9f('0x1d')]=qs[_0x4b9f('0x1d')](_0x33919e[_0x4b9f('0x30')]['limit']);_0x1e1f49['offset']=qs[_0x4b9f('0x1b')](_0x33919e[_0x4b9f('0x30')][_0x4b9f('0x1b')]);}_0x1e1f49[_0x4b9f('0x36')]=qs['sort'](_0x33919e[_0x4b9f('0x30')]['sort']);_0x1e1f49[_0x4b9f('0x37')]=qs[_0x4b9f('0x38')](_[_0x4b9f('0x39')](_0x33919e[_0x4b9f('0x30')],_0x192bf8[_0x4b9f('0x38')]),_0x377a2b);if(_0x33919e['query'][_0x4b9f('0x3a')]){_0x1e1f49[_0x4b9f('0x37')]=_[_0x4b9f('0x3b')](_0x1e1f49[_0x4b9f('0x37')],{'$or':_[_0x4b9f('0x2c')](_0x377a2b,function(_0xd912d3){if(_0xd912d3[_0x4b9f('0x3c')]!==_0x4b9f('0x3d')){var _0x1df91a={};_0x1df91a[_0xd912d3[_0x4b9f('0x2b')]]={'$like':'%'+_0x33919e[_0x4b9f('0x30')][_0x4b9f('0x3a')]+'%'};return _0x1df91a;}})});}_0x1e1f49=_[_0x4b9f('0x3b')]({},_0x1e1f49,_0x33919e[_0x4b9f('0x3e')]);var _0x3dae88={'where':_0x1e1f49['where']};return db[_0x4b9f('0x2d')][_0x4b9f('0x1e')](_0x3dae88)[_0x4b9f('0x23')](function(_0x25d63e){_0x5b1bec[_0x4b9f('0x1e')]=_0x25d63e;if(_0x33919e['query'][_0x4b9f('0x3f')]){_0x1e1f49['include']=[{'all':!![]}];}return db[_0x4b9f('0x2d')]['findAll'](_0x1e1f49);})[_0x4b9f('0x23')](function(_0x19b128){_0x5b1bec[_0x4b9f('0x40')]=_0x19b128;return _0x5b1bec;})[_0x4b9f('0x23')](respondWithFilteredResult(_0x5eeb2d,_0x1e1f49))['catch'](handleError(_0x5eeb2d,null));};exports[_0x4b9f('0x41')]=function(_0x460f3b,_0x424ab9){var _0x23dfa7={'raw':!![],'where':{'id':_0x460f3b['params']['id']}},_0x46c942={};_0x46c942[_0x4b9f('0x2f')]=_[_0x4b9f('0x31')](db['Sound'][_0x4b9f('0x42')]);_0x46c942['query']=_['keys'](_0x460f3b[_0x4b9f('0x30')]);_0x46c942[_0x4b9f('0x38')]=_[_0x4b9f('0x43')](_0x46c942[_0x4b9f('0x2f')],_0x46c942['query']);_0x23dfa7[_0x4b9f('0x32')]=_[_0x4b9f('0x43')](_0x46c942['model'],qs[_0x4b9f('0x33')](_0x460f3b[_0x4b9f('0x30')][_0x4b9f('0x33')]));_0x23dfa7[_0x4b9f('0x32')]=_0x23dfa7['attributes'][_0x4b9f('0x44')]?_0x23dfa7[_0x4b9f('0x32')]:_0x46c942[_0x4b9f('0x2f')];if(_0x460f3b[_0x4b9f('0x30')][_0x4b9f('0x3f')]){_0x23dfa7[_0x4b9f('0x45')]=[{'all':!![]}];}_0x23dfa7=_[_0x4b9f('0x3b')]({},_0x23dfa7,_0x460f3b['options']);return db[_0x4b9f('0x2d')][_0x4b9f('0x46')](_0x23dfa7)[_0x4b9f('0x23')](handleEntityNotFound(_0x424ab9,null))[_0x4b9f('0x23')](respondWithResult(_0x424ab9,null))[_0x4b9f('0x47')](handleError(_0x424ab9,null));};exports[_0x4b9f('0x48')]=function(_0x5f0610,_0x35f5e1,_0x3b2c6a){return db['Sound'][_0x4b9f('0x46')]({'where':{'id':_0x5f0610[_0x4b9f('0x49')]['id']},'attributes':['name',_0x4b9f('0x4a'),'converted_format'],'raw':!![]})[_0x4b9f('0x23')](handleEntityNotFound(_0x35f5e1,null))['then'](function(_0x1c726b){if(_0x1c726b){if(!fs[_0x4b9f('0x4b')](path[_0x4b9f('0x4c')](config['root'],_0x4b9f('0x4d'),_0x1c726b[_0x4b9f('0x4a')]+'.'+_0x1c726b['converted_format']))){throw new db[(_0x4b9f('0x4e'))]['ValidationError']('Sound\x20not\x20found');}return _0x35f5e1['download'](path['join'](config[_0x4b9f('0x4f')],'server/files/sounds/converted',util[_0x4b9f('0x50')](_0x4b9f('0x51'),_0x1c726b[_0x4b9f('0x4a')],_0x1c726b[_0x4b9f('0x52')])),util['format']('%s.%s',_0x1c726b[_0x4b9f('0x2b')],_0x1c726b[_0x4b9f('0x52')]));}return null;})['catch'](handleError(_0x35f5e1,null));};exports[_0x4b9f('0x53')]=function(_0x57ba86,_0xc6f198,_0x372c4c){var _0x2eac80={'name':path[_0x4b9f('0x54')](_0x57ba86['file'][_0x4b9f('0x55')],path[_0x4b9f('0x56')](_0x57ba86['file'][_0x4b9f('0x55')])),'save_name':path[_0x4b9f('0x54')](_0x57ba86[_0x4b9f('0x57')][_0x4b9f('0x58')],path[_0x4b9f('0x56')](_0x57ba86[_0x4b9f('0x57')][_0x4b9f('0x58')])),'original_format':path['extname'](_0x57ba86[_0x4b9f('0x57')][_0x4b9f('0x55')])['substring'](0x1),'converted_format':_0x4b9f('0x59')};var _0x507650=path['join'](config['root'],_0x4b9f('0x5a'),_0x57ba86[_0x4b9f('0x57')]['filename']);var _0x519f4f=path[_0x4b9f('0x4c')](config[_0x4b9f('0x4f')],_0x4b9f('0x4d'),util['format'](_0x4b9f('0x51'),path['basename'](_0x57ba86[_0x4b9f('0x57')]['filename'],path[_0x4b9f('0x56')](_0x57ba86['file'][_0x4b9f('0x58')])),_0x2eac80['converted_format']));logger[_0x4b9f('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x507650);logger[_0x4b9f('0x5b')](_0x4b9f('0x5c'),_0x519f4f);try{fs[_0x4b9f('0x5d')](_0x507650,parseInt(_0x4b9f('0x5e'),0x8));var _0x57dae0=sox[_0x4b9f('0x5f')](_0x507650,_0x519f4f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x57dae0['on'](_0x4b9f('0x29'),function(_0x1fce3f){fs[_0x4b9f('0x60')](_0x507650);_0xc6f198[_0x4b9f('0x19')](0x1f4)['send'](_0x1fce3f);});_0x57dae0['on'](_0x4b9f('0x61'),function(_0x48cbd6){_0x2eac80[_0x4b9f('0x62')]=isNaN(_0x48cbd6[_0x4b9f('0x63')])?null:_0x48cbd6[_0x4b9f('0x63')]*0x3e8;_0x2eac80[_0x4b9f('0x64')]=isNaN(_0x48cbd6[_0x4b9f('0x65')])?null:_0x48cbd6['sampleCount'];_0x2eac80[_0x4b9f('0x66')]=isNaN(_0x48cbd6[_0x4b9f('0x67')])?null:_0x48cbd6[_0x4b9f('0x67')];_0x2eac80[_0x4b9f('0x68')]=isNaN(_0x48cbd6[_0x4b9f('0x69')])?null:_0x48cbd6[_0x4b9f('0x69')];_0x2eac80[_0x4b9f('0x6a')]=isNaN(_0x48cbd6[_0x4b9f('0x6b')])?null:_0x48cbd6['sampleRate'];});_0x57dae0['on'](_0x4b9f('0x6c'),function(_0x3b4511){_0x2eac80[_0x4b9f('0x6d')]=isNaN(_0x3b4511[_0x4b9f('0x63')])?null:_0x3b4511[_0x4b9f('0x63')]*0x3e8;_0x2eac80[_0x4b9f('0x6e')]=isNaN(_0x3b4511[_0x4b9f('0x65')])?null:_0x3b4511[_0x4b9f('0x65')];_0x2eac80[_0x4b9f('0x6f')]=isNaN(_0x3b4511[_0x4b9f('0x67')])?null:_0x3b4511[_0x4b9f('0x67')];_0x2eac80[_0x4b9f('0x70')]=isNaN(_0x3b4511[_0x4b9f('0x69')])?null:_0x3b4511[_0x4b9f('0x69')];_0x2eac80[_0x4b9f('0x71')]=isNaN(_0x3b4511[_0x4b9f('0x6b')])?null:_0x3b4511[_0x4b9f('0x6b')];});_0x57dae0['on']('end',function(){fs[_0x4b9f('0x5d')](_0x519f4f,parseInt(_0x4b9f('0x5e'),0x8));return db[_0x4b9f('0x2d')]['create'](_0x2eac80)['then'](function(_0x337f98){var _0x215f59={'role':_0x57ba86['body']['role'],'userProfileId':_0x57ba86[_0x4b9f('0x72')]['userProfileId']};if(!_0x215f59)throw new Error(_0x4b9f('0x73'));if(_0x215f59['role']==='user'){var _0xf0f75f=_0x337f98[_0x4b9f('0x25')]({'plain':!![]});return db[_0x4b9f('0x74')][_0x4b9f('0x46')]({'where':{'name':_0x4b9f('0x26'),'userProfileId':_0x215f59[_0x4b9f('0x75')]},'raw':!![]})[_0x4b9f('0x23')](function(_0x599f32){if(_0x599f32&&_0x599f32[_0x4b9f('0x76')]===0x0){return db[_0x4b9f('0x27')][_0x4b9f('0x53')]({'name':_0xf0f75f[_0x4b9f('0x2b')],'resourceId':_0xf0f75f['id'],'type':_0x599f32[_0x4b9f('0x2b')],'sectionId':_0x599f32['id']},{})['then'](function(){return _0x337f98;});}else{return _0x337f98;}})[_0x4b9f('0x47')](function(_0x52b733){logger[_0x4b9f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52b733);throw _0x52b733;});}return _0x337f98;})['then'](respondWithResult(_0xc6f198,null))['catch'](handleError(_0xc6f198,null));});_0x57dae0[_0x4b9f('0x77')]();}catch(_0x1a6add){_0xc6f198[_0x4b9f('0x19')](0x1f4)[_0x4b9f('0x78')](_0x1a6add);}};exports['update']=function(_0x585252,_0x3980d8,_0x17a4d5){return db[_0x4b9f('0x2d')]['find']({'where':{'id':_0x585252['params']['id']}})[_0x4b9f('0x23')](handleEntityNotFound(_0x3980d8,null))[_0x4b9f('0x23')](saveUpdates(_[_0x4b9f('0x39')](_0x585252[_0x4b9f('0x72')],[_0x4b9f('0x2b'),'description']),null))[_0x4b9f('0x23')](respondWithResult(_0x3980d8,null))[_0x4b9f('0x47')](handleError(_0x3980d8,null));};exports[_0x4b9f('0x79')]=function(_0x54ea19,_0x33bca9,_0x1a2d30){return db[_0x4b9f('0x2d')][_0x4b9f('0x46')]({'where':{'id':_0x54ea19[_0x4b9f('0x49')]['id']}})[_0x4b9f('0x23')](function(_0xfbf6c8){if(_0xfbf6c8){return _0xfbf6c8['destroy']();}})[_0x4b9f('0x23')](function(_0x26241b){var _0x255298=path[_0x4b9f('0x4c')](config['root'],'server/files/sounds/original',util['format'](_0x4b9f('0x51'),_0x26241b[_0x4b9f('0x4a')],_0x26241b[_0x4b9f('0x7a')]));var _0x1d3748=path['join'](config['root'],_0x4b9f('0x4d'),util['format'](_0x4b9f('0x51'),_0x26241b['save_name'],_0x26241b[_0x4b9f('0x52')]));fs[_0x4b9f('0x60')](_0x255298);fs[_0x4b9f('0x60')](_0x1d3748);return _0x26241b;})['then'](function(_0x5e32ae){if(_0x5e32ae){return _0x33bca9['status'](0xcc)[_0x4b9f('0x28')]();}})[_0x4b9f('0x23')](handleEntityNotFound(_0x33bca9,null))[_0x4b9f('0x47')](handleError(_0x33bca9,null));}; \ No newline at end of file +var _0x3f00=['find','download','save_name','converted_format','existsSync','join','server/files/sounds/converted','ValidationError','root','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','params','description','delete','original_format','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','length'];(function(_0x39e97f,_0x29f9f1){var _0x540485=function(_0x18f776){while(--_0x18f776){_0x39e97f['push'](_0x39e97f['shift']());}};_0x540485(++_0x29f9f1);}(_0x3f00,0xb2));var _0x03f0=function(_0x55a747,_0x50c122){_0x55a747=_0x55a747-0x0;var _0x2136b3=_0x3f00[_0x55a747];return _0x2136b3;};'use strict';var emlformat=require(_0x03f0('0x0'));var rimraf=require(_0x03f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03f0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x03f0('0x3'));var util=require(_0x03f0('0x4'));var path=require(_0x03f0('0x5'));var sox=require(_0x03f0('0x6'));var csv=require(_0x03f0('0x7'));var ejs=require(_0x03f0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03f0('0x9'));var squel=require('squel');var crypto=require(_0x03f0('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x03f0('0xb'));var Papa=require(_0x03f0('0xc'));var Redis=require(_0x03f0('0xd'));var authService=require(_0x03f0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x03f0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03f0('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x03f0('0x11'));var licenseUtil=require(_0x03f0('0x12'));var db=require(_0x03f0('0x13'))['db'];function respondWithStatusCode(_0x32ca56,_0xd63620){_0xd63620=_0xd63620||0xcc;return function(_0x2f47ad){if(_0x2f47ad){return _0x32ca56[_0x03f0('0x14')](_0xd63620);}return _0x32ca56[_0x03f0('0x15')](_0xd63620)[_0x03f0('0x16')]();};}function respondWithResult(_0x48425b,_0x42c2cf){_0x42c2cf=_0x42c2cf||0xc8;return function(_0x605932){if(_0x605932){return _0x48425b['status'](_0x42c2cf)[_0x03f0('0x17')](_0x605932);}};}function respondWithFilteredResult(_0x52df37,_0x229731){return function(_0x14a478){if(_0x14a478){var _0x49ba02=typeof _0x229731[_0x03f0('0x18')]===_0x03f0('0x19')&&typeof _0x229731[_0x03f0('0x1a')]===_0x03f0('0x19');var _0x1b47cd=_0x14a478['count'];var _0x2f83f8=_0x49ba02?0x0:_0x229731[_0x03f0('0x18')];var _0x435ee7=_0x49ba02?_0x14a478[_0x03f0('0x1b')]:_0x229731[_0x03f0('0x18')]+_0x229731[_0x03f0('0x1a')];var _0x840998;if(_0x435ee7>=_0x1b47cd){_0x435ee7=_0x1b47cd;_0x840998=0xc8;}else{_0x840998=0xce;}_0x52df37[_0x03f0('0x15')](_0x840998);return _0x52df37[_0x03f0('0x1c')](_0x03f0('0x1d'),_0x2f83f8+'-'+_0x435ee7+'/'+_0x1b47cd)[_0x03f0('0x17')](_0x14a478);}return null;};}function patchUpdates(_0x53ae3e){return function(_0x5895be){try{jsonpatch[_0x03f0('0x1e')](_0x5895be,_0x53ae3e,!![]);}catch(_0x3e52d4){return BPromise[_0x03f0('0x1f')](_0x3e52d4);}return _0x5895be[_0x03f0('0x20')]();};}function saveUpdates(_0x51e551,_0x34f21e){return function(_0x56487c){if(_0x56487c){return _0x56487c['update'](_0x51e551)[_0x03f0('0x21')](function(_0x36cae3){return _0x36cae3;});}return null;};}function removeEntity(_0x4953b5,_0x2453d9){return function(_0x58670e){if(_0x58670e){return _0x58670e[_0x03f0('0x22')]()[_0x03f0('0x21')](function(){var _0xe8c385=_0x58670e[_0x03f0('0x23')]({'plain':!![]});var _0x12738b='Sounds';return db[_0x03f0('0x24')]['destroy']({'where':{'type':_0x12738b,'resourceId':_0xe8c385['id']}})[_0x03f0('0x21')](function(){return _0x58670e;});})[_0x03f0('0x21')](function(){_0x4953b5[_0x03f0('0x15')](0xcc)[_0x03f0('0x16')]();});}};}function handleEntityNotFound(_0x459e1f,_0xc2e91c){return function(_0x313bef){if(!_0x313bef){_0x459e1f[_0x03f0('0x14')](0x194);}return _0x313bef;};}function handleError(_0x36bef7,_0x30fca0){_0x30fca0=_0x30fca0||0x1f4;return function(_0x5705a7){logger[_0x03f0('0x25')](_0x5705a7[_0x03f0('0x26')]);if(_0x5705a7[_0x03f0('0x27')]){delete _0x5705a7['name'];}_0x36bef7[_0x03f0('0x15')](_0x30fca0)[_0x03f0('0x28')](_0x5705a7);};}exports[_0x03f0('0x29')]=function(_0x462961,_0x283962){var _0x2d7ec3={},_0x34b766={},_0x231165={'count':0x0,'rows':[]};var _0x20102b=_[_0x03f0('0x2a')](db[_0x03f0('0x2b')][_0x03f0('0x2c')],function(_0x11db42){return{'name':_0x11db42[_0x03f0('0x2d')],'type':_0x11db42[_0x03f0('0x2e')]['key']};});_0x34b766[_0x03f0('0x2f')]=_['map'](_0x20102b,_0x03f0('0x27'));_0x34b766[_0x03f0('0x30')]=_[_0x03f0('0x31')](_0x462961['query']);_0x34b766['filters']=_[_0x03f0('0x32')](_0x34b766['model'],_0x34b766[_0x03f0('0x30')]);_0x2d7ec3['attributes']=_[_0x03f0('0x32')](_0x34b766[_0x03f0('0x2f')],qs[_0x03f0('0x33')](_0x462961[_0x03f0('0x30')][_0x03f0('0x33')]));_0x2d7ec3[_0x03f0('0x34')]=_0x2d7ec3[_0x03f0('0x34')]['length']?_0x2d7ec3[_0x03f0('0x34')]:_0x34b766['model'];if(!_0x462961[_0x03f0('0x30')][_0x03f0('0x35')]('nolimit')){_0x2d7ec3[_0x03f0('0x1a')]=qs[_0x03f0('0x1a')](_0x462961['query']['limit']);_0x2d7ec3[_0x03f0('0x18')]=qs[_0x03f0('0x18')](_0x462961['query'][_0x03f0('0x18')]);}_0x2d7ec3['order']=qs[_0x03f0('0x36')](_0x462961[_0x03f0('0x30')][_0x03f0('0x36')]);_0x2d7ec3[_0x03f0('0x37')]=qs[_0x03f0('0x38')](_[_0x03f0('0x39')](_0x462961[_0x03f0('0x30')],_0x34b766[_0x03f0('0x38')]),_0x20102b);if(_0x462961['query']['filter']){_0x2d7ec3[_0x03f0('0x37')]=_[_0x03f0('0x3a')](_0x2d7ec3[_0x03f0('0x37')],{'$or':_[_0x03f0('0x2a')](_0x20102b,function(_0x2ae931){if(_0x2ae931[_0x03f0('0x2e')]!==_0x03f0('0x3b')){var _0x3549a3={};_0x3549a3[_0x2ae931[_0x03f0('0x27')]]={'$like':'%'+_0x462961[_0x03f0('0x30')][_0x03f0('0x3c')]+'%'};return _0x3549a3;}})});}_0x2d7ec3=_[_0x03f0('0x3a')]({},_0x2d7ec3,_0x462961[_0x03f0('0x3d')]);var _0x3e19b2={'where':_0x2d7ec3[_0x03f0('0x37')]};return db[_0x03f0('0x2b')]['count'](_0x3e19b2)[_0x03f0('0x21')](function(_0x1eb170){_0x231165[_0x03f0('0x1b')]=_0x1eb170;if(_0x462961[_0x03f0('0x30')][_0x03f0('0x3e')]){_0x2d7ec3[_0x03f0('0x3f')]=[{'all':!![]}];}return db[_0x03f0('0x2b')][_0x03f0('0x40')](_0x2d7ec3);})[_0x03f0('0x21')](function(_0x5d9d4d){_0x231165['rows']=_0x5d9d4d;return _0x231165;})[_0x03f0('0x21')](respondWithFilteredResult(_0x283962,_0x2d7ec3))[_0x03f0('0x41')](handleError(_0x283962,null));};exports[_0x03f0('0x42')]=function(_0x5c7797,_0x162bdc){var _0x2fbf7e={'raw':!![],'where':{'id':_0x5c7797['params']['id']}},_0x593f92={};_0x593f92['model']=_[_0x03f0('0x31')](db[_0x03f0('0x2b')][_0x03f0('0x2c')]);_0x593f92[_0x03f0('0x30')]=_[_0x03f0('0x31')](_0x5c7797[_0x03f0('0x30')]);_0x593f92['filters']=_[_0x03f0('0x32')](_0x593f92['model'],_0x593f92[_0x03f0('0x30')]);_0x2fbf7e['attributes']=_[_0x03f0('0x32')](_0x593f92[_0x03f0('0x2f')],qs['fields'](_0x5c7797[_0x03f0('0x30')][_0x03f0('0x33')]));_0x2fbf7e['attributes']=_0x2fbf7e[_0x03f0('0x34')][_0x03f0('0x43')]?_0x2fbf7e['attributes']:_0x593f92[_0x03f0('0x2f')];if(_0x5c7797[_0x03f0('0x30')]['includeAll']){_0x2fbf7e['include']=[{'all':!![]}];}_0x2fbf7e=_[_0x03f0('0x3a')]({},_0x2fbf7e,_0x5c7797['options']);return db[_0x03f0('0x2b')][_0x03f0('0x44')](_0x2fbf7e)[_0x03f0('0x21')](handleEntityNotFound(_0x162bdc,null))[_0x03f0('0x21')](respondWithResult(_0x162bdc,null))[_0x03f0('0x41')](handleError(_0x162bdc,null));};exports[_0x03f0('0x45')]=function(_0x49a904,_0x576889,_0x3869c8){return db[_0x03f0('0x2b')][_0x03f0('0x44')]({'where':{'id':_0x49a904['params']['id']},'attributes':[_0x03f0('0x27'),_0x03f0('0x46'),_0x03f0('0x47')],'raw':!![]})[_0x03f0('0x21')](handleEntityNotFound(_0x576889,null))[_0x03f0('0x21')](function(_0x5e6af5){if(_0x5e6af5){if(!fs[_0x03f0('0x48')](path[_0x03f0('0x49')](config['root'],_0x03f0('0x4a'),_0x5e6af5[_0x03f0('0x46')]+'.'+_0x5e6af5[_0x03f0('0x47')]))){throw new db['Sequelize'][(_0x03f0('0x4b'))]('Sound\x20not\x20found');}return _0x576889['download'](path['join'](config[_0x03f0('0x4c')],_0x03f0('0x4a'),util[_0x03f0('0x4d')](_0x03f0('0x4e'),_0x5e6af5[_0x03f0('0x46')],_0x5e6af5[_0x03f0('0x47')])),util['format']('%s.%s',_0x5e6af5[_0x03f0('0x27')],_0x5e6af5['converted_format']));}return null;})[_0x03f0('0x41')](handleError(_0x576889,null));};exports[_0x03f0('0x4f')]=function(_0x39fa34,_0x3cd0b7,_0x3f11d8){var _0x137969={'name':path[_0x03f0('0x50')](_0x39fa34[_0x03f0('0x51')][_0x03f0('0x52')],path[_0x03f0('0x53')](_0x39fa34[_0x03f0('0x51')][_0x03f0('0x52')])),'save_name':path['basename'](_0x39fa34['file'][_0x03f0('0x54')],path['extname'](_0x39fa34[_0x03f0('0x51')][_0x03f0('0x54')])),'original_format':path[_0x03f0('0x53')](_0x39fa34['file'][_0x03f0('0x52')])[_0x03f0('0x55')](0x1),'converted_format':_0x03f0('0x56')};var _0x5242b3=path[_0x03f0('0x49')](config[_0x03f0('0x4c')],_0x03f0('0x57'),_0x39fa34['file'][_0x03f0('0x54')]);var _0x5580f2=path[_0x03f0('0x49')](config[_0x03f0('0x4c')],_0x03f0('0x4a'),util[_0x03f0('0x4d')](_0x03f0('0x4e'),path['basename'](_0x39fa34[_0x03f0('0x51')][_0x03f0('0x54')],path[_0x03f0('0x53')](_0x39fa34[_0x03f0('0x51')][_0x03f0('0x54')])),_0x137969[_0x03f0('0x47')]));logger[_0x03f0('0x58')](_0x03f0('0x59'),_0x5242b3);logger['info'](_0x03f0('0x5a'),_0x5580f2);try{fs[_0x03f0('0x5b')](_0x5242b3,parseInt(_0x03f0('0x5c'),0x8));var _0x4555b6=sox[_0x03f0('0x5d')](_0x5242b3,_0x5580f2,{'sampleRate':0x1f40,'format':_0x03f0('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4555b6['on']('error',function(_0x29a8ff){fs[_0x03f0('0x5e')](_0x5242b3);_0x3cd0b7['status'](0x1f4)['send'](_0x29a8ff);});_0x4555b6['on'](_0x03f0('0x5f'),function(_0x4089e1){_0x137969[_0x03f0('0x60')]=isNaN(_0x4089e1[_0x03f0('0x61')])?null:_0x4089e1['duration']*0x3e8;_0x137969[_0x03f0('0x62')]=isNaN(_0x4089e1['sampleCount'])?null:_0x4089e1[_0x03f0('0x63')];_0x137969['original_channelCount']=isNaN(_0x4089e1['channelCount'])?null:_0x4089e1[_0x03f0('0x64')];_0x137969[_0x03f0('0x65')]=isNaN(_0x4089e1[_0x03f0('0x66')])?null:_0x4089e1[_0x03f0('0x66')];_0x137969[_0x03f0('0x67')]=isNaN(_0x4089e1[_0x03f0('0x68')])?null:_0x4089e1[_0x03f0('0x68')];});_0x4555b6['on']('dest',function(_0x4047c8){_0x137969[_0x03f0('0x69')]=isNaN(_0x4047c8[_0x03f0('0x61')])?null:_0x4047c8[_0x03f0('0x61')]*0x3e8;_0x137969[_0x03f0('0x6a')]=isNaN(_0x4047c8['sampleCount'])?null:_0x4047c8[_0x03f0('0x63')];_0x137969[_0x03f0('0x6b')]=isNaN(_0x4047c8[_0x03f0('0x64')])?null:_0x4047c8['channelCount'];_0x137969['converted_bitRate']=isNaN(_0x4047c8[_0x03f0('0x66')])?null:_0x4047c8['bitRate'];_0x137969[_0x03f0('0x6c')]=isNaN(_0x4047c8['sampleRate'])?null:_0x4047c8[_0x03f0('0x68')];});_0x4555b6['on'](_0x03f0('0x16'),function(){fs[_0x03f0('0x5b')](_0x5580f2,parseInt('0777',0x8));return db[_0x03f0('0x2b')]['create'](_0x137969)[_0x03f0('0x21')](function(_0xb7fa33){var _0x321c35={'role':_0x39fa34['body']['role'],'userProfileId':_0x39fa34[_0x03f0('0x6d')][_0x03f0('0x6e')]};if(!_0x321c35)throw new Error(_0x03f0('0x6f'));if(_0x321c35[_0x03f0('0x70')]==='user'){var _0x538cf0=_0xb7fa33[_0x03f0('0x23')]({'plain':!![]});return db[_0x03f0('0x71')]['find']({'where':{'name':_0x03f0('0x72'),'userProfileId':_0x321c35[_0x03f0('0x6e')]},'raw':!![]})[_0x03f0('0x21')](function(_0x384ffd){if(_0x384ffd&&_0x384ffd[_0x03f0('0x73')]===0x0){return db[_0x03f0('0x24')]['create']({'name':_0x538cf0[_0x03f0('0x27')],'resourceId':_0x538cf0['id'],'type':_0x384ffd[_0x03f0('0x27')],'sectionId':_0x384ffd['id']},{})[_0x03f0('0x21')](function(){return _0xb7fa33;});}else{return _0xb7fa33;}})[_0x03f0('0x41')](function(_0x2ca49f){logger['error'](_0x03f0('0x74'),_0x2ca49f);throw _0x2ca49f;});}return _0xb7fa33;})[_0x03f0('0x21')](respondWithResult(_0x3cd0b7,null))[_0x03f0('0x41')](handleError(_0x3cd0b7,null));});_0x4555b6[_0x03f0('0x75')]();}catch(_0x823d7d){_0x3cd0b7['status'](0x1f4)[_0x03f0('0x28')](_0x823d7d);}};exports[_0x03f0('0x76')]=function(_0x16f77b,_0x146407,_0x53756a){return db[_0x03f0('0x2b')][_0x03f0('0x44')]({'where':{'id':_0x16f77b[_0x03f0('0x77')]['id']}})[_0x03f0('0x21')](handleEntityNotFound(_0x146407,null))[_0x03f0('0x21')](saveUpdates(_['pick'](_0x16f77b[_0x03f0('0x6d')],[_0x03f0('0x27'),_0x03f0('0x78')]),null))[_0x03f0('0x21')](respondWithResult(_0x146407,null))[_0x03f0('0x41')](handleError(_0x146407,null));};exports[_0x03f0('0x79')]=function(_0x2bed69,_0x318c9e,_0x38c297){return db[_0x03f0('0x2b')][_0x03f0('0x44')]({'where':{'id':_0x2bed69[_0x03f0('0x77')]['id']}})[_0x03f0('0x21')](function(_0x5d8128){if(_0x5d8128){return _0x5d8128[_0x03f0('0x22')]();}})['then'](function(_0x13609b){var _0x1d0a2c=path[_0x03f0('0x49')](config[_0x03f0('0x4c')],'server/files/sounds/original',util[_0x03f0('0x4d')](_0x03f0('0x4e'),_0x13609b[_0x03f0('0x46')],_0x13609b[_0x03f0('0x7a')]));var _0x4d7d5b=path[_0x03f0('0x49')](config[_0x03f0('0x4c')],_0x03f0('0x4a'),util['format']('%s.%s',_0x13609b['save_name'],_0x13609b['converted_format']));fs['unlinkSync'](_0x1d0a2c);fs[_0x03f0('0x5e')](_0x4d7d5b);return _0x13609b;})['then'](function(_0x48dd6d){if(_0x48dd6d){return _0x318c9e['status'](0xcc)['end']();}})[_0x03f0('0x21')](handleEntityNotFound(_0x318c9e,null))[_0x03f0('0x41')](handleError(_0x318c9e,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a410839..f834995 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 _0xa649=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds'];(function(_0x3b47aa,_0x2a3bd3){var _0x2687ca=function(_0x5071c7){while(--_0x5071c7){_0x3b47aa['push'](_0x3b47aa['shift']());}};_0x2687ca(++_0x2a3bd3);}(_0xa649,0x1e1));var _0x9a64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa649[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x9a64('0x0'));var util=require(_0x9a64('0x1'));var logger=require('../../config/logger')(_0x9a64('0x2'));var moment=require(_0x9a64('0x3'));var BPromise=require(_0x9a64('0x4'));var rp=require(_0x9a64('0x5'));var fs=require('fs');var path=require(_0x9a64('0x6'));var rimraf=require(_0x9a64('0x7'));var config=require(_0x9a64('0x8'));var attributes=require(_0x9a64('0x9'));module['exports']=function(_0x477530,_0x5cf180){return _0x477530[_0x9a64('0xa')](_0x9a64('0xb'),attributes,{'tableName':_0x9a64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b91=['define','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x4b91,0xab));var _0x14b9=function(_0x519b55,_0x1597a7){_0x519b55=_0x519b55-0x0;var _0x5baf3d=_0x4b91[_0x519b55];return _0x5baf3d;};'use strict';var _=require(_0x14b9('0x0'));var util=require(_0x14b9('0x1'));var logger=require(_0x14b9('0x2'))(_0x14b9('0x3'));var moment=require('moment');var BPromise=require(_0x14b9('0x4'));var rp=require(_0x14b9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14b9('0x6'));var config=require(_0x14b9('0x7'));var attributes=require('./sound.attributes');module[_0x14b9('0x8')]=function(_0x33f7f5,_0x22cf3e){return _0x33f7f5[_0x14b9('0x9')](_0x14b9('0xa'),attributes,{'tableName':_0x14b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 78bb41c..2445874 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 _0x14dd=['lodash','moment','bluebird','randomstring','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSound','Sound','find','options','raw','map','include','model','attributes'];(function(_0x99f96d,_0x3fb5c5){var _0x2721a3=function(_0x2d25a7){while(--_0x2d25a7){_0x99f96d['push'](_0x99f96d['shift']());}};_0x2721a3(++_0x3fb5c5);}(_0x14dd,0x1b0));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd14d('0x0'));var util=require('util');var moment=require(_0xd14d('0x1'));var BPromise=require(_0xd14d('0x2'));var rs=require(_0xd14d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd14d('0x4')][_0xd14d('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1b7ea2,_0x247274,_0x44bc25){return new BPromise(function(_0x46e1ac,_0xf368c3){return client[_0xd14d('0x6')](_0x1b7ea2,_0x44bc25)[_0xd14d('0x7')](function(_0x3bf0f0){logger['info'](_0xd14d('0x8'),_0x247274,_0xd14d('0x9'));logger[_0xd14d('0xa')](_0xd14d('0xb'),_0x247274,_0xd14d('0x9'),JSON[_0xd14d('0xc')](_0x3bf0f0));if(_0x3bf0f0[_0xd14d('0xd')]){if(_0x3bf0f0['error'][_0xd14d('0xe')]===0x1f4){logger[_0xd14d('0xd')](_0xd14d('0x8'),_0x247274,_0x3bf0f0[_0xd14d('0xd')]['message']);return _0xf368c3(_0x3bf0f0['error'][_0xd14d('0xf')]);}logger[_0xd14d('0xd')](_0xd14d('0x8'),_0x247274,_0x3bf0f0[_0xd14d('0xd')][_0xd14d('0xf')]);return _0x46e1ac(_0x3bf0f0[_0xd14d('0xd')][_0xd14d('0xf')]);}else{logger[_0xd14d('0x10')](_0xd14d('0x8'),_0x247274,_0xd14d('0x9'));_0x46e1ac(_0x3bf0f0['result']['message']);}})[_0xd14d('0x11')](function(_0x9214e9){logger['error'](_0xd14d('0x8'),_0x247274,_0x9214e9);_0xf368c3(_0x9214e9);});});}exports[_0xd14d('0x12')]=function(_0x5be232){var _0x5cfd22=this;return new Promise(function(_0xc2fdfb,_0x14685c){return db[_0xd14d('0x13')][_0xd14d('0x14')]({'raw':_0x5be232['options']?_0x5be232[_0xd14d('0x15')][_0xd14d('0x16')]===undefined?!![]:![]:!![],'where':_0x5be232['options']?_0x5be232[_0xd14d('0x15')]['where']||null:null,'attributes':_0x5be232[_0xd14d('0x15')]?_0x5be232[_0xd14d('0x15')]['attributes']||null:null,'include':_0x5be232[_0xd14d('0x15')]?_0x5be232[_0xd14d('0x15')]['include']?_[_0xd14d('0x17')](_0x5be232[_0xd14d('0x15')][_0xd14d('0x18')],function(_0x574dc1){return{'model':db[_0x574dc1[_0xd14d('0x19')]],'as':_0x574dc1['as'],'attributes':_0x574dc1[_0xd14d('0x1a')],'include':_0x574dc1[_0xd14d('0x18')]?_[_0xd14d('0x17')](_0x574dc1[_0xd14d('0x18')],function(_0x27dc0e){return{'model':db[_0x27dc0e['model']],'as':_0x27dc0e['as'],'attributes':_0x27dc0e[_0xd14d('0x1a')],'include':_0x27dc0e[_0xd14d('0x18')]?_[_0xd14d('0x17')](_0x27dc0e[_0xd14d('0x18')],function(_0x1422e0){return{'model':db[_0x1422e0[_0xd14d('0x19')]],'as':_0x1422e0['as'],'attributes':_0x1422e0[_0xd14d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd14d('0x7')](function(_0x4740e9){logger[_0xd14d('0x10')]('ShowSound',_0x5be232);logger[_0xd14d('0xa')](_0xd14d('0x12'),_0x5be232,JSON[_0xd14d('0xc')](_0x4740e9));_0xc2fdfb(_0x4740e9);})[_0xd14d('0x11')](function(_0x209c98){logger[_0xd14d('0xd')](_0xd14d('0x12'),_0x209c98[_0xd14d('0xf')],_0x5be232);_0x14685c(_0x5cfd22[_0xd14d('0xd')](0x1f4,_0x209c98[_0xd14d('0xf')]));});});}; \ No newline at end of file +var _0xd46b=['rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','Sound,\x20%s,\x20%s','message','info','result','catch','ShowSound','Sound','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0xd46b,0xd2));var _0xbd46=function(_0x52b37a,_0x100dee){_0x52b37a=_0x52b37a-0x0;var _0x2c1790=_0xd46b[_0x52b37a];return _0x2c1790;};'use strict';var _=require(_0xbd46('0x0'));var util=require(_0xbd46('0x1'));var moment=require(_0xbd46('0x2'));var BPromise=require(_0xbd46('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd46('0x5'));var logger=require(_0xbd46('0x6'))(_0xbd46('0x7'));var config=require(_0xbd46('0x8'));var jayson=require(_0xbd46('0x9'));var client=jayson[_0xbd46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbfcbf9,_0x41e90c,_0x518eae){return new BPromise(function(_0x4fb366,_0x555b96){return client[_0xbd46('0xb')](_0xbfcbf9,_0x518eae)[_0xbd46('0xc')](function(_0x3d9987){logger['info']('Sound,\x20%s,\x20%s',_0x41e90c,_0xbd46('0xd'));logger[_0xbd46('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x41e90c,_0xbd46('0xd'),JSON[_0xbd46('0xf')](_0x3d9987));if(_0x3d9987[_0xbd46('0x10')]){if(_0x3d9987[_0xbd46('0x10')]['code']===0x1f4){logger[_0xbd46('0x10')](_0xbd46('0x11'),_0x41e90c,_0x3d9987['error'][_0xbd46('0x12')]);return _0x555b96(_0x3d9987[_0xbd46('0x10')][_0xbd46('0x12')]);}logger['error']('Sound,\x20%s,\x20%s',_0x41e90c,_0x3d9987[_0xbd46('0x10')]['message']);return _0x4fb366(_0x3d9987[_0xbd46('0x10')][_0xbd46('0x12')]);}else{logger[_0xbd46('0x13')](_0xbd46('0x11'),_0x41e90c,_0xbd46('0xd'));_0x4fb366(_0x3d9987[_0xbd46('0x14')][_0xbd46('0x12')]);}})[_0xbd46('0x15')](function(_0x163c76){logger[_0xbd46('0x10')](_0xbd46('0x11'),_0x41e90c,_0x163c76);_0x555b96(_0x163c76);});});}exports[_0xbd46('0x16')]=function(_0xa4228e){var _0xc6c522=this;return new Promise(function(_0x38ee56,_0x245f1c){return db[_0xbd46('0x17')][_0xbd46('0x18')]({'raw':_0xa4228e['options']?_0xa4228e[_0xbd46('0x19')][_0xbd46('0x1a')]===undefined?!![]:![]:!![],'where':_0xa4228e['options']?_0xa4228e[_0xbd46('0x19')]['where']||null:null,'attributes':_0xa4228e['options']?_0xa4228e[_0xbd46('0x19')][_0xbd46('0x1b')]||null:null,'include':_0xa4228e[_0xbd46('0x19')]?_0xa4228e[_0xbd46('0x19')][_0xbd46('0x1c')]?_['map'](_0xa4228e['options'][_0xbd46('0x1c')],function(_0xbd6318){return{'model':db[_0xbd6318['model']],'as':_0xbd6318['as'],'attributes':_0xbd6318[_0xbd46('0x1b')],'include':_0xbd6318[_0xbd46('0x1c')]?_[_0xbd46('0x1d')](_0xbd6318[_0xbd46('0x1c')],function(_0x38d37b){return{'model':db[_0x38d37b[_0xbd46('0x1e')]],'as':_0x38d37b['as'],'attributes':_0x38d37b[_0xbd46('0x1b')],'include':_0x38d37b[_0xbd46('0x1c')]?_[_0xbd46('0x1d')](_0x38d37b[_0xbd46('0x1c')],function(_0x367842){return{'model':db[_0x367842[_0xbd46('0x1e')]],'as':_0x367842['as'],'attributes':_0x367842[_0xbd46('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbd46('0xc')](function(_0x4d9c54){logger[_0xbd46('0x13')](_0xbd46('0x16'),_0xa4228e);logger[_0xbd46('0xe')](_0xbd46('0x16'),_0xa4228e,JSON[_0xbd46('0xf')](_0x4d9c54));_0x38ee56(_0x4d9c54);})['catch'](function(_0x4b550e){logger[_0xbd46('0x10')]('ShowSound',_0x4b550e[_0xbd46('0x12')],_0xa4228e);_0x245f1c(_0xc6c522[_0xbd46('0x10')](0x1f4,_0x4b550e[_0xbd46('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index af344da..6379ce8 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x205329,_0x223a33){var _0x1594ab=function(_0x561afb){while(--_0x561afb){_0x205329['push'](_0x205329['shift']());}};_0x1594ab(++_0x223a33);}(_0xda3f,0xec));var _0xfda3=function(_0x1e5543,_0x29056f){_0x1e5543=_0x1e5543-0x0;var _0x24fc38=_0xda3f[_0x1e5543];return _0x24fc38;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x3b6abd,_0xe7aed0){var _0x573c71=function(_0x38790d){while(--_0x38790d){_0x3b6abd['push'](_0x3b6abd['shift']());}};_0x573c71(++_0xe7aed0);}(_0x5eb8,0xb0));var _0x85eb=function(_0x11adbd,_0x5055f5){_0x11adbd=_0x11adbd-0x0;var _0x270029=_0x5eb8[_0x11adbd];return _0x270029;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 6d2f20b..a784ded 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 _0xc9be=['STRING','medium','ENUM','out','sequelize','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xc9be,0x130));var _0xec9b=function(_0xbc5fd,_0x529624){_0xbc5fd=_0xbc5fd-0x0;var _0x2c9c53=_0xc9be[_0xbc5fd];return _0x2c9c53;};'use strict';var Sequelize=require(_0xec9b('0x0'));module[_0xec9b('0x1')]={'uniqueid':{'type':Sequelize[_0xec9b('0x2')]},'body':{'type':Sequelize['TEXT'](_0xec9b('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xec9b('0x4')]('in',_0xec9b('0x5')),'defaultValue':_0xec9b('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xec9b('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdc98=['TEXT','ENUM','out','sequelize','exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xdc98,0x1dd));var _0x8dc9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdc98[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x8dc9('0x0'));module[_0x8dc9('0x1')]={'uniqueid':{'type':Sequelize[_0x8dc9('0x2')]},'body':{'type':Sequelize[_0x8dc9('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x8dc9('0x4')]('in',_0x8dc9('0x5')),'defaultValue':_0x8dc9('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x8dc9('0x2')]},'providerResponse':{'type':Sequelize[_0x8dc9('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7ee724e..e88de6e 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 _0xd193=['desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4faa8f,_0x1d67fe){var _0xe02ab9=function(_0x4453e8){while(--_0x4453e8){_0x4faa8f['push'](_0x4faa8f['shift']());}};_0xe02ab9(++_0x1d67fe);}(_0xd193,0x119));var _0x3d19=function(_0x50ca0a,_0x1b19ab){_0x50ca0a=_0x50ca0a-0x0;var _0xe3c748=_0xd193[_0x50ca0a];return _0xe3c748;};'use strict';var emlformat=require(_0x3d19('0x0'));var rimraf=require(_0x3d19('0x1'));var zipdir=require(_0x3d19('0x2'));var jsonpatch=require(_0x3d19('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d19('0x4'));var Mustache=require(_0x3d19('0x5'));var util=require(_0x3d19('0x6'));var path=require(_0x3d19('0x7'));var sox=require('sox');var csv=require(_0x3d19('0x8'));var ejs=require(_0x3d19('0x9'));var fs=require('fs');var fs_extra=require(_0x3d19('0xa'));var _=require(_0x3d19('0xb'));var squel=require(_0x3d19('0xc'));var crypto=require(_0x3d19('0xd'));var jsforce=require(_0x3d19('0xe'));var deskjs=require(_0x3d19('0xf'));var toCsv=require(_0x3d19('0x8'));var querystring=require(_0x3d19('0x10'));var Papa=require('papaparse');var Redis=require(_0x3d19('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3d19('0x12'));var as=require(_0x3d19('0x13'));var hardwareService=require(_0x3d19('0x14'));var logger=require(_0x3d19('0x15'))(_0x3d19('0x16'));var utils=require('../../config/utils');var config=require(_0x3d19('0x17'));var licenseUtil=require(_0x3d19('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7bb278,_0x2754f1){_0x2754f1=_0x2754f1||0xcc;return function(_0x86bc23){if(_0x86bc23){return _0x7bb278[_0x3d19('0x19')](_0x2754f1);}return _0x7bb278[_0x3d19('0x1a')](_0x2754f1)[_0x3d19('0x1b')]();};}function respondWithResult(_0x1bfd8e,_0x1754ca){_0x1754ca=_0x1754ca||0xc8;return function(_0x2c2d63){if(_0x2c2d63){return _0x1bfd8e[_0x3d19('0x1a')](_0x1754ca)['json'](_0x2c2d63);}};}function respondWithFilteredResult(_0x1ae9ad,_0x389417){return function(_0x2d1789){if(_0x2d1789){var _0x460ea2=typeof _0x389417[_0x3d19('0x1c')]===_0x3d19('0x1d')&&typeof _0x389417[_0x3d19('0x1e')]==='undefined';var _0x2d6f51=_0x2d1789[_0x3d19('0x1f')];var _0x5acba2=_0x460ea2?0x0:_0x389417[_0x3d19('0x1c')];var _0x331cfb=_0x460ea2?_0x2d1789[_0x3d19('0x1f')]:_0x389417[_0x3d19('0x1c')]+_0x389417['limit'];var _0x2add90;if(_0x331cfb>=_0x2d6f51){_0x331cfb=_0x2d6f51;_0x2add90=0xc8;}else{_0x2add90=0xce;}_0x1ae9ad['status'](_0x2add90);return _0x1ae9ad[_0x3d19('0x20')](_0x3d19('0x21'),_0x5acba2+'-'+_0x331cfb+'/'+_0x2d6f51)[_0x3d19('0x22')](_0x2d1789);}return null;};}function patchUpdates(_0x32f2f7){return function(_0x36856c){try{jsonpatch[_0x3d19('0x23')](_0x36856c,_0x32f2f7,!![]);}catch(_0x323e29){return BPromise['reject'](_0x323e29);}return _0x36856c[_0x3d19('0x24')]();};}function saveUpdates(_0xc220af,_0x3b51f5){return function(_0x51f000){if(_0x51f000){return _0x51f000[_0x3d19('0x25')](_0xc220af)[_0x3d19('0x26')](function(_0x2fdeaf){return _0x2fdeaf;});}return null;};}function removeEntity(_0x2197a8,_0xdf1dd0){return function(_0x3c4fb5){if(_0x3c4fb5){return _0x3c4fb5['destroy']()[_0x3d19('0x26')](function(){_0x2197a8[_0x3d19('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ad72,_0xbf067a){return function(_0xb2b9d7){if(!_0xb2b9d7){_0x41ad72[_0x3d19('0x19')](0x194);}return _0xb2b9d7;};}function handleError(_0xcf6292,_0x146951){_0x146951=_0x146951||0x1f4;return function(_0x376fbd){logger[_0x3d19('0x27')](_0x376fbd[_0x3d19('0x28')]);if(_0x376fbd[_0x3d19('0x29')]){delete _0x376fbd['name'];}_0xcf6292[_0x3d19('0x1a')](_0x146951)[_0x3d19('0x2a')](_0x376fbd);};}exports['index']=function(_0x41736a,_0x13fbbf){var _0xbe91b2={},_0x1a4080={},_0x14791b={'count':0x0,'rows':[]};var _0x37d45a=_[_0x3d19('0x2b')](db[_0x3d19('0x2c')][_0x3d19('0x2d')],function(_0x401c6b){return{'name':_0x401c6b[_0x3d19('0x2e')],'type':_0x401c6b[_0x3d19('0x2f')][_0x3d19('0x30')]};});_0x1a4080[_0x3d19('0x31')]=_[_0x3d19('0x2b')](_0x37d45a,_0x3d19('0x29'));_0x1a4080[_0x3d19('0x32')]=_[_0x3d19('0x33')](_0x41736a['query']);_0x1a4080[_0x3d19('0x34')]=_[_0x3d19('0x35')](_0x1a4080['model'],_0x1a4080[_0x3d19('0x32')]);_0xbe91b2['attributes']=_[_0x3d19('0x35')](_0x1a4080['model'],qs[_0x3d19('0x36')](_0x41736a[_0x3d19('0x32')][_0x3d19('0x36')]));_0xbe91b2[_0x3d19('0x37')]=_0xbe91b2['attributes'][_0x3d19('0x38')]?_0xbe91b2[_0x3d19('0x37')]:_0x1a4080[_0x3d19('0x31')];if(!_0x41736a[_0x3d19('0x32')][_0x3d19('0x39')](_0x3d19('0x3a'))){_0xbe91b2[_0x3d19('0x1e')]=qs[_0x3d19('0x1e')](_0x41736a[_0x3d19('0x32')][_0x3d19('0x1e')]);_0xbe91b2[_0x3d19('0x1c')]=qs[_0x3d19('0x1c')](_0x41736a[_0x3d19('0x32')][_0x3d19('0x1c')]);}_0xbe91b2['order']=qs['sort'](_0x41736a[_0x3d19('0x32')]['sort']);_0xbe91b2[_0x3d19('0x3b')]=qs['filters'](_[_0x3d19('0x3c')](_0x41736a[_0x3d19('0x32')],_0x1a4080[_0x3d19('0x34')]),_0x37d45a);if(_0x41736a['query'][_0x3d19('0x3d')]){_0xbe91b2[_0x3d19('0x3b')]=_[_0x3d19('0x3e')](_0xbe91b2[_0x3d19('0x3b')],{'$or':_['map'](_0x37d45a,function(_0x5f28c0){if(_0x5f28c0[_0x3d19('0x2f')]!==_0x3d19('0x3f')){var _0x3436f2={};_0x3436f2[_0x5f28c0[_0x3d19('0x29')]]={'$like':'%'+_0x41736a[_0x3d19('0x32')][_0x3d19('0x3d')]+'%'};return _0x3436f2;}})});}_0xbe91b2=_['merge']({},_0xbe91b2,_0x41736a['options']);var _0x1a7d2c={'where':_0xbe91b2['where']};return db[_0x3d19('0x2c')]['count'](_0x1a7d2c)['then'](function(_0x219daf){_0x14791b[_0x3d19('0x1f')]=_0x219daf;if(_0x41736a[_0x3d19('0x32')][_0x3d19('0x40')]){_0xbe91b2[_0x3d19('0x41')]=[{'all':!![]}];}return db['SquareMessage'][_0x3d19('0x42')](_0xbe91b2);})[_0x3d19('0x26')](function(_0x1b4c04){_0x14791b['rows']=_0x1b4c04;return _0x14791b;})[_0x3d19('0x26')](respondWithFilteredResult(_0x13fbbf,_0xbe91b2))[_0x3d19('0x43')](handleError(_0x13fbbf,null));};exports[_0x3d19('0x44')]=function(_0x1cff5a,_0x27bbb3){var _0x44faa2={'raw':!![],'where':{'id':_0x1cff5a[_0x3d19('0x45')]['id']}},_0x2c85a8={};_0x2c85a8[_0x3d19('0x31')]=_[_0x3d19('0x33')](db['SquareMessage'][_0x3d19('0x2d')]);_0x2c85a8[_0x3d19('0x32')]=_['keys'](_0x1cff5a[_0x3d19('0x32')]);_0x2c85a8[_0x3d19('0x34')]=_['intersection'](_0x2c85a8[_0x3d19('0x31')],_0x2c85a8[_0x3d19('0x32')]);_0x44faa2['attributes']=_[_0x3d19('0x35')](_0x2c85a8[_0x3d19('0x31')],qs[_0x3d19('0x36')](_0x1cff5a[_0x3d19('0x32')]['fields']));_0x44faa2[_0x3d19('0x37')]=_0x44faa2[_0x3d19('0x37')][_0x3d19('0x38')]?_0x44faa2[_0x3d19('0x37')]:_0x2c85a8[_0x3d19('0x31')];if(_0x1cff5a['query'][_0x3d19('0x40')]){_0x44faa2[_0x3d19('0x41')]=[{'all':!![]}];}_0x44faa2=_['merge']({},_0x44faa2,_0x1cff5a[_0x3d19('0x46')]);return db[_0x3d19('0x2c')][_0x3d19('0x47')](_0x44faa2)[_0x3d19('0x26')](handleEntityNotFound(_0x27bbb3,null))['then'](respondWithResult(_0x27bbb3,null))['catch'](handleError(_0x27bbb3,null));};exports['create']=function(_0x2dddd5,_0x416976){return db['SquareMessage'][_0x3d19('0x48')](_0x2dddd5['body'],{})[_0x3d19('0x26')](respondWithResult(_0x416976,0xc9))[_0x3d19('0x43')](handleError(_0x416976,null));};exports['update']=function(_0x220b24,_0x539bf0){if(_0x220b24[_0x3d19('0x49')]['id']){delete _0x220b24[_0x3d19('0x49')]['id'];}return db[_0x3d19('0x2c')][_0x3d19('0x47')]({'where':{'id':_0x220b24[_0x3d19('0x45')]['id']}})[_0x3d19('0x26')](handleEntityNotFound(_0x539bf0,null))[_0x3d19('0x26')](saveUpdates(_0x220b24[_0x3d19('0x49')],null))['then'](respondWithResult(_0x539bf0,null))['catch'](handleError(_0x539bf0,null));};exports['destroy']=function(_0x4767ee,_0x940cfb){return db[_0x3d19('0x2c')][_0x3d19('0x47')]({'where':{'id':_0x4767ee[_0x3d19('0x45')]['id']}})[_0x3d19('0x26')](handleEntityNotFound(_0x940cfb,null))['then'](removeEntity(_0x940cfb,null))[_0x3d19('0x43')](handleError(_0x940cfb,null));}; \ No newline at end of file +var _0xf5dd=['nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','SquareMessage','length','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields'];(function(_0x110dee,_0x3bab76){var _0x4feda4=function(_0x3068b0){while(--_0x3068b0){_0x110dee['push'](_0x110dee['shift']());}};_0x4feda4(++_0x3bab76);}(_0xf5dd,0x1ad));var _0xdf5d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf5dd[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xdf5d('0x0'));var rimraf=require(_0xdf5d('0x1'));var zipdir=require(_0xdf5d('0x2'));var jsonpatch=require(_0xdf5d('0x3'));var rp=require(_0xdf5d('0x4'));var moment=require(_0xdf5d('0x5'));var BPromise=require(_0xdf5d('0x6'));var Mustache=require(_0xdf5d('0x7'));var util=require(_0xdf5d('0x8'));var path=require(_0xdf5d('0x9'));var sox=require(_0xdf5d('0xa'));var csv=require('to-csv');var ejs=require(_0xdf5d('0xb'));var fs=require('fs');var fs_extra=require(_0xdf5d('0xc'));var _=require(_0xdf5d('0xd'));var squel=require(_0xdf5d('0xe'));var crypto=require(_0xdf5d('0xf'));var jsforce=require(_0xdf5d('0x10'));var deskjs=require(_0xdf5d('0x11'));var toCsv=require(_0xdf5d('0x12'));var querystring=require(_0xdf5d('0x13'));var Papa=require(_0xdf5d('0x14'));var Redis=require(_0xdf5d('0x15'));var authService=require(_0xdf5d('0x16'));var qs=require(_0xdf5d('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf5d('0x18'));var logger=require(_0xdf5d('0x19'))(_0xdf5d('0x1a'));var utils=require(_0xdf5d('0x1b'));var config=require(_0xdf5d('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf5d('0x1d'))['db'];function respondWithStatusCode(_0x5405bf,_0x18d645){_0x18d645=_0x18d645||0xcc;return function(_0x1f5321){if(_0x1f5321){return _0x5405bf['sendStatus'](_0x18d645);}return _0x5405bf[_0xdf5d('0x1e')](_0x18d645)[_0xdf5d('0x1f')]();};}function respondWithResult(_0x57f413,_0x4dacae){_0x4dacae=_0x4dacae||0xc8;return function(_0x51c332){if(_0x51c332){return _0x57f413[_0xdf5d('0x1e')](_0x4dacae)['json'](_0x51c332);}};}function respondWithFilteredResult(_0x23a204,_0x2a48bd){return function(_0x2c0bc9){if(_0x2c0bc9){var _0x5d97d8=typeof _0x2a48bd[_0xdf5d('0x20')]===_0xdf5d('0x21')&&typeof _0x2a48bd['limit']===_0xdf5d('0x21');var _0x2547a2=_0x2c0bc9['count'];var _0x528fed=_0x5d97d8?0x0:_0x2a48bd[_0xdf5d('0x20')];var _0x2e2bd9=_0x5d97d8?_0x2c0bc9[_0xdf5d('0x22')]:_0x2a48bd[_0xdf5d('0x20')]+_0x2a48bd['limit'];var _0x5be00a;if(_0x2e2bd9>=_0x2547a2){_0x2e2bd9=_0x2547a2;_0x5be00a=0xc8;}else{_0x5be00a=0xce;}_0x23a204[_0xdf5d('0x1e')](_0x5be00a);return _0x23a204[_0xdf5d('0x23')](_0xdf5d('0x24'),_0x528fed+'-'+_0x2e2bd9+'/'+_0x2547a2)[_0xdf5d('0x25')](_0x2c0bc9);}return null;};}function patchUpdates(_0x3453a3){return function(_0x44651e){try{jsonpatch[_0xdf5d('0x26')](_0x44651e,_0x3453a3,!![]);}catch(_0x2fdfc8){return BPromise['reject'](_0x2fdfc8);}return _0x44651e[_0xdf5d('0x27')]();};}function saveUpdates(_0x343d55,_0x522674){return function(_0x40f13c){if(_0x40f13c){return _0x40f13c[_0xdf5d('0x28')](_0x343d55)[_0xdf5d('0x29')](function(_0x35283a){return _0x35283a;});}return null;};}function removeEntity(_0x2cf5a9,_0x454405){return function(_0x4781bc){if(_0x4781bc){return _0x4781bc[_0xdf5d('0x2a')]()[_0xdf5d('0x29')](function(){_0x2cf5a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x298174,_0xb49516){return function(_0xcf1393){if(!_0xcf1393){_0x298174[_0xdf5d('0x2b')](0x194);}return _0xcf1393;};}function handleError(_0xafe96f,_0x5ca7da){_0x5ca7da=_0x5ca7da||0x1f4;return function(_0x162190){logger['error'](_0x162190[_0xdf5d('0x2c')]);if(_0x162190[_0xdf5d('0x2d')]){delete _0x162190[_0xdf5d('0x2d')];}_0xafe96f[_0xdf5d('0x1e')](_0x5ca7da)[_0xdf5d('0x2e')](_0x162190);};}exports['index']=function(_0x344bd0,_0x352207){var _0x13f86e={},_0x353747={},_0x29dbd2={'count':0x0,'rows':[]};var _0x1f50ec=_[_0xdf5d('0x2f')](db['SquareMessage'][_0xdf5d('0x30')],function(_0x54f316){return{'name':_0x54f316[_0xdf5d('0x31')],'type':_0x54f316['type'][_0xdf5d('0x32')]};});_0x353747[_0xdf5d('0x33')]=_['map'](_0x1f50ec,_0xdf5d('0x2d'));_0x353747[_0xdf5d('0x34')]=_[_0xdf5d('0x35')](_0x344bd0[_0xdf5d('0x34')]);_0x353747['filters']=_['intersection'](_0x353747[_0xdf5d('0x33')],_0x353747['query']);_0x13f86e[_0xdf5d('0x36')]=_[_0xdf5d('0x37')](_0x353747[_0xdf5d('0x33')],qs[_0xdf5d('0x38')](_0x344bd0[_0xdf5d('0x34')][_0xdf5d('0x38')]));_0x13f86e[_0xdf5d('0x36')]=_0x13f86e['attributes']['length']?_0x13f86e[_0xdf5d('0x36')]:_0x353747[_0xdf5d('0x33')];if(!_0x344bd0[_0xdf5d('0x34')]['hasOwnProperty'](_0xdf5d('0x39'))){_0x13f86e[_0xdf5d('0x3a')]=qs[_0xdf5d('0x3a')](_0x344bd0[_0xdf5d('0x34')][_0xdf5d('0x3a')]);_0x13f86e[_0xdf5d('0x20')]=qs['offset'](_0x344bd0[_0xdf5d('0x34')][_0xdf5d('0x20')]);}_0x13f86e[_0xdf5d('0x3b')]=qs[_0xdf5d('0x3c')](_0x344bd0[_0xdf5d('0x34')][_0xdf5d('0x3c')]);_0x13f86e[_0xdf5d('0x3d')]=qs[_0xdf5d('0x3e')](_[_0xdf5d('0x3f')](_0x344bd0[_0xdf5d('0x34')],_0x353747[_0xdf5d('0x3e')]),_0x1f50ec);if(_0x344bd0[_0xdf5d('0x34')][_0xdf5d('0x40')]){_0x13f86e[_0xdf5d('0x3d')]=_['merge'](_0x13f86e[_0xdf5d('0x3d')],{'$or':_[_0xdf5d('0x2f')](_0x1f50ec,function(_0x3e9071){if(_0x3e9071[_0xdf5d('0x41')]!==_0xdf5d('0x42')){var _0x1dce85={};_0x1dce85[_0x3e9071[_0xdf5d('0x2d')]]={'$like':'%'+_0x344bd0[_0xdf5d('0x34')]['filter']+'%'};return _0x1dce85;}})});}_0x13f86e=_[_0xdf5d('0x43')]({},_0x13f86e,_0x344bd0[_0xdf5d('0x44')]);var _0x4e4b8c={'where':_0x13f86e[_0xdf5d('0x3d')]};return db['SquareMessage'][_0xdf5d('0x22')](_0x4e4b8c)[_0xdf5d('0x29')](function(_0x2f26ec){_0x29dbd2['count']=_0x2f26ec;if(_0x344bd0['query'][_0xdf5d('0x45')]){_0x13f86e[_0xdf5d('0x46')]=[{'all':!![]}];}return db['SquareMessage'][_0xdf5d('0x47')](_0x13f86e);})['then'](function(_0x1d8b03){_0x29dbd2[_0xdf5d('0x48')]=_0x1d8b03;return _0x29dbd2;})[_0xdf5d('0x29')](respondWithFilteredResult(_0x352207,_0x13f86e))[_0xdf5d('0x49')](handleError(_0x352207,null));};exports[_0xdf5d('0x4a')]=function(_0x168b9b,_0x72d8d1){var _0x36f7cf={'raw':!![],'where':{'id':_0x168b9b['params']['id']}},_0x3a6b6c={};_0x3a6b6c[_0xdf5d('0x33')]=_[_0xdf5d('0x35')](db[_0xdf5d('0x4b')][_0xdf5d('0x30')]);_0x3a6b6c['query']=_['keys'](_0x168b9b[_0xdf5d('0x34')]);_0x3a6b6c['filters']=_[_0xdf5d('0x37')](_0x3a6b6c[_0xdf5d('0x33')],_0x3a6b6c[_0xdf5d('0x34')]);_0x36f7cf['attributes']=_[_0xdf5d('0x37')](_0x3a6b6c[_0xdf5d('0x33')],qs[_0xdf5d('0x38')](_0x168b9b[_0xdf5d('0x34')][_0xdf5d('0x38')]));_0x36f7cf[_0xdf5d('0x36')]=_0x36f7cf['attributes'][_0xdf5d('0x4c')]?_0x36f7cf[_0xdf5d('0x36')]:_0x3a6b6c[_0xdf5d('0x33')];if(_0x168b9b[_0xdf5d('0x34')][_0xdf5d('0x45')]){_0x36f7cf[_0xdf5d('0x46')]=[{'all':!![]}];}_0x36f7cf=_[_0xdf5d('0x43')]({},_0x36f7cf,_0x168b9b[_0xdf5d('0x44')]);return db[_0xdf5d('0x4b')]['find'](_0x36f7cf)['then'](handleEntityNotFound(_0x72d8d1,null))['then'](respondWithResult(_0x72d8d1,null))[_0xdf5d('0x49')](handleError(_0x72d8d1,null));};exports['create']=function(_0x1fef94,_0x44593e){return db[_0xdf5d('0x4b')][_0xdf5d('0x4d')](_0x1fef94[_0xdf5d('0x4e')],{})[_0xdf5d('0x29')](respondWithResult(_0x44593e,0xc9))['catch'](handleError(_0x44593e,null));};exports[_0xdf5d('0x28')]=function(_0x181e59,_0x3eba02){if(_0x181e59[_0xdf5d('0x4e')]['id']){delete _0x181e59[_0xdf5d('0x4e')]['id'];}return db[_0xdf5d('0x4b')][_0xdf5d('0x4f')]({'where':{'id':_0x181e59['params']['id']}})['then'](handleEntityNotFound(_0x3eba02,null))['then'](saveUpdates(_0x181e59[_0xdf5d('0x4e')],null))[_0xdf5d('0x29')](respondWithResult(_0x3eba02,null))[_0xdf5d('0x49')](handleError(_0x3eba02,null));};exports['destroy']=function(_0x6d8125,_0x4b5c7b){return db[_0xdf5d('0x4b')][_0xdf5d('0x4f')]({'where':{'id':_0x6d8125[_0xdf5d('0x50')]['id']}})[_0xdf5d('0x29')](handleEntityNotFound(_0x4b5c7b,null))['then'](removeEntity(_0x4b5c7b,null))[_0xdf5d('0x49')](handleError(_0x4b5c7b,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 6aef4bf..167c35f 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 _0xfa98=['square_messages','lodash','util','api','moment','bluebird','path','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x27c176,_0x5bb781){var _0x54c706=function(_0x46c0cf){while(--_0x46c0cf){_0x27c176['push'](_0x27c176['shift']());}};_0x54c706(++_0x5bb781);}(_0xfa98,0x1f0));var _0x8fa9=function(_0x2b6a1e,_0x189d92){_0x2b6a1e=_0x2b6a1e-0x0;var _0x2a5fa8=_0xfa98[_0x2b6a1e];return _0x2a5fa8;};'use strict';var _=require(_0x8fa9('0x0'));var util=require(_0x8fa9('0x1'));var logger=require('../../config/logger')(_0x8fa9('0x2'));var moment=require(_0x8fa9('0x3'));var BPromise=require(_0x8fa9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fa9('0x5'));var rimraf=require('rimraf');var config=require(_0x8fa9('0x6'));var attributes=require(_0x8fa9('0x7'));module[_0x8fa9('0x8')]=function(_0x250b24,_0x3ebc01){return _0x250b24[_0x8fa9('0x9')]('SquareMessage',attributes,{'tableName':_0x8fa9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7dc1=['request-promise','path','rimraf','./squareMessage.attributes','SquareMessage','util','../../config/logger','api','bluebird'];(function(_0xd62ebf,_0x191afe){var _0x574701=function(_0x277092){while(--_0x277092){_0xd62ebf['push'](_0xd62ebf['shift']());}};_0x574701(++_0x191afe);}(_0x7dc1,0x113));var _0x17dc=function(_0x28d57a,_0xca371d){_0x28d57a=_0x28d57a-0x0;var _0x15b952=_0x7dc1[_0x28d57a];return _0x15b952;};'use strict';var _=require('lodash');var util=require(_0x17dc('0x0'));var logger=require(_0x17dc('0x1'))(_0x17dc('0x2'));var moment=require('moment');var BPromise=require(_0x17dc('0x3'));var rp=require(_0x17dc('0x4'));var fs=require('fs');var path=require(_0x17dc('0x5'));var rimraf=require(_0x17dc('0x6'));var config=require('../../config/environment');var attributes=require(_0x17dc('0x7'));module['exports']=function(_0x5294c5,_0x1504a1){return _0x5294c5['define'](_0x17dc('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index e7d8f57..ec89bd6 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 _0xb051=['SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','body','options','raw','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x46a31f,_0x934b86){var _0x43b4fd=function(_0x2072d6){while(--_0x2072d6){_0x46a31f['push'](_0x46a31f['shift']());}};_0x43b4fd(++_0x934b86);}(_0xb051,0x1f0));var _0x1b05=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0xb051[_0x46111d];return _0xe82586;};'use strict';var _=require(_0x1b05('0x0'));var util=require('util');var moment=require(_0x1b05('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b05('0x2'));var fs=require('fs');var Redis=require(_0x1b05('0x3'));var db=require(_0x1b05('0x4'))['db'];var utils=require(_0x1b05('0x5'));var logger=require(_0x1b05('0x6'))('rpc');var config=require(_0x1b05('0x7'));var jayson=require(_0x1b05('0x8'));var client=jayson[_0x1b05('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c069b,_0x38311c,_0x2f3f56){return new BPromise(function(_0x59205d,_0x41c68c){return client[_0x1b05('0xa')](_0x2c069b,_0x2f3f56)['then'](function(_0x1f6304){logger[_0x1b05('0xb')]('SquareMessage,\x20%s,\x20%s',_0x38311c,'request\x20sent');logger[_0x1b05('0xc')](_0x1b05('0xd'),_0x38311c,_0x1b05('0xe'),JSON[_0x1b05('0xf')](_0x1f6304));if(_0x1f6304['error']){if(_0x1f6304[_0x1b05('0x10')]['code']===0x1f4){logger[_0x1b05('0x10')](_0x1b05('0x11'),_0x38311c,_0x1f6304[_0x1b05('0x10')]['message']);return _0x41c68c(_0x1f6304[_0x1b05('0x10')]['message']);}logger['error'](_0x1b05('0x11'),_0x38311c,_0x1f6304[_0x1b05('0x10')][_0x1b05('0x12')]);return _0x59205d(_0x1f6304[_0x1b05('0x10')][_0x1b05('0x12')]);}else{logger[_0x1b05('0xb')](_0x1b05('0x11'),_0x38311c,_0x1b05('0xe'));_0x59205d(_0x1f6304[_0x1b05('0x13')][_0x1b05('0x12')]);}})[_0x1b05('0x14')](function(_0x51804e){logger[_0x1b05('0x10')](_0x1b05('0x11'),_0x38311c,_0x51804e);_0x41c68c(_0x51804e);});});}exports[_0x1b05('0x15')]=function(_0x1341cb){var _0x56c584=this;return new Promise(function(_0xac4528,_0x3df8e7){return db['SquareMessage'][_0x1b05('0x16')](_0x1341cb[_0x1b05('0x17')],{'raw':_0x1341cb[_0x1b05('0x18')]?_0x1341cb[_0x1b05('0x18')][_0x1b05('0x19')]===undefined?!![]:![]:!![]})[_0x1b05('0x1a')](function(_0x1be541){logger[_0x1b05('0xb')]('CreateSquareMessage',_0x1341cb);logger[_0x1b05('0xc')](_0x1b05('0x15'),_0x1341cb,JSON['stringify'](_0x1be541));_0xac4528(_0x1be541);})[_0x1b05('0x14')](function(_0x23ceee){logger['error']('CreateSquareMessage',_0x23ceee['message'],_0x1341cb);_0x3df8e7(_0x56c584[_0x1b05('0x10')](0x1f4,_0x23ceee['message']));});});}; \ No newline at end of file +var _0x4355=['message','info','result','CreateSquareMessage','SquareMessage','body','options','then','stringify','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x55698c,_0x192c96){var _0x2ded46=function(_0x5968e4){while(--_0x5968e4){_0x55698c['push'](_0x55698c['shift']());}};_0x2ded46(++_0x192c96);}(_0x4355,0x1d2));var _0x5435=function(_0x2e6fa9,_0x27b082){_0x2e6fa9=_0x2e6fa9-0x0;var _0x13ef91=_0x4355[_0x2e6fa9];return _0x13ef91;};'use strict';var _=require('lodash');var util=require(_0x5435('0x0'));var moment=require('moment');var BPromise=require(_0x5435('0x1'));var rs=require(_0x5435('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5435('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5435('0x4'))(_0x5435('0x5'));var config=require(_0x5435('0x6'));var jayson=require(_0x5435('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4850e2,_0xb2e8b5,_0x3f9e10){return new BPromise(function(_0x14b0bb,_0x4968a1){return client[_0x5435('0x8')](_0x4850e2,_0x3f9e10)['then'](function(_0x361889){logger['info'](_0x5435('0x9'),_0xb2e8b5,_0x5435('0xa'));logger['debug'](_0x5435('0xb'),_0xb2e8b5,_0x5435('0xa'),JSON['stringify'](_0x361889));if(_0x361889[_0x5435('0xc')]){if(_0x361889['error'][_0x5435('0xd')]===0x1f4){logger[_0x5435('0xc')](_0x5435('0x9'),_0xb2e8b5,_0x361889[_0x5435('0xc')]['message']);return _0x4968a1(_0x361889[_0x5435('0xc')][_0x5435('0xe')]);}logger[_0x5435('0xc')](_0x5435('0x9'),_0xb2e8b5,_0x361889[_0x5435('0xc')][_0x5435('0xe')]);return _0x14b0bb(_0x361889[_0x5435('0xc')][_0x5435('0xe')]);}else{logger[_0x5435('0xf')](_0x5435('0x9'),_0xb2e8b5,_0x5435('0xa'));_0x14b0bb(_0x361889[_0x5435('0x10')][_0x5435('0xe')]);}})['catch'](function(_0x44f33f){logger[_0x5435('0xc')]('SquareMessage,\x20%s,\x20%s',_0xb2e8b5,_0x44f33f);_0x4968a1(_0x44f33f);});});}exports[_0x5435('0x11')]=function(_0x44ff04){var _0x454fbf=this;return new Promise(function(_0x34c893,_0x5d4bed){return db[_0x5435('0x12')]['create'](_0x44ff04[_0x5435('0x13')],{'raw':_0x44ff04['options']?_0x44ff04[_0x5435('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x5435('0x15')](function(_0x54f8e3){logger['info'](_0x5435('0x11'),_0x44ff04);logger['debug'](_0x5435('0x11'),_0x44ff04,JSON[_0x5435('0x16')](_0x54f8e3));_0x34c893(_0x54f8e3);})[_0x5435('0x17')](function(_0x56b676){logger[_0x5435('0xc')]('CreateSquareMessage',_0x56b676[_0x5435('0xe')],_0x44ff04);_0x5d4bed(_0x454fbf[_0x5435('0xc')](0x1f4,_0x56b676[_0x5435('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e95e43b..01a24ea 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 _0x6b5e=['put','update','/:id','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','create'];(function(_0x141e03,_0x18340e){var _0x2074e3=function(_0x2b7ece){while(--_0x2b7ece){_0x141e03['push'](_0x141e03['shift']());}};_0x2074e3(++_0x18340e);}(_0x6b5e,0x7c));var _0xe6b5=function(_0x3f7e6b,_0x1245be){_0x3f7e6b=_0x3f7e6b-0x0;var _0x5d600e=_0x6b5e[_0x3f7e6b];return _0x5d600e;};'use strict';var multer=require(_0xe6b5('0x0'));var util=require('util');var path=require(_0xe6b5('0x1'));var timeout=require(_0xe6b5('0x2'));var express=require('express');var router=express[_0xe6b5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe6b5('0x4'));var interaction=require(_0xe6b5('0x5'));var config=require(_0xe6b5('0x6'));var controller=require(_0xe6b5('0x7'));router[_0xe6b5('0x8')]('/',auth[_0xe6b5('0x9')](),controller[_0xe6b5('0xa')]);router[_0xe6b5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe6b5('0xb')]);router['get'](_0xe6b5('0xc'),auth[_0xe6b5('0x9')](),timeout(_0xe6b5('0xd')),controller[_0xe6b5('0xe')]);router['post']('/',auth[_0xe6b5('0x9')](),controller[_0xe6b5('0xf')]);router[_0xe6b5('0x10')]('/:id',auth[_0xe6b5('0x9')](),controller[_0xe6b5('0x11')]);router['delete'](_0xe6b5('0x12'),auth[_0xe6b5('0x9')](),controller['destroy']);module[_0xe6b5('0x13')]=router; \ No newline at end of file +var _0x14eb=['/:id','isAuthenticated','show','15s','test','post','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','get','index'];(function(_0x5a4857,_0x2564a1){var _0x2e1863=function(_0x3d0bb7){while(--_0x3d0bb7){_0x5a4857['push'](_0x5a4857['shift']());}};_0x2e1863(++_0x2564a1);}(_0x14eb,0x192));var _0xb14e=function(_0x346ec9,_0x19645c){_0x346ec9=_0x346ec9-0x0;var _0x1c2853=_0x14eb[_0x346ec9];return _0x1c2853;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb14e('0x0'));var express=require(_0xb14e('0x1'));var router=express[_0xb14e('0x2')]();var fs_extra=require(_0xb14e('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xb14e('0x4')]('/',auth['isAuthenticated'](),controller[_0xb14e('0x5')]);router[_0xb14e('0x4')](_0xb14e('0x6'),auth[_0xb14e('0x7')](),controller[_0xb14e('0x8')]);router[_0xb14e('0x4')]('/:id/test',auth['isAuthenticated'](),timeout(_0xb14e('0x9')),controller[_0xb14e('0xa')]);router[_0xb14e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb14e('0xc')]('/:id',auth[_0xb14e('0x7')](),controller[_0xb14e('0xd')]);router[_0xb14e('0xe')](_0xb14e('0x6'),auth[_0xb14e('0x7')](),controller[_0xb14e('0xf')]);module[_0xb14e('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 9dc984a..6bc1cde 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 _0xe322=['STRING','exports','name'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xe322,0x1e1));var _0x2e32=function(_0x54d958,_0x43bf86){_0x54d958=_0x54d958-0x0;var _0x2cb2a6=_0xe322[_0x54d958];return _0x2cb2a6;};'use strict';var Sequelize=require('sequelize');module[_0x2e32('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2e32('0x1'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2e32('0x2')]}}; \ No newline at end of file +var _0x6d27=['STRING','name','sequelize','exports'];(function(_0x599559,_0x47372a){var _0x5b1da8=function(_0x110232){while(--_0x110232){_0x599559['push'](_0x599559['shift']());}};_0x5b1da8(++_0x47372a);}(_0x6d27,0x166));var _0x76d2=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x6d27[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x76d2('0x0'));module[_0x76d2('0x1')]={'name':{'type':Sequelize[_0x76d2('0x2')],'unique':_0x76d2('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x76d2('0x2')]},'description':{'type':Sequelize[_0x76d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 2e83a32..9179bf1 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 _0x90ea=['reject','save','update','then','destroy','get','ODBC','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SquareOdbc','rows','catch','show','params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','openSync','dsn','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0x90ea,0x1ec));var _0xa90e=function(_0x4a618f,_0x3cc6c4){_0x4a618f=_0x4a618f-0x0;var _0x3462d3=_0x90ea[_0x4a618f];return _0x3462d3;};'use strict';var emlformat=require(_0xa90e('0x0'));var rimraf=require(_0xa90e('0x1'));var zipdir=require(_0xa90e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa90e('0x3'));var moment=require(_0xa90e('0x4'));var BPromise=require(_0xa90e('0x5'));var Mustache=require(_0xa90e('0x6'));var util=require(_0xa90e('0x7'));var path=require(_0xa90e('0x8'));var sox=require(_0xa90e('0x9'));var csv=require('to-csv');var ejs=require(_0xa90e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa90e('0xb'));var crypto=require(_0xa90e('0xc'));var jsforce=require(_0xa90e('0xd'));var deskjs=require(_0xa90e('0xe'));var toCsv=require(_0xa90e('0xf'));var querystring=require(_0xa90e('0x10'));var Papa=require(_0xa90e('0x11'));var Redis=require(_0xa90e('0x12'));var authService=require(_0xa90e('0x13'));var qs=require(_0xa90e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa90e('0x15'));var logger=require(_0xa90e('0x16'))(_0xa90e('0x17'));var utils=require('../../config/utils');var config=require(_0xa90e('0x18'));var licenseUtil=require(_0xa90e('0x19'));var db=require(_0xa90e('0x1a'))['db'];function respondWithStatusCode(_0x3f3ced,_0x378471){_0x378471=_0x378471||0xcc;return function(_0x567ee1){if(_0x567ee1){return _0x3f3ced['sendStatus'](_0x378471);}return _0x3f3ced[_0xa90e('0x1b')](_0x378471)[_0xa90e('0x1c')]();};}function respondWithResult(_0x24d933,_0x2c1fc7){_0x2c1fc7=_0x2c1fc7||0xc8;return function(_0x4df89e){if(_0x4df89e){return _0x24d933[_0xa90e('0x1b')](_0x2c1fc7)['json'](_0x4df89e);}};}function respondWithFilteredResult(_0x54a1ce,_0x3b83ae){return function(_0x30a89c){if(_0x30a89c){var _0x2ef5a8=typeof _0x3b83ae[_0xa90e('0x1d')]===_0xa90e('0x1e')&&typeof _0x3b83ae[_0xa90e('0x1f')]==='undefined';var _0x303c17=_0x30a89c[_0xa90e('0x20')];var _0x541277=_0x2ef5a8?0x0:_0x3b83ae[_0xa90e('0x1d')];var _0x4b30c8=_0x2ef5a8?_0x30a89c['count']:_0x3b83ae['offset']+_0x3b83ae[_0xa90e('0x1f')];var _0x3c4d6e;if(_0x4b30c8>=_0x303c17){_0x4b30c8=_0x303c17;_0x3c4d6e=0xc8;}else{_0x3c4d6e=0xce;}_0x54a1ce[_0xa90e('0x1b')](_0x3c4d6e);return _0x54a1ce[_0xa90e('0x21')](_0xa90e('0x22'),_0x541277+'-'+_0x4b30c8+'/'+_0x303c17)['json'](_0x30a89c);}return null;};}function patchUpdates(_0x278117){return function(_0x419a08){try{jsonpatch[_0xa90e('0x23')](_0x419a08,_0x278117,!![]);}catch(_0x47acb7){return BPromise[_0xa90e('0x24')](_0x47acb7);}return _0x419a08[_0xa90e('0x25')]();};}function saveUpdates(_0x3568d2,_0x542fc3){return function(_0x7c4f07){if(_0x7c4f07){return _0x7c4f07[_0xa90e('0x26')](_0x3568d2)[_0xa90e('0x27')](function(_0x36e006){return _0x36e006;});}return null;};}function removeEntity(_0x588ca9,_0xe3398b){return function(_0x1933c0){if(_0x1933c0){return _0x1933c0[_0xa90e('0x28')]()[_0xa90e('0x27')](function(){var _0x5deadf=_0x1933c0[_0xa90e('0x29')]({'plain':!![]});var _0x4b8f95=_0xa90e('0x2a');return db['UserProfileResource'][_0xa90e('0x28')]({'where':{'type':_0x4b8f95,'resourceId':_0x5deadf['id']}})[_0xa90e('0x27')](function(){return _0x1933c0;});})['then'](function(){_0x588ca9[_0xa90e('0x1b')](0xcc)[_0xa90e('0x1c')]();});}};}function handleEntityNotFound(_0x14b034,_0x2416fe){return function(_0x1a5d36){if(!_0x1a5d36){_0x14b034[_0xa90e('0x2b')](0x194);}return _0x1a5d36;};}function handleError(_0x44f69c,_0x9b215b){_0x9b215b=_0x9b215b||0x1f4;return function(_0x56cd04){logger['error'](_0x56cd04[_0xa90e('0x2c')]);if(_0x56cd04[_0xa90e('0x2d')]){delete _0x56cd04[_0xa90e('0x2d')];}_0x44f69c[_0xa90e('0x1b')](_0x9b215b)[_0xa90e('0x2e')](_0x56cd04);};}exports[_0xa90e('0x2f')]=function(_0x4bf829,_0x1d6403){var _0x9ec4f9={},_0x49a5ff={},_0x538c76={'count':0x0,'rows':[]};var _0x238a72=_['map'](db['SquareOdbc'][_0xa90e('0x30')],function(_0x4eaa7a){return{'name':_0x4eaa7a[_0xa90e('0x31')],'type':_0x4eaa7a[_0xa90e('0x32')]['key']};});_0x49a5ff[_0xa90e('0x33')]=_[_0xa90e('0x34')](_0x238a72,_0xa90e('0x2d'));_0x49a5ff[_0xa90e('0x35')]=_[_0xa90e('0x36')](_0x4bf829[_0xa90e('0x35')]);_0x49a5ff[_0xa90e('0x37')]=_['intersection'](_0x49a5ff[_0xa90e('0x33')],_0x49a5ff['query']);_0x9ec4f9['attributes']=_[_0xa90e('0x38')](_0x49a5ff[_0xa90e('0x33')],qs['fields'](_0x4bf829[_0xa90e('0x35')]['fields']));_0x9ec4f9[_0xa90e('0x39')]=_0x9ec4f9['attributes'][_0xa90e('0x3a')]?_0x9ec4f9[_0xa90e('0x39')]:_0x49a5ff[_0xa90e('0x33')];if(!_0x4bf829['query'][_0xa90e('0x3b')](_0xa90e('0x3c'))){_0x9ec4f9[_0xa90e('0x1f')]=qs[_0xa90e('0x1f')](_0x4bf829[_0xa90e('0x35')]['limit']);_0x9ec4f9['offset']=qs[_0xa90e('0x1d')](_0x4bf829['query'][_0xa90e('0x1d')]);}_0x9ec4f9['order']=qs[_0xa90e('0x3d')](_0x4bf829[_0xa90e('0x35')]['sort']);_0x9ec4f9[_0xa90e('0x3e')]=qs[_0xa90e('0x37')](_[_0xa90e('0x3f')](_0x4bf829[_0xa90e('0x35')],_0x49a5ff[_0xa90e('0x37')]),_0x238a72);if(_0x4bf829[_0xa90e('0x35')][_0xa90e('0x40')]){_0x9ec4f9[_0xa90e('0x3e')]=_[_0xa90e('0x41')](_0x9ec4f9[_0xa90e('0x3e')],{'$or':_['map'](_0x238a72,function(_0x269d11){if(_0x269d11[_0xa90e('0x32')]!==_0xa90e('0x42')){var _0x19519e={};_0x19519e[_0x269d11['name']]={'$like':'%'+_0x4bf829['query'][_0xa90e('0x40')]+'%'};return _0x19519e;}})});}_0x9ec4f9=_[_0xa90e('0x41')]({},_0x9ec4f9,_0x4bf829[_0xa90e('0x43')]);var _0x2b6ae3={'where':_0x9ec4f9[_0xa90e('0x3e')]};return db['SquareOdbc'][_0xa90e('0x20')](_0x2b6ae3)[_0xa90e('0x27')](function(_0x3d9727){_0x538c76[_0xa90e('0x20')]=_0x3d9727;if(_0x4bf829[_0xa90e('0x35')][_0xa90e('0x44')]){_0x9ec4f9[_0xa90e('0x45')]=[{'all':!![]}];}return db[_0xa90e('0x46')]['findAll'](_0x9ec4f9);})[_0xa90e('0x27')](function(_0x168105){_0x538c76[_0xa90e('0x47')]=_0x168105;return _0x538c76;})[_0xa90e('0x27')](respondWithFilteredResult(_0x1d6403,_0x9ec4f9))[_0xa90e('0x48')](handleError(_0x1d6403,null));};exports[_0xa90e('0x49')]=function(_0x4aaa5f,_0x259792){var _0x2a18c1={'raw':!![],'where':{'id':_0x4aaa5f[_0xa90e('0x4a')]['id']}},_0x11a3f4={};_0x11a3f4[_0xa90e('0x33')]=_[_0xa90e('0x36')](db[_0xa90e('0x46')]['rawAttributes']);_0x11a3f4[_0xa90e('0x35')]=_['keys'](_0x4aaa5f['query']);_0x11a3f4[_0xa90e('0x37')]=_[_0xa90e('0x38')](_0x11a3f4['model'],_0x11a3f4[_0xa90e('0x35')]);_0x2a18c1['attributes']=_['intersection'](_0x11a3f4[_0xa90e('0x33')],qs[_0xa90e('0x4b')](_0x4aaa5f[_0xa90e('0x35')][_0xa90e('0x4b')]));_0x2a18c1['attributes']=_0x2a18c1[_0xa90e('0x39')][_0xa90e('0x3a')]?_0x2a18c1['attributes']:_0x11a3f4[_0xa90e('0x33')];if(_0x4aaa5f[_0xa90e('0x35')][_0xa90e('0x44')]){_0x2a18c1['include']=[{'all':!![]}];}_0x2a18c1=_[_0xa90e('0x41')]({},_0x2a18c1,_0x4aaa5f[_0xa90e('0x43')]);return db['SquareOdbc'][_0xa90e('0x4c')](_0x2a18c1)[_0xa90e('0x27')](handleEntityNotFound(_0x259792,null))[_0xa90e('0x27')](respondWithResult(_0x259792,null))['catch'](handleError(_0x259792,null));};exports[_0xa90e('0x4d')]=function(_0xaafd52,_0x196128){return db[_0xa90e('0x46')][_0xa90e('0x4d')](_0xaafd52['body'],{})[_0xa90e('0x27')](function(_0x1c3462){var _0x40523d=_0xaafd52[_0xa90e('0x4e')]['get']({'plain':!![]});if(!_0x40523d)throw new Error(_0xa90e('0x4f'));if(_0x40523d[_0xa90e('0x50')]===_0xa90e('0x4e')){var _0x431a16=_0x1c3462[_0xa90e('0x29')]({'plain':!![]});var _0x2470e0=_0xa90e('0x2a');return db[_0xa90e('0x51')][_0xa90e('0x4c')]({'where':{'name':_0x2470e0,'userProfileId':_0x40523d[_0xa90e('0x52')]},'raw':!![]})[_0xa90e('0x27')](function(_0x45d170){if(_0x45d170&&_0x45d170[_0xa90e('0x53')]===0x0){return db[_0xa90e('0x54')][_0xa90e('0x4d')]({'name':_0x431a16[_0xa90e('0x2d')],'resourceId':_0x431a16['id'],'type':_0x45d170[_0xa90e('0x2d')],'sectionId':_0x45d170['id']},{})['then'](function(){return _0x1c3462;});}else{return _0x1c3462;}})[_0xa90e('0x48')](function(_0x25c482){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25c482);throw _0x25c482;});}return _0x1c3462;})[_0xa90e('0x27')](respondWithResult(_0x196128,0xc9))[_0xa90e('0x48')](handleError(_0x196128,null));};exports[_0xa90e('0x26')]=function(_0x44d940,_0x496e36){if(_0x44d940[_0xa90e('0x55')]['id']){delete _0x44d940[_0xa90e('0x55')]['id'];}return db[_0xa90e('0x46')][_0xa90e('0x4c')]({'where':{'id':_0x44d940[_0xa90e('0x4a')]['id']}})[_0xa90e('0x27')](handleEntityNotFound(_0x496e36,null))[_0xa90e('0x27')](saveUpdates(_0x44d940[_0xa90e('0x55')],null))[_0xa90e('0x27')](respondWithResult(_0x496e36,null))['catch'](handleError(_0x496e36,null));};exports['destroy']=function(_0x458239,_0x1e961e){return db[_0xa90e('0x46')][_0xa90e('0x4c')]({'where':{'id':_0x458239[_0xa90e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1e961e,null))[_0xa90e('0x27')](removeEntity(_0x1e961e,null))[_0xa90e('0x48')](handleError(_0x1e961e,null));};exports['test']=function(_0x5a7dbc,_0xa06e60,_0xeb1960){var _0x3d2c3e;return db[_0xa90e('0x46')][_0xa90e('0x4c')]({'where':{'id':_0x5a7dbc[_0xa90e('0x4a')]['id']},'attributes':['id','dsn']})[_0xa90e('0x27')](handleEntityNotFound(_0xa06e60,null))['then'](function(_0xe9d0a7){if(_0xe9d0a7){var _0x119c88=require('odbc')();_0x119c88[_0xa90e('0x56')](_0xe9d0a7[_0xa90e('0x57')]);_0x119c88['closeSync']();return _0xe9d0a7;}})[_0xa90e('0x27')](respondWithResult(_0xa06e60,null))[_0xa90e('0x48')](handleError(_0xa06e60,null));}; \ No newline at end of file +var _0x5f65=['query','keys','attributes','intersection','fields','length','hasOwnProperty','offset','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','filters','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','odbc','openSync','dsn','closeSync','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','Content-Range','apply','save','update','then','destroy','ODBC','UserProfileResource','error','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model'];(function(_0x5d392b,_0x45edfe){var _0x17cdb5=function(_0x4ef164){while(--_0x4ef164){_0x5d392b['push'](_0x5d392b['shift']());}};_0x17cdb5(++_0x45edfe);}(_0x5f65,0x12b));var _0x55f6=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x5f65[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x55f6('0x0'));var rimraf=require(_0x55f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55f6('0x2'));var rp=require('request-promise');var moment=require(_0x55f6('0x3'));var BPromise=require(_0x55f6('0x4'));var Mustache=require('mustache');var util=require(_0x55f6('0x5'));var path=require(_0x55f6('0x6'));var sox=require(_0x55f6('0x7'));var csv=require(_0x55f6('0x8'));var ejs=require(_0x55f6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55f6('0xa'));var squel=require('squel');var crypto=require(_0x55f6('0xb'));var jsforce=require(_0x55f6('0xc'));var deskjs=require(_0x55f6('0xd'));var toCsv=require(_0x55f6('0x8'));var querystring=require(_0x55f6('0xe'));var Papa=require(_0x55f6('0xf'));var Redis=require('ioredis');var authService=require(_0x55f6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x55f6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55f6('0x12'))(_0x55f6('0x13'));var utils=require(_0x55f6('0x14'));var config=require(_0x55f6('0x15'));var licenseUtil=require(_0x55f6('0x16'));var db=require(_0x55f6('0x17'))['db'];function respondWithStatusCode(_0x366c84,_0x4f24c1){_0x4f24c1=_0x4f24c1||0xcc;return function(_0x1e5652){if(_0x1e5652){return _0x366c84[_0x55f6('0x18')](_0x4f24c1);}return _0x366c84[_0x55f6('0x19')](_0x4f24c1)[_0x55f6('0x1a')]();};}function respondWithResult(_0x53e68d,_0x93e70f){_0x93e70f=_0x93e70f||0xc8;return function(_0x5ba949){if(_0x5ba949){return _0x53e68d[_0x55f6('0x19')](_0x93e70f)[_0x55f6('0x1b')](_0x5ba949);}};}function respondWithFilteredResult(_0x52d466,_0x421d02){return function(_0x1cfd55){if(_0x1cfd55){var _0x560b45=typeof _0x421d02['offset']==='undefined'&&typeof _0x421d02['limit']===_0x55f6('0x1c');var _0x4bdbb4=_0x1cfd55[_0x55f6('0x1d')];var _0x4e7104=_0x560b45?0x0:_0x421d02['offset'];var _0x3b0159=_0x560b45?_0x1cfd55[_0x55f6('0x1d')]:_0x421d02['offset']+_0x421d02[_0x55f6('0x1e')];var _0x5bb02d;if(_0x3b0159>=_0x4bdbb4){_0x3b0159=_0x4bdbb4;_0x5bb02d=0xc8;}else{_0x5bb02d=0xce;}_0x52d466[_0x55f6('0x19')](_0x5bb02d);return _0x52d466['set'](_0x55f6('0x1f'),_0x4e7104+'-'+_0x3b0159+'/'+_0x4bdbb4)[_0x55f6('0x1b')](_0x1cfd55);}return null;};}function patchUpdates(_0x551d41){return function(_0x39e058){try{jsonpatch[_0x55f6('0x20')](_0x39e058,_0x551d41,!![]);}catch(_0x1a54b6){return BPromise['reject'](_0x1a54b6);}return _0x39e058[_0x55f6('0x21')]();};}function saveUpdates(_0x4376ca,_0x37d6a7){return function(_0x1eb338){if(_0x1eb338){return _0x1eb338[_0x55f6('0x22')](_0x4376ca)[_0x55f6('0x23')](function(_0x322841){return _0x322841;});}return null;};}function removeEntity(_0x2d9478,_0x441f6b){return function(_0x2723f7){if(_0x2723f7){return _0x2723f7[_0x55f6('0x24')]()['then'](function(){var _0x5b0c19=_0x2723f7['get']({'plain':!![]});var _0x181bbc=_0x55f6('0x25');return db[_0x55f6('0x26')][_0x55f6('0x24')]({'where':{'type':_0x181bbc,'resourceId':_0x5b0c19['id']}})[_0x55f6('0x23')](function(){return _0x2723f7;});})['then'](function(){_0x2d9478['status'](0xcc)[_0x55f6('0x1a')]();});}};}function handleEntityNotFound(_0x22f473,_0x4db001){return function(_0x16c655){if(!_0x16c655){_0x22f473[_0x55f6('0x18')](0x194);}return _0x16c655;};}function handleError(_0x45c010,_0x5b1691){_0x5b1691=_0x5b1691||0x1f4;return function(_0x5c00bc){logger[_0x55f6('0x27')](_0x5c00bc['stack']);if(_0x5c00bc[_0x55f6('0x28')]){delete _0x5c00bc['name'];}_0x45c010[_0x55f6('0x19')](_0x5b1691)['send'](_0x5c00bc);};}exports[_0x55f6('0x29')]=function(_0xa12007,_0x506070){var _0xa60ad4={},_0x580526={},_0x552042={'count':0x0,'rows':[]};var _0x272cee=_[_0x55f6('0x2a')](db[_0x55f6('0x2b')][_0x55f6('0x2c')],function(_0x1070c8){return{'name':_0x1070c8[_0x55f6('0x2d')],'type':_0x1070c8[_0x55f6('0x2e')][_0x55f6('0x2f')]};});_0x580526[_0x55f6('0x30')]=_[_0x55f6('0x2a')](_0x272cee,_0x55f6('0x28'));_0x580526[_0x55f6('0x31')]=_[_0x55f6('0x32')](_0xa12007[_0x55f6('0x31')]);_0x580526['filters']=_['intersection'](_0x580526[_0x55f6('0x30')],_0x580526[_0x55f6('0x31')]);_0xa60ad4[_0x55f6('0x33')]=_[_0x55f6('0x34')](_0x580526['model'],qs[_0x55f6('0x35')](_0xa12007[_0x55f6('0x31')][_0x55f6('0x35')]));_0xa60ad4[_0x55f6('0x33')]=_0xa60ad4[_0x55f6('0x33')][_0x55f6('0x36')]?_0xa60ad4[_0x55f6('0x33')]:_0x580526[_0x55f6('0x30')];if(!_0xa12007[_0x55f6('0x31')][_0x55f6('0x37')]('nolimit')){_0xa60ad4[_0x55f6('0x1e')]=qs[_0x55f6('0x1e')](_0xa12007[_0x55f6('0x31')]['limit']);_0xa60ad4[_0x55f6('0x38')]=qs[_0x55f6('0x38')](_0xa12007['query'][_0x55f6('0x38')]);}_0xa60ad4['order']=qs[_0x55f6('0x39')](_0xa12007[_0x55f6('0x31')][_0x55f6('0x39')]);_0xa60ad4[_0x55f6('0x3a')]=qs['filters'](_[_0x55f6('0x3b')](_0xa12007[_0x55f6('0x31')],_0x580526['filters']),_0x272cee);if(_0xa12007[_0x55f6('0x31')][_0x55f6('0x3c')]){_0xa60ad4[_0x55f6('0x3a')]=_['merge'](_0xa60ad4[_0x55f6('0x3a')],{'$or':_[_0x55f6('0x2a')](_0x272cee,function(_0x12254d){if(_0x12254d[_0x55f6('0x2e')]!==_0x55f6('0x3d')){var _0x5dff80={};_0x5dff80[_0x12254d[_0x55f6('0x28')]]={'$like':'%'+_0xa12007['query'][_0x55f6('0x3c')]+'%'};return _0x5dff80;}})});}_0xa60ad4=_['merge']({},_0xa60ad4,_0xa12007[_0x55f6('0x3e')]);var _0x2c85f8={'where':_0xa60ad4[_0x55f6('0x3a')]};return db[_0x55f6('0x2b')][_0x55f6('0x1d')](_0x2c85f8)[_0x55f6('0x23')](function(_0xbece2d){_0x552042['count']=_0xbece2d;if(_0xa12007[_0x55f6('0x31')][_0x55f6('0x3f')]){_0xa60ad4[_0x55f6('0x40')]=[{'all':!![]}];}return db[_0x55f6('0x2b')]['findAll'](_0xa60ad4);})['then'](function(_0xc221a7){_0x552042[_0x55f6('0x41')]=_0xc221a7;return _0x552042;})[_0x55f6('0x23')](respondWithFilteredResult(_0x506070,_0xa60ad4))[_0x55f6('0x42')](handleError(_0x506070,null));};exports[_0x55f6('0x43')]=function(_0x4b0675,_0xea186c){var _0x5c1535={'raw':!![],'where':{'id':_0x4b0675['params']['id']}},_0x228c39={};_0x228c39[_0x55f6('0x30')]=_[_0x55f6('0x32')](db[_0x55f6('0x2b')][_0x55f6('0x2c')]);_0x228c39[_0x55f6('0x31')]=_['keys'](_0x4b0675['query']);_0x228c39[_0x55f6('0x44')]=_[_0x55f6('0x34')](_0x228c39['model'],_0x228c39['query']);_0x5c1535['attributes']=_['intersection'](_0x228c39[_0x55f6('0x30')],qs['fields'](_0x4b0675['query'][_0x55f6('0x35')]));_0x5c1535[_0x55f6('0x33')]=_0x5c1535[_0x55f6('0x33')][_0x55f6('0x36')]?_0x5c1535[_0x55f6('0x33')]:_0x228c39['model'];if(_0x4b0675[_0x55f6('0x31')]['includeAll']){_0x5c1535[_0x55f6('0x40')]=[{'all':!![]}];}_0x5c1535=_[_0x55f6('0x45')]({},_0x5c1535,_0x4b0675['options']);return db[_0x55f6('0x2b')][_0x55f6('0x46')](_0x5c1535)[_0x55f6('0x23')](handleEntityNotFound(_0xea186c,null))[_0x55f6('0x23')](respondWithResult(_0xea186c,null))['catch'](handleError(_0xea186c,null));};exports['create']=function(_0x3a3084,_0x4845e8){return db['SquareOdbc'][_0x55f6('0x47')](_0x3a3084['body'],{})[_0x55f6('0x23')](function(_0x2ae077){var _0x42194f=_0x3a3084[_0x55f6('0x48')][_0x55f6('0x49')]({'plain':!![]});if(!_0x42194f)throw new Error(_0x55f6('0x4a'));if(_0x42194f[_0x55f6('0x4b')]===_0x55f6('0x48')){var _0x16c76c=_0x2ae077[_0x55f6('0x49')]({'plain':!![]});var _0x46a1f5=_0x55f6('0x25');return db[_0x55f6('0x4c')]['find']({'where':{'name':_0x46a1f5,'userProfileId':_0x42194f[_0x55f6('0x4d')]},'raw':!![]})[_0x55f6('0x23')](function(_0x46e676){if(_0x46e676&&_0x46e676[_0x55f6('0x4e')]===0x0){return db['UserProfileResource'][_0x55f6('0x47')]({'name':_0x16c76c[_0x55f6('0x28')],'resourceId':_0x16c76c['id'],'type':_0x46e676[_0x55f6('0x28')],'sectionId':_0x46e676['id']},{})[_0x55f6('0x23')](function(){return _0x2ae077;});}else{return _0x2ae077;}})[_0x55f6('0x42')](function(_0x50290b){logger[_0x55f6('0x27')](_0x55f6('0x4f'),_0x50290b);throw _0x50290b;});}return _0x2ae077;})[_0x55f6('0x23')](respondWithResult(_0x4845e8,0xc9))[_0x55f6('0x42')](handleError(_0x4845e8,null));};exports[_0x55f6('0x22')]=function(_0x3b7b59,_0x144da8){if(_0x3b7b59[_0x55f6('0x50')]['id']){delete _0x3b7b59[_0x55f6('0x50')]['id'];}return db[_0x55f6('0x2b')][_0x55f6('0x46')]({'where':{'id':_0x3b7b59[_0x55f6('0x51')]['id']}})['then'](handleEntityNotFound(_0x144da8,null))[_0x55f6('0x23')](saveUpdates(_0x3b7b59[_0x55f6('0x50')],null))[_0x55f6('0x23')](respondWithResult(_0x144da8,null))['catch'](handleError(_0x144da8,null));};exports[_0x55f6('0x24')]=function(_0x2ba5cf,_0x5acf29){return db[_0x55f6('0x2b')][_0x55f6('0x46')]({'where':{'id':_0x2ba5cf[_0x55f6('0x51')]['id']}})['then'](handleEntityNotFound(_0x5acf29,null))[_0x55f6('0x23')](removeEntity(_0x5acf29,null))[_0x55f6('0x42')](handleError(_0x5acf29,null));};exports[_0x55f6('0x52')]=function(_0x51cbd6,_0x374547,_0x56879f){var _0x4cb6b0;return db[_0x55f6('0x2b')][_0x55f6('0x46')]({'where':{'id':_0x51cbd6[_0x55f6('0x51')]['id']},'attributes':['id','dsn']})[_0x55f6('0x23')](handleEntityNotFound(_0x374547,null))[_0x55f6('0x23')](function(_0x3bf5c4){if(_0x3bf5c4){var _0x372aa9=require(_0x55f6('0x53'))();_0x372aa9[_0x55f6('0x54')](_0x3bf5c4[_0x55f6('0x55')]);_0x372aa9[_0x55f6('0x56')]();return _0x3bf5c4;}})['then'](respondWithResult(_0x374547,null))[_0x55f6('0x42')](handleError(_0x374547,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 5ef0f8b..c07fad3 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 _0xcf14=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf14,0x17a));var _0x4cf1=function(_0xdddecf,_0x71d7da){_0xdddecf=_0xdddecf-0x0;var _0x5a78ed=_0xcf14[_0xdddecf];return _0x5a78ed;};'use strict';var _=require(_0x4cf1('0x0'));var util=require(_0x4cf1('0x1'));var logger=require(_0x4cf1('0x2'))(_0x4cf1('0x3'));var moment=require(_0x4cf1('0x4'));var BPromise=require(_0x4cf1('0x5'));var rp=require(_0x4cf1('0x6'));var fs=require('fs');var path=require(_0x4cf1('0x7'));var rimraf=require(_0x4cf1('0x8'));var config=require(_0x4cf1('0x9'));var attributes=require(_0x4cf1('0xa'));module[_0x4cf1('0xb')]=function(_0x555dd3,_0x538597){return _0x555dd3['define'](_0x4cf1('0xc'),attributes,{'tableName':_0x4cf1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11f8=['rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','moment','request-promise','path'];(function(_0x64b37e,_0x35baa9){var _0x598fd5=function(_0x101a8a){while(--_0x101a8a){_0x64b37e['push'](_0x64b37e['shift']());}};_0x598fd5(++_0x35baa9);}(_0x11f8,0x15b));var _0x811f=function(_0x412e40,_0x34e0fd){_0x412e40=_0x412e40-0x0;var _0x5987a6=_0x11f8[_0x412e40];return _0x5987a6;};'use strict';var _=require(_0x811f('0x0'));var util=require(_0x811f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x811f('0x2'));var BPromise=require('bluebird');var rp=require(_0x811f('0x3'));var fs=require('fs');var path=require(_0x811f('0x4'));var rimraf=require(_0x811f('0x5'));var config=require(_0x811f('0x6'));var attributes=require(_0x811f('0x7'));module[_0x811f('0x8')]=function(_0x11fd08,_0x1598fb){return _0x11fd08['define'](_0x811f('0x9'),attributes,{'tableName':_0x811f('0xa'),'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 1024cd3..b1724da 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 _0x0924=['SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','SquareOdbc','find','options','include','map','attributes','model','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x43b791,_0x52fa1c){var _0x417948=function(_0x57fd6d){while(--_0x57fd6d){_0x43b791['push'](_0x43b791['shift']());}};_0x417948(++_0x52fa1c);}(_0x0924,0xda));var _0x4092=function(_0x39d9ec,_0x4ed6e5){_0x39d9ec=_0x39d9ec-0x0;var _0x499ff0=_0x0924[_0x39d9ec];return _0x499ff0;};'use strict';var _=require(_0x4092('0x0'));var util=require(_0x4092('0x1'));var moment=require('moment');var BPromise=require(_0x4092('0x2'));var rs=require(_0x4092('0x3'));var fs=require('fs');var Redis=require(_0x4092('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4092('0x5'))(_0x4092('0x6'));var config=require('../../config/environment');var jayson=require(_0x4092('0x7'));var client=jayson[_0x4092('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29db57,_0xe84380,_0x1f58b8){return new BPromise(function(_0xac5bac,_0x51d755){return client[_0x4092('0x9')](_0x29db57,_0x1f58b8)[_0x4092('0xa')](function(_0x451099){logger[_0x4092('0xb')]('SquareOdbc,\x20%s,\x20%s',_0xe84380,_0x4092('0xc'));logger[_0x4092('0xd')](_0x4092('0xe'),_0xe84380,_0x4092('0xc'),JSON[_0x4092('0xf')](_0x451099));if(_0x451099['error']){if(_0x451099[_0x4092('0x10')][_0x4092('0x11')]===0x1f4){logger[_0x4092('0x10')](_0x4092('0x12'),_0xe84380,_0x451099[_0x4092('0x10')][_0x4092('0x13')]);return _0x51d755(_0x451099[_0x4092('0x10')][_0x4092('0x13')]);}logger[_0x4092('0x10')]('SquareOdbc,\x20%s,\x20%s',_0xe84380,_0x451099['error']['message']);return _0xac5bac(_0x451099['error'][_0x4092('0x13')]);}else{logger[_0x4092('0xb')](_0x4092('0x12'),_0xe84380,_0x4092('0xc'));_0xac5bac(_0x451099[_0x4092('0x14')][_0x4092('0x13')]);}})['catch'](function(_0x42a16b){logger[_0x4092('0x10')](_0x4092('0x12'),_0xe84380,_0x42a16b);_0x51d755(_0x42a16b);});});}exports[_0x4092('0x15')]=function(_0x50a53e){var _0x26784e=this;return new Promise(function(_0x5bb7fd,_0x2381fb){return db[_0x4092('0x16')][_0x4092('0x17')]({'raw':_0x50a53e['options']?_0x50a53e[_0x4092('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x50a53e[_0x4092('0x18')]?_0x50a53e[_0x4092('0x18')]['where']||null:null,'attributes':_0x50a53e[_0x4092('0x18')]?_0x50a53e[_0x4092('0x18')]['attributes']||null:null,'include':_0x50a53e[_0x4092('0x18')]?_0x50a53e['options'][_0x4092('0x19')]?_[_0x4092('0x1a')](_0x50a53e[_0x4092('0x18')][_0x4092('0x19')],function(_0x14d188){return{'model':db[_0x14d188['model']],'as':_0x14d188['as'],'attributes':_0x14d188[_0x4092('0x1b')],'include':_0x14d188[_0x4092('0x19')]?_[_0x4092('0x1a')](_0x14d188['include'],function(_0x14067b){return{'model':db[_0x14067b[_0x4092('0x1c')]],'as':_0x14067b['as'],'attributes':_0x14067b[_0x4092('0x1b')],'include':_0x14067b[_0x4092('0x19')]?_['map'](_0x14067b['include'],function(_0xa352af){return{'model':db[_0xa352af[_0x4092('0x1c')]],'as':_0xa352af['as'],'attributes':_0xa352af[_0x4092('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45abc4){logger[_0x4092('0xb')](_0x4092('0x15'),_0x50a53e);logger[_0x4092('0xd')](_0x4092('0x15'),_0x50a53e,JSON[_0x4092('0xf')](_0x45abc4));_0x5bb7fd(_0x45abc4);})['catch'](function(_0x12dd3c){logger['error']('ShowSquareOdbc',_0x12dd3c['message'],_0x50a53e);_0x2381fb(_0x26784e[_0x4092('0x10')](0x1f4,_0x12dd3c[_0x4092('0x13')]));});});}; \ No newline at end of file +var _0x8547=['then','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8547,0x1a2));var _0x7854=function(_0x36beac,_0x55a397){_0x36beac=_0x36beac-0x0;var _0x1ef5cb=_0x8547[_0x36beac];return _0x1ef5cb;};'use strict';var _=require(_0x7854('0x0'));var util=require('util');var moment=require(_0x7854('0x1'));var BPromise=require(_0x7854('0x2'));var rs=require(_0x7854('0x3'));var fs=require('fs');var Redis=require(_0x7854('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7854('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7854('0x6'));var jayson=require(_0x7854('0x7'));var client=jayson[_0x7854('0x8')][_0x7854('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5020cc,_0x35c355,_0x56dd4b){return new BPromise(function(_0x3ab960,_0x382040){return client[_0x7854('0xa')](_0x5020cc,_0x56dd4b)['then'](function(_0x5bdbfb){logger[_0x7854('0xb')](_0x7854('0xc'),_0x35c355,_0x7854('0xd'));logger['debug'](_0x7854('0xe'),_0x35c355,_0x7854('0xd'),JSON[_0x7854('0xf')](_0x5bdbfb));if(_0x5bdbfb[_0x7854('0x10')]){if(_0x5bdbfb['error'][_0x7854('0x11')]===0x1f4){logger['error'](_0x7854('0xc'),_0x35c355,_0x5bdbfb[_0x7854('0x10')]['message']);return _0x382040(_0x5bdbfb['error'][_0x7854('0x12')]);}logger[_0x7854('0x10')](_0x7854('0xc'),_0x35c355,_0x5bdbfb['error']['message']);return _0x3ab960(_0x5bdbfb[_0x7854('0x10')][_0x7854('0x12')]);}else{logger['info'](_0x7854('0xc'),_0x35c355,_0x7854('0xd'));_0x3ab960(_0x5bdbfb['result'][_0x7854('0x12')]);}})[_0x7854('0x13')](function(_0x346300){logger['error'](_0x7854('0xc'),_0x35c355,_0x346300);_0x382040(_0x346300);});});}exports[_0x7854('0x14')]=function(_0x419428){var _0x592af2=this;return new Promise(function(_0x427ae4,_0x1bccbe){return db[_0x7854('0x15')][_0x7854('0x16')]({'raw':_0x419428[_0x7854('0x17')]?_0x419428[_0x7854('0x17')][_0x7854('0x18')]===undefined?!![]:![]:!![],'where':_0x419428['options']?_0x419428[_0x7854('0x17')][_0x7854('0x19')]||null:null,'attributes':_0x419428['options']?_0x419428[_0x7854('0x17')][_0x7854('0x1a')]||null:null,'include':_0x419428[_0x7854('0x17')]?_0x419428['options'][_0x7854('0x1b')]?_[_0x7854('0x1c')](_0x419428['options'][_0x7854('0x1b')],function(_0x5c2b9d){return{'model':db[_0x5c2b9d[_0x7854('0x1d')]],'as':_0x5c2b9d['as'],'attributes':_0x5c2b9d['attributes'],'include':_0x5c2b9d['include']?_['map'](_0x5c2b9d[_0x7854('0x1b')],function(_0x58a25d){return{'model':db[_0x58a25d[_0x7854('0x1d')]],'as':_0x58a25d['as'],'attributes':_0x58a25d['attributes'],'include':_0x58a25d[_0x7854('0x1b')]?_[_0x7854('0x1c')](_0x58a25d['include'],function(_0x15e646){return{'model':db[_0x15e646[_0x7854('0x1d')]],'as':_0x15e646['as'],'attributes':_0x15e646[_0x7854('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7854('0x1e')](function(_0x126823){logger['info'](_0x7854('0x14'),_0x419428);logger[_0x7854('0x1f')](_0x7854('0x14'),_0x419428,JSON[_0x7854('0xf')](_0x126823));_0x427ae4(_0x126823);})[_0x7854('0x13')](function(_0xcc268c){logger[_0x7854('0x10')]('ShowSquareOdbc',_0xcc268c[_0x7854('0x12')],_0x419428);_0x1bccbe(_0x592af2[_0x7854('0x10')](0x1f4,_0xcc268c[_0x7854('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 1717c8f..ab4ced0 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 _0xbe51=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','getUsers','create','post','/:id/users','addUsers','put','delete','removeUsers','exports','multer','util'];(function(_0x2ad5ce,_0x2527b5){var _0x284200=function(_0x4e146a){while(--_0x4e146a){_0x2ad5ce['push'](_0x2ad5ce['shift']());}};_0x284200(++_0x2527b5);}(_0xbe51,0x1e2));var _0x1be5=function(_0x2dfc6a,_0x1cc37a){_0x2dfc6a=_0x2dfc6a-0x0;var _0xb31d2e=_0xbe51[_0x2dfc6a];return _0xb31d2e;};'use strict';var multer=require(_0x1be5('0x0'));var util=require(_0x1be5('0x1'));var path=require('path');var timeout=require(_0x1be5('0x2'));var express=require('express');var router=express[_0x1be5('0x3')]();var fs_extra=require(_0x1be5('0x4'));var auth=require(_0x1be5('0x5'));var interaction=require(_0x1be5('0x6'));var config=require(_0x1be5('0x7'));var controller=require(_0x1be5('0x8'));router[_0x1be5('0x9')]('/',auth[_0x1be5('0xa')](),controller[_0x1be5('0xb')]);router[_0x1be5('0x9')](_0x1be5('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1be5('0x9')]('/:id/users',auth[_0x1be5('0xa')](),controller[_0x1be5('0xd')]);router['post']('/',auth[_0x1be5('0xa')](),controller[_0x1be5('0xe')]);router[_0x1be5('0xf')](_0x1be5('0x10'),auth[_0x1be5('0xa')](),controller[_0x1be5('0x11')]);router[_0x1be5('0x12')]('/:id',auth[_0x1be5('0xa')](),controller['update']);router[_0x1be5('0x13')](_0x1be5('0xc'),auth[_0x1be5('0xa')](),controller['destroy']);router[_0x1be5('0x13')]('/:id/users',auth[_0x1be5('0xa')](),controller[_0x1be5('0x14')]);module[_0x1be5('0x15')]=router; \ No newline at end of file +var _0x0bf7=['../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','addUsers','put','delete','removeUsers','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x71821,_0x2f2405){var _0x523fb4=function(_0x17f158){while(--_0x17f158){_0x71821['push'](_0x71821['shift']());}};_0x523fb4(++_0x2f2405);}(_0x0bf7,0x14a));var _0x70bf=function(_0x5701fc,_0x1c6a0f){_0x5701fc=_0x5701fc-0x0;var _0x2dadc6=_0x0bf7[_0x5701fc];return _0x2dadc6;};'use strict';var multer=require(_0x70bf('0x0'));var util=require('util');var path=require(_0x70bf('0x1'));var timeout=require(_0x70bf('0x2'));var express=require(_0x70bf('0x3'));var router=express[_0x70bf('0x4')]();var fs_extra=require(_0x70bf('0x5'));var auth=require(_0x70bf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x70bf('0x7'));var controller=require('./squareProject.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x70bf('0x8')]);router[_0x70bf('0x9')](_0x70bf('0xa'),auth[_0x70bf('0xb')](),controller[_0x70bf('0xc')]);router[_0x70bf('0x9')](_0x70bf('0xd'),auth[_0x70bf('0xb')](),controller[_0x70bf('0xe')]);router[_0x70bf('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x70bf('0xf')]('/:id/users',auth[_0x70bf('0xb')](),controller[_0x70bf('0x10')]);router[_0x70bf('0x11')](_0x70bf('0xa'),auth[_0x70bf('0xb')](),controller['update']);router[_0x70bf('0x12')](_0x70bf('0xa'),auth[_0x70bf('0xb')](),controller['destroy']);router[_0x70bf('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x70bf('0x13')]);module[_0x70bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2844b33..35729cf 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 _0xb39c=['name','STRING','TEXT','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','exports'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xb39c,0x136));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xcb39('0x0'));module[_0xcb39('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcb39('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcb39('0x3')]},'notes':{'type':Sequelize[_0xcb39('0x4')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xcb39('0x5')](_0xcb39('0x6'))){return this[_0xcb39('0x5')](_0xcb39('0x6'))[_0xcb39('0x7')](_0xcb39('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xcb39('0x9')),'get':function(){if(this['getDataValue'](_0xcb39('0xa'))){return this[_0xcb39('0x5')](_0xcb39('0xa'))[_0xcb39('0x7')](_0xcb39('0x8'));}}},'savedAt':{'type':Sequelize[_0xcb39('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8c95=['BLOB','long','getDataValue','preproduction','utf8','production','toString','sequelize','exports','STRING','name'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8c95,0x167));var _0x58c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c95[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x58c9('0x0'));module[_0x58c9('0x1')]={'name':{'type':Sequelize[_0x58c9('0x2')],'unique':_0x58c9('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x58c9('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x58c9('0x4')](_0x58c9('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x58c9('0x6')](_0x58c9('0x7'))['toString'](_0x58c9('0x8'));}}},'production':{'type':Sequelize[_0x58c9('0x4')](_0x58c9('0x5')),'get':function(){if(this[_0x58c9('0x6')](_0x58c9('0x9'))){return this[_0x58c9('0x6')](_0x58c9('0x9'))[_0x58c9('0xa')](_0x58c9('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c0f767c..0d5087a 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 _0xc73b=['undefined','limit','count','set','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','send','index','map','SquareProject','rawAttributes','type','model','name','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','keys','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','order','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','offset'];(function(_0x298c6b,_0x3773f1){var _0x513b7f=function(_0x3f42c7){while(--_0x3f42c7){_0x298c6b['push'](_0x298c6b['shift']());}};_0x513b7f(++_0x3773f1);}(_0xc73b,0x1d3));var _0xbc73=function(_0x2ed87f,_0x539f49){_0x2ed87f=_0x2ed87f-0x0;var _0x161c3b=_0xc73b[_0x2ed87f];return _0x161c3b;};'use strict';var emlformat=require(_0xbc73('0x0'));var rimraf=require(_0xbc73('0x1'));var zipdir=require(_0xbc73('0x2'));var jsonpatch=require(_0xbc73('0x3'));var rp=require(_0xbc73('0x4'));var moment=require('moment');var BPromise=require(_0xbc73('0x5'));var Mustache=require(_0xbc73('0x6'));var util=require(_0xbc73('0x7'));var path=require(_0xbc73('0x8'));var sox=require(_0xbc73('0x9'));var csv=require(_0xbc73('0xa'));var ejs=require(_0xbc73('0xb'));var fs=require('fs');var fs_extra=require(_0xbc73('0xc'));var _=require('lodash');var squel=require(_0xbc73('0xd'));var crypto=require(_0xbc73('0xe'));var jsforce=require(_0xbc73('0xf'));var deskjs=require(_0xbc73('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbc73('0x11'));var Papa=require(_0xbc73('0x12'));var Redis=require(_0xbc73('0x13'));var authService=require(_0xbc73('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbc73('0x15'));var hardwareService=require(_0xbc73('0x16'));var logger=require(_0xbc73('0x17'))('api');var utils=require(_0xbc73('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbc73('0x19'));var db=require(_0xbc73('0x1a'))['db'];config[_0xbc73('0x1b')]=_[_0xbc73('0x1c')](config[_0xbc73('0x1b')],{'host':_0xbc73('0x1d'),'port':0x18eb});var socket=require(_0xbc73('0x1e'))(new Redis(config['redis']));require(_0xbc73('0x1f'))[_0xbc73('0x20')](socket);function respondWithStatusCode(_0x397184,_0x506b69){_0x506b69=_0x506b69||0xcc;return function(_0x59d928){if(_0x59d928){return _0x397184[_0xbc73('0x21')](_0x506b69);}return _0x397184['status'](_0x506b69)[_0xbc73('0x22')]();};}function respondWithResult(_0x466c69,_0x4fa642){_0x4fa642=_0x4fa642||0xc8;return function(_0x5873f0){if(_0x5873f0){return _0x466c69[_0xbc73('0x23')](_0x4fa642)[_0xbc73('0x24')](_0x5873f0);}};}function respondWithFilteredResult(_0xed95d7,_0x28a225){return function(_0x5305cf){if(_0x5305cf){var _0x2a1329=typeof _0x28a225[_0xbc73('0x25')]===_0xbc73('0x26')&&typeof _0x28a225[_0xbc73('0x27')]===_0xbc73('0x26');var _0x32d2ca=_0x5305cf['count'];var _0x3d2531=_0x2a1329?0x0:_0x28a225[_0xbc73('0x25')];var _0x5afd64=_0x2a1329?_0x5305cf[_0xbc73('0x28')]:_0x28a225[_0xbc73('0x25')]+_0x28a225[_0xbc73('0x27')];var _0x371bf2;if(_0x5afd64>=_0x32d2ca){_0x5afd64=_0x32d2ca;_0x371bf2=0xc8;}else{_0x371bf2=0xce;}_0xed95d7[_0xbc73('0x23')](_0x371bf2);return _0xed95d7[_0xbc73('0x29')]('Content-Range',_0x3d2531+'-'+_0x5afd64+'/'+_0x32d2ca)[_0xbc73('0x24')](_0x5305cf);}return null;};}function patchUpdates(_0x55a283){return function(_0x7b1a37){try{jsonpatch[_0xbc73('0x2a')](_0x7b1a37,_0x55a283,!![]);}catch(_0x1d1fba){return BPromise[_0xbc73('0x2b')](_0x1d1fba);}return _0x7b1a37[_0xbc73('0x2c')]();};}function saveUpdates(_0x155cda,_0xd05cb5){return function(_0x20d073){if(_0x20d073){return _0x20d073[_0xbc73('0x2d')](_0x155cda)['then'](function(_0x2b5acb){return _0x2b5acb;});}return null;};}function removeEntity(_0x45f27e,_0x15f91f){return function(_0x357195){if(_0x357195){return _0x357195['destroy']()[_0xbc73('0x2e')](function(){var _0x13589b=_0x357195[_0xbc73('0x2f')]({'plain':!![]});var _0x2d0c1e='SquareProjects';return db[_0xbc73('0x30')][_0xbc73('0x31')]({'where':{'type':_0x2d0c1e,'resourceId':_0x13589b['id']}})[_0xbc73('0x2e')](function(){return _0x357195;});})[_0xbc73('0x2e')](function(){_0x45f27e[_0xbc73('0x23')](0xcc)[_0xbc73('0x22')]();});}};}function handleEntityNotFound(_0x2ed001,_0x148ed1){return function(_0x469949){if(!_0x469949){_0x2ed001[_0xbc73('0x21')](0x194);}return _0x469949;};}function handleError(_0x494737,_0x549ad2){_0x549ad2=_0x549ad2||0x1f4;return function(_0x38a4b9){logger['error'](_0x38a4b9[_0xbc73('0x32')]);if(_0x38a4b9['name']){delete _0x38a4b9['name'];}_0x494737[_0xbc73('0x23')](_0x549ad2)[_0xbc73('0x33')](_0x38a4b9);};}exports[_0xbc73('0x34')]=function(_0x29d952,_0x4a1e48){var _0x5e08f4={},_0x30d38b={},_0xed2d9a={'count':0x0,'rows':[]};var _0xdcac3=_[_0xbc73('0x35')](db[_0xbc73('0x36')][_0xbc73('0x37')],function(_0x1a18f6){return{'name':_0x1a18f6['fieldName'],'type':_0x1a18f6[_0xbc73('0x38')]['key']};});_0x30d38b[_0xbc73('0x39')]=_['map'](_0xdcac3,_0xbc73('0x3a'));_0x30d38b['query']=_['keys'](_0x29d952['query']);_0x30d38b[_0xbc73('0x3b')]=_[_0xbc73('0x3c')](_0x30d38b[_0xbc73('0x39')],_0x30d38b[_0xbc73('0x3d')]);_0x5e08f4[_0xbc73('0x3e')]=_[_0xbc73('0x3c')](_0x30d38b['model'],qs['fields'](_0x29d952[_0xbc73('0x3d')][_0xbc73('0x3f')]));_0x5e08f4[_0xbc73('0x3e')]=_0x5e08f4[_0xbc73('0x3e')][_0xbc73('0x40')]?_0x5e08f4['attributes']:_0x30d38b['model'];if(!_0x29d952['query'][_0xbc73('0x41')](_0xbc73('0x42'))){_0x5e08f4[_0xbc73('0x27')]=qs['limit'](_0x29d952['query'][_0xbc73('0x27')]);_0x5e08f4[_0xbc73('0x25')]=qs[_0xbc73('0x25')](_0x29d952['query'][_0xbc73('0x25')]);}_0x5e08f4['order']=qs[_0xbc73('0x43')](_0x29d952[_0xbc73('0x3d')]['sort']);_0x5e08f4[_0xbc73('0x44')]=qs[_0xbc73('0x3b')](_[_0xbc73('0x45')](_0x29d952[_0xbc73('0x3d')],_0x30d38b[_0xbc73('0x3b')]),_0xdcac3);if(_0x29d952[_0xbc73('0x3d')]['filter']){_0x5e08f4[_0xbc73('0x44')]=_['merge'](_0x5e08f4[_0xbc73('0x44')],{'$or':_[_0xbc73('0x35')](_0xdcac3,function(_0x356063){if(_0x356063[_0xbc73('0x38')]!==_0xbc73('0x46')){var _0x53efbb={};_0x53efbb[_0x356063[_0xbc73('0x3a')]]={'$like':'%'+_0x29d952['query'][_0xbc73('0x47')]+'%'};return _0x53efbb;}})});}_0x5e08f4=_[_0xbc73('0x48')]({},_0x5e08f4,_0x29d952[_0xbc73('0x49')]);var _0x1428f0={'where':_0x5e08f4[_0xbc73('0x44')]};return db[_0xbc73('0x36')][_0xbc73('0x28')](_0x1428f0)[_0xbc73('0x2e')](function(_0x397b2e){_0xed2d9a[_0xbc73('0x28')]=_0x397b2e;if(_0x29d952[_0xbc73('0x3d')][_0xbc73('0x4a')]){_0x5e08f4[_0xbc73('0x4b')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x5e08f4);})[_0xbc73('0x2e')](function(_0x3e634c){_0xed2d9a[_0xbc73('0x4c')]=_0x3e634c;return _0xed2d9a;})[_0xbc73('0x2e')](respondWithFilteredResult(_0x4a1e48,_0x5e08f4))[_0xbc73('0x4d')](handleError(_0x4a1e48,null));};exports[_0xbc73('0x4e')]=function(_0x2271f7,_0x41fa07){var _0x495b9b={'raw':![],'where':{'id':_0x2271f7['params']['id']}},_0xa8bdca={};_0xa8bdca[_0xbc73('0x39')]=_[_0xbc73('0x4f')](db[_0xbc73('0x36')]['rawAttributes']);_0xa8bdca[_0xbc73('0x3d')]=_[_0xbc73('0x4f')](_0x2271f7['query']);_0xa8bdca['filters']=_[_0xbc73('0x3c')](_0xa8bdca[_0xbc73('0x39')],_0xa8bdca['query']);_0x495b9b['attributes']=_[_0xbc73('0x3c')](_0xa8bdca[_0xbc73('0x39')],qs[_0xbc73('0x3f')](_0x2271f7[_0xbc73('0x3d')][_0xbc73('0x3f')]));_0x495b9b[_0xbc73('0x3e')]=_0x495b9b[_0xbc73('0x3e')][_0xbc73('0x40')]?_0x495b9b[_0xbc73('0x3e')]:_0xa8bdca[_0xbc73('0x39')];if(_0x2271f7[_0xbc73('0x3d')][_0xbc73('0x4a')]){_0x495b9b['include']=[{'all':!![]}];}_0x495b9b=_[_0xbc73('0x48')]({},_0x495b9b,_0x2271f7[_0xbc73('0x49')]);return db['SquareProject'][_0xbc73('0x50')](_0x495b9b)['then'](handleEntityNotFound(_0x41fa07,null))[_0xbc73('0x2e')](respondWithResult(_0x41fa07,null))[_0xbc73('0x4d')](handleError(_0x41fa07,null));};exports['create']=function(_0x4cf802,_0x4c46f5){return db[_0xbc73('0x36')]['create'](_0x4cf802[_0xbc73('0x51')],{})[_0xbc73('0x2e')](function(_0x32fb9e){var _0x285673=_0x4cf802['user'][_0xbc73('0x2f')]({'plain':!![]});if(!_0x285673)throw new Error(_0xbc73('0x52'));if(_0x285673[_0xbc73('0x53')]===_0xbc73('0x54')){var _0xae0666=_0x32fb9e[_0xbc73('0x2f')]({'plain':!![]});var _0x3aba7f=_0xbc73('0x55');return db['UserProfileSection'][_0xbc73('0x50')]({'where':{'name':_0x3aba7f,'userProfileId':_0x285673[_0xbc73('0x56')]},'raw':!![]})[_0xbc73('0x2e')](function(_0xd76faf){if(_0xd76faf&&_0xd76faf[_0xbc73('0x57')]===0x0){return db['UserProfileResource'][_0xbc73('0x58')]({'name':_0xae0666[_0xbc73('0x3a')],'resourceId':_0xae0666['id'],'type':_0xd76faf[_0xbc73('0x3a')],'sectionId':_0xd76faf['id']},{})[_0xbc73('0x2e')](function(){return _0x32fb9e;});}else{return _0x32fb9e;}})[_0xbc73('0x4d')](function(_0x4f7395){logger[_0xbc73('0x59')](_0xbc73('0x5a'),_0x4f7395);throw _0x4f7395;});}return _0x32fb9e;})[_0xbc73('0x2e')](respondWithResult(_0x4c46f5,0xc9))['catch'](handleError(_0x4c46f5,null));};exports[_0xbc73('0x2d')]=function(_0x1ef3a3,_0xfe8c7d){if(_0x1ef3a3['body']['id']){delete _0x1ef3a3[_0xbc73('0x51')]['id'];}return db['SquareProject'][_0xbc73('0x50')]({'where':{'id':_0x1ef3a3['params']['id']}})['then'](handleEntityNotFound(_0xfe8c7d,null))[_0xbc73('0x2e')](saveUpdates(_0x1ef3a3[_0xbc73('0x51')],null))[_0xbc73('0x2e')](respondWithResult(_0xfe8c7d,null))['catch'](handleError(_0xfe8c7d,null));};exports['destroy']=function(_0x54f217,_0x35db28){return db[_0xbc73('0x36')]['find']({'where':{'id':_0x54f217[_0xbc73('0x5b')]['id']}})['then'](handleEntityNotFound(_0x35db28,null))['then'](removeEntity(_0x35db28,null))[_0xbc73('0x4d')](handleError(_0x35db28,null));};exports['addUsers']=function(_0x3aa2ba,_0x5edde7,_0x2f7e3d){return db[_0xbc73('0x36')]['find']({'where':{'id':_0x3aa2ba[_0xbc73('0x5b')]['id']}})[_0xbc73('0x2e')](handleEntityNotFound(_0x5edde7,null))['then'](function(_0x78939e){if(_0x78939e){return _0x78939e[_0xbc73('0x5c')](_0x3aa2ba[_0xbc73('0x51')][_0xbc73('0x5d')],_[_0xbc73('0x5e')](_0x3aa2ba[_0xbc73('0x51')],['ids','id'])||{});}})['then'](respondWithResult(_0x5edde7,null))[_0xbc73('0x4d')](handleError(_0x5edde7,null));};exports[_0xbc73('0x5f')]=function(_0x1cc437,_0x479dbd,_0x4eaf8c){return db[_0xbc73('0x36')]['find']({'where':{'id':_0x1cc437[_0xbc73('0x5b')]['id']}})[_0xbc73('0x2e')](handleEntityNotFound(_0x479dbd,null))[_0xbc73('0x2e')](function(_0xc020ab){if(_0xc020ab){return _0xc020ab['removeUsers'](_0x1cc437[_0xbc73('0x3d')]['ids'])[_0xbc73('0x2e')](function(){if(_[_0xbc73('0x60')](_0x1cc437['query']['ids'])){for(var _0x4b8724=0x0;_0x4b8724<_0x1cc437[_0xbc73('0x3d')][_0xbc73('0x5d')][_0xbc73('0x40')];_0x4b8724+=0x1){socket[_0xbc73('0x61')](_0xbc73('0x62'),{'UserId':Number(_0x1cc437[_0xbc73('0x3d')][_0xbc73('0x5d')][_0x4b8724]),'SquareProjectId':Number(_0x1cc437[_0xbc73('0x5b')]['id'])});}}else{socket[_0xbc73('0x61')](_0xbc73('0x62'),{'UserId':Number(_0x1cc437[_0xbc73('0x3d')][_0xbc73('0x5d')]),'SquareProjectId':Number(_0x1cc437[_0xbc73('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x479dbd,null))['catch'](handleError(_0x479dbd,null));};exports['getUsers']=function(_0x2ca54f,_0x240071,_0x2da2be){var _0x367d6b={};var _0x44a5f3={};var _0x32e9c9;var _0x53fec1;return db['SquareProject']['findOne']({'where':{'id':_0x2ca54f[_0xbc73('0x5b')]['id']}})[_0xbc73('0x2e')](handleEntityNotFound(_0x240071,null))[_0xbc73('0x2e')](function(_0x2bf8d6){if(_0x2bf8d6){_0x32e9c9=_0x2bf8d6;_0x44a5f3[_0xbc73('0x39')]=_[_0xbc73('0x4f')](db['User'][_0xbc73('0x37')]);_0x44a5f3[_0xbc73('0x3d')]=_[_0xbc73('0x4f')](_0x2ca54f['query']);_0x44a5f3[_0xbc73('0x3b')]=_[_0xbc73('0x3c')](_0x44a5f3[_0xbc73('0x39')],_0x44a5f3[_0xbc73('0x3d')]);_0x367d6b[_0xbc73('0x3e')]=_[_0xbc73('0x3c')](_0x44a5f3['model'],qs[_0xbc73('0x3f')](_0x2ca54f['query'][_0xbc73('0x3f')]));_0x367d6b[_0xbc73('0x3e')]=_0x367d6b[_0xbc73('0x3e')][_0xbc73('0x40')]?_0x367d6b[_0xbc73('0x3e')]:_0x44a5f3[_0xbc73('0x39')];_0x367d6b[_0xbc73('0x63')]=qs[_0xbc73('0x43')](_0x2ca54f[_0xbc73('0x3d')][_0xbc73('0x43')]);_0x367d6b[_0xbc73('0x44')]=qs[_0xbc73('0x3b')](_[_0xbc73('0x45')](_0x2ca54f[_0xbc73('0x3d')],_0x44a5f3['filters']));if(_0x2ca54f['query']['filter']){_0x367d6b[_0xbc73('0x44')]=_[_0xbc73('0x48')](_0x367d6b[_0xbc73('0x44')],{'$or':_[_0xbc73('0x35')](_0x367d6b['attributes'],function(_0x270e8c){var _0x5cb648={};_0x5cb648[_0x270e8c]={'$like':'%'+_0x2ca54f[_0xbc73('0x3d')][_0xbc73('0x47')]+'%'};return _0x5cb648;})});}_0x367d6b=_[_0xbc73('0x48')]({},_0x367d6b,_0x2ca54f['options']);return _0x32e9c9[_0xbc73('0x64')](_0x367d6b);}})['then'](function(_0x5a1bb8){if(_0x5a1bb8){_0x53fec1=_0x5a1bb8[_0xbc73('0x40')];if(!_0x2ca54f[_0xbc73('0x3d')][_0xbc73('0x41')](_0xbc73('0x42'))){_0x367d6b[_0xbc73('0x27')]=qs[_0xbc73('0x27')](_0x2ca54f[_0xbc73('0x3d')][_0xbc73('0x27')]);_0x367d6b[_0xbc73('0x25')]=qs[_0xbc73('0x25')](_0x2ca54f[_0xbc73('0x3d')][_0xbc73('0x25')]);}return _0x32e9c9[_0xbc73('0x64')](_0x367d6b);}})['then'](function(_0x14e751){if(_0x14e751){return _0x14e751?{'count':_0x53fec1,'rows':_0x14e751}:null;}})[_0xbc73('0x2e')](respondWithResult(_0x240071,null))[_0xbc73('0x4d')](handleError(_0x240071,null));}; \ No newline at end of file +var _0xa468=['isArray','emit','userSquareProject:remove','findOne','User','getUsers','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','SquareProjects','UserProfileResource','end','error','name','send','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','filters','intersection','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers'];(function(_0x51a3e8,_0x3edcef){var _0x5e31da=function(_0x27b898){while(--_0x27b898){_0x51a3e8['push'](_0x51a3e8['shift']());}};_0x5e31da(++_0x3edcef);}(_0xa468,0xcf));var _0x8a46=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa468[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x8a46('0x0'));var rimraf=require(_0x8a46('0x1'));var zipdir=require(_0x8a46('0x2'));var jsonpatch=require(_0x8a46('0x3'));var rp=require(_0x8a46('0x4'));var moment=require(_0x8a46('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a46('0x6'));var util=require(_0x8a46('0x7'));var path=require(_0x8a46('0x8'));var sox=require(_0x8a46('0x9'));var csv=require(_0x8a46('0xa'));var ejs=require(_0x8a46('0xb'));var fs=require('fs');var fs_extra=require(_0x8a46('0xc'));var _=require(_0x8a46('0xd'));var squel=require('squel');var crypto=require(_0x8a46('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8a46('0xf'));var toCsv=require(_0x8a46('0xa'));var querystring=require(_0x8a46('0x10'));var Papa=require(_0x8a46('0x11'));var Redis=require(_0x8a46('0x12'));var authService=require(_0x8a46('0x13'));var qs=require(_0x8a46('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a46('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8a46('0x16'));var licenseUtil=require(_0x8a46('0x17'));var db=require(_0x8a46('0x18'))['db'];config[_0x8a46('0x19')]=_[_0x8a46('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8a46('0x1b'))(new Redis(config[_0x8a46('0x19')]));require(_0x8a46('0x1c'))[_0x8a46('0x1d')](socket);function respondWithStatusCode(_0x22ad05,_0x3b5d6f){_0x3b5d6f=_0x3b5d6f||0xcc;return function(_0x269086){if(_0x269086){return _0x22ad05[_0x8a46('0x1e')](_0x3b5d6f);}return _0x22ad05[_0x8a46('0x1f')](_0x3b5d6f)['end']();};}function respondWithResult(_0x2c3548,_0x4550b1){_0x4550b1=_0x4550b1||0xc8;return function(_0x28c520){if(_0x28c520){return _0x2c3548['status'](_0x4550b1)['json'](_0x28c520);}};}function respondWithFilteredResult(_0x4c896d,_0x98cb82){return function(_0x107a74){if(_0x107a74){var _0x3c3b93=typeof _0x98cb82[_0x8a46('0x20')]===_0x8a46('0x21')&&typeof _0x98cb82[_0x8a46('0x22')]==='undefined';var _0x3002cf=_0x107a74['count'];var _0x4a6c7b=_0x3c3b93?0x0:_0x98cb82[_0x8a46('0x20')];var _0x546b5a=_0x3c3b93?_0x107a74[_0x8a46('0x23')]:_0x98cb82[_0x8a46('0x20')]+_0x98cb82[_0x8a46('0x22')];var _0xfb9db6;if(_0x546b5a>=_0x3002cf){_0x546b5a=_0x3002cf;_0xfb9db6=0xc8;}else{_0xfb9db6=0xce;}_0x4c896d[_0x8a46('0x1f')](_0xfb9db6);return _0x4c896d[_0x8a46('0x24')]('Content-Range',_0x4a6c7b+'-'+_0x546b5a+'/'+_0x3002cf)[_0x8a46('0x25')](_0x107a74);}return null;};}function patchUpdates(_0x3a4d38){return function(_0x3d292c){try{jsonpatch[_0x8a46('0x26')](_0x3d292c,_0x3a4d38,!![]);}catch(_0x29fae2){return BPromise[_0x8a46('0x27')](_0x29fae2);}return _0x3d292c[_0x8a46('0x28')]();};}function saveUpdates(_0x381749,_0x428f28){return function(_0x462390){if(_0x462390){return _0x462390[_0x8a46('0x29')](_0x381749)['then'](function(_0x1c55fb){return _0x1c55fb;});}return null;};}function removeEntity(_0x111b15,_0x1ac564){return function(_0x519aac){if(_0x519aac){return _0x519aac[_0x8a46('0x2a')]()[_0x8a46('0x2b')](function(){var _0x2badda=_0x519aac['get']({'plain':!![]});var _0x50c20c=_0x8a46('0x2c');return db[_0x8a46('0x2d')][_0x8a46('0x2a')]({'where':{'type':_0x50c20c,'resourceId':_0x2badda['id']}})[_0x8a46('0x2b')](function(){return _0x519aac;});})[_0x8a46('0x2b')](function(){_0x111b15[_0x8a46('0x1f')](0xcc)[_0x8a46('0x2e')]();});}};}function handleEntityNotFound(_0x3a0e11,_0x2bccd0){return function(_0x37272c){if(!_0x37272c){_0x3a0e11[_0x8a46('0x1e')](0x194);}return _0x37272c;};}function handleError(_0x5cd873,_0x464df7){_0x464df7=_0x464df7||0x1f4;return function(_0x18daa3){logger[_0x8a46('0x2f')](_0x18daa3['stack']);if(_0x18daa3[_0x8a46('0x30')]){delete _0x18daa3['name'];}_0x5cd873[_0x8a46('0x1f')](_0x464df7)[_0x8a46('0x31')](_0x18daa3);};}exports['index']=function(_0x531e5c,_0x220a2b){var _0x47d431={},_0x18e907={},_0x42307b={'count':0x0,'rows':[]};var _0x5c479f=_[_0x8a46('0x32')](db[_0x8a46('0x33')][_0x8a46('0x34')],function(_0xd1c95f){return{'name':_0xd1c95f[_0x8a46('0x35')],'type':_0xd1c95f['type'][_0x8a46('0x36')]};});_0x18e907[_0x8a46('0x37')]=_[_0x8a46('0x32')](_0x5c479f,_0x8a46('0x30'));_0x18e907[_0x8a46('0x38')]=_[_0x8a46('0x39')](_0x531e5c[_0x8a46('0x38')]);_0x18e907['filters']=_['intersection'](_0x18e907[_0x8a46('0x37')],_0x18e907[_0x8a46('0x38')]);_0x47d431[_0x8a46('0x3a')]=_['intersection'](_0x18e907[_0x8a46('0x37')],qs[_0x8a46('0x3b')](_0x531e5c['query'][_0x8a46('0x3b')]));_0x47d431[_0x8a46('0x3a')]=_0x47d431['attributes'][_0x8a46('0x3c')]?_0x47d431[_0x8a46('0x3a')]:_0x18e907[_0x8a46('0x37')];if(!_0x531e5c[_0x8a46('0x38')]['hasOwnProperty'](_0x8a46('0x3d'))){_0x47d431[_0x8a46('0x22')]=qs[_0x8a46('0x22')](_0x531e5c[_0x8a46('0x38')][_0x8a46('0x22')]);_0x47d431[_0x8a46('0x20')]=qs['offset'](_0x531e5c[_0x8a46('0x38')][_0x8a46('0x20')]);}_0x47d431[_0x8a46('0x3e')]=qs['sort'](_0x531e5c[_0x8a46('0x38')][_0x8a46('0x3f')]);_0x47d431[_0x8a46('0x40')]=qs['filters'](_[_0x8a46('0x41')](_0x531e5c['query'],_0x18e907['filters']),_0x5c479f);if(_0x531e5c['query'][_0x8a46('0x42')]){_0x47d431[_0x8a46('0x40')]=_[_0x8a46('0x43')](_0x47d431[_0x8a46('0x40')],{'$or':_[_0x8a46('0x32')](_0x5c479f,function(_0x1fd64e){if(_0x1fd64e[_0x8a46('0x44')]!==_0x8a46('0x45')){var _0x23b2a7={};_0x23b2a7[_0x1fd64e[_0x8a46('0x30')]]={'$like':'%'+_0x531e5c['query'][_0x8a46('0x42')]+'%'};return _0x23b2a7;}})});}_0x47d431=_[_0x8a46('0x43')]({},_0x47d431,_0x531e5c[_0x8a46('0x46')]);var _0x49d13f={'where':_0x47d431[_0x8a46('0x40')]};return db[_0x8a46('0x33')][_0x8a46('0x23')](_0x49d13f)[_0x8a46('0x2b')](function(_0xdddd3c){_0x42307b[_0x8a46('0x23')]=_0xdddd3c;if(_0x531e5c[_0x8a46('0x38')][_0x8a46('0x47')]){_0x47d431[_0x8a46('0x48')]=[{'all':!![]}];}return db[_0x8a46('0x33')][_0x8a46('0x49')](_0x47d431);})[_0x8a46('0x2b')](function(_0x380c0b){_0x42307b[_0x8a46('0x4a')]=_0x380c0b;return _0x42307b;})['then'](respondWithFilteredResult(_0x220a2b,_0x47d431))[_0x8a46('0x4b')](handleError(_0x220a2b,null));};exports[_0x8a46('0x4c')]=function(_0x1e00e1,_0x4baabf){var _0x407c78={'raw':![],'where':{'id':_0x1e00e1[_0x8a46('0x4d')]['id']}},_0x19ca1c={};_0x19ca1c[_0x8a46('0x37')]=_['keys'](db[_0x8a46('0x33')][_0x8a46('0x34')]);_0x19ca1c[_0x8a46('0x38')]=_[_0x8a46('0x39')](_0x1e00e1[_0x8a46('0x38')]);_0x19ca1c[_0x8a46('0x4e')]=_[_0x8a46('0x4f')](_0x19ca1c[_0x8a46('0x37')],_0x19ca1c[_0x8a46('0x38')]);_0x407c78[_0x8a46('0x3a')]=_['intersection'](_0x19ca1c[_0x8a46('0x37')],qs['fields'](_0x1e00e1[_0x8a46('0x38')]['fields']));_0x407c78[_0x8a46('0x3a')]=_0x407c78[_0x8a46('0x3a')][_0x8a46('0x3c')]?_0x407c78[_0x8a46('0x3a')]:_0x19ca1c[_0x8a46('0x37')];if(_0x1e00e1[_0x8a46('0x38')][_0x8a46('0x47')]){_0x407c78[_0x8a46('0x48')]=[{'all':!![]}];}_0x407c78=_[_0x8a46('0x43')]({},_0x407c78,_0x1e00e1[_0x8a46('0x46')]);return db[_0x8a46('0x33')][_0x8a46('0x50')](_0x407c78)['then'](handleEntityNotFound(_0x4baabf,null))[_0x8a46('0x2b')](respondWithResult(_0x4baabf,null))[_0x8a46('0x4b')](handleError(_0x4baabf,null));};exports[_0x8a46('0x51')]=function(_0x208616,_0x3a9793){return db[_0x8a46('0x33')]['create'](_0x208616[_0x8a46('0x52')],{})['then'](function(_0x16f244){var _0x26ffe5=_0x208616[_0x8a46('0x53')][_0x8a46('0x54')]({'plain':!![]});if(!_0x26ffe5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ffe5[_0x8a46('0x55')]===_0x8a46('0x53')){var _0x38cc16=_0x16f244['get']({'plain':!![]});var _0x52c77f=_0x8a46('0x2c');return db[_0x8a46('0x56')][_0x8a46('0x50')]({'where':{'name':_0x52c77f,'userProfileId':_0x26ffe5[_0x8a46('0x57')]},'raw':!![]})['then'](function(_0xa11ca3){if(_0xa11ca3&&_0xa11ca3[_0x8a46('0x58')]===0x0){return db['UserProfileResource'][_0x8a46('0x51')]({'name':_0x38cc16[_0x8a46('0x30')],'resourceId':_0x38cc16['id'],'type':_0xa11ca3[_0x8a46('0x30')],'sectionId':_0xa11ca3['id']},{})['then'](function(){return _0x16f244;});}else{return _0x16f244;}})['catch'](function(_0x46bee3){logger[_0x8a46('0x2f')](_0x8a46('0x59'),_0x46bee3);throw _0x46bee3;});}return _0x16f244;})[_0x8a46('0x2b')](respondWithResult(_0x3a9793,0xc9))['catch'](handleError(_0x3a9793,null));};exports[_0x8a46('0x29')]=function(_0x3f384e,_0x18fe76){if(_0x3f384e[_0x8a46('0x52')]['id']){delete _0x3f384e[_0x8a46('0x52')]['id'];}return db[_0x8a46('0x33')][_0x8a46('0x50')]({'where':{'id':_0x3f384e[_0x8a46('0x4d')]['id']}})['then'](handleEntityNotFound(_0x18fe76,null))['then'](saveUpdates(_0x3f384e[_0x8a46('0x52')],null))['then'](respondWithResult(_0x18fe76,null))[_0x8a46('0x4b')](handleError(_0x18fe76,null));};exports[_0x8a46('0x2a')]=function(_0x588ff9,_0x147ffc){return db[_0x8a46('0x33')]['find']({'where':{'id':_0x588ff9[_0x8a46('0x4d')]['id']}})[_0x8a46('0x2b')](handleEntityNotFound(_0x147ffc,null))[_0x8a46('0x2b')](removeEntity(_0x147ffc,null))[_0x8a46('0x4b')](handleError(_0x147ffc,null));};exports['addUsers']=function(_0x3c721c,_0x3d40f0,_0x50afe8){return db[_0x8a46('0x33')]['find']({'where':{'id':_0x3c721c[_0x8a46('0x4d')]['id']}})[_0x8a46('0x2b')](handleEntityNotFound(_0x3d40f0,null))['then'](function(_0x59d7fe){if(_0x59d7fe){return _0x59d7fe[_0x8a46('0x5a')](_0x3c721c[_0x8a46('0x52')][_0x8a46('0x5b')],_['omit'](_0x3c721c[_0x8a46('0x52')],[_0x8a46('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x3d40f0,null))[_0x8a46('0x4b')](handleError(_0x3d40f0,null));};exports[_0x8a46('0x5c')]=function(_0x4c4d26,_0x45f976,_0x2b7018){return db[_0x8a46('0x33')]['find']({'where':{'id':_0x4c4d26[_0x8a46('0x4d')]['id']}})[_0x8a46('0x2b')](handleEntityNotFound(_0x45f976,null))[_0x8a46('0x2b')](function(_0x199e7e){if(_0x199e7e){return _0x199e7e['removeUsers'](_0x4c4d26[_0x8a46('0x38')][_0x8a46('0x5b')])['then'](function(){if(_[_0x8a46('0x5d')](_0x4c4d26['query'][_0x8a46('0x5b')])){for(var _0x2f58ed=0x0;_0x2f58ed<_0x4c4d26[_0x8a46('0x38')][_0x8a46('0x5b')][_0x8a46('0x3c')];_0x2f58ed+=0x1){socket[_0x8a46('0x5e')]('userSquareProject:remove',{'UserId':Number(_0x4c4d26[_0x8a46('0x38')][_0x8a46('0x5b')][_0x2f58ed]),'SquareProjectId':Number(_0x4c4d26[_0x8a46('0x4d')]['id'])});}}else{socket[_0x8a46('0x5e')](_0x8a46('0x5f'),{'UserId':Number(_0x4c4d26[_0x8a46('0x38')][_0x8a46('0x5b')]),'SquareProjectId':Number(_0x4c4d26[_0x8a46('0x4d')]['id'])});}});}})[_0x8a46('0x2b')](respondWithStatusCode(_0x45f976,null))['catch'](handleError(_0x45f976,null));};exports['getUsers']=function(_0x3810f7,_0x3123ad,_0x509da7){var _0x22b9d5={};var _0x363382={};var _0x18760a;var _0x2c931c;return db[_0x8a46('0x33')][_0x8a46('0x60')]({'where':{'id':_0x3810f7['params']['id']}})[_0x8a46('0x2b')](handleEntityNotFound(_0x3123ad,null))[_0x8a46('0x2b')](function(_0x81242c){if(_0x81242c){_0x18760a=_0x81242c;_0x363382[_0x8a46('0x37')]=_[_0x8a46('0x39')](db[_0x8a46('0x61')][_0x8a46('0x34')]);_0x363382[_0x8a46('0x38')]=_[_0x8a46('0x39')](_0x3810f7[_0x8a46('0x38')]);_0x363382[_0x8a46('0x4e')]=_[_0x8a46('0x4f')](_0x363382[_0x8a46('0x37')],_0x363382[_0x8a46('0x38')]);_0x22b9d5['attributes']=_[_0x8a46('0x4f')](_0x363382[_0x8a46('0x37')],qs[_0x8a46('0x3b')](_0x3810f7[_0x8a46('0x38')][_0x8a46('0x3b')]));_0x22b9d5[_0x8a46('0x3a')]=_0x22b9d5['attributes'][_0x8a46('0x3c')]?_0x22b9d5['attributes']:_0x363382['model'];_0x22b9d5[_0x8a46('0x3e')]=qs[_0x8a46('0x3f')](_0x3810f7[_0x8a46('0x38')][_0x8a46('0x3f')]);_0x22b9d5['where']=qs['filters'](_['pick'](_0x3810f7[_0x8a46('0x38')],_0x363382[_0x8a46('0x4e')]));if(_0x3810f7[_0x8a46('0x38')]['filter']){_0x22b9d5[_0x8a46('0x40')]=_[_0x8a46('0x43')](_0x22b9d5[_0x8a46('0x40')],{'$or':_[_0x8a46('0x32')](_0x22b9d5[_0x8a46('0x3a')],function(_0x25a636){var _0x2922c8={};_0x2922c8[_0x25a636]={'$like':'%'+_0x3810f7[_0x8a46('0x38')][_0x8a46('0x42')]+'%'};return _0x2922c8;})});}_0x22b9d5=_[_0x8a46('0x43')]({},_0x22b9d5,_0x3810f7['options']);return _0x18760a[_0x8a46('0x62')](_0x22b9d5);}})['then'](function(_0x357e68){if(_0x357e68){_0x2c931c=_0x357e68[_0x8a46('0x3c')];if(!_0x3810f7[_0x8a46('0x38')][_0x8a46('0x63')](_0x8a46('0x3d'))){_0x22b9d5[_0x8a46('0x22')]=qs[_0x8a46('0x22')](_0x3810f7[_0x8a46('0x38')][_0x8a46('0x22')]);_0x22b9d5['offset']=qs[_0x8a46('0x20')](_0x3810f7['query'][_0x8a46('0x20')]);}return _0x18760a[_0x8a46('0x62')](_0x22b9d5);}})['then'](function(_0x4c248a){if(_0x4c248a){return _0x4c248a?{'count':_0x2c931c,'rows':_0x4c248a}:null;}})[_0x8a46('0x2b')](respondWithResult(_0x3123ad,null))[_0x8a46('0x4b')](handleError(_0x3123ad,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 58e9543..9fbd69b 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 _0x1184=['emit','hasOwnProperty','exports','../../mysqldb','SquareProject','setMaxListeners','remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1184,0x18b));var _0x4118=function(_0x468991,_0x7582ea){_0x468991=_0x468991-0x0;var _0x3d11bc=_0x1184[_0x468991];return _0x3d11bc;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x4118('0x0'))['db'][_0x4118('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x4118('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4118('0x3')};function emitEvent(_0x34ae1a){return function(_0x51b52c,_0x15e1cc,_0xed9e0a){SquareProjectEvents[_0x4118('0x4')](_0x34ae1a+':'+_0x51b52c['id'],_0x51b52c);SquareProjectEvents['emit'](_0x34ae1a,_0x51b52c);_0xed9e0a(null);};}for(var e in events){if(events[_0x4118('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x4118('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x4cad=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4cad,0x17b));var _0xd4ca=function(_0x43a4a0,_0x4f9fbb){_0x43a4a0=_0x43a4a0-0x0;var _0x319384=_0x4cad[_0x43a4a0];return _0x319384;};'use strict';var EventEmitter=require(_0xd4ca('0x0'));var SquareProject=require(_0xd4ca('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd4ca('0x2')](0x0);var events={'afterCreate':_0xd4ca('0x3'),'afterUpdate':_0xd4ca('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ceaad){return function(_0x1abd3c,_0x2f40b3,_0x1d039a){SquareProjectEvents['emit'](_0x5ceaad+':'+_0x1abd3c['id'],_0x1abd3c);SquareProjectEvents[_0xd4ca('0x5')](_0x5ceaad,_0x1abd3c);_0x1d039a(null);};}for(var e in events){if(events[_0xd4ca('0x6')](e)){var event=events[e];SquareProject[_0xd4ca('0x7')](e,emitEvent(event));}}module[_0xd4ca('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 9ed9419..8ed35da 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 _0x1161=['YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','savedAt','format'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x1161,0x156));var _0x1116=function(_0x981481,_0x24761b){_0x981481=_0x981481-0x0;var _0x3396b6=_0x1161[_0x981481];return _0x3396b6;};'use strict';var _=require(_0x1116('0x0'));var util=require(_0x1116('0x1'));var logger=require(_0x1116('0x2'))(_0x1116('0x3'));var moment=require('moment');var BPromise=require(_0x1116('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1116('0x5'));var rimraf=require(_0x1116('0x6'));var config=require(_0x1116('0x7'));var attributes=require('./squareProject.attributes');module[_0x1116('0x8')]=function(_0x3ad997,_0x4dc6b6){return _0x3ad997[_0x1116('0x9')](_0x1116('0xa'),attributes,{'tableName':_0x1116('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ca04c,_0x492708,_0x3a53d3){if(_0x2ca04c[_0x1116('0xc')]('preproduction')){_0x2ca04c[_0x1116('0xd')]=moment()[_0x1116('0xe')](_0x1116('0xf'));}if(_0x2ca04c[_0x1116('0xc')](_0x1116('0x10'))){_0x2ca04c['publishedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3a53d3(null,_0x2ca04c);}}});}; \ No newline at end of file +var _0x6ca6=['changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./squareProject.attributes','exports','define','SquareProject'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x6ca6,0x17c));var _0x66ca=function(_0x40464e,_0x2b058d){_0x40464e=_0x40464e-0x0;var _0x1324c3=_0x6ca6[_0x40464e];return _0x1324c3;};'use strict';var _=require(_0x66ca('0x0'));var util=require('util');var logger=require(_0x66ca('0x1'))(_0x66ca('0x2'));var moment=require('moment');var BPromise=require(_0x66ca('0x3'));var rp=require(_0x66ca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66ca('0x5'));var config=require('../../config/environment');var attributes=require(_0x66ca('0x6'));module[_0x66ca('0x7')]=function(_0x2b09c9,_0x512d3c){return _0x2b09c9[_0x66ca('0x8')](_0x66ca('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3699b4,_0x33bf22,_0x5296df){if(_0x3699b4[_0x66ca('0xa')](_0x66ca('0xb'))){_0x3699b4[_0x66ca('0xc')]=moment()[_0x66ca('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3699b4[_0x66ca('0xa')]('production')){_0x3699b4['publishedAt']=moment()['format'](_0x66ca('0xe'));}_0x5296df(null,_0x3699b4);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 9fb332d..bf6a334 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 _0x44b2=['register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x55257c,_0x477f57){var _0x585906=function(_0x2a6cac){while(--_0x2a6cac){_0x55257c['push'](_0x55257c['shift']());}};_0x585906(++_0x477f57);}(_0x44b2,0x192));var _0x244b=function(_0x4bc95e,_0x1b645a){_0x4bc95e=_0x4bc95e-0x0;var _0x4c3419=_0x44b2[_0x4bc95e];return _0x4c3419;};'use strict';var _=require(_0x244b('0x0'));var util=require(_0x244b('0x1'));var moment=require('moment');var BPromise=require(_0x244b('0x2'));var rs=require(_0x244b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x244b('0x4'))['db'];var utils=require(_0x244b('0x5'));var logger=require('../../config/logger')(_0x244b('0x6'));var config=require(_0x244b('0x7'));var jayson=require(_0x244b('0x8'));var client=jayson[_0x244b('0x9')][_0x244b('0xa')]({'port':0x232a});config[_0x244b('0xb')]=_[_0x244b('0xc')](config[_0x244b('0xb')],{'host':_0x244b('0xd'),'port':0x18eb});var socket=require(_0x244b('0xe'))(new Redis(config[_0x244b('0xb')]));require(_0x244b('0xf'))[_0x244b('0x10')](socket);function respondWithRpcPromise(_0x343f42,_0x9ab47f,_0x382fb3){return new BPromise(function(_0x4cbe00,_0x37fc7c){return client['request'](_0x343f42,_0x382fb3)[_0x244b('0x11')](function(_0x42ccae){logger[_0x244b('0x12')](_0x244b('0x13'),_0x9ab47f,_0x244b('0x14'));logger['debug'](_0x244b('0x15'),_0x9ab47f,'request\x20sent',JSON[_0x244b('0x16')](_0x42ccae));if(_0x42ccae[_0x244b('0x17')]){if(_0x42ccae[_0x244b('0x17')][_0x244b('0x18')]===0x1f4){logger['error'](_0x244b('0x13'),_0x9ab47f,_0x42ccae[_0x244b('0x17')][_0x244b('0x19')]);return _0x37fc7c(_0x42ccae[_0x244b('0x17')][_0x244b('0x19')]);}logger['error'](_0x244b('0x13'),_0x9ab47f,_0x42ccae[_0x244b('0x17')][_0x244b('0x19')]);return _0x4cbe00(_0x42ccae[_0x244b('0x17')][_0x244b('0x19')]);}else{logger['info'](_0x244b('0x13'),_0x9ab47f,_0x244b('0x14'));_0x4cbe00(_0x42ccae[_0x244b('0x1a')][_0x244b('0x19')]);}})[_0x244b('0x1b')](function(_0x1e2da4){logger[_0x244b('0x17')](_0x244b('0x13'),_0x9ab47f,_0x1e2da4);_0x37fc7c(_0x1e2da4);});});}exports[_0x244b('0x1c')]=function(_0x1c37c1){var _0x5b2286=this;return new Promise(function(_0x42e3d7,_0x4ab84f){return db[_0x244b('0x1d')][_0x244b('0x1e')]({'raw':_0x1c37c1['options']?_0x1c37c1[_0x244b('0x1f')][_0x244b('0x20')]===undefined?!![]:![]:!![],'where':_0x1c37c1[_0x244b('0x1f')]?_0x1c37c1[_0x244b('0x1f')][_0x244b('0x21')]||null:null,'attributes':_0x1c37c1[_0x244b('0x1f')]?_0x1c37c1[_0x244b('0x1f')][_0x244b('0x22')]||null:null,'include':_0x1c37c1[_0x244b('0x1f')]?_0x1c37c1['options'][_0x244b('0x23')]?_[_0x244b('0x24')](_0x1c37c1['options'][_0x244b('0x23')],function(_0x376774){return{'model':db[_0x376774[_0x244b('0x25')]],'as':_0x376774['as'],'attributes':_0x376774[_0x244b('0x22')],'include':_0x376774['include']?_['map'](_0x376774[_0x244b('0x23')],function(_0x179b6e){return{'model':db[_0x179b6e[_0x244b('0x25')]],'as':_0x179b6e['as'],'attributes':_0x179b6e[_0x244b('0x22')],'include':_0x179b6e[_0x244b('0x23')]?_['map'](_0x179b6e[_0x244b('0x23')],function(_0x5db790){return{'model':db[_0x5db790[_0x244b('0x25')]],'as':_0x5db790['as'],'attributes':_0x5db790['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x829a71){logger[_0x244b('0x12')](_0x244b('0x1c'),_0x1c37c1);logger['debug'](_0x244b('0x1c'),_0x1c37c1,JSON[_0x244b('0x16')](_0x829a71));_0x42e3d7(_0x829a71);})[_0x244b('0x1b')](function(_0x136a9a){logger[_0x244b('0x17')](_0x244b('0x1c'),_0x136a9a[_0x244b('0x19')],_0x1c37c1);_0x4ab84f(_0x5b2286[_0x244b('0x17')](0x1f4,_0x136a9a[_0x244b('0x19')]));});});}; \ No newline at end of file +var _0xd1d2=['debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','map','include','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xd1d2,0xda));var _0x2d1d=function(_0x5bcadb,_0x35270a){_0x5bcadb=_0x5bcadb-0x0;var _0x501049=_0xd1d2[_0x5bcadb];return _0x501049;};'use strict';var _=require(_0x2d1d('0x0'));var util=require(_0x2d1d('0x1'));var moment=require('moment');var BPromise=require(_0x2d1d('0x2'));var rs=require(_0x2d1d('0x3'));var fs=require('fs');var Redis=require(_0x2d1d('0x4'));var db=require(_0x2d1d('0x5'))['db'];var utils=require(_0x2d1d('0x6'));var logger=require('../../config/logger')(_0x2d1d('0x7'));var config=require(_0x2d1d('0x8'));var jayson=require(_0x2d1d('0x9'));var client=jayson[_0x2d1d('0xa')][_0x2d1d('0xb')]({'port':0x232a});config[_0x2d1d('0xc')]=_[_0x2d1d('0xd')](config[_0x2d1d('0xc')],{'host':_0x2d1d('0xe'),'port':0x18eb});var socket=require(_0x2d1d('0xf'))(new Redis(config[_0x2d1d('0xc')]));require(_0x2d1d('0x10'))[_0x2d1d('0x11')](socket);function respondWithRpcPromise(_0x1ee243,_0x534317,_0x245875){return new BPromise(function(_0x565a39,_0x50a171){return client[_0x2d1d('0x12')](_0x1ee243,_0x245875)['then'](function(_0x2a660a){logger[_0x2d1d('0x13')](_0x2d1d('0x14'),_0x534317,_0x2d1d('0x15'));logger[_0x2d1d('0x16')](_0x2d1d('0x17'),_0x534317,_0x2d1d('0x15'),JSON[_0x2d1d('0x18')](_0x2a660a));if(_0x2a660a['error']){if(_0x2a660a[_0x2d1d('0x19')][_0x2d1d('0x1a')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x534317,_0x2a660a[_0x2d1d('0x19')][_0x2d1d('0x1b')]);return _0x50a171(_0x2a660a[_0x2d1d('0x19')][_0x2d1d('0x1b')]);}logger[_0x2d1d('0x19')]('SquareProject,\x20%s,\x20%s',_0x534317,_0x2a660a['error'][_0x2d1d('0x1b')]);return _0x565a39(_0x2a660a['error']['message']);}else{logger['info'](_0x2d1d('0x14'),_0x534317,'request\x20sent');_0x565a39(_0x2a660a[_0x2d1d('0x1c')][_0x2d1d('0x1b')]);}})[_0x2d1d('0x1d')](function(_0x301f82){logger[_0x2d1d('0x19')](_0x2d1d('0x14'),_0x534317,_0x301f82);_0x50a171(_0x301f82);});});}exports[_0x2d1d('0x1e')]=function(_0x3a4948){var _0x1e5671=this;return new Promise(function(_0x3a7eb3,_0x15c2e3){return db[_0x2d1d('0x1f')][_0x2d1d('0x20')]({'raw':_0x3a4948[_0x2d1d('0x21')]?_0x3a4948[_0x2d1d('0x21')][_0x2d1d('0x22')]===undefined?!![]:![]:!![],'where':_0x3a4948[_0x2d1d('0x21')]?_0x3a4948[_0x2d1d('0x21')][_0x2d1d('0x23')]||null:null,'attributes':_0x3a4948['options']?_0x3a4948[_0x2d1d('0x21')][_0x2d1d('0x24')]||null:null,'include':_0x3a4948[_0x2d1d('0x21')]?_0x3a4948[_0x2d1d('0x21')]['include']?_[_0x2d1d('0x25')](_0x3a4948['options'][_0x2d1d('0x26')],function(_0x2a5903){return{'model':db[_0x2a5903[_0x2d1d('0x27')]],'as':_0x2a5903['as'],'attributes':_0x2a5903['attributes'],'include':_0x2a5903[_0x2d1d('0x26')]?_['map'](_0x2a5903[_0x2d1d('0x26')],function(_0xd35bf3){return{'model':db[_0xd35bf3[_0x2d1d('0x27')]],'as':_0xd35bf3['as'],'attributes':_0xd35bf3[_0x2d1d('0x24')],'include':_0xd35bf3['include']?_['map'](_0xd35bf3[_0x2d1d('0x26')],function(_0x2b92a6){return{'model':db[_0x2b92a6[_0x2d1d('0x27')]],'as':_0x2b92a6['as'],'attributes':_0x2b92a6[_0x2d1d('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b8b1f){logger[_0x2d1d('0x13')](_0x2d1d('0x1e'),_0x3a4948);logger[_0x2d1d('0x16')](_0x2d1d('0x1e'),_0x3a4948,JSON[_0x2d1d('0x18')](_0x3b8b1f));_0x3a7eb3(_0x3b8b1f);})['catch'](function(_0x418817){logger[_0x2d1d('0x19')](_0x2d1d('0x1e'),_0x418817[_0x2d1d('0x1b')],_0x3a4948);_0x15c2e3(_0x1e5671[_0x2d1d('0x19')](0x1f4,_0x418817['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index f0f654f..693235a 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 _0xc3b9=['./squareProject.events','save','remove','emit','removeListener','register','length','squareProject:'];(function(_0x526168,_0x414b29){var _0x2b5b60=function(_0x1310f3){while(--_0x1310f3){_0x526168['push'](_0x526168['shift']());}};_0x2b5b60(++_0x414b29);}(_0xc3b9,0xb8));var _0x9c3b=function(_0x972692,_0x2a1c56){_0x972692=_0x972692-0x0;var _0x542e84=_0xc3b9[_0x972692];return _0x542e84;};'use strict';var SquareProjectEvents=require(_0x9c3b('0x0'));var events=[_0x9c3b('0x1'),_0x9c3b('0x2'),'update'];function createListener(_0x1dbd78,_0x73d93c){return function(_0x36040a){_0x73d93c[_0x9c3b('0x3')](_0x1dbd78,_0x36040a);};}function removeListener(_0x11a995,_0x17d761){return function(){SquareProjectEvents[_0x9c3b('0x4')](_0x11a995,_0x17d761);};}exports[_0x9c3b('0x5')]=function(_0x2af742){for(var _0x241a34=0x0,_0xd0b4a8=events[_0x9c3b('0x6')];_0x241a34<_0xd0b4a8;_0x241a34++){var _0x3df7ca=events[_0x241a34];var _0x392073=createListener(_0x9c3b('0x7')+_0x3df7ca,_0x2af742);SquareProjectEvents['on'](_0x3df7ca,_0x392073);}}; \ No newline at end of file +var _0x7a08=['removeListener','register','remove','update'];(function(_0x2be6fb,_0x459db9){var _0x5074d7=function(_0x4272a7){while(--_0x4272a7){_0x2be6fb['push'](_0x2be6fb['shift']());}};_0x5074d7(++_0x459db9);}(_0x7a08,0xb6));var _0x87a0=function(_0x214d54,_0x133c72){_0x214d54=_0x214d54-0x0;var _0x44ca46=_0x7a08[_0x214d54];return _0x44ca46;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x87a0('0x0'),_0x87a0('0x1')];function createListener(_0x4b10e2,_0x59e218){return function(_0xcaf32c){_0x59e218['emit'](_0x4b10e2,_0xcaf32c);};}function removeListener(_0xbaf885,_0x2c9d83){return function(){SquareProjectEvents[_0x87a0('0x2')](_0xbaf885,_0x2c9d83);};}exports[_0x87a0('0x3')]=function(_0x41d41e){for(var _0x426ff8=0x0,_0x10edd7=events['length'];_0x426ff8<_0x10edd7;_0x426ff8++){var _0x331d48=events[_0x426ff8];var _0x5ad137=createListener('squareProject:'+_0x331d48,_0x41d41e);SquareProjectEvents['on'](_0x331d48,_0x5ad137);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 014b72a..80673e3 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 _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(_0x585eca,_0x263a04){var _0x189d9a=function(_0x247dcc){while(--_0x247dcc){_0x585eca['push'](_0x585eca['shift']());}};_0x189d9a(++_0x263a04);}(_0x814b,0x1a2));var _0xb814=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x814b[_0x4fbb86];return _0xb141fe;};'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 +var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0xede999,_0x587177){var _0x3537ca=function(_0x374417){while(--_0x374417){_0xede999['push'](_0xede999['shift']());}};_0x3537ca(++_0x587177);}(_0x1261,0x144));var _0x1126=function(_0x332c1b,_0x28d711){_0x332c1b=_0x332c1b-0x0;var _0x21b49b=_0x1261[_0x332c1b];return _0x21b49b;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 0abf15d..b50e71f 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 _0x7da7=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7da7,0x10d));var _0x77da=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x7da7[_0x5cab28];return _0xa3554d;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'uniqueid':{'type':Sequelize[_0x77da('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x77da('0x2')]},'extension':{'type':Sequelize[_0x77da('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x77da('0x2')]},'dnid':{'type':Sequelize[_0x77da('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x77da('0x2')]},'filename':{'type':Sequelize[_0x77da('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x77da('0x3')],'get':function(){var _0x47cf1d='';var _0x1191de=this[_0x77da('0x4')](_0x77da('0x5'));if(_0x1191de){_0x47cf1d=_0x1191de[_0x77da('0x6')](_0x1191de[_0x77da('0x7')]('.'));}return _0x47cf1d;}}}; \ No newline at end of file +var _0x7217=['lastIndexOf','sequelize','STRING','VIRTUAL','getDataValue','savePath','substring'];(function(_0x46d367,_0x1d1fac){var _0x197ed5=function(_0x129e35){while(--_0x129e35){_0x46d367['push'](_0x46d367['shift']());}};_0x197ed5(++_0x1d1fac);}(_0x7217,0x19e));var _0x7721=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7217[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'callerid':{'type':Sequelize[_0x7721('0x1')]},'calleridname':{'type':Sequelize[_0x7721('0x1')]},'context':{'type':Sequelize[_0x7721('0x1')]},'extension':{'type':Sequelize[_0x7721('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7721('0x1')]},'projectName':{'type':Sequelize[_0x7721('0x1')]},'saveName':{'type':Sequelize[_0x7721('0x1')]},'filename':{'type':Sequelize[_0x7721('0x1')]},'savePath':{'type':Sequelize[_0x7721('0x1')]},'format':{'type':Sequelize[_0x7721('0x2')],'get':function(){var _0x18ab6b='';var _0x21f680=this[_0x7721('0x3')](_0x7721('0x4'));if(_0x21f680){_0x18ab6b=_0x21f680[_0x7721('0x5')](_0x21f680[_0x7721('0x6')]('.'));}return _0x18ab6b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 483752b..d56c67b 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 _0x0e6c=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','show','params','intersection','catch','create','body','find','uniqueid','filename','format','existsSync','decryptFile','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','download','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','fast-json-patch','moment','bluebird'];(function(_0x316f6a,_0x1d27ff){var _0x26948a=function(_0x2a35ab){while(--_0x2a35ab){_0x316f6a['push'](_0x316f6a['shift']());}};_0x26948a(++_0x1d27ff);}(_0x0e6c,0x17c));var _0xc0e6=function(_0x3ec988,_0x230f02){_0x3ec988=_0x3ec988-0x0;var _0x2cd1ba=_0x0e6c[_0x3ec988];return _0x2cd1ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc0e6('0x1'));var rp=require('request-promise');var moment=require(_0xc0e6('0x2'));var BPromise=require(_0xc0e6('0x3'));var Mustache=require(_0xc0e6('0x4'));var util=require(_0xc0e6('0x5'));var path=require(_0xc0e6('0x6'));var sox=require('sox');var csv=require(_0xc0e6('0x7'));var ejs=require(_0xc0e6('0x8'));var fs=require('fs');var fs_extra=require(_0xc0e6('0x9'));var _=require(_0xc0e6('0xa'));var squel=require(_0xc0e6('0xb'));var crypto=require(_0xc0e6('0xc'));var jsforce=require(_0xc0e6('0xd'));var deskjs=require(_0xc0e6('0xe'));var toCsv=require(_0xc0e6('0x7'));var querystring=require(_0xc0e6('0xf'));var Papa=require('papaparse');var Redis=require(_0xc0e6('0x10'));var authService=require(_0xc0e6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc0e6('0x12'));var hardwareService=require(_0xc0e6('0x13'));var logger=require(_0xc0e6('0x14'))('api');var utils=require(_0xc0e6('0x15'));var config=require(_0xc0e6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0e6('0x17'))['db'];function respondWithStatusCode(_0x52f2a1,_0x5e3710){_0x5e3710=_0x5e3710||0xcc;return function(_0x1e8e59){if(_0x1e8e59){return _0x52f2a1[_0xc0e6('0x18')](_0x5e3710);}return _0x52f2a1[_0xc0e6('0x19')](_0x5e3710)[_0xc0e6('0x1a')]();};}function respondWithResult(_0x38b627,_0x2debdd){_0x2debdd=_0x2debdd||0xc8;return function(_0xe560b2){if(_0xe560b2){return _0x38b627[_0xc0e6('0x19')](_0x2debdd)[_0xc0e6('0x1b')](_0xe560b2);}};}function respondWithFilteredResult(_0x3fc32d,_0xce878e){return function(_0x548366){if(_0x548366){var _0x51cabe=typeof _0xce878e[_0xc0e6('0x1c')]===_0xc0e6('0x1d')&&typeof _0xce878e[_0xc0e6('0x1e')]==='undefined';var _0x33a5d5=_0x548366[_0xc0e6('0x1f')];var _0x38b261=_0x51cabe?0x0:_0xce878e[_0xc0e6('0x1c')];var _0xfbd1eb=_0x51cabe?_0x548366[_0xc0e6('0x1f')]:_0xce878e[_0xc0e6('0x1c')]+_0xce878e[_0xc0e6('0x1e')];var _0x56857e;if(_0xfbd1eb>=_0x33a5d5){_0xfbd1eb=_0x33a5d5;_0x56857e=0xc8;}else{_0x56857e=0xce;}_0x3fc32d[_0xc0e6('0x19')](_0x56857e);return _0x3fc32d[_0xc0e6('0x20')]('Content-Range',_0x38b261+'-'+_0xfbd1eb+'/'+_0x33a5d5)['json'](_0x548366);}return null;};}function patchUpdates(_0x512725){return function(_0x3f4e97){try{jsonpatch[_0xc0e6('0x21')](_0x3f4e97,_0x512725,!![]);}catch(_0x383507){return BPromise[_0xc0e6('0x22')](_0x383507);}return _0x3f4e97['save']();};}function saveUpdates(_0x1dbf2b,_0x45c462){return function(_0x22ea5f){if(_0x22ea5f){return _0x22ea5f[_0xc0e6('0x23')](_0x1dbf2b)[_0xc0e6('0x24')](function(_0x146003){return _0x146003;});}return null;};}function removeEntity(_0x13d4a1,_0x2f1124){return function(_0x30a0c8){if(_0x30a0c8){return _0x30a0c8[_0xc0e6('0x25')]()[_0xc0e6('0x24')](function(){_0x13d4a1[_0xc0e6('0x19')](0xcc)[_0xc0e6('0x1a')]();});}};}function handleEntityNotFound(_0x8daf59,_0x373c74){return function(_0x15f60c){if(!_0x15f60c){_0x8daf59[_0xc0e6('0x18')](0x194);}return _0x15f60c;};}function handleError(_0x5c801d,_0x319a31){_0x319a31=_0x319a31||0x1f4;return function(_0x50e64b){logger[_0xc0e6('0x26')](_0x50e64b[_0xc0e6('0x27')]);if(_0x50e64b[_0xc0e6('0x28')]){delete _0x50e64b[_0xc0e6('0x28')];}_0x5c801d['status'](_0x319a31)['send'](_0x50e64b);};}exports[_0xc0e6('0x29')]=function(_0x1efd9d,_0x1e7d30){var _0x279cad={},_0x1270aa={},_0x2a8363={'count':0x0,'rows':[]};var _0x4899e8=_[_0xc0e6('0x2a')](db['SquareRecording'][_0xc0e6('0x2b')],function(_0x63972f){return{'name':_0x63972f[_0xc0e6('0x2c')],'type':_0x63972f[_0xc0e6('0x2d')]['key']};});_0x1270aa[_0xc0e6('0x2e')]=_[_0xc0e6('0x2a')](_0x4899e8,_0xc0e6('0x28'));_0x1270aa[_0xc0e6('0x2f')]=_[_0xc0e6('0x30')](_0x1efd9d['query']);_0x1270aa[_0xc0e6('0x31')]=_['intersection'](_0x1270aa[_0xc0e6('0x2e')],_0x1270aa['query']);_0x279cad['attributes']=_['intersection'](_0x1270aa[_0xc0e6('0x2e')],qs[_0xc0e6('0x32')](_0x1efd9d[_0xc0e6('0x2f')][_0xc0e6('0x32')]));_0x279cad[_0xc0e6('0x33')]=_0x279cad[_0xc0e6('0x33')][_0xc0e6('0x34')]?_0x279cad[_0xc0e6('0x33')]:_0x1270aa[_0xc0e6('0x2e')];if(!_0x1efd9d['query'][_0xc0e6('0x35')](_0xc0e6('0x36'))){_0x279cad['limit']=qs[_0xc0e6('0x1e')](_0x1efd9d[_0xc0e6('0x2f')]['limit']);_0x279cad[_0xc0e6('0x1c')]=qs['offset'](_0x1efd9d[_0xc0e6('0x2f')][_0xc0e6('0x1c')]);}_0x279cad['order']=qs[_0xc0e6('0x37')](_0x1efd9d[_0xc0e6('0x2f')][_0xc0e6('0x37')]);_0x279cad[_0xc0e6('0x38')]=qs[_0xc0e6('0x31')](_[_0xc0e6('0x39')](_0x1efd9d[_0xc0e6('0x2f')],_0x1270aa[_0xc0e6('0x31')]),_0x4899e8);if(_0x1efd9d[_0xc0e6('0x2f')][_0xc0e6('0x3a')]){_0x279cad['where']=_[_0xc0e6('0x3b')](_0x279cad[_0xc0e6('0x38')],{'$or':_[_0xc0e6('0x2a')](_0x4899e8,function(_0x520611){if(_0x520611['type']!==_0xc0e6('0x3c')){var _0x297e5e={};_0x297e5e[_0x520611[_0xc0e6('0x28')]]={'$like':'%'+_0x1efd9d[_0xc0e6('0x2f')][_0xc0e6('0x3a')]+'%'};return _0x297e5e;}})});}_0x279cad=_[_0xc0e6('0x3b')]({},_0x279cad,_0x1efd9d[_0xc0e6('0x3d')]);var _0x2592ce={'where':_0x279cad[_0xc0e6('0x38')]};return db[_0xc0e6('0x3e')]['count'](_0x2592ce)[_0xc0e6('0x24')](function(_0x5a54a1){_0x2a8363[_0xc0e6('0x1f')]=_0x5a54a1;if(_0x1efd9d['query'][_0xc0e6('0x3f')]){_0x279cad[_0xc0e6('0x40')]=[{'all':!![]}];}return db[_0xc0e6('0x3e')][_0xc0e6('0x41')](_0x279cad);})['then'](function(_0x2a9740){_0x2a8363[_0xc0e6('0x42')]=_0x2a9740;return _0x2a8363;})[_0xc0e6('0x24')](respondWithFilteredResult(_0x1e7d30,_0x279cad))['catch'](handleError(_0x1e7d30,null));};exports[_0xc0e6('0x43')]=function(_0x22ed5f,_0x58b833){var _0x1dd81d={'raw':!![],'where':{'id':_0x22ed5f[_0xc0e6('0x44')]['id']}},_0x1f38ef={};_0x1f38ef['model']=_[_0xc0e6('0x30')](db[_0xc0e6('0x3e')]['rawAttributes']);_0x1f38ef[_0xc0e6('0x2f')]=_[_0xc0e6('0x30')](_0x22ed5f[_0xc0e6('0x2f')]);_0x1f38ef[_0xc0e6('0x31')]=_['intersection'](_0x1f38ef['model'],_0x1f38ef['query']);_0x1dd81d[_0xc0e6('0x33')]=_[_0xc0e6('0x45')](_0x1f38ef[_0xc0e6('0x2e')],qs[_0xc0e6('0x32')](_0x22ed5f['query']['fields']));_0x1dd81d[_0xc0e6('0x33')]=_0x1dd81d[_0xc0e6('0x33')]['length']?_0x1dd81d[_0xc0e6('0x33')]:_0x1f38ef[_0xc0e6('0x2e')];if(_0x22ed5f[_0xc0e6('0x2f')][_0xc0e6('0x3f')]){_0x1dd81d[_0xc0e6('0x40')]=[{'all':!![]}];}_0x1dd81d=_[_0xc0e6('0x3b')]({},_0x1dd81d,_0x22ed5f['options']);return db[_0xc0e6('0x3e')]['find'](_0x1dd81d)[_0xc0e6('0x24')](handleEntityNotFound(_0x58b833,null))['then'](respondWithResult(_0x58b833,null))[_0xc0e6('0x46')](handleError(_0x58b833,null));};exports[_0xc0e6('0x47')]=function(_0x2d9874,_0x4e1ba4){return db[_0xc0e6('0x3e')][_0xc0e6('0x47')](_0x2d9874[_0xc0e6('0x48')],{})['then'](respondWithResult(_0x4e1ba4,0xc9))[_0xc0e6('0x46')](handleError(_0x4e1ba4,null));};exports[_0xc0e6('0x23')]=function(_0x13703a,_0x76c8c3){if(_0x13703a[_0xc0e6('0x48')]['id']){delete _0x13703a['body']['id'];}return db[_0xc0e6('0x3e')][_0xc0e6('0x49')]({'where':{'id':_0x13703a['params']['id']}})['then'](handleEntityNotFound(_0x76c8c3,null))[_0xc0e6('0x24')](saveUpdates(_0x13703a[_0xc0e6('0x48')],null))[_0xc0e6('0x24')](respondWithResult(_0x76c8c3,null))[_0xc0e6('0x46')](handleError(_0x76c8c3,null));};exports['download']=function(_0x317a1c,_0x312caa,_0x4c387b){var _0x4971e=require('../../components/encryptor');var _0x6b1b55=![];var _0x1319ce={};if(_0x317a1c[_0xc0e6('0x2f')][_0xc0e6('0x2d')]&&_0x317a1c['query']['type']===_0xc0e6('0x4a')){_0x1319ce['uniqueid']=_0x317a1c[_0xc0e6('0x44')]['id'];}else{_0x1319ce['id']=_0x317a1c[_0xc0e6('0x44')]['id'];}return db[_0xc0e6('0x3e')]['find']({'where':_0x1319ce,'attributes':['id','savePath',_0xc0e6('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x312caa,null))[_0xc0e6('0x24')](function(_0x5233e6){if(_0x5233e6){var _0xd5e306=_0x5233e6['savePath'];var _0x1a2cc1=util[_0xc0e6('0x4c')]('%s.cypher',_0xd5e306);if(fs[_0xc0e6('0x4d')](_0x1a2cc1)){_0x6b1b55=!![];return _0x4971e[_0xc0e6('0x4e')](_0x1a2cc1,_0xd5e306,config['secrets']['recording'])[_0xc0e6('0x24')](function(){return _0x5233e6;});}return _0x5233e6;}})[_0xc0e6('0x24')](function(_0x2198de){if(_0x2198de){var _0x2e6315=_0x2198de[_0xc0e6('0x4f')];if(!fs[_0xc0e6('0x4d')](_0x2e6315)){throw new db[(_0xc0e6('0x50'))][(_0xc0e6('0x51'))](_0xc0e6('0x52'));}if(_0x2198de[_0xc0e6('0x4b')]){return _0x312caa['download'](_0x2e6315,_0x2198de['filename']+path[_0xc0e6('0x53')](_0x2e6315),function(){if(_0x6b1b55){fs['unlink'](_0x2e6315);}});}else{return _0x312caa[_0xc0e6('0x54')](_0x2e6315,function(_0x10179d){if(_0x6b1b55){fs[_0xc0e6('0x55')](_0x2e6315);}});}}})[_0xc0e6('0x46')](function(_0x3d77d6){if(_0x3d77d6[_0xc0e6('0x56')]===_0xc0e6('0x52')){_0x312caa['status'](0x194)['send'](_0xc0e6('0x57'));}else{return handleError(_0x312caa,null);}});};exports[_0xc0e6('0x25')]=function(_0x1598ff,_0x3aa2b3){return db['SquareRecording'][_0xc0e6('0x49')]({'where':{'id':_0x1598ff[_0xc0e6('0x44')]['id']}})[_0xc0e6('0x24')](function(_0x59b49d){if(_['isNil'](_0x59b49d)){throw new ReferenceError(_0xc0e6('0x58'));}return _0x59b49d;})[_0xc0e6('0x24')](function(_0x1389b5){var _0x50819a=_0x1389b5[_0xc0e6('0x4f')];logger['info'](_0xc0e6('0x59'),_0x50819a);if(!_[_0xc0e6('0x5a')](_0x1389b5[_0xc0e6('0x4f')])&&fs[_0xc0e6('0x4d')](_0x50819a)){logger[_0xc0e6('0x5b')](_0xc0e6('0x5c')+_0x50819a+_0xc0e6('0x5d'));fs['unlinkSync'](_0x50819a);}_0x50819a=_0x50819a+_0xc0e6('0x5e');if(!_[_0xc0e6('0x5a')](_0x1389b5['savePath'])&&fs[_0xc0e6('0x4d')](_0x50819a)){logger[_0xc0e6('0x5b')](_0xc0e6('0x5c')+_0x50819a+_0xc0e6('0x5d'));fs[_0xc0e6('0x5f')](_0x50819a);}return _0x1389b5;})[_0xc0e6('0x24')](function(_0x4f6ce5){if(!_0x4f6ce5)throw new InternalError();return _0x4f6ce5['destroy']();})[_0xc0e6('0x24')](function(){_0x3aa2b3[_0xc0e6('0x19')](0xcc)[_0xc0e6('0x1a')]();})[_0xc0e6('0x46')](handleError(_0x3aa2b3,null));}; \ No newline at end of file +var _0x65e5=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','type','options','SquareRecording','includeAll','include','findAll','rows','catch','length','create','body','find','params','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','extname','download','unlink','message','SquareRecording\x20not\x20found','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service'];(function(_0x3eb450,_0x592b0a){var _0x2c4cfd=function(_0x34f5dc){while(--_0x34f5dc){_0x3eb450['push'](_0x3eb450['shift']());}};_0x2c4cfd(++_0x592b0a);}(_0x65e5,0x108));var _0x565e=function(_0xdd078d,_0x35e222){_0xdd078d=_0xdd078d-0x0;var _0x32196c=_0x65e5[_0xdd078d];return _0x32196c;};'use strict';var emlformat=require(_0x565e('0x0'));var rimraf=require(_0x565e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x565e('0x2'));var rp=require(_0x565e('0x3'));var moment=require(_0x565e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x565e('0x5'));var csv=require(_0x565e('0x6'));var ejs=require(_0x565e('0x7'));var fs=require('fs');var fs_extra=require(_0x565e('0x8'));var _=require(_0x565e('0x9'));var squel=require(_0x565e('0xa'));var crypto=require('crypto');var jsforce=require(_0x565e('0xb'));var deskjs=require(_0x565e('0xc'));var toCsv=require(_0x565e('0x6'));var querystring=require('querystring');var Papa=require(_0x565e('0xd'));var Redis=require('ioredis');var authService=require(_0x565e('0xe'));var qs=require(_0x565e('0xf'));var as=require(_0x565e('0x10'));var hardwareService=require(_0x565e('0x11'));var logger=require(_0x565e('0x12'))('api');var utils=require(_0x565e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x565e('0x14'));var db=require(_0x565e('0x15'))['db'];function respondWithStatusCode(_0x548d4b,_0x5dc349){_0x5dc349=_0x5dc349||0xcc;return function(_0xe5af5c){if(_0xe5af5c){return _0x548d4b[_0x565e('0x16')](_0x5dc349);}return _0x548d4b[_0x565e('0x17')](_0x5dc349)[_0x565e('0x18')]();};}function respondWithResult(_0x420a5b,_0x326247){_0x326247=_0x326247||0xc8;return function(_0x261f5f){if(_0x261f5f){return _0x420a5b[_0x565e('0x17')](_0x326247)['json'](_0x261f5f);}};}function respondWithFilteredResult(_0xad1a23,_0x543da1){return function(_0x214c69){if(_0x214c69){var _0x3385b7=typeof _0x543da1[_0x565e('0x19')]===_0x565e('0x1a')&&typeof _0x543da1[_0x565e('0x1b')]===_0x565e('0x1a');var _0x1177e8=_0x214c69[_0x565e('0x1c')];var _0x24de4b=_0x3385b7?0x0:_0x543da1[_0x565e('0x19')];var _0x5b2391=_0x3385b7?_0x214c69[_0x565e('0x1c')]:_0x543da1['offset']+_0x543da1[_0x565e('0x1b')];var _0x1fa35a;if(_0x5b2391>=_0x1177e8){_0x5b2391=_0x1177e8;_0x1fa35a=0xc8;}else{_0x1fa35a=0xce;}_0xad1a23[_0x565e('0x17')](_0x1fa35a);return _0xad1a23[_0x565e('0x1d')]('Content-Range',_0x24de4b+'-'+_0x5b2391+'/'+_0x1177e8)[_0x565e('0x1e')](_0x214c69);}return null;};}function patchUpdates(_0x32c128){return function(_0x4f0321){try{jsonpatch[_0x565e('0x1f')](_0x4f0321,_0x32c128,!![]);}catch(_0x5c8d70){return BPromise[_0x565e('0x20')](_0x5c8d70);}return _0x4f0321[_0x565e('0x21')]();};}function saveUpdates(_0x52060e,_0x1c2fb1){return function(_0x133c21){if(_0x133c21){return _0x133c21[_0x565e('0x22')](_0x52060e)[_0x565e('0x23')](function(_0xf7dfa8){return _0xf7dfa8;});}return null;};}function removeEntity(_0xf6007a,_0x2a0ee2){return function(_0x1836ba){if(_0x1836ba){return _0x1836ba['destroy']()[_0x565e('0x23')](function(){_0xf6007a[_0x565e('0x17')](0xcc)[_0x565e('0x18')]();});}};}function handleEntityNotFound(_0x456806,_0x122ff6){return function(_0x12f04b){if(!_0x12f04b){_0x456806[_0x565e('0x16')](0x194);}return _0x12f04b;};}function handleError(_0x3402ff,_0x2cea22){_0x2cea22=_0x2cea22||0x1f4;return function(_0x17cca6){logger[_0x565e('0x24')](_0x17cca6[_0x565e('0x25')]);if(_0x17cca6[_0x565e('0x26')]){delete _0x17cca6[_0x565e('0x26')];}_0x3402ff[_0x565e('0x17')](_0x2cea22)['send'](_0x17cca6);};}exports[_0x565e('0x27')]=function(_0x17cd8b,_0x2437fd){var _0x3096a7={},_0x2bd35b={},_0x2607e4={'count':0x0,'rows':[]};var _0x3e1f54=_[_0x565e('0x28')](db['SquareRecording'][_0x565e('0x29')],function(_0xa3a03a){return{'name':_0xa3a03a[_0x565e('0x2a')],'type':_0xa3a03a['type']['key']};});_0x2bd35b[_0x565e('0x2b')]=_[_0x565e('0x28')](_0x3e1f54,_0x565e('0x26'));_0x2bd35b[_0x565e('0x2c')]=_[_0x565e('0x2d')](_0x17cd8b[_0x565e('0x2c')]);_0x2bd35b[_0x565e('0x2e')]=_[_0x565e('0x2f')](_0x2bd35b[_0x565e('0x2b')],_0x2bd35b[_0x565e('0x2c')]);_0x3096a7[_0x565e('0x30')]=_[_0x565e('0x2f')](_0x2bd35b[_0x565e('0x2b')],qs[_0x565e('0x31')](_0x17cd8b[_0x565e('0x2c')][_0x565e('0x31')]));_0x3096a7[_0x565e('0x30')]=_0x3096a7[_0x565e('0x30')]['length']?_0x3096a7['attributes']:_0x2bd35b[_0x565e('0x2b')];if(!_0x17cd8b[_0x565e('0x2c')]['hasOwnProperty'](_0x565e('0x32'))){_0x3096a7['limit']=qs['limit'](_0x17cd8b[_0x565e('0x2c')][_0x565e('0x1b')]);_0x3096a7['offset']=qs[_0x565e('0x19')](_0x17cd8b[_0x565e('0x2c')][_0x565e('0x19')]);}_0x3096a7[_0x565e('0x33')]=qs['sort'](_0x17cd8b['query']['sort']);_0x3096a7[_0x565e('0x34')]=qs[_0x565e('0x2e')](_[_0x565e('0x35')](_0x17cd8b[_0x565e('0x2c')],_0x2bd35b[_0x565e('0x2e')]),_0x3e1f54);if(_0x17cd8b[_0x565e('0x2c')][_0x565e('0x36')]){_0x3096a7[_0x565e('0x34')]=_[_0x565e('0x37')](_0x3096a7[_0x565e('0x34')],{'$or':_['map'](_0x3e1f54,function(_0x2bdf3b){if(_0x2bdf3b[_0x565e('0x38')]!=='VIRTUAL'){var _0x155600={};_0x155600[_0x2bdf3b['name']]={'$like':'%'+_0x17cd8b[_0x565e('0x2c')][_0x565e('0x36')]+'%'};return _0x155600;}})});}_0x3096a7=_[_0x565e('0x37')]({},_0x3096a7,_0x17cd8b[_0x565e('0x39')]);var _0x5a5969={'where':_0x3096a7[_0x565e('0x34')]};return db[_0x565e('0x3a')][_0x565e('0x1c')](_0x5a5969)[_0x565e('0x23')](function(_0x13220b){_0x2607e4[_0x565e('0x1c')]=_0x13220b;if(_0x17cd8b[_0x565e('0x2c')][_0x565e('0x3b')]){_0x3096a7[_0x565e('0x3c')]=[{'all':!![]}];}return db['SquareRecording'][_0x565e('0x3d')](_0x3096a7);})[_0x565e('0x23')](function(_0x50c8c0){_0x2607e4[_0x565e('0x3e')]=_0x50c8c0;return _0x2607e4;})[_0x565e('0x23')](respondWithFilteredResult(_0x2437fd,_0x3096a7))[_0x565e('0x3f')](handleError(_0x2437fd,null));};exports['show']=function(_0xa1011,_0x5a2bf6){var _0x4fe788={'raw':!![],'where':{'id':_0xa1011['params']['id']}},_0x42d9a2={};_0x42d9a2[_0x565e('0x2b')]=_['keys'](db['SquareRecording'][_0x565e('0x29')]);_0x42d9a2[_0x565e('0x2c')]=_[_0x565e('0x2d')](_0xa1011[_0x565e('0x2c')]);_0x42d9a2[_0x565e('0x2e')]=_[_0x565e('0x2f')](_0x42d9a2[_0x565e('0x2b')],_0x42d9a2[_0x565e('0x2c')]);_0x4fe788[_0x565e('0x30')]=_[_0x565e('0x2f')](_0x42d9a2['model'],qs['fields'](_0xa1011['query'][_0x565e('0x31')]));_0x4fe788[_0x565e('0x30')]=_0x4fe788[_0x565e('0x30')][_0x565e('0x40')]?_0x4fe788[_0x565e('0x30')]:_0x42d9a2[_0x565e('0x2b')];if(_0xa1011[_0x565e('0x2c')][_0x565e('0x3b')]){_0x4fe788['include']=[{'all':!![]}];}_0x4fe788=_['merge']({},_0x4fe788,_0xa1011[_0x565e('0x39')]);return db[_0x565e('0x3a')]['find'](_0x4fe788)[_0x565e('0x23')](handleEntityNotFound(_0x5a2bf6,null))['then'](respondWithResult(_0x5a2bf6,null))['catch'](handleError(_0x5a2bf6,null));};exports[_0x565e('0x41')]=function(_0x1d4441,_0xc35ea5){return db[_0x565e('0x3a')][_0x565e('0x41')](_0x1d4441[_0x565e('0x42')],{})[_0x565e('0x23')](respondWithResult(_0xc35ea5,0xc9))[_0x565e('0x3f')](handleError(_0xc35ea5,null));};exports['update']=function(_0x249be8,_0x56a927){if(_0x249be8[_0x565e('0x42')]['id']){delete _0x249be8[_0x565e('0x42')]['id'];}return db[_0x565e('0x3a')][_0x565e('0x43')]({'where':{'id':_0x249be8[_0x565e('0x44')]['id']}})[_0x565e('0x23')](handleEntityNotFound(_0x56a927,null))[_0x565e('0x23')](saveUpdates(_0x249be8[_0x565e('0x42')],null))[_0x565e('0x23')](respondWithResult(_0x56a927,null))['catch'](handleError(_0x56a927,null));};exports['download']=function(_0xe3e47d,_0x37bcd7,_0x4c61f1){var _0x3a442b=require(_0x565e('0x45'));var _0x43a35d=![];var _0x17e620={};if(_0xe3e47d['query'][_0x565e('0x38')]&&_0xe3e47d[_0x565e('0x2c')][_0x565e('0x38')]===_0x565e('0x46')){_0x17e620[_0x565e('0x46')]=_0xe3e47d[_0x565e('0x44')]['id'];}else{_0x17e620['id']=_0xe3e47d[_0x565e('0x44')]['id'];}return db[_0x565e('0x3a')]['find']({'where':_0x17e620,'attributes':['id','savePath',_0x565e('0x47')],'raw':!![]})[_0x565e('0x23')](handleEntityNotFound(_0x37bcd7,null))['then'](function(_0x24c92a){if(_0x24c92a){var _0x1748c4=_0x24c92a[_0x565e('0x48')];var _0x2f5c69=util[_0x565e('0x49')](_0x565e('0x4a'),_0x1748c4);if(fs[_0x565e('0x4b')](_0x2f5c69)){_0x43a35d=!![];return _0x3a442b[_0x565e('0x4c')](_0x2f5c69,_0x1748c4,config['secrets'][_0x565e('0x4d')])[_0x565e('0x23')](function(){return _0x24c92a;});}return _0x24c92a;}})[_0x565e('0x23')](function(_0x3f8cf5){if(_0x3f8cf5){var _0x581a34=_0x3f8cf5[_0x565e('0x48')];if(!fs['existsSync'](_0x581a34)){throw new db[(_0x565e('0x4e'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x3f8cf5[_0x565e('0x47')]){return _0x37bcd7['download'](_0x581a34,_0x3f8cf5[_0x565e('0x47')]+path[_0x565e('0x4f')](_0x581a34),function(){if(_0x43a35d){fs['unlink'](_0x581a34);}});}else{return _0x37bcd7[_0x565e('0x50')](_0x581a34,function(_0x389efa){if(_0x43a35d){fs[_0x565e('0x51')](_0x581a34);}});}}})['catch'](function(_0x279174){if(_0x279174[_0x565e('0x52')]===_0x565e('0x53')){_0x37bcd7[_0x565e('0x17')](0x194)['send'](_0x565e('0x54'));}else{return handleError(_0x37bcd7,null);}});};exports[_0x565e('0x55')]=function(_0x58a2fc,_0x44949a){return db[_0x565e('0x3a')][_0x565e('0x43')]({'where':{'id':_0x58a2fc[_0x565e('0x44')]['id']}})[_0x565e('0x23')](function(_0x1354d7){if(_[_0x565e('0x56')](_0x1354d7)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1354d7;})[_0x565e('0x23')](function(_0xc603e0){var _0x11a828=_0xc603e0[_0x565e('0x48')];logger[_0x565e('0x57')](_0x565e('0x58'),_0x11a828);if(!_['isNil'](_0xc603e0[_0x565e('0x48')])&&fs[_0x565e('0x4b')](_0x11a828)){logger[_0x565e('0x57')](_0x565e('0x59')+_0x11a828+_0x565e('0x5a'));fs[_0x565e('0x5b')](_0x11a828);}_0x11a828=_0x11a828+_0x565e('0x5c');if(!_[_0x565e('0x56')](_0xc603e0[_0x565e('0x48')])&&fs[_0x565e('0x4b')](_0x11a828)){logger[_0x565e('0x57')](_0x565e('0x59')+_0x11a828+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x565e('0x5b')](_0x11a828);}return _0xc603e0;})['then'](function(_0x5bfcb0){if(!_0x5bfcb0)throw new InternalError();return _0x5bfcb0[_0x565e('0x55')]();})[_0x565e('0x23')](function(){_0x44949a[_0x565e('0x17')](0xcc)['end']();})[_0x565e('0x3f')](handleError(_0x44949a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index d2430aa..b5d28da 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 _0x18b2=['define','SquareRecording','square_recordings','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x4d480e,_0x199312){var _0x154d9a=function(_0x34547b){while(--_0x34547b){_0x4d480e['push'](_0x4d480e['shift']());}};_0x154d9a(++_0x199312);}(_0x18b2,0x85));var _0x218b=function(_0x116699,_0x2b300a){_0x116699=_0x116699-0x0;var _0x57edad=_0x18b2[_0x116699];return _0x57edad;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var logger=require(_0x218b('0x1'))(_0x218b('0x2'));var moment=require('moment');var BPromise=require(_0x218b('0x3'));var rp=require(_0x218b('0x4'));var fs=require('fs');var path=require(_0x218b('0x5'));var rimraf=require(_0x218b('0x6'));var config=require(_0x218b('0x7'));var attributes=require(_0x218b('0x8'));module[_0x218b('0x9')]=function(_0x3a9261,_0x1c2c17){return _0x3a9261[_0x218b('0xa')](_0x218b('0xb'),attributes,{'tableName':_0x218b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07e8=['request-promise','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','moment'];(function(_0x4b436c,_0x233f48){var _0x543ec3=function(_0x26ec96){while(--_0x26ec96){_0x4b436c['push'](_0x4b436c['shift']());}};_0x543ec3(++_0x233f48);}(_0x07e8,0x10f));var _0x807e=function(_0x36c95b,_0x48008c){_0x36c95b=_0x36c95b-0x0;var _0x4e4484=_0x07e8[_0x36c95b];return _0x4e4484;};'use strict';var _=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var logger=require(_0x807e('0x2'))('api');var moment=require(_0x807e('0x3'));var BPromise=require('bluebird');var rp=require(_0x807e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x807e('0x5'));var attributes=require(_0x807e('0x6'));module[_0x807e('0x7')]=function(_0x59981c,_0x5a768b){return _0x59981c[_0x807e('0x8')](_0x807e('0x9'),attributes,{'tableName':_0x807e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 6c995a9..e091966 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 _0xb592=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','options','util','moment'];(function(_0x8a633e,_0x115607){var _0x2aa7c0=function(_0x4d69bd){while(--_0x4d69bd){_0x8a633e['push'](_0x8a633e['shift']());}};_0x2aa7c0(++_0x115607);}(_0xb592,0xc2));var _0x2b59=function(_0x30f53a,_0x55acf8){_0x30f53a=_0x30f53a-0x0;var _0x24fd11=_0xb592[_0x30f53a];return _0x24fd11;};'use strict';var _=require('lodash');var util=require(_0x2b59('0x0'));var moment=require(_0x2b59('0x1'));var BPromise=require(_0x2b59('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b59('0x3'));var db=require(_0x2b59('0x4'))['db'];var utils=require(_0x2b59('0x5'));var logger=require(_0x2b59('0x6'))(_0x2b59('0x7'));var config=require(_0x2b59('0x8'));var jayson=require(_0x2b59('0x9'));var client=jayson[_0x2b59('0xa')][_0x2b59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57b278,_0x5331c4,_0x32d24b){return new BPromise(function(_0x223bad,_0x16cc25){return client['request'](_0x57b278,_0x32d24b)[_0x2b59('0xc')](function(_0x14773d){logger[_0x2b59('0xd')](_0x2b59('0xe'),_0x5331c4,'request\x20sent');logger[_0x2b59('0xf')](_0x2b59('0x10'),_0x5331c4,'request\x20sent',JSON[_0x2b59('0x11')](_0x14773d));if(_0x14773d[_0x2b59('0x12')]){if(_0x14773d[_0x2b59('0x12')][_0x2b59('0x13')]===0x1f4){logger['error'](_0x2b59('0xe'),_0x5331c4,_0x14773d['error'][_0x2b59('0x14')]);return _0x16cc25(_0x14773d['error'][_0x2b59('0x14')]);}logger[_0x2b59('0x12')](_0x2b59('0xe'),_0x5331c4,_0x14773d[_0x2b59('0x12')][_0x2b59('0x14')]);return _0x223bad(_0x14773d[_0x2b59('0x12')][_0x2b59('0x14')]);}else{logger['info'](_0x2b59('0xe'),_0x5331c4,_0x2b59('0x15'));_0x223bad(_0x14773d[_0x2b59('0x16')][_0x2b59('0x14')]);}})[_0x2b59('0x17')](function(_0x36db4b){logger[_0x2b59('0x12')](_0x2b59('0xe'),_0x5331c4,_0x36db4b);_0x16cc25(_0x36db4b);});});}exports[_0x2b59('0x18')]=function(_0x4c61b6){var _0x399253=this;return new Promise(function(_0xe114fc,_0x3eba98){return db[_0x2b59('0x19')][_0x2b59('0x1a')](_0x4c61b6['body'],{'raw':_0x4c61b6[_0x2b59('0x1b')]?_0x4c61b6[_0x2b59('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x2b59('0xc')](function(_0xfd1b0e){logger[_0x2b59('0xd')](_0x2b59('0x18'),_0x4c61b6);logger[_0x2b59('0xf')](_0x2b59('0x18'),_0x4c61b6,JSON[_0x2b59('0x11')](_0xfd1b0e));_0xe114fc(_0xfd1b0e);})[_0x2b59('0x17')](function(_0x17aaf3){logger['error'](_0x2b59('0x18'),_0x17aaf3[_0x2b59('0x14')],_0x4c61b6);_0x3eba98(_0x399253[_0x2b59('0x12')](0x1f4,_0x17aaf3[_0x2b59('0x14')]));});});}; \ No newline at end of file +var _0x7382=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','SquareRecording','create','body','options','CreateSquareRecording','stringify'];(function(_0x196c80,_0x4ed3fe){var _0x3a0703=function(_0x1c34ca){while(--_0x1c34ca){_0x196c80['push'](_0x196c80['shift']());}};_0x3a0703(++_0x4ed3fe);}(_0x7382,0xc8));var _0x2738=function(_0x150e7b,_0x9dbdb3){_0x150e7b=_0x150e7b-0x0;var _0x2cfb13=_0x7382[_0x150e7b];return _0x2cfb13;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require(_0x2738('0x1'));var rs=require(_0x2738('0x2'));var fs=require('fs');var Redis=require(_0x2738('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x4'));var logger=require('../../config/logger')(_0x2738('0x5'));var config=require(_0x2738('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2738('0x7')][_0x2738('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21b9a8,_0x586922,_0xf9b581){return new BPromise(function(_0x247918,_0x42d99e){return client[_0x2738('0x9')](_0x21b9a8,_0xf9b581)[_0x2738('0xa')](function(_0x3bfb86){logger[_0x2738('0xb')](_0x2738('0xc'),_0x586922,_0x2738('0xd'));logger[_0x2738('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x586922,'request\x20sent',JSON['stringify'](_0x3bfb86));if(_0x3bfb86['error']){if(_0x3bfb86['error'][_0x2738('0xf')]===0x1f4){logger[_0x2738('0x10')](_0x2738('0xc'),_0x586922,_0x3bfb86['error'][_0x2738('0x11')]);return _0x42d99e(_0x3bfb86[_0x2738('0x10')][_0x2738('0x11')]);}logger[_0x2738('0x10')](_0x2738('0xc'),_0x586922,_0x3bfb86[_0x2738('0x10')][_0x2738('0x11')]);return _0x247918(_0x3bfb86[_0x2738('0x10')][_0x2738('0x11')]);}else{logger[_0x2738('0xb')](_0x2738('0xc'),_0x586922,'request\x20sent');_0x247918(_0x3bfb86['result'][_0x2738('0x11')]);}})[_0x2738('0x12')](function(_0x4957af){logger[_0x2738('0x10')](_0x2738('0xc'),_0x586922,_0x4957af);_0x42d99e(_0x4957af);});});}exports['CreateSquareRecording']=function(_0x51b0a9){var _0x51157b=this;return new Promise(function(_0x3d596b,_0x49d823){return db[_0x2738('0x13')][_0x2738('0x14')](_0x51b0a9[_0x2738('0x15')],{'raw':_0x51b0a9['options']?_0x51b0a9[_0x2738('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x2738('0xa')](function(_0x3039bb){logger[_0x2738('0xb')](_0x2738('0x17'),_0x51b0a9);logger[_0x2738('0xe')]('CreateSquareRecording',_0x51b0a9,JSON[_0x2738('0x18')](_0x3039bb));_0x3d596b(_0x3039bb);})['catch'](function(_0x2cf8ca){logger[_0x2738('0x10')](_0x2738('0x17'),_0x2cf8ca[_0x2738('0x11')],_0x51b0a9);_0x49d823(_0x51157b[_0x2738('0x10')](0x1f4,_0x2cf8ca[_0x2738('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9002b27..de3f5fb 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3ef90f,_0x46f414){var _0x278fab=function(_0x3ef740){while(--_0x3ef740){_0x3ef90f['push'](_0x3ef90f['shift']());}};_0x278fab(++_0x46f414);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x4151fa,_0x2aca56){var _0x3dfbb3=function(_0x245ccc){while(--_0x245ccc){_0x4151fa['push'](_0x4151fa['shift']());}};_0x3dfbb3(++_0x2aca56);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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 diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index da291cd..739615b 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 _0x7b30=['sequelize','exports','STRING','BOOLEAN'];(function(_0x10c6b5,_0x238322){var _0x5eacd9=function(_0x3ff887){while(--_0x3ff887){_0x10c6b5['push'](_0x10c6b5['shift']());}};_0x5eacd9(++_0x238322);}(_0x7b30,0x174));var _0x07b3=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x7b30[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x07b3('0x0'));module[_0x07b3('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x07b3('0x2')]},'language':{'type':Sequelize[_0x07b3('0x2')]},'type':{'type':Sequelize[_0x07b3('0x2')]},'uniqueid':{'type':Sequelize[_0x07b3('0x2')]},'version':{'type':Sequelize[_0x07b3('0x2')]},'callerid':{'type':Sequelize[_0x07b3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x07b3('0x2')]},'callingani2':{'type':Sequelize[_0x07b3('0x2')]},'callington':{'type':Sequelize[_0x07b3('0x2')]},'callingtns':{'type':Sequelize[_0x07b3('0x2')]},'dnid':{'type':Sequelize[_0x07b3('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x07b3('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x07b3('0x2')]},'enhanced':{'type':Sequelize[_0x07b3('0x2')]},'accountcode':{'type':Sequelize[_0x07b3('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x07b3('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x07b3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xedcb=['STRING','DATE','sequelize','exports'];(function(_0x3348d3,_0x269a7b){var _0x4e9d5f=function(_0x48c306){while(--_0x48c306){_0x3348d3['push'](_0x3348d3['shift']());}};_0x4e9d5f(++_0x269a7b);}(_0xedcb,0x1aa));var _0xbedc=function(_0x193f5a,_0x24fa9e){_0x193f5a=_0x193f5a-0x0;var _0x960763=_0xedcb[_0x193f5a];return _0x960763;};'use strict';var Sequelize=require(_0xbedc('0x0'));module[_0xbedc('0x1')]={'network':{'type':Sequelize[_0xbedc('0x2')]},'network_script':{'type':Sequelize[_0xbedc('0x2')]},'request':{'type':Sequelize[_0xbedc('0x2')]},'channel':{'type':Sequelize[_0xbedc('0x2')]},'language':{'type':Sequelize[_0xbedc('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xbedc('0x2')]},'version':{'type':Sequelize[_0xbedc('0x2')]},'callerid':{'type':Sequelize[_0xbedc('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xbedc('0x2')]},'callington':{'type':Sequelize[_0xbedc('0x2')]},'callingtns':{'type':Sequelize[_0xbedc('0x2')]},'dnid':{'type':Sequelize[_0xbedc('0x2')]},'rdnis':{'type':Sequelize[_0xbedc('0x2')]},'context':{'type':Sequelize[_0xbedc('0x2')]},'extension':{'type':Sequelize[_0xbedc('0x2')]},'priority':{'type':Sequelize[_0xbedc('0x2')]},'enhanced':{'type':Sequelize[_0xbedc('0x2')]},'accountcode':{'type':Sequelize[_0xbedc('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xbedc('0x2')]},'joinAt':{'type':Sequelize[_0xbedc('0x3')]},'leaveAt':{'type':Sequelize[_0xbedc('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e0a48c6..aa13fd0 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 _0xb01d=['Content-Range','apply','update','destroy','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set'];(function(_0x31a35d,_0x72cf){var _0x592d90=function(_0x45bb26){while(--_0x45bb26){_0x31a35d['push'](_0x31a35d['shift']());}};_0x592d90(++_0x72cf);}(_0xb01d,0x6b));var _0xdb01=function(_0x14d664,_0x402592){_0x14d664=_0x14d664-0x0;var _0x2012f6=_0xb01d[_0x14d664];return _0x2012f6;};'use strict';var emlformat=require(_0xdb01('0x0'));var rimraf=require(_0xdb01('0x1'));var zipdir=require(_0xdb01('0x2'));var jsonpatch=require(_0xdb01('0x3'));var rp=require(_0xdb01('0x4'));var moment=require(_0xdb01('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb01('0x6'));var util=require('util');var path=require(_0xdb01('0x7'));var sox=require(_0xdb01('0x8'));var csv=require(_0xdb01('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb01('0xa'));var _=require('lodash');var squel=require(_0xdb01('0xb'));var crypto=require(_0xdb01('0xc'));var jsforce=require(_0xdb01('0xd'));var deskjs=require(_0xdb01('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdb01('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb01('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdb01('0x11'));var as=require(_0xdb01('0x12'));var hardwareService=require(_0xdb01('0x13'));var logger=require(_0xdb01('0x14'))(_0xdb01('0x15'));var utils=require(_0xdb01('0x16'));var config=require(_0xdb01('0x17'));var licenseUtil=require(_0xdb01('0x18'));var db=require(_0xdb01('0x19'))['db'];function respondWithStatusCode(_0x1dc245,_0x4b132f){_0x4b132f=_0x4b132f||0xcc;return function(_0x1bd13c){if(_0x1bd13c){return _0x1dc245[_0xdb01('0x1a')](_0x4b132f);}return _0x1dc245[_0xdb01('0x1b')](_0x4b132f)['end']();};}function respondWithResult(_0x2d7d7c,_0x1ed403){_0x1ed403=_0x1ed403||0xc8;return function(_0x952b88){if(_0x952b88){return _0x2d7d7c['status'](_0x1ed403)['json'](_0x952b88);}};}function respondWithFilteredResult(_0x536a17,_0x1b52ba){return function(_0x230ff1){if(_0x230ff1){var _0x57c5cd=typeof _0x1b52ba[_0xdb01('0x1c')]==='undefined'&&typeof _0x1b52ba[_0xdb01('0x1d')]===_0xdb01('0x1e');var _0x1cf0da=_0x230ff1[_0xdb01('0x1f')];var _0x5c4538=_0x57c5cd?0x0:_0x1b52ba[_0xdb01('0x1c')];var _0x1067b1=_0x57c5cd?_0x230ff1['count']:_0x1b52ba[_0xdb01('0x1c')]+_0x1b52ba['limit'];var _0x3e7fa5;if(_0x1067b1>=_0x1cf0da){_0x1067b1=_0x1cf0da;_0x3e7fa5=0xc8;}else{_0x3e7fa5=0xce;}_0x536a17[_0xdb01('0x1b')](_0x3e7fa5);return _0x536a17[_0xdb01('0x20')](_0xdb01('0x21'),_0x5c4538+'-'+_0x1067b1+'/'+_0x1cf0da)['json'](_0x230ff1);}return null;};}function patchUpdates(_0x242a4e){return function(_0x227e7d){try{jsonpatch[_0xdb01('0x22')](_0x227e7d,_0x242a4e,!![]);}catch(_0x22ea8a){return BPromise['reject'](_0x22ea8a);}return _0x227e7d['save']();};}function saveUpdates(_0x3c2424,_0xfa1e7){return function(_0x3b5a07){if(_0x3b5a07){return _0x3b5a07[_0xdb01('0x23')](_0x3c2424)['then'](function(_0x1f5d39){return _0x1f5d39;});}return null;};}function removeEntity(_0x210d63,_0x5149d3){return function(_0x3eda53){if(_0x3eda53){return _0x3eda53[_0xdb01('0x24')]()[_0xdb01('0x25')](function(){_0x210d63[_0xdb01('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367cd5,_0x8a8aee){return function(_0x5d81dd){if(!_0x5d81dd){_0x367cd5[_0xdb01('0x1a')](0x194);}return _0x5d81dd;};}function handleError(_0x45f0c1,_0x51dbac){_0x51dbac=_0x51dbac||0x1f4;return function(_0x18cb09){logger['error'](_0x18cb09[_0xdb01('0x26')]);if(_0x18cb09['name']){delete _0x18cb09[_0xdb01('0x27')];}_0x45f0c1[_0xdb01('0x1b')](_0x51dbac)[_0xdb01('0x28')](_0x18cb09);};}exports[_0xdb01('0x29')]=function(_0x20f9a3,_0x3c6d83){var _0x304bae={},_0x3a43dd={},_0x23f029={'count':0x0,'rows':[]};var _0x4d080d=_[_0xdb01('0x2a')](db[_0xdb01('0x2b')][_0xdb01('0x2c')],function(_0x43174b){return{'name':_0x43174b[_0xdb01('0x2d')],'type':_0x43174b[_0xdb01('0x2e')][_0xdb01('0x2f')]};});_0x3a43dd[_0xdb01('0x30')]=_['map'](_0x4d080d,_0xdb01('0x27'));_0x3a43dd[_0xdb01('0x31')]=_[_0xdb01('0x32')](_0x20f9a3[_0xdb01('0x31')]);_0x3a43dd[_0xdb01('0x33')]=_[_0xdb01('0x34')](_0x3a43dd['model'],_0x3a43dd[_0xdb01('0x31')]);_0x304bae[_0xdb01('0x35')]=_[_0xdb01('0x34')](_0x3a43dd[_0xdb01('0x30')],qs[_0xdb01('0x36')](_0x20f9a3[_0xdb01('0x31')][_0xdb01('0x36')]));_0x304bae[_0xdb01('0x35')]=_0x304bae[_0xdb01('0x35')]['length']?_0x304bae[_0xdb01('0x35')]:_0x3a43dd[_0xdb01('0x30')];if(!_0x20f9a3[_0xdb01('0x31')][_0xdb01('0x37')]('nolimit')){_0x304bae['limit']=qs[_0xdb01('0x1d')](_0x20f9a3[_0xdb01('0x31')][_0xdb01('0x1d')]);_0x304bae[_0xdb01('0x1c')]=qs[_0xdb01('0x1c')](_0x20f9a3['query'][_0xdb01('0x1c')]);}_0x304bae['order']=qs[_0xdb01('0x38')](_0x20f9a3[_0xdb01('0x31')]['sort']);_0x304bae[_0xdb01('0x39')]=qs[_0xdb01('0x33')](_['pick'](_0x20f9a3[_0xdb01('0x31')],_0x3a43dd[_0xdb01('0x33')]),_0x4d080d);if(_0x20f9a3[_0xdb01('0x31')][_0xdb01('0x3a')]){_0x304bae['where']=_[_0xdb01('0x3b')](_0x304bae[_0xdb01('0x39')],{'$or':_[_0xdb01('0x2a')](_0x4d080d,function(_0xc0d803){if(_0xc0d803[_0xdb01('0x2e')]!=='VIRTUAL'){var _0x4e09ba={};_0x4e09ba[_0xc0d803[_0xdb01('0x27')]]={'$like':'%'+_0x20f9a3[_0xdb01('0x31')][_0xdb01('0x3a')]+'%'};return _0x4e09ba;}})});}_0x304bae=_[_0xdb01('0x3b')]({},_0x304bae,_0x20f9a3['options']);var _0x2024fb={'where':_0x304bae[_0xdb01('0x39')]};return db[_0xdb01('0x2b')][_0xdb01('0x1f')](_0x2024fb)[_0xdb01('0x25')](function(_0x3ab83e){_0x23f029[_0xdb01('0x1f')]=_0x3ab83e;if(_0x20f9a3[_0xdb01('0x31')][_0xdb01('0x3c')]){_0x304bae[_0xdb01('0x3d')]=[{'all':!![]}];}return db[_0xdb01('0x2b')]['findAll'](_0x304bae);})[_0xdb01('0x25')](function(_0x3435ae){_0x23f029[_0xdb01('0x3e')]=_0x3435ae;return _0x23f029;})[_0xdb01('0x25')](respondWithFilteredResult(_0x3c6d83,_0x304bae))[_0xdb01('0x3f')](handleError(_0x3c6d83,null));};exports[_0xdb01('0x40')]=function(_0x27cfe7,_0x2bf236){var _0x4b8bf6={'raw':!![],'where':{'id':_0x27cfe7[_0xdb01('0x41')]['id']}},_0x57b32a={};_0x57b32a['model']=_['keys'](db['SquareReport'][_0xdb01('0x2c')]);_0x57b32a[_0xdb01('0x31')]=_[_0xdb01('0x32')](_0x27cfe7[_0xdb01('0x31')]);_0x57b32a[_0xdb01('0x33')]=_[_0xdb01('0x34')](_0x57b32a[_0xdb01('0x30')],_0x57b32a[_0xdb01('0x31')]);_0x4b8bf6[_0xdb01('0x35')]=_[_0xdb01('0x34')](_0x57b32a[_0xdb01('0x30')],qs['fields'](_0x27cfe7[_0xdb01('0x31')]['fields']));_0x4b8bf6[_0xdb01('0x35')]=_0x4b8bf6[_0xdb01('0x35')]['length']?_0x4b8bf6[_0xdb01('0x35')]:_0x57b32a['model'];if(_0x27cfe7['query'][_0xdb01('0x3c')]){_0x4b8bf6[_0xdb01('0x3d')]=[{'all':!![]}];}_0x4b8bf6=_[_0xdb01('0x3b')]({},_0x4b8bf6,_0x27cfe7['options']);return db[_0xdb01('0x2b')][_0xdb01('0x42')](_0x4b8bf6)[_0xdb01('0x25')](handleEntityNotFound(_0x2bf236,null))[_0xdb01('0x25')](respondWithResult(_0x2bf236,null))['catch'](handleError(_0x2bf236,null));};exports[_0xdb01('0x43')]=function(_0x2ea2f5,_0x5c1eb6){return db[_0xdb01('0x2b')][_0xdb01('0x43')](_0x2ea2f5[_0xdb01('0x44')],{})['then'](respondWithResult(_0x5c1eb6,0xc9))['catch'](handleError(_0x5c1eb6,null));};exports[_0xdb01('0x23')]=function(_0x446de0,_0xa72ed3){if(_0x446de0[_0xdb01('0x44')]['id']){delete _0x446de0[_0xdb01('0x44')]['id'];}return db[_0xdb01('0x2b')][_0xdb01('0x42')]({'where':{'id':_0x446de0[_0xdb01('0x41')]['id']}})[_0xdb01('0x25')](handleEntityNotFound(_0xa72ed3,null))['then'](saveUpdates(_0x446de0['body'],null))['then'](respondWithResult(_0xa72ed3,null))[_0xdb01('0x3f')](handleError(_0xa72ed3,null));};exports[_0xdb01('0x24')]=function(_0x559e49,_0x484865){return db[_0xdb01('0x2b')][_0xdb01('0x42')]({'where':{'id':_0x559e49[_0xdb01('0x41')]['id']}})[_0xdb01('0x25')](handleEntityNotFound(_0x484865,null))['then'](removeEntity(_0x484865,null))[_0xdb01('0x3f')](handleError(_0x484865,null));};exports['describe']=function(_0x3a12c2,_0x34aa5d){return db[_0xdb01('0x2b')][_0xdb01('0x45')]()[_0xdb01('0x25')](respondWithResult(_0x34aa5d,null))['catch'](handleError(_0x34aa5d,null));}; \ No newline at end of file +var _0x8432=['body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../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','send','map','SquareReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','filter','name','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','create'];(function(_0x3f1c5b,_0x1b6679){var _0x3ae114=function(_0x3648ed){while(--_0x3648ed){_0x3f1c5b['push'](_0x3f1c5b['shift']());}};_0x3ae114(++_0x1b6679);}(_0x8432,0x12f));var _0x2843=function(_0x1dab5f,_0x10cd21){_0x1dab5f=_0x1dab5f-0x0;var _0x40c2f3=_0x8432[_0x1dab5f];return _0x40c2f3;};'use strict';var emlformat=require(_0x2843('0x0'));var rimraf=require(_0x2843('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2843('0x2'));var rp=require('request-promise');var moment=require(_0x2843('0x3'));var BPromise=require(_0x2843('0x4'));var Mustache=require(_0x2843('0x5'));var util=require(_0x2843('0x6'));var path=require(_0x2843('0x7'));var sox=require(_0x2843('0x8'));var csv=require(_0x2843('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2843('0xa'));var _=require(_0x2843('0xb'));var squel=require(_0x2843('0xc'));var crypto=require(_0x2843('0xd'));var jsforce=require(_0x2843('0xe'));var deskjs=require(_0x2843('0xf'));var toCsv=require(_0x2843('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2843('0x10'));var authService=require(_0x2843('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2843('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2843('0x13'))(_0x2843('0x14'));var utils=require(_0x2843('0x15'));var config=require(_0x2843('0x16'));var licenseUtil=require(_0x2843('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35495b,_0x40db0a){_0x40db0a=_0x40db0a||0xcc;return function(_0x465675){if(_0x465675){return _0x35495b[_0x2843('0x18')](_0x40db0a);}return _0x35495b[_0x2843('0x19')](_0x40db0a)[_0x2843('0x1a')]();};}function respondWithResult(_0x15792c,_0x33d6a1){_0x33d6a1=_0x33d6a1||0xc8;return function(_0x24cca8){if(_0x24cca8){return _0x15792c[_0x2843('0x19')](_0x33d6a1)[_0x2843('0x1b')](_0x24cca8);}};}function respondWithFilteredResult(_0x5e8d37,_0x21522f){return function(_0x513606){if(_0x513606){var _0x58e668=typeof _0x21522f[_0x2843('0x1c')]===_0x2843('0x1d')&&typeof _0x21522f[_0x2843('0x1e')]===_0x2843('0x1d');var _0x5d0c4b=_0x513606[_0x2843('0x1f')];var _0x262d19=_0x58e668?0x0:_0x21522f[_0x2843('0x1c')];var _0x2be0c5=_0x58e668?_0x513606[_0x2843('0x1f')]:_0x21522f[_0x2843('0x1c')]+_0x21522f['limit'];var _0x3e6ca6;if(_0x2be0c5>=_0x5d0c4b){_0x2be0c5=_0x5d0c4b;_0x3e6ca6=0xc8;}else{_0x3e6ca6=0xce;}_0x5e8d37['status'](_0x3e6ca6);return _0x5e8d37[_0x2843('0x20')](_0x2843('0x21'),_0x262d19+'-'+_0x2be0c5+'/'+_0x5d0c4b)['json'](_0x513606);}return null;};}function patchUpdates(_0x3987f9){return function(_0x3d8b44){try{jsonpatch[_0x2843('0x22')](_0x3d8b44,_0x3987f9,!![]);}catch(_0x9c4a73){return BPromise[_0x2843('0x23')](_0x9c4a73);}return _0x3d8b44[_0x2843('0x24')]();};}function saveUpdates(_0xd04f1,_0x1c08ad){return function(_0x592233){if(_0x592233){return _0x592233[_0x2843('0x25')](_0xd04f1)[_0x2843('0x26')](function(_0x536370){return _0x536370;});}return null;};}function removeEntity(_0x5657c5,_0x346001){return function(_0xb3ef25){if(_0xb3ef25){return _0xb3ef25[_0x2843('0x27')]()[_0x2843('0x26')](function(){_0x5657c5[_0x2843('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e259,_0x571dc2){return function(_0x47913e){if(!_0x47913e){_0x48e259[_0x2843('0x18')](0x194);}return _0x47913e;};}function handleError(_0x38b85e,_0xcfd85f){_0xcfd85f=_0xcfd85f||0x1f4;return function(_0x517aa6){logger[_0x2843('0x28')](_0x517aa6['stack']);if(_0x517aa6['name']){delete _0x517aa6['name'];}_0x38b85e[_0x2843('0x19')](_0xcfd85f)[_0x2843('0x29')](_0x517aa6);};}exports['index']=function(_0x39f26f,_0x1c4a61){var _0x55adb8={},_0x4238c0={},_0x17d1aa={'count':0x0,'rows':[]};var _0x51693b=_[_0x2843('0x2a')](db[_0x2843('0x2b')][_0x2843('0x2c')],function(_0xab9017){return{'name':_0xab9017[_0x2843('0x2d')],'type':_0xab9017[_0x2843('0x2e')][_0x2843('0x2f')]};});_0x4238c0['model']=_[_0x2843('0x2a')](_0x51693b,'name');_0x4238c0[_0x2843('0x30')]=_[_0x2843('0x31')](_0x39f26f[_0x2843('0x30')]);_0x4238c0[_0x2843('0x32')]=_[_0x2843('0x33')](_0x4238c0[_0x2843('0x34')],_0x4238c0[_0x2843('0x30')]);_0x55adb8[_0x2843('0x35')]=_[_0x2843('0x33')](_0x4238c0[_0x2843('0x34')],qs['fields'](_0x39f26f[_0x2843('0x30')]['fields']));_0x55adb8[_0x2843('0x35')]=_0x55adb8[_0x2843('0x35')][_0x2843('0x36')]?_0x55adb8['attributes']:_0x4238c0[_0x2843('0x34')];if(!_0x39f26f[_0x2843('0x30')][_0x2843('0x37')](_0x2843('0x38'))){_0x55adb8[_0x2843('0x1e')]=qs[_0x2843('0x1e')](_0x39f26f[_0x2843('0x30')][_0x2843('0x1e')]);_0x55adb8[_0x2843('0x1c')]=qs[_0x2843('0x1c')](_0x39f26f['query'][_0x2843('0x1c')]);}_0x55adb8['order']=qs[_0x2843('0x39')](_0x39f26f[_0x2843('0x30')][_0x2843('0x39')]);_0x55adb8[_0x2843('0x3a')]=qs[_0x2843('0x32')](_['pick'](_0x39f26f[_0x2843('0x30')],_0x4238c0['filters']),_0x51693b);if(_0x39f26f[_0x2843('0x30')][_0x2843('0x3b')]){_0x55adb8[_0x2843('0x3a')]=_['merge'](_0x55adb8[_0x2843('0x3a')],{'$or':_[_0x2843('0x2a')](_0x51693b,function(_0x2e4194){if(_0x2e4194[_0x2843('0x2e')]!=='VIRTUAL'){var _0x528e8c={};_0x528e8c[_0x2e4194[_0x2843('0x3c')]]={'$like':'%'+_0x39f26f[_0x2843('0x30')][_0x2843('0x3b')]+'%'};return _0x528e8c;}})});}_0x55adb8=_[_0x2843('0x3d')]({},_0x55adb8,_0x39f26f[_0x2843('0x3e')]);var _0x1d9143={'where':_0x55adb8['where']};return db[_0x2843('0x2b')][_0x2843('0x1f')](_0x1d9143)[_0x2843('0x26')](function(_0x1738d6){_0x17d1aa[_0x2843('0x1f')]=_0x1738d6;if(_0x39f26f['query'][_0x2843('0x3f')]){_0x55adb8[_0x2843('0x40')]=[{'all':!![]}];}return db[_0x2843('0x2b')][_0x2843('0x41')](_0x55adb8);})[_0x2843('0x26')](function(_0x9f48e9){_0x17d1aa[_0x2843('0x42')]=_0x9f48e9;return _0x17d1aa;})[_0x2843('0x26')](respondWithFilteredResult(_0x1c4a61,_0x55adb8))[_0x2843('0x43')](handleError(_0x1c4a61,null));};exports[_0x2843('0x44')]=function(_0x487d9e,_0x3681c5){var _0x4d3569={'raw':!![],'where':{'id':_0x487d9e[_0x2843('0x45')]['id']}},_0x481aef={};_0x481aef[_0x2843('0x34')]=_[_0x2843('0x31')](db[_0x2843('0x2b')]['rawAttributes']);_0x481aef[_0x2843('0x30')]=_[_0x2843('0x31')](_0x487d9e[_0x2843('0x30')]);_0x481aef[_0x2843('0x32')]=_['intersection'](_0x481aef['model'],_0x481aef[_0x2843('0x30')]);_0x4d3569[_0x2843('0x35')]=_[_0x2843('0x33')](_0x481aef[_0x2843('0x34')],qs[_0x2843('0x46')](_0x487d9e[_0x2843('0x30')]['fields']));_0x4d3569['attributes']=_0x4d3569[_0x2843('0x35')][_0x2843('0x36')]?_0x4d3569[_0x2843('0x35')]:_0x481aef[_0x2843('0x34')];if(_0x487d9e[_0x2843('0x30')][_0x2843('0x3f')]){_0x4d3569[_0x2843('0x40')]=[{'all':!![]}];}_0x4d3569=_[_0x2843('0x3d')]({},_0x4d3569,_0x487d9e[_0x2843('0x3e')]);return db[_0x2843('0x2b')]['find'](_0x4d3569)[_0x2843('0x26')](handleEntityNotFound(_0x3681c5,null))['then'](respondWithResult(_0x3681c5,null))[_0x2843('0x43')](handleError(_0x3681c5,null));};exports['create']=function(_0x338606,_0x37949a){return db[_0x2843('0x2b')][_0x2843('0x47')](_0x338606[_0x2843('0x48')],{})[_0x2843('0x26')](respondWithResult(_0x37949a,0xc9))[_0x2843('0x43')](handleError(_0x37949a,null));};exports[_0x2843('0x25')]=function(_0x391297,_0x2e371d){if(_0x391297[_0x2843('0x48')]['id']){delete _0x391297[_0x2843('0x48')]['id'];}return db['SquareReport'][_0x2843('0x49')]({'where':{'id':_0x391297[_0x2843('0x45')]['id']}})[_0x2843('0x26')](handleEntityNotFound(_0x2e371d,null))[_0x2843('0x26')](saveUpdates(_0x391297[_0x2843('0x48')],null))[_0x2843('0x26')](respondWithResult(_0x2e371d,null))['catch'](handleError(_0x2e371d,null));};exports['destroy']=function(_0x2300cc,_0x51456a){return db['SquareReport']['find']({'where':{'id':_0x2300cc[_0x2843('0x45')]['id']}})[_0x2843('0x26')](handleEntityNotFound(_0x51456a,null))[_0x2843('0x26')](removeEntity(_0x51456a,null))[_0x2843('0x43')](handleError(_0x51456a,null));};exports[_0x2843('0x4a')]=function(_0x59bde3,_0x3826b7){return db[_0x2843('0x2b')]['describe']()[_0x2843('0x26')](respondWithResult(_0x3826b7,null))[_0x2843('0x43')](handleError(_0x3826b7,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 3568738..6c507c0 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 _0x1fe1=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x594400,_0x13598e){var _0x29a8ef=function(_0xe771c3){while(--_0xe771c3){_0x594400['push'](_0x594400['shift']());}};_0x29a8ef(++_0x13598e);}(_0x1fe1,0x17a));var _0x11fe=function(_0x12be85,_0x3d2816){_0x12be85=_0x12be85-0x0;var _0x15ba57=_0x1fe1[_0x12be85];return _0x15ba57;};'use strict';var _=require('lodash');var util=require(_0x11fe('0x0'));var logger=require('../../config/logger')(_0x11fe('0x1'));var moment=require('moment');var BPromise=require(_0x11fe('0x2'));var rp=require(_0x11fe('0x3'));var fs=require('fs');var path=require(_0x11fe('0x4'));var rimraf=require(_0x11fe('0x5'));var config=require(_0x11fe('0x6'));var attributes=require('./squareReport.attributes');module[_0x11fe('0x7')]=function(_0x46f273,_0x4ad371){return _0x46f273[_0x11fe('0x8')]('SquareReport',attributes,{'tableName':_0x11fe('0x9'),'paranoid':![],'indexes':[{'name':_0x11fe('0xa'),'fields':[_0x11fe('0xb'),_0x11fe('0xc')]},{'name':_0x11fe('0xd'),'fields':[_0x11fe('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2e3=['exports','define','SquareReport','report_square','project_name','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x25cc44,_0x4cc32c){var _0x5df637=function(_0x4f2e0f){while(--_0x4f2e0f){_0x25cc44['push'](_0x25cc44['shift']());}};_0x5df637(++_0x4cc32c);}(_0xe2e3,0x1a9));var _0x3e2e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xe2e3[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x3e2e('0x0'));var util=require(_0x3e2e('0x1'));var logger=require(_0x3e2e('0x2'))('api');var moment=require(_0x3e2e('0x3'));var BPromise=require(_0x3e2e('0x4'));var rp=require(_0x3e2e('0x5'));var fs=require('fs');var path=require(_0x3e2e('0x6'));var rimraf=require(_0x3e2e('0x7'));var config=require(_0x3e2e('0x8'));var attributes=require(_0x3e2e('0x9'));module[_0x3e2e('0xa')]=function(_0x22d5d1,_0x371642){return _0x22d5d1[_0x3e2e('0xb')](_0x3e2e('0xc'),attributes,{'tableName':_0x3e2e('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x3e2e('0xe')]},{'name':'leaveAt','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 c6cb2c9..b14414c 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 _0x813a=['SquareReport','body','options','raw','UpdateSquareReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareReport'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x813a,0xf6));var _0xa813=function(_0x5d60f4,_0x508d87){_0x5d60f4=_0x5d60f4-0x0;var _0x35f7d9=_0x813a[_0x5d60f4];return _0x35f7d9;};'use strict';var _=require(_0xa813('0x0'));var util=require(_0xa813('0x1'));var moment=require(_0xa813('0x2'));var BPromise=require(_0xa813('0x3'));var rs=require(_0xa813('0x4'));var fs=require('fs');var Redis=require(_0xa813('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa813('0x6'));var logger=require(_0xa813('0x7'))('rpc');var config=require(_0xa813('0x8'));var jayson=require(_0xa813('0x9'));var client=jayson[_0xa813('0xa')][_0xa813('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c4904,_0x2e6817,_0xf070ab){return new BPromise(function(_0x5d826e,_0x28ad3d){return client[_0xa813('0xc')](_0x4c4904,_0xf070ab)[_0xa813('0xd')](function(_0x440e14){logger['info'](_0xa813('0xe'),_0x2e6817,'request\x20sent');logger[_0xa813('0xf')](_0xa813('0x10'),_0x2e6817,_0xa813('0x11'),JSON[_0xa813('0x12')](_0x440e14));if(_0x440e14[_0xa813('0x13')]){if(_0x440e14[_0xa813('0x13')][_0xa813('0x14')]===0x1f4){logger[_0xa813('0x13')](_0xa813('0xe'),_0x2e6817,_0x440e14['error'][_0xa813('0x15')]);return _0x28ad3d(_0x440e14[_0xa813('0x13')][_0xa813('0x15')]);}logger[_0xa813('0x13')](_0xa813('0xe'),_0x2e6817,_0x440e14['error']['message']);return _0x5d826e(_0x440e14['error'][_0xa813('0x15')]);}else{logger[_0xa813('0x16')](_0xa813('0xe'),_0x2e6817,_0xa813('0x11'));_0x5d826e(_0x440e14[_0xa813('0x17')][_0xa813('0x15')]);}})[_0xa813('0x18')](function(_0x2a15c9){logger[_0xa813('0x13')]('SquareReport,\x20%s,\x20%s',_0x2e6817,_0x2a15c9);_0x28ad3d(_0x2a15c9);});});}exports[_0xa813('0x19')]=function(_0x14f6e9){var _0x40aacf=this;return new Promise(function(_0x54ce47,_0x3dc5fa){return db[_0xa813('0x1a')]['create'](_0x14f6e9[_0xa813('0x1b')],{'raw':_0x14f6e9[_0xa813('0x1c')]?_0x14f6e9[_0xa813('0x1c')][_0xa813('0x1d')]===undefined?!![]:![]:!![]})[_0xa813('0xd')](function(_0x51ad0b){logger[_0xa813('0x16')](_0xa813('0x19'),_0x14f6e9);logger['debug']('CreateSquareReport',_0x14f6e9,JSON[_0xa813('0x12')](_0x51ad0b));_0x54ce47(_0x51ad0b);})['catch'](function(_0x1e012a){logger[_0xa813('0x13')](_0xa813('0x19'),_0x1e012a[_0xa813('0x15')],_0x14f6e9);_0x3dc5fa(_0x40aacf[_0xa813('0x13')](0x1f4,_0x1e012a[_0xa813('0x15')]));});});};exports[_0xa813('0x1e')]=function(_0x3d443){var _0x222c04=this;return new Promise(function(_0x4a6cc,_0x3deb7b){return db[_0xa813('0x1a')][_0xa813('0x1f')](_0x3d443[_0xa813('0x1b')],{'raw':_0x3d443[_0xa813('0x1c')]?_0x3d443['options'][_0xa813('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d443['options']?_0x3d443['options']['where']||null:null,'attributes':_0x3d443[_0xa813('0x1c')]?_0x3d443[_0xa813('0x1c')][_0xa813('0x20')]||null:null,'limit':_0x3d443['options']?_0x3d443[_0xa813('0x1c')][_0xa813('0x21')]||null:null})[_0xa813('0xd')](function(_0x597bbd){logger[_0xa813('0x16')](_0xa813('0x1e'),_0x3d443);logger['debug']('UpdateSquareReport',_0x3d443,JSON[_0xa813('0x12')](_0x597bbd));_0x4a6cc(_0x597bbd);})[_0xa813('0x18')](function(_0x557cdb){logger[_0xa813('0x13')]('UpdateSquareReport',_0x557cdb[_0xa813('0x15')],_0x3d443);_0x3deb7b(_0x222c04[_0xa813('0x13')](0x1f4,_0x557cdb[_0xa813('0x15')]));});});}; \ No newline at end of file +var _0x3770=['error','code','message','result','catch','SquareReport','create','raw','CreateSquareReport','stringify','UpdateSquareReport','update','body','options','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x10f2b2,_0x13e069){var _0x48de6f=function(_0x337b45){while(--_0x337b45){_0x10f2b2['push'](_0x10f2b2['shift']());}};_0x48de6f(++_0x13e069);}(_0x3770,0x1b0));var _0x0377=function(_0x5f1161,_0x2d266e){_0x5f1161=_0x5f1161-0x0;var _0x1b3b12=_0x3770[_0x5f1161];return _0x1b3b12;};'use strict';var _=require(_0x0377('0x0'));var util=require('util');var moment=require(_0x0377('0x1'));var BPromise=require(_0x0377('0x2'));var rs=require(_0x0377('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0377('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0377('0x5'));var jayson=require(_0x0377('0x6'));var client=jayson[_0x0377('0x7')][_0x0377('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2833df,_0x6b0785,_0x33891d){return new BPromise(function(_0x196566,_0x190acc){return client[_0x0377('0x9')](_0x2833df,_0x33891d)[_0x0377('0xa')](function(_0x2efb96){logger[_0x0377('0xb')](_0x0377('0xc'),_0x6b0785,_0x0377('0xd'));logger[_0x0377('0xe')](_0x0377('0xf'),_0x6b0785,_0x0377('0xd'),JSON['stringify'](_0x2efb96));if(_0x2efb96['error']){if(_0x2efb96[_0x0377('0x10')][_0x0377('0x11')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x6b0785,_0x2efb96[_0x0377('0x10')][_0x0377('0x12')]);return _0x190acc(_0x2efb96[_0x0377('0x10')]['message']);}logger[_0x0377('0x10')](_0x0377('0xc'),_0x6b0785,_0x2efb96['error'][_0x0377('0x12')]);return _0x196566(_0x2efb96[_0x0377('0x10')][_0x0377('0x12')]);}else{logger[_0x0377('0xb')](_0x0377('0xc'),_0x6b0785,_0x0377('0xd'));_0x196566(_0x2efb96[_0x0377('0x13')][_0x0377('0x12')]);}})[_0x0377('0x14')](function(_0x51e299){logger[_0x0377('0x10')](_0x0377('0xc'),_0x6b0785,_0x51e299);_0x190acc(_0x51e299);});});}exports['CreateSquareReport']=function(_0x96f7f){var _0x2c0d93=this;return new Promise(function(_0x434c20,_0x44d6c9){return db[_0x0377('0x15')][_0x0377('0x16')](_0x96f7f['body'],{'raw':_0x96f7f['options']?_0x96f7f['options'][_0x0377('0x17')]===undefined?!![]:![]:!![]})[_0x0377('0xa')](function(_0xfad6ea){logger[_0x0377('0xb')](_0x0377('0x18'),_0x96f7f);logger[_0x0377('0xe')](_0x0377('0x18'),_0x96f7f,JSON[_0x0377('0x19')](_0xfad6ea));_0x434c20(_0xfad6ea);})['catch'](function(_0x17ec5e){logger[_0x0377('0x10')](_0x0377('0x18'),_0x17ec5e[_0x0377('0x12')],_0x96f7f);_0x44d6c9(_0x2c0d93[_0x0377('0x10')](0x1f4,_0x17ec5e[_0x0377('0x12')]));});});};exports[_0x0377('0x1a')]=function(_0x10269b){var _0x5936de=this;return new Promise(function(_0x4fd989,_0x11f3e0){return db[_0x0377('0x15')][_0x0377('0x1b')](_0x10269b[_0x0377('0x1c')],{'raw':_0x10269b[_0x0377('0x1d')]?_0x10269b[_0x0377('0x1d')][_0x0377('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10269b[_0x0377('0x1d')]?_0x10269b[_0x0377('0x1d')]['where']||null:null,'attributes':_0x10269b[_0x0377('0x1d')]?_0x10269b[_0x0377('0x1d')][_0x0377('0x1e')]||null:null,'limit':_0x10269b[_0x0377('0x1d')]?_0x10269b[_0x0377('0x1d')][_0x0377('0x1f')]||null:null})[_0x0377('0xa')](function(_0x4f48f0){logger[_0x0377('0xb')](_0x0377('0x1a'),_0x10269b);logger[_0x0377('0xe')]('UpdateSquareReport',_0x10269b,JSON[_0x0377('0x19')](_0x4f48f0));_0x4fd989(_0x4f48f0);})[_0x0377('0x14')](function(_0x2a4b2d){logger[_0x0377('0x10')]('UpdateSquareReport',_0x2a4b2d[_0x0377('0x12')],_0x10269b);_0x11f3e0(_0x5936de[_0x0377('0x10')](0x1f4,_0x2a4b2d[_0x0377('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1931d81..2e45f5a 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 _0xadb9=['/describe','describe','/:id','show','post','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3d80e4,_0xc6f416){var _0x4552a4=function(_0xc40297){while(--_0xc40297){_0x3d80e4['push'](_0x3d80e4['shift']());}};_0x4552a4(++_0xc6f416);}(_0xadb9,0x14b));var _0x9adb=function(_0x5c5bdc,_0x4c3f09){_0x5c5bdc=_0x5c5bdc-0x0;var _0x58599b=_0xadb9[_0x5c5bdc];return _0x58599b;};'use strict';var multer=require(_0x9adb('0x0'));var util=require(_0x9adb('0x1'));var path=require('path');var timeout=require(_0x9adb('0x2'));var express=require(_0x9adb('0x3'));var router=express[_0x9adb('0x4')]();var fs_extra=require(_0x9adb('0x5'));var auth=require(_0x9adb('0x6'));var interaction=require(_0x9adb('0x7'));var config=require(_0x9adb('0x8'));var controller=require('./squareReportDetail.controller');router[_0x9adb('0x9')]('/',auth[_0x9adb('0xa')](),controller['index']);router['get'](_0x9adb('0xb'),auth['isAuthenticated'](),controller[_0x9adb('0xc')]);router[_0x9adb('0x9')](_0x9adb('0xd'),auth[_0x9adb('0xa')](),controller[_0x9adb('0xe')]);router[_0x9adb('0xf')]('/',auth[_0x9adb('0xa')](),controller['create']);router['put'](_0x9adb('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9adb('0xd'),auth[_0x9adb('0xa')](),controller[_0x9adb('0x10')]);module[_0x9adb('0x11')]=router; \ No newline at end of file +var _0xbde2=['isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareReportDetail.controller','get'];(function(_0x12e3cb,_0x56b424){var _0x381e17=function(_0x34f495){while(--_0x34f495){_0x12e3cb['push'](_0x12e3cb['shift']());}};_0x381e17(++_0x56b424);}(_0xbde2,0x1e5));var _0x2bde=function(_0x2dda66,_0x599815){_0x2dda66=_0x2dda66-0x0;var _0x5aef63=_0xbde2[_0x2dda66];return _0x5aef63;};'use strict';var multer=require('multer');var util=require(_0x2bde('0x0'));var path=require(_0x2bde('0x1'));var timeout=require(_0x2bde('0x2'));var express=require(_0x2bde('0x3'));var router=express[_0x2bde('0x4')]();var fs_extra=require(_0x2bde('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2bde('0x6'));var config=require('../../config/environment');var controller=require(_0x2bde('0x7'));router[_0x2bde('0x8')]('/',auth[_0x2bde('0x9')](),controller[_0x2bde('0xa')]);router[_0x2bde('0x8')](_0x2bde('0xb'),auth['isAuthenticated'](),controller[_0x2bde('0xc')]);router['get'](_0x2bde('0xd'),auth[_0x2bde('0x9')](),controller[_0x2bde('0xe')]);router[_0x2bde('0xf')]('/',auth[_0x2bde('0x9')](),controller[_0x2bde('0x10')]);router['put'](_0x2bde('0xd'),auth[_0x2bde('0x9')](),controller[_0x2bde('0x11')]);router['delete']('/:id',auth[_0x2bde('0x9')](),controller[_0x2bde('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 75bfbd0..50e5279 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 _0x83ab=['sequelize','exports','STRING'];(function(_0x239c07,_0x135a6f){var _0x3e1d6c=function(_0x15c979){while(--_0x15c979){_0x239c07['push'](_0x239c07['shift']());}};_0x3e1d6c(++_0x135a6f);}(_0x83ab,0xc6));var _0xb83a=function(_0x2ffc46,_0x35ce3c){_0x2ffc46=_0x2ffc46-0x0;var _0x1eda8f=_0x83ab[_0x2ffc46];return _0x1eda8f;};'use strict';var Sequelize=require(_0xb83a('0x0'));module[_0xb83a('0x1')]={'uniqueid':{'type':Sequelize[_0xb83a('0x2')]},'node':{'type':Sequelize[_0xb83a('0x2')]},'application':{'type':Sequelize[_0xb83a('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb83a('0x2')]}}; \ No newline at end of file +var _0x7da6=['TEXT','sequelize','exports','STRING'];(function(_0x9f38cc,_0x187982){var _0x5b353f=function(_0x3e9c4d){while(--_0x3e9c4d){_0x9f38cc['push'](_0x9f38cc['shift']());}};_0x5b353f(++_0x187982);}(_0x7da6,0x199));var _0x67da=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x7da6[_0x51a6d6];return _0x5ef1a8;};'use strict';var Sequelize=require(_0x67da('0x0'));module[_0x67da('0x1')]={'uniqueid':{'type':Sequelize[_0x67da('0x2')]},'node':{'type':Sequelize[_0x67da('0x2')]},'application':{'type':Sequelize[_0x67da('0x2')]},'data':{'type':Sequelize[_0x67da('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index ce0b684..c123a4e 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 _0x2c82=['../../mysqldb','status','json','limit','undefined','offset','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4d3187,_0x267c51){var _0x107906=function(_0x5d759d){while(--_0x5d759d){_0x4d3187['push'](_0x4d3187['shift']());}};_0x107906(++_0x267c51);}(_0x2c82,0x173));var _0x22c8=function(_0x502598,_0x1e95c8){_0x502598=_0x502598-0x0;var _0xbdee21=_0x2c82[_0x502598];return _0xbdee21;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x22c8('0x0'));var jsonpatch=require(_0x22c8('0x1'));var rp=require('request-promise');var moment=require(_0x22c8('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x22c8('0x3'));var util=require(_0x22c8('0x4'));var path=require(_0x22c8('0x5'));var sox=require(_0x22c8('0x6'));var csv=require(_0x22c8('0x7'));var ejs=require(_0x22c8('0x8'));var fs=require('fs');var fs_extra=require(_0x22c8('0x9'));var _=require(_0x22c8('0xa'));var squel=require(_0x22c8('0xb'));var crypto=require(_0x22c8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x22c8('0xd'));var toCsv=require(_0x22c8('0x7'));var querystring=require(_0x22c8('0xe'));var Papa=require('papaparse');var Redis=require(_0x22c8('0xf'));var authService=require(_0x22c8('0x10'));var qs=require(_0x22c8('0x11'));var as=require(_0x22c8('0x12'));var hardwareService=require(_0x22c8('0x13'));var logger=require(_0x22c8('0x14'))(_0x22c8('0x15'));var utils=require(_0x22c8('0x16'));var config=require(_0x22c8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x22c8('0x18'))['db'];function respondWithStatusCode(_0x43a64f,_0x56c7b3){_0x56c7b3=_0x56c7b3||0xcc;return function(_0x32223d){if(_0x32223d){return _0x43a64f['sendStatus'](_0x56c7b3);}return _0x43a64f[_0x22c8('0x19')](_0x56c7b3)['end']();};}function respondWithResult(_0x30e21d,_0x2a3c56){_0x2a3c56=_0x2a3c56||0xc8;return function(_0x1252fb){if(_0x1252fb){return _0x30e21d[_0x22c8('0x19')](_0x2a3c56)[_0x22c8('0x1a')](_0x1252fb);}};}function respondWithFilteredResult(_0x3c32d0,_0x5efca9){return function(_0x459763){if(_0x459763){var _0x226442=typeof _0x5efca9['offset']==='undefined'&&typeof _0x5efca9[_0x22c8('0x1b')]===_0x22c8('0x1c');var _0x11f678=_0x459763['count'];var _0x660221=_0x226442?0x0:_0x5efca9[_0x22c8('0x1d')];var _0x590964=_0x226442?_0x459763[_0x22c8('0x1e')]:_0x5efca9[_0x22c8('0x1d')]+_0x5efca9['limit'];var _0x56eac1;if(_0x590964>=_0x11f678){_0x590964=_0x11f678;_0x56eac1=0xc8;}else{_0x56eac1=0xce;}_0x3c32d0[_0x22c8('0x19')](_0x56eac1);return _0x3c32d0[_0x22c8('0x1f')](_0x22c8('0x20'),_0x660221+'-'+_0x590964+'/'+_0x11f678)['json'](_0x459763);}return null;};}function patchUpdates(_0x4d67cd){return function(_0x35c877){try{jsonpatch['apply'](_0x35c877,_0x4d67cd,!![]);}catch(_0x2d5f66){return BPromise['reject'](_0x2d5f66);}return _0x35c877[_0x22c8('0x21')]();};}function saveUpdates(_0x24a373,_0x428240){return function(_0x378984){if(_0x378984){return _0x378984[_0x22c8('0x22')](_0x24a373)[_0x22c8('0x23')](function(_0x1659e7){return _0x1659e7;});}return null;};}function removeEntity(_0x40f673,_0x15b269){return function(_0xd8a7fb){if(_0xd8a7fb){return _0xd8a7fb[_0x22c8('0x24')]()[_0x22c8('0x23')](function(){_0x40f673[_0x22c8('0x19')](0xcc)[_0x22c8('0x25')]();});}};}function handleEntityNotFound(_0x57c47b,_0x1bd227){return function(_0x1748b3){if(!_0x1748b3){_0x57c47b[_0x22c8('0x26')](0x194);}return _0x1748b3;};}function handleError(_0xfa2446,_0x10c429){_0x10c429=_0x10c429||0x1f4;return function(_0x33b58e){logger[_0x22c8('0x27')](_0x33b58e[_0x22c8('0x28')]);if(_0x33b58e['name']){delete _0x33b58e[_0x22c8('0x29')];}_0xfa2446[_0x22c8('0x19')](_0x10c429)[_0x22c8('0x2a')](_0x33b58e);};}exports[_0x22c8('0x2b')]=function(_0x5ba784,_0x1853aa){var _0x3f762d={},_0xe18410={},_0x46a277={'count':0x0,'rows':[]};var _0x555e28=_[_0x22c8('0x2c')](db[_0x22c8('0x2d')][_0x22c8('0x2e')],function(_0x445504){return{'name':_0x445504[_0x22c8('0x2f')],'type':_0x445504['type'][_0x22c8('0x30')]};});_0xe18410['model']=_[_0x22c8('0x2c')](_0x555e28,'name');_0xe18410[_0x22c8('0x31')]=_['keys'](_0x5ba784['query']);_0xe18410[_0x22c8('0x32')]=_['intersection'](_0xe18410['model'],_0xe18410[_0x22c8('0x31')]);_0x3f762d['attributes']=_[_0x22c8('0x33')](_0xe18410[_0x22c8('0x34')],qs[_0x22c8('0x35')](_0x5ba784[_0x22c8('0x31')][_0x22c8('0x35')]));_0x3f762d[_0x22c8('0x36')]=_0x3f762d[_0x22c8('0x36')][_0x22c8('0x37')]?_0x3f762d['attributes']:_0xe18410[_0x22c8('0x34')];if(!_0x5ba784[_0x22c8('0x31')][_0x22c8('0x38')](_0x22c8('0x39'))){_0x3f762d[_0x22c8('0x1b')]=qs[_0x22c8('0x1b')](_0x5ba784[_0x22c8('0x31')][_0x22c8('0x1b')]);_0x3f762d[_0x22c8('0x1d')]=qs[_0x22c8('0x1d')](_0x5ba784['query']['offset']);}_0x3f762d[_0x22c8('0x3a')]=qs[_0x22c8('0x3b')](_0x5ba784[_0x22c8('0x31')][_0x22c8('0x3b')]);_0x3f762d['where']=qs[_0x22c8('0x32')](_[_0x22c8('0x3c')](_0x5ba784['query'],_0xe18410[_0x22c8('0x32')]),_0x555e28);if(_0x5ba784[_0x22c8('0x31')]['filter']){_0x3f762d['where']=_[_0x22c8('0x3d')](_0x3f762d[_0x22c8('0x3e')],{'$or':_['map'](_0x555e28,function(_0xb44207){if(_0xb44207[_0x22c8('0x3f')]!==_0x22c8('0x40')){var _0x515578={};_0x515578[_0xb44207[_0x22c8('0x29')]]={'$like':'%'+_0x5ba784[_0x22c8('0x31')][_0x22c8('0x41')]+'%'};return _0x515578;}})});}_0x3f762d=_['merge']({},_0x3f762d,_0x5ba784[_0x22c8('0x42')]);var _0x113f32={'where':_0x3f762d[_0x22c8('0x3e')]};return db['SquareDetailsReport'][_0x22c8('0x1e')](_0x113f32)['then'](function(_0xc07965){_0x46a277['count']=_0xc07965;if(_0x5ba784[_0x22c8('0x31')][_0x22c8('0x43')]){_0x3f762d[_0x22c8('0x44')]=[{'all':!![]}];}return db[_0x22c8('0x2d')][_0x22c8('0x45')](_0x3f762d);})[_0x22c8('0x23')](function(_0x8f9b72){_0x46a277[_0x22c8('0x46')]=_0x8f9b72;return _0x46a277;})[_0x22c8('0x23')](respondWithFilteredResult(_0x1853aa,_0x3f762d))[_0x22c8('0x47')](handleError(_0x1853aa,null));};exports[_0x22c8('0x48')]=function(_0x199568,_0x292df3){var _0x3f44a7={'raw':!![],'where':{'id':_0x199568[_0x22c8('0x49')]['id']}},_0x1c4146={};_0x1c4146[_0x22c8('0x34')]=_[_0x22c8('0x4a')](db[_0x22c8('0x2d')]['rawAttributes']);_0x1c4146['query']=_[_0x22c8('0x4a')](_0x199568[_0x22c8('0x31')]);_0x1c4146[_0x22c8('0x32')]=_[_0x22c8('0x33')](_0x1c4146[_0x22c8('0x34')],_0x1c4146['query']);_0x3f44a7[_0x22c8('0x36')]=_[_0x22c8('0x33')](_0x1c4146[_0x22c8('0x34')],qs[_0x22c8('0x35')](_0x199568['query']['fields']));_0x3f44a7[_0x22c8('0x36')]=_0x3f44a7[_0x22c8('0x36')]['length']?_0x3f44a7[_0x22c8('0x36')]:_0x1c4146[_0x22c8('0x34')];if(_0x199568[_0x22c8('0x31')][_0x22c8('0x43')]){_0x3f44a7['include']=[{'all':!![]}];}_0x3f44a7=_[_0x22c8('0x3d')]({},_0x3f44a7,_0x199568['options']);return db['SquareDetailsReport'][_0x22c8('0x4b')](_0x3f44a7)[_0x22c8('0x23')](handleEntityNotFound(_0x292df3,null))[_0x22c8('0x23')](respondWithResult(_0x292df3,null))['catch'](handleError(_0x292df3,null));};exports[_0x22c8('0x4c')]=function(_0x5cd663,_0x1e66b0){return db[_0x22c8('0x2d')][_0x22c8('0x4c')](_0x5cd663[_0x22c8('0x4d')],{})[_0x22c8('0x23')](respondWithResult(_0x1e66b0,0xc9))[_0x22c8('0x47')](handleError(_0x1e66b0,null));};exports[_0x22c8('0x22')]=function(_0x24af74,_0x3a7b12){if(_0x24af74['body']['id']){delete _0x24af74[_0x22c8('0x4d')]['id'];}return db[_0x22c8('0x2d')][_0x22c8('0x4b')]({'where':{'id':_0x24af74[_0x22c8('0x49')]['id']}})[_0x22c8('0x23')](handleEntityNotFound(_0x3a7b12,null))[_0x22c8('0x23')](saveUpdates(_0x24af74[_0x22c8('0x4d')],null))[_0x22c8('0x23')](respondWithResult(_0x3a7b12,null))[_0x22c8('0x47')](handleError(_0x3a7b12,null));};exports[_0x22c8('0x24')]=function(_0x4e2640,_0xc88051){return db[_0x22c8('0x2d')][_0x22c8('0x4b')]({'where':{'id':_0x4e2640['params']['id']}})[_0x22c8('0x23')](handleEntityNotFound(_0xc88051,null))[_0x22c8('0x23')](removeEntity(_0xc88051,null))[_0x22c8('0x47')](handleError(_0xc88051,null));};exports[_0x22c8('0x4e')]=function(_0x267d0a,_0x5cfa34){return db['SquareDetailsReport'][_0x22c8('0x4e')]()[_0x22c8('0x23')](respondWithResult(_0x5cfa34,null))[_0x22c8('0x47')](handleError(_0x5cfa34,null));}; \ No newline at end of file +var _0x36fb=['path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','body','params','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x36fb,0x170));var _0xb36f=function(_0x1decba,_0x43ed37){_0x1decba=_0x1decba-0x0;var _0x538ee2=_0x36fb[_0x1decba];return _0x538ee2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb36f('0x0'));var zipdir=require(_0xb36f('0x1'));var jsonpatch=require(_0xb36f('0x2'));var rp=require(_0xb36f('0x3'));var moment=require('moment');var BPromise=require(_0xb36f('0x4'));var Mustache=require(_0xb36f('0x5'));var util=require(_0xb36f('0x6'));var path=require(_0xb36f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb36f('0x8'));var fs=require('fs');var fs_extra=require(_0xb36f('0x9'));var _=require(_0xb36f('0xa'));var squel=require('squel');var crypto=require(_0xb36f('0xb'));var jsforce=require(_0xb36f('0xc'));var deskjs=require(_0xb36f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb36f('0xe'));var Papa=require(_0xb36f('0xf'));var Redis=require(_0xb36f('0x10'));var authService=require(_0xb36f('0x11'));var qs=require(_0xb36f('0x12'));var as=require(_0xb36f('0x13'));var hardwareService=require(_0xb36f('0x14'));var logger=require(_0xb36f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb36f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d4d16,_0x2f7ea4){_0x2f7ea4=_0x2f7ea4||0xcc;return function(_0x3a2604){if(_0x3a2604){return _0x4d4d16[_0xb36f('0x17')](_0x2f7ea4);}return _0x4d4d16['status'](_0x2f7ea4)[_0xb36f('0x18')]();};}function respondWithResult(_0x26a385,_0x112413){_0x112413=_0x112413||0xc8;return function(_0x14da1a){if(_0x14da1a){return _0x26a385['status'](_0x112413)['json'](_0x14da1a);}};}function respondWithFilteredResult(_0xcf4b67,_0x3cf952){return function(_0x1feb34){if(_0x1feb34){var _0x246015=typeof _0x3cf952[_0xb36f('0x19')]==='undefined'&&typeof _0x3cf952['limit']===_0xb36f('0x1a');var _0x1e6d68=_0x1feb34['count'];var _0x1ae02b=_0x246015?0x0:_0x3cf952[_0xb36f('0x19')];var _0x150b14=_0x246015?_0x1feb34[_0xb36f('0x1b')]:_0x3cf952[_0xb36f('0x19')]+_0x3cf952[_0xb36f('0x1c')];var _0x2cc2d3;if(_0x150b14>=_0x1e6d68){_0x150b14=_0x1e6d68;_0x2cc2d3=0xc8;}else{_0x2cc2d3=0xce;}_0xcf4b67[_0xb36f('0x1d')](_0x2cc2d3);return _0xcf4b67[_0xb36f('0x1e')](_0xb36f('0x1f'),_0x1ae02b+'-'+_0x150b14+'/'+_0x1e6d68)[_0xb36f('0x20')](_0x1feb34);}return null;};}function patchUpdates(_0x2f80ab){return function(_0x4a5269){try{jsonpatch[_0xb36f('0x21')](_0x4a5269,_0x2f80ab,!![]);}catch(_0x34fcf2){return BPromise[_0xb36f('0x22')](_0x34fcf2);}return _0x4a5269[_0xb36f('0x23')]();};}function saveUpdates(_0x105518,_0x258fdd){return function(_0x1fe029){if(_0x1fe029){return _0x1fe029[_0xb36f('0x24')](_0x105518)[_0xb36f('0x25')](function(_0x1b469f){return _0x1b469f;});}return null;};}function removeEntity(_0x4c0879,_0x2c5f82){return function(_0x3fee02){if(_0x3fee02){return _0x3fee02[_0xb36f('0x26')]()[_0xb36f('0x25')](function(){_0x4c0879[_0xb36f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x409f8f,_0x2d3c19){return function(_0x31ca29){if(!_0x31ca29){_0x409f8f['sendStatus'](0x194);}return _0x31ca29;};}function handleError(_0x14ed3d,_0x2aec6c){_0x2aec6c=_0x2aec6c||0x1f4;return function(_0x214d9b){logger[_0xb36f('0x27')](_0x214d9b[_0xb36f('0x28')]);if(_0x214d9b['name']){delete _0x214d9b[_0xb36f('0x29')];}_0x14ed3d[_0xb36f('0x1d')](_0x2aec6c)[_0xb36f('0x2a')](_0x214d9b);};}exports[_0xb36f('0x2b')]=function(_0x467b03,_0x4e9a68){var _0x5c7c9f={},_0x218c6e={},_0x520100={'count':0x0,'rows':[]};var _0xaeaac=_[_0xb36f('0x2c')](db[_0xb36f('0x2d')][_0xb36f('0x2e')],function(_0x55c1bb){return{'name':_0x55c1bb['fieldName'],'type':_0x55c1bb['type'][_0xb36f('0x2f')]};});_0x218c6e['model']=_[_0xb36f('0x2c')](_0xaeaac,_0xb36f('0x29'));_0x218c6e['query']=_[_0xb36f('0x30')](_0x467b03[_0xb36f('0x31')]);_0x218c6e[_0xb36f('0x32')]=_[_0xb36f('0x33')](_0x218c6e[_0xb36f('0x34')],_0x218c6e[_0xb36f('0x31')]);_0x5c7c9f[_0xb36f('0x35')]=_[_0xb36f('0x33')](_0x218c6e[_0xb36f('0x34')],qs[_0xb36f('0x36')](_0x467b03[_0xb36f('0x31')][_0xb36f('0x36')]));_0x5c7c9f[_0xb36f('0x35')]=_0x5c7c9f[_0xb36f('0x35')][_0xb36f('0x37')]?_0x5c7c9f[_0xb36f('0x35')]:_0x218c6e['model'];if(!_0x467b03['query']['hasOwnProperty'](_0xb36f('0x38'))){_0x5c7c9f['limit']=qs[_0xb36f('0x1c')](_0x467b03['query'][_0xb36f('0x1c')]);_0x5c7c9f['offset']=qs[_0xb36f('0x19')](_0x467b03[_0xb36f('0x31')][_0xb36f('0x19')]);}_0x5c7c9f[_0xb36f('0x39')]=qs[_0xb36f('0x3a')](_0x467b03[_0xb36f('0x31')][_0xb36f('0x3a')]);_0x5c7c9f[_0xb36f('0x3b')]=qs[_0xb36f('0x32')](_['pick'](_0x467b03[_0xb36f('0x31')],_0x218c6e[_0xb36f('0x32')]),_0xaeaac);if(_0x467b03[_0xb36f('0x31')][_0xb36f('0x3c')]){_0x5c7c9f[_0xb36f('0x3b')]=_[_0xb36f('0x3d')](_0x5c7c9f[_0xb36f('0x3b')],{'$or':_[_0xb36f('0x2c')](_0xaeaac,function(_0x117021){if(_0x117021[_0xb36f('0x3e')]!==_0xb36f('0x3f')){var _0x32e2e5={};_0x32e2e5[_0x117021['name']]={'$like':'%'+_0x467b03[_0xb36f('0x31')][_0xb36f('0x3c')]+'%'};return _0x32e2e5;}})});}_0x5c7c9f=_[_0xb36f('0x3d')]({},_0x5c7c9f,_0x467b03[_0xb36f('0x40')]);var _0x419fb9={'where':_0x5c7c9f['where']};return db[_0xb36f('0x2d')][_0xb36f('0x1b')](_0x419fb9)[_0xb36f('0x25')](function(_0x32b734){_0x520100[_0xb36f('0x1b')]=_0x32b734;if(_0x467b03[_0xb36f('0x31')][_0xb36f('0x41')]){_0x5c7c9f[_0xb36f('0x42')]=[{'all':!![]}];}return db[_0xb36f('0x2d')][_0xb36f('0x43')](_0x5c7c9f);})[_0xb36f('0x25')](function(_0x215b92){_0x520100[_0xb36f('0x44')]=_0x215b92;return _0x520100;})['then'](respondWithFilteredResult(_0x4e9a68,_0x5c7c9f))['catch'](handleError(_0x4e9a68,null));};exports[_0xb36f('0x45')]=function(_0x5a8d21,_0x21ea98){var _0x2d294b={'raw':!![],'where':{'id':_0x5a8d21['params']['id']}},_0x1cd322={};_0x1cd322[_0xb36f('0x34')]=_[_0xb36f('0x30')](db['SquareDetailsReport'][_0xb36f('0x2e')]);_0x1cd322['query']=_[_0xb36f('0x30')](_0x5a8d21[_0xb36f('0x31')]);_0x1cd322[_0xb36f('0x32')]=_[_0xb36f('0x33')](_0x1cd322[_0xb36f('0x34')],_0x1cd322[_0xb36f('0x31')]);_0x2d294b['attributes']=_[_0xb36f('0x33')](_0x1cd322[_0xb36f('0x34')],qs[_0xb36f('0x36')](_0x5a8d21[_0xb36f('0x31')][_0xb36f('0x36')]));_0x2d294b[_0xb36f('0x35')]=_0x2d294b['attributes'][_0xb36f('0x37')]?_0x2d294b['attributes']:_0x1cd322[_0xb36f('0x34')];if(_0x5a8d21[_0xb36f('0x31')][_0xb36f('0x41')]){_0x2d294b[_0xb36f('0x42')]=[{'all':!![]}];}_0x2d294b=_[_0xb36f('0x3d')]({},_0x2d294b,_0x5a8d21[_0xb36f('0x40')]);return db[_0xb36f('0x2d')]['find'](_0x2d294b)[_0xb36f('0x25')](handleEntityNotFound(_0x21ea98,null))[_0xb36f('0x25')](respondWithResult(_0x21ea98,null))[_0xb36f('0x46')](handleError(_0x21ea98,null));};exports[_0xb36f('0x47')]=function(_0x2c0752,_0x24f72f){return db[_0xb36f('0x2d')][_0xb36f('0x47')](_0x2c0752[_0xb36f('0x48')],{})[_0xb36f('0x25')](respondWithResult(_0x24f72f,0xc9))['catch'](handleError(_0x24f72f,null));};exports[_0xb36f('0x24')]=function(_0x293825,_0x2a3881){if(_0x293825[_0xb36f('0x48')]['id']){delete _0x293825[_0xb36f('0x48')]['id'];}return db[_0xb36f('0x2d')]['find']({'where':{'id':_0x293825[_0xb36f('0x49')]['id']}})[_0xb36f('0x25')](handleEntityNotFound(_0x2a3881,null))[_0xb36f('0x25')](saveUpdates(_0x293825[_0xb36f('0x48')],null))['then'](respondWithResult(_0x2a3881,null))[_0xb36f('0x46')](handleError(_0x2a3881,null));};exports[_0xb36f('0x26')]=function(_0x3436d5,_0x2600f1){return db[_0xb36f('0x2d')][_0xb36f('0x4a')]({'where':{'id':_0x3436d5[_0xb36f('0x49')]['id']}})[_0xb36f('0x25')](handleEntityNotFound(_0x2600f1,null))[_0xb36f('0x25')](removeEntity(_0x2600f1,null))['catch'](handleError(_0x2600f1,null));};exports['describe']=function(_0x44064a,_0x3a77d1){return db['SquareDetailsReport']['describe']()[_0xb36f('0x25')](respondWithResult(_0x3a77d1,null))[_0xb36f('0x46')](handleError(_0x3a77d1,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 08e6858..c2850b9 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 _0x7f88=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7f88,0x18c));var _0x87f8=function(_0x164aa6,_0x579f55){_0x164aa6=_0x164aa6-0x0;var _0x241062=_0x7f88[_0x164aa6];return _0x241062;};'use strict';var _=require(_0x87f8('0x0'));var util=require('util');var logger=require(_0x87f8('0x1'))(_0x87f8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x87f8('0x3'));var fs=require('fs');var path=require(_0x87f8('0x4'));var rimraf=require(_0x87f8('0x5'));var config=require(_0x87f8('0x6'));var attributes=require(_0x87f8('0x7'));module[_0x87f8('0x8')]=function(_0x59491c,_0x2abd0f){return _0x59491c[_0x87f8('0x9')](_0x87f8('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0afb=['bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x241ada,_0x38127a){var _0x3662b7=function(_0x35e5a0){while(--_0x35e5a0){_0x241ada['push'](_0x241ada['shift']());}};_0x3662b7(++_0x38127a);}(_0x0afb,0x191));var _0xb0af=function(_0x477981,_0x1fec8a){_0x477981=_0x477981-0x0;var _0xda66dc=_0x0afb[_0x477981];return _0xda66dc;};'use strict';var _=require(_0xb0af('0x0'));var util=require(_0xb0af('0x1'));var logger=require(_0xb0af('0x2'))(_0xb0af('0x3'));var moment=require(_0xb0af('0x4'));var BPromise=require(_0xb0af('0x5'));var rp=require(_0xb0af('0x6'));var fs=require('fs');var path=require(_0xb0af('0x7'));var rimraf=require('rimraf');var config=require(_0xb0af('0x8'));var attributes=require(_0xb0af('0x9'));module[_0xb0af('0xa')]=function(_0x2ffbd7,_0x2029c2){return _0x2ffbd7[_0xb0af('0xb')](_0xb0af('0xc'),attributes,{'tableName':_0xb0af('0xd'),'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 b41d5cf..a789e50 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 _0xae60=['client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x1ec7b0,_0x2eb52a){var _0x5aff54=function(_0x1af5e6){while(--_0x1af5e6){_0x1ec7b0['push'](_0x1ec7b0['shift']());}};_0x5aff54(++_0x2eb52a);}(_0xae60,0x1c7));var _0x0ae6=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xae60[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fed4,_0xbb596c,_0x447a1d){return new BPromise(function(_0x120910,_0x1b5e80){return client['request'](_0x46fed4,_0x447a1d)[_0x0ae6('0xb')](function(_0x36a5e0){logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,'request\x20sent');logger[_0x0ae6('0xe')](_0x0ae6('0xf'),_0xbb596c,_0x0ae6('0x10'),JSON[_0x0ae6('0x11')](_0x36a5e0));if(_0x36a5e0[_0x0ae6('0x12')]){if(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x13')]===0x1f4){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x1b5e80(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}logger[_0x0ae6('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x120910(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}else{logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,_0x0ae6('0x10'));_0x120910(_0x36a5e0[_0x0ae6('0x15')][_0x0ae6('0x14')]);}})[_0x0ae6('0x16')](function(_0x8a4c9a){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x8a4c9a);_0x1b5e80(_0x8a4c9a);});});}exports[_0x0ae6('0x17')]=function(_0xda4f01){var _0x3f5c41=this;return new Promise(function(_0x2fdf25,_0x1735ba){return db[_0x0ae6('0x18')][_0x0ae6('0x19')](_0xda4f01[_0x0ae6('0x1a')],{'raw':_0xda4f01[_0x0ae6('0x1b')]?_0xda4f01['options'][_0x0ae6('0x1c')]===undefined?!![]:![]:!![]})[_0x0ae6('0xb')](function(_0x140a3b){logger[_0x0ae6('0xc')](_0x0ae6('0x17'),_0xda4f01);logger[_0x0ae6('0xe')](_0x0ae6('0x17'),_0xda4f01,JSON[_0x0ae6('0x11')](_0x140a3b));_0x2fdf25(_0x140a3b);})['catch'](function(_0x39b22e){logger[_0x0ae6('0x12')](_0x0ae6('0x17'),_0x39b22e[_0x0ae6('0x14')],_0xda4f01);_0x1735ba(_0x3f5c41[_0x0ae6('0x12')](0x1f4,_0x39b22e['message']));});});}; \ No newline at end of file +var _0xa7fa=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x19e08e,_0x178f46){var _0x14c229=function(_0x791b3b){while(--_0x791b3b){_0x19e08e['push'](_0x19e08e['shift']());}};_0x14c229(++_0x178f46);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa7f('0x1'));var rs=require(_0xaa7f('0x2'));var fs=require('fs');var Redis=require(_0xaa7f('0x3'));var db=require(_0xaa7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa7f('0x5'))(_0xaa7f('0x6'));var config=require(_0xaa7f('0x7'));var jayson=require(_0xaa7f('0x8'));var client=jayson['client'][_0xaa7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48105b,_0x50bab6,_0x3898a3){return new BPromise(function(_0x506a91,_0x3ac236){return client[_0xaa7f('0xa')](_0x48105b,_0x3898a3)[_0xaa7f('0xb')](function(_0x2dbcb6){logger['info'](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));logger['debug'](_0xaa7f('0xe'),_0x50bab6,_0xaa7f('0xd'),JSON[_0xaa7f('0xf')](_0x2dbcb6));if(_0x2dbcb6[_0xaa7f('0x10')]){if(_0x2dbcb6['error']['code']===0x1f4){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);return _0x3ac236(_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);}logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')]['message']);return _0x506a91(_0x2dbcb6[_0xaa7f('0x10')]['message']);}else{logger[_0xaa7f('0x12')](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));_0x506a91(_0x2dbcb6['result'][_0xaa7f('0x11')]);}})[_0xaa7f('0x13')](function(_0x1bd3f9){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x1bd3f9);_0x3ac236(_0x1bd3f9);});});}exports[_0xaa7f('0x14')]=function(_0x2c17c4){var _0x4fbd09=this;return new Promise(function(_0x90863a,_0x1e18a6){return db[_0xaa7f('0x15')][_0xaa7f('0x16')](_0x2c17c4['body'],{'raw':_0x2c17c4['options']?_0x2c17c4[_0xaa7f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaa7f('0xb')](function(_0x21e870){logger['info'](_0xaa7f('0x14'),_0x2c17c4);logger['debug'](_0xaa7f('0x14'),_0x2c17c4,JSON[_0xaa7f('0xf')](_0x21e870));_0x90863a(_0x21e870);})[_0xaa7f('0x13')](function(_0x516d7e){logger[_0xaa7f('0x10')](_0xaa7f('0x14'),_0x516d7e[_0xaa7f('0x11')],_0x2c17c4);_0x1e18a6(_0x4fbd09[_0xaa7f('0x10')](0x1f4,_0x516d7e['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 2eb78be..dadec60 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 _0x5985=['../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express'];(function(_0xecd443,_0x204ed3){var _0xe8f314=function(_0x24d538){while(--_0x24d538){_0xecd443['push'](_0xecd443['shift']());}};_0xe8f314(++_0x204ed3);}(_0x5985,0x19f));var _0x5598=function(_0x514412,_0x4ec8af){_0x514412=_0x514412-0x0;var _0x3c37c3=_0x5985[_0x514412];return _0x3c37c3;};'use strict';var express=require(_0x5598('0x0'));var router=express['Router']();var auth=require(_0x5598('0x1'));var controller=require(_0x5598('0x2'));router[_0x5598('0x3')]('/',auth[_0x5598('0x4')](),controller['index']);router['get'](_0x5598('0x5'),auth[_0x5598('0x4')](),controller[_0x5598('0x6')]);module[_0x5598('0x7')]=router; \ No newline at end of file +var _0xf11e=['/process/:pid/kill','killProcess','express','Router','../../components/auth/service','isAuthenticated','index','get'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0xf11e,0x172));var _0xef11=function(_0x88e22a,_0x5ae6f5){_0x88e22a=_0x88e22a-0x0;var _0x543ab6=_0xf11e[_0x88e22a];return _0x543ab6;};'use strict';var express=require(_0xef11('0x0'));var router=express[_0xef11('0x1')]();var auth=require(_0xef11('0x2'));var controller=require('./system.controller');router['get']('/',auth[_0xef11('0x3')](),controller[_0xef11('0x4')]);router[_0xef11('0x5')](_0xef11('0x6'),auth[_0xef11('0x3')](),controller[_0xef11('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 037ea7b..ce6f1e2 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 _0x2b88=['kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','then','json','killProcess','components/import/cm','format','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x2b88,0x1cf));var _0x82b8=function(_0x1bdfb6,_0x2dd242){_0x1bdfb6=_0x1bdfb6-0x0;var _0x5c124d=_0x2b88[_0x1bdfb6];return _0x5c124d;};'use strict';var info=require(_0x82b8('0x0'));var exec=require(_0x82b8('0x1'))[_0x82b8('0x2')];var logger=require(_0x82b8('0x3'))(_0x82b8('0x4'));var util=require(_0x82b8('0x5'));var BPromise=require(_0x82b8('0x6'));var _=require('lodash');function handleError(_0x61ed24,_0x5d444c,_0x143939){_0x5d444c=_0x5d444c||0x1f4;return function(_0xfdd11d){logger[_0x82b8('0x7')](_0x82b8('0x8'),_0x143939,_0x5d444c,util['inspect'](_0xfdd11d,{'showHidden':![],'depth':null}));delete _0xfdd11d[_0x82b8('0x9')];_0x61ed24[_0x82b8('0xa')](_0x5d444c)[_0x82b8('0xb')](_0xfdd11d);};}exports[_0x82b8('0xc')]=function(_0x5029af,_0xb960b5){return info['getAllData']()[_0x82b8('0xd')](function(_0x52af22){return _0xb960b5[_0x82b8('0xa')](0xc8)[_0x82b8('0xe')](_0x52af22);})['catch'](function(_0x225c0b){return _0xb960b5[_0x82b8('0xa')](0x1f4)[_0x82b8('0xe')](_0x225c0b);});};exports[_0x82b8('0xf')]=function(_0x15c856,_0x566757){var _0x546563=[_0x82b8('0x10')];return new BPromise(function(_0x5e3ab6,_0x3eecaf){return exec(util[_0x82b8('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x15c856[_0x82b8('0x12')][_0x82b8('0x13')]),function(_0x1388fa,_0x3b96fa,_0x202e50){if(_0x1388fa){return _0x3eecaf(_0x1388fa);}return _0x5e3ab6(_0x3b96fa);});})['then'](function(_0x11d162){var _0x368341=![];var _0x292076=_0x11d162['split'](/\n/);for(var _0x214dd5=0x0,_0x43ea90=_0x546563[_0x82b8('0x14')];_0x214dd5<_0x43ea90,_0x368341===![];_0x214dd5+=0x1){if(_0x11d162[_0x82b8('0x15')](_0x546563[_0x214dd5])>=0x0){_0x368341=!![];}}if(!_0x368341){throw new Error(util[_0x82b8('0x11')](_0x82b8('0x16'),_0x15c856[_0x82b8('0x12')]['pid']));}process[_0x82b8('0x17')](_0x15c856[_0x82b8('0x12')][_0x82b8('0x13')],_0x82b8('0x18'));return _0x566757[_0x82b8('0xa')](0xc8)[_0x82b8('0xe')]({'message':util[_0x82b8('0x11')](_0x82b8('0x19'),_0x15c856['params'][_0x82b8('0x13')])});})[_0x82b8('0x1a')](handleError(_0x566757,null,_0x82b8('0xf')));}; \ No newline at end of file +var _0xb6b7=['length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','pid','killProcess','systeminformation','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','getAllData','json','catch','components/import/cm','format','params','then','split'];(function(_0x92fd5e,_0x4ca56d){var _0x5d44db=function(_0x5c8254){while(--_0x5c8254){_0x92fd5e['push'](_0x92fd5e['shift']());}};_0x5d44db(++_0x4ca56d);}(_0xb6b7,0x89));var _0x7b6b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb6b7[_0x3bf83f];return _0x22c4a9;};'use strict';var info=require(_0x7b6b('0x0'));var exec=require('child_process')[_0x7b6b('0x1')];var logger=require('../../config/logger')(_0x7b6b('0x2'));var util=require(_0x7b6b('0x3'));var BPromise=require(_0x7b6b('0x4'));var _=require(_0x7b6b('0x5'));function handleError(_0x13e581,_0x9bc645,_0xb00ef8){_0x9bc645=_0x9bc645||0x1f4;return function(_0x1bdabe){logger[_0x7b6b('0x6')](_0x7b6b('0x7'),_0xb00ef8,_0x9bc645,util[_0x7b6b('0x8')](_0x1bdabe,{'showHidden':![],'depth':null}));delete _0x1bdabe[_0x7b6b('0x9')];_0x13e581[_0x7b6b('0xa')](_0x9bc645)['send'](_0x1bdabe);};}exports['index']=function(_0x85f9b3,_0x457ffb){return info[_0x7b6b('0xb')]()['then'](function(_0x548ec9){return _0x457ffb[_0x7b6b('0xa')](0xc8)[_0x7b6b('0xc')](_0x548ec9);})[_0x7b6b('0xd')](function(_0x1f82af){return _0x457ffb[_0x7b6b('0xa')](0x1f4)[_0x7b6b('0xc')](_0x1f82af);});};exports['killProcess']=function(_0x13e019,_0x198868){var _0x423a36=[_0x7b6b('0xe')];return new BPromise(function(_0xee2250,_0x144b8c){return exec(util[_0x7b6b('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x13e019[_0x7b6b('0x10')]['pid']),function(_0x1772a4,_0x5aba20,_0xf53107){if(_0x1772a4){return _0x144b8c(_0x1772a4);}return _0xee2250(_0x5aba20);});})[_0x7b6b('0x11')](function(_0x2637d9){var _0x58ee9c=![];var _0x3ef93d=_0x2637d9[_0x7b6b('0x12')](/\n/);for(var _0x4c055d=0x0,_0x16ce13=_0x423a36[_0x7b6b('0x13')];_0x4c055d<_0x16ce13,_0x58ee9c===![];_0x4c055d+=0x1){if(_0x2637d9[_0x7b6b('0x14')](_0x423a36[_0x4c055d])>=0x0){_0x58ee9c=!![];}}if(!_0x58ee9c){throw new Error(util[_0x7b6b('0xf')](_0x7b6b('0x15'),_0x13e019[_0x7b6b('0x10')]['pid']));}process[_0x7b6b('0x16')](_0x13e019[_0x7b6b('0x10')]['pid'],'SIGINT');return _0x198868[_0x7b6b('0xa')](0xc8)[_0x7b6b('0xc')]({'message':util[_0x7b6b('0xf')](_0x7b6b('0x17'),_0x13e019[_0x7b6b('0x10')][_0x7b6b('0x18')])});})[_0x7b6b('0xd')](handleError(_0x198868,null,_0x7b6b('0x19')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 7d93d13..820ccdf 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 _0xe34c=['get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x9ec221,_0x2594a6){var _0xdbe55e=function(_0x4b4c43){while(--_0x4b4c43){_0x9ec221['push'](_0x9ec221['shift']());}};_0xdbe55e(++_0x2594a6);}(_0xe34c,0x1cc));var _0xce34=function(_0x16e002,_0x5e1b7e){_0x16e002=_0x16e002-0x0;var _0x1c6613=_0xe34c[_0x16e002];return _0x1c6613;};'use strict';var multer=require(_0xce34('0x0'));var util=require(_0xce34('0x1'));var path=require('path');var timeout=require(_0xce34('0x2'));var express=require(_0xce34('0x3'));var router=express[_0xce34('0x4')]();var fs_extra=require(_0xce34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xce34('0x6'));var config=require(_0xce34('0x7'));var controller=require('./tag.controller');router[_0xce34('0x8')]('/',auth[_0xce34('0x9')](),controller['index']);router['get'](_0xce34('0xa'),auth[_0xce34('0x9')](),controller[_0xce34('0xb')]);router[_0xce34('0xc')]('/',auth[_0xce34('0x9')](),controller[_0xce34('0xd')]);router[_0xce34('0xe')](_0xce34('0xa'),auth[_0xce34('0x9')](),controller['update']);router[_0xce34('0xf')](_0xce34('0xa'),auth[_0xce34('0x9')](),controller[_0xce34('0x10')]);module[_0xce34('0x11')]=router; \ No newline at end of file +var _0x7a27=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','show','post','create','put','/:id','multer','util','path','connect-timeout'];(function(_0x27d95e,_0x1f2544){var _0x1f34cf=function(_0x5b62a9){while(--_0x5b62a9){_0x27d95e['push'](_0x27d95e['shift']());}};_0x1f34cf(++_0x1f2544);}(_0x7a27,0x172));var _0x77a2=function(_0x177f76,_0x51bd84){_0x177f76=_0x177f76-0x0;var _0x5f327a=_0x7a27[_0x177f76];return _0x5f327a;};'use strict';var multer=require(_0x77a2('0x0'));var util=require(_0x77a2('0x1'));var path=require(_0x77a2('0x2'));var timeout=require(_0x77a2('0x3'));var express=require('express');var router=express[_0x77a2('0x4')]();var fs_extra=require(_0x77a2('0x5'));var auth=require(_0x77a2('0x6'));var interaction=require(_0x77a2('0x7'));var config=require('../../config/environment');var controller=require(_0x77a2('0x8'));router[_0x77a2('0x9')]('/',auth[_0x77a2('0xa')](),controller[_0x77a2('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x77a2('0xc')]);router[_0x77a2('0xd')]('/',auth[_0x77a2('0xa')](),controller[_0x77a2('0xe')]);router[_0x77a2('0xf')]('/:id',auth[_0x77a2('0xa')](),controller['update']);router['delete'](_0x77a2('0x10'),auth[_0x77a2('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 2a8ed64..a220b35 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 _0xfe13=['sequelize','STRING','name','#0091EA'];(function(_0x420648,_0x300ee1){var _0x34b3ce=function(_0xbbe1db){while(--_0xbbe1db){_0x420648['push'](_0x420648['shift']());}};_0x34b3ce(++_0x300ee1);}(_0xfe13,0x178));var _0x3fe1=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xfe13[_0x3ceb54];return _0x26d8a6;};'use strict';var Sequelize=require(_0x3fe1('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fe1('0x1')],'unique':_0x3fe1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3fe1('0x1')],'defaultValue':_0x3fe1('0x3')},'description':{'type':Sequelize[_0x3fe1('0x1')]}}; \ No newline at end of file +var _0x8f59=['sequelize','exports','STRING','name','#0091EA'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x8f59,0x11d));var _0x98f5=function(_0x499573,_0x5e995b){_0x499573=_0x499573-0x0;var _0x1757e5=_0x8f59[_0x499573];return _0x1757e5;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'name':{'type':Sequelize[_0x98f5('0x2')],'unique':_0x98f5('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x98f5('0x2')],'defaultValue':_0x98f5('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index aec9c70..f3dc263 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 _0x6953=['mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../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','destroy','then','get','Tags','error','name','send','index','map','Tag','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','moment'];(function(_0xbf1abf,_0x21c249){var _0x47fdb0=function(_0x48f6ea){while(--_0x48f6ea){_0xbf1abf['push'](_0xbf1abf['shift']());}};_0x47fdb0(++_0x21c249);}(_0x6953,0x91));var _0x3695=function(_0x5bc7ab,_0x184ee4){_0x5bc7ab=_0x5bc7ab-0x0;var _0x5e6bdf=_0x6953[_0x5bc7ab];return _0x5e6bdf;};'use strict';var emlformat=require(_0x3695('0x0'));var rimraf=require(_0x3695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3695('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3695('0x3'));var util=require(_0x3695('0x4'));var path=require(_0x3695('0x5'));var sox=require('sox');var csv=require(_0x3695('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3695('0x7'));var _=require(_0x3695('0x8'));var squel=require(_0x3695('0x9'));var crypto=require(_0x3695('0xa'));var jsforce=require(_0x3695('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3695('0x6'));var querystring=require('querystring');var Papa=require(_0x3695('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3695('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3695('0xe'));var logger=require(_0x3695('0xf'))(_0x3695('0x10'));var utils=require(_0x3695('0x11'));var config=require(_0x3695('0x12'));var licenseUtil=require(_0x3695('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19080e,_0x345587){_0x345587=_0x345587||0xcc;return function(_0x212011){if(_0x212011){return _0x19080e[_0x3695('0x14')](_0x345587);}return _0x19080e[_0x3695('0x15')](_0x345587)[_0x3695('0x16')]();};}function respondWithResult(_0x439bd9,_0x4df429){_0x4df429=_0x4df429||0xc8;return function(_0x26dfc9){if(_0x26dfc9){return _0x439bd9[_0x3695('0x15')](_0x4df429)[_0x3695('0x17')](_0x26dfc9);}};}function respondWithFilteredResult(_0x4ca317,_0x3aa59d){return function(_0x231c7d){if(_0x231c7d){var _0x2cdd3=typeof _0x3aa59d[_0x3695('0x18')]===_0x3695('0x19')&&typeof _0x3aa59d[_0x3695('0x1a')]===_0x3695('0x19');var _0x4fa2d9=_0x231c7d[_0x3695('0x1b')];var _0x5edf8d=_0x2cdd3?0x0:_0x3aa59d[_0x3695('0x18')];var _0xcc93bb=_0x2cdd3?_0x231c7d[_0x3695('0x1b')]:_0x3aa59d[_0x3695('0x18')]+_0x3aa59d[_0x3695('0x1a')];var _0x5dec2a;if(_0xcc93bb>=_0x4fa2d9){_0xcc93bb=_0x4fa2d9;_0x5dec2a=0xc8;}else{_0x5dec2a=0xce;}_0x4ca317[_0x3695('0x15')](_0x5dec2a);return _0x4ca317[_0x3695('0x1c')](_0x3695('0x1d'),_0x5edf8d+'-'+_0xcc93bb+'/'+_0x4fa2d9)[_0x3695('0x17')](_0x231c7d);}return null;};}function patchUpdates(_0xc076a9){return function(_0x1ebba8){try{jsonpatch[_0x3695('0x1e')](_0x1ebba8,_0xc076a9,!![]);}catch(_0xb85811){return BPromise[_0x3695('0x1f')](_0xb85811);}return _0x1ebba8[_0x3695('0x20')]();};}function saveUpdates(_0x1b97d2,_0xf2c747){return function(_0x459f33){if(_0x459f33){return _0x459f33[_0x3695('0x21')](_0x1b97d2)['then'](function(_0x42648c){return _0x42648c;});}return null;};}function removeEntity(_0xdb0934,_0x4899c0){return function(_0x4940e9){if(_0x4940e9){return _0x4940e9[_0x3695('0x22')]()[_0x3695('0x23')](function(){var _0x951370=_0x4940e9[_0x3695('0x24')]({'plain':!![]});var _0x534d38=_0x3695('0x25');return db['UserProfileResource'][_0x3695('0x22')]({'where':{'type':_0x534d38,'resourceId':_0x951370['id']}})['then'](function(){return _0x4940e9;});})[_0x3695('0x23')](function(){_0xdb0934['status'](0xcc)[_0x3695('0x16')]();});}};}function handleEntityNotFound(_0x19f834,_0x462ff0){return function(_0x18a474){if(!_0x18a474){_0x19f834[_0x3695('0x14')](0x194);}return _0x18a474;};}function handleError(_0x31fdf3,_0x54b12e){_0x54b12e=_0x54b12e||0x1f4;return function(_0x2be6ee){logger[_0x3695('0x26')](_0x2be6ee['stack']);if(_0x2be6ee[_0x3695('0x27')]){delete _0x2be6ee['name'];}_0x31fdf3[_0x3695('0x15')](_0x54b12e)[_0x3695('0x28')](_0x2be6ee);};}exports[_0x3695('0x29')]=function(_0x23ac01,_0x30a5ba){var _0x21f379={},_0x3a6e8e={},_0x190323={'count':0x0,'rows':[]};var _0x5ce520=_[_0x3695('0x2a')](db[_0x3695('0x2b')][_0x3695('0x2c')],function(_0x4c604f){return{'name':_0x4c604f['fieldName'],'type':_0x4c604f[_0x3695('0x2d')]['key']};});_0x3a6e8e[_0x3695('0x2e')]=_[_0x3695('0x2a')](_0x5ce520,'name');_0x3a6e8e[_0x3695('0x2f')]=_['keys'](_0x23ac01[_0x3695('0x2f')]);_0x3a6e8e[_0x3695('0x30')]=_[_0x3695('0x31')](_0x3a6e8e[_0x3695('0x2e')],_0x3a6e8e[_0x3695('0x2f')]);_0x21f379[_0x3695('0x32')]=_['intersection'](_0x3a6e8e[_0x3695('0x2e')],qs[_0x3695('0x33')](_0x23ac01['query'][_0x3695('0x33')]));_0x21f379[_0x3695('0x32')]=_0x21f379['attributes']['length']?_0x21f379['attributes']:_0x3a6e8e['model'];if(!_0x23ac01[_0x3695('0x2f')][_0x3695('0x34')]('nolimit')){_0x21f379[_0x3695('0x1a')]=qs[_0x3695('0x1a')](_0x23ac01[_0x3695('0x2f')][_0x3695('0x1a')]);_0x21f379['offset']=qs['offset'](_0x23ac01[_0x3695('0x2f')][_0x3695('0x18')]);}_0x21f379['order']=qs[_0x3695('0x35')](_0x23ac01[_0x3695('0x2f')][_0x3695('0x35')]);_0x21f379[_0x3695('0x36')]=qs[_0x3695('0x30')](_[_0x3695('0x37')](_0x23ac01[_0x3695('0x2f')],_0x3a6e8e[_0x3695('0x30')]),_0x5ce520);if(_0x23ac01[_0x3695('0x2f')][_0x3695('0x38')]){_0x21f379[_0x3695('0x36')]=_[_0x3695('0x39')](_0x21f379[_0x3695('0x36')],{'$or':_[_0x3695('0x2a')](_0x5ce520,function(_0xfc50a3){if(_0xfc50a3[_0x3695('0x2d')]!=='VIRTUAL'){var _0x775d39={};_0x775d39[_0xfc50a3[_0x3695('0x27')]]={'$like':'%'+_0x23ac01[_0x3695('0x2f')][_0x3695('0x38')]+'%'};return _0x775d39;}})});}_0x21f379=_[_0x3695('0x39')]({},_0x21f379,_0x23ac01[_0x3695('0x3a')]);var _0x450483={'where':_0x21f379['where']};return db[_0x3695('0x2b')][_0x3695('0x1b')](_0x450483)[_0x3695('0x23')](function(_0x547af9){_0x190323[_0x3695('0x1b')]=_0x547af9;if(_0x23ac01[_0x3695('0x2f')][_0x3695('0x3b')]){_0x21f379[_0x3695('0x3c')]=[{'all':!![]}];}return db[_0x3695('0x2b')][_0x3695('0x3d')](_0x21f379);})[_0x3695('0x23')](function(_0x5b825a){_0x190323[_0x3695('0x3e')]=_0x5b825a;return _0x190323;})['then'](respondWithFilteredResult(_0x30a5ba,_0x21f379))['catch'](handleError(_0x30a5ba,null));};exports[_0x3695('0x3f')]=function(_0x51f403,_0x148547){var _0x30bff0={'raw':!![],'where':{'id':_0x51f403[_0x3695('0x40')]['id']}},_0x65f4b3={};_0x65f4b3['model']=_[_0x3695('0x41')](db[_0x3695('0x2b')][_0x3695('0x2c')]);_0x65f4b3['query']=_[_0x3695('0x41')](_0x51f403[_0x3695('0x2f')]);_0x65f4b3[_0x3695('0x30')]=_[_0x3695('0x31')](_0x65f4b3[_0x3695('0x2e')],_0x65f4b3[_0x3695('0x2f')]);_0x30bff0[_0x3695('0x32')]=_[_0x3695('0x31')](_0x65f4b3[_0x3695('0x2e')],qs['fields'](_0x51f403['query'][_0x3695('0x33')]));_0x30bff0[_0x3695('0x32')]=_0x30bff0[_0x3695('0x32')]['length']?_0x30bff0[_0x3695('0x32')]:_0x65f4b3[_0x3695('0x2e')];if(_0x51f403[_0x3695('0x2f')]['includeAll']){_0x30bff0[_0x3695('0x3c')]=[{'all':!![]}];}_0x30bff0=_[_0x3695('0x39')]({},_0x30bff0,_0x51f403[_0x3695('0x3a')]);return db[_0x3695('0x2b')][_0x3695('0x42')](_0x30bff0)['then'](handleEntityNotFound(_0x148547,null))[_0x3695('0x23')](respondWithResult(_0x148547,null))[_0x3695('0x43')](handleError(_0x148547,null));};exports[_0x3695('0x44')]=function(_0x361a9f,_0x557619){return db[_0x3695('0x2b')]['create'](_0x361a9f['body'],{})[_0x3695('0x23')](function(_0x1b9d80){var _0x410bfc=_0x361a9f[_0x3695('0x45')][_0x3695('0x24')]({'plain':!![]});if(!_0x410bfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410bfc['role']==='user'){var _0x5173b8=_0x1b9d80['get']({'plain':!![]});var _0x4f5f1b='Tags';return db['UserProfileSection'][_0x3695('0x42')]({'where':{'name':_0x4f5f1b,'userProfileId':_0x410bfc[_0x3695('0x46')]},'raw':!![]})['then'](function(_0x44e8d5){if(_0x44e8d5&&_0x44e8d5[_0x3695('0x47')]===0x0){return db['UserProfileResource']['create']({'name':_0x5173b8[_0x3695('0x27')],'resourceId':_0x5173b8['id'],'type':_0x44e8d5[_0x3695('0x27')],'sectionId':_0x44e8d5['id']},{})[_0x3695('0x23')](function(){return _0x1b9d80;});}else{return _0x1b9d80;}})['catch'](function(_0x114423){logger[_0x3695('0x26')](_0x3695('0x48'),_0x114423);throw _0x114423;});}return _0x1b9d80;})[_0x3695('0x23')](respondWithResult(_0x557619,0xc9))[_0x3695('0x43')](handleError(_0x557619,null));};exports[_0x3695('0x21')]=function(_0x3b5552,_0x18b5b3){if(_0x3b5552[_0x3695('0x49')]['id']){delete _0x3b5552[_0x3695('0x49')]['id'];}return db[_0x3695('0x2b')][_0x3695('0x42')]({'where':{'id':_0x3b5552[_0x3695('0x40')]['id']}})[_0x3695('0x23')](handleEntityNotFound(_0x18b5b3,null))[_0x3695('0x23')](saveUpdates(_0x3b5552[_0x3695('0x49')],null))[_0x3695('0x23')](respondWithResult(_0x18b5b3,null))[_0x3695('0x43')](handleError(_0x18b5b3,null));};exports[_0x3695('0x22')]=function(_0x35ffae,_0x42a960){return db[_0x3695('0x2b')][_0x3695('0x42')]({'where':{'id':_0x35ffae['params']['id']}})['then'](handleEntityNotFound(_0x42a960,null))[_0x3695('0x23')](removeEntity(_0x42a960,null))[_0x3695('0x43')](handleError(_0x42a960,null));}; \ No newline at end of file +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(_0x311f13,_0x211d02){var _0x1c553c=function(_0x35bbf6){while(--_0x35bbf6){_0x311f13['push'](_0x311f13['shift']());}};_0x1c553c(++_0x211d02);}(_0x0b78,0x1ad));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'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 diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index df1ddb3..80a95d6 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 _0x527c=['tools_tags','util','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0xaf447,_0x334c66){var _0x4dabec=function(_0x467a5c){while(--_0x467a5c){_0xaf447['push'](_0xaf447['shift']());}};_0x4dabec(++_0x334c66);}(_0x527c,0xd0));var _0xc527=function(_0x29f014,_0x508522){_0x29f014=_0x29f014-0x0;var _0x316be5=_0x527c[_0x29f014];return _0x316be5;};'use strict';var _=require('lodash');var util=require(_0xc527('0x0'));var logger=require('../../config/logger')(_0xc527('0x1'));var moment=require(_0xc527('0x2'));var BPromise=require(_0xc527('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc527('0x4'));var rimraf=require('rimraf');var config=require(_0xc527('0x5'));var attributes=require('./tag.attributes');module[_0xc527('0x6')]=function(_0x4ca6dc,_0x28379d){return _0x4ca6dc[_0xc527('0x7')]('Tag',attributes,{'tableName':_0xc527('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb102=['rimraf','../../config/environment','exports','define','tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1c60aa,_0x5545fa){var _0xcc2c61=function(_0x5308cf){while(--_0x5308cf){_0x1c60aa['push'](_0x1c60aa['shift']());}};_0xcc2c61(++_0x5545fa);}(_0xb102,0x16d));var _0x2b10=function(_0x2f6629,_0x1b013c){_0x2f6629=_0x2f6629-0x0;var _0x317739=_0xb102[_0x2f6629];return _0x317739;};'use strict';var _=require(_0x2b10('0x0'));var util=require('util');var logger=require(_0x2b10('0x1'))(_0x2b10('0x2'));var moment=require(_0x2b10('0x3'));var BPromise=require(_0x2b10('0x4'));var rp=require(_0x2b10('0x5'));var fs=require('fs');var path=require(_0x2b10('0x6'));var rimraf=require(_0x2b10('0x7'));var config=require(_0x2b10('0x8'));var attributes=require('./tag.attributes');module[_0x2b10('0x9')]=function(_0x32e818,_0x438ba9){return _0x32e818[_0x2b10('0xa')]('Tag',attributes,{'tableName':_0x2b10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index fdad583..4ca46c9 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 _0x2121=['request\x20sent','stringify','error','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s'];(function(_0x5dfbcb,_0x1b0508){var _0x42e5df=function(_0x3c22e8){while(--_0x3c22e8){_0x5dfbcb['push'](_0x5dfbcb['shift']());}};_0x42e5df(++_0x1b0508);}(_0x2121,0x1b4));var _0x1212=function(_0x1cae67,_0x6647fb){_0x1cae67=_0x1cae67-0x0;var _0x2ddfdf=_0x2121[_0x1cae67];return _0x2ddfdf;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});} \ No newline at end of file +var _0x07c3=['code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x07c3,0x1bf));var _0x307c=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x07c3[_0x333798];return _0x389f4e;};'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);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 110e5fb..e6f8007 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 c5e1bf1..80dbef7 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x3ced43,_0x38068e){var _0x361869=function(_0x5d9746){while(--_0x5d9746){_0x3ced43['push'](_0x3ced43['shift']());}};_0x361869(++_0x38068e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x5b35d9,_0x2e3e2d){var _0x263f91=function(_0x54eefb){while(--_0x54eefb){_0x5b35d9['push'](_0x5b35d9['shift']());}};_0x263f91(++_0x2e3e2d);}(_0x757a,0xde));var _0xa757=function(_0x225d00,_0x1da3f0){_0x225d00=_0x225d00-0x0;var _0xe8821e=_0x757a[_0x225d00];return _0xe8821e;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index e039cbf..e10d0cc 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 _0x3a9c=['index','map','Team','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Teams','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','isValidChannel','channel','Unknown\x20channel','capitalize','Queue','rawAttributes','pick','Queues','addQueues','findOne','ValidationError','add','toLowerCase','ids','remove','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','findAll','online','voicePause','interface','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Sms','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','update','then','error','stack','name','send'];(function(_0x398a3f,_0x38fb19){var _0xfa8ef8=function(_0x1268d0){while(--_0x1268d0){_0x398a3f['push'](_0x398a3f['shift']());}};_0xfa8ef8(++_0x38fb19);}(_0x3a9c,0x10a));var _0xc3a9=function(_0x3ea8c1,_0x254ef6){_0x3ea8c1=_0x3ea8c1-0x0;var _0x1d806a=_0x3a9c[_0x3ea8c1];return _0x1d806a;};'use strict';var emlformat=require(_0xc3a9('0x0'));var rimraf=require(_0xc3a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc3a9('0x2'));var rp=require(_0xc3a9('0x3'));var moment=require(_0xc3a9('0x4'));var BPromise=require(_0xc3a9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc3a9('0x6'));var sox=require(_0xc3a9('0x7'));var csv=require('to-csv');var ejs=require(_0xc3a9('0x8'));var fs=require('fs');var fs_extra=require(_0xc3a9('0x9'));var _=require('lodash');var squel=require(_0xc3a9('0xa'));var crypto=require(_0xc3a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc3a9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc3a9('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3a9('0xe'));var authService=require(_0xc3a9('0xf'));var qs=require(_0xc3a9('0x10'));var as=require(_0xc3a9('0x11'));var hardwareService=require(_0xc3a9('0x12'));var logger=require(_0xc3a9('0x13'))(_0xc3a9('0x14'));var utils=require('../../config/utils');var config=require(_0xc3a9('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc3a9('0x16')]=_[_0xc3a9('0x17')](config['redis'],{'host':_0xc3a9('0x18'),'port':0x18eb});var socket=require(_0xc3a9('0x19'))(new Redis(config[_0xc3a9('0x16')]));require(_0xc3a9('0x1a'))['register'](socket);function respondWithStatusCode(_0x409d06,_0x42619d){_0x42619d=_0x42619d||0xcc;return function(_0x4509a3){if(_0x4509a3){return _0x409d06[_0xc3a9('0x1b')](_0x42619d);}return _0x409d06[_0xc3a9('0x1c')](_0x42619d)[_0xc3a9('0x1d')]();};}function respondWithResult(_0x234afa,_0x3d3201){_0x3d3201=_0x3d3201||0xc8;return function(_0x4dfa88){if(_0x4dfa88){return _0x234afa['status'](_0x3d3201)['json'](_0x4dfa88);}};}function respondWithFilteredResult(_0x31b959,_0x29df69){return function(_0x537f73){if(_0x537f73){var _0xec15f=typeof _0x29df69['offset']==='undefined'&&typeof _0x29df69['limit']===_0xc3a9('0x1e');var _0x4ec64a=_0x537f73[_0xc3a9('0x1f')];var _0x201d3d=_0xec15f?0x0:_0x29df69[_0xc3a9('0x20')];var _0xaf2e32=_0xec15f?_0x537f73['count']:_0x29df69['offset']+_0x29df69[_0xc3a9('0x21')];var _0x44e86d;if(_0xaf2e32>=_0x4ec64a){_0xaf2e32=_0x4ec64a;_0x44e86d=0xc8;}else{_0x44e86d=0xce;}_0x31b959[_0xc3a9('0x1c')](_0x44e86d);return _0x31b959[_0xc3a9('0x22')](_0xc3a9('0x23'),_0x201d3d+'-'+_0xaf2e32+'/'+_0x4ec64a)[_0xc3a9('0x24')](_0x537f73);}return null;};}function patchUpdates(_0xef9acf){return function(_0x477a8c){try{jsonpatch[_0xc3a9('0x25')](_0x477a8c,_0xef9acf,!![]);}catch(_0x4b3295){return BPromise['reject'](_0x4b3295);}return _0x477a8c['save']();};}function saveUpdates(_0x118d6e,_0x314934){return function(_0x33d7e6){if(_0x33d7e6){return _0x33d7e6[_0xc3a9('0x26')](_0x118d6e)[_0xc3a9('0x27')](function(_0x1ff24d){return _0x1ff24d;});}return null;};}function handleEntityNotFound(_0x4f463d,_0x520911){return function(_0x51f8f0){if(!_0x51f8f0){_0x4f463d[_0xc3a9('0x1b')](0x194);}return _0x51f8f0;};}function handleError(_0x48dc21,_0x139109){_0x139109=_0x139109||0x1f4;return function(_0x2eb4cf){logger[_0xc3a9('0x28')](_0x2eb4cf[_0xc3a9('0x29')]);if(_0x2eb4cf[_0xc3a9('0x2a')]){delete _0x2eb4cf[_0xc3a9('0x2a')];}_0x48dc21['status'](_0x139109)[_0xc3a9('0x2b')](_0x2eb4cf);};}exports[_0xc3a9('0x2c')]=function(_0x99bc6e,_0xd9b0af){var _0x552209={},_0x13ce2a={},_0x3a0703={'count':0x0,'rows':[]};var _0x4bea56=_[_0xc3a9('0x2d')](db[_0xc3a9('0x2e')]['rawAttributes'],function(_0x50dd14){return{'name':_0x50dd14[_0xc3a9('0x2f')],'type':_0x50dd14[_0xc3a9('0x30')]['key']};});_0x13ce2a[_0xc3a9('0x31')]=_['map'](_0x4bea56,_0xc3a9('0x2a'));_0x13ce2a['query']=_[_0xc3a9('0x32')](_0x99bc6e[_0xc3a9('0x33')]);_0x13ce2a[_0xc3a9('0x34')]=_[_0xc3a9('0x35')](_0x13ce2a[_0xc3a9('0x31')],_0x13ce2a[_0xc3a9('0x33')]);_0x552209['attributes']=_[_0xc3a9('0x35')](_0x13ce2a[_0xc3a9('0x31')],qs[_0xc3a9('0x36')](_0x99bc6e[_0xc3a9('0x33')]['fields']));_0x552209[_0xc3a9('0x37')]=_0x552209[_0xc3a9('0x37')]['length']?_0x552209[_0xc3a9('0x37')]:_0x13ce2a[_0xc3a9('0x31')];if(!_0x99bc6e['query'][_0xc3a9('0x38')](_0xc3a9('0x39'))){_0x552209[_0xc3a9('0x21')]=qs[_0xc3a9('0x21')](_0x99bc6e[_0xc3a9('0x33')][_0xc3a9('0x21')]);_0x552209[_0xc3a9('0x20')]=qs['offset'](_0x99bc6e[_0xc3a9('0x33')][_0xc3a9('0x20')]);}_0x552209[_0xc3a9('0x3a')]=qs[_0xc3a9('0x3b')](_0x99bc6e['query'][_0xc3a9('0x3b')]);_0x552209[_0xc3a9('0x3c')]=qs[_0xc3a9('0x34')](_['pick'](_0x99bc6e['query'],_0x13ce2a[_0xc3a9('0x34')]),_0x4bea56);if(_0x99bc6e[_0xc3a9('0x33')][_0xc3a9('0x3d')]){_0x552209[_0xc3a9('0x3c')]=_[_0xc3a9('0x3e')](_0x552209[_0xc3a9('0x3c')],{'$or':_['map'](_0x4bea56,function(_0x12dfe2){if(_0x12dfe2[_0xc3a9('0x30')]!==_0xc3a9('0x3f')){var _0x47bc1b={};_0x47bc1b[_0x12dfe2[_0xc3a9('0x2a')]]={'$like':'%'+_0x99bc6e['query'][_0xc3a9('0x3d')]+'%'};return _0x47bc1b;}})});}_0x552209=_[_0xc3a9('0x3e')]({},_0x552209,_0x99bc6e[_0xc3a9('0x40')]);var _0x5b5806={'where':_0x552209['where']};return db['Team'][_0xc3a9('0x1f')](_0x5b5806)[_0xc3a9('0x27')](function(_0xd9e174){_0x3a0703['count']=_0xd9e174;if(_0x99bc6e['query'][_0xc3a9('0x41')]){_0x552209['include']=[{'all':!![]}];}return db[_0xc3a9('0x2e')]['findAll'](_0x552209);})[_0xc3a9('0x27')](function(_0x2edfde){_0x3a0703[_0xc3a9('0x42')]=_0x2edfde;return _0x3a0703;})[_0xc3a9('0x27')](respondWithFilteredResult(_0xd9b0af,_0x552209))[_0xc3a9('0x43')](handleError(_0xd9b0af,null));};exports[_0xc3a9('0x44')]=function(_0x404cfb,_0x5c66d1){var _0x3e8ac6={'raw':![],'where':{'id':_0x404cfb[_0xc3a9('0x45')]['id']}},_0x2575f3={};_0x2575f3[_0xc3a9('0x31')]=_[_0xc3a9('0x32')](db[_0xc3a9('0x2e')]['rawAttributes']);_0x2575f3[_0xc3a9('0x33')]=_[_0xc3a9('0x32')](_0x404cfb[_0xc3a9('0x33')]);_0x2575f3[_0xc3a9('0x34')]=_[_0xc3a9('0x35')](_0x2575f3['model'],_0x2575f3['query']);_0x3e8ac6[_0xc3a9('0x37')]=_[_0xc3a9('0x35')](_0x2575f3[_0xc3a9('0x31')],qs[_0xc3a9('0x36')](_0x404cfb[_0xc3a9('0x33')]['fields']));_0x3e8ac6['attributes']=_0x3e8ac6[_0xc3a9('0x37')][_0xc3a9('0x46')]?_0x3e8ac6[_0xc3a9('0x37')]:_0x2575f3[_0xc3a9('0x31')];if(_0x404cfb[_0xc3a9('0x33')]['includeAll']){_0x3e8ac6[_0xc3a9('0x47')]=[{'all':!![]}];}_0x3e8ac6=_['merge']({},_0x3e8ac6,_0x404cfb['options']);return db[_0xc3a9('0x2e')][_0xc3a9('0x48')](_0x3e8ac6)[_0xc3a9('0x27')](handleEntityNotFound(_0x5c66d1,null))[_0xc3a9('0x27')](respondWithResult(_0x5c66d1,null))[_0xc3a9('0x43')](handleError(_0x5c66d1,null));};exports[_0xc3a9('0x49')]=function(_0x3a2727,_0x31ed85){return db[_0xc3a9('0x2e')][_0xc3a9('0x49')](_0x3a2727[_0xc3a9('0x4a')],{})[_0xc3a9('0x27')](function(_0x397838){var _0x2807c0=_0x3a2727[_0xc3a9('0x4b')]['get']({'plain':!![]});if(!_0x2807c0)throw new Error(_0xc3a9('0x4c'));if(_0x2807c0['role']===_0xc3a9('0x4b')){var _0x273df0=_0x397838[_0xc3a9('0x4d')]({'plain':!![]});var _0xf26758=_0xc3a9('0x4e');return db[_0xc3a9('0x4f')][_0xc3a9('0x48')]({'where':{'name':_0xf26758,'userProfileId':_0x2807c0['userProfileId']},'raw':!![]})[_0xc3a9('0x27')](function(_0x364263){if(_0x364263&&_0x364263['autoAssociation']===0x0){return db[_0xc3a9('0x50')][_0xc3a9('0x49')]({'name':_0x273df0[_0xc3a9('0x2a')],'resourceId':_0x273df0['id'],'type':_0x364263['name'],'sectionId':_0x364263['id']},{})[_0xc3a9('0x27')](function(){return _0x397838;});}else{return _0x397838;}})[_0xc3a9('0x43')](function(_0x522a77){logger[_0xc3a9('0x28')](_0xc3a9('0x51'),_0x522a77);throw _0x522a77;});}return _0x397838;})[_0xc3a9('0x27')](respondWithResult(_0x31ed85,0xc9))['catch'](handleError(_0x31ed85,null));};exports[_0xc3a9('0x26')]=function(_0x54fe05,_0x20d7d0){if(_0x54fe05[_0xc3a9('0x4a')]['id']){delete _0x54fe05[_0xc3a9('0x4a')]['id'];}return db[_0xc3a9('0x2e')]['find']({'where':{'id':_0x54fe05[_0xc3a9('0x45')]['id']}})['then'](handleEntityNotFound(_0x20d7d0,null))[_0xc3a9('0x27')](saveUpdates(_0x54fe05['body'],null))[_0xc3a9('0x27')](respondWithResult(_0x20d7d0,null))[_0xc3a9('0x43')](handleError(_0x20d7d0,null));};exports[_0xc3a9('0x52')]=function(_0x1f98cf,_0x56d0ce){var _0x6c5d2c=_0x1f98cf[_0xc3a9('0x45')]['id'];var _0x3d6156=[];return db['sequelize'][_0xc3a9('0x53')](function(_0xa01eb4){var _0x2a3180=_0xc3a9('0x54')+_0x6c5d2c;return db['sequelize'][_0xc3a9('0x33')](_0x2a3180,{'type':db[_0xc3a9('0x55')][_0xc3a9('0x56')][_0xc3a9('0x57')],'raw':!![],'transaction':_0xa01eb4})['then'](function(_0x157e64){_0x3d6156=_[_0xc3a9('0x2d')](_0x157e64,function(_0xa2ea9d){return Number(_0xa2ea9d[_0xc3a9('0x58')]);});})[_0xc3a9('0x27')](function(){var _0x10fe53=_0xc3a9('0x59')+_0x6c5d2c;return db['sequelize'][_0xc3a9('0x33')](_0x10fe53,{'type':db[_0xc3a9('0x55')][_0xc3a9('0x56')][_0xc3a9('0x57')],'raw':!![],'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(_0x482e5a){var _0x4147a7=_[_0xc3a9('0x2d')](_0x482e5a,function(_0x262630){return Number(_0x262630[_0xc3a9('0x5a')]);});return db[_0xc3a9('0x5b')]['destroy']({'where':{'UserId':{'$in':_0x3d6156},'VoiceQueueId':{'$in':_0x4147a7}},'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(){var _0x5c3f01=_0xc3a9('0x5c')+_0x6c5d2c;return db[_0xc3a9('0x5d')][_0xc3a9('0x33')](_0x5c3f01,{'type':db[_0xc3a9('0x55')][_0xc3a9('0x56')]['SELECT'],'raw':!![],'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(_0x246595){var _0x145639=_[_0xc3a9('0x2d')](_0x246595,function(_0x4abd12){return Number(_0x4abd12[_0xc3a9('0x5e')]);});return db['UserMailQueue'][_0xc3a9('0x52')]({'where':{'UserId':{'$in':_0x3d6156},'MailQueueId':{'$in':_0x145639}},'transaction':_0xa01eb4});})['then'](function(){var _0xfbc220=_0xc3a9('0x5f')+_0x6c5d2c;return db['sequelize'][_0xc3a9('0x33')](_0xfbc220,{'type':db[_0xc3a9('0x55')][_0xc3a9('0x56')][_0xc3a9('0x57')],'raw':!![],'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(_0x1bb27b){var _0x51dd8a=_[_0xc3a9('0x2d')](_0x1bb27b,function(_0x422eaa){return Number(_0x422eaa[_0xc3a9('0x60')]);});return db[_0xc3a9('0x61')]['destroy']({'where':{'UserId':{'$in':_0x3d6156},'SmsQueueId':{'$in':_0x51dd8a}},'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(){var _0x4be324='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x6c5d2c;return db['sequelize'][_0xc3a9('0x33')](_0x4be324,{'type':db['Sequelize'][_0xc3a9('0x56')][_0xc3a9('0x57')],'raw':!![],'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(_0x53a37c){var _0xe43bda=_['map'](_0x53a37c,function(_0x56562b){return Number(_0x56562b[_0xc3a9('0x62')]);});return db[_0xc3a9('0x63')]['destroy']({'where':{'UserId':{'$in':_0x3d6156},'ChatQueueId':{'$in':_0xe43bda}},'transaction':_0xa01eb4});})['then'](function(){var _0x4a854d=_0xc3a9('0x64')+_0x6c5d2c;return db[_0xc3a9('0x5d')][_0xc3a9('0x33')](_0x4a854d,{'type':db['Sequelize'][_0xc3a9('0x56')][_0xc3a9('0x57')],'raw':!![],'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(_0x1e577f){var _0x542077=_[_0xc3a9('0x2d')](_0x1e577f,function(_0x4906f5){return Number(_0x4906f5[_0xc3a9('0x65')]);});return db['UserFaxQueue'][_0xc3a9('0x52')]({'where':{'UserId':{'$in':_0x3d6156},'FaxQueueId':{'$in':_0x542077}},'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(){var _0x2e6de1='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x6c5d2c;return db[_0xc3a9('0x5d')][_0xc3a9('0x33')](_0x2e6de1,{'type':db['Sequelize'][_0xc3a9('0x56')][_0xc3a9('0x57')],'raw':!![],'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(_0x509c2b){var _0x28e720=_[_0xc3a9('0x2d')](_0x509c2b,function(_0x173179){return Number(_0x173179[_0xc3a9('0x66')]);});return db[_0xc3a9('0x67')][_0xc3a9('0x52')]({'where':{'UserId':{'$in':_0x3d6156},'OpenchannelQueueId':{'$in':_0x28e720}},'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(){var _0x1eceb6='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x6c5d2c;return db['sequelize'][_0xc3a9('0x33')](_0x1eceb6,{'type':db[_0xc3a9('0x55')]['QueryTypes'][_0xc3a9('0x57')],'raw':!![],'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(_0x594e87){var _0x5cea4f=_['map'](_0x594e87,function(_0x41b9a0){return Number(_0x41b9a0[_0xc3a9('0x68')]);});return db[_0xc3a9('0x69')]['destroy']({'where':{'UserId':{'$in':_0x3d6156},'WhatsappQueueId':{'$in':_0x5cea4f}},'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(){return db[_0xc3a9('0x6a')]['find']({'where':{'TeamId':_0x6c5d2c}});})[_0xc3a9('0x27')](function(_0x12476b){if(_0x12476b===null){return;}return db[_0xc3a9('0x6b')][_0xc3a9('0x52')]({'where':{'UserId':{'$in':_0x3d6156},'VoicePrefixId':_0x12476b[_0xc3a9('0x6c')]},'transaction':_0xa01eb4});})[_0xc3a9('0x27')](function(){return db[_0xc3a9('0x2e')][_0xc3a9('0x52')]({'where':{'id':_0x6c5d2c},'cascade':!![],'transaction':_0xa01eb4});})['then'](function(_0x13491f){if(_0x13491f===0x0){_0x56d0ce[_0xc3a9('0x1b')](0x194);}else{return db[_0xc3a9('0x50')][_0xc3a9('0x52')]({'where':{'type':_0xc3a9('0x4e'),'resourceId':_0x6c5d2c},'cascade':!![],'transaction':_0xa01eb4})['then'](function(){_0x56d0ce[_0xc3a9('0x1c')](0xcc)[_0xc3a9('0x1d')]();});}})[_0xc3a9('0x43')](function(_0x1c17c3){_0x56d0ce[_0xc3a9('0x1c')](0x1f4)[_0xc3a9('0x2b')](_0x1c17c3);});});};exports[_0xc3a9('0x6d')]=function(_0x5b5c70,_0x27267f,_0x23ec61){return db[_0xc3a9('0x2e')]['findOne']({'where':{'id':_0x5b5c70['params']['id']}})['then'](handleEntityNotFound(_0x27267f,null))[_0xc3a9('0x27')](function(_0x427369){if(!_0x5b5c70['query']['channel']||!utils[_0xc3a9('0x6e')](_0x5b5c70['query'][_0xc3a9('0x6f')])){throw new db[(_0xc3a9('0x55'))]['ValidationError'](_0xc3a9('0x70'));}var _0x45dbcb={};var _0x5370a6={};_0x5370a6[_0xc3a9('0x31')]=_[_0xc3a9('0x32')](db[_[_0xc3a9('0x71')](_0x5b5c70[_0xc3a9('0x33')][_0xc3a9('0x6f')]['toLowerCase']())+_0xc3a9('0x72')][_0xc3a9('0x73')]);_0x5370a6['query']=_['keys'](_0x5b5c70[_0xc3a9('0x33')]);_0x5370a6[_0xc3a9('0x34')]=_['intersection'](_0x5370a6[_0xc3a9('0x31')],_0x5370a6[_0xc3a9('0x33')]);_0x45dbcb[_0xc3a9('0x37')]=_[_0xc3a9('0x35')](_0x5370a6[_0xc3a9('0x31')],qs[_0xc3a9('0x36')](_0x5b5c70[_0xc3a9('0x33')][_0xc3a9('0x36')]));_0x45dbcb[_0xc3a9('0x37')]=_0x45dbcb[_0xc3a9('0x37')][_0xc3a9('0x46')]?_0x45dbcb[_0xc3a9('0x37')]:_0x5370a6['model'];_0x45dbcb[_0xc3a9('0x21')]=qs[_0xc3a9('0x21')](_0x5b5c70[_0xc3a9('0x33')]['limit']);_0x45dbcb[_0xc3a9('0x20')]=qs[_0xc3a9('0x20')](_0x5b5c70[_0xc3a9('0x33')]['offset']);_0x45dbcb[_0xc3a9('0x3a')]=qs[_0xc3a9('0x3b')](_0x5b5c70[_0xc3a9('0x33')][_0xc3a9('0x3b')]);_0x45dbcb[_0xc3a9('0x3c')]=qs[_0xc3a9('0x34')](_[_0xc3a9('0x74')](_0x5b5c70[_0xc3a9('0x33')],_0x5370a6[_0xc3a9('0x34')]));_0x45dbcb=_[_0xc3a9('0x3e')]({},_0x45dbcb,_0x5b5c70[_0xc3a9('0x40')]);return _0x427369['get'+_[_0xc3a9('0x71')](_0x5b5c70[_0xc3a9('0x33')]['channel']['toLowerCase']())+_0xc3a9('0x75')](_0x45dbcb);})[_0xc3a9('0x27')](respondWithResult(_0x27267f,null))[_0xc3a9('0x43')](handleError(_0x27267f,null));};exports[_0xc3a9('0x76')]=function(_0xf124d9,_0x50208c,_0x1912e0){return db[_0xc3a9('0x2e')][_0xc3a9('0x77')]({'where':{'id':_0xf124d9[_0xc3a9('0x45')]['id']}})[_0xc3a9('0x27')](function(_0x4b5a5f){if(_0x4b5a5f){if(!_0xf124d9['body'][_0xc3a9('0x6f')]||!utils['isValidChannel'](_0xf124d9[_0xc3a9('0x4a')][_0xc3a9('0x6f')])){throw new db['Sequelize'][(_0xc3a9('0x78'))](_0xc3a9('0x70'));}return _0x4b5a5f[_0xc3a9('0x79')+_[_0xc3a9('0x71')](_0xf124d9[_0xc3a9('0x4a')][_0xc3a9('0x6f')][_0xc3a9('0x7a')]())+'Queues'](_0xf124d9[_0xc3a9('0x4a')][_0xc3a9('0x7b')]);}return null;})[_0xc3a9('0x27')](handleEntityNotFound(_0x50208c,null))[_0xc3a9('0x27')](respondWithStatusCode(_0x50208c,null))['catch'](handleError(_0x50208c,null));};exports['removeQueues']=function(_0x221f87,_0x57d200,_0x464331){return db[_0xc3a9('0x2e')][_0xc3a9('0x77')]({'where':{'id':_0x221f87[_0xc3a9('0x45')]['id']}})[_0xc3a9('0x27')](function(_0x38cc72){if(_0x38cc72){if(!_0x221f87['query'][_0xc3a9('0x6f')]||!utils[_0xc3a9('0x6e')](_0x221f87[_0xc3a9('0x33')][_0xc3a9('0x6f')])){throw new db['Sequelize'][(_0xc3a9('0x78'))]('Unknown\x20channel');}return _0x38cc72[_0xc3a9('0x7c')+_[_0xc3a9('0x71')](_0x221f87[_0xc3a9('0x33')]['channel'][_0xc3a9('0x7a')]())+'Queues'](_0x221f87[_0xc3a9('0x33')][_0xc3a9('0x7b')]);}return null;})[_0xc3a9('0x27')](handleEntityNotFound(_0x57d200,null))[_0xc3a9('0x27')](respondWithStatusCode(_0x57d200,null))[_0xc3a9('0x43')](handleError(_0x57d200,null));};exports[_0xc3a9('0x7d')]=function(_0x4dce2d,_0x1fc1b2){var _0x606f07=_[_0xc3a9('0x7e')](_0x4dce2d['body'][_0xc3a9('0x7b')])?_0x4dce2d[_0xc3a9('0x4a')][_0xc3a9('0x7b')]:[_0x4dce2d['body'][_0xc3a9('0x7b')]];var _0x4ad228=_0x4dce2d[_0xc3a9('0x45')]['id'];return db[_0xc3a9('0x2e')][_0xc3a9('0x48')]({'where':{'id':_0x4ad228}})['then'](handleEntityNotFound(_0x1fc1b2,null))[_0xc3a9('0x27')](function(_0x337899){if(_0x337899){var _0x7c67f4=[_0xc3a9('0x7f'),_0xc3a9('0x80'),_0xc3a9('0x81'),'Sms',_0xc3a9('0x82'),_0xc3a9('0x83'),_0xc3a9('0x84')];return db[_0xc3a9('0x5d')][_0xc3a9('0x53')](function(_0x1ae434){var _0x1e76cd=_[_0xc3a9('0x2d')](_0x7c67f4,function(_0x3bb0b8){var _0xa67eca={'attributes':['id',_0xc3a9('0x2a')]};if(_0x3bb0b8===_0xc3a9('0x7f')){_0xa67eca[_0xc3a9('0x85')]={'attributes':[_0xc3a9('0x86')]};}return _0x337899['get'+_0x3bb0b8+'Queues'](_0xa67eca)[_0xc3a9('0x27')](function(_0x22abc3){var _0xdbbe45=_[_0xc3a9('0x2d')](_0x22abc3,function(_0x39ab04){var _0x2d8b39=_[_0xc3a9('0x2d')](_0x606f07,function(_0x1c2634){var _0x35b4b3={'where':{'UserId':_0x1c2634,[_0x3bb0b8+_0xc3a9('0x87')]:_0x39ab04['id']},'transaction':_0x1ae434};if(_0x3bb0b8===_0xc3a9('0x7f')){_0x35b4b3[_0xc3a9('0x17')]={'penalty':_0x39ab04[_0xc3a9('0x88')][_0xc3a9('0x86')]};}return db[_0xc3a9('0x89')+_0x3bb0b8+_0xc3a9('0x72')][_0xc3a9('0x8a')](_0x35b4b3)['then'](function(){socket[_0xc3a9('0x8b')](_0xc3a9('0x4b')+_0x3bb0b8+'Queue:save',{'UserId':_0x1c2634,[_0x3bb0b8+_0xc3a9('0x87')]:_0x39ab04['id']});if(_0x3bb0b8!==_0xc3a9('0x7f')){return;}return db[_0xc3a9('0x89')][_0xc3a9('0x8c')]({'where':{'id':_0x606f07,'online':0x1},'attributes':['id',_0xc3a9('0x2a'),_0xc3a9('0x8d'),_0xc3a9('0x8e'),_0xc3a9('0x8f')],'raw':!![]})[_0xc3a9('0x27')](function(_0x44bac2){var _0x226e61=_['map'](_0x44bac2,function(_0x1c794c){return db['UserVoiceQueueRt'][_0xc3a9('0x90')]({'membername':_0x1c794c['name'],'UserId':_0x1c794c['id'],'queue_name':_0x39ab04[_0xc3a9('0x2a')],'VoiceQueueId':_0x39ab04['id'],'interface':_[_0xc3a9('0x91')](_0x1c794c[_0xc3a9('0x8f')])?util[_0xc3a9('0x92')](_0xc3a9('0x93'),_0x1c794c[_0xc3a9('0x2a')]):_0x1c794c[_0xc3a9('0x8f')],'paused':_0x1c794c[_0xc3a9('0x8e')]||![],'penalty':_0x39ab04[_0xc3a9('0x88')]['penalty']},{'transaction':_0x1ae434});});return Promise[_0xc3a9('0x94')](_0x226e61);});});});return Promise[_0xc3a9('0x94')](_0x2d8b39);});return Promise['all'](_0xdbbe45);})[_0xc3a9('0x27')](function(){return db[_0xc3a9('0x6a')]['findOne']({'where':{'teamId':_0x4ad228}})[_0xc3a9('0x27')](function(_0x4e6ad3){if(_0x4e6ad3){var _0x2da727=_[_0xc3a9('0x2d')](_0x606f07,function(_0x1dbbb0){db['UserVoicePrefix']['upsert']({'UserId':_0x1dbbb0,'VoicePrefixId':_0x4e6ad3['VoicePrefixId']});});return Promise[_0xc3a9('0x94')](_0x2da727);}});});});return Promise['all'](_0x1e76cd)['then'](function(){return _0x337899[_0xc3a9('0x7d')](_0x606f07,{'transaction':_0x1ae434})[_0xc3a9('0x95')](function(_0x1b348b){return _0x1b348b;});});});}})['then'](respondWithResult(_0x1fc1b2,null))[_0xc3a9('0x43')](handleError(_0x1fc1b2,null));};exports[_0xc3a9('0x96')]=function(_0x221d33,_0x52bdb4){var _0x34997b=_[_0xc3a9('0x7e')](_0x221d33['query']['ids'])?_0x221d33[_0xc3a9('0x33')][_0xc3a9('0x7b')]:[_0x221d33[_0xc3a9('0x33')]['ids']];var _0xc8a993=_0x221d33['params']['id'];return db[_0xc3a9('0x2e')][_0xc3a9('0x48')]({'where':{'id':_0xc8a993}})[_0xc3a9('0x27')](handleEntityNotFound(_0x52bdb4,null))[_0xc3a9('0x27')](function(_0xb8ce69){if(_0xb8ce69){var _0x1cf50a=['Voice','Chat',_0xc3a9('0x81'),_0xc3a9('0x97'),'Fax',_0xc3a9('0x83'),_0xc3a9('0x84')];return db[_0xc3a9('0x5d')][_0xc3a9('0x53')](function(_0x5a2d42){var _0x20af75=_['map'](_0x1cf50a,function(_0x3179eb){var _0x1f5db3={'attributes':['id',_0xc3a9('0x2a')]};return _0xb8ce69[_0xc3a9('0x4d')+_0x3179eb+_0xc3a9('0x75')](_0x1f5db3)[_0xc3a9('0x27')](function(_0x5e12b7){var _0x15636f=_['map'](_0x5e12b7,function(_0x56e6aa){return _0x56e6aa[_0xc3a9('0x96')](_0x34997b,{'transaction':_0x5a2d42})[_0xc3a9('0x27')](function(){var _0x5587a8=_['map'](_0x34997b,function(_0xf9d973){socket[_0xc3a9('0x8b')]('user'+_0x3179eb+_0xc3a9('0x98'),{'UserId':Number(_0xf9d973),[_0x3179eb+_0xc3a9('0x87')]:_0x56e6aa['id']});if(_0x3179eb!==_0xc3a9('0x7f')){return;}return db[_0xc3a9('0x99')]['destroy']({'where':{'VoiceQueueId':_0x56e6aa['id'],'UserId':_0xf9d973},'transaction':_0x5a2d42});});return Promise['all'](_0x5587a8);});});return Promise[_0xc3a9('0x94')](_0x15636f);});});return Promise[_0xc3a9('0x94')](_0x20af75)['then'](function(){return _0xb8ce69[_0xc3a9('0x96')](_0x34997b,{'transaction':_0x5a2d42});})[_0xc3a9('0x27')](function(){return db[_0xc3a9('0x6a')][_0xc3a9('0x77')]({'where':{'teamId':_0xc8a993}})[_0xc3a9('0x27')](function(_0x4c2b92){if(_0x4c2b92){var _0x4d544=_[_0xc3a9('0x2d')](_0x34997b,function(_0x15b78b){db[_0xc3a9('0x6b')][_0xc3a9('0x52')]({'where':{'UserId':_0x15b78b,'VoicePrefixId':_0x4c2b92[_0xc3a9('0x6c')]}});});return Promise['all'](_0x4d544);}});});});}})[_0xc3a9('0x27')](respondWithStatusCode(_0x52bdb4,null))[_0xc3a9('0x43')](handleError(_0x52bdb4,null));};exports['getAgents']=function(_0x32cf0d,_0x101688,_0x457583){var _0x31edea={};var _0x3e98f9={};var _0x2b7e72;var _0x4caf01;return db[_0xc3a9('0x2e')][_0xc3a9('0x77')]({'where':{'id':_0x32cf0d['params']['id']}})[_0xc3a9('0x27')](handleEntityNotFound(_0x101688,null))[_0xc3a9('0x27')](function(_0x20a0da){if(_0x20a0da){_0x2b7e72=_0x20a0da;_0x3e98f9[_0xc3a9('0x31')]=_[_0xc3a9('0x32')](db[_0xc3a9('0x89')][_0xc3a9('0x73')]);_0x3e98f9['query']=_[_0xc3a9('0x32')](_0x32cf0d['query']);_0x3e98f9['filters']=_['intersection'](_0x3e98f9[_0xc3a9('0x31')],_0x3e98f9[_0xc3a9('0x33')]);_0x31edea[_0xc3a9('0x37')]=_['intersection'](_0x3e98f9['model'],qs[_0xc3a9('0x36')](_0x32cf0d['query'][_0xc3a9('0x36')]));_0x31edea[_0xc3a9('0x37')]=_0x31edea[_0xc3a9('0x37')]['length']?_0x31edea[_0xc3a9('0x37')]:_0x3e98f9[_0xc3a9('0x31')];_0x31edea[_0xc3a9('0x3a')]=qs[_0xc3a9('0x3b')](_0x32cf0d[_0xc3a9('0x33')][_0xc3a9('0x3b')]);_0x31edea[_0xc3a9('0x3c')]=qs[_0xc3a9('0x34')](_[_0xc3a9('0x74')](_0x32cf0d['query'],_0x3e98f9[_0xc3a9('0x34')]));if(_0x32cf0d[_0xc3a9('0x33')]['filter']){_0x31edea[_0xc3a9('0x3c')]=_['merge'](_0x31edea[_0xc3a9('0x3c')],{'$or':_[_0xc3a9('0x2d')](_0x31edea[_0xc3a9('0x37')],function(_0x356ef5){var _0x4f0aa8={};_0x4f0aa8[_0x356ef5]={'$like':'%'+_0x32cf0d[_0xc3a9('0x33')][_0xc3a9('0x3d')]+'%'};return _0x4f0aa8;})});}_0x31edea=_['merge']({},_0x31edea,_0x32cf0d['options']);return _0x2b7e72[_0xc3a9('0x9a')](_0x31edea);}})[_0xc3a9('0x27')](function(_0x449661){if(_0x449661){_0x4caf01=_0x449661[_0xc3a9('0x46')];if(!_0x32cf0d[_0xc3a9('0x33')][_0xc3a9('0x38')](_0xc3a9('0x39'))){_0x31edea[_0xc3a9('0x21')]=qs[_0xc3a9('0x21')](_0x32cf0d[_0xc3a9('0x33')][_0xc3a9('0x21')]);_0x31edea['offset']=qs[_0xc3a9('0x20')](_0x32cf0d[_0xc3a9('0x33')]['offset']);}return _0x2b7e72[_0xc3a9('0x9a')](_0x31edea);}})[_0xc3a9('0x27')](function(_0xd3a391){if(_0xd3a391){return _0xd3a391?{'count':_0x4caf01,'rows':_0xd3a391}:null;}})[_0xc3a9('0x27')](respondWithResult(_0x101688,null))[_0xc3a9('0x43')](handleError(_0x101688,null));}; \ No newline at end of file +var _0x2a37=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./team.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','Team','fieldName','type','query','keys','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','attributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','destroy','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','rawAttributes','toLowerCase','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Queues','QueueId','penalty','findOrCreate','emit','User','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','TeamVoiceQueue','all','removeAgents','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv'];(function(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_0x2a37,0x92));var _0x72a3=function(_0x1b4db7,_0x179ce8){_0x1b4db7=_0x1b4db7-0x0;var _0x4d8896=_0x2a37[_0x1b4db7];return _0x4d8896;};'use strict';var emlformat=require(_0x72a3('0x0'));var rimraf=require(_0x72a3('0x1'));var zipdir=require(_0x72a3('0x2'));var jsonpatch=require(_0x72a3('0x3'));var rp=require('request-promise');var moment=require(_0x72a3('0x4'));var BPromise=require(_0x72a3('0x5'));var Mustache=require(_0x72a3('0x6'));var util=require(_0x72a3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x72a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72a3('0x9'));var squel=require(_0x72a3('0xa'));var crypto=require(_0x72a3('0xb'));var jsforce=require(_0x72a3('0xc'));var deskjs=require(_0x72a3('0xd'));var toCsv=require(_0x72a3('0x8'));var querystring=require(_0x72a3('0xe'));var Papa=require(_0x72a3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x72a3('0x10'));var as=require(_0x72a3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x72a3('0x12'))(_0x72a3('0x13'));var utils=require(_0x72a3('0x14'));var config=require(_0x72a3('0x15'));var licenseUtil=require(_0x72a3('0x16'));var db=require('../../mysqldb')['db'];config[_0x72a3('0x17')]=_[_0x72a3('0x18')](config[_0x72a3('0x17')],{'host':_0x72a3('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72a3('0x17')]));require(_0x72a3('0x1a'))[_0x72a3('0x1b')](socket);function respondWithStatusCode(_0x337fd9,_0x5c1d08){_0x5c1d08=_0x5c1d08||0xcc;return function(_0x5cefd1){if(_0x5cefd1){return _0x337fd9[_0x72a3('0x1c')](_0x5c1d08);}return _0x337fd9['status'](_0x5c1d08)['end']();};}function respondWithResult(_0x3a6b7a,_0x5ba3f8){_0x5ba3f8=_0x5ba3f8||0xc8;return function(_0x300245){if(_0x300245){return _0x3a6b7a[_0x72a3('0x1d')](_0x5ba3f8)[_0x72a3('0x1e')](_0x300245);}};}function respondWithFilteredResult(_0x3d82af,_0x26e8a3){return function(_0xd7daae){if(_0xd7daae){var _0x60d059=typeof _0x26e8a3[_0x72a3('0x1f')]===_0x72a3('0x20')&&typeof _0x26e8a3[_0x72a3('0x21')]===_0x72a3('0x20');var _0x5e0198=_0xd7daae['count'];var _0xd8ae2e=_0x60d059?0x0:_0x26e8a3['offset'];var _0x377e46=_0x60d059?_0xd7daae[_0x72a3('0x22')]:_0x26e8a3[_0x72a3('0x1f')]+_0x26e8a3['limit'];var _0x3666b9;if(_0x377e46>=_0x5e0198){_0x377e46=_0x5e0198;_0x3666b9=0xc8;}else{_0x3666b9=0xce;}_0x3d82af['status'](_0x3666b9);return _0x3d82af['set'](_0x72a3('0x23'),_0xd8ae2e+'-'+_0x377e46+'/'+_0x5e0198)[_0x72a3('0x1e')](_0xd7daae);}return null;};}function patchUpdates(_0xd69dc9){return function(_0x55932d){try{jsonpatch[_0x72a3('0x24')](_0x55932d,_0xd69dc9,!![]);}catch(_0x1bb1fa){return BPromise[_0x72a3('0x25')](_0x1bb1fa);}return _0x55932d[_0x72a3('0x26')]();};}function saveUpdates(_0x329d1b,_0x242ad6){return function(_0x3d8d51){if(_0x3d8d51){return _0x3d8d51[_0x72a3('0x27')](_0x329d1b)[_0x72a3('0x28')](function(_0xd877b){return _0xd877b;});}return null;};}function handleEntityNotFound(_0x315675,_0x4a4890){return function(_0x116d6f){if(!_0x116d6f){_0x315675[_0x72a3('0x1c')](0x194);}return _0x116d6f;};}function handleError(_0x2292cf,_0x11b9cc){_0x11b9cc=_0x11b9cc||0x1f4;return function(_0x1a312f){logger[_0x72a3('0x29')](_0x1a312f[_0x72a3('0x2a')]);if(_0x1a312f['name']){delete _0x1a312f[_0x72a3('0x2b')];}_0x2292cf['status'](_0x11b9cc)[_0x72a3('0x2c')](_0x1a312f);};}exports['index']=function(_0x5191a4,_0xfd03b2){var _0x2b900c={},_0x59ec14={},_0x2457ba={'count':0x0,'rows':[]};var _0x168a19=_[_0x72a3('0x2d')](db[_0x72a3('0x2e')]['rawAttributes'],function(_0x3dda04){return{'name':_0x3dda04[_0x72a3('0x2f')],'type':_0x3dda04[_0x72a3('0x30')]['key']};});_0x59ec14['model']=_['map'](_0x168a19,_0x72a3('0x2b'));_0x59ec14[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x5191a4[_0x72a3('0x31')]);_0x59ec14[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x59ec14[_0x72a3('0x35')],_0x59ec14[_0x72a3('0x31')]);_0x2b900c['attributes']=_['intersection'](_0x59ec14[_0x72a3('0x35')],qs[_0x72a3('0x36')](_0x5191a4[_0x72a3('0x31')][_0x72a3('0x36')]));_0x2b900c['attributes']=_0x2b900c['attributes'][_0x72a3('0x37')]?_0x2b900c['attributes']:_0x59ec14[_0x72a3('0x35')];if(!_0x5191a4[_0x72a3('0x31')][_0x72a3('0x38')](_0x72a3('0x39'))){_0x2b900c[_0x72a3('0x21')]=qs['limit'](_0x5191a4[_0x72a3('0x31')]['limit']);_0x2b900c[_0x72a3('0x1f')]=qs[_0x72a3('0x1f')](_0x5191a4[_0x72a3('0x31')]['offset']);}_0x2b900c[_0x72a3('0x3a')]=qs[_0x72a3('0x3b')](_0x5191a4[_0x72a3('0x31')][_0x72a3('0x3b')]);_0x2b900c[_0x72a3('0x3c')]=qs['filters'](_[_0x72a3('0x3d')](_0x5191a4[_0x72a3('0x31')],_0x59ec14['filters']),_0x168a19);if(_0x5191a4['query'][_0x72a3('0x3e')]){_0x2b900c[_0x72a3('0x3c')]=_['merge'](_0x2b900c[_0x72a3('0x3c')],{'$or':_[_0x72a3('0x2d')](_0x168a19,function(_0x4c4b13){if(_0x4c4b13[_0x72a3('0x30')]!==_0x72a3('0x3f')){var _0x3462c7={};_0x3462c7[_0x4c4b13[_0x72a3('0x2b')]]={'$like':'%'+_0x5191a4[_0x72a3('0x31')][_0x72a3('0x3e')]+'%'};return _0x3462c7;}})});}_0x2b900c=_[_0x72a3('0x40')]({},_0x2b900c,_0x5191a4[_0x72a3('0x41')]);var _0x29274a={'where':_0x2b900c[_0x72a3('0x3c')]};return db['Team'][_0x72a3('0x22')](_0x29274a)[_0x72a3('0x28')](function(_0x37faf8){_0x2457ba[_0x72a3('0x22')]=_0x37faf8;if(_0x5191a4[_0x72a3('0x31')][_0x72a3('0x42')]){_0x2b900c[_0x72a3('0x43')]=[{'all':!![]}];}return db[_0x72a3('0x2e')][_0x72a3('0x44')](_0x2b900c);})['then'](function(_0x59dce5){_0x2457ba['rows']=_0x59dce5;return _0x2457ba;})['then'](respondWithFilteredResult(_0xfd03b2,_0x2b900c))[_0x72a3('0x45')](handleError(_0xfd03b2,null));};exports[_0x72a3('0x46')]=function(_0x307329,_0x100855){var _0x4358af={'raw':![],'where':{'id':_0x307329[_0x72a3('0x47')]['id']}},_0x35e724={};_0x35e724[_0x72a3('0x35')]=_[_0x72a3('0x32')](db[_0x72a3('0x2e')]['rawAttributes']);_0x35e724['query']=_['keys'](_0x307329[_0x72a3('0x31')]);_0x35e724[_0x72a3('0x33')]=_['intersection'](_0x35e724[_0x72a3('0x35')],_0x35e724[_0x72a3('0x31')]);_0x4358af[_0x72a3('0x48')]=_[_0x72a3('0x34')](_0x35e724['model'],qs['fields'](_0x307329['query']['fields']));_0x4358af[_0x72a3('0x48')]=_0x4358af[_0x72a3('0x48')][_0x72a3('0x37')]?_0x4358af['attributes']:_0x35e724[_0x72a3('0x35')];if(_0x307329[_0x72a3('0x31')][_0x72a3('0x42')]){_0x4358af[_0x72a3('0x43')]=[{'all':!![]}];}_0x4358af=_['merge']({},_0x4358af,_0x307329[_0x72a3('0x41')]);return db[_0x72a3('0x2e')]['find'](_0x4358af)[_0x72a3('0x28')](handleEntityNotFound(_0x100855,null))[_0x72a3('0x28')](respondWithResult(_0x100855,null))[_0x72a3('0x45')](handleError(_0x100855,null));};exports['create']=function(_0x86f217,_0x357324){return db[_0x72a3('0x2e')][_0x72a3('0x49')](_0x86f217[_0x72a3('0x4a')],{})['then'](function(_0x1cc4b4){var _0x5df8e2=_0x86f217['user'][_0x72a3('0x4b')]({'plain':!![]});if(!_0x5df8e2)throw new Error(_0x72a3('0x4c'));if(_0x5df8e2[_0x72a3('0x4d')]===_0x72a3('0x4e')){var _0x1f249d=_0x1cc4b4[_0x72a3('0x4b')]({'plain':!![]});var _0x178eca=_0x72a3('0x4f');return db['UserProfileSection'][_0x72a3('0x50')]({'where':{'name':_0x178eca,'userProfileId':_0x5df8e2[_0x72a3('0x51')]},'raw':!![]})[_0x72a3('0x28')](function(_0x23f87e){if(_0x23f87e&&_0x23f87e[_0x72a3('0x52')]===0x0){return db[_0x72a3('0x53')][_0x72a3('0x49')]({'name':_0x1f249d['name'],'resourceId':_0x1f249d['id'],'type':_0x23f87e[_0x72a3('0x2b')],'sectionId':_0x23f87e['id']},{})[_0x72a3('0x28')](function(){return _0x1cc4b4;});}else{return _0x1cc4b4;}})[_0x72a3('0x45')](function(_0x17192a){logger['error'](_0x72a3('0x54'),_0x17192a);throw _0x17192a;});}return _0x1cc4b4;})[_0x72a3('0x28')](respondWithResult(_0x357324,0xc9))[_0x72a3('0x45')](handleError(_0x357324,null));};exports[_0x72a3('0x27')]=function(_0x56436a,_0x54b858){if(_0x56436a[_0x72a3('0x4a')]['id']){delete _0x56436a[_0x72a3('0x4a')]['id'];}return db['Team']['find']({'where':{'id':_0x56436a[_0x72a3('0x47')]['id']}})[_0x72a3('0x28')](handleEntityNotFound(_0x54b858,null))[_0x72a3('0x28')](saveUpdates(_0x56436a[_0x72a3('0x4a')],null))['then'](respondWithResult(_0x54b858,null))[_0x72a3('0x45')](handleError(_0x54b858,null));};exports['destroy']=function(_0x2b2650,_0x440aec){var _0x2feb23=_0x2b2650[_0x72a3('0x47')]['id'];var _0x238927=[];return db[_0x72a3('0x55')]['transaction'](function(_0x25b80b){var _0x3b9bb6=_0x72a3('0x56')+_0x2feb23;return db['sequelize'][_0x72a3('0x31')](_0x3b9bb6,{'type':db[_0x72a3('0x57')]['QueryTypes'][_0x72a3('0x58')],'raw':!![],'transaction':_0x25b80b})[_0x72a3('0x28')](function(_0x1188e6){_0x238927=_['map'](_0x1188e6,function(_0x39bbc1){return Number(_0x39bbc1['UserId']);});})[_0x72a3('0x28')](function(){var _0xbea542=_0x72a3('0x59')+_0x2feb23;return db[_0x72a3('0x55')][_0x72a3('0x31')](_0xbea542,{'type':db[_0x72a3('0x57')][_0x72a3('0x5a')][_0x72a3('0x58')],'raw':!![],'transaction':_0x25b80b});})[_0x72a3('0x28')](function(_0x5572ec){var _0x59ec4f=_['map'](_0x5572ec,function(_0x30aa15){return Number(_0x30aa15['VoiceQueueId']);});return db[_0x72a3('0x5b')][_0x72a3('0x5c')]({'where':{'UserId':{'$in':_0x238927},'VoiceQueueId':{'$in':_0x59ec4f}},'transaction':_0x25b80b});})[_0x72a3('0x28')](function(){var _0x3ee3d8='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2feb23;return db['sequelize'][_0x72a3('0x31')](_0x3ee3d8,{'type':db[_0x72a3('0x57')]['QueryTypes'][_0x72a3('0x58')],'raw':!![],'transaction':_0x25b80b});})[_0x72a3('0x28')](function(_0x385dfd){var _0x20fdca=_[_0x72a3('0x2d')](_0x385dfd,function(_0x3382c9){return Number(_0x3382c9[_0x72a3('0x5d')]);});return db[_0x72a3('0x5e')][_0x72a3('0x5c')]({'where':{'UserId':{'$in':_0x238927},'MailQueueId':{'$in':_0x20fdca}},'transaction':_0x25b80b});})[_0x72a3('0x28')](function(){var _0x3c6714=_0x72a3('0x5f')+_0x2feb23;return db[_0x72a3('0x55')]['query'](_0x3c6714,{'type':db[_0x72a3('0x57')][_0x72a3('0x5a')][_0x72a3('0x58')],'raw':!![],'transaction':_0x25b80b});})['then'](function(_0x45afa1){var _0x46e4a5=_[_0x72a3('0x2d')](_0x45afa1,function(_0x3fde9c){return Number(_0x3fde9c[_0x72a3('0x60')]);});return db[_0x72a3('0x61')][_0x72a3('0x5c')]({'where':{'UserId':{'$in':_0x238927},'SmsQueueId':{'$in':_0x46e4a5}},'transaction':_0x25b80b});})[_0x72a3('0x28')](function(){var _0x185b85='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2feb23;return db[_0x72a3('0x55')]['query'](_0x185b85,{'type':db[_0x72a3('0x57')][_0x72a3('0x5a')][_0x72a3('0x58')],'raw':!![],'transaction':_0x25b80b});})['then'](function(_0x313aa9){var _0xcdc28f=_[_0x72a3('0x2d')](_0x313aa9,function(_0x8bfe9d){return Number(_0x8bfe9d[_0x72a3('0x62')]);});return db[_0x72a3('0x63')][_0x72a3('0x5c')]({'where':{'UserId':{'$in':_0x238927},'ChatQueueId':{'$in':_0xcdc28f}},'transaction':_0x25b80b});})[_0x72a3('0x28')](function(){var _0x40abea=_0x72a3('0x64')+_0x2feb23;return db[_0x72a3('0x55')]['query'](_0x40abea,{'type':db[_0x72a3('0x57')][_0x72a3('0x5a')]['SELECT'],'raw':!![],'transaction':_0x25b80b});})[_0x72a3('0x28')](function(_0x53e300){var _0x2ee40f=_['map'](_0x53e300,function(_0x3463af){return Number(_0x3463af[_0x72a3('0x65')]);});return db[_0x72a3('0x66')][_0x72a3('0x5c')]({'where':{'UserId':{'$in':_0x238927},'FaxQueueId':{'$in':_0x2ee40f}},'transaction':_0x25b80b});})[_0x72a3('0x28')](function(){var _0x265695=_0x72a3('0x67')+_0x2feb23;return db['sequelize'][_0x72a3('0x31')](_0x265695,{'type':db[_0x72a3('0x57')][_0x72a3('0x5a')]['SELECT'],'raw':!![],'transaction':_0x25b80b});})[_0x72a3('0x28')](function(_0x378ba5){var _0x36f391=_[_0x72a3('0x2d')](_0x378ba5,function(_0x16f65a){return Number(_0x16f65a[_0x72a3('0x68')]);});return db[_0x72a3('0x69')]['destroy']({'where':{'UserId':{'$in':_0x238927},'OpenchannelQueueId':{'$in':_0x36f391}},'transaction':_0x25b80b});})[_0x72a3('0x28')](function(){var _0x16053f=_0x72a3('0x6a')+_0x2feb23;return db[_0x72a3('0x55')][_0x72a3('0x31')](_0x16053f,{'type':db[_0x72a3('0x57')][_0x72a3('0x5a')][_0x72a3('0x58')],'raw':!![],'transaction':_0x25b80b});})[_0x72a3('0x28')](function(_0x58f4f0){var _0x4b070e=_[_0x72a3('0x2d')](_0x58f4f0,function(_0x4394df){return Number(_0x4394df[_0x72a3('0x6b')]);});return db[_0x72a3('0x6c')][_0x72a3('0x5c')]({'where':{'UserId':{'$in':_0x238927},'WhatsappQueueId':{'$in':_0x4b070e}},'transaction':_0x25b80b});})[_0x72a3('0x28')](function(){return db[_0x72a3('0x6d')][_0x72a3('0x50')]({'where':{'TeamId':_0x2feb23}});})[_0x72a3('0x28')](function(_0x4d7dc5){if(_0x4d7dc5===null){return;}return db[_0x72a3('0x6e')][_0x72a3('0x5c')]({'where':{'UserId':{'$in':_0x238927},'VoicePrefixId':_0x4d7dc5[_0x72a3('0x6f')]},'transaction':_0x25b80b});})['then'](function(){return db[_0x72a3('0x2e')][_0x72a3('0x5c')]({'where':{'id':_0x2feb23},'cascade':!![],'transaction':_0x25b80b});})[_0x72a3('0x28')](function(_0x250e95){if(_0x250e95===0x0){_0x440aec[_0x72a3('0x1c')](0x194);}else{return db[_0x72a3('0x53')][_0x72a3('0x5c')]({'where':{'type':'Teams','resourceId':_0x2feb23},'cascade':!![],'transaction':_0x25b80b})[_0x72a3('0x28')](function(){_0x440aec[_0x72a3('0x1d')](0xcc)['end']();});}})[_0x72a3('0x45')](function(_0x1f7801){_0x440aec[_0x72a3('0x1d')](0x1f4)[_0x72a3('0x2c')](_0x1f7801);});});};exports[_0x72a3('0x70')]=function(_0x1dfb61,_0x57cb7c,_0x404547){return db[_0x72a3('0x2e')][_0x72a3('0x71')]({'where':{'id':_0x1dfb61['params']['id']}})[_0x72a3('0x28')](handleEntityNotFound(_0x57cb7c,null))['then'](function(_0x283506){if(!_0x1dfb61[_0x72a3('0x31')][_0x72a3('0x72')]||!utils[_0x72a3('0x73')](_0x1dfb61[_0x72a3('0x31')][_0x72a3('0x72')])){throw new db['Sequelize'][(_0x72a3('0x74'))](_0x72a3('0x75'));}var _0x1e3ea7={};var _0x3b7ded={};_0x3b7ded['model']=_[_0x72a3('0x32')](db[_[_0x72a3('0x76')](_0x1dfb61['query'][_0x72a3('0x72')]['toLowerCase']())+'Queue'][_0x72a3('0x77')]);_0x3b7ded[_0x72a3('0x31')]=_[_0x72a3('0x32')](_0x1dfb61[_0x72a3('0x31')]);_0x3b7ded[_0x72a3('0x33')]=_['intersection'](_0x3b7ded[_0x72a3('0x35')],_0x3b7ded[_0x72a3('0x31')]);_0x1e3ea7[_0x72a3('0x48')]=_[_0x72a3('0x34')](_0x3b7ded[_0x72a3('0x35')],qs['fields'](_0x1dfb61['query'][_0x72a3('0x36')]));_0x1e3ea7[_0x72a3('0x48')]=_0x1e3ea7[_0x72a3('0x48')][_0x72a3('0x37')]?_0x1e3ea7[_0x72a3('0x48')]:_0x3b7ded[_0x72a3('0x35')];_0x1e3ea7[_0x72a3('0x21')]=qs['limit'](_0x1dfb61['query'][_0x72a3('0x21')]);_0x1e3ea7[_0x72a3('0x1f')]=qs[_0x72a3('0x1f')](_0x1dfb61[_0x72a3('0x31')]['offset']);_0x1e3ea7[_0x72a3('0x3a')]=qs[_0x72a3('0x3b')](_0x1dfb61['query'][_0x72a3('0x3b')]);_0x1e3ea7['where']=qs['filters'](_[_0x72a3('0x3d')](_0x1dfb61[_0x72a3('0x31')],_0x3b7ded[_0x72a3('0x33')]));_0x1e3ea7=_['merge']({},_0x1e3ea7,_0x1dfb61[_0x72a3('0x41')]);return _0x283506[_0x72a3('0x4b')+_['capitalize'](_0x1dfb61['query'][_0x72a3('0x72')][_0x72a3('0x78')]())+'Queues'](_0x1e3ea7);})['then'](respondWithResult(_0x57cb7c,null))[_0x72a3('0x45')](handleError(_0x57cb7c,null));};exports[_0x72a3('0x79')]=function(_0x115e2a,_0x546234,_0x472a69){return db['Team'][_0x72a3('0x71')]({'where':{'id':_0x115e2a[_0x72a3('0x47')]['id']}})[_0x72a3('0x28')](function(_0x5d63ce){if(_0x5d63ce){if(!_0x115e2a[_0x72a3('0x4a')][_0x72a3('0x72')]||!utils['isValidChannel'](_0x115e2a[_0x72a3('0x4a')][_0x72a3('0x72')])){throw new db[(_0x72a3('0x57'))]['ValidationError']('Unknown\x20channel');}return _0x5d63ce[_0x72a3('0x7a')+_[_0x72a3('0x76')](_0x115e2a[_0x72a3('0x4a')][_0x72a3('0x72')][_0x72a3('0x78')]())+'Queues'](_0x115e2a[_0x72a3('0x4a')][_0x72a3('0x7b')]);}return null;})[_0x72a3('0x28')](handleEntityNotFound(_0x546234,null))[_0x72a3('0x28')](respondWithStatusCode(_0x546234,null))[_0x72a3('0x45')](handleError(_0x546234,null));};exports[_0x72a3('0x7c')]=function(_0x2f959d,_0x2763f4,_0xf083d3){return db[_0x72a3('0x2e')][_0x72a3('0x71')]({'where':{'id':_0x2f959d[_0x72a3('0x47')]['id']}})[_0x72a3('0x28')](function(_0x1d2ebf){if(_0x1d2ebf){if(!_0x2f959d[_0x72a3('0x31')][_0x72a3('0x72')]||!utils[_0x72a3('0x73')](_0x2f959d[_0x72a3('0x31')]['channel'])){throw new db[(_0x72a3('0x57'))][(_0x72a3('0x74'))](_0x72a3('0x75'));}return _0x1d2ebf[_0x72a3('0x7d')+_['capitalize'](_0x2f959d[_0x72a3('0x31')][_0x72a3('0x72')][_0x72a3('0x78')]())+'Queues'](_0x2f959d['query']['ids']);}return null;})[_0x72a3('0x28')](handleEntityNotFound(_0x2763f4,null))[_0x72a3('0x28')](respondWithStatusCode(_0x2763f4,null))[_0x72a3('0x45')](handleError(_0x2763f4,null));};exports[_0x72a3('0x7e')]=function(_0x4d34a1,_0x6300ca){var _0x2ca20a=_[_0x72a3('0x7f')](_0x4d34a1['body'][_0x72a3('0x7b')])?_0x4d34a1[_0x72a3('0x4a')]['ids']:[_0x4d34a1[_0x72a3('0x4a')]['ids']];var _0x4c8660=_0x4d34a1['params']['id'];return db[_0x72a3('0x2e')][_0x72a3('0x50')]({'where':{'id':_0x4c8660}})[_0x72a3('0x28')](handleEntityNotFound(_0x6300ca,null))[_0x72a3('0x28')](function(_0x29d722){if(_0x29d722){var _0x2a8c81=[_0x72a3('0x80'),_0x72a3('0x81'),_0x72a3('0x82'),_0x72a3('0x83'),_0x72a3('0x84'),_0x72a3('0x85'),_0x72a3('0x86')];return db[_0x72a3('0x55')][_0x72a3('0x87')](function(_0x2fb62f){var _0xb115f9=_[_0x72a3('0x2d')](_0x2a8c81,function(_0x17b79e){var _0x425b16={'attributes':['id',_0x72a3('0x2b')]};if(_0x17b79e===_0x72a3('0x80')){_0x425b16['through']={'attributes':['penalty']};}return _0x29d722[_0x72a3('0x4b')+_0x17b79e+_0x72a3('0x88')](_0x425b16)[_0x72a3('0x28')](function(_0x48985c){var _0x5b6e47=_[_0x72a3('0x2d')](_0x48985c,function(_0x24935b){var _0x3bc2f2=_[_0x72a3('0x2d')](_0x2ca20a,function(_0x3bd978){var _0x49a8f4={'where':{'UserId':_0x3bd978,[_0x17b79e+_0x72a3('0x89')]:_0x24935b['id']},'transaction':_0x2fb62f};if(_0x17b79e===_0x72a3('0x80')){_0x49a8f4[_0x72a3('0x18')]={'penalty':_0x24935b['TeamVoiceQueue'][_0x72a3('0x8a')]};}return db['User'+_0x17b79e+'Queue'][_0x72a3('0x8b')](_0x49a8f4)[_0x72a3('0x28')](function(){socket[_0x72a3('0x8c')](_0x72a3('0x4e')+_0x17b79e+'Queue:save',{'UserId':_0x3bd978,[_0x17b79e+_0x72a3('0x89')]:_0x24935b['id']});if(_0x17b79e!=='Voice'){return;}return db[_0x72a3('0x8d')]['findAll']({'where':{'id':_0x2ca20a,'online':0x1},'attributes':['id',_0x72a3('0x2b'),_0x72a3('0x8e'),'voicePause',_0x72a3('0x8f')],'raw':!![]})[_0x72a3('0x28')](function(_0x1a19eb){var _0x109696=_[_0x72a3('0x2d')](_0x1a19eb,function(_0x396a07){return db[_0x72a3('0x90')][_0x72a3('0x91')]({'membername':_0x396a07[_0x72a3('0x2b')],'UserId':_0x396a07['id'],'queue_name':_0x24935b[_0x72a3('0x2b')],'VoiceQueueId':_0x24935b['id'],'interface':_[_0x72a3('0x92')](_0x396a07[_0x72a3('0x8f')])?util[_0x72a3('0x93')](_0x72a3('0x94'),_0x396a07[_0x72a3('0x2b')]):_0x396a07[_0x72a3('0x8f')],'paused':_0x396a07[_0x72a3('0x95')]||![],'penalty':_0x24935b[_0x72a3('0x96')]['penalty']},{'transaction':_0x2fb62f});});return Promise[_0x72a3('0x97')](_0x109696);});});});return Promise[_0x72a3('0x97')](_0x3bc2f2);});return Promise[_0x72a3('0x97')](_0x5b6e47);})['then'](function(){return db[_0x72a3('0x6d')][_0x72a3('0x71')]({'where':{'teamId':_0x4c8660}})[_0x72a3('0x28')](function(_0xe0f7ca){if(_0xe0f7ca){var _0x3f6968=_[_0x72a3('0x2d')](_0x2ca20a,function(_0x10ea86){db[_0x72a3('0x6e')][_0x72a3('0x91')]({'UserId':_0x10ea86,'VoicePrefixId':_0xe0f7ca[_0x72a3('0x6f')]});});return Promise[_0x72a3('0x97')](_0x3f6968);}});});});return Promise[_0x72a3('0x97')](_0xb115f9)[_0x72a3('0x28')](function(){return _0x29d722[_0x72a3('0x7e')](_0x2ca20a,{'transaction':_0x2fb62f})['spread'](function(_0x249d10){return _0x249d10;});});});}})[_0x72a3('0x28')](respondWithResult(_0x6300ca,null))[_0x72a3('0x45')](handleError(_0x6300ca,null));};exports[_0x72a3('0x98')]=function(_0x1c9bd7,_0xadb455){var _0x5066ab=_['isArray'](_0x1c9bd7[_0x72a3('0x31')][_0x72a3('0x7b')])?_0x1c9bd7['query'][_0x72a3('0x7b')]:[_0x1c9bd7[_0x72a3('0x31')][_0x72a3('0x7b')]];var _0x4cba23=_0x1c9bd7['params']['id'];return db[_0x72a3('0x2e')]['find']({'where':{'id':_0x4cba23}})[_0x72a3('0x28')](handleEntityNotFound(_0xadb455,null))[_0x72a3('0x28')](function(_0x150ff7){if(_0x150ff7){var _0x253afa=[_0x72a3('0x80'),_0x72a3('0x81'),'Mail',_0x72a3('0x83'),_0x72a3('0x84'),_0x72a3('0x85'),_0x72a3('0x86')];return db[_0x72a3('0x55')][_0x72a3('0x87')](function(_0x178aef){var _0xb9f951=_[_0x72a3('0x2d')](_0x253afa,function(_0x1e5bd6){var _0x23abf5={'attributes':['id',_0x72a3('0x2b')]};return _0x150ff7[_0x72a3('0x4b')+_0x1e5bd6+_0x72a3('0x88')](_0x23abf5)['then'](function(_0x4e3120){var _0x1b4fa7=_[_0x72a3('0x2d')](_0x4e3120,function(_0x41ccd1){return _0x41ccd1[_0x72a3('0x98')](_0x5066ab,{'transaction':_0x178aef})[_0x72a3('0x28')](function(){var _0x368c89=_[_0x72a3('0x2d')](_0x5066ab,function(_0x3f455f){socket[_0x72a3('0x8c')](_0x72a3('0x4e')+_0x1e5bd6+_0x72a3('0x99'),{'UserId':Number(_0x3f455f),[_0x1e5bd6+_0x72a3('0x89')]:_0x41ccd1['id']});if(_0x1e5bd6!==_0x72a3('0x80')){return;}return db[_0x72a3('0x90')][_0x72a3('0x5c')]({'where':{'VoiceQueueId':_0x41ccd1['id'],'UserId':_0x3f455f},'transaction':_0x178aef});});return Promise[_0x72a3('0x97')](_0x368c89);});});return Promise[_0x72a3('0x97')](_0x1b4fa7);});});return Promise['all'](_0xb9f951)[_0x72a3('0x28')](function(){return _0x150ff7[_0x72a3('0x98')](_0x5066ab,{'transaction':_0x178aef});})[_0x72a3('0x28')](function(){return db['TeamVoicePrefix'][_0x72a3('0x71')]({'where':{'teamId':_0x4cba23}})['then'](function(_0x433677){if(_0x433677){var _0x3466a1=_[_0x72a3('0x2d')](_0x5066ab,function(_0x322021){db[_0x72a3('0x6e')][_0x72a3('0x5c')]({'where':{'UserId':_0x322021,'VoicePrefixId':_0x433677[_0x72a3('0x6f')]}});});return Promise[_0x72a3('0x97')](_0x3466a1);}});});});}})['then'](respondWithStatusCode(_0xadb455,null))[_0x72a3('0x45')](handleError(_0xadb455,null));};exports[_0x72a3('0x9a')]=function(_0x571ece,_0x15a37d,_0x511a9c){var _0x5e7d42={};var _0x1dccc3={};var _0x190371;var _0x529d25;return db[_0x72a3('0x2e')][_0x72a3('0x71')]({'where':{'id':_0x571ece['params']['id']}})[_0x72a3('0x28')](handleEntityNotFound(_0x15a37d,null))[_0x72a3('0x28')](function(_0x31eb1c){if(_0x31eb1c){_0x190371=_0x31eb1c;_0x1dccc3[_0x72a3('0x35')]=_[_0x72a3('0x32')](db[_0x72a3('0x8d')][_0x72a3('0x77')]);_0x1dccc3[_0x72a3('0x31')]=_['keys'](_0x571ece[_0x72a3('0x31')]);_0x1dccc3[_0x72a3('0x33')]=_[_0x72a3('0x34')](_0x1dccc3['model'],_0x1dccc3[_0x72a3('0x31')]);_0x5e7d42[_0x72a3('0x48')]=_[_0x72a3('0x34')](_0x1dccc3[_0x72a3('0x35')],qs[_0x72a3('0x36')](_0x571ece[_0x72a3('0x31')]['fields']));_0x5e7d42[_0x72a3('0x48')]=_0x5e7d42[_0x72a3('0x48')][_0x72a3('0x37')]?_0x5e7d42[_0x72a3('0x48')]:_0x1dccc3[_0x72a3('0x35')];_0x5e7d42[_0x72a3('0x3a')]=qs[_0x72a3('0x3b')](_0x571ece[_0x72a3('0x31')][_0x72a3('0x3b')]);_0x5e7d42['where']=qs[_0x72a3('0x33')](_[_0x72a3('0x3d')](_0x571ece[_0x72a3('0x31')],_0x1dccc3[_0x72a3('0x33')]));if(_0x571ece[_0x72a3('0x31')][_0x72a3('0x3e')]){_0x5e7d42[_0x72a3('0x3c')]=_[_0x72a3('0x40')](_0x5e7d42[_0x72a3('0x3c')],{'$or':_[_0x72a3('0x2d')](_0x5e7d42[_0x72a3('0x48')],function(_0x2a5dbe){var _0x2564fa={};_0x2564fa[_0x2a5dbe]={'$like':'%'+_0x571ece[_0x72a3('0x31')]['filter']+'%'};return _0x2564fa;})});}_0x5e7d42=_[_0x72a3('0x40')]({},_0x5e7d42,_0x571ece['options']);return _0x190371[_0x72a3('0x9a')](_0x5e7d42);}})[_0x72a3('0x28')](function(_0x1da8bf){if(_0x1da8bf){_0x529d25=_0x1da8bf[_0x72a3('0x37')];if(!_0x571ece['query'][_0x72a3('0x38')]('nolimit')){_0x5e7d42['limit']=qs[_0x72a3('0x21')](_0x571ece[_0x72a3('0x31')]['limit']);_0x5e7d42['offset']=qs[_0x72a3('0x1f')](_0x571ece[_0x72a3('0x31')][_0x72a3('0x1f')]);}return _0x190371[_0x72a3('0x9a')](_0x5e7d42);}})['then'](function(_0x22facc){if(_0x22facc){return _0x22facc?{'count':_0x529d25,'rows':_0x22facc}:null;}})[_0x72a3('0x28')](respondWithResult(_0x15a37d,null))[_0x72a3('0x45')](handleError(_0x15a37d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 768e953..19ec100 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 _0x611f=['setMaxListeners','update','remove','emit','hook','events','../../mysqldb','Team'];(function(_0x133263,_0x300d1d){var _0x15ca9a=function(_0x201150){while(--_0x201150){_0x133263['push'](_0x133263['shift']());}};_0x15ca9a(++_0x300d1d);}(_0x611f,0x1c5));var _0xf611=function(_0x32d81e,_0x122a11){_0x32d81e=_0x32d81e-0x0;var _0x52fbf6=_0x611f[_0x32d81e];return _0x52fbf6;};'use strict';var EventEmitter=require(_0xf611('0x0'));var Team=require(_0xf611('0x1'))['db'][_0xf611('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xf611('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf611('0x4'),'afterDestroy':_0xf611('0x5')};function emitEvent(_0x4f8e6f){return function(_0x21ef5f,_0x4ee420,_0x2fedf3){TeamEvents[_0xf611('0x6')](_0x4f8e6f+':'+_0x21ef5f['id'],_0x21ef5f);TeamEvents[_0xf611('0x6')](_0x4f8e6f,_0x21ef5f);_0x2fedf3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xf611('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xc198=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc198,0x8c));var _0x8c19=function(_0x1b4c02,_0x18a065){_0x1b4c02=_0x1b4c02-0x0;var _0x40d930=_0xc198[_0x1b4c02];return _0x40d930;};'use strict';var EventEmitter=require(_0x8c19('0x0'));var Team=require(_0x8c19('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x8c19('0x2')](0x0);var events={'afterCreate':_0x8c19('0x3'),'afterUpdate':_0x8c19('0x4'),'afterDestroy':_0x8c19('0x5')};function emitEvent(_0x3bacae){return function(_0x339aed,_0x59ed34,_0x531c76){TeamEvents[_0x8c19('0x6')](_0x3bacae+':'+_0x339aed['id'],_0x339aed);TeamEvents[_0x8c19('0x6')](_0x3bacae,_0x339aed);_0x531c76(null);};}for(var e in events){if(events[_0x8c19('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x8c19('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 912a23c..b7d05a2 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 _0x885a=['./team.attributes','exports','Team','teams','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x36a561,_0x70ad3f){var _0x5e0c68=function(_0x376f12){while(--_0x376f12){_0x36a561['push'](_0x36a561['shift']());}};_0x5e0c68(++_0x70ad3f);}(_0x885a,0xae));var _0xa885=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x885a[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xa885('0x0'));var util=require(_0xa885('0x1'));var logger=require(_0xa885('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa885('0x3'));var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa885('0x5'));var attributes=require(_0xa885('0x6'));module[_0xa885('0x7')]=function(_0x5599a3,_0xbce2f3){return _0x5599a3['define'](_0xa885('0x8'),attributes,{'tableName':_0xa885('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8827=['../../config/environment','./team.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x44c7f4,_0x26a1f8){var _0x49a0a9=function(_0x39265d){while(--_0x39265d){_0x44c7f4['push'](_0x44c7f4['shift']());}};_0x49a0a9(++_0x26a1f8);}(_0x8827,0x1e4));var _0x7882=function(_0x587a17,_0x138c1f){_0x587a17=_0x587a17-0x0;var _0x442a11=_0x8827[_0x587a17];return _0x442a11;};'use strict';var _=require(_0x7882('0x0'));var util=require(_0x7882('0x1'));var logger=require('../../config/logger')(_0x7882('0x2'));var moment=require(_0x7882('0x3'));var BPromise=require(_0x7882('0x4'));var rp=require(_0x7882('0x5'));var fs=require('fs');var path=require(_0x7882('0x6'));var rimraf=require(_0x7882('0x7'));var config=require(_0x7882('0x8'));var attributes=require(_0x7882('0x9'));module[_0x7882('0xa')]=function(_0x34e5bf,_0x4fcb96){return _0x34e5bf[_0x7882('0xb')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 0df20ab..b98c8a8 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 _0xded2=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','Team,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x4f0c17,_0x3705c9){var _0x5ac7cc=function(_0x43ca2d){while(--_0x43ca2d){_0x4f0c17['push'](_0x4f0c17['shift']());}};_0x5ac7cc(++_0x3705c9);}(_0xded2,0x1a0));var _0x2ded=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0xded2[_0xaaf2e2];return _0x28bc36;};'use strict';var _=require(_0x2ded('0x0'));var util=require(_0x2ded('0x1'));var moment=require(_0x2ded('0x2'));var BPromise=require(_0x2ded('0x3'));var rs=require(_0x2ded('0x4'));var fs=require('fs');var Redis=require(_0x2ded('0x5'));var db=require(_0x2ded('0x6'))['db'];var utils=require(_0x2ded('0x7'));var logger=require(_0x2ded('0x8'))(_0x2ded('0x9'));var config=require(_0x2ded('0xa'));var jayson=require(_0x2ded('0xb'));var client=jayson['client'][_0x2ded('0xc')]({'port':0x232a});config[_0x2ded('0xd')]=_['defaults'](config[_0x2ded('0xd')],{'host':_0x2ded('0xe'),'port':0x18eb});var socket=require(_0x2ded('0xf'))(new Redis(config[_0x2ded('0xd')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x3bedfa,_0x3a2437,_0x28cef2){return new BPromise(function(_0xf65c39,_0x4e3dad){return client[_0x2ded('0x10')](_0x3bedfa,_0x28cef2)[_0x2ded('0x11')](function(_0x3c75b7){logger[_0x2ded('0x12')](_0x2ded('0x13'),_0x3a2437,_0x2ded('0x14'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x3a2437,_0x2ded('0x14'),JSON[_0x2ded('0x15')](_0x3c75b7));if(_0x3c75b7[_0x2ded('0x16')]){if(_0x3c75b7[_0x2ded('0x16')]['code']===0x1f4){logger['error'](_0x2ded('0x13'),_0x3a2437,_0x3c75b7[_0x2ded('0x16')][_0x2ded('0x17')]);return _0x4e3dad(_0x3c75b7[_0x2ded('0x16')][_0x2ded('0x17')]);}logger[_0x2ded('0x16')](_0x2ded('0x13'),_0x3a2437,_0x3c75b7[_0x2ded('0x16')][_0x2ded('0x17')]);return _0xf65c39(_0x3c75b7[_0x2ded('0x16')][_0x2ded('0x17')]);}else{logger[_0x2ded('0x12')](_0x2ded('0x13'),_0x3a2437,'request\x20sent');_0xf65c39(_0x3c75b7[_0x2ded('0x18')]['message']);}})[_0x2ded('0x19')](function(_0x4bdc36){logger[_0x2ded('0x16')]('Team,\x20%s,\x20%s',_0x3a2437,_0x4bdc36);_0x4e3dad(_0x4bdc36);});});} \ No newline at end of file +var _0xc4dd=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0xc4dd,0xe5));var _0xdc4d=function(_0x2e01a2,_0x8af203){_0x2e01a2=_0x2e01a2-0x0;var _0x25b636=_0xc4dd[_0x2e01a2];return _0x25b636;};'use strict';var _=require(_0xdc4d('0x0'));var util=require(_0xdc4d('0x1'));var moment=require(_0xdc4d('0x2'));var BPromise=require(_0xdc4d('0x3'));var rs=require(_0xdc4d('0x4'));var fs=require('fs');var Redis=require(_0xdc4d('0x5'));var db=require(_0xdc4d('0x6'))['db'];var utils=require(_0xdc4d('0x7'));var logger=require(_0xdc4d('0x8'))(_0xdc4d('0x9'));var config=require(_0xdc4d('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xdc4d('0xb')][_0xdc4d('0xc')]({'port':0x232a});config[_0xdc4d('0xd')]=_[_0xdc4d('0xe')](config[_0xdc4d('0xd')],{'host':_0xdc4d('0xf'),'port':0x18eb});var socket=require(_0xdc4d('0x10'))(new Redis(config[_0xdc4d('0xd')]));require(_0xdc4d('0x11'))['register'](socket);function respondWithRpcPromise(_0xcf0676,_0x44ca95,_0x55bce1){return new BPromise(function(_0x2ba8b8,_0x4e2b15){return client['request'](_0xcf0676,_0x55bce1)[_0xdc4d('0x12')](function(_0x3bb898){logger[_0xdc4d('0x13')](_0xdc4d('0x14'),_0x44ca95,_0xdc4d('0x15'));logger[_0xdc4d('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x44ca95,_0xdc4d('0x15'),JSON[_0xdc4d('0x17')](_0x3bb898));if(_0x3bb898[_0xdc4d('0x18')]){if(_0x3bb898[_0xdc4d('0x18')][_0xdc4d('0x19')]===0x1f4){logger[_0xdc4d('0x18')](_0xdc4d('0x14'),_0x44ca95,_0x3bb898['error'][_0xdc4d('0x1a')]);return _0x4e2b15(_0x3bb898['error'][_0xdc4d('0x1a')]);}logger[_0xdc4d('0x18')](_0xdc4d('0x14'),_0x44ca95,_0x3bb898['error'][_0xdc4d('0x1a')]);return _0x2ba8b8(_0x3bb898['error'][_0xdc4d('0x1a')]);}else{logger[_0xdc4d('0x13')](_0xdc4d('0x14'),_0x44ca95,_0xdc4d('0x15'));_0x2ba8b8(_0x3bb898[_0xdc4d('0x1b')][_0xdc4d('0x1a')]);}})[_0xdc4d('0x1c')](function(_0x45e9e8){logger[_0xdc4d('0x18')](_0xdc4d('0x14'),_0x44ca95,_0x45e9e8);_0x4e2b15(_0x45e9e8);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 418ebf2..52679a8 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 _0xf1cc=['update','register','length','team:','save','remove'];(function(_0x1dd1ed,_0x5d6fdc){var _0x28899a=function(_0x410d2a){while(--_0x410d2a){_0x1dd1ed['push'](_0x1dd1ed['shift']());}};_0x28899a(++_0x5d6fdc);}(_0xf1cc,0x1ae));var _0xcf1c=function(_0x2ca01d,_0x5a3459){_0x2ca01d=_0x2ca01d-0x0;var _0x4bc429=_0xf1cc[_0x2ca01d];return _0x4bc429;};'use strict';var TeamEvents=require('./team.events');var events=[_0xcf1c('0x0'),_0xcf1c('0x1'),_0xcf1c('0x2')];function createListener(_0x7a13fc,_0x3f5253){return function(_0x41edea){_0x3f5253['emit'](_0x7a13fc,_0x41edea);};}function removeListener(_0x11147f,_0x176ea5){return function(){TeamEvents['removeListener'](_0x11147f,_0x176ea5);};}exports[_0xcf1c('0x3')]=function(_0x49c86a){for(var _0x3cb7fc=0x0,_0x584ab4=events[_0xcf1c('0x4')];_0x3cb7fc<_0x584ab4;_0x3cb7fc++){var _0x3f058d=events[_0x3cb7fc];var _0x2ff2c8=createListener(_0xcf1c('0x5')+_0x3f058d,_0x49c86a);TeamEvents['on'](_0x3f058d,_0x2ff2c8);}}; \ No newline at end of file +var _0x5464=['update','register','length','./team.events','remove'];(function(_0x436ce9,_0xe641ed){var _0x3511df=function(_0x3637da){while(--_0x3637da){_0x436ce9['push'](_0x436ce9['shift']());}};_0x3511df(++_0xe641ed);}(_0x5464,0xb2));var _0x4546=function(_0x159c05,_0x364234){_0x159c05=_0x159c05-0x0;var _0xe809c2=_0x5464[_0x159c05];return _0xe809c2;};'use strict';var TeamEvents=require(_0x4546('0x0'));var events=['save',_0x4546('0x1'),_0x4546('0x2')];function createListener(_0x55a74d,_0x176760){return function(_0x3e3130){_0x176760['emit'](_0x55a74d,_0x3e3130);};}function removeListener(_0x497a18,_0x362cd6){return function(){TeamEvents['removeListener'](_0x497a18,_0x362cd6);};}exports[_0x4546('0x3')]=function(_0x2fc2be){for(var _0x30ba30=0x0,_0x59b742=events[_0x4546('0x4')];_0x30ba30<_0x59b742;_0x30ba30++){var _0x199706=events[_0x30ba30];var _0x1373eb=createListener('team:'+_0x199706,_0x2fc2be);TeamEvents['on'](_0x199706,_0x1373eb);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index a92f325..a485150 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 _0xee11=['sequelize','INTEGER'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xee11,0x146));var _0x1ee1=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xee11[_0x22f8ab];return _0x2a70e5;};'use strict';var Sequelize=require(_0x1ee1('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x1ee1('0x1')]}}; \ No newline at end of file +var _0xb7ef=['exports','INTEGER','sequelize'];(function(_0x14632b,_0x3a2fc6){var _0x4c3265=function(_0x43b5f4){while(--_0x43b5f4){_0x14632b['push'](_0x14632b['shift']());}};_0x4c3265(++_0x3a2fc6);}(_0xb7ef,0x1ac));var _0xfb7e=function(_0x14f5b1,_0x236466){_0x14f5b1=_0x14f5b1-0x0;var _0x37bdcc=_0xb7ef[_0x14f5b1];return _0x37bdcc;};'use strict';var Sequelize=require(_0xfb7e('0x0'));module[_0xfb7e('0x1')]={'TeamId':{'type':Sequelize[_0xfb7e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xfb7e('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 83516a4..240db79 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 _0x19cb=['TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','request-promise','./teamVoicePrefix.attributes','exports','define'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x19cb,0x146));var _0xb19c=function(_0x1ee934,_0x593a1c){_0x1ee934=_0x1ee934-0x0;var _0x41c31f=_0x19cb[_0x1ee934];return _0x41c31f;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var logger=require(_0xb19c('0x1'))('api');var moment=require(_0xb19c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb19c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb19c('0x4'));module[_0xb19c('0x5')]=function(_0x5a145d,_0x551f8d){return _0x5a145d[_0xb19c('0x6')](_0xb19c('0x7'),attributes,{'tableName':_0xb19c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc87=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','api','moment','bluebird','rimraf','../../config/environment'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0xbc87,0x144));var _0x7bc8=function(_0x20cd15,_0x431417){_0x20cd15=_0x20cd15-0x0;var _0x23eb73=_0xbc87[_0x20cd15];return _0x23eb73;};'use strict';var _=require(_0x7bc8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7bc8('0x1'));var moment=require(_0x7bc8('0x2'));var BPromise=require(_0x7bc8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7bc8('0x4'));var config=require(_0x7bc8('0x5'));var attributes=require(_0x7bc8('0x6'));module[_0x7bc8('0x7')]=function(_0x489d0b,_0x184610){return _0x489d0b[_0x7bc8('0x8')](_0x7bc8('0x9'),attributes,{'tableName':_0x7bc8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 9d83fc4..17601ec 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x297b50,_0x5e6566){var _0x52c630=function(_0x32667f){while(--_0x32667f){_0x297b50['push'](_0x297b50['shift']());}};_0x52c630(++_0x5e6566);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xcb91[_0x65c50e];return _0x4573e7;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 0e95b8a..31980a9 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 _0x81e1=['exports','INTEGER','sequelize'];(function(_0x58d64b,_0x8fd2fd){var _0x3b7a8a=function(_0x3a224a){while(--_0x3a224a){_0x58d64b['push'](_0x58d64b['shift']());}};_0x3b7a8a(++_0x8fd2fd);}(_0x81e1,0x1af));var _0x181e=function(_0x88913a,_0x569455){_0x88913a=_0x88913a-0x0;var _0x400793=_0x81e1[_0x88913a];return _0x400793;};'use strict';var Sequelize=require(_0x181e('0x0'));module[_0x181e('0x1')]={'penalty':{'type':Sequelize[_0x181e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x372b=['sequelize','exports'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x372b,0x18a));var _0xb372=function(_0x3912d2,_0x1d37b0){_0x3912d2=_0x3912d2-0x0;var _0x7f33fe=_0x372b[_0x3912d2];return _0x7f33fe;};'use strict';var Sequelize=require(_0xb372('0x0'));module[_0xb372('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 12cebb1..d0d98f5 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 _0xb492=['path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment'];(function(_0x5ad78b,_0x2e4192){var _0x2e7211=function(_0xfad764){while(--_0xfad764){_0x5ad78b['push'](_0x5ad78b['shift']());}};_0x2e7211(++_0x2e4192);}(_0xb492,0x172));var _0x2b49=function(_0x2331cf,_0x3d9542){_0x2331cf=_0x2331cf-0x0;var _0x10e5d8=_0xb492[_0x2331cf];return _0x10e5d8;};'use strict';var _=require('lodash');var util=require(_0x2b49('0x0'));var logger=require(_0x2b49('0x1'))(_0x2b49('0x2'));var moment=require(_0x2b49('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b49('0x4'));var rimraf=require(_0x2b49('0x5'));var config=require(_0x2b49('0x6'));var attributes=require(_0x2b49('0x7'));module['exports']=function(_0x53508a,_0x346359){return _0x53508a[_0x2b49('0x8')](_0x2b49('0x9'),attributes,{'tableName':_0x2b49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3b4=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x43ee75,_0x39a80b){var _0x2e485e=function(_0x11c6a1){while(--_0x11c6a1){_0x43ee75['push'](_0x43ee75['shift']());}};_0x2e485e(++_0x39a80b);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x101261,_0x22579d){_0x101261=_0x101261-0x0;var _0x3f1dc7=_0xd3b4[_0x101261];return _0x3f1dc7;};'use strict';var _=require(_0x4d3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4d3b('0x1'));var moment=require(_0x4d3b('0x2'));var BPromise=require(_0x4d3b('0x3'));var rp=require(_0x4d3b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d3b('0x5'));var config=require('../../config/environment');var attributes=require(_0x4d3b('0x6'));module[_0x4d3b('0x7')]=function(_0x708cac,_0x338d10){return _0x708cac[_0x4d3b('0x8')](_0x4d3b('0x9'),attributes,{'tableName':_0x4d3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1a65cf5..f7a3a12 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 _0x885e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','lodash','util','bluebird'];(function(_0x565d2a,_0x35b9de){var _0xed572c=function(_0xec4354){while(--_0xec4354){_0x565d2a['push'](_0x565d2a['shift']());}};_0xed572c(++_0x35b9de);}(_0x885e,0xe4));var _0xe885=function(_0x1d78d0,_0x2ffb39){_0x1d78d0=_0x1d78d0-0x0;var _0x1767e3=_0x885e[_0x1d78d0];return _0x1767e3;};'use strict';var _=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var moment=require('moment');var BPromise=require(_0xe885('0x2'));var rs=require(_0xe885('0x3'));var fs=require('fs');var Redis=require(_0xe885('0x4'));var db=require(_0xe885('0x5'))['db'];var utils=require(_0xe885('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe885('0x7'));var jayson=require(_0xe885('0x8'));var client=jayson[_0xe885('0x9')][_0xe885('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55d2b2,_0x37778a,_0x597bdc){return new BPromise(function(_0x2e8fe0,_0x3c5cc7){return client[_0xe885('0xb')](_0x55d2b2,_0x597bdc)[_0xe885('0xc')](function(_0x231f2f){logger[_0xe885('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x37778a,_0xe885('0xe'));logger[_0xe885('0xf')](_0xe885('0x10'),_0x37778a,_0xe885('0xe'),JSON[_0xe885('0x11')](_0x231f2f));if(_0x231f2f[_0xe885('0x12')]){if(_0x231f2f[_0xe885('0x12')]['code']===0x1f4){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);return _0x3c5cc7(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}logger[_0xe885('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x37778a,_0x231f2f['error']['message']);return _0x2e8fe0(_0x231f2f[_0xe885('0x12')][_0xe885('0x14')]);}else{logger[_0xe885('0xd')](_0xe885('0x13'),_0x37778a,'request\x20sent');_0x2e8fe0(_0x231f2f['result'][_0xe885('0x14')]);}})['catch'](function(_0x36b9e7){logger[_0xe885('0x12')](_0xe885('0x13'),_0x37778a,_0x36b9e7);_0x3c5cc7(_0x36b9e7);});});} \ No newline at end of file +var _0xff96=['TeamVoiceQueue,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x23e90a,_0x4deada){var _0x5e2a8c=function(_0xa65a34){while(--_0xa65a34){_0x23e90a['push'](_0x23e90a['shift']());}};_0x5e2a8c(++_0x4deada);}(_0xff96,0x179));var _0x6ff9=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0xff96[_0x13992d];return _0x3d15bf;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var moment=require(_0x6ff9('0x2'));var BPromise=require(_0x6ff9('0x3'));var rs=require(_0x6ff9('0x4'));var fs=require('fs');var Redis=require(_0x6ff9('0x5'));var db=require(_0x6ff9('0x6'))['db'];var utils=require(_0x6ff9('0x7'));var logger=require(_0x6ff9('0x8'))(_0x6ff9('0x9'));var config=require(_0x6ff9('0xa'));var jayson=require(_0x6ff9('0xb'));var client=jayson['client'][_0x6ff9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5509ee,_0x502cf2,_0x4f982b){return new BPromise(function(_0x5d56f4,_0x2b1b7d){return client[_0x6ff9('0xd')](_0x5509ee,_0x4f982b)[_0x6ff9('0xe')](function(_0x1ce5a3){logger[_0x6ff9('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x502cf2,_0x6ff9('0x10'));logger[_0x6ff9('0x11')](_0x6ff9('0x12'),_0x502cf2,_0x6ff9('0x10'),JSON[_0x6ff9('0x13')](_0x1ce5a3));if(_0x1ce5a3[_0x6ff9('0x14')]){if(_0x1ce5a3[_0x6ff9('0x14')][_0x6ff9('0x15')]===0x1f4){logger[_0x6ff9('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x502cf2,_0x1ce5a3['error'][_0x6ff9('0x16')]);return _0x2b1b7d(_0x1ce5a3['error'][_0x6ff9('0x16')]);}logger[_0x6ff9('0x14')](_0x6ff9('0x17'),_0x502cf2,_0x1ce5a3['error']['message']);return _0x5d56f4(_0x1ce5a3[_0x6ff9('0x14')][_0x6ff9('0x16')]);}else{logger[_0x6ff9('0xf')](_0x6ff9('0x17'),_0x502cf2,'request\x20sent');_0x5d56f4(_0x1ce5a3['result'][_0x6ff9('0x16')]);}})[_0x6ff9('0x18')](function(_0x3d4268){logger[_0x6ff9('0x14')](_0x6ff9('0x17'),_0x502cf2,_0x3d4268);_0x2b1b7d(_0x3d4268);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 7dab98c..2c896be 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 _0xb2af=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4574b1,_0x3c6297){var _0x3bcc5b=function(_0x52e114){while(--_0x52e114){_0x4574b1['push'](_0x4574b1['shift']());}};_0x3bcc5b(++_0x3c6297);}(_0xb2af,0xd2));var _0xfb2a=function(_0x20f528,_0x57738b){_0x20f528=_0x20f528-0x0;var _0x3ecef3=_0xb2af[_0x20f528];return _0x3ecef3;};'use strict';var multer=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var path=require(_0xfb2a('0x2'));var timeout=require(_0xfb2a('0x3'));var express=require('express');var router=express[_0xfb2a('0x4')]();var fs_extra=require(_0xfb2a('0x5'));var auth=require(_0xfb2a('0x6'));var interaction=require(_0xfb2a('0x7'));var config=require(_0xfb2a('0x8'));var controller=require('./template.controller');router[_0xfb2a('0x9')]('/',auth[_0xfb2a('0xa')](),controller[_0xfb2a('0xb')]);router['get'](_0xfb2a('0xc'),auth[_0xfb2a('0xa')](),controller[_0xfb2a('0xd')]);router[_0xfb2a('0xe')]('/',auth[_0xfb2a('0xa')](),controller[_0xfb2a('0xf')]);router[_0xfb2a('0x10')](_0xfb2a('0xc'),auth[_0xfb2a('0xa')](),controller[_0xfb2a('0x11')]);router[_0xfb2a('0x12')](_0xfb2a('0xc'),auth[_0xfb2a('0xa')](),controller[_0xfb2a('0x13')]);module[_0xfb2a('0x14')]=router; \ No newline at end of file +var _0x202a=['Router','../../config/environment','./template.controller','index','show','post','isAuthenticated','create','update','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x345d7a,_0x247261){var _0x154602=function(_0x29c9c0){while(--_0x29c9c0){_0x345d7a['push'](_0x345d7a['shift']());}};_0x154602(++_0x247261);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa202('0x0'));var path=require(_0xa202('0x1'));var timeout=require(_0xa202('0x2'));var express=require('express');var router=express[_0xa202('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa202('0x4'));var controller=require(_0xa202('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa202('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa202('0x7')]);router[_0xa202('0x8')]('/',auth[_0xa202('0x9')](),controller[_0xa202('0xa')]);router['put']('/:id',auth[_0xa202('0x9')](),controller[_0xa202('0xb')]);router[_0xa202('0xc')](_0xa202('0xd'),auth['isAuthenticated'](),controller[_0xa202('0xe')]);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 3e5f85e..86e27da 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 _0xf6bc=['TEXT','sequelize','exports','STRING'];(function(_0x4c91da,_0x4bbebb){var _0x172d2a=function(_0x3465b2){while(--_0x3465b2){_0x4c91da['push'](_0x4c91da['shift']());}};_0x172d2a(++_0x4bbebb);}(_0xf6bc,0x1e9));var _0xcf6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcf6b('0x0'));module[_0xcf6b('0x1')]={'name':{'type':Sequelize[_0xcf6b('0x2')]},'description':{'type':Sequelize[_0xcf6b('0x2')]},'html':{'type':Sequelize[_0xcf6b('0x3')]}}; \ No newline at end of file +var _0x16db=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16db,0x199));var _0xb16d=function(_0x2afa1e,_0x5f37fa){_0x2afa1e=_0x2afa1e-0x0;var _0x4b3ab7=_0x16db[_0x2afa1e];return _0x4b3ab7;};'use strict';var Sequelize=require(_0xb16d('0x0'));module[_0xb16d('0x1')]={'name':{'type':Sequelize[_0xb16d('0x2')]},'description':{'type':Sequelize[_0xb16d('0x2')]},'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 78cda0f..2eb5614 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 _0x375d=['where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','sendStatus','stack','name','map','Template','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1ceb64,_0x2fc035){var _0x1ad615=function(_0x54458d){while(--_0x54458d){_0x1ceb64['push'](_0x1ceb64['shift']());}};_0x1ad615(++_0x2fc035);}(_0x375d,0x1ad));var _0xd375=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x375d[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xd375('0x0'));var rimraf=require(_0xd375('0x1'));var zipdir=require(_0xd375('0x2'));var jsonpatch=require(_0xd375('0x3'));var rp=require(_0xd375('0x4'));var moment=require(_0xd375('0x5'));var BPromise=require(_0xd375('0x6'));var Mustache=require(_0xd375('0x7'));var util=require('util');var path=require(_0xd375('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd375('0x9'));var fs=require('fs');var fs_extra=require(_0xd375('0xa'));var _=require('lodash');var squel=require(_0xd375('0xb'));var crypto=require(_0xd375('0xc'));var jsforce=require(_0xd375('0xd'));var deskjs=require(_0xd375('0xe'));var toCsv=require(_0xd375('0xf'));var querystring=require('querystring');var Papa=require(_0xd375('0x10'));var Redis=require(_0xd375('0x11'));var authService=require(_0xd375('0x12'));var qs=require(_0xd375('0x13'));var as=require(_0xd375('0x14'));var hardwareService=require(_0xd375('0x15'));var logger=require(_0xd375('0x16'))(_0xd375('0x17'));var utils=require('../../config/utils');var config=require(_0xd375('0x18'));var licenseUtil=require(_0xd375('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x151f35,_0x5198db){_0x5198db=_0x5198db||0xcc;return function(_0x2f492e){if(_0x2f492e){return _0x151f35['sendStatus'](_0x5198db);}return _0x151f35[_0xd375('0x1a')](_0x5198db)[_0xd375('0x1b')]();};}function respondWithResult(_0x3e0e63,_0x566033){_0x566033=_0x566033||0xc8;return function(_0x1e81b9){if(_0x1e81b9){return _0x3e0e63['status'](_0x566033)[_0xd375('0x1c')](_0x1e81b9);}};}function respondWithFilteredResult(_0x110f6b,_0x5cf8a3){return function(_0x218c66){if(_0x218c66){var _0x580e70=typeof _0x5cf8a3['offset']===_0xd375('0x1d')&&typeof _0x5cf8a3[_0xd375('0x1e')]===_0xd375('0x1d');var _0x308933=_0x218c66[_0xd375('0x1f')];var _0x20a861=_0x580e70?0x0:_0x5cf8a3[_0xd375('0x20')];var _0x241728=_0x580e70?_0x218c66[_0xd375('0x1f')]:_0x5cf8a3[_0xd375('0x20')]+_0x5cf8a3[_0xd375('0x1e')];var _0x3b1379;if(_0x241728>=_0x308933){_0x241728=_0x308933;_0x3b1379=0xc8;}else{_0x3b1379=0xce;}_0x110f6b[_0xd375('0x1a')](_0x3b1379);return _0x110f6b[_0xd375('0x21')](_0xd375('0x22'),_0x20a861+'-'+_0x241728+'/'+_0x308933)['json'](_0x218c66);}return null;};}function patchUpdates(_0x216a92){return function(_0x599d98){try{jsonpatch[_0xd375('0x23')](_0x599d98,_0x216a92,!![]);}catch(_0x4badc0){return BPromise[_0xd375('0x24')](_0x4badc0);}return _0x599d98[_0xd375('0x25')]();};}function saveUpdates(_0x4f6f07,_0x432900){return function(_0x976b9e){if(_0x976b9e){return _0x976b9e[_0xd375('0x26')](_0x4f6f07)[_0xd375('0x27')](function(_0x1202c7){return _0x1202c7;});}return null;};}function removeEntity(_0x52f799,_0x3b6a13){return function(_0x2e9c7f){if(_0x2e9c7f){return _0x2e9c7f[_0xd375('0x28')]()['then'](function(){var _0xd2838a=_0x2e9c7f[_0xd375('0x29')]({'plain':!![]});var _0x39da7c=_0xd375('0x2a');return db[_0xd375('0x2b')][_0xd375('0x28')]({'where':{'type':_0x39da7c,'resourceId':_0xd2838a['id']}})[_0xd375('0x27')](function(){return _0x2e9c7f;});})[_0xd375('0x27')](function(){_0x52f799['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a431f,_0x2f96da){return function(_0x5839db){if(!_0x5839db){_0x5a431f[_0xd375('0x2c')](0x194);}return _0x5839db;};}function handleError(_0x2e26aa,_0x4af098){_0x4af098=_0x4af098||0x1f4;return function(_0x36fb3b){logger['error'](_0x36fb3b[_0xd375('0x2d')]);if(_0x36fb3b[_0xd375('0x2e')]){delete _0x36fb3b[_0xd375('0x2e')];}_0x2e26aa[_0xd375('0x1a')](_0x4af098)['send'](_0x36fb3b);};}exports['index']=function(_0x519a06,_0x138f80){var _0x52eaca={},_0x804301={},_0x404f2e={'count':0x0,'rows':[]};var _0x82d3bd=_[_0xd375('0x2f')](db[_0xd375('0x30')]['rawAttributes'],function(_0x16d3f1){return{'name':_0x16d3f1[_0xd375('0x31')],'type':_0x16d3f1[_0xd375('0x32')]['key']};});_0x804301[_0xd375('0x33')]=_[_0xd375('0x2f')](_0x82d3bd,_0xd375('0x2e'));_0x804301[_0xd375('0x34')]=_[_0xd375('0x35')](_0x519a06['query']);_0x804301[_0xd375('0x36')]=_[_0xd375('0x37')](_0x804301['model'],_0x804301[_0xd375('0x34')]);_0x52eaca[_0xd375('0x38')]=_['intersection'](_0x804301['model'],qs[_0xd375('0x39')](_0x519a06[_0xd375('0x34')]['fields']));_0x52eaca[_0xd375('0x38')]=_0x52eaca['attributes'][_0xd375('0x3a')]?_0x52eaca[_0xd375('0x38')]:_0x804301[_0xd375('0x33')];if(!_0x519a06['query'][_0xd375('0x3b')](_0xd375('0x3c'))){_0x52eaca[_0xd375('0x1e')]=qs['limit'](_0x519a06[_0xd375('0x34')][_0xd375('0x1e')]);_0x52eaca[_0xd375('0x20')]=qs[_0xd375('0x20')](_0x519a06[_0xd375('0x34')][_0xd375('0x20')]);}_0x52eaca[_0xd375('0x3d')]=qs['sort'](_0x519a06[_0xd375('0x34')][_0xd375('0x3e')]);_0x52eaca[_0xd375('0x3f')]=qs[_0xd375('0x36')](_['pick'](_0x519a06[_0xd375('0x34')],_0x804301[_0xd375('0x36')]),_0x82d3bd);if(_0x519a06[_0xd375('0x34')][_0xd375('0x40')]){_0x52eaca['where']=_[_0xd375('0x41')](_0x52eaca[_0xd375('0x3f')],{'$or':_[_0xd375('0x2f')](_0x82d3bd,function(_0x170fcd){if(_0x170fcd['type']!=='VIRTUAL'){var _0x20272e={};_0x20272e[_0x170fcd['name']]={'$like':'%'+_0x519a06[_0xd375('0x34')][_0xd375('0x40')]+'%'};return _0x20272e;}})});}_0x52eaca=_[_0xd375('0x41')]({},_0x52eaca,_0x519a06[_0xd375('0x42')]);var _0x2db9a6={'where':_0x52eaca[_0xd375('0x3f')]};return db[_0xd375('0x30')][_0xd375('0x1f')](_0x2db9a6)['then'](function(_0x3de87f){_0x404f2e[_0xd375('0x1f')]=_0x3de87f;if(_0x519a06[_0xd375('0x34')][_0xd375('0x43')]){_0x52eaca[_0xd375('0x44')]=[{'all':!![]}];}return db[_0xd375('0x30')][_0xd375('0x45')](_0x52eaca);})[_0xd375('0x27')](function(_0x348e6e){_0x404f2e[_0xd375('0x46')]=_0x348e6e;return _0x404f2e;})[_0xd375('0x27')](respondWithFilteredResult(_0x138f80,_0x52eaca))[_0xd375('0x47')](handleError(_0x138f80,null));};exports[_0xd375('0x48')]=function(_0x2e9e3d,_0x3bac89){var _0x5817a3={'raw':!![],'where':{'id':_0x2e9e3d[_0xd375('0x49')]['id']}},_0x428b4a={};_0x428b4a['model']=_[_0xd375('0x35')](db[_0xd375('0x30')][_0xd375('0x4a')]);_0x428b4a[_0xd375('0x34')]=_[_0xd375('0x35')](_0x2e9e3d[_0xd375('0x34')]);_0x428b4a[_0xd375('0x36')]=_['intersection'](_0x428b4a[_0xd375('0x33')],_0x428b4a['query']);_0x5817a3[_0xd375('0x38')]=_[_0xd375('0x37')](_0x428b4a[_0xd375('0x33')],qs[_0xd375('0x39')](_0x2e9e3d[_0xd375('0x34')]['fields']));_0x5817a3[_0xd375('0x38')]=_0x5817a3['attributes']['length']?_0x5817a3[_0xd375('0x38')]:_0x428b4a[_0xd375('0x33')];if(_0x2e9e3d[_0xd375('0x34')][_0xd375('0x43')]){_0x5817a3['include']=[{'all':!![]}];}_0x5817a3=_[_0xd375('0x41')]({},_0x5817a3,_0x2e9e3d[_0xd375('0x42')]);return db[_0xd375('0x30')][_0xd375('0x4b')](_0x5817a3)[_0xd375('0x27')](handleEntityNotFound(_0x3bac89,null))[_0xd375('0x27')](respondWithResult(_0x3bac89,null))['catch'](handleError(_0x3bac89,null));};exports['create']=function(_0x2f31a2,_0x3dea41){return db['Template'][_0xd375('0x4c')](_0x2f31a2[_0xd375('0x4d')],{})[_0xd375('0x27')](function(_0x58f04e){var _0x23a0fd=_0x2f31a2[_0xd375('0x4e')][_0xd375('0x29')]({'plain':!![]});if(!_0x23a0fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23a0fd[_0xd375('0x4f')]==='user'){var _0x2d321d=_0x58f04e[_0xd375('0x29')]({'plain':!![]});var _0x2a9622=_0xd375('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x2a9622,'userProfileId':_0x23a0fd[_0xd375('0x50')]},'raw':!![]})[_0xd375('0x27')](function(_0x1d2245){if(_0x1d2245&&_0x1d2245[_0xd375('0x51')]===0x0){return db[_0xd375('0x2b')][_0xd375('0x4c')]({'name':_0x2d321d['name'],'resourceId':_0x2d321d['id'],'type':_0x1d2245[_0xd375('0x2e')],'sectionId':_0x1d2245['id']},{})[_0xd375('0x27')](function(){return _0x58f04e;});}else{return _0x58f04e;}})[_0xd375('0x47')](function(_0x4e8378){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e8378);throw _0x4e8378;});}return _0x58f04e;})['then'](respondWithResult(_0x3dea41,0xc9))[_0xd375('0x47')](handleError(_0x3dea41,null));};exports[_0xd375('0x26')]=function(_0x58ada2,_0x7b8856){if(_0x58ada2[_0xd375('0x4d')]['id']){delete _0x58ada2[_0xd375('0x4d')]['id'];}return db[_0xd375('0x30')][_0xd375('0x4b')]({'where':{'id':_0x58ada2['params']['id']}})[_0xd375('0x27')](handleEntityNotFound(_0x7b8856,null))[_0xd375('0x27')](saveUpdates(_0x58ada2[_0xd375('0x4d')],null))['then'](respondWithResult(_0x7b8856,null))[_0xd375('0x47')](handleError(_0x7b8856,null));};exports[_0xd375('0x28')]=function(_0x2beaff,_0x2cec36){return db[_0xd375('0x30')][_0xd375('0x4b')]({'where':{'id':_0x2beaff['params']['id']}})[_0xd375('0x27')](handleEntityNotFound(_0x2cec36,null))[_0xd375('0x27')](removeEntity(_0x2cec36,null))['catch'](handleError(_0x2cec36,null));}; \ No newline at end of file +var _0x9976=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Templates','UserProfileResource','error','name','send','index','Template','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','rimraf','zip-dir','bluebird','util','sox','to-csv','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x48c19a,_0x42f476){var _0x56635c=function(_0x30a322){while(--_0x30a322){_0x48c19a['push'](_0x48c19a['shift']());}};_0x56635c(++_0x42f476);}(_0x9976,0x85));var _0x6997=function(_0x58e531,_0x424a60){_0x58e531=_0x58e531-0x0;var _0x5bc2c4=_0x9976[_0x58e531];return _0x5bc2c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6997('0x0'));var zipdir=require(_0x6997('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6997('0x2'));var Mustache=require('mustache');var util=require(_0x6997('0x3'));var path=require('path');var sox=require(_0x6997('0x4'));var csv=require(_0x6997('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6997('0x6'));var jsforce=require(_0x6997('0x7'));var deskjs=require(_0x6997('0x8'));var toCsv=require(_0x6997('0x5'));var querystring=require('querystring');var Papa=require(_0x6997('0x9'));var Redis=require(_0x6997('0xa'));var authService=require(_0x6997('0xb'));var qs=require(_0x6997('0xc'));var as=require(_0x6997('0xd'));var hardwareService=require(_0x6997('0xe'));var logger=require(_0x6997('0xf'))(_0x6997('0x10'));var utils=require(_0x6997('0x11'));var config=require(_0x6997('0x12'));var licenseUtil=require(_0x6997('0x13'));var db=require(_0x6997('0x14'))['db'];function respondWithStatusCode(_0x5bf20c,_0x46fbf4){_0x46fbf4=_0x46fbf4||0xcc;return function(_0x25873b){if(_0x25873b){return _0x5bf20c[_0x6997('0x15')](_0x46fbf4);}return _0x5bf20c[_0x6997('0x16')](_0x46fbf4)[_0x6997('0x17')]();};}function respondWithResult(_0x254858,_0x5cee8d){_0x5cee8d=_0x5cee8d||0xc8;return function(_0x443bf3){if(_0x443bf3){return _0x254858['status'](_0x5cee8d)[_0x6997('0x18')](_0x443bf3);}};}function respondWithFilteredResult(_0x5ed555,_0x2b3bb7){return function(_0x3a68f2){if(_0x3a68f2){var _0x137a1a=typeof _0x2b3bb7[_0x6997('0x19')]===_0x6997('0x1a')&&typeof _0x2b3bb7[_0x6997('0x1b')]===_0x6997('0x1a');var _0x7e4224=_0x3a68f2[_0x6997('0x1c')];var _0x166f29=_0x137a1a?0x0:_0x2b3bb7[_0x6997('0x19')];var _0x14af96=_0x137a1a?_0x3a68f2['count']:_0x2b3bb7['offset']+_0x2b3bb7['limit'];var _0x48e72d;if(_0x14af96>=_0x7e4224){_0x14af96=_0x7e4224;_0x48e72d=0xc8;}else{_0x48e72d=0xce;}_0x5ed555[_0x6997('0x16')](_0x48e72d);return _0x5ed555[_0x6997('0x1d')](_0x6997('0x1e'),_0x166f29+'-'+_0x14af96+'/'+_0x7e4224)['json'](_0x3a68f2);}return null;};}function patchUpdates(_0xc058ea){return function(_0x4898c9){try{jsonpatch[_0x6997('0x1f')](_0x4898c9,_0xc058ea,!![]);}catch(_0x12fbb1){return BPromise[_0x6997('0x20')](_0x12fbb1);}return _0x4898c9[_0x6997('0x21')]();};}function saveUpdates(_0x17722d,_0x2f84af){return function(_0x154ade){if(_0x154ade){return _0x154ade[_0x6997('0x22')](_0x17722d)[_0x6997('0x23')](function(_0x4d0fd3){return _0x4d0fd3;});}return null;};}function removeEntity(_0x41c6c7,_0x332302){return function(_0x279606){if(_0x279606){return _0x279606[_0x6997('0x24')]()[_0x6997('0x23')](function(){var _0x4630d0=_0x279606['get']({'plain':!![]});var _0xf950bd=_0x6997('0x25');return db[_0x6997('0x26')][_0x6997('0x24')]({'where':{'type':_0xf950bd,'resourceId':_0x4630d0['id']}})[_0x6997('0x23')](function(){return _0x279606;});})['then'](function(){_0x41c6c7[_0x6997('0x16')](0xcc)[_0x6997('0x17')]();});}};}function handleEntityNotFound(_0x216ee9,_0x191ce3){return function(_0x5767c0){if(!_0x5767c0){_0x216ee9[_0x6997('0x15')](0x194);}return _0x5767c0;};}function handleError(_0x42eba5,_0x426c67){_0x426c67=_0x426c67||0x1f4;return function(_0x2172c8){logger[_0x6997('0x27')](_0x2172c8['stack']);if(_0x2172c8[_0x6997('0x28')]){delete _0x2172c8[_0x6997('0x28')];}_0x42eba5[_0x6997('0x16')](_0x426c67)[_0x6997('0x29')](_0x2172c8);};}exports[_0x6997('0x2a')]=function(_0x1fcac7,_0x499173){var _0x5a9df1={},_0x3e335a={},_0x364f05={'count':0x0,'rows':[]};var _0x4cf437=_['map'](db[_0x6997('0x2b')][_0x6997('0x2c')],function(_0x411de6){return{'name':_0x411de6['fieldName'],'type':_0x411de6[_0x6997('0x2d')][_0x6997('0x2e')]};});_0x3e335a[_0x6997('0x2f')]=_[_0x6997('0x30')](_0x4cf437,_0x6997('0x28'));_0x3e335a[_0x6997('0x31')]=_[_0x6997('0x32')](_0x1fcac7[_0x6997('0x31')]);_0x3e335a[_0x6997('0x33')]=_[_0x6997('0x34')](_0x3e335a[_0x6997('0x2f')],_0x3e335a[_0x6997('0x31')]);_0x5a9df1[_0x6997('0x35')]=_[_0x6997('0x34')](_0x3e335a[_0x6997('0x2f')],qs[_0x6997('0x36')](_0x1fcac7[_0x6997('0x31')][_0x6997('0x36')]));_0x5a9df1[_0x6997('0x35')]=_0x5a9df1[_0x6997('0x35')][_0x6997('0x37')]?_0x5a9df1[_0x6997('0x35')]:_0x3e335a[_0x6997('0x2f')];if(!_0x1fcac7[_0x6997('0x31')][_0x6997('0x38')](_0x6997('0x39'))){_0x5a9df1[_0x6997('0x1b')]=qs[_0x6997('0x1b')](_0x1fcac7[_0x6997('0x31')][_0x6997('0x1b')]);_0x5a9df1[_0x6997('0x19')]=qs[_0x6997('0x19')](_0x1fcac7[_0x6997('0x31')][_0x6997('0x19')]);}_0x5a9df1[_0x6997('0x3a')]=qs[_0x6997('0x3b')](_0x1fcac7[_0x6997('0x31')][_0x6997('0x3b')]);_0x5a9df1[_0x6997('0x3c')]=qs[_0x6997('0x33')](_[_0x6997('0x3d')](_0x1fcac7[_0x6997('0x31')],_0x3e335a[_0x6997('0x33')]),_0x4cf437);if(_0x1fcac7[_0x6997('0x31')][_0x6997('0x3e')]){_0x5a9df1[_0x6997('0x3c')]=_[_0x6997('0x3f')](_0x5a9df1[_0x6997('0x3c')],{'$or':_['map'](_0x4cf437,function(_0x5abf28){if(_0x5abf28[_0x6997('0x2d')]!=='VIRTUAL'){var _0x2e63b6={};_0x2e63b6[_0x5abf28[_0x6997('0x28')]]={'$like':'%'+_0x1fcac7['query'][_0x6997('0x3e')]+'%'};return _0x2e63b6;}})});}_0x5a9df1=_['merge']({},_0x5a9df1,_0x1fcac7[_0x6997('0x40')]);var _0x1b9416={'where':_0x5a9df1[_0x6997('0x3c')]};return db[_0x6997('0x2b')]['count'](_0x1b9416)[_0x6997('0x23')](function(_0x37a2cd){_0x364f05[_0x6997('0x1c')]=_0x37a2cd;if(_0x1fcac7[_0x6997('0x31')]['includeAll']){_0x5a9df1[_0x6997('0x41')]=[{'all':!![]}];}return db['Template']['findAll'](_0x5a9df1);})[_0x6997('0x23')](function(_0x407d67){_0x364f05[_0x6997('0x42')]=_0x407d67;return _0x364f05;})['then'](respondWithFilteredResult(_0x499173,_0x5a9df1))[_0x6997('0x43')](handleError(_0x499173,null));};exports['show']=function(_0x5064f3,_0x209ae0){var _0x18fe15={'raw':!![],'where':{'id':_0x5064f3[_0x6997('0x44')]['id']}},_0x68459b={};_0x68459b[_0x6997('0x2f')]=_[_0x6997('0x32')](db[_0x6997('0x2b')]['rawAttributes']);_0x68459b['query']=_[_0x6997('0x32')](_0x5064f3[_0x6997('0x31')]);_0x68459b['filters']=_[_0x6997('0x34')](_0x68459b[_0x6997('0x2f')],_0x68459b[_0x6997('0x31')]);_0x18fe15[_0x6997('0x35')]=_[_0x6997('0x34')](_0x68459b[_0x6997('0x2f')],qs[_0x6997('0x36')](_0x5064f3[_0x6997('0x31')][_0x6997('0x36')]));_0x18fe15[_0x6997('0x35')]=_0x18fe15[_0x6997('0x35')][_0x6997('0x37')]?_0x18fe15['attributes']:_0x68459b[_0x6997('0x2f')];if(_0x5064f3[_0x6997('0x31')][_0x6997('0x45')]){_0x18fe15[_0x6997('0x41')]=[{'all':!![]}];}_0x18fe15=_['merge']({},_0x18fe15,_0x5064f3['options']);return db[_0x6997('0x2b')][_0x6997('0x46')](_0x18fe15)[_0x6997('0x23')](handleEntityNotFound(_0x209ae0,null))[_0x6997('0x23')](respondWithResult(_0x209ae0,null))[_0x6997('0x43')](handleError(_0x209ae0,null));};exports[_0x6997('0x47')]=function(_0x44bcab,_0x359b7f){return db[_0x6997('0x2b')]['create'](_0x44bcab[_0x6997('0x48')],{})[_0x6997('0x23')](function(_0x1a9560){var _0x2bffdf=_0x44bcab[_0x6997('0x49')]['get']({'plain':!![]});if(!_0x2bffdf)throw new Error(_0x6997('0x4a'));if(_0x2bffdf[_0x6997('0x4b')]===_0x6997('0x49')){var _0x504459=_0x1a9560[_0x6997('0x4c')]({'plain':!![]});var _0x4fd061=_0x6997('0x25');return db[_0x6997('0x4d')][_0x6997('0x46')]({'where':{'name':_0x4fd061,'userProfileId':_0x2bffdf['userProfileId']},'raw':!![]})['then'](function(_0x3792c7){if(_0x3792c7&&_0x3792c7[_0x6997('0x4e')]===0x0){return db['UserProfileResource'][_0x6997('0x47')]({'name':_0x504459[_0x6997('0x28')],'resourceId':_0x504459['id'],'type':_0x3792c7[_0x6997('0x28')],'sectionId':_0x3792c7['id']},{})[_0x6997('0x23')](function(){return _0x1a9560;});}else{return _0x1a9560;}})[_0x6997('0x43')](function(_0x54eff0){logger[_0x6997('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54eff0);throw _0x54eff0;});}return _0x1a9560;})[_0x6997('0x23')](respondWithResult(_0x359b7f,0xc9))[_0x6997('0x43')](handleError(_0x359b7f,null));};exports[_0x6997('0x22')]=function(_0x37873a,_0x467ae1){if(_0x37873a[_0x6997('0x48')]['id']){delete _0x37873a['body']['id'];}return db[_0x6997('0x2b')][_0x6997('0x46')]({'where':{'id':_0x37873a[_0x6997('0x44')]['id']}})[_0x6997('0x23')](handleEntityNotFound(_0x467ae1,null))[_0x6997('0x23')](saveUpdates(_0x37873a[_0x6997('0x48')],null))[_0x6997('0x23')](respondWithResult(_0x467ae1,null))[_0x6997('0x43')](handleError(_0x467ae1,null));};exports[_0x6997('0x24')]=function(_0x20768f,_0x551d09){return db[_0x6997('0x2b')][_0x6997('0x46')]({'where':{'id':_0x20768f['params']['id']}})[_0x6997('0x23')](handleEntityNotFound(_0x551d09,null))['then'](removeEntity(_0x551d09,null))[_0x6997('0x43')](handleError(_0x551d09,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1033a9c..d6fdad4 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 _0x8977=['moment','bluebird','path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','util'];(function(_0x4fb479,_0x148044){var _0x2685ee=function(_0x5150e9){while(--_0x5150e9){_0x4fb479['push'](_0x4fb479['shift']());}};_0x2685ee(++_0x148044);}(_0x8977,0x121));var _0x7897=function(_0x53e16a,_0x2394f7){_0x53e16a=_0x53e16a-0x0;var _0x3f0e41=_0x8977[_0x53e16a];return _0x3f0e41;};'use strict';var _=require('lodash');var util=require(_0x7897('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7897('0x1'));var BPromise=require(_0x7897('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7897('0x3'));var rimraf=require(_0x7897('0x4'));var config=require(_0x7897('0x5'));var attributes=require(_0x7897('0x6'));module['exports']=function(_0x52a092,_0x37878b){return _0x52a092[_0x7897('0x7')](_0x7897('0x8'),attributes,{'tableName':_0x7897('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd22c=['../../config/logger','api','path','../../config/environment','./template.attributes','exports','define','tools_templates','util'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0xd22c,0x14c));var _0xcd22=function(_0x58af8b,_0x1071c6){_0x58af8b=_0x58af8b-0x0;var _0xc74d26=_0xd22c[_0x58af8b];return _0xc74d26;};'use strict';var _=require('lodash');var util=require(_0xcd22('0x0'));var logger=require(_0xcd22('0x1'))(_0xcd22('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd22('0x3'));var rimraf=require('rimraf');var config=require(_0xcd22('0x4'));var attributes=require(_0xcd22('0x5'));module[_0xcd22('0x6')]=function(_0xff8b4b,_0x272488){return _0xff8b4b[_0xcd22('0x7')]('Template',attributes,{'tableName':_0xcd22('0x8'),'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 c4512eb..51fb15a 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 _0xb789=['attributes','limit','include','map','model','GetTemplate','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','Template','findAll','options','where'];(function(_0xbcd09d,_0x4318d7){var _0x448407=function(_0x5329a9){while(--_0x5329a9){_0xbcd09d['push'](_0xbcd09d['shift']());}};_0x448407(++_0x4318d7);}(_0xb789,0xc7));var _0x9b78=function(_0x3e20e3,_0x3e82c9){_0x3e20e3=_0x3e20e3-0x0;var _0x57affe=_0xb789[_0x3e20e3];return _0x57affe;};'use strict';var _=require('lodash');var util=require(_0x9b78('0x0'));var moment=require(_0x9b78('0x1'));var BPromise=require(_0x9b78('0x2'));var rs=require(_0x9b78('0x3'));var fs=require('fs');var Redis=require(_0x9b78('0x4'));var db=require(_0x9b78('0x5'))['db'];var utils=require(_0x9b78('0x6'));var logger=require(_0x9b78('0x7'))(_0x9b78('0x8'));var config=require(_0x9b78('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fa129,_0x21bceb,_0x54866f){return new BPromise(function(_0x3d4d8a,_0x58771c){return client[_0x9b78('0xb')](_0x1fa129,_0x54866f)['then'](function(_0x1f52fe){logger[_0x9b78('0xc')](_0x9b78('0xd'),_0x21bceb,'request\x20sent');logger['debug'](_0x9b78('0xe'),_0x21bceb,_0x9b78('0xf'),JSON['stringify'](_0x1f52fe));if(_0x1f52fe['error']){if(_0x1f52fe[_0x9b78('0x10')][_0x9b78('0x11')]===0x1f4){logger['error'](_0x9b78('0xd'),_0x21bceb,_0x1f52fe[_0x9b78('0x10')][_0x9b78('0x12')]);return _0x58771c(_0x1f52fe['error'][_0x9b78('0x12')]);}logger[_0x9b78('0x10')]('Template,\x20%s,\x20%s',_0x21bceb,_0x1f52fe[_0x9b78('0x10')][_0x9b78('0x12')]);return _0x3d4d8a(_0x1f52fe[_0x9b78('0x10')]['message']);}else{logger[_0x9b78('0xc')](_0x9b78('0xd'),_0x21bceb,'request\x20sent');_0x3d4d8a(_0x1f52fe[_0x9b78('0x13')][_0x9b78('0x12')]);}})[_0x9b78('0x14')](function(_0x2cabd8){logger['error'](_0x9b78('0xd'),_0x21bceb,_0x2cabd8);_0x58771c(_0x2cabd8);});});}exports['GetTemplate']=function(_0x3e5676){var _0x8dfd00=this;return new Promise(function(_0x163af8,_0xe801d){return db[_0x9b78('0x15')][_0x9b78('0x16')]({'raw':_0x3e5676[_0x9b78('0x17')]?_0x3e5676[_0x9b78('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3e5676[_0x9b78('0x17')]?_0x3e5676[_0x9b78('0x17')][_0x9b78('0x18')]||null:null,'attributes':_0x3e5676[_0x9b78('0x17')]?_0x3e5676[_0x9b78('0x17')][_0x9b78('0x19')]||null:null,'limit':_0x3e5676[_0x9b78('0x17')]?_0x3e5676[_0x9b78('0x17')][_0x9b78('0x1a')]||null:null,'include':_0x3e5676[_0x9b78('0x17')]?_0x3e5676[_0x9b78('0x17')][_0x9b78('0x1b')]?_[_0x9b78('0x1c')](_0x3e5676['options'][_0x9b78('0x1b')],function(_0x5e134a){return{'model':db[_0x5e134a[_0x9b78('0x1d')]],'as':_0x5e134a['as'],'attributes':_0x5e134a[_0x9b78('0x19')],'include':_0x5e134a['include']?_[_0x9b78('0x1c')](_0x5e134a[_0x9b78('0x1b')],function(_0x50b6e8){return{'model':db[_0x50b6e8[_0x9b78('0x1d')]],'as':_0x50b6e8['as'],'attributes':_0x50b6e8[_0x9b78('0x19')],'include':_0x50b6e8[_0x9b78('0x1b')]?_['map'](_0x50b6e8[_0x9b78('0x1b')],function(_0x341696){return{'model':db[_0x341696[_0x9b78('0x1d')]],'as':_0x341696['as'],'attributes':_0x341696['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5380d2){logger[_0x9b78('0xc')](_0x9b78('0x1e'),_0x3e5676);logger['debug'](_0x9b78('0x1e'),_0x3e5676,JSON[_0x9b78('0x1f')](_0x5380d2));_0x163af8(_0x5380d2);})[_0x9b78('0x14')](function(_0x149f7e){logger[_0x9b78('0x10')](_0x9b78('0x1e'),_0x149f7e[_0x9b78('0x12')],_0x3e5676);_0xe801d(_0x8dfd00[_0x9b78('0x10')](0x1f4,_0x149f7e[_0x9b78('0x12')]));});});}; \ No newline at end of file +var _0xbbce=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','code','error','Template,\x20%s,\x20%s','message','result','Template','findAll','options','where','attributes','include','map','model','GetTemplate','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x2634a7,_0x118508){var _0xa52e2c=function(_0x400f75){while(--_0x400f75){_0x2634a7['push'](_0x2634a7['shift']());}};_0xa52e2c(++_0x118508);}(_0xbbce,0xb0));var _0xebbc=function(_0x2640ca,_0x10cbe4){_0x2640ca=_0x2640ca-0x0;var _0x3b3493=_0xbbce[_0x2640ca];return _0x3b3493;};'use strict';var _=require(_0xebbc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xebbc('0x1'));var rs=require(_0xebbc('0x2'));var fs=require('fs');var Redis=require(_0xebbc('0x3'));var db=require(_0xebbc('0x4'))['db'];var utils=require(_0xebbc('0x5'));var logger=require(_0xebbc('0x6'))('rpc');var config=require(_0xebbc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xebbc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd6161c,_0x512811,_0x39a2fe){return new BPromise(function(_0x2c5e72,_0x4bc47b){return client[_0xebbc('0x9')](_0xd6161c,_0x39a2fe)[_0xebbc('0xa')](function(_0x6a9ee9){logger[_0xebbc('0xb')]('Template,\x20%s,\x20%s',_0x512811,_0xebbc('0xc'));logger[_0xebbc('0xd')]('Template,\x20%s,\x20%s,\x20%s',_0x512811,_0xebbc('0xc'),JSON[_0xebbc('0xe')](_0x6a9ee9));if(_0x6a9ee9['error']){if(_0x6a9ee9['error'][_0xebbc('0xf')]===0x1f4){logger[_0xebbc('0x10')](_0xebbc('0x11'),_0x512811,_0x6a9ee9[_0xebbc('0x10')][_0xebbc('0x12')]);return _0x4bc47b(_0x6a9ee9['error'][_0xebbc('0x12')]);}logger['error'](_0xebbc('0x11'),_0x512811,_0x6a9ee9[_0xebbc('0x10')][_0xebbc('0x12')]);return _0x2c5e72(_0x6a9ee9[_0xebbc('0x10')][_0xebbc('0x12')]);}else{logger['info'](_0xebbc('0x11'),_0x512811,'request\x20sent');_0x2c5e72(_0x6a9ee9[_0xebbc('0x13')][_0xebbc('0x12')]);}})['catch'](function(_0x2bee21){logger['error'](_0xebbc('0x11'),_0x512811,_0x2bee21);_0x4bc47b(_0x2bee21);});});}exports['GetTemplate']=function(_0x3e02ee){var _0x1f8092=this;return new Promise(function(_0x2d48e6,_0x4abae5){return db[_0xebbc('0x14')][_0xebbc('0x15')]({'raw':_0x3e02ee[_0xebbc('0x16')]?_0x3e02ee[_0xebbc('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3e02ee[_0xebbc('0x16')]?_0x3e02ee[_0xebbc('0x16')][_0xebbc('0x17')]||null:null,'attributes':_0x3e02ee[_0xebbc('0x16')]?_0x3e02ee[_0xebbc('0x16')][_0xebbc('0x18')]||null:null,'limit':_0x3e02ee['options']?_0x3e02ee[_0xebbc('0x16')]['limit']||null:null,'include':_0x3e02ee[_0xebbc('0x16')]?_0x3e02ee[_0xebbc('0x16')][_0xebbc('0x19')]?_[_0xebbc('0x1a')](_0x3e02ee[_0xebbc('0x16')]['include'],function(_0x5e06db){return{'model':db[_0x5e06db[_0xebbc('0x1b')]],'as':_0x5e06db['as'],'attributes':_0x5e06db['attributes'],'include':_0x5e06db[_0xebbc('0x19')]?_[_0xebbc('0x1a')](_0x5e06db[_0xebbc('0x19')],function(_0x33c3e2){return{'model':db[_0x33c3e2[_0xebbc('0x1b')]],'as':_0x33c3e2['as'],'attributes':_0x33c3e2[_0xebbc('0x18')],'include':_0x33c3e2[_0xebbc('0x19')]?_[_0xebbc('0x1a')](_0x33c3e2[_0xebbc('0x19')],function(_0x5bdbc5){return{'model':db[_0x5bdbc5[_0xebbc('0x1b')]],'as':_0x5bdbc5['as'],'attributes':_0x5bdbc5[_0xebbc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xebbc('0xa')](function(_0x17464d){logger['info']('GetTemplate',_0x3e02ee);logger['debug'](_0xebbc('0x1c'),_0x3e02ee,JSON[_0xebbc('0xe')](_0x17464d));_0x2d48e6(_0x17464d);})[_0xebbc('0x1d')](function(_0x4bdd30){logger[_0xebbc('0x10')](_0xebbc('0x1c'),_0x4bdd30[_0xebbc('0x12')],_0x3e02ee);_0x4abae5(_0x1f8092[_0xebbc('0x10')](0x1f4,_0x4bdd30['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index c16585a..0372a38 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 _0x0a01=['fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0a01,0x156));var _0x10a0=function(_0xf3c10d,_0x524a9c){_0xf3c10d=_0xf3c10d-0x0;var _0x361e7e=_0x0a01[_0xf3c10d];return _0x361e7e;};'use strict';var multer=require(_0x10a0('0x0'));var util=require(_0x10a0('0x1'));var path=require(_0x10a0('0x2'));var timeout=require(_0x10a0('0x3'));var express=require(_0x10a0('0x4'));var router=express[_0x10a0('0x5')]();var fs_extra=require(_0x10a0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x10a0('0x7'));var config=require(_0x10a0('0x8'));var controller=require(_0x10a0('0x9'));router[_0x10a0('0xa')]('/',auth[_0x10a0('0xb')](),controller[_0x10a0('0xc')]);router[_0x10a0('0xa')]('/:id',auth[_0x10a0('0xb')](),controller['show']);router[_0x10a0('0xa')](_0x10a0('0xd'),auth['isAuthenticated'](),controller[_0x10a0('0xe')]);router[_0x10a0('0xa')](_0x10a0('0xf'),auth['isAuthenticated'](),controller[_0x10a0('0x10')]);router['get'](_0x10a0('0x11'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x12')]);router[_0x10a0('0x13')]('/',auth['isAuthenticated'](),controller[_0x10a0('0x14')]);router[_0x10a0('0x13')]('/:id/all_conditions',auth[_0x10a0('0xb')](),controller[_0x10a0('0x15')]);router[_0x10a0('0x13')](_0x10a0('0xf'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x16')]);router[_0x10a0('0x13')](_0x10a0('0x11'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x17')]);router[_0x10a0('0x18')](_0x10a0('0x19'),auth[_0x10a0('0xb')](),controller[_0x10a0('0x1a')]);router[_0x10a0('0x1b')](_0x10a0('0x19'),auth[_0x10a0('0xb')](),controller['destroy']);module[_0x10a0('0x1c')]=router; \ No newline at end of file +var _0xb694=['addAllCondition','addAnyCondition','/:id/actions','addAction','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','getActions','post'];(function(_0x320cb3,_0x49c0cf){var _0x899c86=function(_0x9fc8f){while(--_0x9fc8f){_0x320cb3['push'](_0x320cb3['shift']());}};_0x899c86(++_0x49c0cf);}(_0xb694,0x1ef));var _0x4b69=function(_0x2f2645,_0x431741){_0x2f2645=_0x2f2645-0x0;var _0x4d84da=_0xb694[_0x2f2645];return _0x4d84da;};'use strict';var multer=require(_0x4b69('0x0'));var util=require(_0x4b69('0x1'));var path=require(_0x4b69('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4b69('0x3')]();var fs_extra=require(_0x4b69('0x4'));var auth=require(_0x4b69('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b69('0x6'));var controller=require(_0x4b69('0x7'));router[_0x4b69('0x8')]('/',auth['isAuthenticated'](),controller[_0x4b69('0x9')]);router[_0x4b69('0x8')](_0x4b69('0xa'),auth[_0x4b69('0xb')](),controller[_0x4b69('0xc')]);router[_0x4b69('0x8')](_0x4b69('0xd'),auth[_0x4b69('0xb')](),controller['getAllConditions']);router[_0x4b69('0x8')](_0x4b69('0xe'),auth[_0x4b69('0xb')](),controller[_0x4b69('0xf')]);router[_0x4b69('0x8')]('/:id/actions',auth['isAuthenticated'](),controller[_0x4b69('0x10')]);router[_0x4b69('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4b69('0x11')](_0x4b69('0xd'),auth[_0x4b69('0xb')](),controller[_0x4b69('0x12')]);router[_0x4b69('0x11')]('/:id/any_conditions',auth[_0x4b69('0xb')](),controller[_0x4b69('0x13')]);router[_0x4b69('0x11')](_0x4b69('0x14'),auth['isAuthenticated'](),controller[_0x4b69('0x15')]);router[_0x4b69('0x16')](_0x4b69('0xa'),auth[_0x4b69('0xb')](),controller[_0x4b69('0x17')]);router[_0x4b69('0x18')](_0x4b69('0xa'),auth['isAuthenticated'](),controller[_0x4b69('0x19')]);module[_0x4b69('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 2df27ba..8d306f5 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 _0x8790=['STRING','exports'];(function(_0x42c9b5,_0x5491a9){var _0x63209=function(_0x38b00c){while(--_0x38b00c){_0x42c9b5['push'](_0x42c9b5['shift']());}};_0x63209(++_0x5491a9);}(_0x8790,0x67));var _0x0879=function(_0x2cb2e6,_0x401618){_0x2cb2e6=_0x2cb2e6-0x0;var _0x8c40d9=_0x8790[_0x2cb2e6];return _0x8c40d9;};'use strict';var Sequelize=require('sequelize');module[_0x0879('0x0')]={'name':{'type':Sequelize[_0x0879('0x1')]},'channel':{'type':Sequelize[_0x0879('0x1')]},'description':{'type':Sequelize[_0x0879('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbeff=['STRING','sequelize'];(function(_0x633b45,_0x587877){var _0x4fb2ff=function(_0x1d0b48){while(--_0x1d0b48){_0x633b45['push'](_0x633b45['shift']());}};_0x4fb2ff(++_0x587877);}(_0xbeff,0x14b));var _0xfbef=function(_0x4778cf,_0x287e4f){_0x4778cf=_0x4778cf-0x0;var _0x4293f8=_0xbeff[_0x4778cf];return _0x4293f8;};'use strict';var Sequelize=require(_0xfbef('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfbef('0x1')]},'description':{'type':Sequelize[_0xfbef('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 937a5bb..af2cefb 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 _0xa1b5=['../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','sendStatus','stack','name','send','index','map','Trigger','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','show','params','rawAttributes','keys','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAnyId','Condition','options','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x221246,_0x168ceb){var _0x13e1ea=function(_0x17ee22){while(--_0x17ee22){_0x221246['push'](_0x221246['shift']());}};_0x13e1ea(++_0x168ceb);}(_0xa1b5,0xfa));var _0x5a1b=function(_0x13966f,_0x1fd964){_0x13966f=_0x13966f-0x0;var _0x4c3df2=_0xa1b5[_0x13966f];return _0x4c3df2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a1b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a1b('0x1'));var rp=require(_0x5a1b('0x2'));var moment=require(_0x5a1b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5a1b('0x4'));var util=require(_0x5a1b('0x5'));var path=require(_0x5a1b('0x6'));var sox=require(_0x5a1b('0x7'));var csv=require(_0x5a1b('0x8'));var ejs=require(_0x5a1b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a1b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5a1b('0xb'));var deskjs=require(_0x5a1b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5a1b('0xd'));var Papa=require('papaparse');var Redis=require(_0x5a1b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5a1b('0xf'));var as=require(_0x5a1b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a1b('0x11'))('api');var utils=require(_0x5a1b('0x12'));var config=require(_0x5a1b('0x13'));var licenseUtil=require(_0x5a1b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x110542,_0x4319ed){_0x4319ed=_0x4319ed||0xcc;return function(_0x2cfc3d){if(_0x2cfc3d){return _0x110542['sendStatus'](_0x4319ed);}return _0x110542['status'](_0x4319ed)[_0x5a1b('0x15')]();};}function respondWithResult(_0x3eda40,_0x3d223f){_0x3d223f=_0x3d223f||0xc8;return function(_0x1c445b){if(_0x1c445b){return _0x3eda40[_0x5a1b('0x16')](_0x3d223f)[_0x5a1b('0x17')](_0x1c445b);}};}function respondWithFilteredResult(_0x3881a4,_0x484d30){return function(_0x32ea){if(_0x32ea){var _0x3dceb6=typeof _0x484d30[_0x5a1b('0x18')]===_0x5a1b('0x19')&&typeof _0x484d30[_0x5a1b('0x1a')]===_0x5a1b('0x19');var _0x13a5bf=_0x32ea[_0x5a1b('0x1b')];var _0x2c4d51=_0x3dceb6?0x0:_0x484d30[_0x5a1b('0x18')];var _0x223f5e=_0x3dceb6?_0x32ea['count']:_0x484d30[_0x5a1b('0x18')]+_0x484d30[_0x5a1b('0x1a')];var _0x1e7ddf;if(_0x223f5e>=_0x13a5bf){_0x223f5e=_0x13a5bf;_0x1e7ddf=0xc8;}else{_0x1e7ddf=0xce;}_0x3881a4['status'](_0x1e7ddf);return _0x3881a4['set'](_0x5a1b('0x1c'),_0x2c4d51+'-'+_0x223f5e+'/'+_0x13a5bf)[_0x5a1b('0x17')](_0x32ea);}return null;};}function patchUpdates(_0x3aad3f){return function(_0xa02833){try{jsonpatch[_0x5a1b('0x1d')](_0xa02833,_0x3aad3f,!![]);}catch(_0x40cf03){return BPromise[_0x5a1b('0x1e')](_0x40cf03);}return _0xa02833[_0x5a1b('0x1f')]();};}function saveUpdates(_0x1564b8,_0x49bf0e){return function(_0x12c2fb){if(_0x12c2fb){return _0x12c2fb[_0x5a1b('0x20')](_0x1564b8)[_0x5a1b('0x21')](function(_0x437674){return _0x437674;});}return null;};}function removeEntity(_0x5d3790,_0x2340af){return function(_0x11b17a){if(_0x11b17a){return _0x11b17a[_0x5a1b('0x22')]()['then'](function(){var _0x2c722c=_0x11b17a[_0x5a1b('0x23')]({'plain':!![]});var _0x42f34e=_0x5a1b('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x42f34e,'resourceId':_0x2c722c['id']}})[_0x5a1b('0x21')](function(){return _0x11b17a;});})[_0x5a1b('0x21')](function(){_0x5d3790[_0x5a1b('0x16')](0xcc)[_0x5a1b('0x15')]();});}};}function handleEntityNotFound(_0x1aa96d,_0x50c55e){return function(_0x9c8a8){if(!_0x9c8a8){_0x1aa96d[_0x5a1b('0x25')](0x194);}return _0x9c8a8;};}function handleError(_0x143a4b,_0x1abe7d){_0x1abe7d=_0x1abe7d||0x1f4;return function(_0x1bc119){logger['error'](_0x1bc119[_0x5a1b('0x26')]);if(_0x1bc119[_0x5a1b('0x27')]){delete _0x1bc119['name'];}_0x143a4b[_0x5a1b('0x16')](_0x1abe7d)[_0x5a1b('0x28')](_0x1bc119);};}exports[_0x5a1b('0x29')]=function(_0x1fce09,_0x1c20b7){var _0x31b6e1={},_0x1ce72d={},_0x163263={'count':0x0,'rows':[]};var _0x12e381=_[_0x5a1b('0x2a')](db[_0x5a1b('0x2b')]['rawAttributes'],function(_0x2c9627){return{'name':_0x2c9627['fieldName'],'type':_0x2c9627[_0x5a1b('0x2c')][_0x5a1b('0x2d')]};});_0x1ce72d[_0x5a1b('0x2e')]=_['map'](_0x12e381,_0x5a1b('0x27'));_0x1ce72d[_0x5a1b('0x2f')]=_['keys'](_0x1fce09[_0x5a1b('0x2f')]);_0x1ce72d['filters']=_[_0x5a1b('0x30')](_0x1ce72d['model'],_0x1ce72d[_0x5a1b('0x2f')]);_0x31b6e1['attributes']=_[_0x5a1b('0x30')](_0x1ce72d[_0x5a1b('0x2e')],qs[_0x5a1b('0x31')](_0x1fce09['query'][_0x5a1b('0x31')]));_0x31b6e1[_0x5a1b('0x32')]=_0x31b6e1[_0x5a1b('0x32')][_0x5a1b('0x33')]?_0x31b6e1['attributes']:_0x1ce72d['model'];if(!_0x1fce09['query'][_0x5a1b('0x34')](_0x5a1b('0x35'))){_0x31b6e1[_0x5a1b('0x1a')]=qs['limit'](_0x1fce09[_0x5a1b('0x2f')][_0x5a1b('0x1a')]);_0x31b6e1[_0x5a1b('0x18')]=qs[_0x5a1b('0x18')](_0x1fce09[_0x5a1b('0x2f')][_0x5a1b('0x18')]);}_0x31b6e1[_0x5a1b('0x36')]=qs[_0x5a1b('0x37')](_0x1fce09[_0x5a1b('0x2f')][_0x5a1b('0x37')]);_0x31b6e1[_0x5a1b('0x38')]=qs[_0x5a1b('0x39')](_[_0x5a1b('0x3a')](_0x1fce09['query'],_0x1ce72d[_0x5a1b('0x39')]),_0x12e381);if(_0x1fce09[_0x5a1b('0x2f')][_0x5a1b('0x3b')]){_0x31b6e1[_0x5a1b('0x38')]=_[_0x5a1b('0x3c')](_0x31b6e1['where'],{'$or':_[_0x5a1b('0x2a')](_0x12e381,function(_0x482901){if(_0x482901[_0x5a1b('0x2c')]!==_0x5a1b('0x3d')){var _0x1b4466={};_0x1b4466[_0x482901[_0x5a1b('0x27')]]={'$like':'%'+_0x1fce09['query']['filter']+'%'};return _0x1b4466;}})});}_0x31b6e1=_[_0x5a1b('0x3c')]({},_0x31b6e1,_0x1fce09['options']);var _0x54e15c={'where':_0x31b6e1[_0x5a1b('0x38')]};return db[_0x5a1b('0x2b')]['count'](_0x54e15c)[_0x5a1b('0x21')](function(_0x72b22){_0x163263[_0x5a1b('0x1b')]=_0x72b22;if(_0x1fce09['query']['includeAll']){_0x31b6e1[_0x5a1b('0x3e')]=[{'all':!![]}];}return db[_0x5a1b('0x2b')]['findAll'](_0x31b6e1);})[_0x5a1b('0x21')](function(_0x2922dc){_0x163263[_0x5a1b('0x3f')]=_0x2922dc;return _0x163263;})[_0x5a1b('0x21')](respondWithFilteredResult(_0x1c20b7,_0x31b6e1))['catch'](handleError(_0x1c20b7,null));};exports[_0x5a1b('0x40')]=function(_0x530ee6,_0x27e78e){var _0xd33355={'raw':![],'where':{'id':_0x530ee6[_0x5a1b('0x41')]['id']}},_0x135c5e={};_0x135c5e['model']=_['keys'](db[_0x5a1b('0x2b')][_0x5a1b('0x42')]);_0x135c5e['query']=_[_0x5a1b('0x43')](_0x530ee6[_0x5a1b('0x2f')]);_0x135c5e['filters']=_[_0x5a1b('0x30')](_0x135c5e[_0x5a1b('0x2e')],_0x135c5e[_0x5a1b('0x2f')]);_0xd33355[_0x5a1b('0x32')]=_[_0x5a1b('0x30')](_0x135c5e[_0x5a1b('0x2e')],qs[_0x5a1b('0x31')](_0x530ee6[_0x5a1b('0x2f')][_0x5a1b('0x31')]));_0xd33355['attributes']=_0xd33355[_0x5a1b('0x32')]['length']?_0xd33355['attributes']:_0x135c5e[_0x5a1b('0x2e')];if(_0x530ee6[_0x5a1b('0x2f')][_0x5a1b('0x44')]){_0xd33355['include']=[{'all':!![]}];}_0xd33355=_[_0x5a1b('0x3c')]({},_0xd33355,_0x530ee6['options']);return db[_0x5a1b('0x2b')][_0x5a1b('0x45')](_0xd33355)[_0x5a1b('0x21')](handleEntityNotFound(_0x27e78e,null))[_0x5a1b('0x21')](respondWithResult(_0x27e78e,null))[_0x5a1b('0x46')](handleError(_0x27e78e,null));};exports[_0x5a1b('0x47')]=function(_0x4873ba,_0x2825e0){return db[_0x5a1b('0x2b')][_0x5a1b('0x47')](_0x4873ba[_0x5a1b('0x48')],{})['then'](function(_0x1149e1){var _0x34a422=_0x4873ba['user'][_0x5a1b('0x23')]({'plain':!![]});if(!_0x34a422)throw new Error(_0x5a1b('0x49'));if(_0x34a422[_0x5a1b('0x4a')]===_0x5a1b('0x4b')){var _0x4d9a37=_0x1149e1[_0x5a1b('0x23')]({'plain':!![]});var _0x56724f=_0x5a1b('0x24');return db[_0x5a1b('0x4c')]['find']({'where':{'name':_0x56724f,'userProfileId':_0x34a422[_0x5a1b('0x4d')]},'raw':!![]})[_0x5a1b('0x21')](function(_0x3b5486){if(_0x3b5486&&_0x3b5486['autoAssociation']===0x0){return db[_0x5a1b('0x4e')]['create']({'name':_0x4d9a37[_0x5a1b('0x27')],'resourceId':_0x4d9a37['id'],'type':_0x3b5486[_0x5a1b('0x27')],'sectionId':_0x3b5486['id']},{})[_0x5a1b('0x21')](function(){return _0x1149e1;});}else{return _0x1149e1;}})[_0x5a1b('0x46')](function(_0x3ef8a5){logger[_0x5a1b('0x4f')](_0x5a1b('0x50'),_0x3ef8a5);throw _0x3ef8a5;});}return _0x1149e1;})['then'](respondWithResult(_0x2825e0,0xc9))['catch'](handleError(_0x2825e0,null));};exports[_0x5a1b('0x20')]=function(_0x141cc6,_0x40fdcb){if(_0x141cc6[_0x5a1b('0x48')]['id']){delete _0x141cc6[_0x5a1b('0x48')]['id'];}return db['Trigger']['find']({'where':{'id':_0x141cc6[_0x5a1b('0x41')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x40fdcb,null))[_0x5a1b('0x21')](saveUpdates(_0x141cc6['body'],null))[_0x5a1b('0x21')](respondWithResult(_0x40fdcb,null))['catch'](handleError(_0x40fdcb,null));};exports[_0x5a1b('0x22')]=function(_0x57c559,_0x2ba92e){return db['Trigger'][_0x5a1b('0x45')]({'where':{'id':_0x57c559[_0x5a1b('0x41')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x2ba92e,null))['then'](removeEntity(_0x2ba92e,null))[_0x5a1b('0x46')](handleError(_0x2ba92e,null));};exports['addAllCondition']=function(_0x4dc0f5,_0x532b8f,_0x26582a){if(_0x4dc0f5[_0x5a1b('0x48')]['id']){delete _0x4dc0f5[_0x5a1b('0x48')]['id'];}return db[_0x5a1b('0x2b')]['find']({'where':{'id':_0x4dc0f5[_0x5a1b('0x41')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x532b8f,null))[_0x5a1b('0x21')](function(_0x329ad7){if(_0x329ad7){_0x4dc0f5[_0x5a1b('0x48')]['TriggerAllId']=_0x329ad7['id'];return db['Condition'][_0x5a1b('0x47')](_0x4dc0f5[_0x5a1b('0x48')]);}})[_0x5a1b('0x21')](respondWithResult(_0x532b8f,null))[_0x5a1b('0x46')](handleError(_0x532b8f,null));};exports['addAnyCondition']=function(_0x581cef,_0x9f8d6e,_0x105374){if(_0x581cef[_0x5a1b('0x48')]['id']){delete _0x581cef['body']['id'];}return db[_0x5a1b('0x2b')][_0x5a1b('0x45')]({'where':{'id':_0x581cef['params']['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x9f8d6e,null))['then'](function(_0x1f136c){if(_0x1f136c){_0x581cef['body'][_0x5a1b('0x51')]=_0x1f136c['id'];return db[_0x5a1b('0x52')][_0x5a1b('0x47')](_0x581cef['body']);}})[_0x5a1b('0x21')](respondWithResult(_0x9f8d6e,null))[_0x5a1b('0x46')](handleError(_0x9f8d6e,null));};exports['getAllConditions']=function(_0x4a6d28,_0x4659dc,_0x1c8b48){var _0x21cd95={};var _0x1ddd7d={};var _0x19c704;var _0x16b24e;return db['Trigger']['findOne']({'where':{'id':_0x4a6d28[_0x5a1b('0x41')]['id']}})['then'](handleEntityNotFound(_0x4659dc,null))[_0x5a1b('0x21')](function(_0x13c245){if(_0x13c245){_0x19c704=_0x13c245;_0x1ddd7d[_0x5a1b('0x2e')]=_['keys'](db[_0x5a1b('0x52')][_0x5a1b('0x42')]);_0x1ddd7d['query']=_[_0x5a1b('0x43')](_0x4a6d28[_0x5a1b('0x2f')]);_0x1ddd7d[_0x5a1b('0x39')]=_[_0x5a1b('0x30')](_0x1ddd7d[_0x5a1b('0x2e')],_0x1ddd7d[_0x5a1b('0x2f')]);_0x21cd95['attributes']=_[_0x5a1b('0x30')](_0x1ddd7d[_0x5a1b('0x2e')],qs[_0x5a1b('0x31')](_0x4a6d28[_0x5a1b('0x2f')][_0x5a1b('0x31')]));_0x21cd95['attributes']=_0x21cd95['attributes'][_0x5a1b('0x33')]?_0x21cd95[_0x5a1b('0x32')]:_0x1ddd7d['model'];_0x21cd95['order']=qs[_0x5a1b('0x37')](_0x4a6d28[_0x5a1b('0x2f')][_0x5a1b('0x37')]);_0x21cd95[_0x5a1b('0x38')]=qs[_0x5a1b('0x39')](_['pick'](_0x4a6d28[_0x5a1b('0x2f')],_0x1ddd7d[_0x5a1b('0x39')]));if(_0x4a6d28[_0x5a1b('0x2f')][_0x5a1b('0x3b')]){_0x21cd95[_0x5a1b('0x38')]=_['merge'](_0x21cd95[_0x5a1b('0x38')],{'$or':_[_0x5a1b('0x2a')](_0x21cd95[_0x5a1b('0x32')],function(_0x5dd0e9){var _0x1183fa={};_0x1183fa[_0x5dd0e9]={'$like':'%'+_0x4a6d28[_0x5a1b('0x2f')][_0x5a1b('0x3b')]+'%'};return _0x1183fa;})});}_0x21cd95=_[_0x5a1b('0x3c')]({},_0x21cd95,_0x4a6d28[_0x5a1b('0x53')]);return _0x19c704[_0x5a1b('0x54')](_0x21cd95);}})[_0x5a1b('0x21')](function(_0x26bf15){if(_0x26bf15){_0x16b24e=_0x26bf15[_0x5a1b('0x33')];if(!_0x4a6d28[_0x5a1b('0x2f')]['hasOwnProperty'](_0x5a1b('0x35'))){_0x21cd95['limit']=qs[_0x5a1b('0x1a')](_0x4a6d28['query'][_0x5a1b('0x1a')]);_0x21cd95[_0x5a1b('0x18')]=qs['offset'](_0x4a6d28[_0x5a1b('0x2f')][_0x5a1b('0x18')]);}return _0x19c704[_0x5a1b('0x54')](_0x21cd95);}})[_0x5a1b('0x21')](function(_0x2617fd){if(_0x2617fd){return _0x2617fd?{'count':_0x16b24e,'rows':_0x2617fd}:null;}})['then'](respondWithResult(_0x4659dc,null))[_0x5a1b('0x46')](handleError(_0x4659dc,null));};exports[_0x5a1b('0x55')]=function(_0x211ea5,_0x26a204,_0x3c8cfa){var _0xb0efb={};var _0x566ce7={};var _0x23ed46;var _0x1ad981;return db[_0x5a1b('0x2b')]['findOne']({'where':{'id':_0x211ea5[_0x5a1b('0x41')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x26a204,null))[_0x5a1b('0x21')](function(_0x14a0c9){if(_0x14a0c9){_0x23ed46=_0x14a0c9;_0x566ce7[_0x5a1b('0x2e')]=_['keys'](db[_0x5a1b('0x52')][_0x5a1b('0x42')]);_0x566ce7[_0x5a1b('0x2f')]=_[_0x5a1b('0x43')](_0x211ea5[_0x5a1b('0x2f')]);_0x566ce7['filters']=_[_0x5a1b('0x30')](_0x566ce7[_0x5a1b('0x2e')],_0x566ce7[_0x5a1b('0x2f')]);_0xb0efb[_0x5a1b('0x32')]=_[_0x5a1b('0x30')](_0x566ce7[_0x5a1b('0x2e')],qs[_0x5a1b('0x31')](_0x211ea5[_0x5a1b('0x2f')]['fields']));_0xb0efb[_0x5a1b('0x32')]=_0xb0efb[_0x5a1b('0x32')]['length']?_0xb0efb[_0x5a1b('0x32')]:_0x566ce7[_0x5a1b('0x2e')];_0xb0efb[_0x5a1b('0x36')]=qs['sort'](_0x211ea5[_0x5a1b('0x2f')]['sort']);_0xb0efb['where']=qs[_0x5a1b('0x39')](_[_0x5a1b('0x3a')](_0x211ea5[_0x5a1b('0x2f')],_0x566ce7['filters']));if(_0x211ea5[_0x5a1b('0x2f')][_0x5a1b('0x3b')]){_0xb0efb[_0x5a1b('0x38')]=_[_0x5a1b('0x3c')](_0xb0efb['where'],{'$or':_[_0x5a1b('0x2a')](_0xb0efb[_0x5a1b('0x32')],function(_0x19dd01){var _0xc3d3f={};_0xc3d3f[_0x19dd01]={'$like':'%'+_0x211ea5['query']['filter']+'%'};return _0xc3d3f;})});}_0xb0efb=_['merge']({},_0xb0efb,_0x211ea5[_0x5a1b('0x53')]);return _0x23ed46[_0x5a1b('0x55')](_0xb0efb);}})['then'](function(_0x5828fe){if(_0x5828fe){_0x1ad981=_0x5828fe[_0x5a1b('0x33')];if(!_0x211ea5['query'][_0x5a1b('0x34')]('nolimit')){_0xb0efb[_0x5a1b('0x1a')]=qs[_0x5a1b('0x1a')](_0x211ea5[_0x5a1b('0x2f')]['limit']);_0xb0efb[_0x5a1b('0x18')]=qs[_0x5a1b('0x18')](_0x211ea5[_0x5a1b('0x2f')][_0x5a1b('0x18')]);}return _0x23ed46[_0x5a1b('0x55')](_0xb0efb);}})[_0x5a1b('0x21')](function(_0x5204d5){if(_0x5204d5){return _0x5204d5?{'count':_0x1ad981,'rows':_0x5204d5}:null;}})['then'](respondWithResult(_0x26a204,null))[_0x5a1b('0x46')](handleError(_0x26a204,null));};exports[_0x5a1b('0x56')]=function(_0xacc143,_0x50f5bf,_0x2d8b1d){if(_0xacc143[_0x5a1b('0x48')]['id']){delete _0xacc143[_0x5a1b('0x48')]['id'];}return db[_0x5a1b('0x2b')][_0x5a1b('0x45')]({'where':{'id':_0xacc143[_0x5a1b('0x41')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0x50f5bf,null))[_0x5a1b('0x21')](function(_0x19ad2e){if(_0x19ad2e){_0xacc143['body'][_0x5a1b('0x57')]=_0x19ad2e['id'];return db[_0x5a1b('0x58')]['create'](_0xacc143[_0x5a1b('0x48')]);}})[_0x5a1b('0x21')](respondWithResult(_0x50f5bf,null))[_0x5a1b('0x46')](handleError(_0x50f5bf,null));};exports[_0x5a1b('0x59')]=function(_0x2506c8,_0xc3c09b,_0x4c17fa){var _0x3f61b1={};var _0x890070={};var _0x3dbb0f;var _0x546918;return db[_0x5a1b('0x2b')]['findOne']({'where':{'id':_0x2506c8[_0x5a1b('0x41')]['id']}})[_0x5a1b('0x21')](handleEntityNotFound(_0xc3c09b,null))[_0x5a1b('0x21')](function(_0x307a02){if(_0x307a02){_0x3dbb0f=_0x307a02;_0x890070['model']=_[_0x5a1b('0x43')](db['Action'][_0x5a1b('0x42')]);_0x890070['query']=_[_0x5a1b('0x43')](_0x2506c8[_0x5a1b('0x2f')]);_0x890070[_0x5a1b('0x39')]=_[_0x5a1b('0x30')](_0x890070['model'],_0x890070[_0x5a1b('0x2f')]);_0x3f61b1[_0x5a1b('0x32')]=_['intersection'](_0x890070[_0x5a1b('0x2e')],qs[_0x5a1b('0x31')](_0x2506c8[_0x5a1b('0x2f')]['fields']));_0x3f61b1[_0x5a1b('0x32')]=_0x3f61b1[_0x5a1b('0x32')][_0x5a1b('0x33')]?_0x3f61b1[_0x5a1b('0x32')]:_0x890070[_0x5a1b('0x2e')];_0x3f61b1[_0x5a1b('0x36')]=qs[_0x5a1b('0x37')](_0x2506c8[_0x5a1b('0x2f')][_0x5a1b('0x37')]);_0x3f61b1[_0x5a1b('0x38')]=qs[_0x5a1b('0x39')](_['pick'](_0x2506c8[_0x5a1b('0x2f')],_0x890070[_0x5a1b('0x39')]));if(_0x2506c8[_0x5a1b('0x2f')][_0x5a1b('0x3b')]){_0x3f61b1['where']=_[_0x5a1b('0x3c')](_0x3f61b1[_0x5a1b('0x38')],{'$or':_[_0x5a1b('0x2a')](_0x3f61b1['attributes'],function(_0x4d2420){var _0x54ff75={};_0x54ff75[_0x4d2420]={'$like':'%'+_0x2506c8[_0x5a1b('0x2f')][_0x5a1b('0x3b')]+'%'};return _0x54ff75;})});}_0x3f61b1=_[_0x5a1b('0x3c')]({},_0x3f61b1,_0x2506c8[_0x5a1b('0x53')]);return _0x3dbb0f[_0x5a1b('0x59')](_0x3f61b1);}})[_0x5a1b('0x21')](function(_0x1ed9e1){if(_0x1ed9e1){_0x546918=_0x1ed9e1[_0x5a1b('0x33')];if(!_0x2506c8[_0x5a1b('0x2f')][_0x5a1b('0x34')]('nolimit')){_0x3f61b1[_0x5a1b('0x1a')]=qs[_0x5a1b('0x1a')](_0x2506c8['query'][_0x5a1b('0x1a')]);_0x3f61b1[_0x5a1b('0x18')]=qs[_0x5a1b('0x18')](_0x2506c8['query'][_0x5a1b('0x18')]);}return _0x3dbb0f[_0x5a1b('0x59')](_0x3f61b1);}})[_0x5a1b('0x21')](function(_0x10638c){if(_0x10638c){return _0x10638c?{'count':_0x546918,'rows':_0x10638c}:null;}})[_0x5a1b('0x21')](respondWithResult(_0xc3c09b,null))[_0x5a1b('0x46')](handleError(_0xc3c09b,null));}; \ No newline at end of file +var _0x8cef=['request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','Triggers','error','stack','name','send','index','map','Trigger','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4e77c6,_0x4c359c){var _0x3e326c=function(_0x50e425){while(--_0x50e425){_0x4e77c6['push'](_0x4e77c6['shift']());}};_0x3e326c(++_0x4c359c);}(_0x8cef,0xbc));var _0xf8ce=function(_0x5b33f6,_0x5af721){_0x5b33f6=_0x5b33f6-0x0;var _0x4ea693=_0x8cef[_0x5b33f6];return _0x4ea693;};'use strict';var emlformat=require(_0xf8ce('0x0'));var rimraf=require(_0xf8ce('0x1'));var zipdir=require(_0xf8ce('0x2'));var jsonpatch=require(_0xf8ce('0x3'));var rp=require(_0xf8ce('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf8ce('0x5'));var path=require(_0xf8ce('0x6'));var sox=require(_0xf8ce('0x7'));var csv=require(_0xf8ce('0x8'));var ejs=require(_0xf8ce('0x9'));var fs=require('fs');var fs_extra=require(_0xf8ce('0xa'));var _=require('lodash');var squel=require(_0xf8ce('0xb'));var crypto=require(_0xf8ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf8ce('0xd'));var toCsv=require(_0xf8ce('0x8'));var querystring=require(_0xf8ce('0xe'));var Papa=require(_0xf8ce('0xf'));var Redis=require('ioredis');var authService=require(_0xf8ce('0x10'));var qs=require(_0xf8ce('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8ce('0x12'));var logger=require(_0xf8ce('0x13'))('api');var utils=require(_0xf8ce('0x14'));var config=require(_0xf8ce('0x15'));var licenseUtil=require(_0xf8ce('0x16'));var db=require(_0xf8ce('0x17'))['db'];function respondWithStatusCode(_0x42002e,_0x420c2d){_0x420c2d=_0x420c2d||0xcc;return function(_0xec8d4d){if(_0xec8d4d){return _0x42002e[_0xf8ce('0x18')](_0x420c2d);}return _0x42002e[_0xf8ce('0x19')](_0x420c2d)[_0xf8ce('0x1a')]();};}function respondWithResult(_0x3b981f,_0x2e4336){_0x2e4336=_0x2e4336||0xc8;return function(_0xec713e){if(_0xec713e){return _0x3b981f[_0xf8ce('0x19')](_0x2e4336)['json'](_0xec713e);}};}function respondWithFilteredResult(_0x3887fd,_0x5886ce){return function(_0x183319){if(_0x183319){var _0x18ba46=typeof _0x5886ce[_0xf8ce('0x1b')]===_0xf8ce('0x1c')&&typeof _0x5886ce[_0xf8ce('0x1d')]===_0xf8ce('0x1c');var _0x3f7ecd=_0x183319[_0xf8ce('0x1e')];var _0x47f4ec=_0x18ba46?0x0:_0x5886ce[_0xf8ce('0x1b')];var _0x2bd969=_0x18ba46?_0x183319[_0xf8ce('0x1e')]:_0x5886ce[_0xf8ce('0x1b')]+_0x5886ce['limit'];var _0x5622ba;if(_0x2bd969>=_0x3f7ecd){_0x2bd969=_0x3f7ecd;_0x5622ba=0xc8;}else{_0x5622ba=0xce;}_0x3887fd[_0xf8ce('0x19')](_0x5622ba);return _0x3887fd[_0xf8ce('0x1f')]('Content-Range',_0x47f4ec+'-'+_0x2bd969+'/'+_0x3f7ecd)['json'](_0x183319);}return null;};}function patchUpdates(_0x3fedff){return function(_0x5039d8){try{jsonpatch[_0xf8ce('0x20')](_0x5039d8,_0x3fedff,!![]);}catch(_0x5625a3){return BPromise[_0xf8ce('0x21')](_0x5625a3);}return _0x5039d8[_0xf8ce('0x22')]();};}function saveUpdates(_0x28ebbb,_0x1a7601){return function(_0x57c0a6){if(_0x57c0a6){return _0x57c0a6['update'](_0x28ebbb)[_0xf8ce('0x23')](function(_0x582dae){return _0x582dae;});}return null;};}function removeEntity(_0x2dab72,_0x598a68){return function(_0x1a2108){if(_0x1a2108){return _0x1a2108[_0xf8ce('0x24')]()[_0xf8ce('0x23')](function(){var _0x411bd3=_0x1a2108[_0xf8ce('0x25')]({'plain':!![]});var _0x194395=_0xf8ce('0x26');return db['UserProfileResource'][_0xf8ce('0x24')]({'where':{'type':_0x194395,'resourceId':_0x411bd3['id']}})[_0xf8ce('0x23')](function(){return _0x1a2108;});})[_0xf8ce('0x23')](function(){_0x2dab72[_0xf8ce('0x19')](0xcc)[_0xf8ce('0x1a')]();});}};}function handleEntityNotFound(_0x6b58a8,_0x5f1df4){return function(_0x33f348){if(!_0x33f348){_0x6b58a8[_0xf8ce('0x18')](0x194);}return _0x33f348;};}function handleError(_0x3ddc3c,_0x48370b){_0x48370b=_0x48370b||0x1f4;return function(_0x516549){logger[_0xf8ce('0x27')](_0x516549[_0xf8ce('0x28')]);if(_0x516549[_0xf8ce('0x29')]){delete _0x516549[_0xf8ce('0x29')];}_0x3ddc3c['status'](_0x48370b)[_0xf8ce('0x2a')](_0x516549);};}exports[_0xf8ce('0x2b')]=function(_0x5c8d17,_0xc8631c){var _0x5e1967={},_0x5a247e={},_0x56e57d={'count':0x0,'rows':[]};var _0x114e9e=_[_0xf8ce('0x2c')](db[_0xf8ce('0x2d')]['rawAttributes'],function(_0x20dfe9){return{'name':_0x20dfe9[_0xf8ce('0x2e')],'type':_0x20dfe9['type'][_0xf8ce('0x2f')]};});_0x5a247e[_0xf8ce('0x30')]=_[_0xf8ce('0x2c')](_0x114e9e,'name');_0x5a247e[_0xf8ce('0x31')]=_[_0xf8ce('0x32')](_0x5c8d17[_0xf8ce('0x31')]);_0x5a247e[_0xf8ce('0x33')]=_[_0xf8ce('0x34')](_0x5a247e[_0xf8ce('0x30')],_0x5a247e[_0xf8ce('0x31')]);_0x5e1967[_0xf8ce('0x35')]=_[_0xf8ce('0x34')](_0x5a247e[_0xf8ce('0x30')],qs[_0xf8ce('0x36')](_0x5c8d17['query']['fields']));_0x5e1967[_0xf8ce('0x35')]=_0x5e1967['attributes'][_0xf8ce('0x37')]?_0x5e1967[_0xf8ce('0x35')]:_0x5a247e[_0xf8ce('0x30')];if(!_0x5c8d17[_0xf8ce('0x31')]['hasOwnProperty'](_0xf8ce('0x38'))){_0x5e1967['limit']=qs[_0xf8ce('0x1d')](_0x5c8d17[_0xf8ce('0x31')]['limit']);_0x5e1967[_0xf8ce('0x1b')]=qs['offset'](_0x5c8d17['query']['offset']);}_0x5e1967[_0xf8ce('0x39')]=qs[_0xf8ce('0x3a')](_0x5c8d17['query'][_0xf8ce('0x3a')]);_0x5e1967[_0xf8ce('0x3b')]=qs[_0xf8ce('0x33')](_[_0xf8ce('0x3c')](_0x5c8d17[_0xf8ce('0x31')],_0x5a247e['filters']),_0x114e9e);if(_0x5c8d17[_0xf8ce('0x31')][_0xf8ce('0x3d')]){_0x5e1967[_0xf8ce('0x3b')]=_[_0xf8ce('0x3e')](_0x5e1967[_0xf8ce('0x3b')],{'$or':_[_0xf8ce('0x2c')](_0x114e9e,function(_0x43d79d){if(_0x43d79d[_0xf8ce('0x3f')]!=='VIRTUAL'){var _0x5bf641={};_0x5bf641[_0x43d79d['name']]={'$like':'%'+_0x5c8d17[_0xf8ce('0x31')][_0xf8ce('0x3d')]+'%'};return _0x5bf641;}})});}_0x5e1967=_[_0xf8ce('0x3e')]({},_0x5e1967,_0x5c8d17['options']);var _0x3fb640={'where':_0x5e1967[_0xf8ce('0x3b')]};return db[_0xf8ce('0x2d')]['count'](_0x3fb640)[_0xf8ce('0x23')](function(_0x313fbf){_0x56e57d[_0xf8ce('0x1e')]=_0x313fbf;if(_0x5c8d17['query'][_0xf8ce('0x40')]){_0x5e1967['include']=[{'all':!![]}];}return db[_0xf8ce('0x2d')][_0xf8ce('0x41')](_0x5e1967);})['then'](function(_0x1d3f4b){_0x56e57d['rows']=_0x1d3f4b;return _0x56e57d;})['then'](respondWithFilteredResult(_0xc8631c,_0x5e1967))[_0xf8ce('0x42')](handleError(_0xc8631c,null));};exports[_0xf8ce('0x43')]=function(_0x38ef3c,_0x27ceb8){var _0x596d6f={'raw':![],'where':{'id':_0x38ef3c[_0xf8ce('0x44')]['id']}},_0x19697c={};_0x19697c[_0xf8ce('0x30')]=_[_0xf8ce('0x32')](db['Trigger'][_0xf8ce('0x45')]);_0x19697c[_0xf8ce('0x31')]=_['keys'](_0x38ef3c[_0xf8ce('0x31')]);_0x19697c[_0xf8ce('0x33')]=_['intersection'](_0x19697c[_0xf8ce('0x30')],_0x19697c['query']);_0x596d6f['attributes']=_[_0xf8ce('0x34')](_0x19697c[_0xf8ce('0x30')],qs['fields'](_0x38ef3c[_0xf8ce('0x31')]['fields']));_0x596d6f[_0xf8ce('0x35')]=_0x596d6f['attributes'][_0xf8ce('0x37')]?_0x596d6f[_0xf8ce('0x35')]:_0x19697c['model'];if(_0x38ef3c[_0xf8ce('0x31')][_0xf8ce('0x40')]){_0x596d6f[_0xf8ce('0x46')]=[{'all':!![]}];}_0x596d6f=_[_0xf8ce('0x3e')]({},_0x596d6f,_0x38ef3c[_0xf8ce('0x47')]);return db['Trigger'][_0xf8ce('0x48')](_0x596d6f)['then'](handleEntityNotFound(_0x27ceb8,null))[_0xf8ce('0x23')](respondWithResult(_0x27ceb8,null))[_0xf8ce('0x42')](handleError(_0x27ceb8,null));};exports[_0xf8ce('0x49')]=function(_0x399c04,_0x247037){return db[_0xf8ce('0x2d')]['create'](_0x399c04['body'],{})[_0xf8ce('0x23')](function(_0x1e4292){var _0x2721b4=_0x399c04[_0xf8ce('0x4a')][_0xf8ce('0x25')]({'plain':!![]});if(!_0x2721b4)throw new Error(_0xf8ce('0x4b'));if(_0x2721b4['role']===_0xf8ce('0x4a')){var _0x3d26ea=_0x1e4292['get']({'plain':!![]});var _0xce8c15=_0xf8ce('0x26');return db[_0xf8ce('0x4c')][_0xf8ce('0x48')]({'where':{'name':_0xce8c15,'userProfileId':_0x2721b4[_0xf8ce('0x4d')]},'raw':!![]})[_0xf8ce('0x23')](function(_0xe6a284){if(_0xe6a284&&_0xe6a284[_0xf8ce('0x4e')]===0x0){return db[_0xf8ce('0x4f')][_0xf8ce('0x49')]({'name':_0x3d26ea[_0xf8ce('0x29')],'resourceId':_0x3d26ea['id'],'type':_0xe6a284[_0xf8ce('0x29')],'sectionId':_0xe6a284['id']},{})['then'](function(){return _0x1e4292;});}else{return _0x1e4292;}})[_0xf8ce('0x42')](function(_0x5bbba4){logger[_0xf8ce('0x27')](_0xf8ce('0x50'),_0x5bbba4);throw _0x5bbba4;});}return _0x1e4292;})[_0xf8ce('0x23')](respondWithResult(_0x247037,0xc9))[_0xf8ce('0x42')](handleError(_0x247037,null));};exports[_0xf8ce('0x51')]=function(_0x2e8222,_0x3dc7dc){if(_0x2e8222['body']['id']){delete _0x2e8222[_0xf8ce('0x52')]['id'];}return db[_0xf8ce('0x2d')][_0xf8ce('0x48')]({'where':{'id':_0x2e8222[_0xf8ce('0x44')]['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0x3dc7dc,null))[_0xf8ce('0x23')](saveUpdates(_0x2e8222[_0xf8ce('0x52')],null))['then'](respondWithResult(_0x3dc7dc,null))[_0xf8ce('0x42')](handleError(_0x3dc7dc,null));};exports[_0xf8ce('0x24')]=function(_0x3acffe,_0x882881){return db[_0xf8ce('0x2d')][_0xf8ce('0x48')]({'where':{'id':_0x3acffe[_0xf8ce('0x44')]['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0x882881,null))['then'](removeEntity(_0x882881,null))['catch'](handleError(_0x882881,null));};exports[_0xf8ce('0x53')]=function(_0x2ba451,_0xdff7e7,_0x3e3984){if(_0x2ba451['body']['id']){delete _0x2ba451[_0xf8ce('0x52')]['id'];}return db['Trigger'][_0xf8ce('0x48')]({'where':{'id':_0x2ba451[_0xf8ce('0x44')]['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0xdff7e7,null))[_0xf8ce('0x23')](function(_0x455d9b){if(_0x455d9b){_0x2ba451['body'][_0xf8ce('0x54')]=_0x455d9b['id'];return db[_0xf8ce('0x55')][_0xf8ce('0x49')](_0x2ba451['body']);}})[_0xf8ce('0x23')](respondWithResult(_0xdff7e7,null))[_0xf8ce('0x42')](handleError(_0xdff7e7,null));};exports[_0xf8ce('0x56')]=function(_0x210ac7,_0x2efdba,_0x5b3d2b){if(_0x210ac7[_0xf8ce('0x52')]['id']){delete _0x210ac7[_0xf8ce('0x52')]['id'];}return db['Trigger']['find']({'where':{'id':_0x210ac7[_0xf8ce('0x44')]['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0x2efdba,null))[_0xf8ce('0x23')](function(_0x388c15){if(_0x388c15){_0x210ac7[_0xf8ce('0x52')][_0xf8ce('0x57')]=_0x388c15['id'];return db[_0xf8ce('0x55')]['create'](_0x210ac7[_0xf8ce('0x52')]);}})['then'](respondWithResult(_0x2efdba,null))[_0xf8ce('0x42')](handleError(_0x2efdba,null));};exports['getAllConditions']=function(_0x21d771,_0x2df6d6,_0x2c6b64){var _0x2dbf35={};var _0x2f84d1={};var _0x5d9d95;var _0x2e3891;return db[_0xf8ce('0x2d')][_0xf8ce('0x58')]({'where':{'id':_0x21d771[_0xf8ce('0x44')]['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0x2df6d6,null))['then'](function(_0x2e4312){if(_0x2e4312){_0x5d9d95=_0x2e4312;_0x2f84d1[_0xf8ce('0x30')]=_['keys'](db[_0xf8ce('0x55')][_0xf8ce('0x45')]);_0x2f84d1[_0xf8ce('0x31')]=_[_0xf8ce('0x32')](_0x21d771[_0xf8ce('0x31')]);_0x2f84d1[_0xf8ce('0x33')]=_[_0xf8ce('0x34')](_0x2f84d1[_0xf8ce('0x30')],_0x2f84d1['query']);_0x2dbf35[_0xf8ce('0x35')]=_[_0xf8ce('0x34')](_0x2f84d1[_0xf8ce('0x30')],qs[_0xf8ce('0x36')](_0x21d771[_0xf8ce('0x31')]['fields']));_0x2dbf35['attributes']=_0x2dbf35[_0xf8ce('0x35')]['length']?_0x2dbf35[_0xf8ce('0x35')]:_0x2f84d1[_0xf8ce('0x30')];_0x2dbf35[_0xf8ce('0x39')]=qs[_0xf8ce('0x3a')](_0x21d771[_0xf8ce('0x31')][_0xf8ce('0x3a')]);_0x2dbf35[_0xf8ce('0x3b')]=qs[_0xf8ce('0x33')](_['pick'](_0x21d771[_0xf8ce('0x31')],_0x2f84d1[_0xf8ce('0x33')]));if(_0x21d771[_0xf8ce('0x31')][_0xf8ce('0x3d')]){_0x2dbf35['where']=_[_0xf8ce('0x3e')](_0x2dbf35[_0xf8ce('0x3b')],{'$or':_[_0xf8ce('0x2c')](_0x2dbf35[_0xf8ce('0x35')],function(_0xe0cd1a){var _0x15d993={};_0x15d993[_0xe0cd1a]={'$like':'%'+_0x21d771[_0xf8ce('0x31')][_0xf8ce('0x3d')]+'%'};return _0x15d993;})});}_0x2dbf35=_[_0xf8ce('0x3e')]({},_0x2dbf35,_0x21d771['options']);return _0x5d9d95['getAllConditions'](_0x2dbf35);}})[_0xf8ce('0x23')](function(_0x10a910){if(_0x10a910){_0x2e3891=_0x10a910[_0xf8ce('0x37')];if(!_0x21d771['query']['hasOwnProperty'](_0xf8ce('0x38'))){_0x2dbf35[_0xf8ce('0x1d')]=qs[_0xf8ce('0x1d')](_0x21d771['query']['limit']);_0x2dbf35[_0xf8ce('0x1b')]=qs[_0xf8ce('0x1b')](_0x21d771['query'][_0xf8ce('0x1b')]);}return _0x5d9d95[_0xf8ce('0x59')](_0x2dbf35);}})['then'](function(_0x34c7f7){if(_0x34c7f7){return _0x34c7f7?{'count':_0x2e3891,'rows':_0x34c7f7}:null;}})[_0xf8ce('0x23')](respondWithResult(_0x2df6d6,null))['catch'](handleError(_0x2df6d6,null));};exports[_0xf8ce('0x5a')]=function(_0x11f416,_0x4b767b,_0x2cb03b){var _0x593145={};var _0x265059={};var _0x46d312;var _0x5c4d53;return db[_0xf8ce('0x2d')][_0xf8ce('0x58')]({'where':{'id':_0x11f416[_0xf8ce('0x44')]['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0x4b767b,null))[_0xf8ce('0x23')](function(_0xa47a73){if(_0xa47a73){_0x46d312=_0xa47a73;_0x265059[_0xf8ce('0x30')]=_[_0xf8ce('0x32')](db[_0xf8ce('0x55')][_0xf8ce('0x45')]);_0x265059[_0xf8ce('0x31')]=_[_0xf8ce('0x32')](_0x11f416[_0xf8ce('0x31')]);_0x265059[_0xf8ce('0x33')]=_['intersection'](_0x265059[_0xf8ce('0x30')],_0x265059[_0xf8ce('0x31')]);_0x593145[_0xf8ce('0x35')]=_[_0xf8ce('0x34')](_0x265059[_0xf8ce('0x30')],qs[_0xf8ce('0x36')](_0x11f416[_0xf8ce('0x31')][_0xf8ce('0x36')]));_0x593145[_0xf8ce('0x35')]=_0x593145[_0xf8ce('0x35')][_0xf8ce('0x37')]?_0x593145[_0xf8ce('0x35')]:_0x265059[_0xf8ce('0x30')];_0x593145['order']=qs[_0xf8ce('0x3a')](_0x11f416[_0xf8ce('0x31')][_0xf8ce('0x3a')]);_0x593145[_0xf8ce('0x3b')]=qs[_0xf8ce('0x33')](_[_0xf8ce('0x3c')](_0x11f416['query'],_0x265059[_0xf8ce('0x33')]));if(_0x11f416['query'][_0xf8ce('0x3d')]){_0x593145['where']=_[_0xf8ce('0x3e')](_0x593145['where'],{'$or':_['map'](_0x593145[_0xf8ce('0x35')],function(_0x5b691b){var _0x3ec302={};_0x3ec302[_0x5b691b]={'$like':'%'+_0x11f416['query'][_0xf8ce('0x3d')]+'%'};return _0x3ec302;})});}_0x593145=_[_0xf8ce('0x3e')]({},_0x593145,_0x11f416[_0xf8ce('0x47')]);return _0x46d312[_0xf8ce('0x5a')](_0x593145);}})[_0xf8ce('0x23')](function(_0xc73eb5){if(_0xc73eb5){_0x5c4d53=_0xc73eb5[_0xf8ce('0x37')];if(!_0x11f416[_0xf8ce('0x31')]['hasOwnProperty'](_0xf8ce('0x38'))){_0x593145['limit']=qs['limit'](_0x11f416[_0xf8ce('0x31')][_0xf8ce('0x1d')]);_0x593145['offset']=qs[_0xf8ce('0x1b')](_0x11f416[_0xf8ce('0x31')]['offset']);}return _0x46d312[_0xf8ce('0x5a')](_0x593145);}})['then'](function(_0x38b0ff){if(_0x38b0ff){return _0x38b0ff?{'count':_0x5c4d53,'rows':_0x38b0ff}:null;}})[_0xf8ce('0x23')](respondWithResult(_0x4b767b,null))[_0xf8ce('0x42')](handleError(_0x4b767b,null));};exports[_0xf8ce('0x5b')]=function(_0x508d59,_0x3c9478,_0x4e6a86){if(_0x508d59['body']['id']){delete _0x508d59[_0xf8ce('0x52')]['id'];}return db[_0xf8ce('0x2d')][_0xf8ce('0x48')]({'where':{'id':_0x508d59['params']['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0x3c9478,null))[_0xf8ce('0x23')](function(_0xabf998){if(_0xabf998){_0x508d59[_0xf8ce('0x52')][_0xf8ce('0x5c')]=_0xabf998['id'];return db[_0xf8ce('0x5d')][_0xf8ce('0x49')](_0x508d59[_0xf8ce('0x52')]);}})[_0xf8ce('0x23')](respondWithResult(_0x3c9478,null))[_0xf8ce('0x42')](handleError(_0x3c9478,null));};exports[_0xf8ce('0x5e')]=function(_0x5279f6,_0x2ae6eb,_0x4a9074){var _0x4bc5bc={};var _0x1c73ce={};var _0x4d41fc;var _0x547fb8;return db['Trigger']['findOne']({'where':{'id':_0x5279f6['params']['id']}})[_0xf8ce('0x23')](handleEntityNotFound(_0x2ae6eb,null))[_0xf8ce('0x23')](function(_0x17c209){if(_0x17c209){_0x4d41fc=_0x17c209;_0x1c73ce[_0xf8ce('0x30')]=_['keys'](db['Action'][_0xf8ce('0x45')]);_0x1c73ce[_0xf8ce('0x31')]=_['keys'](_0x5279f6['query']);_0x1c73ce[_0xf8ce('0x33')]=_['intersection'](_0x1c73ce[_0xf8ce('0x30')],_0x1c73ce[_0xf8ce('0x31')]);_0x4bc5bc[_0xf8ce('0x35')]=_['intersection'](_0x1c73ce['model'],qs[_0xf8ce('0x36')](_0x5279f6[_0xf8ce('0x31')][_0xf8ce('0x36')]));_0x4bc5bc['attributes']=_0x4bc5bc[_0xf8ce('0x35')][_0xf8ce('0x37')]?_0x4bc5bc[_0xf8ce('0x35')]:_0x1c73ce[_0xf8ce('0x30')];_0x4bc5bc[_0xf8ce('0x39')]=qs[_0xf8ce('0x3a')](_0x5279f6[_0xf8ce('0x31')][_0xf8ce('0x3a')]);_0x4bc5bc['where']=qs['filters'](_[_0xf8ce('0x3c')](_0x5279f6[_0xf8ce('0x31')],_0x1c73ce['filters']));if(_0x5279f6[_0xf8ce('0x31')]['filter']){_0x4bc5bc[_0xf8ce('0x3b')]=_[_0xf8ce('0x3e')](_0x4bc5bc[_0xf8ce('0x3b')],{'$or':_[_0xf8ce('0x2c')](_0x4bc5bc[_0xf8ce('0x35')],function(_0x17fb9b){var _0x27f598={};_0x27f598[_0x17fb9b]={'$like':'%'+_0x5279f6['query'][_0xf8ce('0x3d')]+'%'};return _0x27f598;})});}_0x4bc5bc=_[_0xf8ce('0x3e')]({},_0x4bc5bc,_0x5279f6[_0xf8ce('0x47')]);return _0x4d41fc['getActions'](_0x4bc5bc);}})[_0xf8ce('0x23')](function(_0x219a09){if(_0x219a09){_0x547fb8=_0x219a09[_0xf8ce('0x37')];if(!_0x5279f6['query'][_0xf8ce('0x5f')](_0xf8ce('0x38'))){_0x4bc5bc['limit']=qs['limit'](_0x5279f6[_0xf8ce('0x31')][_0xf8ce('0x1d')]);_0x4bc5bc[_0xf8ce('0x1b')]=qs['offset'](_0x5279f6[_0xf8ce('0x31')]['offset']);}return _0x4d41fc[_0xf8ce('0x5e')](_0x4bc5bc);}})[_0xf8ce('0x23')](function(_0x57db64){if(_0x57db64){return _0x57db64?{'count':_0x547fb8,'rows':_0x57db64}:null;}})[_0xf8ce('0x23')](respondWithResult(_0x2ae6eb,null))[_0xf8ce('0x42')](handleError(_0x2ae6eb,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index e088593..999744b 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 _0x3fec=['tools_triggers','lodash','api','moment','request-promise','../../config/environment','exports','define','Trigger'];(function(_0x37970c,_0x2c899b){var _0x577f7a=function(_0x44e0d2){while(--_0x44e0d2){_0x37970c['push'](_0x37970c['shift']());}};_0x577f7a(++_0x2c899b);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3fe('0x1'));var moment=require(_0xc3fe('0x2'));var BPromise=require('bluebird');var rp=require(_0xc3fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc3fe('0x4'));var attributes=require('./trigger.attributes');module[_0xc3fe('0x5')]=function(_0x327d2f,_0x22dd19){return _0x327d2f[_0xc3fe('0x6')](_0xc3fe('0x7'),attributes,{'tableName':_0xc3fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc906=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','tools_triggers'];(function(_0x56857c,_0x4868cb){var _0x4027e7=function(_0x1b452f){while(--_0x1b452f){_0x56857c['push'](_0x56857c['shift']());}};_0x4027e7(++_0x4868cb);}(_0xc906,0x1ad));var _0x6c90=function(_0x4d870a,_0x9fcd51){_0x4d870a=_0x4d870a-0x0;var _0xcbaf52=_0xc906[_0x4d870a];return _0xcbaf52;};'use strict';var _=require(_0x6c90('0x0'));var util=require(_0x6c90('0x1'));var logger=require('../../config/logger')(_0x6c90('0x2'));var moment=require(_0x6c90('0x3'));var BPromise=require(_0x6c90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c90('0x5'));var rimraf=require(_0x6c90('0x6'));var config=require(_0x6c90('0x7'));var attributes=require(_0x6c90('0x8'));module[_0x6c90('0x9')]=function(_0x2b55b8,_0x5491d9){return _0x2b55b8['define']('Trigger',attributes,{'tableName':_0x6c90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 3009c9e..cd02515 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 _0x8be6=['ShowTrigger','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x2953f0,_0x436176){var _0x4c4a61=function(_0xef3933){while(--_0xef3933){_0x2953f0['push'](_0x2953f0['shift']());}};_0x4c4a61(++_0x436176);}(_0x8be6,0xb1));var _0x68be=function(_0x1dd712,_0x5064a6){_0x1dd712=_0x1dd712-0x0;var _0x1af645=_0x8be6[_0x1dd712];return _0x1af645;};'use strict';var _=require('lodash');var util=require(_0x68be('0x0'));var moment=require(_0x68be('0x1'));var BPromise=require(_0x68be('0x2'));var rs=require(_0x68be('0x3'));var fs=require('fs');var Redis=require(_0x68be('0x4'));var db=require(_0x68be('0x5'))['db'];var utils=require(_0x68be('0x6'));var logger=require(_0x68be('0x7'))(_0x68be('0x8'));var config=require(_0x68be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x68be('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541a12,_0x1f0972,_0x52d36f){return new BPromise(function(_0x47d51a,_0x18a377){return client[_0x68be('0xb')](_0x541a12,_0x52d36f)[_0x68be('0xc')](function(_0x2e7530){logger[_0x68be('0xd')](_0x68be('0xe'),_0x1f0972,_0x68be('0xf'));logger[_0x68be('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x1f0972,_0x68be('0xf'),JSON[_0x68be('0x11')](_0x2e7530));if(_0x2e7530[_0x68be('0x12')]){if(_0x2e7530[_0x68be('0x12')][_0x68be('0x13')]===0x1f4){logger[_0x68be('0x12')](_0x68be('0xe'),_0x1f0972,_0x2e7530[_0x68be('0x12')]['message']);return _0x18a377(_0x2e7530['error'][_0x68be('0x14')]);}logger['error'](_0x68be('0xe'),_0x1f0972,_0x2e7530[_0x68be('0x12')][_0x68be('0x14')]);return _0x47d51a(_0x2e7530[_0x68be('0x12')]['message']);}else{logger[_0x68be('0xd')](_0x68be('0xe'),_0x1f0972,_0x68be('0xf'));_0x47d51a(_0x2e7530['result'][_0x68be('0x14')]);}})[_0x68be('0x15')](function(_0x47dbd1){logger[_0x68be('0x12')](_0x68be('0xe'),_0x1f0972,_0x47dbd1);_0x18a377(_0x47dbd1);});});}exports[_0x68be('0x16')]=function(_0x386a00){var _0x2084a1=this;return new Promise(function(_0x32ce6c,_0x48e822){return db[_0x68be('0x17')][_0x68be('0x18')]({'raw':_0x386a00[_0x68be('0x19')]?_0x386a00[_0x68be('0x19')][_0x68be('0x1a')]===undefined?!![]:![]:!![],'where':_0x386a00[_0x68be('0x19')]?_0x386a00[_0x68be('0x19')][_0x68be('0x1b')]||null:null,'attributes':_0x386a00['options']?_0x386a00[_0x68be('0x19')][_0x68be('0x1c')]||null:null,'limit':_0x386a00['options']?_0x386a00[_0x68be('0x19')][_0x68be('0x1d')]||null:null,'include':_0x386a00['options']?_0x386a00[_0x68be('0x19')][_0x68be('0x1e')]?_[_0x68be('0x1f')](_0x386a00[_0x68be('0x19')][_0x68be('0x1e')],function(_0x449d12){return{'model':db[_0x449d12[_0x68be('0x20')]],'as':_0x449d12['as'],'attributes':_0x449d12['attributes'],'include':_0x449d12['include']?_[_0x68be('0x1f')](_0x449d12[_0x68be('0x1e')],function(_0x363ecb){return{'model':db[_0x363ecb[_0x68be('0x20')]],'as':_0x363ecb['as'],'attributes':_0x363ecb[_0x68be('0x1c')],'include':_0x363ecb[_0x68be('0x1e')]?_[_0x68be('0x1f')](_0x363ecb[_0x68be('0x1e')],function(_0x2fd779){return{'model':db[_0x2fd779[_0x68be('0x20')]],'as':_0x2fd779['as'],'attributes':_0x2fd779[_0x68be('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x68be('0xc')](function(_0x26498d){logger[_0x68be('0xd')]('GetTrigger',_0x386a00);logger['debug']('GetTrigger',_0x386a00,JSON[_0x68be('0x11')](_0x26498d));_0x32ce6c(_0x26498d);})[_0x68be('0x15')](function(_0x3f190a){logger[_0x68be('0x12')](_0x68be('0x16'),_0x3f190a[_0x68be('0x14')],_0x386a00);_0x48e822(_0x2084a1[_0x68be('0x12')](0x1f4,_0x3f190a[_0x68be('0x14')]));});});};exports[_0x68be('0x21')]=function(_0x45747d){var _0x56ea2b=this;return new Promise(function(_0x133ba4,_0x1ec75d){return db[_0x68be('0x17')][_0x68be('0x22')]({'raw':_0x45747d[_0x68be('0x19')]?_0x45747d['options'][_0x68be('0x1a')]===undefined?!![]:![]:!![],'where':_0x45747d[_0x68be('0x19')]?_0x45747d[_0x68be('0x19')]['where']||null:null,'attributes':_0x45747d['options']?_0x45747d[_0x68be('0x19')][_0x68be('0x1c')]||null:null,'include':_0x45747d[_0x68be('0x19')]?_0x45747d[_0x68be('0x19')]['include']?_['map'](_0x45747d[_0x68be('0x19')][_0x68be('0x1e')],function(_0x1e3819){return{'model':db[_0x1e3819[_0x68be('0x20')]],'as':_0x1e3819['as'],'attributes':_0x1e3819[_0x68be('0x1c')],'include':_0x1e3819[_0x68be('0x1e')]?_[_0x68be('0x1f')](_0x1e3819[_0x68be('0x1e')],function(_0x47b55b){return{'model':db[_0x47b55b[_0x68be('0x20')]],'as':_0x47b55b['as'],'attributes':_0x47b55b[_0x68be('0x1c')],'include':_0x47b55b[_0x68be('0x1e')]?_[_0x68be('0x1f')](_0x47b55b[_0x68be('0x1e')],function(_0x42f35e){return{'model':db[_0x42f35e[_0x68be('0x20')]],'as':_0x42f35e['as'],'attributes':_0x42f35e[_0x68be('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x68be('0xc')](function(_0x4e047c){logger[_0x68be('0xd')](_0x68be('0x21'),_0x45747d);logger[_0x68be('0x10')]('ShowTrigger',_0x45747d,JSON[_0x68be('0x11')](_0x4e047c));_0x133ba4(_0x4e047c);})[_0x68be('0x15')](function(_0x539e92){logger[_0x68be('0x12')]('ShowTrigger',_0x539e92[_0x68be('0x14')],_0x45747d);_0x1ec75d(_0x56ea2b[_0x68be('0x12')](0x1f4,_0x539e92[_0x68be('0x14')]));});});}; \ No newline at end of file +var _0x17b7=['map','include','model','GetTrigger','debug','message','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','catch','Trigger','options','raw','where','attributes'];(function(_0x356d1b,_0x2a9fb7){var _0x4c2ca4=function(_0x4bf366){while(--_0x4bf366){_0x356d1b['push'](_0x356d1b['shift']());}};_0x4c2ca4(++_0x2a9fb7);}(_0x17b7,0x107));var _0x717b=function(_0x3a0669,_0x42c7ff){_0x3a0669=_0x3a0669-0x0;var _0x17c948=_0x17b7[_0x3a0669];return _0x17c948;};'use strict';var _=require(_0x717b('0x0'));var util=require(_0x717b('0x1'));var moment=require(_0x717b('0x2'));var BPromise=require(_0x717b('0x3'));var rs=require(_0x717b('0x4'));var fs=require('fs');var Redis=require(_0x717b('0x5'));var db=require(_0x717b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x717b('0x7'));var config=require('../../config/environment');var jayson=require(_0x717b('0x8'));var client=jayson['client'][_0x717b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ab3c6,_0x2e08db,_0x24cf67){return new BPromise(function(_0x2cf71a,_0x2e4ff0){return client['request'](_0x2ab3c6,_0x24cf67)[_0x717b('0xa')](function(_0x2aeb8d){logger['info'](_0x717b('0xb'),_0x2e08db,_0x717b('0xc'));logger['debug'](_0x717b('0xd'),_0x2e08db,_0x717b('0xc'),JSON[_0x717b('0xe')](_0x2aeb8d));if(_0x2aeb8d[_0x717b('0xf')]){if(_0x2aeb8d[_0x717b('0xf')][_0x717b('0x10')]===0x1f4){logger[_0x717b('0xf')](_0x717b('0xb'),_0x2e08db,_0x2aeb8d[_0x717b('0xf')]['message']);return _0x2e4ff0(_0x2aeb8d['error']['message']);}logger[_0x717b('0xf')](_0x717b('0xb'),_0x2e08db,_0x2aeb8d['error']['message']);return _0x2cf71a(_0x2aeb8d[_0x717b('0xf')]['message']);}else{logger[_0x717b('0x11')](_0x717b('0xb'),_0x2e08db,_0x717b('0xc'));_0x2cf71a(_0x2aeb8d[_0x717b('0x12')]['message']);}})[_0x717b('0x13')](function(_0x44c749){logger[_0x717b('0xf')]('Trigger,\x20%s,\x20%s',_0x2e08db,_0x44c749);_0x2e4ff0(_0x44c749);});});}exports['GetTrigger']=function(_0x1e5b13){var _0x212aa3=this;return new Promise(function(_0x151521,_0x272d30){return db[_0x717b('0x14')]['findAll']({'raw':_0x1e5b13[_0x717b('0x15')]?_0x1e5b13[_0x717b('0x15')][_0x717b('0x16')]===undefined?!![]:![]:!![],'where':_0x1e5b13[_0x717b('0x15')]?_0x1e5b13[_0x717b('0x15')][_0x717b('0x17')]||null:null,'attributes':_0x1e5b13[_0x717b('0x15')]?_0x1e5b13['options'][_0x717b('0x18')]||null:null,'limit':_0x1e5b13[_0x717b('0x15')]?_0x1e5b13[_0x717b('0x15')]['limit']||null:null,'include':_0x1e5b13[_0x717b('0x15')]?_0x1e5b13[_0x717b('0x15')]['include']?_[_0x717b('0x19')](_0x1e5b13['options'][_0x717b('0x1a')],function(_0x57f966){return{'model':db[_0x57f966['model']],'as':_0x57f966['as'],'attributes':_0x57f966[_0x717b('0x18')],'include':_0x57f966[_0x717b('0x1a')]?_[_0x717b('0x19')](_0x57f966['include'],function(_0x264736){return{'model':db[_0x264736[_0x717b('0x1b')]],'as':_0x264736['as'],'attributes':_0x264736[_0x717b('0x18')],'include':_0x264736[_0x717b('0x1a')]?_[_0x717b('0x19')](_0x264736[_0x717b('0x1a')],function(_0x48c060){return{'model':db[_0x48c060[_0x717b('0x1b')]],'as':_0x48c060['as'],'attributes':_0x48c060[_0x717b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x717b('0xa')](function(_0x119355){logger[_0x717b('0x11')](_0x717b('0x1c'),_0x1e5b13);logger[_0x717b('0x1d')](_0x717b('0x1c'),_0x1e5b13,JSON[_0x717b('0xe')](_0x119355));_0x151521(_0x119355);})[_0x717b('0x13')](function(_0x501fa2){logger[_0x717b('0xf')](_0x717b('0x1c'),_0x501fa2[_0x717b('0x1e')],_0x1e5b13);_0x272d30(_0x212aa3['error'](0x1f4,_0x501fa2['message']));});});};exports['ShowTrigger']=function(_0x59a091){var _0x406a5e=this;return new Promise(function(_0x108370,_0x2200fc){return db[_0x717b('0x14')][_0x717b('0x1f')]({'raw':_0x59a091['options']?_0x59a091['options']['raw']===undefined?!![]:![]:!![],'where':_0x59a091[_0x717b('0x15')]?_0x59a091[_0x717b('0x15')][_0x717b('0x17')]||null:null,'attributes':_0x59a091[_0x717b('0x15')]?_0x59a091['options'][_0x717b('0x18')]||null:null,'include':_0x59a091[_0x717b('0x15')]?_0x59a091[_0x717b('0x15')][_0x717b('0x1a')]?_[_0x717b('0x19')](_0x59a091[_0x717b('0x15')][_0x717b('0x1a')],function(_0x43377c){return{'model':db[_0x43377c[_0x717b('0x1b')]],'as':_0x43377c['as'],'attributes':_0x43377c[_0x717b('0x18')],'include':_0x43377c[_0x717b('0x1a')]?_[_0x717b('0x19')](_0x43377c[_0x717b('0x1a')],function(_0x3c29b4){return{'model':db[_0x3c29b4['model']],'as':_0x3c29b4['as'],'attributes':_0x3c29b4[_0x717b('0x18')],'include':_0x3c29b4[_0x717b('0x1a')]?_[_0x717b('0x19')](_0x3c29b4[_0x717b('0x1a')],function(_0x37dbc5){return{'model':db[_0x37dbc5[_0x717b('0x1b')]],'as':_0x37dbc5['as'],'attributes':_0x37dbc5[_0x717b('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xed343e){logger[_0x717b('0x11')]('ShowTrigger',_0x59a091);logger[_0x717b('0x1d')]('ShowTrigger',_0x59a091,JSON['stringify'](_0xed343e));_0x108370(_0xed343e);})[_0x717b('0x13')](function(_0x36f95a){logger[_0x717b('0xf')]('ShowTrigger',_0x36f95a[_0x717b('0x1e')],_0x59a091);_0x2200fc(_0x406a5e[_0x717b('0xf')](0x1f4,_0x36f95a[_0x717b('0x1e')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 0ba63c3..2eced35 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 _0x30a6=['isAuthenticated','index','get','/:id','post','/:id/clone','clone','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller'];(function(_0x35a3da,_0x286c6a){var _0x568a40=function(_0x4afc63){while(--_0x4afc63){_0x35a3da['push'](_0x35a3da['shift']());}};_0x568a40(++_0x286c6a);}(_0x30a6,0x16c));var _0x630a=function(_0x3e59c2,_0x5aad93){_0x3e59c2=_0x3e59c2-0x0;var _0x2176b4=_0x30a6[_0x3e59c2];return _0x2176b4;};'use strict';var multer=require('multer');var util=require(_0x630a('0x0'));var path=require(_0x630a('0x1'));var timeout=require(_0x630a('0x2'));var express=require(_0x630a('0x3'));var router=express[_0x630a('0x4')]();var fs_extra=require(_0x630a('0x5'));var auth=require(_0x630a('0x6'));var interaction=require(_0x630a('0x7'));var config=require(_0x630a('0x8'));var controller=require(_0x630a('0x9'));router['get']('/',auth[_0x630a('0xa')](),controller[_0x630a('0xb')]);router[_0x630a('0xc')](_0x630a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x630a('0xe')](_0x630a('0xf'),auth[_0x630a('0xa')](),controller[_0x630a('0x10')]);router['post']('/',auth[_0x630a('0xa')](),controller[_0x630a('0x11')]);router['put'](_0x630a('0xd'),auth['isAuthenticated'](),controller[_0x630a('0x12')]);router[_0x630a('0x13')]('/:id',auth[_0x630a('0xa')](),controller[_0x630a('0x14')]);module[_0x630a('0x15')]=router; \ No newline at end of file +var _0x7d35=['/:id','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','show','/:id/clone','clone','post','create','put'];(function(_0x559b69,_0x5b98bd){var _0x2ff0eb=function(_0x1caab1){while(--_0x1caab1){_0x559b69['push'](_0x559b69['shift']());}};_0x2ff0eb(++_0x5b98bd);}(_0x7d35,0x153));var _0x57d3=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x7d35[_0x5235dd];return _0x13059d;};'use strict';var multer=require('multer');var util=require(_0x57d3('0x0'));var path=require(_0x57d3('0x1'));var timeout=require(_0x57d3('0x2'));var express=require(_0x57d3('0x3'));var router=express[_0x57d3('0x4')]();var fs_extra=require(_0x57d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x57d3('0x6'));var config=require(_0x57d3('0x7'));var controller=require(_0x57d3('0x8'));router[_0x57d3('0x9')]('/',auth[_0x57d3('0xa')](),controller[_0x57d3('0xb')]);router[_0x57d3('0x9')]('/:id',auth[_0x57d3('0xa')](),controller[_0x57d3('0xc')]);router['post'](_0x57d3('0xd'),auth[_0x57d3('0xa')](),controller[_0x57d3('0xe')]);router[_0x57d3('0xf')]('/',auth[_0x57d3('0xa')](),controller[_0x57d3('0x10')]);router[_0x57d3('0x11')](_0x57d3('0x12'),auth['isAuthenticated'](),controller[_0x57d3('0x13')]);router[_0x57d3('0x14')](_0x57d3('0x12'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 8226c80..62b9451 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 _0x3d14=['never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','BOOLEAN','name','ENUM','user','peer','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB','udp','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','update','force_rport,comedia','join','nat','all','setDataValue','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x3d14,0xd1));var _0x43d1=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x3d14[_0x1e1965];return _0x1a2e96;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x43d1('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x43d1('0x1')]('friend',_0x43d1('0x2'),_0x43d1('0x3')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x43d1('0x4')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x43d1('0x5'),_0x43d1('0x6'),_0x43d1('0x7'),_0x43d1('0x8'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x43d1('0x9'))},'deny':{'type':Sequelize[_0x43d1('0x4')]},'permit':{'type':Sequelize[_0x43d1('0x4')]},'secret':{'type':Sequelize[_0x43d1('0x4')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x43d1('0x4')]},'transport':{'type':Sequelize[_0x43d1('0x4')],'defaultValue':_0x43d1('0xa'),'set':function(_0x1ebb24){this['setDataValue'](_0x43d1('0xb'),_0x1ebb24?_0x1ebb24['join'](','):null);},'get':function(){return this[_0x43d1('0xc')](_0x43d1('0xb'))?this[_0x43d1('0xc')](_0x43d1('0xb'))[_0x43d1('0xd')](','):null;},'comment':_0x43d1('0xe')},'dtmfmode':{'type':Sequelize['ENUM'](_0x43d1('0xf'),_0x43d1('0x10'),_0x43d1('0x11'),'inband',_0x43d1('0x12')),'defaultValue':_0x43d1('0xf')},'directmedia':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no','nonat',_0x43d1('0x14'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x43d1('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x43d1('0x4')]},'nat':{'type':Sequelize[_0x43d1('0x4')],'defaultValue':_0x43d1('0x15'),'set':function(_0x10038c){this['setDataValue']('nat',_0x10038c?_0x10038c[_0x43d1('0x16')](','):null);},'get':function(){return this[_0x43d1('0xc')](_0x43d1('0x17'))?this[_0x43d1('0xc')](_0x43d1('0x17'))[_0x43d1('0xd')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x43d1('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x43d1('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x43d1('0x4')]},'language':{'type':Sequelize[_0x43d1('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x43d1('0x4')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x43d1('0x4')],'defaultValue':_0x43d1('0x18')},'allow':{'type':Sequelize[_0x43d1('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2a60e5){this[_0x43d1('0x19')](_0x43d1('0x1a'),_0x2a60e5?_0x2a60e5[_0x43d1('0x16')](';'):_0x43d1('0x1b'));},'get':function(){return this[_0x43d1('0xc')](_0x43d1('0x1a'))?this['getDataValue'](_0x43d1('0x1a'))[_0x43d1('0xd')](';'):null;},'comment':_0x43d1('0x1c')},'autoframing':{'type':Sequelize[_0x43d1('0x1')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x43d1('0x1d'),'set':function(_0x10357a){this[_0x43d1('0x19')](_0x43d1('0x1e'),_0x10357a?_0x10357a['join'](','):null);},'get':function(){return this[_0x43d1('0xc')](_0x43d1('0x1e'))?this['getDataValue']('insecure')[_0x43d1('0xd')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x43d1('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no',_0x43d1('0x1f'))},'promiscredir':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'useclientcode':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'accountcode':{'type':Sequelize[_0x43d1('0x20')](0xb)},'setvar':{'type':Sequelize[_0x43d1('0x4')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x43d1('0x21')},'amaflags':{'type':Sequelize[_0x43d1('0x4')]},'callcounter':{'type':Sequelize[_0x43d1('0x1')]('yes','no'),'defaultValue':_0x43d1('0x13')},'busylevel':{'type':Sequelize[_0x43d1('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x43d1('0x4')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x43d1('0x13'),'no',_0x43d1('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x43d1('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x23'),_0x43d1('0x24'),_0x43d1('0x25'))},'session_expires':{'type':Sequelize[_0x43d1('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x43d1('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x43d1('0x1')]('uac',_0x43d1('0x26')),'defaultValue':_0x43d1('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0x43d1('0x4')]},'regexten':{'type':Sequelize[_0x43d1('0x4')]},'fromdomain':{'type':Sequelize[_0x43d1('0x4')]},'fromuser':{'type':Sequelize[_0x43d1('0x4')]},'port':{'type':Sequelize[_0x43d1('0x20')](0x5)},'qualify':{'type':Sequelize[_0x43d1('0x1')]('yes','no'),'defaultValue':_0x43d1('0x13')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x43d1('0x4')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x43d1('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x43d1('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x43d1('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x43d1('0x1')]('yes','no',_0x43d1('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x43d1('0x20')](0xb)},'qualifyfreq':{'type':Sequelize[_0x43d1('0x20')](0xb)},'contactpermit':{'type':Sequelize[_0x43d1('0x4')]},'contactdeny':{'type':Sequelize[_0x43d1('0x4')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x43d1('0x20')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'force_avp':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'icesupport':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no',_0x43d1('0x28'),_0x43d1('0x29'))},'dtlsrekey':{'type':Sequelize[_0x43d1('0x20')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x43d1('0x4')]},'dtlscipher':{'type':Sequelize[_0x43d1('0x4')]},'dtlscafile':{'type':Sequelize[_0x43d1('0x4')]},'dtlscapath':{'type':Sequelize[_0x43d1('0x4')]},'dtlssetup':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x2a'),_0x43d1('0x2b'),_0x43d1('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x43d1('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x43d1('0x4')]},'call_limit':{'type':Sequelize[_0x43d1('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x43d1('0x13'),'no')},'vmexten':{'type':Sequelize[_0x43d1('0x4')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x43d1('0x4')]},'parkinglot':{'type':Sequelize[_0x43d1('0x4')]},'description':{'type':Sequelize[_0x43d1('0x4')]},'host':{'type':Sequelize[_0x43d1('0x4')],'defaultValue':_0x43d1('0x2d')},'canreinvite':{'type':Sequelize[_0x43d1('0x1')](_0x43d1('0x13'),'no',_0x43d1('0x2e'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x43d1('0x4')]},'otherFields':{'type':Sequelize[_0x43d1('0x4')]},'active':{'type':Sequelize[_0x43d1('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x43d1('0x4')],'defaultValue':'no'}}; \ No newline at end of file +var _0x358a=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','join','getDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','certificate','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','ENUM','friend','user','peer','from-voip-provider'];(function(_0x2f61db,_0x471081){var _0x2e5699=function(_0x33cda6){while(--_0x33cda6){_0x2f61db['push'](_0x2f61db['shift']());}};_0x2e5699(++_0x471081);}(_0x358a,0xcc));var _0xa358=function(_0x534e1a,_0x4e4b1b){_0x534e1a=_0x534e1a-0x0;var _0x1c87e5=_0x358a[_0x534e1a];return _0x1c87e5;};'use strict';var Sequelize=require(_0xa358('0x0'));module[_0xa358('0x1')]={'name':{'type':Sequelize[_0xa358('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x4'),_0xa358('0x5'),_0xa358('0x6')),'allowNull':![],'defaultValue':_0xa358('0x4')},'context':{'type':Sequelize[_0xa358('0x2')],'allowNull':![],'defaultValue':_0xa358('0x7')},'callingpres':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x8'),_0xa358('0x9'),'ALLOWED_FAILED_SCREEN',_0xa358('0xa'),'PROHIB_NOT_SCREENED',_0xa358('0xb'),_0xa358('0xc'),_0xa358('0xd'))},'deny':{'type':Sequelize[_0xa358('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xa358('0x2')]},'md5secret':{'type':Sequelize[_0xa358('0x2')]},'remotesecret':{'type':Sequelize[_0xa358('0x2')]},'transport':{'type':Sequelize[_0xa358('0x2')],'defaultValue':'udp','set':function(_0x1d02f0){this['setDataValue']('transport',_0x1d02f0?_0x1d02f0['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue'](_0xa358('0xe'))[_0xa358('0xf')](','):null;},'comment':_0xa358('0x10')},'dtmfmode':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x11'),_0xa358('0x12'),_0xa358('0x13'),_0xa358('0x14'),_0xa358('0x15')),'defaultValue':_0xa358('0x11')},'directmedia':{'type':Sequelize['ENUM'](_0xa358('0x16'),'no',_0xa358('0x17'),_0xa358('0x18'),_0xa358('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa358('0x2')]},'directmediadeny':{'type':Sequelize[_0xa358('0x2')]},'nat':{'type':Sequelize[_0xa358('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x47b749){this['setDataValue']('nat',_0x47b749?_0x47b749[_0xa358('0x1a')](','):null);},'get':function(){return this[_0xa358('0x1b')](_0xa358('0x1c'))?this[_0xa358('0x1b')](_0xa358('0x1c'))['split'](','):null;},'comment':_0xa358('0x1d')},'callgroup':{'type':Sequelize[_0xa358('0x2')]},'namedcallgroup':{'type':Sequelize[_0xa358('0x2')]},'pickupgroup':{'type':Sequelize[_0xa358('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa358('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa358('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa358('0x2')],'defaultValue':_0xa358('0x1e')},'allow':{'type':Sequelize[_0xa358('0x2')],'allowNull':![],'defaultValue':_0xa358('0x1f'),'set':function(_0xe9ad0){this[_0xa358('0x20')]('allow',_0xe9ad0?_0xe9ad0[_0xa358('0x1a')](';'):_0xa358('0x1f'));},'get':function(){return this['getDataValue'](_0xa358('0x21'))?this[_0xa358('0x1b')](_0xa358('0x21'))[_0xa358('0xf')](';'):null;},'comment':_0xa358('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0xa358('0x16'),'no')},'insecure':{'type':Sequelize[_0xa358('0x2')],'defaultValue':_0xa358('0x23'),'set':function(_0x54fd77){this[_0xa358('0x20')](_0xa358('0x24'),_0x54fd77?_0x54fd77[_0xa358('0x1a')](','):null);},'get':function(){return this[_0xa358('0x1b')]('insecure')?this[_0xa358('0x1b')]('insecure')[_0xa358('0xf')](','):null;},'comment':_0xa358('0x25')},'trustrpid':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no',_0xa358('0x26'))},'promiscredir':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xa358('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0xa358('0x27')](0xb)},'setvar':{'type':Sequelize[_0xa358('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xa358('0x28')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xa358('0x16'),'no'),'defaultValue':_0xa358('0x16')},'busylevel':{'type':Sequelize[_0xa358('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xa358('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xa358('0x16'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xa358('0x2')]},'videosupport':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no',_0xa358('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xa358('0x16'),'no')},'mailbox':{'type':Sequelize[_0xa358('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0xa358('0x2a'),'refuse',_0xa358('0x2b'))},'session_expires':{'type':Sequelize[_0xa358('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xa358('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xa358('0x2c'),_0xa358('0x2d')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xa358('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xa358('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no'),'defaultValue':_0xa358('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xa358('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa358('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa358('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no',_0xa358('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa358('0x2')]},'callbackextension':{'type':Sequelize[_0xa358('0x2')]},'timert1':{'type':Sequelize[_0xa358('0x27')](0xb)},'timerb':{'type':Sequelize[_0xa358('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0xa358('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xa358('0x2')]},'contactdeny':{'type':Sequelize[_0xa358('0x2')]},'contactacl':{'type':Sequelize[_0xa358('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xa358('0x2')]},'use_q850_reason':{'type':Sequelize[_0xa358('0x2')]},'maxforwards':{'type':Sequelize[_0xa358('0x27')](0xb)},'encryption':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no')},'force_avp':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no')},'icesupport':{'type':Sequelize[_0xa358('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no',_0xa358('0x2f'),_0xa358('0x30'))},'dtlsrekey':{'type':Sequelize[_0xa358('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa358('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xa358('0x2')]},'dtlscafile':{'type':Sequelize[_0xa358('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xa358('0x3')]('active','passive',_0xa358('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa358('0x2')]},'usereqphone':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa358('0x2')]},'recordofffeature':{'type':Sequelize[_0xa358('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xa358('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xa358('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xa358('0x2')]},'parkinglot':{'type':Sequelize[_0xa358('0x2')]},'description':{'type':Sequelize[_0xa358('0x2')]},'host':{'type':Sequelize[_0xa358('0x2')],'defaultValue':_0xa358('0x32')},'canreinvite':{'type':Sequelize[_0xa358('0x3')](_0xa358('0x16'),'no','nonat','update',_0xa358('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa358('0x2')]},'otherFields':{'type':Sequelize[_0xa358('0x2')]},'active':{'type':Sequelize[_0xa358('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa358('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 93edfed..4a39842 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 _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','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','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0xe5b3,0x133));var _0x3e5b=function(_0x440fb7,_0x5eff99){_0x440fb7=_0x440fb7-0x0;var _0x3d1ba1=_0xe5b3[_0x440fb7];return _0x3d1ba1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file +var _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','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','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 98b49f6..faa64a2 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 _0x1ca3=['bluebird','path','rimraf','./trunk.attributes','define','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x1ca3,0x80));var _0x31ca=function(_0x3572e8,_0x498b40){_0x3572e8=_0x3572e8-0x0;var _0x1b36f3=_0x1ca3[_0x3572e8];return _0x1b36f3;};'use strict';var _=require(_0x31ca('0x0'));var util=require(_0x31ca('0x1'));var logger=require(_0x31ca('0x2'))(_0x31ca('0x3'));var moment=require('moment');var BPromise=require(_0x31ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31ca('0x5'));var rimraf=require(_0x31ca('0x6'));var config=require('../../config/environment');var attributes=require(_0x31ca('0x7'));module['exports']=function(_0x1fb4d7,_0x4680cd){return _0x1fb4d7[_0x31ca('0x8')](_0x31ca('0x9'),attributes,{'tableName':_0x31ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb421=['../../config/environment','define','Trunk','tools_trunks','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3daede,_0x1159f7){var _0x1c5298=function(_0x41d059){while(--_0x41d059){_0x3daede['push'](_0x3daede['shift']());}};_0x1c5298(++_0x1159f7);}(_0xb421,0x164));var _0x1b42=function(_0x464549,_0x4cc47a){_0x464549=_0x464549-0x0;var _0x3bd975=_0xb421[_0x464549];return _0x3bd975;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b42('0x0'))(_0x1b42('0x1'));var moment=require(_0x1b42('0x2'));var BPromise=require(_0x1b42('0x3'));var rp=require(_0x1b42('0x4'));var fs=require('fs');var path=require(_0x1b42('0x5'));var rimraf=require(_0x1b42('0x6'));var config=require(_0x1b42('0x7'));var attributes=require('./trunk.attributes');module['exports']=function(_0x5de7de,_0x939708){return _0x5de7de[_0x1b42('0x8')](_0x1b42('0x9'),attributes,{'tableName':_0x1b42('0xa'),'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 ea30b1c..20bd5e7 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 _0x28f4=['limit','include','map','model','attributes','catch','ShowTrunk','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','GetTrunk','Trunk','findAll','raw','options'];(function(_0x5cb3ca,_0x55fd5d){var _0x221ce7=function(_0x263d54){while(--_0x263d54){_0x5cb3ca['push'](_0x5cb3ca['shift']());}};_0x221ce7(++_0x55fd5d);}(_0x28f4,0x1d1));var _0x428f=function(_0x29740c,_0x292062){_0x29740c=_0x29740c-0x0;var _0x3f6b76=_0x28f4[_0x29740c];return _0x3f6b76;};'use strict';var _=require(_0x428f('0x0'));var util=require(_0x428f('0x1'));var moment=require(_0x428f('0x2'));var BPromise=require(_0x428f('0x3'));var rs=require(_0x428f('0x4'));var fs=require('fs');var Redis=require(_0x428f('0x5'));var db=require(_0x428f('0x6'))['db'];var utils=require(_0x428f('0x7'));var logger=require(_0x428f('0x8'))(_0x428f('0x9'));var config=require(_0x428f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x428f('0xb')][_0x428f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20aeb0,_0x41da46,_0xebc009){return new BPromise(function(_0xecebb,_0x434917){return client['request'](_0x20aeb0,_0xebc009)[_0x428f('0xd')](function(_0x10ef4d){logger[_0x428f('0xe')]('Trunk,\x20%s,\x20%s',_0x41da46,'request\x20sent');logger[_0x428f('0xf')](_0x428f('0x10'),_0x41da46,_0x428f('0x11'),JSON[_0x428f('0x12')](_0x10ef4d));if(_0x10ef4d[_0x428f('0x13')]){if(_0x10ef4d[_0x428f('0x13')][_0x428f('0x14')]===0x1f4){logger[_0x428f('0x13')](_0x428f('0x15'),_0x41da46,_0x10ef4d[_0x428f('0x13')]['message']);return _0x434917(_0x10ef4d[_0x428f('0x13')][_0x428f('0x16')]);}logger['error'](_0x428f('0x15'),_0x41da46,_0x10ef4d[_0x428f('0x13')][_0x428f('0x16')]);return _0xecebb(_0x10ef4d[_0x428f('0x13')][_0x428f('0x16')]);}else{logger[_0x428f('0xe')]('Trunk,\x20%s,\x20%s',_0x41da46,_0x428f('0x11'));_0xecebb(_0x10ef4d[_0x428f('0x17')][_0x428f('0x16')]);}})['catch'](function(_0x48762a){logger['error'](_0x428f('0x15'),_0x41da46,_0x48762a);_0x434917(_0x48762a);});});}exports[_0x428f('0x18')]=function(_0x56f043){var _0x3bb3f0=this;return new Promise(function(_0x2dd8e8,_0x35f70f){return db[_0x428f('0x19')][_0x428f('0x1a')]({'raw':_0x56f043['options']?_0x56f043['options'][_0x428f('0x1b')]===undefined?!![]:![]:!![],'where':_0x56f043[_0x428f('0x1c')]?_0x56f043['options']['where']||null:null,'attributes':_0x56f043[_0x428f('0x1c')]?_0x56f043[_0x428f('0x1c')]['attributes']||null:null,'limit':_0x56f043[_0x428f('0x1c')]?_0x56f043['options'][_0x428f('0x1d')]||null:null,'include':_0x56f043[_0x428f('0x1c')]?_0x56f043['options'][_0x428f('0x1e')]?_[_0x428f('0x1f')](_0x56f043[_0x428f('0x1c')]['include'],function(_0x17f030){return{'model':db[_0x17f030[_0x428f('0x20')]],'as':_0x17f030['as'],'attributes':_0x17f030[_0x428f('0x21')],'include':_0x17f030[_0x428f('0x1e')]?_['map'](_0x17f030[_0x428f('0x1e')],function(_0x5a5c21){return{'model':db[_0x5a5c21['model']],'as':_0x5a5c21['as'],'attributes':_0x5a5c21[_0x428f('0x21')],'include':_0x5a5c21[_0x428f('0x1e')]?_[_0x428f('0x1f')](_0x5a5c21['include'],function(_0x4309df){return{'model':db[_0x4309df['model']],'as':_0x4309df['as'],'attributes':_0x4309df[_0x428f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x428f('0xd')](function(_0x45cb2d){logger[_0x428f('0xe')]('GetTrunk',_0x56f043);logger[_0x428f('0xf')](_0x428f('0x18'),_0x56f043,JSON[_0x428f('0x12')](_0x45cb2d));_0x2dd8e8(_0x45cb2d);})[_0x428f('0x22')](function(_0x5aa5a4){logger[_0x428f('0x13')](_0x428f('0x18'),_0x5aa5a4[_0x428f('0x16')],_0x56f043);_0x35f70f(_0x3bb3f0[_0x428f('0x13')](0x1f4,_0x5aa5a4[_0x428f('0x16')]));});});};exports[_0x428f('0x23')]=function(_0x4718b0){var _0x1be21=this;return new Promise(function(_0x1ca073,_0x47dd4d){return db[_0x428f('0x19')][_0x428f('0x24')]({'raw':_0x4718b0[_0x428f('0x1c')]?_0x4718b0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4718b0['options']?_0x4718b0['options'][_0x428f('0x25')]||null:null,'attributes':_0x4718b0['options']?_0x4718b0[_0x428f('0x1c')][_0x428f('0x21')]||null:null,'include':_0x4718b0[_0x428f('0x1c')]?_0x4718b0[_0x428f('0x1c')]['include']?_[_0x428f('0x1f')](_0x4718b0['options'][_0x428f('0x1e')],function(_0x33bcfd){return{'model':db[_0x33bcfd['model']],'as':_0x33bcfd['as'],'attributes':_0x33bcfd['attributes'],'include':_0x33bcfd[_0x428f('0x1e')]?_[_0x428f('0x1f')](_0x33bcfd[_0x428f('0x1e')],function(_0x5a956c){return{'model':db[_0x5a956c[_0x428f('0x20')]],'as':_0x5a956c['as'],'attributes':_0x5a956c[_0x428f('0x21')],'include':_0x5a956c[_0x428f('0x1e')]?_[_0x428f('0x1f')](_0x5a956c[_0x428f('0x1e')],function(_0x82bf54){return{'model':db[_0x82bf54[_0x428f('0x20')]],'as':_0x82bf54['as'],'attributes':_0x82bf54[_0x428f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x428f('0xd')](function(_0x5a8583){logger['info'](_0x428f('0x23'),_0x4718b0);logger[_0x428f('0xf')]('ShowTrunk',_0x4718b0,JSON[_0x428f('0x12')](_0x5a8583));_0x1ca073(_0x5a8583);})[_0x428f('0x22')](function(_0x3e50f3){logger[_0x428f('0x13')](_0x428f('0x23'),_0x3e50f3['message'],_0x4718b0);_0x47dd4d(_0x1be21['error'](0x1f4,_0x3e50f3[_0x428f('0x16')]));});});}; \ No newline at end of file +var _0x411c=['raw','where','attributes','limit','map','include','model','then','stringify','catch','find','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','GetTrunk','Trunk','findAll','options'];(function(_0x50ce27,_0x2cb253){var _0x9d16aa=function(_0x551154){while(--_0x551154){_0x50ce27['push'](_0x50ce27['shift']());}};_0x9d16aa(++_0x2cb253);}(_0x411c,0x1c8));var _0xc411=function(_0x246bdf,_0x119268){_0x246bdf=_0x246bdf-0x0;var _0x35b19f=_0x411c[_0x246bdf];return _0x35b19f;};'use strict';var _=require(_0xc411('0x0'));var util=require(_0xc411('0x1'));var moment=require(_0xc411('0x2'));var BPromise=require(_0xc411('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc411('0x4'));var db=require(_0xc411('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc411('0x6'));var config=require(_0xc411('0x7'));var jayson=require(_0xc411('0x8'));var client=jayson[_0xc411('0x9')][_0xc411('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14bbd2,_0x1ad099,_0xd29043){return new BPromise(function(_0x559a8f,_0x1650d2){return client[_0xc411('0xb')](_0x14bbd2,_0xd29043)['then'](function(_0x2f96b6){logger[_0xc411('0xc')]('Trunk,\x20%s,\x20%s',_0x1ad099,'request\x20sent');logger[_0xc411('0xd')](_0xc411('0xe'),_0x1ad099,_0xc411('0xf'),JSON['stringify'](_0x2f96b6));if(_0x2f96b6[_0xc411('0x10')]){if(_0x2f96b6[_0xc411('0x10')][_0xc411('0x11')]===0x1f4){logger['error'](_0xc411('0x12'),_0x1ad099,_0x2f96b6[_0xc411('0x10')][_0xc411('0x13')]);return _0x1650d2(_0x2f96b6[_0xc411('0x10')][_0xc411('0x13')]);}logger[_0xc411('0x10')](_0xc411('0x12'),_0x1ad099,_0x2f96b6[_0xc411('0x10')]['message']);return _0x559a8f(_0x2f96b6['error']['message']);}else{logger[_0xc411('0xc')](_0xc411('0x12'),_0x1ad099,_0xc411('0xf'));_0x559a8f(_0x2f96b6[_0xc411('0x14')][_0xc411('0x13')]);}})['catch'](function(_0x5bedfa){logger[_0xc411('0x10')](_0xc411('0x12'),_0x1ad099,_0x5bedfa);_0x1650d2(_0x5bedfa);});});}exports[_0xc411('0x15')]=function(_0x46e07b){var _0x4dad7b=this;return new Promise(function(_0x201683,_0x5542a8){return db[_0xc411('0x16')][_0xc411('0x17')]({'raw':_0x46e07b[_0xc411('0x18')]?_0x46e07b[_0xc411('0x18')][_0xc411('0x19')]===undefined?!![]:![]:!![],'where':_0x46e07b['options']?_0x46e07b[_0xc411('0x18')][_0xc411('0x1a')]||null:null,'attributes':_0x46e07b['options']?_0x46e07b['options'][_0xc411('0x1b')]||null:null,'limit':_0x46e07b[_0xc411('0x18')]?_0x46e07b['options'][_0xc411('0x1c')]||null:null,'include':_0x46e07b[_0xc411('0x18')]?_0x46e07b['options']['include']?_[_0xc411('0x1d')](_0x46e07b[_0xc411('0x18')]['include'],function(_0x194c2e){return{'model':db[_0x194c2e['model']],'as':_0x194c2e['as'],'attributes':_0x194c2e[_0xc411('0x1b')],'include':_0x194c2e[_0xc411('0x1e')]?_[_0xc411('0x1d')](_0x194c2e['include'],function(_0x1ff315){return{'model':db[_0x1ff315['model']],'as':_0x1ff315['as'],'attributes':_0x1ff315[_0xc411('0x1b')],'include':_0x1ff315[_0xc411('0x1e')]?_[_0xc411('0x1d')](_0x1ff315[_0xc411('0x1e')],function(_0x2c13ad){return{'model':db[_0x2c13ad[_0xc411('0x1f')]],'as':_0x2c13ad['as'],'attributes':_0x2c13ad[_0xc411('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc411('0x20')](function(_0xd5ce8f){logger[_0xc411('0xc')](_0xc411('0x15'),_0x46e07b);logger[_0xc411('0xd')](_0xc411('0x15'),_0x46e07b,JSON[_0xc411('0x21')](_0xd5ce8f));_0x201683(_0xd5ce8f);})[_0xc411('0x22')](function(_0x3e062f){logger[_0xc411('0x10')](_0xc411('0x15'),_0x3e062f[_0xc411('0x13')],_0x46e07b);_0x5542a8(_0x4dad7b[_0xc411('0x10')](0x1f4,_0x3e062f[_0xc411('0x13')]));});});};exports['ShowTrunk']=function(_0x4ee270){var _0x20b025=this;return new Promise(function(_0x56017e,_0x55633a){return db[_0xc411('0x16')][_0xc411('0x23')]({'raw':_0x4ee270[_0xc411('0x18')]?_0x4ee270[_0xc411('0x18')][_0xc411('0x19')]===undefined?!![]:![]:!![],'where':_0x4ee270['options']?_0x4ee270[_0xc411('0x18')][_0xc411('0x1a')]||null:null,'attributes':_0x4ee270[_0xc411('0x18')]?_0x4ee270[_0xc411('0x18')][_0xc411('0x1b')]||null:null,'include':_0x4ee270[_0xc411('0x18')]?_0x4ee270[_0xc411('0x18')][_0xc411('0x1e')]?_[_0xc411('0x1d')](_0x4ee270[_0xc411('0x18')][_0xc411('0x1e')],function(_0x31adfe){return{'model':db[_0x31adfe['model']],'as':_0x31adfe['as'],'attributes':_0x31adfe[_0xc411('0x1b')],'include':_0x31adfe[_0xc411('0x1e')]?_[_0xc411('0x1d')](_0x31adfe[_0xc411('0x1e')],function(_0xbbfe4b){return{'model':db[_0xbbfe4b[_0xc411('0x1f')]],'as':_0xbbfe4b['as'],'attributes':_0xbbfe4b[_0xc411('0x1b')],'include':_0xbbfe4b['include']?_[_0xc411('0x1d')](_0xbbfe4b[_0xc411('0x1e')],function(_0x1f1803){return{'model':db[_0x1f1803[_0xc411('0x1f')]],'as':_0x1f1803['as'],'attributes':_0x1f1803[_0xc411('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc411('0x20')](function(_0xedc30){logger['info']('ShowTrunk',_0x4ee270);logger['debug'](_0xc411('0x24'),_0x4ee270,JSON['stringify'](_0xedc30));_0x56017e(_0xedc30);})[_0xc411('0x22')](function(_0x4f87de){logger['error'](_0xc411('0x24'),_0x4f87de[_0xc411('0x13')],_0x4ee270);_0x55633a(_0x20b025[_0xc411('0x10')](0x1f4,_0x4f87de[_0xc411('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index ee8573a..b6f65f7 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 _0xf328=['isAuthenticated','update','exports','../../components/auth/service','put','/:id'];(function(_0x5ebec4,_0x474731){var _0x3b9d3b=function(_0x3aa9da){while(--_0x3aa9da){_0x5ebec4['push'](_0x5ebec4['shift']());}};_0x3b9d3b(++_0x474731);}(_0xf328,0x1a7));var _0x8f32=function(_0x1cacea,_0x4dbc0c){_0x1cacea=_0x1cacea-0x0;var _0xb5ff9a=_0xf328[_0x1cacea];return _0xb5ff9a;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x8f32('0x0'));var controller=require('./user-setting.controller');router[_0x8f32('0x1')](_0x8f32('0x2'),auth[_0x8f32('0x3')](),controller[_0x8f32('0x4')]);module[_0x8f32('0x5')]=router; \ No newline at end of file +var _0x6d3e=['update','exports','express','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0x6d3e,0x9a));var _0xe6d3=function(_0x2041a4,_0x55946d){_0x2041a4=_0x2041a4-0x0;var _0x5464b8=_0x6d3e[_0x2041a4];return _0x5464b8;};'use strict';var express=require(_0xe6d3('0x0'));var router=express['Router']();var auth=require(_0xe6d3('0x1'));var controller=require(_0xe6d3('0x2'));router[_0xe6d3('0x3')](_0xe6d3('0x4'),auth[_0xe6d3('0x5')](),controller[_0xe6d3('0x6')]);module[_0xe6d3('0x7')]=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 15d206b..7946fac 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 _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0x2c8b6a,_0x52045c){var _0x56b9bf=function(_0x596c85){while(--_0x596c85){_0x2c8b6a['push'](_0x2c8b6a['shift']());}};_0x56b9bf(++_0x52045c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xa9e0=['exports','BOOLEAN','DATE','sequelize','error','warning'];(function(_0x1c8adc,_0x534fa0){var _0x405d75=function(_0x425dfd){while(--_0x425dfd){_0x1c8adc['push'](_0x1c8adc['shift']());}};_0x405d75(++_0x534fa0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0a9e('0x1'),_0x0a9e('0x2'),'info','debug'];module[_0x0a9e('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0a9e('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':!![],'defaultValue':null}}; \ 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 31e338c..6363741 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 _0x3b75=['socket.io-emitter','./user-setting.socket','redis','defaults','localhost','status','json','then','sendStatus','error','stack','name','send','update','user','params','Invalid\x20user\x20setting\x20id','UserSetting','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0x3b75,0xdc));var _0x53b7=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x3b75[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0x53b7('0x0'));var Redis=require(_0x53b7('0x1'));var logger=require(_0x53b7('0x2'))(_0x53b7('0x3'));var config=require(_0x53b7('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x53b7('0x5'))(new Redis(config['redis']));require(_0x53b7('0x6'))['register'](socket);config[_0x53b7('0x7')]=_[_0x53b7('0x8')](config[_0x53b7('0x7')],{'host':_0x53b7('0x9'),'port':0x18eb});function respondWithResult(_0x7e5139,_0x5ee630){_0x5ee630=_0x5ee630||0xc8;return function(_0x1f89b7){if(_0x1f89b7){return _0x7e5139[_0x53b7('0xa')](_0x5ee630)[_0x53b7('0xb')](_0x1f89b7);}};}function saveUpdates(_0x509608){return function(_0x1f438f){if(_0x1f438f){return _0x1f438f['update'](_0x509608)[_0x53b7('0xc')](function(_0x3b358e){return _0x3b358e;});}return null;};}function handleEntityNotFound(_0x2fa631){return function(_0x3dae32){if(!_0x3dae32){_0x2fa631[_0x53b7('0xd')](0x194);}return _0x3dae32;};}function handleError(_0x5438cb,_0x387f1e){_0x387f1e=_0x387f1e||0x1f4;return function(_0x340aba){logger[_0x53b7('0xe')](_0x340aba[_0x53b7('0xf')]);if(_0x340aba[_0x53b7('0x10')]){delete _0x340aba[_0x53b7('0x10')];}_0x5438cb[_0x53b7('0xa')](_0x387f1e)[_0x53b7('0x11')](_0x340aba);};}exports[_0x53b7('0x12')]=function(_0x47a9e6,_0xee6476){if(_0x47a9e6[_0x53b7('0x13')]['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x47a9e6[_0x53b7('0x14')]['id'])))throw new Error(_0x53b7('0x15'));return db[_0x53b7('0x16')]['find']({'where':{'id':_0x47a9e6[_0x53b7('0x14')]['id']}})[_0x53b7('0xc')](handleEntityNotFound(_0xee6476,null))[_0x53b7('0xc')](saveUpdates(_0x47a9e6[_0x53b7('0x17')],null))[_0x53b7('0xc')](respondWithResult(_0xee6476,null))[_0x53b7('0x18')](handleError(_0xee6476,null));}; \ No newline at end of file +var _0x9335=['find','params','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','json','update','then','sendStatus','error','name','status','send','role','Unauthorized','Invalid\x20user\x20setting\x20id'];(function(_0x4a6c57,_0x3f0b2c){var _0x29b5cf=function(_0x119272){while(--_0x119272){_0x4a6c57['push'](_0x4a6c57['shift']());}};_0x29b5cf(++_0x3f0b2c);}(_0x9335,0xab));var _0x5933=function(_0x3e1896,_0x499855){_0x3e1896=_0x3e1896-0x0;var _0xace977=_0x9335[_0x3e1896];return _0xace977;};'use strict';var _=require(_0x5933('0x0'));var Redis=require(_0x5933('0x1'));var logger=require('../../config/logger')(_0x5933('0x2'));var config=require(_0x5933('0x3'));var db=require(_0x5933('0x4'))['db'];var socket=require(_0x5933('0x5'))(new Redis(config[_0x5933('0x6')]));require(_0x5933('0x7'))[_0x5933('0x8')](socket);config['redis']=_[_0x5933('0x9')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x21f4c1,_0x3f15fc){_0x3f15fc=_0x3f15fc||0xc8;return function(_0x21ab46){if(_0x21ab46){return _0x21f4c1['status'](_0x3f15fc)[_0x5933('0xa')](_0x21ab46);}};}function saveUpdates(_0x953859){return function(_0x412540){if(_0x412540){return _0x412540[_0x5933('0xb')](_0x953859)[_0x5933('0xc')](function(_0x18860c){return _0x18860c;});}return null;};}function handleEntityNotFound(_0x23758b){return function(_0x8ea55a){if(!_0x8ea55a){_0x23758b[_0x5933('0xd')](0x194);}return _0x8ea55a;};}function handleError(_0x2df73c,_0x27b823){_0x27b823=_0x27b823||0x1f4;return function(_0xa3fa86){logger[_0x5933('0xe')](_0xa3fa86['stack']);if(_0xa3fa86[_0x5933('0xf')]){delete _0xa3fa86['name'];}_0x2df73c[_0x5933('0x10')](_0x27b823)[_0x5933('0x11')](_0xa3fa86);};}exports[_0x5933('0xb')]=function(_0x4e817c,_0x104825){if(_0x4e817c['user'][_0x5933('0x12')]!=='admin')throw new Error(_0x5933('0x13'));if(isNaN(Number(_0x4e817c['params']['id'])))throw new Error(_0x5933('0x14'));return db['UserSetting'][_0x5933('0x15')]({'where':{'id':_0x4e817c[_0x5933('0x16')]['id']}})[_0x5933('0xc')](handleEntityNotFound(_0x104825,null))['then'](saveUpdates(_0x4e817c['body'],null))[_0x5933('0xc')](respondWithResult(_0x104825,null))[_0x5933('0x17')](handleError(_0x104825,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 872fbf0..e9b7342 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 _0x8fff=['update','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x370499,_0xd7eb21){var _0x12205e=function(_0x2d4da4){while(--_0x2d4da4){_0x370499['push'](_0x370499['shift']());}};_0x12205e(++_0xd7eb21);}(_0x8fff,0xb1));var _0xf8ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8fff[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf8ff('0x0'));var UserSetting=require(_0xf8ff('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xf8ff('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf8ff('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6390d3){return function(_0x3a536a,_0x3c14b7,_0x4475c9){UserSettingEvents[_0xf8ff('0x4')](_0x6390d3+':'+_0x3a536a['id'],_0x3a536a);UserSettingEvents[_0xf8ff('0x4')](_0x6390d3,_0x3a536a);_0x4475c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xf8ff('0x5')]=UserSettingEvents; \ No newline at end of file +var _0x1fd7=['remove','emit','hasOwnProperty','../../mysqldb','UserSetting','update'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x1fd7,0x9f));var _0x71fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1fd7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x71fd('0x0'))['db'][_0x71fd('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x71fd('0x2'),'afterDestroy':_0x71fd('0x3')};function emitEvent(_0x2b0566){return function(_0x131935,_0x1e27e8,_0x5e6d08){UserSettingEvents[_0x71fd('0x4')](_0x2b0566+':'+_0x131935['id'],_0x131935);UserSettingEvents[_0x71fd('0x4')](_0x2b0566,_0x131935);_0x5e6d08(null);};}for(var e in events){if(events[_0x71fd('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=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 c977a36..83ae734 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 _0xae2b=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x5458b0,_0x1db8d5){var _0x5fcbee=function(_0x3c4910){while(--_0x3c4910){_0x5458b0['push'](_0x5458b0['shift']());}};_0x5fcbee(++_0x1db8d5);}(_0xae2b,0xb3));var _0xbae2=function(_0x36e7cd,_0x1ba216){_0x36e7cd=_0x36e7cd-0x0;var _0x506013=_0xae2b[_0x36e7cd];return _0x506013;};'use strict';var attributes=require(_0xbae2('0x0'));module[_0xbae2('0x1')]=function(_0x55ac17){return _0x55ac17[_0xbae2('0x2')](_0xbae2('0x3'),attributes,{'tableName':_0xbae2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x214f0e){if(!_0x214f0e[_0xbae2('0x5')])_0x214f0e[_0xbae2('0x6')]=null;else if(_0x214f0e['clientSideLoggingEnabledSince']===null)_0x214f0e[_0xbae2('0x6')]=new Date();}}});}; \ No newline at end of file +var _0xcbe1=['clientSideLoggingEnabledSince','exports','clientSideLoggingEnabled'];(function(_0x4ea44b,_0x546b89){var _0x418cc9=function(_0x1eb1e5){while(--_0x1eb1e5){_0x4ea44b['push'](_0x4ea44b['shift']());}};_0x418cc9(++_0x546b89);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x5ad60a,_0x5262c5){_0x5ad60a=_0x5ad60a-0x0;var _0x266de2=_0xcbe1[_0x5ad60a];return _0x266de2;};'use strict';var attributes=require('./user-setting.attributes');module[_0x1cbe('0x0')]=function(_0x5bfe68){return _0x5bfe68['define']('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e51c7){if(!_0x2e51c7[_0x1cbe('0x1')])_0x2e51c7['clientSideLoggingEnabledSince']=null;else if(_0x2e51c7[_0x1cbe('0x2')]===null)_0x2e51c7['clientSideLoggingEnabledSince']=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 124dc2c..a083c35 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 _0x8229=['register','length','user-setting:','./user-setting.events','save','emit','user-setting:update:user-','userId'];(function(_0xc45596,_0x5c410e){var _0x425ffe=function(_0x3c327d){while(--_0x3c327d){_0xc45596['push'](_0xc45596['shift']());}};_0x425ffe(++_0x5c410e);}(_0x8229,0xbb));var _0x9822=function(_0x4ddf3f,_0x4fc403){_0x4ddf3f=_0x4ddf3f-0x0;var _0x8dcceb=_0x8229[_0x4ddf3f];return _0x8dcceb;};'use strict';var UserSettingEvents=require(_0x9822('0x0'));var events=[_0x9822('0x1'),'remove','update'];function createListener(_0x579328,_0x151ffa){return function(_0x28c4ae){_0x151ffa[_0x9822('0x2')](_0x579328,_0x28c4ae);if(_0x579328==='user-setting:update'){_0x151ffa[_0x9822('0x2')](_0x9822('0x3')+_0x28c4ae[_0x9822('0x4')],_0x28c4ae);}};}exports[_0x9822('0x5')]=function(_0x561c18){for(var _0xe4603=0x0,_0x2a97d3=events[_0x9822('0x6')];_0xe4603<_0x2a97d3;_0xe4603++){var _0xca689f=events[_0xe4603];var _0x2f0fa5=createListener(_0x9822('0x7')+_0xca689f,_0x561c18);UserSettingEvents['on'](_0xca689f,_0x2f0fa5);}}; \ No newline at end of file +var _0xe55c=['userId','length','user-setting:','save','remove','update','emit','user-setting:update:user-'];(function(_0xa210ad,_0x413117){var _0x50d86f=function(_0xbad56e){while(--_0xbad56e){_0xa210ad['push'](_0xa210ad['shift']());}};_0x50d86f(++_0x413117);}(_0xe55c,0xfb));var _0xce55=function(_0x58d1f5,_0x53486e){_0x58d1f5=_0x58d1f5-0x0;var _0x29f435=_0xe55c[_0x58d1f5];return _0x29f435;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xce55('0x0'),_0xce55('0x1'),_0xce55('0x2')];function createListener(_0x26d89c,_0x221b4){return function(_0x4c39cd){_0x221b4[_0xce55('0x3')](_0x26d89c,_0x4c39cd);if(_0x26d89c==='user-setting:update'){_0x221b4['emit'](_0xce55('0x4')+_0x4c39cd[_0xce55('0x5')],_0x4c39cd);}};}exports['register']=function(_0x4736fc){for(var _0x45cef8=0x0,_0x5d3cce=events[_0xce55('0x6')];_0x45cef8<_0x5d3cce;_0x45cef8++){var _0x78717b=events[_0x45cef8];var _0x3a277c=createListener(_0xce55('0x7')+_0x78717b,_0x4736fc);UserSettingEvents['on'](_0x78717b,_0x3a277c);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 5d67f56..d0d9648 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 _0x8e67=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getWhatsappAccounts','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','single','addAvatar','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','addSquareProjects','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','multer'];(function(_0x2e0f37,_0x261f54){var _0x2302bc=function(_0x51854a){while(--_0x51854a){_0x2e0f37['push'](_0x2e0f37['shift']());}};_0x2302bc(++_0x261f54);}(_0x8e67,0x73));var _0x78e6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8e67[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x78e6('0x0'));var util=require(_0x78e6('0x1'));var path=require(_0x78e6('0x2'));var timeout=require(_0x78e6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x78e6('0x4'));var auth=require(_0x78e6('0x5'));var interaction=require(_0x78e6('0x6'));var config=require(_0x78e6('0x7'));var controller=require(_0x78e6('0x8'));router[_0x78e6('0x9')]('/',auth[_0x78e6('0xa')](),controller[_0x78e6('0xb')]);router['get']('/describe',auth[_0x78e6('0xa')](),controller[_0x78e6('0xc')]);router['get'](_0x78e6('0xd'),auth[_0x78e6('0xa')](),controller['whoami']);router[_0x78e6('0x9')](_0x78e6('0xe'),auth[_0x78e6('0xa')](),controller[_0x78e6('0xf')]);router[_0x78e6('0x9')](_0x78e6('0x10'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x11')]);router[_0x78e6('0x9')](_0x78e6('0x12'),controller[_0x78e6('0x13')]);router[_0x78e6('0x9')](_0x78e6('0x14'),auth[_0x78e6('0xa')](),controller['getOpenTabs']);router[_0x78e6('0x9')](_0x78e6('0x15'),auth[_0x78e6('0xa')](),controller['getContacts']);router[_0x78e6('0x9')](_0x78e6('0x16'),auth['isAuthenticated'](),controller[_0x78e6('0x17')]);router[_0x78e6('0x9')](_0x78e6('0x18'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x19')]);router['get']('/:id/groups',auth[_0x78e6('0xa')](),controller[_0x78e6('0x1a')]);router['get'](_0x78e6('0x1b'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x1c')]);router[_0x78e6('0x9')](_0x78e6('0x1d'),auth[_0x78e6('0xa')](),controller['getScreenRecordings']);router['get'](_0x78e6('0x1e'),auth['isAuthenticated'](),controller[_0x78e6('0x1f')]);router[_0x78e6('0x9')](_0x78e6('0x20'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x21')]);router['get'](_0x78e6('0x22'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x23')]);router[_0x78e6('0x9')]('/:id/sms/interactions',auth[_0x78e6('0xa')](),controller[_0x78e6('0x24')]);router[_0x78e6('0x9')](_0x78e6('0x25'),auth[_0x78e6('0xa')](),controller['getFaxInteractions']);router[_0x78e6('0x9')](_0x78e6('0x26'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x27')]);router['get'](_0x78e6('0x28'),auth['isAuthenticated'](),controller['getTeams']);router[_0x78e6('0x9')](_0x78e6('0x29'),auth['isAuthenticated'](),controller[_0x78e6('0x2a')]);router['get']('/:id/agents',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x78e6('0x2b'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x2c')]);router['get'](_0x78e6('0x2d'),auth['isAuthenticated'](),controller[_0x78e6('0x2e')]);router[_0x78e6('0x9')](_0x78e6('0x2f'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x30')]);router[_0x78e6('0x9')](_0x78e6('0x31'),auth['isAuthenticated'](),controller[_0x78e6('0x32')]);router[_0x78e6('0x9')](_0x78e6('0x33'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x34')]);router[_0x78e6('0x9')](_0x78e6('0x35'),auth[_0x78e6('0xa')](),controller['getChatWebsites']);router[_0x78e6('0x9')]('/:id/whatsapp_accounts',auth[_0x78e6('0xa')](),controller[_0x78e6('0x36')]);router[_0x78e6('0x9')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x78e6('0x37')]);router['get']('/:id/scheduled_calls',auth[_0x78e6('0xa')](),controller[_0x78e6('0x38')]);router[_0x78e6('0x9')](_0x78e6('0x39'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x3a')]);router[_0x78e6('0x3b')]('/:id/contacts',auth[_0x78e6('0xa')](),controller[_0x78e6('0x3c')]);router[_0x78e6('0x3b')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x78e6('0x3d'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x3e')]);router[_0x78e6('0x3b')](_0x78e6('0x16'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x3f')]);var upload=multer({'storage':multer[_0x78e6('0x40')]({'destination':function(_0x1c61ca,_0x9ffd97,_0x4b5e34){_0x4b5e34(null,path[_0x78e6('0x41')](config[_0x78e6('0x42')],'server/files/images/'));},'filename':function(_0x146fdd,_0x937f0,_0x1ec0d2){_0x1ec0d2(null,util[_0x78e6('0x43')](_0x78e6('0x44'),Date[_0x78e6('0x45')](),_0x937f0['originalname']));}})});router[_0x78e6('0x3b')]('/:id/avatar',upload[_0x78e6('0x46')]('file'),controller[_0x78e6('0x47')]);router['post']('/:id/login',auth[_0x78e6('0xa')](),controller[_0x78e6('0x48')]);router[_0x78e6('0x3b')](_0x78e6('0x49'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x4a')]);router[_0x78e6('0x3b')]('/:id/pause',auth[_0x78e6('0xa')](),controller[_0x78e6('0x4b')]);router[_0x78e6('0x3b')](_0x78e6('0x4c'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x4d')]);router[_0x78e6('0x3b')](_0x78e6('0x28'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x4e')]);router[_0x78e6('0x3b')](_0x78e6('0x4f'),auth['isAuthenticated'](),controller[_0x78e6('0x50')]);router[_0x78e6('0x3b')](_0x78e6('0x51'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x52')]);router['post'](_0x78e6('0x53'),auth[_0x78e6('0xa')](),controller['addFaxInteractions']);router['post'](_0x78e6('0x54'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x55')]);router[_0x78e6('0x3b')](_0x78e6('0x56'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x57')]);router[_0x78e6('0x3b')](_0x78e6('0x58'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x59')]);router['post'](_0x78e6('0x2d'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x5a')]);router[_0x78e6('0x3b')](_0x78e6('0x2f'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x5b')]);router[_0x78e6('0x3b')](_0x78e6('0x31'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x5c')]);router[_0x78e6('0x3b')](_0x78e6('0x33'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x5d')]);router[_0x78e6('0x3b')](_0x78e6('0x35'),auth['isAuthenticated'](),controller[_0x78e6('0x5e')]);router[_0x78e6('0x3b')]('/:id/whatsapp_accounts',auth[_0x78e6('0xa')](),controller[_0x78e6('0x5f')]);router[_0x78e6('0x3b')](_0x78e6('0x60'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x61')]);router['post']('/:id/api_key',auth['isAuthenticated'](),controller['createApiKey']);router[_0x78e6('0x62')](_0x78e6('0x10'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x63')]);router[_0x78e6('0x62')](_0x78e6('0x64'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x65')]);router[_0x78e6('0x66')](_0x78e6('0x16'),auth[_0x78e6('0xa')](),controller['removeQueues']);router[_0x78e6('0x66')](_0x78e6('0x28'),auth['isAuthenticated'](),controller[_0x78e6('0x67')]);router[_0x78e6('0x66')](_0x78e6('0x10'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x68')]);router['delete'](_0x78e6('0x4f'),auth[_0x78e6('0xa')](),controller['removeChatInteractions']);router[_0x78e6('0x66')](_0x78e6('0x51'),auth['isAuthenticated'](),controller[_0x78e6('0x69')]);router[_0x78e6('0x66')](_0x78e6('0x53'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x6a')]);router[_0x78e6('0x66')](_0x78e6('0x54'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x6b')]);router[_0x78e6('0x66')](_0x78e6('0x56'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x6c')]);router[_0x78e6('0x66')]('/:id/whatsapp_interactions',auth[_0x78e6('0xa')](),controller[_0x78e6('0x6d')]);router[_0x78e6('0x66')]('/:id/fax_accounts',auth[_0x78e6('0xa')](),controller[_0x78e6('0x6e')]);router[_0x78e6('0x66')](_0x78e6('0x2f'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x6f')]);router[_0x78e6('0x66')](_0x78e6('0x31'),auth['isAuthenticated'](),controller[_0x78e6('0x70')]);router[_0x78e6('0x66')]('/:id/sms_accounts',auth[_0x78e6('0xa')](),controller[_0x78e6('0x71')]);router[_0x78e6('0x66')](_0x78e6('0x35'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x78e6('0x66')]('/:id/whatsapp_accounts',auth[_0x78e6('0xa')](),controller['removeWhatsappAccounts']);router['delete'](_0x78e6('0x60'),auth[_0x78e6('0xa')](),controller['removeSquareProjects']);router['delete'](_0x78e6('0x39'),auth[_0x78e6('0xa')](),controller[_0x78e6('0x72')]);module[_0x78e6('0x73')]=router; \ No newline at end of file +var _0x4378=['/:id/sms/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/:id/queues','addQueues','diskStorage','join','root','format','%s-%s','now','file','addAvatar','/:id/login','logout','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','/:id/chat_websites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions'];(function(_0x3195e2,_0x3c40f4){var _0x2e13cd=function(_0x409e64){while(--_0x409e64){_0x3195e2['push'](_0x3195e2['shift']());}};_0x2e13cd(++_0x3c40f4);}(_0x4378,0x192));var _0x8437=function(_0x2a3ee3,_0x48baed){_0x2a3ee3=_0x2a3ee3-0x0;var _0x39ff57=_0x4378[_0x2a3ee3];return _0x39ff57;};'use strict';var multer=require(_0x8437('0x0'));var util=require(_0x8437('0x1'));var path=require(_0x8437('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8437('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8437('0x4'));var config=require(_0x8437('0x5'));var controller=require('./user.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8437('0x6')]);router[_0x8437('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/whoami',auth[_0x8437('0x8')](),controller['whoami']);router['get'](_0x8437('0x9'),auth[_0x8437('0x8')](),controller['getPresence']);router[_0x8437('0x7')](_0x8437('0xa'),auth[_0x8437('0x8')](),controller[_0x8437('0xb')]);router[_0x8437('0x7')](_0x8437('0xc'),controller[_0x8437('0xd')]);router['get'](_0x8437('0xe'),auth[_0x8437('0x8')](),controller[_0x8437('0xf')]);router[_0x8437('0x7')]('/:id/contacts',auth[_0x8437('0x8')](),controller[_0x8437('0x10')]);router[_0x8437('0x7')]('/:id/queues',auth[_0x8437('0x8')](),controller[_0x8437('0x11')]);router[_0x8437('0x7')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x8437('0x12')]);router['get'](_0x8437('0x13'),auth[_0x8437('0x8')](),controller[_0x8437('0x14')]);router['get'](_0x8437('0x15'),auth['isAuthenticated'](),controller[_0x8437('0x16')]);router[_0x8437('0x7')](_0x8437('0x17'),auth[_0x8437('0x8')](),controller[_0x8437('0x18')]);router[_0x8437('0x7')](_0x8437('0x19'),auth[_0x8437('0x8')](),controller[_0x8437('0x1a')]);router[_0x8437('0x7')](_0x8437('0x1b'),auth[_0x8437('0x8')](),controller[_0x8437('0x1c')]);router[_0x8437('0x7')](_0x8437('0x1d'),auth[_0x8437('0x8')](),controller['getMailInteractions']);router[_0x8437('0x7')](_0x8437('0x1e'),auth[_0x8437('0x8')](),controller['getSmsInteractions']);router[_0x8437('0x7')]('/:id/fax/interactions',auth[_0x8437('0x8')](),controller[_0x8437('0x1f')]);router[_0x8437('0x7')](_0x8437('0x20'),auth[_0x8437('0x8')](),controller['getWhatsappInteractions']);router[_0x8437('0x7')](_0x8437('0x21'),auth['isAuthenticated'](),controller[_0x8437('0x22')]);router['get'](_0x8437('0x23'),auth[_0x8437('0x8')](),controller[_0x8437('0x24')]);router['get'](_0x8437('0x25'),auth[_0x8437('0x8')](),controller['getAgents']);router[_0x8437('0x7')](_0x8437('0x26'),auth['isAuthenticated'](),controller[_0x8437('0x27')]);router[_0x8437('0x7')]('/:id/fax_accounts',auth[_0x8437('0x8')](),controller['getFaxAccounts']);router[_0x8437('0x7')](_0x8437('0x28'),auth[_0x8437('0x8')](),controller[_0x8437('0x29')]);router[_0x8437('0x7')]('/:id/openchannel_accounts',auth[_0x8437('0x8')](),controller['getOpenchannelAccounts']);router[_0x8437('0x7')](_0x8437('0x2a'),auth[_0x8437('0x8')](),controller[_0x8437('0x2b')]);router[_0x8437('0x7')]('/:id/chat_websites',auth[_0x8437('0x8')](),controller[_0x8437('0x2c')]);router[_0x8437('0x7')](_0x8437('0x2d'),auth[_0x8437('0x8')](),controller[_0x8437('0x2e')]);router['get'](_0x8437('0x2f'),auth[_0x8437('0x8')](),controller[_0x8437('0x30')]);router['get'](_0x8437('0x31'),auth[_0x8437('0x8')](),controller[_0x8437('0x32')]);router[_0x8437('0x7')](_0x8437('0x33'),auth[_0x8437('0x8')](),controller[_0x8437('0x34')]);router[_0x8437('0x35')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x8437('0x36')]);router[_0x8437('0x35')]('/',auth['isAuthenticated'](),controller[_0x8437('0x37')]);router[_0x8437('0x35')]('/create_many',auth[_0x8437('0x8')](),controller['bulkCreate']);router[_0x8437('0x35')](_0x8437('0x38'),auth[_0x8437('0x8')](),controller[_0x8437('0x39')]);var upload=multer({'storage':multer[_0x8437('0x3a')]({'destination':function(_0x3f3c4,_0x354bf4,_0x5ebcc7){_0x5ebcc7(null,path[_0x8437('0x3b')](config[_0x8437('0x3c')],'server/files/images/'));},'filename':function(_0x3456ed,_0x105e92,_0x51488b){_0x51488b(null,util[_0x8437('0x3d')](_0x8437('0x3e'),Date[_0x8437('0x3f')](),_0x105e92['originalname']));}})});router[_0x8437('0x35')](_0x8437('0xc'),upload['single'](_0x8437('0x40')),controller[_0x8437('0x41')]);router['post'](_0x8437('0x42'),auth[_0x8437('0x8')](),controller['login']);router['post']('/:id/logout',auth[_0x8437('0x8')](),controller[_0x8437('0x43')]);router[_0x8437('0x35')](_0x8437('0x44'),auth[_0x8437('0x8')](),controller[_0x8437('0x45')]);router[_0x8437('0x35')]('/:id/unpause',auth[_0x8437('0x8')](),controller[_0x8437('0x46')]);router['post'](_0x8437('0x21'),auth[_0x8437('0x8')](),controller[_0x8437('0x47')]);router[_0x8437('0x35')](_0x8437('0x48'),auth[_0x8437('0x8')](),controller['addChatInteractions']);router['post'](_0x8437('0x49'),auth['isAuthenticated'](),controller[_0x8437('0x4a')]);router[_0x8437('0x35')](_0x8437('0x4b'),auth['isAuthenticated'](),controller[_0x8437('0x4c')]);router[_0x8437('0x35')](_0x8437('0x4d'),auth['isAuthenticated'](),controller[_0x8437('0x4e')]);router[_0x8437('0x35')](_0x8437('0x4f'),auth[_0x8437('0x8')](),controller['addOpenchannelInteractions']);router[_0x8437('0x35')](_0x8437('0x50'),auth['isAuthenticated'](),controller[_0x8437('0x51')]);router[_0x8437('0x35')](_0x8437('0x52'),auth['isAuthenticated'](),controller[_0x8437('0x53')]);router['post']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x8437('0x54')]);router[_0x8437('0x35')](_0x8437('0x55'),auth[_0x8437('0x8')](),controller['addOpenchannelAccounts']);router[_0x8437('0x35')](_0x8437('0x2a'),auth[_0x8437('0x8')](),controller['addSmsAccounts']);router[_0x8437('0x35')](_0x8437('0x56'),auth[_0x8437('0x8')](),controller['addChatWebsites']);router[_0x8437('0x35')](_0x8437('0x2d'),auth[_0x8437('0x8')](),controller[_0x8437('0x57')]);router[_0x8437('0x35')]('/:id/square_projects',auth[_0x8437('0x8')](),controller[_0x8437('0x58')]);router['post']('/:id/api_key',auth[_0x8437('0x8')](),controller[_0x8437('0x59')]);router[_0x8437('0x5a')](_0x8437('0xa'),auth[_0x8437('0x8')](),controller[_0x8437('0x5b')]);router[_0x8437('0x5a')](_0x8437('0x5c'),auth[_0x8437('0x8')](),controller['changePassword']);router[_0x8437('0x5d')]('/:id/queues',auth['isAuthenticated'](),controller[_0x8437('0x5e')]);router['delete'](_0x8437('0x21'),auth[_0x8437('0x8')](),controller['removeTeams']);router[_0x8437('0x5d')](_0x8437('0xa'),auth[_0x8437('0x8')](),controller[_0x8437('0x5f')]);router[_0x8437('0x5d')](_0x8437('0x48'),auth[_0x8437('0x8')](),controller[_0x8437('0x60')]);router[_0x8437('0x5d')](_0x8437('0x49'),auth[_0x8437('0x8')](),controller[_0x8437('0x61')]);router['delete']('/:id/fax_interactions',auth[_0x8437('0x8')](),controller[_0x8437('0x62')]);router[_0x8437('0x5d')](_0x8437('0x4d'),auth[_0x8437('0x8')](),controller[_0x8437('0x63')]);router[_0x8437('0x5d')](_0x8437('0x4f'),auth[_0x8437('0x8')](),controller[_0x8437('0x64')]);router['delete'](_0x8437('0x50'),auth[_0x8437('0x8')](),controller[_0x8437('0x65')]);router['delete'](_0x8437('0x52'),auth[_0x8437('0x8')](),controller[_0x8437('0x66')]);router['delete'](_0x8437('0x28'),auth[_0x8437('0x8')](),controller[_0x8437('0x67')]);router[_0x8437('0x5d')](_0x8437('0x55'),auth[_0x8437('0x8')](),controller[_0x8437('0x68')]);router['delete'](_0x8437('0x2a'),auth[_0x8437('0x8')](),controller[_0x8437('0x69')]);router[_0x8437('0x5d')](_0x8437('0x56'),auth[_0x8437('0x8')](),controller['removeChatWebsites']);router['delete'](_0x8437('0x2d'),auth[_0x8437('0x8')](),controller[_0x8437('0x6a')]);router['delete'](_0x8437('0x2f'),auth[_0x8437('0x8')](),controller['removeSquareProjects']);router[_0x8437('0x5d')](_0x8437('0x33'),auth[_0x8437('0x8')](),controller['removeApiKey']);module[_0x8437('0x6b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7c309d3..911a89f 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 _0xaced=['rtcp_mux','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','ENUM','admin','local','INTEGER','accountcode','callerid','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey'];(function(_0x212d2f,_0x5a7a54){var _0x3773ca=function(_0x46777d){while(--_0x46777d){_0x212d2f['push'](_0x212d2f['shift']());}};_0x3773ca(++_0x5a7a54);}(_0xaced,0x18c));var _0xdace=function(_0x2f96a1,_0x43ecce){_0x2f96a1=_0x2f96a1-0x0;var _0x21fae3=_0xaced[_0x2f96a1];return _0x21fae3;};'use strict';var Sequelize=require(_0xdace('0x0'));var moment=require(_0xdace('0x1'));var util=require(_0xdace('0x2'));var _=require(_0xdace('0x3'));module[_0xdace('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdace('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x314ff2){this[_0xdace('0x6')](_0xdace('0x5'),_0x314ff2);this['setDataValue'](_0xdace('0x7'),_0x314ff2);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x198ca1){this[_0xdace('0x6')](_0xdace('0x8'),_0x198ca1);this[_0xdace('0x6')]('callerid',util['format'](_0xdace('0x9'),_0x198ca1,this[_0xdace('0xa')](_0xdace('0xb'))));}},'alias':{'type':Sequelize[_0xdace('0xc')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdace('0xd'),'validate':{'isEmail':!![]},'set':function(_0xf962a6){if(_0xf962a6){this[_0xdace('0x6')](_0xdace('0xd'),_0xf962a6['toLowerCase']());}}},'role':{'type':Sequelize[_0xdace('0xe')](_0xdace('0xf'),'user','agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xdace('0xc')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xdace('0x10')},'internal':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':![],'unique':_0xdace('0xb'),'set':function(_0x41a176){this[_0xdace('0x6')](_0xdace('0xb'),_0x41a176);this['setDataValue'](_0xdace('0x12'),_0x41a176);this['setDataValue'](_0xdace('0x13'),util[_0xdace('0x14')](_0xdace('0x9'),this[_0xdace('0xa')](_0xdace('0x8')),_0x41a176));}},'salt':{'type':Sequelize[_0xdace('0xc')]},'phone':{'type':Sequelize[_0xdace('0xc')]},'mobile':{'type':Sequelize[_0xdace('0xc')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdace('0xc')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xdace('0x16')]},'voicePause':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xdace('0xc')],'defaultValue':_0xdace('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xdace('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![],'defaultValue':_0xdace('0x18')},'ipaddr':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'port':{'type':Sequelize[_0xdace('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x19'),_0xdace('0x1a'),_0xdace('0x1b')),'allowNull':!![],'defaultValue':_0xdace('0x19')},'context':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![],'defaultValue':_0xdace('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0xdace('0x1d'),_0xdace('0x1e'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xdace('0x1f'),_0xdace('0x20'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'permit':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'transport':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![],'defaultValue':_0xdace('0x21'),'set':function(_0x3ac83c){this[_0xdace('0x6')](_0xdace('0x22'),_0x3ac83c?_0x3ac83c['join'](','):null);},'get':function(){return this['getDataValue'](_0xdace('0x22'))?this[_0xdace('0xa')](_0xdace('0x22'))['split'](','):null;},'comment':_0xdace('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0xdace('0x24'),_0xdace('0x25'),_0xdace('0x26'),_0xdace('0x27'),_0xdace('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no',_0xdace('0x2a'),'update',_0xdace('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xdace('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![],'defaultValue':_0xdace('0x2c'),'set':function(_0x370420){this[_0xdace('0x6')](_0xdace('0x2d'),_0x370420?_0x370420[_0xdace('0x2e')](','):null);},'get':function(){return this[_0xdace('0xa')](_0xdace('0x2d'))?this[_0xdace('0xa')](_0xdace('0x2d'))[_0xdace('0x2f')](','):null;},'comment':_0xdace('0x30')},'callgroup':{'type':Sequelize[_0xdace('0xc')]},'namedcallgroup':{'type':Sequelize[_0xdace('0xc')]},'pickupgroup':{'type':Sequelize[_0xdace('0xc')]},'namedpickupgroup':{'type':Sequelize[_0xdace('0xc')]},'language':{'type':Sequelize[_0xdace('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdace('0xc')]},'disallow':{'type':Sequelize[_0xdace('0xc')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xdace('0xc')],'allowNull':![],'defaultValue':_0xdace('0x31'),'set':function(_0x51c9ff){this[_0xdace('0x6')]('allow',_0x51c9ff?_0x51c9ff[_0xdace('0x2e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xdace('0xa')](_0xdace('0x32'))?this[_0xdace('0xa')](_0xdace('0x32'))['split'](';'):null;},'comment':_0xdace('0x33')},'autoframing':{'type':Sequelize['ENUM'](_0xdace('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2c121c){this[_0xdace('0x6')]('insecure',_0x2c121c?_0x2c121c[_0xdace('0x2e')](','):null);},'get':function(){return this['getDataValue'](_0xdace('0x34'))?this[_0xdace('0xa')](_0xdace('0x34'))[_0xdace('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xdace('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no',_0xdace('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdace('0x36')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xdace('0x29'),'no'),'allowNull':!![],'defaultValue':_0xdace('0x29')},'busylevel':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'template':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xdace('0x29'),'no',_0xdace('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x38'),_0xdace('0x39'),_0xdace('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xdace('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0xdace('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![],'defaultValue':_0xdace('0x29')},'keepalive':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no',_0xdace('0x3d'),_0xdace('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xdace('0x3f'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xdace('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xdace('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xdace('0xc')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no',_0xdace('0x2a'),'update',_0xdace('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xdace('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xdace('0x41')]},'showWebBar':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0,'set':function(_0x56e678){this[_0xdace('0x6')](_0xdace('0x42'),_0x56e678);var _0x4921ed=this[_0xdace('0x43')]({'plain':!![]});switch(_0x56e678){case 0x0:case 0x1:var _0x17311b=_0x4921ed[_0xdace('0x22')]?_[_0xdace('0x44')](_0x4921ed[_0xdace('0x22')])?_0x4921ed[_0xdace('0x22')][_0xdace('0x2e')]():_0x4921ed['transport']:_0xdace('0x21');if(_0x17311b===_0xdace('0x45')){_0x17311b=_0xdace('0x21');}this[_0xdace('0x6')]('transport',_0x17311b);this['setDataValue'](_0xdace('0x46'),'no');this[_0xdace('0x6')](_0xdace('0x47'),null);this[_0xdace('0x6')](_0xdace('0x48'),null);this[_0xdace('0x6')](_0xdace('0x49'),null);this[_0xdace('0x6')](_0xdace('0x4a'),null);this[_0xdace('0x6')](_0xdace('0x4b'),null);this[_0xdace('0x6')](_0xdace('0x4c'),null);this[_0xdace('0x6')](_0xdace('0x4d'),null);this[_0xdace('0x6')](_0xdace('0x4e'),null);this['setDataValue'](_0xdace('0x4f'),'no');break;case 0x2:this['setDataValue'](_0xdace('0x22'),_0xdace('0x45'));this[_0xdace('0x6')](_0xdace('0x46'),'yes');this[_0xdace('0x6')](_0xdace('0x47'),'yes');this['setDataValue']('force_avp',_0xdace('0x29'));this[_0xdace('0x6')](_0xdace('0x49'),_0xdace('0x29'));this[_0xdace('0x6')](_0xdace('0x4a'),_0xdace('0x29'));this['setDataValue'](_0xdace('0x4b'),'no');this[_0xdace('0x6')](_0xdace('0x4c'),_0xdace('0x50'));this[_0xdace('0x6')](_0xdace('0x4d'),_0x4921ed[_0xdace('0x4d')]||_0xdace('0x51'));this[_0xdace('0x6')](_0xdace('0x4e'),_0x4921ed[_0xdace('0x4e')]||_0xdace('0x52'));this['setDataValue'](_0xdace('0x4f'),_0xdace('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xdace('0x41')],'set':function(_0x4fd2bc){this['setDataValue'](_0xdace('0x53'),_0x4fd2bc?_0x4fd2bc[_0xdace('0x2e')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0xdace('0x54')](this['getDataValue'](_0xdace('0x53'))['split'](','),function(_0x49b485){return parseInt(_0x49b485,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xdace('0xc')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xdace('0xc')]},'phoneBarBusyNumber':{'type':Sequelize[_0xdace('0xc')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xdace('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xdace('0xc')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xdace('0xe')](_0xdace('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xdace('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xdace('0xc')]},'phoneBarEnableJaws':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xdace('0x55')],'get':function(){return this[_0xdace('0xa')](_0xdace('0x56'))?this['getDataValue'](_0xdace('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xdace('0xc')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![],'set':function(_0xf400d7){if(typeof _0xf400d7===_0xdace('0x57')){var _0x16a627=_0xf400d7==='1'?!![]:_0xf400d7==='0'?![]:_0xf400d7===_0xdace('0x58')?!![]:_0xf400d7===_0xdace('0x59')?![]:![];this[_0xdace('0x6')](_0xdace('0x5a'),_0x16a627);}else{this[_0xdace('0x6')](_0xdace('0x5a'),_0xf400d7);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5a6b14){this[_0xdace('0x6')](_0xdace('0x5b'),_0x5a6b14);if(_0x5a6b14===!![]){this['setDataValue'](_0xdace('0x5c'),moment());this['setDataValue'](_0xdace('0x5d'),0x0);}else{this['setDataValue'](_0xdace('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0xdace('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xdace('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xdace('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xdace('0x5e')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdace('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xdace('0x15')],'defaultValue':![]}}; \ No newline at end of file +var _0xe739=['phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','UNSIGNED','sequelize','util','lodash','exports','setDataValue','name','defaultuser','STRING','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','ENUM','admin','agent','telephone','INTEGER','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','user','peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','update','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','uac','uas','fingerprint','active','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','icesupport','dtlsenable','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','map','VIRTUAL'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe739,0x105));var _0x9e73=function(_0x3e60a4,_0x317e1b){_0x3e60a4=_0x3e60a4-0x0;var _0x535568=_0xe739[_0x3e60a4];return _0x535568;};'use strict';var Sequelize=require(_0x9e73('0x0'));var moment=require('moment');var util=require(_0x9e73('0x1'));var _=require(_0x9e73('0x2'));module[_0x9e73('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x594f94){this[_0x9e73('0x4')](_0x9e73('0x5'),_0x594f94);this[_0x9e73('0x4')](_0x9e73('0x6'),_0x594f94);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x9e73('0x7')],'allowNull':![],'set':function(_0x26cb5b){this[_0x9e73('0x4')]('fullname',_0x26cb5b);this[_0x9e73('0x4')](_0x9e73('0x8'),util[_0x9e73('0x9')](_0x9e73('0xa'),_0x26cb5b,this[_0x9e73('0xb')](_0x9e73('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9e73('0x7')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x55b0c8){if(_0x55b0c8){this[_0x9e73('0x4')]('email',_0x55b0c8[_0x9e73('0xd')]());}}},'role':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0xf'),'user',_0x9e73('0x10'),_0x9e73('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x9e73('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9e73('0x7')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':![],'unique':_0x9e73('0xc'),'set':function(_0x3a7bd5){this['setDataValue'](_0x9e73('0xc'),_0x3a7bd5);this[_0x9e73('0x4')]('accountcode',_0x3a7bd5);this[_0x9e73('0x4')](_0x9e73('0x8'),util[_0x9e73('0x9')]('\x22%s\x22\x20<%s>',this[_0x9e73('0xb')]('fullname'),_0x3a7bd5));}},'salt':{'type':Sequelize[_0x9e73('0x7')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x9e73('0x7')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9e73('0x7')]},'city':{'type':Sequelize[_0x9e73('0x7')]},'country':{'type':Sequelize[_0x9e73('0x7')]},'online':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9e73('0x14')]},'voicePause':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x9e73('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9e73('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9e73('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x9e73('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9e73('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9e73('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x9e73('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x9e73('0x16'),_0x9e73('0x17'),_0x9e73('0x18')),'allowNull':!![],'defaultValue':_0x9e73('0x16')},'context':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x9e73('0xe')]('ALLOWED_NOT_SCREENED',_0x9e73('0x19'),_0x9e73('0x1a'),_0x9e73('0x1b'),_0x9e73('0x1c'),_0x9e73('0x1d'),'PROHIB_FAILED_SCREEN',_0x9e73('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![],'defaultValue':_0x9e73('0x1f'),'set':function(_0x38ec16){this[_0x9e73('0x4')]('transport',_0x38ec16?_0x38ec16[_0x9e73('0x20')](','):null);},'get':function(){return this[_0x9e73('0xb')](_0x9e73('0x21'))?this[_0x9e73('0xb')](_0x9e73('0x21'))[_0x9e73('0x22')](','):null;},'comment':_0x9e73('0x23')},'dtmfmode':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x24'),_0x9e73('0x25'),'shortinfo',_0x9e73('0x26'),_0x9e73('0x27')),'allowNull':!![],'defaultValue':_0x9e73('0x24')},'directmedia':{'type':Sequelize[_0x9e73('0xe')]('yes','no',_0x9e73('0x28'),_0x9e73('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![],'defaultValue':_0x9e73('0x2b'),'set':function(_0x430846){this['setDataValue']('nat',_0x430846?_0x430846['join'](','):null);},'get':function(){return this[_0x9e73('0xb')](_0x9e73('0x2c'))?this[_0x9e73('0xb')]('nat')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x9e73('0x7')]},'namedcallgroup':{'type':Sequelize[_0x9e73('0x7')]},'pickupgroup':{'type':Sequelize[_0x9e73('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x9e73('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9e73('0x7')]},'disallow':{'type':Sequelize[_0x9e73('0x7')],'allowNull':![],'defaultValue':_0x9e73('0x2d')},'allow':{'type':Sequelize[_0x9e73('0x7')],'allowNull':![],'defaultValue':_0x9e73('0x2e'),'set':function(_0x40bbda){this[_0x9e73('0x4')](_0x9e73('0x2f'),_0x40bbda?_0x40bbda[_0x9e73('0x20')](';'):_0x9e73('0x2e'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue']('allow')[_0x9e73('0x22')](';'):null;},'comment':_0x9e73('0x30')},'autoframing':{'type':Sequelize['ENUM'](_0x9e73('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![],'set':function(_0x5994aa){this['setDataValue']('insecure',_0x5994aa?_0x5994aa['join'](','):null);},'get':function(){return this['getDataValue'](_0x9e73('0x31'))?this[_0x9e73('0xb')](_0x9e73('0x31'))[_0x9e73('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no',_0x9e73('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x9e73('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9e73('0xe')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9e73('0x33')},'amaflags':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x9e73('0x2a')},'busylevel':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no',_0x9e73('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9e73('0xe')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x35'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x36'),_0x9e73('0x37')),'allowNull':!![],'defaultValue':_0x9e73('0x37')},'t38pt_usertpsource':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x9e73('0x2a')},'keepalive':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9e73('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9e73('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no',_0x9e73('0x38'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9e73('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x39'),'passive',_0x9e73('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x9e73('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x9e73('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9e73('0xe')](_0x9e73('0x2a'),'no',_0x9e73('0x28'),_0x9e73('0x29'),_0x9e73('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x9e73('0x7')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9e73('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9e73('0x3c')]},'showWebBar':{'type':Sequelize[_0x9e73('0x12')],'defaultValue':0x0,'set':function(_0x4c6504){this['setDataValue'](_0x9e73('0x3d'),_0x4c6504);var _0x61b066=this[_0x9e73('0x3e')]({'plain':!![]});switch(_0x4c6504){case 0x0:case 0x1:var _0x158b54=_0x61b066[_0x9e73('0x21')]?_[_0x9e73('0x3f')](_0x61b066[_0x9e73('0x21')])?_0x61b066[_0x9e73('0x21')][_0x9e73('0x20')]():_0x61b066[_0x9e73('0x21')]:_0x9e73('0x1f');if(_0x158b54===_0x9e73('0x40')){_0x158b54='udp';}this[_0x9e73('0x4')](_0x9e73('0x21'),_0x158b54);this[_0x9e73('0x4')](_0x9e73('0x41'),'no');this[_0x9e73('0x4')](_0x9e73('0x42'),null);this[_0x9e73('0x4')](_0x9e73('0x43'),null);this['setDataValue']('icesupport',null);this[_0x9e73('0x4')]('dtlsenable',null);this['setDataValue'](_0x9e73('0x44'),null);this['setDataValue'](_0x9e73('0x45'),null);this[_0x9e73('0x4')](_0x9e73('0x46'),null);this[_0x9e73('0x4')](_0x9e73('0x47'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0x9e73('0x4')](_0x9e73('0x21'),_0x9e73('0x40'));this[_0x9e73('0x4')](_0x9e73('0x41'),_0x9e73('0x2a'));this[_0x9e73('0x4')](_0x9e73('0x42'),_0x9e73('0x2a'));this[_0x9e73('0x4')](_0x9e73('0x43'),_0x9e73('0x2a'));this['setDataValue'](_0x9e73('0x48'),_0x9e73('0x2a'));this[_0x9e73('0x4')](_0x9e73('0x49'),_0x9e73('0x2a'));this[_0x9e73('0x4')](_0x9e73('0x44'),'no');this[_0x9e73('0x4')](_0x9e73('0x45'),_0x9e73('0x3a'));this[_0x9e73('0x4')](_0x9e73('0x46'),_0x61b066[_0x9e73('0x46')]||_0x9e73('0x4a'));this[_0x9e73('0x4')](_0x9e73('0x47'),_0x61b066['dtlsprivatekey']||_0x9e73('0x4b'));this[_0x9e73('0x4')](_0x9e73('0x4c'),_0x9e73('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x9e73('0x3c')],'set':function(_0x5f4d56){this[_0x9e73('0x4')]('permissions',_0x5f4d56?_0x5f4d56[_0x9e73('0x20')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x9e73('0x4d')](this[_0x9e73('0xb')]('permissions')[_0x9e73('0x22')](','),function(_0xbdd295){return parseInt(_0xbdd295,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x9e73('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9e73('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9e73('0x7')]},'phoneBarUnconditional':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x9e73('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9e73('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9e73('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9e73('0x7')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9e73('0x4e')],'get':function(){return this[_0x9e73('0xb')](_0x9e73('0x4f'))?this[_0x9e73('0xb')](_0x9e73('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9e73('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9e73('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![],'set':function(_0xc7c2){if(typeof _0xc7c2===_0x9e73('0x50')){var _0x383f0a=_0xc7c2==='1'?!![]:_0xc7c2==='0'?![]:_0xc7c2===_0x9e73('0x51')?!![]:_0xc7c2==='false'?![]:![];this['setDataValue']('screenrecording',_0x383f0a);}else{this[_0x9e73('0x4')](_0x9e73('0x52'),_0xc7c2);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x151613){this['setDataValue'](_0x9e73('0x53'),_0x151613);if(_0x151613===!![]){this['setDataValue']('blockedAt',moment());this[_0x9e73('0x4')]('loginAttempts',0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x9e73('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9e73('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9e73('0x12')](0x5)[_0x9e73('0x54')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9e73('0x13')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 36beca5..280327a 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 _0x86e0=['penalty','UserVoiceQueueRt','upsert','removeQueues','channel','isValidChannel','remove','Queues','isArray','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','WHATSAPP','getContacts','CmContact','filters','intersection','order','sort','where','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','Queue','pick','options','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','concat','isMiddleware','pause','QueuePause','getChannels','type','DEFAULT\x20PAUSE','unpause','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','addTeams','omit','Team','setDataValue','getChatQueues','Chat','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','VoicePrefixId','removeTeams','getMailQueues','removeAgent','UserVoicePrefix','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$iLike','$notILike','$like','$overlap','$contains','$contained','lastName','Contact','getApiKey','token','createApiKey','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','resolve','getUserSetting','teams','queues','lower','col','desc','asc','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','busy','slice','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','bluebird','util','lodash','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','get','role','Users','user','Agents','agent','Telephones','filter','ignore','map','value','includes','find','name','UserProfileResource','send','User','rawAttributes','fieldName','key','password','getOptions','query','includeAll','userSetting','include','UserSetting','attributes','findAll','rows','openTabs','length','push','chat','dataValues','sms','fax','mail','all','show','params','keys','model','fields','true','merge','openchannel','whatsapp','body','describe','addContacts','ids','internal','findById','securePassword','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','voicemail','mailbox','VoiceMail','fullname','permissions','101','103','113','104','105','106','107','108','109','100','111','115','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','UserProfileSection','isEmpty','telephone','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','addQueues','loginInPause','interface','Unknown\x20channel','add','toLowerCase','spread','capitalize','QueueId','emit','Queue:save','voice','online','format'];(function(_0x45387e,_0x5a3fba){var _0x5ba19d=function(_0x4e007b){while(--_0x4e007b){_0x45387e['push'](_0x45387e['shift']());}};_0x5ba19d(++_0x5a3fba);}(_0x86e0,0xf3));var _0x086e=function(_0x2f7089,_0x4f71db){_0x2f7089=_0x2f7089-0x0;var _0x49abb7=_0x86e0[_0x2f7089];return _0x49abb7;};'use strict';var moment=require('moment');var BPromise=require(_0x086e('0x0'));var util=require(_0x086e('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x086e('0x2'));var squel=require('squel');var jayson=require('jayson/promise');var Redis=require(_0x086e('0x3'));var authService=require(_0x086e('0x4'));var qs=require(_0x086e('0x5'));var logger=require(_0x086e('0x6'))(_0x086e('0x7'));var utils=require(_0x086e('0x8'));var config=require(_0x086e('0x9'));var licenseUtil=require('../../config/license/util');var db=require(_0x086e('0xa'))['db'];var socket=require(_0x086e('0xb'))(new Redis(config[_0x086e('0xc')]));require(_0x086e('0xd'))['register'](socket);config[_0x086e('0xc')]=_[_0x086e('0xe')](config[_0x086e('0xc')],{'host':_0x086e('0xf'),'port':0x18eb});var client=jayson[_0x086e('0x10')][_0x086e('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x340eb7,_0x5b1228,_0xd853cc,_0x7f6b1b){return new BPromise(function(_0x2949f5,_0x58703a){var _0x51a2a3=_0x7f6b1b||client;return _0x51a2a3[_0x086e('0x12')](_0x340eb7,_0xd853cc)[_0x086e('0x13')](function(_0x3e46b5){logger[_0x086e('0x14')](_0x086e('0x15'),_0x5b1228,_0x086e('0x16'));logger[_0x086e('0x17')](_0x086e('0x18'),_0x5b1228,_0x086e('0x16'),JSON[_0x086e('0x19')](_0x3e46b5));if(_0x3e46b5[_0x086e('0x1a')]){if(_0x3e46b5[_0x086e('0x1a')][_0x086e('0x1b')]===0x1f4){logger[_0x086e('0x1a')](_0x086e('0x15'),_0x5b1228,_0x3e46b5[_0x086e('0x1a')]['message']);return _0x58703a(_0x3e46b5[_0x086e('0x1a')][_0x086e('0x1c')]);}logger['error'](_0x086e('0x15'),_0x5b1228,_0x3e46b5[_0x086e('0x1a')][_0x086e('0x1c')]);return _0x2949f5(_0x3e46b5[_0x086e('0x1a')][_0x086e('0x1c')]);}else{logger[_0x086e('0x14')]('User,\x20%s,\x20%s',_0x5b1228,_0x086e('0x16'));_0x2949f5(_0x3e46b5[_0x086e('0x1d')][_0x086e('0x1c')]);}})[_0x086e('0x1e')](function(_0x4326cb){logger[_0x086e('0x1a')]('User,\x20%s,\x20%s',_0x5b1228,_0x4326cb);_0x58703a(_0x4326cb);});});}function respondWithStatusCode(_0x44334a,_0x142e3f){_0x142e3f=_0x142e3f||0xcc;return function(_0x551686){if(_0x551686){return _0x44334a[_0x086e('0x1f')](_0x142e3f);}return _0x44334a['status'](_0x142e3f)[_0x086e('0x20')]();};}function respondWithResult(_0x553a13,_0x38443c){_0x38443c=_0x38443c||0xc8;return function(_0x5aa638){if(_0x5aa638){return _0x553a13['status'](_0x38443c)[_0x086e('0x21')](_0x5aa638);}};}function respondWithFilteredResult(_0x2d8146,_0xc02daa){return function(_0x45f79f){if(_0x45f79f){var _0x574199=typeof _0xc02daa[_0x086e('0x22')]===_0x086e('0x23')&&typeof _0xc02daa[_0x086e('0x24')]===_0x086e('0x23');var _0x43737d=_0x45f79f[_0x086e('0x25')];var _0x37761f=_0x574199?0x0:_0xc02daa['offset'];var _0xd54c43=_0x574199?_0x45f79f[_0x086e('0x25')]:_0xc02daa[_0x086e('0x22')]+_0xc02daa[_0x086e('0x24')];var _0x18f8e0;if(_0xd54c43>=_0x43737d){_0xd54c43=_0x43737d;_0x18f8e0=0xc8;}else{_0x18f8e0=0xce;}_0x2d8146[_0x086e('0x26')](_0x18f8e0);return _0x2d8146[_0x086e('0x27')](_0x086e('0x28'),_0x37761f+'-'+_0xd54c43+'/'+_0x43737d)[_0x086e('0x21')](_0x45f79f);}return null;};}function saveUpdates(_0x2b76e2){return function(_0x114a61){if(_0x114a61){return _0x114a61[_0x086e('0x29')](_0x2b76e2)[_0x086e('0x13')](function(_0x12e54f){return _0x12e54f;});}return null;};}function removeEntity(_0x13dc6c){return function(_0x2f87f9){if(_0x2f87f9){return _0x2f87f9[_0x086e('0x2a')]()[_0x086e('0x13')](function(){var _0x31d032=_0x2f87f9[_0x086e('0x2b')]({'plain':!![]});if(_0x31d032[_0x086e('0x2c')]==='admin')return;var _0x283bf1=[{'name':_0x086e('0x2d'),'value':_0x086e('0x2e'),'ignore':!![]},{'name':_0x086e('0x2f'),'value':_0x086e('0x30'),'ignore':![]},{'name':_0x086e('0x31'),'value':'telephone','ignore':![]}];var _0x4feb20=_(_0x283bf1)[_0x086e('0x32')](_0x086e('0x33'))[_0x086e('0x34')]('value')[_0x086e('0x35')]();if(_[_0x086e('0x36')](_0x4feb20,_0x31d032[_0x086e('0x2c')])){return;}var _0x1bceba=_[_0x086e('0x37')](_0x283bf1,[_0x086e('0x35'),_0x31d032[_0x086e('0x2c')]])[_0x086e('0x38')];return db[_0x086e('0x39')][_0x086e('0x2a')]({'where':{'type':_0x1bceba,'resourceId':_0x31d032['id']}})['then'](function(){return _0x2f87f9;});})[_0x086e('0x13')](function(){_0x13dc6c['status'](0xcc)[_0x086e('0x20')]();});}};}function handleEntityNotFound(_0x2002a5){return function(_0x5cf8b7){if(!_0x5cf8b7){_0x2002a5['sendStatus'](0x194);}return _0x5cf8b7;};}function handleError(_0x5f4c67,_0x3cfb33){_0x3cfb33=_0x3cfb33||0x1f4;return function(_0x2e514c){logger[_0x086e('0x1a')](_0x2e514c['stack']);if(_0x2e514c[_0x086e('0x38')]){delete _0x2e514c[_0x086e('0x38')];}_0x5f4c67[_0x086e('0x26')](_0x3cfb33)[_0x086e('0x3a')](_0x2e514c);};}exports['index']=function(_0x309250,_0x3bd9e4){var _0x392d52={},_0x3d6880={'count':0x0,'rows':[]};var _0x427a43=_(db[_0x086e('0x3b')][_0x086e('0x3c')])['map'](function(_0x2c814d){return{'name':_0x2c814d[_0x086e('0x3d')],'type':_0x2c814d['type'][_0x086e('0x3e')]};})['filter'](function(_0x5c19bc){return!_[_0x086e('0x36')]([_0x086e('0x3f'),'salt'],_0x5c19bc[_0x086e('0x38')]);})[_0x086e('0x35')]();_0x392d52=qs[_0x086e('0x40')](_0x427a43,_0x309250);var _0x3604ec={'where':_0x392d52['where']};return db['User'][_0x086e('0x25')](_0x3604ec)['then'](function(_0x206260){_0x3d6880['count']=_0x206260;if(_0x309250[_0x086e('0x41')][_0x086e('0x42')]){_0x392d52['include']=[{'all':!![]}];}if(_0x309250[_0x086e('0x41')][_0x086e('0x43')]==='true'){_0x392d52[_0x086e('0x44')]=[{'model':db[_0x086e('0x45')],'as':_0x086e('0x43')}];}if(!_[_0x086e('0x36')](_0x392d52[_0x086e('0x46')],'id')){_0x392d52[_0x086e('0x46')]['push']('id');}return db['User'][_0x086e('0x47')](_0x392d52);})['then'](function(_0x2e0585){_0x3d6880[_0x086e('0x48')]=_0x2e0585;if(_0x309250[_0x086e('0x41')][_0x086e('0x49')]==='true'){var _0x4e7295=[];for(var _0x18eebd=0x0;_0x18eebd<_0x3d6880[_0x086e('0x48')][_0x086e('0x4a')];_0x18eebd++){_0x4e7295[_0x086e('0x4b')](get_open_tabs(_0x086e('0x4c'),_0x3d6880[_0x086e('0x48')][_0x18eebd][_0x086e('0x4d')]));_0x4e7295[_0x086e('0x4b')](get_open_tabs(_0x086e('0x4e'),_0x3d6880[_0x086e('0x48')][_0x18eebd][_0x086e('0x4d')]));_0x4e7295['push'](get_open_tabs(_0x086e('0x4f'),_0x3d6880[_0x086e('0x48')][_0x18eebd][_0x086e('0x4d')]));_0x4e7295[_0x086e('0x4b')](get_open_tabs(_0x086e('0x50'),_0x3d6880[_0x086e('0x48')][_0x18eebd][_0x086e('0x4d')]));_0x4e7295[_0x086e('0x4b')](get_open_tabs('openchannel',_0x3d6880['rows'][_0x18eebd][_0x086e('0x4d')]));_0x4e7295[_0x086e('0x4b')](get_open_tabs('whatsapp',_0x3d6880[_0x086e('0x48')][_0x18eebd][_0x086e('0x4d')]));}return BPromise[_0x086e('0x51')](_0x4e7295)[_0x086e('0x13')](function(){return _0x3d6880;});}else{return _0x3d6880;}})[_0x086e('0x13')](respondWithFilteredResult(_0x3bd9e4,_0x392d52))[_0x086e('0x1e')](handleError(_0x3bd9e4,null));};exports[_0x086e('0x52')]=function(_0x203dd9,_0x752e7f){var _0x4ce9e3={'raw':![],'where':{'id':_0x203dd9[_0x086e('0x53')]['id']}},_0xbb9264={};_0xbb9264['model']=_['differenceBy'](_['keys'](db[_0x086e('0x3b')][_0x086e('0x3c')]),[_0x086e('0x3f'),'salt']);_0xbb9264['query']=_[_0x086e('0x54')](_0x203dd9[_0x086e('0x41')]);_0xbb9264['filters']=_['intersection'](_0xbb9264['model'],_0xbb9264[_0x086e('0x41')]);_0x4ce9e3[_0x086e('0x46')]=_['intersection'](_0xbb9264[_0x086e('0x55')],qs[_0x086e('0x56')](_0x203dd9[_0x086e('0x41')][_0x086e('0x56')]));_0x4ce9e3['attributes']=_0x4ce9e3['attributes']['length']?_0x4ce9e3[_0x086e('0x46')]:_0xbb9264[_0x086e('0x55')];if(_0x203dd9[_0x086e('0x41')][_0x086e('0x42')]){_0x4ce9e3[_0x086e('0x44')]=[{'all':!![]}];}if(_0x203dd9['query'][_0x086e('0x43')]===_0x086e('0x57')){_0x4ce9e3[_0x086e('0x44')]=[{'model':db[_0x086e('0x45')],'as':_0x086e('0x43')}];}_0x4ce9e3=_[_0x086e('0x58')]({},_0x4ce9e3,_0x203dd9['options']);if(!_[_0x086e('0x36')](_0x4ce9e3['attributes'],'id')){_0x4ce9e3[_0x086e('0x46')]['push']('id');}return db[_0x086e('0x3b')][_0x086e('0x37')](_0x4ce9e3)['then'](handleEntityNotFound(_0x752e7f,null))[_0x086e('0x13')](function(_0x392445){var _0x23bb38=[];values=_0x392445;if(_0x203dd9[_0x086e('0x41')][_0x086e('0x49')]===_0x086e('0x57')){_0x23bb38['push'](get_open_tabs(_0x086e('0x4c'),_0x392445[_0x086e('0x4d')]));_0x23bb38[_0x086e('0x4b')](get_open_tabs(_0x086e('0x4e'),_0x392445[_0x086e('0x4d')]));_0x23bb38['push'](get_open_tabs(_0x086e('0x59'),_0x392445['dataValues']));_0x23bb38[_0x086e('0x4b')](get_open_tabs(_0x086e('0x5a'),_0x392445['dataValues']));_0x23bb38[_0x086e('0x4b')](get_open_tabs('fax',_0x392445[_0x086e('0x4d')]));_0x23bb38['push'](get_open_tabs(_0x086e('0x50'),_0x392445[_0x086e('0x4d')]));return BPromise[_0x086e('0x51')](_0x23bb38);}else{return values;}})[_0x086e('0x13')](function(){return values;})['then'](respondWithResult(_0x752e7f,null))['catch'](handleError(_0x752e7f,null));};exports['update']=function(_0x5b4ba3,_0x326eb2){if(_0x5b4ba3[_0x086e('0x5b')]['id']){delete _0x5b4ba3[_0x086e('0x5b')]['id'];}delete _0x5b4ba3[_0x086e('0x5b')][_0x086e('0x2c')];return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x5b4ba3[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x326eb2,null))[_0x086e('0x13')](saveUpdates(_0x5b4ba3['body'],null))[_0x086e('0x13')](respondWithResult(_0x326eb2,null))[_0x086e('0x1e')](handleError(_0x326eb2,null));};exports[_0x086e('0x5c')]=function(_0x4a9217,_0x528b35){return db['User'][_0x086e('0x5c')]()[_0x086e('0x13')](respondWithResult(_0x528b35,null))[_0x086e('0x1e')](handleError(_0x528b35,null));};exports[_0x086e('0x5d')]=function(_0x1593c1,_0x18d9ee){return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x1593c1[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x18d9ee,null))[_0x086e('0x13')](function(_0x4ca1b0){if(_0x4ca1b0){return _0x4ca1b0[_0x086e('0x5d')](_0x1593c1[_0x086e('0x5b')][_0x086e('0x5e')],_['omit'](_0x1593c1[_0x086e('0x5b')],[_0x086e('0x5e'),'id'])||{});}})[_0x086e('0x13')](respondWithResult(_0x18d9ee,null))['catch'](handleError(_0x18d9ee,null));};function validateUser(_0xc4cdcf){return new BPromise(function(_0x2a0e54,_0x123234){if(_0xc4cdcf[_0x086e('0x5f')])return _0x2a0e54(_0xc4cdcf);return db['Setting'][_0x086e('0x60')](0x1)[_0x086e('0x13')](function(_0x18bdbe){if(_0x18bdbe[_0x086e('0x61')])authService['validatePasswordPattern'](_0xc4cdcf['password']);db[_0x086e('0x3b')]['max'](_0x086e('0x5f'))[_0x086e('0x13')](function(_0x19906e){if(_['isNil'](_0x19906e)){_0xc4cdcf[_0x086e('0x5f')]=_0x18bdbe[_0x086e('0x62')]||0x1;return;}if(_['isNil'](_0x18bdbe[_0x086e('0x62')])||_0x18bdbe[_0x086e('0x62')]===_0x19906e){_0xc4cdcf['internal']=_0x19906e+0x1;return;}if(_0x18bdbe[_0x086e('0x62')]>_0x19906e){_0xc4cdcf[_0x086e('0x5f')]=_0x18bdbe[_0x086e('0x62')];return;}return db[_0x086e('0x63')][_0x086e('0x41')](_0x086e('0x64'),{'type':db[_0x086e('0x63')][_0x086e('0x65')][_0x086e('0x66')]})[_0x086e('0x13')](function(_0x45a4fc){if(_0x45a4fc&&_0x45a4fc[_0x086e('0x4a')]){for(var _0x1cae4b=0x0,_0x57dc83=_0x45a4fc[_0x086e('0x4a')];_0x1cae4b<_0x57dc83&&_[_0x086e('0x67')](_0xc4cdcf[_0x086e('0x5f')]);_0x1cae4b++){if(_0x18bdbe['min_internal']<=_0x45a4fc[_0x1cae4b][_0x086e('0x68')]){_0xc4cdcf[_0x086e('0x5f')]=_0x45a4fc[_0x1cae4b]['from'];}else if(_0x18bdbe[_0x086e('0x62')]>_0x45a4fc[_0x1cae4b][_0x086e('0x68')]&&_0x18bdbe['min_internal']<=_0x45a4fc[_0x1cae4b]['to']){_0xc4cdcf[_0x086e('0x5f')]=_0x18bdbe[_0x086e('0x62')];}}}if(_['isNil'](_0xc4cdcf[_0x086e('0x5f')])){_0xc4cdcf['internal']=_0x19906e+0x1;}return _0x2a0e54(_0xc4cdcf);});});})[_0x086e('0x1e')](function(_0x30f3c8){_0x123234(_0x30f3c8);});});}function updateUser(_0x67f6d1){return new BPromise(function(_0x13e8dc,_0x14a871){try{if(_0x67f6d1[_0x086e('0x69')]){_0x67f6d1[_0x086e('0x6a')]=_0x67f6d1[_0x086e('0x5f')];_0x67f6d1[_0x086e('0x6b')]={'mailbox':_0x67f6d1[_0x086e('0x5f')],'password':_0x67f6d1[_0x086e('0x3f')],'fullname':_0x67f6d1[_0x086e('0x6c')],'email':_0x67f6d1['email']};}if(_0x67f6d1['role']===_0x086e('0x30')){if(!_0x67f6d1[_0x086e('0x6d')])_0x67f6d1[_0x086e('0x6d')]=[_0x086e('0x6e'),'102',_0x086e('0x6f'),_0x086e('0x70'),'110',_0x086e('0x71'),_0x086e('0x72'),_0x086e('0x73'),_0x086e('0x74'),_0x086e('0x75'),_0x086e('0x76'),_0x086e('0x77'),_0x086e('0x78'),'114',_0x086e('0x79')];}_0x13e8dc(_0x67f6d1);}catch(_0x2fbbf8){_0x14a871(_0x2fbbf8);}});}exports['create']=function(_0x2a651a,_0xfd7e72){if(_0x2a651a[_0x086e('0x2e')][_0x086e('0x2c')]===_0x086e('0x30'))throw new Error('Unauthorized');if(_0x2a651a['body']['role']===_0x086e('0x2e')&&_0x2a651a[_0x086e('0x2e')][_0x086e('0x2c')]!==_0x086e('0x7a')){throw new Error(_0x086e('0x7b'));}if(_0x2a651a[_0x086e('0x5b')]['role']===_0x086e('0x7a')&&_0x2a651a[_0x086e('0x2e')][_0x086e('0x2c')]!=='admin'){throw new Error(_0x086e('0x7c'));}return licenseUtil[_0x086e('0x7d')]([_0x2a651a['body']])['then'](function(){return validateUser(_0x2a651a[_0x086e('0x5b')]);})[_0x086e('0x13')](function(_0x131338){return updateUser(_0x131338)[_0x086e('0x13')](function(_0x37be72){if(_0x37be72['role']===_0x086e('0x7a')){_0x37be72[_0x086e('0x7e')]=_0x2a651a[_0x086e('0x2e')][_0x086e('0x7e')];delete _0x37be72[_0x086e('0x7f')];}return _0x37be72;});})[_0x086e('0x13')](function(_0x39ea76){return db[_0x086e('0x3b')]['create'](_0x39ea76,{'include':[{'model':db[_0x086e('0x6b')],'as':_0x086e('0x6b')}]});})[_0x086e('0x13')](function(_0x38437a){if(_0x2a651a['body'][_0x086e('0x2c')]==='user')return _0x38437a;if(_0x2a651a[_0x086e('0x2e')]['role']!==_0x086e('0x2e'))return _0x38437a;return db['UserProfileSection']['find']({'where':{'name':_0x38437a[_0x086e('0x2c')]===_0x086e('0x30')?'Agents':'Telephones','userProfileId':_0x2a651a[_0x086e('0x2e')]['userProfileId']},'raw':!![]})[_0x086e('0x13')](function(_0x406530){if(!_0x406530||_0x406530[_0x086e('0x80')]!=0x0)return _0x38437a;return db['UserProfileResource'][_0x086e('0x81')]({'name':_0x38437a[_0x086e('0x38')],'resourceId':_0x38437a['id'],'type':_0x406530[_0x086e('0x38')],'sectionId':_0x406530['id']},{})[_0x086e('0x13')](function(){return _0x38437a;});})[_0x086e('0x1e')](function(_0x280d1c){logger[_0x086e('0x1a')](_0x086e('0x82'),_0x280d1c);throw _0x280d1c;});})[_0x086e('0x13')](respondWithResult(_0xfd7e72,0xc9))[_0x086e('0x1e')](handleError(_0xfd7e72,null));};exports[_0x086e('0x83')]=function(_0x2db9b6,_0x196246){var _0x3d3715=_0x2db9b6[_0x086e('0x5b')];var _0x53bb4=[];if(_0x2db9b6[_0x086e('0x2e')][_0x086e('0x2c')]===_0x086e('0x30'))throw new Error(_0x086e('0x84'));if(_[_0x086e('0x85')](_0x3d3715,['role','user'])&&_0x2db9b6[_0x086e('0x2e')][_0x086e('0x2c')]!==_0x086e('0x7a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x086e('0x85')](_0x3d3715,[_0x086e('0x2c'),_0x086e('0x7a')])&&_0x2db9b6[_0x086e('0x2e')]['role']!==_0x086e('0x7a')){throw new Error(_0x086e('0x86'));}return licenseUtil['checkUserLimits'](_0x3d3715)[_0x086e('0x13')](function(){return validateUser(_0x3d3715[0x0]);})[_0x086e('0x13')](function(){for(var _0x4a2e01=0x1;_0x4a2e01<_0x3d3715[_0x086e('0x4a')];_0x4a2e01++){var _0x5eaaf2=_0x3d3715[_0x4a2e01-0x1][_0x086e('0x5f')];if(!_0x3d3715[_0x4a2e01][_0x086e('0x5f')])_0x3d3715[_0x4a2e01]['internal']=_0x5eaaf2+0x1;_0x53bb4[_0x086e('0x4b')](validateUser(_0x3d3715[_0x4a2e01]));}return BPromise[_0x086e('0x51')](_0x53bb4);})[_0x086e('0x13')](function(){_0x53bb4=[];for(var _0x21dd8b=0x0;_0x21dd8b<_0x3d3715['length'];_0x21dd8b++){_0x53bb4['push'](updateUser(_0x3d3715[_0x21dd8b]));}return BPromise[_0x086e('0x51')](_0x53bb4);})[_0x086e('0x13')](function(){return BPromise[_0x086e('0x87')](_0x3d3715,function(_0x3f1d19){return db[_0x086e('0x3b')][_0x086e('0x81')](_0x3f1d19,{'include':[{'model':db[_0x086e('0x6b')],'as':_0x086e('0x6b')}]})[_0x086e('0x13')](function(_0x118ba6){_0x3f1d19['id']=_0x118ba6['id'];return _0x3f1d19;});});})[_0x086e('0x13')](function(_0x4c5f16){if(_0x2db9b6['body'][_0x086e('0x2c')]===_0x086e('0x2e'))return _0x4c5f16;if(_0x2db9b6[_0x086e('0x2e')][_0x086e('0x2c')]!==_0x086e('0x2e'))return _0x4c5f16;var _0x17cb42=_[_0x086e('0x85')](_0x4c5f16,function(_0xc1fac2){return _0xc1fac2['role']===_0x086e('0x30')||_0xc1fac2[_0x086e('0x2c')]==='telephone';});if(!_0x17cb42)return _0x4c5f16;return db[_0x086e('0x88')]['findAll']({'where':{'name':{'$or':[_0x086e('0x2f'),_0x086e('0x31')]},'userProfileId':_0x2db9b6[_0x086e('0x2e')][_0x086e('0x7f')]},'raw':!![]})[_0x086e('0x13')](function(_0x44ff09){if(_[_0x086e('0x89')](_0x44ff09)||!_['some'](_0x44ff09,[_0x086e('0x80'),0x0]))return _0x4c5f16;_0x53bb4=[];var _0xe2bd4e=_(_0x44ff09)[_0x086e('0x34')](function(_0x335d05){if(_0x335d05[_0x086e('0x80')]===0x1)return;return _0x335d05[_0x086e('0x38')]===_0x086e('0x2f')?_0x086e('0x30'):_0x086e('0x8a');})[_0x086e('0x8b')]()['value']();for(var _0x134820=0x0;_0x134820<_0x4c5f16[_0x086e('0x4a')];_0x134820++){if(!_[_0x086e('0x36')](_0xe2bd4e,_0x4c5f16[_0x134820]['role']))return;var _0x4c90ca=_0x4c5f16[_0x134820][_0x086e('0x2c')]==='agent'?_0x086e('0x2f'):_0x086e('0x31');_0x53bb4[_0x086e('0x4b')](db['UserProfileResource']['create']({'name':_0x4c5f16[_0x134820]['name'],'resourceId':_0x4c5f16[_0x134820]['id'],'type':_0x4c90ca,'sectionId':_[_0x086e('0x37')](_0x44ff09,[_0x086e('0x38'),_0x4c90ca])['id']},{}));}return BPromise[_0x086e('0x51')](_0x53bb4);});})[_0x086e('0x13')](respondWithResult(_0x196246,0xc9))[_0x086e('0x1e')](handleError(_0x196246,null));};exports[_0x086e('0x8c')]=function(_0x23883f,_0x4d9139){if(_0x23883f[_0x086e('0x5b')]['id']){delete _0x23883f[_0x086e('0x5b')]['id'];}return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x23883f[_0x086e('0x53')]['id']}})[_0x086e('0x13')](function(_0x3d4b1c){if(!_0x3d4b1c)return null;if(_0x3d4b1c['id']===_0x23883f[_0x086e('0x2e')]['id']){if(!_0x23883f[_0x086e('0x5b')][_0x086e('0x8d')]||!_0x23883f[_0x086e('0x5b')][_0x086e('0x8e')]){throw new db[(_0x086e('0x8f'))]['ValidationError'](_0x086e('0x90'));}if(!_0x3d4b1c[_0x086e('0x91')](_0x23883f[_0x086e('0x5b')][_0x086e('0x8d')])){throw new db['Sequelize']['ValidationError'](_0x086e('0x92'));}if(_0x23883f[_0x086e('0x5b')][_0x086e('0x8d')]===_0x23883f['body']['newPassword']){throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0x94'));}}else if(_0x23883f[_0x086e('0x2e')][_0x086e('0x2c')]===_0x086e('0x7a')){if(!_0x23883f[_0x086e('0x5b')][_0x086e('0x8e')]){throw new db['Sequelize'][(_0x086e('0x93'))](_0x086e('0x95'));}}else if(_0x23883f['user'][_0x086e('0x2c')]===_0x086e('0x2e')){if(!_0x23883f[_0x086e('0x5b')]['newPassword']){throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3d4b1c['role']!==_0x086e('0x30')){throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0x84'));}}else{throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0x84'));}return _0x3d4b1c;})['then'](handleEntityNotFound(_0x4d9139,null))[_0x086e('0x13')](function(_0x59e6eb){return db[_0x086e('0x96')][_0x086e('0x97')]({'attributes':['id',_0x086e('0x61'),_0x086e('0x98'),_0x086e('0x99')]})[_0x086e('0x13')](function(_0x36c249){if(_0x36c249[_0x086e('0x61')])authService[_0x086e('0x9a')](_0x23883f[_0x086e('0x5b')][_0x086e('0x8e')]);if(!_0x36c249[_0x086e('0x98')]||!_0x59e6eb[_0x086e('0x9b')])return _0x59e6eb;authService[_0x086e('0x9c')](_0x23883f[_0x086e('0x5b')][_0x086e('0x8e')],_0x59e6eb[_0x086e('0x9b')],_0x36c249['passwordHistoryLimit']);return _0x59e6eb;})[_0x086e('0x13')](saveUpdates({'password':_0x23883f[_0x086e('0x5b')][_0x086e('0x8e')],'passwordResetAt':_0x23883f[_0x086e('0x2e')]['id']==_0x23883f[_0x086e('0x53')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x23883f[_0x086e('0x5b')][_0x086e('0x8e')],_0x59e6eb[_0x086e('0x9b')])},null));})[_0x086e('0x13')](respondWithResult(_0x4d9139,null))[_0x086e('0x1e')](handleError(_0x4d9139,null));};exports[_0x086e('0x9d')]=function(_0x2f56e5,_0x23e401){var _0x234f51=_0x2f56e5[_0x086e('0x5b')]['channel'];return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x2f56e5[_0x086e('0x53')]['id']},'attributes':['id',_0x086e('0x38'),'role','online',_0x086e('0x9e'),'voicePause',_0x086e('0x9f')]})[_0x086e('0x13')](handleEntityNotFound(_0x23e401,null))[_0x086e('0x13')](function(_0x32ab1a){if(_0x32ab1a){if(!utils['isValidChannel'](_0x234f51)){throw new db['Sequelize']['ValidationError'](_0x086e('0xa0'));}return _0x32ab1a[_0x086e('0xa1')+_['capitalize'](_0x234f51[_0x086e('0xa2')]())+'Queues'](_0x2f56e5['body'][_0x086e('0x5e')],{'penalty':_0x2f56e5['body']['penalty']||0x0})[_0x086e('0xa3')](function(_0x254764){for(var _0x5ea50e=0x0;_0x5ea50e<_0x2f56e5[_0x086e('0x5b')][_0x086e('0x5e')]['length'];_0x5ea50e+=0x1){var _0x3efc75={'UserId':Number(_0x2f56e5['params']['id'])};_0x3efc75[_[_0x086e('0xa4')](_0x234f51[_0x086e('0xa2')]())+_0x086e('0xa5')]=Number(_0x2f56e5[_0x086e('0x5b')][_0x086e('0x5e')][_0x5ea50e]);socket[_0x086e('0xa6')](_0x086e('0x2e')+_[_0x086e('0xa4')](_0x234f51['toLowerCase']())+_0x086e('0xa7'),_0x3efc75);}return _0x254764;})[_0x086e('0x13')](function(){if(_0x234f51===_0x086e('0xa8')){return db['VoiceQueue'][_0x086e('0x47')]({'where':{'id':_0x2f56e5['body'][_0x086e('0x5e')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x086e('0x13')](function(_0x3850df){var _0x3e1f20=_0x32ab1a['get']({'plain':!![]});var _0x288127=[];if(_0x234f51===_0x086e('0xa8')&&_0x3e1f20[_0x086e('0x2c')]===_0x086e('0x30')&&_0x3e1f20[_0x086e('0xa9')]){for(var _0x3c0e64=0x0;_0x3c0e64<_0x3850df[_0x086e('0x4a')];_0x3c0e64+=0x1){_0x288127[_0x086e('0x4b')]({'membername':_0x3e1f20['name'],'UserId':_0x3e1f20['id'],'queue_name':_0x3850df[_0x3c0e64][_0x086e('0x38')],'VoiceQueueId':_0x3850df[_0x3c0e64]['id'],'interface':_[_0x086e('0x67')](_0x3e1f20[_0x086e('0x9f')])?util[_0x086e('0xaa')]('SIP/%s',_0x3e1f20[_0x086e('0x38')]):_0x3e1f20[_0x086e('0x9f')],'paused':_0x3e1f20['voicePause']||![],'penalty':_0x2f56e5[_0x086e('0x5b')][_0x086e('0xab')]||0x0});}return BPromise[_0x086e('0x87')](_0x288127,function(_0x2626ca){return db[_0x086e('0xac')][_0x086e('0xad')](_0x2626ca);});}return _0x32ab1a;});}})[_0x086e('0x13')](respondWithStatusCode(_0x23e401,null))[_0x086e('0x1e')](handleError(_0x23e401,null));};exports[_0x086e('0xae')]=function(_0x37d8a9,_0xd4839f){var _0x586a1a,_0x256f83;return db[_0x086e('0x3b')]['find']({'where':{'id':_0x37d8a9[_0x086e('0x53')]['id']},'attributes':['id',_0x086e('0x38'),_0x086e('0x2c')]})[_0x086e('0x13')](handleEntityNotFound(_0xd4839f,null))[_0x086e('0x13')](function(_0x13038a){if(_0x13038a){_0x586a1a=_0x13038a;if(!_0x37d8a9[_0x086e('0x41')][_0x086e('0xaf')]||!utils[_0x086e('0xb0')](_0x37d8a9[_0x086e('0x41')][_0x086e('0xaf')])){throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0xa0'));}return _0x13038a[_0x086e('0xb1')+_['capitalize'](_0x37d8a9['query'][_0x086e('0xaf')][_0x086e('0xa2')]())+_0x086e('0xb2')](_0x37d8a9[_0x086e('0x41')][_0x086e('0x5e')]);}})[_0x086e('0x13')](function(_0x3e232c){if(_[_0x086e('0xb3')](_0x37d8a9[_0x086e('0x41')]['ids'])){for(var _0x451ffe=0x0;_0x451ffe<_0x37d8a9[_0x086e('0x41')]['ids'][_0x086e('0x4a')];_0x451ffe+=0x1){_0x256f83={'UserId':Number(_0x37d8a9[_0x086e('0x53')]['id'])};_0x256f83[_[_0x086e('0xa4')](_0x37d8a9[_0x086e('0x41')]['channel']['toLowerCase']())+_0x086e('0xa5')]=Number(_0x37d8a9[_0x086e('0x41')][_0x086e('0x5e')][_0x451ffe]);socket['emit'](_0x086e('0x2e')+_[_0x086e('0xa4')](_0x37d8a9[_0x086e('0x41')]['channel'][_0x086e('0xa2')]())+_0x086e('0xb4'),_0x256f83);}}else{_0x256f83={'UserId':Number(_0x37d8a9['params']['id'])};_0x256f83[_['capitalize'](_0x37d8a9[_0x086e('0x41')][_0x086e('0xaf')][_0x086e('0xa2')]())+_0x086e('0xa5')]=Number(_0x37d8a9['query'][_0x086e('0x5e')]);socket['emit'](_0x086e('0x2e')+_[_0x086e('0xa4')](_0x37d8a9[_0x086e('0x41')][_0x086e('0xaf')]['toLowerCase']())+_0x086e('0xb4'),_0x256f83);}return _0x3e232c;})['then'](function(){if(_0x37d8a9[_0x086e('0x41')][_0x086e('0xaf')]==='voice'){return db[_0x086e('0xac')][_0x086e('0x2a')]({'where':{'UserId':_0x37d8a9[_0x086e('0x53')]['id'],'VoiceQueueId':_0x37d8a9[_0x086e('0x41')][_0x086e('0x5e')]},'individualHooks':!![]})[_0x086e('0x13')](function(){return _0x586a1a;});}return _0x586a1a;})['then'](respondWithStatusCode(_0xd4839f,null))[_0x086e('0x1e')](handleError(_0xd4839f,null));};exports[_0x086e('0xb5')]=function(_0x2e956b,_0x1ac795){_0x2e956b[_0x086e('0x5b')][_0x086e('0xb6')]=_0x2e956b['file'][_0x086e('0xb7')];return db[_0x086e('0x3b')]['find']({'where':{'id':_0x2e956b[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x1ac795,null))[_0x086e('0x13')](saveUpdates(_0x2e956b[_0x086e('0x5b')],null))['then'](respondWithResult(_0x1ac795,null))[_0x086e('0x1e')](handleError(_0x1ac795,null));};exports[_0x086e('0xb8')]=function(_0x159d16,_0x1314e4){var _0x3dc7e0=path[_0x086e('0xb9')](config[_0x086e('0xba')],_0x086e('0xbb'));return db[_0x086e('0x3b')]['find']({'where':{'id':_0x159d16[_0x086e('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x086e('0x13')](handleEntityNotFound(_0x1314e4,null))[_0x086e('0x13')](function(_0x5c6369){if(_0x5c6369){if(_[_0x086e('0x67')](_0x5c6369[_0x086e('0xb6')])){return _0x1314e4['download'](_0x3dc7e0);}else{if(!fs[_0x086e('0xbc')](path[_0x086e('0xb9')](config['root'],_0x086e('0xbd'),_0x5c6369[_0x086e('0xb6')]))){return _0x1314e4['download'](_0x3dc7e0);}return _0x1314e4[_0x086e('0xbe')](path[_0x086e('0xb9')](config[_0x086e('0xba')],'server/files/images/',_0x5c6369[_0x086e('0xb6')]));}}})[_0x086e('0x1e')](handleError(_0x1314e4,null));};exports['getOpenTabs']=function(_0x36bc54,_0x2e96bd){return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x36bc54[_0x086e('0x53')]['id']},'attributes':['id']})[_0x086e('0x13')](handleEntityNotFound(_0x2e96bd,null))[_0x086e('0x13')](function(_0x2819e7){var _0x44cd99=[];values=_0x2819e7[_0x086e('0x4d')];_0x44cd99[_0x086e('0x4b')](get_open_tabs(_0x086e('0x4c'),_0x2819e7[_0x086e('0x4d')]));_0x44cd99[_0x086e('0x4b')](get_open_tabs(_0x086e('0x4e'),_0x2819e7[_0x086e('0x4d')]));_0x44cd99[_0x086e('0x4b')](get_open_tabs(_0x086e('0x59'),_0x2819e7[_0x086e('0x4d')]));_0x44cd99[_0x086e('0x4b')](get_open_tabs(_0x086e('0x5a'),_0x2819e7[_0x086e('0x4d')]));_0x44cd99[_0x086e('0x4b')](get_open_tabs('fax',_0x2819e7['dataValues']));_0x44cd99[_0x086e('0x4b')](get_open_tabs('mail',_0x2819e7[_0x086e('0x4d')]));return BPromise['all'](_0x44cd99);})[_0x086e('0x13')](function(_0x2e9f9c){if(_0x2e9f9c){var _0x59f959=_['map'](values[_0x086e('0xbf')],function(_0x50a8ff){return{'channel':_0x086e('0xc0'),'id':_0x50a8ff['id'],'createdAt':_0x50a8ff[_0x086e('0xc1')]};});var _0x377c55=_['map'](values[_0x086e('0xc2')],function(_0xa44c65){return{'channel':_0x086e('0xc3'),'id':_0xa44c65['id'],'createdAt':_0xa44c65[_0x086e('0xc1')]};});var _0x3963b8=_[_0x086e('0x34')](values[_0x086e('0xc4')],function(_0x1f5317){return{'channel':_0x086e('0xc5'),'id':_0x1f5317['id'],'createdAt':_0x1f5317['createdAt']};});var _0x153cf7=_[_0x086e('0x34')](values[_0x086e('0xc6')],function(_0x27b91b){return{'channel':_0x086e('0xc7'),'id':_0x27b91b['id'],'createdAt':_0x27b91b[_0x086e('0xc1')]};});var _0x42fa53=_[_0x086e('0x34')](values['SmsOpenTabs'],function(_0x5550f9){return{'channel':'SMS','id':_0x5550f9['id'],'createdAt':_0x5550f9[_0x086e('0xc1')]};});var _0x351570=_[_0x086e('0x34')](values['WhatsappOpenTabs'],function(_0x73acde){return{'channel':_0x086e('0xc8'),'id':_0x73acde['id'],'createdAt':_0x73acde['createdAt']};});var _0x4f2e75=_['concat'](_0x59f959,_0x377c55,_0x3963b8,_0x153cf7,_0x42fa53,_0x351570);var _0x382fb0={'count':_0x4f2e75[_0x086e('0x4a')],'rows':_0x4f2e75};return _0x382fb0;}else return null;})[_0x086e('0x13')](respondWithResult(_0x2e96bd,null))[_0x086e('0x1e')](handleError(_0x2e96bd,null));};exports[_0x086e('0xc9')]=function(_0x3ad90d,_0x4525e9){var _0xd44169={};var _0x282a70={};var _0x4178db;var _0x35da78;return db['User'][_0x086e('0x97')]({'where':{'id':_0x3ad90d[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x4525e9,null))[_0x086e('0x13')](function(_0x356c1d){if(_0x356c1d){_0x4178db=_0x356c1d;_0x282a70[_0x086e('0x55')]=_[_0x086e('0x54')](db[_0x086e('0xca')][_0x086e('0x3c')]);_0x282a70['query']=_[_0x086e('0x54')](_0x3ad90d['query']);_0x282a70[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x282a70[_0x086e('0x55')],_0x282a70[_0x086e('0x41')]);_0xd44169['attributes']=_[_0x086e('0xcc')](_0x282a70[_0x086e('0x55')],qs[_0x086e('0x56')](_0x3ad90d['query']['fields']));_0xd44169[_0x086e('0x46')]=_0xd44169[_0x086e('0x46')]['length']?_0xd44169[_0x086e('0x46')]:_0x282a70[_0x086e('0x55')];_0xd44169[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x3ad90d[_0x086e('0x41')][_0x086e('0xce')]);_0xd44169['where']=qs['filters'](_['pick'](_0x3ad90d[_0x086e('0x41')],_0x282a70[_0x086e('0xcb')]));if(_0x3ad90d[_0x086e('0x41')]['filter']){_0xd44169[_0x086e('0xcf')]=_['merge'](_0xd44169[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0xd44169[_0x086e('0x46')],function(_0x34c6eb){var _0x57c22d={};_0x57c22d[_0x34c6eb]={'$like':'%'+_0x3ad90d[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x57c22d;})});}_0xd44169=_[_0x086e('0x58')]({},_0xd44169,_0x3ad90d['options']);return _0x4178db[_0x086e('0xc9')](_0xd44169);}})[_0x086e('0x13')](function(_0x44d860){if(_0x44d860){_0x35da78=_0x44d860['length'];if(_0x3ad90d[_0x086e('0x41')][_0x086e('0xd0')](_0x086e('0x42'))){_0xd44169[_0x086e('0x44')]=[{'model':db[_0x086e('0xd1')],'as':_0x086e('0xd2'),'required':![]},{'model':db[_0x086e('0xd3')],'as':_0x086e('0xd4'),'attributes':['id',_0x086e('0x38'),_0x086e('0xd5')],'where':_0x3ad90d['query'][_0x086e('0xd6')]?{'id':_0x3ad90d[_0x086e('0x41')][_0x086e('0xd6')]}:undefined,'required':_0x3ad90d[_0x086e('0x41')]['tag']?!![]:![]}];}if(!_0x3ad90d['query'][_0x086e('0xd0')](_0x086e('0xd7'))){_0xd44169[_0x086e('0x24')]=qs[_0x086e('0x24')](_0x3ad90d[_0x086e('0x41')][_0x086e('0x24')]);_0xd44169[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x3ad90d[_0x086e('0x41')][_0x086e('0x22')]);}return _0x4178db[_0x086e('0xc9')](_0xd44169);}})['then'](function(_0x14d478){if(_0x14d478){return _0x14d478?{'count':_0x35da78,'rows':_0x14d478}:null;}})[_0x086e('0x13')](respondWithResult(_0x4525e9,null))[_0x086e('0x1e')](handleError(_0x4525e9,null));};exports['getQueues']=function(_0x3f3151,_0x45dfc1){var _0x1a5949;var _0x4dd8c0={};var _0x11fb9b;return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x3f3151[_0x086e('0x53')]['id']},'attributes':['id',_0x086e('0x38'),'role']})[_0x086e('0x13')](handleEntityNotFound(_0x45dfc1,null))['then'](function(_0x5b0c0a){if(!utils[_0x086e('0xb0')](_0x3f3151[_0x086e('0x41')][_0x086e('0xaf')])){throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0xa0'));}_0x1a5949=_0x5b0c0a;var _0x162a77={};_0x162a77[_0x086e('0x55')]=_[_0x086e('0x54')](db[_[_0x086e('0xa4')](_0x3f3151[_0x086e('0x41')]['channel'])+_0x086e('0xd8')]['rawAttributes']);_0x162a77[_0x086e('0x41')]=_[_0x086e('0x54')](_0x3f3151[_0x086e('0x41')]);_0x162a77['filters']=_[_0x086e('0xcc')](_0x162a77[_0x086e('0x55')],_0x162a77['query']);_0x4dd8c0[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x162a77[_0x086e('0x55')],qs[_0x086e('0x56')](_0x3f3151[_0x086e('0x41')]['fields']));_0x4dd8c0[_0x086e('0x46')]=_0x4dd8c0['attributes'][_0x086e('0x4a')]?_0x4dd8c0['attributes']:_0x162a77[_0x086e('0x55')];_0x4dd8c0['order']=qs['sort'](_0x3f3151[_0x086e('0x41')][_0x086e('0xce')]);_0x4dd8c0['where']=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x3f3151['query'],_0x162a77[_0x086e('0xcb')]));if(_0x3f3151['query'][_0x086e('0x32')]){_0x4dd8c0[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x4dd8c0[_0x086e('0xcf')],{'$or':_['map'](_0x4dd8c0[_0x086e('0x46')],function(_0x14333f){var _0x5c5695={};_0x5c5695[_0x14333f]={'$like':'%'+_0x3f3151[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x5c5695;})});}_0x4dd8c0=_[_0x086e('0x58')]({},_0x4dd8c0,_0x3f3151[_0x086e('0xda')]);switch(_0x1a5949[_0x086e('0x2c')]){case _0x086e('0x7a'):return db[_[_0x086e('0xa4')](_0x3f3151[_0x086e('0x41')][_0x086e('0xaf')])+_0x086e('0xd8')][_0x086e('0x47')](_0x4dd8c0);case'user':case _0x086e('0x30'):return _0x1a5949[_0x086e('0x2b')+_['capitalize'](_0x3f3151[_0x086e('0x41')]['channel'])+_0x086e('0xb2')](_0x4dd8c0);default:throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0xdb'));}})['then'](function(_0x5c6508){_0x11fb9b=_0x5c6508[_0x086e('0x4a')];if(!_0x3f3151['query']['hasOwnProperty'](_0x086e('0xd7'))){_0x4dd8c0['limit']=qs['limit'](_0x3f3151[_0x086e('0x41')]['limit']);_0x4dd8c0[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x3f3151['query'][_0x086e('0x22')]);}switch(_0x1a5949[_0x086e('0x2c')]){case'admin':return db[_[_0x086e('0xa4')](_0x3f3151[_0x086e('0x41')][_0x086e('0xaf')])+'Queue'][_0x086e('0x47')](_0x4dd8c0);case _0x086e('0x2e'):case'agent':return _0x1a5949[_0x086e('0x2b')+_[_0x086e('0xa4')](_0x3f3151[_0x086e('0x41')][_0x086e('0xaf')])+_0x086e('0xb2')](_0x4dd8c0);}})[_0x086e('0x13')](function(_0x858a52){return{'count':_0x11fb9b,'rows':_0x858a52};})[_0x086e('0x13')](respondWithResult(_0x45dfc1,null))[_0x086e('0x1e')](handleError(_0x45dfc1,null));};exports['getVoiceQueuesRt']=function(_0x2d9bba,_0x212b8e){var _0x418b3c={};var _0x4ba519={};var _0x2c7b87;var _0x9dd3e9;return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x2d9bba[_0x086e('0x53')]['id']}})['then'](handleEntityNotFound(_0x212b8e,null))[_0x086e('0x13')](function(_0x207449){if(_0x207449){_0x2c7b87=_0x207449;_0x4ba519[_0x086e('0x55')]=_['keys'](db[_0x086e('0xac')][_0x086e('0x3c')]);_0x4ba519[_0x086e('0x41')]=_['keys'](_0x2d9bba['query']);_0x4ba519['filters']=_[_0x086e('0xcc')](_0x4ba519[_0x086e('0x55')],_0x4ba519[_0x086e('0x41')]);_0x418b3c[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x4ba519['model'],qs['fields'](_0x2d9bba[_0x086e('0x41')][_0x086e('0x56')]));_0x418b3c[_0x086e('0x46')]=_0x418b3c['attributes'][_0x086e('0x4a')]?_0x418b3c[_0x086e('0x46')]:_0x4ba519[_0x086e('0x55')];_0x418b3c['order']=qs[_0x086e('0xce')](_0x2d9bba[_0x086e('0x41')]['sort']);_0x418b3c[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x2d9bba[_0x086e('0x41')],_0x4ba519['filters']));if(_0x2d9bba[_0x086e('0x41')][_0x086e('0x32')]){_0x418b3c[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x418b3c[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x418b3c[_0x086e('0x46')],function(_0x333677){var _0x20aed8={};_0x20aed8[_0x333677]={'$like':'%'+_0x2d9bba[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x20aed8;})});}_0x418b3c=_['merge']({},_0x418b3c,_0x2d9bba[_0x086e('0xda')]);return _0x2c7b87['getVoiceQueuesRt'](_0x418b3c);}})[_0x086e('0x13')](function(_0x56880b){if(_0x56880b){_0x9dd3e9=_0x56880b['length'];if(!_0x2d9bba[_0x086e('0x41')][_0x086e('0xd0')]('nolimit')){_0x418b3c[_0x086e('0x24')]=qs['limit'](_0x2d9bba['query'][_0x086e('0x24')]);_0x418b3c[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x2d9bba[_0x086e('0x41')][_0x086e('0x22')]);}return _0x2c7b87[_0x086e('0xdc')](_0x418b3c);}})[_0x086e('0x13')](function(_0xecf051){if(_0xecf051){return _0xecf051?{'count':_0x9dd3e9,'rows':_0xecf051}:null;}})[_0x086e('0x13')](respondWithResult(_0x212b8e,null))[_0x086e('0x1e')](handleError(_0x212b8e,null));};exports[_0x086e('0xdd')]=function(_0x38d440,_0x166b71){var _0x42d22a={};var _0x18b3a2={};var _0x368cd3;var _0x4e2a22;return db['User'][_0x086e('0x97')]({'where':{'id':_0x38d440['params']['id']}})['then'](handleEntityNotFound(_0x166b71,null))[_0x086e('0x13')](function(_0x4d4848){if(_0x4d4848){_0x368cd3=_0x4d4848;_0x18b3a2[_0x086e('0x55')]=_['keys'](db[_0x086e('0xde')][_0x086e('0x3c')]);_0x18b3a2['query']=_[_0x086e('0x54')](_0x38d440[_0x086e('0x41')]);_0x18b3a2[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x18b3a2['model'],_0x18b3a2[_0x086e('0x41')]);_0x42d22a[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x18b3a2['model'],qs[_0x086e('0x56')](_0x38d440[_0x086e('0x41')]['fields']));_0x42d22a['attributes']=_0x42d22a[_0x086e('0x46')][_0x086e('0x4a')]?_0x42d22a[_0x086e('0x46')]:_0x18b3a2[_0x086e('0x55')];_0x42d22a['order']=qs[_0x086e('0xce')](_0x38d440[_0x086e('0x41')][_0x086e('0xce')]);_0x42d22a[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x38d440[_0x086e('0x41')],_0x18b3a2[_0x086e('0xcb')]));if(_0x38d440['query'][_0x086e('0x32')]){_0x42d22a[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x42d22a[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x42d22a[_0x086e('0x46')],function(_0x14739e){var _0x5b77e5={};_0x5b77e5[_0x14739e]={'$like':'%'+_0x38d440['query']['filter']+'%'};return _0x5b77e5;})});}_0x42d22a=_[_0x086e('0x58')]({},_0x42d22a,_0x38d440[_0x086e('0xda')]);return _0x368cd3['getGroups'](_0x42d22a);}})['then'](function(_0x180129){if(_0x180129){_0x4e2a22=_0x180129['length'];if(!_0x38d440[_0x086e('0x41')][_0x086e('0xd0')](_0x086e('0xd7'))){_0x42d22a[_0x086e('0x24')]=qs[_0x086e('0x24')](_0x38d440[_0x086e('0x41')]['limit']);_0x42d22a[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x38d440[_0x086e('0x41')]['offset']);}return _0x368cd3[_0x086e('0xdd')](_0x42d22a);}})[_0x086e('0x13')](function(_0x205eec){if(_0x205eec){return _0x205eec?{'count':_0x4e2a22,'rows':_0x205eec}:null;}})[_0x086e('0x13')](respondWithResult(_0x166b71,null))['catch'](handleError(_0x166b71,null));};exports[_0x086e('0xdf')]=function(_0x5058d6,_0xf52a4e){var _0x563bd5={'raw':!![],'where':{}};var _0x52e2f1={};var _0x86d905={'count':0x0,'rows':[]};return db[_0x086e('0x3b')]['findOne']({'where':{'id':_0x5058d6[_0x086e('0x53')]['id']}})['then'](handleEntityNotFound(_0xf52a4e,null))[_0x086e('0x13')](function(_0x4670ff){if(_0x4670ff){_0x52e2f1[_0x086e('0x55')]=_['keys'](db[_0x086e('0xe0')][_0x086e('0x3c')]);_0x52e2f1[_0x086e('0x41')]=_['keys'](_0x5058d6[_0x086e('0x41')]);_0x52e2f1[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x52e2f1['model'],_0x52e2f1[_0x086e('0x41')]);_0x563bd5[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x52e2f1[_0x086e('0x55')],qs['fields'](_0x5058d6[_0x086e('0x41')][_0x086e('0x56')]));_0x563bd5[_0x086e('0x46')]=_0x563bd5[_0x086e('0x46')][_0x086e('0x4a')]?_0x563bd5[_0x086e('0x46')]:_0x52e2f1[_0x086e('0x55')];if(!_0x5058d6[_0x086e('0x41')]['hasOwnProperty'](_0x086e('0xd7'))){_0x563bd5['limit']=qs[_0x086e('0x24')](_0x5058d6[_0x086e('0x41')]['limit']);_0x563bd5['offset']=qs[_0x086e('0x22')](_0x5058d6['query'][_0x086e('0x22')]);}_0x563bd5['order']=qs[_0x086e('0xce')](_0x5058d6[_0x086e('0x41')][_0x086e('0xce')]);_0x563bd5[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x5058d6[_0x086e('0x41')],_0x52e2f1[_0x086e('0xcb')]));_0x563bd5[_0x086e('0xcf')][_0x086e('0xe1')]=_0x4670ff['id'];if(_0x5058d6[_0x086e('0x41')][_0x086e('0x32')]){_0x563bd5[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x563bd5[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x563bd5[_0x086e('0x46')],function(_0x247696){var _0x4de5cf={};_0x4de5cf[_0x247696]={'$like':'%'+_0x5058d6['query']['filter']+'%'};return _0x4de5cf;})});}_0x563bd5=_[_0x086e('0x58')]({},_0x563bd5,_0x5058d6[_0x086e('0xda')]);return db[_0x086e('0xe0')][_0x086e('0x25')]({'where':_0x563bd5[_0x086e('0xcf')]})[_0x086e('0x13')](function(_0x5ce125){_0x86d905[_0x086e('0x25')]=_0x5ce125;if(_0x5058d6['query'][_0x086e('0x42')]){_0x563bd5[_0x086e('0x44')]=[{'all':!![]}];}return db[_0x086e('0xe0')][_0x086e('0x47')](_0x563bd5);})[_0x086e('0x13')](function(_0x2c1f81){_0x86d905[_0x086e('0x48')]=_0x2c1f81;return _0x86d905;});}})[_0x086e('0x13')](respondWithFilteredResult(_0xf52a4e,_0x563bd5))['catch'](handleError(_0xf52a4e,null));};exports[_0x086e('0xe2')]=function(_0x4da4a2,_0x2fe9a8){var _0x81dd2f={'raw':!![],'where':{}};var _0x53a045={};var _0x150e09={'count':0x0,'rows':[]};return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x4da4a2[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x2fe9a8,null))['then'](function(_0x5b0b25){if(_0x5b0b25){_0x53a045[_0x086e('0x55')]=_[_0x086e('0x54')](db[_0x086e('0xe3')][_0x086e('0x3c')]);_0x53a045[_0x086e('0x41')]=_[_0x086e('0x54')](_0x4da4a2[_0x086e('0x41')]);_0x53a045['filters']=_[_0x086e('0xcc')](_0x53a045[_0x086e('0x55')],_0x53a045[_0x086e('0x41')]);_0x81dd2f['attributes']=_[_0x086e('0xcc')](_0x53a045[_0x086e('0x55')],qs[_0x086e('0x56')](_0x4da4a2['query']['fields']));_0x81dd2f[_0x086e('0x46')]=_0x81dd2f[_0x086e('0x46')][_0x086e('0x4a')]?_0x81dd2f[_0x086e('0x46')]:_0x53a045[_0x086e('0x55')];if(!_0x4da4a2[_0x086e('0x41')]['hasOwnProperty'](_0x086e('0xd7'))){_0x81dd2f[_0x086e('0x24')]=qs[_0x086e('0x24')](_0x4da4a2['query']['limit']);_0x81dd2f[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x4da4a2['query'][_0x086e('0x22')]);}_0x81dd2f[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x4da4a2['query'][_0x086e('0xce')]);_0x81dd2f['where']=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x4da4a2[_0x086e('0x41')],_0x53a045[_0x086e('0xcb')]));_0x81dd2f[_0x086e('0xcf')][_0x086e('0xe1')]=_0x5b0b25['id'];if(_0x4da4a2['query']['filter']){_0x81dd2f[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x81dd2f[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x81dd2f[_0x086e('0x46')],function(_0x37afa4){var _0x4fa130={};_0x4fa130[_0x37afa4]={'$like':'%'+_0x4da4a2[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x4fa130;})});}_0x81dd2f=_['merge']({},_0x81dd2f,_0x4da4a2[_0x086e('0xda')]);return db[_0x086e('0xe3')][_0x086e('0x25')]({'where':_0x81dd2f['where']})[_0x086e('0x13')](function(_0x54684b){_0x150e09[_0x086e('0x25')]=_0x54684b;if(_0x4da4a2[_0x086e('0x41')]['includeAll']){_0x81dd2f['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x086e('0x47')](_0x81dd2f);})[_0x086e('0x13')](function(_0x411468){_0x150e09[_0x086e('0x48')]=_0x411468;return _0x150e09;});}})[_0x086e('0x13')](respondWithFilteredResult(_0x2fe9a8,_0x81dd2f))[_0x086e('0x1e')](handleError(_0x2fe9a8,null));};exports[_0x086e('0xe4')]=function(_0x2e82dc,_0x399f19){var _0x4a0f71={};var _0x2b5a36={};var _0xb205d1;var _0x476268;return db['User'][_0x086e('0x97')]({'where':{'id':_0x2e82dc[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x399f19,null))[_0x086e('0x13')](function(_0x4ab5f5){if(_0x4ab5f5){_0xb205d1=_0x4ab5f5;_0x2b5a36['model']=_[_0x086e('0x54')](db[_0x086e('0xe5')][_0x086e('0x3c')]);_0x2b5a36[_0x086e('0x41')]=_[_0x086e('0x54')](_0x2e82dc[_0x086e('0x41')]);_0x2b5a36[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x2b5a36[_0x086e('0x55')],_0x2b5a36[_0x086e('0x41')]);_0x4a0f71[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x2b5a36[_0x086e('0x55')],qs['fields'](_0x2e82dc[_0x086e('0x41')][_0x086e('0x56')]));_0x4a0f71['attributes']=_0x4a0f71[_0x086e('0x46')]['length']?_0x4a0f71['attributes']:_0x2b5a36[_0x086e('0x55')];_0x4a0f71[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x2e82dc[_0x086e('0x41')][_0x086e('0xce')]);_0x4a0f71[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x2e82dc[_0x086e('0x41')],_0x2b5a36[_0x086e('0xcb')]));if(_0x2e82dc['query']['filter']){_0x4a0f71['where']=_[_0x086e('0x58')](_0x4a0f71[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x4a0f71[_0x086e('0x46')],function(_0x1a0be1){var _0x2689e0={};_0x2689e0[_0x1a0be1]={'$like':'%'+_0x2e82dc[_0x086e('0x41')]['filter']+'%'};return _0x2689e0;})});}_0x4a0f71=_[_0x086e('0x58')]({},_0x4a0f71,_0x2e82dc[_0x086e('0xda')]);return _0xb205d1[_0x086e('0xe4')](_0x4a0f71);}})[_0x086e('0x13')](function(_0x31c224){if(_0x31c224){_0x476268=_0x31c224[_0x086e('0x4a')];if(!_0x2e82dc[_0x086e('0x41')][_0x086e('0xd0')](_0x086e('0xd7'))){_0x4a0f71['limit']=qs[_0x086e('0x24')](_0x2e82dc['query'][_0x086e('0x24')]);_0x4a0f71[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x2e82dc['query'][_0x086e('0x22')]);}return _0xb205d1[_0x086e('0xe4')](_0x4a0f71);}})['then'](function(_0x44be22){if(_0x44be22){return _0x44be22?{'count':_0x476268,'rows':_0x44be22}:null;}})[_0x086e('0x13')](respondWithResult(_0x399f19,null))[_0x086e('0x1e')](handleError(_0x399f19,null));};exports[_0x086e('0xe6')]=function(_0x373d52,_0x40383d){var _0x555b8e={};var _0x66e1c7={};var _0x340a67;var _0x5ecba2;return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x373d52[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x40383d,null))[_0x086e('0x13')](function(_0x32287e){if(_0x32287e){_0x340a67=_0x32287e;_0x66e1c7[_0x086e('0x55')]=_[_0x086e('0x54')](db['OpenchannelInteraction'][_0x086e('0x3c')]);_0x66e1c7[_0x086e('0x41')]=_[_0x086e('0x54')](_0x373d52[_0x086e('0x41')]);_0x66e1c7[_0x086e('0xcb')]=_['intersection'](_0x66e1c7[_0x086e('0x55')],_0x66e1c7[_0x086e('0x41')]);_0x555b8e['attributes']=_[_0x086e('0xcc')](_0x66e1c7['model'],qs['fields'](_0x373d52[_0x086e('0x41')][_0x086e('0x56')]));_0x555b8e[_0x086e('0x46')]=_0x555b8e[_0x086e('0x46')][_0x086e('0x4a')]?_0x555b8e[_0x086e('0x46')]:_0x66e1c7[_0x086e('0x55')];_0x555b8e[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x373d52[_0x086e('0x41')][_0x086e('0xce')]);_0x555b8e[_0x086e('0xcf')]=qs['filters'](_['pick'](_0x373d52[_0x086e('0x41')],_0x66e1c7['filters']));if(_0x373d52['query'][_0x086e('0x32')]){_0x555b8e[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x555b8e['where'],{'$or':_[_0x086e('0x34')](_0x555b8e[_0x086e('0x46')],function(_0x26e4f0){var _0x14b139={};_0x14b139[_0x26e4f0]={'$like':'%'+_0x373d52[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x14b139;})});}_0x555b8e=_['merge']({},_0x555b8e,_0x373d52[_0x086e('0xda')]);return _0x340a67[_0x086e('0xe6')](_0x555b8e);}})[_0x086e('0x13')](function(_0xc53d27){if(_0xc53d27){_0x5ecba2=_0xc53d27[_0x086e('0x4a')];if(!_0x373d52[_0x086e('0x41')][_0x086e('0xd0')](_0x086e('0xd7'))){_0x555b8e[_0x086e('0x24')]=qs['limit'](_0x373d52[_0x086e('0x41')][_0x086e('0x24')]);_0x555b8e[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x373d52[_0x086e('0x41')][_0x086e('0x22')]);}return _0x340a67[_0x086e('0xe6')](_0x555b8e);}})[_0x086e('0x13')](function(_0x8d549d){if(_0x8d549d){return _0x8d549d?{'count':_0x5ecba2,'rows':_0x8d549d}:null;}})['then'](respondWithResult(_0x40383d,null))[_0x086e('0x1e')](handleError(_0x40383d,null));};exports[_0x086e('0xe7')]=function(_0x48a09b,_0x3641b1){var _0x3d281a={'raw':!![],'where':{}};var _0x4442c3={};var _0x185a4f={'count':0x0,'rows':[]};return db[_0x086e('0x3b')]['findOne']({'where':{'id':_0x48a09b[_0x086e('0x53')]['id']}})['then'](handleEntityNotFound(_0x3641b1,null))[_0x086e('0x13')](function(_0x17b974){if(_0x17b974){_0x4442c3['model']=_[_0x086e('0x54')](db[_0x086e('0xe8')]['rawAttributes']);_0x4442c3[_0x086e('0x41')]=_['keys'](_0x48a09b[_0x086e('0x41')]);_0x4442c3[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x4442c3[_0x086e('0x55')],_0x4442c3[_0x086e('0x41')]);_0x3d281a[_0x086e('0x46')]=_['intersection'](_0x4442c3[_0x086e('0x55')],qs[_0x086e('0x56')](_0x48a09b[_0x086e('0x41')][_0x086e('0x56')]));_0x3d281a[_0x086e('0x46')]=_0x3d281a['attributes'][_0x086e('0x4a')]?_0x3d281a[_0x086e('0x46')]:_0x4442c3[_0x086e('0x55')];if(!_0x48a09b[_0x086e('0x41')]['hasOwnProperty'](_0x086e('0xd7'))){_0x3d281a[_0x086e('0x24')]=qs['limit'](_0x48a09b['query'][_0x086e('0x24')]);_0x3d281a[_0x086e('0x22')]=qs[_0x086e('0x22')](_0x48a09b[_0x086e('0x41')]['offset']);}_0x3d281a[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x48a09b[_0x086e('0x41')][_0x086e('0xce')]);_0x3d281a[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x48a09b[_0x086e('0x41')],_0x4442c3[_0x086e('0xcb')]));_0x3d281a[_0x086e('0xcf')][_0x086e('0xe1')]=_0x17b974['id'];if(_0x48a09b[_0x086e('0x41')]['filter']){_0x3d281a[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x3d281a[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x3d281a[_0x086e('0x46')],function(_0xab6fb){var _0x30bf2e={};_0x30bf2e[_0xab6fb]={'$like':'%'+_0x48a09b[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x30bf2e;})});}_0x3d281a=_[_0x086e('0x58')]({},_0x3d281a,_0x48a09b[_0x086e('0xda')]);return db[_0x086e('0xe8')][_0x086e('0x25')]({'where':_0x3d281a['where']})['then'](function(_0x4eb808){_0x185a4f['count']=_0x4eb808;if(_0x48a09b[_0x086e('0x41')][_0x086e('0x42')]){_0x3d281a[_0x086e('0x44')]=[{'all':!![]}];}return db[_0x086e('0xe8')]['findAll'](_0x3d281a);})['then'](function(_0x23f0dc){_0x185a4f['rows']=_0x23f0dc;return _0x185a4f;});}})['then'](respondWithFilteredResult(_0x3641b1,_0x3d281a))[_0x086e('0x1e')](handleError(_0x3641b1,null));};exports[_0x086e('0xe9')]=function(_0x31a52e,_0x2b0a3f){var _0x43a3ce={};var _0x4cafa9={};var _0x21b0cc;var _0x9f501a;return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x31a52e[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x2b0a3f,null))[_0x086e('0x13')](function(_0x518712){if(_0x518712){_0x21b0cc=_0x518712;_0x4cafa9[_0x086e('0x55')]=_[_0x086e('0x54')](db[_0x086e('0xea')][_0x086e('0x3c')]);_0x4cafa9['query']=_[_0x086e('0x54')](_0x31a52e[_0x086e('0x41')]);_0x4cafa9['filters']=_[_0x086e('0xcc')](_0x4cafa9[_0x086e('0x55')],_0x4cafa9[_0x086e('0x41')]);_0x43a3ce[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x4cafa9[_0x086e('0x55')],qs[_0x086e('0x56')](_0x31a52e[_0x086e('0x41')]['fields']));_0x43a3ce['attributes']=_0x43a3ce['attributes'][_0x086e('0x4a')]?_0x43a3ce['attributes']:_0x4cafa9[_0x086e('0x55')];_0x43a3ce[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x31a52e[_0x086e('0x41')][_0x086e('0xce')]);_0x43a3ce[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x31a52e[_0x086e('0x41')],_0x4cafa9[_0x086e('0xcb')]));if(_0x31a52e['query'][_0x086e('0x32')]){_0x43a3ce[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x43a3ce[_0x086e('0xcf')],{'$or':_['map'](_0x43a3ce[_0x086e('0x46')],function(_0x38b904){var _0x2219f0={};_0x2219f0[_0x38b904]={'$like':'%'+_0x31a52e[_0x086e('0x41')]['filter']+'%'};return _0x2219f0;})});}_0x43a3ce=_[_0x086e('0x58')]({},_0x43a3ce,_0x31a52e['options']);return _0x21b0cc['getSmsInteractions'](_0x43a3ce);}})[_0x086e('0x13')](function(_0xa74640){if(_0xa74640){_0x9f501a=_0xa74640[_0x086e('0x4a')];if(!_0x31a52e['query'][_0x086e('0xd0')](_0x086e('0xd7'))){_0x43a3ce[_0x086e('0x24')]=qs[_0x086e('0x24')](_0x31a52e[_0x086e('0x41')][_0x086e('0x24')]);_0x43a3ce[_0x086e('0x22')]=qs['offset'](_0x31a52e[_0x086e('0x41')][_0x086e('0x22')]);}return _0x21b0cc[_0x086e('0xe9')](_0x43a3ce);}})[_0x086e('0x13')](function(_0x20a8df){if(_0x20a8df){return _0x20a8df?{'count':_0x9f501a,'rows':_0x20a8df}:null;}})[_0x086e('0x13')](respondWithResult(_0x2b0a3f,null))['catch'](handleError(_0x2b0a3f,null));};exports[_0x086e('0xeb')]=function(_0x5a37ac,_0x4e4047){var _0x46e6da={};var _0x3d3137={};var _0x503c88;var _0x740c9f;return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x5a37ac[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x4e4047,null))[_0x086e('0x13')](function(_0x5536c5){if(_0x5536c5){_0x503c88=_0x5536c5;_0x3d3137['model']=_[_0x086e('0x54')](db['FaxInteraction']['rawAttributes']);_0x3d3137['query']=_[_0x086e('0x54')](_0x5a37ac[_0x086e('0x41')]);_0x3d3137[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x3d3137[_0x086e('0x55')],_0x3d3137['query']);_0x46e6da[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x3d3137[_0x086e('0x55')],qs['fields'](_0x5a37ac['query'][_0x086e('0x56')]));_0x46e6da[_0x086e('0x46')]=_0x46e6da['attributes']['length']?_0x46e6da[_0x086e('0x46')]:_0x3d3137[_0x086e('0x55')];_0x46e6da[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x5a37ac[_0x086e('0x41')]['sort']);_0x46e6da[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x5a37ac[_0x086e('0x41')],_0x3d3137[_0x086e('0xcb')]));if(_0x5a37ac[_0x086e('0x41')][_0x086e('0x32')]){_0x46e6da[_0x086e('0xcf')]=_[_0x086e('0x58')](_0x46e6da[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x46e6da['attributes'],function(_0x299658){var _0x301fc9={};_0x301fc9[_0x299658]={'$like':'%'+_0x5a37ac[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x301fc9;})});}_0x46e6da=_['merge']({},_0x46e6da,_0x5a37ac[_0x086e('0xda')]);return _0x503c88[_0x086e('0xeb')](_0x46e6da);}})[_0x086e('0x13')](function(_0x51f1f7){if(_0x51f1f7){_0x740c9f=_0x51f1f7[_0x086e('0x4a')];if(!_0x5a37ac['query'][_0x086e('0xd0')](_0x086e('0xd7'))){_0x46e6da[_0x086e('0x24')]=qs['limit'](_0x5a37ac['query'][_0x086e('0x24')]);_0x46e6da['offset']=qs[_0x086e('0x22')](_0x5a37ac[_0x086e('0x41')][_0x086e('0x22')]);}return _0x503c88[_0x086e('0xeb')](_0x46e6da);}})[_0x086e('0x13')](function(_0x4b2ad5){if(_0x4b2ad5){return _0x4b2ad5?{'count':_0x740c9f,'rows':_0x4b2ad5}:null;}})[_0x086e('0x13')](respondWithResult(_0x4e4047,null))[_0x086e('0x1e')](handleError(_0x4e4047,null));};exports[_0x086e('0xec')]=function(_0x43eceb,_0x149371){var _0xf4f974={};var _0x50ff91={};var _0x3d2dfb;var _0x54f230;return db['User'][_0x086e('0x97')]({'where':{'id':_0x43eceb[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x149371,null))[_0x086e('0x13')](function(_0x5f1305){if(_0x5f1305){_0x3d2dfb=_0x5f1305;_0x50ff91[_0x086e('0x55')]=_['keys'](db[_0x086e('0xed')][_0x086e('0x3c')]);_0x50ff91[_0x086e('0x41')]=_['keys'](_0x43eceb[_0x086e('0x41')]);_0x50ff91['filters']=_['intersection'](_0x50ff91[_0x086e('0x55')],_0x50ff91['query']);_0xf4f974['attributes']=_[_0x086e('0xcc')](_0x50ff91['model'],qs[_0x086e('0x56')](_0x43eceb[_0x086e('0x41')][_0x086e('0x56')]));_0xf4f974[_0x086e('0x46')]=_0xf4f974['attributes'][_0x086e('0x4a')]?_0xf4f974[_0x086e('0x46')]:_0x50ff91[_0x086e('0x55')];_0xf4f974[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x43eceb[_0x086e('0x41')][_0x086e('0xce')]);_0xf4f974[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_['pick'](_0x43eceb[_0x086e('0x41')],_0x50ff91[_0x086e('0xcb')]));if(_0x43eceb[_0x086e('0x41')][_0x086e('0x32')]){_0xf4f974[_0x086e('0xcf')]=_[_0x086e('0x58')](_0xf4f974[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0xf4f974[_0x086e('0x46')],function(_0x3cd693){var _0x58d550={};_0x58d550[_0x3cd693]={'$like':'%'+_0x43eceb[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x58d550;})});}_0xf4f974=_[_0x086e('0x58')]({},_0xf4f974,_0x43eceb[_0x086e('0xda')]);return _0x3d2dfb[_0x086e('0xec')](_0xf4f974);}})[_0x086e('0x13')](function(_0x53b7a9){if(_0x53b7a9){_0x54f230=_0x53b7a9[_0x086e('0x4a')];if(!_0x43eceb[_0x086e('0x41')]['hasOwnProperty'](_0x086e('0xd7'))){_0xf4f974[_0x086e('0x24')]=qs[_0x086e('0x24')](_0x43eceb[_0x086e('0x41')]['limit']);_0xf4f974[_0x086e('0x22')]=qs['offset'](_0x43eceb[_0x086e('0x41')][_0x086e('0x22')]);}return _0x3d2dfb[_0x086e('0xec')](_0xf4f974);}})[_0x086e('0x13')](function(_0x1c1a19){if(_0x1c1a19){return _0x1c1a19?{'count':_0x54f230,'rows':_0x1c1a19}:null;}})[_0x086e('0x13')](respondWithResult(_0x149371,null))[_0x086e('0x1e')](handleError(_0x149371,null));};exports[_0x086e('0xee')]=function(_0x15c140,_0x4aa187,_0x461893){var _0x1a9a92;var _0x2f5bd4;var _0x3f9196;var _0x40a36b=!_[_0x086e('0x67')](_0x15c140['params']['id'])?_0x15c140[_0x086e('0x53')]['id']:!_['isNil'](_0x15c140[_0x086e('0x2e')]['id'])?_0x15c140[_0x086e('0x2e')]['id']:null;return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x40a36b,'role':{'$or':['admin',_0x086e('0x2e'),_0x086e('0x30')]}},'attributes':['id',_0x086e('0x38'),_0x086e('0xef'),_0x086e('0xf0'),_0x086e('0x2c'),'internal',_0x086e('0x9e')]})[_0x086e('0x13')](function(_0x1ee67d){if(_0x1ee67d){if(_0x1ee67d['role']==='agent'){_0x1a9a92=_0x1ee67d;if(_0x15c140[_0x086e('0x5b')][_0x086e('0x9f')]){_0x3f9196=util[_0x086e('0xaa')](_0x086e('0xf1'),_0x1a9a92[_0x15c140[_0x086e('0x5b')]['interface']]);}else if(_0x15c140[_0x086e('0x5b')][_0x086e('0xf2')]){_0x3f9196=util[_0x086e('0xaa')](_0x086e('0xf3'),_0x15c140[_0x086e('0x5b')][_0x086e('0xf2')]);}else{_0x3f9196=util[_0x086e('0xaa')](_0x086e('0xf3'),_0x1a9a92['name']);}socket['to'](util[_0x086e('0xaa')](_0x086e('0xf4'),_0x1a9a92[_0x086e('0x38')]))[_0x086e('0xa6')](_0x086e('0xf5'),{'user':{'id':_0x1a9a92['id'],'name':_0x1a9a92[_0x086e('0x38')]},'ip':_0x15c140[_0x086e('0xf6')][_0x086e('0xf7')]||_0x15c140['connection']['remoteAddress']||_0x15c140[_0x086e('0xf8')][_0x086e('0xf9')]||_0x15c140[_0x086e('0xfa')]['socket']['remoteAddress']});return db[_0x086e('0xac')][_0x086e('0x2a')]({'where':{'membername':_0x1a9a92[_0x086e('0x38')]},'individualHooks':!![]});}}else{throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0xfb'));}})[_0x086e('0x13')](function(){if(_0x1a9a92){return _0x1a9a92[_0x086e('0xfc')]({'raw':!![]});}})[_0x086e('0x13')](function(_0x1d913e){if(_0x1a9a92){var _0x105add=[];if(_0x1d913e){_0x2f5bd4=_0x1d913e;if(_0x2f5bd4[_0x086e('0x4a')]){for(var _0x138b3c=0x0;_0x138b3c<_0x2f5bd4[_0x086e('0x4a')];_0x138b3c++){_0x105add[_0x086e('0x4b')]({'membername':_0x1a9a92[_0x086e('0x38')],'UserId':_0x1a9a92['id'],'queue_name':_0x2f5bd4[_0x138b3c][_0x086e('0x38')],'VoiceQueueId':_0x2f5bd4[_0x138b3c]['id'],'interface':_0x3f9196,'paused':_0x1a9a92[_0x086e('0x9e')]||![],'penalty':_0x2f5bd4[_0x138b3c][_0x086e('0xfd')]||0x0});}return BPromise[_0x086e('0x87')](_0x105add,function(_0x295d14){return db['UserVoiceQueueRt'][_0x086e('0xad')](_0x295d14);});}}}})['then'](function(){if(_0x1a9a92){return db[_0x086e('0xfe')]['findAll']({'where':{'membername':_0x1a9a92[_0x086e('0x38')],'exitAt':null}});}})[_0x086e('0x13')](function(_0x45c996){if(_0x1a9a92){var _0x2b6e30=[];_0x45c996[_0x086e('0xff')](function(_0x671cba){_0x2b6e30[_0x086e('0x4b')](_0x671cba[_0x086e('0x29')]({'exitAt':moment()['format'](_0x086e('0x100'))}));});return BPromise[_0x086e('0x51')](_0x2b6e30);}})[_0x086e('0x13')](function(){if(_0x1a9a92){var _0x161590=[];var _0x21e360=[];var _0x2aefca=utils['getChannels']();var _0x2d432d={'membername':_0x1a9a92[_0x086e('0x38')],'interface':_0x3f9196,'enterAt':moment()[_0x086e('0xaa')](_0x086e('0x100')),'role':_0x1a9a92[_0x086e('0x2c')],'internal':_0x1a9a92[_0x086e('0x5f')]};_0x2aefca['forEach'](function(_0x20c502){_0x161590[_0x086e('0x4b')](_[_0x086e('0x58')]({'channel':_0x20c502,'type':'LOGIN','data1':_0x15c140[_0x086e('0x5b')][_0x086e('0x101')],'data2':_0x3f9196},_0x2d432d));if(_0x1a9a92[_0x086e('0x9e')]){_0x21e360[_0x086e('0x4b')](_[_0x086e('0x58')]({'channel':_0x20c502,'type':_0x086e('0x102'),'data1':_0x086e('0x103')},_0x2d432d));}});return db['MemberReport'][_0x086e('0x83')](_0x161590[_0x086e('0x104')](_0x21e360),{'individualHooks':!![]});}})['then'](function(){if(_0x1a9a92){return _0x1a9a92['update']({'online':!![],'lastLoginAt':moment()[_0x086e('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1a9a92[_0x086e('0x9e')]||![],'mailPause':_0x1a9a92[_0x086e('0x9e')]||![],'chatPause':_0x1a9a92[_0x086e('0x9e')]||![],'faxPause':_0x1a9a92[_0x086e('0x9e')]||![],'smsPause':_0x1a9a92[_0x086e('0x9e')]||![],'openchannelPause':_0x1a9a92['loginInPause']||![],'whatsappPause':_0x1a9a92['loginInPause']||![],'pauseType':_0x1a9a92[_0x086e('0x9e')]?'LOGININPAUSE':null,'interface':_0x3f9196,'lastPauseAt':moment()[_0x086e('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x458740){if(_0x15c140[_0x086e('0x105')]){return _0x461893();}else{return BPromise['resolve'](_0x458740)[_0x086e('0x13')](respondWithResult(_0x4aa187,null));}})[_0x086e('0x1e')](handleError(_0x4aa187,null));};exports['logout']=function(_0x5c3f6e,_0x1b45dc){var _0x53d232;return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x5c3f6e[_0x086e('0x53')]['id'],'role':_0x086e('0x30')},'attributes':['id',_0x086e('0x38'),_0x086e('0x2c')]})['then'](handleEntityNotFound(_0x1b45dc,null))[_0x086e('0x13')](function(_0x1037d7){if(_0x1037d7){_0x53d232=_0x1037d7;return db[_0x086e('0xac')][_0x086e('0x2a')]({'where':{'membername':_0x53d232[_0x086e('0x38')]},'individualHooks':!![]});}})['then'](function(){return db[_0x086e('0xfe')][_0x086e('0x47')]({'where':{'membername':_0x53d232[_0x086e('0x38')],'exitAt':null}});})[_0x086e('0x13')](function(_0x2d8eb8){var _0x44fb77=[];_0x2d8eb8[_0x086e('0xff')](function(_0x802fca){_0x44fb77['push'](_0x802fca[_0x086e('0x29')]({'exitAt':moment()[_0x086e('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x086e('0x51')](_0x44fb77);})[_0x086e('0x13')](function(){return _0x53d232[_0x086e('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x086e('0x13')](respondWithResult(_0x1b45dc,null))[_0x086e('0x1e')](handleError(_0x1b45dc,null));};exports[_0x086e('0x106')]=function(_0x22df48,_0x36cdcc){var _0x297ef3;return db[_0x086e('0xac')][_0x086e('0x29')]({'paused':0x1},{'where':{'UserId':_0x22df48[_0x086e('0x53')]['id']},'individualHooks':!![]})[_0x086e('0x13')](function(){return db['User'][_0x086e('0x37')]({'where':{'id':_0x22df48[_0x086e('0x53')]['id'],'role':'agent'},'attributes':['id','name',_0x086e('0x2c'),_0x086e('0x5f'),'interface']});})[_0x086e('0x13')](handleEntityNotFound(_0x36cdcc,null))[_0x086e('0x13')](function(_0x1ee818){if(_0x1ee818){_0x297ef3=_0x1ee818;return respondWithRpcPromise(_0x086e('0x107'),_0x086e('0x106'),{'id':_0x297ef3['id'],'name':_0x297ef3[_0x086e('0x38')],'pause':!![]});}})[_0x086e('0x13')](function(){if(_0x297ef3){return db[_0x086e('0xfe')][_0x086e('0x47')]({'where':{'membername':_0x297ef3[_0x086e('0x38')],'type':_0x086e('0x102'),'exitAt':null}});}})[_0x086e('0x13')](function(_0x33e295){if(_0x33e295[_0x086e('0x4a')]){var _0x3b698c=moment()[_0x086e('0xaa')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xcff733=0x0,_0x3823b1=_0x33e295[_0x086e('0x4a')];_0xcff733<_0x3823b1;_0xcff733++){_0x33e295[_0xcff733]['updateAttributes']({'exitAt':_0x3b698c});}}})[_0x086e('0x13')](function(){var _0xb2b4c3=[];var _0x5c458e=utils[_0x086e('0x108')]();_0x5c458e[_0x086e('0xff')](function(_0x39ca88){_0xb2b4c3['push']({'channel':_0x39ca88,'membername':_0x297ef3['name'],'interface':_[_0x086e('0x67')](_0x297ef3['interface'])?util[_0x086e('0xaa')]('SIP/%s',_0x297ef3['name']):_0x297ef3[_0x086e('0x9f')],'type':_0x086e('0x102'),'enterAt':moment()[_0x086e('0xaa')](_0x086e('0x100')),'data1':_0x22df48['body'][_0x086e('0x109')]||_0x086e('0x10a'),'role':_0x297ef3[_0x086e('0x2c')],'internal':_0x297ef3[_0x086e('0x5f')]});});return db['MemberReport'][_0x086e('0x83')](_0xb2b4c3,{'individualHooks':!![]});})[_0x086e('0x13')](function(){return _0x297ef3[_0x086e('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x22df48[_0x086e('0x5b')][_0x086e('0x109')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x086e('0x13')](respondWithResult(_0x36cdcc,null))['catch'](handleError(_0x36cdcc,null));};exports[_0x086e('0x10b')]=function(_0x241b16,_0x5e7a73){var _0x3e7e3b;return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x241b16[_0x086e('0x53')]['id']},'attributes':['id',_0x086e('0x38'),_0x086e('0x2c'),_0x086e('0x10c'),_0x086e('0x10d'),_0x086e('0x10e'),_0x086e('0x10f'),_0x086e('0x110'),_0x086e('0x111'),_0x086e('0x112'),_0x086e('0x113'),_0x086e('0x114')]})[_0x086e('0x13')](handleEntityNotFound(_0x5e7a73,null))[_0x086e('0x13')](function(_0x421dbc){if(_0x421dbc){_0x3e7e3b=_0x421dbc;if(_0x241b16[_0x086e('0x5b')]['channel']&&!utils['isValidChannel'](_0x241b16[_0x086e('0x5b')][_0x086e('0xaf')])){throw new db[(_0x086e('0x8f'))][(_0x086e('0x93'))](_0x086e('0xa0'));}switch(_0x241b16[_0x086e('0x5b')][_0x086e('0xaf')]){case _0x086e('0xa8'):return respondWithRpcPromise(_0x086e('0x107'),'unpause',{'id':_0x3e7e3b['id'],'name':_0x3e7e3b['name'],'pause':![]})[_0x086e('0x13')](function(){return db[_0x086e('0xac')]['update']({'paused':0x0},{'where':{'UserId':_0x3e7e3b['id']},'individualHooks':!![]});})[_0x086e('0x13')](function(){return db[_0x086e('0xfe')]['find']({'where':{'channel':_0x241b16[_0x086e('0x5b')][_0x086e('0xaf')],'membername':_0x3e7e3b[_0x086e('0x38')],'type':_0x086e('0x102'),'exitAt':null}});})[_0x086e('0x13')](function(_0x367298){if(_0x367298){return _0x367298['update']({'exitAt':moment()['format'](_0x086e('0x100')),'data2':_0x086e('0x115')},{'individualHooks':!![]});}return null;})[_0x086e('0x13')](function(){return _0x3e7e3b[_0x086e('0x29')]({'voicePause':![]});});case _0x086e('0x50'):case _0x086e('0x4c'):case _0x086e('0x4f'):case _0x086e('0x4e'):case _0x086e('0x5a'):case _0x086e('0x59'):return db['MemberReport'][_0x086e('0x37')]({'where':{'channel':_0x241b16[_0x086e('0x5b')][_0x086e('0xaf')],'membername':_0x3e7e3b[_0x086e('0x38')],'type':_0x086e('0x102'),'exitAt':null}})[_0x086e('0x13')](function(_0x3ce47c){if(_0x3ce47c){return _0x3ce47c['update']({'exitAt':moment()['format'](_0x086e('0x100')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x086e('0x13')](function(){var _0x20f446={};_[_0x086e('0x27')](_0x20f446,util['format'](_0x086e('0x116'),_0x241b16[_0x086e('0x5b')][_0x086e('0xaf')],_0x086e('0x117')),![]);return _0x3e7e3b['update'](_0x20f446);});default:return respondWithRpcPromise(_0x086e('0x107'),_0x086e('0x10b'),{'id':_0x3e7e3b['id'],'name':_0x3e7e3b[_0x086e('0x38')],'pause':![]})[_0x086e('0x13')](function(){return db[_0x086e('0xac')][_0x086e('0x29')]({'paused':0x0},{'where':{'UserId':_0x3e7e3b['id']}});})[_0x086e('0x13')](function(){return db[_0x086e('0xfe')][_0x086e('0x47')]({'where':{'membername':_0x3e7e3b['name'],'type':'PAUSE','exitAt':null}});})[_0x086e('0x13')](function(_0xa2e9f2){var _0x4f3f04=[];_0xa2e9f2['forEach'](function(_0x2d8d08){_0x4f3f04[_0x086e('0x4b')](_0x2d8d08[_0x086e('0x29')]({'exitAt':moment()[_0x086e('0xaa')](_0x086e('0x100')),'data2':_0x086e('0x115')}));});return BPromise[_0x086e('0x51')](_0x4f3f04);})[_0x086e('0x13')](function(){return _0x3e7e3b['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x086e('0x13')](respondWithResult(_0x5e7a73,null))[_0x086e('0x1e')](handleError(_0x5e7a73,null));};exports[_0x086e('0x118')]=function(_0x3b9fbb,_0x440921){var _0x29a4a6={};var _0x33a0e8={};var _0x3bff5c;var _0x3e8445;return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x3b9fbb[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x440921,null))[_0x086e('0x13')](function(_0x3e389b){if(_0x3e389b){_0x3bff5c=_0x3e389b;_0x33a0e8[_0x086e('0x55')]=_['keys'](db['Team'][_0x086e('0x3c')]);_0x33a0e8[_0x086e('0x41')]=_[_0x086e('0x54')](_0x3b9fbb['query']);_0x33a0e8['filters']=_[_0x086e('0xcc')](_0x33a0e8[_0x086e('0x55')],_0x33a0e8[_0x086e('0x41')]);_0x29a4a6[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x33a0e8['model'],qs[_0x086e('0x56')](_0x3b9fbb[_0x086e('0x41')][_0x086e('0x56')]));_0x29a4a6['attributes']=_0x29a4a6[_0x086e('0x46')][_0x086e('0x4a')]?_0x29a4a6[_0x086e('0x46')]:_0x33a0e8[_0x086e('0x55')];_0x29a4a6['order']=qs['sort'](_0x3b9fbb[_0x086e('0x41')][_0x086e('0xce')]);_0x29a4a6['where']=qs['filters'](_[_0x086e('0xd9')](_0x3b9fbb[_0x086e('0x41')],_0x33a0e8[_0x086e('0xcb')]));if(_0x3b9fbb[_0x086e('0x41')]['filter']){_0x29a4a6['where']=_[_0x086e('0x58')](_0x29a4a6[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x29a4a6[_0x086e('0x46')],function(_0x538408){var _0x40c0cc={};_0x40c0cc[_0x538408]={'$like':'%'+_0x3b9fbb[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x40c0cc;})});}_0x29a4a6=_[_0x086e('0x58')]({},_0x29a4a6,_0x3b9fbb[_0x086e('0xda')]);return _0x3bff5c[_0x086e('0x118')](_0x29a4a6);}})[_0x086e('0x13')](function(_0x4aa988){if(_0x4aa988){_0x3e8445=_0x4aa988[_0x086e('0x4a')];if(!_0x3b9fbb[_0x086e('0x41')][_0x086e('0xd0')]('nolimit')){_0x29a4a6[_0x086e('0x24')]=qs[_0x086e('0x24')](_0x3b9fbb['query'][_0x086e('0x24')]);_0x29a4a6['offset']=qs[_0x086e('0x22')](_0x3b9fbb[_0x086e('0x41')][_0x086e('0x22')]);}return _0x3bff5c['getTeams'](_0x29a4a6);}})['then'](function(_0x27d752){if(_0x27d752){return _0x27d752?{'count':_0x3e8445,'rows':_0x27d752}:null;}})['then'](respondWithResult(_0x440921,null))[_0x086e('0x1e')](handleError(_0x440921,null));};exports[_0x086e('0x119')]=function(_0x4a0ad8,_0x206c71){return db[_0x086e('0x3b')][_0x086e('0x37')]({'where':{'id':_0x4a0ad8[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x206c71,null))[_0x086e('0x13')](function(_0x209aa5){if(_0x209aa5){var _0x265e40=_0x209aa5['get']({'plain':!![]});return _0x209aa5[_0x086e('0x119')](_0x4a0ad8[_0x086e('0x5b')][_0x086e('0x5e')],_[_0x086e('0x11a')](_0x4a0ad8[_0x086e('0x5b')],[_0x086e('0x5e'),'id'])||{})['then'](function(){for(var _0x43592b=0x0;_0x43592b<_0x4a0ad8[_0x086e('0x5b')]['ids'][_0x086e('0x4a')];_0x43592b++){var _0x3b200b=[];var _0x495b24={};db[_0x086e('0x11b')]['findOne']({'where':{'id':_0x4a0ad8[_0x086e('0x5b')][_0x086e('0x5e')][_0x43592b]}})[_0x086e('0x13')](function(_0x29ff55){_0x495b24=_0x29ff55[_0x086e('0x4d')];_0x3b200b[_0x086e('0x4b')](_0x29ff55[_0x086e('0xfc')]()[_0x086e('0x13')](function(_0x101a00){for(var _0x3805e9=0x0;_0x3805e9<_0x101a00[_0x086e('0x4a')];_0x3805e9++){_0x101a00[_0x3805e9][_0x086e('0x11c')](_0x086e('0xaf'),'Voice');}return _0x101a00;}));_0x3b200b[_0x086e('0x4b')](_0x29ff55[_0x086e('0x11d')]()[_0x086e('0x13')](function(_0x375cf6){for(var _0x3a193a=0x0;_0x3a193a<_0x375cf6[_0x086e('0x4a')];_0x3a193a++){_0x375cf6[_0x3a193a][_0x086e('0x11c')]('channel',_0x086e('0x11e'));}return _0x375cf6;}));_0x3b200b['push'](_0x29ff55['getMailQueues']()[_0x086e('0x13')](function(_0x478af8){for(var _0x274ec0=0x0;_0x274ec0<_0x478af8[_0x086e('0x4a')];_0x274ec0++){_0x478af8[_0x274ec0]['setDataValue'](_0x086e('0xaf'),_0x086e('0x11f'));}return _0x478af8;}));_0x3b200b[_0x086e('0x4b')](_0x29ff55[_0x086e('0x120')]()[_0x086e('0x13')](function(_0x139d00){for(var _0x25b7e6=0x0;_0x25b7e6<_0x139d00[_0x086e('0x4a')];_0x25b7e6++){_0x139d00[_0x25b7e6][_0x086e('0x11c')](_0x086e('0xaf'),_0x086e('0x121'));}return _0x139d00;}));_0x3b200b[_0x086e('0x4b')](_0x29ff55[_0x086e('0x122')]()[_0x086e('0x13')](function(_0x51dedc){for(var _0x1999b1=0x0;_0x1999b1<_0x51dedc['length'];_0x1999b1++){_0x51dedc[_0x1999b1][_0x086e('0x11c')]('channel',_0x086e('0x123'));}return _0x51dedc;}));_0x3b200b['push'](_0x29ff55[_0x086e('0x124')]()[_0x086e('0x13')](function(_0x5aa441){for(var _0x31a8a4=0x0;_0x31a8a4<_0x5aa441[_0x086e('0x4a')];_0x31a8a4++){_0x5aa441[_0x31a8a4][_0x086e('0x11c')](_0x086e('0xaf'),_0x086e('0x125'));}return _0x5aa441;}));_0x3b200b['push'](_0x29ff55[_0x086e('0x126')]()[_0x086e('0x13')](function(_0x2f0848){for(var _0x275964=0x0;_0x275964<_0x2f0848[_0x086e('0x4a')];_0x275964++){_0x2f0848[_0x275964][_0x086e('0x11c')](_0x086e('0xaf'),_0x086e('0x127'));}return _0x2f0848;}));return BPromise[_0x086e('0x51')](_0x3b200b);})[_0x086e('0x13')](function(_0x576981){var _0x593e62=_[_0x086e('0x128')](_0x576981);_0x3b200b=[];return db[_0x086e('0x63')][_0x086e('0x129')](function(_0x383a8d){for(var _0x4ca655=0x0;_0x4ca655<_0x593e62[_0x086e('0x4a')];_0x4ca655++){_0x3b200b[_0x086e('0x4b')](_0x593e62[_0x4ca655][_0x086e('0x12a')](_0x265e40['id']),{'transaction':_0x383a8d});}return BPromise[_0x086e('0x51')](_0x3b200b)[_0x086e('0x13')](function(){if(_0x265e40[_0x086e('0xa9')]){return BPromise['each'](_['filter'](_0x593e62,function(_0x355d93){return _0x355d93[_0x086e('0x12b')](_0x086e('0xaf'))===_0x086e('0x12c');}),function(_0x3126ac){return db[_0x086e('0xac')][_0x086e('0xad')]({'membername':_0x265e40[_0x086e('0x38')],'UserId':_0x265e40['id'],'queue_name':_0x3126ac[_0x086e('0x38')],'VoiceQueueId':_0x3126ac['id'],'interface':_[_0x086e('0x67')](_0x265e40[_0x086e('0x9f')])?util['format'](_0x086e('0xf3'),_0x265e40[_0x086e('0x38')]):_0x265e40[_0x086e('0x9f')],'paused':_0x265e40[_0x086e('0x10c')]||![],'penalty':_0x265e40[_0x086e('0xab')]},{'transaction':_0x383a8d});});}else{return;}})[_0x086e('0x13')](function(){for(var _0x20a165=0x0;_0x20a165<_0x593e62[_0x086e('0x4a')];_0x20a165++){var _0x595f7e=_0x593e62[_0x20a165][_0x086e('0x12b')](_0x086e('0xaf'));var _0x26b51a=_0x595f7e+_0x086e('0xa5');socket[_0x086e('0xa6')]('user'+_0x595f7e+_0x086e('0xa7'),{'UserId':_0x265e40['id'],['queueField']:_0x593e62[_0x20a165]['id']});}});});})[_0x086e('0x13')](function(){db[_0x086e('0x12d')][_0x086e('0x97')]({'where':{'teamId':_0x495b24['id']}})[_0x086e('0x13')](function(_0x3a8e48){if(_0x3a8e48){db['UserVoicePrefix']['create']({'UserId':_0x4a0ad8['params']['id'],'VoicePrefixId':_0x3a8e48[_0x086e('0x12e')]});}});});}});}})[_0x086e('0x13')](respondWithStatusCode(_0x206c71,null))['catch'](handleError(_0x206c71,null));};exports[_0x086e('0x12f')]=function(_0xca2b7f,_0x338a6f){return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0xca2b7f['params']['id']}})['then'](handleEntityNotFound(_0x338a6f,null))[_0x086e('0x13')](function(_0x5cb734){if(_0x5cb734){var _0x3658e9=_0x5cb734[_0x086e('0x2b')]({'plain':!![]});var _0x47d5c4=_0xca2b7f['query'][_0x086e('0x5e')];return _0x5cb734[_0x086e('0x12f')](_0x47d5c4)[_0x086e('0x13')](function(){for(var _0x2194bc=0x0;_0x2194bc<_0x47d5c4[_0x086e('0x4a')];_0x2194bc++){var _0x9814e9=[];var _0x2da941={};db[_0x086e('0x11b')]['findOne']({'where':{'id':_0x47d5c4[_0x2194bc]}})[_0x086e('0x13')](function(_0x484c87){_0x2da941=_0x484c87[_0x086e('0x4d')];_0x9814e9[_0x086e('0x4b')](_0x484c87[_0x086e('0xfc')]()[_0x086e('0x13')](function(_0xefb99f){for(var _0x45993d=0x0;_0x45993d<_0xefb99f[_0x086e('0x4a')];_0x45993d++){_0xefb99f[_0x45993d][_0x086e('0x11c')](_0x086e('0xaf'),_0x086e('0x12c'));}return _0xefb99f;}));_0x9814e9[_0x086e('0x4b')](_0x484c87['getChatQueues']()['then'](function(_0x47fd30){for(var _0x3ee8da=0x0;_0x3ee8da<_0x47fd30[_0x086e('0x4a')];_0x3ee8da++){_0x47fd30[_0x3ee8da][_0x086e('0x11c')](_0x086e('0xaf'),_0x086e('0x11e'));}return _0x47fd30;}));_0x9814e9[_0x086e('0x4b')](_0x484c87[_0x086e('0x130')]()[_0x086e('0x13')](function(_0x2b4bc9){for(var _0x1f907a=0x0;_0x1f907a<_0x2b4bc9[_0x086e('0x4a')];_0x1f907a++){_0x2b4bc9[_0x1f907a][_0x086e('0x11c')](_0x086e('0xaf'),'Mail');}return _0x2b4bc9;}));_0x9814e9[_0x086e('0x4b')](_0x484c87['getSmsQueues']()[_0x086e('0x13')](function(_0x5651f2){for(var _0x1e3925=0x0;_0x1e3925<_0x5651f2[_0x086e('0x4a')];_0x1e3925++){_0x5651f2[_0x1e3925][_0x086e('0x11c')](_0x086e('0xaf'),'Sms');}return _0x5651f2;}));_0x9814e9[_0x086e('0x4b')](_0x484c87[_0x086e('0x122')]()[_0x086e('0x13')](function(_0x56514c){for(var _0x8abd3e=0x0;_0x8abd3e<_0x56514c[_0x086e('0x4a')];_0x8abd3e++){_0x56514c[_0x8abd3e][_0x086e('0x11c')](_0x086e('0xaf'),_0x086e('0x123'));}return _0x56514c;}));_0x9814e9[_0x086e('0x4b')](_0x484c87[_0x086e('0x124')]()[_0x086e('0x13')](function(_0x9826de){for(var _0x39aeca=0x0;_0x39aeca<_0x9826de[_0x086e('0x4a')];_0x39aeca++){_0x9826de[_0x39aeca][_0x086e('0x11c')](_0x086e('0xaf'),_0x086e('0x125'));}return _0x9826de;}));_0x9814e9[_0x086e('0x4b')](_0x484c87[_0x086e('0x126')]()[_0x086e('0x13')](function(_0xbf3298){for(var _0x31986f=0x0;_0x31986f<_0xbf3298[_0x086e('0x4a')];_0x31986f++){_0xbf3298[_0x31986f][_0x086e('0x11c')]('channel','Openchannel');}return _0xbf3298;}));return BPromise[_0x086e('0x51')](_0x9814e9);})[_0x086e('0x13')](function(_0x4b3549){var _0x5109f4=_[_0x086e('0x128')](_0x4b3549);_0x9814e9=[];return db[_0x086e('0x63')][_0x086e('0x129')](function(_0x3fc26d){for(var _0x2cdc81=0x0;_0x2cdc81<_0x5109f4[_0x086e('0x4a')];_0x2cdc81++){_0x9814e9[_0x086e('0x4b')](_0x5109f4[_0x2cdc81][_0x086e('0x131')](_0x3658e9['id']),{'transaction':_0x3fc26d});}return BPromise[_0x086e('0x51')](_0x9814e9)[_0x086e('0x13')](function(){if(_0x3658e9[_0x086e('0xa9')]){return BPromise[_0x086e('0x87')](_[_0x086e('0x32')](_0x5109f4,function(_0x4c8667){return _0x4c8667[_0x086e('0x12b')](_0x086e('0xaf'))===_0x086e('0x12c');}),function(_0x16f87c){return db[_0x086e('0xac')][_0x086e('0x2a')]({'where':{'VoiceQueueId':_0x16f87c['id'],'UserId':_0x3658e9['id']},'transaction':_0x3fc26d});});}else{return;}})[_0x086e('0x13')](function(){db['TeamVoicePrefix'][_0x086e('0x97')]({'where':{'teamId':_0x2da941['id']}})['then'](function(_0x10006f){if(_0x10006f){return db[_0x086e('0x132')][_0x086e('0x2a')]({'where':{'UserId':_0x3658e9['id'],'VoicePrefixId':_0x10006f[_0x086e('0x4d')][_0x086e('0x12e')]}});}});})['then'](function(){for(var _0x3f89ed=0x0;_0x3f89ed<_0x5109f4[_0x086e('0x4a')];_0x3f89ed++){var _0x59076f=_0x5109f4[_0x3f89ed][_0x086e('0x12b')]('channel');var _0x3896a4=_0x59076f+'QueueId';socket['emit'](_0x086e('0x2e')+_0x59076f+'Queue:remove',{'UserId':_0x3658e9['id'],['queueField']:_0x5109f4[_0x3f89ed]['id']});}});});});}});}})[_0x086e('0x13')](respondWithStatusCode(_0x338a6f,null))[_0x086e('0x1e')](handleError(_0x338a6f,null));};exports[_0x086e('0x133')]=function(_0x2263a8,_0x2672f2){var _0x4030be={};var _0x281295={};var _0x5b7019;var _0x366108;return db['User'][_0x086e('0x97')]({'where':{'id':_0x2263a8['params']['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x2672f2,null))[_0x086e('0x13')](function(_0x144a03){if(_0x144a03){_0x5b7019=_0x144a03;_0x281295['model']=_[_0x086e('0x54')](db[_0x086e('0xd1')]['rawAttributes']);_0x281295[_0x086e('0x41')]=_['keys'](_0x2263a8['query']);_0x281295[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x281295[_0x086e('0x55')],_0x281295['query']);_0x4030be[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x281295['model'],qs[_0x086e('0x56')](_0x2263a8[_0x086e('0x41')][_0x086e('0x56')]));_0x4030be[_0x086e('0x46')]=_0x4030be[_0x086e('0x46')]['length']?_0x4030be[_0x086e('0x46')]:_0x281295[_0x086e('0x55')];_0x4030be[_0x086e('0xcd')]=qs[_0x086e('0xce')](_0x2263a8[_0x086e('0x41')][_0x086e('0xce')]);_0x4030be[_0x086e('0xcf')]=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x2263a8['query'],_0x281295[_0x086e('0xcb')]));if(_0x2263a8[_0x086e('0x41')][_0x086e('0x32')]){_0x4030be['where']=_['merge'](_0x4030be[_0x086e('0xcf')],{'$or':_[_0x086e('0x34')](_0x4030be['attributes'],function(_0x41edef){var _0x35181d={};_0x35181d[_0x41edef]={'$like':'%'+_0x2263a8[_0x086e('0x41')][_0x086e('0x32')]+'%'};return _0x35181d;})});}_0x4030be=_['merge']({},_0x4030be,_0x2263a8[_0x086e('0xda')]);return _0x5b7019['getLists'](_0x4030be);}})[_0x086e('0x13')](function(_0x1ff4f5){if(_0x1ff4f5){_0x366108=_0x1ff4f5[_0x086e('0x4a')];if(!_0x2263a8['query'][_0x086e('0xd0')](_0x086e('0xd7'))){_0x4030be[_0x086e('0x24')]=qs[_0x086e('0x24')](_0x2263a8['query'][_0x086e('0x24')]);_0x4030be['offset']=qs[_0x086e('0x22')](_0x2263a8['query'][_0x086e('0x22')]);}return _0x5b7019['getLists'](_0x4030be);}})['then'](function(_0x260c0c){if(_0x260c0c){return _0x260c0c?{'count':_0x366108,'rows':_0x260c0c}:null;}})[_0x086e('0x13')](respondWithResult(_0x2672f2,null))[_0x086e('0x1e')](handleError(_0x2672f2,null));};exports[_0x086e('0x134')]=function(_0x4f967d,_0x21898d){var _0x22c6d6={};var _0x485b54={};var _0x401a36;return db[_0x086e('0x3b')][_0x086e('0x97')]({'where':{'id':_0x4f967d[_0x086e('0x53')]['id']}})[_0x086e('0x13')](handleEntityNotFound(_0x21898d,null))[_0x086e('0x13')](function(_0x4dacc6){if(_0x4dacc6){_0x401a36=_0x4dacc6;_0x485b54['model']=_['keys'](db[_0x086e('0x3b')][_0x086e('0x3c')]);_0x485b54[_0x086e('0x41')]=_['keys'](_0x4f967d['query']);_0x485b54[_0x086e('0xcb')]=_[_0x086e('0xcc')](_0x485b54['model'],_0x485b54['query']);_0x22c6d6[_0x086e('0x46')]=_[_0x086e('0xcc')](_0x485b54['model'],qs['fields'](_0x4f967d['query'][_0x086e('0x56')]));_0x22c6d6[_0x086e('0x46')]=_0x22c6d6[_0x086e('0x46')][_0x086e('0x4a')]?_0x22c6d6['attributes']:_0x485b54[_0x086e('0x55')];_0x22c6d6['order']=qs[_0x086e('0xce')](_0x4f967d[_0x086e('0x41')]['sort']);_0x22c6d6['where']=qs[_0x086e('0xcb')](_[_0x086e('0xd9')](_0x4f967d[_0x086e('0x41')],_0x485b54[_0x086e('0xcb')]));if(_0x4f967d[_0x086e('0x41')]['filter']){_0x22c6d6[_0x086e('0xcf')]=_['merge'](_0x22c6d6['where'],{'$or':_[_0x086e('0x34')](_0x22c6d6[_0x086e('0x46')],function(_0x28ccbe){var _0x57297c={};_0x57297c[_0x28ccbe]={'$like':'%'+_0x4f967d[_0x086e('0x41')]['filter']+'%'};return _0x57297c;})});}_0x22c6d6[_0x086e('0x55')]=db[_0x086e('0x3b')];_0x22c6d6['as']='Agents';_0x22c6d6=_[_0x086e('0x58')]({},_0x22c6d6,_0x4f967d[_0x086e('0xda')]);return _0x401a36[_0x086e('0xfc')]({'include':[_0x22c6d6]});}})[_0x086e('0x13')](function(_0x3a7c63){if(_0x3a7c63){var _0x2bb17e={},_0x2ab8a5=[];for(var _0x59d3ce=0x0;_0x59d3ce<_0x3a7c63['length'];_0x59d3ce+=0x1){for(var _0x455c60=0x0,_0x5cf8e2;_0x455c60<_0x3a7c63[_0x59d3ce]['Agents'][_0x086e('0x4a')];_0x455c60+=0x1){_0x5cf8e2=_0x3a7c63[_0x59d3ce][_0x086e('0x2f')][_0x455c60][_0x086e('0x2b')]({'plain':!![]});_0x2bb17e[_0x5cf8e2['id']]=_0x5cf8e2;}}_0x2bb17e=_[_0x086e('0x135')](_0x2bb17e);for(var _0xb3e8f2=qs[_0x086e('0x22')](_0x4f967d[_0x086e('0x41')][_0x086e('0x22')]);_0xb3e8f2<_0x2bb17e[_0x086e('0x4a')]&&_0x2ab8a5[_0x086e('0x4a')]=_0x3f2c84){_0x243393=_0x3f2c84;_0x8b566a=0xc8;}else{_0x8b566a=0xce;}_0x4dc1d0['status'](_0x8b566a);return _0x4dc1d0['set'](_0xcbb1('0x22'),_0x5295b2+'-'+_0x243393+'/'+_0x3f2c84)['json'](_0x2886d4);}return null;};}function saveUpdates(_0x2aec44){return function(_0x11b7b2){if(_0x11b7b2){return _0x11b7b2[_0xcbb1('0x23')](_0x2aec44)['then'](function(_0x59a3fe){return _0x59a3fe;});}return null;};}function removeEntity(_0x21cc02){return function(_0xdd0293){if(_0xdd0293){return _0xdd0293[_0xcbb1('0x24')]()[_0xcbb1('0x12')](function(){var _0x69d519=_0xdd0293[_0xcbb1('0x25')]({'plain':!![]});if(_0x69d519[_0xcbb1('0x26')]==='admin')return;var _0x4561c0=[{'name':_0xcbb1('0x27'),'value':_0xcbb1('0x28'),'ignore':!![]},{'name':_0xcbb1('0x29'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0xcbb1('0x2a'),'ignore':![]}];var _0x2ffec3=_(_0x4561c0)[_0xcbb1('0x2b')](_0xcbb1('0x2c'))['map'](_0xcbb1('0x2d'))[_0xcbb1('0x2d')]();if(_[_0xcbb1('0x2e')](_0x2ffec3,_0x69d519['role'])){return;}var _0x2906c5=_[_0xcbb1('0x2f')](_0x4561c0,[_0xcbb1('0x2d'),_0x69d519['role']])['name'];return db[_0xcbb1('0x30')][_0xcbb1('0x24')]({'where':{'type':_0x2906c5,'resourceId':_0x69d519['id']}})[_0xcbb1('0x12')](function(){return _0xdd0293;});})[_0xcbb1('0x12')](function(){_0x21cc02[_0xcbb1('0x1d')](0xcc)[_0xcbb1('0x31')]();});}};}function handleEntityNotFound(_0x420c63){return function(_0x167ad2){if(!_0x167ad2){_0x420c63[_0xcbb1('0x1c')](0x194);}return _0x167ad2;};}function handleError(_0x343b8c,_0x2ed54a){_0x2ed54a=_0x2ed54a||0x1f4;return function(_0x2af5c9){logger['error'](_0x2af5c9[_0xcbb1('0x32')]);if(_0x2af5c9[_0xcbb1('0x33')]){delete _0x2af5c9[_0xcbb1('0x33')];}_0x343b8c[_0xcbb1('0x1d')](_0x2ed54a)['send'](_0x2af5c9);};}exports[_0xcbb1('0x34')]=function(_0xa01f66,_0xf86397){var _0x4ee7c5={},_0x58733f={'count':0x0,'rows':[]};var _0x169f9f=_(db[_0xcbb1('0x35')][_0xcbb1('0x36')])['map'](function(_0x33b0cf){return{'name':_0x33b0cf[_0xcbb1('0x37')],'type':_0x33b0cf[_0xcbb1('0x38')][_0xcbb1('0x39')]};})['filter'](function(_0xccd069){return!_['includes']([_0xcbb1('0x3a'),'salt'],_0xccd069[_0xcbb1('0x33')]);})[_0xcbb1('0x2d')]();_0x4ee7c5=qs[_0xcbb1('0x3b')](_0x169f9f,_0xa01f66);var _0x4eff3f={'where':_0x4ee7c5[_0xcbb1('0x3c')]};return db[_0xcbb1('0x35')][_0xcbb1('0x20')](_0x4eff3f)[_0xcbb1('0x12')](function(_0x2ea25e){_0x58733f['count']=_0x2ea25e;if(_0xa01f66['query']['includeAll']){_0x4ee7c5[_0xcbb1('0x3d')]=[{'all':!![]}];}if(_0xa01f66['query'][_0xcbb1('0x3e')]==='true'){_0x4ee7c5[_0xcbb1('0x3d')]=[{'model':db['UserSetting'],'as':_0xcbb1('0x3e')}];}if(!_['includes'](_0x4ee7c5[_0xcbb1('0x3f')],'id')){_0x4ee7c5['attributes'][_0xcbb1('0x40')]('id');}return db[_0xcbb1('0x35')][_0xcbb1('0x41')](_0x4ee7c5);})[_0xcbb1('0x12')](function(_0x26bc01){_0x58733f[_0xcbb1('0x42')]=_0x26bc01;if(_0xa01f66[_0xcbb1('0x43')][_0xcbb1('0x44')]===_0xcbb1('0x45')){var _0x563517=[];for(var _0x1ebbf9=0x0;_0x1ebbf9<_0x58733f[_0xcbb1('0x42')][_0xcbb1('0x46')];_0x1ebbf9++){_0x563517[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x47'),_0x58733f[_0xcbb1('0x42')][_0x1ebbf9]['dataValues']));_0x563517[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x48'),_0x58733f[_0xcbb1('0x42')][_0x1ebbf9][_0xcbb1('0x49')]));_0x563517[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x4a'),_0x58733f[_0xcbb1('0x42')][_0x1ebbf9][_0xcbb1('0x49')]));_0x563517[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x4b'),_0x58733f[_0xcbb1('0x42')][_0x1ebbf9][_0xcbb1('0x49')]));_0x563517[_0xcbb1('0x40')](get_open_tabs('openchannel',_0x58733f['rows'][_0x1ebbf9][_0xcbb1('0x49')]));_0x563517[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x4c'),_0x58733f[_0xcbb1('0x42')][_0x1ebbf9][_0xcbb1('0x49')]));}return BPromise[_0xcbb1('0x4d')](_0x563517)[_0xcbb1('0x12')](function(){return _0x58733f;});}else{return _0x58733f;}})[_0xcbb1('0x12')](respondWithFilteredResult(_0xf86397,_0x4ee7c5))[_0xcbb1('0x1b')](handleError(_0xf86397,null));};exports[_0xcbb1('0x4e')]=function(_0x2034a4,_0x50e0ee){var _0x37c710={'raw':![],'where':{'id':_0x2034a4['params']['id']}},_0x538978={};_0x538978[_0xcbb1('0x4f')]=_[_0xcbb1('0x50')](_[_0xcbb1('0x51')](db['User'][_0xcbb1('0x36')]),[_0xcbb1('0x3a'),'salt']);_0x538978[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x2034a4[_0xcbb1('0x43')]);_0x538978['filters']=_[_0xcbb1('0x52')](_0x538978['model'],_0x538978[_0xcbb1('0x43')]);_0x37c710[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x538978[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x2034a4['query'][_0xcbb1('0x53')]));_0x37c710[_0xcbb1('0x3f')]=_0x37c710[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x37c710[_0xcbb1('0x3f')]:_0x538978['model'];if(_0x2034a4[_0xcbb1('0x43')]['includeAll']){_0x37c710[_0xcbb1('0x3d')]=[{'all':!![]}];}if(_0x2034a4[_0xcbb1('0x43')][_0xcbb1('0x3e')]===_0xcbb1('0x45')){_0x37c710[_0xcbb1('0x3d')]=[{'model':db[_0xcbb1('0x54')],'as':'userSetting'}];}_0x37c710=_[_0xcbb1('0x55')]({},_0x37c710,_0x2034a4[_0xcbb1('0x56')]);if(!_[_0xcbb1('0x2e')](_0x37c710['attributes'],'id')){_0x37c710[_0xcbb1('0x3f')][_0xcbb1('0x40')]('id');}return db[_0xcbb1('0x35')][_0xcbb1('0x2f')](_0x37c710)[_0xcbb1('0x12')](handleEntityNotFound(_0x50e0ee,null))[_0xcbb1('0x12')](function(_0x4323ca){var _0x32e59c=[];values=_0x4323ca;if(_0x2034a4[_0xcbb1('0x43')][_0xcbb1('0x44')]===_0xcbb1('0x45')){_0x32e59c[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x47'),_0x4323ca[_0xcbb1('0x49')]));_0x32e59c[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x48'),_0x4323ca[_0xcbb1('0x49')]));_0x32e59c[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x57'),_0x4323ca['dataValues']));_0x32e59c['push'](get_open_tabs('whatsapp',_0x4323ca[_0xcbb1('0x49')]));_0x32e59c[_0xcbb1('0x40')](get_open_tabs('fax',_0x4323ca[_0xcbb1('0x49')]));_0x32e59c[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x4b'),_0x4323ca[_0xcbb1('0x49')]));return BPromise[_0xcbb1('0x4d')](_0x32e59c);}else{return values;}})[_0xcbb1('0x12')](function(){return values;})[_0xcbb1('0x12')](respondWithResult(_0x50e0ee,null))[_0xcbb1('0x1b')](handleError(_0x50e0ee,null));};exports[_0xcbb1('0x23')]=function(_0x8709fc,_0x9530e1){if(_0x8709fc[_0xcbb1('0x58')]['id']){delete _0x8709fc[_0xcbb1('0x58')]['id'];}delete _0x8709fc[_0xcbb1('0x58')]['role'];return db['User']['find']({'where':{'id':_0x8709fc['params']['id']}})['then'](handleEntityNotFound(_0x9530e1,null))[_0xcbb1('0x12')](saveUpdates(_0x8709fc[_0xcbb1('0x58')],null))['then'](respondWithResult(_0x9530e1,null))[_0xcbb1('0x1b')](handleError(_0x9530e1,null));};exports[_0xcbb1('0x59')]=function(_0x2f06bf,_0x4e4525){return db['User'][_0xcbb1('0x59')]()[_0xcbb1('0x12')](respondWithResult(_0x4e4525,null))[_0xcbb1('0x1b')](handleError(_0x4e4525,null));};exports[_0xcbb1('0x5a')]=function(_0x26a8b9,_0x5a84c0){return db[_0xcbb1('0x35')]['find']({'where':{'id':_0x26a8b9['params']['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x5a84c0,null))[_0xcbb1('0x12')](function(_0x1062d4){if(_0x1062d4){return _0x1062d4[_0xcbb1('0x5a')](_0x26a8b9[_0xcbb1('0x58')][_0xcbb1('0x5b')],_[_0xcbb1('0x5c')](_0x26a8b9['body'],[_0xcbb1('0x5b'),'id'])||{});}})[_0xcbb1('0x12')](respondWithResult(_0x5a84c0,null))[_0xcbb1('0x1b')](handleError(_0x5a84c0,null));};function validateUser(_0x17214b){return new BPromise(function(_0x27784b,_0x19283e){if(_0x17214b[_0xcbb1('0x5d')])return _0x27784b(_0x17214b);return db[_0xcbb1('0x5e')][_0xcbb1('0x5f')](0x1)[_0xcbb1('0x12')](function(_0x5868c9){if(_0x5868c9[_0xcbb1('0x60')])authService['validatePasswordPattern'](_0x17214b['password']);db[_0xcbb1('0x35')][_0xcbb1('0x61')]('internal')[_0xcbb1('0x12')](function(_0x1adb71){if(_['isNil'](_0x1adb71)){_0x17214b[_0xcbb1('0x5d')]=_0x5868c9['min_internal']||0x1;return;}if(_[_0xcbb1('0x62')](_0x5868c9[_0xcbb1('0x63')])||_0x5868c9['min_internal']===_0x1adb71){_0x17214b[_0xcbb1('0x5d')]=_0x1adb71+0x1;return;}if(_0x5868c9[_0xcbb1('0x63')]>_0x1adb71){_0x17214b[_0xcbb1('0x5d')]=_0x5868c9[_0xcbb1('0x63')];return;}return db[_0xcbb1('0x64')]['query'](_0xcbb1('0x65'),{'type':db[_0xcbb1('0x64')][_0xcbb1('0x66')]['SELECT']})[_0xcbb1('0x12')](function(_0x452f6b){if(_0x452f6b&&_0x452f6b[_0xcbb1('0x46')]){for(var _0x4a6c10=0x0,_0x711eb5=_0x452f6b[_0xcbb1('0x46')];_0x4a6c10<_0x711eb5&&_['isNil'](_0x17214b['internal']);_0x4a6c10++){if(_0x5868c9[_0xcbb1('0x63')]<=_0x452f6b[_0x4a6c10][_0xcbb1('0x67')]){_0x17214b[_0xcbb1('0x5d')]=_0x452f6b[_0x4a6c10][_0xcbb1('0x67')];}else if(_0x5868c9[_0xcbb1('0x63')]>_0x452f6b[_0x4a6c10][_0xcbb1('0x67')]&&_0x5868c9[_0xcbb1('0x63')]<=_0x452f6b[_0x4a6c10]['to']){_0x17214b['internal']=_0x5868c9['min_internal'];}}}if(_[_0xcbb1('0x62')](_0x17214b[_0xcbb1('0x5d')])){_0x17214b[_0xcbb1('0x5d')]=_0x1adb71+0x1;}return _0x27784b(_0x17214b);});});})[_0xcbb1('0x1b')](function(_0x4f82f6){_0x19283e(_0x4f82f6);});});}function updateUser(_0x4417c9){return new BPromise(function(_0x76d22b,_0x225026){try{if(_0x4417c9[_0xcbb1('0x68')]){_0x4417c9[_0xcbb1('0x69')]=_0x4417c9[_0xcbb1('0x5d')];_0x4417c9['VoiceMail']={'mailbox':_0x4417c9[_0xcbb1('0x5d')],'password':_0x4417c9['password'],'fullname':_0x4417c9[_0xcbb1('0x6a')],'email':_0x4417c9[_0xcbb1('0x6b')]};}if(_0x4417c9[_0xcbb1('0x26')]==='agent'){if(!_0x4417c9[_0xcbb1('0x6c')])_0x4417c9['permissions']=['101',_0xcbb1('0x6d'),_0xcbb1('0x6e'),_0xcbb1('0x6f'),_0xcbb1('0x70'),_0xcbb1('0x71'),'105',_0xcbb1('0x72'),_0xcbb1('0x73'),'108',_0xcbb1('0x74'),_0xcbb1('0x75'),_0xcbb1('0x76'),_0xcbb1('0x77'),_0xcbb1('0x78')];}_0x76d22b(_0x4417c9);}catch(_0xf5f3f4){_0x225026(_0xf5f3f4);}});}exports[_0xcbb1('0x79')]=function(_0xafaa6c,_0x5c81d6){if(_0xafaa6c[_0xcbb1('0x28')][_0xcbb1('0x26')]==='agent')throw new Error(_0xcbb1('0x7a'));if(_0xafaa6c[_0xcbb1('0x58')][_0xcbb1('0x26')]===_0xcbb1('0x28')&&_0xafaa6c[_0xcbb1('0x28')][_0xcbb1('0x26')]!==_0xcbb1('0x7b')){throw new Error(_0xcbb1('0x7c'));}if(_0xafaa6c[_0xcbb1('0x58')][_0xcbb1('0x26')]==='admin'&&_0xafaa6c[_0xcbb1('0x28')][_0xcbb1('0x26')]!==_0xcbb1('0x7b')){throw new Error(_0xcbb1('0x7d'));}return licenseUtil[_0xcbb1('0x7e')]([_0xafaa6c['body']])[_0xcbb1('0x12')](function(){return validateUser(_0xafaa6c[_0xcbb1('0x58')]);})[_0xcbb1('0x12')](function(_0x4dc406){return updateUser(_0x4dc406)[_0xcbb1('0x12')](function(_0x3524cb){if(_0x3524cb[_0xcbb1('0x26')]===_0xcbb1('0x7b')){_0x3524cb['settingsEnabled']=_0xafaa6c[_0xcbb1('0x28')]['settingsEnabled'];delete _0x3524cb[_0xcbb1('0x7f')];}return _0x3524cb;});})[_0xcbb1('0x12')](function(_0x27c93a){return db[_0xcbb1('0x35')][_0xcbb1('0x79')](_0x27c93a,{'include':[{'model':db[_0xcbb1('0x80')],'as':_0xcbb1('0x80')}]});})[_0xcbb1('0x12')](function(_0x30a7ff){if(_0xafaa6c[_0xcbb1('0x58')][_0xcbb1('0x26')]===_0xcbb1('0x28'))return _0x30a7ff;if(_0xafaa6c[_0xcbb1('0x28')][_0xcbb1('0x26')]!=='user')return _0x30a7ff;return db[_0xcbb1('0x81')]['find']({'where':{'name':_0x30a7ff[_0xcbb1('0x26')]===_0xcbb1('0x82')?_0xcbb1('0x29'):_0xcbb1('0x83'),'userProfileId':_0xafaa6c['user'][_0xcbb1('0x7f')]},'raw':!![]})[_0xcbb1('0x12')](function(_0x6ce7ef){if(!_0x6ce7ef||_0x6ce7ef[_0xcbb1('0x84')]!=0x0)return _0x30a7ff;return db['UserProfileResource'][_0xcbb1('0x79')]({'name':_0x30a7ff['name'],'resourceId':_0x30a7ff['id'],'type':_0x6ce7ef[_0xcbb1('0x33')],'sectionId':_0x6ce7ef['id']},{})[_0xcbb1('0x12')](function(){return _0x30a7ff;});})[_0xcbb1('0x1b')](function(_0xc0dffc){logger[_0xcbb1('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc0dffc);throw _0xc0dffc;});})['then'](respondWithResult(_0x5c81d6,0xc9))[_0xcbb1('0x1b')](handleError(_0x5c81d6,null));};exports['bulkCreate']=function(_0x5cb751,_0x1b8760){var _0x44d195=_0x5cb751[_0xcbb1('0x58')];var _0x6a6590=[];if(_0x5cb751['user'][_0xcbb1('0x26')]==='agent')throw new Error(_0xcbb1('0x7a'));if(_['some'](_0x44d195,[_0xcbb1('0x26'),'user'])&&_0x5cb751[_0xcbb1('0x28')][_0xcbb1('0x26')]!==_0xcbb1('0x7b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xcbb1('0x85')](_0x44d195,[_0xcbb1('0x26'),_0xcbb1('0x7b')])&&_0x5cb751[_0xcbb1('0x28')][_0xcbb1('0x26')]!==_0xcbb1('0x7b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xcbb1('0x7e')](_0x44d195)[_0xcbb1('0x12')](function(){return validateUser(_0x44d195[0x0]);})[_0xcbb1('0x12')](function(){for(var _0x28f5a5=0x1;_0x28f5a5<_0x44d195[_0xcbb1('0x46')];_0x28f5a5++){var _0x1e67f7=_0x44d195[_0x28f5a5-0x1]['internal'];if(!_0x44d195[_0x28f5a5][_0xcbb1('0x5d')])_0x44d195[_0x28f5a5][_0xcbb1('0x5d')]=_0x1e67f7+0x1;_0x6a6590['push'](validateUser(_0x44d195[_0x28f5a5]));}return BPromise[_0xcbb1('0x4d')](_0x6a6590);})[_0xcbb1('0x12')](function(){_0x6a6590=[];for(var _0x5bc392=0x0;_0x5bc392<_0x44d195[_0xcbb1('0x46')];_0x5bc392++){_0x6a6590[_0xcbb1('0x40')](updateUser(_0x44d195[_0x5bc392]));}return BPromise[_0xcbb1('0x4d')](_0x6a6590);})[_0xcbb1('0x12')](function(){return BPromise[_0xcbb1('0x86')](_0x44d195,function(_0x4aef6f){return db[_0xcbb1('0x35')][_0xcbb1('0x79')](_0x4aef6f,{'include':[{'model':db[_0xcbb1('0x80')],'as':_0xcbb1('0x80')}]})[_0xcbb1('0x12')](function(_0x4b159c){_0x4aef6f['id']=_0x4b159c['id'];return _0x4aef6f;});});})['then'](function(_0x4907f3){if(_0x5cb751['body'][_0xcbb1('0x26')]==='user')return _0x4907f3;if(_0x5cb751['user'][_0xcbb1('0x26')]!==_0xcbb1('0x28'))return _0x4907f3;var _0x39d15e=_[_0xcbb1('0x85')](_0x4907f3,function(_0x4b63f3){return _0x4b63f3[_0xcbb1('0x26')]==='agent'||_0x4b63f3[_0xcbb1('0x26')]==='telephone';});if(!_0x39d15e)return _0x4907f3;return db['UserProfileSection'][_0xcbb1('0x41')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x5cb751[_0xcbb1('0x28')][_0xcbb1('0x7f')]},'raw':!![]})[_0xcbb1('0x12')](function(_0x186946){if(_['isEmpty'](_0x186946)||!_[_0xcbb1('0x85')](_0x186946,[_0xcbb1('0x84'),0x0]))return _0x4907f3;_0x6a6590=[];var _0x240fcd=_(_0x186946)['map'](function(_0x6eb839){if(_0x6eb839[_0xcbb1('0x84')]===0x1)return;return _0x6eb839[_0xcbb1('0x33')]===_0xcbb1('0x29')?'agent':'telephone';})[_0xcbb1('0x87')]()[_0xcbb1('0x2d')]();for(var _0x31e802=0x0;_0x31e802<_0x4907f3['length'];_0x31e802++){if(!_['includes'](_0x240fcd,_0x4907f3[_0x31e802]['role']))return;var _0x4fb0b9=_0x4907f3[_0x31e802]['role']===_0xcbb1('0x82')?_0xcbb1('0x29'):_0xcbb1('0x83');_0x6a6590[_0xcbb1('0x40')](db[_0xcbb1('0x30')]['create']({'name':_0x4907f3[_0x31e802][_0xcbb1('0x33')],'resourceId':_0x4907f3[_0x31e802]['id'],'type':_0x4fb0b9,'sectionId':_[_0xcbb1('0x2f')](_0x186946,[_0xcbb1('0x33'),_0x4fb0b9])['id']},{}));}return BPromise[_0xcbb1('0x4d')](_0x6a6590);});})[_0xcbb1('0x12')](respondWithResult(_0x1b8760,0xc9))['catch'](handleError(_0x1b8760,null));};exports[_0xcbb1('0x88')]=function(_0x277c46,_0xbce631){if(_0x277c46[_0xcbb1('0x58')]['id']){delete _0x277c46[_0xcbb1('0x58')]['id'];}return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0x277c46[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](function(_0x307a2b){if(!_0x307a2b)return null;if(_0x307a2b['id']===_0x277c46[_0xcbb1('0x28')]['id']){if(!_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8a')]||!_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8b')]){throw new db[(_0xcbb1('0x8c'))][(_0xcbb1('0x8d'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x307a2b['authenticate'](_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8a')])){throw new db[(_0xcbb1('0x8c'))][(_0xcbb1('0x8d'))](_0xcbb1('0x8e'));}if(_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8a')]===_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8b')]){throw new db[(_0xcbb1('0x8c'))][(_0xcbb1('0x8d'))](_0xcbb1('0x8f'));}}else if(_0x277c46[_0xcbb1('0x28')][_0xcbb1('0x26')]===_0xcbb1('0x7b')){if(!_0x277c46[_0xcbb1('0x58')]['newPassword']){throw new db[(_0xcbb1('0x8c'))]['ValidationError'](_0xcbb1('0x90'));}}else if(_0x277c46[_0xcbb1('0x28')][_0xcbb1('0x26')]==='user'){if(!_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8b')]){throw new db[(_0xcbb1('0x8c'))][(_0xcbb1('0x8d'))](_0xcbb1('0x90'));}if(_0x307a2b[_0xcbb1('0x26')]!==_0xcbb1('0x82')){throw new db[(_0xcbb1('0x8c'))]['ValidationError'](_0xcbb1('0x7a'));}}else{throw new db[(_0xcbb1('0x8c'))]['ValidationError'](_0xcbb1('0x7a'));}return _0x307a2b;})[_0xcbb1('0x12')](handleEntityNotFound(_0xbce631,null))[_0xcbb1('0x12')](function(_0xc11a41){return db[_0xcbb1('0x5e')][_0xcbb1('0x91')]({'attributes':['id',_0xcbb1('0x60'),_0xcbb1('0x92'),'passwordHistoryLimit']})[_0xcbb1('0x12')](function(_0x414404){if(_0x414404['securePassword'])authService[_0xcbb1('0x93')](_0x277c46['body']['newPassword']);if(!_0x414404['enforcePasswordHistory']||!_0xc11a41[_0xcbb1('0x94')])return _0xc11a41;authService[_0xcbb1('0x95')](_0x277c46[_0xcbb1('0x58')]['newPassword'],_0xc11a41['previousPasswords'],_0x414404['passwordHistoryLimit']);return _0xc11a41;})[_0xcbb1('0x12')](saveUpdates({'password':_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8b')],'passwordResetAt':_0x277c46['user']['id']==_0x277c46[_0xcbb1('0x89')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x277c46[_0xcbb1('0x58')][_0xcbb1('0x8b')],_0xc11a41['previousPasswords'])},null));})[_0xcbb1('0x12')](respondWithResult(_0xbce631,null))['catch'](handleError(_0xbce631,null));};exports['addQueues']=function(_0x4b21f5,_0xb1b2a1){var _0x4d7b52=_0x4b21f5[_0xcbb1('0x58')][_0xcbb1('0x96')];return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0x4b21f5[_0xcbb1('0x89')]['id']},'attributes':['id',_0xcbb1('0x33'),_0xcbb1('0x26'),'online',_0xcbb1('0x97'),_0xcbb1('0x98'),_0xcbb1('0x99')]})[_0xcbb1('0x12')](handleEntityNotFound(_0xb1b2a1,null))[_0xcbb1('0x12')](function(_0xd65917){if(_0xd65917){if(!utils[_0xcbb1('0x9a')](_0x4d7b52)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0xd65917[_0xcbb1('0x9b')+_[_0xcbb1('0x9c')](_0x4d7b52['toLowerCase']())+_0xcbb1('0x9d')](_0x4b21f5[_0xcbb1('0x58')][_0xcbb1('0x5b')],{'penalty':_0x4b21f5[_0xcbb1('0x58')][_0xcbb1('0x9e')]||0x0})[_0xcbb1('0x9f')](function(_0x761496){for(var _0xe3bc15=0x0;_0xe3bc15<_0x4b21f5[_0xcbb1('0x58')]['ids'][_0xcbb1('0x46')];_0xe3bc15+=0x1){var _0x576865={'UserId':Number(_0x4b21f5[_0xcbb1('0x89')]['id'])};_0x576865[_[_0xcbb1('0x9c')](_0x4d7b52[_0xcbb1('0xa0')]())+'QueueId']=Number(_0x4b21f5['body']['ids'][_0xe3bc15]);socket['emit']('user'+_[_0xcbb1('0x9c')](_0x4d7b52[_0xcbb1('0xa0')]())+_0xcbb1('0xa1'),_0x576865);}return _0x761496;})[_0xcbb1('0x12')](function(){if(_0x4d7b52==='voice'){return db['VoiceQueue'][_0xcbb1('0x41')]({'where':{'id':_0x4b21f5['body'][_0xcbb1('0x5b')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xcbb1('0x12')](function(_0x50be6e){var _0x25b07b=_0xd65917[_0xcbb1('0x25')]({'plain':!![]});var _0xcc09d8=[];if(_0x4d7b52==='voice'&&_0x25b07b['role']==='agent'&&_0x25b07b[_0xcbb1('0xa2')]){for(var _0x59c284=0x0;_0x59c284<_0x50be6e[_0xcbb1('0x46')];_0x59c284+=0x1){_0xcc09d8[_0xcbb1('0x40')]({'membername':_0x25b07b[_0xcbb1('0x33')],'UserId':_0x25b07b['id'],'queue_name':_0x50be6e[_0x59c284][_0xcbb1('0x33')],'VoiceQueueId':_0x50be6e[_0x59c284]['id'],'interface':_[_0xcbb1('0x62')](_0x25b07b[_0xcbb1('0x99')])?util[_0xcbb1('0xa3')](_0xcbb1('0xa4'),_0x25b07b[_0xcbb1('0x33')]):_0x25b07b[_0xcbb1('0x99')],'paused':_0x25b07b[_0xcbb1('0x98')]||![],'penalty':_0x4b21f5[_0xcbb1('0x58')][_0xcbb1('0x9e')]||0x0});}return BPromise[_0xcbb1('0x86')](_0xcc09d8,function(_0x286636){return db[_0xcbb1('0xa5')]['upsert'](_0x286636);});}return _0xd65917;});}})[_0xcbb1('0x12')](respondWithStatusCode(_0xb1b2a1,null))[_0xcbb1('0x1b')](handleError(_0xb1b2a1,null));};exports[_0xcbb1('0xa6')]=function(_0x40f605,_0x452dcd){var _0x115b3c,_0x22e2de;return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0x40f605[_0xcbb1('0x89')]['id']},'attributes':['id',_0xcbb1('0x33'),_0xcbb1('0x26')]})[_0xcbb1('0x12')](handleEntityNotFound(_0x452dcd,null))[_0xcbb1('0x12')](function(_0x5e37cf){if(_0x5e37cf){_0x115b3c=_0x5e37cf;if(!_0x40f605['query'][_0xcbb1('0x96')]||!utils['isValidChannel'](_0x40f605['query']['channel'])){throw new db[(_0xcbb1('0x8c'))][(_0xcbb1('0x8d'))]('Unknown\x20channel');}return _0x5e37cf['remove'+_[_0xcbb1('0x9c')](_0x40f605[_0xcbb1('0x43')][_0xcbb1('0x96')]['toLowerCase']())+_0xcbb1('0x9d')](_0x40f605['query']['ids']);}})['then'](function(_0x324951){if(_[_0xcbb1('0xa7')](_0x40f605['query'][_0xcbb1('0x5b')])){for(var _0x155522=0x0;_0x155522<_0x40f605['query'][_0xcbb1('0x5b')]['length'];_0x155522+=0x1){_0x22e2de={'UserId':Number(_0x40f605[_0xcbb1('0x89')]['id'])};_0x22e2de[_[_0xcbb1('0x9c')](_0x40f605['query'][_0xcbb1('0x96')]['toLowerCase']())+_0xcbb1('0xa8')]=Number(_0x40f605[_0xcbb1('0x43')]['ids'][_0x155522]);socket[_0xcbb1('0xa9')]('user'+_[_0xcbb1('0x9c')](_0x40f605[_0xcbb1('0x43')][_0xcbb1('0x96')][_0xcbb1('0xa0')]())+_0xcbb1('0xaa'),_0x22e2de);}}else{_0x22e2de={'UserId':Number(_0x40f605[_0xcbb1('0x89')]['id'])};_0x22e2de[_[_0xcbb1('0x9c')](_0x40f605[_0xcbb1('0x43')]['channel']['toLowerCase']())+_0xcbb1('0xa8')]=Number(_0x40f605[_0xcbb1('0x43')][_0xcbb1('0x5b')]);socket['emit'](_0xcbb1('0x28')+_[_0xcbb1('0x9c')](_0x40f605['query']['channel'][_0xcbb1('0xa0')]())+_0xcbb1('0xaa'),_0x22e2de);}return _0x324951;})[_0xcbb1('0x12')](function(){if(_0x40f605[_0xcbb1('0x43')][_0xcbb1('0x96')]==='voice'){return db[_0xcbb1('0xa5')][_0xcbb1('0x24')]({'where':{'UserId':_0x40f605[_0xcbb1('0x89')]['id'],'VoiceQueueId':_0x40f605['query'][_0xcbb1('0x5b')]},'individualHooks':!![]})['then'](function(){return _0x115b3c;});}return _0x115b3c;})[_0xcbb1('0x12')](respondWithStatusCode(_0x452dcd,null))[_0xcbb1('0x1b')](handleError(_0x452dcd,null));};exports[_0xcbb1('0xab')]=function(_0x5588e3,_0x16b7e2){_0x5588e3[_0xcbb1('0x58')][_0xcbb1('0xac')]=_0x5588e3[_0xcbb1('0xad')]['filename'];return db[_0xcbb1('0x35')]['find']({'where':{'id':_0x5588e3[_0xcbb1('0x89')]['id']}})['then'](handleEntityNotFound(_0x16b7e2,null))['then'](saveUpdates(_0x5588e3[_0xcbb1('0x58')],null))[_0xcbb1('0x12')](respondWithResult(_0x16b7e2,null))[_0xcbb1('0x1b')](handleError(_0x16b7e2,null));};exports[_0xcbb1('0xae')]=function(_0xa01f09,_0x5322b8){var _0xad0c00=path[_0xcbb1('0xaf')](config[_0xcbb1('0xb0')],'server/files/images/logos/default_profile.png');return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0xa01f09['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x5322b8,null))['then'](function(_0x572fa7){if(_0x572fa7){if(_[_0xcbb1('0x62')](_0x572fa7[_0xcbb1('0xac')])){return _0x5322b8[_0xcbb1('0xb1')](_0xad0c00);}else{if(!fs[_0xcbb1('0xb2')](path[_0xcbb1('0xaf')](config[_0xcbb1('0xb0')],'server/files/images/',_0x572fa7[_0xcbb1('0xac')]))){return _0x5322b8[_0xcbb1('0xb1')](_0xad0c00);}return _0x5322b8[_0xcbb1('0xb1')](path[_0xcbb1('0xaf')](config['root'],_0xcbb1('0xb3'),_0x572fa7[_0xcbb1('0xac')]));}}})['catch'](handleError(_0x5322b8,null));};exports[_0xcbb1('0xb4')]=function(_0x152ae7,_0x29039c){return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0x152ae7[_0xcbb1('0x89')]['id']},'attributes':['id']})[_0xcbb1('0x12')](handleEntityNotFound(_0x29039c,null))['then'](function(_0x44de1e){var _0x1b2e7d=[];values=_0x44de1e[_0xcbb1('0x49')];_0x1b2e7d[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x47'),_0x44de1e[_0xcbb1('0x49')]));_0x1b2e7d['push'](get_open_tabs(_0xcbb1('0x48'),_0x44de1e[_0xcbb1('0x49')]));_0x1b2e7d['push'](get_open_tabs(_0xcbb1('0x57'),_0x44de1e[_0xcbb1('0x49')]));_0x1b2e7d[_0xcbb1('0x40')](get_open_tabs('whatsapp',_0x44de1e['dataValues']));_0x1b2e7d[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x4a'),_0x44de1e[_0xcbb1('0x49')]));_0x1b2e7d[_0xcbb1('0x40')](get_open_tabs(_0xcbb1('0x4b'),_0x44de1e['dataValues']));return BPromise[_0xcbb1('0x4d')](_0x1b2e7d);})['then'](function(_0x552710){if(_0x552710){var _0x10bbbd=_['map'](values['ChatOpenTabs'],function(_0x51d684){return{'channel':'CHAT','id':_0x51d684['id'],'createdAt':_0x51d684['createdAt']};});var _0x375dcd=_[_0xcbb1('0xb5')](values[_0xcbb1('0xb6')],function(_0x51354c){return{'channel':_0xcbb1('0xb7'),'id':_0x51354c['id'],'createdAt':_0x51354c[_0xcbb1('0xb8')]};});var _0x29f433=_[_0xcbb1('0xb5')](values[_0xcbb1('0xb9')],function(_0x1e21ad){return{'channel':'OPENCHANNEL','id':_0x1e21ad['id'],'createdAt':_0x1e21ad['createdAt']};});var _0x578c11=_['map'](values[_0xcbb1('0xba')],function(_0x3bd1ab){return{'channel':'MAIL','id':_0x3bd1ab['id'],'createdAt':_0x3bd1ab[_0xcbb1('0xb8')]};});var _0x230017=_['map'](values[_0xcbb1('0xbb')],function(_0xd5c1e1){return{'channel':_0xcbb1('0xbc'),'id':_0xd5c1e1['id'],'createdAt':_0xd5c1e1[_0xcbb1('0xb8')]};});var _0x222a02=_[_0xcbb1('0xb5')](values[_0xcbb1('0xbd')],function(_0x28923b){return{'channel':_0xcbb1('0xbe'),'id':_0x28923b['id'],'createdAt':_0x28923b[_0xcbb1('0xb8')]};});var _0x1520d4=_[_0xcbb1('0xbf')](_0x10bbbd,_0x375dcd,_0x29f433,_0x578c11,_0x230017,_0x222a02);var _0x1ba43e={'count':_0x1520d4[_0xcbb1('0x46')],'rows':_0x1520d4};return _0x1ba43e;}else return null;})['then'](respondWithResult(_0x29039c,null))[_0xcbb1('0x1b')](handleError(_0x29039c,null));};exports[_0xcbb1('0xc0')]=function(_0x2b13d3,_0x17f117){var _0x5ce9f9={};var _0x39c43d={};var _0x3492f9;var _0xc63ebc;return db[_0xcbb1('0x35')][_0xcbb1('0x91')]({'where':{'id':_0x2b13d3[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x17f117,null))['then'](function(_0x4cf740){if(_0x4cf740){_0x3492f9=_0x4cf740;_0x39c43d[_0xcbb1('0x4f')]=_['keys'](db[_0xcbb1('0xc1')][_0xcbb1('0x36')]);_0x39c43d[_0xcbb1('0x43')]=_['keys'](_0x2b13d3[_0xcbb1('0x43')]);_0x39c43d[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0x39c43d['model'],_0x39c43d[_0xcbb1('0x43')]);_0x5ce9f9[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x39c43d[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x2b13d3['query'][_0xcbb1('0x53')]));_0x5ce9f9[_0xcbb1('0x3f')]=_0x5ce9f9[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x5ce9f9[_0xcbb1('0x3f')]:_0x39c43d[_0xcbb1('0x4f')];_0x5ce9f9[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x2b13d3[_0xcbb1('0x43')]['sort']);_0x5ce9f9[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x2b13d3[_0xcbb1('0x43')],_0x39c43d[_0xcbb1('0xc2')]));if(_0x2b13d3[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x5ce9f9[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x5ce9f9[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x5ce9f9[_0xcbb1('0x3f')],function(_0x426be7){var _0x2b9428={};_0x2b9428[_0x426be7]={'$like':'%'+_0x2b13d3[_0xcbb1('0x43')]['filter']+'%'};return _0x2b9428;})});}_0x5ce9f9=_[_0xcbb1('0x55')]({},_0x5ce9f9,_0x2b13d3[_0xcbb1('0x56')]);return _0x3492f9[_0xcbb1('0xc0')](_0x5ce9f9);}})[_0xcbb1('0x12')](function(_0xb6e955){if(_0xb6e955){_0xc63ebc=_0xb6e955[_0xcbb1('0x46')];if(_0x2b13d3['query'][_0xcbb1('0xc6')]('includeAll')){_0x5ce9f9[_0xcbb1('0x3d')]=[{'model':db[_0xcbb1('0xc7')],'as':_0xcbb1('0xc8'),'required':![]},{'model':db[_0xcbb1('0xc9')],'as':_0xcbb1('0xca'),'attributes':['id','name',_0xcbb1('0xcb')],'where':_0x2b13d3[_0xcbb1('0x43')]['tag']?{'id':_0x2b13d3[_0xcbb1('0x43')][_0xcbb1('0xcc')]}:undefined,'required':_0x2b13d3['query']['tag']?!![]:![]}];}if(!_0x2b13d3[_0xcbb1('0x43')][_0xcbb1('0xc6')](_0xcbb1('0xcd'))){_0x5ce9f9[_0xcbb1('0x21')]=qs[_0xcbb1('0x21')](_0x2b13d3[_0xcbb1('0x43')][_0xcbb1('0x21')]);_0x5ce9f9['offset']=qs['offset'](_0x2b13d3[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}return _0x3492f9['getContacts'](_0x5ce9f9);}})['then'](function(_0x3be7a5){if(_0x3be7a5){return _0x3be7a5?{'count':_0xc63ebc,'rows':_0x3be7a5}:null;}})[_0xcbb1('0x12')](respondWithResult(_0x17f117,null))['catch'](handleError(_0x17f117,null));};exports['getQueues']=function(_0xca8ce8,_0x45ac06){var _0x35cac9;var _0x29b468={};var _0x2fe57f;return db[_0xcbb1('0x35')]['findOne']({'where':{'id':_0xca8ce8['params']['id']},'attributes':['id',_0xcbb1('0x33'),'role']})[_0xcbb1('0x12')](handleEntityNotFound(_0x45ac06,null))[_0xcbb1('0x12')](function(_0x5396dd){if(!utils[_0xcbb1('0x9a')](_0xca8ce8['query']['channel'])){throw new db[(_0xcbb1('0x8c'))]['ValidationError'](_0xcbb1('0xce'));}_0x35cac9=_0x5396dd;var _0x57be36={};_0x57be36[_0xcbb1('0x4f')]=_['keys'](db[_['capitalize'](_0xca8ce8[_0xcbb1('0x43')]['channel'])+'Queue'][_0xcbb1('0x36')]);_0x57be36['query']=_[_0xcbb1('0x51')](_0xca8ce8[_0xcbb1('0x43')]);_0x57be36['filters']=_[_0xcbb1('0x52')](_0x57be36[_0xcbb1('0x4f')],_0x57be36[_0xcbb1('0x43')]);_0x29b468[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x57be36[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0xca8ce8[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x29b468[_0xcbb1('0x3f')]=_0x29b468['attributes'][_0xcbb1('0x46')]?_0x29b468[_0xcbb1('0x3f')]:_0x57be36['model'];_0x29b468['order']=qs[_0xcbb1('0xc4')](_0xca8ce8[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x29b468['where']=qs['filters'](_['pick'](_0xca8ce8[_0xcbb1('0x43')],_0x57be36[_0xcbb1('0xc2')]));if(_0xca8ce8[_0xcbb1('0x43')]['filter']){_0x29b468['where']=_[_0xcbb1('0x55')](_0x29b468[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x29b468[_0xcbb1('0x3f')],function(_0x3e91cb){var _0x14472c={};_0x14472c[_0x3e91cb]={'$like':'%'+_0xca8ce8[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x14472c;})});}_0x29b468=_[_0xcbb1('0x55')]({},_0x29b468,_0xca8ce8[_0xcbb1('0x56')]);switch(_0x35cac9['role']){case _0xcbb1('0x7b'):return db[_[_0xcbb1('0x9c')](_0xca8ce8[_0xcbb1('0x43')]['channel'])+_0xcbb1('0xcf')][_0xcbb1('0x41')](_0x29b468);case _0xcbb1('0x28'):case _0xcbb1('0x82'):return _0x35cac9[_0xcbb1('0x25')+_[_0xcbb1('0x9c')](_0xca8ce8[_0xcbb1('0x43')]['channel'])+_0xcbb1('0x9d')](_0x29b468);default:throw new db[(_0xcbb1('0x8c'))][(_0xcbb1('0x8d'))]('Unknown\x20role');}})[_0xcbb1('0x12')](function(_0x275d2c){_0x2fe57f=_0x275d2c[_0xcbb1('0x46')];if(!_0xca8ce8[_0xcbb1('0x43')]['hasOwnProperty']('nolimit')){_0x29b468['limit']=qs['limit'](_0xca8ce8[_0xcbb1('0x43')]['limit']);_0x29b468[_0xcbb1('0x1e')]=qs['offset'](_0xca8ce8[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}switch(_0x35cac9['role']){case'admin':return db[_[_0xcbb1('0x9c')](_0xca8ce8[_0xcbb1('0x43')][_0xcbb1('0x96')])+'Queue'][_0xcbb1('0x41')](_0x29b468);case _0xcbb1('0x28'):case _0xcbb1('0x82'):return _0x35cac9[_0xcbb1('0x25')+_['capitalize'](_0xca8ce8['query'][_0xcbb1('0x96')])+_0xcbb1('0x9d')](_0x29b468);}})[_0xcbb1('0x12')](function(_0x38a45d){return{'count':_0x2fe57f,'rows':_0x38a45d};})[_0xcbb1('0x12')](respondWithResult(_0x45ac06,null))['catch'](handleError(_0x45ac06,null));};exports[_0xcbb1('0xd0')]=function(_0x5bd992,_0x1dcc8a){var _0x4056bb={};var _0x377a15={};var _0x3a4d99;var _0x175f81;return db['User'][_0xcbb1('0x91')]({'where':{'id':_0x5bd992[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x1dcc8a,null))[_0xcbb1('0x12')](function(_0x27e10a){if(_0x27e10a){_0x3a4d99=_0x27e10a;_0x377a15[_0xcbb1('0x4f')]=_[_0xcbb1('0x51')](db['UserVoiceQueueRt'][_0xcbb1('0x36')]);_0x377a15[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x5bd992[_0xcbb1('0x43')]);_0x377a15['filters']=_[_0xcbb1('0x52')](_0x377a15['model'],_0x377a15[_0xcbb1('0x43')]);_0x4056bb[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x377a15[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x5bd992[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x4056bb[_0xcbb1('0x3f')]=_0x4056bb[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x4056bb[_0xcbb1('0x3f')]:_0x377a15[_0xcbb1('0x4f')];_0x4056bb[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x5bd992[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x4056bb[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x5bd992['query'],_0x377a15[_0xcbb1('0xc2')]));if(_0x5bd992[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x4056bb['where']=_[_0xcbb1('0x55')](_0x4056bb[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x4056bb[_0xcbb1('0x3f')],function(_0x5c3a6e){var _0x3e8b28={};_0x3e8b28[_0x5c3a6e]={'$like':'%'+_0x5bd992[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x3e8b28;})});}_0x4056bb=_[_0xcbb1('0x55')]({},_0x4056bb,_0x5bd992[_0xcbb1('0x56')]);return _0x3a4d99['getVoiceQueuesRt'](_0x4056bb);}})[_0xcbb1('0x12')](function(_0x56d6c1){if(_0x56d6c1){_0x175f81=_0x56d6c1['length'];if(!_0x5bd992[_0xcbb1('0x43')]['hasOwnProperty'](_0xcbb1('0xcd'))){_0x4056bb[_0xcbb1('0x21')]=qs[_0xcbb1('0x21')](_0x5bd992[_0xcbb1('0x43')][_0xcbb1('0x21')]);_0x4056bb['offset']=qs[_0xcbb1('0x1e')](_0x5bd992[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}return _0x3a4d99['getVoiceQueuesRt'](_0x4056bb);}})[_0xcbb1('0x12')](function(_0x2a30ae){if(_0x2a30ae){return _0x2a30ae?{'count':_0x175f81,'rows':_0x2a30ae}:null;}})['then'](respondWithResult(_0x1dcc8a,null))[_0xcbb1('0x1b')](handleError(_0x1dcc8a,null));};exports[_0xcbb1('0xd1')]=function(_0x3467b1,_0x3c008b){var _0x177714={};var _0x496b6f={};var _0x6f4321;var _0x3da317;return db[_0xcbb1('0x35')][_0xcbb1('0x91')]({'where':{'id':_0x3467b1[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x3c008b,null))[_0xcbb1('0x12')](function(_0x33e444){if(_0x33e444){_0x6f4321=_0x33e444;_0x496b6f['model']=_[_0xcbb1('0x51')](db[_0xcbb1('0xd2')][_0xcbb1('0x36')]);_0x496b6f[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x3467b1['query']);_0x496b6f['filters']=_[_0xcbb1('0x52')](_0x496b6f[_0xcbb1('0x4f')],_0x496b6f[_0xcbb1('0x43')]);_0x177714[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x496b6f[_0xcbb1('0x4f')],qs['fields'](_0x3467b1[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x177714['attributes']=_0x177714[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x177714[_0xcbb1('0x3f')]:_0x496b6f[_0xcbb1('0x4f')];_0x177714[_0xcbb1('0xc3')]=qs['sort'](_0x3467b1[_0xcbb1('0x43')]['sort']);_0x177714['where']=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x3467b1[_0xcbb1('0x43')],_0x496b6f[_0xcbb1('0xc2')]));if(_0x3467b1[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x177714[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x177714[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x177714[_0xcbb1('0x3f')],function(_0x485541){var _0x875ebc={};_0x875ebc[_0x485541]={'$like':'%'+_0x3467b1[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x875ebc;})});}_0x177714=_['merge']({},_0x177714,_0x3467b1[_0xcbb1('0x56')]);return _0x6f4321[_0xcbb1('0xd1')](_0x177714);}})[_0xcbb1('0x12')](function(_0x3b795d){if(_0x3b795d){_0x3da317=_0x3b795d[_0xcbb1('0x46')];if(!_0x3467b1[_0xcbb1('0x43')][_0xcbb1('0xc6')](_0xcbb1('0xcd'))){_0x177714['limit']=qs['limit'](_0x3467b1[_0xcbb1('0x43')]['limit']);_0x177714[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x3467b1[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}return _0x6f4321[_0xcbb1('0xd1')](_0x177714);}})['then'](function(_0x29400f){if(_0x29400f){return _0x29400f?{'count':_0x3da317,'rows':_0x29400f}:null;}})[_0xcbb1('0x12')](respondWithResult(_0x3c008b,null))[_0xcbb1('0x1b')](handleError(_0x3c008b,null));};exports[_0xcbb1('0xd3')]=function(_0x30d01a,_0x21816e){var _0x56d32d={'raw':!![],'where':{}};var _0x430e42={};var _0x281dad={'count':0x0,'rows':[]};return db[_0xcbb1('0x35')][_0xcbb1('0x91')]({'where':{'id':_0x30d01a[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x21816e,null))[_0xcbb1('0x12')](function(_0x2653c6){if(_0x2653c6){_0x430e42[_0xcbb1('0x4f')]=_[_0xcbb1('0x51')](db[_0xcbb1('0xd4')][_0xcbb1('0x36')]);_0x430e42[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x30d01a[_0xcbb1('0x43')]);_0x430e42[_0xcbb1('0xc2')]=_['intersection'](_0x430e42[_0xcbb1('0x4f')],_0x430e42[_0xcbb1('0x43')]);_0x56d32d['attributes']=_[_0xcbb1('0x52')](_0x430e42[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x30d01a[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x56d32d[_0xcbb1('0x3f')]=_0x56d32d[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x56d32d[_0xcbb1('0x3f')]:_0x430e42[_0xcbb1('0x4f')];if(!_0x30d01a['query'][_0xcbb1('0xc6')]('nolimit')){_0x56d32d[_0xcbb1('0x21')]=qs[_0xcbb1('0x21')](_0x30d01a[_0xcbb1('0x43')]['limit']);_0x56d32d[_0xcbb1('0x1e')]=qs['offset'](_0x30d01a['query'][_0xcbb1('0x1e')]);}_0x56d32d[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x30d01a[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x56d32d['where']=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x30d01a[_0xcbb1('0x43')],_0x430e42[_0xcbb1('0xc2')]));_0x56d32d[_0xcbb1('0x3c')][_0xcbb1('0xd5')]=_0x2653c6['id'];if(_0x30d01a[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x56d32d[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x56d32d['where'],{'$or':_['map'](_0x56d32d['attributes'],function(_0x207958){var _0x14218c={};_0x14218c[_0x207958]={'$like':'%'+_0x30d01a[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x14218c;})});}_0x56d32d=_[_0xcbb1('0x55')]({},_0x56d32d,_0x30d01a[_0xcbb1('0x56')]);return db['VoiceRecording'][_0xcbb1('0x20')]({'where':_0x56d32d[_0xcbb1('0x3c')]})[_0xcbb1('0x12')](function(_0x1b89e5){_0x281dad[_0xcbb1('0x20')]=_0x1b89e5;if(_0x30d01a['query'][_0xcbb1('0xd6')]){_0x56d32d['include']=[{'all':!![]}];}return db[_0xcbb1('0xd4')][_0xcbb1('0x41')](_0x56d32d);})[_0xcbb1('0x12')](function(_0x4346fe){_0x281dad[_0xcbb1('0x42')]=_0x4346fe;return _0x281dad;});}})['then'](respondWithFilteredResult(_0x21816e,_0x56d32d))[_0xcbb1('0x1b')](handleError(_0x21816e,null));};exports[_0xcbb1('0xd7')]=function(_0x1599bc,_0x6705f0){var _0x25c950={'raw':!![],'where':{}};var _0x2571f9={};var _0x208e48={'count':0x0,'rows':[]};return db['User'][_0xcbb1('0x91')]({'where':{'id':_0x1599bc['params']['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x6705f0,null))[_0xcbb1('0x12')](function(_0x4337a0){if(_0x4337a0){_0x2571f9['model']=_['keys'](db[_0xcbb1('0xd8')][_0xcbb1('0x36')]);_0x2571f9[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x1599bc[_0xcbb1('0x43')]);_0x2571f9[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0x2571f9[_0xcbb1('0x4f')],_0x2571f9['query']);_0x25c950['attributes']=_[_0xcbb1('0x52')](_0x2571f9[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x1599bc[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x25c950[_0xcbb1('0x3f')]=_0x25c950[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x25c950[_0xcbb1('0x3f')]:_0x2571f9['model'];if(!_0x1599bc[_0xcbb1('0x43')][_0xcbb1('0xc6')]('nolimit')){_0x25c950[_0xcbb1('0x21')]=qs['limit'](_0x1599bc[_0xcbb1('0x43')][_0xcbb1('0x21')]);_0x25c950[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x1599bc[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}_0x25c950[_0xcbb1('0xc3')]=qs['sort'](_0x1599bc[_0xcbb1('0x43')]['sort']);_0x25c950[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_['pick'](_0x1599bc['query'],_0x2571f9[_0xcbb1('0xc2')]));_0x25c950[_0xcbb1('0x3c')]['UserId']=_0x4337a0['id'];if(_0x1599bc[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x25c950[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x25c950['where'],{'$or':_[_0xcbb1('0xb5')](_0x25c950[_0xcbb1('0x3f')],function(_0x5453e0){var _0xac8086={};_0xac8086[_0x5453e0]={'$like':'%'+_0x1599bc['query'][_0xcbb1('0x2b')]+'%'};return _0xac8086;})});}_0x25c950=_[_0xcbb1('0x55')]({},_0x25c950,_0x1599bc[_0xcbb1('0x56')]);return db[_0xcbb1('0xd8')][_0xcbb1('0x20')]({'where':_0x25c950[_0xcbb1('0x3c')]})['then'](function(_0x165b33){_0x208e48[_0xcbb1('0x20')]=_0x165b33;if(_0x1599bc[_0xcbb1('0x43')]['includeAll']){_0x25c950['include']=[{'all':!![]}];}return db[_0xcbb1('0xd8')]['findAll'](_0x25c950);})[_0xcbb1('0x12')](function(_0x47630b){_0x208e48['rows']=_0x47630b;return _0x208e48;});}})[_0xcbb1('0x12')](respondWithFilteredResult(_0x6705f0,_0x25c950))[_0xcbb1('0x1b')](handleError(_0x6705f0,null));};exports[_0xcbb1('0xd9')]=function(_0x2e0f17,_0x3769fe){var _0x2e1005={};var _0x24873e={};var _0x7cee85;var _0x19e0ba;return db[_0xcbb1('0x35')][_0xcbb1('0x91')]({'where':{'id':_0x2e0f17['params']['id']}})['then'](handleEntityNotFound(_0x3769fe,null))['then'](function(_0x12ef35){if(_0x12ef35){_0x7cee85=_0x12ef35;_0x24873e['model']=_[_0xcbb1('0x51')](db[_0xcbb1('0xda')][_0xcbb1('0x36')]);_0x24873e[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x2e0f17[_0xcbb1('0x43')]);_0x24873e[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0x24873e['model'],_0x24873e[_0xcbb1('0x43')]);_0x2e1005[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x24873e[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x2e0f17['query'][_0xcbb1('0x53')]));_0x2e1005[_0xcbb1('0x3f')]=_0x2e1005[_0xcbb1('0x3f')]['length']?_0x2e1005[_0xcbb1('0x3f')]:_0x24873e['model'];_0x2e1005[_0xcbb1('0xc3')]=qs['sort'](_0x2e0f17['query'][_0xcbb1('0xc4')]);_0x2e1005[_0xcbb1('0x3c')]=qs['filters'](_[_0xcbb1('0xc5')](_0x2e0f17['query'],_0x24873e[_0xcbb1('0xc2')]));if(_0x2e0f17[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x2e1005[_0xcbb1('0x3c')]=_['merge'](_0x2e1005[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x2e1005[_0xcbb1('0x3f')],function(_0x2ff75b){var _0x4a073a={};_0x4a073a[_0x2ff75b]={'$like':'%'+_0x2e0f17[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x4a073a;})});}_0x2e1005=_[_0xcbb1('0x55')]({},_0x2e1005,_0x2e0f17[_0xcbb1('0x56')]);return _0x7cee85['getChatInteractions'](_0x2e1005);}})[_0xcbb1('0x12')](function(_0x311937){if(_0x311937){_0x19e0ba=_0x311937[_0xcbb1('0x46')];if(!_0x2e0f17[_0xcbb1('0x43')][_0xcbb1('0xc6')](_0xcbb1('0xcd'))){_0x2e1005['limit']=qs[_0xcbb1('0x21')](_0x2e0f17[_0xcbb1('0x43')][_0xcbb1('0x21')]);_0x2e1005[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x2e0f17[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}return _0x7cee85[_0xcbb1('0xd9')](_0x2e1005);}})[_0xcbb1('0x12')](function(_0x58a619){if(_0x58a619){return _0x58a619?{'count':_0x19e0ba,'rows':_0x58a619}:null;}})[_0xcbb1('0x12')](respondWithResult(_0x3769fe,null))[_0xcbb1('0x1b')](handleError(_0x3769fe,null));};exports[_0xcbb1('0xdb')]=function(_0x1030d5,_0x11fb90){var _0xd059db={};var _0x2fa5bf={};var _0x3b384c;var _0x1c098d;return db[_0xcbb1('0x35')][_0xcbb1('0x91')]({'where':{'id':_0x1030d5[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x11fb90,null))[_0xcbb1('0x12')](function(_0x196434){if(_0x196434){_0x3b384c=_0x196434;_0x2fa5bf['model']=_['keys'](db[_0xcbb1('0xdc')][_0xcbb1('0x36')]);_0x2fa5bf['query']=_[_0xcbb1('0x51')](_0x1030d5[_0xcbb1('0x43')]);_0x2fa5bf[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0x2fa5bf[_0xcbb1('0x4f')],_0x2fa5bf[_0xcbb1('0x43')]);_0xd059db['attributes']=_[_0xcbb1('0x52')](_0x2fa5bf[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x1030d5[_0xcbb1('0x43')]['fields']));_0xd059db[_0xcbb1('0x3f')]=_0xd059db['attributes'][_0xcbb1('0x46')]?_0xd059db[_0xcbb1('0x3f')]:_0x2fa5bf[_0xcbb1('0x4f')];_0xd059db[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x1030d5[_0xcbb1('0x43')]['sort']);_0xd059db[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x1030d5['query'],_0x2fa5bf[_0xcbb1('0xc2')]));if(_0x1030d5[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0xd059db[_0xcbb1('0x3c')]=_['merge'](_0xd059db['where'],{'$or':_[_0xcbb1('0xb5')](_0xd059db['attributes'],function(_0x27dfa4){var _0x88c019={};_0x88c019[_0x27dfa4]={'$like':'%'+_0x1030d5[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x88c019;})});}_0xd059db=_['merge']({},_0xd059db,_0x1030d5[_0xcbb1('0x56')]);return _0x3b384c[_0xcbb1('0xdb')](_0xd059db);}})[_0xcbb1('0x12')](function(_0x5236b6){if(_0x5236b6){_0x1c098d=_0x5236b6['length'];if(!_0x1030d5[_0xcbb1('0x43')][_0xcbb1('0xc6')]('nolimit')){_0xd059db[_0xcbb1('0x21')]=qs[_0xcbb1('0x21')](_0x1030d5[_0xcbb1('0x43')][_0xcbb1('0x21')]);_0xd059db[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x1030d5[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}return _0x3b384c[_0xcbb1('0xdb')](_0xd059db);}})[_0xcbb1('0x12')](function(_0x1c9a05){if(_0x1c9a05){return _0x1c9a05?{'count':_0x1c098d,'rows':_0x1c9a05}:null;}})[_0xcbb1('0x12')](respondWithResult(_0x11fb90,null))[_0xcbb1('0x1b')](handleError(_0x11fb90,null));};exports[_0xcbb1('0xdd')]=function(_0x38f53a,_0x5ab60b){var _0x4327fb={'raw':!![],'where':{}};var _0x29ccd2={};var _0x1c8d6f={'count':0x0,'rows':[]};return db[_0xcbb1('0x35')]['findOne']({'where':{'id':_0x38f53a[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x5ab60b,null))['then'](function(_0x360449){if(_0x360449){_0x29ccd2[_0xcbb1('0x4f')]=_['keys'](db[_0xcbb1('0xde')]['rawAttributes']);_0x29ccd2[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x38f53a[_0xcbb1('0x43')]);_0x29ccd2[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0x29ccd2[_0xcbb1('0x4f')],_0x29ccd2[_0xcbb1('0x43')]);_0x4327fb[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x29ccd2[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x38f53a[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x4327fb[_0xcbb1('0x3f')]=_0x4327fb[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x4327fb[_0xcbb1('0x3f')]:_0x29ccd2[_0xcbb1('0x4f')];if(!_0x38f53a[_0xcbb1('0x43')][_0xcbb1('0xc6')](_0xcbb1('0xcd'))){_0x4327fb['limit']=qs[_0xcbb1('0x21')](_0x38f53a[_0xcbb1('0x43')][_0xcbb1('0x21')]);_0x4327fb[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x38f53a['query'][_0xcbb1('0x1e')]);}_0x4327fb[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x38f53a[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x4327fb[_0xcbb1('0x3c')]=qs['filters'](_[_0xcbb1('0xc5')](_0x38f53a[_0xcbb1('0x43')],_0x29ccd2[_0xcbb1('0xc2')]));_0x4327fb[_0xcbb1('0x3c')][_0xcbb1('0xd5')]=_0x360449['id'];if(_0x38f53a[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x4327fb[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x4327fb[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x4327fb[_0xcbb1('0x3f')],function(_0x66c630){var _0x29d054={};_0x29d054[_0x66c630]={'$like':'%'+_0x38f53a[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x29d054;})});}_0x4327fb=_[_0xcbb1('0x55')]({},_0x4327fb,_0x38f53a[_0xcbb1('0x56')]);return db[_0xcbb1('0xde')]['count']({'where':_0x4327fb[_0xcbb1('0x3c')]})[_0xcbb1('0x12')](function(_0x500b0f){_0x1c8d6f[_0xcbb1('0x20')]=_0x500b0f;if(_0x38f53a[_0xcbb1('0x43')]['includeAll']){_0x4327fb['include']=[{'all':!![]}];}return db[_0xcbb1('0xde')][_0xcbb1('0x41')](_0x4327fb);})[_0xcbb1('0x12')](function(_0x5b60a2){_0x1c8d6f['rows']=_0x5b60a2;return _0x1c8d6f;});}})['then'](respondWithFilteredResult(_0x5ab60b,_0x4327fb))[_0xcbb1('0x1b')](handleError(_0x5ab60b,null));};exports[_0xcbb1('0xdf')]=function(_0x4d8cb9,_0x3ab4ed){var _0x8b936={};var _0x56d52d={};var _0x26fab6;var _0xec949d;return db[_0xcbb1('0x35')][_0xcbb1('0x91')]({'where':{'id':_0x4d8cb9['params']['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x3ab4ed,null))['then'](function(_0x27a872){if(_0x27a872){_0x26fab6=_0x27a872;_0x56d52d[_0xcbb1('0x4f')]=_[_0xcbb1('0x51')](db['SmsInteraction'][_0xcbb1('0x36')]);_0x56d52d['query']=_[_0xcbb1('0x51')](_0x4d8cb9[_0xcbb1('0x43')]);_0x56d52d[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0x56d52d[_0xcbb1('0x4f')],_0x56d52d['query']);_0x8b936['attributes']=_['intersection'](_0x56d52d[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x4d8cb9[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x8b936['attributes']=_0x8b936[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x8b936[_0xcbb1('0x3f')]:_0x56d52d[_0xcbb1('0x4f')];_0x8b936['order']=qs[_0xcbb1('0xc4')](_0x4d8cb9[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x8b936['where']=qs[_0xcbb1('0xc2')](_['pick'](_0x4d8cb9[_0xcbb1('0x43')],_0x56d52d['filters']));if(_0x4d8cb9[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x8b936[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x8b936[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x8b936[_0xcbb1('0x3f')],function(_0x51aca2){var _0x531789={};_0x531789[_0x51aca2]={'$like':'%'+_0x4d8cb9['query'][_0xcbb1('0x2b')]+'%'};return _0x531789;})});}_0x8b936=_[_0xcbb1('0x55')]({},_0x8b936,_0x4d8cb9[_0xcbb1('0x56')]);return _0x26fab6[_0xcbb1('0xdf')](_0x8b936);}})[_0xcbb1('0x12')](function(_0x52a188){if(_0x52a188){_0xec949d=_0x52a188[_0xcbb1('0x46')];if(!_0x4d8cb9['query'][_0xcbb1('0xc6')](_0xcbb1('0xcd'))){_0x8b936[_0xcbb1('0x21')]=qs['limit'](_0x4d8cb9[_0xcbb1('0x43')]['limit']);_0x8b936[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x4d8cb9['query']['offset']);}return _0x26fab6[_0xcbb1('0xdf')](_0x8b936);}})[_0xcbb1('0x12')](function(_0x46b266){if(_0x46b266){return _0x46b266?{'count':_0xec949d,'rows':_0x46b266}:null;}})[_0xcbb1('0x12')](respondWithResult(_0x3ab4ed,null))[_0xcbb1('0x1b')](handleError(_0x3ab4ed,null));};exports['getFaxInteractions']=function(_0x180acd,_0x403753){var _0x1f2ea2={};var _0x5c676c={};var _0x1fc39d;var _0x261dcf;return db['User'][_0xcbb1('0x91')]({'where':{'id':_0x180acd['params']['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x403753,null))[_0xcbb1('0x12')](function(_0x35dbfb){if(_0x35dbfb){_0x1fc39d=_0x35dbfb;_0x5c676c[_0xcbb1('0x4f')]=_['keys'](db[_0xcbb1('0xe0')][_0xcbb1('0x36')]);_0x5c676c[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x180acd['query']);_0x5c676c[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0x5c676c[_0xcbb1('0x4f')],_0x5c676c['query']);_0x1f2ea2[_0xcbb1('0x3f')]=_['intersection'](_0x5c676c[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x180acd[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x1f2ea2[_0xcbb1('0x3f')]=_0x1f2ea2[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x1f2ea2[_0xcbb1('0x3f')]:_0x5c676c[_0xcbb1('0x4f')];_0x1f2ea2['order']=qs[_0xcbb1('0xc4')](_0x180acd[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x1f2ea2[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x180acd[_0xcbb1('0x43')],_0x5c676c[_0xcbb1('0xc2')]));if(_0x180acd['query'][_0xcbb1('0x2b')]){_0x1f2ea2[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x1f2ea2[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x1f2ea2[_0xcbb1('0x3f')],function(_0x1a9a29){var _0x25e39a={};_0x25e39a[_0x1a9a29]={'$like':'%'+_0x180acd[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x25e39a;})});}_0x1f2ea2=_[_0xcbb1('0x55')]({},_0x1f2ea2,_0x180acd[_0xcbb1('0x56')]);return _0x1fc39d[_0xcbb1('0xe1')](_0x1f2ea2);}})[_0xcbb1('0x12')](function(_0xe99b82){if(_0xe99b82){_0x261dcf=_0xe99b82[_0xcbb1('0x46')];if(!_0x180acd['query'][_0xcbb1('0xc6')](_0xcbb1('0xcd'))){_0x1f2ea2['limit']=qs['limit'](_0x180acd[_0xcbb1('0x43')][_0xcbb1('0x21')]);_0x1f2ea2['offset']=qs[_0xcbb1('0x1e')](_0x180acd[_0xcbb1('0x43')]['offset']);}return _0x1fc39d['getFaxInteractions'](_0x1f2ea2);}})['then'](function(_0x53f695){if(_0x53f695){return _0x53f695?{'count':_0x261dcf,'rows':_0x53f695}:null;}})['then'](respondWithResult(_0x403753,null))[_0xcbb1('0x1b')](handleError(_0x403753,null));};exports[_0xcbb1('0xe2')]=function(_0x158f65,_0x1b5f91){var _0x236869={};var _0x243daa={};var _0x2b4ee6;var _0x5d57a2;return db['User'][_0xcbb1('0x91')]({'where':{'id':_0x158f65[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x1b5f91,null))[_0xcbb1('0x12')](function(_0xb2306c){if(_0xb2306c){_0x2b4ee6=_0xb2306c;_0x243daa['model']=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x243daa['query']=_['keys'](_0x158f65['query']);_0x243daa['filters']=_[_0xcbb1('0x52')](_0x243daa[_0xcbb1('0x4f')],_0x243daa['query']);_0x236869[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x243daa[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x158f65['query']['fields']));_0x236869[_0xcbb1('0x3f')]=_0x236869[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x236869['attributes']:_0x243daa[_0xcbb1('0x4f')];_0x236869[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x158f65[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x236869[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x158f65[_0xcbb1('0x43')],_0x243daa[_0xcbb1('0xc2')]));if(_0x158f65['query'][_0xcbb1('0x2b')]){_0x236869[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x236869[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x236869[_0xcbb1('0x3f')],function(_0x414e28){var _0x57ce8={};_0x57ce8[_0x414e28]={'$like':'%'+_0x158f65[_0xcbb1('0x43')][_0xcbb1('0x2b')]+'%'};return _0x57ce8;})});}_0x236869=_['merge']({},_0x236869,_0x158f65[_0xcbb1('0x56')]);return _0x2b4ee6[_0xcbb1('0xe2')](_0x236869);}})[_0xcbb1('0x12')](function(_0x10d519){if(_0x10d519){_0x5d57a2=_0x10d519[_0xcbb1('0x46')];if(!_0x158f65['query']['hasOwnProperty'](_0xcbb1('0xcd'))){_0x236869[_0xcbb1('0x21')]=qs['limit'](_0x158f65[_0xcbb1('0x43')]['limit']);_0x236869[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x158f65[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}return _0x2b4ee6[_0xcbb1('0xe2')](_0x236869);}})[_0xcbb1('0x12')](function(_0x2c19e7){if(_0x2c19e7){return _0x2c19e7?{'count':_0x5d57a2,'rows':_0x2c19e7}:null;}})[_0xcbb1('0x12')](respondWithResult(_0x1b5f91,null))[_0xcbb1('0x1b')](handleError(_0x1b5f91,null));};exports[_0xcbb1('0xe3')]=function(_0x450f28,_0x4594a5,_0x168243){var _0x2af12a;var _0x19d0a1;var _0x36400d;var _0x2d4e0b=!_[_0xcbb1('0x62')](_0x450f28[_0xcbb1('0x89')]['id'])?_0x450f28[_0xcbb1('0x89')]['id']:!_[_0xcbb1('0x62')](_0x450f28[_0xcbb1('0x28')]['id'])?_0x450f28[_0xcbb1('0x28')]['id']:null;return db['User']['find']({'where':{'id':_0x2d4e0b,'role':{'$or':[_0xcbb1('0x7b'),_0xcbb1('0x28'),_0xcbb1('0x82')]}},'attributes':['id',_0xcbb1('0x33'),_0xcbb1('0xe4'),_0xcbb1('0xe5'),_0xcbb1('0x26'),'internal','loginInPause']})[_0xcbb1('0x12')](function(_0x406614){if(_0x406614){if(_0x406614['role']===_0xcbb1('0x82')){_0x2af12a=_0x406614;if(_0x450f28[_0xcbb1('0x58')][_0xcbb1('0x99')]){_0x36400d=util['format'](_0xcbb1('0xe6'),_0x2af12a[_0x450f28[_0xcbb1('0x58')]['interface']]);}else if(_0x450f28[_0xcbb1('0x58')][_0xcbb1('0xe7')]){_0x36400d=util[_0xcbb1('0xa3')](_0xcbb1('0xa4'),_0x450f28[_0xcbb1('0x58')][_0xcbb1('0xe7')]);}else{_0x36400d=util[_0xcbb1('0xa3')](_0xcbb1('0xa4'),_0x2af12a[_0xcbb1('0x33')]);}socket['to'](util['format']('user:%s',_0x2af12a[_0xcbb1('0x33')]))[_0xcbb1('0xa9')](_0xcbb1('0xe8'),{'user':{'id':_0x2af12a['id'],'name':_0x2af12a['name']},'ip':_0x450f28[_0xcbb1('0xe9')][_0xcbb1('0xea')]||_0x450f28[_0xcbb1('0xeb')]['remoteAddress']||_0x450f28[_0xcbb1('0xec')][_0xcbb1('0xed')]||_0x450f28[_0xcbb1('0xeb')][_0xcbb1('0xec')][_0xcbb1('0xed')]});return db['UserVoiceQueueRt'][_0xcbb1('0x24')]({'where':{'membername':_0x2af12a[_0xcbb1('0x33')]},'individualHooks':!![]});}}else{throw new db[(_0xcbb1('0x8c'))]['ValidationError'](_0xcbb1('0xee'));}})[_0xcbb1('0x12')](function(){if(_0x2af12a){return _0x2af12a[_0xcbb1('0xef')]({'raw':!![]});}})[_0xcbb1('0x12')](function(_0x28f13d){if(_0x2af12a){var _0x4f20b9=[];if(_0x28f13d){_0x19d0a1=_0x28f13d;if(_0x19d0a1[_0xcbb1('0x46')]){for(var _0x5eaab7=0x0;_0x5eaab7<_0x19d0a1[_0xcbb1('0x46')];_0x5eaab7++){_0x4f20b9['push']({'membername':_0x2af12a[_0xcbb1('0x33')],'UserId':_0x2af12a['id'],'queue_name':_0x19d0a1[_0x5eaab7][_0xcbb1('0x33')],'VoiceQueueId':_0x19d0a1[_0x5eaab7]['id'],'interface':_0x36400d,'paused':_0x2af12a[_0xcbb1('0x97')]||![],'penalty':_0x19d0a1[_0x5eaab7][_0xcbb1('0xf0')]||0x0});}return BPromise[_0xcbb1('0x86')](_0x4f20b9,function(_0x455aa0){return db['UserVoiceQueueRt'][_0xcbb1('0xf1')](_0x455aa0);});}}}})[_0xcbb1('0x12')](function(){if(_0x2af12a){return db['MemberReport'][_0xcbb1('0x41')]({'where':{'membername':_0x2af12a[_0xcbb1('0x33')],'exitAt':null}});}})['then'](function(_0x1d50a0){if(_0x2af12a){var _0x14affe=[];_0x1d50a0[_0xcbb1('0xf2')](function(_0x239374){_0x14affe[_0xcbb1('0x40')](_0x239374['update']({'exitAt':moment()[_0xcbb1('0xa3')](_0xcbb1('0xf3'))}));});return BPromise['all'](_0x14affe);}})[_0xcbb1('0x12')](function(){if(_0x2af12a){var _0x15dff8=[];var _0x2e0715=[];var _0x7ada7e=utils[_0xcbb1('0xf4')]();var _0x3be650={'membername':_0x2af12a['name'],'interface':_0x36400d,'enterAt':moment()[_0xcbb1('0xa3')](_0xcbb1('0xf3')),'role':_0x2af12a['role'],'internal':_0x2af12a[_0xcbb1('0x5d')]};_0x7ada7e['forEach'](function(_0xb0e2b1){_0x15dff8[_0xcbb1('0x40')](_[_0xcbb1('0x55')]({'channel':_0xb0e2b1,'type':_0xcbb1('0xf5'),'data1':_0x450f28[_0xcbb1('0x58')][_0xcbb1('0xf6')],'data2':_0x36400d},_0x3be650));if(_0x2af12a[_0xcbb1('0x97')]){_0x2e0715[_0xcbb1('0x40')](_[_0xcbb1('0x55')]({'channel':_0xb0e2b1,'type':_0xcbb1('0xf7'),'data1':'LOGININPAUSE'},_0x3be650));}});return db[_0xcbb1('0xf8')]['bulkCreate'](_0x15dff8[_0xcbb1('0xbf')](_0x2e0715),{'individualHooks':!![]});}})['then'](function(){if(_0x2af12a){return _0x2af12a[_0xcbb1('0x23')]({'online':!![],'lastLoginAt':moment()[_0xcbb1('0xa3')](_0xcbb1('0xf3')),'voicePause':_0x2af12a[_0xcbb1('0x97')]||![],'mailPause':_0x2af12a[_0xcbb1('0x97')]||![],'chatPause':_0x2af12a[_0xcbb1('0x97')]||![],'faxPause':_0x2af12a['loginInPause']||![],'smsPause':_0x2af12a[_0xcbb1('0x97')]||![],'openchannelPause':_0x2af12a[_0xcbb1('0x97')]||![],'whatsappPause':_0x2af12a['loginInPause']||![],'pauseType':_0x2af12a[_0xcbb1('0x97')]?_0xcbb1('0xf9'):null,'interface':_0x36400d,'lastPauseAt':moment()[_0xcbb1('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xcbb1('0x12')](function(_0x576f3d){if(_0x450f28['isMiddleware']){return _0x168243();}else{return BPromise['resolve'](_0x576f3d)[_0xcbb1('0x12')](respondWithResult(_0x4594a5,null));}})[_0xcbb1('0x1b')](handleError(_0x4594a5,null));};exports[_0xcbb1('0xfa')]=function(_0x3f8de3,_0x3fe278){var _0x5cacb;return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0x3f8de3[_0xcbb1('0x89')]['id'],'role':_0xcbb1('0x82')},'attributes':['id',_0xcbb1('0x33'),_0xcbb1('0x26')]})[_0xcbb1('0x12')](handleEntityNotFound(_0x3fe278,null))['then'](function(_0x149760){if(_0x149760){_0x5cacb=_0x149760;return db[_0xcbb1('0xa5')]['destroy']({'where':{'membername':_0x5cacb[_0xcbb1('0x33')]},'individualHooks':!![]});}})[_0xcbb1('0x12')](function(){return db[_0xcbb1('0xf8')][_0xcbb1('0x41')]({'where':{'membername':_0x5cacb['name'],'exitAt':null}});})['then'](function(_0x5b00ab){var _0x4217cd=[];_0x5b00ab[_0xcbb1('0xf2')](function(_0x55df20){_0x4217cd['push'](_0x55df20[_0xcbb1('0x23')]({'exitAt':moment()[_0xcbb1('0xa3')](_0xcbb1('0xf3'))}));});return BPromise[_0xcbb1('0x4d')](_0x4217cd);})['then'](function(){return _0x5cacb[_0xcbb1('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3fe278,null))[_0xcbb1('0x1b')](handleError(_0x3fe278,null));};exports[_0xcbb1('0xfb')]=function(_0x4bb93d,_0x1c612e){var _0x227e64;return db[_0xcbb1('0xa5')]['update']({'paused':0x1},{'where':{'UserId':_0x4bb93d[_0xcbb1('0x89')]['id']},'individualHooks':!![]})[_0xcbb1('0x12')](function(){return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0x4bb93d[_0xcbb1('0x89')]['id'],'role':_0xcbb1('0x82')},'attributes':['id',_0xcbb1('0x33'),_0xcbb1('0x26'),'internal',_0xcbb1('0x99')]});})[_0xcbb1('0x12')](handleEntityNotFound(_0x1c612e,null))[_0xcbb1('0x12')](function(_0x251b79){if(_0x251b79){_0x227e64=_0x251b79;return respondWithRpcPromise('QueuePause',_0xcbb1('0xfb'),{'id':_0x227e64['id'],'name':_0x227e64['name'],'pause':!![]});}})['then'](function(){if(_0x227e64){return db[_0xcbb1('0xf8')][_0xcbb1('0x41')]({'where':{'membername':_0x227e64[_0xcbb1('0x33')],'type':_0xcbb1('0xf7'),'exitAt':null}});}})[_0xcbb1('0x12')](function(_0x52e594){if(_0x52e594[_0xcbb1('0x46')]){var _0x3e7504=moment()[_0xcbb1('0xa3')](_0xcbb1('0xf3'));for(var _0x625a2c=0x0,_0x5093ca=_0x52e594[_0xcbb1('0x46')];_0x625a2c<_0x5093ca;_0x625a2c++){_0x52e594[_0x625a2c][_0xcbb1('0xfc')]({'exitAt':_0x3e7504});}}})[_0xcbb1('0x12')](function(){var _0x20d2c3=[];var _0x28e1af=utils[_0xcbb1('0xf4')]();_0x28e1af[_0xcbb1('0xf2')](function(_0x1ec909){_0x20d2c3[_0xcbb1('0x40')]({'channel':_0x1ec909,'membername':_0x227e64[_0xcbb1('0x33')],'interface':_['isNil'](_0x227e64[_0xcbb1('0x99')])?util['format']('SIP/%s',_0x227e64[_0xcbb1('0x33')]):_0x227e64[_0xcbb1('0x99')],'type':'PAUSE','enterAt':moment()[_0xcbb1('0xa3')](_0xcbb1('0xf3')),'data1':_0x4bb93d['body'][_0xcbb1('0x38')]||_0xcbb1('0xfd'),'role':_0x227e64[_0xcbb1('0x26')],'internal':_0x227e64['internal']});});return db[_0xcbb1('0xf8')][_0xcbb1('0xfe')](_0x20d2c3,{'individualHooks':!![]});})[_0xcbb1('0x12')](function(){return _0x227e64['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4bb93d['body'][_0xcbb1('0x38')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xcbb1('0xa3')](_0xcbb1('0xf3'))});})[_0xcbb1('0x12')](respondWithResult(_0x1c612e,null))['catch'](handleError(_0x1c612e,null));};exports[_0xcbb1('0xff')]=function(_0x33b842,_0x3999e2){var _0x40151a;return db['User'][_0xcbb1('0x2f')]({'where':{'id':_0x33b842[_0xcbb1('0x89')]['id']},'attributes':['id',_0xcbb1('0x33'),_0xcbb1('0x26'),_0xcbb1('0x98'),'mailPause',_0xcbb1('0x100'),_0xcbb1('0x101'),_0xcbb1('0x102'),_0xcbb1('0x103'),_0xcbb1('0x104'),_0xcbb1('0x105'),_0xcbb1('0x106')]})[_0xcbb1('0x12')](handleEntityNotFound(_0x3999e2,null))[_0xcbb1('0x12')](function(_0x470c32){if(_0x470c32){_0x40151a=_0x470c32;if(_0x33b842[_0xcbb1('0x58')]['channel']&&!utils[_0xcbb1('0x9a')](_0x33b842[_0xcbb1('0x58')]['channel'])){throw new db[(_0xcbb1('0x8c'))][(_0xcbb1('0x8d'))]('Unknown\x20channel');}switch(_0x33b842[_0xcbb1('0x58')][_0xcbb1('0x96')]){case'voice':return respondWithRpcPromise(_0xcbb1('0x107'),_0xcbb1('0xff'),{'id':_0x40151a['id'],'name':_0x40151a[_0xcbb1('0x33')],'pause':![]})[_0xcbb1('0x12')](function(){return db[_0xcbb1('0xa5')]['update']({'paused':0x0},{'where':{'UserId':_0x40151a['id']},'individualHooks':!![]});})[_0xcbb1('0x12')](function(){return db['MemberReport'][_0xcbb1('0x2f')]({'where':{'channel':_0x33b842['body']['channel'],'membername':_0x40151a['name'],'type':_0xcbb1('0xf7'),'exitAt':null}});})[_0xcbb1('0x12')](function(_0x1430f2){if(_0x1430f2){return _0x1430f2[_0xcbb1('0x23')]({'exitAt':moment()['format'](_0xcbb1('0xf3')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x40151a[_0xcbb1('0x23')]({'voicePause':![]});});case'mail':case'chat':case'fax':case _0xcbb1('0x48'):case _0xcbb1('0x4c'):case _0xcbb1('0x57'):return db[_0xcbb1('0xf8')]['find']({'where':{'channel':_0x33b842[_0xcbb1('0x58')][_0xcbb1('0x96')],'membername':_0x40151a[_0xcbb1('0x33')],'type':_0xcbb1('0xf7'),'exitAt':null}})['then'](function(_0x13f4e2){if(_0x13f4e2){return _0x13f4e2['update']({'exitAt':moment()['format'](_0xcbb1('0xf3')),'data2':_0xcbb1('0x108')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x3fa38e={};_['set'](_0x3fa38e,util[_0xcbb1('0xa3')](_0xcbb1('0x109'),_0x33b842[_0xcbb1('0x58')][_0xcbb1('0x96')],_0xcbb1('0x10a')),![]);return _0x40151a[_0xcbb1('0x23')](_0x3fa38e);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x40151a['id'],'name':_0x40151a['name'],'pause':![]})[_0xcbb1('0x12')](function(){return db[_0xcbb1('0xa5')][_0xcbb1('0x23')]({'paused':0x0},{'where':{'UserId':_0x40151a['id']}});})['then'](function(){return db[_0xcbb1('0xf8')][_0xcbb1('0x41')]({'where':{'membername':_0x40151a['name'],'type':'PAUSE','exitAt':null}});})[_0xcbb1('0x12')](function(_0x7b1b9){var _0x103b56=[];_0x7b1b9[_0xcbb1('0xf2')](function(_0x33b087){_0x103b56[_0xcbb1('0x40')](_0x33b087[_0xcbb1('0x23')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xcbb1('0x108')}));});return BPromise[_0xcbb1('0x4d')](_0x103b56);})[_0xcbb1('0x12')](function(){return _0x40151a[_0xcbb1('0x23')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xcbb1('0x12')](respondWithResult(_0x3999e2,null))['catch'](handleError(_0x3999e2,null));};exports[_0xcbb1('0x10b')]=function(_0x5c1407,_0x3a4f58){var _0x2ed0d7={};var _0x42172c={};var _0x450aa9;var _0x1a19fd;return db[_0xcbb1('0x35')][_0xcbb1('0x91')]({'where':{'id':_0x5c1407[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x3a4f58,null))[_0xcbb1('0x12')](function(_0x21ece8){if(_0x21ece8){_0x450aa9=_0x21ece8;_0x42172c[_0xcbb1('0x4f')]=_['keys'](db['Team']['rawAttributes']);_0x42172c[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x5c1407['query']);_0x42172c[_0xcbb1('0xc2')]=_['intersection'](_0x42172c[_0xcbb1('0x4f')],_0x42172c['query']);_0x2ed0d7['attributes']=_[_0xcbb1('0x52')](_0x42172c[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x5c1407[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x2ed0d7[_0xcbb1('0x3f')]=_0x2ed0d7['attributes'][_0xcbb1('0x46')]?_0x2ed0d7['attributes']:_0x42172c[_0xcbb1('0x4f')];_0x2ed0d7[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x5c1407[_0xcbb1('0x43')][_0xcbb1('0xc4')]);_0x2ed0d7[_0xcbb1('0x3c')]=qs['filters'](_[_0xcbb1('0xc5')](_0x5c1407[_0xcbb1('0x43')],_0x42172c[_0xcbb1('0xc2')]));if(_0x5c1407[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x2ed0d7[_0xcbb1('0x3c')]=_['merge'](_0x2ed0d7[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x2ed0d7[_0xcbb1('0x3f')],function(_0x5a094e){var _0x1c5192={};_0x1c5192[_0x5a094e]={'$like':'%'+_0x5c1407['query']['filter']+'%'};return _0x1c5192;})});}_0x2ed0d7=_[_0xcbb1('0x55')]({},_0x2ed0d7,_0x5c1407[_0xcbb1('0x56')]);return _0x450aa9[_0xcbb1('0x10b')](_0x2ed0d7);}})[_0xcbb1('0x12')](function(_0x3b21d2){if(_0x3b21d2){_0x1a19fd=_0x3b21d2[_0xcbb1('0x46')];if(!_0x5c1407[_0xcbb1('0x43')]['hasOwnProperty'](_0xcbb1('0xcd'))){_0x2ed0d7[_0xcbb1('0x21')]=qs[_0xcbb1('0x21')](_0x5c1407[_0xcbb1('0x43')]['limit']);_0x2ed0d7[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x5c1407['query']['offset']);}return _0x450aa9[_0xcbb1('0x10b')](_0x2ed0d7);}})[_0xcbb1('0x12')](function(_0x347b39){if(_0x347b39){return _0x347b39?{'count':_0x1a19fd,'rows':_0x347b39}:null;}})[_0xcbb1('0x12')](respondWithResult(_0x3a4f58,null))[_0xcbb1('0x1b')](handleError(_0x3a4f58,null));};exports['addTeams']=function(_0x5c0d8d,_0xf5870){return db[_0xcbb1('0x35')][_0xcbb1('0x2f')]({'where':{'id':_0x5c0d8d[_0xcbb1('0x89')]['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0xf5870,null))[_0xcbb1('0x12')](function(_0x1ea15d){if(_0x1ea15d){var _0x3a3b2e=_0x1ea15d[_0xcbb1('0x25')]({'plain':!![]});return _0x1ea15d['addTeams'](_0x5c0d8d[_0xcbb1('0x58')]['ids'],_[_0xcbb1('0x5c')](_0x5c0d8d['body'],['ids','id'])||{})['then'](function(){for(var _0x524ff6=0x0;_0x524ff6<_0x5c0d8d[_0xcbb1('0x58')][_0xcbb1('0x5b')][_0xcbb1('0x46')];_0x524ff6++){var _0x58cf6e=[];var _0x3204e5={};db['Team']['findOne']({'where':{'id':_0x5c0d8d['body'][_0xcbb1('0x5b')][_0x524ff6]}})[_0xcbb1('0x12')](function(_0x1b9919){_0x3204e5=_0x1b9919[_0xcbb1('0x49')];_0x58cf6e['push'](_0x1b9919['getVoiceQueues']()[_0xcbb1('0x12')](function(_0x220b27){for(var _0x1b9725=0x0;_0x1b9725<_0x220b27[_0xcbb1('0x46')];_0x1b9725++){_0x220b27[_0x1b9725]['setDataValue'](_0xcbb1('0x96'),_0xcbb1('0x10c'));}return _0x220b27;}));_0x58cf6e[_0xcbb1('0x40')](_0x1b9919[_0xcbb1('0x10d')]()['then'](function(_0x2c781f){for(var _0x35f528=0x0;_0x35f528<_0x2c781f[_0xcbb1('0x46')];_0x35f528++){_0x2c781f[_0x35f528][_0xcbb1('0x10e')](_0xcbb1('0x96'),_0xcbb1('0x10f'));}return _0x2c781f;}));_0x58cf6e[_0xcbb1('0x40')](_0x1b9919[_0xcbb1('0x110')]()['then'](function(_0x1ba133){for(var _0x1a7163=0x0;_0x1a7163<_0x1ba133['length'];_0x1a7163++){_0x1ba133[_0x1a7163]['setDataValue'](_0xcbb1('0x96'),_0xcbb1('0x111'));}return _0x1ba133;}));_0x58cf6e[_0xcbb1('0x40')](_0x1b9919[_0xcbb1('0x112')]()[_0xcbb1('0x12')](function(_0x27473d){for(var _0x24e82e=0x0;_0x24e82e<_0x27473d['length'];_0x24e82e++){_0x27473d[_0x24e82e]['setDataValue'](_0xcbb1('0x96'),'Sms');}return _0x27473d;}));_0x58cf6e[_0xcbb1('0x40')](_0x1b9919['getWhatsappQueues']()[_0xcbb1('0x12')](function(_0x53daa4){for(var _0x2e041b=0x0;_0x2e041b<_0x53daa4['length'];_0x2e041b++){_0x53daa4[_0x2e041b][_0xcbb1('0x10e')](_0xcbb1('0x96'),_0xcbb1('0x113'));}return _0x53daa4;}));_0x58cf6e[_0xcbb1('0x40')](_0x1b9919['getFaxQueues']()[_0xcbb1('0x12')](function(_0x4bc169){for(var _0x341d5e=0x0;_0x341d5e<_0x4bc169['length'];_0x341d5e++){_0x4bc169[_0x341d5e]['setDataValue'](_0xcbb1('0x96'),'Fax');}return _0x4bc169;}));_0x58cf6e[_0xcbb1('0x40')](_0x1b9919[_0xcbb1('0x114')]()[_0xcbb1('0x12')](function(_0x2dd642){for(var _0x42365b=0x0;_0x42365b<_0x2dd642[_0xcbb1('0x46')];_0x42365b++){_0x2dd642[_0x42365b][_0xcbb1('0x10e')](_0xcbb1('0x96'),_0xcbb1('0x115'));}return _0x2dd642;}));return BPromise[_0xcbb1('0x4d')](_0x58cf6e);})[_0xcbb1('0x12')](function(_0x2e0dc9){var _0x411280=_[_0xcbb1('0x116')](_0x2e0dc9);_0x58cf6e=[];return db[_0xcbb1('0x64')][_0xcbb1('0x117')](function(_0x2465cd){for(var _0x13ca5=0x0;_0x13ca5<_0x411280[_0xcbb1('0x46')];_0x13ca5++){_0x58cf6e['push'](_0x411280[_0x13ca5][_0xcbb1('0x118')](_0x3a3b2e['id']),{'transaction':_0x2465cd});}return BPromise[_0xcbb1('0x4d')](_0x58cf6e)[_0xcbb1('0x12')](function(){if(_0x3a3b2e['online']){return BPromise['each'](_[_0xcbb1('0x2b')](_0x411280,function(_0x2cc173){return _0x2cc173['getDataValue'](_0xcbb1('0x96'))===_0xcbb1('0x10c');}),function(_0x23cf34){return db[_0xcbb1('0xa5')][_0xcbb1('0xf1')]({'membername':_0x3a3b2e[_0xcbb1('0x33')],'UserId':_0x3a3b2e['id'],'queue_name':_0x23cf34[_0xcbb1('0x33')],'VoiceQueueId':_0x23cf34['id'],'interface':_[_0xcbb1('0x62')](_0x3a3b2e[_0xcbb1('0x99')])?util[_0xcbb1('0xa3')](_0xcbb1('0xa4'),_0x3a3b2e['name']):_0x3a3b2e[_0xcbb1('0x99')],'paused':_0x3a3b2e[_0xcbb1('0x98')]||![],'penalty':_0x3a3b2e['penalty']},{'transaction':_0x2465cd});});}else{return;}})[_0xcbb1('0x12')](function(){for(var _0x562e23=0x0;_0x562e23<_0x411280[_0xcbb1('0x46')];_0x562e23++){var _0x372314=_0x411280[_0x562e23][_0xcbb1('0x119')](_0xcbb1('0x96'));var _0x1be963=_0x372314+_0xcbb1('0xa8');socket['emit'](_0xcbb1('0x28')+_0x372314+'Queue:save',{'UserId':_0x3a3b2e['id'],['queueField']:_0x411280[_0x562e23]['id']});}});});})[_0xcbb1('0x12')](function(){db[_0xcbb1('0x11a')][_0xcbb1('0x91')]({'where':{'teamId':_0x3204e5['id']}})[_0xcbb1('0x12')](function(_0x188d24){if(_0x188d24){db[_0xcbb1('0x11b')][_0xcbb1('0x79')]({'UserId':_0x5c0d8d[_0xcbb1('0x89')]['id'],'VoicePrefixId':_0x188d24[_0xcbb1('0x11c')]});}});});}});}})['then'](respondWithStatusCode(_0xf5870,null))[_0xcbb1('0x1b')](handleError(_0xf5870,null));};exports[_0xcbb1('0x11d')]=function(_0x5f3914,_0x4b5f91){return db[_0xcbb1('0x35')]['findOne']({'where':{'id':_0x5f3914['params']['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x4b5f91,null))[_0xcbb1('0x12')](function(_0x527adc){if(_0x527adc){var _0x2f1d27=_0x527adc[_0xcbb1('0x25')]({'plain':!![]});var _0x47cfd9=_0x5f3914[_0xcbb1('0x43')][_0xcbb1('0x5b')];return _0x527adc[_0xcbb1('0x11d')](_0x47cfd9)['then'](function(){for(var _0xe2f6b1=0x0;_0xe2f6b1<_0x47cfd9[_0xcbb1('0x46')];_0xe2f6b1++){var _0x594b3a=[];var _0x4a9755={};db[_0xcbb1('0x11e')]['findOne']({'where':{'id':_0x47cfd9[_0xe2f6b1]}})[_0xcbb1('0x12')](function(_0x2881bc){_0x4a9755=_0x2881bc['dataValues'];_0x594b3a[_0xcbb1('0x40')](_0x2881bc[_0xcbb1('0xef')]()[_0xcbb1('0x12')](function(_0x1bdf12){for(var _0x60d995=0x0;_0x60d995<_0x1bdf12[_0xcbb1('0x46')];_0x60d995++){_0x1bdf12[_0x60d995][_0xcbb1('0x10e')](_0xcbb1('0x96'),'Voice');}return _0x1bdf12;}));_0x594b3a[_0xcbb1('0x40')](_0x2881bc[_0xcbb1('0x10d')]()[_0xcbb1('0x12')](function(_0x577128){for(var _0x42a34f=0x0;_0x42a34f<_0x577128[_0xcbb1('0x46')];_0x42a34f++){_0x577128[_0x42a34f]['setDataValue'](_0xcbb1('0x96'),_0xcbb1('0x10f'));}return _0x577128;}));_0x594b3a[_0xcbb1('0x40')](_0x2881bc[_0xcbb1('0x110')]()[_0xcbb1('0x12')](function(_0x5c4ff0){for(var _0x1a4376=0x0;_0x1a4376<_0x5c4ff0['length'];_0x1a4376++){_0x5c4ff0[_0x1a4376][_0xcbb1('0x10e')](_0xcbb1('0x96'),'Mail');}return _0x5c4ff0;}));_0x594b3a[_0xcbb1('0x40')](_0x2881bc[_0xcbb1('0x112')]()[_0xcbb1('0x12')](function(_0xef2b1d){for(var _0x46831c=0x0;_0x46831c<_0xef2b1d[_0xcbb1('0x46')];_0x46831c++){_0xef2b1d[_0x46831c][_0xcbb1('0x10e')]('channel','Sms');}return _0xef2b1d;}));_0x594b3a['push'](_0x2881bc[_0xcbb1('0x11f')]()[_0xcbb1('0x12')](function(_0x291a1f){for(var _0x517c23=0x0;_0x517c23<_0x291a1f[_0xcbb1('0x46')];_0x517c23++){_0x291a1f[_0x517c23][_0xcbb1('0x10e')](_0xcbb1('0x96'),_0xcbb1('0x113'));}return _0x291a1f;}));_0x594b3a['push'](_0x2881bc[_0xcbb1('0x120')]()[_0xcbb1('0x12')](function(_0x1d496a){for(var _0x2471a7=0x0;_0x2471a7<_0x1d496a[_0xcbb1('0x46')];_0x2471a7++){_0x1d496a[_0x2471a7][_0xcbb1('0x10e')](_0xcbb1('0x96'),_0xcbb1('0x121'));}return _0x1d496a;}));_0x594b3a[_0xcbb1('0x40')](_0x2881bc[_0xcbb1('0x114')]()[_0xcbb1('0x12')](function(_0x390e1b){for(var _0x55d251=0x0;_0x55d251<_0x390e1b[_0xcbb1('0x46')];_0x55d251++){_0x390e1b[_0x55d251][_0xcbb1('0x10e')](_0xcbb1('0x96'),_0xcbb1('0x115'));}return _0x390e1b;}));return BPromise[_0xcbb1('0x4d')](_0x594b3a);})[_0xcbb1('0x12')](function(_0x39e3a5){var _0x12c6c6=_[_0xcbb1('0x116')](_0x39e3a5);_0x594b3a=[];return db['sequelize'][_0xcbb1('0x117')](function(_0x38fc7b){for(var _0x537134=0x0;_0x537134<_0x12c6c6[_0xcbb1('0x46')];_0x537134++){_0x594b3a[_0xcbb1('0x40')](_0x12c6c6[_0x537134][_0xcbb1('0x122')](_0x2f1d27['id']),{'transaction':_0x38fc7b});}return BPromise[_0xcbb1('0x4d')](_0x594b3a)[_0xcbb1('0x12')](function(){if(_0x2f1d27[_0xcbb1('0xa2')]){return BPromise['each'](_[_0xcbb1('0x2b')](_0x12c6c6,function(_0x322f28){return _0x322f28[_0xcbb1('0x119')](_0xcbb1('0x96'))==='Voice';}),function(_0x5c6edf){return db[_0xcbb1('0xa5')][_0xcbb1('0x24')]({'where':{'VoiceQueueId':_0x5c6edf['id'],'UserId':_0x2f1d27['id']},'transaction':_0x38fc7b});});}else{return;}})['then'](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x4a9755['id']}})['then'](function(_0x351cb9){if(_0x351cb9){return db[_0xcbb1('0x11b')][_0xcbb1('0x24')]({'where':{'UserId':_0x2f1d27['id'],'VoicePrefixId':_0x351cb9[_0xcbb1('0x49')][_0xcbb1('0x11c')]}});}});})[_0xcbb1('0x12')](function(){for(var _0x4e0a18=0x0;_0x4e0a18<_0x12c6c6['length'];_0x4e0a18++){var _0x94b5b2=_0x12c6c6[_0x4e0a18][_0xcbb1('0x119')](_0xcbb1('0x96'));var _0x22d9e9=_0x94b5b2+_0xcbb1('0xa8');socket[_0xcbb1('0xa9')](_0xcbb1('0x28')+_0x94b5b2+'Queue:remove',{'UserId':_0x2f1d27['id'],['queueField']:_0x12c6c6[_0x4e0a18]['id']});}});});});}});}})[_0xcbb1('0x12')](respondWithStatusCode(_0x4b5f91,null))['catch'](handleError(_0x4b5f91,null));};exports['getLists']=function(_0x227e23,_0x4dbb9b){var _0x5090cc={};var _0x1affe9={};var _0x3b29e8;var _0x1b5a39;return db['User'][_0xcbb1('0x91')]({'where':{'id':_0x227e23[_0xcbb1('0x89')]['id']}})['then'](handleEntityNotFound(_0x4dbb9b,null))[_0xcbb1('0x12')](function(_0x1be6a7){if(_0x1be6a7){_0x3b29e8=_0x1be6a7;_0x1affe9['model']=_[_0xcbb1('0x51')](db[_0xcbb1('0xc7')][_0xcbb1('0x36')]);_0x1affe9[_0xcbb1('0x43')]=_['keys'](_0x227e23['query']);_0x1affe9[_0xcbb1('0xc2')]=_['intersection'](_0x1affe9[_0xcbb1('0x4f')],_0x1affe9[_0xcbb1('0x43')]);_0x5090cc[_0xcbb1('0x3f')]=_[_0xcbb1('0x52')](_0x1affe9[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x227e23[_0xcbb1('0x43')][_0xcbb1('0x53')]));_0x5090cc[_0xcbb1('0x3f')]=_0x5090cc[_0xcbb1('0x3f')][_0xcbb1('0x46')]?_0x5090cc[_0xcbb1('0x3f')]:_0x1affe9[_0xcbb1('0x4f')];_0x5090cc['order']=qs[_0xcbb1('0xc4')](_0x227e23['query'][_0xcbb1('0xc4')]);_0x5090cc[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_[_0xcbb1('0xc5')](_0x227e23[_0xcbb1('0x43')],_0x1affe9['filters']));if(_0x227e23[_0xcbb1('0x43')]['filter']){_0x5090cc[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x5090cc[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x5090cc[_0xcbb1('0x3f')],function(_0xc2d1cb){var _0x5b0302={};_0x5b0302[_0xc2d1cb]={'$like':'%'+_0x227e23[_0xcbb1('0x43')]['filter']+'%'};return _0x5b0302;})});}_0x5090cc=_[_0xcbb1('0x55')]({},_0x5090cc,_0x227e23['options']);return _0x3b29e8[_0xcbb1('0x123')](_0x5090cc);}})[_0xcbb1('0x12')](function(_0x1c51c9){if(_0x1c51c9){_0x1b5a39=_0x1c51c9['length'];if(!_0x227e23[_0xcbb1('0x43')]['hasOwnProperty'](_0xcbb1('0xcd'))){_0x5090cc[_0xcbb1('0x21')]=qs[_0xcbb1('0x21')](_0x227e23[_0xcbb1('0x43')]['limit']);_0x5090cc[_0xcbb1('0x1e')]=qs[_0xcbb1('0x1e')](_0x227e23[_0xcbb1('0x43')][_0xcbb1('0x1e')]);}return _0x3b29e8['getLists'](_0x5090cc);}})['then'](function(_0x1f7893){if(_0x1f7893){return _0x1f7893?{'count':_0x1b5a39,'rows':_0x1f7893}:null;}})['then'](respondWithResult(_0x4dbb9b,null))[_0xcbb1('0x1b')](handleError(_0x4dbb9b,null));};exports[_0xcbb1('0x124')]=function(_0x590261,_0x2d1f52){var _0x45b1d8={};var _0xc34b4a={};var _0x1e4c64;return db['User'][_0xcbb1('0x91')]({'where':{'id':_0x590261['params']['id']}})[_0xcbb1('0x12')](handleEntityNotFound(_0x2d1f52,null))[_0xcbb1('0x12')](function(_0x45b0fb){if(_0x45b0fb){_0x1e4c64=_0x45b0fb;_0xc34b4a[_0xcbb1('0x4f')]=_[_0xcbb1('0x51')](db[_0xcbb1('0x35')][_0xcbb1('0x36')]);_0xc34b4a[_0xcbb1('0x43')]=_[_0xcbb1('0x51')](_0x590261[_0xcbb1('0x43')]);_0xc34b4a[_0xcbb1('0xc2')]=_[_0xcbb1('0x52')](_0xc34b4a[_0xcbb1('0x4f')],_0xc34b4a[_0xcbb1('0x43')]);_0x45b1d8['attributes']=_['intersection'](_0xc34b4a[_0xcbb1('0x4f')],qs[_0xcbb1('0x53')](_0x590261['query'][_0xcbb1('0x53')]));_0x45b1d8['attributes']=_0x45b1d8[_0xcbb1('0x3f')]['length']?_0x45b1d8[_0xcbb1('0x3f')]:_0xc34b4a[_0xcbb1('0x4f')];_0x45b1d8[_0xcbb1('0xc3')]=qs[_0xcbb1('0xc4')](_0x590261[_0xcbb1('0x43')]['sort']);_0x45b1d8[_0xcbb1('0x3c')]=qs[_0xcbb1('0xc2')](_['pick'](_0x590261[_0xcbb1('0x43')],_0xc34b4a[_0xcbb1('0xc2')]));if(_0x590261[_0xcbb1('0x43')][_0xcbb1('0x2b')]){_0x45b1d8[_0xcbb1('0x3c')]=_[_0xcbb1('0x55')](_0x45b1d8[_0xcbb1('0x3c')],{'$or':_[_0xcbb1('0xb5')](_0x45b1d8['attributes'],function(_0x4482f6){var _0x580997={};_0x580997[_0x4482f6]={'$like':'%'+_0x590261['query'][_0xcbb1('0x2b')]+'%'};return _0x580997;})});}_0x45b1d8[_0xcbb1('0x4f')]=db[_0xcbb1('0x35')];_0x45b1d8['as']='Agents';_0x45b1d8=_[_0xcbb1('0x55')]({},_0x45b1d8,_0x590261[_0xcbb1('0x56')]);return _0x1e4c64['getVoiceQueues']({'include':[_0x45b1d8]});}})[_0xcbb1('0x12')](function(_0xe9c9){if(_0xe9c9){var _0x11ddfd={},_0x51670a=[];for(var _0x136e89=0x0;_0x136e89<_0xe9c9[_0xcbb1('0x46')];_0x136e89+=0x1){for(var _0x59c9e4=0x0,_0x417bf8;_0x59c9e4<_0xe9c9[_0x136e89][_0xcbb1('0x29')][_0xcbb1('0x46')];_0x59c9e4+=0x1){_0x417bf8=_0xe9c9[_0x136e89][_0xcbb1('0x29')][_0x59c9e4][_0xcbb1('0x25')]({'plain':!![]});_0x11ddfd[_0x417bf8['id']]=_0x417bf8;}}_0x11ddfd=_[_0xcbb1('0x125')](_0x11ddfd);for(var _0x2e9435=qs[_0xcbb1('0x1e')](_0x590261[_0xcbb1('0x43')][_0xcbb1('0x1e')]);_0x2e9435<_0x11ddfd[_0xcbb1('0x46')]&&_0x51670a[_0xcbb1('0x46')]=_0x2f5c26['agents']){throw new Error(_0x0faf('0x51'));}})[_0x0faf('0xe')](function(){if(_0x54244f){return db[_0x0faf('0x3e')][_0x0faf('0x48')]({'where':{'membername':_0x54244f[_0x0faf('0x24')]},'individualHooks':!![]});}})[_0x0faf('0xe')](function(){if(_0x54244f){return _0x54244f[_0x0faf('0x52')]({'raw':!![]});}})['then'](function(_0x48efeb){if(_0x54244f){if(_0x48efeb){var _0x5f3209=[];_0x5cfa50=_0x48efeb;if(_0x5cfa50[_0x0faf('0x2c')]){for(var _0x46a341=0x0;_0x46a341<_0x5cfa50[_0x0faf('0x2c')];_0x46a341++){_0x5f3209[_0x0faf('0x30')](db[_0x0faf('0x3e')][_0x0faf('0x53')]({'membername':_0x54244f[_0x0faf('0x24')],'UserId':_0x54244f['id'],'queue_name':_0x5cfa50[_0x46a341][_0x0faf('0x24')],'VoiceQueueId':_0x5cfa50[_0x46a341]['id'],'interface':_0x5369df,'paused':_0x54244f[_0x0faf('0x4c')]||![],'penalty':_0x5cfa50[_0x46a341]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0faf('0x45')](_0x5f3209);}}}})[_0x0faf('0xe')](function(){if(_0x54244f){return db[_0x0faf('0x28')][_0x0faf('0x44')]({'where':{'membername':_0x54244f[_0x0faf('0x24')],'exitAt':null}});}})[_0x0faf('0xe')](function(_0x5e58eb){if(_0x54244f){if(_0x5e58eb&&_0x5e58eb[_0x0faf('0x2c')]){var _0x5274ee=[];_0x5e58eb[_0x0faf('0x2f')](function(_0xae29ca){_0x5274ee[_0x0faf('0x30')](_0xae29ca[_0x0faf('0x36')]({'exitAt':moment()[_0x0faf('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0faf('0x45')](_0x5274ee);}}})[_0x0faf('0xe')](function(_0x2f1e5e){if(_0x54244f){var _0x56f039=[];var _0x3495e2=[];var _0x318751=utils[_0x0faf('0x2e')]();var _0x531c9c={'membername':_0x54244f['name'],'interface':_0x5369df,'enterAt':moment()[_0x0faf('0x2a')](_0x0faf('0x2b')),'role':_0x54244f['role'],'internal':_0x54244f[_0x0faf('0x26')]};_0x318751[_0x0faf('0x2f')](function(_0x10e62b){_0x56f039[_0x0faf('0x30')](_[_0x0faf('0x54')]({'channel':_0x10e62b,'type':_0x0faf('0x55'),'data1':_0x0faf('0x56'),'data2':_0x5369df},_0x531c9c));if(_0x54244f['loginInPause']){_0x3495e2[_0x0faf('0x30')](_[_0x0faf('0x54')]({'channel':_0x10e62b,'type':_0x0faf('0x29'),'data1':_0x0faf('0x57')},_0x531c9c));}});return db['MemberReport']['bulkCreate'](_0x56f039[_0x0faf('0x58')](_0x3495e2),{'individualHooks':!![]});}})[_0x0faf('0xe')](function(){if(_0x54244f){return _0x54244f[_0x0faf('0x36')]({'online':!![],'lastLoginAt':moment()[_0x0faf('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x54244f[_0x0faf('0x4c')]||![],'mailPause':_0x54244f['loginInPause']||![],'chatPause':_0x54244f[_0x0faf('0x4c')]||![],'faxPause':_0x54244f[_0x0faf('0x4c')]||![],'smsPause':_0x54244f[_0x0faf('0x4c')]||![],'openchannelPause':_0x54244f[_0x0faf('0x4c')]||![],'pauseType':_0x54244f['loginInPause']?_0x0faf('0x57'):null,'lastPauseAt':moment()[_0x0faf('0x2a')](_0x0faf('0x2b')),'interface':_0x5369df});}})[_0x0faf('0xe')](function(_0x507c3c){_0x2e0882(_0x507c3c);})['catch'](function(_0x3ea806){_0xe6ee51(_0x299427[_0x0faf('0x14')](0x1f4,_0x3ea806[_0x0faf('0x16')]));});});}; \ No newline at end of file +var _0x14e2=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./user.socket','request','then','info','User,\x20%s,\x20%s','request\x20sent','error','code','message','options','raw','where','attributes','map','include','model','GetUser','debug','stringify','catch','ShowUser','User','find','PauseUser','name','role','UserVoiceQueueRt','update','MemberReport','findAll','format','length','getChannels','forEach','push','isNil','interface','SIP/%s','PAUSE','type','DEFAULT\x20PAUSE','internal','body','uniqueid','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','mail','fax','sms','openchannel','whatsapp','set','%s%s','Pause','system','all','LogoutUser','LoginUser','findOne','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGININPAUSE','lodash','util','bluebird','randomstring'];(function(_0xd1dc7e,_0x486531){var _0x26a20b=function(_0x8eb487){while(--_0x8eb487){_0xd1dc7e['push'](_0xd1dc7e['shift']());}};_0x26a20b(++_0x486531);}(_0x14e2,0x1b4));var _0x214e=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x14e2[_0x77773a];return _0x1091a2;};'use strict';var _=require(_0x214e('0x0'));var util=require(_0x214e('0x1'));var moment=require('moment');var BPromise=require(_0x214e('0x2'));var rs=require(_0x214e('0x3'));var fs=require('fs');var Redis=require(_0x214e('0x4'));var db=require(_0x214e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x214e('0x6'))(_0x214e('0x7'));var config=require(_0x214e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x214e('0x9')][_0x214e('0xa')]({'port':0x232a});config[_0x214e('0xb')]=_[_0x214e('0xc')](config[_0x214e('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x214e('0xb')]));require(_0x214e('0xd'))['register'](socket);function respondWithRpcPromise(_0x77ad85,_0x4add5b,_0x267e3a){return new BPromise(function(_0x22859d,_0xbc858c){return client[_0x214e('0xe')](_0x77ad85,_0x267e3a)[_0x214e('0xf')](function(_0x507edf){logger[_0x214e('0x10')](_0x214e('0x11'),_0x4add5b,_0x214e('0x12'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x4add5b,_0x214e('0x12'),JSON['stringify'](_0x507edf));if(_0x507edf[_0x214e('0x13')]){if(_0x507edf[_0x214e('0x13')][_0x214e('0x14')]===0x1f4){logger[_0x214e('0x13')](_0x214e('0x11'),_0x4add5b,_0x507edf[_0x214e('0x13')][_0x214e('0x15')]);return _0xbc858c(_0x507edf['error'][_0x214e('0x15')]);}logger[_0x214e('0x13')](_0x214e('0x11'),_0x4add5b,_0x507edf[_0x214e('0x13')]['message']);return _0x22859d(_0x507edf[_0x214e('0x13')][_0x214e('0x15')]);}else{logger['info'](_0x214e('0x11'),_0x4add5b,_0x214e('0x12'));_0x22859d(_0x507edf['result'][_0x214e('0x15')]);}})['catch'](function(_0x204101){logger[_0x214e('0x13')]('User,\x20%s,\x20%s',_0x4add5b,_0x204101);_0xbc858c(_0x204101);});});}exports['GetUser']=function(_0x41d6ef){var _0x1d29fb=this;return new Promise(function(_0x1b0edc,_0x3a829d){return db['User']['findAll']({'raw':_0x41d6ef[_0x214e('0x16')]?_0x41d6ef[_0x214e('0x16')][_0x214e('0x17')]===undefined?!![]:![]:!![],'where':_0x41d6ef['options']?_0x41d6ef['options'][_0x214e('0x18')]||null:null,'attributes':_0x41d6ef[_0x214e('0x16')]?_0x41d6ef[_0x214e('0x16')][_0x214e('0x19')]||null:null,'limit':_0x41d6ef[_0x214e('0x16')]?_0x41d6ef[_0x214e('0x16')]['limit']||null:null,'include':_0x41d6ef['options']?_0x41d6ef[_0x214e('0x16')]['include']?_[_0x214e('0x1a')](_0x41d6ef[_0x214e('0x16')][_0x214e('0x1b')],function(_0x2ed5fc){return{'model':db[_0x2ed5fc[_0x214e('0x1c')]],'as':_0x2ed5fc['as'],'attributes':_0x2ed5fc['attributes'],'include':_0x2ed5fc['include']?_[_0x214e('0x1a')](_0x2ed5fc[_0x214e('0x1b')],function(_0x4a5262){return{'model':db[_0x4a5262[_0x214e('0x1c')]],'as':_0x4a5262['as'],'attributes':_0x4a5262[_0x214e('0x19')],'include':_0x4a5262[_0x214e('0x1b')]?_[_0x214e('0x1a')](_0x4a5262[_0x214e('0x1b')],function(_0x5cb6d3){return{'model':db[_0x5cb6d3[_0x214e('0x1c')]],'as':_0x5cb6d3['as'],'attributes':_0x5cb6d3[_0x214e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x214e('0xf')](function(_0x262cb0){logger[_0x214e('0x10')](_0x214e('0x1d'),_0x41d6ef);logger[_0x214e('0x1e')](_0x214e('0x1d'),_0x41d6ef,JSON[_0x214e('0x1f')](_0x262cb0));_0x1b0edc(_0x262cb0);})[_0x214e('0x20')](function(_0x169570){logger['error'](_0x214e('0x1d'),_0x169570['message'],_0x41d6ef);_0x3a829d(_0x1d29fb[_0x214e('0x13')](0x1f4,_0x169570[_0x214e('0x15')]));});});};exports[_0x214e('0x21')]=function(_0x55a985){var _0xa85b6d=this;return new Promise(function(_0xa10fd2,_0x49e86d){return db[_0x214e('0x22')][_0x214e('0x23')]({'raw':_0x55a985['options']?_0x55a985[_0x214e('0x16')][_0x214e('0x17')]===undefined?!![]:![]:!![],'where':_0x55a985['options']?_0x55a985[_0x214e('0x16')][_0x214e('0x18')]||null:null,'attributes':_0x55a985['options']?_0x55a985[_0x214e('0x16')][_0x214e('0x19')]||null:null,'include':_0x55a985[_0x214e('0x16')]?_0x55a985[_0x214e('0x16')][_0x214e('0x1b')]?_[_0x214e('0x1a')](_0x55a985['options'][_0x214e('0x1b')],function(_0x1ebfb7){return{'model':db[_0x1ebfb7[_0x214e('0x1c')]],'as':_0x1ebfb7['as'],'attributes':_0x1ebfb7[_0x214e('0x19')],'include':_0x1ebfb7['include']?_['map'](_0x1ebfb7['include'],function(_0x447754){return{'model':db[_0x447754[_0x214e('0x1c')]],'as':_0x447754['as'],'attributes':_0x447754['attributes'],'include':_0x447754[_0x214e('0x1b')]?_[_0x214e('0x1a')](_0x447754[_0x214e('0x1b')],function(_0x46559e){return{'model':db[_0x46559e['model']],'as':_0x46559e['as'],'attributes':_0x46559e[_0x214e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x214e('0xf')](function(_0x8a393a){logger[_0x214e('0x10')](_0x214e('0x21'),_0x55a985);logger[_0x214e('0x1e')](_0x214e('0x21'),_0x55a985,JSON[_0x214e('0x1f')](_0x8a393a));_0xa10fd2(_0x8a393a);})[_0x214e('0x20')](function(_0x4b83d3){logger[_0x214e('0x13')](_0x214e('0x21'),_0x4b83d3[_0x214e('0x15')],_0x55a985);_0x49e86d(_0xa85b6d[_0x214e('0x13')](0x1f4,_0x4b83d3['message']));});});};exports[_0x214e('0x24')]=function(_0x3de762){var _0x5c6a2f=this;return new Promise(function(_0x17037e,_0xe1a18a){var _0x3588ca;return db[_0x214e('0x22')]['find']({'where':_0x3de762[_0x214e('0x16')][_0x214e('0x18')]||{},'attributes':['id',_0x214e('0x25'),_0x214e('0x26'),'internal','interface']})[_0x214e('0xf')](function(_0x49ae9e){if(_0x49ae9e){_0x3588ca=_0x49ae9e;return db[_0x214e('0x27')][_0x214e('0x28')]({'paused':0x1},{'where':{'UserId':_0x3588ca['id']},'individualHooks':!![]});}})['then'](function(){if(_0x3588ca){return db[_0x214e('0x29')][_0x214e('0x2a')]({'where':{'membername':_0x3588ca[_0x214e('0x25')],'type':'PAUSE','exitAt':null}});}})[_0x214e('0xf')](function(_0x57d084){if(_0x3588ca){if(_0x57d084&&_0x57d084['length']){var _0x302cfa=moment()[_0x214e('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1d45a0=0x0,_0x100278=_0x57d084[_0x214e('0x2c')];_0x1d45a0<_0x100278;_0x1d45a0++){_0x57d084[_0x1d45a0]['updateAttributes']({'exitAt':_0x302cfa});}}}})[_0x214e('0xf')](function(){if(_0x3588ca){var _0xa9ec2e=[];var _0x1c5ca1=utils[_0x214e('0x2d')]();_0x1c5ca1[_0x214e('0x2e')](function(_0x12af23){_0xa9ec2e[_0x214e('0x2f')]({'channel':_0x12af23,'membername':_0x3588ca['name'],'interface':_[_0x214e('0x30')](_0x3588ca[_0x214e('0x31')])?util['format'](_0x214e('0x32'),_0x3588ca['name']):_0x3588ca['interface'],'type':_0x214e('0x33'),'enterAt':moment()[_0x214e('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3de762['body'][_0x214e('0x34')]||_0x214e('0x35'),'role':_0x3588ca['role'],'internal':_0x3588ca[_0x214e('0x36')],'uniqueid':_0x3de762[_0x214e('0x37')][_0x214e('0x38')]||null});});return db['MemberReport']['bulkCreate'](_0xa9ec2e,{'individualHooks':!![]});}})[_0x214e('0xf')](function(){if(_0x3588ca){return _0x3588ca[_0x214e('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3de762[_0x214e('0x37')][_0x214e('0x34')]||_0x214e('0x35'),'lastPauseAt':moment()[_0x214e('0x2b')](_0x214e('0x39'))});}})[_0x214e('0xf')](function(_0x4c216b){_0x17037e(_0x4c216b);})['catch'](function(_0xd038a4){_0xe1a18a(_0x5c6a2f['error'](0x1f4,_0xd038a4['message']));});});};exports[_0x214e('0x3a')]=function(_0x5888a5){var _0x5da784=this;return new Promise(function(_0x4ba6df,_0x2b87fa){var _0x4ad4e2;return db[_0x214e('0x22')]['findOne']({'where':_0x5888a5[_0x214e('0x16')][_0x214e('0x18')]||{},'attributes':['id',_0x214e('0x25')]})[_0x214e('0xf')](function(_0x13b95c){if(_0x13b95c){_0x4ad4e2=_0x13b95c;if(_0x5888a5[_0x214e('0x37')][_0x214e('0x3b')]&&!utils[_0x214e('0x3c')](_0x5888a5[_0x214e('0x37')]['channel'])){throw new Error(_0x214e('0x3d'));}switch(_0x5888a5[_0x214e('0x37')][_0x214e('0x3b')]){case _0x214e('0x3e'):return db[_0x214e('0x27')][_0x214e('0x28')]({'paused':0x0},{'where':{'UserId':_0x4ad4e2['id']}})['then'](function(){return db['MemberReport'][_0x214e('0x23')]({'where':{'channel':_0x5888a5[_0x214e('0x37')][_0x214e('0x3b')],'membername':_0x4ad4e2[_0x214e('0x25')],'type':_0x214e('0x33'),'exitAt':null}});})['then'](function(_0x362114){if(_0x362114){return _0x362114[_0x214e('0x28')]({'exitAt':moment()['format'](_0x214e('0x39')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x214e('0xf')](function(){return _0x4ad4e2[_0x214e('0x28')]({'voicePause':![]});});case _0x214e('0x3f'):case'chat':case _0x214e('0x40'):case _0x214e('0x41'):case _0x214e('0x42'):case _0x214e('0x43'):return db[_0x214e('0x29')][_0x214e('0x23')]({'where':{'channel':_0x5888a5[_0x214e('0x37')][_0x214e('0x3b')],'membername':_0x4ad4e2['name'],'type':_0x214e('0x33'),'exitAt':null}})['then'](function(_0x1320d5){return _0x1320d5[_0x214e('0x28')]({'exitAt':moment()[_0x214e('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0x214e('0xf')](function(){var _0x1bba4d={};_[_0x214e('0x44')](_0x1bba4d,util[_0x214e('0x2b')](_0x214e('0x45'),_0x5888a5[_0x214e('0x37')][_0x214e('0x3b')],_0x214e('0x46')),![]);return _0x4ad4e2[_0x214e('0x28')](_0x1bba4d);});default:return db[_0x214e('0x27')][_0x214e('0x28')]({'paused':0x0},{'where':{'UserId':_0x4ad4e2['id']}})['then'](function(){return db[_0x214e('0x29')]['findAll']({'where':{'membername':_0x4ad4e2[_0x214e('0x25')],'type':'PAUSE','exitAt':null}});})[_0x214e('0xf')](function(_0x9e915b){var _0xf822d0=[];_0x9e915b[_0x214e('0x2e')](function(_0xe4be83){_0xf822d0[_0x214e('0x2f')](_0xe4be83['update']({'exitAt':moment()[_0x214e('0x2b')](_0x214e('0x39')),'data2':_0x214e('0x47')}));});return BPromise[_0x214e('0x48')](_0xf822d0);})['then'](function(){return _0x4ad4e2[_0x214e('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x214e('0xf')](function(_0x1801a0){_0x4ba6df(_0x1801a0);})['catch'](function(_0x19e6e6){_0x2b87fa(_0x5da784['error'](0x1f4,_0x19e6e6['message']));});});};exports[_0x214e('0x49')]=function(_0x2366be){var _0x280161=this;return new Promise(function(_0x4c8c1f,_0x328a98){var _0x542f72;return db['User']['findOne']({'where':_0x2366be[_0x214e('0x16')][_0x214e('0x18')]||{},'attributes':['id',_0x214e('0x25')]})['then'](function(_0xf4efea){if(_0xf4efea){_0x542f72=_0xf4efea;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x542f72[_0x214e('0x25')]},'individualHooks':!![]});}})[_0x214e('0xf')](function(){if(_0x542f72){return db[_0x214e('0x29')][_0x214e('0x2a')]({'where':{'membername':_0x542f72['name'],'exitAt':null}});}})[_0x214e('0xf')](function(_0x3ebbf7){if(_0x542f72){if(_0x3ebbf7&&_0x3ebbf7['length']){var _0x540214=[];_0x3ebbf7[_0x214e('0x2e')](function(_0x47bfc4){_0x540214[_0x214e('0x2f')](_0x47bfc4[_0x214e('0x28')]({'exitAt':moment()['format'](_0x214e('0x39'))}));});return BPromise[_0x214e('0x48')](_0x540214);}}})['then'](function(){if(_0x542f72){return _0x542f72[_0x214e('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x214e('0xf')](function(_0x1bbb3a){_0x4c8c1f(_0x1bbb3a);})[_0x214e('0x20')](function(_0x38351e){_0x328a98(_0x280161[_0x214e('0x13')](0x1f4,_0x38351e['message']));});});};exports[_0x214e('0x4a')]=function(_0x13f3d7){var _0x456cd5=this;return new Promise(function(_0x1fd8c6,_0x101e70){var _0x2b74c3;var _0xd78c8b;var _0x20962e;var _0x34789a;return db['User'][_0x214e('0x4b')]({'where':_0x13f3d7['options']['where']||{},'attributes':['id',_0x214e('0x25'),'role','mobile','phone',_0x214e('0x36'),_0x214e('0x4c'),'interface']})[_0x214e('0xf')](function(_0x20002a){if(_0x20002a){_0x2b74c3=_0x20002a;_0x34789a=_0x13f3d7[_0x214e('0x37')][_0x214e('0x31')]?_0x13f3d7[_0x214e('0x37')]['interface']:util['format'](_0x214e('0x32'),_0x2b74c3[_0x214e('0x25')]);return db[_0x214e('0x22')][_0x214e('0x4d')]({'where':{'role':_0x214e('0x4e'),'online':!![],'id':{'$ne':_0x2b74c3['id']}}});}})[_0x214e('0xf')](function(_0xc6792c){if(_0xc6792c){_0x20962e=_0xc6792c;return require(_0x214e('0x4f'))[_0x214e('0x50')]();}})[_0x214e('0xf')](function(_0x2df748){if(_0x2df748&&_0x2df748[_0x214e('0x51')]&&_0x20962e>=_0x2df748[_0x214e('0x51')]){throw new Error(_0x214e('0x52'));}})[_0x214e('0xf')](function(){if(_0x2b74c3){return db[_0x214e('0x27')]['destroy']({'where':{'membername':_0x2b74c3[_0x214e('0x25')]},'individualHooks':!![]});}})[_0x214e('0xf')](function(){if(_0x2b74c3){return _0x2b74c3[_0x214e('0x53')]({'raw':!![]});}})[_0x214e('0xf')](function(_0x11549b){if(_0x2b74c3){if(_0x11549b){var _0x15eb65=[];_0xd78c8b=_0x11549b;if(_0xd78c8b[_0x214e('0x2c')]){for(var _0x3b6211=0x0;_0x3b6211<_0xd78c8b[_0x214e('0x2c')];_0x3b6211++){_0x15eb65[_0x214e('0x2f')](db[_0x214e('0x27')][_0x214e('0x54')]({'membername':_0x2b74c3['name'],'UserId':_0x2b74c3['id'],'queue_name':_0xd78c8b[_0x3b6211]['name'],'VoiceQueueId':_0xd78c8b[_0x3b6211]['id'],'interface':_0x34789a,'paused':_0x2b74c3['loginInPause']||![],'penalty':_0xd78c8b[_0x3b6211][_0x214e('0x55')]||0x0}));}return BPromise[_0x214e('0x48')](_0x15eb65);}}}})[_0x214e('0xf')](function(){if(_0x2b74c3){return db[_0x214e('0x29')][_0x214e('0x2a')]({'where':{'membername':_0x2b74c3[_0x214e('0x25')],'exitAt':null}});}})[_0x214e('0xf')](function(_0x38155d){if(_0x2b74c3){if(_0x38155d&&_0x38155d[_0x214e('0x2c')]){var _0x47cf3d=[];_0x38155d[_0x214e('0x2e')](function(_0x1b2ffe){_0x47cf3d[_0x214e('0x2f')](_0x1b2ffe['update']({'exitAt':moment()[_0x214e('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x214e('0x48')](_0x47cf3d);}}})[_0x214e('0xf')](function(_0x4a095d){if(_0x2b74c3){var _0x388f04=[];var _0x4a297f=[];var _0x484e8e=utils[_0x214e('0x2d')]();var _0x2cd7c8={'membername':_0x2b74c3['name'],'interface':_0x34789a,'enterAt':moment()['format'](_0x214e('0x39')),'role':_0x2b74c3[_0x214e('0x26')],'internal':_0x2b74c3[_0x214e('0x36')]};_0x484e8e[_0x214e('0x2e')](function(_0x1e9ce6){_0x388f04[_0x214e('0x2f')](_[_0x214e('0x56')]({'channel':_0x1e9ce6,'type':'LOGIN','data1':'callysquare','data2':_0x34789a},_0x2cd7c8));if(_0x2b74c3[_0x214e('0x4c')]){_0x4a297f['push'](_[_0x214e('0x56')]({'channel':_0x1e9ce6,'type':_0x214e('0x33'),'data1':_0x214e('0x57')},_0x2cd7c8));}});return db['MemberReport']['bulkCreate'](_0x388f04['concat'](_0x4a297f),{'individualHooks':!![]});}})[_0x214e('0xf')](function(){if(_0x2b74c3){return _0x2b74c3[_0x214e('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0x214e('0x39')),'voicePause':_0x2b74c3['loginInPause']||![],'mailPause':_0x2b74c3[_0x214e('0x4c')]||![],'chatPause':_0x2b74c3['loginInPause']||![],'faxPause':_0x2b74c3[_0x214e('0x4c')]||![],'smsPause':_0x2b74c3[_0x214e('0x4c')]||![],'openchannelPause':_0x2b74c3[_0x214e('0x4c')]||![],'pauseType':_0x2b74c3[_0x214e('0x4c')]?_0x214e('0x57'):null,'lastPauseAt':moment()[_0x214e('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x34789a});}})[_0x214e('0xf')](function(_0x4c5cef){_0x1fd8c6(_0x4c5cef);})['catch'](function(_0x186a3f){_0x101e70(_0x456cd5[_0x214e('0x13')](0x1f4,_0x186a3f[_0x214e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 3d9c51e..f0d1133 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 _0x759c=['length','user:','remove','update','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x759c,0xd4));var _0xc759=function(_0x463665,_0xf9a22e){_0x463665=_0x463665-0x0;var _0x2e7d36=_0x759c[_0x463665];return _0x2e7d36;};'use strict';var UserEvents=require('./user.events');var events=['save',_0xc759('0x0'),_0xc759('0x1')];function createListener(_0x14e84b,_0x48ce0d){return function(_0x164de1){_0x48ce0d[_0xc759('0x2')](_0x14e84b,_0x164de1);};}function removeListener(_0x5c8281,_0x188137){return function(){UserEvents['removeListener'](_0x5c8281,_0x188137);};}exports['register']=function(_0x5c2ded){for(var _0x32b2a6=0x0,_0x17f636=events[_0xc759('0x3')];_0x32b2a6<_0x17f636;_0x32b2a6++){var _0x32cab3=events[_0x32b2a6];var _0x46d55b=createListener(_0xc759('0x4')+_0x32cab3,_0x5c2ded);UserEvents['on'](_0x32cab3,_0x46d55b);}}; \ No newline at end of file +var _0x4e4c=['length','user:','save','remove','emit','removeListener','register'];(function(_0xb916e,_0x473ebd){var _0x4c6215=function(_0x3cf02f){while(--_0x3cf02f){_0xb916e['push'](_0xb916e['shift']());}};_0x4c6215(++_0x473ebd);}(_0x4e4c,0xbf));var _0xc4e4=function(_0x178803,_0x466753){_0x178803=_0x178803-0x0;var _0x1c9379=_0x4e4c[_0x178803];return _0x1c9379;};'use strict';var UserEvents=require('./user.events');var events=[_0xc4e4('0x0'),_0xc4e4('0x1'),'update'];function createListener(_0x2b01b1,_0x1f4196){return function(_0x3ab575){_0x1f4196[_0xc4e4('0x2')](_0x2b01b1,_0x3ab575);};}function removeListener(_0x48b69d,_0x10750b){return function(){UserEvents[_0xc4e4('0x3')](_0x48b69d,_0x10750b);};}exports[_0xc4e4('0x4')]=function(_0x190b47){for(var _0x58bd5f=0x0,_0x4e19a3=events[_0xc4e4('0x5')];_0x58bd5f<_0x4e19a3;_0x58bd5f++){var _0x3f740f=events[_0x58bd5f];var _0x1916c=createListener(_0xc4e4('0x6')+_0x3f740f,_0x190b47);UserEvents['on'](_0x3f740f,_0x1916c);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 8e5b5f2..172b240 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x193913,_0x30e32a){var _0x2b15fc=function(_0x57747a){while(--_0x57747a){_0x193913['push'](_0x193913['shift']());}};_0x2b15fc(++_0x30e32a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xcb91[_0x4d2f00];return _0x2d7b7f;};'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(_0x4ea98c,_0xd19e28){var _0x287e82=function(_0x287060){while(--_0x287060){_0x4ea98c['push'](_0x4ea98c['shift']());}};_0x287e82(++_0xd19e28);}(_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 b39176a..0dc1cc9 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 _0x029b=['sequelize','exports'];(function(_0x4bf92e,_0x187809){var _0x4ac1d5=function(_0x34f008){while(--_0x34f008){_0x4bf92e['push'](_0x4bf92e['shift']());}};_0x4ac1d5(++_0x187809);}(_0x029b,0x66));var _0xb029=function(_0xf7aa90,_0x32ea35){_0xf7aa90=_0xf7aa90-0x0;var _0x47b21f=_0x029b[_0xf7aa90];return _0x47b21f;};'use strict';var Sequelize=require(_0xb029('0x0'));module[_0xb029('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd04b=['exports','INTEGER','sequelize'];(function(_0x49b1e5,_0x3b3140){var _0x3dcfe9=function(_0x46dbd6){while(--_0x46dbd6){_0x49b1e5['push'](_0x49b1e5['shift']());}};_0x3dcfe9(++_0x3b3140);}(_0xd04b,0x173));var _0xbd04=function(_0x4c0fd6,_0x2a5e5a){_0x4c0fd6=_0x4c0fd6-0x0;var _0x336cd4=_0xd04b[_0x4c0fd6];return _0x336cd4;};'use strict';var Sequelize=require(_0xbd04('0x0'));module[_0xbd04('0x1')]={'penalty':{'type':Sequelize[_0xbd04('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index bf9ee98..56d4045 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 _0x946c=['user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x4f97c0,_0x46e460){var _0x248a7a=function(_0x4574bb){while(--_0x4574bb){_0x4f97c0['push'](_0x4f97c0['shift']());}};_0x248a7a(++_0x46e460);}(_0x946c,0x1e2));var _0xc946=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x946c[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xc946('0x0'));var util=require(_0xc946('0x1'));var logger=require(_0xc946('0x2'))(_0xc946('0x3'));var moment=require(_0xc946('0x4'));var BPromise=require(_0xc946('0x5'));var rp=require(_0xc946('0x6'));var fs=require('fs');var path=require(_0xc946('0x7'));var rimraf=require('rimraf');var config=require(_0xc946('0x8'));var attributes=require(_0xc946('0x9'));module[_0xc946('0xa')]=function(_0x2596c8,_0x31e4bc){return _0x2596c8['define'](_0xc946('0xb'),attributes,{'tableName':_0xc946('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5af9=['bluebird','rimraf','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues','lodash','util','../../config/logger','moment'];(function(_0x4b2a99,_0x50f753){var _0x1b78f0=function(_0xce13ef){while(--_0xce13ef){_0x4b2a99['push'](_0x4b2a99['shift']());}};_0x1b78f0(++_0x50f753);}(_0x5af9,0x92));var _0x95af=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0x5af9[_0x1c0991];return _0x5034de;};'use strict';var _=require(_0x95af('0x0'));var util=require(_0x95af('0x1'));var logger=require(_0x95af('0x2'))('api');var moment=require(_0x95af('0x3'));var BPromise=require(_0x95af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x95af('0x5'));var config=require(_0x95af('0x6'));var attributes=require(_0x95af('0x7'));module[_0x95af('0x8')]=function(_0x19eed6,_0x52df39){return _0x19eed6['define']('UserChatQueue',attributes,{'tableName':_0x95af('0x9'),'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 7c49e5f..1a583af 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 _0xb51e=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x402380,_0x26afb6){var _0x5700cf=function(_0x3f2e10){while(--_0x3f2e10){_0x402380['push'](_0x402380['shift']());}};_0x5700cf(++_0x26afb6);}(_0xb51e,0xd3));var _0xeb51=function(_0x291655,_0x412309){_0x291655=_0x291655-0x0;var _0x13719e=_0xb51e[_0x291655];return _0x13719e;};'use strict';var _=require(_0xeb51('0x0'));var util=require('util');var moment=require(_0xeb51('0x1'));var BPromise=require(_0xeb51('0x2'));var rs=require(_0xeb51('0x3'));var fs=require('fs');var Redis=require(_0xeb51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb51('0x5'));var logger=require(_0xeb51('0x6'))('rpc');var config=require(_0xeb51('0x7'));var jayson=require(_0xeb51('0x8'));var client=jayson['client'][_0xeb51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5afec7,_0xf43983,_0x44e2e5){return new BPromise(function(_0x5ace08,_0x73ec81){return client['request'](_0x5afec7,_0x44e2e5)['then'](function(_0x13a906){logger[_0xeb51('0xa')](_0xeb51('0xb'),_0xf43983,_0xeb51('0xc'));logger[_0xeb51('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0xf43983,_0xeb51('0xc'),JSON[_0xeb51('0xe')](_0x13a906));if(_0x13a906[_0xeb51('0xf')]){if(_0x13a906[_0xeb51('0xf')][_0xeb51('0x10')]===0x1f4){logger[_0xeb51('0xf')]('UserChatQueue,\x20%s,\x20%s',_0xf43983,_0x13a906[_0xeb51('0xf')][_0xeb51('0x11')]);return _0x73ec81(_0x13a906[_0xeb51('0xf')]['message']);}logger['error'](_0xeb51('0xb'),_0xf43983,_0x13a906[_0xeb51('0xf')]['message']);return _0x5ace08(_0x13a906[_0xeb51('0xf')][_0xeb51('0x11')]);}else{logger[_0xeb51('0xa')](_0xeb51('0xb'),_0xf43983,_0xeb51('0xc'));_0x5ace08(_0x13a906['result']['message']);}})[_0xeb51('0x12')](function(_0x203894){logger['error']('UserChatQueue,\x20%s,\x20%s',_0xf43983,_0x203894);_0x73ec81(_0x203894);});});} \ No newline at end of file +var _0x782f=['message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4dbfe5,_0x4413dc){var _0x162f99=function(_0x436561){while(--_0x436561){_0x4dbfe5['push'](_0x4dbfe5['shift']());}};_0x162f99(++_0x4413dc);}(_0x782f,0x117));var _0xf782=function(_0x500f12,_0x361c77){_0x500f12=_0x500f12-0x0;var _0x5958a9=_0x782f[_0x500f12];return _0x5958a9;};'use strict';var _=require(_0xf782('0x0'));var util=require('util');var moment=require(_0xf782('0x1'));var BPromise=require(_0xf782('0x2'));var rs=require(_0xf782('0x3'));var fs=require('fs');var Redis=require(_0xf782('0x4'));var db=require(_0xf782('0x5'))['db'];var utils=require(_0xf782('0x6'));var logger=require(_0xf782('0x7'))('rpc');var config=require(_0xf782('0x8'));var jayson=require(_0xf782('0x9'));var client=jayson[_0xf782('0xa')][_0xf782('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bff55,_0x1a4f70,_0x4d6984){return new BPromise(function(_0x11c690,_0x53bc20){return client[_0xf782('0xc')](_0x1bff55,_0x4d6984)[_0xf782('0xd')](function(_0x2df37c){logger['info'](_0xf782('0xe'),_0x1a4f70,'request\x20sent');logger[_0xf782('0xf')](_0xf782('0x10'),_0x1a4f70,_0xf782('0x11'),JSON['stringify'](_0x2df37c));if(_0x2df37c[_0xf782('0x12')]){if(_0x2df37c[_0xf782('0x12')][_0xf782('0x13')]===0x1f4){logger['error'](_0xf782('0xe'),_0x1a4f70,_0x2df37c[_0xf782('0x12')]['message']);return _0x53bc20(_0x2df37c[_0xf782('0x12')][_0xf782('0x14')]);}logger['error'](_0xf782('0xe'),_0x1a4f70,_0x2df37c['error'][_0xf782('0x14')]);return _0x11c690(_0x2df37c[_0xf782('0x12')][_0xf782('0x14')]);}else{logger[_0xf782('0x15')](_0xf782('0xe'),_0x1a4f70,_0xf782('0x11'));_0x11c690(_0x2df37c[_0xf782('0x16')]['message']);}})['catch'](function(_0x5db8e2){logger[_0xf782('0x12')](_0xf782('0xe'),_0x1a4f70,_0x5db8e2);_0x53bc20(_0x5db8e2);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2963c7e..1351ab7 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5774f2,_0x4905bb){var _0x483f77=function(_0xc0b9f3){while(--_0xc0b9f3){_0x5774f2['push'](_0x5774f2['shift']());}};_0x483f77(++_0x4905bb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x57e4aa,_0x482b33){var _0x203e32=function(_0xf03c77){while(--_0xf03c77){_0x57e4aa['push'](_0x57e4aa['shift']());}};_0x203e32(++_0x482b33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 1df9fba..7a4ae4a 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 _0x9d9c=['STRING','sequelize','exports','INTEGER'];(function(_0x4da668,_0x1f6dd8){var _0x5f172b=function(_0x18938b){while(--_0x18938b){_0x4da668['push'](_0x4da668['shift']());}};_0x5f172b(++_0x1f6dd8);}(_0x9d9c,0x175));var _0xc9d9=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x9d9c[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0xc9d9('0x0'));module[_0xc9d9('0x1')]={'penalty':{'type':Sequelize[_0xc9d9('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc9d9('0x3')]}}; \ No newline at end of file +var _0x3583=['exports','INTEGER','STRING','sequelize'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0x3583,0xaf));var _0x3358=function(_0x15d62e,_0x5a7537){_0x15d62e=_0x15d62e-0x0;var _0xddb277=_0x3583[_0x15d62e];return _0xddb277;};'use strict';var Sequelize=require(_0x3358('0x0'));module[_0x3358('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3358('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3358('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 4db97a2..3140628 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 _0x35cf=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x35cf,0xc6));var _0xf35c=function(_0x5d8084,_0x1947e9){_0x5d8084=_0x5d8084-0x0;var _0x4c0147=_0x35cf[_0x5d8084];return _0x4c0147;};'use strict';var _=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var logger=require(_0xf35c('0x2'))(_0xf35c('0x3'));var moment=require(_0xf35c('0x4'));var BPromise=require(_0xf35c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf35c('0x6'));var rimraf=require(_0xf35c('0x7'));var config=require(_0xf35c('0x8'));var attributes=require(_0xf35c('0x9'));module[_0xf35c('0xa')]=function(_0x19c01c,_0x2a1da6){return _0x19c01c[_0xf35c('0xb')](_0xf35c('0xc'),attributes,{'tableName':_0xf35c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77bb=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x47642e,_0x8cf71f){var _0x5d9850=function(_0x14e0e8){while(--_0x14e0e8){_0x47642e['push'](_0x47642e['shift']());}};_0x5d9850(++_0x8cf71f);}(_0x77bb,0xad));var _0xb77b=function(_0x1ca9f0,_0xf9b57f){_0x1ca9f0=_0x1ca9f0-0x0;var _0x3bb4c2=_0x77bb[_0x1ca9f0];return _0x3bb4c2;};'use strict';var _=require(_0xb77b('0x0'));var util=require(_0xb77b('0x1'));var logger=require(_0xb77b('0x2'))('api');var moment=require(_0xb77b('0x3'));var BPromise=require(_0xb77b('0x4'));var rp=require(_0xb77b('0x5'));var fs=require('fs');var path=require(_0xb77b('0x6'));var rimraf=require(_0xb77b('0x7'));var config=require(_0xb77b('0x8'));var attributes=require(_0xb77b('0x9'));module[_0xb77b('0xa')]=function(_0x4aafbb,_0xc12c50){return _0x4aafbb[_0xb77b('0xb')](_0xb77b('0xc'),attributes,{'tableName':_0xb77b('0xd'),'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 b67ef62..9cbf668 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 _0x6225=['UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0x6225,0x154));var _0x5622=function(_0x4f750b,_0x4e3e43){_0x4f750b=_0x4f750b-0x0;var _0x918b39=_0x6225[_0x4f750b];return _0x918b39;};'use strict';var _=require(_0x5622('0x0'));var util=require('util');var moment=require(_0x5622('0x1'));var BPromise=require(_0x5622('0x2'));var rs=require(_0x5622('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5622('0x4'))['db'];var utils=require(_0x5622('0x5'));var logger=require(_0x5622('0x6'))(_0x5622('0x7'));var config=require(_0x5622('0x8'));var jayson=require(_0x5622('0x9'));var client=jayson[_0x5622('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e28aa,_0x2d33c4,_0x5dae7d){return new BPromise(function(_0x34a743,_0x17aa97){return client['request'](_0x8e28aa,_0x5dae7d)['then'](function(_0x396e4e){logger[_0x5622('0xb')](_0x5622('0xc'),_0x2d33c4,'request\x20sent');logger[_0x5622('0xd')](_0x5622('0xe'),_0x2d33c4,_0x5622('0xf'),JSON[_0x5622('0x10')](_0x396e4e));if(_0x396e4e[_0x5622('0x11')]){if(_0x396e4e['error'][_0x5622('0x12')]===0x1f4){logger[_0x5622('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x2d33c4,_0x396e4e[_0x5622('0x11')][_0x5622('0x13')]);return _0x17aa97(_0x396e4e[_0x5622('0x11')][_0x5622('0x13')]);}logger[_0x5622('0x11')](_0x5622('0xc'),_0x2d33c4,_0x396e4e[_0x5622('0x11')]['message']);return _0x34a743(_0x396e4e[_0x5622('0x11')][_0x5622('0x13')]);}else{logger[_0x5622('0xb')](_0x5622('0xc'),_0x2d33c4,_0x5622('0xf'));_0x34a743(_0x396e4e[_0x5622('0x14')]['message']);}})[_0x5622('0x15')](function(_0x1dbafd){logger['error'](_0x5622('0xc'),_0x2d33c4,_0x1dbafd);_0x17aa97(_0x1dbafd);});});} \ No newline at end of file +var _0x9aad=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x219db7,_0x23b1da){var _0x393c71=function(_0x50ae02){while(--_0x50ae02){_0x219db7['push'](_0x219db7['shift']());}};_0x393c71(++_0x23b1da);}(_0x9aad,0x155));var _0xd9aa=function(_0x23ec30,_0x564e96){_0x23ec30=_0x23ec30-0x0;var _0x195a05=_0x9aad[_0x23ec30];return _0x195a05;};'use strict';var _=require('lodash');var util=require(_0xd9aa('0x0'));var moment=require(_0xd9aa('0x1'));var BPromise=require(_0xd9aa('0x2'));var rs=require(_0xd9aa('0x3'));var fs=require('fs');var Redis=require(_0xd9aa('0x4'));var db=require(_0xd9aa('0x5'))['db'];var utils=require(_0xd9aa('0x6'));var logger=require(_0xd9aa('0x7'))(_0xd9aa('0x8'));var config=require(_0xd9aa('0x9'));var jayson=require(_0xd9aa('0xa'));var client=jayson['client'][_0xd9aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10f568,_0x1b7d22,_0x16f839){return new BPromise(function(_0x44706a,_0x4d5f3b){return client[_0xd9aa('0xc')](_0x10f568,_0x16f839)[_0xd9aa('0xd')](function(_0x50bb78){logger[_0xd9aa('0xe')](_0xd9aa('0xf'),_0x1b7d22,'request\x20sent');logger[_0xd9aa('0x10')](_0xd9aa('0x11'),_0x1b7d22,_0xd9aa('0x12'),JSON[_0xd9aa('0x13')](_0x50bb78));if(_0x50bb78[_0xd9aa('0x14')]){if(_0x50bb78[_0xd9aa('0x14')][_0xd9aa('0x15')]===0x1f4){logger[_0xd9aa('0x14')](_0xd9aa('0xf'),_0x1b7d22,_0x50bb78[_0xd9aa('0x14')][_0xd9aa('0x16')]);return _0x4d5f3b(_0x50bb78[_0xd9aa('0x14')][_0xd9aa('0x16')]);}logger[_0xd9aa('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x1b7d22,_0x50bb78[_0xd9aa('0x14')][_0xd9aa('0x16')]);return _0x44706a(_0x50bb78[_0xd9aa('0x14')][_0xd9aa('0x16')]);}else{logger[_0xd9aa('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x1b7d22,_0xd9aa('0x12'));_0x44706a(_0x50bb78['result'][_0xd9aa('0x16')]);}})[_0xd9aa('0x17')](function(_0x44bb30){logger[_0xd9aa('0x14')](_0xd9aa('0xf'),_0x1b7d22,_0x44bb30);_0x4d5f3b(_0x44bb30);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7c33422..5adde60 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(_0x537586,_0x28fa71){var _0x5545a8=function(_0x5dc18b){while(--_0x5dc18b){_0x537586['push'](_0x537586['shift']());}};_0x5545a8(++_0x28fa71);}(_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(_0xd4cf1e,_0x1467a6){var _0x1940a9=function(_0x36e6df){while(--_0x36e6df){_0xd4cf1e['push'](_0xd4cf1e['shift']());}};_0x1940a9(++_0x1467a6);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 3405acf..0a00a82 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 _0x9fcf=['sequelize','exports','INTEGER'];(function(_0x2bd2d5,_0x2d68d2){var _0x4edfe=function(_0x42738e){while(--_0x42738e){_0x2bd2d5['push'](_0x2bd2d5['shift']());}};_0x4edfe(++_0x2d68d2);}(_0x9fcf,0x1da));var _0xf9fc=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9fcf[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xf9fc('0x0'));module[_0xf9fc('0x1')]={'penalty':{'type':Sequelize[_0xf9fc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa067=['sequelize','exports'];(function(_0x40d734,_0xe7e9c){var _0x67943a=function(_0x19b02f){while(--_0x19b02f){_0x40d734['push'](_0x40d734['shift']());}};_0x67943a(++_0xe7e9c);}(_0xa067,0x16a));var _0x7a06=function(_0x3a3035,_0x4130f8){_0x3a3035=_0x3a3035-0x0;var _0xea9f09=_0xa067[_0x3a3035];return _0xea9f09;};'use strict';var Sequelize=require(_0x7a06('0x0'));module[_0x7a06('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index bc4253e..a334078 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 _0x1bc6=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','lodash'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0x1bc6,0x133));var _0x61bc=function(_0x2e8fa0,_0x230e09){_0x2e8fa0=_0x2e8fa0-0x0;var _0x4f5705=_0x1bc6[_0x2e8fa0];return _0x4f5705;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var logger=require(_0x61bc('0x2'))(_0x61bc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x61bc('0x4'));var fs=require('fs');var path=require(_0x61bc('0x5'));var rimraf=require(_0x61bc('0x6'));var config=require(_0x61bc('0x7'));var attributes=require(_0x61bc('0x8'));module[_0x61bc('0x9')]=function(_0x267db7,_0x5a1177){return _0x267db7['define'](_0x61bc('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e5e=['../../config/logger','api','moment','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e5e,0xfb));var _0xe3e5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e5e[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xe3e5('0x0'));var util=require('util');var logger=require(_0xe3e5('0x1'))(_0xe3e5('0x2'));var moment=require(_0xe3e5('0x3'));var BPromise=require('bluebird');var rp=require(_0xe3e5('0x4'));var fs=require('fs');var path=require(_0xe3e5('0x5'));var rimraf=require(_0xe3e5('0x6'));var config=require('../../config/environment');var attributes=require(_0xe3e5('0x7'));module[_0xe3e5('0x8')]=function(_0x310077,_0x31ec0e){return _0x310077[_0xe3e5('0x9')](_0xe3e5('0xa'),attributes,{'tableName':_0xe3e5('0xb'),'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 34470f3..6ddf1be 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5c8b85,_0x33ebfb){var _0x22d6e8=function(_0x569a2c){while(--_0x569a2c){_0x5c8b85['push'](_0x5c8b85['shift']());}};_0x22d6e8(++_0x33ebfb);}(_0xe14b,0x93));var _0xbe14=function(_0x301502,_0x13c5d3){_0x301502=_0x301502-0x0;var _0x5218ab=_0xe14b[_0x301502];return _0x5218ab;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x26b58f,_0x285732){var _0x4d9cad=function(_0x49e5d8){while(--_0x49e5d8){_0x26b58f['push'](_0x26b58f['shift']());}};_0x4d9cad(++_0x285732);}(_0x55ca,0x126));var _0xa55c=function(_0x33e93d,_0x1a8423){_0x33e93d=_0x33e93d-0x0;var _0x19e99d=_0x55ca[_0x33e93d];return _0x19e99d;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index e9fb94a..f962a79 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 _0x1ed4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','connect-timeout','express','Router','fs-extra'];(function(_0x4a0918,_0x40cf2e){var _0x648c2e=function(_0x30041){while(--_0x30041){_0x4a0918['push'](_0x4a0918['shift']());}};_0x648c2e(++_0x40cf2e);}(_0x1ed4,0x73));var _0x41ed=function(_0x1068fb,_0x8e54){_0x1068fb=_0x1068fb-0x0;var _0x5d6dca=_0x1ed4[_0x1068fb];return _0x5d6dca;};'use strict';var multer=require(_0x41ed('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x41ed('0x1'));var express=require(_0x41ed('0x2'));var router=express[_0x41ed('0x3')]();var fs_extra=require(_0x41ed('0x4'));var auth=require(_0x41ed('0x5'));var interaction=require(_0x41ed('0x6'));var config=require(_0x41ed('0x7'));var controller=require(_0x41ed('0x8'));router[_0x41ed('0x9')]('/',auth[_0x41ed('0xa')](),controller[_0x41ed('0xb')]);module['exports']=router; \ No newline at end of file +var _0x24ec=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports'];(function(_0x5c0684,_0x3c8da4){var _0x229013=function(_0xc549fe){while(--_0xc549fe){_0x5c0684['push'](_0x5c0684['shift']());}};_0x229013(++_0x3c8da4);}(_0x24ec,0x1c7));var _0xc24e=function(_0x19e087,_0x18c45a){_0x19e087=_0x19e087-0x0;var _0x5b0033=_0x24ec[_0x19e087];return _0x5b0033;};'use strict';var multer=require(_0xc24e('0x0'));var util=require(_0xc24e('0x1'));var path=require('path');var timeout=require(_0xc24e('0x2'));var express=require('express');var router=express[_0xc24e('0x3')]();var fs_extra=require(_0xc24e('0x4'));var auth=require(_0xc24e('0x5'));var interaction=require(_0xc24e('0x6'));var config=require(_0xc24e('0x7'));var controller=require(_0xc24e('0x8'));router[_0xc24e('0x9')]('/',auth[_0xc24e('0xa')](),controller[_0xc24e('0xb')]);module[_0xc24e('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index c84a13a..fecfc26 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 _0x085b=['TEXT','STRING','sequelize','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x085b,0x7a));var _0xb085=function(_0x23c05f,_0x176fd9){_0x23c05f=_0x23c05f-0x0;var _0x159f9c=_0x085b[_0x23c05f];return _0x159f9c;};'use strict';var Sequelize=require(_0xb085('0x0'));module[_0xb085('0x1')]={'body':{'type':Sequelize[_0xb085('0x2')]},'senderName':{'type':Sequelize[_0xb085('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xb085('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x067c=['sequelize','exports','STRING','TEXT','BOOLEAN'];(function(_0x1d4449,_0x495153){var _0x4dcde3=function(_0x36d549){while(--_0x36d549){_0x1d4449['push'](_0x1d4449['shift']());}};_0x4dcde3(++_0x495153);}(_0x067c,0xe1));var _0xc067=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0x067c[_0x2e78e9];return _0x35aad4;};'use strict';var Sequelize=require(_0xc067('0x0'));module[_0xc067('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xc067('0x2')]},'recipientsId':{'type':Sequelize[_0xc067('0x3')]},'recipientsDescription':{'type':Sequelize[_0xc067('0x2')]},'beep':{'type':Sequelize[_0xc067('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 5b79014..14cb888 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 _0x93fc=['UserNotification','create','forEach','emit','userNotification:send','catch','findOne','html','render','User','union','queue','replace','Queue','ids','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','join','sequelize','transaction'];(function(_0x7fc415,_0x219555){var _0x49ba08=function(_0x5bb951){while(--_0x5bb951){_0x7fc415['push'](_0x7fc415['shift']());}};_0x49ba08(++_0x219555);}(_0x93fc,0x136));var _0xc93f=function(_0x1d11ba,_0x343302){_0x1d11ba=_0x1d11ba-0x0;var _0x4e00b9=_0x93fc[_0x1d11ba];return _0x4e00b9;};'use strict';var emlformat=require(_0xc93f('0x0'));var rimraf=require(_0xc93f('0x1'));var zipdir=require(_0xc93f('0x2'));var jsonpatch=require(_0xc93f('0x3'));var rp=require(_0xc93f('0x4'));var moment=require(_0xc93f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc93f('0x6'));var util=require(_0xc93f('0x7'));var path=require(_0xc93f('0x8'));var sox=require(_0xc93f('0x9'));var csv=require(_0xc93f('0xa'));var ejs=require(_0xc93f('0xb'));var fs=require('fs');var fs_extra=require(_0xc93f('0xc'));var _=require(_0xc93f('0xd'));var squel=require('squel');var crypto=require(_0xc93f('0xe'));var jsforce=require(_0xc93f('0xf'));var deskjs=require(_0xc93f('0x10'));var toCsv=require(_0xc93f('0xa'));var querystring=require('querystring');var Papa=require(_0xc93f('0x11'));var Redis=require(_0xc93f('0x12'));var authService=require(_0xc93f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc93f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc93f('0x15'))(_0xc93f('0x16'));var utils=require(_0xc93f('0x17'));var config=require(_0xc93f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc93f('0x19'))['db'];config[_0xc93f('0x1a')]=_[_0xc93f('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc93f('0x1c'))(new Redis(config[_0xc93f('0x1a')]));require(_0xc93f('0x1d'))['register'](socket);function respondWithStatusCode(_0x4b825c,_0xa1ff7e){_0xa1ff7e=_0xa1ff7e||0xcc;return function(_0x436400){if(_0x436400){return _0x4b825c[_0xc93f('0x1e')](_0xa1ff7e);}return _0x4b825c['status'](_0xa1ff7e)[_0xc93f('0x1f')]();};}function respondWithResult(_0x4f6ec5,_0x3fbdd3){_0x3fbdd3=_0x3fbdd3||0xc8;return function(_0x1caa0f){if(_0x1caa0f){return _0x4f6ec5[_0xc93f('0x20')](_0x3fbdd3)[_0xc93f('0x21')](_0x1caa0f);}};}function respondWithFilteredResult(_0x5ae7e4,_0x5aa649){return function(_0x5f01d1){if(_0x5f01d1){var _0x4eeb07=typeof _0x5aa649[_0xc93f('0x22')]===_0xc93f('0x23')&&typeof _0x5aa649[_0xc93f('0x24')]===_0xc93f('0x23');var _0x124af3=_0x5f01d1['count'];var _0x1f99e8=_0x4eeb07?0x0:_0x5aa649['offset'];var _0x34d655=_0x4eeb07?_0x5f01d1[_0xc93f('0x25')]:_0x5aa649[_0xc93f('0x22')]+_0x5aa649[_0xc93f('0x24')];var _0xd8546;if(_0x34d655>=_0x124af3){_0x34d655=_0x124af3;_0xd8546=0xc8;}else{_0xd8546=0xce;}_0x5ae7e4[_0xc93f('0x20')](_0xd8546);return _0x5ae7e4['set'](_0xc93f('0x26'),_0x1f99e8+'-'+_0x34d655+'/'+_0x124af3)['json'](_0x5f01d1);}return null;};}function patchUpdates(_0x3b3e8b){return function(_0x167d35){try{jsonpatch[_0xc93f('0x27')](_0x167d35,_0x3b3e8b,!![]);}catch(_0x2ad225){return BPromise['reject'](_0x2ad225);}return _0x167d35[_0xc93f('0x28')]();};}function saveUpdates(_0x4fe13a,_0x4dae13){return function(_0x26e698){if(_0x26e698){return _0x26e698[_0xc93f('0x29')](_0x4fe13a)[_0xc93f('0x2a')](function(_0x35bf5a){return _0x35bf5a;});}return null;};}function removeEntity(_0x1c3d2a,_0x44e5a4){return function(_0x44cd0a){if(_0x44cd0a){return _0x44cd0a[_0xc93f('0x2b')]()[_0xc93f('0x2a')](function(){_0x1c3d2a[_0xc93f('0x20')](0xcc)[_0xc93f('0x1f')]();});}};}function handleEntityNotFound(_0x1d40ad,_0x210120){return function(_0x49745a){if(!_0x49745a){_0x1d40ad[_0xc93f('0x1e')](0x194);}return _0x49745a;};}function handleError(_0x459a1c,_0x2534c1){_0x2534c1=_0x2534c1||0x1f4;return function(_0x4a207e){logger['error'](_0x4a207e[_0xc93f('0x2c')]);if(_0x4a207e[_0xc93f('0x2d')]){delete _0x4a207e[_0xc93f('0x2d')];}_0x459a1c[_0xc93f('0x20')](_0x2534c1)['send'](_0x4a207e);};}exports[_0xc93f('0x2e')]=function(_0x1cc2f2,_0x53b0ba,_0x5610fd){if(!_0x1cc2f2[_0xc93f('0x2f')][_0xc93f('0x30')](_0xc93f('0x31'))&&!_0x1cc2f2['body'][_0xc93f('0x30')](_0xc93f('0x32'))){throw new db[(_0xc93f('0x33'))]['ValidationError'](_0xc93f('0x34'));}else{if(_0x1cc2f2[_0xc93f('0x2f')]['hasOwnProperty'](_0xc93f('0x32'))&&!_0x1cc2f2[_0xc93f('0x2f')][_0xc93f('0x30')](_0xc93f('0x35'))){throw new db[(_0xc93f('0x33'))]['ValidationError'](_0xc93f('0x36'));}if(!_0x1cc2f2['body'][_0xc93f('0x30')](_0xc93f('0x37'))){throw new db[(_0xc93f('0x33'))][(_0xc93f('0x38'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5362e1=JSON['parse'](_0x1cc2f2[_0xc93f('0x2f')][_0xc93f('0x37')]);}catch(_0x4d9216){logger[_0xc93f('0x39')](_0x4d9216);throw new db[(_0xc93f('0x33'))][(_0xc93f('0x38'))](_0xc93f('0x3a'));}var _0x18b5c6=[_0xc93f('0x3b'),'faxqueue',_0xc93f('0x3c'),'openchannelqueue','smsqueue',_0xc93f('0x3d'),_0xc93f('0x3e'),_0xc93f('0x3f'),_0xc93f('0x40')];if(_['some'](_0x5362e1,function(_0x5ec6ed){return!_[_0xc93f('0x41')](_0x18b5c6,_0x5ec6ed[_0xc93f('0x42')][_0xc93f('0x43')]());})){throw new db[(_0xc93f('0x33'))][(_0xc93f('0x38'))](_0xc93f('0x44'));}}}var _0x6e670f={};_0x6e670f[_0xc93f('0x45')]=_0x1cc2f2[_0xc93f('0x2f')][_0xc93f('0x30')](_0xc93f('0x45'))?_0x1cc2f2['body'][_0xc93f('0x45')]:_0x1cc2f2['user'][_0xc93f('0x46')];_0x6e670f[_0xc93f('0x47')]=_[_0xc93f('0x48')](_0x1cc2f2[_0xc93f('0x2f')]['recipientsDescription'])?null:_0x1cc2f2[_0xc93f('0x2f')][_0xc93f('0x47')];_0x6e670f['beep']=_0x1cc2f2['body'][_0xc93f('0x49')]||![];_0x6e670f[_0xc93f('0x4a')]=_0x1cc2f2[_0xc93f('0x40')]['id'];return getContent(_0x1cc2f2[_0xc93f('0x2f')])['then'](function(_0x38b68f){_0x6e670f[_0xc93f('0x2f')]=_0x38b68f;return getRecipients(_0x5362e1);})[_0xc93f('0x2a')](function(_0x34cfc6){_0x6e670f['recipientsId']=_['sortBy'](_0x34cfc6)[_0xc93f('0x4b')](',');return db[_0xc93f('0x4c')][_0xc93f('0x4d')](function(_0x29ba00){return db[_0xc93f('0x4e')][_0xc93f('0x4f')](_0x6e670f,{'raw':!![],'transaction':_0x29ba00})[_0xc93f('0x2a')](function(_0x207c7f){var _0x4de079={'sender':_0x6e670f[_0xc93f('0x45')],'description':_0x6e670f[_0xc93f('0x47')],'content':_0x6e670f[_0xc93f('0x2f')],'beep':_0x6e670f['beep']};_0x34cfc6[_0xc93f('0x50')](function(_0x2870a7){_0x4de079['recipient']=_0x2870a7;socket[_0xc93f('0x51')](_0xc93f('0x52'),_0x4de079);});return _0x207c7f;});});})[_0xc93f('0x2a')](respondWithResult(_0x53b0ba,0xc9))[_0xc93f('0x53')](handleError(_0x53b0ba,null));};function getContent(_0x4e84a9){return new BPromise(function(_0x32c821,_0x559a50){if(_0x4e84a9[_0xc93f('0x31')]){_0x32c821(_0x4e84a9[_0xc93f('0x31')]);return;}return db['Template'][_0xc93f('0x54')]({'attributes':[_0xc93f('0x55')],'where':{'id':_0x4e84a9[_0xc93f('0x32')]},'raw':!![]})['then'](function(_0x1fbaed){if(!_0x1fbaed)throw new db[(_0xc93f('0x33'))][(_0xc93f('0x38'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0xe5b2fa=Mustache[_0xc93f('0x56')](_0x1fbaed[_0xc93f('0x55')],_0x4e84a9[_0xc93f('0x35')]);_0x32c821(_0xe5b2fa);})[_0xc93f('0x53')](function(_0x239879){_0x559a50(_0x239879);});});}function getRecipients(_0x40c4a8){return new BPromise(function(_0x3c06a3,_0x4d3f70){var _0x18c37f=[];var _0x1a2bab=[];_0x40c4a8[_0xc93f('0x50')](function(_0x5c9658){var _0x297562=_['startCase'](_0x5c9658[_0xc93f('0x42')][_0xc93f('0x43')]());if(_0x297562===_0xc93f('0x57')){_0x18c37f=_[_0xc93f('0x58')](_0x18c37f,_0x5c9658['ids']);}else{if(_['includes'](_0x297562,_0xc93f('0x59')))_0x297562=_0x297562[_0xc93f('0x5a')]('queue',_0xc93f('0x5b'));_0x5c9658[_0xc93f('0x5c')][_0xc93f('0x50')](function(_0x1f0cae){_0x1a2bab['push'](getAgents(_0x297562,_0x1f0cae));});}});return BPromise[_0xc93f('0x5d')](_0x1a2bab)[_0xc93f('0x2a')](function(_0x57aa90){_0x18c37f=_[_0xc93f('0x58')](_0x18c37f,_[_0xc93f('0x5e')](_0x57aa90));_0x3c06a3(_0x18c37f);})[_0xc93f('0x53')](function(_0x43f776){_0x4d3f70(_0x43f776);});});}function getAgents(_0x283fa4,_0x3196e1){return new BPromise(function(_0x4d53cd,_0x1b5d97){return db[_0x283fa4][_0xc93f('0x54')]({'where':{'id':_0x3196e1}})[_0xc93f('0x2a')](function(_0x19eefb){return _0x19eefb[_0xc93f('0x5f')]({'attributes':['id'],'raw':!![]})['then'](function(_0xf25315){var _0x4fe93d=_[_0xc93f('0x60')](_0xf25315,'id');_0x4d53cd(_0x4fe93d);});})[_0xc93f('0x53')](function(_0x4cb6d0){_0x1b5d97(_0x4cb6d0);});});} \ No newline at end of file +var _0x05f1=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','includes','senderName','fullname','isEmpty','beep','sortBy','join','transaction','UserNotification','create','recipientsDescription','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','model','toLowerCase','union','ids','queue','replace','Queue','forEach','push','all','flatten','getAgents','map','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x05f1,0xb6));var _0x105f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x05f1[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x105f('0x0'));var zipdir=require(_0x105f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x105f('0x2'));var moment=require(_0x105f('0x3'));var BPromise=require(_0x105f('0x4'));var Mustache=require(_0x105f('0x5'));var util=require(_0x105f('0x6'));var path=require(_0x105f('0x7'));var sox=require(_0x105f('0x8'));var csv=require(_0x105f('0x9'));var ejs=require(_0x105f('0xa'));var fs=require('fs');var fs_extra=require(_0x105f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x105f('0xc'));var deskjs=require(_0x105f('0xd'));var toCsv=require(_0x105f('0x9'));var querystring=require(_0x105f('0xe'));var Papa=require(_0x105f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x105f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x105f('0x11'));var logger=require(_0x105f('0x12'))(_0x105f('0x13'));var utils=require('../../config/utils');var config=require(_0x105f('0x14'));var licenseUtil=require(_0x105f('0x15'));var db=require('../../mysqldb')['db'];config[_0x105f('0x16')]=_[_0x105f('0x17')](config[_0x105f('0x16')],{'host':_0x105f('0x18'),'port':0x18eb});var socket=require(_0x105f('0x19'))(new Redis(config[_0x105f('0x16')]));require('./userNotification.socket')[_0x105f('0x1a')](socket);function respondWithStatusCode(_0x457dd7,_0xda974){_0xda974=_0xda974||0xcc;return function(_0xcc6baa){if(_0xcc6baa){return _0x457dd7[_0x105f('0x1b')](_0xda974);}return _0x457dd7[_0x105f('0x1c')](_0xda974)[_0x105f('0x1d')]();};}function respondWithResult(_0x4c6e39,_0x2375c1){_0x2375c1=_0x2375c1||0xc8;return function(_0x2ea4ec){if(_0x2ea4ec){return _0x4c6e39[_0x105f('0x1c')](_0x2375c1)[_0x105f('0x1e')](_0x2ea4ec);}};}function respondWithFilteredResult(_0x10c0d1,_0x10d72b){return function(_0x13e9f1){if(_0x13e9f1){var _0x459f3b=typeof _0x10d72b[_0x105f('0x1f')]===_0x105f('0x20')&&typeof _0x10d72b[_0x105f('0x21')]===_0x105f('0x20');var _0x475562=_0x13e9f1[_0x105f('0x22')];var _0x1f20e9=_0x459f3b?0x0:_0x10d72b['offset'];var _0x428e56=_0x459f3b?_0x13e9f1[_0x105f('0x22')]:_0x10d72b[_0x105f('0x1f')]+_0x10d72b[_0x105f('0x21')];var _0x4c8806;if(_0x428e56>=_0x475562){_0x428e56=_0x475562;_0x4c8806=0xc8;}else{_0x4c8806=0xce;}_0x10c0d1[_0x105f('0x1c')](_0x4c8806);return _0x10c0d1[_0x105f('0x23')](_0x105f('0x24'),_0x1f20e9+'-'+_0x428e56+'/'+_0x475562)[_0x105f('0x1e')](_0x13e9f1);}return null;};}function patchUpdates(_0x306a60){return function(_0x3ea508){try{jsonpatch[_0x105f('0x25')](_0x3ea508,_0x306a60,!![]);}catch(_0x16d71a){return BPromise[_0x105f('0x26')](_0x16d71a);}return _0x3ea508[_0x105f('0x27')]();};}function saveUpdates(_0x21f449,_0xb71d39){return function(_0x793611){if(_0x793611){return _0x793611[_0x105f('0x28')](_0x21f449)[_0x105f('0x29')](function(_0x221011){return _0x221011;});}return null;};}function removeEntity(_0x3df383,_0x3e5aaa){return function(_0x33fa19){if(_0x33fa19){return _0x33fa19[_0x105f('0x2a')]()[_0x105f('0x29')](function(){_0x3df383['status'](0xcc)[_0x105f('0x1d')]();});}};}function handleEntityNotFound(_0x4e6f26,_0x29ea09){return function(_0x47854c){if(!_0x47854c){_0x4e6f26['sendStatus'](0x194);}return _0x47854c;};}function handleError(_0x10a69e,_0x3040ad){_0x3040ad=_0x3040ad||0x1f4;return function(_0x483838){logger['error'](_0x483838['stack']);if(_0x483838[_0x105f('0x2b')]){delete _0x483838[_0x105f('0x2b')];}_0x10a69e[_0x105f('0x1c')](_0x3040ad)[_0x105f('0x2c')](_0x483838);};}exports[_0x105f('0x2d')]=function(_0x2652b1,_0x53ad12,_0x5ae0c3){if(!_0x2652b1[_0x105f('0x2e')][_0x105f('0x2f')](_0x105f('0x30'))&&!_0x2652b1[_0x105f('0x2e')][_0x105f('0x2f')]('TemplateId')){throw new db[(_0x105f('0x31'))][(_0x105f('0x32'))](_0x105f('0x33'));}else{if(_0x2652b1['body'][_0x105f('0x2f')](_0x105f('0x34'))&&!_0x2652b1['body'][_0x105f('0x2f')]('view')){throw new db[(_0x105f('0x31'))][(_0x105f('0x32'))](_0x105f('0x35'));}if(!_0x2652b1[_0x105f('0x2e')][_0x105f('0x2f')](_0x105f('0x36'))){throw new db['Sequelize'][(_0x105f('0x32'))](_0x105f('0x37'));}else{try{var _0x42933e=JSON[_0x105f('0x38')](_0x2652b1[_0x105f('0x2e')][_0x105f('0x36')]);}catch(_0x2700b5){logger[_0x105f('0x39')](_0x2700b5);throw new db[(_0x105f('0x31'))][(_0x105f('0x32'))](_0x105f('0x3a'));}var _0x4e4b4f=[_0x105f('0x3b'),'faxqueue',_0x105f('0x3c'),_0x105f('0x3d'),'smsqueue',_0x105f('0x3e'),_0x105f('0x3f'),_0x105f('0x40'),_0x105f('0x41')];if(_[_0x105f('0x42')](_0x42933e,function(_0x5697ef){return!_[_0x105f('0x43')](_0x4e4b4f,_0x5697ef['model']['toLowerCase']());})){throw new db['Sequelize'][(_0x105f('0x32'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x254efa={};_0x254efa[_0x105f('0x44')]=_0x2652b1['body'][_0x105f('0x2f')](_0x105f('0x44'))?_0x2652b1[_0x105f('0x2e')][_0x105f('0x44')]:_0x2652b1[_0x105f('0x41')][_0x105f('0x45')];_0x254efa['recipientsDescription']=_[_0x105f('0x46')](_0x2652b1['body']['recipientsDescription'])?null:_0x2652b1['body']['recipientsDescription'];_0x254efa[_0x105f('0x47')]=_0x2652b1[_0x105f('0x2e')][_0x105f('0x47')]||![];_0x254efa['SenderId']=_0x2652b1['user']['id'];return getContent(_0x2652b1[_0x105f('0x2e')])[_0x105f('0x29')](function(_0x1f4976){_0x254efa[_0x105f('0x2e')]=_0x1f4976;return getRecipients(_0x42933e);})[_0x105f('0x29')](function(_0x36a1a9){_0x254efa['recipientsId']=_[_0x105f('0x48')](_0x36a1a9)[_0x105f('0x49')](',');return db['sequelize'][_0x105f('0x4a')](function(_0xa178ea){return db[_0x105f('0x4b')][_0x105f('0x4c')](_0x254efa,{'raw':!![],'transaction':_0xa178ea})[_0x105f('0x29')](function(_0x4d6b30){var _0xa6f5cc={'sender':_0x254efa[_0x105f('0x44')],'description':_0x254efa[_0x105f('0x4d')],'content':_0x254efa['body'],'beep':_0x254efa['beep']};_0x36a1a9['forEach'](function(_0x2ae3e2){_0xa6f5cc['recipient']=_0x2ae3e2;socket['emit']('userNotification:send',_0xa6f5cc);});return _0x4d6b30;});});})[_0x105f('0x29')](respondWithResult(_0x53ad12,0xc9))[_0x105f('0x4e')](handleError(_0x53ad12,null));};function getContent(_0x23f0b2){return new BPromise(function(_0x4dfd9d,_0x45bdc9){if(_0x23f0b2[_0x105f('0x30')]){_0x4dfd9d(_0x23f0b2[_0x105f('0x30')]);return;}return db[_0x105f('0x4f')][_0x105f('0x50')]({'attributes':['html'],'where':{'id':_0x23f0b2[_0x105f('0x34')]},'raw':!![]})[_0x105f('0x29')](function(_0x4bba44){if(!_0x4bba44)throw new db[(_0x105f('0x31'))][(_0x105f('0x32'))](_0x105f('0x51'));var _0x49dd13=Mustache[_0x105f('0x52')](_0x4bba44[_0x105f('0x53')],_0x23f0b2[_0x105f('0x54')]);_0x4dfd9d(_0x49dd13);})[_0x105f('0x4e')](function(_0x51d3e6){_0x45bdc9(_0x51d3e6);});});}function getRecipients(_0x2200f1){return new BPromise(function(_0x1881e,_0x55aa28){var _0x3e7c86=[];var _0x21daf8=[];_0x2200f1['forEach'](function(_0x3edd39){var _0x11fc4a=_['startCase'](_0x3edd39[_0x105f('0x55')][_0x105f('0x56')]());if(_0x11fc4a==='User'){_0x3e7c86=_[_0x105f('0x57')](_0x3e7c86,_0x3edd39[_0x105f('0x58')]);}else{if(_[_0x105f('0x43')](_0x11fc4a,_0x105f('0x59')))_0x11fc4a=_0x11fc4a[_0x105f('0x5a')]('queue',_0x105f('0x5b'));_0x3edd39[_0x105f('0x58')][_0x105f('0x5c')](function(_0x2693c0){_0x21daf8[_0x105f('0x5d')](getAgents(_0x11fc4a,_0x2693c0));});}});return BPromise[_0x105f('0x5e')](_0x21daf8)[_0x105f('0x29')](function(_0x124296){_0x3e7c86=_['union'](_0x3e7c86,_[_0x105f('0x5f')](_0x124296));_0x1881e(_0x3e7c86);})[_0x105f('0x4e')](function(_0x3ad3b9){_0x55aa28(_0x3ad3b9);});});}function getAgents(_0x5d5076,_0x33ad4b){return new BPromise(function(_0x23cace,_0xa3023f){return db[_0x5d5076][_0x105f('0x50')]({'where':{'id':_0x33ad4b}})[_0x105f('0x29')](function(_0x94f83c){return _0x94f83c[_0x105f('0x60')]({'attributes':['id'],'raw':!![]})[_0x105f('0x29')](function(_0xa6b47a){var _0x39a461=_[_0x105f('0x61')](_0xa6b47a,'id');_0x23cace(_0x39a461);});})[_0x105f('0x4e')](function(_0x2d1431){_0xa3023f(_0x2d1431);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index afcda5c..250b8a3 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 _0xa30d=['exports','events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty'];(function(_0x3412bb,_0x1bfeff){var _0x3f973f=function(_0x2fffe5){while(--_0x2fffe5){_0x3412bb['push'](_0x3412bb['shift']());}};_0x3f973f(++_0x1bfeff);}(_0xa30d,0xac));var _0xda30=function(_0x4fa77f,_0x1ae31){_0x4fa77f=_0x4fa77f-0x0;var _0xa7783f=_0xa30d[_0x4fa77f];return _0xa7783f;};'use strict';var EventEmitter=require(_0xda30('0x0'));var UserNotification=require(_0xda30('0x1'))['db'][_0xda30('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda30('0x3'),'afterUpdate':_0xda30('0x4'),'afterDestroy':_0xda30('0x5')};function emitEvent(_0x4ad2e7){return function(_0xc6421e,_0x456844,_0x7ca4dc){UserNotificationEvents[_0xda30('0x6')](_0x4ad2e7+':'+_0xc6421e['id'],_0xc6421e);UserNotificationEvents['emit'](_0x4ad2e7,_0xc6421e);_0x7ca4dc(null);};}for(var e in events){if(events[_0xda30('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xda30('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xaba0=['setMaxListeners','emit','exports','events','../../mysqldb'];(function(_0x500d85,_0x4a2e53){var _0x573fef=function(_0x1578ec){while(--_0x1578ec){_0x500d85['push'](_0x500d85['shift']());}};_0x573fef(++_0x4a2e53);}(_0xaba0,0x1bb));var _0x0aba=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xaba0[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x0aba('0x0'));var UserNotification=require(_0x0aba('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x0aba('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b0ae0){return function(_0x11493d,_0xf5b1c8,_0x56a7b9){UserNotificationEvents[_0x0aba('0x3')](_0x2b0ae0+':'+_0x11493d['id'],_0x11493d);UserNotificationEvents[_0x0aba('0x3')](_0x2b0ae0,_0x11493d);_0x56a7b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x0aba('0x4')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 9d81670..469008a 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 _0xde6c=['bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x27f051,_0x14f67c){var _0x4ac31d=function(_0x19ff44){while(--_0x19ff44){_0x27f051['push'](_0x27f051['shift']());}};_0x4ac31d(++_0x14f67c);}(_0xde6c,0xa4));var _0xcde6=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0xde6c[_0x141486];return _0x1b5fb9;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var logger=require(_0xcde6('0x2'))(_0xcde6('0x3'));var moment=require('moment');var BPromise=require(_0xcde6('0x4'));var rp=require(_0xcde6('0x5'));var fs=require('fs');var path=require(_0xcde6('0x6'));var rimraf=require(_0xcde6('0x7'));var config=require(_0xcde6('0x8'));var attributes=require(_0xcde6('0x9'));module['exports']=function(_0x27b2be,_0x4359cb){return _0x27b2be[_0xcde6('0xa')]('UserNotification',attributes,{'tableName':_0xcde6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcde6('0xc'),'collate':_0xcde6('0xd')});}; \ No newline at end of file +var _0x399d=['../../config/logger','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x27fe34,_0x15c993){var _0x117fb2=function(_0x5b0aa6){while(--_0x5b0aa6){_0x27fe34['push'](_0x27fe34['shift']());}};_0x117fb2(++_0x15c993);}(_0x399d,0x196));var _0xd399=function(_0x42580f,_0x232218){_0x42580f=_0x42580f-0x0;var _0x51f552=_0x399d[_0x42580f];return _0x51f552;};'use strict';var _=require(_0xd399('0x0'));var util=require('util');var logger=require(_0xd399('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd399('0x2'));var rp=require(_0xd399('0x3'));var fs=require('fs');var path=require(_0xd399('0x4'));var rimraf=require(_0xd399('0x5'));var config=require('../../config/environment');var attributes=require(_0xd399('0x6'));module[_0xd399('0x7')]=function(_0x58689b,_0x5b02b4){return _0x58689b['define']('UserNotification',attributes,{'tableName':_0xd399('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd399('0x9'),'collate':_0xd399('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 160ab10..e7763da 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 _0xa49e=['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','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2bdde9,_0x532ea3){var _0x454ec1=function(_0x7b945){while(--_0x7b945){_0x2bdde9['push'](_0x2bdde9['shift']());}};_0x454ec1(++_0x532ea3);}(_0xa49e,0x10f));var _0xea49=function(_0x5ad820,_0x955136){_0x5ad820=_0x5ad820-0x0;var _0x1969d3=_0xa49e[_0x5ad820];return _0x1969d3;};'use strict';var _=require(_0xea49('0x0'));var util=require('util');var moment=require(_0xea49('0x1'));var BPromise=require(_0xea49('0x2'));var rs=require(_0xea49('0x3'));var fs=require('fs');var Redis=require(_0xea49('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea49('0x5'));var logger=require(_0xea49('0x6'))('rpc');var config=require(_0xea49('0x7'));var jayson=require(_0xea49('0x8'));var client=jayson[_0xea49('0x9')][_0xea49('0xa')]({'port':0x232a});config[_0xea49('0xb')]=_[_0xea49('0xc')](config['redis'],{'host':_0xea49('0xd'),'port':0x18eb});var socket=require(_0xea49('0xe'))(new Redis(config['redis']));require(_0xea49('0xf'))['register'](socket);function respondWithRpcPromise(_0x454a5c,_0x399432,_0x3fe546){return new BPromise(function(_0x202e1a,_0x55df48){return client[_0xea49('0x10')](_0x454a5c,_0x3fe546)[_0xea49('0x11')](function(_0x2ddb35){logger[_0xea49('0x12')](_0xea49('0x13'),_0x399432,_0xea49('0x14'));logger[_0xea49('0x15')](_0xea49('0x16'),_0x399432,_0xea49('0x14'),JSON[_0xea49('0x17')](_0x2ddb35));if(_0x2ddb35[_0xea49('0x18')]){if(_0x2ddb35[_0xea49('0x18')][_0xea49('0x19')]===0x1f4){logger[_0xea49('0x18')]('UserNotification,\x20%s,\x20%s',_0x399432,_0x2ddb35['error'][_0xea49('0x1a')]);return _0x55df48(_0x2ddb35[_0xea49('0x18')][_0xea49('0x1a')]);}logger[_0xea49('0x18')](_0xea49('0x13'),_0x399432,_0x2ddb35[_0xea49('0x18')][_0xea49('0x1a')]);return _0x202e1a(_0x2ddb35[_0xea49('0x18')][_0xea49('0x1a')]);}else{logger[_0xea49('0x12')](_0xea49('0x13'),_0x399432,_0xea49('0x14'));_0x202e1a(_0x2ddb35['result'][_0xea49('0x1a')]);}})[_0xea49('0x1b')](function(_0x591a2a){logger['error'](_0xea49('0x13'),_0x399432,_0x591a2a);_0x55df48(_0x591a2a);});});} \ No newline at end of file +var _0x496c=['defaults','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','UserNotification,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x496c,0x81));var _0xc496=function(_0x248cfd,_0x3e4241){_0x248cfd=_0x248cfd-0x0;var _0x361698=_0x496c[_0x248cfd];return _0x361698;};'use strict';var _=require(_0xc496('0x0'));var util=require(_0xc496('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc496('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc496('0x3'))['db'];var utils=require(_0xc496('0x4'));var logger=require(_0xc496('0x5'))(_0xc496('0x6'));var config=require(_0xc496('0x7'));var jayson=require(_0xc496('0x8'));var client=jayson[_0xc496('0x9')][_0xc496('0xa')]({'port':0x232a});config['redis']=_[_0xc496('0xb')](config[_0xc496('0xc')],{'host':_0xc496('0xd'),'port':0x18eb});var socket=require(_0xc496('0xe'))(new Redis(config['redis']));require(_0xc496('0xf'))['register'](socket);function respondWithRpcPromise(_0x4e8008,_0x58cba9,_0x8b1446){return new BPromise(function(_0x273d58,_0x97bb2f){return client[_0xc496('0x10')](_0x4e8008,_0x8b1446)[_0xc496('0x11')](function(_0x3d229b){logger[_0xc496('0x12')]('UserNotification,\x20%s,\x20%s',_0x58cba9,'request\x20sent');logger[_0xc496('0x13')](_0xc496('0x14'),_0x58cba9,_0xc496('0x15'),JSON[_0xc496('0x16')](_0x3d229b));if(_0x3d229b['error']){if(_0x3d229b['error'][_0xc496('0x17')]===0x1f4){logger[_0xc496('0x18')](_0xc496('0x19'),_0x58cba9,_0x3d229b[_0xc496('0x18')][_0xc496('0x1a')]);return _0x97bb2f(_0x3d229b['error'][_0xc496('0x1a')]);}logger[_0xc496('0x18')](_0xc496('0x19'),_0x58cba9,_0x3d229b[_0xc496('0x18')][_0xc496('0x1a')]);return _0x273d58(_0x3d229b['error'][_0xc496('0x1a')]);}else{logger[_0xc496('0x12')](_0xc496('0x19'),_0x58cba9,'request\x20sent');_0x273d58(_0x3d229b['result'][_0xc496('0x1a')]);}})[_0xc496('0x1b')](function(_0x200524){logger[_0xc496('0x18')]('UserNotification,\x20%s,\x20%s',_0x58cba9,_0x200524);_0x97bb2f(_0x200524);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 85e2bd4..85da5b5 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 _0x8565=['removeListener','register','length','userNotification:','./userNotification.events','emit'];(function(_0x258721,_0x5ef0e8){var _0x85f95c=function(_0x32c4d6){while(--_0x32c4d6){_0x258721['push'](_0x258721['shift']());}};_0x85f95c(++_0x5ef0e8);}(_0x8565,0x1e4));var _0x5856=function(_0x2aca22,_0x3e3460){_0x2aca22=_0x2aca22-0x0;var _0x227ce3=_0x8565[_0x2aca22];return _0x227ce3;};'use strict';var UserNotificationEvents=require(_0x5856('0x0'));var events=['save','remove','update'];function createListener(_0x4f15d9,_0x593769){return function(_0x53bd00){_0x593769[_0x5856('0x1')](_0x4f15d9,_0x53bd00);};}function removeListener(_0x26f1e4,_0x47312b){return function(){UserNotificationEvents[_0x5856('0x2')](_0x26f1e4,_0x47312b);};}exports[_0x5856('0x3')]=function(_0x5c90f4){for(var _0x105358=0x0,_0x502a22=events[_0x5856('0x4')];_0x105358<_0x502a22;_0x105358++){var _0x26e20a=events[_0x105358];var _0x442a22=createListener(_0x5856('0x5')+_0x26e20a,_0x5c90f4);UserNotificationEvents['on'](_0x26e20a,_0x442a22);}}; \ No newline at end of file +var _0xeed4=['emit','length','./userNotification.events','save'];(function(_0x10d40b,_0x3901b7){var _0x468707=function(_0x404689){while(--_0x404689){_0x10d40b['push'](_0x10d40b['shift']());}};_0x468707(++_0x3901b7);}(_0xeed4,0xde));var _0x4eed=function(_0x32e7d6,_0x682bc5){_0x32e7d6=_0x32e7d6-0x0;var _0x5427cf=_0xeed4[_0x32e7d6];return _0x5427cf;};'use strict';var UserNotificationEvents=require(_0x4eed('0x0'));var events=[_0x4eed('0x1'),'remove','update'];function createListener(_0x263cdd,_0x56dbf6){return function(_0x15249a){_0x56dbf6[_0x4eed('0x2')](_0x263cdd,_0x15249a);};}function removeListener(_0x294c23,_0x28260f){return function(){UserNotificationEvents['removeListener'](_0x294c23,_0x28260f);};}exports['register']=function(_0xe40af3){for(var _0x66688c=0x0,_0xd86641=events[_0x4eed('0x3')];_0x66688c<_0xd86641;_0x66688c++){var _0x489b31=events[_0x66688c];var _0x48c715=createListener('userNotification:'+_0x489b31,_0xe40af3);UserNotificationEvents['on'](_0x489b31,_0x48c715);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 96a4176..d28c86b 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4da003,_0x1bc721){var _0x468e30=function(_0x53c3c2){while(--_0x53c3c2){_0x4da003['push'](_0x4da003['shift']());}};_0x468e30(++_0x1bc721);}(_0x70e0,0x17b));var _0x070e=function(_0x5338b1,_0x1e1e5e){_0x5338b1=_0x5338b1-0x0;var _0x2800ca=_0x70e0[_0x5338b1];return _0x2800ca;};'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(_0xeafedc,_0x34fcf0){var _0x1a56da=function(_0x18e945){while(--_0x18e945){_0xeafedc['push'](_0xeafedc['shift']());}};_0x1a56da(++_0x34fcf0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f883921..bf7e526 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 _0x2955=['exports','INTEGER'];(function(_0x2ce9db,_0x27f036){var _0x280272=function(_0x3aa388){while(--_0x3aa388){_0x2ce9db['push'](_0x2ce9db['shift']());}};_0x280272(++_0x27f036);}(_0x2955,0xc6));var _0x5295=function(_0x3ae608,_0xebce6e){_0x3ae608=_0x3ae608-0x0;var _0x2d765c=_0x2955[_0x3ae608];return _0x2d765c;};'use strict';var Sequelize=require('sequelize');module[_0x5295('0x0')]={'penalty':{'type':Sequelize[_0x5295('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc358=['sequelize','exports','INTEGER'];(function(_0x2af845,_0x4344cb){var _0x2e9563=function(_0x36a0b3){while(--_0x36a0b3){_0x2af845['push'](_0x2af845['shift']());}};_0x2e9563(++_0x4344cb);}(_0xc358,0x108));var _0x8c35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc358[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8c35('0x0'));module[_0x8c35('0x1')]={'penalty':{'type':Sequelize[_0x8c35('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index e8811db..7aae6ea 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 _0x3cfa=['bluebird','path','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x3cfa,0x173));var _0xa3cf=function(_0x16a47c,_0x4e8c1c){_0x16a47c=_0x16a47c-0x0;var _0x21f8a3=_0x3cfa[_0x16a47c];return _0x21f8a3;};'use strict';var _=require(_0xa3cf('0x0'));var util=require('util');var logger=require(_0xa3cf('0x1'))(_0xa3cf('0x2'));var moment=require('moment');var BPromise=require(_0xa3cf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3cf('0x4'));var rimraf=require('rimraf');var config=require(_0xa3cf('0x5'));var attributes=require(_0xa3cf('0x6'));module[_0xa3cf('0x7')]=function(_0x500b93,_0x102fe1){return _0x500b93[_0xa3cf('0x8')](_0xa3cf('0x9'),attributes,{'tableName':_0xa3cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9cf=['api','bluebird','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xe9cf,0xd0));var _0xfe9c=function(_0x1a379a,_0x2868e0){_0x1a379a=_0x1a379a-0x0;var _0x528c58=_0xe9cf[_0x1a379a];return _0x528c58;};'use strict';var _=require(_0xfe9c('0x0'));var util=require(_0xfe9c('0x1'));var logger=require('../../config/logger')(_0xfe9c('0x2'));var moment=require('moment');var BPromise=require(_0xfe9c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe9c('0x4'));var config=require(_0xfe9c('0x5'));var attributes=require(_0xfe9c('0x6'));module[_0xfe9c('0x7')]=function(_0x367cd6,_0x31b07e){return _0x367cd6[_0xfe9c('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0xfe9c('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 12f62a7..4653f2b 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 _0xbbeb=['request\x20sent','stringify','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xbbeb,0x1eb));var _0xbbbe=function(_0x55b3b5,_0x254983){_0x55b3b5=_0x55b3b5-0x0;var _0x5297a9=_0xbbeb[_0x55b3b5];return _0x5297a9;};'use strict';var _=require(_0xbbbe('0x0'));var util=require('util');var moment=require(_0xbbbe('0x1'));var BPromise=require(_0xbbbe('0x2'));var rs=require(_0xbbbe('0x3'));var fs=require('fs');var Redis=require(_0xbbbe('0x4'));var db=require(_0xbbbe('0x5'))['db'];var utils=require(_0xbbbe('0x6'));var logger=require(_0xbbbe('0x7'))('rpc');var config=require(_0xbbbe('0x8'));var jayson=require(_0xbbbe('0x9'));var client=jayson[_0xbbbe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c656,_0x5437f1,_0x396cb5){return new BPromise(function(_0x97c514,_0x4cc89f){return client[_0xbbbe('0xb')](_0x30c656,_0x396cb5)[_0xbbbe('0xc')](function(_0x31516d){logger[_0xbbbe('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5437f1,'request\x20sent');logger[_0xbbbe('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5437f1,_0xbbbe('0xf'),JSON[_0xbbbe('0x10')](_0x31516d));if(_0x31516d['error']){if(_0x31516d[_0xbbbe('0x11')][_0xbbbe('0x12')]===0x1f4){logger[_0xbbbe('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5437f1,_0x31516d[_0xbbbe('0x11')][_0xbbbe('0x13')]);return _0x4cc89f(_0x31516d[_0xbbbe('0x11')]['message']);}logger[_0xbbbe('0x11')](_0xbbbe('0x14'),_0x5437f1,_0x31516d[_0xbbbe('0x11')]['message']);return _0x97c514(_0x31516d[_0xbbbe('0x11')][_0xbbbe('0x13')]);}else{logger[_0xbbbe('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5437f1,_0xbbbe('0xf'));_0x97c514(_0x31516d[_0xbbbe('0x15')][_0xbbbe('0x13')]);}})['catch'](function(_0x21b5f9){logger[_0xbbbe('0x11')](_0xbbbe('0x14'),_0x5437f1,_0x21b5f9);_0x4cc89f(_0x21b5f9);});});} \ No newline at end of file +var _0x56f4=['bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x56f4,0x18d));var _0x456f=function(_0x5a125c,_0x155fa2){_0x5a125c=_0x5a125c-0x0;var _0x4c70af=_0x56f4[_0x5a125c];return _0x4c70af;};'use strict';var _=require(_0x456f('0x0'));var util=require(_0x456f('0x1'));var moment=require(_0x456f('0x2'));var BPromise=require(_0x456f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x456f('0x4'))['db'];var utils=require(_0x456f('0x5'));var logger=require('../../config/logger')(_0x456f('0x6'));var config=require('../../config/environment');var jayson=require(_0x456f('0x7'));var client=jayson['client'][_0x456f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bf1,_0x425e1d,_0x56849c){return new BPromise(function(_0x33534d,_0x789e2b){return client[_0x456f('0x9')](_0x2d1bf1,_0x56849c)[_0x456f('0xa')](function(_0x3fa5c0){logger['info'](_0x456f('0xb'),_0x425e1d,_0x456f('0xc'));logger['debug'](_0x456f('0xd'),_0x425e1d,_0x456f('0xc'),JSON[_0x456f('0xe')](_0x3fa5c0));if(_0x3fa5c0[_0x456f('0xf')]){if(_0x3fa5c0[_0x456f('0xf')][_0x456f('0x10')]===0x1f4){logger[_0x456f('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x425e1d,_0x3fa5c0['error'][_0x456f('0x11')]);return _0x789e2b(_0x3fa5c0[_0x456f('0xf')]['message']);}logger[_0x456f('0xf')](_0x456f('0xb'),_0x425e1d,_0x3fa5c0[_0x456f('0xf')][_0x456f('0x11')]);return _0x33534d(_0x3fa5c0[_0x456f('0xf')][_0x456f('0x11')]);}else{logger[_0x456f('0x12')](_0x456f('0xb'),_0x425e1d,_0x456f('0xc'));_0x33534d(_0x3fa5c0[_0x456f('0x13')][_0x456f('0x11')]);}})['catch'](function(_0x31f22c){logger[_0x456f('0xf')](_0x456f('0xb'),_0x425e1d,_0x31f22c);_0x789e2b(_0x31f22c);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 9345683..79eab62 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 _0x8d56=['/describe','describe','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addResources','put','update','destroy','delete','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index'];(function(_0xc12dac,_0x126684){var _0x4448f1=function(_0x233e7a){while(--_0x233e7a){_0xc12dac['push'](_0xc12dac['shift']());}};_0x4448f1(++_0x126684);}(_0x8d56,0x1c3));var _0x68d5=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x8d56[_0x403cff];return _0x5a7c56;};'use strict';var multer=require(_0x68d5('0x0'));var util=require(_0x68d5('0x1'));var path=require(_0x68d5('0x2'));var timeout=require(_0x68d5('0x3'));var express=require(_0x68d5('0x4'));var router=express[_0x68d5('0x5')]();var fs_extra=require(_0x68d5('0x6'));var auth=require(_0x68d5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x68d5('0x8'));var controller=require(_0x68d5('0x9'));router[_0x68d5('0xa')]('/',auth[_0x68d5('0xb')](),controller[_0x68d5('0xc')]);router['get'](_0x68d5('0xd'),auth[_0x68d5('0xb')](),controller[_0x68d5('0xe')]);router[_0x68d5('0xa')]('/:id',auth[_0x68d5('0xb')](),controller['show']);router[_0x68d5('0xa')](_0x68d5('0xf'),auth[_0x68d5('0xb')](),controller[_0x68d5('0x10')]);router['get'](_0x68d5('0x11'),auth[_0x68d5('0xb')](),controller['getResources']);router[_0x68d5('0x12')]('/',auth['isAuthenticated'](),controller[_0x68d5('0x13')]);router[_0x68d5('0x12')](_0x68d5('0x14'),auth[_0x68d5('0xb')](),controller[_0x68d5('0x15')]);router[_0x68d5('0x12')]('/:id/sections',auth[_0x68d5('0xb')](),controller['addSections']);router[_0x68d5('0x12')](_0x68d5('0x11'),auth[_0x68d5('0xb')](),controller[_0x68d5('0x16')]);router[_0x68d5('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x68d5('0x18')]);router['delete']('/:id',auth[_0x68d5('0xb')](),controller[_0x68d5('0x19')]);router[_0x68d5('0x1a')](_0x68d5('0xf'),auth[_0x68d5('0xb')](),controller[_0x68d5('0x1b')]);router['delete']('/:id/resources',auth[_0x68d5('0xb')](),controller[_0x68d5('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xcc5d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','/describe','isAuthenticated','/:id','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','exports','multer','util','path','connect-timeout','express'];(function(_0x108978,_0x5d008){var _0x124a15=function(_0x17074b){while(--_0x17074b){_0x108978['push'](_0x108978['shift']());}};_0x124a15(++_0x5d008);}(_0xcc5d,0x181));var _0xdcc5=function(_0x29fa92,_0x1841be){_0x29fa92=_0x29fa92-0x0;var _0x2d4fb2=_0xcc5d[_0x29fa92];return _0x2d4fb2;};'use strict';var multer=require(_0xdcc5('0x0'));var util=require(_0xdcc5('0x1'));var path=require(_0xdcc5('0x2'));var timeout=require(_0xdcc5('0x3'));var express=require(_0xdcc5('0x4'));var router=express[_0xdcc5('0x5')]();var fs_extra=require(_0xdcc5('0x6'));var auth=require(_0xdcc5('0x7'));var interaction=require(_0xdcc5('0x8'));var config=require(_0xdcc5('0x9'));var controller=require(_0xdcc5('0xa'));router[_0xdcc5('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdcc5('0xb')](_0xdcc5('0xc'),auth[_0xdcc5('0xd')](),controller['describe']);router[_0xdcc5('0xb')](_0xdcc5('0xe'),auth[_0xdcc5('0xd')](),controller['show']);router[_0xdcc5('0xb')](_0xdcc5('0xf'),auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x10')]);router[_0xdcc5('0xb')](_0xdcc5('0x11'),auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x12')]);router[_0xdcc5('0x13')]('/',auth[_0xdcc5('0xd')](),controller['create']);router[_0xdcc5('0x13')](_0xdcc5('0x14'),auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x15')]);router['post'](_0xdcc5('0xf'),auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x16')]);router[_0xdcc5('0x13')](_0xdcc5('0x11'),auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x17')]);router[_0xdcc5('0x18')]('/:id',auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x19')]);router[_0xdcc5('0x1a')](_0xdcc5('0xe'),auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x1b')]);router[_0xdcc5('0x1a')](_0xdcc5('0xf'),auth[_0xdcc5('0xd')](),controller[_0xdcc5('0x1c')]);router[_0xdcc5('0x1a')](_0xdcc5('0x11'),auth[_0xdcc5('0xd')](),controller['removeResources']);module[_0xdcc5('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 1763ab1..d75d23e 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 _0x49cd=['crudPermissions','join','getDataValue','BOOLEAN','sequelize','STRING','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x49cd,0x193));var _0xd49c=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0x49cd[_0x5a6961];return _0x4af0a6;};'use strict';var Sequelize=require(_0xd49c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd49c('0x1')],'allowNull':![],'unique':_0xd49c('0x2')},'crudPermissions':{'type':Sequelize[_0xd49c('0x1')],'set':function(_0x361173){this['setDataValue'](_0xd49c('0x3'),_0x361173?_0x361173[_0xd49c('0x4')](''):[]);},'get':function(){return this[_0xd49c('0x5')]('crudPermissions')?this[_0xd49c('0x5')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd49c('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd49c('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x60ad=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x289037,_0x57aed0){var _0x3c5ae7=function(_0x3f9da4){while(--_0x3f9da4){_0x289037['push'](_0x289037['shift']());}};_0x3c5ae7(++_0x57aed0);}(_0x60ad,0xb0));var _0xd60a=function(_0x1518f5,_0x149e83){_0x1518f5=_0x1518f5-0x0;var _0x59ec8b=_0x60ad[_0x1518f5];return _0x59ec8b;};'use strict';var Sequelize=require(_0xd60a('0x0'));module[_0xd60a('0x1')]={'name':{'type':Sequelize[_0xd60a('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xd60a('0x2')],'set':function(_0x4fb132){this[_0xd60a('0x3')](_0xd60a('0x4'),_0x4fb132?_0x4fb132[_0xd60a('0x5')](''):[]);},'get':function(){return this[_0xd60a('0x6')]('crudPermissions')?this[_0xd60a('0x6')](_0xd60a('0x4'))[_0xd60a('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd60a('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd60a('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd60a('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd60a('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd60a('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd60a('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 708a166..1f57019 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 _0x5713=['findOne','Dashboard','forEach','resourceId','addResources','transaction','bulkCreate','removeResources','ids','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','show','include','find','create','body','clone','get','omit','crudPermissions','createdAt','updatedAt','UserProfileSection','findAll','params','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','sequelize','sectionId','push','removeSections','getSections','includes','subsections','enabled'];(function(_0xf936f5,_0x305471){var _0x4f36dd=function(_0x59f3d5){while(--_0x59f3d5){_0xf936f5['push'](_0xf936f5['shift']());}};_0x4f36dd(++_0x305471);}(_0x5713,0x1c7));var _0x3571=function(_0x478d42,_0x54078c){_0x478d42=_0x478d42-0x0;var _0x6efe31=_0x5713[_0x478d42];return _0x6efe31;};'use strict';var emlformat=require(_0x3571('0x0'));var rimraf=require(_0x3571('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3571('0x2'));var rp=require('request-promise');var moment=require(_0x3571('0x3'));var BPromise=require(_0x3571('0x4'));var Mustache=require(_0x3571('0x5'));var util=require(_0x3571('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3571('0x7'));var ejs=require(_0x3571('0x8'));var fs=require('fs');var fs_extra=require(_0x3571('0x9'));var _=require(_0x3571('0xa'));var squel=require(_0x3571('0xb'));var crypto=require(_0x3571('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3571('0xd'));var toCsv=require(_0x3571('0x7'));var querystring=require(_0x3571('0xe'));var Papa=require(_0x3571('0xf'));var Redis=require(_0x3571('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3571('0x11'));var hardwareService=require(_0x3571('0x12'));var logger=require(_0x3571('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3571('0x14'))['db'];config[_0x3571('0x15')]=_[_0x3571('0x16')](config[_0x3571('0x15')],{'host':_0x3571('0x17'),'port':0x18eb});var socket=require(_0x3571('0x18'))(new Redis(config[_0x3571('0x15')]));require(_0x3571('0x19'))[_0x3571('0x1a')](socket);function respondWithStatusCode(_0x1558b2,_0x432441){_0x432441=_0x432441||0xcc;return function(_0x3a51ef){if(_0x3a51ef){return _0x1558b2[_0x3571('0x1b')](_0x432441);}return _0x1558b2[_0x3571('0x1c')](_0x432441)[_0x3571('0x1d')]();};}function respondWithResult(_0x42a2fb,_0x5da167){_0x5da167=_0x5da167||0xc8;return function(_0x5a27e1){if(_0x5a27e1){return _0x42a2fb['status'](_0x5da167)[_0x3571('0x1e')](_0x5a27e1);}};}function respondWithFilteredResult(_0x49e33d,_0x2b5b9c){return function(_0x37881f){if(_0x37881f){var _0x4b745a=typeof _0x2b5b9c[_0x3571('0x1f')]===_0x3571('0x20')&&typeof _0x2b5b9c[_0x3571('0x21')]===_0x3571('0x20');var _0x29c048=_0x37881f[_0x3571('0x22')];var _0x53f3f9=_0x4b745a?0x0:_0x2b5b9c[_0x3571('0x1f')];var _0x5b811f=_0x4b745a?_0x37881f[_0x3571('0x22')]:_0x2b5b9c[_0x3571('0x1f')]+_0x2b5b9c['limit'];var _0x500bfa;if(_0x5b811f>=_0x29c048){_0x5b811f=_0x29c048;_0x500bfa=0xc8;}else{_0x500bfa=0xce;}_0x49e33d['status'](_0x500bfa);return _0x49e33d[_0x3571('0x23')](_0x3571('0x24'),_0x53f3f9+'-'+_0x5b811f+'/'+_0x29c048)[_0x3571('0x1e')](_0x37881f);}return null;};}function patchUpdates(_0x189b3b){return function(_0x251cac){try{jsonpatch['apply'](_0x251cac,_0x189b3b,!![]);}catch(_0x41d5f1){return BPromise[_0x3571('0x25')](_0x41d5f1);}return _0x251cac[_0x3571('0x26')]();};}function saveUpdates(_0x128ab6,_0x234cb5){return function(_0x5c5750){if(_0x5c5750){return _0x5c5750[_0x3571('0x27')](_0x128ab6)[_0x3571('0x28')](function(_0x5c830b){return _0x5c830b;});}return null;};}function removeEntity(_0x46d4cd,_0x48a47b){return function(_0xbcb9c1){if(_0xbcb9c1){return _0xbcb9c1[_0x3571('0x29')]()[_0x3571('0x28')](function(){_0x46d4cd[_0x3571('0x1c')](0xcc)[_0x3571('0x1d')]();});}};}function handleEntityNotFound(_0x285d9c,_0x400560){return function(_0x4cbaae){if(!_0x4cbaae){_0x285d9c[_0x3571('0x1b')](0x194);}return _0x4cbaae;};}function handleError(_0x365f15,_0x7341f0){_0x7341f0=_0x7341f0||0x1f4;return function(_0x4fbe35){logger['error'](_0x4fbe35['stack']);if(_0x4fbe35[_0x3571('0x2a')]){delete _0x4fbe35['name'];}_0x365f15[_0x3571('0x1c')](_0x7341f0)[_0x3571('0x2b')](_0x4fbe35);};}exports[_0x3571('0x2c')]=function(_0x56e865,_0x559a26){var _0x7c1c2a={},_0x40eea0={},_0x4cc26c={'count':0x0,'rows':[]};var _0x37de61=_['map'](db[_0x3571('0x2d')][_0x3571('0x2e')],function(_0x4205bd){return{'name':_0x4205bd[_0x3571('0x2f')],'type':_0x4205bd[_0x3571('0x30')][_0x3571('0x31')]};});_0x40eea0[_0x3571('0x32')]=_['map'](_0x37de61,_0x3571('0x2a'));_0x40eea0[_0x3571('0x33')]=_[_0x3571('0x34')](_0x56e865[_0x3571('0x33')]);_0x40eea0['filters']=_[_0x3571('0x35')](_0x40eea0['model'],_0x40eea0[_0x3571('0x33')]);_0x7c1c2a[_0x3571('0x36')]=_[_0x3571('0x35')](_0x40eea0[_0x3571('0x32')],qs[_0x3571('0x37')](_0x56e865['query']['fields']));_0x7c1c2a['attributes']=_0x7c1c2a['attributes'][_0x3571('0x38')]?_0x7c1c2a['attributes']:_0x40eea0[_0x3571('0x32')];if(!_0x56e865[_0x3571('0x33')][_0x3571('0x39')](_0x3571('0x3a'))){_0x7c1c2a[_0x3571('0x21')]=qs[_0x3571('0x21')](_0x56e865[_0x3571('0x33')]['limit']);_0x7c1c2a[_0x3571('0x1f')]=qs[_0x3571('0x1f')](_0x56e865[_0x3571('0x33')][_0x3571('0x1f')]);}_0x7c1c2a[_0x3571('0x3b')]=qs['sort'](_0x56e865[_0x3571('0x33')][_0x3571('0x3c')]);_0x7c1c2a[_0x3571('0x3d')]=qs[_0x3571('0x3e')](_[_0x3571('0x3f')](_0x56e865['query'],_0x40eea0['filters']),_0x37de61);if(_0x56e865['query'][_0x3571('0x40')]){_0x7c1c2a['where']=_[_0x3571('0x41')](_0x7c1c2a[_0x3571('0x3d')],{'$or':_[_0x3571('0x42')](_0x37de61,function(_0x14a132){if(_0x14a132[_0x3571('0x30')]!==_0x3571('0x43')){var _0x54726b={};_0x54726b[_0x14a132[_0x3571('0x2a')]]={'$like':'%'+_0x56e865[_0x3571('0x33')]['filter']+'%'};return _0x54726b;}})});}_0x7c1c2a=_['merge']({},_0x7c1c2a,_0x56e865[_0x3571('0x44')]);var _0x4531fd={'where':_0x7c1c2a[_0x3571('0x3d')]};return db[_0x3571('0x2d')][_0x3571('0x22')](_0x4531fd)[_0x3571('0x28')](function(_0x5c3919){_0x4cc26c[_0x3571('0x22')]=_0x5c3919;if(_0x56e865[_0x3571('0x33')][_0x3571('0x45')]){_0x7c1c2a['include']=[{'all':!![]}];}return db[_0x3571('0x2d')]['findAll'](_0x7c1c2a);})[_0x3571('0x28')](function(_0x51cd18){_0x4cc26c[_0x3571('0x46')]=_0x51cd18;return _0x4cc26c;})[_0x3571('0x28')](respondWithFilteredResult(_0x559a26,_0x7c1c2a))[_0x3571('0x47')](handleError(_0x559a26,null));};exports[_0x3571('0x48')]=function(_0x3b80b6,_0x11dc3c){var _0x45e34b={'raw':![],'where':{'id':_0x3b80b6['params']['id']}},_0x2626f1={};_0x2626f1['model']=_[_0x3571('0x34')](db[_0x3571('0x2d')][_0x3571('0x2e')]);_0x2626f1[_0x3571('0x33')]=_[_0x3571('0x34')](_0x3b80b6[_0x3571('0x33')]);_0x2626f1[_0x3571('0x3e')]=_['intersection'](_0x2626f1['model'],_0x2626f1[_0x3571('0x33')]);_0x45e34b[_0x3571('0x36')]=_[_0x3571('0x35')](_0x2626f1[_0x3571('0x32')],qs[_0x3571('0x37')](_0x3b80b6[_0x3571('0x33')][_0x3571('0x37')]));_0x45e34b[_0x3571('0x36')]=_0x45e34b[_0x3571('0x36')][_0x3571('0x38')]?_0x45e34b['attributes']:_0x2626f1[_0x3571('0x32')];if(_0x3b80b6['query'][_0x3571('0x45')]){_0x45e34b[_0x3571('0x49')]=[{'all':!![]}];}_0x45e34b=_[_0x3571('0x41')]({},_0x45e34b,_0x3b80b6['options']);return db[_0x3571('0x2d')][_0x3571('0x4a')](_0x45e34b)[_0x3571('0x28')](handleEntityNotFound(_0x11dc3c,null))[_0x3571('0x28')](respondWithResult(_0x11dc3c,null))[_0x3571('0x47')](handleError(_0x11dc3c,null));};exports[_0x3571('0x4b')]=function(_0x2ebd54,_0x560c0f){return db[_0x3571('0x2d')]['create'](_0x2ebd54[_0x3571('0x4c')],{})['then'](respondWithResult(_0x560c0f,0xc9))[_0x3571('0x47')](handleError(_0x560c0f,null));};exports[_0x3571('0x4d')]=function(_0x4a82f1,_0x15fdad){var _0x256ae0={'where':{'id':_0x4a82f1['params']['id']}},_0x5977c6={};_0x5977c6[_0x3571('0x32')]=_[_0x3571('0x34')](db[_0x3571('0x2d')][_0x3571('0x2e')]);_0x256ae0[_0x3571('0x36')]=_[_0x3571('0x35')](_0x5977c6['model'],qs[_0x3571('0x37')](_0x4a82f1[_0x3571('0x33')][_0x3571('0x37')]));_0x256ae0[_0x3571('0x36')]=_0x256ae0[_0x3571('0x36')]['length']?_0x256ae0[_0x3571('0x36')]:_0x5977c6[_0x3571('0x32')];if(_0x4a82f1[_0x3571('0x33')][_0x3571('0x45')]){_0x256ae0[_0x3571('0x49')]=[{'all':!![]}];}_0x256ae0=_[_0x3571('0x41')]({},_0x256ae0,_0x4a82f1['options']);return db[_0x3571('0x2d')][_0x3571('0x4a')](_0x256ae0)[_0x3571('0x28')](handleEntityNotFound(_0x15fdad,null))['then'](function(_0xe0e247){if(_0xe0e247){var _0x233edc=_0xe0e247[_0x3571('0x4e')]({'plain':!![]});_0x233edc=qs[_0x3571('0x4f')](_0x233edc,['id','createdAt','updatedAt',_0x3571('0x50')]);_0x4a82f1[_0x3571('0x4c')]=_[_0x3571('0x4f')](_0x4a82f1[_0x3571('0x4c')],['id',_0x3571('0x51'),_0x3571('0x52')]);return db['sequelize']['transaction'](function(_0x4437cd){return db[_0x3571('0x2d')][_0x3571('0x4b')](_[_0x3571('0x41')](_0x233edc,_0x4a82f1[_0x3571('0x4c')]),{'include':_0x4a82f1[_0x3571('0x33')][_0x3571('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x4437cd})[_0x3571('0x28')](function(_0x397666){var _0x57be3c=_0x397666[_0x3571('0x4e')]({'plain':!![]});return db[_0x3571('0x53')][_0x3571('0x54')]({'where':{'userProfileId':_0x4a82f1[_0x3571('0x55')]['id']},'raw':!![]})[_0x3571('0x28')](function(_0x3a4731){if(_0x3a4731){return BPromise['each'](_0x3a4731,function(_0x48c99d){return new BPromise(function(_0x49034b,_0xead253){if(_0x48c99d[_0x3571('0x56')]===null||_0x48c99d[_0x3571('0x56')]===0x1)_0x49034b(null);return db[_0x3571('0x57')][_0x3571('0x54')]({'where':{'sectionId':_0x48c99d['id']},'raw':!![]})[_0x3571('0x28')](function(_0x36e31a){var _0x4193a6=_['map'](_0x36e31a,function(_0x5513bd){return qs['omit'](_0x5513bd,['id','createdAt',_0x3571('0x52'),'sectionId']);});_0x49034b(_0x4193a6);})['catch'](function(_0x3c5ea6){_0xead253(_0x3c5ea6);});})['then'](function(_0x375b32){var _0x1113c3=qs[_0x3571('0x4f')](_0x48c99d,['id',_0x3571('0x51'),'updatedAt']);_0x1113c3[_0x3571('0x58')]=_0x57be3c['id'];if(_0x375b32)_0x1113c3['Resources']=_0x375b32;return _0x1113c3;})[_0x3571('0x28')](function(_0x14e502){return db[_0x3571('0x53')][_0x3571('0x4b')](_0x14e502,{'include':[{'model':db[_0x3571('0x57')],'as':_0x3571('0x59')}],'raw':!![],'transaction':_0x4437cd});});})[_0x3571('0x28')](function(){return _0x57be3c;});}});});});}})[_0x3571('0x28')](respondWithResult(_0x15fdad,0xc9))[_0x3571('0x47')](handleError(_0x15fdad,null));};exports[_0x3571('0x27')]=function(_0x4b053d,_0xcf62d5){if(_0x4b053d[_0x3571('0x4c')]['id']){delete _0x4b053d[_0x3571('0x4c')]['id'];}return db[_0x3571('0x2d')][_0x3571('0x4a')]({'where':{'id':_0x4b053d[_0x3571('0x55')]['id']}})['then'](handleEntityNotFound(_0xcf62d5,null))[_0x3571('0x28')](saveUpdates(_0x4b053d['body'],null))[_0x3571('0x28')](respondWithResult(_0xcf62d5,null))[_0x3571('0x47')](handleError(_0xcf62d5,null));};exports[_0x3571('0x29')]=function(_0x1b5a8a,_0x1c817a){return db['UserProfile'][_0x3571('0x4a')]({'where':{'id':_0x1b5a8a[_0x3571('0x55')]['id']}})[_0x3571('0x28')](handleEntityNotFound(_0x1c817a,null))['then'](removeEntity(_0x1c817a,null))[_0x3571('0x47')](handleError(_0x1c817a,null));};exports[_0x3571('0x5a')]=function(_0x441a7a,_0x53f57){return db['UserProfile'][_0x3571('0x5a')]()[_0x3571('0x28')](respondWithResult(_0x53f57,null))[_0x3571('0x47')](handleError(_0x53f57,null));};exports[_0x3571('0x5b')]=function(_0x17d9ee,_0x271e84){var _0x74bff2=_0x17d9ee[_0x3571('0x4c')];return db[_0x3571('0x2d')][_0x3571('0x4a')]({'where':{'id':_0x17d9ee[_0x3571('0x55')]['id']}})[_0x3571('0x28')](handleEntityNotFound(_0x271e84,null))[_0x3571('0x28')](function(_0x1ea269){if(_0x1ea269){return db[_0x3571('0x5c')]['transaction'](function(_0x3aa3f3){return db['UserProfileSection'][_0x3571('0x29')]({'where':{'userProfileId':_0x17d9ee[_0x3571('0x55')]['id'],'sectionId':_[_0x3571('0x42')](_0x74bff2,function(_0x1da77f){return _0x1da77f[_0x3571('0x5d')];})},'transaction':_0x3aa3f3})[_0x3571('0x28')](function(){var _0x5429ac=_['map'](_0x74bff2,function(_0x49c370){_0x49c370['userProfileId']=_0x17d9ee['params']['id'];return _0x49c370;});var _0x8186ff=[];return BPromise['each'](_0x5429ac,function(_0x4a297c){return db[_0x3571('0x53')][_0x3571('0x4b')](_0x4a297c,{'include':[{'model':db[_0x3571('0x57')],'as':_0x3571('0x59')}],'raw':!![],'transaction':_0x3aa3f3})['then'](function(_0x186ab1){_0x8186ff[_0x3571('0x5e')](_0x186ab1['get']({'plain':!![]}));});})['then'](function(){return _0x8186ff;});});});}})[_0x3571('0x28')](function(_0x291a7b){return _0x291a7b;})[_0x3571('0x28')](respondWithResult(_0x271e84,null))[_0x3571('0x47')](handleError(_0x271e84,null));};exports[_0x3571('0x5f')]=function(_0x249095,_0x5c692f){var _0x5fb5ff;return db[_0x3571('0x2d')]['find']({'where':{'id':_0x249095['params']['id']},'attributes':['id','name']})[_0x3571('0x28')](handleEntityNotFound(_0x5c692f,null))[_0x3571('0x28')](function(_0x2a8cde){if(_0x2a8cde){_0x5fb5ff=_0x2a8cde;return db[_0x3571('0x53')]['destroy']({'where':{'userProfileId':_0x249095[_0x3571('0x55')]['id'],'sectionId':_0x249095['query']['ids']}});}})[_0x3571('0x28')](function(){return _0x5fb5ff;})['then'](respondWithStatusCode(_0x5c692f,null))[_0x3571('0x47')](handleError(_0x5c692f,null));};exports[_0x3571('0x60')]=function(_0x435101,_0x72e4fe){var _0x1f0ba9=[];var _0x250673=[];return db[_0x3571('0x53')][_0x3571('0x54')]({'where':{'userProfileId':_0x435101[_0x3571('0x55')]['id']},'raw':!![]})['then'](function(_0x5791f3){_0x1f0ba9=_[_0x3571('0x40')](_0x5791f3,function(_0x3437c5){return _0x3437c5['enabled']===0x1||_[_0x3571('0x61')]([0x3eb,0x709],_0x3437c5[_0x3571('0x5d')]);});if(!_['isEmpty'](_0x1f0ba9)){return _[_0x3571('0x42')](_0x1f0ba9,function(_0x4d30db){return _0x4d30db['sectionId'];});}else{return;}})['then'](function(_0x5c9cb7){if(_0x5c9cb7)_0x250673=_0x5c9cb7;if(_[_0x3571('0x61')](_0x250673,0x64)){var _0x2e7e7b=_[_0x3571('0x4a')](_0x1f0ba9,{'sectionId':0x64});return hasDefaultDashboard(_0x2e7e7b)[_0x3571('0x28')](function(_0x4537ed){return _[_0x3571('0x42')](_0x1f0ba9,function(_0x441d2c){if(_0x441d2c[_0x3571('0x5d')]===0x64){_0x441d2c['subsections']=_0x4537ed;}return _0x441d2c;});});}else{return;}})[_0x3571('0x28')](function(_0x2777c2){if(_0x2777c2)_0x1f0ba9=_0x2777c2;if(_[_0x3571('0x61')](_0x250673,0x3eb)){var _0x4538b1=_['find'](_0x1f0ba9,{'sectionId':0x3eb});return getCustomDashboards(_0x4538b1)[_0x3571('0x28')](function(_0x142b82){return _[_0x3571('0x42')](_0x1f0ba9,function(_0x8dba1a){if(_0x4538b1['enabled']){if(_0x8dba1a[_0x3571('0x5d')]===0x3eb){_0x8dba1a[_0x3571('0x62')]=_0x142b82;}}else{if(_0x8dba1a[_0x3571('0x5d')]===0x64){_0x8dba1a[_0x3571('0x62')]=_0x142b82;}}return _0x8dba1a;});});}else{return;}})[_0x3571('0x28')](function(_0x5a39a3){if(_0x5a39a3)_0x1f0ba9=_0x5a39a3;if(_[_0x3571('0x61')](_0x250673,0x709)){var _0x4daa41=_[_0x3571('0x4a')](_0x1f0ba9,{'sectionId':0x709});return getPlugins(_0x4daa41)[_0x3571('0x28')](function(_0x1be481){if(_0x4daa41[_0x3571('0x63')]){return _['map'](_0x1f0ba9,function(_0x393a12){if(_0x393a12[_0x3571('0x5d')]===0x709){_0x393a12[_0x3571('0x62')]=_0x1be481;}return _0x393a12;});}else{var _0x58949c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1be481};var _0x1fb916=_['map'](_0x1f0ba9);_0x1fb916[_0x3571('0x5e')](_0x58949c);return _0x1fb916;}});}else{return;}})['then'](function(_0x4548f2){if(_0x4548f2)_0x1f0ba9=_0x4548f2;return _[_0x3571('0x40')](_0x1f0ba9,['enabled',0x1]);})['then'](respondWithResult(_0x72e4fe,null))['catch'](handleError(_0x72e4fe,null));};function hasDefaultDashboard(_0x2a6399){var _0xc2c109=[0x65];return new BPromise(function(_0x5a4c66,_0x149c6f){try{if(_0x2a6399[_0x3571('0x56')]){_0x5a4c66(_0xc2c109);}else{return db[_0x3571('0x57')][_0x3571('0x64')]({'where':{'sectionId':_0x2a6399['id']},'raw':!![]})['then'](function(_0x371ae7){_0x371ae7?_0x5a4c66(_0xc2c109):_0x5a4c66();});}}catch(_0x4cd695){_0x149c6f(_0x4cd695);}});}function getCustomDashboards(_0x40168f){var _0x12fab4=[];return new BPromise(function(_0x324aec,_0x1c98e4){try{if(_0x40168f[_0x3571('0x56')]){return db[_0x3571('0x65')][_0x3571('0x54')]({'raw':!![]})[_0x3571('0x28')](function(_0x20d9d2){_0x20d9d2[_0x3571('0x66')](function(_0x31205e){_0x12fab4[_0x3571('0x5e')](_0x31205e['id']+0x1869f);});_0x324aec(_0x12fab4);});}else{return db[_0x3571('0x57')][_0x3571('0x54')]({'where':{'sectionId':_0x40168f['id']},'raw':!![]})[_0x3571('0x28')](function(_0x3a6fc3){_0x3a6fc3[_0x3571('0x66')](function(_0x12f75c){_0x12fab4[_0x3571('0x5e')](_0x12f75c[_0x3571('0x67')]+0x1869f);});_0x324aec(_0x12fab4);});}}catch(_0x212345){_0x1c98e4(_0x212345);}});}function getPlugins(_0x1fd50a){var _0x862aac=[];return new BPromise(function(_0x4472f7,_0x13d724){try{if(_0x1fd50a[_0x3571('0x56')]){return db['Plugin'][_0x3571('0x54')]({'raw':!![]})['then'](function(_0xad82ac){_0xad82ac[_0x3571('0x66')](function(_0x1c57ae){_0x862aac[_0x3571('0x5e')](_0x1c57ae['id']+0x15b38);});_0x4472f7(_0x862aac);});}else{return db[_0x3571('0x57')][_0x3571('0x54')]({'where':{'sectionId':_0x1fd50a['id']},'raw':!![]})[_0x3571('0x28')](function(_0x462644){_0x462644['forEach'](function(_0x52175c){_0x862aac[_0x3571('0x5e')](_0x52175c[_0x3571('0x67')]+0x15b38);});_0x4472f7(_0x862aac);});}}catch(_0x4bdd77){_0x13d724(_0x4bdd77);}});}exports[_0x3571('0x68')]=function(_0x29d5c4,_0x12ae59){return db[_0x3571('0x2d')][_0x3571('0x4a')]({'where':{'id':_0x29d5c4['params']['id']}})['then'](handleEntityNotFound(_0x12ae59,null))[_0x3571('0x28')](function(_0x403b87){if(_0x403b87){return db[_0x3571('0x5c')][_0x3571('0x69')](function(_0x3b576c){return db['UserProfileSection'][_0x3571('0x54')]({'where':{'userProfileId':_0x29d5c4['params']['id']},'attributes':['id'],'raw':!![]})[_0x3571('0x28')](function(_0x398e07){if(_0x398e07){return db['UserProfileSection'][_0x3571('0x29')]({'where':{'userProfileId':_0x29d5c4[_0x3571('0x55')]['id'],'id':_['map'](_0x398e07,function(_0x28d39a){return _0x28d39a['id'];})},'transaction':_0x3b576c});}})[_0x3571('0x28')](function(_0x380e26){var _0x4a11b0=_[_0x3571('0x42')](_0x29d5c4['body'],function(_0x43ad1e){_0x43ad1e[_0x3571('0x58')]=_0x29d5c4['params']['id'];return _0x43ad1e;});return db['UserProfileSection'][_0x3571('0x6a')](_0x4a11b0,{'raw':!![],'transaction':_0x3b576c});})['then'](function(_0x1a8d3b){var _0x4e4cab=_['filter'](_[_0x3571('0x42')](_0x1a8d3b,function(_0x189116){return _0x189116[_0x3571('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x4e4cab){return db[_0x3571('0x53')][_0x3571('0x54')]({'where':{'userProfileId':_0x29d5c4['params']['id'],'sectionId':_[_0x3571('0x42')](_0x4e4cab,function(_0x39b6b7){return _0x39b6b7[_0x3571('0x5d')];})},'attributes':['id',_0x3571('0x5d')],'raw':!![]})[_0x3571('0x28')](function(_0x132f44){var _0x3c0a8f=_[_0x3571('0x42')](_0x29d5c4['body'],function(_0x554711){_0x554711['userProfileId']=_0x29d5c4['params']['id'];return _0x554711;});return db[_0x3571('0x57')][_0x3571('0x6a')](_0x3c0a8f,{'raw':!![],'transaction':_0x3b576c});});}})['catch'](handleError(_0x12ae59,null));});}})[_0x3571('0x28')](function(_0x4eda8b){var _0x267f24=_['map'](_0x4eda8b,function(_0x3d7dac){return _0x3d7dac[_0x3571('0x4e')]({'plain':!![]});});})[_0x3571('0x28')](respondWithResult(_0x12ae59,null))[_0x3571('0x47')](handleError(_0x12ae59,null));};exports[_0x3571('0x6b')]=function(_0x222cbe,_0xad9455,_0x174a38){return db[_0x3571('0x2d')][_0x3571('0x4a')]({'where':{'id':_0x222cbe['params']['id']}})[_0x3571('0x28')](handleEntityNotFound(_0xad9455,null))['then'](function(_0x4a59f2){if(_0x4a59f2){return _0x4a59f2[_0x3571('0x6b')](_0x222cbe[_0x3571('0x33')][_0x3571('0x6c')]);}})[_0x3571('0x28')](respondWithStatusCode(_0xad9455,null))[_0x3571('0x47')](handleError(_0xad9455,null));};exports[_0x3571('0x6d')]=function(_0x475db5,_0x1ca923){var _0x468533={};if(!_0x475db5[_0x3571('0x33')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x475db5[_0x3571('0x33')]['hasOwnProperty']('nolimit')){_0x468533[_0x3571('0x21')]=qs[_0x3571('0x21')](_0x475db5[_0x3571('0x33')][_0x3571('0x21')]);_0x468533['offset']=qs[_0x3571('0x1f')](_0x475db5[_0x3571('0x33')][_0x3571('0x1f')]);}return db['UserProfile']['find']({'where':{'id':_0x475db5[_0x3571('0x55')]['id']}})[_0x3571('0x28')](function(_0x11b27c){if(!_0x11b27c)throw new Error(_0x3571('0x6e')+_0x475db5[_0x3571('0x55')]['id']);return db[_0x3571('0x2d')][_0x3571('0x6d')](_0x475db5);})['then'](respondWithFilteredResult(_0x1ca923,_0x468533))[_0x3571('0x47')](handleError(_0x1ca923,null));}; \ No newline at end of file +var _0xde3a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','VIRTUAL','filter','options','where','include','findAll','rows','catch','show','params','find','create','body','clone','includeAll','get','createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','omit','sectionId','Resources','update','describe','push','removeSections','ids','enabled','includes','subsections','findOne','forEach','resourceId','Plugin','addResources','userProfileId','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x585b01,_0xa7fe){var _0x2bc3bd=function(_0x49f9c3){while(--_0x49f9c3){_0x585b01['push'](_0x585b01['shift']());}};_0x2bc3bd(++_0xa7fe);}(_0xde3a,0x140));var _0xade3=function(_0x22afba,_0x14b664){_0x22afba=_0x22afba-0x0;var _0x5d2888=_0xde3a[_0x22afba];return _0x5d2888;};'use strict';var emlformat=require(_0xade3('0x0'));var rimraf=require(_0xade3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xade3('0x2'));var BPromise=require(_0xade3('0x3'));var Mustache=require(_0xade3('0x4'));var util=require(_0xade3('0x5'));var path=require(_0xade3('0x6'));var sox=require(_0xade3('0x7'));var csv=require(_0xade3('0x8'));var ejs=require(_0xade3('0x9'));var fs=require('fs');var fs_extra=require(_0xade3('0xa'));var _=require('lodash');var squel=require(_0xade3('0xb'));var crypto=require(_0xade3('0xc'));var jsforce=require(_0xade3('0xd'));var deskjs=require(_0xade3('0xe'));var toCsv=require(_0xade3('0x8'));var querystring=require(_0xade3('0xf'));var Papa=require(_0xade3('0x10'));var Redis=require('ioredis');var authService=require(_0xade3('0x11'));var qs=require(_0xade3('0x12'));var as=require(_0xade3('0x13'));var hardwareService=require(_0xade3('0x14'));var logger=require(_0xade3('0x15'))('api');var utils=require(_0xade3('0x16'));var config=require(_0xade3('0x17'));var licenseUtil=require(_0xade3('0x18'));var db=require(_0xade3('0x19'))['db'];config[_0xade3('0x1a')]=_[_0xade3('0x1b')](config[_0xade3('0x1a')],{'host':_0xade3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xade3('0x1a')]));require('./userProfile.socket')[_0xade3('0x1d')](socket);function respondWithStatusCode(_0x2deef7,_0x445269){_0x445269=_0x445269||0xcc;return function(_0x57c690){if(_0x57c690){return _0x2deef7['sendStatus'](_0x445269);}return _0x2deef7[_0xade3('0x1e')](_0x445269)[_0xade3('0x1f')]();};}function respondWithResult(_0x4897e3,_0xb60571){_0xb60571=_0xb60571||0xc8;return function(_0x5d17d7){if(_0x5d17d7){return _0x4897e3[_0xade3('0x1e')](_0xb60571)[_0xade3('0x20')](_0x5d17d7);}};}function respondWithFilteredResult(_0x483101,_0x43e1cb){return function(_0x247c25){if(_0x247c25){var _0x5bb218=typeof _0x43e1cb[_0xade3('0x21')]==='undefined'&&typeof _0x43e1cb['limit']===_0xade3('0x22');var _0x1d902b=_0x247c25[_0xade3('0x23')];var _0x179b11=_0x5bb218?0x0:_0x43e1cb[_0xade3('0x21')];var _0x98c74=_0x5bb218?_0x247c25['count']:_0x43e1cb[_0xade3('0x21')]+_0x43e1cb[_0xade3('0x24')];var _0x11222d;if(_0x98c74>=_0x1d902b){_0x98c74=_0x1d902b;_0x11222d=0xc8;}else{_0x11222d=0xce;}_0x483101[_0xade3('0x1e')](_0x11222d);return _0x483101[_0xade3('0x25')](_0xade3('0x26'),_0x179b11+'-'+_0x98c74+'/'+_0x1d902b)['json'](_0x247c25);}return null;};}function patchUpdates(_0x28af25){return function(_0x36f028){try{jsonpatch[_0xade3('0x27')](_0x36f028,_0x28af25,!![]);}catch(_0x320860){return BPromise[_0xade3('0x28')](_0x320860);}return _0x36f028[_0xade3('0x29')]();};}function saveUpdates(_0x2148d9,_0x2f50f8){return function(_0x15a121){if(_0x15a121){return _0x15a121['update'](_0x2148d9)['then'](function(_0x4623ad){return _0x4623ad;});}return null;};}function removeEntity(_0x57b91e,_0x596362){return function(_0x249a6c){if(_0x249a6c){return _0x249a6c[_0xade3('0x2a')]()[_0xade3('0x2b')](function(){_0x57b91e[_0xade3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8d4a,_0x3ef3f5){return function(_0x1842c5){if(!_0x1842c5){_0x2c8d4a['sendStatus'](0x194);}return _0x1842c5;};}function handleError(_0x4f6e06,_0x8eeab){_0x8eeab=_0x8eeab||0x1f4;return function(_0x14b149){logger[_0xade3('0x2c')](_0x14b149['stack']);if(_0x14b149[_0xade3('0x2d')]){delete _0x14b149[_0xade3('0x2d')];}_0x4f6e06[_0xade3('0x1e')](_0x8eeab)[_0xade3('0x2e')](_0x14b149);};}exports['index']=function(_0x422fbf,_0x3861a6){var _0x5edf40={},_0x36b016={},_0x44f699={'count':0x0,'rows':[]};var _0x57869d=_[_0xade3('0x2f')](db[_0xade3('0x30')][_0xade3('0x31')],function(_0x1c8e56){return{'name':_0x1c8e56[_0xade3('0x32')],'type':_0x1c8e56[_0xade3('0x33')]['key']};});_0x36b016[_0xade3('0x34')]=_[_0xade3('0x2f')](_0x57869d,'name');_0x36b016[_0xade3('0x35')]=_[_0xade3('0x36')](_0x422fbf[_0xade3('0x35')]);_0x36b016[_0xade3('0x37')]=_[_0xade3('0x38')](_0x36b016[_0xade3('0x34')],_0x36b016[_0xade3('0x35')]);_0x5edf40[_0xade3('0x39')]=_['intersection'](_0x36b016[_0xade3('0x34')],qs[_0xade3('0x3a')](_0x422fbf[_0xade3('0x35')][_0xade3('0x3a')]));_0x5edf40['attributes']=_0x5edf40[_0xade3('0x39')][_0xade3('0x3b')]?_0x5edf40['attributes']:_0x36b016[_0xade3('0x34')];if(!_0x422fbf[_0xade3('0x35')]['hasOwnProperty'](_0xade3('0x3c'))){_0x5edf40['limit']=qs['limit'](_0x422fbf[_0xade3('0x35')][_0xade3('0x24')]);_0x5edf40[_0xade3('0x21')]=qs[_0xade3('0x21')](_0x422fbf[_0xade3('0x35')]['offset']);}_0x5edf40[_0xade3('0x3d')]=qs[_0xade3('0x3e')](_0x422fbf[_0xade3('0x35')][_0xade3('0x3e')]);_0x5edf40['where']=qs['filters'](_[_0xade3('0x3f')](_0x422fbf[_0xade3('0x35')],_0x36b016['filters']),_0x57869d);if(_0x422fbf[_0xade3('0x35')]['filter']){_0x5edf40['where']=_[_0xade3('0x40')](_0x5edf40['where'],{'$or':_['map'](_0x57869d,function(_0xaba890){if(_0xaba890[_0xade3('0x33')]!==_0xade3('0x41')){var _0x39db1a={};_0x39db1a[_0xaba890[_0xade3('0x2d')]]={'$like':'%'+_0x422fbf['query'][_0xade3('0x42')]+'%'};return _0x39db1a;}})});}_0x5edf40=_[_0xade3('0x40')]({},_0x5edf40,_0x422fbf[_0xade3('0x43')]);var _0xfbcb2={'where':_0x5edf40[_0xade3('0x44')]};return db[_0xade3('0x30')][_0xade3('0x23')](_0xfbcb2)[_0xade3('0x2b')](function(_0x40bb3e){_0x44f699[_0xade3('0x23')]=_0x40bb3e;if(_0x422fbf['query']['includeAll']){_0x5edf40[_0xade3('0x45')]=[{'all':!![]}];}return db[_0xade3('0x30')][_0xade3('0x46')](_0x5edf40);})[_0xade3('0x2b')](function(_0x4c5995){_0x44f699[_0xade3('0x47')]=_0x4c5995;return _0x44f699;})['then'](respondWithFilteredResult(_0x3861a6,_0x5edf40))[_0xade3('0x48')](handleError(_0x3861a6,null));};exports[_0xade3('0x49')]=function(_0x1114bc,_0xafa48e){var _0x4c2fc8={'raw':![],'where':{'id':_0x1114bc[_0xade3('0x4a')]['id']}},_0x9256cf={};_0x9256cf['model']=_[_0xade3('0x36')](db[_0xade3('0x30')]['rawAttributes']);_0x9256cf['query']=_[_0xade3('0x36')](_0x1114bc[_0xade3('0x35')]);_0x9256cf[_0xade3('0x37')]=_['intersection'](_0x9256cf[_0xade3('0x34')],_0x9256cf[_0xade3('0x35')]);_0x4c2fc8[_0xade3('0x39')]=_[_0xade3('0x38')](_0x9256cf['model'],qs[_0xade3('0x3a')](_0x1114bc['query'][_0xade3('0x3a')]));_0x4c2fc8['attributes']=_0x4c2fc8[_0xade3('0x39')][_0xade3('0x3b')]?_0x4c2fc8[_0xade3('0x39')]:_0x9256cf['model'];if(_0x1114bc[_0xade3('0x35')]['includeAll']){_0x4c2fc8[_0xade3('0x45')]=[{'all':!![]}];}_0x4c2fc8=_[_0xade3('0x40')]({},_0x4c2fc8,_0x1114bc[_0xade3('0x43')]);return db['UserProfile'][_0xade3('0x4b')](_0x4c2fc8)[_0xade3('0x2b')](handleEntityNotFound(_0xafa48e,null))[_0xade3('0x2b')](respondWithResult(_0xafa48e,null))[_0xade3('0x48')](handleError(_0xafa48e,null));};exports[_0xade3('0x4c')]=function(_0x1d16c9,_0x3a28e0){return db[_0xade3('0x30')][_0xade3('0x4c')](_0x1d16c9[_0xade3('0x4d')],{})['then'](respondWithResult(_0x3a28e0,0xc9))[_0xade3('0x48')](handleError(_0x3a28e0,null));};exports[_0xade3('0x4e')]=function(_0x483a88,_0x349989){var _0x14aea4={'where':{'id':_0x483a88[_0xade3('0x4a')]['id']}},_0x578467={};_0x578467[_0xade3('0x34')]=_[_0xade3('0x36')](db[_0xade3('0x30')][_0xade3('0x31')]);_0x14aea4[_0xade3('0x39')]=_['intersection'](_0x578467[_0xade3('0x34')],qs[_0xade3('0x3a')](_0x483a88['query'][_0xade3('0x3a')]));_0x14aea4['attributes']=_0x14aea4[_0xade3('0x39')][_0xade3('0x3b')]?_0x14aea4[_0xade3('0x39')]:_0x578467[_0xade3('0x34')];if(_0x483a88[_0xade3('0x35')][_0xade3('0x4f')]){_0x14aea4['include']=[{'all':!![]}];}_0x14aea4=_[_0xade3('0x40')]({},_0x14aea4,_0x483a88[_0xade3('0x43')]);return db[_0xade3('0x30')][_0xade3('0x4b')](_0x14aea4)['then'](handleEntityNotFound(_0x349989,null))[_0xade3('0x2b')](function(_0x4cb692){if(_0x4cb692){var _0x542113=_0x4cb692[_0xade3('0x50')]({'plain':!![]});_0x542113=qs['omit'](_0x542113,['id',_0xade3('0x51'),_0xade3('0x52'),'crudPermissions']);_0x483a88[_0xade3('0x4d')]=_['omit'](_0x483a88['body'],['id',_0xade3('0x51'),_0xade3('0x52')]);return db[_0xade3('0x53')][_0xade3('0x54')](function(_0x23f71d){return db[_0xade3('0x30')][_0xade3('0x4c')](_[_0xade3('0x40')](_0x542113,_0x483a88[_0xade3('0x4d')]),{'include':_0x483a88['query'][_0xade3('0x4f')]?[{'all':!![]}]:undefined,'transaction':_0x23f71d})[_0xade3('0x2b')](function(_0x49e17f){var _0x113ab0=_0x49e17f[_0xade3('0x50')]({'plain':!![]});return db[_0xade3('0x55')]['findAll']({'where':{'userProfileId':_0x483a88[_0xade3('0x4a')]['id']},'raw':!![]})['then'](function(_0x303118){if(_0x303118){return BPromise[_0xade3('0x56')](_0x303118,function(_0x956269){return new BPromise(function(_0x8def9f,_0x91b281){if(_0x956269['autoAssociation']===null||_0x956269[_0xade3('0x57')]===0x1)_0x8def9f(null);return db[_0xade3('0x58')]['findAll']({'where':{'sectionId':_0x956269['id']},'raw':!![]})[_0xade3('0x2b')](function(_0xa19ea){var _0x4d4478=_[_0xade3('0x2f')](_0xa19ea,function(_0x4ad7cf){return qs[_0xade3('0x59')](_0x4ad7cf,['id',_0xade3('0x51'),_0xade3('0x52'),_0xade3('0x5a')]);});_0x8def9f(_0x4d4478);})[_0xade3('0x48')](function(_0x20141a){_0x91b281(_0x20141a);});})[_0xade3('0x2b')](function(_0x51ab6d){var _0x118859=qs[_0xade3('0x59')](_0x956269,['id','createdAt',_0xade3('0x52')]);_0x118859['userProfileId']=_0x113ab0['id'];if(_0x51ab6d)_0x118859[_0xade3('0x5b')]=_0x51ab6d;return _0x118859;})[_0xade3('0x2b')](function(_0x4971c8){return db['UserProfileSection'][_0xade3('0x4c')](_0x4971c8,{'include':[{'model':db[_0xade3('0x58')],'as':_0xade3('0x5b')}],'raw':!![],'transaction':_0x23f71d});});})[_0xade3('0x2b')](function(){return _0x113ab0;});}});});});}})['then'](respondWithResult(_0x349989,0xc9))['catch'](handleError(_0x349989,null));};exports[_0xade3('0x5c')]=function(_0x543176,_0x416eae){if(_0x543176['body']['id']){delete _0x543176[_0xade3('0x4d')]['id'];}return db[_0xade3('0x30')][_0xade3('0x4b')]({'where':{'id':_0x543176[_0xade3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x416eae,null))[_0xade3('0x2b')](saveUpdates(_0x543176[_0xade3('0x4d')],null))[_0xade3('0x2b')](respondWithResult(_0x416eae,null))[_0xade3('0x48')](handleError(_0x416eae,null));};exports['destroy']=function(_0x3e4c50,_0x24a3f5){return db[_0xade3('0x30')][_0xade3('0x4b')]({'where':{'id':_0x3e4c50[_0xade3('0x4a')]['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0x24a3f5,null))[_0xade3('0x2b')](removeEntity(_0x24a3f5,null))[_0xade3('0x48')](handleError(_0x24a3f5,null));};exports[_0xade3('0x5d')]=function(_0x983dff,_0xc8d173){return db['UserProfile'][_0xade3('0x5d')]()[_0xade3('0x2b')](respondWithResult(_0xc8d173,null))[_0xade3('0x48')](handleError(_0xc8d173,null));};exports['addSections']=function(_0x3287a1,_0x106066){var _0x332fae=_0x3287a1[_0xade3('0x4d')];return db[_0xade3('0x30')][_0xade3('0x4b')]({'where':{'id':_0x3287a1[_0xade3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x106066,null))[_0xade3('0x2b')](function(_0x4a0ccc){if(_0x4a0ccc){return db['sequelize'][_0xade3('0x54')](function(_0x1d58cf){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3287a1[_0xade3('0x4a')]['id'],'sectionId':_[_0xade3('0x2f')](_0x332fae,function(_0x493615){return _0x493615[_0xade3('0x5a')];})},'transaction':_0x1d58cf})[_0xade3('0x2b')](function(){var _0x34b4c5=_[_0xade3('0x2f')](_0x332fae,function(_0x58872c){_0x58872c['userProfileId']=_0x3287a1[_0xade3('0x4a')]['id'];return _0x58872c;});var _0x45b324=[];return BPromise[_0xade3('0x56')](_0x34b4c5,function(_0x3d8bd9){return db[_0xade3('0x55')][_0xade3('0x4c')](_0x3d8bd9,{'include':[{'model':db[_0xade3('0x58')],'as':_0xade3('0x5b')}],'raw':!![],'transaction':_0x1d58cf})[_0xade3('0x2b')](function(_0x147418){_0x45b324[_0xade3('0x5e')](_0x147418[_0xade3('0x50')]({'plain':!![]}));});})[_0xade3('0x2b')](function(){return _0x45b324;});});});}})[_0xade3('0x2b')](function(_0x330b60){return _0x330b60;})[_0xade3('0x2b')](respondWithResult(_0x106066,null))[_0xade3('0x48')](handleError(_0x106066,null));};exports[_0xade3('0x5f')]=function(_0x4bd3da,_0xbd9767){var _0x160d76;return db['UserProfile'][_0xade3('0x4b')]({'where':{'id':_0x4bd3da[_0xade3('0x4a')]['id']},'attributes':['id',_0xade3('0x2d')]})[_0xade3('0x2b')](handleEntityNotFound(_0xbd9767,null))[_0xade3('0x2b')](function(_0x1e62a5){if(_0x1e62a5){_0x160d76=_0x1e62a5;return db[_0xade3('0x55')][_0xade3('0x2a')]({'where':{'userProfileId':_0x4bd3da['params']['id'],'sectionId':_0x4bd3da[_0xade3('0x35')][_0xade3('0x60')]}});}})[_0xade3('0x2b')](function(){return _0x160d76;})[_0xade3('0x2b')](respondWithStatusCode(_0xbd9767,null))[_0xade3('0x48')](handleError(_0xbd9767,null));};exports['getSections']=function(_0x432f24,_0x1cb861){var _0x4bbd00=[];var _0x233e3d=[];return db[_0xade3('0x55')]['findAll']({'where':{'userProfileId':_0x432f24['params']['id']},'raw':!![]})[_0xade3('0x2b')](function(_0x198671){_0x4bbd00=_[_0xade3('0x42')](_0x198671,function(_0x3dffbc){return _0x3dffbc[_0xade3('0x61')]===0x1||_[_0xade3('0x62')]([0x3eb,0x709],_0x3dffbc[_0xade3('0x5a')]);});if(!_['isEmpty'](_0x4bbd00)){return _[_0xade3('0x2f')](_0x4bbd00,function(_0x485e3f){return _0x485e3f[_0xade3('0x5a')];});}else{return;}})[_0xade3('0x2b')](function(_0x2ffe23){if(_0x2ffe23)_0x233e3d=_0x2ffe23;if(_[_0xade3('0x62')](_0x233e3d,0x64)){var _0xc401d7=_[_0xade3('0x4b')](_0x4bbd00,{'sectionId':0x64});return hasDefaultDashboard(_0xc401d7)[_0xade3('0x2b')](function(_0x4b652f){return _[_0xade3('0x2f')](_0x4bbd00,function(_0x473fdf){if(_0x473fdf[_0xade3('0x5a')]===0x64){_0x473fdf[_0xade3('0x63')]=_0x4b652f;}return _0x473fdf;});});}else{return;}})[_0xade3('0x2b')](function(_0x4a1a65){if(_0x4a1a65)_0x4bbd00=_0x4a1a65;if(_[_0xade3('0x62')](_0x233e3d,0x3eb)){var _0x12077a=_[_0xade3('0x4b')](_0x4bbd00,{'sectionId':0x3eb});return getCustomDashboards(_0x12077a)[_0xade3('0x2b')](function(_0x13ddfd){return _[_0xade3('0x2f')](_0x4bbd00,function(_0x347667){if(_0x12077a[_0xade3('0x61')]){if(_0x347667[_0xade3('0x5a')]===0x3eb){_0x347667[_0xade3('0x63')]=_0x13ddfd;}}else{if(_0x347667[_0xade3('0x5a')]===0x64){_0x347667[_0xade3('0x63')]=_0x13ddfd;}}return _0x347667;});});}else{return;}})[_0xade3('0x2b')](function(_0x24373){if(_0x24373)_0x4bbd00=_0x24373;if(_[_0xade3('0x62')](_0x233e3d,0x709)){var _0x56e1d4=_[_0xade3('0x4b')](_0x4bbd00,{'sectionId':0x709});return getPlugins(_0x56e1d4)['then'](function(_0x2502b2){if(_0x56e1d4['enabled']){return _[_0xade3('0x2f')](_0x4bbd00,function(_0x1468fe){if(_0x1468fe[_0xade3('0x5a')]===0x709){_0x1468fe[_0xade3('0x63')]=_0x2502b2;}return _0x1468fe;});}else{var _0x16f040={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2502b2};var _0x1339a9=_[_0xade3('0x2f')](_0x4bbd00);_0x1339a9[_0xade3('0x5e')](_0x16f040);return _0x1339a9;}});}else{return;}})[_0xade3('0x2b')](function(_0x5d255c){if(_0x5d255c)_0x4bbd00=_0x5d255c;return _[_0xade3('0x42')](_0x4bbd00,[_0xade3('0x61'),0x1]);})['then'](respondWithResult(_0x1cb861,null))[_0xade3('0x48')](handleError(_0x1cb861,null));};function hasDefaultDashboard(_0x3e0e73){var _0x3ee427=[0x65];return new BPromise(function(_0x20254e,_0x59977e){try{if(_0x3e0e73[_0xade3('0x57')]){_0x20254e(_0x3ee427);}else{return db[_0xade3('0x58')][_0xade3('0x64')]({'where':{'sectionId':_0x3e0e73['id']},'raw':!![]})[_0xade3('0x2b')](function(_0x384446){_0x384446?_0x20254e(_0x3ee427):_0x20254e();});}}catch(_0x29f53f){_0x59977e(_0x29f53f);}});}function getCustomDashboards(_0x2563ae){var _0x4cbe63=[];return new BPromise(function(_0x44fae1,_0x2eb595){try{if(_0x2563ae[_0xade3('0x57')]){return db['Dashboard'][_0xade3('0x46')]({'raw':!![]})[_0xade3('0x2b')](function(_0x1412b1){_0x1412b1[_0xade3('0x65')](function(_0x3bc6fe){_0x4cbe63['push'](_0x3bc6fe['id']+0x1869f);});_0x44fae1(_0x4cbe63);});}else{return db['UserProfileResource'][_0xade3('0x46')]({'where':{'sectionId':_0x2563ae['id']},'raw':!![]})[_0xade3('0x2b')](function(_0x14746c){_0x14746c[_0xade3('0x65')](function(_0x290931){_0x4cbe63[_0xade3('0x5e')](_0x290931[_0xade3('0x66')]+0x1869f);});_0x44fae1(_0x4cbe63);});}}catch(_0x3f6407){_0x2eb595(_0x3f6407);}});}function getPlugins(_0x509932){var _0x49a202=[];return new BPromise(function(_0x375f03,_0xe9f575){try{if(_0x509932['autoAssociation']){return db[_0xade3('0x67')][_0xade3('0x46')]({'raw':!![]})[_0xade3('0x2b')](function(_0x121989){_0x121989['forEach'](function(_0x32c078){_0x49a202[_0xade3('0x5e')](_0x32c078['id']+0x15b38);});_0x375f03(_0x49a202);});}else{return db[_0xade3('0x58')][_0xade3('0x46')]({'where':{'sectionId':_0x509932['id']},'raw':!![]})[_0xade3('0x2b')](function(_0x52d386){_0x52d386['forEach'](function(_0x539e3b){_0x49a202[_0xade3('0x5e')](_0x539e3b['resourceId']+0x15b38);});_0x375f03(_0x49a202);});}}catch(_0x3d014f){_0xe9f575(_0x3d014f);}});}exports[_0xade3('0x68')]=function(_0x20a18a,_0x21d4f4){return db[_0xade3('0x30')][_0xade3('0x4b')]({'where':{'id':_0x20a18a[_0xade3('0x4a')]['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0x21d4f4,null))[_0xade3('0x2b')](function(_0x26cab3){if(_0x26cab3){return db['sequelize'][_0xade3('0x54')](function(_0x193e9c){return db[_0xade3('0x55')]['findAll']({'where':{'userProfileId':_0x20a18a['params']['id']},'attributes':['id'],'raw':!![]})[_0xade3('0x2b')](function(_0x3f02cf){if(_0x3f02cf){return db[_0xade3('0x55')]['destroy']({'where':{'userProfileId':_0x20a18a[_0xade3('0x4a')]['id'],'id':_['map'](_0x3f02cf,function(_0x40d115){return _0x40d115['id'];})},'transaction':_0x193e9c});}})[_0xade3('0x2b')](function(_0x1f290e){var _0x52b055=_[_0xade3('0x2f')](_0x20a18a[_0xade3('0x4d')],function(_0x33288d){_0x33288d[_0xade3('0x69')]=_0x20a18a[_0xade3('0x4a')]['id'];return _0x33288d;});return db[_0xade3('0x55')][_0xade3('0x6a')](_0x52b055,{'raw':!![],'transaction':_0x193e9c});})[_0xade3('0x2b')](function(_0x436900){var _0x46800d=_['filter'](_[_0xade3('0x2f')](_0x436900,function(_0x2b7539){return _0x2b7539[_0xade3('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x46800d){return db[_0xade3('0x55')]['findAll']({'where':{'userProfileId':_0x20a18a[_0xade3('0x4a')]['id'],'sectionId':_[_0xade3('0x2f')](_0x46800d,function(_0x362c3b){return _0x362c3b[_0xade3('0x5a')];})},'attributes':['id',_0xade3('0x5a')],'raw':!![]})[_0xade3('0x2b')](function(_0x2433ba){var _0x4433c6=_[_0xade3('0x2f')](_0x20a18a['body'],function(_0xee30a4){_0xee30a4[_0xade3('0x69')]=_0x20a18a[_0xade3('0x4a')]['id'];return _0xee30a4;});return db['UserProfileResource'][_0xade3('0x6a')](_0x4433c6,{'raw':!![],'transaction':_0x193e9c});});}})['catch'](handleError(_0x21d4f4,null));});}})['then'](function(_0x108c19){var _0x59681a=_[_0xade3('0x2f')](_0x108c19,function(_0xf6d348){return _0xf6d348['get']({'plain':!![]});});})[_0xade3('0x2b')](respondWithResult(_0x21d4f4,null))[_0xade3('0x48')](handleError(_0x21d4f4,null));};exports['removeResources']=function(_0x5862ae,_0x44ffac,_0x45ac40){return db[_0xade3('0x30')][_0xade3('0x4b')]({'where':{'id':_0x5862ae[_0xade3('0x4a')]['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0x44ffac,null))['then'](function(_0x271e22){if(_0x271e22){return _0x271e22[_0xade3('0x6b')](_0x5862ae[_0xade3('0x35')][_0xade3('0x60')]);}})[_0xade3('0x2b')](respondWithStatusCode(_0x44ffac,null))[_0xade3('0x48')](handleError(_0x44ffac,null));};exports['getResources']=function(_0x1fb719,_0x5ef247){var _0x2a885b={};if(!_0x1fb719[_0xade3('0x35')][_0xade3('0x6c')])throw new Error(_0xade3('0x6d'));if(!_0x1fb719[_0xade3('0x35')][_0xade3('0x6e')]('nolimit')){_0x2a885b[_0xade3('0x24')]=qs[_0xade3('0x24')](_0x1fb719[_0xade3('0x35')][_0xade3('0x24')]);_0x2a885b['offset']=qs[_0xade3('0x21')](_0x1fb719[_0xade3('0x35')]['offset']);}return db[_0xade3('0x30')]['find']({'where':{'id':_0x1fb719[_0xade3('0x4a')]['id']}})[_0xade3('0x2b')](function(_0x2e84bc){if(!_0x2e84bc)throw new Error(_0xade3('0x6f')+_0x1fb719['params']['id']);return db[_0xade3('0x30')][_0xade3('0x70')](_0x1fb719);})[_0xade3('0x2b')](respondWithFilteredResult(_0x5ef247,_0x2a885b))[_0xade3('0x48')](handleError(_0x5ef247,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a7761de..2c2d7da 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 _0x3837=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x3837,0x1d1));var _0x7383=function(_0x11ecad,_0x2003d9){_0x11ecad=_0x11ecad-0x0;var _0x2e4fdf=_0x3837[_0x11ecad];return _0x2e4fdf;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7383('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7383('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7383('0x2'),'afterDestroy':_0x7383('0x3')};function emitEvent(_0x49878d){return function(_0x227ab2,_0xf57468,_0x53485d){UserProfileEvents['emit'](_0x49878d+':'+_0x227ab2['id'],_0x227ab2);UserProfileEvents[_0x7383('0x4')](_0x49878d,_0x227ab2);_0x53485d(null);};}for(var e in events){if(events[_0x7383('0x5')](e)){var event=events[e];UserProfile[_0x7383('0x6')](e,emitEvent(event));}}module[_0x7383('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x6365=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners','update'];(function(_0x47695e,_0x119372){var _0x515a9c=function(_0x2cd0ce){while(--_0x2cd0ce){_0x47695e['push'](_0x47695e['shift']());}};_0x515a9c(++_0x119372);}(_0x6365,0x148));var _0x5636=function(_0x490909,_0xb3917f){_0x490909=_0x490909-0x0;var _0x4741b1=_0x6365[_0x490909];return _0x4741b1;};'use strict';var EventEmitter=require(_0x5636('0x0'));var UserProfile=require(_0x5636('0x1'))['db'][_0x5636('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5636('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5636('0x4'),'afterDestroy':_0x5636('0x5')};function emitEvent(_0x355be7){return function(_0x27e6da,_0x34ca1e,_0x4ad69d){UserProfileEvents[_0x5636('0x6')](_0x355be7+':'+_0x27e6da['id'],_0x27e6da);UserProfileEvents[_0x5636('0x6')](_0x355be7,_0x27e6da);_0x4ad69d(null);};}for(var e in events){if(events[_0x5636('0x7')](e)){var event=events[e];UserProfile[_0x5636('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index a8671e3..e66503c 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 _0x5d58=['rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','VIRTUAL','find','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','reportId','CustomReports','count','rows','CmContact','Tag','Tags','color','tag','true','chat','dataValues','fax','mail','openchannel','whatsapp','filter','field','findAll','associatedResources','map','model','then','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','childModel','SquareProject','odbc','SquareOdbc','parentSections','SquareProjects','name','projects','JscriptyProject','contacts','Lists','ListId','lists','CmCompany','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','FaxQueue','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','membername','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','type','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','zendeskaccounts','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','Template','triggers','Trigger','variables','Variable','plugins','Reports','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','query','toString','define','UserProfile','user_profiles','Invalid\x20section\x20\x27','UserProfileSection','all','ignore','isEmpty','union','length','push'];(function(_0xb3fdbb,_0x1df1fd){var _0x2798d3=function(_0xf7249b){while(--_0xf7249b){_0xb3fdbb['push'](_0xb3fdbb['shift']());}};_0x2798d3(++_0x1df1fd);}(_0x5d58,0x187));var _0x85d5=function(_0x1979d0,_0x3d5549){_0x1979d0=_0x1979d0-0x0;var _0x53729c=_0x5d58[_0x1979d0];return _0x53729c;};'use strict';var _=require('lodash');var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module['exports']=function(_0x64d32c){var _0x1eff3b=_0x64d32c['models'];function _0x1469fc(_0x30bfe8,_0x54207b){return new Promise(function(_0x1eb211,_0x2d457a){if(!_0x54207b)return _0x1eb211(null);var _0x578fad=_0x54207b[_0x85d5('0x0')]?{[_0x54207b['filter'][_0x85d5('0x1')]]:_0x54207b[_0x85d5('0x0')]['value']}:undefined;return _0x1eff3b[_0x30bfe8][_0x85d5('0x2')]({'where':_0x578fad,'raw':!![]})['then'](function(_0x1098be){_0x54207b[_0x85d5('0x3')]=_[_0x85d5('0x4')](_0x1098be,'id');_0x1eb211(_0x54207b);})['catch'](function(_0x499b36){_0x2d457a(_0x499b36);});});}function _0x4e147a(_0x1a2b82,_0x12a681){return new Promise(function(_0xde1063,_0x25369e){var _0x229355=_0x1a2b82[_0x85d5('0x0')]?{[_0x1a2b82[_0x85d5('0x0')]['field']]:_0x1a2b82['filter']['value']}:undefined;return _0x1eff3b[_0x1a2b82[_0x85d5('0x5')]][_0x85d5('0x2')]({'where':_0x229355,'raw':!![]})[_0x85d5('0x6')](function(_0x1704f0){_0x12a681[_0x85d5('0x3')]=_[_0x85d5('0x4')](_0x1704f0,function(_0x1545b4){return _0x1545b4['name'];});_0xde1063(_0x12a681);})[_0x85d5('0x7')](function(_0x2d7c95){_0x25369e(_0x2d7c95);});});}function _0x1621ed(_0x3da3f4,_0x19f7d5,_0x3dc83c){if(!_0x19f7d5)return Promise[_0x85d5('0x8')](null);return new Promise(function(_0x12bef9,_0x17652b){return _0x1eff3b[_0x85d5('0x9')][_0x85d5('0x2')]({'where':{'sectionId':_0x19f7d5['id']},'raw':!![]})[_0x85d5('0x6')](function(_0x34b981){if(_0x3da3f4[_0x85d5('0x1')]&&_0x3da3f4[_0x85d5('0x1')]!=='id'){_0x19f7d5[_0x85d5('0x3')]=_[_0x85d5('0x4')](_0x34b981,function(_0x1d6134){return _0x1d6134[_0x3da3f4['field']];});}else{if(_0x3dc83c===_0x85d5('0xa')){_0x19f7d5[_0x85d5('0x3')]=_['map'](_0x34b981,function(_0x231b57){return{'id':_0x231b57[_0x85d5('0xb')],'type':_0x231b57['type']};});}else{_0x19f7d5['associatedResources']=_[_0x85d5('0x4')](_0x34b981,function(_0x5a1b9a){return _0x5a1b9a[_0x85d5('0xb')];});}}_0x12bef9(_0x19f7d5);})['catch'](function(_0x240000){_0x17652b(_0x240000);});});}function _0x1f8d27(_0x560b3a,_0x4e11c4){var _0x4da71b={'parentSections':[]};switch(_0x560b3a['toLowerCase']()){case _0x85d5('0xc'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0xe');break;case _0x85d5('0xf'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x10');break;case'squarerecordings':_0x4da71b[_0x85d5('0xd')]='SquareRecording';_0x4da71b[_0x85d5('0x11')]=[{'name':_0x85d5('0x12'),'field':_0x85d5('0x13'),'foreignKey':'projectName'}];break;case _0x85d5('0x14'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x15');break;case _0x85d5('0x16'):_0x4da71b[_0x85d5('0xd')]='CmContact';_0x4da71b[_0x85d5('0x11')]=[{'name':_0x85d5('0x17'),'field':'id','foreignKey':_0x85d5('0x18')}];break;case _0x85d5('0x19'):_0x4da71b[_0x85d5('0xd')]='CmList';break;case'companies':_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x1a');break;case _0x85d5('0x1b'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x1c');break;case'chatqueues':_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x1d');break;case'chatwebsites':_0x4da71b['childModel']=_0x85d5('0x1e');break;case _0x85d5('0x1f'):_0x4da71b['childModel']=_0x85d5('0x20');break;case'faxaccounts':_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x21');break;case'inboundroutes':case _0x85d5('0x22'):case _0x85d5('0x23'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x24');break;case'contexts':_0x4da71b['childModel']=_0x85d5('0x25');break;case _0x85d5('0x26'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x27');break;case _0x85d5('0x28'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x29');_0x4da71b[_0x85d5('0x11')]=[{'name':_0x85d5('0x2a'),'field':'name','foreignKey':'membername','model':_0x85d5('0x2b'),'filter':{'field':_0x85d5('0x2c'),'value':[_0x85d5('0x2d')]}},{'name':_0x85d5('0x2e'),'field':_0x85d5('0x13'),'foreignKey':_0x85d5('0x2f'),'model':_0x85d5('0x2b'),'filter':{'field':_0x85d5('0x2c'),'value':['telephone']}},{'name':_0x85d5('0x30'),'field':_0x85d5('0x13'),'foreignKey':_0x85d5('0x31'),'model':_0x85d5('0x32'),'filter':{'field':'type','value':[_0x85d5('0x33')]}},{'name':_0x85d5('0x34'),'field':_0x85d5('0x13'),'foreignKey':_0x85d5('0x31'),'model':'VoiceQueue','filter':{'field':_0x85d5('0x35'),'value':['outbound']}}];break;case'musiconholds':_0x4da71b[_0x85d5('0xd')]='VoiceMusicOnHold';break;case _0x85d5('0x36'):_0x4da71b['childModel']='VoiceChanSpy';break;case _0x85d5('0x37'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x38');break;case _0x85d5('0x39'):_0x4da71b[_0x85d5('0xd')]='Campaign';break;case'mailqueues':_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x3a');break;case _0x85d5('0x3b'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x3c');break;case _0x85d5('0x3d'):_0x4da71b['childModel']='MailSubstatus';break;case _0x85d5('0x3e'):_0x4da71b['childModel']=_0x85d5('0x3f');break;case _0x85d5('0x40'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x41');break;case _0x85d5('0x42'):_0x4da71b['childModel']='SmsQueue';break;case _0x85d5('0x43'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x44');break;case _0x85d5('0x45'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x46');break;case _0x85d5('0x47'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x48');break;case _0x85d5('0x49'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x4a');break;case _0x85d5('0x4b'):case _0x85d5('0x4c'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x32');if(_0x4e11c4){_0x4da71b[_0x85d5('0x11')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x85d5('0x4d'):case _0x85d5('0x4e'):case _0x85d5('0x4f'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x2b');if(_0x4e11c4){_0x4da71b[_0x85d5('0x11')]=[{'name':'Users','filter':{'field':_0x85d5('0x2c'),'value':['admin','user']},'ignore':!![]},{'name':_0x85d5('0x2a')},{'name':_0x85d5('0x2e')}];}break;case _0x85d5('0x50'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x51');break;case'salesforceaccounts':_0x4da71b[_0x85d5('0xd')]='SalesforceAccount';break;case _0x85d5('0x52'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x53');break;case'sugarcrmaccounts':_0x4da71b['childModel']='SugarcrmAccount';break;case _0x85d5('0x54'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x55');break;case'zohoaccounts':_0x4da71b['childModel']=_0x85d5('0x56');break;case _0x85d5('0x57'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x2b');break;case'cannedanswers':_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x58');break;case _0x85d5('0x59'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x5a');break;case _0x85d5('0x5b'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x5c');break;case _0x85d5('0x5d'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x5e');break;case _0x85d5('0x5f'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x60');break;case _0x85d5('0x61'):_0x4da71b['childModel']=_0x85d5('0x62');break;case _0x85d5('0x63'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x64');break;case'tags':_0x4da71b[_0x85d5('0xd')]='Tag';break;case _0x85d5('0x65'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x66');break;case _0x85d5('0x67'):_0x4da71b['childModel']=_0x85d5('0x68');break;case'trunks':_0x4da71b['childModel']='Trunk';break;case _0x85d5('0x69'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x6a');break;case _0x85d5('0x6b'):_0x4da71b[_0x85d5('0xd')]='Plugin';break;case'extractedreports':_0x4da71b[_0x85d5('0xd')]=_0x85d5('0xa');_0x4da71b[_0x85d5('0x11')]=[{'name':_0x85d5('0x6c'),'field':'id','foreignKey':'reportId'}];break;case _0x85d5('0x6d'):_0x4da71b[_0x85d5('0xd')]=_0x85d5('0x6e');break;}return _0x4da71b;}function _0x54b9ab(_0x565ebe,_0x3ed683){var _0x404451=_0x565ebe[_0x85d5('0x6f')](0x0)['toUpperCase']()+_0x565ebe[_0x85d5('0x70')](0x1);var _0x3e7263={'type':_0x1eff3b[_0x85d5('0x71')][_0x85d5('0x72')]['SELECT'],'raw':!![]};return new Promise(function(_0x259942,_0x35c0e1){var _0x720309=squel['select']()[_0x85d5('0x1')](_0x85d5('0x73')+_0x404451+_0x85d5('0x74'),'id')['field'](_0x85d5('0x75'))[_0x85d5('0x76')]('user_has_'+_0x565ebe+_0x85d5('0x77'),'ui')['where'](_0x85d5('0x78'),_0x3ed683['id']);return _0x1eff3b['sequelize'][_0x85d5('0x79')](_0x720309[_0x85d5('0x7a')](),_0x3e7263)[_0x85d5('0x6')](function(_0x33c486){_0x3ed683[_0x404451+'OpenTabs']=_0x33c486;_0x259942(_0x33c486);})[_0x85d5('0x7')](function(_0x38a2fd){_0x35c0e1(_0x38a2fd);});});}return _0x64d32c[_0x85d5('0x7b')](_0x85d5('0x7c'),attributes,{'tableName':_0x85d5('0x7d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x226795){var _0x3236b5={'raw':![],'where':{}};var _0x390c3a={};var _0x5cf0a6={'count':0x0,'rows':[]};var _0x5d67d1=_0x226795[_0x85d5('0x79')]['section'];var _0x29e17f=_0x226795[_0x85d5('0x79')]['mergeResources']||![];var _0x580322=_0x1f8d27(_0x5d67d1,_0x29e17f);if(!_0x580322[_0x85d5('0xd')])throw new Error(_0x85d5('0x7e')+_0x5d67d1+'\x27');var _0x4266ae=[{'name':_0x5d67d1}];if(!_['isEmpty'](_0x580322[_0x85d5('0x11')]))_0x4266ae=_0x580322[_0x85d5('0x11')];var _0x123422=[];for(var _0x2aa68f=0x0;_0x2aa68f<_0x4266ae['length'];_0x2aa68f++){_0x123422['push'](_0x1eff3b[_0x85d5('0x7f')]['find']({'where':{'userProfileId':_0x226795['params']['id'],'name':_0x4266ae[_0x2aa68f][_0x85d5('0x13')]},'raw':!![]}));}return Promise[_0x85d5('0x80')](_0x123422)[_0x85d5('0x6')](function(_0x556af9){var _0x576714=_[_0x85d5('0x0')](_0x556af9,function(_0x67ae8d){return _0x67ae8d?_0x67ae8d:undefined;});var _0x291298=_['filter'](_0x4266ae,[_0x85d5('0x81'),!![]]);var _0x353236=_[_0x85d5('0x82')](_0x576714)&&_[_0x85d5('0x82')](_0x291298)?null:_[_0x85d5('0x83')](_0x291298,_0x576714);if(!_0x353236)return null;var _0x2b3421=[];for(var _0x361a01=0x0;_0x361a01<_0x353236[_0x85d5('0x84')];_0x361a01++){var _0x4f80dd=_['find'](_0x4266ae,function(_0x2a0a59){return _0x353236[_0x361a01]?_0x2a0a59[_0x85d5('0x13')]===_0x353236[_0x361a01][_0x85d5('0x13')]:null;});if(_0x4f80dd){if(_0x353236[_0x361a01]['ignore']){_0x2b3421[_0x85d5('0x85')](_0x1469fc(_0x580322[_0x85d5('0xd')],_0x353236[_0x361a01]));}else{if(!_0x353236[_0x361a01]['autoAssociation']){_0x2b3421[_0x85d5('0x85')](_0x1621ed(_0x4f80dd,_0x353236[_0x361a01],_0x580322[_0x85d5('0xd')]));}else{if(_0x4f80dd[_0x85d5('0x5')]){_0x2b3421[_0x85d5('0x85')](_0x4e147a(_0x4f80dd,_0x353236[_0x361a01]));}}}}}return Promise[_0x85d5('0x80')](_0x2b3421);})['then'](function(_0x35ba15){var _0x1b96eb=_0x35ba15;var _0x46f825=null;if(_0x1b96eb){_0x46f825=_0x1b96eb[_0x85d5('0x84')]===0x1?_0x1b96eb[0x0]:null;}if(!_0x46f825&&!_0x1b96eb)return _0x5cf0a6;var _0x17a33b=_0x1eff3b[_0x580322['childModel']][_0x85d5('0x86')];_0x390c3a[_0x85d5('0x5')]=_[_0x85d5('0x87')](_0x17a33b);_0x390c3a[_0x85d5('0x79')]=_[_0x85d5('0x87')](_0x226795[_0x85d5('0x79')]);_0x390c3a[_0x85d5('0x88')]=_[_0x85d5('0x89')](_0x390c3a[_0x85d5('0x5')],_0x390c3a[_0x85d5('0x79')]);_0x3236b5['attributes']=_[_0x85d5('0x89')](_0x390c3a[_0x85d5('0x5')],qs[_0x85d5('0x8a')](_0x226795[_0x85d5('0x79')][_0x85d5('0x8a')]));_0x3236b5[_0x85d5('0x8b')]=_0x3236b5['attributes'][_0x85d5('0x84')]?_0x3236b5['attributes']:_0x390c3a['model'];if(!_0x226795[_0x85d5('0x79')][_0x85d5('0x8c')](_0x85d5('0x8d'))){_0x3236b5[_0x85d5('0x8e')]=qs[_0x85d5('0x8e')](_0x226795[_0x85d5('0x79')][_0x85d5('0x8e')]);_0x3236b5[_0x85d5('0x8f')]=qs[_0x85d5('0x8f')](_0x226795['query'][_0x85d5('0x8f')]);}_0x3236b5[_0x85d5('0x90')]=qs[_0x85d5('0x91')](_0x226795[_0x85d5('0x79')][_0x85d5('0x91')]);_0x3236b5[_0x85d5('0x92')]=qs[_0x85d5('0x88')](_[_0x85d5('0x93')](_0x226795[_0x85d5('0x79')],_0x390c3a[_0x85d5('0x88')]));if(_0x226795[_0x85d5('0x79')][_0x85d5('0x0')]){_0x3236b5[_0x85d5('0x92')]=_[_0x85d5('0x94')](_0x3236b5[_0x85d5('0x92')],{'$or':_['map'](_0x17a33b,function(_0x52243a){if(_0x52243a[_0x85d5('0x35')]['key']!==_0x85d5('0x95')){var _0xa18a5e={};_0xa18a5e[_0x52243a[_0x85d5('0x1')]]={'$like':'%'+_0x226795[_0x85d5('0x79')][_0x85d5('0x0')]+'%'};return _0xa18a5e;}})});}var _0x182933=[];var _0x3c14d0=null;var _0xdeef5e={};if(_0x46f825){_0x3c14d0=_[_0x85d5('0x96')](_0x4266ae,['name',_0x46f825[_0x85d5('0x13')]]);if(_0x3c14d0[_0x85d5('0x1')]){_0xdeef5e={};if(_0x580322['childModel']===_0x85d5('0xa')){_0xdeef5e[_0x3c14d0['foreignKey']]=_[_0x85d5('0x4')](_0x46f825[_0x85d5('0x3')],'id');}else{_0xdeef5e[_0x3c14d0[_0x85d5('0x97')]]=_0x46f825[_0x85d5('0x3')];}_0x182933['push'](_0xdeef5e);}else{_0x3236b5[_0x85d5('0x92')]['id']=_0x46f825[_0x85d5('0x3')];}}else{for(var _0x59d51b=0x0;_0x59d51b<_0x1b96eb[_0x85d5('0x84')];_0x59d51b++){_0x3c14d0=_[_0x85d5('0x96')](_0x4266ae,['name',_0x1b96eb[_0x59d51b][_0x85d5('0x13')]]);if(_0x3c14d0[_0x85d5('0x1')]){_0xdeef5e={};_0xdeef5e[_0x3c14d0[_0x85d5('0x97')]]=_0x1b96eb[_0x59d51b]['associatedResources'];_0x182933[_0x85d5('0x85')](_0xdeef5e);}else{if(!_0x3236b5[_0x85d5('0x92')]['id'])_0x3236b5[_0x85d5('0x92')]['id']=[];_0x1b96eb[_0x59d51b][_0x85d5('0x3')][_0x85d5('0x98')](function(_0x1e45e5){_0x3236b5['where']['id'][_0x85d5('0x85')](_0x1e45e5);});}}}if(!_[_0x85d5('0x82')](_0x182933)){_0x3236b5['where']=_[_0x85d5('0x94')](_0x3236b5['where'],{'$and':{'$or':_0x182933}});}_0x3236b5=_[_0x85d5('0x94')]({},_0x3236b5,_0x226795[_0x85d5('0x99')]);if(_0x46f825&&!_0x46f825[_0x85d5('0x9a')]&&_0x580322['childModel']===_0x85d5('0xa')){if(_0x226795[_0x85d5('0x79')][_0x85d5('0x9b')]){_0x3236b5[_0x85d5('0x9c')]=[{'all':!![]}];}return _0x1eff3b[_0x580322[_0x85d5('0xd')]]['findAll'](_0x3236b5)[_0x85d5('0x6')](function(_0x29ca79){var _0xbbff78=[];_0x29ca79[_0x85d5('0x98')](function(_0x599c49){var _0x1764b0;switch(_0x599c49[_0x85d5('0x9d')]){case _0x85d5('0x9e'):_0x1764b0=_['find'](_0x46f825[_0x85d5('0x3')],function(_0x55d388){return _0x55d388['id']===_0x599c49[_0x85d5('0x9f')]&&_0x55d388[_0x85d5('0x35')]==='DefaultReports';});break;case'custom':_0x1764b0=_[_0x85d5('0x96')](_0x46f825[_0x85d5('0x3')],function(_0x3f8420){return _0x3f8420['id']===_0x599c49[_0x85d5('0x9f')]&&_0x3f8420[_0x85d5('0x35')]===_0x85d5('0xa0');});break;}if(_0x1764b0)_0xbbff78[_0x85d5('0x85')](_0x599c49);});_0x5cf0a6[_0x85d5('0xa1')]=_0xbbff78['length'];_0x5cf0a6[_0x85d5('0xa2')]=_0xbbff78;return _0x5cf0a6;});}else{return _0x1eff3b[_0x580322[_0x85d5('0xd')]][_0x85d5('0xa1')]({'where':_0x3236b5['where']})[_0x85d5('0x6')](function(_0x393a29){_0x5cf0a6['count']=_0x393a29;if(_0x226795[_0x85d5('0x79')][_0x85d5('0x9b')]){if(_0x580322[_0x85d5('0xd')]===_0x85d5('0xa3')){_0x3236b5[_0x85d5('0x9c')]=[{'model':_0x1eff3b[_0x85d5('0xa4')],'as':_0x85d5('0xa5'),'attributes':['id','name',_0x85d5('0xa6')],'required':_0x226795[_0x85d5('0x79')][_0x85d5('0xa7')]?!![]:![]},{'model':_0x1eff3b[_0x85d5('0xa4')],'as':'ThroughTags','attributes':['id',_0x85d5('0x13'),_0x85d5('0xa6')],'through':_0x226795[_0x85d5('0x79')][_0x85d5('0xa7')]?{'attributes':[],'where':{'TagId':_0x226795[_0x85d5('0x79')]['tag']||undefined}}:{},'required':_0x226795['query'][_0x85d5('0xa7')]?!![]:![]}];}else{_0x3236b5['include']=[{'all':!![]}];}}return _0x1eff3b[_0x580322[_0x85d5('0xd')]][_0x85d5('0x2')](_0x3236b5);})[_0x85d5('0x6')](function(_0xc595b5){_0x5cf0a6[_0x85d5('0xa2')]=_0xc595b5;if(_0x5d67d1===_0x85d5('0x2a')&&_0x226795[_0x85d5('0x79')]['openTabs']===_0x85d5('0xa8')){var _0x5366bc=[];for(var _0x26fbbe=0x0;_0x26fbbe<_0x5cf0a6[_0x85d5('0xa2')][_0x85d5('0x84')];_0x26fbbe++){_0x5366bc['push'](_0x54b9ab(_0x85d5('0xa9'),_0x5cf0a6[_0x85d5('0xa2')][_0x26fbbe][_0x85d5('0xaa')]));_0x5366bc['push'](_0x54b9ab('sms',_0x5cf0a6[_0x85d5('0xa2')][_0x26fbbe][_0x85d5('0xaa')]));_0x5366bc['push'](_0x54b9ab(_0x85d5('0xab'),_0x5cf0a6[_0x85d5('0xa2')][_0x26fbbe]['dataValues']));_0x5366bc[_0x85d5('0x85')](_0x54b9ab(_0x85d5('0xac'),_0x5cf0a6[_0x85d5('0xa2')][_0x26fbbe][_0x85d5('0xaa')]));_0x5366bc[_0x85d5('0x85')](_0x54b9ab(_0x85d5('0xad'),_0x5cf0a6[_0x85d5('0xa2')][_0x26fbbe]['dataValues']));_0x5366bc[_0x85d5('0x85')](_0x54b9ab(_0x85d5('0xae'),_0x5cf0a6[_0x85d5('0xa2')][_0x26fbbe][_0x85d5('0xaa')]));}return Promise['all'](_0x5366bc)['then'](function(){return _0x5cf0a6;});}return _0x5cf0a6;});}});}}});}; \ No newline at end of file +var _0x2ef3=['squel','exports','models','filter','field','value','findAll','then','associatedResources','map','name','UserProfileResource','AnalyticExtractedReport','type','resourceId','catch','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceRecording','Agents','User','role','agent','membername','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users','agents','telephones','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','variables','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','ui.createdAt','user_has_','_interactions','where','query','define','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','all','ignore','union','autoAssociation','rawAttributes','model','keys','filters','attributes','intersection','hasOwnProperty','limit','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','reportType','DefaultReports','custom','CustomReports','rows','count','include','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs'];(function(_0xa98b7b,_0x19d6df){var _0x3ef9f5=function(_0x5eec17){while(--_0x5eec17){_0xa98b7b['push'](_0xa98b7b['shift']());}};_0x3ef9f5(++_0x19d6df);}(_0x2ef3,0xba));var _0x32ef=function(_0x81e6c3,_0x3ebc3d){_0x81e6c3=_0x81e6c3-0x0;var _0x1f1a0e=_0x2ef3[_0x81e6c3];return _0x1f1a0e;};'use strict';var _=require(_0x32ef('0x0'));var attributes=require(_0x32ef('0x1'));var qs=require(_0x32ef('0x2'));var squel=require(_0x32ef('0x3'));module[_0x32ef('0x4')]=function(_0x38047b){var _0x48106c=_0x38047b[_0x32ef('0x5')];function _0x38b7f3(_0x524ab6,_0x402857){return new Promise(function(_0x37dd1d,_0x4c8104){if(!_0x402857)return _0x37dd1d(null);var _0x5dfa09=_0x402857[_0x32ef('0x6')]?{[_0x402857[_0x32ef('0x6')][_0x32ef('0x7')]]:_0x402857[_0x32ef('0x6')][_0x32ef('0x8')]}:undefined;return _0x48106c[_0x524ab6][_0x32ef('0x9')]({'where':_0x5dfa09,'raw':!![]})[_0x32ef('0xa')](function(_0x2bbb50){_0x402857[_0x32ef('0xb')]=_[_0x32ef('0xc')](_0x2bbb50,'id');_0x37dd1d(_0x402857);})['catch'](function(_0x5780e9){_0x4c8104(_0x5780e9);});});}function _0x401d0b(_0x33281d,_0x45bfd5){return new Promise(function(_0x1499c2,_0x5af651){var _0x193714=_0x33281d['filter']?{[_0x33281d[_0x32ef('0x6')]['field']]:_0x33281d[_0x32ef('0x6')][_0x32ef('0x8')]}:undefined;return _0x48106c[_0x33281d['model']]['findAll']({'where':_0x193714,'raw':!![]})[_0x32ef('0xa')](function(_0x4d8009){_0x45bfd5[_0x32ef('0xb')]=_[_0x32ef('0xc')](_0x4d8009,function(_0x93d492){return _0x93d492[_0x32ef('0xd')];});_0x1499c2(_0x45bfd5);})['catch'](function(_0x55bf0b){_0x5af651(_0x55bf0b);});});}function _0x531e30(_0x13db1a,_0x3950e6,_0xb5aed2){if(!_0x3950e6)return Promise['resolve'](null);return new Promise(function(_0x5d559b,_0x1eb468){return _0x48106c[_0x32ef('0xe')][_0x32ef('0x9')]({'where':{'sectionId':_0x3950e6['id']},'raw':!![]})['then'](function(_0xbe37f6){if(_0x13db1a[_0x32ef('0x7')]&&_0x13db1a['field']!=='id'){_0x3950e6[_0x32ef('0xb')]=_[_0x32ef('0xc')](_0xbe37f6,function(_0x26aff3){return _0x26aff3[_0x13db1a[_0x32ef('0x7')]];});}else{if(_0xb5aed2===_0x32ef('0xf')){_0x3950e6[_0x32ef('0xb')]=_['map'](_0xbe37f6,function(_0x3c5b78){return{'id':_0x3c5b78['resourceId'],'type':_0x3c5b78[_0x32ef('0x10')]};});}else{_0x3950e6[_0x32ef('0xb')]=_['map'](_0xbe37f6,function(_0x1af371){return _0x1af371[_0x32ef('0x11')];});}}_0x5d559b(_0x3950e6);})[_0x32ef('0x12')](function(_0x55f7f2){_0x1eb468(_0x55f7f2);});});}function _0x57f5e5(_0x22f2d7,_0xb30fab){var _0x225feb={'parentSections':[]};switch(_0x22f2d7['toLowerCase']()){case'squareprojects':_0x225feb[_0x32ef('0x13')]='SquareProject';break;case'odbc':_0x225feb[_0x32ef('0x13')]=_0x32ef('0x14');break;case _0x32ef('0x15'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x16');_0x225feb[_0x32ef('0x17')]=[{'name':_0x32ef('0x18'),'field':_0x32ef('0xd'),'foreignKey':_0x32ef('0x19')}];break;case _0x32ef('0x1a'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x1b');break;case'contacts':_0x225feb[_0x32ef('0x13')]=_0x32ef('0x1c');_0x225feb['parentSections']=[{'name':_0x32ef('0x1d'),'field':'id','foreignKey':_0x32ef('0x1e')}];break;case _0x32ef('0x1f'):_0x225feb[_0x32ef('0x13')]='CmList';break;case _0x32ef('0x20'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x21');break;case _0x32ef('0x22'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x23');break;case _0x32ef('0x24'):_0x225feb['childModel']=_0x32ef('0x25');break;case'chatwebsites':_0x225feb[_0x32ef('0x13')]=_0x32ef('0x26');break;case'faxqueues':_0x225feb[_0x32ef('0x13')]=_0x32ef('0x27');break;case _0x32ef('0x28'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x29');break;case'inboundroutes':case'internalroutes':case _0x32ef('0x2a'):_0x225feb['childModel']=_0x32ef('0x2b');break;case _0x32ef('0x2c'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x2d');break;case _0x32ef('0x2e'):_0x225feb[_0x32ef('0x13')]='VoiceMail';break;case'voicerecordings':_0x225feb['childModel']=_0x32ef('0x2f');_0x225feb[_0x32ef('0x17')]=[{'name':_0x32ef('0x30'),'field':'name','foreignKey':'membername','model':_0x32ef('0x31'),'filter':{'field':_0x32ef('0x32'),'value':[_0x32ef('0x33')]}},{'name':'Telephones','field':'name','foreignKey':_0x32ef('0x34'),'model':_0x32ef('0x31'),'filter':{'field':_0x32ef('0x32'),'value':[_0x32ef('0x35')]}},{'name':_0x32ef('0x36'),'field':_0x32ef('0xd'),'foreignKey':_0x32ef('0x37'),'model':_0x32ef('0x38'),'filter':{'field':_0x32ef('0x10'),'value':['inbound']}},{'name':_0x32ef('0x39'),'field':_0x32ef('0xd'),'foreignKey':_0x32ef('0x37'),'model':'VoiceQueue','filter':{'field':_0x32ef('0x10'),'value':[_0x32ef('0x3a')]}}];break;case _0x32ef('0x3b'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x3c');break;case _0x32ef('0x3d'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x3e');break;case _0x32ef('0x3f'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x40');break;case _0x32ef('0x41'):_0x225feb['childModel']=_0x32ef('0x42');break;case _0x32ef('0x43'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x44');break;case _0x32ef('0x45'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x46');break;case'mailsubstatuses':_0x225feb['childModel']=_0x32ef('0x47');break;case _0x32ef('0x48'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x49');break;case'openchannelaccounts':_0x225feb[_0x32ef('0x13')]=_0x32ef('0x4a');break;case'smsqueues':_0x225feb[_0x32ef('0x13')]='SmsQueue';break;case _0x32ef('0x4b'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x4c');break;case _0x32ef('0x4d'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x4e');break;case _0x32ef('0x4f'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x50');break;case _0x32ef('0x51'):_0x225feb['childModel']=_0x32ef('0x52');break;case'voicequeues':case _0x32ef('0x53'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x38');if(_0xb30fab){_0x225feb['parentSections']=[{'name':_0x32ef('0x36')},{'name':_0x32ef('0x39')}];}break;case _0x32ef('0x54'):case _0x32ef('0x55'):case _0x32ef('0x56'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x31');if(_0xb30fab){_0x225feb['parentSections']=[{'name':'Users','filter':{'field':_0x32ef('0x32'),'value':[_0x32ef('0x57'),_0x32ef('0x58')]},'ignore':!![]},{'name':_0x32ef('0x30')},{'name':_0x32ef('0x59')}];}break;case _0x32ef('0x5a'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x5b');break;case _0x32ef('0x5c'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x5d');break;case _0x32ef('0x5e'):_0x225feb[_0x32ef('0x13')]='FreshdeskAccount';break;case _0x32ef('0x5f'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x60');break;case _0x32ef('0x61'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x62');break;case _0x32ef('0x63'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x64');break;case _0x32ef('0x65'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x31');break;case _0x32ef('0x66'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x67');break;case _0x32ef('0x68'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x69');break;case'customdashboards':_0x225feb['childModel']=_0x32ef('0x6a');break;case _0x32ef('0x6b'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x6c');break;case _0x32ef('0x6d'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x6e');break;case _0x32ef('0x6f'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x70');break;case _0x32ef('0x71'):_0x225feb['childModel']=_0x32ef('0x72');break;case _0x32ef('0x73'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x74');break;case _0x32ef('0x75'):_0x225feb[_0x32ef('0x13')]='Template';break;case _0x32ef('0x76'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0x77');break;case'trunks':_0x225feb[_0x32ef('0x13')]='Trunk';break;case _0x32ef('0x78'):_0x225feb[_0x32ef('0x13')]='Variable';break;case _0x32ef('0x79'):_0x225feb['childModel']=_0x32ef('0x7a');break;case _0x32ef('0x7b'):_0x225feb[_0x32ef('0x13')]=_0x32ef('0xf');_0x225feb[_0x32ef('0x17')]=[{'name':_0x32ef('0x7c'),'field':'id','foreignKey':_0x32ef('0x7d')}];break;case'metrics':_0x225feb['childModel']=_0x32ef('0x7e');break;}return _0x225feb;}function _0x52232a(_0x4fbab6,_0xb519e9){var _0x89d0b3=_0x4fbab6[_0x32ef('0x7f')](0x0)[_0x32ef('0x80')]()+_0x4fbab6[_0x32ef('0x81')](0x1);var _0x356704={'type':_0x48106c[_0x32ef('0x82')][_0x32ef('0x83')][_0x32ef('0x84')],'raw':!![]};return new Promise(function(_0x123571,_0x4c125c){var _0x518ee1=squel[_0x32ef('0x85')]()[_0x32ef('0x7')]('ui.'+_0x89d0b3+_0x32ef('0x86'),'id')[_0x32ef('0x7')](_0x32ef('0x87'))['from'](_0x32ef('0x88')+_0x4fbab6+_0x32ef('0x89'),'ui')[_0x32ef('0x8a')]('ui.UserId\x20=\x20?',_0xb519e9['id']);return _0x48106c['sequelize'][_0x32ef('0x8b')](_0x518ee1['toString'](),_0x356704)[_0x32ef('0xa')](function(_0x5bb114){_0xb519e9[_0x89d0b3+'OpenTabs']=_0x5bb114;_0x123571(_0x5bb114);})[_0x32ef('0x12')](function(_0x208989){_0x4c125c(_0x208989);});});}return _0x38047b[_0x32ef('0x8c')]('UserProfile',attributes,{'tableName':_0x32ef('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x222b24){var _0x5f9da7={'raw':![],'where':{}};var _0x58ecbb={};var _0x4557ce={'count':0x0,'rows':[]};var _0x12b7f8=_0x222b24['query']['section'];var _0x2e20dc=_0x222b24[_0x32ef('0x8b')][_0x32ef('0x8e')]||![];var _0x339625=_0x57f5e5(_0x12b7f8,_0x2e20dc);if(!_0x339625[_0x32ef('0x13')])throw new Error(_0x32ef('0x8f')+_0x12b7f8+'\x27');var _0x4c89e8=[{'name':_0x12b7f8}];if(!_[_0x32ef('0x90')](_0x339625[_0x32ef('0x17')]))_0x4c89e8=_0x339625[_0x32ef('0x17')];var _0x36ed97=[];for(var _0x21e930=0x0;_0x21e930<_0x4c89e8[_0x32ef('0x91')];_0x21e930++){_0x36ed97[_0x32ef('0x92')](_0x48106c[_0x32ef('0x93')][_0x32ef('0x94')]({'where':{'userProfileId':_0x222b24['params']['id'],'name':_0x4c89e8[_0x21e930][_0x32ef('0xd')]},'raw':!![]}));}return Promise[_0x32ef('0x95')](_0x36ed97)[_0x32ef('0xa')](function(_0x1c629d){var _0x79ae28=_['filter'](_0x1c629d,function(_0x47c0ed){return _0x47c0ed?_0x47c0ed:undefined;});var _0x2125de=_[_0x32ef('0x6')](_0x4c89e8,[_0x32ef('0x96'),!![]]);var _0x334ca6=_[_0x32ef('0x90')](_0x79ae28)&&_['isEmpty'](_0x2125de)?null:_[_0x32ef('0x97')](_0x2125de,_0x79ae28);if(!_0x334ca6)return null;var _0x544045=[];for(var _0x216e2f=0x0;_0x216e2f<_0x334ca6[_0x32ef('0x91')];_0x216e2f++){var _0x48b6f4=_['find'](_0x4c89e8,function(_0x2c9f7a){return _0x334ca6[_0x216e2f]?_0x2c9f7a[_0x32ef('0xd')]===_0x334ca6[_0x216e2f][_0x32ef('0xd')]:null;});if(_0x48b6f4){if(_0x334ca6[_0x216e2f]['ignore']){_0x544045['push'](_0x38b7f3(_0x339625[_0x32ef('0x13')],_0x334ca6[_0x216e2f]));}else{if(!_0x334ca6[_0x216e2f][_0x32ef('0x98')]){_0x544045[_0x32ef('0x92')](_0x531e30(_0x48b6f4,_0x334ca6[_0x216e2f],_0x339625[_0x32ef('0x13')]));}else{if(_0x48b6f4['model']){_0x544045[_0x32ef('0x92')](_0x401d0b(_0x48b6f4,_0x334ca6[_0x216e2f]));}}}}}return Promise[_0x32ef('0x95')](_0x544045);})[_0x32ef('0xa')](function(_0xd7a78){var _0x9df27c=_0xd7a78;var _0x268dcd=null;if(_0x9df27c){_0x268dcd=_0x9df27c[_0x32ef('0x91')]===0x1?_0x9df27c[0x0]:null;}if(!_0x268dcd&&!_0x9df27c)return _0x4557ce;var _0x44e23e=_0x48106c[_0x339625[_0x32ef('0x13')]][_0x32ef('0x99')];_0x58ecbb[_0x32ef('0x9a')]=_[_0x32ef('0x9b')](_0x44e23e);_0x58ecbb['query']=_['keys'](_0x222b24[_0x32ef('0x8b')]);_0x58ecbb[_0x32ef('0x9c')]=_['intersection'](_0x58ecbb[_0x32ef('0x9a')],_0x58ecbb['query']);_0x5f9da7[_0x32ef('0x9d')]=_[_0x32ef('0x9e')](_0x58ecbb[_0x32ef('0x9a')],qs['fields'](_0x222b24[_0x32ef('0x8b')]['fields']));_0x5f9da7[_0x32ef('0x9d')]=_0x5f9da7[_0x32ef('0x9d')]['length']?_0x5f9da7['attributes']:_0x58ecbb[_0x32ef('0x9a')];if(!_0x222b24['query'][_0x32ef('0x9f')]('nolimit')){_0x5f9da7[_0x32ef('0xa0')]=qs[_0x32ef('0xa0')](_0x222b24[_0x32ef('0x8b')]['limit']);_0x5f9da7['offset']=qs['offset'](_0x222b24[_0x32ef('0x8b')]['offset']);}_0x5f9da7[_0x32ef('0xa1')]=qs[_0x32ef('0xa2')](_0x222b24[_0x32ef('0x8b')][_0x32ef('0xa2')]);_0x5f9da7[_0x32ef('0x8a')]=qs[_0x32ef('0x9c')](_['pick'](_0x222b24[_0x32ef('0x8b')],_0x58ecbb['filters']));if(_0x222b24['query'][_0x32ef('0x6')]){_0x5f9da7['where']=_[_0x32ef('0xa3')](_0x5f9da7[_0x32ef('0x8a')],{'$or':_['map'](_0x44e23e,function(_0x232b40){if(_0x232b40[_0x32ef('0x10')][_0x32ef('0xa4')]!==_0x32ef('0xa5')){var _0x1fa36d={};_0x1fa36d[_0x232b40[_0x32ef('0x7')]]={'$like':'%'+_0x222b24['query']['filter']+'%'};return _0x1fa36d;}})});}var _0x35b10d=[];var _0x5e0b55=null;var _0x41bbe1={};if(_0x268dcd){_0x5e0b55=_[_0x32ef('0x94')](_0x4c89e8,[_0x32ef('0xd'),_0x268dcd[_0x32ef('0xd')]]);if(_0x5e0b55[_0x32ef('0x7')]){_0x41bbe1={};if(_0x339625[_0x32ef('0x13')]==='AnalyticExtractedReport'){_0x41bbe1[_0x5e0b55[_0x32ef('0xa6')]]=_[_0x32ef('0xc')](_0x268dcd[_0x32ef('0xb')],'id');}else{_0x41bbe1[_0x5e0b55[_0x32ef('0xa6')]]=_0x268dcd[_0x32ef('0xb')];}_0x35b10d['push'](_0x41bbe1);}else{_0x5f9da7['where']['id']=_0x268dcd[_0x32ef('0xb')];}}else{for(var _0x904a4f=0x0;_0x904a4f<_0x9df27c['length'];_0x904a4f++){_0x5e0b55=_[_0x32ef('0x94')](_0x4c89e8,[_0x32ef('0xd'),_0x9df27c[_0x904a4f][_0x32ef('0xd')]]);if(_0x5e0b55[_0x32ef('0x7')]){_0x41bbe1={};_0x41bbe1[_0x5e0b55[_0x32ef('0xa6')]]=_0x9df27c[_0x904a4f][_0x32ef('0xb')];_0x35b10d[_0x32ef('0x92')](_0x41bbe1);}else{if(!_0x5f9da7[_0x32ef('0x8a')]['id'])_0x5f9da7[_0x32ef('0x8a')]['id']=[];_0x9df27c[_0x904a4f]['associatedResources'][_0x32ef('0xa7')](function(_0xefbbf2){_0x5f9da7['where']['id'][_0x32ef('0x92')](_0xefbbf2);});}}}if(!_['isEmpty'](_0x35b10d)){_0x5f9da7[_0x32ef('0x8a')]=_['merge'](_0x5f9da7[_0x32ef('0x8a')],{'$and':{'$or':_0x35b10d}});}_0x5f9da7=_[_0x32ef('0xa3')]({},_0x5f9da7,_0x222b24[_0x32ef('0xa8')]);if(_0x268dcd&&!_0x268dcd[_0x32ef('0x98')]&&_0x339625['childModel']===_0x32ef('0xf')){if(_0x222b24[_0x32ef('0x8b')][_0x32ef('0xa9')]){_0x5f9da7['include']=[{'all':!![]}];}return _0x48106c[_0x339625['childModel']]['findAll'](_0x5f9da7)[_0x32ef('0xa')](function(_0x12f5ef){var _0x1ec12d=[];_0x12f5ef[_0x32ef('0xa7')](function(_0x3cc90c){var _0x5a1696;switch(_0x3cc90c[_0x32ef('0xaa')]){case'default':_0x5a1696=_[_0x32ef('0x94')](_0x268dcd[_0x32ef('0xb')],function(_0xc43e1){return _0xc43e1['id']===_0x3cc90c['reportId']&&_0xc43e1[_0x32ef('0x10')]===_0x32ef('0xab');});break;case _0x32ef('0xac'):_0x5a1696=_[_0x32ef('0x94')](_0x268dcd[_0x32ef('0xb')],function(_0x4d4b5f){return _0x4d4b5f['id']===_0x3cc90c[_0x32ef('0x7d')]&&_0x4d4b5f['type']===_0x32ef('0xad');});break;}if(_0x5a1696)_0x1ec12d[_0x32ef('0x92')](_0x3cc90c);});_0x4557ce['count']=_0x1ec12d['length'];_0x4557ce[_0x32ef('0xae')]=_0x1ec12d;return _0x4557ce;});}else{return _0x48106c[_0x339625[_0x32ef('0x13')]][_0x32ef('0xaf')]({'where':_0x5f9da7[_0x32ef('0x8a')]})['then'](function(_0x356fd4){_0x4557ce['count']=_0x356fd4;if(_0x222b24['query'][_0x32ef('0xa9')]){if(_0x339625['childModel']===_0x32ef('0x1c')){_0x5f9da7[_0x32ef('0xb0')]=[{'model':_0x48106c[_0x32ef('0x74')],'as':'Tags','attributes':['id','name',_0x32ef('0xb1')],'required':_0x222b24[_0x32ef('0x8b')][_0x32ef('0xb2')]?!![]:![]},{'model':_0x48106c[_0x32ef('0x74')],'as':_0x32ef('0xb3'),'attributes':['id',_0x32ef('0xd'),_0x32ef('0xb1')],'through':_0x222b24['query'][_0x32ef('0xb2')]?{'attributes':[],'where':{'TagId':_0x222b24[_0x32ef('0x8b')][_0x32ef('0xb2')]||undefined}}:{},'required':_0x222b24[_0x32ef('0x8b')]['tag']?!![]:![]}];}else{_0x5f9da7['include']=[{'all':!![]}];}}return _0x48106c[_0x339625[_0x32ef('0x13')]]['findAll'](_0x5f9da7);})[_0x32ef('0xa')](function(_0x1d3a37){_0x4557ce['rows']=_0x1d3a37;if(_0x12b7f8==='Agents'&&_0x222b24['query'][_0x32ef('0xb4')]===_0x32ef('0xb5')){var _0xa53375=[];for(var _0x275995=0x0;_0x275995<_0x4557ce['rows'][_0x32ef('0x91')];_0x275995++){_0xa53375[_0x32ef('0x92')](_0x52232a(_0x32ef('0xb6'),_0x4557ce['rows'][_0x275995][_0x32ef('0xb7')]));_0xa53375['push'](_0x52232a(_0x32ef('0xb8'),_0x4557ce[_0x32ef('0xae')][_0x275995]['dataValues']));_0xa53375['push'](_0x52232a(_0x32ef('0xb9'),_0x4557ce[_0x32ef('0xae')][_0x275995][_0x32ef('0xb7')]));_0xa53375[_0x32ef('0x92')](_0x52232a(_0x32ef('0xba'),_0x4557ce[_0x32ef('0xae')][_0x275995][_0x32ef('0xb7')]));_0xa53375[_0x32ef('0x92')](_0x52232a(_0x32ef('0xbb'),_0x4557ce['rows'][_0x275995][_0x32ef('0xb7')]));_0xa53375['push'](_0x52232a(_0x32ef('0xbc'),_0x4557ce[_0x32ef('0xae')][_0x275995][_0x32ef('0xb7')]));}return Promise[_0x32ef('0x95')](_0xa53375)[_0x32ef('0xa')](function(){return _0x4557ce;});}return _0x4557ce;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index eff34fe..0a3297a 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 _0x6333=['stringify','error','code','UserProfile,\x20%s,\x20%s','message','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults','request','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x6333,0x83));var _0x3633=function(_0x49c223,_0x4569e1){_0x49c223=_0x49c223-0x0;var _0x2a03c2=_0x6333[_0x49c223];return _0x2a03c2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3633('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3633('0x1'));var db=require(_0x3633('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3633('0x3'))('rpc');var config=require(_0x3633('0x4'));var jayson=require(_0x3633('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x3633('0x6')]=_[_0x3633('0x7')](config[_0x3633('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3633('0x6')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x463f1d,_0x288fc8,_0x184dd9){return new BPromise(function(_0x5aace0,_0x24e243){return client[_0x3633('0x8')](_0x463f1d,_0x184dd9)['then'](function(_0x507300){logger[_0x3633('0x9')]('UserProfile,\x20%s,\x20%s',_0x288fc8,'request\x20sent');logger[_0x3633('0xa')](_0x3633('0xb'),_0x288fc8,_0x3633('0xc'),JSON[_0x3633('0xd')](_0x507300));if(_0x507300[_0x3633('0xe')]){if(_0x507300['error'][_0x3633('0xf')]===0x1f4){logger[_0x3633('0xe')](_0x3633('0x10'),_0x288fc8,_0x507300[_0x3633('0xe')]['message']);return _0x24e243(_0x507300['error'][_0x3633('0x11')]);}logger[_0x3633('0xe')](_0x3633('0x10'),_0x288fc8,_0x507300[_0x3633('0xe')][_0x3633('0x11')]);return _0x5aace0(_0x507300[_0x3633('0xe')]['message']);}else{logger[_0x3633('0x9')](_0x3633('0x10'),_0x288fc8,'request\x20sent');_0x5aace0(_0x507300['result'][_0x3633('0x11')]);}})['catch'](function(_0x4875b8){logger[_0x3633('0xe')](_0x3633('0x10'),_0x288fc8,_0x4875b8);_0x24e243(_0x4875b8);});});} \ No newline at end of file +var _0x7ad3=['socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','client','http','redis','defaults','localhost'];(function(_0x1118da,_0x2fde4c){var _0x7374da=function(_0x46f897){while(--_0x46f897){_0x1118da['push'](_0x1118da['shift']());}};_0x7374da(++_0x2fde4c);}(_0x7ad3,0x108));var _0x37ad=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x7ad3[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x37ad('0x0'));var util=require(_0x37ad('0x1'));var moment=require(_0x37ad('0x2'));var BPromise=require(_0x37ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x37ad('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x37ad('0x6')][_0x37ad('0x7')]({'port':0x232a});config[_0x37ad('0x8')]=_[_0x37ad('0x9')](config[_0x37ad('0x8')],{'host':_0x37ad('0xa'),'port':0x18eb});var socket=require(_0x37ad('0xb'))(new Redis(config[_0x37ad('0x8')]));require(_0x37ad('0xc'))['register'](socket);function respondWithRpcPromise(_0x6d601e,_0x5444ab,_0x5864f9){return new BPromise(function(_0x4c4bed,_0x4da3b7){return client[_0x37ad('0xd')](_0x6d601e,_0x5864f9)[_0x37ad('0xe')](function(_0x1a4487){logger[_0x37ad('0xf')](_0x37ad('0x10'),_0x5444ab,_0x37ad('0x11'));logger[_0x37ad('0x12')](_0x37ad('0x13'),_0x5444ab,_0x37ad('0x11'),JSON[_0x37ad('0x14')](_0x1a4487));if(_0x1a4487[_0x37ad('0x15')]){if(_0x1a4487['error']['code']===0x1f4){logger[_0x37ad('0x15')](_0x37ad('0x10'),_0x5444ab,_0x1a4487['error'][_0x37ad('0x16')]);return _0x4da3b7(_0x1a4487[_0x37ad('0x15')]['message']);}logger[_0x37ad('0x15')](_0x37ad('0x10'),_0x5444ab,_0x1a4487['error'][_0x37ad('0x16')]);return _0x4c4bed(_0x1a4487[_0x37ad('0x15')][_0x37ad('0x16')]);}else{logger['info'](_0x37ad('0x10'),_0x5444ab,_0x37ad('0x11'));_0x4c4bed(_0x1a4487[_0x37ad('0x17')]['message']);}})[_0x37ad('0x18')](function(_0x21927d){logger['error'](_0x37ad('0x10'),_0x5444ab,_0x21927d);_0x4da3b7(_0x21927d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 326d2dd..88e04ba 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 _0x43cf=['update','emit','removeListener','register','length','./userProfile.events','remove'];(function(_0x3d6254,_0x2c7c2a){var _0x3f6e29=function(_0x16c036){while(--_0x16c036){_0x3d6254['push'](_0x3d6254['shift']());}};_0x3f6e29(++_0x2c7c2a);}(_0x43cf,0x12b));var _0xf43c=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0x43cf[_0x1d3577];return _0x277d9a;};'use strict';var UserProfileEvents=require(_0xf43c('0x0'));var events=['save',_0xf43c('0x1'),_0xf43c('0x2')];function createListener(_0x1dbc09,_0x1b1fda){return function(_0x2859a1){_0x1b1fda[_0xf43c('0x3')](_0x1dbc09,_0x2859a1);};}function removeListener(_0x583329,_0x2d0b85){return function(){UserProfileEvents[_0xf43c('0x4')](_0x583329,_0x2d0b85);};}exports[_0xf43c('0x5')]=function(_0x1efbf4){for(var _0x5be68c=0x0,_0x4b23cb=events[_0xf43c('0x6')];_0x5be68c<_0x4b23cb;_0x5be68c++){var _0x5c7e4b=events[_0x5be68c];var _0x46511b=createListener('userProfile:'+_0x5c7e4b,_0x1efbf4);UserProfileEvents['on'](_0x5c7e4b,_0x46511b);}}; \ No newline at end of file +var _0xe88e=['update','emit','removeListener','register','length','userProfile:','./userProfile.events','save'];(function(_0x3790a6,_0x276d65){var _0xe6a81b=function(_0x3025a3){while(--_0x3025a3){_0x3790a6['push'](_0x3790a6['shift']());}};_0xe6a81b(++_0x276d65);}(_0xe88e,0xd6));var _0xee88=function(_0x4fecf3,_0x17fdb0){_0x4fecf3=_0x4fecf3-0x0;var _0x50161f=_0xe88e[_0x4fecf3];return _0x50161f;};'use strict';var UserProfileEvents=require(_0xee88('0x0'));var events=[_0xee88('0x1'),'remove',_0xee88('0x2')];function createListener(_0x2a0d39,_0x2a4add){return function(_0x24592f){_0x2a4add[_0xee88('0x3')](_0x2a0d39,_0x24592f);};}function removeListener(_0x3d7a5d,_0x35a357){return function(){UserProfileEvents[_0xee88('0x4')](_0x3d7a5d,_0x35a357);};}exports[_0xee88('0x5')]=function(_0x3ad619){for(var _0x512834=0x0,_0x3c307a=events[_0xee88('0x6')];_0x512834<_0x3c307a;_0x512834++){var _0xf4e103=events[_0x512834];var _0xefaf18=createListener(_0xee88('0x7')+_0xf4e103,_0x3ad619);UserProfileEvents['on'](_0xf4e103,_0xefaf18);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index aa12f80..635bd0a 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 _0x3920=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3920,0x144));var _0x0392=function(_0x312185,_0x55368e){_0x312185=_0x312185-0x0;var _0x3089fb=_0x3920[_0x312185];return _0x3089fb;};'use strict';var multer=require(_0x0392('0x0'));var util=require(_0x0392('0x1'));var path=require(_0x0392('0x2'));var timeout=require(_0x0392('0x3'));var express=require(_0x0392('0x4'));var router=express[_0x0392('0x5')]();var fs_extra=require(_0x0392('0x6'));var auth=require(_0x0392('0x7'));var interaction=require(_0x0392('0x8'));var config=require(_0x0392('0x9'));var controller=require('./userProfileResource.controller');router[_0x0392('0xa')]('/',auth[_0x0392('0xb')](),controller[_0x0392('0xc')]);router[_0x0392('0xa')](_0x0392('0xd'),auth['isAuthenticated'](),controller[_0x0392('0xe')]);router[_0x0392('0xa')](_0x0392('0xf'),auth['isAuthenticated'](),controller[_0x0392('0x10')]);router[_0x0392('0x11')]('/',auth[_0x0392('0xb')](),controller[_0x0392('0x12')]);router[_0x0392('0x13')](_0x0392('0xf'),auth[_0x0392('0xb')](),controller[_0x0392('0x14')]);router[_0x0392('0x15')](_0x0392('0xf'),auth[_0x0392('0xb')](),controller[_0x0392('0x16')]);module['exports']=router; \ No newline at end of file +var _0xcdd0=['isAuthenticated','index','/describe','describe','/:id','post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0xcdd0,0x1ae));var _0x0cdd=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xcdd0[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var path=require('path');var timeout=require(_0x0cdd('0x2'));var express=require(_0x0cdd('0x3'));var router=express[_0x0cdd('0x4')]();var fs_extra=require(_0x0cdd('0x5'));var auth=require(_0x0cdd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0cdd('0x7'));var controller=require(_0x0cdd('0x8'));router[_0x0cdd('0x9')]('/',auth[_0x0cdd('0xa')](),controller[_0x0cdd('0xb')]);router[_0x0cdd('0x9')](_0x0cdd('0xc'),auth['isAuthenticated'](),controller[_0x0cdd('0xd')]);router[_0x0cdd('0x9')](_0x0cdd('0xe'),auth[_0x0cdd('0xa')](),controller['show']);router[_0x0cdd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0cdd('0xe'),auth['isAuthenticated'](),controller[_0x0cdd('0x10')]);router[_0x0cdd('0x11')](_0x0cdd('0xe'),auth[_0x0cdd('0xa')](),controller[_0x0cdd('0x12')]);module[_0x0cdd('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b7d155d..105e07c 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 _0xb00c=['STRING','INTEGER','sequelize','exports'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0xb00c,0x66));var _0xcb00=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xb00c[_0x4c7935];return _0x30651d;};'use strict';var Sequelize=require(_0xcb00('0x0'));module[_0xcb00('0x1')]={'name':{'type':Sequelize[_0xcb00('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcb00('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xcb00('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x40a7=['STRING','INTEGER','sequelize'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x40a7,0x83));var _0x740a=function(_0x33ec41,_0x4f671e){_0x33ec41=_0x33ec41-0x0;var _0x5df971=_0x40a7[_0x33ec41];return _0x5df971;};'use strict';var Sequelize=require(_0x740a('0x0'));module['exports']={'name':{'type':Sequelize[_0x740a('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x740a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x740a('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index b90eb1f..3f3534a 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 _0x8e3f=['save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','filter','options','UserProfileResource','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40ae02,_0x41f85e){_0x41f85e=_0x41f85e||0xcc;return function(_0x336790){if(_0x336790){return _0x40ae02[_0xf8e3('0x1a')](_0x41f85e);}return _0x40ae02['status'](_0x41f85e)[_0xf8e3('0x1b')]();};}function respondWithResult(_0xa856f5,_0x2fe631){_0x2fe631=_0x2fe631||0xc8;return function(_0x4af736){if(_0x4af736){return _0xa856f5[_0xf8e3('0x1c')](_0x2fe631)['json'](_0x4af736);}};}function respondWithFilteredResult(_0x1ec773,_0x40c196){return function(_0x460629){if(_0x460629){var _0x570ee3=typeof _0x40c196['offset']===_0xf8e3('0x1d')&&typeof _0x40c196[_0xf8e3('0x1e')]===_0xf8e3('0x1d');var _0x3b01ac=_0x460629[_0xf8e3('0x1f')];var _0x11d4cc=_0x570ee3?0x0:_0x40c196[_0xf8e3('0x20')];var _0x2e27e3=_0x570ee3?_0x460629[_0xf8e3('0x1f')]:_0x40c196[_0xf8e3('0x20')]+_0x40c196['limit'];var _0x20cc64;if(_0x2e27e3>=_0x3b01ac){_0x2e27e3=_0x3b01ac;_0x20cc64=0xc8;}else{_0x20cc64=0xce;}_0x1ec773[_0xf8e3('0x1c')](_0x20cc64);return _0x1ec773[_0xf8e3('0x21')](_0xf8e3('0x22'),_0x11d4cc+'-'+_0x2e27e3+'/'+_0x3b01ac)[_0xf8e3('0x23')](_0x460629);}return null;};}function patchUpdates(_0x11c58e){return function(_0x1cae53){try{jsonpatch[_0xf8e3('0x24')](_0x1cae53,_0x11c58e,!![]);}catch(_0x5b99b1){return BPromise[_0xf8e3('0x25')](_0x5b99b1);}return _0x1cae53[_0xf8e3('0x26')]();};}function saveUpdates(_0x3c636d,_0xccbcc0){return function(_0x4a1e5f){if(_0x4a1e5f){return _0x4a1e5f[_0xf8e3('0x27')](_0x3c636d)['then'](function(_0x286059){return _0x286059;});}return null;};}function removeEntity(_0x225a1b,_0x33d526){return function(_0x2dc856){if(_0x2dc856){return _0x2dc856[_0xf8e3('0x28')]()[_0xf8e3('0x29')](function(){_0x225a1b['status'](0xcc)[_0xf8e3('0x1b')]();});}};}function handleEntityNotFound(_0x2fc674,_0x3373ca){return function(_0x417b42){if(!_0x417b42){_0x2fc674[_0xf8e3('0x1a')](0x194);}return _0x417b42;};}function handleError(_0x3b41a1,_0x2963ed){_0x2963ed=_0x2963ed||0x1f4;return function(_0x157a2d){logger['error'](_0x157a2d[_0xf8e3('0x2a')]);if(_0x157a2d[_0xf8e3('0x2b')]){delete _0x157a2d[_0xf8e3('0x2b')];}_0x3b41a1[_0xf8e3('0x1c')](_0x2963ed)[_0xf8e3('0x2c')](_0x157a2d);};}exports[_0xf8e3('0x2d')]=function(_0x16485e,_0xfaf15d){var _0x4f2ae9={},_0x21e1c0={},_0x243e28={'count':0x0,'rows':[]};var _0x492694=_[_0xf8e3('0x2e')](db['UserProfileResource'][_0xf8e3('0x2f')],function(_0x10cf28){return{'name':_0x10cf28[_0xf8e3('0x30')],'type':_0x10cf28[_0xf8e3('0x31')][_0xf8e3('0x32')]};});_0x21e1c0[_0xf8e3('0x33')]=_[_0xf8e3('0x2e')](_0x492694,_0xf8e3('0x2b'));_0x21e1c0['query']=_[_0xf8e3('0x34')](_0x16485e[_0xf8e3('0x35')]);_0x21e1c0['filters']=_['intersection'](_0x21e1c0['model'],_0x21e1c0[_0xf8e3('0x35')]);_0x4f2ae9['attributes']=_[_0xf8e3('0x36')](_0x21e1c0[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x16485e[_0xf8e3('0x35')]['fields']));_0x4f2ae9['attributes']=_0x4f2ae9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0x4f2ae9[_0xf8e3('0x38')]:_0x21e1c0[_0xf8e3('0x33')];if(!_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x3a')]('nolimit')){_0x4f2ae9[_0xf8e3('0x1e')]=qs['limit'](_0x16485e['query'][_0xf8e3('0x1e')]);_0x4f2ae9[_0xf8e3('0x20')]=qs[_0xf8e3('0x20')](_0x16485e[_0xf8e3('0x35')]['offset']);}_0x4f2ae9['order']=qs[_0xf8e3('0x3b')](_0x16485e[_0xf8e3('0x35')]['sort']);_0x4f2ae9[_0xf8e3('0x3c')]=qs[_0xf8e3('0x3d')](_[_0xf8e3('0x3e')](_0x16485e[_0xf8e3('0x35')],_0x21e1c0['filters']),_0x492694);if(_0x16485e['query']['filter']){_0x4f2ae9[_0xf8e3('0x3c')]=_[_0xf8e3('0x3f')](_0x4f2ae9[_0xf8e3('0x3c')],{'$or':_[_0xf8e3('0x2e')](_0x492694,function(_0x53160a){if(_0x53160a[_0xf8e3('0x31')]!=='VIRTUAL'){var _0x20909b={};_0x20909b[_0x53160a[_0xf8e3('0x2b')]]={'$like':'%'+_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x40')]+'%'};return _0x20909b;}})});}_0x4f2ae9=_[_0xf8e3('0x3f')]({},_0x4f2ae9,_0x16485e[_0xf8e3('0x41')]);var _0x82e778={'where':_0x4f2ae9[_0xf8e3('0x3c')]};return db[_0xf8e3('0x42')]['count'](_0x82e778)[_0xf8e3('0x29')](function(_0x537089){_0x243e28[_0xf8e3('0x1f')]=_0x537089;if(_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x43')]){_0x4f2ae9[_0xf8e3('0x44')]=[{'all':!![]}];}return db[_0xf8e3('0x42')][_0xf8e3('0x45')](_0x4f2ae9);})[_0xf8e3('0x29')](function(_0x2f05b7){_0x243e28['rows']=_0x2f05b7;return _0x243e28;})[_0xf8e3('0x29')](respondWithFilteredResult(_0xfaf15d,_0x4f2ae9))[_0xf8e3('0x46')](handleError(_0xfaf15d,null));};exports[_0xf8e3('0x47')]=function(_0x382dbb,_0x6dd110){var _0xe7fcb9={'raw':![],'where':{'id':_0x382dbb[_0xf8e3('0x48')]['id']}},_0x792190={};_0x792190['model']=_['keys'](db['UserProfileResource'][_0xf8e3('0x2f')]);_0x792190[_0xf8e3('0x35')]=_['keys'](_0x382dbb[_0xf8e3('0x35')]);_0x792190['filters']=_[_0xf8e3('0x36')](_0x792190[_0xf8e3('0x33')],_0x792190['query']);_0xe7fcb9[_0xf8e3('0x38')]=_['intersection'](_0x792190[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x382dbb['query'][_0xf8e3('0x37')]));_0xe7fcb9[_0xf8e3('0x38')]=_0xe7fcb9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0xe7fcb9['attributes']:_0x792190['model'];if(_0x382dbb['query'][_0xf8e3('0x43')]){_0xe7fcb9[_0xf8e3('0x44')]=[{'all':!![]}];}_0xe7fcb9=_[_0xf8e3('0x3f')]({},_0xe7fcb9,_0x382dbb['options']);return db[_0xf8e3('0x42')]['find'](_0xe7fcb9)[_0xf8e3('0x29')](handleEntityNotFound(_0x6dd110,null))[_0xf8e3('0x29')](respondWithResult(_0x6dd110,null))['catch'](handleError(_0x6dd110,null));};exports['create']=function(_0x128234,_0x2939e6){return db[_0xf8e3('0x42')][_0xf8e3('0x49')](_0x128234[_0xf8e3('0x4a')],{})[_0xf8e3('0x29')](respondWithResult(_0x2939e6,0xc9))[_0xf8e3('0x46')](handleError(_0x2939e6,null));};exports[_0xf8e3('0x27')]=function(_0xdc2430,_0x81898e){if(_0xdc2430[_0xf8e3('0x4a')]['id']){delete _0xdc2430['body']['id'];}return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0xdc2430[_0xf8e3('0x48')]['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x81898e,null))[_0xf8e3('0x29')](saveUpdates(_0xdc2430[_0xf8e3('0x4a')],null))['then'](respondWithResult(_0x81898e,null))[_0xf8e3('0x46')](handleError(_0x81898e,null));};exports[_0xf8e3('0x28')]=function(_0x39caae,_0x3e60a6){return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0x39caae['params']['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x3e60a6,null))[_0xf8e3('0x29')](removeEntity(_0x3e60a6,null))[_0xf8e3('0x46')](handleError(_0x3e60a6,null));};exports[_0xf8e3('0x4c')]=function(_0x113404,_0x2fef16){return db['UserProfileResource'][_0xf8e3('0x4c')]()[_0xf8e3('0x29')](respondWithResult(_0x2fef16,null))[_0xf8e3('0x46')](handleError(_0x2fef16,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(_0x125ba3,_0x4b257f){var _0x5647a3=function(_0x163c08){while(--_0x163c08){_0x125ba3['push'](_0x125ba3['shift']());}};_0x5647a3(++_0x4b257f);}(_0xd943,0x15d));var _0x3d94=function(_0x319f01,_0x397386){_0x319f01=_0x319f01-0x0;var _0x7575c1=_0xd943[_0x319f01];return _0x7575c1;};'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 90fddb3..aadc08d 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 _0x28d8=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x28d8,0x86));var _0x828d=function(_0x50fdf3,_0x349f76){_0x50fdf3=_0x50fdf3-0x0;var _0x58fbbc=_0x28d8[_0x50fdf3];return _0x58fbbc;};'use strict';var _=require(_0x828d('0x0'));var util=require(_0x828d('0x1'));var logger=require(_0x828d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x828d('0x3'));var rp=require(_0x828d('0x4'));var fs=require('fs');var path=require(_0x828d('0x5'));var rimraf=require(_0x828d('0x6'));var config=require(_0x828d('0x7'));var attributes=require(_0x828d('0x8'));module[_0x828d('0x9')]=function(_0x14dcac,_0x40a74d){return _0x14dcac[_0x828d('0xa')](_0x828d('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x828d('0xc'),'fields':[_0x828d('0xd'),_0x828d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe19b=['exports','define','UserProfileResource','compositeIndex','resourceId','lodash','util','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe19b,0x195));var _0xbe19=function(_0x1fa78a,_0x4749a4){_0x1fa78a=_0x1fa78a-0x0;var _0x30a032=_0xe19b[_0x1fa78a];return _0x30a032;};'use strict';var _=require(_0xbe19('0x0'));var util=require(_0xbe19('0x1'));var logger=require('../../config/logger')(_0xbe19('0x2'));var moment=require(_0xbe19('0x3'));var BPromise=require(_0xbe19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xbe19('0x5')]=function(_0x3285f0,_0x1b69b0){return _0x3285f0[_0xbe19('0x6')](_0xbe19('0x7'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xbe19('0x8'),'fields':[_0xbe19('0x9'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index cc72027..dd1c877 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 _0x330a=['error','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','code','message'];(function(_0xc1dcf7,_0x57ef71){var _0x52c3eb=function(_0x29e515){while(--_0x29e515){_0xc1dcf7['push'](_0xc1dcf7['shift']());}};_0x52c3eb(++_0x57ef71);}(_0x330a,0x6e));var _0xa330=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x330a[_0x8ba19a];return _0x2bd8b4;};'use strict';var _=require('lodash');var util=require(_0xa330('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa330('0x1'));var db=require(_0xa330('0x2'))['db'];var utils=require(_0xa330('0x3'));var logger=require('../../config/logger')(_0xa330('0x4'));var config=require(_0xa330('0x5'));var jayson=require(_0xa330('0x6'));var client=jayson[_0xa330('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33e177,_0x1ffbe5,_0x29e9d4){return new BPromise(function(_0x2f9513,_0x57b2bc){return client['request'](_0x33e177,_0x29e9d4)[_0xa330('0x8')](function(_0x27e555){logger[_0xa330('0x9')](_0xa330('0xa'),_0x1ffbe5,'request\x20sent');logger[_0xa330('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x1ffbe5,_0xa330('0xc'),JSON[_0xa330('0xd')](_0x27e555));if(_0x27e555['error']){if(_0x27e555['error'][_0xa330('0xe')]===0x1f4){logger['error'](_0xa330('0xa'),_0x1ffbe5,_0x27e555['error'][_0xa330('0xf')]);return _0x57b2bc(_0x27e555[_0xa330('0x10')][_0xa330('0xf')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x1ffbe5,_0x27e555[_0xa330('0x10')]['message']);return _0x2f9513(_0x27e555[_0xa330('0x10')][_0xa330('0xf')]);}else{logger[_0xa330('0x9')](_0xa330('0xa'),_0x1ffbe5,_0xa330('0xc'));_0x2f9513(_0x27e555['result'][_0xa330('0xf')]);}})[_0xa330('0x11')](function(_0x3fba5e){logger[_0xa330('0x10')](_0xa330('0xa'),_0x1ffbe5,_0x3fba5e);_0x57b2bc(_0x3fba5e);});});} \ No newline at end of file +var _0x39b0=['ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x36afa2,_0x1b2094){var _0x317cca=function(_0x154fea){while(--_0x154fea){_0x36afa2['push'](_0x36afa2['shift']());}};_0x317cca(++_0x1b2094);}(_0x39b0,0x9e));var _0x039b=function(_0x41afac,_0x3da339){_0x41afac=_0x41afac-0x0;var _0x24433c=_0x39b0[_0x41afac];return _0x24433c;};'use strict';var _=require(_0x039b('0x0'));var util=require(_0x039b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x039b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x039b('0x3'));var logger=require(_0x039b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x039b('0x5'));var client=jayson[_0x039b('0x6')][_0x039b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1cc8f7,_0x53dca1,_0x2afc76){return new BPromise(function(_0x3c8701,_0x5a34c5){return client[_0x039b('0x8')](_0x1cc8f7,_0x2afc76)[_0x039b('0x9')](function(_0x178f54){logger[_0x039b('0xa')](_0x039b('0xb'),_0x53dca1,_0x039b('0xc'));logger[_0x039b('0xd')](_0x039b('0xe'),_0x53dca1,_0x039b('0xc'),JSON[_0x039b('0xf')](_0x178f54));if(_0x178f54[_0x039b('0x10')]){if(_0x178f54['error']['code']===0x1f4){logger[_0x039b('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x53dca1,_0x178f54[_0x039b('0x10')][_0x039b('0x11')]);return _0x5a34c5(_0x178f54[_0x039b('0x10')][_0x039b('0x11')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x53dca1,_0x178f54[_0x039b('0x10')][_0x039b('0x11')]);return _0x3c8701(_0x178f54[_0x039b('0x10')][_0x039b('0x11')]);}else{logger['info'](_0x039b('0xb'),_0x53dca1,_0x039b('0xc'));_0x3c8701(_0x178f54[_0x039b('0x12')]['message']);}})[_0x039b('0x13')](function(_0x17c65f){logger[_0x039b('0x10')](_0x039b('0xb'),_0x53dca1,_0x17c65f);_0x5a34c5(_0x17c65f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 4cbec26..412f89e 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 _0x3cf3=['index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated'];(function(_0x52431f,_0x36c549){var _0x113b0f=function(_0x54bdb1){while(--_0x54bdb1){_0x52431f['push'](_0x52431f['shift']());}};_0x113b0f(++_0x36c549);}(_0x3cf3,0x1ee));var _0x33cf=function(_0x339db5,_0x441041){_0x339db5=_0x339db5-0x0;var _0x142ff8=_0x3cf3[_0x339db5];return _0x142ff8;};'use strict';var multer=require(_0x33cf('0x0'));var util=require(_0x33cf('0x1'));var path=require(_0x33cf('0x2'));var timeout=require('connect-timeout');var express=require(_0x33cf('0x3'));var router=express[_0x33cf('0x4')]();var fs_extra=require(_0x33cf('0x5'));var auth=require(_0x33cf('0x6'));var interaction=require(_0x33cf('0x7'));var config=require(_0x33cf('0x8'));var controller=require(_0x33cf('0x9'));router[_0x33cf('0xa')]('/',auth[_0x33cf('0xb')](),controller[_0x33cf('0xc')]);router[_0x33cf('0xa')](_0x33cf('0xd'),auth[_0x33cf('0xb')](),controller[_0x33cf('0xe')]);router[_0x33cf('0xa')](_0x33cf('0xf'),auth[_0x33cf('0xb')](),controller[_0x33cf('0x10')]);router[_0x33cf('0x11')]('/',auth['isAuthenticated'](),controller[_0x33cf('0x12')]);router[_0x33cf('0x13')](_0x33cf('0xf'),auth[_0x33cf('0xb')](),controller[_0x33cf('0x14')]);router[_0x33cf('0x15')](_0x33cf('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x33cf('0x16')]=router; \ No newline at end of file +var _0x9340=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileSection.controller','get','index','describe','/:id','show','isAuthenticated','create'];(function(_0x592e9e,_0x3a9301){var _0x1dda1c=function(_0x1e830a){while(--_0x1e830a){_0x592e9e['push'](_0x592e9e['shift']());}};_0x1dda1c(++_0x3a9301);}(_0x9340,0x1bd));var _0x0934=function(_0x1a0c15,_0x554c31){_0x1a0c15=_0x1a0c15-0x0;var _0x4e9d4d=_0x9340[_0x1a0c15];return _0x4e9d4d;};'use strict';var multer=require('multer');var util=require(_0x0934('0x0'));var path=require(_0x0934('0x1'));var timeout=require(_0x0934('0x2'));var express=require(_0x0934('0x3'));var router=express[_0x0934('0x4')]();var fs_extra=require(_0x0934('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0934('0x6'));var config=require('../../config/environment');var controller=require(_0x0934('0x7'));router[_0x0934('0x8')]('/',auth['isAuthenticated'](),controller[_0x0934('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0934('0xa')]);router['get'](_0x0934('0xb'),auth['isAuthenticated'](),controller[_0x0934('0xc')]);router['post']('/',auth[_0x0934('0xd')](),controller[_0x0934('0xe')]);router[_0x0934('0xf')]('/:id',auth[_0x0934('0xd')](),controller[_0x0934('0x10')]);router[_0x0934('0x11')](_0x0934('0xb'),auth['isAuthenticated'](),controller[_0x0934('0x12')]);module[_0x0934('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 5fec700..da620ed 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 _0x0b0e=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x3090bd,_0x29e46e){var _0x40be64=function(_0x3ca4ab){while(--_0x3ca4ab){_0x3090bd['push'](_0x3090bd['shift']());}};_0x40be64(++_0x29e46e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x0b0e[_0x309d93];return _0x2dd61d;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe0b0('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe0b0('0x1')],'set':function(_0x28040c){this[_0xe0b0('0x4')](_0xe0b0('0x5'),_0x28040c?_0x28040c[_0xe0b0('0x6')](''):[]);},'get':function(){return this[_0xe0b0('0x7')](_0xe0b0('0x5'))?this[_0xe0b0('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0xf45e=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xf45e,0x115));var _0xef45=function(_0x8075f2,_0x118505){_0x8075f2=_0x8075f2-0x0;var _0x5c4aa5=_0xf45e[_0x8075f2];return _0x5c4aa5;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'name':{'type':Sequelize[_0xef45('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xef45('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xef45('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xef45('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xef45('0x1')],'set':function(_0x37772f){this[_0xef45('0x4')](_0xef45('0x5'),_0x37772f?_0x37772f[_0xef45('0x6')](''):[]);},'get':function(){return this[_0xef45('0x7')](_0xef45('0x5'))?this[_0xef45('0x7')](_0xef45('0x5'))[_0xef45('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 9a222ab..68ffe27 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 _0xe093=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','catch','keys','length','create','body','update','find','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model'];(function(_0x521698,_0x5bdd14){var _0x4c92ad=function(_0x460d4d){while(--_0x460d4d){_0x521698['push'](_0x521698['shift']());}};_0x4c92ad(++_0x5bdd14);}(_0xe093,0x6b));var _0x3e09=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xe093[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require(_0x3e09('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3e09('0x1'));var moment=require(_0x3e09('0x2'));var BPromise=require(_0x3e09('0x3'));var Mustache=require(_0x3e09('0x4'));var util=require(_0x3e09('0x5'));var path=require(_0x3e09('0x6'));var sox=require('sox');var csv=require(_0x3e09('0x7'));var ejs=require(_0x3e09('0x8'));var fs=require('fs');var fs_extra=require(_0x3e09('0x9'));var _=require(_0x3e09('0xa'));var squel=require(_0x3e09('0xb'));var crypto=require(_0x3e09('0xc'));var jsforce=require(_0x3e09('0xd'));var deskjs=require(_0x3e09('0xe'));var toCsv=require(_0x3e09('0x7'));var querystring=require(_0x3e09('0xf'));var Papa=require(_0x3e09('0x10'));var Redis=require(_0x3e09('0x11'));var authService=require(_0x3e09('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3e09('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3e09('0x14'));var config=require(_0x3e09('0x15'));var licenseUtil=require(_0x3e09('0x16'));var db=require(_0x3e09('0x17'))['db'];function respondWithStatusCode(_0x14d79c,_0x3daded){_0x3daded=_0x3daded||0xcc;return function(_0x5e8fad){if(_0x5e8fad){return _0x14d79c['sendStatus'](_0x3daded);}return _0x14d79c['status'](_0x3daded)[_0x3e09('0x18')]();};}function respondWithResult(_0xa88f73,_0x4f57a5){_0x4f57a5=_0x4f57a5||0xc8;return function(_0x3b21f2){if(_0x3b21f2){return _0xa88f73[_0x3e09('0x19')](_0x4f57a5)[_0x3e09('0x1a')](_0x3b21f2);}};}function respondWithFilteredResult(_0x9e7fe1,_0x57cda4){return function(_0x109369){if(_0x109369){var _0x2019ca=typeof _0x57cda4[_0x3e09('0x1b')]==='undefined'&&typeof _0x57cda4[_0x3e09('0x1c')]===_0x3e09('0x1d');var _0x51d6f6=_0x109369[_0x3e09('0x1e')];var _0x164192=_0x2019ca?0x0:_0x57cda4['offset'];var _0x27aea5=_0x2019ca?_0x109369[_0x3e09('0x1e')]:_0x57cda4['offset']+_0x57cda4[_0x3e09('0x1c')];var _0x4fdb95;if(_0x27aea5>=_0x51d6f6){_0x27aea5=_0x51d6f6;_0x4fdb95=0xc8;}else{_0x4fdb95=0xce;}_0x9e7fe1[_0x3e09('0x19')](_0x4fdb95);return _0x9e7fe1[_0x3e09('0x1f')](_0x3e09('0x20'),_0x164192+'-'+_0x27aea5+'/'+_0x51d6f6)['json'](_0x109369);}return null;};}function patchUpdates(_0x361fa6){return function(_0x567acf){try{jsonpatch[_0x3e09('0x21')](_0x567acf,_0x361fa6,!![]);}catch(_0x3f7713){return BPromise['reject'](_0x3f7713);}return _0x567acf[_0x3e09('0x22')]();};}function saveUpdates(_0x6126fc,_0x5060f7){return function(_0x501fc9){if(_0x501fc9){return _0x501fc9['update'](_0x6126fc)[_0x3e09('0x23')](function(_0x1dd408){return _0x1dd408;});}return null;};}function removeEntity(_0x590661,_0x1f8791){return function(_0x254283){if(_0x254283){return _0x254283[_0x3e09('0x24')]()[_0x3e09('0x23')](function(){_0x590661['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d142,_0x166a81){return function(_0x20e94b){if(!_0x20e94b){_0x45d142[_0x3e09('0x25')](0x194);}return _0x20e94b;};}function handleError(_0x241c8d,_0x43de80){_0x43de80=_0x43de80||0x1f4;return function(_0x3325e5){logger[_0x3e09('0x26')](_0x3325e5['stack']);if(_0x3325e5[_0x3e09('0x27')]){delete _0x3325e5['name'];}_0x241c8d[_0x3e09('0x19')](_0x43de80)[_0x3e09('0x28')](_0x3325e5);};}exports[_0x3e09('0x29')]=function(_0x5425e2,_0x4082f7){var _0x130209={},_0x2e7280={},_0x62bcdb={'count':0x0,'rows':[]};var _0x587818=_[_0x3e09('0x2a')](db['UserProfileSection'][_0x3e09('0x2b')],function(_0x3d79fa){return{'name':_0x3d79fa[_0x3e09('0x2c')],'type':_0x3d79fa['type'][_0x3e09('0x2d')]};});_0x2e7280[_0x3e09('0x2e')]=_[_0x3e09('0x2a')](_0x587818,'name');_0x2e7280['query']=_['keys'](_0x5425e2[_0x3e09('0x2f')]);_0x2e7280[_0x3e09('0x30')]=_[_0x3e09('0x31')](_0x2e7280[_0x3e09('0x2e')],_0x2e7280[_0x3e09('0x2f')]);_0x130209[_0x3e09('0x32')]=_[_0x3e09('0x31')](_0x2e7280['model'],qs[_0x3e09('0x33')](_0x5425e2[_0x3e09('0x2f')][_0x3e09('0x33')]));_0x130209[_0x3e09('0x32')]=_0x130209[_0x3e09('0x32')]['length']?_0x130209[_0x3e09('0x32')]:_0x2e7280['model'];if(!_0x5425e2[_0x3e09('0x2f')][_0x3e09('0x34')](_0x3e09('0x35'))){_0x130209[_0x3e09('0x1c')]=qs['limit'](_0x5425e2[_0x3e09('0x2f')][_0x3e09('0x1c')]);_0x130209['offset']=qs[_0x3e09('0x1b')](_0x5425e2[_0x3e09('0x2f')][_0x3e09('0x1b')]);}_0x130209[_0x3e09('0x36')]=qs[_0x3e09('0x37')](_0x5425e2[_0x3e09('0x2f')][_0x3e09('0x37')]);_0x130209[_0x3e09('0x38')]=qs[_0x3e09('0x30')](_[_0x3e09('0x39')](_0x5425e2['query'],_0x2e7280['filters']),_0x587818);if(_0x5425e2[_0x3e09('0x2f')][_0x3e09('0x3a')]){_0x130209[_0x3e09('0x38')]=_[_0x3e09('0x3b')](_0x130209['where'],{'$or':_[_0x3e09('0x2a')](_0x587818,function(_0x563c81){if(_0x563c81[_0x3e09('0x3c')]!==_0x3e09('0x3d')){var _0x4a65cd={};_0x4a65cd[_0x563c81['name']]={'$like':'%'+_0x5425e2[_0x3e09('0x2f')]['filter']+'%'};return _0x4a65cd;}})});}_0x130209=_[_0x3e09('0x3b')]({},_0x130209,_0x5425e2[_0x3e09('0x3e')]);var _0x37345f={'where':_0x130209[_0x3e09('0x38')]};return db[_0x3e09('0x3f')][_0x3e09('0x1e')](_0x37345f)[_0x3e09('0x23')](function(_0x4727f6){_0x62bcdb['count']=_0x4727f6;if(_0x5425e2[_0x3e09('0x2f')][_0x3e09('0x40')]){_0x130209[_0x3e09('0x41')]=[{'all':!![]}];}return db[_0x3e09('0x3f')][_0x3e09('0x42')](_0x130209);})['then'](function(_0xf89705){_0x62bcdb[_0x3e09('0x43')]=_0xf89705;return _0x62bcdb;})['then'](respondWithFilteredResult(_0x4082f7,_0x130209))[_0x3e09('0x44')](handleError(_0x4082f7,null));};exports['show']=function(_0x471a95,_0x28ed78){var _0x544680={'raw':![],'where':{'id':_0x471a95['params']['id']}},_0x329fa1={};_0x329fa1[_0x3e09('0x2e')]=_[_0x3e09('0x45')](db['UserProfileSection'][_0x3e09('0x2b')]);_0x329fa1['query']=_[_0x3e09('0x45')](_0x471a95[_0x3e09('0x2f')]);_0x329fa1[_0x3e09('0x30')]=_[_0x3e09('0x31')](_0x329fa1['model'],_0x329fa1['query']);_0x544680['attributes']=_[_0x3e09('0x31')](_0x329fa1[_0x3e09('0x2e')],qs['fields'](_0x471a95[_0x3e09('0x2f')][_0x3e09('0x33')]));_0x544680[_0x3e09('0x32')]=_0x544680[_0x3e09('0x32')][_0x3e09('0x46')]?_0x544680['attributes']:_0x329fa1[_0x3e09('0x2e')];if(_0x471a95['query'][_0x3e09('0x40')]){_0x544680['include']=[{'all':!![]}];}_0x544680=_[_0x3e09('0x3b')]({},_0x544680,_0x471a95[_0x3e09('0x3e')]);return db['UserProfileSection']['find'](_0x544680)[_0x3e09('0x23')](handleEntityNotFound(_0x28ed78,null))[_0x3e09('0x23')](respondWithResult(_0x28ed78,null))['catch'](handleError(_0x28ed78,null));};exports[_0x3e09('0x47')]=function(_0x253978,_0x52d57a){return db[_0x3e09('0x3f')][_0x3e09('0x47')](_0x253978[_0x3e09('0x48')],{})[_0x3e09('0x23')](respondWithResult(_0x52d57a,0xc9))[_0x3e09('0x44')](handleError(_0x52d57a,null));};exports[_0x3e09('0x49')]=function(_0x2c3fbf,_0x2cadcb){if(_0x2c3fbf['body']['id']){delete _0x2c3fbf['body']['id'];}return db['UserProfileSection'][_0x3e09('0x4a')]({'where':{'id':_0x2c3fbf[_0x3e09('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2cadcb,null))['then'](saveUpdates(_0x2c3fbf[_0x3e09('0x48')],null))[_0x3e09('0x23')](respondWithResult(_0x2cadcb,null))[_0x3e09('0x44')](handleError(_0x2cadcb,null));};exports[_0x3e09('0x24')]=function(_0x241ce0,_0x54589e){return db[_0x3e09('0x3f')][_0x3e09('0x4a')]({'where':{'id':_0x241ce0[_0x3e09('0x4b')]['id']}})[_0x3e09('0x23')](handleEntityNotFound(_0x54589e,null))['then'](removeEntity(_0x54589e,null))[_0x3e09('0x44')](handleError(_0x54589e,null));};exports[_0x3e09('0x4c')]=function(_0x1561fb,_0x14e04d){return db[_0x3e09('0x3f')][_0x3e09('0x4c')]()[_0x3e09('0x23')](respondWithResult(_0x14e04d,null))[_0x3e09('0x44')](handleError(_0x14e04d,null));}; \ No newline at end of file +var _0x4846=['rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','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','undefined','limit','count','Content-Range','save','update','destroy','then','error','name','send','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params'];(function(_0x56b43e,_0xc27fb2){var _0xc943e9=function(_0x439cd6){while(--_0x439cd6){_0x56b43e['push'](_0x56b43e['shift']());}};_0xc943e9(++_0xc27fb2);}(_0x4846,0x1bb));var _0x6484=function(_0x391df0,_0x51b2dc){_0x391df0=_0x391df0-0x0;var _0x30bec6=_0x4846[_0x391df0];return _0x30bec6;};'use strict';var emlformat=require(_0x6484('0x0'));var rimraf=require(_0x6484('0x1'));var zipdir=require(_0x6484('0x2'));var jsonpatch=require(_0x6484('0x3'));var rp=require(_0x6484('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6484('0x5'));var csv=require('to-csv');var ejs=require(_0x6484('0x6'));var fs=require('fs');var fs_extra=require(_0x6484('0x7'));var _=require('lodash');var squel=require(_0x6484('0x8'));var crypto=require(_0x6484('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6484('0xa'));var toCsv=require(_0x6484('0xb'));var querystring=require('querystring');var Papa=require(_0x6484('0xc'));var Redis=require('ioredis');var authService=require(_0x6484('0xd'));var qs=require(_0x6484('0xe'));var as=require(_0x6484('0xf'));var hardwareService=require(_0x6484('0x10'));var logger=require(_0x6484('0x11'))(_0x6484('0x12'));var utils=require(_0x6484('0x13'));var config=require(_0x6484('0x14'));var licenseUtil=require(_0x6484('0x15'));var db=require(_0x6484('0x16'))['db'];function respondWithStatusCode(_0x1577a9,_0x5af370){_0x5af370=_0x5af370||0xcc;return function(_0x453bd2){if(_0x453bd2){return _0x1577a9[_0x6484('0x17')](_0x5af370);}return _0x1577a9[_0x6484('0x18')](_0x5af370)[_0x6484('0x19')]();};}function respondWithResult(_0x20dce4,_0x6bc53e){_0x6bc53e=_0x6bc53e||0xc8;return function(_0x11d366){if(_0x11d366){return _0x20dce4[_0x6484('0x18')](_0x6bc53e)[_0x6484('0x1a')](_0x11d366);}};}function respondWithFilteredResult(_0xec352e,_0x1167c5){return function(_0x3cb076){if(_0x3cb076){var _0x2d3b8f=typeof _0x1167c5[_0x6484('0x1b')]===_0x6484('0x1c')&&typeof _0x1167c5[_0x6484('0x1d')]===_0x6484('0x1c');var _0x449929=_0x3cb076['count'];var _0x1d8ede=_0x2d3b8f?0x0:_0x1167c5[_0x6484('0x1b')];var _0x10d84f=_0x2d3b8f?_0x3cb076[_0x6484('0x1e')]:_0x1167c5[_0x6484('0x1b')]+_0x1167c5[_0x6484('0x1d')];var _0x210a35;if(_0x10d84f>=_0x449929){_0x10d84f=_0x449929;_0x210a35=0xc8;}else{_0x210a35=0xce;}_0xec352e[_0x6484('0x18')](_0x210a35);return _0xec352e['set'](_0x6484('0x1f'),_0x1d8ede+'-'+_0x10d84f+'/'+_0x449929)[_0x6484('0x1a')](_0x3cb076);}return null;};}function patchUpdates(_0x14aee8){return function(_0x5ec46f){try{jsonpatch['apply'](_0x5ec46f,_0x14aee8,!![]);}catch(_0x1e8685){return BPromise['reject'](_0x1e8685);}return _0x5ec46f[_0x6484('0x20')]();};}function saveUpdates(_0x3833e5,_0x2952fd){return function(_0x56b22f){if(_0x56b22f){return _0x56b22f[_0x6484('0x21')](_0x3833e5)['then'](function(_0x2c60b9){return _0x2c60b9;});}return null;};}function removeEntity(_0x22a5d2,_0x826d7f){return function(_0x5f15eb){if(_0x5f15eb){return _0x5f15eb[_0x6484('0x22')]()[_0x6484('0x23')](function(){_0x22a5d2[_0x6484('0x18')](0xcc)[_0x6484('0x19')]();});}};}function handleEntityNotFound(_0x532afe,_0x3f6feb){return function(_0x24bacb){if(!_0x24bacb){_0x532afe['sendStatus'](0x194);}return _0x24bacb;};}function handleError(_0x1388b6,_0x262925){_0x262925=_0x262925||0x1f4;return function(_0x1b2a30){logger[_0x6484('0x24')](_0x1b2a30['stack']);if(_0x1b2a30[_0x6484('0x25')]){delete _0x1b2a30[_0x6484('0x25')];}_0x1388b6['status'](_0x262925)[_0x6484('0x26')](_0x1b2a30);};}exports['index']=function(_0x1b58c0,_0x178289){var _0x51bc30={},_0x12d9d6={},_0x102887={'count':0x0,'rows':[]};var _0x455fb3=_[_0x6484('0x27')](db['UserProfileSection']['rawAttributes'],function(_0xb76112){return{'name':_0xb76112[_0x6484('0x28')],'type':_0xb76112[_0x6484('0x29')][_0x6484('0x2a')]};});_0x12d9d6['model']=_[_0x6484('0x27')](_0x455fb3,'name');_0x12d9d6['query']=_[_0x6484('0x2b')](_0x1b58c0[_0x6484('0x2c')]);_0x12d9d6[_0x6484('0x2d')]=_[_0x6484('0x2e')](_0x12d9d6[_0x6484('0x2f')],_0x12d9d6[_0x6484('0x2c')]);_0x51bc30[_0x6484('0x30')]=_['intersection'](_0x12d9d6[_0x6484('0x2f')],qs['fields'](_0x1b58c0[_0x6484('0x2c')][_0x6484('0x31')]));_0x51bc30[_0x6484('0x30')]=_0x51bc30[_0x6484('0x30')][_0x6484('0x32')]?_0x51bc30[_0x6484('0x30')]:_0x12d9d6[_0x6484('0x2f')];if(!_0x1b58c0[_0x6484('0x2c')][_0x6484('0x33')]('nolimit')){_0x51bc30[_0x6484('0x1d')]=qs[_0x6484('0x1d')](_0x1b58c0['query'][_0x6484('0x1d')]);_0x51bc30[_0x6484('0x1b')]=qs['offset'](_0x1b58c0[_0x6484('0x2c')][_0x6484('0x1b')]);}_0x51bc30[_0x6484('0x34')]=qs[_0x6484('0x35')](_0x1b58c0[_0x6484('0x2c')]['sort']);_0x51bc30[_0x6484('0x36')]=qs[_0x6484('0x2d')](_[_0x6484('0x37')](_0x1b58c0[_0x6484('0x2c')],_0x12d9d6[_0x6484('0x2d')]),_0x455fb3);if(_0x1b58c0['query'][_0x6484('0x38')]){_0x51bc30[_0x6484('0x36')]=_[_0x6484('0x39')](_0x51bc30[_0x6484('0x36')],{'$or':_[_0x6484('0x27')](_0x455fb3,function(_0x59a52){if(_0x59a52[_0x6484('0x29')]!==_0x6484('0x3a')){var _0x29f5c1={};_0x29f5c1[_0x59a52['name']]={'$like':'%'+_0x1b58c0[_0x6484('0x2c')][_0x6484('0x38')]+'%'};return _0x29f5c1;}})});}_0x51bc30=_[_0x6484('0x39')]({},_0x51bc30,_0x1b58c0[_0x6484('0x3b')]);var _0x425405={'where':_0x51bc30[_0x6484('0x36')]};return db[_0x6484('0x3c')][_0x6484('0x1e')](_0x425405)['then'](function(_0xfe1700){_0x102887[_0x6484('0x1e')]=_0xfe1700;if(_0x1b58c0[_0x6484('0x2c')][_0x6484('0x3d')]){_0x51bc30[_0x6484('0x3e')]=[{'all':!![]}];}return db[_0x6484('0x3c')][_0x6484('0x3f')](_0x51bc30);})['then'](function(_0x505f4f){_0x102887[_0x6484('0x40')]=_0x505f4f;return _0x102887;})['then'](respondWithFilteredResult(_0x178289,_0x51bc30))[_0x6484('0x41')](handleError(_0x178289,null));};exports[_0x6484('0x42')]=function(_0x301ece,_0x1f3607){var _0x30e47f={'raw':![],'where':{'id':_0x301ece[_0x6484('0x43')]['id']}},_0x440ad5={};_0x440ad5['model']=_[_0x6484('0x2b')](db[_0x6484('0x3c')][_0x6484('0x44')]);_0x440ad5[_0x6484('0x2c')]=_[_0x6484('0x2b')](_0x301ece['query']);_0x440ad5['filters']=_['intersection'](_0x440ad5[_0x6484('0x2f')],_0x440ad5['query']);_0x30e47f[_0x6484('0x30')]=_[_0x6484('0x2e')](_0x440ad5[_0x6484('0x2f')],qs[_0x6484('0x31')](_0x301ece[_0x6484('0x2c')][_0x6484('0x31')]));_0x30e47f[_0x6484('0x30')]=_0x30e47f[_0x6484('0x30')][_0x6484('0x32')]?_0x30e47f[_0x6484('0x30')]:_0x440ad5[_0x6484('0x2f')];if(_0x301ece[_0x6484('0x2c')][_0x6484('0x3d')]){_0x30e47f[_0x6484('0x3e')]=[{'all':!![]}];}_0x30e47f=_['merge']({},_0x30e47f,_0x301ece[_0x6484('0x3b')]);return db[_0x6484('0x3c')][_0x6484('0x45')](_0x30e47f)['then'](handleEntityNotFound(_0x1f3607,null))[_0x6484('0x23')](respondWithResult(_0x1f3607,null))[_0x6484('0x41')](handleError(_0x1f3607,null));};exports[_0x6484('0x46')]=function(_0x27988a,_0x245a36){return db[_0x6484('0x3c')][_0x6484('0x46')](_0x27988a[_0x6484('0x47')],{})[_0x6484('0x23')](respondWithResult(_0x245a36,0xc9))['catch'](handleError(_0x245a36,null));};exports[_0x6484('0x21')]=function(_0x36a8b5,_0x17e834){if(_0x36a8b5[_0x6484('0x47')]['id']){delete _0x36a8b5['body']['id'];}return db['UserProfileSection'][_0x6484('0x45')]({'where':{'id':_0x36a8b5[_0x6484('0x43')]['id']}})[_0x6484('0x23')](handleEntityNotFound(_0x17e834,null))[_0x6484('0x23')](saveUpdates(_0x36a8b5['body'],null))['then'](respondWithResult(_0x17e834,null))[_0x6484('0x41')](handleError(_0x17e834,null));};exports[_0x6484('0x22')]=function(_0x55ed59,_0x11f7cb){return db[_0x6484('0x3c')][_0x6484('0x45')]({'where':{'id':_0x55ed59[_0x6484('0x43')]['id']}})['then'](handleEntityNotFound(_0x11f7cb,null))[_0x6484('0x23')](removeEntity(_0x11f7cb,null))[_0x6484('0x41')](handleError(_0x11f7cb,null));};exports[_0x6484('0x48')]=function(_0x1a89d1,_0x4195d3){return db['UserProfileSection']['describe']()[_0x6484('0x23')](respondWithResult(_0x4195d3,null))[_0x6484('0x41')](handleError(_0x4195d3,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 1344466..6d6caf9 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 _0x2577=['request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','moment'];(function(_0x44f2db,_0x65594e){var _0x444fb5=function(_0xf00f74){while(--_0xf00f74){_0x44f2db['push'](_0x44f2db['shift']());}};_0x444fb5(++_0x65594e);}(_0x2577,0x1e6));var _0x7257=function(_0xf58718,_0x33541a){_0xf58718=_0xf58718-0x0;var _0x5aea10=_0x2577[_0xf58718];return _0x5aea10;};'use strict';var _=require(_0x7257('0x0'));var util=require(_0x7257('0x1'));var logger=require(_0x7257('0x2'))('api');var moment=require(_0x7257('0x3'));var BPromise=require('bluebird');var rp=require(_0x7257('0x4'));var fs=require('fs');var path=require(_0x7257('0x5'));var rimraf=require(_0x7257('0x6'));var config=require(_0x7257('0x7'));var attributes=require(_0x7257('0x8'));module[_0x7257('0x9')]=function(_0x405c9e,_0x5a3bda){return _0x405c9e['define'](_0x7257('0xa'),attributes,{'tableName':_0x7257('0xb'),'paranoid':![],'indexes':[{'name':_0x7257('0xc'),'fields':['sectionId',_0x7257('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5965=['userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','sectionId'];(function(_0x4f5c31,_0xb1d521){var _0x3ddacd=function(_0x15aa24){while(--_0x15aa24){_0x4f5c31['push'](_0x4f5c31['shift']());}};_0x3ddacd(++_0xb1d521);}(_0x5965,0x8d));var _0x5596=function(_0x48a3d5,_0x3a6124){_0x48a3d5=_0x48a3d5-0x0;var _0x24a4f0=_0x5965[_0x48a3d5];return _0x24a4f0;};'use strict';var _=require(_0x5596('0x0'));var util=require('util');var logger=require(_0x5596('0x1'))(_0x5596('0x2'));var moment=require(_0x5596('0x3'));var BPromise=require(_0x5596('0x4'));var rp=require(_0x5596('0x5'));var fs=require('fs');var path=require(_0x5596('0x6'));var rimraf=require('rimraf');var config=require(_0x5596('0x7'));var attributes=require(_0x5596('0x8'));module[_0x5596('0x9')]=function(_0x3c54f6,_0x546c3f){return _0x3c54f6[_0x5596('0xa')]('UserProfileSection',attributes,{'tableName':_0x5596('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x5596('0xc'),_0x5596('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ba15cba..ca25e60 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 _0x22f1=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xf440f8,_0x2a7d1a){var _0x373320=function(_0x4026ee){while(--_0x4026ee){_0xf440f8['push'](_0xf440f8['shift']());}};_0x373320(++_0x2a7d1a);}(_0x22f1,0xbd));var _0x122f=function(_0x2f4a13,_0x422095){_0x2f4a13=_0x2f4a13-0x0;var _0x239dad=_0x22f1[_0x2f4a13];return _0x239dad;};'use strict';var _=require(_0x122f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x122f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x122f('0x2'));var db=require(_0x122f('0x3'))['db'];var utils=require(_0x122f('0x4'));var logger=require(_0x122f('0x5'))(_0x122f('0x6'));var config=require(_0x122f('0x7'));var jayson=require(_0x122f('0x8'));var client=jayson[_0x122f('0x9')][_0x122f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x766b2c,_0x1d95fc,_0x5ea110){return new BPromise(function(_0x261fa6,_0x35f0e9){return client[_0x122f('0xb')](_0x766b2c,_0x5ea110)['then'](function(_0x40eefd){logger['info'](_0x122f('0xc'),_0x1d95fc,_0x122f('0xd'));logger['debug'](_0x122f('0xe'),_0x1d95fc,_0x122f('0xd'),JSON[_0x122f('0xf')](_0x40eefd));if(_0x40eefd[_0x122f('0x10')]){if(_0x40eefd[_0x122f('0x10')][_0x122f('0x11')]===0x1f4){logger['error'](_0x122f('0xc'),_0x1d95fc,_0x40eefd[_0x122f('0x10')][_0x122f('0x12')]);return _0x35f0e9(_0x40eefd['error'][_0x122f('0x12')]);}logger[_0x122f('0x10')](_0x122f('0xc'),_0x1d95fc,_0x40eefd[_0x122f('0x10')][_0x122f('0x12')]);return _0x261fa6(_0x40eefd['error'][_0x122f('0x12')]);}else{logger[_0x122f('0x13')](_0x122f('0xc'),_0x1d95fc,_0x122f('0xd'));_0x261fa6(_0x40eefd[_0x122f('0x14')]['message']);}})['catch'](function(_0x24d3bb){logger[_0x122f('0x10')](_0x122f('0xc'),_0x1d95fc,_0x24d3bb);_0x35f0e9(_0x24d3bb);});});} \ No newline at end of file +var _0xe74e=['http','request','info','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2b6599,_0x4b5e81){var _0x18431d=function(_0x51619d){while(--_0x51619d){_0x2b6599['push'](_0x2b6599['shift']());}};_0x18431d(++_0x4b5e81);}(_0xe74e,0x146));var _0xee74=function(_0x35f01b,_0x1205c0){_0x35f01b=_0x35f01b-0x0;var _0x51785d=_0xe74e[_0x35f01b];return _0x51785d;};'use strict';var _=require(_0xee74('0x0'));var util=require(_0xee74('0x1'));var moment=require(_0xee74('0x2'));var BPromise=require(_0xee74('0x3'));var rs=require(_0xee74('0x4'));var fs=require('fs');var Redis=require(_0xee74('0x5'));var db=require(_0xee74('0x6'))['db'];var utils=require(_0xee74('0x7'));var logger=require('../../config/logger')(_0xee74('0x8'));var config=require(_0xee74('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc5aaac,_0x2f6479,_0x38a4bf){return new BPromise(function(_0x4a45d7,_0x1b3606){return client[_0xee74('0xb')](_0xc5aaac,_0x38a4bf)['then'](function(_0x41bb60){logger[_0xee74('0xc')](_0xee74('0xd'),_0x2f6479,'request\x20sent');logger['debug'](_0xee74('0xe'),_0x2f6479,_0xee74('0xf'),JSON['stringify'](_0x41bb60));if(_0x41bb60[_0xee74('0x10')]){if(_0x41bb60[_0xee74('0x10')][_0xee74('0x11')]===0x1f4){logger[_0xee74('0x10')](_0xee74('0xd'),_0x2f6479,_0x41bb60[_0xee74('0x10')][_0xee74('0x12')]);return _0x1b3606(_0x41bb60[_0xee74('0x10')][_0xee74('0x12')]);}logger[_0xee74('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x2f6479,_0x41bb60[_0xee74('0x10')][_0xee74('0x12')]);return _0x4a45d7(_0x41bb60[_0xee74('0x10')][_0xee74('0x12')]);}else{logger[_0xee74('0xc')](_0xee74('0xd'),_0x2f6479,_0xee74('0xf'));_0x4a45d7(_0x41bb60[_0xee74('0x13')]['message']);}})[_0xee74('0x14')](function(_0x5d4f98){logger[_0xee74('0x10')](_0xee74('0xd'),_0x2f6479,_0x5d4f98);_0x1b3606(_0x5d4f98);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c6ba2c9..063cd5b 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4ddf1d,_0x5d8ce2){var _0x189c9f=function(_0x398e73){while(--_0x398e73){_0x4ddf1d['push'](_0x4ddf1d['shift']());}};_0x189c9f(++_0x5d8ce2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xcb91[_0x1969a7];return _0x3d665f;};'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 552003e..4d6730e 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 _0xe713=['sequelize','exports'];(function(_0xc4a198,_0x5ded7b){var _0x43bdc7=function(_0x125d3d){while(--_0x125d3d){_0xc4a198['push'](_0xc4a198['shift']());}};_0x43bdc7(++_0x5ded7b);}(_0xe713,0x1dc));var _0x3e71=function(_0xd8efb0,_0x2fb48b){_0xd8efb0=_0xd8efb0-0x0;var _0x3d962c=_0xe713[_0xd8efb0];return _0x3d962c;};'use strict';var Sequelize=require(_0x3e71('0x0'));module[_0x3e71('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa997=['sequelize','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa997,0x1c4));var _0x7a99=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0xa997[_0x5eef05];return _0x56d4b8;};'use strict';var Sequelize=require(_0x7a99('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7a99('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index b75b58d..d9977b2 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 _0x3d04=['../../config/environment','./userSmsQueue.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30804d,_0x38b1a4){var _0x3bdf9f=function(_0x3f86cf){while(--_0x3f86cf){_0x30804d['push'](_0x30804d['shift']());}};_0x3bdf9f(++_0x38b1a4);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));module[_0x43d0('0xa')]=function(_0x617bf,_0x5e284f){return _0x617bf['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7046=['path','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2f898b,_0xea7205){var _0x16a4b4=function(_0x489275){while(--_0x489275){_0x2f898b['push'](_0x2f898b['shift']());}};_0x16a4b4(++_0xea7205);}(_0x7046,0x144));var _0x6704=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7046[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 007578b..588fd53 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 _0xcf88=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash'];(function(_0x52b6dc,_0x271723){var _0x351ddd=function(_0x38191b){while(--_0x38191b){_0x52b6dc['push'](_0x52b6dc['shift']());}};_0x351ddd(++_0x271723);}(_0xcf88,0x164));var _0x8cf8=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xcf88[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x8cf8('0x0'));var util=require(_0x8cf8('0x1'));var moment=require(_0x8cf8('0x2'));var BPromise=require(_0x8cf8('0x3'));var rs=require(_0x8cf8('0x4'));var fs=require('fs');var Redis=require(_0x8cf8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8cf8('0x6'))(_0x8cf8('0x7'));var config=require(_0x8cf8('0x8'));var jayson=require(_0x8cf8('0x9'));var client=jayson[_0x8cf8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1be268,_0x1d0919,_0x5c9180){return new BPromise(function(_0x173b3a,_0x1e9af8){return client[_0x8cf8('0xb')](_0x1be268,_0x5c9180)[_0x8cf8('0xc')](function(_0x4f1b0c){logger['info'](_0x8cf8('0xd'),_0x1d0919,_0x8cf8('0xe'));logger['debug'](_0x8cf8('0xf'),_0x1d0919,_0x8cf8('0xe'),JSON['stringify'](_0x4f1b0c));if(_0x4f1b0c[_0x8cf8('0x10')]){if(_0x4f1b0c[_0x8cf8('0x10')][_0x8cf8('0x11')]===0x1f4){logger[_0x8cf8('0x10')](_0x8cf8('0xd'),_0x1d0919,_0x4f1b0c[_0x8cf8('0x10')][_0x8cf8('0x12')]);return _0x1e9af8(_0x4f1b0c[_0x8cf8('0x10')][_0x8cf8('0x12')]);}logger[_0x8cf8('0x10')](_0x8cf8('0xd'),_0x1d0919,_0x4f1b0c[_0x8cf8('0x10')][_0x8cf8('0x12')]);return _0x173b3a(_0x4f1b0c[_0x8cf8('0x10')][_0x8cf8('0x12')]);}else{logger[_0x8cf8('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x1d0919,_0x8cf8('0xe'));_0x173b3a(_0x4f1b0c['result'][_0x8cf8('0x12')]);}})[_0x8cf8('0x14')](function(_0x10ca74){logger['error'](_0x8cf8('0xd'),_0x1d0919,_0x10ca74);_0x1e9af8(_0x10ca74);});});} \ No newline at end of file +var _0xbce8=['../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','error','UserSmsQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbce8,0x84));var _0x8bce=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0xbce8[_0x4f08dd];return _0x3017ee;};'use strict';var _=require(_0x8bce('0x0'));var util=require(_0x8bce('0x1'));var moment=require(_0x8bce('0x2'));var BPromise=require(_0x8bce('0x3'));var rs=require(_0x8bce('0x4'));var fs=require('fs');var Redis=require(_0x8bce('0x5'));var db=require(_0x8bce('0x6'))['db'];var utils=require(_0x8bce('0x7'));var logger=require(_0x8bce('0x8'))(_0x8bce('0x9'));var config=require(_0x8bce('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8bce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dec89,_0x4e0644,_0x2e76e2){return new BPromise(function(_0x3ade6d,_0x25df03){return client[_0x8bce('0xc')](_0x2dec89,_0x2e76e2)['then'](function(_0x32acf9){logger[_0x8bce('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4e0644,_0x8bce('0xe'));logger[_0x8bce('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4e0644,_0x8bce('0xe'),JSON['stringify'](_0x32acf9));if(_0x32acf9[_0x8bce('0x10')]){if(_0x32acf9['error']['code']===0x1f4){logger[_0x8bce('0x10')](_0x8bce('0x11'),_0x4e0644,_0x32acf9['error']['message']);return _0x25df03(_0x32acf9['error'][_0x8bce('0x12')]);}logger[_0x8bce('0x10')](_0x8bce('0x11'),_0x4e0644,_0x32acf9['error'][_0x8bce('0x12')]);return _0x3ade6d(_0x32acf9[_0x8bce('0x10')][_0x8bce('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x4e0644,_0x8bce('0xe'));_0x3ade6d(_0x32acf9[_0x8bce('0x13')][_0x8bce('0x12')]);}})['catch'](function(_0x3243de){logger[_0x8bce('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4e0644,_0x3243de);_0x25df03(_0x3243de);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2787da5..9e96454 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 _0x066c=['exports','INTEGER','sequelize'];(function(_0x2d9389,_0x708a7a){var _0x2c24a5=function(_0x4aecc8){while(--_0x4aecc8){_0x2d9389['push'](_0x2d9389['shift']());}};_0x2c24a5(++_0x708a7a);}(_0x066c,0x15e));var _0xc066=function(_0x117f1d,_0x4aa481){_0x117f1d=_0x117f1d-0x0;var _0x23ed07=_0x066c[_0x117f1d];return _0x23ed07;};'use strict';var Sequelize=require(_0xc066('0x0'));module[_0xc066('0x1')]={'UserId':{'type':Sequelize[_0xc066('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xc066('0x2')]}}; \ No newline at end of file +var _0x33b6=['INTEGER','exports'];(function(_0x37d542,_0x12dca0){var _0x2293f6=function(_0xd47657){while(--_0xd47657){_0x37d542['push'](_0x37d542['shift']());}};_0x2293f6(++_0x12dca0);}(_0x33b6,0x93));var _0x633b=function(_0x131c81,_0x12fe63){_0x131c81=_0x131c81-0x0;var _0x241e7a=_0x33b6[_0x131c81];return _0x241e7a;};'use strict';var Sequelize=require('sequelize');module[_0x633b('0x0')]={'UserId':{'type':Sequelize[_0x633b('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x633b('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index cdc7acb..53329f3 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(_0x3a5863,_0x468a67){var _0x2f460b=function(_0x49d5b6){while(--_0x49d5b6){_0x3a5863['push'](_0x3a5863['shift']());}};_0x2f460b(++_0x468a67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x89ebdf,_0x5739a4){var _0x13849c=function(_0x40feb5){while(--_0x40feb5){_0x89ebdf['push'](_0x89ebdf['shift']());}};_0x13849c(++_0x5739a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 d287f91..e395e55 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x587288,_0x582bac){var _0x52319e=function(_0x103062){while(--_0x103062){_0x587288['push'](_0x587288['shift']());}};_0x52319e(++_0x582bac);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x52cafe,_0x41d4dc){var _0x54636b=function(_0x137d21){while(--_0x137d21){_0x52cafe['push'](_0x52cafe['shift']());}};_0x54636b(++_0x41d4dc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 63cd76b..4cc1ab6 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 _0x9d96=['INTEGER','sequelize','exports'];(function(_0x1b4e88,_0x392683){var _0x3e56f7=function(_0x2b38b2){while(--_0x2b38b2){_0x1b4e88['push'](_0x1b4e88['shift']());}};_0x3e56f7(++_0x392683);}(_0x9d96,0xfd));var _0x69d9=function(_0x58599a,_0x1cc5cc){_0x58599a=_0x58599a-0x0;var _0xdce490=_0x9d96[_0x58599a];return _0xdce490;};'use strict';var Sequelize=require(_0x69d9('0x0'));module[_0x69d9('0x1')]={'penalty':{'type':Sequelize[_0x69d9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9b75=['exports','INTEGER','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9b75,0x1b5));var _0x59b7=function(_0x4690ea,_0x28a52d){_0x4690ea=_0x4690ea-0x0;var _0x3b67a7=_0x9b75[_0x4690ea];return _0x3b67a7;};'use strict';var Sequelize=require(_0x59b7('0x0'));module[_0x59b7('0x1')]={'penalty':{'type':Sequelize[_0x59b7('0x2')],'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 5ac1f05..e6b32f2 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 _0xb296=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x3e56fc,_0x336119){var _0x1e866b=function(_0x3dc12a){while(--_0x3dc12a){_0x3e56fc['push'](_0x3e56fc['shift']());}};_0x1e866b(++_0x336119);}(_0xb296,0x125));var _0x6b29=function(_0x40e983,_0x338026){_0x40e983=_0x40e983-0x0;var _0x1dc0d2=_0xb296[_0x40e983];return _0x1dc0d2;};'use strict';var _=require(_0x6b29('0x0'));var util=require(_0x6b29('0x1'));var logger=require(_0x6b29('0x2'))(_0x6b29('0x3'));var moment=require(_0x6b29('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b29('0x5'));var fs=require('fs');var path=require(_0x6b29('0x6'));var rimraf=require(_0x6b29('0x7'));var config=require(_0x6b29('0x8'));var attributes=require(_0x6b29('0x9'));module[_0x6b29('0xa')]=function(_0x392eb2,_0x4fbdb2){return _0x392eb2[_0x6b29('0xb')](_0x6b29('0xc'),attributes,{'tableName':_0x6b29('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadd4=['define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports'];(function(_0x242ab7,_0x5637f0){var _0x16d17b=function(_0x5a59ec){while(--_0x5a59ec){_0x242ab7['push'](_0x242ab7['shift']());}};_0x16d17b(++_0x5637f0);}(_0xadd4,0x93));var _0x4add=function(_0x194bd8,_0x47a1b6){_0x194bd8=_0x194bd8-0x0;var _0x4ab5e6=_0xadd4[_0x194bd8];return _0x4ab5e6;};'use strict';var _=require('lodash');var util=require(_0x4add('0x0'));var logger=require(_0x4add('0x1'))('api');var moment=require(_0x4add('0x2'));var BPromise=require('bluebird');var rp=require(_0x4add('0x3'));var fs=require('fs');var path=require(_0x4add('0x4'));var rimraf=require(_0x4add('0x5'));var config=require(_0x4add('0x6'));var attributes=require(_0x4add('0x7'));module[_0x4add('0x8')]=function(_0x1d34db,_0x32a0be){return _0x1d34db[_0x4add('0x9')](_0x4add('0xa'),attributes,{'tableName':_0x4add('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 086eb76..e1d0fac 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 _0x4276=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x27a075,_0x3a8bf){var _0x23140d=function(_0x2ac463){while(--_0x2ac463){_0x27a075['push'](_0x27a075['shift']());}};_0x23140d(++_0x3a8bf);}(_0x4276,0x81));var _0x6427=function(_0x1029cd,_0x33c5b5){_0x1029cd=_0x1029cd-0x0;var _0x22c576=_0x4276[_0x1029cd];return _0x22c576;};'use strict';var _=require('lodash');var util=require(_0x6427('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6427('0x1'));var fs=require('fs');var Redis=require(_0x6427('0x2'));var db=require(_0x6427('0x3'))['db'];var utils=require(_0x6427('0x4'));var logger=require(_0x6427('0x5'))('rpc');var config=require(_0x6427('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6427('0x7')][_0x6427('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x308d33,_0x2c3e8a,_0x5ccf61){return new BPromise(function(_0x27fc4b,_0x44302){return client[_0x6427('0x9')](_0x308d33,_0x5ccf61)[_0x6427('0xa')](function(_0x2eba20){logger[_0x6427('0xb')](_0x6427('0xc'),_0x2c3e8a,_0x6427('0xd'));logger[_0x6427('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2c3e8a,_0x6427('0xd'),JSON[_0x6427('0xf')](_0x2eba20));if(_0x2eba20[_0x6427('0x10')]){if(_0x2eba20[_0x6427('0x10')][_0x6427('0x11')]===0x1f4){logger[_0x6427('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x2c3e8a,_0x2eba20[_0x6427('0x10')][_0x6427('0x12')]);return _0x44302(_0x2eba20['error'][_0x6427('0x12')]);}logger[_0x6427('0x10')](_0x6427('0xc'),_0x2c3e8a,_0x2eba20[_0x6427('0x10')][_0x6427('0x12')]);return _0x27fc4b(_0x2eba20[_0x6427('0x10')][_0x6427('0x12')]);}else{logger[_0x6427('0xb')](_0x6427('0xc'),_0x2c3e8a,_0x6427('0xd'));_0x27fc4b(_0x2eba20[_0x6427('0x13')][_0x6427('0x12')]);}})[_0x6427('0x14')](function(_0x48011d){logger[_0x6427('0x10')](_0x6427('0xc'),_0x2c3e8a,_0x48011d);_0x44302(_0x48011d);});});} \ No newline at end of file +var _0xefdf=['client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xefdf,0x1dc));var _0xfefd=function(_0x36ee93,_0x502135){_0x36ee93=_0x36ee93-0x0;var _0x2a936c=_0xefdf[_0x36ee93];return _0x2a936c;};'use strict';var _=require(_0xfefd('0x0'));var util=require(_0xfefd('0x1'));var moment=require(_0xfefd('0x2'));var BPromise=require(_0xfefd('0x3'));var rs=require(_0xfefd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfefd('0x5'));var logger=require('../../config/logger')(_0xfefd('0x6'));var config=require('../../config/environment');var jayson=require(_0xfefd('0x7'));var client=jayson[_0xfefd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59e8d0,_0x55e087,_0x3cfa8c){return new BPromise(function(_0xe1ee88,_0xedeab4){return client[_0xfefd('0x9')](_0x59e8d0,_0x3cfa8c)[_0xfefd('0xa')](function(_0x34680e){logger[_0xfefd('0xb')](_0xfefd('0xc'),_0x55e087,_0xfefd('0xd'));logger[_0xfefd('0xe')](_0xfefd('0xf'),_0x55e087,'request\x20sent',JSON[_0xfefd('0x10')](_0x34680e));if(_0x34680e[_0xfefd('0x11')]){if(_0x34680e[_0xfefd('0x11')][_0xfefd('0x12')]===0x1f4){logger[_0xfefd('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x55e087,_0x34680e[_0xfefd('0x11')][_0xfefd('0x13')]);return _0xedeab4(_0x34680e['error'][_0xfefd('0x13')]);}logger[_0xfefd('0x11')](_0xfefd('0xc'),_0x55e087,_0x34680e[_0xfefd('0x11')][_0xfefd('0x13')]);return _0xe1ee88(_0x34680e['error'][_0xfefd('0x13')]);}else{logger['info'](_0xfefd('0xc'),_0x55e087,_0xfefd('0xd'));_0xe1ee88(_0x34680e[_0xfefd('0x14')]['message']);}})[_0xfefd('0x15')](function(_0x473da4){logger[_0xfefd('0x11')](_0xfefd('0xc'),_0x55e087,_0x473da4);_0xedeab4(_0x473da4);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 074564f..c634240 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x12d75f,_0x4f3762){var _0x5b9dd3=function(_0x5367e6){while(--_0x5367e6){_0x12d75f['push'](_0x12d75f['shift']());}};_0x5b9dd3(++_0x4f3762);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x30c8c8,_0x471ee8){var _0x51857e=function(_0x34ed5c){while(--_0x34ed5c){_0x30c8c8['push'](_0x30c8c8['shift']());}};_0x51857e(++_0x471ee8);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index da2eb8d..e47095a 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 _0x7914=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x38d92a,_0x25b571){var _0x577c8a=function(_0x5afaff){while(--_0x5afaff){_0x38d92a['push'](_0x38d92a['shift']());}};_0x577c8a(++_0x25b571);}(_0x7914,0x136));var _0x4791=function(_0x4deeef,_0xdfad5a){_0x4deeef=_0x4deeef-0x0;var _0x5cfd23=_0x7914[_0x4deeef];return _0x5cfd23;};'use strict';var Sequelize=require('sequelize');module[_0x4791('0x0')]={'uniqueid':{'type':Sequelize[_0x4791('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x4791('0x2')],'allowNull':![],'comment':_0x4791('0x3')},'UserId':{'type':Sequelize[_0x4791('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4791('0x2')],'allowNull':![],'unique':_0x4791('0x4'),'comment':_0x4791('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x4791('0x2')],'allowNull':![],'unique':_0x4791('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x4791('0x1')](0xb),'defaultValue':0x0,'comment':_0x4791('0x3')},'paused':{'type':Sequelize[_0x4791('0x1')](0xb),'defaultValue':0x0,'comment':_0x4791('0x3')}}; \ No newline at end of file +var _0x4afd=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','INTEGER'];(function(_0xfc8faf,_0x86244a){var _0x48c40b=function(_0x107c22){while(--_0x107c22){_0xfc8faf['push'](_0xfc8faf['shift']());}};_0x48c40b(++_0x86244a);}(_0x4afd,0x1d9));var _0xd4af=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4afd[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0xd4af('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd4af('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd4af('0x2')},'membername':{'type':Sequelize[_0xd4af('0x3')],'allowNull':![],'comment':_0xd4af('0x2')},'UserId':{'type':Sequelize[_0xd4af('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd4af('0x3')],'allowNull':![],'unique':_0xd4af('0x4'),'comment':_0xd4af('0x2')},'VoiceQueueId':{'type':Sequelize[_0xd4af('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xd4af('0x3')],'allowNull':![],'unique':_0xd4af('0x4'),'comment':_0xd4af('0x2')},'penalty':{'type':Sequelize[_0xd4af('0x1')](0xb),'defaultValue':0x0,'comment':_0xd4af('0x2')},'paused':{'type':Sequelize[_0xd4af('0x1')](0xb),'defaultValue':0x0,'comment':_0xd4af('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 6ba9db2..8c4f74a 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 _0xffc8=['remove','emit','hasOwnProperty','hook','exports','UserVoiceQueueRt','save'];(function(_0x306240,_0x4e980a){var _0x8b2e3b=function(_0x4c40be){while(--_0x4c40be){_0x306240['push'](_0x306240['shift']());}};_0x8b2e3b(++_0x4e980a);}(_0xffc8,0xc2));var _0x8ffc=function(_0x45cea1,_0x5600a4){_0x45cea1=_0x45cea1-0x0;var _0x4f09ca=_0xffc8[_0x45cea1];return _0x4f09ca;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x8ffc('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8ffc('0x1'),'afterUpdate':'update','afterDestroy':_0x8ffc('0x2')};function emitEvent(_0x2e6f55){return function(_0x4e0bb6,_0x12c781,_0x1660fe){UserVoiceQueueRtEvents[_0x8ffc('0x3')](_0x2e6f55+':'+_0x4e0bb6['id'],_0x4e0bb6);UserVoiceQueueRtEvents[_0x8ffc('0x3')](_0x2e6f55,_0x4e0bb6);_0x1660fe(null);};}for(var e in events){if(events[_0x8ffc('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0x8ffc('0x5')](e,emitEvent(event));}}module[_0x8ffc('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x443f=['exports','events','UserVoiceQueueRt','setMaxListeners','save','update','emit','hook'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x443f,0xd1));var _0xf443=function(_0x7670a7,_0x5d628a){_0x7670a7=_0x7670a7-0x0;var _0xb6bb41=_0x443f[_0x7670a7];return _0xb6bb41;};'use strict';var EventEmitter=require(_0xf443('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xf443('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf443('0x2')](0x0);var events={'afterCreate':_0xf443('0x3'),'afterUpdate':_0xf443('0x4'),'afterDestroy':'remove'};function emitEvent(_0x55b723){return function(_0x4ee495,_0x15e0b5,_0x23febd){UserVoiceQueueRtEvents[_0xf443('0x5')](_0x55b723+':'+_0x4ee495['id'],_0x4ee495);UserVoiceQueueRtEvents[_0xf443('0x5')](_0x55b723,_0x4ee495);_0x23febd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xf443('0x6')](e,emitEvent(event));}}module[_0xf443('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 6827d55..386cd11 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 _0xeb74=['rimraf','exports','define','UserVoiceQueueRt','lodash','../../config/logger','moment','bluebird','path'];(function(_0x40ce07,_0x2d9283){var _0x2493a0=function(_0x3351cd){while(--_0x3351cd){_0x40ce07['push'](_0x40ce07['shift']());}};_0x2493a0(++_0x2d9283);}(_0xeb74,0x1f3));var _0x4eb7=function(_0x290aa2,_0x3ee5fa){_0x290aa2=_0x290aa2-0x0;var _0x24b82f=_0xeb74[_0x290aa2];return _0x24b82f;};'use strict';var _=require(_0x4eb7('0x0'));var util=require('util');var logger=require(_0x4eb7('0x1'))('api');var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4eb7('0x4'));var rimraf=require(_0x4eb7('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x4eb7('0x6')]=function(_0x206e2d,_0x446aa4){return _0x206e2d[_0x4eb7('0x7')](_0x4eb7('0x8'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0323=['user_has_voice_queues_rt','util','../../config/logger','bluebird','path','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt'];(function(_0x58b31a,_0x3854dc){var _0x57c068=function(_0x2f11e7){while(--_0x2f11e7){_0x58b31a['push'](_0x58b31a['shift']());}};_0x57c068(++_0x3854dc);}(_0x0323,0x111));var _0x3032=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x0323[_0x5458a6];return _0x2669fc;};'use strict';var _=require('lodash');var util=require(_0x3032('0x0'));var logger=require(_0x3032('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3032('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3032('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3032('0x4'));module[_0x3032('0x5')]=function(_0x5c5cba,_0x55ed93){return _0x5c5cba['define'](_0x3032('0x6'),attributes,{'tableName':_0x3032('0x7'),'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 ed0ed47..f7fcc43 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 _0xef67=['code','message','request\x20sent','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','stringify','error'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xef67,0x1d6));var _0x7ef6=function(_0x5b45da,_0x52bb87){_0x5b45da=_0x5b45da-0x0;var _0x2327f7=_0xef67[_0x5b45da];return _0x2327f7;};'use strict';var _=require(_0x7ef6('0x0'));var util=require(_0x7ef6('0x1'));var moment=require(_0x7ef6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ef6('0x3'));var db=require(_0x7ef6('0x4'))['db'];var utils=require(_0x7ef6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7ef6('0x6'));var jayson=require(_0x7ef6('0x7'));var client=jayson[_0x7ef6('0x8')]['http']({'port':0x232a});config[_0x7ef6('0x9')]=_[_0x7ef6('0xa')](config[_0x7ef6('0x9')],{'host':_0x7ef6('0xb'),'port':0x18eb});var socket=require(_0x7ef6('0xc'))(new Redis(config[_0x7ef6('0x9')]));require(_0x7ef6('0xd'))['register'](socket);function respondWithRpcPromise(_0x3cd850,_0x3a6402,_0x4c931b){return new BPromise(function(_0x28640a,_0x51c741){return client['request'](_0x3cd850,_0x4c931b)[_0x7ef6('0xe')](function(_0x4cb48b){logger[_0x7ef6('0xf')](_0x7ef6('0x10'),_0x3a6402,'request\x20sent');logger[_0x7ef6('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3a6402,'request\x20sent',JSON[_0x7ef6('0x12')](_0x4cb48b));if(_0x4cb48b[_0x7ef6('0x13')]){if(_0x4cb48b[_0x7ef6('0x13')][_0x7ef6('0x14')]===0x1f4){logger[_0x7ef6('0x13')](_0x7ef6('0x10'),_0x3a6402,_0x4cb48b[_0x7ef6('0x13')][_0x7ef6('0x15')]);return _0x51c741(_0x4cb48b[_0x7ef6('0x13')]['message']);}logger[_0x7ef6('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3a6402,_0x4cb48b[_0x7ef6('0x13')][_0x7ef6('0x15')]);return _0x28640a(_0x4cb48b[_0x7ef6('0x13')][_0x7ef6('0x15')]);}else{logger[_0x7ef6('0xf')](_0x7ef6('0x10'),_0x3a6402,_0x7ef6('0x16'));_0x28640a(_0x4cb48b[_0x7ef6('0x17')][_0x7ef6('0x15')]);}})[_0x7ef6('0x18')](function(_0x1f6e58){logger[_0x7ef6('0x13')](_0x7ef6('0x10'),_0x3a6402,_0x1f6e58);_0x51c741(_0x1f6e58);});});}exports[_0x7ef6('0x19')]=function(_0x31f5cc){var _0x314fde=this;return new Promise(function(_0x1cc2f0,_0x1b41ba){return db[_0x7ef6('0x1a')][_0x7ef6('0x1b')]({'raw':_0x31f5cc[_0x7ef6('0x1c')]?_0x31f5cc[_0x7ef6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x31f5cc['options']?_0x31f5cc['options'][_0x7ef6('0x1d')]||null:null,'attributes':[[db[_0x7ef6('0x1e')]['fn'](_0x7ef6('0x1f'),db[_0x7ef6('0x1e')]['fn']('IF',db['sequelize'][_0x7ef6('0x20')](_0x7ef6('0x21')))),_0x7ef6('0x22')]]})['then'](function(_0x5a1378){logger['info'](_0x7ef6('0x19'),_0x31f5cc);logger[_0x7ef6('0x11')](_0x7ef6('0x19'),_0x31f5cc,JSON[_0x7ef6('0x12')](_0x5a1378));_0x1cc2f0(_0x5a1378);})[_0x7ef6('0x18')](function(_0x377260){logger['error']('GetVoiceQueueRtPauses',_0x377260[_0x7ef6('0x15')],_0x31f5cc);_0x1b41ba(_0x314fde['error'](0x1f4,_0x377260[_0x7ef6('0x15')]));});});}; \ No newline at end of file +var _0x967e=['code','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xe695fa,_0x387982){var _0x48660b=function(_0x53cda4){while(--_0x53cda4){_0xe695fa['push'](_0xe695fa['shift']());}};_0x48660b(++_0x387982);}(_0x967e,0x1bd));var _0xe967=function(_0x26a58d,_0x528af5){_0x26a58d=_0x26a58d-0x0;var _0x1de8a1=_0x967e[_0x26a58d];return _0x1de8a1;};'use strict';var _=require(_0xe967('0x0'));var util=require('util');var moment=require(_0xe967('0x1'));var BPromise=require(_0xe967('0x2'));var rs=require(_0xe967('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe967('0x4'))['db'];var utils=require(_0xe967('0x5'));var logger=require('../../config/logger')(_0xe967('0x6'));var config=require(_0xe967('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xe967('0x8')]=_[_0xe967('0x9')](config[_0xe967('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe967('0xa'))(new Redis(config[_0xe967('0x8')]));require(_0xe967('0xb'))[_0xe967('0xc')](socket);function respondWithRpcPromise(_0x32c594,_0x396840,_0x4cde86){return new BPromise(function(_0x924834,_0x3e4f9d){return client['request'](_0x32c594,_0x4cde86)[_0xe967('0xd')](function(_0x14e973){logger[_0xe967('0xe')](_0xe967('0xf'),_0x396840,_0xe967('0x10'));logger[_0xe967('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x396840,_0xe967('0x10'),JSON[_0xe967('0x12')](_0x14e973));if(_0x14e973[_0xe967('0x13')]){if(_0x14e973[_0xe967('0x13')][_0xe967('0x14')]===0x1f4){logger[_0xe967('0x13')](_0xe967('0xf'),_0x396840,_0x14e973[_0xe967('0x13')][_0xe967('0x15')]);return _0x3e4f9d(_0x14e973['error']['message']);}logger[_0xe967('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x396840,_0x14e973[_0xe967('0x13')][_0xe967('0x15')]);return _0x924834(_0x14e973[_0xe967('0x13')][_0xe967('0x15')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x396840,_0xe967('0x10'));_0x924834(_0x14e973['result'][_0xe967('0x15')]);}})['catch'](function(_0x564a5b){logger[_0xe967('0x13')](_0xe967('0xf'),_0x396840,_0x564a5b);_0x3e4f9d(_0x564a5b);});});}exports[_0xe967('0x16')]=function(_0x5717dd){var _0x182b78=this;return new Promise(function(_0x3aa2c9,_0x191d2a){return db[_0xe967('0x17')]['findAll']({'raw':_0x5717dd[_0xe967('0x18')]?_0x5717dd['options'][_0xe967('0x19')]===undefined?!![]:![]:!![],'where':_0x5717dd[_0xe967('0x18')]?_0x5717dd[_0xe967('0x18')][_0xe967('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0xe967('0x1b'),db[_0xe967('0x1c')]['fn']('IF',db[_0xe967('0x1c')]['literal'](_0xe967('0x1d')))),'outboundQueuePauses']]})['then'](function(_0xb5c80f){logger['info']('GetVoiceQueueRtPauses',_0x5717dd);logger[_0xe967('0x11')](_0xe967('0x16'),_0x5717dd,JSON[_0xe967('0x12')](_0xb5c80f));_0x3aa2c9(_0xb5c80f);})[_0xe967('0x1e')](function(_0x26b4d8){logger[_0xe967('0x13')](_0xe967('0x16'),_0x26b4d8['message'],_0x5717dd);_0x191d2a(_0x182b78[_0xe967('0x13')](0x1f4,_0x26b4d8['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1c4669a..31fcbc6 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 _0xf88f=['save','remove','update','removeListener','length','./userVoiceQueueRt.events'];(function(_0x258b4f,_0x3000be){var _0x20ab7a=function(_0x1be025){while(--_0x1be025){_0x258b4f['push'](_0x258b4f['shift']());}};_0x20ab7a(++_0x3000be);}(_0xf88f,0x1bb));var _0xff88=function(_0x1646e7,_0xcf457d){_0x1646e7=_0x1646e7-0x0;var _0x543df2=_0xf88f[_0x1646e7];return _0x543df2;};'use strict';var UserVoiceQueueRtEvents=require(_0xff88('0x0'));var events=[_0xff88('0x1'),_0xff88('0x2'),_0xff88('0x3')];function createListener(_0x1e541a,_0x25c2a8){return function(_0x184827){_0x25c2a8['emit'](_0x1e541a,_0x184827);};}function removeListener(_0x1bcee9,_0x33aa75){return function(){UserVoiceQueueRtEvents[_0xff88('0x4')](_0x1bcee9,_0x33aa75);};}exports['register']=function(_0x38e1df){for(var _0x406a2e=0x0,_0x4140a8=events[_0xff88('0x5')];_0x406a2e<_0x4140a8;_0x406a2e++){var _0x3551e6=events[_0x406a2e];var _0x469bfd=createListener('userVoiceQueueRt:'+_0x3551e6,_0x38e1df);UserVoiceQueueRtEvents['on'](_0x3551e6,_0x469bfd);}}; \ No newline at end of file +var _0x553a=['length','userVoiceQueueRt:','save','update','register'];(function(_0x3d4a17,_0x46c8a4){var _0x322aed=function(_0x2e3d9e){while(--_0x2e3d9e){_0x3d4a17['push'](_0x3d4a17['shift']());}};_0x322aed(++_0x46c8a4);}(_0x553a,0x192));var _0xa553=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x553a[_0xc0638b];return _0xd57dfa;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa553('0x0'),'remove',_0xa553('0x1')];function createListener(_0x1f4982,_0x1776c6){return function(_0x58654a){_0x1776c6['emit'](_0x1f4982,_0x58654a);};}function removeListener(_0x367421,_0x50ecee){return function(){UserVoiceQueueRtEvents['removeListener'](_0x367421,_0x50ecee);};}exports[_0xa553('0x2')]=function(_0x53190d){for(var _0x5ddf5e=0x0,_0x18da5d=events[_0xa553('0x3')];_0x5ddf5e<_0x18da5d;_0x5ddf5e++){var _0xaae97=events[_0x5ddf5e];var _0x48f7d2=createListener(_0xa553('0x4')+_0xaae97,_0x53190d);UserVoiceQueueRtEvents['on'](_0xaae97,_0x48f7d2);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index c378152..701beca 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x52707a,_0x3e0b76){var _0x172e66=function(_0x31ade4){while(--_0x31ade4){_0x52707a['push'](_0x52707a['shift']());}};_0x172e66(++_0x3e0b76);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0xcb91[_0x2ca2d0];return _0x521c23;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x56f151,_0x281759){var _0x52c1e3=function(_0x12ba6d){while(--_0x12ba6d){_0x56f151['push'](_0x56f151['shift']());}};_0x52c1e3(++_0x281759);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'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 4b833f0..8a67428 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 _0x646a=['exports','INTEGER','sequelize'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x646a,0x182));var _0xa646=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x646a[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0xa646('0x0'));module[_0xa646('0x1')]={'penalty':{'type':Sequelize[_0xa646('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x90a9=['exports','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x90a9,0x1d3));var _0x990a=function(_0x4eee09,_0x25f138){_0x4eee09=_0x4eee09-0x0;var _0x55ebb5=_0x90a9[_0x4eee09];return _0x55ebb5;};'use strict';var Sequelize=require(_0x990a('0x0'));module[_0x990a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 0def894..d27f0db 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 _0xf7f4=['./userWhatsappQueue.attributes','exports','UserWhatsappQueue','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x74ec68,_0x24477d){var _0x1db1f6=function(_0x464f8d){while(--_0x464f8d){_0x74ec68['push'](_0x74ec68['shift']());}};_0x1db1f6(++_0x24477d);}(_0xf7f4,0x157));var _0x4f7f=function(_0x55a118,_0x2d122f){_0x55a118=_0x55a118-0x0;var _0x1b1f91=_0xf7f4[_0x55a118];return _0x1b1f91;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4f7f('0x0'))(_0x4f7f('0x1'));var moment=require(_0x4f7f('0x2'));var BPromise=require(_0x4f7f('0x3'));var rp=require(_0x4f7f('0x4'));var fs=require('fs');var path=require(_0x4f7f('0x5'));var rimraf=require('rimraf');var config=require(_0x4f7f('0x6'));var attributes=require(_0x4f7f('0x7'));module[_0x4f7f('0x8')]=function(_0x268dba,_0x3ba2b6){return _0x268dba['define'](_0x4f7f('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b7f=['bluebird','request-promise','path','rimraf','../../config/environment','define','UserWhatsappQueue','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b7f,0xee));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6b7('0x0'));var util=require(_0xf6b7('0x1'));var logger=require(_0xf6b7('0x2'))(_0xf6b7('0x3'));var moment=require('moment');var BPromise=require(_0xf6b7('0x4'));var rp=require(_0xf6b7('0x5'));var fs=require('fs');var path=require(_0xf6b7('0x6'));var rimraf=require(_0xf6b7('0x7'));var config=require(_0xf6b7('0x8'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x5c8bce,_0x46158b){return _0x5c8bce[_0xf6b7('0x9')](_0xf6b7('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 096eab2..a9b3671 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 _0xb863=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2cf51d,_0x270796){var _0x34bfb0=function(_0xa7b05e){while(--_0xa7b05e){_0x2cf51d['push'](_0x2cf51d['shift']());}};_0x34bfb0(++_0x270796);}(_0xb863,0x13a));var _0x3b86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb863[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3b86('0x0'));var util=require(_0x3b86('0x1'));var moment=require(_0x3b86('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b86('0x3'));var fs=require('fs');var Redis=require(_0x3b86('0x4'));var db=require(_0x3b86('0x5'))['db'];var utils=require(_0x3b86('0x6'));var logger=require(_0x3b86('0x7'))(_0x3b86('0x8'));var config=require(_0x3b86('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3b86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2916e6,_0xe81379,_0x2c6f9e){return new BPromise(function(_0x565d54,_0x1ed497){return client[_0x3b86('0xb')](_0x2916e6,_0x2c6f9e)[_0x3b86('0xc')](function(_0x7d1956){logger['info'](_0x3b86('0xd'),_0xe81379,_0x3b86('0xe'));logger[_0x3b86('0xf')](_0x3b86('0x10'),_0xe81379,_0x3b86('0xe'),JSON['stringify'](_0x7d1956));if(_0x7d1956[_0x3b86('0x11')]){if(_0x7d1956[_0x3b86('0x11')][_0x3b86('0x12')]===0x1f4){logger[_0x3b86('0x11')](_0x3b86('0xd'),_0xe81379,_0x7d1956[_0x3b86('0x11')][_0x3b86('0x13')]);return _0x1ed497(_0x7d1956['error'][_0x3b86('0x13')]);}logger[_0x3b86('0x11')](_0x3b86('0xd'),_0xe81379,_0x7d1956[_0x3b86('0x11')][_0x3b86('0x13')]);return _0x565d54(_0x7d1956[_0x3b86('0x11')][_0x3b86('0x13')]);}else{logger['info'](_0x3b86('0xd'),_0xe81379,_0x3b86('0xe'));_0x565d54(_0x7d1956[_0x3b86('0x14')][_0x3b86('0x13')]);}})[_0x3b86('0x15')](function(_0x1d866c){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0xe81379,_0x1d866c);_0x1ed497(_0x1d866c);});});} \ No newline at end of file +var _0x9cfd=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x40e326,_0x15ab6b){var _0x5bd81b=function(_0x54dca9){while(--_0x54dca9){_0x40e326['push'](_0x40e326['shift']());}};_0x5bd81b(++_0x15ab6b);}(_0x9cfd,0x149));var _0xd9cf=function(_0x3d7e9a,_0x128d70){_0x3d7e9a=_0x3d7e9a-0x0;var _0x7d127a=_0x9cfd[_0x3d7e9a];return _0x7d127a;};'use strict';var _=require(_0xd9cf('0x0'));var util=require('util');var moment=require(_0xd9cf('0x1'));var BPromise=require(_0xd9cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd9cf('0x3'));var logger=require(_0xd9cf('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd9cf('0x5'));var client=jayson[_0xd9cf('0x6')][_0xd9cf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e82aa,_0x2949ee,_0x445c30){return new BPromise(function(_0xeee4dc,_0x16a20c){return client[_0xd9cf('0x8')](_0x2e82aa,_0x445c30)[_0xd9cf('0x9')](function(_0x4c6a73){logger[_0xd9cf('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2949ee,'request\x20sent');logger['debug'](_0xd9cf('0xb'),_0x2949ee,_0xd9cf('0xc'),JSON[_0xd9cf('0xd')](_0x4c6a73));if(_0x4c6a73[_0xd9cf('0xe')]){if(_0x4c6a73[_0xd9cf('0xe')][_0xd9cf('0xf')]===0x1f4){logger[_0xd9cf('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2949ee,_0x4c6a73[_0xd9cf('0xe')][_0xd9cf('0x10')]);return _0x16a20c(_0x4c6a73[_0xd9cf('0xe')][_0xd9cf('0x10')]);}logger[_0xd9cf('0xe')](_0xd9cf('0x11'),_0x2949ee,_0x4c6a73['error']['message']);return _0xeee4dc(_0x4c6a73['error']['message']);}else{logger[_0xd9cf('0xa')](_0xd9cf('0x11'),_0x2949ee,_0xd9cf('0xc'));_0xeee4dc(_0x4c6a73[_0xd9cf('0x12')][_0xd9cf('0x10')]);}})[_0xd9cf('0x13')](function(_0x4116e4){logger[_0xd9cf('0xe')](_0xd9cf('0x11'),_0x2949ee,_0x4116e4);_0x16a20c(_0x4116e4);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 4b9a2c5..923dc86 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 _0x4b84=['../../components/interaction/service','../../config/environment','index','/:id','show','create','put','update','delete','isAuthenticated','destroy','exports','multer','util','express','../../components/auth/service'];(function(_0x2a91f8,_0x449a8b){var _0x8e0541=function(_0x4ffa3b){while(--_0x4ffa3b){_0x2a91f8['push'](_0x2a91f8['shift']());}};_0x8e0541(++_0x449a8b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x4b84[_0x3a9635];return _0x10d08c;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x44b8('0x9')]);router[_0x44b8('0xa')](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0xb')]);router[_0x44b8('0xc')](_0x44b8('0x7'),auth[_0x44b8('0xd')](),controller[_0x44b8('0xe')]);module[_0x44b8('0xf')]=router; \ No newline at end of file +var _0x3e25=['./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3e25,0x14f));var _0x53e2=function(_0x3ea742,_0x54e78f){_0x3ea742=_0x3ea742-0x0;var _0xa2a08c=_0x3e25[_0x3ea742];return _0xa2a08c;};'use strict';var multer=require(_0x53e2('0x0'));var util=require(_0x53e2('0x1'));var path=require(_0x53e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x53e2('0x3'));var router=express['Router']();var fs_extra=require(_0x53e2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x53e2('0x5'));var config=require(_0x53e2('0x6'));var controller=require(_0x53e2('0x7'));router[_0x53e2('0x8')]('/',auth[_0x53e2('0x9')](),controller[_0x53e2('0xa')]);router[_0x53e2('0x8')](_0x53e2('0xb'),auth[_0x53e2('0x9')](),controller[_0x53e2('0xc')]);router[_0x53e2('0xd')]('/',auth[_0x53e2('0x9')](),controller[_0x53e2('0xe')]);router[_0x53e2('0xf')](_0x53e2('0xb'),auth[_0x53e2('0x9')](),controller[_0x53e2('0x10')]);router[_0x53e2('0x11')]('/:id',auth[_0x53e2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 6cb1e61..45116d2 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 _0x061c=['name','STRING'];(function(_0x3aa479,_0x571eb3){var _0x532c28=function(_0xc2972a){while(--_0xc2972a){_0x3aa479['push'](_0x3aa479['shift']());}};_0x532c28(++_0x571eb3);}(_0x061c,0x1df));var _0xc061=function(_0xa68e17,_0x4d1b65){_0xa68e17=_0xa68e17-0x0;var _0x1993f1=_0x061c[_0xa68e17];return _0x1993f1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc061('0x0')],'unique':_0xc061('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc690=['exports','STRING'];(function(_0x29f65a,_0x400ea2){var _0x64be52=function(_0x2db3a3){while(--_0x2db3a3){_0x29f65a['push'](_0x29f65a['shift']());}};_0x64be52(++_0x400ea2);}(_0xc690,0x1b8));var _0x0c69=function(_0x1fde75,_0x16d4f0){_0x1fde75=_0x1fde75-0x0;var _0x596d82=_0xc690[_0x1fde75];return _0x596d82;};'use strict';var Sequelize=require('sequelize');module[_0x0c69('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0c69('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 1c3fcea..ee77e63 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 _0x2b2b=['then','destroy','Variables','UserProfileResource','end','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','findAll','rows','catch','show','includeAll','include','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','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','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','apply','reject','save','update'];(function(_0x2e5da5,_0x3b874a){var _0x55015b=function(_0x3eb528){while(--_0x3eb528){_0x2e5da5['push'](_0x2e5da5['shift']());}};_0x55015b(++_0x3b874a);}(_0x2b2b,0xd3));var _0xb2b2=function(_0x462f67,_0x5b91d7){_0x462f67=_0x462f67-0x0;var _0x2d7f1a=_0x2b2b[_0x462f67];return _0x2d7f1a;};'use strict';var emlformat=require(_0xb2b2('0x0'));var rimraf=require(_0xb2b2('0x1'));var zipdir=require(_0xb2b2('0x2'));var jsonpatch=require(_0xb2b2('0x3'));var rp=require(_0xb2b2('0x4'));var moment=require('moment');var BPromise=require(_0xb2b2('0x5'));var Mustache=require('mustache');var util=require(_0xb2b2('0x6'));var path=require(_0xb2b2('0x7'));var sox=require(_0xb2b2('0x8'));var csv=require(_0xb2b2('0x9'));var ejs=require(_0xb2b2('0xa'));var fs=require('fs');var fs_extra=require(_0xb2b2('0xb'));var _=require('lodash');var squel=require(_0xb2b2('0xc'));var crypto=require(_0xb2b2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb2b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb2b2('0xf'));var Papa=require(_0xb2b2('0x10'));var Redis=require(_0xb2b2('0x11'));var authService=require(_0xb2b2('0x12'));var qs=require(_0xb2b2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb2b2('0x14'));var utils=require(_0xb2b2('0x15'));var config=require(_0xb2b2('0x16'));var licenseUtil=require(_0xb2b2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d5084,_0x17fef8){_0x17fef8=_0x17fef8||0xcc;return function(_0x27c893){if(_0x27c893){return _0x4d5084[_0xb2b2('0x18')](_0x17fef8);}return _0x4d5084[_0xb2b2('0x19')](_0x17fef8)['end']();};}function respondWithResult(_0x5dd45b,_0x461cbc){_0x461cbc=_0x461cbc||0xc8;return function(_0x2938ba){if(_0x2938ba){return _0x5dd45b[_0xb2b2('0x19')](_0x461cbc)['json'](_0x2938ba);}};}function respondWithFilteredResult(_0xd6655d,_0x12eb59){return function(_0x2d9b89){if(_0x2d9b89){var _0x539802=typeof _0x12eb59['offset']===_0xb2b2('0x1a')&&typeof _0x12eb59[_0xb2b2('0x1b')]===_0xb2b2('0x1a');var _0x3426fc=_0x2d9b89[_0xb2b2('0x1c')];var _0xfa4e04=_0x539802?0x0:_0x12eb59['offset'];var _0x3d8236=_0x539802?_0x2d9b89['count']:_0x12eb59[_0xb2b2('0x1d')]+_0x12eb59[_0xb2b2('0x1b')];var _0x2a6f4a;if(_0x3d8236>=_0x3426fc){_0x3d8236=_0x3426fc;_0x2a6f4a=0xc8;}else{_0x2a6f4a=0xce;}_0xd6655d[_0xb2b2('0x19')](_0x2a6f4a);return _0xd6655d[_0xb2b2('0x1e')]('Content-Range',_0xfa4e04+'-'+_0x3d8236+'/'+_0x3426fc)['json'](_0x2d9b89);}return null;};}function patchUpdates(_0xcc4f72){return function(_0xf9c521){try{jsonpatch[_0xb2b2('0x1f')](_0xf9c521,_0xcc4f72,!![]);}catch(_0x3cbd43){return BPromise[_0xb2b2('0x20')](_0x3cbd43);}return _0xf9c521[_0xb2b2('0x21')]();};}function saveUpdates(_0x1b0ba5,_0x3ef127){return function(_0x36e621){if(_0x36e621){return _0x36e621[_0xb2b2('0x22')](_0x1b0ba5)[_0xb2b2('0x23')](function(_0xa99466){return _0xa99466;});}return null;};}function removeEntity(_0xfcc239,_0x477fd4){return function(_0x54b076){if(_0x54b076){return _0x54b076[_0xb2b2('0x24')]()[_0xb2b2('0x23')](function(){var _0x91ad6f=_0x54b076['get']({'plain':!![]});var _0x13c35c=_0xb2b2('0x25');return db[_0xb2b2('0x26')][_0xb2b2('0x24')]({'where':{'type':_0x13c35c,'resourceId':_0x91ad6f['id']}})[_0xb2b2('0x23')](function(){return _0x54b076;});})[_0xb2b2('0x23')](function(){_0xfcc239[_0xb2b2('0x19')](0xcc)[_0xb2b2('0x27')]();});}};}function handleEntityNotFound(_0x1cbf45,_0x67b10e){return function(_0xb955ef){if(!_0xb955ef){_0x1cbf45[_0xb2b2('0x18')](0x194);}return _0xb955ef;};}function handleError(_0x10f01a,_0x26dd3b){_0x26dd3b=_0x26dd3b||0x1f4;return function(_0x54412d){logger[_0xb2b2('0x28')](_0x54412d[_0xb2b2('0x29')]);if(_0x54412d[_0xb2b2('0x2a')]){delete _0x54412d[_0xb2b2('0x2a')];}_0x10f01a[_0xb2b2('0x19')](_0x26dd3b)[_0xb2b2('0x2b')](_0x54412d);};}exports['index']=function(_0x878d64,_0x416bec){var _0x563474={},_0x2c5fdc={},_0x25c111={'count':0x0,'rows':[]};var _0x2d6973=_[_0xb2b2('0x2c')](db[_0xb2b2('0x2d')][_0xb2b2('0x2e')],function(_0x1235de){return{'name':_0x1235de[_0xb2b2('0x2f')],'type':_0x1235de[_0xb2b2('0x30')]['key']};});_0x2c5fdc['model']=_[_0xb2b2('0x2c')](_0x2d6973,'name');_0x2c5fdc[_0xb2b2('0x31')]=_[_0xb2b2('0x32')](_0x878d64[_0xb2b2('0x31')]);_0x2c5fdc[_0xb2b2('0x33')]=_[_0xb2b2('0x34')](_0x2c5fdc[_0xb2b2('0x35')],_0x2c5fdc[_0xb2b2('0x31')]);_0x563474[_0xb2b2('0x36')]=_[_0xb2b2('0x34')](_0x2c5fdc[_0xb2b2('0x35')],qs[_0xb2b2('0x37')](_0x878d64[_0xb2b2('0x31')][_0xb2b2('0x37')]));_0x563474[_0xb2b2('0x36')]=_0x563474[_0xb2b2('0x36')][_0xb2b2('0x38')]?_0x563474['attributes']:_0x2c5fdc[_0xb2b2('0x35')];if(!_0x878d64['query'][_0xb2b2('0x39')](_0xb2b2('0x3a'))){_0x563474[_0xb2b2('0x1b')]=qs[_0xb2b2('0x1b')](_0x878d64[_0xb2b2('0x31')][_0xb2b2('0x1b')]);_0x563474['offset']=qs[_0xb2b2('0x1d')](_0x878d64[_0xb2b2('0x31')][_0xb2b2('0x1d')]);}_0x563474[_0xb2b2('0x3b')]=qs[_0xb2b2('0x3c')](_0x878d64['query']['sort']);_0x563474['where']=qs[_0xb2b2('0x33')](_[_0xb2b2('0x3d')](_0x878d64['query'],_0x2c5fdc[_0xb2b2('0x33')]),_0x2d6973);if(_0x878d64['query'][_0xb2b2('0x3e')]){_0x563474[_0xb2b2('0x3f')]=_[_0xb2b2('0x40')](_0x563474[_0xb2b2('0x3f')],{'$or':_['map'](_0x2d6973,function(_0x41966a){if(_0x41966a['type']!=='VIRTUAL'){var _0x5aa0a0={};_0x5aa0a0[_0x41966a['name']]={'$like':'%'+_0x878d64[_0xb2b2('0x31')][_0xb2b2('0x3e')]+'%'};return _0x5aa0a0;}})});}_0x563474=_['merge']({},_0x563474,_0x878d64['options']);var _0x1124f3={'where':_0x563474['where']};return db['Variable'][_0xb2b2('0x1c')](_0x1124f3)[_0xb2b2('0x23')](function(_0x51cd62){_0x25c111[_0xb2b2('0x1c')]=_0x51cd62;if(_0x878d64[_0xb2b2('0x31')]['includeAll']){_0x563474['include']=[{'all':!![]}];}return db[_0xb2b2('0x2d')][_0xb2b2('0x41')](_0x563474);})[_0xb2b2('0x23')](function(_0x49727f){_0x25c111[_0xb2b2('0x42')]=_0x49727f;return _0x25c111;})[_0xb2b2('0x23')](respondWithFilteredResult(_0x416bec,_0x563474))[_0xb2b2('0x43')](handleError(_0x416bec,null));};exports[_0xb2b2('0x44')]=function(_0x2ee768,_0x23baaf){var _0x21d719={'raw':!![],'where':{'id':_0x2ee768['params']['id']}},_0x8e211a={};_0x8e211a[_0xb2b2('0x35')]=_[_0xb2b2('0x32')](db['Variable']['rawAttributes']);_0x8e211a[_0xb2b2('0x31')]=_['keys'](_0x2ee768['query']);_0x8e211a[_0xb2b2('0x33')]=_[_0xb2b2('0x34')](_0x8e211a[_0xb2b2('0x35')],_0x8e211a[_0xb2b2('0x31')]);_0x21d719['attributes']=_[_0xb2b2('0x34')](_0x8e211a[_0xb2b2('0x35')],qs[_0xb2b2('0x37')](_0x2ee768[_0xb2b2('0x31')][_0xb2b2('0x37')]));_0x21d719[_0xb2b2('0x36')]=_0x21d719['attributes'][_0xb2b2('0x38')]?_0x21d719[_0xb2b2('0x36')]:_0x8e211a[_0xb2b2('0x35')];if(_0x2ee768[_0xb2b2('0x31')][_0xb2b2('0x45')]){_0x21d719[_0xb2b2('0x46')]=[{'all':!![]}];}_0x21d719=_[_0xb2b2('0x40')]({},_0x21d719,_0x2ee768[_0xb2b2('0x47')]);return db[_0xb2b2('0x2d')][_0xb2b2('0x48')](_0x21d719)[_0xb2b2('0x23')](handleEntityNotFound(_0x23baaf,null))[_0xb2b2('0x23')](respondWithResult(_0x23baaf,null))[_0xb2b2('0x43')](handleError(_0x23baaf,null));};exports[_0xb2b2('0x49')]=function(_0x4837aa,_0x38408c){return db[_0xb2b2('0x2d')][_0xb2b2('0x49')](_0x4837aa['body'],{})[_0xb2b2('0x23')](function(_0x437418){var _0x10c900=_0x4837aa[_0xb2b2('0x4a')][_0xb2b2('0x4b')]({'plain':!![]});if(!_0x10c900)throw new Error(_0xb2b2('0x4c'));if(_0x10c900['role']==='user'){var _0x5f47fe=_0x437418[_0xb2b2('0x4b')]({'plain':!![]});var _0x21bac9='Variables';return db[_0xb2b2('0x4d')][_0xb2b2('0x48')]({'where':{'name':_0x21bac9,'userProfileId':_0x10c900['userProfileId']},'raw':!![]})[_0xb2b2('0x23')](function(_0x33a2eb){if(_0x33a2eb&&_0x33a2eb[_0xb2b2('0x4e')]===0x0){return db[_0xb2b2('0x26')][_0xb2b2('0x49')]({'name':_0x5f47fe['name'],'resourceId':_0x5f47fe['id'],'type':_0x33a2eb['name'],'sectionId':_0x33a2eb['id']},{})[_0xb2b2('0x23')](function(){return _0x437418;});}else{return _0x437418;}})['catch'](function(_0x7a236b){logger[_0xb2b2('0x28')](_0xb2b2('0x4f'),_0x7a236b);throw _0x7a236b;});}return _0x437418;})[_0xb2b2('0x23')](respondWithResult(_0x38408c,0xc9))['catch'](handleError(_0x38408c,null));};exports['update']=function(_0x2472cd,_0x6523b9){if(_0x2472cd[_0xb2b2('0x50')]['id']){delete _0x2472cd[_0xb2b2('0x50')]['id'];}return db[_0xb2b2('0x2d')][_0xb2b2('0x48')]({'where':{'id':_0x2472cd[_0xb2b2('0x51')]['id']}})[_0xb2b2('0x23')](handleEntityNotFound(_0x6523b9,null))['then'](saveUpdates(_0x2472cd['body'],null))[_0xb2b2('0x23')](respondWithResult(_0x6523b9,null))[_0xb2b2('0x43')](handleError(_0x6523b9,null));};exports[_0xb2b2('0x24')]=function(_0x14edb7,_0x218bd5){return db[_0xb2b2('0x2d')][_0xb2b2('0x48')]({'where':{'id':_0x14edb7[_0xb2b2('0x51')]['id']}})['then'](handleEntityNotFound(_0x218bd5,null))[_0xb2b2('0x23')](removeEntity(_0x218bd5,null))[_0xb2b2('0x43')](handleError(_0x218bd5,null));}; \ No newline at end of file +var _0xebcc=['include','findAll','rows','catch','show','params','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','get','Variables','UserProfileResource','end','stack','name','index','map','Variable','rawAttributes','fieldName','type','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll'];(function(_0x544db9,_0x24e355){var _0x217d7b=function(_0xd2b2f2){while(--_0xd2b2f2){_0x544db9['push'](_0x544db9['shift']());}};_0x217d7b(++_0x24e355);}(_0xebcc,0xb6));var _0xcebc=function(_0x2d37d6,_0x11f9e8){_0x2d37d6=_0x2d37d6-0x0;var _0x4595b5=_0xebcc[_0x2d37d6];return _0x4595b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcebc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcebc('0x1'));var moment=require(_0xcebc('0x2'));var BPromise=require(_0xcebc('0x3'));var Mustache=require(_0xcebc('0x4'));var util=require(_0xcebc('0x5'));var path=require(_0xcebc('0x6'));var sox=require('sox');var csv=require(_0xcebc('0x7'));var ejs=require(_0xcebc('0x8'));var fs=require('fs');var fs_extra=require(_0xcebc('0x9'));var _=require(_0xcebc('0xa'));var squel=require(_0xcebc('0xb'));var crypto=require(_0xcebc('0xc'));var jsforce=require(_0xcebc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcebc('0x7'));var querystring=require(_0xcebc('0xe'));var Papa=require(_0xcebc('0xf'));var Redis=require(_0xcebc('0x10'));var authService=require(_0xcebc('0x11'));var qs=require(_0xcebc('0x12'));var as=require(_0xcebc('0x13'));var hardwareService=require(_0xcebc('0x14'));var logger=require(_0xcebc('0x15'))(_0xcebc('0x16'));var utils=require('../../config/utils');var config=require(_0xcebc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcebc('0x18'))['db'];function respondWithStatusCode(_0x2161eb,_0x1ee9f3){_0x1ee9f3=_0x1ee9f3||0xcc;return function(_0xd81c3){if(_0xd81c3){return _0x2161eb[_0xcebc('0x19')](_0x1ee9f3);}return _0x2161eb[_0xcebc('0x1a')](_0x1ee9f3)['end']();};}function respondWithResult(_0x43f8bd,_0x49652f){_0x49652f=_0x49652f||0xc8;return function(_0x2dc259){if(_0x2dc259){return _0x43f8bd[_0xcebc('0x1a')](_0x49652f)[_0xcebc('0x1b')](_0x2dc259);}};}function respondWithFilteredResult(_0x30140a,_0x3128a7){return function(_0x20fcc9){if(_0x20fcc9){var _0x1a8f08=typeof _0x3128a7[_0xcebc('0x1c')]===_0xcebc('0x1d')&&typeof _0x3128a7[_0xcebc('0x1e')]===_0xcebc('0x1d');var _0x1e498c=_0x20fcc9[_0xcebc('0x1f')];var _0x3763e7=_0x1a8f08?0x0:_0x3128a7[_0xcebc('0x1c')];var _0x47c54a=_0x1a8f08?_0x20fcc9['count']:_0x3128a7[_0xcebc('0x1c')]+_0x3128a7[_0xcebc('0x1e')];var _0x48cdfd;if(_0x47c54a>=_0x1e498c){_0x47c54a=_0x1e498c;_0x48cdfd=0xc8;}else{_0x48cdfd=0xce;}_0x30140a['status'](_0x48cdfd);return _0x30140a['set'](_0xcebc('0x20'),_0x3763e7+'-'+_0x47c54a+'/'+_0x1e498c)[_0xcebc('0x1b')](_0x20fcc9);}return null;};}function patchUpdates(_0x38a2c7){return function(_0x3d1133){try{jsonpatch[_0xcebc('0x21')](_0x3d1133,_0x38a2c7,!![]);}catch(_0x1fcd4a){return BPromise['reject'](_0x1fcd4a);}return _0x3d1133['save']();};}function saveUpdates(_0xf8d5de,_0x21f354){return function(_0x25c122){if(_0x25c122){return _0x25c122[_0xcebc('0x22')](_0xf8d5de)[_0xcebc('0x23')](function(_0x1a14da){return _0x1a14da;});}return null;};}function removeEntity(_0x1466f7,_0x5de24b){return function(_0x136c4a){if(_0x136c4a){return _0x136c4a['destroy']()[_0xcebc('0x23')](function(){var _0x3bd771=_0x136c4a[_0xcebc('0x24')]({'plain':!![]});var _0x1afb9d=_0xcebc('0x25');return db[_0xcebc('0x26')]['destroy']({'where':{'type':_0x1afb9d,'resourceId':_0x3bd771['id']}})['then'](function(){return _0x136c4a;});})[_0xcebc('0x23')](function(){_0x1466f7[_0xcebc('0x1a')](0xcc)[_0xcebc('0x27')]();});}};}function handleEntityNotFound(_0x27f208,_0x18f331){return function(_0x9d09ca){if(!_0x9d09ca){_0x27f208[_0xcebc('0x19')](0x194);}return _0x9d09ca;};}function handleError(_0x548777,_0x47faf6){_0x47faf6=_0x47faf6||0x1f4;return function(_0x4ac46d){logger['error'](_0x4ac46d[_0xcebc('0x28')]);if(_0x4ac46d[_0xcebc('0x29')]){delete _0x4ac46d[_0xcebc('0x29')];}_0x548777[_0xcebc('0x1a')](_0x47faf6)['send'](_0x4ac46d);};}exports[_0xcebc('0x2a')]=function(_0x110072,_0x4dbde6){var _0x3e5b70={},_0x427954={},_0x4f9ac7={'count':0x0,'rows':[]};var _0x5142b9=_[_0xcebc('0x2b')](db[_0xcebc('0x2c')][_0xcebc('0x2d')],function(_0x5a247a){return{'name':_0x5a247a[_0xcebc('0x2e')],'type':_0x5a247a[_0xcebc('0x2f')]['key']};});_0x427954[_0xcebc('0x30')]=_['map'](_0x5142b9,_0xcebc('0x29'));_0x427954['query']=_['keys'](_0x110072[_0xcebc('0x31')]);_0x427954['filters']=_['intersection'](_0x427954[_0xcebc('0x30')],_0x427954[_0xcebc('0x31')]);_0x3e5b70['attributes']=_['intersection'](_0x427954[_0xcebc('0x30')],qs['fields'](_0x110072[_0xcebc('0x31')][_0xcebc('0x32')]));_0x3e5b70[_0xcebc('0x33')]=_0x3e5b70[_0xcebc('0x33')][_0xcebc('0x34')]?_0x3e5b70[_0xcebc('0x33')]:_0x427954[_0xcebc('0x30')];if(!_0x110072[_0xcebc('0x31')][_0xcebc('0x35')](_0xcebc('0x36'))){_0x3e5b70[_0xcebc('0x1e')]=qs['limit'](_0x110072[_0xcebc('0x31')]['limit']);_0x3e5b70[_0xcebc('0x1c')]=qs[_0xcebc('0x1c')](_0x110072[_0xcebc('0x31')][_0xcebc('0x1c')]);}_0x3e5b70[_0xcebc('0x37')]=qs[_0xcebc('0x38')](_0x110072[_0xcebc('0x31')][_0xcebc('0x38')]);_0x3e5b70[_0xcebc('0x39')]=qs[_0xcebc('0x3a')](_[_0xcebc('0x3b')](_0x110072[_0xcebc('0x31')],_0x427954['filters']),_0x5142b9);if(_0x110072[_0xcebc('0x31')][_0xcebc('0x3c')]){_0x3e5b70[_0xcebc('0x39')]=_['merge'](_0x3e5b70['where'],{'$or':_[_0xcebc('0x2b')](_0x5142b9,function(_0x1cd799){if(_0x1cd799[_0xcebc('0x2f')]!=='VIRTUAL'){var _0x2aa105={};_0x2aa105[_0x1cd799[_0xcebc('0x29')]]={'$like':'%'+_0x110072['query'][_0xcebc('0x3c')]+'%'};return _0x2aa105;}})});}_0x3e5b70=_[_0xcebc('0x3d')]({},_0x3e5b70,_0x110072[_0xcebc('0x3e')]);var _0x43e5b2={'where':_0x3e5b70[_0xcebc('0x39')]};return db[_0xcebc('0x2c')]['count'](_0x43e5b2)[_0xcebc('0x23')](function(_0xe773be){_0x4f9ac7['count']=_0xe773be;if(_0x110072[_0xcebc('0x31')][_0xcebc('0x3f')]){_0x3e5b70[_0xcebc('0x40')]=[{'all':!![]}];}return db[_0xcebc('0x2c')][_0xcebc('0x41')](_0x3e5b70);})[_0xcebc('0x23')](function(_0x161232){_0x4f9ac7[_0xcebc('0x42')]=_0x161232;return _0x4f9ac7;})[_0xcebc('0x23')](respondWithFilteredResult(_0x4dbde6,_0x3e5b70))[_0xcebc('0x43')](handleError(_0x4dbde6,null));};exports[_0xcebc('0x44')]=function(_0x406255,_0x1e94d1){var _0x1c709a={'raw':!![],'where':{'id':_0x406255[_0xcebc('0x45')]['id']}},_0x45fedf={};_0x45fedf['model']=_[_0xcebc('0x46')](db['Variable'][_0xcebc('0x2d')]);_0x45fedf[_0xcebc('0x31')]=_[_0xcebc('0x46')](_0x406255[_0xcebc('0x31')]);_0x45fedf[_0xcebc('0x3a')]=_['intersection'](_0x45fedf[_0xcebc('0x30')],_0x45fedf[_0xcebc('0x31')]);_0x1c709a[_0xcebc('0x33')]=_[_0xcebc('0x47')](_0x45fedf[_0xcebc('0x30')],qs[_0xcebc('0x32')](_0x406255[_0xcebc('0x31')]['fields']));_0x1c709a['attributes']=_0x1c709a[_0xcebc('0x33')][_0xcebc('0x34')]?_0x1c709a['attributes']:_0x45fedf[_0xcebc('0x30')];if(_0x406255[_0xcebc('0x31')]['includeAll']){_0x1c709a['include']=[{'all':!![]}];}_0x1c709a=_[_0xcebc('0x3d')]({},_0x1c709a,_0x406255['options']);return db[_0xcebc('0x2c')][_0xcebc('0x48')](_0x1c709a)['then'](handleEntityNotFound(_0x1e94d1,null))['then'](respondWithResult(_0x1e94d1,null))[_0xcebc('0x43')](handleError(_0x1e94d1,null));};exports[_0xcebc('0x49')]=function(_0x2979dc,_0x28eac4){return db['Variable'][_0xcebc('0x49')](_0x2979dc[_0xcebc('0x4a')],{})[_0xcebc('0x23')](function(_0x3569af){var _0x183dee=_0x2979dc[_0xcebc('0x4b')][_0xcebc('0x24')]({'plain':!![]});if(!_0x183dee)throw new Error(_0xcebc('0x4c'));if(_0x183dee[_0xcebc('0x4d')]===_0xcebc('0x4b')){var _0x36638=_0x3569af['get']({'plain':!![]});var _0x5874e5=_0xcebc('0x25');return db['UserProfileSection'][_0xcebc('0x48')]({'where':{'name':_0x5874e5,'userProfileId':_0x183dee[_0xcebc('0x4e')]},'raw':!![]})[_0xcebc('0x23')](function(_0x501ee4){if(_0x501ee4&&_0x501ee4[_0xcebc('0x4f')]===0x0){return db[_0xcebc('0x26')][_0xcebc('0x49')]({'name':_0x36638[_0xcebc('0x29')],'resourceId':_0x36638['id'],'type':_0x501ee4[_0xcebc('0x29')],'sectionId':_0x501ee4['id']},{})[_0xcebc('0x23')](function(){return _0x3569af;});}else{return _0x3569af;}})['catch'](function(_0x173e08){logger[_0xcebc('0x50')](_0xcebc('0x51'),_0x173e08);throw _0x173e08;});}return _0x3569af;})[_0xcebc('0x23')](respondWithResult(_0x28eac4,0xc9))[_0xcebc('0x43')](handleError(_0x28eac4,null));};exports['update']=function(_0x5c74d5,_0x29845d){if(_0x5c74d5['body']['id']){delete _0x5c74d5[_0xcebc('0x4a')]['id'];}return db[_0xcebc('0x2c')][_0xcebc('0x48')]({'where':{'id':_0x5c74d5['params']['id']}})[_0xcebc('0x23')](handleEntityNotFound(_0x29845d,null))[_0xcebc('0x23')](saveUpdates(_0x5c74d5[_0xcebc('0x4a')],null))[_0xcebc('0x23')](respondWithResult(_0x29845d,null))[_0xcebc('0x43')](handleError(_0x29845d,null));};exports['destroy']=function(_0xb9db97,_0x23c1b2){return db['Variable']['find']({'where':{'id':_0xb9db97[_0xcebc('0x45')]['id']}})['then'](handleEntityNotFound(_0x23c1b2,null))[_0xcebc('0x23')](removeEntity(_0x23c1b2,null))[_0xcebc('0x43')](handleError(_0x23c1b2,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 98289ce..74ddebf 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 _0x7960=['define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x38533d,_0x4e9b1b){var _0x4d56db=function(_0x4420e1){while(--_0x4420e1){_0x38533d['push'](_0x38533d['shift']());}};_0x4d56db(++_0x4e9b1b);}(_0x7960,0x13b));var _0x0796=function(_0x131d32,_0x1e60cf){_0x131d32=_0x131d32-0x0;var _0x197937=_0x7960[_0x131d32];return _0x197937;};'use strict';var _=require(_0x0796('0x0'));var util=require(_0x0796('0x1'));var logger=require(_0x0796('0x2'))(_0x0796('0x3'));var moment=require(_0x0796('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0796('0x5'));var rimraf=require(_0x0796('0x6'));var config=require(_0x0796('0x7'));var attributes=require(_0x0796('0x8'));module[_0x0796('0x9')]=function(_0x278155,_0x27f27d){return _0x278155[_0x0796('0xa')](_0x0796('0xb'),attributes,{'tableName':_0x0796('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99a0=['Variable','tools_variables','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x39d4ff,_0xa3c28d){var _0x455ca5=function(_0x1ef7cf){while(--_0x1ef7cf){_0x39d4ff['push'](_0x39d4ff['shift']());}};_0x455ca5(++_0xa3c28d);}(_0x99a0,0x92));var _0x099a=function(_0x1915bb,_0x130c90){_0x1915bb=_0x1915bb-0x0;var _0x3a0687=_0x99a0[_0x1915bb];return _0x3a0687;};'use strict';var _=require(_0x099a('0x0'));var util=require('util');var logger=require(_0x099a('0x1'))(_0x099a('0x2'));var moment=require(_0x099a('0x3'));var BPromise=require('bluebird');var rp=require(_0x099a('0x4'));var fs=require('fs');var path=require(_0x099a('0x5'));var rimraf=require(_0x099a('0x6'));var config=require(_0x099a('0x7'));var attributes=require(_0x099a('0x8'));module[_0x099a('0x9')]=function(_0x2d1bc3,_0x360753){return _0x2d1bc3['define'](_0x099a('0xa'),attributes,{'tableName':_0x099a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 7ca77ec..cef316c 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5e9ebd,_0x3bdb65){_0x5e9ebd=_0x5e9ebd-0x0;var _0x3f49bb=_0x1cb9[_0x5e9ebd];return _0x3f49bb;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x50e30b,_0x216368){var _0x4b7300=function(_0x8f06d7){while(--_0x8f06d7){_0x50e30b['push'](_0x50e30b['shift']());}};_0x4b7300(++_0x216368);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4db876,_0x532e02){_0x4db876=_0x4db876-0x0;var _0x48137a=_0x8ef6[_0x4db876];return _0x48137a;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 25d7c15..14b3c2c 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 _0x48ce=['express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','canUpdate','reset','/pull','pull','/restart','/migrations','migrations','exports'];(function(_0x9752a2,_0x3f4709){var _0x3c2a17=function(_0x349aae){while(--_0x349aae){_0x9752a2['push'](_0x9752a2['shift']());}};_0x3c2a17(++_0x3f4709);}(_0x48ce,0x121));var _0xe48c=function(_0x4b16c1,_0x3aa9a0){_0x4b16c1=_0x4b16c1-0x0;var _0x4108b6=_0x48ce[_0x4b16c1];return _0x4108b6;};'use strict';var express=require(_0xe48c('0x0'));var router=express[_0xe48c('0x1')]();var auth=require(_0xe48c('0x2'));var controller=require(_0xe48c('0x3'));router[_0xe48c('0x4')]('/',controller[_0xe48c('0x5')]);router[_0xe48c('0x4')](_0xe48c('0x6'),auth[_0xe48c('0x7')](),auth['canUpdate'](),controller[_0xe48c('0x8')]);router[_0xe48c('0x4')]('/reset',auth[_0xe48c('0x7')](),auth[_0xe48c('0x9')](),controller[_0xe48c('0xa')]);router[_0xe48c('0x4')](_0xe48c('0xb'),auth['isAuthenticated'](),auth[_0xe48c('0x9')](),controller[_0xe48c('0xc')]);router[_0xe48c('0x4')](_0xe48c('0xd'),auth['isAuthenticated'](),controller['restart']);router['get'](_0xe48c('0xe'),controller[_0xe48c('0xf')]);module[_0xe48c('0x10')]=router; \ No newline at end of file +var _0xfeec=['isAuthenticated','canUpdate','get','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','index','/fetch'];(function(_0x5afe6c,_0x5541d){var _0x4756eb=function(_0x417e63){while(--_0x417e63){_0x5afe6c['push'](_0x5afe6c['shift']());}};_0x4756eb(++_0x5541d);}(_0xfeec,0x1f3));var _0xcfee=function(_0x37db17,_0x3f6946){_0x37db17=_0x37db17-0x0;var _0x3d4283=_0xfeec[_0x37db17];return _0x3d4283;};'use strict';var express=require('express');var router=express[_0xcfee('0x0')]();var auth=require(_0xcfee('0x1'));var controller=require(_0xcfee('0x2'));router['get']('/',controller[_0xcfee('0x3')]);router['get'](_0xcfee('0x4'),auth[_0xcfee('0x5')](),auth[_0xcfee('0x6')](),controller['fetch']);router[_0xcfee('0x7')]('/reset',auth['isAuthenticated'](),auth[_0xcfee('0x6')](),controller['reset']);router['get']('/pull',auth[_0xcfee('0x5')](),auth[_0xcfee('0x6')](),controller[_0xcfee('0x8')]);router['get'](_0xcfee('0x9'),auth[_0xcfee('0x5')](),controller[_0xcfee('0xa')]);router[_0xcfee('0x7')](_0xcfee('0xb'),controller[_0xcfee('0xc')]);module[_0xcfee('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 7a4ee3a..54e316e 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 _0x0805=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','replace','push','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','version','query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x0805,0x157));var _0x5080=function(_0x12c83d,_0x537f1f){_0x12c83d=_0x12c83d-0x0;var _0x1cf216=_0x0805[_0x12c83d];return _0x1cf216;};'use strict';var Umzug=require(_0x5080('0x0'));var path=require(_0x5080('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x5080('0x2'))(module,'version');var compareVersions=require(_0x5080('0x3'));var exec=require(_0x5080('0x4'))[_0x5080('0x5')];var db=require(_0x5080('0x6'))['db'];var config=require(_0x5080('0x7'));var pm2=require(_0x5080('0x8'));var logger=require('../../config/logger')(_0x5080('0x9'));var git=require('simple-git')(config[_0x5080('0xa')]);exports[_0x5080('0xb')]=function(_0x3ee4da,_0x26a7b7){var _0x5f4757={'current':module[_0x5080('0xc')][_0x5080('0xd')],'phonebar':0x2};if(_0x3ee4da[_0x5080('0xe')]&&_0x3ee4da[_0x5080('0xe')][_0x5080('0xf')]){return git[_0x5080('0x10')]()[_0x5080('0x11')](function(_0x6cbc99,_0x42efa5){_0x5f4757[_0x5080('0xf')]=(_0x6cbc99?module['exports'][_0x5080('0xd')]:_0x42efa5[_0x5080('0xf')])||_0x5080('0x12');return _0x26a7b7[_0x5080('0x13')](0xc8)[_0x5080('0x14')](_0x5f4757);});}else{return _0x26a7b7[_0x5080('0x13')](0xc8)[_0x5080('0x14')](_0x5f4757);}};exports[_0x5080('0x10')]=function(_0x5607b0,_0x4e41d8){return git[_0x5080('0x10')]([_0x5080('0x15'),'master'],function(_0x53bf9d){if(_0x53bf9d){logger[_0x5080('0x16')](_0x53bf9d);return _0x4e41d8[_0x5080('0x13')](0x1f4)[_0x5080('0x14')](_0x53bf9d);}logger[_0x5080('0x17')]('git\x20fetch');return _0x4e41d8[_0x5080('0x13')](0xc8)[_0x5080('0x14')]({'output':_0x5080('0x18')});});};exports[_0x5080('0x19')]=function(_0x3f586d,_0x46653c){return git[_0x5080('0x19')]([_0x5080('0x1a'),_0x5080('0x1b')],function(_0x482480){if(_0x482480){logger[_0x5080('0x16')](_0x482480);return _0x46653c['status'](0x1f4)[_0x5080('0x14')](_0x482480);}logger[_0x5080('0x17')](_0x5080('0x1c'));return _0x46653c['status'](0xc8)['json']({'output':_0x5080('0x1d')});});};exports[_0x5080('0x1e')]=function(_0x8f440e,_0x2cd6b0){exec(_0x5080('0x1f'),function(_0x3b7184,_0x213c11,_0x3113f7){logger['info'](_0x213c11);logger[_0x5080('0x17')](_0x3113f7);if(_0x3b7184){logger[_0x5080('0x16')](_0x3b7184);return _0x2cd6b0['status'](0x1f4)[_0x5080('0x14')](_0x3b7184);}return _0x2cd6b0['status'](0xc8)[_0x5080('0x14')]({'output':_0x213c11});});};exports[_0x5080('0x20')]=function(_0x3fe9cc,_0x5a9eb0){return pm2[_0x5080('0x20')](_0x5080('0x21'))[_0x5080('0x22')](function(_0x451399){logger['info'](_0x5080('0x23'),_0x451399);return _0x5a9eb0[_0x5080('0x13')](0xc8)['json']({'output':_0x5080('0x24')});})[_0x5080('0x25')](function(_0x307652){logger[_0x5080('0x16')](_0x307652);return _0x5a9eb0[_0x5080('0x13')](0x1f4)[_0x5080('0x14')](_0x307652);});};exports[_0x5080('0x26')]=function(_0x4a6faf,_0x15e66e){var _0x265da5=fs[_0x5080('0x27')](path[_0x5080('0x28')](config[_0x5080('0xa')],'server',_0x5080('0x26')));var _0x525a6d=[];for(var _0x323961=0x0;_0x323961<_0x265da5[_0x5080('0x29')];_0x323961++){var _0x528ede=_0x265da5[_0x323961][_0x5080('0x2a')]('.js','');if(compareVersions(module['exports'][_0x5080('0xd')],_0x528ede)===-0x1){_0x525a6d[_0x5080('0x2b')](_0x528ede);}}if(_0x525a6d[_0x5080('0x29')]){var _0x26f15a=_0x525a6d['sort'](compareVersions);var _0x29730c=new Umzug({'storage':_0x5080('0x2c'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x5080('0xd')},'migrations':{'params':[db['sequelize'][_0x5080('0x2d')](),db[_0x5080('0x2c')][_0x5080('0x2e')],function(){throw new Error(_0x5080('0x2f'));}],'path':path[_0x5080('0x28')](config[_0x5080('0xa')],_0x5080('0x30'),_0x5080('0x26')),'pattern':/\.js$/}});_0x29730c['up']({'migrations':_[_0x5080('0x31')](_0x26f15a,function(_0x53c452){return _0x53c452+_0x5080('0x32');})})[_0x5080('0x22')](function(){return _0x15e66e['status'](0xc8)['json']({'output':_0x5080('0x33')+module[_0x5080('0xc')][_0x5080('0xd')]+'\x20to\x20'+_['last'](_0x26f15a),'migrations':_[_0x5080('0x28')](_0x26f15a)});})[_0x5080('0x25')](function(_0x1dbd7b){if(_0x1dbd7b instanceof db[_0x5080('0x2c')][_0x5080('0x34')]){return _0x15e66e[_0x5080('0x13')](0xc8)[_0x5080('0x14')]({'output':_0x5080('0x35')});}else{return _0x15e66e['status'](0x1f4)[_0x5080('0x14')](_0x1dbd7b);}});}else{return _0x15e66e['status'](0xc8)[_0x5080('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x5a3c=['Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','replace','.js','push','length','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','version','2.0.0','status','json','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0x5a3c,0x194));var _0xc5a3=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x5a3c[_0x1abb09];return _0xea1c07;};'use strict';var Umzug=require(_0xc5a3('0x0'));var path=require(_0xc5a3('0x1'));var fs=require('fs');var _=require(_0xc5a3('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xc5a3('0x3'));var exec=require(_0xc5a3('0x4'))[_0xc5a3('0x5')];var db=require(_0xc5a3('0x6'))['db'];var config=require(_0xc5a3('0x7'));var pm2=require(_0xc5a3('0x8'));var logger=require(_0xc5a3('0x9'))(_0xc5a3('0xa'));var git=require(_0xc5a3('0xb'))(config[_0xc5a3('0xc')]);exports[_0xc5a3('0xd')]=function(_0x583ad0,_0x4c05db){var _0xfcb5ac={'current':module[_0xc5a3('0xe')]['version'],'phonebar':0x2};if(_0x583ad0[_0xc5a3('0xf')]&&_0x583ad0[_0xc5a3('0xf')][_0xc5a3('0x10')]){return git[_0xc5a3('0x11')]()[_0xc5a3('0x12')](function(_0xb10cc7,_0x2db782){_0xfcb5ac[_0xc5a3('0x10')]=(_0xb10cc7?module[_0xc5a3('0xe')][_0xc5a3('0x13')]:_0x2db782[_0xc5a3('0x10')])||_0xc5a3('0x14');return _0x4c05db[_0xc5a3('0x15')](0xc8)[_0xc5a3('0x16')](_0xfcb5ac);});}else{return _0x4c05db[_0xc5a3('0x15')](0xc8)[_0xc5a3('0x16')](_0xfcb5ac);}};exports[_0xc5a3('0x11')]=function(_0x5ccd59,_0x221521){return git['fetch'](['origin',_0xc5a3('0x17')],function(_0x4f5f9c){if(_0x4f5f9c){logger['error'](_0x4f5f9c);return _0x221521['status'](0x1f4)[_0xc5a3('0x16')](_0x4f5f9c);}logger[_0xc5a3('0x18')](_0xc5a3('0x19'));return _0x221521[_0xc5a3('0x15')](0xc8)[_0xc5a3('0x16')]({'output':_0xc5a3('0x1a')});});};exports[_0xc5a3('0x1b')]=function(_0x3844fa,_0x2a62e5){return git[_0xc5a3('0x1b')]([_0xc5a3('0x1c'),_0xc5a3('0x1d')],function(_0x488d1e){if(_0x488d1e){logger[_0xc5a3('0x1e')](_0x488d1e);return _0x2a62e5[_0xc5a3('0x15')](0x1f4)['json'](_0x488d1e);}logger[_0xc5a3('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2a62e5['status'](0xc8)[_0xc5a3('0x16')]({'output':_0xc5a3('0x1f')});});};exports[_0xc5a3('0x20')]=function(_0x17a5c7,_0x1b4120){exec(_0xc5a3('0x21'),function(_0x4ccf78,_0x4539e1,_0x3b446d){logger['info'](_0x4539e1);logger[_0xc5a3('0x18')](_0x3b446d);if(_0x4ccf78){logger[_0xc5a3('0x1e')](_0x4ccf78);return _0x1b4120['status'](0x1f4)[_0xc5a3('0x16')](_0x4ccf78);}return _0x1b4120[_0xc5a3('0x15')](0xc8)[_0xc5a3('0x16')]({'output':_0x4539e1});});};exports[_0xc5a3('0x22')]=function(_0x190231,_0x15c776){return pm2[_0xc5a3('0x22')]('motion2')[_0xc5a3('0x23')](function(_0x5615b8){logger[_0xc5a3('0x18')]('pm2\x20restart\x20motion\x20%s',_0x5615b8);return _0x15c776['status'](0xc8)[_0xc5a3('0x16')]({'output':_0xc5a3('0x24')});})['catch'](function(_0x2ec746){logger[_0xc5a3('0x1e')](_0x2ec746);return _0x15c776[_0xc5a3('0x15')](0x1f4)['json'](_0x2ec746);});};exports[_0xc5a3('0x25')]=function(_0x33f974,_0x5241dd){var _0x282a19=fs[_0xc5a3('0x26')](path[_0xc5a3('0x27')](config['root'],_0xc5a3('0x28'),_0xc5a3('0x25')));var _0xdd9dca=[];for(var _0x2a658c=0x0;_0x2a658c<_0x282a19['length'];_0x2a658c++){var _0x1acc7e=_0x282a19[_0x2a658c][_0xc5a3('0x29')](_0xc5a3('0x2a'),'');if(compareVersions(module[_0xc5a3('0xe')][_0xc5a3('0x13')],_0x1acc7e)===-0x1){_0xdd9dca[_0xc5a3('0x2b')](_0x1acc7e);}}if(_0xdd9dca[_0xc5a3('0x2c')]){var _0x5f4b81=_0xdd9dca['sort'](compareVersions);var _0x5f1cd0=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xc5a3('0x2d')],'modelName':_0xc5a3('0x2d'),'columnName':_0xc5a3('0x13')},'migrations':{'params':[db[_0xc5a3('0x2e')][_0xc5a3('0x2f')](),db[_0xc5a3('0x2e')][_0xc5a3('0x30')],function(){throw new Error(_0xc5a3('0x31'));}],'path':path[_0xc5a3('0x27')](config[_0xc5a3('0xc')],_0xc5a3('0x28'),_0xc5a3('0x25')),'pattern':/\.js$/}});_0x5f1cd0['up']({'migrations':_[_0xc5a3('0x32')](_0x5f4b81,function(_0x2672de){return _0x2672de+_0xc5a3('0x2a');})})[_0xc5a3('0x23')](function(){return _0x5241dd[_0xc5a3('0x15')](0xc8)[_0xc5a3('0x16')]({'output':_0xc5a3('0x33')+module[_0xc5a3('0xe')][_0xc5a3('0x13')]+_0xc5a3('0x34')+_[_0xc5a3('0x35')](_0x5f4b81),'migrations':_[_0xc5a3('0x27')](_0x5f4b81)});})['catch'](function(_0x5661ef){if(_0x5661ef instanceof db[_0xc5a3('0x2e')]['UniqueConstraintError']){return _0x5241dd[_0xc5a3('0x15')](0xc8)[_0xc5a3('0x16')]({'output':_0xc5a3('0x36')});}else{return _0x5241dd[_0xc5a3('0x15')](0x1f4)[_0xc5a3('0x16')](_0x5661ef);}});}else{return _0x5241dd['status'](0xc8)[_0xc5a3('0x16')]({'output':_0xc5a3('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 2ee3b5e..18160aa 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 _0x3978=['get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x26c16c,_0xb66511){var _0x2ef9a8=function(_0x296966){while(--_0x296966){_0x26c16c['push'](_0x26c16c['shift']());}};_0x2ef9a8(++_0xb66511);}(_0x3978,0x186));var _0x8397=function(_0xb56221,_0x2797fb){_0xb56221=_0xb56221-0x0;var _0x6a5cb=_0x3978[_0xb56221];return _0x6a5cb;};'use strict';var multer=require(_0x8397('0x0'));var util=require('util');var path=require(_0x8397('0x1'));var timeout=require('connect-timeout');var express=require(_0x8397('0x2'));var router=express[_0x8397('0x3')]();var fs_extra=require(_0x8397('0x4'));var auth=require(_0x8397('0x5'));var interaction=require(_0x8397('0x6'));var config=require(_0x8397('0x7'));var controller=require(_0x8397('0x8'));router[_0x8397('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8397('0x9')]('/describe',auth[_0x8397('0xa')](),controller[_0x8397('0xb')]);router['get'](_0x8397('0xc'),auth['isAuthenticated'](),controller[_0x8397('0xd')]);router[_0x8397('0xe')]('/',auth[_0x8397('0xa')](),controller[_0x8397('0xf')]);router[_0x8397('0x10')](_0x8397('0xc'),auth['isAuthenticated'](),controller[_0x8397('0x11')]);router[_0x8397('0x12')](_0x8397('0xc'),auth[_0x8397('0xa')](),controller[_0x8397('0x13')]);module[_0x8397('0x14')]=router; \ No newline at end of file +var _0x3b89=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b89,0x153));var _0x93b8=function(_0x48d3f8,_0x502a1b){_0x48d3f8=_0x48d3f8-0x0;var _0x3f6498=_0x3b89[_0x48d3f8];return _0x3f6498;};'use strict';var multer=require(_0x93b8('0x0'));var util=require(_0x93b8('0x1'));var path=require(_0x93b8('0x2'));var timeout=require(_0x93b8('0x3'));var express=require(_0x93b8('0x4'));var router=express['Router']();var fs_extra=require(_0x93b8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x93b8('0x6'));var config=require(_0x93b8('0x7'));var controller=require('./voiceAgentReport.controller');router[_0x93b8('0x8')]('/',auth[_0x93b8('0x9')](),controller[_0x93b8('0xa')]);router[_0x93b8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x93b8('0xb')]);router[_0x93b8('0x8')](_0x93b8('0xc'),auth[_0x93b8('0x9')](),controller[_0x93b8('0xd')]);router[_0x93b8('0xe')]('/',auth[_0x93b8('0x9')](),controller['create']);router['put']('/:id',auth[_0x93b8('0x9')](),controller[_0x93b8('0xf')]);router[_0x93b8('0x10')](_0x93b8('0xc'),auth[_0x93b8('0x9')](),controller[_0x93b8('0x11')]);module[_0x93b8('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 6a74c91..95294cc 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 _0x3870=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x12744f,_0x2a4c3d){var _0x3cee31=function(_0x54468e){while(--_0x54468e){_0x12744f['push'](_0x12744f['shift']());}};_0x3cee31(++_0x2a4c3d);}(_0x3870,0x146));var _0x0387=function(_0x252869,_0x3749a5){_0x252869=_0x252869-0x0;var _0x36a4f6=_0x3870[_0x252869];return _0x36a4f6;};'use strict';var Sequelize=require(_0x0387('0x0'));module[_0x0387('0x1')]={'type':{'type':Sequelize[_0x0387('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0387('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0387('0x2')]},'interface':{'type':Sequelize[_0x0387('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x0387('0x3')]},'agentconnectAt':{'type':Sequelize[_0x0387('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x0387('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x0387('0x3')]},'holdtime':{'type':Sequelize[_0x0387('0x4')]},'agentcomplete':{'type':Sequelize[_0x0387('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x0387('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0387('0x4')]},'agentacw':{'type':Sequelize[_0x0387('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0387('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x0387('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x0387('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0387('0x2')]},'connectedlinename':{'type':Sequelize[_0x0387('0x2')]},'language':{'type':Sequelize[_0x0387('0x2')]},'accountcode':{'type':Sequelize[_0x0387('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0387('0x2')]},'priority':{'type':Sequelize[_0x0387('0x2')]},'destchannel':{'type':Sequelize[_0x0387('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x0387('0x2')]},'destcalleridname':{'type':Sequelize[_0x0387('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0387('0x2')]},'destaccountcode':{'type':Sequelize[_0x0387('0x2')]},'destcontext':{'type':Sequelize[_0x0387('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x0387('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x0387('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0387('0x2')],'comment':_0x0387('0x6')},'transferexten':{'type':Sequelize[_0x0387('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0387('0x2')]},'agententerreason':{'type':Sequelize[_0x0387('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd943=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x4d8524,_0x1e8925){var _0xbdb413=function(_0x1e70d7){while(--_0x1e70d7){_0x4d8524['push'](_0x4d8524['shift']());}};_0xbdb413(++_0x1e8925);}(_0xd943,0x15d));var _0x3d94=function(_0xb2d950,_0x48c0f6){_0xb2d950=_0xb2d950-0x0;var _0x4c5321=_0xd943[_0xb2d950];return _0x4c5321;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'type':{'type':Sequelize[_0x3d94('0x2')]},'uniqueid':{'type':Sequelize[_0x3d94('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3d94('0x2')]},'queue':{'type':Sequelize[_0x3d94('0x2')]},'interface':{'type':Sequelize[_0x3d94('0x2')]},'membername':{'type':Sequelize[_0x3d94('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3d94('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x3d94('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3d94('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3d94('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3d94('0x5')]},'reason':{'type':Sequelize[_0x3d94('0x2')]},'lastevent':{'type':Sequelize[_0x3d94('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3d94('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3d94('0x2')]},'connectedlinename':{'type':Sequelize[_0x3d94('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3d94('0x2')]},'context':{'type':Sequelize[_0x3d94('0x2')]},'exten':{'type':Sequelize[_0x3d94('0x2')]},'priority':{'type':Sequelize[_0x3d94('0x2')]},'destchannel':{'type':Sequelize[_0x3d94('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x3d94('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3d94('0x2')]},'destcalleridname':{'type':Sequelize[_0x3d94('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x3d94('0x2')]},'destlanguage':{'type':Sequelize[_0x3d94('0x2')]},'destaccountcode':{'type':Sequelize[_0x3d94('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x3d94('0x2')]},'destpriority':{'type':Sequelize[_0x3d94('0x2')]},'destuniqueid':{'type':Sequelize[_0x3d94('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3d94('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x3d94('0x2')]},'transfer':{'type':Sequelize[_0x3d94('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3d94('0x2')],'comment':_0x3d94('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3d94('0x2')]},'agententerreason':{'type':Sequelize[_0x3d94('0x5')],'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 85804fb..ccc329c 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(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 1fcb20e..749c8d3 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 _0xe94a=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceAgentReport','destuniqueid'];(function(_0x5a1b0b,_0x1881ed){var _0x3dce33=function(_0x1d08dd){while(--_0x1d08dd){_0x5a1b0b['push'](_0x5a1b0b['shift']());}};_0x3dce33(++_0x1881ed);}(_0xe94a,0x1c7));var _0xae94=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xe94a[_0x59342a];return _0x17abc9;};'use strict';var _=require(_0xae94('0x0'));var util=require(_0xae94('0x1'));var logger=require(_0xae94('0x2'))('api');var moment=require(_0xae94('0x3'));var BPromise=require(_0xae94('0x4'));var rp=require(_0xae94('0x5'));var fs=require('fs');var path=require(_0xae94('0x6'));var rimraf=require(_0xae94('0x7'));var config=require(_0xae94('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0xae94('0x9')]=function(_0x1f836b,_0x1f587d){return _0x1f836b[_0xae94('0xa')](_0xae94('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0xae94('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7676=['define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','path','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x543865,_0x502676){var _0x1d3e67=function(_0x3132e4){while(--_0x3132e4){_0x543865['push'](_0x543865['shift']());}};_0x1d3e67(++_0x502676);}(_0x7676,0xb8));var _0x6767=function(_0x2e1137,_0x23b049){_0x2e1137=_0x2e1137-0x0;var _0x3247f5=_0x7676[_0x2e1137];return _0x3247f5;};'use strict';var _=require(_0x6767('0x0'));var util=require(_0x6767('0x1'));var logger=require(_0x6767('0x2'))('api');var moment=require(_0x6767('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6767('0x4'));var rimraf=require('rimraf');var config=require(_0x6767('0x5'));var attributes=require(_0x6767('0x6'));module[_0x6767('0x7')]=function(_0x4d0c08,_0x24d747){return _0x4d0c08[_0x6767('0x8')](_0x6767('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x6767('0xa'),_0x6767('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2d639c8..b29cea3 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 _0xcf76=['create','body','raw','then','stringify','UpdateVoiceAgentReport','update','options','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x14ee69,_0x436a8a){var _0x4d5664=function(_0x3e69bc){while(--_0x3e69bc){_0x14ee69['push'](_0x14ee69['shift']());}};_0x4d5664(++_0x436a8a);}(_0xcf76,0x14a));var _0x6cf7=function(_0x1e4643,_0x55f7ad){_0x1e4643=_0x1e4643-0x0;var _0xe31037=_0xcf76[_0x1e4643];return _0xe31037;};'use strict';var _=require(_0x6cf7('0x0'));var util=require(_0x6cf7('0x1'));var moment=require(_0x6cf7('0x2'));var BPromise=require(_0x6cf7('0x3'));var rs=require(_0x6cf7('0x4'));var fs=require('fs');var Redis=require(_0x6cf7('0x5'));var db=require(_0x6cf7('0x6'))['db'];var utils=require(_0x6cf7('0x7'));var logger=require(_0x6cf7('0x8'))('rpc');var config=require(_0x6cf7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6cf7('0xa')][_0x6cf7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31fccd,_0x336d5b,_0x3fc5e9){return new BPromise(function(_0x29e375,_0x84e7bb){return client['request'](_0x31fccd,_0x3fc5e9)['then'](function(_0x3faeff){logger['info'](_0x6cf7('0xc'),_0x336d5b,_0x6cf7('0xd'));logger[_0x6cf7('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x336d5b,'request\x20sent',JSON['stringify'](_0x3faeff));if(_0x3faeff[_0x6cf7('0xf')]){if(_0x3faeff[_0x6cf7('0xf')][_0x6cf7('0x10')]===0x1f4){logger[_0x6cf7('0xf')](_0x6cf7('0xc'),_0x336d5b,_0x3faeff['error']['message']);return _0x84e7bb(_0x3faeff[_0x6cf7('0xf')]['message']);}logger['error'](_0x6cf7('0xc'),_0x336d5b,_0x3faeff[_0x6cf7('0xf')][_0x6cf7('0x11')]);return _0x29e375(_0x3faeff[_0x6cf7('0xf')]['message']);}else{logger[_0x6cf7('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x336d5b,_0x6cf7('0xd'));_0x29e375(_0x3faeff['result'][_0x6cf7('0x11')]);}})[_0x6cf7('0x13')](function(_0x530dbc){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x336d5b,_0x530dbc);_0x84e7bb(_0x530dbc);});});}exports[_0x6cf7('0x14')]=function(_0x28cd99){var _0x2c8f99=this;return new Promise(function(_0x470785,_0xd91a16){return db[_0x6cf7('0x15')][_0x6cf7('0x16')](_0x28cd99[_0x6cf7('0x17')],{'raw':_0x28cd99['options']?_0x28cd99['options'][_0x6cf7('0x18')]===undefined?!![]:![]:!![]})[_0x6cf7('0x19')](function(_0x3ea469){logger[_0x6cf7('0x12')]('CreateVoiceAgentReport',_0x28cd99);logger[_0x6cf7('0xe')](_0x6cf7('0x14'),_0x28cd99,JSON[_0x6cf7('0x1a')](_0x3ea469));_0x470785(_0x3ea469);})[_0x6cf7('0x13')](function(_0x328673){logger['error'](_0x6cf7('0x14'),_0x328673[_0x6cf7('0x11')],_0x28cd99);_0xd91a16(_0x2c8f99['error'](0x1f4,_0x328673['message']));});});};exports[_0x6cf7('0x1b')]=function(_0x305034){var _0xddb92b=this;return new Promise(function(_0xe61a23,_0x5a72e5){return db[_0x6cf7('0x15')][_0x6cf7('0x1c')](_0x305034['body'],{'raw':_0x305034['options']?_0x305034[_0x6cf7('0x1d')][_0x6cf7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x305034['options']?_0x305034[_0x6cf7('0x1d')][_0x6cf7('0x1e')]||null:null,'attributes':_0x305034[_0x6cf7('0x1d')]?_0x305034[_0x6cf7('0x1d')]['attributes']||null:null,'limit':_0x305034[_0x6cf7('0x1d')]?_0x305034[_0x6cf7('0x1d')][_0x6cf7('0x1f')]||null:null})[_0x6cf7('0x19')](function(_0x2d6ded){logger[_0x6cf7('0x12')](_0x6cf7('0x1b'),_0x305034);logger[_0x6cf7('0xe')](_0x6cf7('0x1b'),_0x305034,JSON[_0x6cf7('0x1a')](_0x2d6ded));_0xe61a23(_0x2d6ded);})[_0x6cf7('0x13')](function(_0x3ed563){logger[_0x6cf7('0xf')]('UpdateVoiceAgentReport',_0x3ed563[_0x6cf7('0x11')],_0x305034);_0x5a72e5(_0xddb92b[_0x6cf7('0xf')](0x1f4,_0x3ed563[_0x6cf7('0x11')]));});});}; \ No newline at end of file +var _0x3670=['ioredis','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceAgentReport','body','options','raw','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird'];(function(_0x2dd9a2,_0x38a3f6){var _0x14dacd=function(_0x3fde9e){while(--_0x3fde9e){_0x2dd9a2['push'](_0x2dd9a2['shift']());}};_0x14dacd(++_0x38a3f6);}(_0x3670,0xb9));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0367('0x0'));var util=require(_0x0367('0x1'));var moment=require(_0x0367('0x2'));var BPromise=require(_0x0367('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0367('0x4'));var db=require('../../mysqldb')['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[_0x0367('0x5')][_0x0367('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x35511f,_0x19aa44,_0x59e224){return new BPromise(function(_0x4b8856,_0x456d0b){return client['request'](_0x35511f,_0x59e224)[_0x0367('0x7')](function(_0x1186a2){logger[_0x0367('0x8')](_0x0367('0x9'),_0x19aa44,_0x0367('0xa'));logger[_0x0367('0xb')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x19aa44,'request\x20sent',JSON[_0x0367('0xc')](_0x1186a2));if(_0x1186a2[_0x0367('0xd')]){if(_0x1186a2[_0x0367('0xd')][_0x0367('0xe')]===0x1f4){logger[_0x0367('0xd')](_0x0367('0x9'),_0x19aa44,_0x1186a2[_0x0367('0xd')]['message']);return _0x456d0b(_0x1186a2['error'][_0x0367('0xf')]);}logger[_0x0367('0xd')](_0x0367('0x9'),_0x19aa44,_0x1186a2[_0x0367('0xd')][_0x0367('0xf')]);return _0x4b8856(_0x1186a2[_0x0367('0xd')]['message']);}else{logger['info'](_0x0367('0x9'),_0x19aa44,_0x0367('0xa'));_0x4b8856(_0x1186a2[_0x0367('0x10')]['message']);}})[_0x0367('0x11')](function(_0x1a03ba){logger[_0x0367('0xd')](_0x0367('0x9'),_0x19aa44,_0x1a03ba);_0x456d0b(_0x1a03ba);});});}exports[_0x0367('0x12')]=function(_0x3500b1){var _0x3e4d18=this;return new Promise(function(_0x8908d0,_0x4a0ce7){return db['VoiceAgentReport']['create'](_0x3500b1[_0x0367('0x13')],{'raw':_0x3500b1['options']?_0x3500b1[_0x0367('0x14')][_0x0367('0x15')]===undefined?!![]:![]:!![]})[_0x0367('0x7')](function(_0x1c03f2){logger['info']('CreateVoiceAgentReport',_0x3500b1);logger[_0x0367('0xb')]('CreateVoiceAgentReport',_0x3500b1,JSON[_0x0367('0xc')](_0x1c03f2));_0x8908d0(_0x1c03f2);})[_0x0367('0x11')](function(_0x45ef41){logger[_0x0367('0xd')](_0x0367('0x12'),_0x45ef41[_0x0367('0xf')],_0x3500b1);_0x4a0ce7(_0x3e4d18['error'](0x1f4,_0x45ef41[_0x0367('0xf')]));});});};exports['UpdateVoiceAgentReport']=function(_0x1b74d0){var _0x2e0c38=this;return new Promise(function(_0x15ee36,_0x4b1dfe){return db['VoiceAgentReport'][_0x0367('0x16')](_0x1b74d0[_0x0367('0x13')],{'raw':_0x1b74d0['options']?_0x1b74d0[_0x0367('0x14')][_0x0367('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b74d0[_0x0367('0x14')]?_0x1b74d0[_0x0367('0x14')][_0x0367('0x17')]||null:null,'attributes':_0x1b74d0['options']?_0x1b74d0[_0x0367('0x14')][_0x0367('0x18')]||null:null,'limit':_0x1b74d0['options']?_0x1b74d0[_0x0367('0x14')][_0x0367('0x19')]||null:null})[_0x0367('0x7')](function(_0x13bcd6){logger[_0x0367('0x8')](_0x0367('0x1a'),_0x1b74d0);logger[_0x0367('0xb')](_0x0367('0x1a'),_0x1b74d0,JSON['stringify'](_0x13bcd6));_0x15ee36(_0x13bcd6);})[_0x0367('0x11')](function(_0x172919){logger['error'](_0x0367('0x1a'),_0x172919['message'],_0x1b74d0);_0x4b1dfe(_0x2e0c38[_0x0367('0xd')](0x1f4,_0x172919['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e2a09cb..11c8c47 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 _0x04de=['describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','/describe','isAuthenticated'];(function(_0x42baf6,_0x40eae8){var _0x3b1ae6=function(_0x1b4ceb){while(--_0x1b4ceb){_0x42baf6['push'](_0x42baf6['shift']());}};_0x3b1ae6(++_0x40eae8);}(_0x04de,0x107));var _0xe04d=function(_0x751dba,_0x49a1be){_0x751dba=_0x751dba-0x0;var _0x6a2946=_0x04de[_0x751dba];return _0x6a2946;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0xd')]);router[_0xe04d('0xe')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x10')]);router[_0xe04d('0x11')]('/',auth['isAuthenticated'](),controller[_0xe04d('0x12')]);router[_0xe04d('0x13')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x14')]);router[_0xe04d('0x15')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x16')]);module['exports']=router; \ No newline at end of file +var _0xb66c=['./voiceCallReport.controller','get','/describe','isAuthenticated','describe','show','post','create','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x19e928,_0x26a0e4){var _0x4e941f=function(_0x52a5cd){while(--_0x52a5cd){_0x19e928['push'](_0x19e928['shift']());}};_0x4e941f(++_0x26a0e4);}(_0xb66c,0x175));var _0xcb66=function(_0x4d3514,_0x4cbb27){_0x4d3514=_0x4d3514-0x0;var _0x462ef1=_0xb66c[_0x4d3514];return _0x462ef1;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require(_0xcb66('0x1'));var timeout=require('connect-timeout');var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var fs_extra=require(_0xcb66('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var controller=require(_0xcb66('0x7'));router[_0xcb66('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcb66('0x8')](_0xcb66('0x9'),auth[_0xcb66('0xa')](),controller[_0xcb66('0xb')]);router[_0xcb66('0x8')]('/:id',auth[_0xcb66('0xa')](),controller[_0xcb66('0xc')]);router[_0xcb66('0xd')]('/',auth[_0xcb66('0xa')](),controller[_0xcb66('0xe')]);router['put'](_0xcb66('0xf'),auth[_0xcb66('0xa')](),controller[_0xcb66('0x10')]);router[_0xcb66('0x11')]('/:id',auth[_0xcb66('0xa')](),controller[_0xcb66('0x12')]);module[_0xcb66('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index da1a7e3..0fe12b3 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 _0x0854=['INTEGER','sequelize','STRING','ENUM','internal','outbound','inbound-fax','outbound-fax','DATE'];(function(_0xc6821a,_0x38d00a){var _0x4aab05=function(_0x1d0517){while(--_0x1d0517){_0xc6821a['push'](_0xc6821a['shift']());}};_0x4aab05(++_0x38d00a);}(_0x0854,0xd9));var _0x4085=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0854[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x4085('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4085('0x1')]},'type':{'type':Sequelize[_0x4085('0x2')]('inbound',_0x4085('0x3'),_0x4085('0x4'),_0x4085('0x5'),_0x4085('0x6'),'dialer')},'tag':{'type':Sequelize[_0x4085('0x1')]},'accountcode':{'type':Sequelize[_0x4085('0x1')]},'source':{'type':Sequelize[_0x4085('0x1')]},'destination':{'type':Sequelize[_0x4085('0x1')]},'destinationcontext':{'type':Sequelize[_0x4085('0x1')]},'callerid':{'type':Sequelize[_0x4085('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x4085('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x4085('0x7')]},'systemanswertime':{'type':Sequelize[_0x4085('0x7')]},'answertime':{'type':Sequelize[_0x4085('0x7')]},'endtime':{'type':Sequelize[_0x4085('0x7')]},'duration':{'type':Sequelize[_0x4085('0x8')]},'billableseconds':{'type':Sequelize[_0x4085('0x8')]},'mohtime':{'type':Sequelize[_0x4085('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4085('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4085('0x1')]},'userDisposition':{'type':Sequelize[_0x4085('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x4085('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x4085('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x4085('0x1')]},'routeid':{'type':Sequelize[_0x4085('0x8')]},'sipcallid':{'type':Sequelize[_0x4085('0x1')]}}; \ No newline at end of file +var _0x8f25=['INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','dialer','TEXT','DATE'];(function(_0x437249,_0x17a89b){var _0x1194f7=function(_0x153b4f){while(--_0x153b4f){_0x437249['push'](_0x437249['shift']());}};_0x1194f7(++_0x17a89b);}(_0x8f25,0x14b));var _0x58f2=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x8f25[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x58f2('0x0'));module[_0x58f2('0x1')]={'uniqueid':{'type':Sequelize[_0x58f2('0x2')]},'type':{'type':Sequelize[_0x58f2('0x3')](_0x58f2('0x4'),_0x58f2('0x5'),'outbound','inbound-fax','outbound-fax',_0x58f2('0x6'))},'tag':{'type':Sequelize[_0x58f2('0x2')]},'accountcode':{'type':Sequelize[_0x58f2('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x58f2('0x2')]},'destinationcontext':{'type':Sequelize[_0x58f2('0x2')]},'callerid':{'type':Sequelize[_0x58f2('0x2')]},'channel':{'type':Sequelize[_0x58f2('0x2')]},'destinationchannel':{'type':Sequelize[_0x58f2('0x2')]},'lastapplication':{'type':Sequelize[_0x58f2('0x2')]},'lastdata':{'type':Sequelize[_0x58f2('0x7')]},'starttime':{'type':Sequelize[_0x58f2('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x58f2('0x8')]},'endtime':{'type':Sequelize[_0x58f2('0x8')]},'duration':{'type':Sequelize[_0x58f2('0x9')]},'billableseconds':{'type':Sequelize[_0x58f2('0x9')]},'mohtime':{'type':Sequelize[_0x58f2('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x58f2('0x2')]},'userfield':{'type':Sequelize[_0x58f2('0x2')]},'userDisposition':{'type':Sequelize[_0x58f2('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x58f2('0x2')]},'note':{'type':Sequelize[_0x58f2('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x58f2('0x9')]},'sipcallid':{'type':Sequelize[_0x58f2('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e0be960..e2f4094 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x5df01c,_0x3ad300){var _0xeb5443=function(_0x35fbc0){while(--_0x35fbc0){_0x5df01c['push'](_0x5df01c['shift']());}};_0xeb5443(++_0x3ad300);}(_0x0b0e,0x187));var _0xe0b0=function(_0x17dcd1,_0x3b7ccb){_0x17dcd1=_0x17dcd1-0x0;var _0x12af77=_0x0b0e[_0x17dcd1];return _0x12af77;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,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(_0x45ceac,_0x2582e9){var _0x4dd773=function(_0x35cd4a){while(--_0x35cd4a){_0x45ceac['push'](_0x45ceac['shift']());}};_0x4dd773(++_0x2582e9);}(_0xdb28,0x106));var _0x8db2=function(_0x30c69c,_0x35c45d){_0x30c69c=_0x30c69c-0x0;var _0x29b307=_0xdb28[_0x30c69c];return _0x29b307;};'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 cf99c25..ab791ef 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 _0xbb50=['api','moment','request-promise','rimraf','./voiceCallReport.attributes','define','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbb50,0x11b));var _0x0bb5=function(_0x5cf608,_0x3ed79a){_0x5cf608=_0x5cf608-0x0;var _0x1e1560=_0xbb50[_0x5cf608];return _0x1e1560;};'use strict';var _=require(_0x0bb5('0x0'));var util=require(_0x0bb5('0x1'));var logger=require(_0x0bb5('0x2'))(_0x0bb5('0x3'));var moment=require(_0x0bb5('0x4'));var BPromise=require('bluebird');var rp=require(_0x0bb5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0bb5('0x6'));var config=require('../../config/environment');var attributes=require(_0x0bb5('0x7'));module['exports']=function(_0x487540,_0x5bd643){return _0x487540[_0x0bb5('0x8')]('VoiceCallReport',attributes,{'tableName':_0x0bb5('0x9'),'paranoid':![],'indexes':[{'fields':[_0x0bb5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdcb4=['define','VoiceCallReport','report_call','uniqueid','lodash','util','api','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xdcb4,0x12d));var _0x4dcb=function(_0x10a5b3,_0x5eb793){_0x10a5b3=_0x10a5b3-0x0;var _0x51e574=_0xdcb4[_0x10a5b3];return _0x51e574;};'use strict';var _=require(_0x4dcb('0x0'));var util=require(_0x4dcb('0x1'));var logger=require('../../config/logger')(_0x4dcb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4dcb('0x3'));var rimraf=require(_0x4dcb('0x4'));var config=require(_0x4dcb('0x5'));var attributes=require(_0x4dcb('0x6'));module['exports']=function(_0xcf9ab7,_0x47f7ad){return _0xcf9ab7[_0x4dcb('0x7')](_0x4dcb('0x8'),attributes,{'tableName':_0x4dcb('0x9'),'paranoid':![],'indexes':[{'fields':[_0x4dcb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 1dd7ec2..dd5b748 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 _0x4107=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','limit','include','model','attributes','map','then','CreateVoiceCallReport','body','UpdateVoiceCallReport','where','lodash','util','moment'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x4107,0x10d));var _0x7410=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0x4107[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0x7410('0x0'));var util=require(_0x7410('0x1'));var moment=require(_0x7410('0x2'));var BPromise=require('bluebird');var rs=require(_0x7410('0x3'));var fs=require('fs');var Redis=require(_0x7410('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7410('0x5'));var logger=require('../../config/logger')(_0x7410('0x6'));var config=require(_0x7410('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7410('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30ffc1,_0x5ddd0d,_0x212190){return new BPromise(function(_0x42877c,_0x4a2abd){return client[_0x7410('0x9')](_0x30ffc1,_0x212190)['then'](function(_0x597f4c){logger[_0x7410('0xa')](_0x7410('0xb'),_0x5ddd0d,_0x7410('0xc'));logger[_0x7410('0xd')](_0x7410('0xe'),_0x5ddd0d,_0x7410('0xc'),JSON[_0x7410('0xf')](_0x597f4c));if(_0x597f4c[_0x7410('0x10')]){if(_0x597f4c[_0x7410('0x10')]['code']===0x1f4){logger['error'](_0x7410('0xb'),_0x5ddd0d,_0x597f4c['error']['message']);return _0x4a2abd(_0x597f4c['error']['message']);}logger[_0x7410('0x10')](_0x7410('0xb'),_0x5ddd0d,_0x597f4c[_0x7410('0x10')][_0x7410('0x11')]);return _0x42877c(_0x597f4c[_0x7410('0x10')][_0x7410('0x11')]);}else{logger[_0x7410('0xa')](_0x7410('0xb'),_0x5ddd0d,_0x7410('0xc'));_0x42877c(_0x597f4c['result']['message']);}})[_0x7410('0x12')](function(_0x10f2d8){logger[_0x7410('0x10')](_0x7410('0xb'),_0x5ddd0d,_0x10f2d8);_0x4a2abd(_0x10f2d8);});});}exports[_0x7410('0x13')]=function(_0x75416f){var _0x50781e=this;return new Promise(function(_0x2a141b,_0x3039aa){return db[_0x7410('0x14')][_0x7410('0x15')]({'raw':_0x75416f[_0x7410('0x16')]?_0x75416f['options'][_0x7410('0x17')]===undefined?!![]:![]:!![],'where':_0x75416f[_0x7410('0x16')]?_0x75416f[_0x7410('0x16')]['where']||null:null,'attributes':_0x75416f[_0x7410('0x16')]?_0x75416f[_0x7410('0x16')]['attributes']||null:null,'limit':_0x75416f[_0x7410('0x16')]?_0x75416f[_0x7410('0x16')][_0x7410('0x18')]||null:null,'include':_0x75416f[_0x7410('0x16')]?_0x75416f[_0x7410('0x16')][_0x7410('0x19')]?_['map'](_0x75416f[_0x7410('0x16')][_0x7410('0x19')],function(_0x2d038c){return{'model':db[_0x2d038c[_0x7410('0x1a')]],'as':_0x2d038c['as'],'attributes':_0x2d038c[_0x7410('0x1b')],'include':_0x2d038c['include']?_[_0x7410('0x1c')](_0x2d038c[_0x7410('0x19')],function(_0x3038b4){return{'model':db[_0x3038b4[_0x7410('0x1a')]],'as':_0x3038b4['as'],'attributes':_0x3038b4[_0x7410('0x1b')],'include':_0x3038b4[_0x7410('0x19')]?_['map'](_0x3038b4[_0x7410('0x19')],function(_0x4a742f){return{'model':db[_0x4a742f[_0x7410('0x1a')]],'as':_0x4a742f['as'],'attributes':_0x4a742f[_0x7410('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7410('0x1d')](function(_0x38fb67){logger[_0x7410('0xa')](_0x7410('0x13'),_0x75416f);logger['debug'](_0x7410('0x13'),_0x75416f,JSON[_0x7410('0xf')](_0x38fb67));_0x2a141b(_0x38fb67);})[_0x7410('0x12')](function(_0x3a82aa){logger[_0x7410('0x10')](_0x7410('0x13'),_0x3a82aa[_0x7410('0x11')],_0x75416f);_0x3039aa(_0x50781e[_0x7410('0x10')](0x1f4,_0x3a82aa[_0x7410('0x11')]));});});};exports[_0x7410('0x1e')]=function(_0x332d25){var _0x5a6065=this;return new Promise(function(_0x2dd1ca,_0x2a5162){return db['VoiceCallReport']['create'](_0x332d25[_0x7410('0x1f')],{'raw':_0x332d25[_0x7410('0x16')]?_0x332d25['options'][_0x7410('0x17')]===undefined?!![]:![]:!![]})[_0x7410('0x1d')](function(_0x55142d){logger[_0x7410('0xa')](_0x7410('0x1e'),_0x332d25);logger['debug']('CreateVoiceCallReport',_0x332d25,JSON['stringify'](_0x55142d));_0x2dd1ca(_0x55142d);})[_0x7410('0x12')](function(_0x2a8633){logger[_0x7410('0x10')](_0x7410('0x1e'),_0x2a8633[_0x7410('0x11')],_0x332d25);_0x2a5162(_0x5a6065[_0x7410('0x10')](0x1f4,_0x2a8633[_0x7410('0x11')]));});});};exports[_0x7410('0x20')]=function(_0x148a54){var _0x4d8d5e=this;return new Promise(function(_0x55ed3a,_0x12b09c){return db['VoiceCallReport']['update'](_0x148a54[_0x7410('0x1f')],{'raw':_0x148a54[_0x7410('0x16')]?_0x148a54[_0x7410('0x16')][_0x7410('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x148a54[_0x7410('0x16')]?_0x148a54[_0x7410('0x16')][_0x7410('0x21')]||null:null,'attributes':_0x148a54[_0x7410('0x16')]?_0x148a54[_0x7410('0x16')]['attributes']||null:null,'limit':_0x148a54[_0x7410('0x16')]?_0x148a54[_0x7410('0x16')]['limit']||null:null})['then'](function(_0x5687ea){logger[_0x7410('0xa')](_0x7410('0x20'),_0x148a54);logger['debug']('UpdateVoiceCallReport',_0x148a54,JSON[_0x7410('0xf')](_0x5687ea));_0x55ed3a(_0x5687ea);})[_0x7410('0x12')](function(_0x4a9e25){logger[_0x7410('0x10')](_0x7410('0x20'),_0x4a9e25[_0x7410('0x11')],_0x148a54);_0x12b09c(_0x4d8d5e[_0x7410('0x10')](0x1f4,_0x4a9e25[_0x7410('0x11')]));});});}; \ No newline at end of file +var _0x23c8=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','body','then','update','UpdateVoiceCallReport','lodash','moment','ioredis','../../mysqldb'];(function(_0x4f501c,_0x1acbd2){var _0x4f5955=function(_0x3ebb97){while(--_0x3ebb97){_0x4f501c['push'](_0x4f501c['shift']());}};_0x4f5955(++_0x1acbd2);}(_0x23c8,0x1d0));var _0x823c=function(_0x49222e,_0x79398c){_0x49222e=_0x49222e-0x0;var _0x4bda50=_0x23c8[_0x49222e];return _0x4bda50;};'use strict';var _=require(_0x823c('0x0'));var util=require('util');var moment=require(_0x823c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x823c('0x2'));var db=require(_0x823c('0x3'))['db'];var utils=require(_0x823c('0x4'));var logger=require(_0x823c('0x5'))(_0x823c('0x6'));var config=require('../../config/environment');var jayson=require(_0x823c('0x7'));var client=jayson[_0x823c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cbfb0,_0x51feb0,_0x643d89){return new BPromise(function(_0x11f245,_0x2bbfa0){return client[_0x823c('0x9')](_0x1cbfb0,_0x643d89)['then'](function(_0x1e8a79){logger[_0x823c('0xa')](_0x823c('0xb'),_0x51feb0,_0x823c('0xc'));logger[_0x823c('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x51feb0,_0x823c('0xc'),JSON[_0x823c('0xe')](_0x1e8a79));if(_0x1e8a79[_0x823c('0xf')]){if(_0x1e8a79[_0x823c('0xf')][_0x823c('0x10')]===0x1f4){logger[_0x823c('0xf')](_0x823c('0xb'),_0x51feb0,_0x1e8a79[_0x823c('0xf')][_0x823c('0x11')]);return _0x2bbfa0(_0x1e8a79['error']['message']);}logger[_0x823c('0xf')](_0x823c('0xb'),_0x51feb0,_0x1e8a79[_0x823c('0xf')][_0x823c('0x11')]);return _0x11f245(_0x1e8a79[_0x823c('0xf')]['message']);}else{logger[_0x823c('0xa')](_0x823c('0xb'),_0x51feb0,'request\x20sent');_0x11f245(_0x1e8a79[_0x823c('0x12')]['message']);}})[_0x823c('0x13')](function(_0x476488){logger['error'](_0x823c('0xb'),_0x51feb0,_0x476488);_0x2bbfa0(_0x476488);});});}exports['GetVoiceCallReport']=function(_0x17f9d8){var _0x396a05=this;return new Promise(function(_0x2653cd,_0x314843){return db[_0x823c('0x14')][_0x823c('0x15')]({'raw':_0x17f9d8[_0x823c('0x16')]?_0x17f9d8[_0x823c('0x16')][_0x823c('0x17')]===undefined?!![]:![]:!![],'where':_0x17f9d8[_0x823c('0x16')]?_0x17f9d8[_0x823c('0x16')][_0x823c('0x18')]||null:null,'attributes':_0x17f9d8[_0x823c('0x16')]?_0x17f9d8[_0x823c('0x16')][_0x823c('0x19')]||null:null,'limit':_0x17f9d8[_0x823c('0x16')]?_0x17f9d8[_0x823c('0x16')][_0x823c('0x1a')]||null:null,'include':_0x17f9d8[_0x823c('0x16')]?_0x17f9d8[_0x823c('0x16')][_0x823c('0x1b')]?_[_0x823c('0x1c')](_0x17f9d8[_0x823c('0x16')]['include'],function(_0x477afc){return{'model':db[_0x477afc[_0x823c('0x1d')]],'as':_0x477afc['as'],'attributes':_0x477afc[_0x823c('0x19')],'include':_0x477afc[_0x823c('0x1b')]?_['map'](_0x477afc[_0x823c('0x1b')],function(_0x1cee63){return{'model':db[_0x1cee63[_0x823c('0x1d')]],'as':_0x1cee63['as'],'attributes':_0x1cee63[_0x823c('0x19')],'include':_0x1cee63['include']?_[_0x823c('0x1c')](_0x1cee63[_0x823c('0x1b')],function(_0x351aa7){return{'model':db[_0x351aa7[_0x823c('0x1d')]],'as':_0x351aa7['as'],'attributes':_0x351aa7[_0x823c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x322671){logger[_0x823c('0xa')](_0x823c('0x1e'),_0x17f9d8);logger['debug'](_0x823c('0x1e'),_0x17f9d8,JSON[_0x823c('0xe')](_0x322671));_0x2653cd(_0x322671);})[_0x823c('0x13')](function(_0x4e721d){logger[_0x823c('0xf')](_0x823c('0x1e'),_0x4e721d[_0x823c('0x11')],_0x17f9d8);_0x314843(_0x396a05[_0x823c('0xf')](0x1f4,_0x4e721d[_0x823c('0x11')]));});});};exports[_0x823c('0x1f')]=function(_0xc2751e){var _0x16180a=this;return new Promise(function(_0x111c5b,_0x4e4f41){return db[_0x823c('0x14')]['create'](_0xc2751e[_0x823c('0x20')],{'raw':_0xc2751e[_0x823c('0x16')]?_0xc2751e[_0x823c('0x16')][_0x823c('0x17')]===undefined?!![]:![]:!![]})[_0x823c('0x21')](function(_0x38cdd){logger[_0x823c('0xa')](_0x823c('0x1f'),_0xc2751e);logger['debug']('CreateVoiceCallReport',_0xc2751e,JSON['stringify'](_0x38cdd));_0x111c5b(_0x38cdd);})['catch'](function(_0x3c92fb){logger[_0x823c('0xf')](_0x823c('0x1f'),_0x3c92fb[_0x823c('0x11')],_0xc2751e);_0x4e4f41(_0x16180a[_0x823c('0xf')](0x1f4,_0x3c92fb[_0x823c('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x509bb3){var _0x491757=this;return new Promise(function(_0x4db425,_0x7bc825){return db[_0x823c('0x14')][_0x823c('0x22')](_0x509bb3[_0x823c('0x20')],{'raw':_0x509bb3['options']?_0x509bb3[_0x823c('0x16')][_0x823c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x509bb3['options']?_0x509bb3[_0x823c('0x16')][_0x823c('0x18')]||null:null,'attributes':_0x509bb3[_0x823c('0x16')]?_0x509bb3['options']['attributes']||null:null,'limit':_0x509bb3[_0x823c('0x16')]?_0x509bb3['options'][_0x823c('0x1a')]||null:null})[_0x823c('0x21')](function(_0x554622){logger[_0x823c('0xa')](_0x823c('0x23'),_0x509bb3);logger['debug']('UpdateVoiceCallReport',_0x509bb3,JSON[_0x823c('0xe')](_0x554622));_0x4db425(_0x554622);})[_0x823c('0x13')](function(_0x2d6fbe){logger[_0x823c('0xf')](_0x823c('0x23'),_0x2d6fbe['message'],_0x509bb3);_0x7bc825(_0x491757[_0x823c('0xf')](0x1f4,_0x2d6fbe[_0x823c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 0cf2f98..327d7b8 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 _0xbeb8=['../../components/interaction/service','./voiceChanSpy.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xb13e3e,_0x4c8c85){var _0x2a585d=function(_0x4ba650){while(--_0x4ba650){_0xb13e3e['push'](_0xb13e3e['shift']());}};_0x2a585d(++_0x4c8c85);}(_0xbeb8,0x124));var _0x8beb=function(_0x3726e3,_0x49f0d6){_0x3726e3=_0x3726e3-0x0;var _0x1d8892=_0xbeb8[_0x3726e3];return _0x1d8892;};'use strict';var multer=require(_0x8beb('0x0'));var util=require(_0x8beb('0x1'));var path=require(_0x8beb('0x2'));var timeout=require(_0x8beb('0x3'));var express=require(_0x8beb('0x4'));var router=express[_0x8beb('0x5')]();var fs_extra=require(_0x8beb('0x6'));var auth=require(_0x8beb('0x7'));var interaction=require(_0x8beb('0x8'));var config=require('../../config/environment');var controller=require(_0x8beb('0x9'));router[_0x8beb('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8beb('0xb'),auth[_0x8beb('0xc')](),controller['show']);router[_0x8beb('0xd')]('/',auth[_0x8beb('0xc')](),controller[_0x8beb('0xe')]);router[_0x8beb('0xf')](_0x8beb('0xb'),auth[_0x8beb('0xc')](),controller[_0x8beb('0x10')]);router[_0x8beb('0x11')](_0x8beb('0xb'),auth[_0x8beb('0xc')](),controller[_0x8beb('0x12')]);module[_0x8beb('0x13')]=router; \ No newline at end of file +var _0xf88f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x114760,_0x1afbdc){var _0x397afd=function(_0x5c4fe1){while(--_0x5c4fe1){_0x114760['push'](_0x114760['shift']());}};_0x397afd(++_0x1afbdc);}(_0xf88f,0xb4));var _0xff88=function(_0x36c7d8,_0x8a5a9e){_0x36c7d8=_0x36c7d8-0x0;var _0x43040a=_0xf88f[_0x36c7d8];return _0x43040a;};'use strict';var multer=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var path=require(_0xff88('0x2'));var timeout=require('connect-timeout');var express=require(_0xff88('0x3'));var router=express[_0xff88('0x4')]();var fs_extra=require(_0xff88('0x5'));var auth=require(_0xff88('0x6'));var interaction=require(_0xff88('0x7'));var config=require(_0xff88('0x8'));var controller=require('./voiceChanSpy.controller');router[_0xff88('0x9')]('/',auth[_0xff88('0xa')](),controller[_0xff88('0xb')]);router['get']('/:id',auth[_0xff88('0xa')](),controller['show']);router[_0xff88('0xc')]('/',auth[_0xff88('0xa')](),controller[_0xff88('0xd')]);router['put'](_0xff88('0xe'),auth[_0xff88('0xa')](),controller['update']);router['delete'](_0xff88('0xe'),auth[_0xff88('0xa')](),controller[_0xff88('0xf')]);module[_0xff88('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 54439eb..1b8218f 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 _0x855e=['join','getDataValue','split','BOOLEAN','STRING','name','options'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x855e,0x193));var _0xe855=function(_0x4cdaa3,_0x3227fa){_0x4cdaa3=_0x4cdaa3-0x0;var _0x288cbb=_0x855e[_0x4cdaa3];return _0x288cbb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe855('0x0')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xe855('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xe855('0x0')],'set':function(_0x34c61f){this['setDataValue'](_0xe855('0x2'),_0x34c61f?_0x34c61f[_0xe855('0x3')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0xe855('0x4')](_0xe855('0x2'))[_0xe855('0x5')](''):[];}},'auth':{'type':Sequelize[_0xe855('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xe855('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe855('0x0')]},'description':{'type':Sequelize[_0xe855('0x0')]}}; \ No newline at end of file +var _0xa4b2=['setDataValue','options','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa4b2,0xed));var _0x2a4b=function(_0x4328a1,_0x33006a){_0x4328a1=_0x4328a1-0x0;var _0x8d1590=_0xa4b2[_0x4328a1];return _0x8d1590;};'use strict';var Sequelize=require('sequelize');module[_0x2a4b('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x2a4b('0x1')],'unique':_0x2a4b('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x2a4b('0x1')],'set':function(_0x29df8d){this[_0x2a4b('0x3')](_0x2a4b('0x4'),_0x29df8d?_0x29df8d['join'](''):[]);},'get':function(){return this[_0x2a4b('0x5')](_0x2a4b('0x4'))?this[_0x2a4b('0x5')]('options')[_0x2a4b('0x6')](''):[];}},'auth':{'type':Sequelize[_0x2a4b('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x2a4b('0x1')]},'record':{'type':Sequelize[_0x2a4b('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2a4b('0x1')]},'description':{'type':Sequelize[_0x2a4b('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8e1645a..852430a 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 _0x342e=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','ChanSpies','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','VoiceChanSpy','catch','show','params','include','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0x342e,0xde));var _0xe342=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0x342e[_0x200aa5];return _0x458200;};'use strict';var emlformat=require(_0xe342('0x0'));var rimraf=require(_0xe342('0x1'));var zipdir=require(_0xe342('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe342('0x3'));var BPromise=require(_0xe342('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe342('0x5'));var sox=require(_0xe342('0x6'));var csv=require(_0xe342('0x7'));var ejs=require(_0xe342('0x8'));var fs=require('fs');var fs_extra=require(_0xe342('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe342('0xa'));var jsforce=require(_0xe342('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe342('0xc'));var Papa=require(_0xe342('0xd'));var Redis=require(_0xe342('0xe'));var authService=require(_0xe342('0xf'));var qs=require(_0xe342('0x10'));var as=require(_0xe342('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe342('0x12'))(_0xe342('0x13'));var utils=require(_0xe342('0x14'));var config=require(_0xe342('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe342('0x16'))['db'];function respondWithStatusCode(_0x50c16e,_0x2fff81){_0x2fff81=_0x2fff81||0xcc;return function(_0x419815){if(_0x419815){return _0x50c16e[_0xe342('0x17')](_0x2fff81);}return _0x50c16e[_0xe342('0x18')](_0x2fff81)['end']();};}function respondWithResult(_0x428c0b,_0x404989){_0x404989=_0x404989||0xc8;return function(_0x59434c){if(_0x59434c){return _0x428c0b[_0xe342('0x18')](_0x404989)[_0xe342('0x19')](_0x59434c);}};}function respondWithFilteredResult(_0xe384cd,_0x8a23f0){return function(_0xe8b832){if(_0xe8b832){var _0x219f51=typeof _0x8a23f0[_0xe342('0x1a')]===_0xe342('0x1b')&&typeof _0x8a23f0[_0xe342('0x1c')]===_0xe342('0x1b');var _0x144b24=_0xe8b832['count'];var _0xf70e61=_0x219f51?0x0:_0x8a23f0['offset'];var _0x5df492=_0x219f51?_0xe8b832[_0xe342('0x1d')]:_0x8a23f0[_0xe342('0x1a')]+_0x8a23f0[_0xe342('0x1c')];var _0x273865;if(_0x5df492>=_0x144b24){_0x5df492=_0x144b24;_0x273865=0xc8;}else{_0x273865=0xce;}_0xe384cd[_0xe342('0x18')](_0x273865);return _0xe384cd[_0xe342('0x1e')](_0xe342('0x1f'),_0xf70e61+'-'+_0x5df492+'/'+_0x144b24)[_0xe342('0x19')](_0xe8b832);}return null;};}function patchUpdates(_0x420036){return function(_0x5731e8){try{jsonpatch[_0xe342('0x20')](_0x5731e8,_0x420036,!![]);}catch(_0x45d096){return BPromise['reject'](_0x45d096);}return _0x5731e8[_0xe342('0x21')]();};}function saveUpdates(_0x56cd1e,_0x2fe50d){return function(_0x26d2a2){if(_0x26d2a2){return _0x26d2a2[_0xe342('0x22')](_0x56cd1e)[_0xe342('0x23')](function(_0x4e3950){return _0x4e3950;});}return null;};}function removeEntity(_0x2e70f5,_0x415aaf){return function(_0x212a7e){if(_0x212a7e){return _0x212a7e['destroy']()['then'](function(){var _0x16dff3=_0x212a7e[_0xe342('0x24')]({'plain':!![]});var _0x5e6e3f=_0xe342('0x25');return db[_0xe342('0x26')][_0xe342('0x27')]({'where':{'type':_0x5e6e3f,'resourceId':_0x16dff3['id']}})[_0xe342('0x23')](function(){return _0x212a7e;});})[_0xe342('0x23')](function(){_0x2e70f5[_0xe342('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e28a,_0x5a63f9){return function(_0x2625a7){if(!_0x2625a7){_0x36e28a[_0xe342('0x17')](0x194);}return _0x2625a7;};}function handleError(_0x59ddce,_0x509192){_0x509192=_0x509192||0x1f4;return function(_0x1c7c97){logger[_0xe342('0x28')](_0x1c7c97[_0xe342('0x29')]);if(_0x1c7c97[_0xe342('0x2a')]){delete _0x1c7c97[_0xe342('0x2a')];}_0x59ddce[_0xe342('0x18')](_0x509192)[_0xe342('0x2b')](_0x1c7c97);};}exports[_0xe342('0x2c')]=function(_0x1cb746,_0x334f7d){var _0x539d3d={},_0x368e45={},_0x2313be={'count':0x0,'rows':[]};var _0xc1b5d0=_['map'](db['VoiceChanSpy'][_0xe342('0x2d')],function(_0x4aa534){return{'name':_0x4aa534[_0xe342('0x2e')],'type':_0x4aa534[_0xe342('0x2f')][_0xe342('0x30')]};});_0x368e45[_0xe342('0x31')]=_[_0xe342('0x32')](_0xc1b5d0,_0xe342('0x2a'));_0x368e45[_0xe342('0x33')]=_[_0xe342('0x34')](_0x1cb746[_0xe342('0x33')]);_0x368e45[_0xe342('0x35')]=_[_0xe342('0x36')](_0x368e45[_0xe342('0x31')],_0x368e45['query']);_0x539d3d[_0xe342('0x37')]=_[_0xe342('0x36')](_0x368e45[_0xe342('0x31')],qs['fields'](_0x1cb746['query'][_0xe342('0x38')]));_0x539d3d[_0xe342('0x37')]=_0x539d3d['attributes'][_0xe342('0x39')]?_0x539d3d[_0xe342('0x37')]:_0x368e45[_0xe342('0x31')];if(!_0x1cb746[_0xe342('0x33')][_0xe342('0x3a')](_0xe342('0x3b'))){_0x539d3d['limit']=qs[_0xe342('0x1c')](_0x1cb746[_0xe342('0x33')]['limit']);_0x539d3d[_0xe342('0x1a')]=qs['offset'](_0x1cb746[_0xe342('0x33')][_0xe342('0x1a')]);}_0x539d3d[_0xe342('0x3c')]=qs[_0xe342('0x3d')](_0x1cb746[_0xe342('0x33')][_0xe342('0x3d')]);_0x539d3d[_0xe342('0x3e')]=qs['filters'](_[_0xe342('0x3f')](_0x1cb746[_0xe342('0x33')],_0x368e45[_0xe342('0x35')]),_0xc1b5d0);if(_0x1cb746[_0xe342('0x33')][_0xe342('0x40')]){_0x539d3d['where']=_['merge'](_0x539d3d[_0xe342('0x3e')],{'$or':_[_0xe342('0x32')](_0xc1b5d0,function(_0x4331bd){if(_0x4331bd['type']!==_0xe342('0x41')){var _0x41efbb={};_0x41efbb[_0x4331bd['name']]={'$like':'%'+_0x1cb746['query'][_0xe342('0x40')]+'%'};return _0x41efbb;}})});}_0x539d3d=_[_0xe342('0x42')]({},_0x539d3d,_0x1cb746['options']);var _0x1c454f={'where':_0x539d3d[_0xe342('0x3e')]};return db['VoiceChanSpy'][_0xe342('0x1d')](_0x1c454f)[_0xe342('0x23')](function(_0x36f66e){_0x2313be[_0xe342('0x1d')]=_0x36f66e;if(_0x1cb746[_0xe342('0x33')]['includeAll']){_0x539d3d['include']=[{'all':!![]}];}return db[_0xe342('0x43')]['findAll'](_0x539d3d);})['then'](function(_0x174855){_0x2313be['rows']=_0x174855;return _0x2313be;})['then'](respondWithFilteredResult(_0x334f7d,_0x539d3d))[_0xe342('0x44')](handleError(_0x334f7d,null));};exports[_0xe342('0x45')]=function(_0x1f4373,_0x59c8d2){var _0x183b98={'raw':![],'where':{'id':_0x1f4373[_0xe342('0x46')]['id']}},_0x540f6c={};_0x540f6c['model']=_[_0xe342('0x34')](db['VoiceChanSpy'][_0xe342('0x2d')]);_0x540f6c[_0xe342('0x33')]=_[_0xe342('0x34')](_0x1f4373[_0xe342('0x33')]);_0x540f6c[_0xe342('0x35')]=_[_0xe342('0x36')](_0x540f6c['model'],_0x540f6c[_0xe342('0x33')]);_0x183b98['attributes']=_['intersection'](_0x540f6c[_0xe342('0x31')],qs['fields'](_0x1f4373[_0xe342('0x33')][_0xe342('0x38')]));_0x183b98[_0xe342('0x37')]=_0x183b98[_0xe342('0x37')][_0xe342('0x39')]?_0x183b98['attributes']:_0x540f6c['model'];if(_0x1f4373[_0xe342('0x33')]['includeAll']){_0x183b98[_0xe342('0x47')]=[{'all':!![]}];}_0x183b98=_['merge']({},_0x183b98,_0x1f4373['options']);return db[_0xe342('0x43')][_0xe342('0x48')](_0x183b98)[_0xe342('0x23')](handleEntityNotFound(_0x59c8d2,null))[_0xe342('0x23')](respondWithResult(_0x59c8d2,null))['catch'](handleError(_0x59c8d2,null));};exports['create']=function(_0x48fc25,_0x535f50){return db[_0xe342('0x43')]['create'](_0x48fc25[_0xe342('0x49')],{})[_0xe342('0x23')](function(_0x962aa1){var _0x3ce025=_0x48fc25[_0xe342('0x4a')][_0xe342('0x24')]({'plain':!![]});if(!_0x3ce025)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ce025[_0xe342('0x4b')]==='user'){var _0x304dbf=_0x962aa1[_0xe342('0x24')]({'plain':!![]});var _0x216cc3=_0xe342('0x25');return db[_0xe342('0x4c')]['find']({'where':{'name':_0x216cc3,'userProfileId':_0x3ce025[_0xe342('0x4d')]},'raw':!![]})[_0xe342('0x23')](function(_0x34a3e2){if(_0x34a3e2&&_0x34a3e2[_0xe342('0x4e')]===0x0){return db[_0xe342('0x26')][_0xe342('0x4f')]({'name':_0x304dbf['name'],'resourceId':_0x304dbf['id'],'type':_0x34a3e2['name'],'sectionId':_0x34a3e2['id']},{})[_0xe342('0x23')](function(){return _0x962aa1;});}else{return _0x962aa1;}})[_0xe342('0x44')](function(_0x139855){logger[_0xe342('0x28')](_0xe342('0x50'),_0x139855);throw _0x139855;});}return _0x962aa1;})['then'](respondWithResult(_0x535f50,0xc9))[_0xe342('0x44')](handleError(_0x535f50,null));};exports[_0xe342('0x22')]=function(_0x35ae19,_0x505574){if(_0x35ae19[_0xe342('0x49')]['id']){delete _0x35ae19[_0xe342('0x49')]['id'];}return db[_0xe342('0x43')]['find']({'where':{'id':_0x35ae19[_0xe342('0x46')]['id']}})['then'](handleEntityNotFound(_0x505574,null))['then'](saveUpdates(_0x35ae19[_0xe342('0x49')],null))['then'](respondWithResult(_0x505574,null))[_0xe342('0x44')](handleError(_0x505574,null));};exports['destroy']=function(_0xd00c46,_0x35c6bd){return db[_0xe342('0x43')][_0xe342('0x48')]({'where':{'id':_0xd00c46['params']['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x35c6bd,null))[_0xe342('0x23')](removeEntity(_0x35c6bd,null))['catch'](handleError(_0x35c6bd,null));}; \ No newline at end of file +var _0x851e=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','get','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x851e,0x1e8));var _0xe851=function(_0x21a848,_0x5ce41a){_0x21a848=_0x21a848-0x0;var _0x5aaf99=_0x851e[_0x21a848];return _0x5aaf99;};'use strict';var emlformat=require(_0xe851('0x0'));var rimraf=require(_0xe851('0x1'));var zipdir=require(_0xe851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe851('0x3'));var BPromise=require(_0xe851('0x4'));var Mustache=require(_0xe851('0x5'));var util=require(_0xe851('0x6'));var path=require(_0xe851('0x7'));var sox=require('sox');var csv=require(_0xe851('0x8'));var ejs=require(_0xe851('0x9'));var fs=require('fs');var fs_extra=require(_0xe851('0xa'));var _=require(_0xe851('0xb'));var squel=require(_0xe851('0xc'));var crypto=require('crypto');var jsforce=require(_0xe851('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe851('0xe'));var Papa=require(_0xe851('0xf'));var Redis=require(_0xe851('0x10'));var authService=require(_0xe851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe851('0x12'));var hardwareService=require(_0xe851('0x13'));var logger=require(_0xe851('0x14'))('api');var utils=require(_0xe851('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe851('0x16'));var db=require(_0xe851('0x17'))['db'];function respondWithStatusCode(_0x5bb014,_0x2b76af){_0x2b76af=_0x2b76af||0xcc;return function(_0x4fff7e){if(_0x4fff7e){return _0x5bb014[_0xe851('0x18')](_0x2b76af);}return _0x5bb014['status'](_0x2b76af)[_0xe851('0x19')]();};}function respondWithResult(_0x32b54e,_0x5960f2){_0x5960f2=_0x5960f2||0xc8;return function(_0x391632){if(_0x391632){return _0x32b54e[_0xe851('0x1a')](_0x5960f2)[_0xe851('0x1b')](_0x391632);}};}function respondWithFilteredResult(_0x4e5195,_0x4d902d){return function(_0x11ba80){if(_0x11ba80){var _0x2f073c=typeof _0x4d902d[_0xe851('0x1c')]===_0xe851('0x1d')&&typeof _0x4d902d[_0xe851('0x1e')]===_0xe851('0x1d');var _0x53c7e0=_0x11ba80[_0xe851('0x1f')];var _0x48a1b3=_0x2f073c?0x0:_0x4d902d[_0xe851('0x1c')];var _0x55dd83=_0x2f073c?_0x11ba80[_0xe851('0x1f')]:_0x4d902d['offset']+_0x4d902d[_0xe851('0x1e')];var _0x2d8015;if(_0x55dd83>=_0x53c7e0){_0x55dd83=_0x53c7e0;_0x2d8015=0xc8;}else{_0x2d8015=0xce;}_0x4e5195[_0xe851('0x1a')](_0x2d8015);return _0x4e5195[_0xe851('0x20')](_0xe851('0x21'),_0x48a1b3+'-'+_0x55dd83+'/'+_0x53c7e0)[_0xe851('0x1b')](_0x11ba80);}return null;};}function patchUpdates(_0x37ab53){return function(_0x409796){try{jsonpatch['apply'](_0x409796,_0x37ab53,!![]);}catch(_0x238a5c){return BPromise['reject'](_0x238a5c);}return _0x409796[_0xe851('0x22')]();};}function saveUpdates(_0x545b9d,_0x3eb7f9){return function(_0x453392){if(_0x453392){return _0x453392['update'](_0x545b9d)['then'](function(_0x1d5aa2){return _0x1d5aa2;});}return null;};}function removeEntity(_0x44ccb3,_0x3bb018){return function(_0x181b19){if(_0x181b19){return _0x181b19[_0xe851('0x23')]()[_0xe851('0x24')](function(){var _0x4ce93a=_0x181b19[_0xe851('0x25')]({'plain':!![]});var _0x2d508='ChanSpies';return db['UserProfileResource'][_0xe851('0x23')]({'where':{'type':_0x2d508,'resourceId':_0x4ce93a['id']}})['then'](function(){return _0x181b19;});})[_0xe851('0x24')](function(){_0x44ccb3[_0xe851('0x1a')](0xcc)[_0xe851('0x19')]();});}};}function handleEntityNotFound(_0x2ff847,_0x1ad48e){return function(_0x1d4c78){if(!_0x1d4c78){_0x2ff847[_0xe851('0x18')](0x194);}return _0x1d4c78;};}function handleError(_0x4c67ee,_0x45771c){_0x45771c=_0x45771c||0x1f4;return function(_0x25f50a){logger['error'](_0x25f50a['stack']);if(_0x25f50a['name']){delete _0x25f50a[_0xe851('0x26')];}_0x4c67ee[_0xe851('0x1a')](_0x45771c)[_0xe851('0x27')](_0x25f50a);};}exports[_0xe851('0x28')]=function(_0x4ef1e2,_0x4d9d17){var _0x29f8d5={},_0x3d4ee3={},_0x160b7f={'count':0x0,'rows':[]};var _0x7d1569=_[_0xe851('0x29')](db[_0xe851('0x2a')][_0xe851('0x2b')],function(_0x592aa1){return{'name':_0x592aa1['fieldName'],'type':_0x592aa1[_0xe851('0x2c')][_0xe851('0x2d')]};});_0x3d4ee3[_0xe851('0x2e')]=_[_0xe851('0x29')](_0x7d1569,_0xe851('0x26'));_0x3d4ee3[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x4ef1e2[_0xe851('0x2f')]);_0x3d4ee3[_0xe851('0x31')]=_[_0xe851('0x32')](_0x3d4ee3['model'],_0x3d4ee3[_0xe851('0x2f')]);_0x29f8d5[_0xe851('0x33')]=_[_0xe851('0x32')](_0x3d4ee3['model'],qs[_0xe851('0x34')](_0x4ef1e2[_0xe851('0x2f')]['fields']));_0x29f8d5[_0xe851('0x33')]=_0x29f8d5[_0xe851('0x33')][_0xe851('0x35')]?_0x29f8d5['attributes']:_0x3d4ee3[_0xe851('0x2e')];if(!_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x36')](_0xe851('0x37'))){_0x29f8d5['limit']=qs[_0xe851('0x1e')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x1e')]);_0x29f8d5['offset']=qs[_0xe851('0x1c')](_0x4ef1e2['query'][_0xe851('0x1c')]);}_0x29f8d5[_0xe851('0x38')]=qs[_0xe851('0x39')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x39')]);_0x29f8d5[_0xe851('0x3a')]=qs[_0xe851('0x31')](_[_0xe851('0x3b')](_0x4ef1e2[_0xe851('0x2f')],_0x3d4ee3[_0xe851('0x31')]),_0x7d1569);if(_0x4ef1e2['query'][_0xe851('0x3c')]){_0x29f8d5['where']=_[_0xe851('0x3d')](_0x29f8d5[_0xe851('0x3a')],{'$or':_[_0xe851('0x29')](_0x7d1569,function(_0x189a1b){if(_0x189a1b['type']!==_0xe851('0x3e')){var _0x45d9f7={};_0x45d9f7[_0x189a1b[_0xe851('0x26')]]={'$like':'%'+_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x3c')]+'%'};return _0x45d9f7;}})});}_0x29f8d5=_[_0xe851('0x3d')]({},_0x29f8d5,_0x4ef1e2[_0xe851('0x3f')]);var _0x577eec={'where':_0x29f8d5[_0xe851('0x3a')]};return db[_0xe851('0x2a')][_0xe851('0x1f')](_0x577eec)[_0xe851('0x24')](function(_0x4890b9){_0x160b7f['count']=_0x4890b9;if(_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x40')]){_0x29f8d5[_0xe851('0x41')]=[{'all':!![]}];}return db[_0xe851('0x2a')][_0xe851('0x42')](_0x29f8d5);})[_0xe851('0x24')](function(_0x355f76){_0x160b7f[_0xe851('0x43')]=_0x355f76;return _0x160b7f;})['then'](respondWithFilteredResult(_0x4d9d17,_0x29f8d5))['catch'](handleError(_0x4d9d17,null));};exports[_0xe851('0x44')]=function(_0x2d0768,_0x3df1e9){var _0x1fdda8={'raw':![],'where':{'id':_0x2d0768[_0xe851('0x45')]['id']}},_0x487346={};_0x487346[_0xe851('0x2e')]=_[_0xe851('0x30')](db['VoiceChanSpy'][_0xe851('0x2b')]);_0x487346[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x2d0768[_0xe851('0x2f')]);_0x487346[_0xe851('0x31')]=_[_0xe851('0x32')](_0x487346[_0xe851('0x2e')],_0x487346['query']);_0x1fdda8['attributes']=_['intersection'](_0x487346['model'],qs[_0xe851('0x34')](_0x2d0768[_0xe851('0x2f')][_0xe851('0x34')]));_0x1fdda8[_0xe851('0x33')]=_0x1fdda8[_0xe851('0x33')][_0xe851('0x35')]?_0x1fdda8[_0xe851('0x33')]:_0x487346['model'];if(_0x2d0768[_0xe851('0x2f')][_0xe851('0x40')]){_0x1fdda8[_0xe851('0x41')]=[{'all':!![]}];}_0x1fdda8=_['merge']({},_0x1fdda8,_0x2d0768[_0xe851('0x3f')]);return db[_0xe851('0x2a')][_0xe851('0x46')](_0x1fdda8)[_0xe851('0x24')](handleEntityNotFound(_0x3df1e9,null))[_0xe851('0x24')](respondWithResult(_0x3df1e9,null))[_0xe851('0x47')](handleError(_0x3df1e9,null));};exports[_0xe851('0x48')]=function(_0x4662da,_0x1fb5ed){return db[_0xe851('0x2a')][_0xe851('0x48')](_0x4662da[_0xe851('0x49')],{})['then'](function(_0x328646){var _0x54782d=_0x4662da[_0xe851('0x4a')][_0xe851('0x25')]({'plain':!![]});if(!_0x54782d)throw new Error(_0xe851('0x4b'));if(_0x54782d[_0xe851('0x4c')]===_0xe851('0x4a')){var _0x5458f6=_0x328646[_0xe851('0x25')]({'plain':!![]});var _0x3c7f7c='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x3c7f7c,'userProfileId':_0x54782d[_0xe851('0x4d')]},'raw':!![]})[_0xe851('0x24')](function(_0x42e954){if(_0x42e954&&_0x42e954[_0xe851('0x4e')]===0x0){return db[_0xe851('0x4f')][_0xe851('0x48')]({'name':_0x5458f6[_0xe851('0x26')],'resourceId':_0x5458f6['id'],'type':_0x42e954[_0xe851('0x26')],'sectionId':_0x42e954['id']},{})[_0xe851('0x24')](function(){return _0x328646;});}else{return _0x328646;}})[_0xe851('0x47')](function(_0xc32db4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc32db4);throw _0xc32db4;});}return _0x328646;})[_0xe851('0x24')](respondWithResult(_0x1fb5ed,0xc9))[_0xe851('0x47')](handleError(_0x1fb5ed,null));};exports['update']=function(_0x341ae9,_0x52eccd){if(_0x341ae9[_0xe851('0x49')]['id']){delete _0x341ae9[_0xe851('0x49')]['id'];}return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x341ae9[_0xe851('0x45')]['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x52eccd,null))[_0xe851('0x24')](saveUpdates(_0x341ae9[_0xe851('0x49')],null))[_0xe851('0x24')](respondWithResult(_0x52eccd,null))[_0xe851('0x47')](handleError(_0x52eccd,null));};exports[_0xe851('0x23')]=function(_0x1ff342,_0x482b6d){return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x1ff342['params']['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x482b6d,null))[_0xe851('0x24')](removeEntity(_0x482b6d,null))[_0xe851('0x47')](handleError(_0x482b6d,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a27f43e..a211cc0 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 _0x5625=['Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','agent','then','catch','exports','models','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','merge'];(function(_0x12e3f4,_0x4a3923){var _0x50d9b4=function(_0x2f0972){while(--_0x2f0972){_0x12e3f4['push'](_0x12e3f4['shift']());}};_0x50d9b4(++_0x4a3923);}(_0x5625,0x1d6));var _0x5562=function(_0x33944b,_0x1ab55f){_0x33944b=_0x33944b-0x0;var _0x3d5505=_0x5625[_0x33944b];return _0x3d5505;};'use strict';var _=require(_0x5562('0x0'));var util=require(_0x5562('0x1'));var BPromise=require(_0x5562('0x2'));var attributes=require(_0x5562('0x3'));var getUserApplications=function(_0x5166b7,_0x4598e8,_0x37483e){var _0x58500b=0x1;var _0x2139d5=[];var _0x21b087={'context':_0x4598e8['context']||_0x5562('0x4'),'exten':util[_0x5562('0x5')](_0x5562('0x6'),_0x5166b7[_0x5562('0x7')],_0x37483e),'type':_0x5562('0x8'),'isApp':![],'ChanSpyId':_0x5166b7['id'],'UserId':_0x4598e8['id']};_0x2139d5[_0x5562('0x9')](_[_0x5562('0xa')]({'app':_0x5562('0xb'),'appdata':util[_0x5562('0x5')](_0x5562('0xc'),_0x5562('0xd')),'priority':_0x58500b++},_0x21b087));if(_0x5166b7[_0x5562('0xe')]){_0x2139d5[_0x5562('0x9')](_[_0x5562('0xa')]({'app':'MixMonitor','appdata':util[_0x5562('0x5')](_0x5562('0xf'),_0x5166b7[_0x5562('0x10')]),'priority':_0x58500b++},_0x21b087));}if(_0x5166b7[_0x5562('0x11')]){_0x2139d5[_0x5562('0x9')](_[_0x5562('0xa')]({'app':_0x5562('0x12'),'appdata':_0x5166b7[_0x5562('0x13')],'priority':_0x58500b++},_0x21b087));}_0x2139d5[_0x5562('0x9')](_['merge']({'app':'ChanSpy','appdata':util[_0x5562('0x5')](_0x5562('0x14'),_0x4598e8[_0x5562('0x15')],_0x5166b7[_0x5562('0x16')]?_0x5166b7[_0x5562('0x16')][_0x5562('0x17')](''):''),'priority':_0x58500b++},_0x21b087));if(_0x5166b7[_0x5562('0xe')]){_0x2139d5['push'](_[_0x5562('0xa')]({'app':_0x5562('0x18'),'priority':_0x58500b++},_0x21b087));}return _0x2139d5;};var getChanSpyApplications=function(_0x319861,_0x1fe435){var _0x2f0ed7=[];for(var _0x3b1947=0x0,_0x41b9cd=0x1;_0x3b1947<_0x1fe435['length'];_0x3b1947++,_0x41b9cd=0x1){_0x2f0ed7=_0x2f0ed7[_0x5562('0x19')](getUserApplications(_0x319861,_0x1fe435[_0x3b1947],_0x1fe435[_0x3b1947][_0x5562('0x1a')]));if(_0x1fe435[_0x3b1947]['internal']!=_0x1fe435[_0x3b1947][_0x5562('0x15')]){_0x2f0ed7=_0x2f0ed7[_0x5562('0x19')](getUserApplications(_0x319861,_0x1fe435[_0x3b1947],_0x1fe435[_0x3b1947][_0x5562('0x15')]));}}return _0x2f0ed7;};var getChanSpyPromise=function(_0x5dd714,_0x12dce7){return new BPromise(function(_0x702d39,_0x5ac0d3){return _0x5dd714[_0x5562('0x1b')]['findAll']({'attributes':['id',_0x5562('0x15'),'internal'],'where':{'role':_0x5562('0x1c'),'chanspy':!![]},'raw':!![]})[_0x5562('0x1d')](function(_0x1c0a29){if(_0x1c0a29){return _0x702d39(getChanSpyApplications(_0x12dce7,_0x1c0a29));}return _0x702d39([]);})[_0x5562('0x1e')](function(_0x30dcb2){_0x5ac0d3(_0x30dcb2);});});};module[_0x5562('0x1f')]=function(_0x308534,_0x51f15e){var _0x1d1342=_0x308534[_0x5562('0x20')];return _0x308534['define'](_0x5562('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5527cd,_0x4fc1f4,_0x471cec){return getChanSpyPromise(_0x1d1342,_0x5527cd)[_0x5562('0x1d')](function(_0xa2581){if(_0xa2581&&_0xa2581['length']){return _0x1d1342[_0x5562('0x22')][_0x5562('0x23')](_0xa2581);}})[_0x5562('0x1d')](function(){_0x471cec();})[_0x5562('0x1e')](function(_0xd04c95){_0x471cec(_0xd04c95);});},'afterUpdate':function(_0x4d72e1,_0x3b8796,_0x16e2e3){return _0x1d1342[_0x5562('0x22')][_0x5562('0x24')]({'where':{'ChanSpyId':_0x4d72e1['id']}})['then'](function(){return getChanSpyPromise(_0x1d1342,_0x4d72e1);})[_0x5562('0x1d')](function(_0x1b3116){if(_0x1b3116&&_0x1b3116['length']){return _0x1d1342[_0x5562('0x22')][_0x5562('0x23')](_0x1b3116);}})[_0x5562('0x1d')](function(){_0x16e2e3();})[_0x5562('0x1e')](function(_0x962030){_0x16e2e3(_0x962030);});},'afterDestroy':function(_0xe601d1,_0x2ac8a3,_0x273f98){return _0x1d1342[_0x5562('0x22')][_0x5562('0x24')]({'where':{'ChanSpyId':_0xe601d1['id']}})[_0x5562('0x1d')](function(){_0x273f98();})[_0x5562('0x1e')](function(_0x484a0f){_0x273f98(_0x484a0f);});}}});}; \ No newline at end of file +var _0x42b4=['options','record','length','internal','concat','User','findAll','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name'];(function(_0x10df87,_0x4e3dcb){var _0x22923d=function(_0x439738){while(--_0x439738){_0x10df87['push'](_0x10df87['shift']());}};_0x22923d(++_0x4e3dcb);}(_0x42b4,0x130));var _0x442b=function(_0x49afa7,_0x11f055){_0x49afa7=_0x49afa7-0x0;var _0x5c533e=_0x42b4[_0x49afa7];return _0x5c533e;};'use strict';var _=require(_0x442b('0x0'));var util=require('util');var BPromise=require(_0x442b('0x1'));var attributes=require(_0x442b('0x2'));var getUserApplications=function(_0x34b65d,_0x4aac56,_0x3225df){var _0x259001=0x1;var _0xc197d5=[];var _0x2ef252={'context':_0x4aac56[_0x442b('0x3')]||_0x442b('0x4'),'exten':util[_0x442b('0x5')]('%s%s',_0x34b65d[_0x442b('0x6')],_0x3225df),'type':_0x442b('0x7'),'isApp':![],'ChanSpyId':_0x34b65d['id'],'UserId':_0x4aac56['id']};_0xc197d5[_0x442b('0x8')](_[_0x442b('0x9')]({'app':_0x442b('0xa'),'appdata':util[_0x442b('0x5')](_0x442b('0xb'),_0x442b('0xc')),'priority':_0x259001++},_0x2ef252));if(_0x34b65d['record']){_0xc197d5[_0x442b('0x8')](_[_0x442b('0x9')]({'app':'MixMonitor','appdata':util['format'](_0x442b('0xd'),_0x34b65d[_0x442b('0xe')]),'priority':_0x259001++},_0x2ef252));}if(_0x34b65d[_0x442b('0xf')]){_0xc197d5[_0x442b('0x8')](_[_0x442b('0x9')]({'app':'Authenticate','appdata':_0x34b65d[_0x442b('0x10')],'priority':_0x259001++},_0x2ef252));}_0xc197d5[_0x442b('0x8')](_['merge']({'app':_0x442b('0x11'),'appdata':util['format'](_0x442b('0x12'),_0x4aac56[_0x442b('0x13')],_0x34b65d[_0x442b('0x14')]?_0x34b65d[_0x442b('0x14')]['join'](''):''),'priority':_0x259001++},_0x2ef252));if(_0x34b65d[_0x442b('0x15')]){_0xc197d5[_0x442b('0x8')](_[_0x442b('0x9')]({'app':'StopMixMonitor','priority':_0x259001++},_0x2ef252));}return _0xc197d5;};var getChanSpyApplications=function(_0x302a9d,_0x340072){var _0x24f0de=[];for(var _0x4f9f8f=0x0,_0x431b9f=0x1;_0x4f9f8f<_0x340072[_0x442b('0x16')];_0x4f9f8f++,_0x431b9f=0x1){_0x24f0de=_0x24f0de['concat'](getUserApplications(_0x302a9d,_0x340072[_0x4f9f8f],_0x340072[_0x4f9f8f][_0x442b('0x17')]));if(_0x340072[_0x4f9f8f][_0x442b('0x17')]!=_0x340072[_0x4f9f8f][_0x442b('0x13')]){_0x24f0de=_0x24f0de[_0x442b('0x18')](getUserApplications(_0x302a9d,_0x340072[_0x4f9f8f],_0x340072[_0x4f9f8f][_0x442b('0x13')]));}}return _0x24f0de;};var getChanSpyPromise=function(_0x1dc0b1,_0x2358b6){return new BPromise(function(_0x5db36d,_0x3cbc88){return _0x1dc0b1[_0x442b('0x19')][_0x442b('0x1a')]({'attributes':['id',_0x442b('0x13'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x442b('0x1b')](function(_0x16423a){if(_0x16423a){return _0x5db36d(getChanSpyApplications(_0x2358b6,_0x16423a));}return _0x5db36d([]);})[_0x442b('0x1c')](function(_0x1be6bf){_0x3cbc88(_0x1be6bf);});});};module[_0x442b('0x1d')]=function(_0x2f21db,_0x50b6c8){var _0x5bf26e=_0x2f21db[_0x442b('0x1e')];return _0x2f21db[_0x442b('0x1f')](_0x442b('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x445575,_0x1edc0d,_0x3b4fdb){return getChanSpyPromise(_0x5bf26e,_0x445575)[_0x442b('0x1b')](function(_0x361444){if(_0x361444&&_0x361444[_0x442b('0x16')]){return _0x5bf26e[_0x442b('0x21')][_0x442b('0x22')](_0x361444);}})[_0x442b('0x1b')](function(){_0x3b4fdb();})[_0x442b('0x1c')](function(_0xc1d333){_0x3b4fdb(_0xc1d333);});},'afterUpdate':function(_0x12478f,_0x459093,_0x118f91){return _0x5bf26e['VoiceExtension'][_0x442b('0x23')]({'where':{'ChanSpyId':_0x12478f['id']}})[_0x442b('0x1b')](function(){return getChanSpyPromise(_0x5bf26e,_0x12478f);})[_0x442b('0x1b')](function(_0x243939){if(_0x243939&&_0x243939[_0x442b('0x16')]){return _0x5bf26e[_0x442b('0x21')][_0x442b('0x22')](_0x243939);}})[_0x442b('0x1b')](function(){_0x118f91();})[_0x442b('0x1c')](function(_0x2120c1){_0x118f91(_0x2120c1);});},'afterDestroy':function(_0x22a945,_0x4b947d,_0x560a19){return _0x5bf26e[_0x442b('0x21')]['destroy']({'where':{'ChanSpyId':_0x22a945['id']}})[_0x442b('0x1b')](function(){_0x560a19();})['catch'](function(_0x313ecf){_0x560a19(_0x313ecf);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 78879fb..a940ea0 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 _0x131e=['info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceChanSpy,\x20%s,\x20%s','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x44334a,_0x181bce){var _0x20a140=function(_0x7ee785){while(--_0x7ee785){_0x44334a['push'](_0x44334a['shift']());}};_0x20a140(++_0x181bce);}(_0x131e,0x1ec));var _0xe131=function(_0x44eddd,_0x31757e){_0x44eddd=_0x44eddd-0x0;var _0x1ce0dd=_0x131e[_0x44eddd];return _0x1ce0dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe131('0x0'));var rs=require(_0xe131('0x1'));var fs=require('fs');var Redis=require(_0xe131('0x2'));var db=require(_0xe131('0x3'))['db'];var utils=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('rpc');var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')][_0xe131('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1002a6,_0x48a90e,_0x5c4eb5){return new BPromise(function(_0x562617,_0x4bf386){return client[_0xe131('0xa')](_0x1002a6,_0x5c4eb5)[_0xe131('0xb')](function(_0x530ecb){logger[_0xe131('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x48a90e,_0xe131('0xd'));logger[_0xe131('0xe')](_0xe131('0xf'),_0x48a90e,_0xe131('0xd'),JSON[_0xe131('0x10')](_0x530ecb));if(_0x530ecb[_0xe131('0x11')]){if(_0x530ecb[_0xe131('0x11')]['code']===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x48a90e,_0x530ecb['error'][_0xe131('0x12')]);return _0x4bf386(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}logger[_0xe131('0x11')](_0xe131('0x13'),_0x48a90e,_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);return _0x562617(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x48a90e,'request\x20sent');_0x562617(_0x530ecb['result']['message']);}})[_0xe131('0x14')](function(_0x32091b){logger[_0xe131('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x48a90e,_0x32091b);_0x4bf386(_0x32091b);});});} \ No newline at end of file +var _0x5712=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x5712,0x140));var _0x2571=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5712[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var moment=require(_0x2571('0x2'));var BPromise=require(_0x2571('0x3'));var rs=require(_0x2571('0x4'));var fs=require('fs');var Redis=require(_0x2571('0x5'));var db=require(_0x2571('0x6'))['db'];var utils=require(_0x2571('0x7'));var logger=require(_0x2571('0x8'))(_0x2571('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2571('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e19b2,_0x251ee6,_0x3ca885){return new BPromise(function(_0x204ecc,_0xda659a){return client[_0x2571('0xb')](_0x3e19b2,_0x3ca885)['then'](function(_0x1f0c98){logger['info'](_0x2571('0xc'),_0x251ee6,_0x2571('0xd'));logger[_0x2571('0xe')](_0x2571('0xf'),_0x251ee6,_0x2571('0xd'),JSON[_0x2571('0x10')](_0x1f0c98));if(_0x1f0c98[_0x2571('0x11')]){if(_0x1f0c98[_0x2571('0x11')]['code']===0x1f4){logger['error'](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0xda659a(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0x204ecc(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}else{logger[_0x2571('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x251ee6,_0x2571('0xd'));_0x204ecc(_0x1f0c98['result']['message']);}})['catch'](function(_0x4c3e11){logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x4c3e11);_0xda659a(_0x4c3e11);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 9f7eac8..d951111 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 _0x1ab9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','index','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer','path'];(function(_0x4756d5,_0x20560a){var _0xf834a8=function(_0x1ae08c){while(--_0x1ae08c){_0x4756d5['push'](_0x4756d5['shift']());}};_0xf834a8(++_0x20560a);}(_0x1ab9,0xcf));var _0x91ab=function(_0x1aa277,_0x1edd4f){_0x1aa277=_0x1aa277-0x0;var _0x2f21e5=_0x1ab9[_0x1aa277];return _0x2f21e5;};'use strict';var multer=require(_0x91ab('0x0'));var util=require('util');var path=require(_0x91ab('0x1'));var timeout=require(_0x91ab('0x2'));var express=require(_0x91ab('0x3'));var router=express[_0x91ab('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91ab('0x5'));var interaction=require(_0x91ab('0x6'));var config=require('../../config/environment');var controller=require(_0x91ab('0x7'));router[_0x91ab('0x8')]('/',auth['isAuthenticated'](),controller[_0x91ab('0x9')]);router[_0x91ab('0x8')](_0x91ab('0xa'),auth['isAuthenticated'](),controller[_0x91ab('0xb')]);router[_0x91ab('0xc')]('/',auth[_0x91ab('0xd')](),controller[_0x91ab('0xe')]);router['put'](_0x91ab('0xa'),auth['isAuthenticated'](),controller[_0x91ab('0xf')]);router[_0x91ab('0x10')](_0x91ab('0xa'),auth['isAuthenticated'](),controller[_0x91ab('0x11')]);module[_0x91ab('0x12')]=router; \ No newline at end of file +var _0xe323=['fs-extra','../../config/environment','./voiceContext.controller','isAuthenticated','/:id','show','post','put','update','delete','exports','multer','util','express','Router'];(function(_0x557a66,_0x39d140){var _0x3569c4=function(_0x15001b){while(--_0x15001b){_0x557a66['push'](_0x557a66['shift']());}};_0x3569c4(++_0x39d140);}(_0xe323,0x155));var _0x3e32=function(_0xbc249c,_0x15b868){_0xbc249c=_0xbc249c-0x0;var _0x4942ba=_0xe323[_0xbc249c];return _0x4942ba;};'use strict';var multer=require(_0x3e32('0x0'));var util=require(_0x3e32('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3e32('0x2'));var router=express[_0x3e32('0x3')]();var fs_extra=require(_0x3e32('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3e32('0x5'));var controller=require(_0x3e32('0x6'));router['get']('/',auth[_0x3e32('0x7')](),controller['index']);router['get'](_0x3e32('0x8'),auth[_0x3e32('0x7')](),controller[_0x3e32('0x9')]);router[_0x3e32('0xa')]('/',auth[_0x3e32('0x7')](),controller['create']);router[_0x3e32('0xb')](_0x3e32('0x8'),auth[_0x3e32('0x7')](),controller[_0x3e32('0xc')]);router[_0x3e32('0xd')]('/:id',auth[_0x3e32('0x7')](),controller['destroy']);module[_0x3e32('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index a6c0c9d..1fe7a3c 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 _0x33be=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x2c4c2d,_0x51cc89){var _0x2c94da=function(_0xb12ca0){while(--_0xb12ca0){_0x2c4c2d['push'](_0x2c4c2d['shift']());}};_0x2c94da(++_0x51cc89);}(_0x33be,0x18f));var _0xe33b=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x33be[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xe33b('0x0'));module[_0xe33b('0x1')]={'name':{'type':Sequelize[_0xe33b('0x2')],'unique':_0xe33b('0x3')},'description':{'type':Sequelize[_0xe33b('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xe33b('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf367=['BOOLEAN','exports','STRING','name'];(function(_0x404eed,_0x5390c5){var _0xd45887=function(_0x1ee42b){while(--_0x1ee42b){_0x404eed['push'](_0x404eed['shift']());}};_0xd45887(++_0x5390c5);}(_0xf367,0x85));var _0x7f36=function(_0x2e1bf4,_0x3996f7){_0x2e1bf4=_0x2e1bf4-0x0;var _0x41d08a=_0xf367[_0x2e1bf4];return _0x41d08a;};'use strict';var Sequelize=require('sequelize');module[_0x7f36('0x0')]={'name':{'type':Sequelize[_0x7f36('0x1')],'unique':_0x7f36('0x2')},'description':{'type':Sequelize[_0x7f36('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7f36('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 cf2732a..d2f8245 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 _0x725f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','findAll','show','includeAll','options','find','create','readFileSync','join','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','root','server/files/templates/context.ejs','render','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x725f,0x19b));var _0xf725=function(_0x347bbc,_0x419202){_0x347bbc=_0x347bbc-0x0;var _0x346c57=_0x725f[_0x347bbc];return _0x346c57;};'use strict';var emlformat=require(_0xf725('0x0'));var rimraf=require(_0xf725('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf725('0x2'));var rp=require(_0xf725('0x3'));var moment=require(_0xf725('0x4'));var BPromise=require(_0xf725('0x5'));var Mustache=require(_0xf725('0x6'));var util=require('util');var path=require(_0xf725('0x7'));var sox=require(_0xf725('0x8'));var csv=require(_0xf725('0x9'));var ejs=require(_0xf725('0xa'));var fs=require('fs');var fs_extra=require(_0xf725('0xb'));var _=require(_0xf725('0xc'));var squel=require(_0xf725('0xd'));var crypto=require('crypto');var jsforce=require(_0xf725('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf725('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf725('0xf'));var authService=require(_0xf725('0x10'));var qs=require(_0xf725('0x11'));var as=require(_0xf725('0x12'));var hardwareService=require(_0xf725('0x13'));var logger=require(_0xf725('0x14'))(_0xf725('0x15'));var utils=require(_0xf725('0x16'));var config=require(_0xf725('0x17'));var licenseUtil=require(_0xf725('0x18'));var db=require(_0xf725('0x19'))['db'];var jayson=require(_0xf725('0x1a'));var client=jayson[_0xf725('0x1b')][_0xf725('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x195e1a,_0x1804f0,_0x2b9f8c,_0x3914c8){return new BPromise(function(_0x5cb52c,_0x2cbed2){var _0x57cdab=_0x3914c8||client;return _0x57cdab[_0xf725('0x1d')](_0x195e1a,_0x2b9f8c)[_0xf725('0x1e')](function(_0x4acc8a){logger['info'](_0xf725('0x1f'),_0x1804f0,_0xf725('0x20'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1804f0,_0xf725('0x20'),JSON[_0xf725('0x21')](_0x4acc8a));if(_0x4acc8a[_0xf725('0x22')]){if(_0x4acc8a[_0xf725('0x22')][_0xf725('0x23')]===0x1f4){logger[_0xf725('0x22')](_0xf725('0x1f'),_0x1804f0,_0x4acc8a['error'][_0xf725('0x24')]);return _0x2cbed2(_0x4acc8a[_0xf725('0x22')][_0xf725('0x24')]);}logger[_0xf725('0x22')](_0xf725('0x1f'),_0x1804f0,_0x4acc8a[_0xf725('0x22')][_0xf725('0x24')]);return _0x5cb52c(_0x4acc8a['error'][_0xf725('0x24')]);}else{logger[_0xf725('0x25')](_0xf725('0x1f'),_0x1804f0,_0xf725('0x20'));_0x5cb52c(_0x4acc8a[_0xf725('0x26')]['message']);}})[_0xf725('0x27')](function(_0x478ba0){logger[_0xf725('0x22')](_0xf725('0x1f'),_0x1804f0,_0x478ba0);_0x2cbed2(_0x478ba0);});});}function respondWithStatusCode(_0x3083c3,_0x506718){_0x506718=_0x506718||0xcc;return function(_0x19f6ee){if(_0x19f6ee){return _0x3083c3[_0xf725('0x28')](_0x506718);}return _0x3083c3['status'](_0x506718)['end']();};}function respondWithResult(_0x37000d,_0xd2655f){_0xd2655f=_0xd2655f||0xc8;return function(_0x193700){if(_0x193700){return _0x37000d[_0xf725('0x29')](_0xd2655f)[_0xf725('0x2a')](_0x193700);}};}function respondWithFilteredResult(_0x294462,_0x849e5){return function(_0x114285){if(_0x114285){var _0x23c5a1=typeof _0x849e5[_0xf725('0x2b')]===_0xf725('0x2c')&&typeof _0x849e5['limit']==='undefined';var _0x53cc41=_0x114285[_0xf725('0x2d')];var _0x54330d=_0x23c5a1?0x0:_0x849e5[_0xf725('0x2b')];var _0x7e4c7=_0x23c5a1?_0x114285[_0xf725('0x2d')]:_0x849e5['offset']+_0x849e5[_0xf725('0x2e')];var _0x2b4e30;if(_0x7e4c7>=_0x53cc41){_0x7e4c7=_0x53cc41;_0x2b4e30=0xc8;}else{_0x2b4e30=0xce;}_0x294462[_0xf725('0x29')](_0x2b4e30);return _0x294462[_0xf725('0x2f')](_0xf725('0x30'),_0x54330d+'-'+_0x7e4c7+'/'+_0x53cc41)['json'](_0x114285);}return null;};}function patchUpdates(_0x1752fe){return function(_0xee09f2){try{jsonpatch[_0xf725('0x31')](_0xee09f2,_0x1752fe,!![]);}catch(_0x5d7201){return BPromise[_0xf725('0x32')](_0x5d7201);}return _0xee09f2[_0xf725('0x33')]();};}function saveUpdates(_0x140251,_0x4922ff){return function(_0x1a2fae){if(_0x1a2fae){return _0x1a2fae[_0xf725('0x34')](_0x140251)[_0xf725('0x1e')](function(_0x44e0a7){return _0x44e0a7;});}return null;};}function removeEntity(_0x5b1c39,_0x1180a9){return function(_0xdb527){if(_0xdb527){return _0xdb527[_0xf725('0x35')]()[_0xf725('0x1e')](function(){var _0x43f507=_0xdb527[_0xf725('0x36')]({'plain':!![]});var _0x2bd247=_0xf725('0x37');return db[_0xf725('0x38')][_0xf725('0x35')]({'where':{'type':_0x2bd247,'resourceId':_0x43f507['id']}})[_0xf725('0x1e')](function(){return _0xdb527;});})['then'](function(){_0x5b1c39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0c4c,_0x11a1ea){return function(_0x390b61){if(!_0x390b61){_0x4e0c4c[_0xf725('0x28')](0x194);}return _0x390b61;};}function handleError(_0x5d6acf,_0x19c216){_0x19c216=_0x19c216||0x1f4;return function(_0x37675c){logger[_0xf725('0x22')](_0x37675c[_0xf725('0x39')]);if(_0x37675c['name']){delete _0x37675c[_0xf725('0x3a')];}_0x5d6acf['status'](_0x19c216)[_0xf725('0x3b')](_0x37675c);};}exports[_0xf725('0x3c')]=function(_0x3b37ae,_0x6018b5){var _0x1c9245={},_0x46a457={},_0x149171={'count':0x0,'rows':[]};var _0x56fd6d=_[_0xf725('0x3d')](db[_0xf725('0x3e')]['rawAttributes'],function(_0x114eaa){return{'name':_0x114eaa[_0xf725('0x3f')],'type':_0x114eaa[_0xf725('0x40')][_0xf725('0x41')]};});_0x46a457[_0xf725('0x42')]=_[_0xf725('0x3d')](_0x56fd6d,'name');_0x46a457[_0xf725('0x43')]=_[_0xf725('0x44')](_0x3b37ae[_0xf725('0x43')]);_0x46a457[_0xf725('0x45')]=_[_0xf725('0x46')](_0x46a457['model'],_0x46a457[_0xf725('0x43')]);_0x1c9245[_0xf725('0x47')]=_[_0xf725('0x46')](_0x46a457[_0xf725('0x42')],qs[_0xf725('0x48')](_0x3b37ae[_0xf725('0x43')][_0xf725('0x48')]));_0x1c9245[_0xf725('0x47')]=_0x1c9245['attributes'][_0xf725('0x49')]?_0x1c9245[_0xf725('0x47')]:_0x46a457[_0xf725('0x42')];if(!_0x3b37ae['query'][_0xf725('0x4a')](_0xf725('0x4b'))){_0x1c9245['limit']=qs['limit'](_0x3b37ae['query'][_0xf725('0x2e')]);_0x1c9245['offset']=qs[_0xf725('0x2b')](_0x3b37ae['query'][_0xf725('0x2b')]);}_0x1c9245[_0xf725('0x4c')]=qs[_0xf725('0x4d')](_0x3b37ae['query'][_0xf725('0x4d')]);_0x1c9245['where']=qs[_0xf725('0x45')](_['pick'](_0x3b37ae['query'],_0x46a457[_0xf725('0x45')]),_0x56fd6d);if(_0x3b37ae[_0xf725('0x43')]['filter']){_0x1c9245[_0xf725('0x4e')]=_[_0xf725('0x4f')](_0x1c9245[_0xf725('0x4e')],{'$or':_[_0xf725('0x3d')](_0x56fd6d,function(_0xd12db8){if(_0xd12db8[_0xf725('0x40')]!==_0xf725('0x50')){var _0x4620da={};_0x4620da[_0xd12db8[_0xf725('0x3a')]]={'$like':'%'+_0x3b37ae[_0xf725('0x43')][_0xf725('0x51')]+'%'};return _0x4620da;}})});}_0x1c9245=_[_0xf725('0x4f')]({},_0x1c9245,_0x3b37ae['options']);var _0x5061c7={'where':_0x1c9245['where']};return db['VoiceContext'][_0xf725('0x2d')](_0x5061c7)[_0xf725('0x1e')](function(_0x10b134){_0x149171[_0xf725('0x2d')]=_0x10b134;if(_0x3b37ae[_0xf725('0x43')]['includeAll']){_0x1c9245[_0xf725('0x52')]=[{'all':!![]}];}return db[_0xf725('0x3e')][_0xf725('0x53')](_0x1c9245);})[_0xf725('0x1e')](function(_0x3d051b){_0x149171['rows']=_0x3d051b;return _0x149171;})[_0xf725('0x1e')](respondWithFilteredResult(_0x6018b5,_0x1c9245))['catch'](handleError(_0x6018b5,null));};exports[_0xf725('0x54')]=function(_0x17ac9e,_0x54dc8f){var _0x1384e8={'raw':![],'where':{'id':_0x17ac9e['params']['id']}},_0x3c9219={};_0x3c9219['model']=_['keys'](db['VoiceContext']['rawAttributes']);_0x3c9219[_0xf725('0x43')]=_[_0xf725('0x44')](_0x17ac9e[_0xf725('0x43')]);_0x3c9219[_0xf725('0x45')]=_[_0xf725('0x46')](_0x3c9219[_0xf725('0x42')],_0x3c9219['query']);_0x1384e8[_0xf725('0x47')]=_[_0xf725('0x46')](_0x3c9219[_0xf725('0x42')],qs['fields'](_0x17ac9e[_0xf725('0x43')][_0xf725('0x48')]));_0x1384e8[_0xf725('0x47')]=_0x1384e8[_0xf725('0x47')]['length']?_0x1384e8[_0xf725('0x47')]:_0x3c9219[_0xf725('0x42')];if(_0x17ac9e[_0xf725('0x43')][_0xf725('0x55')]){_0x1384e8[_0xf725('0x52')]=[{'all':!![]}];}_0x1384e8=_[_0xf725('0x4f')]({},_0x1384e8,_0x17ac9e[_0xf725('0x56')]);return db[_0xf725('0x3e')][_0xf725('0x57')](_0x1384e8)['then'](handleEntityNotFound(_0x54dc8f,null))[_0xf725('0x1e')](respondWithResult(_0x54dc8f,null))['catch'](handleError(_0x54dc8f,null));};exports[_0xf725('0x58')]=function(_0x2f3127,_0x1ca97b,_0x2fca65){var _0x1fb7b8;return db[_0xf725('0x3e')]['create'](_0x2f3127['body'],{'raw':!![]})[_0xf725('0x1e')](function(_0xf8c7){_0x1fb7b8=_0xf8c7;return db['VoiceContext'][_0xf725('0x53')]({'raw':!![]});})[_0xf725('0x1e')](function(_0x4d74b9){var _0x462b64=fs[_0xf725('0x59')](path[_0xf725('0x5a')](config['root'],'server/files/templates/context.ejs'),_0xf725('0x5b'));var _0x4e6558=ejs['render'](_0x462b64,{'contexts':_0x4d74b9||[]});fs[_0xf725('0x5c')](_0xf725('0x5d'),_0x4e6558);})['then'](function(){return respondWithRpcPromise(_0xf725('0x5e'),'create',{'module':_0xf725('0x5f')});})['then'](function(){var _0x335d67=_0x2f3127[_0xf725('0x60')]['get']({'plain':!![]});if(!_0x335d67)throw new Error(_0xf725('0x61'));if(_0x335d67['role']==='user'){var _0x1481fd=_0x1fb7b8[_0xf725('0x36')]({'plain':!![]});return db[_0xf725('0x62')][_0xf725('0x57')]({'where':{'name':_0xf725('0x37'),'userProfileId':_0x335d67[_0xf725('0x63')]},'raw':!![]})[_0xf725('0x1e')](function(_0x4c8773){if(_0x4c8773&&_0x4c8773[_0xf725('0x64')]===0x0){return db[_0xf725('0x38')]['create']({'name':_0x1481fd[_0xf725('0x3a')],'resourceId':_0x1481fd['id'],'type':_0x4c8773['name'],'sectionId':_0x4c8773['id']},{})[_0xf725('0x1e')](function(){return _0x1fb7b8;});}else{return _0x1fb7b8;}})[_0xf725('0x27')](function(_0x41425f){logger['error'](_0xf725('0x65'),_0x41425f);throw _0x41425f;});}return _0x1fb7b8;})[_0xf725('0x1e')](respondWithResult(_0x1ca97b,0xc9))[_0xf725('0x27')](handleError(_0x1ca97b,null));};exports[_0xf725('0x34')]=function(_0x164f1a,_0x50ce50,_0x29df47){var _0x1f3557;return db[_0xf725('0x3e')][_0xf725('0x57')]({'where':{'id':_0x164f1a[_0xf725('0x66')]['id']}})[_0xf725('0x1e')](handleEntityNotFound(_0x50ce50,null))[_0xf725('0x1e')](saveUpdates(_0x164f1a[_0xf725('0x67')],null))[_0xf725('0x1e')](function(_0xd8de6d){if(_0xd8de6d){_0x1f3557=_0xd8de6d;return db[_0xf725('0x3e')][_0xf725('0x53')]({'raw':!![]});}})[_0xf725('0x1e')](function(_0x42cc65){var _0x2bfc0a=fs[_0xf725('0x59')](path[_0xf725('0x5a')](config[_0xf725('0x68')],_0xf725('0x69')),_0xf725('0x5b'));var _0x297e22=ejs[_0xf725('0x6a')](_0x2bfc0a,{'contexts':_0x42cc65||[]});fs['writeFileSync'](_0xf725('0x5d'),_0x297e22);})[_0xf725('0x1e')](function(){return respondWithRpcPromise(_0xf725('0x5e'),_0xf725('0x34'),{'module':_0xf725('0x5f')});})[_0xf725('0x1e')](function(){return _0x1f3557;})['then'](respondWithResult(_0x50ce50,null))[_0xf725('0x27')](handleError(_0x50ce50,null));};exports[_0xf725('0x35')]=function(_0x498597,_0x2b3eb5,_0x1fd41f){var _0x2d8b1a;return db[_0xf725('0x3e')][_0xf725('0x57')]({'where':{'id':_0x498597[_0xf725('0x66')]['id']}})[_0xf725('0x1e')](handleEntityNotFound(_0x2b3eb5,null))[_0xf725('0x1e')](removeEntity(_0x2b3eb5,null))[_0xf725('0x1e')](function(){return db[_0xf725('0x3e')]['findAll']({'raw':!![]});})['then'](function(_0x4cd880){var _0x256076=fs[_0xf725('0x59')](path['join'](config[_0xf725('0x68')],_0xf725('0x69')),'utf8');var _0x3b766f=ejs[_0xf725('0x6a')](_0x256076,{'contexts':_0x4cd880});fs[_0xf725('0x5c')](_0xf725('0x5d'),_0x3b766f);return respondWithRpcPromise(_0xf725('0x5e'),'destroy',{'module':_0xf725('0x5f')});})[_0xf725('0x27')](handleError(_0x2b3eb5,null));}; \ No newline at end of file +var _0xcb11=['undefined','count','set','Content-Range','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','attributes','length','query','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceContext','includeAll','include','rows','params','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','limit'];(function(_0x984d2d,_0x64d814){var _0x21ca54=function(_0x3a6425){while(--_0x3a6425){_0x984d2d['push'](_0x984d2d['shift']());}};_0x21ca54(++_0x64d814);}(_0xcb11,0x105));var _0x1cb1=function(_0x8ad45d,_0x2c14cd){_0x8ad45d=_0x8ad45d-0x0;var _0x1c31b0=_0xcb11[_0x8ad45d];return _0x1c31b0;};'use strict';var emlformat=require(_0x1cb1('0x0'));var rimraf=require(_0x1cb1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb1('0x2'));var rp=require(_0x1cb1('0x3'));var moment=require(_0x1cb1('0x4'));var BPromise=require(_0x1cb1('0x5'));var Mustache=require(_0x1cb1('0x6'));var util=require(_0x1cb1('0x7'));var path=require(_0x1cb1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1cb1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cb1('0xa'));var squel=require(_0x1cb1('0xb'));var crypto=require(_0x1cb1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1cb1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1cb1('0xe'));var Papa=require(_0x1cb1('0xf'));var Redis=require(_0x1cb1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1cb1('0x11'));var hardwareService=require(_0x1cb1('0x12'));var logger=require(_0x1cb1('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1cb1('0x14'));var licenseUtil=require(_0x1cb1('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1cb1('0x16'));var client=jayson['client'][_0x1cb1('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x367612,_0x33413e,_0x5a3b74,_0x2423aa){return new BPromise(function(_0x38c6c9,_0x51de50){var _0x39c9d7=_0x2423aa||client;return _0x39c9d7['request'](_0x367612,_0x5a3b74)[_0x1cb1('0x18')](function(_0x237810){logger[_0x1cb1('0x19')](_0x1cb1('0x1a'),_0x33413e,_0x1cb1('0x1b'));logger['debug'](_0x1cb1('0x1c'),_0x33413e,_0x1cb1('0x1b'),JSON['stringify'](_0x237810));if(_0x237810[_0x1cb1('0x1d')]){if(_0x237810[_0x1cb1('0x1d')]['code']===0x1f4){logger['error'](_0x1cb1('0x1a'),_0x33413e,_0x237810[_0x1cb1('0x1d')]['message']);return _0x51de50(_0x237810['error'][_0x1cb1('0x1e')]);}logger[_0x1cb1('0x1d')](_0x1cb1('0x1a'),_0x33413e,_0x237810[_0x1cb1('0x1d')][_0x1cb1('0x1e')]);return _0x38c6c9(_0x237810['error'][_0x1cb1('0x1e')]);}else{logger[_0x1cb1('0x19')]('VoiceContext,\x20%s,\x20%s',_0x33413e,_0x1cb1('0x1b'));_0x38c6c9(_0x237810[_0x1cb1('0x1f')]['message']);}})[_0x1cb1('0x20')](function(_0x172d5c){logger[_0x1cb1('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x33413e,_0x172d5c);_0x51de50(_0x172d5c);});});}function respondWithStatusCode(_0x540af0,_0xaf9471){_0xaf9471=_0xaf9471||0xcc;return function(_0x5d7b70){if(_0x5d7b70){return _0x540af0[_0x1cb1('0x21')](_0xaf9471);}return _0x540af0[_0x1cb1('0x22')](_0xaf9471)[_0x1cb1('0x23')]();};}function respondWithResult(_0x41b11a,_0x41e381){_0x41e381=_0x41e381||0xc8;return function(_0x2ec75c){if(_0x2ec75c){return _0x41b11a[_0x1cb1('0x22')](_0x41e381)[_0x1cb1('0x24')](_0x2ec75c);}};}function respondWithFilteredResult(_0x2eb13f,_0x21a52a){return function(_0x3b94b5){if(_0x3b94b5){var _0x476afb=typeof _0x21a52a[_0x1cb1('0x25')]==='undefined'&&typeof _0x21a52a[_0x1cb1('0x26')]===_0x1cb1('0x27');var _0xe5e766=_0x3b94b5['count'];var _0x41c0e6=_0x476afb?0x0:_0x21a52a['offset'];var _0x58c968=_0x476afb?_0x3b94b5[_0x1cb1('0x28')]:_0x21a52a[_0x1cb1('0x25')]+_0x21a52a['limit'];var _0x32dea8;if(_0x58c968>=_0xe5e766){_0x58c968=_0xe5e766;_0x32dea8=0xc8;}else{_0x32dea8=0xce;}_0x2eb13f['status'](_0x32dea8);return _0x2eb13f[_0x1cb1('0x29')](_0x1cb1('0x2a'),_0x41c0e6+'-'+_0x58c968+'/'+_0xe5e766)[_0x1cb1('0x24')](_0x3b94b5);}return null;};}function patchUpdates(_0x3ea755){return function(_0x249e73){try{jsonpatch['apply'](_0x249e73,_0x3ea755,!![]);}catch(_0x2bf4e4){return BPromise[_0x1cb1('0x2b')](_0x2bf4e4);}return _0x249e73[_0x1cb1('0x2c')]();};}function saveUpdates(_0x5721bc,_0x57a7e9){return function(_0x225fc4){if(_0x225fc4){return _0x225fc4[_0x1cb1('0x2d')](_0x5721bc)[_0x1cb1('0x18')](function(_0x3d8a9b){return _0x3d8a9b;});}return null;};}function removeEntity(_0x49079e,_0x58d263){return function(_0x59181c){if(_0x59181c){return _0x59181c[_0x1cb1('0x2e')]()[_0x1cb1('0x18')](function(){var _0x1e4c76=_0x59181c['get']({'plain':!![]});var _0x5ad26f=_0x1cb1('0x2f');return db[_0x1cb1('0x30')][_0x1cb1('0x2e')]({'where':{'type':_0x5ad26f,'resourceId':_0x1e4c76['id']}})[_0x1cb1('0x18')](function(){return _0x59181c;});})[_0x1cb1('0x18')](function(){_0x49079e[_0x1cb1('0x22')](0xcc)[_0x1cb1('0x23')]();});}};}function handleEntityNotFound(_0x5e99c8,_0x73cd3a){return function(_0x47e183){if(!_0x47e183){_0x5e99c8[_0x1cb1('0x21')](0x194);}return _0x47e183;};}function handleError(_0x431b1b,_0x46afd9){_0x46afd9=_0x46afd9||0x1f4;return function(_0x1d913b){logger[_0x1cb1('0x1d')](_0x1d913b[_0x1cb1('0x31')]);if(_0x1d913b[_0x1cb1('0x32')]){delete _0x1d913b[_0x1cb1('0x32')];}_0x431b1b[_0x1cb1('0x22')](_0x46afd9)[_0x1cb1('0x33')](_0x1d913b);};}exports['index']=function(_0x2b80bf,_0x6a1d6d){var _0xece3a1={},_0x51c545={},_0x428190={'count':0x0,'rows':[]};var _0x2c6426=_[_0x1cb1('0x34')](db['VoiceContext'][_0x1cb1('0x35')],function(_0x1c0581){return{'name':_0x1c0581[_0x1cb1('0x36')],'type':_0x1c0581[_0x1cb1('0x37')][_0x1cb1('0x38')]};});_0x51c545[_0x1cb1('0x39')]=_['map'](_0x2c6426,'name');_0x51c545['query']=_[_0x1cb1('0x3a')](_0x2b80bf['query']);_0x51c545[_0x1cb1('0x3b')]=_[_0x1cb1('0x3c')](_0x51c545['model'],_0x51c545['query']);_0xece3a1['attributes']=_[_0x1cb1('0x3c')](_0x51c545['model'],qs['fields'](_0x2b80bf['query'][_0x1cb1('0x3d')]));_0xece3a1[_0x1cb1('0x3e')]=_0xece3a1[_0x1cb1('0x3e')][_0x1cb1('0x3f')]?_0xece3a1[_0x1cb1('0x3e')]:_0x51c545[_0x1cb1('0x39')];if(!_0x2b80bf[_0x1cb1('0x40')]['hasOwnProperty'](_0x1cb1('0x41'))){_0xece3a1['limit']=qs[_0x1cb1('0x26')](_0x2b80bf[_0x1cb1('0x40')]['limit']);_0xece3a1['offset']=qs['offset'](_0x2b80bf[_0x1cb1('0x40')][_0x1cb1('0x25')]);}_0xece3a1[_0x1cb1('0x42')]=qs['sort'](_0x2b80bf[_0x1cb1('0x40')][_0x1cb1('0x43')]);_0xece3a1[_0x1cb1('0x44')]=qs['filters'](_[_0x1cb1('0x45')](_0x2b80bf['query'],_0x51c545[_0x1cb1('0x3b')]),_0x2c6426);if(_0x2b80bf[_0x1cb1('0x40')][_0x1cb1('0x46')]){_0xece3a1[_0x1cb1('0x44')]=_[_0x1cb1('0x47')](_0xece3a1[_0x1cb1('0x44')],{'$or':_[_0x1cb1('0x34')](_0x2c6426,function(_0x483089){if(_0x483089[_0x1cb1('0x37')]!==_0x1cb1('0x48')){var _0x298362={};_0x298362[_0x483089[_0x1cb1('0x32')]]={'$like':'%'+_0x2b80bf[_0x1cb1('0x40')][_0x1cb1('0x46')]+'%'};return _0x298362;}})});}_0xece3a1=_[_0x1cb1('0x47')]({},_0xece3a1,_0x2b80bf[_0x1cb1('0x49')]);var _0x1246a3={'where':_0xece3a1['where']};return db[_0x1cb1('0x4a')][_0x1cb1('0x28')](_0x1246a3)['then'](function(_0x39be9e){_0x428190[_0x1cb1('0x28')]=_0x39be9e;if(_0x2b80bf[_0x1cb1('0x40')][_0x1cb1('0x4b')]){_0xece3a1[_0x1cb1('0x4c')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0xece3a1);})[_0x1cb1('0x18')](function(_0x32ac5d){_0x428190[_0x1cb1('0x4d')]=_0x32ac5d;return _0x428190;})['then'](respondWithFilteredResult(_0x6a1d6d,_0xece3a1))[_0x1cb1('0x20')](handleError(_0x6a1d6d,null));};exports['show']=function(_0x632d48,_0x487c98){var _0x402bf2={'raw':![],'where':{'id':_0x632d48[_0x1cb1('0x4e')]['id']}},_0x35c34b={};_0x35c34b[_0x1cb1('0x39')]=_[_0x1cb1('0x3a')](db[_0x1cb1('0x4a')]['rawAttributes']);_0x35c34b[_0x1cb1('0x40')]=_[_0x1cb1('0x3a')](_0x632d48[_0x1cb1('0x40')]);_0x35c34b[_0x1cb1('0x3b')]=_[_0x1cb1('0x3c')](_0x35c34b[_0x1cb1('0x39')],_0x35c34b[_0x1cb1('0x40')]);_0x402bf2[_0x1cb1('0x3e')]=_[_0x1cb1('0x3c')](_0x35c34b[_0x1cb1('0x39')],qs['fields'](_0x632d48['query'][_0x1cb1('0x3d')]));_0x402bf2[_0x1cb1('0x3e')]=_0x402bf2[_0x1cb1('0x3e')]['length']?_0x402bf2[_0x1cb1('0x3e')]:_0x35c34b['model'];if(_0x632d48[_0x1cb1('0x40')]['includeAll']){_0x402bf2['include']=[{'all':!![]}];}_0x402bf2=_[_0x1cb1('0x47')]({},_0x402bf2,_0x632d48[_0x1cb1('0x49')]);return db[_0x1cb1('0x4a')][_0x1cb1('0x4f')](_0x402bf2)[_0x1cb1('0x18')](handleEntityNotFound(_0x487c98,null))[_0x1cb1('0x18')](respondWithResult(_0x487c98,null))[_0x1cb1('0x20')](handleError(_0x487c98,null));};exports['create']=function(_0x297eaa,_0x509fc7,_0x6e941b){var _0x1a6587;return db[_0x1cb1('0x4a')][_0x1cb1('0x50')](_0x297eaa[_0x1cb1('0x51')],{'raw':!![]})['then'](function(_0xbbeaa2){_0x1a6587=_0xbbeaa2;return db['VoiceContext'][_0x1cb1('0x52')]({'raw':!![]});})[_0x1cb1('0x18')](function(_0xf92620){var _0xad601d=fs[_0x1cb1('0x53')](path[_0x1cb1('0x54')](config[_0x1cb1('0x55')],_0x1cb1('0x56')),_0x1cb1('0x57'));var _0x16225=ejs[_0x1cb1('0x58')](_0xad601d,{'contexts':_0xf92620||[]});fs[_0x1cb1('0x59')](_0x1cb1('0x5a'),_0x16225);})[_0x1cb1('0x18')](function(){return respondWithRpcPromise(_0x1cb1('0x5b'),'create',{'module':_0x1cb1('0x5c')});})['then'](function(){var _0x3a386b=_0x297eaa['user']['get']({'plain':!![]});if(!_0x3a386b)throw new Error(_0x1cb1('0x5d'));if(_0x3a386b['role']===_0x1cb1('0x5e')){var _0x2116e7=_0x1a6587[_0x1cb1('0x5f')]({'plain':!![]});return db[_0x1cb1('0x60')]['find']({'where':{'name':_0x1cb1('0x2f'),'userProfileId':_0x3a386b[_0x1cb1('0x61')]},'raw':!![]})[_0x1cb1('0x18')](function(_0x58436d){if(_0x58436d&&_0x58436d[_0x1cb1('0x62')]===0x0){return db[_0x1cb1('0x30')][_0x1cb1('0x50')]({'name':_0x2116e7[_0x1cb1('0x32')],'resourceId':_0x2116e7['id'],'type':_0x58436d[_0x1cb1('0x32')],'sectionId':_0x58436d['id']},{})[_0x1cb1('0x18')](function(){return _0x1a6587;});}else{return _0x1a6587;}})[_0x1cb1('0x20')](function(_0x394564){logger[_0x1cb1('0x1d')](_0x1cb1('0x63'),_0x394564);throw _0x394564;});}return _0x1a6587;})[_0x1cb1('0x18')](respondWithResult(_0x509fc7,0xc9))[_0x1cb1('0x20')](handleError(_0x509fc7,null));};exports[_0x1cb1('0x2d')]=function(_0x50799a,_0x369d7a,_0x244020){var _0xcf7796;return db['VoiceContext']['find']({'where':{'id':_0x50799a[_0x1cb1('0x4e')]['id']}})[_0x1cb1('0x18')](handleEntityNotFound(_0x369d7a,null))[_0x1cb1('0x18')](saveUpdates(_0x50799a[_0x1cb1('0x51')],null))[_0x1cb1('0x18')](function(_0x2011cc){if(_0x2011cc){_0xcf7796=_0x2011cc;return db[_0x1cb1('0x4a')]['findAll']({'raw':!![]});}})[_0x1cb1('0x18')](function(_0x10c65b){var _0x343a93=fs['readFileSync'](path[_0x1cb1('0x54')](config[_0x1cb1('0x55')],_0x1cb1('0x56')),_0x1cb1('0x57'));var _0x39646c=ejs[_0x1cb1('0x58')](_0x343a93,{'contexts':_0x10c65b||[]});fs[_0x1cb1('0x59')](_0x1cb1('0x5a'),_0x39646c);})['then'](function(){return respondWithRpcPromise(_0x1cb1('0x5b'),_0x1cb1('0x2d'),{'module':'chan_sip.so'});})[_0x1cb1('0x18')](function(){return _0xcf7796;})[_0x1cb1('0x18')](respondWithResult(_0x369d7a,null))['catch'](handleError(_0x369d7a,null));};exports['destroy']=function(_0x5e2b1d,_0x69ef96,_0x454d7b){var _0x5009b4;return db[_0x1cb1('0x4a')]['find']({'where':{'id':_0x5e2b1d[_0x1cb1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x69ef96,null))['then'](removeEntity(_0x69ef96,null))[_0x1cb1('0x18')](function(){return db[_0x1cb1('0x4a')][_0x1cb1('0x52')]({'raw':!![]});})[_0x1cb1('0x18')](function(_0x440f7c){var _0x3d345e=fs[_0x1cb1('0x53')](path[_0x1cb1('0x54')](config['root'],_0x1cb1('0x56')),'utf8');var _0x2abda9=ejs[_0x1cb1('0x58')](_0x3d345e,{'contexts':_0x440f7c});fs[_0x1cb1('0x59')](_0x1cb1('0x5a'),_0x2abda9);return respondWithRpcPromise(_0x1cb1('0x5b'),'destroy',{'module':'chan_sip.so'});})[_0x1cb1('0x20')](handleError(_0x69ef96,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 31f582e..0332529 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 _0x6faf=['bluebird','request-promise','rimraf','./voiceContext.attributes','define','VoiceContext','voice_contexts','util','../../config/logger','api','moment'];(function(_0x589102,_0x286fb9){var _0x40b91d=function(_0x5e5169){while(--_0x5e5169){_0x589102['push'](_0x589102['shift']());}};_0x40b91d(++_0x286fb9);}(_0x6faf,0xf9));var _0xf6fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6faf[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xf6fa('0x0'));var logger=require(_0xf6fa('0x1'))(_0xf6fa('0x2'));var moment=require(_0xf6fa('0x3'));var BPromise=require(_0xf6fa('0x4'));var rp=require(_0xf6fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6fa('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6fa('0x7'));module['exports']=function(_0xe883dd,_0x3c91fc){return _0xe883dd[_0xf6fa('0x8')](_0xf6fa('0x9'),attributes,{'tableName':_0xf6fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7844=['exports','define','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2cdb65,_0x1dfb10){var _0x978dd7=function(_0x3c7eca){while(--_0x3c7eca){_0x2cdb65['push'](_0x2cdb65['shift']());}};_0x978dd7(++_0x1dfb10);}(_0x7844,0x15f));var _0x4784=function(_0x3edae4,_0x333d01){_0x3edae4=_0x3edae4-0x0;var _0x1190a7=_0x7844[_0x3edae4];return _0x1190a7;};'use strict';var _=require(_0x4784('0x0'));var util=require('util');var logger=require(_0x4784('0x1'))(_0x4784('0x2'));var moment=require(_0x4784('0x3'));var BPromise=require(_0x4784('0x4'));var rp=require(_0x4784('0x5'));var fs=require('fs');var path=require(_0x4784('0x6'));var rimraf=require(_0x4784('0x7'));var config=require(_0x4784('0x8'));var attributes=require('./voiceContext.attributes');module[_0x4784('0x9')]=function(_0x1e283b,_0x42b71a){return _0x1e283b[_0x4784('0xa')]('VoiceContext',attributes,{'tableName':_0x4784('0xb'),'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 9924ca8..c539ba1 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 _0x0c99=['../../config/utils','rpc','../../config/environment','jayson/promise','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x217d6c,_0x11e87f){var _0x5689ba=function(_0xd1d07){while(--_0xd1d07){_0x217d6c['push'](_0x217d6c['shift']());}};_0x5689ba(++_0x11e87f);}(_0x0c99,0x1af));var _0x90c9=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x0c99[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0x90c9('0x0'));var util=require(_0x90c9('0x1'));var moment=require(_0x90c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x90c9('0x3'));var fs=require('fs');var Redis=require(_0x90c9('0x4'));var db=require(_0x90c9('0x5'))['db'];var utils=require(_0x90c9('0x6'));var logger=require('../../config/logger')(_0x90c9('0x7'));var config=require(_0x90c9('0x8'));var jayson=require(_0x90c9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a43c0,_0x3446a4,_0xcb6555){return new BPromise(function(_0x150cd8,_0x47c9cf){return client['request'](_0x3a43c0,_0xcb6555)['then'](function(_0x28c5f4){logger[_0x90c9('0xa')](_0x90c9('0xb'),_0x3446a4,'request\x20sent');logger[_0x90c9('0xc')](_0x90c9('0xd'),_0x3446a4,_0x90c9('0xe'),JSON[_0x90c9('0xf')](_0x28c5f4));if(_0x28c5f4[_0x90c9('0x10')]){if(_0x28c5f4[_0x90c9('0x10')]['code']===0x1f4){logger[_0x90c9('0x10')](_0x90c9('0xb'),_0x3446a4,_0x28c5f4['error'][_0x90c9('0x11')]);return _0x47c9cf(_0x28c5f4[_0x90c9('0x10')][_0x90c9('0x11')]);}logger[_0x90c9('0x10')](_0x90c9('0xb'),_0x3446a4,_0x28c5f4[_0x90c9('0x10')]['message']);return _0x150cd8(_0x28c5f4[_0x90c9('0x10')][_0x90c9('0x11')]);}else{logger['info'](_0x90c9('0xb'),_0x3446a4,_0x90c9('0xe'));_0x150cd8(_0x28c5f4[_0x90c9('0x12')][_0x90c9('0x11')]);}})['catch'](function(_0x30a65a){logger[_0x90c9('0x10')](_0x90c9('0xb'),_0x3446a4,_0x30a65a);_0x47c9cf(_0x30a65a);});});} \ No newline at end of file +var _0x97a8=['rpc','../../config/environment','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x437375,_0x5b1fc3){var _0x9a6f77=function(_0x4a50b3){while(--_0x4a50b3){_0x437375['push'](_0x437375['shift']());}};_0x9a6f77(++_0x5b1fc3);}(_0x97a8,0xe3));var _0x897a=function(_0x448b29,_0x309b98){_0x448b29=_0x448b29-0x0;var _0x4c8162=_0x97a8[_0x448b29];return _0x4c8162;};'use strict';var _=require('lodash');var util=require(_0x897a('0x0'));var moment=require(_0x897a('0x1'));var BPromise=require(_0x897a('0x2'));var rs=require(_0x897a('0x3'));var fs=require('fs');var Redis=require(_0x897a('0x4'));var db=require(_0x897a('0x5'))['db'];var utils=require(_0x897a('0x6'));var logger=require('../../config/logger')(_0x897a('0x7'));var config=require(_0x897a('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59b9f1,_0x3eb794,_0x128644){return new BPromise(function(_0x3cd748,_0x364c09){return client[_0x897a('0x9')](_0x59b9f1,_0x128644)['then'](function(_0x18ecde){logger[_0x897a('0xa')](_0x897a('0xb'),_0x3eb794,_0x897a('0xc'));logger[_0x897a('0xd')](_0x897a('0xe'),_0x3eb794,_0x897a('0xc'),JSON['stringify'](_0x18ecde));if(_0x18ecde['error']){if(_0x18ecde['error']['code']===0x1f4){logger[_0x897a('0xf')]('VoiceContext,\x20%s,\x20%s',_0x3eb794,_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);return _0x364c09(_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);}logger['error'](_0x897a('0xb'),_0x3eb794,_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);return _0x3cd748(_0x18ecde[_0x897a('0xf')]['message']);}else{logger['info'](_0x897a('0xb'),_0x3eb794,_0x897a('0xc'));_0x3cd748(_0x18ecde['result'][_0x897a('0x10')]);}})[_0x897a('0x11')](function(_0xaf826e){logger[_0x897a('0xf')](_0x897a('0xb'),_0x3eb794,_0xaf826e);_0x364c09(_0xaf826e);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c18a6ea..b445399 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 _0xb2e3=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3462d1,_0x188412){var _0xe64b5e=function(_0x2825d5){while(--_0x2825d5){_0x3462d1['push'](_0x3462d1['shift']());}};_0xe64b5e(++_0x188412);}(_0xb2e3,0xf9));var _0x3b2e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb2e3[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x3b2e('0x0'));var util=require(_0x3b2e('0x1'));var path=require(_0x3b2e('0x2'));var timeout=require(_0x3b2e('0x3'));var express=require(_0x3b2e('0x4'));var router=express[_0x3b2e('0x5')]();var fs_extra=require(_0x3b2e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3b2e('0x7'));var config=require(_0x3b2e('0x8'));var controller=require(_0x3b2e('0x9'));router[_0x3b2e('0xa')]('/',auth[_0x3b2e('0xb')](),controller[_0x3b2e('0xc')]);router['get'](_0x3b2e('0xd'),auth[_0x3b2e('0xb')](),controller[_0x3b2e('0xe')]);router[_0x3b2e('0xa')](_0x3b2e('0xf'),auth[_0x3b2e('0xb')](),controller[_0x3b2e('0x10')]);router['post']('/',auth[_0x3b2e('0xb')](),controller[_0x3b2e('0x11')]);router[_0x3b2e('0x12')](_0x3b2e('0xf'),auth[_0x3b2e('0xb')](),controller[_0x3b2e('0x13')]);router[_0x3b2e('0x14')](_0x3b2e('0xf'),auth['isAuthenticated'](),controller[_0x3b2e('0x15')]);module[_0x3b2e('0x16')]=router; \ No newline at end of file +var _0x921a=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x921a,0x1ce));var _0xa921=function(_0x3cebf5,_0x1ce673){_0x3cebf5=_0x3cebf5-0x0;var _0x4462d1=_0x921a[_0x3cebf5];return _0x4462d1;};'use strict';var multer=require(_0xa921('0x0'));var util=require('util');var path=require(_0xa921('0x1'));var timeout=require('connect-timeout');var express=require(_0xa921('0x2'));var router=express[_0xa921('0x3')]();var fs_extra=require(_0xa921('0x4'));var auth=require(_0xa921('0x5'));var interaction=require(_0xa921('0x6'));var config=require(_0xa921('0x7'));var controller=require('./voiceDialReport.controller');router[_0xa921('0x8')]('/',auth[_0xa921('0x9')](),controller[_0xa921('0xa')]);router[_0xa921('0x8')](_0xa921('0xb'),auth[_0xa921('0x9')](),controller[_0xa921('0xc')]);router[_0xa921('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa921('0xd')]);router['post']('/',auth[_0xa921('0x9')](),controller['create']);router[_0xa921('0xe')](_0xa921('0xf'),auth['isAuthenticated'](),controller[_0xa921('0x10')]);router[_0xa921('0x11')](_0xa921('0xf'),auth[_0xa921('0x9')](),controller[_0xa921('0x12')]);module[_0xa921('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 37da457..ac4c634 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 _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0xdf9b3c,_0xb472f0){var _0x5d7d6b=function(_0x2c490e){while(--_0x2c490e){_0xdf9b3c['push'](_0xdf9b3c['shift']());}};_0x5d7d6b(++_0xb472f0);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4eaf5d,_0x4c6151){_0x4eaf5d=_0x4eaf5d-0x0;var _0x244a3b=_0xe5b3[_0x4eaf5d];return _0x244a3b;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x1171b8,_0x379ef5){var _0x16cfa2=function(_0x3d5c41){while(--_0x3d5c41){_0x1171b8['push'](_0x1171b8['shift']());}};_0x16cfa2(++_0x379ef5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x30a8dc,_0x53df96){_0x30a8dc=_0x30a8dc-0x0;var _0x1eef6d=_0x9bde[_0x30a8dc];return _0x1eef6d;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 3fb80e9..526c9e1 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 _0x27b0=['squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','error','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','show','find','create','body','params','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x26681d,_0x233735){var _0xea7ae=function(_0x40b38d){while(--_0x40b38d){_0x26681d['push'](_0x26681d['shift']());}};_0xea7ae(++_0x233735);}(_0x27b0,0xd9));var _0x027b=function(_0x20afc3,_0x2f189a){_0x20afc3=_0x20afc3-0x0;var _0x4cbb43=_0x27b0[_0x20afc3];return _0x4cbb43;};'use strict';var emlformat=require(_0x027b('0x0'));var rimraf=require(_0x027b('0x1'));var zipdir=require(_0x027b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x027b('0x3'));var moment=require(_0x027b('0x4'));var BPromise=require(_0x027b('0x5'));var Mustache=require(_0x027b('0x6'));var util=require(_0x027b('0x7'));var path=require(_0x027b('0x8'));var sox=require(_0x027b('0x9'));var csv=require(_0x027b('0xa'));var ejs=require(_0x027b('0xb'));var fs=require('fs');var fs_extra=require(_0x027b('0xc'));var _=require(_0x027b('0xd'));var squel=require(_0x027b('0xe'));var crypto=require(_0x027b('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x027b('0xa'));var querystring=require('querystring');var Papa=require(_0x027b('0x10'));var Redis=require(_0x027b('0x11'));var authService=require(_0x027b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x027b('0x13'));var hardwareService=require(_0x027b('0x14'));var logger=require(_0x027b('0x15'))('api');var utils=require(_0x027b('0x16'));var config=require(_0x027b('0x17'));var licenseUtil=require(_0x027b('0x18'));var db=require(_0x027b('0x19'))['db'];function respondWithStatusCode(_0x2cc7d7,_0xaf37fe){_0xaf37fe=_0xaf37fe||0xcc;return function(_0xb7653b){if(_0xb7653b){return _0x2cc7d7[_0x027b('0x1a')](_0xaf37fe);}return _0x2cc7d7[_0x027b('0x1b')](_0xaf37fe)[_0x027b('0x1c')]();};}function respondWithResult(_0x519d95,_0x4b3d7d){_0x4b3d7d=_0x4b3d7d||0xc8;return function(_0x4d08b8){if(_0x4d08b8){return _0x519d95[_0x027b('0x1b')](_0x4b3d7d)[_0x027b('0x1d')](_0x4d08b8);}};}function respondWithFilteredResult(_0x47c668,_0x52fc31){return function(_0x5ce8d1){if(_0x5ce8d1){var _0xbc9c3f=typeof _0x52fc31[_0x027b('0x1e')]===_0x027b('0x1f')&&typeof _0x52fc31[_0x027b('0x20')]===_0x027b('0x1f');var _0x406de2=_0x5ce8d1['count'];var _0x624beb=_0xbc9c3f?0x0:_0x52fc31[_0x027b('0x1e')];var _0x3f1921=_0xbc9c3f?_0x5ce8d1[_0x027b('0x21')]:_0x52fc31[_0x027b('0x1e')]+_0x52fc31[_0x027b('0x20')];var _0x445ae9;if(_0x3f1921>=_0x406de2){_0x3f1921=_0x406de2;_0x445ae9=0xc8;}else{_0x445ae9=0xce;}_0x47c668[_0x027b('0x1b')](_0x445ae9);return _0x47c668[_0x027b('0x22')](_0x027b('0x23'),_0x624beb+'-'+_0x3f1921+'/'+_0x406de2)[_0x027b('0x1d')](_0x5ce8d1);}return null;};}function patchUpdates(_0x448e8f){return function(_0x3e9068){try{jsonpatch[_0x027b('0x24')](_0x3e9068,_0x448e8f,!![]);}catch(_0x486605){return BPromise[_0x027b('0x25')](_0x486605);}return _0x3e9068['save']();};}function saveUpdates(_0x57ee8b,_0x543e94){return function(_0x8a826f){if(_0x8a826f){return _0x8a826f['update'](_0x57ee8b)['then'](function(_0x28ccb3){return _0x28ccb3;});}return null;};}function removeEntity(_0x17c185,_0x404f48){return function(_0x49f081){if(_0x49f081){return _0x49f081[_0x027b('0x26')]()['then'](function(){_0x17c185['status'](0xcc)[_0x027b('0x1c')]();});}};}function handleEntityNotFound(_0x481e87,_0x5e13ac){return function(_0x47be17){if(!_0x47be17){_0x481e87[_0x027b('0x1a')](0x194);}return _0x47be17;};}function handleError(_0x25570c,_0x101313){_0x101313=_0x101313||0x1f4;return function(_0x638e6d){logger[_0x027b('0x27')](_0x638e6d['stack']);if(_0x638e6d[_0x027b('0x28')]){delete _0x638e6d[_0x027b('0x28')];}_0x25570c[_0x027b('0x1b')](_0x101313)[_0x027b('0x29')](_0x638e6d);};}exports['index']=function(_0x3fa6f7,_0x5c89d8){var _0x529c27={},_0x240395={},_0x1cac37={'count':0x0,'rows':[]};var _0x8f57ce=_[_0x027b('0x2a')](db[_0x027b('0x2b')][_0x027b('0x2c')],function(_0x93d01a){return{'name':_0x93d01a[_0x027b('0x2d')],'type':_0x93d01a[_0x027b('0x2e')][_0x027b('0x2f')]};});_0x240395['model']=_[_0x027b('0x2a')](_0x8f57ce,'name');_0x240395[_0x027b('0x30')]=_[_0x027b('0x31')](_0x3fa6f7[_0x027b('0x30')]);_0x240395['filters']=_[_0x027b('0x32')](_0x240395[_0x027b('0x33')],_0x240395[_0x027b('0x30')]);_0x529c27[_0x027b('0x34')]=_[_0x027b('0x32')](_0x240395['model'],qs[_0x027b('0x35')](_0x3fa6f7[_0x027b('0x30')]['fields']));_0x529c27['attributes']=_0x529c27[_0x027b('0x34')][_0x027b('0x36')]?_0x529c27[_0x027b('0x34')]:_0x240395[_0x027b('0x33')];if(!_0x3fa6f7[_0x027b('0x30')][_0x027b('0x37')](_0x027b('0x38'))){_0x529c27[_0x027b('0x20')]=qs[_0x027b('0x20')](_0x3fa6f7['query'][_0x027b('0x20')]);_0x529c27[_0x027b('0x1e')]=qs[_0x027b('0x1e')](_0x3fa6f7[_0x027b('0x30')][_0x027b('0x1e')]);}_0x529c27[_0x027b('0x39')]=qs[_0x027b('0x3a')](_0x3fa6f7[_0x027b('0x30')][_0x027b('0x3a')]);_0x529c27[_0x027b('0x3b')]=qs[_0x027b('0x3c')](_[_0x027b('0x3d')](_0x3fa6f7[_0x027b('0x30')],_0x240395[_0x027b('0x3c')]),_0x8f57ce);if(_0x3fa6f7[_0x027b('0x30')][_0x027b('0x3e')]){_0x529c27[_0x027b('0x3b')]=_[_0x027b('0x3f')](_0x529c27['where'],{'$or':_[_0x027b('0x2a')](_0x8f57ce,function(_0x53b268){if(_0x53b268[_0x027b('0x2e')]!==_0x027b('0x40')){var _0x5d739b={};_0x5d739b[_0x53b268[_0x027b('0x28')]]={'$like':'%'+_0x3fa6f7[_0x027b('0x30')]['filter']+'%'};return _0x5d739b;}})});}_0x529c27=_[_0x027b('0x3f')]({},_0x529c27,_0x3fa6f7[_0x027b('0x41')]);var _0x14e0a8={'where':_0x529c27[_0x027b('0x3b')]};return db[_0x027b('0x2b')][_0x027b('0x21')](_0x14e0a8)['then'](function(_0x43337b){_0x1cac37['count']=_0x43337b;if(_0x3fa6f7[_0x027b('0x30')][_0x027b('0x42')]){_0x529c27[_0x027b('0x43')]=[{'all':!![]}];}return db[_0x027b('0x2b')][_0x027b('0x44')](_0x529c27);})[_0x027b('0x45')](function(_0x161472){_0x1cac37['rows']=_0x161472;return _0x1cac37;})[_0x027b('0x45')](respondWithFilteredResult(_0x5c89d8,_0x529c27))['catch'](handleError(_0x5c89d8,null));};exports[_0x027b('0x46')]=function(_0x4853a9,_0x5bd73e){var _0xfd521d={'raw':!![],'where':{'id':_0x4853a9['params']['id']}},_0x5ad1d6={};_0x5ad1d6[_0x027b('0x33')]=_[_0x027b('0x31')](db[_0x027b('0x2b')][_0x027b('0x2c')]);_0x5ad1d6[_0x027b('0x30')]=_[_0x027b('0x31')](_0x4853a9['query']);_0x5ad1d6[_0x027b('0x3c')]=_['intersection'](_0x5ad1d6[_0x027b('0x33')],_0x5ad1d6['query']);_0xfd521d[_0x027b('0x34')]=_[_0x027b('0x32')](_0x5ad1d6[_0x027b('0x33')],qs['fields'](_0x4853a9[_0x027b('0x30')][_0x027b('0x35')]));_0xfd521d['attributes']=_0xfd521d[_0x027b('0x34')][_0x027b('0x36')]?_0xfd521d[_0x027b('0x34')]:_0x5ad1d6['model'];if(_0x4853a9['query'][_0x027b('0x42')]){_0xfd521d[_0x027b('0x43')]=[{'all':!![]}];}_0xfd521d=_['merge']({},_0xfd521d,_0x4853a9[_0x027b('0x41')]);return db[_0x027b('0x2b')][_0x027b('0x47')](_0xfd521d)[_0x027b('0x45')](handleEntityNotFound(_0x5bd73e,null))[_0x027b('0x45')](respondWithResult(_0x5bd73e,null))['catch'](handleError(_0x5bd73e,null));};exports[_0x027b('0x48')]=function(_0x5530c9,_0x54fa02){return db[_0x027b('0x2b')][_0x027b('0x48')](_0x5530c9['body'],{})[_0x027b('0x45')](respondWithResult(_0x54fa02,0xc9))['catch'](handleError(_0x54fa02,null));};exports['update']=function(_0x320d44,_0x56dfa4){if(_0x320d44[_0x027b('0x49')]['id']){delete _0x320d44[_0x027b('0x49')]['id'];}return db[_0x027b('0x2b')][_0x027b('0x47')]({'where':{'id':_0x320d44[_0x027b('0x4a')]['id']}})[_0x027b('0x45')](handleEntityNotFound(_0x56dfa4,null))['then'](saveUpdates(_0x320d44[_0x027b('0x49')],null))[_0x027b('0x45')](respondWithResult(_0x56dfa4,null))['catch'](handleError(_0x56dfa4,null));};exports[_0x027b('0x26')]=function(_0x1e0285,_0x5566e0){return db[_0x027b('0x2b')][_0x027b('0x47')]({'where':{'id':_0x1e0285['params']['id']}})[_0x027b('0x45')](handleEntityNotFound(_0x5566e0,null))[_0x027b('0x45')](removeEntity(_0x5566e0,null))[_0x027b('0x4b')](handleError(_0x5566e0,null));};exports[_0x027b('0x4c')]=function(_0x2872e3,_0x4a623f){return db[_0x027b('0x2b')][_0x027b('0x4c')]()[_0x027b('0x45')](respondWithResult(_0x4a623f,null))[_0x027b('0x4b')](handleError(_0x4a623f,null));}; \ No newline at end of file +var _0x3160=['options','where','include','findAll','catch','show','params','keys','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL'];(function(_0x29f806,_0x5cd0bd){var _0xd270f=function(_0x2e8fb0){while(--_0x2e8fb0){_0x29f806['push'](_0x29f806['shift']());}};_0xd270f(++_0x5cd0bd);}(_0x3160,0xa2));var _0x0316=function(_0x4387bc,_0x316c48){_0x4387bc=_0x4387bc-0x0;var _0x2747f9=_0x3160[_0x4387bc];return _0x2747f9;};'use strict';var emlformat=require(_0x0316('0x0'));var rimraf=require(_0x0316('0x1'));var zipdir=require(_0x0316('0x2'));var jsonpatch=require(_0x0316('0x3'));var rp=require(_0x0316('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0316('0x5'));var util=require(_0x0316('0x6'));var path=require(_0x0316('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0316('0x8'));var fs=require('fs');var fs_extra=require(_0x0316('0x9'));var _=require(_0x0316('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0316('0xb'));var deskjs=require(_0x0316('0xc'));var toCsv=require(_0x0316('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0316('0xe'));var qs=require(_0x0316('0xf'));var as=require(_0x0316('0x10'));var hardwareService=require(_0x0316('0x11'));var logger=require(_0x0316('0x12'))(_0x0316('0x13'));var utils=require(_0x0316('0x14'));var config=require(_0x0316('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0316('0x16'))['db'];function respondWithStatusCode(_0x399f1a,_0x509205){_0x509205=_0x509205||0xcc;return function(_0x1a318d){if(_0x1a318d){return _0x399f1a[_0x0316('0x17')](_0x509205);}return _0x399f1a['status'](_0x509205)['end']();};}function respondWithResult(_0x49b67f,_0x560479){_0x560479=_0x560479||0xc8;return function(_0x59d09a){if(_0x59d09a){return _0x49b67f[_0x0316('0x18')](_0x560479)[_0x0316('0x19')](_0x59d09a);}};}function respondWithFilteredResult(_0x3ba443,_0x4bacf5){return function(_0x1d7bff){if(_0x1d7bff){var _0x17cf05=typeof _0x4bacf5['offset']==='undefined'&&typeof _0x4bacf5['limit']===_0x0316('0x1a');var _0x350b7f=_0x1d7bff[_0x0316('0x1b')];var _0x15df52=_0x17cf05?0x0:_0x4bacf5[_0x0316('0x1c')];var _0xc3aba8=_0x17cf05?_0x1d7bff[_0x0316('0x1b')]:_0x4bacf5['offset']+_0x4bacf5[_0x0316('0x1d')];var _0x276a90;if(_0xc3aba8>=_0x350b7f){_0xc3aba8=_0x350b7f;_0x276a90=0xc8;}else{_0x276a90=0xce;}_0x3ba443['status'](_0x276a90);return _0x3ba443[_0x0316('0x1e')](_0x0316('0x1f'),_0x15df52+'-'+_0xc3aba8+'/'+_0x350b7f)['json'](_0x1d7bff);}return null;};}function patchUpdates(_0x53b9a6){return function(_0x5eaeab){try{jsonpatch[_0x0316('0x20')](_0x5eaeab,_0x53b9a6,!![]);}catch(_0x575416){return BPromise[_0x0316('0x21')](_0x575416);}return _0x5eaeab['save']();};}function saveUpdates(_0x164a3c,_0x2acef4){return function(_0x2a4730){if(_0x2a4730){return _0x2a4730[_0x0316('0x22')](_0x164a3c)[_0x0316('0x23')](function(_0x263ff3){return _0x263ff3;});}return null;};}function removeEntity(_0x2d0871,_0x22949d){return function(_0x3e519b){if(_0x3e519b){return _0x3e519b['destroy']()[_0x0316('0x23')](function(){_0x2d0871['status'](0xcc)[_0x0316('0x24')]();});}};}function handleEntityNotFound(_0x1f3f62,_0x4bf9f6){return function(_0xd1fd33){if(!_0xd1fd33){_0x1f3f62['sendStatus'](0x194);}return _0xd1fd33;};}function handleError(_0x11b4e8,_0x584445){_0x584445=_0x584445||0x1f4;return function(_0x411b4d){logger[_0x0316('0x25')](_0x411b4d[_0x0316('0x26')]);if(_0x411b4d[_0x0316('0x27')]){delete _0x411b4d[_0x0316('0x27')];}_0x11b4e8[_0x0316('0x18')](_0x584445)[_0x0316('0x28')](_0x411b4d);};}exports[_0x0316('0x29')]=function(_0x19bfa3,_0x353aae){var _0x54e503={},_0x43cf51={},_0x39abdd={'count':0x0,'rows':[]};var _0x9c2f08=_[_0x0316('0x2a')](db[_0x0316('0x2b')][_0x0316('0x2c')],function(_0x3e05f8){return{'name':_0x3e05f8[_0x0316('0x2d')],'type':_0x3e05f8[_0x0316('0x2e')]['key']};});_0x43cf51[_0x0316('0x2f')]=_[_0x0316('0x2a')](_0x9c2f08,'name');_0x43cf51['query']=_['keys'](_0x19bfa3[_0x0316('0x30')]);_0x43cf51[_0x0316('0x31')]=_[_0x0316('0x32')](_0x43cf51[_0x0316('0x2f')],_0x43cf51[_0x0316('0x30')]);_0x54e503[_0x0316('0x33')]=_[_0x0316('0x32')](_0x43cf51['model'],qs[_0x0316('0x34')](_0x19bfa3[_0x0316('0x30')][_0x0316('0x34')]));_0x54e503['attributes']=_0x54e503[_0x0316('0x33')]['length']?_0x54e503[_0x0316('0x33')]:_0x43cf51['model'];if(!_0x19bfa3['query'][_0x0316('0x35')]('nolimit')){_0x54e503[_0x0316('0x1d')]=qs[_0x0316('0x1d')](_0x19bfa3[_0x0316('0x30')][_0x0316('0x1d')]);_0x54e503[_0x0316('0x1c')]=qs['offset'](_0x19bfa3[_0x0316('0x30')][_0x0316('0x1c')]);}_0x54e503[_0x0316('0x36')]=qs['sort'](_0x19bfa3[_0x0316('0x30')][_0x0316('0x37')]);_0x54e503['where']=qs['filters'](_[_0x0316('0x38')](_0x19bfa3[_0x0316('0x30')],_0x43cf51[_0x0316('0x31')]),_0x9c2f08);if(_0x19bfa3[_0x0316('0x30')][_0x0316('0x39')]){_0x54e503['where']=_[_0x0316('0x3a')](_0x54e503['where'],{'$or':_[_0x0316('0x2a')](_0x9c2f08,function(_0x310822){if(_0x310822[_0x0316('0x2e')]!==_0x0316('0x3b')){var _0x1a9611={};_0x1a9611[_0x310822[_0x0316('0x27')]]={'$like':'%'+_0x19bfa3[_0x0316('0x30')][_0x0316('0x39')]+'%'};return _0x1a9611;}})});}_0x54e503=_[_0x0316('0x3a')]({},_0x54e503,_0x19bfa3[_0x0316('0x3c')]);var _0x1051b3={'where':_0x54e503[_0x0316('0x3d')]};return db[_0x0316('0x2b')]['count'](_0x1051b3)[_0x0316('0x23')](function(_0x4078c4){_0x39abdd[_0x0316('0x1b')]=_0x4078c4;if(_0x19bfa3[_0x0316('0x30')]['includeAll']){_0x54e503[_0x0316('0x3e')]=[{'all':!![]}];}return db[_0x0316('0x2b')][_0x0316('0x3f')](_0x54e503);})[_0x0316('0x23')](function(_0x34fef1){_0x39abdd['rows']=_0x34fef1;return _0x39abdd;})[_0x0316('0x23')](respondWithFilteredResult(_0x353aae,_0x54e503))[_0x0316('0x40')](handleError(_0x353aae,null));};exports[_0x0316('0x41')]=function(_0x1fff85,_0x5701b1){var _0x1d48cc={'raw':!![],'where':{'id':_0x1fff85[_0x0316('0x42')]['id']}},_0x5914e6={};_0x5914e6['model']=_[_0x0316('0x43')](db[_0x0316('0x2b')][_0x0316('0x2c')]);_0x5914e6[_0x0316('0x30')]=_[_0x0316('0x43')](_0x1fff85[_0x0316('0x30')]);_0x5914e6[_0x0316('0x31')]=_[_0x0316('0x32')](_0x5914e6[_0x0316('0x2f')],_0x5914e6[_0x0316('0x30')]);_0x1d48cc[_0x0316('0x33')]=_[_0x0316('0x32')](_0x5914e6['model'],qs[_0x0316('0x34')](_0x1fff85[_0x0316('0x30')][_0x0316('0x34')]));_0x1d48cc[_0x0316('0x33')]=_0x1d48cc[_0x0316('0x33')][_0x0316('0x44')]?_0x1d48cc[_0x0316('0x33')]:_0x5914e6[_0x0316('0x2f')];if(_0x1fff85['query'][_0x0316('0x45')]){_0x1d48cc[_0x0316('0x3e')]=[{'all':!![]}];}_0x1d48cc=_[_0x0316('0x3a')]({},_0x1d48cc,_0x1fff85[_0x0316('0x3c')]);return db[_0x0316('0x2b')][_0x0316('0x46')](_0x1d48cc)[_0x0316('0x23')](handleEntityNotFound(_0x5701b1,null))['then'](respondWithResult(_0x5701b1,null))[_0x0316('0x40')](handleError(_0x5701b1,null));};exports['create']=function(_0x410594,_0x2e3207){return db[_0x0316('0x2b')][_0x0316('0x47')](_0x410594[_0x0316('0x48')],{})[_0x0316('0x23')](respondWithResult(_0x2e3207,0xc9))['catch'](handleError(_0x2e3207,null));};exports[_0x0316('0x22')]=function(_0x401e47,_0x521fa8){if(_0x401e47[_0x0316('0x48')]['id']){delete _0x401e47[_0x0316('0x48')]['id'];}return db[_0x0316('0x2b')][_0x0316('0x46')]({'where':{'id':_0x401e47[_0x0316('0x42')]['id']}})[_0x0316('0x23')](handleEntityNotFound(_0x521fa8,null))[_0x0316('0x23')](saveUpdates(_0x401e47[_0x0316('0x48')],null))[_0x0316('0x23')](respondWithResult(_0x521fa8,null))['catch'](handleError(_0x521fa8,null));};exports['destroy']=function(_0x59152a,_0x2ec5c2){return db[_0x0316('0x2b')][_0x0316('0x46')]({'where':{'id':_0x59152a[_0x0316('0x42')]['id']}})[_0x0316('0x23')](handleEntityNotFound(_0x2ec5c2,null))[_0x0316('0x23')](removeEntity(_0x2ec5c2,null))['catch'](handleError(_0x2ec5c2,null));};exports[_0x0316('0x49')]=function(_0x1d36f9,_0x49f7cb){return db[_0x0316('0x2b')]['describe']()['then'](respondWithResult(_0x49f7cb,null))['catch'](handleError(_0x49f7cb,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5c74bef..c08acaa 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 _0x0d07=['VoiceDialReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x0d07,0x9c));var _0x70d0=function(_0x434010,_0x591dd5){_0x434010=_0x434010-0x0;var _0x37cab1=_0x0d07[_0x434010];return _0x37cab1;};'use strict';var _=require('lodash');var util=require(_0x70d0('0x0'));var logger=require(_0x70d0('0x1'))(_0x70d0('0x2'));var moment=require(_0x70d0('0x3'));var BPromise=require(_0x70d0('0x4'));var rp=require(_0x70d0('0x5'));var fs=require('fs');var path=require(_0x70d0('0x6'));var rimraf=require(_0x70d0('0x7'));var config=require(_0x70d0('0x8'));var attributes=require(_0x70d0('0x9'));module[_0x70d0('0xa')]=function(_0x13c906,_0xc2bda6){return _0x13c906[_0x70d0('0xb')](_0x70d0('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x70d0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad68=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1bd5ee,_0x319c5c){var _0x52610d=function(_0x132ed1){while(--_0x132ed1){_0x1bd5ee['push'](_0x1bd5ee['shift']());}};_0x52610d(++_0x319c5c);}(_0xad68,0x102));var _0x8ad6=function(_0x26a515,_0x286339){_0x26a515=_0x26a515-0x0;var _0x314682=_0xad68[_0x26a515];return _0x314682;};'use strict';var _=require(_0x8ad6('0x0'));var util=require(_0x8ad6('0x1'));var logger=require(_0x8ad6('0x2'))(_0x8ad6('0x3'));var moment=require('moment');var BPromise=require(_0x8ad6('0x4'));var rp=require(_0x8ad6('0x5'));var fs=require('fs');var path=require(_0x8ad6('0x6'));var rimraf=require(_0x8ad6('0x7'));var config=require(_0x8ad6('0x8'));var attributes=require(_0x8ad6('0x9'));module[_0x8ad6('0xa')]=function(_0x4cc20e,_0x2ac999){return _0x4cc20e['define']('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x8ad6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 0b54c50..74c7528 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 _0xa53c=['VoiceDialReport','create','body','options','raw','stringify','catch','UpdateVoiceDialReport','update','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','CreateVoiceDialReport'];(function(_0x3e2261,_0x43c227){var _0x339e41=function(_0x41fa91){while(--_0x41fa91){_0x3e2261['push'](_0x3e2261['shift']());}};_0x339e41(++_0x43c227);}(_0xa53c,0x1bc));var _0xca53=function(_0x369c1e,_0x55f23a){_0x369c1e=_0x369c1e-0x0;var _0xd630f3=_0xa53c[_0x369c1e];return _0xd630f3;};'use strict';var _=require(_0xca53('0x0'));var util=require(_0xca53('0x1'));var moment=require(_0xca53('0x2'));var BPromise=require('bluebird');var rs=require(_0xca53('0x3'));var fs=require('fs');var Redis=require(_0xca53('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca53('0x5'));var logger=require(_0xca53('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xca53('0x7')][_0xca53('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c07ba,_0xb96eaa,_0x4c7f0c){return new BPromise(function(_0x319054,_0x42faad){return client[_0xca53('0x9')](_0x1c07ba,_0x4c7f0c)[_0xca53('0xa')](function(_0x2a86ec){logger[_0xca53('0xb')](_0xca53('0xc'),_0xb96eaa,'request\x20sent');logger[_0xca53('0xd')](_0xca53('0xe'),_0xb96eaa,'request\x20sent',JSON['stringify'](_0x2a86ec));if(_0x2a86ec['error']){if(_0x2a86ec['error'][_0xca53('0xf')]===0x1f4){logger[_0xca53('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0xb96eaa,_0x2a86ec[_0xca53('0x10')][_0xca53('0x11')]);return _0x42faad(_0x2a86ec[_0xca53('0x10')][_0xca53('0x11')]);}logger[_0xca53('0x10')](_0xca53('0xc'),_0xb96eaa,_0x2a86ec[_0xca53('0x10')][_0xca53('0x11')]);return _0x319054(_0x2a86ec[_0xca53('0x10')][_0xca53('0x11')]);}else{logger[_0xca53('0xb')](_0xca53('0xc'),_0xb96eaa,_0xca53('0x12'));_0x319054(_0x2a86ec[_0xca53('0x13')][_0xca53('0x11')]);}})['catch'](function(_0x175c3a){logger['error'](_0xca53('0xc'),_0xb96eaa,_0x175c3a);_0x42faad(_0x175c3a);});});}exports[_0xca53('0x14')]=function(_0x10d261){var _0x478442=this;return new Promise(function(_0x1f3435,_0x419d6c){return db[_0xca53('0x15')][_0xca53('0x16')](_0x10d261[_0xca53('0x17')],{'raw':_0x10d261[_0xca53('0x18')]?_0x10d261[_0xca53('0x18')][_0xca53('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4c80c2){logger[_0xca53('0xb')]('CreateVoiceDialReport',_0x10d261);logger[_0xca53('0xd')](_0xca53('0x14'),_0x10d261,JSON[_0xca53('0x1a')](_0x4c80c2));_0x1f3435(_0x4c80c2);})[_0xca53('0x1b')](function(_0x4ec8a0){logger[_0xca53('0x10')](_0xca53('0x14'),_0x4ec8a0[_0xca53('0x11')],_0x10d261);_0x419d6c(_0x478442[_0xca53('0x10')](0x1f4,_0x4ec8a0['message']));});});};exports[_0xca53('0x1c')]=function(_0x26b335){var _0x4fa823=this;return new Promise(function(_0x30e169,_0x1236f6){return db[_0xca53('0x15')][_0xca53('0x1d')](_0x26b335[_0xca53('0x17')],{'raw':_0x26b335[_0xca53('0x18')]?_0x26b335[_0xca53('0x18')][_0xca53('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26b335[_0xca53('0x18')]?_0x26b335[_0xca53('0x18')]['where']||null:null,'attributes':_0x26b335['options']?_0x26b335[_0xca53('0x18')]['attributes']||null:null,'limit':_0x26b335[_0xca53('0x18')]?_0x26b335[_0xca53('0x18')][_0xca53('0x1e')]||null:null})[_0xca53('0xa')](function(_0xe31fee){logger['info'](_0xca53('0x1c'),_0x26b335);logger[_0xca53('0xd')]('UpdateVoiceDialReport',_0x26b335,JSON['stringify'](_0xe31fee));_0x30e169(_0xe31fee);})[_0xca53('0x1b')](function(_0x422235){logger[_0xca53('0x10')](_0xca53('0x1c'),_0x422235[_0xca53('0x11')],_0x26b335);_0x1236f6(_0x4fa823['error'](0x1f4,_0x422235[_0xca53('0x11')]));});});}; \ No newline at end of file +var _0x0f0d=['limit','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','body','raw','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','update','options','where'];(function(_0x5738c4,_0x54bd3b){var _0x323b64=function(_0x3bf81f){while(--_0x3bf81f){_0x5738c4['push'](_0x5738c4['shift']());}};_0x323b64(++_0x54bd3b);}(_0x0f0d,0x75));var _0xd0f0=function(_0x435150,_0x591cd9){_0x435150=_0x435150-0x0;var _0x13b3a4=_0x0f0d[_0x435150];return _0x13b3a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd0f0('0x0'));var rs=require(_0xd0f0('0x1'));var fs=require('fs');var Redis=require(_0xd0f0('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd0f0('0x3'));var config=require(_0xd0f0('0x4'));var jayson=require(_0xd0f0('0x5'));var client=jayson[_0xd0f0('0x6')][_0xd0f0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b1685,_0x2e714f,_0x31f848){return new BPromise(function(_0x172542,_0x113917){return client[_0xd0f0('0x8')](_0x3b1685,_0x31f848)[_0xd0f0('0x9')](function(_0x2c030d){logger[_0xd0f0('0xa')](_0xd0f0('0xb'),_0x2e714f,_0xd0f0('0xc'));logger[_0xd0f0('0xd')](_0xd0f0('0xe'),_0x2e714f,_0xd0f0('0xc'),JSON[_0xd0f0('0xf')](_0x2c030d));if(_0x2c030d[_0xd0f0('0x10')]){if(_0x2c030d[_0xd0f0('0x10')][_0xd0f0('0x11')]===0x1f4){logger[_0xd0f0('0x10')](_0xd0f0('0xb'),_0x2e714f,_0x2c030d['error'][_0xd0f0('0x12')]);return _0x113917(_0x2c030d[_0xd0f0('0x10')][_0xd0f0('0x12')]);}logger[_0xd0f0('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x2e714f,_0x2c030d[_0xd0f0('0x10')][_0xd0f0('0x12')]);return _0x172542(_0x2c030d['error'][_0xd0f0('0x12')]);}else{logger[_0xd0f0('0xa')](_0xd0f0('0xb'),_0x2e714f,_0xd0f0('0xc'));_0x172542(_0x2c030d['result'][_0xd0f0('0x12')]);}})[_0xd0f0('0x13')](function(_0x3d4f83){logger[_0xd0f0('0x10')](_0xd0f0('0xb'),_0x2e714f,_0x3d4f83);_0x113917(_0x3d4f83);});});}exports['CreateVoiceDialReport']=function(_0x1d0110){var _0x4a6508=this;return new Promise(function(_0x24423c,_0x31dc06){return db['VoiceDialReport']['create'](_0x1d0110[_0xd0f0('0x14')],{'raw':_0x1d0110['options']?_0x1d0110['options'][_0xd0f0('0x15')]===undefined?!![]:![]:!![]})[_0xd0f0('0x9')](function(_0x4e52bc){logger[_0xd0f0('0xa')](_0xd0f0('0x16'),_0x1d0110);logger[_0xd0f0('0xd')](_0xd0f0('0x16'),_0x1d0110,JSON[_0xd0f0('0xf')](_0x4e52bc));_0x24423c(_0x4e52bc);})[_0xd0f0('0x13')](function(_0x10cd41){logger['error'](_0xd0f0('0x16'),_0x10cd41[_0xd0f0('0x12')],_0x1d0110);_0x31dc06(_0x4a6508[_0xd0f0('0x10')](0x1f4,_0x10cd41[_0xd0f0('0x12')]));});});};exports[_0xd0f0('0x17')]=function(_0x8972b8){var _0x39cce1=this;return new Promise(function(_0x21560b,_0x2e7bbf){return db[_0xd0f0('0x18')][_0xd0f0('0x19')](_0x8972b8[_0xd0f0('0x14')],{'raw':_0x8972b8[_0xd0f0('0x1a')]?_0x8972b8['options'][_0xd0f0('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8972b8[_0xd0f0('0x1a')]?_0x8972b8[_0xd0f0('0x1a')][_0xd0f0('0x1b')]||null:null,'attributes':_0x8972b8[_0xd0f0('0x1a')]?_0x8972b8['options']['attributes']||null:null,'limit':_0x8972b8['options']?_0x8972b8['options'][_0xd0f0('0x1c')]||null:null})['then'](function(_0x43dd52){logger['info'](_0xd0f0('0x17'),_0x8972b8);logger[_0xd0f0('0xd')](_0xd0f0('0x17'),_0x8972b8,JSON[_0xd0f0('0xf')](_0x43dd52));_0x21560b(_0x43dd52);})[_0xd0f0('0x13')](function(_0x125d14){logger[_0xd0f0('0x10')](_0xd0f0('0x17'),_0x125d14[_0xd0f0('0x12')],_0x8972b8);_0x2e7bbf(_0x39cce1[_0xd0f0('0x10')](0x1f4,_0x125d14[_0xd0f0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index b76274f..618f494 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 _0xd3d3=['./voiceExtension.controller','get','index','isAuthenticated','show','post','create','/:id/applications','addApplications','put','update','delete','/:id','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2dc53c,_0x4a29ce){var _0x32ea88=function(_0x159135){while(--_0x159135){_0x2dc53c['push'](_0x2dc53c['shift']());}};_0x32ea88(++_0x4a29ce);}(_0xd3d3,0xe0));var _0x3d3d=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xd3d3[_0x1762b4];return _0x29beda;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3d3d('0x0'));var timeout=require(_0x3d3d('0x1'));var express=require(_0x3d3d('0x2'));var router=express[_0x3d3d('0x3')]();var fs_extra=require(_0x3d3d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3d3d('0x5'));var config=require(_0x3d3d('0x6'));var controller=require(_0x3d3d('0x7'));router[_0x3d3d('0x8')]('/',auth['isAuthenticated'](),controller[_0x3d3d('0x9')]);router[_0x3d3d('0x8')]('/:id',auth[_0x3d3d('0xa')](),controller[_0x3d3d('0xb')]);router[_0x3d3d('0xc')]('/',auth[_0x3d3d('0xa')](),controller[_0x3d3d('0xd')]);router[_0x3d3d('0xc')](_0x3d3d('0xe'),auth[_0x3d3d('0xa')](),controller[_0x3d3d('0xf')]);router[_0x3d3d('0x10')]('/:id',auth[_0x3d3d('0xa')](),controller[_0x3d3d('0x11')]);router[_0x3d3d('0x12')](_0x3d3d('0x13'),auth[_0x3d3d('0xa')](),controller['destroy']);module[_0x3d3d('0x14')]=router; \ No newline at end of file +var _0xa15d=['../../components/interaction/service','get','index','/:id','isAuthenticated','create','post','addApplications','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x562947,_0x495513){var _0x1de3c9=function(_0xecec62){while(--_0xecec62){_0x562947['push'](_0x562947['shift']());}};_0x1de3c9(++_0x495513);}(_0xa15d,0x8a));var _0xda15=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xa15d[_0x270adf];return _0x29eda9;};'use strict';var multer=require(_0xda15('0x0'));var util=require(_0xda15('0x1'));var path=require(_0xda15('0x2'));var timeout=require('connect-timeout');var express=require(_0xda15('0x3'));var router=express[_0xda15('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda15('0x5'));var interaction=require(_0xda15('0x6'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xda15('0x7')]('/',auth['isAuthenticated'](),controller[_0xda15('0x8')]);router['get'](_0xda15('0x9'),auth[_0xda15('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xda15('0xb')]);router[_0xda15('0xc')]('/:id/applications',auth[_0xda15('0xa')](),controller[_0xda15('0xd')]);router[_0xda15('0xe')](_0xda15('0x9'),auth[_0xda15('0xa')](),controller[_0xda15('0xf')]);router['delete'](_0xda15('0x9'),auth['isAuthenticated'](),controller[_0xda15('0x10')]);module[_0xda15('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 3172736..56e40bf 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 _0x5334=['wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN'];(function(_0x2b9a22,_0x3bc0cf){var _0x565e1a=function(_0x41650c){while(--_0x41650c){_0x2b9a22['push'](_0x2b9a22['shift']());}};_0x565e1a(++_0x3bc0cf);}(_0x5334,0x1cc));var _0x4533=function(_0x53df25,_0x2a7f81){_0x53df25=_0x53df25-0x0;var _0x434a1b=_0x5334[_0x53df25];return _0x434a1b;};'use strict';var Sequelize=require(_0x4533('0x0'));module[_0x4533('0x1')]={'context':{'type':Sequelize[_0x4533('0x2')],'allowNull':![],'unique':_0x4533('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4533('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x4533('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4533('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x4533('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4533('0x4')](_0x4533('0x5'),_0x4533('0x6'),_0x4533('0x7'),_0x4533('0x8'),_0x4533('0x9'),_0x4533('0xa'),_0x4533('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x4533('0x2')]},'interval':{'type':Sequelize[_0x4533('0x2')],'allowNull':![],'defaultValue':_0x4533('0xc')},'IntervalId':{'type':Sequelize[_0x4533('0xd')]},'isApp':{'type':Sequelize[_0x4533('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x4533('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4533('0xd')]},'recordingFormat':{'type':Sequelize[_0x4533('0x2')],'defaultValue':_0x4533('0xf')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x4533('0x10')],'get':function(_0x251008){return this[_0x4533('0x11')](_0x4533('0x12'));}},'alias':{'type':Sequelize[_0x4533('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x8faa=['STRING','compositeIndex','inbound','outbound','inbound-fax','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports'];(function(_0x15841a,_0x146606){var _0x482191=function(_0x17ca3e){while(--_0x17ca3e){_0x15841a['push'](_0x15841a['shift']());}};_0x482191(++_0x146606);}(_0x8faa,0x140));var _0xa8fa=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0x8faa[_0x51bb38];return _0x51c09b;};'use strict';var Sequelize=require(_0xa8fa('0x0'));module[_0xa8fa('0x1')]={'context':{'type':Sequelize[_0xa8fa('0x2')],'allowNull':![],'unique':_0xa8fa('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa8fa('0x2')],'allowNull':![],'unique':_0xa8fa('0x3')},'priority':{'type':Sequelize[_0xa8fa('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xa8fa('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa8fa('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xa8fa('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xa8fa('0x4'),_0xa8fa('0x5'),'internal',_0xa8fa('0x6'),'outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa8fa('0x2')],'allowNull':![],'defaultValue':_0xa8fa('0x7')},'IntervalId':{'type':Sequelize[_0xa8fa('0x8')]},'isApp':{'type':Sequelize[_0xa8fa('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa8fa('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xa8fa('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xa8fa('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xa8fa('0xa')},'answer':{'type':Sequelize[_0xa8fa('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0xa8fa('0xb')],'get':function(_0x5d34d2){return this[_0xa8fa('0xc')](_0xa8fa('0xd'));}},'alias':{'type':Sequelize[_0xa8fa('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index a1fa5cb..6412603 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 _0x124c=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','OutboundRoutes','internal','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','priority','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','inbound','outbound','InternalRoutes','filter','ignore','map','value','includes','type','name','UserProfileResource','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','params','startsWith','body','exten','concat'];(function(_0x112c84,_0x4adb79){var _0x5c93a5=function(_0x4d57cf){while(--_0x4d57cf){_0x112c84['push'](_0x112c84['shift']());}};_0x5c93a5(++_0x4adb79);}(_0x124c,0x1f1));var _0xc124=function(_0x34ba47,_0x3858e3){_0x34ba47=_0x34ba47-0x0;var _0xa76c3c=_0x124c[_0x34ba47];return _0xa76c3c;};'use strict';var _=require(_0xc124('0x0'));var Redis=require(_0xc124('0x1'));var qs=require(_0xc124('0x2'));var logger=require('../../config/logger')(_0xc124('0x3'));var config=require(_0xc124('0x4'));var db=require('../../mysqldb')['db'];config[_0xc124('0x5')]=_['defaults'](config[_0xc124('0x5')],{'host':_0xc124('0x6'),'port':0x18eb});var socket=require(_0xc124('0x7'))(new Redis(config['redis']));require(_0xc124('0x8'))['register'](socket);function respondWithStatusCode(_0xea35ac,_0x44ad5a){_0x44ad5a=_0x44ad5a||0xcc;return function(_0x2d7102){if(_0x2d7102){return _0xea35ac[_0xc124('0x9')](_0x44ad5a);}return _0xea35ac[_0xc124('0xa')](_0x44ad5a)[_0xc124('0xb')]();};}function respondWithResult(_0x391d4b,_0x56aba6){_0x56aba6=_0x56aba6||0xc8;return function(_0x3de2d2){if(_0x3de2d2){return _0x391d4b[_0xc124('0xa')](_0x56aba6)[_0xc124('0xc')](_0x3de2d2);}};}function respondWithFilteredResult(_0x1c343f,_0x459ee6){return function(_0x18ed64){if(_0x18ed64){var _0x2ea40b=typeof _0x459ee6[_0xc124('0xd')]===_0xc124('0xe')&&typeof _0x459ee6['limit']==='undefined';var _0x29786c=_0x18ed64['count'];var _0x2e09d5=_0x2ea40b?0x0:_0x459ee6[_0xc124('0xd')];var _0x2595ad=_0x2ea40b?_0x18ed64[_0xc124('0xf')]:_0x459ee6['offset']+_0x459ee6[_0xc124('0x10')];var _0x1d1348;if(_0x2595ad>=_0x29786c){_0x2595ad=_0x29786c;_0x1d1348=0xc8;}else{_0x1d1348=0xce;}_0x1c343f['status'](_0x1d1348);return _0x1c343f[_0xc124('0x11')](_0xc124('0x12'),_0x2e09d5+'-'+_0x2595ad+'/'+_0x29786c)[_0xc124('0xc')](_0x18ed64);}return null;};}function removeEntity(_0xe65c39){return function(_0x1d9d4a){if(_0x1d9d4a){return _0x1d9d4a[_0xc124('0x13')]()[_0xc124('0x14')](function(){var _0x1c9523=_0x1d9d4a[_0xc124('0x15')]({'plain':!![]});var _0x45d615=[{'name':'InboundRoutes','value':_0xc124('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0xc124('0x17'),'ignore':![]},{'name':_0xc124('0x18'),'value':'internal','ignore':![]}];var _0x2d2913=_(_0x45d615)[_0xc124('0x19')](_0xc124('0x1a'))[_0xc124('0x1b')](_0xc124('0x1c'))['value']();if(_[_0xc124('0x1d')](_0x2d2913,_0x1c9523[_0xc124('0x1e')])){return;}var _0x446589=_['find'](_0x45d615,[_0xc124('0x1c'),_0x1c9523[_0xc124('0x1e')]])[_0xc124('0x1f')];return db[_0xc124('0x20')][_0xc124('0x13')]({'where':{'type':_0x446589,'resourceId':_0x1c9523['id']}})[_0xc124('0x14')](function(){return _0x1d9d4a;});})[_0xc124('0x14')](function(){_0xe65c39['status'](0xcc)[_0xc124('0xb')]();});}};}function handleEntityNotFound(_0x643948){return function(_0x161c49){if(!_0x161c49){_0x643948[_0xc124('0x9')](0x194);}return _0x161c49;};}function handleError(_0x56b826,_0x58820a){_0x58820a=_0x58820a||0x1f4;return function(_0x473f4f){logger['error'](_0x473f4f[_0xc124('0x21')]);if(_0x473f4f[_0xc124('0x1f')]){delete _0x473f4f[_0xc124('0x1f')];}_0x56b826['status'](_0x58820a)[_0xc124('0x22')](_0x473f4f);};}exports[_0xc124('0x23')]=function(_0x597f35,_0x2a53fd){var _0xd925f6={},_0x200af4={},_0x3c9f42={'count':0x0,'rows':[]};var _0x4dac75=_['map'](db[_0xc124('0x24')][_0xc124('0x25')],function(_0x5ae0c2){return{'name':_0x5ae0c2[_0xc124('0x26')],'type':_0x5ae0c2[_0xc124('0x1e')][_0xc124('0x27')]};});_0x200af4[_0xc124('0x28')]=_[_0xc124('0x1b')](_0x4dac75,'name');_0x200af4['query']=_[_0xc124('0x29')](_0x597f35['query']);_0x200af4['filters']=_[_0xc124('0x2a')](_0x200af4['model'],_0x200af4[_0xc124('0x2b')]);_0xd925f6[_0xc124('0x2c')]=_[_0xc124('0x2a')](_0x200af4[_0xc124('0x28')],qs[_0xc124('0x2d')](_0x597f35[_0xc124('0x2b')][_0xc124('0x2d')]));_0xd925f6['attributes']=_0xd925f6[_0xc124('0x2c')][_0xc124('0x2e')]?_0xd925f6['attributes']:_0x200af4['model'];if(!_0x597f35[_0xc124('0x2b')][_0xc124('0x2f')](_0xc124('0x30'))){_0xd925f6[_0xc124('0x10')]=qs['limit'](_0x597f35[_0xc124('0x2b')][_0xc124('0x10')]);_0xd925f6['offset']=qs[_0xc124('0xd')](_0x597f35[_0xc124('0x2b')][_0xc124('0xd')]);}_0xd925f6['order']=qs[_0xc124('0x31')](_0x597f35['query'][_0xc124('0x31')]);_0xd925f6[_0xc124('0x32')]=qs[_0xc124('0x33')](_[_0xc124('0x34')](_0x597f35[_0xc124('0x2b')],_0x200af4[_0xc124('0x33')]),_0x4dac75);if(_0x597f35[_0xc124('0x2b')][_0xc124('0x19')]){_0xd925f6[_0xc124('0x32')]=_[_0xc124('0x35')](_0xd925f6[_0xc124('0x32')],{'$or':_['map'](_0x4dac75,function(_0x33e79c){if(_0x33e79c[_0xc124('0x1e')]!==_0xc124('0x36')){var _0x254bcc={};_0x254bcc[_0x33e79c[_0xc124('0x1f')]]={'$like':'%'+_0x597f35['query']['filter']+'%'};return _0x254bcc;}})});}_0xd925f6=_[_0xc124('0x35')]({},_0xd925f6,_0x597f35[_0xc124('0x37')]);var _0x43cc28={'where':_0xd925f6[_0xc124('0x32')]};return db['VoiceExtension']['count'](_0x43cc28)[_0xc124('0x14')](function(_0x3060cf){_0x3c9f42[_0xc124('0xf')]=_0x3060cf;if(_0x597f35['query']['includeAll']){_0xd925f6[_0xc124('0x38')]=[{'all':!![]}];}return db[_0xc124('0x24')][_0xc124('0x39')](_0xd925f6);})[_0xc124('0x14')](function(_0x52958e){_0x3c9f42[_0xc124('0x3a')]=_0x52958e;return _0x3c9f42;})[_0xc124('0x14')](respondWithFilteredResult(_0x2a53fd,_0xd925f6))[_0xc124('0x3b')](handleError(_0x2a53fd,null));};exports['show']=function(_0x80d448,_0x1eed3f){var _0xfe1b7a={'raw':![],'where':{'id':_0x80d448['params']['id']}},_0x41c8c6={};_0x41c8c6[_0xc124('0x28')]=_[_0xc124('0x29')](db[_0xc124('0x24')][_0xc124('0x25')]);_0x41c8c6[_0xc124('0x2b')]=_[_0xc124('0x29')](_0x80d448['query']);_0x41c8c6[_0xc124('0x33')]=_[_0xc124('0x2a')](_0x41c8c6[_0xc124('0x28')],_0x41c8c6['query']);_0xfe1b7a['attributes']=_[_0xc124('0x2a')](_0x41c8c6[_0xc124('0x28')],qs['fields'](_0x80d448[_0xc124('0x2b')][_0xc124('0x2d')]));_0xfe1b7a[_0xc124('0x2c')]=_0xfe1b7a[_0xc124('0x2c')][_0xc124('0x2e')]?_0xfe1b7a[_0xc124('0x2c')]:_0x41c8c6['model'];if(_0x80d448['query'][_0xc124('0x3c')]){_0xfe1b7a[_0xc124('0x38')]=[{'all':!![]}];}_0xfe1b7a=_[_0xc124('0x35')]({},_0xfe1b7a,_0x80d448[_0xc124('0x37')]);return db[_0xc124('0x24')][_0xc124('0x3d')](_0xfe1b7a)[_0xc124('0x14')](handleEntityNotFound(_0x1eed3f,null))['then'](respondWithResult(_0x1eed3f,null))['catch'](handleError(_0x1eed3f,null));};exports[_0xc124('0x13')]=function(_0x50e234,_0x5c1dc9){return db[_0xc124('0x24')][_0xc124('0x3d')]({'where':{'id':_0x50e234[_0xc124('0x3e')]['id']}})[_0xc124('0x14')](handleEntityNotFound(_0x5c1dc9,null))[_0xc124('0x14')](removeEntity(_0x5c1dc9,null))[_0xc124('0x3b')](handleError(_0x5c1dc9,null));};exports['create']=function(_0x110f03,_0x530db3){if(_0x110f03['body']['type']==='outbound'&&!_[_0xc124('0x3f')](_0x110f03[_0xc124('0x40')]['exten'],'_')){_0x110f03[_0xc124('0x40')][_0xc124('0x41')]='_'[_0xc124('0x42')](_0x110f03[_0xc124('0x40')]['exten']);}return db[_0xc124('0x24')][_0xc124('0x43')](_0x110f03[_0xc124('0x40')],{'raw':![]})[_0xc124('0x14')](function(_0x37726e){var _0x142906=_0x110f03[_0xc124('0x44')][_0xc124('0x15')]({'plain':!![]});if(!_0x142906)throw new Error(_0xc124('0x45'));if(_0x142906['role']===_0xc124('0x44')){var _0x5ea16f=_0x37726e['get']({'plain':!![]});var _0x2cdf79=[{'name':_0xc124('0x46'),'value':'inbound'},{'name':_0xc124('0x47'),'value':'outbound'},{'name':_0xc124('0x18'),'value':_0xc124('0x48')}];var _0x21d3bc=_['find'](_0x2cdf79,[_0xc124('0x1c'),_0x5ea16f['type']])['name'];return db['UserProfileSection'][_0xc124('0x3d')]({'where':{'name':_0x21d3bc,'userProfileId':_0x142906[_0xc124('0x49')]},'raw':!![]})[_0xc124('0x14')](function(_0x1b13e9){if(_0x1b13e9&&_0x1b13e9[_0xc124('0x4a')]===0x0){return db[_0xc124('0x20')][_0xc124('0x43')]({'name':_0x5ea16f[_0xc124('0x1f')],'resourceId':_0x5ea16f['id'],'type':_0x1b13e9[_0xc124('0x1f')],'sectionId':_0x1b13e9['id']},{})['then'](function(){return _0x37726e;});}else{return _0x37726e;}})[_0xc124('0x3b')](function(_0x134c5d){logger[_0xc124('0x4b')](_0xc124('0x4c'),_0x134c5d);throw _0x134c5d;});}return _0x37726e;})[_0xc124('0x14')](respondWithResult(_0x530db3,0xc9))[_0xc124('0x3b')](handleError(_0x530db3,null));};exports['update']=function(_0xe4373e,_0x2cc658){if(_0xe4373e[_0xc124('0x40')]['id']){delete _0xe4373e[_0xc124('0x40')]['id'];}return db[_0xc124('0x24')]['find']({'where':{'id':_0xe4373e[_0xc124('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2cc658,null))[_0xc124('0x14')](function(_0x199e56){if(_0x199e56){return db[_0xc124('0x24')][_0xc124('0x4d')](_['pick'](_0xe4373e['body'],['exten','context',_0xc124('0x4e'),_0xc124('0x4f'),'cutdigits',_0xc124('0x50'),_0xc124('0x51')]),{'where':{'context':_0x199e56['context'],'exten':_0x199e56['exten']},'individualHooks':!![]})[_0xc124('0x14')](function(_0x427921){return _0x427921;});}return null;})['then'](respondWithStatusCode(_0x2cc658,null))['catch'](handleError(_0x2cc658,null));};exports[_0xc124('0x52')]=function(_0x57264f,_0x3d4b4b){var _0xdbead6=_0x57264f[_0xc124('0x3e')]['id'];var _0x364bd0=_0x57264f[_0xc124('0x40')];var _0x4ee856=0xc8;var _0x10ff01=null;return db[_0xc124('0x53')]['transaction']({'isolationLevel':db[_0xc124('0x53')][_0xc124('0x54')][_0xc124('0x55')][_0xc124('0x56')]},function(_0x4e3afc){return db[_0xc124('0x24')][_0xc124('0x57')]({'where':{'id':_0xdbead6},'transaction':_0x4e3afc})[_0xc124('0x14')](function(_0x30415b){if(_0x30415b){return db['VoiceExtension'][_0xc124('0x13')]({'where':{'VoiceExtensionId':_0xdbead6},'transaction':_0x4e3afc})[_0xc124('0x14')](function(){var _0x575a91=_[_0xc124('0x1b')](_0x364bd0,function(_0x4f1b3b){_0x4f1b3b[_0xc124('0x58')]=_0xdbead6;_0x4f1b3b[_0xc124('0x59')]=!![];return _0x4f1b3b;});return _0x30415b[_0xc124('0x5a')](_0x575a91);})[_0xc124('0x14')](function(_0x3dec35){return db[_0xc124('0x24')]['bulkCreate'](_0x3dec35,{'transaction':_0x4e3afc});});}else{_0x4ee856=0x194;_0x10ff01=[];}});})[_0xc124('0x14')](function(){if(_0x4ee856!==0x194){return db['VoiceExtension'][_0xc124('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0xdbead6},'order':_0xc124('0x5c')})[_0xc124('0x14')](function(_0x54e31b){_0x10ff01=_0x54e31b;});}})[_0xc124('0x3b')](function(_0x24f6ab){_0x4ee856=0x1f4;logger[_0xc124('0x4b')](_0x24f6ab[_0xc124('0x21')]);if(_0x24f6ab[_0xc124('0x1f')]){delete _0x24f6ab[_0xc124('0x1f')];}_0x10ff01=_0x24f6ab;})[_0xc124('0x5d')](function(){if(_0x10ff01===null){_0x3d4b4b[_0xc124('0x9')](_0x4ee856);}else{if(_0x4ee856===0x1f4){_0x3d4b4b[_0xc124('0xa')](_0x4ee856)['send'](_0x10ff01);}else{_0x3d4b4b[_0xc124('0xa')](_0x4ee856)[_0xc124('0xc')](_0x10ff01);}}});}; \ No newline at end of file +var _0x9eec=['fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','rows','catch','show','body','startsWith','exten','concat','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','InternalRoutes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','description','recordingFormat','mandatoryDisposition','context','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','priority','stack','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','limit','undefined','count','set','Content-Range','then','inbound','OutboundRoutes','outbound','internal','filter','map','value','type','find','name','destroy','end','error','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x3518b6,_0x1d6005){var _0x55a221=function(_0x25ebfa){while(--_0x25ebfa){_0x3518b6['push'](_0x3518b6['shift']());}};_0x55a221(++_0x1d6005);}(_0x9eec,0x1ab));var _0xc9ee=function(_0x6c0747,_0x5295b8){_0x6c0747=_0x6c0747-0x0;var _0x588994=_0x9eec[_0x6c0747];return _0x588994;};'use strict';var _=require(_0xc9ee('0x0'));var Redis=require(_0xc9ee('0x1'));var qs=require(_0xc9ee('0x2'));var logger=require(_0xc9ee('0x3'))(_0xc9ee('0x4'));var config=require(_0xc9ee('0x5'));var db=require('../../mysqldb')['db'];config[_0xc9ee('0x6')]=_[_0xc9ee('0x7')](config[_0xc9ee('0x6')],{'host':_0xc9ee('0x8'),'port':0x18eb});var socket=require(_0xc9ee('0x9'))(new Redis(config[_0xc9ee('0x6')]));require(_0xc9ee('0xa'))[_0xc9ee('0xb')](socket);function respondWithStatusCode(_0x46a61b,_0x49224d){_0x49224d=_0x49224d||0xcc;return function(_0x4e5b34){if(_0x4e5b34){return _0x46a61b[_0xc9ee('0xc')](_0x49224d);}return _0x46a61b[_0xc9ee('0xd')](_0x49224d)['end']();};}function respondWithResult(_0x2ac0d3,_0x29cd83){_0x29cd83=_0x29cd83||0xc8;return function(_0x126d96){if(_0x126d96){return _0x2ac0d3[_0xc9ee('0xd')](_0x29cd83)[_0xc9ee('0xe')](_0x126d96);}};}function respondWithFilteredResult(_0x5dd4c8,_0x10a081){return function(_0x36b1a4){if(_0x36b1a4){var _0xd536cd=typeof _0x10a081['offset']==='undefined'&&typeof _0x10a081[_0xc9ee('0xf')]===_0xc9ee('0x10');var _0x43ff0a=_0x36b1a4['count'];var _0x459cc3=_0xd536cd?0x0:_0x10a081['offset'];var _0x354eb2=_0xd536cd?_0x36b1a4[_0xc9ee('0x11')]:_0x10a081['offset']+_0x10a081[_0xc9ee('0xf')];var _0x325806;if(_0x354eb2>=_0x43ff0a){_0x354eb2=_0x43ff0a;_0x325806=0xc8;}else{_0x325806=0xce;}_0x5dd4c8['status'](_0x325806);return _0x5dd4c8[_0xc9ee('0x12')](_0xc9ee('0x13'),_0x459cc3+'-'+_0x354eb2+'/'+_0x43ff0a)[_0xc9ee('0xe')](_0x36b1a4);}return null;};}function removeEntity(_0x4063d1){return function(_0x3e7d0e){if(_0x3e7d0e){return _0x3e7d0e['destroy']()[_0xc9ee('0x14')](function(){var _0x505e33=_0x3e7d0e['get']({'plain':!![]});var _0x31130e=[{'name':'InboundRoutes','value':_0xc9ee('0x15'),'ignore':![]},{'name':_0xc9ee('0x16'),'value':_0xc9ee('0x17'),'ignore':![]},{'name':'InternalRoutes','value':_0xc9ee('0x18'),'ignore':![]}];var _0x249301=_(_0x31130e)[_0xc9ee('0x19')]('ignore')[_0xc9ee('0x1a')](_0xc9ee('0x1b'))['value']();if(_['includes'](_0x249301,_0x505e33[_0xc9ee('0x1c')])){return;}var _0x753d0f=_[_0xc9ee('0x1d')](_0x31130e,[_0xc9ee('0x1b'),_0x505e33[_0xc9ee('0x1c')]])[_0xc9ee('0x1e')];return db['UserProfileResource'][_0xc9ee('0x1f')]({'where':{'type':_0x753d0f,'resourceId':_0x505e33['id']}})[_0xc9ee('0x14')](function(){return _0x3e7d0e;});})[_0xc9ee('0x14')](function(){_0x4063d1['status'](0xcc)[_0xc9ee('0x20')]();});}};}function handleEntityNotFound(_0x4ee6bf){return function(_0x1a5bbf){if(!_0x1a5bbf){_0x4ee6bf[_0xc9ee('0xc')](0x194);}return _0x1a5bbf;};}function handleError(_0x471039,_0x37f47f){_0x37f47f=_0x37f47f||0x1f4;return function(_0x1fa3fe){logger[_0xc9ee('0x21')](_0x1fa3fe['stack']);if(_0x1fa3fe[_0xc9ee('0x1e')]){delete _0x1fa3fe[_0xc9ee('0x1e')];}_0x471039[_0xc9ee('0xd')](_0x37f47f)['send'](_0x1fa3fe);};}exports['index']=function(_0x50aa65,_0x52d945){var _0xc3d99={},_0x227792={},_0x9ed723={'count':0x0,'rows':[]};var _0x22cf93=_[_0xc9ee('0x1a')](db['VoiceExtension'][_0xc9ee('0x22')],function(_0x47089e){return{'name':_0x47089e[_0xc9ee('0x23')],'type':_0x47089e[_0xc9ee('0x1c')][_0xc9ee('0x24')]};});_0x227792[_0xc9ee('0x25')]=_[_0xc9ee('0x1a')](_0x22cf93,'name');_0x227792[_0xc9ee('0x26')]=_[_0xc9ee('0x27')](_0x50aa65[_0xc9ee('0x26')]);_0x227792[_0xc9ee('0x28')]=_[_0xc9ee('0x29')](_0x227792['model'],_0x227792['query']);_0xc3d99[_0xc9ee('0x2a')]=_[_0xc9ee('0x29')](_0x227792[_0xc9ee('0x25')],qs[_0xc9ee('0x2b')](_0x50aa65[_0xc9ee('0x26')][_0xc9ee('0x2b')]));_0xc3d99[_0xc9ee('0x2a')]=_0xc3d99[_0xc9ee('0x2a')][_0xc9ee('0x2c')]?_0xc3d99[_0xc9ee('0x2a')]:_0x227792[_0xc9ee('0x25')];if(!_0x50aa65[_0xc9ee('0x26')][_0xc9ee('0x2d')](_0xc9ee('0x2e'))){_0xc3d99[_0xc9ee('0xf')]=qs['limit'](_0x50aa65[_0xc9ee('0x26')][_0xc9ee('0xf')]);_0xc3d99['offset']=qs[_0xc9ee('0x2f')](_0x50aa65[_0xc9ee('0x26')][_0xc9ee('0x2f')]);}_0xc3d99[_0xc9ee('0x30')]=qs[_0xc9ee('0x31')](_0x50aa65[_0xc9ee('0x26')][_0xc9ee('0x31')]);_0xc3d99[_0xc9ee('0x32')]=qs[_0xc9ee('0x28')](_[_0xc9ee('0x33')](_0x50aa65[_0xc9ee('0x26')],_0x227792[_0xc9ee('0x28')]),_0x22cf93);if(_0x50aa65['query'][_0xc9ee('0x19')]){_0xc3d99[_0xc9ee('0x32')]=_[_0xc9ee('0x34')](_0xc3d99[_0xc9ee('0x32')],{'$or':_[_0xc9ee('0x1a')](_0x22cf93,function(_0x33056d){if(_0x33056d[_0xc9ee('0x1c')]!==_0xc9ee('0x35')){var _0x3e78d8={};_0x3e78d8[_0x33056d[_0xc9ee('0x1e')]]={'$like':'%'+_0x50aa65['query'][_0xc9ee('0x19')]+'%'};return _0x3e78d8;}})});}_0xc3d99=_[_0xc9ee('0x34')]({},_0xc3d99,_0x50aa65[_0xc9ee('0x36')]);var _0x2b60eb={'where':_0xc3d99['where']};return db[_0xc9ee('0x37')][_0xc9ee('0x11')](_0x2b60eb)[_0xc9ee('0x14')](function(_0x3ae911){_0x9ed723[_0xc9ee('0x11')]=_0x3ae911;if(_0x50aa65[_0xc9ee('0x26')][_0xc9ee('0x38')]){_0xc3d99[_0xc9ee('0x39')]=[{'all':!![]}];}return db[_0xc9ee('0x37')]['findAll'](_0xc3d99);})[_0xc9ee('0x14')](function(_0x50b9b2){_0x9ed723[_0xc9ee('0x3a')]=_0x50b9b2;return _0x9ed723;})[_0xc9ee('0x14')](respondWithFilteredResult(_0x52d945,_0xc3d99))[_0xc9ee('0x3b')](handleError(_0x52d945,null));};exports[_0xc9ee('0x3c')]=function(_0x3f90d1,_0x3c2291){var _0x562fbb={'raw':![],'where':{'id':_0x3f90d1['params']['id']}},_0x25160e={};_0x25160e[_0xc9ee('0x25')]=_[_0xc9ee('0x27')](db[_0xc9ee('0x37')][_0xc9ee('0x22')]);_0x25160e[_0xc9ee('0x26')]=_[_0xc9ee('0x27')](_0x3f90d1[_0xc9ee('0x26')]);_0x25160e[_0xc9ee('0x28')]=_[_0xc9ee('0x29')](_0x25160e['model'],_0x25160e[_0xc9ee('0x26')]);_0x562fbb['attributes']=_[_0xc9ee('0x29')](_0x25160e[_0xc9ee('0x25')],qs['fields'](_0x3f90d1[_0xc9ee('0x26')][_0xc9ee('0x2b')]));_0x562fbb[_0xc9ee('0x2a')]=_0x562fbb[_0xc9ee('0x2a')]['length']?_0x562fbb[_0xc9ee('0x2a')]:_0x25160e[_0xc9ee('0x25')];if(_0x3f90d1[_0xc9ee('0x26')][_0xc9ee('0x38')]){_0x562fbb['include']=[{'all':!![]}];}_0x562fbb=_[_0xc9ee('0x34')]({},_0x562fbb,_0x3f90d1[_0xc9ee('0x36')]);return db[_0xc9ee('0x37')][_0xc9ee('0x1d')](_0x562fbb)['then'](handleEntityNotFound(_0x3c2291,null))[_0xc9ee('0x14')](respondWithResult(_0x3c2291,null))[_0xc9ee('0x3b')](handleError(_0x3c2291,null));};exports[_0xc9ee('0x1f')]=function(_0x16b344,_0x47c7ca){return db[_0xc9ee('0x37')][_0xc9ee('0x1d')]({'where':{'id':_0x16b344['params']['id']}})[_0xc9ee('0x14')](handleEntityNotFound(_0x47c7ca,null))[_0xc9ee('0x14')](removeEntity(_0x47c7ca,null))['catch'](handleError(_0x47c7ca,null));};exports['create']=function(_0xf9aa2,_0x4f7713){if(_0xf9aa2[_0xc9ee('0x3d')][_0xc9ee('0x1c')]===_0xc9ee('0x17')&&!_[_0xc9ee('0x3e')](_0xf9aa2['body'][_0xc9ee('0x3f')],'_')){_0xf9aa2['body'][_0xc9ee('0x3f')]='_'[_0xc9ee('0x40')](_0xf9aa2[_0xc9ee('0x3d')][_0xc9ee('0x3f')]);}return db[_0xc9ee('0x37')][_0xc9ee('0x41')](_0xf9aa2[_0xc9ee('0x3d')],{'raw':![]})[_0xc9ee('0x14')](function(_0x26d08d){var _0x4124fb=_0xf9aa2['user'][_0xc9ee('0x42')]({'plain':!![]});if(!_0x4124fb)throw new Error(_0xc9ee('0x43'));if(_0x4124fb[_0xc9ee('0x44')]==='user'){var _0x309ab8=_0x26d08d['get']({'plain':!![]});var _0x23f13a=[{'name':_0xc9ee('0x45'),'value':'inbound'},{'name':_0xc9ee('0x16'),'value':'outbound'},{'name':_0xc9ee('0x46'),'value':_0xc9ee('0x18')}];var _0xe22170=_[_0xc9ee('0x1d')](_0x23f13a,[_0xc9ee('0x1b'),_0x309ab8[_0xc9ee('0x1c')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0xe22170,'userProfileId':_0x4124fb[_0xc9ee('0x47')]},'raw':!![]})[_0xc9ee('0x14')](function(_0xd03785){if(_0xd03785&&_0xd03785[_0xc9ee('0x48')]===0x0){return db[_0xc9ee('0x49')][_0xc9ee('0x41')]({'name':_0x309ab8[_0xc9ee('0x1e')],'resourceId':_0x309ab8['id'],'type':_0xd03785[_0xc9ee('0x1e')],'sectionId':_0xd03785['id']},{})['then'](function(){return _0x26d08d;});}else{return _0x26d08d;}})[_0xc9ee('0x3b')](function(_0x55e075){logger[_0xc9ee('0x21')](_0xc9ee('0x4a'),_0x55e075);throw _0x55e075;});}return _0x26d08d;})[_0xc9ee('0x14')](respondWithResult(_0x4f7713,0xc9))[_0xc9ee('0x3b')](handleError(_0x4f7713,null));};exports[_0xc9ee('0x4b')]=function(_0x552fd0,_0x338f93){if(_0x552fd0[_0xc9ee('0x3d')]['id']){delete _0x552fd0[_0xc9ee('0x3d')]['id'];}return db['VoiceExtension'][_0xc9ee('0x1d')]({'where':{'id':_0x552fd0[_0xc9ee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x338f93,null))[_0xc9ee('0x14')](function(_0x55e5e6){if(_0x55e5e6){return db[_0xc9ee('0x37')][_0xc9ee('0x4b')](_[_0xc9ee('0x33')](_0x552fd0['body'],[_0xc9ee('0x3f'),'context',_0xc9ee('0x4d'),_0xc9ee('0x4e'),'cutdigits',_0xc9ee('0x4f'),'alias']),{'where':{'context':_0x55e5e6[_0xc9ee('0x50')],'exten':_0x55e5e6['exten']},'individualHooks':!![]})[_0xc9ee('0x14')](function(_0x35f8e0){return _0x35f8e0;});}return null;})[_0xc9ee('0x14')](respondWithStatusCode(_0x338f93,null))[_0xc9ee('0x3b')](handleError(_0x338f93,null));};exports[_0xc9ee('0x51')]=function(_0x32344a,_0x11a768){var _0x34ff79=_0x32344a['params']['id'];var _0x155150=_0x32344a['body'];var _0x2c3983=0xc8;var _0x15b91f=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xc9ee('0x52')][_0xc9ee('0x53')][_0xc9ee('0x54')][_0xc9ee('0x55')]},function(_0x5a59e9){return db[_0xc9ee('0x37')]['findOne']({'where':{'id':_0x34ff79},'transaction':_0x5a59e9})[_0xc9ee('0x14')](function(_0x36e825){if(_0x36e825){return db[_0xc9ee('0x37')][_0xc9ee('0x1f')]({'where':{'VoiceExtensionId':_0x34ff79},'transaction':_0x5a59e9})[_0xc9ee('0x14')](function(){var _0x3992b6=_[_0xc9ee('0x1a')](_0x155150,function(_0x2d7e87){_0x2d7e87[_0xc9ee('0x56')]=_0x34ff79;_0x2d7e87[_0xc9ee('0x57')]=!![];return _0x2d7e87;});return _0x36e825['createRouting'](_0x3992b6);})[_0xc9ee('0x14')](function(_0x30a883){return db[_0xc9ee('0x37')][_0xc9ee('0x58')](_0x30a883,{'transaction':_0x5a59e9});});}else{_0x2c3983=0x194;_0x15b91f=[];}});})[_0xc9ee('0x14')](function(){if(_0x2c3983!==0x194){return db[_0xc9ee('0x37')][_0xc9ee('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x34ff79},'order':_0xc9ee('0x5a')})['then'](function(_0x53bc0f){_0x15b91f=_0x53bc0f;});}})[_0xc9ee('0x3b')](function(_0x190fcf){_0x2c3983=0x1f4;logger[_0xc9ee('0x21')](_0x190fcf[_0xc9ee('0x5b')]);if(_0x190fcf[_0xc9ee('0x1e')]){delete _0x190fcf[_0xc9ee('0x1e')];}_0x15b91f=_0x190fcf;})[_0xc9ee('0x5c')](function(){if(_0x15b91f===null){_0x11a768[_0xc9ee('0xc')](_0x2c3983);}else{if(_0x2c3983===0x1f4){_0x11a768[_0xc9ee('0xd')](_0x2c3983)[_0xc9ee('0x5d')](_0x15b91f);}else{_0x11a768['status'](_0x2c3983)['json'](_0x15b91f);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 662d788..82bc713 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 _0x047c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x282d58,_0x3f2b63){var _0x84c8eb=function(_0x16d800){while(--_0x16d800){_0x282d58['push'](_0x282d58['shift']());}};_0x84c8eb(++_0x3f2b63);}(_0x047c,0x110));var _0xc047=function(_0x4f7bc4,_0x1bcc07){_0x4f7bc4=_0x4f7bc4-0x0;var _0x3b347f=_0x047c[_0x4f7bc4];return _0x3b347f;};'use strict';var EventEmitter=require(_0xc047('0x0'));var VoiceExtension=require(_0xc047('0x1'))['db'][_0xc047('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc047('0x3')](0x0);var events={'afterCreate':_0xc047('0x4'),'afterUpdate':_0xc047('0x5'),'afterDestroy':_0xc047('0x6')};function emitEvent(_0x5bc770){return function(_0x4c6e76,_0xdc4143,_0x331813){VoiceExtensionEvents[_0xc047('0x7')](_0x5bc770+':'+_0x4c6e76['id'],_0x4c6e76);VoiceExtensionEvents[_0xc047('0x7')](_0x5bc770,_0x4c6e76);_0x331813(null);};}for(var e in events){if(events[_0xc047('0x8')](e)){var event=events[e];VoiceExtension[_0xc047('0x9')](e,emitEvent(event));}}module[_0xc047('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x5dc7=['save','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x7fbacc,_0x3da0a6){var _0x31ca68=function(_0x1a3a8b){while(--_0x1a3a8b){_0x7fbacc['push'](_0x7fbacc['shift']());}};_0x31ca68(++_0x3da0a6);}(_0x5dc7,0x1a2));var _0x75dc=function(_0x1d3816,_0x1b6eef){_0x1d3816=_0x1d3816-0x0;var _0x4335f7=_0x5dc7[_0x1d3816];return _0x4335f7;};'use strict';var EventEmitter=require(_0x75dc('0x0'));var VoiceExtension=require(_0x75dc('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x75dc('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x94f5b9){return function(_0x7813da,_0x1d31ba,_0x10277d){VoiceExtensionEvents['emit'](_0x94f5b9+':'+_0x7813da['id'],_0x7813da);VoiceExtensionEvents['emit'](_0x94f5b9,_0x7813da);_0x10277d(null);};}for(var e in events){if(events[_0x75dc('0x3')](e)){var event=events[e];VoiceExtension[_0x75dc('0x4')](e,emitEvent(event));}}module[_0x75dc('0x5')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 37bde68..0e7a1e6 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 _0x8a5c=['app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','length','name','trunk','param','phone','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','*,*,*,*','intervals','IntervalId','map','hasOwnProperty','tag','toLowerCase','CDR(tag)=','ExecIf','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback'];(function(_0x30810d,_0x1fb5cf){var _0x424597=function(_0x2c8da6){while(--_0x2c8da6){_0x30810d['push'](_0x30810d['shift']());}};_0x424597(++_0x1fb5cf);}(_0x8a5c,0x112));var _0xc8a5=function(_0x49879e,_0x15dd83){_0x49879e=_0x49879e-0x0;var _0x16961b=_0x8a5c[_0x49879e];return _0x16961b;};'use strict';var _=require('lodash');var attributes=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]=function(_0x1d3f89){var _0x21c90d=_0x1d3f89[_0xc8a5('0x2')];function _0x4d1b58(_0xe06918){var _0x2f628e=0x2;var _0x5e4dda=[{'type':_0xe06918[_0xc8a5('0x3')],'app':'Set','appdata':_0xc8a5('0x4')+_0xe06918[_0xc8a5('0x3')],'context':_0xe06918[_0xc8a5('0x5')],'exten':_0xe06918[_0xc8a5('0x6')],'priority':_0x2f628e++,'VoiceExtensionId':_0xe06918['id']},{'type':_0xe06918[_0xc8a5('0x3')],'app':_0xe06918[_0xc8a5('0x7')]?_0xc8a5('0x8'):_0xc8a5('0x9'),'appdata':_0xe06918[_0xc8a5('0x7')]?_0xc8a5('0xa')+_0xe06918[_0xc8a5('0x7')]:_0xc8a5('0xb'),'context':_0xe06918[_0xc8a5('0x5')],'exten':_0xe06918[_0xc8a5('0x6')],'priority':_0x2f628e++,'VoiceExtensionId':_0xe06918['id']}];if(_0xe06918[_0xc8a5('0x3')]===_0xc8a5('0xc')){_0x5e4dda[_0xc8a5('0xd')]({'type':_0xc8a5('0xc'),'app':_0xc8a5('0x8'),'appdata':_0xc8a5('0xe')+_0xe06918['id'],'context':_0xe06918['context'],'exten':_0xe06918[_0xc8a5('0x6')],'priority':_0x2f628e++,'VoiceExtensionId':_0xe06918['id']});}_0x5e4dda['push']({'type':_0xe06918[_0xc8a5('0x3')],'app':_0xc8a5('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xe06918[_0xc8a5('0x5')],'exten':_0xe06918['exten'],'priority':_0x2f628e++,'VoiceExtensionId':_0xe06918['id']},{'type':_0xe06918['type'],'app':'Set','appdata':_0xc8a5('0xf'),'context':_0xe06918['context'],'exten':_0xe06918[_0xc8a5('0x6')],'priority':_0x2f628e++,'VoiceExtensionId':_0xe06918['id']},{'type':_0xe06918[_0xc8a5('0x3')],'app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x10'),'context':_0xe06918[_0xc8a5('0x5')],'exten':_0xe06918[_0xc8a5('0x6')],'priority':_0x2f628e++,'VoiceExtensionId':_0xe06918['id']});return _0x5e4dda;}function _0x39e72c(_0x8e92cf){var _0x15e97b=0x2;var _0x35ce57=[{'type':_0xc8a5('0x11'),'app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x12'),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf['exten'],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':_0xc8a5('0x11'),'app':_0x8e92cf['alias']?'Set':_0xc8a5('0x9'),'appdata':_0x8e92cf[_0xc8a5('0x7')]?_0xc8a5('0xa')+_0x8e92cf[_0xc8a5('0x7')]:_0xc8a5('0xb'),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf[_0xc8a5('0x6')],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':_0xc8a5('0x11'),'app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x13')+(_0x8e92cf[_0xc8a5('0x14')]?'${EXTEN:'+_0x8e92cf[_0xc8a5('0x14')]+'}':_0xc8a5('0x15')),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf[_0xc8a5('0x6')],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':_0xc8a5('0x11'),'app':'Set','appdata':_0xc8a5('0xe')+_0x8e92cf['id'],'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf[_0xc8a5('0x6')],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':_0xc8a5('0x11'),'app':'ExecIf','appdata':_0xc8a5('0x16')+(_0x15e97b+0x2)+_0xc8a5('0x17')+(_0x15e97b+0x1)+')','context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf[_0xc8a5('0x6')],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':_0xc8a5('0x11'),'app':_0xc8a5('0x8'),'appdata':_0x8e92cf[_0xc8a5('0x14')]?_0xc8a5('0x18')+_0x8e92cf[_0xc8a5('0x14')]+'}':_0xc8a5('0x19'),'context':_0x8e92cf['context'],'exten':_0x8e92cf['exten'],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':'outbound','app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x1a'),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf[_0xc8a5('0x6')],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':'outbound','app':_0xc8a5('0x8'),'appdata':_0xc8a5('0xf'),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf['exten'],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':'outbound','app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x10'),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf['exten'],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':_0xc8a5('0x11'),'app':_0xc8a5('0x8'),'appdata':'outboundrouteid='+_0x8e92cf['id'],'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf[_0xc8a5('0x6')],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']}];if(_0x8e92cf['hasOwnProperty'](_0xc8a5('0x1b'))&&_0x8e92cf[_0xc8a5('0x1b')]!==_0xc8a5('0x1c')){_0x35ce57[_0xc8a5('0xd')]({'type':_0xc8a5('0x11'),'app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x1d'),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf['exten'],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']},{'type':_0xc8a5('0x11'),'app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x1e')+_0x8e92cf['recordingFormat']||_0xc8a5('0x1f'),'context':_0x8e92cf[_0xc8a5('0x5')],'exten':_0x8e92cf['exten'],'priority':_0x15e97b++,'VoiceExtensionId':_0x8e92cf['id']});}return _0x35ce57;}function _0xa1c270(_0x4c83d2,_0x323ef4){var _0x5e0b9d=[{'name':'trunk','param':0x0},{'name':_0xc8a5('0x20'),'param':0x1},{'name':_0xc8a5('0x21'),'param':0x2},{'name':_0xc8a5('0x22'),'param':0x3}];var _0x2645f4={};var _0x4df526=_0x323ef4[_0xc8a5('0x23')](',');var _0x441a02=[];for(var _0x24cf1a=0x0;_0x24cf1a<_0x5e0b9d[_0xc8a5('0x24')];_0x24cf1a++){switch(_0x5e0b9d[_0x24cf1a][_0xc8a5('0x25')]){case _0xc8a5('0x26'):_0x2645f4[_0xc8a5('0x26')]=_0x4df526[_0x5e0b9d[_0x24cf1a][_0xc8a5('0x27')]][_0xc8a5('0x23')]('/')[0x1];_0x2645f4[_0xc8a5('0x28')]=_0x4df526[_0x5e0b9d[_0x24cf1a][_0xc8a5('0x27')]][_0xc8a5('0x23')]('/')[0x2];_0x2645f4[_0xc8a5('0x29')]=_0x2645f4['phone']?_0x2645f4[_0xc8a5('0x28')]['split']('$')[0x0]:undefined;_0x2645f4[_0xc8a5('0x28')]=_0x4c83d2[_0xc8a5('0x14')]?(_0x2645f4[_0xc8a5('0x29')]||'')+_0xc8a5('0x2a')+_0x4c83d2[_0xc8a5('0x14')]+'}':(_0x2645f4[_0xc8a5('0x29')]||'')+_0xc8a5('0x15');_0x441a02[_0x5e0b9d[_0x24cf1a][_0xc8a5('0x27')]]=[_0xc8a5('0x2b'),_0x2645f4['trunk'],_0x2645f4['phone']][_0xc8a5('0x2c')]('/');break;case _0xc8a5('0x21'):_0x2645f4[_0xc8a5('0x21')]=_0x4df526[_0x5e0b9d[_0x24cf1a][_0xc8a5('0x27')]];if(_0x4c83d2['recordingFormat']!==_0xc8a5('0x1c')){if(_0x2645f4[_0xc8a5('0x21')][_0xc8a5('0x2d')](_0xc8a5('0x2e'))<0x0){_0x2645f4[_0xc8a5('0x21')]+=_0xc8a5('0x2e');}}else{_0x2645f4[_0xc8a5('0x21')]=_0x2645f4[_0xc8a5('0x21')][_0xc8a5('0x2f')](_0xc8a5('0x2e'),'');}_0x441a02[_0x5e0b9d[_0x24cf1a][_0xc8a5('0x27')]]=_0x2645f4['options'];break;default:_0x441a02[_0x5e0b9d[_0x24cf1a][_0xc8a5('0x27')]]=_0x4df526[_0x5e0b9d[_0x24cf1a][_0xc8a5('0x27')]];}}return _0x441a02[_0xc8a5('0x2c')](',');}function _0x52cb5d(_0x175df0,_0x327c8d,_0x14c6ad){return new Promise(function(_0x25eaad,_0x410954){var _0x13d876=[];if(_[_0xc8a5('0x30')](_0x327c8d))return _0x25eaad(_0x13d876);_0x21c90d['Interval'][_0xc8a5('0x31')]({'attributes':['id',_0xc8a5('0x32'),'IntervalId'],'raw':!![]})['then'](function(_0x447053){for(var _0x220cb5=0x0,_0x2d96d8=0x0;_0x220cb5<_0x327c8d[_0xc8a5('0x24')];_0x220cb5++,_0x2d96d8=0x0){var _0x309c2a=_0x327c8d[_0x220cb5];var _0x1076fb=[];var _0x27d3e5=[];delete _0x309c2a['id'];if(_0x309c2a[_0xc8a5('0x32')]!==_0xc8a5('0x33')){_0x309c2a[_0xc8a5('0x34')]=[_0x309c2a[_0xc8a5('0x32')]];}else{_0x309c2a[_0xc8a5('0x34')]=_0x309c2a[_0xc8a5('0x35')]?_[_0xc8a5('0x36')](_['filter'](_0x447053,{'IntervalId':_0x309c2a[_0xc8a5('0x35')]}),'interval'):[];}_0x309c2a[_0xc8a5('0x5')]=_0x175df0[_0xc8a5('0x5')];_0x309c2a[_0xc8a5('0x6')]=_0x175df0[_0xc8a5('0x6')];if(_0x309c2a[_0xc8a5('0x3')])_0x309c2a['type']=_0x309c2a[_0xc8a5('0x3')]['toLowerCase']();if(_0x175df0['type']===_0xc8a5('0x11')){if(_0x309c2a[_0xc8a5('0x37')](_0xc8a5('0x38'))&&_0x309c2a[_0xc8a5('0x38')]&&_0x309c2a[_0xc8a5('0x38')]!=='--'){_0x1076fb[_0xc8a5('0xd')]({'type':_0x309c2a[_0xc8a5('0x3')][_0xc8a5('0x39')](),'app':'Set','appdata':_0xc8a5('0x3a')+_0x309c2a[_0xc8a5('0x38')],'context':_0x175df0[_0xc8a5('0x5')],'exten':_0x175df0[_0xc8a5('0x6')],'priority':_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')]+_0x14c6ad+_0x2d96d8++,'VoiceExtensionId':_0x175df0['id']});}_0x1076fb['push']({'type':_0x309c2a[_0xc8a5('0x3')]['toLowerCase'](),'app':_0xc8a5('0x3b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x309c2a[_0xc8a5('0x3c')]?_0xc8a5('0x3d')+_0x309c2a[_0xc8a5('0x3c')]+')':_0xc8a5('0x3e')),'context':_0x175df0[_0xc8a5('0x5')],'exten':_0x175df0['exten'],'priority':_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')]+_0x14c6ad+_0x2d96d8++,'VoiceExtensionId':_0x175df0['id']});}else{if(_0x309c2a[_0xc8a5('0x37')](_0xc8a5('0x3f'))){if([_0xc8a5('0x40'),_0xc8a5('0x41')]['includes'](_0x309c2a[_0xc8a5('0x42')][_0xc8a5('0x39')]())&&_0x309c2a[_0xc8a5('0x43')]!==_0xc8a5('0x44')){if(_0x309c2a[_0xc8a5('0x3f')]){_0x1076fb[_0xc8a5('0xd')]({'type':_0x309c2a[_0xc8a5('0x3')][_0xc8a5('0x39')](),'app':_0xc8a5('0x3b'),'appdata':_0xc8a5('0x45'),'context':_0x175df0[_0xc8a5('0x5')],'exten':_0x175df0['exten'],'priority':_0x309c2a['intervals'][_0xc8a5('0x24')]+_0x14c6ad+_0x2d96d8++,'VoiceExtensionId':_0x175df0['id']});_0x1076fb[_0xc8a5('0xd')]({'type':_0x309c2a[_0xc8a5('0x3')][_0xc8a5('0x39')](),'app':'Set','appdata':_0xc8a5('0x46'),'context':_0x175df0[_0xc8a5('0x5')],'exten':_0x175df0[_0xc8a5('0x6')],'priority':_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')]+_0x14c6ad+_0x2d96d8++,'VoiceExtensionId':_0x175df0['id']});}else{_0x1076fb[_0xc8a5('0xd')]({'type':_0x309c2a[_0xc8a5('0x3')][_0xc8a5('0x39')](),'app':_0xc8a5('0x3b'),'appdata':_0xc8a5('0x47'),'context':_0x175df0[_0xc8a5('0x5')],'exten':_0x175df0[_0xc8a5('0x6')],'priority':_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')]+_0x14c6ad+_0x2d96d8++,'VoiceExtensionId':_0x175df0['id']});_0x1076fb[_0xc8a5('0xd')]({'type':_0x309c2a['type']['toLowerCase'](),'app':_0xc8a5('0x8'),'appdata':_0xc8a5('0x48'),'context':_0x175df0[_0xc8a5('0x5')],'exten':_0x175df0[_0xc8a5('0x6')],'priority':_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')]+_0x14c6ad+_0x2d96d8++,'VoiceExtensionId':_0x175df0['id']});}}}}for(var _0x3e1bb7=0x0;_0x3e1bb7<_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')];_0x3e1bb7++){var _0xd63ea3=_0x14c6ad+_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')];var _0x1aff3e=_0x3e1bb7===_0x309c2a[_0xc8a5('0x34')][_0xc8a5('0x24')]-0x1?_0x14c6ad+_0x1076fb[_0xc8a5('0x24')]+_0x27d3e5[_0xc8a5('0x24')]+0x2:_0x14c6ad+_0x3e1bb7+0x1;_0x1076fb[_0xc8a5('0x49')](_0x3e1bb7,0x0,{'type':_0x175df0['type'],'app':_0xc8a5('0x4a'),'appdata':_0x309c2a[_0xc8a5('0x34')][_0x3e1bb7]+'?'+_0x175df0['context']+',${EXTEN},'+_0xd63ea3+':'+_0x175df0[_0xc8a5('0x5')]+_0xc8a5('0x4b')+_0x1aff3e,'exten':_0x175df0[_0xc8a5('0x6')],'context':_0x175df0['context'],'priority':_0x14c6ad+_0x3e1bb7,'VoiceExtensionId':_0x175df0['id']});}if(_0x309c2a[_0xc8a5('0x43')]==='outboundDial')_0x309c2a[_0xc8a5('0x4c')]=_0xa1c270(_0x175df0,_0x309c2a[_0xc8a5('0x4c')]);_0x309c2a[_0xc8a5('0x4d')]=_0x1076fb[_0xc8a5('0x24')]?_[_0xc8a5('0x4e')](_0x1076fb)['priority']+0x1:_0x14c6ad;_0x13d876=_[_0xc8a5('0x4f')](_0x13d876,_0x1076fb,[_0x309c2a],_0x27d3e5);_0x14c6ad=_[_0xc8a5('0x4e')](_0x13d876)[_0xc8a5('0x4d')]+0x1;}return _0x25eaad(_0x13d876);})[_0xc8a5('0x50')](function(_0x3938de){_0x410954(_0x3938de);});});}return _0x1d3f89[_0xc8a5('0x51')](_0xc8a5('0x52'),attributes,{'tableName':_0xc8a5('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1e989f){var _0x2b6322=this['get']({'plain':!![]});var _0x147355=_0x2b6322[_0xc8a5('0x3')]===_0xc8a5('0x11')?_0x39e72c(_0x2b6322):_0x4d1b58(_0x2b6322);return _0x52cb5d(_0x2b6322,_0x1e989f,_[_0xc8a5('0x4e')](_0x147355)[_0xc8a5('0x4d')]+0x1)['then'](function(_0x273797){var _0x1be64f=_[_0xc8a5('0x4f')](_0x147355,_0x273797);_0x1be64f['push']({'type':_0x2b6322['type'],'app':_0xc8a5('0x54'),'exten':_0x2b6322[_0xc8a5('0x6')],'context':_0x2b6322[_0xc8a5('0x5')],'priority':_['last'](_0x1be64f)['priority']+0x1,'VoiceExtensionId':_0x2b6322['id']});return _0x1be64f;});}}});}; \ No newline at end of file +var _0xef8b=['XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','split','length','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','then','intervals','interval','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','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','last','priority','concat','catch','define','VoiceExtension','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','No\x20alias\x20set','inbound','push','outbound','CDR(type)=outbound','NoOp','CDR(routeAlias)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0'];(function(_0x2350dd,_0x53e293){var _0x5ca2db=function(_0x5dacc7){while(--_0x5dacc7){_0x2350dd['push'](_0x2350dd['shift']());}};_0x5ca2db(++_0x53e293);}(_0xef8b,0x192));var _0xbef8=function(_0x23c3f4,_0x24f0b3){_0x23c3f4=_0x23c3f4-0x0;var _0x82f0f1=_0xef8b[_0x23c3f4];return _0x82f0f1;};'use strict';var _=require('lodash');var attributes=require(_0xbef8('0x0'));module[_0xbef8('0x1')]=function(_0x98588a){var _0x3a3b14=_0x98588a[_0xbef8('0x2')];function _0x361696(_0x336519){var _0x224dd2=0x2;var _0x201996=[{'type':_0x336519[_0xbef8('0x3')],'app':_0xbef8('0x4'),'appdata':'CDR(type)='+_0x336519[_0xbef8('0x3')],'context':_0x336519[_0xbef8('0x5')],'exten':_0x336519[_0xbef8('0x6')],'priority':_0x224dd2++,'VoiceExtensionId':_0x336519['id']},{'type':_0x336519['type'],'app':_0x336519[_0xbef8('0x7')]?_0xbef8('0x4'):'NoOp','appdata':_0x336519['alias']?'CDR(routeAlias)='+_0x336519[_0xbef8('0x7')]:_0xbef8('0x8'),'context':_0x336519[_0xbef8('0x5')],'exten':_0x336519[_0xbef8('0x6')],'priority':_0x224dd2++,'VoiceExtensionId':_0x336519['id']}];if(_0x336519[_0xbef8('0x3')]===_0xbef8('0x9')){_0x201996[_0xbef8('0xa')]({'type':_0xbef8('0x9'),'app':_0xbef8('0x4'),'appdata':'CDR(routeid)='+_0x336519['id'],'context':_0x336519[_0xbef8('0x5')],'exten':_0x336519[_0xbef8('0x6')],'priority':_0x224dd2++,'VoiceExtensionId':_0x336519['id']});}_0x201996[_0xbef8('0xa')]({'type':_0x336519['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x336519[_0xbef8('0x5')],'exten':_0x336519['exten'],'priority':_0x224dd2++,'VoiceExtensionId':_0x336519['id']},{'type':_0x336519[_0xbef8('0x3')],'app':_0xbef8('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x336519[_0xbef8('0x5')],'exten':_0x336519['exten'],'priority':_0x224dd2++,'VoiceExtensionId':_0x336519['id']},{'type':_0x336519['type'],'app':_0xbef8('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x336519['context'],'exten':_0x336519[_0xbef8('0x6')],'priority':_0x224dd2++,'VoiceExtensionId':_0x336519['id']});return _0x201996;}function _0x1e8060(_0x29d084){var _0x321ad0=0x2;var _0x5d745b=[{'type':_0xbef8('0xb'),'app':'Set','appdata':_0xbef8('0xc'),'context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084['exten'],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':_0x29d084[_0xbef8('0x7')]?'Set':_0xbef8('0xd'),'appdata':_0x29d084[_0xbef8('0x7')]?_0xbef8('0xe')+_0x29d084['alias']:'No\x20alias\x20set','context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084[_0xbef8('0x6')],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':_0xbef8('0x4'),'appdata':'CDR(destination)='+(_0x29d084['cutdigits']?_0xbef8('0xf')+_0x29d084[_0xbef8('0x10')]+'}':_0xbef8('0x11')),'context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084[_0xbef8('0x6')],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':'outbound','app':_0xbef8('0x4'),'appdata':_0xbef8('0x12')+_0x29d084['id'],'context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084['exten'],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':'ExecIf','appdata':_0xbef8('0x13')+(_0x321ad0+0x2)+'):Goto('+(_0x321ad0+0x1)+')','context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084['exten'],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':'Set','appdata':_0x29d084[_0xbef8('0x10')]?_0xbef8('0x14')+_0x29d084[_0xbef8('0x10')]+'}':_0xbef8('0x15'),'context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084['exten'],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':_0xbef8('0x4'),'appdata':_0xbef8('0x16'),'context':_0x29d084['context'],'exten':_0x29d084[_0xbef8('0x6')],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':_0xbef8('0x4'),'appdata':_0xbef8('0x17'),'context':_0x29d084['context'],'exten':_0x29d084['exten'],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':_0xbef8('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084['exten'],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':'Set','appdata':_0xbef8('0x18')+_0x29d084['id'],'context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084[_0xbef8('0x6')],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']}];if(_0x29d084[_0xbef8('0x19')]('recordingFormat')&&_0x29d084[_0xbef8('0x1a')]!==_0xbef8('0x1b')){_0x5d745b[_0xbef8('0xa')]({'type':'outbound','app':'Set','appdata':_0xbef8('0x1c'),'context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084[_0xbef8('0x6')],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']},{'type':_0xbef8('0xb'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x29d084[_0xbef8('0x1a')]||_0xbef8('0x1d'),'context':_0x29d084[_0xbef8('0x5')],'exten':_0x29d084[_0xbef8('0x6')],'priority':_0x321ad0++,'VoiceExtensionId':_0x29d084['id']});}return _0x5d745b;}function _0x143002(_0x1c47e8,_0x5109db){var _0x56ab5e=[{'name':_0xbef8('0x1e'),'param':0x0},{'name':_0xbef8('0x1f'),'param':0x1},{'name':_0xbef8('0x20'),'param':0x2},{'name':_0xbef8('0x21'),'param':0x3}];var _0x31e5c1={};var _0x2fe527=_0x5109db[_0xbef8('0x22')](',');var _0x31a7b8=[];for(var _0x25d8f3=0x0;_0x25d8f3<_0x56ab5e[_0xbef8('0x23')];_0x25d8f3++){switch(_0x56ab5e[_0x25d8f3]['name']){case _0xbef8('0x1e'):_0x31e5c1[_0xbef8('0x1e')]=_0x2fe527[_0x56ab5e[_0x25d8f3]['param']]['split']('/')[0x1];_0x31e5c1['phone']=_0x2fe527[_0x56ab5e[_0x25d8f3][_0xbef8('0x24')]][_0xbef8('0x22')]('/')[0x2];_0x31e5c1['prefix']=_0x31e5c1[_0xbef8('0x25')]?_0x31e5c1['phone'][_0xbef8('0x22')]('$')[0x0]:undefined;_0x31e5c1[_0xbef8('0x25')]=_0x1c47e8[_0xbef8('0x10')]?(_0x31e5c1[_0xbef8('0x26')]||'')+_0xbef8('0xf')+_0x1c47e8[_0xbef8('0x10')]+'}':(_0x31e5c1[_0xbef8('0x26')]||'')+_0xbef8('0x11');_0x31a7b8[_0x56ab5e[_0x25d8f3][_0xbef8('0x24')]]=[_0xbef8('0x27'),_0x31e5c1[_0xbef8('0x1e')],_0x31e5c1[_0xbef8('0x25')]][_0xbef8('0x28')]('/');break;case _0xbef8('0x20'):_0x31e5c1[_0xbef8('0x20')]=_0x2fe527[_0x56ab5e[_0x25d8f3][_0xbef8('0x24')]];if(_0x1c47e8[_0xbef8('0x1a')]!=='none'){if(_0x31e5c1[_0xbef8('0x20')][_0xbef8('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x31e5c1['options']+=_0xbef8('0x2a');}}else{_0x31e5c1['options']=_0x31e5c1[_0xbef8('0x20')][_0xbef8('0x2b')](_0xbef8('0x2a'),'');}_0x31a7b8[_0x56ab5e[_0x25d8f3][_0xbef8('0x24')]]=_0x31e5c1['options'];break;default:_0x31a7b8[_0x56ab5e[_0x25d8f3][_0xbef8('0x24')]]=_0x2fe527[_0x56ab5e[_0x25d8f3][_0xbef8('0x24')]];}}return _0x31a7b8[_0xbef8('0x28')](',');}function _0x2fead2(_0x330026,_0x213b6b,_0x2e9855){return new Promise(function(_0x36ae81,_0x5e267f){var _0x145974=[];if(_[_0xbef8('0x2c')](_0x213b6b))return _0x36ae81(_0x145974);_0x3a3b14[_0xbef8('0x2d')][_0xbef8('0x2e')]({'attributes':['id','interval',_0xbef8('0x2f')],'raw':!![]})[_0xbef8('0x30')](function(_0x14d737){for(var _0x45059c=0x0,_0x4ae5d5=0x0;_0x45059c<_0x213b6b[_0xbef8('0x23')];_0x45059c++,_0x4ae5d5=0x0){var _0x3a0571=_0x213b6b[_0x45059c];var _0x251c00=[];var _0x161d7d=[];delete _0x3a0571['id'];if(_0x3a0571['interval']!=='*,*,*,*'){_0x3a0571[_0xbef8('0x31')]=[_0x3a0571[_0xbef8('0x32')]];}else{_0x3a0571[_0xbef8('0x31')]=_0x3a0571['IntervalId']?_[_0xbef8('0x33')](_[_0xbef8('0x34')](_0x14d737,{'IntervalId':_0x3a0571['IntervalId']}),_0xbef8('0x32')):[];}_0x3a0571[_0xbef8('0x5')]=_0x330026[_0xbef8('0x5')];_0x3a0571[_0xbef8('0x6')]=_0x330026[_0xbef8('0x6')];if(_0x3a0571[_0xbef8('0x3')])_0x3a0571['type']=_0x3a0571[_0xbef8('0x3')][_0xbef8('0x35')]();if(_0x330026['type']===_0xbef8('0xb')){if(_0x3a0571[_0xbef8('0x19')]('tag')&&_0x3a0571[_0xbef8('0x36')]&&_0x3a0571[_0xbef8('0x36')]!=='--'){_0x251c00[_0xbef8('0xa')]({'type':_0x3a0571[_0xbef8('0x3')][_0xbef8('0x35')](),'app':_0xbef8('0x4'),'appdata':_0xbef8('0x37')+_0x3a0571[_0xbef8('0x36')],'context':_0x330026['context'],'exten':_0x330026['exten'],'priority':_0x3a0571[_0xbef8('0x31')][_0xbef8('0x23')]+_0x2e9855+_0x4ae5d5++,'VoiceExtensionId':_0x330026['id']});}_0x251c00['push']({'type':_0x3a0571[_0xbef8('0x3')][_0xbef8('0x35')](),'app':_0xbef8('0x38'),'appdata':_0xbef8('0x39')+(_0x3a0571[_0xbef8('0x3a')]?_0xbef8('0x3b')+_0x3a0571[_0xbef8('0x3a')]+')':_0xbef8('0x3c')),'context':_0x330026[_0xbef8('0x5')],'exten':_0x330026[_0xbef8('0x6')],'priority':_0x3a0571[_0xbef8('0x31')][_0xbef8('0x23')]+_0x2e9855+_0x4ae5d5++,'VoiceExtensionId':_0x330026['id']});}else{if(_0x3a0571[_0xbef8('0x19')](_0xbef8('0x3d'))){if([_0xbef8('0x3e'),_0xbef8('0x3f')][_0xbef8('0x40')](_0x3a0571[_0xbef8('0x41')][_0xbef8('0x35')]())&&_0x3a0571[_0xbef8('0x42')]!==_0xbef8('0x43')){if(_0x3a0571[_0xbef8('0x3d')]){_0x251c00['push']({'type':_0x3a0571[_0xbef8('0x3')][_0xbef8('0x35')](),'app':_0xbef8('0x38'),'appdata':_0xbef8('0x44'),'context':_0x330026[_0xbef8('0x5')],'exten':_0x330026[_0xbef8('0x6')],'priority':_0x3a0571[_0xbef8('0x31')][_0xbef8('0x23')]+_0x2e9855+_0x4ae5d5++,'VoiceExtensionId':_0x330026['id']});_0x251c00[_0xbef8('0xa')]({'type':_0x3a0571[_0xbef8('0x3')][_0xbef8('0x35')](),'app':'Set','appdata':_0xbef8('0x45'),'context':_0x330026['context'],'exten':_0x330026['exten'],'priority':_0x3a0571[_0xbef8('0x31')]['length']+_0x2e9855+_0x4ae5d5++,'VoiceExtensionId':_0x330026['id']});}else{_0x251c00[_0xbef8('0xa')]({'type':_0x3a0571[_0xbef8('0x3')]['toLowerCase'](),'app':_0xbef8('0x38'),'appdata':_0xbef8('0x46'),'context':_0x330026[_0xbef8('0x5')],'exten':_0x330026[_0xbef8('0x6')],'priority':_0x3a0571[_0xbef8('0x31')][_0xbef8('0x23')]+_0x2e9855+_0x4ae5d5++,'VoiceExtensionId':_0x330026['id']});_0x251c00['push']({'type':_0x3a0571['type'][_0xbef8('0x35')](),'app':'Set','appdata':_0xbef8('0x47'),'context':_0x330026[_0xbef8('0x5')],'exten':_0x330026[_0xbef8('0x6')],'priority':_0x3a0571[_0xbef8('0x31')][_0xbef8('0x23')]+_0x2e9855+_0x4ae5d5++,'VoiceExtensionId':_0x330026['id']});}}}}for(var _0x22f5b4=0x0;_0x22f5b4<_0x3a0571['intervals'][_0xbef8('0x23')];_0x22f5b4++){var _0x1260a8=_0x2e9855+_0x3a0571['intervals'][_0xbef8('0x23')];var _0x31f471=_0x22f5b4===_0x3a0571[_0xbef8('0x31')][_0xbef8('0x23')]-0x1?_0x2e9855+_0x251c00['length']+_0x161d7d[_0xbef8('0x23')]+0x2:_0x2e9855+_0x22f5b4+0x1;_0x251c00[_0xbef8('0x48')](_0x22f5b4,0x0,{'type':_0x330026[_0xbef8('0x3')],'app':_0xbef8('0x49'),'appdata':_0x3a0571[_0xbef8('0x31')][_0x22f5b4]+'?'+_0x330026[_0xbef8('0x5')]+_0xbef8('0x4a')+_0x1260a8+':'+_0x330026[_0xbef8('0x5')]+_0xbef8('0x4a')+_0x31f471,'exten':_0x330026[_0xbef8('0x6')],'context':_0x330026['context'],'priority':_0x2e9855+_0x22f5b4,'VoiceExtensionId':_0x330026['id']});}if(_0x3a0571[_0xbef8('0x42')]===_0xbef8('0x4b'))_0x3a0571[_0xbef8('0x4c')]=_0x143002(_0x330026,_0x3a0571[_0xbef8('0x4c')]);_0x3a0571['priority']=_0x251c00[_0xbef8('0x23')]?_[_0xbef8('0x4d')](_0x251c00)[_0xbef8('0x4e')]+0x1:_0x2e9855;_0x145974=_[_0xbef8('0x4f')](_0x145974,_0x251c00,[_0x3a0571],_0x161d7d);_0x2e9855=_['last'](_0x145974)[_0xbef8('0x4e')]+0x1;}return _0x36ae81(_0x145974);})[_0xbef8('0x50')](function(_0x513bee){_0x5e267f(_0x513bee);});});}return _0x98588a[_0xbef8('0x51')](_0xbef8('0x52'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x241bc6){var _0x54a2a1=this[_0xbef8('0x53')]({'plain':!![]});var _0x5f2954=_0x54a2a1[_0xbef8('0x3')]===_0xbef8('0xb')?_0x1e8060(_0x54a2a1):_0x361696(_0x54a2a1);return _0x2fead2(_0x54a2a1,_0x241bc6,_[_0xbef8('0x4d')](_0x5f2954)[_0xbef8('0x4e')]+0x1)[_0xbef8('0x30')](function(_0x5e9d7b){var _0x355a0a=_[_0xbef8('0x4f')](_0x5f2954,_0x5e9d7b);_0x355a0a['push']({'type':_0x54a2a1[_0xbef8('0x3')],'app':_0xbef8('0x54'),'exten':_0x54a2a1['exten'],'context':_0x54a2a1['context'],'priority':_[_0xbef8('0x4d')](_0x355a0a)[_0xbef8('0x4e')]+0x1,'VoiceExtensionId':_0x54a2a1['id']});return _0x355a0a;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ea2c687..acdd896 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 _0x5d95=['VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','request','info'];(function(_0x22bd5f,_0x1607fe){var _0x338013=function(_0x2096ee){while(--_0x2096ee){_0x22bd5f['push'](_0x22bd5f['shift']());}};_0x338013(++_0x1607fe);}(_0x5d95,0x77));var _0x55d9=function(_0x2e6e44,_0x3c47ba){_0x2e6e44=_0x2e6e44-0x0;var _0x3803c8=_0x5d95[_0x2e6e44];return _0x3803c8;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var moment=require('moment');var BPromise=require(_0x55d9('0x2'));var rs=require(_0x55d9('0x3'));var fs=require('fs');var Redis=require(_0x55d9('0x4'));var db=require(_0x55d9('0x5'))['db'];var utils=require(_0x55d9('0x6'));var logger=require('../../config/logger')(_0x55d9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55d9('0x8')][_0x55d9('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x55d9('0xa')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x77a04f,_0x373788,_0x2b406c){return new BPromise(function(_0xfd0f08,_0x38cde2){return client[_0x55d9('0xb')](_0x77a04f,_0x2b406c)['then'](function(_0x552cb8){logger[_0x55d9('0xc')](_0x55d9('0xd'),_0x373788,_0x55d9('0xe'));logger[_0x55d9('0xf')](_0x55d9('0x10'),_0x373788,_0x55d9('0xe'),JSON[_0x55d9('0x11')](_0x552cb8));if(_0x552cb8[_0x55d9('0x12')]){if(_0x552cb8[_0x55d9('0x12')]['code']===0x1f4){logger[_0x55d9('0x12')](_0x55d9('0xd'),_0x373788,_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);return _0x38cde2(_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);}logger[_0x55d9('0x12')](_0x55d9('0xd'),_0x373788,_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);return _0xfd0f08(_0x552cb8[_0x55d9('0x12')][_0x55d9('0x13')]);}else{logger[_0x55d9('0xc')](_0x55d9('0xd'),_0x373788,'request\x20sent');_0xfd0f08(_0x552cb8[_0x55d9('0x14')][_0x55d9('0x13')]);}})['catch'](function(_0x4c8561){logger['error'](_0x55d9('0xd'),_0x373788,_0x4c8561);_0x38cde2(_0x4c8561);});});}exports[_0x55d9('0x15')]=function(_0x191c3e){var _0x3e9645=this;return new Promise(function(_0x535ad9,_0x13d435){return db[_0x55d9('0x16')][_0x55d9('0x17')]({'raw':_0x191c3e['options']?_0x191c3e[_0x55d9('0x18')][_0x55d9('0x19')]===undefined?!![]:![]:!![],'where':_0x191c3e[_0x55d9('0x18')]?_0x191c3e[_0x55d9('0x18')]['where']||null:null,'attributes':_0x191c3e['options']?_0x191c3e[_0x55d9('0x18')][_0x55d9('0x1a')]||null:null,'limit':_0x191c3e[_0x55d9('0x18')]?_0x191c3e[_0x55d9('0x18')][_0x55d9('0x1b')]||null:null,'include':_0x191c3e[_0x55d9('0x18')]?_0x191c3e[_0x55d9('0x18')][_0x55d9('0x1c')]?_[_0x55d9('0x1d')](_0x191c3e['options'][_0x55d9('0x1c')],function(_0x2c5d21){return{'model':db[_0x2c5d21['model']],'as':_0x2c5d21['as'],'attributes':_0x2c5d21[_0x55d9('0x1a')],'include':_0x2c5d21['include']?_[_0x55d9('0x1d')](_0x2c5d21[_0x55d9('0x1c')],function(_0x28d332){return{'model':db[_0x28d332[_0x55d9('0x1e')]],'as':_0x28d332['as'],'attributes':_0x28d332[_0x55d9('0x1a')],'include':_0x28d332['include']?_[_0x55d9('0x1d')](_0x28d332['include'],function(_0x4c1bbe){return{'model':db[_0x4c1bbe[_0x55d9('0x1e')]],'as':_0x4c1bbe['as'],'attributes':_0x4c1bbe[_0x55d9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x55d9('0x1f')](function(_0x4d0027){logger[_0x55d9('0xc')](_0x55d9('0x15'),_0x191c3e);logger[_0x55d9('0xf')](_0x55d9('0x15'),_0x191c3e,JSON[_0x55d9('0x11')](_0x4d0027));_0x535ad9(_0x4d0027);})[_0x55d9('0x20')](function(_0x19ca6a){logger[_0x55d9('0x12')](_0x55d9('0x15'),_0x19ca6a[_0x55d9('0x13')],_0x191c3e);_0x13d435(_0x3e9645[_0x55d9('0x12')](0x1f4,_0x19ca6a[_0x55d9('0x13')]));});});}; \ No newline at end of file +var _0x9b2c=['./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','where','attributes','limit','include','model','map','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x2be71,_0x3a30a5){var _0x2fbc8c=function(_0x26a289){while(--_0x26a289){_0x2be71['push'](_0x2be71['shift']());}};_0x2fbc8c(++_0x3a30a5);}(_0x9b2c,0x189));var _0xc9b2=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x9b2c[_0x2f1762];return _0x8ab21;};'use strict';var _=require('lodash');var util=require(_0xc9b2('0x0'));var moment=require(_0xc9b2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc9b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9b2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9b2('0x4'))(_0xc9b2('0x5'));var config=require(_0xc9b2('0x6'));var jayson=require(_0xc9b2('0x7'));var client=jayson[_0xc9b2('0x8')][_0xc9b2('0x9')]({'port':0x232a});config[_0xc9b2('0xa')]=_[_0xc9b2('0xb')](config[_0xc9b2('0xa')],{'host':_0xc9b2('0xc'),'port':0x18eb});var socket=require(_0xc9b2('0xd'))(new Redis(config['redis']));require(_0xc9b2('0xe'))['register'](socket);function respondWithRpcPromise(_0x54d7f9,_0x115350,_0x392e79){return new BPromise(function(_0x137e38,_0x110c87){return client[_0xc9b2('0xf')](_0x54d7f9,_0x392e79)[_0xc9b2('0x10')](function(_0x367025){logger[_0xc9b2('0x11')](_0xc9b2('0x12'),_0x115350,_0xc9b2('0x13'));logger[_0xc9b2('0x14')](_0xc9b2('0x15'),_0x115350,'request\x20sent',JSON[_0xc9b2('0x16')](_0x367025));if(_0x367025[_0xc9b2('0x17')]){if(_0x367025[_0xc9b2('0x17')][_0xc9b2('0x18')]===0x1f4){logger['error'](_0xc9b2('0x12'),_0x115350,_0x367025[_0xc9b2('0x17')][_0xc9b2('0x19')]);return _0x110c87(_0x367025[_0xc9b2('0x17')][_0xc9b2('0x19')]);}logger[_0xc9b2('0x17')](_0xc9b2('0x12'),_0x115350,_0x367025[_0xc9b2('0x17')]['message']);return _0x137e38(_0x367025[_0xc9b2('0x17')][_0xc9b2('0x19')]);}else{logger[_0xc9b2('0x11')](_0xc9b2('0x12'),_0x115350,'request\x20sent');_0x137e38(_0x367025[_0xc9b2('0x1a')][_0xc9b2('0x19')]);}})[_0xc9b2('0x1b')](function(_0x352995){logger[_0xc9b2('0x17')](_0xc9b2('0x12'),_0x115350,_0x352995);_0x110c87(_0x352995);});});}exports[_0xc9b2('0x1c')]=function(_0x50352c){var _0x474970=this;return new Promise(function(_0x58e1ba,_0x13739a){return db[_0xc9b2('0x1d')]['findAll']({'raw':_0x50352c[_0xc9b2('0x1e')]?_0x50352c[_0xc9b2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x50352c[_0xc9b2('0x1e')]?_0x50352c['options'][_0xc9b2('0x1f')]||null:null,'attributes':_0x50352c[_0xc9b2('0x1e')]?_0x50352c[_0xc9b2('0x1e')][_0xc9b2('0x20')]||null:null,'limit':_0x50352c[_0xc9b2('0x1e')]?_0x50352c[_0xc9b2('0x1e')][_0xc9b2('0x21')]||null:null,'include':_0x50352c[_0xc9b2('0x1e')]?_0x50352c[_0xc9b2('0x1e')][_0xc9b2('0x22')]?_['map'](_0x50352c[_0xc9b2('0x1e')][_0xc9b2('0x22')],function(_0x444181){return{'model':db[_0x444181[_0xc9b2('0x23')]],'as':_0x444181['as'],'attributes':_0x444181['attributes'],'include':_0x444181[_0xc9b2('0x22')]?_['map'](_0x444181[_0xc9b2('0x22')],function(_0xa07875){return{'model':db[_0xa07875[_0xc9b2('0x23')]],'as':_0xa07875['as'],'attributes':_0xa07875[_0xc9b2('0x20')],'include':_0xa07875[_0xc9b2('0x22')]?_[_0xc9b2('0x24')](_0xa07875[_0xc9b2('0x22')],function(_0x3d735a){return{'model':db[_0x3d735a[_0xc9b2('0x23')]],'as':_0x3d735a['as'],'attributes':_0x3d735a[_0xc9b2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc9b2('0x10')](function(_0x2ab823){logger[_0xc9b2('0x11')](_0xc9b2('0x1c'),_0x50352c);logger[_0xc9b2('0x14')](_0xc9b2('0x1c'),_0x50352c,JSON['stringify'](_0x2ab823));_0x58e1ba(_0x2ab823);})['catch'](function(_0x3df56f){logger[_0xc9b2('0x17')](_0xc9b2('0x1c'),_0x3df56f['message'],_0x50352c);_0x13739a(_0x474970[_0xc9b2('0x17')](0x1f4,_0x3df56f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 4006868..59c59a0 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(_0x2d4562,_0x5d08b4){var _0x18d0da=function(_0x3a52e6){while(--_0x3a52e6){_0x2d4562['push'](_0x2d4562['shift']());}};_0x18d0da(++_0x5d08b4);}(_0xf494,0x1c6));var _0x4f49=function(_0x4cb2dd,_0x105544){_0x4cb2dd=_0x4cb2dd-0x0;var _0x8edc2c=_0xf494[_0x4cb2dd];return _0x8edc2c;};'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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x814b,0x1a2));var _0xb814=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x814b[_0x20845e];return _0x28cf2b;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 94e6581..42b72eb 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 _0xc2c7=['../../components/interaction/service','get','isAuthenticated','index','show','/:id/messages','getMessages','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3a1e18,_0x3298da){var _0x40f511=function(_0xac6e09){while(--_0xac6e09){_0x3a1e18['push'](_0x3a1e18['shift']());}};_0x40f511(++_0x3298da);}(_0xc2c7,0x134));var _0x7c2c=function(_0x413b0c,_0x28e61a){_0x413b0c=_0x413b0c-0x0;var _0x411650=_0xc2c7[_0x413b0c];return _0x411650;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x11')]);router[_0x7c2c('0x12')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x13')]);module[_0x7c2c('0x14')]=router; \ No newline at end of file +var _0x2d72=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','update','exports'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x2d72,0xa8));var _0x22d7=function(_0x133b24,_0x4a85bb){_0x133b24=_0x133b24-0x0;var _0x5b8bf8=_0x2d72[_0x133b24];return _0x5b8bf8;};'use strict';var multer=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var path=require(_0x22d7('0x2'));var timeout=require(_0x22d7('0x3'));var express=require(_0x22d7('0x4'));var router=express[_0x22d7('0x5')]();var fs_extra=require(_0x22d7('0x6'));var auth=require(_0x22d7('0x7'));var interaction=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var controller=require(_0x22d7('0xa'));router[_0x22d7('0xb')]('/',auth[_0x22d7('0xc')](),controller[_0x22d7('0xd')]);router['get'](_0x22d7('0xe'),auth[_0x22d7('0xc')](),controller['show']);router[_0x22d7('0xb')](_0x22d7('0xf'),auth[_0x22d7('0xc')](),controller[_0x22d7('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x22d7('0x11')]);router[_0x22d7('0x12')](_0x22d7('0xe'),auth[_0x22d7('0xc')](),controller[_0x22d7('0x13')]);router['delete']('/:id',auth[_0x22d7('0xc')](),controller['destroy']);module[_0x22d7('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 15a649a..eb7d815 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 _0xb519=['mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','yes','ENUM','INTEGER','getDataValue','fullname','\x20-\x20'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0xb519,0x1b1));var _0x9b51=function(_0x502fd4,_0x3bab6e){_0x502fd4=_0x502fd4-0x0;var _0x56b3ef=_0xb519[_0x502fd4];return _0x56b3ef;};'use strict';var Sequelize=require(_0x9b51('0x0'));module[_0x9b51('0x1')]={'customer_id':{'type':Sequelize[_0x9b51('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x9b51('0x3'),'unique':_0x9b51('0x4')},'mailbox':{'type':Sequelize[_0x9b51('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x9b51('0x2')]},'fullname':{'type':Sequelize[_0x9b51('0x2')]},'email':{'type':Sequelize[_0x9b51('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3a9747){this[_0x9b51('0x5')](_0x9b51('0x6'),typeof _0x3a9747===_0x9b51('0x7')&&_0x3a9747['trim']()?_0x3a9747[_0x9b51('0x8')]():null);}},'pager':{'type':Sequelize[_0x9b51('0x2')]},'tz':{'type':Sequelize[_0x9b51('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x9b51('0x9'),'no'),'defaultValue':_0x9b51('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9b51('0xa')]('yes','no'),'defaultValue':_0x9b51('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x9b51('0x2')]},'callback':{'type':Sequelize[_0x9b51('0x2')]},'review':{'type':Sequelize[_0x9b51('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x9b51('0xa')](_0x9b51('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x9b51('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x9b51('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x9b51('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9b51('0xa')](_0x9b51('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x9b51('0x9'),'no'),'defaultValue':_0x9b51('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x9b51('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x9b51('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9b51('0xa')](_0x9b51('0x9'),'no'),'defaultValue':_0x9b51('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x9b51('0x2')]},'emailbody':{'type':Sequelize[_0x9b51('0x2')]},'maxsecs':{'type':Sequelize[_0x9b51('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9b51('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9b51('0xc')](_0x9b51('0xd'))+_0x9b51('0xe')+this[_0x9b51('0xc')](_0x9b51('0xf'));}}}; \ No newline at end of file +var _0x5108=['VIRTUAL','getDataValue','fullname','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x5108,0x99));var _0x8510=function(_0x313abe,_0x16165d){_0x313abe=_0x313abe-0x0;var _0x5a4cd3=_0x5108[_0x313abe];return _0x5a4cd3;};'use strict';var Sequelize=require(_0x8510('0x0'));module[_0x8510('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8510('0x2')],'defaultValue':_0x8510('0x3'),'unique':_0x8510('0x4')},'mailbox':{'type':Sequelize[_0x8510('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x8510('0x2')]},'email':{'type':Sequelize[_0x8510('0x2')],'validate':{'isEmail':!![]},'set':function(_0x163fdd){this['setDataValue'](_0x8510('0x5'),typeof _0x163fdd==='string'&&_0x163fdd[_0x8510('0x6')]()?_0x163fdd['trim']():null);}},'pager':{'type':Sequelize[_0x8510('0x2')]},'tz':{'type':Sequelize[_0x8510('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x8510('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x8510('0x7')](_0x8510('0x8'),'no'),'defaultValue':_0x8510('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x8510('0x2')]},'callback':{'type':Sequelize[_0x8510('0x2')]},'review':{'type':Sequelize[_0x8510('0x7')](_0x8510('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8510('0x7')](_0x8510('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8510('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8510('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8510('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8510('0x7')](_0x8510('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8510('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8510('0x7')](_0x8510('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x8510('0x7')](_0x8510('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8510('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8510('0x7')](_0x8510('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x8510('0xa')},'emailsubject':{'type':Sequelize[_0x8510('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x8510('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8510('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8510('0xc')],'get':function(){return this[_0x8510('0xd')](_0x8510('0xe'))+'\x20-\x20'+this[_0x8510('0xd')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index d431652..4c89089 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 _0xb10b=['attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','type','merge','options','VoiceMail','include','findAll','rows','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','get','end','error','stack','name','send','map','fieldName','key','model','query','keys','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e9e76,_0x3cb685){_0x5e9e76=_0x5e9e76-0x0;var _0x2bc580=_0xb10b[_0x5e9e76];return _0x2bc580;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x3ba6cd=_0x436104[_0xbb10('0x25')]({'plain':!![]});var _0x537898='Voicemails';return db['UserProfileResource'][_0xbb10('0x24')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x23')](function(){return _0x436104;});})[_0xbb10('0x23')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x26')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x18')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x27')](_0x4aabb9[_0xbb10('0x28')]);if(_0x4aabb9[_0xbb10('0x29')]){delete _0x4aabb9[_0xbb10('0x29')];}_0x20d946[_0xbb10('0x19')](_0x2a0e8b)[_0xbb10('0x2a')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=_[_0xbb10('0x2b')](db['VoiceMail']['rawAttributes'],function(_0x4c3744){return{'name':_0x4c3744[_0xbb10('0x2c')],'type':_0x4c3744['type'][_0xbb10('0x2d')]};});_0x56f2da[_0xbb10('0x2e')]=_[_0xbb10('0x2b')](_0x1dcc9c,_0xbb10('0x29'));_0x56f2da[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x221624[_0xbb10('0x2f')]);_0x56f2da['filters']=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],_0x56f2da[_0xbb10('0x2f')]);_0x448d5c[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x448d5c['attributes']=_0x448d5c[_0xbb10('0x32')][_0xbb10('0x34')]?_0x448d5c[_0xbb10('0x32')]:_0x56f2da[_0xbb10('0x2e')];if(!_0x221624['query'][_0xbb10('0x35')]('nolimit')){_0x448d5c['limit']=qs[_0xbb10('0x1c')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x1c')]);_0x448d5c[_0xbb10('0x1b')]=qs[_0xbb10('0x1b')](_0x221624[_0xbb10('0x2f')]['offset']);}_0x448d5c[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x221624['query']['sort']);_0x448d5c['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x39')](_0x221624[_0xbb10('0x2f')],_0x56f2da['filters']),_0x1dcc9c);if(_0x221624[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x448d5c[_0xbb10('0x3b')]=_['merge'](_0x448d5c[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x2b')](_0x1dcc9c,function(_0x1dcd38){if(_0x1dcd38[_0xbb10('0x3c')]!=='VIRTUAL'){var _0xd238e9={};_0xd238e9[_0x1dcd38[_0xbb10('0x29')]]={'$like':'%'+_0x221624['query'][_0xbb10('0x3a')]+'%'};return _0xd238e9;}})});}_0x448d5c=_[_0xbb10('0x3d')]({},_0x448d5c,_0x221624[_0xbb10('0x3e')]);var _0x3a9934={'where':_0x448d5c[_0xbb10('0x3b')]};return db[_0xbb10('0x3f')]['count'](_0x3a9934)[_0xbb10('0x23')](function(_0x1c7fae){_0x16ad2a[_0xbb10('0x1e')]=_0x1c7fae;if(_0x221624[_0xbb10('0x2f')]['includeAll']){_0x448d5c[_0xbb10('0x40')]=[{'all':!![]}];}return db[_0xbb10('0x3f')][_0xbb10('0x41')](_0x448d5c);})[_0xbb10('0x23')](function(_0x5e2cfa){_0x16ad2a[_0xbb10('0x42')]=_0x5e2cfa;return _0x16ad2a;})[_0xbb10('0x23')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))['catch'](handleError(_0x4ee02e,null));};exports['show']=function(_0x38d78f,_0x4a3ddf){var _0x318984={'raw':!![],'where':{'id':_0x38d78f['params']['id']}},_0x180933={};_0x180933[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x3f')]['rawAttributes']);_0x180933[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x38d78f[_0xbb10('0x2f')]);_0x180933[_0xbb10('0x38')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],_0x180933[_0xbb10('0x2f')]);_0x318984[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x38d78f[_0xbb10('0x2f')]['fields']));_0x318984[_0xbb10('0x32')]=_0x318984[_0xbb10('0x32')]['length']?_0x318984[_0xbb10('0x32')]:_0x180933[_0xbb10('0x2e')];if(_0x38d78f[_0xbb10('0x2f')][_0xbb10('0x43')]){_0x318984[_0xbb10('0x40')]=[{'all':!![]}];}_0x318984=_[_0xbb10('0x3d')]({},_0x318984,_0x38d78f[_0xbb10('0x3e')]);return db['VoiceMail']['find'](_0x318984)[_0xbb10('0x23')](handleEntityNotFound(_0x4a3ddf,null))[_0xbb10('0x23')](respondWithResult(_0x4a3ddf,null))[_0xbb10('0x44')](handleError(_0x4a3ddf,null));};exports['create']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x3f')][_0xbb10('0x45')](_0x5f0c12[_0xbb10('0x46')],{})[_0xbb10('0x23')](function(_0x22b315){var _0x2f2552=_0x5f0c12[_0xbb10('0x47')][_0xbb10('0x25')]({'plain':!![]});if(!_0x2f2552)throw new Error(_0xbb10('0x48'));if(_0x2f2552['role']==='user'){var _0x412e13=_0x22b315[_0xbb10('0x25')]({'plain':!![]});var _0x36ab7d=_0xbb10('0x49');return db[_0xbb10('0x4a')][_0xbb10('0x4b')]({'where':{'name':_0x36ab7d,'userProfileId':_0x2f2552[_0xbb10('0x4c')]},'raw':!![]})[_0xbb10('0x23')](function(_0x1c0d8f){if(_0x1c0d8f&&_0x1c0d8f[_0xbb10('0x4d')]===0x0){return db[_0xbb10('0x4e')][_0xbb10('0x45')]({'name':_0x412e13[_0xbb10('0x29')],'resourceId':_0x412e13['id'],'type':_0x1c0d8f[_0xbb10('0x29')],'sectionId':_0x1c0d8f['id']},{})[_0xbb10('0x23')](function(){return _0x22b315;});}else{return _0x22b315;}})['catch'](function(_0x124052){logger['error'](_0xbb10('0x4f'),_0x124052);throw _0x124052;});}return _0x22b315;})[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,0xc9))[_0xbb10('0x44')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x22')]=function(_0x26e66e,_0x32d8e9){if(_0x26e66e[_0xbb10('0x46')]['id']){delete _0x26e66e[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x26e66e[_0xbb10('0x50')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x32d8e9,null))[_0xbb10('0x23')](saveUpdates(_0x26e66e[_0xbb10('0x46')],null))[_0xbb10('0x23')](respondWithResult(_0x32d8e9,null))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x24')]=function(_0x466eb7,_0x1b83a9){return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x466eb7[_0xbb10('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b83a9,null))[_0xbb10('0x23')](removeEntity(_0x1b83a9,null))[_0xbb10('0x44')](handleError(_0x1b83a9,null));};exports[_0xbb10('0x51')]=function(_0x14fed3,_0x432728,_0x22de7f){return db[_0xbb10('0x3f')][_0xbb10('0x52')]({'where':{'id':_0x14fed3[_0xbb10('0x50')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x432728,null))[_0xbb10('0x23')](function(_0x2a1ce1){var _0x16932f;var _0x4e7fac={},_0x4ea1a6={};_0x4ea1a6[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x53')][_0xbb10('0x54')]);_0x4ea1a6['query']=_['keys'](_0x14fed3[_0xbb10('0x2f')]);_0x4ea1a6[_0xbb10('0x38')]=_[_0xbb10('0x31')](_0x4ea1a6[_0xbb10('0x2e')],_0x4ea1a6[_0xbb10('0x2f')]);_0x4e7fac[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x4ea1a6['model'],qs[_0xbb10('0x33')](_0x14fed3[_0xbb10('0x2f')]['fields']));_0x4e7fac['attributes']=_0x4e7fac['attributes'][_0xbb10('0x34')]?_0x4e7fac[_0xbb10('0x32')]:_0x4ea1a6[_0xbb10('0x2e')];if(!_0x14fed3['query']['hasOwnProperty']('nolimit')){_0x4e7fac[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x14fed3[_0xbb10('0x2f')]['limit']);_0x4e7fac[_0xbb10('0x1b')]=qs[_0xbb10('0x1b')](_0x14fed3['query']['offset']);}_0x4e7fac[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x37')]);_0x4e7fac['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x39')](_0x14fed3[_0xbb10('0x2f')],_0x4ea1a6['filters']));if(_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x4e7fac[_0xbb10('0x3b')]=_['merge'](_0x4e7fac[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x2b')](_0x4e7fac[_0xbb10('0x32')],function(_0x37b65f){var _0x5e4a6e={};_0x5e4a6e[_0x37b65f]={'$like':'%'+_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x3a')]+'%'};return _0x5e4a6e;})});}_0x4e7fac[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x4e7fac['where'],{'mailboxuser':_0x2a1ce1[_0xbb10('0x55')]});_0x4e7fac=_[_0xbb10('0x3d')]({},_0x4e7fac,_0x14fed3[_0xbb10('0x3e')]);return db[_0xbb10('0x53')][_0xbb10('0x56')](_0x4e7fac)[_0xbb10('0x23')](respondWithFilteredResult(_0x432728,_0x4e7fac));})[_0xbb10('0x44')](handleError(_0x432728,null));}; \ No newline at end of file +var _0x0972=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','pick','mailbox','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','get','Voicemails','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','rows','catch','params','length','options'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x0972,0x64));var _0x2097=function(_0x3b527a,_0x4e69e5){_0x3b527a=_0x3b527a-0x0;var _0x5cea1c=_0x0972[_0x3b527a];return _0x5cea1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];function respondWithStatusCode(_0x3b2f94,_0x170005){_0x170005=_0x170005||0xcc;return function(_0x16871b){if(_0x16871b){return _0x3b2f94[_0x2097('0x1a')](_0x170005);}return _0x3b2f94[_0x2097('0x1b')](_0x170005)[_0x2097('0x1c')]();};}function respondWithResult(_0x1c9ef9,_0x2c3e41){_0x2c3e41=_0x2c3e41||0xc8;return function(_0x354387){if(_0x354387){return _0x1c9ef9['status'](_0x2c3e41)[_0x2097('0x1d')](_0x354387);}};}function respondWithFilteredResult(_0x35c062,_0x4d31bc){return function(_0x4eec05){if(_0x4eec05){var _0x4fc8c5=typeof _0x4d31bc[_0x2097('0x1e')]==='undefined'&&typeof _0x4d31bc[_0x2097('0x1f')]===_0x2097('0x20');var _0x43fec9=_0x4eec05[_0x2097('0x21')];var _0x44c584=_0x4fc8c5?0x0:_0x4d31bc['offset'];var _0x324652=_0x4fc8c5?_0x4eec05[_0x2097('0x21')]:_0x4d31bc[_0x2097('0x1e')]+_0x4d31bc[_0x2097('0x1f')];var _0x1d3804;if(_0x324652>=_0x43fec9){_0x324652=_0x43fec9;_0x1d3804=0xc8;}else{_0x1d3804=0xce;}_0x35c062[_0x2097('0x1b')](_0x1d3804);return _0x35c062[_0x2097('0x22')](_0x2097('0x23'),_0x44c584+'-'+_0x324652+'/'+_0x43fec9)['json'](_0x4eec05);}return null;};}function patchUpdates(_0x4d957e){return function(_0xf65dc6){try{jsonpatch['apply'](_0xf65dc6,_0x4d957e,!![]);}catch(_0x227c00){return BPromise[_0x2097('0x24')](_0x227c00);}return _0xf65dc6['save']();};}function saveUpdates(_0x442db7,_0x5b0582){return function(_0x2e17c8){if(_0x2e17c8){return _0x2e17c8[_0x2097('0x25')](_0x442db7)[_0x2097('0x26')](function(_0x20b93a){return _0x20b93a;});}return null;};}function removeEntity(_0x36b15e,_0x35047b){return function(_0x56390a){if(_0x56390a){return _0x56390a[_0x2097('0x27')]()['then'](function(){var _0x3f9279=_0x56390a[_0x2097('0x28')]({'plain':!![]});var _0x345875=_0x2097('0x29');return db['UserProfileResource'][_0x2097('0x27')]({'where':{'type':_0x345875,'resourceId':_0x3f9279['id']}})[_0x2097('0x26')](function(){return _0x56390a;});})['then'](function(){_0x36b15e[_0x2097('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29b879,_0x48ae06){return function(_0xbc0339){if(!_0xbc0339){_0x29b879[_0x2097('0x1a')](0x194);}return _0xbc0339;};}function handleError(_0x407a2a,_0x7eefb4){_0x7eefb4=_0x7eefb4||0x1f4;return function(_0x410afa){logger[_0x2097('0x2a')](_0x410afa[_0x2097('0x2b')]);if(_0x410afa['name']){delete _0x410afa[_0x2097('0x2c')];}_0x407a2a[_0x2097('0x1b')](_0x7eefb4)['send'](_0x410afa);};}exports[_0x2097('0x2d')]=function(_0x41487d,_0x59fb84){var _0x4d0916={},_0x312c77={},_0x11b051={'count':0x0,'rows':[]};var _0x1649c8=_[_0x2097('0x2e')](db[_0x2097('0x2f')][_0x2097('0x30')],function(_0x56c538){return{'name':_0x56c538[_0x2097('0x31')],'type':_0x56c538['type'][_0x2097('0x32')]};});_0x312c77[_0x2097('0x33')]=_[_0x2097('0x2e')](_0x1649c8,_0x2097('0x2c'));_0x312c77[_0x2097('0x34')]=_[_0x2097('0x35')](_0x41487d[_0x2097('0x34')]);_0x312c77[_0x2097('0x36')]=_[_0x2097('0x37')](_0x312c77['model'],_0x312c77[_0x2097('0x34')]);_0x4d0916[_0x2097('0x38')]=_[_0x2097('0x37')](_0x312c77['model'],qs[_0x2097('0x39')](_0x41487d[_0x2097('0x34')][_0x2097('0x39')]));_0x4d0916[_0x2097('0x38')]=_0x4d0916['attributes']['length']?_0x4d0916['attributes']:_0x312c77[_0x2097('0x33')];if(!_0x41487d[_0x2097('0x34')][_0x2097('0x3a')](_0x2097('0x3b'))){_0x4d0916[_0x2097('0x1f')]=qs[_0x2097('0x1f')](_0x41487d['query'][_0x2097('0x1f')]);_0x4d0916[_0x2097('0x1e')]=qs[_0x2097('0x1e')](_0x41487d[_0x2097('0x34')][_0x2097('0x1e')]);}_0x4d0916[_0x2097('0x3c')]=qs['sort'](_0x41487d[_0x2097('0x34')][_0x2097('0x3d')]);_0x4d0916[_0x2097('0x3e')]=qs['filters'](_['pick'](_0x41487d[_0x2097('0x34')],_0x312c77[_0x2097('0x36')]),_0x1649c8);if(_0x41487d[_0x2097('0x34')][_0x2097('0x3f')]){_0x4d0916[_0x2097('0x3e')]=_[_0x2097('0x40')](_0x4d0916[_0x2097('0x3e')],{'$or':_[_0x2097('0x2e')](_0x1649c8,function(_0x23c4a5){if(_0x23c4a5[_0x2097('0x41')]!==_0x2097('0x42')){var _0x1ef92a={};_0x1ef92a[_0x23c4a5['name']]={'$like':'%'+_0x41487d[_0x2097('0x34')][_0x2097('0x3f')]+'%'};return _0x1ef92a;}})});}_0x4d0916=_[_0x2097('0x40')]({},_0x4d0916,_0x41487d['options']);var _0x1394df={'where':_0x4d0916[_0x2097('0x3e')]};return db[_0x2097('0x2f')][_0x2097('0x21')](_0x1394df)[_0x2097('0x26')](function(_0xd4d89e){_0x11b051[_0x2097('0x21')]=_0xd4d89e;if(_0x41487d[_0x2097('0x34')]['includeAll']){_0x4d0916[_0x2097('0x43')]=[{'all':!![]}];}return db[_0x2097('0x2f')][_0x2097('0x44')](_0x4d0916);})[_0x2097('0x26')](function(_0x12e0e2){_0x11b051[_0x2097('0x45')]=_0x12e0e2;return _0x11b051;})[_0x2097('0x26')](respondWithFilteredResult(_0x59fb84,_0x4d0916))[_0x2097('0x46')](handleError(_0x59fb84,null));};exports['show']=function(_0x3fc3fe,_0x5869d8){var _0x3e0739={'raw':!![],'where':{'id':_0x3fc3fe[_0x2097('0x47')]['id']}},_0x298e49={};_0x298e49[_0x2097('0x33')]=_[_0x2097('0x35')](db['VoiceMail'][_0x2097('0x30')]);_0x298e49[_0x2097('0x34')]=_[_0x2097('0x35')](_0x3fc3fe[_0x2097('0x34')]);_0x298e49[_0x2097('0x36')]=_['intersection'](_0x298e49[_0x2097('0x33')],_0x298e49[_0x2097('0x34')]);_0x3e0739[_0x2097('0x38')]=_[_0x2097('0x37')](_0x298e49[_0x2097('0x33')],qs[_0x2097('0x39')](_0x3fc3fe[_0x2097('0x34')][_0x2097('0x39')]));_0x3e0739['attributes']=_0x3e0739[_0x2097('0x38')][_0x2097('0x48')]?_0x3e0739[_0x2097('0x38')]:_0x298e49[_0x2097('0x33')];if(_0x3fc3fe['query']['includeAll']){_0x3e0739['include']=[{'all':!![]}];}_0x3e0739=_[_0x2097('0x40')]({},_0x3e0739,_0x3fc3fe[_0x2097('0x49')]);return db['VoiceMail'][_0x2097('0x4a')](_0x3e0739)[_0x2097('0x26')](handleEntityNotFound(_0x5869d8,null))['then'](respondWithResult(_0x5869d8,null))['catch'](handleError(_0x5869d8,null));};exports[_0x2097('0x4b')]=function(_0x21829d,_0x1b4de6){return db['VoiceMail'][_0x2097('0x4b')](_0x21829d[_0x2097('0x4c')],{})['then'](function(_0x86a05a){var _0x2682a9=_0x21829d[_0x2097('0x4d')][_0x2097('0x28')]({'plain':!![]});if(!_0x2682a9)throw new Error(_0x2097('0x4e'));if(_0x2682a9['role']==='user'){var _0x140b41=_0x86a05a[_0x2097('0x28')]({'plain':!![]});var _0x329632='Voicemails';return db['UserProfileSection'][_0x2097('0x4a')]({'where':{'name':_0x329632,'userProfileId':_0x2682a9[_0x2097('0x4f')]},'raw':!![]})['then'](function(_0x41cd90){if(_0x41cd90&&_0x41cd90[_0x2097('0x50')]===0x0){return db[_0x2097('0x51')][_0x2097('0x4b')]({'name':_0x140b41[_0x2097('0x2c')],'resourceId':_0x140b41['id'],'type':_0x41cd90['name'],'sectionId':_0x41cd90['id']},{})[_0x2097('0x26')](function(){return _0x86a05a;});}else{return _0x86a05a;}})[_0x2097('0x46')](function(_0x190859){logger['error'](_0x2097('0x52'),_0x190859);throw _0x190859;});}return _0x86a05a;})[_0x2097('0x26')](respondWithResult(_0x1b4de6,0xc9))['catch'](handleError(_0x1b4de6,null));};exports[_0x2097('0x25')]=function(_0x4d6ed6,_0x30b4cd){if(_0x4d6ed6['body']['id']){delete _0x4d6ed6['body']['id'];}return db['VoiceMail'][_0x2097('0x4a')]({'where':{'id':_0x4d6ed6['params']['id']}})['then'](handleEntityNotFound(_0x30b4cd,null))[_0x2097('0x26')](saveUpdates(_0x4d6ed6['body'],null))[_0x2097('0x26')](respondWithResult(_0x30b4cd,null))[_0x2097('0x46')](handleError(_0x30b4cd,null));};exports['destroy']=function(_0x3e799f,_0x3e2e45){return db[_0x2097('0x2f')][_0x2097('0x4a')]({'where':{'id':_0x3e799f[_0x2097('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e2e45,null))[_0x2097('0x26')](removeEntity(_0x3e2e45,null))['catch'](handleError(_0x3e2e45,null));};exports[_0x2097('0x53')]=function(_0x140e43,_0x24f166,_0x55e3cd){return db[_0x2097('0x2f')][_0x2097('0x54')]({'where':{'id':_0x140e43[_0x2097('0x47')]['id']}})[_0x2097('0x26')](handleEntityNotFound(_0x24f166,null))[_0x2097('0x26')](function(_0x56cfbf){var _0x5b9fa2;var _0x265eac={},_0x275578={};_0x275578['model']=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x275578[_0x2097('0x34')]=_['keys'](_0x140e43[_0x2097('0x34')]);_0x275578[_0x2097('0x36')]=_['intersection'](_0x275578[_0x2097('0x33')],_0x275578[_0x2097('0x34')]);_0x265eac[_0x2097('0x38')]=_[_0x2097('0x37')](_0x275578[_0x2097('0x33')],qs[_0x2097('0x39')](_0x140e43[_0x2097('0x34')][_0x2097('0x39')]));_0x265eac[_0x2097('0x38')]=_0x265eac['attributes'][_0x2097('0x48')]?_0x265eac[_0x2097('0x38')]:_0x275578[_0x2097('0x33')];if(!_0x140e43[_0x2097('0x34')][_0x2097('0x3a')](_0x2097('0x3b'))){_0x265eac['limit']=qs[_0x2097('0x1f')](_0x140e43[_0x2097('0x34')][_0x2097('0x1f')]);_0x265eac[_0x2097('0x1e')]=qs[_0x2097('0x1e')](_0x140e43['query'][_0x2097('0x1e')]);}_0x265eac[_0x2097('0x3c')]=qs['sort'](_0x140e43['query']['sort']);_0x265eac[_0x2097('0x3e')]=qs[_0x2097('0x36')](_[_0x2097('0x55')](_0x140e43[_0x2097('0x34')],_0x275578[_0x2097('0x36')]));if(_0x140e43[_0x2097('0x34')][_0x2097('0x3f')]){_0x265eac[_0x2097('0x3e')]=_[_0x2097('0x40')](_0x265eac['where'],{'$or':_['map'](_0x265eac[_0x2097('0x38')],function(_0x34d832){var _0x1eeb30={};_0x1eeb30[_0x34d832]={'$like':'%'+_0x140e43[_0x2097('0x34')][_0x2097('0x3f')]+'%'};return _0x1eeb30;})});}_0x265eac[_0x2097('0x3e')]=_['merge'](_0x265eac[_0x2097('0x3e')],{'mailboxuser':_0x56cfbf[_0x2097('0x56')]});_0x265eac=_[_0x2097('0x40')]({},_0x265eac,_0x140e43[_0x2097('0x49')]);return db['VoiceMailMessage']['findAndCountAll'](_0x265eac)[_0x2097('0x26')](respondWithFilteredResult(_0x24f166,_0x265eac));})[_0x2097('0x46')](handleError(_0x24f166,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9f16676..980e830 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 _0x0fac=['api','moment','bluebird','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger'];(function(_0x4a5cd0,_0x32ef4c){var _0x357a6f=function(_0x534b19){while(--_0x534b19){_0x4a5cd0['push'](_0x4a5cd0['shift']());}};_0x357a6f(++_0x32ef4c);}(_0x0fac,0x6d));var _0xc0fa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0fac[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc0fa('0x0'));var util=require(_0xc0fa('0x1'));var logger=require(_0xc0fa('0x2'))(_0xc0fa('0x3'));var moment=require(_0xc0fa('0x4'));var BPromise=require(_0xc0fa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0fa('0x6'));var rimraf=require(_0xc0fa('0x7'));var config=require('../../config/environment');var attributes=require(_0xc0fa('0x8'));module[_0xc0fa('0x9')]=function(_0x2be106,_0x325a0e){return _0x2be106[_0xc0fa('0xa')](_0xc0fa('0xb'),attributes,{'tableName':_0xc0fa('0xc'),'paranoid':![],'indexes':[{'name':_0xc0fa('0xd'),'fields':[_0xc0fa('0xe'),_0xc0fa('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe641=['request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','context','lodash','util','../../config/logger','moment','bluebird'];(function(_0x577343,_0x4a0f66){var _0x4ffc22=function(_0xa05085){while(--_0xa05085){_0x577343['push'](_0x577343['shift']());}};_0x4ffc22(++_0x4a0f66);}(_0xe641,0x14b));var _0x1e64=function(_0x4a8002,_0x47ce0e){_0x4a8002=_0x4a8002-0x0;var _0x66d4a4=_0xe641[_0x4a8002];return _0x66d4a4;};'use strict';var _=require(_0x1e64('0x0'));var util=require(_0x1e64('0x1'));var logger=require(_0x1e64('0x2'))('api');var moment=require(_0x1e64('0x3'));var BPromise=require(_0x1e64('0x4'));var rp=require(_0x1e64('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e64('0x6'));var config=require(_0x1e64('0x7'));var attributes=require(_0x1e64('0x8'));module[_0x1e64('0x9')]=function(_0x3221e7,_0x4cecdd){return _0x3221e7['define'](_0x1e64('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x1e64('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 985e1bb..c5c9f2e 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 _0x0631=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','http','then','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','VoiceMail,\x20%s,\x20%s','message'];(function(_0x117417,_0x214c67){var _0x5ba86d=function(_0x35ad70){while(--_0x35ad70){_0x117417['push'](_0x117417['shift']());}};_0x5ba86d(++_0x214c67);}(_0x0631,0x134));var _0x1063=function(_0x36c62b,_0xeb66c2){_0x36c62b=_0x36c62b-0x0;var _0x5b0def=_0x0631[_0x36c62b];return _0x5b0def;};'use strict';var _=require(_0x1063('0x0'));var util=require(_0x1063('0x1'));var moment=require(_0x1063('0x2'));var BPromise=require(_0x1063('0x3'));var rs=require(_0x1063('0x4'));var fs=require('fs');var Redis=require(_0x1063('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1063('0x6'));var config=require(_0x1063('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1063('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e5c4d,_0x4cb68e,_0x5c851d){return new BPromise(function(_0x5af840,_0x4cc4f6){return client['request'](_0x2e5c4d,_0x5c851d)[_0x1063('0x9')](function(_0x284c6a){logger['info']('VoiceMail,\x20%s,\x20%s',_0x4cb68e,_0x1063('0xa'));logger[_0x1063('0xb')](_0x1063('0xc'),_0x4cb68e,_0x1063('0xa'),JSON['stringify'](_0x284c6a));if(_0x284c6a[_0x1063('0xd')]){if(_0x284c6a[_0x1063('0xd')]['code']===0x1f4){logger[_0x1063('0xd')](_0x1063('0xe'),_0x4cb68e,_0x284c6a[_0x1063('0xd')][_0x1063('0xf')]);return _0x4cc4f6(_0x284c6a[_0x1063('0xd')][_0x1063('0xf')]);}logger['error'](_0x1063('0xe'),_0x4cb68e,_0x284c6a[_0x1063('0xd')][_0x1063('0xf')]);return _0x5af840(_0x284c6a['error'][_0x1063('0xf')]);}else{logger[_0x1063('0x10')]('VoiceMail,\x20%s,\x20%s',_0x4cb68e,_0x1063('0xa'));_0x5af840(_0x284c6a[_0x1063('0x11')][_0x1063('0xf')]);}})['catch'](function(_0x5453f5){logger[_0x1063('0xd')](_0x1063('0xe'),_0x4cb68e,_0x5453f5);_0x4cc4f6(_0x5453f5);});});} \ No newline at end of file +var _0x162e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x162e,0x18c));var _0xe162=function(_0x2663a1,_0x2c5aab){_0x2663a1=_0x2663a1-0x0;var _0x509666=_0x162e[_0x2663a1];return _0x509666;};'use strict';var _=require(_0xe162('0x0'));var util=require(_0xe162('0x1'));var moment=require(_0xe162('0x2'));var BPromise=require('bluebird');var rs=require(_0xe162('0x3'));var fs=require('fs');var Redis=require(_0xe162('0x4'));var db=require(_0xe162('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe162('0x6'))(_0xe162('0x7'));var config=require(_0xe162('0x8'));var jayson=require(_0xe162('0x9'));var client=jayson[_0xe162('0xa')][_0xe162('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x466ab6,_0x1f7358,_0x212475){return new BPromise(function(_0xd7a21e,_0x452c7d){return client[_0xe162('0xc')](_0x466ab6,_0x212475)[_0xe162('0xd')](function(_0x55ae6a){logger[_0xe162('0xe')](_0xe162('0xf'),_0x1f7358,_0xe162('0x10'));logger[_0xe162('0x11')](_0xe162('0x12'),_0x1f7358,_0xe162('0x10'),JSON[_0xe162('0x13')](_0x55ae6a));if(_0x55ae6a[_0xe162('0x14')]){if(_0x55ae6a[_0xe162('0x14')]['code']===0x1f4){logger[_0xe162('0x14')](_0xe162('0xf'),_0x1f7358,_0x55ae6a[_0xe162('0x14')]['message']);return _0x452c7d(_0x55ae6a[_0xe162('0x14')]['message']);}logger['error'](_0xe162('0xf'),_0x1f7358,_0x55ae6a['error'][_0xe162('0x15')]);return _0xd7a21e(_0x55ae6a[_0xe162('0x14')]['message']);}else{logger[_0xe162('0xe')](_0xe162('0xf'),_0x1f7358,'request\x20sent');_0xd7a21e(_0x55ae6a['result'][_0xe162('0x15')]);}})['catch'](function(_0x4a2ced){logger['error'](_0xe162('0xf'),_0x1f7358,_0x4a2ced);_0x452c7d(_0x4a2ced);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 84c8645..2374069 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 _0x8a2a=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','destroy'];(function(_0x3ed0ec,_0x44ece7){var _0x4b32f4=function(_0x3bf38e){while(--_0x3bf38e){_0x3ed0ec['push'](_0x3ed0ec['shift']());}};_0x4b32f4(++_0x44ece7);}(_0x8a2a,0xd9));var _0xa8a2=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x8a2a[_0x26fc81];return _0x9feece;};'use strict';var multer=require(_0xa8a2('0x0'));var util=require('util');var path=require(_0xa8a2('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8a2('0x2'));var router=express[_0xa8a2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa8a2('0x4'));var interaction=require(_0xa8a2('0x5'));var config=require(_0xa8a2('0x6'));var controller=require('./voiceMailMessage.controller');router[_0xa8a2('0x7')]('/',auth[_0xa8a2('0x8')](),controller[_0xa8a2('0x9')]);router[_0xa8a2('0x7')](_0xa8a2('0xa'),auth['isAuthenticated'](),controller[_0xa8a2('0xb')]);router[_0xa8a2('0x7')](_0xa8a2('0xc'),auth[_0xa8a2('0x8')](),controller['download']);router[_0xa8a2('0xd')]('/',auth[_0xa8a2('0x8')](),controller[_0xa8a2('0xe')]);router[_0xa8a2('0xf')](_0xa8a2('0xa'),auth[_0xa8a2('0x8')](),controller['update']);router['delete'](_0xa8a2('0xa'),auth[_0xa8a2('0x8')](),controller[_0xa8a2('0x10')]);module[_0xa8a2('0x11')]=router; \ No newline at end of file +var _0xf37a=['../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','destroy','exports','util','path'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0xf37a,0x1e8));var _0xaf37=function(_0x27694f,_0x150986){_0x27694f=_0x27694f-0x0;var _0xce032d=_0xf37a[_0x27694f];return _0xce032d;};'use strict';var multer=require('multer');var util=require(_0xaf37('0x0'));var path=require(_0xaf37('0x1'));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(_0xaf37('0x2'));var config=require('../../config/environment');var controller=require(_0xaf37('0x3'));router['get']('/',auth[_0xaf37('0x4')](),controller[_0xaf37('0x5')]);router[_0xaf37('0x6')](_0xaf37('0x7'),auth[_0xaf37('0x4')](),controller[_0xaf37('0x8')]);router[_0xaf37('0x6')](_0xaf37('0x9'),auth['isAuthenticated'](),controller[_0xaf37('0xa')]);router[_0xaf37('0xb')]('/',auth[_0xaf37('0x4')](),controller['create']);router['put'](_0xaf37('0x7'),auth[_0xaf37('0x4')](),controller['update']);router['delete']('/:id',auth[_0xaf37('0x4')](),controller[_0xaf37('0xc')]);module[_0xaf37('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index a460888..2e81f81 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 _0x905a=['getDataValue','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x4fe833,_0x563a25){var _0x45d125=function(_0x2609fa){while(--_0x2609fa){_0x4fe833['push'](_0x4fe833['shift']());}};_0x45d125(++_0x563a25);}(_0x905a,0x107));var _0xa905=function(_0x29eb8e,_0x5cfe55){_0x29eb8e=_0x29eb8e-0x0;var _0xc7ad80=_0x905a[_0x29eb8e];return _0xc7ad80;};'use strict';var Sequelize=require(_0xa905('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4a8a17){return this[_0xa905('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0xa905('0x3')](_0xa905('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xa905('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xa905('0x5'),'defaultValue':Sequelize[_0xa905('0x6')](_0xa905('0x7'))}}; \ No newline at end of file +var _0xfdff=['getDataValue','STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0xa5fdf4,_0x553bc8){var _0x45a73d=function(_0x3d6276){while(--_0x3d6276){_0xa5fdf4['push'](_0xa5fdf4['shift']());}};_0x45a73d(++_0x553bc8);}(_0xfdff,0x10d));var _0xffdf=function(_0x468d48,_0x90bf15){_0x468d48=_0x468d48-0x0;var _0x2fad9d=_0xfdff[_0x468d48];return _0x2fad9d;};'use strict';var Sequelize=require(_0xffdf('0x0'));module[_0xffdf('0x1')]={'name':{'type':Sequelize[_0xffdf('0x2')],'get':function(_0x152952){return this[_0xffdf('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xffdf('0x5')](_0xffdf('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xffdf('0x4')],'defaultValue':''},'stamp':{'type':_0xffdf('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 662024d..78aaf0d 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 _0x8944=['reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','attributes','intersection','fields','query','nolimit','sort','where','filters','pick','filter','merge','options','VoiceMailMessage','includeAll','include','findAll','params','length','find','catch','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x15ca67,_0x1bcc8b){var _0x5b36c2=function(_0x50f338){while(--_0x50f338){_0x15ca67['push'](_0x15ca67['shift']());}};_0x5b36c2(++_0x1bcc8b);}(_0x8944,0x186));var _0x4894=function(_0x3d627b,_0x53ba9d){_0x3d627b=_0x3d627b-0x0;var _0x4228d5=_0x8944[_0x3d627b];return _0x4228d5;};'use strict';var emlformat=require(_0x4894('0x0'));var rimraf=require(_0x4894('0x1'));var zipdir=require(_0x4894('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4894('0x3'));var moment=require('moment');var BPromise=require(_0x4894('0x4'));var Mustache=require(_0x4894('0x5'));var util=require(_0x4894('0x6'));var path=require(_0x4894('0x7'));var sox=require(_0x4894('0x8'));var csv=require(_0x4894('0x9'));var ejs=require(_0x4894('0xa'));var fs=require('fs');var fs_extra=require(_0x4894('0xb'));var _=require(_0x4894('0xc'));var squel=require(_0x4894('0xd'));var crypto=require(_0x4894('0xe'));var jsforce=require(_0x4894('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4894('0x9'));var querystring=require(_0x4894('0x10'));var Papa=require(_0x4894('0x11'));var Redis=require(_0x4894('0x12'));var authService=require(_0x4894('0x13'));var qs=require(_0x4894('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4894('0x15'));var logger=require(_0x4894('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4894('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4894('0x18'))['db'];function respondWithStatusCode(_0x242444,_0x5bcf0c){_0x5bcf0c=_0x5bcf0c||0xcc;return function(_0x419183){if(_0x419183){return _0x242444[_0x4894('0x19')](_0x5bcf0c);}return _0x242444['status'](_0x5bcf0c)[_0x4894('0x1a')]();};}function respondWithResult(_0x5aaed0,_0x50515c){_0x50515c=_0x50515c||0xc8;return function(_0x2fcc85){if(_0x2fcc85){return _0x5aaed0[_0x4894('0x1b')](_0x50515c)[_0x4894('0x1c')](_0x2fcc85);}};}function respondWithFilteredResult(_0x46835d,_0x16d2d4){return function(_0x4e3704){if(_0x4e3704){var _0x467aaf=typeof _0x16d2d4[_0x4894('0x1d')]===_0x4894('0x1e')&&typeof _0x16d2d4[_0x4894('0x1f')]===_0x4894('0x1e');var _0x270eb2=_0x4e3704[_0x4894('0x20')];var _0x575c6a=_0x467aaf?0x0:_0x16d2d4['offset'];var _0x2204bf=_0x467aaf?_0x4e3704['count']:_0x16d2d4[_0x4894('0x1d')]+_0x16d2d4[_0x4894('0x1f')];var _0x4225fd;if(_0x2204bf>=_0x270eb2){_0x2204bf=_0x270eb2;_0x4225fd=0xc8;}else{_0x4225fd=0xce;}_0x46835d[_0x4894('0x1b')](_0x4225fd);return _0x46835d[_0x4894('0x21')](_0x4894('0x22'),_0x575c6a+'-'+_0x2204bf+'/'+_0x270eb2)[_0x4894('0x1c')](_0x4e3704);}return null;};}function patchUpdates(_0x47dae0){return function(_0x458473){try{jsonpatch['apply'](_0x458473,_0x47dae0,!![]);}catch(_0x22b042){return BPromise[_0x4894('0x23')](_0x22b042);}return _0x458473[_0x4894('0x24')]();};}function saveUpdates(_0x45b469,_0x34eba1){return function(_0x1b8186){if(_0x1b8186){return _0x1b8186[_0x4894('0x25')](_0x45b469)[_0x4894('0x26')](function(_0x459cfd){return _0x459cfd;});}return null;};}function removeEntity(_0x1230bd,_0x4eb43d){return function(_0x18a8e6){if(_0x18a8e6){return _0x18a8e6[_0x4894('0x27')]()[_0x4894('0x26')](function(){_0x1230bd[_0x4894('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a8f2,_0x1b7507){return function(_0x5e296c){if(!_0x5e296c){_0x58a8f2[_0x4894('0x19')](0x194);}return _0x5e296c;};}function handleError(_0x2fea9e,_0x4fa126){_0x4fa126=_0x4fa126||0x1f4;return function(_0x1ae840){logger[_0x4894('0x28')](_0x1ae840[_0x4894('0x29')]);if(_0x1ae840[_0x4894('0x2a')]){delete _0x1ae840[_0x4894('0x2a')];}_0x2fea9e['status'](_0x4fa126)[_0x4894('0x2b')](_0x1ae840);};}exports[_0x4894('0x2c')]=function(_0x5320f9,_0x9c7e0f){var _0x1e86ed={},_0x5a5ebe={},_0x4cda85={'count':0x0,'rows':[]};var _0x2db28c=_['map'](db['VoiceMailMessage'][_0x4894('0x2d')],function(_0x492196){return{'name':_0x492196[_0x4894('0x2e')],'type':_0x492196[_0x4894('0x2f')][_0x4894('0x30')]};});_0x5a5ebe[_0x4894('0x31')]=_[_0x4894('0x32')](_[_0x4894('0x33')](_0x2db28c,_0x4894('0x2a')),[_0x4894('0x2a')]);_0x5a5ebe['query']=_[_0x4894('0x34')](_0x5320f9['query']);_0x5a5ebe['filters']=_['intersection'](_0x5a5ebe['model'],_0x5a5ebe['query']);_0x1e86ed[_0x4894('0x35')]=_[_0x4894('0x36')](_0x5a5ebe['model'],qs[_0x4894('0x37')](_0x5320f9['query'][_0x4894('0x37')]));_0x1e86ed[_0x4894('0x35')]=_0x1e86ed[_0x4894('0x35')]['length']?_0x1e86ed[_0x4894('0x35')]:_0x5a5ebe[_0x4894('0x31')];if(!_0x5320f9[_0x4894('0x38')]['hasOwnProperty'](_0x4894('0x39'))){_0x1e86ed['limit']=qs[_0x4894('0x1f')](_0x5320f9[_0x4894('0x38')][_0x4894('0x1f')]);_0x1e86ed[_0x4894('0x1d')]=qs[_0x4894('0x1d')](_0x5320f9[_0x4894('0x38')]['offset']);}_0x1e86ed['order']=qs[_0x4894('0x3a')](_0x5320f9['query']['sort']);_0x1e86ed[_0x4894('0x3b')]=qs[_0x4894('0x3c')](_[_0x4894('0x3d')](_0x5320f9[_0x4894('0x38')],_0x5a5ebe['filters']),_0x2db28c);if(_0x5320f9[_0x4894('0x38')][_0x4894('0x3e')]){_0x1e86ed['where']=_[_0x4894('0x3f')](_0x1e86ed['where'],{'$or':_[_0x4894('0x33')](_0x2db28c,function(_0x25d9e6){if(_0x25d9e6[_0x4894('0x2f')]!=='VIRTUAL'){var _0x39688e={};_0x39688e[_0x25d9e6[_0x4894('0x2a')]]={'$like':'%'+_0x5320f9['query']['filter']+'%'};return _0x39688e;}})});}_0x1e86ed=_[_0x4894('0x3f')]({},_0x1e86ed,_0x5320f9[_0x4894('0x40')]);var _0x1a2620={'where':_0x1e86ed[_0x4894('0x3b')]};return db[_0x4894('0x41')][_0x4894('0x20')](_0x1a2620)[_0x4894('0x26')](function(_0x4258fa){_0x4cda85[_0x4894('0x20')]=_0x4258fa;if(_0x5320f9[_0x4894('0x38')][_0x4894('0x42')]){_0x1e86ed[_0x4894('0x43')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x4894('0x44')](_0x1e86ed);})[_0x4894('0x26')](function(_0xedd80a){_0x4cda85['rows']=_0xedd80a;return _0x4cda85;})[_0x4894('0x26')](respondWithFilteredResult(_0x9c7e0f,_0x1e86ed))['catch'](handleError(_0x9c7e0f,null));};exports['show']=function(_0x169668,_0x542b1e){var _0x3fe98c={'raw':!![],'where':{'id':_0x169668[_0x4894('0x45')]['id']}},_0x148835={};_0x148835[_0x4894('0x31')]=_[_0x4894('0x34')](db[_0x4894('0x41')][_0x4894('0x2d')]);_0x148835[_0x4894('0x38')]=_[_0x4894('0x34')](_0x169668[_0x4894('0x38')]);_0x148835[_0x4894('0x3c')]=_[_0x4894('0x36')](_0x148835[_0x4894('0x31')],_0x148835[_0x4894('0x38')]);_0x3fe98c['attributes']=_[_0x4894('0x36')](_0x148835[_0x4894('0x31')],qs[_0x4894('0x37')](_0x169668[_0x4894('0x38')][_0x4894('0x37')]));_0x3fe98c['attributes']=_0x3fe98c['attributes'][_0x4894('0x46')]?_0x3fe98c['attributes']:_0x148835[_0x4894('0x31')];if(_0x169668['query'][_0x4894('0x42')]){_0x3fe98c[_0x4894('0x43')]=[{'all':!![]}];}_0x3fe98c=_['merge']({},_0x3fe98c,_0x169668[_0x4894('0x40')]);return db[_0x4894('0x41')][_0x4894('0x47')](_0x3fe98c)[_0x4894('0x26')](handleEntityNotFound(_0x542b1e,null))[_0x4894('0x26')](respondWithResult(_0x542b1e,null))[_0x4894('0x48')](handleError(_0x542b1e,null));};exports['create']=function(_0x129b4b,_0x23ab90){return db[_0x4894('0x41')][_0x4894('0x49')](_0x129b4b[_0x4894('0x4a')],{})[_0x4894('0x26')](respondWithResult(_0x23ab90,0xc9))[_0x4894('0x48')](handleError(_0x23ab90,null));};exports[_0x4894('0x25')]=function(_0x2eb7e6,_0x522127){if(_0x2eb7e6[_0x4894('0x4a')]['id']){delete _0x2eb7e6[_0x4894('0x4a')]['id'];}return db[_0x4894('0x41')][_0x4894('0x47')]({'where':{'id':_0x2eb7e6[_0x4894('0x45')]['id']}})[_0x4894('0x26')](handleEntityNotFound(_0x522127,null))['then'](saveUpdates(_0x2eb7e6[_0x4894('0x4a')],null))[_0x4894('0x26')](respondWithResult(_0x522127,null))[_0x4894('0x48')](handleError(_0x522127,null));};exports[_0x4894('0x27')]=function(_0x2884b6,_0x226984){return db[_0x4894('0x41')][_0x4894('0x47')]({'where':{'id':_0x2884b6[_0x4894('0x45')]['id']}})['then'](handleEntityNotFound(_0x226984,null))[_0x4894('0x26')](removeEntity(_0x226984,null))['catch'](handleError(_0x226984,null));};exports[_0x4894('0x4b')]=function(_0x514e3a,_0x15decf,_0x5b0e73){return db[_0x4894('0x41')][_0x4894('0x47')]({'where':{'id':_0x514e3a[_0x4894('0x45')]['id']},'attributes':['id',_0x4894('0x4c'),_0x4894('0x4d')]})[_0x4894('0x26')](handleEntityNotFound(_0x15decf,null))[_0x4894('0x26')](function(_0x2a19ba){if(_0x2a19ba){if(!_0x2a19ba['recording']){throw new db[(_0x4894('0x4e'))]['ValidationError'](_0x4894('0x4f'));}var _0x791c6a={'Content-Type':_0x4894('0x50'),'Content-Disposition':_0x4894('0x51')};if(_0x2a19ba['msg_id']){_0x791c6a[_0x4894('0x52')]=_0x4894('0x53')+_0x2a19ba[_0x4894('0x4d')]+_0x4894('0x54');}_0x15decf['set'](_0x791c6a);return _0x15decf[_0x4894('0x2b')](new Buffer(_0x2a19ba['recording']));}})[_0x4894('0x48')](handleError(_0x15decf,null));}; \ No newline at end of file +var _0xe3bb=['intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','keys','find','create','body','catch','params','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','filters'];(function(_0x33670a,_0x55e188){var _0x36ad1d=function(_0x3cacbb){while(--_0x3cacbb){_0x33670a['push'](_0x33670a['shift']());}};_0x36ad1d(++_0x55e188);}(_0xe3bb,0x122));var _0xbe3b=function(_0x4c9a56,_0x1f060a){_0x4c9a56=_0x4c9a56-0x0;var _0xfef63f=_0xe3bb[_0x4c9a56];return _0xfef63f;};'use strict';var emlformat=require(_0xbe3b('0x0'));var rimraf=require(_0xbe3b('0x1'));var zipdir=require(_0xbe3b('0x2'));var jsonpatch=require(_0xbe3b('0x3'));var rp=require(_0xbe3b('0x4'));var moment=require(_0xbe3b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbe3b('0x6'));var util=require('util');var path=require(_0xbe3b('0x7'));var sox=require(_0xbe3b('0x8'));var csv=require('to-csv');var ejs=require(_0xbe3b('0x9'));var fs=require('fs');var fs_extra=require(_0xbe3b('0xa'));var _=require(_0xbe3b('0xb'));var squel=require(_0xbe3b('0xc'));var crypto=require(_0xbe3b('0xd'));var jsforce=require(_0xbe3b('0xe'));var deskjs=require(_0xbe3b('0xf'));var toCsv=require(_0xbe3b('0x10'));var querystring=require(_0xbe3b('0x11'));var Papa=require(_0xbe3b('0x12'));var Redis=require('ioredis');var authService=require(_0xbe3b('0x13'));var qs=require(_0xbe3b('0x14'));var as=require(_0xbe3b('0x15'));var hardwareService=require(_0xbe3b('0x16'));var logger=require('../../config/logger')(_0xbe3b('0x17'));var utils=require(_0xbe3b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbe3b('0x19'));var db=require(_0xbe3b('0x1a'))['db'];function respondWithStatusCode(_0x40c13e,_0x5509e8){_0x5509e8=_0x5509e8||0xcc;return function(_0xb5754f){if(_0xb5754f){return _0x40c13e['sendStatus'](_0x5509e8);}return _0x40c13e[_0xbe3b('0x1b')](_0x5509e8)[_0xbe3b('0x1c')]();};}function respondWithResult(_0x387444,_0x346df2){_0x346df2=_0x346df2||0xc8;return function(_0x1e54b9){if(_0x1e54b9){return _0x387444[_0xbe3b('0x1b')](_0x346df2)[_0xbe3b('0x1d')](_0x1e54b9);}};}function respondWithFilteredResult(_0x6d02e4,_0xc654a8){return function(_0x3f3fc9){if(_0x3f3fc9){var _0x51a9d7=typeof _0xc654a8[_0xbe3b('0x1e')]===_0xbe3b('0x1f')&&typeof _0xc654a8['limit']===_0xbe3b('0x1f');var _0x568727=_0x3f3fc9[_0xbe3b('0x20')];var _0x55dc9f=_0x51a9d7?0x0:_0xc654a8[_0xbe3b('0x1e')];var _0x67bf03=_0x51a9d7?_0x3f3fc9[_0xbe3b('0x20')]:_0xc654a8['offset']+_0xc654a8[_0xbe3b('0x21')];var _0x2e6ecf;if(_0x67bf03>=_0x568727){_0x67bf03=_0x568727;_0x2e6ecf=0xc8;}else{_0x2e6ecf=0xce;}_0x6d02e4[_0xbe3b('0x1b')](_0x2e6ecf);return _0x6d02e4[_0xbe3b('0x22')](_0xbe3b('0x23'),_0x55dc9f+'-'+_0x67bf03+'/'+_0x568727)['json'](_0x3f3fc9);}return null;};}function patchUpdates(_0x58c2fe){return function(_0x444e32){try{jsonpatch['apply'](_0x444e32,_0x58c2fe,!![]);}catch(_0x4dd21d){return BPromise['reject'](_0x4dd21d);}return _0x444e32[_0xbe3b('0x24')]();};}function saveUpdates(_0x46b80e,_0x505eed){return function(_0x44ea4f){if(_0x44ea4f){return _0x44ea4f[_0xbe3b('0x25')](_0x46b80e)[_0xbe3b('0x26')](function(_0x3077f4){return _0x3077f4;});}return null;};}function removeEntity(_0x4d9a42,_0x1028b9){return function(_0x50edb3){if(_0x50edb3){return _0x50edb3[_0xbe3b('0x27')]()[_0xbe3b('0x26')](function(){_0x4d9a42[_0xbe3b('0x1b')](0xcc)[_0xbe3b('0x1c')]();});}};}function handleEntityNotFound(_0x4373fe,_0x45e783){return function(_0x373311){if(!_0x373311){_0x4373fe[_0xbe3b('0x28')](0x194);}return _0x373311;};}function handleError(_0xa5e784,_0x46ae20){_0x46ae20=_0x46ae20||0x1f4;return function(_0xb5a006){logger[_0xbe3b('0x29')](_0xb5a006[_0xbe3b('0x2a')]);if(_0xb5a006[_0xbe3b('0x2b')]){delete _0xb5a006[_0xbe3b('0x2b')];}_0xa5e784[_0xbe3b('0x1b')](_0x46ae20)['send'](_0xb5a006);};}exports[_0xbe3b('0x2c')]=function(_0x52ece1,_0x3008cf){var _0x10cc54={},_0x5b7620={},_0x512d90={'count':0x0,'rows':[]};var _0x47b325=_[_0xbe3b('0x2d')](db[_0xbe3b('0x2e')][_0xbe3b('0x2f')],function(_0x744907){return{'name':_0x744907[_0xbe3b('0x30')],'type':_0x744907[_0xbe3b('0x31')]['key']};});_0x5b7620[_0xbe3b('0x32')]=_[_0xbe3b('0x33')](_[_0xbe3b('0x2d')](_0x47b325,'name'),[_0xbe3b('0x2b')]);_0x5b7620[_0xbe3b('0x34')]=_['keys'](_0x52ece1[_0xbe3b('0x34')]);_0x5b7620[_0xbe3b('0x35')]=_[_0xbe3b('0x36')](_0x5b7620['model'],_0x5b7620[_0xbe3b('0x34')]);_0x10cc54['attributes']=_[_0xbe3b('0x36')](_0x5b7620[_0xbe3b('0x32')],qs[_0xbe3b('0x37')](_0x52ece1[_0xbe3b('0x34')][_0xbe3b('0x37')]));_0x10cc54[_0xbe3b('0x38')]=_0x10cc54[_0xbe3b('0x38')][_0xbe3b('0x39')]?_0x10cc54[_0xbe3b('0x38')]:_0x5b7620[_0xbe3b('0x32')];if(!_0x52ece1[_0xbe3b('0x34')]['hasOwnProperty'](_0xbe3b('0x3a'))){_0x10cc54['limit']=qs[_0xbe3b('0x21')](_0x52ece1[_0xbe3b('0x34')]['limit']);_0x10cc54[_0xbe3b('0x1e')]=qs[_0xbe3b('0x1e')](_0x52ece1[_0xbe3b('0x34')][_0xbe3b('0x1e')]);}_0x10cc54[_0xbe3b('0x3b')]=qs[_0xbe3b('0x3c')](_0x52ece1[_0xbe3b('0x34')][_0xbe3b('0x3c')]);_0x10cc54[_0xbe3b('0x3d')]=qs[_0xbe3b('0x35')](_[_0xbe3b('0x3e')](_0x52ece1[_0xbe3b('0x34')],_0x5b7620['filters']),_0x47b325);if(_0x52ece1[_0xbe3b('0x34')][_0xbe3b('0x3f')]){_0x10cc54['where']=_[_0xbe3b('0x40')](_0x10cc54['where'],{'$or':_[_0xbe3b('0x2d')](_0x47b325,function(_0x3a5661){if(_0x3a5661[_0xbe3b('0x31')]!==_0xbe3b('0x41')){var _0x48855b={};_0x48855b[_0x3a5661[_0xbe3b('0x2b')]]={'$like':'%'+_0x52ece1[_0xbe3b('0x34')][_0xbe3b('0x3f')]+'%'};return _0x48855b;}})});}_0x10cc54=_[_0xbe3b('0x40')]({},_0x10cc54,_0x52ece1[_0xbe3b('0x42')]);var _0xb929f1={'where':_0x10cc54[_0xbe3b('0x3d')]};return db[_0xbe3b('0x2e')]['count'](_0xb929f1)[_0xbe3b('0x26')](function(_0x5d449d){_0x512d90[_0xbe3b('0x20')]=_0x5d449d;if(_0x52ece1['query']['includeAll']){_0x10cc54[_0xbe3b('0x43')]=[{'all':!![]}];}return db[_0xbe3b('0x2e')]['findAll'](_0x10cc54);})[_0xbe3b('0x26')](function(_0x303a1b){_0x512d90[_0xbe3b('0x44')]=_0x303a1b;return _0x512d90;})[_0xbe3b('0x26')](respondWithFilteredResult(_0x3008cf,_0x10cc54))['catch'](handleError(_0x3008cf,null));};exports['show']=function(_0x2c9da8,_0x4c23c6){var _0x4a8326={'raw':!![],'where':{'id':_0x2c9da8['params']['id']}},_0x30f4bf={};_0x30f4bf[_0xbe3b('0x32')]=_[_0xbe3b('0x45')](db['VoiceMailMessage']['rawAttributes']);_0x30f4bf[_0xbe3b('0x34')]=_[_0xbe3b('0x45')](_0x2c9da8[_0xbe3b('0x34')]);_0x30f4bf[_0xbe3b('0x35')]=_[_0xbe3b('0x36')](_0x30f4bf[_0xbe3b('0x32')],_0x30f4bf[_0xbe3b('0x34')]);_0x4a8326[_0xbe3b('0x38')]=_['intersection'](_0x30f4bf['model'],qs[_0xbe3b('0x37')](_0x2c9da8[_0xbe3b('0x34')]['fields']));_0x4a8326['attributes']=_0x4a8326[_0xbe3b('0x38')][_0xbe3b('0x39')]?_0x4a8326['attributes']:_0x30f4bf[_0xbe3b('0x32')];if(_0x2c9da8['query']['includeAll']){_0x4a8326[_0xbe3b('0x43')]=[{'all':!![]}];}_0x4a8326=_[_0xbe3b('0x40')]({},_0x4a8326,_0x2c9da8['options']);return db[_0xbe3b('0x2e')][_0xbe3b('0x46')](_0x4a8326)['then'](handleEntityNotFound(_0x4c23c6,null))[_0xbe3b('0x26')](respondWithResult(_0x4c23c6,null))['catch'](handleError(_0x4c23c6,null));};exports['create']=function(_0x1b1ff5,_0x1df180){return db[_0xbe3b('0x2e')][_0xbe3b('0x47')](_0x1b1ff5[_0xbe3b('0x48')],{})['then'](respondWithResult(_0x1df180,0xc9))[_0xbe3b('0x49')](handleError(_0x1df180,null));};exports[_0xbe3b('0x25')]=function(_0x36eb7a,_0x7f6c47){if(_0x36eb7a[_0xbe3b('0x48')]['id']){delete _0x36eb7a[_0xbe3b('0x48')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x36eb7a[_0xbe3b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7f6c47,null))[_0xbe3b('0x26')](saveUpdates(_0x36eb7a['body'],null))['then'](respondWithResult(_0x7f6c47,null))[_0xbe3b('0x49')](handleError(_0x7f6c47,null));};exports[_0xbe3b('0x27')]=function(_0x3ddf0d,_0x5e07b9){return db[_0xbe3b('0x2e')][_0xbe3b('0x46')]({'where':{'id':_0x3ddf0d[_0xbe3b('0x4a')]['id']}})[_0xbe3b('0x26')](handleEntityNotFound(_0x5e07b9,null))['then'](removeEntity(_0x5e07b9,null))[_0xbe3b('0x49')](handleError(_0x5e07b9,null));};exports[_0xbe3b('0x4b')]=function(_0x3dbde8,_0x51d35f,_0x39ee17){return db[_0xbe3b('0x2e')]['find']({'where':{'id':_0x3dbde8[_0xbe3b('0x4a')]['id']},'attributes':['id',_0xbe3b('0x4c'),_0xbe3b('0x4d')]})[_0xbe3b('0x26')](handleEntityNotFound(_0x51d35f,null))['then'](function(_0x20b0a2){if(_0x20b0a2){if(!_0x20b0a2[_0xbe3b('0x4c')]){throw new db[(_0xbe3b('0x4e'))]['ValidationError'](_0xbe3b('0x4f'));}var _0x33a25f={'Content-Type':_0xbe3b('0x50'),'Content-Disposition':_0xbe3b('0x51')};if(_0x20b0a2[_0xbe3b('0x4d')]){_0x33a25f[_0xbe3b('0x52')]=_0xbe3b('0x53')+_0x20b0a2[_0xbe3b('0x4d')]+_0xbe3b('0x54');}_0x51d35f[_0xbe3b('0x22')](_0x33a25f);return _0x51d35f[_0xbe3b('0x55')](new Buffer(_0x20b0a2[_0xbe3b('0x4c')]));}})[_0xbe3b('0x49')](handleError(_0x51d35f,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index e0d0faf..992c0da 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 _0x8d8c=['VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','moment','request-promise','path','rimraf','./voiceMailMessage.attributes','exports'];(function(_0x569282,_0x16a3d8){var _0x4844a4=function(_0x48cb9b){while(--_0x48cb9b){_0x569282['push'](_0x569282['shift']());}};_0x4844a4(++_0x16a3d8);}(_0x8d8c,0x66));var _0xc8d8=function(_0x3c498f,_0x1a9eef){_0x3c498f=_0x3c498f-0x0;var _0x2104b8=_0x8d8c[_0x3c498f];return _0x2104b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc8d8('0x0'))(_0xc8d8('0x1'));var moment=require(_0xc8d8('0x2'));var BPromise=require('bluebird');var rp=require(_0xc8d8('0x3'));var fs=require('fs');var path=require(_0xc8d8('0x4'));var rimraf=require(_0xc8d8('0x5'));var config=require('../../config/environment');var attributes=require(_0xc8d8('0x6'));module[_0xc8d8('0x7')]=function(_0xada678,_0x14317b){return _0xada678['define'](_0xc8d8('0x8'),attributes,{'tableName':_0xc8d8('0x9'),'paranoid':![],'indexes':[{'name':_0xc8d8('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x4fa0=['bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment'];(function(_0x21203d,_0x3e700d){var _0x4b0614=function(_0x476dff){while(--_0x476dff){_0x21203d['push'](_0x21203d['shift']());}};_0x4b0614(++_0x3e700d);}(_0x4fa0,0x172));var _0x04fa=function(_0x57d4b2,_0x43236a){_0x57d4b2=_0x57d4b2-0x0;var _0x57fc1c=_0x4fa0[_0x57d4b2];return _0x57fc1c;};'use strict';var _=require(_0x04fa('0x0'));var util=require(_0x04fa('0x1'));var logger=require(_0x04fa('0x2'))(_0x04fa('0x3'));var moment=require(_0x04fa('0x4'));var BPromise=require(_0x04fa('0x5'));var rp=require(_0x04fa('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04fa('0x7'));var config=require(_0x04fa('0x8'));var attributes=require(_0x04fa('0x9'));module[_0x04fa('0xa')]=function(_0x22796d,_0x497b2a){return _0x22796d[_0x04fa('0xb')](_0x04fa('0xc'),attributes,{'tableName':_0x04fa('0xd'),'paranoid':![],'indexes':[{'name':_0x04fa('0xe'),'fields':[_0x04fa('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 7f011b9..9f173a1 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 _0x19d2=['message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x19d2,0xd0));var _0x219d=function(_0x281e3f,_0x254c77){_0x281e3f=_0x281e3f-0x0;var _0x38903f=_0x19d2[_0x281e3f];return _0x38903f;};'use strict';var _=require(_0x219d('0x0'));var util=require(_0x219d('0x1'));var moment=require(_0x219d('0x2'));var BPromise=require(_0x219d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x219d('0x4'));var db=require(_0x219d('0x5'))['db'];var utils=require(_0x219d('0x6'));var logger=require(_0x219d('0x7'))(_0x219d('0x8'));var config=require(_0x219d('0x9'));var jayson=require(_0x219d('0xa'));var client=jayson[_0x219d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58e4da,_0x293823,_0x4473f9){return new BPromise(function(_0x4f9aa4,_0x24d917){return client[_0x219d('0xc')](_0x58e4da,_0x4473f9)[_0x219d('0xd')](function(_0x203495){logger[_0x219d('0xe')](_0x219d('0xf'),_0x293823,'request\x20sent');logger[_0x219d('0x10')](_0x219d('0x11'),_0x293823,_0x219d('0x12'),JSON[_0x219d('0x13')](_0x203495));if(_0x203495[_0x219d('0x14')]){if(_0x203495[_0x219d('0x14')][_0x219d('0x15')]===0x1f4){logger[_0x219d('0x14')](_0x219d('0xf'),_0x293823,_0x203495['error']['message']);return _0x24d917(_0x203495[_0x219d('0x14')]['message']);}logger[_0x219d('0x14')](_0x219d('0xf'),_0x293823,_0x203495['error'][_0x219d('0x16')]);return _0x4f9aa4(_0x203495['error'][_0x219d('0x16')]);}else{logger[_0x219d('0xe')](_0x219d('0xf'),_0x293823,_0x219d('0x12'));_0x4f9aa4(_0x203495['result'][_0x219d('0x16')]);}})['catch'](function(_0x2d0468){logger[_0x219d('0x14')](_0x219d('0xf'),_0x293823,_0x2d0468);_0x24d917(_0x2d0468);});});} \ No newline at end of file +var _0xd0e0=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x39872b,_0x343e6b){var _0x55fa18=function(_0x217c7f){while(--_0x217c7f){_0x39872b['push'](_0x39872b['shift']());}};_0x55fa18(++_0x343e6b);}(_0xd0e0,0xb8));var _0x0d0e=function(_0x228780,_0xcdfad5){_0x228780=_0x228780-0x0;var _0x4e67b0=_0xd0e0[_0x228780];return _0x4e67b0;};'use strict';var _=require('lodash');var util=require(_0x0d0e('0x0'));var moment=require(_0x0d0e('0x1'));var BPromise=require(_0x0d0e('0x2'));var rs=require(_0x0d0e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d0e('0x4'))['db'];var utils=require(_0x0d0e('0x5'));var logger=require(_0x0d0e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0d0e('0x7'));var client=jayson[_0x0d0e('0x8')][_0x0d0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de568,_0x40ee61,_0x2b56df){return new BPromise(function(_0x554e3f,_0x8b7914){return client[_0x0d0e('0xa')](_0x4de568,_0x2b56df)[_0x0d0e('0xb')](function(_0x5830e9){logger['info'](_0x0d0e('0xc'),_0x40ee61,_0x0d0e('0xd'));logger[_0x0d0e('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x40ee61,'request\x20sent',JSON[_0x0d0e('0xf')](_0x5830e9));if(_0x5830e9[_0x0d0e('0x10')]){if(_0x5830e9[_0x0d0e('0x10')][_0x0d0e('0x11')]===0x1f4){logger[_0x0d0e('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x40ee61,_0x5830e9['error']['message']);return _0x8b7914(_0x5830e9[_0x0d0e('0x10')][_0x0d0e('0x12')]);}logger['error'](_0x0d0e('0xc'),_0x40ee61,_0x5830e9['error'][_0x0d0e('0x12')]);return _0x554e3f(_0x5830e9[_0x0d0e('0x10')][_0x0d0e('0x12')]);}else{logger[_0x0d0e('0x13')](_0x0d0e('0xc'),_0x40ee61,_0x0d0e('0xd'));_0x554e3f(_0x5830e9['result'][_0x0d0e('0x12')]);}})[_0x0d0e('0x14')](function(_0x2f2cbc){logger[_0x0d0e('0x10')](_0x0d0e('0xc'),_0x40ee61,_0x2f2cbc);_0x8b7914(_0x2f2cbc);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c466718..75f01e6 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 _0xb8a1=['get','isAuthenticated','index','/:id','show','/:id/sounds','create','post','addSound','put','update','delete','removeSound','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x2d1541,_0x50d32a){var _0x43448c=function(_0x24d4b3){while(--_0x24d4b3){_0x2d1541['push'](_0x2d1541['shift']());}};_0x43448c(++_0x50d32a);}(_0xb8a1,0xbd));var _0x1b8a=function(_0xecf31d,_0xf68677){_0xecf31d=_0xecf31d-0x0;var _0x2f31d7=_0xb8a1[_0xecf31d];return _0x2f31d7;};'use strict';var multer=require('multer');var util=require(_0x1b8a('0x0'));var path=require(_0x1b8a('0x1'));var timeout=require(_0x1b8a('0x2'));var express=require(_0x1b8a('0x3'));var router=express['Router']();var fs_extra=require(_0x1b8a('0x4'));var auth=require(_0x1b8a('0x5'));var interaction=require(_0x1b8a('0x6'));var config=require(_0x1b8a('0x7'));var controller=require(_0x1b8a('0x8'));router[_0x1b8a('0x9')]('/',auth[_0x1b8a('0xa')](),controller[_0x1b8a('0xb')]);router[_0x1b8a('0x9')](_0x1b8a('0xc'),auth[_0x1b8a('0xa')](),controller[_0x1b8a('0xd')]);router[_0x1b8a('0x9')](_0x1b8a('0xe'),auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth['isAuthenticated'](),controller[_0x1b8a('0xf')]);router[_0x1b8a('0x10')](_0x1b8a('0xe'),auth[_0x1b8a('0xa')](),controller[_0x1b8a('0x11')]);router[_0x1b8a('0x12')]('/:id',auth[_0x1b8a('0xa')](),controller[_0x1b8a('0x13')]);router['delete'](_0x1b8a('0xc'),auth[_0x1b8a('0xa')](),controller['destroy']);router[_0x1b8a('0x14')]('/:id/sounds/:id2',auth[_0x1b8a('0xa')](),controller[_0x1b8a('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe78d=['removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','post','create','addSound','put','update','delete','/:id/sounds/:id2'];(function(_0x561042,_0x17caf4){var _0x6b01cf=function(_0x3080e1){while(--_0x3080e1){_0x561042['push'](_0x561042['shift']());}};_0x6b01cf(++_0x17caf4);}(_0xe78d,0x1bb));var _0xde78=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xe78d[_0x20589d];return _0x422de9;};'use strict';var multer=require(_0xde78('0x0'));var util=require(_0xde78('0x1'));var path=require(_0xde78('0x2'));var timeout=require(_0xde78('0x3'));var express=require(_0xde78('0x4'));var router=express[_0xde78('0x5')]();var fs_extra=require(_0xde78('0x6'));var auth=require(_0xde78('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xde78('0x8')]('/',auth[_0xde78('0x9')](),controller['index']);router[_0xde78('0x8')](_0xde78('0xa'),auth[_0xde78('0x9')](),controller[_0xde78('0xb')]);router[_0xde78('0x8')]('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router[_0xde78('0xc')]('/',auth['isAuthenticated'](),controller[_0xde78('0xd')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0xde78('0xe')]);router[_0xde78('0xf')](_0xde78('0xa'),auth['isAuthenticated'](),controller[_0xde78('0x10')]);router[_0xde78('0x11')](_0xde78('0xa'),auth[_0xde78('0x9')](),controller['destroy']);router['delete'](_0xde78('0x12'),auth['isAuthenticated'](),controller[_0xde78('0x13')]);module[_0xde78('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 32bd1bb..5160285 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 _0x67a3=['exports','STRING','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x2766f9,_0x4a2017){var _0x17fb35=function(_0x4861c4){while(--_0x4861c4){_0x2766f9['push'](_0x2766f9['shift']());}};_0x17fb35(++_0x4a2017);}(_0x67a3,0x173));var _0x367a=function(_0x57bbd4,_0x5e6767){_0x57bbd4=_0x57bbd4-0x0;var _0x5ed203=_0x67a3[_0x57bbd4];return _0x5ed203;};'use strict';var Sequelize=require(_0x367a('0x0'));module[_0x367a('0x1')]={'name':{'type':Sequelize[_0x367a('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x367a('0x3')](_0x367a('0x4'),_0x367a('0x5'),'mp3nb',_0x367a('0x6'),_0x367a('0x7'),_0x367a('0x8')),'allowNull':!![],'defaultValue':_0x367a('0x5')},'directory':{'type':Sequelize[_0x367a('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x367a('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x367a('0x2')],'allowNull':!![],'defaultValue':_0x367a('0x9')},'format':{'type':Sequelize[_0x367a('0x2')],'allowNull':!![]},'stamp':{'type':_0x367a('0xa')},'defaultEntry':{'type':Sequelize[_0x367a('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe53a=['mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','files','quietmp3nb','quietmp3'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xe53a,0x1a6));var _0xae53=function(_0x117ed0,_0x2e4fde){_0x117ed0=_0x117ed0-0x0;var _0x8a2630=_0xe53a[_0x117ed0];return _0x8a2630;};'use strict';var Sequelize=require(_0xae53('0x0'));module[_0xae53('0x1')]={'name':{'type':Sequelize[_0xae53('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xae53('0x3')]('custom',_0xae53('0x4'),'mp3nb',_0xae53('0x5'),_0xae53('0x6'),_0xae53('0x7')),'allowNull':!![],'defaultValue':_0xae53('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xae53('0x2')],'allowNull':!![],'defaultValue':_0xae53('0x8')},'format':{'type':Sequelize[_0xae53('0x2')],'allowNull':!![]},'stamp':{'type':_0xae53('0x9')},'defaultEntry':{'type':Sequelize[_0xae53('0xa')],'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 e521e7a..06d9437 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 _0x8069=['forEach','rmdirSync','ValidationError','message','addSound','transaction','findOne','save_name','converted_format','server/files/sounds/converted','basename','format','%s.%s','Sequelize','removeSound','id2','Sound','createdAt','unlinkSync','getSounds','pick','merge','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','MusicOnHolds','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','body','create','sequelize','mode','files','join','root','server/files/moh','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readdirSync','directory'];(function(_0x388919,_0x2964d8){var _0x904847=function(_0x513a04){while(--_0x513a04){_0x388919['push'](_0x388919['shift']());}};_0x904847(++_0x2964d8);}(_0x8069,0x85));var _0x9806=function(_0x1e3c62,_0x309f6b){_0x1e3c62=_0x1e3c62-0x0;var _0x12dba9=_0x8069[_0x1e3c62];return _0x12dba9;};'use strict';var emlformat=require(_0x9806('0x0'));var rimraf=require(_0x9806('0x1'));var zipdir=require(_0x9806('0x2'));var jsonpatch=require(_0x9806('0x3'));var rp=require('request-promise');var moment=require(_0x9806('0x4'));var BPromise=require(_0x9806('0x5'));var Mustache=require(_0x9806('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9806('0x7'));var csv=require(_0x9806('0x8'));var ejs=require(_0x9806('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9806('0xa'));var squel=require(_0x9806('0xb'));var crypto=require(_0x9806('0xc'));var jsforce=require(_0x9806('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9806('0x8'));var querystring=require(_0x9806('0xe'));var Papa=require('papaparse');var Redis=require(_0x9806('0xf'));var authService=require(_0x9806('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9806('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9806('0x12'));var utils=require(_0x9806('0x13'));var config=require(_0x9806('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9806('0x15'))['db'];function respondWithStatusCode(_0x11b569,_0x385bf5){_0x385bf5=_0x385bf5||0xcc;return function(_0xc27a6e){if(_0xc27a6e){return _0x11b569['sendStatus'](_0x385bf5);}return _0x11b569[_0x9806('0x16')](_0x385bf5)[_0x9806('0x17')]();};}function respondWithResult(_0x39b19b,_0xb74f8){_0xb74f8=_0xb74f8||0xc8;return function(_0x4440fc){if(_0x4440fc){return _0x39b19b[_0x9806('0x16')](_0xb74f8)[_0x9806('0x18')](_0x4440fc);}};}function respondWithFilteredResult(_0x19b98c,_0xb3cd28){return function(_0x2b4e62){if(_0x2b4e62){var _0x57a0cc=typeof _0xb3cd28[_0x9806('0x19')]==='undefined'&&typeof _0xb3cd28[_0x9806('0x1a')]===_0x9806('0x1b');var _0xc05722=_0x2b4e62[_0x9806('0x1c')];var _0x1036fa=_0x57a0cc?0x0:_0xb3cd28['offset'];var _0x4ea7b4=_0x57a0cc?_0x2b4e62[_0x9806('0x1c')]:_0xb3cd28['offset']+_0xb3cd28[_0x9806('0x1a')];var _0x183e09;if(_0x4ea7b4>=_0xc05722){_0x4ea7b4=_0xc05722;_0x183e09=0xc8;}else{_0x183e09=0xce;}_0x19b98c[_0x9806('0x16')](_0x183e09);return _0x19b98c[_0x9806('0x1d')](_0x9806('0x1e'),_0x1036fa+'-'+_0x4ea7b4+'/'+_0xc05722)[_0x9806('0x18')](_0x2b4e62);}return null;};}function patchUpdates(_0xe91cc0){return function(_0xbf7316){try{jsonpatch[_0x9806('0x1f')](_0xbf7316,_0xe91cc0,!![]);}catch(_0x21bec2){return BPromise['reject'](_0x21bec2);}return _0xbf7316[_0x9806('0x20')]();};}function saveUpdates(_0x186450,_0x299677){return function(_0x9d7d70){if(_0x9d7d70){return _0x9d7d70[_0x9806('0x21')](_0x186450)[_0x9806('0x22')](function(_0x5a7b11){return _0x5a7b11;});}return null;};}function removeEntity(_0xe38efb,_0x968e8c){return function(_0x1d671e){if(_0x1d671e){return _0x1d671e[_0x9806('0x23')]()[_0x9806('0x22')](function(){var _0x497192=_0x1d671e['get']({'plain':!![]});var _0x52f188=_0x9806('0x24');return db['UserProfileResource'][_0x9806('0x23')]({'where':{'type':_0x52f188,'resourceId':_0x497192['id']}})[_0x9806('0x22')](function(){return _0x1d671e;});})[_0x9806('0x22')](function(){_0xe38efb[_0x9806('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x539018,_0x2f505f){return function(_0x12c189){if(!_0x12c189){_0x539018['sendStatus'](0x194);}return _0x12c189;};}function handleError(_0x4d48e7,_0x155763){_0x155763=_0x155763||0x1f4;return function(_0x36ba4b){logger[_0x9806('0x25')](_0x36ba4b[_0x9806('0x26')]);if(_0x36ba4b[_0x9806('0x27')]){delete _0x36ba4b[_0x9806('0x27')];}_0x4d48e7[_0x9806('0x16')](_0x155763)[_0x9806('0x28')](_0x36ba4b);};}exports['index']=function(_0x89ee2f,_0xb059d4){var _0x353002={},_0x16ee30={},_0x2311a9={'count':0x0,'rows':[]};var _0x1bd10d=_[_0x9806('0x29')](db[_0x9806('0x2a')][_0x9806('0x2b')],function(_0x5e9205){return{'name':_0x5e9205[_0x9806('0x2c')],'type':_0x5e9205['type'][_0x9806('0x2d')]};});_0x16ee30[_0x9806('0x2e')]=_[_0x9806('0x29')](_0x1bd10d,_0x9806('0x27'));_0x16ee30[_0x9806('0x2f')]=_[_0x9806('0x30')](_0x89ee2f[_0x9806('0x2f')]);_0x16ee30[_0x9806('0x31')]=_[_0x9806('0x32')](_0x16ee30[_0x9806('0x2e')],_0x16ee30[_0x9806('0x2f')]);_0x353002['attributes']=_[_0x9806('0x32')](_0x16ee30['model'],qs['fields'](_0x89ee2f[_0x9806('0x2f')][_0x9806('0x33')]));_0x353002['attributes']=_0x353002['attributes'][_0x9806('0x34')]?_0x353002[_0x9806('0x35')]:_0x16ee30[_0x9806('0x2e')];if(!_0x89ee2f[_0x9806('0x2f')]['hasOwnProperty'](_0x9806('0x36'))){_0x353002[_0x9806('0x1a')]=qs[_0x9806('0x1a')](_0x89ee2f[_0x9806('0x2f')]['limit']);_0x353002[_0x9806('0x19')]=qs[_0x9806('0x19')](_0x89ee2f[_0x9806('0x2f')][_0x9806('0x19')]);}_0x353002[_0x9806('0x37')]=qs[_0x9806('0x38')](_0x89ee2f[_0x9806('0x2f')]['sort']);delete _0x89ee2f['query'][_0x9806('0x38')];_0x353002[_0x9806('0x39')]=qs[_0x9806('0x31')](_['pick'](_0x89ee2f[_0x9806('0x2f')],_0x16ee30['filters']),_0x1bd10d);if(_0x89ee2f['query']['filter']){_0x353002['where']=_['merge'](_0x353002[_0x9806('0x39')],{'$or':_[_0x9806('0x29')](_0x1bd10d,function(_0x57167a){if(_0x57167a[_0x9806('0x3a')]!==_0x9806('0x3b')){var _0x2c3277={};_0x2c3277[_0x57167a[_0x9806('0x27')]]={'$like':'%'+_0x89ee2f[_0x9806('0x2f')][_0x9806('0x3c')]+'%'};return _0x2c3277;}})});}_0x353002=_['merge']({},_0x353002,_0x89ee2f[_0x9806('0x3d')]);var _0x28a540={'where':_0x353002['where']};return db[_0x9806('0x2a')][_0x9806('0x1c')](_0x28a540)['then'](function(_0x24d603){_0x2311a9[_0x9806('0x1c')]=_0x24d603;if(_0x89ee2f[_0x9806('0x2f')][_0x9806('0x3e')]){_0x353002[_0x9806('0x3f')]=[{'all':!![]}];}return db[_0x9806('0x2a')]['findAll'](_0x353002);})[_0x9806('0x22')](function(_0x4ef23d){_0x2311a9[_0x9806('0x40')]=_0x4ef23d;return _0x2311a9;})[_0x9806('0x22')](respondWithFilteredResult(_0xb059d4,_0x353002))[_0x9806('0x41')](handleError(_0xb059d4,null));};exports[_0x9806('0x42')]=function(_0x414095,_0x5e6fa4){var _0x3e1d5d={'raw':![],'where':{'id':_0x414095['params']['id']}},_0x26bac2={};_0x26bac2['model']=_[_0x9806('0x30')](db[_0x9806('0x2a')][_0x9806('0x2b')]);_0x26bac2[_0x9806('0x2f')]=_['keys'](_0x414095['query']);_0x26bac2[_0x9806('0x31')]=_[_0x9806('0x32')](_0x26bac2[_0x9806('0x2e')],_0x26bac2[_0x9806('0x2f')]);_0x3e1d5d['attributes']=_[_0x9806('0x32')](_0x26bac2[_0x9806('0x2e')],qs[_0x9806('0x33')](_0x414095[_0x9806('0x2f')][_0x9806('0x33')]));_0x3e1d5d[_0x9806('0x35')]=_0x3e1d5d[_0x9806('0x35')]['length']?_0x3e1d5d['attributes']:_0x26bac2[_0x9806('0x2e')];if(_0x414095[_0x9806('0x2f')][_0x9806('0x3e')]){_0x3e1d5d[_0x9806('0x3f')]=[{'all':!![]}];}_0x3e1d5d=_['merge']({},_0x3e1d5d,_0x414095[_0x9806('0x3d')]);return db['VoiceMusicOnHold'][_0x9806('0x43')](_0x3e1d5d)['then'](handleEntityNotFound(_0x5e6fa4,null))[_0x9806('0x22')](respondWithResult(_0x5e6fa4,null))[_0x9806('0x41')](handleError(_0x5e6fa4,null));};exports[_0x9806('0x21')]=function(_0x2ecb74,_0x39113b){if(_0x2ecb74['body']['id']){delete _0x2ecb74[_0x9806('0x44')]['id'];}return db[_0x9806('0x2a')]['find']({'where':{'id':_0x2ecb74['params']['id']}})[_0x9806('0x22')](handleEntityNotFound(_0x39113b,null))['then'](saveUpdates(_0x2ecb74['body'],null))[_0x9806('0x22')](respondWithResult(_0x39113b,null))['catch'](handleError(_0x39113b,null));};exports[_0x9806('0x45')]=function(_0x152ef8,_0x4f6ae7,_0x3f01bf){return db[_0x9806('0x46')]['transaction'](function(_0xcba173){if(_0x152ef8[_0x9806('0x44')][_0x9806('0x47')]===_0x9806('0x48')){_0x152ef8[_0x9806('0x44')]['directory']=path[_0x9806('0x49')](config[_0x9806('0x4a')],_0x9806('0x4b'),_0x152ef8[_0x9806('0x44')][_0x9806('0x27')]);}return db[_0x9806('0x2a')]['create'](_0x152ef8['body'],{'transaction':_0xcba173})['then'](function(_0x8f08b9){if(_0x152ef8['body'][_0x9806('0x47')]===_0x9806('0x48')){fs['mkdirSync'](_0x8f08b9['directory'],parseInt('0777',0x8));}var _0x9c5fab=_0x152ef8['user']['get']({'plain':!![]});if(!_0x9c5fab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9c5fab[_0x9806('0x4c')]===_0x9806('0x4d')){var _0x592ae0=_0x8f08b9[_0x9806('0x4e')]({'plain':!![]});return db[_0x9806('0x4f')][_0x9806('0x43')]({'where':{'name':_0x9806('0x24'),'userProfileId':_0x9c5fab[_0x9806('0x50')]},'raw':!![]})[_0x9806('0x22')](function(_0x54e400){if(_0x54e400&&_0x54e400[_0x9806('0x51')]===0x0){return db[_0x9806('0x52')][_0x9806('0x45')]({'name':_0x592ae0[_0x9806('0x27')],'resourceId':_0x592ae0['id'],'type':_0x54e400[_0x9806('0x27')],'sectionId':_0x54e400['id']},{})[_0x9806('0x22')](function(){return _0x8f08b9;});}else{return _0x8f08b9;}})[_0x9806('0x41')](function(_0x32d940){logger[_0x9806('0x25')](_0x9806('0x53'),_0x32d940);});}return _0x8f08b9;});})[_0x9806('0x22')](respondWithResult(_0x4f6ae7,0xc9))[_0x9806('0x41')](handleError(_0x4f6ae7,null));};exports[_0x9806('0x23')]=function(_0x4341d8,_0x466717,_0x3eb528){var _0x4771ad;return db['VoiceMusicOnHold'][_0x9806('0x43')]({'where':{'id':_0x4341d8[_0x9806('0x54')]['id']}})[_0x9806('0x22')](function(_0x237cf9){if(_0x237cf9){return db[_0x9806('0x46')]['transaction'](function(_0x235827){return _0x237cf9['destroy']({'transaction':_0x235827,'raw':!![]})[_0x9806('0x22')](function(_0xa6a2f0){if(_0xa6a2f0['directory']){fs[_0x9806('0x55')](_0xa6a2f0[_0x9806('0x56')])[_0x9806('0x57')](function(_0x3331ce){fs['unlinkSync'](path[_0x9806('0x49')](_0xa6a2f0['directory'],_0x3331ce));});fs[_0x9806('0x58')](_0xa6a2f0[_0x9806('0x56')]);}return _0xa6a2f0;});})[_0x9806('0x41')](function(_0x2e8e73){throw new db['Sequelize'][(_0x9806('0x59'))](_0x2e8e73[_0x9806('0x5a')]);});}})[_0x9806('0x22')](handleEntityNotFound(_0x466717,null))[_0x9806('0x22')](removeEntity(_0x466717,null))[_0x9806('0x41')](handleError(_0x466717,null));};exports[_0x9806('0x5b')]=function(_0x352a33,_0x4e6492,_0x178ee8){return db['sequelize'][_0x9806('0x5c')](function(_0x13ba97){var _0x37635e;return db[_0x9806('0x2a')]['find']({'where':{'id':_0x352a33[_0x9806('0x54')]['id']}})['then'](function(_0x56dfd6){if(_0x56dfd6){_0x37635e=_0x56dfd6;return _0x56dfd6[_0x9806('0x5b')](_0x352a33[_0x9806('0x44')]['id'],{'transaction':_0x13ba97});}})[_0x9806('0x22')](function(_0x15525c){if(_0x15525c){return db['Sound'][_0x9806('0x5d')]({'where':{'id':_0x352a33[_0x9806('0x44')]['id']},'attributes':['id',_0x9806('0x27'),_0x9806('0x5e'),_0x9806('0x5f'),'createdAt'],'raw':!![]});}})[_0x9806('0x22')](function(_0x5497b3){if(_0x5497b3){var _0x562562=path[_0x9806('0x49')](config[_0x9806('0x4a')],_0x9806('0x60'),util['format']('%s.%s',path[_0x9806('0x61')](_0x5497b3[_0x9806('0x5e')],path['extname'](_0x5497b3[_0x9806('0x5e')])),_0x5497b3[_0x9806('0x5f')]));var _0x36a8c7=path[_0x9806('0x49')](config[_0x9806('0x4a')],_0x9806('0x4b'),_0x37635e[_0x9806('0x27')],util[_0x9806('0x62')](_0x9806('0x63'),_0x5497b3[_0x9806('0x27')],_0x5497b3[_0x9806('0x5f')]));fs['symlinkSync'](_0x562562,_0x36a8c7);return _0x5497b3;}})[_0x9806('0x41')](function(_0xa139c5){throw new db[(_0x9806('0x64'))]['ValidationError'](_0xa139c5[_0x9806('0x5a')]);});})[_0x9806('0x22')](handleEntityNotFound(_0x4e6492,null))['then'](respondWithResult(_0x4e6492,0xc9))[_0x9806('0x41')](handleError(_0x4e6492,null));};exports[_0x9806('0x65')]=function(_0x48f132,_0xf7721d,_0x49bcb6){return db[_0x9806('0x46')]['transaction'](function(_0x3885cc){var _0x5e1be5;return db[_0x9806('0x2a')]['findOne']({'where':{'id':_0x48f132['params']['id']}})['then'](handleEntityNotFound(_0xf7721d,null))['then'](function(_0x49ca4d){if(_0x49ca4d){_0x5e1be5=_0x49ca4d;return _0x49ca4d[_0x9806('0x65')](_0x48f132[_0x9806('0x54')][_0x9806('0x66')]);}})[_0x9806('0x22')](function(_0x1edb35){if(_0x1edb35){return db[_0x9806('0x67')][_0x9806('0x5d')]({'where':{'id':_0x48f132[_0x9806('0x54')][_0x9806('0x66')]},'attributes':['id',_0x9806('0x27'),_0x9806('0x5e'),_0x9806('0x5f'),_0x9806('0x68')],'raw':!![]});}})[_0x9806('0x22')](function(_0x38a655){if(_0x38a655){fs[_0x9806('0x69')](path[_0x9806('0x49')](_0x5e1be5[_0x9806('0x56')],util[_0x9806('0x62')](_0x9806('0x63'),_0x38a655['name'],_0x38a655[_0x9806('0x5f')])));return _0x38a655;}})[_0x9806('0x41')](function(_0x5a1a04){throw new db['Sequelize'][(_0x9806('0x59'))](_0x5a1a04[_0x9806('0x5a')]);});})[_0x9806('0x22')](handleEntityNotFound(_0xf7721d,null))[_0x9806('0x22')](respondWithStatusCode(_0xf7721d,0xcc))[_0x9806('0x41')](handleError(_0xf7721d,null));};exports[_0x9806('0x6a')]=function(_0x4d78ba,_0x4ecd6b,_0x13b697){var _0x5b3c97={};var _0x1e1d9e={};var _0x125c38;var _0x311a1c;return db[_0x9806('0x2a')][_0x9806('0x5d')]({'where':{'id':_0x4d78ba[_0x9806('0x54')]['id']}})[_0x9806('0x22')](handleEntityNotFound(_0x4ecd6b,null))['then'](function(_0x4b4edc){if(_0x4b4edc){_0x125c38=_0x4b4edc;_0x1e1d9e[_0x9806('0x2e')]=_[_0x9806('0x30')](db[_0x9806('0x67')][_0x9806('0x2b')]);_0x1e1d9e[_0x9806('0x2f')]=_[_0x9806('0x30')](_0x4d78ba[_0x9806('0x2f')]);_0x1e1d9e[_0x9806('0x31')]=_['intersection'](_0x1e1d9e['model'],_0x1e1d9e['query']);_0x5b3c97[_0x9806('0x35')]=_[_0x9806('0x32')](_0x1e1d9e[_0x9806('0x2e')],qs['fields'](_0x4d78ba[_0x9806('0x2f')][_0x9806('0x33')]));_0x5b3c97['attributes']=_0x5b3c97[_0x9806('0x35')][_0x9806('0x34')]?_0x5b3c97[_0x9806('0x35')]:_0x1e1d9e[_0x9806('0x2e')];_0x5b3c97['order']=qs[_0x9806('0x38')](_0x4d78ba[_0x9806('0x2f')][_0x9806('0x38')]);_0x5b3c97['where']=qs[_0x9806('0x31')](_[_0x9806('0x6b')](_0x4d78ba['query'],_0x1e1d9e[_0x9806('0x31')]));if(_0x4d78ba['query']['filter']){_0x5b3c97[_0x9806('0x39')]=_[_0x9806('0x6c')](_0x5b3c97[_0x9806('0x39')],{'$or':_[_0x9806('0x29')](_0x5b3c97[_0x9806('0x35')],function(_0x5a9884){var _0x2093bf={};_0x2093bf[_0x5a9884]={'$like':'%'+_0x4d78ba['query'][_0x9806('0x3c')]+'%'};return _0x2093bf;})});}_0x5b3c97=_['merge']({},_0x5b3c97,_0x4d78ba[_0x9806('0x3d')]);return _0x125c38[_0x9806('0x6a')](_0x5b3c97);}})[_0x9806('0x22')](function(_0x1615ad){if(_0x1615ad){_0x311a1c=_0x1615ad['length'];if(!_0x4d78ba['query'][_0x9806('0x6d')]('nolimit')){_0x5b3c97['limit']=qs[_0x9806('0x1a')](_0x4d78ba[_0x9806('0x2f')]['limit']);_0x5b3c97[_0x9806('0x19')]=qs[_0x9806('0x19')](_0x4d78ba['query'][_0x9806('0x19')]);}return _0x125c38[_0x9806('0x6a')](_0x5b3c97);}})[_0x9806('0x22')](function(_0x1a64b5){if(_0x1a64b5){return _0x1a64b5?{'count':_0x311a1c,'rows':_0x1a64b5}:null;}})[_0x9806('0x22')](respondWithResult(_0x4ecd6b,null))[_0x9806('0x41')](handleError(_0x4ecd6b,null));}; \ No newline at end of file +var _0xf6e4=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','../../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','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','params','keys','includeAll','options','find','catch','update','body','create','sequelize','transaction','root','server/files/moh','mode','files','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','removeSound','id2','getSounds','eml-format'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xf6e4,0x14f));var _0x4f6e=function(_0x55d7cb,_0x27ba4b){_0x55d7cb=_0x55d7cb-0x0;var _0x50b1b8=_0xf6e4[_0x55d7cb];return _0x50b1b8;};'use strict';var emlformat=require(_0x4f6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f6e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f6e('0x2'));var moment=require(_0x4f6e('0x3'));var BPromise=require(_0x4f6e('0x4'));var Mustache=require(_0x4f6e('0x5'));var util=require(_0x4f6e('0x6'));var path=require(_0x4f6e('0x7'));var sox=require(_0x4f6e('0x8'));var csv=require(_0x4f6e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f6e('0xa'));var _=require(_0x4f6e('0xb'));var squel=require('squel');var crypto=require(_0x4f6e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f6e('0x9'));var querystring=require(_0x4f6e('0xd'));var Papa=require(_0x4f6e('0xe'));var Redis=require('ioredis');var authService=require(_0x4f6e('0xf'));var qs=require(_0x4f6e('0x10'));var as=require(_0x4f6e('0x11'));var hardwareService=require(_0x4f6e('0x12'));var logger=require(_0x4f6e('0x13'))('api');var utils=require(_0x4f6e('0x14'));var config=require(_0x4f6e('0x15'));var licenseUtil=require(_0x4f6e('0x16'));var db=require(_0x4f6e('0x17'))['db'];function respondWithStatusCode(_0x3aa07e,_0x374f49){_0x374f49=_0x374f49||0xcc;return function(_0x25716d){if(_0x25716d){return _0x3aa07e['sendStatus'](_0x374f49);}return _0x3aa07e[_0x4f6e('0x18')](_0x374f49)[_0x4f6e('0x19')]();};}function respondWithResult(_0x2bd388,_0x448373){_0x448373=_0x448373||0xc8;return function(_0x18c098){if(_0x18c098){return _0x2bd388[_0x4f6e('0x18')](_0x448373)[_0x4f6e('0x1a')](_0x18c098);}};}function respondWithFilteredResult(_0x2b322d,_0x1e8cb9){return function(_0x5ebd55){if(_0x5ebd55){var _0x2cb733=typeof _0x1e8cb9[_0x4f6e('0x1b')]==='undefined'&&typeof _0x1e8cb9[_0x4f6e('0x1c')]===_0x4f6e('0x1d');var _0x7c6825=_0x5ebd55[_0x4f6e('0x1e')];var _0x4cb51a=_0x2cb733?0x0:_0x1e8cb9[_0x4f6e('0x1b')];var _0x4cb429=_0x2cb733?_0x5ebd55[_0x4f6e('0x1e')]:_0x1e8cb9['offset']+_0x1e8cb9[_0x4f6e('0x1c')];var _0x364def;if(_0x4cb429>=_0x7c6825){_0x4cb429=_0x7c6825;_0x364def=0xc8;}else{_0x364def=0xce;}_0x2b322d[_0x4f6e('0x18')](_0x364def);return _0x2b322d[_0x4f6e('0x1f')](_0x4f6e('0x20'),_0x4cb51a+'-'+_0x4cb429+'/'+_0x7c6825)[_0x4f6e('0x1a')](_0x5ebd55);}return null;};}function patchUpdates(_0x12df16){return function(_0x1cfde2){try{jsonpatch[_0x4f6e('0x21')](_0x1cfde2,_0x12df16,!![]);}catch(_0xdc1f98){return BPromise[_0x4f6e('0x22')](_0xdc1f98);}return _0x1cfde2[_0x4f6e('0x23')]();};}function saveUpdates(_0x1bede8,_0x4aa620){return function(_0x3b8e82){if(_0x3b8e82){return _0x3b8e82['update'](_0x1bede8)[_0x4f6e('0x24')](function(_0x23b4c5){return _0x23b4c5;});}return null;};}function removeEntity(_0x43fd39,_0x33f251){return function(_0x1c881a){if(_0x1c881a){return _0x1c881a[_0x4f6e('0x25')]()['then'](function(){var _0x166e81=_0x1c881a[_0x4f6e('0x26')]({'plain':!![]});var _0x38dc67='MusicOnHolds';return db[_0x4f6e('0x27')][_0x4f6e('0x25')]({'where':{'type':_0x38dc67,'resourceId':_0x166e81['id']}})[_0x4f6e('0x24')](function(){return _0x1c881a;});})[_0x4f6e('0x24')](function(){_0x43fd39[_0x4f6e('0x18')](0xcc)[_0x4f6e('0x19')]();});}};}function handleEntityNotFound(_0x6711c1,_0x1b6a7a){return function(_0x27e54c){if(!_0x27e54c){_0x6711c1['sendStatus'](0x194);}return _0x27e54c;};}function handleError(_0x190f07,_0x4ea3a9){_0x4ea3a9=_0x4ea3a9||0x1f4;return function(_0x8aa3eb){logger['error'](_0x8aa3eb[_0x4f6e('0x28')]);if(_0x8aa3eb['name']){delete _0x8aa3eb[_0x4f6e('0x29')];}_0x190f07[_0x4f6e('0x18')](_0x4ea3a9)[_0x4f6e('0x2a')](_0x8aa3eb);};}exports[_0x4f6e('0x2b')]=function(_0xbd1a8b,_0x306b53){var _0x3d38e1={},_0x42cf16={},_0x510928={'count':0x0,'rows':[]};var _0x277d26=_[_0x4f6e('0x2c')](db[_0x4f6e('0x2d')][_0x4f6e('0x2e')],function(_0x16527c){return{'name':_0x16527c[_0x4f6e('0x2f')],'type':_0x16527c[_0x4f6e('0x30')][_0x4f6e('0x31')]};});_0x42cf16[_0x4f6e('0x32')]=_[_0x4f6e('0x2c')](_0x277d26,_0x4f6e('0x29'));_0x42cf16[_0x4f6e('0x33')]=_['keys'](_0xbd1a8b['query']);_0x42cf16[_0x4f6e('0x34')]=_[_0x4f6e('0x35')](_0x42cf16['model'],_0x42cf16['query']);_0x3d38e1[_0x4f6e('0x36')]=_[_0x4f6e('0x35')](_0x42cf16['model'],qs[_0x4f6e('0x37')](_0xbd1a8b[_0x4f6e('0x33')][_0x4f6e('0x37')]));_0x3d38e1[_0x4f6e('0x36')]=_0x3d38e1['attributes'][_0x4f6e('0x38')]?_0x3d38e1[_0x4f6e('0x36')]:_0x42cf16['model'];if(!_0xbd1a8b[_0x4f6e('0x33')]['hasOwnProperty'](_0x4f6e('0x39'))){_0x3d38e1[_0x4f6e('0x1c')]=qs[_0x4f6e('0x1c')](_0xbd1a8b[_0x4f6e('0x33')]['limit']);_0x3d38e1[_0x4f6e('0x1b')]=qs[_0x4f6e('0x1b')](_0xbd1a8b['query'][_0x4f6e('0x1b')]);}_0x3d38e1[_0x4f6e('0x3a')]=qs['sort'](_0xbd1a8b[_0x4f6e('0x33')][_0x4f6e('0x3b')]);delete _0xbd1a8b[_0x4f6e('0x33')][_0x4f6e('0x3b')];_0x3d38e1[_0x4f6e('0x3c')]=qs[_0x4f6e('0x34')](_[_0x4f6e('0x3d')](_0xbd1a8b[_0x4f6e('0x33')],_0x42cf16[_0x4f6e('0x34')]),_0x277d26);if(_0xbd1a8b[_0x4f6e('0x33')][_0x4f6e('0x3e')]){_0x3d38e1['where']=_['merge'](_0x3d38e1[_0x4f6e('0x3c')],{'$or':_['map'](_0x277d26,function(_0x3e3426){if(_0x3e3426[_0x4f6e('0x30')]!==_0x4f6e('0x3f')){var _0x2e2b05={};_0x2e2b05[_0x3e3426['name']]={'$like':'%'+_0xbd1a8b[_0x4f6e('0x33')][_0x4f6e('0x3e')]+'%'};return _0x2e2b05;}})});}_0x3d38e1=_[_0x4f6e('0x40')]({},_0x3d38e1,_0xbd1a8b['options']);var _0x4d9443={'where':_0x3d38e1['where']};return db[_0x4f6e('0x2d')][_0x4f6e('0x1e')](_0x4d9443)[_0x4f6e('0x24')](function(_0x47b51b){_0x510928[_0x4f6e('0x1e')]=_0x47b51b;if(_0xbd1a8b['query']['includeAll']){_0x3d38e1[_0x4f6e('0x41')]=[{'all':!![]}];}return db[_0x4f6e('0x2d')][_0x4f6e('0x42')](_0x3d38e1);})[_0x4f6e('0x24')](function(_0x1ac7b0){_0x510928[_0x4f6e('0x43')]=_0x1ac7b0;return _0x510928;})['then'](respondWithFilteredResult(_0x306b53,_0x3d38e1))['catch'](handleError(_0x306b53,null));};exports['show']=function(_0x15543a,_0x239fda){var _0xe62430={'raw':![],'where':{'id':_0x15543a[_0x4f6e('0x44')]['id']}},_0x41ff54={};_0x41ff54['model']=_[_0x4f6e('0x45')](db[_0x4f6e('0x2d')][_0x4f6e('0x2e')]);_0x41ff54[_0x4f6e('0x33')]=_[_0x4f6e('0x45')](_0x15543a[_0x4f6e('0x33')]);_0x41ff54[_0x4f6e('0x34')]=_[_0x4f6e('0x35')](_0x41ff54['model'],_0x41ff54[_0x4f6e('0x33')]);_0xe62430['attributes']=_[_0x4f6e('0x35')](_0x41ff54[_0x4f6e('0x32')],qs[_0x4f6e('0x37')](_0x15543a[_0x4f6e('0x33')][_0x4f6e('0x37')]));_0xe62430['attributes']=_0xe62430['attributes'][_0x4f6e('0x38')]?_0xe62430[_0x4f6e('0x36')]:_0x41ff54[_0x4f6e('0x32')];if(_0x15543a['query'][_0x4f6e('0x46')]){_0xe62430[_0x4f6e('0x41')]=[{'all':!![]}];}_0xe62430=_[_0x4f6e('0x40')]({},_0xe62430,_0x15543a[_0x4f6e('0x47')]);return db['VoiceMusicOnHold'][_0x4f6e('0x48')](_0xe62430)['then'](handleEntityNotFound(_0x239fda,null))[_0x4f6e('0x24')](respondWithResult(_0x239fda,null))[_0x4f6e('0x49')](handleError(_0x239fda,null));};exports[_0x4f6e('0x4a')]=function(_0x200c7c,_0x14949d){if(_0x200c7c[_0x4f6e('0x4b')]['id']){delete _0x200c7c[_0x4f6e('0x4b')]['id'];}return db[_0x4f6e('0x2d')][_0x4f6e('0x48')]({'where':{'id':_0x200c7c[_0x4f6e('0x44')]['id']}})[_0x4f6e('0x24')](handleEntityNotFound(_0x14949d,null))['then'](saveUpdates(_0x200c7c[_0x4f6e('0x4b')],null))[_0x4f6e('0x24')](respondWithResult(_0x14949d,null))['catch'](handleError(_0x14949d,null));};exports[_0x4f6e('0x4c')]=function(_0x455ae4,_0x5a85d3,_0x24a8b4){return db[_0x4f6e('0x4d')][_0x4f6e('0x4e')](function(_0x3fa945){if(_0x455ae4['body']['mode']==='files'){_0x455ae4['body']['directory']=path['join'](config[_0x4f6e('0x4f')],_0x4f6e('0x50'),_0x455ae4[_0x4f6e('0x4b')][_0x4f6e('0x29')]);}return db[_0x4f6e('0x2d')][_0x4f6e('0x4c')](_0x455ae4[_0x4f6e('0x4b')],{'transaction':_0x3fa945})[_0x4f6e('0x24')](function(_0x4170b0){if(_0x455ae4[_0x4f6e('0x4b')][_0x4f6e('0x51')]===_0x4f6e('0x52')){fs[_0x4f6e('0x53')](_0x4170b0[_0x4f6e('0x54')],parseInt('0777',0x8));}var _0x404c96=_0x455ae4[_0x4f6e('0x55')][_0x4f6e('0x26')]({'plain':!![]});if(!_0x404c96)throw new Error(_0x4f6e('0x56'));if(_0x404c96['role']===_0x4f6e('0x55')){var _0x413352=_0x4170b0['get']({'plain':!![]});return db[_0x4f6e('0x57')]['find']({'where':{'name':_0x4f6e('0x58'),'userProfileId':_0x404c96[_0x4f6e('0x59')]},'raw':!![]})['then'](function(_0x8da89a){if(_0x8da89a&&_0x8da89a[_0x4f6e('0x5a')]===0x0){return db[_0x4f6e('0x27')][_0x4f6e('0x4c')]({'name':_0x413352[_0x4f6e('0x29')],'resourceId':_0x413352['id'],'type':_0x8da89a[_0x4f6e('0x29')],'sectionId':_0x8da89a['id']},{})[_0x4f6e('0x24')](function(){return _0x4170b0;});}else{return _0x4170b0;}})[_0x4f6e('0x49')](function(_0x501c34){logger[_0x4f6e('0x5b')](_0x4f6e('0x5c'),_0x501c34);});}return _0x4170b0;});})[_0x4f6e('0x24')](respondWithResult(_0x5a85d3,0xc9))['catch'](handleError(_0x5a85d3,null));};exports['destroy']=function(_0x503785,_0x516291,_0x5dc811){var _0x39a99e;return db['VoiceMusicOnHold'][_0x4f6e('0x48')]({'where':{'id':_0x503785['params']['id']}})['then'](function(_0x5f06f5){if(_0x5f06f5){return db[_0x4f6e('0x4d')][_0x4f6e('0x4e')](function(_0x2f733f){return _0x5f06f5[_0x4f6e('0x25')]({'transaction':_0x2f733f,'raw':!![]})[_0x4f6e('0x24')](function(_0x20884c){if(_0x20884c[_0x4f6e('0x54')]){fs['readdirSync'](_0x20884c[_0x4f6e('0x54')])[_0x4f6e('0x5d')](function(_0x1132d2){fs[_0x4f6e('0x5e')](path[_0x4f6e('0x5f')](_0x20884c[_0x4f6e('0x54')],_0x1132d2));});fs[_0x4f6e('0x60')](_0x20884c[_0x4f6e('0x54')]);}return _0x20884c;});})[_0x4f6e('0x49')](function(_0x1b1085){throw new db[(_0x4f6e('0x61'))][(_0x4f6e('0x62'))](_0x1b1085[_0x4f6e('0x63')]);});}})['then'](handleEntityNotFound(_0x516291,null))[_0x4f6e('0x24')](removeEntity(_0x516291,null))[_0x4f6e('0x49')](handleError(_0x516291,null));};exports['addSound']=function(_0x54269b,_0x138653,_0x1ce65d){return db[_0x4f6e('0x4d')][_0x4f6e('0x4e')](function(_0x4d4fcb){var _0x3cb290;return db[_0x4f6e('0x2d')][_0x4f6e('0x48')]({'where':{'id':_0x54269b[_0x4f6e('0x44')]['id']}})[_0x4f6e('0x24')](function(_0xca8d1e){if(_0xca8d1e){_0x3cb290=_0xca8d1e;return _0xca8d1e['addSound'](_0x54269b[_0x4f6e('0x4b')]['id'],{'transaction':_0x4d4fcb});}})[_0x4f6e('0x24')](function(_0xedb97c){if(_0xedb97c){return db[_0x4f6e('0x64')][_0x4f6e('0x65')]({'where':{'id':_0x54269b['body']['id']},'attributes':['id',_0x4f6e('0x29'),_0x4f6e('0x66'),_0x4f6e('0x67'),_0x4f6e('0x68')],'raw':!![]});}})[_0x4f6e('0x24')](function(_0x43ac2d){if(_0x43ac2d){var _0x3c913d=path[_0x4f6e('0x5f')](config['root'],_0x4f6e('0x69'),util[_0x4f6e('0x6a')](_0x4f6e('0x6b'),path['basename'](_0x43ac2d[_0x4f6e('0x66')],path[_0x4f6e('0x6c')](_0x43ac2d['save_name'])),_0x43ac2d[_0x4f6e('0x67')]));var _0x133f2d=path[_0x4f6e('0x5f')](config[_0x4f6e('0x4f')],_0x4f6e('0x50'),_0x3cb290[_0x4f6e('0x29')],util['format'](_0x4f6e('0x6b'),_0x43ac2d[_0x4f6e('0x29')],_0x43ac2d['converted_format']));fs['symlinkSync'](_0x3c913d,_0x133f2d);return _0x43ac2d;}})[_0x4f6e('0x49')](function(_0x4da69){throw new db[(_0x4f6e('0x61'))]['ValidationError'](_0x4da69[_0x4f6e('0x63')]);});})[_0x4f6e('0x24')](handleEntityNotFound(_0x138653,null))[_0x4f6e('0x24')](respondWithResult(_0x138653,0xc9))[_0x4f6e('0x49')](handleError(_0x138653,null));};exports['removeSound']=function(_0x3671f4,_0x5e13b9,_0xa437bc){return db[_0x4f6e('0x4d')][_0x4f6e('0x4e')](function(_0x72793){var _0x166fd5;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x3671f4[_0x4f6e('0x44')]['id']}})[_0x4f6e('0x24')](handleEntityNotFound(_0x5e13b9,null))[_0x4f6e('0x24')](function(_0x5186b0){if(_0x5186b0){_0x166fd5=_0x5186b0;return _0x5186b0[_0x4f6e('0x6d')](_0x3671f4[_0x4f6e('0x44')]['id2']);}})[_0x4f6e('0x24')](function(_0x104f8e){if(_0x104f8e){return db['Sound']['findOne']({'where':{'id':_0x3671f4[_0x4f6e('0x44')][_0x4f6e('0x6e')]},'attributes':['id','name',_0x4f6e('0x66'),_0x4f6e('0x67'),_0x4f6e('0x68')],'raw':!![]});}})['then'](function(_0x309f2f){if(_0x309f2f){fs[_0x4f6e('0x5e')](path['join'](_0x166fd5['directory'],util['format']('%s.%s',_0x309f2f[_0x4f6e('0x29')],_0x309f2f['converted_format'])));return _0x309f2f;}})[_0x4f6e('0x49')](function(_0x46608b){throw new db[(_0x4f6e('0x61'))][(_0x4f6e('0x62'))](_0x46608b['message']);});})[_0x4f6e('0x24')](handleEntityNotFound(_0x5e13b9,null))['then'](respondWithStatusCode(_0x5e13b9,0xcc))[_0x4f6e('0x49')](handleError(_0x5e13b9,null));};exports['getSounds']=function(_0x1982e4,_0x4eec3e,_0x4af1c7){var _0x2910e0={};var _0x3f8b4c={};var _0x3a824f;var _0x4edaa8;return db['VoiceMusicOnHold'][_0x4f6e('0x65')]({'where':{'id':_0x1982e4['params']['id']}})[_0x4f6e('0x24')](handleEntityNotFound(_0x4eec3e,null))[_0x4f6e('0x24')](function(_0x50ac7f){if(_0x50ac7f){_0x3a824f=_0x50ac7f;_0x3f8b4c[_0x4f6e('0x32')]=_[_0x4f6e('0x45')](db['Sound'][_0x4f6e('0x2e')]);_0x3f8b4c['query']=_[_0x4f6e('0x45')](_0x1982e4[_0x4f6e('0x33')]);_0x3f8b4c[_0x4f6e('0x34')]=_[_0x4f6e('0x35')](_0x3f8b4c[_0x4f6e('0x32')],_0x3f8b4c['query']);_0x2910e0[_0x4f6e('0x36')]=_[_0x4f6e('0x35')](_0x3f8b4c[_0x4f6e('0x32')],qs[_0x4f6e('0x37')](_0x1982e4[_0x4f6e('0x33')][_0x4f6e('0x37')]));_0x2910e0[_0x4f6e('0x36')]=_0x2910e0[_0x4f6e('0x36')][_0x4f6e('0x38')]?_0x2910e0['attributes']:_0x3f8b4c[_0x4f6e('0x32')];_0x2910e0[_0x4f6e('0x3a')]=qs[_0x4f6e('0x3b')](_0x1982e4[_0x4f6e('0x33')][_0x4f6e('0x3b')]);_0x2910e0[_0x4f6e('0x3c')]=qs[_0x4f6e('0x34')](_[_0x4f6e('0x3d')](_0x1982e4[_0x4f6e('0x33')],_0x3f8b4c['filters']));if(_0x1982e4[_0x4f6e('0x33')]['filter']){_0x2910e0['where']=_[_0x4f6e('0x40')](_0x2910e0['where'],{'$or':_[_0x4f6e('0x2c')](_0x2910e0['attributes'],function(_0x1370ca){var _0x2c176c={};_0x2c176c[_0x1370ca]={'$like':'%'+_0x1982e4[_0x4f6e('0x33')][_0x4f6e('0x3e')]+'%'};return _0x2c176c;})});}_0x2910e0=_['merge']({},_0x2910e0,_0x1982e4['options']);return _0x3a824f[_0x4f6e('0x6f')](_0x2910e0);}})[_0x4f6e('0x24')](function(_0x5c305f){if(_0x5c305f){_0x4edaa8=_0x5c305f[_0x4f6e('0x38')];if(!_0x1982e4[_0x4f6e('0x33')]['hasOwnProperty'](_0x4f6e('0x39'))){_0x2910e0[_0x4f6e('0x1c')]=qs[_0x4f6e('0x1c')](_0x1982e4['query'][_0x4f6e('0x1c')]);_0x2910e0[_0x4f6e('0x1b')]=qs[_0x4f6e('0x1b')](_0x1982e4[_0x4f6e('0x33')]['offset']);}return _0x3a824f['getSounds'](_0x2910e0);}})[_0x4f6e('0x24')](function(_0x522850){if(_0x522850){return _0x522850?{'count':_0x4edaa8,'rows':_0x522850}:null;}})[_0x4f6e('0x24')](respondWithResult(_0x4eec3e,null))[_0x4f6e('0x49')](handleError(_0x4eec3e,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index c5f8e51..4e037a4 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 _0x6421=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold'];(function(_0xb043,_0x404cc3){var _0x111122=function(_0x955597){while(--_0x955597){_0xb043['push'](_0xb043['shift']());}};_0x111122(++_0x404cc3);}(_0x6421,0x1dc));var _0x1642=function(_0x2996e5,_0x4c702a){_0x2996e5=_0x2996e5-0x0;var _0x17b175=_0x6421[_0x2996e5];return _0x17b175;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var logger=require(_0x1642('0x2'))(_0x1642('0x3'));var moment=require(_0x1642('0x4'));var BPromise=require(_0x1642('0x5'));var rp=require(_0x1642('0x6'));var fs=require('fs');var path=require(_0x1642('0x7'));var rimraf=require(_0x1642('0x8'));var config=require(_0x1642('0x9'));var attributes=require(_0x1642('0xa'));module[_0x1642('0xb')]=function(_0x5c399a,_0x3dca1a){return _0x5c399a['define'](_0x1642('0xc'),attributes,{'tableName':_0x1642('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d34=['VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','define'];(function(_0x223fac,_0x53317a){var _0x5db2ac=function(_0x4b5f06){while(--_0x4b5f06){_0x223fac['push'](_0x223fac['shift']());}};_0x5db2ac(++_0x53317a);}(_0x1d34,0xb2));var _0x41d3=function(_0x558a07,_0x52ab2a){_0x558a07=_0x558a07-0x0;var _0x499c5d=_0x1d34[_0x558a07];return _0x499c5d;};'use strict';var _=require('lodash');var util=require(_0x41d3('0x0'));var logger=require(_0x41d3('0x1'))(_0x41d3('0x2'));var moment=require('moment');var BPromise=require(_0x41d3('0x3'));var rp=require(_0x41d3('0x4'));var fs=require('fs');var path=require(_0x41d3('0x5'));var rimraf=require('rimraf');var config=require(_0x41d3('0x6'));var attributes=require(_0x41d3('0x7'));module['exports']=function(_0x49ebac,_0x23f0bf){return _0x49ebac[_0x41d3('0x8')](_0x41d3('0x9'),attributes,{'tableName':_0x41d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index ef2b163..2c7f096 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x214a24,_0x522547){var _0x564a55=function(_0x3a121a){while(--_0x3a121a){_0x214a24['push'](_0x214a24['shift']());}};_0x564a55(++_0x522547);}(_0xedd9,0xfc));var _0x9edd=function(_0x2fb105,_0x47e11d){_0x2fb105=_0x2fb105-0x0;var _0x183338=_0xedd9[_0x2fb105];return _0x183338;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x29f8c6,_0x5078ae){var _0x5be3d6=function(_0x15716d){while(--_0x15716d){_0x29f8c6['push'](_0x29f8c6['shift']());}};_0x5be3d6(++_0x5078ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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/voicePrefix/index.js b/server/api/voicePrefix/index.js index 623a4ea..fa49a21 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 _0x5458=['destroy','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','create','post','addTeams','put','delete'];(function(_0x19e941,_0x3fc637){var _0x42d603=function(_0x157e83){while(--_0x157e83){_0x19e941['push'](_0x19e941['shift']());}};_0x42d603(++_0x3fc637);}(_0x5458,0x1d7));var _0x8545=function(_0x42980b,_0x185efd){_0x42980b=_0x42980b-0x0;var _0x2ebca9=_0x5458[_0x42980b];return _0x2ebca9;};'use strict';var multer=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var path=require(_0x8545('0x2'));var timeout=require(_0x8545('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8545('0x4'));var interaction=require(_0x8545('0x5'));var config=require(_0x8545('0x6'));var controller=require(_0x8545('0x7'));router[_0x8545('0x8')]('/',auth[_0x8545('0x9')](),controller[_0x8545('0xa')]);router[_0x8545('0x8')](_0x8545('0xb'),auth[_0x8545('0x9')](),controller[_0x8545('0xc')]);router[_0x8545('0x8')](_0x8545('0xd'),auth[_0x8545('0x9')](),controller['show']);router['get'](_0x8545('0xe'),auth[_0x8545('0x9')](),controller[_0x8545('0xf')]);router[_0x8545('0x8')](_0x8545('0x10'),auth['isAuthenticated'](),controller[_0x8545('0x11')]);router['post']('/',auth[_0x8545('0x9')](),controller[_0x8545('0x12')]);router[_0x8545('0x13')](_0x8545('0xe'),auth[_0x8545('0x9')](),controller['addAgents']);router[_0x8545('0x13')](_0x8545('0x10'),auth[_0x8545('0x9')](),controller[_0x8545('0x14')]);router[_0x8545('0x15')]('/:id',auth[_0x8545('0x9')](),controller['update']);router[_0x8545('0x16')](_0x8545('0xd'),auth[_0x8545('0x9')](),controller[_0x8545('0x17')]);router[_0x8545('0x16')](_0x8545('0xe'),auth[_0x8545('0x9')](),controller[_0x8545('0x18')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);module[_0x8545('0x19')]=router; \ No newline at end of file +var _0x0588=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','addTeams','update','delete','destroy','removeAgents','/:id/teams','exports'];(function(_0x4ee381,_0x32833d){var _0x6fadab=function(_0x437404){while(--_0x437404){_0x4ee381['push'](_0x4ee381['shift']());}};_0x6fadab(++_0x32833d);}(_0x0588,0xd8));var _0x8058=function(_0x1a5415,_0x5ad3c3){_0x1a5415=_0x1a5415-0x0;var _0x4d587d=_0x0588[_0x1a5415];return _0x4d587d;};'use strict';var multer=require(_0x8058('0x0'));var util=require(_0x8058('0x1'));var path=require(_0x8058('0x2'));var timeout=require(_0x8058('0x3'));var express=require(_0x8058('0x4'));var router=express[_0x8058('0x5')]();var fs_extra=require(_0x8058('0x6'));var auth=require(_0x8058('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8058('0x8'));router[_0x8058('0x9')]('/',auth[_0x8058('0xa')](),controller[_0x8058('0xb')]);router[_0x8058('0x9')]('/describe',auth[_0x8058('0xa')](),controller[_0x8058('0xc')]);router[_0x8058('0x9')](_0x8058('0xd'),auth['isAuthenticated'](),controller[_0x8058('0xe')]);router[_0x8058('0x9')](_0x8058('0xf'),auth[_0x8058('0xa')](),controller[_0x8058('0x10')]);router[_0x8058('0x9')]('/:id/teams',auth[_0x8058('0xa')](),controller['getTeams']);router[_0x8058('0x11')]('/',auth[_0x8058('0xa')](),controller[_0x8058('0x12')]);router[_0x8058('0x11')](_0x8058('0xf'),auth[_0x8058('0xa')](),controller[_0x8058('0x13')]);router[_0x8058('0x11')]('/:id/teams',auth[_0x8058('0xa')](),controller[_0x8058('0x14')]);router['put']('/:id',auth[_0x8058('0xa')](),controller[_0x8058('0x15')]);router[_0x8058('0x16')](_0x8058('0xd'),auth[_0x8058('0xa')](),controller[_0x8058('0x17')]);router[_0x8058('0x16')](_0x8058('0xf'),auth[_0x8058('0xa')](),controller[_0x8058('0x18')]);router[_0x8058('0x16')](_0x8058('0x19'),auth[_0x8058('0xa')](),controller['removeTeams']);module[_0x8058('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a6686b6..dc33f18 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 _0xbd63=['name','VIRTUAL','system-','INTEGER','STRING'];(function(_0x28bd15,_0x2a1353){var _0x31ab5c=function(_0x3cf509){while(--_0x3cf509){_0x28bd15['push'](_0x28bd15['shift']());}};_0x31ab5c(++_0x2a1353);}(_0xbd63,0x103));var _0x3bd6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbd63[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3bd6('0x0')],'allowNull':![],'unique':_0x3bd6('0x1')},'prefix':{'type':Sequelize[_0x3bd6('0x2')],'get':function(_0x5cb793){return _0x3bd6('0x3')+this['getDataValue'](_0x3bd6('0x1'))+'-';}},'description':{'type':Sequelize[_0x3bd6('0x0')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x3bd6('0x4')]}}; \ No newline at end of file +var _0xdbd2=['VIRTUAL','system-','getDataValue','INTEGER','exports','STRING','name'];(function(_0x52506b,_0x49474e){var _0x4a271a=function(_0x4a2365){while(--_0x4a2365){_0x52506b['push'](_0x52506b['shift']());}};_0x4a271a(++_0x49474e);}(_0xdbd2,0xc8));var _0x2dbd=function(_0x27d880,_0x1499d2){_0x27d880=_0x27d880-0x0;var _0x2b7db0=_0xdbd2[_0x27d880];return _0x2b7db0;};'use strict';var Sequelize=require('sequelize');module[_0x2dbd('0x0')]={'name':{'type':Sequelize[_0x2dbd('0x1')],'allowNull':![],'unique':_0x2dbd('0x2')},'prefix':{'type':Sequelize[_0x2dbd('0x3')],'get':function(_0x1a35c2){return _0x2dbd('0x4')+this[_0x2dbd('0x5')](_0x2dbd('0x2'))+'-';}},'description':{'type':Sequelize[_0x2dbd('0x1')]},'callerIdAll':{'type':Sequelize[_0x2dbd('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x2dbd('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index b66bfc8..b647e45 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 _0x896e=['userVoicePrefix:save','removeTeams','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','isEmpty','forEach','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','send','index','VoicePrefix','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','rawAttributes','find','destroy','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','params','addAgents','ids','spread','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','order','hasOwnProperty','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','UserVoicePrefix','findOrCreate'];(function(_0x11296f,_0x3b958d){var _0x403ff4=function(_0x32a3b8){while(--_0x32a3b8){_0x11296f['push'](_0x11296f['shift']());}};_0x403ff4(++_0x3b958d);}(_0x896e,0x1e9));var _0xe896=function(_0x20b036,_0x42ce7d){_0x20b036=_0x20b036-0x0;var _0x1f7298=_0x896e[_0x20b036];return _0x1f7298;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];config[_0xe896('0x1a')]=_['defaults'](config[_0xe896('0x1a')],{'host':_0xe896('0x1b'),'port':0x18eb});var socket=require(_0xe896('0x1c'))(new Redis(config['redis']));require(_0xe896('0x1d'))[_0xe896('0x1e')](socket);function respondWithStatusCode(_0x1e7ef8,_0x564758){_0x564758=_0x564758||0xcc;return function(_0x5a7957){if(_0x5a7957){return _0x1e7ef8[_0xe896('0x1f')](_0x564758);}return _0x1e7ef8[_0xe896('0x20')](_0x564758)['end']();};}function respondWithResult(_0x5e78d6,_0x11f41c){_0x11f41c=_0x11f41c||0xc8;return function(_0x16e272){if(_0x16e272){return _0x5e78d6['status'](_0x11f41c)[_0xe896('0x21')](_0x16e272);}};}function respondWithFilteredResult(_0x4e062a,_0x41cbd7){return function(_0x32f86d){if(_0x32f86d){var _0x2d4cf0=typeof _0x41cbd7['offset']===_0xe896('0x22')&&typeof _0x41cbd7[_0xe896('0x23')]===_0xe896('0x22');var _0xbebbe1=_0x32f86d[_0xe896('0x24')];var _0x3ac8b8=_0x2d4cf0?0x0:_0x41cbd7[_0xe896('0x25')];var _0x32d3d3=_0x2d4cf0?_0x32f86d['count']:_0x41cbd7[_0xe896('0x25')]+_0x41cbd7['limit'];var _0x5d2c8d;if(_0x32d3d3>=_0xbebbe1){_0x32d3d3=_0xbebbe1;_0x5d2c8d=0xc8;}else{_0x5d2c8d=0xce;}_0x4e062a[_0xe896('0x20')](_0x5d2c8d);return _0x4e062a[_0xe896('0x26')](_0xe896('0x27'),_0x3ac8b8+'-'+_0x32d3d3+'/'+_0xbebbe1)[_0xe896('0x21')](_0x32f86d);}return null;};}function patchUpdates(_0x498469){return function(_0x468479){try{jsonpatch['apply'](_0x468479,_0x498469,!![]);}catch(_0x5001f7){return BPromise[_0xe896('0x28')](_0x5001f7);}return _0x468479[_0xe896('0x29')]();};}function saveUpdates(_0x1e952a,_0x2e2c10){return function(_0x20e295){if(_0x20e295){return _0x20e295[_0xe896('0x2a')](_0x1e952a)[_0xe896('0x2b')](function(_0x4b71cc){return _0x4b71cc;});}return null;};}function removeEntity(_0x390128,_0x163a75){return function(_0xc3cd05){if(_0xc3cd05){return _0xc3cd05['destroy']()[_0xe896('0x2b')](function(){var _0xd50fe2=_0xc3cd05[_0xe896('0x2c')]({'plain':!![]});var _0xe93aa0=_0xe896('0x2d');return db[_0xe896('0x2e')]['destroy']({'where':{'type':_0xe93aa0,'resourceId':_0xd50fe2['id']}})[_0xe896('0x2b')](function(){return _0xc3cd05;});})[_0xe896('0x2b')](function(){_0x390128[_0xe896('0x20')](0xcc)[_0xe896('0x2f')]();});}};}function handleEntityNotFound(_0xace03f,_0x5e0d9b){return function(_0x47c268){if(!_0x47c268){_0xace03f['sendStatus'](0x194);}return _0x47c268;};}function handleError(_0x504d7c,_0x562ddd){_0x562ddd=_0x562ddd||0x1f4;return function(_0x291290){logger[_0xe896('0x30')](_0x291290[_0xe896('0x31')]);if(_0x291290[_0xe896('0x32')]){delete _0x291290[_0xe896('0x32')];}_0x504d7c[_0xe896('0x20')](_0x562ddd)[_0xe896('0x33')](_0x291290);};}exports[_0xe896('0x34')]=function(_0x4ab96b,_0x4ce052){var _0x142d29={},_0x255dd1={},_0x29be89={'count':0x0,'rows':[]};var _0x76c0c3=_['map'](db[_0xe896('0x35')]['rawAttributes'],function(_0x57c6e8){return{'name':_0x57c6e8[_0xe896('0x36')],'type':_0x57c6e8[_0xe896('0x37')][_0xe896('0x38')]};});_0x255dd1['model']=_['map'](_0x76c0c3,'name');_0x255dd1[_0xe896('0x39')]=_[_0xe896('0x3a')](_0x4ab96b[_0xe896('0x39')]);_0x255dd1[_0xe896('0x3b')]=_[_0xe896('0x3c')](_0x255dd1['model'],_0x255dd1[_0xe896('0x39')]);_0x142d29[_0xe896('0x3d')]=_[_0xe896('0x3c')](_0x255dd1[_0xe896('0x3e')],qs[_0xe896('0x3f')](_0x4ab96b[_0xe896('0x39')][_0xe896('0x3f')]));_0x142d29[_0xe896('0x3d')]=_0x142d29['attributes'][_0xe896('0x40')]?_0x142d29[_0xe896('0x3d')]:_0x255dd1['model'];if(!_0x4ab96b[_0xe896('0x39')]['hasOwnProperty'](_0xe896('0x41'))){_0x142d29['limit']=qs[_0xe896('0x23')](_0x4ab96b['query'][_0xe896('0x23')]);_0x142d29[_0xe896('0x25')]=qs[_0xe896('0x25')](_0x4ab96b[_0xe896('0x39')][_0xe896('0x25')]);}_0x142d29['order']=qs['sort'](_0x4ab96b[_0xe896('0x39')][_0xe896('0x42')]);_0x142d29[_0xe896('0x43')]=qs[_0xe896('0x3b')](_[_0xe896('0x44')](_0x4ab96b['query'],_0x255dd1['filters']),_0x76c0c3);if(_0x4ab96b[_0xe896('0x39')][_0xe896('0x45')]){_0x142d29['where']=_['merge'](_0x142d29[_0xe896('0x43')],{'$or':_[_0xe896('0x46')](_0x76c0c3,function(_0x911adb){if(_0x911adb[_0xe896('0x37')]!==_0xe896('0x47')){var _0x41fa6f={};_0x41fa6f[_0x911adb[_0xe896('0x32')]]={'$like':'%'+_0x4ab96b[_0xe896('0x39')][_0xe896('0x45')]+'%'};return _0x41fa6f;}})});}_0x142d29=_[_0xe896('0x48')]({},_0x142d29,_0x4ab96b[_0xe896('0x49')]);var _0x1bc76a={'where':_0x142d29['where']};return db[_0xe896('0x35')][_0xe896('0x24')](_0x1bc76a)['then'](function(_0x57366b){_0x29be89['count']=_0x57366b;if(_0x4ab96b[_0xe896('0x39')][_0xe896('0x4a')]){_0x142d29[_0xe896('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0xe896('0x4c')](_0x142d29);})[_0xe896('0x2b')](function(_0x55a8ba){_0x29be89['rows']=_0x55a8ba;return _0x29be89;})['then'](respondWithFilteredResult(_0x4ce052,_0x142d29))[_0xe896('0x4d')](handleError(_0x4ce052,null));};exports[_0xe896('0x4e')]=function(_0x16927a,_0x402aef){var _0x4452aa={'raw':![],'where':{'id':_0x16927a['params']['id']}},_0x2ae833={};_0x2ae833[_0xe896('0x3e')]=_[_0xe896('0x3a')](db['VoicePrefix'][_0xe896('0x4f')]);_0x2ae833[_0xe896('0x39')]=_[_0xe896('0x3a')](_0x16927a[_0xe896('0x39')]);_0x2ae833['filters']=_[_0xe896('0x3c')](_0x2ae833[_0xe896('0x3e')],_0x2ae833[_0xe896('0x39')]);_0x4452aa[_0xe896('0x3d')]=_[_0xe896('0x3c')](_0x2ae833[_0xe896('0x3e')],qs['fields'](_0x16927a[_0xe896('0x39')]['fields']));_0x4452aa[_0xe896('0x3d')]=_0x4452aa[_0xe896('0x3d')][_0xe896('0x40')]?_0x4452aa[_0xe896('0x3d')]:_0x2ae833[_0xe896('0x3e')];if(_0x16927a[_0xe896('0x39')]['includeAll']){_0x4452aa[_0xe896('0x4b')]=[{'all':!![]}];}_0x4452aa=_[_0xe896('0x48')]({},_0x4452aa,_0x16927a['options']);return db[_0xe896('0x35')][_0xe896('0x50')](_0x4452aa)['then'](handleEntityNotFound(_0x402aef,null))[_0xe896('0x2b')](respondWithResult(_0x402aef,null))['catch'](handleError(_0x402aef,null));};exports[_0xe896('0x51')]=function(_0xb90690,_0x3fd073){return db[_0xe896('0x35')][_0xe896('0x50')]({'where':{'id':_0xb90690['params']['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x3fd073,null))[_0xe896('0x2b')](removeEntity(_0x3fd073,null))[_0xe896('0x4d')](handleError(_0x3fd073,null));};exports['describe']=function(_0x2ceae5,_0x5d205b){return db['VoicePrefix'][_0xe896('0x52')]()[_0xe896('0x2b')](respondWithResult(_0x5d205b,null))['catch'](handleError(_0x5d205b,null));};exports[_0xe896('0x53')]=function(_0x3d137b,_0x5bfd1e){var _0x58497a;return db[_0xe896('0x54')][_0xe896('0x55')](function(_0x5b8719){return db[_0xe896('0x35')][_0xe896('0x53')](_0x3d137b[_0xe896('0x56')],{'transaction':_0x5b8719})[_0xe896('0x2b')](function(_0x16d1c8){_0x58497a=_0x16d1c8[_0xe896('0x2c')]({'plain':!![]});return db[_0xe896('0x57')][_0xe896('0x50')]({'where':{'id':_0x58497a[_0xe896('0x58')]},'raw':!![]})[_0xe896('0x2b')](function(_0x357302){return createVoicePrefixExtensions(_0x58497a,_0x357302,_0x5b8719);});});})['then'](function(){var _0x1d7e31=_0x3d137b[_0xe896('0x59')][_0xe896('0x2c')]({'plain':!![]});if(!_0x1d7e31)throw new Error(_0xe896('0x5a'));if(_0x1d7e31[_0xe896('0x5b')]===_0xe896('0x59')){var _0x157946=_0x58497a;return db[_0xe896('0x5c')][_0xe896('0x50')]({'where':{'name':_0xe896('0x2d'),'userProfileId':_0x1d7e31[_0xe896('0x5d')]},'raw':!![]})[_0xe896('0x2b')](function(_0x5d8265){if(_0x5d8265&&_0x5d8265[_0xe896('0x5e')]===0x0){return db[_0xe896('0x2e')][_0xe896('0x53')]({'name':_0x157946['name'],'resourceId':_0x157946['id'],'type':_0x5d8265['name'],'sectionId':_0x5d8265['id']},{})['then'](function(){return _0x58497a;});}else{return _0x58497a;}})[_0xe896('0x4d')](function(_0x29aa11){logger[_0xe896('0x30')](_0xe896('0x5f'),_0x29aa11);throw _0x29aa11;});}return _0x58497a;})['then'](respondWithResult(_0x5bfd1e,null))[_0xe896('0x4d')](handleError(_0x5bfd1e,null));};function Extension(_0x28396c,_0x57ed84,_0x3c893a,_0x5d6c1c){this[_0xe896('0x60')]=_0xe896('0x61');this['exten']=_0x28396c;this[_0xe896('0x62')]=_0x3c893a;this[_0xe896('0x37')]='system';this['description']=_0xe896('0x63');this[_0xe896('0x64')]=_0x57ed84;this[_0xe896('0x65')]=_0x5d6c1c;}function createVoicePrefixExtensions(_0x11291a,_0x2a1858,_0x4e4092){return new BPromise(function(_0xdadb92,_0x3c82d1){var _0x113b00=new Extension(formatPrefixName(_0x11291a[_0xe896('0x66')]),0x1,'NoOp','Voice\x20Prefix');_0x113b00[_0xe896('0x67')]=_0x11291a['id'];return db[_0xe896('0x57')]['create'](_0x113b00,{'transaction':_0x4e4092})[_0xe896('0x2b')](function(_0x4f2d6e){var _0x3ccaad=_0x4f2d6e[_0xe896('0x2c')]({'plain':!![]});var _0xce2b25=_[_0xe896('0x46')](addVoicePrefixExtensions(_0x11291a,_0x2a1858),function(_0x11b001){_0x11b001[_0xe896('0x58')]=_0x3ccaad['id'];_0x11b001[_0xe896('0x67')]=_0x11291a['id'];return _0x11b001;});return db[_0xe896('0x57')][_0xe896('0x68')](_0xce2b25,{'transaction':_0x4e4092})[_0xe896('0x2b')](function(_0xcb329a){if(!_0xcb329a){return _0x3c82d1(_0xe896('0x69'));}else{return _0xdadb92(_0xcb329a);}})[_0xe896('0x4d')](function(_0x14d88e){return _0x3c82d1(_0x14d88e);});});;});};function addVoicePrefixExtensions(_0x468fd7,_0x33bd1b){var _0x404b42=[];var _0x26e75d=formatPrefixName(_0x468fd7[_0xe896('0x66')]);_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x2,_0xe896('0x6b'),_0xe896('0x6c')+_0x468fd7['name']));if(_0x468fd7['callerIdAll']){_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x3,_0xe896('0x6b'),'PREFIX-CALLERIDALL='+_0x468fd7[_0xe896('0x6d')]));}else{_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x3,_0xe896('0x6e'),_0xe896('0x6f')));}_0x404b42[_0xe896('0x6a')](new Extension(_0x26e75d,0x4,_0xe896('0x70'),_0x33bd1b[_0xe896('0x60')]+','+_0xe896('0x71')+(0x8+_0x468fd7[_0xe896('0x32')][_0xe896('0x40')])+'}'+','+0x1));return _0x404b42;}function formatPrefixName(_0x1479c8){var _0x4e417a='_';for(var _0x3d299a=0x0;_0x3d299a<_0x1479c8[_0xe896('0x40')];_0x3d299a++){if(_0x1479c8['charAt'](_0x3d299a)=='-'){_0x4e417a+=_0x1479c8[_0xe896('0x72')](_0x3d299a);}else{_0x4e417a+='['+_0x1479c8['charAt'](_0x3d299a)+']';}}_0x4e417a+='.';return _0x4e417a;}exports['update']=function(_0x1f3e10,_0x1bbeeb,_0x4fd476){var _0x56223c=_0x1f3e10[_0xe896('0x56')];_0x56223c['prefix']='system-'+_0x56223c[_0xe896('0x32')]+'-';return db[_0xe896('0x54')][_0xe896('0x55')](function(_0x539f6d){return db[_0xe896('0x35')][_0xe896('0x2a')](_0x56223c,{'where':{'id':_0x56223c['id']},'transaction':_0x539f6d})[_0xe896('0x2b')](function(){return db['VoiceExtension'][_0xe896('0x51')]({'where':{'VoicePrefixId':_0x56223c['id']},'transaction':_0x539f6d})[_0xe896('0x2b')](function(){return db[_0xe896('0x57')][_0xe896('0x50')]({'where':{'id':_0x56223c['VoiceExtensionId']},'raw':!![]})[_0xe896('0x2b')](function(_0x37d951){return createVoicePrefixExtensions(_0x56223c,_0x37d951,_0x539f6d);});});});})[_0xe896('0x2b')](function(){return db[_0xe896('0x35')]['findById'](_0x56223c['id']);})[_0xe896('0x2b')](respondWithResult(_0x1bbeeb,null))[_0xe896('0x4d')](handleError(_0x1bbeeb,null));};exports['addAgents']=function(_0x2d910b,_0x129ff2,_0x35ed8c){return db[_0xe896('0x35')]['find']({'where':{'id':_0x2d910b[_0xe896('0x73')]['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x129ff2,null))[_0xe896('0x2b')](function(_0x1ea3ea){if(_0x1ea3ea){return _0x1ea3ea[_0xe896('0x74')](_0x2d910b[_0xe896('0x56')]['ids'],_['omit'](_0x2d910b['body'],[_0xe896('0x75'),'id'])||{})[_0xe896('0x76')](function(_0x10421d){for(var _0x270121=0x0;_0x270121<_0x2d910b[_0xe896('0x56')][_0xe896('0x75')][_0xe896('0x40')];_0x270121+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x2d910b[_0xe896('0x56')]['ids'][_0x270121]),'VoicePrefixId':Number(_0x2d910b[_0xe896('0x73')]['id'])});}return _0x10421d;});}})['then'](respondWithResult(_0x129ff2,null))[_0xe896('0x4d')](handleError(_0x129ff2,null));};exports['removeAgents']=function(_0x2d2978,_0x36994f,_0x2ffb63){return db[_0xe896('0x35')][_0xe896('0x50')]({'where':{'id':_0x2d2978['params']['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x36994f,null))[_0xe896('0x2b')](function(_0x690a75){if(_0x690a75){return _0x690a75[_0xe896('0x77')](_0x2d2978[_0xe896('0x39')][_0xe896('0x75')])[_0xe896('0x2b')](function(){if(_['isArray'](_0x2d2978[_0xe896('0x39')]['ids'])){for(var _0x2008a9=0x0;_0x2008a9<_0x2d2978[_0xe896('0x39')][_0xe896('0x75')]['length'];_0x2008a9+=0x1){socket[_0xe896('0x78')](_0xe896('0x79'),{'UserId':Number(_0x2d2978[_0xe896('0x39')][_0xe896('0x75')][_0x2008a9]),'VoicePrefixId':Number(_0x2d2978[_0xe896('0x73')]['id'])});}}else{socket[_0xe896('0x78')](_0xe896('0x79'),{'UserId':Number(_0x2d2978[_0xe896('0x39')][_0xe896('0x75')]),'VoicePrefixId':Number(_0x2d2978[_0xe896('0x73')]['id'])});}});}})[_0xe896('0x2b')](respondWithStatusCode(_0x36994f,null))['catch'](handleError(_0x36994f,null));};exports[_0xe896('0x7a')]=function(_0x317880,_0x3d3a1b,_0x3b0f36){var _0x48885e={};var _0x12f5f6={};var _0x129fe0;var _0x8089;return db[_0xe896('0x35')][_0xe896('0x7b')]({'where':{'id':_0x317880[_0xe896('0x73')]['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x3d3a1b,null))[_0xe896('0x2b')](function(_0x1f37e4){if(_0x1f37e4){_0x129fe0=_0x1f37e4;_0x12f5f6[_0xe896('0x3e')]=_[_0xe896('0x3a')](db[_0xe896('0x7c')]['rawAttributes']);_0x12f5f6[_0xe896('0x39')]=_[_0xe896('0x3a')](_0x317880[_0xe896('0x39')]);_0x12f5f6['filters']=_[_0xe896('0x3c')](_0x12f5f6['model'],_0x12f5f6['query']);_0x48885e[_0xe896('0x3d')]=_[_0xe896('0x3c')](_0x12f5f6[_0xe896('0x3e')],qs['fields'](_0x317880[_0xe896('0x39')][_0xe896('0x3f')]));_0x48885e['attributes']=_0x48885e['attributes'][_0xe896('0x40')]?_0x48885e[_0xe896('0x3d')]:_0x12f5f6[_0xe896('0x3e')];_0x48885e[_0xe896('0x7d')]=qs[_0xe896('0x42')](_0x317880[_0xe896('0x39')][_0xe896('0x42')]);_0x48885e['where']=qs['filters'](_[_0xe896('0x44')](_0x317880['query'],_0x12f5f6['filters']));if(_0x317880[_0xe896('0x39')][_0xe896('0x45')]){_0x48885e[_0xe896('0x43')]=_[_0xe896('0x48')](_0x48885e['where'],{'$or':_[_0xe896('0x46')](_0x48885e[_0xe896('0x3d')],function(_0x487d67){var _0x13da47={};_0x13da47[_0x487d67]={'$like':'%'+_0x317880[_0xe896('0x39')][_0xe896('0x45')]+'%'};return _0x13da47;})});}_0x48885e=_[_0xe896('0x48')]({},_0x48885e,_0x317880[_0xe896('0x49')]);return _0x129fe0[_0xe896('0x7a')](_0x48885e);}})[_0xe896('0x2b')](function(_0x1c5812){if(_0x1c5812){_0x8089=_0x1c5812[_0xe896('0x40')];if(!_0x317880[_0xe896('0x39')][_0xe896('0x7e')](_0xe896('0x41'))){_0x48885e[_0xe896('0x23')]=qs['limit'](_0x317880[_0xe896('0x39')][_0xe896('0x23')]);_0x48885e[_0xe896('0x25')]=qs[_0xe896('0x25')](_0x317880[_0xe896('0x39')][_0xe896('0x25')]);}return _0x129fe0[_0xe896('0x7a')](_0x48885e);}})[_0xe896('0x2b')](function(_0x2bf6d5){if(_0x2bf6d5){return _0x2bf6d5?{'count':_0x8089,'rows':_0x2bf6d5}:null;}})[_0xe896('0x2b')](respondWithResult(_0x3d3a1b,null))['catch'](handleError(_0x3d3a1b,null));};exports['getTeams']=function(_0x41e6c4,_0x42c83c,_0x3822cd){var _0x56ee2d={};var _0x100804={};var _0x13b335;var _0x54f5e5;return db[_0xe896('0x35')][_0xe896('0x7b')]({'where':{'id':_0x41e6c4['params']['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x42c83c,null))[_0xe896('0x2b')](function(_0x20cfaf){if(_0x20cfaf){_0x13b335=_0x20cfaf;_0x100804[_0xe896('0x3e')]=_[_0xe896('0x3a')](db[_0xe896('0x7f')][_0xe896('0x4f')]);_0x100804[_0xe896('0x39')]=_['keys'](_0x41e6c4[_0xe896('0x39')]);_0x100804[_0xe896('0x3b')]=_[_0xe896('0x3c')](_0x100804[_0xe896('0x3e')],_0x100804[_0xe896('0x39')]);_0x56ee2d['attributes']=_[_0xe896('0x3c')](_0x100804[_0xe896('0x3e')],qs[_0xe896('0x3f')](_0x41e6c4['query'][_0xe896('0x3f')]));_0x56ee2d[_0xe896('0x3d')]=_0x56ee2d[_0xe896('0x3d')][_0xe896('0x40')]?_0x56ee2d[_0xe896('0x3d')]:_0x100804[_0xe896('0x3e')];_0x56ee2d[_0xe896('0x7d')]=qs[_0xe896('0x42')](_0x41e6c4[_0xe896('0x39')]['sort']);_0x56ee2d[_0xe896('0x43')]=qs['filters'](_[_0xe896('0x44')](_0x41e6c4[_0xe896('0x39')],_0x100804[_0xe896('0x3b')]));if(_0x41e6c4[_0xe896('0x39')]['filter']){_0x56ee2d[_0xe896('0x43')]=_[_0xe896('0x48')](_0x56ee2d['where'],{'$or':_[_0xe896('0x46')](_0x56ee2d[_0xe896('0x3d')],function(_0x474924){var _0x498987={};_0x498987[_0x474924]={'$like':'%'+_0x41e6c4[_0xe896('0x39')]['filter']+'%'};return _0x498987;})});}_0x56ee2d=_['merge']({},_0x56ee2d,_0x41e6c4[_0xe896('0x49')]);return _0x13b335[_0xe896('0x80')](_0x56ee2d);}})['then'](function(_0x1cf246){if(_0x1cf246){_0x54f5e5=_0x1cf246[_0xe896('0x40')];if(!_0x41e6c4['query']['hasOwnProperty']('nolimit')){_0x56ee2d['limit']=qs[_0xe896('0x23')](_0x41e6c4[_0xe896('0x39')][_0xe896('0x23')]);_0x56ee2d[_0xe896('0x25')]=qs[_0xe896('0x25')](_0x41e6c4[_0xe896('0x39')][_0xe896('0x25')]);}return _0x13b335[_0xe896('0x80')](_0x56ee2d);}})['then'](function(_0xd345d8){if(_0xd345d8){return _0xd345d8?{'count':_0x54f5e5,'rows':_0xd345d8}:null;}})[_0xe896('0x2b')](respondWithResult(_0x42c83c,null))[_0xe896('0x4d')](handleError(_0x42c83c,null));};exports[_0xe896('0x81')]=function(_0x5a254b,_0x4f4d26,_0x2f30a9){var _0x33fbb8=_0x5a254b['body']['ids'];var _0x419fc7;return db[_0xe896('0x7f')][_0xe896('0x4c')]({'where':{'id':_0x33fbb8},'attributes':['id'],'include':[{'model':db[_0xe896('0x7c')],'as':_0xe896('0x82'),'attributes':['id','name',_0xe896('0x83'),_0xe896('0x84'),_0xe896('0x85')],'raw':!![]}]})['then'](function(_0x231dcd){if(_0x231dcd){_0x419fc7=_0x231dcd;var _0x219ef1=_[_0xe896('0x86')](_0x231dcd,function(_0xdeaa37){var _0x43676c=_0xdeaa37['get']({'plain':!![]});return _0x43676c[_0xe896('0x82')];});return db[_0xe896('0x35')][_0xe896('0x50')]({'where':{'id':_0x5a254b['params']['id']}})[_0xe896('0x2b')](function(_0x5bfd3b){return db[_0xe896('0x54')][_0xe896('0x55')](function(_0x1e1820){return _0x5bfd3b[_0xe896('0x81')](_0x33fbb8,{'transaction':_0x1e1820})[_0xe896('0x2b')](function(){return BPromise[_0xe896('0x87')](_0x419fc7,function(_0x4870d7){return db['TeamVoicePrefix'][_0xe896('0x88')]({'TeamId':_0x4870d7['id'],'VoicePrefixId':_0x5a254b['params']['id']},{'transaction':_0x1e1820});});})[_0xe896('0x2b')](function(){return BPromise[_0xe896('0x87')](_0x219ef1,function(_0x5ac4ad){return db[_0xe896('0x89')][_0xe896('0x8a')]({'where':{'UserId':_0x5ac4ad['id'],'VoicePrefixId':_0x5a254b['params']['id']},'transaction':_0x1e1820});});})[_0xe896('0x2b')](function(){_0x219ef1['forEach'](function(_0x326c67){socket[_0xe896('0x78')](_0xe896('0x8b'),{'UserId':_0x326c67['id'],'VoicePrefixId':_0x5bfd3b['id']});});});});});}})[_0xe896('0x2b')](respondWithStatusCode(_0x4f4d26,null))['catch'](handleError(_0x4f4d26,null));};exports[_0xe896('0x8c')]=function(_0x25b297,_0x111c0d,_0x22ac85){return db[_0xe896('0x7f')][_0xe896('0x4c')]({'where':{'id':_0x25b297[_0xe896('0x39')][_0xe896('0x75')]},'attributes':['id'],'include':[{'model':db[_0xe896('0x7c')],'as':_0xe896('0x82'),'attributes':['id'],'raw':!![]}]})[_0xe896('0x2b')](handleEntityNotFound(_0x111c0d,null))[_0xe896('0x2b')](function(_0x23049d){var _0x39e735=_[_0xe896('0x46')](_0x23049d,'id');var _0xc0cb7c=[];var _0x16b398=[];var _0x4edeaf=squel[_0xe896('0x8d')]();_0x4edeaf[_0xe896('0x8e')]('tq.TeamId')['from'](_0xe896('0x8f'),'tq')[_0xe896('0x90')](_0xe896('0x91'),'ut',_0xe896('0x92'))[_0xe896('0x43')](_0xe896('0x93'),_0x25b297[_0xe896('0x73')]['id']);for(var _0x46a4f0=0x0;_0x46a4f0<_0x23049d['length'];_0x46a4f0+=0x1){let _0x13eb9a=_0x23049d[_0x46a4f0];for(var _0x3c70a3=0x0;_0x3c70a3<_0x13eb9a[_0xe896('0x82')][_0xe896('0x40')];_0x3c70a3+=0x1){let _0x59bea9=_0x13eb9a[_0xe896('0x82')][_0x3c70a3];var _0x54b2f0=_0x4edeaf['clone']();_0x54b2f0[_0xe896('0x43')](_0xe896('0x94'),_0x59bea9['id']);_0x16b398[_0xe896('0x6a')](db[_0xe896('0x54')][_0xe896('0x39')](_0x54b2f0[_0xe896('0x95')](),{'type':db[_0xe896('0x54')]['QueryTypes'][_0xe896('0x96')]})[_0xe896('0x2b')](function(_0x98bc8){if(_0x98bc8[_0xe896('0x40')]===0x1){return _0x59bea9['id'];}else{var _0xe78476=_[_0xe896('0x97')](_[_0xe896('0x46')](_0x98bc8,_0xe896('0x98')),function(_0x3c377e){return _['includes'](_0x39e735,_0x3c377e);});if(_0xe78476){return _0x59bea9['id'];}}}));}}return BPromise[_0xe896('0x99')](_0x16b398)[_0xe896('0x2b')](function(_0x4983ea){_0xc0cb7c=_(_0xc0cb7c)[_0xe896('0x9a')](_0x4983ea)['compact']()['value']();return db[_0xe896('0x35')]['find']({'where':{'id':_0x25b297['params']['id']}})[_0xe896('0x2b')](function(_0x1af1a2){return db[_0xe896('0x54')]['transaction'](function(_0x2b72af){return _0x1af1a2['removeTeams'](_0x25b297[_0xe896('0x39')][_0xe896('0x75')],{'transaction':_0x2b72af})['then'](function(){if(!_[_0xe896('0x9b')](_0xc0cb7c)){return _0x1af1a2[_0xe896('0x77')](_0xc0cb7c,{'transaction':_0x2b72af});}})['then'](function(){_0xc0cb7c[_0xe896('0x9c')](function(_0x5478f3){socket['emit']('userVoicePrefix:remove',{'UserId':_0x5478f3,'VoicePrefixId':_0x1af1a2['id']});});});});});});})[_0xe896('0x2b')](respondWithStatusCode(_0x111c0d,null))['catch'](handleError(_0x111c0d,null));}; \ No newline at end of file +var _0x1399=['Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','each','upsert','UserVoicePrefix','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','includes','all','compact','value','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./voicePrefix.socket','register','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','VoicePrefixes','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','VoicePrefix','findAll','catch','show','params','includeAll','find','describe','transaction','create','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','error','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate'];(function(_0x43a7fd,_0x305efe){var _0x2c7d63=function(_0x2ae75f){while(--_0x2ae75f){_0x43a7fd['push'](_0x43a7fd['shift']());}};_0x2c7d63(++_0x305efe);}(_0x1399,0x16c));var _0x9139=function(_0x47c5d8,_0x39bd42){_0x47c5d8=_0x47c5d8-0x0;var _0x55acdb=_0x1399[_0x47c5d8];return _0x55acdb;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9139('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9139('0x17'))(new Redis(config[_0x9139('0x16')]));require(_0x9139('0x18'))[_0x9139('0x19')](socket);function respondWithStatusCode(_0x5936d2,_0x3b1f21){_0x3b1f21=_0x3b1f21||0xcc;return function(_0x4d1a85){if(_0x4d1a85){return _0x5936d2['sendStatus'](_0x3b1f21);}return _0x5936d2['status'](_0x3b1f21)[_0x9139('0x1a')]();};}function respondWithResult(_0x3e2bad,_0x1cd24e){_0x1cd24e=_0x1cd24e||0xc8;return function(_0x3fadf7){if(_0x3fadf7){return _0x3e2bad[_0x9139('0x1b')](_0x1cd24e)[_0x9139('0x1c')](_0x3fadf7);}};}function respondWithFilteredResult(_0x4bd957,_0x57b9df){return function(_0x13cab8){if(_0x13cab8){var _0xe39cbc=typeof _0x57b9df['offset']==='undefined'&&typeof _0x57b9df[_0x9139('0x1d')]===_0x9139('0x1e');var _0x56add4=_0x13cab8[_0x9139('0x1f')];var _0x1ef57b=_0xe39cbc?0x0:_0x57b9df[_0x9139('0x20')];var _0x3c8296=_0xe39cbc?_0x13cab8[_0x9139('0x1f')]:_0x57b9df[_0x9139('0x20')]+_0x57b9df[_0x9139('0x1d')];var _0x45fa16;if(_0x3c8296>=_0x56add4){_0x3c8296=_0x56add4;_0x45fa16=0xc8;}else{_0x45fa16=0xce;}_0x4bd957[_0x9139('0x1b')](_0x45fa16);return _0x4bd957[_0x9139('0x21')](_0x9139('0x22'),_0x1ef57b+'-'+_0x3c8296+'/'+_0x56add4)[_0x9139('0x1c')](_0x13cab8);}return null;};}function patchUpdates(_0x5a3e2e){return function(_0x105170){try{jsonpatch[_0x9139('0x23')](_0x105170,_0x5a3e2e,!![]);}catch(_0x31635a){return BPromise[_0x9139('0x24')](_0x31635a);}return _0x105170[_0x9139('0x25')]();};}function saveUpdates(_0x1a7350,_0x4b7fe0){return function(_0x28bf7d){if(_0x28bf7d){return _0x28bf7d[_0x9139('0x26')](_0x1a7350)['then'](function(_0x3ed4da){return _0x3ed4da;});}return null;};}function removeEntity(_0x2ee4bb,_0x10bfa0){return function(_0x4a3ed2){if(_0x4a3ed2){return _0x4a3ed2[_0x9139('0x27')]()[_0x9139('0x28')](function(){var _0x49d01e=_0x4a3ed2[_0x9139('0x29')]({'plain':!![]});var _0x39e8cf=_0x9139('0x2a');return db['UserProfileResource'][_0x9139('0x27')]({'where':{'type':_0x39e8cf,'resourceId':_0x49d01e['id']}})[_0x9139('0x28')](function(){return _0x4a3ed2;});})[_0x9139('0x28')](function(){_0x2ee4bb[_0x9139('0x1b')](0xcc)[_0x9139('0x1a')]();});}};}function handleEntityNotFound(_0x16dfb4,_0xfe6854){return function(_0x573a05){if(!_0x573a05){_0x16dfb4['sendStatus'](0x194);}return _0x573a05;};}function handleError(_0x1b3fd9,_0x22d0f8){_0x22d0f8=_0x22d0f8||0x1f4;return function(_0xd27355){logger['error'](_0xd27355['stack']);if(_0xd27355[_0x9139('0x2b')]){delete _0xd27355[_0x9139('0x2b')];}_0x1b3fd9[_0x9139('0x1b')](_0x22d0f8)[_0x9139('0x2c')](_0xd27355);};}exports[_0x9139('0x2d')]=function(_0x541644,_0x5a1673){var _0x2f26de={},_0x57a6fb={},_0x4de1a2={'count':0x0,'rows':[]};var _0x222429=_[_0x9139('0x2e')](db['VoicePrefix'][_0x9139('0x2f')],function(_0xe658c2){return{'name':_0xe658c2['fieldName'],'type':_0xe658c2[_0x9139('0x30')][_0x9139('0x31')]};});_0x57a6fb[_0x9139('0x32')]=_[_0x9139('0x2e')](_0x222429,_0x9139('0x2b'));_0x57a6fb[_0x9139('0x33')]=_[_0x9139('0x34')](_0x541644[_0x9139('0x33')]);_0x57a6fb[_0x9139('0x35')]=_[_0x9139('0x36')](_0x57a6fb[_0x9139('0x32')],_0x57a6fb['query']);_0x2f26de[_0x9139('0x37')]=_[_0x9139('0x36')](_0x57a6fb['model'],qs[_0x9139('0x38')](_0x541644[_0x9139('0x33')][_0x9139('0x38')]));_0x2f26de['attributes']=_0x2f26de[_0x9139('0x37')][_0x9139('0x39')]?_0x2f26de[_0x9139('0x37')]:_0x57a6fb[_0x9139('0x32')];if(!_0x541644[_0x9139('0x33')][_0x9139('0x3a')](_0x9139('0x3b'))){_0x2f26de[_0x9139('0x1d')]=qs[_0x9139('0x1d')](_0x541644[_0x9139('0x33')]['limit']);_0x2f26de[_0x9139('0x20')]=qs[_0x9139('0x20')](_0x541644[_0x9139('0x33')][_0x9139('0x20')]);}_0x2f26de[_0x9139('0x3c')]=qs[_0x9139('0x3d')](_0x541644[_0x9139('0x33')]['sort']);_0x2f26de[_0x9139('0x3e')]=qs['filters'](_[_0x9139('0x3f')](_0x541644[_0x9139('0x33')],_0x57a6fb[_0x9139('0x35')]),_0x222429);if(_0x541644['query'][_0x9139('0x40')]){_0x2f26de[_0x9139('0x3e')]=_[_0x9139('0x41')](_0x2f26de[_0x9139('0x3e')],{'$or':_[_0x9139('0x2e')](_0x222429,function(_0xe90991){if(_0xe90991[_0x9139('0x30')]!==_0x9139('0x42')){var _0x118d53={};_0x118d53[_0xe90991[_0x9139('0x2b')]]={'$like':'%'+_0x541644['query'][_0x9139('0x40')]+'%'};return _0x118d53;}})});}_0x2f26de=_[_0x9139('0x41')]({},_0x2f26de,_0x541644[_0x9139('0x43')]);var _0x4b8dd7={'where':_0x2f26de['where']};return db['VoicePrefix'][_0x9139('0x1f')](_0x4b8dd7)[_0x9139('0x28')](function(_0x3611b4){_0x4de1a2[_0x9139('0x1f')]=_0x3611b4;if(_0x541644[_0x9139('0x33')]['includeAll']){_0x2f26de[_0x9139('0x44')]=[{'all':!![]}];}return db[_0x9139('0x45')][_0x9139('0x46')](_0x2f26de);})[_0x9139('0x28')](function(_0x2197ff){_0x4de1a2['rows']=_0x2197ff;return _0x4de1a2;})[_0x9139('0x28')](respondWithFilteredResult(_0x5a1673,_0x2f26de))[_0x9139('0x47')](handleError(_0x5a1673,null));};exports[_0x9139('0x48')]=function(_0x197891,_0x539a55){var _0x5b0aec={'raw':![],'where':{'id':_0x197891[_0x9139('0x49')]['id']}},_0x39d3dc={};_0x39d3dc['model']=_['keys'](db[_0x9139('0x45')][_0x9139('0x2f')]);_0x39d3dc['query']=_[_0x9139('0x34')](_0x197891[_0x9139('0x33')]);_0x39d3dc['filters']=_[_0x9139('0x36')](_0x39d3dc['model'],_0x39d3dc['query']);_0x5b0aec[_0x9139('0x37')]=_[_0x9139('0x36')](_0x39d3dc[_0x9139('0x32')],qs[_0x9139('0x38')](_0x197891[_0x9139('0x33')]['fields']));_0x5b0aec[_0x9139('0x37')]=_0x5b0aec[_0x9139('0x37')][_0x9139('0x39')]?_0x5b0aec['attributes']:_0x39d3dc[_0x9139('0x32')];if(_0x197891[_0x9139('0x33')][_0x9139('0x4a')]){_0x5b0aec[_0x9139('0x44')]=[{'all':!![]}];}_0x5b0aec=_[_0x9139('0x41')]({},_0x5b0aec,_0x197891[_0x9139('0x43')]);return db[_0x9139('0x45')][_0x9139('0x4b')](_0x5b0aec)[_0x9139('0x28')](handleEntityNotFound(_0x539a55,null))[_0x9139('0x28')](respondWithResult(_0x539a55,null))[_0x9139('0x47')](handleError(_0x539a55,null));};exports['destroy']=function(_0x10eb03,_0x2e1bbe){return db[_0x9139('0x45')]['find']({'where':{'id':_0x10eb03[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x2e1bbe,null))['then'](removeEntity(_0x2e1bbe,null))[_0x9139('0x47')](handleError(_0x2e1bbe,null));};exports[_0x9139('0x4c')]=function(_0x83f1d2,_0x5180b5){return db[_0x9139('0x45')][_0x9139('0x4c')]()[_0x9139('0x28')](respondWithResult(_0x5180b5,null))[_0x9139('0x47')](handleError(_0x5180b5,null));};exports['create']=function(_0x2b6948,_0x1a2a2d){var _0x3ba071;return db['sequelize'][_0x9139('0x4d')](function(_0x146201){return db[_0x9139('0x45')][_0x9139('0x4e')](_0x2b6948[_0x9139('0x4f')],{'transaction':_0x146201})[_0x9139('0x28')](function(_0x2b22fa){_0x3ba071=_0x2b22fa['get']({'plain':!![]});return db[_0x9139('0x50')][_0x9139('0x4b')]({'where':{'id':_0x3ba071['VoiceExtensionId']},'raw':!![]})[_0x9139('0x28')](function(_0x1e1290){return createVoicePrefixExtensions(_0x3ba071,_0x1e1290,_0x146201);});});})[_0x9139('0x28')](function(){var _0x1a0841=_0x2b6948[_0x9139('0x51')]['get']({'plain':!![]});if(!_0x1a0841)throw new Error(_0x9139('0x52'));if(_0x1a0841[_0x9139('0x53')]==='user'){var _0x500863=_0x3ba071;return db[_0x9139('0x54')][_0x9139('0x4b')]({'where':{'name':_0x9139('0x2a'),'userProfileId':_0x1a0841['userProfileId']},'raw':!![]})[_0x9139('0x28')](function(_0x576b5a){if(_0x576b5a&&_0x576b5a['autoAssociation']===0x0){return db[_0x9139('0x55')][_0x9139('0x4e')]({'name':_0x500863[_0x9139('0x2b')],'resourceId':_0x500863['id'],'type':_0x576b5a[_0x9139('0x2b')],'sectionId':_0x576b5a['id']},{})['then'](function(){return _0x3ba071;});}else{return _0x3ba071;}})[_0x9139('0x47')](function(_0x91a5a8){logger[_0x9139('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x91a5a8);throw _0x91a5a8;});}return _0x3ba071;})[_0x9139('0x28')](respondWithResult(_0x1a2a2d,null))[_0x9139('0x47')](handleError(_0x1a2a2d,null));};function Extension(_0x25cf0f,_0x73d4fc,_0x163730,_0x3f7e41){this[_0x9139('0x57')]=_0x9139('0x58');this[_0x9139('0x59')]=_0x25cf0f;this[_0x9139('0x5a')]=_0x163730;this[_0x9139('0x30')]=_0x9139('0x5b');this[_0x9139('0x5c')]=_0x9139('0x5d');this['priority']=_0x73d4fc;this[_0x9139('0x5e')]=_0x3f7e41;}function createVoicePrefixExtensions(_0x32b31b,_0x3ef34c,_0x37433c){return new BPromise(function(_0x40afea,_0x53c09a){var _0x3feaac=new Extension(formatPrefixName(_0x32b31b[_0x9139('0x5f')]),0x1,_0x9139('0x60'),_0x9139('0x61'));_0x3feaac[_0x9139('0x62')]=_0x32b31b['id'];return db['VoiceExtension']['create'](_0x3feaac,{'transaction':_0x37433c})[_0x9139('0x28')](function(_0x3a0bc6){var _0x4b0274=_0x3a0bc6[_0x9139('0x29')]({'plain':!![]});var _0xd20c65=_[_0x9139('0x2e')](addVoicePrefixExtensions(_0x32b31b,_0x3ef34c),function(_0x4c125e){_0x4c125e[_0x9139('0x63')]=_0x4b0274['id'];_0x4c125e[_0x9139('0x62')]=_0x32b31b['id'];return _0x4c125e;});return db[_0x9139('0x50')][_0x9139('0x64')](_0xd20c65,{'transaction':_0x37433c})[_0x9139('0x28')](function(_0x53a27f){if(!_0x53a27f){return _0x53c09a(_0x9139('0x65'));}else{return _0x40afea(_0x53a27f);}})[_0x9139('0x47')](function(_0x336230){return _0x53c09a(_0x336230);});});;});};function addVoicePrefixExtensions(_0x26fe55,_0x4f6e7c){var _0x53152f=[];var _0x46b5cb=formatPrefixName(_0x26fe55[_0x9139('0x5f')]);_0x53152f[_0x9139('0x66')](new Extension(_0x46b5cb,0x2,_0x9139('0x67'),'CDR(prefix)='+_0x26fe55[_0x9139('0x2b')]));if(_0x26fe55[_0x9139('0x68')]){_0x53152f['push'](new Extension(_0x46b5cb,0x3,_0x9139('0x67'),_0x9139('0x69')+_0x26fe55[_0x9139('0x68')]));}else{_0x53152f[_0x9139('0x66')](new Extension(_0x46b5cb,0x3,_0x9139('0x60'),_0x9139('0x6a')));}_0x53152f[_0x9139('0x66')](new Extension(_0x46b5cb,0x4,_0x9139('0x6b'),_0x4f6e7c['context']+','+'${EXTEN:'+(0x8+_0x26fe55['name'][_0x9139('0x39')])+'}'+','+0x1));return _0x53152f;}function formatPrefixName(_0x1025d6){var _0x2235fb='_';for(var _0x4eefd8=0x0;_0x4eefd8<_0x1025d6[_0x9139('0x39')];_0x4eefd8++){if(_0x1025d6[_0x9139('0x6c')](_0x4eefd8)=='-'){_0x2235fb+=_0x1025d6[_0x9139('0x6c')](_0x4eefd8);}else{_0x2235fb+='['+_0x1025d6[_0x9139('0x6c')](_0x4eefd8)+']';}}_0x2235fb+='.';return _0x2235fb;}exports[_0x9139('0x26')]=function(_0x3aacdb,_0x5d9ae8,_0x437d18){var _0x582b67=_0x3aacdb[_0x9139('0x4f')];_0x582b67['prefix']=_0x9139('0x6d')+_0x582b67[_0x9139('0x2b')]+'-';return db['sequelize']['transaction'](function(_0x4324ed){return db[_0x9139('0x45')][_0x9139('0x26')](_0x582b67,{'where':{'id':_0x582b67['id']},'transaction':_0x4324ed})['then'](function(){return db[_0x9139('0x50')][_0x9139('0x27')]({'where':{'VoicePrefixId':_0x582b67['id']},'transaction':_0x4324ed})[_0x9139('0x28')](function(){return db[_0x9139('0x50')]['find']({'where':{'id':_0x582b67['VoiceExtensionId']},'raw':!![]})[_0x9139('0x28')](function(_0x2462fc){return createVoicePrefixExtensions(_0x582b67,_0x2462fc,_0x4324ed);});});});})['then'](function(){return db[_0x9139('0x45')][_0x9139('0x6e')](_0x582b67['id']);})[_0x9139('0x28')](respondWithResult(_0x5d9ae8,null))[_0x9139('0x47')](handleError(_0x5d9ae8,null));};exports[_0x9139('0x6f')]=function(_0x400ac9,_0x3c17fd,_0x3167bb){return db[_0x9139('0x45')][_0x9139('0x4b')]({'where':{'id':_0x400ac9[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x3c17fd,null))[_0x9139('0x28')](function(_0x582a47){if(_0x582a47){return _0x582a47[_0x9139('0x6f')](_0x400ac9[_0x9139('0x4f')][_0x9139('0x70')],_[_0x9139('0x71')](_0x400ac9[_0x9139('0x4f')],['ids','id'])||{})[_0x9139('0x72')](function(_0x54cd2a){for(var _0x14868a=0x0;_0x14868a<_0x400ac9[_0x9139('0x4f')][_0x9139('0x70')]['length'];_0x14868a+=0x1){socket[_0x9139('0x73')](_0x9139('0x74'),{'UserId':Number(_0x400ac9['body'][_0x9139('0x70')][_0x14868a]),'VoicePrefixId':Number(_0x400ac9[_0x9139('0x49')]['id'])});}return _0x54cd2a;});}})[_0x9139('0x28')](respondWithResult(_0x3c17fd,null))[_0x9139('0x47')](handleError(_0x3c17fd,null));};exports[_0x9139('0x75')]=function(_0x451458,_0x1abb10,_0x24b8d8){return db[_0x9139('0x45')]['find']({'where':{'id':_0x451458[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x1abb10,null))[_0x9139('0x28')](function(_0x3c3474){if(_0x3c3474){return _0x3c3474[_0x9139('0x75')](_0x451458['query'][_0x9139('0x70')])[_0x9139('0x28')](function(){if(_['isArray'](_0x451458['query'][_0x9139('0x70')])){for(var _0x377234=0x0;_0x377234<_0x451458[_0x9139('0x33')][_0x9139('0x70')]['length'];_0x377234+=0x1){socket[_0x9139('0x73')](_0x9139('0x76'),{'UserId':Number(_0x451458[_0x9139('0x33')][_0x9139('0x70')][_0x377234]),'VoicePrefixId':Number(_0x451458[_0x9139('0x49')]['id'])});}}else{socket[_0x9139('0x73')](_0x9139('0x76'),{'UserId':Number(_0x451458[_0x9139('0x33')][_0x9139('0x70')]),'VoicePrefixId':Number(_0x451458[_0x9139('0x49')]['id'])});}});}})[_0x9139('0x28')](respondWithStatusCode(_0x1abb10,null))[_0x9139('0x47')](handleError(_0x1abb10,null));};exports[_0x9139('0x77')]=function(_0x100c61,_0x1bcf40,_0x402a07){var _0x4152b2={};var _0x43a3d4={};var _0x2d9821;var _0x55ac7a;return db[_0x9139('0x45')][_0x9139('0x78')]({'where':{'id':_0x100c61[_0x9139('0x49')]['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x1bcf40,null))[_0x9139('0x28')](function(_0x4c633e){if(_0x4c633e){_0x2d9821=_0x4c633e;_0x43a3d4[_0x9139('0x32')]=_[_0x9139('0x34')](db[_0x9139('0x79')][_0x9139('0x2f')]);_0x43a3d4[_0x9139('0x33')]=_[_0x9139('0x34')](_0x100c61[_0x9139('0x33')]);_0x43a3d4['filters']=_['intersection'](_0x43a3d4[_0x9139('0x32')],_0x43a3d4[_0x9139('0x33')]);_0x4152b2[_0x9139('0x37')]=_[_0x9139('0x36')](_0x43a3d4['model'],qs['fields'](_0x100c61[_0x9139('0x33')][_0x9139('0x38')]));_0x4152b2[_0x9139('0x37')]=_0x4152b2[_0x9139('0x37')][_0x9139('0x39')]?_0x4152b2[_0x9139('0x37')]:_0x43a3d4[_0x9139('0x32')];_0x4152b2[_0x9139('0x3c')]=qs[_0x9139('0x3d')](_0x100c61['query'][_0x9139('0x3d')]);_0x4152b2['where']=qs[_0x9139('0x35')](_[_0x9139('0x3f')](_0x100c61[_0x9139('0x33')],_0x43a3d4[_0x9139('0x35')]));if(_0x100c61['query']['filter']){_0x4152b2[_0x9139('0x3e')]=_[_0x9139('0x41')](_0x4152b2[_0x9139('0x3e')],{'$or':_[_0x9139('0x2e')](_0x4152b2[_0x9139('0x37')],function(_0x49bdc7){var _0x47e8bf={};_0x47e8bf[_0x49bdc7]={'$like':'%'+_0x100c61[_0x9139('0x33')]['filter']+'%'};return _0x47e8bf;})});}_0x4152b2=_[_0x9139('0x41')]({},_0x4152b2,_0x100c61[_0x9139('0x43')]);return _0x2d9821[_0x9139('0x77')](_0x4152b2);}})['then'](function(_0x22ce9c){if(_0x22ce9c){_0x55ac7a=_0x22ce9c[_0x9139('0x39')];if(!_0x100c61[_0x9139('0x33')][_0x9139('0x3a')](_0x9139('0x3b'))){_0x4152b2[_0x9139('0x1d')]=qs['limit'](_0x100c61[_0x9139('0x33')][_0x9139('0x1d')]);_0x4152b2[_0x9139('0x20')]=qs[_0x9139('0x20')](_0x100c61['query']['offset']);}return _0x2d9821[_0x9139('0x77')](_0x4152b2);}})[_0x9139('0x28')](function(_0x4fe06f){if(_0x4fe06f){return _0x4fe06f?{'count':_0x55ac7a,'rows':_0x4fe06f}:null;}})['then'](respondWithResult(_0x1bcf40,null))[_0x9139('0x47')](handleError(_0x1bcf40,null));};exports['getTeams']=function(_0x43514f,_0x550504,_0x580185){var _0x21c1e0={};var _0x2ed30b={};var _0x7eeefb;var _0x22349d;return db[_0x9139('0x45')]['findOne']({'where':{'id':_0x43514f['params']['id']}})[_0x9139('0x28')](handleEntityNotFound(_0x550504,null))[_0x9139('0x28')](function(_0x459e1e){if(_0x459e1e){_0x7eeefb=_0x459e1e;_0x2ed30b[_0x9139('0x32')]=_['keys'](db[_0x9139('0x7a')]['rawAttributes']);_0x2ed30b[_0x9139('0x33')]=_[_0x9139('0x34')](_0x43514f[_0x9139('0x33')]);_0x2ed30b['filters']=_[_0x9139('0x36')](_0x2ed30b['model'],_0x2ed30b['query']);_0x21c1e0[_0x9139('0x37')]=_[_0x9139('0x36')](_0x2ed30b[_0x9139('0x32')],qs['fields'](_0x43514f[_0x9139('0x33')]['fields']));_0x21c1e0[_0x9139('0x37')]=_0x21c1e0[_0x9139('0x37')][_0x9139('0x39')]?_0x21c1e0[_0x9139('0x37')]:_0x2ed30b[_0x9139('0x32')];_0x21c1e0[_0x9139('0x3c')]=qs['sort'](_0x43514f['query'][_0x9139('0x3d')]);_0x21c1e0[_0x9139('0x3e')]=qs[_0x9139('0x35')](_[_0x9139('0x3f')](_0x43514f[_0x9139('0x33')],_0x2ed30b['filters']));if(_0x43514f['query'][_0x9139('0x40')]){_0x21c1e0[_0x9139('0x3e')]=_[_0x9139('0x41')](_0x21c1e0[_0x9139('0x3e')],{'$or':_[_0x9139('0x2e')](_0x21c1e0[_0x9139('0x37')],function(_0x5614df){var _0x55e8d7={};_0x55e8d7[_0x5614df]={'$like':'%'+_0x43514f[_0x9139('0x33')][_0x9139('0x40')]+'%'};return _0x55e8d7;})});}_0x21c1e0=_[_0x9139('0x41')]({},_0x21c1e0,_0x43514f['options']);return _0x7eeefb['getTeams'](_0x21c1e0);}})[_0x9139('0x28')](function(_0x4f8488){if(_0x4f8488){_0x22349d=_0x4f8488[_0x9139('0x39')];if(!_0x43514f['query'][_0x9139('0x3a')](_0x9139('0x3b'))){_0x21c1e0['limit']=qs[_0x9139('0x1d')](_0x43514f['query']['limit']);_0x21c1e0[_0x9139('0x20')]=qs[_0x9139('0x20')](_0x43514f[_0x9139('0x33')][_0x9139('0x20')]);}return _0x7eeefb[_0x9139('0x7b')](_0x21c1e0);}})[_0x9139('0x28')](function(_0x4cce2c){if(_0x4cce2c){return _0x4cce2c?{'count':_0x22349d,'rows':_0x4cce2c}:null;}})[_0x9139('0x28')](respondWithResult(_0x550504,null))[_0x9139('0x47')](handleError(_0x550504,null));};exports[_0x9139('0x7c')]=function(_0x387d19,_0x5511ac,_0x2c3437){var _0x24e241=_0x387d19[_0x9139('0x4f')][_0x9139('0x70')];var _0x10c463;return db[_0x9139('0x7a')][_0x9139('0x46')]({'where':{'id':_0x24e241},'attributes':['id'],'include':[{'model':db[_0x9139('0x79')],'as':'Agents','attributes':['id',_0x9139('0x2b'),_0x9139('0x7d'),_0x9139('0x7e'),_0x9139('0x7f')],'raw':!![]}]})[_0x9139('0x28')](function(_0xdbd388){if(_0xdbd388){_0x10c463=_0xdbd388;var _0x6a479a=_[_0x9139('0x80')](_0xdbd388,function(_0x4ab1ed){var _0x4ac0a5=_0x4ab1ed[_0x9139('0x29')]({'plain':!![]});return _0x4ac0a5[_0x9139('0x81')];});return db[_0x9139('0x45')][_0x9139('0x4b')]({'where':{'id':_0x387d19[_0x9139('0x49')]['id']}})[_0x9139('0x28')](function(_0x338cf4){return db[_0x9139('0x82')][_0x9139('0x4d')](function(_0x4ac429){return _0x338cf4[_0x9139('0x7c')](_0x24e241,{'transaction':_0x4ac429})[_0x9139('0x28')](function(){return BPromise[_0x9139('0x83')](_0x10c463,function(_0xee935b){return db['TeamVoicePrefix'][_0x9139('0x84')]({'TeamId':_0xee935b['id'],'VoicePrefixId':_0x387d19['params']['id']},{'transaction':_0x4ac429});});})[_0x9139('0x28')](function(){return BPromise[_0x9139('0x83')](_0x6a479a,function(_0x8ee6f3){return db[_0x9139('0x85')][_0x9139('0x86')]({'where':{'UserId':_0x8ee6f3['id'],'VoicePrefixId':_0x387d19[_0x9139('0x49')]['id']},'transaction':_0x4ac429});});})[_0x9139('0x28')](function(){_0x6a479a[_0x9139('0x87')](function(_0x520457){socket['emit']('userVoicePrefix:save',{'UserId':_0x520457['id'],'VoicePrefixId':_0x338cf4['id']});});});});});}})[_0x9139('0x28')](respondWithStatusCode(_0x5511ac,null))['catch'](handleError(_0x5511ac,null));};exports[_0x9139('0x88')]=function(_0x26e724,_0x31ede0,_0x13f114){return db[_0x9139('0x7a')][_0x9139('0x46')]({'where':{'id':_0x26e724[_0x9139('0x33')][_0x9139('0x70')]},'attributes':['id'],'include':[{'model':db[_0x9139('0x79')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9139('0x28')](handleEntityNotFound(_0x31ede0,null))['then'](function(_0x2cc56d){var _0x346236=_[_0x9139('0x2e')](_0x2cc56d,'id');var _0x2c3a84=[];var _0x518031=[];var _0x4e1267=squel[_0x9139('0x89')]();_0x4e1267[_0x9139('0x8a')](_0x9139('0x8b'))[_0x9139('0x8c')](_0x9139('0x8d'),'tq')[_0x9139('0x8e')](_0x9139('0x8f'),'ut',_0x9139('0x90'))[_0x9139('0x3e')](_0x9139('0x91'),_0x26e724['params']['id']);for(var _0x568234=0x0;_0x568234<_0x2cc56d[_0x9139('0x39')];_0x568234+=0x1){let _0x3e41e5=_0x2cc56d[_0x568234];for(var _0x27c1a2=0x0;_0x27c1a2<_0x3e41e5[_0x9139('0x81')][_0x9139('0x39')];_0x27c1a2+=0x1){let _0x40a2a5=_0x3e41e5[_0x9139('0x81')][_0x27c1a2];var _0x194b7d=_0x4e1267['clone']();_0x194b7d[_0x9139('0x3e')](_0x9139('0x92'),_0x40a2a5['id']);_0x518031['push'](db[_0x9139('0x82')][_0x9139('0x33')](_0x194b7d[_0x9139('0x93')](),{'type':db[_0x9139('0x82')][_0x9139('0x94')][_0x9139('0x95')]})[_0x9139('0x28')](function(_0x43ef80){if(_0x43ef80[_0x9139('0x39')]===0x1){return _0x40a2a5['id'];}else{var _0x4cb6ad=_[_0x9139('0x96')](_['map'](_0x43ef80,'TeamId'),function(_0xd0b878){return _[_0x9139('0x97')](_0x346236,_0xd0b878);});if(_0x4cb6ad){return _0x40a2a5['id'];}}}));}}return BPromise[_0x9139('0x98')](_0x518031)[_0x9139('0x28')](function(_0x59cf9d){_0x2c3a84=_(_0x2c3a84)['union'](_0x59cf9d)[_0x9139('0x99')]()[_0x9139('0x9a')]();return db['VoicePrefix'][_0x9139('0x4b')]({'where':{'id':_0x26e724[_0x9139('0x49')]['id']}})['then'](function(_0x18625c){return db['sequelize'][_0x9139('0x4d')](function(_0x20ff88){return _0x18625c[_0x9139('0x88')](_0x26e724[_0x9139('0x33')][_0x9139('0x70')],{'transaction':_0x20ff88})['then'](function(){if(!_['isEmpty'](_0x2c3a84)){return _0x18625c['removeAgents'](_0x2c3a84,{'transaction':_0x20ff88});}})['then'](function(){_0x2c3a84[_0x9139('0x87')](function(_0x4c4081){socket[_0x9139('0x73')](_0x9139('0x76'),{'UserId':_0x4c4081,'VoicePrefixId':_0x18625c['id']});});});});});});})[_0x9139('0x28')](respondWithStatusCode(_0x31ede0,null))[_0x9139('0x47')](handleError(_0x31ede0,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index dcf4d76..71f4655 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 _0x2a44=['hook','exports','../../mysqldb','VoicePrefix','save','remove','emit'];(function(_0x10a9b2,_0x39ae95){var _0x5a575b=function(_0x3ad7c6){while(--_0x3ad7c6){_0x10a9b2['push'](_0x10a9b2['shift']());}};_0x5a575b(++_0x39ae95);}(_0x2a44,0x1bb));var _0x42a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a44[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x42a4('0x0'))['db'][_0x42a4('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x42a4('0x2'),'afterUpdate':'update','afterDestroy':_0x42a4('0x3')};function emitEvent(_0x33d89e){return function(_0x4fff89,_0x5529f3,_0x5cfdd9){VoicePrefixEvents['emit'](_0x33d89e+':'+_0x4fff89['id'],_0x4fff89);VoicePrefixEvents[_0x42a4('0x4')](_0x33d89e,_0x4fff89);_0x5cfdd9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x42a4('0x5')](e,emitEvent(event));}}module[_0x42a4('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x8190=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4ff5a2,_0xb33150){var _0xe162f6=function(_0x321cbd){while(--_0x321cbd){_0x4ff5a2['push'](_0x4ff5a2['shift']());}};_0xe162f6(++_0xb33150);}(_0x8190,0x11d));var _0x0819=function(_0x3f19ca,_0x20c45b){_0x3f19ca=_0x3f19ca-0x0;var _0x2367d3=_0x8190[_0x3f19ca];return _0x2367d3;};'use strict';var EventEmitter=require(_0x0819('0x0'));var VoicePrefix=require(_0x0819('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0819('0x2')](0x0);var events={'afterCreate':_0x0819('0x3'),'afterUpdate':_0x0819('0x4'),'afterDestroy':_0x0819('0x5')};function emitEvent(_0xaec611){return function(_0x554fd3,_0x4f03fb,_0x9c0e71){VoicePrefixEvents['emit'](_0xaec611+':'+_0x554fd3['id'],_0x554fd3);VoicePrefixEvents[_0x0819('0x6')](_0xaec611,_0x554fd3);_0x9c0e71(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x0819('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index af828b1..ec2b89d 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 _0xc897=['../../config/environment','exports','define','voice_prefixes','api','bluebird','request-promise','path'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0xc897,0x1f4));var _0x7c89=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xc897[_0x32b993];return _0x482780;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c89('0x0'));var moment=require('moment');var BPromise=require(_0x7c89('0x1'));var rp=require(_0x7c89('0x2'));var fs=require('fs');var path=require(_0x7c89('0x3'));var rimraf=require('rimraf');var config=require(_0x7c89('0x4'));var attributes=require('./voicePrefix.attributes');module[_0x7c89('0x5')]=function(_0x2138fc,_0x3a4c64){return _0x2138fc[_0x7c89('0x6')]('VoicePrefix',attributes,{'tableName':_0x7c89('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bad=['voice_prefixes','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix'];(function(_0x3de303,_0x3212c5){var _0x4cd804=function(_0x1c8f23){while(--_0x1c8f23){_0x3de303['push'](_0x3de303['shift']());}};_0x4cd804(++_0x3212c5);}(_0x2bad,0x64));var _0xd2ba=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0x2bad[_0x28fbbf];return _0x543af6;};'use strict';var _=require(_0xd2ba('0x0'));var util=require(_0xd2ba('0x1'));var logger=require(_0xd2ba('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd2ba('0x3'));var fs=require('fs');var path=require(_0xd2ba('0x4'));var rimraf=require(_0xd2ba('0x5'));var config=require(_0xd2ba('0x6'));var attributes=require(_0xd2ba('0x7'));module['exports']=function(_0x57d627,_0x265343){return _0x57d627[_0xd2ba('0x8')](_0xd2ba('0x9'),attributes,{'tableName':_0xd2ba('0xa'),'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 c916fe2..09ab3d5 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 _0xbd9e=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','info','request\x20sent','debug','stringify','error','VoicePrefix,\x20%s,\x20%s','message','result','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbd9e,0x108));var _0xebd9=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xbd9e[_0x456fb1];return _0x4083d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebd9('0x0'));var BPromise=require('bluebird');var rs=require(_0xebd9('0x1'));var fs=require('fs');var Redis=require(_0xebd9('0x2'));var db=require(_0xebd9('0x3'))['db'];var utils=require(_0xebd9('0x4'));var logger=require(_0xebd9('0x5'))('rpc');var config=require(_0xebd9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xebd9('0x7')][_0xebd9('0x8')]({'port':0x232a});config[_0xebd9('0x9')]=_[_0xebd9('0xa')](config[_0xebd9('0x9')],{'host':_0xebd9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebd9('0x9')]));require(_0xebd9('0xc'))[_0xebd9('0xd')](socket);function respondWithRpcPromise(_0x406705,_0x16537e,_0x4b1985){return new BPromise(function(_0x35fcfd,_0x5eda85){return client[_0xebd9('0xe')](_0x406705,_0x4b1985)['then'](function(_0x40c787){logger[_0xebd9('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x16537e,_0xebd9('0x10'));logger[_0xebd9('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x16537e,_0xebd9('0x10'),JSON[_0xebd9('0x12')](_0x40c787));if(_0x40c787[_0xebd9('0x13')]){if(_0x40c787[_0xebd9('0x13')]['code']===0x1f4){logger[_0xebd9('0x13')](_0xebd9('0x14'),_0x16537e,_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);return _0x5eda85(_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);}logger[_0xebd9('0x13')](_0xebd9('0x14'),_0x16537e,_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);return _0x35fcfd(_0x40c787[_0xebd9('0x13')][_0xebd9('0x15')]);}else{logger[_0xebd9('0xf')](_0xebd9('0x14'),_0x16537e,'request\x20sent');_0x35fcfd(_0x40c787[_0xebd9('0x16')][_0xebd9('0x15')]);}})[_0xebd9('0x17')](function(_0x4d793e){logger[_0xebd9('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x16537e,_0x4d793e);_0x5eda85(_0x4d793e);});});} \ No newline at end of file +var _0xc274=['register','request','then','request\x20sent','debug','stringify','error','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./voicePrefix.socket'];(function(_0x1476a4,_0x382d8f){var _0x47ff87=function(_0x4d2e79){while(--_0x4d2e79){_0x1476a4['push'](_0x1476a4['shift']());}};_0x47ff87(++_0x382d8f);}(_0xc274,0x151));var _0x4c27=function(_0x4f6a55,_0xe26a41){_0x4f6a55=_0x4f6a55-0x0;var _0x42ce5a=_0xc274[_0x4f6a55];return _0x42ce5a;};'use strict';var _=require('lodash');var util=require(_0x4c27('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c27('0x1'));var fs=require('fs');var Redis=require(_0x4c27('0x2'));var db=require(_0x4c27('0x3'))['db'];var utils=require(_0x4c27('0x4'));var logger=require(_0x4c27('0x5'))(_0x4c27('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c27('0x7'));var client=jayson['client'][_0x4c27('0x8')]({'port':0x232a});config[_0x4c27('0x9')]=_[_0x4c27('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c27('0xb'))(new Redis(config['redis']));require(_0x4c27('0xc'))[_0x4c27('0xd')](socket);function respondWithRpcPromise(_0x2d0a27,_0x846d26,_0x2604cf){return new BPromise(function(_0x5c666e,_0x29b5ff){return client[_0x4c27('0xe')](_0x2d0a27,_0x2604cf)[_0x4c27('0xf')](function(_0x163df3){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x846d26,_0x4c27('0x10'));logger[_0x4c27('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x846d26,'request\x20sent',JSON[_0x4c27('0x12')](_0x163df3));if(_0x163df3[_0x4c27('0x13')]){if(_0x163df3[_0x4c27('0x13')]['code']===0x1f4){logger[_0x4c27('0x13')](_0x4c27('0x14'),_0x846d26,_0x163df3[_0x4c27('0x13')]['message']);return _0x29b5ff(_0x163df3[_0x4c27('0x13')]['message']);}logger['error'](_0x4c27('0x14'),_0x846d26,_0x163df3[_0x4c27('0x13')][_0x4c27('0x15')]);return _0x5c666e(_0x163df3[_0x4c27('0x13')]['message']);}else{logger[_0x4c27('0x16')](_0x4c27('0x14'),_0x846d26,'request\x20sent');_0x5c666e(_0x163df3[_0x4c27('0x17')][_0x4c27('0x15')]);}})[_0x4c27('0x18')](function(_0x42a9d6){logger['error'](_0x4c27('0x14'),_0x846d26,_0x42a9d6);_0x29b5ff(_0x42a9d6);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2df7304..2de32bd 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 _0x25a3=['voicePrefix:','./voicePrefix.events','save','remove','emit','removeListener','register','length'];(function(_0x1b4f37,_0x2306e6){var _0x450308=function(_0x396850){while(--_0x396850){_0x1b4f37['push'](_0x1b4f37['shift']());}};_0x450308(++_0x2306e6);}(_0x25a3,0x121));var _0x325a=function(_0x5c3766,_0x3a60a5){_0x5c3766=_0x5c3766-0x0;var _0x17edd2=_0x25a3[_0x5c3766];return _0x17edd2;};'use strict';var VoicePrefixEvents=require(_0x325a('0x0'));var events=[_0x325a('0x1'),_0x325a('0x2'),'update'];function createListener(_0x81800a,_0x50e9ba){return function(_0x46df7b){_0x50e9ba[_0x325a('0x3')](_0x81800a,_0x46df7b);};}function removeListener(_0x1f6e3d,_0x5d829e){return function(){VoicePrefixEvents[_0x325a('0x4')](_0x1f6e3d,_0x5d829e);};}exports[_0x325a('0x5')]=function(_0x272122){for(var _0x56e8fb=0x0,_0x533867=events[_0x325a('0x6')];_0x56e8fb<_0x533867;_0x56e8fb++){var _0x209f5e=events[_0x56e8fb];var _0x43bd79=createListener(_0x325a('0x7')+_0x209f5e,_0x272122);VoicePrefixEvents['on'](_0x209f5e,_0x43bd79);}}; \ No newline at end of file +var _0x9567=['emit','removeListener','length','./voicePrefix.events','save','remove','update'];(function(_0x449d9d,_0x12a32e){var _0xfae9fb=function(_0x5d1125){while(--_0x5d1125){_0x449d9d['push'](_0x449d9d['shift']());}};_0xfae9fb(++_0x12a32e);}(_0x9567,0xdc));var _0x7956=function(_0x54560e,_0x5e0f43){_0x54560e=_0x54560e-0x0;var _0x14ceea=_0x9567[_0x54560e];return _0x14ceea;};'use strict';var VoicePrefixEvents=require(_0x7956('0x0'));var events=[_0x7956('0x1'),_0x7956('0x2'),_0x7956('0x3')];function createListener(_0x4459ae,_0x50169f){return function(_0x4da79a){_0x50169f[_0x7956('0x4')](_0x4459ae,_0x4da79a);};}function removeListener(_0x27b00b,_0x5cd0f8){return function(){VoicePrefixEvents[_0x7956('0x5')](_0x27b00b,_0x5cd0f8);};}exports['register']=function(_0x12c09e){for(var _0x48c4b6=0x0,_0x1819b6=events[_0x7956('0x6')];_0x48c4b6<_0x1819b6;_0x48c4b6++){var _0x48b2b3=events[_0x48c4b6];var _0x3c213a=createListener('voicePrefix:'+_0x48b2b3,_0x12c09e);VoicePrefixEvents['on'](_0x48b2b3,_0x3c213a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index f9f1120..8919c7a 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 _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(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xb10b,0x12a));var _0xbb10=function(_0x3640e2,_0x562103){_0x3640e2=_0x3640e2-0x0;var _0x277415=_0xb10b[_0x3640e2];return _0x277415;};'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 +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(_0x16daee,_0x54a221){var _0x577a36=function(_0x5ede24){while(--_0x5ede24){_0x16daee['push'](_0x16daee['shift']());}};_0x577a36(++_0x54a221);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 96fbfcd..a5934e8 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 _0x2143=['agentBusyFactor','dropRate','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','STRING','outbound','default','ENUM','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','strategy','type','getDataValue','dialMethod','inbound','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'];(function(_0x460dae,_0x3a907f){var _0x36e6d0=function(_0x447057){while(--_0x447057){_0x460dae['push'](_0x460dae['shift']());}};_0x36e6d0(++_0x3a907f);}(_0x2143,0x73));var _0x3214=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0x2143[_0x8b631b];return _0x3e6832;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3214('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x3214('0x1')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x3214('0x2')},'announce':{'type':Sequelize[_0x3214('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3214('0x3')]('rr',_0x3214('0x4'),_0x3214('0x5'),_0x3214('0x6'),_0x3214('0x7'),_0x3214('0x8'),_0x3214('0x9'),'wrandom',_0x3214('0xa')),'allowNull':![],'defaultValue':_0x3214('0x4'),'set':function(_0x1168d6){this[_0x3214('0xb')](_0x3214('0xc'),_0x1168d6?_0x1168d6:'rrmemory');},'get':function(){var _0x51ea02=this['getDataValue'](_0x3214('0xd'));var _0x4d9068=this[_0x3214('0xe')](_0x3214('0xf'));var _0x51632b=this[_0x3214('0xe')](_0x3214('0xc'));if(_0x51ea02===_0x3214('0x10')){return _0x51632b;}if(_0x4d9068===_0x3214('0x11')&&_0x51632b==='rrmemory'||_0x4d9068===_0x3214('0x11')&&_0x51632b===_0x3214('0x12')){return _0x51632b;}if(_0x4d9068===_0x3214('0x13')||_0x4d9068===_0x3214('0x14')||_0x4d9068===_0x3214('0x15')){return _0x51632b;}return null;}},'servicelevel':{'type':Sequelize[_0x3214('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3214('0x16')](0xb)},'timeout':{'type':Sequelize[_0x3214('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3214('0x0')]},'weight':{'type':Sequelize[_0x3214('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3214('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x17'),'no'),'defaultValue':_0x3214('0x17')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x3214('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3214('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x3214('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3214('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3214('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3214('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x3214('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3214('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3214('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3214('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3214('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x17'),'no'),'defaultValue':_0x3214('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x3214('0x17'),'no',_0x3214('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3214('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3214('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x3214('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3214('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3214('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3214('0x0')]},'queue_youarenext':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x3214('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3214('0x0')]},'queue_quantity1':{'type':Sequelize[_0x3214('0x0')]},'queue_quantity2':{'type':Sequelize[_0x3214('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x3214('0x0')]},'queue_less_than':{'type':Sequelize[_0x3214('0x0')]},'periodic_announce':{'type':Sequelize[_0x3214('0x1a')],'set':function(_0x2792f6){this[_0x3214('0xb')](_0x3214('0x1b'),_0x2792f6?_0x2792f6[_0x3214('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0x3214('0x1b'))?this[_0x3214('0xe')](_0x3214('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x3214('0x0')],'defaultValue':_0x3214('0x17'),'set':function(_0x4b3388){this['setDataValue'](_0x3214('0x1d'),_0x4b3388?_0x4b3388['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x3214('0x1d'))?this['getDataValue'](_0x3214('0x1d'))[_0x3214('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3214('0x0')],'defaultValue':'no','set':function(_0x185b47){this[_0x3214('0xb')]('leavewhenempty',_0x185b47?_0x185b47[_0x3214('0x1c')](','):undefined);},'get':function(){return this[_0x3214('0xe')](_0x3214('0x1f'))?this['getDataValue']('leavewhenempty')[_0x3214('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3214('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3214('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3214('0x0')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x3214('0x20')],'defaultValue':0x0,'set':function(_0x42307d){this[_0x3214('0xb')]('acw',_0x42307d);if(_0x42307d){if(this[_0x3214('0xe')](_0x3214('0x21'))<0x2){this[_0x3214('0xb')](_0x3214('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3214('0x20')],'defaultValue':0x0,'comment':_0x3214('0x22')},'dialMethod':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x23'),_0x3214('0x13'),_0x3214('0x15'),_0x3214('0x14'),_0x3214('0x11')),'defaultValue':'progressive','comment':_0x3214('0x24')},'dialLimitChannel':{'type':Sequelize[_0x3214('0x16')](0x4)[_0x3214('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x3214('0x16')](0x4)[_0x3214('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3214('0x26')},'dialPowerLevel':{'type':Sequelize[_0x3214('0x27')](0x2)[_0x3214('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3214('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x3214('0x29'),_0x3214('0x2a')),'defaultValue':_0x3214('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x3214('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3214('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x3214('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x3214('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x3214('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3214('0x0')],'comment':_0x3214('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3214('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3214('0x16')](0x5)[_0x3214('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'defaultValue':0x3,'comment':_0x3214('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3214('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3214('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3214('0x34')},'dialTimezone':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3214('0x0')],'defaultValue':_0x3214('0x35')},'dialPrefix':{'type':Sequelize[_0x3214('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3214('0x3')](_0x3214('0x36'),_0x3214('0x37'),_0x3214('0x38')),'defaultValue':_0x3214('0x36')},'dialAMDActive':{'type':Sequelize[_0x3214('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3214('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3214('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x3214('0x16')](0x9)[_0x3214('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3214('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3214('0x16')](0x9)[_0x3214('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3214('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3214('0x16')](0x9)[_0x3214('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3214('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3214('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3214('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3214('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3214('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3214('0x16')](0x9)[_0x3214('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3214('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3214('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3214('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x3214('0x16')](0x5)[_0x3214('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x3214('0x20')],'defaultValue':0x0,'comment':_0x3214('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3214('0x3')]('DESC',_0x3214('0x42')),'defaultValue':_0x3214('0x43')},'dialQueueProject2':{'type':Sequelize[_0x3214('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3214('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3214('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3214('0x44')},'dialCutDigit':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3214('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3214('0x16')](0x5)[_0x3214('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x3214('0x16')](0x5)[_0x3214('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3214('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3214('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3214('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x3214('0x16')](0x5)[_0x3214('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3214('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3214('0x16')](0x5)[_0x3214('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3214('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3214('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3214('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x461e09){if(!_0x461e09)this['setDataValue'](_0x3214('0x4d'),null);this[_0x3214('0xb')]('mandatoryDisposition',_0x461e09);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3214('0x16')](0x3)[_0x3214('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3214('0x20')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0bd2=['https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','ENUM','inbound','outbound','STRING','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','BOOLEAN','Active/Disactive\x20Campaign','Dial\x20Method.','UNSIGNED','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.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX'];(function(_0x5e838c,_0x2a7d9c){var _0x18852f=function(_0x2ee014){while(--_0x2ee014){_0x5e838c['push'](_0x5e838c['shift']());}};_0x18852f(++_0x2a7d9c);}(_0x0bd2,0x6b));var _0x20bd=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x0bd2[_0x30b0d8];return _0x459c09;};'use strict';var Sequelize=require('sequelize');module[_0x20bd('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x20bd('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x3'),_0x20bd('0x4')),'allowNull':![],'defaultValue':_0x20bd('0x3')},'musiconhold':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':_0x20bd('0x6')},'announce':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x20bd('0x2')]('rr','ringall',_0x20bd('0x7'),_0x20bd('0x8'),_0x20bd('0x9'),_0x20bd('0xa'),_0x20bd('0xb'),_0x20bd('0xc'),_0x20bd('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x58edd8){this[_0x20bd('0xe')]('strategy',_0x58edd8?_0x58edd8:_0x20bd('0xa'));},'get':function(){var _0x51e24b=this[_0x20bd('0xf')]('type');var _0x57e645=this[_0x20bd('0xf')]('dialMethod');var _0x5c51aa=this['getDataValue']('strategy');if(_0x51e24b===_0x20bd('0x3')){return _0x5c51aa;}if(_0x57e645===_0x20bd('0x10')&&_0x5c51aa===_0x20bd('0xa')||_0x57e645===_0x20bd('0x10')&&_0x5c51aa===_0x20bd('0x11')){return _0x5c51aa;}if(_0x57e645===_0x20bd('0x12')||_0x57e645===_0x20bd('0x13')||_0x57e645===_0x20bd('0x14')){return _0x5c51aa;}return null;}},'servicelevel':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x20bd('0x15')](0xb)},'timeout':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x20bd('0x16'),'no',_0x20bd('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x20bd('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x20bd('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x20bd('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x20bd('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x16'),'no'),'defaultValue':_0x20bd('0x16')},'announce_holdtime':{'type':Sequelize[_0x20bd('0x2')]('yes','no',_0x20bd('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x20bd('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x20bd('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x20bd('0x5')]},'queue_youarenext':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x20bd('0x5')]},'queue_quantity2':{'type':Sequelize[_0x20bd('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x20bd('0x5')]},'queue_less_than':{'type':Sequelize[_0x20bd('0x5')]},'periodic_announce':{'type':Sequelize[_0x20bd('0x19')],'set':function(_0xdb5e42){this[_0x20bd('0xe')](_0x20bd('0x1a'),_0xdb5e42?_0xdb5e42[_0x20bd('0x1b')](','):[]);},'get':function(){return this[_0x20bd('0xf')]('periodic_announce')?this['getDataValue'](_0x20bd('0x1a'))[_0x20bd('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':_0x20bd('0x16'),'set':function(_0x588a41){this[_0x20bd('0xe')]('joinempty',_0x588a41?_0x588a41[_0x20bd('0x1b')](','):undefined);},'get':function(){return this[_0x20bd('0xf')](_0x20bd('0x1d'))?this[_0x20bd('0xf')](_0x20bd('0x1d'))[_0x20bd('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':'no','set':function(_0x33e1d5){this[_0x20bd('0xe')](_0x20bd('0x1e'),_0x33e1d5?_0x33e1d5['join'](','):undefined);},'get':function(){return this[_0x20bd('0xf')]('leavewhenempty')?this[_0x20bd('0xf')](_0x20bd('0x1e'))[_0x20bd('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x20bd('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x20bd('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x20bd('0x5')]},'description':{'type':Sequelize[_0x20bd('0x5')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x5e9e3e){this[_0x20bd('0xe')](_0x20bd('0x1f'),_0x5e9e3e);if(_0x5e9e3e){if(this[_0x20bd('0xf')]('wrapuptime')<0x2){this[_0x20bd('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x20bd('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x20bd('0x20')],'defaultValue':0x0,'comment':_0x20bd('0x21')},'dialMethod':{'type':Sequelize[_0x20bd('0x2')]('preview',_0x20bd('0x12'),_0x20bd('0x14'),_0x20bd('0x13'),'booked'),'defaultValue':_0x20bd('0x12'),'comment':_0x20bd('0x22')},'dialLimitChannel':{'type':Sequelize[_0x20bd('0x15')](0x4)[_0x20bd('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x20bd('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x20bd('0x24')},'dialPowerLevel':{'type':Sequelize[_0x20bd('0x25')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x20bd('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x20bd('0x2')](_0x20bd('0x27'),'dropRate'),'defaultValue':_0x20bd('0x28'),'comment':_0x20bd('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x20bd('0x25')](0x2)[_0x20bd('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x20bd('0x15')](0x3)[_0x20bd('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x20bd('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x20bd('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x20bd('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x20bd('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x20bd('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x20bd('0x2c'),'comment':_0x20bd('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x20bd('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x20bd('0x5')],'comment':_0x20bd('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x20bd('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x20bd('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x20bd('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)[_0x20bd('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x20bd('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x20bd('0x15')](0x5)[_0x20bd('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x20bd('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)[_0x20bd('0x23')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x20bd('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x20bd('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)[_0x20bd('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x20bd('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x20bd('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x20bd('0x2')]('always',_0x20bd('0x35'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x20bd('0x20')],'defaultValue':0x0,'comment':_0x20bd('0x36')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x20bd('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x20bd('0x15')](0x9)[_0x20bd('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x20bd('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x20bd('0x15')](0x9)[_0x20bd('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x20bd('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x20bd('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x20bd('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x20bd('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x20bd('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x20bd('0x15')](0x9)[_0x20bd('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x20bd('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x20bd('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x20bd('0x15')](0x5)[_0x20bd('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x20bd('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x20bd('0x15')](0x9)[_0x20bd('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x20bd('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x20bd('0x3e')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x20bd('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x20bd('0x2')]('DESC','ASC'),'defaultValue':_0x20bd('0x40')},'dialQueueProject2':{'type':Sequelize[_0x20bd('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x20bd('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x20bd('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x20bd('0x41')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x20bd('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x20bd('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)[_0x20bd('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x20bd('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)[_0x20bd('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x20bd('0x43')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x20bd('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x20bd('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x20bd('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x20bd('0x15')](0x5)[_0x20bd('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x20bd('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x20bd('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x20bd('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x20bd('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x20bd('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x20bd('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x20bd('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x562a66){if(!_0x562a66)this[_0x20bd('0xe')](_0x20bd('0x4a'),null);this[_0x20bd('0xe')](_0x20bd('0x4b'),_0x562a66);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x20bd('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x20bd('0x15')](0x3)[_0x20bd('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 9d4c92e..ba6927f 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 _0x549e=['filter','options','include','findAll','rows','catch','params','length','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','role','getHoppers','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','interface','flatMap','penalty','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','online','push','isNil','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','CmListId','fromQuery','removeLists','getBlackLists','CmList','cm_hopper_black','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','QueueCampaigns','outbound','ignore','map','value','type','find','name','UserProfileResource','end','stack','index','VoiceQueue','rawAttributes','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge'];(function(_0x30ceb1,_0x213b7d){var _0x903a67=function(_0x5ede2a){while(--_0x5ede2a){_0x30ceb1['push'](_0x30ceb1['shift']());}};_0x903a67(++_0x213b7d);}(_0x549e,0x1e0));var _0xe549=function(_0xb42fbf,_0x33f28e){_0xb42fbf=_0xb42fbf-0x0;var _0x4e575f=_0x549e[_0xb42fbf];return _0x4e575f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe549('0x0'));var zipdir=require(_0xe549('0x1'));var jsonpatch=require(_0xe549('0x2'));var rp=require(_0xe549('0x3'));var moment=require(_0xe549('0x4'));var BPromise=require(_0xe549('0x5'));var Mustache=require(_0xe549('0x6'));var util=require('util');var path=require(_0xe549('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe549('0x8'));var fs=require('fs');var fs_extra=require(_0xe549('0x9'));var _=require(_0xe549('0xa'));var squel=require(_0xe549('0xb'));var crypto=require(_0xe549('0xc'));var jsforce=require(_0xe549('0xd'));var deskjs=require(_0xe549('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe549('0xf'));var Papa=require(_0xe549('0x10'));var Redis=require(_0xe549('0x11'));var authService=require(_0xe549('0x12'));var qs=require(_0xe549('0x13'));var as=require(_0xe549('0x14'));var hardwareService=require(_0xe549('0x15'));var logger=require(_0xe549('0x16'))(_0xe549('0x17'));var utils=require(_0xe549('0x18'));var config=require(_0xe549('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe549('0x1a'))['db'];config[_0xe549('0x1b')]=_[_0xe549('0x1c')](config[_0xe549('0x1b')],{'host':_0xe549('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe549('0x1b')]));require(_0xe549('0x1e'))[_0xe549('0x1f')](socket);function respondWithStatusCode(_0x1cad49,_0x4a8fcb){_0x4a8fcb=_0x4a8fcb||0xcc;return function(_0x25600d){if(_0x25600d){return _0x1cad49[_0xe549('0x20')](_0x4a8fcb);}return _0x1cad49[_0xe549('0x21')](_0x4a8fcb)['end']();};}function respondWithResult(_0x58d43a,_0xbc6e10){_0xbc6e10=_0xbc6e10||0xc8;return function(_0x45762d){if(_0x45762d){return _0x58d43a[_0xe549('0x21')](_0xbc6e10)[_0xe549('0x22')](_0x45762d);}};}function respondWithFilteredResult(_0x2490fa,_0x47afa3){return function(_0x3e307f){if(_0x3e307f){var _0x1fcb4c=typeof _0x47afa3[_0xe549('0x23')]===_0xe549('0x24')&&typeof _0x47afa3[_0xe549('0x25')]==='undefined';var _0x2c6eb6=_0x3e307f[_0xe549('0x26')];var _0x388282=_0x1fcb4c?0x0:_0x47afa3[_0xe549('0x23')];var _0xfeabb0=_0x1fcb4c?_0x3e307f[_0xe549('0x26')]:_0x47afa3[_0xe549('0x23')]+_0x47afa3[_0xe549('0x25')];var _0x5127de;if(_0xfeabb0>=_0x2c6eb6){_0xfeabb0=_0x2c6eb6;_0x5127de=0xc8;}else{_0x5127de=0xce;}_0x2490fa[_0xe549('0x21')](_0x5127de);return _0x2490fa[_0xe549('0x27')](_0xe549('0x28'),_0x388282+'-'+_0xfeabb0+'/'+_0x2c6eb6)[_0xe549('0x22')](_0x3e307f);}return null;};}function patchUpdates(_0x389394){return function(_0x330647){try{jsonpatch['apply'](_0x330647,_0x389394,!![]);}catch(_0x2bf94a){return BPromise[_0xe549('0x29')](_0x2bf94a);}return _0x330647['save']();};}function saveUpdates(_0x12491b,_0x1b85cd){return function(_0x599252){if(_0x599252){return _0x599252[_0xe549('0x2a')](_0x12491b)[_0xe549('0x2b')](function(_0x296991){return _0x296991;});}return null;};}function removeEntity(_0x4c3934,_0xd5580){return function(_0x3b6800){if(_0x3b6800){return _0x3b6800[_0xe549('0x2c')]()[_0xe549('0x2b')](function(){var _0x241f98=_0x3b6800[_0xe549('0x2d')]({'plain':!![]});var _0x527a2e=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0xe549('0x2e'),'value':_0xe549('0x2f'),'ignore':![]}];var _0x35c653=_(_0x527a2e)['filter'](_0xe549('0x30'))[_0xe549('0x31')](_0xe549('0x32'))['value']();if(_['includes'](_0x35c653,_0x241f98[_0xe549('0x33')])){return;}var _0x51c2a5=_[_0xe549('0x34')](_0x527a2e,[_0xe549('0x32'),_0x241f98[_0xe549('0x33')]])[_0xe549('0x35')];return db[_0xe549('0x36')][_0xe549('0x2c')]({'where':{'type':_0x51c2a5,'resourceId':_0x241f98['id']}})[_0xe549('0x2b')](function(){return _0x3b6800;});})[_0xe549('0x2b')](function(){_0x4c3934[_0xe549('0x21')](0xcc)[_0xe549('0x37')]();});}};}function handleEntityNotFound(_0x31cb81,_0x15ec4a){return function(_0x3f6248){if(!_0x3f6248){_0x31cb81[_0xe549('0x20')](0x194);}return _0x3f6248;};}function handleError(_0x36e686,_0x3082fa){_0x3082fa=_0x3082fa||0x1f4;return function(_0x17e6d6){logger['error'](_0x17e6d6[_0xe549('0x38')]);if(_0x17e6d6['name']){delete _0x17e6d6['name'];}_0x36e686['status'](_0x3082fa)['send'](_0x17e6d6);};}exports[_0xe549('0x39')]=function(_0xc4b917,_0x492460){var _0x324d5c={},_0xbf57d={},_0x5251f5={'count':0x0,'rows':[]};var _0x39a6bb=_[_0xe549('0x31')](db[_0xe549('0x3a')][_0xe549('0x3b')],function(_0x2ff9b0){return{'name':_0x2ff9b0['fieldName'],'type':_0x2ff9b0[_0xe549('0x33')][_0xe549('0x3c')]};});_0xbf57d['model']=_[_0xe549('0x31')](_0x39a6bb,_0xe549('0x35'));_0xbf57d[_0xe549('0x3d')]=_[_0xe549('0x3e')](_0xc4b917[_0xe549('0x3d')]);_0xbf57d['filters']=_[_0xe549('0x3f')](_0xbf57d['model'],_0xbf57d[_0xe549('0x3d')]);_0x324d5c['attributes']=_[_0xe549('0x3f')](_0xbf57d[_0xe549('0x40')],qs[_0xe549('0x41')](_0xc4b917['query']['fields']));_0x324d5c[_0xe549('0x42')]=_0x324d5c[_0xe549('0x42')]['length']?_0x324d5c[_0xe549('0x42')]:_0xbf57d['model'];if(!_0xc4b917[_0xe549('0x3d')][_0xe549('0x43')](_0xe549('0x44'))){_0x324d5c[_0xe549('0x25')]=qs[_0xe549('0x25')](_0xc4b917[_0xe549('0x3d')][_0xe549('0x25')]);_0x324d5c[_0xe549('0x23')]=qs[_0xe549('0x23')](_0xc4b917[_0xe549('0x3d')][_0xe549('0x23')]);}_0x324d5c[_0xe549('0x45')]=qs[_0xe549('0x46')](_0xc4b917[_0xe549('0x3d')]['sort']);_0x324d5c['where']=qs[_0xe549('0x47')](_[_0xe549('0x48')](_0xc4b917[_0xe549('0x3d')],_0xbf57d[_0xe549('0x47')]),_0x39a6bb);if(_0xc4b917[_0xe549('0x3d')]['filter']){_0x324d5c[_0xe549('0x49')]=_[_0xe549('0x4a')](_0x324d5c[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x39a6bb,function(_0x56240d){if(_0x56240d[_0xe549('0x33')]!=='VIRTUAL'){var _0x292828={};_0x292828[_0x56240d[_0xe549('0x35')]]={'$like':'%'+_0xc4b917['query'][_0xe549('0x4b')]+'%'};return _0x292828;}})});}_0x324d5c=_[_0xe549('0x4a')]({},_0x324d5c,_0xc4b917[_0xe549('0x4c')]);var _0x188fb3={'where':_0x324d5c[_0xe549('0x49')]};return db[_0xe549('0x3a')][_0xe549('0x26')](_0x188fb3)[_0xe549('0x2b')](function(_0x24a12c){_0x5251f5['count']=_0x24a12c;if(_0xc4b917[_0xe549('0x3d')]['includeAll']){_0x324d5c[_0xe549('0x4d')]=[{'all':!![]}];}return db[_0xe549('0x3a')][_0xe549('0x4e')](_0x324d5c);})['then'](function(_0x281d32){_0x5251f5[_0xe549('0x4f')]=_0x281d32;return _0x5251f5;})[_0xe549('0x2b')](respondWithFilteredResult(_0x492460,_0x324d5c))[_0xe549('0x50')](handleError(_0x492460,null));};exports['show']=function(_0x489fa4,_0x291148){var _0x130527={'raw':![],'where':{'id':_0x489fa4[_0xe549('0x51')]['id']}},_0x35992a={};_0x35992a[_0xe549('0x40')]=_['keys'](db[_0xe549('0x3a')][_0xe549('0x3b')]);_0x35992a[_0xe549('0x3d')]=_[_0xe549('0x3e')](_0x489fa4[_0xe549('0x3d')]);_0x35992a['filters']=_[_0xe549('0x3f')](_0x35992a[_0xe549('0x40')],_0x35992a[_0xe549('0x3d')]);_0x130527[_0xe549('0x42')]=_[_0xe549('0x3f')](_0x35992a['model'],qs[_0xe549('0x41')](_0x489fa4[_0xe549('0x3d')][_0xe549('0x41')]));_0x130527[_0xe549('0x42')]=_0x130527[_0xe549('0x42')][_0xe549('0x52')]?_0x130527[_0xe549('0x42')]:_0x35992a['model'];if(_0x489fa4[_0xe549('0x3d')][_0xe549('0x53')]){_0x130527['include']=[{'all':!![]}];}_0x130527=_[_0xe549('0x4a')]({},_0x130527,_0x489fa4[_0xe549('0x4c')]);return db[_0xe549('0x3a')][_0xe549('0x34')](_0x130527)[_0xe549('0x2b')](handleEntityNotFound(_0x291148,null))[_0xe549('0x2b')](respondWithResult(_0x291148,null))[_0xe549('0x50')](handleError(_0x291148,null));};exports[_0xe549('0x54')]=function(_0xc8f006,_0x1cdcfb){return db[_0xe549('0x3a')][_0xe549('0x54')](_0xc8f006['body'],{})['then'](function(_0x49a7b0){var _0x1c3217=_0xc8f006[_0xe549('0x55')][_0xe549('0x2d')]({'plain':!![]});if(!_0x1c3217)throw new Error(_0xe549('0x56'));if(_0x1c3217['role']==='user'){var _0x147e3a=_0x49a7b0[_0xe549('0x2d')]({'plain':!![]});var _0x1e5fd5=[{'name':_0xe549('0x57'),'value':'inbound'},{'name':_0xe549('0x2e'),'value':'outbound'}];var _0x343997=_[_0xe549('0x34')](_0x1e5fd5,[_0xe549('0x32'),_0x147e3a['type']])[_0xe549('0x35')];return db[_0xe549('0x58')][_0xe549('0x34')]({'where':{'name':_0x343997,'userProfileId':_0x1c3217[_0xe549('0x59')]},'raw':!![]})['then'](function(_0x29b36d){if(_0x29b36d&&_0x29b36d[_0xe549('0x5a')]===0x0){return db[_0xe549('0x36')][_0xe549('0x54')]({'name':_0x147e3a[_0xe549('0x35')],'resourceId':_0x147e3a['id'],'type':_0x29b36d['name'],'sectionId':_0x29b36d['id']},{})['then'](function(){return _0x49a7b0;});}else{return _0x49a7b0;}})[_0xe549('0x50')](function(_0x528244){logger[_0xe549('0x5b')](_0xe549('0x5c'),_0x528244);throw _0x528244;});}return _0x49a7b0;})[_0xe549('0x2b')](respondWithResult(_0x1cdcfb,0xc9))[_0xe549('0x50')](handleError(_0x1cdcfb,null));};exports['clone']=function(_0x3e066b,_0x3b0fd1){var _0x171ed2={'where':{'id':_0x3e066b[_0xe549('0x51')]['id']}},_0xa2e190={};_0xa2e190[_0xe549('0x40')]=_['keys'](db[_0xe549('0x3a')][_0xe549('0x3b')]);_0x171ed2[_0xe549('0x42')]=_[_0xe549('0x3f')](_0xa2e190[_0xe549('0x40')],qs[_0xe549('0x41')](_0x3e066b[_0xe549('0x3d')]['fields']));_0x171ed2[_0xe549('0x42')]=_0x171ed2[_0xe549('0x42')][_0xe549('0x52')]?_0x171ed2[_0xe549('0x42')]:_0xa2e190['model'];if(_0x3e066b['query'][_0xe549('0x53')]){_0x171ed2['include']=[{'all':!![]}];}_0x171ed2=_[_0xe549('0x4a')]({},_0x171ed2,_0x3e066b['options']);return db[_0xe549('0x3a')][_0xe549('0x34')](_0x171ed2)[_0xe549('0x2b')](handleEntityNotFound(_0x3b0fd1,null))['then'](function(_0x52efc8){if(_0x52efc8){var _0xa4a101=_0x52efc8['get']({'plain':!![]});_0xa4a101=qs[_0xe549('0x5d')](_0xa4a101,['id',_0xe549('0x5e'),_0xe549('0x5f')]);_0x3e066b[_0xe549('0x60')]=_[_0xe549('0x5d')](_0x3e066b['body'],['id',_0xe549('0x5e'),_0xe549('0x5f')]);return db[_0xe549('0x3a')]['create'](_['merge'](_0xa4a101,_0x3e066b['body']),{'include':_0x3e066b[_0xe549('0x3d')][_0xe549('0x53')]?[{'all':!![]}]:undefined})[_0xe549('0x2b')](function(_0x4aaf4e){var _0x2d8dfb=_0x3e066b[_0xe549('0x55')][_0xe549('0x2d')]({'plain':!![]});if(!_0x2d8dfb)throw new Error(_0xe549('0x56'));if(_0x2d8dfb[_0xe549('0x61')]===_0xe549('0x55')){var _0x778aa5=_0x4aaf4e['get']({'plain':!![]});var _0x1ab9ca=[{'name':_0xe549('0x57'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xe549('0x2f')}];var _0x2bd04a=_['find'](_0x1ab9ca,[_0xe549('0x32'),_0x778aa5['type']])['name'];return db[_0xe549('0x58')]['find']({'where':{'name':_0x2bd04a,'userProfileId':_0x2d8dfb[_0xe549('0x59')]},'raw':!![]})[_0xe549('0x2b')](function(_0x39fcba){if(_0x39fcba&&_0x39fcba[_0xe549('0x5a')]===0x0){return db[_0xe549('0x36')][_0xe549('0x54')]({'name':_0x778aa5[_0xe549('0x35')],'resourceId':_0x778aa5['id'],'type':_0x39fcba[_0xe549('0x35')],'sectionId':_0x39fcba['id']},{})['then'](function(){return _0x4aaf4e;});}else{return _0x4aaf4e;}})['catch'](function(_0x111593){logger['error'](_0xe549('0x5c'),_0x111593);throw _0x111593;});}return _0x4aaf4e;});}})[_0xe549('0x2b')](respondWithResult(_0x3b0fd1,0xc9))[_0xe549('0x50')](handleError(_0x3b0fd1,null));};exports[_0xe549('0x2a')]=function(_0x1271b7,_0x57a0c6){if(_0x1271b7['body']['id']){delete _0x1271b7[_0xe549('0x60')]['id'];}return db[_0xe549('0x3a')][_0xe549('0x34')]({'where':{'id':_0x1271b7[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x57a0c6,null))[_0xe549('0x2b')](saveUpdates(_0x1271b7[_0xe549('0x60')],null))['then'](respondWithResult(_0x57a0c6,null))[_0xe549('0x50')](handleError(_0x57a0c6,null));};exports[_0xe549('0x2c')]=function(_0xebbb6f,_0x3ead21){return db[_0xe549('0x3a')]['find']({'where':{'id':_0xebbb6f[_0xe549('0x51')]['id']}})['then'](handleEntityNotFound(_0x3ead21,null))['then'](removeEntity(_0x3ead21,null))[_0xe549('0x50')](handleError(_0x3ead21,null));};exports[_0xe549('0x62')]=function(_0x30ab81,_0x1fb8ea,_0x1ce53c){var _0x30df9d={'raw':![],'where':{}};var _0x14ff0e={};var _0x1c7e45={'count':0x0,'rows':[]};return db[_0xe549('0x3a')]['findOne']({'where':{'id':_0x30ab81[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x1fb8ea,null))[_0xe549('0x2b')](function(_0x2bec78){if(_0x2bec78){_0x14ff0e[_0xe549('0x40')]=_[_0xe549('0x3e')](db[_0xe549('0x63')][_0xe549('0x3b')]);_0x14ff0e[_0xe549('0x3d')]=_['keys'](_0x30ab81['query']);_0x14ff0e[_0xe549('0x47')]=_[_0xe549('0x3f')](_0x14ff0e[_0xe549('0x40')],_0x14ff0e['query']);_0x30df9d[_0xe549('0x42')]=_[_0xe549('0x3f')](_0x14ff0e[_0xe549('0x40')],qs[_0xe549('0x41')](_0x30ab81[_0xe549('0x3d')]['fields']));_0x30df9d[_0xe549('0x42')]=_0x30df9d[_0xe549('0x42')]['length']?_0x30df9d['attributes']:_0x14ff0e[_0xe549('0x40')];if(!_0x30ab81['query'][_0xe549('0x43')](_0xe549('0x44'))){_0x30df9d['limit']=qs[_0xe549('0x25')](_0x30ab81[_0xe549('0x3d')]['limit']);_0x30df9d[_0xe549('0x23')]=qs[_0xe549('0x23')](_0x30ab81['query'][_0xe549('0x23')]);}_0x30df9d['order']=qs[_0xe549('0x46')](_0x30ab81['query']['sort']);_0x30df9d[_0xe549('0x49')]=qs[_0xe549('0x47')](_[_0xe549('0x48')](_0x30ab81[_0xe549('0x3d')],_0x14ff0e[_0xe549('0x47')]));_0x30df9d['where'][_0xe549('0x64')]=_0x2bec78['id'];if(_0x30ab81[_0xe549('0x3d')][_0xe549('0x4b')]){_0x30df9d[_0xe549('0x49')]=_[_0xe549('0x4a')](_0x30df9d[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x30df9d['attributes'],function(_0x31ca3e){var _0x25d707={};_0x25d707[_0x31ca3e]={'$like':'%'+_0x30ab81[_0xe549('0x3d')]['filter']+'%'};return _0x25d707;})});}_0x30df9d=_[_0xe549('0x4a')]({},_0x30df9d,_0x30ab81['options']);return db[_0xe549('0x63')][_0xe549('0x26')]({'where':_0x30df9d[_0xe549('0x49')]})['then'](function(_0x4b0d24){_0x1c7e45[_0xe549('0x26')]=_0x4b0d24;if(_0x30ab81['query'][_0xe549('0x53')]){_0x30df9d['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x30df9d);})[_0xe549('0x2b')](function(_0x331c45){_0x1c7e45[_0xe549('0x4f')]=_0x331c45;return _0x1c7e45;});}})['then'](respondWithFilteredResult(_0x1fb8ea,_0x30df9d))[_0xe549('0x50')](handleError(_0x1fb8ea,null));};exports[_0xe549('0x65')]=function(_0x3579ca,_0x198bd1,_0x4b0f81){var _0x184a86={'raw':!![],'where':{}};var _0x365df1={};var _0x406a2e={'count':0x0,'rows':[]};return db[_0xe549('0x3a')]['findOne']({'where':{'id':_0x3579ca[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x198bd1,null))[_0xe549('0x2b')](function(_0x29e8ee){if(_0x29e8ee){_0x365df1['model']=_[_0xe549('0x3e')](db[_0xe549('0x66')][_0xe549('0x3b')]);_0x365df1['query']=_[_0xe549('0x3e')](_0x3579ca[_0xe549('0x3d')]);_0x365df1[_0xe549('0x47')]=_['intersection'](_0x365df1[_0xe549('0x40')],_0x365df1[_0xe549('0x3d')]);_0x184a86[_0xe549('0x42')]=_[_0xe549('0x3f')](_0x365df1['model'],qs['fields'](_0x3579ca[_0xe549('0x3d')][_0xe549('0x41')]));_0x184a86['attributes']=_0x184a86[_0xe549('0x42')][_0xe549('0x52')]?_0x184a86[_0xe549('0x42')]:_0x365df1[_0xe549('0x40')];if(!_0x3579ca['query'][_0xe549('0x43')]('nolimit')){_0x184a86[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x3579ca[_0xe549('0x3d')][_0xe549('0x25')]);_0x184a86[_0xe549('0x23')]=qs[_0xe549('0x23')](_0x3579ca['query'][_0xe549('0x23')]);}_0x184a86[_0xe549('0x45')]=qs[_0xe549('0x46')](_0x3579ca[_0xe549('0x3d')]['sort']);_0x184a86[_0xe549('0x49')]=qs['filters'](_['pick'](_0x3579ca[_0xe549('0x3d')],_0x365df1[_0xe549('0x47')]));_0x184a86['where']['VoiceQueueId']=_0x29e8ee['id'];if(_0x3579ca[_0xe549('0x3d')][_0xe549('0x4b')]){_0x184a86[_0xe549('0x49')]=_[_0xe549('0x4a')](_0x184a86[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x184a86[_0xe549('0x42')],function(_0x53c100){var _0x1786ff={};_0x1786ff[_0x53c100]={'$like':'%'+_0x3579ca['query'][_0xe549('0x4b')]+'%'};return _0x1786ff;})});}_0x184a86=_[_0xe549('0x4a')]({},_0x184a86,_0x3579ca[_0xe549('0x4c')]);return db[_0xe549('0x66')][_0xe549('0x26')]({'where':_0x184a86['where']})[_0xe549('0x2b')](function(_0x213a08){_0x406a2e['count']=_0x213a08;if(_0x3579ca['query'][_0xe549('0x53')]){_0x184a86[_0xe549('0x4d')]=[{'all':!![]}];}return db[_0xe549('0x66')]['findAll'](_0x184a86);})[_0xe549('0x2b')](function(_0x37e9f9){_0x406a2e[_0xe549('0x4f')]=_0x37e9f9;return _0x406a2e;});}})[_0xe549('0x2b')](respondWithFilteredResult(_0x198bd1,_0x184a86))[_0xe549('0x50')](handleError(_0x198bd1,null));};exports['getHopperFinals']=function(_0x3ecc68,_0x5e84c8,_0x47734b){var _0x21ade6={'raw':!![],'where':{}};var _0x2519cd={};var _0x3d0605={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe549('0x67')]({'where':{'id':_0x3ecc68[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x5e84c8,null))['then'](function(_0xfaf933){if(_0xfaf933){_0x2519cd['model']=_[_0xe549('0x3e')](db[_0xe549('0x68')][_0xe549('0x3b')]);_0x2519cd[_0xe549('0x3d')]=_[_0xe549('0x3e')](_0x3ecc68[_0xe549('0x3d')]);_0x2519cd['filters']=_['intersection'](_0x2519cd[_0xe549('0x40')],_0x2519cd[_0xe549('0x3d')]);_0x21ade6['attributes']=_[_0xe549('0x3f')](_0x2519cd[_0xe549('0x40')],qs[_0xe549('0x41')](_0x3ecc68['query'][_0xe549('0x41')]));_0x21ade6['attributes']=_0x21ade6[_0xe549('0x42')][_0xe549('0x52')]?_0x21ade6[_0xe549('0x42')]:_0x2519cd[_0xe549('0x40')];if(!_0x3ecc68['query'][_0xe549('0x43')](_0xe549('0x44'))){_0x21ade6[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x3ecc68[_0xe549('0x3d')]['limit']);_0x21ade6[_0xe549('0x23')]=qs['offset'](_0x3ecc68[_0xe549('0x3d')][_0xe549('0x23')]);}_0x21ade6[_0xe549('0x45')]=qs[_0xe549('0x46')](_0x3ecc68[_0xe549('0x3d')]['sort']);_0x21ade6[_0xe549('0x49')]=qs[_0xe549('0x47')](_[_0xe549('0x48')](_0x3ecc68[_0xe549('0x3d')],_0x2519cd[_0xe549('0x47')]));_0x21ade6[_0xe549('0x49')]['VoiceQueueId']=_0xfaf933['id'];if(_0x3ecc68[_0xe549('0x3d')][_0xe549('0x4b')]){_0x21ade6[_0xe549('0x49')]=_[_0xe549('0x4a')](_0x21ade6[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x21ade6[_0xe549('0x42')],function(_0x18cfc5){var _0x3d8d5b={};_0x3d8d5b[_0x18cfc5]={'$like':'%'+_0x3ecc68[_0xe549('0x3d')]['filter']+'%'};return _0x3d8d5b;})});}_0x21ade6=_['merge']({},_0x21ade6,_0x3ecc68[_0xe549('0x4c')]);return db[_0xe549('0x68')]['count']({'where':_0x21ade6['where']})[_0xe549('0x2b')](function(_0x27d18e){_0x3d0605[_0xe549('0x26')]=_0x27d18e;if(_0x3ecc68[_0xe549('0x3d')]['includeAll']){_0x21ade6[_0xe549('0x4d')]=[{'all':!![]}];}return db[_0xe549('0x68')][_0xe549('0x4e')](_0x21ade6);})['then'](function(_0x5e76c9){_0x3d0605['rows']=_0x5e76c9;return _0x3d0605;});}})[_0xe549('0x2b')](respondWithFilteredResult(_0x5e84c8,_0x21ade6))[_0xe549('0x50')](handleError(_0x5e84c8,null));};exports[_0xe549('0x69')]=function(_0x564822,_0x49769b,_0x21c004){var _0x389343={'raw':!![],'where':{}};var _0x3eb6c3={};var _0x26baf6={'count':0x0,'rows':[]};return db[_0xe549('0x3a')][_0xe549('0x67')]({'where':{'id':_0x564822['params']['id']}})['then'](handleEntityNotFound(_0x49769b,null))[_0xe549('0x2b')](function(_0xe3a273){if(_0xe3a273){_0x3eb6c3[_0xe549('0x40')]=_[_0xe549('0x3e')](db[_0xe549('0x6a')][_0xe549('0x3b')]);_0x3eb6c3[_0xe549('0x3d')]=_[_0xe549('0x3e')](_0x564822[_0xe549('0x3d')]);_0x3eb6c3['filters']=_[_0xe549('0x3f')](_0x3eb6c3[_0xe549('0x40')],_0x3eb6c3['query']);_0x389343[_0xe549('0x42')]=_[_0xe549('0x3f')](_0x3eb6c3[_0xe549('0x40')],qs[_0xe549('0x41')](_0x564822[_0xe549('0x3d')][_0xe549('0x41')]));_0x389343[_0xe549('0x42')]=_0x389343[_0xe549('0x42')][_0xe549('0x52')]?_0x389343['attributes']:_0x3eb6c3['model'];if(!_0x564822[_0xe549('0x3d')][_0xe549('0x43')](_0xe549('0x44'))){_0x389343[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x564822[_0xe549('0x3d')]['limit']);_0x389343[_0xe549('0x23')]=qs[_0xe549('0x23')](_0x564822['query']['offset']);}_0x389343['order']=qs[_0xe549('0x46')](_0x564822[_0xe549('0x3d')][_0xe549('0x46')]);_0x389343['where']=qs['filters'](_[_0xe549('0x48')](_0x564822[_0xe549('0x3d')],_0x3eb6c3[_0xe549('0x47')]));_0x389343['where'][_0xe549('0x64')]=_0xe3a273['id'];if(_0x564822[_0xe549('0x3d')][_0xe549('0x4b')]){_0x389343[_0xe549('0x49')]=_[_0xe549('0x4a')](_0x389343['where'],{'$or':_['map'](_0x389343['attributes'],function(_0xde8501){var _0x1b76bb={};_0x1b76bb[_0xde8501]={'$like':'%'+_0x564822[_0xe549('0x3d')][_0xe549('0x4b')]+'%'};return _0x1b76bb;})});}_0x389343=_[_0xe549('0x4a')]({},_0x389343,_0x564822['options']);return db[_0xe549('0x6a')][_0xe549('0x26')]({'where':_0x389343['where']})[_0xe549('0x2b')](function(_0x1728cd){_0x26baf6['count']=_0x1728cd;if(_0x564822[_0xe549('0x3d')][_0xe549('0x53')]){_0x389343[_0xe549('0x4d')]=[{'all':!![]}];}return db[_0xe549('0x6a')][_0xe549('0x4e')](_0x389343);})[_0xe549('0x2b')](function(_0x49af95){_0x26baf6[_0xe549('0x4f')]=_0x49af95;return _0x26baf6;});}})[_0xe549('0x2b')](respondWithFilteredResult(_0x49769b,_0x389343))['catch'](handleError(_0x49769b,null));};exports['getTeams']=function(_0x1296d0,_0x45b515,_0x37c46d){var _0x32917e={};var _0x14927c={};var _0x4f64bc;var _0x1a1e02;return db[_0xe549('0x3a')][_0xe549('0x67')]({'where':{'id':_0x1296d0[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x45b515,null))[_0xe549('0x2b')](function(_0x496615){if(_0x496615){_0x4f64bc=_0x496615;_0x14927c[_0xe549('0x40')]=_[_0xe549('0x3e')](db[_0xe549('0x6b')][_0xe549('0x3b')]);_0x14927c[_0xe549('0x3d')]=_[_0xe549('0x3e')](_0x1296d0[_0xe549('0x3d')]);_0x14927c[_0xe549('0x47')]=_[_0xe549('0x3f')](_0x14927c['model'],_0x14927c[_0xe549('0x3d')]);_0x32917e[_0xe549('0x42')]=_[_0xe549('0x3f')](_0x14927c[_0xe549('0x40')],qs[_0xe549('0x41')](_0x1296d0[_0xe549('0x3d')][_0xe549('0x41')]));_0x32917e['attributes']=_0x32917e['attributes'][_0xe549('0x52')]?_0x32917e[_0xe549('0x42')]:_0x14927c[_0xe549('0x40')];_0x32917e[_0xe549('0x45')]=qs['sort'](_0x1296d0[_0xe549('0x3d')]['sort']);_0x32917e[_0xe549('0x49')]=qs[_0xe549('0x47')](_[_0xe549('0x48')](_0x1296d0[_0xe549('0x3d')],_0x14927c[_0xe549('0x47')]));if(_0x1296d0[_0xe549('0x3d')][_0xe549('0x4b')]){_0x32917e['where']=_['merge'](_0x32917e['where'],{'$or':_['map'](_0x32917e[_0xe549('0x42')],function(_0xd94a15){var _0x3a2749={};_0x3a2749[_0xd94a15]={'$like':'%'+_0x1296d0[_0xe549('0x3d')]['filter']+'%'};return _0x3a2749;})});}_0x32917e=_['merge']({},_0x32917e,_0x1296d0[_0xe549('0x4c')]);return _0x4f64bc[_0xe549('0x6c')](_0x32917e);}})[_0xe549('0x2b')](function(_0x929e19){if(_0x929e19){_0x1a1e02=_0x929e19[_0xe549('0x52')];if(!_0x1296d0[_0xe549('0x3d')]['hasOwnProperty'](_0xe549('0x44'))){_0x32917e[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x1296d0[_0xe549('0x3d')][_0xe549('0x25')]);_0x32917e['offset']=qs[_0xe549('0x23')](_0x1296d0[_0xe549('0x3d')][_0xe549('0x23')]);}return _0x4f64bc[_0xe549('0x6c')](_0x32917e);}})[_0xe549('0x2b')](function(_0x5d08fd){if(_0x5d08fd){return _0x5d08fd?{'count':_0x1a1e02,'rows':_0x5d08fd}:null;}})[_0xe549('0x2b')](respondWithResult(_0x45b515,null))[_0xe549('0x50')](handleError(_0x45b515,null));};exports[_0xe549('0x6d')]=function(_0x1b753f,_0x435392,_0x466823){var _0x126bf8=_0x1b753f[_0xe549('0x60')][_0xe549('0x6e')];var _0x5a7607=_[_0xe549('0x31')](_0x126bf8,'id');return db['Team'][_0xe549('0x4e')]({'where':{'id':_0x5a7607},'attributes':['id'],'include':[{'model':db[_0xe549('0x6f')],'as':_0xe549('0x70'),'attributes':['id','name','online','voicePause',_0xe549('0x71')],'raw':!![]}]})['then'](function(_0x533520){if(_0x533520){var _0x482407=_[_0xe549('0x72')](_0x533520,function(_0x3cbe47){var _0x57f494=_0x3cbe47[_0xe549('0x2d')]({'plain':!![]});_0x57f494[_0xe549('0x70')]['forEach'](function(_0x104973){_0x104973['penalty']=_[_0xe549('0x34')](_0x126bf8,{'id':_0x57f494['id']})[_0xe549('0x73')];});return _0x57f494[_0xe549('0x70')];});return db[_0xe549('0x3a')]['find']({'where':{'id':_0x1b753f[_0xe549('0x51')]['id']}})['then'](function(_0xb0a6c5){return db['sequelize'][_0xe549('0x74')](function(_0x41ff6e){return _0xb0a6c5[_0xe549('0x6d')](_0x5a7607,{'transaction':_0x41ff6e})['then'](function(){return BPromise[_0xe549('0x75')](_0x126bf8,function(_0x40b7e7){return db[_0xe549('0x76')][_0xe549('0x77')]({'TeamId':_0x40b7e7['id'],'VoiceQueueId':_0x1b753f[_0xe549('0x51')]['id'],'penalty':_0x40b7e7[_0xe549('0x73')]},{'transaction':_0x41ff6e});});})[_0xe549('0x2b')](function(){return BPromise[_0xe549('0x75')](_0x482407,function(_0x55f46f){return db['UserVoiceQueue'][_0xe549('0x78')]({'where':{'UserId':_0x55f46f['id'],'VoiceQueueId':_0x1b753f['params']['id']},'defaults':{'penalty':_0x55f46f[_0xe549('0x73')]},'transaction':_0x41ff6e});});})[_0xe549('0x2b')](function(){return BPromise['each'](_[_0xe549('0x4b')](_0x482407,{'online':!![]}),function(_0x2674ed){return db[_0xe549('0x79')][_0xe549('0x77')]({'membername':_0x2674ed[_0xe549('0x35')],'UserId':_0x2674ed['id'],'queue_name':_0xb0a6c5['name'],'VoiceQueueId':_0xb0a6c5['id'],'interface':_['isNil'](_0x2674ed[_0xe549('0x71')])?util[_0xe549('0x7a')](_0xe549('0x7b'),_0x2674ed['name']):_0x2674ed[_0xe549('0x71')],'paused':_0x2674ed['voicePause']||![],'penalty':_0x2674ed[_0xe549('0x73')]},{'transaction':_0x41ff6e});});})[_0xe549('0x2b')](function(){_0x482407[_0xe549('0x7c')](function(_0x8ec95d){socket[_0xe549('0x7d')](_0xe549('0x7e'),{'UserId':_0x8ec95d['id'],'VoiceQueueId':_0xb0a6c5['id']});});});});});}})[_0xe549('0x2b')](respondWithStatusCode(_0x435392,null))[_0xe549('0x50')](handleError(_0x435392,null));};exports['removeTeams']=function(_0x3aed3c,_0x50a108,_0x3071d5){return db['Team']['findAll']({'where':{'id':_0x3aed3c[_0xe549('0x3d')][_0xe549('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe549('0x2b')](handleEntityNotFound(_0x50a108,null))[_0xe549('0x2b')](function(_0x341d2f){var _0x39d954=_['map'](_0x341d2f,'id');var _0x16424b=[];var _0x2e40cf=[];var _0x54c190=squel[_0xe549('0x80')]();_0x54c190[_0xe549('0x81')](_0xe549('0x82'))['from'](_0xe549('0x83'),'tq')[_0xe549('0x84')]('user_has_teams','ut',_0xe549('0x85'))[_0xe549('0x49')](_0xe549('0x86'),_0x3aed3c[_0xe549('0x51')]['id']);for(var _0x1e8ef1=0x0;_0x1e8ef1<_0x341d2f[_0xe549('0x52')];_0x1e8ef1+=0x1){let _0x281e40=_0x341d2f[_0x1e8ef1];for(var _0xa0dd3=0x0;_0xa0dd3<_0x281e40[_0xe549('0x70')][_0xe549('0x52')];_0xa0dd3+=0x1){let _0x55df54=_0x281e40[_0xe549('0x70')][_0xa0dd3];var _0x3e8483=_0x54c190[_0xe549('0x87')]();_0x3e8483[_0xe549('0x49')](_0xe549('0x88'),_0x55df54['id']);_0x2e40cf['push'](db[_0xe549('0x89')]['query'](_0x3e8483['toString'](),{'type':db[_0xe549('0x89')][_0xe549('0x8a')][_0xe549('0x8b')]})[_0xe549('0x2b')](function(_0x4bab42){if(_0x4bab42[_0xe549('0x52')]===0x1){return _0x55df54['id'];}else{var _0xe065f1=_[_0xe549('0x8c')](_[_0xe549('0x31')](_0x4bab42,_0xe549('0x8d')),function(_0x2c3595){return _[_0xe549('0x8e')](_0x39d954,_0x2c3595);});if(_0xe065f1){return _0x55df54['id'];}}}));}}return BPromise[_0xe549('0x8f')](_0x2e40cf)[_0xe549('0x2b')](function(_0xeef9f8){_0x16424b=_(_0x16424b)[_0xe549('0x90')](_0xeef9f8)[_0xe549('0x91')]()[_0xe549('0x32')]();return db['VoiceQueue'][_0xe549('0x34')]({'where':{'id':_0x3aed3c[_0xe549('0x51')]['id']}})['then'](function(_0x40ff8d){return db[_0xe549('0x89')][_0xe549('0x74')](function(_0x18ae9a){return _0x40ff8d[_0xe549('0x92')](_0x3aed3c[_0xe549('0x3d')][_0xe549('0x7f')],{'transaction':_0x18ae9a})[_0xe549('0x2b')](function(){if(!_[_0xe549('0x93')](_0x16424b)){return _0x40ff8d['removeAgents'](_0x16424b,{'transaction':_0x18ae9a})[_0xe549('0x2b')](function(){return db[_0xe549('0x79')][_0xe549('0x2c')]({'where':{'VoiceQueueId':_0x3aed3c[_0xe549('0x51')]['id'],'UserId':_0x16424b},'transaction':_0x18ae9a});});}})['then'](function(){_0x16424b['forEach'](function(_0x64ad62){socket[_0xe549('0x7d')](_0xe549('0x94'),{'UserId':_0x64ad62,'VoiceQueueId':_0x40ff8d['id']});});});});});});})[_0xe549('0x2b')](respondWithStatusCode(_0x50a108,null))[_0xe549('0x50')](handleError(_0x50a108,null));};exports[_0xe549('0x95')]=function(_0x4ecf7b,_0x536ac6,_0x2641a0){var _0x51e07a,_0x50de40;return db[_0xe549('0x3a')]['find']({'where':{'id':_0x4ecf7b[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x536ac6,null))[_0xe549('0x2b')](function(_0x5dd624){if(_0x5dd624){_0x50de40=_0x5dd624;return _0x5dd624['addAgents'](_0x4ecf7b[_0xe549('0x60')][_0xe549('0x7f')],_[_0xe549('0x5d')](_0x4ecf7b[_0xe549('0x60')],[_0xe549('0x7f'),'id'])||{})['spread'](function(_0x31183e){for(var _0x1902de=0x0;_0x1902de<_0x4ecf7b[_0xe549('0x60')]['ids']['length'];_0x1902de+=0x1){socket[_0xe549('0x7d')](_0xe549('0x7e'),{'UserId':Number(_0x4ecf7b[_0xe549('0x60')]['ids'][_0x1902de]),'VoiceQueueId':Number(_0x4ecf7b['params']['id'])});}return _0x31183e;});}})[_0xe549('0x2b')](function(_0x514777){_0x51e07a=_0x514777||[];if(_0x50de40){return db[_0xe549('0x6f')]['findAll']({'where':{'id':_0x4ecf7b[_0xe549('0x60')][_0xe549('0x7f')]},'attributes':['id','name','online','voicePause','interface'],'raw':!![]});}})[_0xe549('0x2b')](function(_0x3b8286){if(!_[_0xe549('0x93')](_0x3b8286)){var _0x409a2a=[];for(var _0x1239e8=0x0;_0x1239e8<_0x3b8286[_0xe549('0x52')];_0x1239e8++){if(_0x3b8286[_0x1239e8][_0xe549('0x96')]){_0x409a2a[_0xe549('0x97')](db[_0xe549('0x79')][_0xe549('0x77')]({'membername':_0x3b8286[_0x1239e8][_0xe549('0x35')],'UserId':_0x3b8286[_0x1239e8]['id'],'queue_name':_0x50de40[_0xe549('0x35')],'VoiceQueueId':_0x50de40['id'],'interface':_[_0xe549('0x98')](_0x3b8286[_0x1239e8]['interface'])?util[_0xe549('0x7a')](_0xe549('0x7b'),_0x3b8286[_0x1239e8]['name']):_0x3b8286[_0x1239e8]['interface'],'paused':_0x3b8286[_0x1239e8]['voicePause']||![],'penalty':_0x4ecf7b['body'][_0xe549('0x73')]||0x0}));}}return BPromise['all'](_0x409a2a);}})[_0xe549('0x2b')](function(){return _0x51e07a;})['then'](respondWithResult(_0x536ac6,null))[_0xe549('0x50')](handleError(_0x536ac6,null));};exports['removeAgents']=function(_0x368e3c,_0x46ee87,_0x5d1943){return db[_0xe549('0x3a')][_0xe549('0x34')]({'where':{'id':_0x368e3c[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x46ee87,null))[_0xe549('0x2b')](function(_0x551ea9){if(_0x551ea9){return _0x551ea9[_0xe549('0x99')](_0x368e3c[_0xe549('0x3d')][_0xe549('0x7f')])[_0xe549('0x2b')](function(){if(_[_0xe549('0x9a')](_0x368e3c['query']['ids'])){for(var _0x5aaad5=0x0;_0x5aaad5<_0x368e3c[_0xe549('0x3d')][_0xe549('0x7f')][_0xe549('0x52')];_0x5aaad5+=0x1){socket[_0xe549('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x368e3c['query']['ids'][_0x5aaad5]),'VoiceQueueId':Number(_0x368e3c[_0xe549('0x51')]['id'])});}}else{socket[_0xe549('0x7d')](_0xe549('0x94'),{'UserId':Number(_0x368e3c[_0xe549('0x3d')][_0xe549('0x7f')]),'VoiceQueueId':Number(_0x368e3c[_0xe549('0x51')]['id'])});}});}})[_0xe549('0x2b')](function(_0x417737){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x368e3c[_0xe549('0x51')]['id'],'UserId':_0x368e3c['query'][_0xe549('0x7f')]}})['then'](function(){return _0x417737;});})['then'](respondWithStatusCode(_0x46ee87,null))[_0xe549('0x50')](handleError(_0x46ee87,null));};exports['getAgents']=function(_0x2c9f92,_0x27430d,_0x319be9){var _0x388f87={};var _0x30dfe8={};var _0x42d909;var _0xdafbbe;return db['VoiceQueue'][_0xe549('0x67')]({'where':{'id':_0x2c9f92['params']['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x27430d,null))['then'](function(_0x13fbcb){if(_0x13fbcb){_0x42d909=_0x13fbcb;_0x30dfe8[_0xe549('0x40')]=_[_0xe549('0x3e')](db[_0xe549('0x6f')][_0xe549('0x3b')]);_0x30dfe8[_0xe549('0x3d')]=_['keys'](_0x2c9f92['query']);_0x30dfe8[_0xe549('0x47')]=_[_0xe549('0x3f')](_0x30dfe8['model'],_0x30dfe8['query']);_0x388f87[_0xe549('0x42')]=_[_0xe549('0x3f')](_0x30dfe8[_0xe549('0x40')],qs[_0xe549('0x41')](_0x2c9f92[_0xe549('0x3d')]['fields']));_0x388f87[_0xe549('0x42')]=_0x388f87[_0xe549('0x42')]['length']?_0x388f87['attributes']:_0x30dfe8[_0xe549('0x40')];_0x388f87[_0xe549('0x45')]=qs['sort'](_0x2c9f92[_0xe549('0x3d')][_0xe549('0x46')]);_0x388f87['where']=qs[_0xe549('0x47')](_[_0xe549('0x48')](_0x2c9f92[_0xe549('0x3d')],_0x30dfe8[_0xe549('0x47')]));if(_0x2c9f92['query'][_0xe549('0x4b')]){_0x388f87['where']=_[_0xe549('0x4a')](_0x388f87[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x388f87[_0xe549('0x42')],function(_0x3004e4){var _0x63f115={};_0x63f115[_0x3004e4]={'$like':'%'+_0x2c9f92[_0xe549('0x3d')][_0xe549('0x4b')]+'%'};return _0x63f115;})});}_0x388f87=_[_0xe549('0x4a')]({},_0x388f87,_0x2c9f92['options']);return _0x42d909[_0xe549('0x9b')](_0x388f87);}})[_0xe549('0x2b')](function(_0x2dd210){if(_0x2dd210){_0xdafbbe=_0x2dd210['length'];if(!_0x2c9f92[_0xe549('0x3d')]['hasOwnProperty']('nolimit')){_0x388f87[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x2c9f92['query'][_0xe549('0x25')]);_0x388f87[_0xe549('0x23')]=qs['offset'](_0x2c9f92[_0xe549('0x3d')][_0xe549('0x23')]);}return _0x42d909[_0xe549('0x9b')](_0x388f87);}})[_0xe549('0x2b')](function(_0x53afd1){if(_0x53afd1){return _0x53afd1?{'count':_0xdafbbe,'rows':_0x53afd1}:null;}})[_0xe549('0x2b')](respondWithResult(_0x27430d,null))[_0xe549('0x50')](handleError(_0x27430d,null));};exports[_0xe549('0x9c')]=function(_0x5297c2,_0x5699f7,_0x3f05ef){var _0x21f9f2={};var _0x492267={};var _0x396d19;var _0x1eaa46;return db['VoiceQueue'][_0xe549('0x67')]({'where':{'id':_0x5297c2['params']['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x5699f7,null))['then'](function(_0x8a556d){if(_0x8a556d){_0x396d19=_0x8a556d;_0x492267['model']=_[_0xe549('0x3e')](db[_0xe549('0x79')][_0xe549('0x3b')]);_0x492267[_0xe549('0x3d')]=_['keys'](_0x5297c2[_0xe549('0x3d')]);_0x492267[_0xe549('0x47')]=_[_0xe549('0x3f')](_0x492267[_0xe549('0x40')],_0x492267[_0xe549('0x3d')]);_0x21f9f2[_0xe549('0x42')]=_[_0xe549('0x3f')](_0x492267[_0xe549('0x40')],qs[_0xe549('0x41')](_0x5297c2[_0xe549('0x3d')][_0xe549('0x41')]));_0x21f9f2[_0xe549('0x42')]=_0x21f9f2['attributes'][_0xe549('0x52')]?_0x21f9f2[_0xe549('0x42')]:_0x492267[_0xe549('0x40')];_0x21f9f2['order']=qs['sort'](_0x5297c2[_0xe549('0x3d')][_0xe549('0x46')]);_0x21f9f2[_0xe549('0x49')]=qs['filters'](_[_0xe549('0x48')](_0x5297c2[_0xe549('0x3d')],_0x492267['filters']));if(_0x5297c2['query'][_0xe549('0x4b')]){_0x21f9f2[_0xe549('0x49')]=_[_0xe549('0x4a')](_0x21f9f2[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x21f9f2[_0xe549('0x42')],function(_0x6e004d){var _0x2d3398={};_0x2d3398[_0x6e004d]={'$like':'%'+_0x5297c2[_0xe549('0x3d')][_0xe549('0x4b')]+'%'};return _0x2d3398;})});}_0x21f9f2=_[_0xe549('0x4a')]({},_0x21f9f2,_0x5297c2[_0xe549('0x4c')]);return _0x396d19[_0xe549('0x9c')](_0x21f9f2);}})[_0xe549('0x2b')](function(_0xabc3af){if(_0xabc3af){_0x1eaa46=_0xabc3af[_0xe549('0x52')];if(!_0x5297c2[_0xe549('0x3d')][_0xe549('0x43')](_0xe549('0x44'))){_0x21f9f2[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x5297c2[_0xe549('0x3d')]['limit']);_0x21f9f2[_0xe549('0x23')]=qs[_0xe549('0x23')](_0x5297c2[_0xe549('0x3d')][_0xe549('0x23')]);}return _0x396d19[_0xe549('0x9c')](_0x21f9f2);}})['then'](function(_0x2295bb){return _0x2295bb?{'count':_0x1eaa46,'rows':_0x2295bb}:null;})['then'](respondWithResult(_0x5699f7,null))[_0xe549('0x50')](handleError(_0x5699f7,null));};exports[_0xe549('0x9d')]=function(_0x5b6936,_0x5ed18a,_0x1451e4){var _0x383d28={};var _0x4e8570={};var _0x3a118c;var _0x3775c7;return db['VoiceQueue']['findOne']({'where':{'id':_0x5b6936[_0xe549('0x51')]['id']}})['then'](handleEntityNotFound(_0x5ed18a,null))[_0xe549('0x2b')](function(_0x304543){if(_0x304543){_0x3a118c=_0x304543;_0x4e8570[_0xe549('0x40')]=_[_0xe549('0x3e')](db['CmList'][_0xe549('0x3b')]);_0x4e8570[_0xe549('0x3d')]=_['keys'](_0x5b6936[_0xe549('0x3d')]);_0x4e8570[_0xe549('0x47')]=_['intersection'](_0x4e8570['model'],_0x4e8570[_0xe549('0x3d')]);_0x383d28[_0xe549('0x42')]=_['intersection'](_0x4e8570[_0xe549('0x40')],qs['fields'](_0x5b6936['query'][_0xe549('0x41')]));_0x383d28['attributes']=_0x383d28[_0xe549('0x42')][_0xe549('0x52')]?_0x383d28['attributes']:_0x4e8570[_0xe549('0x40')];_0x383d28[_0xe549('0x45')]=qs['sort'](_0x5b6936[_0xe549('0x3d')][_0xe549('0x46')]);_0x383d28[_0xe549('0x49')]=qs['filters'](_[_0xe549('0x48')](_0x5b6936['query'],_0x4e8570[_0xe549('0x47')]));if(_0x5b6936['query'][_0xe549('0x4b')]){_0x383d28['where']=_[_0xe549('0x4a')](_0x383d28[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x383d28[_0xe549('0x42')],function(_0x35dcb5){var _0xc61c92={};_0xc61c92[_0x35dcb5]={'$like':'%'+_0x5b6936['query'][_0xe549('0x4b')]+'%'};return _0xc61c92;})});}_0x383d28=_[_0xe549('0x4a')]({},_0x383d28,_0x5b6936[_0xe549('0x4c')]);return _0x3a118c[_0xe549('0x9d')](_0x383d28);}})[_0xe549('0x2b')](function(_0x4d34be){if(_0x4d34be){_0x3775c7=_0x4d34be[_0xe549('0x52')];if(!_0x5b6936[_0xe549('0x3d')][_0xe549('0x43')](_0xe549('0x44'))){_0x383d28[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x5b6936['query'][_0xe549('0x25')]);_0x383d28[_0xe549('0x23')]=qs[_0xe549('0x23')](_0x5b6936['query'][_0xe549('0x23')]);}return _0x3a118c[_0xe549('0x9d')](_0x383d28);}})['then'](function(_0x396d2a){if(_0x396d2a){return _0x396d2a?{'count':_0x3775c7,'rows':_0x396d2a}:null;}})[_0xe549('0x2b')](respondWithResult(_0x5ed18a,null))['catch'](handleError(_0x5ed18a,null));};exports[_0xe549('0x9e')]=function(_0x5e7657,_0x45eacb,_0x5020e4){var _0x4dae1f,_0x2ce3c1;return db[_0xe549('0x3a')][_0xe549('0x34')]({'where':{'id':_0x5e7657[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x45eacb,null))[_0xe549('0x2b')](function(_0x42e978){if(_0x42e978){_0x2ce3c1=_0x42e978;return _0x42e978[_0xe549('0x9e')](_0x5e7657['body'][_0xe549('0x7f')],_[_0xe549('0x5d')](_0x5e7657['body'],[_0xe549('0x7f'),'id'])||{});}return null;})[_0xe549('0x9f')](function(_0xd19ffb){var _0x1e7d6b;_0x4dae1f=_0xd19ffb||[];var _0x161fb2=[];if(_0xd19ffb){for(var _0x11a571=0x0;_0x11a571<_0xd19ffb[_0xe549('0x52')];_0x11a571+=0x1){var _0xb4ecc=_0xd19ffb[_0x11a571][_0xe549('0x2d')]({'plain':!![]});_0x2ce3c1[_0xe549('0xa0')]=_0x5e7657['body'][_0xe549('0xa0')]?_0x5e7657[_0xe549('0x60')][_0xe549('0xa0')]:_0x2ce3c1[_0xe549('0xa0')];switch(_0x2ce3c1[_0xe549('0xa0')]){case _0xe549('0xa1'):_0x1e7d6b=squel[_0xe549('0xa2')]()[_0xe549('0xa3')](_0xe549('0xa4'))['fromQuery']([_0xe549('0xa5'),_0xe549('0xa6'),_0xe549('0xa7'),_0xe549('0xa8'),_0xe549('0x64'),_0xe549('0x5e'),_0xe549('0x5f')],squel[_0xe549('0x80')]()[_0xe549('0x81')](_0xe549('0xa5'),_0xe549('0xa5'))[_0xe549('0x81')](_0xe549('0xa9'),_0xe549('0xa6'))[_0xe549('0x81')]('id',_0xe549('0xa7'))['field'](_0xb4ecc['CmListId'][_0xe549('0xaa')](),_0xe549('0xa8'))[_0xe549('0x81')](_0x5e7657[_0xe549('0x51')]['id'][_0xe549('0xaa')](),_0xe549('0x64'))[_0xe549('0x81')](_0xe549('0xa9'),_0xe549('0x5e'))[_0xe549('0x81')](_0xe549('0xa9'),_0xe549('0x5f'))[_0xe549('0xab')](_0xe549('0xac'))[_0xe549('0x49')](_0xe549('0xad'))[_0xe549('0x49')](_0xe549('0xae'),_0xb4ecc['CmListId'][_0xe549('0xaa')]())[_0xe549('0x49')](_0xe549('0xaf'))[_0xe549('0x49')](_0xe549('0xb0'),squel[_0xe549('0x80')]()[_0xe549('0x81')](_0xe549('0xb1'))[_0xe549('0xab')]('cm_hopper_final')[_0xe549('0x49')](_0xe549('0x86'),_0x5e7657[_0xe549('0x51')]['id']['toString']()))[_0xe549('0x49')](_0xe549('0xb0'),squel['select']()['field'](_0xe549('0xb2'))[_0xe549('0xab')]('cm_hopper')[_0xe549('0x49')]('VoiceQueueId\x20=\x20?',_0x5e7657['params']['id']['toString']())))[_0xe549('0xaa')]();break;case'onlyIfOpen':_0x1e7d6b=squel[_0xe549('0xa2')]()[_0xe549('0xa3')](_0xe549('0xa4'))['fromQuery']([_0xe549('0xa5'),'scheduledAt',_0xe549('0xa7'),_0xe549('0xa8'),_0xe549('0x64'),'createdAt',_0xe549('0x5f')],squel[_0xe549('0x80')]()['field'](_0xe549('0xa5'),_0xe549('0xa5'))[_0xe549('0x81')](_0xe549('0xa9'),_0xe549('0xa6'))[_0xe549('0x81')]('id',_0xe549('0xa7'))[_0xe549('0x81')](_0xb4ecc[_0xe549('0xb3')][_0xe549('0xaa')](),_0xe549('0xa8'))[_0xe549('0x81')](_0x5e7657[_0xe549('0x51')]['id']['toString'](),_0xe549('0x64'))[_0xe549('0x81')](_0xe549('0xa9'),'createdAt')[_0xe549('0x81')]('NOW()',_0xe549('0x5f'))[_0xe549('0xab')](_0xe549('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0xe549('0x49')](_0xe549('0xae'),_0xb4ecc[_0xe549('0xb3')][_0xe549('0xaa')]())[_0xe549('0x49')]('phone\x20IS\x20NOT\x20NULL')[_0xe549('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe549('0x80')]()[_0xe549('0x81')](_0xe549('0xb2'))[_0xe549('0xab')](_0xe549('0xa4'))[_0xe549('0x49')](_0xe549('0x86'),_0x5e7657[_0xe549('0x51')]['id'][_0xe549('0xaa')]())))['toString']();break;default:_0x1e7d6b=squel[_0xe549('0xa2')]()[_0xe549('0xa3')](_0xe549('0xa4'))[_0xe549('0xb4')]([_0xe549('0xa5'),_0xe549('0xa6'),_0xe549('0xa7'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xe549('0x80')]()[_0xe549('0x81')](_0xe549('0xa5'),_0xe549('0xa5'))[_0xe549('0x81')](_0xe549('0xa9'),'scheduledAt')[_0xe549('0x81')]('id','ContactId')[_0xe549('0x81')](_0xb4ecc[_0xe549('0xb3')]['toString'](),_0xe549('0xa8'))[_0xe549('0x81')](_0x5e7657[_0xe549('0x51')]['id'][_0xe549('0xaa')](),_0xe549('0x64'))[_0xe549('0x81')](_0xe549('0xa9'),_0xe549('0x5e'))[_0xe549('0x81')]('NOW()',_0xe549('0x5f'))[_0xe549('0xab')](_0xe549('0xac'))[_0xe549('0x49')](_0xe549('0xad'))[_0xe549('0x49')](_0xe549('0xae'),_0xb4ecc[_0xe549('0xb3')][_0xe549('0xaa')]())[_0xe549('0x49')](_0xe549('0xaf')))[_0xe549('0xaa')]();}_0x161fb2[_0xe549('0x97')](db[_0xe549('0x89')][_0xe549('0x3d')](_0x1e7d6b));}return BPromise[_0xe549('0x8f')](_0x161fb2);}})[_0xe549('0x2b')](function(){return _0x4dae1f;})[_0xe549('0x2b')](respondWithResult(_0x45eacb,null))[_0xe549('0x50')](handleError(_0x45eacb,null));};exports[_0xe549('0xb5')]=function(_0x2a5755,_0x3a1127,_0x39266){return db[_0xe549('0x3a')][_0xe549('0x34')]({'where':{'id':_0x2a5755[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x3a1127,null))[_0xe549('0x2b')](function(_0x170338){if(_0x170338){return _0x170338['removeLists'](_0x2a5755[_0xe549('0x3d')][_0xe549('0x7f')]);}})['then'](function(_0x117189){if(_0x117189){return db[_0xe549('0x63')][_0xe549('0x2c')]({'where':{'ListId':_0x2a5755[_0xe549('0x3d')][_0xe549('0x7f')],'VoiceQueueId':_0x2a5755[_0xe549('0x51')]['id']}})['then'](function(){return _0x117189;});}})['then'](respondWithStatusCode(_0x3a1127,null))[_0xe549('0x50')](handleError(_0x3a1127,null));};exports[_0xe549('0xb6')]=function(_0x44b3ab,_0x3339f8,_0x51a408){var _0x55ac6d={};var _0x36961d={};var _0x86507b;var _0x3b678a;return db[_0xe549('0x3a')][_0xe549('0x67')]({'where':{'id':_0x44b3ab[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x3339f8,null))[_0xe549('0x2b')](function(_0xd06c8d){if(_0xd06c8d){_0x86507b=_0xd06c8d;_0x36961d[_0xe549('0x40')]=_['keys'](db[_0xe549('0xb7')][_0xe549('0x3b')]);_0x36961d[_0xe549('0x3d')]=_[_0xe549('0x3e')](_0x44b3ab[_0xe549('0x3d')]);_0x36961d[_0xe549('0x47')]=_[_0xe549('0x3f')](_0x36961d[_0xe549('0x40')],_0x36961d[_0xe549('0x3d')]);_0x55ac6d['attributes']=_[_0xe549('0x3f')](_0x36961d['model'],qs[_0xe549('0x41')](_0x44b3ab[_0xe549('0x3d')][_0xe549('0x41')]));_0x55ac6d[_0xe549('0x42')]=_0x55ac6d[_0xe549('0x42')][_0xe549('0x52')]?_0x55ac6d[_0xe549('0x42')]:_0x36961d[_0xe549('0x40')];_0x55ac6d[_0xe549('0x45')]=qs[_0xe549('0x46')](_0x44b3ab[_0xe549('0x3d')]['sort']);_0x55ac6d[_0xe549('0x49')]=qs[_0xe549('0x47')](_['pick'](_0x44b3ab[_0xe549('0x3d')],_0x36961d[_0xe549('0x47')]));if(_0x44b3ab[_0xe549('0x3d')][_0xe549('0x4b')]){_0x55ac6d[_0xe549('0x49')]=_['merge'](_0x55ac6d[_0xe549('0x49')],{'$or':_[_0xe549('0x31')](_0x55ac6d[_0xe549('0x42')],function(_0x5418c3){var _0x39a571={};_0x39a571[_0x5418c3]={'$like':'%'+_0x44b3ab[_0xe549('0x3d')][_0xe549('0x4b')]+'%'};return _0x39a571;})});}_0x55ac6d=_[_0xe549('0x4a')]({},_0x55ac6d,_0x44b3ab['options']);return _0x86507b['getBlackLists'](_0x55ac6d);}})['then'](function(_0x381729){if(_0x381729){_0x3b678a=_0x381729[_0xe549('0x52')];if(!_0x44b3ab['query']['hasOwnProperty'](_0xe549('0x44'))){_0x55ac6d[_0xe549('0x25')]=qs[_0xe549('0x25')](_0x44b3ab[_0xe549('0x3d')][_0xe549('0x25')]);_0x55ac6d[_0xe549('0x23')]=qs['offset'](_0x44b3ab['query']['offset']);}return _0x86507b[_0xe549('0xb6')](_0x55ac6d);}})[_0xe549('0x2b')](function(_0x1a6998){if(_0x1a6998){return _0x1a6998?{'count':_0x3b678a,'rows':_0x1a6998}:null;}})[_0xe549('0x2b')](respondWithResult(_0x3339f8,null))[_0xe549('0x50')](handleError(_0x3339f8,null));};exports['addBlackLists']=function(_0x2a1dcc,_0x2d34c0,_0x4efedf){var _0x419fcf,_0x1d0657;return db['VoiceQueue'][_0xe549('0x34')]({'where':{'id':_0x2a1dcc[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x2d34c0,null))[_0xe549('0x2b')](function(_0x442a99){if(_0x442a99){_0x1d0657=_0x442a99;return _0x442a99['addBlackLists'](_0x2a1dcc[_0xe549('0x60')][_0xe549('0x7f')],_[_0xe549('0x5d')](_0x2a1dcc[_0xe549('0x60')],[_0xe549('0x7f'),'id'])||{});}return null;})[_0xe549('0x9f')](function(_0x2bf5cb){var _0x565cbb;_0x419fcf=_0x2bf5cb||[];var _0x4439e7=[];if(_0x2bf5cb){for(var _0xe97137=0x0;_0xe97137<_0x2bf5cb[_0xe549('0x52')];_0xe97137+=0x1){var _0x3e968b=_0x2bf5cb[_0xe97137][_0xe549('0x2d')]({'plain':!![]});_0x565cbb=squel[_0xe549('0xa2')]()[_0xe549('0xa3')](_0xe549('0xb8'))[_0xe549('0xb4')]([_0xe549('0xa5'),_0xe549('0xa7'),_0xe549('0xa8'),_0xe549('0x64'),_0xe549('0x5e'),_0xe549('0x5f')],squel[_0xe549('0x80')]()['field'](_0xe549('0xa5'),_0xe549('0xa5'))[_0xe549('0x81')]('id','ContactId')[_0xe549('0x81')](_0x3e968b[_0xe549('0xb3')][_0xe549('0xaa')](),'ListId')[_0xe549('0x81')](_0x2a1dcc[_0xe549('0x51')]['id'][_0xe549('0xaa')](),_0xe549('0x64'))[_0xe549('0x81')]('NOW()',_0xe549('0x5e'))[_0xe549('0x81')]('NOW()','updatedAt')[_0xe549('0xab')](_0xe549('0xac'))[_0xe549('0x49')](_0xe549('0xad'))['where'](_0xe549('0xae'),_0x3e968b['CmListId'][_0xe549('0xaa')]())[_0xe549('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0xe549('0xaa')]();_0x4439e7[_0xe549('0x97')](db[_0xe549('0x89')]['query'](_0x565cbb));}return BPromise['all'](_0x4439e7);}})[_0xe549('0x2b')](function(){return _0x419fcf;})[_0xe549('0x2b')](respondWithResult(_0x2d34c0,null))[_0xe549('0x50')](handleError(_0x2d34c0,null));};exports['removeBlackLists']=function(_0x2bb478,_0x48b70d,_0x490d50){return db[_0xe549('0x3a')][_0xe549('0x34')]({'where':{'id':_0x2bb478[_0xe549('0x51')]['id']}})[_0xe549('0x2b')](handleEntityNotFound(_0x48b70d,null))[_0xe549('0x2b')](function(_0x2425bf){if(_0x2425bf){return _0x2425bf['removeBlackLists'](_0x2bb478[_0xe549('0x3d')]['ids']);}})[_0xe549('0x2b')](function(_0x3c7bb5){if(_0x3c7bb5){return db[_0xe549('0x6a')][_0xe549('0x2c')]({'where':{'ListId':_0x2bb478[_0xe549('0x3d')][_0xe549('0x7f')],'VoiceQueueId':_0x2bb478['params']['id']}})['then'](function(){return _0x3c7bb5;});}})[_0xe549('0x2b')](respondWithStatusCode(_0x48b70d,null))[_0xe549('0x50')](handleError(_0x48b70d,null));}; \ No newline at end of file +var _0xd53c=['spread','User','online','isNil','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','util','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','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./voiceQueue.socket','register','sendStatus','status','end','json','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','value','includes','type','UserProfileResource','error','stack','name','index','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','offset','filters','pick','where','merge','VIRTUAL','options','VoiceQueue','include','findAll','catch','params','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getHoppers','findOne','nolimit','order','sort','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','all','union','compact','isEmpty','UserVoiceQueueRt','emit','userVoiceQueue:remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd53c,0x19b));var _0xcd53=function(_0x3a1cb4,_0x7fcea3){_0x3a1cb4=_0x3a1cb4-0x0;var _0x338ded=_0xd53c[_0x3a1cb4];return _0x338ded;};'use strict';var emlformat=require(_0xcd53('0x0'));var rimraf=require(_0xcd53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd53('0x2'));var moment=require(_0xcd53('0x3'));var BPromise=require(_0xcd53('0x4'));var Mustache=require('mustache');var util=require(_0xcd53('0x5'));var path=require('path');var sox=require(_0xcd53('0x6'));var csv=require('to-csv');var ejs=require(_0xcd53('0x7'));var fs=require('fs');var fs_extra=require(_0xcd53('0x8'));var _=require(_0xcd53('0x9'));var squel=require(_0xcd53('0xa'));var crypto=require(_0xcd53('0xb'));var jsforce=require(_0xcd53('0xc'));var deskjs=require(_0xcd53('0xd'));var toCsv=require(_0xcd53('0xe'));var querystring=require(_0xcd53('0xf'));var Papa=require(_0xcd53('0x10'));var Redis=require(_0xcd53('0x11'));var authService=require(_0xcd53('0x12'));var qs=require(_0xcd53('0x13'));var as=require(_0xcd53('0x14'));var hardwareService=require(_0xcd53('0x15'));var logger=require('../../config/logger')(_0xcd53('0x16'));var utils=require('../../config/utils');var config=require(_0xcd53('0x17'));var licenseUtil=require(_0xcd53('0x18'));var db=require(_0xcd53('0x19'))['db'];config['redis']=_[_0xcd53('0x1a')](config[_0xcd53('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd53('0x1b')]));require(_0xcd53('0x1c'))[_0xcd53('0x1d')](socket);function respondWithStatusCode(_0x35d256,_0x2c390e){_0x2c390e=_0x2c390e||0xcc;return function(_0x3d4a7e){if(_0x3d4a7e){return _0x35d256[_0xcd53('0x1e')](_0x2c390e);}return _0x35d256[_0xcd53('0x1f')](_0x2c390e)[_0xcd53('0x20')]();};}function respondWithResult(_0x317392,_0x330d75){_0x330d75=_0x330d75||0xc8;return function(_0x3fa3a6){if(_0x3fa3a6){return _0x317392[_0xcd53('0x1f')](_0x330d75)[_0xcd53('0x21')](_0x3fa3a6);}};}function respondWithFilteredResult(_0xa383ec,_0x1abdc6){return function(_0x2ee561){if(_0x2ee561){var _0x5c27ce=typeof _0x1abdc6['offset']==='undefined'&&typeof _0x1abdc6[_0xcd53('0x22')]==='undefined';var _0x5502f5=_0x2ee561['count'];var _0x40e8e0=_0x5c27ce?0x0:_0x1abdc6['offset'];var _0x4131c5=_0x5c27ce?_0x2ee561[_0xcd53('0x23')]:_0x1abdc6['offset']+_0x1abdc6['limit'];var _0x5a8bf6;if(_0x4131c5>=_0x5502f5){_0x4131c5=_0x5502f5;_0x5a8bf6=0xc8;}else{_0x5a8bf6=0xce;}_0xa383ec[_0xcd53('0x1f')](_0x5a8bf6);return _0xa383ec[_0xcd53('0x24')](_0xcd53('0x25'),_0x40e8e0+'-'+_0x4131c5+'/'+_0x5502f5)[_0xcd53('0x21')](_0x2ee561);}return null;};}function patchUpdates(_0x1d9b14){return function(_0x139608){try{jsonpatch[_0xcd53('0x26')](_0x139608,_0x1d9b14,!![]);}catch(_0x89eec8){return BPromise[_0xcd53('0x27')](_0x89eec8);}return _0x139608['save']();};}function saveUpdates(_0x58678f,_0x2a6813){return function(_0x2cbdfb){if(_0x2cbdfb){return _0x2cbdfb[_0xcd53('0x28')](_0x58678f)['then'](function(_0x194624){return _0x194624;});}return null;};}function removeEntity(_0x30eaa3,_0x448449){return function(_0x4356dd){if(_0x4356dd){return _0x4356dd[_0xcd53('0x29')]()[_0xcd53('0x2a')](function(){var _0x2fa245=_0x4356dd[_0xcd53('0x2b')]({'plain':!![]});var _0x4371ca=[{'name':_0xcd53('0x2c'),'value':_0xcd53('0x2d'),'ignore':![]},{'name':_0xcd53('0x2e'),'value':_0xcd53('0x2f'),'ignore':![]}];var _0x463bbd=_(_0x4371ca)[_0xcd53('0x30')]('ignore')['map'](_0xcd53('0x31'))[_0xcd53('0x31')]();if(_[_0xcd53('0x32')](_0x463bbd,_0x2fa245[_0xcd53('0x33')])){return;}var _0x5821bd=_['find'](_0x4371ca,[_0xcd53('0x31'),_0x2fa245[_0xcd53('0x33')]])['name'];return db[_0xcd53('0x34')][_0xcd53('0x29')]({'where':{'type':_0x5821bd,'resourceId':_0x2fa245['id']}})[_0xcd53('0x2a')](function(){return _0x4356dd;});})[_0xcd53('0x2a')](function(){_0x30eaa3[_0xcd53('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fed9,_0x35c535){return function(_0x1a78e0){if(!_0x1a78e0){_0x55fed9[_0xcd53('0x1e')](0x194);}return _0x1a78e0;};}function handleError(_0x13fd29,_0x1d3edc){_0x1d3edc=_0x1d3edc||0x1f4;return function(_0x36df9d){logger[_0xcd53('0x35')](_0x36df9d[_0xcd53('0x36')]);if(_0x36df9d[_0xcd53('0x37')]){delete _0x36df9d[_0xcd53('0x37')];}_0x13fd29[_0xcd53('0x1f')](_0x1d3edc)['send'](_0x36df9d);};}exports[_0xcd53('0x38')]=function(_0x4fc3d0,_0x25032a){var _0x2b8742={},_0xdff08b={},_0x42e660={'count':0x0,'rows':[]};var _0x57600a=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x521ac3){return{'name':_0x521ac3[_0xcd53('0x39')],'type':_0x521ac3[_0xcd53('0x33')][_0xcd53('0x3a')]};});_0xdff08b[_0xcd53('0x3b')]=_[_0xcd53('0x3c')](_0x57600a,_0xcd53('0x37'));_0xdff08b[_0xcd53('0x3d')]=_[_0xcd53('0x3e')](_0x4fc3d0[_0xcd53('0x3d')]);_0xdff08b['filters']=_[_0xcd53('0x3f')](_0xdff08b[_0xcd53('0x3b')],_0xdff08b['query']);_0x2b8742[_0xcd53('0x40')]=_[_0xcd53('0x3f')](_0xdff08b[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0x4fc3d0[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x2b8742[_0xcd53('0x40')]=_0x2b8742[_0xcd53('0x40')][_0xcd53('0x42')]?_0x2b8742[_0xcd53('0x40')]:_0xdff08b['model'];if(!_0x4fc3d0[_0xcd53('0x3d')][_0xcd53('0x43')]('nolimit')){_0x2b8742[_0xcd53('0x22')]=qs[_0xcd53('0x22')](_0x4fc3d0[_0xcd53('0x3d')][_0xcd53('0x22')]);_0x2b8742['offset']=qs[_0xcd53('0x44')](_0x4fc3d0[_0xcd53('0x3d')][_0xcd53('0x44')]);}_0x2b8742['order']=qs['sort'](_0x4fc3d0[_0xcd53('0x3d')]['sort']);_0x2b8742['where']=qs[_0xcd53('0x45')](_[_0xcd53('0x46')](_0x4fc3d0[_0xcd53('0x3d')],_0xdff08b[_0xcd53('0x45')]),_0x57600a);if(_0x4fc3d0['query'][_0xcd53('0x30')]){_0x2b8742[_0xcd53('0x47')]=_[_0xcd53('0x48')](_0x2b8742[_0xcd53('0x47')],{'$or':_[_0xcd53('0x3c')](_0x57600a,function(_0x1e4086){if(_0x1e4086[_0xcd53('0x33')]!==_0xcd53('0x49')){var _0x5b9966={};_0x5b9966[_0x1e4086[_0xcd53('0x37')]]={'$like':'%'+_0x4fc3d0[_0xcd53('0x3d')][_0xcd53('0x30')]+'%'};return _0x5b9966;}})});}_0x2b8742=_[_0xcd53('0x48')]({},_0x2b8742,_0x4fc3d0[_0xcd53('0x4a')]);var _0x36278d={'where':_0x2b8742[_0xcd53('0x47')]};return db[_0xcd53('0x4b')]['count'](_0x36278d)[_0xcd53('0x2a')](function(_0x27b057){_0x42e660[_0xcd53('0x23')]=_0x27b057;if(_0x4fc3d0['query']['includeAll']){_0x2b8742[_0xcd53('0x4c')]=[{'all':!![]}];}return db[_0xcd53('0x4b')][_0xcd53('0x4d')](_0x2b8742);})[_0xcd53('0x2a')](function(_0x3853ed){_0x42e660['rows']=_0x3853ed;return _0x42e660;})[_0xcd53('0x2a')](respondWithFilteredResult(_0x25032a,_0x2b8742))[_0xcd53('0x4e')](handleError(_0x25032a,null));};exports['show']=function(_0x14aed3,_0x48bbee){var _0x58b39f={'raw':![],'where':{'id':_0x14aed3[_0xcd53('0x4f')]['id']}},_0x43b06b={};_0x43b06b[_0xcd53('0x3b')]=_[_0xcd53('0x3e')](db[_0xcd53('0x4b')][_0xcd53('0x50')]);_0x43b06b['query']=_[_0xcd53('0x3e')](_0x14aed3[_0xcd53('0x3d')]);_0x43b06b[_0xcd53('0x45')]=_[_0xcd53('0x3f')](_0x43b06b[_0xcd53('0x3b')],_0x43b06b[_0xcd53('0x3d')]);_0x58b39f[_0xcd53('0x40')]=_[_0xcd53('0x3f')](_0x43b06b[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0x14aed3[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x58b39f[_0xcd53('0x40')]=_0x58b39f[_0xcd53('0x40')][_0xcd53('0x42')]?_0x58b39f[_0xcd53('0x40')]:_0x43b06b[_0xcd53('0x3b')];if(_0x14aed3[_0xcd53('0x3d')][_0xcd53('0x51')]){_0x58b39f[_0xcd53('0x4c')]=[{'all':!![]}];}_0x58b39f=_[_0xcd53('0x48')]({},_0x58b39f,_0x14aed3[_0xcd53('0x4a')]);return db[_0xcd53('0x4b')][_0xcd53('0x52')](_0x58b39f)[_0xcd53('0x2a')](handleEntityNotFound(_0x48bbee,null))['then'](respondWithResult(_0x48bbee,null))[_0xcd53('0x4e')](handleError(_0x48bbee,null));};exports['create']=function(_0xf7d5e1,_0x4ec733){return db['VoiceQueue'][_0xcd53('0x53')](_0xf7d5e1['body'],{})[_0xcd53('0x2a')](function(_0x4c8f5b){var _0x385149=_0xf7d5e1[_0xcd53('0x54')]['get']({'plain':!![]});if(!_0x385149)throw new Error(_0xcd53('0x55'));if(_0x385149[_0xcd53('0x56')]==='user'){var _0x173ef7=_0x4c8f5b['get']({'plain':!![]});var _0x56a13b=[{'name':_0xcd53('0x2c'),'value':_0xcd53('0x2d')},{'name':_0xcd53('0x2e'),'value':_0xcd53('0x2f')}];var _0x5ad925=_['find'](_0x56a13b,['value',_0x173ef7[_0xcd53('0x33')]])['name'];return db[_0xcd53('0x57')][_0xcd53('0x52')]({'where':{'name':_0x5ad925,'userProfileId':_0x385149[_0xcd53('0x58')]},'raw':!![]})['then'](function(_0x3c668d){if(_0x3c668d&&_0x3c668d[_0xcd53('0x59')]===0x0){return db['UserProfileResource'][_0xcd53('0x53')]({'name':_0x173ef7['name'],'resourceId':_0x173ef7['id'],'type':_0x3c668d[_0xcd53('0x37')],'sectionId':_0x3c668d['id']},{})[_0xcd53('0x2a')](function(){return _0x4c8f5b;});}else{return _0x4c8f5b;}})[_0xcd53('0x4e')](function(_0x537b3e){logger[_0xcd53('0x35')](_0xcd53('0x5a'),_0x537b3e);throw _0x537b3e;});}return _0x4c8f5b;})[_0xcd53('0x2a')](respondWithResult(_0x4ec733,0xc9))[_0xcd53('0x4e')](handleError(_0x4ec733,null));};exports[_0xcd53('0x5b')]=function(_0x425e3c,_0x60d2f){var _0x4de8a7={'where':{'id':_0x425e3c[_0xcd53('0x4f')]['id']}},_0xe3d0d4={};_0xe3d0d4[_0xcd53('0x3b')]=_[_0xcd53('0x3e')](db[_0xcd53('0x4b')]['rawAttributes']);_0x4de8a7['attributes']=_[_0xcd53('0x3f')](_0xe3d0d4[_0xcd53('0x3b')],qs['fields'](_0x425e3c[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x4de8a7[_0xcd53('0x40')]=_0x4de8a7[_0xcd53('0x40')][_0xcd53('0x42')]?_0x4de8a7['attributes']:_0xe3d0d4['model'];if(_0x425e3c[_0xcd53('0x3d')][_0xcd53('0x51')]){_0x4de8a7[_0xcd53('0x4c')]=[{'all':!![]}];}_0x4de8a7=_['merge']({},_0x4de8a7,_0x425e3c[_0xcd53('0x4a')]);return db[_0xcd53('0x4b')]['find'](_0x4de8a7)[_0xcd53('0x2a')](handleEntityNotFound(_0x60d2f,null))[_0xcd53('0x2a')](function(_0x4133fa){if(_0x4133fa){var _0x5e1198=_0x4133fa['get']({'plain':!![]});_0x5e1198=qs[_0xcd53('0x5c')](_0x5e1198,['id',_0xcd53('0x5d'),_0xcd53('0x5e')]);_0x425e3c[_0xcd53('0x5f')]=_['omit'](_0x425e3c['body'],['id',_0xcd53('0x5d'),_0xcd53('0x5e')]);return db[_0xcd53('0x4b')][_0xcd53('0x53')](_[_0xcd53('0x48')](_0x5e1198,_0x425e3c[_0xcd53('0x5f')]),{'include':_0x425e3c[_0xcd53('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xcd53('0x2a')](function(_0x3fe8c0){var _0x525a8f=_0x425e3c[_0xcd53('0x54')][_0xcd53('0x2b')]({'plain':!![]});if(!_0x525a8f)throw new Error(_0xcd53('0x55'));if(_0x525a8f['role']===_0xcd53('0x54')){var _0xfac399=_0x3fe8c0[_0xcd53('0x2b')]({'plain':!![]});var _0x53604b=[{'name':'VoiceQueues','value':_0xcd53('0x2d')},{'name':_0xcd53('0x2e'),'value':_0xcd53('0x2f')}];var _0x74273a=_[_0xcd53('0x52')](_0x53604b,[_0xcd53('0x31'),_0xfac399[_0xcd53('0x33')]])[_0xcd53('0x37')];return db[_0xcd53('0x57')][_0xcd53('0x52')]({'where':{'name':_0x74273a,'userProfileId':_0x525a8f[_0xcd53('0x58')]},'raw':!![]})[_0xcd53('0x2a')](function(_0x51e0bb){if(_0x51e0bb&&_0x51e0bb[_0xcd53('0x59')]===0x0){return db[_0xcd53('0x34')]['create']({'name':_0xfac399['name'],'resourceId':_0xfac399['id'],'type':_0x51e0bb['name'],'sectionId':_0x51e0bb['id']},{})[_0xcd53('0x2a')](function(){return _0x3fe8c0;});}else{return _0x3fe8c0;}})[_0xcd53('0x4e')](function(_0x1cdd6d){logger[_0xcd53('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cdd6d);throw _0x1cdd6d;});}return _0x3fe8c0;});}})[_0xcd53('0x2a')](respondWithResult(_0x60d2f,0xc9))[_0xcd53('0x4e')](handleError(_0x60d2f,null));};exports['update']=function(_0x3babd0,_0x53d826){if(_0x3babd0['body']['id']){delete _0x3babd0[_0xcd53('0x5f')]['id'];}return db[_0xcd53('0x4b')][_0xcd53('0x52')]({'where':{'id':_0x3babd0['params']['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x53d826,null))[_0xcd53('0x2a')](saveUpdates(_0x3babd0[_0xcd53('0x5f')],null))[_0xcd53('0x2a')](respondWithResult(_0x53d826,null))['catch'](handleError(_0x53d826,null));};exports[_0xcd53('0x29')]=function(_0x2d7bea,_0x5c4a15){return db[_0xcd53('0x4b')][_0xcd53('0x52')]({'where':{'id':_0x2d7bea[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x5c4a15,null))[_0xcd53('0x2a')](removeEntity(_0x5c4a15,null))[_0xcd53('0x4e')](handleError(_0x5c4a15,null));};exports[_0xcd53('0x60')]=function(_0x5c3b5e,_0xba6927,_0x4e5d4e){var _0x36ea9c={'raw':![],'where':{}};var _0x50c203={};var _0x1a7d35={'count':0x0,'rows':[]};return db[_0xcd53('0x4b')][_0xcd53('0x61')]({'where':{'id':_0x5c3b5e[_0xcd53('0x4f')]['id']}})['then'](handleEntityNotFound(_0xba6927,null))['then'](function(_0x19fb3c){if(_0x19fb3c){_0x50c203[_0xcd53('0x3b')]=_['keys'](db['CmHopper']['rawAttributes']);_0x50c203[_0xcd53('0x3d')]=_[_0xcd53('0x3e')](_0x5c3b5e[_0xcd53('0x3d')]);_0x50c203[_0xcd53('0x45')]=_[_0xcd53('0x3f')](_0x50c203[_0xcd53('0x3b')],_0x50c203[_0xcd53('0x3d')]);_0x36ea9c[_0xcd53('0x40')]=_[_0xcd53('0x3f')](_0x50c203['model'],qs[_0xcd53('0x41')](_0x5c3b5e['query'][_0xcd53('0x41')]));_0x36ea9c['attributes']=_0x36ea9c['attributes']['length']?_0x36ea9c[_0xcd53('0x40')]:_0x50c203['model'];if(!_0x5c3b5e[_0xcd53('0x3d')][_0xcd53('0x43')](_0xcd53('0x62'))){_0x36ea9c['limit']=qs[_0xcd53('0x22')](_0x5c3b5e['query']['limit']);_0x36ea9c[_0xcd53('0x44')]=qs['offset'](_0x5c3b5e[_0xcd53('0x3d')][_0xcd53('0x44')]);}_0x36ea9c[_0xcd53('0x63')]=qs[_0xcd53('0x64')](_0x5c3b5e[_0xcd53('0x3d')]['sort']);_0x36ea9c['where']=qs[_0xcd53('0x45')](_[_0xcd53('0x46')](_0x5c3b5e[_0xcd53('0x3d')],_0x50c203[_0xcd53('0x45')]));_0x36ea9c[_0xcd53('0x47')][_0xcd53('0x65')]=_0x19fb3c['id'];if(_0x5c3b5e[_0xcd53('0x3d')][_0xcd53('0x30')]){_0x36ea9c[_0xcd53('0x47')]=_[_0xcd53('0x48')](_0x36ea9c[_0xcd53('0x47')],{'$or':_[_0xcd53('0x3c')](_0x36ea9c[_0xcd53('0x40')],function(_0x167e74){var _0x5d5ee9={};_0x5d5ee9[_0x167e74]={'$like':'%'+_0x5c3b5e[_0xcd53('0x3d')][_0xcd53('0x30')]+'%'};return _0x5d5ee9;})});}_0x36ea9c=_[_0xcd53('0x48')]({},_0x36ea9c,_0x5c3b5e[_0xcd53('0x4a')]);return db[_0xcd53('0x66')]['count']({'where':_0x36ea9c[_0xcd53('0x47')]})['then'](function(_0xc6c0f){_0x1a7d35['count']=_0xc6c0f;if(_0x5c3b5e[_0xcd53('0x3d')]['includeAll']){_0x36ea9c['include']=[{'all':!![]}];}return db[_0xcd53('0x66')]['findAll'](_0x36ea9c);})[_0xcd53('0x2a')](function(_0x1dbc70){_0x1a7d35[_0xcd53('0x67')]=_0x1dbc70;return _0x1a7d35;});}})[_0xcd53('0x2a')](respondWithFilteredResult(_0xba6927,_0x36ea9c))[_0xcd53('0x4e')](handleError(_0xba6927,null));};exports[_0xcd53('0x68')]=function(_0x23eb23,_0x479dc1,_0x34e80b){var _0x1b9bcd={'raw':!![],'where':{}};var _0x2d5304={};var _0x1ab1a4={'count':0x0,'rows':[]};return db[_0xcd53('0x4b')][_0xcd53('0x61')]({'where':{'id':_0x23eb23[_0xcd53('0x4f')]['id']}})['then'](handleEntityNotFound(_0x479dc1,null))[_0xcd53('0x2a')](function(_0x403bf2){if(_0x403bf2){_0x2d5304['model']=_[_0xcd53('0x3e')](db[_0xcd53('0x69')]['rawAttributes']);_0x2d5304[_0xcd53('0x3d')]=_[_0xcd53('0x3e')](_0x23eb23[_0xcd53('0x3d')]);_0x2d5304[_0xcd53('0x45')]=_['intersection'](_0x2d5304[_0xcd53('0x3b')],_0x2d5304[_0xcd53('0x3d')]);_0x1b9bcd['attributes']=_[_0xcd53('0x3f')](_0x2d5304[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0x23eb23['query'][_0xcd53('0x41')]));_0x1b9bcd[_0xcd53('0x40')]=_0x1b9bcd[_0xcd53('0x40')][_0xcd53('0x42')]?_0x1b9bcd['attributes']:_0x2d5304[_0xcd53('0x3b')];if(!_0x23eb23[_0xcd53('0x3d')][_0xcd53('0x43')](_0xcd53('0x62'))){_0x1b9bcd[_0xcd53('0x22')]=qs[_0xcd53('0x22')](_0x23eb23['query'][_0xcd53('0x22')]);_0x1b9bcd[_0xcd53('0x44')]=qs[_0xcd53('0x44')](_0x23eb23['query']['offset']);}_0x1b9bcd['order']=qs[_0xcd53('0x64')](_0x23eb23[_0xcd53('0x3d')][_0xcd53('0x64')]);_0x1b9bcd[_0xcd53('0x47')]=qs['filters'](_[_0xcd53('0x46')](_0x23eb23[_0xcd53('0x3d')],_0x2d5304[_0xcd53('0x45')]));_0x1b9bcd['where'][_0xcd53('0x65')]=_0x403bf2['id'];if(_0x23eb23['query'][_0xcd53('0x30')]){_0x1b9bcd[_0xcd53('0x47')]=_[_0xcd53('0x48')](_0x1b9bcd[_0xcd53('0x47')],{'$or':_['map'](_0x1b9bcd[_0xcd53('0x40')],function(_0x37776a){var _0x157007={};_0x157007[_0x37776a]={'$like':'%'+_0x23eb23[_0xcd53('0x3d')]['filter']+'%'};return _0x157007;})});}_0x1b9bcd=_[_0xcd53('0x48')]({},_0x1b9bcd,_0x23eb23[_0xcd53('0x4a')]);return db[_0xcd53('0x69')][_0xcd53('0x23')]({'where':_0x1b9bcd[_0xcd53('0x47')]})['then'](function(_0x310430){_0x1ab1a4[_0xcd53('0x23')]=_0x310430;if(_0x23eb23[_0xcd53('0x3d')][_0xcd53('0x51')]){_0x1b9bcd['include']=[{'all':!![]}];}return db[_0xcd53('0x69')][_0xcd53('0x4d')](_0x1b9bcd);})[_0xcd53('0x2a')](function(_0x26096f){_0x1ab1a4[_0xcd53('0x67')]=_0x26096f;return _0x1ab1a4;});}})['then'](respondWithFilteredResult(_0x479dc1,_0x1b9bcd))[_0xcd53('0x4e')](handleError(_0x479dc1,null));};exports[_0xcd53('0x6a')]=function(_0xe2593a,_0x5306c5,_0x16870e){var _0x3f3e7a={'raw':!![],'where':{}};var _0x268802={};var _0x59a306={'count':0x0,'rows':[]};return db[_0xcd53('0x4b')]['findOne']({'where':{'id':_0xe2593a[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x5306c5,null))[_0xcd53('0x2a')](function(_0x34b60a){if(_0x34b60a){_0x268802['model']=_[_0xcd53('0x3e')](db[_0xcd53('0x6b')][_0xcd53('0x50')]);_0x268802[_0xcd53('0x3d')]=_[_0xcd53('0x3e')](_0xe2593a[_0xcd53('0x3d')]);_0x268802[_0xcd53('0x45')]=_[_0xcd53('0x3f')](_0x268802[_0xcd53('0x3b')],_0x268802[_0xcd53('0x3d')]);_0x3f3e7a[_0xcd53('0x40')]=_['intersection'](_0x268802[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0xe2593a[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x3f3e7a[_0xcd53('0x40')]=_0x3f3e7a['attributes']['length']?_0x3f3e7a[_0xcd53('0x40')]:_0x268802[_0xcd53('0x3b')];if(!_0xe2593a[_0xcd53('0x3d')]['hasOwnProperty'](_0xcd53('0x62'))){_0x3f3e7a[_0xcd53('0x22')]=qs[_0xcd53('0x22')](_0xe2593a[_0xcd53('0x3d')][_0xcd53('0x22')]);_0x3f3e7a['offset']=qs[_0xcd53('0x44')](_0xe2593a['query'][_0xcd53('0x44')]);}_0x3f3e7a['order']=qs[_0xcd53('0x64')](_0xe2593a['query'][_0xcd53('0x64')]);_0x3f3e7a[_0xcd53('0x47')]=qs[_0xcd53('0x45')](_[_0xcd53('0x46')](_0xe2593a[_0xcd53('0x3d')],_0x268802[_0xcd53('0x45')]));_0x3f3e7a['where']['VoiceQueueId']=_0x34b60a['id'];if(_0xe2593a[_0xcd53('0x3d')][_0xcd53('0x30')]){_0x3f3e7a[_0xcd53('0x47')]=_[_0xcd53('0x48')](_0x3f3e7a[_0xcd53('0x47')],{'$or':_['map'](_0x3f3e7a[_0xcd53('0x40')],function(_0x35241a){var _0x5c4980={};_0x5c4980[_0x35241a]={'$like':'%'+_0xe2593a[_0xcd53('0x3d')][_0xcd53('0x30')]+'%'};return _0x5c4980;})});}_0x3f3e7a=_['merge']({},_0x3f3e7a,_0xe2593a[_0xcd53('0x4a')]);return db[_0xcd53('0x6b')]['count']({'where':_0x3f3e7a[_0xcd53('0x47')]})[_0xcd53('0x2a')](function(_0x4811f1){_0x59a306[_0xcd53('0x23')]=_0x4811f1;if(_0xe2593a[_0xcd53('0x3d')][_0xcd53('0x51')]){_0x3f3e7a['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xcd53('0x4d')](_0x3f3e7a);})['then'](function(_0x22af4d){_0x59a306[_0xcd53('0x67')]=_0x22af4d;return _0x59a306;});}})[_0xcd53('0x2a')](respondWithFilteredResult(_0x5306c5,_0x3f3e7a))[_0xcd53('0x4e')](handleError(_0x5306c5,null));};exports[_0xcd53('0x6c')]=function(_0x59d03c,_0x34f37b,_0x2a12c9){var _0x2956cb={'raw':!![],'where':{}};var _0x300064={};var _0x421d65={'count':0x0,'rows':[]};return db[_0xcd53('0x4b')][_0xcd53('0x61')]({'where':{'id':_0x59d03c[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x34f37b,null))[_0xcd53('0x2a')](function(_0x3ea328){if(_0x3ea328){_0x300064['model']=_[_0xcd53('0x3e')](db[_0xcd53('0x6d')]['rawAttributes']);_0x300064['query']=_[_0xcd53('0x3e')](_0x59d03c[_0xcd53('0x3d')]);_0x300064[_0xcd53('0x45')]=_[_0xcd53('0x3f')](_0x300064[_0xcd53('0x3b')],_0x300064['query']);_0x2956cb[_0xcd53('0x40')]=_[_0xcd53('0x3f')](_0x300064[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0x59d03c['query'][_0xcd53('0x41')]));_0x2956cb[_0xcd53('0x40')]=_0x2956cb['attributes'][_0xcd53('0x42')]?_0x2956cb['attributes']:_0x300064[_0xcd53('0x3b')];if(!_0x59d03c[_0xcd53('0x3d')][_0xcd53('0x43')]('nolimit')){_0x2956cb['limit']=qs[_0xcd53('0x22')](_0x59d03c[_0xcd53('0x3d')]['limit']);_0x2956cb[_0xcd53('0x44')]=qs[_0xcd53('0x44')](_0x59d03c[_0xcd53('0x3d')][_0xcd53('0x44')]);}_0x2956cb['order']=qs[_0xcd53('0x64')](_0x59d03c['query'][_0xcd53('0x64')]);_0x2956cb[_0xcd53('0x47')]=qs[_0xcd53('0x45')](_['pick'](_0x59d03c[_0xcd53('0x3d')],_0x300064[_0xcd53('0x45')]));_0x2956cb[_0xcd53('0x47')][_0xcd53('0x65')]=_0x3ea328['id'];if(_0x59d03c[_0xcd53('0x3d')][_0xcd53('0x30')]){_0x2956cb[_0xcd53('0x47')]=_['merge'](_0x2956cb['where'],{'$or':_['map'](_0x2956cb[_0xcd53('0x40')],function(_0x30c13c){var _0x712c52={};_0x712c52[_0x30c13c]={'$like':'%'+_0x59d03c[_0xcd53('0x3d')]['filter']+'%'};return _0x712c52;})});}_0x2956cb=_[_0xcd53('0x48')]({},_0x2956cb,_0x59d03c[_0xcd53('0x4a')]);return db['CmHopperBlack']['count']({'where':_0x2956cb[_0xcd53('0x47')]})[_0xcd53('0x2a')](function(_0x769f2b){_0x421d65[_0xcd53('0x23')]=_0x769f2b;if(_0x59d03c[_0xcd53('0x3d')][_0xcd53('0x51')]){_0x2956cb[_0xcd53('0x4c')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xcd53('0x4d')](_0x2956cb);})[_0xcd53('0x2a')](function(_0x47bcaf){_0x421d65[_0xcd53('0x67')]=_0x47bcaf;return _0x421d65;});}})[_0xcd53('0x2a')](respondWithFilteredResult(_0x34f37b,_0x2956cb))[_0xcd53('0x4e')](handleError(_0x34f37b,null));};exports[_0xcd53('0x6e')]=function(_0x422ec9,_0x598210,_0x2290b8){var _0x272426={};var _0x13f1e0={};var _0x1e6cb1;var _0x568a27;return db[_0xcd53('0x4b')][_0xcd53('0x61')]({'where':{'id':_0x422ec9[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x598210,null))[_0xcd53('0x2a')](function(_0x1f0746){if(_0x1f0746){_0x1e6cb1=_0x1f0746;_0x13f1e0[_0xcd53('0x3b')]=_[_0xcd53('0x3e')](db[_0xcd53('0x6f')]['rawAttributes']);_0x13f1e0[_0xcd53('0x3d')]=_[_0xcd53('0x3e')](_0x422ec9['query']);_0x13f1e0[_0xcd53('0x45')]=_[_0xcd53('0x3f')](_0x13f1e0[_0xcd53('0x3b')],_0x13f1e0[_0xcd53('0x3d')]);_0x272426[_0xcd53('0x40')]=_['intersection'](_0x13f1e0[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0x422ec9[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x272426[_0xcd53('0x40')]=_0x272426['attributes'][_0xcd53('0x42')]?_0x272426[_0xcd53('0x40')]:_0x13f1e0['model'];_0x272426[_0xcd53('0x63')]=qs['sort'](_0x422ec9['query'][_0xcd53('0x64')]);_0x272426[_0xcd53('0x47')]=qs[_0xcd53('0x45')](_[_0xcd53('0x46')](_0x422ec9[_0xcd53('0x3d')],_0x13f1e0[_0xcd53('0x45')]));if(_0x422ec9['query'][_0xcd53('0x30')]){_0x272426[_0xcd53('0x47')]=_[_0xcd53('0x48')](_0x272426[_0xcd53('0x47')],{'$or':_['map'](_0x272426[_0xcd53('0x40')],function(_0x4b39fd){var _0x3f2eef={};_0x3f2eef[_0x4b39fd]={'$like':'%'+_0x422ec9[_0xcd53('0x3d')]['filter']+'%'};return _0x3f2eef;})});}_0x272426=_[_0xcd53('0x48')]({},_0x272426,_0x422ec9[_0xcd53('0x4a')]);return _0x1e6cb1[_0xcd53('0x6e')](_0x272426);}})[_0xcd53('0x2a')](function(_0x438746){if(_0x438746){_0x568a27=_0x438746[_0xcd53('0x42')];if(!_0x422ec9[_0xcd53('0x3d')][_0xcd53('0x43')](_0xcd53('0x62'))){_0x272426[_0xcd53('0x22')]=qs[_0xcd53('0x22')](_0x422ec9[_0xcd53('0x3d')][_0xcd53('0x22')]);_0x272426[_0xcd53('0x44')]=qs[_0xcd53('0x44')](_0x422ec9[_0xcd53('0x3d')][_0xcd53('0x44')]);}return _0x1e6cb1[_0xcd53('0x6e')](_0x272426);}})[_0xcd53('0x2a')](function(_0x5a1225){if(_0x5a1225){return _0x5a1225?{'count':_0x568a27,'rows':_0x5a1225}:null;}})[_0xcd53('0x2a')](respondWithResult(_0x598210,null))[_0xcd53('0x4e')](handleError(_0x598210,null));};exports[_0xcd53('0x70')]=function(_0x1e0160,_0x242806,_0x1ce31b){var _0x1c1c82=_0x1e0160[_0xcd53('0x5f')]['teams'];var _0x321574=_[_0xcd53('0x3c')](_0x1c1c82,'id');return db['Team'][_0xcd53('0x4d')]({'where':{'id':_0x321574},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcd53('0x71'),'attributes':['id','name','online',_0xcd53('0x72'),_0xcd53('0x73')],'raw':!![]}]})[_0xcd53('0x2a')](function(_0x3655ca){if(_0x3655ca){var _0x5dc8bf=_[_0xcd53('0x74')](_0x3655ca,function(_0x475c62){var _0x5bc08b=_0x475c62[_0xcd53('0x2b')]({'plain':!![]});_0x5bc08b[_0xcd53('0x71')][_0xcd53('0x75')](function(_0x5b3065){_0x5b3065[_0xcd53('0x76')]=_[_0xcd53('0x52')](_0x1c1c82,{'id':_0x5bc08b['id']})[_0xcd53('0x76')];});return _0x5bc08b[_0xcd53('0x71')];});return db[_0xcd53('0x4b')]['find']({'where':{'id':_0x1e0160[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](function(_0x3b5882){return db[_0xcd53('0x77')][_0xcd53('0x78')](function(_0x51936b){return _0x3b5882['addTeams'](_0x321574,{'transaction':_0x51936b})[_0xcd53('0x2a')](function(){return BPromise[_0xcd53('0x79')](_0x1c1c82,function(_0x436ccc){return db[_0xcd53('0x7a')][_0xcd53('0x7b')]({'TeamId':_0x436ccc['id'],'VoiceQueueId':_0x1e0160['params']['id'],'penalty':_0x436ccc[_0xcd53('0x76')]},{'transaction':_0x51936b});});})[_0xcd53('0x2a')](function(){return BPromise[_0xcd53('0x79')](_0x5dc8bf,function(_0x4e9442){return db[_0xcd53('0x7c')][_0xcd53('0x7d')]({'where':{'UserId':_0x4e9442['id'],'VoiceQueueId':_0x1e0160['params']['id']},'defaults':{'penalty':_0x4e9442[_0xcd53('0x76')]},'transaction':_0x51936b});});})[_0xcd53('0x2a')](function(){return BPromise['each'](_[_0xcd53('0x30')](_0x5dc8bf,{'online':!![]}),function(_0x36c0ec){return db['UserVoiceQueueRt'][_0xcd53('0x7b')]({'membername':_0x36c0ec[_0xcd53('0x37')],'UserId':_0x36c0ec['id'],'queue_name':_0x3b5882[_0xcd53('0x37')],'VoiceQueueId':_0x3b5882['id'],'interface':_['isNil'](_0x36c0ec[_0xcd53('0x73')])?util[_0xcd53('0x7e')](_0xcd53('0x7f'),_0x36c0ec[_0xcd53('0x37')]):_0x36c0ec['interface'],'paused':_0x36c0ec[_0xcd53('0x72')]||![],'penalty':_0x36c0ec[_0xcd53('0x76')]},{'transaction':_0x51936b});});})[_0xcd53('0x2a')](function(){_0x5dc8bf[_0xcd53('0x75')](function(_0x57d3eb){socket['emit'](_0xcd53('0x80'),{'UserId':_0x57d3eb['id'],'VoiceQueueId':_0x3b5882['id']});});});});});}})['then'](respondWithStatusCode(_0x242806,null))[_0xcd53('0x4e')](handleError(_0x242806,null));};exports[_0xcd53('0x81')]=function(_0x55f7e8,_0x11f156,_0x4d3189){return db[_0xcd53('0x6f')][_0xcd53('0x4d')]({'where':{'id':_0x55f7e8[_0xcd53('0x3d')][_0xcd53('0x82')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcd53('0x71'),'attributes':['id'],'raw':!![]}]})[_0xcd53('0x2a')](handleEntityNotFound(_0x11f156,null))[_0xcd53('0x2a')](function(_0x2726eb){var _0x1e65b3=_[_0xcd53('0x3c')](_0x2726eb,'id');var _0x52389a=[];var _0x34110f=[];var _0x415bff=squel[_0xcd53('0x83')]();_0x415bff[_0xcd53('0x84')](_0xcd53('0x85'))[_0xcd53('0x86')]('team_has_voice_queues','tq')[_0xcd53('0x87')](_0xcd53('0x88'),'ut',_0xcd53('0x89'))[_0xcd53('0x47')](_0xcd53('0x8a'),_0x55f7e8[_0xcd53('0x4f')]['id']);for(var _0x52b893=0x0;_0x52b893<_0x2726eb['length'];_0x52b893+=0x1){let _0x5f3553=_0x2726eb[_0x52b893];for(var _0x2d61a1=0x0;_0x2d61a1<_0x5f3553[_0xcd53('0x71')][_0xcd53('0x42')];_0x2d61a1+=0x1){let _0x1cb789=_0x5f3553[_0xcd53('0x71')][_0x2d61a1];var _0x3e0aa3=_0x415bff[_0xcd53('0x5b')]();_0x3e0aa3['where']('ut.UserId\x20=\x20?',_0x1cb789['id']);_0x34110f[_0xcd53('0x8b')](db[_0xcd53('0x77')][_0xcd53('0x3d')](_0x3e0aa3[_0xcd53('0x8c')](),{'type':db[_0xcd53('0x77')]['QueryTypes'][_0xcd53('0x8d')]})['then'](function(_0x5b634e){if(_0x5b634e[_0xcd53('0x42')]===0x1){return _0x1cb789['id'];}else{var _0x398942=_[_0xcd53('0x8e')](_[_0xcd53('0x3c')](_0x5b634e,'TeamId'),function(_0x4f6cc0){return _['includes'](_0x1e65b3,_0x4f6cc0);});if(_0x398942){return _0x1cb789['id'];}}}));}}return BPromise[_0xcd53('0x8f')](_0x34110f)['then'](function(_0x24000e){_0x52389a=_(_0x52389a)[_0xcd53('0x90')](_0x24000e)[_0xcd53('0x91')]()[_0xcd53('0x31')]();return db[_0xcd53('0x4b')]['find']({'where':{'id':_0x55f7e8[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](function(_0x1fc972){return db['sequelize'][_0xcd53('0x78')](function(_0x57ce28){return _0x1fc972[_0xcd53('0x81')](_0x55f7e8[_0xcd53('0x3d')][_0xcd53('0x82')],{'transaction':_0x57ce28})['then'](function(){if(!_[_0xcd53('0x92')](_0x52389a)){return _0x1fc972['removeAgents'](_0x52389a,{'transaction':_0x57ce28})[_0xcd53('0x2a')](function(){return db[_0xcd53('0x93')][_0xcd53('0x29')]({'where':{'VoiceQueueId':_0x55f7e8['params']['id'],'UserId':_0x52389a},'transaction':_0x57ce28});});}})['then'](function(){_0x52389a[_0xcd53('0x75')](function(_0x29f19e){socket[_0xcd53('0x94')](_0xcd53('0x95'),{'UserId':_0x29f19e,'VoiceQueueId':_0x1fc972['id']});});});});});});})[_0xcd53('0x2a')](respondWithStatusCode(_0x11f156,null))[_0xcd53('0x4e')](handleError(_0x11f156,null));};exports['addAgents']=function(_0x27ffa3,_0x35e4ce,_0x27aff7){var _0x165674,_0x3d9216;return db[_0xcd53('0x4b')][_0xcd53('0x52')]({'where':{'id':_0x27ffa3[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x35e4ce,null))[_0xcd53('0x2a')](function(_0x2187b7){if(_0x2187b7){_0x3d9216=_0x2187b7;return _0x2187b7['addAgents'](_0x27ffa3[_0xcd53('0x5f')][_0xcd53('0x82')],_[_0xcd53('0x5c')](_0x27ffa3[_0xcd53('0x5f')],[_0xcd53('0x82'),'id'])||{})[_0xcd53('0x96')](function(_0x3a3a3d){for(var _0xecc528=0x0;_0xecc528<_0x27ffa3['body']['ids'][_0xcd53('0x42')];_0xecc528+=0x1){socket[_0xcd53('0x94')](_0xcd53('0x80'),{'UserId':Number(_0x27ffa3[_0xcd53('0x5f')][_0xcd53('0x82')][_0xecc528]),'VoiceQueueId':Number(_0x27ffa3[_0xcd53('0x4f')]['id'])});}return _0x3a3a3d;});}})[_0xcd53('0x2a')](function(_0x19a4ee){_0x165674=_0x19a4ee||[];if(_0x3d9216){return db[_0xcd53('0x97')][_0xcd53('0x4d')]({'where':{'id':_0x27ffa3['body']['ids']},'attributes':['id','name',_0xcd53('0x98'),_0xcd53('0x72'),'interface'],'raw':!![]});}})[_0xcd53('0x2a')](function(_0x7ac573){if(!_[_0xcd53('0x92')](_0x7ac573)){var _0x17ecc2=[];for(var _0xaa3c7e=0x0;_0xaa3c7e<_0x7ac573[_0xcd53('0x42')];_0xaa3c7e++){if(_0x7ac573[_0xaa3c7e][_0xcd53('0x98')]){_0x17ecc2[_0xcd53('0x8b')](db[_0xcd53('0x93')][_0xcd53('0x7b')]({'membername':_0x7ac573[_0xaa3c7e][_0xcd53('0x37')],'UserId':_0x7ac573[_0xaa3c7e]['id'],'queue_name':_0x3d9216[_0xcd53('0x37')],'VoiceQueueId':_0x3d9216['id'],'interface':_[_0xcd53('0x99')](_0x7ac573[_0xaa3c7e][_0xcd53('0x73')])?util[_0xcd53('0x7e')](_0xcd53('0x7f'),_0x7ac573[_0xaa3c7e][_0xcd53('0x37')]):_0x7ac573[_0xaa3c7e][_0xcd53('0x73')],'paused':_0x7ac573[_0xaa3c7e][_0xcd53('0x72')]||![],'penalty':_0x27ffa3['body'][_0xcd53('0x76')]||0x0}));}}return BPromise['all'](_0x17ecc2);}})[_0xcd53('0x2a')](function(){return _0x165674;})['then'](respondWithResult(_0x35e4ce,null))[_0xcd53('0x4e')](handleError(_0x35e4ce,null));};exports[_0xcd53('0x9a')]=function(_0x52f7f1,_0x3bb26e,_0x159e96){return db[_0xcd53('0x4b')]['find']({'where':{'id':_0x52f7f1['params']['id']}})['then'](handleEntityNotFound(_0x3bb26e,null))[_0xcd53('0x2a')](function(_0x49f707){if(_0x49f707){return _0x49f707[_0xcd53('0x9a')](_0x52f7f1[_0xcd53('0x3d')][_0xcd53('0x82')])['then'](function(){if(_[_0xcd53('0x9b')](_0x52f7f1[_0xcd53('0x3d')][_0xcd53('0x82')])){for(var _0x6a71ff=0x0;_0x6a71ff<_0x52f7f1[_0xcd53('0x3d')][_0xcd53('0x82')][_0xcd53('0x42')];_0x6a71ff+=0x1){socket['emit'](_0xcd53('0x95'),{'UserId':Number(_0x52f7f1[_0xcd53('0x3d')][_0xcd53('0x82')][_0x6a71ff]),'VoiceQueueId':Number(_0x52f7f1[_0xcd53('0x4f')]['id'])});}}else{socket[_0xcd53('0x94')](_0xcd53('0x95'),{'UserId':Number(_0x52f7f1['query'][_0xcd53('0x82')]),'VoiceQueueId':Number(_0x52f7f1[_0xcd53('0x4f')]['id'])});}});}})[_0xcd53('0x2a')](function(_0x1159e0){return db[_0xcd53('0x93')][_0xcd53('0x29')]({'where':{'VoiceQueueId':_0x52f7f1[_0xcd53('0x4f')]['id'],'UserId':_0x52f7f1[_0xcd53('0x3d')]['ids']}})[_0xcd53('0x2a')](function(){return _0x1159e0;});})[_0xcd53('0x2a')](respondWithStatusCode(_0x3bb26e,null))[_0xcd53('0x4e')](handleError(_0x3bb26e,null));};exports['getAgents']=function(_0x4bf088,_0x57d00a,_0x452e18){var _0xbe8fe7={};var _0x47ab07={};var _0x46845c;var _0x57897d;return db['VoiceQueue']['findOne']({'where':{'id':_0x4bf088[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x57d00a,null))[_0xcd53('0x2a')](function(_0x3be017){if(_0x3be017){_0x46845c=_0x3be017;_0x47ab07[_0xcd53('0x3b')]=_[_0xcd53('0x3e')](db[_0xcd53('0x97')][_0xcd53('0x50')]);_0x47ab07[_0xcd53('0x3d')]=_['keys'](_0x4bf088[_0xcd53('0x3d')]);_0x47ab07[_0xcd53('0x45')]=_[_0xcd53('0x3f')](_0x47ab07['model'],_0x47ab07[_0xcd53('0x3d')]);_0xbe8fe7['attributes']=_['intersection'](_0x47ab07['model'],qs['fields'](_0x4bf088[_0xcd53('0x3d')][_0xcd53('0x41')]));_0xbe8fe7[_0xcd53('0x40')]=_0xbe8fe7[_0xcd53('0x40')][_0xcd53('0x42')]?_0xbe8fe7['attributes']:_0x47ab07[_0xcd53('0x3b')];_0xbe8fe7[_0xcd53('0x63')]=qs[_0xcd53('0x64')](_0x4bf088['query']['sort']);_0xbe8fe7['where']=qs[_0xcd53('0x45')](_[_0xcd53('0x46')](_0x4bf088['query'],_0x47ab07[_0xcd53('0x45')]));if(_0x4bf088[_0xcd53('0x3d')][_0xcd53('0x30')]){_0xbe8fe7[_0xcd53('0x47')]=_['merge'](_0xbe8fe7[_0xcd53('0x47')],{'$or':_['map'](_0xbe8fe7['attributes'],function(_0x54f873){var _0x292b8b={};_0x292b8b[_0x54f873]={'$like':'%'+_0x4bf088[_0xcd53('0x3d')][_0xcd53('0x30')]+'%'};return _0x292b8b;})});}_0xbe8fe7=_[_0xcd53('0x48')]({},_0xbe8fe7,_0x4bf088[_0xcd53('0x4a')]);return _0x46845c[_0xcd53('0x9c')](_0xbe8fe7);}})[_0xcd53('0x2a')](function(_0x3bc2db){if(_0x3bc2db){_0x57897d=_0x3bc2db[_0xcd53('0x42')];if(!_0x4bf088['query'][_0xcd53('0x43')](_0xcd53('0x62'))){_0xbe8fe7[_0xcd53('0x22')]=qs[_0xcd53('0x22')](_0x4bf088[_0xcd53('0x3d')][_0xcd53('0x22')]);_0xbe8fe7[_0xcd53('0x44')]=qs[_0xcd53('0x44')](_0x4bf088[_0xcd53('0x3d')][_0xcd53('0x44')]);}return _0x46845c['getAgents'](_0xbe8fe7);}})[_0xcd53('0x2a')](function(_0x46dd44){if(_0x46dd44){return _0x46dd44?{'count':_0x57897d,'rows':_0x46dd44}:null;}})['then'](respondWithResult(_0x57d00a,null))[_0xcd53('0x4e')](handleError(_0x57d00a,null));};exports['getMembers']=function(_0x3967eb,_0x29942a,_0x1ae125){var _0x100adb={};var _0x49b5fd={};var _0x4ce751;var _0x1844c7;return db[_0xcd53('0x4b')][_0xcd53('0x61')]({'where':{'id':_0x3967eb[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x29942a,null))[_0xcd53('0x2a')](function(_0x5c2efd){if(_0x5c2efd){_0x4ce751=_0x5c2efd;_0x49b5fd['model']=_[_0xcd53('0x3e')](db[_0xcd53('0x93')][_0xcd53('0x50')]);_0x49b5fd['query']=_['keys'](_0x3967eb[_0xcd53('0x3d')]);_0x49b5fd['filters']=_[_0xcd53('0x3f')](_0x49b5fd[_0xcd53('0x3b')],_0x49b5fd[_0xcd53('0x3d')]);_0x100adb[_0xcd53('0x40')]=_[_0xcd53('0x3f')](_0x49b5fd['model'],qs[_0xcd53('0x41')](_0x3967eb[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x100adb[_0xcd53('0x40')]=_0x100adb[_0xcd53('0x40')][_0xcd53('0x42')]?_0x100adb[_0xcd53('0x40')]:_0x49b5fd[_0xcd53('0x3b')];_0x100adb[_0xcd53('0x63')]=qs[_0xcd53('0x64')](_0x3967eb[_0xcd53('0x3d')][_0xcd53('0x64')]);_0x100adb[_0xcd53('0x47')]=qs[_0xcd53('0x45')](_['pick'](_0x3967eb[_0xcd53('0x3d')],_0x49b5fd['filters']));if(_0x3967eb[_0xcd53('0x3d')][_0xcd53('0x30')]){_0x100adb['where']=_[_0xcd53('0x48')](_0x100adb['where'],{'$or':_['map'](_0x100adb[_0xcd53('0x40')],function(_0x2bbe2a){var _0x2a5af7={};_0x2a5af7[_0x2bbe2a]={'$like':'%'+_0x3967eb[_0xcd53('0x3d')][_0xcd53('0x30')]+'%'};return _0x2a5af7;})});}_0x100adb=_[_0xcd53('0x48')]({},_0x100adb,_0x3967eb[_0xcd53('0x4a')]);return _0x4ce751[_0xcd53('0x9d')](_0x100adb);}})[_0xcd53('0x2a')](function(_0x5d0eb2){if(_0x5d0eb2){_0x1844c7=_0x5d0eb2[_0xcd53('0x42')];if(!_0x3967eb[_0xcd53('0x3d')][_0xcd53('0x43')](_0xcd53('0x62'))){_0x100adb[_0xcd53('0x22')]=qs[_0xcd53('0x22')](_0x3967eb[_0xcd53('0x3d')]['limit']);_0x100adb[_0xcd53('0x44')]=qs[_0xcd53('0x44')](_0x3967eb[_0xcd53('0x3d')][_0xcd53('0x44')]);}return _0x4ce751['getMembers'](_0x100adb);}})[_0xcd53('0x2a')](function(_0x2461b9){return _0x2461b9?{'count':_0x1844c7,'rows':_0x2461b9}:null;})['then'](respondWithResult(_0x29942a,null))[_0xcd53('0x4e')](handleError(_0x29942a,null));};exports[_0xcd53('0x9e')]=function(_0xd59843,_0x2c2c84,_0x2a2d20){var _0x44eecb={};var _0xa5f6e2={};var _0x43a8d9;var _0x249d0a;return db['VoiceQueue'][_0xcd53('0x61')]({'where':{'id':_0xd59843['params']['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x2c2c84,null))[_0xcd53('0x2a')](function(_0x3162e){if(_0x3162e){_0x43a8d9=_0x3162e;_0xa5f6e2[_0xcd53('0x3b')]=_[_0xcd53('0x3e')](db[_0xcd53('0x9f')][_0xcd53('0x50')]);_0xa5f6e2[_0xcd53('0x3d')]=_[_0xcd53('0x3e')](_0xd59843['query']);_0xa5f6e2[_0xcd53('0x45')]=_['intersection'](_0xa5f6e2[_0xcd53('0x3b')],_0xa5f6e2['query']);_0x44eecb[_0xcd53('0x40')]=_[_0xcd53('0x3f')](_0xa5f6e2[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0xd59843[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x44eecb['attributes']=_0x44eecb[_0xcd53('0x40')][_0xcd53('0x42')]?_0x44eecb[_0xcd53('0x40')]:_0xa5f6e2[_0xcd53('0x3b')];_0x44eecb[_0xcd53('0x63')]=qs[_0xcd53('0x64')](_0xd59843[_0xcd53('0x3d')][_0xcd53('0x64')]);_0x44eecb['where']=qs[_0xcd53('0x45')](_[_0xcd53('0x46')](_0xd59843[_0xcd53('0x3d')],_0xa5f6e2[_0xcd53('0x45')]));if(_0xd59843['query'][_0xcd53('0x30')]){_0x44eecb[_0xcd53('0x47')]=_['merge'](_0x44eecb['where'],{'$or':_[_0xcd53('0x3c')](_0x44eecb[_0xcd53('0x40')],function(_0x1b0c54){var _0x46cf0c={};_0x46cf0c[_0x1b0c54]={'$like':'%'+_0xd59843[_0xcd53('0x3d')][_0xcd53('0x30')]+'%'};return _0x46cf0c;})});}_0x44eecb=_[_0xcd53('0x48')]({},_0x44eecb,_0xd59843[_0xcd53('0x4a')]);return _0x43a8d9[_0xcd53('0x9e')](_0x44eecb);}})[_0xcd53('0x2a')](function(_0x58ee31){if(_0x58ee31){_0x249d0a=_0x58ee31[_0xcd53('0x42')];if(!_0xd59843[_0xcd53('0x3d')][_0xcd53('0x43')](_0xcd53('0x62'))){_0x44eecb['limit']=qs[_0xcd53('0x22')](_0xd59843[_0xcd53('0x3d')][_0xcd53('0x22')]);_0x44eecb[_0xcd53('0x44')]=qs[_0xcd53('0x44')](_0xd59843[_0xcd53('0x3d')][_0xcd53('0x44')]);}return _0x43a8d9[_0xcd53('0x9e')](_0x44eecb);}})[_0xcd53('0x2a')](function(_0x44e73e){if(_0x44e73e){return _0x44e73e?{'count':_0x249d0a,'rows':_0x44e73e}:null;}})['then'](respondWithResult(_0x2c2c84,null))['catch'](handleError(_0x2c2c84,null));};exports[_0xcd53('0xa0')]=function(_0x46a8c2,_0x4608c7,_0x234a53){var _0x16615a,_0x581467;return db[_0xcd53('0x4b')][_0xcd53('0x52')]({'where':{'id':_0x46a8c2[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x4608c7,null))['then'](function(_0x5703ec){if(_0x5703ec){_0x581467=_0x5703ec;return _0x5703ec[_0xcd53('0xa0')](_0x46a8c2['body'][_0xcd53('0x82')],_['omit'](_0x46a8c2[_0xcd53('0x5f')],['ids','id'])||{});}return null;})[_0xcd53('0x96')](function(_0x2c5be1){var _0x1a5a53;_0x16615a=_0x2c5be1||[];var _0x457d71=[];if(_0x2c5be1){for(var _0x2910ed=0x0;_0x2910ed<_0x2c5be1[_0xcd53('0x42')];_0x2910ed+=0x1){var _0x1e266f=_0x2c5be1[_0x2910ed][_0xcd53('0x2b')]({'plain':!![]});_0x581467[_0xcd53('0xa1')]=_0x46a8c2[_0xcd53('0x5f')]['dialCheckDuplicateType']?_0x46a8c2['body'][_0xcd53('0xa1')]:_0x581467[_0xcd53('0xa1')];switch(_0x581467['dialCheckDuplicateType']){case _0xcd53('0xa2'):_0x1a5a53=squel['insert']()[_0xcd53('0xa3')](_0xcd53('0xa4'))[_0xcd53('0xa5')](['phone',_0xcd53('0xa6'),_0xcd53('0xa7'),_0xcd53('0xa8'),_0xcd53('0x65'),_0xcd53('0x5d'),_0xcd53('0x5e')],squel['select']()['field'](_0xcd53('0xa9'),'phone')['field'](_0xcd53('0xaa'),_0xcd53('0xa6'))[_0xcd53('0x84')]('id',_0xcd53('0xa7'))[_0xcd53('0x84')](_0x1e266f[_0xcd53('0xab')][_0xcd53('0x8c')](),_0xcd53('0xa8'))[_0xcd53('0x84')](_0x46a8c2[_0xcd53('0x4f')]['id'][_0xcd53('0x8c')](),_0xcd53('0x65'))[_0xcd53('0x84')](_0xcd53('0xaa'),_0xcd53('0x5d'))[_0xcd53('0x84')](_0xcd53('0xaa'),'updatedAt')['from'](_0xcd53('0xac'))['where'](_0xcd53('0xad'))[_0xcd53('0x47')](_0xcd53('0xae'),_0x1e266f[_0xcd53('0xab')][_0xcd53('0x8c')]())[_0xcd53('0x47')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xcd53('0xaf'),squel['select']()['field'](_0xcd53('0xb0'))[_0xcd53('0x86')](_0xcd53('0xb1'))['where']('VoiceQueueId\x20=\x20?',_0x46a8c2['params']['id'][_0xcd53('0x8c')]()))[_0xcd53('0x47')](_0xcd53('0xaf'),squel[_0xcd53('0x83')]()[_0xcd53('0x84')](_0xcd53('0xb2'))[_0xcd53('0x86')]('cm_hopper')[_0xcd53('0x47')]('VoiceQueueId\x20=\x20?',_0x46a8c2[_0xcd53('0x4f')]['id']['toString']())))[_0xcd53('0x8c')]();break;case _0xcd53('0xb3'):_0x1a5a53=squel[_0xcd53('0xb4')]()[_0xcd53('0xa3')](_0xcd53('0xa4'))['fromQuery']([_0xcd53('0xa9'),_0xcd53('0xa6'),'ContactId',_0xcd53('0xa8'),'VoiceQueueId',_0xcd53('0x5d'),_0xcd53('0x5e')],squel['select']()['field'](_0xcd53('0xa9'),_0xcd53('0xa9'))['field'](_0xcd53('0xaa'),'scheduledAt')[_0xcd53('0x84')]('id',_0xcd53('0xa7'))[_0xcd53('0x84')](_0x1e266f['CmListId'][_0xcd53('0x8c')](),_0xcd53('0xa8'))['field'](_0x46a8c2[_0xcd53('0x4f')]['id'][_0xcd53('0x8c')](),_0xcd53('0x65'))['field']('NOW()',_0xcd53('0x5d'))['field']('NOW()',_0xcd53('0x5e'))[_0xcd53('0x86')](_0xcd53('0xac'))[_0xcd53('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0xcd53('0xae'),_0x1e266f['CmListId'][_0xcd53('0x8c')]())[_0xcd53('0x47')](_0xcd53('0xb5'))['where'](_0xcd53('0xaf'),squel['select']()['field'](_0xcd53('0xb2'))[_0xcd53('0x86')](_0xcd53('0xa4'))[_0xcd53('0x47')]('VoiceQueueId\x20=\x20?',_0x46a8c2[_0xcd53('0x4f')]['id']['toString']())))[_0xcd53('0x8c')]();break;default:_0x1a5a53=squel['insert']()[_0xcd53('0xa3')]('cm_hopper')['fromQuery']([_0xcd53('0xa9'),_0xcd53('0xa6'),_0xcd53('0xa7'),_0xcd53('0xa8'),_0xcd53('0x65'),'createdAt',_0xcd53('0x5e')],squel['select']()[_0xcd53('0x84')]('phone',_0xcd53('0xa9'))[_0xcd53('0x84')](_0xcd53('0xaa'),'scheduledAt')[_0xcd53('0x84')]('id','ContactId')[_0xcd53('0x84')](_0x1e266f[_0xcd53('0xab')][_0xcd53('0x8c')](),'ListId')[_0xcd53('0x84')](_0x46a8c2[_0xcd53('0x4f')]['id']['toString'](),_0xcd53('0x65'))['field'](_0xcd53('0xaa'),_0xcd53('0x5d'))['field'](_0xcd53('0xaa'),_0xcd53('0x5e'))[_0xcd53('0x86')](_0xcd53('0xac'))[_0xcd53('0x47')]('deletedAt\x20IS\x20NULL')[_0xcd53('0x47')](_0xcd53('0xae'),_0x1e266f['CmListId']['toString']())[_0xcd53('0x47')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x457d71[_0xcd53('0x8b')](db[_0xcd53('0x77')][_0xcd53('0x3d')](_0x1a5a53));}return BPromise[_0xcd53('0x8f')](_0x457d71);}})[_0xcd53('0x2a')](function(){return _0x16615a;})[_0xcd53('0x2a')](respondWithResult(_0x4608c7,null))['catch'](handleError(_0x4608c7,null));};exports['removeLists']=function(_0x8e58be,_0x9c5266,_0x40b810){return db[_0xcd53('0x4b')][_0xcd53('0x52')]({'where':{'id':_0x8e58be[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x9c5266,null))[_0xcd53('0x2a')](function(_0x304f4d){if(_0x304f4d){return _0x304f4d[_0xcd53('0xb6')](_0x8e58be[_0xcd53('0x3d')][_0xcd53('0x82')]);}})[_0xcd53('0x2a')](function(_0x32a2c6){if(_0x32a2c6){return db[_0xcd53('0x66')]['destroy']({'where':{'ListId':_0x8e58be[_0xcd53('0x3d')]['ids'],'VoiceQueueId':_0x8e58be['params']['id']}})[_0xcd53('0x2a')](function(){return _0x32a2c6;});}})[_0xcd53('0x2a')](respondWithStatusCode(_0x9c5266,null))[_0xcd53('0x4e')](handleError(_0x9c5266,null));};exports[_0xcd53('0xb7')]=function(_0x1a26ee,_0x41413c,_0xd843bf){var _0x3b640b={};var _0x5498bb={};var _0x3d271c;var _0xc0b682;return db[_0xcd53('0x4b')][_0xcd53('0x61')]({'where':{'id':_0x1a26ee[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x41413c,null))[_0xcd53('0x2a')](function(_0x5a307a){if(_0x5a307a){_0x3d271c=_0x5a307a;_0x5498bb[_0xcd53('0x3b')]=_[_0xcd53('0x3e')](db['CmList'][_0xcd53('0x50')]);_0x5498bb['query']=_[_0xcd53('0x3e')](_0x1a26ee[_0xcd53('0x3d')]);_0x5498bb[_0xcd53('0x45')]=_[_0xcd53('0x3f')](_0x5498bb['model'],_0x5498bb[_0xcd53('0x3d')]);_0x3b640b[_0xcd53('0x40')]=_['intersection'](_0x5498bb[_0xcd53('0x3b')],qs[_0xcd53('0x41')](_0x1a26ee[_0xcd53('0x3d')][_0xcd53('0x41')]));_0x3b640b[_0xcd53('0x40')]=_0x3b640b[_0xcd53('0x40')][_0xcd53('0x42')]?_0x3b640b[_0xcd53('0x40')]:_0x5498bb['model'];_0x3b640b['order']=qs[_0xcd53('0x64')](_0x1a26ee[_0xcd53('0x3d')]['sort']);_0x3b640b[_0xcd53('0x47')]=qs['filters'](_[_0xcd53('0x46')](_0x1a26ee['query'],_0x5498bb[_0xcd53('0x45')]));if(_0x1a26ee['query']['filter']){_0x3b640b['where']=_[_0xcd53('0x48')](_0x3b640b[_0xcd53('0x47')],{'$or':_[_0xcd53('0x3c')](_0x3b640b[_0xcd53('0x40')],function(_0x4c3d2b){var _0x5f4368={};_0x5f4368[_0x4c3d2b]={'$like':'%'+_0x1a26ee['query'][_0xcd53('0x30')]+'%'};return _0x5f4368;})});}_0x3b640b=_[_0xcd53('0x48')]({},_0x3b640b,_0x1a26ee['options']);return _0x3d271c['getBlackLists'](_0x3b640b);}})['then'](function(_0x21958c){if(_0x21958c){_0xc0b682=_0x21958c['length'];if(!_0x1a26ee[_0xcd53('0x3d')][_0xcd53('0x43')](_0xcd53('0x62'))){_0x3b640b[_0xcd53('0x22')]=qs[_0xcd53('0x22')](_0x1a26ee[_0xcd53('0x3d')]['limit']);_0x3b640b[_0xcd53('0x44')]=qs[_0xcd53('0x44')](_0x1a26ee[_0xcd53('0x3d')]['offset']);}return _0x3d271c[_0xcd53('0xb7')](_0x3b640b);}})[_0xcd53('0x2a')](function(_0x4284ce){if(_0x4284ce){return _0x4284ce?{'count':_0xc0b682,'rows':_0x4284ce}:null;}})[_0xcd53('0x2a')](respondWithResult(_0x41413c,null))[_0xcd53('0x4e')](handleError(_0x41413c,null));};exports[_0xcd53('0xb8')]=function(_0x29d59f,_0x29778d,_0x1d0126){var _0x20aecd,_0x308943;return db[_0xcd53('0x4b')][_0xcd53('0x52')]({'where':{'id':_0x29d59f[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x29778d,null))[_0xcd53('0x2a')](function(_0x55c232){if(_0x55c232){_0x308943=_0x55c232;return _0x55c232[_0xcd53('0xb8')](_0x29d59f[_0xcd53('0x5f')][_0xcd53('0x82')],_['omit'](_0x29d59f[_0xcd53('0x5f')],['ids','id'])||{});}return null;})[_0xcd53('0x96')](function(_0x375c2b){var _0x110a58;_0x20aecd=_0x375c2b||[];var _0x75e477=[];if(_0x375c2b){for(var _0x930005=0x0;_0x930005<_0x375c2b['length'];_0x930005+=0x1){var _0x5afd6d=_0x375c2b[_0x930005][_0xcd53('0x2b')]({'plain':!![]});_0x110a58=squel[_0xcd53('0xb4')]()[_0xcd53('0xa3')](_0xcd53('0xb9'))['fromQuery']([_0xcd53('0xa9'),_0xcd53('0xa7'),_0xcd53('0xa8'),_0xcd53('0x65'),_0xcd53('0x5d'),'updatedAt'],squel[_0xcd53('0x83')]()['field'](_0xcd53('0xa9'),_0xcd53('0xa9'))[_0xcd53('0x84')]('id',_0xcd53('0xa7'))[_0xcd53('0x84')](_0x5afd6d[_0xcd53('0xab')]['toString'](),_0xcd53('0xa8'))[_0xcd53('0x84')](_0x29d59f[_0xcd53('0x4f')]['id']['toString'](),'VoiceQueueId')['field'](_0xcd53('0xaa'),_0xcd53('0x5d'))[_0xcd53('0x84')](_0xcd53('0xaa'),_0xcd53('0x5e'))['from'](_0xcd53('0xac'))[_0xcd53('0x47')](_0xcd53('0xad'))[_0xcd53('0x47')](_0xcd53('0xae'),_0x5afd6d[_0xcd53('0xab')][_0xcd53('0x8c')]())[_0xcd53('0x47')](_0xcd53('0xb5')))['toString']();_0x75e477[_0xcd53('0x8b')](db[_0xcd53('0x77')][_0xcd53('0x3d')](_0x110a58));}return BPromise[_0xcd53('0x8f')](_0x75e477);}})[_0xcd53('0x2a')](function(){return _0x20aecd;})['then'](respondWithResult(_0x29778d,null))[_0xcd53('0x4e')](handleError(_0x29778d,null));};exports['removeBlackLists']=function(_0x34a755,_0x318560,_0x375527){return db[_0xcd53('0x4b')][_0xcd53('0x52')]({'where':{'id':_0x34a755[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](handleEntityNotFound(_0x318560,null))[_0xcd53('0x2a')](function(_0x48b434){if(_0x48b434){return _0x48b434[_0xcd53('0xba')](_0x34a755[_0xcd53('0x3d')][_0xcd53('0x82')]);}})[_0xcd53('0x2a')](function(_0x3e5ab8){if(_0x3e5ab8){return db[_0xcd53('0x6d')][_0xcd53('0x29')]({'where':{'ListId':_0x34a755[_0xcd53('0x3d')][_0xcd53('0x82')],'VoiceQueueId':_0x34a755[_0xcd53('0x4f')]['id']}})[_0xcd53('0x2a')](function(){return _0x3e5ab8;});}})['then'](respondWithStatusCode(_0x318560,null))[_0xcd53('0x4e')](handleError(_0x318560,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 44981eb..f6429d0 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 _0x9e6e=['hook','events','../../mysqldb','VoiceQueue','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x125d3f,_0x512ca8){var _0x260ec7=function(_0xf762a7){while(--_0xf762a7){_0x125d3f['push'](_0x125d3f['shift']());}};_0x260ec7(++_0x512ca8);}(_0x9e6e,0xa1));var _0xe9e6=function(_0x4b04e7,_0x3b680b){_0x4b04e7=_0x4b04e7-0x0;var _0x2b41a3=_0x9e6e[_0x4b04e7];return _0x2b41a3;};'use strict';var EventEmitter=require(_0xe9e6('0x0'));var VoiceQueue=require(_0xe9e6('0x1'))['db'][_0xe9e6('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe9e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9e6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4dd8a3){return function(_0x12070d,_0x129f66,_0x4eb7da){VoiceQueueEvents[_0xe9e6('0x5')](_0x4dd8a3+':'+_0x12070d['id'],_0x12070d);VoiceQueueEvents[_0xe9e6('0x5')](_0x4dd8a3,_0x12070d);_0x4eb7da(null);};}for(var e in events){if(events[_0xe9e6('0x6')](e)){var event=events[e];VoiceQueue[_0xe9e6('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x85d8=['remove','emit','hasOwnProperty','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x5d6238,_0xe6992b){var _0x46ac6b=function(_0x5bc30c){while(--_0x5bc30c){_0x5d6238['push'](_0x5d6238['shift']());}};_0x46ac6b(++_0xe6992b);}(_0x85d8,0x13b));var _0x885d=function(_0x2fff62,_0x17bede){_0x2fff62=_0x2fff62-0x0;var _0x342a26=_0x85d8[_0x2fff62];return _0x342a26;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x885d('0x0'))['db'][_0x885d('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x885d('0x2')](0x0);var events={'afterCreate':_0x885d('0x3'),'afterUpdate':_0x885d('0x4'),'afterDestroy':_0x885d('0x5')};function emitEvent(_0x3b599b){return function(_0x477005,_0x1ca842,_0x5806d1){VoiceQueueEvents[_0x885d('0x6')](_0x3b599b+':'+_0x477005['id'],_0x477005);VoiceQueueEvents[_0x885d('0x6')](_0x3b599b,_0x477005);_0x5806d1(null);};}for(var e in events){if(events[_0x885d('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 33f364f..f64d060 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x5b91ab,_0xdc0cfb){var _0x12094b=function(_0x4bf665){while(--_0x4bf665){_0x5b91ab['push'](_0x5b91ab['shift']());}};_0x12094b(++_0xdc0cfb);}(_0x34e8,0x12c));var _0x834e=function(_0x296f35,_0xb07175){_0x296f35=_0x296f35-0x0;var _0x100d9e=_0x34e8[_0x296f35];return _0x100d9e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x304324,_0x50789e){var _0x38e006=function(_0x25ea92){while(--_0x25ea92){_0x304324['push'](_0x304324['shift']());}};_0x38e006(++_0x50789e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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':'voice_queues','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 59159ae..fbb2fa9 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 _0xb3d3=['GetVoiceQueue','VoiceQueue','findAll','options','limit','map','include','model','attributes','raw','where','ShowVoiceQueue','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','client','redis','localhost','./voiceQueue.socket','register','then','info','request\x20sent','debug','error','code','message','VoiceQueue,\x20%s,\x20%s','result','catch'];(function(_0x50cf65,_0x24f1e8){var _0x562691=function(_0x2ce5b7){while(--_0x2ce5b7){_0x50cf65['push'](_0x50cf65['shift']());}};_0x562691(++_0x24f1e8);}(_0xb3d3,0x1d4));var _0x3b3d=function(_0x3a94e1,_0x22e4fd){_0x3a94e1=_0x3a94e1-0x0;var _0x6a09d5=_0xb3d3[_0x3a94e1];return _0x6a09d5;};'use strict';var _=require(_0x3b3d('0x0'));var util=require(_0x3b3d('0x1'));var moment=require(_0x3b3d('0x2'));var BPromise=require(_0x3b3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b3d('0x4'));var logger=require(_0x3b3d('0x5'))(_0x3b3d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3b3d('0x7')]['http']({'port':0x232a});config[_0x3b3d('0x8')]=_['defaults'](config[_0x3b3d('0x8')],{'host':_0x3b3d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b3d('0x8')]));require(_0x3b3d('0xa'))[_0x3b3d('0xb')](socket);function respondWithRpcPromise(_0x13bb5c,_0x55ec52,_0x476fb6){return new BPromise(function(_0x263cc1,_0x2ef7b4){return client['request'](_0x13bb5c,_0x476fb6)[_0x3b3d('0xc')](function(_0x207c66){logger[_0x3b3d('0xd')]('VoiceQueue,\x20%s,\x20%s',_0x55ec52,_0x3b3d('0xe'));logger[_0x3b3d('0xf')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x55ec52,_0x3b3d('0xe'),JSON['stringify'](_0x207c66));if(_0x207c66[_0x3b3d('0x10')]){if(_0x207c66[_0x3b3d('0x10')][_0x3b3d('0x11')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x55ec52,_0x207c66['error'][_0x3b3d('0x12')]);return _0x2ef7b4(_0x207c66[_0x3b3d('0x10')]['message']);}logger[_0x3b3d('0x10')](_0x3b3d('0x13'),_0x55ec52,_0x207c66[_0x3b3d('0x10')][_0x3b3d('0x12')]);return _0x263cc1(_0x207c66[_0x3b3d('0x10')][_0x3b3d('0x12')]);}else{logger[_0x3b3d('0xd')](_0x3b3d('0x13'),_0x55ec52,_0x3b3d('0xe'));_0x263cc1(_0x207c66[_0x3b3d('0x14')][_0x3b3d('0x12')]);}})[_0x3b3d('0x15')](function(_0x42f3e1){logger[_0x3b3d('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x55ec52,_0x42f3e1);_0x2ef7b4(_0x42f3e1);});});}exports[_0x3b3d('0x16')]=function(_0x32379e){var _0x15645c=this;return new Promise(function(_0x1e5116,_0x4bef87){return db[_0x3b3d('0x17')][_0x3b3d('0x18')]({'raw':_0x32379e['options']?_0x32379e['options']['raw']===undefined?!![]:![]:!![],'where':_0x32379e[_0x3b3d('0x19')]?_0x32379e[_0x3b3d('0x19')]['where']||null:null,'attributes':_0x32379e['options']?_0x32379e['options']['attributes']||null:null,'limit':_0x32379e['options']?_0x32379e[_0x3b3d('0x19')][_0x3b3d('0x1a')]||null:null,'include':_0x32379e['options']?_0x32379e[_0x3b3d('0x19')]['include']?_[_0x3b3d('0x1b')](_0x32379e[_0x3b3d('0x19')][_0x3b3d('0x1c')],function(_0x8de523){return{'model':db[_0x8de523[_0x3b3d('0x1d')]],'as':_0x8de523['as'],'attributes':_0x8de523[_0x3b3d('0x1e')],'include':_0x8de523[_0x3b3d('0x1c')]?_[_0x3b3d('0x1b')](_0x8de523[_0x3b3d('0x1c')],function(_0x548f2a){return{'model':db[_0x548f2a[_0x3b3d('0x1d')]],'as':_0x548f2a['as'],'attributes':_0x548f2a[_0x3b3d('0x1e')],'include':_0x548f2a[_0x3b3d('0x1c')]?_[_0x3b3d('0x1b')](_0x548f2a[_0x3b3d('0x1c')],function(_0x2470bb){return{'model':db[_0x2470bb[_0x3b3d('0x1d')]],'as':_0x2470bb['as'],'attributes':_0x2470bb[_0x3b3d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3b3d('0xc')](function(_0x57f9e8){logger[_0x3b3d('0xd')]('GetVoiceQueue',_0x32379e);logger[_0x3b3d('0xf')]('GetVoiceQueue',_0x32379e,JSON['stringify'](_0x57f9e8));_0x1e5116(_0x57f9e8);})[_0x3b3d('0x15')](function(_0x3838d9){logger[_0x3b3d('0x10')](_0x3b3d('0x16'),_0x3838d9[_0x3b3d('0x12')],_0x32379e);_0x4bef87(_0x15645c[_0x3b3d('0x10')](0x1f4,_0x3838d9['message']));});});};exports['ShowVoiceQueue']=function(_0x211985){var _0x1354fd=this;return new Promise(function(_0x2fb4dd,_0x450f61){return db[_0x3b3d('0x17')]['find']({'raw':_0x211985[_0x3b3d('0x19')]?_0x211985[_0x3b3d('0x19')][_0x3b3d('0x1f')]===undefined?!![]:![]:!![],'where':_0x211985[_0x3b3d('0x19')]?_0x211985[_0x3b3d('0x19')][_0x3b3d('0x20')]||null:null,'attributes':_0x211985[_0x3b3d('0x19')]?_0x211985[_0x3b3d('0x19')][_0x3b3d('0x1e')]||null:null,'include':_0x211985['options']?_0x211985[_0x3b3d('0x19')]['include']?_[_0x3b3d('0x1b')](_0x211985[_0x3b3d('0x19')][_0x3b3d('0x1c')],function(_0x2d68dc){return{'model':db[_0x2d68dc[_0x3b3d('0x1d')]],'as':_0x2d68dc['as'],'attributes':_0x2d68dc[_0x3b3d('0x1e')],'include':_0x2d68dc[_0x3b3d('0x1c')]?_[_0x3b3d('0x1b')](_0x2d68dc[_0x3b3d('0x1c')],function(_0x2ed72f){return{'model':db[_0x2ed72f[_0x3b3d('0x1d')]],'as':_0x2ed72f['as'],'attributes':_0x2ed72f[_0x3b3d('0x1e')],'include':_0x2ed72f[_0x3b3d('0x1c')]?_[_0x3b3d('0x1b')](_0x2ed72f[_0x3b3d('0x1c')],function(_0x47f273){return{'model':db[_0x47f273['model']],'as':_0x47f273['as'],'attributes':_0x47f273[_0x3b3d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3b3d('0xc')](function(_0x2a272d){logger[_0x3b3d('0xd')](_0x3b3d('0x21'),_0x211985);logger[_0x3b3d('0xf')](_0x3b3d('0x21'),_0x211985,JSON[_0x3b3d('0x22')](_0x2a272d));_0x2fb4dd(_0x2a272d);})['catch'](function(_0x1eb553){logger['error'](_0x3b3d('0x21'),_0x1eb553[_0x3b3d('0x12')],_0x211985);_0x450f61(_0x1354fd[_0x3b3d('0x10')](0x1f4,_0x1eb553['message']));});});}; \ No newline at end of file +var _0x92d5=['include','map','model','ShowVoiceQueue','find','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes'];(function(_0x439a3a,_0x64894c){var _0x5adba9=function(_0x14342b){while(--_0x14342b){_0x439a3a['push'](_0x439a3a['shift']());}};_0x5adba9(++_0x64894c);}(_0x92d5,0x10f));var _0x592d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x92d5[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x592d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x592d('0x1'));var rs=require(_0x592d('0x2'));var fs=require('fs');var Redis=require(_0x592d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x592d('0x4'));var logger=require(_0x592d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x592d('0x6'));var client=jayson['client'][_0x592d('0x7')]({'port':0x232a});config[_0x592d('0x8')]=_[_0x592d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x592d('0xa'))(new Redis(config['redis']));require(_0x592d('0xb'))[_0x592d('0xc')](socket);function respondWithRpcPromise(_0x368bae,_0x48920c,_0x2a0750){return new BPromise(function(_0x181c0b,_0x253cea){return client[_0x592d('0xd')](_0x368bae,_0x2a0750)[_0x592d('0xe')](function(_0x1d0651){logger[_0x592d('0xf')](_0x592d('0x10'),_0x48920c,_0x592d('0x11'));logger[_0x592d('0x12')](_0x592d('0x13'),_0x48920c,_0x592d('0x11'),JSON[_0x592d('0x14')](_0x1d0651));if(_0x1d0651[_0x592d('0x15')]){if(_0x1d0651[_0x592d('0x15')][_0x592d('0x16')]===0x1f4){logger[_0x592d('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x48920c,_0x1d0651['error'][_0x592d('0x17')]);return _0x253cea(_0x1d0651[_0x592d('0x15')][_0x592d('0x17')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x48920c,_0x1d0651[_0x592d('0x15')][_0x592d('0x17')]);return _0x181c0b(_0x1d0651['error'][_0x592d('0x17')]);}else{logger['info'](_0x592d('0x10'),_0x48920c,_0x592d('0x11'));_0x181c0b(_0x1d0651[_0x592d('0x18')][_0x592d('0x17')]);}})[_0x592d('0x19')](function(_0x5a63d2){logger['error'](_0x592d('0x10'),_0x48920c,_0x5a63d2);_0x253cea(_0x5a63d2);});});}exports[_0x592d('0x1a')]=function(_0x2366a5){var _0x2b1a6c=this;return new Promise(function(_0x592731,_0x57757f){return db[_0x592d('0x1b')][_0x592d('0x1c')]({'raw':_0x2366a5[_0x592d('0x1d')]?_0x2366a5[_0x592d('0x1d')][_0x592d('0x1e')]===undefined?!![]:![]:!![],'where':_0x2366a5[_0x592d('0x1d')]?_0x2366a5[_0x592d('0x1d')][_0x592d('0x1f')]||null:null,'attributes':_0x2366a5[_0x592d('0x1d')]?_0x2366a5[_0x592d('0x1d')][_0x592d('0x20')]||null:null,'limit':_0x2366a5[_0x592d('0x1d')]?_0x2366a5[_0x592d('0x1d')]['limit']||null:null,'include':_0x2366a5['options']?_0x2366a5[_0x592d('0x1d')][_0x592d('0x21')]?_[_0x592d('0x22')](_0x2366a5[_0x592d('0x1d')]['include'],function(_0x525064){return{'model':db[_0x525064['model']],'as':_0x525064['as'],'attributes':_0x525064['attributes'],'include':_0x525064[_0x592d('0x21')]?_['map'](_0x525064[_0x592d('0x21')],function(_0x4793e8){return{'model':db[_0x4793e8[_0x592d('0x23')]],'as':_0x4793e8['as'],'attributes':_0x4793e8['attributes'],'include':_0x4793e8['include']?_[_0x592d('0x22')](_0x4793e8[_0x592d('0x21')],function(_0x3164b){return{'model':db[_0x3164b['model']],'as':_0x3164b['as'],'attributes':_0x3164b[_0x592d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x592d('0xe')](function(_0x56722f){logger['info'](_0x592d('0x1a'),_0x2366a5);logger['debug'](_0x592d('0x1a'),_0x2366a5,JSON[_0x592d('0x14')](_0x56722f));_0x592731(_0x56722f);})['catch'](function(_0x5a8f7a){logger[_0x592d('0x15')](_0x592d('0x1a'),_0x5a8f7a[_0x592d('0x17')],_0x2366a5);_0x57757f(_0x2b1a6c[_0x592d('0x15')](0x1f4,_0x5a8f7a[_0x592d('0x17')]));});});};exports[_0x592d('0x24')]=function(_0x5bbcaa){var _0xe37829=this;return new Promise(function(_0x4b09ee,_0x44b8e9){return db['VoiceQueue'][_0x592d('0x25')]({'raw':_0x5bbcaa[_0x592d('0x1d')]?_0x5bbcaa[_0x592d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5bbcaa[_0x592d('0x1d')]?_0x5bbcaa[_0x592d('0x1d')][_0x592d('0x1f')]||null:null,'attributes':_0x5bbcaa[_0x592d('0x1d')]?_0x5bbcaa[_0x592d('0x1d')][_0x592d('0x20')]||null:null,'include':_0x5bbcaa[_0x592d('0x1d')]?_0x5bbcaa['options'][_0x592d('0x21')]?_[_0x592d('0x22')](_0x5bbcaa[_0x592d('0x1d')]['include'],function(_0x29f1ec){return{'model':db[_0x29f1ec[_0x592d('0x23')]],'as':_0x29f1ec['as'],'attributes':_0x29f1ec[_0x592d('0x20')],'include':_0x29f1ec[_0x592d('0x21')]?_[_0x592d('0x22')](_0x29f1ec['include'],function(_0x1d0a93){return{'model':db[_0x1d0a93[_0x592d('0x23')]],'as':_0x1d0a93['as'],'attributes':_0x1d0a93[_0x592d('0x20')],'include':_0x1d0a93[_0x592d('0x21')]?_[_0x592d('0x22')](_0x1d0a93[_0x592d('0x21')],function(_0x5d5c15){return{'model':db[_0x5d5c15[_0x592d('0x23')]],'as':_0x5d5c15['as'],'attributes':_0x5d5c15[_0x592d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x592d('0xe')](function(_0xc2b426){logger[_0x592d('0xf')](_0x592d('0x24'),_0x5bbcaa);logger[_0x592d('0x12')]('ShowVoiceQueue',_0x5bbcaa,JSON[_0x592d('0x14')](_0xc2b426));_0x4b09ee(_0xc2b426);})[_0x592d('0x19')](function(_0x13d9df){logger[_0x592d('0x15')]('ShowVoiceQueue',_0x13d9df[_0x592d('0x17')],_0x5bbcaa);_0x44b8e9(_0xe37829['error'](0x1f4,_0x13d9df[_0x592d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 28b8073..e20db99 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 _0x678d=['length','./voiceQueue.events','save','update','emit','removeListener','register'];(function(_0x2a3951,_0xd1155a){var _0x2b0c59=function(_0x410378){while(--_0x410378){_0x2a3951['push'](_0x2a3951['shift']());}};_0x2b0c59(++_0xd1155a);}(_0x678d,0x135));var _0xd678=function(_0x447973,_0xfe7d70){_0x447973=_0x447973-0x0;var _0x50b31e=_0x678d[_0x447973];return _0x50b31e;};'use strict';var VoiceQueueEvents=require(_0xd678('0x0'));var events=[_0xd678('0x1'),'remove',_0xd678('0x2')];function createListener(_0x10f416,_0x53dd96){return function(_0x34e1f7){_0x53dd96[_0xd678('0x3')](_0x10f416,_0x34e1f7);};}function removeListener(_0x150ec6,_0x39933e){return function(){VoiceQueueEvents[_0xd678('0x4')](_0x150ec6,_0x39933e);};}exports[_0xd678('0x5')]=function(_0x3f47c8){for(var _0x403f8b=0x0,_0x22ff6d=events[_0xd678('0x6')];_0x403f8b<_0x22ff6d;_0x403f8b++){var _0x137236=events[_0x403f8b];var _0x14cae5=createListener('voiceQueue:'+_0x137236,_0x3f47c8);VoiceQueueEvents['on'](_0x137236,_0x14cae5);}}; \ No newline at end of file +var _0x5bf5=['save','remove','removeListener','register','voiceQueue:'];(function(_0x1483c4,_0x451f75){var _0x28f0c6=function(_0x188e92){while(--_0x188e92){_0x1483c4['push'](_0x1483c4['shift']());}};_0x28f0c6(++_0x451f75);}(_0x5bf5,0xc3));var _0x55bf=function(_0x47425c,_0x23da78){_0x47425c=_0x47425c-0x0;var _0xfd0fd=_0x5bf5[_0x47425c];return _0xfd0fd;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x55bf('0x0'),_0x55bf('0x1'),'update'];function createListener(_0x454ed6,_0xff438d){return function(_0x37cfcb){_0xff438d['emit'](_0x454ed6,_0x37cfcb);};}function removeListener(_0xd09ec7,_0x115280){return function(){VoiceQueueEvents[_0x55bf('0x2')](_0xd09ec7,_0x115280);};}exports[_0x55bf('0x3')]=function(_0x3770dd){for(var _0x2418f5=0x0,_0x1c4f85=events['length'];_0x2418f5<_0x1c4f85;_0x2418f5++){var _0x2cc832=events[_0x2418f5];var _0x3ba6d9=createListener(_0x55bf('0x4')+_0x2cc832,_0x3770dd);VoiceQueueEvents['on'](_0x2cc832,_0x3ba6d9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 993274c..0bf9347 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 _0x7d39=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','/index','getVoiceQueuesReport','/:id','show','post','put','update'];(function(_0x3b4d1b,_0x12517b){var _0x5a2ffd=function(_0x241fe6){while(--_0x241fe6){_0x3b4d1b['push'](_0x3b4d1b['shift']());}};_0x5a2ffd(++_0x12517b);}(_0x7d39,0x1cf));var _0x97d3=function(_0x5d0149,_0x1e3ed8){_0x5d0149=_0x5d0149-0x0;var _0x2402c9=_0x7d39[_0x5d0149];return _0x2402c9;};'use strict';var multer=require(_0x97d3('0x0'));var util=require(_0x97d3('0x1'));var path=require(_0x97d3('0x2'));var timeout=require(_0x97d3('0x3'));var express=require(_0x97d3('0x4'));var router=express[_0x97d3('0x5')]();var fs_extra=require(_0x97d3('0x6'));var auth=require(_0x97d3('0x7'));var interaction=require(_0x97d3('0x8'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x97d3('0x9')](),controller[_0x97d3('0xa')]);router[_0x97d3('0xb')]('/describe',auth[_0x97d3('0x9')](),controller[_0x97d3('0xc')]);router[_0x97d3('0xb')](_0x97d3('0xd'),auth['isAuthenticated'](),controller[_0x97d3('0xe')]);router[_0x97d3('0xb')](_0x97d3('0xf'),auth[_0x97d3('0x9')](),controller[_0x97d3('0x10')]);router[_0x97d3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x97d3('0x12')](_0x97d3('0xf'),auth['isAuthenticated'](),controller[_0x97d3('0x13')]);router[_0x97d3('0x14')](_0x97d3('0xf'),auth[_0x97d3('0x9')](),controller[_0x97d3('0x15')]);module[_0x97d3('0x16')]=router; \ No newline at end of file +var _0x381b=['./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','getVoiceQueuesReport','/:id','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xfe6cb9,_0x6e97a3){var _0x584222=function(_0x30e0d7){while(--_0x30e0d7){_0xfe6cb9['push'](_0xfe6cb9['shift']());}};_0x584222(++_0x6e97a3);}(_0x381b,0xca));var _0xb381=function(_0xf61586,_0x56b0c4){_0xf61586=_0xf61586-0x0;var _0x2b6eb3=_0x381b[_0xf61586];return _0x2b6eb3;};'use strict';var multer=require(_0xb381('0x0'));var util=require(_0xb381('0x1'));var path=require(_0xb381('0x2'));var timeout=require(_0xb381('0x3'));var express=require('express');var router=express[_0xb381('0x4')]();var fs_extra=require(_0xb381('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb381('0x6'));var config=require(_0xb381('0x7'));var controller=require(_0xb381('0x8'));router['get']('/',auth[_0xb381('0x9')](),controller[_0xb381('0xa')]);router[_0xb381('0xb')](_0xb381('0xc'),auth['isAuthenticated'](),controller[_0xb381('0xd')]);router[_0xb381('0xb')]('/index',auth[_0xb381('0x9')](),controller[_0xb381('0xe')]);router['get'](_0xb381('0xf'),auth[_0xb381('0x9')](),controller['show']);router[_0xb381('0x10')]('/',auth[_0xb381('0x9')](),controller['create']);router[_0xb381('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb381('0x12')]);router[_0xb381('0x13')](_0xb381('0xf'),auth[_0xb381('0x9')](),controller[_0xb381('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 83b7bfd..c5c4da6 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 _0x925d=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue'];(function(_0x555afe,_0x27ce50){var _0x4f88fb=function(_0x5956f7){while(--_0x5956f7){_0x555afe['push'](_0x555afe['shift']());}};_0x4f88fb(++_0x27ce50);}(_0x925d,0x70));var _0xd925=function(_0x32f975,_0x283d21){_0x32f975=_0x32f975-0x0;var _0x34b0ce=_0x925d[_0x32f975];return _0x34b0ce;};'use strict';var Sequelize=require(_0xd925('0x0'));var moment=require(_0xd925('0x1'));module['exports']={'type':{'type':Sequelize[_0xd925('0x2')]},'uniqueid':{'type':Sequelize[_0xd925('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd925('0x2')]},'queue':{'type':Sequelize[_0xd925('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xd925('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x139397){var _0x524960=moment(_0x139397);var _0x358a4b=moment(this['getDataValue']('queuecallerjoinAt'))[_0xd925('0x4')](_0xd925('0x5'));var _0x4ed656=_0x524960[_0xd925('0x6')](_0x358a4b,'seconds');this[_0xd925('0x7')]('queuecallerleaveAt',_0x139397);this['setDataValue'](_0xd925('0x8'),_0x4ed656||null);}},'position':{'type':Sequelize[_0xd925('0x9')]},'count':{'type':Sequelize[_0xd925('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xd925('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xd925('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd925('0x3')]},'queuecallerexit':{'type':Sequelize[_0xd925('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xd925('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xd925('0x2')],'comment':_0xd925('0xb')},'originalposition':{'type':Sequelize[_0xd925('0x9')]},'channel':{'type':Sequelize[_0xd925('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd925('0x2')]},'connectedlinename':{'type':Sequelize[_0xd925('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd925('0x2')]},'exten':{'type':Sequelize[_0xd925('0x2')]},'priority':{'type':Sequelize[_0xd925('0x2')]},'holdtime':{'type':Sequelize[_0xd925('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd925('0x2')]},'transfer':{'type':Sequelize[_0xd925('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd925('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd925('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xd925('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc19c=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xc19c,0x1b5));var _0xcc19=function(_0x424405,_0x58a9cc){_0x424405=_0x424405-0x0;var _0x38aa6b=_0xc19c[_0x424405];return _0x38aa6b;};'use strict';var Sequelize=require(_0xcc19('0x0'));var moment=require(_0xcc19('0x1'));module[_0xcc19('0x2')]={'type':{'type':Sequelize[_0xcc19('0x3')]},'uniqueid':{'type':Sequelize[_0xcc19('0x3')]},'calleridnum':{'type':Sequelize[_0xcc19('0x3')]},'calleridname':{'type':Sequelize[_0xcc19('0x3')]},'queue':{'type':Sequelize[_0xcc19('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xcc19('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xcc19('0x4')],'set':function(_0x547cb1){var _0x58207e=moment(_0x547cb1);var _0x2835fe=moment(this[_0xcc19('0x5')](_0xcc19('0x6')))[_0xcc19('0x7')](_0xcc19('0x8'));var _0x3e4dfb=_0x58207e['diff'](_0x2835fe,_0xcc19('0x9'));this['setDataValue'](_0xcc19('0xa'),_0x547cb1);this[_0xcc19('0xb')](_0xcc19('0xc'),_0x3e4dfb||null);}},'position':{'type':Sequelize[_0xcc19('0xd')]},'count':{'type':Sequelize[_0xcc19('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xcc19('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xcc19('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xcc19('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xcc19('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xcc19('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xcc19('0xf')},'originalposition':{'type':Sequelize[_0xcc19('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xcc19('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcc19('0x3')]},'context':{'type':Sequelize[_0xcc19('0x3')]},'exten':{'type':Sequelize[_0xcc19('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xcc19('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcc19('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcc19('0x3')]},'transfer':{'type':Sequelize[_0xcc19('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xcc19('0x10')},'transferexten':{'type':Sequelize[_0xcc19('0x3')]},'transferuniqueid':{'type':Sequelize[_0xcc19('0x3')]},'disposition':{'type':Sequelize[_0xcc19('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xcc19('0xd')],'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 2d862ca..42330d8 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 _0x6d27=['type','key','model','keys','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','describe','getVoiceQueuesReport','findAll','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','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','stack','name','send','map','VoiceQueueReport','rawAttributes'];(function(_0x4ec16b,_0x5f41d8){var _0x4b667a=function(_0x4d1119){while(--_0x4d1119){_0x4ec16b['push'](_0x4ec16b['shift']());}};_0x4b667a(++_0x5f41d8);}(_0x6d27,0x74));var _0x76d2=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6d27[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x76d2('0x0'));var rimraf=require(_0x76d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76d2('0x2'));var rp=require('request-promise');var moment=require(_0x76d2('0x3'));var BPromise=require(_0x76d2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x76d2('0x5'));var sox=require(_0x76d2('0x6'));var csv=require(_0x76d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76d2('0x8'));var _=require(_0x76d2('0x9'));var squel=require(_0x76d2('0xa'));var crypto=require('crypto');var jsforce=require(_0x76d2('0xb'));var deskjs=require(_0x76d2('0xc'));var toCsv=require(_0x76d2('0x7'));var querystring=require(_0x76d2('0xd'));var Papa=require(_0x76d2('0xe'));var Redis=require(_0x76d2('0xf'));var authService=require(_0x76d2('0x10'));var qs=require(_0x76d2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76d2('0x12'));var logger=require(_0x76d2('0x13'))(_0x76d2('0x14'));var utils=require(_0x76d2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x76d2('0x16'));var db=require(_0x76d2('0x17'))['db'];config[_0x76d2('0x18')]=_['defaults'](config[_0x76d2('0x18')],{'host':_0x76d2('0x19'),'port':0x18eb});var socket=require(_0x76d2('0x1a'))(new Redis(config[_0x76d2('0x18')]));require(_0x76d2('0x1b'))[_0x76d2('0x1c')](socket);function respondWithStatusCode(_0x1a2e59,_0x42e967){_0x42e967=_0x42e967||0xcc;return function(_0xd97bfe){if(_0xd97bfe){return _0x1a2e59[_0x76d2('0x1d')](_0x42e967);}return _0x1a2e59[_0x76d2('0x1e')](_0x42e967)[_0x76d2('0x1f')]();};}function respondWithResult(_0x3f2210,_0x4c1f17){_0x4c1f17=_0x4c1f17||0xc8;return function(_0x43bc3b){if(_0x43bc3b){return _0x3f2210[_0x76d2('0x1e')](_0x4c1f17)[_0x76d2('0x20')](_0x43bc3b);}};}function respondWithFilteredResult(_0x51be27,_0x5a46bb){return function(_0xb2ceb4){if(_0xb2ceb4){var _0x20a188=typeof _0x5a46bb[_0x76d2('0x21')]===_0x76d2('0x22')&&typeof _0x5a46bb[_0x76d2('0x23')]===_0x76d2('0x22');var _0x33258a=_0xb2ceb4[_0x76d2('0x24')];var _0x1b5ecc=_0x20a188?0x0:_0x5a46bb[_0x76d2('0x21')];var _0x5fac80=_0x20a188?_0xb2ceb4['count']:_0x5a46bb['offset']+_0x5a46bb['limit'];var _0x224bcb;if(_0x5fac80>=_0x33258a){_0x5fac80=_0x33258a;_0x224bcb=0xc8;}else{_0x224bcb=0xce;}_0x51be27[_0x76d2('0x1e')](_0x224bcb);return _0x51be27[_0x76d2('0x25')](_0x76d2('0x26'),_0x1b5ecc+'-'+_0x5fac80+'/'+_0x33258a)[_0x76d2('0x20')](_0xb2ceb4);}return null;};}function patchUpdates(_0x441d11){return function(_0xe5a6e5){try{jsonpatch[_0x76d2('0x27')](_0xe5a6e5,_0x441d11,!![]);}catch(_0x39648a){return BPromise[_0x76d2('0x28')](_0x39648a);}return _0xe5a6e5[_0x76d2('0x29')]();};}function saveUpdates(_0x1ab06a,_0x44abe0){return function(_0x4d115a){if(_0x4d115a){return _0x4d115a[_0x76d2('0x2a')](_0x1ab06a)[_0x76d2('0x2b')](function(_0x3ffa75){return _0x3ffa75;});}return null;};}function removeEntity(_0x4c75b6,_0x174025){return function(_0x43e514){if(_0x43e514){return _0x43e514[_0x76d2('0x2c')]()[_0x76d2('0x2b')](function(){_0x4c75b6[_0x76d2('0x1e')](0xcc)[_0x76d2('0x1f')]();});}};}function handleEntityNotFound(_0x57a4c7,_0x21570e){return function(_0x5537df){if(!_0x5537df){_0x57a4c7[_0x76d2('0x1d')](0x194);}return _0x5537df;};}function handleError(_0x60a73e,_0x58cb6a){_0x58cb6a=_0x58cb6a||0x1f4;return function(_0xb3932e){logger[_0x76d2('0x2d')](_0xb3932e[_0x76d2('0x2e')]);if(_0xb3932e[_0x76d2('0x2f')]){delete _0xb3932e[_0x76d2('0x2f')];}_0x60a73e[_0x76d2('0x1e')](_0x58cb6a)[_0x76d2('0x30')](_0xb3932e);};}exports['index']=function(_0x39a03b,_0x1d0722){var _0x14a063={},_0x572ba1={},_0x279b74={'count':0x0,'rows':[]};var _0x36b0d6=_[_0x76d2('0x31')](db[_0x76d2('0x32')][_0x76d2('0x33')],function(_0x5c02c8){return{'name':_0x5c02c8['fieldName'],'type':_0x5c02c8[_0x76d2('0x34')][_0x76d2('0x35')]};});_0x572ba1[_0x76d2('0x36')]=_['map'](_0x36b0d6,_0x76d2('0x2f'));_0x572ba1['query']=_[_0x76d2('0x37')](_0x39a03b['query']);_0x572ba1['filters']=_[_0x76d2('0x38')](_0x572ba1[_0x76d2('0x36')],_0x572ba1['query']);_0x14a063[_0x76d2('0x39')]=_[_0x76d2('0x38')](_0x572ba1['model'],qs['fields'](_0x39a03b[_0x76d2('0x3a')][_0x76d2('0x3b')]));_0x14a063[_0x76d2('0x39')]=_0x14a063['attributes'][_0x76d2('0x3c')]?_0x14a063['attributes']:_0x572ba1[_0x76d2('0x36')];if(!_0x39a03b['query'][_0x76d2('0x3d')](_0x76d2('0x3e'))){_0x14a063[_0x76d2('0x23')]=qs[_0x76d2('0x23')](_0x39a03b[_0x76d2('0x3a')]['limit']);_0x14a063[_0x76d2('0x21')]=qs['offset'](_0x39a03b[_0x76d2('0x3a')]['offset']);}_0x14a063[_0x76d2('0x3f')]=qs[_0x76d2('0x40')](_0x39a03b['query'][_0x76d2('0x40')]);_0x14a063[_0x76d2('0x41')]=qs['filters'](_[_0x76d2('0x42')](_0x39a03b[_0x76d2('0x3a')],_0x572ba1[_0x76d2('0x43')]),_0x36b0d6);if(_0x39a03b[_0x76d2('0x3a')][_0x76d2('0x44')]){_0x14a063[_0x76d2('0x41')]=_[_0x76d2('0x45')](_0x14a063['where'],{'$or':_[_0x76d2('0x31')](_0x36b0d6,function(_0x58847c){if(_0x58847c[_0x76d2('0x34')]!==_0x76d2('0x46')){var _0x4a3aba={};_0x4a3aba[_0x58847c[_0x76d2('0x2f')]]={'$like':'%'+_0x39a03b[_0x76d2('0x3a')][_0x76d2('0x44')]+'%'};return _0x4a3aba;}})});}_0x14a063=_[_0x76d2('0x45')]({},_0x14a063,_0x39a03b[_0x76d2('0x47')]);var _0xe4ff2c={'where':_0x14a063[_0x76d2('0x41')]};return db[_0x76d2('0x32')][_0x76d2('0x24')](_0xe4ff2c)['then'](function(_0x2a9c84){_0x279b74[_0x76d2('0x24')]=_0x2a9c84;if(_0x39a03b[_0x76d2('0x3a')][_0x76d2('0x48')]){_0x14a063[_0x76d2('0x49')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x14a063);})[_0x76d2('0x2b')](function(_0x5e3ae9){_0x279b74[_0x76d2('0x4a')]=_0x5e3ae9;return _0x279b74;})[_0x76d2('0x2b')](respondWithFilteredResult(_0x1d0722,_0x14a063))['catch'](handleError(_0x1d0722,null));};exports[_0x76d2('0x4b')]=function(_0x2ff268,_0x39deaa){var _0x116c18={'raw':![],'where':{'id':_0x2ff268[_0x76d2('0x4c')]['id']}},_0x5ab4c0={};_0x5ab4c0['model']=_[_0x76d2('0x37')](db[_0x76d2('0x32')]['rawAttributes']);_0x5ab4c0[_0x76d2('0x3a')]=_[_0x76d2('0x37')](_0x2ff268[_0x76d2('0x3a')]);_0x5ab4c0['filters']=_[_0x76d2('0x38')](_0x5ab4c0['model'],_0x5ab4c0[_0x76d2('0x3a')]);_0x116c18[_0x76d2('0x39')]=_['intersection'](_0x5ab4c0[_0x76d2('0x36')],qs[_0x76d2('0x3b')](_0x2ff268['query'][_0x76d2('0x3b')]));_0x116c18[_0x76d2('0x39')]=_0x116c18['attributes'][_0x76d2('0x3c')]?_0x116c18[_0x76d2('0x39')]:_0x5ab4c0[_0x76d2('0x36')];if(_0x2ff268[_0x76d2('0x3a')][_0x76d2('0x48')]){_0x116c18[_0x76d2('0x49')]=[{'all':!![]}];}_0x116c18=_[_0x76d2('0x45')]({},_0x116c18,_0x2ff268[_0x76d2('0x47')]);return db['VoiceQueueReport'][_0x76d2('0x4d')](_0x116c18)[_0x76d2('0x2b')](handleEntityNotFound(_0x39deaa,null))[_0x76d2('0x2b')](respondWithResult(_0x39deaa,null))[_0x76d2('0x4e')](handleError(_0x39deaa,null));};exports['create']=function(_0x3d419f,_0x388550){return db[_0x76d2('0x32')][_0x76d2('0x4f')](_0x3d419f[_0x76d2('0x50')],{})['then'](respondWithResult(_0x388550,0xc9))[_0x76d2('0x4e')](handleError(_0x388550,null));};exports[_0x76d2('0x2a')]=function(_0x3db59c,_0x656f0a){if(_0x3db59c[_0x76d2('0x50')]['id']){delete _0x3db59c[_0x76d2('0x50')]['id'];}return db[_0x76d2('0x32')][_0x76d2('0x4d')]({'where':{'id':_0x3db59c['params']['id']}})[_0x76d2('0x2b')](handleEntityNotFound(_0x656f0a,null))[_0x76d2('0x2b')](saveUpdates(_0x3db59c[_0x76d2('0x50')],null))[_0x76d2('0x2b')](respondWithResult(_0x656f0a,null))['catch'](handleError(_0x656f0a,null));};exports['destroy']=function(_0x16e629,_0x25a499){return db['VoiceQueueReport']['find']({'where':{'id':_0x16e629[_0x76d2('0x4c')]['id']}})[_0x76d2('0x2b')](handleEntityNotFound(_0x25a499,null))[_0x76d2('0x2b')](removeEntity(_0x25a499,null))[_0x76d2('0x4e')](handleError(_0x25a499,null));};exports['describe']=function(_0x292fed,_0x5931ab){return db[_0x76d2('0x32')][_0x76d2('0x51')]()[_0x76d2('0x2b')](respondWithResult(_0x5931ab,null))['catch'](handleError(_0x5931ab,null));};exports[_0x76d2('0x52')]=function(_0x3b0320,_0x3c4a34){var _0x255ce8={},_0x5e0fc3={},_0x1dcc4b={'count':0x0,'rows':[]};_0x5e0fc3['model']=_[_0x76d2('0x37')](db['VoiceQueueReport'][_0x76d2('0x33')]);_0x5e0fc3[_0x76d2('0x3a')]=_[_0x76d2('0x37')](_0x3b0320[_0x76d2('0x3a')]);_0x5e0fc3[_0x76d2('0x43')]=_[_0x76d2('0x38')](_0x5e0fc3['model'],_0x5e0fc3[_0x76d2('0x3a')]);_0x255ce8[_0x76d2('0x39')]=_[_0x76d2('0x38')](_0x5e0fc3['model'],qs[_0x76d2('0x3b')](_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x3b')]));_0x255ce8['attributes']=_0x255ce8['attributes'][_0x76d2('0x3c')]?_0x255ce8[_0x76d2('0x39')]:_0x5e0fc3['model'];if(!_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x3d')](_0x76d2('0x3e'))){_0x255ce8[_0x76d2('0x23')]=qs[_0x76d2('0x23')](_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x23')]);_0x255ce8[_0x76d2('0x21')]=qs[_0x76d2('0x21')](_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x21')]);}_0x255ce8[_0x76d2('0x3f')]=qs[_0x76d2('0x40')](_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x40')]);_0x255ce8[_0x76d2('0x41')]=qs['filters'](_['pick'](_0x3b0320[_0x76d2('0x3a')],_0x5e0fc3['filters']));if(_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x44')]){_0x255ce8[_0x76d2('0x41')]=_[_0x76d2('0x45')](_0x255ce8['where'],{'$or':_[_0x76d2('0x31')](_0x255ce8[_0x76d2('0x39')],function(_0x1c2dd2){var _0x467c69={};_0x467c69[_0x1c2dd2]={'$like':'%'+_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x44')]+'%'};return _0x467c69;})});}_0x255ce8=_['merge']({},_0x255ce8,_0x3b0320[_0x76d2('0x47')]);var _0x300ed4={'where':_0x255ce8[_0x76d2('0x41')]};return db[_0x76d2('0x32')][_0x76d2('0x24')](_0x300ed4)[_0x76d2('0x2b')](function(_0x4dfddd){_0x1dcc4b[_0x76d2('0x24')]=_0x4dfddd;if(_0x3b0320[_0x76d2('0x3a')][_0x76d2('0x48')]){_0x255ce8['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x76d2('0x53')](_0x255ce8);})[_0x76d2('0x2b')](function(_0x121a25){_0x1dcc4b[_0x76d2('0x4a')]=_0x121a25;return _0x1dcc4b;})[_0x76d2('0x2b')](respondWithFilteredResult(_0x3c4a34,_0x255ce8,_0x76d2('0x52')))['catch'](handleError(_0x3c4a34,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x25de=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','VoiceQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x3091ba,_0x41551e){var _0x2bf93d=function(_0x56ff64){while(--_0x56ff64){_0x3091ba['push'](_0x3091ba['shift']());}};_0x2bf93d(++_0x41551e);}(_0x25de,0xa1));var _0xe25d=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0x25de[_0xfb0281];return _0x408dd3;};'use strict';var emlformat=require(_0xe25d('0x0'));var rimraf=require(_0xe25d('0x1'));var zipdir=require(_0xe25d('0x2'));var jsonpatch=require(_0xe25d('0x3'));var rp=require(_0xe25d('0x4'));var moment=require(_0xe25d('0x5'));var BPromise=require(_0xe25d('0x6'));var Mustache=require('mustache');var util=require(_0xe25d('0x7'));var path=require(_0xe25d('0x8'));var sox=require(_0xe25d('0x9'));var csv=require('to-csv');var ejs=require(_0xe25d('0xa'));var fs=require('fs');var fs_extra=require(_0xe25d('0xb'));var _=require(_0xe25d('0xc'));var squel=require(_0xe25d('0xd'));var crypto=require('crypto');var jsforce=require(_0xe25d('0xe'));var deskjs=require(_0xe25d('0xf'));var toCsv=require(_0xe25d('0x10'));var querystring=require(_0xe25d('0x11'));var Papa=require('papaparse');var Redis=require(_0xe25d('0x12'));var authService=require(_0xe25d('0x13'));var qs=require(_0xe25d('0x14'));var as=require(_0xe25d('0x15'));var hardwareService=require(_0xe25d('0x16'));var logger=require(_0xe25d('0x17'))(_0xe25d('0x18'));var utils=require(_0xe25d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe25d('0x1a'));var db=require(_0xe25d('0x1b'))['db'];config['redis']=_[_0xe25d('0x1c')](config['redis'],{'host':_0xe25d('0x1d'),'port':0x18eb});var socket=require(_0xe25d('0x1e'))(new Redis(config[_0xe25d('0x1f')]));require(_0xe25d('0x20'))[_0xe25d('0x21')](socket);function respondWithStatusCode(_0x414020,_0xdde72c){_0xdde72c=_0xdde72c||0xcc;return function(_0x2dd4d7){if(_0x2dd4d7){return _0x414020[_0xe25d('0x22')](_0xdde72c);}return _0x414020[_0xe25d('0x23')](_0xdde72c)[_0xe25d('0x24')]();};}function respondWithResult(_0x12a8fa,_0x406464){_0x406464=_0x406464||0xc8;return function(_0x44c9f9){if(_0x44c9f9){return _0x12a8fa[_0xe25d('0x23')](_0x406464)['json'](_0x44c9f9);}};}function respondWithFilteredResult(_0x49a6c4,_0x1516c2){return function(_0x2ec042){if(_0x2ec042){var _0x457957=typeof _0x1516c2[_0xe25d('0x25')]==='undefined'&&typeof _0x1516c2['limit']===_0xe25d('0x26');var _0x504ffd=_0x2ec042[_0xe25d('0x27')];var _0x712a2a=_0x457957?0x0:_0x1516c2[_0xe25d('0x25')];var _0x32ce89=_0x457957?_0x2ec042[_0xe25d('0x27')]:_0x1516c2['offset']+_0x1516c2['limit'];var _0x8b0bc7;if(_0x32ce89>=_0x504ffd){_0x32ce89=_0x504ffd;_0x8b0bc7=0xc8;}else{_0x8b0bc7=0xce;}_0x49a6c4['status'](_0x8b0bc7);return _0x49a6c4[_0xe25d('0x28')](_0xe25d('0x29'),_0x712a2a+'-'+_0x32ce89+'/'+_0x504ffd)[_0xe25d('0x2a')](_0x2ec042);}return null;};}function patchUpdates(_0x3f11bd){return function(_0x31cf88){try{jsonpatch[_0xe25d('0x2b')](_0x31cf88,_0x3f11bd,!![]);}catch(_0xd7d488){return BPromise[_0xe25d('0x2c')](_0xd7d488);}return _0x31cf88[_0xe25d('0x2d')]();};}function saveUpdates(_0x52f489,_0x5cd3c4){return function(_0x3f8514){if(_0x3f8514){return _0x3f8514['update'](_0x52f489)[_0xe25d('0x2e')](function(_0x225f02){return _0x225f02;});}return null;};}function removeEntity(_0x41228a,_0x346831){return function(_0x11a652){if(_0x11a652){return _0x11a652[_0xe25d('0x2f')]()['then'](function(){_0x41228a[_0xe25d('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x368452,_0x1a0238){return function(_0x123f1b){if(!_0x123f1b){_0x368452[_0xe25d('0x22')](0x194);}return _0x123f1b;};}function handleError(_0x4b6a80,_0x26a898){_0x26a898=_0x26a898||0x1f4;return function(_0x4f7082){logger[_0xe25d('0x30')](_0x4f7082[_0xe25d('0x31')]);if(_0x4f7082[_0xe25d('0x32')]){delete _0x4f7082[_0xe25d('0x32')];}_0x4b6a80[_0xe25d('0x23')](_0x26a898)[_0xe25d('0x33')](_0x4f7082);};}exports['index']=function(_0x477088,_0x496e42){var _0x240ffb={},_0x2558fe={},_0x4a52e4={'count':0x0,'rows':[]};var _0xfe23ef=_[_0xe25d('0x34')](db[_0xe25d('0x35')][_0xe25d('0x36')],function(_0x38e4ca){return{'name':_0x38e4ca[_0xe25d('0x37')],'type':_0x38e4ca['type'][_0xe25d('0x38')]};});_0x2558fe['model']=_[_0xe25d('0x34')](_0xfe23ef,_0xe25d('0x32'));_0x2558fe[_0xe25d('0x39')]=_[_0xe25d('0x3a')](_0x477088['query']);_0x2558fe[_0xe25d('0x3b')]=_[_0xe25d('0x3c')](_0x2558fe[_0xe25d('0x3d')],_0x2558fe[_0xe25d('0x39')]);_0x240ffb[_0xe25d('0x3e')]=_[_0xe25d('0x3c')](_0x2558fe[_0xe25d('0x3d')],qs['fields'](_0x477088[_0xe25d('0x39')][_0xe25d('0x3f')]));_0x240ffb[_0xe25d('0x3e')]=_0x240ffb[_0xe25d('0x3e')][_0xe25d('0x40')]?_0x240ffb[_0xe25d('0x3e')]:_0x2558fe[_0xe25d('0x3d')];if(!_0x477088[_0xe25d('0x39')][_0xe25d('0x41')]('nolimit')){_0x240ffb[_0xe25d('0x42')]=qs[_0xe25d('0x42')](_0x477088[_0xe25d('0x39')][_0xe25d('0x42')]);_0x240ffb[_0xe25d('0x25')]=qs['offset'](_0x477088[_0xe25d('0x39')]['offset']);}_0x240ffb[_0xe25d('0x43')]=qs[_0xe25d('0x44')](_0x477088[_0xe25d('0x39')]['sort']);_0x240ffb['where']=qs[_0xe25d('0x3b')](_[_0xe25d('0x45')](_0x477088[_0xe25d('0x39')],_0x2558fe[_0xe25d('0x3b')]),_0xfe23ef);if(_0x477088[_0xe25d('0x39')][_0xe25d('0x46')]){_0x240ffb[_0xe25d('0x47')]=_[_0xe25d('0x48')](_0x240ffb[_0xe25d('0x47')],{'$or':_[_0xe25d('0x34')](_0xfe23ef,function(_0x19de5c){if(_0x19de5c[_0xe25d('0x49')]!==_0xe25d('0x4a')){var _0x32ff7f={};_0x32ff7f[_0x19de5c[_0xe25d('0x32')]]={'$like':'%'+_0x477088['query'][_0xe25d('0x46')]+'%'};return _0x32ff7f;}})});}_0x240ffb=_[_0xe25d('0x48')]({},_0x240ffb,_0x477088[_0xe25d('0x4b')]);var _0x4e7404={'where':_0x240ffb[_0xe25d('0x47')]};return db[_0xe25d('0x35')][_0xe25d('0x27')](_0x4e7404)[_0xe25d('0x2e')](function(_0x450727){_0x4a52e4[_0xe25d('0x27')]=_0x450727;if(_0x477088[_0xe25d('0x39')]['includeAll']){_0x240ffb[_0xe25d('0x4c')]=[{'all':!![]}];}return db[_0xe25d('0x35')][_0xe25d('0x4d')](_0x240ffb);})['then'](function(_0x24baf1){_0x4a52e4[_0xe25d('0x4e')]=_0x24baf1;return _0x4a52e4;})[_0xe25d('0x2e')](respondWithFilteredResult(_0x496e42,_0x240ffb))[_0xe25d('0x4f')](handleError(_0x496e42,null));};exports[_0xe25d('0x50')]=function(_0x412d38,_0x397ed1){var _0x25e77c={'raw':![],'where':{'id':_0x412d38['params']['id']}},_0x14294a={};_0x14294a[_0xe25d('0x3d')]=_[_0xe25d('0x3a')](db[_0xe25d('0x35')][_0xe25d('0x36')]);_0x14294a[_0xe25d('0x39')]=_[_0xe25d('0x3a')](_0x412d38[_0xe25d('0x39')]);_0x14294a[_0xe25d('0x3b')]=_[_0xe25d('0x3c')](_0x14294a[_0xe25d('0x3d')],_0x14294a[_0xe25d('0x39')]);_0x25e77c[_0xe25d('0x3e')]=_[_0xe25d('0x3c')](_0x14294a['model'],qs[_0xe25d('0x3f')](_0x412d38['query'][_0xe25d('0x3f')]));_0x25e77c['attributes']=_0x25e77c[_0xe25d('0x3e')][_0xe25d('0x40')]?_0x25e77c[_0xe25d('0x3e')]:_0x14294a[_0xe25d('0x3d')];if(_0x412d38[_0xe25d('0x39')][_0xe25d('0x51')]){_0x25e77c[_0xe25d('0x4c')]=[{'all':!![]}];}_0x25e77c=_['merge']({},_0x25e77c,_0x412d38[_0xe25d('0x4b')]);return db[_0xe25d('0x35')][_0xe25d('0x52')](_0x25e77c)['then'](handleEntityNotFound(_0x397ed1,null))[_0xe25d('0x2e')](respondWithResult(_0x397ed1,null))['catch'](handleError(_0x397ed1,null));};exports[_0xe25d('0x53')]=function(_0x319c98,_0xfb2b71){return db['VoiceQueueReport'][_0xe25d('0x53')](_0x319c98[_0xe25d('0x54')],{})[_0xe25d('0x2e')](respondWithResult(_0xfb2b71,0xc9))['catch'](handleError(_0xfb2b71,null));};exports['update']=function(_0x5c26dd,_0x283a32){if(_0x5c26dd['body']['id']){delete _0x5c26dd[_0xe25d('0x54')]['id'];}return db[_0xe25d('0x35')][_0xe25d('0x52')]({'where':{'id':_0x5c26dd[_0xe25d('0x55')]['id']}})[_0xe25d('0x2e')](handleEntityNotFound(_0x283a32,null))[_0xe25d('0x2e')](saveUpdates(_0x5c26dd[_0xe25d('0x54')],null))[_0xe25d('0x2e')](respondWithResult(_0x283a32,null))[_0xe25d('0x4f')](handleError(_0x283a32,null));};exports[_0xe25d('0x2f')]=function(_0x4fa952,_0x4238c3){return db[_0xe25d('0x35')][_0xe25d('0x52')]({'where':{'id':_0x4fa952[_0xe25d('0x55')]['id']}})[_0xe25d('0x2e')](handleEntityNotFound(_0x4238c3,null))['then'](removeEntity(_0x4238c3,null))[_0xe25d('0x4f')](handleError(_0x4238c3,null));};exports[_0xe25d('0x56')]=function(_0x4c4e4c,_0x589ca8){return db[_0xe25d('0x35')][_0xe25d('0x56')]()[_0xe25d('0x2e')](respondWithResult(_0x589ca8,null))['catch'](handleError(_0x589ca8,null));};exports[_0xe25d('0x57')]=function(_0xc26d3e,_0x3be48a){var _0x2c2d87={},_0x54637e={},_0x2c1342={'count':0x0,'rows':[]};_0x54637e[_0xe25d('0x3d')]=_['keys'](db['VoiceQueueReport'][_0xe25d('0x36')]);_0x54637e['query']=_[_0xe25d('0x3a')](_0xc26d3e['query']);_0x54637e[_0xe25d('0x3b')]=_[_0xe25d('0x3c')](_0x54637e['model'],_0x54637e[_0xe25d('0x39')]);_0x2c2d87['attributes']=_[_0xe25d('0x3c')](_0x54637e[_0xe25d('0x3d')],qs[_0xe25d('0x3f')](_0xc26d3e[_0xe25d('0x39')][_0xe25d('0x3f')]));_0x2c2d87[_0xe25d('0x3e')]=_0x2c2d87[_0xe25d('0x3e')][_0xe25d('0x40')]?_0x2c2d87[_0xe25d('0x3e')]:_0x54637e[_0xe25d('0x3d')];if(!_0xc26d3e['query'][_0xe25d('0x41')](_0xe25d('0x58'))){_0x2c2d87[_0xe25d('0x42')]=qs['limit'](_0xc26d3e[_0xe25d('0x39')][_0xe25d('0x42')]);_0x2c2d87[_0xe25d('0x25')]=qs['offset'](_0xc26d3e[_0xe25d('0x39')][_0xe25d('0x25')]);}_0x2c2d87[_0xe25d('0x43')]=qs['sort'](_0xc26d3e[_0xe25d('0x39')][_0xe25d('0x44')]);_0x2c2d87[_0xe25d('0x47')]=qs[_0xe25d('0x3b')](_[_0xe25d('0x45')](_0xc26d3e['query'],_0x54637e['filters']));if(_0xc26d3e[_0xe25d('0x39')][_0xe25d('0x46')]){_0x2c2d87[_0xe25d('0x47')]=_[_0xe25d('0x48')](_0x2c2d87['where'],{'$or':_[_0xe25d('0x34')](_0x2c2d87['attributes'],function(_0x5c6b92){var _0x2f7ee1={};_0x2f7ee1[_0x5c6b92]={'$like':'%'+_0xc26d3e[_0xe25d('0x39')][_0xe25d('0x46')]+'%'};return _0x2f7ee1;})});}_0x2c2d87=_['merge']({},_0x2c2d87,_0xc26d3e[_0xe25d('0x4b')]);var _0x150154={'where':_0x2c2d87[_0xe25d('0x47')]};return db[_0xe25d('0x35')][_0xe25d('0x27')](_0x150154)[_0xe25d('0x2e')](function(_0x484c17){_0x2c1342['count']=_0x484c17;if(_0xc26d3e[_0xe25d('0x39')]['includeAll']){_0x2c2d87['include']=[{'all':!![]}];}return db[_0xe25d('0x35')]['findAll'](_0x2c2d87);})[_0xe25d('0x2e')](function(_0x10c5ce){_0x2c1342[_0xe25d('0x4e')]=_0x10c5ce;return _0x2c1342;})['then'](respondWithFilteredResult(_0x3be48a,_0x2c2d87,'getVoiceQueuesReport'))[_0xe25d('0x4f')](handleError(_0x3be48a,null,_0xe25d('0x57')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2d6026c..d897c8d 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 _0x3c69=['remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save','update'];(function(_0x130064,_0x38817b){var _0x44913a=function(_0x45901c){while(--_0x45901c){_0x130064['push'](_0x130064['shift']());}};_0x44913a(++_0x38817b);}(_0x3c69,0x1bd));var _0x93c6=function(_0x46ee6b,_0x7f3e6c){_0x46ee6b=_0x46ee6b-0x0;var _0x97d54b=_0x3c69[_0x46ee6b];return _0x97d54b;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x93c6('0x0')](0x0);var events={'afterCreate':_0x93c6('0x1'),'afterUpdate':_0x93c6('0x2'),'afterDestroy':_0x93c6('0x3')};function emitEvent(_0x4f658e){return function(_0x5746e1,_0x4936d6,_0x40a66b){VoiceQueueReportEvents['emit'](_0x4f658e+':'+_0x5746e1['id'],_0x5746e1);VoiceQueueReportEvents[_0x93c6('0x4')](_0x4f658e,_0x5746e1);_0x40a66b(null);};}for(var e in events){if(events[_0x93c6('0x5')](e)){var event=events[e];VoiceQueueReport[_0x93c6('0x6')](e,emitEvent(event));}}module[_0x93c6('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x1cd4=['emit','hasOwnProperty','hook','exports','events','VoiceQueueReport','save','update','remove'];(function(_0x19b553,_0x345691){var _0x29678e=function(_0x34638e){while(--_0x34638e){_0x19b553['push'](_0x19b553['shift']());}};_0x29678e(++_0x345691);}(_0x1cd4,0x136));var _0x41cd=function(_0x130030,_0x1f237a){_0x130030=_0x130030-0x0;var _0x283503=_0x1cd4[_0x130030];return _0x283503;};'use strict';var EventEmitter=require(_0x41cd('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x41cd('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x41cd('0x2'),'afterUpdate':_0x41cd('0x3'),'afterDestroy':_0x41cd('0x4')};function emitEvent(_0x2b77ba){return function(_0x445421,_0x40f6ae,_0x5e5b50){VoiceQueueReportEvents['emit'](_0x2b77ba+':'+_0x445421['id'],_0x445421);VoiceQueueReportEvents[_0x41cd('0x5')](_0x2b77ba,_0x445421);_0x5e5b50(null);};}for(var e in events){if(events[_0x41cd('0x6')](e)){var event=events[e];VoiceQueueReport[_0x41cd('0x7')](e,emitEvent(event));}}module[_0x41cd('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 30f4e21..8cf34d4 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 _0xbaa2=['rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0xbaa2,0x171));var _0x2baa=function(_0x3dc49e,_0x549c70){_0x3dc49e=_0x3dc49e-0x0;var _0x1d8966=_0xbaa2[_0x3dc49e];return _0x1d8966;};'use strict';var _=require(_0x2baa('0x0'));var util=require(_0x2baa('0x1'));var logger=require(_0x2baa('0x2'))(_0x2baa('0x3'));var moment=require(_0x2baa('0x4'));var BPromise=require(_0x2baa('0x5'));var rp=require(_0x2baa('0x6'));var fs=require('fs');var path=require(_0x2baa('0x7'));var rimraf=require(_0x2baa('0x8'));var config=require(_0x2baa('0x9'));var attributes=require(_0x2baa('0xa'));module[_0x2baa('0xb')]=function(_0x813a97,_0x457ea9){return _0x813a97[_0x2baa('0xc')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53a4=['rimraf','../../config/environment','./voiceQueueReport.attributes','exports','report_queue','uniqueid','lodash','api','moment','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x53a4,0x1e6));var _0x453a=function(_0xd047e1,_0x12d4d6){_0xd047e1=_0xd047e1-0x0;var _0x3c6056=_0x53a4[_0xd047e1];return _0x3c6056;};'use strict';var _=require(_0x453a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x453a('0x1'));var moment=require(_0x453a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x453a('0x3'));var rimraf=require(_0x453a('0x4'));var config=require(_0x453a('0x5'));var attributes=require(_0x453a('0x6'));module[_0x453a('0x7')]=function(_0x428f9c,_0x286116){return _0x428f9c['define']('VoiceQueueReport',attributes,{'tableName':_0x453a('0x8'),'paranoid':![],'indexes':[{'fields':[_0x453a('0x9')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index b91aed2..c80b8c6 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 _0xbb60=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','create','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','where','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4abce3,_0x29b087){var _0x48be14=function(_0x422df1){while(--_0x422df1){_0x4abce3['push'](_0x4abce3['shift']());}};_0x48be14(++_0x29b087);}(_0xbb60,0x1c7));var _0x0bb6=function(_0x59d0d0,_0x294784){_0x59d0d0=_0x59d0d0-0x0;var _0x506f29=_0xbb60[_0x59d0d0];return _0x506f29;};'use strict';var _=require(_0x0bb6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0bb6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bb6('0x2'));var db=require(_0x0bb6('0x3'))['db'];var utils=require(_0x0bb6('0x4'));var logger=require(_0x0bb6('0x5'))(_0x0bb6('0x6'));var config=require(_0x0bb6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0bb6('0x8')]['http']({'port':0x232a});config[_0x0bb6('0x9')]=_[_0x0bb6('0xa')](config[_0x0bb6('0x9')],{'host':_0x0bb6('0xb'),'port':0x18eb});var socket=require(_0x0bb6('0xc'))(new Redis(config[_0x0bb6('0x9')]));require(_0x0bb6('0xd'))[_0x0bb6('0xe')](socket);function respondWithRpcPromise(_0x2e6042,_0x53d046,_0x320e25){return new BPromise(function(_0x5bc423,_0x246f56){return client['request'](_0x2e6042,_0x320e25)[_0x0bb6('0xf')](function(_0x23a3b6){logger[_0x0bb6('0x10')](_0x0bb6('0x11'),_0x53d046,_0x0bb6('0x12'));logger[_0x0bb6('0x13')](_0x0bb6('0x14'),_0x53d046,_0x0bb6('0x12'),JSON[_0x0bb6('0x15')](_0x23a3b6));if(_0x23a3b6[_0x0bb6('0x16')]){if(_0x23a3b6[_0x0bb6('0x16')][_0x0bb6('0x17')]===0x1f4){logger[_0x0bb6('0x16')](_0x0bb6('0x11'),_0x53d046,_0x23a3b6['error'][_0x0bb6('0x18')]);return _0x246f56(_0x23a3b6[_0x0bb6('0x16')][_0x0bb6('0x18')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x53d046,_0x23a3b6[_0x0bb6('0x16')][_0x0bb6('0x18')]);return _0x5bc423(_0x23a3b6[_0x0bb6('0x16')][_0x0bb6('0x18')]);}else{logger[_0x0bb6('0x10')](_0x0bb6('0x11'),_0x53d046,_0x0bb6('0x12'));_0x5bc423(_0x23a3b6['result'][_0x0bb6('0x18')]);}})[_0x0bb6('0x19')](function(_0x278a81){logger['error'](_0x0bb6('0x11'),_0x53d046,_0x278a81);_0x246f56(_0x278a81);});});}exports[_0x0bb6('0x1a')]=function(_0xf43d0f){var _0xa690e8=this;return new Promise(function(_0x4e9930,_0x1b78df){return db[_0x0bb6('0x1b')][_0x0bb6('0x1c')]({'raw':_0xf43d0f[_0x0bb6('0x1d')]?_0xf43d0f['options'][_0x0bb6('0x1e')]===undefined?!![]:![]:!![],'where':_0xf43d0f['options']?_0xf43d0f['options']['where']||null:null,'attributes':_0xf43d0f[_0x0bb6('0x1d')]?_0xf43d0f[_0x0bb6('0x1d')][_0x0bb6('0x1f')]||null:null,'limit':_0xf43d0f[_0x0bb6('0x1d')]?_0xf43d0f[_0x0bb6('0x1d')][_0x0bb6('0x20')]||null:null,'include':_0xf43d0f[_0x0bb6('0x1d')]?_0xf43d0f[_0x0bb6('0x1d')][_0x0bb6('0x21')]?_[_0x0bb6('0x22')](_0xf43d0f[_0x0bb6('0x1d')][_0x0bb6('0x21')],function(_0x42e0e4){return{'model':db[_0x42e0e4[_0x0bb6('0x23')]],'as':_0x42e0e4['as'],'attributes':_0x42e0e4[_0x0bb6('0x1f')],'include':_0x42e0e4[_0x0bb6('0x21')]?_[_0x0bb6('0x22')](_0x42e0e4[_0x0bb6('0x21')],function(_0x551851){return{'model':db[_0x551851[_0x0bb6('0x23')]],'as':_0x551851['as'],'attributes':_0x551851[_0x0bb6('0x1f')],'include':_0x551851[_0x0bb6('0x21')]?_[_0x0bb6('0x22')](_0x551851[_0x0bb6('0x21')],function(_0x803020){return{'model':db[_0x803020['model']],'as':_0x803020['as'],'attributes':_0x803020['attributes']};}):[]};}):[]};}):[]:[]})[_0x0bb6('0xf')](function(_0x548b31){logger[_0x0bb6('0x10')](_0x0bb6('0x1a'),_0xf43d0f);logger[_0x0bb6('0x13')]('GetVoiceQueueReport',_0xf43d0f,JSON[_0x0bb6('0x15')](_0x548b31));_0x4e9930(_0x548b31);})['catch'](function(_0x38259f){logger[_0x0bb6('0x16')](_0x0bb6('0x1a'),_0x38259f[_0x0bb6('0x18')],_0xf43d0f);_0x1b78df(_0xa690e8[_0x0bb6('0x16')](0x1f4,_0x38259f['message']));});});};exports['CreateVoiceQueueReport']=function(_0x1deebd){var _0x1cc297=this;return new Promise(function(_0x32b45d,_0x5c9478){return db[_0x0bb6('0x1b')][_0x0bb6('0x24')](_0x1deebd['body'],{'raw':_0x1deebd[_0x0bb6('0x1d')]?_0x1deebd[_0x0bb6('0x1d')][_0x0bb6('0x1e')]===undefined?!![]:![]:!![]})[_0x0bb6('0xf')](function(_0x5681e8){logger[_0x0bb6('0x10')](_0x0bb6('0x25'),_0x1deebd);logger[_0x0bb6('0x13')](_0x0bb6('0x25'),_0x1deebd,JSON[_0x0bb6('0x15')](_0x5681e8));_0x32b45d(_0x5681e8);})[_0x0bb6('0x19')](function(_0x5a2a19){logger[_0x0bb6('0x16')](_0x0bb6('0x25'),_0x5a2a19[_0x0bb6('0x18')],_0x1deebd);_0x5c9478(_0x1cc297['error'](0x1f4,_0x5a2a19['message']));});});};exports[_0x0bb6('0x26')]=function(_0x2be213){var _0x1dd59c=this;return new Promise(function(_0x340dc7,_0x5b301e){return db['VoiceQueueReport'][_0x0bb6('0x27')](_0x2be213[_0x0bb6('0x28')],{'raw':_0x2be213[_0x0bb6('0x1d')]?_0x2be213['options'][_0x0bb6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2be213[_0x0bb6('0x1d')]?_0x2be213[_0x0bb6('0x1d')][_0x0bb6('0x29')]||null:null,'attributes':_0x2be213[_0x0bb6('0x1d')]?_0x2be213[_0x0bb6('0x1d')][_0x0bb6('0x1f')]||null:null,'limit':_0x2be213[_0x0bb6('0x1d')]?_0x2be213[_0x0bb6('0x1d')][_0x0bb6('0x20')]||null:null})[_0x0bb6('0xf')](function(_0xf67ece){logger[_0x0bb6('0x10')](_0x0bb6('0x26'),_0x2be213);logger['debug']('UpdateVoiceQueueReport',_0x2be213,JSON['stringify'](_0xf67ece));_0x340dc7(_0xf67ece);})[_0x0bb6('0x19')](function(_0x58ca2d){logger[_0x0bb6('0x16')]('UpdateVoiceQueueReport',_0x58ca2d[_0x0bb6('0x18')],_0x2be213);_0x5b301e(_0x1dd59c[_0x0bb6('0x16')](0x1f4,_0x58ca2d['message']));});});}; \ No newline at end of file +var _0x3a9f=['redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','include','model','map','CreateVoiceQueueReport','create','body','update','where','limit','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3a9f,0x129));var _0xf3a9=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x3a9f[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0xf3a9('0x0'));var util=require(_0xf3a9('0x1'));var moment=require(_0xf3a9('0x2'));var BPromise=require(_0xf3a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3a9('0x5'));var logger=require(_0xf3a9('0x6'))('rpc');var config=require(_0xf3a9('0x7'));var jayson=require(_0xf3a9('0x8'));var client=jayson[_0xf3a9('0x9')]['http']({'port':0x232a});config['redis']=_[_0xf3a9('0xa')](config[_0xf3a9('0xb')],{'host':_0xf3a9('0xc'),'port':0x18eb});var socket=require(_0xf3a9('0xd'))(new Redis(config[_0xf3a9('0xb')]));require(_0xf3a9('0xe'))[_0xf3a9('0xf')](socket);function respondWithRpcPromise(_0x27aaf6,_0x22bb24,_0x53216e){return new BPromise(function(_0x3c2be,_0x171631){return client['request'](_0x27aaf6,_0x53216e)[_0xf3a9('0x10')](function(_0x1d3ffc){logger[_0xf3a9('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x22bb24,'request\x20sent');logger[_0xf3a9('0x12')](_0xf3a9('0x13'),_0x22bb24,_0xf3a9('0x14'),JSON[_0xf3a9('0x15')](_0x1d3ffc));if(_0x1d3ffc[_0xf3a9('0x16')]){if(_0x1d3ffc[_0xf3a9('0x16')][_0xf3a9('0x17')]===0x1f4){logger[_0xf3a9('0x16')](_0xf3a9('0x18'),_0x22bb24,_0x1d3ffc[_0xf3a9('0x16')][_0xf3a9('0x19')]);return _0x171631(_0x1d3ffc[_0xf3a9('0x16')][_0xf3a9('0x19')]);}logger[_0xf3a9('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x22bb24,_0x1d3ffc['error']['message']);return _0x3c2be(_0x1d3ffc[_0xf3a9('0x16')][_0xf3a9('0x19')]);}else{logger[_0xf3a9('0x11')](_0xf3a9('0x18'),_0x22bb24,_0xf3a9('0x14'));_0x3c2be(_0x1d3ffc[_0xf3a9('0x1a')][_0xf3a9('0x19')]);}})[_0xf3a9('0x1b')](function(_0x478bd7){logger[_0xf3a9('0x16')](_0xf3a9('0x18'),_0x22bb24,_0x478bd7);_0x171631(_0x478bd7);});});}exports[_0xf3a9('0x1c')]=function(_0x3c25a6){var _0x35d35f=this;return new Promise(function(_0x39a2a1,_0x3ce68d){return db[_0xf3a9('0x1d')][_0xf3a9('0x1e')]({'raw':_0x3c25a6[_0xf3a9('0x1f')]?_0x3c25a6[_0xf3a9('0x1f')][_0xf3a9('0x20')]===undefined?!![]:![]:!![],'where':_0x3c25a6[_0xf3a9('0x1f')]?_0x3c25a6['options']['where']||null:null,'attributes':_0x3c25a6['options']?_0x3c25a6[_0xf3a9('0x1f')][_0xf3a9('0x21')]||null:null,'limit':_0x3c25a6[_0xf3a9('0x1f')]?_0x3c25a6[_0xf3a9('0x1f')]['limit']||null:null,'include':_0x3c25a6['options']?_0x3c25a6[_0xf3a9('0x1f')][_0xf3a9('0x22')]?_['map'](_0x3c25a6[_0xf3a9('0x1f')]['include'],function(_0x1fb1fd){return{'model':db[_0x1fb1fd[_0xf3a9('0x23')]],'as':_0x1fb1fd['as'],'attributes':_0x1fb1fd[_0xf3a9('0x21')],'include':_0x1fb1fd[_0xf3a9('0x22')]?_[_0xf3a9('0x24')](_0x1fb1fd[_0xf3a9('0x22')],function(_0x1fc329){return{'model':db[_0x1fc329[_0xf3a9('0x23')]],'as':_0x1fc329['as'],'attributes':_0x1fc329['attributes'],'include':_0x1fc329[_0xf3a9('0x22')]?_[_0xf3a9('0x24')](_0x1fc329[_0xf3a9('0x22')],function(_0x2c4ded){return{'model':db[_0x2c4ded['model']],'as':_0x2c4ded['as'],'attributes':_0x2c4ded[_0xf3a9('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf3a9('0x10')](function(_0xeac9f0){logger[_0xf3a9('0x11')](_0xf3a9('0x1c'),_0x3c25a6);logger[_0xf3a9('0x12')]('GetVoiceQueueReport',_0x3c25a6,JSON[_0xf3a9('0x15')](_0xeac9f0));_0x39a2a1(_0xeac9f0);})[_0xf3a9('0x1b')](function(_0x112a7e){logger[_0xf3a9('0x16')](_0xf3a9('0x1c'),_0x112a7e[_0xf3a9('0x19')],_0x3c25a6);_0x3ce68d(_0x35d35f[_0xf3a9('0x16')](0x1f4,_0x112a7e[_0xf3a9('0x19')]));});});};exports[_0xf3a9('0x25')]=function(_0x46c6d0){var _0x1c7b7f=this;return new Promise(function(_0x2a9e70,_0x2bec46){return db[_0xf3a9('0x1d')][_0xf3a9('0x26')](_0x46c6d0[_0xf3a9('0x27')],{'raw':_0x46c6d0[_0xf3a9('0x1f')]?_0x46c6d0[_0xf3a9('0x1f')][_0xf3a9('0x20')]===undefined?!![]:![]:!![]})[_0xf3a9('0x10')](function(_0x2df74d){logger[_0xf3a9('0x11')](_0xf3a9('0x25'),_0x46c6d0);logger[_0xf3a9('0x12')]('CreateVoiceQueueReport',_0x46c6d0,JSON[_0xf3a9('0x15')](_0x2df74d));_0x2a9e70(_0x2df74d);})[_0xf3a9('0x1b')](function(_0x59ced5){logger['error'](_0xf3a9('0x25'),_0x59ced5[_0xf3a9('0x19')],_0x46c6d0);_0x2bec46(_0x1c7b7f['error'](0x1f4,_0x59ced5[_0xf3a9('0x19')]));});});};exports['UpdateVoiceQueueReport']=function(_0xccb150){var _0x122b0e=this;return new Promise(function(_0x3e3260,_0x94c187){return db[_0xf3a9('0x1d')][_0xf3a9('0x28')](_0xccb150[_0xf3a9('0x27')],{'raw':_0xccb150[_0xf3a9('0x1f')]?_0xccb150[_0xf3a9('0x1f')][_0xf3a9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xccb150[_0xf3a9('0x1f')]?_0xccb150[_0xf3a9('0x1f')][_0xf3a9('0x29')]||null:null,'attributes':_0xccb150[_0xf3a9('0x1f')]?_0xccb150[_0xf3a9('0x1f')]['attributes']||null:null,'limit':_0xccb150['options']?_0xccb150[_0xf3a9('0x1f')][_0xf3a9('0x2a')]||null:null})[_0xf3a9('0x10')](function(_0x26fba1){logger[_0xf3a9('0x11')](_0xf3a9('0x2b'),_0xccb150);logger[_0xf3a9('0x12')](_0xf3a9('0x2b'),_0xccb150,JSON[_0xf3a9('0x15')](_0x26fba1));_0x3e3260(_0x26fba1);})[_0xf3a9('0x1b')](function(_0x54368c){logger[_0xf3a9('0x16')](_0xf3a9('0x2b'),_0x54368c[_0xf3a9('0x19')],_0xccb150);_0x94c187(_0x122b0e[_0xf3a9('0x16')](0x1f4,_0x54368c[_0xf3a9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 831e2e1..dddcde2 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 _0xb5ec=['save','remove','update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x5d3ec6,_0x11a5ba){var _0x50d6ce=function(_0x24c5dc){while(--_0x24c5dc){_0x5d3ec6['push'](_0x5d3ec6['shift']());}};_0x50d6ce(++_0x11a5ba);}(_0xb5ec,0x97));var _0xcb5e=function(_0x38b158,_0x359bbb){_0x38b158=_0x38b158-0x0;var _0x237840=_0xb5ec[_0x38b158];return _0x237840;};'use strict';var VoiceQueueReportEvents=require(_0xcb5e('0x0'));var events=[_0xcb5e('0x1'),_0xcb5e('0x2'),_0xcb5e('0x3')];function createListener(_0x4830bc,_0x7d5379){return function(_0x41a291){_0x7d5379[_0xcb5e('0x4')](_0x4830bc,_0x41a291);};}function removeListener(_0x58b83a,_0x421351){return function(){VoiceQueueReportEvents['removeListener'](_0x58b83a,_0x421351);};}exports[_0xcb5e('0x5')]=function(_0xfbd838){for(var _0x38fd3e=0x0,_0x20e2a2=events[_0xcb5e('0x6')];_0x38fd3e<_0x20e2a2;_0x38fd3e++){var _0x3a51a8=events[_0x38fd3e];var _0x1c9952=createListener(_0xcb5e('0x7')+_0x3a51a8,_0xfbd838);VoiceQueueReportEvents['on'](_0x3a51a8,_0x1c9952);}}; \ No newline at end of file +var _0x433a=['removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','emit'];(function(_0x2ae278,_0x5eb5a4){var _0x412c37=function(_0xcaab64){while(--_0xcaab64){_0x2ae278['push'](_0x2ae278['shift']());}};_0x412c37(++_0x5eb5a4);}(_0x433a,0x14c));var _0xa433=function(_0xd5944e,_0x48b192){_0xd5944e=_0xd5944e-0x0;var _0x48afb4=_0x433a[_0xd5944e];return _0x48afb4;};'use strict';var VoiceQueueReportEvents=require(_0xa433('0x0'));var events=[_0xa433('0x1'),_0xa433('0x2'),'update'];function createListener(_0x29307f,_0x44c87a){return function(_0x22ac7b){_0x44c87a[_0xa433('0x3')](_0x29307f,_0x22ac7b);};}function removeListener(_0x4a4d5c,_0x22f282){return function(){VoiceQueueReportEvents[_0xa433('0x4')](_0x4a4d5c,_0x22f282);};}exports['register']=function(_0x333987){for(var _0x4117cb=0x0,_0x406fd6=events[_0xa433('0x5')];_0x4117cb<_0x406fd6;_0x4117cb++){var _0x29fb63=events[_0x4117cb];var _0x59fbe9=createListener(_0xa433('0x6')+_0x29fb63,_0x333987);VoiceQueueReportEvents['on'](_0x29fb63,_0x59fbe9);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index fb49c63..a1e98b7 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 _0x8cb4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8cb4,0xf3));var _0x48cb=function(_0x11c270,_0x358456){_0x11c270=_0x11c270-0x0;var _0x59ed65=_0x8cb4[_0x11c270];return _0x59ed65;};'use strict';var multer=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var path=require(_0x48cb('0x2'));var timeout=require('connect-timeout');var express=require(_0x48cb('0x3'));var router=express[_0x48cb('0x4')]();var fs_extra=require(_0x48cb('0x5'));var auth=require(_0x48cb('0x6'));var interaction=require(_0x48cb('0x7'));var config=require(_0x48cb('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x48cb('0x9')](),controller[_0x48cb('0xa')]);router[_0x48cb('0xb')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller['show']);router['post']('/',auth[_0x48cb('0x9')](),controller[_0x48cb('0xd')]);router[_0x48cb('0xe')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller[_0x48cb('0xf')]);router[_0x48cb('0x10')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller[_0x48cb('0x11')]);module[_0x48cb('0x12')]=router; \ No newline at end of file +var _0xccb9=['show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xccb9,0x124));var _0x9ccb=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0xccb9[_0x44268d];return _0x4be92d;};'use strict';var multer=require(_0x9ccb('0x0'));var util=require('util');var path=require(_0x9ccb('0x1'));var timeout=require(_0x9ccb('0x2'));var express=require(_0x9ccb('0x3'));var router=express[_0x9ccb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ccb('0x5'));var interaction=require(_0x9ccb('0x6'));var config=require(_0x9ccb('0x7'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x9ccb('0x8')](),controller[_0x9ccb('0x9')]);router[_0x9ccb('0xa')](_0x9ccb('0xb'),auth[_0x9ccb('0x8')](),controller[_0x9ccb('0xc')]);router[_0x9ccb('0xd')]('/',auth['isAuthenticated'](),controller[_0x9ccb('0xe')]);router[_0x9ccb('0xf')](_0x9ccb('0xb'),auth[_0x9ccb('0x8')](),controller[_0x9ccb('0x10')]);router[_0x9ccb('0x11')](_0x9ccb('0xb'),auth[_0x9ccb('0x8')](),controller[_0x9ccb('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 32518b7..29570ed 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 _0x179b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING'];(function(_0x12fa3f,_0xa076ed){var _0x33baf3=function(_0x42f6e2){while(--_0x42f6e2){_0x12fa3f['push'](_0x12fa3f['shift']());}};_0x33baf3(++_0xa076ed);}(_0x179b,0x171));var _0xb179=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x179b[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0xb179('0x0'));var moment=require('moment');module[_0xb179('0x1')]={'time':{'type':Sequelize[_0xb179('0x2')]},'callid':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb179('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb179('0x3')],'allowNull':![],'defaultValue':moment()[_0xb179('0x4')](_0xb179('0x5'))}}; \ No newline at end of file +var _0x63eb=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x63eb,0x195));var _0xb63e=function(_0xfe657b,_0x596d9f){_0xfe657b=_0xfe657b-0x0;var _0x3bc18d=_0x63eb[_0xfe657b];return _0x3bc18d;};'use strict';var Sequelize=require(_0xb63e('0x0'));var moment=require(_0xb63e('0x1'));module[_0xb63e('0x2')]={'time':{'type':Sequelize[_0xb63e('0x3')]},'callid':{'type':Sequelize[_0xb63e('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb63e('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb63e('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb63e('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb63e('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb63e('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb63e('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xb63e('0x4')](_0xb63e('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 7898c4e..1b4e159 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 _0x8ae2=['count','set','Content-Range','save','update','destroy','then','error','stack','name','send','VoiceQueuesLog','fieldName','type','key','model','map','query','filters','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','keys','rawAttributes','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0xeb603e,_0x420fb0){var _0x15f7bf=function(_0x59f33d){while(--_0x59f33d){_0xeb603e['push'](_0xeb603e['shift']());}};_0x15f7bf(++_0x420fb0);}(_0x8ae2,0x140));var _0x28ae=function(_0x28f1ac,_0x4a2725){_0x28f1ac=_0x28f1ac-0x0;var _0xf0b934=_0x8ae2[_0x28f1ac];return _0xf0b934;};'use strict';var emlformat=require(_0x28ae('0x0'));var rimraf=require(_0x28ae('0x1'));var zipdir=require(_0x28ae('0x2'));var jsonpatch=require(_0x28ae('0x3'));var rp=require('request-promise');var moment=require(_0x28ae('0x4'));var BPromise=require(_0x28ae('0x5'));var Mustache=require('mustache');var util=require(_0x28ae('0x6'));var path=require('path');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(_0x28ae('0xa'));var crypto=require(_0x28ae('0xb'));var jsforce=require(_0x28ae('0xc'));var deskjs=require(_0x28ae('0xd'));var toCsv=require(_0x28ae('0xe'));var querystring=require('querystring');var Papa=require(_0x28ae('0xf'));var Redis=require(_0x28ae('0x10'));var authService=require(_0x28ae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x28ae('0x12'));var hardwareService=require(_0x28ae('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x28ae('0x14'));var licenseUtil=require(_0x28ae('0x15'));var db=require(_0x28ae('0x16'))['db'];function respondWithStatusCode(_0x26e228,_0x53a917){_0x53a917=_0x53a917||0xcc;return function(_0x3083a4){if(_0x3083a4){return _0x26e228[_0x28ae('0x17')](_0x53a917);}return _0x26e228[_0x28ae('0x18')](_0x53a917)[_0x28ae('0x19')]();};}function respondWithResult(_0x3229e3,_0x52a096){_0x52a096=_0x52a096||0xc8;return function(_0x1b4704){if(_0x1b4704){return _0x3229e3[_0x28ae('0x18')](_0x52a096)[_0x28ae('0x1a')](_0x1b4704);}};}function respondWithFilteredResult(_0x48e4ed,_0x66c4fc){return function(_0x9966e0){if(_0x9966e0){var _0x8104e6=typeof _0x66c4fc[_0x28ae('0x1b')]===_0x28ae('0x1c')&&typeof _0x66c4fc[_0x28ae('0x1d')]===_0x28ae('0x1c');var _0x47a508=_0x9966e0['count'];var _0x90d212=_0x8104e6?0x0:_0x66c4fc[_0x28ae('0x1b')];var _0x4938c5=_0x8104e6?_0x9966e0[_0x28ae('0x1e')]:_0x66c4fc[_0x28ae('0x1b')]+_0x66c4fc['limit'];var _0x3ef524;if(_0x4938c5>=_0x47a508){_0x4938c5=_0x47a508;_0x3ef524=0xc8;}else{_0x3ef524=0xce;}_0x48e4ed['status'](_0x3ef524);return _0x48e4ed[_0x28ae('0x1f')](_0x28ae('0x20'),_0x90d212+'-'+_0x4938c5+'/'+_0x47a508)[_0x28ae('0x1a')](_0x9966e0);}return null;};}function patchUpdates(_0x1bd28f){return function(_0x2668b6){try{jsonpatch['apply'](_0x2668b6,_0x1bd28f,!![]);}catch(_0x50d4ed){return BPromise['reject'](_0x50d4ed);}return _0x2668b6[_0x28ae('0x21')]();};}function saveUpdates(_0x5410c3,_0x5d0ca1){return function(_0x172986){if(_0x172986){return _0x172986[_0x28ae('0x22')](_0x5410c3)['then'](function(_0xb660a4){return _0xb660a4;});}return null;};}function removeEntity(_0x3005ce,_0x184424){return function(_0x22134b){if(_0x22134b){return _0x22134b[_0x28ae('0x23')]()[_0x28ae('0x24')](function(){_0x3005ce[_0x28ae('0x18')](0xcc)[_0x28ae('0x19')]();});}};}function handleEntityNotFound(_0x30a875,_0x5ed4b5){return function(_0xc86528){if(!_0xc86528){_0x30a875[_0x28ae('0x17')](0x194);}return _0xc86528;};}function handleError(_0xfb21ef,_0x4bf5b6){_0x4bf5b6=_0x4bf5b6||0x1f4;return function(_0x1ab589){logger[_0x28ae('0x25')](_0x1ab589[_0x28ae('0x26')]);if(_0x1ab589[_0x28ae('0x27')]){delete _0x1ab589[_0x28ae('0x27')];}_0xfb21ef[_0x28ae('0x18')](_0x4bf5b6)[_0x28ae('0x28')](_0x1ab589);};}exports['index']=function(_0x5b571a,_0x58246f){var _0x58dea1={},_0x5e130d={},_0x57e0e6={'count':0x0,'rows':[]};var _0x5b5c3f=_['map'](db[_0x28ae('0x29')]['rawAttributes'],function(_0x2f1cf3){return{'name':_0x2f1cf3[_0x28ae('0x2a')],'type':_0x2f1cf3[_0x28ae('0x2b')][_0x28ae('0x2c')]};});_0x5e130d[_0x28ae('0x2d')]=_[_0x28ae('0x2e')](_0x5b5c3f,_0x28ae('0x27'));_0x5e130d[_0x28ae('0x2f')]=_['keys'](_0x5b571a['query']);_0x5e130d[_0x28ae('0x30')]=_['intersection'](_0x5e130d[_0x28ae('0x2d')],_0x5e130d[_0x28ae('0x2f')]);_0x58dea1[_0x28ae('0x31')]=_['intersection'](_0x5e130d[_0x28ae('0x2d')],qs['fields'](_0x5b571a['query'][_0x28ae('0x32')]));_0x58dea1[_0x28ae('0x31')]=_0x58dea1[_0x28ae('0x31')][_0x28ae('0x33')]?_0x58dea1[_0x28ae('0x31')]:_0x5e130d[_0x28ae('0x2d')];if(!_0x5b571a[_0x28ae('0x2f')]['hasOwnProperty'](_0x28ae('0x34'))){_0x58dea1[_0x28ae('0x1d')]=qs[_0x28ae('0x1d')](_0x5b571a[_0x28ae('0x2f')][_0x28ae('0x1d')]);_0x58dea1['offset']=qs['offset'](_0x5b571a[_0x28ae('0x2f')][_0x28ae('0x1b')]);}_0x58dea1['order']=qs[_0x28ae('0x35')](_0x5b571a[_0x28ae('0x2f')]['sort']);_0x58dea1['where']=qs[_0x28ae('0x30')](_[_0x28ae('0x36')](_0x5b571a[_0x28ae('0x2f')],_0x5e130d[_0x28ae('0x30')]),_0x5b5c3f);if(_0x5b571a['query'][_0x28ae('0x37')]){_0x58dea1[_0x28ae('0x38')]=_[_0x28ae('0x39')](_0x58dea1[_0x28ae('0x38')],{'$or':_[_0x28ae('0x2e')](_0x5b5c3f,function(_0x2792e5){if(_0x2792e5[_0x28ae('0x2b')]!==_0x28ae('0x3a')){var _0x171a16={};_0x171a16[_0x2792e5[_0x28ae('0x27')]]={'$like':'%'+_0x5b571a[_0x28ae('0x2f')][_0x28ae('0x37')]+'%'};return _0x171a16;}})});}_0x58dea1=_[_0x28ae('0x39')]({},_0x58dea1,_0x5b571a['options']);var _0x20da2d={'where':_0x58dea1[_0x28ae('0x38')]};return db['VoiceQueuesLog'][_0x28ae('0x1e')](_0x20da2d)[_0x28ae('0x24')](function(_0x1372a8){_0x57e0e6['count']=_0x1372a8;if(_0x5b571a['query'][_0x28ae('0x3b')]){_0x58dea1[_0x28ae('0x3c')]=[{'all':!![]}];}return db[_0x28ae('0x29')][_0x28ae('0x3d')](_0x58dea1);})[_0x28ae('0x24')](function(_0x51851c){_0x57e0e6[_0x28ae('0x3e')]=_0x51851c;return _0x57e0e6;})['then'](respondWithFilteredResult(_0x58246f,_0x58dea1))['catch'](handleError(_0x58246f,null));};exports['show']=function(_0x457725,_0x570e96){var _0xfa2f0d={'raw':!![],'where':{'id':_0x457725['params']['id']}},_0x1a4a64={};_0x1a4a64['model']=_[_0x28ae('0x3f')](db[_0x28ae('0x29')][_0x28ae('0x40')]);_0x1a4a64[_0x28ae('0x2f')]=_[_0x28ae('0x3f')](_0x457725[_0x28ae('0x2f')]);_0x1a4a64[_0x28ae('0x30')]=_['intersection'](_0x1a4a64[_0x28ae('0x2d')],_0x1a4a64['query']);_0xfa2f0d[_0x28ae('0x31')]=_['intersection'](_0x1a4a64[_0x28ae('0x2d')],qs[_0x28ae('0x32')](_0x457725[_0x28ae('0x2f')][_0x28ae('0x32')]));_0xfa2f0d[_0x28ae('0x31')]=_0xfa2f0d[_0x28ae('0x31')][_0x28ae('0x33')]?_0xfa2f0d[_0x28ae('0x31')]:_0x1a4a64[_0x28ae('0x2d')];if(_0x457725[_0x28ae('0x2f')][_0x28ae('0x3b')]){_0xfa2f0d[_0x28ae('0x3c')]=[{'all':!![]}];}_0xfa2f0d=_[_0x28ae('0x39')]({},_0xfa2f0d,_0x457725['options']);return db[_0x28ae('0x29')][_0x28ae('0x41')](_0xfa2f0d)[_0x28ae('0x24')](handleEntityNotFound(_0x570e96,null))['then'](respondWithResult(_0x570e96,null))[_0x28ae('0x42')](handleError(_0x570e96,null));};exports['create']=function(_0x423a2b,_0x374685){return db[_0x28ae('0x29')][_0x28ae('0x43')](_0x423a2b[_0x28ae('0x44')],{})['then'](respondWithResult(_0x374685,0xc9))[_0x28ae('0x42')](handleError(_0x374685,null));};exports[_0x28ae('0x22')]=function(_0x26de20,_0x31a55f){if(_0x26de20[_0x28ae('0x44')]['id']){delete _0x26de20[_0x28ae('0x44')]['id'];}return db[_0x28ae('0x29')]['find']({'where':{'id':_0x26de20[_0x28ae('0x45')]['id']}})[_0x28ae('0x24')](handleEntityNotFound(_0x31a55f,null))['then'](saveUpdates(_0x26de20[_0x28ae('0x44')],null))[_0x28ae('0x24')](respondWithResult(_0x31a55f,null))[_0x28ae('0x42')](handleError(_0x31a55f,null));};exports[_0x28ae('0x23')]=function(_0x75f474,_0x1a1004){return db[_0x28ae('0x29')]['find']({'where':{'id':_0x75f474['params']['id']}})[_0x28ae('0x24')](handleEntityNotFound(_0x1a1004,null))['then'](removeEntity(_0x1a1004,null))[_0x28ae('0x42')](handleError(_0x1a1004,null));}; \ No newline at end of file +var _0xf951=['ioredis','../../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','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf951,0x86));var _0x1f95=function(_0x1c1259,_0x2db8ee){_0x1c1259=_0x1c1259-0x0;var _0x1dab5c=_0xf951[_0x1c1259];return _0x1dab5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f95('0x0'));var zipdir=require(_0x1f95('0x1'));var jsonpatch=require(_0x1f95('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f95('0x3'));var Mustache=require(_0x1f95('0x4'));var util=require(_0x1f95('0x5'));var path=require('path');var sox=require(_0x1f95('0x6'));var csv=require('to-csv');var ejs=require(_0x1f95('0x7'));var fs=require('fs');var fs_extra=require(_0x1f95('0x8'));var _=require(_0x1f95('0x9'));var squel=require(_0x1f95('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1f95('0xb'));var toCsv=require(_0x1f95('0xc'));var querystring=require(_0x1f95('0xd'));var Papa=require('papaparse');var Redis=require(_0x1f95('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1f95('0xf'));var as=require(_0x1f95('0x10'));var hardwareService=require(_0x1f95('0x11'));var logger=require(_0x1f95('0x12'))(_0x1f95('0x13'));var utils=require(_0x1f95('0x14'));var config=require(_0x1f95('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5421f3,_0x3d6b99){_0x3d6b99=_0x3d6b99||0xcc;return function(_0x1bdf7c){if(_0x1bdf7c){return _0x5421f3[_0x1f95('0x16')](_0x3d6b99);}return _0x5421f3[_0x1f95('0x17')](_0x3d6b99)[_0x1f95('0x18')]();};}function respondWithResult(_0x29f764,_0x463d71){_0x463d71=_0x463d71||0xc8;return function(_0x26319d){if(_0x26319d){return _0x29f764['status'](_0x463d71)[_0x1f95('0x19')](_0x26319d);}};}function respondWithFilteredResult(_0x7d306c,_0x7cb24d){return function(_0x271e9a){if(_0x271e9a){var _0xc93e74=typeof _0x7cb24d[_0x1f95('0x1a')]===_0x1f95('0x1b')&&typeof _0x7cb24d[_0x1f95('0x1c')]===_0x1f95('0x1b');var _0x281f8b=_0x271e9a[_0x1f95('0x1d')];var _0x298232=_0xc93e74?0x0:_0x7cb24d['offset'];var _0x560b11=_0xc93e74?_0x271e9a[_0x1f95('0x1d')]:_0x7cb24d[_0x1f95('0x1a')]+_0x7cb24d[_0x1f95('0x1c')];var _0x25a8b5;if(_0x560b11>=_0x281f8b){_0x560b11=_0x281f8b;_0x25a8b5=0xc8;}else{_0x25a8b5=0xce;}_0x7d306c[_0x1f95('0x17')](_0x25a8b5);return _0x7d306c[_0x1f95('0x1e')](_0x1f95('0x1f'),_0x298232+'-'+_0x560b11+'/'+_0x281f8b)[_0x1f95('0x19')](_0x271e9a);}return null;};}function patchUpdates(_0x49cdc8){return function(_0x7f550d){try{jsonpatch[_0x1f95('0x20')](_0x7f550d,_0x49cdc8,!![]);}catch(_0x210dba){return BPromise[_0x1f95('0x21')](_0x210dba);}return _0x7f550d['save']();};}function saveUpdates(_0x3825b8,_0x5060d4){return function(_0xf75797){if(_0xf75797){return _0xf75797[_0x1f95('0x22')](_0x3825b8)[_0x1f95('0x23')](function(_0x459739){return _0x459739;});}return null;};}function removeEntity(_0x4e068f,_0x1a2da5){return function(_0x384400){if(_0x384400){return _0x384400[_0x1f95('0x24')]()[_0x1f95('0x23')](function(){_0x4e068f[_0x1f95('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58d9ad,_0x1ff0e6){return function(_0x1cf08c){if(!_0x1cf08c){_0x58d9ad['sendStatus'](0x194);}return _0x1cf08c;};}function handleError(_0x46a4de,_0x34524c){_0x34524c=_0x34524c||0x1f4;return function(_0x2bc8d4){logger[_0x1f95('0x25')](_0x2bc8d4[_0x1f95('0x26')]);if(_0x2bc8d4['name']){delete _0x2bc8d4[_0x1f95('0x27')];}_0x46a4de[_0x1f95('0x17')](_0x34524c)[_0x1f95('0x28')](_0x2bc8d4);};}exports[_0x1f95('0x29')]=function(_0x260769,_0x379e78){var _0x5ed2f1={},_0x28052c={},_0x31a1ac={'count':0x0,'rows':[]};var _0x42ad95=_[_0x1f95('0x2a')](db[_0x1f95('0x2b')][_0x1f95('0x2c')],function(_0x5e2fde){return{'name':_0x5e2fde[_0x1f95('0x2d')],'type':_0x5e2fde['type'][_0x1f95('0x2e')]};});_0x28052c[_0x1f95('0x2f')]=_[_0x1f95('0x2a')](_0x42ad95,_0x1f95('0x27'));_0x28052c[_0x1f95('0x30')]=_[_0x1f95('0x31')](_0x260769[_0x1f95('0x30')]);_0x28052c[_0x1f95('0x32')]=_['intersection'](_0x28052c[_0x1f95('0x2f')],_0x28052c[_0x1f95('0x30')]);_0x5ed2f1[_0x1f95('0x33')]=_[_0x1f95('0x34')](_0x28052c[_0x1f95('0x2f')],qs[_0x1f95('0x35')](_0x260769[_0x1f95('0x30')]['fields']));_0x5ed2f1[_0x1f95('0x33')]=_0x5ed2f1[_0x1f95('0x33')][_0x1f95('0x36')]?_0x5ed2f1[_0x1f95('0x33')]:_0x28052c[_0x1f95('0x2f')];if(!_0x260769[_0x1f95('0x30')]['hasOwnProperty']('nolimit')){_0x5ed2f1[_0x1f95('0x1c')]=qs[_0x1f95('0x1c')](_0x260769[_0x1f95('0x30')]['limit']);_0x5ed2f1['offset']=qs['offset'](_0x260769[_0x1f95('0x30')][_0x1f95('0x1a')]);}_0x5ed2f1[_0x1f95('0x37')]=qs['sort'](_0x260769[_0x1f95('0x30')][_0x1f95('0x38')]);_0x5ed2f1[_0x1f95('0x39')]=qs[_0x1f95('0x32')](_[_0x1f95('0x3a')](_0x260769[_0x1f95('0x30')],_0x28052c[_0x1f95('0x32')]),_0x42ad95);if(_0x260769['query'][_0x1f95('0x3b')]){_0x5ed2f1[_0x1f95('0x39')]=_[_0x1f95('0x3c')](_0x5ed2f1[_0x1f95('0x39')],{'$or':_[_0x1f95('0x2a')](_0x42ad95,function(_0x21429d){if(_0x21429d[_0x1f95('0x3d')]!==_0x1f95('0x3e')){var _0x1d47f1={};_0x1d47f1[_0x21429d[_0x1f95('0x27')]]={'$like':'%'+_0x260769[_0x1f95('0x30')][_0x1f95('0x3b')]+'%'};return _0x1d47f1;}})});}_0x5ed2f1=_['merge']({},_0x5ed2f1,_0x260769[_0x1f95('0x3f')]);var _0x359869={'where':_0x5ed2f1[_0x1f95('0x39')]};return db['VoiceQueuesLog']['count'](_0x359869)[_0x1f95('0x23')](function(_0x32adb0){_0x31a1ac['count']=_0x32adb0;if(_0x260769[_0x1f95('0x30')][_0x1f95('0x40')]){_0x5ed2f1[_0x1f95('0x41')]=[{'all':!![]}];}return db[_0x1f95('0x2b')][_0x1f95('0x42')](_0x5ed2f1);})[_0x1f95('0x23')](function(_0x1c0e6d){_0x31a1ac[_0x1f95('0x43')]=_0x1c0e6d;return _0x31a1ac;})[_0x1f95('0x23')](respondWithFilteredResult(_0x379e78,_0x5ed2f1))['catch'](handleError(_0x379e78,null));};exports[_0x1f95('0x44')]=function(_0x1654cb,_0x43093e){var _0x37cf6e={'raw':!![],'where':{'id':_0x1654cb[_0x1f95('0x45')]['id']}},_0x48cd83={};_0x48cd83[_0x1f95('0x2f')]=_['keys'](db[_0x1f95('0x2b')]['rawAttributes']);_0x48cd83[_0x1f95('0x30')]=_[_0x1f95('0x31')](_0x1654cb[_0x1f95('0x30')]);_0x48cd83[_0x1f95('0x32')]=_[_0x1f95('0x34')](_0x48cd83[_0x1f95('0x2f')],_0x48cd83[_0x1f95('0x30')]);_0x37cf6e[_0x1f95('0x33')]=_['intersection'](_0x48cd83[_0x1f95('0x2f')],qs[_0x1f95('0x35')](_0x1654cb['query']['fields']));_0x37cf6e['attributes']=_0x37cf6e[_0x1f95('0x33')][_0x1f95('0x36')]?_0x37cf6e[_0x1f95('0x33')]:_0x48cd83[_0x1f95('0x2f')];if(_0x1654cb[_0x1f95('0x30')][_0x1f95('0x40')]){_0x37cf6e[_0x1f95('0x41')]=[{'all':!![]}];}_0x37cf6e=_['merge']({},_0x37cf6e,_0x1654cb[_0x1f95('0x3f')]);return db[_0x1f95('0x2b')][_0x1f95('0x46')](_0x37cf6e)[_0x1f95('0x23')](handleEntityNotFound(_0x43093e,null))[_0x1f95('0x23')](respondWithResult(_0x43093e,null))[_0x1f95('0x47')](handleError(_0x43093e,null));};exports[_0x1f95('0x48')]=function(_0x46aed9,_0x1fd15c){return db[_0x1f95('0x2b')][_0x1f95('0x48')](_0x46aed9['body'],{})[_0x1f95('0x23')](respondWithResult(_0x1fd15c,0xc9))['catch'](handleError(_0x1fd15c,null));};exports[_0x1f95('0x22')]=function(_0x22066a,_0x3bd1ca){if(_0x22066a['body']['id']){delete _0x22066a[_0x1f95('0x49')]['id'];}return db[_0x1f95('0x2b')]['find']({'where':{'id':_0x22066a['params']['id']}})[_0x1f95('0x23')](handleEntityNotFound(_0x3bd1ca,null))[_0x1f95('0x23')](saveUpdates(_0x22066a[_0x1f95('0x49')],null))['then'](respondWithResult(_0x3bd1ca,null))[_0x1f95('0x47')](handleError(_0x3bd1ca,null));};exports['destroy']=function(_0x43865e,_0x270a75){return db[_0x1f95('0x2b')]['find']({'where':{'id':_0x43865e[_0x1f95('0x45')]['id']}})[_0x1f95('0x23')](handleEntityNotFound(_0x270a75,null))[_0x1f95('0x23')](removeEntity(_0x270a75,null))[_0x1f95('0x47')](handleError(_0x270a75,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 500fdd1..1acee1b 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 _0x96f3=['bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api','moment'];(function(_0x23554c,_0x37a732){var _0x98d56=function(_0x1d7edf){while(--_0x1d7edf){_0x23554c['push'](_0x23554c['shift']());}};_0x98d56(++_0x37a732);}(_0x96f3,0xf7));var _0x396f=function(_0x3b3db0,_0x11c264){_0x3b3db0=_0x3b3db0-0x0;var _0x4f571b=_0x96f3[_0x3b3db0];return _0x4f571b;};'use strict';var _=require(_0x396f('0x0'));var util=require(_0x396f('0x1'));var logger=require(_0x396f('0x2'))(_0x396f('0x3'));var moment=require(_0x396f('0x4'));var BPromise=require(_0x396f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x396f('0x6'));var config=require(_0x396f('0x7'));var attributes=require(_0x396f('0x8'));module['exports']=function(_0x5f5949,_0x8f2585){return _0x5f5949[_0x396f('0x9')](_0x396f('0xa'),attributes,{'tableName':_0x396f('0xb'),'paranoid':![],'indexes':[{'name':_0x396f('0xc'),'fields':[_0x396f('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x0379=['define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0379,0x114));var _0x9037=function(_0x20a3de,_0x1f7369){_0x20a3de=_0x20a3de-0x0;var _0x4b5503=_0x0379[_0x20a3de];return _0x4b5503;};'use strict';var _=require(_0x9037('0x0'));var util=require(_0x9037('0x1'));var logger=require('../../config/logger')(_0x9037('0x2'));var moment=require(_0x9037('0x3'));var BPromise=require(_0x9037('0x4'));var rp=require(_0x9037('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9037('0x6'));var config=require(_0x9037('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x9037('0x8')]=function(_0x410e3e,_0x514723){return _0x410e3e[_0x9037('0x9')](_0x9037('0xa'),attributes,{'tableName':_0x9037('0xb'),'paranoid':![],'indexes':[{'name':_0x9037('0xc'),'fields':[_0x9037('0xd'),_0x9037('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 37b5789..25f15ab 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 _0xb700=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xb700,0x1d3));var _0x0b70=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0xb700[_0x4206f5];return _0xa29cf3;};'use strict';var _=require(_0x0b70('0x0'));var util=require('util');var moment=require(_0x0b70('0x1'));var BPromise=require(_0x0b70('0x2'));var rs=require(_0x0b70('0x3'));var fs=require('fs');var Redis=require(_0x0b70('0x4'));var db=require(_0x0b70('0x5'))['db'];var utils=require(_0x0b70('0x6'));var logger=require(_0x0b70('0x7'))(_0x0b70('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0b70('0x9')][_0x0b70('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4094aa,_0x17cc6d,_0x12fd11){return new BPromise(function(_0x51e82a,_0xd4d174){return client[_0x0b70('0xb')](_0x4094aa,_0x12fd11)[_0x0b70('0xc')](function(_0x2540ac){logger[_0x0b70('0xd')](_0x0b70('0xe'),_0x17cc6d,_0x0b70('0xf'));logger['debug'](_0x0b70('0x10'),_0x17cc6d,_0x0b70('0xf'),JSON['stringify'](_0x2540ac));if(_0x2540ac[_0x0b70('0x11')]){if(_0x2540ac['error'][_0x0b70('0x12')]===0x1f4){logger[_0x0b70('0x11')](_0x0b70('0xe'),_0x17cc6d,_0x2540ac[_0x0b70('0x11')][_0x0b70('0x13')]);return _0xd4d174(_0x2540ac[_0x0b70('0x11')][_0x0b70('0x13')]);}logger['error'](_0x0b70('0xe'),_0x17cc6d,_0x2540ac['error']['message']);return _0x51e82a(_0x2540ac[_0x0b70('0x11')][_0x0b70('0x13')]);}else{logger['info'](_0x0b70('0xe'),_0x17cc6d,_0x0b70('0xf'));_0x51e82a(_0x2540ac[_0x0b70('0x14')]['message']);}})['catch'](function(_0x5a84cc){logger[_0x0b70('0x11')](_0x0b70('0xe'),_0x17cc6d,_0x5a84cc);_0xd4d174(_0x5a84cc);});});} \ No newline at end of file +var _0x2285=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x25ffd4,_0x16b31d){var _0x414452=function(_0x4440d2){while(--_0x4440d2){_0x25ffd4['push'](_0x25ffd4['shift']());}};_0x414452(++_0x16b31d);}(_0x2285,0x177));var _0x5228=function(_0x160928,_0x119be1){_0x160928=_0x160928-0x0;var _0x459142=_0x2285[_0x160928];return _0x459142;};'use strict';var _=require('lodash');var util=require(_0x5228('0x0'));var moment=require(_0x5228('0x1'));var BPromise=require(_0x5228('0x2'));var rs=require(_0x5228('0x3'));var fs=require('fs');var Redis=require(_0x5228('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5228('0x5'));var logger=require(_0x5228('0x6'))('rpc');var config=require(_0x5228('0x7'));var jayson=require(_0x5228('0x8'));var client=jayson[_0x5228('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b2db,_0x156977,_0x192393){return new BPromise(function(_0x322b86,_0x81c9c6){return client[_0x5228('0xa')](_0x18b2db,_0x192393)[_0x5228('0xb')](function(_0xbd1b8d){logger[_0x5228('0xc')](_0x5228('0xd'),_0x156977,'request\x20sent');logger[_0x5228('0xe')](_0x5228('0xf'),_0x156977,_0x5228('0x10'),JSON[_0x5228('0x11')](_0xbd1b8d));if(_0xbd1b8d['error']){if(_0xbd1b8d[_0x5228('0x12')][_0x5228('0x13')]===0x1f4){logger[_0x5228('0x12')](_0x5228('0xd'),_0x156977,_0xbd1b8d['error'][_0x5228('0x14')]);return _0x81c9c6(_0xbd1b8d[_0x5228('0x12')][_0x5228('0x14')]);}logger[_0x5228('0x12')](_0x5228('0xd'),_0x156977,_0xbd1b8d[_0x5228('0x12')]['message']);return _0x322b86(_0xbd1b8d[_0x5228('0x12')][_0x5228('0x14')]);}else{logger['info'](_0x5228('0xd'),_0x156977,_0x5228('0x10'));_0x322b86(_0xbd1b8d['result'][_0x5228('0x14')]);}})[_0x5228('0x15')](function(_0x1c4121){logger[_0x5228('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x156977,_0x1c4121);_0x81c9c6(_0x1c4121);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5314a2c..04d02ea 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 _0x74ee=['get','isAuthenticated','index','/:id','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x74ee,0x87));var _0xe74e=function(_0x3b826c,_0xbcae60){_0x3b826c=_0x3b826c-0x0;var _0x2b1aec=_0x74ee[_0x3b826c];return _0x2b1aec;};'use strict';var multer=require(_0xe74e('0x0'));var util=require(_0xe74e('0x1'));var path=require('path');var timeout=require(_0xe74e('0x2'));var express=require(_0xe74e('0x3'));var router=express['Router']();var fs_extra=require(_0xe74e('0x4'));var auth=require(_0xe74e('0x5'));var interaction=require(_0xe74e('0x6'));var config=require(_0xe74e('0x7'));var controller=require(_0xe74e('0x8'));router[_0xe74e('0x9')]('/',auth[_0xe74e('0xa')](),controller[_0xe74e('0xb')]);router[_0xe74e('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe74e('0x9')](_0xe74e('0xc'),auth['isAuthenticated'](),controller[_0xe74e('0xd')]);router[_0xe74e('0x9')]('/:id/download',auth[_0xe74e('0xa')](),controller[_0xe74e('0xe')]);router[_0xe74e('0x9')](_0xe74e('0xf'),controller[_0xe74e('0x10')]);router['get'](_0xe74e('0x11'),auth['isAuthenticated'](),controller[_0xe74e('0x12')]);router[_0xe74e('0x13')]('/',auth[_0xe74e('0xa')](),controller[_0xe74e('0x14')]);router[_0xe74e('0x13')](_0xe74e('0x11'),auth[_0xe74e('0xa')](),controller[_0xe74e('0x15')]);router[_0xe74e('0x16')]('/:id',auth[_0xe74e('0xa')](),controller[_0xe74e('0x17')]);router['delete'](_0xe74e('0xc'),auth[_0xe74e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe003=['./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4adbd1,_0x338e5d){var _0x545fc2=function(_0x163bcd){while(--_0x163bcd){_0x4adbd1['push'](_0x4adbd1['shift']());}};_0x545fc2(++_0x338e5d);}(_0xe003,0x124));var _0x3e00=function(_0x4a34e0,_0x29ff2f){_0x4a34e0=_0x4a34e0-0x0;var _0xb5ce1d=_0xe003[_0x4a34e0];return _0xb5ce1d;};'use strict';var multer=require(_0x3e00('0x0'));var util=require(_0x3e00('0x1'));var path=require(_0x3e00('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e00('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3e00('0x4'));var interaction=require(_0x3e00('0x5'));var config=require(_0x3e00('0x6'));var controller=require(_0x3e00('0x7'));router['get']('/',auth[_0x3e00('0x8')](),controller[_0x3e00('0x9')]);router[_0x3e00('0xa')](_0x3e00('0xb'),auth[_0x3e00('0x8')](),controller[_0x3e00('0xc')]);router[_0x3e00('0xa')](_0x3e00('0xd'),auth[_0x3e00('0x8')](),controller['show']);router[_0x3e00('0xa')](_0x3e00('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x3e00('0xa')]('/:id/downloads',controller[_0x3e00('0xf')]);router['get'](_0x3e00('0x10'),auth[_0x3e00('0x8')](),controller[_0x3e00('0x11')]);router[_0x3e00('0x12')]('/',auth[_0x3e00('0x8')](),controller['create']);router[_0x3e00('0x12')]('/:id/transcribe',auth[_0x3e00('0x8')](),controller[_0x3e00('0x13')]);router[_0x3e00('0x14')](_0x3e00('0xd'),auth[_0x3e00('0x8')](),controller['update']);router[_0x3e00('0x15')](_0x3e00('0xd'),auth[_0x3e00('0x8')](),controller['destroy']);module[_0x3e00('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 733c641..554c72b 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 e14c1e6..56b0d61 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 _0xee58=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','VoiceRecording','fieldName','key','model','differenceBy','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','find','create','body','describe','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','ValidationError','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','send','downloads','sequelize','col','token','$and','secrets','Sequelize','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','destroy','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','Buckets','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','.txt','eml-format','fast-json-patch'];(function(_0x12a1e1,_0x645d9){var _0x49ff65=function(_0x5eda3a){while(--_0x5eda3a){_0x12a1e1['push'](_0x12a1e1['shift']());}};_0x49ff65(++_0x645d9);}(_0xee58,0x1cf));var _0x8ee5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xee58[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x8ee5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8ee5('0x1'));var rp=require(_0x8ee5('0x2'));var moment=require(_0x8ee5('0x3'));var BPromise=require(_0x8ee5('0x4'));var Mustache=require(_0x8ee5('0x5'));var util=require(_0x8ee5('0x6'));var path=require(_0x8ee5('0x7'));var sox=require(_0x8ee5('0x8'));var csv=require(_0x8ee5('0x9'));var ejs=require(_0x8ee5('0xa'));var fs=require('fs');var fs_extra=require(_0x8ee5('0xb'));var _=require(_0x8ee5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8ee5('0xd'));var deskjs=require(_0x8ee5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8ee5('0xf'));var Papa=require(_0x8ee5('0x10'));var AWS=require(_0x8ee5('0x11'));var uuidv4=require(_0x8ee5('0x12'));var Redis=require(_0x8ee5('0x13'));var authService=require(_0x8ee5('0x14'));var qs=require(_0x8ee5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ee5('0x16'));var logger=require(_0x8ee5('0x17'))(_0x8ee5('0x18'));var utils=require(_0x8ee5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8ee5('0x1a'));var db=require(_0x8ee5('0x1b'))['db'];function respondWithStatusCode(_0x1d5643,_0x50d644){_0x50d644=_0x50d644||0xcc;return function(_0x2cc316){if(_0x2cc316){return _0x1d5643[_0x8ee5('0x1c')](_0x50d644);}return _0x1d5643[_0x8ee5('0x1d')](_0x50d644)[_0x8ee5('0x1e')]();};}function respondWithResult(_0x2abb74,_0x95ac3b){_0x95ac3b=_0x95ac3b||0xc8;return function(_0x11e852){if(_0x11e852){return _0x2abb74[_0x8ee5('0x1d')](_0x95ac3b)['json'](_0x11e852);}};}function respondWithFilteredResult(_0x23671c,_0x95d3e6){return function(_0xe86062){if(_0xe86062){var _0x5e2596=typeof _0x95d3e6[_0x8ee5('0x1f')]===_0x8ee5('0x20')&&typeof _0x95d3e6[_0x8ee5('0x21')]===_0x8ee5('0x20');var _0x2ac7c3=_0xe86062['count'];var _0x7e13c7=_0x5e2596?0x0:_0x95d3e6[_0x8ee5('0x1f')];var _0x45c59d=_0x5e2596?_0xe86062[_0x8ee5('0x22')]:_0x95d3e6[_0x8ee5('0x1f')]+_0x95d3e6[_0x8ee5('0x21')];var _0x5d9153;if(_0x45c59d>=_0x2ac7c3){_0x45c59d=_0x2ac7c3;_0x5d9153=0xc8;}else{_0x5d9153=0xce;}_0x23671c[_0x8ee5('0x1d')](_0x5d9153);return _0x23671c[_0x8ee5('0x23')](_0x8ee5('0x24'),_0x7e13c7+'-'+_0x45c59d+'/'+_0x2ac7c3)[_0x8ee5('0x25')](_0xe86062);}return null;};}function patchUpdates(_0x37ce49){return function(_0x28ec5c){try{jsonpatch[_0x8ee5('0x26')](_0x28ec5c,_0x37ce49,!![]);}catch(_0x43d444){return BPromise[_0x8ee5('0x27')](_0x43d444);}return _0x28ec5c[_0x8ee5('0x28')]();};}function saveUpdates(_0x4684b4,_0xf4000){return function(_0x98251){if(_0x98251){return _0x98251[_0x8ee5('0x29')](_0x4684b4)[_0x8ee5('0x2a')](function(_0x255f38){return _0x255f38;});}return null;};}function removeEntity(_0x11cf09,_0x38cfa9){return function(_0x1c7926){if(_0x1c7926){return _0x1c7926['destroy']()[_0x8ee5('0x2a')](function(){_0x11cf09[_0x8ee5('0x1d')](0xcc)[_0x8ee5('0x1e')]();});}};}function handleEntityNotFound(_0x24f6bb,_0x483272){return function(_0x525493){if(!_0x525493){_0x24f6bb['sendStatus'](0x194);}return _0x525493;};}function handleError(_0x3381c0,_0x4a9ddd){_0x4a9ddd=_0x4a9ddd||0x1f4;return function(_0x1be2b7){logger[_0x8ee5('0x2b')](_0x1be2b7[_0x8ee5('0x2c')]);if(_0x1be2b7[_0x8ee5('0x2d')]){delete _0x1be2b7[_0x8ee5('0x2d')];}_0x3381c0['status'](_0x4a9ddd)['send'](_0x1be2b7);};}exports[_0x8ee5('0x2e')]=function(_0x4129c9,_0x10a511){var _0x32ec0d={},_0x2252bf={},_0x1f829b={'count':0x0,'rows':[]};var _0x50b116=_['map'](db[_0x8ee5('0x2f')]['rawAttributes'],function(_0x25d0ff){return{'name':_0x25d0ff[_0x8ee5('0x30')],'type':_0x25d0ff['type'][_0x8ee5('0x31')]};});_0x2252bf[_0x8ee5('0x32')]=_[_0x8ee5('0x33')](_[_0x8ee5('0x34')](_0x50b116,'name'),['format']);_0x2252bf[_0x8ee5('0x35')]=_[_0x8ee5('0x36')](_0x4129c9[_0x8ee5('0x35')]);_0x2252bf['filters']=_[_0x8ee5('0x37')](_0x2252bf[_0x8ee5('0x32')],_0x2252bf['query']);_0x32ec0d[_0x8ee5('0x38')]=_['intersection'](_0x2252bf['model'],qs[_0x8ee5('0x39')](_0x4129c9[_0x8ee5('0x35')][_0x8ee5('0x39')]));_0x32ec0d[_0x8ee5('0x38')]=_0x32ec0d['attributes'][_0x8ee5('0x3a')]?_0x32ec0d[_0x8ee5('0x38')]:_0x2252bf[_0x8ee5('0x32')];if(!_0x4129c9[_0x8ee5('0x35')][_0x8ee5('0x3b')](_0x8ee5('0x3c'))){_0x32ec0d[_0x8ee5('0x21')]=qs[_0x8ee5('0x21')](_0x4129c9[_0x8ee5('0x35')][_0x8ee5('0x21')]);_0x32ec0d['offset']=qs['offset'](_0x4129c9[_0x8ee5('0x35')][_0x8ee5('0x1f')]);}_0x32ec0d[_0x8ee5('0x3d')]=qs[_0x8ee5('0x3e')](_0x4129c9[_0x8ee5('0x35')][_0x8ee5('0x3e')]);_0x32ec0d[_0x8ee5('0x3f')]=qs[_0x8ee5('0x40')](_['pick'](_0x4129c9[_0x8ee5('0x35')],_0x2252bf['filters']),_0x50b116);if(_0x4129c9[_0x8ee5('0x35')][_0x8ee5('0x41')]){_0x32ec0d[_0x8ee5('0x3f')]=_[_0x8ee5('0x42')](_0x32ec0d[_0x8ee5('0x3f')],{'$or':_[_0x8ee5('0x34')](_0x50b116,function(_0x1e9a33){if(_0x1e9a33[_0x8ee5('0x43')]!==_0x8ee5('0x44')){var _0x5d091d={};_0x5d091d[_0x1e9a33[_0x8ee5('0x2d')]]={'$like':'%'+_0x4129c9[_0x8ee5('0x35')][_0x8ee5('0x41')]+'%'};return _0x5d091d;}})});}_0x32ec0d=_[_0x8ee5('0x42')]({},_0x32ec0d,_0x4129c9[_0x8ee5('0x45')]);var _0x18b28b={'where':_0x32ec0d['where']};return db[_0x8ee5('0x2f')][_0x8ee5('0x22')](_0x18b28b)[_0x8ee5('0x2a')](function(_0x312e12){_0x1f829b[_0x8ee5('0x22')]=_0x312e12;if(_0x4129c9[_0x8ee5('0x35')]['includeAll']){_0x32ec0d[_0x8ee5('0x46')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x32ec0d);})[_0x8ee5('0x2a')](function(_0x32ca5e){_0x1f829b[_0x8ee5('0x47')]=_0x32ca5e;return _0x1f829b;})[_0x8ee5('0x2a')](respondWithFilteredResult(_0x10a511,_0x32ec0d))[_0x8ee5('0x48')](handleError(_0x10a511,null));};exports[_0x8ee5('0x49')]=function(_0x18bd19,_0x5232fb){var _0x52a788={'raw':![],'where':{'id':_0x18bd19[_0x8ee5('0x4a')]['id']}},_0x2a3763={};_0x2a3763[_0x8ee5('0x32')]=_[_0x8ee5('0x36')](db[_0x8ee5('0x2f')]['rawAttributes']);_0x2a3763[_0x8ee5('0x35')]=_[_0x8ee5('0x36')](_0x18bd19['query']);_0x2a3763[_0x8ee5('0x40')]=_[_0x8ee5('0x37')](_0x2a3763[_0x8ee5('0x32')],_0x2a3763['query']);_0x52a788[_0x8ee5('0x38')]=_[_0x8ee5('0x37')](_0x2a3763[_0x8ee5('0x32')],qs[_0x8ee5('0x39')](_0x18bd19[_0x8ee5('0x35')]['fields']));_0x52a788[_0x8ee5('0x38')]=_0x52a788[_0x8ee5('0x38')][_0x8ee5('0x3a')]?_0x52a788[_0x8ee5('0x38')]:_0x2a3763[_0x8ee5('0x32')];if(_0x18bd19[_0x8ee5('0x35')]['includeAll']){_0x52a788['include']=[{'all':!![]}];}_0x52a788=_['merge']({},_0x52a788,_0x18bd19[_0x8ee5('0x45')]);return db[_0x8ee5('0x2f')][_0x8ee5('0x4b')](_0x52a788)[_0x8ee5('0x2a')](handleEntityNotFound(_0x5232fb,null))[_0x8ee5('0x2a')](respondWithResult(_0x5232fb,null))['catch'](handleError(_0x5232fb,null));};exports[_0x8ee5('0x4c')]=function(_0x45e200,_0x21b7c5){return db['VoiceRecording']['create'](_0x45e200[_0x8ee5('0x4d')],{})[_0x8ee5('0x2a')](respondWithResult(_0x21b7c5,0xc9))['catch'](handleError(_0x21b7c5,null));};exports[_0x8ee5('0x29')]=function(_0x4b1e11,_0x4aba00){if(_0x4b1e11[_0x8ee5('0x4d')]['id']){delete _0x4b1e11[_0x8ee5('0x4d')]['id'];}return db[_0x8ee5('0x2f')]['find']({'where':{'id':_0x4b1e11[_0x8ee5('0x4a')]['id']}})[_0x8ee5('0x2a')](handleEntityNotFound(_0x4aba00,null))['then'](saveUpdates(_0x4b1e11[_0x8ee5('0x4d')],null))[_0x8ee5('0x2a')](respondWithResult(_0x4aba00,null))[_0x8ee5('0x48')](handleError(_0x4aba00,null));};exports[_0x8ee5('0x4e')]=function(_0x538d19,_0x2aa6f2){return db['VoiceRecording'][_0x8ee5('0x4e')]()[_0x8ee5('0x2a')](respondWithResult(_0x2aa6f2,null))[_0x8ee5('0x48')](handleError(_0x2aa6f2,null));};exports['download']=function(_0xcdf3fe,_0x3bfd84,_0x4de8d3){var _0x3496a5=require('../../components/encryptor');var _0xf485e6=![];var _0x1b316d={};if(_0xcdf3fe[_0x8ee5('0x35')][_0x8ee5('0x43')]&&_0xcdf3fe['query'][_0x8ee5('0x43')]===_0x8ee5('0x4f')){_0x1b316d[_0x8ee5('0x4f')]=_0xcdf3fe[_0x8ee5('0x4a')]['id'];}else{_0x1b316d['id']=_0xcdf3fe[_0x8ee5('0x4a')]['id'];}return db['VoiceRecording']['find']({'where':_0x1b316d,'attributes':['id','value'],'raw':!![]})[_0x8ee5('0x2a')](handleEntityNotFound(_0x3bfd84,null))[_0x8ee5('0x2a')](function(_0x50fc79){if(_0x50fc79){var _0x2c256e=_0x50fc79[_0x8ee5('0x50')];var _0x97dbb4=util[_0x8ee5('0x51')](_0x8ee5('0x52'),_0x2c256e);if(fs[_0x8ee5('0x53')](_0x97dbb4)){_0xf485e6=!![];return _0x3496a5[_0x8ee5('0x54')](_0x97dbb4,_0x2c256e,config['secrets'][_0x8ee5('0x55')])[_0x8ee5('0x2a')](function(){return _0x50fc79;});}return _0x50fc79;}})[_0x8ee5('0x2a')](function(_0x3a519d){if(_0x3a519d){var _0x52f18f=_0x3a519d[_0x8ee5('0x50')];if(!fs[_0x8ee5('0x53')](_0x52f18f)){throw new db['Sequelize'][(_0x8ee5('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x3a519d[_0x8ee5('0x57')]){return _0x3bfd84[_0x8ee5('0x58')](_0x52f18f,_0x3a519d['filename']+path[_0x8ee5('0x59')](_0x52f18f),function(){if(_0xf485e6){fs[_0x8ee5('0x5a')](_0x52f18f);}});}else{return _0x3bfd84['download'](_0x52f18f,function(_0x19ad88){if(_0xf485e6){fs[_0x8ee5('0x5a')](_0x52f18f);}});}}})['catch'](function(_0x5203cc){if(_0x5203cc[_0x8ee5('0x5b')]===_0x8ee5('0x5c')){_0x3bfd84[_0x8ee5('0x1d')](0x194)[_0x8ee5('0x5d')]('Not\x20found');}else{return handleError(_0x3bfd84,null);}});};exports[_0x8ee5('0x5e')]=function(_0x490ef0,_0x2cd5ef,_0x1fa332){var _0x56ab77=require('../../components/encryptor');var _0x44c6b2=![];var _0x22a5a6={'$and':[db[_0x8ee5('0x5f')]['where'](db['sequelize']['fn']('MD5',db[_0x8ee5('0x5f')][_0x8ee5('0x60')](_0x8ee5('0x4f'))),_0x490ef0[_0x8ee5('0x35')][_0x8ee5('0x61')])]};if(_0x490ef0['query']['type']&&_0x490ef0['query'][_0x8ee5('0x43')]===_0x8ee5('0x4f')){_0x22a5a6[_0x8ee5('0x62')]['push']({'uniqueid':_0x490ef0[_0x8ee5('0x4a')]['id']});}else{_0x22a5a6[_0x8ee5('0x62')]['push']({'id':_0x490ef0[_0x8ee5('0x4a')]['id']});}return db['VoiceRecording'][_0x8ee5('0x4b')]({'where':_0x22a5a6,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x2cd5ef,null))['then'](function(_0x16b1ca){if(_0x16b1ca){var _0x2ddd1c=util[_0x8ee5('0x51')]('%s.cypher',_0x16b1ca[_0x8ee5('0x50')]);if(fs[_0x8ee5('0x53')](_0x2ddd1c)){_0x44c6b2=!![];return _0x56ab77[_0x8ee5('0x54')](_0x2ddd1c,_0x16b1ca[_0x8ee5('0x50')],config[_0x8ee5('0x63')][_0x8ee5('0x55')])[_0x8ee5('0x2a')](function(){return _0x16b1ca;});}return _0x16b1ca;}})['then'](function(_0x1fc491){if(_0x1fc491){if(!fs['existsSync'](_0x1fc491['value'])){throw new db[(_0x8ee5('0x64'))][(_0x8ee5('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x1fc491['filename']){return _0x2cd5ef[_0x8ee5('0x58')](_0x1fc491['value'],_0x1fc491[_0x8ee5('0x57')]+path['extname'](_0x1fc491[_0x8ee5('0x50')]),function(){if(_0x44c6b2){fs[_0x8ee5('0x5a')](_0x1fc491[_0x8ee5('0x50')]);}});}else{return _0x2cd5ef[_0x8ee5('0x58')](_0x1fc491['value'],function(_0x1f4b53){if(_0x44c6b2){fs[_0x8ee5('0x5a')](_0x1fc491[_0x8ee5('0x50')]);}});}}})[_0x8ee5('0x48')](handleError(_0x2cd5ef,null));};exports['destroy']=function(_0x608836,_0x2a9ced){return db['VoiceRecording'][_0x8ee5('0x4b')]({'where':{'id':_0x608836['params']['id']}})[_0x8ee5('0x2a')](function(_0x4fad18){if(_[_0x8ee5('0x65')](_0x4fad18)){throw new ReferenceError(_0x8ee5('0x66'));}return _0x4fad18;})['then'](function(_0x46f877){var _0x2a9621=_0x46f877['value'];logger[_0x8ee5('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x2a9621);if(!_['isNil'](_0x46f877[_0x8ee5('0x50')])&&fs[_0x8ee5('0x53')](_0x2a9621)){logger[_0x8ee5('0x67')](_0x8ee5('0x68')+_0x2a9621+_0x8ee5('0x69'));fs[_0x8ee5('0x6a')](_0x2a9621);}_0x2a9621=_0x2a9621+_0x8ee5('0x6b');if(!_['isNil'](_0x46f877[_0x8ee5('0x50')])&&fs['existsSync'](_0x2a9621)){logger[_0x8ee5('0x67')]('File:\x20\x22'+_0x2a9621+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8ee5('0x6a')](_0x2a9621);}return _0x46f877;})[_0x8ee5('0x2a')](function(_0x8068a5){if(!_0x8068a5)throw new InternalError();return _0x8068a5[_0x8ee5('0x6c')]();})[_0x8ee5('0x2a')](function(){_0x2a9ced[_0x8ee5('0x1d')](0xcc)[_0x8ee5('0x1e')]();})[_0x8ee5('0x48')](handleError(_0x2a9ced,null));};function getBucketslist(_0x383fda,_0x379412,_0x30e65b){return new Promise(function(_0x17eda,_0x176d63){var _0x49cdff=new AWS['S3']({'accessKeyId':_0x379412,'secretAccessKey':_0x383fda,'region':_0x30e65b});_0x49cdff[_0x8ee5('0x6d')]({},function(_0x213d9a,_0x3e2a43){if(_0x213d9a){return _0x176d63(_0x213d9a);}else{return _0x17eda(_0x3e2a43);}});});}function createBucket(_0x35cd28,_0x34dc27,_0x198393,_0x5f43ab){return new Promise(function(_0x19d263,_0x53ba14){var _0x12ec31=new AWS['S3']({'accessKeyId':_0x34dc27,'secretAccessKey':_0x35cd28,'region':_0x198393});_0x12ec31[_0x8ee5('0x6e')]({'Bucket':_0x5f43ab},function(_0xbe52dd,_0x2604ce){if(_0xbe52dd){return _0x53ba14(_0xbe52dd);}else{return _0x19d263(_0x2604ce);}});});}function uploadFile(_0x5aeb1c,_0x2b7eed,_0x118fb9,_0x283a21,_0x580024,_0x5eb753){return new Promise(function(_0x1f021b,_0x1235b3){var _0x1ebde1=new AWS['S3']({'accessKeyId':_0x2b7eed,'secretAccessKey':_0x5aeb1c,'region':_0x118fb9});_0x1ebde1[_0x8ee5('0x6f')]({'Bucket':_0x283a21,'Key':_0x580024,'Body':_0x5eb753},function(_0x1f3ac5,_0x5b32a6){if(_0x1f3ac5){return _0x1235b3(_0x1f3ac5);}else{return _0x1f021b(_0x5b32a6);}});});}function startTranscribe(_0x527971,_0xecdd66,_0x48faae,_0x2c3a12,_0x9fbae4,_0xf1f1cb){return new Promise(function(_0x5df5b8,_0xc0de26){var _0x482c30=new AWS[(_0x8ee5('0x70'))]({'accessKeyId':_0xecdd66,'secretAccessKey':_0x527971,'region':_0x48faae});_0x482c30[_0x8ee5('0x71')]({'TranscriptionJobName':_0x2c3a12,'LanguageCode':_0x9fbae4,'Media':{'MediaFileUri':_0xf1f1cb}},function(_0x1ab718,_0x4e9e1b){if(_0x1ab718){return _0xc0de26(_0x1ab718);}else{return _0x5df5b8(_0x4e9e1b);}});});}function transcribe(_0x3d5485,_0x463596,_0x4bc3f8,_0x3a13fe,_0x348c10,_0x4f7d07,_0x730bd6){return new Promise(function(_0x31da0d,_0x275183){var _0x144d85={};logger['info'](util[_0x8ee5('0x51')](_0x8ee5('0x72'),_0x3d5485,_0x348c10));return uploadFile(_0x463596,_0x4bc3f8,_0x3a13fe,_0x348c10,path[_0x8ee5('0x73')](_0x4f7d07),fs[_0x8ee5('0x74')](_0x4f7d07))[_0x8ee5('0x2a')](function(_0x27dbff){logger[_0x8ee5('0x67')](util[_0x8ee5('0x51')](_0x8ee5('0x75'),_0x3d5485,_0x348c10,_0x27dbff['Location']));_0x144d85[_0x8ee5('0x76')]=_0x27dbff[_0x8ee5('0x77')];_0x144d85[_0x8ee5('0x78')]=_0x27dbff[_0x8ee5('0x79')];logger[_0x8ee5('0x67')](util[_0x8ee5('0x51')](_0x8ee5('0x7a'),_0x3d5485));return startTranscribe(_0x463596,_0x4bc3f8,_0x3a13fe,uuidv4(),_0x730bd6,_0x27dbff[_0x8ee5('0x79')]);})[_0x8ee5('0x2a')](function(_0xc20152){logger[_0x8ee5('0x67')](util[_0x8ee5('0x51')](_0x8ee5('0x7b'),_0x3d5485,_0xc20152[_0x8ee5('0x7c')][_0x8ee5('0x7d')]));_0x144d85[_0x8ee5('0x7e')]=_0xc20152[_0x8ee5('0x7c')]['TranscriptionJobName'];_0x144d85['transcribeStatus']=_0xc20152[_0x8ee5('0x7c')][_0x8ee5('0x7f')];return _0x31da0d(_0x144d85);})['catch'](function(_0x5a3dd7){return _0x275183(_0x5a3dd7);});});}exports[_0x8ee5('0x80')]=function(_0x46e0b0,_0x397b0c,_0x218271){var _0x1527b7;var _0x522426;var _0x3f6bfb;var _0x1914c8=require(_0x8ee5('0x81'));return db['VoiceRecording'][_0x8ee5('0x82')]({'where':{'id':_0x46e0b0[_0x8ee5('0x4a')]['id']}})[_0x8ee5('0x2a')](function(_0x5e08cc){if(_0x5e08cc){var _0x3f6a25=util[_0x8ee5('0x51')]('%s.cypher',_0x5e08cc['value']);if(fs[_0x8ee5('0x53')](_0x3f6a25)){cypher=!![];return _0x1914c8[_0x8ee5('0x54')](_0x3f6a25,_0x5e08cc[_0x8ee5('0x50')],config[_0x8ee5('0x63')][_0x8ee5('0x55')])[_0x8ee5('0x2a')](function(){return _0x5e08cc;});}return _0x5e08cc;}})[_0x8ee5('0x2a')](function(_0x315110){if(!_0x315110){throw new db[(_0x8ee5('0x64'))][(_0x8ee5('0x56'))](_0x8ee5('0x83'));}_0x522426=_0x315110;return db[_0x8ee5('0x84')][_0x8ee5('0x82')]({'where':{'id':0x1}});})[_0x8ee5('0x2a')](handleEntityNotFound(_0x397b0c,null))[_0x8ee5('0x2a')](function(_0x5edb6d){if(_0x5edb6d){_0x1527b7=_0x5edb6d;if(!_0x1527b7['transcribe']||!_0x1527b7[_0x8ee5('0x85')]||!_0x1527b7[_0x8ee5('0x86')]||!_0x1527b7[_0x8ee5('0x87')]||!_0x1527b7[_0x8ee5('0x76')]){throw new db['Sequelize'][(_0x8ee5('0x56'))](_0x8ee5('0x88'));}if(_0x46e0b0['body'][_0x8ee5('0x89')]&&(!_0x1527b7[_0x8ee5('0x8a')]||!_0x1527b7['sentimentAccountId']||!_0x1527b7[_0x8ee5('0x8b')]||!_0x1527b7[_0x8ee5('0x87')]||!_0x1527b7['bucket'])){throw new db['Sequelize']['ValidationError'](_0x8ee5('0x8c'));}return db[_0x8ee5('0x8d')][_0x8ee5('0x82')]({'where':{'id':_0x1527b7['transcribeAccountId']}});}})[_0x8ee5('0x2a')](function(_0x4136e3){if(!_0x4136e3){throw new db[(_0x8ee5('0x64'))][(_0x8ee5('0x56'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4136e3['data1']||!_0x4136e3[_0x8ee5('0x8e')]){throw new db[(_0x8ee5('0x64'))][(_0x8ee5('0x56'))](_0x8ee5('0x8f'));}_0x3f6bfb=_0x4136e3;return getBucketslist(_0x3f6bfb['data1'],_0x3f6bfb[_0x8ee5('0x8e')],_0x1527b7[_0x8ee5('0x86')]);})['then'](function(_0x2f10bf){if(_0x2f10bf&&_0x2f10bf[_0x8ee5('0x90')]){var _0x1b4782=_[_0x8ee5('0x4b')](_0x2f10bf[_0x8ee5('0x90')],function(_0x193b8f){return _0x193b8f['Name']===_0x1527b7[_0x8ee5('0x76')];});if(!_0x1b4782){logger[_0x8ee5('0x67')](util[_0x8ee5('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x46e0b0[_0x8ee5('0x4a')]['id'],_0x1527b7[_0x8ee5('0x76')]));return createBucket(_0x3f6bfb[_0x8ee5('0x91')],_0x3f6bfb[_0x8ee5('0x8e')],_0x1527b7[_0x8ee5('0x86')],_0x1527b7[_0x8ee5('0x76')]);}logger[_0x8ee5('0x67')](util['format'](_0x8ee5('0x92'),_0x46e0b0[_0x8ee5('0x4a')]['id'],_0x1527b7['bucket']));return;}})[_0x8ee5('0x2a')](function(_0x571f64){if(_0x522426[_0x8ee5('0x93')]==='NEW'){return transcribe(_0x46e0b0[_0x8ee5('0x4a')]['id'],_0x3f6bfb[_0x8ee5('0x91')],_0x3f6bfb['data2'],_0x1527b7[_0x8ee5('0x86')],_0x1527b7[_0x8ee5('0x76')],_0x522426['value'],_0x1527b7['language']);}else{logger[_0x8ee5('0x67')](util[_0x8ee5('0x51')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x46e0b0[_0x8ee5('0x4a')]['id']));return{'transcribeStatus':_0x8ee5('0x94')};}})['then'](function(_0x5003f1){if(_0x5003f1){_0x5003f1[_0x8ee5('0x95')]=_0x46e0b0['body'][_0x8ee5('0x89')];return _0x522426['updateAttributes'](_0x5003f1);}})[_0x8ee5('0x2a')](respondWithResult(_0x397b0c,null))[_0x8ee5('0x48')](handleError(_0x397b0c,null));};function writeFile(_0x4923c6,_0x3f2754){return new Promise(function(_0x5c2cf8,_0x36b365){fs[_0x8ee5('0x96')](_0x3f2754,_0x4923c6,function(_0x10153b,_0x137946){if(_0x10153b){return _0x36b365(_0x10153b);}else{return _0x5c2cf8(_0x137946);}});});}exports[_0x8ee5('0x97')]=function(_0x415859,_0x5bf374,_0x541d19){return db['VoiceRecording'][_0x8ee5('0x82')]({'where':{'id':_0x415859[_0x8ee5('0x4a')]['id']}})[_0x8ee5('0x2a')](handleEntityNotFound(_0x5bf374))[_0x8ee5('0x2a')](function(_0x5bafa4){if(_0x5bafa4&&_0x5bafa4[_0x8ee5('0x98')]){var _0x4028e5=_0x5bafa4[_0x8ee5('0x98')];var _0x4df697=config[_0x8ee5('0x99')]+'/server/files/transcribes/transcribe_'+_0x5bafa4['id']+_0x8ee5('0x9a');if(fs[_0x8ee5('0x53')](_0x4df697)){return _0x4df697;}return writeFile(_0x4028e5,_0x4df697)['then'](function(){return _0x4df697;});}else{throw new db[(_0x8ee5('0x64'))][(_0x8ee5('0x56'))]('Transcript\x20not\x20available');}})['then'](function(_0x53c871){return _0x5bf374[_0x8ee5('0x58')](_0x53c871);})[_0x8ee5('0x48')](handleError(_0x5bf374));}; \ No newline at end of file +var _0x2ae7=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','params','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','token','push','decryptFile','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Cloud\x20Provider\x20not\x20configured','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','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','querystring','uuid/v4','../../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','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters'];(function(_0xc87b90,_0x45448b){var _0x175243=function(_0x4a3b68){while(--_0x4a3b68){_0xc87b90['push'](_0xc87b90['shift']());}};_0x175243(++_0x45448b);}(_0x2ae7,0x65));var _0x72ae=function(_0x41a92c,_0x151201){_0x41a92c=_0x41a92c-0x0;var _0x123f63=_0x2ae7[_0x41a92c];return _0x123f63;};'use strict';var emlformat=require(_0x72ae('0x0'));var rimraf=require(_0x72ae('0x1'));var zipdir=require(_0x72ae('0x2'));var jsonpatch=require(_0x72ae('0x3'));var rp=require(_0x72ae('0x4'));var moment=require(_0x72ae('0x5'));var BPromise=require(_0x72ae('0x6'));var Mustache=require(_0x72ae('0x7'));var util=require(_0x72ae('0x8'));var path=require(_0x72ae('0x9'));var sox=require(_0x72ae('0xa'));var csv=require('to-csv');var ejs=require(_0x72ae('0xb'));var fs=require('fs');var fs_extra=require(_0x72ae('0xc'));var _=require(_0x72ae('0xd'));var squel=require(_0x72ae('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72ae('0xf'));var toCsv=require(_0x72ae('0x10'));var querystring=require(_0x72ae('0x11'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x72ae('0x12'));var Redis=require('ioredis');var authService=require(_0x72ae('0x13'));var qs=require(_0x72ae('0x14'));var as=require(_0x72ae('0x15'));var hardwareService=require(_0x72ae('0x16'));var logger=require(_0x72ae('0x17'))('api');var utils=require(_0x72ae('0x18'));var config=require(_0x72ae('0x19'));var licenseUtil=require(_0x72ae('0x1a'));var db=require(_0x72ae('0x1b'))['db'];function respondWithStatusCode(_0x55836f,_0xefd054){_0xefd054=_0xefd054||0xcc;return function(_0x5c39c1){if(_0x5c39c1){return _0x55836f[_0x72ae('0x1c')](_0xefd054);}return _0x55836f['status'](_0xefd054)[_0x72ae('0x1d')]();};}function respondWithResult(_0x17fa1f,_0x64127a){_0x64127a=_0x64127a||0xc8;return function(_0x2b0c92){if(_0x2b0c92){return _0x17fa1f[_0x72ae('0x1e')](_0x64127a)[_0x72ae('0x1f')](_0x2b0c92);}};}function respondWithFilteredResult(_0x56e5c1,_0x569674){return function(_0x24e5e0){if(_0x24e5e0){var _0x1818cf=typeof _0x569674[_0x72ae('0x20')]==='undefined'&&typeof _0x569674[_0x72ae('0x21')]===_0x72ae('0x22');var _0xbce7db=_0x24e5e0['count'];var _0x290f8a=_0x1818cf?0x0:_0x569674[_0x72ae('0x20')];var _0x8ad9d8=_0x1818cf?_0x24e5e0[_0x72ae('0x23')]:_0x569674[_0x72ae('0x20')]+_0x569674[_0x72ae('0x21')];var _0x4a414b;if(_0x8ad9d8>=_0xbce7db){_0x8ad9d8=_0xbce7db;_0x4a414b=0xc8;}else{_0x4a414b=0xce;}_0x56e5c1[_0x72ae('0x1e')](_0x4a414b);return _0x56e5c1[_0x72ae('0x24')](_0x72ae('0x25'),_0x290f8a+'-'+_0x8ad9d8+'/'+_0xbce7db)[_0x72ae('0x1f')](_0x24e5e0);}return null;};}function patchUpdates(_0x40c08e){return function(_0x5e9c33){try{jsonpatch[_0x72ae('0x26')](_0x5e9c33,_0x40c08e,!![]);}catch(_0x3a4cf9){return BPromise[_0x72ae('0x27')](_0x3a4cf9);}return _0x5e9c33[_0x72ae('0x28')]();};}function saveUpdates(_0x570f77,_0x3c07c0){return function(_0x2716d0){if(_0x2716d0){return _0x2716d0[_0x72ae('0x29')](_0x570f77)['then'](function(_0x2441f0){return _0x2441f0;});}return null;};}function removeEntity(_0x18e32a,_0x4b6ba7){return function(_0x5e029d){if(_0x5e029d){return _0x5e029d[_0x72ae('0x2a')]()[_0x72ae('0x2b')](function(){_0x18e32a['status'](0xcc)[_0x72ae('0x1d')]();});}};}function handleEntityNotFound(_0x3e3bdc,_0x9528f5){return function(_0x3d7a4d){if(!_0x3d7a4d){_0x3e3bdc[_0x72ae('0x1c')](0x194);}return _0x3d7a4d;};}function handleError(_0x186105,_0x437d12){_0x437d12=_0x437d12||0x1f4;return function(_0xee176d){logger[_0x72ae('0x2c')](_0xee176d[_0x72ae('0x2d')]);if(_0xee176d[_0x72ae('0x2e')]){delete _0xee176d[_0x72ae('0x2e')];}_0x186105[_0x72ae('0x1e')](_0x437d12)[_0x72ae('0x2f')](_0xee176d);};}exports[_0x72ae('0x30')]=function(_0x3005fb,_0x527c43){var _0x5b6ca1={},_0x1e4c93={},_0x19c181={'count':0x0,'rows':[]};var _0x1b03a8=_[_0x72ae('0x31')](db[_0x72ae('0x32')]['rawAttributes'],function(_0x41bf76){return{'name':_0x41bf76[_0x72ae('0x33')],'type':_0x41bf76[_0x72ae('0x34')][_0x72ae('0x35')]};});_0x1e4c93[_0x72ae('0x36')]=_[_0x72ae('0x37')](_[_0x72ae('0x31')](_0x1b03a8,'name'),[_0x72ae('0x38')]);_0x1e4c93[_0x72ae('0x39')]=_[_0x72ae('0x3a')](_0x3005fb['query']);_0x1e4c93[_0x72ae('0x3b')]=_['intersection'](_0x1e4c93['model'],_0x1e4c93[_0x72ae('0x39')]);_0x5b6ca1[_0x72ae('0x3c')]=_[_0x72ae('0x3d')](_0x1e4c93[_0x72ae('0x36')],qs[_0x72ae('0x3e')](_0x3005fb['query']['fields']));_0x5b6ca1[_0x72ae('0x3c')]=_0x5b6ca1['attributes'][_0x72ae('0x3f')]?_0x5b6ca1[_0x72ae('0x3c')]:_0x1e4c93[_0x72ae('0x36')];if(!_0x3005fb[_0x72ae('0x39')][_0x72ae('0x40')](_0x72ae('0x41'))){_0x5b6ca1['limit']=qs[_0x72ae('0x21')](_0x3005fb[_0x72ae('0x39')]['limit']);_0x5b6ca1[_0x72ae('0x20')]=qs[_0x72ae('0x20')](_0x3005fb['query'][_0x72ae('0x20')]);}_0x5b6ca1[_0x72ae('0x42')]=qs[_0x72ae('0x43')](_0x3005fb[_0x72ae('0x39')][_0x72ae('0x43')]);_0x5b6ca1[_0x72ae('0x44')]=qs[_0x72ae('0x3b')](_[_0x72ae('0x45')](_0x3005fb[_0x72ae('0x39')],_0x1e4c93[_0x72ae('0x3b')]),_0x1b03a8);if(_0x3005fb[_0x72ae('0x39')][_0x72ae('0x46')]){_0x5b6ca1[_0x72ae('0x44')]=_[_0x72ae('0x47')](_0x5b6ca1['where'],{'$or':_[_0x72ae('0x31')](_0x1b03a8,function(_0x405600){if(_0x405600[_0x72ae('0x34')]!==_0x72ae('0x48')){var _0x4ba4f1={};_0x4ba4f1[_0x405600[_0x72ae('0x2e')]]={'$like':'%'+_0x3005fb['query'][_0x72ae('0x46')]+'%'};return _0x4ba4f1;}})});}_0x5b6ca1=_[_0x72ae('0x47')]({},_0x5b6ca1,_0x3005fb['options']);var _0x35289c={'where':_0x5b6ca1[_0x72ae('0x44')]};return db['VoiceRecording'][_0x72ae('0x23')](_0x35289c)[_0x72ae('0x2b')](function(_0x43694c){_0x19c181[_0x72ae('0x23')]=_0x43694c;if(_0x3005fb['query'][_0x72ae('0x49')]){_0x5b6ca1['include']=[{'all':!![]}];}return db[_0x72ae('0x32')][_0x72ae('0x4a')](_0x5b6ca1);})[_0x72ae('0x2b')](function(_0x467fa7){_0x19c181[_0x72ae('0x4b')]=_0x467fa7;return _0x19c181;})[_0x72ae('0x2b')](respondWithFilteredResult(_0x527c43,_0x5b6ca1))[_0x72ae('0x4c')](handleError(_0x527c43,null));};exports[_0x72ae('0x4d')]=function(_0x5cd5d8,_0x132d4b){var _0x505fb2={'raw':![],'where':{'id':_0x5cd5d8['params']['id']}},_0x399c0b={};_0x399c0b['model']=_[_0x72ae('0x3a')](db[_0x72ae('0x32')][_0x72ae('0x4e')]);_0x399c0b['query']=_[_0x72ae('0x3a')](_0x5cd5d8[_0x72ae('0x39')]);_0x399c0b[_0x72ae('0x3b')]=_['intersection'](_0x399c0b['model'],_0x399c0b[_0x72ae('0x39')]);_0x505fb2['attributes']=_[_0x72ae('0x3d')](_0x399c0b['model'],qs[_0x72ae('0x3e')](_0x5cd5d8[_0x72ae('0x39')]['fields']));_0x505fb2[_0x72ae('0x3c')]=_0x505fb2[_0x72ae('0x3c')][_0x72ae('0x3f')]?_0x505fb2['attributes']:_0x399c0b[_0x72ae('0x36')];if(_0x5cd5d8['query'][_0x72ae('0x49')]){_0x505fb2[_0x72ae('0x4f')]=[{'all':!![]}];}_0x505fb2=_['merge']({},_0x505fb2,_0x5cd5d8[_0x72ae('0x50')]);return db[_0x72ae('0x32')][_0x72ae('0x51')](_0x505fb2)['then'](handleEntityNotFound(_0x132d4b,null))[_0x72ae('0x2b')](respondWithResult(_0x132d4b,null))[_0x72ae('0x4c')](handleError(_0x132d4b,null));};exports['create']=function(_0x33ee72,_0x50a6e1){return db[_0x72ae('0x32')][_0x72ae('0x52')](_0x33ee72[_0x72ae('0x53')],{})['then'](respondWithResult(_0x50a6e1,0xc9))['catch'](handleError(_0x50a6e1,null));};exports['update']=function(_0x4a0849,_0x12cc0d){if(_0x4a0849['body']['id']){delete _0x4a0849[_0x72ae('0x53')]['id'];}return db[_0x72ae('0x32')][_0x72ae('0x51')]({'where':{'id':_0x4a0849[_0x72ae('0x54')]['id']}})['then'](handleEntityNotFound(_0x12cc0d,null))[_0x72ae('0x2b')](saveUpdates(_0x4a0849[_0x72ae('0x53')],null))[_0x72ae('0x2b')](respondWithResult(_0x12cc0d,null))[_0x72ae('0x4c')](handleError(_0x12cc0d,null));};exports['describe']=function(_0xd57de1,_0x36f438){return db['VoiceRecording']['describe']()[_0x72ae('0x2b')](respondWithResult(_0x36f438,null))[_0x72ae('0x4c')](handleError(_0x36f438,null));};exports[_0x72ae('0x55')]=function(_0x3f9b4b,_0x278296,_0x62c056){var _0x42e0f7=require(_0x72ae('0x56'));var _0x50262b=![];var _0x39b5c1={};if(_0x3f9b4b[_0x72ae('0x39')][_0x72ae('0x34')]&&_0x3f9b4b[_0x72ae('0x39')][_0x72ae('0x34')]===_0x72ae('0x57')){_0x39b5c1[_0x72ae('0x57')]=_0x3f9b4b[_0x72ae('0x54')]['id'];}else{_0x39b5c1['id']=_0x3f9b4b[_0x72ae('0x54')]['id'];}return db[_0x72ae('0x32')]['find']({'where':_0x39b5c1,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x278296,null))[_0x72ae('0x2b')](function(_0x52019c){if(_0x52019c){var _0x269619=_0x52019c[_0x72ae('0x58')];var _0x4470e4=util[_0x72ae('0x38')](_0x72ae('0x59'),_0x269619);if(fs[_0x72ae('0x5a')](_0x4470e4)){_0x50262b=!![];return _0x42e0f7['decryptFile'](_0x4470e4,_0x269619,config[_0x72ae('0x5b')][_0x72ae('0x5c')])['then'](function(){return _0x52019c;});}return _0x52019c;}})['then'](function(_0x5cce90){if(_0x5cce90){var _0x4c450a=_0x5cce90[_0x72ae('0x58')];if(!fs[_0x72ae('0x5a')](_0x4c450a)){throw new db[(_0x72ae('0x5d'))][(_0x72ae('0x5e'))](_0x72ae('0x5f'));}if(_0x5cce90[_0x72ae('0x60')]){return _0x278296['download'](_0x4c450a,_0x5cce90[_0x72ae('0x60')]+path[_0x72ae('0x61')](_0x4c450a),function(){if(_0x50262b){fs[_0x72ae('0x62')](_0x4c450a);}});}else{return _0x278296['download'](_0x4c450a,function(_0x320039){if(_0x50262b){fs[_0x72ae('0x62')](_0x4c450a);}});}}})[_0x72ae('0x4c')](function(_0x4e1f0f){if(_0x4e1f0f[_0x72ae('0x63')]===_0x72ae('0x5f')){_0x278296[_0x72ae('0x1e')](0x194)[_0x72ae('0x2f')](_0x72ae('0x64'));}else{return handleError(_0x278296,null);}});};exports[_0x72ae('0x65')]=function(_0x43dd2a,_0x3cc828,_0x3157bc){var _0x3cec1a=require(_0x72ae('0x56'));var _0x372383=![];var _0x25352c={'$and':[db[_0x72ae('0x66')][_0x72ae('0x44')](db[_0x72ae('0x66')]['fn']('MD5',db[_0x72ae('0x66')][_0x72ae('0x67')](_0x72ae('0x57'))),_0x43dd2a[_0x72ae('0x39')][_0x72ae('0x68')])]};if(_0x43dd2a[_0x72ae('0x39')][_0x72ae('0x34')]&&_0x43dd2a['query'][_0x72ae('0x34')]===_0x72ae('0x57')){_0x25352c['$and']['push']({'uniqueid':_0x43dd2a[_0x72ae('0x54')]['id']});}else{_0x25352c['$and'][_0x72ae('0x69')]({'id':_0x43dd2a[_0x72ae('0x54')]['id']});}return db[_0x72ae('0x32')][_0x72ae('0x51')]({'where':_0x25352c,'attributes':['id',_0x72ae('0x58')],'raw':!![]})[_0x72ae('0x2b')](handleEntityNotFound(_0x3cc828,null))['then'](function(_0x217fd9){if(_0x217fd9){var _0x4d8010=util[_0x72ae('0x38')]('%s.cypher',_0x217fd9[_0x72ae('0x58')]);if(fs[_0x72ae('0x5a')](_0x4d8010)){_0x372383=!![];return _0x3cec1a[_0x72ae('0x6a')](_0x4d8010,_0x217fd9['value'],config['secrets'][_0x72ae('0x5c')])['then'](function(){return _0x217fd9;});}return _0x217fd9;}})['then'](function(_0x47cb25){if(_0x47cb25){if(!fs[_0x72ae('0x5a')](_0x47cb25['value'])){throw new db[(_0x72ae('0x5d'))][(_0x72ae('0x5e'))]('VoiceRecording\x20not\x20found');}if(_0x47cb25[_0x72ae('0x60')]){return _0x3cc828[_0x72ae('0x55')](_0x47cb25[_0x72ae('0x58')],_0x47cb25[_0x72ae('0x60')]+path['extname'](_0x47cb25[_0x72ae('0x58')]),function(){if(_0x372383){fs['unlink'](_0x47cb25[_0x72ae('0x58')]);}});}else{return _0x3cc828[_0x72ae('0x55')](_0x47cb25[_0x72ae('0x58')],function(_0x1dd4da){if(_0x372383){fs[_0x72ae('0x62')](_0x47cb25[_0x72ae('0x58')]);}});}}})['catch'](handleError(_0x3cc828,null));};exports[_0x72ae('0x2a')]=function(_0x4ec573,_0x2e9c84){return db[_0x72ae('0x32')][_0x72ae('0x51')]({'where':{'id':_0x4ec573['params']['id']}})[_0x72ae('0x2b')](function(_0x543d97){if(_[_0x72ae('0x6b')](_0x543d97)){throw new ReferenceError(_0x72ae('0x6c'));}return _0x543d97;})['then'](function(_0x2b7538){var _0x51233a=_0x2b7538[_0x72ae('0x58')];logger['info'](_0x72ae('0x6d'),_0x51233a);if(!_[_0x72ae('0x6b')](_0x2b7538[_0x72ae('0x58')])&&fs[_0x72ae('0x5a')](_0x51233a)){logger['info'](_0x72ae('0x6e')+_0x51233a+_0x72ae('0x6f'));fs[_0x72ae('0x70')](_0x51233a);}_0x51233a=_0x51233a+_0x72ae('0x71');if(!_[_0x72ae('0x6b')](_0x2b7538['value'])&&fs[_0x72ae('0x5a')](_0x51233a)){logger[_0x72ae('0x72')]('File:\x20\x22'+_0x51233a+_0x72ae('0x6f'));fs[_0x72ae('0x70')](_0x51233a);}return _0x2b7538;})[_0x72ae('0x2b')](function(_0x149a1c){if(!_0x149a1c)throw new InternalError();return _0x149a1c[_0x72ae('0x2a')]();})[_0x72ae('0x2b')](function(){_0x2e9c84['status'](0xcc)[_0x72ae('0x1d')]();})['catch'](handleError(_0x2e9c84,null));};function getBucketslist(_0x1efeb2,_0x33765d,_0x581e44){return new Promise(function(_0x1ec258,_0x104da9){var _0x577f80=new AWS['S3']({'accessKeyId':_0x33765d,'secretAccessKey':_0x1efeb2,'region':_0x581e44});_0x577f80[_0x72ae('0x73')]({},function(_0x1fe4c5,_0x567e7d){if(_0x1fe4c5){return _0x104da9(_0x1fe4c5);}else{return _0x1ec258(_0x567e7d);}});});}function createBucket(_0x5a4372,_0x5a89b0,_0x133f44,_0xe6bf4f){return new Promise(function(_0x1e393a,_0xe78095){var _0x2fb33b=new AWS['S3']({'accessKeyId':_0x5a89b0,'secretAccessKey':_0x5a4372,'region':_0x133f44});_0x2fb33b[_0x72ae('0x74')]({'Bucket':_0xe6bf4f},function(_0x30e1b8,_0xca971b){if(_0x30e1b8){return _0xe78095(_0x30e1b8);}else{return _0x1e393a(_0xca971b);}});});}function uploadFile(_0x1ea855,_0x3ab29c,_0xccd495,_0x1f2d57,_0x3cad7d,_0x3f4427){return new Promise(function(_0x28c92a,_0x2d65b0){var _0x188895=new AWS['S3']({'accessKeyId':_0x3ab29c,'secretAccessKey':_0x1ea855,'region':_0xccd495});_0x188895[_0x72ae('0x75')]({'Bucket':_0x1f2d57,'Key':_0x3cad7d,'Body':_0x3f4427},function(_0x74a550,_0x526c91){if(_0x74a550){return _0x2d65b0(_0x74a550);}else{return _0x28c92a(_0x526c91);}});});}function startTranscribe(_0x586ebf,_0x1765fb,_0x4ffccc,_0x619e9b,_0x1c530f,_0x4a28a3){return new Promise(function(_0x214cf4,_0x2b0a9a){var _0xb9c7f5=new AWS[(_0x72ae('0x76'))]({'accessKeyId':_0x1765fb,'secretAccessKey':_0x586ebf,'region':_0x4ffccc});_0xb9c7f5[_0x72ae('0x77')]({'TranscriptionJobName':_0x619e9b,'LanguageCode':_0x1c530f,'Media':{'MediaFileUri':_0x4a28a3}},function(_0x121ae6,_0x41489c){if(_0x121ae6){return _0x2b0a9a(_0x121ae6);}else{return _0x214cf4(_0x41489c);}});});}function transcribe(_0x542656,_0x1ff4a9,_0x520c15,_0x142a0d,_0x25f185,_0x22efb9,_0x57db1c){return new Promise(function(_0x2f0fc2,_0x16c142){var _0x3f2e51={};logger[_0x72ae('0x72')](util[_0x72ae('0x38')](_0x72ae('0x78'),_0x542656,_0x25f185));return uploadFile(_0x1ff4a9,_0x520c15,_0x142a0d,_0x25f185,path[_0x72ae('0x79')](_0x22efb9),fs[_0x72ae('0x7a')](_0x22efb9))[_0x72ae('0x2b')](function(_0x34a9dc){logger[_0x72ae('0x72')](util[_0x72ae('0x38')](_0x72ae('0x7b'),_0x542656,_0x25f185,_0x34a9dc[_0x72ae('0x7c')]));_0x3f2e51[_0x72ae('0x7d')]=_0x34a9dc[_0x72ae('0x7e')];_0x3f2e51['location']=_0x34a9dc[_0x72ae('0x7c')];logger[_0x72ae('0x72')](util[_0x72ae('0x38')](_0x72ae('0x7f'),_0x542656));return startTranscribe(_0x1ff4a9,_0x520c15,_0x142a0d,uuidv4(),_0x57db1c,_0x34a9dc['Location']);})[_0x72ae('0x2b')](function(_0x10c3d4){logger['info'](util[_0x72ae('0x38')](_0x72ae('0x80'),_0x542656,_0x10c3d4['TranscriptionJob'][_0x72ae('0x81')]));_0x3f2e51[_0x72ae('0x82')]=_0x10c3d4[_0x72ae('0x83')]['TranscriptionJobName'];_0x3f2e51[_0x72ae('0x84')]=_0x10c3d4[_0x72ae('0x83')][_0x72ae('0x85')];return _0x2f0fc2(_0x3f2e51);})['catch'](function(_0x3f4e21){return _0x16c142(_0x3f4e21);});});}exports[_0x72ae('0x86')]=function(_0x4c4ebd,_0x228357,_0x440770){var _0x29496e;var _0x178205;var _0x13b128;var _0x5ed683=require(_0x72ae('0x56'));return db[_0x72ae('0x32')]['findOne']({'where':{'id':_0x4c4ebd[_0x72ae('0x54')]['id']}})[_0x72ae('0x2b')](function(_0x3d3b80){if(_0x3d3b80){var _0x5536b4=util[_0x72ae('0x38')](_0x72ae('0x59'),_0x3d3b80[_0x72ae('0x58')]);if(fs[_0x72ae('0x5a')](_0x5536b4)){cypher=!![];return _0x5ed683[_0x72ae('0x6a')](_0x5536b4,_0x3d3b80[_0x72ae('0x58')],config[_0x72ae('0x5b')][_0x72ae('0x5c')])[_0x72ae('0x2b')](function(){return _0x3d3b80;});}return _0x3d3b80;}})[_0x72ae('0x2b')](function(_0x270f69){if(!_0x270f69){throw new db[(_0x72ae('0x5d'))][(_0x72ae('0x5e'))](_0x72ae('0x87'));}_0x178205=_0x270f69;return db[_0x72ae('0x88')][_0x72ae('0x89')]({'where':{'id':0x1}});})[_0x72ae('0x2b')](handleEntityNotFound(_0x228357,null))['then'](function(_0x55f3ba){if(_0x55f3ba){_0x29496e=_0x55f3ba;if(!_0x29496e[_0x72ae('0x8a')]||!_0x29496e[_0x72ae('0x8b')]||!_0x29496e[_0x72ae('0x8c')]||!_0x29496e['language']||!_0x29496e['bucket']){throw new db[(_0x72ae('0x5d'))][(_0x72ae('0x5e'))]('Transcribe\x20not\x20configured');}if(_0x4c4ebd['body']['runSentiment']&&(!_0x29496e['sentiment']||!_0x29496e[_0x72ae('0x8d')]||!_0x29496e['sentimentRegion']||!_0x29496e[_0x72ae('0x8e')]||!_0x29496e[_0x72ae('0x7d')])){throw new db['Sequelize'][(_0x72ae('0x5e'))](_0x72ae('0x8f'));}return db['CloudProvider'][_0x72ae('0x89')]({'where':{'id':_0x29496e[_0x72ae('0x8b')]}});}})['then'](function(_0xce5f08){if(!_0xce5f08){throw new db['Sequelize'][(_0x72ae('0x5e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xce5f08[_0x72ae('0x90')]||!_0xce5f08[_0x72ae('0x91')]){throw new db[(_0x72ae('0x5d'))][(_0x72ae('0x5e'))](_0x72ae('0x92'));}_0x13b128=_0xce5f08;return getBucketslist(_0x13b128[_0x72ae('0x90')],_0x13b128[_0x72ae('0x91')],_0x29496e[_0x72ae('0x8c')]);})[_0x72ae('0x2b')](function(_0x135fea){if(_0x135fea&&_0x135fea['Buckets']){var _0x1525c8=_[_0x72ae('0x51')](_0x135fea['Buckets'],function(_0x5c06e3){return _0x5c06e3[_0x72ae('0x93')]===_0x29496e[_0x72ae('0x7d')];});if(!_0x1525c8){logger['info'](util[_0x72ae('0x38')](_0x72ae('0x94'),_0x4c4ebd[_0x72ae('0x54')]['id'],_0x29496e[_0x72ae('0x7d')]));return createBucket(_0x13b128['data1'],_0x13b128[_0x72ae('0x91')],_0x29496e[_0x72ae('0x8c')],_0x29496e[_0x72ae('0x7d')]);}logger[_0x72ae('0x72')](util[_0x72ae('0x38')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4c4ebd['params']['id'],_0x29496e[_0x72ae('0x7d')]));return;}})[_0x72ae('0x2b')](function(_0x424546){if(_0x178205[_0x72ae('0x84')]===_0x72ae('0x95')){return transcribe(_0x4c4ebd['params']['id'],_0x13b128[_0x72ae('0x90')],_0x13b128['data2'],_0x29496e[_0x72ae('0x8c')],_0x29496e['bucket'],_0x178205[_0x72ae('0x58')],_0x29496e[_0x72ae('0x8e')]);}else{logger[_0x72ae('0x72')](util[_0x72ae('0x38')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4c4ebd[_0x72ae('0x54')]['id']));return{'transcribeStatus':_0x72ae('0x96')};}})[_0x72ae('0x2b')](function(_0x11c9f7){if(_0x11c9f7){_0x11c9f7[_0x72ae('0x97')]=_0x4c4ebd[_0x72ae('0x53')][_0x72ae('0x98')];return _0x178205[_0x72ae('0x99')](_0x11c9f7);}})[_0x72ae('0x2b')](respondWithResult(_0x228357,null))[_0x72ae('0x4c')](handleError(_0x228357,null));};function writeFile(_0x3e8482,_0x5df155){return new Promise(function(_0x4eb9a7,_0x305b54){fs[_0x72ae('0x9a')](_0x5df155,_0x3e8482,function(_0x48638c,_0x1c0d8a){if(_0x48638c){return _0x305b54(_0x48638c);}else{return _0x4eb9a7(_0x1c0d8a);}});});}exports[_0x72ae('0x9b')]=function(_0x4deeb3,_0x359154,_0x52359e){return db[_0x72ae('0x32')][_0x72ae('0x89')]({'where':{'id':_0x4deeb3[_0x72ae('0x54')]['id']}})[_0x72ae('0x2b')](handleEntityNotFound(_0x359154))['then'](function(_0x54749a){if(_0x54749a&&_0x54749a[_0x72ae('0x9c')]){var _0x57c86d=_0x54749a['fileText'];var _0x33ed22=config[_0x72ae('0x9d')]+_0x72ae('0x9e')+_0x54749a['id']+_0x72ae('0x9f');if(fs[_0x72ae('0x5a')](_0x33ed22)){return _0x33ed22;}return writeFile(_0x57c86d,_0x33ed22)[_0x72ae('0x2b')](function(){return _0x33ed22;});}else{throw new db[(_0x72ae('0x5d'))][(_0x72ae('0x5e'))](_0x72ae('0xa0'));}})[_0x72ae('0x2b')](function(_0x4722e9){return _0x359154[_0x72ae('0x55')](_0x4722e9);})[_0x72ae('0x4c')](handleError(_0x359154));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c461729..fbae2c7 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 _0x77dc=['../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4d55e8,_0x2b86c6){var _0x13b145=function(_0x1e508d){while(--_0x1e508d){_0x4d55e8['push'](_0x4d55e8['shift']());}};_0x13b145(++_0x2b86c6);}(_0x77dc,0x84));var _0xc77d=function(_0x2696d4,_0x495b60){_0x2696d4=_0x2696d4-0x0;var _0x4d0f72=_0x77dc[_0x2696d4];return _0x4d0f72;};'use strict';var _=require(_0xc77d('0x0'));var util=require(_0xc77d('0x1'));var logger=require(_0xc77d('0x2'))(_0xc77d('0x3'));var moment=require('moment');var BPromise=require(_0xc77d('0x4'));var rp=require(_0xc77d('0x5'));var fs=require('fs');var path=require(_0xc77d('0x6'));var rimraf=require(_0xc77d('0x7'));var config=require(_0xc77d('0x8'));var attributes=require(_0xc77d('0x9'));module[_0xc77d('0xa')]=function(_0x4070b7,_0x201b34){return _0x4070b7['define'](_0xc77d('0xb'),attributes,{'tableName':_0xc77d('0xc'),'paranoid':![],'indexes':[{'name':_0xc77d('0xd'),'fields':[_0xc77d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0360=['rimraf','../../config/environment','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','request-promise'];(function(_0x4831d4,_0x591805){var _0x39d859=function(_0x3d8da4){while(--_0x3d8da4){_0x4831d4['push'](_0x4831d4['shift']());}};_0x39d859(++_0x591805);}(_0x0360,0x11e));var _0x0036=function(_0x26e0c5,_0xb24454){_0x26e0c5=_0x26e0c5-0x0;var _0x4877e7=_0x0360[_0x26e0c5];return _0x4877e7;};'use strict';var _=require('lodash');var util=require(_0x0036('0x0'));var logger=require(_0x0036('0x1'))(_0x0036('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0036('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0036('0x4'));var config=require(_0x0036('0x5'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x1fba1c,_0x35a872){return _0x1fba1c[_0x0036('0x6')](_0x0036('0x7'),attributes,{'tableName':_0x0036('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0036('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 19b7dc4..6618d0d 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 _0x958a=['unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher'];(function(_0x53286a,_0x485c92){var _0x5730ff=function(_0x478c81){while(--_0x478c81){_0x53286a['push'](_0x53286a['shift']());}};_0x5730ff(++_0x485c92);}(_0x958a,0x128));var _0xa958=function(_0x1040ab,_0x2b349f){_0x1040ab=_0x1040ab-0x0;var _0x1548fe=_0x958a[_0x1040ab];return _0x1548fe;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}exports[_0xa958('0x17')]=function(_0x4eadc9){var _0x3a053f=this;return new Promise(function(_0x70d13e,_0x52a184){return db[_0xa958('0x18')][_0xa958('0x19')](_0x4eadc9[_0xa958('0x1a')],{'raw':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')][_0xa958('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eadc9['options']?_0x4eadc9['options'][_0xa958('0x1d')]||null:null,'attributes':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')]['attributes']||null:null,'limit':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')]['limit']||null:null})[_0xa958('0xb')](function(_0x401175){logger['info']('UpdateVoiceRecording',_0x4eadc9);logger[_0xa958('0xf')](_0xa958('0x17'),_0x4eadc9,JSON['stringify'](_0x401175));_0x70d13e(_0x401175);})[_0xa958('0x16')](function(_0x27097a){logger[_0xa958('0x12')](_0xa958('0x17'),_0x27097a[_0xa958('0x14')],_0x4eadc9);_0x52a184(_0x3a053f[_0xa958('0x12')](0x1f4,_0x27097a['message']));});});};exports[_0xa958('0x1e')]=function(_0x48ef34){var _0x43df63=this;return new Promise(function(_0x3c2ea3,_0x32ea36){var _0x18f600=require(_0xa958('0x1f'));var _0xddc7f6;return db[_0xa958('0x20')][_0xa958('0x21')]({'attributes':['id',_0xa958('0x22')],'where':{'id':0x1},'raw':!![]})[_0xa958('0xb')](function(_0x4c4c37){_0xddc7f6=_0x4c4c37;return db['VoiceRecording'][_0xa958('0x23')](_0x48ef34['body']);})[_0xa958('0xb')](function(_0x1b76de){if(_0xddc7f6['callRecordingEncryption']&&fs[_0xa958('0x24')](_0x1b76de[_0xa958('0x25')])){var _0x179bc2=util[_0xa958('0x26')](_0xa958('0x27'),_0x1b76de['value']);return _0x18f600['encryptFile'](_0x1b76de[_0xa958('0x25')],_0x179bc2,config['secrets']['recording'])[_0xa958('0xb')](function(){fs[_0xa958('0x28')](_0x1b76de[_0xa958('0x25')]);logger[_0xa958('0xc')](_0xa958('0x29'));return _0x1b76de;});}return _0x1b76de;})[_0xa958('0xb')](function(_0x516a2f){logger[_0xa958('0xc')]('CreateVoiceRecording',_0x48ef34);logger['debug'](_0xa958('0x1e'),_0x48ef34,JSON[_0xa958('0x11')](_0x516a2f));_0x3c2ea3(_0x516a2f);})[_0xa958('0x16')](function(_0x1cc55d){logger[_0xa958('0x12')](_0xa958('0x1e'),_0x1cc55d[_0xa958('0x14')],_0x48ef34);_0x32ea36(_0x43df63[_0xa958('0x12')](0x1f4,_0x1cc55d['message']));});});}; \ No newline at end of file +var _0xdb28=['options','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateVoiceRecording','update','body'];(function(_0x37d66a,_0x311dac){var _0x1a1123=function(_0x506c45){while(--_0x506c45){_0x37d66a['push'](_0x37d66a['shift']());}};_0x1a1123(++_0x311dac);}(_0xdb28,0x106));var _0x8db2=function(_0x15a6fe,_0x3de6f1){_0x15a6fe=_0x15a6fe-0x0;var _0x2046aa=_0xdb28[_0x15a6fe];return _0x2046aa;};'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')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['VoiceRecording'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')][_0x8db2('0x1a')]||null:null,'attributes':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')][_0x8db2('0x1b')]||null:null})[_0x8db2('0xc')](function(_0x2260d8){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger['debug'](_0x8db2('0x16'),_0x3fddc2,JSON['stringify'](_0x2260d8));_0x46ce14(_0x2260d8);})['catch'](function(_0x52a9ca){logger['error'](_0x8db2('0x16'),_0x52a9ca[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x52a9ca[_0x8db2('0x13')]));});});};exports[_0x8db2('0x1c')]=function(_0x8d4f54){var _0x58cd9d=this;return new Promise(function(_0x3544ba,_0x372311){var _0x430dd5=require(_0x8db2('0x1d'));var _0x483aee;return db[_0x8db2('0x1e')][_0x8db2('0x1f')]({'attributes':['id',_0x8db2('0x20')],'where':{'id':0x1},'raw':!![]})[_0x8db2('0xc')](function(_0xbe5ece){_0x483aee=_0xbe5ece;return db[_0x8db2('0x21')][_0x8db2('0x22')](_0x8d4f54[_0x8db2('0x18')]);})[_0x8db2('0xc')](function(_0x493cab){if(_0x483aee[_0x8db2('0x20')]&&fs['existsSync'](_0x493cab['value'])){var _0x302188=util[_0x8db2('0x23')](_0x8db2('0x24'),_0x493cab['value']);return _0x430dd5[_0x8db2('0x25')](_0x493cab['value'],_0x302188,config[_0x8db2('0x26')][_0x8db2('0x27')])[_0x8db2('0xc')](function(){fs['unlink'](_0x493cab['value']);logger[_0x8db2('0x14')](_0x8db2('0x28'));return _0x493cab;});}return _0x493cab;})['then'](function(_0x516dcb){logger[_0x8db2('0x14')](_0x8db2('0x1c'),_0x8d4f54);logger[_0x8db2('0xf')](_0x8db2('0x1c'),_0x8d4f54,JSON[_0x8db2('0x10')](_0x516dcb));_0x3544ba(_0x516dcb);})[_0x8db2('0x15')](function(_0x101711){logger[_0x8db2('0x11')](_0x8db2('0x1c'),_0x101711[_0x8db2('0x13')],_0x8d4f54);_0x372311(_0x58cd9d['error'](0x1f4,_0x101711[_0x8db2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 1e7d5b4..c72f00b 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 _0x4017=['delete','destroy','multer','path','express','Router','fs-extra','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','show','post','create','put','/:id','update'];(function(_0x2dc5e,_0x5376dd){var _0x384e3a=function(_0x136429){while(--_0x136429){_0x2dc5e['push'](_0x2dc5e['shift']());}};_0x384e3a(++_0x5376dd);}(_0x4017,0x145));var _0x7401=function(_0x16e80b,_0x4d4700){_0x16e80b=_0x16e80b-0x0;var _0x30b22d=_0x4017[_0x16e80b];return _0x30b22d;};'use strict';var multer=require(_0x7401('0x0'));var util=require('util');var path=require(_0x7401('0x1'));var timeout=require('connect-timeout');var express=require(_0x7401('0x2'));var router=express[_0x7401('0x3')]();var fs_extra=require(_0x7401('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7401('0x5'));var controller=require(_0x7401('0x6'));router['get']('/',auth[_0x7401('0x7')](),controller[_0x7401('0x8')]);router[_0x7401('0x9')](_0x7401('0xa'),auth[_0x7401('0x7')](),controller['describe']);router[_0x7401('0x9')]('/:id',auth[_0x7401('0x7')](),controller[_0x7401('0xb')]);router[_0x7401('0xc')]('/',auth[_0x7401('0x7')](),controller[_0x7401('0xd')]);router[_0x7401('0xe')](_0x7401('0xf'),auth['isAuthenticated'](),controller[_0x7401('0x10')]);router[_0x7401('0x11')](_0x7401('0xf'),auth[_0x7401('0x7')](),controller[_0x7401('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf93b=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x5cd45d,_0x3ddb7e){var _0x2367b1=function(_0x3da348){while(--_0x3da348){_0x5cd45d['push'](_0x5cd45d['shift']());}};_0x2367b1(++_0x3ddb7e);}(_0xf93b,0x12f));var _0xbf93=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0xf93b[_0x14e9f0];return _0xa63f7e;};'use strict';var multer=require(_0xbf93('0x0'));var util=require(_0xbf93('0x1'));var path=require(_0xbf93('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf93('0x3'));var router=express[_0xbf93('0x4')]();var fs_extra=require(_0xbf93('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbf93('0x6'));router[_0xbf93('0x7')]('/',auth['isAuthenticated'](),controller[_0xbf93('0x8')]);router['get'](_0xbf93('0x9'),auth[_0xbf93('0xa')](),controller[_0xbf93('0xb')]);router['get'](_0xbf93('0xc'),auth[_0xbf93('0xa')](),controller[_0xbf93('0xd')]);router[_0xbf93('0xe')]('/',auth[_0xbf93('0xa')](),controller[_0xbf93('0xf')]);router[_0xbf93('0x10')](_0xbf93('0xc'),auth[_0xbf93('0xa')](),controller[_0xbf93('0x11')]);router[_0xbf93('0x12')](_0xbf93('0xc'),auth[_0xbf93('0xa')](),controller[_0xbf93('0x13')]);module[_0xbf93('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index cdd8edd..73d53de 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 _0x6c6b=['sequelize','moment','blind','attended','STRING','ENUM','Yes'];(function(_0x5263d2,_0x476862){var _0x2363a0=function(_0x22380d){while(--_0x22380d){_0x5263d2['push'](_0x5263d2['shift']());}};_0x2363a0(++_0x476862);}(_0x6c6b,0x1ce));var _0xb6c6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c6b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb6c6('0x0'));var moment=require(_0xb6c6('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb6c6('0x2'),_0xb6c6('0x3'))},'result':{'type':Sequelize[_0xb6c6('0x4')]},'transfererchannel':{'type':Sequelize[_0xb6c6('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xb6c6('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xb6c6('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xb6c6('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xb6c6('0x4')]},'transferercontext':{'type':Sequelize[_0xb6c6('0x4')]},'transfererexten':{'type':Sequelize[_0xb6c6('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xb6c6('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xb6c6('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xb6c6('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb6c6('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb6c6('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xb6c6('0x4')]},'transfereecontext':{'type':Sequelize[_0xb6c6('0x4')]},'transfereeexten':{'type':Sequelize[_0xb6c6('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xb6c6('0x4')]},'isexternal':{'type':Sequelize[_0xb6c6('0x5')](_0xb6c6('0x6'),'No')},'context':{'type':Sequelize[_0xb6c6('0x4')]},'extension':{'type':Sequelize[_0xb6c6('0x4')]}}; \ No newline at end of file +var _0x8521=['attended','STRING','Yes','moment','exports','ENUM','blind'];(function(_0x430a1a,_0x317e0d){var _0x897413=function(_0x1188cf){while(--_0x1188cf){_0x430a1a['push'](_0x430a1a['shift']());}};_0x897413(++_0x317e0d);}(_0x8521,0xf1));var _0x1852=function(_0x592bad,_0x2520c7){_0x592bad=_0x592bad-0x0;var _0x9d744a=_0x8521[_0x592bad];return _0x9d744a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1852('0x0'));module[_0x1852('0x1')]={'type':{'type':Sequelize[_0x1852('0x2')](_0x1852('0x3'),_0x1852('0x4'))},'result':{'type':Sequelize[_0x1852('0x5')]},'transfererchannel':{'type':Sequelize[_0x1852('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x1852('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1852('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1852('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x1852('0x5')]},'transferercontext':{'type':Sequelize[_0x1852('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1852('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x1852('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x1852('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1852('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x1852('0x5')]},'transfereeexten':{'type':Sequelize[_0x1852('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x1852('0x2')](_0x1852('0x6'),'No')},'context':{'type':Sequelize[_0x1852('0x5')]},'extension':{'type':Sequelize[_0x1852('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index ac9ab06..c6b91c2 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 _0x9d39=['attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','type','key','model','query','keys','filters','intersection','fields'];(function(_0x2ad0c9,_0x40d36a){var _0x2a8663=function(_0x51a527){while(--_0x51a527){_0x2ad0c9['push'](_0x2ad0c9['shift']());}};_0x2a8663(++_0x40d36a);}(_0x9d39,0x169));var _0x99d3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9d39[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99d3('0x0'));var zipdir=require(_0x99d3('0x1'));var jsonpatch=require(_0x99d3('0x2'));var rp=require('request-promise');var moment=require(_0x99d3('0x3'));var BPromise=require(_0x99d3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x99d3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x99d3('0x6'));var fs=require('fs');var fs_extra=require(_0x99d3('0x7'));var _=require(_0x99d3('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99d3('0x9'));var toCsv=require(_0x99d3('0xa'));var querystring=require(_0x99d3('0xb'));var Papa=require(_0x99d3('0xc'));var Redis=require('ioredis');var authService=require(_0x99d3('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x99d3('0xe'));var hardwareService=require(_0x99d3('0xf'));var logger=require('../../config/logger')(_0x99d3('0x10'));var utils=require('../../config/utils');var config=require(_0x99d3('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50104c,_0x317fc2){_0x317fc2=_0x317fc2||0xcc;return function(_0x1a5544){if(_0x1a5544){return _0x50104c[_0x99d3('0x12')](_0x317fc2);}return _0x50104c[_0x99d3('0x13')](_0x317fc2)[_0x99d3('0x14')]();};}function respondWithResult(_0x5c73a7,_0x43eeba){_0x43eeba=_0x43eeba||0xc8;return function(_0x2acec5){if(_0x2acec5){return _0x5c73a7[_0x99d3('0x13')](_0x43eeba)[_0x99d3('0x15')](_0x2acec5);}};}function respondWithFilteredResult(_0x523182,_0x480544){return function(_0x37dc3a){if(_0x37dc3a){var _0x275ec9=typeof _0x480544[_0x99d3('0x16')]===_0x99d3('0x17')&&typeof _0x480544[_0x99d3('0x18')]==='undefined';var _0x29bc17=_0x37dc3a[_0x99d3('0x19')];var _0xc5d328=_0x275ec9?0x0:_0x480544[_0x99d3('0x16')];var _0x54a69c=_0x275ec9?_0x37dc3a[_0x99d3('0x19')]:_0x480544[_0x99d3('0x16')]+_0x480544[_0x99d3('0x18')];var _0x27fa67;if(_0x54a69c>=_0x29bc17){_0x54a69c=_0x29bc17;_0x27fa67=0xc8;}else{_0x27fa67=0xce;}_0x523182[_0x99d3('0x13')](_0x27fa67);return _0x523182['set'](_0x99d3('0x1a'),_0xc5d328+'-'+_0x54a69c+'/'+_0x29bc17)[_0x99d3('0x15')](_0x37dc3a);}return null;};}function patchUpdates(_0x498af1){return function(_0x7f76b0){try{jsonpatch[_0x99d3('0x1b')](_0x7f76b0,_0x498af1,!![]);}catch(_0x45327a){return BPromise[_0x99d3('0x1c')](_0x45327a);}return _0x7f76b0[_0x99d3('0x1d')]();};}function saveUpdates(_0x5c832c,_0x32f28f){return function(_0x116d3b){if(_0x116d3b){return _0x116d3b['update'](_0x5c832c)[_0x99d3('0x1e')](function(_0x4f025e){return _0x4f025e;});}return null;};}function removeEntity(_0x2030a4,_0xf8079){return function(_0x40f5ea){if(_0x40f5ea){return _0x40f5ea[_0x99d3('0x1f')]()['then'](function(){_0x2030a4[_0x99d3('0x13')](0xcc)[_0x99d3('0x14')]();});}};}function handleEntityNotFound(_0x1febd4,_0x830aec){return function(_0x161613){if(!_0x161613){_0x1febd4['sendStatus'](0x194);}return _0x161613;};}function handleError(_0x3f648f,_0x3b26be){_0x3b26be=_0x3b26be||0x1f4;return function(_0x17bf85){logger[_0x99d3('0x20')](_0x17bf85[_0x99d3('0x21')]);if(_0x17bf85[_0x99d3('0x22')]){delete _0x17bf85[_0x99d3('0x22')];}_0x3f648f[_0x99d3('0x13')](_0x3b26be)[_0x99d3('0x23')](_0x17bf85);};}exports[_0x99d3('0x24')]=function(_0xbae66a,_0x112255){var _0x35eee1={},_0x8090a7={},_0xd8be1f={'count':0x0,'rows':[]};var _0x4bf8fb=_[_0x99d3('0x25')](db[_0x99d3('0x26')]['rawAttributes'],function(_0x451677){return{'name':_0x451677['fieldName'],'type':_0x451677[_0x99d3('0x27')][_0x99d3('0x28')]};});_0x8090a7[_0x99d3('0x29')]=_[_0x99d3('0x25')](_0x4bf8fb,_0x99d3('0x22'));_0x8090a7[_0x99d3('0x2a')]=_[_0x99d3('0x2b')](_0xbae66a['query']);_0x8090a7[_0x99d3('0x2c')]=_[_0x99d3('0x2d')](_0x8090a7[_0x99d3('0x29')],_0x8090a7[_0x99d3('0x2a')]);_0x35eee1['attributes']=_['intersection'](_0x8090a7[_0x99d3('0x29')],qs[_0x99d3('0x2e')](_0xbae66a['query'][_0x99d3('0x2e')]));_0x35eee1[_0x99d3('0x2f')]=_0x35eee1[_0x99d3('0x2f')][_0x99d3('0x30')]?_0x35eee1['attributes']:_0x8090a7[_0x99d3('0x29')];if(!_0xbae66a[_0x99d3('0x2a')][_0x99d3('0x31')](_0x99d3('0x32'))){_0x35eee1[_0x99d3('0x18')]=qs[_0x99d3('0x18')](_0xbae66a[_0x99d3('0x2a')][_0x99d3('0x18')]);_0x35eee1['offset']=qs[_0x99d3('0x16')](_0xbae66a[_0x99d3('0x2a')][_0x99d3('0x16')]);}_0x35eee1['order']=qs[_0x99d3('0x33')](_0xbae66a['query'][_0x99d3('0x33')]);_0x35eee1[_0x99d3('0x34')]=qs['filters'](_['pick'](_0xbae66a[_0x99d3('0x2a')],_0x8090a7[_0x99d3('0x2c')]),_0x4bf8fb);if(_0xbae66a['query'][_0x99d3('0x35')]){_0x35eee1['where']=_['merge'](_0x35eee1[_0x99d3('0x34')],{'$or':_['map'](_0x4bf8fb,function(_0x309f91){if(_0x309f91[_0x99d3('0x27')]!=='VIRTUAL'){var _0x426601={};_0x426601[_0x309f91[_0x99d3('0x22')]]={'$like':'%'+_0xbae66a['query'][_0x99d3('0x35')]+'%'};return _0x426601;}})});}_0x35eee1=_[_0x99d3('0x36')]({},_0x35eee1,_0xbae66a[_0x99d3('0x37')]);var _0x33cd78={'where':_0x35eee1['where']};return db[_0x99d3('0x26')][_0x99d3('0x19')](_0x33cd78)['then'](function(_0x448f08){_0xd8be1f[_0x99d3('0x19')]=_0x448f08;if(_0xbae66a[_0x99d3('0x2a')][_0x99d3('0x38')]){_0x35eee1[_0x99d3('0x39')]=[{'all':!![]}];}return db[_0x99d3('0x26')][_0x99d3('0x3a')](_0x35eee1);})[_0x99d3('0x1e')](function(_0x18fabc){_0xd8be1f[_0x99d3('0x3b')]=_0x18fabc;return _0xd8be1f;})[_0x99d3('0x1e')](respondWithFilteredResult(_0x112255,_0x35eee1))[_0x99d3('0x3c')](handleError(_0x112255,null));};exports[_0x99d3('0x3d')]=function(_0x310749,_0x59abfa){var _0x5ac286={'raw':!![],'where':{'id':_0x310749[_0x99d3('0x3e')]['id']}},_0xf3eb15={};_0xf3eb15[_0x99d3('0x29')]=_[_0x99d3('0x2b')](db[_0x99d3('0x26')][_0x99d3('0x3f')]);_0xf3eb15['query']=_[_0x99d3('0x2b')](_0x310749[_0x99d3('0x2a')]);_0xf3eb15[_0x99d3('0x2c')]=_[_0x99d3('0x2d')](_0xf3eb15[_0x99d3('0x29')],_0xf3eb15[_0x99d3('0x2a')]);_0x5ac286['attributes']=_[_0x99d3('0x2d')](_0xf3eb15[_0x99d3('0x29')],qs['fields'](_0x310749[_0x99d3('0x2a')]['fields']));_0x5ac286['attributes']=_0x5ac286[_0x99d3('0x2f')][_0x99d3('0x30')]?_0x5ac286['attributes']:_0xf3eb15['model'];if(_0x310749[_0x99d3('0x2a')][_0x99d3('0x38')]){_0x5ac286['include']=[{'all':!![]}];}_0x5ac286=_['merge']({},_0x5ac286,_0x310749['options']);return db[_0x99d3('0x26')][_0x99d3('0x40')](_0x5ac286)[_0x99d3('0x1e')](handleEntityNotFound(_0x59abfa,null))[_0x99d3('0x1e')](respondWithResult(_0x59abfa,null))['catch'](handleError(_0x59abfa,null));};exports[_0x99d3('0x41')]=function(_0x5150da,_0x4f54e7){return db[_0x99d3('0x26')][_0x99d3('0x41')](_0x5150da['body'],{})[_0x99d3('0x1e')](respondWithResult(_0x4f54e7,0xc9))[_0x99d3('0x3c')](handleError(_0x4f54e7,null));};exports['update']=function(_0x1d2e46,_0x2cfb4b){if(_0x1d2e46[_0x99d3('0x42')]['id']){delete _0x1d2e46[_0x99d3('0x42')]['id'];}return db[_0x99d3('0x26')][_0x99d3('0x40')]({'where':{'id':_0x1d2e46[_0x99d3('0x3e')]['id']}})[_0x99d3('0x1e')](handleEntityNotFound(_0x2cfb4b,null))['then'](saveUpdates(_0x1d2e46[_0x99d3('0x42')],null))[_0x99d3('0x1e')](respondWithResult(_0x2cfb4b,null))[_0x99d3('0x3c')](handleError(_0x2cfb4b,null));};exports['destroy']=function(_0x4fd42a,_0x1ad4ac){return db[_0x99d3('0x26')][_0x99d3('0x40')]({'where':{'id':_0x4fd42a[_0x99d3('0x3e')]['id']}})[_0x99d3('0x1e')](handleEntityNotFound(_0x1ad4ac,null))[_0x99d3('0x1e')](removeEntity(_0x1ad4ac,null))[_0x99d3('0x3c')](handleError(_0x1ad4ac,null));};exports['describe']=function(_0x424118,_0x19f15c){return db[_0x99d3('0x26')][_0x99d3('0x43')]()[_0x99d3('0x1e')](respondWithResult(_0x19f15c,null))[_0x99d3('0x3c')](handleError(_0x19f15c,null));}; \ No newline at end of file +var _0xec49=['error','stack','name','send','index','map','rawAttributes','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','findAll','catch','show','include','find','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus'];(function(_0x1815aa,_0x428481){var _0xe10c20=function(_0x44ef14){while(--_0x44ef14){_0x1815aa['push'](_0x1815aa['shift']());}};_0xe10c20(++_0x428481);}(_0xec49,0x14b));var _0x9ec4=function(_0xf5d0c,_0x5b0448){_0xf5d0c=_0xf5d0c-0x0;var _0x28724a=_0xec49[_0xf5d0c];return _0x28724a;};'use strict';var emlformat=require(_0x9ec4('0x0'));var rimraf=require(_0x9ec4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ec4('0x2'));var rp=require(_0x9ec4('0x3'));var moment=require(_0x9ec4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ec4('0x5'));var util=require(_0x9ec4('0x6'));var path=require(_0x9ec4('0x7'));var sox=require('sox');var csv=require(_0x9ec4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ec4('0x9'));var _=require(_0x9ec4('0xa'));var squel=require('squel');var crypto=require(_0x9ec4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9ec4('0xc'));var toCsv=require(_0x9ec4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9ec4('0xd'));var qs=require(_0x9ec4('0xe'));var as=require(_0x9ec4('0xf'));var hardwareService=require(_0x9ec4('0x10'));var logger=require(_0x9ec4('0x11'))(_0x9ec4('0x12'));var utils=require(_0x9ec4('0x13'));var config=require(_0x9ec4('0x14'));var licenseUtil=require(_0x9ec4('0x15'));var db=require(_0x9ec4('0x16'))['db'];function respondWithStatusCode(_0x29ab05,_0x4df624){_0x4df624=_0x4df624||0xcc;return function(_0x187bb0){if(_0x187bb0){return _0x29ab05['sendStatus'](_0x4df624);}return _0x29ab05[_0x9ec4('0x17')](_0x4df624)[_0x9ec4('0x18')]();};}function respondWithResult(_0x33c893,_0x535125){_0x535125=_0x535125||0xc8;return function(_0xfef7c8){if(_0xfef7c8){return _0x33c893[_0x9ec4('0x17')](_0x535125)['json'](_0xfef7c8);}};}function respondWithFilteredResult(_0x22b432,_0x4ebbe9){return function(_0x401f06){if(_0x401f06){var _0x529289=typeof _0x4ebbe9[_0x9ec4('0x19')]==='undefined'&&typeof _0x4ebbe9['limit']===_0x9ec4('0x1a');var _0x2e8261=_0x401f06[_0x9ec4('0x1b')];var _0x1967d4=_0x529289?0x0:_0x4ebbe9[_0x9ec4('0x19')];var _0x446181=_0x529289?_0x401f06[_0x9ec4('0x1b')]:_0x4ebbe9[_0x9ec4('0x19')]+_0x4ebbe9[_0x9ec4('0x1c')];var _0x3566e7;if(_0x446181>=_0x2e8261){_0x446181=_0x2e8261;_0x3566e7=0xc8;}else{_0x3566e7=0xce;}_0x22b432[_0x9ec4('0x17')](_0x3566e7);return _0x22b432[_0x9ec4('0x1d')](_0x9ec4('0x1e'),_0x1967d4+'-'+_0x446181+'/'+_0x2e8261)[_0x9ec4('0x1f')](_0x401f06);}return null;};}function patchUpdates(_0x38c079){return function(_0x50f3a7){try{jsonpatch[_0x9ec4('0x20')](_0x50f3a7,_0x38c079,!![]);}catch(_0x39a771){return BPromise[_0x9ec4('0x21')](_0x39a771);}return _0x50f3a7[_0x9ec4('0x22')]();};}function saveUpdates(_0x38024f,_0x1e165b){return function(_0x3e6322){if(_0x3e6322){return _0x3e6322[_0x9ec4('0x23')](_0x38024f)['then'](function(_0x22997e){return _0x22997e;});}return null;};}function removeEntity(_0x2f39c8,_0x4983c3){return function(_0x3ad656){if(_0x3ad656){return _0x3ad656[_0x9ec4('0x24')]()[_0x9ec4('0x25')](function(){_0x2f39c8[_0x9ec4('0x17')](0xcc)[_0x9ec4('0x18')]();});}};}function handleEntityNotFound(_0x9c0190,_0x25b7c7){return function(_0x471998){if(!_0x471998){_0x9c0190[_0x9ec4('0x26')](0x194);}return _0x471998;};}function handleError(_0x23f74e,_0xc9e777){_0xc9e777=_0xc9e777||0x1f4;return function(_0x3fdd30){logger[_0x9ec4('0x27')](_0x3fdd30[_0x9ec4('0x28')]);if(_0x3fdd30['name']){delete _0x3fdd30[_0x9ec4('0x29')];}_0x23f74e[_0x9ec4('0x17')](_0xc9e777)[_0x9ec4('0x2a')](_0x3fdd30);};}exports[_0x9ec4('0x2b')]=function(_0x5da442,_0x327949){var _0x34b156={},_0x28020c={},_0x1a2810={'count':0x0,'rows':[]};var _0x12ec76=_[_0x9ec4('0x2c')](db['VoiceTransferReport'][_0x9ec4('0x2d')],function(_0xd82fad){return{'name':_0xd82fad['fieldName'],'type':_0xd82fad[_0x9ec4('0x2e')]['key']};});_0x28020c[_0x9ec4('0x2f')]=_[_0x9ec4('0x2c')](_0x12ec76,_0x9ec4('0x29'));_0x28020c['query']=_[_0x9ec4('0x30')](_0x5da442['query']);_0x28020c[_0x9ec4('0x31')]=_[_0x9ec4('0x32')](_0x28020c[_0x9ec4('0x2f')],_0x28020c['query']);_0x34b156['attributes']=_['intersection'](_0x28020c[_0x9ec4('0x2f')],qs['fields'](_0x5da442[_0x9ec4('0x33')][_0x9ec4('0x34')]));_0x34b156['attributes']=_0x34b156[_0x9ec4('0x35')][_0x9ec4('0x36')]?_0x34b156[_0x9ec4('0x35')]:_0x28020c[_0x9ec4('0x2f')];if(!_0x5da442['query'][_0x9ec4('0x37')](_0x9ec4('0x38'))){_0x34b156[_0x9ec4('0x1c')]=qs[_0x9ec4('0x1c')](_0x5da442[_0x9ec4('0x33')][_0x9ec4('0x1c')]);_0x34b156[_0x9ec4('0x19')]=qs[_0x9ec4('0x19')](_0x5da442['query']['offset']);}_0x34b156[_0x9ec4('0x39')]=qs['sort'](_0x5da442[_0x9ec4('0x33')]['sort']);_0x34b156[_0x9ec4('0x3a')]=qs['filters'](_[_0x9ec4('0x3b')](_0x5da442[_0x9ec4('0x33')],_0x28020c[_0x9ec4('0x31')]),_0x12ec76);if(_0x5da442[_0x9ec4('0x33')][_0x9ec4('0x3c')]){_0x34b156[_0x9ec4('0x3a')]=_[_0x9ec4('0x3d')](_0x34b156[_0x9ec4('0x3a')],{'$or':_[_0x9ec4('0x2c')](_0x12ec76,function(_0x56cb67){if(_0x56cb67[_0x9ec4('0x2e')]!==_0x9ec4('0x3e')){var _0x3d8f09={};_0x3d8f09[_0x56cb67[_0x9ec4('0x29')]]={'$like':'%'+_0x5da442[_0x9ec4('0x33')]['filter']+'%'};return _0x3d8f09;}})});}_0x34b156=_[_0x9ec4('0x3d')]({},_0x34b156,_0x5da442[_0x9ec4('0x3f')]);var _0x29177a={'where':_0x34b156[_0x9ec4('0x3a')]};return db[_0x9ec4('0x40')][_0x9ec4('0x1b')](_0x29177a)['then'](function(_0x54704e){_0x1a2810['count']=_0x54704e;if(_0x5da442[_0x9ec4('0x33')][_0x9ec4('0x41')]){_0x34b156['include']=[{'all':!![]}];}return db[_0x9ec4('0x40')][_0x9ec4('0x42')](_0x34b156);})[_0x9ec4('0x25')](function(_0x2d49cb){_0x1a2810['rows']=_0x2d49cb;return _0x1a2810;})[_0x9ec4('0x25')](respondWithFilteredResult(_0x327949,_0x34b156))[_0x9ec4('0x43')](handleError(_0x327949,null));};exports[_0x9ec4('0x44')]=function(_0x26928b,_0x2ab8d3){var _0x579b3b={'raw':!![],'where':{'id':_0x26928b['params']['id']}},_0x260557={};_0x260557[_0x9ec4('0x2f')]=_[_0x9ec4('0x30')](db[_0x9ec4('0x40')]['rawAttributes']);_0x260557[_0x9ec4('0x33')]=_[_0x9ec4('0x30')](_0x26928b[_0x9ec4('0x33')]);_0x260557[_0x9ec4('0x31')]=_[_0x9ec4('0x32')](_0x260557[_0x9ec4('0x2f')],_0x260557['query']);_0x579b3b[_0x9ec4('0x35')]=_[_0x9ec4('0x32')](_0x260557[_0x9ec4('0x2f')],qs['fields'](_0x26928b[_0x9ec4('0x33')][_0x9ec4('0x34')]));_0x579b3b[_0x9ec4('0x35')]=_0x579b3b[_0x9ec4('0x35')][_0x9ec4('0x36')]?_0x579b3b[_0x9ec4('0x35')]:_0x260557[_0x9ec4('0x2f')];if(_0x26928b['query'][_0x9ec4('0x41')]){_0x579b3b[_0x9ec4('0x45')]=[{'all':!![]}];}_0x579b3b=_[_0x9ec4('0x3d')]({},_0x579b3b,_0x26928b[_0x9ec4('0x3f')]);return db[_0x9ec4('0x40')][_0x9ec4('0x46')](_0x579b3b)[_0x9ec4('0x25')](handleEntityNotFound(_0x2ab8d3,null))[_0x9ec4('0x25')](respondWithResult(_0x2ab8d3,null))[_0x9ec4('0x43')](handleError(_0x2ab8d3,null));};exports['create']=function(_0x7cfe6b,_0x3ff46a){return db[_0x9ec4('0x40')]['create'](_0x7cfe6b[_0x9ec4('0x47')],{})['then'](respondWithResult(_0x3ff46a,0xc9))[_0x9ec4('0x43')](handleError(_0x3ff46a,null));};exports[_0x9ec4('0x23')]=function(_0x5829a5,_0x331065){if(_0x5829a5[_0x9ec4('0x47')]['id']){delete _0x5829a5[_0x9ec4('0x47')]['id'];}return db[_0x9ec4('0x40')]['find']({'where':{'id':_0x5829a5['params']['id']}})[_0x9ec4('0x25')](handleEntityNotFound(_0x331065,null))[_0x9ec4('0x25')](saveUpdates(_0x5829a5[_0x9ec4('0x47')],null))[_0x9ec4('0x25')](respondWithResult(_0x331065,null))[_0x9ec4('0x43')](handleError(_0x331065,null));};exports[_0x9ec4('0x24')]=function(_0x3b453b,_0x423b39){return db[_0x9ec4('0x40')][_0x9ec4('0x46')]({'where':{'id':_0x3b453b[_0x9ec4('0x48')]['id']}})[_0x9ec4('0x25')](handleEntityNotFound(_0x423b39,null))[_0x9ec4('0x25')](removeEntity(_0x423b39,null))[_0x9ec4('0x43')](handleError(_0x423b39,null));};exports['describe']=function(_0x35e038,_0x1f0dc6){return db[_0x9ec4('0x40')][_0x9ec4('0x49')]()['then'](respondWithResult(_0x1f0dc6,null))['catch'](handleError(_0x1f0dc6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index fd31b67..24591a1 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 _0xb0dd=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2ee01d,_0x48f7a7){var _0x24bc9f=function(_0x2c23fd){while(--_0x2c23fd){_0x2ee01d['push'](_0x2ee01d['shift']());}};_0x24bc9f(++_0x48f7a7);}(_0xb0dd,0xef));var _0xdb0d=function(_0x5172da,_0x512e07){_0x5172da=_0x5172da-0x0;var _0x19a97b=_0xb0dd[_0x5172da];return _0x19a97b;};'use strict';var _=require(_0xdb0d('0x0'));var util=require(_0xdb0d('0x1'));var logger=require(_0xdb0d('0x2'))(_0xdb0d('0x3'));var moment=require('moment');var BPromise=require(_0xdb0d('0x4'));var rp=require(_0xdb0d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb0d('0x6'));var config=require(_0xdb0d('0x7'));var attributes=require(_0xdb0d('0x8'));module[_0xdb0d('0x9')]=function(_0x463ed2,_0x30d326){return _0x463ed2[_0xdb0d('0xa')](_0xdb0d('0xb'),attributes,{'tableName':_0xdb0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf69c=['exports','VoiceTransferReport','report_call_transfer','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0xcc53db,_0x387b8a){var _0x1cafb6=function(_0x3af2ff){while(--_0x3af2ff){_0xcc53db['push'](_0xcc53db['shift']());}};_0x1cafb6(++_0x387b8a);}(_0xf69c,0xdb));var _0xcf69=function(_0x10d8ad,_0x4c10fa){_0x10d8ad=_0x10d8ad-0x0;var _0x212cfc=_0xf69c[_0x10d8ad];return _0x212cfc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf69('0x0'))(_0xcf69('0x1'));var moment=require(_0xcf69('0x2'));var BPromise=require(_0xcf69('0x3'));var rp=require(_0xcf69('0x4'));var fs=require('fs');var path=require(_0xcf69('0x5'));var rimraf=require(_0xcf69('0x6'));var config=require(_0xcf69('0x7'));var attributes=require(_0xcf69('0x8'));module[_0xcf69('0x9')]=function(_0x48fe1d,_0x1159eb){return _0x48fe1d['define'](_0xcf69('0xa'),attributes,{'tableName':_0xcf69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index b2a4af8..4b2ec35 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 _0xb3fc=['body','options','raw','then','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceTransferReport','create'];(function(_0x167b5e,_0x62fcb7){var _0x33e79c=function(_0x51edf5){while(--_0x51edf5){_0x167b5e['push'](_0x167b5e['shift']());}};_0x33e79c(++_0x62fcb7);}(_0xb3fc,0x199));var _0xcb3f=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0xb3fc[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0xcb3f('0x0'));var util=require(_0xcb3f('0x1'));var moment=require(_0xcb3f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb3f('0x3'));var db=require(_0xcb3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb3f('0x5'))(_0xcb3f('0x6'));var config=require('../../config/environment');var jayson=require(_0xcb3f('0x7'));var client=jayson[_0xcb3f('0x8')][_0xcb3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d4299,_0xfd4074,_0x3b639b){return new BPromise(function(_0x4b64b8,_0x4beeec){return client[_0xcb3f('0xa')](_0x4d4299,_0x3b639b)['then'](function(_0x39f52c){logger[_0xcb3f('0xb')](_0xcb3f('0xc'),_0xfd4074,_0xcb3f('0xd'));logger[_0xcb3f('0xe')](_0xcb3f('0xf'),_0xfd4074,_0xcb3f('0xd'),JSON[_0xcb3f('0x10')](_0x39f52c));if(_0x39f52c['error']){if(_0x39f52c[_0xcb3f('0x11')][_0xcb3f('0x12')]===0x1f4){logger[_0xcb3f('0x11')](_0xcb3f('0xc'),_0xfd4074,_0x39f52c[_0xcb3f('0x11')][_0xcb3f('0x13')]);return _0x4beeec(_0x39f52c[_0xcb3f('0x11')]['message']);}logger[_0xcb3f('0x11')](_0xcb3f('0xc'),_0xfd4074,_0x39f52c[_0xcb3f('0x11')][_0xcb3f('0x13')]);return _0x4b64b8(_0x39f52c[_0xcb3f('0x11')]['message']);}else{logger[_0xcb3f('0xb')](_0xcb3f('0xc'),_0xfd4074,'request\x20sent');_0x4b64b8(_0x39f52c['result'][_0xcb3f('0x13')]);}})[_0xcb3f('0x14')](function(_0x5603dc){logger[_0xcb3f('0x11')](_0xcb3f('0xc'),_0xfd4074,_0x5603dc);_0x4beeec(_0x5603dc);});});}exports[_0xcb3f('0x15')]=function(_0x4d24db){var _0x33336c=this;return new Promise(function(_0x41be37,_0x1bf669){return db['VoiceTransferReport'][_0xcb3f('0x16')](_0x4d24db[_0xcb3f('0x17')],{'raw':_0x4d24db['options']?_0x4d24db[_0xcb3f('0x18')][_0xcb3f('0x19')]===undefined?!![]:![]:!![]})[_0xcb3f('0x1a')](function(_0x5e4a9b){logger['info'](_0xcb3f('0x15'),_0x4d24db);logger[_0xcb3f('0xe')](_0xcb3f('0x15'),_0x4d24db,JSON[_0xcb3f('0x10')](_0x5e4a9b));_0x41be37(_0x5e4a9b);})[_0xcb3f('0x14')](function(_0x3be3bc){logger[_0xcb3f('0x11')](_0xcb3f('0x15'),_0x3be3bc[_0xcb3f('0x13')],_0x4d24db);_0x1bf669(_0x33336c['error'](0x1f4,_0x3be3bc['message']));});});}; \ No newline at end of file +var _0x945f=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','CreateVoiceTransferReport','create','body','options','raw','then','stringify','catch','lodash','moment'];(function(_0x324808,_0x3d7099){var _0x20d068=function(_0x301a0c){while(--_0x301a0c){_0x324808['push'](_0x324808['shift']());}};_0x20d068(++_0x3d7099);}(_0x945f,0xa6));var _0xf945=function(_0x3cd974,_0x5904e4){_0x3cd974=_0x3cd974-0x0;var _0x51ede7=_0x945f[_0x3cd974];return _0x51ede7;};'use strict';var _=require(_0xf945('0x0'));var util=require('util');var moment=require(_0xf945('0x1'));var BPromise=require(_0xf945('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf945('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf945('0x4'))(_0xf945('0x5'));var config=require(_0xf945('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf945('0x7')][_0xf945('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39711d,_0x5c7c29,_0x3f1d49){return new BPromise(function(_0x43a29e,_0x59377f){return client['request'](_0x39711d,_0x3f1d49)['then'](function(_0x3e2288){logger[_0xf945('0x9')](_0xf945('0xa'),_0x5c7c29,'request\x20sent');logger[_0xf945('0xb')](_0xf945('0xc'),_0x5c7c29,_0xf945('0xd'),JSON['stringify'](_0x3e2288));if(_0x3e2288[_0xf945('0xe')]){if(_0x3e2288[_0xf945('0xe')]['code']===0x1f4){logger['error'](_0xf945('0xa'),_0x5c7c29,_0x3e2288[_0xf945('0xe')][_0xf945('0xf')]);return _0x59377f(_0x3e2288[_0xf945('0xe')][_0xf945('0xf')]);}logger[_0xf945('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c7c29,_0x3e2288[_0xf945('0xe')][_0xf945('0xf')]);return _0x43a29e(_0x3e2288[_0xf945('0xe')][_0xf945('0xf')]);}else{logger[_0xf945('0x9')](_0xf945('0xa'),_0x5c7c29,'request\x20sent');_0x43a29e(_0x3e2288['result'][_0xf945('0xf')]);}})['catch'](function(_0x499bfe){logger[_0xf945('0xe')](_0xf945('0xa'),_0x5c7c29,_0x499bfe);_0x59377f(_0x499bfe);});});}exports[_0xf945('0x10')]=function(_0x37864b){var _0x1dd44e=this;return new Promise(function(_0x527fe1,_0x94c2bc){return db['VoiceTransferReport'][_0xf945('0x11')](_0x37864b[_0xf945('0x12')],{'raw':_0x37864b[_0xf945('0x13')]?_0x37864b[_0xf945('0x13')][_0xf945('0x14')]===undefined?!![]:![]:!![]})[_0xf945('0x15')](function(_0x393649){logger[_0xf945('0x9')](_0xf945('0x10'),_0x37864b);logger[_0xf945('0xb')](_0xf945('0x10'),_0x37864b,JSON[_0xf945('0x16')](_0x393649));_0x527fe1(_0x393649);})[_0xf945('0x17')](function(_0x549f96){logger[_0xf945('0xe')](_0xf945('0x10'),_0x549f96[_0xf945('0xf')],_0x37864b);_0x94c2bc(_0x1dd44e[_0xf945('0xe')](0x1f4,_0x549f96['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 0542eaf..73fa978 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 _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x553502,_0x4d2c0c){var _0x246c37=function(_0x36698a){while(--_0x36698a){_0x553502['push'](_0x553502['shift']());}};_0x246c37(++_0x4d2c0c);}(_0xdace,0xc5));var _0xedac=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0xdace[_0x5311e8];return _0x582ad8;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file +var _0x9a19=['hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup'];(function(_0x291c01,_0x5f1984){var _0x369234=function(_0x2e6862){while(--_0x2e6862){_0x291c01['push'](_0x291c01['shift']());}};_0x369234(++_0x5f1984);}(_0x9a19,0x114));var _0x99a1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x9a19[_0x5a776b];return _0xbbef59;};'use strict';var express=require(_0x99a1('0x0'));var router=express[_0x99a1('0x1')]();var auth=require(_0x99a1('0x2'));var controller=require('./webbar.controller');router[_0x99a1('0x3')](_0x99a1('0x4'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x7')]);router[_0x99a1('0x3')](_0x99a1('0x8'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x9')]);router[_0x99a1('0x3')]('/answer',auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x99a1('0xa')]);router[_0x99a1('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xb')]);router[_0x99a1('0x3')](_0x99a1('0xc'),auth[_0x99a1('0x5')](),auth['isWebrtcLicence'](),controller[_0x99a1('0xd')]);router[_0x99a1('0x3')](_0x99a1('0xe'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x3')](_0x99a1('0x10'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x11')]);module[_0x99a1('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index dade8d9..a11c551 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 _0x5178=['message','result','User','findOne','agent','VoiceChannels','all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','catch','hangup','hangup\x20fired:','validate','user:%s','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','http','../../config/logger','ioredis','defaults','redis','localhost','socket.io-emitter','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','NotFound','request','then','code'];(function(_0x5ce6f1,_0xb0aa10){var _0x250fe2=function(_0x21d3e7){while(--_0x21d3e7){_0x5ce6f1['push'](_0x5ce6f1['shift']());}};_0x250fe2(++_0xb0aa10);}(_0x5178,0x171));var _0x8517=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5178[_0x397e5f];return _0x5302b8;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x8517('0x0'));var db=require(_0x8517('0x1'))['db'];var config=require(_0x8517('0x2'));var util=require(_0x8517('0x3'));var BPromise=require(_0x8517('0x4'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x8517('0x5')]({'port':0x232a});var logger=require(_0x8517('0x6'))('webbarapi');var Redis=require(_0x8517('0x7'));config['redis']=_[_0x8517('0x8')](config[_0x8517('0x9')],{'host':_0x8517('0xa'),'port':0x18eb});var io=require(_0x8517('0xb'))(new Redis(config[_0x8517('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x8517('0xd')]},'callerId':{'type':_0x8517('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],_0x8517('0xf')]},'sessionId':{'type':_0x8517('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],_0x8517('0xf')]},'sessionId':{'type':_0x8517('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],_0x8517('0xf')]},'sessionId':{'type':'string','required':[!![],_0x8517('0x10')]},'transferNumber':{'type':_0x8517('0xe'),'required':[!![],_0x8517('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],_0x8517('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],_0x8517('0xf')]},'sessionId':{'type':_0x8517('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],_0x8517('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x8517('0xc'),'required':[!![],_0x8517('0xf')]}});function emit(_0x30cea1,_0x504a92,_0x2953dd){logger[_0x8517('0x12')](_0x30cea1,_0x504a92,JSON[_0x8517('0x13')](_0x2953dd));io['to'](_0x30cea1)['emit'](_0x504a92,_0x2953dd);}function handleError(_0xdfe7fe){return function(_0x100b76){console[_0x8517('0x14')](_0x8517('0x15'),_0x100b76,_0x100b76 instanceof RangeError);logger[_0x8517('0x16')](_0x100b76[_0x8517('0x17')]);if(_0x100b76 instanceof RangeError){if(_0x100b76[_0x8517('0x18')]){delete _0x100b76['name'];}_0xdfe7fe[_0x8517('0x19')](0x194)['send'](_0x100b76);}else{if(_0x100b76['name']){delete _0x100b76[_0x8517('0x18')];}_0xdfe7fe[_0x8517('0x19')](0x1f4)[_0x8517('0x1a')](_0x100b76);}};}function checkError(){return function(_0x180d8d){if(!_0x180d8d){throw new RangeError(_0x8517('0x1b'));}return _0x180d8d;};}function respondWithRpcPromise(_0xdfde16,_0x512458){return new BPromise(function(_0x4b145f,_0x2dd1df){var _0x37861d=amiClient;return _0x37861d[_0x8517('0x1c')](_0xdfde16,_0x512458)[_0x8517('0x1d')](function(_0x3a5f0b){if(_0x3a5f0b[_0x8517('0x16')]){if(_0x3a5f0b['error'][_0x8517('0x1e')]===0x1f4){return _0x2dd1df(_0x3a5f0b[_0x8517('0x16')]['message']);}return _0x4b145f(_0x3a5f0b[_0x8517('0x16')][_0x8517('0x1f')]);}else{_0x4b145f(_0x3a5f0b[_0x8517('0x20')]);}})['catch'](function(_0x634092){_0x2dd1df(_0x634092);});});}function getAgent(_0x572ce4){return db[_0x8517('0x21')][_0x8517('0x22')]({'where':{'id':_0x572ce4,'role':_0x8517('0x23')}})[_0x8517('0x1d')](checkError());}function getAgentCheckSession(_0x238f2c,_0x300e3f){return new BPromise(function(_0x481ceb,_0x39764e){var _0x51d516=respondWithRpcPromise(_0x8517('0x24'));var _0x70ee9d=getAgent(_0x238f2c);Promise[_0x8517('0x25')]([_0x51d516,_0x70ee9d])[_0x8517('0x1d')](function(_0x3e6f89){var _0x1b2423=_0x3e6f89[0x0];var _0x4c691f=_0x3e6f89[0x1];var _0x20ec0a=_['filter'](_0x1b2423[_0x8517('0x26')],function(_0x4b9983){return _0x4b9983[_0x8517('0x27')]==_0x4c691f['id']&&_0x4b9983[_0x8517('0x28')]==_0x300e3f;});if(_0x20ec0a[_0x8517('0x29')]==0x1){_0x481ceb(_0x4c691f);}else{_0x39764e(new RangeError(_0x8517('0x2a')+_0x300e3f+_0x8517('0x2b')));}});});}exports[_0x8517('0x2c')]=function(_0x647d81,_0x559707){logger[_0x8517('0x12')](_0x8517('0x2d'),_0x647d81[_0x8517('0x2e')]);var _0x53c009=originateValidation['validate'](_0x647d81['body']);if(_0x53c009[_0x8517('0x29')]>0x0){return _0x559707[_0x8517('0x19')](0x190)[_0x8517('0x2f')](_0x53c009);}var _0x2abad4=_0x647d81[_0x8517('0x2e')][_0x8517('0x30')];var _0x5d9d04=_0x647d81[_0x8517('0x2e')][_0x8517('0x31')];var _0x3fc3aa=_0x647d81['body'][_0x8517('0x32')];var _0x5756d7=_0x647d81[_0x8517('0x2e')][_0x8517('0x33')];return getAgent(_0x2abad4)['then'](function(_0x572feb){logger[_0x8517('0x12')](_0x8517('0x34'),_0x572feb[_0x8517('0x18')]);emit(util[_0x8517('0x35')]('user:%s',_0x572feb['name']),_0x8517('0x36'),{'callNumber':_0x5d9d04,'callerId':_0x3fc3aa,'callbackUrl':_0x5756d7});return _0x559707[_0x8517('0x19')](0xc8)[_0x8517('0x2f')]({'error':![],'message':'originate\x20executed!'});})[_0x8517('0x37')](handleError(_0x559707));};exports[_0x8517('0x38')]=function(_0x4afa5b,_0x209235){logger[_0x8517('0x12')](_0x8517('0x39'),_0x4afa5b[_0x8517('0x2e')]);var _0x57ca29=hangupValidation[_0x8517('0x3a')](_0x4afa5b[_0x8517('0x2e')]);if(_0x57ca29[_0x8517('0x29')]>0x0){return _0x209235[_0x8517('0x19')](0x190)[_0x8517('0x2f')](_0x57ca29);}var _0x22592a=_0x4afa5b[_0x8517('0x2e')][_0x8517('0x30')];var _0x3f338a=_0x4afa5b[_0x8517('0x2e')][_0x8517('0x28')];return getAgent(_0x22592a)[_0x8517('0x1d')](function(_0x232e49){logger['info']('entityFound:',_0x232e49[_0x8517('0x18')]);emit(util[_0x8517('0x35')](_0x8517('0x3b'),_0x232e49[_0x8517('0x18')]),_0x8517('0x3c'),{'sessionId':_0x3f338a});return _0x209235['status'](0xc8)[_0x8517('0x2f')]({'error':![],'message':_0x8517('0x3d')});})['catch'](handleError(_0x209235));};exports[_0x8517('0x3e')]=function(_0x34fd09,_0x32fba6){logger[_0x8517('0x12')]('answer\x20fired:',_0x34fd09[_0x8517('0x2e')]);var _0x24034f=answerValidation['validate'](_0x34fd09[_0x8517('0x2e')]);if(_0x24034f[_0x8517('0x29')]>0x0){return _0x32fba6[_0x8517('0x19')](0x190)['json'](_0x24034f);}var _0x368bb8=_0x34fd09[_0x8517('0x2e')][_0x8517('0x30')];var _0x404a40=_0x34fd09[_0x8517('0x2e')][_0x8517('0x28')];return getAgent(_0x368bb8)[_0x8517('0x1d')](function(_0x501850){logger[_0x8517('0x12')](_0x8517('0x34'),_0x501850['name']);emit(util[_0x8517('0x35')](_0x8517('0x3b'),_0x501850[_0x8517('0x18')]),_0x8517('0x3f'),{'sessionId':_0x404a40});return _0x32fba6[_0x8517('0x19')](0xc8)[_0x8517('0x2f')]({'error':![],'message':'answer\x20executed!'});})[_0x8517('0x37')](handleError(_0x32fba6));};exports[_0x8517('0x40')]=function(_0x3a9778,_0x561860){logger[_0x8517('0x12')](_0x8517('0x41'),_0x3a9778['body']);var _0x10ed6a=holdValidation[_0x8517('0x3a')](_0x3a9778['body']);if(_0x10ed6a['length']>0x0){return _0x561860['status'](0x190)[_0x8517('0x2f')](_0x10ed6a);}var _0x250a14=_0x3a9778['body'][_0x8517('0x30')];var _0x5b0ea3=_0x3a9778['body'][_0x8517('0x28')];return getAgent(_0x250a14)[_0x8517('0x1d')](function(_0x3c8ecb){logger[_0x8517('0x12')]('entityFound:',_0x3c8ecb[_0x8517('0x18')]);emit(util[_0x8517('0x35')](_0x8517('0x3b'),_0x3c8ecb['name']),_0x8517('0x42'),{'sessionId':_0x5b0ea3});return _0x561860[_0x8517('0x19')](0xc8)[_0x8517('0x2f')]({'error':![],'message':_0x8517('0x43')});})[_0x8517('0x37')](handleError(_0x561860));};exports[_0x8517('0x44')]=function(_0x3cccd9,_0x4987eb){logger[_0x8517('0x12')]('unhold\x20fired:',_0x3cccd9['body']);var _0x2752b6=unholdValidation[_0x8517('0x3a')](_0x3cccd9[_0x8517('0x2e')]);if(_0x2752b6[_0x8517('0x29')]>0x0){return _0x4987eb['status'](0x190)[_0x8517('0x2f')](_0x2752b6);}var _0x2da857=_0x3cccd9['body']['userId'];var _0x3bdbb4=_0x3cccd9[_0x8517('0x2e')][_0x8517('0x28')];return getAgent(_0x2da857)['then'](function(_0x26444e){logger['info'](_0x8517('0x34'),_0x26444e[_0x8517('0x18')]);emit(util[_0x8517('0x35')](_0x8517('0x3b'),_0x26444e[_0x8517('0x18')]),_0x8517('0x45'),{'sessionId':_0x3bdbb4});return _0x4987eb[_0x8517('0x19')](0xc8)[_0x8517('0x2f')]({'error':![],'message':_0x8517('0x46')});})['catch'](handleError(_0x4987eb));};exports['calls']=function(_0x1eaadc,_0x6f36b1){logger[_0x8517('0x12')]('calls\x20fired:',_0x6f36b1[_0x8517('0x2e')]);var _0x1ce476=callsValidation[_0x8517('0x3a')](_0x1eaadc['body']);if(_0x1ce476['length']>0x0){return _0x6f36b1[_0x8517('0x19')](0x190)[_0x8517('0x2f')](_0x1ce476);}var _0x919ff8=_0x1eaadc[_0x8517('0x2e')][_0x8517('0x30')];var _0x3be6db=respondWithRpcPromise(_0x8517('0x24'));var _0x123504=getAgent(_0x919ff8);return Promise[_0x8517('0x25')]([_0x3be6db,_0x123504])[_0x8517('0x1d')](function(_0x3f6f67){var _0x3c5462=_0x3f6f67[0x0];var _0xf303bb=_0x3f6f67[0x1];var _0x20dc60=_[_0x8517('0x47')](_0x3c5462[_0x8517('0x26')],function(_0x5c3932){return _0x5c3932[_0x8517('0x27')]==_0xf303bb['id'];});return _0x6f36b1[_0x8517('0x19')](0xc8)[_0x8517('0x2f')]({'count':_0x20dc60[_0x8517('0x29')],'rows':_0x20dc60});})[_0x8517('0x37')](handleError(_0x6f36b1));};exports[_0x8517('0x48')]=function(_0x322682,_0x50b037){logger[_0x8517('0x12')](_0x8517('0x49'),_0x322682[_0x8517('0x2e')]);var _0x461640=conferenceValidation[_0x8517('0x3a')](_0x322682['body']);if(_0x461640[_0x8517('0x29')]>0x0){return _0x50b037['status'](0x190)[_0x8517('0x2f')](_0x461640);}var _0x2305dd=_0x322682[_0x8517('0x2e')][_0x8517('0x30')];return getAgent(_0x2305dd)[_0x8517('0x1d')](function(_0x56b659){logger[_0x8517('0x12')](_0x8517('0x34'),_0x56b659[_0x8517('0x18')]);emit(util[_0x8517('0x35')]('user:%s',_0x56b659['name']),_0x8517('0x4a'));return _0x50b037['status'](0xc8)[_0x8517('0x2f')]({'error':![],'message':_0x8517('0x4b')});})['catch'](handleError(_0x50b037));};exports[_0x8517('0x4c')]=function(_0x3e9374,_0x4a483d){logger[_0x8517('0x12')](_0x8517('0x4d'),_0x3e9374[_0x8517('0x2e')]);var _0x3321c5=transferValidation[_0x8517('0x3a')](_0x3e9374[_0x8517('0x2e')]);if(_0x3321c5[_0x8517('0x29')]>0x0){return _0x4a483d[_0x8517('0x19')](0x190)['json'](_0x3321c5);}var _0x2f0156=_0x3e9374[_0x8517('0x2e')][_0x8517('0x30')];var _0x1b9c97=_0x3e9374['body'][_0x8517('0x28')];var _0x4793fe=_0x3e9374[_0x8517('0x2e')][_0x8517('0x4e')];return getAgent(_0x2f0156)[_0x8517('0x1d')](function(_0x67bd47){logger['info']('entityFound:',_0x67bd47[_0x8517('0x18')]);emit(util[_0x8517('0x35')](_0x8517('0x3b'),_0x67bd47[_0x8517('0x18')]),'webbar:transfer',{'sessionId':_0x1b9c97,'transferNumber':_0x4793fe});return _0x4a483d[_0x8517('0x19')](0xc8)[_0x8517('0x2f')]({'error':![],'message':_0x8517('0x4f')});})[_0x8517('0x37')](handleError(_0x4a483d));}; \ No newline at end of file +var _0xb43b=['ioredis','redis','validate','number','userId\x20is\x20required','string','info','stringify','emit','log','error','name','status','send','NotFound','request','then','code','message','result','User','VoiceChannels','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callbackUrl','entityFound:','format','json','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','user:%s','answer\x20executed!','hold','hold\x20fired:','webbar:hold','calls','calls\x20fired:','all','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi'];(function(_0x1ffad8,_0x16d702){var _0xf8684=function(_0x1060b6){while(--_0x1060b6){_0x1ffad8['push'](_0x1ffad8['shift']());}};_0xf8684(++_0x16d702);}(_0xb43b,0xbf));var _0xbb43=function(_0x1bee59,_0x2bf87c){_0x1bee59=_0x1bee59-0x0;var _0xf3d1a9=_0xb43b[_0x1bee59];return _0xf3d1a9;};'use strict';var path=require(_0xbb43('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xbb43('0x1'))['db'];var config=require(_0xbb43('0x2'));var util=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var jayson=require(_0xbb43('0x5'));var amiClient=jayson[_0xbb43('0x6')][_0xbb43('0x7')]({'port':0x232a});var logger=require(_0xbb43('0x8'))(_0xbb43('0x9'));var Redis=require(_0xbb43('0xa'));config[_0xbb43('0xb')]=_['defaults'](config[_0xbb43('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb43('0xb')]));var Schema=require(_0xbb43('0xc'));var originateValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'callNumber':{'type':_0xbb43('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xbb43('0xf')},'callbackUrl':{'type':_0xbb43('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbb43('0xf'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xbb43('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':_0xbb43('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xbb43('0xd'),'required':[!![],_0xbb43('0xe')]}});function emit(_0x15182b,_0x10c91b,_0x3be44b){logger[_0xbb43('0x10')](_0x15182b,_0x10c91b,JSON[_0xbb43('0x11')](_0x3be44b));io['to'](_0x15182b)[_0xbb43('0x12')](_0x10c91b,_0x3be44b);}function handleError(_0x20b839){return function(_0x4c223b){console[_0xbb43('0x13')]('handleError:',_0x4c223b,_0x4c223b instanceof RangeError);logger[_0xbb43('0x14')](_0x4c223b['stack']);if(_0x4c223b instanceof RangeError){if(_0x4c223b[_0xbb43('0x15')]){delete _0x4c223b[_0xbb43('0x15')];}_0x20b839[_0xbb43('0x16')](0x194)[_0xbb43('0x17')](_0x4c223b);}else{if(_0x4c223b['name']){delete _0x4c223b[_0xbb43('0x15')];}_0x20b839[_0xbb43('0x16')](0x1f4)[_0xbb43('0x17')](_0x4c223b);}};}function checkError(){return function(_0x6f34d6){if(!_0x6f34d6){throw new RangeError(_0xbb43('0x18'));}return _0x6f34d6;};}function respondWithRpcPromise(_0x57fc97,_0xee1084){return new BPromise(function(_0x1e83cd,_0x3409d0){var _0x3cb6d1=amiClient;return _0x3cb6d1[_0xbb43('0x19')](_0x57fc97,_0xee1084)[_0xbb43('0x1a')](function(_0x36992f){if(_0x36992f[_0xbb43('0x14')]){if(_0x36992f['error'][_0xbb43('0x1b')]===0x1f4){return _0x3409d0(_0x36992f[_0xbb43('0x14')]['message']);}return _0x1e83cd(_0x36992f[_0xbb43('0x14')][_0xbb43('0x1c')]);}else{_0x1e83cd(_0x36992f[_0xbb43('0x1d')]);}})['catch'](function(_0x4ea4c5){_0x3409d0(_0x4ea4c5);});});}function getAgent(_0x20f223){return db[_0xbb43('0x1e')]['findOne']({'where':{'id':_0x20f223,'role':'agent'}})[_0xbb43('0x1a')](checkError());}function getAgentCheckSession(_0xb9fe3b,_0x268fb5){return new BPromise(function(_0x4bb859,_0x27bb65){var _0x426cec=respondWithRpcPromise(_0xbb43('0x1f'));var _0x1a6e2b=getAgent(_0xb9fe3b);Promise['all']([_0x426cec,_0x1a6e2b])[_0xbb43('0x1a')](function(_0x170e7a){var _0x821beb=_0x170e7a[0x0];var _0x293d66=_0x170e7a[0x1];var _0x34b679=_[_0xbb43('0x20')](_0x821beb[_0xbb43('0x21')],function(_0x48986d){return _0x48986d[_0xbb43('0x22')]==_0x293d66['id']&&_0x48986d[_0xbb43('0x23')]==_0x268fb5;});if(_0x34b679[_0xbb43('0x24')]==0x1){_0x4bb859(_0x293d66);}else{_0x27bb65(new RangeError('sessionId\x20'+_0x268fb5+_0xbb43('0x25')));}});});}exports[_0xbb43('0x26')]=function(_0x9384d8,_0x168374){logger[_0xbb43('0x10')](_0xbb43('0x27'),_0x9384d8[_0xbb43('0x28')]);var _0xa86300=originateValidation[_0xbb43('0xc')](_0x9384d8['body']);if(_0xa86300['length']>0x0){return _0x168374['status'](0x190)['json'](_0xa86300);}var _0x352249=_0x9384d8[_0xbb43('0x28')][_0xbb43('0x29')];var _0xe5d75b=_0x9384d8[_0xbb43('0x28')][_0xbb43('0x2a')];var _0x3c8758=_0x9384d8[_0xbb43('0x28')]['callerId'];var _0x1cf664=_0x9384d8[_0xbb43('0x28')][_0xbb43('0x2b')];return getAgent(_0x352249)[_0xbb43('0x1a')](function(_0x4c65d0){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x4c65d0[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')]('user:%s',_0x4c65d0[_0xbb43('0x15')]),'webbar:originate',{'callNumber':_0xe5d75b,'callerId':_0x3c8758,'callbackUrl':_0x1cf664});return _0x168374[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x2f')});})[_0xbb43('0x30')](handleError(_0x168374));};exports[_0xbb43('0x31')]=function(_0x1c1f8b,_0x316ab1){logger[_0xbb43('0x10')](_0xbb43('0x32'),_0x1c1f8b[_0xbb43('0x28')]);var _0xfeaa38=hangupValidation[_0xbb43('0xc')](_0x1c1f8b['body']);if(_0xfeaa38[_0xbb43('0x24')]>0x0){return _0x316ab1[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0xfeaa38);}var _0x2db230=_0x1c1f8b[_0xbb43('0x28')][_0xbb43('0x29')];var _0x21e03d=_0x1c1f8b[_0xbb43('0x28')][_0xbb43('0x23')];return getAgent(_0x2db230)[_0xbb43('0x1a')](function(_0x1fe204){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x1fe204[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')]('user:%s',_0x1fe204[_0xbb43('0x15')]),_0xbb43('0x33'),{'sessionId':_0x21e03d});return _0x316ab1[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x34')});})[_0xbb43('0x30')](handleError(_0x316ab1));};exports['answer']=function(_0x13e9f7,_0x448c6f){logger['info']('answer\x20fired:',_0x13e9f7[_0xbb43('0x28')]);var _0x1eb63f=answerValidation[_0xbb43('0xc')](_0x13e9f7[_0xbb43('0x28')]);if(_0x1eb63f[_0xbb43('0x24')]>0x0){return _0x448c6f['status'](0x190)['json'](_0x1eb63f);}var _0x2ea37b=_0x13e9f7[_0xbb43('0x28')][_0xbb43('0x29')];var _0x2d1256=_0x13e9f7[_0xbb43('0x28')][_0xbb43('0x23')];return getAgent(_0x2ea37b)[_0xbb43('0x1a')](function(_0x1d8993){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x1d8993['name']);emit(util['format'](_0xbb43('0x35'),_0x1d8993[_0xbb43('0x15')]),'webbar:answer',{'sessionId':_0x2d1256});return _0x448c6f[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x36')});})[_0xbb43('0x30')](handleError(_0x448c6f));};exports[_0xbb43('0x37')]=function(_0x1fcb16,_0x3976f1){logger['info'](_0xbb43('0x38'),_0x1fcb16[_0xbb43('0x28')]);var _0x5970cc=holdValidation[_0xbb43('0xc')](_0x1fcb16[_0xbb43('0x28')]);if(_0x5970cc['length']>0x0){return _0x3976f1[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0x5970cc);}var _0xd1f32b=_0x1fcb16[_0xbb43('0x28')][_0xbb43('0x29')];var _0x43a840=_0x1fcb16[_0xbb43('0x28')][_0xbb43('0x23')];return getAgent(_0xd1f32b)[_0xbb43('0x1a')](function(_0x2f044f){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x2f044f['name']);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x2f044f[_0xbb43('0x15')]),_0xbb43('0x39'),{'sessionId':_0x43a840});return _0x3976f1['status'](0xc8)[_0xbb43('0x2e')]({'error':![],'message':'hold\x20executed!'});})[_0xbb43('0x30')](handleError(_0x3976f1));};exports['unhold']=function(_0x21f78b,_0x322a77){logger[_0xbb43('0x10')]('unhold\x20fired:',_0x21f78b[_0xbb43('0x28')]);var _0x218da6=unholdValidation[_0xbb43('0xc')](_0x21f78b['body']);if(_0x218da6[_0xbb43('0x24')]>0x0){return _0x322a77[_0xbb43('0x16')](0x190)['json'](_0x218da6);}var _0x42029c=_0x21f78b['body'][_0xbb43('0x29')];var _0x476116=_0x21f78b['body'][_0xbb43('0x23')];return getAgent(_0x42029c)[_0xbb43('0x1a')](function(_0x349390){logger['info'](_0xbb43('0x2c'),_0x349390['name']);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x349390[_0xbb43('0x15')]),'webbar:unhold',{'sessionId':_0x476116});return _0x322a77[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x322a77));};exports[_0xbb43('0x3a')]=function(_0x9e3707,_0x5b7b39){logger['info'](_0xbb43('0x3b'),_0x5b7b39['body']);var _0x30908e=callsValidation[_0xbb43('0xc')](_0x9e3707[_0xbb43('0x28')]);if(_0x30908e['length']>0x0){return _0x5b7b39['status'](0x190)['json'](_0x30908e);}var _0x55cb63=_0x9e3707['body'][_0xbb43('0x29')];var _0x31d265=respondWithRpcPromise(_0xbb43('0x1f'));var _0x4024bb=getAgent(_0x55cb63);return Promise[_0xbb43('0x3c')]([_0x31d265,_0x4024bb])['then'](function(_0x19e8b7){var _0x529455=_0x19e8b7[0x0];var _0x6e7c04=_0x19e8b7[0x1];var _0x4b5e4b=_[_0xbb43('0x20')](_0x529455[_0xbb43('0x21')],function(_0x132b98){return _0x132b98[_0xbb43('0x22')]==_0x6e7c04['id'];});return _0x5b7b39['status'](0xc8)[_0xbb43('0x2e')]({'count':_0x4b5e4b['length'],'rows':_0x4b5e4b});})[_0xbb43('0x30')](handleError(_0x5b7b39));};exports[_0xbb43('0x3d')]=function(_0x512619,_0x1b69ab){logger[_0xbb43('0x10')]('conference\x20fired:',_0x512619[_0xbb43('0x28')]);var _0x13e1e3=conferenceValidation[_0xbb43('0xc')](_0x512619[_0xbb43('0x28')]);if(_0x13e1e3[_0xbb43('0x24')]>0x0){return _0x1b69ab[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0x13e1e3);}var _0x161556=_0x512619['body'][_0xbb43('0x29')];return getAgent(_0x161556)['then'](function(_0x36a69b){logger[_0xbb43('0x10')]('entityFound:',_0x36a69b[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x36a69b[_0xbb43('0x15')]),_0xbb43('0x3e'));return _0x1b69ab[_0xbb43('0x16')](0xc8)[_0xbb43('0x2e')]({'error':![],'message':_0xbb43('0x3f')});})['catch'](handleError(_0x1b69ab));};exports[_0xbb43('0x40')]=function(_0x21260c,_0x12f96c){logger[_0xbb43('0x10')]('transfer\x20fired:',_0x21260c[_0xbb43('0x28')]);var _0x5d73a5=transferValidation[_0xbb43('0xc')](_0x21260c['body']);if(_0x5d73a5[_0xbb43('0x24')]>0x0){return _0x12f96c[_0xbb43('0x16')](0x190)[_0xbb43('0x2e')](_0x5d73a5);}var _0x265d2d=_0x21260c[_0xbb43('0x28')][_0xbb43('0x29')];var _0x349699=_0x21260c[_0xbb43('0x28')][_0xbb43('0x23')];var _0x32483f=_0x21260c['body'][_0xbb43('0x41')];return getAgent(_0x265d2d)['then'](function(_0x1b9280){logger[_0xbb43('0x10')](_0xbb43('0x2c'),_0x1b9280[_0xbb43('0x15')]);emit(util[_0xbb43('0x2d')](_0xbb43('0x35'),_0x1b9280[_0xbb43('0x15')]),_0xbb43('0x42'),{'sessionId':_0x349699,'transferNumber':_0x32483f});return _0x12f96c['status'](0xc8)[_0xbb43('0x2e')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x12f96c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4f14f05..d7edddb 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 _0x5c3c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x17a2e6,_0x525f74){var _0x4ce0cc=function(_0x4b8e7d){while(--_0x4b8e7d){_0x17a2e6['push'](_0x17a2e6['shift']());}};_0x4ce0cc(++_0x525f74);}(_0x5c3c,0x132));var _0xc5c3=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x5c3c[_0x369151];return _0x4292d5;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var fs_extra=require(_0xc5c3('0x5'));var auth=require(_0xc5c3('0x6'));var interaction=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var controller=require(_0xc5c3('0x9'));router[_0xc5c3('0xa')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0xa')]('/:id',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xe')]);router['get'](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller['getDispositions']);router[_0xc5c3('0xa')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['getAnswers']);router[_0xc5c3('0xa')](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x12')]);router[_0xc5c3('0xa')](_0xc5c3('0x13'),auth['isAuthenticated'](),controller[_0xc5c3('0x14')]);router[_0xc5c3('0x15')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x16')]);router[_0xc5c3('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc5c3('0x17')]);router[_0xc5c3('0x15')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['addAnswer']);router['post'](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x18')]);router[_0xc5c3('0x15')](_0xc5c3('0x13'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x19')]);router['post'](_0xc5c3('0x1a'),controller[_0xc5c3('0x1b')]);router[_0xc5c3('0x15')](_0xc5c3('0x1c'),auth['isAuthenticated'](),controller[_0xc5c3('0x1d')]);router[_0xc5c3('0x1e')](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x20')]);router['delete'](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x21')]);router[_0xc5c3('0x22')](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x23')]);router['delete']('/:id/canned_answers',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x24')]);router['delete']('/:id/users',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x25')]);module[_0xc5c3('0x26')]=router; \ No newline at end of file +var _0x6d38=['get','/describe','/:id','/:id/dispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','update','delete','removeAgents','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index'];(function(_0x409682,_0x370090){var _0x1ee901=function(_0xe93c56){while(--_0xe93c56){_0x409682['push'](_0x409682['shift']());}};_0x1ee901(++_0x370090);}(_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['get'](_0x86d3('0xc'),auth[_0x86d3('0x7')](),controller['getDispositions']);router['get'](_0x86d3('0xd'),auth[_0x86d3('0x7')](),controller['getAnswers']);router[_0x86d3('0x9')]('/:id/users',auth[_0x86d3('0x7')](),controller[_0x86d3('0xe')]);router[_0x86d3('0x9')](_0x86d3('0xf'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x10')]);router[_0x86d3('0x11')]('/',auth[_0x86d3('0x7')](),controller['create']);router[_0x86d3('0x11')](_0x86d3('0xc'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x12')]);router[_0x86d3('0x11')](_0x86d3('0xd'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x13')]);router['post'](_0x86d3('0x14'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x15')]);router[_0x86d3('0x11')](_0x86d3('0xf'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x16')]);router[_0x86d3('0x11')](_0x86d3('0x17'),controller['notify']);router[_0x86d3('0x11')]('/:id/send',auth[_0x86d3('0x7')](),controller['send']);router['put'](_0x86d3('0xb'),auth[_0x86d3('0x7')](),controller[_0x86d3('0x18')]);router[_0x86d3('0x19')]('/:id',auth[_0x86d3('0x7')](),controller['destroy']);router[_0x86d3('0x19')](_0x86d3('0xc'),auth[_0x86d3('0x7')](),controller['removeDispositions']);router[_0x86d3('0x19')](_0x86d3('0xd'),auth[_0x86d3('0x7')](),controller['removeAnswers']);router['delete'](_0x86d3('0x14'),auth['isAuthenticated'](),controller[_0x86d3('0x1a')]);module[_0x86d3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 551e524..c680cf5 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 _0x3cba=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','twilio','sinch','TEXT','BOOLEAN'];(function(_0x29f361,_0x199d41){var _0x3e11d8=function(_0x212d00){while(--_0x212d00){_0x29f361['push'](_0x29f361['shift']());}};_0x3e11d8(++_0x199d41);}(_0x3cba,0x1e1));var _0xa3cb=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x3cba[_0x296923];return _0x29af70;};'use strict';var Sequelize=require(_0xa3cb('0x0'));var rs=require(_0xa3cb('0x1'));module[_0xa3cb('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa3cb('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xa3cb('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xa3cb('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xa3cb('0x4')]},'type':{'type':Sequelize['ENUM'](_0xa3cb('0x5'),_0xa3cb('0x6'))},'accountSid':{'type':Sequelize[_0xa3cb('0x4')]},'baseUrl':{'type':Sequelize[_0xa3cb('0x4')]},'authToken':{'type':Sequelize[_0xa3cb('0x4')]},'notificationTemplate':{'type':Sequelize[_0xa3cb('0x7')],'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[_0xa3cb('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa3cb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa3cb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa3cb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa3cb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa3cb('0x9')],'comment':_0xa3cb('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa3cb('0xb'),'set':function(_0x69f1e0){if(!_0x69f1e0){this[_0xa3cb('0xc')]('mandatoryDispositionPauseId',null);}this[_0xa3cb('0xc')](_0xa3cb('0xd'),_0x69f1e0);}},'description':{'type':Sequelize[_0xa3cb('0x4')]}}; \ No newline at end of file +var _0xcbf2=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x14c995,_0x5390e6){var _0x10fa2c=function(_0x59cae6){while(--_0x59cae6){_0x14c995['push'](_0x14c995['shift']());}};_0x10fa2c(++_0x5390e6);}(_0xcbf2,0x8a));var _0x2cbf=function(_0x159041,_0x1e82ab){_0x159041=_0x159041-0x0;var _0xe32c6b=_0xcbf2[_0x159041];return _0xe32c6b;};'use strict';var Sequelize=require(_0x2cbf('0x0'));var rs=require('randomstring');module[_0x2cbf('0x1')]={'name':{'type':Sequelize[_0x2cbf('0x2')],'unique':_0x2cbf('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2cbf('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x2cbf('0x2')],'defaultValue':function(){return rs[_0x2cbf('0x4')]();}},'phone':{'type':Sequelize[_0x2cbf('0x2')]},'type':{'type':Sequelize[_0x2cbf('0x5')]('twilio',_0x2cbf('0x6'))},'accountSid':{'type':Sequelize[_0x2cbf('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2cbf('0x7')],'defaultValue':function(){return _0x2cbf('0x8');}},'notificationSound':{'type':Sequelize[_0x2cbf('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2cbf('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2cbf('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2cbf('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2cbf('0xa')],'comment':_0x2cbf('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x2cbf('0x9')],'defaultValue':![],'comment':_0x2cbf('0xc'),'set':function(_0x1a3972){if(!_0x1a3972){this[_0x2cbf('0xd')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x2cbf('0xe'),_0x1a3972);}},'description':{'type':Sequelize[_0x2cbf('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 9bfdad4..a911f87 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 _0xba3a=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','get','WhatsappAccounts','destroy','stack','send','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','params','length','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Disposition','getDispositions','findOne','pick','WhatsappAccountId','ids','CannedAnswer','getAnswers','removeAnswers','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','account','sinch','statuses','state','read','timestamp','message_id','applications','Applications','asc','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','List','out','Messages','dataValues','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x43bee0,_0x5be716){var _0x477472=function(_0x14fa06){while(--_0x14fa06){_0x43bee0['push'](_0x43bee0['shift']());}};_0x477472(++_0x5be716);}(_0xba3a,0x163));var _0xaba3=function(_0x6c9ac2,_0x35886a){_0x6c9ac2=_0x6c9ac2-0x0;var _0x4d9f44=_0xba3a[_0x6c9ac2];return _0x4d9f44;};'use strict';var emlformat=require(_0xaba3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaba3('0x1'));var rp=require('request-promise');var moment=require(_0xaba3('0x2'));var BPromise=require(_0xaba3('0x3'));var Mustache=require(_0xaba3('0x4'));var util=require(_0xaba3('0x5'));var path=require(_0xaba3('0x6'));var sox=require(_0xaba3('0x7'));var csv=require(_0xaba3('0x8'));var ejs=require(_0xaba3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaba3('0xa'));var squel=require(_0xaba3('0xb'));var crypto=require('crypto');var jsforce=require(_0xaba3('0xc'));var deskjs=require(_0xaba3('0xd'));var toCsv=require(_0xaba3('0x8'));var querystring=require(_0xaba3('0xe'));var Papa=require(_0xaba3('0xf'));var Redis=require(_0xaba3('0x10'));var authService=require(_0xaba3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaba3('0x12'));var hardwareService=require(_0xaba3('0x13'));var logger=require(_0xaba3('0x14'))(_0xaba3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaba3('0x16'))['db'];config[_0xaba3('0x17')]=_[_0xaba3('0x18')](config[_0xaba3('0x17')],{'host':_0xaba3('0x19'),'port':0x18eb});var socket=require(_0xaba3('0x1a'))(new Redis(config['redis']));require(_0xaba3('0x1b'))[_0xaba3('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xaba3('0x1d')][_0xaba3('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5de25b,_0x2a0f53,_0x880852,_0x9e79b1){return new BPromise(function(_0x467c8c,_0x32090a){var _0x3ff156=_0x9e79b1||client;return _0x3ff156[_0xaba3('0x1f')](_0x5de25b,_0x880852)[_0xaba3('0x20')](function(_0x46c55d){logger['info'](_0xaba3('0x21'),_0x2a0f53,_0xaba3('0x22'));logger[_0xaba3('0x23')](_0xaba3('0x24'),_0x2a0f53,'request\x20sent',JSON[_0xaba3('0x25')](_0x46c55d));if(_0x46c55d[_0xaba3('0x26')]){if(_0x46c55d[_0xaba3('0x26')][_0xaba3('0x27')]===0x1f4){logger['error'](_0xaba3('0x21'),_0x2a0f53,_0x46c55d['error'][_0xaba3('0x28')]);return _0x32090a(_0x46c55d[_0xaba3('0x26')]['message']);}logger[_0xaba3('0x26')](_0xaba3('0x21'),_0x2a0f53,_0x46c55d[_0xaba3('0x26')][_0xaba3('0x28')]);return _0x467c8c(_0x46c55d['error'][_0xaba3('0x28')]);}else{logger[_0xaba3('0x29')](_0xaba3('0x21'),_0x2a0f53,'request\x20sent');_0x467c8c(_0x46c55d[_0xaba3('0x2a')]['message']);}})['catch'](function(_0x16c155){logger[_0xaba3('0x26')](_0xaba3('0x21'),_0x2a0f53,_0x16c155);_0x32090a(_0x16c155);});});}function respondWithStatusCode(_0x3259e1,_0x585ad4){_0x585ad4=_0x585ad4||0xcc;return function(_0x2f25b5){if(_0x2f25b5){return _0x3259e1[_0xaba3('0x2b')](_0x585ad4);}return _0x3259e1['status'](_0x585ad4)['end']();};}function respondWithResult(_0x25d3fc,_0x33cf21){_0x33cf21=_0x33cf21||0xc8;return function(_0x4e57ff){if(_0x4e57ff){return _0x25d3fc[_0xaba3('0x2c')](_0x33cf21)[_0xaba3('0x2d')](_0x4e57ff);}};}function respondWithFilteredResult(_0x380c3f,_0x184d39){return function(_0x10f7fc){if(_0x10f7fc){var _0x2e512e=typeof _0x184d39[_0xaba3('0x2e')]===_0xaba3('0x2f')&&typeof _0x184d39[_0xaba3('0x30')]==='undefined';var _0x33c92a=_0x10f7fc[_0xaba3('0x31')];var _0x4faa8d=_0x2e512e?0x0:_0x184d39['offset'];var _0x160bc4=_0x2e512e?_0x10f7fc['count']:_0x184d39['offset']+_0x184d39[_0xaba3('0x30')];var _0x100560;if(_0x160bc4>=_0x33c92a){_0x160bc4=_0x33c92a;_0x100560=0xc8;}else{_0x100560=0xce;}_0x380c3f[_0xaba3('0x2c')](_0x100560);return _0x380c3f[_0xaba3('0x32')](_0xaba3('0x33'),_0x4faa8d+'-'+_0x160bc4+'/'+_0x33c92a)['json'](_0x10f7fc);}return null;};}function patchUpdates(_0x49b10c){return function(_0x50d810){try{jsonpatch[_0xaba3('0x34')](_0x50d810,_0x49b10c,!![]);}catch(_0x24bf1a){return BPromise[_0xaba3('0x35')](_0x24bf1a);}return _0x50d810[_0xaba3('0x36')]();};}function saveUpdates(_0x1c9200,_0x281f8c){return function(_0x1b7482){if(_0x1b7482){return _0x1b7482['update'](_0x1c9200)[_0xaba3('0x20')](function(_0x30e664){return _0x30e664;});}return null;};}function removeEntity(_0x2f4a76,_0x3cfeac){return function(_0x202634){if(_0x202634){return _0x202634['destroy']()[_0xaba3('0x20')](function(){var _0x7f1d1=_0x202634[_0xaba3('0x37')]({'plain':!![]});var _0x40b2eb=_0xaba3('0x38');return db['UserProfileResource'][_0xaba3('0x39')]({'where':{'type':_0x40b2eb,'resourceId':_0x7f1d1['id']}})[_0xaba3('0x20')](function(){return _0x202634;});})[_0xaba3('0x20')](function(){_0x2f4a76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e070,_0x4e4de4){return function(_0x1267ad){if(!_0x1267ad){_0x28e070[_0xaba3('0x2b')](0x194);}return _0x1267ad;};}function handleError(_0x3c7fb3,_0x597f45){_0x597f45=_0x597f45||0x1f4;return function(_0x4ee22e){logger[_0xaba3('0x26')](_0x4ee22e[_0xaba3('0x3a')]);if(_0x4ee22e['name']){delete _0x4ee22e['name'];}_0x3c7fb3[_0xaba3('0x2c')](_0x597f45)[_0xaba3('0x3b')](_0x4ee22e);};}exports['index']=function(_0x23f786,_0x58f268){var _0x2b9359={'include':[{'model':db[_0xaba3('0x3c')],'as':_0xaba3('0x3d')}]},_0x1a8115={},_0x24d1f9={'count':0x0,'rows':[]};var _0x14ea6e=_['map'](db[_0xaba3('0x3e')][_0xaba3('0x3f')],function(_0x20db8e){return{'name':_0x20db8e[_0xaba3('0x40')],'type':_0x20db8e[_0xaba3('0x41')][_0xaba3('0x42')]};});_0x1a8115['model']=_[_0xaba3('0x43')](_0x14ea6e,_0xaba3('0x44'));_0x1a8115[_0xaba3('0x45')]=_[_0xaba3('0x46')](_0x23f786['query']);_0x1a8115[_0xaba3('0x47')]=_[_0xaba3('0x48')](_0x1a8115[_0xaba3('0x49')],_0x1a8115[_0xaba3('0x45')]);_0x2b9359[_0xaba3('0x4a')]=_['intersection'](_0x1a8115[_0xaba3('0x49')],qs[_0xaba3('0x4b')](_0x23f786[_0xaba3('0x45')][_0xaba3('0x4b')]));_0x2b9359[_0xaba3('0x4a')]=_0x2b9359['attributes']['length']?_0x2b9359[_0xaba3('0x4a')]:_0x1a8115[_0xaba3('0x49')];if(!_0x23f786[_0xaba3('0x45')][_0xaba3('0x4c')](_0xaba3('0x4d'))){_0x2b9359[_0xaba3('0x30')]=qs[_0xaba3('0x30')](_0x23f786[_0xaba3('0x45')][_0xaba3('0x30')]);_0x2b9359[_0xaba3('0x2e')]=qs[_0xaba3('0x2e')](_0x23f786[_0xaba3('0x45')][_0xaba3('0x2e')]);}_0x2b9359[_0xaba3('0x4e')]=qs[_0xaba3('0x4f')](_0x23f786[_0xaba3('0x45')][_0xaba3('0x4f')]);_0x2b9359[_0xaba3('0x50')]=qs[_0xaba3('0x47')](_['pick'](_0x23f786['query'],_0x1a8115[_0xaba3('0x47')]),_0x14ea6e);if(_0x23f786[_0xaba3('0x45')][_0xaba3('0x51')]){_0x2b9359[_0xaba3('0x50')]=_[_0xaba3('0x52')](_0x2b9359[_0xaba3('0x50')],{'$or':_['map'](_0x14ea6e,function(_0xfd3b39){if(_0xfd3b39[_0xaba3('0x41')]!=='VIRTUAL'){var _0x1415ac={};_0x1415ac[_0xfd3b39[_0xaba3('0x44')]]={'$like':'%'+_0x23f786[_0xaba3('0x45')]['filter']+'%'};return _0x1415ac;}})});}_0x2b9359=_['merge']({},_0x2b9359,_0x23f786[_0xaba3('0x53')]);var _0x472dae={'where':_0x2b9359[_0xaba3('0x50')]};return db[_0xaba3('0x3e')][_0xaba3('0x31')](_0x472dae)[_0xaba3('0x20')](function(_0x41a174){_0x24d1f9[_0xaba3('0x31')]=_0x41a174;if(_0x23f786[_0xaba3('0x45')]['includeAll']){_0x2b9359['include']=[{'all':!![]}];}return db[_0xaba3('0x3e')][_0xaba3('0x54')](_0x2b9359);})[_0xaba3('0x20')](function(_0x3efa39){_0x24d1f9[_0xaba3('0x55')]=_0x3efa39;return _0x24d1f9;})[_0xaba3('0x20')](respondWithFilteredResult(_0x58f268,_0x2b9359))[_0xaba3('0x56')](handleError(_0x58f268,null));};exports['show']=function(_0x593b80,_0x57c97f){var _0x3270cb={'raw':![],'where':{'id':_0x593b80[_0xaba3('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xaba3('0x3d')}]},_0x343ed6={};_0x343ed6['model']=_[_0xaba3('0x46')](db[_0xaba3('0x3e')]['rawAttributes']);_0x343ed6[_0xaba3('0x45')]=_[_0xaba3('0x46')](_0x593b80[_0xaba3('0x45')]);_0x343ed6[_0xaba3('0x47')]=_[_0xaba3('0x48')](_0x343ed6[_0xaba3('0x49')],_0x343ed6[_0xaba3('0x45')]);_0x3270cb[_0xaba3('0x4a')]=_[_0xaba3('0x48')](_0x343ed6[_0xaba3('0x49')],qs[_0xaba3('0x4b')](_0x593b80[_0xaba3('0x45')][_0xaba3('0x4b')]));_0x3270cb[_0xaba3('0x4a')]=_0x3270cb[_0xaba3('0x4a')][_0xaba3('0x58')]?_0x3270cb[_0xaba3('0x4a')]:_0x343ed6[_0xaba3('0x49')];if(_0x593b80[_0xaba3('0x45')][_0xaba3('0x59')]){_0x3270cb[_0xaba3('0x5a')]=[{'all':!![]}];}_0x3270cb=_[_0xaba3('0x52')]({},_0x3270cb,_0x593b80['options']);return db[_0xaba3('0x3e')][_0xaba3('0x5b')](_0x3270cb)[_0xaba3('0x20')](handleEntityNotFound(_0x57c97f,null))[_0xaba3('0x20')](respondWithResult(_0x57c97f,null))[_0xaba3('0x56')](handleError(_0x57c97f,null));};exports[_0xaba3('0x5c')]=function(_0x1f4d57,_0xad198d){return db[_0xaba3('0x3e')]['create'](_0x1f4d57[_0xaba3('0x5d')],{})[_0xaba3('0x20')](function(_0x1b35d0){var _0x260b50=_0x1f4d57[_0xaba3('0x5e')][_0xaba3('0x37')]({'plain':!![]});if(!_0x260b50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x260b50[_0xaba3('0x5f')]===_0xaba3('0x5e')){var _0x479289=_0x1b35d0[_0xaba3('0x37')]({'plain':!![]});var _0x3fd550='WhatsappAccounts';return db[_0xaba3('0x60')][_0xaba3('0x5b')]({'where':{'name':_0x3fd550,'userProfileId':_0x260b50[_0xaba3('0x61')]},'raw':!![]})[_0xaba3('0x20')](function(_0x493485){if(_0x493485&&_0x493485[_0xaba3('0x62')]===0x0){return db[_0xaba3('0x63')]['create']({'name':_0x479289[_0xaba3('0x44')],'resourceId':_0x479289['id'],'type':_0x493485[_0xaba3('0x44')],'sectionId':_0x493485['id']},{})[_0xaba3('0x20')](function(){return _0x1b35d0;});}else{return _0x1b35d0;}})[_0xaba3('0x56')](function(_0x2ab36a){logger['error'](_0xaba3('0x64'),_0x2ab36a);throw _0x2ab36a;});}return _0x1b35d0;})[_0xaba3('0x20')](respondWithResult(_0xad198d,0xc9))[_0xaba3('0x56')](handleError(_0xad198d,null));};exports[_0xaba3('0x65')]=function(_0x783468,_0x53e91f){if(_0x783468[_0xaba3('0x5d')]['id']){delete _0x783468[_0xaba3('0x5d')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x783468[_0xaba3('0x57')]['id']},'include':[{'model':db[_0xaba3('0x3c')],'as':'mandatoryDispositionPause'}]})[_0xaba3('0x20')](handleEntityNotFound(_0x53e91f,null))[_0xaba3('0x20')](saveUpdates(_0x783468[_0xaba3('0x5d')],null))[_0xaba3('0x20')](respondWithResult(_0x53e91f,null))[_0xaba3('0x56')](handleError(_0x53e91f,null));};exports['destroy']=function(_0x109cbb,_0x5eed93){return db['WhatsappAccount'][_0xaba3('0x5b')]({'where':{'id':_0x109cbb[_0xaba3('0x57')]['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x5eed93,null))[_0xaba3('0x20')](removeEntity(_0x5eed93,null))[_0xaba3('0x56')](handleError(_0x5eed93,null));};exports['describe']=function(_0x4ccf9d,_0x36f814){return db[_0xaba3('0x3e')]['describe']()[_0xaba3('0x20')](respondWithResult(_0x36f814,null))[_0xaba3('0x56')](handleError(_0x36f814,null));};exports['addDisposition']=function(_0x419145,_0x510bb0,_0x444290){if(_0x419145[_0xaba3('0x5d')]['id']){delete _0x419145[_0xaba3('0x5d')]['id'];}return db[_0xaba3('0x3e')]['find']({'where':{'id':_0x419145[_0xaba3('0x57')]['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x510bb0,null))['then'](function(_0x47f989){if(_0x47f989){_0x419145['body']['WhatsappAccountId']=_0x47f989['id'];return db[_0xaba3('0x66')][_0xaba3('0x5c')](_0x419145[_0xaba3('0x5d')]);}})[_0xaba3('0x20')](respondWithResult(_0x510bb0,null))[_0xaba3('0x56')](handleError(_0x510bb0,null));};exports[_0xaba3('0x67')]=function(_0x36b822,_0x2fb0c1,_0x265b0){var _0x50a41c={'raw':![],'where':{}};var _0x4d07c9={};var _0x47f2c4={'count':0x0,'rows':[]};return db[_0xaba3('0x3e')][_0xaba3('0x68')]({'where':{'id':_0x36b822[_0xaba3('0x57')]['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x2fb0c1,null))[_0xaba3('0x20')](function(_0xaca4b){if(_0xaca4b){_0x4d07c9[_0xaba3('0x49')]=_['keys'](db[_0xaba3('0x66')][_0xaba3('0x3f')]);_0x4d07c9[_0xaba3('0x45')]=_[_0xaba3('0x46')](_0x36b822[_0xaba3('0x45')]);_0x4d07c9[_0xaba3('0x47')]=_[_0xaba3('0x48')](_0x4d07c9['model'],_0x4d07c9[_0xaba3('0x45')]);_0x50a41c['attributes']=_[_0xaba3('0x48')](_0x4d07c9['model'],qs['fields'](_0x36b822[_0xaba3('0x45')][_0xaba3('0x4b')]));_0x50a41c[_0xaba3('0x4a')]=_0x50a41c[_0xaba3('0x4a')][_0xaba3('0x58')]?_0x50a41c[_0xaba3('0x4a')]:_0x4d07c9[_0xaba3('0x49')];if(!_0x36b822[_0xaba3('0x45')][_0xaba3('0x4c')](_0xaba3('0x4d'))){_0x50a41c[_0xaba3('0x30')]=qs[_0xaba3('0x30')](_0x36b822[_0xaba3('0x45')][_0xaba3('0x30')]);_0x50a41c[_0xaba3('0x2e')]=qs[_0xaba3('0x2e')](_0x36b822[_0xaba3('0x45')][_0xaba3('0x2e')]);}_0x50a41c[_0xaba3('0x4e')]=qs[_0xaba3('0x4f')](_0x36b822[_0xaba3('0x45')][_0xaba3('0x4f')]);_0x50a41c[_0xaba3('0x50')]=qs[_0xaba3('0x47')](_[_0xaba3('0x69')](_0x36b822[_0xaba3('0x45')],_0x4d07c9[_0xaba3('0x47')]));_0x50a41c['where'][_0xaba3('0x6a')]=_0xaca4b['id'];if(_0x36b822[_0xaba3('0x45')][_0xaba3('0x51')]){_0x50a41c[_0xaba3('0x50')]=_[_0xaba3('0x52')](_0x50a41c[_0xaba3('0x50')],{'$or':_[_0xaba3('0x43')](_0x50a41c[_0xaba3('0x4a')],function(_0x5c6f33){var _0x589718={};_0x589718[_0x5c6f33]={'$like':'%'+_0x36b822[_0xaba3('0x45')][_0xaba3('0x51')]+'%'};return _0x589718;})});}_0x50a41c=_[_0xaba3('0x52')]({},_0x50a41c,_0x36b822[_0xaba3('0x53')]);return db[_0xaba3('0x66')][_0xaba3('0x31')]({'where':_0x50a41c[_0xaba3('0x50')]})[_0xaba3('0x20')](function(_0x1c5987){_0x47f2c4[_0xaba3('0x31')]=_0x1c5987;if(_0x36b822[_0xaba3('0x45')][_0xaba3('0x59')]){_0x50a41c[_0xaba3('0x5a')]=[{'all':!![]}];}return db[_0xaba3('0x66')]['findAll'](_0x50a41c);})[_0xaba3('0x20')](function(_0x47622e){_0x47f2c4[_0xaba3('0x55')]=_0x47622e;return _0x47f2c4;});}})['then'](respondWithFilteredResult(_0x2fb0c1,_0x50a41c))['catch'](handleError(_0x2fb0c1,null));};exports['removeDispositions']=function(_0x2d7edc,_0x178362,_0x4062ee){return db[_0xaba3('0x3e')][_0xaba3('0x5b')]({'where':{'id':_0x2d7edc[_0xaba3('0x57')]['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x178362,null))[_0xaba3('0x20')](function(_0x36ed52){if(_0x36ed52){return _0x36ed52['removeDispositions'](_0x2d7edc['query'][_0xaba3('0x6b')]);}})[_0xaba3('0x20')](respondWithStatusCode(_0x178362,null))['catch'](handleError(_0x178362,null));};exports['addAnswer']=function(_0x1f26fd,_0x5db5d2,_0x4a630a){if(_0x1f26fd[_0xaba3('0x5d')]['id']){delete _0x1f26fd[_0xaba3('0x5d')]['id'];}return db[_0xaba3('0x3e')][_0xaba3('0x5b')]({'where':{'id':_0x1f26fd['params']['id']}})['then'](handleEntityNotFound(_0x5db5d2,null))[_0xaba3('0x20')](function(_0x2729b1){if(_0x2729b1){_0x1f26fd[_0xaba3('0x5d')][_0xaba3('0x6a')]=_0x2729b1['id'];return db[_0xaba3('0x6c')]['create'](_0x1f26fd[_0xaba3('0x5d')]);}})[_0xaba3('0x20')](respondWithResult(_0x5db5d2,null))[_0xaba3('0x56')](handleError(_0x5db5d2,null));};exports[_0xaba3('0x6d')]=function(_0xefdb00,_0x35607e,_0x2d9b27){var _0x5442fd={'raw':![],'where':{}};var _0x44afa8={};var _0x3e7a3a={'count':0x0,'rows':[]};return db[_0xaba3('0x3e')]['findOne']({'where':{'id':_0xefdb00[_0xaba3('0x57')]['id']}})['then'](handleEntityNotFound(_0x35607e,null))['then'](function(_0x3972e8){if(_0x3972e8){_0x44afa8[_0xaba3('0x49')]=_[_0xaba3('0x46')](db['CannedAnswer'][_0xaba3('0x3f')]);_0x44afa8['query']=_[_0xaba3('0x46')](_0xefdb00['query']);_0x44afa8[_0xaba3('0x47')]=_['intersection'](_0x44afa8['model'],_0x44afa8[_0xaba3('0x45')]);_0x5442fd[_0xaba3('0x4a')]=_[_0xaba3('0x48')](_0x44afa8[_0xaba3('0x49')],qs['fields'](_0xefdb00['query'][_0xaba3('0x4b')]));_0x5442fd['attributes']=_0x5442fd[_0xaba3('0x4a')][_0xaba3('0x58')]?_0x5442fd[_0xaba3('0x4a')]:_0x44afa8['model'];if(!_0xefdb00[_0xaba3('0x45')]['hasOwnProperty']('nolimit')){_0x5442fd['limit']=qs[_0xaba3('0x30')](_0xefdb00['query'][_0xaba3('0x30')]);_0x5442fd[_0xaba3('0x2e')]=qs[_0xaba3('0x2e')](_0xefdb00['query'][_0xaba3('0x2e')]);}_0x5442fd[_0xaba3('0x4e')]=qs[_0xaba3('0x4f')](_0xefdb00['query'][_0xaba3('0x4f')]);_0x5442fd[_0xaba3('0x50')]=qs[_0xaba3('0x47')](_[_0xaba3('0x69')](_0xefdb00[_0xaba3('0x45')],_0x44afa8[_0xaba3('0x47')]));_0x5442fd['where']['WhatsappAccountId']=_0x3972e8['id'];if(_0xefdb00['query']['filter']){_0x5442fd[_0xaba3('0x50')]=_[_0xaba3('0x52')](_0x5442fd[_0xaba3('0x50')],{'$or':_['map'](_0x5442fd[_0xaba3('0x4a')],function(_0x2644b8){var _0x45240b={};_0x45240b[_0x2644b8]={'$like':'%'+_0xefdb00[_0xaba3('0x45')][_0xaba3('0x51')]+'%'};return _0x45240b;})});}_0x5442fd=_['merge']({},_0x5442fd,_0xefdb00[_0xaba3('0x53')]);return db['CannedAnswer'][_0xaba3('0x31')]({'where':_0x5442fd[_0xaba3('0x50')]})[_0xaba3('0x20')](function(_0x2092b7){_0x3e7a3a[_0xaba3('0x31')]=_0x2092b7;if(_0xefdb00['query']['includeAll']){_0x5442fd[_0xaba3('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xaba3('0x54')](_0x5442fd);})[_0xaba3('0x20')](function(_0x41601f){_0x3e7a3a['rows']=_0x41601f;return _0x3e7a3a;});}})[_0xaba3('0x20')](respondWithFilteredResult(_0x35607e,_0x5442fd))['catch'](handleError(_0x35607e,null));};exports[_0xaba3('0x6e')]=function(_0x144f26,_0xb1a684,_0x2cd710){return db[_0xaba3('0x3e')][_0xaba3('0x5b')]({'where':{'id':_0x144f26[_0xaba3('0x57')]['id']}})['then'](handleEntityNotFound(_0xb1a684,null))[_0xaba3('0x20')](function(_0x8256e8){if(_0x8256e8){return _0x8256e8['removeAnswers'](_0x144f26[_0xaba3('0x45')]['ids']);}})[_0xaba3('0x20')](respondWithStatusCode(_0xb1a684,null))[_0xaba3('0x56')](handleError(_0xb1a684,null));};exports['addAgents']=function(_0x10b0de,_0x3c33bf,_0x4e5f36){return db[_0xaba3('0x3e')][_0xaba3('0x5b')]({'where':{'id':_0x10b0de[_0xaba3('0x57')]['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x3c33bf,null))[_0xaba3('0x20')](function(_0x8452b2){if(_0x8452b2){return _0x8452b2['addAgents'](_0x10b0de[_0xaba3('0x5d')][_0xaba3('0x6b')],_[_0xaba3('0x6f')](_0x10b0de[_0xaba3('0x5d')],[_0xaba3('0x6b'),'id'])||{})['spread'](function(_0x3c9725){for(var _0x1d1995=0x0;_0x1d1995<_0x10b0de[_0xaba3('0x5d')][_0xaba3('0x6b')][_0xaba3('0x58')];_0x1d1995+=0x1){socket[_0xaba3('0x70')](_0xaba3('0x71'),{'UserId':Number(_0x10b0de[_0xaba3('0x5d')][_0xaba3('0x6b')][_0x1d1995]),'WhatsappAccountId':Number(_0x10b0de[_0xaba3('0x57')]['id'])});}return _0x3c9725;});}})[_0xaba3('0x20')](respondWithResult(_0x3c33bf,null))[_0xaba3('0x56')](handleError(_0x3c33bf,null));};exports[_0xaba3('0x72')]=function(_0x25c27a,_0x4b895c,_0x58e66a){return db['WhatsappAccount']['find']({'where':{'id':_0x25c27a['params']['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x4b895c,null))[_0xaba3('0x20')](function(_0x1d2c66){if(_0x1d2c66){return _0x1d2c66[_0xaba3('0x72')](_0x25c27a[_0xaba3('0x45')][_0xaba3('0x6b')])[_0xaba3('0x20')](function(){if(_[_0xaba3('0x73')](_0x25c27a[_0xaba3('0x45')]['ids'])){for(var _0xaa5353=0x0;_0xaa5353<_0x25c27a[_0xaba3('0x45')][_0xaba3('0x6b')][_0xaba3('0x58')];_0xaa5353+=0x1){socket['emit'](_0xaba3('0x74'),{'UserId':Number(_0x25c27a[_0xaba3('0x45')][_0xaba3('0x6b')][_0xaa5353]),'WhatsappAccountId':Number(_0x25c27a[_0xaba3('0x57')]['id'])});}}else{socket[_0xaba3('0x70')](_0xaba3('0x74'),{'UserId':Number(_0x25c27a['query'][_0xaba3('0x6b')]),'WhatsappAccountId':Number(_0x25c27a[_0xaba3('0x57')]['id'])});}});}})[_0xaba3('0x20')](respondWithStatusCode(_0x4b895c,null))[_0xaba3('0x56')](handleError(_0x4b895c,null));};exports['getAgents']=function(_0x2009ea,_0x4a369d,_0x448422){var _0x3f2dc8={};var _0xd6528e={};var _0x775113;var _0x12d987;return db[_0xaba3('0x3e')][_0xaba3('0x68')]({'where':{'id':_0x2009ea[_0xaba3('0x57')]['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x4a369d,null))[_0xaba3('0x20')](function(_0x587610){if(_0x587610){_0x775113=_0x587610;_0xd6528e[_0xaba3('0x49')]=_[_0xaba3('0x46')](db[_0xaba3('0x75')][_0xaba3('0x3f')]);_0xd6528e['query']=_[_0xaba3('0x46')](_0x2009ea[_0xaba3('0x45')]);_0xd6528e[_0xaba3('0x47')]=_[_0xaba3('0x48')](_0xd6528e[_0xaba3('0x49')],_0xd6528e[_0xaba3('0x45')]);_0x3f2dc8[_0xaba3('0x4a')]=_[_0xaba3('0x48')](_0xd6528e[_0xaba3('0x49')],qs[_0xaba3('0x4b')](_0x2009ea[_0xaba3('0x45')][_0xaba3('0x4b')]));_0x3f2dc8['attributes']=_0x3f2dc8[_0xaba3('0x4a')]['length']?_0x3f2dc8[_0xaba3('0x4a')]:_0xd6528e['model'];_0x3f2dc8[_0xaba3('0x4e')]=qs['sort'](_0x2009ea[_0xaba3('0x45')]['sort']);_0x3f2dc8[_0xaba3('0x50')]=qs[_0xaba3('0x47')](_['pick'](_0x2009ea[_0xaba3('0x45')],_0xd6528e[_0xaba3('0x47')]));if(_0x2009ea[_0xaba3('0x45')][_0xaba3('0x51')]){_0x3f2dc8[_0xaba3('0x50')]=_[_0xaba3('0x52')](_0x3f2dc8['where'],{'$or':_[_0xaba3('0x43')](_0x3f2dc8[_0xaba3('0x4a')],function(_0x5078dd){var _0x3db327={};_0x3db327[_0x5078dd]={'$like':'%'+_0x2009ea['query']['filter']+'%'};return _0x3db327;})});}_0x3f2dc8=_[_0xaba3('0x52')]({},_0x3f2dc8,_0x2009ea['options']);return _0x775113['getAgents'](_0x3f2dc8);}})[_0xaba3('0x20')](function(_0x56a7fd){if(_0x56a7fd){_0x12d987=_0x56a7fd[_0xaba3('0x58')];if(!_0x2009ea['query'][_0xaba3('0x4c')](_0xaba3('0x4d'))){_0x3f2dc8[_0xaba3('0x30')]=qs[_0xaba3('0x30')](_0x2009ea[_0xaba3('0x45')]['limit']);_0x3f2dc8['offset']=qs['offset'](_0x2009ea[_0xaba3('0x45')][_0xaba3('0x2e')]);}return _0x775113[_0xaba3('0x76')](_0x3f2dc8);}})[_0xaba3('0x20')](function(_0x506d47){if(_0x506d47){return _0x506d47?{'count':_0x12d987,'rows':_0x506d47}:null;}})[_0xaba3('0x20')](respondWithResult(_0x4a369d,null))[_0xaba3('0x56')](handleError(_0x4a369d,null));};exports['addApplications']=function(_0x2b8f75,_0x4748ef){var _0x38efb7=_0x2b8f75[_0xaba3('0x57')]['id'];var _0x8dbcb=_0x2b8f75[_0xaba3('0x5d')];var _0x1bfd5e=0xc8;var _0x56d0a8=null;return db[_0xaba3('0x77')][_0xaba3('0x78')]({'isolationLevel':db[_0xaba3('0x77')][_0xaba3('0x79')][_0xaba3('0x7a')][_0xaba3('0x7b')]},function(_0x4e8f5e){return db[_0xaba3('0x3e')][_0xaba3('0x68')]({'where':{'id':_0x38efb7},'transaction':_0x4e8f5e})[_0xaba3('0x20')](function(_0x1835a1){if(_0x1835a1){return db[_0xaba3('0x7c')][_0xaba3('0x39')]({'where':{'WhatsappAccountId':_0x38efb7},'transaction':_0x4e8f5e})[_0xaba3('0x20')](function(){var _0x39bba0=_['map'](_0x8dbcb,function(_0x3436f6){_0x3436f6[_0xaba3('0x6a')]=_0x38efb7;return _0x3436f6;});return db['WhatsappApplication'][_0xaba3('0x7d')](_0x39bba0,{'transaction':_0x4e8f5e});});}else{_0x1bfd5e=0x194;_0x56d0a8=[];}});})[_0xaba3('0x20')](function(){if(_0x1bfd5e!==0x194){return db['WhatsappApplication'][_0xaba3('0x7e')]({'where':{'WhatsappAccountId':_0x38efb7},'order':_0xaba3('0x7f')})[_0xaba3('0x20')](function(_0xc64274){_0x56d0a8=_0xc64274;});}})[_0xaba3('0x56')](function(_0x44c82b){_0x1bfd5e=0x1f4;logger[_0xaba3('0x26')](_0x44c82b[_0xaba3('0x3a')]);if(_0x44c82b[_0xaba3('0x44')]){delete _0x44c82b[_0xaba3('0x44')];}_0x56d0a8=_0x44c82b;})[_0xaba3('0x80')](function(){if(_0x56d0a8===null){_0x4748ef[_0xaba3('0x2b')](_0x1bfd5e);}else{if(_0x1bfd5e===0x1f4){_0x4748ef[_0xaba3('0x2c')](_0x1bfd5e)['send'](_0x56d0a8);}else{_0x4748ef[_0xaba3('0x2c')](_0x1bfd5e)[_0xaba3('0x2d')](_0x56d0a8);}}});};exports['getApplications']=function(_0x5b6d15,_0x1583d3,_0x1543e2){var _0x52e569={};var _0x6ff23d={};var _0x4835dd;var _0x46e5cd;return db['WhatsappAccount'][_0xaba3('0x68')]({'where':{'id':_0x5b6d15[_0xaba3('0x57')]['id']}})[_0xaba3('0x20')](handleEntityNotFound(_0x1583d3,null))[_0xaba3('0x20')](function(_0x2ffc16){if(_0x2ffc16){_0x4835dd=_0x2ffc16;_0x6ff23d[_0xaba3('0x49')]=_[_0xaba3('0x46')](db['WhatsappApplication'][_0xaba3('0x3f')]);_0x6ff23d[_0xaba3('0x45')]=_[_0xaba3('0x46')](_0x5b6d15['query']);_0x6ff23d['filters']=_[_0xaba3('0x48')](_0x6ff23d[_0xaba3('0x49')],_0x6ff23d['query']);_0x52e569[_0xaba3('0x4a')]=_[_0xaba3('0x48')](_0x6ff23d[_0xaba3('0x49')],qs[_0xaba3('0x4b')](_0x5b6d15[_0xaba3('0x45')][_0xaba3('0x4b')]));_0x52e569[_0xaba3('0x4a')]=_0x52e569[_0xaba3('0x4a')][_0xaba3('0x58')]?_0x52e569[_0xaba3('0x4a')]:_0x6ff23d[_0xaba3('0x49')];_0x52e569[_0xaba3('0x4e')]=qs[_0xaba3('0x4f')](_0x5b6d15[_0xaba3('0x45')][_0xaba3('0x4f')]);_0x52e569[_0xaba3('0x50')]=qs['filters'](_['pick'](_0x5b6d15[_0xaba3('0x45')],_0x6ff23d[_0xaba3('0x47')]));if(_0x5b6d15[_0xaba3('0x45')][_0xaba3('0x51')]){_0x52e569[_0xaba3('0x50')]=_[_0xaba3('0x52')](_0x52e569[_0xaba3('0x50')],{'$or':_[_0xaba3('0x43')](_0x52e569['attributes'],function(_0x7044d3){var _0x41184b={};_0x41184b[_0x7044d3]={'$like':'%'+_0x5b6d15[_0xaba3('0x45')]['filter']+'%'};return _0x41184b;})});}_0x52e569=_[_0xaba3('0x52')]({},_0x52e569,_0x5b6d15[_0xaba3('0x53')]);return _0x4835dd[_0xaba3('0x81')](_0x52e569);}})[_0xaba3('0x20')](function(_0x16e5f9){if(_0x16e5f9){_0x46e5cd=_0x16e5f9[_0xaba3('0x58')];if(!_0x5b6d15[_0xaba3('0x45')][_0xaba3('0x4c')](_0xaba3('0x4d'))){_0x52e569[_0xaba3('0x30')]=qs[_0xaba3('0x30')](_0x5b6d15['query'][_0xaba3('0x30')]);_0x52e569[_0xaba3('0x2e')]=qs[_0xaba3('0x2e')](_0x5b6d15[_0xaba3('0x45')]['offset']);}return _0x4835dd[_0xaba3('0x81')](_0x52e569);}})[_0xaba3('0x20')](function(_0xa7f006){if(_0xa7f006){return _0xa7f006?{'count':_0x46e5cd,'rows':_0xa7f006}:null;}})['then'](respondWithResult(_0x1583d3,null))[_0xaba3('0x56')](handleError(_0x1583d3,null));};exports[_0xaba3('0x82')]=function(_0x234049,_0x5ef1a5,_0x184a6d){var _0x400352={'channel':'whatsapp'};var _0x47e208=[];var _0xe1cc8a=[];var _0x43a26c={};return db[_0xaba3('0x3e')][_0xaba3('0x5b')]({'where':{'id':_0x234049[_0xaba3('0x57')]['id']},'include':[{'model':db[_0xaba3('0x7c')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x5ef1a5,null))[_0xaba3('0x20')](function(_0x2d25ce){_0x400352[_0xaba3('0x83')]=_0x2d25ce;if(_0x400352['account']&&_0x400352[_0xaba3('0x83')]['type']===_0xaba3('0x84')&&_0x234049[_0xaba3('0x5d')][_0xaba3('0x85')]){if(_0x234049[_0xaba3('0x5d')][_0xaba3('0x85')][_0xaba3('0x58')]===0x0)return;if(_0x234049[_0xaba3('0x5d')][_0xaba3('0x85')][0x0][_0xaba3('0x86')]!==_0xaba3('0x87'))return;return db['WhatsappMessage'][_0xaba3('0x65')]({'read':!![],'readAt':_0x234049['body'][_0xaba3('0x85')][0x0][_0xaba3('0x88')]},{'where':{'messageId':_0x234049[_0xaba3('0x5d')][_0xaba3('0x85')][0x0][_0xaba3('0x89')]},'individualHooks':!![]})[_0xaba3('0x20')](function(_0x3648c5){return _0x5ef1a5[_0xaba3('0x2c')](0xc8)[_0xaba3('0x2d')](_0x3648c5);});}_0x400352[_0xaba3('0x8a')]=_['orderBy'](_0x2d25ce[_0xaba3('0x8b')],[_0xaba3('0x7f')],[_0xaba3('0x8c')]);if(_0x400352[_0xaba3('0x83')][_0xaba3('0x8b')]){delete _0x400352['account'][_0xaba3('0x8b')];}return db[_0xaba3('0x8d')][_0xaba3('0x8e')]()[_0xaba3('0x20')](function(_0x27f715){if(!_0x27f715){throw new db[(_0xaba3('0x8f'))][(_0xaba3('0x90'))](_0xaba3('0x91'));}_0x47e208=_[_0xaba3('0x92')](_[_0xaba3('0x46')](_0x27f715),[_0xaba3('0x93'),_0xaba3('0x94')]);_0xe1cc8a=_[_0xaba3('0x92')](_['keys'](_0x27f715),['createdAt',_0xaba3('0x94'),_0xaba3('0x95'),_0xaba3('0x96')]);_0x400352[_0xaba3('0x5d')]={'mapKey':'mobile'};if(_0x400352[_0xaba3('0x83')]&&_0x400352[_0xaba3('0x83')]['type']===_0xaba3('0x97')){_0x400352[_0xaba3('0x5d')]['from']=_0x234049['body'][_0xaba3('0x98')][_0xaba3('0x99')](_0xaba3('0x9a'),'');_0x400352[_0xaba3('0x5d')][_0xaba3('0x5d')]=_0x234049[_0xaba3('0x5d')][_0xaba3('0x9b')];_0x400352[_0xaba3('0x5d')][_0xaba3('0x9c')]=_0x234049[_0xaba3('0x5d')][_0xaba3('0x9d')];}if(_0x400352[_0xaba3('0x83')]&&_0x400352['account']['type']===_0xaba3('0x84')){_0x400352['body'][_0xaba3('0x9e')]=_0x234049[_0xaba3('0x5d')][_0xaba3('0x9f')][0x0]['from'];_0x400352[_0xaba3('0x5d')][_0xaba3('0x5d')]=_0x234049['body'][_0xaba3('0x9f')][0x0][_0xaba3('0x28')][_0xaba3('0x5d')];_0x400352[_0xaba3('0x5d')]['messageId']=_0x234049[_0xaba3('0x5d')]['notifications'][0x0][_0xaba3('0x89')];}if(_0x400352[_0xaba3('0x5d')]['id']){delete _0x400352[_0xaba3('0x5d')]['id'];}if(_[_0xaba3('0xa0')](_0x400352['body'][_0xaba3('0x9e')])){throw new db['Sequelize'][(_0xaba3('0x90'))](_0xaba3('0xa1'));}if(_[_0xaba3('0xa0')](_0x400352['body'][_0xaba3('0x5d')])||_0x400352['body'][_0xaba3('0x5d')]===''){throw new db[(_0xaba3('0x8f'))][(_0xaba3('0x90'))](_0xaba3('0xa2'));}if(_[_0xaba3('0xa0')](_0x400352[_0xaba3('0x5d')][_0xaba3('0xa3')])){throw new db['Sequelize'][(_0xaba3('0x90'))](_0xaba3('0xa4')+_0xe1cc8a);}if(!_[_0xaba3('0xa5')](_0xe1cc8a,_0x400352['body'][_0xaba3('0xa3')])){throw new db[(_0xaba3('0x8f'))][(_0xaba3('0x90'))](_0xaba3('0xa6')+_0xe1cc8a);}_0x43a26c[_0x400352[_0xaba3('0x5d')][_0xaba3('0xa3')]]=_0x400352['body']['from'];return db[_0xaba3('0xa7')][_0xaba3('0x5b')]({'where':{'id':_0x400352[_0xaba3('0x83')]['ListId']},'include':[{'model':db[_0xaba3('0x8d')],'as':'Contacts','where':_0x43a26c,'limit':0x1,'order':[[_0xaba3('0x94'),_0xaba3('0xa8')]]}]});})['then'](handleEntityNotFound(_0x5ef1a5,null))['then'](function(_0xcbf15c){if(_0xcbf15c){_0x400352[_0xaba3('0xa9')]=_[_0xaba3('0x6f')](_0xcbf15c,['Contacts']);if(_0xcbf15c[_0xaba3('0xaa')][_0xaba3('0x58')]){return _0xcbf15c[_0xaba3('0xaa')][0x0];}var _0xd14913=_[_0xaba3('0x18')](_0x400352[_0xaba3('0x5d')],{'firstName':_0x400352[_0xaba3('0x5d')][_0xaba3('0x9e')],'ListId':_0xcbf15c['id']});_0xd14913[_0x400352[_0xaba3('0x5d')]['mapKey']]=_0x400352['body'][_0xaba3('0x9e')];return db[_0xaba3('0x8d')]['create'](_0xd14913,{'fields':_0x47e208,'raw':!![]});}})[_0xaba3('0x20')](handleEntityNotFound(_0x5ef1a5,null))[_0xaba3('0x20')](function(_0x163924){if(_0x163924){_0x400352[_0xaba3('0xab')]=_0x163924;var _0x3bae00={'ContactId':_0x163924['id'],'phone':_0x400352['body'][_0xaba3('0x9e')],'WhatsappAccountId':_0x234049[_0xaba3('0x57')]['id']};var _0x3e7109={'ContactId':_0x163924['id'],'WhatsappAccountId':_0x234049['params']['id'],'closed':![]};return db[_0xaba3('0xac')][_0xaba3('0x5b')]({'where':_0x3e7109})['then'](function(_0x4760fc){if(_0x4760fc){return[_0x4760fc,![]];}return db[_0xaba3('0xac')][_0xaba3('0x5c')](_0x3bae00)[_0xaba3('0x20')](function(_0x6068e3){return[_0x6068e3,!![]];});});}})[_0xaba3('0xad')](function(_0xb7888b,_0xe4a6f1){_0x400352['interaction']=_0xb7888b[_0xaba3('0x37')]({'plain':!![]});_0x400352[_0xaba3('0xae')][_0xaba3('0xaf')]=![];if(_0xe4a6f1){if(_0x400352['account'][_0xaba3('0xb0')]){_0x400352[_0xaba3('0x8a')][_0xaba3('0xb1')]({'id':0x0,'priority':_0x400352[_0xaba3('0x8a')][_0xaba3('0x58')]+0x1,'app':_0xaba3('0xb2'),'appdata':'unmanaged','interval':_0xaba3('0xb3')});}_0x400352[_0xaba3('0xae')][_0xaba3('0xaf')]=!![];}return db[_0xaba3('0xb4')][_0xaba3('0x5c')]({'phone':_0x400352[_0xaba3('0x5d')][_0xaba3('0x9e')],'messageId':_0x400352[_0xaba3('0x5d')][_0xaba3('0x9c')],'body':_0x400352[_0xaba3('0x5d')]['body'],'WhatsappAccountId':_0x234049[_0xaba3('0x57')]['id'],'WhatsappInteractionId':_0xb7888b['id'],'direction':'in','ContactId':_0xb7888b['ContactId'],'AttachmentId':_0x400352[_0xaba3('0x5d')]['AttachmentId']});})[_0xaba3('0x20')](function(_0x47de5d){_0x400352['message']=_0x47de5d;if(_0x400352[_0xaba3('0xae')][_0xaba3('0xb5')]){return db['User']['find']({'attributes':['id',_0xaba3('0x44')],'where':{'id':_0x400352[_0xaba3('0xae')][_0xaba3('0xb5')]}})[_0xaba3('0x20')](function(_0x500835){if(_0x500835){_0x400352['applications'][_0xaba3('0xb6')]({'id':0x0,'priority':0x0,'app':_0xaba3('0xb7'),'appdata':_0x500835[_0xaba3('0x44')]+','+(_0x400352[_0xaba3('0x83')][_0xaba3('0xb8')]||0xa),'interval':_0xaba3('0xb3')});}return respondWithRpcPromise(_0xaba3('0xb9'),_0xaba3('0xba'),_0x400352);});}return respondWithRpcPromise(_0xaba3('0xb9'),_0xaba3('0xba'),_0x400352);})[_0xaba3('0x20')](function(_0xde56ec){if(_0xde56ec){var _0x3cd90c=0xc8;var _0xe4a5b='receiveMessage';logger[_0xaba3('0x29')](_0xaba3('0x24'),_0xe4a5b,_0x3cd90c,_0xaba3('0xbb'));logger[_0xaba3('0x23')](_0xaba3('0xbc'),_0xe4a5b,_0x3cd90c,'entity\x20found',JSON[_0xaba3('0x25')](_0xde56ec));if(_0x400352[_0xaba3('0x83')][_0xaba3('0x41')]===_0xaba3('0x97')){return _0x5ef1a5['status'](_0x3cd90c)[_0xaba3('0x32')](_0xaba3('0xbd'),'text/xml')[_0xaba3('0x3b')](_0xaba3('0xbe'));}else{return _0x5ef1a5['status'](_0x3cd90c)['json'](_0xde56ec);}}});})[_0xaba3('0x56')](handleError(_0x5ef1a5,null));};exports[_0xaba3('0x3b')]=function(_0x3045bc,_0x14dd6d,_0x1229e9){var _0x51764f,_0x5713d5,_0x3a5d9b;if(_[_0xaba3('0xa0')](_0x3045bc[_0xaba3('0x5d')][_0xaba3('0x5d')])||_0x3045bc[_0xaba3('0x5d')]['body']===''){throw new db[(_0xaba3('0x8f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xaba3('0xa0')](_0x3045bc[_0xaba3('0x5d')]['to'])){throw new db[(_0xaba3('0x8f'))]['ValidationError']('to\x20is\x20mandatory');}_0x51764f=_0x3045bc[_0xaba3('0x5d')]['to'];return db['WhatsappAccount'][_0xaba3('0x5b')]({'where':{'id':_0x3045bc[_0xaba3('0x57')]['id']},'include':[{'model':db[_0xaba3('0xa7')],'as':_0xaba3('0xbf'),'include':[{'model':db['CmContact'],'as':_0xaba3('0xaa'),'where':{'mobile':_0x51764f},'limit':0x1,'order':[[_0xaba3('0x94'),_0xaba3('0xa8')]]}]}]})[_0xaba3('0x20')](handleEntityNotFound(_0x14dd6d,null))[_0xaba3('0x20')](function(_0x468bec){if(_0x468bec&&_0x468bec[_0xaba3('0xbf')]){_0x5713d5=_0x468bec[_0xaba3('0x37')]({'plain':!![]});if(_0x5713d5[_0xaba3('0xbf')]&&_0x5713d5['List']['Contacts']['length']){return _0x5713d5[_0xaba3('0xbf')]['Contacts'][0x0];}return db[_0xaba3('0x8d')][_0xaba3('0x5c')](_['defaults'](_0x3045bc['body'],{'firstName':_0x51764f,'mobile':_0x51764f,'phone':_0x51764f,'ListId':_0x5713d5[_0xaba3('0x96')]}));}})['then'](handleEntityNotFound(_0x14dd6d,null))[_0xaba3('0x20')](function(_0x4c39f8){if(_0x4c39f8){_0x3a5d9b=_0x4c39f8;return db['WhatsappInteraction'][_0xaba3('0x5b')]({'where':{'ContactId':_0x3a5d9b['id'],'closed':![],'WhatsappAccountId':_0x5713d5['id']}})[_0xaba3('0x20')](function(_0x3f3e59){if(_0x3f3e59){return[_0x3f3e59,![]];}return db[_0xaba3('0xac')][_0xaba3('0x5c')]({'UserId':_0x3045bc['user']['id'],'ContactId':_0x3a5d9b['id'],'WhatsappAccountId':_0x5713d5['id'],'phone':_0x51764f,'firstMsgDirection':_0xaba3('0xc0'),'Messages':[_[_0xaba3('0x52')](_0x3045bc['body'],{'read':![],'body':_0x3045bc[_0xaba3('0x5d')]['body'],'phone':_0x51764f,'WhatsappAccountId':_0x5713d5['id'],'UserId':_0x3045bc[_0xaba3('0x5e')]['id'],'ContactId':_0x3a5d9b['id']})]},{'include':[{'model':db[_0xaba3('0xb4')],'as':_0xaba3('0xc1')}]})['then'](function(_0x5de48f){return[_0x5de48f,!![]];});});}})[_0xaba3('0xad')](function(_0x3ced9a,_0x1cfc34){if(_0x1cfc34){return _0x3ced9a;}return db[_0xaba3('0xb4')]['create'](_['merge'](_0x3045bc[_0xaba3('0x5d')],{'read':![],'body':_0x3045bc[_0xaba3('0x5d')][_0xaba3('0x5d')],'phone':_0x51764f,'WhatsappAccountId':_0x5713d5['id'],'WhatsappInteractionId':_0x3ced9a['id'],'UserId':_0x3045bc[_0xaba3('0x5e')]['id'],'ContactId':_0x3a5d9b['id']}))[_0xaba3('0x20')](function(_0x58a1cd){_0x3ced9a[_0xaba3('0xc2')][_0xaba3('0xc1')]=[];_0x3ced9a[_0xaba3('0xc2')][_0xaba3('0xc1')][_0xaba3('0xb1')](_0x58a1cd[_0xaba3('0xc2')]);return _0x3ced9a;});})[_0xaba3('0x20')](respondWithResult(_0x14dd6d,null))[_0xaba3('0x56')](handleError(_0x14dd6d,null));}; \ No newline at end of file +var _0x5a7e=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','type','key','map','name','keys','filters','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','WhatsappMessage','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','includes','mapKey','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','push','unmanaged','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','to\x20is\x20mandatory','List','user','Messages','dataValues','eml-format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5a7e,0xbb));var _0xe5a7=function(_0x2ed4fa,_0x55588e){_0x2ed4fa=_0x2ed4fa-0x0;var _0x534b53=_0x5a7e[_0x2ed4fa];return _0x534b53;};'use strict';var emlformat=require(_0xe5a7('0x0'));var rimraf=require(_0xe5a7('0x1'));var zipdir=require(_0xe5a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5a7('0x3'));var moment=require(_0xe5a7('0x4'));var BPromise=require(_0xe5a7('0x5'));var Mustache=require(_0xe5a7('0x6'));var util=require(_0xe5a7('0x7'));var path=require(_0xe5a7('0x8'));var sox=require(_0xe5a7('0x9'));var csv=require(_0xe5a7('0xa'));var ejs=require(_0xe5a7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5a7('0xc'));var squel=require('squel');var crypto=require(_0xe5a7('0xd'));var jsforce=require(_0xe5a7('0xe'));var deskjs=require(_0xe5a7('0xf'));var toCsv=require(_0xe5a7('0xa'));var querystring=require(_0xe5a7('0x10'));var Papa=require('papaparse');var Redis=require(_0xe5a7('0x11'));var authService=require(_0xe5a7('0x12'));var qs=require(_0xe5a7('0x13'));var as=require(_0xe5a7('0x14'));var hardwareService=require(_0xe5a7('0x15'));var logger=require('../../config/logger')(_0xe5a7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe5a7('0x17'))['db'];config[_0xe5a7('0x18')]=_[_0xe5a7('0x19')](config[_0xe5a7('0x18')],{'host':_0xe5a7('0x1a'),'port':0x18eb});var socket=require(_0xe5a7('0x1b'))(new Redis(config[_0xe5a7('0x18')]));require('./whatsappAccount.socket')[_0xe5a7('0x1c')](socket);var jayson=require(_0xe5a7('0x1d'));var client=jayson[_0xe5a7('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0xe6b77e,_0x560e45,_0x4c295f,_0x264a1f){return new BPromise(function(_0x42afd8,_0x29d1be){var _0x2b4f2c=_0x264a1f||client;return _0x2b4f2c['request'](_0xe6b77e,_0x4c295f)[_0xe5a7('0x1f')](function(_0x489654){logger['info'](_0xe5a7('0x20'),_0x560e45,_0xe5a7('0x21'));logger[_0xe5a7('0x22')](_0xe5a7('0x23'),_0x560e45,_0xe5a7('0x21'),JSON[_0xe5a7('0x24')](_0x489654));if(_0x489654[_0xe5a7('0x25')]){if(_0x489654[_0xe5a7('0x25')]['code']===0x1f4){logger[_0xe5a7('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x560e45,_0x489654[_0xe5a7('0x25')][_0xe5a7('0x26')]);return _0x29d1be(_0x489654['error'][_0xe5a7('0x26')]);}logger[_0xe5a7('0x25')](_0xe5a7('0x20'),_0x560e45,_0x489654[_0xe5a7('0x25')][_0xe5a7('0x26')]);return _0x42afd8(_0x489654['error']['message']);}else{logger[_0xe5a7('0x27')](_0xe5a7('0x20'),_0x560e45,'request\x20sent');_0x42afd8(_0x489654['result']['message']);}})[_0xe5a7('0x28')](function(_0x3a2dcf){logger['error'](_0xe5a7('0x20'),_0x560e45,_0x3a2dcf);_0x29d1be(_0x3a2dcf);});});}function respondWithStatusCode(_0x19ef4,_0x1dff9d){_0x1dff9d=_0x1dff9d||0xcc;return function(_0x176447){if(_0x176447){return _0x19ef4[_0xe5a7('0x29')](_0x1dff9d);}return _0x19ef4[_0xe5a7('0x2a')](_0x1dff9d)[_0xe5a7('0x2b')]();};}function respondWithResult(_0x535af9,_0xaa74e3){_0xaa74e3=_0xaa74e3||0xc8;return function(_0x4a7be5){if(_0x4a7be5){return _0x535af9['status'](_0xaa74e3)[_0xe5a7('0x2c')](_0x4a7be5);}};}function respondWithFilteredResult(_0x393099,_0x5dd105){return function(_0xa050b7){if(_0xa050b7){var _0x4896af=typeof _0x5dd105['offset']===_0xe5a7('0x2d')&&typeof _0x5dd105[_0xe5a7('0x2e')]===_0xe5a7('0x2d');var _0x4d6fe6=_0xa050b7[_0xe5a7('0x2f')];var _0x5f4b9e=_0x4896af?0x0:_0x5dd105[_0xe5a7('0x30')];var _0x56387b=_0x4896af?_0xa050b7['count']:_0x5dd105[_0xe5a7('0x30')]+_0x5dd105[_0xe5a7('0x2e')];var _0x21a26e;if(_0x56387b>=_0x4d6fe6){_0x56387b=_0x4d6fe6;_0x21a26e=0xc8;}else{_0x21a26e=0xce;}_0x393099['status'](_0x21a26e);return _0x393099[_0xe5a7('0x31')](_0xe5a7('0x32'),_0x5f4b9e+'-'+_0x56387b+'/'+_0x4d6fe6)[_0xe5a7('0x2c')](_0xa050b7);}return null;};}function patchUpdates(_0x3a4e1a){return function(_0x1e6897){try{jsonpatch[_0xe5a7('0x33')](_0x1e6897,_0x3a4e1a,!![]);}catch(_0xe9335a){return BPromise[_0xe5a7('0x34')](_0xe9335a);}return _0x1e6897['save']();};}function saveUpdates(_0x41a322,_0x4cbd3e){return function(_0x3d9b75){if(_0x3d9b75){return _0x3d9b75[_0xe5a7('0x35')](_0x41a322)[_0xe5a7('0x1f')](function(_0x44da0b){return _0x44da0b;});}return null;};}function removeEntity(_0x33f478,_0x1b9bec){return function(_0x2ae090){if(_0x2ae090){return _0x2ae090[_0xe5a7('0x36')]()[_0xe5a7('0x1f')](function(){var _0x59bac6=_0x2ae090[_0xe5a7('0x37')]({'plain':!![]});var _0x23f8c3='WhatsappAccounts';return db[_0xe5a7('0x38')][_0xe5a7('0x36')]({'where':{'type':_0x23f8c3,'resourceId':_0x59bac6['id']}})['then'](function(){return _0x2ae090;});})[_0xe5a7('0x1f')](function(){_0x33f478[_0xe5a7('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd775,_0x198bc1){return function(_0x133977){if(!_0x133977){_0x2fd775['sendStatus'](0x194);}return _0x133977;};}function handleError(_0x163050,_0x2194d9){_0x2194d9=_0x2194d9||0x1f4;return function(_0x2d5ddd){logger['error'](_0x2d5ddd[_0xe5a7('0x39')]);if(_0x2d5ddd['name']){delete _0x2d5ddd['name'];}_0x163050[_0xe5a7('0x2a')](_0x2194d9)[_0xe5a7('0x3a')](_0x2d5ddd);};}exports[_0xe5a7('0x3b')]=function(_0x468096,_0x208181){var _0x3a7bf4={'include':[{'model':db[_0xe5a7('0x3c')],'as':_0xe5a7('0x3d')}]},_0x754a79={},_0x39e570={'count':0x0,'rows':[]};var _0xf7dd82=_['map'](db[_0xe5a7('0x3e')]['rawAttributes'],function(_0x2c7c39){return{'name':_0x2c7c39[_0xe5a7('0x3f')],'type':_0x2c7c39[_0xe5a7('0x40')][_0xe5a7('0x41')]};});_0x754a79['model']=_[_0xe5a7('0x42')](_0xf7dd82,_0xe5a7('0x43'));_0x754a79['query']=_[_0xe5a7('0x44')](_0x468096['query']);_0x754a79[_0xe5a7('0x45')]=_['intersection'](_0x754a79[_0xe5a7('0x46')],_0x754a79[_0xe5a7('0x47')]);_0x3a7bf4[_0xe5a7('0x48')]=_['intersection'](_0x754a79[_0xe5a7('0x46')],qs[_0xe5a7('0x49')](_0x468096['query'][_0xe5a7('0x49')]));_0x3a7bf4[_0xe5a7('0x48')]=_0x3a7bf4['attributes'][_0xe5a7('0x4a')]?_0x3a7bf4[_0xe5a7('0x48')]:_0x754a79['model'];if(!_0x468096['query'][_0xe5a7('0x4b')](_0xe5a7('0x4c'))){_0x3a7bf4[_0xe5a7('0x2e')]=qs[_0xe5a7('0x2e')](_0x468096[_0xe5a7('0x47')][_0xe5a7('0x2e')]);_0x3a7bf4[_0xe5a7('0x30')]=qs['offset'](_0x468096[_0xe5a7('0x47')][_0xe5a7('0x30')]);}_0x3a7bf4[_0xe5a7('0x4d')]=qs[_0xe5a7('0x4e')](_0x468096['query']['sort']);_0x3a7bf4[_0xe5a7('0x4f')]=qs[_0xe5a7('0x45')](_[_0xe5a7('0x50')](_0x468096[_0xe5a7('0x47')],_0x754a79[_0xe5a7('0x45')]),_0xf7dd82);if(_0x468096[_0xe5a7('0x47')][_0xe5a7('0x51')]){_0x3a7bf4[_0xe5a7('0x4f')]=_['merge'](_0x3a7bf4[_0xe5a7('0x4f')],{'$or':_[_0xe5a7('0x42')](_0xf7dd82,function(_0x59576c){if(_0x59576c[_0xe5a7('0x40')]!==_0xe5a7('0x52')){var _0x334b60={};_0x334b60[_0x59576c[_0xe5a7('0x43')]]={'$like':'%'+_0x468096[_0xe5a7('0x47')]['filter']+'%'};return _0x334b60;}})});}_0x3a7bf4=_[_0xe5a7('0x53')]({},_0x3a7bf4,_0x468096[_0xe5a7('0x54')]);var _0x41bb96={'where':_0x3a7bf4['where']};return db['WhatsappAccount'][_0xe5a7('0x2f')](_0x41bb96)[_0xe5a7('0x1f')](function(_0x3ae2c9){_0x39e570[_0xe5a7('0x2f')]=_0x3ae2c9;if(_0x468096[_0xe5a7('0x47')][_0xe5a7('0x55')]){_0x3a7bf4[_0xe5a7('0x56')]=[{'all':!![]}];}return db[_0xe5a7('0x3e')][_0xe5a7('0x57')](_0x3a7bf4);})[_0xe5a7('0x1f')](function(_0x54a78b){_0x39e570[_0xe5a7('0x58')]=_0x54a78b;return _0x39e570;})[_0xe5a7('0x1f')](respondWithFilteredResult(_0x208181,_0x3a7bf4))[_0xe5a7('0x28')](handleError(_0x208181,null));};exports['show']=function(_0x4d3bcc,_0x2e4b75){var _0x1c3be9={'raw':![],'where':{'id':_0x4d3bcc[_0xe5a7('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xe5a7('0x3d')}]},_0x23f8f8={};_0x23f8f8[_0xe5a7('0x46')]=_[_0xe5a7('0x44')](db[_0xe5a7('0x3e')][_0xe5a7('0x5a')]);_0x23f8f8[_0xe5a7('0x47')]=_[_0xe5a7('0x44')](_0x4d3bcc[_0xe5a7('0x47')]);_0x23f8f8[_0xe5a7('0x45')]=_[_0xe5a7('0x5b')](_0x23f8f8[_0xe5a7('0x46')],_0x23f8f8[_0xe5a7('0x47')]);_0x1c3be9[_0xe5a7('0x48')]=_[_0xe5a7('0x5b')](_0x23f8f8[_0xe5a7('0x46')],qs['fields'](_0x4d3bcc[_0xe5a7('0x47')][_0xe5a7('0x49')]));_0x1c3be9['attributes']=_0x1c3be9[_0xe5a7('0x48')][_0xe5a7('0x4a')]?_0x1c3be9[_0xe5a7('0x48')]:_0x23f8f8[_0xe5a7('0x46')];if(_0x4d3bcc[_0xe5a7('0x47')][_0xe5a7('0x55')]){_0x1c3be9['include']=[{'all':!![]}];}_0x1c3be9=_[_0xe5a7('0x53')]({},_0x1c3be9,_0x4d3bcc[_0xe5a7('0x54')]);return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')](_0x1c3be9)[_0xe5a7('0x1f')](handleEntityNotFound(_0x2e4b75,null))[_0xe5a7('0x1f')](respondWithResult(_0x2e4b75,null))[_0xe5a7('0x28')](handleError(_0x2e4b75,null));};exports['create']=function(_0x2d9de2,_0x331de9){return db[_0xe5a7('0x3e')][_0xe5a7('0x5d')](_0x2d9de2[_0xe5a7('0x5e')],{})[_0xe5a7('0x1f')](function(_0x1e8c9d){var _0x2e6dc2=_0x2d9de2['user'][_0xe5a7('0x37')]({'plain':!![]});if(!_0x2e6dc2)throw new Error(_0xe5a7('0x5f'));if(_0x2e6dc2[_0xe5a7('0x60')]==='user'){var _0xc9a263=_0x1e8c9d[_0xe5a7('0x37')]({'plain':!![]});var _0x145535='WhatsappAccounts';return db[_0xe5a7('0x61')]['find']({'where':{'name':_0x145535,'userProfileId':_0x2e6dc2[_0xe5a7('0x62')]},'raw':!![]})[_0xe5a7('0x1f')](function(_0x2b0e40){if(_0x2b0e40&&_0x2b0e40[_0xe5a7('0x63')]===0x0){return db[_0xe5a7('0x38')][_0xe5a7('0x5d')]({'name':_0xc9a263[_0xe5a7('0x43')],'resourceId':_0xc9a263['id'],'type':_0x2b0e40['name'],'sectionId':_0x2b0e40['id']},{})['then'](function(){return _0x1e8c9d;});}else{return _0x1e8c9d;}})[_0xe5a7('0x28')](function(_0x51a135){logger[_0xe5a7('0x25')](_0xe5a7('0x64'),_0x51a135);throw _0x51a135;});}return _0x1e8c9d;})[_0xe5a7('0x1f')](respondWithResult(_0x331de9,0xc9))[_0xe5a7('0x28')](handleError(_0x331de9,null));};exports[_0xe5a7('0x35')]=function(_0x42e7f9,_0x4d2fbc){if(_0x42e7f9[_0xe5a7('0x5e')]['id']){delete _0x42e7f9['body']['id'];}return db['WhatsappAccount'][_0xe5a7('0x5c')]({'where':{'id':_0x42e7f9[_0xe5a7('0x59')]['id']},'include':[{'model':db[_0xe5a7('0x3c')],'as':_0xe5a7('0x3d')}]})[_0xe5a7('0x1f')](handleEntityNotFound(_0x4d2fbc,null))[_0xe5a7('0x1f')](saveUpdates(_0x42e7f9[_0xe5a7('0x5e')],null))[_0xe5a7('0x1f')](respondWithResult(_0x4d2fbc,null))['catch'](handleError(_0x4d2fbc,null));};exports['destroy']=function(_0x222658,_0x3862e9){return db[_0xe5a7('0x3e')]['find']({'where':{'id':_0x222658[_0xe5a7('0x59')]['id']}})[_0xe5a7('0x1f')](handleEntityNotFound(_0x3862e9,null))[_0xe5a7('0x1f')](removeEntity(_0x3862e9,null))[_0xe5a7('0x28')](handleError(_0x3862e9,null));};exports[_0xe5a7('0x65')]=function(_0x56d9e5,_0x2eb4b0){return db[_0xe5a7('0x3e')][_0xe5a7('0x65')]()[_0xe5a7('0x1f')](respondWithResult(_0x2eb4b0,null))[_0xe5a7('0x28')](handleError(_0x2eb4b0,null));};exports[_0xe5a7('0x66')]=function(_0x2301de,_0x1f9d8b,_0x346b07){if(_0x2301de['body']['id']){delete _0x2301de[_0xe5a7('0x5e')]['id'];}return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')]({'where':{'id':_0x2301de[_0xe5a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f9d8b,null))[_0xe5a7('0x1f')](function(_0x5aaa7b){if(_0x5aaa7b){_0x2301de[_0xe5a7('0x5e')][_0xe5a7('0x67')]=_0x5aaa7b['id'];return db[_0xe5a7('0x68')][_0xe5a7('0x5d')](_0x2301de[_0xe5a7('0x5e')]);}})[_0xe5a7('0x1f')](respondWithResult(_0x1f9d8b,null))['catch'](handleError(_0x1f9d8b,null));};exports[_0xe5a7('0x69')]=function(_0x2f0ce8,_0x43ea3f,_0x55fe92){var _0xf8701e={'raw':![],'where':{}};var _0x31b135={};var _0x3dbcfe={'count':0x0,'rows':[]};return db[_0xe5a7('0x3e')][_0xe5a7('0x6a')]({'where':{'id':_0x2f0ce8[_0xe5a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x43ea3f,null))[_0xe5a7('0x1f')](function(_0x1762bf){if(_0x1762bf){_0x31b135['model']=_[_0xe5a7('0x44')](db[_0xe5a7('0x68')][_0xe5a7('0x5a')]);_0x31b135['query']=_[_0xe5a7('0x44')](_0x2f0ce8[_0xe5a7('0x47')]);_0x31b135[_0xe5a7('0x45')]=_[_0xe5a7('0x5b')](_0x31b135[_0xe5a7('0x46')],_0x31b135[_0xe5a7('0x47')]);_0xf8701e[_0xe5a7('0x48')]=_[_0xe5a7('0x5b')](_0x31b135[_0xe5a7('0x46')],qs[_0xe5a7('0x49')](_0x2f0ce8[_0xe5a7('0x47')]['fields']));_0xf8701e[_0xe5a7('0x48')]=_0xf8701e[_0xe5a7('0x48')][_0xe5a7('0x4a')]?_0xf8701e[_0xe5a7('0x48')]:_0x31b135['model'];if(!_0x2f0ce8[_0xe5a7('0x47')][_0xe5a7('0x4b')]('nolimit')){_0xf8701e[_0xe5a7('0x2e')]=qs['limit'](_0x2f0ce8[_0xe5a7('0x47')][_0xe5a7('0x2e')]);_0xf8701e[_0xe5a7('0x30')]=qs[_0xe5a7('0x30')](_0x2f0ce8[_0xe5a7('0x47')][_0xe5a7('0x30')]);}_0xf8701e[_0xe5a7('0x4d')]=qs[_0xe5a7('0x4e')](_0x2f0ce8[_0xe5a7('0x47')]['sort']);_0xf8701e[_0xe5a7('0x4f')]=qs[_0xe5a7('0x45')](_[_0xe5a7('0x50')](_0x2f0ce8['query'],_0x31b135[_0xe5a7('0x45')]));_0xf8701e[_0xe5a7('0x4f')][_0xe5a7('0x67')]=_0x1762bf['id'];if(_0x2f0ce8[_0xe5a7('0x47')][_0xe5a7('0x51')]){_0xf8701e['where']=_[_0xe5a7('0x53')](_0xf8701e[_0xe5a7('0x4f')],{'$or':_[_0xe5a7('0x42')](_0xf8701e['attributes'],function(_0x11f0f6){var _0x3f8444={};_0x3f8444[_0x11f0f6]={'$like':'%'+_0x2f0ce8['query'][_0xe5a7('0x51')]+'%'};return _0x3f8444;})});}_0xf8701e=_[_0xe5a7('0x53')]({},_0xf8701e,_0x2f0ce8[_0xe5a7('0x54')]);return db[_0xe5a7('0x68')][_0xe5a7('0x2f')]({'where':_0xf8701e[_0xe5a7('0x4f')]})[_0xe5a7('0x1f')](function(_0x3c3c48){_0x3dbcfe[_0xe5a7('0x2f')]=_0x3c3c48;if(_0x2f0ce8[_0xe5a7('0x47')][_0xe5a7('0x55')]){_0xf8701e['include']=[{'all':!![]}];}return db['Disposition'][_0xe5a7('0x57')](_0xf8701e);})[_0xe5a7('0x1f')](function(_0xac042a){_0x3dbcfe[_0xe5a7('0x58')]=_0xac042a;return _0x3dbcfe;});}})[_0xe5a7('0x1f')](respondWithFilteredResult(_0x43ea3f,_0xf8701e))['catch'](handleError(_0x43ea3f,null));};exports[_0xe5a7('0x6b')]=function(_0x3f92be,_0x4fb5b3,_0x13f3c2){return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')]({'where':{'id':_0x3f92be['params']['id']}})[_0xe5a7('0x1f')](handleEntityNotFound(_0x4fb5b3,null))[_0xe5a7('0x1f')](function(_0x5d4c0b){if(_0x5d4c0b){return _0x5d4c0b[_0xe5a7('0x6b')](_0x3f92be[_0xe5a7('0x47')][_0xe5a7('0x6c')]);}})['then'](respondWithStatusCode(_0x4fb5b3,null))[_0xe5a7('0x28')](handleError(_0x4fb5b3,null));};exports[_0xe5a7('0x6d')]=function(_0x2996b1,_0x23ecfa,_0x97b9b3){if(_0x2996b1[_0xe5a7('0x5e')]['id']){delete _0x2996b1[_0xe5a7('0x5e')]['id'];}return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')]({'where':{'id':_0x2996b1['params']['id']}})['then'](handleEntityNotFound(_0x23ecfa,null))[_0xe5a7('0x1f')](function(_0x1a19fb){if(_0x1a19fb){_0x2996b1[_0xe5a7('0x5e')][_0xe5a7('0x67')]=_0x1a19fb['id'];return db['CannedAnswer'][_0xe5a7('0x5d')](_0x2996b1[_0xe5a7('0x5e')]);}})[_0xe5a7('0x1f')](respondWithResult(_0x23ecfa,null))[_0xe5a7('0x28')](handleError(_0x23ecfa,null));};exports['getAnswers']=function(_0x2f32f9,_0x380511,_0x4a4510){var _0x214139={'raw':![],'where':{}};var _0x10679a={};var _0x3cfca7={'count':0x0,'rows':[]};return db[_0xe5a7('0x3e')][_0xe5a7('0x6a')]({'where':{'id':_0x2f32f9['params']['id']}})[_0xe5a7('0x1f')](handleEntityNotFound(_0x380511,null))['then'](function(_0x563995){if(_0x563995){_0x10679a[_0xe5a7('0x46')]=_['keys'](db[_0xe5a7('0x6e')][_0xe5a7('0x5a')]);_0x10679a[_0xe5a7('0x47')]=_[_0xe5a7('0x44')](_0x2f32f9[_0xe5a7('0x47')]);_0x10679a['filters']=_['intersection'](_0x10679a['model'],_0x10679a[_0xe5a7('0x47')]);_0x214139[_0xe5a7('0x48')]=_[_0xe5a7('0x5b')](_0x10679a[_0xe5a7('0x46')],qs[_0xe5a7('0x49')](_0x2f32f9[_0xe5a7('0x47')][_0xe5a7('0x49')]));_0x214139[_0xe5a7('0x48')]=_0x214139[_0xe5a7('0x48')][_0xe5a7('0x4a')]?_0x214139[_0xe5a7('0x48')]:_0x10679a[_0xe5a7('0x46')];if(!_0x2f32f9[_0xe5a7('0x47')][_0xe5a7('0x4b')]('nolimit')){_0x214139['limit']=qs[_0xe5a7('0x2e')](_0x2f32f9['query'][_0xe5a7('0x2e')]);_0x214139[_0xe5a7('0x30')]=qs[_0xe5a7('0x30')](_0x2f32f9['query'][_0xe5a7('0x30')]);}_0x214139[_0xe5a7('0x4d')]=qs[_0xe5a7('0x4e')](_0x2f32f9['query']['sort']);_0x214139[_0xe5a7('0x4f')]=qs[_0xe5a7('0x45')](_['pick'](_0x2f32f9['query'],_0x10679a[_0xe5a7('0x45')]));_0x214139['where'][_0xe5a7('0x67')]=_0x563995['id'];if(_0x2f32f9[_0xe5a7('0x47')]['filter']){_0x214139[_0xe5a7('0x4f')]=_[_0xe5a7('0x53')](_0x214139[_0xe5a7('0x4f')],{'$or':_['map'](_0x214139[_0xe5a7('0x48')],function(_0xc38d87){var _0x132f01={};_0x132f01[_0xc38d87]={'$like':'%'+_0x2f32f9[_0xe5a7('0x47')][_0xe5a7('0x51')]+'%'};return _0x132f01;})});}_0x214139=_[_0xe5a7('0x53')]({},_0x214139,_0x2f32f9[_0xe5a7('0x54')]);return db['CannedAnswer']['count']({'where':_0x214139[_0xe5a7('0x4f')]})[_0xe5a7('0x1f')](function(_0x13d4f2){_0x3cfca7[_0xe5a7('0x2f')]=_0x13d4f2;if(_0x2f32f9[_0xe5a7('0x47')]['includeAll']){_0x214139[_0xe5a7('0x56')]=[{'all':!![]}];}return db[_0xe5a7('0x6e')][_0xe5a7('0x57')](_0x214139);})[_0xe5a7('0x1f')](function(_0x161a21){_0x3cfca7['rows']=_0x161a21;return _0x3cfca7;});}})[_0xe5a7('0x1f')](respondWithFilteredResult(_0x380511,_0x214139))[_0xe5a7('0x28')](handleError(_0x380511,null));};exports[_0xe5a7('0x6f')]=function(_0x14f739,_0x934c96,_0x44ebb0){return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')]({'where':{'id':_0x14f739[_0xe5a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x934c96,null))[_0xe5a7('0x1f')](function(_0x2c8452){if(_0x2c8452){return _0x2c8452[_0xe5a7('0x6f')](_0x14f739[_0xe5a7('0x47')][_0xe5a7('0x6c')]);}})[_0xe5a7('0x1f')](respondWithStatusCode(_0x934c96,null))[_0xe5a7('0x28')](handleError(_0x934c96,null));};exports[_0xe5a7('0x70')]=function(_0x3fd4dd,_0x2aec79,_0x3ba574){return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')]({'where':{'id':_0x3fd4dd[_0xe5a7('0x59')]['id']}})[_0xe5a7('0x1f')](handleEntityNotFound(_0x2aec79,null))['then'](function(_0x1f5a49){if(_0x1f5a49){return _0x1f5a49['addAgents'](_0x3fd4dd[_0xe5a7('0x5e')]['ids'],_[_0xe5a7('0x71')](_0x3fd4dd[_0xe5a7('0x5e')],[_0xe5a7('0x6c'),'id'])||{})['spread'](function(_0x339de5){for(var _0x29232b=0x0;_0x29232b<_0x3fd4dd['body'][_0xe5a7('0x6c')][_0xe5a7('0x4a')];_0x29232b+=0x1){socket[_0xe5a7('0x72')](_0xe5a7('0x73'),{'UserId':Number(_0x3fd4dd[_0xe5a7('0x5e')][_0xe5a7('0x6c')][_0x29232b]),'WhatsappAccountId':Number(_0x3fd4dd[_0xe5a7('0x59')]['id'])});}return _0x339de5;});}})[_0xe5a7('0x1f')](respondWithResult(_0x2aec79,null))[_0xe5a7('0x28')](handleError(_0x2aec79,null));};exports['removeAgents']=function(_0x299dd2,_0xdd67e9,_0x3b0202){return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')]({'where':{'id':_0x299dd2[_0xe5a7('0x59')]['id']}})[_0xe5a7('0x1f')](handleEntityNotFound(_0xdd67e9,null))[_0xe5a7('0x1f')](function(_0x16b25d){if(_0x16b25d){return _0x16b25d['removeAgents'](_0x299dd2[_0xe5a7('0x47')][_0xe5a7('0x6c')])['then'](function(){if(_['isArray'](_0x299dd2['query']['ids'])){for(var _0x10bb8a=0x0;_0x10bb8a<_0x299dd2[_0xe5a7('0x47')][_0xe5a7('0x6c')][_0xe5a7('0x4a')];_0x10bb8a+=0x1){socket[_0xe5a7('0x72')](_0xe5a7('0x74'),{'UserId':Number(_0x299dd2[_0xe5a7('0x47')][_0xe5a7('0x6c')][_0x10bb8a]),'WhatsappAccountId':Number(_0x299dd2[_0xe5a7('0x59')]['id'])});}}else{socket[_0xe5a7('0x72')](_0xe5a7('0x74'),{'UserId':Number(_0x299dd2[_0xe5a7('0x47')][_0xe5a7('0x6c')]),'WhatsappAccountId':Number(_0x299dd2[_0xe5a7('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0xdd67e9,null))[_0xe5a7('0x28')](handleError(_0xdd67e9,null));};exports[_0xe5a7('0x75')]=function(_0x46a3bb,_0x8684bd,_0xb988fe){var _0x232ab0={};var _0x380a5a={};var _0xc22abb;var _0x11eb1c;return db[_0xe5a7('0x3e')][_0xe5a7('0x6a')]({'where':{'id':_0x46a3bb[_0xe5a7('0x59')]['id']}})['then'](handleEntityNotFound(_0x8684bd,null))[_0xe5a7('0x1f')](function(_0x4e8a15){if(_0x4e8a15){_0xc22abb=_0x4e8a15;_0x380a5a[_0xe5a7('0x46')]=_[_0xe5a7('0x44')](db[_0xe5a7('0x76')][_0xe5a7('0x5a')]);_0x380a5a['query']=_['keys'](_0x46a3bb['query']);_0x380a5a[_0xe5a7('0x45')]=_[_0xe5a7('0x5b')](_0x380a5a[_0xe5a7('0x46')],_0x380a5a[_0xe5a7('0x47')]);_0x232ab0['attributes']=_[_0xe5a7('0x5b')](_0x380a5a[_0xe5a7('0x46')],qs[_0xe5a7('0x49')](_0x46a3bb[_0xe5a7('0x47')][_0xe5a7('0x49')]));_0x232ab0[_0xe5a7('0x48')]=_0x232ab0[_0xe5a7('0x48')][_0xe5a7('0x4a')]?_0x232ab0['attributes']:_0x380a5a[_0xe5a7('0x46')];_0x232ab0['order']=qs[_0xe5a7('0x4e')](_0x46a3bb[_0xe5a7('0x47')][_0xe5a7('0x4e')]);_0x232ab0['where']=qs['filters'](_['pick'](_0x46a3bb[_0xe5a7('0x47')],_0x380a5a['filters']));if(_0x46a3bb[_0xe5a7('0x47')][_0xe5a7('0x51')]){_0x232ab0[_0xe5a7('0x4f')]=_[_0xe5a7('0x53')](_0x232ab0['where'],{'$or':_['map'](_0x232ab0['attributes'],function(_0x2681c4){var _0x150a3a={};_0x150a3a[_0x2681c4]={'$like':'%'+_0x46a3bb[_0xe5a7('0x47')][_0xe5a7('0x51')]+'%'};return _0x150a3a;})});}_0x232ab0=_['merge']({},_0x232ab0,_0x46a3bb['options']);return _0xc22abb[_0xe5a7('0x75')](_0x232ab0);}})['then'](function(_0x51aaee){if(_0x51aaee){_0x11eb1c=_0x51aaee[_0xe5a7('0x4a')];if(!_0x46a3bb['query'][_0xe5a7('0x4b')]('nolimit')){_0x232ab0['limit']=qs['limit'](_0x46a3bb['query'][_0xe5a7('0x2e')]);_0x232ab0[_0xe5a7('0x30')]=qs[_0xe5a7('0x30')](_0x46a3bb[_0xe5a7('0x47')][_0xe5a7('0x30')]);}return _0xc22abb[_0xe5a7('0x75')](_0x232ab0);}})[_0xe5a7('0x1f')](function(_0x273eac){if(_0x273eac){return _0x273eac?{'count':_0x11eb1c,'rows':_0x273eac}:null;}})[_0xe5a7('0x1f')](respondWithResult(_0x8684bd,null))[_0xe5a7('0x28')](handleError(_0x8684bd,null));};exports[_0xe5a7('0x77')]=function(_0x81d2f,_0x5f2b77){var _0x3a0701=_0x81d2f[_0xe5a7('0x59')]['id'];var _0x48381a=_0x81d2f[_0xe5a7('0x5e')];var _0x40749c=0xc8;var _0x56dc69=null;return db[_0xe5a7('0x78')][_0xe5a7('0x79')]({'isolationLevel':db['sequelize'][_0xe5a7('0x7a')]['ISOLATION_LEVELS'][_0xe5a7('0x7b')]},function(_0x3751c7){return db[_0xe5a7('0x3e')][_0xe5a7('0x6a')]({'where':{'id':_0x3a0701},'transaction':_0x3751c7})[_0xe5a7('0x1f')](function(_0x32d4a6){if(_0x32d4a6){return db[_0xe5a7('0x7c')][_0xe5a7('0x36')]({'where':{'WhatsappAccountId':_0x3a0701},'transaction':_0x3751c7})[_0xe5a7('0x1f')](function(){var _0x19aad8=_[_0xe5a7('0x42')](_0x48381a,function(_0x16f400){_0x16f400[_0xe5a7('0x67')]=_0x3a0701;return _0x16f400;});return db[_0xe5a7('0x7c')][_0xe5a7('0x7d')](_0x19aad8,{'transaction':_0x3751c7});});}else{_0x40749c=0x194;_0x56dc69=[];}});})['then'](function(){if(_0x40749c!==0x194){return db['WhatsappApplication'][_0xe5a7('0x7e')]({'where':{'WhatsappAccountId':_0x3a0701},'order':_0xe5a7('0x7f')})['then'](function(_0x57aee5){_0x56dc69=_0x57aee5;});}})['catch'](function(_0x4337ea){_0x40749c=0x1f4;logger[_0xe5a7('0x25')](_0x4337ea['stack']);if(_0x4337ea[_0xe5a7('0x43')]){delete _0x4337ea[_0xe5a7('0x43')];}_0x56dc69=_0x4337ea;})[_0xe5a7('0x80')](function(){if(_0x56dc69===null){_0x5f2b77['sendStatus'](_0x40749c);}else{if(_0x40749c===0x1f4){_0x5f2b77[_0xe5a7('0x2a')](_0x40749c)[_0xe5a7('0x3a')](_0x56dc69);}else{_0x5f2b77[_0xe5a7('0x2a')](_0x40749c)['json'](_0x56dc69);}}});};exports[_0xe5a7('0x81')]=function(_0x332488,_0x2fa20c,_0x23458f){var _0x30175e={};var _0x2c5931={};var _0x2c5405;var _0x21104a;return db[_0xe5a7('0x3e')][_0xe5a7('0x6a')]({'where':{'id':_0x332488[_0xe5a7('0x59')]['id']}})[_0xe5a7('0x1f')](handleEntityNotFound(_0x2fa20c,null))[_0xe5a7('0x1f')](function(_0x5c9178){if(_0x5c9178){_0x2c5405=_0x5c9178;_0x2c5931[_0xe5a7('0x46')]=_['keys'](db[_0xe5a7('0x7c')][_0xe5a7('0x5a')]);_0x2c5931['query']=_[_0xe5a7('0x44')](_0x332488['query']);_0x2c5931['filters']=_[_0xe5a7('0x5b')](_0x2c5931[_0xe5a7('0x46')],_0x2c5931['query']);_0x30175e[_0xe5a7('0x48')]=_[_0xe5a7('0x5b')](_0x2c5931[_0xe5a7('0x46')],qs[_0xe5a7('0x49')](_0x332488[_0xe5a7('0x47')]['fields']));_0x30175e[_0xe5a7('0x48')]=_0x30175e[_0xe5a7('0x48')][_0xe5a7('0x4a')]?_0x30175e['attributes']:_0x2c5931[_0xe5a7('0x46')];_0x30175e['order']=qs[_0xe5a7('0x4e')](_0x332488[_0xe5a7('0x47')][_0xe5a7('0x4e')]);_0x30175e[_0xe5a7('0x4f')]=qs[_0xe5a7('0x45')](_['pick'](_0x332488[_0xe5a7('0x47')],_0x2c5931[_0xe5a7('0x45')]));if(_0x332488[_0xe5a7('0x47')][_0xe5a7('0x51')]){_0x30175e[_0xe5a7('0x4f')]=_[_0xe5a7('0x53')](_0x30175e[_0xe5a7('0x4f')],{'$or':_[_0xe5a7('0x42')](_0x30175e[_0xe5a7('0x48')],function(_0x1ca64f){var _0x2f540f={};_0x2f540f[_0x1ca64f]={'$like':'%'+_0x332488[_0xe5a7('0x47')][_0xe5a7('0x51')]+'%'};return _0x2f540f;})});}_0x30175e=_[_0xe5a7('0x53')]({},_0x30175e,_0x332488[_0xe5a7('0x54')]);return _0x2c5405[_0xe5a7('0x81')](_0x30175e);}})[_0xe5a7('0x1f')](function(_0xf8d07e){if(_0xf8d07e){_0x21104a=_0xf8d07e[_0xe5a7('0x4a')];if(!_0x332488[_0xe5a7('0x47')][_0xe5a7('0x4b')]('nolimit')){_0x30175e['limit']=qs[_0xe5a7('0x2e')](_0x332488[_0xe5a7('0x47')]['limit']);_0x30175e[_0xe5a7('0x30')]=qs[_0xe5a7('0x30')](_0x332488[_0xe5a7('0x47')][_0xe5a7('0x30')]);}return _0x2c5405[_0xe5a7('0x81')](_0x30175e);}})['then'](function(_0xac7352){if(_0xac7352){return _0xac7352?{'count':_0x21104a,'rows':_0xac7352}:null;}})[_0xe5a7('0x1f')](respondWithResult(_0x2fa20c,null))[_0xe5a7('0x28')](handleError(_0x2fa20c,null));};exports[_0xe5a7('0x82')]=function(_0x1d6761,_0x433bbc,_0x4baf25){var _0x449e40={'channel':_0xe5a7('0x83')};var _0x1b3af4=[];var _0x4ce4ed=[];var _0x82d52e={};return db[_0xe5a7('0x3e')][_0xe5a7('0x5c')]({'where':{'id':_0x1d6761[_0xe5a7('0x59')]['id']},'include':[{'model':db[_0xe5a7('0x7c')],'as':_0xe5a7('0x84')}]})[_0xe5a7('0x1f')](handleEntityNotFound(_0x433bbc,null))[_0xe5a7('0x1f')](function(_0x2d846e){_0x449e40['account']=_0x2d846e;if(_0x449e40[_0xe5a7('0x85')]&&_0x449e40[_0xe5a7('0x85')]['type']==='sinch'&&_0x1d6761['body'][_0xe5a7('0x86')]){if(_0x1d6761['body']['statuses'][_0xe5a7('0x4a')]===0x0)return;if(_0x1d6761[_0xe5a7('0x5e')][_0xe5a7('0x86')][0x0][_0xe5a7('0x87')]!=='read')return;return db[_0xe5a7('0x88')][_0xe5a7('0x35')]({'read':!![],'readAt':_0x1d6761[_0xe5a7('0x5e')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x1d6761[_0xe5a7('0x5e')][_0xe5a7('0x86')][0x0][_0xe5a7('0x89')]},'individualHooks':!![]})[_0xe5a7('0x1f')](function(_0x5609c3){return _0x433bbc['status'](0xc8)['json'](_0x5609c3);});}_0x449e40[_0xe5a7('0x8a')]=_[_0xe5a7('0x8b')](_0x2d846e[_0xe5a7('0x84')],[_0xe5a7('0x7f')],[_0xe5a7('0x8c')]);if(_0x449e40['account']['Applications']){delete _0x449e40[_0xe5a7('0x85')]['Applications'];}return db[_0xe5a7('0x8d')][_0xe5a7('0x65')]()[_0xe5a7('0x1f')](function(_0x37d6b8){if(!_0x37d6b8){throw new db[(_0xe5a7('0x8e'))][(_0xe5a7('0x8f'))]('no\x20available\x20attributes');}_0x1b3af4=_[_0xe5a7('0x90')](_[_0xe5a7('0x44')](_0x37d6b8),[_0xe5a7('0x91'),'updatedAt']);_0x4ce4ed=_[_0xe5a7('0x90')](_[_0xe5a7('0x44')](_0x37d6b8),[_0xe5a7('0x91'),_0xe5a7('0x92'),'CompanyId',_0xe5a7('0x93')]);_0x449e40[_0xe5a7('0x5e')]={'mapKey':_0xe5a7('0x94')};if(_0x449e40['account']&&_0x449e40[_0xe5a7('0x85')][_0xe5a7('0x40')]===_0xe5a7('0x95')){_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x96')]=_0x1d6761[_0xe5a7('0x5e')]['From'][_0xe5a7('0x97')](_0xe5a7('0x98'),'');_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x5e')]=_0x1d6761[_0xe5a7('0x5e')][_0xe5a7('0x99')];_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x9a')]=_0x1d6761[_0xe5a7('0x5e')][_0xe5a7('0x9b')];}if(_0x449e40[_0xe5a7('0x85')]&&_0x449e40[_0xe5a7('0x85')][_0xe5a7('0x40')]===_0xe5a7('0x9c')){_0x449e40[_0xe5a7('0x5e')]['from']=_0x1d6761['body'][_0xe5a7('0x9d')][0x0][_0xe5a7('0x96')];_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x5e')]=_0x1d6761[_0xe5a7('0x5e')][_0xe5a7('0x9d')][0x0][_0xe5a7('0x26')]['body'];_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x9a')]=_0x1d6761[_0xe5a7('0x5e')][_0xe5a7('0x9d')][0x0][_0xe5a7('0x89')];}if(_0x449e40[_0xe5a7('0x5e')]['id']){delete _0x449e40[_0xe5a7('0x5e')]['id'];}if(_['isNil'](_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x96')])){throw new db[(_0xe5a7('0x8e'))][(_0xe5a7('0x8f'))](_0xe5a7('0x9e'));}if(_['isNil'](_0x449e40[_0xe5a7('0x5e')]['body'])||_0x449e40['body'][_0xe5a7('0x5e')]===''){throw new db[(_0xe5a7('0x8e'))]['ValidationError'](_0xe5a7('0x9f'));}if(_[_0xe5a7('0xa0')](_0x449e40[_0xe5a7('0x5e')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ce4ed);}if(!_[_0xe5a7('0xa1')](_0x4ce4ed,_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0xa2')])){throw new db[(_0xe5a7('0x8e'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ce4ed);}_0x82d52e[_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0xa2')]]=_0x449e40['body'][_0xe5a7('0x96')];return db['CmList'][_0xe5a7('0x5c')]({'where':{'id':_0x449e40[_0xe5a7('0x85')][_0xe5a7('0x93')]},'include':[{'model':db[_0xe5a7('0x8d')],'as':_0xe5a7('0xa3'),'where':_0x82d52e,'limit':0x1,'order':[[_0xe5a7('0x92'),_0xe5a7('0xa4')]]}]});})[_0xe5a7('0x1f')](handleEntityNotFound(_0x433bbc,null))[_0xe5a7('0x1f')](function(_0x34b1a9){if(_0x34b1a9){_0x449e40[_0xe5a7('0xa5')]=_['omit'](_0x34b1a9,[_0xe5a7('0xa3')]);if(_0x34b1a9['Contacts'][_0xe5a7('0x4a')]){return _0x34b1a9['Contacts'][0x0];}var _0x48898f=_[_0xe5a7('0x19')](_0x449e40['body'],{'firstName':_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x96')],'ListId':_0x34b1a9['id']});_0x48898f[_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0xa2')]]=_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x96')];return db[_0xe5a7('0x8d')][_0xe5a7('0x5d')](_0x48898f,{'fields':_0x1b3af4,'raw':!![]});}})['then'](handleEntityNotFound(_0x433bbc,null))[_0xe5a7('0x1f')](function(_0xe4f094){if(_0xe4f094){_0x449e40[_0xe5a7('0xa6')]=_0xe4f094;var _0x4dc711={'ContactId':_0xe4f094['id'],'phone':_0x449e40[_0xe5a7('0x5e')][_0xe5a7('0x96')],'WhatsappAccountId':_0x1d6761[_0xe5a7('0x59')]['id']};var _0x42ecad={'ContactId':_0xe4f094['id'],'WhatsappAccountId':_0x1d6761[_0xe5a7('0x59')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x42ecad})[_0xe5a7('0x1f')](function(_0x3107a4){if(_0x3107a4){return[_0x3107a4,![]];}return db[_0xe5a7('0xa7')][_0xe5a7('0x5d')](_0x4dc711)[_0xe5a7('0x1f')](function(_0x583b94){return[_0x583b94,!![]];});});}})[_0xe5a7('0xa8')](function(_0x29ac3b,_0x43853f){_0x449e40[_0xe5a7('0xa9')]=_0x29ac3b['get']({'plain':!![]});_0x449e40[_0xe5a7('0xa9')]['created']=![];if(_0x43853f){if(_0x449e40[_0xe5a7('0x85')]['autoclose']){_0x449e40[_0xe5a7('0x8a')][_0xe5a7('0xaa')]({'id':0x0,'priority':_0x449e40[_0xe5a7('0x8a')][_0xe5a7('0x4a')]+0x1,'app':'close','appdata':_0xe5a7('0xab'),'interval':'*,*,*,*'});}_0x449e40[_0xe5a7('0xa9')][_0xe5a7('0xac')]=!![];}return db[_0xe5a7('0x88')][_0xe5a7('0x5d')]({'phone':_0x449e40['body']['from'],'messageId':_0x449e40['body']['messageId'],'body':_0x449e40['body'][_0xe5a7('0x5e')],'WhatsappAccountId':_0x1d6761[_0xe5a7('0x59')]['id'],'WhatsappInteractionId':_0x29ac3b['id'],'direction':'in','ContactId':_0x29ac3b[_0xe5a7('0xad')],'AttachmentId':_0x449e40['body'][_0xe5a7('0xae')]});})[_0xe5a7('0x1f')](function(_0x5e036b){_0x449e40[_0xe5a7('0x26')]=_0x5e036b;if(_0x449e40[_0xe5a7('0xa9')][_0xe5a7('0xaf')]){return db[_0xe5a7('0x76')][_0xe5a7('0x5c')]({'attributes':['id','name'],'where':{'id':_0x449e40[_0xe5a7('0xa9')][_0xe5a7('0xaf')]}})[_0xe5a7('0x1f')](function(_0x1c21ae){if(_0x1c21ae){_0x449e40[_0xe5a7('0x8a')][_0xe5a7('0xb0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1c21ae[_0xe5a7('0x43')]+','+(_0x449e40[_0xe5a7('0x85')][_0xe5a7('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe5a7('0xb2'),'startRouting',_0x449e40);});}return respondWithRpcPromise(_0xe5a7('0xb2'),_0xe5a7('0xb3'),_0x449e40);})[_0xe5a7('0x1f')](function(_0x3b98e4){if(_0x3b98e4){var _0xe69f1c=0xc8;var _0x3a41bd='receiveMessage';logger[_0xe5a7('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3a41bd,_0xe69f1c,_0xe5a7('0xb4'));logger[_0xe5a7('0x22')](_0xe5a7('0xb5'),_0x3a41bd,_0xe69f1c,_0xe5a7('0xb4'),JSON[_0xe5a7('0x24')](_0x3b98e4));if(_0x449e40[_0xe5a7('0x85')][_0xe5a7('0x40')]==='twilio'){return _0x433bbc[_0xe5a7('0x2a')](_0xe69f1c)['set'](_0xe5a7('0xb6'),'text/xml')['send']('\x0a');}else{return _0x433bbc[_0xe5a7('0x2a')](_0xe69f1c)[_0xe5a7('0x2c')](_0x3b98e4);}}});})[_0xe5a7('0x28')](handleError(_0x433bbc,null));};exports[_0xe5a7('0x3a')]=function(_0x2d7ac,_0x1612bd,_0x393962){var _0x35fb60,_0x2b293d,_0x394a9f;if(_['isNil'](_0x2d7ac[_0xe5a7('0x5e')][_0xe5a7('0x5e')])||_0x2d7ac[_0xe5a7('0x5e')][_0xe5a7('0x5e')]===''){throw new db[(_0xe5a7('0x8e'))][(_0xe5a7('0x8f'))](_0xe5a7('0x9f'));}if(_[_0xe5a7('0xa0')](_0x2d7ac[_0xe5a7('0x5e')]['to'])){throw new db[(_0xe5a7('0x8e'))]['ValidationError'](_0xe5a7('0xb7'));}_0x35fb60=_0x2d7ac[_0xe5a7('0x5e')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x2d7ac[_0xe5a7('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xe5a7('0xb8'),'include':[{'model':db['CmContact'],'as':_0xe5a7('0xa3'),'where':{'mobile':_0x35fb60},'limit':0x1,'order':[[_0xe5a7('0x92'),_0xe5a7('0xa4')]]}]}]})[_0xe5a7('0x1f')](handleEntityNotFound(_0x1612bd,null))['then'](function(_0x3ced5d){if(_0x3ced5d&&_0x3ced5d[_0xe5a7('0xb8')]){_0x2b293d=_0x3ced5d[_0xe5a7('0x37')]({'plain':!![]});if(_0x2b293d[_0xe5a7('0xb8')]&&_0x2b293d[_0xe5a7('0xb8')][_0xe5a7('0xa3')][_0xe5a7('0x4a')]){return _0x2b293d[_0xe5a7('0xb8')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0xe5a7('0x19')](_0x2d7ac[_0xe5a7('0x5e')],{'firstName':_0x35fb60,'mobile':_0x35fb60,'phone':_0x35fb60,'ListId':_0x2b293d[_0xe5a7('0x93')]}));}})['then'](handleEntityNotFound(_0x1612bd,null))['then'](function(_0x278dbb){if(_0x278dbb){_0x394a9f=_0x278dbb;return db[_0xe5a7('0xa7')][_0xe5a7('0x5c')]({'where':{'ContactId':_0x394a9f['id'],'closed':![],'WhatsappAccountId':_0x2b293d['id']}})['then'](function(_0x3f8b4e){if(_0x3f8b4e){return[_0x3f8b4e,![]];}return db[_0xe5a7('0xa7')][_0xe5a7('0x5d')]({'UserId':_0x2d7ac[_0xe5a7('0xb9')]['id'],'ContactId':_0x394a9f['id'],'WhatsappAccountId':_0x2b293d['id'],'phone':_0x35fb60,'firstMsgDirection':'out','Messages':[_[_0xe5a7('0x53')](_0x2d7ac[_0xe5a7('0x5e')],{'read':![],'body':_0x2d7ac[_0xe5a7('0x5e')][_0xe5a7('0x5e')],'phone':_0x35fb60,'WhatsappAccountId':_0x2b293d['id'],'UserId':_0x2d7ac[_0xe5a7('0xb9')]['id'],'ContactId':_0x394a9f['id']})]},{'include':[{'model':db[_0xe5a7('0x88')],'as':_0xe5a7('0xba')}]})['then'](function(_0x5630b9){return[_0x5630b9,!![]];});});}})[_0xe5a7('0xa8')](function(_0x47b125,_0x697079){if(_0x697079){return _0x47b125;}return db[_0xe5a7('0x88')]['create'](_[_0xe5a7('0x53')](_0x2d7ac[_0xe5a7('0x5e')],{'read':![],'body':_0x2d7ac[_0xe5a7('0x5e')]['body'],'phone':_0x35fb60,'WhatsappAccountId':_0x2b293d['id'],'WhatsappInteractionId':_0x47b125['id'],'UserId':_0x2d7ac[_0xe5a7('0xb9')]['id'],'ContactId':_0x394a9f['id']}))[_0xe5a7('0x1f')](function(_0x4f282a){_0x47b125['dataValues'][_0xe5a7('0xba')]=[];_0x47b125['dataValues'][_0xe5a7('0xba')][_0xe5a7('0xaa')](_0x4f282a[_0xe5a7('0xbb')]);return _0x47b125;});})[_0xe5a7('0x1f')](respondWithResult(_0x1612bd,null))[_0xe5a7('0x28')](handleError(_0x1612bd,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 0efe56f..bafed70 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 _0x028e=['update','remove','emit','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x028e,0x114));var _0xe028=function(_0x3ad497,_0x1285d3){_0x3ad497=_0x3ad497-0x0;var _0x39a541=_0x028e[_0x3ad497];return _0x39a541;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xe028('0x0'))['db'][_0xe028('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe028('0x2')](0x0);var events={'afterCreate':_0xe028('0x3'),'afterUpdate':_0xe028('0x4'),'afterDestroy':_0xe028('0x5')};function emitEvent(_0x50861f){return function(_0x7b3bd8,_0x54d157,_0x5be69f){WhatsappAccountEvents['emit'](_0x50861f+':'+_0x7b3bd8['id'],_0x7b3bd8);WhatsappAccountEvents[_0xe028('0x6')](_0x50861f,_0x7b3bd8);_0x5be69f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xe028('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x147f=['hasOwnProperty','hook','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0x41fb84,_0x3770b8){var _0x231304=function(_0x40ce59){while(--_0x40ce59){_0x41fb84['push'](_0x41fb84['shift']());}};_0x231304(++_0x3770b8);}(_0x147f,0x146));var _0xf147=function(_0x3d5d44,_0x4f1c7d){_0x3d5d44=_0x3d5d44-0x0;var _0xfe6125=_0x147f[_0x3d5d44];return _0xfe6125;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf147('0x0'))['db'][_0xf147('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf147('0x2')](0x0);var events={'afterCreate':_0xf147('0x3'),'afterUpdate':_0xf147('0x4'),'afterDestroy':_0xf147('0x5')};function emitEvent(_0x30d91a){return function(_0x208806,_0x290f8c,_0x1ebf36){WhatsappAccountEvents[_0xf147('0x6')](_0x30d91a+':'+_0x208806['id'],_0x208806);WhatsappAccountEvents[_0xf147('0x6')](_0x30d91a,_0x208806);_0x1ebf36(null);};}for(var e in events){if(events[_0xf147('0x7')](e)){var event=events[e];WhatsappAccount[_0xf147('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 9ab04c9..53a48f2 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 _0x6a93=['define','WhatsappAccount','whatsapp_accounts','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x314e18,_0xa73ca1){var _0x56205d=function(_0x54fda9){while(--_0x54fda9){_0x314e18['push'](_0x314e18['shift']());}};_0x56205d(++_0xa73ca1);}(_0x6a93,0x18f));var _0x36a9=function(_0x186deb,_0x3936b4){_0x186deb=_0x186deb-0x0;var _0x210b5d=_0x6a93[_0x186deb];return _0x210b5d;};'use strict';var _=require('lodash');var util=require(_0x36a9('0x0'));var logger=require('../../config/logger')(_0x36a9('0x1'));var moment=require(_0x36a9('0x2'));var BPromise=require(_0x36a9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36a9('0x4'));var rimraf=require(_0x36a9('0x5'));var config=require(_0x36a9('0x6'));var attributes=require(_0x36a9('0x7'));module[_0x36a9('0x8')]=function(_0x574c9c,_0x44b7e7){return _0x574c9c[_0x36a9('0x9')](_0x36a9('0xa'),attributes,{'tableName':_0x36a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fb9=['api','moment','bluebird','request-promise','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','util'];(function(_0xadc861,_0x306a3d){var _0x2cd2ac=function(_0xb2741c){while(--_0xb2741c){_0xadc861['push'](_0xadc861['shift']());}};_0x2cd2ac(++_0x306a3d);}(_0x5fb9,0x13f));var _0x95fb=function(_0xc1e350,_0x59402){_0xc1e350=_0xc1e350-0x0;var _0x5556ed=_0x5fb9[_0xc1e350];return _0x5556ed;};'use strict';var _=require('lodash');var util=require(_0x95fb('0x0'));var logger=require('../../config/logger')(_0x95fb('0x1'));var moment=require(_0x95fb('0x2'));var BPromise=require(_0x95fb('0x3'));var rp=require(_0x95fb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x95fb('0x5'));var attributes=require('./whatsappAccount.attributes');module[_0x95fb('0x6')]=function(_0xabe379,_0x4a15c6){return _0xabe379[_0x95fb('0x7')](_0x95fb('0x8'),attributes,{'tableName':_0x95fb('0x9'),'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 6a5c3db..ce6c17b 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 _0xc974=['./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','message','WhatsappAccount,\x20%s,\x20%s','result','ShowWhatsappAccount','options','raw','where','attributes','map','include','model','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0xa3caeb,_0xc26197){var _0x442252=function(_0x5b38e3){while(--_0x5b38e3){_0xa3caeb['push'](_0xa3caeb['shift']());}};_0x442252(++_0xc26197);}(_0xc974,0x1dc));var _0x4c97=function(_0x25a02e,_0x4ec281){_0x25a02e=_0x25a02e-0x0;var _0x267250=_0xc974[_0x25a02e];return _0x267250;};'use strict';var _=require(_0x4c97('0x0'));var util=require(_0x4c97('0x1'));var moment=require('moment');var BPromise=require(_0x4c97('0x2'));var rs=require(_0x4c97('0x3'));var fs=require('fs');var Redis=require(_0x4c97('0x4'));var db=require(_0x4c97('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c97('0x6'))(_0x4c97('0x7'));var config=require(_0x4c97('0x8'));var jayson=require(_0x4c97('0x9'));var client=jayson[_0x4c97('0xa')]['http']({'port':0x232a});config[_0x4c97('0xb')]=_[_0x4c97('0xc')](config['redis'],{'host':_0x4c97('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c97('0xb')]));require(_0x4c97('0xe'))[_0x4c97('0xf')](socket);function respondWithRpcPromise(_0x2163f2,_0x501048,_0x64ecc6){return new BPromise(function(_0x4dec7d,_0x2bb086){return client[_0x4c97('0x10')](_0x2163f2,_0x64ecc6)[_0x4c97('0x11')](function(_0x128548){logger[_0x4c97('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x501048,_0x4c97('0x13'));logger[_0x4c97('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x501048,_0x4c97('0x13'),JSON[_0x4c97('0x15')](_0x128548));if(_0x128548[_0x4c97('0x16')]){if(_0x128548['error']['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x501048,_0x128548['error'][_0x4c97('0x17')]);return _0x2bb086(_0x128548[_0x4c97('0x16')][_0x4c97('0x17')]);}logger[_0x4c97('0x16')](_0x4c97('0x18'),_0x501048,_0x128548[_0x4c97('0x16')][_0x4c97('0x17')]);return _0x4dec7d(_0x128548[_0x4c97('0x16')][_0x4c97('0x17')]);}else{logger[_0x4c97('0x12')](_0x4c97('0x18'),_0x501048,_0x4c97('0x13'));_0x4dec7d(_0x128548[_0x4c97('0x19')][_0x4c97('0x17')]);}})['catch'](function(_0x302672){logger[_0x4c97('0x16')](_0x4c97('0x18'),_0x501048,_0x302672);_0x2bb086(_0x302672);});});}exports[_0x4c97('0x1a')]=function(_0x991387){var _0x43c664=this;return new Promise(function(_0x3d6eb5,_0x360c7f){return db['WhatsappAccount']['find']({'raw':_0x991387['options']?_0x991387[_0x4c97('0x1b')][_0x4c97('0x1c')]===undefined?!![]:![]:!![],'where':_0x991387[_0x4c97('0x1b')]?_0x991387['options'][_0x4c97('0x1d')]||null:null,'attributes':_0x991387[_0x4c97('0x1b')]?_0x991387[_0x4c97('0x1b')][_0x4c97('0x1e')]||null:null,'include':_0x991387[_0x4c97('0x1b')]?_0x991387[_0x4c97('0x1b')]['include']?_[_0x4c97('0x1f')](_0x991387[_0x4c97('0x1b')][_0x4c97('0x20')],function(_0x31f312){return{'model':db[_0x31f312[_0x4c97('0x21')]],'as':_0x31f312['as'],'attributes':_0x31f312[_0x4c97('0x1e')],'include':_0x31f312['include']?_[_0x4c97('0x1f')](_0x31f312[_0x4c97('0x20')],function(_0x5e5309){return{'model':db[_0x5e5309[_0x4c97('0x21')]],'as':_0x5e5309['as'],'attributes':_0x5e5309[_0x4c97('0x1e')],'include':_0x5e5309[_0x4c97('0x20')]?_[_0x4c97('0x1f')](_0x5e5309[_0x4c97('0x20')],function(_0x31fe9d){return{'model':db[_0x31fe9d['model']],'as':_0x31fe9d['as'],'attributes':_0x31fe9d[_0x4c97('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c97('0x11')](function(_0x331d29){logger[_0x4c97('0x12')](_0x4c97('0x1a'),_0x991387);logger['debug'](_0x4c97('0x1a'),_0x991387,JSON[_0x4c97('0x15')](_0x331d29));_0x3d6eb5(_0x331d29);})[_0x4c97('0x22')](function(_0x5aa5b4){logger['error'](_0x4c97('0x1a'),_0x5aa5b4[_0x4c97('0x17')],_0x991387);_0x360c7f(_0x43c664[_0x4c97('0x16')](0x1f4,_0x5aa5b4[_0x4c97('0x17')]));});});}; \ No newline at end of file +var _0xc2fe=['message','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','map','model','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5d0d24,_0x3a026a){var _0x4d4ce7=function(_0x1b6688){while(--_0x1b6688){_0x5d0d24['push'](_0x5d0d24['shift']());}};_0x4d4ce7(++_0x3a026a);}(_0xc2fe,0x135));var _0xec2f=function(_0x59a12d,_0x39400b){_0x59a12d=_0x59a12d-0x0;var _0x341f79=_0xc2fe[_0x59a12d];return _0x341f79;};'use strict';var _=require('lodash');var util=require(_0xec2f('0x0'));var moment=require(_0xec2f('0x1'));var BPromise=require(_0xec2f('0x2'));var rs=require(_0xec2f('0x3'));var fs=require('fs');var Redis=require(_0xec2f('0x4'));var db=require(_0xec2f('0x5'))['db'];var utils=require(_0xec2f('0x6'));var logger=require(_0xec2f('0x7'))(_0xec2f('0x8'));var config=require(_0xec2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xec2f('0xa')][_0xec2f('0xb')]({'port':0x232a});config[_0xec2f('0xc')]=_[_0xec2f('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xec2f('0xe'))(new Redis(config['redis']));require(_0xec2f('0xf'))['register'](socket);function respondWithRpcPromise(_0x24caf5,_0x2c8990,_0xbc12a){return new BPromise(function(_0x27732d,_0x2e323d){return client[_0xec2f('0x10')](_0x24caf5,_0xbc12a)['then'](function(_0x389ad3){logger[_0xec2f('0x11')](_0xec2f('0x12'),_0x2c8990,_0xec2f('0x13'));logger[_0xec2f('0x14')](_0xec2f('0x15'),_0x2c8990,_0xec2f('0x13'),JSON['stringify'](_0x389ad3));if(_0x389ad3[_0xec2f('0x16')]){if(_0x389ad3[_0xec2f('0x16')][_0xec2f('0x17')]===0x1f4){logger['error'](_0xec2f('0x12'),_0x2c8990,_0x389ad3['error'][_0xec2f('0x18')]);return _0x2e323d(_0x389ad3[_0xec2f('0x16')][_0xec2f('0x18')]);}logger[_0xec2f('0x16')](_0xec2f('0x12'),_0x2c8990,_0x389ad3[_0xec2f('0x16')][_0xec2f('0x18')]);return _0x27732d(_0x389ad3['error']['message']);}else{logger[_0xec2f('0x11')](_0xec2f('0x12'),_0x2c8990,'request\x20sent');_0x27732d(_0x389ad3['result'][_0xec2f('0x18')]);}})[_0xec2f('0x19')](function(_0x1b7dcf){logger[_0xec2f('0x16')](_0xec2f('0x12'),_0x2c8990,_0x1b7dcf);_0x2e323d(_0x1b7dcf);});});}exports[_0xec2f('0x1a')]=function(_0x2ad9c0){var _0x13bca1=this;return new Promise(function(_0x315300,_0x4f1989){return db[_0xec2f('0x1b')][_0xec2f('0x1c')]({'raw':_0x2ad9c0['options']?_0x2ad9c0[_0xec2f('0x1d')][_0xec2f('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ad9c0[_0xec2f('0x1d')]?_0x2ad9c0[_0xec2f('0x1d')]['where']||null:null,'attributes':_0x2ad9c0[_0xec2f('0x1d')]?_0x2ad9c0[_0xec2f('0x1d')][_0xec2f('0x1f')]||null:null,'include':_0x2ad9c0[_0xec2f('0x1d')]?_0x2ad9c0['options'][_0xec2f('0x20')]?_[_0xec2f('0x21')](_0x2ad9c0[_0xec2f('0x1d')][_0xec2f('0x20')],function(_0x2dc165){return{'model':db[_0x2dc165['model']],'as':_0x2dc165['as'],'attributes':_0x2dc165['attributes'],'include':_0x2dc165[_0xec2f('0x20')]?_['map'](_0x2dc165[_0xec2f('0x20')],function(_0x470e57){return{'model':db[_0x470e57[_0xec2f('0x22')]],'as':_0x470e57['as'],'attributes':_0x470e57[_0xec2f('0x1f')],'include':_0x470e57['include']?_['map'](_0x470e57[_0xec2f('0x20')],function(_0x49bf6b){return{'model':db[_0x49bf6b[_0xec2f('0x22')]],'as':_0x49bf6b['as'],'attributes':_0x49bf6b[_0xec2f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xec2f('0x23')](function(_0x4b2c43){logger['info'](_0xec2f('0x1a'),_0x2ad9c0);logger[_0xec2f('0x14')]('ShowWhatsappAccount',_0x2ad9c0,JSON[_0xec2f('0x24')](_0x4b2c43));_0x315300(_0x4b2c43);})[_0xec2f('0x19')](function(_0x3e7e1a){logger[_0xec2f('0x16')](_0xec2f('0x1a'),_0x3e7e1a[_0xec2f('0x18')],_0x2ad9c0);_0x4f1989(_0x13bca1[_0xec2f('0x16')](0x1f4,_0x3e7e1a[_0xec2f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 6a065fc..bf79aca 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 _0xeee9=['save','remove','update','emit','removeListener','register','length','whatsappAccount:'];(function(_0x577d1e,_0x5199b1){var _0xce36ed=function(_0x49f31d){while(--_0x49f31d){_0x577d1e['push'](_0x577d1e['shift']());}};_0xce36ed(++_0x5199b1);}(_0xeee9,0x1f0));var _0x9eee=function(_0x4aacb0,_0x4eae8c){_0x4aacb0=_0x4aacb0-0x0;var _0x3de7fd=_0xeee9[_0x4aacb0];return _0x3de7fd;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x9eee('0x0'),_0x9eee('0x1'),_0x9eee('0x2')];function createListener(_0x21c5e7,_0x11fe38){return function(_0x30f535){_0x11fe38[_0x9eee('0x3')](_0x21c5e7,_0x30f535);};}function removeListener(_0x361a49,_0x374a2f){return function(){WhatsappAccountEvents[_0x9eee('0x4')](_0x361a49,_0x374a2f);};}exports[_0x9eee('0x5')]=function(_0x1a2f10){for(var _0x2b4a6e=0x0,_0x55de23=events[_0x9eee('0x6')];_0x2b4a6e<_0x55de23;_0x2b4a6e++){var _0x5a304b=events[_0x2b4a6e];var _0x3b9881=createListener(_0x9eee('0x7')+_0x5a304b,_0x1a2f10);WhatsappAccountEvents['on'](_0x5a304b,_0x3b9881);}}; \ No newline at end of file +var _0xe261=['register','length','whatsappAccount:','save','remove','update','emit'];(function(_0x2665a3,_0x3bac99){var _0x586de6=function(_0x1034d7){while(--_0x1034d7){_0x2665a3['push'](_0x2665a3['shift']());}};_0x586de6(++_0x3bac99);}(_0xe261,0xea));var _0x1e26=function(_0x5954fd,_0x248fae){_0x5954fd=_0x5954fd-0x0;var _0x3c8d63=_0xe261[_0x5954fd];return _0x3c8d63;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x1e26('0x0'),_0x1e26('0x1'),_0x1e26('0x2')];function createListener(_0x10dbe8,_0xdd5a4d){return function(_0x5a85ab){_0xdd5a4d[_0x1e26('0x3')](_0x10dbe8,_0x5a85ab);};}function removeListener(_0x47a446,_0xbbc855){return function(){WhatsappAccountEvents['removeListener'](_0x47a446,_0xbbc855);};}exports[_0x1e26('0x4')]=function(_0x261206){for(var _0x142af2=0x0,_0x9ee88c=events[_0x1e26('0x5')];_0x142af2<_0x9ee88c;_0x142af2++){var _0x2e2f70=events[_0x142af2];var _0x111bed=createListener(_0x1e26('0x6')+_0x2e2f70,_0x261206);WhatsappAccountEvents['on'](_0x2e2f70,_0x111bed);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 54c2430..79f9167 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 _0x4c20=['create','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','post'];(function(_0x1cc6c4,_0x4addb0){var _0x975775=function(_0x23e1f4){while(--_0x23e1f4){_0x1cc6c4['push'](_0x1cc6c4['shift']());}};_0x975775(++_0x4addb0);}(_0x4c20,0xef));var _0x04c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c20[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x04c2('0x0'));var util=require(_0x04c2('0x1'));var path=require(_0x04c2('0x2'));var timeout=require(_0x04c2('0x3'));var express=require('express');var router=express[_0x04c2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x04c2('0x5'));var interaction=require(_0x04c2('0x6'));var config=require(_0x04c2('0x7'));var controller=require(_0x04c2('0x8'));router[_0x04c2('0x9')]('/',auth[_0x04c2('0xa')](),controller[_0x04c2('0xb')]);router['get']('/:id',auth[_0x04c2('0xa')](),controller['show']);router[_0x04c2('0xc')]('/',auth[_0x04c2('0xa')](),controller[_0x04c2('0xd')]);router['put'](_0x04c2('0xe'),auth[_0x04c2('0xa')](),controller[_0x04c2('0xf')]);router[_0x04c2('0x10')](_0x04c2('0xe'),auth[_0x04c2('0xa')](),controller[_0x04c2('0x11')]);module['exports']=router; \ No newline at end of file +var _0x17f5=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x17f5,0x199));var _0x517f=function(_0x28ed4f,_0x3b5bd5){_0x28ed4f=_0x28ed4f-0x0;var _0x5d36d5=_0x17f5[_0x28ed4f];return _0x5d36d5;};'use strict';var multer=require(_0x517f('0x0'));var util=require(_0x517f('0x1'));var path=require(_0x517f('0x2'));var timeout=require(_0x517f('0x3'));var express=require(_0x517f('0x4'));var router=express[_0x517f('0x5')]();var fs_extra=require(_0x517f('0x6'));var auth=require(_0x517f('0x7'));var interaction=require(_0x517f('0x8'));var config=require(_0x517f('0x9'));var controller=require('./whatsappApplication.controller');router[_0x517f('0xa')]('/',auth[_0x517f('0xb')](),controller[_0x517f('0xc')]);router['get'](_0x517f('0xd'),auth[_0x517f('0xb')](),controller['show']);router[_0x517f('0xe')]('/',auth[_0x517f('0xb')](),controller[_0x517f('0xf')]);router[_0x517f('0x10')](_0x517f('0xd'),auth[_0x517f('0xb')](),controller[_0x517f('0x11')]);router[_0x517f('0x12')]('/:id',auth[_0x517f('0xb')](),controller[_0x517f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 2652aa8..7c9b07c 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 _0xa63e=['exports','INTEGER','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x2d0a47,_0x51c775){var _0x567df2=function(_0x2fac92){while(--_0x2fac92){_0x2d0a47['push'](_0x2d0a47['shift']());}};_0x567df2(++_0x51c775);}(_0xa63e,0x77));var _0xea63=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa63e[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xea63('0x0'));module[_0xea63('0x1')]={'priority':{'type':Sequelize[_0xea63('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xea63('0x3')]()},'description':{'type':Sequelize[_0xea63('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xea63('0x5')}}; \ No newline at end of file +var _0x722c=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2e87f0,_0x434dc9){var _0x136ccd=function(_0x4e2d23){while(--_0x4e2d23){_0x2e87f0['push'](_0x2e87f0['shift']());}};_0x136ccd(++_0x434dc9);}(_0x722c,0xf1));var _0xc722=function(_0x4c8ef4,_0x511b1e){_0x4c8ef4=_0x4c8ef4-0x0;var _0x3fc0c3=_0x722c[_0x4c8ef4];return _0x3fc0c3;};'use strict';var Sequelize=require(_0xc722('0x0'));module[_0xc722('0x1')]={'priority':{'type':Sequelize[_0xc722('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc722('0x3')],'allowNull':![],'defaultValue':_0xc722('0x4')},'appdata':{'type':Sequelize[_0xc722('0x5')]()},'description':{'type':Sequelize[_0xc722('0x3')]},'interval':{'type':Sequelize[_0xc722('0x3')],'defaultValue':_0xc722('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 53a0f3f..074bd9c 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 _0x5ed9=['save','update','then','destroy','sendStatus','stack','name','send','index','WhatsappApplication','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','merge','map','type','options','includeAll','include','findAll','catch','show','params','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject'];(function(_0x287cf3,_0x1414bd){var _0x15779c=function(_0x1af52b){while(--_0x1af52b){_0x287cf3['push'](_0x287cf3['shift']());}};_0x15779c(++_0x1414bd);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5ed9[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x95ed('0x0'));var rimraf=require(_0x95ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95ed('0x2'));var rp=require(_0x95ed('0x3'));var moment=require(_0x95ed('0x4'));var BPromise=require(_0x95ed('0x5'));var Mustache=require('mustache');var util=require(_0x95ed('0x6'));var path=require(_0x95ed('0x7'));var sox=require(_0x95ed('0x8'));var csv=require('to-csv');var ejs=require(_0x95ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95ed('0xa'));var squel=require(_0x95ed('0xb'));var crypto=require(_0x95ed('0xc'));var jsforce=require(_0x95ed('0xd'));var deskjs=require(_0x95ed('0xe'));var toCsv=require(_0x95ed('0xf'));var querystring=require('querystring');var Papa=require(_0x95ed('0x10'));var Redis=require(_0x95ed('0x11'));var authService=require(_0x95ed('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x95ed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95ed('0x14'))(_0x95ed('0x15'));var utils=require(_0x95ed('0x16'));var config=require(_0x95ed('0x17'));var licenseUtil=require(_0x95ed('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4571,_0x3da05b){_0x3da05b=_0x3da05b||0xcc;return function(_0x4236c1){if(_0x4236c1){return _0x5e4571['sendStatus'](_0x3da05b);}return _0x5e4571['status'](_0x3da05b)[_0x95ed('0x19')]();};}function respondWithResult(_0x11671d,_0x22211f){_0x22211f=_0x22211f||0xc8;return function(_0x3ebfda){if(_0x3ebfda){return _0x11671d['status'](_0x22211f)[_0x95ed('0x1a')](_0x3ebfda);}};}function respondWithFilteredResult(_0xd3fe73,_0x477b8f){return function(_0x597a04){if(_0x597a04){var _0x5fc6b5=typeof _0x477b8f['offset']===_0x95ed('0x1b')&&typeof _0x477b8f['limit']==='undefined';var _0x47f841=_0x597a04[_0x95ed('0x1c')];var _0x58fb9e=_0x5fc6b5?0x0:_0x477b8f[_0x95ed('0x1d')];var _0x1bc47c=_0x5fc6b5?_0x597a04['count']:_0x477b8f[_0x95ed('0x1d')]+_0x477b8f[_0x95ed('0x1e')];var _0x4432c9;if(_0x1bc47c>=_0x47f841){_0x1bc47c=_0x47f841;_0x4432c9=0xc8;}else{_0x4432c9=0xce;}_0xd3fe73[_0x95ed('0x1f')](_0x4432c9);return _0xd3fe73[_0x95ed('0x20')](_0x95ed('0x21'),_0x58fb9e+'-'+_0x1bc47c+'/'+_0x47f841)[_0x95ed('0x1a')](_0x597a04);}return null;};}function patchUpdates(_0x3e05cf){return function(_0x10823b){try{jsonpatch[_0x95ed('0x22')](_0x10823b,_0x3e05cf,!![]);}catch(_0x5887e3){return BPromise[_0x95ed('0x23')](_0x5887e3);}return _0x10823b[_0x95ed('0x24')]();};}function saveUpdates(_0x4e8a5d,_0x5d5afe){return function(_0x54c5ae){if(_0x54c5ae){return _0x54c5ae[_0x95ed('0x25')](_0x4e8a5d)[_0x95ed('0x26')](function(_0x31384c){return _0x31384c;});}return null;};}function removeEntity(_0x61d85e,_0x2c0824){return function(_0x19b664){if(_0x19b664){return _0x19b664[_0x95ed('0x27')]()[_0x95ed('0x26')](function(){_0x61d85e[_0x95ed('0x1f')](0xcc)[_0x95ed('0x19')]();});}};}function handleEntityNotFound(_0x3b298f,_0x413be3){return function(_0x461a50){if(!_0x461a50){_0x3b298f[_0x95ed('0x28')](0x194);}return _0x461a50;};}function handleError(_0x51ca8b,_0x2da24f){_0x2da24f=_0x2da24f||0x1f4;return function(_0x518dbd){logger['error'](_0x518dbd[_0x95ed('0x29')]);if(_0x518dbd[_0x95ed('0x2a')]){delete _0x518dbd[_0x95ed('0x2a')];}_0x51ca8b[_0x95ed('0x1f')](_0x2da24f)[_0x95ed('0x2b')](_0x518dbd);};}exports[_0x95ed('0x2c')]=function(_0x88e102,_0x190620){var _0x39330d={},_0x3f3ed9={},_0x105af5={'count':0x0,'rows':[]};var _0x3a8841=_['map'](db[_0x95ed('0x2d')][_0x95ed('0x2e')],function(_0x53b1f4){return{'name':_0x53b1f4[_0x95ed('0x2f')],'type':_0x53b1f4['type']['key']};});_0x3f3ed9['model']=_['map'](_0x3a8841,'name');_0x3f3ed9[_0x95ed('0x30')]=_[_0x95ed('0x31')](_0x88e102[_0x95ed('0x30')]);_0x3f3ed9[_0x95ed('0x32')]=_[_0x95ed('0x33')](_0x3f3ed9[_0x95ed('0x34')],_0x3f3ed9[_0x95ed('0x30')]);_0x39330d['attributes']=_[_0x95ed('0x33')](_0x3f3ed9[_0x95ed('0x34')],qs[_0x95ed('0x35')](_0x88e102['query']['fields']));_0x39330d[_0x95ed('0x36')]=_0x39330d['attributes']['length']?_0x39330d['attributes']:_0x3f3ed9['model'];if(!_0x88e102[_0x95ed('0x30')]['hasOwnProperty'](_0x95ed('0x37'))){_0x39330d[_0x95ed('0x1e')]=qs['limit'](_0x88e102['query']['limit']);_0x39330d['offset']=qs['offset'](_0x88e102[_0x95ed('0x30')][_0x95ed('0x1d')]);}_0x39330d[_0x95ed('0x38')]=qs[_0x95ed('0x39')](_0x88e102[_0x95ed('0x30')][_0x95ed('0x39')]);_0x39330d['where']=qs[_0x95ed('0x32')](_[_0x95ed('0x3a')](_0x88e102[_0x95ed('0x30')],_0x3f3ed9['filters']),_0x3a8841);if(_0x88e102[_0x95ed('0x30')][_0x95ed('0x3b')]){_0x39330d[_0x95ed('0x3c')]=_[_0x95ed('0x3d')](_0x39330d[_0x95ed('0x3c')],{'$or':_[_0x95ed('0x3e')](_0x3a8841,function(_0x40e968){if(_0x40e968[_0x95ed('0x3f')]!=='VIRTUAL'){var _0x53ddbe={};_0x53ddbe[_0x40e968['name']]={'$like':'%'+_0x88e102[_0x95ed('0x30')][_0x95ed('0x3b')]+'%'};return _0x53ddbe;}})});}_0x39330d=_[_0x95ed('0x3d')]({},_0x39330d,_0x88e102[_0x95ed('0x40')]);var _0x2c0ea8={'where':_0x39330d[_0x95ed('0x3c')]};return db['WhatsappApplication'][_0x95ed('0x1c')](_0x2c0ea8)[_0x95ed('0x26')](function(_0x477eb6){_0x105af5['count']=_0x477eb6;if(_0x88e102['query'][_0x95ed('0x41')]){_0x39330d[_0x95ed('0x42')]=[{'all':!![]}];}return db[_0x95ed('0x2d')][_0x95ed('0x43')](_0x39330d);})[_0x95ed('0x26')](function(_0x5c4c54){_0x105af5['rows']=_0x5c4c54;return _0x105af5;})[_0x95ed('0x26')](respondWithFilteredResult(_0x190620,_0x39330d))[_0x95ed('0x44')](handleError(_0x190620,null));};exports[_0x95ed('0x45')]=function(_0x3c8b7c,_0x4f91ed){var _0x6746ce={'raw':!![],'where':{'id':_0x3c8b7c[_0x95ed('0x46')]['id']}},_0x537c2b={};_0x537c2b[_0x95ed('0x34')]=_[_0x95ed('0x31')](db['WhatsappApplication'][_0x95ed('0x2e')]);_0x537c2b[_0x95ed('0x30')]=_[_0x95ed('0x31')](_0x3c8b7c['query']);_0x537c2b['filters']=_[_0x95ed('0x33')](_0x537c2b['model'],_0x537c2b[_0x95ed('0x30')]);_0x6746ce['attributes']=_[_0x95ed('0x33')](_0x537c2b[_0x95ed('0x34')],qs[_0x95ed('0x35')](_0x3c8b7c[_0x95ed('0x30')][_0x95ed('0x35')]));_0x6746ce['attributes']=_0x6746ce[_0x95ed('0x36')][_0x95ed('0x47')]?_0x6746ce[_0x95ed('0x36')]:_0x537c2b['model'];if(_0x3c8b7c[_0x95ed('0x30')]['includeAll']){_0x6746ce[_0x95ed('0x42')]=[{'all':!![]}];}_0x6746ce=_[_0x95ed('0x3d')]({},_0x6746ce,_0x3c8b7c['options']);return db[_0x95ed('0x2d')][_0x95ed('0x48')](_0x6746ce)['then'](handleEntityNotFound(_0x4f91ed,null))['then'](respondWithResult(_0x4f91ed,null))[_0x95ed('0x44')](handleError(_0x4f91ed,null));};exports['create']=function(_0x257a23,_0x5288e6){return db[_0x95ed('0x2d')][_0x95ed('0x49')](_0x257a23[_0x95ed('0x4a')],{})[_0x95ed('0x26')](respondWithResult(_0x5288e6,0xc9))[_0x95ed('0x44')](handleError(_0x5288e6,null));};exports['update']=function(_0x373f2b,_0x2d0849){if(_0x373f2b[_0x95ed('0x4a')]['id']){delete _0x373f2b[_0x95ed('0x4a')]['id'];}return db[_0x95ed('0x2d')][_0x95ed('0x48')]({'where':{'id':_0x373f2b[_0x95ed('0x46')]['id']}})[_0x95ed('0x26')](handleEntityNotFound(_0x2d0849,null))[_0x95ed('0x26')](saveUpdates(_0x373f2b[_0x95ed('0x4a')],null))[_0x95ed('0x26')](respondWithResult(_0x2d0849,null))[_0x95ed('0x44')](handleError(_0x2d0849,null));};exports[_0x95ed('0x27')]=function(_0x4dc496,_0x29cb03){return db[_0x95ed('0x2d')]['find']({'where':{'id':_0x4dc496[_0x95ed('0x46')]['id']}})['then'](handleEntityNotFound(_0x29cb03,null))[_0x95ed('0x26')](removeEntity(_0x29cb03,null))[_0x95ed('0x44')](handleError(_0x29cb03,null));}; \ No newline at end of file +var _0x147b=['update','then','destroy','end','error','name','index','map','WhatsappApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','rawAttributes','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x21b3c9,_0x3041a4){var _0x9eb38e=function(_0x17421a){while(--_0x17421a){_0x21b3c9['push'](_0x21b3c9['shift']());}};_0x9eb38e(++_0x3041a4);}(_0x147b,0x193));var _0xb147=function(_0x2c02db,_0x4e46ad){_0x2c02db=_0x2c02db-0x0;var _0x1623f8=_0x147b[_0x2c02db];return _0x1623f8;};'use strict';var emlformat=require(_0xb147('0x0'));var rimraf=require(_0xb147('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb147('0x2'));var rp=require(_0xb147('0x3'));var moment=require('moment');var BPromise=require(_0xb147('0x4'));var Mustache=require(_0xb147('0x5'));var util=require(_0xb147('0x6'));var path=require('path');var sox=require(_0xb147('0x7'));var csv=require('to-csv');var ejs=require(_0xb147('0x8'));var fs=require('fs');var fs_extra=require(_0xb147('0x9'));var _=require(_0xb147('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb147('0xb'));var deskjs=require(_0xb147('0xc'));var toCsv=require(_0xb147('0xd'));var querystring=require(_0xb147('0xe'));var Papa=require(_0xb147('0xf'));var Redis=require(_0xb147('0x10'));var authService=require(_0xb147('0x11'));var qs=require(_0xb147('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb147('0x13'))(_0xb147('0x14'));var utils=require(_0xb147('0x15'));var config=require(_0xb147('0x16'));var licenseUtil=require(_0xb147('0x17'));var db=require(_0xb147('0x18'))['db'];function respondWithStatusCode(_0x1465f6,_0x2d5e1c){_0x2d5e1c=_0x2d5e1c||0xcc;return function(_0x38040c){if(_0x38040c){return _0x1465f6[_0xb147('0x19')](_0x2d5e1c);}return _0x1465f6[_0xb147('0x1a')](_0x2d5e1c)['end']();};}function respondWithResult(_0xc110cb,_0x3dcfe0){_0x3dcfe0=_0x3dcfe0||0xc8;return function(_0x23ad29){if(_0x23ad29){return _0xc110cb[_0xb147('0x1a')](_0x3dcfe0)['json'](_0x23ad29);}};}function respondWithFilteredResult(_0x2a0eeb,_0x394614){return function(_0x4ab867){if(_0x4ab867){var _0x4df7e9=typeof _0x394614[_0xb147('0x1b')]===_0xb147('0x1c')&&typeof _0x394614[_0xb147('0x1d')]==='undefined';var _0x52af1f=_0x4ab867[_0xb147('0x1e')];var _0x5e3235=_0x4df7e9?0x0:_0x394614[_0xb147('0x1b')];var _0x107b35=_0x4df7e9?_0x4ab867[_0xb147('0x1e')]:_0x394614['offset']+_0x394614['limit'];var _0x4cd62f;if(_0x107b35>=_0x52af1f){_0x107b35=_0x52af1f;_0x4cd62f=0xc8;}else{_0x4cd62f=0xce;}_0x2a0eeb[_0xb147('0x1a')](_0x4cd62f);return _0x2a0eeb[_0xb147('0x1f')](_0xb147('0x20'),_0x5e3235+'-'+_0x107b35+'/'+_0x52af1f)['json'](_0x4ab867);}return null;};}function patchUpdates(_0x39c15c){return function(_0x84c1ed){try{jsonpatch[_0xb147('0x21')](_0x84c1ed,_0x39c15c,!![]);}catch(_0x45cbe8){return BPromise[_0xb147('0x22')](_0x45cbe8);}return _0x84c1ed['save']();};}function saveUpdates(_0xa85f38,_0xf64527){return function(_0x243523){if(_0x243523){return _0x243523[_0xb147('0x23')](_0xa85f38)[_0xb147('0x24')](function(_0x53ac4b){return _0x53ac4b;});}return null;};}function removeEntity(_0x565acd,_0x203161){return function(_0x98509e){if(_0x98509e){return _0x98509e[_0xb147('0x25')]()[_0xb147('0x24')](function(){_0x565acd['status'](0xcc)[_0xb147('0x26')]();});}};}function handleEntityNotFound(_0x4c5475,_0x5930a5){return function(_0x2b7c3a){if(!_0x2b7c3a){_0x4c5475[_0xb147('0x19')](0x194);}return _0x2b7c3a;};}function handleError(_0x444d58,_0x139057){_0x139057=_0x139057||0x1f4;return function(_0x12c18f){logger[_0xb147('0x27')](_0x12c18f['stack']);if(_0x12c18f['name']){delete _0x12c18f[_0xb147('0x28')];}_0x444d58[_0xb147('0x1a')](_0x139057)['send'](_0x12c18f);};}exports[_0xb147('0x29')]=function(_0x45887f,_0x50f831){var _0x517990={},_0x2b90ef={},_0xe07da5={'count':0x0,'rows':[]};var _0x1ba125=_[_0xb147('0x2a')](db[_0xb147('0x2b')]['rawAttributes'],function(_0x3e6a3c){return{'name':_0x3e6a3c[_0xb147('0x2c')],'type':_0x3e6a3c[_0xb147('0x2d')][_0xb147('0x2e')]};});_0x2b90ef[_0xb147('0x2f')]=_['map'](_0x1ba125,_0xb147('0x28'));_0x2b90ef[_0xb147('0x30')]=_[_0xb147('0x31')](_0x45887f[_0xb147('0x30')]);_0x2b90ef[_0xb147('0x32')]=_[_0xb147('0x33')](_0x2b90ef[_0xb147('0x2f')],_0x2b90ef[_0xb147('0x30')]);_0x517990[_0xb147('0x34')]=_['intersection'](_0x2b90ef[_0xb147('0x2f')],qs[_0xb147('0x35')](_0x45887f[_0xb147('0x30')][_0xb147('0x35')]));_0x517990[_0xb147('0x34')]=_0x517990[_0xb147('0x34')][_0xb147('0x36')]?_0x517990[_0xb147('0x34')]:_0x2b90ef['model'];if(!_0x45887f[_0xb147('0x30')][_0xb147('0x37')](_0xb147('0x38'))){_0x517990[_0xb147('0x1d')]=qs[_0xb147('0x1d')](_0x45887f[_0xb147('0x30')][_0xb147('0x1d')]);_0x517990['offset']=qs[_0xb147('0x1b')](_0x45887f['query'][_0xb147('0x1b')]);}_0x517990[_0xb147('0x39')]=qs['sort'](_0x45887f['query']['sort']);_0x517990[_0xb147('0x3a')]=qs[_0xb147('0x32')](_[_0xb147('0x3b')](_0x45887f[_0xb147('0x30')],_0x2b90ef[_0xb147('0x32')]),_0x1ba125);if(_0x45887f['query'][_0xb147('0x3c')]){_0x517990['where']=_['merge'](_0x517990['where'],{'$or':_[_0xb147('0x2a')](_0x1ba125,function(_0xdbc869){if(_0xdbc869[_0xb147('0x2d')]!==_0xb147('0x3d')){var _0x2fb83d={};_0x2fb83d[_0xdbc869[_0xb147('0x28')]]={'$like':'%'+_0x45887f['query'][_0xb147('0x3c')]+'%'};return _0x2fb83d;}})});}_0x517990=_[_0xb147('0x3e')]({},_0x517990,_0x45887f[_0xb147('0x3f')]);var _0x449412={'where':_0x517990[_0xb147('0x3a')]};return db[_0xb147('0x2b')]['count'](_0x449412)[_0xb147('0x24')](function(_0x22043c){_0xe07da5[_0xb147('0x1e')]=_0x22043c;if(_0x45887f['query'][_0xb147('0x40')]){_0x517990[_0xb147('0x41')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x517990);})['then'](function(_0x40762c){_0xe07da5['rows']=_0x40762c;return _0xe07da5;})['then'](respondWithFilteredResult(_0x50f831,_0x517990))[_0xb147('0x42')](handleError(_0x50f831,null));};exports[_0xb147('0x43')]=function(_0x2fd593,_0x4673cd){var _0x4a7c03={'raw':!![],'where':{'id':_0x2fd593['params']['id']}},_0x3d9358={};_0x3d9358[_0xb147('0x2f')]=_[_0xb147('0x31')](db[_0xb147('0x2b')][_0xb147('0x44')]);_0x3d9358[_0xb147('0x30')]=_[_0xb147('0x31')](_0x2fd593[_0xb147('0x30')]);_0x3d9358[_0xb147('0x32')]=_['intersection'](_0x3d9358[_0xb147('0x2f')],_0x3d9358[_0xb147('0x30')]);_0x4a7c03[_0xb147('0x34')]=_[_0xb147('0x33')](_0x3d9358[_0xb147('0x2f')],qs[_0xb147('0x35')](_0x2fd593['query'][_0xb147('0x35')]));_0x4a7c03['attributes']=_0x4a7c03[_0xb147('0x34')][_0xb147('0x36')]?_0x4a7c03[_0xb147('0x34')]:_0x3d9358[_0xb147('0x2f')];if(_0x2fd593['query'][_0xb147('0x40')]){_0x4a7c03[_0xb147('0x41')]=[{'all':!![]}];}_0x4a7c03=_[_0xb147('0x3e')]({},_0x4a7c03,_0x2fd593['options']);return db[_0xb147('0x2b')]['find'](_0x4a7c03)[_0xb147('0x24')](handleEntityNotFound(_0x4673cd,null))[_0xb147('0x24')](respondWithResult(_0x4673cd,null))[_0xb147('0x42')](handleError(_0x4673cd,null));};exports[_0xb147('0x45')]=function(_0x1d679e,_0x17975d){return db[_0xb147('0x2b')][_0xb147('0x45')](_0x1d679e[_0xb147('0x46')],{})[_0xb147('0x24')](respondWithResult(_0x17975d,0xc9))[_0xb147('0x42')](handleError(_0x17975d,null));};exports[_0xb147('0x23')]=function(_0x37e03b,_0x39e48a){if(_0x37e03b[_0xb147('0x46')]['id']){delete _0x37e03b['body']['id'];}return db[_0xb147('0x2b')][_0xb147('0x47')]({'where':{'id':_0x37e03b[_0xb147('0x48')]['id']}})[_0xb147('0x24')](handleEntityNotFound(_0x39e48a,null))[_0xb147('0x24')](saveUpdates(_0x37e03b['body'],null))[_0xb147('0x24')](respondWithResult(_0x39e48a,null))[_0xb147('0x42')](handleError(_0x39e48a,null));};exports['destroy']=function(_0x2d6c1d,_0x57e700){return db['WhatsappApplication'][_0xb147('0x47')]({'where':{'id':_0x2d6c1d[_0xb147('0x48')]['id']}})['then'](handleEntityNotFound(_0x57e700,null))[_0xb147('0x24')](removeEntity(_0x57e700,null))[_0xb147('0x42')](handleError(_0x57e700,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1640d39..a00d15e 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 _0xa630=['../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','rimraf'];(function(_0x1564b0,_0x4100bd){var _0x8b2ea7=function(_0x455785){while(--_0x455785){_0x1564b0['push'](_0x1564b0['shift']());}};_0x8b2ea7(++_0x4100bd);}(_0xa630,0xbe));var _0x0a63=function(_0x5604d9,_0x1812b6){_0x5604d9=_0x5604d9-0x0;var _0xe67e90=_0xa630[_0x5604d9];return _0xe67e90;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));module[_0x0a63('0x7')]=function(_0x37b4c9,_0x4b7474){return _0x37b4c9[_0x0a63('0x8')](_0x0a63('0x9'),attributes,{'tableName':_0x0a63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a63('0xb'),'collate':_0x0a63('0xc')});}; \ No newline at end of file +var _0x7a2c=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','whatsapp_applications'];(function(_0x5c923e,_0x1196c7){var _0x8b0575=function(_0x58384b){while(--_0x58384b){_0x5c923e['push'](_0x5c923e['shift']());}};_0x8b0575(++_0x1196c7);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x37e87c,_0x35cd9e){_0x37e87c=_0x37e87c-0x0;var _0x4d79f7=_0x7a2c[_0x37e87c];return _0x4d79f7;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('WhatsappApplication',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc7a2('0xb'),'collate':_0xc7a2('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index e96c678..50d0499 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa908bc,_0xb277f5){var _0x4593f3=function(_0x5ab87c){while(--_0x5ab87c){_0xa908bc['push'](_0xa908bc['shift']());}};_0x4593f3(++_0xb277f5);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x3ae67c,_0x3a997d){var _0x3295ca=function(_0x268067){while(--_0x268067){_0x3ae67c['push'](_0x3ae67c['shift']());}};_0x3295ca(++_0x3a997d);}(_0x55ca,0x126));var _0xa55c=function(_0x196e16,_0x168729){_0x196e16=_0x196e16-0x0;var _0x37531f=_0x55ca[_0x196e16];return _0x37531f;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index a107b1a..31a7472 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 _0x4975=['removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','whatsapp','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy'];(function(_0x5df59f,_0xf11a72){var _0x190e3b=function(_0x2b983e){while(--_0x2b983e){_0x5df59f['push'](_0x5df59f['shift']());}};_0x190e3b(++_0xf11a72);}(_0x4975,0x86));var _0x5497=function(_0x573be2,_0x130477){_0x573be2=_0x573be2-0x0;var _0x18561b=_0x4975[_0x573be2];return _0x18561b;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0xa')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0xa')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x5497('0x14')]);router[_0x5497('0x15')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x16')]);router[_0x5497('0x15')](_0x5497('0x17'),auth[_0x5497('0xd')](),interaction[_0x5497('0x18')](_0x5497('0x19'),'whatsappinteraction:addtags'),controller[_0x5497('0x1a')]);router['put'](_0x5497('0xf'),auth[_0x5497('0xd')](),interaction[_0x5497('0x18')](_0x5497('0x19'),_0x5497('0x1b')),controller[_0x5497('0x1c')]);router[_0x5497('0x1d')]('/:id',auth['isAuthenticated'](),interaction[_0x5497('0x18')](_0x5497('0x19'),_0x5497('0x1e')),controller['destroy']);router[_0x5497('0x1d')](_0x5497('0x17'),auth[_0x5497('0xd')](),controller[_0x5497('0x1f')]);module[_0x5497('0x20')]=router; \ No newline at end of file +var _0x44e8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','delete','/:id/tags','removeTags','exports','multer','connect-timeout'];(function(_0x522ea3,_0x2384bd){var _0x4eb4cb=function(_0x5dc61a){while(--_0x5dc61a){_0x522ea3['push'](_0x522ea3['shift']());}};_0x4eb4cb(++_0x2384bd);}(_0x44e8,0xd7));var _0x844e=function(_0x321f0c,_0x36fbe9){_0x321f0c=_0x321f0c-0x0;var _0x3c3b68=_0x44e8[_0x321f0c];return _0x3c3b68;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0x8')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0xf')]);router[_0x844e('0x8')](_0x844e('0x10'),auth[_0x844e('0xb')](),controller[_0x844e('0x11')]);router[_0x844e('0x12')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0x12')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0x13')]);router[_0x844e('0x12')]('/:id/tags',auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),'whatsappinteraction:addtags'),controller[_0x844e('0x16')]);router[_0x844e('0x17')](_0x844e('0xc'),auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),_0x844e('0x18')),controller[_0x844e('0x19')]);router['delete'](_0x844e('0xc'),auth['isAuthenticated'](),interaction[_0x844e('0x14')]('whatsapp',_0x844e('0x1a')),controller['destroy']);router[_0x844e('0x1b')](_0x844e('0x1c'),auth[_0x844e('0xb')](),controller[_0x844e('0x1d')]);module[_0x844e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 98f0af1..823f865 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 _0xaab2=['exports','BOOLEAN','STRING','ENUM','DATE','out','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaab2,0xca));var _0x2aab=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xaab2[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2aab('0x0'));module[_0x2aab('0x1')]={'closed':{'type':Sequelize[_0x2aab('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2aab('0x3')]},'secondDisposition':{'type':Sequelize[_0x2aab('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2aab('0x3')]},'note':{'type':Sequelize[_0x2aab('0x3')]},'phone':{'type':Sequelize[_0x2aab('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x2aab('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2aab('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x2aab('0x4')]('in',_0x2aab('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2aab('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe314=['BOOLEAN','DATE','STRING','ENUM','out','moment','exports'];(function(_0x41fb98,_0x470189){var _0x4b0044=function(_0xf8b2ec){while(--_0xf8b2ec){_0x41fb98['push'](_0x41fb98['shift']());}};_0x4b0044(++_0x470189);}(_0xe314,0x7c));var _0x4e31=function(_0x506aef,_0xb1161c){_0x506aef=_0x506aef-0x0;var _0x579eea=_0xe314[_0x506aef];return _0x579eea;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4e31('0x0'));module[_0x4e31('0x1')]={'closed':{'type':Sequelize[_0x4e31('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4e31('0x3')]},'disposition':{'type':Sequelize[_0x4e31('0x4')]},'secondDisposition':{'type':Sequelize[_0x4e31('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4e31('0x4')]},'note':{'type':Sequelize[_0x4e31('0x4')]},'phone':{'type':Sequelize[_0x4e31('0x4')]},'read1stAt':{'type':Sequelize[_0x4e31('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4e31('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4e31('0x5')]('in',_0x4e31('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4e31('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 24d16e8..06c6fab 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 _0x97ed=['disposition','Messages','basename','createReadStream','pipe','createWriteStream','System','Contact','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','unlinkSync','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','error','stack','name','map','fullname','TagIds','split','forEach','Tags','push','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','$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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','WhatsappInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','include','options','create','describe','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Whatsapp','Owner','N.A.','closed','closedAt'];(function(_0x5b82a8,_0x217bef){var _0x41ebf4=function(_0x3ee383){while(--_0x3ee383){_0x5b82a8['push'](_0x5b82a8['shift']());}};_0x41ebf4(++_0x217bef);}(_0x97ed,0x1e7));var _0xd97e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x97ed[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xd97e('0x0'));var rimraf=require(_0xd97e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd97e('0x2'));var moment=require(_0xd97e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd97e('0x4'));var util=require(_0xd97e('0x5'));var path=require(_0xd97e('0x6'));var sox=require(_0xd97e('0x7'));var csv=require('to-csv');var ejs=require(_0xd97e('0x8'));var fs=require('fs');var fs_extra=require(_0xd97e('0x9'));var _=require('lodash');var squel=require(_0xd97e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd97e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd97e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd97e('0xd'));var as=require(_0xd97e('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xd97e('0xf'));var logger=require(_0xd97e('0x10'))(_0xd97e('0x11'));var utils=require('../../config/utils');var config=require(_0xd97e('0x12'));var licenseUtil=require(_0xd97e('0x13'));var db=require(_0xd97e('0x14'))['db'];config[_0xd97e('0x15')]=_[_0xd97e('0x16')](config[_0xd97e('0x15')],{'host':_0xd97e('0x17'),'port':0x18eb});var socket=require(_0xd97e('0x18'))(new Redis(config[_0xd97e('0x15')]));require(_0xd97e('0x19'))['register'](socket);function respondWithStatusCode(_0x45fc2b,_0x51cf2a){_0x51cf2a=_0x51cf2a||0xcc;return function(_0x40b81a){if(_0x40b81a){return _0x45fc2b[_0xd97e('0x1a')](_0x51cf2a);}return _0x45fc2b[_0xd97e('0x1b')](_0x51cf2a)[_0xd97e('0x1c')]();};}function respondWithResult(_0x2dfdc4,_0x3c1bed){_0x3c1bed=_0x3c1bed||0xc8;return function(_0x48bae3){if(_0x48bae3){return _0x2dfdc4[_0xd97e('0x1b')](_0x3c1bed)[_0xd97e('0x1d')](_0x48bae3);}};}function respondWithFilteredResult(_0x129cc1,_0x98b85a){return function(_0x27a561){if(_0x27a561){var _0x25d6a1=typeof _0x98b85a[_0xd97e('0x1e')]===_0xd97e('0x1f')&&typeof _0x98b85a[_0xd97e('0x20')]===_0xd97e('0x1f');var _0x4bd1c4=_0x27a561[_0xd97e('0x21')];var _0x4d0596=_0x25d6a1?0x0:_0x98b85a[_0xd97e('0x1e')];var _0x2c91c9=_0x25d6a1?_0x27a561[_0xd97e('0x21')]:_0x98b85a[_0xd97e('0x1e')]+_0x98b85a[_0xd97e('0x20')];var _0x47af25;if(_0x2c91c9>=_0x4bd1c4){_0x2c91c9=_0x4bd1c4;_0x47af25=0xc8;}else{_0x47af25=0xce;}_0x129cc1['status'](_0x47af25);return _0x129cc1[_0xd97e('0x22')]('Content-Range',_0x4d0596+'-'+_0x2c91c9+'/'+_0x4bd1c4)['json'](_0x27a561);}return null;};}function patchUpdates(_0x1a94a3){return function(_0x3f4b1e){try{jsonpatch[_0xd97e('0x23')](_0x3f4b1e,_0x1a94a3,!![]);}catch(_0x36adc0){return BPromise['reject'](_0x36adc0);}return _0x3f4b1e[_0xd97e('0x24')]();};}function saveUpdates(_0x416ea0,_0x364651){return function(_0x91385f){if(_0x91385f){return _0x91385f['update'](_0x416ea0)[_0xd97e('0x25')](function(_0x39b210){return _0x39b210;});}return null;};}function removeEntity(_0x2b1102,_0xcc3cbe){return function(_0x17650d){if(_0x17650d){return _0x17650d['destroy']()['then'](function(){_0x2b1102[_0xd97e('0x1b')](0xcc)[_0xd97e('0x1c')]();});}};}function handleEntityNotFound(_0x2b28e0,_0x426c8d){return function(_0x16bd25){if(!_0x16bd25){_0x2b28e0[_0xd97e('0x1a')](0x194);}return _0x16bd25;};}function handleError(_0x164998,_0x996db8){_0x996db8=_0x996db8||0x1f4;return function(_0x40978f){logger[_0xd97e('0x26')](_0x40978f[_0xd97e('0x27')]);if(_0x40978f['name']){delete _0x40978f[_0xd97e('0x28')];}_0x164998[_0xd97e('0x1b')](_0x996db8)['send'](_0x40978f);};}function getInteractionUsers(_0x1c787d,_0x33501e){return new BPromise(function(_0x2a0aea,_0xe6d8a1){try{if(_0x33501e[_0x1c787d['id']]){_0x1c787d['Users']=_[_0xd97e('0x29')](_0x33501e[_0x1c787d['id']],function(_0x573c40){return{'id':_0x573c40['id'],'fullname':_0x573c40[_0xd97e('0x2a')]};});}}catch(_0x5bb342){_0xe6d8a1(_0x5bb342);}_0x2a0aea(_0x1c787d);});}function getInteractionTags(_0x217aca,_0x217241){return new BPromise(function(_0x5efd1b,_0x27a901){try{if(_0x217aca[_0xd97e('0x2b')]){_0x217aca['Tags']=[];_0x217aca[_0xd97e('0x2b')][_0xd97e('0x2c')](',')[_0xd97e('0x2d')](function(_0x3c71b0){_0x217aca[_0xd97e('0x2e')][_0xd97e('0x2f')](_0x217241[_0x3c71b0]);});}delete _0x217aca[_0xd97e('0x2b')];}catch(_0x393756){_0x27a901(_0x393756);}_0x5efd1b(_0x217aca);});}function updateWhatsappInteraction(_0x19bf11,_0x238a61,_0x1d09ea){return new BPromise(function(_0x3059cf,_0x4c5cb5){return getInteractionUsers(_0x19bf11,_0x1d09ea)['then'](function(_0x2166b3){return getInteractionTags(_0x2166b3,_0x238a61);})[_0xd97e('0x25')](function(_0x19f349){_0x3059cf(_0x19f349);})['catch'](function(_0x178067){_0x4c5cb5(_0x178067);});});}exports[_0xd97e('0x30')]=function(_0x241139,_0x5098e8){var _0x5847d8={},_0x1bfb7a={},_0xc9755c={'count':0x0,'rows':[]};var _0x394023=_[_0xd97e('0x29')](db['WhatsappInteraction'][_0xd97e('0x31')],function(_0x616a85){return{'name':_0x616a85['fieldName'],'type':_0x616a85[_0xd97e('0x32')][_0xd97e('0x33')]};});_0x1bfb7a[_0xd97e('0x34')]=_[_0xd97e('0x29')](_0x394023,_0xd97e('0x28'));_0x1bfb7a[_0xd97e('0x35')]=_[_0xd97e('0x36')](_0x241139['query']);_0x1bfb7a[_0xd97e('0x37')]=_[_0xd97e('0x38')](_0x1bfb7a['model'],_0x1bfb7a[_0xd97e('0x35')]);_0x5847d8[_0xd97e('0x39')]=_['intersection'](_0x1bfb7a[_0xd97e('0x34')],qs['fields'](_0x241139['query'][_0xd97e('0x3a')]));_0x5847d8[_0xd97e('0x39')]=_0x5847d8[_0xd97e('0x39')][_0xd97e('0x3b')]?_0x5847d8[_0xd97e('0x39')]:_0x1bfb7a[_0xd97e('0x34')];if(!_0x241139['query']['hasOwnProperty'](_0xd97e('0x3c'))){_0x5847d8[_0xd97e('0x20')]=qs['limit'](_0x241139[_0xd97e('0x35')]['limit']);_0x5847d8[_0xd97e('0x1e')]=qs[_0xd97e('0x1e')](_0x241139[_0xd97e('0x35')][_0xd97e('0x1e')]);}_0x5847d8[_0xd97e('0x3d')]=qs[_0xd97e('0x3e')](_0x241139['query']['sort']);_0x5847d8[_0xd97e('0x3f')]=qs[_0xd97e('0x37')](_[_0xd97e('0x40')](_0x241139[_0xd97e('0x35')],_0x1bfb7a[_0xd97e('0x37')]),_0x394023);var _0x4ae16e=[];var _0x1e459e=squel[_0xd97e('0x41')]()[_0xd97e('0x42')]('id')[_0xd97e('0x42')]('name')[_0xd97e('0x42')](_0xd97e('0x43'))['from'](_0xd97e('0x44'));var _0x3768dc=squel[_0xd97e('0x41')]()[_0xd97e('0x42')](_0xd97e('0x45'))[_0xd97e('0x42')](_0xd97e('0x46'))[_0xd97e('0x42')](_0xd97e('0x47'))['from'](_0xd97e('0x48'),'ui')[_0xd97e('0x49')](_0xd97e('0x4a'),'u',_0xd97e('0x4b'));var _0x652b9f=squel[_0xd97e('0x41')]()[_0xd97e('0x4c')](_0xd97e('0x4d'),'i')[_0xd97e('0x49')]('cm_contacts','c',_0xd97e('0x4e'))[_0xd97e('0x49')](_0xd97e('0x4a'),'o',_0xd97e('0x4f'))[_0xd97e('0x49')](_0xd97e('0x50'),'a',_0xd97e('0x51'))[_0xd97e('0x49')](_0xd97e('0x52'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0xd97e('0x53'),'it',_0xd97e('0x54'))[_0xd97e('0x49')](_0xd97e('0x44'),'t',_0xd97e('0x55'));var _0x318e4d=squel[_0xd97e('0x56')]();var _0x45e6b8=[];var _0x3e9f48=squel[_0xd97e('0x56')]();var _0x51a5d8;if(_0x241139[_0xd97e('0x35')][_0xd97e('0x57')]){_0x51a5d8=as[_0xd97e('0x58')](_0x241139[_0xd97e('0x35')][_0xd97e('0x57')]);var _0x1b8d05=_0x51a5d8['sqlOperator'];for(var _0x55927f=0x0;_0x55927f<_0x51a5d8[_0xd97e('0x59')]['length'];_0x55927f++){var _0x21e080=_0x51a5d8[_0xd97e('0x59')][_0x55927f];var _0x1ed2b2='i';var _0x4b71fc=_[_0xd97e('0x5a')](_0x394023,[_0xd97e('0x28'),_0x21e080[_0xd97e('0x42')]]);if(!_0x4b71fc){switch(_0x21e080[_0xd97e('0x42')]){case _0xd97e('0x5b'):if(_0x21e080[_0xd97e('0x5c')]==0x1){_0x652b9f[_0xd97e('0x5d')]('`'+_0x21e080[_0xd97e('0x42')]+_0xd97e('0x5e'));}else{_0x652b9f['having']('`'+_0x21e080[_0xd97e('0x42')]+'`\x20>\x200');}break;case'Contact':if(_0x21e080['operator']===_0xd97e('0x5f')){if(_0x21e080['value'][_0xd97e('0x2c')]('\x20')[_0xd97e('0x3b')]>0x1){_0x318e4d[_0x1b8d05](_0xd97e('0x60'),qs[_0xd97e('0x61')](_0x21e080[_0xd97e('0x5c')]),null);}else{var _0x320db9='%'+_0x21e080[_0xd97e('0x5c')]+'%';_0x318e4d[_0x1b8d05]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x320db9,_0x320db9,_0x320db9);}}else{_0x4b71fc=_[_0xd97e('0x5a')](_0x394023,[_0xd97e('0x28'),_0xd97e('0x62')]);_0x21e080[_0xd97e('0x42')]=_0xd97e('0x62');_0x42124f=as[_0xd97e('0x63')](_0x1ed2b2,_0x4b71fc[_0xd97e('0x32')],_0x21e080);_0x318e4d[_0x1b8d05](_0x42124f[_0xd97e('0x64')],_0x42124f[_0xd97e('0x5c')][_0xd97e('0x65')],_0x42124f[_0xd97e('0x5c')][_0xd97e('0x1c')]);}break;case _0xd97e('0x66'):var _0x3fed65=_0x21e080[_0xd97e('0x5c')][_0xd97e('0x2c')](',')[_0xd97e('0x29')](function(_0x67cb3f){return Number(_0x67cb3f);});_0x3fed65[_0xd97e('0x2d')](function(_0x155003){_0x3e9f48['or'](_0xd97e('0x67'),'%,'+_0x155003+',%');});_0x45e6b8=_[_0xd97e('0x68')](_0x45e6b8,_0x3fed65);break;case _0xd97e('0x69'):if(_0x21e080['operator']===_0xd97e('0x5f')){_0x318e4d[_0x1b8d05]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x21e080[_0xd97e('0x5c')]+'%',null);}else{_0x4b71fc=_[_0xd97e('0x5a')](_0x394023,['name','UserId']);_0x21e080['field']=_0xd97e('0x6a');_0x42124f=as[_0xd97e('0x63')](_0x1ed2b2,_0x4b71fc[_0xd97e('0x32')],_0x21e080);_0x318e4d[_0x1b8d05](_0x42124f[_0xd97e('0x64')],_0x42124f[_0xd97e('0x5c')][_0xd97e('0x65')],_0x42124f['value'][_0xd97e('0x1c')]);}break;case _0xd97e('0x6b'):_0x42124f=as[_0xd97e('0x63')]('me',null,_0x21e080);_0x318e4d[_0x1b8d05](_0x42124f['text'],_0x42124f[_0xd97e('0x5c')][_0xd97e('0x65')],_0x42124f[_0xd97e('0x5c')]['end']);break;}}else{var _0x42124f=as['buildExpression'](_0x1ed2b2,_0x4b71fc[_0xd97e('0x32')],_0x21e080);_0x318e4d[_0x1b8d05](_0x42124f[_0xd97e('0x64')],_0x42124f[_0xd97e('0x5c')][_0xd97e('0x65')],_0x42124f[_0xd97e('0x5c')]['end']);}}}else{var _0x3171d3=_(_0x241139[_0xd97e('0x35')])[_0xd97e('0x36')]()['map'](function(_0x2a00e8){return _[_0xd97e('0x6c')](_0x394023,[_0xd97e('0x28'),_0x2a00e8])?_0x2a00e8:undefined;})[_0xd97e('0x6d')]()[_0xd97e('0x5c')]();if(!_[_0xd97e('0x6e')](_0x3171d3)){_0x3171d3[_0xd97e('0x2d')](function(_0x5a1f7d){if(_0x5a1f7d===_0xd97e('0x6f')){_0x652b9f[_0xd97e('0x3f')](_0xd97e('0x70'),[]['concat'](_0x241139['query'][_0x5a1f7d]));}else if(_0x5a1f7d===_0xd97e('0x71')){var _0x4d7d5d=JSON[_0xd97e('0x72')](_0x241139['query'][_0x5a1f7d])[_0xd97e('0x73')];var _0x3b6ba1=JSON[_0xd97e('0x72')](_0x241139[_0xd97e('0x35')][_0x5a1f7d])[_0xd97e('0x74')];_0x652b9f[_0xd97e('0x3f')](_0xd97e('0x75'),_0x4d7d5d,_0x3b6ba1);}else{if(_0x241139[_0xd97e('0x35')][_0x5a1f7d]===_0xd97e('0x76')){_0x652b9f['where']('i.'+_0x5a1f7d+'\x20IS\x20NULL');}else{_0x652b9f[_0xd97e('0x3f')]('i.'+_0x5a1f7d+_0xd97e('0x77'),_0x241139[_0xd97e('0x35')][_0x5a1f7d]);}}});}if(_0x241139[_0xd97e('0x35')][_0xd97e('0x78')]){if(_0x241139[_0xd97e('0x35')][_0xd97e('0x78')]==0x1){_0x652b9f[_0xd97e('0x5d')](_0xd97e('0x79'));}else{_0x652b9f[_0xd97e('0x5d')](_0xd97e('0x7a'));}}if(_0x241139[_0xd97e('0x35')]['tag']){_0x45e6b8=_[_0xd97e('0x7b')](_0x241139[_0xd97e('0x35')][_0xd97e('0x7c')])?_0x241139[_0xd97e('0x35')][_0xd97e('0x7c')]:new Array(_0x241139[_0xd97e('0x35')][_0xd97e('0x7c')]);_0x45e6b8[_0xd97e('0x2d')](function(_0x12dcc9){_0x3e9f48['or'](_0xd97e('0x67'),'%,'+_0x12dcc9+',%');});}if(_0x241139[_0xd97e('0x35')][_0xd97e('0x7d')]){var _0x578038=_0x241139[_0xd97e('0x35')][_0xd97e('0x7d')][_0xd97e('0x7e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd97e('0x7f')](_0x578038)){_0x318e4d['or'](_0xd97e('0x80'),_0x578038+'%')['or'](_0xd97e('0x81'),_0x578038+'%');}else{_0x318e4d['or'](_0xd97e('0x82'),qs[_0xd97e('0x61')](_0x578038))['or'](_0xd97e('0x83'),_0x578038+'%');}}}_0x652b9f[_0xd97e('0x3f')](_0x318e4d);_0x652b9f[_0xd97e('0x84')](_0xd97e('0x85'));var _0x2635f2={'type':db[_0xd97e('0x86')][_0xd97e('0x87')][_0xd97e('0x88')],'raw':!![]};var _0x56050b=_0x652b9f[_0xd97e('0x89')]();_0x56050b[_0xd97e('0x42')](_0xd97e('0x85'));_0x56050b[_0xd97e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd97e('0x5b'));if(_0x5847d8[_0xd97e('0x3d')]){_0x5847d8[_0xd97e('0x3d')][_0xd97e('0x2d')](function(_0x557a4c){var _0x510515=_0x557a4c[0x0]==='contactName'?_0x557a4c[0x0]:'i.'+_0x557a4c[0x0];_0x652b9f['order'](_0x510515,_0x557a4c[0x1]===_0xd97e('0x8a')?![]:!![]);});}if(!_[_0xd97e('0x6e')](_0x45e6b8)){_0x652b9f[_0xd97e('0x5d')](_0x3e9f48);_0x56050b[_0xd97e('0x3f')]('t.id\x20IN\x20?',_0x45e6b8);}BPromise['resolve']()[_0xd97e('0x25')](function(){if(!_0x51a5d8){if(_0x241139[_0xd97e('0x35')][_0xd97e('0x6f')])return;_0x56050b['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x652b9f['where'](_0xd97e('0x8b'));return;}if(_0x241139['user'][_0xd97e('0x8c')]!==_0xd97e('0x8d'))return;return _0x241139['user'][_0xd97e('0x8e')]({'attributes':['id'],'raw':!![]})[_0xd97e('0x25')](function(_0x424067){if(_[_0xd97e('0x6e')](_0x424067)){_0x56050b['where'](_0xd97e('0x8f'));_0x652b9f[_0xd97e('0x3f')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x56050b['where'](_0xd97e('0x70'),_[_0xd97e('0x29')](_0x424067,'id'));_0x652b9f[_0xd97e('0x3f')](_0xd97e('0x70'),_[_0xd97e('0x29')](_0x424067,'id'));}});})[_0xd97e('0x25')](function(){if(_0x241139[_0xd97e('0x90')][_0xd97e('0x8c')]===_0xd97e('0x8d')&&!_0x51a5d8&&!_0x241139[_0xd97e('0x35')][_0xd97e('0x6f')])return[];return db[_0xd97e('0x91')][_0xd97e('0x35')](_0x56050b[_0xd97e('0x92')](),_0x2635f2);})['then'](function(_0x30c8d2){_0xc9755c[_0xd97e('0x21')]=_0x30c8d2[_0xd97e('0x3b')];if(_0xc9755c['count']===0x0)return[];return db[_0xd97e('0x91')][_0xd97e('0x35')](_0x1e459e[_0xd97e('0x92')](),_0x2635f2)['then'](function(_0x501a60){_0x4ae16e=_[_0xd97e('0x93')](_0x501a60,'id');_0x2635f2=_[_0xd97e('0x94')](_0x2635f2,{'model':db[_0xd97e('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x241139['query']['fields']){_0x5847d8[_0xd97e('0x39')][_0xd97e('0x2d')](function(_0x2497af){_0x652b9f['field']('i.'+_0x2497af);});}else{_0x652b9f[_0xd97e('0x42')](_0xd97e('0x96'),'unreadMessages');_0x652b9f[_0xd97e('0x42')](_0xd97e('0x97'),_0xd97e('0x98'));_0x652b9f[_0xd97e('0x42')](_0xd97e('0x99'),'Account.mandatoryDisposition');_0x652b9f['field'](_0xd97e('0x9a'),_0xd97e('0x9b'));_0x652b9f[_0xd97e('0x42')](_0xd97e('0x9c'));_0x652b9f[_0xd97e('0x42')](_0xd97e('0x9d'),_0xd97e('0x9e'));_0x652b9f[_0xd97e('0x42')](_0xd97e('0x9f'),_0xd97e('0xa0'));_0x652b9f['field'](_0xd97e('0xa1'),_0xd97e('0xa2'));_0x652b9f['field'](_0xd97e('0xa3'),_0xd97e('0xa4'));_0x652b9f[_0xd97e('0x42')](_0xd97e('0xa5'),_0xd97e('0xa6'));_0x652b9f['field'](_0xd97e('0xa7'),_0xd97e('0xa8'));_0x652b9f[_0xd97e('0x42')](_0xd97e('0xa9'),_0xd97e('0xaa'));_0x652b9f[_0xd97e('0x42')](_0xd97e('0xab'),_0xd97e('0xac'));_0x652b9f['field'](_0xd97e('0xad'),_0xd97e('0x2b'));}if(_0x5847d8[_0xd97e('0x20')])_0x652b9f[_0xd97e('0x20')](_0x5847d8[_0xd97e('0x20')]);if(_0x5847d8[_0xd97e('0x1e')])_0x652b9f[_0xd97e('0x1e')](_0x5847d8[_0xd97e('0x1e')]);return db[_0xd97e('0x91')][_0xd97e('0x35')](_0x652b9f[_0xd97e('0x92')](),_0x2635f2);})[_0xd97e('0x25')](function(_0x4957a6){if(_0x4957a6[_0xd97e('0x3b')]>0x0)_0x3768dc[_0xd97e('0x3f')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x4957a6,'id'));return db[_0xd97e('0x91')][_0xd97e('0x35')](_0x3768dc[_0xd97e('0x92')](),_0x2635f2)[_0xd97e('0x25')](function(_0x315ab6){var _0x270f56=_[_0xd97e('0xae')](_0x315ab6,_0xd97e('0xaf'));var _0x3ac59c=[];_0x4957a6[_0xd97e('0x2d')](function(_0x23fd27){_0x3ac59c['push'](updateWhatsappInteraction(_0x23fd27,_0x4ae16e,_0x270f56));});return BPromise[_0xd97e('0xb0')](_0x3ac59c);});});})[_0xd97e('0x25')](function(_0x151c0f){_0xc9755c[_0xd97e('0xb1')]=_0x151c0f;return _0xc9755c;})[_0xd97e('0x25')](respondWithFilteredResult(_0x5098e8,_0x5847d8))[_0xd97e('0xb2')](handleError(_0x5098e8,null));};exports[_0xd97e('0xb3')]=function(_0x3e3125,_0x3ce7d1){var _0x512395={'raw':![],'where':{'id':_0x3e3125[_0xd97e('0xb4')]['id']}},_0x2e405b={};_0x2e405b[_0xd97e('0x34')]=_[_0xd97e('0x36')](db[_0xd97e('0x95')][_0xd97e('0x31')]);_0x2e405b['query']=_['keys'](_0x3e3125['query']);_0x2e405b['filters']=_['intersection'](_0x2e405b['model'],_0x2e405b[_0xd97e('0x35')]);_0x512395[_0xd97e('0x39')]=_[_0xd97e('0x38')](_0x2e405b[_0xd97e('0x34')],qs['fields'](_0x3e3125[_0xd97e('0x35')][_0xd97e('0x3a')]));_0x512395[_0xd97e('0x39')]=_0x512395[_0xd97e('0x39')][_0xd97e('0x3b')]?_0x512395[_0xd97e('0x39')]:_0x2e405b[_0xd97e('0x34')];if(_0x3e3125['query'][_0xd97e('0xb5')]){_0x512395[_0xd97e('0xb6')]=[{'all':!![]}];}_0x512395=_[_0xd97e('0x94')]({},_0x512395,_0x3e3125[_0xd97e('0xb7')]);return db[_0xd97e('0x95')][_0xd97e('0x5a')](_0x512395)['then'](handleEntityNotFound(_0x3ce7d1,null))['then'](respondWithResult(_0x3ce7d1,null))['catch'](handleError(_0x3ce7d1,null));};exports[_0xd97e('0xb8')]=function(_0x49905d,_0x1d4d9c){return db['WhatsappInteraction']['create'](_0x49905d[_0xd97e('0x6b')],{})[_0xd97e('0x25')](respondWithResult(_0x1d4d9c,0xc9))[_0xd97e('0xb2')](handleError(_0x1d4d9c,null));};exports['update']=function(_0x429a0b,_0x26bc5c){if(_0x429a0b['body']['id']){delete _0x429a0b[_0xd97e('0x6b')]['id'];}return db['WhatsappInteraction'][_0xd97e('0x5a')]({'where':{'id':_0x429a0b[_0xd97e('0xb4')]['id']}})[_0xd97e('0x25')](handleEntityNotFound(_0x26bc5c,null))[_0xd97e('0x25')](saveUpdates(_0x429a0b[_0xd97e('0x6b')],null))['then'](respondWithResult(_0x26bc5c,null))[_0xd97e('0xb2')](handleError(_0x26bc5c,null));};exports['destroy']=function(_0x580556,_0x8484ce){return db[_0xd97e('0x95')][_0xd97e('0x5a')]({'where':{'id':_0x580556['params']['id']}})[_0xd97e('0x25')](handleEntityNotFound(_0x8484ce,null))[_0xd97e('0x25')](removeEntity(_0x8484ce,null))['catch'](handleError(_0x8484ce,null));};exports['describe']=function(_0x43ec65,_0x5ae273){return db[_0xd97e('0x95')][_0xd97e('0xb9')]()[_0xd97e('0x25')](respondWithResult(_0x5ae273,null))[_0xd97e('0xb2')](handleError(_0x5ae273,null));};exports['addMessage']=function(_0x391a81,_0x26183e,_0x42c9ab){return db[_0xd97e('0xba')][_0xd97e('0x5a')]({'where':{'id':_0x391a81[_0xd97e('0xb4')]['id']}})['then'](handleEntityNotFound(_0x26183e,null))[_0xd97e('0x25')](function(_0x57817f){if(_0x57817f){return _0x57817f['addMessage'](_0x391a81[_0xd97e('0x6b')][_0xd97e('0xbb')],_[_0xd97e('0xbc')](_0x391a81['body'],[_0xd97e('0xbb'),'id'])||{});}})[_0xd97e('0x25')](respondWithResult(_0x26183e,null))[_0xd97e('0xb2')](handleError(_0x26183e,null));};exports[_0xd97e('0xbd')]=function(_0x3d4c63,_0x76b9af,_0x448406){var _0x5c7a92={'raw':![],'where':{}};var _0x341146={};var _0x3760f9={'count':0x0,'rows':[]};return db[_0xd97e('0x95')][_0xd97e('0xbe')]({'where':{'id':_0x3d4c63[_0xd97e('0xb4')]['id']}})[_0xd97e('0x25')](handleEntityNotFound(_0x76b9af,null))['then'](function(_0xacaaa6){if(_0xacaaa6){_0x341146[_0xd97e('0x34')]=_[_0xd97e('0x36')](db['WhatsappMessage']['rawAttributes']);_0x341146[_0xd97e('0x35')]=_[_0xd97e('0x36')](_0x3d4c63[_0xd97e('0x35')]);_0x341146[_0xd97e('0x37')]=_['intersection'](_0x341146[_0xd97e('0x34')],_0x341146['query']);_0x5c7a92[_0xd97e('0x39')]=_['intersection'](_0x341146[_0xd97e('0x34')],qs['fields'](_0x3d4c63[_0xd97e('0x35')]['fields']));_0x5c7a92[_0xd97e('0x39')]=_0x5c7a92['attributes'][_0xd97e('0x3b')]?_0x5c7a92[_0xd97e('0x39')]:_0x341146[_0xd97e('0x34')];if(!_0x3d4c63[_0xd97e('0x35')]['hasOwnProperty'](_0xd97e('0x3c'))){_0x5c7a92[_0xd97e('0x20')]=qs['limit'](_0x3d4c63[_0xd97e('0x35')]['limit']);_0x5c7a92['offset']=qs[_0xd97e('0x1e')](_0x3d4c63[_0xd97e('0x35')]['offset']);}_0x5c7a92[_0xd97e('0x3d')]=qs[_0xd97e('0x3e')](_0x3d4c63[_0xd97e('0x35')][_0xd97e('0x3e')]);_0x5c7a92[_0xd97e('0x3f')]=qs[_0xd97e('0x37')](_[_0xd97e('0x40')](_0x3d4c63['query'],_0x341146[_0xd97e('0x37')]));_0x5c7a92['where']['WhatsappInteractionId']=_0xacaaa6['id'];if(_0x3d4c63[_0xd97e('0x35')][_0xd97e('0x7d')]){_0x5c7a92[_0xd97e('0x3f')]=_[_0xd97e('0x94')](_0x5c7a92[_0xd97e('0x3f')],{'$or':_[_0xd97e('0x29')](_0x5c7a92[_0xd97e('0x39')],function(_0x39369a){var _0x545434={};_0x545434[_0x39369a]={'$like':'%'+_0x3d4c63[_0xd97e('0x35')]['filter']+'%'};return _0x545434;})});}if(_0x3d4c63[_0xd97e('0x35')][_0xd97e('0x73')]){var _0x5d362c=_0x3d4c63['query']['$gte']['split'](',');var _0x139c71={};_0x139c71[_0x5d362c[0x0]]={'$gte':moment(_0x5d362c[0x1])[_0xd97e('0xbf')](_0xd97e('0xc0'))};_0x5c7a92[_0xd97e('0x3f')]=_['merge'](_0x5c7a92['where'],_0x139c71);}_0x5c7a92=_[_0xd97e('0x94')]({},_0x5c7a92,_0x3d4c63[_0xd97e('0xb7')]);return db[_0xd97e('0xba')][_0xd97e('0x21')]({'where':_0x5c7a92['where']})[_0xd97e('0x25')](function(_0x513dd1){_0x3760f9[_0xd97e('0x21')]=_0x513dd1;if(_0x3d4c63[_0xd97e('0x35')][_0xd97e('0xb5')]){_0x5c7a92['include']=[{'all':!![]}];}return db[_0xd97e('0xba')][_0xd97e('0xc1')](_0x5c7a92);})[_0xd97e('0x25')](function(_0x3f8ae3){_0x3760f9[_0xd97e('0xb1')]=_0x3f8ae3;return _0x3760f9;});}})[_0xd97e('0x25')](respondWithFilteredResult(_0x76b9af,_0x5c7a92))[_0xd97e('0xb2')](handleError(_0x76b9af,null));};exports[_0xd97e('0xc2')]=function(_0x5b103f,_0x238c5b,_0x5b253a){return db[_0xd97e('0x95')]['find']({'where':{'id':_0x5b103f[_0xd97e('0xb4')]['id']}})[_0xd97e('0x25')](handleEntityNotFound(_0x238c5b,null))[_0xd97e('0x25')](function(_0x4c70f5){if(_0x4c70f5){return _0x4c70f5[_0xd97e('0xc3')](_0x5b103f[_0xd97e('0x6b')][_0xd97e('0xbb')],_[_0xd97e('0xbc')](_0x5b103f[_0xd97e('0x6b')],[_0xd97e('0xbb'),'id'])||{})[_0xd97e('0xc4')](function(){return db[_0xd97e('0x66')][_0xd97e('0xc1')]({'attributes':['id','name',_0xd97e('0x43')],'where':{'id':_0x5b103f[_0xd97e('0x6b')]['ids']}});})[_0xd97e('0x25')](function(_0x1c619b){socket[_0xd97e('0xc5')](_0xd97e('0xc6'),{'id':Number(_0x5b103f[_0xd97e('0xb4')]['id']),'tags':_0x1c619b||[]});return{'id':Number(_0x5b103f['params']['id']),'tags':_0x1c619b||[]};});}})[_0xd97e('0x25')](respondWithResult(_0x238c5b,null))[_0xd97e('0xb2')](handleError(_0x238c5b,null));};exports[_0xd97e('0xc7')]=function(_0x40e753,_0x561a62,_0x589cbb){return db[_0xd97e('0x95')]['find']({'where':{'id':_0x40e753[_0xd97e('0xb4')]['id']}})[_0xd97e('0x25')](handleEntityNotFound(_0x561a62,null))['then'](function(_0x1d4b9d){if(_0x1d4b9d){return _0x1d4b9d[_0xd97e('0xc7')](_0x40e753[_0xd97e('0x35')][_0xd97e('0xbb')]);}})[_0xd97e('0x25')](respondWithStatusCode(_0x561a62,null))[_0xd97e('0xb2')](handleError(_0x561a62,null));};exports[_0xd97e('0xc8')]=function(_0x523586,_0x771947){var _0x43efe5=moment()[_0xd97e('0xc9')]()['toString']();var _0x4c1c1f=path[_0xd97e('0xca')](config[_0xd97e('0xcb')],_0xd97e('0xcc'),_0xd97e('0xcd'),_0xd97e('0xce'));var _0x44e4e4=path['join'](config[_0xd97e('0xcb')],'server',_0xd97e('0xcd'),_0xd97e('0xcf'));var _0x1cbbdc=path[_0xd97e('0xca')](_0x4c1c1f,_0x43efe5);var _0x19db06=util[_0xd97e('0xbf')](_0xd97e('0xd0'),_0x523586[_0xd97e('0xb4')]['id'],_0x43efe5);var _0x323586=path[_0xd97e('0xca')](_0x4c1c1f,_0x19db06);var _0x1e6914=[];_0x1e6914['push']({'model':db[_0xd97e('0x69')],'as':_0xd97e('0x69'),'attributes':['id',_0xd97e('0x2a')],'raw':!![]});_0x1e6914[_0xd97e('0x2f')]({'model':db[_0xd97e('0xd1')],'as':'Contact','attributes':['id',_0xd97e('0xd2'),_0xd97e('0xd3')],'raw':!![]});if(_0x523586[_0xd97e('0x35')][_0xd97e('0xcf')]){_0x1e6914['push']({'model':db[_0xd97e('0xd4')],'as':_0xd97e('0xd4'),'raw':!![]});}var _0x5d3862=[{'model':db[_0xd97e('0xba')],'as':'Messages','attributes':['id',_0xd97e('0x6b'),_0xd97e('0x71'),_0xd97e('0xd5'),_0xd97e('0xd6'),_0xd97e('0x78')],'include':_0x1e6914}];_0x5d3862['push']({'model':db[_0xd97e('0xd7')],'as':'Account','attributes':['id',_0xd97e('0x28')]});_0x5d3862[_0xd97e('0x2f')]({'model':db[_0xd97e('0x69')],'as':'Owner','attributes':['id',_0xd97e('0x2a')]});return db['WhatsappInteraction'][_0xd97e('0x5a')]({'where':{'id':_0x523586[_0xd97e('0xb4')]['id']},'include':_0x5d3862})[_0xd97e('0x25')](handleEntityNotFound(_0x771947,null))[_0xd97e('0x25')](function(_0x50c8ba){if(_0x50c8ba){var _0x3a5ade=_0x50c8ba['get']({'plain':!![]});fs['mkdirSync'](_0x1cbbdc);var _0x76452f={'channel':_0xd97e('0xd8'),'account':_0x3a5ade['Account']['name'],'agent':_0x3a5ade['Owner']?_0x3a5ade[_0xd97e('0xd9')][_0xd97e('0x2a')]:_0xd97e('0xda'),'createdAt':moment(_0x3a5ade[_0xd97e('0x71')])[_0xd97e('0xbf')](_0xd97e('0xc0'))[_0xd97e('0x92')](),'closedAt':_0x3a5ade[_0xd97e('0xdb')]?moment(_0x3a5ade[_0xd97e('0xdc')])[_0xd97e('0xbf')](_0xd97e('0xc0'))[_0xd97e('0x92')]():'','disposition':_0x3a5ade[_0xd97e('0xdd')],'messages':_(_0x3a5ade[_0xd97e('0xde')])[_0xd97e('0x7d')]({'secret':![]})[_0xd97e('0x29')](function(_0x4bd0b4){if(_0x4bd0b4[_0xd97e('0xd4')]){var _0xd3d28=path['join'](_0x44e4e4,_0x4bd0b4[_0xd97e('0xd4')][_0xd97e('0xdf')]);if(fs['existsSync'](_0xd3d28)){fs[_0xd97e('0xe0')](_0xd3d28)[_0xd97e('0xe1')](fs[_0xd97e('0xe2')](path['join'](_0x1cbbdc,_0x4bd0b4[_0xd97e('0xd4')][_0xd97e('0xdf')])));}}return{'date':moment(_0x4bd0b4['createdAt'])[_0xd97e('0xbf')](_0xd97e('0xc0'))[_0xd97e('0x92')](),'sender':_0x4bd0b4[_0xd97e('0xd5')]==='out'?_0x4bd0b4[_0xd97e('0x69')]?_0x4bd0b4[_0xd97e('0x69')][_0xd97e('0x2a')]:_0xd97e('0xe3'):_0x4bd0b4['Contact'][_0xd97e('0xd2')]+(_0x4bd0b4[_0xd97e('0xe4')][_0xd97e('0xd3')]?'\x20'+_0x4bd0b4[_0xd97e('0xe4')][_0xd97e('0xd3')]:''),'body':_0x4bd0b4[_0xd97e('0xd4')]?_0x4bd0b4[_0xd97e('0xd4')][_0xd97e('0xdf')]:_0x4bd0b4[_0xd97e('0x6b')],'direction':_0x4bd0b4[_0xd97e('0xd5')]===_0xd97e('0xe5')?'A':'C','secret':_0x4bd0b4[_0xd97e('0xd6')],'read':_0x4bd0b4['read'],'attachment':_0x4bd0b4[_0xd97e('0xd4')]};})[_0xd97e('0x5c')]()};return ejs[_0xd97e('0xe6')](path[_0xd97e('0xca')](config['root'],_0xd97e('0xcc'),_0xd97e('0xe7'),_0xd97e('0xe8')),{'interaction':_0x76452f})[_0xd97e('0x25')](function(_0x1662e2){var _0x455b2d=path[_0xd97e('0xca')](_0x1cbbdc,_0xd97e('0xe9')+_0x3a5ade['id']+'-'+_0x43efe5+_0xd97e('0xea'));var _0x460387={'path':_0x455b2d,'channel':_0xd97e('0xd8'),'interactionId':_0x3a5ade['id']};return pdf['createPdfFromHTML'](_0x1662e2,_0x460387);})[_0xd97e('0x25')](function(){return new BPromise(function(_0x5c47e4,_0x47cb83){zipdir(_0x1cbbdc,{'saveTo':_0x323586},function(_0x4e2a7f,_0x215cad){if(_0x4e2a7f)return _0x47cb83(_0x4e2a7f);return _0x5c47e4(_0x215cad);});})[_0xd97e('0x25')](function(){return new BPromise(function(_0x2ccf4d,_0x4956f5){rimraf(_0x1cbbdc,function(_0x59cdfe){if(_0x59cdfe)_0x4956f5(_0x59cdfe);return _0x2ccf4d();});});})[_0xd97e('0x25')](function(){return _0x771947[_0xd97e('0xc8')](_0x323586,_0x19db06,function(_0x4c5933){if(_0x4c5933){console['log']('err',_0x4c5933);}else{fs[_0xd97e('0xeb')](_0x323586);}});});});}else{return _0x771947[_0xd97e('0x1a')](0xc8);}})[_0xd97e('0xb2')](handleError(_0x771947,null));}; \ No newline at end of file +var _0xa1fd=['offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','stack','send','map','TagIds','Tags','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','from','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','conditions','find','unreadMessages','value','having','`\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','ContactId','text','start','Tag','User','UserId','buildExpression','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','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','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','includeAll','include','create','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Messages','direction','WhatsappAccount','Account','Whatsapp','Owner','closed','closedAt','disposition','Attachment','existsSync','createReadStream','pipe','createWriteStream','System','Contact','out','secret','renderFile','transcript-','createPdfFromHTML','log','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x4ac5c1,_0x12f4bc){_0x4ac5c1=_0x4ac5c1-0x0;var _0x17c632=_0xa1fd[_0x4ac5c1];return _0x17c632;};'use strict';var emlformat=require(_0xda1f('0x0'));var rimraf=require(_0xda1f('0x1'));var zipdir=require(_0xda1f('0x2'));var jsonpatch=require(_0xda1f('0x3'));var rp=require('request-promise');var moment=require(_0xda1f('0x4'));var BPromise=require(_0xda1f('0x5'));var Mustache=require(_0xda1f('0x6'));var util=require(_0xda1f('0x7'));var path=require(_0xda1f('0x8'));var sox=require('sox');var csv=require(_0xda1f('0x9'));var ejs=require(_0xda1f('0xa'));var fs=require('fs');var fs_extra=require(_0xda1f('0xb'));var _=require('lodash');var squel=require(_0xda1f('0xc'));var crypto=require(_0xda1f('0xd'));var jsforce=require(_0xda1f('0xe'));var deskjs=require(_0xda1f('0xf'));var toCsv=require(_0xda1f('0x9'));var querystring=require(_0xda1f('0x10'));var Papa=require(_0xda1f('0x11'));var Redis=require(_0xda1f('0x12'));var authService=require(_0xda1f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xda1f('0x14'));var pdf=require(_0xda1f('0x15'));var hardwareService=require(_0xda1f('0x16'));var logger=require(_0xda1f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xda1f('0x18'));var licenseUtil=require(_0xda1f('0x19'));var db=require(_0xda1f('0x1a'))['db'];config[_0xda1f('0x1b')]=_[_0xda1f('0x1c')](config['redis'],{'host':_0xda1f('0x1d'),'port':0x18eb});var socket=require(_0xda1f('0x1e'))(new Redis(config[_0xda1f('0x1b')]));require(_0xda1f('0x1f'))[_0xda1f('0x20')](socket);function respondWithStatusCode(_0x3186c0,_0x518ebb){_0x518ebb=_0x518ebb||0xcc;return function(_0x77da5b){if(_0x77da5b){return _0x3186c0[_0xda1f('0x21')](_0x518ebb);}return _0x3186c0[_0xda1f('0x22')](_0x518ebb)[_0xda1f('0x23')]();};}function respondWithResult(_0x48f5d0,_0x534cbc){_0x534cbc=_0x534cbc||0xc8;return function(_0x3020ea){if(_0x3020ea){return _0x48f5d0['status'](_0x534cbc)[_0xda1f('0x24')](_0x3020ea);}};}function respondWithFilteredResult(_0xec80f1,_0x1e10af){return function(_0x59b7bf){if(_0x59b7bf){var _0xe81fc2=typeof _0x1e10af[_0xda1f('0x25')]==='undefined'&&typeof _0x1e10af[_0xda1f('0x26')]===_0xda1f('0x27');var _0x5a790c=_0x59b7bf[_0xda1f('0x28')];var _0x23c5cd=_0xe81fc2?0x0:_0x1e10af[_0xda1f('0x25')];var _0xe85e94=_0xe81fc2?_0x59b7bf[_0xda1f('0x28')]:_0x1e10af[_0xda1f('0x25')]+_0x1e10af[_0xda1f('0x26')];var _0x6cd9a8;if(_0xe85e94>=_0x5a790c){_0xe85e94=_0x5a790c;_0x6cd9a8=0xc8;}else{_0x6cd9a8=0xce;}_0xec80f1[_0xda1f('0x22')](_0x6cd9a8);return _0xec80f1[_0xda1f('0x29')](_0xda1f('0x2a'),_0x23c5cd+'-'+_0xe85e94+'/'+_0x5a790c)[_0xda1f('0x24')](_0x59b7bf);}return null;};}function patchUpdates(_0x59baa0){return function(_0x39c1ad){try{jsonpatch['apply'](_0x39c1ad,_0x59baa0,!![]);}catch(_0x443fa1){return BPromise['reject'](_0x443fa1);}return _0x39c1ad[_0xda1f('0x2b')]();};}function saveUpdates(_0x2d209d,_0x4b1c7d){return function(_0x2cbdd8){if(_0x2cbdd8){return _0x2cbdd8[_0xda1f('0x2c')](_0x2d209d)[_0xda1f('0x2d')](function(_0x1cf1bc){return _0x1cf1bc;});}return null;};}function removeEntity(_0x1d5485,_0x5516e4){return function(_0x310d37){if(_0x310d37){return _0x310d37[_0xda1f('0x2e')]()[_0xda1f('0x2d')](function(){_0x1d5485[_0xda1f('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x142257,_0xeb3b45){return function(_0x4a994f){if(!_0x4a994f){_0x142257[_0xda1f('0x21')](0x194);}return _0x4a994f;};}function handleError(_0x51eeae,_0x34459d){_0x34459d=_0x34459d||0x1f4;return function(_0x4bf7cf){logger['error'](_0x4bf7cf[_0xda1f('0x2f')]);if(_0x4bf7cf['name']){delete _0x4bf7cf['name'];}_0x51eeae[_0xda1f('0x22')](_0x34459d)[_0xda1f('0x30')](_0x4bf7cf);};}function getInteractionUsers(_0x2188d9,_0x55d28c){return new BPromise(function(_0x44715d,_0x148d8e){try{if(_0x55d28c[_0x2188d9['id']]){_0x2188d9['Users']=_[_0xda1f('0x31')](_0x55d28c[_0x2188d9['id']],function(_0x518633){return{'id':_0x518633['id'],'fullname':_0x518633['fullname']};});}}catch(_0x4850d3){_0x148d8e(_0x4850d3);}_0x44715d(_0x2188d9);});}function getInteractionTags(_0x90a7a3,_0x7f3b78){return new BPromise(function(_0x239296,_0x5b0366){try{if(_0x90a7a3[_0xda1f('0x32')]){_0x90a7a3[_0xda1f('0x33')]=[];_0x90a7a3[_0xda1f('0x32')]['split'](',')[_0xda1f('0x34')](function(_0x53cbaa){_0x90a7a3[_0xda1f('0x33')][_0xda1f('0x35')](_0x7f3b78[_0x53cbaa]);});}delete _0x90a7a3[_0xda1f('0x32')];}catch(_0x1a6ce7){_0x5b0366(_0x1a6ce7);}_0x239296(_0x90a7a3);});}function updateWhatsappInteraction(_0x154e50,_0x5b52bf,_0x1cfc2d){return new BPromise(function(_0xc7c6de,_0xc0e6a3){return getInteractionUsers(_0x154e50,_0x1cfc2d)[_0xda1f('0x2d')](function(_0x497c00){return getInteractionTags(_0x497c00,_0x5b52bf);})[_0xda1f('0x2d')](function(_0x6ecd35){_0xc7c6de(_0x6ecd35);})[_0xda1f('0x36')](function(_0xfaba85){_0xc0e6a3(_0xfaba85);});});}exports[_0xda1f('0x37')]=function(_0x4b37d5,_0x101b11){var _0xcfb2c2={},_0x4609bb={},_0x1f5251={'count':0x0,'rows':[]};var _0x993ca2=_['map'](db[_0xda1f('0x38')][_0xda1f('0x39')],function(_0x1824ad){return{'name':_0x1824ad[_0xda1f('0x3a')],'type':_0x1824ad[_0xda1f('0x3b')]['key']};});_0x4609bb[_0xda1f('0x3c')]=_[_0xda1f('0x31')](_0x993ca2,_0xda1f('0x3d'));_0x4609bb[_0xda1f('0x3e')]=_[_0xda1f('0x3f')](_0x4b37d5[_0xda1f('0x3e')]);_0x4609bb[_0xda1f('0x40')]=_[_0xda1f('0x41')](_0x4609bb['model'],_0x4609bb[_0xda1f('0x3e')]);_0xcfb2c2[_0xda1f('0x42')]=_[_0xda1f('0x41')](_0x4609bb[_0xda1f('0x3c')],qs[_0xda1f('0x43')](_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x43')]));_0xcfb2c2['attributes']=_0xcfb2c2[_0xda1f('0x42')][_0xda1f('0x44')]?_0xcfb2c2[_0xda1f('0x42')]:_0x4609bb[_0xda1f('0x3c')];if(!_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x45')](_0xda1f('0x46'))){_0xcfb2c2[_0xda1f('0x26')]=qs[_0xda1f('0x26')](_0x4b37d5['query']['limit']);_0xcfb2c2[_0xda1f('0x25')]=qs[_0xda1f('0x25')](_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x25')]);}_0xcfb2c2['order']=qs[_0xda1f('0x47')](_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x47')]);_0xcfb2c2[_0xda1f('0x48')]=qs[_0xda1f('0x40')](_[_0xda1f('0x49')](_0x4b37d5['query'],_0x4609bb[_0xda1f('0x40')]),_0x993ca2);var _0x13a8b5=[];var _0x1e43d1=squel[_0xda1f('0x4a')]()[_0xda1f('0x4b')]('id')[_0xda1f('0x4b')](_0xda1f('0x3d'))[_0xda1f('0x4b')]('color')[_0xda1f('0x4c')]('tools_tags');var _0x17869a=squel[_0xda1f('0x4a')]()[_0xda1f('0x4b')]('u.id')[_0xda1f('0x4b')](_0xda1f('0x4d'))[_0xda1f('0x4b')](_0xda1f('0x4e'))['from'](_0xda1f('0x4f'),'ui')['left_join'](_0xda1f('0x50'),'u',_0xda1f('0x51'));var _0x175bcc=squel[_0xda1f('0x4a')]()[_0xda1f('0x4c')](_0xda1f('0x52'),'i')[_0xda1f('0x53')](_0xda1f('0x54'),'c',_0xda1f('0x55'))[_0xda1f('0x53')](_0xda1f('0x50'),'o',_0xda1f('0x56'))[_0xda1f('0x53')](_0xda1f('0x57'),'a',_0xda1f('0x58'))['left_join'](_0xda1f('0x59'),'me',_0xda1f('0x5a'))[_0xda1f('0x53')](_0xda1f('0x5b'),'it',_0xda1f('0x5c'))[_0xda1f('0x53')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x451711=squel[_0xda1f('0x5d')]();var _0x140eb1=[];var _0x217fbf=squel[_0xda1f('0x5d')]();var _0x4b71da;if(_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x5e')]){_0x4b71da=as['parseSearch'](_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x5e')]);var _0x4e1c1a=_0x4b71da['sqlOperator'];for(var _0xee525d=0x0;_0xee525d<_0x4b71da[_0xda1f('0x5f')][_0xda1f('0x44')];_0xee525d++){var _0x36d415=_0x4b71da[_0xda1f('0x5f')][_0xee525d];var _0x4fcc9e='i';var _0x2df9a1=_[_0xda1f('0x60')](_0x993ca2,['name',_0x36d415[_0xda1f('0x4b')]]);if(!_0x2df9a1){switch(_0x36d415['field']){case _0xda1f('0x61'):if(_0x36d415[_0xda1f('0x62')]==0x1){_0x175bcc[_0xda1f('0x63')]('`'+_0x36d415[_0xda1f('0x4b')]+_0xda1f('0x64'));}else{_0x175bcc[_0xda1f('0x63')]('`'+_0x36d415[_0xda1f('0x4b')]+_0xda1f('0x65'));}break;case'Contact':if(_0x36d415[_0xda1f('0x66')]===_0xda1f('0x67')){if(_0x36d415[_0xda1f('0x62')][_0xda1f('0x68')]('\x20')[_0xda1f('0x44')]>0x1){_0x451711[_0x4e1c1a](_0xda1f('0x69'),qs[_0xda1f('0x6a')](_0x36d415[_0xda1f('0x62')]),null);}else{var _0x232829='%'+_0x36d415[_0xda1f('0x62')]+'%';_0x451711[_0x4e1c1a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x232829,_0x232829,_0x232829);}}else{_0x2df9a1=_[_0xda1f('0x60')](_0x993ca2,[_0xda1f('0x3d'),_0xda1f('0x6b')]);_0x36d415[_0xda1f('0x4b')]='ContactId';_0x243bab=as['buildExpression'](_0x4fcc9e,_0x2df9a1['type'],_0x36d415);_0x451711[_0x4e1c1a](_0x243bab[_0xda1f('0x6c')],_0x243bab['value'][_0xda1f('0x6d')],_0x243bab['value'][_0xda1f('0x23')]);}break;case _0xda1f('0x6e'):var _0xa80cd2=_0x36d415[_0xda1f('0x62')][_0xda1f('0x68')](',')[_0xda1f('0x31')](function(_0x277723){return Number(_0x277723);});_0xa80cd2[_0xda1f('0x34')](function(_0x440297){_0x217fbf['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x440297+',%');});_0x140eb1=_['union'](_0x140eb1,_0xa80cd2);break;case _0xda1f('0x6f'):if(_0x36d415[_0xda1f('0x66')]===_0xda1f('0x67')){_0x451711[_0x4e1c1a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x36d415[_0xda1f('0x62')]+'%',null);}else{_0x2df9a1=_[_0xda1f('0x60')](_0x993ca2,['name',_0xda1f('0x70')]);_0x36d415[_0xda1f('0x4b')]=_0xda1f('0x70');_0x243bab=as[_0xda1f('0x71')](_0x4fcc9e,_0x2df9a1[_0xda1f('0x3b')],_0x36d415);_0x451711[_0x4e1c1a](_0x243bab[_0xda1f('0x6c')],_0x243bab[_0xda1f('0x62')]['start'],_0x243bab['value'][_0xda1f('0x23')]);}break;case _0xda1f('0x72'):_0x243bab=as[_0xda1f('0x71')]('me',null,_0x36d415);_0x451711[_0x4e1c1a](_0x243bab['text'],_0x243bab['value'][_0xda1f('0x6d')],_0x243bab[_0xda1f('0x62')]['end']);break;}}else{var _0x243bab=as['buildExpression'](_0x4fcc9e,_0x2df9a1[_0xda1f('0x3b')],_0x36d415);_0x451711[_0x4e1c1a](_0x243bab[_0xda1f('0x6c')],_0x243bab[_0xda1f('0x62')]['start'],_0x243bab['value'][_0xda1f('0x23')]);}}}else{var _0x4954ee=_(_0x4b37d5[_0xda1f('0x3e')])[_0xda1f('0x3f')]()[_0xda1f('0x31')](function(_0x127033){return _[_0xda1f('0x73')](_0x993ca2,[_0xda1f('0x3d'),_0x127033])?_0x127033:undefined;})[_0xda1f('0x74')]()['value']();if(!_[_0xda1f('0x75')](_0x4954ee)){_0x4954ee[_0xda1f('0x34')](function(_0x6e1a8d){if(_0x6e1a8d===_0xda1f('0x76')){_0x175bcc[_0xda1f('0x48')](_0xda1f('0x77'),[][_0xda1f('0x78')](_0x4b37d5[_0xda1f('0x3e')][_0x6e1a8d]));}else if(_0x6e1a8d==='createdAt'){var _0x502a88=JSON[_0xda1f('0x79')](_0x4b37d5[_0xda1f('0x3e')][_0x6e1a8d])[_0xda1f('0x7a')];var _0x3e41c8=JSON[_0xda1f('0x79')](_0x4b37d5[_0xda1f('0x3e')][_0x6e1a8d])[_0xda1f('0x7b')];_0x175bcc[_0xda1f('0x48')](_0xda1f('0x7c'),_0x502a88,_0x3e41c8);}else{if(_0x4b37d5[_0xda1f('0x3e')][_0x6e1a8d]===_0xda1f('0x7d')){_0x175bcc[_0xda1f('0x48')]('i.'+_0x6e1a8d+_0xda1f('0x7e'));}else{_0x175bcc['where']('i.'+_0x6e1a8d+_0xda1f('0x7f'),_0x4b37d5['query'][_0x6e1a8d]);}}});}if(_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x80')]){if(_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x80')]==0x1){_0x175bcc[_0xda1f('0x63')](_0xda1f('0x81'));}else{_0x175bcc[_0xda1f('0x63')](_0xda1f('0x82'));}}if(_0x4b37d5['query'][_0xda1f('0x83')]){_0x140eb1=_['isArray'](_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x83')])?_0x4b37d5['query']['tag']:new Array(_0x4b37d5['query']['tag']);_0x140eb1[_0xda1f('0x34')](function(_0x2af161){_0x217fbf['or'](_0xda1f('0x84'),'%,'+_0x2af161+',%');});}if(_0x4b37d5['query'][_0xda1f('0x85')]){var _0x57197c=_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x85')][_0xda1f('0x86')]('\x5c','\x5c\x5c')[_0xda1f('0x86')](/'/g,'\x27\x27');if(qs[_0xda1f('0x87')](_0x57197c)){_0x451711['or'](_0xda1f('0x88'),_0x57197c+'%')['or'](_0xda1f('0x89'),_0x57197c+'%');}else{_0x451711['or'](_0xda1f('0x8a'),qs['getFullTextValue'](_0x57197c))['or'](_0xda1f('0x8b'),_0x57197c+'%');}}}_0x175bcc[_0xda1f('0x48')](_0x451711);_0x175bcc[_0xda1f('0x8c')](_0xda1f('0x8d'));var _0x11324e={'type':db[_0xda1f('0x8e')][_0xda1f('0x8f')]['SELECT'],'raw':!![]};var _0x4cc6c3=_0x175bcc[_0xda1f('0x90')]();_0x4cc6c3[_0xda1f('0x4b')](_0xda1f('0x8d'));_0x4cc6c3['field'](_0xda1f('0x91'),'unreadMessages');if(_0xcfb2c2[_0xda1f('0x92')]){_0xcfb2c2[_0xda1f('0x92')]['forEach'](function(_0xbe9b33){var _0x2800cf=_0xbe9b33[0x0]===_0xda1f('0x93')?_0xbe9b33[0x0]:'i.'+_0xbe9b33[0x0];_0x175bcc[_0xda1f('0x92')](_0x2800cf,_0xbe9b33[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x140eb1)){_0x175bcc[_0xda1f('0x63')](_0x217fbf);_0x4cc6c3[_0xda1f('0x48')](_0xda1f('0x94'),_0x140eb1);}BPromise[_0xda1f('0x95')]()[_0xda1f('0x2d')](function(){if(!_0x4b71da){if(_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x76')])return;_0x4cc6c3[_0xda1f('0x48')](_0xda1f('0x96'));_0x175bcc[_0xda1f('0x48')](_0xda1f('0x96'));return;}if(_0x4b37d5[_0xda1f('0x97')][_0xda1f('0x98')]!==_0xda1f('0x99'))return;return _0x4b37d5['user'][_0xda1f('0x9a')]({'attributes':['id'],'raw':!![]})[_0xda1f('0x2d')](function(_0x3eb022){if(_[_0xda1f('0x75')](_0x3eb022)){_0x4cc6c3[_0xda1f('0x48')](_0xda1f('0x9b'));_0x175bcc[_0xda1f('0x48')](_0xda1f('0x9b'));}else{_0x4cc6c3[_0xda1f('0x48')](_0xda1f('0x77'),_[_0xda1f('0x31')](_0x3eb022,'id'));_0x175bcc['where'](_0xda1f('0x77'),_[_0xda1f('0x31')](_0x3eb022,'id'));}});})[_0xda1f('0x2d')](function(){if(_0x4b37d5[_0xda1f('0x97')][_0xda1f('0x98')]==='agent'&&!_0x4b71da&&!_0x4b37d5['query'][_0xda1f('0x76')])return[];return db[_0xda1f('0x9c')][_0xda1f('0x3e')](_0x4cc6c3[_0xda1f('0x9d')](),_0x11324e);})[_0xda1f('0x2d')](function(_0x5ad7ab){_0x1f5251['count']=_0x5ad7ab[_0xda1f('0x44')];if(_0x1f5251['count']===0x0)return[];return db[_0xda1f('0x9c')][_0xda1f('0x3e')](_0x1e43d1[_0xda1f('0x9d')](),_0x11324e)[_0xda1f('0x2d')](function(_0xe3c595){_0x13a8b5=_[_0xda1f('0x9e')](_0xe3c595,'id');_0x11324e=_[_0xda1f('0x9f')](_0x11324e,{'model':db[_0xda1f('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b37d5[_0xda1f('0x3e')][_0xda1f('0x43')]){_0xcfb2c2[_0xda1f('0x42')][_0xda1f('0x34')](function(_0x16d78b){_0x175bcc[_0xda1f('0x4b')]('i.'+_0x16d78b);});}else{_0x175bcc[_0xda1f('0x4b')](_0xda1f('0x91'),_0xda1f('0x61'));_0x175bcc[_0xda1f('0x4b')]('a.key',_0xda1f('0xa0'));_0x175bcc[_0xda1f('0x4b')](_0xda1f('0xa1'),'Account.mandatoryDisposition');_0x175bcc['field'](_0xda1f('0xa2'),'contactName');_0x175bcc[_0xda1f('0x4b')](_0xda1f('0xa3'));_0x175bcc[_0xda1f('0x4b')](_0xda1f('0xa4'),'Contact.firstName');_0x175bcc['field'](_0xda1f('0xa5'),_0xda1f('0xa6'));_0x175bcc[_0xda1f('0x4b')](_0xda1f('0xa7'),_0xda1f('0xa8'));_0x175bcc[_0xda1f('0x4b')](_0xda1f('0xa9'),_0xda1f('0xaa'));_0x175bcc['field'](_0xda1f('0xab'),'Contact.mobile');_0x175bcc[_0xda1f('0x4b')](_0xda1f('0xac'),_0xda1f('0xad'));_0x175bcc['field'](_0xda1f('0xae'),'Owner.fullname');_0x175bcc['field']('o.internal',_0xda1f('0xaf'));_0x175bcc[_0xda1f('0x4b')](_0xda1f('0xb0'),'TagIds');}if(_0xcfb2c2[_0xda1f('0x26')])_0x175bcc['limit'](_0xcfb2c2[_0xda1f('0x26')]);if(_0xcfb2c2[_0xda1f('0x25')])_0x175bcc[_0xda1f('0x25')](_0xcfb2c2[_0xda1f('0x25')]);return db['sequelize'][_0xda1f('0x3e')](_0x175bcc['toString'](),_0x11324e);})[_0xda1f('0x2d')](function(_0x45e979){if(_0x45e979[_0xda1f('0x44')]>0x0)_0x17869a[_0xda1f('0x48')](_0xda1f('0xb1'),_[_0xda1f('0x31')](_0x45e979,'id'));return db[_0xda1f('0x9c')][_0xda1f('0x3e')](_0x17869a[_0xda1f('0x9d')](),_0x11324e)[_0xda1f('0x2d')](function(_0x17666c){var _0x2fc96b=_[_0xda1f('0xb2')](_0x17666c,_0xda1f('0xb3'));var _0x2a3acb=[];_0x45e979[_0xda1f('0x34')](function(_0x36525f){_0x2a3acb[_0xda1f('0x35')](updateWhatsappInteraction(_0x36525f,_0x13a8b5,_0x2fc96b));});return BPromise[_0xda1f('0xb4')](_0x2a3acb);});});})[_0xda1f('0x2d')](function(_0x11b35d){_0x1f5251[_0xda1f('0xb5')]=_0x11b35d;return _0x1f5251;})[_0xda1f('0x2d')](respondWithFilteredResult(_0x101b11,_0xcfb2c2))['catch'](handleError(_0x101b11,null));};exports[_0xda1f('0xb6')]=function(_0x294c90,_0x370798){var _0x4d933c={'raw':![],'where':{'id':_0x294c90[_0xda1f('0xb7')]['id']}},_0xb93e80={};_0xb93e80['model']=_[_0xda1f('0x3f')](db[_0xda1f('0x38')][_0xda1f('0x39')]);_0xb93e80[_0xda1f('0x3e')]=_[_0xda1f('0x3f')](_0x294c90[_0xda1f('0x3e')]);_0xb93e80[_0xda1f('0x40')]=_['intersection'](_0xb93e80['model'],_0xb93e80[_0xda1f('0x3e')]);_0x4d933c[_0xda1f('0x42')]=_[_0xda1f('0x41')](_0xb93e80[_0xda1f('0x3c')],qs['fields'](_0x294c90[_0xda1f('0x3e')][_0xda1f('0x43')]));_0x4d933c['attributes']=_0x4d933c['attributes'][_0xda1f('0x44')]?_0x4d933c['attributes']:_0xb93e80['model'];if(_0x294c90[_0xda1f('0x3e')][_0xda1f('0xb8')]){_0x4d933c[_0xda1f('0xb9')]=[{'all':!![]}];}_0x4d933c=_['merge']({},_0x4d933c,_0x294c90['options']);return db[_0xda1f('0x38')]['find'](_0x4d933c)[_0xda1f('0x2d')](handleEntityNotFound(_0x370798,null))[_0xda1f('0x2d')](respondWithResult(_0x370798,null))[_0xda1f('0x36')](handleError(_0x370798,null));};exports['create']=function(_0x3e3959,_0x37b415){return db[_0xda1f('0x38')][_0xda1f('0xba')](_0x3e3959[_0xda1f('0x72')],{})[_0xda1f('0x2d')](respondWithResult(_0x37b415,0xc9))[_0xda1f('0x36')](handleError(_0x37b415,null));};exports[_0xda1f('0x2c')]=function(_0x461638,_0x1533fe){if(_0x461638[_0xda1f('0x72')]['id']){delete _0x461638['body']['id'];}return db[_0xda1f('0x38')][_0xda1f('0x60')]({'where':{'id':_0x461638[_0xda1f('0xb7')]['id']}})[_0xda1f('0x2d')](handleEntityNotFound(_0x1533fe,null))[_0xda1f('0x2d')](saveUpdates(_0x461638[_0xda1f('0x72')],null))[_0xda1f('0x2d')](respondWithResult(_0x1533fe,null))['catch'](handleError(_0x1533fe,null));};exports[_0xda1f('0x2e')]=function(_0x4ed438,_0x2067b9){return db[_0xda1f('0x38')][_0xda1f('0x60')]({'where':{'id':_0x4ed438['params']['id']}})[_0xda1f('0x2d')](handleEntityNotFound(_0x2067b9,null))[_0xda1f('0x2d')](removeEntity(_0x2067b9,null))['catch'](handleError(_0x2067b9,null));};exports[_0xda1f('0xbb')]=function(_0x5afa8c,_0x528a33){return db[_0xda1f('0x38')][_0xda1f('0xbb')]()[_0xda1f('0x2d')](respondWithResult(_0x528a33,null))[_0xda1f('0x36')](handleError(_0x528a33,null));};exports[_0xda1f('0xbc')]=function(_0x2b5f42,_0x463930,_0x1bccaf){return db['WhatsappMessage'][_0xda1f('0x60')]({'where':{'id':_0x2b5f42['params']['id']}})[_0xda1f('0x2d')](handleEntityNotFound(_0x463930,null))[_0xda1f('0x2d')](function(_0x1db747){if(_0x1db747){return _0x1db747['addMessage'](_0x2b5f42['body'][_0xda1f('0xbd')],_[_0xda1f('0xbe')](_0x2b5f42['body'],[_0xda1f('0xbd'),'id'])||{});}})[_0xda1f('0x2d')](respondWithResult(_0x463930,null))[_0xda1f('0x36')](handleError(_0x463930,null));};exports[_0xda1f('0xbf')]=function(_0x690662,_0x5bdd89,_0x43994c){var _0x12e98a={'raw':![],'where':{}};var _0x5b4814={};var _0x4fa395={'count':0x0,'rows':[]};return db[_0xda1f('0x38')][_0xda1f('0xc0')]({'where':{'id':_0x690662['params']['id']}})[_0xda1f('0x2d')](handleEntityNotFound(_0x5bdd89,null))[_0xda1f('0x2d')](function(_0x2baf11){if(_0x2baf11){_0x5b4814['model']=_[_0xda1f('0x3f')](db[_0xda1f('0xc1')][_0xda1f('0x39')]);_0x5b4814[_0xda1f('0x3e')]=_['keys'](_0x690662[_0xda1f('0x3e')]);_0x5b4814[_0xda1f('0x40')]=_[_0xda1f('0x41')](_0x5b4814[_0xda1f('0x3c')],_0x5b4814[_0xda1f('0x3e')]);_0x12e98a['attributes']=_[_0xda1f('0x41')](_0x5b4814[_0xda1f('0x3c')],qs[_0xda1f('0x43')](_0x690662['query'][_0xda1f('0x43')]));_0x12e98a[_0xda1f('0x42')]=_0x12e98a[_0xda1f('0x42')]['length']?_0x12e98a[_0xda1f('0x42')]:_0x5b4814[_0xda1f('0x3c')];if(!_0x690662['query'][_0xda1f('0x45')](_0xda1f('0x46'))){_0x12e98a['limit']=qs['limit'](_0x690662['query'][_0xda1f('0x26')]);_0x12e98a['offset']=qs['offset'](_0x690662[_0xda1f('0x3e')][_0xda1f('0x25')]);}_0x12e98a['order']=qs[_0xda1f('0x47')](_0x690662[_0xda1f('0x3e')][_0xda1f('0x47')]);_0x12e98a['where']=qs[_0xda1f('0x40')](_[_0xda1f('0x49')](_0x690662[_0xda1f('0x3e')],_0x5b4814[_0xda1f('0x40')]));_0x12e98a[_0xda1f('0x48')][_0xda1f('0xb3')]=_0x2baf11['id'];if(_0x690662[_0xda1f('0x3e')]['filter']){_0x12e98a[_0xda1f('0x48')]=_[_0xda1f('0x9f')](_0x12e98a[_0xda1f('0x48')],{'$or':_[_0xda1f('0x31')](_0x12e98a['attributes'],function(_0x48bfa4){var _0x26d468={};_0x26d468[_0x48bfa4]={'$like':'%'+_0x690662[_0xda1f('0x3e')]['filter']+'%'};return _0x26d468;})});}if(_0x690662[_0xda1f('0x3e')]['$gte']){var _0x46d0b7=_0x690662[_0xda1f('0x3e')][_0xda1f('0x7a')][_0xda1f('0x68')](',');var _0xc841e3={};_0xc841e3[_0x46d0b7[0x0]]={'$gte':moment(_0x46d0b7[0x1])['format'](_0xda1f('0xc2'))};_0x12e98a[_0xda1f('0x48')]=_[_0xda1f('0x9f')](_0x12e98a[_0xda1f('0x48')],_0xc841e3);}_0x12e98a=_['merge']({},_0x12e98a,_0x690662[_0xda1f('0xc3')]);return db[_0xda1f('0xc1')][_0xda1f('0x28')]({'where':_0x12e98a[_0xda1f('0x48')]})[_0xda1f('0x2d')](function(_0x2f8851){_0x4fa395[_0xda1f('0x28')]=_0x2f8851;if(_0x690662[_0xda1f('0x3e')][_0xda1f('0xb8')]){_0x12e98a['include']=[{'all':!![]}];}return db[_0xda1f('0xc1')][_0xda1f('0xc4')](_0x12e98a);})[_0xda1f('0x2d')](function(_0x6a4d57){_0x4fa395[_0xda1f('0xb5')]=_0x6a4d57;return _0x4fa395;});}})[_0xda1f('0x2d')](respondWithFilteredResult(_0x5bdd89,_0x12e98a))['catch'](handleError(_0x5bdd89,null));};exports[_0xda1f('0xc5')]=function(_0x2b1673,_0x103e5e,_0x586f24){return db[_0xda1f('0x38')][_0xda1f('0x60')]({'where':{'id':_0x2b1673['params']['id']}})[_0xda1f('0x2d')](handleEntityNotFound(_0x103e5e,null))['then'](function(_0x4ec66a){if(_0x4ec66a){return _0x4ec66a[_0xda1f('0xc6')](_0x2b1673[_0xda1f('0x72')][_0xda1f('0xbd')],_[_0xda1f('0xbe')](_0x2b1673[_0xda1f('0x72')],[_0xda1f('0xbd'),'id'])||{})[_0xda1f('0xc7')](function(){return db[_0xda1f('0x6e')][_0xda1f('0xc4')]({'attributes':['id','name','color'],'where':{'id':_0x2b1673[_0xda1f('0x72')]['ids']}});})[_0xda1f('0x2d')](function(_0x59c41a){socket[_0xda1f('0xc8')](_0xda1f('0xc9'),{'id':Number(_0x2b1673[_0xda1f('0xb7')]['id']),'tags':_0x59c41a||[]});return{'id':Number(_0x2b1673['params']['id']),'tags':_0x59c41a||[]};});}})[_0xda1f('0x2d')](respondWithResult(_0x103e5e,null))[_0xda1f('0x36')](handleError(_0x103e5e,null));};exports[_0xda1f('0xca')]=function(_0x48eb99,_0x334a9a,_0x28f991){return db[_0xda1f('0x38')][_0xda1f('0x60')]({'where':{'id':_0x48eb99[_0xda1f('0xb7')]['id']}})[_0xda1f('0x2d')](handleEntityNotFound(_0x334a9a,null))[_0xda1f('0x2d')](function(_0x422330){if(_0x422330){return _0x422330[_0xda1f('0xca')](_0x48eb99[_0xda1f('0x3e')][_0xda1f('0xbd')]);}})[_0xda1f('0x2d')](respondWithStatusCode(_0x334a9a,null))['catch'](handleError(_0x334a9a,null));};exports[_0xda1f('0xcb')]=function(_0x36ae56,_0x5b28aa){var _0x45abb2=moment()[_0xda1f('0xcc')]()[_0xda1f('0x9d')]();var _0x1ea507=path[_0xda1f('0xcd')](config[_0xda1f('0xce')],'server',_0xda1f('0xcf'),_0xda1f('0xd0'));var _0x326a7b=path[_0xda1f('0xcd')](config[_0xda1f('0xce')],_0xda1f('0xd1'),_0xda1f('0xcf'),_0xda1f('0xd2'));var _0xeaa14=path['join'](_0x1ea507,_0x45abb2);var _0x3ce6ef=util[_0xda1f('0xd3')](_0xda1f('0xd4'),_0x36ae56[_0xda1f('0xb7')]['id'],_0x45abb2);var _0x4b272e=path[_0xda1f('0xcd')](_0x1ea507,_0x3ce6ef);var _0x37d207=[];_0x37d207[_0xda1f('0x35')]({'model':db[_0xda1f('0x6f')],'as':_0xda1f('0x6f'),'attributes':['id',_0xda1f('0xd5')],'raw':!![]});_0x37d207[_0xda1f('0x35')]({'model':db[_0xda1f('0xd6')],'as':'Contact','attributes':['id',_0xda1f('0xd7'),_0xda1f('0xd8')],'raw':!![]});if(_0x36ae56['query'][_0xda1f('0xd2')]){_0x37d207[_0xda1f('0x35')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3f3a3b=[{'model':db['WhatsappMessage'],'as':_0xda1f('0xd9'),'attributes':['id',_0xda1f('0x72'),'createdAt',_0xda1f('0xda'),'secret',_0xda1f('0x80')],'include':_0x37d207}];_0x3f3a3b[_0xda1f('0x35')]({'model':db[_0xda1f('0xdb')],'as':_0xda1f('0xdc'),'attributes':['id',_0xda1f('0x3d')]});_0x3f3a3b['push']({'model':db[_0xda1f('0x6f')],'as':'Owner','attributes':['id',_0xda1f('0xd5')]});return db['WhatsappInteraction'][_0xda1f('0x60')]({'where':{'id':_0x36ae56['params']['id']},'include':_0x3f3a3b})[_0xda1f('0x2d')](handleEntityNotFound(_0x5b28aa,null))['then'](function(_0x36dc93){if(_0x36dc93){var _0x40a234=_0x36dc93['get']({'plain':!![]});fs['mkdirSync'](_0xeaa14);var _0x4d95a1={'channel':_0xda1f('0xdd'),'account':_0x40a234[_0xda1f('0xdc')][_0xda1f('0x3d')],'agent':_0x40a234[_0xda1f('0xde')]?_0x40a234[_0xda1f('0xde')][_0xda1f('0xd5')]:'N.A.','createdAt':moment(_0x40a234['createdAt'])[_0xda1f('0xd3')](_0xda1f('0xc2'))[_0xda1f('0x9d')](),'closedAt':_0x40a234[_0xda1f('0xdf')]?moment(_0x40a234[_0xda1f('0xe0')])[_0xda1f('0xd3')](_0xda1f('0xc2'))[_0xda1f('0x9d')]():'','disposition':_0x40a234[_0xda1f('0xe1')],'messages':_(_0x40a234[_0xda1f('0xd9')])[_0xda1f('0x85')]({'secret':![]})['map'](function(_0x1e4bc1){if(_0x1e4bc1[_0xda1f('0xe2')]){var _0xb66676=path[_0xda1f('0xcd')](_0x326a7b,_0x1e4bc1['Attachment']['basename']);if(fs[_0xda1f('0xe3')](_0xb66676)){fs[_0xda1f('0xe4')](_0xb66676)[_0xda1f('0xe5')](fs[_0xda1f('0xe6')](path[_0xda1f('0xcd')](_0xeaa14,_0x1e4bc1[_0xda1f('0xe2')]['basename'])));}}return{'date':moment(_0x1e4bc1['createdAt'])['format'](_0xda1f('0xc2'))['toString'](),'sender':_0x1e4bc1[_0xda1f('0xda')]==='out'?_0x1e4bc1['User']?_0x1e4bc1[_0xda1f('0x6f')]['fullname']:_0xda1f('0xe7'):_0x1e4bc1['Contact']['firstName']+(_0x1e4bc1['Contact'][_0xda1f('0xd8')]?'\x20'+_0x1e4bc1[_0xda1f('0xe8')][_0xda1f('0xd8')]:''),'body':_0x1e4bc1[_0xda1f('0xe2')]?_0x1e4bc1[_0xda1f('0xe2')]['basename']:_0x1e4bc1[_0xda1f('0x72')],'direction':_0x1e4bc1[_0xda1f('0xda')]===_0xda1f('0xe9')?'A':'C','secret':_0x1e4bc1[_0xda1f('0xea')],'read':_0x1e4bc1[_0xda1f('0x80')],'attachment':_0x1e4bc1[_0xda1f('0xe2')]};})['value']()};return ejs[_0xda1f('0xeb')](path[_0xda1f('0xcd')](config[_0xda1f('0xce')],'server','views','downloadInteraction.ejs'),{'interaction':_0x4d95a1})[_0xda1f('0x2d')](function(_0x4ab528){var _0xd94a6a=path[_0xda1f('0xcd')](_0xeaa14,_0xda1f('0xec')+_0x40a234['id']+'-'+_0x45abb2+'.pdf');var _0x532ac0={'path':_0xd94a6a,'channel':_0xda1f('0xdd'),'interactionId':_0x40a234['id']};return pdf[_0xda1f('0xed')](_0x4ab528,_0x532ac0);})[_0xda1f('0x2d')](function(){return new BPromise(function(_0x209029,_0x53b279){zipdir(_0xeaa14,{'saveTo':_0x4b272e},function(_0xcb313e,_0x20cae0){if(_0xcb313e)return _0x53b279(_0xcb313e);return _0x209029(_0x20cae0);});})[_0xda1f('0x2d')](function(){return new BPromise(function(_0x32d7b7,_0x5770bc){rimraf(_0xeaa14,function(_0x84829e){if(_0x84829e)_0x5770bc(_0x84829e);return _0x32d7b7();});});})[_0xda1f('0x2d')](function(){return _0x5b28aa[_0xda1f('0xcb')](_0x4b272e,_0x3ce6ef,function(_0x508bbb){if(_0x508bbb){console[_0xda1f('0xee')]('err',_0x508bbb);}else{fs['unlinkSync'](_0x4b272e);}});});});}else{return _0x5b28aa[_0xda1f('0x21')](0xc8);}})[_0xda1f('0x36')](handleError(_0x5b28aa,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 64e14b5..f66c2dd 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 _0x2083=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x146db9,_0x15f231){var _0x1eeac2=function(_0x3ce0e0){while(--_0x3ce0e0){_0x146db9['push'](_0x146db9['shift']());}};_0x1eeac2(++_0x15f231);}(_0x2083,0x137));var _0x3208=function(_0x595e65,_0x4e1529){_0x595e65=_0x595e65-0x0;var _0xa42976=_0x2083[_0x595e65];return _0xa42976;};'use strict';var EventEmitter=require(_0x3208('0x0'));var WhatsappInteraction=require(_0x3208('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x3208('0x1'))['db'][_0x3208('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3208('0x3')](0x0);var events={'afterCreate':_0x3208('0x4'),'afterUpdate':_0x3208('0x5'),'afterDestroy':_0x3208('0x6')};function emitEvent(_0x1535fb){return function(_0x574345,_0x52318e,_0x5c8d7f){_0x574345[_0x3208('0x7')]({'attributes':['id'],'raw':!![]})[_0x3208('0x8')](function(_0x3d4b9d){_0x574345[_0x3208('0x9')]('Users',_0x3d4b9d[_0x3208('0xa')](function(_0x441a64){return{'id':_0x441a64['id']};}));return WhatsappMessage[_0x3208('0xb')]({'where':{'WhatsappInteractionId':_0x574345['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4e3bf7){_0x574345[_0x3208('0x9')](_0x3208('0xc'),_0x4e3bf7[_0x3208('0xd')]);WhatsappInteractionEvents[_0x3208('0xe')](_0x1535fb+':'+_0x574345['id'],_0x574345);WhatsappInteractionEvents['emit'](_0x1535fb,_0x574345);_0x5c8d7f(null);})['catch'](_0x5c8d7f(null));};}for(var e in events){if(events[_0x3208('0xf')](e)){var event=events[e];WhatsappInteraction[_0x3208('0x10')](e,emitEvent(event));}}module[_0x3208('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x9189=['WhatsappMessage','setMaxListeners','update','getUsers','then','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','WhatsappInteraction','../../mysqldb'];(function(_0x656c05,_0x1d4b18){var _0x28475a=function(_0x21ef6a){while(--_0x21ef6a){_0x656c05['push'](_0x656c05['shift']());}};_0x28475a(++_0x1d4b18);}(_0x9189,0x1b0));var _0x9918=function(_0x319d30,_0x191330){_0x319d30=_0x319d30-0x0;var _0x59f9f7=_0x9189[_0x319d30];return _0x59f9f7;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x9918('0x0')];var WhatsappMessage=require(_0x9918('0x1'))['db'][_0x9918('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9918('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9918('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cb5a2){return function(_0xfd91d2,_0x325957,_0x4a47d4){_0xfd91d2[_0x9918('0x5')]({'attributes':['id'],'raw':!![]})[_0x9918('0x6')](function(_0x7b8770){_0xfd91d2['setDataValue']('Users',_0x7b8770['map'](function(_0x46bef9){return{'id':_0x46bef9['id']};}));return WhatsappMessage[_0x9918('0x7')]({'where':{'WhatsappInteractionId':_0xfd91d2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x21f0ff){_0xfd91d2['setDataValue'](_0x9918('0x8'),_0x21f0ff[_0x9918('0x9')]);WhatsappInteractionEvents[_0x9918('0xa')](_0x4cb5a2+':'+_0xfd91d2['id'],_0xfd91d2);WhatsappInteractionEvents[_0x9918('0xa')](_0x4cb5a2,_0xfd91d2);_0x4a47d4(null);})[_0x9918('0xb')](_0x4a47d4(null));};}for(var e in events){if(events[_0x9918('0xc')](e)){var event=events[e];WhatsappInteraction[_0x9918('0xd')](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 3d79416..cfb26f7 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 _0x37c3=['bluebird','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x43d35d,_0xa2725e){var _0xf5f865=function(_0x53f593){while(--_0x53f593){_0x43d35d['push'](_0x43d35d['shift']());}};_0xf5f865(++_0xa2725e);}(_0x37c3,0x13b));var _0x337c=function(_0x38a417,_0x2c10c6){_0x38a417=_0x38a417-0x0;var _0x36408d=_0x37c3[_0x38a417];return _0x36408d;};'use strict';var _=require(_0x337c('0x0'));var util=require(_0x337c('0x1'));var logger=require(_0x337c('0x2'))(_0x337c('0x3'));var moment=require(_0x337c('0x4'));var BPromise=require(_0x337c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x337c('0x6'));var attributes=require(_0x337c('0x7'));module[_0x337c('0x8')]=function(_0x19a235,_0x3ed851){return _0x19a235[_0x337c('0x9')](_0x337c('0xa'),attributes,{'tableName':_0x337c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a964e,_0x3f9a56,_0x231f03){if(_0x5a964e[_0x337c('0xc')](_0x337c('0xd'))){_0x5a964e['closedAt']=moment()[_0x337c('0xe')](_0x337c('0xf'));}_0x231f03(null,_0x5a964e);}}});}; \ No newline at end of file +var _0x13cf=['moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api'];(function(_0x46e072,_0x13e36f){var _0x15d7ea=function(_0x436ca0){while(--_0x436ca0){_0x46e072['push'](_0x46e072['shift']());}};_0x15d7ea(++_0x13e36f);}(_0x13cf,0x13f));var _0xf13c=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x13cf[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xf13c('0x0'));var util=require(_0xf13c('0x1'));var logger=require(_0xf13c('0x2'))(_0xf13c('0x3'));var moment=require(_0xf13c('0x4'));var BPromise=require(_0xf13c('0x5'));var rp=require(_0xf13c('0x6'));var fs=require('fs');var path=require(_0xf13c('0x7'));var rimraf=require('rimraf');var config=require(_0xf13c('0x8'));var attributes=require(_0xf13c('0x9'));module['exports']=function(_0x55b903,_0xb3fc97){return _0x55b903[_0xf13c('0xa')](_0xf13c('0xb'),attributes,{'tableName':_0xf13c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31497d,_0x347b23,_0xde7d4b){if(_0x31497d[_0xf13c('0xd')](_0xf13c('0xe'))){_0x31497d[_0xf13c('0xf')]=moment()[_0xf13c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0xde7d4b(null,_0x31497d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 7af7384..c5bc4a7 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 _0x2c3f=['randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','stringify','catch','AddTagsToWhatsappInteraction','find','addTags','ids','omit','body','spread','AddTags','util','moment','bluebird'];(function(_0x38dbf0,_0x4f8a7f){var _0x1eb9df=function(_0x271fb9){while(--_0x271fb9){_0x38dbf0['push'](_0x38dbf0['shift']());}};_0x1eb9df(++_0x4f8a7f);}(_0x2c3f,0xa1));var _0xf2c3=function(_0x40a2ca,_0x8f2dae){_0x40a2ca=_0x40a2ca-0x0;var _0x5964f1=_0x2c3f[_0x40a2ca];return _0x5964f1;};'use strict';var _=require('lodash');var util=require(_0xf2c3('0x0'));var moment=require(_0xf2c3('0x1'));var BPromise=require(_0xf2c3('0x2'));var rs=require(_0xf2c3('0x3'));var fs=require('fs');var Redis=require(_0xf2c3('0x4'));var db=require(_0xf2c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2c3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf2c3('0x7'));var client=jayson[_0xf2c3('0x8')][_0xf2c3('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf2c3('0xa')],{'host':_0xf2c3('0xb'),'port':0x18eb});var socket=require(_0xf2c3('0xc'))(new Redis(config[_0xf2c3('0xa')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x165fc1,_0x1670d0,_0x27ab22){return new BPromise(function(_0x5ebfb3,_0x20f24f){return client[_0xf2c3('0xd')](_0x165fc1,_0x27ab22)[_0xf2c3('0xe')](function(_0x595e22){logger[_0xf2c3('0xf')](_0xf2c3('0x10'),_0x1670d0,'request\x20sent');logger[_0xf2c3('0x11')](_0xf2c3('0x12'),_0x1670d0,_0xf2c3('0x13'),JSON['stringify'](_0x595e22));if(_0x595e22[_0xf2c3('0x14')]){if(_0x595e22['error']['code']===0x1f4){logger[_0xf2c3('0x14')](_0xf2c3('0x10'),_0x1670d0,_0x595e22[_0xf2c3('0x14')][_0xf2c3('0x15')]);return _0x20f24f(_0x595e22[_0xf2c3('0x14')][_0xf2c3('0x15')]);}logger[_0xf2c3('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x1670d0,_0x595e22[_0xf2c3('0x14')][_0xf2c3('0x15')]);return _0x5ebfb3(_0x595e22[_0xf2c3('0x14')]['message']);}else{logger['info'](_0xf2c3('0x10'),_0x1670d0,_0xf2c3('0x13'));_0x5ebfb3(_0x595e22[_0xf2c3('0x16')][_0xf2c3('0x15')]);}})['catch'](function(_0x170916){logger[_0xf2c3('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x1670d0,_0x170916);_0x20f24f(_0x170916);});});}exports[_0xf2c3('0x17')]=function(_0x520ce9){var _0x1f21e3=this;return new Promise(function(_0x308e20,_0x57e9df){return db[_0xf2c3('0x18')][_0xf2c3('0x19')](_0x520ce9['body'],{'raw':_0x520ce9[_0xf2c3('0x1a')]?_0x520ce9[_0xf2c3('0x1a')][_0xf2c3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x520ce9[_0xf2c3('0x1a')]?_0x520ce9[_0xf2c3('0x1a')][_0xf2c3('0x1c')]||null:null,'attributes':_0x520ce9[_0xf2c3('0x1a')]?_0x520ce9['options'][_0xf2c3('0x1d')]||null:null,'limit':_0x520ce9[_0xf2c3('0x1a')]?_0x520ce9[_0xf2c3('0x1a')][_0xf2c3('0x1e')]||null:null})['then'](function(_0x53c685){logger[_0xf2c3('0xf')]('UpdateWhatsappInteraction',_0x520ce9);logger[_0xf2c3('0x11')](_0xf2c3('0x17'),_0x520ce9,JSON[_0xf2c3('0x1f')](_0x53c685));_0x308e20(_0x53c685);})[_0xf2c3('0x20')](function(_0x320305){logger['error']('UpdateWhatsappInteraction',_0x320305[_0xf2c3('0x15')],_0x520ce9);_0x57e9df(_0x1f21e3[_0xf2c3('0x14')](0x1f4,_0x320305[_0xf2c3('0x15')]));});});};exports[_0xf2c3('0x21')]=function(_0x437a18){return new Promise(function(_0x16939f,_0x361cfe){return db[_0xf2c3('0x18')][_0xf2c3('0x22')]({'where':_0x437a18['options']?_0x437a18[_0xf2c3('0x1a')]['where']||null:null})[_0xf2c3('0xe')](function(_0x414d3a){if(_0x414d3a){return _0x414d3a[_0xf2c3('0x23')](_0x437a18['body'][_0xf2c3('0x24')],_[_0xf2c3('0x25')](_0x437a18[_0xf2c3('0x26')],[_0xf2c3('0x24'),'id'])||{});}})[_0xf2c3('0x27')](function(_0x1303e2){logger[_0xf2c3('0xf')]('AddTags',_0x437a18);logger['debug'](_0xf2c3('0x28'),_0x437a18,JSON[_0xf2c3('0x1f')](_0x1303e2));_0x16939f(_0x1303e2);})['catch'](function(_0x682515){logger[_0xf2c3('0x14')]('AddTags',_0x682515[_0xf2c3('0x15')],_0x437a18);_0x361cfe(_this[_0xf2c3('0x14')](0x1f4,_0x682515[_0xf2c3('0x15')]));});});}; \ No newline at end of file +var _0xe3b4=['message','result','catch','WhatsappInteraction','update','body','options','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7e10d2,_0x14fcef){var _0x1d20f3=function(_0x149549){while(--_0x149549){_0x7e10d2['push'](_0x7e10d2['shift']());}};_0x1d20f3(++_0x14fcef);}(_0xe3b4,0x6a));var _0x4e3b=function(_0x1c2e00,_0x38eb90){_0x1c2e00=_0x1c2e00-0x0;var _0x15c27e=_0xe3b4[_0x1c2e00];return _0x15c27e;};'use strict';var _=require(_0x4e3b('0x0'));var util=require(_0x4e3b('0x1'));var moment=require(_0x4e3b('0x2'));var BPromise=require(_0x4e3b('0x3'));var rs=require(_0x4e3b('0x4'));var fs=require('fs');var Redis=require(_0x4e3b('0x5'));var db=require(_0x4e3b('0x6'))['db'];var utils=require(_0x4e3b('0x7'));var logger=require(_0x4e3b('0x8'))('rpc');var config=require(_0x4e3b('0x9'));var jayson=require(_0x4e3b('0xa'));var client=jayson[_0x4e3b('0xb')][_0x4e3b('0xc')]({'port':0x232a});config[_0x4e3b('0xd')]=_[_0x4e3b('0xe')](config[_0x4e3b('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4e3b('0xd')]));require(_0x4e3b('0xf'))['register'](socket);function respondWithRpcPromise(_0x308562,_0x547e6e,_0x46405e){return new BPromise(function(_0x245a5d,_0xbfc913){return client[_0x4e3b('0x10')](_0x308562,_0x46405e)[_0x4e3b('0x11')](function(_0x4afe87){logger[_0x4e3b('0x12')](_0x4e3b('0x13'),_0x547e6e,_0x4e3b('0x14'));logger[_0x4e3b('0x15')](_0x4e3b('0x16'),_0x547e6e,_0x4e3b('0x14'),JSON[_0x4e3b('0x17')](_0x4afe87));if(_0x4afe87['error']){if(_0x4afe87[_0x4e3b('0x18')][_0x4e3b('0x19')]===0x1f4){logger[_0x4e3b('0x18')](_0x4e3b('0x13'),_0x547e6e,_0x4afe87[_0x4e3b('0x18')][_0x4e3b('0x1a')]);return _0xbfc913(_0x4afe87[_0x4e3b('0x18')][_0x4e3b('0x1a')]);}logger['error'](_0x4e3b('0x13'),_0x547e6e,_0x4afe87[_0x4e3b('0x18')][_0x4e3b('0x1a')]);return _0x245a5d(_0x4afe87[_0x4e3b('0x18')][_0x4e3b('0x1a')]);}else{logger[_0x4e3b('0x12')](_0x4e3b('0x13'),_0x547e6e,_0x4e3b('0x14'));_0x245a5d(_0x4afe87[_0x4e3b('0x1b')]['message']);}})[_0x4e3b('0x1c')](function(_0x24ee9e){logger[_0x4e3b('0x18')](_0x4e3b('0x13'),_0x547e6e,_0x24ee9e);_0xbfc913(_0x24ee9e);});});}exports['UpdateWhatsappInteraction']=function(_0x1fade6){var _0x42ad1c=this;return new Promise(function(_0x20a426,_0x247523){return db[_0x4e3b('0x1d')][_0x4e3b('0x1e')](_0x1fade6[_0x4e3b('0x1f')],{'raw':_0x1fade6[_0x4e3b('0x20')]?_0x1fade6[_0x4e3b('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fade6[_0x4e3b('0x20')]?_0x1fade6[_0x4e3b('0x20')][_0x4e3b('0x21')]||null:null,'attributes':_0x1fade6[_0x4e3b('0x20')]?_0x1fade6[_0x4e3b('0x20')][_0x4e3b('0x22')]||null:null,'limit':_0x1fade6[_0x4e3b('0x20')]?_0x1fade6['options'][_0x4e3b('0x23')]||null:null})[_0x4e3b('0x11')](function(_0x6442eb){logger[_0x4e3b('0x12')](_0x4e3b('0x24'),_0x1fade6);logger[_0x4e3b('0x15')]('UpdateWhatsappInteraction',_0x1fade6,JSON[_0x4e3b('0x17')](_0x6442eb));_0x20a426(_0x6442eb);})[_0x4e3b('0x1c')](function(_0x28a294){logger[_0x4e3b('0x18')](_0x4e3b('0x24'),_0x28a294[_0x4e3b('0x1a')],_0x1fade6);_0x247523(_0x42ad1c[_0x4e3b('0x18')](0x1f4,_0x28a294[_0x4e3b('0x1a')]));});});};exports[_0x4e3b('0x25')]=function(_0x305b06){return new Promise(function(_0x2071ad,_0x4c2d8b){return db[_0x4e3b('0x1d')][_0x4e3b('0x26')]({'where':_0x305b06[_0x4e3b('0x20')]?_0x305b06[_0x4e3b('0x20')][_0x4e3b('0x21')]||null:null})[_0x4e3b('0x11')](function(_0x1d8c1d){if(_0x1d8c1d){return _0x1d8c1d[_0x4e3b('0x27')](_0x305b06[_0x4e3b('0x1f')]['ids'],_[_0x4e3b('0x28')](_0x305b06[_0x4e3b('0x1f')],[_0x4e3b('0x29'),'id'])||{});}})[_0x4e3b('0x2a')](function(_0x442ba1){logger[_0x4e3b('0x12')](_0x4e3b('0x2b'),_0x305b06);logger[_0x4e3b('0x15')](_0x4e3b('0x2b'),_0x305b06,JSON['stringify'](_0x442ba1));_0x2071ad(_0x442ba1);})['catch'](function(_0x5da328){logger[_0x4e3b('0x18')](_0x4e3b('0x2b'),_0x5da328[_0x4e3b('0x1a')],_0x305b06);_0x4c2d8b(_this[_0x4e3b('0x18')](0x1f4,_0x5da328[_0x4e3b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ea8014c..4fc17c4 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 _0x7201=['update','removeListener','register','./whatsappInteraction.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7201,0x1ad));var _0x1720=function(_0x3e7a94,_0x55733e){_0x3e7a94=_0x3e7a94-0x0;var _0x1c18f=_0x7201[_0x3e7a94];return _0x1c18f;};'use strict';var WhatsappInteractionEvents=require(_0x1720('0x0'));var events=[_0x1720('0x1'),_0x1720('0x2'),_0x1720('0x3')];function createListener(_0x441f44,_0x200d42){return function(_0x260ff0){_0x200d42['emit'](_0x441f44,_0x260ff0);};}function removeListener(_0x480c1a,_0x37a34b){return function(){WhatsappInteractionEvents[_0x1720('0x4')](_0x480c1a,_0x37a34b);};}exports[_0x1720('0x5')]=function(_0x4b630f){for(var _0x38a8a6=0x0,_0x3719f5=events['length'];_0x38a8a6<_0x3719f5;_0x38a8a6++){var _0x59a7b3=events[_0x38a8a6];var _0x54d74e=createListener('whatsappInteraction:'+_0x59a7b3,_0x4b630f);WhatsappInteractionEvents['on'](_0x59a7b3,_0x54d74e);}}; \ No newline at end of file +var _0xc13a=['save','remove','update','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x268fa0,_0x1ee87c){var _0x54efe0=function(_0x510327){while(--_0x510327){_0x268fa0['push'](_0x268fa0['shift']());}};_0x54efe0(++_0x1ee87c);}(_0xc13a,0x13f));var _0xac13=function(_0x192881,_0x20783a){_0x192881=_0x192881-0x0;var _0x1c01ec=_0xc13a[_0x192881];return _0x1c01ec;};'use strict';var WhatsappInteractionEvents=require(_0xac13('0x0'));var events=[_0xac13('0x1'),_0xac13('0x2'),_0xac13('0x3')];function createListener(_0x10705d,_0x44dfc8){return function(_0x19b4ad){_0x44dfc8['emit'](_0x10705d,_0x19b4ad);};}function removeListener(_0x27eca0,_0x1ef950){return function(){WhatsappInteractionEvents[_0xac13('0x4')](_0x27eca0,_0x1ef950);};}exports[_0xac13('0x5')]=function(_0x58c029){for(var _0xe3f761=0x0,_0x35c5b3=events[_0xac13('0x6')];_0xe3f761<_0x35c5b3;_0xe3f761++){var _0x1c1157=events[_0xe3f761];var _0xfd5fc1=createListener(_0xac13('0x7')+_0x1c1157,_0x58c029);WhatsappInteractionEvents['on'](_0x1c1157,_0xfd5fc1);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f294032..788577c 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 _0x0e4f=['destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappMessage.controller','get','isAuthenticated','describe','/:id','post','whatsapp','whatsappmessage:create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x2ae15f,_0x3e1860){var _0x42a3d3=function(_0xcd0e60){while(--_0xcd0e60){_0x2ae15f['push'](_0x2ae15f['shift']());}};_0x42a3d3(++_0x3e1860);}(_0x0e4f,0x10a));var _0xf0e4=function(_0x4fab6b,_0x2216b7){_0x4fab6b=_0x4fab6b-0x0;var _0x5aada4=_0x0e4f[_0x4fab6b];return _0x5aada4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0e4('0x0'));var timeout=require(_0xf0e4('0x1'));var express=require('express');var router=express[_0xf0e4('0x2')]();var fs_extra=require(_0xf0e4('0x3'));var auth=require(_0xf0e4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf0e4('0x5'));router[_0xf0e4('0x6')]('/',auth[_0xf0e4('0x7')](),controller['index']);router[_0xf0e4('0x6')]('/describe',auth[_0xf0e4('0x7')](),controller[_0xf0e4('0x8')]);router[_0xf0e4('0x6')](_0xf0e4('0x9'),auth[_0xf0e4('0x7')](),controller['show']);router[_0xf0e4('0xa')]('/',auth[_0xf0e4('0x7')](),interaction['tracked'](_0xf0e4('0xb'),_0xf0e4('0xc')),controller['create']);router['post'](_0xf0e4('0xd'),controller[_0xf0e4('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf0e4('0xf')]);router[_0xf0e4('0x10')](_0xf0e4('0x11'),auth[_0xf0e4('0x7')](),controller[_0xf0e4('0x12')]);router[_0xf0e4('0x10')](_0xf0e4('0x13'),auth[_0xf0e4('0x7')](),controller[_0xf0e4('0x14')]);router[_0xf0e4('0x15')]('/:id',auth[_0xf0e4('0x7')](),controller[_0xf0e4('0x16')]);module[_0xf0e4('0x17')]=router; \ No newline at end of file +var _0xe47c=['path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','whatsapp','whatsappmessage:create','create','post','/:id/status','status','put','update','accept','delete','exports','multer','util'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe47c,0x127));var _0xce47=function(_0x3cdd2f,_0x1c829e){_0x3cdd2f=_0x3cdd2f-0x0;var _0x59892b=_0xe47c[_0x3cdd2f];return _0x59892b;};'use strict';var multer=require(_0xce47('0x0'));var util=require(_0xce47('0x1'));var path=require(_0xce47('0x2'));var timeout=require(_0xce47('0x3'));var express=require('express');var router=express[_0xce47('0x4')]();var fs_extra=require(_0xce47('0x5'));var auth=require(_0xce47('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xce47('0x7'));router[_0xce47('0x8')]('/',auth[_0xce47('0x9')](),controller[_0xce47('0xa')]);router[_0xce47('0x8')](_0xce47('0xb'),auth[_0xce47('0x9')](),controller[_0xce47('0xc')]);router['get'](_0xce47('0xd'),auth[_0xce47('0x9')](),controller[_0xce47('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xce47('0xf')](_0xce47('0x10'),_0xce47('0x11')),controller[_0xce47('0x12')]);router[_0xce47('0x13')](_0xce47('0x14'),controller[_0xce47('0x15')]);router[_0xce47('0x16')](_0xce47('0xd'),auth[_0xce47('0x9')](),controller[_0xce47('0x17')]);router[_0xce47('0x16')]('/:id/accept',auth[_0xce47('0x9')](),controller[_0xce47('0x18')]);router[_0xce47('0x16')]('/:id/reject',auth[_0xce47('0x9')](),controller['reject']);router[_0xce47('0x19')]('/:id',auth[_0xce47('0x9')](),controller['destroy']);module[_0xce47('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 82d0a5a..5682ac4 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 _0x9997=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x7cd0f9,_0x751ec2){var _0x306825=function(_0xdce9b2){while(--_0xdce9b2){_0x7cd0f9['push'](_0x7cd0f9['shift']());}};_0x306825(++_0x751ec2);}(_0x9997,0xcb));var _0x7999=function(_0xd2f4ac,_0x5aa8e5){_0xd2f4ac=_0xd2f4ac-0x0;var _0x9757b2=_0x9997[_0xd2f4ac];return _0x9757b2;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7999('0x0')](_0x7999('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7999('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7999('0x3')]('in',_0x7999('0x4')),'defaultValue':_0x7999('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7999('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7999('0x5')]},'readAt':{'type':Sequelize[_0x7999('0x6')]},'secret':{'type':Sequelize[_0x7999('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7999('0x5')]},'providerResponse':{'type':Sequelize[_0x7999('0x0')]}}; \ No newline at end of file +var _0x3061=['out','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x4fa67a,_0x390b87){var _0x1d31d1=function(_0x38a598){while(--_0x38a598){_0x4fa67a['push'](_0x4fa67a['shift']());}};_0x1d31d1(++_0x390b87);}(_0x3061,0x176));var _0x1306=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x3061[_0x2a0350];return _0x425220;};'use strict';var Sequelize=require('sequelize');module[_0x1306('0x0')]={'body':{'type':Sequelize[_0x1306('0x1')](_0x1306('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1306('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1306('0x4')),'defaultValue':_0x1306('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1306('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1306('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1306('0x5')]},'providerResponse':{'type':Sequelize[_0x1306('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index ce6cc38..ad9e25d 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 _0x6511=['index','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','Sequelize','internal','interface','motionChannel','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','request','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','name','send'];(function(_0x51fe9a,_0x25b7f6){var _0x3cb5b6=function(_0x244b97){while(--_0x244b97){_0x51fe9a['push'](_0x51fe9a['shift']());}};_0x3cb5b6(++_0x25b7f6);}(_0x6511,0x164));var _0x1651=function(_0x39a387,_0x496459){_0x39a387=_0x39a387-0x0;var _0x4d9420=_0x6511[_0x39a387];return _0x4d9420;};'use strict';var emlformat=require(_0x1651('0x0'));var rimraf=require(_0x1651('0x1'));var zipdir=require(_0x1651('0x2'));var jsonpatch=require(_0x1651('0x3'));var rp=require(_0x1651('0x4'));var moment=require(_0x1651('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1651('0x6'));var util=require(_0x1651('0x7'));var path=require(_0x1651('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1651('0x9'));var _=require(_0x1651('0xa'));var squel=require(_0x1651('0xb'));var crypto=require(_0x1651('0xc'));var jsforce=require(_0x1651('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1651('0xe'));var querystring=require(_0x1651('0xf'));var Papa=require('papaparse');var Redis=require(_0x1651('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1651('0x11'));var as=require(_0x1651('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1651('0x13'))(_0x1651('0x14'));var utils=require(_0x1651('0x15'));var config=require(_0x1651('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1651('0x17')]=_[_0x1651('0x18')](config[_0x1651('0x17')],{'host':_0x1651('0x19'),'port':0x18eb});var socket=require(_0x1651('0x1a'))(new Redis(config[_0x1651('0x17')]));require(_0x1651('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1651('0x1c')][_0x1651('0x1d')]({'port':0x232c});var client9002=jayson[_0x1651('0x1c')][_0x1651('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x30cc09,_0x576857,_0x2c099d,_0x54df87){return new BPromise(function(_0x31220c,_0x11bb24){var _0x4a3f57=_0x54df87||client;return _0x4a3f57[_0x1651('0x1e')](_0x30cc09,_0x2c099d)['then'](function(_0x547052){logger[_0x1651('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x576857,_0x1651('0x20'));logger[_0x1651('0x21')](_0x1651('0x22'),_0x576857,_0x1651('0x20'),JSON['stringify'](_0x547052));if(_0x547052[_0x1651('0x23')]){if(_0x547052['error'][_0x1651('0x24')]===0x1f4){logger[_0x1651('0x23')](_0x1651('0x25'),_0x576857,_0x547052['error'][_0x1651('0x26')]);return _0x11bb24(_0x547052[_0x1651('0x23')][_0x1651('0x26')]);}logger[_0x1651('0x23')](_0x1651('0x25'),_0x576857,_0x547052[_0x1651('0x23')][_0x1651('0x26')]);return _0x31220c(_0x547052[_0x1651('0x23')][_0x1651('0x26')]);}else{logger[_0x1651('0x1f')](_0x1651('0x25'),_0x576857,_0x1651('0x20'));_0x31220c(_0x547052[_0x1651('0x27')]['message']);}})[_0x1651('0x28')](function(_0xe479e1){logger[_0x1651('0x23')](_0x1651('0x25'),_0x576857,_0xe479e1);_0x11bb24(_0xe479e1);});});}function respondWithStatusCode(_0x2ba081,_0x7309cc){_0x7309cc=_0x7309cc||0xcc;return function(_0x385fa1){if(_0x385fa1){return _0x2ba081[_0x1651('0x29')](_0x7309cc);}return _0x2ba081[_0x1651('0x2a')](_0x7309cc)[_0x1651('0x2b')]();};}function respondWithResult(_0x41e74e,_0x1581ec){_0x1581ec=_0x1581ec||0xc8;return function(_0x3ba9dd){if(_0x3ba9dd){return _0x41e74e[_0x1651('0x2a')](_0x1581ec)['json'](_0x3ba9dd);}};}function respondWithFilteredResult(_0x380711,_0x24d882){return function(_0x1b7776){if(_0x1b7776){var _0x23d4f6=typeof _0x24d882[_0x1651('0x2c')]===_0x1651('0x2d')&&typeof _0x24d882[_0x1651('0x2e')]===_0x1651('0x2d');var _0x32e963=_0x1b7776[_0x1651('0x2f')];var _0x7db16a=_0x23d4f6?0x0:_0x24d882[_0x1651('0x2c')];var _0x2afd7d=_0x23d4f6?_0x1b7776[_0x1651('0x2f')]:_0x24d882[_0x1651('0x2c')]+_0x24d882[_0x1651('0x2e')];var _0xf86269;if(_0x2afd7d>=_0x32e963){_0x2afd7d=_0x32e963;_0xf86269=0xc8;}else{_0xf86269=0xce;}_0x380711['status'](_0xf86269);return _0x380711[_0x1651('0x30')](_0x1651('0x31'),_0x7db16a+'-'+_0x2afd7d+'/'+_0x32e963)[_0x1651('0x32')](_0x1b7776);}return null;};}function patchUpdates(_0x3bf061){return function(_0x16cf1e){try{jsonpatch[_0x1651('0x33')](_0x16cf1e,_0x3bf061,!![]);}catch(_0x11a3fe){return BPromise[_0x1651('0x34')](_0x11a3fe);}return _0x16cf1e['save']();};}function saveUpdates(_0x1e59e7,_0x226854){return function(_0x1bdc23){if(_0x1bdc23){return _0x1bdc23[_0x1651('0x35')](_0x1e59e7)['then'](function(_0xd23b40){return _0xd23b40;});}return null;};}function removeEntity(_0x547e23,_0x325440){return function(_0x508229){if(_0x508229){return _0x508229[_0x1651('0x36')]()[_0x1651('0x37')](function(){_0x547e23[_0x1651('0x2a')](0xcc)[_0x1651('0x2b')]();});}};}function handleEntityNotFound(_0x398e48,_0x34e326){return function(_0x38836a){if(!_0x38836a){_0x398e48[_0x1651('0x29')](0x194);}return _0x38836a;};}function handleError(_0xeceab4,_0x48a652){_0x48a652=_0x48a652||0x1f4;return function(_0x42ae17){logger[_0x1651('0x23')](_0x42ae17['stack']);if(_0x42ae17[_0x1651('0x38')]){delete _0x42ae17['name'];}_0xeceab4['status'](_0x48a652)[_0x1651('0x39')](_0x42ae17);};}exports[_0x1651('0x3a')]=function(_0x3b651d,_0x1fed42){var _0x5019f4={},_0x33309e={},_0x1fc219={'count':0x0,'rows':[]};var _0x5288a9=_[_0x1651('0x3b')](db[_0x1651('0x3c')][_0x1651('0x3d')],function(_0x1c1e87){return{'name':_0x1c1e87[_0x1651('0x3e')],'type':_0x1c1e87[_0x1651('0x3f')][_0x1651('0x40')]};});_0x33309e['model']=_['map'](_0x5288a9,_0x1651('0x38'));_0x33309e[_0x1651('0x41')]=_[_0x1651('0x42')](_0x3b651d['query']);_0x33309e[_0x1651('0x43')]=_[_0x1651('0x44')](_0x33309e[_0x1651('0x45')],_0x33309e[_0x1651('0x41')]);_0x5019f4['attributes']=_[_0x1651('0x44')](_0x33309e[_0x1651('0x45')],qs['fields'](_0x3b651d['query'][_0x1651('0x46')]));_0x5019f4[_0x1651('0x47')]=_0x5019f4[_0x1651('0x47')]['length']?_0x5019f4[_0x1651('0x47')]:_0x33309e[_0x1651('0x45')];if(!_0x3b651d[_0x1651('0x41')][_0x1651('0x48')](_0x1651('0x49'))){_0x5019f4[_0x1651('0x2e')]=qs[_0x1651('0x2e')](_0x3b651d[_0x1651('0x41')]['limit']);_0x5019f4[_0x1651('0x2c')]=qs[_0x1651('0x2c')](_0x3b651d[_0x1651('0x41')][_0x1651('0x2c')]);}_0x5019f4[_0x1651('0x4a')]=qs[_0x1651('0x4b')](_0x3b651d[_0x1651('0x41')]['sort']);_0x5019f4[_0x1651('0x4c')]=qs[_0x1651('0x43')](_[_0x1651('0x4d')](_0x3b651d[_0x1651('0x41')],_0x33309e['filters']),_0x5288a9);if(_0x3b651d[_0x1651('0x41')][_0x1651('0x4e')]){_0x5019f4['where']=_[_0x1651('0x4f')](_0x5019f4['where'],{'$or':_[_0x1651('0x3b')](_0x5288a9,function(_0x440ae5){if(_0x440ae5['type']!==_0x1651('0x50')){var _0x1c2345={};_0x1c2345[_0x440ae5[_0x1651('0x38')]]={'$like':'%'+_0x3b651d[_0x1651('0x41')][_0x1651('0x4e')]+'%'};return _0x1c2345;}})});}_0x5019f4=_[_0x1651('0x4f')]({},_0x5019f4,_0x3b651d[_0x1651('0x51')]);var _0x47e851={'where':_0x5019f4['where']};return db[_0x1651('0x3c')][_0x1651('0x2f')](_0x47e851)[_0x1651('0x37')](function(_0x44d55b){_0x1fc219['count']=_0x44d55b;if(_0x3b651d['query'][_0x1651('0x52')]){_0x5019f4[_0x1651('0x53')]=[{'all':!![]}];}return db[_0x1651('0x3c')][_0x1651('0x54')](_0x5019f4);})['then'](function(_0x59b7ad){_0x1fc219[_0x1651('0x55')]=_0x59b7ad;return _0x1fc219;})[_0x1651('0x37')](respondWithFilteredResult(_0x1fed42,_0x5019f4))[_0x1651('0x28')](handleError(_0x1fed42,null));};exports[_0x1651('0x56')]=function(_0x2a387b,_0x7c2297){var _0x299e22={'raw':!![],'where':{'id':_0x2a387b[_0x1651('0x57')]['id']}},_0x194639={};_0x194639[_0x1651('0x45')]=_[_0x1651('0x42')](db[_0x1651('0x3c')][_0x1651('0x3d')]);_0x194639[_0x1651('0x41')]=_[_0x1651('0x42')](_0x2a387b[_0x1651('0x41')]);_0x194639[_0x1651('0x43')]=_[_0x1651('0x44')](_0x194639[_0x1651('0x45')],_0x194639[_0x1651('0x41')]);_0x299e22[_0x1651('0x47')]=_[_0x1651('0x44')](_0x194639[_0x1651('0x45')],qs[_0x1651('0x46')](_0x2a387b[_0x1651('0x41')][_0x1651('0x46')]));_0x299e22[_0x1651('0x47')]=_0x299e22['attributes']['length']?_0x299e22['attributes']:_0x194639['model'];if(_0x2a387b[_0x1651('0x41')][_0x1651('0x52')]){_0x299e22[_0x1651('0x53')]=[{'all':!![]}];}_0x299e22=_[_0x1651('0x4f')]({},_0x299e22,_0x2a387b[_0x1651('0x51')]);return db['WhatsappMessage'][_0x1651('0x58')](_0x299e22)[_0x1651('0x37')](handleEntityNotFound(_0x7c2297,null))[_0x1651('0x37')](respondWithResult(_0x7c2297,null))[_0x1651('0x28')](handleError(_0x7c2297,null));};exports['create']=function(_0xb5aa8d,_0x113406){return db[_0x1651('0x3c')][_0x1651('0x59')](_0xb5aa8d[_0x1651('0x5a')],{})[_0x1651('0x37')](respondWithResult(_0x113406,0xc9))[_0x1651('0x28')](handleError(_0x113406,null));};exports[_0x1651('0x35')]=function(_0x45e33c,_0x3cc251){if(_0x45e33c[_0x1651('0x5a')]['id']){delete _0x45e33c[_0x1651('0x5a')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x45e33c[_0x1651('0x57')]['id']}})[_0x1651('0x37')](handleEntityNotFound(_0x3cc251,null))[_0x1651('0x37')](saveUpdates(_0x45e33c['body'],null))['then'](respondWithResult(_0x3cc251,null))['catch'](handleError(_0x3cc251,null));};exports[_0x1651('0x36')]=function(_0x4325a9,_0x307789){return db[_0x1651('0x3c')][_0x1651('0x58')]({'where':{'id':_0x4325a9[_0x1651('0x57')]['id']}})['then'](handleEntityNotFound(_0x307789,null))[_0x1651('0x37')](removeEntity(_0x307789,null))['catch'](handleError(_0x307789,null));};exports[_0x1651('0x5b')]=function(_0x57e687,_0x604627){return db[_0x1651('0x3c')][_0x1651('0x5b')]()['then'](respondWithResult(_0x604627,null))[_0x1651('0x28')](handleError(_0x604627,null));};var interaction_log=require(_0x1651('0x13'))('whatsapp-interactions');exports['accept']=function(_0x3341bb,_0x1a7a20,_0x40969d){var _0x269959={'agent':{},'channel':_0x1651('0x5c')};if(_0x3341bb[_0x1651('0x5a')]['id']){delete _0x3341bb['body']['id'];}_0x3341bb[_0x1651('0x5a')][_0x1651('0x5d')]=!![];_0x3341bb[_0x1651('0x5a')]['readAt']=moment()[_0x1651('0x5e')](_0x1651('0x5f'));_0x3341bb[_0x1651('0x5a')][_0x1651('0x60')]=_0x3341bb[_0x1651('0x5a')][_0x1651('0x60')]||_0x3341bb['user']['id'];_0x269959[_0x1651('0x61')]['id']=_0x3341bb[_0x1651('0x5a')][_0x1651('0x60')];return db['WhatsappMessage'][_0x1651('0x58')]({'where':{'id':_0x3341bb['params']['id'],'UserId':null}})[_0x1651('0x37')](handleEntityNotFound(_0x1a7a20,null))[_0x1651('0x37')](saveUpdates(_0x3341bb[_0x1651('0x5a')],null))[_0x1651('0x37')](function(_0x8f2b9c){if(_0x8f2b9c){_0x269959['message']=_0x8f2b9c['get']({'plain':!![]});return db['WhatsappInteraction'][_0x1651('0x58')]({'where':{'id':_0x8f2b9c[_0x1651('0x62')]}});}return null;})[_0x1651('0x37')](handleEntityNotFound(_0x1a7a20,null))[_0x1651('0x37')](function(_0x231540){if(_0x231540){return _0x231540[_0x1651('0x35')]({'UserId':_0x3341bb[_0x1651('0x5a')][_0x1651('0x60')],'read1stAt':_[_0x1651('0x63')](_0x231540[_0x1651('0x64')])?moment()[_0x1651('0x5e')](_0x1651('0x5f')):undefined});}return null;})[_0x1651('0x37')](function(_0x4274cd){if(_0x4274cd){_0x269959[_0x1651('0x65')]=_0x4274cd[_0x1651('0x66')]({'plain':!![]});interaction_log[_0x1651('0x1f')](_0x1651('0x67'),_0x3341bb[_0x1651('0x68')]['id'],_0x3341bb[_0x1651('0x68')]['name'],_0x3341bb['user']['role'],_0x269959[_0x1651('0x65')]['id'],_0x3341bb['body']?JSON[_0x1651('0x69')](_0x3341bb['body']):_0x1651('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x1651('0x6b'),_0x269959);}return null;})[_0x1651('0x37')](function(_0x4d46b6){var _0x542ea0=_0x1651('0x6c')+_0x4d46b6[_0x1651('0x26')]['ContactId'];return db[_0x1651('0x6d')][_0x1651('0x41')](_0x542ea0,{'type':db['Sequelize'][_0x1651('0x6e')][_0x1651('0x6f')],'raw':!![]})[_0x1651('0x37')](function(_0x102d78){return _0x102d78;});})[_0x1651('0x37')](function(_0x22e42c){if(_0x22e42c){_0x269959[_0x1651('0x26')][_0x1651('0x70')]=_0x22e42c[0x0];if(!_0x3341bb[_0x1651('0x5a')][_0x1651('0x60')])return;return db[_0x1651('0x71')]['find']({'where':{'id':_0x3341bb['body']['UserId'],'role':'agent'},'attributes':['id',_0x1651('0x38'),_0x1651('0x72'),_0x1651('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3ef78a){if(!_0x3ef78a)return null;_0x269959[_0x1651('0x26')][_0x1651('0x61')]=_0x3ef78a;return _0x269959;})[_0x1651('0x37')](function(_0x538579){if(_0x538579){if(_0x3341bb[_0x1651('0x5a')][_0x1651('0x74')]){_0x269959[_0x1651('0x26')]['interface']=util['format'](_0x1651('0x75'),_0x3341bb[_0x1651('0x68')]['name']);_0x269959[_0x1651('0x26')][_0x1651('0x76')]=_0x269959[_0x1651('0x76')];_0x269959[_0x1651('0x26')]['motionChannel']=_0x269959[_0x1651('0x76')];_0x269959[_0x1651('0x26')][_0x1651('0x77')]=_0x1651('0x78');return respondWithRpcPromise(_0x1651('0x79'),_0x1651('0x79'),{'event':_0x1651('0x7a'),'message':_0x269959[_0x1651('0x26')]},client9002)[_0x1651('0x37')](function(){return _0x269959;});}return _0x269959;}return null;})[_0x1651('0x37')](respondWithResult(_0x1a7a20,null))[_0x1651('0x28')](handleError(_0x1a7a20,null));};var interaction_log=require(_0x1651('0x13'))('whatsapp-interactions');exports[_0x1651('0x34')]=function(_0x5f7069,_0x54d16d,_0x35c058){var _0x293639={'agent':{},'channel':_0x1651('0x5c')};if(_0x5f7069[_0x1651('0x5a')]['id']){delete _0x5f7069[_0x1651('0x5a')]['id'];}_0x5f7069[_0x1651('0x5a')]['UserId']=_0x5f7069[_0x1651('0x5a')][_0x1651('0x60')]||_0x5f7069[_0x1651('0x68')]['id'];_0x293639[_0x1651('0x61')]['id']=_0x5f7069[_0x1651('0x5a')][_0x1651('0x60')];return db[_0x1651('0x3c')]['find']({'where':{'id':_0x5f7069['params']['id'],'UserId':null}})[_0x1651('0x37')](handleEntityNotFound(_0x54d16d,null))['then'](function(_0x422298){if(_0x422298){_0x293639[_0x1651('0x26')]=_0x422298['get']({'plain':!![]});return db[_0x1651('0x7b')][_0x1651('0x58')]({'where':{'id':_0x422298[_0x1651('0x62')]}});}return null;})[_0x1651('0x37')](handleEntityNotFound(_0x54d16d,null))[_0x1651('0x37')](function(_0x43cc2d){if(_0x43cc2d){_0x293639['interaction']=_0x43cc2d[_0x1651('0x66')]({'plain':!![]});interaction_log[_0x1651('0x1f')](_0x1651('0x7c'),_0x5f7069[_0x1651('0x68')]['id'],_0x5f7069[_0x1651('0x68')]['name'],_0x5f7069[_0x1651('0x68')][_0x1651('0x7d')],_0x293639[_0x1651('0x65')]['id'],_0x5f7069[_0x1651('0x5a')]?JSON[_0x1651('0x69')](_0x5f7069[_0x1651('0x5a')]):_0x1651('0x6a'));return respondWithRpcPromise(_0x1651('0x7e'),'rejectMessage',_0x293639);}return null;})[_0x1651('0x37')](function(_0x2252cd){var _0x381c42=_0x1651('0x6c')+_0x2252cd[_0x1651('0x26')][_0x1651('0x7f')];return db['sequelize']['query'](_0x381c42,{'type':db[_0x1651('0x80')]['QueryTypes']['SELECT'],'raw':!![]})[_0x1651('0x37')](function(_0x143077){return _0x143077;});})[_0x1651('0x37')](function(_0x29c8d8){if(_0x29c8d8){_0x293639[_0x1651('0x26')][_0x1651('0x70')]=_0x29c8d8[0x0];if(!_0x5f7069['body']['UserId'])return;return db[_0x1651('0x71')][_0x1651('0x58')]({'where':{'id':_0x5f7069[_0x1651('0x5a')][_0x1651('0x60')],'role':_0x1651('0x61')},'attributes':['id',_0x1651('0x38'),_0x1651('0x72'),_0x1651('0x73'),_0x1651('0x81')],'raw':!![]});}return null;})[_0x1651('0x37')](function(_0x387710){if(!_0x387710)return null;_0x293639[_0x1651('0x26')][_0x1651('0x61')]=_0x387710;return _0x293639;})[_0x1651('0x37')](function(_0x4085f5){if(_0x4085f5){_0x4085f5[_0x1651('0x26')][_0x1651('0x82')]=util['format'](_0x1651('0x75'),_0x5f7069[_0x1651('0x68')]['name']);_0x4085f5[_0x1651('0x26')][_0x1651('0x76')]=_0x293639[_0x1651('0x76')];_0x4085f5['message'][_0x1651('0x83')]=_0x293639[_0x1651('0x76')];_0x4085f5['message'][_0x1651('0x77')]=_0x1651('0x34');respondWithRpcPromise(_0x1651('0x79'),_0x1651('0x79'),{'event':'rejectmessage','message':_0x4085f5['message']},client9002);return _0x293639;}return null;})[_0x1651('0x37')](respondWithResult(_0x54d16d,null))[_0x1651('0x28')](handleError(_0x54d16d,null));};exports['status']=function(_0x558b44,_0x1a60fc,_0x3281ca){if(_0x558b44[_0x1651('0x5a')]['id']){delete _0x558b44[_0x1651('0x5a')]['id'];}var _0x388329;return db[_0x1651('0x3c')][_0x1651('0x58')]({'where':{'id':_0x558b44['params']['id']}})[_0x1651('0x37')](handleEntityNotFound(_0x1a60fc,null))[_0x1651('0x37')](function(_0x4b5d34){if(_0x4b5d34){_0x388329=_0x4b5d34;return db[_0x1651('0x84')][_0x1651('0x58')]({'where':{'id':_0x4b5d34[_0x1651('0x85')]}});}})[_0x1651('0x37')](handleEntityNotFound(_0x1a60fc,null))['then'](function(_0x2cbaa7){if(_0x2cbaa7){logger[_0x1651('0x21')](_0x1651('0x86'),'status','received\x20delivery\x20report\x20from',_0x2cbaa7[_0x1651('0x3f')],util[_0x1651('0x87')](_0x558b44[_0x1651('0x5a')],{'showHidden':![],'depth':null}));switch(_0x2cbaa7[_0x1651('0x3f')]){case _0x1651('0x88'):if(_0x558b44[_0x1651('0x5a')]['MessageSid']&&_0x558b44[_0x1651('0x5a')]['MessageSid']===_0x388329['messageId']&&_0x558b44[_0x1651('0x5a')]['MessageStatus']&&_0x558b44['body']['MessageStatus']===_0x1651('0x5d')){return _0x388329[_0x1651('0x35')]({'read':!![]});}else{logger[_0x1651('0x23')](_0x1651('0x89'),_0x1651('0x2a'),_0x1651('0x88'),util['inspect'](_0x558b44[_0x1651('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x388329;}})[_0x1651('0x37')](respondWithResult(_0x1a60fc,null))[_0x1651('0x28')](handleError(_0x1a60fc,null));}; \ No newline at end of file +var _0x0b5a=['whatsapp-interactions','accept','whatsapp','format','UserId','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','user','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','internal','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','Sequelize','contact','User','email','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','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','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','findAll','rows','keys','include','find','create','body','params','destroy','describe'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0b5a,0x145));var _0xa0b5=function(_0x160829,_0xc63d56){_0x160829=_0x160829-0x0;var _0x47bfd7=_0x0b5a[_0x160829];return _0x47bfd7;};'use strict';var emlformat=require(_0xa0b5('0x0'));var rimraf=require(_0xa0b5('0x1'));var zipdir=require(_0xa0b5('0x2'));var jsonpatch=require(_0xa0b5('0x3'));var rp=require(_0xa0b5('0x4'));var moment=require(_0xa0b5('0x5'));var BPromise=require(_0xa0b5('0x6'));var Mustache=require('mustache');var util=require(_0xa0b5('0x7'));var path=require(_0xa0b5('0x8'));var sox=require('sox');var csv=require(_0xa0b5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0b5('0xa'));var squel=require(_0xa0b5('0xb'));var crypto=require(_0xa0b5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa0b5('0xd'));var toCsv=require(_0xa0b5('0x9'));var querystring=require(_0xa0b5('0xe'));var Papa=require(_0xa0b5('0xf'));var Redis=require(_0xa0b5('0x10'));var authService=require(_0xa0b5('0x11'));var qs=require(_0xa0b5('0x12'));var as=require(_0xa0b5('0x13'));var hardwareService=require(_0xa0b5('0x14'));var logger=require(_0xa0b5('0x15'))('api');var utils=require(_0xa0b5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa0b5('0x17'));var db=require(_0xa0b5('0x18'))['db'];config[_0xa0b5('0x19')]=_[_0xa0b5('0x1a')](config[_0xa0b5('0x19')],{'host':_0xa0b5('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0b5('0x19')]));require(_0xa0b5('0x1c'))[_0xa0b5('0x1d')](socket);var jayson=require(_0xa0b5('0x1e'));var client=jayson[_0xa0b5('0x1f')][_0xa0b5('0x20')]({'port':0x232c});var client9002=jayson[_0xa0b5('0x1f')][_0xa0b5('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5f6316,_0x1a5b99,_0x3a0e6d,_0x41193e){return new BPromise(function(_0xd9a556,_0x281956){var _0x78f9be=_0x41193e||client;return _0x78f9be[_0xa0b5('0x21')](_0x5f6316,_0x3a0e6d)[_0xa0b5('0x22')](function(_0x30f760){logger['info'](_0xa0b5('0x23'),_0x1a5b99,_0xa0b5('0x24'));logger[_0xa0b5('0x25')](_0xa0b5('0x26'),_0x1a5b99,_0xa0b5('0x24'),JSON[_0xa0b5('0x27')](_0x30f760));if(_0x30f760[_0xa0b5('0x28')]){if(_0x30f760[_0xa0b5('0x28')][_0xa0b5('0x29')]===0x1f4){logger[_0xa0b5('0x28')](_0xa0b5('0x23'),_0x1a5b99,_0x30f760[_0xa0b5('0x28')]['message']);return _0x281956(_0x30f760['error'][_0xa0b5('0x2a')]);}logger[_0xa0b5('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x1a5b99,_0x30f760['error'][_0xa0b5('0x2a')]);return _0xd9a556(_0x30f760[_0xa0b5('0x28')][_0xa0b5('0x2a')]);}else{logger[_0xa0b5('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0x1a5b99,'request\x20sent');_0xd9a556(_0x30f760[_0xa0b5('0x2c')][_0xa0b5('0x2a')]);}})[_0xa0b5('0x2d')](function(_0x345db4){logger['error'](_0xa0b5('0x23'),_0x1a5b99,_0x345db4);_0x281956(_0x345db4);});});}function respondWithStatusCode(_0xcf3470,_0x4758b0){_0x4758b0=_0x4758b0||0xcc;return function(_0x256cd8){if(_0x256cd8){return _0xcf3470[_0xa0b5('0x2e')](_0x4758b0);}return _0xcf3470[_0xa0b5('0x2f')](_0x4758b0)[_0xa0b5('0x30')]();};}function respondWithResult(_0x14cb9c,_0x105142){_0x105142=_0x105142||0xc8;return function(_0x1fc3f6){if(_0x1fc3f6){return _0x14cb9c[_0xa0b5('0x2f')](_0x105142)[_0xa0b5('0x31')](_0x1fc3f6);}};}function respondWithFilteredResult(_0x48ef44,_0x579d72){return function(_0x377635){if(_0x377635){var _0x5d453f=typeof _0x579d72[_0xa0b5('0x32')]==='undefined'&&typeof _0x579d72[_0xa0b5('0x33')]===_0xa0b5('0x34');var _0x4fcff5=_0x377635[_0xa0b5('0x35')];var _0x450eb5=_0x5d453f?0x0:_0x579d72[_0xa0b5('0x32')];var _0x3565f5=_0x5d453f?_0x377635[_0xa0b5('0x35')]:_0x579d72[_0xa0b5('0x32')]+_0x579d72[_0xa0b5('0x33')];var _0x4a4258;if(_0x3565f5>=_0x4fcff5){_0x3565f5=_0x4fcff5;_0x4a4258=0xc8;}else{_0x4a4258=0xce;}_0x48ef44[_0xa0b5('0x2f')](_0x4a4258);return _0x48ef44[_0xa0b5('0x36')]('Content-Range',_0x450eb5+'-'+_0x3565f5+'/'+_0x4fcff5)[_0xa0b5('0x31')](_0x377635);}return null;};}function patchUpdates(_0x59ce18){return function(_0x51568a){try{jsonpatch[_0xa0b5('0x37')](_0x51568a,_0x59ce18,!![]);}catch(_0x7dbae3){return BPromise[_0xa0b5('0x38')](_0x7dbae3);}return _0x51568a[_0xa0b5('0x39')]();};}function saveUpdates(_0x58451b,_0x2e1be4){return function(_0x3a2882){if(_0x3a2882){return _0x3a2882[_0xa0b5('0x3a')](_0x58451b)[_0xa0b5('0x22')](function(_0x1e0661){return _0x1e0661;});}return null;};}function removeEntity(_0x403f46,_0x36fc10){return function(_0x27220a){if(_0x27220a){return _0x27220a['destroy']()[_0xa0b5('0x22')](function(){_0x403f46[_0xa0b5('0x2f')](0xcc)[_0xa0b5('0x30')]();});}};}function handleEntityNotFound(_0x296099,_0x518a72){return function(_0x275480){if(!_0x275480){_0x296099['sendStatus'](0x194);}return _0x275480;};}function handleError(_0x2e664a,_0x1912ff){_0x1912ff=_0x1912ff||0x1f4;return function(_0x1faf6e){logger['error'](_0x1faf6e['stack']);if(_0x1faf6e[_0xa0b5('0x3b')]){delete _0x1faf6e[_0xa0b5('0x3b')];}_0x2e664a[_0xa0b5('0x2f')](_0x1912ff)[_0xa0b5('0x3c')](_0x1faf6e);};}exports[_0xa0b5('0x3d')]=function(_0x14c665,_0x213dff){var _0x8f3c22={},_0x40f622={},_0x26c161={'count':0x0,'rows':[]};var _0x4c2aa3=_[_0xa0b5('0x3e')](db[_0xa0b5('0x3f')][_0xa0b5('0x40')],function(_0x3e71ba){return{'name':_0x3e71ba[_0xa0b5('0x41')],'type':_0x3e71ba[_0xa0b5('0x42')][_0xa0b5('0x43')]};});_0x40f622[_0xa0b5('0x44')]=_['map'](_0x4c2aa3,_0xa0b5('0x3b'));_0x40f622[_0xa0b5('0x45')]=_['keys'](_0x14c665[_0xa0b5('0x45')]);_0x40f622['filters']=_[_0xa0b5('0x46')](_0x40f622[_0xa0b5('0x44')],_0x40f622[_0xa0b5('0x45')]);_0x8f3c22[_0xa0b5('0x47')]=_[_0xa0b5('0x46')](_0x40f622[_0xa0b5('0x44')],qs[_0xa0b5('0x48')](_0x14c665[_0xa0b5('0x45')]['fields']));_0x8f3c22[_0xa0b5('0x47')]=_0x8f3c22[_0xa0b5('0x47')]['length']?_0x8f3c22['attributes']:_0x40f622[_0xa0b5('0x44')];if(!_0x14c665[_0xa0b5('0x45')][_0xa0b5('0x49')](_0xa0b5('0x4a'))){_0x8f3c22['limit']=qs[_0xa0b5('0x33')](_0x14c665[_0xa0b5('0x45')][_0xa0b5('0x33')]);_0x8f3c22[_0xa0b5('0x32')]=qs['offset'](_0x14c665['query'][_0xa0b5('0x32')]);}_0x8f3c22['order']=qs['sort'](_0x14c665['query'][_0xa0b5('0x4b')]);_0x8f3c22[_0xa0b5('0x4c')]=qs[_0xa0b5('0x4d')](_['pick'](_0x14c665[_0xa0b5('0x45')],_0x40f622[_0xa0b5('0x4d')]),_0x4c2aa3);if(_0x14c665['query'][_0xa0b5('0x4e')]){_0x8f3c22[_0xa0b5('0x4c')]=_[_0xa0b5('0x4f')](_0x8f3c22[_0xa0b5('0x4c')],{'$or':_[_0xa0b5('0x3e')](_0x4c2aa3,function(_0x189bf9){if(_0x189bf9[_0xa0b5('0x42')]!=='VIRTUAL'){var _0x21ec00={};_0x21ec00[_0x189bf9[_0xa0b5('0x3b')]]={'$like':'%'+_0x14c665[_0xa0b5('0x45')]['filter']+'%'};return _0x21ec00;}})});}_0x8f3c22=_[_0xa0b5('0x4f')]({},_0x8f3c22,_0x14c665[_0xa0b5('0x50')]);var _0x53cd6c={'where':_0x8f3c22['where']};return db[_0xa0b5('0x3f')][_0xa0b5('0x35')](_0x53cd6c)[_0xa0b5('0x22')](function(_0x49e79f){_0x26c161[_0xa0b5('0x35')]=_0x49e79f;if(_0x14c665[_0xa0b5('0x45')][_0xa0b5('0x51')]){_0x8f3c22['include']=[{'all':!![]}];}return db[_0xa0b5('0x3f')][_0xa0b5('0x52')](_0x8f3c22);})[_0xa0b5('0x22')](function(_0x223b9a){_0x26c161[_0xa0b5('0x53')]=_0x223b9a;return _0x26c161;})['then'](respondWithFilteredResult(_0x213dff,_0x8f3c22))['catch'](handleError(_0x213dff,null));};exports['show']=function(_0x5e99cb,_0x1d904b){var _0x3bbd26={'raw':!![],'where':{'id':_0x5e99cb['params']['id']}},_0x4f2125={};_0x4f2125[_0xa0b5('0x44')]=_[_0xa0b5('0x54')](db['WhatsappMessage']['rawAttributes']);_0x4f2125[_0xa0b5('0x45')]=_['keys'](_0x5e99cb[_0xa0b5('0x45')]);_0x4f2125[_0xa0b5('0x4d')]=_[_0xa0b5('0x46')](_0x4f2125[_0xa0b5('0x44')],_0x4f2125[_0xa0b5('0x45')]);_0x3bbd26[_0xa0b5('0x47')]=_[_0xa0b5('0x46')](_0x4f2125['model'],qs[_0xa0b5('0x48')](_0x5e99cb[_0xa0b5('0x45')][_0xa0b5('0x48')]));_0x3bbd26[_0xa0b5('0x47')]=_0x3bbd26[_0xa0b5('0x47')]['length']?_0x3bbd26['attributes']:_0x4f2125['model'];if(_0x5e99cb[_0xa0b5('0x45')][_0xa0b5('0x51')]){_0x3bbd26[_0xa0b5('0x55')]=[{'all':!![]}];}_0x3bbd26=_[_0xa0b5('0x4f')]({},_0x3bbd26,_0x5e99cb[_0xa0b5('0x50')]);return db[_0xa0b5('0x3f')][_0xa0b5('0x56')](_0x3bbd26)[_0xa0b5('0x22')](handleEntityNotFound(_0x1d904b,null))[_0xa0b5('0x22')](respondWithResult(_0x1d904b,null))['catch'](handleError(_0x1d904b,null));};exports[_0xa0b5('0x57')]=function(_0x11fcce,_0x427e5d){return db['WhatsappMessage'][_0xa0b5('0x57')](_0x11fcce[_0xa0b5('0x58')],{})[_0xa0b5('0x22')](respondWithResult(_0x427e5d,0xc9))['catch'](handleError(_0x427e5d,null));};exports['update']=function(_0x1b439e,_0x2c9ee3){if(_0x1b439e[_0xa0b5('0x58')]['id']){delete _0x1b439e[_0xa0b5('0x58')]['id'];}return db[_0xa0b5('0x3f')][_0xa0b5('0x56')]({'where':{'id':_0x1b439e[_0xa0b5('0x59')]['id']}})['then'](handleEntityNotFound(_0x2c9ee3,null))[_0xa0b5('0x22')](saveUpdates(_0x1b439e['body'],null))[_0xa0b5('0x22')](respondWithResult(_0x2c9ee3,null))[_0xa0b5('0x2d')](handleError(_0x2c9ee3,null));};exports[_0xa0b5('0x5a')]=function(_0x3ddaad,_0x57e16d){return db['WhatsappMessage']['find']({'where':{'id':_0x3ddaad['params']['id']}})[_0xa0b5('0x22')](handleEntityNotFound(_0x57e16d,null))[_0xa0b5('0x22')](removeEntity(_0x57e16d,null))[_0xa0b5('0x2d')](handleError(_0x57e16d,null));};exports['describe']=function(_0x3fcdac,_0xb2948b){return db[_0xa0b5('0x3f')][_0xa0b5('0x5b')]()[_0xa0b5('0x22')](respondWithResult(_0xb2948b,null))['catch'](handleError(_0xb2948b,null));};var interaction_log=require(_0xa0b5('0x15'))(_0xa0b5('0x5c'));exports[_0xa0b5('0x5d')]=function(_0x4b08d4,_0x1db945,_0x97f724){var _0x19358d={'agent':{},'channel':_0xa0b5('0x5e')};if(_0x4b08d4[_0xa0b5('0x58')]['id']){delete _0x4b08d4[_0xa0b5('0x58')]['id'];}_0x4b08d4[_0xa0b5('0x58')]['read']=!![];_0x4b08d4[_0xa0b5('0x58')]['readAt']=moment()[_0xa0b5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b08d4[_0xa0b5('0x58')]['UserId']=_0x4b08d4[_0xa0b5('0x58')][_0xa0b5('0x60')]||_0x4b08d4['user']['id'];_0x19358d['agent']['id']=_0x4b08d4['body'][_0xa0b5('0x60')];return db[_0xa0b5('0x3f')][_0xa0b5('0x56')]({'where':{'id':_0x4b08d4[_0xa0b5('0x59')]['id'],'UserId':null}})[_0xa0b5('0x22')](handleEntityNotFound(_0x1db945,null))[_0xa0b5('0x22')](saveUpdates(_0x4b08d4['body'],null))[_0xa0b5('0x22')](function(_0xd5688f){if(_0xd5688f){_0x19358d[_0xa0b5('0x2a')]=_0xd5688f['get']({'plain':!![]});return db[_0xa0b5('0x61')][_0xa0b5('0x56')]({'where':{'id':_0xd5688f[_0xa0b5('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1db945,null))['then'](function(_0x226177){if(_0x226177){return _0x226177[_0xa0b5('0x3a')]({'UserId':_0x4b08d4[_0xa0b5('0x58')]['UserId'],'read1stAt':_[_0xa0b5('0x63')](_0x226177[_0xa0b5('0x64')])?moment()['format'](_0xa0b5('0x65')):undefined});}return null;})[_0xa0b5('0x22')](function(_0x1e5021){if(_0x1e5021){_0x19358d[_0xa0b5('0x66')]=_0x1e5021[_0xa0b5('0x67')]({'plain':!![]});interaction_log[_0xa0b5('0x2b')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b08d4[_0xa0b5('0x68')]['id'],_0x4b08d4[_0xa0b5('0x68')][_0xa0b5('0x3b')],_0x4b08d4[_0xa0b5('0x68')]['role'],_0x19358d[_0xa0b5('0x66')]['id'],_0x4b08d4['body']?JSON[_0xa0b5('0x27')](_0x4b08d4['body']):'null');return respondWithRpcPromise(_0xa0b5('0x69'),_0xa0b5('0x6a'),_0x19358d);}return null;})['then'](function(_0x41ec6e){var _0x2ffa25=_0xa0b5('0x6b')+_0x41ec6e[_0xa0b5('0x2a')][_0xa0b5('0x6c')];return db[_0xa0b5('0x6d')][_0xa0b5('0x45')](_0x2ffa25,{'type':db['Sequelize'][_0xa0b5('0x6e')][_0xa0b5('0x6f')],'raw':!![]})['then'](function(_0x567c07){return _0x567c07;});})[_0xa0b5('0x22')](function(_0x3cc891){if(_0x3cc891){_0x19358d[_0xa0b5('0x2a')]['contact']=_0x3cc891[0x0];if(!_0x4b08d4[_0xa0b5('0x58')][_0xa0b5('0x60')])return;return db['User'][_0xa0b5('0x56')]({'where':{'id':_0x4b08d4[_0xa0b5('0x58')][_0xa0b5('0x60')],'role':'agent'},'attributes':['id',_0xa0b5('0x3b'),_0xa0b5('0x70'),'email',_0xa0b5('0x71')],'raw':!![]});}return null;})[_0xa0b5('0x22')](function(_0xbb5504){if(!_0xbb5504)return null;_0x19358d[_0xa0b5('0x2a')][_0xa0b5('0x72')]=_0xbb5504;return _0x19358d;})[_0xa0b5('0x22')](function(_0x2f0020){if(_0x2f0020){if(_0x4b08d4[_0xa0b5('0x58')][_0xa0b5('0x73')]){_0x19358d[_0xa0b5('0x2a')]['interface']=util['format'](_0xa0b5('0x74'),_0x4b08d4['user'][_0xa0b5('0x3b')]);_0x19358d[_0xa0b5('0x2a')][_0xa0b5('0x75')]=_0x19358d['channel'];_0x19358d[_0xa0b5('0x2a')][_0xa0b5('0x76')]=_0x19358d['channel'];_0x19358d[_0xa0b5('0x2a')][_0xa0b5('0x77')]=_0xa0b5('0x5d');return respondWithRpcPromise(_0xa0b5('0x78'),_0xa0b5('0x78'),{'event':_0xa0b5('0x79'),'message':_0x19358d[_0xa0b5('0x2a')]},client9002)[_0xa0b5('0x22')](function(){return _0x19358d;});}return _0x19358d;}return null;})['then'](respondWithResult(_0x1db945,null))[_0xa0b5('0x2d')](handleError(_0x1db945,null));};var interaction_log=require(_0xa0b5('0x15'))('whatsapp-interactions');exports['reject']=function(_0x381bed,_0x1b1857,_0x452391){var _0x1b2fe3={'agent':{},'channel':_0xa0b5('0x5e')};if(_0x381bed[_0xa0b5('0x58')]['id']){delete _0x381bed[_0xa0b5('0x58')]['id'];}_0x381bed['body'][_0xa0b5('0x60')]=_0x381bed[_0xa0b5('0x58')]['UserId']||_0x381bed['user']['id'];_0x1b2fe3[_0xa0b5('0x72')]['id']=_0x381bed[_0xa0b5('0x58')][_0xa0b5('0x60')];return db['WhatsappMessage']['find']({'where':{'id':_0x381bed[_0xa0b5('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b1857,null))[_0xa0b5('0x22')](function(_0x36fdd4){if(_0x36fdd4){_0x1b2fe3[_0xa0b5('0x2a')]=_0x36fdd4[_0xa0b5('0x67')]({'plain':!![]});return db[_0xa0b5('0x61')][_0xa0b5('0x56')]({'where':{'id':_0x36fdd4[_0xa0b5('0x62')]}});}return null;})[_0xa0b5('0x22')](handleEntityNotFound(_0x1b1857,null))['then'](function(_0x2c9055){if(_0x2c9055){_0x1b2fe3['interaction']=_0x2c9055[_0xa0b5('0x67')]({'plain':!![]});interaction_log['info'](_0xa0b5('0x7a'),_0x381bed[_0xa0b5('0x68')]['id'],_0x381bed[_0xa0b5('0x68')][_0xa0b5('0x3b')],_0x381bed[_0xa0b5('0x68')]['role'],_0x1b2fe3[_0xa0b5('0x66')]['id'],_0x381bed[_0xa0b5('0x58')]?JSON[_0xa0b5('0x27')](_0x381bed['body']):_0xa0b5('0x7b'));return respondWithRpcPromise(_0xa0b5('0x7c'),'rejectMessage',_0x1b2fe3);}return null;})[_0xa0b5('0x22')](function(_0x39894a){var _0x18a5d1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x39894a[_0xa0b5('0x2a')][_0xa0b5('0x6c')];return db[_0xa0b5('0x6d')][_0xa0b5('0x45')](_0x18a5d1,{'type':db[_0xa0b5('0x7d')][_0xa0b5('0x6e')][_0xa0b5('0x6f')],'raw':!![]})[_0xa0b5('0x22')](function(_0x108404){return _0x108404;});})['then'](function(_0x4b5c8b){if(_0x4b5c8b){_0x1b2fe3[_0xa0b5('0x2a')][_0xa0b5('0x7e')]=_0x4b5c8b[0x0];if(!_0x381bed['body'][_0xa0b5('0x60')])return;return db[_0xa0b5('0x7f')][_0xa0b5('0x56')]({'where':{'id':_0x381bed[_0xa0b5('0x58')][_0xa0b5('0x60')],'role':_0xa0b5('0x72')},'attributes':['id',_0xa0b5('0x3b'),_0xa0b5('0x70'),_0xa0b5('0x80'),_0xa0b5('0x71')],'raw':!![]});}return null;})['then'](function(_0x436ce6){if(!_0x436ce6)return null;_0x1b2fe3['message'][_0xa0b5('0x72')]=_0x436ce6;return _0x1b2fe3;})['then'](function(_0x3bca2f){if(_0x3bca2f){_0x3bca2f[_0xa0b5('0x2a')][_0xa0b5('0x81')]=util['format'](_0xa0b5('0x74'),_0x381bed[_0xa0b5('0x68')][_0xa0b5('0x3b')]);_0x3bca2f[_0xa0b5('0x2a')][_0xa0b5('0x75')]=_0x1b2fe3['channel'];_0x3bca2f[_0xa0b5('0x2a')][_0xa0b5('0x76')]=_0x1b2fe3['channel'];_0x3bca2f[_0xa0b5('0x2a')][_0xa0b5('0x77')]='reject';respondWithRpcPromise(_0xa0b5('0x78'),_0xa0b5('0x78'),{'event':'rejectmessage','message':_0x3bca2f['message']},client9002);return _0x1b2fe3;}return null;})[_0xa0b5('0x22')](respondWithResult(_0x1b1857,null))[_0xa0b5('0x2d')](handleError(_0x1b1857,null));};exports[_0xa0b5('0x2f')]=function(_0x376c1f,_0x2a5629,_0x4bf43f){if(_0x376c1f[_0xa0b5('0x58')]['id']){delete _0x376c1f['body']['id'];}var _0x30f7e7;return db[_0xa0b5('0x3f')][_0xa0b5('0x56')]({'where':{'id':_0x376c1f['params']['id']}})[_0xa0b5('0x22')](handleEntityNotFound(_0x2a5629,null))[_0xa0b5('0x22')](function(_0x429059){if(_0x429059){_0x30f7e7=_0x429059;return db[_0xa0b5('0x82')][_0xa0b5('0x56')]({'where':{'id':_0x429059[_0xa0b5('0x83')]}});}})['then'](handleEntityNotFound(_0x2a5629,null))[_0xa0b5('0x22')](function(_0xeb03fe){if(_0xeb03fe){logger[_0xa0b5('0x25')](_0xa0b5('0x84'),_0xa0b5('0x2f'),_0xa0b5('0x85'),_0xeb03fe[_0xa0b5('0x42')],util[_0xa0b5('0x86')](_0x376c1f[_0xa0b5('0x58')],{'showHidden':![],'depth':null}));switch(_0xeb03fe[_0xa0b5('0x42')]){case _0xa0b5('0x87'):if(_0x376c1f[_0xa0b5('0x58')][_0xa0b5('0x88')]&&_0x376c1f['body'][_0xa0b5('0x88')]===_0x30f7e7[_0xa0b5('0x89')]&&_0x376c1f['body'][_0xa0b5('0x8a')]&&_0x376c1f['body']['MessageStatus']==='read'){return _0x30f7e7[_0xa0b5('0x3a')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xa0b5('0x2f'),_0xa0b5('0x87'),util[_0xa0b5('0x86')](_0x376c1f[_0xa0b5('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x30f7e7;}})['then'](respondWithResult(_0x2a5629,null))[_0xa0b5('0x2d')](handleError(_0x2a5629,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index c612e10..5191b76 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 _0xe5b5=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x8339ed,_0x43062a){var _0x53c7d4=function(_0x19f961){while(--_0x19f961){_0x8339ed['push'](_0x8339ed['shift']());}};_0x53c7d4(++_0x43062a);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0xe5b5[_0x4aa838];return _0x3abff0;};'use strict';var EventEmitter=require(_0x5e5b('0x0'));var WhatsappMessage=require(_0x5e5b('0x1'))['db'][_0x5e5b('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x5e5b('0x3')](0x0);var events={'afterCreate':_0x5e5b('0x4'),'afterUpdate':_0x5e5b('0x5'),'afterDestroy':_0x5e5b('0x6')};function emitEvent(_0x3dc763){return function(_0xf20c6a,_0x20a50c,_0xdc6616){WhatsappMessageEvents[_0x5e5b('0x7')](_0x3dc763+':'+_0xf20c6a['id'],_0xf20c6a);WhatsappMessageEvents[_0x5e5b('0x7')](_0x3dc763,_0xf20c6a);_0xdc6616(null);};}for(var e in events){if(events[_0x5e5b('0x8')](e)){var event=events[e];WhatsappMessage[_0x5e5b('0x9')](e,emitEvent(event));}}module[_0x5e5b('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0xe1e3=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x3ec1e5,_0x53c2e8){var _0x440caf=function(_0x42f905){while(--_0x42f905){_0x3ec1e5['push'](_0x3ec1e5['shift']());}};_0x440caf(++_0x53c2e8);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x319174,_0x23cb14){_0x319174=_0x319174-0x0;var _0x4836fd=_0xe1e3[_0x319174];return _0x4836fd;};'use strict';var EventEmitter=require(_0x3e1e('0x0'));var WhatsappMessage=require(_0x3e1e('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3e1e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3e1e('0x3')};function emitEvent(_0x4d5360){return function(_0x3bacc,_0x5a11ef,_0x1abd25){WhatsappMessageEvents[_0x3e1e('0x4')](_0x4d5360+':'+_0x3bacc['id'],_0x3bacc);WhatsappMessageEvents[_0x3e1e('0x4')](_0x4d5360,_0x3bacc);_0x1abd25(null);};}for(var e in events){if(events[_0x3e1e('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x3e1e('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 9a2a774..d802ddf 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 _0xc7d3=['update','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','catch','error','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid'];(function(_0x1b2b25,_0x5a44c9){var _0x3d9b5d=function(_0x775806){while(--_0x775806){_0x1b2b25['push'](_0x1b2b25['shift']());}};_0x3d9b5d(++_0x5a44c9);}(_0xc7d3,0x8f));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c7d('0x0'));var util=require('util');var logger=require(_0x3c7d('0x1'))(_0x3c7d('0x2'));var moment=require(_0x3c7d('0x3'));var BPromise=require(_0x3c7d('0x4'));var rp=require(_0x3c7d('0x5'));var fetch=require(_0x3c7d('0x6'));var fs=require('fs');var path=require(_0x3c7d('0x7'));var rimraf=require('rimraf');var config=require(_0x3c7d('0x8'));var attributes=require(_0x3c7d('0x9'));module[_0x3c7d('0xa')]=function(_0x294c4c,_0x36d022){return _0x294c4c['define'](_0x3c7d('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x3c7d('0xc'),'fields':[_0x3c7d('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x3c7d('0xd')],'type':_0x3c7d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x389ec6,_0x431bb0,_0x29022c){var _0x46d4fa=_0x294c4c[_0x3c7d('0xf')];var _0x4379a8=_0x389ec6[_0x3c7d('0x10')]({'plain':!![]});if(_0x4379a8['direction']['toLowerCase']()==='in'||_0x4379a8[_0x3c7d('0x11')][_0x3c7d('0x12')]()==='out'&&!_0x4379a8[_0x3c7d('0x13')]&&!_['isNil'](_0x4379a8[_0x3c7d('0x14')])){_0x46d4fa[_0x3c7d('0x15')][_0x3c7d('0x16')]({'where':{'id':_0x4379a8[_0x3c7d('0x17')]}})[_0x3c7d('0x18')](function(_0x2bd3d5){if(_0x2bd3d5){_0x2bd3d5['update']({'lastMsgAt':_0x4379a8['createdAt'],'lastMsgDirection':_0x4379a8[_0x3c7d('0x11')][_0x3c7d('0x12')]()});}})[_0x3c7d('0x19')](function(_0xa9da1a){console[_0x3c7d('0x1a')](_0xa9da1a);});}if(_0x4379a8[_0x3c7d('0x11')]===_0x3c7d('0x1b')&&!_0x4379a8[_0x3c7d('0x13')]){var _0x25b412;_0x46d4fa[_0x3c7d('0x1c')][_0x3c7d('0x1d')]({'where':{'id':_0x4379a8[_0x3c7d('0x1e')]},'raw':!![]})['then'](function(_0x577a30){_0x25b412=_0x577a30;if(_0x25b412&&_0x25b412['type']){switch(_0x25b412[_0x3c7d('0x1f')]){case _0x3c7d('0x20'):var _0x4c6208=require(_0x3c7d('0x20'));if(_0x25b412[_0x3c7d('0x21')]&&_0x25b412['authToken']&&_0x25b412[_0x3c7d('0x22')]){var _0x45a06a=new _0x4c6208(_0x25b412[_0x3c7d('0x21')],_0x25b412[_0x3c7d('0x23')]);_0x45a06a[_0x3c7d('0x24')][_0x3c7d('0x25')]({'body':_0x4379a8[_0x3c7d('0xd')],'to':_0x3c7d('0x26')+_0x4379a8[_0x3c7d('0x22')],'from':_0x3c7d('0x26')+_0x25b412[_0x3c7d('0x22')],'statusCallback':_0x25b412['remote']+_0x3c7d('0x27')+_0x4379a8['id']+_0x3c7d('0x28')+_0x25b412[_0x3c7d('0x29')]})[_0x3c7d('0x18')](function(_0x49acce){if(_0x49acce[_0x3c7d('0x2a')]){return _0x389ec6[_0x3c7d('0x2b')]({'messageId':_0x49acce['sid']});}})['catch'](function(_0x98aa45){logger[_0x3c7d('0x1a')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3c7d('0x2c'),_0x3c7d('0x20'),util[_0x3c7d('0x2d')](_0x98aa45,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3c7d('0x2e'),_0x3c7d('0x2c'),_0x3c7d('0x20'),_0x3c7d('0x2f'));}break;case _0x3c7d('0x30'):var _0x2e1e9f=_0x25b412[_0x3c7d('0x21')];var _0x48b691=_0x25b412[_0x3c7d('0x23')];var _0x34cf9e=_0x25b412[_0x3c7d('0x31')]+_0x3c7d('0x32')+_0x2e1e9f+_0x3c7d('0x33');var _0x4ec744={'to':[_0x4379a8[_0x3c7d('0x22')]],'message':{'type':_0x3c7d('0x34'),'text':_0x4379a8[_0x3c7d('0xd')]}};var _0x2a8d8f={'method':_0x3c7d('0x35'),'uri':_0x34cf9e,'headers':{'Authorization':_0x3c7d('0x36')+_0x48b691,'Content-Type':_0x3c7d('0x37')},'body':_0x4ec744,'json':!![]};rp(_0x2a8d8f)[_0x3c7d('0x18')](function(_0x2d99a3){if(_0x2d99a3['statuses'][0x0][_0x3c7d('0x38')]){return _0x389ec6['update']({'messageId':_0x2d99a3['statuses'][0x0]['message_id']});}})['catch'](function(_0x3e39bd){logger[_0x3c7d('0x39')](_0x3c7d('0x3a'),_0x3e39bd);});break;}}})[_0x3c7d('0x3b')](function(){_0x29022c();});}else{_0x29022c();}}},'charset':_0x3c7d('0x3c'),'collate':_0x3c7d('0x3d')});}; \ No newline at end of file +var _0xc452=['inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','error','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc452,0x154));var _0x2c45=function(_0x3e310b,_0x1bbd14){_0x3e310b=_0x3e310b-0x0;var _0x548505=_0xc452[_0x3e310b];return _0x548505;};'use strict';var _=require('lodash');var util=require(_0x2c45('0x0'));var logger=require('../../config/logger')(_0x2c45('0x1'));var moment=require(_0x2c45('0x2'));var BPromise=require(_0x2c45('0x3'));var rp=require(_0x2c45('0x4'));var fetch=require(_0x2c45('0x5'));var fs=require('fs');var path=require(_0x2c45('0x6'));var rimraf=require(_0x2c45('0x7'));var config=require('../../config/environment');var attributes=require(_0x2c45('0x8'));module[_0x2c45('0x9')]=function(_0x20eb23,_0x573bfe){return _0x20eb23[_0x2c45('0xa')](_0x2c45('0xb'),attributes,{'tableName':_0x2c45('0xc'),'paranoid':![],'indexes':[{'name':_0x2c45('0xd'),'fields':[_0x2c45('0xd')]},{'name':_0x2c45('0xe'),'fields':[_0x2c45('0xf')],'type':_0x2c45('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2499b6,_0x17c7cf,_0x3957a4){var _0x228500=_0x20eb23[_0x2c45('0x11')];var _0x105350=_0x2499b6[_0x2c45('0x12')]({'plain':!![]});if(_0x105350[_0x2c45('0x13')]['toLowerCase']()==='in'||_0x105350['direction'][_0x2c45('0x14')]()==='out'&&!_0x105350[_0x2c45('0x15')]&&!_[_0x2c45('0x16')](_0x105350[_0x2c45('0x17')])){_0x228500[_0x2c45('0x18')][_0x2c45('0x19')]({'where':{'id':_0x105350[_0x2c45('0x1a')]}})[_0x2c45('0x1b')](function(_0xca9e8d){if(_0xca9e8d){_0xca9e8d[_0x2c45('0x1c')]({'lastMsgAt':_0x105350['createdAt'],'lastMsgDirection':_0x105350[_0x2c45('0x13')]['toLowerCase']()});}})['catch'](function(_0x3e5b1a){console[_0x2c45('0x1d')](_0x3e5b1a);});}if(_0x105350[_0x2c45('0x13')]===_0x2c45('0x1e')&&!_0x105350['secret']){var _0x33f7c7;_0x228500[_0x2c45('0x1f')][_0x2c45('0x20')]({'where':{'id':_0x105350[_0x2c45('0x21')]},'raw':!![]})[_0x2c45('0x1b')](function(_0x2370ec){_0x33f7c7=_0x2370ec;if(_0x33f7c7&&_0x33f7c7[_0x2c45('0x22')]){switch(_0x33f7c7[_0x2c45('0x22')]){case _0x2c45('0x23'):var _0x11bfcb=require(_0x2c45('0x23'));if(_0x33f7c7[_0x2c45('0x24')]&&_0x33f7c7[_0x2c45('0x25')]&&_0x33f7c7[_0x2c45('0x26')]){var _0x434d59=new _0x11bfcb(_0x33f7c7[_0x2c45('0x24')],_0x33f7c7[_0x2c45('0x25')]);_0x434d59[_0x2c45('0x27')][_0x2c45('0x28')]({'body':_0x105350[_0x2c45('0xf')],'to':'whatsapp:'+_0x105350[_0x2c45('0x26')],'from':_0x2c45('0x29')+_0x33f7c7[_0x2c45('0x26')],'statusCallback':_0x33f7c7[_0x2c45('0x2a')]+_0x2c45('0x2b')+_0x105350['id']+_0x2c45('0x2c')+_0x33f7c7[_0x2c45('0x2d')]})['then'](function(_0x5cfe1b){if(_0x5cfe1b['sid']){return _0x2499b6['update']({'messageId':_0x5cfe1b[_0x2c45('0x2e')]});}})[_0x2c45('0x2f')](function(_0x54e17c){logger['error'](_0x2c45('0x30'),_0x2c45('0x31'),_0x2c45('0x23'),util[_0x2c45('0x32')](_0x54e17c,{'showHidden':![],'depth':null}));});}else{logger[_0x2c45('0x1d')](_0x2c45('0x30'),_0x2c45('0x31'),_0x2c45('0x23'),_0x2c45('0x33'));}break;case _0x2c45('0x34'):var _0x4f1b45=_0x33f7c7[_0x2c45('0x24')];var _0x3ace6a=_0x33f7c7[_0x2c45('0x25')];var _0x25c979=_0x33f7c7[_0x2c45('0x35')]+_0x2c45('0x36')+_0x4f1b45+_0x2c45('0x37');var _0x12ee5e={'to':[_0x105350[_0x2c45('0x26')]],'message':{'type':'text','text':_0x105350[_0x2c45('0xf')]}};var _0x1e3ea4={'method':_0x2c45('0x38'),'uri':_0x25c979,'headers':{'Authorization':_0x2c45('0x39')+_0x3ace6a,'Content-Type':'application/json'},'body':_0x12ee5e,'json':!![]};rp(_0x1e3ea4)[_0x2c45('0x1b')](function(_0x2da894){if(_0x2da894['statuses'][0x0][_0x2c45('0x3a')]){return _0x2499b6['update']({'messageId':_0x2da894[_0x2c45('0x3b')][0x0]['message_id']});}})[_0x2c45('0x2f')](function(_0x1955f7){logger[_0x2c45('0x3c')](_0x2c45('0x3d'),_0x1955f7);});break;}}})[_0x2c45('0x3e')](function(){_0x3957a4();});}else{_0x3957a4();}}},'charset':_0x2c45('0x3f'),'collate':_0x2c45('0x40')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 6f1c18e..765456b 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 _0x4fa9=['then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register'];(function(_0x2684ad,_0x45ffd1){var _0x49e485=function(_0x328e41){while(--_0x328e41){_0x2684ad['push'](_0x2684ad['shift']());}};_0x49e485(++_0x45ffd1);}(_0x4fa9,0x1aa));var _0x94fa=function(_0x14ad5c,_0x3edcaa){_0x14ad5c=_0x14ad5c-0x0;var _0x4012b8=_0x4fa9[_0x14ad5c];return _0x4012b8;};'use strict';var _=require('lodash');var util=require(_0x94fa('0x0'));var moment=require(_0x94fa('0x1'));var BPromise=require(_0x94fa('0x2'));var rs=require(_0x94fa('0x3'));var fs=require('fs');var Redis=require(_0x94fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x94fa('0x5'));var logger=require(_0x94fa('0x6'))(_0x94fa('0x7'));var config=require(_0x94fa('0x8'));var jayson=require(_0x94fa('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x94fa('0xa')]=_[_0x94fa('0xb')](config['redis'],{'host':_0x94fa('0xc'),'port':0x18eb});var socket=require(_0x94fa('0xd'))(new Redis(config['redis']));require(_0x94fa('0xe'))[_0x94fa('0xf')](socket);function respondWithRpcPromise(_0x7e649b,_0x4005e4,_0x25ce0e){return new BPromise(function(_0x324aed,_0x5c0e67){return client['request'](_0x7e649b,_0x25ce0e)[_0x94fa('0x10')](function(_0x4fbda1){logger['info'](_0x94fa('0x11'),_0x4005e4,_0x94fa('0x12'));logger[_0x94fa('0x13')](_0x94fa('0x14'),_0x4005e4,_0x94fa('0x12'),JSON[_0x94fa('0x15')](_0x4fbda1));if(_0x4fbda1[_0x94fa('0x16')]){if(_0x4fbda1['error'][_0x94fa('0x17')]===0x1f4){logger['error'](_0x94fa('0x11'),_0x4005e4,_0x4fbda1[_0x94fa('0x16')][_0x94fa('0x18')]);return _0x5c0e67(_0x4fbda1[_0x94fa('0x16')][_0x94fa('0x18')]);}logger[_0x94fa('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x4005e4,_0x4fbda1[_0x94fa('0x16')]['message']);return _0x324aed(_0x4fbda1[_0x94fa('0x16')][_0x94fa('0x18')]);}else{logger[_0x94fa('0x19')](_0x94fa('0x11'),_0x4005e4,_0x94fa('0x12'));_0x324aed(_0x4fbda1[_0x94fa('0x1a')][_0x94fa('0x18')]);}})[_0x94fa('0x1b')](function(_0x46c7de){logger[_0x94fa('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x4005e4,_0x46c7de);_0x5c0e67(_0x46c7de);});});}exports[_0x94fa('0x1c')]=function(_0x480a67){var _0x13f11e=this;return new Promise(function(_0x2e0a01,_0x378525){return db[_0x94fa('0x1d')][_0x94fa('0x1e')](_0x480a67[_0x94fa('0x1f')],{'raw':_0x480a67[_0x94fa('0x20')]?_0x480a67[_0x94fa('0x20')][_0x94fa('0x21')]===undefined?!![]:![]:!![]})[_0x94fa('0x10')](function(_0x4fbdbc){logger[_0x94fa('0x19')](_0x94fa('0x1c'),_0x480a67);logger['debug'](_0x94fa('0x1c'),_0x480a67,JSON['stringify'](_0x4fbdbc));_0x2e0a01(_0x4fbdbc);})['catch'](function(_0x220b3b){logger[_0x94fa('0x16')]('CreateWhatsappMessage',_0x220b3b[_0x94fa('0x18')],_0x480a67);_0x378525(_0x13f11e['error'](0x1f4,_0x220b3b[_0x94fa('0x18')]));});});}; \ No newline at end of file +var _0xa4d5=['WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateWhatsappMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2851cf,_0x5516e6){var _0x11fb18=function(_0x57a199){while(--_0x57a199){_0x2851cf['push'](_0x2851cf['shift']());}};_0x11fb18(++_0x5516e6);}(_0xa4d5,0x6a));var _0x5a4d=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0xa4d5[_0xfad1a7];return _0x571012;};'use strict';var _=require(_0x5a4d('0x0'));var util=require(_0x5a4d('0x1'));var moment=require(_0x5a4d('0x2'));var BPromise=require(_0x5a4d('0x3'));var rs=require(_0x5a4d('0x4'));var fs=require('fs');var Redis=require(_0x5a4d('0x5'));var db=require(_0x5a4d('0x6'))['db'];var utils=require(_0x5a4d('0x7'));var logger=require(_0x5a4d('0x8'))(_0x5a4d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a4d('0xa')]['http']({'port':0x232a});config['redis']=_[_0x5a4d('0xb')](config[_0x5a4d('0xc')],{'host':_0x5a4d('0xd'),'port':0x18eb});var socket=require(_0x5a4d('0xe'))(new Redis(config[_0x5a4d('0xc')]));require(_0x5a4d('0xf'))[_0x5a4d('0x10')](socket);function respondWithRpcPromise(_0x4f59d7,_0x460f72,_0x2ec5cf){return new BPromise(function(_0x17fac3,_0x1bb611){return client[_0x5a4d('0x11')](_0x4f59d7,_0x2ec5cf)[_0x5a4d('0x12')](function(_0x47b5e6){logger[_0x5a4d('0x13')](_0x5a4d('0x14'),_0x460f72,_0x5a4d('0x15'));logger['debug'](_0x5a4d('0x16'),_0x460f72,_0x5a4d('0x15'),JSON['stringify'](_0x47b5e6));if(_0x47b5e6[_0x5a4d('0x17')]){if(_0x47b5e6[_0x5a4d('0x17')]['code']===0x1f4){logger[_0x5a4d('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x460f72,_0x47b5e6['error'][_0x5a4d('0x18')]);return _0x1bb611(_0x47b5e6[_0x5a4d('0x17')]['message']);}logger['error'](_0x5a4d('0x14'),_0x460f72,_0x47b5e6[_0x5a4d('0x17')][_0x5a4d('0x18')]);return _0x17fac3(_0x47b5e6['error'][_0x5a4d('0x18')]);}else{logger[_0x5a4d('0x13')](_0x5a4d('0x14'),_0x460f72,_0x5a4d('0x15'));_0x17fac3(_0x47b5e6[_0x5a4d('0x19')][_0x5a4d('0x18')]);}})[_0x5a4d('0x1a')](function(_0x7ba0f7){logger[_0x5a4d('0x17')](_0x5a4d('0x14'),_0x460f72,_0x7ba0f7);_0x1bb611(_0x7ba0f7);});});}exports[_0x5a4d('0x1b')]=function(_0x1cf89c){var _0x3fe69f=this;return new Promise(function(_0x51e551,_0x278f1c){return db['WhatsappMessage']['create'](_0x1cf89c[_0x5a4d('0x1c')],{'raw':_0x1cf89c[_0x5a4d('0x1d')]?_0x1cf89c[_0x5a4d('0x1d')][_0x5a4d('0x1e')]===undefined?!![]:![]:!![]})[_0x5a4d('0x12')](function(_0x1b3683){logger[_0x5a4d('0x13')](_0x5a4d('0x1b'),_0x1cf89c);logger['debug'](_0x5a4d('0x1b'),_0x1cf89c,JSON[_0x5a4d('0x1f')](_0x1b3683));_0x51e551(_0x1b3683);})[_0x5a4d('0x1a')](function(_0x423786){logger['error'](_0x5a4d('0x1b'),_0x423786['message'],_0x1cf89c);_0x278f1c(_0x3fe69f[_0x5a4d('0x17')](0x1f4,_0x423786[_0x5a4d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index c701ea8..04b0c78 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 _0xa596=['./whatsappMessage.events','save','remove','update','emit','register','length','whatsappMessage:'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0xa596,0x1a0));var _0x6a59=function(_0x24208c,_0x1dc00b){_0x24208c=_0x24208c-0x0;var _0x334b12=_0xa596[_0x24208c];return _0x334b12;};'use strict';var WhatsappMessageEvents=require(_0x6a59('0x0'));var events=[_0x6a59('0x1'),_0x6a59('0x2'),_0x6a59('0x3')];function createListener(_0x6e0b,_0x1c01f9){return function(_0x1ce731){_0x1c01f9[_0x6a59('0x4')](_0x6e0b,_0x1ce731);};}function removeListener(_0x24e04d,_0x421fe5){return function(){WhatsappMessageEvents['removeListener'](_0x24e04d,_0x421fe5);};}exports[_0x6a59('0x5')]=function(_0x5e6d18){for(var _0x113c4c=0x0,_0x2eb40f=events[_0x6a59('0x6')];_0x113c4c<_0x2eb40f;_0x113c4c++){var _0x2e7894=events[_0x113c4c];var _0x188ee5=createListener(_0x6a59('0x7')+_0x2e7894,_0x5e6d18);WhatsappMessageEvents['on'](_0x2e7894,_0x188ee5);}}; \ No newline at end of file +var _0xbb7d=['save','remove','update','emit','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x1cdc8d,_0x1e5b71){var _0x267c57=function(_0x9fab80){while(--_0x9fab80){_0x1cdc8d['push'](_0x1cdc8d['shift']());}};_0x267c57(++_0x1e5b71);}(_0xbb7d,0x1aa));var _0xdbb7=function(_0xad0f15,_0x56a81a){_0xad0f15=_0xad0f15-0x0;var _0x2ff730=_0xbb7d[_0xad0f15];return _0x2ff730;};'use strict';var WhatsappMessageEvents=require(_0xdbb7('0x0'));var events=[_0xdbb7('0x1'),_0xdbb7('0x2'),_0xdbb7('0x3')];function createListener(_0x3bfc01,_0x59fea9){return function(_0x5214d4){_0x59fea9[_0xdbb7('0x4')](_0x3bfc01,_0x5214d4);};}function removeListener(_0x1a768f,_0x55cc1c){return function(){WhatsappMessageEvents['removeListener'](_0x1a768f,_0x55cc1c);};}exports['register']=function(_0x5adb24){for(var _0x4c1e05=0x0,_0x24aa92=events[_0xdbb7('0x5')];_0x4c1e05<_0x24aa92;_0x4c1e05++){var _0x178738=events[_0x4c1e05];var _0x5a4961=createListener(_0xdbb7('0x6')+_0x178738,_0x5adb24);WhatsappMessageEvents['on'](_0x178738,_0x5a4961);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 216e412..4e5388e 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 _0xf56d=['/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers'];(function(_0x41f61d,_0x223306){var _0x1dfce4=function(_0x103c19){while(--_0x103c19){_0x41f61d['push'](_0x41f61d['shift']());}};_0x1dfce4(++_0x223306);}(_0xf56d,0xc5));var _0xdf56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf56d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdf56('0x0'));var util=require(_0xdf56('0x1'));var path=require(_0xdf56('0x2'));var timeout=require(_0xdf56('0x3'));var express=require(_0xdf56('0x4'));var router=express[_0xdf56('0x5')]();var fs_extra=require(_0xdf56('0x6'));var auth=require(_0xdf56('0x7'));var interaction=require(_0xdf56('0x8'));var config=require(_0xdf56('0x9'));var controller=require(_0xdf56('0xa'));router[_0xdf56('0xb')]('/',auth['isAuthenticated'](),controller[_0xdf56('0xc')]);router[_0xdf56('0xb')](_0xdf56('0xd'),auth[_0xdf56('0xe')](),controller[_0xdf56('0xf')]);router[_0xdf56('0xb')](_0xdf56('0x10'),auth[_0xdf56('0xe')](),controller[_0xdf56('0x11')]);router[_0xdf56('0xb')](_0xdf56('0x12'),auth[_0xdf56('0xe')](),controller[_0xdf56('0x13')]);router[_0xdf56('0xb')](_0xdf56('0x14'),auth[_0xdf56('0xe')](),controller[_0xdf56('0x15')]);router['get'](_0xdf56('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xdf56('0x17')]('/',auth[_0xdf56('0xe')](),controller[_0xdf56('0x18')]);router['post'](_0xdf56('0x14'),auth[_0xdf56('0xe')](),controller[_0xdf56('0x19')]);router[_0xdf56('0x17')](_0xdf56('0x16'),auth[_0xdf56('0xe')](),controller['addAgents']);router[_0xdf56('0x1a')](_0xdf56('0x10'),auth[_0xdf56('0xe')](),controller[_0xdf56('0x1b')]);router[_0xdf56('0x1c')]('/:id',auth[_0xdf56('0xe')](),controller['destroy']);router[_0xdf56('0x1c')]('/:id/teams',auth[_0xdf56('0xe')](),controller[_0xdf56('0x1d')]);router[_0xdf56('0x1c')](_0xdf56('0x16'),auth['isAuthenticated'](),controller[_0xdf56('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x8b88=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents','update','delete','destroy','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5b1d2d,_0x26f07b){var _0x2dd369=function(_0xfc0b7e){while(--_0xfc0b7e){_0x5b1d2d['push'](_0x5b1d2d['shift']());}};_0x2dd369(++_0x26f07b);}(_0x8b88,0x1a8));var _0x88b8=function(_0x594894,_0xd3baee){_0x594894=_0x594894-0x0;var _0x4d3413=_0x8b88[_0x594894];return _0x4d3413;};'use strict';var multer=require(_0x88b8('0x0'));var util=require(_0x88b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x88b8('0x2'));var router=express[_0x88b8('0x3')]();var fs_extra=require(_0x88b8('0x4'));var auth=require(_0x88b8('0x5'));var interaction=require(_0x88b8('0x6'));var config=require(_0x88b8('0x7'));var controller=require('./whatsappQueue.controller');router[_0x88b8('0x8')]('/',auth[_0x88b8('0x9')](),controller[_0x88b8('0xa')]);router[_0x88b8('0x8')]('/describe',auth[_0x88b8('0x9')](),controller[_0x88b8('0xb')]);router[_0x88b8('0x8')](_0x88b8('0xc'),auth[_0x88b8('0x9')](),controller[_0x88b8('0xd')]);router[_0x88b8('0x8')](_0x88b8('0xe'),auth[_0x88b8('0x9')](),controller[_0x88b8('0xf')]);router[_0x88b8('0x8')](_0x88b8('0x10'),auth[_0x88b8('0x9')](),controller[_0x88b8('0x11')]);router[_0x88b8('0x8')](_0x88b8('0x12'),auth[_0x88b8('0x9')](),controller[_0x88b8('0x13')]);router['post']('/',auth[_0x88b8('0x9')](),controller[_0x88b8('0x14')]);router['post']('/:id/teams',auth[_0x88b8('0x9')](),controller[_0x88b8('0x15')]);router[_0x88b8('0x16')](_0x88b8('0x12'),auth[_0x88b8('0x9')](),controller[_0x88b8('0x17')]);router['put'](_0x88b8('0xc'),auth['isAuthenticated'](),controller[_0x88b8('0x18')]);router[_0x88b8('0x19')](_0x88b8('0xc'),auth[_0x88b8('0x9')](),controller[_0x88b8('0x1a')]);router[_0x88b8('0x19')]('/:id/teams',auth[_0x88b8('0x9')](),controller['removeTeams']);router[_0x88b8('0x19')](_0x88b8('0x12'),auth[_0x88b8('0x9')](),controller[_0x88b8('0x1b')]);module[_0x88b8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index ae8a487..525ae09 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 _0x13c0=['roundrobin','sequelize','exports','STRING','name','beepall'];(function(_0x494c01,_0x5a74fe){var _0x584980=function(_0x1d2ad5){while(--_0x1d2ad5){_0x494c01['push'](_0x494c01['shift']());}};_0x584980(++_0x5a74fe);}(_0x13c0,0x79));var _0x013c=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0x13c0[_0x4d67b8];return _0x55af3b;};'use strict';var Sequelize=require(_0x013c('0x0'));module[_0x013c('0x1')]={'name':{'type':Sequelize[_0x013c('0x2')],'unique':_0x013c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x013c('0x4'),_0x013c('0x5'))},'description':{'type':Sequelize[_0x013c('0x2')]}}; \ No newline at end of file +var _0x132f=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x132f,0x182));var _0xf132=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x132f[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0xf132('0x0'));module[_0xf132('0x1')]={'name':{'type':Sequelize[_0xf132('0x2')],'unique':_0xf132('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf132('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf132('0x5')]('rrmemory',_0xf132('0x6'),_0xf132('0x7'))},'description':{'type':Sequelize[_0xf132('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 5830643..ee8b557 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 _0xaaf4=['api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','apply','then','destroy','get','WhatsappQueues','UserProfileResource','end','sendStatus','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','catch','show','params','fields','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','findAll','User','UserId','agent','whatsappPause','updatedAt','rows','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x152fd0,_0x9e077e){var _0x1e243f=function(_0x3874f7){while(--_0x3874f7){_0x152fd0['push'](_0x152fd0['shift']());}};_0x1e243f(++_0x9e077e);}(_0xaaf4,0x100));var _0x4aaf=function(_0x2bb377,_0x1f7733){_0x2bb377=_0x2bb377-0x0;var _0x51b541=_0xaaf4[_0x2bb377];return _0x51b541;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4aaf('0x0'));var jsonpatch=require(_0x4aaf('0x1'));var rp=require(_0x4aaf('0x2'));var moment=require(_0x4aaf('0x3'));var BPromise=require(_0x4aaf('0x4'));var Mustache=require('mustache');var util=require(_0x4aaf('0x5'));var path=require(_0x4aaf('0x6'));var sox=require(_0x4aaf('0x7'));var csv=require(_0x4aaf('0x8'));var ejs=require(_0x4aaf('0x9'));var fs=require('fs');var fs_extra=require(_0x4aaf('0xa'));var _=require(_0x4aaf('0xb'));var squel=require('squel');var crypto=require(_0x4aaf('0xc'));var jsforce=require(_0x4aaf('0xd'));var deskjs=require(_0x4aaf('0xe'));var toCsv=require(_0x4aaf('0x8'));var querystring=require(_0x4aaf('0xf'));var Papa=require(_0x4aaf('0x10'));var Redis=require(_0x4aaf('0x11'));var authService=require(_0x4aaf('0x12'));var qs=require(_0x4aaf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aaf('0x14'));var logger=require(_0x4aaf('0x15'))(_0x4aaf('0x16'));var utils=require('../../config/utils');var config=require(_0x4aaf('0x17'));var licenseUtil=require(_0x4aaf('0x18'));var db=require(_0x4aaf('0x19'))['db'];config[_0x4aaf('0x1a')]=_[_0x4aaf('0x1b')](config[_0x4aaf('0x1a')],{'host':_0x4aaf('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4aaf('0x1a')]));require('./whatsappQueue.socket')[_0x4aaf('0x1d')](socket);function respondWithStatusCode(_0x5611b7,_0x4e2086){_0x4e2086=_0x4e2086||0xcc;return function(_0x5b41b1){if(_0x5b41b1){return _0x5611b7['sendStatus'](_0x4e2086);}return _0x5611b7[_0x4aaf('0x1e')](_0x4e2086)['end']();};}function respondWithResult(_0x23a675,_0x5bef02){_0x5bef02=_0x5bef02||0xc8;return function(_0x2bb0a3){if(_0x2bb0a3){return _0x23a675[_0x4aaf('0x1e')](_0x5bef02)[_0x4aaf('0x1f')](_0x2bb0a3);}};}function respondWithFilteredResult(_0x1e5509,_0x50ecdc){return function(_0x36bf9a){if(_0x36bf9a){var _0x2f7390=typeof _0x50ecdc[_0x4aaf('0x20')]===_0x4aaf('0x21')&&typeof _0x50ecdc[_0x4aaf('0x22')]===_0x4aaf('0x21');var _0x163e49=_0x36bf9a[_0x4aaf('0x23')];var _0x5770b5=_0x2f7390?0x0:_0x50ecdc[_0x4aaf('0x20')];var _0xcf341a=_0x2f7390?_0x36bf9a['count']:_0x50ecdc[_0x4aaf('0x20')]+_0x50ecdc['limit'];var _0x68ef38;if(_0xcf341a>=_0x163e49){_0xcf341a=_0x163e49;_0x68ef38=0xc8;}else{_0x68ef38=0xce;}_0x1e5509['status'](_0x68ef38);return _0x1e5509['set']('Content-Range',_0x5770b5+'-'+_0xcf341a+'/'+_0x163e49)[_0x4aaf('0x1f')](_0x36bf9a);}return null;};}function patchUpdates(_0x49b312){return function(_0x2362da){try{jsonpatch[_0x4aaf('0x24')](_0x2362da,_0x49b312,!![]);}catch(_0x275492){return BPromise['reject'](_0x275492);}return _0x2362da['save']();};}function saveUpdates(_0x1789e8,_0x56d383){return function(_0x58eaa0){if(_0x58eaa0){return _0x58eaa0['update'](_0x1789e8)[_0x4aaf('0x25')](function(_0x2231ac){return _0x2231ac;});}return null;};}function removeEntity(_0x58518f,_0x5b442c){return function(_0x2db185){if(_0x2db185){return _0x2db185[_0x4aaf('0x26')]()[_0x4aaf('0x25')](function(){var _0x34901e=_0x2db185[_0x4aaf('0x27')]({'plain':!![]});var _0x43e27e=_0x4aaf('0x28');return db[_0x4aaf('0x29')][_0x4aaf('0x26')]({'where':{'type':_0x43e27e,'resourceId':_0x34901e['id']}})[_0x4aaf('0x25')](function(){return _0x2db185;});})[_0x4aaf('0x25')](function(){_0x58518f['status'](0xcc)[_0x4aaf('0x2a')]();});}};}function handleEntityNotFound(_0x16353c,_0x1aa8e0){return function(_0x154b1d){if(!_0x154b1d){_0x16353c[_0x4aaf('0x2b')](0x194);}return _0x154b1d;};}function handleError(_0x1a4e86,_0x5f4fb0){_0x5f4fb0=_0x5f4fb0||0x1f4;return function(_0x58e633){logger[_0x4aaf('0x2c')](_0x58e633[_0x4aaf('0x2d')]);if(_0x58e633[_0x4aaf('0x2e')]){delete _0x58e633['name'];}_0x1a4e86[_0x4aaf('0x1e')](_0x5f4fb0)[_0x4aaf('0x2f')](_0x58e633);};}exports['index']=function(_0x247b6d,_0x29690a){var _0x6f3a55={},_0x2aac3b={},_0x43f175={'count':0x0,'rows':[]};var _0x4eb5d6=_[_0x4aaf('0x30')](db[_0x4aaf('0x31')][_0x4aaf('0x32')],function(_0x5c55ab){return{'name':_0x5c55ab[_0x4aaf('0x33')],'type':_0x5c55ab[_0x4aaf('0x34')]['key']};});_0x2aac3b[_0x4aaf('0x35')]=_[_0x4aaf('0x30')](_0x4eb5d6,'name');_0x2aac3b[_0x4aaf('0x36')]=_[_0x4aaf('0x37')](_0x247b6d[_0x4aaf('0x36')]);_0x2aac3b['filters']=_[_0x4aaf('0x38')](_0x2aac3b[_0x4aaf('0x35')],_0x2aac3b[_0x4aaf('0x36')]);_0x6f3a55[_0x4aaf('0x39')]=_[_0x4aaf('0x38')](_0x2aac3b[_0x4aaf('0x35')],qs['fields'](_0x247b6d['query']['fields']));_0x6f3a55[_0x4aaf('0x39')]=_0x6f3a55[_0x4aaf('0x39')][_0x4aaf('0x3a')]?_0x6f3a55['attributes']:_0x2aac3b['model'];if(!_0x247b6d[_0x4aaf('0x36')][_0x4aaf('0x3b')]('nolimit')){_0x6f3a55[_0x4aaf('0x22')]=qs[_0x4aaf('0x22')](_0x247b6d[_0x4aaf('0x36')][_0x4aaf('0x22')]);_0x6f3a55[_0x4aaf('0x20')]=qs[_0x4aaf('0x20')](_0x247b6d['query']['offset']);}_0x6f3a55[_0x4aaf('0x3c')]=qs[_0x4aaf('0x3d')](_0x247b6d[_0x4aaf('0x36')]['sort']);_0x6f3a55['where']=qs['filters'](_[_0x4aaf('0x3e')](_0x247b6d[_0x4aaf('0x36')],_0x2aac3b[_0x4aaf('0x3f')]),_0x4eb5d6);if(_0x247b6d['query'][_0x4aaf('0x40')]){_0x6f3a55[_0x4aaf('0x41')]=_[_0x4aaf('0x42')](_0x6f3a55['where'],{'$or':_['map'](_0x4eb5d6,function(_0x3dc605){if(_0x3dc605[_0x4aaf('0x34')]!==_0x4aaf('0x43')){var _0x111c93={};_0x111c93[_0x3dc605['name']]={'$like':'%'+_0x247b6d[_0x4aaf('0x36')]['filter']+'%'};return _0x111c93;}})});}_0x6f3a55=_[_0x4aaf('0x42')]({},_0x6f3a55,_0x247b6d[_0x4aaf('0x44')]);var _0x45a341={'where':_0x6f3a55[_0x4aaf('0x41')]};return db[_0x4aaf('0x31')][_0x4aaf('0x23')](_0x45a341)[_0x4aaf('0x25')](function(_0x10a9c3){_0x43f175[_0x4aaf('0x23')]=_0x10a9c3;if(_0x247b6d[_0x4aaf('0x36')]['includeAll']){_0x6f3a55[_0x4aaf('0x45')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x6f3a55);})[_0x4aaf('0x25')](function(_0x97309d){_0x43f175['rows']=_0x97309d;return _0x43f175;})[_0x4aaf('0x25')](respondWithFilteredResult(_0x29690a,_0x6f3a55))[_0x4aaf('0x46')](handleError(_0x29690a,null));};exports[_0x4aaf('0x47')]=function(_0x5d910d,_0x522fe8){var _0x23d307={'raw':!![],'where':{'id':_0x5d910d[_0x4aaf('0x48')]['id']}},_0x30ca3f={};_0x30ca3f[_0x4aaf('0x35')]=_[_0x4aaf('0x37')](db[_0x4aaf('0x31')][_0x4aaf('0x32')]);_0x30ca3f[_0x4aaf('0x36')]=_[_0x4aaf('0x37')](_0x5d910d['query']);_0x30ca3f['filters']=_['intersection'](_0x30ca3f['model'],_0x30ca3f[_0x4aaf('0x36')]);_0x23d307[_0x4aaf('0x39')]=_[_0x4aaf('0x38')](_0x30ca3f[_0x4aaf('0x35')],qs[_0x4aaf('0x49')](_0x5d910d[_0x4aaf('0x36')]['fields']));_0x23d307[_0x4aaf('0x39')]=_0x23d307['attributes'][_0x4aaf('0x3a')]?_0x23d307[_0x4aaf('0x39')]:_0x30ca3f['model'];if(_0x5d910d[_0x4aaf('0x36')][_0x4aaf('0x4a')]){_0x23d307['include']=[{'all':!![]}];}_0x23d307=_[_0x4aaf('0x42')]({},_0x23d307,_0x5d910d['options']);return db[_0x4aaf('0x31')][_0x4aaf('0x4b')](_0x23d307)[_0x4aaf('0x25')](handleEntityNotFound(_0x522fe8,null))[_0x4aaf('0x25')](respondWithResult(_0x522fe8,null))[_0x4aaf('0x46')](handleError(_0x522fe8,null));};exports[_0x4aaf('0x4c')]=function(_0x3b119c,_0x36ddbe){return db[_0x4aaf('0x31')][_0x4aaf('0x4c')](_0x3b119c[_0x4aaf('0x4d')],{})[_0x4aaf('0x25')](function(_0x590201){var _0x4d9055=_0x3b119c['user'][_0x4aaf('0x27')]({'plain':!![]});if(!_0x4d9055)throw new Error(_0x4aaf('0x4e'));if(_0x4d9055[_0x4aaf('0x4f')]===_0x4aaf('0x50')){var _0x456984=_0x590201[_0x4aaf('0x27')]({'plain':!![]});var _0x445ec1=_0x4aaf('0x28');return db[_0x4aaf('0x51')]['find']({'where':{'name':_0x445ec1,'userProfileId':_0x4d9055[_0x4aaf('0x52')]},'raw':!![]})[_0x4aaf('0x25')](function(_0x2065d9){if(_0x2065d9&&_0x2065d9[_0x4aaf('0x53')]===0x0){return db[_0x4aaf('0x29')][_0x4aaf('0x4c')]({'name':_0x456984[_0x4aaf('0x2e')],'resourceId':_0x456984['id'],'type':_0x2065d9[_0x4aaf('0x2e')],'sectionId':_0x2065d9['id']},{})[_0x4aaf('0x25')](function(){return _0x590201;});}else{return _0x590201;}})[_0x4aaf('0x46')](function(_0x363909){logger[_0x4aaf('0x2c')](_0x4aaf('0x54'),_0x363909);throw _0x363909;});}return _0x590201;})[_0x4aaf('0x25')](respondWithResult(_0x36ddbe,0xc9))['catch'](handleError(_0x36ddbe,null));};exports[_0x4aaf('0x55')]=function(_0x2bd572,_0x598e56){if(_0x2bd572[_0x4aaf('0x4d')]['id']){delete _0x2bd572[_0x4aaf('0x4d')]['id'];}return db[_0x4aaf('0x31')][_0x4aaf('0x4b')]({'where':{'id':_0x2bd572['params']['id']}})[_0x4aaf('0x25')](handleEntityNotFound(_0x598e56,null))['then'](saveUpdates(_0x2bd572['body'],null))['then'](respondWithResult(_0x598e56,null))[_0x4aaf('0x46')](handleError(_0x598e56,null));};exports[_0x4aaf('0x26')]=function(_0x42b607,_0xcf919c){return db['WhatsappQueue']['find']({'where':{'id':_0x42b607[_0x4aaf('0x48')]['id']}})[_0x4aaf('0x25')](handleEntityNotFound(_0xcf919c,null))[_0x4aaf('0x25')](removeEntity(_0xcf919c,null))[_0x4aaf('0x46')](handleError(_0xcf919c,null));};exports[_0x4aaf('0x56')]=function(_0x435406,_0x2ab0c5){return db[_0x4aaf('0x31')]['describe']()[_0x4aaf('0x25')](respondWithResult(_0x2ab0c5,null))[_0x4aaf('0x46')](handleError(_0x2ab0c5,null));};exports['getMembers']=function(_0x220816,_0x236f5d,_0x4923e4){var _0x2a2242={'raw':!![],'where':{}},_0x297d48={},_0x70f317;return db[_0x4aaf('0x31')][_0x4aaf('0x57')]({'where':{'id':_0x220816[_0x4aaf('0x48')]['id']}})[_0x4aaf('0x25')](handleEntityNotFound(_0x236f5d,null))[_0x4aaf('0x25')](function(_0x5bdc46){if(_0x5bdc46){_0x70f317=_0x5bdc46[_0x4aaf('0x27')]({'plain':!![]});_0x297d48[_0x4aaf('0x35')]=_['keys'](db[_0x4aaf('0x58')][_0x4aaf('0x32')]);_0x297d48[_0x4aaf('0x36')]=_[_0x4aaf('0x37')](_0x220816[_0x4aaf('0x36')]);_0x297d48[_0x4aaf('0x3f')]=_['intersection'](_0x297d48[_0x4aaf('0x35')],_0x297d48[_0x4aaf('0x36')]);_0x2a2242[_0x4aaf('0x39')]=_[_0x4aaf('0x38')](_0x297d48[_0x4aaf('0x35')],qs[_0x4aaf('0x49')](_0x220816[_0x4aaf('0x36')]['fields']));_0x2a2242[_0x4aaf('0x39')]=_0x2a2242[_0x4aaf('0x39')][_0x4aaf('0x3a')]?_0x2a2242['attributes']:_0x297d48[_0x4aaf('0x35')];if(!_0x220816[_0x4aaf('0x36')][_0x4aaf('0x3b')](_0x4aaf('0x59'))){_0x2a2242[_0x4aaf('0x22')]=qs['limit'](_0x220816[_0x4aaf('0x36')][_0x4aaf('0x22')]);_0x2a2242[_0x4aaf('0x20')]=qs[_0x4aaf('0x20')](_0x220816[_0x4aaf('0x36')][_0x4aaf('0x20')]);}_0x2a2242[_0x4aaf('0x3c')]=qs[_0x4aaf('0x3d')](_0x220816[_0x4aaf('0x36')][_0x4aaf('0x3d')]);_0x2a2242[_0x4aaf('0x41')]=qs[_0x4aaf('0x3f')](_[_0x4aaf('0x3e')](_0x220816[_0x4aaf('0x36')],_0x297d48[_0x4aaf('0x3f')]));_0x2a2242['where'][_0x4aaf('0x5a')]=_0x5bdc46['id'];if(_0x220816[_0x4aaf('0x36')]['filter']){_0x2a2242[_0x4aaf('0x41')]=_[_0x4aaf('0x42')](_0x2a2242[_0x4aaf('0x41')],{'$or':_[_0x4aaf('0x30')](_0x2a2242[_0x4aaf('0x39')],function(_0x2e4fe2){var _0x239a7e={};_0x239a7e[_0x2e4fe2]={'$like':'%'+_0x220816[_0x4aaf('0x36')][_0x4aaf('0x40')]+'%'};return _0x239a7e;})});}_0x2a2242=_['merge']({},_0x2a2242,_0x220816[_0x4aaf('0x44')]);return db[_0x4aaf('0x58')][_0x4aaf('0x5b')](_0x2a2242);}})[_0x4aaf('0x25')](function(_0x4446dc){if(_0x4446dc){return db[_0x4aaf('0x5c')]['findAndCountAll']({'where':{'id':_[_0x4aaf('0x30')](_0x4446dc,_0x4aaf('0x5d')),'role':_0x4aaf('0x5e')},'attributes':['id',_0x4aaf('0x2e'),_0x4aaf('0x5f'),_0x4aaf('0x60'),'createdAt']});}})[_0x4aaf('0x25')](function(_0xdfc567){if(_0xdfc567){return{'count':_0xdfc567[_0x4aaf('0x23')],'rows':_[_0x4aaf('0x30')](_0xdfc567[_0x4aaf('0x61')],function(_0x4f72a9){return{'membername':_0x4f72a9[_0x4aaf('0x2e')],'UserId':_0x4f72a9['id'],'queue_name':_0x70f317['name'],'WhatsappQueueId':_0x70f317['id'],'interface':util['format'](_0x4aaf('0x62'),_0x4aaf('0x63'),_0x4f72a9['name']),'penalty':0x0,'paused':_0x4f72a9[_0x4aaf('0x5f')],'createdAt':_0x4f72a9[_0x4aaf('0x64')],'updatedAt':_0x4f72a9[_0x4aaf('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4aaf('0x25')](respondWithFilteredResult(_0x236f5d,_0x2a2242))[_0x4aaf('0x46')](handleError(_0x236f5d,null));};exports['getTeams']=function(_0x33c54c,_0x5510e4,_0x356d34){var _0x4f608c={};var _0x943833={};var _0x2238c2;var _0x158531;return db[_0x4aaf('0x31')][_0x4aaf('0x57')]({'where':{'id':_0x33c54c['params']['id']}})[_0x4aaf('0x25')](handleEntityNotFound(_0x5510e4,null))['then'](function(_0x3321bf){if(_0x3321bf){_0x2238c2=_0x3321bf;_0x943833[_0x4aaf('0x35')]=_[_0x4aaf('0x37')](db[_0x4aaf('0x65')][_0x4aaf('0x32')]);_0x943833[_0x4aaf('0x36')]=_['keys'](_0x33c54c[_0x4aaf('0x36')]);_0x943833[_0x4aaf('0x3f')]=_[_0x4aaf('0x38')](_0x943833[_0x4aaf('0x35')],_0x943833['query']);_0x4f608c[_0x4aaf('0x39')]=_['intersection'](_0x943833[_0x4aaf('0x35')],qs['fields'](_0x33c54c[_0x4aaf('0x36')][_0x4aaf('0x49')]));_0x4f608c['attributes']=_0x4f608c[_0x4aaf('0x39')]['length']?_0x4f608c[_0x4aaf('0x39')]:_0x943833[_0x4aaf('0x35')];_0x4f608c[_0x4aaf('0x3c')]=qs[_0x4aaf('0x3d')](_0x33c54c[_0x4aaf('0x36')][_0x4aaf('0x3d')]);_0x4f608c[_0x4aaf('0x41')]=qs['filters'](_[_0x4aaf('0x3e')](_0x33c54c[_0x4aaf('0x36')],_0x943833['filters']));if(_0x33c54c[_0x4aaf('0x36')][_0x4aaf('0x40')]){_0x4f608c[_0x4aaf('0x41')]=_[_0x4aaf('0x42')](_0x4f608c[_0x4aaf('0x41')],{'$or':_[_0x4aaf('0x30')](_0x4f608c[_0x4aaf('0x39')],function(_0x2f3660){var _0x1b80dc={};_0x1b80dc[_0x2f3660]={'$like':'%'+_0x33c54c['query'][_0x4aaf('0x40')]+'%'};return _0x1b80dc;})});}_0x4f608c=_[_0x4aaf('0x42')]({},_0x4f608c,_0x33c54c[_0x4aaf('0x44')]);return _0x2238c2[_0x4aaf('0x66')](_0x4f608c);}})[_0x4aaf('0x25')](function(_0x229484){if(_0x229484){_0x158531=_0x229484[_0x4aaf('0x3a')];if(!_0x33c54c['query'][_0x4aaf('0x3b')](_0x4aaf('0x59'))){_0x4f608c[_0x4aaf('0x22')]=qs[_0x4aaf('0x22')](_0x33c54c[_0x4aaf('0x36')]['limit']);_0x4f608c[_0x4aaf('0x20')]=qs[_0x4aaf('0x20')](_0x33c54c['query'][_0x4aaf('0x20')]);}return _0x2238c2[_0x4aaf('0x66')](_0x4f608c);}})[_0x4aaf('0x25')](function(_0x3dc437){if(_0x3dc437){return _0x3dc437?{'count':_0x158531,'rows':_0x3dc437}:null;}})[_0x4aaf('0x25')](respondWithResult(_0x5510e4,null))[_0x4aaf('0x46')](handleError(_0x5510e4,null));};exports[_0x4aaf('0x67')]=function(_0x5bfb7d,_0x2df0f5,_0x5ab63c){var _0x17b6bf=_0x5bfb7d[_0x4aaf('0x4d')][_0x4aaf('0x68')];return db[_0x4aaf('0x65')][_0x4aaf('0x5b')]({'where':{'id':_0x17b6bf},'attributes':['id'],'include':[{'model':db[_0x4aaf('0x5c')],'as':_0x4aaf('0x69'),'attributes':['id',_0x4aaf('0x2e'),_0x4aaf('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x4aaf('0x25')](function(_0x16f461){if(_0x16f461){var _0x3e4d8b=_[_0x4aaf('0x6b')](_0x16f461,function(_0x14e409){var _0x1cfd52=_0x14e409[_0x4aaf('0x27')]({'plain':!![]});return _0x1cfd52[_0x4aaf('0x69')];});return db[_0x4aaf('0x31')][_0x4aaf('0x4b')]({'where':{'id':_0x5bfb7d[_0x4aaf('0x48')]['id']}})[_0x4aaf('0x25')](function(_0x488ead){return db[_0x4aaf('0x6c')][_0x4aaf('0x6d')](function(_0x2d4686){return _0x488ead[_0x4aaf('0x67')](_0x17b6bf,{'transaction':_0x2d4686})['then'](function(){return BPromise[_0x4aaf('0x6e')](_0x3e4d8b,function(_0x179abd){return db[_0x4aaf('0x58')][_0x4aaf('0x6f')]({'where':{'UserId':_0x179abd['id'],'WhatsappQueueId':_0x5bfb7d[_0x4aaf('0x48')]['id']},'transaction':_0x2d4686});});})[_0x4aaf('0x25')](function(){_0x3e4d8b[_0x4aaf('0x70')](function(_0xa90a7b){socket[_0x4aaf('0x71')](_0x4aaf('0x72'),{'UserId':_0xa90a7b['id'],'WhatsappQueueId':_0x488ead['id']});});});});});}})[_0x4aaf('0x25')](respondWithStatusCode(_0x2df0f5,null))[_0x4aaf('0x46')](handleError(_0x2df0f5,null));};exports[_0x4aaf('0x73')]=function(_0x4738c3,_0x2aadb0,_0x50260b){return db['Team'][_0x4aaf('0x5b')]({'where':{'id':_0x4738c3['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4aaf('0x5c')],'as':_0x4aaf('0x69'),'attributes':['id'],'raw':!![]}]})[_0x4aaf('0x25')](handleEntityNotFound(_0x2aadb0,null))[_0x4aaf('0x25')](function(_0x5845d8){var _0xd96872=_[_0x4aaf('0x30')](_0x5845d8,'id');var _0x34b439=[];var _0x104426=[];var _0x4e7f57=squel['select']();_0x4e7f57[_0x4aaf('0x74')]('tq.TeamId')[_0x4aaf('0x75')]('team_has_whatsapp_queues','tq')[_0x4aaf('0x76')](_0x4aaf('0x77'),'ut',_0x4aaf('0x78'))[_0x4aaf('0x41')](_0x4aaf('0x79'),_0x4738c3[_0x4aaf('0x48')]['id']);for(var _0x58d180=0x0;_0x58d180<_0x5845d8['length'];_0x58d180+=0x1){let _0x54832b=_0x5845d8[_0x58d180];for(var _0x1db3e3=0x0;_0x1db3e3<_0x54832b[_0x4aaf('0x69')][_0x4aaf('0x3a')];_0x1db3e3+=0x1){let _0x2c08e3=_0x54832b[_0x4aaf('0x69')][_0x1db3e3];var _0x44bac0=_0x4e7f57[_0x4aaf('0x7a')]();_0x44bac0[_0x4aaf('0x41')](_0x4aaf('0x7b'),_0x2c08e3['id']);_0x104426['push'](db[_0x4aaf('0x6c')][_0x4aaf('0x36')](_0x44bac0[_0x4aaf('0x7c')](),{'type':db[_0x4aaf('0x6c')][_0x4aaf('0x7d')][_0x4aaf('0x7e')]})[_0x4aaf('0x25')](function(_0x2ed38c){if(_0x2ed38c[_0x4aaf('0x3a')]===0x1){return _0x2c08e3['id'];}else{var _0x45b7bc=_[_0x4aaf('0x7f')](_['map'](_0x2ed38c,'TeamId'),function(_0x4c3412){return _['includes'](_0xd96872,_0x4c3412);});if(_0x45b7bc){return _0x2c08e3['id'];}}}));}}return BPromise[_0x4aaf('0x80')](_0x104426)[_0x4aaf('0x25')](function(_0x499079){_0x34b439=_(_0x34b439)['union'](_0x499079)[_0x4aaf('0x81')]()[_0x4aaf('0x82')]();return db[_0x4aaf('0x31')][_0x4aaf('0x4b')]({'where':{'id':_0x4738c3['params']['id']}})[_0x4aaf('0x25')](function(_0x2bcf8c){return db['sequelize'][_0x4aaf('0x6d')](function(_0x58202b){return _0x2bcf8c['removeTeams'](_0x4738c3['query']['ids'],{'transaction':_0x58202b})[_0x4aaf('0x25')](function(){if(!_[_0x4aaf('0x83')](_0x34b439)){return _0x2bcf8c[_0x4aaf('0x84')](_0x34b439,{'transaction':_0x58202b});}})['then'](function(){_0x34b439[_0x4aaf('0x70')](function(_0x5c6a86){socket[_0x4aaf('0x71')]('userWhatsappQueue:remove',{'UserId':_0x5c6a86,'WhatsappQueueId':_0x2bcf8c['id']});});});});});});})[_0x4aaf('0x25')](respondWithStatusCode(_0x2aadb0,null))[_0x4aaf('0x46')](handleError(_0x2aadb0,null));};exports[_0x4aaf('0x85')]=function(_0x16bec3,_0x7bafbb,_0x4232d2){return db[_0x4aaf('0x31')][_0x4aaf('0x4b')]({'where':{'id':_0x16bec3[_0x4aaf('0x48')]['id']}})[_0x4aaf('0x25')](handleEntityNotFound(_0x7bafbb,null))[_0x4aaf('0x25')](function(_0x26f71a){if(_0x26f71a){return _0x26f71a['addAgents'](_0x16bec3['body'][_0x4aaf('0x68')],_[_0x4aaf('0x86')](_0x16bec3['body'],[_0x4aaf('0x68'),'id'])||{})[_0x4aaf('0x87')](function(_0x447437){for(var _0x3f6d88=0x0;_0x3f6d88<_0x16bec3[_0x4aaf('0x4d')][_0x4aaf('0x68')]['length'];_0x3f6d88+=0x1){socket[_0x4aaf('0x71')](_0x4aaf('0x72'),{'UserId':Number(_0x16bec3[_0x4aaf('0x4d')][_0x4aaf('0x68')][_0x3f6d88]),'WhatsappQueueId':Number(_0x16bec3[_0x4aaf('0x48')]['id'])});}return _0x447437;});}})['then'](respondWithResult(_0x7bafbb,null))[_0x4aaf('0x46')](handleError(_0x7bafbb,null));};exports[_0x4aaf('0x84')]=function(_0x51971a,_0x53554b,_0x227a82){return db['WhatsappQueue'][_0x4aaf('0x4b')]({'where':{'id':_0x51971a['params']['id']}})[_0x4aaf('0x25')](handleEntityNotFound(_0x53554b,null))[_0x4aaf('0x25')](function(_0x197825){if(_0x197825){return _0x197825['removeAgents'](_0x51971a['query'][_0x4aaf('0x68')])[_0x4aaf('0x25')](function(){if(_[_0x4aaf('0x88')](_0x51971a[_0x4aaf('0x36')][_0x4aaf('0x68')])){for(var _0x44fbc4=0x0;_0x44fbc4<_0x51971a[_0x4aaf('0x36')][_0x4aaf('0x68')][_0x4aaf('0x3a')];_0x44fbc4+=0x1){socket[_0x4aaf('0x71')](_0x4aaf('0x89'),{'UserId':Number(_0x51971a[_0x4aaf('0x36')][_0x4aaf('0x68')][_0x44fbc4]),'WhatsappQueueId':Number(_0x51971a[_0x4aaf('0x48')]['id'])});}}else{socket[_0x4aaf('0x71')](_0x4aaf('0x89'),{'UserId':Number(_0x51971a[_0x4aaf('0x36')]['ids']),'WhatsappQueueId':Number(_0x51971a[_0x4aaf('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x53554b,null))[_0x4aaf('0x46')](handleError(_0x53554b,null));};exports[_0x4aaf('0x8a')]=function(_0x4c44f9,_0x3d58d4,_0x19bb42){var _0x4c2e70={};var _0xff783b={};var _0x5f42eb;var _0x17e4ce;return db[_0x4aaf('0x31')]['findOne']({'where':{'id':_0x4c44f9[_0x4aaf('0x48')]['id']}})[_0x4aaf('0x25')](handleEntityNotFound(_0x3d58d4,null))[_0x4aaf('0x25')](function(_0x51a258){if(_0x51a258){_0x5f42eb=_0x51a258;_0xff783b[_0x4aaf('0x35')]=_[_0x4aaf('0x37')](db['User']['rawAttributes']);_0xff783b[_0x4aaf('0x36')]=_[_0x4aaf('0x37')](_0x4c44f9[_0x4aaf('0x36')]);_0xff783b[_0x4aaf('0x3f')]=_[_0x4aaf('0x38')](_0xff783b[_0x4aaf('0x35')],_0xff783b[_0x4aaf('0x36')]);_0x4c2e70[_0x4aaf('0x39')]=_[_0x4aaf('0x38')](_0xff783b[_0x4aaf('0x35')],qs[_0x4aaf('0x49')](_0x4c44f9[_0x4aaf('0x36')]['fields']));_0x4c2e70['attributes']=_0x4c2e70[_0x4aaf('0x39')][_0x4aaf('0x3a')]?_0x4c2e70[_0x4aaf('0x39')]:_0xff783b[_0x4aaf('0x35')];_0x4c2e70[_0x4aaf('0x3c')]=qs[_0x4aaf('0x3d')](_0x4c44f9[_0x4aaf('0x36')][_0x4aaf('0x3d')]);_0x4c2e70[_0x4aaf('0x41')]=qs['filters'](_[_0x4aaf('0x3e')](_0x4c44f9[_0x4aaf('0x36')],_0xff783b[_0x4aaf('0x3f')]));if(_0x4c44f9['query'][_0x4aaf('0x40')]){_0x4c2e70['where']=_[_0x4aaf('0x42')](_0x4c2e70[_0x4aaf('0x41')],{'$or':_['map'](_0x4c2e70[_0x4aaf('0x39')],function(_0x3f6337){var _0x43b3c2={};_0x43b3c2[_0x3f6337]={'$like':'%'+_0x4c44f9[_0x4aaf('0x36')]['filter']+'%'};return _0x43b3c2;})});}_0x4c2e70=_[_0x4aaf('0x42')]({},_0x4c2e70,_0x4c44f9[_0x4aaf('0x44')]);return _0x5f42eb[_0x4aaf('0x8a')](_0x4c2e70);}})[_0x4aaf('0x25')](function(_0x5cbcf6){if(_0x5cbcf6){_0x17e4ce=_0x5cbcf6[_0x4aaf('0x3a')];if(!_0x4c44f9[_0x4aaf('0x36')][_0x4aaf('0x3b')](_0x4aaf('0x59'))){_0x4c2e70[_0x4aaf('0x22')]=qs[_0x4aaf('0x22')](_0x4c44f9[_0x4aaf('0x36')]['limit']);_0x4c2e70[_0x4aaf('0x20')]=qs[_0x4aaf('0x20')](_0x4c44f9[_0x4aaf('0x36')]['offset']);}return _0x5f42eb[_0x4aaf('0x8a')](_0x4c2e70);}})['then'](function(_0x1a7016){if(_0x1a7016){return _0x1a7016?{'count':_0x17e4ce,'rows':_0x1a7016}:null;}})[_0x4aaf('0x25')](respondWithResult(_0x3d58d4,null))[_0x4aaf('0x46')](handleError(_0x3d58d4,null));}; \ No newline at end of file +var _0x5fbc=['isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','WhatsappQueues','end','stack','name','send','map','WhatsappQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','Agents','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','value','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','removeAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fbc,0x8b));var _0xc5fb=function(_0x148d91,_0x1ba77f){_0x148d91=_0x148d91-0x0;var _0x4d97a8=_0x5fbc[_0x148d91];return _0x4d97a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5fb('0x0'));var zipdir=require(_0xc5fb('0x1'));var jsonpatch=require(_0xc5fb('0x2'));var rp=require(_0xc5fb('0x3'));var moment=require(_0xc5fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc5fb('0x5'));var util=require(_0xc5fb('0x6'));var path=require(_0xc5fb('0x7'));var sox=require(_0xc5fb('0x8'));var csv=require(_0xc5fb('0x9'));var ejs=require(_0xc5fb('0xa'));var fs=require('fs');var fs_extra=require(_0xc5fb('0xb'));var _=require(_0xc5fb('0xc'));var squel=require(_0xc5fb('0xd'));var crypto=require(_0xc5fb('0xe'));var jsforce=require(_0xc5fb('0xf'));var deskjs=require(_0xc5fb('0x10'));var toCsv=require(_0xc5fb('0x9'));var querystring=require(_0xc5fb('0x11'));var Papa=require(_0xc5fb('0x12'));var Redis=require(_0xc5fb('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc5fb('0x14'));var as=require(_0xc5fb('0x15'));var hardwareService=require(_0xc5fb('0x16'));var logger=require(_0xc5fb('0x17'))(_0xc5fb('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc5fb('0x19'));var db=require(_0xc5fb('0x1a'))['db'];config[_0xc5fb('0x1b')]=_[_0xc5fb('0x1c')](config[_0xc5fb('0x1b')],{'host':_0xc5fb('0x1d'),'port':0x18eb});var socket=require(_0xc5fb('0x1e'))(new Redis(config[_0xc5fb('0x1b')]));require('./whatsappQueue.socket')[_0xc5fb('0x1f')](socket);function respondWithStatusCode(_0x29aa77,_0x5a4ac7){_0x5a4ac7=_0x5a4ac7||0xcc;return function(_0x4a30a){if(_0x4a30a){return _0x29aa77[_0xc5fb('0x20')](_0x5a4ac7);}return _0x29aa77[_0xc5fb('0x21')](_0x5a4ac7)['end']();};}function respondWithResult(_0xa09e24,_0x3a2cf4){_0x3a2cf4=_0x3a2cf4||0xc8;return function(_0x53f69f){if(_0x53f69f){return _0xa09e24[_0xc5fb('0x21')](_0x3a2cf4)[_0xc5fb('0x22')](_0x53f69f);}};}function respondWithFilteredResult(_0x56cf96,_0x1c211f){return function(_0x1bdf1d){if(_0x1bdf1d){var _0x17c29a=typeof _0x1c211f[_0xc5fb('0x23')]===_0xc5fb('0x24')&&typeof _0x1c211f[_0xc5fb('0x25')]===_0xc5fb('0x24');var _0x72895a=_0x1bdf1d[_0xc5fb('0x26')];var _0x263bb8=_0x17c29a?0x0:_0x1c211f[_0xc5fb('0x23')];var _0x3559a6=_0x17c29a?_0x1bdf1d['count']:_0x1c211f[_0xc5fb('0x23')]+_0x1c211f[_0xc5fb('0x25')];var _0x1451c4;if(_0x3559a6>=_0x72895a){_0x3559a6=_0x72895a;_0x1451c4=0xc8;}else{_0x1451c4=0xce;}_0x56cf96[_0xc5fb('0x21')](_0x1451c4);return _0x56cf96['set'](_0xc5fb('0x27'),_0x263bb8+'-'+_0x3559a6+'/'+_0x72895a)[_0xc5fb('0x22')](_0x1bdf1d);}return null;};}function patchUpdates(_0x4ed13e){return function(_0x115aa9){try{jsonpatch[_0xc5fb('0x28')](_0x115aa9,_0x4ed13e,!![]);}catch(_0xeebd9b){return BPromise[_0xc5fb('0x29')](_0xeebd9b);}return _0x115aa9[_0xc5fb('0x2a')]();};}function saveUpdates(_0x2b8138,_0x3cd1f8){return function(_0xc22789){if(_0xc22789){return _0xc22789[_0xc5fb('0x2b')](_0x2b8138)[_0xc5fb('0x2c')](function(_0x3189ce){return _0x3189ce;});}return null;};}function removeEntity(_0x47e22d,_0x47cf36){return function(_0x314ced){if(_0x314ced){return _0x314ced[_0xc5fb('0x2d')]()[_0xc5fb('0x2c')](function(){var _0x92050d=_0x314ced['get']({'plain':!![]});var _0x3100e0=_0xc5fb('0x2e');return db['UserProfileResource'][_0xc5fb('0x2d')]({'where':{'type':_0x3100e0,'resourceId':_0x92050d['id']}})[_0xc5fb('0x2c')](function(){return _0x314ced;});})[_0xc5fb('0x2c')](function(){_0x47e22d[_0xc5fb('0x21')](0xcc)[_0xc5fb('0x2f')]();});}};}function handleEntityNotFound(_0x377496,_0x31f5ae){return function(_0xbce423){if(!_0xbce423){_0x377496[_0xc5fb('0x20')](0x194);}return _0xbce423;};}function handleError(_0x291515,_0x36c25a){_0x36c25a=_0x36c25a||0x1f4;return function(_0x41f61b){logger['error'](_0x41f61b[_0xc5fb('0x30')]);if(_0x41f61b[_0xc5fb('0x31')]){delete _0x41f61b[_0xc5fb('0x31')];}_0x291515[_0xc5fb('0x21')](_0x36c25a)[_0xc5fb('0x32')](_0x41f61b);};}exports['index']=function(_0x1bc72c,_0x570b44){var _0x2d2d64={},_0x22c7f3={},_0x21038d={'count':0x0,'rows':[]};var _0x317ae7=_[_0xc5fb('0x33')](db[_0xc5fb('0x34')]['rawAttributes'],function(_0x12e84b){return{'name':_0x12e84b[_0xc5fb('0x35')],'type':_0x12e84b['type'][_0xc5fb('0x36')]};});_0x22c7f3[_0xc5fb('0x37')]=_[_0xc5fb('0x33')](_0x317ae7,_0xc5fb('0x31'));_0x22c7f3[_0xc5fb('0x38')]=_[_0xc5fb('0x39')](_0x1bc72c[_0xc5fb('0x38')]);_0x22c7f3[_0xc5fb('0x3a')]=_[_0xc5fb('0x3b')](_0x22c7f3['model'],_0x22c7f3[_0xc5fb('0x38')]);_0x2d2d64[_0xc5fb('0x3c')]=_[_0xc5fb('0x3b')](_0x22c7f3[_0xc5fb('0x37')],qs[_0xc5fb('0x3d')](_0x1bc72c['query'][_0xc5fb('0x3d')]));_0x2d2d64[_0xc5fb('0x3c')]=_0x2d2d64[_0xc5fb('0x3c')][_0xc5fb('0x3e')]?_0x2d2d64[_0xc5fb('0x3c')]:_0x22c7f3[_0xc5fb('0x37')];if(!_0x1bc72c[_0xc5fb('0x38')][_0xc5fb('0x3f')](_0xc5fb('0x40'))){_0x2d2d64[_0xc5fb('0x25')]=qs['limit'](_0x1bc72c[_0xc5fb('0x38')][_0xc5fb('0x25')]);_0x2d2d64[_0xc5fb('0x23')]=qs['offset'](_0x1bc72c[_0xc5fb('0x38')]['offset']);}_0x2d2d64[_0xc5fb('0x41')]=qs[_0xc5fb('0x42')](_0x1bc72c[_0xc5fb('0x38')][_0xc5fb('0x42')]);_0x2d2d64['where']=qs['filters'](_[_0xc5fb('0x43')](_0x1bc72c[_0xc5fb('0x38')],_0x22c7f3[_0xc5fb('0x3a')]),_0x317ae7);if(_0x1bc72c[_0xc5fb('0x38')][_0xc5fb('0x44')]){_0x2d2d64[_0xc5fb('0x45')]=_['merge'](_0x2d2d64['where'],{'$or':_[_0xc5fb('0x33')](_0x317ae7,function(_0x18bee4){if(_0x18bee4[_0xc5fb('0x46')]!=='VIRTUAL'){var _0x327278={};_0x327278[_0x18bee4['name']]={'$like':'%'+_0x1bc72c[_0xc5fb('0x38')][_0xc5fb('0x44')]+'%'};return _0x327278;}})});}_0x2d2d64=_[_0xc5fb('0x47')]({},_0x2d2d64,_0x1bc72c['options']);var _0x391be8={'where':_0x2d2d64[_0xc5fb('0x45')]};return db['WhatsappQueue'][_0xc5fb('0x26')](_0x391be8)['then'](function(_0x130235){_0x21038d[_0xc5fb('0x26')]=_0x130235;if(_0x1bc72c[_0xc5fb('0x38')][_0xc5fb('0x48')]){_0x2d2d64['include']=[{'all':!![]}];}return db[_0xc5fb('0x34')][_0xc5fb('0x49')](_0x2d2d64);})['then'](function(_0x31c1f3){_0x21038d[_0xc5fb('0x4a')]=_0x31c1f3;return _0x21038d;})[_0xc5fb('0x2c')](respondWithFilteredResult(_0x570b44,_0x2d2d64))[_0xc5fb('0x4b')](handleError(_0x570b44,null));};exports[_0xc5fb('0x4c')]=function(_0x3142dd,_0xedf150){var _0x3af8c7={'raw':!![],'where':{'id':_0x3142dd[_0xc5fb('0x4d')]['id']}},_0x1afb68={};_0x1afb68['model']=_[_0xc5fb('0x39')](db[_0xc5fb('0x34')][_0xc5fb('0x4e')]);_0x1afb68[_0xc5fb('0x38')]=_['keys'](_0x3142dd[_0xc5fb('0x38')]);_0x1afb68[_0xc5fb('0x3a')]=_[_0xc5fb('0x3b')](_0x1afb68[_0xc5fb('0x37')],_0x1afb68[_0xc5fb('0x38')]);_0x3af8c7['attributes']=_[_0xc5fb('0x3b')](_0x1afb68['model'],qs['fields'](_0x3142dd[_0xc5fb('0x38')][_0xc5fb('0x3d')]));_0x3af8c7[_0xc5fb('0x3c')]=_0x3af8c7[_0xc5fb('0x3c')][_0xc5fb('0x3e')]?_0x3af8c7[_0xc5fb('0x3c')]:_0x1afb68[_0xc5fb('0x37')];if(_0x3142dd['query']['includeAll']){_0x3af8c7[_0xc5fb('0x4f')]=[{'all':!![]}];}_0x3af8c7=_[_0xc5fb('0x47')]({},_0x3af8c7,_0x3142dd[_0xc5fb('0x50')]);return db[_0xc5fb('0x34')][_0xc5fb('0x51')](_0x3af8c7)[_0xc5fb('0x2c')](handleEntityNotFound(_0xedf150,null))[_0xc5fb('0x2c')](respondWithResult(_0xedf150,null))[_0xc5fb('0x4b')](handleError(_0xedf150,null));};exports[_0xc5fb('0x52')]=function(_0x376326,_0x182d20){return db[_0xc5fb('0x34')]['create'](_0x376326[_0xc5fb('0x53')],{})[_0xc5fb('0x2c')](function(_0x49f12f){var _0x417e7b=_0x376326[_0xc5fb('0x54')][_0xc5fb('0x55')]({'plain':!![]});if(!_0x417e7b)throw new Error(_0xc5fb('0x56'));if(_0x417e7b[_0xc5fb('0x57')]===_0xc5fb('0x54')){var _0xb10211=_0x49f12f[_0xc5fb('0x55')]({'plain':!![]});var _0x79c04f='WhatsappQueues';return db[_0xc5fb('0x58')]['find']({'where':{'name':_0x79c04f,'userProfileId':_0x417e7b['userProfileId']},'raw':!![]})[_0xc5fb('0x2c')](function(_0x5c25e7){if(_0x5c25e7&&_0x5c25e7[_0xc5fb('0x59')]===0x0){return db[_0xc5fb('0x5a')]['create']({'name':_0xb10211[_0xc5fb('0x31')],'resourceId':_0xb10211['id'],'type':_0x5c25e7[_0xc5fb('0x31')],'sectionId':_0x5c25e7['id']},{})[_0xc5fb('0x2c')](function(){return _0x49f12f;});}else{return _0x49f12f;}})[_0xc5fb('0x4b')](function(_0x4b001e){logger[_0xc5fb('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b001e);throw _0x4b001e;});}return _0x49f12f;})[_0xc5fb('0x2c')](respondWithResult(_0x182d20,0xc9))[_0xc5fb('0x4b')](handleError(_0x182d20,null));};exports[_0xc5fb('0x2b')]=function(_0x4ce323,_0x53a106){if(_0x4ce323['body']['id']){delete _0x4ce323['body']['id'];}return db[_0xc5fb('0x34')][_0xc5fb('0x51')]({'where':{'id':_0x4ce323[_0xc5fb('0x4d')]['id']}})[_0xc5fb('0x2c')](handleEntityNotFound(_0x53a106,null))[_0xc5fb('0x2c')](saveUpdates(_0x4ce323[_0xc5fb('0x53')],null))['then'](respondWithResult(_0x53a106,null))[_0xc5fb('0x4b')](handleError(_0x53a106,null));};exports[_0xc5fb('0x2d')]=function(_0x21a3b1,_0x175111){return db[_0xc5fb('0x34')][_0xc5fb('0x51')]({'where':{'id':_0x21a3b1[_0xc5fb('0x4d')]['id']}})[_0xc5fb('0x2c')](handleEntityNotFound(_0x175111,null))[_0xc5fb('0x2c')](removeEntity(_0x175111,null))['catch'](handleError(_0x175111,null));};exports['describe']=function(_0xde20d1,_0x1fc30e){return db['WhatsappQueue'][_0xc5fb('0x5c')]()[_0xc5fb('0x2c')](respondWithResult(_0x1fc30e,null))['catch'](handleError(_0x1fc30e,null));};exports[_0xc5fb('0x5d')]=function(_0xcaf461,_0x3f8c1b,_0x428aa0){var _0x3609e2={'raw':!![],'where':{}},_0x233654={},_0x3d147a;return db[_0xc5fb('0x34')][_0xc5fb('0x5e')]({'where':{'id':_0xcaf461['params']['id']}})['then'](handleEntityNotFound(_0x3f8c1b,null))[_0xc5fb('0x2c')](function(_0x4a4f87){if(_0x4a4f87){_0x3d147a=_0x4a4f87[_0xc5fb('0x55')]({'plain':!![]});_0x233654[_0xc5fb('0x37')]=_['keys'](db[_0xc5fb('0x5f')][_0xc5fb('0x4e')]);_0x233654[_0xc5fb('0x38')]=_['keys'](_0xcaf461[_0xc5fb('0x38')]);_0x233654[_0xc5fb('0x3a')]=_[_0xc5fb('0x3b')](_0x233654['model'],_0x233654[_0xc5fb('0x38')]);_0x3609e2[_0xc5fb('0x3c')]=_[_0xc5fb('0x3b')](_0x233654[_0xc5fb('0x37')],qs[_0xc5fb('0x3d')](_0xcaf461[_0xc5fb('0x38')][_0xc5fb('0x3d')]));_0x3609e2[_0xc5fb('0x3c')]=_0x3609e2[_0xc5fb('0x3c')]['length']?_0x3609e2[_0xc5fb('0x3c')]:_0x233654[_0xc5fb('0x37')];if(!_0xcaf461[_0xc5fb('0x38')][_0xc5fb('0x3f')](_0xc5fb('0x40'))){_0x3609e2[_0xc5fb('0x25')]=qs[_0xc5fb('0x25')](_0xcaf461[_0xc5fb('0x38')][_0xc5fb('0x25')]);_0x3609e2['offset']=qs[_0xc5fb('0x23')](_0xcaf461[_0xc5fb('0x38')][_0xc5fb('0x23')]);}_0x3609e2['order']=qs['sort'](_0xcaf461[_0xc5fb('0x38')][_0xc5fb('0x42')]);_0x3609e2[_0xc5fb('0x45')]=qs[_0xc5fb('0x3a')](_['pick'](_0xcaf461[_0xc5fb('0x38')],_0x233654[_0xc5fb('0x3a')]));_0x3609e2[_0xc5fb('0x45')][_0xc5fb('0x60')]=_0x4a4f87['id'];if(_0xcaf461['query']['filter']){_0x3609e2['where']=_[_0xc5fb('0x47')](_0x3609e2[_0xc5fb('0x45')],{'$or':_['map'](_0x3609e2['attributes'],function(_0x259398){var _0x2c49d4={};_0x2c49d4[_0x259398]={'$like':'%'+_0xcaf461[_0xc5fb('0x38')][_0xc5fb('0x44')]+'%'};return _0x2c49d4;})});}_0x3609e2=_['merge']({},_0x3609e2,_0xcaf461[_0xc5fb('0x50')]);return db[_0xc5fb('0x5f')]['findAll'](_0x3609e2);}})['then'](function(_0x511eb2){if(_0x511eb2){return db[_0xc5fb('0x61')][_0xc5fb('0x62')]({'where':{'id':_[_0xc5fb('0x33')](_0x511eb2,'UserId'),'role':_0xc5fb('0x63')},'attributes':['id',_0xc5fb('0x31'),'whatsappPause',_0xc5fb('0x64'),_0xc5fb('0x65')]});}})[_0xc5fb('0x2c')](function(_0x29733e){if(_0x29733e){return{'count':_0x29733e['count'],'rows':_[_0xc5fb('0x33')](_0x29733e[_0xc5fb('0x4a')],function(_0x532626){return{'membername':_0x532626[_0xc5fb('0x31')],'UserId':_0x532626['id'],'queue_name':_0x3d147a[_0xc5fb('0x31')],'WhatsappQueueId':_0x3d147a['id'],'interface':util[_0xc5fb('0x66')]('%s/%s','SIP',_0x532626[_0xc5fb('0x31')]),'penalty':0x0,'paused':_0x532626['whatsappPause'],'createdAt':_0x532626[_0xc5fb('0x65')],'updatedAt':_0x532626[_0xc5fb('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc5fb('0x2c')](respondWithFilteredResult(_0x3f8c1b,_0x3609e2))[_0xc5fb('0x4b')](handleError(_0x3f8c1b,null));};exports[_0xc5fb('0x67')]=function(_0x5924d9,_0x307658,_0x197133){var _0x1e9c33={};var _0xafa091={};var _0x270f71;var _0x164382;return db['WhatsappQueue']['findOne']({'where':{'id':_0x5924d9['params']['id']}})[_0xc5fb('0x2c')](handleEntityNotFound(_0x307658,null))[_0xc5fb('0x2c')](function(_0x1694a1){if(_0x1694a1){_0x270f71=_0x1694a1;_0xafa091[_0xc5fb('0x37')]=_[_0xc5fb('0x39')](db[_0xc5fb('0x68')][_0xc5fb('0x4e')]);_0xafa091[_0xc5fb('0x38')]=_[_0xc5fb('0x39')](_0x5924d9[_0xc5fb('0x38')]);_0xafa091[_0xc5fb('0x3a')]=_[_0xc5fb('0x3b')](_0xafa091[_0xc5fb('0x37')],_0xafa091[_0xc5fb('0x38')]);_0x1e9c33[_0xc5fb('0x3c')]=_[_0xc5fb('0x3b')](_0xafa091[_0xc5fb('0x37')],qs[_0xc5fb('0x3d')](_0x5924d9[_0xc5fb('0x38')][_0xc5fb('0x3d')]));_0x1e9c33[_0xc5fb('0x3c')]=_0x1e9c33['attributes'][_0xc5fb('0x3e')]?_0x1e9c33[_0xc5fb('0x3c')]:_0xafa091['model'];_0x1e9c33[_0xc5fb('0x41')]=qs['sort'](_0x5924d9[_0xc5fb('0x38')]['sort']);_0x1e9c33[_0xc5fb('0x45')]=qs['filters'](_[_0xc5fb('0x43')](_0x5924d9[_0xc5fb('0x38')],_0xafa091[_0xc5fb('0x3a')]));if(_0x5924d9[_0xc5fb('0x38')][_0xc5fb('0x44')]){_0x1e9c33[_0xc5fb('0x45')]=_[_0xc5fb('0x47')](_0x1e9c33[_0xc5fb('0x45')],{'$or':_['map'](_0x1e9c33[_0xc5fb('0x3c')],function(_0x76eb8){var _0x3a9ac2={};_0x3a9ac2[_0x76eb8]={'$like':'%'+_0x5924d9[_0xc5fb('0x38')][_0xc5fb('0x44')]+'%'};return _0x3a9ac2;})});}_0x1e9c33=_[_0xc5fb('0x47')]({},_0x1e9c33,_0x5924d9[_0xc5fb('0x50')]);return _0x270f71['getTeams'](_0x1e9c33);}})[_0xc5fb('0x2c')](function(_0x3010fa){if(_0x3010fa){_0x164382=_0x3010fa['length'];if(!_0x5924d9[_0xc5fb('0x38')]['hasOwnProperty'](_0xc5fb('0x40'))){_0x1e9c33[_0xc5fb('0x25')]=qs[_0xc5fb('0x25')](_0x5924d9['query'][_0xc5fb('0x25')]);_0x1e9c33['offset']=qs[_0xc5fb('0x23')](_0x5924d9[_0xc5fb('0x38')][_0xc5fb('0x23')]);}return _0x270f71[_0xc5fb('0x67')](_0x1e9c33);}})[_0xc5fb('0x2c')](function(_0x4bfd3e){if(_0x4bfd3e){return _0x4bfd3e?{'count':_0x164382,'rows':_0x4bfd3e}:null;}})['then'](respondWithResult(_0x307658,null))[_0xc5fb('0x4b')](handleError(_0x307658,null));};exports[_0xc5fb('0x69')]=function(_0x66a2d1,_0x51abff,_0x140cdd){var _0x1ae801=_0x66a2d1[_0xc5fb('0x53')][_0xc5fb('0x6a')];return db['Team'][_0xc5fb('0x49')]({'where':{'id':_0x1ae801},'attributes':['id'],'include':[{'model':db[_0xc5fb('0x61')],'as':_0xc5fb('0x6b'),'attributes':['id',_0xc5fb('0x31'),'online',_0xc5fb('0x6c'),'interface'],'raw':!![]}]})[_0xc5fb('0x2c')](function(_0x3065a4){if(_0x3065a4){var _0x1d6794=_['flatMap'](_0x3065a4,function(_0x31fa48){var _0xd6d5eb=_0x31fa48[_0xc5fb('0x55')]({'plain':!![]});return _0xd6d5eb[_0xc5fb('0x6b')];});return db[_0xc5fb('0x34')]['find']({'where':{'id':_0x66a2d1[_0xc5fb('0x4d')]['id']}})[_0xc5fb('0x2c')](function(_0x1ae984){return db[_0xc5fb('0x6d')][_0xc5fb('0x6e')](function(_0xf2a2b){return _0x1ae984[_0xc5fb('0x69')](_0x1ae801,{'transaction':_0xf2a2b})[_0xc5fb('0x2c')](function(){return BPromise[_0xc5fb('0x6f')](_0x1d6794,function(_0x50b576){return db[_0xc5fb('0x5f')][_0xc5fb('0x70')]({'where':{'UserId':_0x50b576['id'],'WhatsappQueueId':_0x66a2d1['params']['id']},'transaction':_0xf2a2b});});})[_0xc5fb('0x2c')](function(){_0x1d6794[_0xc5fb('0x71')](function(_0x724976){socket[_0xc5fb('0x72')]('userWhatsappQueue:save',{'UserId':_0x724976['id'],'WhatsappQueueId':_0x1ae984['id']});});});});});}})[_0xc5fb('0x2c')](respondWithStatusCode(_0x51abff,null))['catch'](handleError(_0x51abff,null));};exports['removeTeams']=function(_0x50f4e4,_0xa44e1b,_0x8c9fb0){return db[_0xc5fb('0x68')]['findAll']({'where':{'id':_0x50f4e4['query'][_0xc5fb('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xc5fb('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5fb('0x2c')](handleEntityNotFound(_0xa44e1b,null))['then'](function(_0x3248de){var _0x2c1bcc=_[_0xc5fb('0x33')](_0x3248de,'id');var _0x58f2d6=[];var _0x55ea6e=[];var _0x264bbf=squel[_0xc5fb('0x73')]();_0x264bbf[_0xc5fb('0x74')](_0xc5fb('0x75'))[_0xc5fb('0x76')]('team_has_whatsapp_queues','tq')['join'](_0xc5fb('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc5fb('0x45')]('WhatsappQueueId\x20=\x20?',_0x50f4e4[_0xc5fb('0x4d')]['id']);for(var _0x51cb1a=0x0;_0x51cb1a<_0x3248de[_0xc5fb('0x3e')];_0x51cb1a+=0x1){let _0x3510b6=_0x3248de[_0x51cb1a];for(var _0x2e4500=0x0;_0x2e4500<_0x3510b6[_0xc5fb('0x6b')][_0xc5fb('0x3e')];_0x2e4500+=0x1){let _0x3ca49a=_0x3510b6[_0xc5fb('0x6b')][_0x2e4500];var _0x24834d=_0x264bbf['clone']();_0x24834d[_0xc5fb('0x45')](_0xc5fb('0x78'),_0x3ca49a['id']);_0x55ea6e[_0xc5fb('0x79')](db[_0xc5fb('0x6d')][_0xc5fb('0x38')](_0x24834d[_0xc5fb('0x7a')](),{'type':db[_0xc5fb('0x6d')][_0xc5fb('0x7b')][_0xc5fb('0x7c')]})[_0xc5fb('0x2c')](function(_0x3ee71c){if(_0x3ee71c[_0xc5fb('0x3e')]===0x1){return _0x3ca49a['id'];}else{var _0x25d963=_['every'](_[_0xc5fb('0x33')](_0x3ee71c,_0xc5fb('0x7d')),function(_0x3ad39c){return _['includes'](_0x2c1bcc,_0x3ad39c);});if(_0x25d963){return _0x3ca49a['id'];}}}));}}return BPromise[_0xc5fb('0x7e')](_0x55ea6e)[_0xc5fb('0x2c')](function(_0x5dec87){_0x58f2d6=_(_0x58f2d6)['union'](_0x5dec87)['compact']()[_0xc5fb('0x7f')]();return db[_0xc5fb('0x34')]['find']({'where':{'id':_0x50f4e4[_0xc5fb('0x4d')]['id']}})[_0xc5fb('0x2c')](function(_0x5b1a11){return db[_0xc5fb('0x6d')][_0xc5fb('0x6e')](function(_0x515c47){return _0x5b1a11[_0xc5fb('0x80')](_0x50f4e4[_0xc5fb('0x38')][_0xc5fb('0x6a')],{'transaction':_0x515c47})[_0xc5fb('0x2c')](function(){if(!_[_0xc5fb('0x81')](_0x58f2d6)){return _0x5b1a11['removeAgents'](_0x58f2d6,{'transaction':_0x515c47});}})['then'](function(){_0x58f2d6[_0xc5fb('0x71')](function(_0x4d5462){socket[_0xc5fb('0x72')](_0xc5fb('0x82'),{'UserId':_0x4d5462,'WhatsappQueueId':_0x5b1a11['id']});});});});});});})[_0xc5fb('0x2c')](respondWithStatusCode(_0xa44e1b,null))[_0xc5fb('0x4b')](handleError(_0xa44e1b,null));};exports[_0xc5fb('0x83')]=function(_0x14628d,_0x24c64d,_0x5159fc){return db[_0xc5fb('0x34')]['find']({'where':{'id':_0x14628d['params']['id']}})['then'](handleEntityNotFound(_0x24c64d,null))[_0xc5fb('0x2c')](function(_0xfbfc42){if(_0xfbfc42){return _0xfbfc42[_0xc5fb('0x83')](_0x14628d[_0xc5fb('0x53')][_0xc5fb('0x6a')],_[_0xc5fb('0x84')](_0x14628d['body'],[_0xc5fb('0x6a'),'id'])||{})['spread'](function(_0x57f4a9){for(var _0xe091c0=0x0;_0xe091c0<_0x14628d[_0xc5fb('0x53')][_0xc5fb('0x6a')]['length'];_0xe091c0+=0x1){socket[_0xc5fb('0x72')](_0xc5fb('0x85'),{'UserId':Number(_0x14628d[_0xc5fb('0x53')][_0xc5fb('0x6a')][_0xe091c0]),'WhatsappQueueId':Number(_0x14628d[_0xc5fb('0x4d')]['id'])});}return _0x57f4a9;});}})[_0xc5fb('0x2c')](respondWithResult(_0x24c64d,null))[_0xc5fb('0x4b')](handleError(_0x24c64d,null));};exports['removeAgents']=function(_0x6cade4,_0x1724c5,_0x855524){return db[_0xc5fb('0x34')][_0xc5fb('0x51')]({'where':{'id':_0x6cade4[_0xc5fb('0x4d')]['id']}})[_0xc5fb('0x2c')](handleEntityNotFound(_0x1724c5,null))[_0xc5fb('0x2c')](function(_0x5784bd){if(_0x5784bd){return _0x5784bd[_0xc5fb('0x86')](_0x6cade4[_0xc5fb('0x38')][_0xc5fb('0x6a')])[_0xc5fb('0x2c')](function(){if(_[_0xc5fb('0x87')](_0x6cade4[_0xc5fb('0x38')]['ids'])){for(var _0x23c00a=0x0;_0x23c00a<_0x6cade4[_0xc5fb('0x38')][_0xc5fb('0x6a')][_0xc5fb('0x3e')];_0x23c00a+=0x1){socket[_0xc5fb('0x72')]('userWhatsappQueue:remove',{'UserId':Number(_0x6cade4[_0xc5fb('0x38')]['ids'][_0x23c00a]),'WhatsappQueueId':Number(_0x6cade4[_0xc5fb('0x4d')]['id'])});}}else{socket[_0xc5fb('0x72')](_0xc5fb('0x82'),{'UserId':Number(_0x6cade4[_0xc5fb('0x38')]['ids']),'WhatsappQueueId':Number(_0x6cade4[_0xc5fb('0x4d')]['id'])});}});}})[_0xc5fb('0x2c')](respondWithStatusCode(_0x1724c5,null))['catch'](handleError(_0x1724c5,null));};exports['getAgents']=function(_0x4cebc2,_0x494128,_0x27333b){var _0x49e2b9={};var _0x45c083={};var _0x5e5dd4;var _0x43a278;return db['WhatsappQueue'][_0xc5fb('0x5e')]({'where':{'id':_0x4cebc2[_0xc5fb('0x4d')]['id']}})[_0xc5fb('0x2c')](handleEntityNotFound(_0x494128,null))[_0xc5fb('0x2c')](function(_0x503ecc){if(_0x503ecc){_0x5e5dd4=_0x503ecc;_0x45c083[_0xc5fb('0x37')]=_[_0xc5fb('0x39')](db[_0xc5fb('0x61')]['rawAttributes']);_0x45c083[_0xc5fb('0x38')]=_[_0xc5fb('0x39')](_0x4cebc2[_0xc5fb('0x38')]);_0x45c083[_0xc5fb('0x3a')]=_[_0xc5fb('0x3b')](_0x45c083[_0xc5fb('0x37')],_0x45c083['query']);_0x49e2b9[_0xc5fb('0x3c')]=_['intersection'](_0x45c083[_0xc5fb('0x37')],qs[_0xc5fb('0x3d')](_0x4cebc2['query']['fields']));_0x49e2b9[_0xc5fb('0x3c')]=_0x49e2b9['attributes'][_0xc5fb('0x3e')]?_0x49e2b9[_0xc5fb('0x3c')]:_0x45c083[_0xc5fb('0x37')];_0x49e2b9[_0xc5fb('0x41')]=qs[_0xc5fb('0x42')](_0x4cebc2[_0xc5fb('0x38')][_0xc5fb('0x42')]);_0x49e2b9[_0xc5fb('0x45')]=qs[_0xc5fb('0x3a')](_[_0xc5fb('0x43')](_0x4cebc2['query'],_0x45c083[_0xc5fb('0x3a')]));if(_0x4cebc2[_0xc5fb('0x38')][_0xc5fb('0x44')]){_0x49e2b9[_0xc5fb('0x45')]=_[_0xc5fb('0x47')](_0x49e2b9[_0xc5fb('0x45')],{'$or':_['map'](_0x49e2b9[_0xc5fb('0x3c')],function(_0x29ae5a){var _0x464245={};_0x464245[_0x29ae5a]={'$like':'%'+_0x4cebc2[_0xc5fb('0x38')][_0xc5fb('0x44')]+'%'};return _0x464245;})});}_0x49e2b9=_[_0xc5fb('0x47')]({},_0x49e2b9,_0x4cebc2[_0xc5fb('0x50')]);return _0x5e5dd4[_0xc5fb('0x88')](_0x49e2b9);}})[_0xc5fb('0x2c')](function(_0x4acd13){if(_0x4acd13){_0x43a278=_0x4acd13['length'];if(!_0x4cebc2['query'][_0xc5fb('0x3f')]('nolimit')){_0x49e2b9[_0xc5fb('0x25')]=qs['limit'](_0x4cebc2[_0xc5fb('0x38')]['limit']);_0x49e2b9[_0xc5fb('0x23')]=qs[_0xc5fb('0x23')](_0x4cebc2['query'][_0xc5fb('0x23')]);}return _0x5e5dd4[_0xc5fb('0x88')](_0x49e2b9);}})[_0xc5fb('0x2c')](function(_0x52a133){if(_0x52a133){return _0x52a133?{'count':_0x43a278,'rows':_0x52a133}:null;}})[_0xc5fb('0x2c')](respondWithResult(_0x494128,null))[_0xc5fb('0x4b')](handleError(_0x494128,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 13072fc..1ce7de7 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 _0x8ad5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ad5,0x1a2));var _0x58ad=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x8ad5[_0x1e7b16];return _0x37fadc;};'use strict';var EventEmitter=require(_0x58ad('0x0'));var WhatsappQueue=require(_0x58ad('0x1'))['db'][_0x58ad('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x58ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x58ad('0x4')};function emitEvent(_0xf50715){return function(_0x25ec78,_0x12bf3a,_0x5052f0){WhatsappQueueEvents[_0x58ad('0x5')](_0xf50715+':'+_0x25ec78['id'],_0x25ec78);WhatsappQueueEvents[_0x58ad('0x5')](_0xf50715,_0x25ec78);_0x5052f0(null);};}for(var e in events){if(events[_0x58ad('0x6')](e)){var event=events[e];WhatsappQueue[_0x58ad('0x7')](e,emitEvent(event));}}module[_0x58ad('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xd30e=['hook','exports','events','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x306822,_0x385a29){var _0x267bfd=function(_0x214d5a){while(--_0x214d5a){_0x306822['push'](_0x306822['shift']());}};_0x267bfd(++_0x385a29);}(_0xd30e,0x6e));var _0xed30=function(_0x5045c8,_0x769c14){_0x5045c8=_0x5045c8-0x0;var _0x566b2b=_0xd30e[_0x5045c8];return _0x566b2b;};'use strict';var EventEmitter=require(_0xed30('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xed30('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xed30('0x2')](0x0);var events={'afterCreate':_0xed30('0x3'),'afterUpdate':_0xed30('0x4'),'afterDestroy':'remove'};function emitEvent(_0xcd0452){return function(_0x242411,_0x4ae2ff,_0x17afee){WhatsappQueueEvents[_0xed30('0x5')](_0xcd0452+':'+_0x242411['id'],_0x242411);WhatsappQueueEvents[_0xed30('0x5')](_0xcd0452,_0x242411);_0x17afee(null);};}for(var e in events){if(events[_0xed30('0x6')](e)){var event=events[e];WhatsappQueue[_0xed30('0x7')](e,emitEvent(event));}}module[_0xed30('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 6ef6726..1ae8d82 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 _0x1e9c=['whatsapp_queues','util','api','moment','bluebird','request-promise','path','rimraf','exports','WhatsappQueue'];(function(_0x12ff2c,_0x4cab86){var _0x2467a3=function(_0x1f515c){while(--_0x1f515c){_0x12ff2c['push'](_0x12ff2c['shift']());}};_0x2467a3(++_0x4cab86);}(_0x1e9c,0x8d));var _0xc1e9=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x1e9c[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require(_0xc1e9('0x0'));var logger=require('../../config/logger')(_0xc1e9('0x1'));var moment=require(_0xc1e9('0x2'));var BPromise=require(_0xc1e9('0x3'));var rp=require(_0xc1e9('0x4'));var fs=require('fs');var path=require(_0xc1e9('0x5'));var rimraf=require(_0xc1e9('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0xc1e9('0x7')]=function(_0x4d5c33,_0x27f814){return _0x4d5c33['define'](_0xc1e9('0x8'),attributes,{'tableName':_0xc1e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf08e=['../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','lodash','util','../../config/logger','api','bluebird','rimraf'];(function(_0x28e0c5,_0xae901c){var _0x154afc=function(_0x9a6c91){while(--_0x9a6c91){_0x28e0c5['push'](_0x28e0c5['shift']());}};_0x154afc(++_0xae901c);}(_0xf08e,0x130));var _0xef08=function(_0x58e37a,_0x3dd00f){_0x58e37a=_0x58e37a-0x0;var _0x40ff7c=_0xf08e[_0x58e37a];return _0x40ff7c;};'use strict';var _=require(_0xef08('0x0'));var util=require(_0xef08('0x1'));var logger=require(_0xef08('0x2'))(_0xef08('0x3'));var moment=require('moment');var BPromise=require(_0xef08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xef08('0x5'));var config=require(_0xef08('0x6'));var attributes=require(_0xef08('0x7'));module['exports']=function(_0x185584,_0x30b9c7){return _0x185584[_0xef08('0x8')](_0xef08('0x9'),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 8043ab3..2565733 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 _0x7e1e=['WhatsappQueue','findAll','raw','options','where','attributes','map','model','include','GetWhatsappQueue','find','ShowWhatsappQueue','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7e1e,0x12c));var _0xe7e1=function(_0x681503,_0x27bc52){_0x681503=_0x681503-0x0;var _0x52452e=_0x7e1e[_0x681503];return _0x52452e;};'use strict';var _=require(_0xe7e1('0x0'));var util=require(_0xe7e1('0x1'));var moment=require(_0xe7e1('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7e1('0x4'));var logger=require('../../config/logger')(_0xe7e1('0x5'));var config=require(_0xe7e1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe7e1('0x7')]['http']({'port':0x232a});config[_0xe7e1('0x8')]=_[_0xe7e1('0x9')](config[_0xe7e1('0x8')],{'host':_0xe7e1('0xa'),'port':0x18eb});var socket=require(_0xe7e1('0xb'))(new Redis(config[_0xe7e1('0x8')]));require('./whatsappQueue.socket')[_0xe7e1('0xc')](socket);function respondWithRpcPromise(_0x75749d,_0x18598a,_0x4134b2){return new BPromise(function(_0x593922,_0x58d983){return client[_0xe7e1('0xd')](_0x75749d,_0x4134b2)[_0xe7e1('0xe')](function(_0x13379a){logger[_0xe7e1('0xf')](_0xe7e1('0x10'),_0x18598a,_0xe7e1('0x11'));logger[_0xe7e1('0x12')](_0xe7e1('0x13'),_0x18598a,_0xe7e1('0x11'),JSON[_0xe7e1('0x14')](_0x13379a));if(_0x13379a[_0xe7e1('0x15')]){if(_0x13379a[_0xe7e1('0x15')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x18598a,_0x13379a[_0xe7e1('0x15')]['message']);return _0x58d983(_0x13379a[_0xe7e1('0x15')][_0xe7e1('0x16')]);}logger[_0xe7e1('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x18598a,_0x13379a[_0xe7e1('0x15')][_0xe7e1('0x16')]);return _0x593922(_0x13379a[_0xe7e1('0x15')][_0xe7e1('0x16')]);}else{logger[_0xe7e1('0xf')](_0xe7e1('0x10'),_0x18598a,_0xe7e1('0x11'));_0x593922(_0x13379a['result'][_0xe7e1('0x16')]);}})[_0xe7e1('0x17')](function(_0x33330d){logger['error'](_0xe7e1('0x10'),_0x18598a,_0x33330d);_0x58d983(_0x33330d);});});}exports['GetWhatsappQueue']=function(_0x41691a){var _0x8bf0b=this;return new Promise(function(_0x397848,_0x4f3e9c){return db[_0xe7e1('0x18')][_0xe7e1('0x19')]({'raw':_0x41691a['options']?_0x41691a['options'][_0xe7e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x41691a[_0xe7e1('0x1b')]?_0x41691a[_0xe7e1('0x1b')][_0xe7e1('0x1c')]||null:null,'attributes':_0x41691a[_0xe7e1('0x1b')]?_0x41691a[_0xe7e1('0x1b')][_0xe7e1('0x1d')]||null:null,'limit':_0x41691a['options']?_0x41691a[_0xe7e1('0x1b')]['limit']||null:null,'include':_0x41691a[_0xe7e1('0x1b')]?_0x41691a[_0xe7e1('0x1b')]['include']?_[_0xe7e1('0x1e')](_0x41691a['options']['include'],function(_0x5baa60){return{'model':db[_0x5baa60[_0xe7e1('0x1f')]],'as':_0x5baa60['as'],'attributes':_0x5baa60[_0xe7e1('0x1d')],'include':_0x5baa60[_0xe7e1('0x20')]?_[_0xe7e1('0x1e')](_0x5baa60[_0xe7e1('0x20')],function(_0x41f326){return{'model':db[_0x41f326['model']],'as':_0x41f326['as'],'attributes':_0x41f326[_0xe7e1('0x1d')],'include':_0x41f326['include']?_[_0xe7e1('0x1e')](_0x41f326[_0xe7e1('0x20')],function(_0x212bdd){return{'model':db[_0x212bdd[_0xe7e1('0x1f')]],'as':_0x212bdd['as'],'attributes':_0x212bdd[_0xe7e1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe7e1('0xe')](function(_0x32042f){logger[_0xe7e1('0xf')]('GetWhatsappQueue',_0x41691a);logger[_0xe7e1('0x12')](_0xe7e1('0x21'),_0x41691a,JSON[_0xe7e1('0x14')](_0x32042f));_0x397848(_0x32042f);})['catch'](function(_0xd68621){logger[_0xe7e1('0x15')](_0xe7e1('0x21'),_0xd68621[_0xe7e1('0x16')],_0x41691a);_0x4f3e9c(_0x8bf0b[_0xe7e1('0x15')](0x1f4,_0xd68621[_0xe7e1('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x1b8d54){var _0x4b478d=this;return new Promise(function(_0x58e789,_0x5062ce){return db['WhatsappQueue'][_0xe7e1('0x22')]({'raw':_0x1b8d54[_0xe7e1('0x1b')]?_0x1b8d54[_0xe7e1('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b8d54[_0xe7e1('0x1b')]?_0x1b8d54[_0xe7e1('0x1b')][_0xe7e1('0x1c')]||null:null,'attributes':_0x1b8d54['options']?_0x1b8d54[_0xe7e1('0x1b')][_0xe7e1('0x1d')]||null:null,'include':_0x1b8d54['options']?_0x1b8d54['options'][_0xe7e1('0x20')]?_['map'](_0x1b8d54['options']['include'],function(_0x387fd7){return{'model':db[_0x387fd7[_0xe7e1('0x1f')]],'as':_0x387fd7['as'],'attributes':_0x387fd7[_0xe7e1('0x1d')],'include':_0x387fd7[_0xe7e1('0x20')]?_[_0xe7e1('0x1e')](_0x387fd7[_0xe7e1('0x20')],function(_0x2cac91){return{'model':db[_0x2cac91[_0xe7e1('0x1f')]],'as':_0x2cac91['as'],'attributes':_0x2cac91['attributes'],'include':_0x2cac91[_0xe7e1('0x20')]?_[_0xe7e1('0x1e')](_0x2cac91[_0xe7e1('0x20')],function(_0x6f9b74){return{'model':db[_0x6f9b74['model']],'as':_0x6f9b74['as'],'attributes':_0x6f9b74[_0xe7e1('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d6f00){logger[_0xe7e1('0xf')](_0xe7e1('0x23'),_0x1b8d54);logger[_0xe7e1('0x12')](_0xe7e1('0x23'),_0x1b8d54,JSON[_0xe7e1('0x14')](_0x3d6f00));_0x58e789(_0x3d6f00);})[_0xe7e1('0x17')](function(_0x104a5c){logger[_0xe7e1('0x15')](_0xe7e1('0x23'),_0x104a5c[_0xe7e1('0x16')],_0x1b8d54);_0x5062ce(_0x4b478d[_0xe7e1('0x15')](0x1f4,_0x104a5c[_0xe7e1('0x16')]));});});}; \ No newline at end of file +var _0x7fe2=['WhatsappQueue','options','raw','where','attributes','limit','include','map','model','find','ShowWhatsappQueue','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetWhatsappQueue'];(function(_0x423236,_0x42a171){var _0x4ce078=function(_0x2f4b5e){while(--_0x2f4b5e){_0x423236['push'](_0x423236['shift']());}};_0x4ce078(++_0x42a171);}(_0x7fe2,0x1ad));var _0x27fe=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0x7fe2[_0x151418];return _0x40e29a;};'use strict';var _=require('lodash');var util=require(_0x27fe('0x0'));var moment=require('moment');var BPromise=require(_0x27fe('0x1'));var rs=require(_0x27fe('0x2'));var fs=require('fs');var Redis=require(_0x27fe('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x27fe('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x27fe('0x5'));var client=jayson[_0x27fe('0x6')][_0x27fe('0x7')]({'port':0x232a});config[_0x27fe('0x8')]=_[_0x27fe('0x9')](config[_0x27fe('0x8')],{'host':_0x27fe('0xa'),'port':0x18eb});var socket=require(_0x27fe('0xb'))(new Redis(config[_0x27fe('0x8')]));require(_0x27fe('0xc'))[_0x27fe('0xd')](socket);function respondWithRpcPromise(_0x2bc9aa,_0x3b31a7,_0x5ef0f6){return new BPromise(function(_0x2c6614,_0x3dcdeb){return client[_0x27fe('0xe')](_0x2bc9aa,_0x5ef0f6)[_0x27fe('0xf')](function(_0x21b06d){logger['info'](_0x27fe('0x10'),_0x3b31a7,_0x27fe('0x11'));logger[_0x27fe('0x12')](_0x27fe('0x13'),_0x3b31a7,_0x27fe('0x11'),JSON[_0x27fe('0x14')](_0x21b06d));if(_0x21b06d[_0x27fe('0x15')]){if(_0x21b06d['error']['code']===0x1f4){logger['error'](_0x27fe('0x10'),_0x3b31a7,_0x21b06d['error']['message']);return _0x3dcdeb(_0x21b06d[_0x27fe('0x15')]['message']);}logger[_0x27fe('0x15')](_0x27fe('0x10'),_0x3b31a7,_0x21b06d[_0x27fe('0x15')][_0x27fe('0x16')]);return _0x2c6614(_0x21b06d[_0x27fe('0x15')][_0x27fe('0x16')]);}else{logger[_0x27fe('0x17')](_0x27fe('0x10'),_0x3b31a7,'request\x20sent');_0x2c6614(_0x21b06d[_0x27fe('0x18')][_0x27fe('0x16')]);}})[_0x27fe('0x19')](function(_0x17588b){logger[_0x27fe('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x3b31a7,_0x17588b);_0x3dcdeb(_0x17588b);});});}exports[_0x27fe('0x1a')]=function(_0x3f1a61){var _0x46a7ff=this;return new Promise(function(_0xc34998,_0x2f3b27){return db[_0x27fe('0x1b')]['findAll']({'raw':_0x3f1a61[_0x27fe('0x1c')]?_0x3f1a61[_0x27fe('0x1c')][_0x27fe('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f1a61[_0x27fe('0x1c')]?_0x3f1a61[_0x27fe('0x1c')][_0x27fe('0x1e')]||null:null,'attributes':_0x3f1a61[_0x27fe('0x1c')]?_0x3f1a61[_0x27fe('0x1c')][_0x27fe('0x1f')]||null:null,'limit':_0x3f1a61[_0x27fe('0x1c')]?_0x3f1a61[_0x27fe('0x1c')][_0x27fe('0x20')]||null:null,'include':_0x3f1a61[_0x27fe('0x1c')]?_0x3f1a61[_0x27fe('0x1c')][_0x27fe('0x21')]?_[_0x27fe('0x22')](_0x3f1a61[_0x27fe('0x1c')][_0x27fe('0x21')],function(_0x14d5e4){return{'model':db[_0x14d5e4[_0x27fe('0x23')]],'as':_0x14d5e4['as'],'attributes':_0x14d5e4['attributes'],'include':_0x14d5e4['include']?_['map'](_0x14d5e4['include'],function(_0xad65a1){return{'model':db[_0xad65a1[_0x27fe('0x23')]],'as':_0xad65a1['as'],'attributes':_0xad65a1[_0x27fe('0x1f')],'include':_0xad65a1['include']?_[_0x27fe('0x22')](_0xad65a1[_0x27fe('0x21')],function(_0x34792a){return{'model':db[_0x34792a[_0x27fe('0x23')]],'as':_0x34792a['as'],'attributes':_0x34792a[_0x27fe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x27fe('0xf')](function(_0x46f0d7){logger[_0x27fe('0x17')]('GetWhatsappQueue',_0x3f1a61);logger[_0x27fe('0x12')]('GetWhatsappQueue',_0x3f1a61,JSON[_0x27fe('0x14')](_0x46f0d7));_0xc34998(_0x46f0d7);})[_0x27fe('0x19')](function(_0x1d4857){logger[_0x27fe('0x15')](_0x27fe('0x1a'),_0x1d4857[_0x27fe('0x16')],_0x3f1a61);_0x2f3b27(_0x46a7ff[_0x27fe('0x15')](0x1f4,_0x1d4857['message']));});});};exports['ShowWhatsappQueue']=function(_0x41a84a){var _0x38a1d2=this;return new Promise(function(_0x5f4976,_0x34241d){return db['WhatsappQueue'][_0x27fe('0x24')]({'raw':_0x41a84a[_0x27fe('0x1c')]?_0x41a84a[_0x27fe('0x1c')][_0x27fe('0x1d')]===undefined?!![]:![]:!![],'where':_0x41a84a[_0x27fe('0x1c')]?_0x41a84a['options'][_0x27fe('0x1e')]||null:null,'attributes':_0x41a84a[_0x27fe('0x1c')]?_0x41a84a[_0x27fe('0x1c')][_0x27fe('0x1f')]||null:null,'include':_0x41a84a[_0x27fe('0x1c')]?_0x41a84a[_0x27fe('0x1c')]['include']?_[_0x27fe('0x22')](_0x41a84a[_0x27fe('0x1c')][_0x27fe('0x21')],function(_0x21ee46){return{'model':db[_0x21ee46['model']],'as':_0x21ee46['as'],'attributes':_0x21ee46[_0x27fe('0x1f')],'include':_0x21ee46[_0x27fe('0x21')]?_[_0x27fe('0x22')](_0x21ee46[_0x27fe('0x21')],function(_0x3f731d){return{'model':db[_0x3f731d[_0x27fe('0x23')]],'as':_0x3f731d['as'],'attributes':_0x3f731d[_0x27fe('0x1f')],'include':_0x3f731d[_0x27fe('0x21')]?_[_0x27fe('0x22')](_0x3f731d[_0x27fe('0x21')],function(_0x4d565c){return{'model':db[_0x4d565c['model']],'as':_0x4d565c['as'],'attributes':_0x4d565c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x242a1b){logger[_0x27fe('0x17')]('ShowWhatsappQueue',_0x41a84a);logger[_0x27fe('0x12')](_0x27fe('0x25'),_0x41a84a,JSON[_0x27fe('0x14')](_0x242a1b));_0x5f4976(_0x242a1b);})['catch'](function(_0x2c5296){logger[_0x27fe('0x15')]('ShowWhatsappQueue',_0x2c5296[_0x27fe('0x16')],_0x41a84a);_0x34241d(_0x38a1d2[_0x27fe('0x15')](0x1f4,_0x2c5296[_0x27fe('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 1e0f010..14be939 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 _0x1b61=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x21c2f5,_0x2eff97){var _0x118d23=function(_0x529d39){while(--_0x529d39){_0x21c2f5['push'](_0x21c2f5['shift']());}};_0x118d23(++_0x2eff97);}(_0x1b61,0xb2));var _0x11b6=function(_0x45dabf,_0x4e6bfe){_0x45dabf=_0x45dabf-0x0;var _0xa83e3d=_0x1b61[_0x45dabf];return _0xa83e3d;};'use strict';var WhatsappQueueEvents=require(_0x11b6('0x0'));var events=[_0x11b6('0x1'),_0x11b6('0x2'),_0x11b6('0x3')];function createListener(_0x2a6f87,_0x4aa03d){return function(_0x10a823){_0x4aa03d[_0x11b6('0x4')](_0x2a6f87,_0x10a823);};}function removeListener(_0x125b16,_0x4455d8){return function(){WhatsappQueueEvents[_0x11b6('0x5')](_0x125b16,_0x4455d8);};}exports[_0x11b6('0x6')]=function(_0x13c759){for(var _0x4b0780=0x0,_0x31c8ec=events[_0x11b6('0x7')];_0x4b0780<_0x31c8ec;_0x4b0780++){var _0xf2e020=events[_0x4b0780];var _0x302925=createListener(_0x11b6('0x8')+_0xf2e020,_0x13c759);WhatsappQueueEvents['on'](_0xf2e020,_0x302925);}}; \ No newline at end of file +var _0x7838=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0xcdbfe,_0x154ad7){var _0x1894dd=function(_0x525924){while(--_0x525924){_0xcdbfe['push'](_0xcdbfe['shift']());}};_0x1894dd(++_0x154ad7);}(_0x7838,0x15c));var _0x8783=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x7838[_0x2555d0];return _0x3bb486;};'use strict';var WhatsappQueueEvents=require(_0x8783('0x0'));var events=[_0x8783('0x1'),_0x8783('0x2'),_0x8783('0x3')];function createListener(_0x173d2e,_0xc9d3a5){return function(_0x4c4526){_0xc9d3a5[_0x8783('0x4')](_0x173d2e,_0x4c4526);};}function removeListener(_0x3d14d9,_0x13b6e9){return function(){WhatsappQueueEvents[_0x8783('0x5')](_0x3d14d9,_0x13b6e9);};}exports[_0x8783('0x6')]=function(_0x55874c){for(var _0x255b68=0x0,_0x531b5c=events[_0x8783('0x7')];_0x255b68<_0x531b5c;_0x255b68++){var _0x131146=events[_0x255b68];var _0x4316bd=createListener(_0x8783('0x8')+_0x131146,_0x55874c);WhatsappQueueEvents['on'](_0x131146,_0x4316bd);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 47d3b26..7e8e37f 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 _0x05ee=['update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put'];(function(_0x15ec35,_0x5b9972){var _0x937cce=function(_0x59326b){while(--_0x59326b){_0x15ec35['push'](_0x15ec35['shift']());}};_0x937cce(++_0x5b9972);}(_0x05ee,0x68));var _0xe05e=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x05ee[_0x3718b7];return _0xf8c91e;};'use strict';var multer=require('multer');var util=require(_0xe05e('0x0'));var path=require(_0xe05e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe05e('0x2')]();var fs_extra=require(_0xe05e('0x3'));var auth=require(_0xe05e('0x4'));var interaction=require(_0xe05e('0x5'));var config=require(_0xe05e('0x6'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xe05e('0x7')](),controller['index']);router[_0xe05e('0x8')](_0xe05e('0x9'),auth[_0xe05e('0x7')](),controller[_0xe05e('0xa')]);router['get'](_0xe05e('0xb'),auth[_0xe05e('0x7')](),controller[_0xe05e('0xc')]);router[_0xe05e('0xd')]('/',auth['isAuthenticated'](),controller[_0xe05e('0xe')]);router[_0xe05e('0xf')](_0xe05e('0xb'),auth[_0xe05e('0x7')](),controller[_0xe05e('0x10')]);router[_0xe05e('0x11')]('/:id',auth[_0xe05e('0x7')](),controller[_0xe05e('0x12')]);module[_0xe05e('0x13')]=router; \ No newline at end of file +var _0xe4b0=['express','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','destroy','exports','multer','util','path'];(function(_0x52b49d,_0x7056f8){var _0x4e8333=function(_0x547c1d){while(--_0x547c1d){_0x52b49d['push'](_0x52b49d['shift']());}};_0x4e8333(++_0x7056f8);}(_0xe4b0,0x1eb));var _0x0e4b=function(_0x1e9707,_0x13dcf1){_0x1e9707=_0x1e9707-0x0;var _0x5df14a=_0xe4b0[_0x1e9707];return _0x5df14a;};'use strict';var multer=require(_0x0e4b('0x0'));var util=require(_0x0e4b('0x1'));var path=require(_0x0e4b('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e4b('0x3'));var router=express[_0x0e4b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e4b('0x5'));var config=require(_0x0e4b('0x6'));var controller=require(_0x0e4b('0x7'));router[_0x0e4b('0x8')]('/',auth['isAuthenticated'](),controller[_0x0e4b('0x9')]);router[_0x0e4b('0x8')](_0x0e4b('0xa'),auth[_0x0e4b('0xb')](),controller['describe']);router[_0x0e4b('0x8')](_0x0e4b('0xc'),auth[_0x0e4b('0xb')](),controller[_0x0e4b('0xd')]);router[_0x0e4b('0xe')]('/',auth[_0x0e4b('0xb')](),controller[_0x0e4b('0xf')]);router[_0x0e4b('0x10')](_0x0e4b('0xc'),auth[_0x0e4b('0xb')](),controller['update']);router['delete'](_0x0e4b('0xc'),auth[_0x0e4b('0xb')](),controller[_0x0e4b('0x11')]);module[_0x0e4b('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 7b576a6..1fa0ad5 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(_0x261f7a,_0x27e10f){var _0x1f72b4=function(_0x31ae32){while(--_0x31ae32){_0x261f7a['push'](_0x261f7a['shift']());}};_0x1f72b4(++_0x27e10f);}(_0x7a54,0x106));var _0x47a5=function(_0x505948,_0x4fc376){_0x505948=_0x505948-0x0;var _0x6de960=_0x7a54[_0x505948];return _0x6de960;};'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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x76a232,_0x30d95b){var _0x103684=function(_0x5b739c){while(--_0x5b739c){_0x76a232['push'](_0x76a232['shift']());}};_0x103684(++_0x30d95b);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 61db46e..f4eec78 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 _0x9354=['rows','show','keys','length','find','catch','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','offset','sort','filter','where','merge','type','options','includeAll','include','findAll'];(function(_0x5d8b71,_0x3a6fe3){var _0x2e2525=function(_0x84e9fa){while(--_0x84e9fa){_0x5d8b71['push'](_0x5d8b71['shift']());}};_0x2e2525(++_0x3a6fe3);}(_0x9354,0x96));var _0x4935=function(_0x2b3478,_0x58afd7){_0x2b3478=_0x2b3478-0x0;var _0x1c106f=_0x9354[_0x2b3478];return _0x1c106f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x344e51,_0x1c37ba){return function(_0x3784f9){if(!_0x3784f9){_0x344e51[_0x4935('0x17')](0x194);}return _0x3784f9;};}function handleError(_0x2e1583,_0xf4abb2){_0xf4abb2=_0xf4abb2||0x1f4;return function(_0x1d08b5){logger[_0x4935('0x24')](_0x1d08b5[_0x4935('0x25')]);if(_0x1d08b5[_0x4935('0x26')]){delete _0x1d08b5[_0x4935('0x26')];}_0x2e1583['status'](_0xf4abb2)['send'](_0x1d08b5);};}exports['index']=function(_0x1fc218,_0x76ea7d){var _0x4f1163={},_0x3f0707={},_0x20755a={'count':0x0,'rows':[]};var _0x24a3b6=_[_0x4935('0x27')](db[_0x4935('0x28')][_0x4935('0x29')],function(_0x28afc2){return{'name':_0x28afc2[_0x4935('0x2a')],'type':_0x28afc2['type'][_0x4935('0x2b')]};});_0x3f0707[_0x4935('0x2c')]=_['map'](_0x24a3b6,'name');_0x3f0707[_0x4935('0x2d')]=_['keys'](_0x1fc218[_0x4935('0x2d')]);_0x3f0707[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x3f0707['model'],_0x3f0707['query']);_0x4f1163[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x3f0707['model'],qs[_0x4935('0x31')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x31')]));_0x4f1163[_0x4935('0x30')]=_0x4f1163[_0x4935('0x30')]['length']?_0x4f1163['attributes']:_0x3f0707[_0x4935('0x2c')];if(!_0x1fc218[_0x4935('0x2d')]['hasOwnProperty']('nolimit')){_0x4f1163[_0x4935('0x1c')]=qs['limit'](_0x1fc218[_0x4935('0x2d')][_0x4935('0x1c')]);_0x4f1163[_0x4935('0x32')]=qs[_0x4935('0x32')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x32')]);}_0x4f1163['order']=qs[_0x4935('0x33')](_0x1fc218['query'][_0x4935('0x33')]);_0x4f1163['where']=qs[_0x4935('0x2e')](_['pick'](_0x1fc218[_0x4935('0x2d')],_0x3f0707[_0x4935('0x2e')]),_0x24a3b6);if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x34')]){_0x4f1163[_0x4935('0x35')]=_[_0x4935('0x36')](_0x4f1163[_0x4935('0x35')],{'$or':_['map'](_0x24a3b6,function(_0x57e1ca){if(_0x57e1ca[_0x4935('0x37')]!=='VIRTUAL'){var _0x4e8b2e={};_0x4e8b2e[_0x57e1ca[_0x4935('0x26')]]={'$like':'%'+_0x1fc218['query'][_0x4935('0x34')]+'%'};return _0x4e8b2e;}})});}_0x4f1163=_[_0x4935('0x36')]({},_0x4f1163,_0x1fc218[_0x4935('0x38')]);var _0x99b7c5={'where':_0x4f1163[_0x4935('0x35')]};return db['WhatsappQueueReport']['count'](_0x99b7c5)[_0x4935('0x22')](function(_0x2be169){_0x20755a[_0x4935('0x1d')]=_0x2be169;if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x39')]){_0x4f1163[_0x4935('0x3a')]=[{'all':!![]}];}return db[_0x4935('0x28')][_0x4935('0x3b')](_0x4f1163);})['then'](function(_0x4e94f6){_0x20755a[_0x4935('0x3c')]=_0x4e94f6;return _0x20755a;})[_0x4935('0x22')](respondWithFilteredResult(_0x76ea7d,_0x4f1163))['catch'](handleError(_0x76ea7d,null));};exports[_0x4935('0x3d')]=function(_0x157950,_0x4706eb){var _0xe5c9f5={'raw':!![],'where':{'id':_0x157950['params']['id']}},_0x52ab0c={};_0x52ab0c[_0x4935('0x2c')]=_[_0x4935('0x3e')](db['WhatsappQueueReport'][_0x4935('0x29')]);_0x52ab0c[_0x4935('0x2d')]=_[_0x4935('0x3e')](_0x157950['query']);_0x52ab0c[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],_0x52ab0c[_0x4935('0x2d')]);_0xe5c9f5[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],qs[_0x4935('0x31')](_0x157950[_0x4935('0x2d')][_0x4935('0x31')]));_0xe5c9f5[_0x4935('0x30')]=_0xe5c9f5[_0x4935('0x30')][_0x4935('0x3f')]?_0xe5c9f5[_0x4935('0x30')]:_0x52ab0c[_0x4935('0x2c')];if(_0x157950[_0x4935('0x2d')][_0x4935('0x39')]){_0xe5c9f5[_0x4935('0x3a')]=[{'all':!![]}];}_0xe5c9f5=_['merge']({},_0xe5c9f5,_0x157950[_0x4935('0x38')]);return db['WhatsappQueueReport'][_0x4935('0x40')](_0xe5c9f5)[_0x4935('0x22')](handleEntityNotFound(_0x4706eb,null))[_0x4935('0x22')](respondWithResult(_0x4706eb,null))[_0x4935('0x41')](handleError(_0x4706eb,null));};exports['create']=function(_0x2a3404,_0x9c8bad){return db[_0x4935('0x28')][_0x4935('0x42')](_0x2a3404[_0x4935('0x43')],{})[_0x4935('0x22')](respondWithResult(_0x9c8bad,0xc9))[_0x4935('0x41')](handleError(_0x9c8bad,null));};exports[_0x4935('0x21')]=function(_0x29b932,_0x392cba){if(_0x29b932['body']['id']){delete _0x29b932[_0x4935('0x43')]['id'];}return db[_0x4935('0x28')]['find']({'where':{'id':_0x29b932[_0x4935('0x44')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x392cba,null))[_0x4935('0x22')](saveUpdates(_0x29b932[_0x4935('0x43')],null))[_0x4935('0x22')](respondWithResult(_0x392cba,null))[_0x4935('0x41')](handleError(_0x392cba,null));};exports[_0x4935('0x23')]=function(_0x471fb1,_0x4b9c70){return db[_0x4935('0x28')]['find']({'where':{'id':_0x471fb1['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4b9c70,null))[_0x4935('0x22')](removeEntity(_0x4b9c70,null))[_0x4935('0x41')](handleError(_0x4b9c70,null));};exports[_0x4935('0x45')]=function(_0x2dd30f,_0x487cf3){return db[_0x4935('0x28')][_0x4935('0x45')]()[_0x4935('0x22')](respondWithResult(_0x487cf3,null))[_0x4935('0x41')](handleError(_0x487cf3,null));}; \ No newline at end of file +var _0xbaf0=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x53b880,_0x51c5c8){var _0x55ea52=function(_0x490168){while(--_0x490168){_0x53b880['push'](_0x53b880['shift']());}};_0x55ea52(++_0x51c5c8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xcc;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0x1b')](_0xe4378c);}return _0x465dd7['status'](_0xe4378c)[_0x0baf('0x1c')]();};}function respondWithResult(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0xc8;return function(_0x1f50c3){if(_0x1f50c3){return _0x49e44b[_0x0baf('0x1d')](_0x1c76a8)[_0x0baf('0x1e')](_0x1f50c3);}};}function respondWithFilteredResult(_0xb8339e,_0x469599){return function(_0x4f80a8){if(_0x4f80a8){var _0x4cd79d=typeof _0x469599[_0x0baf('0x1f')]===_0x0baf('0x20')&&typeof _0x469599[_0x0baf('0x21')]===_0x0baf('0x20');var _0x2cf7da=_0x4f80a8[_0x0baf('0x22')];var _0x53c338=_0x4cd79d?0x0:_0x469599[_0x0baf('0x1f')];var _0xfbecec=_0x4cd79d?_0x4f80a8[_0x0baf('0x22')]:_0x469599[_0x0baf('0x1f')]+_0x469599[_0x0baf('0x21')];var _0x42b7f2;if(_0xfbecec>=_0x2cf7da){_0xfbecec=_0x2cf7da;_0x42b7f2=0xc8;}else{_0x42b7f2=0xce;}_0xb8339e['status'](_0x42b7f2);return _0xb8339e['set'](_0x0baf('0x23'),_0x53c338+'-'+_0xfbecec+'/'+_0x2cf7da)[_0x0baf('0x1e')](_0x4f80a8);}return null;};}function patchUpdates(_0x32e839){return function(_0x1848e8){try{jsonpatch[_0x0baf('0x24')](_0x1848e8,_0x32e839,!![]);}catch(_0x3e3e20){return BPromise[_0x0baf('0x25')](_0x3e3e20);}return _0x1848e8[_0x0baf('0x26')]();};}function saveUpdates(_0x2c42e2,_0x15a2c3){return function(_0x54f2fa){if(_0x54f2fa){return _0x54f2fa[_0x0baf('0x27')](_0x2c42e2)['then'](function(_0xf6c158){return _0xf6c158;});}return null;};}function removeEntity(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(_0x2ef0aa){return _0x2ef0aa['destroy']()['then'](function(){_0x5dbf00[_0x0baf('0x1d')](0xcc)[_0x0baf('0x1c')]();});}};}function handleEntityNotFound(_0x34e264,_0x19d9fd){return function(_0x3a1ba1){if(!_0x3a1ba1){_0x34e264['sendStatus'](0x194);}return _0x3a1ba1;};}function handleError(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0x1f4;return function(_0x1ca35a){logger[_0x0baf('0x28')](_0x1ca35a[_0x0baf('0x29')]);if(_0x1ca35a[_0x0baf('0x2a')]){delete _0x1ca35a[_0x0baf('0x2a')];}_0x448617['status'](_0x4681c5)[_0x0baf('0x2b')](_0x1ca35a);};}exports[_0x0baf('0x2c')]=function(_0xcaf13d,_0x265915){var _0x55c715={},_0x29dbdf={},_0x34a58a={'count':0x0,'rows':[]};var _0x5d9d7f=_[_0x0baf('0x2d')](db[_0x0baf('0x2e')][_0x0baf('0x2f')],function(_0xb4dbb1){return{'name':_0xb4dbb1[_0x0baf('0x30')],'type':_0xb4dbb1[_0x0baf('0x31')][_0x0baf('0x32')]};});_0x29dbdf['model']=_[_0x0baf('0x2d')](_0x5d9d7f,_0x0baf('0x2a'));_0x29dbdf[_0x0baf('0x33')]=_[_0x0baf('0x34')](_0xcaf13d[_0x0baf('0x33')]);_0x29dbdf[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x29dbdf[_0x0baf('0x37')],_0x29dbdf[_0x0baf('0x33')]);_0x55c715[_0x0baf('0x38')]=_[_0x0baf('0x36')](_0x29dbdf[_0x0baf('0x37')],qs[_0x0baf('0x39')](_0xcaf13d[_0x0baf('0x33')]['fields']));_0x55c715[_0x0baf('0x38')]=_0x55c715['attributes'][_0x0baf('0x3a')]?_0x55c715[_0x0baf('0x38')]:_0x29dbdf[_0x0baf('0x37')];if(!_0xcaf13d[_0x0baf('0x33')]['hasOwnProperty'](_0x0baf('0x3b'))){_0x55c715[_0x0baf('0x21')]=qs['limit'](_0xcaf13d[_0x0baf('0x33')][_0x0baf('0x21')]);_0x55c715[_0x0baf('0x1f')]=qs[_0x0baf('0x1f')](_0xcaf13d[_0x0baf('0x33')][_0x0baf('0x1f')]);}_0x55c715[_0x0baf('0x3c')]=qs[_0x0baf('0x3d')](_0xcaf13d['query'][_0x0baf('0x3d')]);_0x55c715[_0x0baf('0x3e')]=qs['filters'](_[_0x0baf('0x3f')](_0xcaf13d['query'],_0x29dbdf['filters']),_0x5d9d7f);if(_0xcaf13d[_0x0baf('0x33')][_0x0baf('0x40')]){_0x55c715['where']=_['merge'](_0x55c715[_0x0baf('0x3e')],{'$or':_[_0x0baf('0x2d')](_0x5d9d7f,function(_0x3412bc){if(_0x3412bc[_0x0baf('0x31')]!==_0x0baf('0x41')){var _0x2028ad={};_0x2028ad[_0x3412bc[_0x0baf('0x2a')]]={'$like':'%'+_0xcaf13d[_0x0baf('0x33')][_0x0baf('0x40')]+'%'};return _0x2028ad;}})});}_0x55c715=_[_0x0baf('0x42')]({},_0x55c715,_0xcaf13d[_0x0baf('0x43')]);var _0x148540={'where':_0x55c715[_0x0baf('0x3e')]};return db[_0x0baf('0x2e')]['count'](_0x148540)[_0x0baf('0x44')](function(_0x1435d5){_0x34a58a['count']=_0x1435d5;if(_0xcaf13d[_0x0baf('0x33')][_0x0baf('0x45')]){_0x55c715[_0x0baf('0x46')]=[{'all':!![]}];}return db[_0x0baf('0x2e')][_0x0baf('0x47')](_0x55c715);})[_0x0baf('0x44')](function(_0x57b581){_0x34a58a[_0x0baf('0x48')]=_0x57b581;return _0x34a58a;})[_0x0baf('0x44')](respondWithFilteredResult(_0x265915,_0x55c715))['catch'](handleError(_0x265915,null));};exports[_0x0baf('0x49')]=function(_0x412e6f,_0x45c6aa){var _0x57903e={'raw':!![],'where':{'id':_0x412e6f[_0x0baf('0x4a')]['id']}},_0x504031={};_0x504031[_0x0baf('0x37')]=_[_0x0baf('0x34')](db[_0x0baf('0x2e')][_0x0baf('0x2f')]);_0x504031[_0x0baf('0x33')]=_[_0x0baf('0x34')](_0x412e6f[_0x0baf('0x33')]);_0x504031[_0x0baf('0x35')]=_[_0x0baf('0x36')](_0x504031['model'],_0x504031[_0x0baf('0x33')]);_0x57903e[_0x0baf('0x38')]=_[_0x0baf('0x36')](_0x504031[_0x0baf('0x37')],qs[_0x0baf('0x39')](_0x412e6f['query'][_0x0baf('0x39')]));_0x57903e[_0x0baf('0x38')]=_0x57903e[_0x0baf('0x38')][_0x0baf('0x3a')]?_0x57903e[_0x0baf('0x38')]:_0x504031['model'];if(_0x412e6f[_0x0baf('0x33')][_0x0baf('0x45')]){_0x57903e[_0x0baf('0x46')]=[{'all':!![]}];}_0x57903e=_[_0x0baf('0x42')]({},_0x57903e,_0x412e6f[_0x0baf('0x43')]);return db[_0x0baf('0x2e')][_0x0baf('0x4b')](_0x57903e)['then'](handleEntityNotFound(_0x45c6aa,null))[_0x0baf('0x44')](respondWithResult(_0x45c6aa,null))[_0x0baf('0x4c')](handleError(_0x45c6aa,null));};exports[_0x0baf('0x4d')]=function(_0x57008f,_0x3c9de3){return db[_0x0baf('0x2e')][_0x0baf('0x4d')](_0x57008f[_0x0baf('0x4e')],{})[_0x0baf('0x44')](respondWithResult(_0x3c9de3,0xc9))[_0x0baf('0x4c')](handleError(_0x3c9de3,null));};exports[_0x0baf('0x27')]=function(_0x5a54bb,_0x22c451){if(_0x5a54bb[_0x0baf('0x4e')]['id']){delete _0x5a54bb[_0x0baf('0x4e')]['id'];}return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0x5a54bb[_0x0baf('0x4a')]['id']}})[_0x0baf('0x44')](handleEntityNotFound(_0x22c451,null))[_0x0baf('0x44')](saveUpdates(_0x5a54bb[_0x0baf('0x4e')],null))[_0x0baf('0x44')](respondWithResult(_0x22c451,null))[_0x0baf('0x4c')](handleError(_0x22c451,null));};exports['destroy']=function(_0x528ff6,_0x354329){return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0x528ff6[_0x0baf('0x4a')]['id']}})[_0x0baf('0x44')](handleEntityNotFound(_0x354329,null))[_0x0baf('0x44')](removeEntity(_0x354329,null))[_0x0baf('0x4c')](handleError(_0x354329,null));};exports['describe']=function(_0x3fe534,_0x2ef4c1){return db[_0x0baf('0x2e')][_0x0baf('0x4f')]()[_0x0baf('0x44')](respondWithResult(_0x2ef4c1,null))[_0x0baf('0x4c')](handleError(_0x2ef4c1,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index dfed601..0e8e8c9 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 _0xbb69=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define'];(function(_0x52391e,_0x4ed5c3){var _0x124c37=function(_0x2ccf88){while(--_0x2ccf88){_0x52391e['push'](_0x52391e['shift']());}};_0x124c37(++_0x4ed5c3);}(_0xbb69,0xc6));var _0x9bb6=function(_0x27b099,_0x2ce19b){_0x27b099=_0x27b099-0x0;var _0x2a4ee1=_0xbb69[_0x27b099];return _0x2a4ee1;};'use strict';var _=require(_0x9bb6('0x0'));var util=require(_0x9bb6('0x1'));var logger=require(_0x9bb6('0x2'))(_0x9bb6('0x3'));var moment=require(_0x9bb6('0x4'));var BPromise=require(_0x9bb6('0x5'));var rp=require(_0x9bb6('0x6'));var fs=require('fs');var path=require(_0x9bb6('0x7'));var rimraf=require(_0x9bb6('0x8'));var config=require(_0x9bb6('0x9'));var attributes=require(_0x9bb6('0xa'));module['exports']=function(_0x43672b,_0x2c0ff0){return _0x43672b[_0x9bb6('0xb')](_0x9bb6('0xc'),attributes,{'tableName':_0x9bb6('0xd'),'paranoid':![],'indexes':[{'name':_0x9bb6('0xe'),'fields':[_0x9bb6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x40ac=['util','../../config/logger','api','bluebird','request-promise','rimraf','exports','report_whatsapp_queue','uniqueid'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40ac,0xea));var _0xc40a=function(_0x83560f,_0x3d005f){_0x83560f=_0x83560f-0x0;var _0x5d4a9f=_0x40ac[_0x83560f];return _0x5d4a9f;};'use strict';var _=require('lodash');var util=require(_0xc40a('0x0'));var logger=require(_0xc40a('0x1'))(_0xc40a('0x2'));var moment=require('moment');var BPromise=require(_0xc40a('0x3'));var rp=require(_0xc40a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc40a('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0xc40a('0x6')]=function(_0x420e4c,_0x169570){return _0x420e4c['define']('WhatsappQueueReport',attributes,{'tableName':_0xc40a('0x7'),'paranoid':![],'indexes':[{'name':_0xc40a('0x8'),'fields':[_0xc40a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 362cce7..1240621 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 _0x8009=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options','UpdateWhatsappQueueReport','raw','attributes'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0x8009,0xfc));var _0x9800=function(_0x21b7cb,_0x15585f){_0x21b7cb=_0x21b7cb-0x0;var _0x2100d7=_0x8009[_0x21b7cb];return _0x2100d7;};'use strict';var _=require(_0x9800('0x0'));var util=require(_0x9800('0x1'));var moment=require(_0x9800('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9800('0x3'));var db=require(_0x9800('0x4'))['db'];var utils=require(_0x9800('0x5'));var logger=require(_0x9800('0x6'))(_0x9800('0x7'));var config=require('../../config/environment');var jayson=require(_0x9800('0x8'));var client=jayson[_0x9800('0x9')][_0x9800('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x145bce,_0x57b2b6,_0x17b210){return new BPromise(function(_0x5db5e4,_0x5e501c){return client['request'](_0x145bce,_0x17b210)[_0x9800('0xb')](function(_0x598860){logger['info'](_0x9800('0xc'),_0x57b2b6,_0x9800('0xd'));logger[_0x9800('0xe')](_0x9800('0xf'),_0x57b2b6,_0x9800('0xd'),JSON[_0x9800('0x10')](_0x598860));if(_0x598860[_0x9800('0x11')]){if(_0x598860[_0x9800('0x11')]['code']===0x1f4){logger[_0x9800('0x11')](_0x9800('0xc'),_0x57b2b6,_0x598860['error']['message']);return _0x5e501c(_0x598860[_0x9800('0x11')][_0x9800('0x12')]);}logger[_0x9800('0x11')](_0x9800('0xc'),_0x57b2b6,_0x598860['error'][_0x9800('0x12')]);return _0x5db5e4(_0x598860[_0x9800('0x11')][_0x9800('0x12')]);}else{logger[_0x9800('0x13')](_0x9800('0xc'),_0x57b2b6,_0x9800('0xd'));_0x5db5e4(_0x598860[_0x9800('0x14')][_0x9800('0x12')]);}})[_0x9800('0x15')](function(_0x10eec3){logger[_0x9800('0x11')](_0x9800('0xc'),_0x57b2b6,_0x10eec3);_0x5e501c(_0x10eec3);});});}exports[_0x9800('0x16')]=function(_0x29ca7f){var _0x3fd616=this;return new Promise(function(_0x55c648,_0x366a0d){return db[_0x9800('0x17')]['create'](_0x29ca7f['body'],{'raw':_0x29ca7f[_0x9800('0x18')]?_0x29ca7f[_0x9800('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9800('0xb')](function(_0x319a4b){logger[_0x9800('0x13')](_0x9800('0x16'),_0x29ca7f);logger[_0x9800('0xe')](_0x9800('0x16'),_0x29ca7f,JSON[_0x9800('0x10')](_0x319a4b));_0x55c648(_0x319a4b);})[_0x9800('0x15')](function(_0x2de9f6){logger[_0x9800('0x11')](_0x9800('0x16'),_0x2de9f6['message'],_0x29ca7f);_0x366a0d(_0x3fd616[_0x9800('0x11')](0x1f4,_0x2de9f6[_0x9800('0x12')]));});});};exports[_0x9800('0x19')]=function(_0x4883c6){var _0x9fc112=this;return new Promise(function(_0x174890,_0x3ad67a){return db['WhatsappQueueReport']['update'](_0x4883c6['body'],{'raw':_0x4883c6['options']?_0x4883c6['options'][_0x9800('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4883c6[_0x9800('0x18')]?_0x4883c6[_0x9800('0x18')]['where']||null:null,'attributes':_0x4883c6['options']?_0x4883c6[_0x9800('0x18')][_0x9800('0x1b')]||null:null,'limit':_0x4883c6[_0x9800('0x18')]?_0x4883c6[_0x9800('0x18')]['limit']||null:null})[_0x9800('0xb')](function(_0x54888e){logger['info'](_0x9800('0x19'),_0x4883c6);logger[_0x9800('0xe')](_0x9800('0x19'),_0x4883c6,JSON[_0x9800('0x10')](_0x54888e));_0x174890(_0x54888e);})['catch'](function(_0x59ce7a){logger[_0x9800('0x11')](_0x9800('0x19'),_0x59ce7a[_0x9800('0x12')],_0x4883c6);_0x3ad67a(_0x9fc112['error'](0x1f4,_0x59ce7a[_0x9800('0x12')]));});});}; \ No newline at end of file +var _0x1a17=['body','options','raw','CreateWhatsappQueueReport','debug','stringify','catch','update','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','WhatsappQueueReport','create'];(function(_0x356f4e,_0x597033){var _0x4eaae9=function(_0xb058e6){while(--_0xb058e6){_0x356f4e['push'](_0x356f4e['shift']());}};_0x4eaae9(++_0x597033);}(_0x1a17,0x172));var _0x71a1=function(_0x3c0a2e,_0x17072c){_0x3c0a2e=_0x3c0a2e-0x0;var _0x44dbc2=_0x1a17[_0x3c0a2e];return _0x44dbc2;};'use strict';var _=require(_0x71a1('0x0'));var util=require(_0x71a1('0x1'));var moment=require(_0x71a1('0x2'));var BPromise=require(_0x71a1('0x3'));var rs=require(_0x71a1('0x4'));var fs=require('fs');var Redis=require(_0x71a1('0x5'));var db=require(_0x71a1('0x6'))['db'];var utils=require(_0x71a1('0x7'));var logger=require('../../config/logger')(_0x71a1('0x8'));var config=require(_0x71a1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x71a1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x480c6c,_0x4c86da,_0xc30aa0){return new BPromise(function(_0x2e4e33,_0x1593b4){return client['request'](_0x480c6c,_0xc30aa0)[_0x71a1('0xb')](function(_0x40d3fa){logger[_0x71a1('0xc')](_0x71a1('0xd'),_0x4c86da,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4c86da,_0x71a1('0xe'),JSON['stringify'](_0x40d3fa));if(_0x40d3fa[_0x71a1('0xf')]){if(_0x40d3fa[_0x71a1('0xf')][_0x71a1('0x10')]===0x1f4){logger[_0x71a1('0xf')](_0x71a1('0xd'),_0x4c86da,_0x40d3fa[_0x71a1('0xf')][_0x71a1('0x11')]);return _0x1593b4(_0x40d3fa[_0x71a1('0xf')][_0x71a1('0x11')]);}logger[_0x71a1('0xf')](_0x71a1('0xd'),_0x4c86da,_0x40d3fa[_0x71a1('0xf')]['message']);return _0x2e4e33(_0x40d3fa[_0x71a1('0xf')][_0x71a1('0x11')]);}else{logger[_0x71a1('0xc')](_0x71a1('0xd'),_0x4c86da,_0x71a1('0xe'));_0x2e4e33(_0x40d3fa['result'][_0x71a1('0x11')]);}})['catch'](function(_0x58dc9c){logger[_0x71a1('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4c86da,_0x58dc9c);_0x1593b4(_0x58dc9c);});});}exports['CreateWhatsappQueueReport']=function(_0x1392f2){var _0x26c111=this;return new Promise(function(_0x31be08,_0x2f43ac){return db[_0x71a1('0x12')][_0x71a1('0x13')](_0x1392f2[_0x71a1('0x14')],{'raw':_0x1392f2[_0x71a1('0x15')]?_0x1392f2['options'][_0x71a1('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5650fa){logger[_0x71a1('0xc')](_0x71a1('0x17'),_0x1392f2);logger[_0x71a1('0x18')]('CreateWhatsappQueueReport',_0x1392f2,JSON[_0x71a1('0x19')](_0x5650fa));_0x31be08(_0x5650fa);})[_0x71a1('0x1a')](function(_0x1802e8){logger[_0x71a1('0xf')](_0x71a1('0x17'),_0x1802e8[_0x71a1('0x11')],_0x1392f2);_0x2f43ac(_0x26c111['error'](0x1f4,_0x1802e8[_0x71a1('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x310ec8){var _0x61b4ed=this;return new Promise(function(_0x294177,_0x3b16d7){return db[_0x71a1('0x12')][_0x71a1('0x1b')](_0x310ec8['body'],{'raw':_0x310ec8[_0x71a1('0x15')]?_0x310ec8['options'][_0x71a1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310ec8[_0x71a1('0x15')]?_0x310ec8[_0x71a1('0x15')]['where']||null:null,'attributes':_0x310ec8[_0x71a1('0x15')]?_0x310ec8[_0x71a1('0x15')][_0x71a1('0x1c')]||null:null,'limit':_0x310ec8[_0x71a1('0x15')]?_0x310ec8['options']['limit']||null:null})['then'](function(_0x4e6709){logger[_0x71a1('0xc')](_0x71a1('0x1d'),_0x310ec8);logger['debug']('UpdateWhatsappQueueReport',_0x310ec8,JSON[_0x71a1('0x19')](_0x4e6709));_0x294177(_0x4e6709);})[_0x71a1('0x1a')](function(_0x39df0a){logger[_0x71a1('0xf')](_0x71a1('0x1d'),_0x39df0a[_0x71a1('0x11')],_0x310ec8);_0x3b16d7(_0x61b4ed[_0x71a1('0xf')](0x1f4,_0x39df0a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index c40fc1d..8c87ae3 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 _0xd7af=['isAuthenticated','describe','show','create','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd7af,0x9f));var _0xfd7a=function(_0x2da472,_0x4d9f61){_0x2da472=_0x2da472-0x0;var _0x183ff3=_0xd7af[_0x2da472];return _0x183ff3;};'use strict';var multer=require(_0xfd7a('0x0'));var util=require('util');var path=require(_0xfd7a('0x1'));var timeout=require(_0xfd7a('0x2'));var express=require('express');var router=express[_0xfd7a('0x3')]();var fs_extra=require(_0xfd7a('0x4'));var auth=require(_0xfd7a('0x5'));var interaction=require(_0xfd7a('0x6'));var config=require(_0xfd7a('0x7'));var controller=require(_0xfd7a('0x8'));router[_0xfd7a('0x9')]('/',auth['isAuthenticated'](),controller[_0xfd7a('0xa')]);router['get'](_0xfd7a('0xb'),auth[_0xfd7a('0xc')](),controller[_0xfd7a('0xd')]);router['get']('/:id',auth[_0xfd7a('0xc')](),controller[_0xfd7a('0xe')]);router['post']('/',auth[_0xfd7a('0xc')](),controller[_0xfd7a('0xf')]);router['put'](_0xfd7a('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfd7a('0x11')]);module[_0xfd7a('0x12')]=router; \ No newline at end of file +var _0x6da8=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create','update','delete','destroy','multer','util'];(function(_0x53ca92,_0x3af852){var _0x138062=function(_0x1854e9){while(--_0x1854e9){_0x53ca92['push'](_0x53ca92['shift']());}};_0x138062(++_0x3af852);}(_0x6da8,0x12a));var _0x86da=function(_0x31c355,_0xbbc61c){_0x31c355=_0x31c355-0x0;var _0x5b7fff=_0x6da8[_0x31c355];return _0x5b7fff;};'use strict';var multer=require(_0x86da('0x0'));var util=require(_0x86da('0x1'));var path=require(_0x86da('0x2'));var timeout=require(_0x86da('0x3'));var express=require(_0x86da('0x4'));var router=express[_0x86da('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x86da('0x6'));var interaction=require(_0x86da('0x7'));var config=require(_0x86da('0x8'));var controller=require(_0x86da('0x9'));router[_0x86da('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x86da('0xa')](_0x86da('0xb'),auth[_0x86da('0xc')](),controller[_0x86da('0xd')]);router[_0x86da('0xa')](_0x86da('0xe'),auth[_0x86da('0xc')](),controller[_0x86da('0xf')]);router['post']('/',auth[_0x86da('0xc')](),controller[_0x86da('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x86da('0x11')]);router[_0x86da('0x12')](_0x86da('0xe'),auth[_0x86da('0xc')](),controller[_0x86da('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index cf21ab5..e95e533 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 _0x33d2=['DATE','sequelize','exports','STRING','account','agent'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x33d2,0x7f));var _0x233d=function(_0x15a34f,_0x1378ba){_0x15a34f=_0x15a34f-0x0;var _0x2e7b6b=_0x33d2[_0x15a34f];return _0x2e7b6b;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'uniqueid':{'type':Sequelize[_0x233d('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x233d('0x3'),_0x233d('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x233d('0x5')]}}; \ No newline at end of file +var _0x07a2=['exports','ENUM','account','agent','queue','DATE','sequelize'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x07a2,0x12c));var _0x207a=function(_0x5abe5a,_0x5747c0){_0x5abe5a=_0x5abe5a-0x0;var _0x5abba2=_0x07a2[_0x5abe5a];return _0x5abba2;};'use strict';var Sequelize=require(_0x207a('0x0'));module[_0x207a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x207a('0x2')](_0x207a('0x3'),_0x207a('0x4'),_0x207a('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x207a('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f5d62e3..17d2205 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 _0x882c=['index','map','WhatsappTransferReport','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','params','options','find','create','body','destroy','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','send'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x882c,0x6c));var _0xc882=function(_0xc41365,_0x35d774){_0xc41365=_0xc41365-0x0;var _0x388102=_0x882c[_0xc41365];return _0x388102;};'use strict';var emlformat=require(_0xc882('0x0'));var rimraf=require(_0xc882('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc882('0x2'));var moment=require('moment');var BPromise=require(_0xc882('0x3'));var Mustache=require(_0xc882('0x4'));var util=require(_0xc882('0x5'));var path=require(_0xc882('0x6'));var sox=require('sox');var csv=require(_0xc882('0x7'));var ejs=require(_0xc882('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc882('0x9'));var squel=require(_0xc882('0xa'));var crypto=require(_0xc882('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc882('0x7'));var querystring=require(_0xc882('0xc'));var Papa=require(_0xc882('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc882('0xe'));var as=require(_0xc882('0xf'));var hardwareService=require(_0xc882('0x10'));var logger=require(_0xc882('0x11'))('api');var utils=require(_0xc882('0x12'));var config=require(_0xc882('0x13'));var licenseUtil=require(_0xc882('0x14'));var db=require(_0xc882('0x15'))['db'];function respondWithStatusCode(_0x14b989,_0x1e3597){_0x1e3597=_0x1e3597||0xcc;return function(_0x554ac8){if(_0x554ac8){return _0x14b989['sendStatus'](_0x1e3597);}return _0x14b989[_0xc882('0x16')](_0x1e3597)['end']();};}function respondWithResult(_0x560f55,_0x1d986c){_0x1d986c=_0x1d986c||0xc8;return function(_0x5a586e){if(_0x5a586e){return _0x560f55[_0xc882('0x16')](_0x1d986c)[_0xc882('0x17')](_0x5a586e);}};}function respondWithFilteredResult(_0x5f4418,_0x33f086){return function(_0x40b452){if(_0x40b452){var _0x26b6c7=typeof _0x33f086['offset']===_0xc882('0x18')&&typeof _0x33f086[_0xc882('0x19')]==='undefined';var _0x38521b=_0x40b452['count'];var _0x4bf8c6=_0x26b6c7?0x0:_0x33f086[_0xc882('0x1a')];var _0x2c6644=_0x26b6c7?_0x40b452[_0xc882('0x1b')]:_0x33f086[_0xc882('0x1a')]+_0x33f086[_0xc882('0x19')];var _0x4f4a9f;if(_0x2c6644>=_0x38521b){_0x2c6644=_0x38521b;_0x4f4a9f=0xc8;}else{_0x4f4a9f=0xce;}_0x5f4418['status'](_0x4f4a9f);return _0x5f4418[_0xc882('0x1c')](_0xc882('0x1d'),_0x4bf8c6+'-'+_0x2c6644+'/'+_0x38521b)['json'](_0x40b452);}return null;};}function patchUpdates(_0x603616){return function(_0x26d841){try{jsonpatch[_0xc882('0x1e')](_0x26d841,_0x603616,!![]);}catch(_0x32bf40){return BPromise[_0xc882('0x1f')](_0x32bf40);}return _0x26d841[_0xc882('0x20')]();};}function saveUpdates(_0x1f1e9e,_0x2bd26a){return function(_0x137714){if(_0x137714){return _0x137714[_0xc882('0x21')](_0x1f1e9e)[_0xc882('0x22')](function(_0xeefbf6){return _0xeefbf6;});}return null;};}function removeEntity(_0x29d6b1,_0x2ea8bd){return function(_0x2b1eaf){if(_0x2b1eaf){return _0x2b1eaf['destroy']()['then'](function(){_0x29d6b1[_0xc882('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217b04,_0x3e1b48){return function(_0x587cca){if(!_0x587cca){_0x217b04[_0xc882('0x23')](0x194);}return _0x587cca;};}function handleError(_0x3c80f0,_0x25af74){_0x25af74=_0x25af74||0x1f4;return function(_0x1d1562){logger['error'](_0x1d1562[_0xc882('0x24')]);if(_0x1d1562['name']){delete _0x1d1562['name'];}_0x3c80f0[_0xc882('0x16')](_0x25af74)[_0xc882('0x25')](_0x1d1562);};}exports[_0xc882('0x26')]=function(_0x20c5c6,_0x5d203e){var _0xf3c0af={},_0x1d4803={},_0x4bfba3={'count':0x0,'rows':[]};var _0x1a185b=_[_0xc882('0x27')](db[_0xc882('0x28')][_0xc882('0x29')],function(_0x238e36){return{'name':_0x238e36['fieldName'],'type':_0x238e36[_0xc882('0x2a')][_0xc882('0x2b')]};});_0x1d4803[_0xc882('0x2c')]=_['map'](_0x1a185b,_0xc882('0x2d'));_0x1d4803[_0xc882('0x2e')]=_[_0xc882('0x2f')](_0x20c5c6['query']);_0x1d4803[_0xc882('0x30')]=_['intersection'](_0x1d4803[_0xc882('0x2c')],_0x1d4803[_0xc882('0x2e')]);_0xf3c0af[_0xc882('0x31')]=_[_0xc882('0x32')](_0x1d4803[_0xc882('0x2c')],qs[_0xc882('0x33')](_0x20c5c6[_0xc882('0x2e')][_0xc882('0x33')]));_0xf3c0af['attributes']=_0xf3c0af['attributes'][_0xc882('0x34')]?_0xf3c0af['attributes']:_0x1d4803[_0xc882('0x2c')];if(!_0x20c5c6[_0xc882('0x2e')][_0xc882('0x35')](_0xc882('0x36'))){_0xf3c0af[_0xc882('0x19')]=qs['limit'](_0x20c5c6[_0xc882('0x2e')]['limit']);_0xf3c0af['offset']=qs[_0xc882('0x1a')](_0x20c5c6[_0xc882('0x2e')][_0xc882('0x1a')]);}_0xf3c0af[_0xc882('0x37')]=qs['sort'](_0x20c5c6['query'][_0xc882('0x38')]);_0xf3c0af['where']=qs['filters'](_[_0xc882('0x39')](_0x20c5c6[_0xc882('0x2e')],_0x1d4803[_0xc882('0x30')]),_0x1a185b);if(_0x20c5c6['query'][_0xc882('0x3a')]){_0xf3c0af['where']=_['merge'](_0xf3c0af[_0xc882('0x3b')],{'$or':_[_0xc882('0x27')](_0x1a185b,function(_0x1adb64){if(_0x1adb64[_0xc882('0x2a')]!==_0xc882('0x3c')){var _0x305298={};_0x305298[_0x1adb64[_0xc882('0x2d')]]={'$like':'%'+_0x20c5c6[_0xc882('0x2e')]['filter']+'%'};return _0x305298;}})});}_0xf3c0af=_[_0xc882('0x3d')]({},_0xf3c0af,_0x20c5c6['options']);var _0x11d183={'where':_0xf3c0af['where']};return db['WhatsappTransferReport'][_0xc882('0x1b')](_0x11d183)[_0xc882('0x22')](function(_0x515014){_0x4bfba3['count']=_0x515014;if(_0x20c5c6['query'][_0xc882('0x3e')]){_0xf3c0af[_0xc882('0x3f')]=[{'all':!![]}];}return db[_0xc882('0x28')]['findAll'](_0xf3c0af);})[_0xc882('0x22')](function(_0x4c5cb9){_0x4bfba3[_0xc882('0x40')]=_0x4c5cb9;return _0x4bfba3;})[_0xc882('0x22')](respondWithFilteredResult(_0x5d203e,_0xf3c0af))[_0xc882('0x41')](handleError(_0x5d203e,null));};exports['show']=function(_0x4cdafc,_0x485ba8){var _0x56d585={'raw':!![],'where':{'id':_0x4cdafc[_0xc882('0x42')]['id']}},_0x4de7c9={};_0x4de7c9[_0xc882('0x2c')]=_[_0xc882('0x2f')](db[_0xc882('0x28')][_0xc882('0x29')]);_0x4de7c9[_0xc882('0x2e')]=_['keys'](_0x4cdafc[_0xc882('0x2e')]);_0x4de7c9[_0xc882('0x30')]=_[_0xc882('0x32')](_0x4de7c9['model'],_0x4de7c9[_0xc882('0x2e')]);_0x56d585[_0xc882('0x31')]=_['intersection'](_0x4de7c9[_0xc882('0x2c')],qs[_0xc882('0x33')](_0x4cdafc[_0xc882('0x2e')][_0xc882('0x33')]));_0x56d585[_0xc882('0x31')]=_0x56d585[_0xc882('0x31')][_0xc882('0x34')]?_0x56d585[_0xc882('0x31')]:_0x4de7c9['model'];if(_0x4cdafc[_0xc882('0x2e')][_0xc882('0x3e')]){_0x56d585[_0xc882('0x3f')]=[{'all':!![]}];}_0x56d585=_[_0xc882('0x3d')]({},_0x56d585,_0x4cdafc[_0xc882('0x43')]);return db[_0xc882('0x28')][_0xc882('0x44')](_0x56d585)[_0xc882('0x22')](handleEntityNotFound(_0x485ba8,null))['then'](respondWithResult(_0x485ba8,null))[_0xc882('0x41')](handleError(_0x485ba8,null));};exports[_0xc882('0x45')]=function(_0x26f132,_0x116de0){return db[_0xc882('0x28')]['create'](_0x26f132['body'],{})[_0xc882('0x22')](respondWithResult(_0x116de0,0xc9))[_0xc882('0x41')](handleError(_0x116de0,null));};exports['update']=function(_0x39ca55,_0x3ecf77){if(_0x39ca55[_0xc882('0x46')]['id']){delete _0x39ca55[_0xc882('0x46')]['id'];}return db['WhatsappTransferReport'][_0xc882('0x44')]({'where':{'id':_0x39ca55[_0xc882('0x42')]['id']}})[_0xc882('0x22')](handleEntityNotFound(_0x3ecf77,null))[_0xc882('0x22')](saveUpdates(_0x39ca55[_0xc882('0x46')],null))['then'](respondWithResult(_0x3ecf77,null))[_0xc882('0x41')](handleError(_0x3ecf77,null));};exports[_0xc882('0x47')]=function(_0x2f1cd6,_0x459be1){return db[_0xc882('0x28')]['find']({'where':{'id':_0x2f1cd6[_0xc882('0x42')]['id']}})[_0xc882('0x22')](handleEntityNotFound(_0x459be1,null))[_0xc882('0x22')](removeEntity(_0x459be1,null))[_0xc882('0x41')](handleError(_0x459be1,null));};exports[_0xc882('0x48')]=function(_0x11c9cf,_0x8985a7){return db['WhatsappTransferReport'][_0xc882('0x48')]()[_0xc882('0x22')](respondWithResult(_0x8985a7,null))['catch'](handleError(_0x8985a7,null));}; \ No newline at end of file +var _0x99bd=['../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0x99bd,0x116));var _0xd99b=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x99bd[_0x4ae829];return _0x256b31;};'use strict';var emlformat=require(_0xd99b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd99b('0x1'));var jsonpatch=require(_0xd99b('0x2'));var rp=require(_0xd99b('0x3'));var moment=require(_0xd99b('0x4'));var BPromise=require(_0xd99b('0x5'));var Mustache=require(_0xd99b('0x6'));var util=require(_0xd99b('0x7'));var path=require(_0xd99b('0x8'));var sox=require(_0xd99b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd99b('0xa'));var _=require(_0xd99b('0xb'));var squel=require(_0xd99b('0xc'));var crypto=require(_0xd99b('0xd'));var jsforce=require(_0xd99b('0xe'));var deskjs=require(_0xd99b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd99b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd99b('0x11'));var qs=require(_0xd99b('0x12'));var as=require(_0xd99b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd99b('0x14'))('api');var utils=require(_0xd99b('0x15'));var config=require(_0xd99b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd99b('0x17'))['db'];function respondWithStatusCode(_0x17a059,_0x1a5258){_0x1a5258=_0x1a5258||0xcc;return function(_0x4dca46){if(_0x4dca46){return _0x17a059[_0xd99b('0x18')](_0x1a5258);}return _0x17a059[_0xd99b('0x19')](_0x1a5258)[_0xd99b('0x1a')]();};}function respondWithResult(_0x5f2cc0,_0x22fb09){_0x22fb09=_0x22fb09||0xc8;return function(_0x3d9321){if(_0x3d9321){return _0x5f2cc0[_0xd99b('0x19')](_0x22fb09)[_0xd99b('0x1b')](_0x3d9321);}};}function respondWithFilteredResult(_0x4cfd73,_0x28cd02){return function(_0x14c93f){if(_0x14c93f){var _0x1059a8=typeof _0x28cd02['offset']===_0xd99b('0x1c')&&typeof _0x28cd02[_0xd99b('0x1d')]==='undefined';var _0x2b88a9=_0x14c93f['count'];var _0x3610ff=_0x1059a8?0x0:_0x28cd02[_0xd99b('0x1e')];var _0x2ee38a=_0x1059a8?_0x14c93f[_0xd99b('0x1f')]:_0x28cd02[_0xd99b('0x1e')]+_0x28cd02[_0xd99b('0x1d')];var _0x5585bb;if(_0x2ee38a>=_0x2b88a9){_0x2ee38a=_0x2b88a9;_0x5585bb=0xc8;}else{_0x5585bb=0xce;}_0x4cfd73[_0xd99b('0x19')](_0x5585bb);return _0x4cfd73['set']('Content-Range',_0x3610ff+'-'+_0x2ee38a+'/'+_0x2b88a9)[_0xd99b('0x1b')](_0x14c93f);}return null;};}function patchUpdates(_0x399f52){return function(_0x1e53b5){try{jsonpatch[_0xd99b('0x20')](_0x1e53b5,_0x399f52,!![]);}catch(_0x4addf4){return BPromise[_0xd99b('0x21')](_0x4addf4);}return _0x1e53b5[_0xd99b('0x22')]();};}function saveUpdates(_0x527ebe,_0x5ab606){return function(_0x56c16f){if(_0x56c16f){return _0x56c16f[_0xd99b('0x23')](_0x527ebe)[_0xd99b('0x24')](function(_0x195a5a){return _0x195a5a;});}return null;};}function removeEntity(_0x314e59,_0x1be4f0){return function(_0x3f6868){if(_0x3f6868){return _0x3f6868[_0xd99b('0x25')]()['then'](function(){_0x314e59[_0xd99b('0x19')](0xcc)[_0xd99b('0x1a')]();});}};}function handleEntityNotFound(_0x7f6bd2,_0x50c0c0){return function(_0x11bf00){if(!_0x11bf00){_0x7f6bd2[_0xd99b('0x18')](0x194);}return _0x11bf00;};}function handleError(_0x3bec08,_0x1664b3){_0x1664b3=_0x1664b3||0x1f4;return function(_0x40a72d){logger['error'](_0x40a72d[_0xd99b('0x26')]);if(_0x40a72d[_0xd99b('0x27')]){delete _0x40a72d[_0xd99b('0x27')];}_0x3bec08[_0xd99b('0x19')](_0x1664b3)[_0xd99b('0x28')](_0x40a72d);};}exports[_0xd99b('0x29')]=function(_0x132053,_0x583b2b){var _0x14ce92={},_0x559c92={},_0x4d7541={'count':0x0,'rows':[]};var _0x4bde46=_['map'](db['WhatsappTransferReport'][_0xd99b('0x2a')],function(_0x2d2f18){return{'name':_0x2d2f18[_0xd99b('0x2b')],'type':_0x2d2f18[_0xd99b('0x2c')]['key']};});_0x559c92[_0xd99b('0x2d')]=_[_0xd99b('0x2e')](_0x4bde46,_0xd99b('0x27'));_0x559c92['query']=_[_0xd99b('0x2f')](_0x132053['query']);_0x559c92[_0xd99b('0x30')]=_['intersection'](_0x559c92[_0xd99b('0x2d')],_0x559c92['query']);_0x14ce92[_0xd99b('0x31')]=_[_0xd99b('0x32')](_0x559c92['model'],qs[_0xd99b('0x33')](_0x132053[_0xd99b('0x34')][_0xd99b('0x33')]));_0x14ce92[_0xd99b('0x31')]=_0x14ce92[_0xd99b('0x31')][_0xd99b('0x35')]?_0x14ce92['attributes']:_0x559c92['model'];if(!_0x132053['query'][_0xd99b('0x36')](_0xd99b('0x37'))){_0x14ce92[_0xd99b('0x1d')]=qs[_0xd99b('0x1d')](_0x132053[_0xd99b('0x34')][_0xd99b('0x1d')]);_0x14ce92[_0xd99b('0x1e')]=qs[_0xd99b('0x1e')](_0x132053[_0xd99b('0x34')]['offset']);}_0x14ce92[_0xd99b('0x38')]=qs[_0xd99b('0x39')](_0x132053[_0xd99b('0x34')][_0xd99b('0x39')]);_0x14ce92['where']=qs[_0xd99b('0x30')](_[_0xd99b('0x3a')](_0x132053['query'],_0x559c92['filters']),_0x4bde46);if(_0x132053[_0xd99b('0x34')][_0xd99b('0x3b')]){_0x14ce92[_0xd99b('0x3c')]=_[_0xd99b('0x3d')](_0x14ce92[_0xd99b('0x3c')],{'$or':_[_0xd99b('0x2e')](_0x4bde46,function(_0xcfaaa4){if(_0xcfaaa4[_0xd99b('0x2c')]!==_0xd99b('0x3e')){var _0x204b6b={};_0x204b6b[_0xcfaaa4[_0xd99b('0x27')]]={'$like':'%'+_0x132053[_0xd99b('0x34')][_0xd99b('0x3b')]+'%'};return _0x204b6b;}})});}_0x14ce92=_[_0xd99b('0x3d')]({},_0x14ce92,_0x132053[_0xd99b('0x3f')]);var _0x38a090={'where':_0x14ce92[_0xd99b('0x3c')]};return db[_0xd99b('0x40')][_0xd99b('0x1f')](_0x38a090)[_0xd99b('0x24')](function(_0x1f5237){_0x4d7541['count']=_0x1f5237;if(_0x132053[_0xd99b('0x34')][_0xd99b('0x41')]){_0x14ce92[_0xd99b('0x42')]=[{'all':!![]}];}return db[_0xd99b('0x40')][_0xd99b('0x43')](_0x14ce92);})[_0xd99b('0x24')](function(_0x306e32){_0x4d7541[_0xd99b('0x44')]=_0x306e32;return _0x4d7541;})[_0xd99b('0x24')](respondWithFilteredResult(_0x583b2b,_0x14ce92))[_0xd99b('0x45')](handleError(_0x583b2b,null));};exports['show']=function(_0x44ea2f,_0x46ee59){var _0x528fcd={'raw':!![],'where':{'id':_0x44ea2f[_0xd99b('0x46')]['id']}},_0xdc1a55={};_0xdc1a55[_0xd99b('0x2d')]=_[_0xd99b('0x2f')](db[_0xd99b('0x40')][_0xd99b('0x2a')]);_0xdc1a55[_0xd99b('0x34')]=_[_0xd99b('0x2f')](_0x44ea2f[_0xd99b('0x34')]);_0xdc1a55[_0xd99b('0x30')]=_['intersection'](_0xdc1a55[_0xd99b('0x2d')],_0xdc1a55[_0xd99b('0x34')]);_0x528fcd['attributes']=_['intersection'](_0xdc1a55[_0xd99b('0x2d')],qs[_0xd99b('0x33')](_0x44ea2f[_0xd99b('0x34')][_0xd99b('0x33')]));_0x528fcd['attributes']=_0x528fcd[_0xd99b('0x31')][_0xd99b('0x35')]?_0x528fcd[_0xd99b('0x31')]:_0xdc1a55[_0xd99b('0x2d')];if(_0x44ea2f['query'][_0xd99b('0x41')]){_0x528fcd['include']=[{'all':!![]}];}_0x528fcd=_[_0xd99b('0x3d')]({},_0x528fcd,_0x44ea2f[_0xd99b('0x3f')]);return db[_0xd99b('0x40')]['find'](_0x528fcd)[_0xd99b('0x24')](handleEntityNotFound(_0x46ee59,null))[_0xd99b('0x24')](respondWithResult(_0x46ee59,null))[_0xd99b('0x45')](handleError(_0x46ee59,null));};exports[_0xd99b('0x47')]=function(_0x4e61b2,_0x505f90){return db[_0xd99b('0x40')][_0xd99b('0x47')](_0x4e61b2['body'],{})[_0xd99b('0x24')](respondWithResult(_0x505f90,0xc9))[_0xd99b('0x45')](handleError(_0x505f90,null));};exports[_0xd99b('0x23')]=function(_0x14f978,_0x6aa95f){if(_0x14f978[_0xd99b('0x48')]['id']){delete _0x14f978[_0xd99b('0x48')]['id'];}return db[_0xd99b('0x40')][_0xd99b('0x49')]({'where':{'id':_0x14f978[_0xd99b('0x46')]['id']}})['then'](handleEntityNotFound(_0x6aa95f,null))[_0xd99b('0x24')](saveUpdates(_0x14f978['body'],null))[_0xd99b('0x24')](respondWithResult(_0x6aa95f,null))[_0xd99b('0x45')](handleError(_0x6aa95f,null));};exports[_0xd99b('0x25')]=function(_0x147099,_0x261323){return db[_0xd99b('0x40')][_0xd99b('0x49')]({'where':{'id':_0x147099['params']['id']}})[_0xd99b('0x24')](handleEntityNotFound(_0x261323,null))['then'](removeEntity(_0x261323,null))[_0xd99b('0x45')](handleError(_0x261323,null));};exports['describe']=function(_0x32c78c,_0x286597){return db[_0xd99b('0x40')][_0xd99b('0x4a')]()[_0xd99b('0x24')](respondWithResult(_0x286597,null))[_0xd99b('0x45')](handleError(_0x286597,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 9f3301f..b33dc8d 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 _0x0fd7=['bluebird','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x2aa3a9,_0x5cd194){var _0x5eefd7=function(_0x2dd55e){while(--_0x2dd55e){_0x2aa3a9['push'](_0x2aa3a9['shift']());}};_0x5eefd7(++_0x5cd194);}(_0x0fd7,0x181));var _0x70fd=function(_0x54a12d,_0x1502ef){_0x54a12d=_0x54a12d-0x0;var _0x40097b=_0x0fd7[_0x54a12d];return _0x40097b;};'use strict';var _=require(_0x70fd('0x0'));var util=require(_0x70fd('0x1'));var logger=require(_0x70fd('0x2'))(_0x70fd('0x3'));var moment=require(_0x70fd('0x4'));var BPromise=require(_0x70fd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x70fd('0x6'));var rimraf=require(_0x70fd('0x7'));var config=require('../../config/environment');var attributes=require(_0x70fd('0x8'));module[_0x70fd('0x9')]=function(_0x162e92,_0x1d319a){return _0x162e92[_0x70fd('0xa')](_0x70fd('0xb'),attributes,{'tableName':_0x70fd('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa5b3=['api','moment','bluebird','path','rimraf','../../config/environment','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x30e87d,_0x54dd69){var _0x42badc=function(_0x3eb3d6){while(--_0x3eb3d6){_0x30e87d['push'](_0x30e87d['shift']());}};_0x42badc(++_0x54dd69);}(_0xa5b3,0x10e));var _0x3a5b=function(_0x479f12,_0x4a71cd){_0x479f12=_0x479f12-0x0;var _0x258f36=_0xa5b3[_0x479f12];return _0x258f36;};'use strict';var _=require(_0x3a5b('0x0'));var util=require(_0x3a5b('0x1'));var logger=require(_0x3a5b('0x2'))(_0x3a5b('0x3'));var moment=require(_0x3a5b('0x4'));var BPromise=require(_0x3a5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a5b('0x6'));var rimraf=require(_0x3a5b('0x7'));var config=require(_0x3a5b('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0x3a5b('0x9')]=function(_0x37389f,_0x52cdb1){return _0x37389f['define'](_0x3a5b('0xa'),attributes,{'tableName':_0x3a5b('0xb'),'paranoid':![],'indexes':[{'name':_0x3a5b('0xc'),'fields':[_0x3a5b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 38ede8c..619f147 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 _0x5700=['http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x1bd87e,_0x317993){var _0x189074=function(_0x53c1cf){while(--_0x53c1cf){_0x1bd87e['push'](_0x1bd87e['shift']());}};_0x189074(++_0x317993);}(_0x5700,0x129));var _0x0570=function(_0x323387,_0x4d1c1a){_0x323387=_0x323387-0x0;var _0x406f8e=_0x5700[_0x323387];return _0x406f8e;};'use strict';var _=require(_0x0570('0x0'));var util=require(_0x0570('0x1'));var moment=require(_0x0570('0x2'));var BPromise=require(_0x0570('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0570('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0570('0x5'))(_0x0570('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0570('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x524842,_0x10d6d6,_0x53c0f9){return new BPromise(function(_0x21d99c,_0x51c5c1){return client[_0x0570('0x8')](_0x524842,_0x53c0f9)[_0x0570('0x9')](function(_0x355e9e){logger['info'](_0x0570('0xa'),_0x10d6d6,_0x0570('0xb'));logger[_0x0570('0xc')](_0x0570('0xd'),_0x10d6d6,_0x0570('0xb'),JSON[_0x0570('0xe')](_0x355e9e));if(_0x355e9e[_0x0570('0xf')]){if(_0x355e9e['error']['code']===0x1f4){logger[_0x0570('0xf')](_0x0570('0xa'),_0x10d6d6,_0x355e9e['error'][_0x0570('0x10')]);return _0x51c5c1(_0x355e9e['error'][_0x0570('0x10')]);}logger['error'](_0x0570('0xa'),_0x10d6d6,_0x355e9e['error'][_0x0570('0x10')]);return _0x21d99c(_0x355e9e[_0x0570('0xf')][_0x0570('0x10')]);}else{logger[_0x0570('0x11')](_0x0570('0xa'),_0x10d6d6,_0x0570('0xb'));_0x21d99c(_0x355e9e['result'][_0x0570('0x10')]);}})[_0x0570('0x12')](function(_0x50e3a3){logger[_0x0570('0xf')](_0x0570('0xa'),_0x10d6d6,_0x50e3a3);_0x51c5c1(_0x50e3a3);});});} \ No newline at end of file +var _0x346c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','lodash','util'];(function(_0x199486,_0x40beb2){var _0x3769e9=function(_0x1350b0){while(--_0x1350b0){_0x199486['push'](_0x199486['shift']());}};_0x3769e9(++_0x40beb2);}(_0x346c,0x15e));var _0xc346=function(_0x5db765,_0x2cbc16){_0x5db765=_0x5db765-0x0;var _0x1345fe=_0x346c[_0x5db765];return _0x1345fe;};'use strict';var _=require(_0xc346('0x0'));var util=require(_0xc346('0x1'));var moment=require(_0xc346('0x2'));var BPromise=require(_0xc346('0x3'));var rs=require(_0xc346('0x4'));var fs=require('fs');var Redis=require(_0xc346('0x5'));var db=require(_0xc346('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc346('0x7'))('rpc');var config=require(_0xc346('0x8'));var jayson=require(_0xc346('0x9'));var client=jayson[_0xc346('0xa')][_0xc346('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39e786,_0x311a5c,_0x4aa755){return new BPromise(function(_0x21489d,_0x218d09){return client['request'](_0x39e786,_0x4aa755)[_0xc346('0xc')](function(_0x1fe168){logger[_0xc346('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x311a5c,_0xc346('0xe'));logger[_0xc346('0xf')](_0xc346('0x10'),_0x311a5c,'request\x20sent',JSON['stringify'](_0x1fe168));if(_0x1fe168['error']){if(_0x1fe168[_0xc346('0x11')][_0xc346('0x12')]===0x1f4){logger[_0xc346('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x311a5c,_0x1fe168[_0xc346('0x11')][_0xc346('0x13')]);return _0x218d09(_0x1fe168[_0xc346('0x11')][_0xc346('0x13')]);}logger[_0xc346('0x11')](_0xc346('0x14'),_0x311a5c,_0x1fe168[_0xc346('0x11')]['message']);return _0x21489d(_0x1fe168[_0xc346('0x11')][_0xc346('0x13')]);}else{logger[_0xc346('0xd')](_0xc346('0x14'),_0x311a5c,_0xc346('0xe'));_0x21489d(_0x1fe168[_0xc346('0x15')][_0xc346('0x13')]);}})['catch'](function(_0x1b893f){logger['error'](_0xc346('0x14'),_0x311a5c,_0x1b893f);_0x218d09(_0x1b893f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index efacced..a6199d4 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x82c0=['log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','status','None'];(function(_0x46012a,_0x28243a){var _0x373e1b=function(_0x53d861){while(--_0x53d861){_0x46012a['push'](_0x46012a['shift']());}};_0x373e1b(++_0x28243a);}(_0x82c0,0x96));var _0x082c=function(_0x19da96,_0x36ed99){_0x19da96=_0x19da96-0x0;var _0x82d0bd=_0x82c0[_0x19da96];return _0x82d0bd;};'use strict';var _=require(_0x082c('0x0'));var db=require(_0x082c('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x082c('0x2'));var rpc=require(_0x082c('0x3'));var config=require(_0x082c('0x4'));var logger=require(_0x082c('0x5'))(_0x082c('0x6'));var pm2=require(_0x082c('0x7'));var pm2Config=require(_0x082c('0x8'));var schedule=require(_0x082c('0x9'));var chat=require(_0x082c('0xa'));var whatsapp=require(_0x082c('0xb'));var transcribe=require(_0x082c('0xc'));function main(){return db['sequelize']['sync']()[_0x082c('0xd')](function(){if(config[_0x082c('0xe')]){return seedDb[_0x082c('0xf')]();}})[_0x082c('0xd')](function(){return checkLicense[_0x082c('0xf')]();})['then'](function(){return rpc[_0x082c('0x10')]();})[_0x082c('0xd')](function(_0x195d9b){logger[_0x082c('0x11')](_0x195d9b);return chat[_0x082c('0x12')]();})[_0x082c('0xd')](function(){return whatsapp[_0x082c('0x12')]();})[_0x082c('0xd')](function(){return schedule['start']();})[_0x082c('0xd')](function(){return transcribe[_0x082c('0x12')]();})[_0x082c('0xd')](function(_0x5e27b4){logger[_0x082c('0x11')](_0x5e27b4);return pm2['start'](pm2Config);})[_0x082c('0xd')](function(_0x16ef9e){var _0x144292=_0x16ef9e[_0x082c('0x13')](function(_0x128e2b){return typeof _0x128e2b[_0x082c('0x14')]===_0x082c('0x15')&&_0x128e2b[_0x082c('0x14')]>=0x0;});if(_0x144292['length']>0x0){throw new Error(_0x144292[_0x082c('0x16')]+_0x082c('0x17')+_[_0x082c('0x18')](_0x144292,function(_0xef8800){return'\x22'+_0xef8800[_0x082c('0x19')][_0x082c('0x1a')]+'\x22';}));}logger[_0x082c('0x11')]('Online\x20apps:',_[_0x082c('0x18')](_[_0x082c('0x13')](_0x16ef9e,{'status':_0x082c('0x1b')}),_0x082c('0x1a'))['join']());logger['info']('Offline\x20apps:',_[_0x082c('0x18')](_[_0x082c('0x13')](_0x16ef9e,function(_0x4ea9a4){return _0x4ea9a4[_0x082c('0x1c')]!==_0x082c('0x1b');}),_0x082c('0x1a'))['join']()||_0x082c('0x1d'));console[_0x082c('0x1e')](_0x082c('0x1f'));})[_0x082c('0x20')](function(_0x1b96a6){console[_0x082c('0x1e')](_0x082c('0x21'),_0x1b96a6);logger[_0x082c('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x1b96a6);process[_0x082c('0x23')](0x1);});}main(); \ No newline at end of file +var _0x621e=['length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','Online\x20apps:','online','name','join','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','default','listen','info','start','filter','exitCode','number'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x621e,0x1b0));var _0xe621=function(_0x2cbc3e,_0x1c37c2){_0x2cbc3e=_0x2cbc3e-0x0;var _0x26c081=_0x621e[_0x2cbc3e];return _0x26c081;};'use strict';var _=require(_0xe621('0x0'));var db=require(_0xe621('0x1'))['db'];var seedDb=require(_0xe621('0x2'));var checkLicense=require(_0xe621('0x3'));var rpc=require(_0xe621('0x4'));var config=require('./config/environment');var logger=require(_0xe621('0x5'))(_0xe621('0x6'));var pm2=require(_0xe621('0x7'));var pm2Config=require(_0xe621('0x8'));var schedule=require(_0xe621('0x9'));var chat=require(_0xe621('0xa'));var whatsapp=require(_0xe621('0xb'));var transcribe=require(_0xe621('0xc'));function main(){return db[_0xe621('0xd')][_0xe621('0xe')]()[_0xe621('0xf')](function(){if(config['seedDB']){return seedDb[_0xe621('0x10')]();}})['then'](function(){return checkLicense['default']();})[_0xe621('0xf')](function(){return rpc[_0xe621('0x11')]();})[_0xe621('0xf')](function(_0x2ef32a){logger[_0xe621('0x12')](_0x2ef32a);return chat[_0xe621('0x13')]();})[_0xe621('0xf')](function(){return whatsapp[_0xe621('0x13')]();})[_0xe621('0xf')](function(){return schedule[_0xe621('0x13')]();})[_0xe621('0xf')](function(){return transcribe['start']();})[_0xe621('0xf')](function(_0x3b55ba){logger[_0xe621('0x12')](_0x3b55ba);return pm2['start'](pm2Config);})['then'](function(_0x266dbb){var _0x4e6bb8=_0x266dbb[_0xe621('0x14')](function(_0x3a2077){return typeof _0x3a2077[_0xe621('0x15')]===_0xe621('0x16')&&_0x3a2077[_0xe621('0x15')]>=0x0;});if(_0x4e6bb8[_0xe621('0x17')]>0x0){throw new Error(_0x4e6bb8[_0xe621('0x17')]+_0xe621('0x18')+_['map'](_0x4e6bb8,function(_0x5afc04){return'\x22'+_0x5afc04[_0xe621('0x19')]['name']+'\x22';}));}logger[_0xe621('0x12')](_0xe621('0x1a'),_['map'](_[_0xe621('0x14')](_0x266dbb,{'status':_0xe621('0x1b')}),_0xe621('0x1c'))[_0xe621('0x1d')]());logger[_0xe621('0x12')]('Offline\x20apps:',_['map'](_[_0xe621('0x14')](_0x266dbb,function(_0x29fd40){return _0x29fd40['status']!==_0xe621('0x1b');}),_0xe621('0x1c'))[_0xe621('0x1d')]()||_0xe621('0x1e'));console[_0xe621('0x1f')]('App\x20Ready!');})['catch'](function(_0x3ad1ad){console['log'](_0xe621('0x20'),_0x3ad1ad);logger[_0xe621('0x21')](_0xe621('0x22'),_0x3ad1ad);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 91a1e8d..2e4dd9e 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 _0x5b46=['Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','decryptString','split','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','name','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','interface','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','use','headers','authorization','Basic','User','authenticate','pass','Wrong\x20credentials.','catch','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update'];(function(_0xf00579,_0x52840d){var _0x318821=function(_0x39ede5){while(--_0x39ede5){_0xf00579['push'](_0xf00579['shift']());}};_0x318821(++_0x52840d);}(_0x5b46,0x1b4));var _0x65b4=function(_0x1ad84d,_0x30d0f9){_0x1ad84d=_0x1ad84d-0x0;var _0x48f26b=_0x5b46[_0x1ad84d];return _0x48f26b;};'use strict';var db=require(_0x65b4('0x0'))['db'];var config=require(_0x65b4('0x1'));var hardwareConf=require(_0x65b4('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x65b4('0x3'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x65b4('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x65b4('0x5'));var crypto=require(_0x65b4('0x6'));var BPromise=require(_0x65b4('0x7'));var util=require(_0x65b4('0x8'));var moment=require(_0x65b4('0x9'));var validateJwt=expressJwt({'secret':config[_0x65b4('0xa')]['session']});var userAttributes=['id',_0x65b4('0xb'),_0x65b4('0xc'),_0x65b4('0xd'),'internal',_0x65b4('0xe'),_0x65b4('0xf'),_0x65b4('0x10'),'md5secret',_0x65b4('0x11'),'chatPause',_0x65b4('0x12'),_0x65b4('0x13'),_0x65b4('0x14'),_0x65b4('0x15'),_0x65b4('0x16'),_0x65b4('0x17'),_0x65b4('0x18'),_0x65b4('0x19'),_0x65b4('0x1a'),'allowmessenger',_0x65b4('0x1b'),'alias',_0x65b4('0x1c'),'phoneBarAutoAnswerDelay',_0x65b4('0x1d'),_0x65b4('0x1e'),_0x65b4('0x1f'),_0x65b4('0x20'),'phoneBarExpires',_0x65b4('0x21'),_0x65b4('0x22'),'phoneBarRemoteControlPort','hotdesk',_0x65b4('0x23'),'userProfileId',_0x65b4('0x24'),_0x65b4('0x25'),_0x65b4('0x26'),'downloadVoiceRecordings',_0x65b4('0x27'),_0x65b4('0x28'),_0x65b4('0x29'),_0x65b4('0x2a')];exports[_0x65b4('0x2b')]=function(){return this[_0x65b4('0x2c')](!![])['use'](function(_0x1061d6,_0x5a14d1,_0xae41c1){if(_0x1061d6[_0x65b4('0x2d')]){_0xae41c1();}else{return db[_0x65b4('0x2e')][_0x65b4('0x2f')]({'where':{'id':_0x1061d6[_0x65b4('0x30')]['id']},'attributes':['id',_0x65b4('0x31'),_0x65b4('0x32')],'raw':!![]})[_0x65b4('0x33')](function(_0x5d5d3b){if(_0x5d5d3b&&_0x5d5d3b[_0x65b4('0x31')]){return _0x5a14d1[_0x65b4('0x34')](_0x5d5d3b[_0x65b4('0x32')]===_0x65b4('0x35')?0x195:0x193)[_0x65b4('0x36')]({'message':_0x5d5d3b['disposition']===_0x65b4('0x35')?_0x65b4('0x37'):_0x65b4('0x38')});}else{_0xae41c1();}})['catch'](function(_0x2f2f3b){_0xae41c1(_0x2f2f3b);});}});};exports[_0x65b4('0x2c')]=function isAuthenticated(_0x56cf8a){return compose()[_0x65b4('0x39')](function(_0xb5c34e,_0x10d401,_0x2f75c3){var _0x320cf8;if(_0xb5c34e[_0x65b4('0x3a')][_0x65b4('0x3b')]){if(_['startsWith'](_0xb5c34e[_0x65b4('0x3a')]['authorization'],_0x65b4('0x3c'))){var _0x3fae1a=basicAuth(_0xb5c34e);db[_0x65b4('0x3d')]['find']({'where':{'name':_0x3fae1a[_0x65b4('0xd')]}})[_0x65b4('0x33')](function(_0x53be08){if(!_0x53be08||!_0x53be08[_0x65b4('0x3e')](_0x3fae1a[_0x65b4('0x3f')])){return _0x10d401['status'](0x191)[_0x65b4('0x36')]({'message':_0x65b4('0x40')});}_0xb5c34e[_0x65b4('0x2d')]={'id':_0x53be08['id']};_0x2f75c3();})[_0x65b4('0x41')](function(_0x4cf682){_0x2f75c3(_0x4cf682);});}else if(_[_0x65b4('0x42')](_0xb5c34e['headers'][_0x65b4('0x3b')],_0x65b4('0x43'))){validateJwt(_0xb5c34e,_0x10d401,_0x2f75c3);}else{if(_0x56cf8a){_0x2f75c3();}else{return _0x10d401[_0x65b4('0x34')](0x193)['json']({'message':_0x65b4('0x44')});}}}else if(_0xb5c34e[_0x65b4('0x45')][_0x65b4('0x46')]){try{var _0x40663b={'audience':hardwareConf[_0x65b4('0x47')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0xb5c34e[_0x65b4('0x45')]['apikey'],_0x40663b)[_0x65b4('0x33')](function(_0x220d01){return db[_0x65b4('0x3d')][_0x65b4('0x48')]({'where':{'id':_0x220d01[_0x65b4('0x49')]}})[_0x65b4('0x33')](function(_0x3cb11a){_0x320cf8=_0x3cb11a;return db[_0x65b4('0x4a')][_0x65b4('0x2f')]({'where':{'id':0x1},'attributes':[_0x65b4('0x4b'),_0x65b4('0x4c')],'raw':!![]});})[_0x65b4('0x33')](function(_0x576229){if(!_0x320cf8||!_['isEqual'](_0x320cf8[_0x65b4('0x4d')],_0x220d01[_0x65b4('0x4e')])){return _0x10d401[_0x65b4('0x34')](0x191)[_0x65b4('0x36')]({'message':_0x65b4('0x4f')});}if(_0x320cf8[_0x65b4('0x50')]){return _0x10d401[_0x65b4('0x34')](0x191)[_0x65b4('0x36')]({'message':_0x65b4('0x51')});}if(_0x320cf8[_0x65b4('0x52')]){if(_0x576229[_0x65b4('0x4c')]>0x0){if(moment(_0x320cf8['blockedAt'])[_0x65b4('0x53')](_0x576229['blockDuration'],_0x65b4('0x54'))>moment()){return _0x10d401['status'](0x191)[_0x65b4('0x36')]({'message':_0x65b4('0x51')});}}else{return _0x10d401[_0x65b4('0x34')](0x191)[_0x65b4('0x36')]({'message':'Invalid\x20API\x20access\x20key'});}}_0xb5c34e[_0x65b4('0x2d')]={'id':_0x320cf8['id']};_0x2f75c3();});})['catch'](function(){return _0x10d401[_0x65b4('0x34')](0x191)[_0x65b4('0x36')]({'message':_0x65b4('0x51')});});}catch(_0x1a97be){_0x2f75c3(_0x1a97be);}}else if(_0x56cf8a){_0x2f75c3();}else{return _0x10d401[_0x65b4('0x34')](0x193)['json']({'message':_0x65b4('0x44')});}})[_0x65b4('0x39')](function(_0x3153df,_0x50bd49,_0x971277){if(_0x3153df[_0x65b4('0x2d')]){db[_0x65b4('0x3d')]['find']({'where':{'id':_0x3153df['user']['id']},'attributes':userAttributes})[_0x65b4('0x33')](function(_0x4ee107){if(!_0x4ee107){return _0x50bd49[_0x65b4('0x34')](0x194)[_0x65b4('0x36')]({'message':_0x65b4('0x55')});}_0x3153df[_0x65b4('0x2d')]=_0x4ee107;_0x971277();})[_0x65b4('0x41')](function(_0x37b26e){_0x971277(_0x37b26e);});}else if(_0x56cf8a){_0x971277();}else{return _0x50bd49[_0x65b4('0x34')](0x194)[_0x65b4('0x36')]({'message':_0x65b4('0x56')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x455eef,_0x5d2242,_0x135a1b){return licenseUtil['getLicense']()[_0x65b4('0x33')](function(_0x1f313e){if(_0x1f313e[_0x65b4('0x57')]){_0x135a1b();}else{return _0x5d2242[_0x65b4('0x34')](0x193)['json']({'message':_0x65b4('0x58')});}})[_0x65b4('0x41')](function(_0x121816){_0x135a1b(_0x121816);});});};exports[_0x65b4('0x59')]=function isWebrtcLicence(){return compose()[_0x65b4('0x39')](function(_0xc1a482,_0x5bc2c7,_0x384756){return licenseUtil[_0x65b4('0x5a')]()['then'](function(_0x372588){if(_0x372588[_0x65b4('0x5b')]){_0x384756();}else{return _0x5bc2c7[_0x65b4('0x34')](0x193)['json']({'message':_0x65b4('0x58')});}})[_0x65b4('0x41')](function(_0x574195){_0x384756(_0x574195);});});};exports[_0x65b4('0x5c')]=function(_0x32a9e9,_0x58fe99,_0x96df72){_0x32a9e9[_0x65b4('0x5c')]=!![];return _0x96df72();};exports[_0x65b4('0x5d')]=function signToken(_0x58be14){return signJwt(_0x58be14);};exports[_0x65b4('0x5e')]=function(_0x3a29e5,_0x458fbb){if(!_0x3a29e5[_0x65b4('0x2d')]){return _0x458fbb[_0x65b4('0x34')](0x194)['json']({'message':_0x65b4('0x5f')});}var _0x5dba1e={'payload':{'id':_0x3a29e5[_0x65b4('0x2d')]['id'],'role':_0x3a29e5[_0x65b4('0x2d')][_0x65b4('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5dba1e)[_0x65b4('0x33')](function(_0x25caa6){_0x458fbb[_0x65b4('0x60')](_0x65b4('0x61'),_0x25caa6);_0x458fbb[_0x65b4('0x62')](_0x65b4('0x63'));})[_0x65b4('0x41')](function(_0x3a56d0){return _0x458fbb[_0x65b4('0x34')](0x1f4)[_0x65b4('0x64')](_0x3a56d0);});};exports[_0x65b4('0x65')]=function(_0x5a7090){if(_['isNil'](_0x5a7090[_0x65b4('0x4d')])||_[_0x65b4('0x66')](_0x5a7090[_0x65b4('0x67')])){return null;}else{return createJwt(_0x5a7090);}};exports['generateApiKey']=function(_0x2adb3c){_0x2adb3c[_0x65b4('0x4d')]=generateNonce();_0x2adb3c[_0x65b4('0x67')]=generateIssuedAt();return createJwt(_0x2adb3c);};exports[_0x65b4('0x68')]=function(_0x5d6a26,_0x20376f){var _0x5b39a3=_0x5d6a26[_0x65b4('0x45')]['apikey'];if(_0x5b39a3){var _0x3d0b50={'nonce':_0x20376f[_0x65b4('0x4d')],'iat':_0x20376f[_0x65b4('0x67')],'audience':hardwareConf[_0x65b4('0x47')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x5b39a3,_0x3d0b50)[_0x65b4('0x33')](function(){return generateApiKey(_0x20376f);});}else{throw{'message':_0x65b4('0x69')};}};exports['validatePasswordPattern']=function(_0x47c51b){var _0x5bb6a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5bb6a8[_0x65b4('0x6a')](_0x47c51b))throw new db[(_0x65b4('0x6b'))][(_0x65b4('0x6c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x3fe2c3,_0x30f878,_0x3c12c6){var _0x1de3ad=encryptor[_0x65b4('0x6d')](_0x30f878)[_0x65b4('0x6e')](',');for(var _0x1fdfdf=0x0;_0x1fdfdf<_0x3c12c6;_0x1fdfdf++){if(!_0x1de3ad[_0x1fdfdf])break;if(_0x3fe2c3['toLowerCase']()===_0x1de3ad[_0x1fdfdf]['toLowerCase']()){var _0x21726c=util[_0x65b4('0x6f')](_0x65b4('0x70'),_0x3c12c6);if(_0x3c12c6===0x1){_0x21726c=_0x65b4('0x71');}throw new db['Sequelize'][(_0x65b4('0x6c'))](_0x21726c);}}return;};exports[_0x65b4('0x72')]=function(_0x521338,_0x39b779){var _0x2e4b12=_0x39b779?encryptor[_0x65b4('0x6d')](_0x39b779)[_0x65b4('0x6e')](','):[];if(_0x2e4b12[_0x65b4('0x73')]===0x5){_0x2e4b12[_0x65b4('0x74')](-0x1,0x1);}_0x2e4b12[_0x65b4('0x75')](_0x521338);return encryptor[_0x65b4('0x76')](_0x2e4b12[_0x65b4('0x77')](','));};function signJwt(_0xd36ea1){var _0x1066a4=BPromise[_0x65b4('0x78')](jwt['sign'],{'context':jwt});var _0x19cb0f=_0xd36ea1[_0x65b4('0x79')]||config['secrets']['session'];return new BPromise(function(_0x135115,_0x4a6f60){_0x1066a4(_0xd36ea1[_0x65b4('0x7a')],_0x19cb0f,_0xd36ea1[_0x65b4('0x7b')])[_0x65b4('0x33')](function(_0xf21424){_0x135115(_0xf21424);})['catch'](function(_0x35f847){_0x4a6f60(_0x35f847);});});}function verifyJwt(_0x3e9c8e,_0x2e56f2,_0x148f67){var _0x11495b=BPromise[_0x65b4('0x78')](jwt[_0x65b4('0x7c')],{'context':jwt});var _0xa01b3c=_0x148f67||config['secrets']['session'];return new BPromise(function(_0x59dd3a,_0x1b1760){_0x11495b(_0x3e9c8e,_0xa01b3c,_0x2e56f2)[_0x65b4('0x33')](function(_0x1fc832){_0x59dd3a(_0x1fc832);})[_0x65b4('0x41')](function(_0x17bf80){_0x1b1760(_0x17bf80);});});}function generateNonce(){return crypto[_0x65b4('0x7d')](0x10)[_0x65b4('0x7e')](_0x65b4('0x7f'));}function generateIssuedAt(){return Math[_0x65b4('0x80')](Date[_0x65b4('0x81')]()/0x3e8)[_0x65b4('0x7e')]();}function createJwt(_0x43d051){var _0x51f49d={'payload':{'iat':_0x43d051[_0x65b4('0x67')],'nonce':_0x43d051[_0x65b4('0x4d')]},'options':{'algorithm':_0x65b4('0x82'),'subject':_0x43d051['id'][_0x65b4('0x7e')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x51f49d)[_0x65b4('0x33')](function(_0x2a339b){return{'iat':_0x43d051[_0x65b4('0x67')],'nonce':_0x43d051[_0x65b4('0x4d')],'token':_0x2a339b};});} \ No newline at end of file +var _0xde4b=['wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','catch','headers','authorization','Basic','authenticate','pass','status','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','getUuid','query','apikey','User','find','sub','allowedLoginAttempts','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','retrieveApiKey','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','now','HS512','../../mysqldb','../../config/environment','../encryptor','lodash','composable-middleware','crypto','bluebird','util','moment','secrets','session','role','fullname','name','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','showWebBar','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','settingsEnabled'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xde4b,0xd5));var _0xbde4=function(_0x2bcc1d,_0x101e28){_0x2bcc1d=_0x2bcc1d-0x0;var _0xa89608=_0xde4b[_0x2bcc1d];return _0xa89608;};'use strict';var db=require(_0xbde4('0x0'))['db'];var config=require(_0xbde4('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xbde4('0x2'));var _=require(_0xbde4('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0xbde4('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0xbde4('0x5'));var BPromise=require(_0xbde4('0x6'));var util=require(_0xbde4('0x7'));var moment=require(_0xbde4('0x8'));var validateJwt=expressJwt({'secret':config[_0xbde4('0x9')][_0xbde4('0xa')]});var userAttributes=['id',_0xbde4('0xb'),_0xbde4('0xc'),_0xbde4('0xd'),'internal','email',_0xbde4('0xe'),_0xbde4('0xf'),_0xbde4('0x10'),_0xbde4('0x11'),'chatPause',_0xbde4('0x12'),_0xbde4('0x13'),_0xbde4('0x14'),'openchannelPause','pauseType',_0xbde4('0x15'),'lastLoginAt','lastPauseAt',_0xbde4('0x16'),_0xbde4('0x17'),_0xbde4('0x18'),_0xbde4('0x19'),_0xbde4('0x1a'),'phoneBarAutoAnswerDelay',_0xbde4('0x1b'),_0xbde4('0x1c'),_0xbde4('0x1d'),_0xbde4('0x1e'),'phoneBarExpires','phoneBarPrefixRequired',_0xbde4('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0xbde4('0x20'),_0xbde4('0x21'),'privacyEnabled',_0xbde4('0x22'),_0xbde4('0x23'),_0xbde4('0x24'),_0xbde4('0x25'),'downloadAttachments',_0xbde4('0x26'),_0xbde4('0x27')];exports[_0xbde4('0x28')]=function(){return this[_0xbde4('0x29')](!![])[_0xbde4('0x2a')](function(_0x18d7f1,_0x2f3ece,_0x1ec0be){if(_0x18d7f1[_0xbde4('0x2b')]){_0x1ec0be();}else{return db['ChatInteraction'][_0xbde4('0x2c')]({'where':{'id':_0x18d7f1['params']['id']},'attributes':['id',_0xbde4('0x2d'),_0xbde4('0x2e')],'raw':!![]})[_0xbde4('0x2f')](function(_0x10e105){if(_0x10e105&&_0x10e105[_0xbde4('0x2d')]){return _0x2f3ece['status'](_0x10e105[_0xbde4('0x2e')]===_0xbde4('0x30')?0x195:0x193)[_0xbde4('0x31')]({'message':_0x10e105['disposition']===_0xbde4('0x30')?_0xbde4('0x32'):'Forbidden.'});}else{_0x1ec0be();}})[_0xbde4('0x33')](function(_0x3fa201){_0x1ec0be(_0x3fa201);});}});};exports[_0xbde4('0x29')]=function isAuthenticated(_0x366def){return compose()['use'](function(_0x465b68,_0x3d36b7,_0x369bee){var _0x475b52;if(_0x465b68[_0xbde4('0x34')][_0xbde4('0x35')]){if(_['startsWith'](_0x465b68[_0xbde4('0x34')]['authorization'],_0xbde4('0x36'))){var _0x168cf4=basicAuth(_0x465b68);db['User']['find']({'where':{'name':_0x168cf4[_0xbde4('0xd')]}})[_0xbde4('0x2f')](function(_0x23b997){if(!_0x23b997||!_0x23b997[_0xbde4('0x37')](_0x168cf4[_0xbde4('0x38')])){return _0x3d36b7[_0xbde4('0x39')](0x191)[_0xbde4('0x31')]({'message':_0xbde4('0x3a')});}_0x465b68[_0xbde4('0x2b')]={'id':_0x23b997['id']};_0x369bee();})['catch'](function(_0x7934e4){_0x369bee(_0x7934e4);});}else if(_[_0xbde4('0x3b')](_0x465b68['headers']['authorization'],_0xbde4('0x3c'))){validateJwt(_0x465b68,_0x3d36b7,_0x369bee);}else{if(_0x366def){_0x369bee();}else{return _0x3d36b7['status'](0x193)[_0xbde4('0x31')]({'message':_0xbde4('0x3d')});}}}else if(_0x465b68['query']['apikey']){try{var _0x5ad8f1={'audience':hardwareConf[_0xbde4('0x3e')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x465b68[_0xbde4('0x3f')][_0xbde4('0x40')],_0x5ad8f1)[_0xbde4('0x2f')](function(_0x5270f4){return db[_0xbde4('0x41')][_0xbde4('0x42')]({'where':{'id':_0x5270f4[_0xbde4('0x43')]}})[_0xbde4('0x2f')](function(_0x551db3){_0x475b52=_0x551db3;return db['Setting'][_0xbde4('0x2c')]({'where':{'id':0x1},'attributes':[_0xbde4('0x44'),'blockDuration'],'raw':!![]});})[_0xbde4('0x2f')](function(_0x221baf){if(!_0x475b52||!_[_0xbde4('0x45')](_0x475b52['apiKeyNonce'],_0x5270f4[_0xbde4('0x46')])){return _0x3d36b7[_0xbde4('0x39')](0x191)[_0xbde4('0x31')]({'message':_0xbde4('0x47')});}if(_0x475b52[_0xbde4('0x48')]){return _0x3d36b7['status'](0x191)['json']({'message':_0xbde4('0x49')});}if(_0x475b52[_0xbde4('0x4a')]){if(_0x221baf[_0xbde4('0x4b')]>0x0){if(moment(_0x475b52[_0xbde4('0x4c')])[_0xbde4('0x4d')](_0x221baf[_0xbde4('0x4b')],'minutes')>moment()){return _0x3d36b7['status'](0x191)[_0xbde4('0x31')]({'message':_0xbde4('0x49')});}}else{return _0x3d36b7['status'](0x191)[_0xbde4('0x31')]({'message':_0xbde4('0x49')});}}_0x465b68['user']={'id':_0x475b52['id']};_0x369bee();});})[_0xbde4('0x33')](function(){return _0x3d36b7['status'](0x191)[_0xbde4('0x31')]({'message':_0xbde4('0x49')});});}catch(_0x30d8bf){_0x369bee(_0x30d8bf);}}else if(_0x366def){_0x369bee();}else{return _0x3d36b7[_0xbde4('0x39')](0x193)[_0xbde4('0x31')]({'message':_0xbde4('0x3d')});}})['use'](function(_0x2ecdde,_0x29d1d5,_0xd12b09){if(_0x2ecdde['user']){db['User']['find']({'where':{'id':_0x2ecdde['user']['id']},'attributes':userAttributes})[_0xbde4('0x2f')](function(_0x28c354){if(!_0x28c354){return _0x29d1d5[_0xbde4('0x39')](0x194)[_0xbde4('0x31')]({'message':_0xbde4('0x4e')});}_0x2ecdde[_0xbde4('0x2b')]=_0x28c354;_0xd12b09();})[_0xbde4('0x33')](function(_0xbd5f1c){_0xd12b09(_0xbd5f1c);});}else if(_0x366def){_0xd12b09();}else{return _0x29d1d5['status'](0x194)[_0xbde4('0x31')]({'message':_0xbde4('0x4f')});}});};exports[_0xbde4('0x50')]=function canUpdate(){return compose()['use'](function(_0x39255c,_0x6f8a8a,_0x55e322){return licenseUtil['getLicense']()['then'](function(_0x2d0934){if(_0x2d0934[_0xbde4('0x51')]){_0x55e322();}else{return _0x6f8a8a[_0xbde4('0x39')](0x193)[_0xbde4('0x31')]({'message':'Forbidden'});}})[_0xbde4('0x33')](function(_0x3c4ce0){_0x55e322(_0x3c4ce0);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0xbde4('0x2a')](function(_0x1138d3,_0x19129a,_0x35dc83){return licenseUtil[_0xbde4('0x52')]()['then'](function(_0x1b580a){if(_0x1b580a[_0xbde4('0x53')]){_0x35dc83();}else{return _0x19129a[_0xbde4('0x39')](0x193)[_0xbde4('0x31')]({'message':'Forbidden'});}})[_0xbde4('0x33')](function(_0x31d4ee){_0x35dc83(_0x31d4ee);});});};exports['isMiddleware']=function(_0x579ed2,_0x44a95c,_0x416266){_0x579ed2[_0xbde4('0x54')]=!![];return _0x416266();};exports['signToken']=function signToken(_0x5f485a){return signJwt(_0x5f485a);};exports[_0xbde4('0x55')]=function(_0x5cd610,_0x189dfe){if(!_0x5cd610[_0xbde4('0x2b')]){return _0x189dfe[_0xbde4('0x39')](0x194)[_0xbde4('0x31')]({'message':_0xbde4('0x56')});}var _0x2253bc={'payload':{'id':_0x5cd610[_0xbde4('0x2b')]['id'],'role':_0x5cd610[_0xbde4('0x2b')][_0xbde4('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2253bc)[_0xbde4('0x2f')](function(_0xfe5ff5){_0x189dfe['cookie'](_0xbde4('0x57'),_0xfe5ff5);_0x189dfe[_0xbde4('0x58')](_0xbde4('0x59'));})[_0xbde4('0x33')](function(_0x4d4b8d){return _0x189dfe['status'](0x1f4)['send'](_0x4d4b8d);});};exports[_0xbde4('0x5a')]=function(_0x1adf5f){if(_['isNil'](_0x1adf5f[_0xbde4('0x5b')])||_['isNil'](_0x1adf5f[_0xbde4('0x5c')])){return null;}else{return createJwt(_0x1adf5f);}};exports[_0xbde4('0x5d')]=function(_0x56643d){_0x56643d['apiKeyNonce']=generateNonce();_0x56643d[_0xbde4('0x5c')]=generateIssuedAt();return createJwt(_0x56643d);};exports[_0xbde4('0x5e')]=function(_0x5c9dda,_0x5ac18e){var _0x1a07d2=_0x5c9dda[_0xbde4('0x3f')]['apikey'];if(_0x1a07d2){var _0x54020e={'nonce':_0x5ac18e['apiKeyNonce'],'iat':_0x5ac18e['apiKeyIat'],'audience':hardwareConf[_0xbde4('0x3e')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x1a07d2,_0x54020e)[_0xbde4('0x2f')](function(){return generateApiKey(_0x5ac18e);});}else{throw{'message':_0xbde4('0x5f')};}};exports[_0xbde4('0x60')]=function(_0x155a70){var _0x3bf7e7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3bf7e7[_0xbde4('0x61')](_0x155a70))throw new db[(_0xbde4('0x62'))][(_0xbde4('0x63'))](_0xbde4('0x64'));return;};exports[_0xbde4('0x65')]=function(_0x17fe18,_0x41ab47,_0x1e2e12){var _0x3c430e=encryptor[_0xbde4('0x66')](_0x41ab47)[_0xbde4('0x67')](',');for(var _0x4811df=0x0;_0x4811df<_0x1e2e12;_0x4811df++){if(!_0x3c430e[_0x4811df])break;if(_0x17fe18['toLowerCase']()===_0x3c430e[_0x4811df][_0xbde4('0x68')]()){var _0x1f1b61=util[_0xbde4('0x69')](_0xbde4('0x6a'),_0x1e2e12);if(_0x1e2e12===0x1){_0x1f1b61=_0xbde4('0x6b');}throw new db[(_0xbde4('0x62'))]['ValidationError'](_0x1f1b61);}}return;};exports[_0xbde4('0x6c')]=function(_0x2c06d0,_0x1f3c99){var _0x3ea836=_0x1f3c99?encryptor[_0xbde4('0x66')](_0x1f3c99)[_0xbde4('0x67')](','):[];if(_0x3ea836[_0xbde4('0x6d')]===0x5){_0x3ea836[_0xbde4('0x6e')](-0x1,0x1);}_0x3ea836[_0xbde4('0x6f')](_0x2c06d0);return encryptor[_0xbde4('0x70')](_0x3ea836['join'](','));};function signJwt(_0x1dddfc){var _0xa1384=BPromise[_0xbde4('0x71')](jwt[_0xbde4('0x72')],{'context':jwt});var _0x5e94ab=_0x1dddfc[_0xbde4('0x73')]||config[_0xbde4('0x9')][_0xbde4('0xa')];return new BPromise(function(_0x55b4a1,_0x58be27){_0xa1384(_0x1dddfc[_0xbde4('0x74')],_0x5e94ab,_0x1dddfc[_0xbde4('0x75')])[_0xbde4('0x2f')](function(_0x5197e1){_0x55b4a1(_0x5197e1);})[_0xbde4('0x33')](function(_0x2cf48c){_0x58be27(_0x2cf48c);});});}function verifyJwt(_0x42aa54,_0x3fd624,_0xb43a84){var _0xde74fd=BPromise[_0xbde4('0x71')](jwt[_0xbde4('0x76')],{'context':jwt});var _0x25e0b6=_0xb43a84||config[_0xbde4('0x9')][_0xbde4('0xa')];return new BPromise(function(_0x2c7ffe,_0x9de9f3){_0xde74fd(_0x42aa54,_0x25e0b6,_0x3fd624)['then'](function(_0xa8178f){_0x2c7ffe(_0xa8178f);})[_0xbde4('0x33')](function(_0x2724c6){_0x9de9f3(_0x2724c6);});});}function generateNonce(){return crypto[_0xbde4('0x77')](0x10)[_0xbde4('0x78')](_0xbde4('0x79'));}function generateIssuedAt(){return Math['floor'](Date[_0xbde4('0x7a')]()/0x3e8)[_0xbde4('0x78')]();}function createJwt(_0x2282fe){var _0x12e98d={'payload':{'iat':_0x2282fe[_0xbde4('0x5c')],'nonce':_0x2282fe[_0xbde4('0x5b')]},'options':{'algorithm':_0xbde4('0x7b'),'subject':_0x2282fe['id'][_0xbde4('0x78')](),'issuer':hardwareConf[_0xbde4('0x3e')](),'audience':hardwareConf[_0xbde4('0x3e')]()}};return signJwt(_0x12e98d)['then'](function(_0x1bceb3){return{'iat':_0x2282fe[_0xbde4('0x5c')],'nonce':_0x2282fe[_0xbde4('0x5b')],'token':_0x1bceb3};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 81e1dfd..ee959f6 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 _0xbe9e=['indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','createDecipher','encryptString','utf8','base64','decryptString','secret','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter'];(function(_0x205cf1,_0x4f82f5){var _0x31f695=function(_0x149fa0){while(--_0x149fa0){_0x205cf1['push'](_0x205cf1['shift']());}};_0x31f695(++_0x4f82f5);}(_0xbe9e,0x1e8));var _0xebe9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xbe9e[_0x465a0c];return _0x1e202e;};'use strict';var crypto=require(_0xebe9('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xebe9('0x1'));var config=require(_0xebe9('0x2'));var logger=require(_0xebe9('0x3'))(_0xebe9('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xebe9('0x5')][_0xebe9('0x6')],'algorithm':_0xebe9('0x7')};const fileOptions={'algorithm':_0xebe9('0x8')};if(config[_0xebe9('0x9')]&&config[_0xebe9('0x9')][_0xebe9('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xebe9('0xa')]);if(isSupported){fileOptions[_0xebe9('0xa')]=config[_0xebe9('0x9')][_0xebe9('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xebe9('0xb')](',\x20');logger[_0xebe9('0xc')](config['encrypt'][_0xebe9('0xa')],_0xebe9('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x31fbb2){return AES_SUPPORTED_RX['test'](_0x31fbb2);}function getSupportedCiphers(){return crypto[_0xebe9('0xe')]()[_0xebe9('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x50c0c1){return getSupportedCiphers()[_0xebe9('0x10')](_0x50c0c1)>-0x1;}function combineOptions(_0x39b0a0){var _0x5c43b1={};for(var _0x5b114a in fileOptions){if(fileOptions[_0xebe9('0x11')](_0x5b114a)){_0x5c43b1[_0x5b114a]=fileOptions[_0x5b114a];}}if(_0x39b0a0){for(var _0x18e01e in _0x39b0a0){if(_0x39b0a0[_0xebe9('0x11')](_0x18e01e)){_0x5c43b1[_0x18e01e]=_0x39b0a0[_0x18e01e];}}}return _0x5c43b1;}exports[_0xebe9('0x12')]=function(_0xbfc930,_0x4be271,_0x5ec938,_0x355d79){return new BPromise(function(_0x2ed229,_0x1c47b8){_0x355d79=combineOptions(_0x355d79);var _0x7e8606=new Buffer(_0x5ec938);var _0xc980bb=fs[_0xebe9('0x13')](_0xbfc930);var _0x4dece7=fs[_0xebe9('0x14')](_0x4be271);var _0x51a772=crypto[_0xebe9('0x15')](_0x355d79[_0xebe9('0xa')],_0x7e8606);_0xc980bb['on'](_0xebe9('0x16'),function(_0x39fdc2){var _0x37a0d5=new Buffer(_0x51a772[_0xebe9('0x17')](_0x39fdc2),_0xebe9('0x18'));_0x4dece7[_0xebe9('0x19')](_0x37a0d5);});_0xc980bb['on'](_0xebe9('0x1a'),function(){try{var _0x1754ff=new Buffer(_0x51a772[_0xebe9('0x1b')](_0xebe9('0x18')),'binary');_0x4dece7[_0xebe9('0x19')](_0x1754ff);_0x4dece7[_0xebe9('0x1a')]();_0x4dece7['on'](_0xebe9('0x1c'),function(){return _0x2ed229(_0x4be271);});}catch(_0x38f689){fs[_0xebe9('0x1d')](_0x4be271);return _0x1c47b8(_0x38f689);}});});};exports['decryptFile']=function(_0x2e9e83,_0x44326b,_0x5cae2e,_0x44a507){return new BPromise(function(_0x5bef60,_0x1b020a){_0x44a507=combineOptions(_0x44a507);var _0x4bb09c=new Buffer(_0x5cae2e);var _0x35c3e2=fs[_0xebe9('0x13')](_0x2e9e83);var _0x465455=fs[_0xebe9('0x14')](_0x44326b);var _0xc23b12=crypto[_0xebe9('0x1e')](_0x44a507['algorithm'],_0x4bb09c);_0x35c3e2['on'](_0xebe9('0x16'),function(_0x2a9653){var _0x4d1388=new Buffer(_0xc23b12[_0xebe9('0x17')](_0x2a9653),_0xebe9('0x18'));_0x465455[_0xebe9('0x19')](_0x4d1388);});_0x35c3e2['on']('end',function(){try{var _0x403efe=new Buffer(_0xc23b12['final']('binary'),_0xebe9('0x18'));_0x465455[_0xebe9('0x19')](_0x403efe);_0x465455[_0xebe9('0x1a')]();_0x465455['on'](_0xebe9('0x1c'),function(){return _0x5bef60(_0x44326b);});}catch(_0x51f5a4){fs['unlink'](_0x44326b);return _0x1b020a(_0x51f5a4);}});});};exports[_0xebe9('0x1f')]=function(_0x106904,_0x272724,_0x4b6cb5){var _0x3fae1a=_0x4b6cb5||stringOptions[_0xebe9('0xa')];var _0x18ef95=_0x272724||stringOptions['secret'];var _0x354098=crypto[_0xebe9('0x15')](_0x3fae1a,_0x18ef95);var _0x4c8b1a=_0x354098['update'](_0x106904,_0xebe9('0x20'),_0xebe9('0x21'));_0x4c8b1a+=_0x354098[_0xebe9('0x1b')](_0xebe9('0x21'));return _0x4c8b1a;};exports[_0xebe9('0x22')]=function(_0x3e380a,_0x1560bd,_0x5312cd){var _0x450c25=_0x5312cd||stringOptions[_0xebe9('0xa')];var _0x183d19=_0x1560bd||stringOptions[_0xebe9('0x23')];var _0x4b76c7=crypto[_0xebe9('0x1e')](_0x450c25,_0x183d19);var _0x3145cf=_0x4b76c7[_0xebe9('0x17')](_0x3e380a,_0xebe9('0x21'),_0xebe9('0x20'));_0x3145cf+=_0x4b76c7[_0xebe9('0x1b')]('utf8');return _0x3145cf;}; \ No newline at end of file +var _0x58c6=['write','final','end','unlink','createDecipher','close','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary'];(function(_0x33fb2a,_0x4758c0){var _0x58b621=function(_0x445c61){while(--_0x445c61){_0x33fb2a['push'](_0x33fb2a['shift']());}};_0x58b621(++_0x4758c0);}(_0x58c6,0x93));var _0x658c=function(_0x5bd6da,_0x3f7ac8){_0x5bd6da=_0x5bd6da-0x0;var _0x5e6b8=_0x58c6[_0x5bd6da];return _0x5e6b8;};'use strict';var crypto=require(_0x658c('0x0'));var fs=require('fs');var BPromise=require(_0x658c('0x1'));var _=require(_0x658c('0x2'));var config=require('../../config/environment');var logger=require(_0x658c('0x3'))(_0x658c('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x658c('0x5')][_0x658c('0x6')],'algorithm':_0x658c('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x658c('0x8')]&&config[_0x658c('0x8')][_0x658c('0x9')]){var isSupported=isAlgorithmSupported(config[_0x658c('0x8')][_0x658c('0x9')]);if(isSupported){fileOptions[_0x658c('0x9')]=config[_0x658c('0x8')][_0x658c('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x658c('0xa')](',\x20');logger[_0x658c('0xb')](config['encrypt']['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x5d3732){return AES_SUPPORTED_RX[_0x658c('0xc')](_0x5d3732);}function getSupportedCiphers(){return crypto[_0x658c('0xd')]()[_0x658c('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x4d302e){return getSupportedCiphers()[_0x658c('0xf')](_0x4d302e)>-0x1;}function combineOptions(_0x1c2cc1){var _0xabcad7={};for(var _0x49369e in fileOptions){if(fileOptions['hasOwnProperty'](_0x49369e)){_0xabcad7[_0x49369e]=fileOptions[_0x49369e];}}if(_0x1c2cc1){for(var _0x297110 in _0x1c2cc1){if(_0x1c2cc1[_0x658c('0x10')](_0x297110)){_0xabcad7[_0x297110]=_0x1c2cc1[_0x297110];}}}return _0xabcad7;}exports['encryptFile']=function(_0x3ae653,_0x1a5f5b,_0x48ab44,_0x4a505c){return new BPromise(function(_0x142a71,_0x3ee7c9){_0x4a505c=combineOptions(_0x4a505c);var _0x153f87=new Buffer(_0x48ab44);var _0x3d7bf3=fs[_0x658c('0x11')](_0x3ae653);var _0x5dea25=fs[_0x658c('0x12')](_0x1a5f5b);var _0x80ec2f=crypto[_0x658c('0x13')](_0x4a505c[_0x658c('0x9')],_0x153f87);_0x3d7bf3['on'](_0x658c('0x14'),function(_0x270ba6){var _0x4d42c3=new Buffer(_0x80ec2f[_0x658c('0x15')](_0x270ba6),_0x658c('0x16'));_0x5dea25[_0x658c('0x17')](_0x4d42c3);});_0x3d7bf3['on']('end',function(){try{var _0x102865=new Buffer(_0x80ec2f[_0x658c('0x18')](_0x658c('0x16')),_0x658c('0x16'));_0x5dea25[_0x658c('0x17')](_0x102865);_0x5dea25[_0x658c('0x19')]();_0x5dea25['on']('close',function(){return _0x142a71(_0x1a5f5b);});}catch(_0x3e4acb){fs[_0x658c('0x1a')](_0x1a5f5b);return _0x3ee7c9(_0x3e4acb);}});});};exports['decryptFile']=function(_0x364cba,_0x2e6071,_0x170bd4,_0x178361){return new BPromise(function(_0x5e6c10,_0x14b56c){_0x178361=combineOptions(_0x178361);var _0x1027c4=new Buffer(_0x170bd4);var _0x5cf2c4=fs[_0x658c('0x11')](_0x364cba);var _0x4bf862=fs[_0x658c('0x12')](_0x2e6071);var _0x5393b9=crypto[_0x658c('0x1b')](_0x178361[_0x658c('0x9')],_0x1027c4);_0x5cf2c4['on'](_0x658c('0x14'),function(_0x34549a){var _0x2ca84d=new Buffer(_0x5393b9[_0x658c('0x15')](_0x34549a),_0x658c('0x16'));_0x4bf862[_0x658c('0x17')](_0x2ca84d);});_0x5cf2c4['on']('end',function(){try{var _0xc75c35=new Buffer(_0x5393b9[_0x658c('0x18')]('binary'),_0x658c('0x16'));_0x4bf862['write'](_0xc75c35);_0x4bf862['end']();_0x4bf862['on'](_0x658c('0x1c'),function(){return _0x5e6c10(_0x2e6071);});}catch(_0x1e7d36){fs[_0x658c('0x1a')](_0x2e6071);return _0x14b56c(_0x1e7d36);}});});};exports[_0x658c('0x1d')]=function(_0x497542,_0x2afe15,_0x16c56e){var _0x183b46=_0x16c56e||stringOptions[_0x658c('0x9')];var _0x4ad5e7=_0x2afe15||stringOptions[_0x658c('0x1e')];var _0x4deb3e=crypto[_0x658c('0x13')](_0x183b46,_0x4ad5e7);var _0x402f99=_0x4deb3e[_0x658c('0x15')](_0x497542,_0x658c('0x1f'),_0x658c('0x20'));_0x402f99+=_0x4deb3e[_0x658c('0x18')]('base64');return _0x402f99;};exports[_0x658c('0x21')]=function(_0x25d333,_0x905fa7,_0x299710){var _0x4de8d3=_0x299710||stringOptions[_0x658c('0x9')];var _0x20fda6=_0x905fa7||stringOptions[_0x658c('0x1e')];var _0x479333=crypto[_0x658c('0x1b')](_0x4de8d3,_0x20fda6);var _0x1de9f4=_0x479333[_0x658c('0x15')](_0x25d333,_0x658c('0x20'),_0x658c('0x1f'));_0x1de9f4+=_0x479333[_0x658c('0x18')](_0x658c('0x1f'));return _0x1de9f4;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index b800059..b1f325b 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 _0xf84c=['split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.csv','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find'];(function(_0x3d7a2a,_0x30db71){var _0x2b1057=function(_0x4beeca){while(--_0x4beeca){_0x3d7a2a['push'](_0x3d7a2a['shift']());}};_0x2b1057(++_0x30db71);}(_0xf84c,0x1ba));var _0xcf84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf84c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xcf84('0x0'));var path=require(_0xcf84('0x1'));var _=require('lodash');var csv=require(_0xcf84('0x2'));var fs=require('fs');var BPromise=require(_0xcf84('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xcf84('0x4'))['db'];var dbH=require(_0xcf84('0x4'))[_0xcf84('0x5')];var logger=require(_0xcf84('0x6'))(_0xcf84('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xcf84('0x8')][0x2]);var QUERY=process[_0xcf84('0x8')][0x3];var PATH=process[_0xcf84('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x149af0,_0xbf63db){var _0x1d3bbc={'status':_0x149af0};var _0x29616b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xbf63db){_0x1d3bbc[_0xcf84('0x9')]=_0xbf63db;}return db[_0xcf84('0xa')][_0xcf84('0xb')](_0x1d3bbc,_0x29616b);}function main(){var _0x35bbba=0x1388;var _0x1c9ca0;logger['info'](util[_0xcf84('0xc')](_0xcf84('0xd'),EXTRACTED_REPORT_ID,_0xcf84('0xe')));return db[_0xcf84('0xf')][_0xcf84('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcf84('0x11'),_0xcf84('0x12')]})['then'](function(_0x4946c7){if(_0x4946c7){_0x1c9ca0=_0x4946c7;_0x35bbba=_0x1c9ca0[_0xcf84('0x12')]||0x1388;}})[_0xcf84('0x13')](function(){return dbH[_0xcf84('0x14')][_0xcf84('0x15')](util[_0xcf84('0xc')](_0xcf84('0x16'),QUERY),{'type':dbH[_0xcf84('0x14')]['QueryTypes'][_0xcf84('0x17')]});})[_0xcf84('0x13')](function(_0x2fc18c){if(!_0x2fc18c[0x0][_0xcf84('0x18')]){return analyticExtractedReport(_0xcf84('0x19'));}var _0x8a936c=[];var _0x5d2995=0x0;if(_0x1c9ca0[_0xcf84('0x11')]){if(_0x2fc18c&&_0x2fc18c[_0xcf84('0x1a')]){var _0x4dcaca=_[_0xcf84('0x1b')](_0x2fc18c[0x0][_0xcf84('0x18')]/_0x35bbba);var _0x29896b=Number[_0xcf84('0x1c')](_0x2fc18c[0x0][_0xcf84('0x18')]/_0x35bbba)?_0x2fc18c[0x0]['num']%_0x35bbba:0x0;_0x4dcaca[_0xcf84('0x1d')](function(_0x2f32cc){if(_0x2f32cc>0x0){_0x5d2995+=_0x35bbba;}_0x8a936c[_0xcf84('0x1e')](dbH[_0xcf84('0x14')]['query'](util[_0xcf84('0xc')](_0xcf84('0x1f'),QUERY,_0x35bbba,_0x5d2995),{'type':dbH[_0xcf84('0x14')]['QueryTypes'][_0xcf84('0x17')]}));});if(_0x29896b>0x0){_0x5d2995+=_0x35bbba;_0x8a936c[_0xcf84('0x1e')](dbH[_0xcf84('0x14')][_0xcf84('0x15')](util[_0xcf84('0xc')](_0xcf84('0x1f'),QUERY,_0x29896b,_0x5d2995),{'type':dbH[_0xcf84('0x14')]['QueryTypes'][_0xcf84('0x17')]}));}}}else{_0x8a936c[_0xcf84('0x1e')](dbH[_0xcf84('0x14')][_0xcf84('0x15')](QUERY,{'type':dbH[_0xcf84('0x14')][_0xcf84('0x20')]['SELECT']}));}var _0x3d9037=path[_0xcf84('0x21')](PATH);var _0x1fd1c5=path['basename'](PATH,_0xcf84('0x22'));var _0x2a37a7=_0x1c9ca0[_0xcf84('0x11')]&&_0x8a936c[_0xcf84('0x1a')]>0x1;var _0x1992c9=[];if(!fs[_0xcf84('0x23')](path['join'](_0x3d9037,_0x1fd1c5))&&_0x2a37a7){fs['mkdirSync'](path[_0xcf84('0x24')](_0x3d9037,_0x1fd1c5));}return BPromise['each'](_0x8a936c,function(_0x980a47){_0x1992c9[_0xcf84('0x1e')](_0x980a47);})['then'](function(){for(var _0x53829e=0x0;_0x53829e<_0x1992c9[_0xcf84('0x1a')];_0x53829e+=0x1){var _0x4f99e6;var _0x55454c=_0x1992c9[_0x53829e];if(_0x2a37a7){_0x4f99e6=path['join'](_0x3d9037,_0x1fd1c5,util[_0xcf84('0xc')](_0xcf84('0x25'),_0x1fd1c5,_0x53829e,_0xcf84('0x26')));}else{_0x4f99e6=path[_0xcf84('0x24')](_0x3d9037,util['format'](_0xcf84('0x27'),_0x1fd1c5,_0xcf84('0x26')));}fs[_0xcf84('0x28')](_0x4f99e6,csv(_0x55454c));}})[_0xcf84('0x13')](function(){if(_0x2a37a7){return new Promise(function(_0x27020e){zipdir(path[_0xcf84('0x24')](_0x3d9037,_0x1fd1c5),{'saveTo':path[_0xcf84('0x24')](_0x3d9037,util[_0xcf84('0xc')](_0xcf84('0x27'),_0x1fd1c5,_0xcf84('0x29')))},function(_0x2820d4,_0x29c7d2){rimraf(path[_0xcf84('0x24')](_0x3d9037,_0x1fd1c5),function(){});_0x27020e(_0xcf84('0x2a'));});});}})[_0xcf84('0x13')](function(){logger[_0xcf84('0x2b')](util[_0xcf84('0xc')](_0xcf84('0x2c'),EXTRACTED_REPORT_ID,_0xcf84('0xe')));return analyticExtractedReport(_0xcf84('0x2d'),_0x2a37a7?util[_0xcf84('0xc')]('%s.%s',_0x1fd1c5,_0x2a37a7?_0xcf84('0x29'):_0xcf84('0x26')):null);});})[_0xcf84('0x2e')](function(_0x4180e0){logger[_0xcf84('0x2b')](util[_0xcf84('0xc')](_0xcf84('0x2f'),EXTRACTED_REPORT_ID,_0xcf84('0xe')),util['inspect'](_0x4180e0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcf84('0x30'));})[_0xcf84('0x31')](function(){process[_0xcf84('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd2d5=['zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','forEach','sequelize','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','csv','%s.%s','writeFileSync'];(function(_0x5440ad,_0x5000fa){var _0x45a91a=function(_0x1608d9){while(--_0x1608d9){_0x5440ad['push'](_0x5440ad['shift']());}};_0x45a91a(++_0x5000fa);}(_0xd2d5,0x104));var _0x5d2d=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0xd2d5[_0x319cb9];return _0x1735fc;};'use strict';var util=require(_0x5d2d('0x0'));var path=require(_0x5d2d('0x1'));var _=require(_0x5d2d('0x2'));var csv=require(_0x5d2d('0x3'));var fs=require('fs');var BPromise=require(_0x5d2d('0x4'));var zipdir=require(_0x5d2d('0x5'));var rimraf=require('rimraf');var db=require(_0x5d2d('0x6'))['db'];var dbH=require(_0x5d2d('0x6'))[_0x5d2d('0x7')];var logger=require(_0x5d2d('0x8'))(_0x5d2d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x5d2d('0xa')][0x2]);var QUERY=process[_0x5d2d('0xa')][0x3];var PATH=process[_0x5d2d('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x29d789,_0x41836e){var _0x342ca5={'status':_0x29d789};var _0xe97fb8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x41836e){_0x342ca5[_0x5d2d('0xb')]=_0x41836e;}return db['AnalyticExtractedReport']['update'](_0x342ca5,_0xe97fb8);}function main(){var _0x2c6ea8=0x1388;var _0xe6a58f;logger['info'](util[_0x5d2d('0xc')](_0x5d2d('0xd'),EXTRACTED_REPORT_ID,_0x5d2d('0xe')));return db[_0x5d2d('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5d2d('0x10'),_0x5d2d('0x11')]})[_0x5d2d('0x12')](function(_0xcc4440){if(_0xcc4440){_0xe6a58f=_0xcc4440;_0x2c6ea8=_0xe6a58f['splitSizeCsv']||0x1388;}})[_0x5d2d('0x12')](function(){return dbH['sequelize'][_0x5d2d('0x13')](util[_0x5d2d('0xc')](_0x5d2d('0x14'),QUERY),{'type':dbH['sequelize'][_0x5d2d('0x15')][_0x5d2d('0x16')]});})[_0x5d2d('0x12')](function(_0x4757f2){if(!_0x4757f2[0x0][_0x5d2d('0x17')]){return analyticExtractedReport(_0x5d2d('0x18'));}var _0x53f48c=[];var _0xf97999=0x0;if(_0xe6a58f[_0x5d2d('0x10')]){if(_0x4757f2&&_0x4757f2['length']){var _0x1adf32=_[_0x5d2d('0x19')](_0x4757f2[0x0][_0x5d2d('0x17')]/_0x2c6ea8);var _0x3f3ada=Number['isInteger'](_0x4757f2[0x0][_0x5d2d('0x17')]/_0x2c6ea8)?_0x4757f2[0x0]['num']%_0x2c6ea8:0x0;_0x1adf32[_0x5d2d('0x1a')](function(_0x196caa){if(_0x196caa>0x0){_0xf97999+=_0x2c6ea8;}_0x53f48c['push'](dbH[_0x5d2d('0x1b')][_0x5d2d('0x13')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2c6ea8,_0xf97999),{'type':dbH[_0x5d2d('0x1b')][_0x5d2d('0x15')]['SELECT']}));});if(_0x3f3ada>0x0){_0xf97999+=_0x2c6ea8;_0x53f48c[_0x5d2d('0x1c')](dbH['sequelize'][_0x5d2d('0x13')](util['format'](_0x5d2d('0x1d'),QUERY,_0x3f3ada,_0xf97999),{'type':dbH[_0x5d2d('0x1b')]['QueryTypes']['SELECT']}));}}}else{_0x53f48c[_0x5d2d('0x1c')](dbH['sequelize'][_0x5d2d('0x13')](QUERY,{'type':dbH[_0x5d2d('0x1b')][_0x5d2d('0x15')][_0x5d2d('0x16')]}));}var _0x43d8c9=path[_0x5d2d('0x1e')](PATH);var _0x87e25a=path[_0x5d2d('0x1f')](PATH,_0x5d2d('0x20'));var _0x37cdf3=_0xe6a58f['split']&&_0x53f48c[_0x5d2d('0x21')]>0x1;var _0x533738=[];if(!fs[_0x5d2d('0x22')](path[_0x5d2d('0x23')](_0x43d8c9,_0x87e25a))&&_0x37cdf3){fs[_0x5d2d('0x24')](path[_0x5d2d('0x23')](_0x43d8c9,_0x87e25a));}return BPromise['each'](_0x53f48c,function(_0x533fec){_0x533738['push'](_0x533fec);})[_0x5d2d('0x12')](function(){for(var _0x48decb=0x0;_0x48decb<_0x533738[_0x5d2d('0x21')];_0x48decb+=0x1){var _0x2e8fe9;var _0xdfec17=_0x533738[_0x48decb];if(_0x37cdf3){_0x2e8fe9=path[_0x5d2d('0x23')](_0x43d8c9,_0x87e25a,util[_0x5d2d('0xc')]('%s%d.%s',_0x87e25a,_0x48decb,_0x5d2d('0x25')));}else{_0x2e8fe9=path[_0x5d2d('0x23')](_0x43d8c9,util[_0x5d2d('0xc')](_0x5d2d('0x26'),_0x87e25a,_0x5d2d('0x25')));}fs[_0x5d2d('0x27')](_0x2e8fe9,csv(_0xdfec17));}})[_0x5d2d('0x12')](function(){if(_0x37cdf3){return new Promise(function(_0x442644){zipdir(path[_0x5d2d('0x23')](_0x43d8c9,_0x87e25a),{'saveTo':path[_0x5d2d('0x23')](_0x43d8c9,util[_0x5d2d('0xc')]('%s.%s',_0x87e25a,_0x5d2d('0x28')))},function(_0x2f4a2d,_0x29e376){rimraf(path[_0x5d2d('0x23')](_0x43d8c9,_0x87e25a),function(){});_0x442644(_0x5d2d('0x29'));});});}})[_0x5d2d('0x12')](function(){logger['info'](util[_0x5d2d('0xc')](_0x5d2d('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x5d2d('0x2b'),_0x37cdf3?util[_0x5d2d('0xc')](_0x5d2d('0x26'),_0x87e25a,_0x37cdf3?_0x5d2d('0x28'):_0x5d2d('0x25')):null);});})[_0x5d2d('0x2c')](function(_0x26b659){logger[_0x5d2d('0x2d')](util[_0x5d2d('0xc')](_0x5d2d('0x2e'),EXTRACTED_REPORT_ID,_0x5d2d('0xe')),util[_0x5d2d('0x2f')](_0x26b659,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5d2d('0x30'));})[_0x5d2d('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index dcd8526..cbd2e67 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 _0xdb15=['YYYY-MM-DD','center','Interaction\x20Transcript','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','catch','lodash','util','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','auto','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','join','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0xdb15,0x12c));var _0x5db1=function(_0x51e36c,_0x2b1c3f){_0x51e36c=_0x51e36c-0x0;var _0x139ce8=_0xdb15[_0x51e36c];return _0x139ce8;};'use strict';var _=require(_0x5db1('0x0'));var fs=require('fs');var util=require(_0x5db1('0x1'));var path=require('path');var moment=require(_0x5db1('0x2'));var htmlToPdfmake=require(_0x5db1('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x5db1('0x4'));var rimraf=require(_0x5db1('0x5'));var JSDOM=require(_0x5db1('0x6'))[_0x5db1('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x5db1('0x8'));var db=require(_0x5db1('0x9'))['db'];var dbH=require(_0x5db1('0x9'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5db1('0xa')][0x3];var PATH=process[_0x5db1('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x5db1('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x553958,_0x1cfc25){var _0x44e762={'status':_0x553958};var _0x58879f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1cfc25){_0x44e762[_0x5db1('0xc')]=_0x1cfc25;}return db[_0x5db1('0xd')][_0x5db1('0xe')](_0x44e762,_0x58879f);}function getHeaders(_0x13f01d){return _[_0x5db1('0xf')](_0x13f01d,function(_0x53e57e){return{'text':_0x53e57e,'style':_0x5db1('0x10')};});}function getRows(_0x31f24d,_0x110754){return _[_0x5db1('0xf')](_0x110754,function(_0x23e0af){return _(_0x23e0af)['pick'](_0x31f24d)[_0x5db1('0xf')](function(_0x2bd2d6){return _0x2bd2d6?_[_0x5db1('0x11')](_0x2bd2d6):'';})[_0x5db1('0x12')]();});}function createTable(_0x52d411,_0xf3e8a6){var _0x2935cc={'widths':_[_0x5db1('0x13')](Array(_0x52d411[_0x5db1('0x14')]),0x91),'heights':function(_0x30e3e0){return _0x30e3e0===0x0?_0x5db1('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2d2fc7=getHeaders(_0x52d411);_0x2935cc[_0x5db1('0x16')][_0x5db1('0x17')](_0x2d2fc7);var _0x157d2e=getRows(_0x52d411,_0xf3e8a6);_0x2935cc[_0x5db1('0x16')]=_0x2935cc[_0x5db1('0x16')][_0x5db1('0x18')](_0x157d2e);return _0x2935cc;}function createTables(_0x1f219b){var _0x22ef00=[];var _0x34a03f=_[_0x5db1('0x19')](Object['keys'](_0x1f219b[0x0]),0x5);_0x34a03f[_0x5db1('0x1a')](function(_0x3c89f7){_0x22ef00[_0x5db1('0x17')](createTable(_0x3c89f7,_0x1f219b));});return _0x22ef00;}function getPDFDocDefinition(_0x177a90){var _0x5abb75=util[_0x5db1('0x1b')](_0x5db1('0x1c'),NAME,EXTRACTED_REPORT[_0x5db1('0x1d')],moment(EXTRACTED_REPORT[_0x5db1('0x1e')])[_0x5db1('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x5db1('0x1f')])['format'](FORMAT));var _0x25a1e0=[];for(var _0x544b99=0x0;_0x544b99<_0x177a90['length'];_0x544b99++){var _0x408278=[];if(_0x544b99===0x0){_0x408278[_0x5db1('0x17')]({'text':_0x5abb75,'style':'header'});}var _0x2e63d0={'table':_0x177a90[_0x544b99]};if(_0x544b99>0x0){_0x2e63d0[_0x5db1('0x20')]=_0x5db1('0x21');_0x2e63d0[_0x5db1('0x22')]=[0x0,0x46,0x0,0x0];}_0x408278['push'](_0x2e63d0);_0x25a1e0[_0x5db1('0x17')](_0x408278);}return{'pageSize':'A4','pageOrientation':_0x5db1('0x23'),'content':_0x25a1e0,'footer':function(_0x144c1c,_0x12e699){return{'text':_0x144c1c[_0x5db1('0x11')]()+_0x5db1('0x24')+_0x12e699,'style':_0x5db1('0x25')};},'defaultStyle':{'font':_0x5db1('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x5db1('0x27')},'footer':{'alignment':_0x5db1('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4a7050){var _0x5c96fb=0x1388;var _0x46508f;if(!_0x4a7050[0x0][_0x5db1('0x29')]){return analyticExtractedReport(_0x5db1('0x2a'));}return db[_0x5db1('0x2b')][_0x5db1('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5db1('0x2d'),'splitSizePdf']})['then'](function(_0x2f3958){if(_0x2f3958){_0x46508f=_0x2f3958;_0x5c96fb=_0x46508f['splitSizePdf']||0x3e8;}})[_0x5db1('0x2e')](function(){var _0x3263d0=[];var _0x53c16e=0x0;if(_0x46508f['split']){if(_0x4a7050&&_0x4a7050[_0x5db1('0x14')]){var _0x5aa229=_[_0x5db1('0x2f')](_0x4a7050[0x0][_0x5db1('0x29')]/_0x5c96fb);var _0x25f776=Number[_0x5db1('0x30')](_0x4a7050[0x0][_0x5db1('0x29')]/_0x5c96fb)?_0x4a7050[0x0][_0x5db1('0x29')]%_0x5c96fb:0x0;_0x5aa229['forEach'](function(_0x2f9758){if(_0x2f9758>0x0){_0x53c16e+=_0x5c96fb;}_0x3263d0['push'](dbH[_0x5db1('0x31')][_0x5db1('0x32')](util[_0x5db1('0x1b')](_0x5db1('0x33'),QUERY,_0x5c96fb,_0x53c16e),{'type':dbH[_0x5db1('0x31')][_0x5db1('0x34')][_0x5db1('0x35')]}));});if(_0x25f776>0x0){_0x53c16e+=_0x5c96fb;_0x3263d0[_0x5db1('0x17')](dbH[_0x5db1('0x31')][_0x5db1('0x32')](util[_0x5db1('0x1b')](_0x5db1('0x33'),QUERY,_0x25f776,_0x53c16e),{'type':dbH[_0x5db1('0x31')]['QueryTypes']['SELECT']}));}}}else{_0x3263d0[_0x5db1('0x17')](dbH[_0x5db1('0x31')][_0x5db1('0x32')](QUERY,{'type':dbH[_0x5db1('0x31')]['QueryTypes'][_0x5db1('0x35')]}));}var _0x584d5c=path[_0x5db1('0x36')](PATH);var _0x16590e=path[_0x5db1('0x37')](PATH,_0x5db1('0x38'));var _0x25102a=_0x46508f[_0x5db1('0x2d')]&&_0x3263d0[_0x5db1('0x14')]>0x1;var _0x103e39=[];if(!fs[_0x5db1('0x39')](path['join'](_0x584d5c,_0x16590e))&&_0x25102a){fs[_0x5db1('0x3a')](path['join'](_0x584d5c,_0x16590e));}return BPromise['each'](_0x3263d0,function(_0x47b6ce){_0x103e39[_0x5db1('0x17')](_0x47b6ce);})['then'](function(){var _0x650ba5=[];for(var _0x3508ea=0x0;_0x3508ea<_0x103e39[_0x5db1('0x14')];_0x3508ea+=0x1){var _0x56e21e=_0x103e39[_0x3508ea];var _0x2078fe=createTables(_[_0x5db1('0x3b')](_0x56e21e));var _0x2943c8;var _0x443d0a=getPDFDocDefinition(_0x2078fe);var _0x258645=getPDFPrinter();var _0x2a313b=_0x258645[_0x5db1('0x3c')](_0x443d0a);if(_0x25102a){_0x2943c8=path['join'](_0x584d5c,_0x16590e,util[_0x5db1('0x1b')](_0x5db1('0x3d'),_0x16590e,_0x3508ea,_0x5db1('0x3e')));}else{_0x2943c8=path[_0x5db1('0x3f')](_0x584d5c,util['format'](_0x5db1('0x40'),_0x16590e,'pdf'));}_0x650ba5[_0x5db1('0x17')](writePDFDocument(_0x2a313b,_0x2943c8));}return Promise[_0x5db1('0x41')](_0x650ba5);})[_0x5db1('0x2e')](function(){if(_0x25102a){return new Promise(function(_0x327a72){zipdir(path[_0x5db1('0x3f')](_0x584d5c,_0x16590e),{'saveTo':path['join'](_0x584d5c,util['format']('%s.%s',_0x16590e,_0x5db1('0x42')))},function(){rimraf(path['join'](_0x584d5c,_0x16590e),function(){});_0x327a72(_0x5db1('0x43'));});});}})[_0x5db1('0x2e')](function(){if(!_0x25102a)return;rimraf(path[_0x5db1('0x3f')](_0x584d5c,_0x16590e),function(){});})[_0x5db1('0x2e')](function(){logger[_0x5db1('0x44')](util[_0x5db1('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5db1('0x45')));return analyticExtractedReport(_0x5db1('0x46'),_0x25102a?util[_0x5db1('0x1b')](_0x5db1('0x40'),_0x16590e,_0x25102a?_0x5db1('0x42'):_0x5db1('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x5db1('0x44')](util['format'](_0x5db1('0x47'),EXTRACTED_REPORT_ID,_0x5db1('0x45')));return db[_0x5db1('0xd')][_0x5db1('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x10a09f){EXTRACTED_REPORT=_0x10a09f;return dbH[_0x5db1('0x31')]['query'](util['format'](_0x5db1('0x49'),QUERY),{'type':dbH[_0x5db1('0x31')]['QueryTypes'][_0x5db1('0x35')]});})[_0x5db1('0x2e')](extractReport)['catch'](function(_0x7ca2c6){logger[_0x5db1('0x44')](util['format'](_0x5db1('0x4a'),EXTRACTED_REPORT_ID,_0x5db1('0x45')),util[_0x5db1('0x4b')](_0x7ca2c6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x5db1('0x4c')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5979ae=new PdfPrinter({'Arial':{'normal':__dirname+_0x5db1('0x4d'),'bold':__dirname+_0x5db1('0x4e'),'italics':__dirname+_0x5db1('0x4f'),'bolditalics':__dirname+_0x5db1('0x50')}});return _0x5979ae;}function getPDFDocDefinitionFromHTML(_0x338057,_0x6b7d87){var _0x358e4c=util[_0x5db1('0x1b')](_0x5db1('0x51'),_0x6b7d87[_0x5db1('0x52')],_0x6b7d87[_0x5db1('0x53')]);var _0xe0a8df=moment()[_0x5db1('0x1b')](_0x5db1('0x54'))[_0x5db1('0x11')]();var _0x65b6c3=htmlToPdfmake(_0x338057,{'window':window,'tableAutoSize':!![]});return{'content':[_0x65b6c3],'defaultStyle':{'font':_0x5db1('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x5db1('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5db1('0x55')}},'header':function(){return[{'text':_0x5db1('0x56'),'style':_0x5db1('0x57')}];},'footer':function(_0xc6d525,_0x2a3ea7){return[{'text':util[_0x5db1('0x1b')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x358e4c,_0xc6d525,_0x2a3ea7,_0xe0a8df),'style':_0x5db1('0x25')}];}};}function writePDFDocument(_0x2b795a,_0x5c6591){return new Promise(function(_0x4ac3cf,_0x4c4779){var _0x244d98=_0x2b795a[_0x5db1('0x58')](fs[_0x5db1('0x59')](_0x5c6591));_0x244d98['on'](_0x5db1('0x5a'),function(){_0x4ac3cf(_0x5db1('0x5a'));});_0x244d98['on'](_0x5db1('0x5b'),function(_0x53c8ab){_0x4c4779(_0x53c8ab);});_0x2b795a[_0x5db1('0x5c')]();});}exports[_0x5db1('0x5d')]=function(_0x2ba3ab,_0x576753){var _0x530cfd=getPDFPrinter();var _0x3693b3=getPDFDocDefinitionFromHTML(_0x2ba3ab,_0x576753);var _0x4af82e=_0x530cfd[_0x5db1('0x3c')](_0x3693b3);return writePDFDocument(_0x4af82e,_0x576753[_0x5db1('0x5e')])[_0x5db1('0x5f')](function(_0x57b0bf){throw _0x57b0bf;});}; \ No newline at end of file +var _0x51d6=['dirname','basename','.pdf','existsSync','join','each','flatten','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','PDF','Completed','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','pipe','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','path','moment','zip-dir','rimraf','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','pick','value','fill','length','auto','push','body','concat','chunk','keys','forEach','format','name','startDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x51d6,0xd3));var _0x651d=function(_0x4abc53,_0x2c45cc){_0x4abc53=_0x4abc53-0x0;var _0x50ce83=_0x51d6[_0x4abc53];return _0x50ce83;};'use strict';var _=require(_0x651d('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x651d('0x1'));var moment=require(_0x651d('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x651d('0x3'));var rimraf=require(_0x651d('0x4'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0x651d('0x5')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x651d('0x6'))[_0x651d('0x7')];var logger=require(_0x651d('0x8'))(_0x651d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x651d('0xa')][0x2]);var QUERY=process[_0x651d('0xa')][0x3];var PATH=process[_0x651d('0xa')][0x4];var NAME=process[_0x651d('0xa')][0x5];var FORMAT=_0x651d('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x326e21,_0x1fdfc4){var _0x218dd0={'status':_0x326e21};var _0x5d8677={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1fdfc4){_0x218dd0[_0x651d('0xc')]=_0x1fdfc4;}return db[_0x651d('0xd')]['update'](_0x218dd0,_0x5d8677);}function getHeaders(_0x1c5329){return _[_0x651d('0xe')](_0x1c5329,function(_0x12715d){return{'text':_0x12715d,'style':'tableHeader'};});}function getRows(_0x244956,_0x58a29f){return _[_0x651d('0xe')](_0x58a29f,function(_0x1274b1){return _(_0x1274b1)[_0x651d('0xf')](_0x244956)['map'](function(_0x5e9b1a){return _0x5e9b1a?_['toString'](_0x5e9b1a):'';})[_0x651d('0x10')]();});}function createTable(_0x2bd869,_0x34e974){var _0x1b5760={'widths':_[_0x651d('0x11')](Array(_0x2bd869[_0x651d('0x12')]),0x91),'heights':function(_0x18db71){return _0x18db71===0x0?_0x651d('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x463b4e=getHeaders(_0x2bd869);_0x1b5760['body'][_0x651d('0x14')](_0x463b4e);var _0x70c708=getRows(_0x2bd869,_0x34e974);_0x1b5760['body']=_0x1b5760[_0x651d('0x15')][_0x651d('0x16')](_0x70c708);return _0x1b5760;}function createTables(_0x5cd7b4){var _0x1dc9cc=[];var _0x40d474=_[_0x651d('0x17')](Object[_0x651d('0x18')](_0x5cd7b4[0x0]),0x5);_0x40d474[_0x651d('0x19')](function(_0x5e43bd){_0x1dc9cc[_0x651d('0x14')](createTable(_0x5e43bd,_0x5cd7b4));});return _0x1dc9cc;}function getPDFDocDefinition(_0x1f4de5){var _0x2fc477=util[_0x651d('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x651d('0x1b')],moment(EXTRACTED_REPORT[_0x651d('0x1c')])[_0x651d('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x651d('0x1a')](FORMAT));var _0x477e4c=[];for(var _0x2a6264=0x0;_0x2a6264<_0x1f4de5[_0x651d('0x12')];_0x2a6264++){var _0x2712ee=[];if(_0x2a6264===0x0){_0x2712ee['push']({'text':_0x2fc477,'style':_0x651d('0x1d')});}var _0x1736b8={'table':_0x1f4de5[_0x2a6264]};if(_0x2a6264>0x0){_0x1736b8[_0x651d('0x1e')]=_0x651d('0x1f');_0x1736b8[_0x651d('0x20')]=[0x0,0x46,0x0,0x0];}_0x2712ee['push'](_0x1736b8);_0x477e4c['push'](_0x2712ee);}return{'pageSize':'A4','pageOrientation':_0x651d('0x21'),'content':_0x477e4c,'footer':function(_0x27f4a8,_0x1b93a0){return{'text':_0x27f4a8[_0x651d('0x22')]()+_0x651d('0x23')+_0x1b93a0,'style':_0x651d('0x24')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x651d('0x25')},'footer':{'alignment':_0x651d('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5bf5bc){var _0x6fea58=0x1388;var _0x5a69cb;if(!_0x5bf5bc[0x0][_0x651d('0x27')]){return analyticExtractedReport(_0x651d('0x28'));}return db[_0x651d('0x29')][_0x651d('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x651d('0x2b'),_0x651d('0x2c')]})[_0x651d('0x2d')](function(_0x3c70ad){if(_0x3c70ad){_0x5a69cb=_0x3c70ad;_0x6fea58=_0x5a69cb[_0x651d('0x2c')]||0x3e8;}})['then'](function(){var _0x2ab2b9=[];var _0x1abd73=0x0;if(_0x5a69cb[_0x651d('0x2b')]){if(_0x5bf5bc&&_0x5bf5bc[_0x651d('0x12')]){var _0x5e5aa8=_[_0x651d('0x2e')](_0x5bf5bc[0x0]['num']/_0x6fea58);var _0x50a3eb=Number[_0x651d('0x2f')](_0x5bf5bc[0x0]['num']/_0x6fea58)?_0x5bf5bc[0x0][_0x651d('0x27')]%_0x6fea58:0x0;_0x5e5aa8['forEach'](function(_0x171232){if(_0x171232>0x0){_0x1abd73+=_0x6fea58;}_0x2ab2b9['push'](dbH['sequelize'][_0x651d('0x30')](util[_0x651d('0x1a')](_0x651d('0x31'),QUERY,_0x6fea58,_0x1abd73),{'type':dbH[_0x651d('0x32')][_0x651d('0x33')][_0x651d('0x34')]}));});if(_0x50a3eb>0x0){_0x1abd73+=_0x6fea58;_0x2ab2b9[_0x651d('0x14')](dbH[_0x651d('0x32')][_0x651d('0x30')](util[_0x651d('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x50a3eb,_0x1abd73),{'type':dbH[_0x651d('0x32')][_0x651d('0x33')][_0x651d('0x34')]}));}}}else{_0x2ab2b9['push'](dbH[_0x651d('0x32')][_0x651d('0x30')](QUERY,{'type':dbH[_0x651d('0x32')]['QueryTypes']['SELECT']}));}var _0x5a06fc=path[_0x651d('0x35')](PATH);var _0x9407=path[_0x651d('0x36')](PATH,_0x651d('0x37'));var _0x5937bd=_0x5a69cb[_0x651d('0x2b')]&&_0x2ab2b9[_0x651d('0x12')]>0x1;var _0x1f3465=[];if(!fs[_0x651d('0x38')](path[_0x651d('0x39')](_0x5a06fc,_0x9407))&&_0x5937bd){fs['mkdirSync'](path['join'](_0x5a06fc,_0x9407));}return BPromise[_0x651d('0x3a')](_0x2ab2b9,function(_0x17d173){_0x1f3465[_0x651d('0x14')](_0x17d173);})[_0x651d('0x2d')](function(){var _0x69fc2f=[];for(var _0x4a2c6e=0x0;_0x4a2c6e<_0x1f3465[_0x651d('0x12')];_0x4a2c6e+=0x1){var _0x44ea33=_0x1f3465[_0x4a2c6e];var _0x365657=createTables(_[_0x651d('0x3b')](_0x44ea33));var _0x3e67d0;var _0xd3b37b=getPDFDocDefinition(_0x365657);var _0x1f1331=getPDFPrinter();var _0x45661b=_0x1f1331['createPdfKitDocument'](_0xd3b37b);if(_0x5937bd){_0x3e67d0=path[_0x651d('0x39')](_0x5a06fc,_0x9407,util[_0x651d('0x1a')](_0x651d('0x3c'),_0x9407,_0x4a2c6e,_0x651d('0x3d')));}else{_0x3e67d0=path[_0x651d('0x39')](_0x5a06fc,util['format'](_0x651d('0x3e'),_0x9407,_0x651d('0x3d')));}_0x69fc2f[_0x651d('0x14')](writePDFDocument(_0x45661b,_0x3e67d0));}return Promise['all'](_0x69fc2f);})[_0x651d('0x2d')](function(){if(_0x5937bd){return new Promise(function(_0x481b2f){zipdir(path[_0x651d('0x39')](_0x5a06fc,_0x9407),{'saveTo':path['join'](_0x5a06fc,util[_0x651d('0x1a')](_0x651d('0x3e'),_0x9407,_0x651d('0x3f')))},function(){rimraf(path['join'](_0x5a06fc,_0x9407),function(){});_0x481b2f(_0x651d('0x40'));});});}})[_0x651d('0x2d')](function(){if(!_0x5937bd)return;rimraf(path['join'](_0x5a06fc,_0x9407),function(){});})[_0x651d('0x2d')](function(){logger[_0x651d('0x41')](util[_0x651d('0x1a')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x651d('0x42')));return analyticExtractedReport(_0x651d('0x43'),_0x5937bd?util[_0x651d('0x1a')]('%s.%s',_0x9407,_0x5937bd?_0x651d('0x3f'):_0x651d('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x651d('0x41')](util[_0x651d('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x651d('0xd')][_0x651d('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x651d('0x2d')](function(_0x3019f6){EXTRACTED_REPORT=_0x3019f6;return dbH[_0x651d('0x32')][_0x651d('0x30')](util[_0x651d('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x651d('0x32')][_0x651d('0x33')]['SELECT']});})[_0x651d('0x2d')](extractReport)[_0x651d('0x45')](function(_0x3a6f85){logger[_0x651d('0x41')](util['format'](_0x651d('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0x651d('0x47')](_0x3a6f85,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x651d('0x48'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5bd3d2=new PdfPrinter({'Arial':{'normal':__dirname+_0x651d('0x49'),'bold':__dirname+_0x651d('0x4a'),'italics':__dirname+_0x651d('0x4b'),'bolditalics':__dirname+_0x651d('0x4c')}});return _0x5bd3d2;}function getPDFDocDefinitionFromHTML(_0x22ea9c,_0x2c1ea1){var _0x2960a6=util[_0x651d('0x1a')](_0x651d('0x4d'),_0x2c1ea1[_0x651d('0x4e')],_0x2c1ea1['interactionId']);var _0x2dd4fa=moment()[_0x651d('0x1a')]('YYYY-MM-DD')[_0x651d('0x22')]();var _0x532040=htmlToPdfmake(_0x22ea9c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x532040],'defaultStyle':{'font':_0x651d('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x651d('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x651d('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x651d('0x50')}},'header':function(){return[{'text':_0x651d('0x51'),'style':_0x651d('0x1d')}];},'footer':function(_0x37f734,_0x54f93b){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2960a6,_0x37f734,_0x54f93b,_0x2dd4fa),'style':_0x651d('0x24')}];}};}function writePDFDocument(_0x5d022f,_0x30c149){return new Promise(function(_0x666b41,_0x5f27a5){var _0x58b4f3=_0x5d022f[_0x651d('0x52')](fs['createWriteStream'](_0x30c149));_0x58b4f3['on']('finish',function(){_0x666b41(_0x651d('0x53'));});_0x58b4f3['on'](_0x651d('0x54'),function(_0x4ee030){_0x5f27a5(_0x4ee030);});_0x5d022f[_0x651d('0x55')]();});}exports[_0x651d('0x56')]=function(_0x18cd14,_0xaea38a){var _0x116fe6=getPDFPrinter();var _0x56921a=getPDFDocDefinitionFromHTML(_0x18cd14,_0xaea38a);var _0x225d48=_0x116fe6[_0x651d('0x57')](_0x56921a);return writePDFDocument(_0x225d48,_0xaea38a[_0x651d('0x1')])[_0x651d('0x45')](function(_0x56952a){throw _0x56952a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 2dee822..d89b6dc 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 _0xbb58=['query','format','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','writeFileSync','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize'];(function(_0x45ca66,_0x47f5d2){var _0x329bdc=function(_0x48225c){while(--_0x48225c){_0x45ca66['push'](_0x45ca66['shift']());}};_0x329bdc(++_0x47f5d2);}(_0xbb58,0x17b));var _0x8bb5=function(_0x155663,_0x12af42){_0x155663=_0x155663-0x0;var _0x3bfbe8=_0xbb58[_0x155663];return _0x3bfbe8;};'use strict';var util=require('util');var path=require(_0x8bb5('0x0'));var _=require(_0x8bb5('0x1'));var fs=require('fs');var json2xls=require(_0x8bb5('0x2'));var BPromise=require(_0x8bb5('0x3'));var zipdir=require(_0x8bb5('0x4'));var rimraf=require('rimraf');var db=require(_0x8bb5('0x5'))['db'];var dbH=require(_0x8bb5('0x5'))[_0x8bb5('0x6')];var logger=require(_0x8bb5('0x7'))(_0x8bb5('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x8bb5('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x26bb0a,_0x535ef0){var _0x3a73df={'status':_0x26bb0a};var _0x2100ca={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x535ef0){_0x3a73df[_0x8bb5('0xa')]=_0x535ef0;}return db[_0x8bb5('0xb')][_0x8bb5('0xc')](_0x3a73df,_0x2100ca);}function main(){var _0x558e5a=0x1388;var _0x46cf73;logger[_0x8bb5('0xd')](util['format'](_0x8bb5('0xe'),EXTRACTED_REPORT_ID,_0x8bb5('0xf')));return db[_0x8bb5('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8bb5('0x11'),_0x8bb5('0x12')]})['then'](function(_0x35d9db){if(_0x35d9db){_0x46cf73=_0x35d9db;_0x558e5a=_0x46cf73[_0x8bb5('0x12')]||0x1388;}})[_0x8bb5('0x13')](function(){return dbH[_0x8bb5('0x14')][_0x8bb5('0x15')](util[_0x8bb5('0x16')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x8bb5('0x17')][_0x8bb5('0x18')]});})['then'](function(_0x19a5aa){if(!_0x19a5aa[0x0][_0x8bb5('0x19')]){return analyticExtractedReport(_0x8bb5('0x1a'));}var _0x3960fd=[];var _0x2fb420=0x0;if(_0x46cf73['split']){if(_0x19a5aa&&_0x19a5aa[_0x8bb5('0x1b')]){var _0x472d30=_[_0x8bb5('0x1c')](_0x19a5aa[0x0][_0x8bb5('0x19')]/_0x558e5a);var _0x429682=Number['isInteger'](_0x19a5aa[0x0][_0x8bb5('0x19')]/_0x558e5a)?_0x19a5aa[0x0][_0x8bb5('0x19')]%_0x558e5a:0x0;_0x472d30[_0x8bb5('0x1d')](function(_0x33ce5a){if(_0x33ce5a>0x0){_0x2fb420+=_0x558e5a;}_0x3960fd[_0x8bb5('0x1e')](dbH['sequelize'][_0x8bb5('0x15')](util[_0x8bb5('0x16')](_0x8bb5('0x1f'),QUERY,_0x558e5a,_0x2fb420),{'type':dbH[_0x8bb5('0x14')][_0x8bb5('0x17')][_0x8bb5('0x18')]}));});if(_0x429682>0x0){_0x2fb420+=_0x558e5a;_0x3960fd['push'](dbH['sequelize']['query'](util[_0x8bb5('0x16')](_0x8bb5('0x1f'),QUERY,_0x429682,_0x2fb420),{'type':dbH['sequelize']['QueryTypes'][_0x8bb5('0x18')]}));}}}else{_0x3960fd[_0x8bb5('0x1e')](dbH['sequelize'][_0x8bb5('0x15')](QUERY,{'type':dbH[_0x8bb5('0x14')]['QueryTypes'][_0x8bb5('0x18')]}));}var _0x3c5f01=path[_0x8bb5('0x20')](PATH);var _0x1583d9=path[_0x8bb5('0x21')](PATH,_0x8bb5('0x22'));var _0x4c514e=_0x46cf73[_0x8bb5('0x11')]&&_0x3960fd[_0x8bb5('0x1b')]>0x1;var _0x53bb4e=[];if(!fs[_0x8bb5('0x23')](path[_0x8bb5('0x24')](_0x3c5f01,_0x1583d9))&&_0x4c514e){fs['mkdirSync'](path[_0x8bb5('0x24')](_0x3c5f01,_0x1583d9));}return BPromise[_0x8bb5('0x25')](_0x3960fd,function(_0x35106a){_0x53bb4e[_0x8bb5('0x1e')](_0x35106a);})[_0x8bb5('0x13')](function(){for(var _0x33115a=0x0;_0x33115a<_0x53bb4e[_0x8bb5('0x1b')];_0x33115a+=0x1){var _0x179f27;var _0x4be499=_0x53bb4e[_0x33115a];if(_0x4c514e){_0x179f27=path[_0x8bb5('0x24')](_0x3c5f01,_0x1583d9,util['format'](_0x8bb5('0x26'),_0x1583d9,_0x33115a,_0x8bb5('0x27')));}else{_0x179f27=path[_0x8bb5('0x24')](_0x3c5f01,util[_0x8bb5('0x16')]('%s.%s',_0x1583d9,'xlsx'));}fs[_0x8bb5('0x28')](_0x179f27,json2xls(_0x4be499),'binary');}})[_0x8bb5('0x13')](function(){if(_0x4c514e){return new Promise(function(_0x501d24){zipdir(path['join'](_0x3c5f01,_0x1583d9),{'saveTo':path[_0x8bb5('0x24')](_0x3c5f01,util[_0x8bb5('0x16')](_0x8bb5('0x29'),_0x1583d9,'zip'))},function(_0x175526,_0x5b19da){rimraf(path['join'](_0x3c5f01,_0x1583d9),function(){});_0x501d24(_0x8bb5('0x2a'));});});}})[_0x8bb5('0x13')](function(){logger[_0x8bb5('0xd')](util[_0x8bb5('0x16')](_0x8bb5('0x2b'),EXTRACTED_REPORT_ID,_0x8bb5('0xf')));return analyticExtractedReport(_0x8bb5('0x2c'),_0x4c514e?util[_0x8bb5('0x16')]('%s.%s',_0x1583d9,_0x4c514e?_0x8bb5('0x2d'):_0x8bb5('0x27')):null);});})['catch'](function(_0xda25d8){logger[_0x8bb5('0xd')](util['format'](_0x8bb5('0x2e'),EXTRACTED_REPORT_ID,_0x8bb5('0xf')),util[_0x8bb5('0x2f')](_0xda25d8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8bb5('0x30'));})[_0x8bb5('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4cb1=['zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','lodash','json2xls','bluebird','zip-dir','rimraf','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x4cb1,0x167));var _0x14cb=function(_0x1aa839,_0x5ca4ec){_0x1aa839=_0x1aa839-0x0;var _0xd32e7e=_0x4cb1[_0x1aa839];return _0xd32e7e;};'use strict';var util=require('util');var path=require('path');var _=require(_0x14cb('0x0'));var fs=require('fs');var json2xls=require(_0x14cb('0x1'));var BPromise=require(_0x14cb('0x2'));var zipdir=require(_0x14cb('0x3'));var rimraf=require(_0x14cb('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x14cb('0x5'))(_0x14cb('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x14cb('0x7')][0x2]);var QUERY=process[_0x14cb('0x7')][0x3];var PATH=process[_0x14cb('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b7caf,_0x9ed853){var _0x1fd724={'status':_0x2b7caf};var _0x3b1d4d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x9ed853){_0x1fd724[_0x14cb('0x8')]=_0x9ed853;}return db[_0x14cb('0x9')]['update'](_0x1fd724,_0x3b1d4d);}function main(){var _0x421cf5=0x1388;var _0x478a89;logger['info'](util[_0x14cb('0xa')](_0x14cb('0xb'),EXTRACTED_REPORT_ID,_0x14cb('0xc')));return db[_0x14cb('0xd')][_0x14cb('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x14cb('0xf'),_0x14cb('0x10')]})['then'](function(_0x434fe3){if(_0x434fe3){_0x478a89=_0x434fe3;_0x421cf5=_0x478a89[_0x14cb('0x10')]||0x1388;}})[_0x14cb('0x11')](function(){return dbH[_0x14cb('0x12')][_0x14cb('0x13')](util[_0x14cb('0xa')](_0x14cb('0x14'),QUERY),{'type':dbH[_0x14cb('0x12')]['QueryTypes'][_0x14cb('0x15')]});})[_0x14cb('0x11')](function(_0x3012fb){if(!_0x3012fb[0x0][_0x14cb('0x16')]){return analyticExtractedReport(_0x14cb('0x17'));}var _0x33804a=[];var _0x324646=0x0;if(_0x478a89[_0x14cb('0xf')]){if(_0x3012fb&&_0x3012fb[_0x14cb('0x18')]){var _0x538f93=_[_0x14cb('0x19')](_0x3012fb[0x0][_0x14cb('0x16')]/_0x421cf5);var _0x36e6a0=Number['isInteger'](_0x3012fb[0x0][_0x14cb('0x16')]/_0x421cf5)?_0x3012fb[0x0][_0x14cb('0x16')]%_0x421cf5:0x0;_0x538f93[_0x14cb('0x1a')](function(_0x55365c){if(_0x55365c>0x0){_0x324646+=_0x421cf5;}_0x33804a[_0x14cb('0x1b')](dbH[_0x14cb('0x12')]['query'](util[_0x14cb('0xa')](_0x14cb('0x1c'),QUERY,_0x421cf5,_0x324646),{'type':dbH['sequelize'][_0x14cb('0x1d')][_0x14cb('0x15')]}));});if(_0x36e6a0>0x0){_0x324646+=_0x421cf5;_0x33804a['push'](dbH[_0x14cb('0x12')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x36e6a0,_0x324646),{'type':dbH['sequelize']['QueryTypes'][_0x14cb('0x15')]}));}}}else{_0x33804a[_0x14cb('0x1b')](dbH[_0x14cb('0x12')]['query'](QUERY,{'type':dbH[_0x14cb('0x12')][_0x14cb('0x1d')]['SELECT']}));}var _0x5833d2=path['dirname'](PATH);var _0x41fcd5=path[_0x14cb('0x1e')](PATH,_0x14cb('0x1f'));var _0x16cbd2=_0x478a89[_0x14cb('0xf')]&&_0x33804a['length']>0x1;var _0x4cf32e=[];if(!fs[_0x14cb('0x20')](path[_0x14cb('0x21')](_0x5833d2,_0x41fcd5))&&_0x16cbd2){fs[_0x14cb('0x22')](path['join'](_0x5833d2,_0x41fcd5));}return BPromise[_0x14cb('0x23')](_0x33804a,function(_0x33a785){_0x4cf32e['push'](_0x33a785);})[_0x14cb('0x11')](function(){for(var _0x1a1d10=0x0;_0x1a1d10<_0x4cf32e[_0x14cb('0x18')];_0x1a1d10+=0x1){var _0x57d98e;var _0x501c70=_0x4cf32e[_0x1a1d10];if(_0x16cbd2){_0x57d98e=path[_0x14cb('0x21')](_0x5833d2,_0x41fcd5,util[_0x14cb('0xa')](_0x14cb('0x24'),_0x41fcd5,_0x1a1d10,_0x14cb('0x25')));}else{_0x57d98e=path[_0x14cb('0x21')](_0x5833d2,util['format'](_0x14cb('0x26'),_0x41fcd5,'xlsx'));}fs['writeFileSync'](_0x57d98e,json2xls(_0x501c70),_0x14cb('0x27'));}})['then'](function(){if(_0x16cbd2){return new Promise(function(_0x2ff58a){zipdir(path['join'](_0x5833d2,_0x41fcd5),{'saveTo':path[_0x14cb('0x21')](_0x5833d2,util[_0x14cb('0xa')](_0x14cb('0x26'),_0x41fcd5,_0x14cb('0x28')))},function(_0x42cebc,_0x2a05ea){rimraf(path['join'](_0x5833d2,_0x41fcd5),function(){});_0x2ff58a(_0x14cb('0x29'));});});}})[_0x14cb('0x11')](function(){logger[_0x14cb('0x2a')](util[_0x14cb('0xa')](_0x14cb('0x2b'),EXTRACTED_REPORT_ID,_0x14cb('0xc')));return analyticExtractedReport(_0x14cb('0x2c'),_0x16cbd2?util[_0x14cb('0xa')](_0x14cb('0x26'),_0x41fcd5,_0x16cbd2?_0x14cb('0x28'):_0x14cb('0x25')):null);});})[_0x14cb('0x2d')](function(_0x494f49){logger['info'](util[_0x14cb('0xa')](_0x14cb('0x2e'),EXTRACTED_REPORT_ID,_0x14cb('0xc')),util[_0x14cb('0x2f')](_0x494f49,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x14cb('0x30')](function(){process[_0x14cb('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 3e1eedc..a9c5ad0 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 _0xe05d=['tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','models','destroy','bulkCreate','sortBy','lodash','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','extensions','extension','push','type','Set','format','context','priority','VoiceExtensionId','inbound','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','length','toLowerCase','createdAt','interval','*,*,*,*'];(function(_0x5d63ed,_0x1d48e4){var _0x525fc6=function(_0x4eab27){while(--_0x4eab27){_0x5d63ed['push'](_0x5d63ed['shift']());}};_0x525fc6(++_0x1d48e4);}(_0xe05d,0x175));var _0xde05=function(_0x16ed03,_0x2c5bd4){_0x16ed03=_0x16ed03-0x0;var _0x4e924f=_0xe05d[_0x16ed03];return _0x4e924f;};'use strict';var _=require(_0xde05('0x0'));var util=require('util');function rewrite(_0x4ea202,_0x8686fb){var _0x1840cf=this;return _0x4ea202['models'][_0xde05('0x1')][_0xde05('0x2')]({'raw':!![]})[_0xde05('0x3')](function(_0x4c5a7d){_0x1840cf[_0xde05('0x4')]=_0x4c5a7d;return _0x4ea202['models'][_0xde05('0x5')]['findAll']({'where':{'IntervalId':_0x8686fb[_0xde05('0x6')]},'raw':!![]});})['then'](function(_0x30c01a){return _0x4ea202['models']['VoiceExtension'][_0xde05('0x2')]({'where':{'exten':{'$in':_[_0xde05('0x7')](_['map'](_0x30c01a,'exten'))}},'order':[{'raw':_0xde05('0x8')}],'raw':!![]});})[_0xde05('0x3')](function(_0x3c0302){var _0x52c37b=_[_0xde05('0x9')](_0x3c0302,{'priority':'1'});var _0x3c4f8a=_['filter'](_0x3c0302,{'isApp':0x1});var _0x3ca8ad=_[_0xde05('0xa')](_0x3c4f8a,_0xde05('0xb'));var _0x1c515a=[_0xde05('0xc'),_0xde05('0xd')];var _0x509dd8=[];var _0x38bbd8=[];for(var _0x1a44b9 in _0x3ca8ad){if(_0x3ca8ad[_0xde05('0xe')](_0x1a44b9)){_0x1840cf['priority']=0x2;_0x1840cf[_0xde05('0xf')]=[];_0x1840cf[_0xde05('0x10')]=_['find'](_0x52c37b,{'exten':_0x3ca8ad[_0x1a44b9][0x0]['exten']});_0x1840cf['extensions'][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':_0xde05('0x13'),'appdata':util[_0xde05('0x14')]('CDR(type)=%s',_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')]),'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});if(_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')]===_0xde05('0x18')){_0x1840cf['extensions'][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':_0xde05('0x13'),'appdata':'CDR(routeid)='+_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')],'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0]['exten'],'priority':_0x1840cf['priority']++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});}else if(_0x3ca8ad[_0x1a44b9][0x0]['type']===_0xde05('0x19')){if(_0x1840cf['extension']){_0x1840cf[_0xde05('0xf')][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':_0xde05('0x13'),'appdata':_0xde05('0x1a')+(_0x1840cf[_0xde05('0x10')]['cutdigits']?_0xde05('0x1b')+_0x1840cf[_0xde05('0x10')]['cutdigits']+'}':_0xde05('0x1c')),'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});}_0x1840cf[_0xde05('0xf')][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0]['type'],'app':_0xde05('0x13'),'appdata':_0xde05('0x1d')+_0x3ca8ad[_0x1a44b9][0x0]['VoiceExtensionId'],'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0]['exten'],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0]['VoiceExtensionId']});var _0x237216=_0x1840cf[_0xde05('0x16')]++;_0x1840cf[_0xde05('0xf')][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':_0xde05('0x1e'),'appdata':_0xde05('0x1f')+(_0x237216+0x2)+_0xde05('0x20')+(_0x237216+0x1)+')','context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0]['exten'],'priority':_0x237216,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0]['VoiceExtensionId']});if(_0x1840cf[_0xde05('0x10')]){_0x1840cf[_0xde05('0xf')][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':'Set','appdata':_0x1840cf[_0xde05('0x10')][_0xde05('0x21')]?_0xde05('0x22')+_0x1840cf[_0xde05('0x10')][_0xde05('0x21')]+'}':_0xde05('0x23'),'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});}_0x1840cf['extensions']['push']({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':_0xde05('0x13'),'appdata':_0xde05('0x24')+_0x3ca8ad[_0x1a44b9][0x0]['VoiceExtensionId'],'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0]['exten'],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});if(_0x1840cf[_0xde05('0x10')]&&_0x1840cf['extension']['hasOwnProperty']('recordingFormat')&&_0x1840cf[_0xde05('0x10')]['recordingFormat']!=='none'){_0x1840cf['extensions']['push']({'type':_0x3ca8ad[_0x1a44b9][0x0]['type'],'app':_0xde05('0x13'),'appdata':_0xde05('0x25'),'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'priority':_0x1840cf['priority']++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0]['VoiceExtensionId']});_0x1840cf['extensions'][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0]['type'],'app':'Set','appdata':_0xde05('0x26')+_0x1840cf[_0xde05('0x10')][_0xde05('0x27')]||_0xde05('0x28'),'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0]['exten'],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});}}_0x1840cf[_0xde05('0xf')][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':_0xde05('0x13'),'appdata':_0xde05('0x29'),'context':_0x3ca8ad[_0x1a44b9][0x0]['context'],'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});_0x1840cf['extensions'][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});_0x1840cf[_0xde05('0xf')][_0xde05('0x11')]({'type':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x12')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'priority':_0x1840cf[_0xde05('0x16')]++,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});for(var _0x99ebc8=0x0,_0x34ae02=0x0;_0x99ebc8<_0x3ca8ad[_0x1a44b9][_0xde05('0x2a')];_0x99ebc8+=0x1,_0x34ae02=0x0){var _0x47ba9c=_0x3ca8ad[_0x1a44b9][_0x99ebc8];if(_0x47ba9c['type']){_0x47ba9c[_0xde05('0x12')]=_0x47ba9c[_0xde05('0x12')][_0xde05('0x2b')]();}var _0x507816=[];var _0x2afa1b=[];delete _0x47ba9c['id'];delete _0x47ba9c[_0xde05('0x2c')];delete _0x47ba9c['updatedAt'];var _0x937e3a=_0x47ba9c[_0xde05('0x2d')]!==_0xde05('0x2e')?[_0x47ba9c[_0xde05('0x2d')]]:_0x47ba9c[_0xde05('0x6')]?_['map'](_['filter'](_0x1840cf['intervals'],{'IntervalId':_0x47ba9c[_0xde05('0x6')]}),_0xde05('0x2d')):[];if(_0x47ba9c[_0xde05('0xe')](_0xde05('0x2f'))){if(_0x47ba9c['tag']&&_0x47ba9c[_0xde05('0x2f')]!=='--'){_0x507816['push']({'type':_0x47ba9c[_0xde05('0x12')],'app':_0xde05('0x13'),'appdata':_0xde05('0x30')+_0x47ba9c[_0xde05('0x2f')],'context':_0x47ba9c[_0xde05('0x15')],'exten':_0x47ba9c[_0xde05('0xb')],'priority':_0x937e3a['length']+_0x1840cf[_0xde05('0x16')]+_0x34ae02++,'VoiceExtensionId':_0x47ba9c['VoiceExtensionId']});}}if(_0x47ba9c['type']==='outbound'&&_0x47ba9c[_0xde05('0xe')](_0xde05('0x31'))){if(_0x47ba9c[_0xde05('0x31')]){_0x507816[_0xde05('0x11')]({'type':_0x47ba9c[_0xde05('0x12')],'app':_0xde05('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x47ba9c[_0xde05('0x31')]+')','context':_0x47ba9c[_0xde05('0x15')],'exten':_0x47ba9c[_0xde05('0xb')],'priority':_0x937e3a[_0xde05('0x2a')]+_0x1840cf[_0xde05('0x16')]+_0x34ae02++,'VoiceExtensionId':_0x47ba9c['VoiceExtensionId']});}else{_0x507816['push']({'type':_0x47ba9c[_0xde05('0x12')],'app':_0xde05('0x1e'),'appdata':_0xde05('0x32'),'context':_0x47ba9c['context'],'exten':_0x47ba9c[_0xde05('0xb')],'priority':_0x937e3a[_0xde05('0x2a')]+_0x1840cf['priority']+_0x34ae02++,'VoiceExtensionId':_0x47ba9c[_0xde05('0x17')]});}}if(_0x47ba9c[_0xde05('0xe')](_0xde05('0x33'))){if(_0x1c515a[_0xde05('0x34')](_0x47ba9c[_0xde05('0x35')]['toLowerCase']())>=0x0&&_0x47ba9c[_0xde05('0x36')]!=='custom'){if(_0x47ba9c[_0xde05('0x33')]){_0x507816[_0xde05('0x11')]({'type':_0x47ba9c['type'],'app':_0xde05('0x1e'),'appdata':_0xde05('0x37'),'context':_0x47ba9c[_0xde05('0x15')],'exten':_0x47ba9c['exten'],'priority':_0x937e3a[_0xde05('0x2a')]+_0x1840cf[_0xde05('0x16')]+_0x34ae02++,'VoiceExtensionId':_0x47ba9c['VoiceExtensionId']});_0x507816[_0xde05('0x11')]({'type':_0x47ba9c[_0xde05('0x12')],'app':'Set','appdata':_0xde05('0x38'),'context':_0x47ba9c[_0xde05('0x15')],'exten':_0x47ba9c[_0xde05('0xb')],'priority':_0x937e3a[_0xde05('0x2a')]+_0x1840cf['priority']+_0x34ae02++,'VoiceExtensionId':_0x47ba9c[_0xde05('0x17')]});}else{_0x507816[_0xde05('0x11')]({'type':_0x47ba9c[_0xde05('0x12')],'app':_0xde05('0x1e'),'appdata':_0xde05('0x39'),'context':_0x47ba9c[_0xde05('0x15')],'exten':_0x47ba9c['exten'],'priority':_0x937e3a['length']+_0x1840cf[_0xde05('0x16')]+_0x34ae02++,'VoiceExtensionId':_0x47ba9c['VoiceExtensionId']});_0x507816[_0xde05('0x11')]({'type':_0x47ba9c[_0xde05('0x12')],'app':_0xde05('0x13'),'appdata':_0xde05('0x3a'),'context':_0x47ba9c[_0xde05('0x15')],'exten':_0x47ba9c['exten'],'priority':_0x937e3a['length']+_0x1840cf[_0xde05('0x16')]+_0x34ae02++,'VoiceExtensionId':_0x47ba9c[_0xde05('0x17')]});}}}for(var _0x31e47b=0x0;_0x31e47b<_0x937e3a[_0xde05('0x2a')];_0x31e47b+=0x1){var _0xe02471=_0x1840cf[_0xde05('0x16')]+_0x937e3a[_0xde05('0x2a')];var _0x3179e4=_0x31e47b===_0x937e3a[_0xde05('0x2a')]-0x1?_0x1840cf[_0xde05('0x16')]+_0x507816['length']+_0x2afa1b[_0xde05('0x2a')]+0x2:_0x1840cf[_0xde05('0x16')]+_0x31e47b+0x1;_0x507816[_0xde05('0x3b')](_0x31e47b,0x0,{'type':_0x47ba9c[_0xde05('0x12')],'app':_0xde05('0x3c'),'appdata':_0x937e3a[_0x31e47b]+'?'+_0x47ba9c[_0xde05('0x15')]+_0xde05('0x3d')+_0xe02471+':'+_0x47ba9c[_0xde05('0x15')]+_0xde05('0x3d')+_0x3179e4,'exten':_0x47ba9c[_0xde05('0xb')],'context':_0x47ba9c[_0xde05('0x15')],'priority':_0x1840cf[_0xde05('0x16')]+_0x31e47b,'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});}_0x47ba9c[_0xde05('0x16')]=_0x507816[_0xde05('0x2a')]?_[_0xde05('0x3e')](_0x507816)[_0xde05('0x16')]+0x1:_0x1840cf[_0xde05('0x16')];_0x1840cf[_0xde05('0x16')]=(_0x2afa1b[_0xde05('0x2a')]?_['last'](_0x2afa1b)[_0xde05('0x16')]:_0x47ba9c[_0xde05('0x16')])+0x1;_0x1840cf[_0xde05('0xf')]=_[_0xde05('0x3f')](_0x1840cf[_0xde05('0xf')],_0x507816,[_0x47ba9c],_0x2afa1b);}_0x1840cf['extensions']['push']({'type':_0x3ca8ad[_0x1a44b9][0x0]['type'],'app':_0xde05('0x40'),'exten':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0xb')],'context':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x15')],'priority':_0x1840cf[_0xde05('0x16')],'VoiceExtensionId':_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]});_0x509dd8['push'](_0x3ca8ad[_0x1a44b9][0x0][_0xde05('0x17')]);_0x38bbd8=_['concat'](_0x38bbd8,_0x1840cf[_0xde05('0xf')]);}}return _0x4ea202[_0xde05('0x41')](function(_0x227c4b){return _0x4ea202[_0xde05('0x42')]['VoiceExtension'][_0xde05('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x509dd8}},'transaction':_0x227c4b})['then'](function(_0x5dd66a){return _0x4ea202[_0xde05('0x42')]['VoiceExtension'][_0xde05('0x44')](_[_0xde05('0x45')](_0x38bbd8,_0xde05('0x16')),{'transaction':_0x227c4b});});});})['catch'](function(_0x4a11f0){console['error'](_0x4a11f0);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x75ef=['VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','push','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','catch','error','rewrite','lodash','util','Interval','findAll','intervals','VoiceExtension','IntervalId','then','models','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','extensions','extension','Set','format','CDR(type)=%s','type','inbound','context'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x75ef,0x18a));var _0xf75e=function(_0x2e25ee,_0x58bf5d){_0x2e25ee=_0x2e25ee-0x0;var _0x153546=_0x75ef[_0x2e25ee];return _0x153546;};'use strict';var _=require(_0xf75e('0x0'));var util=require(_0xf75e('0x1'));function rewrite(_0x404f32,_0x22d0a5){var _0x251a34=this;return _0x404f32['models'][_0xf75e('0x2')][_0xf75e('0x3')]({'raw':!![]})['then'](function(_0x48b26e){_0x251a34[_0xf75e('0x4')]=_0x48b26e;return _0x404f32['models'][_0xf75e('0x5')]['findAll']({'where':{'IntervalId':_0x22d0a5[_0xf75e('0x6')]},'raw':!![]});})[_0xf75e('0x7')](function(_0x4a00ec){return _0x404f32[_0xf75e('0x8')][_0xf75e('0x5')][_0xf75e('0x3')]({'where':{'exten':{'$in':_[_0xf75e('0x9')](_[_0xf75e('0xa')](_0x4a00ec,_0xf75e('0xb')))}},'order':[{'raw':_0xf75e('0xc')}],'raw':!![]});})[_0xf75e('0x7')](function(_0x24faf1){var _0x33e817=_['filter'](_0x24faf1,{'priority':'1'});var _0x588478=_[_0xf75e('0xd')](_0x24faf1,{'isApp':0x1});var _0x373970=_['groupBy'](_0x588478,'exten');var _0x2c01b8=[_0xf75e('0xe'),_0xf75e('0xf')];var _0x56f8f6=[];var _0x475aff=[];for(var _0x56a6e0 in _0x373970){if(_0x373970[_0xf75e('0x10')](_0x56a6e0)){_0x251a34[_0xf75e('0x11')]=0x2;_0x251a34[_0xf75e('0x12')]=[];_0x251a34[_0xf75e('0x13')]=_['find'](_0x33e817,{'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')]});_0x251a34[_0xf75e('0x12')]['push']({'type':_0x373970[_0x56a6e0][0x0]['type'],'app':_0xf75e('0x14'),'appdata':util[_0xf75e('0x15')](_0xf75e('0x16'),_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')]),'context':_0x373970[_0x56a6e0][0x0]['context'],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0]['VoiceExtensionId']});if(_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')]===_0xf75e('0x18')){_0x251a34[_0xf75e('0x12')]['push']({'type':_0x373970[_0x56a6e0][0x0]['type'],'app':_0xf75e('0x14'),'appdata':'CDR(routeid)='+_0x373970[_0x56a6e0][0x0]['VoiceExtensionId'],'context':_0x373970[_0x56a6e0][0x0][_0xf75e('0x19')],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});}else if(_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')]===_0xf75e('0x1b')){if(_0x251a34['extension']){_0x251a34[_0xf75e('0x12')]['push']({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':_0xf75e('0x14'),'appdata':_0xf75e('0x1c')+(_0x251a34['extension'][_0xf75e('0x1d')]?_0xf75e('0x1e')+_0x251a34['extension'][_0xf75e('0x1d')]+'}':'${EXTEN}'),'context':_0x373970[_0x56a6e0][0x0]['context'],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});}_0x251a34['extensions'][_0xf75e('0x1f')]({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':'Set','appdata':'CDR(routeid)='+_0x373970[_0x56a6e0][0x0]['VoiceExtensionId'],'context':_0x373970[_0x56a6e0][0x0]['context'],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});var _0xe5d4ef=_0x251a34['priority']++;_0x251a34[_0xf75e('0x12')][_0xf75e('0x1f')]({'type':_0x373970[_0x56a6e0][0x0]['type'],'app':_0xf75e('0x20'),'appdata':_0xf75e('0x21')+(_0xe5d4ef+0x2)+_0xf75e('0x22')+(_0xe5d4ef+0x1)+')','context':_0x373970[_0x56a6e0][0x0]['context'],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0xe5d4ef,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});if(_0x251a34['extension']){_0x251a34[_0xf75e('0x12')][_0xf75e('0x1f')]({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':_0xf75e('0x14'),'appdata':_0x251a34[_0xf75e('0x13')][_0xf75e('0x1d')]?_0xf75e('0x23')+_0x251a34[_0xf75e('0x13')][_0xf75e('0x1d')]+'}':_0xf75e('0x24'),'context':_0x373970[_0x56a6e0][0x0]['context'],'exten':_0x373970[_0x56a6e0][0x0]['exten'],'priority':_0x251a34['priority']++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});}_0x251a34[_0xf75e('0x12')][_0xf75e('0x1f')]({'type':_0x373970[_0x56a6e0][0x0]['type'],'app':_0xf75e('0x14'),'appdata':_0xf75e('0x25')+_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')],'context':_0x373970[_0x56a6e0][0x0][_0xf75e('0x19')],'exten':_0x373970[_0x56a6e0][0x0]['exten'],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});if(_0x251a34[_0xf75e('0x13')]&&_0x251a34['extension'][_0xf75e('0x10')](_0xf75e('0x26'))&&_0x251a34[_0xf75e('0x13')][_0xf75e('0x26')]!==_0xf75e('0x27')){_0x251a34['extensions'][_0xf75e('0x1f')]({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':_0xf75e('0x14'),'appdata':_0xf75e('0x28'),'context':_0x373970[_0x56a6e0][0x0][_0xf75e('0x19')],'exten':_0x373970[_0x56a6e0][0x0]['exten'],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});_0x251a34['extensions']['push']({'type':_0x373970[_0x56a6e0][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x251a34[_0xf75e('0x13')]['recordingFormat']||_0xf75e('0x29'),'context':_0x373970[_0x56a6e0][0x0][_0xf75e('0x19')],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});}}_0x251a34[_0xf75e('0x12')][_0xf75e('0x1f')]({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x373970[_0x56a6e0][0x0]['context'],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});_0x251a34[_0xf75e('0x12')]['push']({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':_0xf75e('0x14'),'appdata':_0xf75e('0x2a'),'context':_0x373970[_0x56a6e0][0x0]['context'],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});_0x251a34[_0xf75e('0x12')][_0xf75e('0x1f')]({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':_0xf75e('0x14'),'appdata':_0xf75e('0x2b'),'context':_0x373970[_0x56a6e0][0x0][_0xf75e('0x19')],'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'priority':_0x251a34[_0xf75e('0x11')]++,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});for(var _0x369033=0x0,_0x26309e=0x0;_0x369033<_0x373970[_0x56a6e0][_0xf75e('0x2c')];_0x369033+=0x1,_0x26309e=0x0){var _0xdc92fe=_0x373970[_0x56a6e0][_0x369033];if(_0xdc92fe[_0xf75e('0x17')]){_0xdc92fe[_0xf75e('0x17')]=_0xdc92fe[_0xf75e('0x17')][_0xf75e('0x2d')]();}var _0x2304c8=[];var _0x12a60c=[];delete _0xdc92fe['id'];delete _0xdc92fe[_0xf75e('0x2e')];delete _0xdc92fe[_0xf75e('0x2f')];var _0x4c9de3=_0xdc92fe[_0xf75e('0x30')]!=='*,*,*,*'?[_0xdc92fe['interval']]:_0xdc92fe[_0xf75e('0x6')]?_[_0xf75e('0xa')](_['filter'](_0x251a34['intervals'],{'IntervalId':_0xdc92fe[_0xf75e('0x6')]}),'interval'):[];if(_0xdc92fe[_0xf75e('0x10')](_0xf75e('0x31'))){if(_0xdc92fe['tag']&&_0xdc92fe['tag']!=='--'){_0x2304c8[_0xf75e('0x1f')]({'type':_0xdc92fe[_0xf75e('0x17')],'app':_0xf75e('0x14'),'appdata':_0xf75e('0x32')+_0xdc92fe[_0xf75e('0x31')],'context':_0xdc92fe[_0xf75e('0x19')],'exten':_0xdc92fe['exten'],'priority':_0x4c9de3[_0xf75e('0x2c')]+_0x251a34['priority']+_0x26309e++,'VoiceExtensionId':_0xdc92fe[_0xf75e('0x1a')]});}}if(_0xdc92fe[_0xf75e('0x17')]===_0xf75e('0x1b')&&_0xdc92fe[_0xf75e('0x10')](_0xf75e('0x33'))){if(_0xdc92fe[_0xf75e('0x33')]){_0x2304c8['push']({'type':_0xdc92fe[_0xf75e('0x17')],'app':_0xf75e('0x20'),'appdata':_0xf75e('0x34')+_0xdc92fe['callerID']+')','context':_0xdc92fe[_0xf75e('0x19')],'exten':_0xdc92fe[_0xf75e('0xb')],'priority':_0x4c9de3[_0xf75e('0x2c')]+_0x251a34[_0xf75e('0x11')]+_0x26309e++,'VoiceExtensionId':_0xdc92fe[_0xf75e('0x1a')]});}else{_0x2304c8['push']({'type':_0xdc92fe[_0xf75e('0x17')],'app':_0xf75e('0x20'),'appdata':_0xf75e('0x35'),'context':_0xdc92fe['context'],'exten':_0xdc92fe[_0xf75e('0xb')],'priority':_0x4c9de3[_0xf75e('0x2c')]+_0x251a34['priority']+_0x26309e++,'VoiceExtensionId':_0xdc92fe[_0xf75e('0x1a')]});}}if(_0xdc92fe[_0xf75e('0x10')](_0xf75e('0x36'))){if(_0x2c01b8[_0xf75e('0x37')](_0xdc92fe[_0xf75e('0x38')][_0xf75e('0x2d')]())>=0x0&&_0xdc92fe['appType']!=='custom'){if(_0xdc92fe[_0xf75e('0x36')]){_0x2304c8[_0xf75e('0x1f')]({'type':_0xdc92fe[_0xf75e('0x17')],'app':'ExecIf','appdata':_0xf75e('0x39'),'context':_0xdc92fe['context'],'exten':_0xdc92fe[_0xf75e('0xb')],'priority':_0x4c9de3[_0xf75e('0x2c')]+_0x251a34['priority']+_0x26309e++,'VoiceExtensionId':_0xdc92fe[_0xf75e('0x1a')]});_0x2304c8['push']({'type':_0xdc92fe[_0xf75e('0x17')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0xdc92fe[_0xf75e('0x19')],'exten':_0xdc92fe[_0xf75e('0xb')],'priority':_0x4c9de3[_0xf75e('0x2c')]+_0x251a34[_0xf75e('0x11')]+_0x26309e++,'VoiceExtensionId':_0xdc92fe['VoiceExtensionId']});}else{_0x2304c8['push']({'type':_0xdc92fe[_0xf75e('0x17')],'app':_0xf75e('0x20'),'appdata':_0xf75e('0x3a'),'context':_0xdc92fe['context'],'exten':_0xdc92fe[_0xf75e('0xb')],'priority':_0x4c9de3[_0xf75e('0x2c')]+_0x251a34['priority']+_0x26309e++,'VoiceExtensionId':_0xdc92fe[_0xf75e('0x1a')]});_0x2304c8[_0xf75e('0x1f')]({'type':_0xdc92fe['type'],'app':_0xf75e('0x14'),'appdata':_0xf75e('0x3b'),'context':_0xdc92fe[_0xf75e('0x19')],'exten':_0xdc92fe['exten'],'priority':_0x4c9de3[_0xf75e('0x2c')]+_0x251a34[_0xf75e('0x11')]+_0x26309e++,'VoiceExtensionId':_0xdc92fe[_0xf75e('0x1a')]});}}}for(var _0x7a4b25=0x0;_0x7a4b25<_0x4c9de3[_0xf75e('0x2c')];_0x7a4b25+=0x1){var _0xd24e97=_0x251a34['priority']+_0x4c9de3[_0xf75e('0x2c')];var _0xb57e5a=_0x7a4b25===_0x4c9de3[_0xf75e('0x2c')]-0x1?_0x251a34[_0xf75e('0x11')]+_0x2304c8[_0xf75e('0x2c')]+_0x12a60c[_0xf75e('0x2c')]+0x2:_0x251a34['priority']+_0x7a4b25+0x1;_0x2304c8[_0xf75e('0x3c')](_0x7a4b25,0x0,{'type':_0xdc92fe['type'],'app':_0xf75e('0x3d'),'appdata':_0x4c9de3[_0x7a4b25]+'?'+_0xdc92fe[_0xf75e('0x19')]+_0xf75e('0x3e')+_0xd24e97+':'+_0xdc92fe['context']+_0xf75e('0x3e')+_0xb57e5a,'exten':_0xdc92fe[_0xf75e('0xb')],'context':_0xdc92fe[_0xf75e('0x19')],'priority':_0x251a34[_0xf75e('0x11')]+_0x7a4b25,'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});}_0xdc92fe['priority']=_0x2304c8['length']?_[_0xf75e('0x3f')](_0x2304c8)['priority']+0x1:_0x251a34[_0xf75e('0x11')];_0x251a34[_0xf75e('0x11')]=(_0x12a60c[_0xf75e('0x2c')]?_[_0xf75e('0x3f')](_0x12a60c)['priority']:_0xdc92fe[_0xf75e('0x11')])+0x1;_0x251a34[_0xf75e('0x12')]=_[_0xf75e('0x40')](_0x251a34[_0xf75e('0x12')],_0x2304c8,[_0xdc92fe],_0x12a60c);}_0x251a34[_0xf75e('0x12')]['push']({'type':_0x373970[_0x56a6e0][0x0][_0xf75e('0x17')],'app':_0xf75e('0x41'),'exten':_0x373970[_0x56a6e0][0x0][_0xf75e('0xb')],'context':_0x373970[_0x56a6e0][0x0][_0xf75e('0x19')],'priority':_0x251a34[_0xf75e('0x11')],'VoiceExtensionId':_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]});_0x56f8f6['push'](_0x373970[_0x56a6e0][0x0][_0xf75e('0x1a')]);_0x475aff=_[_0xf75e('0x40')](_0x475aff,_0x251a34['extensions']);}}return _0x404f32['transaction'](function(_0x20ce9e){return _0x404f32[_0xf75e('0x8')][_0xf75e('0x5')][_0xf75e('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x56f8f6}},'transaction':_0x20ce9e})[_0xf75e('0x7')](function(_0x531924){return _0x404f32[_0xf75e('0x8')][_0xf75e('0x5')]['bulkCreate'](_['sortBy'](_0x475aff,_0xf75e('0x11')),{'transaction':_0x20ce9e});});});})[_0xf75e('0x43')](function(_0xd74a3c){console[_0xf75e('0x44')](_0xd74a3c);});}exports[_0xf75e('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 36b776f..063d3e1 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 _0xf767=['phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','CmList','Lists','then','get','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','BlackLists','Campaign','dialCheckDuplicateType','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','stringify','bluebird','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','message','hasOwnProperty','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','Duplicate\x20Contact','CmContact','create','keys','pick','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf767,0x16e));var _0x7f76=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0xf767[_0x43776a];return _0x18eb8f;};'use strict';var BPromise=require(_0x7f76('0x0'));var util=require(_0x7f76('0x1'));var _=require(_0x7f76('0x2'));var fs=require('fs');var squel=require(_0x7f76('0x3'));var Papa=require('papaparse');var Redis=require(_0x7f76('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x7f76('0x5'));var logger=require(_0x7f76('0x6'))(_0x7f76('0x7'));config[_0x7f76('0x8')]=_[_0x7f76('0x9')](config[_0x7f76('0x8')],{'host':_0x7f76('0xa'),'port':0x18eb});var socket=require(_0x7f76('0xb'))(new Redis(config[_0x7f76('0x8')]));require(_0x7f76('0xc'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x7f76('0xd')][0x2]===_0x7f76('0xe')||process[_0x7f76('0xd')][0x2]===_0x7f76('0xf')){throw new Error(_0x7f76('0x10'));}var FILEPATH=process[_0x7f76('0xd')][0x2];if(!process[_0x7f76('0xd')][0x3]||process[_0x7f76('0xd')][0x3]==='undefined'||process[_0x7f76('0xd')][0x3]==='null'||!process['argv'][0x4]||process[_0x7f76('0xd')][0x4]===_0x7f76('0xe')||process[_0x7f76('0xd')][0x4]===_0x7f76('0xf')){throw new Error(_0x7f76('0x11'));}var FIELDS=_[_0x7f76('0x12')](process[_0x7f76('0xd')][0x3][_0x7f76('0x13')](','),process['argv'][0x4][_0x7f76('0x13')](','));if(!process[_0x7f76('0xd')][0x5]||process[_0x7f76('0xd')][0x5]==='undefined'||process[_0x7f76('0xd')][0x5]===_0x7f76('0xf')){throw new Error(_0x7f76('0x14'));}var LISTID=process[_0x7f76('0xd')][0x5];var COMPANYID=process[_0x7f76('0xd')][0x6]&&process[_0x7f76('0xd')][0x6]!==_0x7f76('0xe')&&process[_0x7f76('0xd')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0x7f76('0xd')][0x7]&&process[_0x7f76('0xd')][0x7]!=='undefined'&&process[_0x7f76('0xd')][0x7]!==_0x7f76('0xf')?process['argv'][0x7]:null;if(!process[_0x7f76('0xd')][0x8]||process[_0x7f76('0xd')][0x8]==='undefined'||process[_0x7f76('0xd')][0x8]==='null'){throw new Error(_0x7f76('0x15'));}var SOCKET_TIMESTAMP=process[_0x7f76('0xd')][0x8];}catch(_0x1156e8){logger[_0x7f76('0x16')](_0x1156e8);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(_0x3c300f,_0x21497c,_0x28333d,_0x596ae0){var _0xf0ee13={'message':_0x21497c};_0xf0ee13[_0x3c300f]=!![];if(_0x28333d){_0xf0ee13[_0x7f76('0x17')]=_0x28333d;}if(_0x596ae0){_0xf0ee13[_0x7f76('0x18')]=_0x596ae0;}return _0xf0ee13;}function isEmail(_0x1be15d){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))*$/[_0x7f76('0x19')](_0x1be15d);}function checkRow(_0x4ecf7f,_0x12f5f3,_0x7fddac){return new BPromise(function(_0x2f33d0,_0x52d286){if(_['isNil'](_0x4ecf7f)){return _0x52d286(handleCheckRowError(_0x7f76('0x16'),_0x7f76('0x1a'),null,_0x7fddac));}if(_0x4ecf7f['errors']&&_0x4ecf7f['errors'][_0x7f76('0x1b')]){var _0x20fcdf=_[_0x7f76('0x1c')](_0x4ecf7f['errors'],_0x7f76('0x1d'))['join'](';');return _0x52d286(handleCheckRowError('error',_0x20fcdf,null,_0x7fddac));}var _0x25b24f={};for(var _0x4ecbec in FIELDS){if(FIELDS[_0x7f76('0x1e')](_0x4ecbec)&&FIELDS[_0x4ecbec]){_0x25b24f[_0x4ecbec]=_0x4ecf7f[_0x7f76('0x1f')][0x0][FIELDS[_0x4ecbec]]||_0x4ecf7f[_0x7f76('0x1f')][0x0]['\ufeff'+FIELDS[_0x4ecbec]];}}if(!_0x25b24f[_0x7f76('0x20')]){return _0x52d286(handleCheckRowError(_0x7f76('0x16'),'firstName\x20not\x20specified!',null,_0x7fddac));}if(!_0x25b24f[_0x7f76('0x21')]){return _0x52d286(handleCheckRowError(_0x7f76('0x16'),'phone\x20not\x20specified!',null,_0x7fddac));}if(_0x25b24f[_0x7f76('0x22')]){var _0x1a35a7=moment(_0x25b24f[_0x7f76('0x22')],_0x7f76('0x23'));if(!_0x1a35a7[_0x7f76('0x24')]()){return _0x52d286(handleCheckRowError(_0x7f76('0x16'),_0x7f76('0x25'),null,_0x7fddac));}}if(_0x25b24f[_0x7f76('0x26')]){if(!isEmail(_0x25b24f[_0x7f76('0x26')])){return _0x52d286(handleCheckRowError(_0x7f76('0x16'),_0x7f76('0x27'),null,_0x7fddac));}}_0x25b24f[_0x7f76('0x28')]=LISTID;_0x25b24f['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7f76('0x1b')]&&_0x12f5f3){var _0x45751c={};for(var _0x54344f=0x0,_0x46d321=DUPLICATES['length'];_0x54344f<_0x46d321;_0x54344f+=0x1){_0x45751c[DUPLICATES[_0x54344f]]=_0x25b24f[DUPLICATES[_0x54344f]];}var _0x2fdc69=_[_0x7f76('0x29')](_0x12f5f3,_0x45751c);if(_0x2fdc69){return _0x52d286(handleCheckRowError('duplicate',_0x7f76('0x2a'),_0x2fdc69,_0x7fddac));}}return db[_0x7f76('0x2b')][_0x7f76('0x2c')](_0x25b24f,{'raw':!![],'hooks':![],'fields':_[_0x7f76('0x2d')](_0x25b24f)})['then'](function(_0x528cd4){if(DUPLICATES&&DUPLICATES[_0x7f76('0x1b')]&&_0x12f5f3){_0x12f5f3['push'](_[_0x7f76('0x2e')](_0x25b24f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x528cd4['id'];return _0x2f33d0();})['catch'](function(_0x5cd806){return _0x52d286(handleCheckRowError(_0x7f76('0x16'),_0x7f76('0x2f')+(_0x5cd806[_0x7f76('0x1d')]||JSON['stringify'](_0x5cd806)),null,_0x7fddac));});});}function checkHopper(){function _0xb4fe97(){return function(_0x536370){logger[_0x7f76('0x16')]('cmContact',_0x7f76('0x30'),util[_0x7f76('0x31')](_0x536370,{'showHidden':![],'depth':null}));};}var _0x57808c=function(_0x331275,_0x40fc46){var _0x24a892=squel[_0x7f76('0x32')]()[_0x7f76('0x33')](_0x7f76('0x34'))[_0x7f76('0x35')](['phone',_0x7f76('0x36'),_0x7f76('0x37'),_0x7f76('0x28'),_0x40fc46,_0x7f76('0x38'),_0x7f76('0x39')],squel[_0x7f76('0x3a')]()[_0x7f76('0x3b')](_0x7f76('0x21'),'phone')[_0x7f76('0x3b')](_0x7f76('0x3c'),_0x7f76('0x36'))[_0x7f76('0x3b')]('id',_0x7f76('0x37'))[_0x7f76('0x3b')](LISTID[_0x7f76('0x3d')](),_0x7f76('0x28'))[_0x7f76('0x3b')](_0x331275['id'][_0x7f76('0x3d')](),_0x40fc46)[_0x7f76('0x3b')](_0x7f76('0x3c'),_0x7f76('0x38'))[_0x7f76('0x3b')](_0x7f76('0x3c'),'updatedAt')[_0x7f76('0x3e')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x7f76('0x3f'),LISTID[_0x7f76('0x3d')]())[_0x7f76('0x40')](_0x7f76('0x41'))[_0x7f76('0x40')](_0x7f76('0x42'),squel['select']()['field'](_0x7f76('0x21'))['from'](_0x7f76('0x34'))[_0x7f76('0x40')](_0x40fc46+_0x7f76('0x43'),_0x331275['id'][_0x7f76('0x3d')]())))['toString']();return _0x24a892;};var _0x12cf12=function(_0x4446d1,_0x3b8ef1){var _0x51c30f=squel[_0x7f76('0x32')]()[_0x7f76('0x33')]('cm_hopper')[_0x7f76('0x35')]([_0x7f76('0x21'),'scheduledAt',_0x7f76('0x37'),'ListId',_0x3b8ef1,'createdAt',_0x7f76('0x39')],squel[_0x7f76('0x3a')]()[_0x7f76('0x3b')](_0x7f76('0x21'),_0x7f76('0x21'))['field']('NOW()','scheduledAt')[_0x7f76('0x3b')]('id',_0x7f76('0x37'))['field'](LISTID[_0x7f76('0x3d')](),'ListId')[_0x7f76('0x3b')](_0x4446d1['id'][_0x7f76('0x3d')](),_0x3b8ef1)[_0x7f76('0x3b')](_0x7f76('0x3c'),'createdAt')['field'](_0x7f76('0x3c'),_0x7f76('0x39'))[_0x7f76('0x3e')](_0x7f76('0x44'))['where'](_0x7f76('0x45'))[_0x7f76('0x40')](_0x7f76('0x3f'),LISTID[_0x7f76('0x3d')]())[_0x7f76('0x40')](_0x7f76('0x46'),squel[_0x7f76('0x47')](hopperContacts))[_0x7f76('0x40')](_0x7f76('0x41'))['where'](_0x7f76('0x42'),squel[_0x7f76('0x3a')]()[_0x7f76('0x3b')]('calleridnum')['from'](_0x7f76('0x48'))[_0x7f76('0x40')](_0x3b8ef1+_0x7f76('0x43'),_0x4446d1['id'][_0x7f76('0x3d')]()))[_0x7f76('0x40')](_0x7f76('0x42'),squel[_0x7f76('0x3a')]()['field'](_0x7f76('0x21'))[_0x7f76('0x3e')](_0x7f76('0x34'))[_0x7f76('0x40')](_0x3b8ef1+_0x7f76('0x43'),_0x4446d1['id'][_0x7f76('0x3d')]())))[_0x7f76('0x3d')]();return _0x51c30f;};function _0xee6fc1(_0x4a41f1,_0x452b0){var _0x168dbe=squel[_0x7f76('0x32')]()[_0x7f76('0x33')](_0x7f76('0x34'))[_0x7f76('0x35')]([_0x7f76('0x21'),'scheduledAt',_0x7f76('0x37'),_0x7f76('0x28'),_0x452b0,_0x7f76('0x38'),_0x7f76('0x39')],squel[_0x7f76('0x3a')]()[_0x7f76('0x3b')](_0x7f76('0x21'),_0x7f76('0x21'))[_0x7f76('0x3b')]('NOW()',_0x7f76('0x36'))[_0x7f76('0x3b')]('id',_0x7f76('0x37'))[_0x7f76('0x3b')](LISTID['toString'](),'ListId')[_0x7f76('0x3b')](_0x4a41f1['id'][_0x7f76('0x3d')](),_0x452b0)[_0x7f76('0x3b')]('NOW()',_0x7f76('0x38'))[_0x7f76('0x3b')](_0x7f76('0x3c'),_0x7f76('0x39'))[_0x7f76('0x3e')]('cm_contacts')[_0x7f76('0x40')](_0x7f76('0x45'))['where'](_0x7f76('0x3f'),LISTID[_0x7f76('0x3d')]())['where'](_0x7f76('0x46'),squel[_0x7f76('0x47')](hopperContacts))[_0x7f76('0x40')](_0x7f76('0x41')))['toString']();return _0x168dbe;}function _0x5301dc(_0x17d21e,_0xa10016){var _0x1758c0=squel['insert']()[_0x7f76('0x33')](_0x7f76('0x49'))['fromQuery']([_0x7f76('0x21'),_0x7f76('0x37'),_0x7f76('0x28'),_0xa10016,_0x7f76('0x38'),_0x7f76('0x39')],squel[_0x7f76('0x3a')]()['field'](_0x7f76('0x21'),_0x7f76('0x21'))[_0x7f76('0x3b')]('id','ContactId')[_0x7f76('0x3b')](LISTID['toString'](),_0x7f76('0x28'))[_0x7f76('0x3b')](_0x17d21e['id'][_0x7f76('0x3d')](),_0xa10016)['field']('NOW()','createdAt')[_0x7f76('0x3b')](_0x7f76('0x3c'),'updatedAt')[_0x7f76('0x3e')](_0x7f76('0x44'))['where']('deletedAt\x20IS\x20NULL')[_0x7f76('0x40')](_0x7f76('0x3f'),LISTID[_0x7f76('0x3d')]())['where'](_0x7f76('0x46'),squel[_0x7f76('0x47')](hopperContacts))[_0x7f76('0x40')](_0x7f76('0x41')))[_0x7f76('0x3d')]();return _0x1758c0;}return db[_0x7f76('0x4a')][_0x7f76('0x4b')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x7f76('0x4c')],'as':_0x7f76('0x4d'),'where':{'id':LISTID}}]})[_0x7f76('0x4e')](function(_0x29c6b9){var _0x419cd7=[];if(_0x29c6b9){var _0x5884b9;for(var _0x26be13=0x0,_0x2b94d3;_0x26be13<_0x29c6b9['length'];_0x26be13+=0x1){_0x2b94d3=_0x29c6b9[_0x26be13][_0x7f76('0x4f')]({'plain':!![]});switch(_0x2b94d3['dialCheckDuplicateType']){case _0x7f76('0x50'):_0x419cd7[_0x7f76('0x51')](db[_0x7f76('0x52')]['query'](_0x12cf12(_0x2b94d3,_0x7f76('0x53')))['then'](function(){})[_0x7f76('0x54')](_0xb4fe97()));break;case _0x7f76('0x55'):_0x419cd7[_0x7f76('0x51')](db[_0x7f76('0x52')][_0x7f76('0x56')](_0x57808c(_0x2b94d3,_0x7f76('0x53')))['then'](function(){})[_0x7f76('0x54')](_0xb4fe97()));break;default:_0x419cd7['push'](db[_0x7f76('0x52')][_0x7f76('0x56')](_0xee6fc1(_0x2b94d3,_0x7f76('0x53')))[_0x7f76('0x4e')](function(){})[_0x7f76('0x54')](_0xb4fe97()));}}}return _0x419cd7;})[_0x7f76('0x57')]()[_0x7f76('0x4e')](function(){return db[_0x7f76('0x4a')][_0x7f76('0x4b')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x7f76('0x4c')],'as':_0x7f76('0x58'),'where':{'id':LISTID}}]})[_0x7f76('0x4e')](function(_0x156942){var _0xe2d844=[];if(_0x156942){var _0x3ed348;for(var _0x14e9cf=0x0,_0x5acc61;_0x14e9cf<_0x156942[_0x7f76('0x1b')];_0x14e9cf+=0x1){_0x5acc61=_0x156942[_0x14e9cf][_0x7f76('0x4f')]({'plain':!![]});_0xe2d844[_0x7f76('0x51')](db[_0x7f76('0x52')][_0x7f76('0x56')](_0x5301dc(_0x5acc61,_0x7f76('0x53')))[_0x7f76('0x4e')](function(){})['catch'](_0xb4fe97()));}}return _0xe2d844;})['all']();})[_0x7f76('0x4e')](function(){return db[_0x7f76('0x59')][_0x7f76('0x4b')]({'attributes':['id',_0x7f76('0x5a')],'include':[{'model':db[_0x7f76('0x4c')],'as':'Lists','where':{'id':LISTID}}]})[_0x7f76('0x4e')](function(_0x287ee8){var _0x546414=[];if(_0x287ee8){for(var _0x7a8187=0x0,_0x2579f2;_0x7a8187<_0x287ee8[_0x7f76('0x1b')];_0x7a8187+=0x1){_0x2579f2=_0x287ee8[_0x7a8187][_0x7f76('0x4f')]({'plain':!![]});switch(_0x2579f2[_0x7f76('0x5a')]){case _0x7f76('0x50'):_0x546414[_0x7f76('0x51')](db[_0x7f76('0x52')][_0x7f76('0x56')](_0x12cf12(_0x2579f2,_0x7f76('0x5b')))['then'](function(){})[_0x7f76('0x54')](_0xb4fe97()));break;case _0x7f76('0x55'):_0x546414['push'](db['sequelize']['query'](_0x57808c(_0x2579f2,'CampaignId'))[_0x7f76('0x4e')](function(){})['catch'](_0xb4fe97()));break;default:_0x546414[_0x7f76('0x51')](db[_0x7f76('0x52')]['query'](_0xee6fc1(_0x2579f2,_0x7f76('0x5b')))['then'](function(){})['catch'](_0xb4fe97()));}}}return _0x546414;})[_0x7f76('0x57')]();})[_0x7f76('0x4e')](function(){return db[_0x7f76('0x59')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x7f76('0x4c')],'as':_0x7f76('0x58'),'where':{'id':LISTID}}]})[_0x7f76('0x4e')](function(_0x290e5c){var _0x267070=[];if(_0x290e5c){for(var _0x5809da=0x0,_0x6d6eed;_0x5809da<_0x290e5c[_0x7f76('0x1b')];_0x5809da+=0x1){_0x6d6eed=_0x290e5c[_0x5809da][_0x7f76('0x4f')]({'plain':!![]});_0x267070[_0x7f76('0x51')](db['sequelize'][_0x7f76('0x56')](_0x5301dc(_0x6d6eed,_0x7f76('0x5b')))[_0x7f76('0x4e')](function(){})['catch'](_0xb4fe97()));}}return _0x267070;})[_0x7f76('0x57')]();})[_0x7f76('0x54')](function(_0x158875){logger['error'](_0x7f76('0x5c'),'generalCheckHopper',_0x158875[_0x7f76('0x1d')]);});}var processPromises=function(_0x2fd59a){return BPromise[_0x7f76('0x57')](promises)[_0x7f76('0x4e')](function(_0x3cd191){})[_0x7f76('0x54')](function(_0x40b6a3){logger['error'](_0x7f76('0x5d'),JSON['stringify'](_0x40b6a3));})['finally'](function(){socket[_0x7f76('0x5e')](_0x7f76('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2fd59a){return _0x2fd59a[_0x7f76('0x60')]();}});};var endCsv=function(){return BPromise[_0x7f76('0x61')]()[_0x7f76('0x4e')](function(){if(hopperContacts){return checkHopper();}})[_0x7f76('0x4e')](function(){socket[_0x7f76('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7f76('0x62')](FILEPATH);}catch(_0x4e2c41){logger[_0x7f76('0x16')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x4e2c41));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x7f76('0x61')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7f76('0x13')](',');return db[_0x7f76('0x2b')][_0x7f76('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7f76('0x4e')](function(_0x4bea71){var _0x20ef26=fs[_0x7f76('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7f76('0x64')](_0x20ef26,{'header':!![],'skipEmptyLines':!![],'step':function(_0x10804e,_0x31116d){total+=0x1;var _0x3a1325=total;promises['push'](checkRow(_0x10804e,_0x4bea71,_0x3a1325)[_0x7f76('0x4e')](function(){success+=0x1;})[_0x7f76('0x54')](function(_0x29a417){if(_0x29a417[_0x7f76('0x16')]){errors+=0x1;delete _0x29a417[_0x7f76('0x16')];}else if(_0x29a417[_0x7f76('0x65')]){duplicates+=0x1;delete _0x29a417[_0x7f76('0x65')];}rows['push'](_0x29a417);}));if(total%0xc8===0x0){_0x31116d[_0x7f76('0x66')]();return processPromises(_0x31116d);}},'complete':function(){return processPromises()[_0x7f76('0x4e')](function(){logger[_0x7f76('0x67')](_0x7f76('0x68'));endCsv();});},'error':function(_0x2720e6,_0x51b595){logger[_0x7f76('0x67')](_0x7f76('0x69'),JSON['stringify'](_0x2720e6));endCsv();}});})[_0x7f76('0x54')](function(_0x7a529c){logger[_0x7f76('0x16')](_0x7f76('0x6a'),JSON[_0x7f76('0x6b')](_0x7a529c));});}main(); \ No newline at end of file +var _0x3344=['Lists','get','always','push','sequelize','query','onlyIfOpen','all','VoiceQueueId','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','into','id\x20IN\x20?','str','calleridnum','phone\x20IS\x20NOT\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList'];(function(_0x2012a6,_0x27db10){var _0x4e07f2=function(_0x2e3732){while(--_0x2e3732){_0x2012a6['push'](_0x2012a6['shift']());}};_0x4e07f2(++_0x27db10);}(_0x3344,0x1c0));var _0x4334=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3344[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x4334('0x0'));var util=require(_0x4334('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x4334('0x2'));var Papa=require(_0x4334('0x3'));var Redis=require(_0x4334('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x4334('0x5'));config[_0x4334('0x6')]=_[_0x4334('0x7')](config[_0x4334('0x6')],{'host':_0x4334('0x8'),'port':0x18eb});var socket=require(_0x4334('0x9'))(new Redis(config[_0x4334('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0x4334('0xa')](socket);try{if(!process[_0x4334('0xb')][0x2]||process[_0x4334('0xb')][0x2]===_0x4334('0xc')||process['argv'][0x2]===_0x4334('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x4334('0xb')][0x2];if(!process[_0x4334('0xb')][0x3]||process[_0x4334('0xb')][0x3]===_0x4334('0xc')||process['argv'][0x3]===_0x4334('0xd')||!process[_0x4334('0xb')][0x4]||process[_0x4334('0xb')][0x4]===_0x4334('0xc')||process['argv'][0x4]===_0x4334('0xd')){throw new Error(_0x4334('0xe'));}var FIELDS=_['zipObject'](process[_0x4334('0xb')][0x3]['split'](','),process['argv'][0x4][_0x4334('0xf')](','));if(!process[_0x4334('0xb')][0x5]||process[_0x4334('0xb')][0x5]===_0x4334('0xc')||process[_0x4334('0xb')][0x5]===_0x4334('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x4334('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x4334('0xb')][0x6]!==_0x4334('0xc')&&process['argv'][0x6]!==_0x4334('0xd')?process[_0x4334('0xb')][0x6]:null;var DUPLICATES=process[_0x4334('0xb')][0x7]&&process[_0x4334('0xb')][0x7]!=='undefined'&&process[_0x4334('0xb')][0x7]!==_0x4334('0xd')?process[_0x4334('0xb')][0x7]:null;if(!process[_0x4334('0xb')][0x8]||process['argv'][0x8]===_0x4334('0xc')||process[_0x4334('0xb')][0x8]===_0x4334('0xd')){throw new Error(_0x4334('0x10'));}var SOCKET_TIMESTAMP=process[_0x4334('0xb')][0x8];}catch(_0x4ff9fb){logger[_0x4334('0x11')](_0x4ff9fb);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(_0x26f5de,_0x1cba9d,_0x511fe0,_0x160b3f){var _0x333828={'message':_0x1cba9d};_0x333828[_0x26f5de]=!![];if(_0x511fe0){_0x333828[_0x4334('0x12')]=_0x511fe0;}if(_0x160b3f){_0x333828['index']=_0x160b3f;}return _0x333828;}function isEmail(_0x4f3f02){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))*$/[_0x4334('0x13')](_0x4f3f02);}function checkRow(_0x2750a0,_0x12c67a,_0x1e5429){return new BPromise(function(_0x1f7dae,_0x2b7e8e){if(_[_0x4334('0x14')](_0x2750a0)){return _0x2b7e8e(handleCheckRowError(_0x4334('0x11'),_0x4334('0x15'),null,_0x1e5429));}if(_0x2750a0['errors']&&_0x2750a0[_0x4334('0x16')][_0x4334('0x17')]){var _0x5a7892=_[_0x4334('0x18')](_0x2750a0[_0x4334('0x16')],_0x4334('0x19'))[_0x4334('0x1a')](';');return _0x2b7e8e(handleCheckRowError(_0x4334('0x11'),_0x5a7892,null,_0x1e5429));}var _0x1b6633={};for(var _0x32f221 in FIELDS){if(FIELDS[_0x4334('0x1b')](_0x32f221)&&FIELDS[_0x32f221]){_0x1b6633[_0x32f221]=_0x2750a0[_0x4334('0x1c')][0x0][FIELDS[_0x32f221]]||_0x2750a0[_0x4334('0x1c')][0x0]['\ufeff'+FIELDS[_0x32f221]];}}if(!_0x1b6633['firstName']){return _0x2b7e8e(handleCheckRowError(_0x4334('0x11'),'firstName\x20not\x20specified!',null,_0x1e5429));}if(!_0x1b6633['phone']){return _0x2b7e8e(handleCheckRowError(_0x4334('0x11'),_0x4334('0x1d'),null,_0x1e5429));}if(_0x1b6633[_0x4334('0x1e')]){var _0x1015c2=moment(_0x1b6633[_0x4334('0x1e')],_0x4334('0x1f'));if(!_0x1015c2['isValid']()){return _0x2b7e8e(handleCheckRowError(_0x4334('0x11'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1e5429));}}if(_0x1b6633[_0x4334('0x20')]){if(!isEmail(_0x1b6633[_0x4334('0x20')])){return _0x2b7e8e(handleCheckRowError(_0x4334('0x11'),'email\x20format\x20is\x20not\x20valid!',null,_0x1e5429));}}_0x1b6633[_0x4334('0x21')]=LISTID;_0x1b6633[_0x4334('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x12c67a){var _0x58d74d={};for(var _0x3527f1=0x0,_0x146ac4=DUPLICATES[_0x4334('0x17')];_0x3527f1<_0x146ac4;_0x3527f1+=0x1){_0x58d74d[DUPLICATES[_0x3527f1]]=_0x1b6633[DUPLICATES[_0x3527f1]];}var _0x28d24d=_[_0x4334('0x23')](_0x12c67a,_0x58d74d);if(_0x28d24d){return _0x2b7e8e(handleCheckRowError(_0x4334('0x24'),'Duplicate\x20Contact',_0x28d24d,_0x1e5429));}}return db[_0x4334('0x25')][_0x4334('0x26')](_0x1b6633,{'raw':!![],'hooks':![],'fields':_[_0x4334('0x27')](_0x1b6633)})[_0x4334('0x28')](function(_0x147446){if(DUPLICATES&&DUPLICATES[_0x4334('0x17')]&&_0x12c67a){_0x12c67a['push'](_[_0x4334('0x29')](_0x1b6633,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x147446['id'];return _0x1f7dae();})[_0x4334('0x2a')](function(_0x1cdc2d){return _0x2b7e8e(handleCheckRowError(_0x4334('0x11'),_0x4334('0x2b')+(_0x1cdc2d[_0x4334('0x19')]||JSON[_0x4334('0x2c')](_0x1cdc2d)),null,_0x1e5429));});});}function checkHopper(){function _0x2cdad2(){return function(_0x3b6c02){logger[_0x4334('0x11')](_0x4334('0x2d'),_0x4334('0x2e'),util[_0x4334('0x2f')](_0x3b6c02,{'showHidden':![],'depth':null}));};}var _0x4b56ff=function(_0xed16d9,_0xb54939){var _0x5214bf=squel['insert']()['into'](_0x4334('0x30'))[_0x4334('0x31')]([_0x4334('0x32'),_0x4334('0x33'),_0x4334('0x34'),_0x4334('0x21'),_0xb54939,_0x4334('0x35'),'updatedAt'],squel[_0x4334('0x36')]()[_0x4334('0x37')]('phone',_0x4334('0x32'))[_0x4334('0x37')](_0x4334('0x38'),'scheduledAt')['field']('id',_0x4334('0x34'))[_0x4334('0x37')](LISTID['toString'](),'ListId')[_0x4334('0x37')](_0xed16d9['id']['toString'](),_0xb54939)[_0x4334('0x37')](_0x4334('0x38'),_0x4334('0x35'))['field'](_0x4334('0x38'),_0x4334('0x39'))[_0x4334('0x3a')](_0x4334('0x3b'))[_0x4334('0x3c')](_0x4334('0x3d'))[_0x4334('0x3c')](_0x4334('0x3e'),LISTID[_0x4334('0x3f')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x4334('0x3c')](_0x4334('0x40'),squel[_0x4334('0x36')]()[_0x4334('0x37')](_0x4334('0x32'))[_0x4334('0x3a')]('cm_hopper')['where'](_0xb54939+_0x4334('0x41'),_0xed16d9['id'][_0x4334('0x3f')]())))['toString']();return _0x5214bf;};var _0x171fef=function(_0x2c83b9,_0x23fe68){var _0x302d57=squel[_0x4334('0x42')]()[_0x4334('0x43')](_0x4334('0x30'))[_0x4334('0x31')]([_0x4334('0x32'),'scheduledAt','ContactId',_0x4334('0x21'),_0x23fe68,_0x4334('0x35'),'updatedAt'],squel[_0x4334('0x36')]()['field'](_0x4334('0x32'),_0x4334('0x32'))[_0x4334('0x37')](_0x4334('0x38'),'scheduledAt')[_0x4334('0x37')]('id',_0x4334('0x34'))[_0x4334('0x37')](LISTID['toString'](),'ListId')[_0x4334('0x37')](_0x2c83b9['id']['toString'](),_0x23fe68)[_0x4334('0x37')](_0x4334('0x38'),_0x4334('0x35'))[_0x4334('0x37')]('NOW()',_0x4334('0x39'))[_0x4334('0x3a')](_0x4334('0x3b'))[_0x4334('0x3c')]('deletedAt\x20IS\x20NULL')[_0x4334('0x3c')](_0x4334('0x3e'),LISTID[_0x4334('0x3f')]())[_0x4334('0x3c')](_0x4334('0x44'),squel[_0x4334('0x45')](hopperContacts))[_0x4334('0x3c')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x4334('0x40'),squel[_0x4334('0x36')]()[_0x4334('0x37')](_0x4334('0x46'))[_0x4334('0x3a')]('cm_hopper_final')['where'](_0x23fe68+_0x4334('0x41'),_0x2c83b9['id']['toString']()))[_0x4334('0x3c')](_0x4334('0x40'),squel[_0x4334('0x36')]()[_0x4334('0x37')]('phone')[_0x4334('0x3a')](_0x4334('0x30'))[_0x4334('0x3c')](_0x23fe68+_0x4334('0x41'),_0x2c83b9['id'][_0x4334('0x3f')]())))['toString']();return _0x302d57;};function _0x25c2a5(_0x4f8d26,_0x306c00){var _0x2f8ce8=squel['insert']()[_0x4334('0x43')](_0x4334('0x30'))[_0x4334('0x31')](['phone',_0x4334('0x33'),'ContactId',_0x4334('0x21'),_0x306c00,_0x4334('0x35'),_0x4334('0x39')],squel[_0x4334('0x36')]()[_0x4334('0x37')](_0x4334('0x32'),_0x4334('0x32'))['field'](_0x4334('0x38'),_0x4334('0x33'))[_0x4334('0x37')]('id',_0x4334('0x34'))['field'](LISTID[_0x4334('0x3f')](),_0x4334('0x21'))['field'](_0x4f8d26['id']['toString'](),_0x306c00)['field'](_0x4334('0x38'),_0x4334('0x35'))[_0x4334('0x37')](_0x4334('0x38'),'updatedAt')[_0x4334('0x3a')](_0x4334('0x3b'))[_0x4334('0x3c')](_0x4334('0x3d'))['where'](_0x4334('0x3e'),LISTID[_0x4334('0x3f')]())[_0x4334('0x3c')](_0x4334('0x44'),squel['str'](hopperContacts))['where'](_0x4334('0x47')))[_0x4334('0x3f')]();return _0x2f8ce8;}function _0x449764(_0x88067b,_0x4400d4){var _0x48b961=squel['insert']()[_0x4334('0x43')]('cm_hopper_black')[_0x4334('0x31')](['phone',_0x4334('0x34'),_0x4334('0x21'),_0x4400d4,'createdAt',_0x4334('0x39')],squel[_0x4334('0x36')]()[_0x4334('0x37')]('phone',_0x4334('0x32'))['field']('id',_0x4334('0x34'))[_0x4334('0x37')](LISTID[_0x4334('0x3f')](),_0x4334('0x21'))[_0x4334('0x37')](_0x88067b['id'][_0x4334('0x3f')](),_0x4400d4)[_0x4334('0x37')](_0x4334('0x38'),_0x4334('0x35'))[_0x4334('0x37')](_0x4334('0x38'),'updatedAt')['from'](_0x4334('0x3b'))[_0x4334('0x3c')](_0x4334('0x3d'))['where'](_0x4334('0x3e'),LISTID['toString']())[_0x4334('0x3c')](_0x4334('0x44'),squel[_0x4334('0x45')](hopperContacts))[_0x4334('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x48b961;}return db[_0x4334('0x48')][_0x4334('0x49')]({'where':{'type':_0x4334('0x4a')},'attributes':['id',_0x4334('0x4b')],'include':[{'model':db[_0x4334('0x4c')],'as':_0x4334('0x4d'),'where':{'id':LISTID}}]})[_0x4334('0x28')](function(_0x1be1e9){var _0x57ff1f=[];if(_0x1be1e9){var _0x29e9f8;for(var _0x403f4c=0x0,_0x59f8e6;_0x403f4c<_0x1be1e9[_0x4334('0x17')];_0x403f4c+=0x1){_0x59f8e6=_0x1be1e9[_0x403f4c][_0x4334('0x4e')]({'plain':!![]});switch(_0x59f8e6[_0x4334('0x4b')]){case _0x4334('0x4f'):_0x57ff1f[_0x4334('0x50')](db[_0x4334('0x51')][_0x4334('0x52')](_0x171fef(_0x59f8e6,'VoiceQueueId'))['then'](function(){})[_0x4334('0x2a')](_0x2cdad2()));break;case _0x4334('0x53'):_0x57ff1f['push'](db[_0x4334('0x51')][_0x4334('0x52')](_0x4b56ff(_0x59f8e6,'VoiceQueueId'))[_0x4334('0x28')](function(){})[_0x4334('0x2a')](_0x2cdad2()));break;default:_0x57ff1f[_0x4334('0x50')](db[_0x4334('0x51')][_0x4334('0x52')](_0x25c2a5(_0x59f8e6,'VoiceQueueId'))['then'](function(){})[_0x4334('0x2a')](_0x2cdad2()));}}}return _0x57ff1f;})[_0x4334('0x54')]()[_0x4334('0x28')](function(){return db[_0x4334('0x48')]['findAll']({'where':{'type':_0x4334('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0xd4b07f){var _0x351775=[];if(_0xd4b07f){var _0x1ebea9;for(var _0x35bc28=0x0,_0x2b22bb;_0x35bc28<_0xd4b07f['length'];_0x35bc28+=0x1){_0x2b22bb=_0xd4b07f[_0x35bc28][_0x4334('0x4e')]({'plain':!![]});_0x351775[_0x4334('0x50')](db[_0x4334('0x51')][_0x4334('0x52')](_0x449764(_0x2b22bb,_0x4334('0x55')))[_0x4334('0x28')](function(){})['catch'](_0x2cdad2()));}}return _0x351775;})['all']();})['then'](function(){return db[_0x4334('0x56')]['findAll']({'attributes':['id',_0x4334('0x4b')],'include':[{'model':db['CmList'],'as':_0x4334('0x4d'),'where':{'id':LISTID}}]})[_0x4334('0x28')](function(_0x2d8561){var _0x3547a3=[];if(_0x2d8561){for(var _0x11afc7=0x0,_0x5b6dd6;_0x11afc7<_0x2d8561[_0x4334('0x17')];_0x11afc7+=0x1){_0x5b6dd6=_0x2d8561[_0x11afc7][_0x4334('0x4e')]({'plain':!![]});switch(_0x5b6dd6[_0x4334('0x4b')]){case _0x4334('0x4f'):_0x3547a3['push'](db[_0x4334('0x51')]['query'](_0x171fef(_0x5b6dd6,_0x4334('0x57')))['then'](function(){})[_0x4334('0x2a')](_0x2cdad2()));break;case _0x4334('0x53'):_0x3547a3['push'](db[_0x4334('0x51')][_0x4334('0x52')](_0x4b56ff(_0x5b6dd6,_0x4334('0x57')))[_0x4334('0x28')](function(){})[_0x4334('0x2a')](_0x2cdad2()));break;default:_0x3547a3[_0x4334('0x50')](db[_0x4334('0x51')]['query'](_0x25c2a5(_0x5b6dd6,_0x4334('0x57')))[_0x4334('0x28')](function(){})[_0x4334('0x2a')](_0x2cdad2()));}}}return _0x3547a3;})[_0x4334('0x54')]();})[_0x4334('0x28')](function(){return db[_0x4334('0x56')][_0x4334('0x49')]({'attributes':['id'],'include':[{'model':db[_0x4334('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x4334('0x28')](function(_0x17332a){var _0x4ba453=[];if(_0x17332a){for(var _0x1590c6=0x0,_0x40112a;_0x1590c6<_0x17332a[_0x4334('0x17')];_0x1590c6+=0x1){_0x40112a=_0x17332a[_0x1590c6][_0x4334('0x4e')]({'plain':!![]});_0x4ba453[_0x4334('0x50')](db[_0x4334('0x51')]['query'](_0x449764(_0x40112a,'CampaignId'))['then'](function(){})['catch'](_0x2cdad2()));}}return _0x4ba453;})[_0x4334('0x54')]();})[_0x4334('0x2a')](function(_0x25fe42){logger[_0x4334('0x11')](_0x4334('0x58'),_0x4334('0x59'),_0x25fe42[_0x4334('0x19')]);});}var processPromises=function(_0x30160a){return BPromise[_0x4334('0x54')](promises)[_0x4334('0x28')](function(_0x5c1e9e){})['catch'](function(_0x3b2432){logger[_0x4334('0x11')](_0x4334('0x5a'),JSON[_0x4334('0x2c')](_0x3b2432));})[_0x4334('0x5b')](function(){socket[_0x4334('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x30160a){return _0x30160a[_0x4334('0x5d')]();}});};var endCsv=function(){return BPromise[_0x4334('0x5e')]()[_0x4334('0x28')](function(){if(hopperContacts){return checkHopper();}})[_0x4334('0x28')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x91433e){logger[_0x4334('0x11')](_0x4334('0x5f'),JSON[_0x4334('0x2c')](_0x91433e));}finally{process[_0x4334('0x60')](0x0);}});};process['on'](_0x4334('0x61'),function(){logger[_0x4334('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x4334('0x5e')]()[_0x4334('0x28')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x4334('0x25')][_0x4334('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4334('0x28')](function(_0x2d0c7b){var _0x2eb347=fs[_0x4334('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4334('0x64')](_0x2eb347,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4dee96,_0x113704){total+=0x1;var _0x39b6f6=total;promises['push'](checkRow(_0x4dee96,_0x2d0c7b,_0x39b6f6)['then'](function(){success+=0x1;})['catch'](function(_0x3eae62){if(_0x3eae62[_0x4334('0x11')]){errors+=0x1;delete _0x3eae62[_0x4334('0x11')];}else if(_0x3eae62[_0x4334('0x24')]){duplicates+=0x1;delete _0x3eae62[_0x4334('0x24')];}rows[_0x4334('0x50')](_0x3eae62);}));if(total%0xc8===0x0){_0x113704[_0x4334('0x65')]();return processPromises(_0x113704);}},'complete':function(){return processPromises()[_0x4334('0x28')](function(){logger[_0x4334('0x62')](_0x4334('0x66'));endCsv();});},'error':function(_0x3466a0,_0x3279c){logger['info'](_0x4334('0x67'),JSON[_0x4334('0x2c')](_0x3466a0));endCsv();}});})[_0x4334('0x2a')](function(_0x3e1c52){logger['error'](_0x4334('0x68'),JSON[_0x4334('0x2c')](_0x3e1c52));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5ee0388..83a8f43 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 _0xb598=['util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','updatedAt','select','\x20=\x20?','keys','CompanyId','fromQuery','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','message','errors','push','code','query','spread','error','stringify','send','start','socket_timestamp','.csv','header','writeFileSync','parse','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','length','cm_contacts_','CREATE\x20TABLE\x20','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns','then','affectedRows','unlink','exit','catch','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse'];(function(_0x1a92cd,_0x3b6c8f){var _0x141605=function(_0x399c21){while(--_0x399c21){_0x1a92cd['push'](_0x1a92cd['shift']());}};_0x141605(++_0x3b6c8f);}(_0xb598,0x10e));var _0x8b59=function(_0x2808b0,_0x26a025){_0x2808b0=_0x2808b0-0x0;var _0x5c21ee=_0xb598[_0x2808b0];return _0x5c21ee;};'use strict';var fs=require('fs');var path=require(_0x8b59('0x0'));var _=require('lodash');var Papa=require(_0x8b59('0x1'));var util=require(_0x8b59('0x2'));var BPromise=require(_0x8b59('0x3'));var moment=require('moment');var squel=require(_0x8b59('0x4'));var Redis=require(_0x8b59('0x5'));var db=require(_0x8b59('0x6'))['db'];var config=require(_0x8b59('0x7'));var logger=require(_0x8b59('0x8'))(_0x8b59('0x9'));config['redis']=_[_0x8b59('0xa')](config[_0x8b59('0xb')],{'host':_0x8b59('0xc'),'port':0x18eb});var socket=require(_0x8b59('0xd'))(new Redis(config[_0x8b59('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x8b59('0xe'));function isEmail(_0x344080){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))*$/[_0x8b59('0xf')](_0x344080);}function selectNotIn(_0x14281c,_0x2e9298,_0x567671,_0x16eea1,_0x3d7dd8){return squel['select']()[_0x8b59('0x10')](_0x8b59('0x11'))[_0x8b59('0x12')](_0x16eea1)[_0x8b59('0x13')](_0x2e9298,null,_0x2e9298+'.id\x20=\x20'+_0x16eea1+'.'+_0x567671)[_0x8b59('0x14')](_0x16eea1+'.'+_0x567671+'\x20=\x20'+_0x14281c+'.'+_0x567671)[_0x8b59('0x14')](_0x2e9298+_0x8b59('0x15')+_0x3d7dd8['join']()+')');}function insertCmHopper(_0x141f29,_0x2c522c,_0x40009e,_0x5b81dd,_0x20cc94){var _0x1d69df=[_0x8b59('0x16'),_0x8b59('0x17'),_0x8b59('0x18'),_0x8b59('0x19'),_0x2c522c+'.'+_0x5b81dd,_0x8b59('0x1a'),_0x8b59('0x1b'),_0x8b59('0x1c'),_0x8b59('0x1d'),'\x22'+_0x20cc94+'\x22'];return squel[_0x8b59('0x1e')]()[_0x8b59('0x1f')](_0x8b59('0x20'))['fromQuery']([_0x8b59('0x11'),_0x8b59('0x21'),_0x8b59('0x22'),_0x8b59('0x23'),_0x5b81dd,_0x8b59('0x24'),'updatedAt','priority',_0x8b59('0x25'),_0x8b59('0x26')],squel['select']()[_0x8b59('0x27')](_0x1d69df)['from'](_0x2c522c)[_0x8b59('0x13')](_0x8b59('0x28'),null,_0x8b59('0x29')+_0x2c522c+_0x8b59('0x2a'))['join'](_0x40009e,null,_0x40009e+_0x8b59('0x2b')+_0x2c522c+'.'+_0x5b81dd)['where'](_0x2c522c+_0x8b59('0x2c'),_0x141f29)[_0x8b59('0x14')](_0x8b59('0x2d'),NOW)[_0x8b59('0x14')](_0x8b59('0x2e'),selectNotIn(_0x2c522c,_0x40009e,_0x5b81dd,_0x8b59('0x20'),[_0x8b59('0x2f'),_0x8b59('0x30')]))[_0x8b59('0x14')](_0x8b59('0x2e'),selectNotIn(_0x2c522c,_0x40009e,_0x5b81dd,'cm_hopper',[_0x8b59('0x2f')])))[_0x8b59('0x31')]();}function insertCmHopperBlack(_0x4f1c0c,_0x380db9,_0x4cae7b,_0x1b34b5){var _0x15b572=[_0x8b59('0x16'),_0x8b59('0x18'),'cm_contacts.ListId',_0x380db9+'.'+_0x1b34b5,'cm_contacts.createdAt',_0x8b59('0x1b')];return squel[_0x8b59('0x1e')]()[_0x8b59('0x1f')](_0x8b59('0x32'))['fromQuery']([_0x8b59('0x11'),'ContactId',_0x8b59('0x23'),_0x1b34b5,'createdAt',_0x8b59('0x33')],squel[_0x8b59('0x34')]()['fields'](_0x15b572)['from'](_0x380db9)['join']('cm_contacts',null,_0x8b59('0x29')+_0x380db9+_0x8b59('0x2a'))['join'](_0x4cae7b,null,_0x4cae7b+_0x8b59('0x2b')+_0x380db9+'.'+_0x1b34b5)[_0x8b59('0x14')](_0x380db9+_0x8b59('0x2c'),_0x4f1c0c)[_0x8b59('0x14')](_0x8b59('0x2d'),NOW)[_0x8b59('0x14')](_0x8b59('0x2e'),squel[_0x8b59('0x34')]()[_0x8b59('0x10')](_0x8b59('0x11'))['from']('cm_hopper_black')[_0x8b59('0x14')]('ListId\x20=\x20?',_0x4f1c0c)[_0x8b59('0x14')](_0x1b34b5+_0x8b59('0x35'),_0x380db9+'.'+_0x1b34b5)))[_0x8b59('0x31')]();}function insertCmContact(_0xd854b4,_0x52ca14,_0x525aa2,_0x1522f1){var _0x3d9d95=_['concat'](_[_0x8b59('0x36')](_0x1522f1),[_0x8b59('0x23'),_0x8b59('0x37'),_0x8b59('0x24'),_0x8b59('0x33')]);return squel[_0x8b59('0x1e')]()['into'](_0x8b59('0x28'))[_0x8b59('0x38')](_0x3d9d95,squel[_0x8b59('0x34')]()['fields'](_0x3d9d95)['from'](_0x52ca14)[_0x8b59('0x14')]('('+_0x525aa2[_0x8b59('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x8b59('0x34')]()[_0x8b59('0x27')](_0x525aa2)[_0x8b59('0x12')](_0x8b59('0x28'))[_0x8b59('0x14')](_0x8b59('0x39'),_0xd854b4)[_0x8b59('0x14')](_0x8b59('0x3a')))[_0x8b59('0x14')](_0x8b59('0x3b'),squel[_0x8b59('0x34')]()['field'](_0x8b59('0x3c'),_0x8b59('0x3d'))[_0x8b59('0x12')](_0x52ca14)['group'](_0x525aa2['join'](','))))['toString']();}function handleStop(){logger[_0x8b59('0x3e')](_0x8b59('0x3f'));stopped=!![];}function handleUncaughtException(_0x24314c){logger['error'](_0x24314c[_0x8b59('0x40')]);process['exit'](0x1);}function handleError(_0x128afc,_0x50dce8){stats[_0x8b59('0x41')][_0x8b59('0x42')]({'name':_0x50dce8[_0x8b59('0x43')],'message':_0x50dce8['message'],'row':_0x128afc});}function handleQuery(_0x22a75b){logger[_0x8b59('0x3e')](_0x22a75b);return db['sequelize'][_0x8b59('0x44')](_0x22a75b)[_0x8b59('0x45')](function(_0x5a5bcb){results[_0x8b59('0x42')](_0x5a5bcb);})['catch'](function(_0x12e73e){logger[_0x8b59('0x46')](_0x12e73e[_0x8b59('0x40')]);});}function main(_0x28a39f,_0x3ebbaf,_0x51dc4a,_0x55444f){logger[_0x8b59('0x3e')]('main',_0x28a39f,JSON[_0x8b59('0x47')](_0x3ebbaf));process[_0x8b59('0x48')](_0x8b59('0x49'));var _0xf3118d=_0x3ebbaf['binding'];var _0x24705a=_0x3ebbaf[_0x8b59('0x4a')];var _0x35028d=path[_0x8b59('0x13')](config['root'],'server/files/tmp',_0x24705a+_0x8b59('0x4b'));var _0x24e04a=_[_0x8b59('0x36')](_0xf3118d)[_0x8b59('0x13')]();logger[_0x8b59('0x3e')](_0x8b59('0x4c'),_0x24e04a);fs[_0x8b59('0x4d')](_0x35028d,_0x24e04a+'\x0a');Papa[_0x8b59('0x4e')](fs['createReadStream'](_0x28a39f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x49fffc,_0x2d126f){try{for(var _0x3d3855=0x0,_0x1ec794=[];_0x3d3855<_0x49fffc[_0x8b59('0x4f')]['length'];_0x3d3855++){stats['rows']+=0x1;if(_0x49fffc[_0x8b59('0x41')][_0x3d3855]){handleError(_0x49fffc[_0x8b59('0x4f')][_0x3d3855],_0x49fffc['errors'][_0x3d3855]);}else{var _0x5e2bf6=[];for(var _0x47f66f in _0xf3118d){if(_0xf3118d[_0x8b59('0x50')](_0x47f66f)){if(_0x49fffc[_0x8b59('0x4f')][_0x3d3855][_0xf3118d[_0x47f66f]]){var _0x35fd9b=_[_0x8b59('0x51')](_0x49fffc[_0x8b59('0x4f')][_0x3d3855][_0xf3118d[_0x47f66f]][_0x8b59('0x52')](/"/g,'\x27'));switch(_0x47f66f){case _0x8b59('0x21'):var _0x330de1=moment(_0x35fd9b,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x330de1[_0x8b59('0x53')]()){_0x1ec794[_0x8b59('0x42')]('\x22'+_0x35fd9b+'\x22');}else{_0x5e2bf6[_0x8b59('0x42')](_0x8b59('0x54'));}break;case _0x8b59('0x55'):var _0x23f704=parseInt(_0x35fd9b);_0x35fd9b=_['isNaN'](_0x23f704)||_0x23f704<0x0||_0x23f704>0x4?_0x55444f?0x3:0x2:_0x23f704;_0x1ec794[_0x8b59('0x42')]('\x22'+_0x35fd9b+'\x22');break;case'UserId':var _0x299f7b=parseInt(_0x35fd9b);if(_[_0x8b59('0x56')](_0x299f7b)&&_[_0x8b59('0x57')](_0x51dc4a,_0x299f7b)){_0x1ec794[_0x8b59('0x42')]('\x22'+_0x299f7b+'\x22');}else{_0x5e2bf6[_0x8b59('0x42')](_0x8b59('0x58'));}break;case _0x8b59('0x59'):if(isEmail(_0x35fd9b)){_0x1ec794[_0x8b59('0x42')]('\x22'+_0x35fd9b+'\x22');}else{_0x5e2bf6['push'](_0x8b59('0x5a'));}break;case _0x8b59('0x5b'):var _0x3da372=moment(_0x35fd9b,_0x8b59('0x5c'),!![]);if(_0x3da372[_0x8b59('0x53')]()){_0x1ec794['push']('\x22'+_0x35fd9b+'\x22');}else{_0x5e2bf6[_0x8b59('0x42')](_0x8b59('0x5d'));}break;default:_0x1ec794['push']('\x22'+_0x35fd9b+'\x22');}}else{switch(_0x47f66f){case'firstName':case'phone':_0x5e2bf6[_0x8b59('0x42')](_0x47f66f+_0x8b59('0x5e'));break;default:_0x1ec794[_0x8b59('0x42')]('\x22\x22');}}}}if(_0x5e2bf6['length']){handleError(_0x49fffc[_0x8b59('0x4f')][_0x3d3855],{'code':_0x8b59('0x5f'),'message':_0x5e2bf6['join']()});}else{fs[_0x8b59('0x60')](_0x35028d,_0x1ec794['join']()+'\x0a');}_0x1ec794=[];}if(!(stats['rows']%0xc8)){socket[_0x8b59('0x61')](_0x8b59('0x62')+_0x24705a,stats);stats['errors']=[];}}if(stopped){logger[_0x8b59('0x3e')](_0x8b59('0x63'));_0x2d126f['abort']();}}catch(_0x34c996){handleError(_0x49fffc[_0x8b59('0x4f')][_0x3d3855],{'code':_0x8b59('0x64'),'message':_0x34c996[_0x8b59('0x40')]});logger['error'](_0x8b59('0x65'),_0x34c996[_0x8b59('0x40')]);}},'complete':function(){try{var _0x5aabb0=[];var _0x4f8377=_0x8b59('0x28');if(_0x3ebbaf['duplicates']&&_0x3ebbaf[_0x8b59('0x66')][_0x8b59('0x67')]){_0x4f8377=_0x8b59('0x68')+_0x24705a;_0x5aabb0['push'](_0x8b59('0x69')+_0x4f8377+'\x20LIKE\x20cm_contacts;');}var _0x45805e=util[_0x8b59('0x6a')](_0x8b59('0x6b'),_0x35028d,_0x4f8377,_0x24e04a,_0x3ebbaf[_0x8b59('0x23')],_0x3ebbaf['CompanyId']||null,NOW,NOW);if(_[_0x8b59('0x6c')](_0xf3118d['scheduledat'])){_0x45805e+=_0x8b59('0x6d');}_0x5aabb0[_0x8b59('0x42')](_0x45805e);if(_0x3ebbaf['duplicates']&&_0x3ebbaf[_0x8b59('0x66')][_0x8b59('0x67')]){_0x5aabb0[_0x8b59('0x42')](insertCmContact(_0x3ebbaf[_0x8b59('0x23')],_0x4f8377,_0x3ebbaf[_0x8b59('0x66')],_0xf3118d));_0x5aabb0['push'](_0x8b59('0x6e')+_0x4f8377+';');}_0x5aabb0[_0x8b59('0x42')](insertCmHopper(_0x3ebbaf[_0x8b59('0x23')],'voice_queues_has_cm_lists',_0x8b59('0x6f'),_0x8b59('0x70'),_0x55444f));_0x5aabb0[_0x8b59('0x42')](insertCmHopperBlack(_0x3ebbaf[_0x8b59('0x23')],'voice_queues_has_cm_blacklists',_0x8b59('0x6f'),'VoiceQueueId'));_0x5aabb0[_0x8b59('0x42')](insertCmHopper(_0x3ebbaf[_0x8b59('0x23')],_0x8b59('0x71'),'campaigns',_0x8b59('0x72'),_0x55444f));_0x5aabb0[_0x8b59('0x42')](insertCmHopperBlack(_0x3ebbaf[_0x8b59('0x23')],'campaigns_has_cm_blacklists',_0x8b59('0x73'),_0x8b59('0x72')));BPromise['each'](_0x5aabb0,handleQuery)[_0x8b59('0x74')](function(_0x5b1411){stats['finish']=!![];stats['affectedRows']=_0x3ebbaf[_0x8b59('0x66')]&&_0x3ebbaf[_0x8b59('0x66')][_0x8b59('0x67')]?results[0x2][_0x8b59('0x75')]:results[0x0][_0x8b59('0x75')];socket[_0x8b59('0x61')]('contact:import:'+_0x24705a,stats);fs[_0x8b59('0x76')](_0x28a39f);fs[_0x8b59('0x76')](_0x35028d);process[_0x8b59('0x77')](0x0);})[_0x8b59('0x78')](function(_0x4cef7f){logger[_0x8b59('0x46')](_0x4cef7f[_0x8b59('0x40')]);process[_0x8b59('0x77')](0x1);});}catch(_0x4cf132){logger[_0x8b59('0x46')](_0x8b59('0x79'),_0x4cf132['message']);process[_0x8b59('0x77')](0x1);}},'error':function(_0x383a4b,_0x59a019,_0x166793,_0xca9224){throw new Error(_0xca9224);}});}function validate(){if(process[_0x8b59('0x7a')]&&process['argv'][_0x8b59('0x67')]<0x4){throw new Error(_0x8b59('0x7b'));}var _0x4c87aa=path['join'](config['root'],_0x8b59('0x7c'),process[_0x8b59('0x7a')][0x2]);if(!fs[_0x8b59('0x7d')](_0x4c87aa)){throw new Error(_0x8b59('0x7e'));}var _0x39f805={};try{_0x39f805=JSON[_0x8b59('0x4e')](process[_0x8b59('0x7a')][0x3]);if(!_0x39f805[_0x8b59('0x7f')]){throw new Error(_0x8b59('0x80'));}if(!_0x39f805[_0x8b59('0x7f')][_0x8b59('0x11')]){throw new Error(_0x8b59('0x81'));}if(!_0x39f805[_0x8b59('0x7f')][_0x8b59('0x82')]){throw new Error(_0x8b59('0x83'));}var _0x54d2ef=0x0;if(_0x39f805[_0x8b59('0x7f')]['UserId']){_0x54d2ef=0x1;}if(!_0x39f805['ListId']){throw new Error(_0x8b59('0x84'));}}catch(_0x13fc31){throw new Error('body\x20id\x20mandatory');}var _0x37d562=[];try{_0x37d562=_['map'](JSON[_0x8b59('0x4e')](process[_0x8b59('0x7a')][0x4]),'id');}catch(_0x4a3245){logger['info'](_0x8b59('0x85'));}main(_0x4c87aa,_0x39f805,_0x37d562,_0x54d2ef);}validate();process['on'](_0x8b59('0x86'),handleStop);process['on'](_0x8b59('0x87'),handleUncaughtException); \ No newline at end of file +var _0x5dea=['email\x20wrong\x20format','dateOfBirth','\x20not\x20specified','SystemRow','appendFileSync','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','affectedRows','contact:import:','unlink','exit','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','path','papaparse','util','moment','squel','ioredis','../../../config/environment','../../../config/logger','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','into','fromQuery','scheduledat','ContactId','createdAt','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.updatedAt','cm_hopper_black','phone','ListId','updatedAt','field','ListId\x20=\x20?','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','info','Received\x20SIGINT','error','message','errors','push','sequelize','query','spread','catch','main','stringify','send','start','socket_timestamp','header','writeFileSync','parse','createReadStream','length','rows','data','hasOwnProperty','trim','replace','isValid','priority','isNaN','isNumber','agent\x20not\x20exists'];(function(_0xfecfef,_0x13f6b5){var _0x5d6ace=function(_0x46d208){while(--_0x46d208){_0xfecfef['push'](_0xfecfef['shift']());}};_0x5d6ace(++_0x13f6b5);}(_0x5dea,0x12b));var _0xa5de=function(_0x5db7ec,_0x368c90){_0x5db7ec=_0x5db7ec-0x0;var _0x20b568=_0x5dea[_0x5db7ec];return _0x20b568;};'use strict';var fs=require('fs');var path=require(_0xa5de('0x0'));var _=require('lodash');var Papa=require(_0xa5de('0x1'));var util=require(_0xa5de('0x2'));var BPromise=require('bluebird');var moment=require(_0xa5de('0x3'));var squel=require(_0xa5de('0x4'));var Redis=require(_0xa5de('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xa5de('0x6'));var logger=require(_0xa5de('0x7'))('import');config['redis']=_[_0xa5de('0x8')](config[_0xa5de('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5de('0xa'))(new Redis(config[_0xa5de('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa5de('0xb')](_0xa5de('0xc'));function isEmail(_0x1902f5){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))*$/[_0xa5de('0xd')](_0x1902f5);}function selectNotIn(_0x320f3c,_0xc405b4,_0x36fb11,_0x1063a9,_0x88057e){return squel[_0xa5de('0xe')]()['field']('phone')[_0xa5de('0xf')](_0x1063a9)['join'](_0xc405b4,null,_0xc405b4+_0xa5de('0x10')+_0x1063a9+'.'+_0x36fb11)[_0xa5de('0x11')](_0x1063a9+'.'+_0x36fb11+'\x20=\x20'+_0x320f3c+'.'+_0x36fb11)[_0xa5de('0x11')](_0xc405b4+_0xa5de('0x12')+_0x88057e[_0xa5de('0x13')]()+')');}function insertCmHopper(_0x9caed6,_0x142242,_0x3bcaad,_0x2a614b,_0x33ac24){var _0x4709c1=['cm_contacts.phone',_0xa5de('0x14'),_0xa5de('0x15'),_0xa5de('0x16'),_0x142242+'.'+_0x2a614b,_0xa5de('0x17'),'cm_contacts.updatedAt',_0xa5de('0x18'),'cm_contacts.UserId','\x22'+_0x33ac24+'\x22'];return squel[_0xa5de('0x19')]()[_0xa5de('0x1a')]('cm_hopper')[_0xa5de('0x1b')](['phone',_0xa5de('0x1c'),_0xa5de('0x1d'),'ListId',_0x2a614b,_0xa5de('0x1e'),'updatedAt','priority',_0xa5de('0x1f'),'recallme'],squel[_0xa5de('0xe')]()[_0xa5de('0x20')](_0x4709c1)['from'](_0x142242)[_0xa5de('0x13')](_0xa5de('0x21'),null,_0xa5de('0x22')+_0x142242+_0xa5de('0x23'))[_0xa5de('0x13')](_0x3bcaad,null,_0x3bcaad+_0xa5de('0x10')+_0x142242+'.'+_0x2a614b)[_0xa5de('0x11')](_0x142242+_0xa5de('0x24'),_0x9caed6)['where'](_0xa5de('0x25'),NOW)[_0xa5de('0x11')](_0xa5de('0x26'),selectNotIn(_0x142242,_0x3bcaad,_0x2a614b,_0xa5de('0x27'),[_0xa5de('0x28'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x142242,_0x3bcaad,_0x2a614b,_0xa5de('0x27'),[_0xa5de('0x28')])))[_0xa5de('0x29')]();}function insertCmHopperBlack(_0x195fab,_0x308d93,_0x23bc8c,_0x2e987e){var _0x2f754c=['cm_contacts.phone',_0xa5de('0x15'),_0xa5de('0x16'),_0x308d93+'.'+_0x2e987e,_0xa5de('0x17'),_0xa5de('0x2a')];return squel[_0xa5de('0x19')]()[_0xa5de('0x1a')](_0xa5de('0x2b'))[_0xa5de('0x1b')]([_0xa5de('0x2c'),_0xa5de('0x1d'),_0xa5de('0x2d'),_0x2e987e,'createdAt',_0xa5de('0x2e')],squel[_0xa5de('0xe')]()[_0xa5de('0x20')](_0x2f754c)[_0xa5de('0xf')](_0x308d93)[_0xa5de('0x13')](_0xa5de('0x21'),null,'cm_contacts.ListId\x20=\x20'+_0x308d93+_0xa5de('0x23'))[_0xa5de('0x13')](_0x23bc8c,null,_0x23bc8c+_0xa5de('0x10')+_0x308d93+'.'+_0x2e987e)[_0xa5de('0x11')](_0x308d93+_0xa5de('0x24'),_0x195fab)[_0xa5de('0x11')](_0xa5de('0x25'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xa5de('0xe')]()[_0xa5de('0x2f')](_0xa5de('0x2c'))[_0xa5de('0xf')](_0xa5de('0x2b'))[_0xa5de('0x11')](_0xa5de('0x30'),_0x195fab)[_0xa5de('0x11')](_0x2e987e+'\x20=\x20?',_0x308d93+'.'+_0x2e987e)))[_0xa5de('0x29')]();}function insertCmContact(_0x40c35a,_0x462b08,_0x36fc56,_0x1e7d3e){var _0x36ca12=_[_0xa5de('0x31')](_[_0xa5de('0x32')](_0x1e7d3e),[_0xa5de('0x2d'),_0xa5de('0x33'),_0xa5de('0x1e'),_0xa5de('0x2e')]);return squel[_0xa5de('0x19')]()['into'](_0xa5de('0x21'))[_0xa5de('0x1b')](_0x36ca12,squel['select']()[_0xa5de('0x20')](_0x36ca12)['from'](_0x462b08)[_0xa5de('0x11')]('('+_0x36fc56[_0xa5de('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0xa5de('0xe')]()[_0xa5de('0x20')](_0x36fc56)[_0xa5de('0xf')]('cm_contacts')[_0xa5de('0x11')]('ListId\x20=\x20?',_0x40c35a)[_0xa5de('0x11')](_0xa5de('0x34')))['where'](_0xa5de('0x35'),squel[_0xa5de('0xe')]()[_0xa5de('0x2f')]('MIN(id)',_0xa5de('0x36'))['from'](_0x462b08)['group'](_0x36fc56['join'](','))))['toString']();}function handleStop(){logger[_0xa5de('0x37')](_0xa5de('0x38'));stopped=!![];}function handleUncaughtException(_0x45bfa7){logger[_0xa5de('0x39')](_0x45bfa7[_0xa5de('0x3a')]);process['exit'](0x1);}function handleError(_0x308aff,_0x3fa6e8){stats[_0xa5de('0x3b')][_0xa5de('0x3c')]({'name':_0x3fa6e8['code'],'message':_0x3fa6e8[_0xa5de('0x3a')],'row':_0x308aff});}function handleQuery(_0x618c7a){logger[_0xa5de('0x37')](_0x618c7a);return db[_0xa5de('0x3d')][_0xa5de('0x3e')](_0x618c7a)[_0xa5de('0x3f')](function(_0x515035){results[_0xa5de('0x3c')](_0x515035);})[_0xa5de('0x40')](function(_0x8d74e8){logger[_0xa5de('0x39')](_0x8d74e8[_0xa5de('0x3a')]);});}function main(_0x58c9ce,_0x3390e3,_0x285cf4,_0x463617){logger['info'](_0xa5de('0x41'),_0x58c9ce,JSON[_0xa5de('0x42')](_0x3390e3));process[_0xa5de('0x43')](_0xa5de('0x44'));var _0xdbc6b=_0x3390e3['binding'];var _0x51ba48=_0x3390e3[_0xa5de('0x45')];var _0x3cec00=path['join'](config['root'],'server/files/tmp',_0x51ba48+'.csv');var _0x3c455c=_[_0xa5de('0x32')](_0xdbc6b)['join']();logger[_0xa5de('0x37')](_0xa5de('0x46'),_0x3c455c);fs[_0xa5de('0x47')](_0x3cec00,_0x3c455c+'\x0a');Papa[_0xa5de('0x48')](fs[_0xa5de('0x49')](_0x58c9ce),{'header':!![],'skipEmptyLines':!![],'step':function(_0x30f2b6,_0x5787e0){try{for(var _0x2dc0ea=0x0,_0x4f0276=[];_0x2dc0ea<_0x30f2b6['data'][_0xa5de('0x4a')];_0x2dc0ea++){stats[_0xa5de('0x4b')]+=0x1;if(_0x30f2b6[_0xa5de('0x3b')][_0x2dc0ea]){handleError(_0x30f2b6[_0xa5de('0x4c')][_0x2dc0ea],_0x30f2b6[_0xa5de('0x3b')][_0x2dc0ea]);}else{var _0x196185=[];for(var _0xb2d353 in _0xdbc6b){if(_0xdbc6b[_0xa5de('0x4d')](_0xb2d353)){if(_0x30f2b6['data'][_0x2dc0ea][_0xdbc6b[_0xb2d353]]){var _0x350a38=_[_0xa5de('0x4e')](_0x30f2b6[_0xa5de('0x4c')][_0x2dc0ea][_0xdbc6b[_0xb2d353]][_0xa5de('0x4f')](/"/g,'\x27'));switch(_0xb2d353){case _0xa5de('0x1c'):var _0x40a379=moment(_0x350a38,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x40a379[_0xa5de('0x50')]()){_0x4f0276[_0xa5de('0x3c')]('\x22'+_0x350a38+'\x22');}else{_0x196185[_0xa5de('0x3c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa5de('0x51'):var _0x1221cd=parseInt(_0x350a38);_0x350a38=_[_0xa5de('0x52')](_0x1221cd)||_0x1221cd<0x0||_0x1221cd>0x4?_0x463617?0x3:0x2:_0x1221cd;_0x4f0276[_0xa5de('0x3c')]('\x22'+_0x350a38+'\x22');break;case _0xa5de('0x1f'):var _0x40d812=parseInt(_0x350a38);if(_[_0xa5de('0x53')](_0x40d812)&&_['includes'](_0x285cf4,_0x40d812)){_0x4f0276['push']('\x22'+_0x40d812+'\x22');}else{_0x196185[_0xa5de('0x3c')](_0xa5de('0x54'));}break;case'email':if(isEmail(_0x350a38)){_0x4f0276[_0xa5de('0x3c')]('\x22'+_0x350a38+'\x22');}else{_0x196185[_0xa5de('0x3c')](_0xa5de('0x55'));}break;case _0xa5de('0x56'):var _0x59c9a9=moment(_0x350a38,'YYYY-MM-DD',!![]);if(_0x59c9a9['isValid']()){_0x4f0276['push']('\x22'+_0x350a38+'\x22');}else{_0x196185[_0xa5de('0x3c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4f0276[_0xa5de('0x3c')]('\x22'+_0x350a38+'\x22');}}else{switch(_0xb2d353){case'firstName':case _0xa5de('0x2c'):_0x196185['push'](_0xb2d353+_0xa5de('0x57'));break;default:_0x4f0276[_0xa5de('0x3c')]('\x22\x22');}}}}if(_0x196185[_0xa5de('0x4a')]){handleError(_0x30f2b6[_0xa5de('0x4c')][_0x2dc0ea],{'code':_0xa5de('0x58'),'message':_0x196185['join']()});}else{fs[_0xa5de('0x59')](_0x3cec00,_0x4f0276[_0xa5de('0x13')]()+'\x0a');}_0x4f0276=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x51ba48,stats);stats[_0xa5de('0x3b')]=[];}}if(stopped){logger[_0xa5de('0x37')](_0xa5de('0x5a'));_0x5787e0[_0xa5de('0x5b')]();}}catch(_0x144faf){handleError(_0x30f2b6['data'][_0x2dc0ea],{'code':_0xa5de('0x5c'),'message':_0x144faf['message']});logger[_0xa5de('0x39')](_0xa5de('0x5d'),_0x144faf[_0xa5de('0x3a')]);}},'complete':function(){try{var _0x2bf20f=[];var _0x1b3d75=_0xa5de('0x21');if(_0x3390e3[_0xa5de('0x5e')]&&_0x3390e3[_0xa5de('0x5e')]['length']){_0x1b3d75=_0xa5de('0x5f')+_0x51ba48;_0x2bf20f[_0xa5de('0x3c')](_0xa5de('0x60')+_0x1b3d75+_0xa5de('0x61'));}var _0x38faf6=util['format'](_0xa5de('0x62'),_0x3cec00,_0x1b3d75,_0x3c455c,_0x3390e3[_0xa5de('0x2d')],_0x3390e3['CompanyId']||null,NOW,NOW);if(_[_0xa5de('0x63')](_0xdbc6b[_0xa5de('0x1c')])){_0x38faf6+=_0xa5de('0x64');}_0x2bf20f[_0xa5de('0x3c')](_0x38faf6);if(_0x3390e3['duplicates']&&_0x3390e3[_0xa5de('0x5e')][_0xa5de('0x4a')]){_0x2bf20f[_0xa5de('0x3c')](insertCmContact(_0x3390e3[_0xa5de('0x2d')],_0x1b3d75,_0x3390e3[_0xa5de('0x5e')],_0xdbc6b));_0x2bf20f[_0xa5de('0x3c')]('DROP\x20TABLE\x20'+_0x1b3d75+';');}_0x2bf20f[_0xa5de('0x3c')](insertCmHopper(_0x3390e3['ListId'],_0xa5de('0x65'),'voice_queues',_0xa5de('0x66'),_0x463617));_0x2bf20f[_0xa5de('0x3c')](insertCmHopperBlack(_0x3390e3[_0xa5de('0x2d')],_0xa5de('0x67'),_0xa5de('0x68'),_0xa5de('0x66')));_0x2bf20f[_0xa5de('0x3c')](insertCmHopper(_0x3390e3[_0xa5de('0x2d')],_0xa5de('0x69'),_0xa5de('0x6a'),_0xa5de('0x6b'),_0x463617));_0x2bf20f['push'](insertCmHopperBlack(_0x3390e3[_0xa5de('0x2d')],_0xa5de('0x6c'),'campaigns','CampaignId'));BPromise['each'](_0x2bf20f,handleQuery)[_0xa5de('0x6d')](function(_0x45ab70){stats['finish']=!![];stats[_0xa5de('0x6e')]=_0x3390e3[_0xa5de('0x5e')]&&_0x3390e3[_0xa5de('0x5e')][_0xa5de('0x4a')]?results[0x2]['affectedRows']:results[0x0][_0xa5de('0x6e')];socket['emit'](_0xa5de('0x6f')+_0x51ba48,stats);fs['unlink'](_0x58c9ce);fs[_0xa5de('0x70')](_0x3cec00);process[_0xa5de('0x71')](0x0);})['catch'](function(_0x286191){logger[_0xa5de('0x39')](_0x286191[_0xa5de('0x3a')]);process[_0xa5de('0x71')](0x1);});}catch(_0x5809a3){logger[_0xa5de('0x39')](_0xa5de('0x72'),_0x5809a3[_0xa5de('0x3a')]);process[_0xa5de('0x71')](0x1);}},'error':function(_0x50cef5,_0x23ecb4,_0x3a7aec,_0x2be521){throw new Error(_0x2be521);}});}function validate(){if(process[_0xa5de('0x73')]&&process[_0xa5de('0x73')][_0xa5de('0x4a')]<0x4){throw new Error(_0xa5de('0x74'));}var _0x5e0c4d=path[_0xa5de('0x13')](config[_0xa5de('0x75')],_0xa5de('0x76'),process[_0xa5de('0x73')][0x2]);if(!fs[_0xa5de('0x77')](_0x5e0c4d)){throw new Error(_0xa5de('0x78'));}var _0x396194={};try{_0x396194=JSON[_0xa5de('0x48')](process[_0xa5de('0x73')][0x3]);if(!_0x396194[_0xa5de('0x79')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x396194[_0xa5de('0x79')][_0xa5de('0x2c')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x396194[_0xa5de('0x79')][_0xa5de('0x7a')]){throw new Error(_0xa5de('0x7b'));}var _0x41c259=0x0;if(_0x396194['binding'][_0xa5de('0x1f')]){_0x41c259=0x1;}if(!_0x396194[_0xa5de('0x2d')]){throw new Error(_0xa5de('0x7c'));}}catch(_0x1429e2){throw new Error(_0xa5de('0x7d'));}var _0x29770b=[];try{_0x29770b=_['map'](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x364a2a){logger[_0xa5de('0x37')](_0xa5de('0x7e'));}main(_0x5e0c4d,_0x396194,_0x29770b,_0x41c259);}validate();process['on'](_0xa5de('0x7f'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 5c416de..729c791 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfac4=['variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfac4,0x82));var _0x4fac=function(_0x15553a,_0x1d41f5){_0x15553a=_0x15553a-0x0;var _0x1e8b69=_0xfac4[_0x15553a];return _0x1e8b69;};'use strict';exports[_0x4fac('0x0')]=function(_0x18b6f7,_0x533302){var _0xf7472f=[{'type':_0x4fac('0x1'),'content':_0x4fac('0x2'),'variableName':null}];switch(_0x18b6f7[_0x4fac('0x3')]()){case _0x4fac('0x4'):switch(_0x533302[_0x4fac('0x3')]()){case _0x4fac('0x5'):_0xf7472f[_0x4fac('0x6')]({'type':'variable','content':'','variableName':_0x4fac('0x7')});_0xf7472f[_0x4fac('0x6')]({'type':_0x4fac('0x8'),'content':'','variableName':_0x4fac('0x9')});break;case _0x4fac('0xa'):_0xf7472f[_0x4fac('0x6')]({'type':_0x4fac('0x1'),'content':_0x4fac('0xb'),'variableName':null});_0xf7472f[_0x4fac('0x6')]({'type':_0x4fac('0x8'),'content':'','variableName':_0x4fac('0xc')});break;}}return _0xf7472f;};exports[_0x4fac('0xd')]=function(_0x4f04d8,_0x2ea21f){var _0x2b8afc=[];switch(_0x4f04d8[_0x4fac('0x3')]()){case'voice':switch(_0x2ea21f[_0x4fac('0x3')]()){case _0x4fac('0x5'):_0x2b8afc=[{'type':_0x4fac('0x1'),'content':_0x4fac('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x10'),'keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x9')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x11'),'keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x12')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x13'),'keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x14')},{'type':_0x4fac('0xf'),'content':'','key':'Queue','keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x7')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x15'),'keyType':'variable','variableName':_0x4fac('0x16')},{'type':_0x4fac('0xf'),'content':'','key':'Date','keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x17')},{'type':'string','content':_0x4fac('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x4fac('0xf'),'content':'','key':'Agent\x20Name','keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x19')},{'type':_0x4fac('0xf'),'content':'','key':'Agent\x20Number','keyType':_0x4fac('0x8'),'variableName':_0x4fac('0xc')},{'type':'string','content':_0x4fac('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x1b'),'keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x17')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x1c')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x1d'),'keyType':'variable','variableName':_0x4fac('0x1e')},{'type':_0x4fac('0xf'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x4fac('0x1f')},{'type':_0x4fac('0xf'),'content':'','key':'Talk\x20Time','keyType':_0x4fac('0x8'),'variableName':_0x4fac('0x20')}];break;case _0x4fac('0xa'):_0x2b8afc=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x21'),'keyType':_0x4fac('0x8'),'keyContent':'','variableName':_0x4fac('0xc')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x22'),'keyType':_0x4fac('0x8'),'keyContent':'','variableName':_0x4fac('0x23')},{'type':_0x4fac('0xf'),'content':'','key':'UniqueId','keyType':_0x4fac('0x8'),'keyContent':'','variableName':_0x4fac('0x16')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x24'),'keyType':_0x4fac('0x8'),'keyContent':'','variableName':_0x4fac('0x25')},{'type':_0x4fac('0x1'),'content':_0x4fac('0x1a')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x26'),'keyType':_0x4fac('0x8'),'keyContent':'','variableName':_0x4fac('0x27')},{'type':'keyValue','content':'','key':_0x4fac('0x28'),'keyType':'variable','keyContent':'','variableName':_0x4fac('0x29')},{'type':_0x4fac('0xf'),'content':'','key':_0x4fac('0x2a'),'keyType':_0x4fac('0x8'),'keyContent':'','variableName':_0x4fac('0x2b')},{'type':'keyValue','content':'','key':_0x4fac('0x2c'),'keyType':_0x4fac('0x8'),'keyContent':'','variableName':_0x4fac('0x2d')}];break;}}return _0x2b8afc;}; \ No newline at end of file +var _0x0677=['Called\x20Number','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','getSubjects','string','toLowerCase','voice','push','queue','variable','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','calleridname','Call\x20To','Queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentcompleteAt','Hold\x20Time','holdtime','talktime'];(function(_0x5baf32,_0x103278){var _0x539cae=function(_0x43c0c2){while(--_0x43c0c2){_0x5baf32['push'](_0x5baf32['shift']());}};_0x539cae(++_0x103278);}(_0x0677,0x149));var _0x7067=function(_0x1889d2,_0x340dfc){_0x1889d2=_0x1889d2-0x0;var _0x43d542=_0x0677[_0x1889d2];return _0x43d542;};'use strict';exports[_0x7067('0x0')]=function(_0x398f32,_0x4b06e2){var _0x51a980=[{'type':_0x7067('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x398f32[_0x7067('0x2')]()){case _0x7067('0x3'):switch(_0x4b06e2['toLowerCase']()){case'inbound':_0x51a980[_0x7067('0x4')]({'type':'variable','content':'','variableName':_0x7067('0x5')});_0x51a980[_0x7067('0x4')]({'type':_0x7067('0x6'),'content':'','variableName':_0x7067('0x7')});break;case _0x7067('0x8'):_0x51a980[_0x7067('0x4')]({'type':_0x7067('0x1'),'content':'Outbound\x20Call','variableName':null});_0x51a980[_0x7067('0x4')]({'type':_0x7067('0x6'),'content':'','variableName':_0x7067('0x9')});break;}}return _0x51a980;};exports[_0x7067('0xa')]=function(_0x959ded,_0x3de44d){var _0x29a909=[];switch(_0x959ded[_0x7067('0x2')]()){case'voice':switch(_0x3de44d[_0x7067('0x2')]()){case'inbound':_0x29a909=[{'type':'string','content':_0x7067('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x7067('0xc'),'keyType':_0x7067('0x6'),'variableName':'calleridnum'},{'type':_0x7067('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x7067('0x6'),'variableName':_0x7067('0xe')},{'type':'keyValue','content':'','key':_0x7067('0xf'),'keyType':_0x7067('0x6'),'variableName':'destexten'},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x10'),'keyType':_0x7067('0x6'),'variableName':_0x7067('0x5')},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x11'),'keyType':_0x7067('0x6'),'variableName':_0x7067('0x12')},{'type':_0x7067('0xd'),'content':'','key':'Date','keyType':_0x7067('0x6'),'variableName':'agentcalledAt'},{'type':'string','content':_0x7067('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x14'),'keyType':'variable','variableName':_0x7067('0x15')},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x16'),'keyType':'variable','variableName':_0x7067('0x9')},{'type':_0x7067('0x1'),'content':_0x7067('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x18'),'keyType':'variable','variableName':_0x7067('0x19')},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x1a'),'keyType':'variable','variableName':'agentconnectAt'},{'type':_0x7067('0xd'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0x7067('0x1b')},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x1c'),'keyType':_0x7067('0x6'),'variableName':_0x7067('0x1d')},{'type':_0x7067('0xd'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x7067('0x1e')}];break;case _0x7067('0x8'):_0x29a909=[{'type':_0x7067('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0x7067('0x1f'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x7067('0xd'),'content':'','key':'Member\x20Name','keyType':_0x7067('0x6'),'keyContent':'','variableName':_0x7067('0x20')},{'type':'keyValue','content':'','key':_0x7067('0x11'),'keyType':_0x7067('0x6'),'keyContent':'','variableName':_0x7067('0x12')},{'type':'keyValue','content':'','key':_0x7067('0x21'),'keyType':_0x7067('0x6'),'keyContent':'','variableName':_0x7067('0x22')},{'type':'string','content':_0x7067('0x17')},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x23'),'keyType':_0x7067('0x6'),'keyContent':'','variableName':_0x7067('0x24')},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x25'),'keyType':_0x7067('0x6'),'keyContent':'','variableName':_0x7067('0x26')},{'type':_0x7067('0xd'),'content':'','key':_0x7067('0x27'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0x7067('0xd'),'content':'','key':'Billable\x20Time','keyType':_0x7067('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x29a909;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 3d5f590..3fb45ff 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4478=['../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','stringify','null','findOne','then','update','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb'];(function(_0x2c1371,_0x2d5a4f){var _0x26dbc6=function(_0x395879){while(--_0x395879){_0x2c1371['push'](_0x2c1371['shift']());}};_0x26dbc6(++_0x2d5a4f);}(_0x4478,0x194));var _0x8447=function(_0x3702c7,_0x30c5bf){_0x3702c7=_0x3702c7-0x0;var _0x2a6a74=_0x4478[_0x3702c7];return _0x2a6a74;};'use strict';var _=require(_0x8447('0x0'));var db=require(_0x8447('0x1'))['db'];var loggers={'openchannel':require(_0x8447('0x2'))(_0x8447('0x3')),'mail':require(_0x8447('0x2'))(_0x8447('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x8447('0x2'))(_0x8447('0x5')),'chat':require(_0x8447('0x2'))('chat-interactions'),'whatsapp':require(_0x8447('0x2'))(_0x8447('0x6'))};function getInteractionId(_0x4859ce,_0x41509e,_0xe36e43){if(_0x4859ce&&_0x4859ce[_[_0x8447('0x7')](_0xe36e43)+_0x8447('0x8')]){return _0x4859ce[_[_0x8447('0x7')](_0xe36e43)+'InteractionId'];}else if(_0x4859ce&&_0x4859ce['id']){return _0x4859ce['id'];}else if(_0x41509e&&_0x41509e['id']){return _0x41509e['id'];}else{return _0x8447('0x9');}}function log(_0x116856,_0x2cc669,_0xeba282,_0x28faa4,_0x2f9425,_0xf36d20){loggers[_0x2f9425[_0x8447('0xa')]()][_0x116856]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf36d20[_0x8447('0xb')](),_0x2cc669?_0x2cc669['id']:null,_0x2cc669?_0x2cc669['name']:null,_0x2cc669?_0x2cc669['role']:null,getInteractionId(_0xeba282,_0x28faa4,_0x2f9425),_0xeba282?JSON[_0x8447('0xc')](_0xeba282):_0x8447('0xd'));}function updateUser(_0x5a86a6,_0x2982be,_0xc0f681,_0x3d3883,_0x2c9ad5){db[_[_0x8447('0x7')](_0x3d3883)+'Interaction'][_0x8447('0xe')]({'where':{'id':getInteractionId(_0x2982be,_0xc0f681,_0x3d3883)}})[_0x8447('0xf')](function(_0x566795){if(_0x566795){return _0x566795[_0x8447('0x10')]({'UserId':_0x5a86a6?_0x5a86a6['id']:null});}})['then'](function(_0x528f56){if(_0x528f56){log('info',_0x5a86a6,_0x2982be,_0xc0f681,_0x3d3883,_0x2c9ad5);}})[_0x8447('0x11')](function(){log(_0x8447('0x12'),_0x5a86a6,_0x2982be,_0xc0f681,_0x3d3883,_0x2c9ad5);});}exports[_0x8447('0x13')]=function(_0x37cf7b,_0x999e15){return function(_0x1facff,_0x108d0c,_0x2c2950){var _0x578752=_0x1facff[_0x8447('0x14')];var _0x371f80={};var _0x255e91=_0x1facff[_0x8447('0x15')];if(_0x371f80){_0x371f80=_[_0x8447('0x16')](_0x1facff[_0x8447('0x17')]);_0x371f80=_[_0x8447('0x18')](_0x371f80,[_0x8447('0x17'),_0x8447('0x19'),_0x8447('0x1a'),_0x8447('0x1b'),_0x8447('0x1c')]);}updateUser(_0x578752,_0x371f80,_0x255e91,_0x37cf7b,_0x999e15);_0x2c2950(null);};}; \ No newline at end of file +var _0x79e7=['fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','whatsapp-interactions','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','null','Interaction','findOne','then','update','info','catch','tracked','user','query','clone','body','omit','html','phone'];(function(_0x242bb9,_0x5575b7){var _0x2a2760=function(_0x54703e){while(--_0x54703e){_0x242bb9['push'](_0x242bb9['shift']());}};_0x2a2760(++_0x5575b7);}(_0x79e7,0x14c));var _0x779e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x79e7[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x779e('0x0'));var db=require(_0x779e('0x1'))['db'];var loggers={'openchannel':require(_0x779e('0x2'))(_0x779e('0x3')),'mail':require('../../config/logger')(_0x779e('0x4')),'fax':require(_0x779e('0x2'))(_0x779e('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x779e('0x2'))('chat-interactions'),'whatsapp':require(_0x779e('0x2'))(_0x779e('0x6'))};function getInteractionId(_0xda245e,_0x1b2b9d,_0x4a1303){if(_0xda245e&&_0xda245e[_['upperFirst'](_0x4a1303)+'InteractionId']){return _0xda245e[_['upperFirst'](_0x4a1303)+_0x779e('0x7')];}else if(_0xda245e&&_0xda245e['id']){return _0xda245e['id'];}else if(_0x1b2b9d&&_0x1b2b9d['id']){return _0x1b2b9d['id'];}else{return _0x779e('0x8');}}function log(_0x149ca1,_0x55f992,_0x224503,_0x1e5c37,_0x180f25,_0xa263c4){loggers[_0x180f25[_0x779e('0x9')]()][_0x149ca1](_0x779e('0xa'),_0xa263c4[_0x779e('0xb')](),_0x55f992?_0x55f992['id']:null,_0x55f992?_0x55f992['name']:null,_0x55f992?_0x55f992[_0x779e('0xc')]:null,getInteractionId(_0x224503,_0x1e5c37,_0x180f25),_0x224503?JSON['stringify'](_0x224503):_0x779e('0xd'));}function updateUser(_0x4d3e9d,_0x43e75f,_0x28ace9,_0x4e2bb2,_0x11c151){db[_['upperFirst'](_0x4e2bb2)+_0x779e('0xe')][_0x779e('0xf')]({'where':{'id':getInteractionId(_0x43e75f,_0x28ace9,_0x4e2bb2)}})[_0x779e('0x10')](function(_0x2e7951){if(_0x2e7951){return _0x2e7951[_0x779e('0x11')]({'UserId':_0x4d3e9d?_0x4d3e9d['id']:null});}})[_0x779e('0x10')](function(_0x82e4e7){if(_0x82e4e7){log(_0x779e('0x12'),_0x4d3e9d,_0x43e75f,_0x28ace9,_0x4e2bb2,_0x11c151);}})[_0x779e('0x13')](function(){log('error',_0x4d3e9d,_0x43e75f,_0x28ace9,_0x4e2bb2,_0x11c151);});}exports[_0x779e('0x14')]=function(_0x4a3207,_0x658d51){return function(_0x419ed3,_0x41c987,_0x460773){var _0xf1b6d1=_0x419ed3[_0x779e('0x15')];var _0x46a631={};var _0x22a62b=_0x419ed3[_0x779e('0x16')];if(_0x46a631){_0x46a631=_[_0x779e('0x17')](_0x419ed3[_0x779e('0x18')]);_0x46a631=_[_0x779e('0x19')](_0x46a631,['body',_0x779e('0x1a'),_0x779e('0x1b'),_0x779e('0x1c'),_0x779e('0x1d')]);}updateUser(_0xf1b6d1,_0x46a631,_0x22a62b,_0x4a3207,_0x658d51);_0x460773(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index cf97b8f..89c1ca7 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddf5=['final','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8'];(function(_0x56a226,_0x2fb531){var _0x15fcfe=function(_0x45b94e){while(--_0x45b94e){_0x56a226['push'](_0x56a226['shift']());}};_0x15fcfe(++_0x2fb531);}(_0xddf5,0xdd));var _0x5ddf=function(_0x112b51,_0x6664de){_0x112b51=_0x112b51-0x0;var _0x394865=_0xddf5[_0x112b51];return _0x394865;};'use strict';var crypto=require('crypto');var util=require(_0x5ddf('0x0'));var compose=require(_0x5ddf('0x1'));var db=require(_0x5ddf('0x2'))['db'];var config=require(_0x5ddf('0x3'));function getValueFromLicense(_0x987137,_0x26ac29){if(_0x987137&&_0x26ac29){if(_0x26ac29[_0x5ddf('0x4')]&&_0x26ac29['license']){var _0x49143b=_0x26ac29['data1'];var _0x2d54fd=_0x26ac29[_0x5ddf('0x5')];var _0x2eaba7=_0x49143b[_0x5ddf('0x6')]('-')[0x4];var _0x420324=_0x49143b[_0x5ddf('0x6')]('-')[0x0];var _0x25e7ab=crypto[_0x5ddf('0x7')]('aes-256-ctr',util[_0x5ddf('0x8')](_0x5ddf('0x9'),_0x2eaba7,_0x49143b,_0x420324));var _0x451f6c=_0x25e7ab[_0x5ddf('0xa')](_0x2d54fd,_0x5ddf('0xb'),_0x5ddf('0xc'));_0x451f6c+=_0x25e7ab[_0x5ddf('0xd')](_0x5ddf('0xc'));var _0x233522=JSON['parse'](_0x451f6c);return _0x233522['hasOwnProperty'](_0x987137)?_0x233522[_0x987137]:null;}}return null;}function isLimit(_0x5479bb,_0x1614a1,_0x387afc,_0x237c50){var _0x2b2d8c=_0x1614a1;return compose()[_0x5ddf('0xe')](function(_0x1d3cbd,_0x42783b,_0x34bee0){return db[_0x5ddf('0xf')][_0x5ddf('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x5ddf('0x11')](function(_0x1d0ea4){var _0x31e639=getValueFromLicense(_0x5479bb,_0x1d0ea4);return _0x31e639?_0x31e639:_0x2b2d8c;})['then'](function(_0x2cc55){_0x2b2d8c=_0x2cc55;return _0x387afc['count'](_0x237c50);})[_0x5ddf('0x11')](function(_0x1b0fda){if(_0x1b0fda>=_0x2b2d8c){return _0x42783b[_0x5ddf('0x12')](0x193)[_0x5ddf('0x13')]({'message':util[_0x5ddf('0x8')](_0x5ddf('0x14'),_0x5479bb)});}_0x34bee0();})[_0x5ddf('0x15')](function(_0x1fdd87){_0x34bee0(_0x1fdd87);});});}function isUserLimit(){return isLimit(_0x5ddf('0x16'),0x1,db[_0x5ddf('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0x5ddf('0x18')}]}});}exports[_0x5ddf('0x19')]=isUserLimit; \ No newline at end of file +var _0x8b08=['user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','split','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin'];(function(_0x890db7,_0x4dcf2c){var _0x46412=function(_0x2685df){while(--_0x2685df){_0x890db7['push'](_0x890db7['shift']());}};_0x46412(++_0x4dcf2c);}(_0x8b08,0x10a));var _0x88b0=function(_0x3b1865,_0x2703d7){_0x3b1865=_0x3b1865-0x0;var _0x4428b2=_0x8b08[_0x3b1865];return _0x4428b2;};'use strict';var crypto=require(_0x88b0('0x0'));var util=require('util');var compose=require(_0x88b0('0x1'));var db=require(_0x88b0('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0xfd7929,_0x52aa77){if(_0xfd7929&&_0x52aa77){if(_0x52aa77[_0x88b0('0x3')]&&_0x52aa77[_0x88b0('0x4')]){var _0x15e4a6=_0x52aa77[_0x88b0('0x3')];var _0x5d6519=_0x52aa77[_0x88b0('0x4')];var _0x3ed74f=_0x15e4a6[_0x88b0('0x5')]('-')[0x4];var _0x25ad10=_0x15e4a6[_0x88b0('0x5')]('-')[0x0];var _0x72695f=crypto['createDecipher']('aes-256-ctr',util['format'](_0x88b0('0x6'),_0x3ed74f,_0x15e4a6,_0x25ad10));var _0xce52a4=_0x72695f[_0x88b0('0x7')](_0x5d6519,_0x88b0('0x8'),_0x88b0('0x9'));_0xce52a4+=_0x72695f['final'](_0x88b0('0x9'));var _0xd3a8e7=JSON[_0x88b0('0xa')](_0xce52a4);return _0xd3a8e7[_0x88b0('0xb')](_0xfd7929)?_0xd3a8e7[_0xfd7929]:null;}}return null;}function isLimit(_0x2ec26b,_0x26b1af,_0x183661,_0x45ebdb){var _0xf592e8=_0x26b1af;return compose()[_0x88b0('0xc')](function(_0x1cf5ef,_0x45ce43,_0x1fce15){return db[_0x88b0('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x88b0('0xe')](function(_0x502aff){var _0x250194=getValueFromLicense(_0x2ec26b,_0x502aff);return _0x250194?_0x250194:_0xf592e8;})[_0x88b0('0xe')](function(_0x30567){_0xf592e8=_0x30567;return _0x183661[_0x88b0('0xf')](_0x45ebdb);})[_0x88b0('0xe')](function(_0x527d8f){if(_0x527d8f>=_0xf592e8){return _0x45ce43['status'](0x193)[_0x88b0('0x10')]({'message':util[_0x88b0('0x11')](_0x88b0('0x12'),_0x2ec26b)});}_0x1fce15();})[_0x88b0('0x13')](function(_0x1c66e3){_0x1fce15(_0x1c66e3);});});}function isUserLimit(){return isLimit(_0x88b0('0x14'),0x1,db['User'],{'where':{'$or':[{'role':_0x88b0('0x15')},{'role':_0x88b0('0x16')}]}});}exports[_0x88b0('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 18ae8f6..aa8c299 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 _0xd26d=['moment','startsWith','[$or]','and','[$and]','replace','split','length','slice','forEach','shift','match','map','conditions','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','LIKE\x20?','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','$endsWith','utcOffset','hours','minutes'];(function(_0x937fe7,_0x46567b){var _0x4fc595=function(_0x1a777f){while(--_0x1a777f){_0x937fe7['push'](_0x937fe7['shift']());}};_0x4fc595(++_0x46567b);}(_0xd26d,0xd0));var _0xdd26=function(_0x24ddf6,_0x114e56){_0x24ddf6=_0x24ddf6-0x0;var _0x393d70=_0xd26d[_0x24ddf6];return _0x393d70;};'use strict';var _=require('lodash');var moment=require(_0xdd26('0x0'));exports['parseSearch']=function(_0x21e872){var _0x450d06={'conditions':[]};_0x450d06['sqlOperator']=_[_0xdd26('0x1')](_0x21e872,_0xdd26('0x2'))?'or':_0xdd26('0x3');var _0x2492b1=_0x21e872['replace'](_0xdd26('0x4'),'')[_0xdd26('0x5')](_0xdd26('0x2'),'')[_0xdd26('0x6')]('||');for(var _0x5383b6=0x0;_0x5383b6<_0x2492b1[_0xdd26('0x7')];_0x5383b6++){var _0xba852=_0x2492b1[_0x5383b6][_0xdd26('0x6')](':=');var _0x57a2b1=_0xba852[0x0];var _0x430689=_0xba852[_0xdd26('0x8')](0x1);_0x430689[_0xdd26('0x9')](function(_0x37a133){var _0x2cb783=_0x37a133[_0xdd26('0x6')]('[')[_0xdd26('0xa')]();var _0x362f2d=_0x37a133[_0xdd26('0xb')](/\[(.*?)\]/g);_0x362f2d[_0xdd26('0x9')](function(_0xc2d301){var _0x589710=_0xc2d301[_0xdd26('0x6')]('[')['filter'](function(_0x3d9df5){return _0x3d9df5['indexOf'](']')>-0x1;})[_0xdd26('0xc')](function(_0x591b94){return _0x591b94[_0xdd26('0x6')](']')[0x0];})[0x0];_0x450d06[_0xdd26('0xd')]['push']({'field':_0x57a2b1,'operator':_0x2cb783,'value':_0x589710});});});}return _0x450d06;};exports[_0xdd26('0xe')]=function(_0x3797c5,_0x5d4a88,_0x8d4a54){var _0x5f734c={};if(_0x5d4a88===_0xdd26('0xf')){if(_0x8d4a54[_0xdd26('0x10')]==='$eq'){_0x8d4a54[_0xdd26('0x10')]=_0xdd26('0x11');_0x8d4a54['value']+=','+_0x8d4a54[_0xdd26('0x12')];}else if(_[_0xdd26('0x13')]([_0xdd26('0x14'),_0xdd26('0x15')],_0x8d4a54[_0xdd26('0x10')])){_0x8d4a54[_0xdd26('0x12')]=moment(_0x8d4a54[_0xdd26('0x12')])[_0xdd26('0x16')](0x1,_0xdd26('0x17'))[_0xdd26('0x18')](_0xdd26('0x19'));}}if(_0x8d4a54[_0xdd26('0x1a')]){_0x5d4a88=_0x8d4a54[_0xdd26('0x1a')];_0x5f734c[_0xdd26('0x1b')]=_0xdd26('0x1c')+_0x3797c5+'.'+_0x8d4a54[_0xdd26('0x1d')]+_0xdd26('0x1e')+_0x8d4a54[_0xdd26('0x1a')]+')\x20'+parseOperator(_0x8d4a54[_0xdd26('0x10')]);}else{_0x5f734c[_0xdd26('0x1b')]=_0x3797c5+'.'+_0x8d4a54[_0xdd26('0x1d')]+'\x20'+parseOperator(_0x8d4a54['operator']);}if(_['includes']([_0xdd26('0x1f'),_0xdd26('0x20')],_0x8d4a54['operator']))_0x5f734c[_0xdd26('0x1b')]='('+_0x5f734c[_0xdd26('0x1b')]+_0xdd26('0x21')+_0x3797c5+'.'+_0x8d4a54[_0xdd26('0x1d')]+_0xdd26('0x22');_0x5f734c[_0xdd26('0x12')]=parseValue(_0x5d4a88,_0x8d4a54['operator'],_0x8d4a54['value']);return _0x5f734c;};function parseOperator(_0x583484){var _0x53226a;switch(_0x583484){case'$in':_0x53226a=_0xdd26('0x23');break;case _0xdd26('0x20'):_0x53226a=_0xdd26('0x24');break;case _0xdd26('0x25'):_0x53226a=_0xdd26('0x26');break;case _0xdd26('0x1f'):_0x53226a=_0xdd26('0x27');break;case'$substring':case'$startsWith':case'$endsWith':_0x53226a=_0xdd26('0x28');break;case'$lt':_0x53226a=_0xdd26('0x29');break;case'$gt':_0x53226a=_0xdd26('0x2a');break;case _0xdd26('0x15'):_0x53226a=_0xdd26('0x2b');break;case'$gte':_0x53226a=_0xdd26('0x2c');break;case'$between':_0x53226a=_0xdd26('0x2d');break;}return _0x53226a;}function parseValue(_0x193005,_0x3cde37,_0x1f67cc){var _0xea2141={'start':undefined,'end':undefined};switch(_0x3cde37){case'$in':case _0xdd26('0x20'):_0xea2141['start']=_0x1f67cc[_0xdd26('0x6')](',');break;case'$substring':_0xea2141[_0xdd26('0x2e')]='%'+_0x1f67cc+'%';break;case _0xdd26('0x2f'):_0xea2141[_0xdd26('0x2e')]=_0x1f67cc+'%';break;case _0xdd26('0x30'):_0xea2141[_0xdd26('0x2e')]='%'+_0x1f67cc;break;case _0xdd26('0x11'):var _0x17a77c=_0x1f67cc['split'](',');var _0x1f67cc=_0x17a77c[_0xdd26('0xa')]();var _0x1234cc=_0x17a77c['pop']();if(_0x193005===_0xdd26('0xf')){_0x1f67cc=moment(_0x1f67cc)['utcOffset'](0x0,!![])[_0xdd26('0x18')]();_0x1234cc=moment(_0x1234cc)[_0xdd26('0x31')](0x0,!![])['add'](0x17,_0xdd26('0x32'))[_0xdd26('0x16')](0x3b,_0xdd26('0x33'))[_0xdd26('0x16')](0x3b,'seconds')['format']();}_0xea2141={'start':_0x1f67cc,'end':_0x1234cc};break;default:_0xea2141['start']=_0x1f67cc;break;}return _0xea2141;} \ No newline at end of file +var _0x5909=['\x20AS\x20','text','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','forEach','split','shift','match','filter','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','add','format','castTo','field'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x5909,0x86));var _0x9590=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0x5909[_0x270a54];return _0x4d07d0;};'use strict';var _=require(_0x9590('0x0'));var moment=require(_0x9590('0x1'));exports[_0x9590('0x2')]=function(_0x3c4e71){var _0x59b6c7={'conditions':[]};_0x59b6c7[_0x9590('0x3')]=_[_0x9590('0x4')](_0x3c4e71,_0x9590('0x5'))?'or':'and';var _0x5ec9b3=_0x3c4e71[_0x9590('0x6')](_0x9590('0x7'),'')[_0x9590('0x6')](_0x9590('0x5'),'')['split']('||');for(var _0x2029b1=0x0;_0x2029b1<_0x5ec9b3['length'];_0x2029b1++){var _0xccbc5c=_0x5ec9b3[_0x2029b1]['split'](':=');var _0x4576aa=_0xccbc5c[0x0];var _0x27a9fa=_0xccbc5c['slice'](0x1);_0x27a9fa[_0x9590('0x8')](function(_0x2e08cb){var _0x2c291a=_0x2e08cb[_0x9590('0x9')]('[')[_0x9590('0xa')]();var _0x19c70b=_0x2e08cb[_0x9590('0xb')](/\[(.*?)\]/g);_0x19c70b[_0x9590('0x8')](function(_0x2b37a4){var _0x3f95d2=_0x2b37a4[_0x9590('0x9')]('[')[_0x9590('0xc')](function(_0x3ae215){return _0x3ae215['indexOf'](']')>-0x1;})[_0x9590('0xd')](function(_0x4e5b16){return _0x4e5b16[_0x9590('0x9')](']')[0x0];})[0x0];_0x59b6c7[_0x9590('0xe')][_0x9590('0xf')]({'field':_0x4576aa,'operator':_0x2c291a,'value':_0x3f95d2});});});}return _0x59b6c7;};exports[_0x9590('0x10')]=function(_0x129ebe,_0x241c1b,_0x50e528){var _0x5d2ac4={};if(_0x241c1b===_0x9590('0x11')){if(_0x50e528[_0x9590('0x12')]===_0x9590('0x13')){_0x50e528[_0x9590('0x12')]=_0x9590('0x14');_0x50e528[_0x9590('0x15')]+=','+_0x50e528[_0x9590('0x15')];}else if(_[_0x9590('0x16')](['$gt',_0x9590('0x17')],_0x50e528[_0x9590('0x12')])){_0x50e528[_0x9590('0x15')]=moment(_0x50e528[_0x9590('0x15')])[_0x9590('0x18')](0x1,'days')[_0x9590('0x19')]('YYYY-MM-DD');}}if(_0x50e528[_0x9590('0x1a')]){_0x241c1b=_0x50e528[_0x9590('0x1a')];_0x5d2ac4['text']='CAST('+_0x129ebe+'.'+_0x50e528[_0x9590('0x1b')]+_0x9590('0x1c')+_0x50e528[_0x9590('0x1a')]+')\x20'+parseOperator(_0x50e528['operator']);}else{_0x5d2ac4[_0x9590('0x1d')]=_0x129ebe+'.'+_0x50e528[_0x9590('0x1b')]+'\x20'+parseOperator(_0x50e528[_0x9590('0x12')]);}if(_[_0x9590('0x16')](['$ne',_0x9590('0x1e')],_0x50e528[_0x9590('0x12')]))_0x5d2ac4['text']='('+_0x5d2ac4['text']+_0x9590('0x1f')+_0x129ebe+'.'+_0x50e528[_0x9590('0x1b')]+'\x20IS\x20NULL)';_0x5d2ac4[_0x9590('0x15')]=parseValue(_0x241c1b,_0x50e528['operator'],_0x50e528[_0x9590('0x15')]);return _0x5d2ac4;};function parseOperator(_0x34d4c9){var _0xd834f3;switch(_0x34d4c9){case _0x9590('0x20'):_0xd834f3=_0x9590('0x21');break;case _0x9590('0x1e'):_0xd834f3=_0x9590('0x22');break;case _0x9590('0x13'):_0xd834f3='=\x20?';break;case _0x9590('0x23'):_0xd834f3=_0x9590('0x24');break;case _0x9590('0x25'):case _0x9590('0x26'):case _0x9590('0x27'):_0xd834f3=_0x9590('0x28');break;case _0x9590('0x29'):_0xd834f3=_0x9590('0x2a');break;case _0x9590('0x2b'):_0xd834f3=_0x9590('0x2c');break;case _0x9590('0x17'):_0xd834f3=_0x9590('0x2d');break;case'$gte':_0xd834f3=_0x9590('0x2e');break;case _0x9590('0x14'):_0xd834f3=_0x9590('0x2f');break;}return _0xd834f3;}function parseValue(_0x1ffe04,_0x10aca3,_0x2c3295){var _0x8c9250={'start':undefined,'end':undefined};switch(_0x10aca3){case _0x9590('0x20'):case _0x9590('0x1e'):_0x8c9250[_0x9590('0x30')]=_0x2c3295[_0x9590('0x9')](',');break;case _0x9590('0x25'):_0x8c9250[_0x9590('0x30')]='%'+_0x2c3295+'%';break;case _0x9590('0x26'):_0x8c9250[_0x9590('0x30')]=_0x2c3295+'%';break;case _0x9590('0x27'):_0x8c9250['start']='%'+_0x2c3295;break;case'$between':var _0x391cd2=_0x2c3295['split'](',');var _0x2c3295=_0x391cd2[_0x9590('0xa')]();var _0x39fa9d=_0x391cd2[_0x9590('0x31')]();if(_0x1ffe04==='DATE'){_0x2c3295=moment(_0x2c3295)['utcOffset'](0x0,!![])['format']();_0x39fa9d=moment(_0x39fa9d)[_0x9590('0x32')](0x0,!![])[_0x9590('0x18')](0x17,_0x9590('0x33'))['add'](0x3b,_0x9590('0x34'))['add'](0x3b,_0x9590('0x35'))['format']();}_0x8c9250={'start':_0x2c3295,'end':_0x39fa9d};break;default:_0x8c9250[_0x9590('0x30')]=_0x2c3295;break;}return _0x8c9250;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 9b66beb..ddb2cc4 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 _0x7401=['cast','col','unsigned','substr','DESC','ASC','omit','isEmpty','length','isObject','isString','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','object','columns','value','where','merge','map','VIRTUAL','lower','options','lodash','moment','keys','includes','parse','split','filters','forOwn','find','type','DATE','isPlainObject','format','$lte','YYYY-MM-DD','utc','name','uniqueid','isArray','limit','offset','sort','indexOf','priority'];(function(_0x2892dd,_0x2950d1){var _0x3966a7=function(_0x4b35c3){while(--_0x4b35c3){_0x2892dd['push'](_0x2892dd['shift']());}};_0x3966a7(++_0x2950d1);}(_0x7401,0xf0));var _0x1740=function(_0x531516,_0x2c2c37){_0x531516=_0x531516-0x0;var _0x1a5649=_0x7401[_0x531516];return _0x1a5649;};'use strict';var _=require(_0x1740('0x0'));var sequelize=require('sequelize');var moment=require(_0x1740('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5634cb){var _0x732a2c=['ne'];try{var _0x3cb6eb=JSON['parse'](_0x5634cb);var _0x2fd36d=Object[_0x1740('0x2')](_0x3cb6eb)[0x0];return _0x732a2c[_0x1740('0x3')](_0x2fd36d);}catch(_0x2f5426){return![];}}function getOperatorValue(_0x566c51){var _0x39d8f4=JSON[_0x1740('0x4')](_0x566c51);var _0x4dc4fd=Object['keys'](_0x39d8f4)[0x0];var _0x32684d=_0x39d8f4[_0x4dc4fd];return{['$'+_0x4dc4fd]:_0x32684d};}exports['fields']=function(_0x2da8dc){var _0xc7b443=null;if(_0x2da8dc){_0xc7b443=_0x2da8dc[_0x1740('0x5')](',');}return _0xc7b443;};exports[_0x1740('0x6')]=function(_0x263bed,_0x2e362d){var _0x473566={};if(!_['isEmpty'](_0x263bed)){_[_0x1740('0x7')](_0x263bed,function(_0x111920,_0x18ec05){try{if(_0x2e362d){var _0x3a8bcf=_[_0x1740('0x8')](_0x2e362d,{'name':_0x18ec05})||{};if(hasSequelizeOperator(_0x111920)){_0x473566[_0x18ec05]=getOperatorValue(_0x111920);}else if(_0x3a8bcf[_0x1740('0x9')]===_0x1740('0xa')&&_[_0x1740('0xb')](_0x111920)){var _0x232565=JSON[_0x1740('0x4')](_0x111920);var _0x224869={'$gte':moment(moment(_0x232565['$gte'])[_0x1740('0xc')]('YYYY-MM-DD'))['utc']()[_0x1740('0xc')](),'$lte':moment(moment(_0x232565[_0x1740('0xd')])[_0x1740('0xc')](_0x1740('0xe')))[_0x1740('0xf')]()['subtract'](0x1,'s')['format']()};_0x473566[_0x18ec05]=_0x224869;}else if(_0x3a8bcf[_0x1740('0x10')]===_0x1740('0x11')){_0x473566[_0x18ec05]=_0x111920;}else{_0x473566[_0x18ec05]=_[_0x1740('0x12')](_0x111920)?_0x111920:JSON[_0x1740('0x4')](_0x111920);}}else{_0x473566[_0x18ec05]=_[_0x1740('0x12')](_0x111920)?_0x111920:JSON[_0x1740('0x4')](_0x111920);}}catch(_0x2e9c4e){_0x473566[_0x18ec05]=_0x111920[_0x1740('0x5')](',');}});}return _0x473566;};exports[_0x1740('0x13')]=function(_0xa8e055){_0xa8e055=parseInt(_0xa8e055,0xa);if(!_0xa8e055||_0xa8e055<0x0){_0xa8e055=LIMIT_VALUE;}return _0xa8e055;};exports[_0x1740('0x14')]=function(_0x5962b1){_0x5962b1=parseInt(_0x5962b1,0xa);if(!_0x5962b1||_0x5962b1<0x0){_0x5962b1=0x0;}return _0x5962b1;};exports[_0x1740('0x15')]=function(_0xa37d25){var _0x5b1b3c,_0x5bd197=null;if(_0xa37d25){_0x5b1b3c=_0xa37d25[_0x1740('0x5')](',');_0x5bd197=_['map'](_0x5b1b3c,function(_0x213f53){if(_0x213f53[_0x1740('0x16')]('-')===0x0){return[_0x213f53===_0x1740('0x17')?sequelize[_0x1740('0x18')](sequelize[_0x1740('0x19')]('priority'),_0x1740('0x1a')):_0x213f53[_0x1740('0x1b')](0x1),_0x1740('0x1c')];}else{return[_0x213f53==='priority'?sequelize[_0x1740('0x18')](sequelize[_0x1740('0x19')]('priority'),_0x1740('0x1a')):_0x213f53,_0x1740('0x1d')];}});}return _0x5bd197;};exports[_0x1740('0x1e')]=function(_0x3ff1f3,_0x4e5c05){if(_[_0x1740('0x1f')](_0x3ff1f3)){return _0x3ff1f3;}if(_[_0x1740('0x12')](_0x3ff1f3)){for(var _0x4a0d64=0x0;_0x4a0d64<_0x3ff1f3[_0x1740('0x20')];_0x4a0d64+=0x1){_0x3ff1f3[_0x4a0d64]=this[_0x1740('0x1e')](_0x3ff1f3[_0x4a0d64],_0x4e5c05);}return _0x3ff1f3;}if(!_[_0x1740('0x21')](_0x3ff1f3)){return _0x3ff1f3;}if(_[_0x1740('0x22')](_0x4e5c05)){_0x4e5c05=[_0x4e5c05];}if(!_[_0x1740('0x12')](_0x4e5c05)){return _0x3ff1f3;}for(var _0x367887=0x0;_0x367887<_0x4e5c05[_0x1740('0x20')];_0x367887+=0x1){_[_0x1740('0x23')](_0x3ff1f3,_0x4e5c05[_0x367887]);}for(var _0x502c61 in _0x3ff1f3){if(_0x3ff1f3['hasOwnProperty'](_0x502c61)){_0x3ff1f3[_0x502c61]=this['omit'](_0x3ff1f3[_0x502c61],_0x4e5c05);}}return _0x3ff1f3;};exports[_0x1740('0x24')]=function(_0xdd09a5){return _0xdd09a5['match'](RegExp(_0x1740('0x25')))?!![]:![];};exports[_0x1740('0x26')]=function(_0x45d229){return _0x45d229[_0x1740('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x1740('0x28')]=function(_0x179398){var _0x1796c2=[];_0x179398[_0x1740('0x5')](/[ ,]+/)[_0x1740('0x29')](function(_0x3e15c7){_0x3e15c7=_0x3e15c7[_0x1740('0x2a')](/([^:]")"+/g,'$1');_0x3e15c7='+'+_0x3e15c7+'*';if(_0x3e15c7[_0x1740('0x3')]('@'))_0x3e15c7='\x22'+_0x3e15c7+'\x22';_0x1796c2[_0x1740('0x2b')](_0x3e15c7);});return _0x1796c2[_0x1740('0x2c')]('\x20');};exports[_0x1740('0x2d')]=function(_0x5810b9,_0x296877,_0x3690f6){var _0x3bc669={},_0x27442c={};if(_0x296877['query']['$id']){_0x296877[_0x1740('0x2e')]['id']=_0x296877[_0x1740('0x2e')][_0x1740('0x2f')];delete _0x296877[_0x1740('0x2e')][_0x1740('0x2f')];}_0x3bc669[_0x1740('0x30')]=_['map'](_0x5810b9,_0x1740('0x10'));_0x3bc669['query']=_[_0x1740('0x2')](_0x296877[_0x1740('0x2e')]);_0x3bc669['filters']=_[_0x1740('0x31')](_0x3bc669[_0x1740('0x30')],_0x3bc669[_0x1740('0x2e')]);_0x27442c[_0x1740('0x32')]=_[_0x1740('0x31')](_0x3bc669[_0x1740('0x30')],this[_0x1740('0x33')](_0x296877['query']['fields']));_0x27442c[_0x1740('0x32')]=_0x27442c['attributes']['length']?_0x27442c['attributes']:_0x3bc669['model'];if(!_0x296877[_0x1740('0x2e')][_0x1740('0x34')](_0x1740('0x35'))){_0x27442c[_0x1740('0x13')]=this[_0x1740('0x13')](_0x296877[_0x1740('0x2e')][_0x1740('0x13')]);_0x27442c[_0x1740('0x14')]=this['offset'](_0x296877[_0x1740('0x2e')][_0x1740('0x14')]);}_0x27442c[_0x1740('0x36')]=this[_0x1740('0x15')](_0x296877[_0x1740('0x2e')][_0x1740('0x15')]);_0x27442c['where']=this['filters'](_[_0x1740('0x37')](_0x296877['query'],_0x3bc669['filters']),_0x5810b9);if(_0x296877['query'][_0x1740('0x38')]){var _0x166846=_0x5810b9;var _0x4896b5=_0x296877[_0x1740('0x2e')][_0x1740('0x38')];if(typeof _0x4896b5===_0x1740('0x39')){_0x166846=_[_0x1740('0x38')](_0x5810b9,function(_0x492649){return _[_0x1740('0x3')](_0x4896b5[_0x1740('0x3a')],_0x492649['name']);});_0x4896b5=_0x4896b5[_0x1740('0x3b')];}_0x27442c[_0x1740('0x3c')]=_[_0x1740('0x3d')](_0x27442c['where'],{'$or':_[_0x1740('0x3e')](_0x166846,function(_0x675b8f){if(_0x675b8f['type']!==_0x1740('0x3f')){if(_0x3690f6){return sequelize[_0x1740('0x3c')](sequelize['fn'](_0x1740('0x40'),sequelize[_0x1740('0x19')](_0x675b8f[_0x1740('0x10')])),{'$like':sequelize['fn']('lower','%'+_0x296877[_0x1740('0x2e')][_0x1740('0x38')]+'%')});}else{var _0x31a3c6={};_0x31a3c6[_0x675b8f[_0x1740('0x10')]]={'$like':'%'+_0x296877['query']['filter']+'%'};return _0x31a3c6;}}})});}_0x27442c=_['merge']({},_0x27442c,_0x296877[_0x1740('0x41')]);return _0x27442c;}; \ No newline at end of file +var _0x5e89=['indexOf','priority','cast','DESC','unsigned','ASC','length','isObject','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','order','where','pick','filter','object','columns','value','merge','col','lower','options','parse','keys','fields','split','filters','isEmpty','forOwn','$gte','utc','format','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5e89,0x19d));var _0x95e8=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x5e89[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x49acbb){var _0x3c1c70=['ne'];try{var _0x2049a4=JSON[_0x95e8('0x0')](_0x49acbb);var _0x41522a=Object[_0x95e8('0x1')](_0x2049a4)[0x0];return _0x3c1c70['includes'](_0x41522a);}catch(_0x4f110c){return![];}}function getOperatorValue(_0x2de8d9){var _0x34786a=JSON[_0x95e8('0x0')](_0x2de8d9);var _0x3c21c7=Object['keys'](_0x34786a)[0x0];var _0x436f41=_0x34786a[_0x3c21c7];return{['$'+_0x3c21c7]:_0x436f41};}exports[_0x95e8('0x2')]=function(_0x58a83e){var _0x124601=null;if(_0x58a83e){_0x124601=_0x58a83e[_0x95e8('0x3')](',');}return _0x124601;};exports[_0x95e8('0x4')]=function(_0x21575f,_0x496f08){var _0x41c0b2={};if(!_[_0x95e8('0x5')](_0x21575f)){_[_0x95e8('0x6')](_0x21575f,function(_0x1def19,_0x375857){try{if(_0x496f08){var _0x2fcc01=_['find'](_0x496f08,{'name':_0x375857})||{};if(hasSequelizeOperator(_0x1def19)){_0x41c0b2[_0x375857]=getOperatorValue(_0x1def19);}else if(_0x2fcc01['type']==='DATE'&&_['isPlainObject'](_0x1def19)){var _0x27384f=JSON[_0x95e8('0x0')](_0x1def19);var _0x103aa1={'$gte':moment(moment(_0x27384f[_0x95e8('0x7')])['format']('YYYY-MM-DD'))[_0x95e8('0x8')]()[_0x95e8('0x9')](),'$lte':moment(moment(_0x27384f['$lte'])[_0x95e8('0x9')](_0x95e8('0xa')))[_0x95e8('0x8')]()[_0x95e8('0xb')](0x1,'s')[_0x95e8('0x9')]()};_0x41c0b2[_0x375857]=_0x103aa1;}else if(_0x2fcc01[_0x95e8('0xc')]===_0x95e8('0xd')){_0x41c0b2[_0x375857]=_0x1def19;}else{_0x41c0b2[_0x375857]=_[_0x95e8('0xe')](_0x1def19)?_0x1def19:JSON[_0x95e8('0x0')](_0x1def19);}}else{_0x41c0b2[_0x375857]=_[_0x95e8('0xe')](_0x1def19)?_0x1def19:JSON[_0x95e8('0x0')](_0x1def19);}}catch(_0x2b8bb8){_0x41c0b2[_0x375857]=_0x1def19[_0x95e8('0x3')](',');}});}return _0x41c0b2;};exports[_0x95e8('0xf')]=function(_0x1cfe27){_0x1cfe27=parseInt(_0x1cfe27,0xa);if(!_0x1cfe27||_0x1cfe27<0x0){_0x1cfe27=LIMIT_VALUE;}return _0x1cfe27;};exports[_0x95e8('0x10')]=function(_0x20fa23){_0x20fa23=parseInt(_0x20fa23,0xa);if(!_0x20fa23||_0x20fa23<0x0){_0x20fa23=0x0;}return _0x20fa23;};exports[_0x95e8('0x11')]=function(_0x108059){var _0x2e2812,_0x1f49da=null;if(_0x108059){_0x2e2812=_0x108059[_0x95e8('0x3')](',');_0x1f49da=_[_0x95e8('0x12')](_0x2e2812,function(_0x39a80e){if(_0x39a80e[_0x95e8('0x13')]('-')===0x0){return[_0x39a80e===_0x95e8('0x14')?sequelize[_0x95e8('0x15')](sequelize['col'](_0x95e8('0x14')),'unsigned'):_0x39a80e['substr'](0x1),_0x95e8('0x16')];}else{return[_0x39a80e===_0x95e8('0x14')?sequelize['cast'](sequelize['col']('priority'),_0x95e8('0x17')):_0x39a80e,_0x95e8('0x18')];}});}return _0x1f49da;};exports['omit']=function(_0x32e859,_0x10f64c){if(_[_0x95e8('0x5')](_0x32e859)){return _0x32e859;}if(_[_0x95e8('0xe')](_0x32e859)){for(var _0xb83a3=0x0;_0xb83a3<_0x32e859[_0x95e8('0x19')];_0xb83a3+=0x1){_0x32e859[_0xb83a3]=this['omit'](_0x32e859[_0xb83a3],_0x10f64c);}return _0x32e859;}if(!_[_0x95e8('0x1a')](_0x32e859)){return _0x32e859;}if(_['isString'](_0x10f64c)){_0x10f64c=[_0x10f64c];}if(!_[_0x95e8('0xe')](_0x10f64c)){return _0x32e859;}for(var _0x1344d3=0x0;_0x1344d3<_0x10f64c[_0x95e8('0x19')];_0x1344d3+=0x1){_[_0x95e8('0x1b')](_0x32e859,_0x10f64c[_0x1344d3]);}for(var _0x20dcf8 in _0x32e859){if(_0x32e859['hasOwnProperty'](_0x20dcf8)){_0x32e859[_0x20dcf8]=this['omit'](_0x32e859[_0x20dcf8],_0x10f64c);}}return _0x32e859;};exports[_0x95e8('0x1c')]=function(_0x666426){return _0x666426[_0x95e8('0x1d')](RegExp(_0x95e8('0x1e')))?!![]:![];};exports[_0x95e8('0x1f')]=function(_0x4c6bdb){return _0x4c6bdb[_0x95e8('0x1d')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x2236b1){var _0x14c45d=[];_0x2236b1[_0x95e8('0x3')](/[ ,]+/)[_0x95e8('0x20')](function(_0x105c98){_0x105c98=_0x105c98[_0x95e8('0x21')](/([^:]")"+/g,'$1');_0x105c98='+'+_0x105c98+'*';if(_0x105c98['includes']('@'))_0x105c98='\x22'+_0x105c98+'\x22';_0x14c45d[_0x95e8('0x22')](_0x105c98);});return _0x14c45d[_0x95e8('0x23')]('\x20');};exports[_0x95e8('0x24')]=function(_0x3b7028,_0x3c7d3d,_0x3b63bc){var _0x6cfd53={},_0x36422a={};if(_0x3c7d3d[_0x95e8('0x25')][_0x95e8('0x26')]){_0x3c7d3d[_0x95e8('0x25')]['id']=_0x3c7d3d[_0x95e8('0x25')]['$id'];delete _0x3c7d3d[_0x95e8('0x25')][_0x95e8('0x26')];}_0x6cfd53[_0x95e8('0x27')]=_[_0x95e8('0x12')](_0x3b7028,_0x95e8('0xc'));_0x6cfd53['query']=_['keys'](_0x3c7d3d[_0x95e8('0x25')]);_0x6cfd53[_0x95e8('0x4')]=_[_0x95e8('0x28')](_0x6cfd53[_0x95e8('0x27')],_0x6cfd53[_0x95e8('0x25')]);_0x36422a['attributes']=_['intersection'](_0x6cfd53[_0x95e8('0x27')],this['fields'](_0x3c7d3d[_0x95e8('0x25')][_0x95e8('0x2')]));_0x36422a[_0x95e8('0x29')]=_0x36422a['attributes'][_0x95e8('0x19')]?_0x36422a[_0x95e8('0x29')]:_0x6cfd53[_0x95e8('0x27')];if(!_0x3c7d3d[_0x95e8('0x25')][_0x95e8('0x2a')]('nolimit')){_0x36422a['limit']=this[_0x95e8('0xf')](_0x3c7d3d[_0x95e8('0x25')][_0x95e8('0xf')]);_0x36422a[_0x95e8('0x10')]=this[_0x95e8('0x10')](_0x3c7d3d['query']['offset']);}_0x36422a[_0x95e8('0x2b')]=this[_0x95e8('0x11')](_0x3c7d3d[_0x95e8('0x25')]['sort']);_0x36422a[_0x95e8('0x2c')]=this[_0x95e8('0x4')](_[_0x95e8('0x2d')](_0x3c7d3d[_0x95e8('0x25')],_0x6cfd53[_0x95e8('0x4')]),_0x3b7028);if(_0x3c7d3d[_0x95e8('0x25')][_0x95e8('0x2e')]){var _0x5b59af=_0x3b7028;var _0xdc675f=_0x3c7d3d['query'][_0x95e8('0x2e')];if(typeof _0xdc675f===_0x95e8('0x2f')){_0x5b59af=_[_0x95e8('0x2e')](_0x3b7028,function(_0x15e04b){return _['includes'](_0xdc675f[_0x95e8('0x30')],_0x15e04b[_0x95e8('0xc')]);});_0xdc675f=_0xdc675f[_0x95e8('0x31')];}_0x36422a['where']=_[_0x95e8('0x32')](_0x36422a[_0x95e8('0x2c')],{'$or':_[_0x95e8('0x12')](_0x5b59af,function(_0x531a5d){if(_0x531a5d['type']!=='VIRTUAL'){if(_0x3b63bc){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x95e8('0x33')](_0x531a5d['name'])),{'$like':sequelize['fn'](_0x95e8('0x34'),'%'+_0x3c7d3d['query'][_0x95e8('0x2e')]+'%')});}else{var _0x5e5d4f={};_0x5e5d4f[_0x531a5d[_0x95e8('0xc')]]={'$like':'%'+_0x3c7d3d[_0x95e8('0x25')][_0x95e8('0x2e')]+'%'};return _0x5e5d4f;}}})});}_0x36422a=_[_0x95e8('0x32')]({},_0x36422a,_0x3c7d3d[_0x95e8('0x35')]);return _0x36422a;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 5cb254e..4993c07 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x27b7d2,_0x56c091){var _0x3ef6be=function(_0x6e8a35){while(--_0x6e8a35){_0x27b7d2['push'](_0x27b7d2['shift']());}};_0x3ef6be(++_0x56c091);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 a854e87..9b1dcd0 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 _0xd463=['../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','join','createHash','md5','update','digest','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring','crypto','bimedia-machine-uuid','execSync'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0xd463,0x1eb));var _0x3d46=function(_0x4cf628,_0x56c30f){_0x4cf628=_0x4cf628-0x0;var _0x44d7f3=_0xd463[_0x4cf628];return _0x44d7f3;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x3d46('0x0'));var machine=require(_0x3d46('0x1'));var exec=require('child_process')[_0x3d46('0x2')];var config=require(_0x3d46('0x3'));function getInterfaces(){var _0x25e92a=[];var _0x54ed2e=os[_0x3d46('0x4')]();var _0x1c2ae0=_[_0x3d46('0x5')](_[_0x3d46('0x6')](_0x54ed2e));for(var _0x455fc2=0x0;_0x455fc2<_0x1c2ae0[_0x3d46('0x7')];_0x455fc2++){var _0x31277e=_0x54ed2e[_0x1c2ae0[_0x455fc2]][_0x3d46('0x8')](function(_0x47e218){return _0x47e218[_0x3d46('0x9')]===_0x3d46('0xa')&&_0x47e218[_0x3d46('0xb')]===![];});_0x25e92a=_0x25e92a[_0x3d46('0xc')](_0x31277e);}return _0x25e92a;}function getFirstInterface(){var _0x483c22=_[_0x3d46('0xd')](getInterfaces());return{'macAddress':_0x483c22&&_0x483c22[_0x3d46('0xe')]?_0x483c22[_0x3d46('0xe')]:_0x3d46('0xf'),'ipAddress':_0x483c22&&_0x483c22[_0x3d46('0x10')]?_0x483c22['address']:_0x3d46('0x11')};}exports[_0x3d46('0x12')]=getFirstInterface;function getCPUhash(){var _0x2e7e22=_[_0x3d46('0x5')](os[_0x3d46('0x13')]()['map'](function(_0x3624a6){return _0x3624a6['model'];}))[_0x3d46('0x14')](':');return crypto[_0x3d46('0x15')](_0x3d46('0x16'))[_0x3d46('0x17')](_0x2e7e22)[_0x3d46('0x18')]('hex');}exports[_0x3d46('0x19')]=function(){var _0x3d6579=os[_0x3d46('0x1a')]();var _0xb5116f=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0xb5116f[_0x3d46('0x1b')](config[_0x3d46('0x1c')])){return config['licenseToken'];}else if(_0x3d6579===_0x3d46('0x1d')){return exec(_0x3d46('0x1e'),{'encoding':_0x3d46('0x1f')})[_0x3d46('0x20')]('\x0d\x0a','');}else{var _0x39c0bc=getFirstInterface();var _0x194fb1=getCPUhash();var _0x32647c=_0x194fb1+'|'+os[_0x3d46('0x21')]()+'|'+_0x39c0bc[_0x3d46('0x22')]+'|'+_0x39c0bc[_0x3d46('0x23')];var _0x1de75b=crypto[_0x3d46('0x15')](_0x3d46('0x16'))[_0x3d46('0x17')](_0x32647c)[_0x3d46('0x18')](_0x3d46('0x24'));return _0x1de75b[_0x3d46('0x25')](0x0,0x8)+'-'+_0x1de75b[_0x3d46('0x25')](0x8,0xc)+'-'+_0x1de75b[_0x3d46('0x25')](0xc,0x10)+'-'+_0x1de75b[_0x3d46('0x25')](0x10,0x14)+'-'+_0x1de75b[_0x3d46('0x25')](0x14);}}; \ No newline at end of file +var _0xa674=['filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','keys','length'];(function(_0x21e6b6,_0x466934){var _0x30cf27=function(_0x49a49c){while(--_0x49a49c){_0x21e6b6['push'](_0x21e6b6['shift']());}};_0x30cf27(++_0x466934);}(_0xa674,0x19d));var _0x4a67=function(_0x2542f3,_0x171da9){_0x2542f3=_0x2542f3-0x0;var _0x2aa248=_0xa674[_0x2542f3];return _0x2aa248;};'use strict';var _=require(_0x4a67('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x4a67('0x1'));var exec=require('child_process')[_0x4a67('0x2')];var config=require('../environment');function getInterfaces(){var _0x4eb259=[];var _0x3f19ad=os[_0x4a67('0x3')]();var _0x5e321b=_[_0x4a67('0x4')](_[_0x4a67('0x5')](_0x3f19ad));for(var _0x2dcc6b=0x0;_0x2dcc6b<_0x5e321b[_0x4a67('0x6')];_0x2dcc6b++){var _0x302733=_0x3f19ad[_0x5e321b[_0x2dcc6b]][_0x4a67('0x7')](function(_0x1e6e4f){return _0x1e6e4f[_0x4a67('0x8')]===_0x4a67('0x9')&&_0x1e6e4f[_0x4a67('0xa')]===![];});_0x4eb259=_0x4eb259[_0x4a67('0xb')](_0x302733);}return _0x4eb259;}function getFirstInterface(){var _0xf580c1=_['head'](getInterfaces());return{'macAddress':_0xf580c1&&_0xf580c1[_0x4a67('0xc')]?_0xf580c1[_0x4a67('0xc')]:_0x4a67('0xd'),'ipAddress':_0xf580c1&&_0xf580c1['address']?_0xf580c1[_0x4a67('0xe')]:'127.0.0.1'};}exports[_0x4a67('0xf')]=getFirstInterface;function getCPUhash(){var _0x526ce2=_['orderBy'](os[_0x4a67('0x10')]()[_0x4a67('0x11')](function(_0x1e0785){return _0x1e0785[_0x4a67('0x12')];}))[_0x4a67('0x13')](':');return crypto[_0x4a67('0x14')](_0x4a67('0x15'))[_0x4a67('0x16')](_0x526ce2)[_0x4a67('0x17')](_0x4a67('0x18'));}exports[_0x4a67('0x19')]=function(){var _0x324ac3=os[_0x4a67('0x1a')]();var _0x53ae05=/[0-9a-f-]{36}/;if(config[_0x4a67('0x1b')]&&_0x53ae05[_0x4a67('0x1c')](config[_0x4a67('0x1b')])){return config[_0x4a67('0x1b')];}else if(_0x324ac3===_0x4a67('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x4a67('0x1e')]('\x0d\x0a','');}else{var _0x1db108=getFirstInterface();var _0xc00e4c=getCPUhash();var _0x57f207=_0xc00e4c+'|'+os[_0x4a67('0x1f')]()+'|'+_0x1db108[_0x4a67('0x20')]+'|'+_0x1db108[_0x4a67('0x21')];var _0x37a4f9=crypto[_0x4a67('0x14')](_0x4a67('0x15'))[_0x4a67('0x16')](_0x57f207)[_0x4a67('0x17')](_0x4a67('0x18'));return _0x37a4f9[_0x4a67('0x22')](0x0,0x8)+'-'+_0x37a4f9[_0x4a67('0x22')](0x8,0xc)+'-'+_0x37a4f9[_0x4a67('0x22')](0xc,0x10)+'-'+_0x37a4f9[_0x4a67('0x22')](0x10,0x14)+'-'+_0x37a4f9['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index d62919a..64f0499 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 _0x2097=['bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment'];(function(_0x538505,_0x3010e4){var _0x46c0a9=function(_0x371c77){while(--_0x371c77){_0x538505['push'](_0x538505['shift']());}};_0x46c0a9(++_0x3010e4);}(_0x2097,0x1ac));var _0x7209=function(_0xd82e11,_0x4d7011){_0xd82e11=_0xd82e11-0x0;var _0x4347e8=_0x2097[_0xd82e11];return _0x4347e8;};'use strict';var util=require(_0x7209('0x0'));var moment=require(_0x7209('0x1'));var rp=require('request-promise');var BPromise=require(_0x7209('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x7209('0x3'))['db'];var encryptor=require(_0x7209('0x4'));var hardware=require(_0x7209('0x5'));var logger=require(_0x7209('0x6'))(_0x7209('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3a891d){return new BPromise(function(_0x11418e,_0x2be61b){var _0x5b1864=util[_0x7209('0x8')](_0x7209('0x9'),HOST,_0x3a891d,module['exports'][_0x7209('0xa')]);if(oldToken){_0x5b1864=util[_0x7209('0x8')](_0x7209('0xb'),HOST,_0x3a891d,module[_0x7209('0xc')][_0x7209('0xa')],oldToken);}var _0x32f700={'uri':_0x5b1864,'method':_0x7209('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x32f700)[_0x7209('0xe')](function(_0x49fe68){_0x11418e(_0x49fe68);})[_0x7209('0xf')](function(_0x12359f){_0x2be61b(_0x12359f);});});}function manageLicense(_0x495cd0,_0x263c42){var _0x209233=_0x263c42[_0x7209('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x209233[_0x7209('0x11')]!==_0x495cd0&&!_0x209233[_0x7209('0x12')]){oldToken=_0x209233[_0x7209('0x11')];}httpRequest(_0x495cd0)[_0x7209('0xe')](function(_0x17f914){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x17f914[_0x7209('0x13')]){isOldTokenSent=![];if(!_0x209233['license']&&_0x209233[_0x7209('0x7')]!=_0x17f914['license']||_0x209233[_0x7209('0x7')]&&_0x209233[_0x7209('0x12')]){logger[_0x7209('0x14')](_0x7209('0x15'));}if(_0x209233[_0x7209('0x7')]&&!_0x209233[_0x7209('0x12')]&&_0x209233['license']!=_0x17f914[_0x7209('0x7')]){logger[_0x7209('0x14')](_0x7209('0x16'));}if(_0x209233[_0x7209('0x7')]&&!_0x209233['data2']&&_0x209233['license']==_0x17f914[_0x7209('0x7')]){return _0x263c42;}return _0x263c42[_0x7209('0x17')]({'data1':_0x495cd0,'data2':null,'license':_0x17f914['license']});}else{if(_0x17f914[_0x7209('0x7')]||_0x209233[_0x7209('0x7')]){if(!_0x209233[_0x7209('0x12')]){if(_0x209233[_0x7209('0x11')]==_0x495cd0){GRAY_PERIOD_REASON=_0x7209('0x18');logger['info'](_0x7209('0x19'));}else{GRAY_PERIOD_REASON=_0x7209('0x1a');logger['info'](_0x7209('0x1b'),_0x209233['data1'],_0x495cd0);}logger[_0x7209('0x14')](_0x7209('0x1c'),GRAY_PERIOD_REASON[_0x7209('0x1d')](),moment()[_0x7209('0x8')](_0x7209('0x1e')));return _0x263c42[_0x7209('0x17')]({'data2':encryptor[_0x7209('0x1f')](moment()[_0x7209('0x8')](_0x7209('0x1e')))});}else{if(moment()[_0x7209('0x20')](encryptor[_0x7209('0x21')](_0x209233[_0x7209('0x12')]),_0x7209('0x22'))>DAYS){logger[_0x7209('0x14')](_0x7209('0x23'),moment()[_0x7209('0x8')](_0x7209('0x1e')));isOldTokenSent=![];return _0x263c42[_0x7209('0x17')]({'data1':_0x495cd0,'data2':null,'license':null});}}}else{if(_0x209233[_0x7209('0x11')]!=_0x495cd0){logger[_0x7209('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x209233[_0x7209('0x11')],_0x495cd0);return _0x263c42['update']({'data1':_0x495cd0,'data2':null,'license':null});}}}return _0x263c42;})[_0x7209('0xe')](function(_0x2ec1c2){_0x263c42=_0x2ec1c2;})[_0x7209('0xf')](function(_0x40b2f6){logger[_0x7209('0x24')](_0x40b2f6[_0x7209('0x25')]);})[_0x7209('0x26')](function(){setTimeout(function(){manageLicense(hardware[_0x7209('0x27')](),_0x263c42);},TIME);});}function defaultLicense(){var _0x4ed380=hardware[_0x7209('0x27')]();if(_0x4ed380){return db[_0x7209('0x28')][_0x7209('0x29')]({'where':{'id':0x1},'defaults':{'data1':_0x4ed380}})['spread'](function(_0x25f019,_0x3af87f){logger[_0x7209('0x14')](_0x7209('0x2a'),_0x4ed380);manageLicense(_0x4ed380,_0x25f019);})[_0x7209('0xf')](function(_0x2f8acc){logger['error'](_0x2f8acc[_0x7209('0x25')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x97e0=['bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise'];(function(_0x514369,_0x1deef7){var _0x5820ba=function(_0x2b43ea){while(--_0x2b43ea){_0x514369['push'](_0x514369['shift']());}};_0x5820ba(++_0x1deef7);}(_0x97e0,0xa9));var _0x097e=function(_0x258d6e,_0x54387b){_0x258d6e=_0x258d6e-0x0;var _0x1654f2=_0x97e0[_0x258d6e];return _0x1654f2;};'use strict';var util=require(_0x097e('0x0'));var moment=require(_0x097e('0x1'));var rp=require(_0x097e('0x2'));var BPromise=require(_0x097e('0x3'));var pkginfo=require('pkginfo')(module,_0x097e('0x4'));var db=require(_0x097e('0x5'))['db'];var encryptor=require(_0x097e('0x6'));var hardware=require(_0x097e('0x7'));var logger=require(_0x097e('0x8'))(_0x097e('0x9'));var HOST=_0x097e('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x524912){return new BPromise(function(_0x32a592,_0x14e121){var _0x392851=util[_0x097e('0xb')](_0x097e('0xc'),HOST,_0x524912,module[_0x097e('0xd')][_0x097e('0x4')]);if(oldToken){_0x392851=util[_0x097e('0xb')](_0x097e('0xe'),HOST,_0x524912,module['exports'][_0x097e('0x4')],oldToken);}var _0x325c87={'uri':_0x392851,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x325c87)[_0x097e('0xf')](function(_0x23d13a){_0x32a592(_0x23d13a);})[_0x097e('0x10')](function(_0x207a8e){_0x14e121(_0x207a8e);});});}function manageLicense(_0x513eb6,_0x50bb1f){var _0x50c218=_0x50bb1f[_0x097e('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x50c218['data1']!==_0x513eb6&&!_0x50c218[_0x097e('0x12')]){oldToken=_0x50c218['data1'];}httpRequest(_0x513eb6)[_0x097e('0xf')](function(_0x1bbcef){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1bbcef[_0x097e('0x13')]){isOldTokenSent=![];if(!_0x50c218[_0x097e('0x9')]&&_0x50c218['license']!=_0x1bbcef[_0x097e('0x9')]||_0x50c218[_0x097e('0x9')]&&_0x50c218['data2']){logger[_0x097e('0x14')](_0x097e('0x15'));}if(_0x50c218[_0x097e('0x9')]&&!_0x50c218['data2']&&_0x50c218[_0x097e('0x9')]!=_0x1bbcef['license']){logger[_0x097e('0x14')](_0x097e('0x16'));}if(_0x50c218['license']&&!_0x50c218[_0x097e('0x12')]&&_0x50c218[_0x097e('0x9')]==_0x1bbcef[_0x097e('0x9')]){return _0x50bb1f;}return _0x50bb1f[_0x097e('0x17')]({'data1':_0x513eb6,'data2':null,'license':_0x1bbcef[_0x097e('0x9')]});}else{if(_0x1bbcef[_0x097e('0x9')]||_0x50c218[_0x097e('0x9')]){if(!_0x50c218[_0x097e('0x12')]){if(_0x50c218[_0x097e('0x18')]==_0x513eb6){GRAY_PERIOD_REASON=_0x097e('0x19');logger['info'](_0x097e('0x1a'));}else{GRAY_PERIOD_REASON=_0x097e('0x1b');logger[_0x097e('0x14')](_0x097e('0x1c'),_0x50c218[_0x097e('0x18')],_0x513eb6);}logger[_0x097e('0x14')](_0x097e('0x1d'),GRAY_PERIOD_REASON[_0x097e('0x1e')](),moment()[_0x097e('0xb')](_0x097e('0x1f')));return _0x50bb1f[_0x097e('0x17')]({'data2':encryptor[_0x097e('0x20')](moment()[_0x097e('0xb')](_0x097e('0x1f')))});}else{if(moment()[_0x097e('0x21')](encryptor['decryptString'](_0x50c218[_0x097e('0x12')]),'days')>DAYS){logger[_0x097e('0x14')](_0x097e('0x22'),moment()[_0x097e('0xb')](_0x097e('0x1f')));isOldTokenSent=![];return _0x50bb1f[_0x097e('0x17')]({'data1':_0x513eb6,'data2':null,'license':null});}}}else{if(_0x50c218[_0x097e('0x18')]!=_0x513eb6){logger[_0x097e('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x50c218[_0x097e('0x18')],_0x513eb6);return _0x50bb1f[_0x097e('0x17')]({'data1':_0x513eb6,'data2':null,'license':null});}}}return _0x50bb1f;})[_0x097e('0xf')](function(_0x3681ab){_0x50bb1f=_0x3681ab;})[_0x097e('0x10')](function(_0x2afeb5){logger[_0x097e('0x23')](_0x2afeb5[_0x097e('0x24')]);})[_0x097e('0x25')](function(){setTimeout(function(){manageLicense(hardware[_0x097e('0x26')](),_0x50bb1f);},TIME);});}function defaultLicense(){var _0x449c9e=hardware[_0x097e('0x26')]();if(_0x449c9e){return db[_0x097e('0x27')][_0x097e('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x449c9e}})[_0x097e('0x29')](function(_0x15ddb4,_0x5d2b3a){logger['info'](_0x097e('0x2a'),_0x449c9e);manageLicense(_0x449c9e,_0x15ddb4);})[_0x097e('0x10')](function(_0x55db77){logger[_0x097e('0x23')](_0x55db77[_0x097e('0x24')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index babc3ce..676e4c7 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 _0xcf72=['telephone','then','telephones','admin','count','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','uuid','license','data1','decryptString','%s:%s:%s','demo','machineUuid','deadline','add','days','format','grayReason','changed','message','User','findAll','role','COUNT','col','user'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf72,0x15b));var _0x2cf7=function(_0x12bfb0,_0x336162){_0x12bfb0=_0x12bfb0-0x0;var _0x35b875=_0xcf72[_0x12bfb0];return _0x35b875;};'use strict';var util=require(_0x2cf7('0x0'));var _=require(_0x2cf7('0x1'));var moment=require(_0x2cf7('0x2'));var BPromise=require(_0x2cf7('0x3'));var hardware=require(_0x2cf7('0x4'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2cf7('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x2cf7('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2cf7('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2cf7('0x7'),'machineUuid':hardware[_0x2cf7('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x16b882){return new BPromise(function(_0x4c887c,_0x52af0f){return db[_0x2cf7('0x8')][_0x2cf7('0x9')](_[_0x2cf7('0xa')](_0x16b882,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x522628){return checkLicense(_0x522628,null);})['then'](function(_0x3f8f7b){_0x4c887c(_0x3f8f7b);return;})['catch'](function(_0x320942){_0x52af0f(_0x320942);});});}function checkLicense(_0x253bcc,_0x3dbb2d){if(!_0x253bcc){demoLicense[_0x2cf7('0xb')]=_0x253bcc['data1'];return demoLicense;}try{var _0xb25eca=_0x3dbb2d||_0x253bcc[_0x2cf7('0xc')];if(_['isEmpty'](_0xb25eca)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x39608e=_0x253bcc[_0x2cf7('0xd')];var _0x3cbbc4=_0x253bcc['data2'];var _0x161e25=_0x39608e['split']('-')[0x4];var _0x38822b=_0x39608e['split']('-')[0x0];var _0x4ae03a=encryptor[_0x2cf7('0xe')](_0xb25eca,util['format'](_0x2cf7('0xf'),_0x161e25,_0x39608e,_0x38822b));var _0x28e141=JSON['parse'](_0x4ae03a);_0x28e141[_0x2cf7('0x10')]=![];_0x28e141[_0x2cf7('0xb')]=_0x39608e;_0x28e141[_0x2cf7('0x11')]=hardware[_0x2cf7('0x6')]();if(_0x3cbbc4){var _0x1489b3=encryptor['decryptString'](_0x3cbbc4);_0x28e141['gray']=_0x1489b3;_0x28e141[_0x2cf7('0x12')]=moment(_0x1489b3)[_0x2cf7('0x13')](0x7,_0x2cf7('0x14'))[_0x2cf7('0x15')]();_0x28e141[_0x2cf7('0x16')]=_0x28e141[_0x2cf7('0xb')]!=_0x28e141[_0x2cf7('0x11')]?_0x2cf7('0x17'):'disabled';}return _0x28e141;}catch(_0x142a98){breakingLicense[_0x2cf7('0xb')]=_0x253bcc[_0x2cf7('0xd')];breakingLicense[_0x2cf7('0x18')]=_0x142a98[_0x2cf7('0x18')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x18bd7a,_0x437227){getLicense()['then'](function(_0x496106){return db[_0x2cf7('0x19')][_0x2cf7('0x1a')]({'attributes':[_0x2cf7('0x1b'),[db['sequelize']['fn'](_0x2cf7('0x1c'),db['sequelize'][_0x2cf7('0x1d')](_0x2cf7('0x1b'))),'count']],'group':_0x2cf7('0x1b'),'where':{'role':{'$or':['admin',_0x2cf7('0x1e'),_0x2cf7('0x1f')]}},'raw':!![]})[_0x2cf7('0x20')](function(_0x210f03){var _0x500b9a={'user':_0x496106['users']||0x0,'telephone':_0x496106[_0x2cf7('0x21')]||0x0};_0x210f03['forEach'](function(_0x5688fd){var _0x2b297f=_0x5688fd[_0x2cf7('0x1b')]===_0x2cf7('0x22')?_0x2cf7('0x1e'):_0x5688fd[_0x2cf7('0x1b')];_0x500b9a[_0x2b297f]-=_0x5688fd[_0x2cf7('0x23')];if(_0x500b9a[_0x2b297f]<0x0)_0x500b9a[_0x2b297f]=0x0;});_0x18bd7a(_0x500b9a);return;});})[_0x2cf7('0x24')](function(_0x7fc7de){_0x437227(_0x7fc7de);});});}function checkUserLimits(_0x5c1155){return new BPromise(function(_0xf676b,_0xd71689){getLimits()['then'](function(_0x16e05a){var _0x4c1162=_[_0x2cf7('0x25')](_[_0x2cf7('0x26')](_0x5c1155,'role'),[_0x2cf7('0x22'),'user','telephone']);var _0x464aa8=(_0x4c1162[_0x2cf7('0x22')]||0x0)+(_0x4c1162[_0x2cf7('0x1e')]||0x0);var _0x24c160=_0x4c1162['telephone']||0x0;if(_0x464aa8>_0x16e05a[_0x2cf7('0x1e')])return _0xd71689(_0x2cf7('0x27'));if(_0x24c160>_0x16e05a[_0x2cf7('0x1f')])return _0xd71689(_0x2cf7('0x28'));return _0xf676b();})[_0x2cf7('0x24')](function(_0x2265d6){_0xd71689(_0x2265d6);});});}module[_0x2cf7('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xcbc6=['data2','split','decryptString','format','parse','uuid','machineUuid','gray','deadline','grayReason','changed','disabled','message','User','sequelize','COUNT','col','count','role','admin','user','telephone','users','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','./hardware','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xcbc6,0x71));var _0x6cbc=function(_0x2a0c21,_0x51ad5e){_0x2a0c21=_0x2a0c21-0x0;var _0x28f2ff=_0xcbc6[_0x2a0c21];return _0x28f2ff;};'use strict';var util=require(_0x6cbc('0x0'));var _=require('lodash');var moment=require(_0x6cbc('0x1'));var BPromise=require('bluebird');var hardware=require(_0x6cbc('0x2'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6cbc('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6cbc('0x4'),'machineUuid':hardware[_0x6cbc('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6cbc('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6cbc('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x54f5b6){return new BPromise(function(_0x55b68c,_0x47f743){return db[_0x6cbc('0x7')][_0x6cbc('0x8')](_[_0x6cbc('0x9')](_0x54f5b6,{'raw':!![],'where':{'id':0x1}}))[_0x6cbc('0xa')](function(_0x1bde9e){return checkLicense(_0x1bde9e,null);})[_0x6cbc('0xa')](function(_0xbd4470){_0x55b68c(_0xbd4470);return;})[_0x6cbc('0xb')](function(_0x359509){_0x47f743(_0x359509);});});}function checkLicense(_0x525792,_0xa6f427){if(!_0x525792){demoLicense['uuid']=_0x525792[_0x6cbc('0xc')];return demoLicense;}try{var _0x2c7824=_0xa6f427||_0x525792[_0x6cbc('0xd')];if(_[_0x6cbc('0xe')](_0x2c7824)){throw new Error(_0x6cbc('0xf'));}var _0xc96a91=_0x525792[_0x6cbc('0xc')];var _0x1cb442=_0x525792[_0x6cbc('0x10')];var _0x3d9f32=_0xc96a91[_0x6cbc('0x11')]('-')[0x4];var _0x159f45=_0xc96a91[_0x6cbc('0x11')]('-')[0x0];var _0xa9feb6=encryptor[_0x6cbc('0x12')](_0x2c7824,util[_0x6cbc('0x13')]('%s:%s:%s',_0x3d9f32,_0xc96a91,_0x159f45));var _0x3baada=JSON[_0x6cbc('0x14')](_0xa9feb6);_0x3baada['demo']=![];_0x3baada[_0x6cbc('0x15')]=_0xc96a91;_0x3baada[_0x6cbc('0x16')]=hardware[_0x6cbc('0x5')]();if(_0x1cb442){var _0x19168c=encryptor[_0x6cbc('0x12')](_0x1cb442);_0x3baada[_0x6cbc('0x17')]=_0x19168c;_0x3baada[_0x6cbc('0x18')]=moment(_0x19168c)['add'](0x7,'days')[_0x6cbc('0x13')]();_0x3baada[_0x6cbc('0x19')]=_0x3baada['uuid']!=_0x3baada[_0x6cbc('0x16')]?_0x6cbc('0x1a'):_0x6cbc('0x1b');}return _0x3baada;}catch(_0x10b99b){breakingLicense[_0x6cbc('0x15')]=_0x525792[_0x6cbc('0xc')];breakingLicense['message']=_0x10b99b[_0x6cbc('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x499c78,_0x1cb1f3){getLicense()[_0x6cbc('0xa')](function(_0x2a8865){return db[_0x6cbc('0x1d')]['findAll']({'attributes':['role',[db[_0x6cbc('0x1e')]['fn'](_0x6cbc('0x1f'),db['sequelize'][_0x6cbc('0x20')]('role')),_0x6cbc('0x21')]],'group':_0x6cbc('0x22'),'where':{'role':{'$or':[_0x6cbc('0x23'),_0x6cbc('0x24'),_0x6cbc('0x25')]}},'raw':!![]})[_0x6cbc('0xa')](function(_0x5e942f){var _0x30bb58={'user':_0x2a8865[_0x6cbc('0x26')]||0x0,'telephone':_0x2a8865['telephones']||0x0};_0x5e942f[_0x6cbc('0x27')](function(_0x2a5ad7){var _0x282ce0=_0x2a5ad7[_0x6cbc('0x22')]===_0x6cbc('0x23')?'user':_0x2a5ad7[_0x6cbc('0x22')];_0x30bb58[_0x282ce0]-=_0x2a5ad7[_0x6cbc('0x21')];if(_0x30bb58[_0x282ce0]<0x0)_0x30bb58[_0x282ce0]=0x0;});_0x499c78(_0x30bb58);return;});})['catch'](function(_0x1e3386){_0x1cb1f3(_0x1e3386);});});}function checkUserLimits(_0x21c5dd){return new BPromise(function(_0x44d228,_0x10b54d){getLimits()[_0x6cbc('0xa')](function(_0x493c5f){var _0x8dc399=_['pick'](_[_0x6cbc('0x28')](_0x21c5dd,'role'),[_0x6cbc('0x23'),_0x6cbc('0x24'),'telephone']);var _0x31c4a4=(_0x8dc399['admin']||0x0)+(_0x8dc399[_0x6cbc('0x24')]||0x0);var _0x584534=_0x8dc399['telephone']||0x0;if(_0x31c4a4>_0x493c5f[_0x6cbc('0x24')])return _0x10b54d(_0x6cbc('0x29'));if(_0x584534>_0x493c5f['telephone'])return _0x10b54d(_0x6cbc('0x2a'));return _0x44d228();})['catch'](function(_0x13d236){_0x10b54d(_0x13d236);});});}module['exports']={'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 a693650..37550c6 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 _0x056b=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x440d6c,_0x2a4c3a){var _0x2470c5=function(_0x4f5c8b){while(--_0x4f5c8b){_0x440d6c['push'](_0x440d6c['shift']());}};_0x2470c5(++_0x2a4c3a);}(_0x056b,0xb6));var _0xb056=function(_0x5d6bd6,_0x10e488){_0x5d6bd6=_0x5d6bd6-0x0;var _0x167aef=_0x056b[_0x5d6bd6];return _0x167aef;};'use strict';module['exports']={'DOMAIN':_0xb056('0x0'),'SESSION_SECRET':_0xb056('0x1'),'GOOGLE_ID':_0xb056('0x2'),'GOOGLE_SECRET':_0xb056('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x4b17=['secret','exports','myappanuglar-secret'];(function(_0x1bc47e,_0x3f0eba){var _0x5aade1=function(_0x364189){while(--_0x364189){_0x1bc47e['push'](_0x1bc47e['shift']());}};_0x5aade1(++_0x3f0eba);}(_0x4b17,0x10f));var _0x74b1=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0x4b17[_0xe51596];return _0x22c705;};'use strict';module[_0x74b1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x74b1('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x74b1('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ef9c3ec..583436f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d48=['exports','../utils/loggers'];(function(_0x2a5e39,_0x1dd030){var _0x5a8748=function(_0x469c00){while(--_0x469c00){_0x2a5e39['push'](_0x2a5e39['shift']());}};_0x5a8748(++_0x1dd030);}(_0x4d48,0x89));var _0x84d4=function(_0xa5a920,_0x2d8772){_0xa5a920=_0xa5a920-0x0;var _0x596618=_0x4d48[_0xa5a920];return _0x596618;};'use strict';var fileLogger=require(_0x84d4('0x0'))['fileLogger'];module[_0x84d4('0x1')]=fileLogger; \ No newline at end of file +var _0x55f0=['exports','../utils/loggers'];(function(_0x4d525c,_0x277dac){var _0x3f0655=function(_0x5e8102){while(--_0x5e8102){_0x4d525c['push'](_0x4d525c['shift']());}};_0x3f0655(++_0x277dac);}(_0x55f0,0x1e3));var _0x055f=function(_0x5528bc,_0x3fbeca){_0x5528bc=_0x5528bc-0x0;var _0x592eea=_0x55f0[_0x5528bc];return _0x592eea;};'use strict';var fileLogger=require(_0x055f('0x0'))['fileLogger'];module[_0x055f('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index f782c80..61226da 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 _0x2a01=['../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','agi','../../services/email/index.js','routing','../../services/routing/index.js','xdr'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2a01,0x1e5));var _0x12a0=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2a01[_0x1928c9];return _0x51b5fb;};'use strict';var path=require(_0x12a0('0x0'));var os=require('os');var config={'apps':[{'name':_0x12a0('0x1'),'script':path[_0x12a0('0x2')](__dirname,_0x12a0('0x3'))},{'name':_0x12a0('0x4'),'script':path[_0x12a0('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x12a0('0x5'),'script':path[_0x12a0('0x2')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x12a0('0x2')](__dirname,_0x12a0('0x6'))},{'name':_0x12a0('0x7'),'script':path[_0x12a0('0x2')](__dirname,_0x12a0('0x8'))},{'name':_0x12a0('0x9'),'script':path['join'](__dirname,_0x12a0('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0xce52=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join'];(function(_0x379b38,_0x2c1c0c){var _0x2deb1b=function(_0x23ee25){while(--_0x23ee25){_0x379b38['push'](_0x379b38['shift']());}};_0x2deb1b(++_0x2c1c0c);}(_0xce52,0x135));var _0x2ce5=function(_0x25634c,_0x1e1c8d){_0x25634c=_0x25634c-0x0;var _0x5d1001=_0xce52[_0x25634c];return _0x5d1001;};'use strict';var path=require(_0x2ce5('0x0'));var os=require('os');var config={'apps':[{'name':_0x2ce5('0x1'),'script':path[_0x2ce5('0x2')](__dirname,_0x2ce5('0x3'))},{'name':_0x2ce5('0x4'),'script':path[_0x2ce5('0x2')](__dirname,_0x2ce5('0x5'))},{'name':_0x2ce5('0x6'),'script':path[_0x2ce5('0x2')](__dirname,_0x2ce5('0x7'))},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x2ce5('0x8'),'script':path['join'](__dirname,_0x2ce5('0x9'))},{'name':_0x2ce5('0xa'),'script':path['join'](__dirname,_0x2ce5('0xb'))}]};module[_0x2ce5('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 97454e5..a25d73c 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 _0xdcb4=['delete','dump','saved','pm2','./config','connect','connected','disconnect','stop','then','restart','list','describe'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0xdcb4,0x1a3));var _0x4dcb=function(_0x169592,_0xf06adc){_0x169592=_0x169592-0x0;var _0x5a7257=_0xdcb4[_0x169592];return _0x5a7257;};'use strict';var pm2=require(_0x4dcb('0x0'));var BPromise=require('bluebird');var config=require(_0x4dcb('0x1'));function connect(){return new BPromise(function(_0x2a72e6,_0x3dfee9){return pm2[_0x4dcb('0x2')](function(_0x379a89){if(_0x379a89){return _0x3dfee9(_0x379a89);}return _0x2a72e6(_0x4dcb('0x3'));});});};exports['start']=function(_0x2d23ed){return connect()['then'](function(){return new BPromise(function(_0x54a94c,_0x2a0b3b){return pm2['start'](_0x2d23ed,function(_0x236162,_0x5ab5c3){if(_0x236162){return _0x2a0b3b(_0x236162);}pm2[_0x4dcb('0x4')]();return _0x54a94c(_0x5ab5c3);});});});};exports[_0x4dcb('0x5')]=function(_0x937c95){return connect()[_0x4dcb('0x6')](function(){return new BPromise(function(_0x362a91,_0x16e3d5){return pm2[_0x4dcb('0x5')](_0x937c95,function(_0x265702,_0x1b3332){if(_0x265702){return _0x16e3d5(_0x265702);}pm2[_0x4dcb('0x4')]();return _0x362a91(_0x1b3332);});});});};exports[_0x4dcb('0x7')]=function(_0x1fe980){return connect()['then'](function(){return new BPromise(function(_0x27638b,_0x3dd8b0){return pm2[_0x4dcb('0x7')](_0x1fe980,function(_0xf368b8,_0x1fb2df){if(_0xf368b8){return _0x3dd8b0(_0xf368b8);}pm2[_0x4dcb('0x4')]();return _0x27638b(_0x1fb2df);});});});};exports[_0x4dcb('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x159bca,_0x1444a2){return pm2['list'](function(_0x417b21,_0x2dd50e){if(_0x417b21){return _0x1444a2(_0x417b21);}pm2['disconnect']();return _0x159bca(_0x2dd50e);});});});};exports[_0x4dcb('0x9')]=function(_0x38fef7){return connect()[_0x4dcb('0x6')](function(){return new BPromise(function(_0x44d121,_0x4e34b8){return pm2[_0x4dcb('0x9')](_0x38fef7,function(_0x167f8c,_0x112f79){if(_0x167f8c){return _0x4e34b8(_0x167f8c);}pm2[_0x4dcb('0x4')]();return _0x44d121(_0x112f79);});});});};exports[_0x4dcb('0xa')]=function(_0x1e67cc){return connect()[_0x4dcb('0x6')](function(){return new BPromise(function(_0x95ebf4,_0x604a6f){return pm2[_0x4dcb('0xa')](_0x1e67cc,function(_0x172fe7,_0x4f4057){if(_0x172fe7){return _0x604a6f(_0x172fe7);}pm2[_0x4dcb('0x4')]();return _0x95ebf4(_0x4f4057);});});});};exports[_0x4dcb('0xb')]=function(){return connect()[_0x4dcb('0x6')](function(){return new BPromise(function(_0x371ff6,_0x17c87c){return pm2[_0x4dcb('0xb')](function(_0x1f3f9e){if(_0x1f3f9e){return _0x17c87c(_0x1f3f9e);}return _0x371ff6(_0x4dcb('0xc'));});});});}; \ No newline at end of file +var _0x12e9=['dump','saved','pm2','bluebird','./config','connect','then','disconnect','restart','list','describe','delete'];(function(_0x235949,_0x1ecf17){var _0xdcd3be=function(_0x471015){while(--_0x471015){_0x235949['push'](_0x235949['shift']());}};_0xdcd3be(++_0x1ecf17);}(_0x12e9,0x152));var _0x912e=function(_0x4ba843,_0x3819f0){_0x4ba843=_0x4ba843-0x0;var _0x270a39=_0x12e9[_0x4ba843];return _0x270a39;};'use strict';var pm2=require(_0x912e('0x0'));var BPromise=require(_0x912e('0x1'));var config=require(_0x912e('0x2'));function connect(){return new BPromise(function(_0x4b4876,_0x3e448d){return pm2[_0x912e('0x3')](function(_0x5b5fa2){if(_0x5b5fa2){return _0x3e448d(_0x5b5fa2);}return _0x4b4876('connected');});});};exports['start']=function(_0x12135e){return connect()[_0x912e('0x4')](function(){return new BPromise(function(_0x42d64f,_0x246c3b){return pm2['start'](_0x12135e,function(_0x1b3466,_0x547f03){if(_0x1b3466){return _0x246c3b(_0x1b3466);}pm2[_0x912e('0x5')]();return _0x42d64f(_0x547f03);});});});};exports['stop']=function(_0x508eda){return connect()['then'](function(){return new BPromise(function(_0x429214,_0x3fdaa8){return pm2['stop'](_0x508eda,function(_0x5235bf,_0x1c41be){if(_0x5235bf){return _0x3fdaa8(_0x5235bf);}pm2[_0x912e('0x5')]();return _0x429214(_0x1c41be);});});});};exports[_0x912e('0x6')]=function(_0xa03388){return connect()[_0x912e('0x4')](function(){return new BPromise(function(_0x36b75b,_0x1eb032){return pm2[_0x912e('0x6')](_0xa03388,function(_0x9dd588,_0x27a2bd){if(_0x9dd588){return _0x1eb032(_0x9dd588);}pm2['disconnect']();return _0x36b75b(_0x27a2bd);});});});};exports[_0x912e('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3022f3,_0x5ad82c){return pm2[_0x912e('0x7')](function(_0x598789,_0x241d1f){if(_0x598789){return _0x5ad82c(_0x598789);}pm2['disconnect']();return _0x3022f3(_0x241d1f);});});});};exports[_0x912e('0x8')]=function(_0x4b1e45){return connect()['then'](function(){return new BPromise(function(_0x1162d5,_0x18fde9){return pm2[_0x912e('0x8')](_0x4b1e45,function(_0x2e3a74,_0x4dcee0){if(_0x2e3a74){return _0x18fde9(_0x2e3a74);}pm2[_0x912e('0x5')]();return _0x1162d5(_0x4dcee0);});});});};exports[_0x912e('0x9')]=function(_0x332e5a){return connect()['then'](function(){return new BPromise(function(_0x4232d5,_0x11eccf){return pm2[_0x912e('0x9')](_0x332e5a,function(_0x40297d,_0x2d20ac){if(_0x40297d){return _0x11eccf(_0x40297d);}pm2['disconnect']();return _0x4232d5(_0x2d20ac);});});});};exports[_0x912e('0xa')]=function(){return connect()[_0x912e('0x4')](function(){return new BPromise(function(_0x3cec15,_0x3d23d5){return pm2[_0x912e('0xa')](function(_0x27ae3b){if(_0x27ae3b){return _0x3d23d5(_0x27ae3b);}return _0x3cec15(_0x912e('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 54b4834..1c8d79c 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 _0x05d2=['timeout','format','emit','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','then','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update'];(function(_0x428dab,_0xc639d5){var _0x2b9e66=function(_0x2e83a0){while(--_0x2e83a0){_0x428dab['push'](_0x428dab['shift']());}};_0x2b9e66(++_0xc639d5);}(_0x05d2,0x1c6));var _0x205d=function(_0x52c3aa,_0x52990b){_0x52c3aa=_0x52c3aa-0x0;var _0x4b0a21=_0x05d2[_0x52c3aa];return _0x4b0a21;};'use strict';var _=require(_0x205d('0x0'));var moment=require(_0x205d('0x1'));var Redis=require('ioredis');var util=require(_0x205d('0x2'));var config=require('../../config/environment');var db=require(_0x205d('0x3'))['db'];var logger=require(_0x205d('0x4'))('schedule');config[_0x205d('0x5')]=_[_0x205d('0x6')](config[_0x205d('0x5')],{'host':_0x205d('0x7'),'port':0x18eb});var io=require(_0x205d('0x8'))(new Redis(config[_0x205d('0x5')]));function closeInteractions(){var _0x1af569=0x0;var _0x4c0780=[];return db[_0x205d('0x9')][_0x205d('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x205d('0xb')](function(_0x360f48){_0x1af569=_0x360f48['chatTimeout'];if(_0x1af569){return db['ChatInteraction'][_0x205d('0xc')]({'raw':!![],'attributes':['id',_0x205d('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x205d('0xe')](_0x360f48['chatTimeout'],_0x205d('0xf'))}}});}else{return[];}})['then'](function(_0x4e71d4){if(_0x4e71d4&&_0x4e71d4[_0x205d('0x10')]){_0x4c0780=_['map'](_0x4e71d4||[],'id');logger[_0x205d('0x11')](_0x205d('0x12'),_0x4c0780[_0x205d('0x13')]());return db[_0x205d('0x14')][_0x205d('0x15')]({'closeReason':'system','disposition':_0x205d('0x16'),'closed':!![],'closedAt':moment()[_0x205d('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4c0780}});}})[_0x205d('0xb')](function(){if(_0x4c0780&&_0x4c0780[_0x205d('0x10')]){logger[_0x205d('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4c0780['join']());for(var _0x653afa=0x0;_0x653afa<_0x4c0780[_0x205d('0x10')];_0x653afa++){io[_0x205d('0x18')]('chatInteraction:update',{'id':_0x4c0780[_0x653afa],'closed':!![]});}}})['catch'](function(_0x394749){logger[_0x205d('0x19')](_0x205d('0x1a'),_0x394749?util['inspect'](_0x394749,{'showHidden':![],'depth':null}):'');});}exports[_0x205d('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xef91=['ioredis','util','../../config/environment','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','findAll','lastMsgAt','minutes','then','length','map','join','ChatInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','start','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xef91,0x9f));var _0x1ef9=function(_0x2f026e,_0x41ef79){_0x2f026e=_0x2f026e-0x0;var _0x5321ee=_0xef91[_0x2f026e];return _0x5321ee;};'use strict';var _=require('lodash');var moment=require(_0x1ef9('0x0'));var Redis=require(_0x1ef9('0x1'));var util=require(_0x1ef9('0x2'));var config=require(_0x1ef9('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x1ef9('0x4'));config[_0x1ef9('0x5')]=_[_0x1ef9('0x6')](config[_0x1ef9('0x5')],{'host':_0x1ef9('0x7'),'port':0x18eb});var io=require(_0x1ef9('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x196320=0x0;var _0x5b6443=[];return db[_0x1ef9('0x9')][_0x1ef9('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0xa8299){_0x196320=_0xa8299[_0x1ef9('0xb')];if(_0x196320){return db['ChatInteraction'][_0x1ef9('0xc')]({'raw':!![],'attributes':['id',_0x1ef9('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0xa8299[_0x1ef9('0xb')],_0x1ef9('0xe'))}}});}else{return[];}})[_0x1ef9('0xf')](function(_0x16da65){if(_0x16da65&&_0x16da65[_0x1ef9('0x10')]){_0x5b6443=_[_0x1ef9('0x11')](_0x16da65||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x5b6443[_0x1ef9('0x12')]());return db[_0x1ef9('0x13')]['update']({'closeReason':_0x1ef9('0x14'),'disposition':_0x1ef9('0x15'),'closed':!![],'closedAt':moment()[_0x1ef9('0x16')](_0x1ef9('0x17'))},{'where':{'id':_0x5b6443}});}})[_0x1ef9('0xf')](function(){if(_0x5b6443&&_0x5b6443[_0x1ef9('0x10')]){logger[_0x1ef9('0x18')](_0x1ef9('0x19'),_0x5b6443[_0x1ef9('0x12')]());for(var _0x33e043=0x0;_0x33e043<_0x5b6443['length'];_0x33e043++){io[_0x1ef9('0x1a')](_0x1ef9('0x1b'),{'id':_0x5b6443[_0x33e043],'closed':!![]});}}})[_0x1ef9('0x1c')](function(_0x3700ba){logger[_0x1ef9('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x3700ba?util[_0x1ef9('0x1e')](_0x3700ba,{'showHidden':![],'depth':null}):'');});}exports[_0x1ef9('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 9425158..60aca77 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 _0x3a93=['service','MailAccount','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','stringify','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','exec\x20custom\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','jobs','map','keyBy','difference','intersection','length','toString','exists','deleteJob','toRun','index','run\x20job','cron','isBetween','startAt','endAt','add','add\x20cron','stop','stop\x20cron','active','update','update\x20cron','start','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','Smtp'];(function(_0x35057d,_0x3d1eb9){var _0x342c5b=function(_0x5650e2){while(--_0x5650e2){_0x35057d['push'](_0x35057d['shift']());}};_0x342c5b(++_0x3d1eb9);}(_0x3a93,0x167));var _0x33a9=function(_0x47eba0,_0x57591f){_0x47eba0=_0x47eba0-0x0;var _0x5648a3=_0x3a93[_0x47eba0];return _0x5648a3;};'use strict';var fs=require('fs');var util=require(_0x33a9('0x0'));var path=require(_0x33a9('0x1'));var _=require(_0x33a9('0x2'));var moment=require('moment');var CronJobManager=require(_0x33a9('0x3'));var jayson=require(_0x33a9('0x4'));var BPromise=require(_0x33a9('0x5'));var logger=require('../logger')('schedule');var db=require(_0x33a9('0x6'))['db'];var analyticCustomReportController=require(_0x33a9('0x7'));var analyticDefaultReportController=require(_0x33a9('0x8'));var client=jayson[_0x33a9('0x9')][_0x33a9('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26681b,_0x1efbaa){return function(){logger['info'](_0x33a9('0xb'),_0x26681b['email']);var _0x202e75=!![];var _0xfa54c0={'tls':{'rejectUnauthorized':![]}};if(_0x26681b['MailAccount'][_0x33a9('0xc')][_0x33a9('0xd')]){_0xfa54c0[_0x33a9('0xd')]=_0x26681b[_0x33a9('0xe')]['Smtp'][_0x33a9('0xd')];}else{_0xfa54c0[_0x33a9('0xf')]=_0x26681b[_0x33a9('0xe')][_0x33a9('0xc')][_0x33a9('0xf')];_0xfa54c0[_0x33a9('0x10')]=_0x26681b[_0x33a9('0xe')][_0x33a9('0xc')]['port'];_0xfa54c0[_0x33a9('0x11')]=_0x26681b['MailAccount'][_0x33a9('0xc')][_0x33a9('0x11')];}if(_0x26681b[_0x33a9('0xe')][_0x33a9('0xc')]['authentication']){_0xfa54c0[_0x33a9('0x12')]={'user':_0x26681b[_0x33a9('0xe')][_0x33a9('0xc')][_0x33a9('0x13')],'pass':_0x26681b[_0x33a9('0xe')][_0x33a9('0xc')][_0x33a9('0x14')]};}var _0x32c3e7={'account':_0xfa54c0,'message':{'from':util[_0x33a9('0x15')](_0x33a9('0x16'),_0x26681b['MailAccount'][_0x33a9('0x17')],_0x26681b[_0x33a9('0xe')][_0x33a9('0x18')]||_0x26681b[_0x33a9('0xe')][_0x33a9('0xc')][_0x33a9('0x13')]),'to':_0x26681b[_0x33a9('0x18')],'cc':_0x26681b['cc'],'bcc':_0x26681b[_0x33a9('0x19')],'subject':util[_0x33a9('0x15')](_0x33a9('0x1a'),_0x1efbaa['name'],_0x26681b[_0x33a9('0x1b')],_0x26681b[_0x33a9('0x1c')])}};var _0x4a4de6=path[_0x33a9('0x1d')](__dirname,_0x33a9('0x1e'));var _0xe05341=_0x1efbaa['savename'];var _0x1e89a5=util[_0x33a9('0x15')](_0x33a9('0x1f'),path[_0x33a9('0x20')](_0x1efbaa[_0x33a9('0x21')],path[_0x33a9('0x22')](_0x1efbaa[_0x33a9('0x21')])),_0x33a9('0x23'));var _0x3c0ba4=path[_0x33a9('0x1d')](_0x4a4de6,_0xe05341);var _0x5e4f54=path[_0x33a9('0x1d')](_0x4a4de6,_0x1e89a5);if(fs[_0x33a9('0x24')](_0x3c0ba4)){_0x1efbaa[_0x33a9('0x25')]=_0x33a9('0x26');_0x32c3e7[_0x33a9('0x27')][_0x33a9('0x28')]=[{'filename':_0xe05341,'path':_0x3c0ba4}];_0x32c3e7['message']['text']=util[_0x33a9('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x33a9('0x29')](_0x1efbaa,null,0x2));}else if(fs[_0x33a9('0x24')](_0x5e4f54)){_0x1efbaa[_0x33a9('0x25')]=_0x33a9('0x26');_0x32c3e7['message'][_0x33a9('0x28')]=[{'filename':_0x1e89a5,'path':_0x5e4f54}];}else{_0x32c3e7['message'][_0x33a9('0x2a')]=_0x33a9('0x2b');if(!_0x26681b[_0x33a9('0x2c')]){_0x202e75=![];logger[_0x33a9('0x2d')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x202e75){return client[_0x33a9('0x2e')](_0x33a9('0x2f'),_0x32c3e7)[_0x33a9('0x30')](function(_0x31823b){if(_0x31823b[_0x33a9('0x31')]){return logger[_0x33a9('0x31')](_0x33a9('0x32'),JSON[_0x33a9('0x29')](_0x31823b));}return logger[_0x33a9('0x2d')](_0x33a9('0x33'));})[_0x33a9('0x34')](function(_0x4d59d6){return logger['error'](_0x33a9('0x32'),JSON[_0x33a9('0x29')](_0x4d59d6));});}};}function handleError(){return function(_0x18e658){return logger['error'](JSON[_0x33a9('0x29')](_0x18e658));};}function handleResult(_0x44c29c){return function(_0x12830f){logger[_0x33a9('0x2d')](_0x33a9('0x35'),JSON[_0x33a9('0x29')](_0x12830f));if(_0x44c29c[_0x33a9('0xe')]&&_0x44c29c[_0x33a9('0xe')][_0x33a9('0xc')]&&!_[_0x33a9('0x36')](_0x44c29c[_0x33a9('0x18')])){setTimeout(handleSendEmail(_0x44c29c,_0x12830f),0x3c*0x3e8);}};}function handleJob(_0x2b70dc){return function(){try{if(_[_0x33a9('0x36')](_0x2b70dc['subtractNumber'])){return logger[_0x33a9('0x2d')](_0x33a9('0x37'));}if(_['isNil'](_0x2b70dc[_0x33a9('0x1c')])){return logger['info'](_0x33a9('0x38'));}var _0x26635a={'startDate':moment()[_0x33a9('0x39')](_0x2b70dc[_0x33a9('0x1b')],_0x2b70dc[_0x33a9('0x1c')])[_0x33a9('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x33a9('0x15')](_0x33a9('0x3a')),'type':_0x33a9('0x3b'),'output':_0x2b70dc[_0x33a9('0x3c')],'name':_0x2b70dc['name']};if(!_['isNil'](_0x2b70dc[_0x33a9('0x3d')])){logger[_0x33a9('0x2d')](_0x33a9('0x3e'),_0x2b70dc[_0x33a9('0x3d')]);return analyticDefaultReportController['runReport']({'id':_0x2b70dc['DefaultReportId']},_0x26635a)[_0x33a9('0x30')](handleResult(_0x2b70dc))[_0x33a9('0x34')](handleError());}if(!_[_0x33a9('0x36')](_0x2b70dc['CustomReportId'])){logger['info'](_0x33a9('0x3f'),_0x2b70dc['CustomReportId']);return analyticCustomReportController[_0x33a9('0x40')]({'id':_0x2b70dc[_0x33a9('0x41')]},_0x26635a)['then'](handleResult(_0x2b70dc))[_0x33a9('0x34')](handleError());}}catch(_0x4defc9){logger['error'](JSON[_0x33a9('0x29')](_0x4defc9));}return logger[_0x33a9('0x2d')](_0x33a9('0x42'));};}function getJobs(_0x52caea){var _0x325d0a={};if(_0x52caea){_0x325d0a['id']=_0x52caea;}return db[_0x33a9('0x43')][_0x33a9('0x44')]({'where':_0x325d0a,'include':[{'model':db[_0x33a9('0xe')],'attributes':['id',_0x33a9('0x17'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x33a9('0xc')}]}]})[_0x33a9('0x30')](function(_0x3f90ad){var _0x3a343e=_['keys'](manager[_0x33a9('0x45')]);var _0x499914=_[_0x33a9('0x46')](_0x3f90ad,function(_0x1419d0){return _0x1419d0['id']['toString']();});var _0x4b2822=_[_0x33a9('0x47')](_0x3f90ad,function(_0xed0015){return _0xed0015['id']['toString']();});var _0x453a6e=_0x52caea?_0x499914:_[_0x33a9('0x48')](_0x499914,_0x3a343e);var _0x4fd4a1=_[_0x33a9('0x49')](_0x499914,_0x3a343e);var _0x5954b0=_[_0x33a9('0x48')](_0x3a343e,_0x499914);var _0x69594e;var _0x1f28b5;for(_0x69594e=0x0;_0x69594e<_0x5954b0[_0x33a9('0x4a')]&&!_0x52caea;_0x69594e+=0x1){_0x1f28b5=_0x5954b0[_0x69594e][_0x33a9('0x4b')]();if(manager[_0x33a9('0x4c')](_0x1f28b5)){manager['stop'](_0x1f28b5);manager[_0x33a9('0x4d')](_0x1f28b5);logger['info']('delete\x20cron',_0x1f28b5);}}logger[_0x33a9('0x2d')](_0x33a9('0x4e'),JSON[_0x33a9('0x29')](_0x453a6e));for(_0x69594e=0x0;_0x69594e<_0x453a6e[_0x33a9('0x4a')];_0x69594e+=0x1){_0x1f28b5=_0x453a6e[_0x69594e]['toString']();logger[_0x33a9('0x2d')](_0x33a9('0x4f'),_0x1f28b5);if(_0x52caea){logger[_0x33a9('0x2d')]('my\x20id',_0x52caea);logger[_0x33a9('0x2d')](JSON[_0x33a9('0x29')](_0x4b2822[_0x1f28b5]));BPromise['resolve']()[_0x33a9('0x30')](handleJob(_0x4b2822[_0x1f28b5]));logger[_0x33a9('0x2d')](_0x33a9('0x50'),_0x4b2822[_0x1f28b5][_0x33a9('0x17')],_0x4b2822[_0x1f28b5][_0x33a9('0x51')]);}else if(_0x4b2822[_0x1f28b5]['cron']&&_0x4b2822[_0x1f28b5]['active']&&moment()[_0x33a9('0x52')](_0x4b2822[_0x1f28b5][_0x33a9('0x53')],_0x4b2822[_0x1f28b5][_0x33a9('0x54')])){manager[_0x33a9('0x55')](_0x1f28b5,_0x4b2822[_0x1f28b5]['cron'],handleJob(_0x4b2822[_0x1f28b5]));manager['start'](_0x1f28b5);logger[_0x33a9('0x2d')](_0x33a9('0x56'),_0x4b2822[_0x1f28b5]['name'],_0x4b2822[_0x1f28b5][_0x33a9('0x51')]);}else if(manager['exists'](_0x1f28b5)){manager[_0x33a9('0x57')](_0x1f28b5);manager[_0x33a9('0x4d')](_0x1f28b5);logger['info'](_0x33a9('0x58'),_0x4b2822[_0x1f28b5][_0x33a9('0x17')],_0x4b2822[_0x1f28b5][_0x33a9('0x51')]);}}for(_0x69594e=0x0,_0x1f28b5;_0x69594e<_0x4fd4a1[_0x33a9('0x4a')]&&!_0x52caea;_0x69594e+=0x1){_0x1f28b5=_0x4fd4a1[_0x69594e][_0x33a9('0x4b')]();if(manager[_0x33a9('0x4c')](_0x1f28b5)){if(_0x4b2822[_0x1f28b5][_0x33a9('0x51')]&&_0x4b2822[_0x1f28b5][_0x33a9('0x59')]&&moment()['isBetween'](_0x4b2822[_0x1f28b5][_0x33a9('0x53')],_0x4b2822[_0x1f28b5]['endAt'])){manager[_0x33a9('0x5a')](_0x1f28b5,_0x4b2822[_0x1f28b5][_0x33a9('0x51')],handleJob(_0x4b2822[_0x1f28b5]));logger[_0x33a9('0x2d')](_0x33a9('0x5b'),_0x4b2822[_0x1f28b5][_0x33a9('0x17')],_0x4b2822[_0x1f28b5]['cron']);}else{manager[_0x33a9('0x57')](_0x1f28b5);manager[_0x33a9('0x4d')](_0x1f28b5);logger[_0x33a9('0x2d')](_0x33a9('0x58'),_0x4b2822[_0x1f28b5]['name'],_0x4b2822[_0x1f28b5][_0x33a9('0x51')]);}}}})['catch'](function(_0x3d3720){logger[_0x33a9('0x31')](JSON['stringify'](_0x3d3720));});}exports['run']=function(_0x328801){return getJobs(_0x328801);};exports[_0x33a9('0x5c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9f47=['toString','keyBy','difference','length','exists','stop','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','update','deleteJob','run','start','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','extname','zip','Sent','attachments','message','text','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map'];(function(_0x5e9456,_0x12e8dd){var _0x348dbf=function(_0x422a15){while(--_0x422a15){_0x5e9456['push'](_0x5e9456['shift']());}};_0x348dbf(++_0x12e8dd);}(_0x9f47,0x11e));var _0x79f4=function(_0x56ad36,_0x15de76){_0x56ad36=_0x56ad36-0x0;var _0x592494=_0x9f47[_0x56ad36];return _0x592494;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x79f4('0x0'));var _=require(_0x79f4('0x1'));var moment=require(_0x79f4('0x2'));var CronJobManager=require(_0x79f4('0x3'));var jayson=require(_0x79f4('0x4'));var BPromise=require(_0x79f4('0x5'));var logger=require(_0x79f4('0x6'))(_0x79f4('0x7'));var db=require(_0x79f4('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x79f4('0x9'));var client=jayson[_0x79f4('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x121ffe,_0x434bbd){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x121ffe['email']);var _0x38a436=!![];var _0x34fcc4={'tls':{'rejectUnauthorized':![]}};if(_0x121ffe[_0x79f4('0xb')][_0x79f4('0xc')][_0x79f4('0xd')]){_0x34fcc4[_0x79f4('0xd')]=_0x121ffe['MailAccount']['Smtp'][_0x79f4('0xd')];}else{_0x34fcc4[_0x79f4('0xe')]=_0x121ffe[_0x79f4('0xb')][_0x79f4('0xc')]['host'];_0x34fcc4[_0x79f4('0xf')]=_0x121ffe['MailAccount'][_0x79f4('0xc')][_0x79f4('0xf')];_0x34fcc4[_0x79f4('0x10')]=_0x121ffe['MailAccount'][_0x79f4('0xc')][_0x79f4('0x10')];}if(_0x121ffe[_0x79f4('0xb')][_0x79f4('0xc')][_0x79f4('0x11')]){_0x34fcc4[_0x79f4('0x12')]={'user':_0x121ffe[_0x79f4('0xb')][_0x79f4('0xc')][_0x79f4('0x13')],'pass':_0x121ffe[_0x79f4('0xb')][_0x79f4('0xc')][_0x79f4('0x14')]};}var _0x36b799={'account':_0x34fcc4,'message':{'from':util[_0x79f4('0x15')]('\x22%s\x22\x20<%s>',_0x121ffe['MailAccount'][_0x79f4('0x16')],_0x121ffe['MailAccount']['email']||_0x121ffe[_0x79f4('0xb')][_0x79f4('0xc')][_0x79f4('0x13')]),'to':_0x121ffe[_0x79f4('0x17')],'cc':_0x121ffe['cc'],'bcc':_0x121ffe[_0x79f4('0x18')],'subject':util[_0x79f4('0x15')](_0x79f4('0x19'),_0x434bbd[_0x79f4('0x16')],_0x121ffe[_0x79f4('0x1a')],_0x121ffe[_0x79f4('0x1b')])}};var _0x3a463c=path[_0x79f4('0x1c')](__dirname,_0x79f4('0x1d'));var _0x5bc5b8=_0x434bbd['savename'];var _0x33ba21=util['format']('%s.%s',path['basename'](_0x434bbd['savename'],path[_0x79f4('0x1e')](_0x434bbd['savename'])),_0x79f4('0x1f'));var _0x390b42=path[_0x79f4('0x1c')](_0x3a463c,_0x5bc5b8);var _0x5a8a4f=path[_0x79f4('0x1c')](_0x3a463c,_0x33ba21);if(fs['existsSync'](_0x390b42)){_0x434bbd['status']=_0x79f4('0x20');_0x36b799['message'][_0x79f4('0x21')]=[{'filename':_0x5bc5b8,'path':_0x390b42}];_0x36b799[_0x79f4('0x22')][_0x79f4('0x23')]=util[_0x79f4('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x434bbd,null,0x2));}else if(fs['existsSync'](_0x5a8a4f)){_0x434bbd[_0x79f4('0x24')]=_0x79f4('0x20');_0x36b799[_0x79f4('0x22')][_0x79f4('0x21')]=[{'filename':_0x33ba21,'path':_0x5a8a4f}];}else{_0x36b799[_0x79f4('0x22')][_0x79f4('0x23')]=_0x79f4('0x25');if(!_0x121ffe[_0x79f4('0x26')]){_0x38a436=![];logger[_0x79f4('0x27')](_0x79f4('0x28'));}}if(_0x38a436){return client[_0x79f4('0x29')](_0x79f4('0x2a'),_0x36b799)[_0x79f4('0x2b')](function(_0x6feb45){if(_0x6feb45[_0x79f4('0x2c')]){return logger[_0x79f4('0x2c')](_0x79f4('0x2d'),JSON[_0x79f4('0x2e')](_0x6feb45));}return logger[_0x79f4('0x27')](_0x79f4('0x2f'));})['catch'](function(_0x3e7056){return logger[_0x79f4('0x2c')](_0x79f4('0x2d'),JSON['stringify'](_0x3e7056));});}};}function handleError(){return function(_0x422d2e){return logger[_0x79f4('0x2c')](JSON[_0x79f4('0x2e')](_0x422d2e));};}function handleResult(_0x383ba2){return function(_0x502713){logger[_0x79f4('0x27')]('data',JSON[_0x79f4('0x2e')](_0x502713));if(_0x383ba2[_0x79f4('0xb')]&&_0x383ba2[_0x79f4('0xb')][_0x79f4('0xc')]&&!_[_0x79f4('0x30')](_0x383ba2[_0x79f4('0x17')])){setTimeout(handleSendEmail(_0x383ba2,_0x502713),0x3c*0x3e8);}};}function handleJob(_0x3e5753){return function(){try{if(_[_0x79f4('0x30')](_0x3e5753[_0x79f4('0x1a')])){return logger[_0x79f4('0x27')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x79f4('0x30')](_0x3e5753['subtractUnit'])){return logger[_0x79f4('0x27')](_0x79f4('0x31'));}var _0x5b9273={'startDate':moment()[_0x79f4('0x32')](_0x3e5753[_0x79f4('0x1a')],_0x3e5753[_0x79f4('0x1b')])[_0x79f4('0x15')](_0x79f4('0x33')),'endDate':moment()[_0x79f4('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x3e5753[_0x79f4('0x34')],'name':_0x3e5753[_0x79f4('0x16')]};if(!_[_0x79f4('0x30')](_0x3e5753[_0x79f4('0x35')])){logger[_0x79f4('0x27')](_0x79f4('0x36'),_0x3e5753['DefaultReportId']);return analyticDefaultReportController[_0x79f4('0x37')]({'id':_0x3e5753[_0x79f4('0x35')]},_0x5b9273)[_0x79f4('0x2b')](handleResult(_0x3e5753))[_0x79f4('0x38')](handleError());}if(!_[_0x79f4('0x30')](_0x3e5753[_0x79f4('0x39')])){logger[_0x79f4('0x27')](_0x79f4('0x3a'),_0x3e5753[_0x79f4('0x39')]);return analyticCustomReportController[_0x79f4('0x37')]({'id':_0x3e5753[_0x79f4('0x39')]},_0x5b9273)[_0x79f4('0x2b')](handleResult(_0x3e5753))['catch'](handleError());}}catch(_0x1a1713){logger['error'](JSON[_0x79f4('0x2e')](_0x1a1713));}return logger[_0x79f4('0x27')](_0x79f4('0x3b'));};}function getJobs(_0x225177){var _0x1da726={};if(_0x225177){_0x1da726['id']=_0x225177;}return db[_0x79f4('0x3c')][_0x79f4('0x3d')]({'where':_0x1da726,'include':[{'model':db[_0x79f4('0xb')],'attributes':['id',_0x79f4('0x16'),_0x79f4('0x17')],'include':[{'model':db[_0x79f4('0x3e')],'as':_0x79f4('0xc')}]}]})[_0x79f4('0x2b')](function(_0x4dd5c0){var _0x1edae9=_[_0x79f4('0x3f')](manager[_0x79f4('0x40')]);var _0x246bff=_[_0x79f4('0x41')](_0x4dd5c0,function(_0xf8d547){return _0xf8d547['id'][_0x79f4('0x42')]();});var _0x321569=_[_0x79f4('0x43')](_0x4dd5c0,function(_0x5ad219){return _0x5ad219['id'][_0x79f4('0x42')]();});var _0x5acb90=_0x225177?_0x246bff:_[_0x79f4('0x44')](_0x246bff,_0x1edae9);var _0x3310bf=_['intersection'](_0x246bff,_0x1edae9);var _0x2e0ea0=_['difference'](_0x1edae9,_0x246bff);var _0x1f82d3;var _0x5b6654;for(_0x1f82d3=0x0;_0x1f82d3<_0x2e0ea0[_0x79f4('0x45')]&&!_0x225177;_0x1f82d3+=0x1){_0x5b6654=_0x2e0ea0[_0x1f82d3][_0x79f4('0x42')]();if(manager[_0x79f4('0x46')](_0x5b6654)){manager[_0x79f4('0x47')](_0x5b6654);manager['deleteJob'](_0x5b6654);logger[_0x79f4('0x27')]('delete\x20cron',_0x5b6654);}}logger[_0x79f4('0x27')](_0x79f4('0x48'),JSON[_0x79f4('0x2e')](_0x5acb90));for(_0x1f82d3=0x0;_0x1f82d3<_0x5acb90['length'];_0x1f82d3+=0x1){_0x5b6654=_0x5acb90[_0x1f82d3][_0x79f4('0x42')]();logger[_0x79f4('0x27')](_0x79f4('0x49'),_0x5b6654);if(_0x225177){logger[_0x79f4('0x27')](_0x79f4('0x4a'),_0x225177);logger['info'](JSON[_0x79f4('0x2e')](_0x321569[_0x5b6654]));BPromise[_0x79f4('0x4b')]()[_0x79f4('0x2b')](handleJob(_0x321569[_0x5b6654]));logger['info']('run\x20job',_0x321569[_0x5b6654][_0x79f4('0x16')],_0x321569[_0x5b6654][_0x79f4('0x4c')]);}else if(_0x321569[_0x5b6654][_0x79f4('0x4c')]&&_0x321569[_0x5b6654][_0x79f4('0x4d')]&&moment()[_0x79f4('0x4e')](_0x321569[_0x5b6654][_0x79f4('0x4f')],_0x321569[_0x5b6654][_0x79f4('0x50')])){manager[_0x79f4('0x51')](_0x5b6654,_0x321569[_0x5b6654][_0x79f4('0x4c')],handleJob(_0x321569[_0x5b6654]));manager['start'](_0x5b6654);logger[_0x79f4('0x27')](_0x79f4('0x52'),_0x321569[_0x5b6654]['name'],_0x321569[_0x5b6654]['cron']);}else if(manager[_0x79f4('0x46')](_0x5b6654)){manager[_0x79f4('0x47')](_0x5b6654);manager['deleteJob'](_0x5b6654);logger[_0x79f4('0x27')](_0x79f4('0x53'),_0x321569[_0x5b6654][_0x79f4('0x16')],_0x321569[_0x5b6654][_0x79f4('0x4c')]);}}for(_0x1f82d3=0x0,_0x5b6654;_0x1f82d3<_0x3310bf[_0x79f4('0x45')]&&!_0x225177;_0x1f82d3+=0x1){_0x5b6654=_0x3310bf[_0x1f82d3][_0x79f4('0x42')]();if(manager[_0x79f4('0x46')](_0x5b6654)){if(_0x321569[_0x5b6654][_0x79f4('0x4c')]&&_0x321569[_0x5b6654][_0x79f4('0x4d')]&&moment()[_0x79f4('0x4e')](_0x321569[_0x5b6654][_0x79f4('0x4f')],_0x321569[_0x5b6654][_0x79f4('0x50')])){manager[_0x79f4('0x54')](_0x5b6654,_0x321569[_0x5b6654]['cron'],handleJob(_0x321569[_0x5b6654]));logger[_0x79f4('0x27')]('update\x20cron',_0x321569[_0x5b6654]['name'],_0x321569[_0x5b6654]['cron']);}else{manager[_0x79f4('0x47')](_0x5b6654);manager[_0x79f4('0x55')](_0x5b6654);logger[_0x79f4('0x27')](_0x79f4('0x53'),_0x321569[_0x5b6654][_0x79f4('0x16')],_0x321569[_0x5b6654]['cron']);}}}})[_0x79f4('0x38')](function(_0xa66d25){logger[_0x79f4('0x2c')](JSON[_0x79f4('0x2e')](_0xa66d25));});}exports[_0x79f4('0x56')]=function(_0x14c6ec){return getJobs(_0x14c6ec);};exports[_0x79f4('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 1e843db..0830ea9 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 _0xeffd=['data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','inspect','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','info','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','findOne'];(function(_0x58d5a4,_0x5a9736){var _0x14f7a8=function(_0x326d56){while(--_0x326d56){_0x58d5a4['push'](_0x58d5a4['shift']());}};_0x14f7a8(++_0x5a9736);}(_0xeffd,0x6b));var _0xdeff=function(_0xfe63df,_0x27f972){_0xfe63df=_0xfe63df-0x0;var _0x435b5b=_0xeffd[_0xfe63df];return _0x435b5b;};var _=require(_0xdeff('0x0'));var AWS=require('aws-sdk');var rp=require(_0xdeff('0x1'));var util=require(_0xdeff('0x2'));var BPromise=require(_0xdeff('0x3'));var db=require(_0xdeff('0x4'))['db'];var logger=require(_0xdeff('0x5'))(_0xdeff('0x6'));function getTranscriptionJob(_0x298274,_0x2881fd,_0x8315d4,_0x1c4628){return new Promise(function(_0x1ed641,_0x132631){var _0x281ad7=new AWS[(_0xdeff('0x7'))]({'accessKeyId':_0x2881fd,'secretAccessKey':_0x298274,'region':_0x8315d4});_0x281ad7[_0xdeff('0x8')]({'TranscriptionJobName':_0x1c4628},function(_0x12e953,_0x24897a){if(_0x12e953){return _0x132631(_0x12e953);}else{return _0x1ed641(_0x24897a);}});});}function sentiment(_0x540ae6,_0x3ae201,_0x45a8a6,_0xf6d58d,_0x51fcb7){return new Promise(function(_0x1ff265,_0x4423e9){var _0x3c1482=new AWS[(_0xdeff('0x9'))]({'accessKeyId':_0x3ae201,'secretAccessKey':_0x540ae6,'region':_0x45a8a6});_0x3c1482[_0xdeff('0xa')]({'Text':_0xf6d58d,'LanguageCode':_0x51fcb7[_0xdeff('0xb')](0x0,0x2)},function(_0x2e9783,_0x402075){if(_0x2e9783){return _0x4423e9(_0x2e9783);}else{return _0x1ff265(_0x402075);}});});}function checkTranscribeJob(_0x505d0c,_0x461699,_0x116bf9){var _0x4952f2;return new BPromise(function(_0x2e614c,_0x4e7526){logger['info'](util[_0xdeff('0xc')](_0xdeff('0xd'),_0x505d0c['id'],_0x505d0c[_0xdeff('0xe')]));return getTranscriptionJob(_0x116bf9[_0xdeff('0xf')],_0x116bf9['data2'],_0x461699[_0xdeff('0x10')],_0x505d0c[_0xdeff('0xe')])[_0xdeff('0x11')](function(_0x391633){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x505d0c['id'],_0x505d0c['transcribeName'],_0x391633[_0xdeff('0x13')]['TranscriptionJobStatus']));if(!_0x505d0c['fileText']){switch(_0x391633[_0xdeff('0x13')][_0xdeff('0x14')]){case'COMPLETED':var _0x2de203={'transcribeStatus':_0x391633[_0xdeff('0x13')][_0xdeff('0x14')],'fileUri':_0x391633[_0xdeff('0x13')][_0xdeff('0x15')][_0xdeff('0x16')]};logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x505d0c['id']));return rp({'uri':_0x391633['TranscriptionJob']['Transcript'][_0xdeff('0x16')],'json':!![]})['then'](function(_0x189627){logger[_0xdeff('0x12')](util['format'](_0xdeff('0x17'),_0x505d0c['id']));if(_0x189627&&_0x189627[_0xdeff('0x18')]&&_0x189627['results']['transcripts']&&_0x189627[_0xdeff('0x18')][_0xdeff('0x19')][_0xdeff('0x1a')]){_0x2de203[_0xdeff('0x1b')]='';for(var _0x32add9=0x0;_0x32add9<_0x189627['results'][_0xdeff('0x19')][_0xdeff('0x1a')];_0x32add9++){_0x2de203[_0xdeff('0x1b')]+=_0x189627[_0xdeff('0x18')][_0xdeff('0x19')][_0x32add9][_0xdeff('0x1c')]+'';}}return _0x505d0c[_0xdeff('0x1d')](_0x2de203);})['then'](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x505d0c['id']));if(!_0x505d0c['tempSentiment']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x20'));}if(!_0x461699[_0xdeff('0x21')]||!_0x461699[_0xdeff('0x22')]||!_0x461699[_0xdeff('0x23')]||!_0x461699[_0xdeff('0x24')]||!_0x461699['bucket']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x25'));}if(!_0x2de203['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x461699[_0xdeff('0x22')]===_0x116bf9['id']){return _0x116bf9;}else{return db['CloudProvider'][_0xdeff('0x26')]({'where':{'id':_settings[_0xdeff('0x22')]}});}})[_0xdeff('0x11')](function(_0x5af6b2){if(!_0x5af6b2){throw new db[(_0xdeff('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5af6b2[_0xdeff('0xf')]||!_0x5af6b2[_0xdeff('0x27')]){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x4952f2=_0x5af6b2;logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x28'),_0x505d0c['id']));return sentiment(_0x4952f2[_0xdeff('0xf')],_0x4952f2[_0xdeff('0x27')],_0x461699[_0xdeff('0x23')],_0x2de203[_0xdeff('0x1b')],_0x461699['language']);})[_0xdeff('0x11')](function(_0x5cef77){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x29'),_0x505d0c['id']));return _0x505d0c[_0xdeff('0x1d')]({'sentiment':_0x5cef77[_0xdeff('0x2a')],'sPositive':_0x5cef77[_0xdeff('0x2b')]['Positive'],'sNegative':_0x5cef77[_0xdeff('0x2b')][_0xdeff('0x2c')],'sMixed':_0x5cef77['SentimentScore'][_0xdeff('0x2d')],'sNeutral':_0x5cef77[_0xdeff('0x2b')][_0xdeff('0x2e')]});})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x2f'),_0x505d0c['id']));_0x2e614c();});case _0xdeff('0x30'):return _0x505d0c['update']({'transcribeStatus':_0xdeff('0x30'),'failureReason':_0x391633['TranscriptionJob'][_0xdeff('0x31')]})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util['format'](_0xdeff('0x2f'),_0x505d0c['id']));_0x2e614c();});default:logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x32'),_0x505d0c['id']));break;}}else{return BPromise[_0xdeff('0x33')]()['then'](function(){if(!_0x505d0c[_0xdeff('0x34')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x20'));}if(!_0x461699['sentiment']||!_0x461699[_0xdeff('0x22')]||!_0x461699[_0xdeff('0x23')]||!_0x461699[_0xdeff('0x24')]||!_0x461699[_0xdeff('0x35')]){throw new db[(_0xdeff('0x1e'))]['ValidationError'](_0xdeff('0x25'));}if(!_0x505d0c[_0xdeff('0x1b')]){throw new Error(_0xdeff('0x36'));}if(_0x461699[_0xdeff('0x22')]===_0x116bf9['id']){return _0x116bf9;}else{return db[_0xdeff('0x37')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xdeff('0x11')](function(_0x1f5411){if(!_0x1f5411){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x38'));}if(!_0x1f5411[_0xdeff('0xf')]||!_0x1f5411[_0xdeff('0x27')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x39'));}_0x4952f2=_0x1f5411;logger[_0xdeff('0x12')](util['format'](_0xdeff('0x28'),_0x505d0c['id']));return sentiment(_0x4952f2[_0xdeff('0xf')],_0x4952f2[_0xdeff('0x27')],_0x461699[_0xdeff('0x23')],_0x505d0c['fileText'],_0x461699[_0xdeff('0x24')]);})[_0xdeff('0x11')](function(_0x8fe480){logger[_0xdeff('0x12')](util[_0xdeff('0xc')](_0xdeff('0x29'),_0x505d0c['id']));return _0x505d0c[_0xdeff('0x1d')]({'sentiment':_0x8fe480[_0xdeff('0x2a')],'sPositive':_0x8fe480['SentimentScore'][_0xdeff('0x3a')],'sNegative':_0x8fe480[_0xdeff('0x2b')][_0xdeff('0x2c')],'sMixed':_0x8fe480[_0xdeff('0x2b')][_0xdeff('0x2d')],'sNeutral':_0x8fe480['SentimentScore'][_0xdeff('0x2e')],'transcribeStatus':_0xdeff('0x3b')});})[_0xdeff('0x11')](function(){logger[_0xdeff('0x12')](util[_0xdeff('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x505d0c['id']));_0x2e614c();});}})[_0xdeff('0x3c')](function(_0x4e7316){if(_0x4e7316){if(!_0x4e7316[_0xdeff('0x3d')]||_0x4e7316[_0xdeff('0x3d')]!==_0xdeff('0x3e')){logger[_0xdeff('0x3f')](util[_0xdeff('0xc')](_0xdeff('0x40'),_0x505d0c['id']),util['inspect'](_0x4e7316,{'showHidden':![],'depth':null}));}}_0x2e614c();});});}function checkTranscribe(){var _0x49bc0b;var _0x71b5a5;var _0xf91a72;return db[_0xdeff('0x41')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xdeff('0x11')](function(_0x344218){if(!_0x344218||!_0x344218['length']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x42'));}_0x49bc0b=_0x344218;return db['Setting'][_0xdeff('0x26')]({'where':{'id':0x1}});})[_0xdeff('0x11')](function(_0x1ca376){if(!_0x1ca376){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x43'));}_0x71b5a5=_0x1ca376;if(!_0x71b5a5[_0xdeff('0x6')]||!_0x71b5a5[_0xdeff('0x44')]||!_0x71b5a5[_0xdeff('0x10')]||!_0x71b5a5[_0xdeff('0x24')]||!_0x71b5a5[_0xdeff('0x35')]){throw new db['Sequelize'][(_0xdeff('0x1f'))](_0xdeff('0x45'));}return db['CloudProvider'][_0xdeff('0x26')]({'where':{'id':_0x71b5a5[_0xdeff('0x44')]}});})[_0xdeff('0x11')](function(_0x33482b){if(!_0x33482b){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x38'));}if(!_0x33482b[_0xdeff('0xf')]||!_0x33482b['data2']){throw new db[(_0xdeff('0x1e'))][(_0xdeff('0x1f'))](_0xdeff('0x39'));}_0xf91a72=_0x33482b;var _0x552749=[];_0x49bc0b['forEach'](function(_0x1e43a6){_0x552749[_0xdeff('0x46')](checkTranscribeJob(_0x1e43a6,_0x71b5a5,_0xf91a72));});return BPromise[_0xdeff('0x47')](_0x552749);})[_0xdeff('0x3c')](function(_0x440053){if(_0x440053){if(!_0x440053[_0xdeff('0x3d')]||_0x440053['name']!=='SequelizeValidationError'){logger[_0xdeff('0x3f')](util[_0xdeff('0x48')](_0x440053,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x8d05=['Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Cloud\x20Provider\x20not\x20configured','Negative','Neutral','catch','name','error','inspect','VoiceRecording','IN_PROGRESS','Setting','findOne','Settings\x20not\x20available','transcribeAccountId','forEach','all','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','bluebird','transcribe','TranscribeService','Comprehend','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider'];(function(_0x2c958e,_0x125f97){var _0x11476d=function(_0x2c863f){while(--_0x2c863f){_0x2c958e['push'](_0x2c958e['shift']());}};_0x11476d(++_0x125f97);}(_0x8d05,0xe8));var _0x58d0=function(_0x427be6,_0x3f387a){_0x427be6=_0x427be6-0x0;var _0x6c680=_0x8d05[_0x427be6];return _0x6c680;};var _=require(_0x58d0('0x0'));var AWS=require(_0x58d0('0x1'));var rp=require(_0x58d0('0x2'));var util=require(_0x58d0('0x3'));var BPromise=require(_0x58d0('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x58d0('0x5'));function getTranscriptionJob(_0x3de956,_0x1a2d82,_0x55f391,_0x5adebc){return new Promise(function(_0xdff7f2,_0xb300a9){var _0x528303=new AWS[(_0x58d0('0x6'))]({'accessKeyId':_0x1a2d82,'secretAccessKey':_0x3de956,'region':_0x55f391});_0x528303['getTranscriptionJob']({'TranscriptionJobName':_0x5adebc},function(_0xe744f4,_0x34ab60){if(_0xe744f4){return _0xb300a9(_0xe744f4);}else{return _0xdff7f2(_0x34ab60);}});});}function sentiment(_0x38c1d9,_0xce5a28,_0x1d070a,_0x492edf,_0x35d080){return new Promise(function(_0x249afc,_0x52bab1){var _0x1ce0e7=new AWS[(_0x58d0('0x7'))]({'accessKeyId':_0xce5a28,'secretAccessKey':_0x38c1d9,'region':_0x1d070a});_0x1ce0e7['detectSentiment']({'Text':_0x492edf,'LanguageCode':_0x35d080['substring'](0x0,0x2)},function(_0x2bac57,_0x3e4c78){if(_0x2bac57){return _0x52bab1(_0x2bac57);}else{return _0x249afc(_0x3e4c78);}});});}function checkTranscribeJob(_0x85352e,_0x1efa0d,_0xf90244){var _0x268263;return new BPromise(function(_0x368c5c,_0x1667f8){logger[_0x58d0('0x8')](util[_0x58d0('0x9')](_0x58d0('0xa'),_0x85352e['id'],_0x85352e[_0x58d0('0xb')]));return getTranscriptionJob(_0xf90244[_0x58d0('0xc')],_0xf90244[_0x58d0('0xd')],_0x1efa0d[_0x58d0('0xe')],_0x85352e[_0x58d0('0xb')])[_0x58d0('0xf')](function(_0x246f48){logger[_0x58d0('0x8')](util['format'](_0x58d0('0x10'),_0x85352e['id'],_0x85352e[_0x58d0('0xb')],_0x246f48[_0x58d0('0x11')][_0x58d0('0x12')]));if(!_0x85352e[_0x58d0('0x13')]){switch(_0x246f48[_0x58d0('0x11')][_0x58d0('0x12')]){case _0x58d0('0x14'):var _0x1e4ca2={'transcribeStatus':_0x246f48[_0x58d0('0x11')][_0x58d0('0x12')],'fileUri':_0x246f48[_0x58d0('0x11')][_0x58d0('0x15')][_0x58d0('0x16')]};logger['info'](util[_0x58d0('0x9')](_0x58d0('0x17'),_0x85352e['id']));return rp({'uri':_0x246f48[_0x58d0('0x11')]['Transcript'][_0x58d0('0x16')],'json':!![]})[_0x58d0('0xf')](function(_0x412583){logger['info'](util[_0x58d0('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x85352e['id']));if(_0x412583&&_0x412583['results']&&_0x412583[_0x58d0('0x18')][_0x58d0('0x19')]&&_0x412583[_0x58d0('0x18')][_0x58d0('0x19')]['length']){_0x1e4ca2[_0x58d0('0x13')]='';for(var _0x28b6e2=0x0;_0x28b6e2<_0x412583[_0x58d0('0x18')]['transcripts'][_0x58d0('0x1a')];_0x28b6e2++){_0x1e4ca2[_0x58d0('0x13')]+=_0x412583['results'][_0x58d0('0x19')][_0x28b6e2][_0x58d0('0x1b')]+'';}}return _0x85352e[_0x58d0('0x1c')](_0x1e4ca2);})[_0x58d0('0xf')](function(){logger[_0x58d0('0x8')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x85352e['id']));if(!_0x85352e[_0x58d0('0x1d')]){throw new db[(_0x58d0('0x1e'))][(_0x58d0('0x1f'))](_0x58d0('0x20'));}if(!_0x1efa0d[_0x58d0('0x21')]||!_0x1efa0d['sentimentAccountId']||!_0x1efa0d[_0x58d0('0x22')]||!_0x1efa0d['language']||!_0x1efa0d[_0x58d0('0x23')]){throw new db[(_0x58d0('0x1e'))][(_0x58d0('0x1f'))](_0x58d0('0x24'));}if(!_0x1e4ca2['fileText']){throw new Error(_0x58d0('0x25'));}if(_0x1efa0d[_0x58d0('0x26')]===_0xf90244['id']){return _0xf90244;}else{return db[_0x58d0('0x27')]['findOne']({'where':{'id':_settings[_0x58d0('0x26')]}});}})[_0x58d0('0xf')](function(_0x2b35b3){if(!_0x2b35b3){throw new db[(_0x58d0('0x1e'))]['ValidationError'](_0x58d0('0x28'));}if(!_0x2b35b3[_0x58d0('0xc')]||!_0x2b35b3[_0x58d0('0xd')]){throw new db[(_0x58d0('0x1e'))][(_0x58d0('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x268263=_0x2b35b3;logger[_0x58d0('0x8')](util[_0x58d0('0x9')](_0x58d0('0x29'),_0x85352e['id']));return sentiment(_0x268263[_0x58d0('0xc')],_0x268263[_0x58d0('0xd')],_0x1efa0d[_0x58d0('0x22')],_0x1e4ca2[_0x58d0('0x13')],_0x1efa0d[_0x58d0('0x2a')]);})[_0x58d0('0xf')](function(_0x3ec781){logger['info'](util[_0x58d0('0x9')](_0x58d0('0x2b'),_0x85352e['id']));return _0x85352e[_0x58d0('0x1c')]({'sentiment':_0x3ec781[_0x58d0('0x2c')],'sPositive':_0x3ec781[_0x58d0('0x2d')][_0x58d0('0x2e')],'sNegative':_0x3ec781[_0x58d0('0x2d')]['Negative'],'sMixed':_0x3ec781['SentimentScore'][_0x58d0('0x2f')],'sNeutral':_0x3ec781[_0x58d0('0x2d')]['Neutral']});})[_0x58d0('0xf')](function(){logger[_0x58d0('0x8')](util[_0x58d0('0x9')](_0x58d0('0x30'),_0x85352e['id']));_0x368c5c();});case _0x58d0('0x31'):return _0x85352e['update']({'transcribeStatus':'FAILED','failureReason':_0x246f48[_0x58d0('0x11')]['FailureReason']})['then'](function(){logger['info'](util[_0x58d0('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x85352e['id']));_0x368c5c();});default:logger[_0x58d0('0x8')](util['format'](_0x58d0('0x32'),_0x85352e['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x85352e['tempSentiment']){throw new db[(_0x58d0('0x1e'))][(_0x58d0('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1efa0d[_0x58d0('0x21')]||!_0x1efa0d['sentimentAccountId']||!_0x1efa0d[_0x58d0('0x22')]||!_0x1efa0d[_0x58d0('0x2a')]||!_0x1efa0d['bucket']){throw new db[(_0x58d0('0x1e'))]['ValidationError'](_0x58d0('0x24'));}if(!_0x85352e[_0x58d0('0x13')]){throw new Error(_0x58d0('0x25'));}if(_0x1efa0d[_0x58d0('0x26')]===_0xf90244['id']){return _0xf90244;}else{return db[_0x58d0('0x27')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x432cb6){if(!_0x432cb6){throw new db[(_0x58d0('0x1e'))]['ValidationError'](_0x58d0('0x28'));}if(!_0x432cb6['data1']||!_0x432cb6['data2']){throw new db[(_0x58d0('0x1e'))][(_0x58d0('0x1f'))](_0x58d0('0x33'));}_0x268263=_0x432cb6;logger[_0x58d0('0x8')](util[_0x58d0('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x85352e['id']));return sentiment(_0x268263['data1'],_0x268263['data2'],_0x1efa0d[_0x58d0('0x22')],_0x85352e[_0x58d0('0x13')],_0x1efa0d[_0x58d0('0x2a')]);})[_0x58d0('0xf')](function(_0xf9d831){logger[_0x58d0('0x8')](util[_0x58d0('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x85352e['id']));return _0x85352e[_0x58d0('0x1c')]({'sentiment':_0xf9d831[_0x58d0('0x2c')],'sPositive':_0xf9d831['SentimentScore']['Positive'],'sNegative':_0xf9d831[_0x58d0('0x2d')][_0x58d0('0x34')],'sMixed':_0xf9d831[_0x58d0('0x2d')][_0x58d0('0x2f')],'sNeutral':_0xf9d831[_0x58d0('0x2d')][_0x58d0('0x35')],'transcribeStatus':_0x58d0('0x14')});})[_0x58d0('0xf')](function(){logger[_0x58d0('0x8')](util['format'](_0x58d0('0x30'),_0x85352e['id']));_0x368c5c();});}})[_0x58d0('0x36')](function(_0x485a5e){if(_0x485a5e){if(!_0x485a5e['name']||_0x485a5e[_0x58d0('0x37')]!=='SequelizeValidationError'){logger[_0x58d0('0x38')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x85352e['id']),util[_0x58d0('0x39')](_0x485a5e,{'showHidden':![],'depth':null}));}}_0x368c5c();});});}function checkTranscribe(){var _0x1e1477;var _0x23d48b;var _0x1326dd;return db[_0x58d0('0x3a')]['findAll']({'where':{'transcribeStatus':_0x58d0('0x3b')}})[_0x58d0('0xf')](function(_0x17ba25){if(!_0x17ba25||!_0x17ba25[_0x58d0('0x1a')]){throw new db[(_0x58d0('0x1e'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x1e1477=_0x17ba25;return db[_0x58d0('0x3c')][_0x58d0('0x3d')]({'where':{'id':0x1}});})[_0x58d0('0xf')](function(_0x5bec4a){if(!_0x5bec4a){throw new db[(_0x58d0('0x1e'))]['ValidationError'](_0x58d0('0x3e'));}_0x23d48b=_0x5bec4a;if(!_0x23d48b[_0x58d0('0x5')]||!_0x23d48b[_0x58d0('0x3f')]||!_0x23d48b['transcribeRegion']||!_0x23d48b['language']||!_0x23d48b[_0x58d0('0x23')]){throw new db[(_0x58d0('0x1e'))][(_0x58d0('0x1f'))]('Transcribe\x20not\x20configured');}return db[_0x58d0('0x27')][_0x58d0('0x3d')]({'where':{'id':_0x23d48b['transcribeAccountId']}});})['then'](function(_0x452351){if(!_0x452351){throw new db[(_0x58d0('0x1e'))][(_0x58d0('0x1f'))](_0x58d0('0x28'));}if(!_0x452351[_0x58d0('0xc')]||!_0x452351[_0x58d0('0xd')]){throw new db[(_0x58d0('0x1e'))]['ValidationError'](_0x58d0('0x33'));}_0x1326dd=_0x452351;var _0x3c7ae2=[];_0x1e1477[_0x58d0('0x40')](function(_0x286761){_0x3c7ae2['push'](checkTranscribeJob(_0x286761,_0x23d48b,_0x1326dd));});return BPromise[_0x58d0('0x41')](_0x3c7ae2);})['catch'](function(_0x380248){if(_0x380248){if(!_0x380248[_0x58d0('0x37')]||_0x380248['name']!==_0x58d0('0x42')){logger[_0x58d0('0x38')](util[_0x58d0('0x39')](_0x380248,{'showHidden':![],'depth':null}));}}});}exports[_0x58d0('0x43')]=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 eaaee69..53bf23d 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 _0xe67e=['schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','subtract','hours','length','map','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xe67e,0x1ca));var _0xee67=function(_0x3a8d5b,_0x3a020f){_0x3a8d5b=_0x3a8d5b-0x0;var _0x509d13=_0xe67e[_0x3a8d5b];return _0x509d13;};'use strict';var _=require(_0xee67('0x0'));var moment=require(_0xee67('0x1'));var Redis=require(_0xee67('0x2'));var util=require('util');var config=require(_0xee67('0x3'));var db=require(_0xee67('0x4'))['db'];var logger=require(_0xee67('0x5'))(_0xee67('0x6'));config[_0xee67('0x7')]=_[_0xee67('0x8')](config[_0xee67('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xee67('0x9'))(new Redis(config[_0xee67('0x7')]));function closeInteractions(){var _0x3e41fa=[];return db[_0xee67('0xa')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xee67('0xb')](0x18,_0xee67('0xc'))}}})['then'](function(_0x22289a){if(_0x22289a&&_0x22289a[_0xee67('0xd')]){_0x3e41fa=_[_0xee67('0xe')](_0x22289a||[],'id');logger[_0xee67('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x3e41fa[_0xee67('0x10')]());return db[_0xee67('0xa')][_0xee67('0x11')]({'closeReason':_0xee67('0x12'),'disposition':_0xee67('0x13'),'closed':!![],'closedAt':moment()[_0xee67('0x14')](_0xee67('0x15'))},{'where':{'id':_0x3e41fa}});}})[_0xee67('0x16')](function(){if(_0x3e41fa&&_0x3e41fa[_0xee67('0xd')]){logger[_0xee67('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3e41fa[_0xee67('0x10')]());for(var _0x56febb=0x0;_0x56febb<_0x3e41fa[_0xee67('0xd')];_0x56febb++){io[_0xee67('0x17')](_0xee67('0x18'),{'id':_0x3e41fa[_0x56febb],'closed':!![]});}}})[_0xee67('0x19')](function(_0x183cc8){logger['error'](_0xee67('0x1a'),_0x183cc8?util[_0xee67('0x1b')](_0x183cc8,{'showHidden':![],'depth':null}):'');});}exports[_0xee67('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa269=['update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','length','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x189901,_0x2f35a9){var _0x5df3c2=function(_0x17382a){while(--_0x17382a){_0x189901['push'](_0x189901['shift']());}};_0x5df3c2(++_0x2f35a9);}(_0xa269,0x14c));var _0x9a26=function(_0x154ca9,_0x577f27){_0x154ca9=_0x154ca9-0x0;var _0xc22b94=_0xa269[_0x154ca9];return _0xc22b94;};'use strict';var _=require('lodash');var moment=require(_0x9a26('0x0'));var Redis=require('ioredis');var util=require(_0x9a26('0x1'));var config=require(_0x9a26('0x2'));var db=require(_0x9a26('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x9a26('0x4')]=_[_0x9a26('0x5')](config[_0x9a26('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9a26('0x6'))(new Redis(config[_0x9a26('0x4')]));function closeInteractions(){var _0x11d37b=[];return db[_0x9a26('0x7')][_0x9a26('0x8')]({'raw':!![],'attributes':['id',_0x9a26('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9a26('0xa')](0x18,_0x9a26('0xb'))}}})[_0x9a26('0xc')](function(_0x4bed7b){if(_0x4bed7b&&_0x4bed7b['length']){_0x11d37b=_[_0x9a26('0xd')](_0x4bed7b||[],'id');logger[_0x9a26('0xe')](_0x9a26('0xf'),_0x11d37b['join']());return db['WhatsappInteraction'][_0x9a26('0x10')]({'closeReason':_0x9a26('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9a26('0x12')](_0x9a26('0x13'))},{'where':{'id':_0x11d37b}});}})[_0x9a26('0xc')](function(){if(_0x11d37b&&_0x11d37b['length']){logger[_0x9a26('0xe')](_0x9a26('0x14'),_0x11d37b[_0x9a26('0x15')]());for(var _0x44be52=0x0;_0x44be52<_0x11d37b[_0x9a26('0x16')];_0x44be52++){io[_0x9a26('0x17')](_0x9a26('0x18'),{'id':_0x11d37b[_0x44be52],'closed':!![]});}}})[_0x9a26('0x19')](function(_0x4057bb){logger[_0x9a26('0x1a')](_0x9a26('0x1b'),_0x4057bb?util['inspect'](_0x4057bb,{'showHidden':![],'depth':null}):'');});}exports[_0x9a26('0x1c')]=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 092f147..3df6a42 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9921=['Biondo','innocenzo.biondo','push','now','Innocenzo','@xcally.com','destroy','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','util','../mysqldb'];(function(_0x2797bc,_0x3617b0){var _0x24a66c=function(_0x2bc0ff){while(--_0x2bc0ff){_0x2797bc['push'](_0x2797bc['shift']());}};_0x24a66c(++_0x3617b0);}(_0x9921,0x70));var _0x1992=function(_0x3e2035,_0x4c847a){_0x3e2035=_0x3e2035-0x0;var _0x12353d=_0x9921[_0x3e2035];return _0x12353d;};'use strict';var util=require(_0x1992('0x0'));var db=require(_0x1992('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x1992('0x2')+i,'phone':0xf879fb460+i,'email':_0x1992('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1992('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x1992('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1992('0x4')]({'id':i,'firstName':_0x1992('0x6')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x1992('0x3')+i+_0x1992('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1992('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x1992('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1992('0x5')](),'updatedAt':Date[_0x1992('0x5')]()});}db['CmContact'][_0x1992('0x8')]({'where':{}})[_0x1992('0x9')](function(){return db[_0x1992('0xa')][_0x1992('0xb')](contacts);})[_0x1992('0x9')](function(){console[_0x1992('0xc')](_0x1992('0xd'),_0x1992('0xe'));return db[_0x1992('0xf')]['destroy']({'where':{}});})['then'](function(){return db[_0x1992('0xf')][_0x1992('0xb')](hopper);})['then'](function(){console['log'](_0x1992('0xd'),_0x1992('0x10'));return db[_0x1992('0xa')][_0x1992('0xb')](contacts2);})['then'](function(){console[_0x1992('0xc')](_0x1992('0xd'),_0x1992('0x11'));return db[_0x1992('0xf')][_0x1992('0xb')](hopper2);})[_0x1992('0x9')](function(){console['log'](_0x1992('0xd'),_0x1992('0x12'));})['catch'](function(_0x1db90d){console[_0x1992('0xc')](_0x1db90d);}); \ No newline at end of file +var _0x00a8=['log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','destroy','CmContact','bulkCreate','then'];(function(_0x1a51f6,_0x54ec4){var _0x25eb59=function(_0x1d328e){while(--_0x1d328e){_0x1a51f6['push'](_0x1a51f6['shift']());}};_0x25eb59(++_0x54ec4);}(_0x00a8,0x111));var _0x800a=function(_0x3848a0,_0x45a43e){_0x3848a0=_0x3848a0-0x0;var _0x58cde1=_0x00a8[_0x3848a0];return _0x58cde1;};'use strict';var util=require(_0x800a('0x0'));var db=require(_0x800a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x800a('0x2')+i,'lastName':_0x800a('0x3')+i,'phone':0xf879fb460+i,'email':_0x800a('0x4')+i+_0x800a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x800a('0x6')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x800a('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x800a('0x6')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x800a('0x3')+i,'phone':0xf879fb460+i,'email':_0x800a('0x4')+i+_0x800a('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x800a('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x800a('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x800a('0x7')]()});}db['CmContact'][_0x800a('0x8')]({'where':{}})['then'](function(){return db[_0x800a('0x9')][_0x800a('0xa')](contacts);})[_0x800a('0xb')](function(){console[_0x800a('0xc')](_0x800a('0xd'),_0x800a('0xe'));return db[_0x800a('0xf')][_0x800a('0x8')]({'where':{}});})['then'](function(){return db[_0x800a('0xf')]['bulkCreate'](hopper);})[_0x800a('0xb')](function(){console[_0x800a('0xc')]('finished\x20populating',_0x800a('0x10'));return db[_0x800a('0x9')][_0x800a('0xa')](contacts2);})[_0x800a('0xb')](function(){console[_0x800a('0xc')](_0x800a('0xd'),_0x800a('0x11'));return db[_0x800a('0xf')][_0x800a('0xa')](hopper2);})[_0x800a('0xb')](function(){console['log'](_0x800a('0xd'),'hopper2');})[_0x800a('0x12')](function(_0x495296){console[_0x800a('0xc')](_0x495296);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index b4d67ae..507dfa3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0866=['/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt'];(function(_0xd27dc7,_0x4c8600){var _0x4b2161=function(_0x5d064b){while(--_0x5d064b){_0xd27dc7['push'](_0xd27dc7['shift']());}};_0x4b2161(++_0x4c8600);}(_0x0866,0x16f));var _0x6086=function(_0x2bf949,_0xb52b95){_0x2bf949=_0x2bf949-0x0;var _0x5be036=_0x0866[_0x2bf949];return _0x5be036;};'use strict';var util=require(_0x6086('0x0'));var db=require(_0x6086('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6086('0x2')]({'name':util[_0x6086('0x3')]('%s%s','agent',i),'fullname':util[_0x6086('0x3')](_0x6086('0x4'),_0x6086('0x5'),i),'email':util[_0x6086('0x3')](_0x6086('0x6'),_0x6086('0x5'),i),'role':'agent','password':_0x6086('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x6086('0x8'),'ws',_0x6086('0x9')],'disallow':[_0x6086('0xa')],'allow':['ulaw'],'defaultuser':util['format']('%s%s','agent',i),'encryption':'yes','avpf':_0x6086('0xb'),'force_avp':_0x6086('0xb'),'icesupport':_0x6086('0xb'),'dtlsenable':_0x6086('0xb'),'dtlsverify':'no','dtlscertfile':_0x6086('0xc'),'dtlsprivatekey':_0x6086('0xd'),'dtlssetup':_0x6086('0xe'),'callerid':util[_0x6086('0x3')]('\x22%s\x22\x20<%s>',util['format'](_0x6086('0x4'),_0x6086('0x5'),i),0xfa0+i)});}db[_0x6086('0xf')][_0x6086('0x10')](users)['then'](function(){console['log'](_0x6086('0x11'));})[_0x6086('0x12')](function(_0x5e6f62){console[_0x6086('0x13')](_0x5e6f62);}); \ No newline at end of file +var _0x6a8c=['then','log','add\x20user','../mysqldb','push','format','%s%s','%s%s@xcally.com','agent','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate'];(function(_0x5ae187,_0x8afd5c){var _0x211069=function(_0x5a56b6){while(--_0x5a56b6){_0x5ae187['push'](_0x5ae187['shift']());}};_0x211069(++_0x8afd5c);}(_0x6a8c,0x159));var _0xc6a8=function(_0x1e3143,_0x371ba4){_0x1e3143=_0x1e3143-0x0;var _0x26ae72=_0x6a8c[_0x1e3143];return _0x26ae72;};'use strict';var util=require('util');var db=require(_0xc6a8('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc6a8('0x1')]({'name':util[_0xc6a8('0x2')]('%s%s','agent',i),'fullname':util[_0xc6a8('0x2')](_0xc6a8('0x3'),'agent',i),'email':util[_0xc6a8('0x2')](_0xc6a8('0x4'),'agent',i),'role':_0xc6a8('0x5'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0xc6a8('0x6'),'ws','wss'],'disallow':[_0xc6a8('0x7')],'allow':[_0xc6a8('0x8')],'defaultuser':util[_0xc6a8('0x2')](_0xc6a8('0x3'),'agent',i),'encryption':_0xc6a8('0x9'),'avpf':_0xc6a8('0x9'),'force_avp':_0xc6a8('0x9'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xc6a8('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xc6a8('0xb'),'callerid':util[_0xc6a8('0x2')](_0xc6a8('0xc'),util[_0xc6a8('0x2')](_0xc6a8('0x3'),_0xc6a8('0x5'),i),0xfa0+i)});}db[_0xc6a8('0xd')][_0xc6a8('0xe')](users)[_0xc6a8('0xf')](function(){console[_0xc6a8('0x10')](_0xc6a8('0x11'));})['catch'](function(_0x50d746){console[_0xc6a8('0x10')](_0x50d746);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 816e67b..6ad15b6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2a2=['Trunk','Campaign','user','userProfileId','ChatQueues','FaxQueues','getVoiceQueues','getFaxQueues','getMailQueues','getWhatsappQueues','all','chat','fax','sms','mail','telephone:%s','trunk:%s','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','removeFaxInteractions','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','catch','default','setMaxListeners','address','request','remoteAddress','remotePort','log','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','map','resourceId','where','type','format','%s:queue:%s','length','handshake','query','find','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue'];(function(_0x5d0218,_0x51ccc6){var _0x5a1644=function(_0x4bb38e){while(--_0x4bb38e){_0x5d0218['push'](_0x5d0218['shift']());}};_0x5a1644(++_0x51ccc6);}(_0xc2a2,0x84));var _0x2c2a=function(_0x2029cc,_0x27e4d5){_0x2029cc=_0x2029cc-0x0;var _0x27acc1=_0xc2a2[_0x2029cc];return _0x27acc1;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var BPromise=require(_0x2c2a('0x2'));var db=require(_0x2c2a('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x2c2a('0x4')],'include':[{'as':_0x2c2a('0x5'),'model':db[_0x2c2a('0x6')],'attributes':['id','name',_0x2c2a('0x7')],'raw':!![],'where':{'role':_0x2c2a('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2c2a('0x4')],'where':{'role':_0x2c2a('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0x2c2a('0xa')}};function getAssociatedResources(_0x48bfcc,_0x396b2c,_0x48ba78){return db[_0x2c2a('0xb')][_0x2c2a('0xc')]({'where':{'name':_0x48bfcc,'userProfileId':_0x396b2c},'raw':!![]})[_0x2c2a('0xd')](function(_0x5e9b75){if(_0x5e9b75){if(_0x5e9b75[_0x2c2a('0xe')]){switch(_0x48bfcc){case _0x2c2a('0xf'):case'ChatQueues':case'FaxQueues':case _0x2c2a('0x10'):case _0x2c2a('0x11'):case _0x2c2a('0x12'):case _0x2c2a('0x13'):return db[_0x48ba78][_0x2c2a('0x14')](queryQueues);case _0x2c2a('0x15'):return db[_0x48ba78]['findAll'](queryTelephones);case _0x2c2a('0x16'):return db[_0x48ba78][_0x2c2a('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x48ba78][_0x2c2a('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0x2c2a('0x14')]({'attributes':['resourceId'],'where':{'sectionId':_0x5e9b75['id']},'raw':!![]})[_0x2c2a('0xd')](function(_0x40051f){if(_0x40051f){var _0x523692={'where':{'id':_[_0x2c2a('0x17')](_0x40051f,_0x2c2a('0x18'))},'raw':!![]};switch(_0x48ba78){case _0x2c2a('0x6'):_0x523692[_0x2c2a('0x19')][_0x2c2a('0x7')]=_0x2c2a('0x9');break;case'Campaign':_0x523692['where'][_0x2c2a('0x1a')]='ivr';break;}return db[_0x48ba78][_0x2c2a('0x14')](_0x523692);}else{return[];}});}}else{return[];}})[_0x2c2a('0xd')](function(_0x190eba){return _0x190eba;});}function joinOrLeaveQueues(_0x2120ab,_0x1fe22c,_0x3d7068,_0x3c7ccd){_0x2120ab[_0x1fe22c](util[_0x2c2a('0x1b')](_0x2c2a('0x1c'),_0x3d7068,_0x3c7ccd[_0x2c2a('0x4')]));if(_0x3c7ccd['Agents']){for(var _0x1896f2=0x0;_0x1896f2<_0x3c7ccd['Agents'][_0x2c2a('0x1d')];_0x1896f2+=0x1){_0x2120ab[_0x1fe22c](util[_0x2c2a('0x1b')]('user:%s',_0x3c7ccd[_0x2c2a('0x5')][_0x1896f2][_0x2c2a('0x4')]));}}}function joinOrLeave(_0x1f07d5,_0x5a8ad3,_0x2842f9){var _0x25788b;if(_0x1f07d5[_0x2c2a('0x1e')][_0x2c2a('0x1f')]['id']){db[_0x2c2a('0x6')][_0x2c2a('0x20')]({'attributes':['id',_0x2c2a('0x4'),_0x2c2a('0x7'),'userProfileId'],'where':{'id':_0x1f07d5['handshake']['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x2c2a('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c2a('0x22')],'as':_0x2c2a('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c2a('0x24')],'as':_0x2c2a('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c2a('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x2c2a('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c2a('0x28')],'as':_0x2c2a('0x29'),'attributes':['id'],'raw':!![]}]})[_0x2c2a('0xd')](function(_0x5c2fbb){if(_0x5c2fbb){_0x25788b=_0x5c2fbb;_0x1f07d5[_0x5a8ad3](util[_0x2c2a('0x1b')](_0x2c2a('0x2a'),_0x5c2fbb[_0x2c2a('0x4')]));var _0xd1f9af=[];switch(_0x5c2fbb[_0x2c2a('0x7')]){case _0x2c2a('0x2b'):_0x1f07d5[_0x5a8ad3](_0x2c2a('0x2c'));_0x1f07d5[_0x5a8ad3](_0x2c2a('0x2d'));if(queryQueues[_0x2c2a('0x2e')](_0x2c2a('0x2f'))){delete queryQueues[_0x2c2a('0x2f')];}_0xd1f9af[_0x2c2a('0x30')](db[_0x2c2a('0x31')][_0x2c2a('0x14')](queryQueues));_0xd1f9af['push'](db[_0x2c2a('0x32')][_0x2c2a('0x14')](queryQueues));_0xd1f9af[_0x2c2a('0x30')](db[_0x2c2a('0x33')][_0x2c2a('0x14')](queryQueues));_0xd1f9af['push'](db[_0x2c2a('0x34')][_0x2c2a('0x14')](queryQueues));_0xd1f9af['push'](db[_0x2c2a('0x35')]['findAll'](queryQueues));_0xd1f9af[_0x2c2a('0x30')](db[_0x2c2a('0x36')][_0x2c2a('0x14')](queryQueues));_0xd1f9af[_0x2c2a('0x30')](db[_0x2c2a('0x37')][_0x2c2a('0x14')](queryQueues));_0xd1f9af[_0x2c2a('0x30')](db['User'][_0x2c2a('0x14')](queryTelephones));_0xd1f9af[_0x2c2a('0x30')](db[_0x2c2a('0x38')]['findAll'](queryTrunks));_0xd1f9af['push'](db[_0x2c2a('0x39')]['findAll'](queryCampaigns));_0xd1f9af[_0x2c2a('0x30')](db[_0x2c2a('0x6')][_0x2c2a('0x14')](queryAgents));break;case _0x2c2a('0x3a'):_0x1f07d5[_0x5a8ad3](_0x2c2a('0x2c'));_0x1f07d5[_0x5a8ad3]('voice:outbound');_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0xf'),_0x5c2fbb[_0x2c2a('0x3b')],_0x2c2a('0x31')));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0x3c'),_0x5c2fbb[_0x2c2a('0x3b')],_0x2c2a('0x32')));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0x3d'),_0x5c2fbb['userProfileId'],'FaxQueue'));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0x10'),_0x5c2fbb[_0x2c2a('0x3b')],_0x2c2a('0x34')));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0x11'),_0x5c2fbb['userProfileId'],'MailQueue'));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0x12'),_0x5c2fbb[_0x2c2a('0x3b')],_0x2c2a('0x36')));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0x13'),_0x5c2fbb[_0x2c2a('0x3b')],_0x2c2a('0x37')));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources(_0x2c2a('0x15'),_0x5c2fbb['userProfileId'],_0x2c2a('0x6')));_0xd1f9af['push'](getAssociatedResources(_0x2c2a('0x16'),_0x5c2fbb[_0x2c2a('0x3b')],_0x2c2a('0x38')));_0xd1f9af[_0x2c2a('0x30')](getAssociatedResources('IvrCampaigns',_0x5c2fbb[_0x2c2a('0x3b')],_0x2c2a('0x39')));_0xd1f9af['push'](db[_0x2c2a('0x6')][_0x2c2a('0x14')](queryAgents));break;case _0x2c2a('0x8'):_0x1f07d5[_0x5a8ad3](_0x2c2a('0x2c'));_0x1f07d5[_0x5a8ad3](_0x2c2a('0x2d'));_0xd1f9af[_0x2c2a('0x30')](_0x5c2fbb[_0x2c2a('0x3e')]({'attributes':['id',_0x2c2a('0x4')]}));_0xd1f9af['push'](_0x5c2fbb['getChatQueues']({'attributes':['id',_0x2c2a('0x4')]}));_0xd1f9af['push'](_0x5c2fbb[_0x2c2a('0x3f')]({'attributes':['id','name']}));_0xd1f9af[_0x2c2a('0x30')](_0x5c2fbb['getSmsQueues']({'attributes':['id',_0x2c2a('0x4')]}));_0xd1f9af[_0x2c2a('0x30')](_0x5c2fbb[_0x2c2a('0x40')]({'attributes':['id',_0x2c2a('0x4')]}));_0xd1f9af['push'](_0x5c2fbb['getOpenchannelQueues']({'attributes':['id',_0x2c2a('0x4')]}));_0xd1f9af['push'](_0x5c2fbb[_0x2c2a('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0x2c2a('0x42')](_0xd1f9af);}})[_0x2c2a('0xd')](function(_0x5aaf62){if(_0x5aaf62&&_0x5aaf62[_0x2c2a('0x1d')]){for(var _0x3d888f=0x0;_0x3d888f<_0x5aaf62['length'];_0x3d888f+=0x1){for(var _0x576019=0x0;_0x576019<_0x5aaf62[_0x3d888f][_0x2c2a('0x1d')];_0x576019+=0x1){switch(_0x3d888f){case 0x0:joinOrLeaveQueues(_0x1f07d5,_0x5a8ad3,'voice',_0x5aaf62[_0x3d888f][_0x576019]);break;case 0x1:joinOrLeaveQueues(_0x1f07d5,_0x5a8ad3,_0x2c2a('0x43'),_0x5aaf62[_0x3d888f][_0x576019]);break;case 0x2:joinOrLeaveQueues(_0x1f07d5,_0x5a8ad3,_0x2c2a('0x44'),_0x5aaf62[_0x3d888f][_0x576019]);break;case 0x3:joinOrLeaveQueues(_0x1f07d5,_0x5a8ad3,_0x2c2a('0x45'),_0x5aaf62[_0x3d888f][_0x576019]);break;case 0x4:joinOrLeaveQueues(_0x1f07d5,_0x5a8ad3,_0x2c2a('0x46'),_0x5aaf62[_0x3d888f][_0x576019]);break;case 0x5:joinOrLeaveQueues(_0x1f07d5,_0x5a8ad3,'openchannel',_0x5aaf62[_0x3d888f][_0x576019]);break;case 0x6:joinOrLeaveQueues(_0x1f07d5,_0x5a8ad3,'whatsapp',_0x5aaf62[_0x3d888f][_0x576019]);break;case 0x7:if(_0x25788b[_0x2c2a('0x7')]!==_0x2c2a('0x8'))_0x1f07d5[_0x5a8ad3](util[_0x2c2a('0x1b')](_0x2c2a('0x47'),_0x5aaf62[_0x3d888f][_0x576019]['name']));break;case 0x8:if(_0x25788b['role']!==_0x2c2a('0x8'))_0x1f07d5[_0x5a8ad3](util['format'](_0x2c2a('0x48'),_0x5aaf62[_0x3d888f][_0x576019]['name']));break;case 0x9:if(_0x25788b[_0x2c2a('0x7')]!==_0x2c2a('0x8'))_0x1f07d5[_0x5a8ad3](util['format']('campaign:%s:%s',_0x5aaf62[_0x3d888f][_0x576019][_0x2c2a('0x1a')],_0x5aaf62[_0x3d888f][_0x576019][_0x2c2a('0x4')]));break;case 0xa:_0x1f07d5[_0x5a8ad3](util[_0x2c2a('0x1b')](_0x2c2a('0x2a'),_0x5aaf62[_0x3d888f][_0x576019]['name']));break;}}}}})[_0x2c2a('0xd')](function(){if(_0x5a8ad3==='leave'){var _0x1c4ec5=_[_0x2c2a('0x17')](_0x25788b['ChatInteractions'],'id');return _0x25788b['removeChatInteractions'](_0x1c4ec5)[_0x2c2a('0xd')](function(){for(var _0x3b3dec=0x0;_0x3b3dec<_0x1c4ec5[_0x2c2a('0x1d')];_0x3b3dec+=0x1){_0x2842f9[_0x2c2a('0x49')](_0x2c2a('0x4a'),{'ChatInteractionId':Number(_0x1c4ec5[_0x3b3dec]),'UserId':Number(_0x25788b['id'])});}});}})[_0x2c2a('0xd')](function(){if(_0x5a8ad3===_0x2c2a('0x4b')){var _0xb910bc=_['map'](_0x25788b[_0x2c2a('0x23')],'id');return _0x25788b[_0x2c2a('0x4c')](_0xb910bc)['then'](function(){for(var _0x4ce25b=0x0;_0x4ce25b<_0xb910bc[_0x2c2a('0x1d')];_0x4ce25b+=0x1){_0x2842f9[_0x2c2a('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xb910bc[_0x4ce25b]),'UserId':Number(_0x25788b['id'])});}});}})['then'](function(){if(_0x5a8ad3==='leave'){var _0x388da8=_[_0x2c2a('0x17')](_0x25788b[_0x2c2a('0x25')],'id');return _0x25788b[_0x2c2a('0x4d')](_0x388da8)['then'](function(){for(var _0x1702d2=0x0;_0x1702d2<_0x388da8[_0x2c2a('0x1d')];_0x1702d2+=0x1){_0x2842f9[_0x2c2a('0x49')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x388da8[_0x1702d2]),'UserId':Number(_0x25788b['id'])});}});}})[_0x2c2a('0xd')](function(){if(_0x5a8ad3==='leave'){var _0x54b4ff=_[_0x2c2a('0x17')](_0x25788b[_0x2c2a('0x4e')],'id');return _0x25788b[_0x2c2a('0x4f')](_0x54b4ff)[_0x2c2a('0xd')](function(){for(var _0x157967=0x0;_0x157967<_0x54b4ff[_0x2c2a('0x1d')];_0x157967+=0x1){_0x2842f9['emit'](_0x2c2a('0x50'),{'SmsInteractionId':Number(_0x54b4ff[_0x157967]),'UserId':Number(_0x25788b['id'])});}});}})[_0x2c2a('0xd')](function(){if(_0x5a8ad3===_0x2c2a('0x4b')){var _0x7b121e=_[_0x2c2a('0x17')](_0x25788b[_0x2c2a('0x27')],'id');return _0x25788b[_0x2c2a('0x51')](_0x7b121e)[_0x2c2a('0xd')](function(){for(var _0x199706=0x0;_0x199706<_0x7b121e[_0x2c2a('0x1d')];_0x199706+=0x1){_0x2842f9[_0x2c2a('0x49')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x7b121e[_0x199706]),'UserId':Number(_0x25788b['id'])});}});}})[_0x2c2a('0xd')](function(){if(_0x5a8ad3==='leave'){var _0x45f225=_[_0x2c2a('0x17')](_0x25788b[_0x2c2a('0x29')],'id');return _0x25788b['removeWhatsappInteractions'](_0x45f225)['then'](function(){for(var _0x53e2cb=0x0;_0x53e2cb<_0x45f225[_0x2c2a('0x1d')];_0x53e2cb+=0x1){_0x2842f9[_0x2c2a('0x49')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x45f225[_0x53e2cb]),'UserId':Number(_0x25788b['id'])});}});}})[_0x2c2a('0x52')](function(_0x37ac01){_0x1f07d5['log'](_0x37ac01);});}}function onDisconnect(_0x48f90f,_0x38087e){joinOrLeave(_0x48f90f,'leave',_0x38087e);}function onConnect(_0x5aa823){joinOrLeave(_0x5aa823,'join');}exports[_0x2c2a('0x53')]=function(_0x2e7e2a){_0x2e7e2a['on']('connection',function(_0x189ddf){_0x189ddf[_0x2c2a('0x54')](0x0);_0x189ddf[_0x2c2a('0x55')]=_0x189ddf[_0x2c2a('0x56')]['connection'][_0x2c2a('0x57')]+':'+_0x189ddf['request']['connection'][_0x2c2a('0x58')];_0x189ddf['connectedAt']=new Date();_0x189ddf[_0x2c2a('0x59')]=function(_0x1777d1){console[_0x2c2a('0x59')](_0x2c2a('0x5a')+_0x189ddf[_0x2c2a('0x5b')][_0x2c2a('0x4')]+'['+_0x189ddf['address']+']',_0x1777d1);};_0x189ddf['on'](_0x2c2a('0x5c'),function(){onDisconnect(_0x189ddf,_0x2e7e2a);_0x189ddf[_0x2c2a('0x59')]('DISCONNECTED');});onConnect(_0x189ddf);_0x189ddf[_0x2c2a('0x59')](_0x2c2a('0x5d'));});}; \ No newline at end of file +var _0xe5e8=['getWhatsappQueues','all','voice','chat','sms','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','OpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','Agents','User','role','agent','name','telephone','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','map','where','Campaign','ivr','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','FaxQueue','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues'];(function(_0x46b6ef,_0x101741){var _0x391e35=function(_0x7b6cfe){while(--_0x7b6cfe){_0x46b6ef['push'](_0x46b6ef['shift']());}};_0x391e35(++_0x101741);}(_0xe5e8,0xe7));var _0x8e5e=function(_0x21943c,_0x40516d){_0x21943c=_0x21943c-0x0;var _0x2fd945=_0xe5e8[_0x21943c];return _0x2fd945;};'use strict';var _=require(_0x8e5e('0x0'));var util=require(_0x8e5e('0x1'));var BPromise=require(_0x8e5e('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x8e5e('0x3'),'model':db[_0x8e5e('0x4')],'attributes':['id','name',_0x8e5e('0x5')],'raw':!![],'where':{'role':_0x8e5e('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8e5e('0x7')],'where':{'role':_0x8e5e('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8e5e('0x7')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x8e5e('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8e5e('0x7'),_0x8e5e('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3989fa,_0x9b22e4,_0x3f5935){return db[_0x8e5e('0xa')][_0x8e5e('0xb')]({'where':{'name':_0x3989fa,'userProfileId':_0x9b22e4},'raw':!![]})[_0x8e5e('0xc')](function(_0x5f4ec4){if(_0x5f4ec4){if(_0x5f4ec4[_0x8e5e('0xd')]){switch(_0x3989fa){case _0x8e5e('0xe'):case _0x8e5e('0xf'):case _0x8e5e('0x10'):case _0x8e5e('0x11'):case _0x8e5e('0x12'):case _0x8e5e('0x13'):case _0x8e5e('0x14'):return db[_0x3f5935][_0x8e5e('0x15')](queryQueues);case _0x8e5e('0x16'):return db[_0x3f5935][_0x8e5e('0x15')](queryTelephones);case'Trunks':return db[_0x3f5935][_0x8e5e('0x15')](queryTrunks);case _0x8e5e('0x17'):return db[_0x3f5935][_0x8e5e('0x15')](queryCampaigns);}}else{return db[_0x8e5e('0x18')][_0x8e5e('0x15')]({'attributes':['resourceId'],'where':{'sectionId':_0x5f4ec4['id']},'raw':!![]})[_0x8e5e('0xc')](function(_0x553b13){if(_0x553b13){var _0x415b88={'where':{'id':_[_0x8e5e('0x19')](_0x553b13,'resourceId')},'raw':!![]};switch(_0x3f5935){case'User':_0x415b88[_0x8e5e('0x1a')][_0x8e5e('0x5')]=_0x8e5e('0x8');break;case _0x8e5e('0x1b'):_0x415b88[_0x8e5e('0x1a')][_0x8e5e('0x9')]=_0x8e5e('0x1c');break;}return db[_0x3f5935]['findAll'](_0x415b88);}else{return[];}});}}else{return[];}})[_0x8e5e('0xc')](function(_0x1b49af){return _0x1b49af;});}function joinOrLeaveQueues(_0x124a3a,_0x2ee13a,_0x213cca,_0x57d674){_0x124a3a[_0x2ee13a](util['format']('%s:queue:%s',_0x213cca,_0x57d674[_0x8e5e('0x7')]));if(_0x57d674[_0x8e5e('0x3')]){for(var _0x36689f=0x0;_0x36689f<_0x57d674['Agents'][_0x8e5e('0x1d')];_0x36689f+=0x1){_0x124a3a[_0x2ee13a](util[_0x8e5e('0x1e')](_0x8e5e('0x1f'),_0x57d674[_0x8e5e('0x3')][_0x36689f][_0x8e5e('0x7')]));}}}function joinOrLeave(_0x3462ac,_0xefc4c,_0x58d91d){var _0x49bd22;if(_0x3462ac[_0x8e5e('0x20')][_0x8e5e('0x21')]['id']){db[_0x8e5e('0x4')][_0x8e5e('0x22')]({'attributes':['id',_0x8e5e('0x7'),_0x8e5e('0x5'),_0x8e5e('0x23')],'where':{'id':_0x3462ac['handshake'][_0x8e5e('0x21')]['id']},'include':[{'model':db[_0x8e5e('0x24')],'as':_0x8e5e('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x8e5e('0x26')],'as':_0x8e5e('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x8e5e('0x28')],'as':_0x8e5e('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x8e5e('0x2a')],'as':_0x8e5e('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8e5e('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x8e5e('0xc')](function(_0x39c0e5){if(_0x39c0e5){_0x49bd22=_0x39c0e5;_0x3462ac[_0xefc4c](util[_0x8e5e('0x1e')](_0x8e5e('0x1f'),_0x39c0e5['name']));var _0x34cb66=[];switch(_0x39c0e5['role']){case _0x8e5e('0x2d'):_0x3462ac[_0xefc4c](_0x8e5e('0x2e'));_0x3462ac[_0xefc4c](_0x8e5e('0x2f'));if(queryQueues[_0x8e5e('0x30')](_0x8e5e('0x31'))){delete queryQueues['include'];}_0x34cb66[_0x8e5e('0x32')](db[_0x8e5e('0x33')]['findAll'](queryQueues));_0x34cb66[_0x8e5e('0x32')](db[_0x8e5e('0x34')][_0x8e5e('0x15')](queryQueues));_0x34cb66[_0x8e5e('0x32')](db['FaxQueue'][_0x8e5e('0x15')](queryQueues));_0x34cb66[_0x8e5e('0x32')](db[_0x8e5e('0x35')][_0x8e5e('0x15')](queryQueues));_0x34cb66[_0x8e5e('0x32')](db['MailQueue'][_0x8e5e('0x15')](queryQueues));_0x34cb66[_0x8e5e('0x32')](db[_0x8e5e('0x36')][_0x8e5e('0x15')](queryQueues));_0x34cb66[_0x8e5e('0x32')](db[_0x8e5e('0x37')][_0x8e5e('0x15')](queryQueues));_0x34cb66[_0x8e5e('0x32')](db[_0x8e5e('0x4')][_0x8e5e('0x15')](queryTelephones));_0x34cb66[_0x8e5e('0x32')](db[_0x8e5e('0x38')][_0x8e5e('0x15')](queryTrunks));_0x34cb66['push'](db[_0x8e5e('0x1b')][_0x8e5e('0x15')](queryCampaigns));_0x34cb66['push'](db[_0x8e5e('0x4')][_0x8e5e('0x15')](queryAgents));break;case _0x8e5e('0x39'):_0x3462ac[_0xefc4c](_0x8e5e('0x2e'));_0x3462ac[_0xefc4c](_0x8e5e('0x2f'));_0x34cb66['push'](getAssociatedResources('VoiceQueues',_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x33')));_0x34cb66['push'](getAssociatedResources(_0x8e5e('0xf'),_0x39c0e5[_0x8e5e('0x23')],'ChatQueue'));_0x34cb66[_0x8e5e('0x32')](getAssociatedResources(_0x8e5e('0x10'),_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x3a')));_0x34cb66[_0x8e5e('0x32')](getAssociatedResources('SmsQueues',_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x35')));_0x34cb66['push'](getAssociatedResources('MailQueues',_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x3b')));_0x34cb66[_0x8e5e('0x32')](getAssociatedResources('OpenchannelQueues',_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x36')));_0x34cb66[_0x8e5e('0x32')](getAssociatedResources(_0x8e5e('0x14'),_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x37')));_0x34cb66['push'](getAssociatedResources(_0x8e5e('0x16'),_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x4')));_0x34cb66[_0x8e5e('0x32')](getAssociatedResources('Trunks',_0x39c0e5[_0x8e5e('0x23')],_0x8e5e('0x38')));_0x34cb66[_0x8e5e('0x32')](getAssociatedResources('IvrCampaigns',_0x39c0e5[_0x8e5e('0x23')],'Campaign'));_0x34cb66['push'](db[_0x8e5e('0x4')][_0x8e5e('0x15')](queryAgents));break;case _0x8e5e('0x6'):_0x3462ac[_0xefc4c]('voice:inbound');_0x3462ac[_0xefc4c](_0x8e5e('0x2f'));_0x34cb66[_0x8e5e('0x32')](_0x39c0e5[_0x8e5e('0x3c')]({'attributes':['id',_0x8e5e('0x7')]}));_0x34cb66[_0x8e5e('0x32')](_0x39c0e5[_0x8e5e('0x3d')]({'attributes':['id',_0x8e5e('0x7')]}));_0x34cb66[_0x8e5e('0x32')](_0x39c0e5[_0x8e5e('0x3e')]({'attributes':['id',_0x8e5e('0x7')]}));_0x34cb66[_0x8e5e('0x32')](_0x39c0e5[_0x8e5e('0x3f')]({'attributes':['id',_0x8e5e('0x7')]}));_0x34cb66[_0x8e5e('0x32')](_0x39c0e5[_0x8e5e('0x40')]({'attributes':['id','name']}));_0x34cb66[_0x8e5e('0x32')](_0x39c0e5[_0x8e5e('0x41')]({'attributes':['id','name']}));_0x34cb66[_0x8e5e('0x32')](_0x39c0e5[_0x8e5e('0x42')]({'attributes':['id',_0x8e5e('0x7')]}));break;}return BPromise[_0x8e5e('0x43')](_0x34cb66);}})[_0x8e5e('0xc')](function(_0x1539e4){if(_0x1539e4&&_0x1539e4[_0x8e5e('0x1d')]){for(var _0x59436d=0x0;_0x59436d<_0x1539e4[_0x8e5e('0x1d')];_0x59436d+=0x1){for(var _0x46f67e=0x0;_0x46f67e<_0x1539e4[_0x59436d][_0x8e5e('0x1d')];_0x46f67e+=0x1){switch(_0x59436d){case 0x0:joinOrLeaveQueues(_0x3462ac,_0xefc4c,_0x8e5e('0x44'),_0x1539e4[_0x59436d][_0x46f67e]);break;case 0x1:joinOrLeaveQueues(_0x3462ac,_0xefc4c,_0x8e5e('0x45'),_0x1539e4[_0x59436d][_0x46f67e]);break;case 0x2:joinOrLeaveQueues(_0x3462ac,_0xefc4c,'fax',_0x1539e4[_0x59436d][_0x46f67e]);break;case 0x3:joinOrLeaveQueues(_0x3462ac,_0xefc4c,_0x8e5e('0x46'),_0x1539e4[_0x59436d][_0x46f67e]);break;case 0x4:joinOrLeaveQueues(_0x3462ac,_0xefc4c,'mail',_0x1539e4[_0x59436d][_0x46f67e]);break;case 0x5:joinOrLeaveQueues(_0x3462ac,_0xefc4c,_0x8e5e('0x47'),_0x1539e4[_0x59436d][_0x46f67e]);break;case 0x6:joinOrLeaveQueues(_0x3462ac,_0xefc4c,_0x8e5e('0x48'),_0x1539e4[_0x59436d][_0x46f67e]);break;case 0x7:if(_0x49bd22['role']!==_0x8e5e('0x6'))_0x3462ac[_0xefc4c](util[_0x8e5e('0x1e')]('telephone:%s',_0x1539e4[_0x59436d][_0x46f67e][_0x8e5e('0x7')]));break;case 0x8:if(_0x49bd22[_0x8e5e('0x5')]!=='agent')_0x3462ac[_0xefc4c](util[_0x8e5e('0x1e')](_0x8e5e('0x49'),_0x1539e4[_0x59436d][_0x46f67e]['name']));break;case 0x9:if(_0x49bd22[_0x8e5e('0x5')]!=='agent')_0x3462ac[_0xefc4c](util[_0x8e5e('0x1e')](_0x8e5e('0x4a'),_0x1539e4[_0x59436d][_0x46f67e][_0x8e5e('0x9')],_0x1539e4[_0x59436d][_0x46f67e][_0x8e5e('0x7')]));break;case 0xa:_0x3462ac[_0xefc4c](util[_0x8e5e('0x1e')]('user:%s',_0x1539e4[_0x59436d][_0x46f67e][_0x8e5e('0x7')]));break;}}}}})[_0x8e5e('0xc')](function(){if(_0xefc4c===_0x8e5e('0x4b')){var _0x5e7a8e=_['map'](_0x49bd22[_0x8e5e('0x25')],'id');return _0x49bd22[_0x8e5e('0x4c')](_0x5e7a8e)[_0x8e5e('0xc')](function(){for(var _0x5a102d=0x0;_0x5a102d<_0x5e7a8e['length'];_0x5a102d+=0x1){_0x58d91d[_0x8e5e('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x5e7a8e[_0x5a102d]),'UserId':Number(_0x49bd22['id'])});}});}})[_0x8e5e('0xc')](function(){if(_0xefc4c===_0x8e5e('0x4b')){var _0x3ca92e=_[_0x8e5e('0x19')](_0x49bd22['MailInteractions'],'id');return _0x49bd22[_0x8e5e('0x4e')](_0x3ca92e)[_0x8e5e('0xc')](function(){for(var _0x549870=0x0;_0x549870<_0x3ca92e[_0x8e5e('0x1d')];_0x549870+=0x1){_0x58d91d[_0x8e5e('0x4d')](_0x8e5e('0x4f'),{'MailInteractionId':Number(_0x3ca92e[_0x549870]),'UserId':Number(_0x49bd22['id'])});}});}})['then'](function(){if(_0xefc4c==='leave'){var _0x451dd1=_[_0x8e5e('0x19')](_0x49bd22[_0x8e5e('0x29')],'id');return _0x49bd22['removeFaxInteractions'](_0x451dd1)[_0x8e5e('0xc')](function(){for(var _0x2bbd32=0x0;_0x2bbd32<_0x451dd1[_0x8e5e('0x1d')];_0x2bbd32+=0x1){_0x58d91d[_0x8e5e('0x4d')](_0x8e5e('0x50'),{'FaxInteractionId':Number(_0x451dd1[_0x2bbd32]),'UserId':Number(_0x49bd22['id'])});}});}})[_0x8e5e('0xc')](function(){if(_0xefc4c==='leave'){var _0xa8dd5e=_[_0x8e5e('0x19')](_0x49bd22[_0x8e5e('0x2b')],'id');return _0x49bd22['removeSmsInteractions'](_0xa8dd5e)[_0x8e5e('0xc')](function(){for(var _0x5c2338=0x0;_0x5c2338<_0xa8dd5e[_0x8e5e('0x1d')];_0x5c2338+=0x1){_0x58d91d[_0x8e5e('0x4d')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xa8dd5e[_0x5c2338]),'UserId':Number(_0x49bd22['id'])});}});}})['then'](function(){if(_0xefc4c===_0x8e5e('0x4b')){var _0x3b9f3f=_[_0x8e5e('0x19')](_0x49bd22[_0x8e5e('0x51')],'id');return _0x49bd22['removeOpenchannelInteractions'](_0x3b9f3f)['then'](function(){for(var _0x4891f6=0x0;_0x4891f6<_0x3b9f3f[_0x8e5e('0x1d')];_0x4891f6+=0x1){_0x58d91d[_0x8e5e('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3b9f3f[_0x4891f6]),'UserId':Number(_0x49bd22['id'])});}});}})[_0x8e5e('0xc')](function(){if(_0xefc4c===_0x8e5e('0x4b')){var _0xae3178=_[_0x8e5e('0x19')](_0x49bd22[_0x8e5e('0x52')],'id');return _0x49bd22[_0x8e5e('0x53')](_0xae3178)['then'](function(){for(var _0x53de69=0x0;_0x53de69<_0xae3178[_0x8e5e('0x1d')];_0x53de69+=0x1){_0x58d91d[_0x8e5e('0x4d')](_0x8e5e('0x54'),{'WhatsappInteractionId':Number(_0xae3178[_0x53de69]),'UserId':Number(_0x49bd22['id'])});}});}})[_0x8e5e('0x55')](function(_0x4a0f29){_0x3462ac[_0x8e5e('0x56')](_0x4a0f29);});}}function onDisconnect(_0x247da1,_0x4f400f){joinOrLeave(_0x247da1,'leave',_0x4f400f);}function onConnect(_0x1dbeaf){joinOrLeave(_0x1dbeaf,_0x8e5e('0x57'));}exports[_0x8e5e('0x58')]=function(_0x55d279){_0x55d279['on'](_0x8e5e('0x59'),function(_0x1df471){_0x1df471[_0x8e5e('0x5a')](0x0);_0x1df471[_0x8e5e('0x5b')]=_0x1df471[_0x8e5e('0x5c')][_0x8e5e('0x59')][_0x8e5e('0x5d')]+':'+_0x1df471[_0x8e5e('0x5c')]['connection']['remotePort'];_0x1df471[_0x8e5e('0x5e')]=new Date();_0x1df471[_0x8e5e('0x56')]=function(_0x144405){console['log']('SocketIO\x20'+_0x1df471[_0x8e5e('0x5f')][_0x8e5e('0x7')]+'['+_0x1df471[_0x8e5e('0x5b')]+']',_0x144405);};_0x1df471['on'](_0x8e5e('0x60'),function(){onDisconnect(_0x1df471,_0x55d279);_0x1df471[_0x8e5e('0x56')](_0x8e5e('0x61'));});onConnect(_0x1df471);_0x1df471[_0x8e5e('0x56')](_0x8e5e('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a2a1a68..3f69454 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 _0x0d88=['changed','substatus','closed','User','find','fullname','email','internal','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','ChatInteraction','afterCreate','Chat','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','Whatsapp','WhatsappInteraction','closedinteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s','EventManager','error','code','channel','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','catch','AfterCreateMessage','get','motionChannel','event','opened','resolve','sequelize','AfterCreate'];(function(_0x41b5ca,_0x3dbf55){var _0x8fa6e6=function(_0x13a567){while(--_0x13a567){_0x41b5ca['push'](_0x41b5ca['shift']());}};_0x8fa6e6(++_0x3dbf55);}(_0x0d88,0x1ca));var _0x80d8=function(_0x471f05,_0x50e17f){_0x471f05=_0x471f05-0x0;var _0x491c37=_0x0d88[_0x471f05];return _0x491c37;};'use strict';var util=require(_0x80d8('0x0'));var db=require(_0x80d8('0x1'))['db'];var jayson=require(_0x80d8('0x2'));var logger=require(_0x80d8('0x3'))(_0x80d8('0x4'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x80d8('0x5'),'event':_0x80d8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x80d8('0x7'),'model':_0x80d8('0x5'),'event':_0x80d8('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x80d8('0x7'),'model':_0x80d8('0x9'),'event':_0x80d8('0x6'),'condition':_0x80d8('0xa'),'callback':afterCreateMessage},{'channel':_0x80d8('0xb'),'model':_0x80d8('0xc'),'event':_0x80d8('0x6'),'condition':_0x80d8('0xd'),'callback':afterCreate},{'channel':_0x80d8('0xb'),'model':_0x80d8('0xc'),'event':_0x80d8('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x80d8('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x80d8('0xe'),'model':_0x80d8('0xf'),'event':'afterCreate','condition':_0x80d8('0xd'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x80d8('0xf'),'event':_0x80d8('0x8'),'condition':_0x80d8('0x10'),'callback':afterUpdate},{'channel':_0x80d8('0xe'),'model':_0x80d8('0x11'),'event':_0x80d8('0x6'),'condition':_0x80d8('0xa'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x80d8('0x12'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x80d8('0x12'),'event':_0x80d8('0x8'),'condition':_0x80d8('0x10'),'callback':afterUpdate},{'channel':_0x80d8('0x13'),'model':_0x80d8('0x14'),'event':_0x80d8('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x80d8('0x15'),'model':_0x80d8('0x16'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x80d8('0x15'),'model':_0x80d8('0x16'),'event':_0x80d8('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':'afterCreate','condition':_0x80d8('0xa'),'callback':afterCreateMessage},{'channel':_0x80d8('0x17'),'model':_0x80d8('0x18'),'event':'afterCreate','condition':_0x80d8('0xd'),'callback':afterCreate},{'channel':_0x80d8('0x17'),'model':_0x80d8('0x18'),'event':_0x80d8('0x8'),'condition':_0x80d8('0x10'),'callback':afterUpdate},{'channel':_0x80d8('0x17'),'model':_0x80d8('0x19'),'event':_0x80d8('0x6'),'condition':_0x80d8('0xa'),'callback':afterCreateMessage}];function request(_0x2d3a41){return client[_0x80d8('0x1a')]('EventManager',_0x2d3a41)[_0x80d8('0x1b')](function(_0x5220a5){logger[_0x80d8('0x1c')](_0x80d8('0x1d'),_0x80d8('0x1e'),_0x5220a5);if(_0x5220a5[_0x80d8('0x1f')]){if(_0x5220a5[_0x80d8('0x1f')][_0x80d8('0x20')]===0x1f4){logger['error']('Trigger,\x20%s','EventManager',_0x5220a5[_0x80d8('0x1f')]);}}})['catch'](function(_0x50d76b){logger[_0x80d8('0x1f')](_0x80d8('0x1d'),'EventManager',_0x50d76b);});}function afterCreateMessage(_0x599a8d){return function(_0x4657ee){_0x4657ee=_0x4657ee['get']({'plain':!![]});_0x4657ee[_0x80d8('0x21')]=_0x599a8d;_0x4657ee['motionChannel']=_0x599a8d;_0x4657ee['event']=_0x4657ee[_0x80d8('0x22')];Promise['resolve']()[_0x80d8('0x1b')](function(){if(typeof _0x4657ee[_0x80d8('0x23')]===_0x80d8('0x24'))return null;var _0x506f4a=_0x80d8('0x25')+_0x4657ee['ContactId'];return db['sequelize'][_0x80d8('0x26')](_0x506f4a,{'type':db[_0x80d8('0x27')][_0x80d8('0x28')][_0x80d8('0x29')],'raw':!![]});})[_0x80d8('0x1b')](function(_0x5445bc){if(_0x5445bc){_0x4657ee[_0x80d8('0x2a')]=_0x5445bc[0x0];}if(typeof _0x4657ee[_0x80d8('0x2b')]===_0x80d8('0x24'))return;return getAgent(_0x4657ee['UserId']);})[_0x80d8('0x1b')](function(_0x22625b){if(_0x22625b){_0x4657ee[_0x80d8('0x2c')]=util[_0x80d8('0x2d')](_0x80d8('0x2e'),_0x22625b[_0x80d8('0x2f')]);_0x4657ee[_0x80d8('0x30')]=_0x22625b;_0x4657ee[_0x80d8('0x21')]=_0x599a8d;return request({'event':_0x80d8('0x31'),'message':_0x4657ee});}else{return request({'event':_0x80d8('0x32'),'message':_0x4657ee});}})[_0x80d8('0x33')](function(_0x3f88ed){logger[_0x80d8('0x1f')](_0x80d8('0x1d'),_0x80d8('0x34'),_0x3f88ed);});};}function afterCreate(_0x196c16,_0x39b688){return function(_0x298d36){_0x298d36=_0x298d36[_0x80d8('0x35')]({'plain':!![]});_0x298d36[_0x80d8('0x21')]=_0x196c16;_0x298d36[_0x80d8('0x36')]=_0x196c16;_0x298d36[_0x80d8('0x37')]=_0x80d8('0x38');Promise[_0x80d8('0x39')]()['then'](function(){var _0x324dac=_0x80d8('0x25')+_0x298d36[_0x80d8('0x23')];return db[_0x80d8('0x3a')][_0x80d8('0x26')](_0x324dac,{'type':db['Sequelize'][_0x80d8('0x28')][_0x80d8('0x29')],'raw':!![]});})[_0x80d8('0x1b')](function(_0x3d06f0){if(_0x3d06f0){_0x298d36[_0x80d8('0x2a')]=_0x3d06f0[0x0];}if(typeof _0x298d36[_0x80d8('0x2b')]===_0x80d8('0x24'))return;return getAgent(_0x298d36[_0x80d8('0x2b')]);})[_0x80d8('0x1b')](function(_0x188d1f){if(_0x188d1f){_0x298d36[_0x80d8('0x2c')]=util[_0x80d8('0x2d')](_0x80d8('0x2e'),_0x188d1f[_0x80d8('0x2f')]);_0x298d36[_0x80d8('0x30')]=_0x188d1f;}return request({'event':_0x39b688,'message':_0x298d36});})[_0x80d8('0x33')](function(_0x4df800){logger[_0x80d8('0x1f')]('Trigger,\x20%s',_0x80d8('0x3b'),_0x4df800);});};}function afterUpdate(_0xdfcbd6){return function(_0x1f0079){var _0x39023f=_0x1f0079[_0x80d8('0x3c')]('closed')&&_0x1f0079['closed'];var _0x2522c8=_0x1f0079['changed'](_0x80d8('0x3d'));if(_0x39023f||_0x2522c8){var _0x9085e9=_0x39023f?_0x80d8('0x10'):'substatus';var _0x173b14=_0x1f0079[_0x80d8('0x35')]({'plain':!![]});_0x173b14['channel']=_0xdfcbd6;_0x173b14[_0x80d8('0x36')]=_0xdfcbd6;_0x173b14[_0x80d8('0x37')]=_0x39023f?_0x80d8('0x3e'):_0x80d8('0x3d');var _0x428e21=_0x80d8('0x25')+_0x173b14['ContactId'];return db[_0x80d8('0x3a')][_0x80d8('0x26')](_0x428e21,{'type':db[_0x80d8('0x27')][_0x80d8('0x28')][_0x80d8('0x29')],'raw':!![]})[_0x80d8('0x1b')](function(_0x4babbc){if(_0x4babbc){_0x173b14[_0x80d8('0x2a')]=_0x4babbc[0x0];}if(typeof _0x173b14[_0x80d8('0x2b')]===_0x80d8('0x24'))return;return getAgent(_0x173b14[_0x80d8('0x2b')]);})[_0x80d8('0x1b')](function(_0x31f26b){if(_0x31f26b){_0x173b14[_0x80d8('0x2c')]=util[_0x80d8('0x2d')]('SIP/%s',_0x31f26b[_0x80d8('0x2f')]);_0x173b14['agent']=_0x31f26b;}return request({'event':_0x9085e9,'message':_0x173b14});})[_0x80d8('0x33')](function(_0x209c09){logger['error'](_0x80d8('0x1d'),'AfterUpdate',_0x209c09);});}};}function getAgent(_0x5ea157){return db[_0x80d8('0x3f')][_0x80d8('0x40')]({'where':{'id':_0x5ea157},'attributes':['id',_0x80d8('0x2f'),_0x80d8('0x41'),_0x80d8('0x42'),_0x80d8('0x43')],'raw':!![]})[_0x80d8('0x1b')](function(_0x2424e7){return _0x2424e7;});}exports['default']=function(){for(var _0x60a1f9=0x0;_0x60a1f9=_0xef9fa8['agents']){throw Error(_0x08b8('0x11'));}_0x1e0b7a(_0x3cad3b);})[_0x08b8('0x12')](function(_0x4a0fa5){_0x21df07(_0x4a0fa5);});});}; \ No newline at end of file +var _0x2600=['count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','voice','chat','fax','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','getLicense','role','User'];(function(_0x5e94da,_0x4dfe74){var _0x359931=function(_0x51b824){while(--_0x51b824){_0x5e94da['push'](_0x5e94da['shift']());}};_0x359931(++_0x4dfe74);}(_0x2600,0x131));var _0x0260=function(_0x294a8e,_0x419033){_0x294a8e=_0x294a8e-0x0;var _0x3ba3a3=_0x2600[_0x294a8e];return _0x3ba3a3;};'use strict';var _=require(_0x0260('0x0'));var BPromise=require(_0x0260('0x1'));var db=require(_0x0260('0x2'))['db'];var util=require('./license/util');var channels=[_0x0260('0x3'),'mail',_0x0260('0x4'),_0x0260('0x5'),'sms',_0x0260('0x6'),_0x0260('0x7')];exports[_0x0260('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x3c26d5){_0x3c26d5=_0x3c26d5[_0x0260('0x9')]();return _[_0x0260('0xa')](channels,_0x3c26d5);};exports[_0x0260('0xb')]=function(_0x11c3b4,_0x5d1c04,_0x40a734,_0x523d55){var _0x3b06cf={'loginAttempts':_0x5d1c04,'blocked':_0x40a734};if(!_[_0x0260('0xc')](_0x523d55)){_0x3b06cf[_0x0260('0xd')]=_0x523d55;}return _0x11c3b4['updateAttributes'](_0x3b06cf);};exports[_0x0260('0xe')]=function(_0x239566){return new BPromise(function(_0x463f9d,_0x5ac742){var _0xd49f9c=0x0;if(_0x239566[_0x0260('0xf')]!=='agent'){_0x463f9d(_0x239566);}db[_0x0260('0x10')][_0x0260('0x11')]({'where':{'role':_0x0260('0x12'),'online':!![],'id':{'$ne':_0x239566['id']}}})[_0x0260('0x13')](function(_0x124f0b){_0xd49f9c=_0x124f0b;return util[_0x0260('0xe')]();})[_0x0260('0x13')](function(_0x13ef89){if(_0x13ef89&&_0x13ef89[_0x0260('0x14')]&&_0xd49f9c>=_0x13ef89[_0x0260('0x14')]){throw Error(_0x0260('0x15'));}_0x463f9d(_0x239566);})[_0x0260('0x16')](function(_0x3b5474){_0x5ac742(_0x3b5474);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index dd07b85..91b1aea 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa512=['status','render','404'];(function(_0xab6a2b,_0x403a6b){var _0x33edba=function(_0x533c32){while(--_0x533c32){_0xab6a2b['push'](_0xab6a2b['shift']());}};_0x33edba(++_0x403a6b);}(_0xa512,0xcb));var _0x2a51=function(_0xb8fd40,_0x23030a){_0xb8fd40=_0xb8fd40-0x0;var _0x46fcde=_0xa512[_0xb8fd40];return _0x46fcde;};'use strict';module['exports'][0x194]=function pageNotFound(_0x10ae19,_0x29f531){var _0x8c6743=_0x2a51('0x0');var _0x1f8cff=0x194;var _0x4425c5={'status':_0x1f8cff};_0x29f531[_0x2a51('0x1')](_0x4425c5[_0x2a51('0x1')]);_0x29f531[_0x2a51('0x2')](_0x8c6743,{},function(_0xf2099b,_0x7cf4b8){if(_0xf2099b){return _0x29f531[_0x2a51('0x1')](_0x4425c5['status'])['json'](_0x4425c5);}_0x29f531['send'](_0x7cf4b8);});}; \ No newline at end of file +var _0xe53b=['exports','404','status','render','json','send'];(function(_0x40eec9,_0x817a67){var _0xfee890=function(_0x186640){while(--_0x186640){_0x40eec9['push'](_0x40eec9['shift']());}};_0xfee890(++_0x817a67);}(_0xe53b,0x1a4));var _0xbe53=function(_0xfb5685,_0x5d0ca8){_0xfb5685=_0xfb5685-0x0;var _0xa9e5ea=_0xe53b[_0xfb5685];return _0xa9e5ea;};'use strict';module[_0xbe53('0x0')][0x194]=function pageNotFound(_0x3589d8,_0x2d0a2e){var _0x1035ce=_0xbe53('0x1');var _0x2adf91=0x194;var _0x59a51d={'status':_0x2adf91};_0x2d0a2e[_0xbe53('0x2')](_0x59a51d[_0xbe53('0x2')]);_0x2d0a2e[_0xbe53('0x3')](_0x1035ce,{},function(_0x4447b7,_0x2cf256){if(_0x4447b7){return _0x2d0a2e['status'](_0x59a51d[_0xbe53('0x2')])[_0xbe53('0x4')](_0x59a51d);}_0x2d0a2e[_0xbe53('0x5')](_0x2cf256);});}; \ No newline at end of file diff --git a/server/migrations/2.5.37.js b/server/migrations/2.5.37.js index d3202ae..b8df934 100644 --- a/server/migrations/2.5.37.js +++ b/server/migrations/2.5.37.js @@ -164,11 +164,11 @@ module.exports = { ' `UserId` int(11) DEFAULT NULL,' + ' PRIMARY KEY (`id`),' + ' KEY `UserId` (`UserId`),' + - ' CONSTRAINT `user_settings_ibfk_1` FOREIGN KEY (`UserId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,' + + ' CONSTRAINT `user_settings_ibfk_1` FOREIGN KEY (`UserId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE' + ') ENGINE=InnoDB DEFAULT CHARSET=utf8;'); migration.query( - "INSERT INTO `user_settings`(clientSideLoggingLevel, clientSideLoggingScopes, clientSideLoggingEnabledSince, createdAt , updatedAt , userId) SELECT 'error', '[]', NULL, NOW(), NOW(), id FROM `users`" + "INSERT INTO `user_settings`(clientSideLoggingLevel, clientSideLoggingEnabled, clientSideLoggingEnabledSince, createdAt , updatedAt , userId) SELECT 'error', false, NULL, NOW(), NOW(), id FROM `users`" ); // END user settings diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 84aa34a..353ddfb 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f98=['WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccount','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Members','VoiceQueueId','Hoppers','CmHopperFinal','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Agents','UserVoiceQueue','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailServerOut','MailAccountId','Smtp','Dispositions','CannedAnswer','Answers','MailMessage','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','team_has_mail_queues','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','DashboardItem','Items','FaxAccountId','Exntensions','user_has_fax_accounts','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Tags','UserSmsQueue','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','CompanyId','cm_contact_has_tags','Queue','OwnerId','CampaignId','Automation','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','ChatApplications','FaxApplications','SmsApplications','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','DefaultReportId','MetricId','Configurations','Subjects','SubjectId','DescriptionId','FieldId','AccountId','Subject','Description','VariableId','SugarcrmField','SugarcrmAccount','DeskAccount','DeskField','Descriptions','int_desk_configuration_has_tags','Field','ZohoAccount','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','FromId','SessionId','SmsQueueReport','ProjectId','JscriptyProject','team_has_sms_queues','team_has_openchannel_queues','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ToChatWebsiteId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','UserSetting','user','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions'];(function(_0x260749,_0x14042a){var _0x4dfe6e=function(_0x38f4fa){while(--_0x38f4fa){_0x260749['push'](_0x260749['shift']());}};_0x4dfe6e(++_0x14042a);}(_0x8f98,0xd9));var _0x88f9=function(_0x33402e,_0x2f2347){_0x33402e=_0x33402e-0x0;var _0x33e8bb=_0x8f98[_0x33402e];return _0x33e8bb;};'use strict';var config=require(_0x88f9('0x0'));var Sequelize=require(_0x88f9('0x1'));var _=require('lodash');var jstz=require(_0x88f9('0x2'));var timezone=jstz[_0x88f9('0x3')]();config['sequelize']=_[_0x88f9('0x4')](config[_0x88f9('0x1')],{'database':_0x88f9('0x5'),'username':'xcall','password':_0x88f9('0x6'),'options':{'host':_0x88f9('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x88f9('0x8')},'logging':![],'timezone':timezone[_0x88f9('0x9')](),'define':{'charset':_0x88f9('0xa'),'collate':_0x88f9('0xb')}}});config['sequelizeHistory']=_[_0x88f9('0x4')](config[_0x88f9('0xc')],{'database':_0x88f9('0x5'),'username':_0x88f9('0xd'),'password':'xC@LL1234','options':{'host':_0x88f9('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x88f9('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x88f9('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x88f9('0x1')][_0x88f9('0xe')],config[_0x88f9('0x1')]['username'],config[_0x88f9('0x1')][_0x88f9('0xf')],config[_0x88f9('0x1')][_0x88f9('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x88f9('0xe')],config[_0x88f9('0xc')]['username'],config['sequelizeHistory'][_0x88f9('0xf')],config[_0x88f9('0xc')]['options'])};db[_0x88f9('0x11')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x13'));db[_0x88f9('0x14')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x15'));db[_0x88f9('0x16')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x17'));db[_0x88f9('0x18')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x19'));db[_0x88f9('0x1a')]=db['sequelize']['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x88f9('0x1b')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x1c'));db[_0x88f9('0x1d')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x88f9('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0x88f9('0x1e')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x1f'));db[_0x88f9('0x20')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x21'));db[_0x88f9('0x22')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0x88f9('0x23')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x24'));db[_0x88f9('0x25')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x88f9('0x26')]=db['sequelize'][_0x88f9('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x88f9('0x27')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x28'));db[_0x88f9('0x29')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x2a'));db[_0x88f9('0x2b')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x2c'));db[_0x88f9('0x2d')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x2e'));db[_0x88f9('0x2f')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/userMailQueue/userMailQueue.model');db[_0x88f9('0x30')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x31'));db['UserSmsQueue']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x32'));db[_0x88f9('0x33')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x34'));db['UserWhatsappQueue']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x35'));db[_0x88f9('0x36')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x37'));db['MailServerOut']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x38'));db[_0x88f9('0x39')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x3a'));db[_0x88f9('0x3b')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/mailQueue/mailQueue.model');db[_0x88f9('0x3c')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x3d'));db[_0x88f9('0x3e')]=db[_0x88f9('0x1')]['import']('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x3f'));db[_0x88f9('0x40')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x41'));db[_0x88f9('0x42')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x43'));db[_0x88f9('0x44')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x45'));db['DashboardItem']=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x46'));db[_0x88f9('0x47')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x48'));db['FaxInteraction']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x49'));db[_0x88f9('0x4a')]=db[_0x88f9('0x1')]['import']('../api/faxMessage/faxMessage.model');db[_0x88f9('0x4b')]=db[_0x88f9('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x88f9('0x4c')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x4d'));db[_0x88f9('0x4e')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/smsAccount/smsAccount.model');db[_0x88f9('0x4f')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x50'));db[_0x88f9('0x51')]=db['sequelize']['import'](_0x88f9('0x52'));db[_0x88f9('0x53')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x54'));db[_0x88f9('0x55')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x56'));db[_0x88f9('0x57')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x58'));db[_0x88f9('0x59')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x5a'));db['OpenchannelInteraction']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x5b'));db['OpenchannelMessage']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x5c'));db[_0x88f9('0x5d')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x5e'));db[_0x88f9('0x5f')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x60'));db['OpenchannelQueueReport']=db[_0x88f9('0x1')]['import'](_0x88f9('0x61'));db[_0x88f9('0x62')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x63'));db['ChatInteraction']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x64'));db['ChatMessage']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x65'));db[_0x88f9('0x66')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x67'));db[_0x88f9('0x68')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x69'));db[_0x88f9('0x6a')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x6b'));db[_0x88f9('0x6c')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x6d'));db[_0x88f9('0x6e')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x6f'));db[_0x88f9('0x70')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x71'));db[_0x88f9('0x72')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x73'));db['CmHopperBlack']=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x88f9('0x74')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x75'));db['ReportAgentPreview']=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x88f9('0x76')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x88f9('0x77')]=db['sequelize']['import'](_0x88f9('0x78'));db['Automation']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x79'));db['CannedAnswer']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x7a'));db[_0x88f9('0x7b')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x7c'));db['Condition']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x7d'));db[_0x88f9('0x7e')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x7f'));db[_0x88f9('0x80')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/pause/pause.model');db['Cdr']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x81'));db[_0x88f9('0x82')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x88f9('0x83')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x84'));db[_0x88f9('0x85')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x86'));db[_0x88f9('0x87')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x88'));db[_0x88f9('0x89')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/template/template.model');db[_0x88f9('0x8a')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x8b'));db[_0x88f9('0x8c')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x8d'));db[_0x88f9('0x8e')]=db['sequelize'][_0x88f9('0x12')]('../api/integration/integration.model');db[_0x88f9('0x8f')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x90'));db[_0x88f9('0x91')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x92'));db[_0x88f9('0x93')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x94'));db['AnalyticExtractedReport']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x95'));db[_0x88f9('0x96')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x97'));db[_0x88f9('0x98')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x88f9('0x99')]=db[_0x88f9('0x1')]['import'](_0x88f9('0x9a'));db[_0x88f9('0x9b')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x88f9('0x9c')]=db['sequelize'][_0x88f9('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x88f9('0x9d')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x9e'));db['SugarcrmAccount']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x9f'));db[_0x88f9('0xa0')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xa1'));db['SugarcrmField']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xa2'));db['DeskAccount']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xa3'));db[_0x88f9('0xa4')]=db[_0x88f9('0x1')]['import'](_0x88f9('0xa5'));db['DeskField']=db[_0x88f9('0x1')]['import'](_0x88f9('0xa6'));db['ZohoAccount']=db[_0x88f9('0x1')]['import'](_0x88f9('0xa7'));db[_0x88f9('0xa8')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x88f9('0xa9')]=db[_0x88f9('0x1')]['import'](_0x88f9('0xaa'));db['ZendeskAccount']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xab'));db['ZendeskConfiguration']=db['sequelize']['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x88f9('0xac')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xad'));db[_0x88f9('0xae')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xaf'));db[_0x88f9('0xb0')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x88f9('0xb1')]=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x88f9('0xb2')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xb3'));db['VtigerConfiguration']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xb4'));db[_0x88f9('0xb5')]=db[_0x88f9('0x1')]['import'](_0x88f9('0xb6'));db[_0x88f9('0xb7')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xb8'));db[_0x88f9('0xb9')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xba'));db[_0x88f9('0xbb')]=db[_0x88f9('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x88f9('0xbc')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xbd'));db[_0x88f9('0xbe')]=db['sequelize'][_0x88f9('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x88f9('0xbf')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xc0'));db[_0x88f9('0xc1')]=db[_0x88f9('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x88f9('0xc2')]=db[_0x88f9('0x1')]['import'](_0x88f9('0xc3'));db[_0x88f9('0xc4')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xc5'));db[_0x88f9('0x8e')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xc6'));db[_0x88f9('0xc7')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xc8'));db[_0x88f9('0xc9')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0x88f9('0xca')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xcb'));db[_0x88f9('0xcc')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xcd'));db[_0x88f9('0xce')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xcf'));db[_0x88f9('0xd0')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xd1'));db[_0x88f9('0xd2')]=db[_0x88f9('0x1')]['import'](_0x88f9('0xd3'));db[_0x88f9('0xd4')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xd5'));db['JscriptyProject']=db[_0x88f9('0x1')]['import'](_0x88f9('0xd6'));db[_0x88f9('0xd7')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xd8'));db['SquareOdbc']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xd9'));db[_0x88f9('0xda')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/squareProject/squareProject.model');db[_0x88f9('0xdb')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/squareRecording/squareRecording.model');db[_0x88f9('0xdc')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xdd'));db[_0x88f9('0xde')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xdf'));db[_0x88f9('0xe0')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xe1'));db[_0x88f9('0xe2')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xe3'));db[_0x88f9('0xe4')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xe5'));db[_0x88f9('0xe6')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xe7'));db[_0x88f9('0xe8')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xe9'));db[_0x88f9('0xea')]=db[_0x88f9('0x1')]['import'](_0x88f9('0xeb'));db[_0x88f9('0xec')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xed'));db[_0x88f9('0xee')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xef'));db[_0x88f9('0xf0')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xf1'));db['SmsTransferReport']=db['sequelize'][_0x88f9('0x12')](_0x88f9('0xf2'));db[_0x88f9('0xf3')]=db[_0x88f9('0x1')]['import'](_0x88f9('0xf4'));db[_0x88f9('0xf5')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xf6'));db['UserProfile']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xf7'));db[_0x88f9('0xf8')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xf9'));db['UserProfileResource']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xfa'));db[_0x88f9('0xfb')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xfc'));db['WhatsappAccount']=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xfd'));db[_0x88f9('0xfe')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0xff'));db[_0x88f9('0x100')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x101'));db[_0x88f9('0x102')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x103'));db[_0x88f9('0x104')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x105'));db[_0x88f9('0x106')]=db[_0x88f9('0x1')][_0x88f9('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x88f9('0x107')]=db['sequelize'][_0x88f9('0x12')](_0x88f9('0x108'));db[_0x88f9('0x109')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x10a'));db[_0x88f9('0x10b')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x10c'));db[_0x88f9('0x10d')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x10e'));db[_0x88f9('0x10f')]=db[_0x88f9('0x1')][_0x88f9('0x12')](_0x88f9('0x110'));db['UserSetting']=db[_0x88f9('0x1')]['import']('../api/user-setting/user-setting.model');db['User'][_0x88f9('0x111')](db[_0x88f9('0x1e')],{'as':_0x88f9('0x1e'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11')]['hasOne'](db['UserSetting'],{'as':'userSetting','onDelete':'cascade','foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11')][_0x88f9('0x114')](db['VoiceRecording'],{'as':_0x88f9('0x115'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11')][_0x88f9('0x114')](db[_0x88f9('0x2b')],{'as':_0x88f9('0x116'),'foreignKey':'UserId'});db[_0x88f9('0x11')][_0x88f9('0x114')](db[_0x88f9('0x18')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x88f9('0x11')][_0x88f9('0x114')](db['CmHopperFinal'],{'as':_0x88f9('0x117'),'foreignKey':'UserId'});db[_0x88f9('0x11')][_0x88f9('0x114')](db['CmHopperHistory'],{'as':_0x88f9('0x118'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11')][_0x88f9('0x114')](db[_0x88f9('0x119')],{'as':_0x88f9('0x119'),'foreignKey':_0x88f9('0x113')});db['User'][_0x88f9('0x114')](db[_0x88f9('0x11a')],{'as':_0x88f9('0x11b'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11')]['hasMany'](db[_0x88f9('0x11c')],{'as':_0x88f9('0x11d'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11')]['hasMany'](db[_0x88f9('0x51')],{'as':_0x88f9('0x11e'),'foreignKey':'UserId'});db['User'][_0x88f9('0x114')](db[_0x88f9('0x11f')],{'as':_0x88f9('0x120'),'foreignKey':'UserId'});db[_0x88f9('0x11')]['hasMany'](db[_0x88f9('0x3e')],{'as':_0x88f9('0x121'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11')]['hasMany'](db[_0x88f9('0x100')],{'as':_0x88f9('0x122'),'foreignKey':_0x88f9('0x113')});db['User'][_0x88f9('0x114')](db[_0x88f9('0xfb')],{'as':_0x88f9('0x123'),'foreignKey':_0x88f9('0x124')});db[_0x88f9('0x11')][_0x88f9('0x125')](db[_0x88f9('0x126')],{'as':_0x88f9('0x126'),'foreignKey':_0x88f9('0x127')});db[_0x88f9('0x11')][_0x88f9('0x128')](db['ChatGroup'],{'as':_0x88f9('0x129'),'through':_0x88f9('0x12a')});db[_0x88f9('0x11')][_0x88f9('0x128')](db['CmContact'],{'as':_0x88f9('0x12b'),'through':_0x88f9('0x12c')});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x12d'),'through':'cm_user_has_lists'});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0xde')],{'through':_0x88f9('0x12e')});db['User'][_0x88f9('0x128')](db[_0x88f9('0x3e')],{'as':_0x88f9('0x121'),'through':_0x88f9('0x12f')});db['User'][_0x88f9('0x128')](db['ChatInteraction'],{'as':_0x88f9('0x11d'),'through':_0x88f9('0x130')});db[_0x88f9('0x11')]['belongsToMany'](db['FaxInteraction'],{'as':_0x88f9('0x120'),'through':_0x88f9('0x131')});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x51')],{'as':_0x88f9('0x11e'),'through':_0x88f9('0x132')});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x11a')],{'as':_0x88f9('0x11b'),'through':_0x88f9('0x133')});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x100')],{'as':_0x88f9('0x122'),'through':'user_has_whatsapp_interactions'});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x1b')],{'as':_0x88f9('0x134'),'through':'UserVoiceQueue','required':![]});db['User']['belongsToMany'](db[_0x88f9('0xf5')],{'as':_0x88f9('0x135'),'through':'UserVoicePrefix','required':![]});db[_0x88f9('0x11')]['belongsToMany'](db[_0x88f9('0x3b')],{'as':_0x88f9('0x136'),'through':_0x88f9('0x2f'),'required':![]});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x68')],{'as':_0x88f9('0x137'),'through':_0x88f9('0x2d'),'required':![],'hooks':!![]});db[_0x88f9('0x11')][_0x88f9('0x128')](db['FaxQueue'],{'as':_0x88f9('0x138'),'through':_0x88f9('0x30'),'required':![]});db[_0x88f9('0x11')]['belongsToMany'](db[_0x88f9('0x55')],{'as':_0x88f9('0x139'),'through':'UserSmsQueue','required':![]});db[_0x88f9('0x11')]['belongsToMany'](db[_0x88f9('0x5d')],{'as':_0x88f9('0x13a'),'through':_0x88f9('0x33'),'required':![]});db['User']['belongsToMany'](db[_0x88f9('0x107')],{'as':_0x88f9('0x13b'),'through':_0x88f9('0x13c'),'required':![]});db[_0x88f9('0x11')][_0x88f9('0x128')](db['CmList'],{'through':_0x88f9('0x13d')});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x5f')],{'as':_0x88f9('0x13e'),'through':_0x88f9('0x13f')});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x140')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x39')],{'as':_0x88f9('0x141'),'through':'user_has_mail_accounts'});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x57')],{'as':_0x88f9('0x142'),'through':_0x88f9('0x143')});db[_0x88f9('0x11')]['belongsToMany'](db[_0x88f9('0x4e')],{'as':'SmsAccounts','through':_0x88f9('0x144')});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0x145')],{'as':_0x88f9('0x146'),'through':'user_has_whatsapp_accounts'});db[_0x88f9('0x11')][_0x88f9('0x128')](db[_0x88f9('0xda')],{'as':_0x88f9('0x147'),'through':_0x88f9('0x148')});db['VoiceChanSpy'][_0x88f9('0x114')](db['VoiceExtension'],{'as':_0x88f9('0x149'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x14a')});db['VoiceContext'][_0x88f9('0x114')](db[_0x88f9('0x18')],{'onDelete':_0x88f9('0x112')});db['VoiceExtension'][_0x88f9('0x114')](db[_0x88f9('0x18')],{'as':_0x88f9('0x14b'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x1a')][_0x88f9('0x128')](db[_0x88f9('0x85')],{'as':'Sounds','through':'moh_has_sounds'});db[_0x88f9('0x1b')][_0x88f9('0x114')](db['UserVoiceQueueRt'],{'as':_0x88f9('0x14c'),'foreignKey':_0x88f9('0x14d')});db[_0x88f9('0x1b')][_0x88f9('0x114')](db['CmHopper'],{'as':_0x88f9('0x14e'),'foreignKey':_0x88f9('0x14d')});db[_0x88f9('0x1b')][_0x88f9('0x114')](db[_0x88f9('0x14f')],{'as':_0x88f9('0x117'),'foreignKey':'VoiceQueueId'});db[_0x88f9('0x1b')][_0x88f9('0x114')](db['CmHopperHistory'],{'as':_0x88f9('0x150'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x88f9('0x119')],{'as':_0x88f9('0x119'),'foreignKey':'VoiceQueueId'});db[_0x88f9('0x1b')][_0x88f9('0x114')](db[_0x88f9('0x151')],{'as':_0x88f9('0x152'),'foreignKey':_0x88f9('0x14d')});db[_0x88f9('0x1b')][_0x88f9('0x114')](db[_0x88f9('0xd0')],{'as':_0x88f9('0x153'),'foreignKey':_0x88f9('0x14d')});db[_0x88f9('0x1b')]['belongsTo'](db['Trunk'],{'as':_0x88f9('0x29'),'foreignKey':_0x88f9('0x154')});db[_0x88f9('0x1b')]['belongsTo'](db['Trunk'],{'as':_0x88f9('0x155'),'foreignKey':_0x88f9('0x156')});db[_0x88f9('0x1b')][_0x88f9('0x125')](db[_0x88f9('0x7e')],{'as':_0x88f9('0x7e'),'foreignKey':_0x88f9('0x157')});db[_0x88f9('0x1b')][_0x88f9('0x125')](db[_0x88f9('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x88f9('0x158')});db[_0x88f9('0x1b')][_0x88f9('0x128')](db[_0x88f9('0xf3')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x88f9('0x128')](db['User'],{'as':_0x88f9('0x159'),'through':_0x88f9('0x15a')});db[_0x88f9('0x1b')][_0x88f9('0x128')](db['Team'],{'as':_0x88f9('0x15b'),'through':_0x88f9('0x10b')});db[_0x88f9('0x1b')][_0x88f9('0x128')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x15c'),'through':_0x88f9('0x15d')});db[_0x88f9('0x1d')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x11'),'foreignKey':_0x88f9('0x113')});db['ScreenRecording']['belongsTo'](db[_0x88f9('0x11')],{'as':'User','foreignKey':'UserId'});db[_0x88f9('0x1e')][_0x88f9('0x114')](db[_0x88f9('0x20')],{'as':_0x88f9('0x15e'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x15f'),'sourceKey':_0x88f9('0x160')});db[_0x88f9('0x20')][_0x88f9('0x125')](db[_0x88f9('0x1e')],{'foreignKey':_0x88f9('0x15f'),'targetKey':'mailbox'});db['VoiceCallReport'][_0x88f9('0x114')](db['VoiceQueueReport'],{'as':_0x88f9('0x161'),'foreignKey':_0x88f9('0x162'),'constraints':![]});db[_0x88f9('0x22')][_0x88f9('0x114')](db[_0x88f9('0x25')],{'as':_0x88f9('0x163'),'foreignKey':'uniqueid','constraints':![]});db[_0x88f9('0x22')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x11'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x22')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'as':_0x88f9('0x164'),'foreignKey':'ContactId'});db[_0x88f9('0x36')][_0x88f9('0x125')](db[_0x88f9('0x39')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x88f9('0x165')][_0x88f9('0x125')](db[_0x88f9('0x39')],{'as':_0x88f9('0x39'),'foreignKey':_0x88f9('0x166')});db[_0x88f9('0x39')][_0x88f9('0x111')](db[_0x88f9('0x36')],{'as':'Imap','onDelete':'cascade'});db[_0x88f9('0x39')][_0x88f9('0x111')](db[_0x88f9('0x165')],{'as':_0x88f9('0x167'),'onDelete':'cascade'});db[_0x88f9('0x39')][_0x88f9('0x114')](db[_0x88f9('0x7b')],{'as':_0x88f9('0x168'),'foreignKey':_0x88f9('0x166'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x39')]['hasMany'](db[_0x88f9('0x169')],{'as':_0x88f9('0x16a'),'foreignKey':_0x88f9('0x166')});db[_0x88f9('0x39')]['hasMany'](db[_0x88f9('0x16b')],{'as':_0x88f9('0x15e'),'foreignKey':_0x88f9('0x166')});db[_0x88f9('0x39')]['hasMany'](db['MailInteraction'],{'as':_0x88f9('0x16c')});db[_0x88f9('0x39')][_0x88f9('0x114')](db[_0x88f9('0x40')],{'as':_0x88f9('0x14b')});db[_0x88f9('0x39')][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db['MailAccount']['belongsTo'](db['Template'],{'as':_0x88f9('0x89'),'foreignKey':_0x88f9('0x16f')});db[_0x88f9('0x39')]['belongsTo'](db[_0x88f9('0x80')],{'as':_0x88f9('0x170'),'foreignKey':_0x88f9('0x158')});db[_0x88f9('0x39')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':_0x88f9('0x171')});db[_0x88f9('0x3b')]['belongsToMany'](db[_0x88f9('0x11')],{'as':'Agents','through':'UserMailQueue'});db[_0x88f9('0x3b')][_0x88f9('0x128')](db[_0x88f9('0xde')],{'through':_0x88f9('0x172'),'as':_0x88f9('0x15b')});db[_0x88f9('0x3e')][_0x88f9('0x114')](db[_0x88f9('0x16b')],{'as':_0x88f9('0x15e'),'onDelete':_0x88f9('0x112'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x88f9('0x125')](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db[_0x88f9('0x3e')][_0x88f9('0x125')](db['CmContact'],{'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x3e')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x174'),'foreignKey':'UserId'});db[_0x88f9('0x3e')][_0x88f9('0x128')](db['Tag'],{'through':_0x88f9('0x175'),'as':'Tags'});db[_0x88f9('0x3e')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x175'),'as':_0x88f9('0x176')});db[_0x88f9('0x3e')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x177'),'through':_0x88f9('0x12f'),'foreignKey':'MailInteractionId'});db[_0x88f9('0x16b')][_0x88f9('0x114')](db[_0x88f9('0xe6')],{'as':_0x88f9('0x178'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x16b')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':'User'});db[_0x88f9('0x16b')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'onDelete':'cascade','as':_0x88f9('0x164')});db['MailMessage'][_0x88f9('0x125')](db[_0x88f9('0x3e')],{'as':_0x88f9('0x179'),'foreignKey':'MailInteractionId'});db[_0x88f9('0x16b')][_0x88f9('0x125')](db[_0x88f9('0x39')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x166')});db['MailMessage'][_0x88f9('0x125')](db[_0x88f9('0x5f')],{'as':_0x88f9('0x5f'),'foreignKey':_0x88f9('0x17b')});db[_0x88f9('0x16b')][_0x88f9('0x125')](db['ChatOfflineMessage'],{'as':_0x88f9('0x66'),'foreignKey':_0x88f9('0x17c')});db[_0x88f9('0x40')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x88f9('0x40')][_0x88f9('0x125')](db['MailQueue'],{'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x40')][_0x88f9('0x125')](db['MailAccount'],{'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x40')][_0x88f9('0x125')](db[_0x88f9('0x7e')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x88f9('0x40')]['belongsTo'](db[_0x88f9('0x87')],{'onDelete':_0x88f9('0x17d'),'foreignKey':_0x88f9('0x17e')});db[_0x88f9('0x42')][_0x88f9('0x125')](db[_0x88f9('0x39')],{});db[_0x88f9('0x42')][_0x88f9('0x125')](db['CmList'],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x42')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'as':'Contact','foreignKey':_0x88f9('0x173')});db[_0x88f9('0x42')][_0x88f9('0x125')](db[_0x88f9('0x3e')],{});db[_0x88f9('0x42')][_0x88f9('0x125')](db['MailMessage'],{});db[_0x88f9('0x42')][_0x88f9('0x125')](db[_0x88f9('0x11')],{});db[_0x88f9('0x42')][_0x88f9('0x125')](db[_0x88f9('0x3b')],{});db[_0x88f9('0x44')]['hasMany'](db[_0x88f9('0x17f')],{'as':_0x88f9('0x180'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x140')][_0x88f9('0x114')](db[_0x88f9('0x7b')],{'as':_0x88f9('0x168'),'foreignKey':_0x88f9('0x181'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x140')][_0x88f9('0x114')](db[_0x88f9('0x169')],{'as':_0x88f9('0x16a'),'foreignKey':_0x88f9('0x181')});db[_0x88f9('0x140')][_0x88f9('0x114')](db[_0x88f9('0x11f')],{'as':_0x88f9('0x16c')});db['FaxAccount']['hasMany'](db['FaxApplication'],{'as':'Applications'});db[_0x88f9('0x140')][_0x88f9('0x114')](db['VoiceExtension'],{'as':_0x88f9('0x182'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x140')][_0x88f9('0x114')](db['FaxMessage'],{'as':_0x88f9('0x15e')});db[_0x88f9('0x140')][_0x88f9('0x125')](db[_0x88f9('0x29')],{'as':'Trunk'});db[_0x88f9('0x140')]['belongsTo'](db[_0x88f9('0xf3')],{'as':'List','foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x140')]['belongsTo'](db[_0x88f9('0x80')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x88f9('0x140')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':'Agents','through':_0x88f9('0x183')});db[_0x88f9('0x47')][_0x88f9('0x125')](db['User'],{'onDelete':_0x88f9('0x17d')});db['FaxApplication']['belongsTo'](db[_0x88f9('0x4b')],{'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x47')][_0x88f9('0x125')](db['FaxAccount'],{'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x47')][_0x88f9('0x125')](db[_0x88f9('0x87')],{'onDelete':_0x88f9('0x17d'),'foreignKey':'TagId'});db[_0x88f9('0x11f')][_0x88f9('0x114')](db[_0x88f9('0x4a')],{'as':_0x88f9('0x15e'),'onDelete':_0x88f9('0x112'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x88f9('0x125')](db['FaxAccount'],{'as':_0x88f9('0x17a'),'foreignKey':'FaxAccountId'});db[_0x88f9('0x11f')][_0x88f9('0x125')](db['CmContact'],{'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x11f')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x174'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11f')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x184'),'as':'Tags'});db[_0x88f9('0x11f')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':'fax_interaction_has_tags','as':_0x88f9('0x176')});db[_0x88f9('0x11f')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':'Users','through':_0x88f9('0x131'),'foreignKey':'FaxInteractionId'});db[_0x88f9('0x4a')]['belongsTo'](db['User'],{'onDelete':'cascade','as':'User'});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x88f9('0x185')});db[_0x88f9('0x4a')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'onDelete':'cascade','as':'Contact'});db[_0x88f9('0x4a')]['belongsTo'](db[_0x88f9('0xe6')],{'as':'Attachment','foreignKey':_0x88f9('0x186')});db['FaxMessage'][_0x88f9('0x125')](db[_0x88f9('0x140')],{'as':_0x88f9('0x17a'),'foreignKey':'FaxAccountId'});db[_0x88f9('0x4b')][_0x88f9('0x128')](db['User'],{'as':'Agents','through':_0x88f9('0x30')});db[_0x88f9('0x4b')][_0x88f9('0x128')](db[_0x88f9('0xde')],{'through':_0x88f9('0x187'),'as':_0x88f9('0x15b')});db['FaxQueueReport'][_0x88f9('0x125')](db[_0x88f9('0x140')],{});db[_0x88f9('0x4c')][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x4c')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x4c')][_0x88f9('0x125')](db['FaxInteraction'],{});db[_0x88f9('0x4c')][_0x88f9('0x125')](db[_0x88f9('0x4a')],{});db[_0x88f9('0x4c')]['belongsTo'](db[_0x88f9('0x11')],{});db[_0x88f9('0x4c')][_0x88f9('0x125')](db[_0x88f9('0x4b')],{});db[_0x88f9('0x4e')][_0x88f9('0x114')](db[_0x88f9('0x7b')],{'as':_0x88f9('0x168'),'foreignKey':_0x88f9('0x188'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x4e')][_0x88f9('0x114')](db[_0x88f9('0x169')],{'as':_0x88f9('0x16a'),'foreignKey':_0x88f9('0x188')});db[_0x88f9('0x4e')][_0x88f9('0x114')](db[_0x88f9('0x53')],{'as':_0x88f9('0x15e'),'foreignKey':_0x88f9('0x188')});db[_0x88f9('0x4e')][_0x88f9('0x114')](db[_0x88f9('0x51')],{'as':_0x88f9('0x16c')});db[_0x88f9('0x4e')][_0x88f9('0x114')](db['SmsApplication'],{'as':_0x88f9('0x14b')});db[_0x88f9('0x4e')][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x4e')][_0x88f9('0x125')](db[_0x88f9('0x80')],{'as':_0x88f9('0x170'),'foreignKey':_0x88f9('0x158')});db[_0x88f9('0x4e')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':'user_has_sms_accounts'});db[_0x88f9('0x4f')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x4f')]['belongsTo'](db[_0x88f9('0x55')],{'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x4f')]['belongsTo'](db[_0x88f9('0x4e')],{'onDelete':'restrict'});db[_0x88f9('0x4f')][_0x88f9('0x125')](db[_0x88f9('0x7e')],{'onDelete':_0x88f9('0x17d'),'foreignKey':'IntervalId'});db[_0x88f9('0x4f')]['belongsTo'](db[_0x88f9('0x87')],{'onDelete':'restrict','foreignKey':_0x88f9('0x17e')});db[_0x88f9('0x51')][_0x88f9('0x114')](db[_0x88f9('0x53')],{'as':_0x88f9('0x15e'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x189')});db['SmsInteraction'][_0x88f9('0x125')](db[_0x88f9('0x4e')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x188')});db['SmsInteraction'][_0x88f9('0x125')](db[_0x88f9('0x70')],{'as':_0x88f9('0x164'),'foreignKey':'ContactId'});db[_0x88f9('0x51')][_0x88f9('0x125')](db['User'],{'as':_0x88f9('0x174'),'foreignKey':_0x88f9('0x113')});db['SmsInteraction']['belongsToMany'](db[_0x88f9('0x87')],{'through':_0x88f9('0x18a'),'as':_0x88f9('0x18b')});db[_0x88f9('0x51')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x18a'),'as':'ThroughTags'});db[_0x88f9('0x51')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x177'),'through':_0x88f9('0x132'),'foreignKey':_0x88f9('0x189')});db[_0x88f9('0x53')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x11')});db[_0x88f9('0x53')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'onDelete':'cascade','as':_0x88f9('0x164')});db[_0x88f9('0x53')][_0x88f9('0x125')](db['SmsInteraction'],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x179'),'foreignKey':_0x88f9('0x189')});db[_0x88f9('0x53')][_0x88f9('0x125')](db[_0x88f9('0x4e')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x188')});db[_0x88f9('0x55')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':_0x88f9('0x18c'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x88f9('0x128')](db[_0x88f9('0xde')],{'through':'team_has_sms_queues','as':_0x88f9('0x15b')});db['OpenchannelAccount'][_0x88f9('0x114')](db[_0x88f9('0x7b')],{'as':_0x88f9('0x168'),'foreignKey':_0x88f9('0x18d'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x57')][_0x88f9('0x114')](db[_0x88f9('0x169')],{'as':_0x88f9('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x88f9('0x11a')],{'as':_0x88f9('0x16c'),'foreignKey':_0x88f9('0x18d')});db[_0x88f9('0x57')][_0x88f9('0x114')](db[_0x88f9('0x18e')],{'as':_0x88f9('0x15e'),'foreignKey':_0x88f9('0x18d')});db[_0x88f9('0x57')]['hasMany'](db[_0x88f9('0x59')],{'as':_0x88f9('0x14b'),'foreignKey':'OpenchannelAccountId'});db[_0x88f9('0x57')][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x88f9('0x125')](db[_0x88f9('0x80')],{'as':_0x88f9('0x170'),'foreignKey':_0x88f9('0x158')});db[_0x88f9('0x57')][_0x88f9('0x128')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x88f9('0x59')][_0x88f9('0x125')](db['User'],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x88f9('0x125')](db[_0x88f9('0x5d')],{'onDelete':'restrict','foreignKey':_0x88f9('0x18f')});db['OpenchannelApplication'][_0x88f9('0x125')](db[_0x88f9('0x57')],{'onDelete':'restrict','foreignKey':_0x88f9('0x18d')});db[_0x88f9('0x59')][_0x88f9('0x125')](db[_0x88f9('0x7e')],{'onDelete':_0x88f9('0x17d'),'foreignKey':_0x88f9('0x157')});db[_0x88f9('0x59')]['belongsTo'](db[_0x88f9('0x87')],{'onDelete':_0x88f9('0x17d'),'foreignKey':'TagId'});db[_0x88f9('0x11a')]['hasMany'](db[_0x88f9('0x18e')],{'as':_0x88f9('0x15e'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x190')});db[_0x88f9('0x11a')][_0x88f9('0x125')](db[_0x88f9('0x57')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x18d')});db['OpenchannelInteraction'][_0x88f9('0x125')](db['CmContact'],{'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x11a')][_0x88f9('0x125')](db['User'],{'as':_0x88f9('0x174'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11a')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x191'),'as':'Tags'});db['OpenchannelInteraction'][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x191'),'as':'ThroughTags'});db[_0x88f9('0x11a')]['belongsToMany'](db['User'],{'as':_0x88f9('0x177'),'through':_0x88f9('0x133'),'foreignKey':_0x88f9('0x190')});db[_0x88f9('0x18e')]['belongsTo'](db[_0x88f9('0x11')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x11')});db['OpenchannelMessage'][_0x88f9('0x125')](db[_0x88f9('0x70')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x164')});db[_0x88f9('0x18e')][_0x88f9('0x125')](db[_0x88f9('0x11a')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x179'),'foreignKey':_0x88f9('0x190')});db[_0x88f9('0x18e')]['belongsTo'](db[_0x88f9('0xe6')],{'as':'Attachment','foreignKey':_0x88f9('0x186')});db[_0x88f9('0x18e')][_0x88f9('0x125')](db[_0x88f9('0x57')],{'as':'Account','foreignKey':_0x88f9('0x18d')});db['OpenchannelQueue'][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':'UserOpenchannelQueue','foreignKey':_0x88f9('0x18f')});db['OpenchannelQueue'][_0x88f9('0x128')](db[_0x88f9('0xde')],{'through':'team_has_openchannel_queues','as':_0x88f9('0x15b')});db[_0x88f9('0x5f')]['hasMany'](db[_0x88f9('0x7b')],{'as':_0x88f9('0x168'),'foreignKey':_0x88f9('0x17b'),'onDelete':_0x88f9('0x112')});db['ChatWebsite']['hasMany'](db[_0x88f9('0x169')],{'as':_0x88f9('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0x88f9('0x5f')][_0x88f9('0x114')](db[_0x88f9('0x6c')],{'as':_0x88f9('0x192')});db[_0x88f9('0x5f')]['hasMany'](db['ChatInteraction'],{'as':_0x88f9('0x16c')});db[_0x88f9('0x5f')][_0x88f9('0x114')](db['ChatApplication'],{'as':'Applications'});db[_0x88f9('0x5f')][_0x88f9('0x114')](db[_0x88f9('0x193')],{'as':'Messages'});db[_0x88f9('0x5f')][_0x88f9('0x125')](db['CmList'],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x5f')]['belongsTo'](db[_0x88f9('0x7e')],{'as':_0x88f9('0x7e'),'foreignKey':_0x88f9('0x157')});db[_0x88f9('0x5f')]['belongsTo'](db[_0x88f9('0x39')],{'as':_0x88f9('0x39'),'foreignKey':_0x88f9('0x166')});db[_0x88f9('0x5f')]['belongsTo'](db[_0x88f9('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x88f9('0x158')});db[_0x88f9('0x5f')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':_0x88f9('0x13f')});db[_0x88f9('0x194')][_0x88f9('0x125')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x194')]['belongsTo'](db[_0x88f9('0x70')],{'as':'Contact','foreignKey':_0x88f9('0x173')});db[_0x88f9('0x194')][_0x88f9('0x125')](db['OpenchannelInteraction'],{});db[_0x88f9('0x194')]['belongsTo'](db[_0x88f9('0x18e')],{});db[_0x88f9('0x194')][_0x88f9('0x125')](db[_0x88f9('0x11')],{});db[_0x88f9('0x194')][_0x88f9('0x125')](db[_0x88f9('0x5d')],{});db[_0x88f9('0x62')][_0x88f9('0x125')](db['User'],{'as':_0x88f9('0x195'),'foreignKey':'UserId','onDelete':_0x88f9('0x17d')});db[_0x88f9('0x62')][_0x88f9('0x125')](db['ChatQueue'],{'as':'Queue','foreignKey':_0x88f9('0x196'),'onDelete':'restrict'});db['ChatApplication'][_0x88f9('0x125')](db[_0x88f9('0x5f')],{'as':_0x88f9('0x197'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x88f9('0x62')]['belongsTo'](db[_0x88f9('0x87')],{'onDelete':_0x88f9('0x17d'),'foreignKey':_0x88f9('0x17e')});db['ChatInteraction'][_0x88f9('0x114')](db[_0x88f9('0x193')],{'as':_0x88f9('0x15e'),'onDelete':_0x88f9('0x112'),'foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0x88f9('0x125')](db[_0x88f9('0x5f')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x17b')});db[_0x88f9('0x11c')][_0x88f9('0x125')](db['CmContact'],{'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x11c')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x174'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x11c')]['belongsToMany'](db[_0x88f9('0x87')],{'through':_0x88f9('0x198'),'as':_0x88f9('0x18b')});db[_0x88f9('0x11c')]['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x88f9('0x176')});db[_0x88f9('0x11c')]['belongsToMany'](db['User'],{'as':_0x88f9('0x177'),'through':_0x88f9('0x130'),'foreignKey':_0x88f9('0x199')});db[_0x88f9('0x193')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x11')});db[_0x88f9('0x193')]['belongsTo'](db['CmContact'],{'onDelete':_0x88f9('0x112'),'as':'Contact','foreignKey':_0x88f9('0x173')});db[_0x88f9('0x193')][_0x88f9('0x125')](db[_0x88f9('0x11c')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x179'),'foreignKey':'ChatInteractionId'});db[_0x88f9('0x193')][_0x88f9('0x125')](db[_0x88f9('0xe6')],{'as':_0x88f9('0xe6'),'foreignKey':'AttachmentId'});db[_0x88f9('0x193')][_0x88f9('0x125')](db[_0x88f9('0x5f')],{'as':_0x88f9('0x17a'),'foreignKey':'ChatWebsiteId'});db[_0x88f9('0x66')][_0x88f9('0x114')](db[_0x88f9('0xe6')],{'as':_0x88f9('0x178'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x88f9('0x112'),'hooks':!![]});db[_0x88f9('0x66')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x66')][_0x88f9('0x125')](db['ChatWebsite'],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x17b')});db[_0x88f9('0x68')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':_0x88f9('0x2d'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x88f9('0xde')],{'through':'team_has_chat_queues','as':'Teams'});db[_0x88f9('0x6a')][_0x88f9('0x114')](db['ChatInternalMessage'],{'as':_0x88f9('0x15e'),'foreignKey':'ChatGroupId','onDelete':_0x88f9('0x112')});db[_0x88f9('0x6a')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':'Members','through':_0x88f9('0x12a')});db[_0x88f9('0x6c')][_0x88f9('0x125')](db[_0x88f9('0x5f')],{'as':'Website','foreignKey':_0x88f9('0x17b')});db[_0x88f9('0x6e')]['hasMany'](db[_0x88f9('0x70')],{'as':_0x88f9('0x12b'),'foreignKey':_0x88f9('0x19a')});db[_0x88f9('0x70')]['hasMany'](db['CmHopper'],{'as':_0x88f9('0x14e'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x70')][_0x88f9('0x114')](db['CmHopperFinal'],{'as':_0x88f9('0x117'),'foreignKey':_0x88f9('0x173')});db['CmContact'][_0x88f9('0x114')](db[_0x88f9('0x74')],{'as':_0x88f9('0x150'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x70')][_0x88f9('0x114')](db[_0x88f9('0x119')],{'as':_0x88f9('0x119'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x70')]['hasMany'](db[_0x88f9('0xd0')],{'as':_0x88f9('0x153'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x70')]['hasMany'](db[_0x88f9('0x11a')],{'as':_0x88f9('0x11b'),'foreignKey':'ContactId','onDelete':_0x88f9('0x17d')});db[_0x88f9('0x70')]['hasMany'](db[_0x88f9('0x11c')],{'as':_0x88f9('0x11d'),'foreignKey':_0x88f9('0x173'),'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x70')][_0x88f9('0x114')](db[_0x88f9('0x51')],{'as':'SmsInteractions','foreignKey':_0x88f9('0x173'),'onDelete':'restrict'});db['CmContact'][_0x88f9('0x114')](db[_0x88f9('0x11f')],{'as':_0x88f9('0x120'),'foreignKey':_0x88f9('0x173'),'onDelete':'restrict'});db[_0x88f9('0x70')]['hasMany'](db[_0x88f9('0x3e')],{'as':_0x88f9('0x121'),'foreignKey':'ContactId','onDelete':_0x88f9('0x17d')});db['CmContact'][_0x88f9('0x125')](db['CmCompany'],{'as':'Company','foreignKey':_0x88f9('0x19a')});db['CmContact']['belongsTo'](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':'ListId','onDelete':_0x88f9('0x112')});db[_0x88f9('0x70')][_0x88f9('0x128')](db['User'],{'as':_0x88f9('0x177'),'through':_0x88f9('0x12c')});db[_0x88f9('0x70')][_0x88f9('0x128')](db['Tag'],{'as':_0x88f9('0x18b'),'through':'cm_contact_has_tags'});db[_0x88f9('0x70')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x19b'),'as':_0x88f9('0x176')});db[_0x88f9('0x72')]['belongsTo'](db[_0x88f9('0x70')],{'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x72')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x88f9('0x16e'),'onDelete':'cascade'});db[_0x88f9('0x72')][_0x88f9('0x125')](db['User'],{'as':_0x88f9('0x195'),'foreignKey':_0x88f9('0x113')});db[_0x88f9('0x72')]['belongsTo'](db[_0x88f9('0x1b')],{'as':_0x88f9('0x19c'),'foreignKey':'VoiceQueueId','onDelete':_0x88f9('0x112')});db[_0x88f9('0x72')][_0x88f9('0x125')](db[_0x88f9('0xe2')],{'as':_0x88f9('0xe2'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x88f9('0x72')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x174'),'foreignKey':_0x88f9('0x19d')});db[_0x88f9('0x151')][_0x88f9('0x125')](db['CmContact'],{'as':'Contact','foreignKey':_0x88f9('0x173'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x151')]['belongsTo'](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e'),'onDelete':_0x88f9('0x112')});db['CmHopperBlack'][_0x88f9('0x125')](db[_0x88f9('0x1b')],{'as':_0x88f9('0x19c'),'foreignKey':'VoiceQueueId','onDelete':_0x88f9('0x112')});db['CmHopperBlack'][_0x88f9('0x125')](db[_0x88f9('0xe2')],{'as':_0x88f9('0xe2'),'foreignKey':_0x88f9('0x19e'),'onDelete':'cascade'});db[_0x88f9('0x19f')][_0x88f9('0x114')](db[_0x88f9('0x1a0')],{'as':{'plural':_0x88f9('0x1a1'),'singular':_0x88f9('0x1a2')},'foreignKey':_0x88f9('0x1a3'),'onDelete':_0x88f9('0x112'),'hooks':!![]});db[_0x88f9('0x19f')][_0x88f9('0x114')](db[_0x88f9('0x1a0')],{'as':{'plural':_0x88f9('0x1a4'),'singular':_0x88f9('0x1a5')},'foreignKey':_0x88f9('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0x88f9('0x19f')][_0x88f9('0x114')](db[_0x88f9('0x77')],{'as':_0x88f9('0x1a7'),'foreignKey':_0x88f9('0x1a8'),'onDelete':_0x88f9('0x112'),'hooks':!![]});db[_0x88f9('0x7b')][_0x88f9('0x114')](db['Disposition'],{'as':_0x88f9('0x168'),'foreignKey':_0x88f9('0x1a9'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x7e')][_0x88f9('0x114')](db['Interval'],{'as':_0x88f9('0x1aa'),'foreignKey':_0x88f9('0x157'),'onDelete':_0x88f9('0x112'),'hooks':!![],'required':![]});db[_0x88f9('0x7e')][_0x88f9('0x114')](db[_0x88f9('0x18')],{'as':_0x88f9('0x1ab'),'foreignKey':_0x88f9('0x157'),'onDelete':_0x88f9('0x17d')});db[_0x88f9('0x7e')][_0x88f9('0x114')](db[_0x88f9('0x40')],{'as':'MailApplications','foreignKey':_0x88f9('0x157')});db[_0x88f9('0x7e')][_0x88f9('0x114')](db['ChatApplication'],{'as':_0x88f9('0x1ac'),'foreignKey':_0x88f9('0x157')});db[_0x88f9('0x7e')][_0x88f9('0x114')](db[_0x88f9('0x47')],{'as':_0x88f9('0x1ad'),'foreignKey':_0x88f9('0x157')});db['Interval'][_0x88f9('0x114')](db[_0x88f9('0x4f')],{'as':_0x88f9('0x1ae'),'foreignKey':_0x88f9('0x157')});db['Schedule'][_0x88f9('0x125')](db['MailAccount'],{});db['Schedule']['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0x88f9('0x83')][_0x88f9('0x125')](db[_0x88f9('0x91')],{'foreignKey':'CustomReportId'});db['Sound'][_0x88f9('0x128')](db[_0x88f9('0x1a')],{'as':'Mohs','through':_0x88f9('0x1af'),'onDelete':_0x88f9('0x17d')});db['Tag'][_0x88f9('0x128')](db[_0x88f9('0x70')],{'through':_0x88f9('0x19b')});db['Tag'][_0x88f9('0x128')](db[_0x88f9('0x11c')],{'through':'chat_interaction_has_tags'});db[_0x88f9('0x87')][_0x88f9('0x128')](db[_0x88f9('0x3e')],{'through':_0x88f9('0x175')});db[_0x88f9('0x87')]['belongsToMany'](db[_0x88f9('0x51')],{'through':_0x88f9('0x18a')});db[_0x88f9('0x87')][_0x88f9('0x128')](db['FaxInteraction'],{'through':_0x88f9('0x184')});db[_0x88f9('0x87')]['belongsToMany'](db[_0x88f9('0x11a')],{'through':'openchannel_interaction_has_tags'});db[_0x88f9('0x87')][_0x88f9('0x128')](db[_0x88f9('0x100')],{'through':_0x88f9('0x1b0')});db[_0x88f9('0x8a')][_0x88f9('0x114')](db['Condition'],{'as':{'plural':_0x88f9('0x1b1'),'singular':_0x88f9('0x1b2')},'foreignKey':'TriggerAllId','onDelete':_0x88f9('0x112'),'hooks':!![]});db[_0x88f9('0x8a')][_0x88f9('0x114')](db['Condition'],{'as':{'plural':_0x88f9('0x1b3'),'singular':_0x88f9('0x1b4')},'foreignKey':_0x88f9('0x1b5'),'onDelete':_0x88f9('0x112'),'hooks':!![]});db[_0x88f9('0x8a')][_0x88f9('0x114')](db[_0x88f9('0x77')],{'as':_0x88f9('0x1a7'),'foreignKey':_0x88f9('0x1b6'),'onDelete':'cascade','hooks':!![]});db[_0x88f9('0x91')][_0x88f9('0x114')](db[_0x88f9('0x98')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1b8'),'hooks':!![]});db[_0x88f9('0x93')]['hasMany'](db[_0x88f9('0x98')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1b9')});db['AnalyticMetric'][_0x88f9('0x114')](db[_0x88f9('0x98')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1ba')});db[_0x88f9('0x98')][_0x88f9('0x125')](db[_0x88f9('0x96')],{'foreignKey':_0x88f9('0x1ba')});db[_0x88f9('0x9b')][_0x88f9('0x114')](db[_0x88f9('0x9c')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x88f9('0x114')](db['SalesforceField'],{'as':_0x88f9('0x1bc'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0x9c')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x88f9('0x1be')});db[_0x88f9('0x9c')][_0x88f9('0x114')](db[_0x88f9('0x9d')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0x9c')][_0x88f9('0x125')](db[_0x88f9('0x9b')],{'as':'Account','foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0x9d')][_0x88f9('0x114')](db[_0x88f9('0x9d')],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0x9d')][_0x88f9('0x114')](db['SalesforceField'],{'as':_0x88f9('0x1c2'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x88f9('0x114')](db[_0x88f9('0x9d')],{'as':'Field','foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0x9d')][_0x88f9('0x125')](db[_0x88f9('0x8c')],{'as':_0x88f9('0x8c'),'foreignKey':_0x88f9('0x1c3')});db['SugarcrmAccount'][_0x88f9('0x114')](db[_0x88f9('0xa0')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xa0')][_0x88f9('0x114')](db[_0x88f9('0x1c4')],{'as':_0x88f9('0x1bc'),'onDelete':_0x88f9('0x112'),'foreignKey':'SubjectId'});db[_0x88f9('0xa0')][_0x88f9('0x114')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xa0')][_0x88f9('0x114')](db[_0x88f9('0x1c4')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xa0')]['belongsTo'](db[_0x88f9('0x1c5')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x1c0')});db['SugarcrmField'][_0x88f9('0x114')](db[_0x88f9('0x1c4')],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0x1c4')][_0x88f9('0x114')](db[_0x88f9('0x1c4')],{'as':'Description','foreignKey':_0x88f9('0x1be')});db[_0x88f9('0x1c4')][_0x88f9('0x114')](db[_0x88f9('0x1c4')],{'as':'Field','foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0x1c4')]['belongsTo'](db[_0x88f9('0x8c')],{'as':_0x88f9('0x8c'),'foreignKey':'VariableId'});db[_0x88f9('0x1c6')][_0x88f9('0x114')](db[_0x88f9('0xa4')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xa4')]['hasMany'](db[_0x88f9('0x1c7')],{'as':'Subjects','onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0xa4')]['hasMany'](db[_0x88f9('0x1c7')],{'as':_0x88f9('0x1c8'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xa4')]['hasMany'](db['DeskField'],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':'FieldId'});db[_0x88f9('0xa4')][_0x88f9('0x125')](db[_0x88f9('0x1c6')],{'as':'Account','foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xa4')]['belongsToMany'](db['Tag'],{'through':_0x88f9('0x1c9')});db[_0x88f9('0x1c7')][_0x88f9('0x114')](db['DeskField'],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0x1c7')][_0x88f9('0x114')](db[_0x88f9('0x1c7')],{'as':_0x88f9('0x1c2'),'foreignKey':'DescriptionId'});db[_0x88f9('0x1c7')][_0x88f9('0x114')](db[_0x88f9('0x1c7')],{'as':_0x88f9('0x1ca'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0x1c7')]['belongsTo'](db[_0x88f9('0x8c')],{'as':_0x88f9('0x8c'),'foreignKey':_0x88f9('0x1c3')});db[_0x88f9('0x1cb')][_0x88f9('0x114')](db[_0x88f9('0xa8')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xa8')][_0x88f9('0x114')](db['ZohoField'],{'as':_0x88f9('0x1bc'),'onDelete':_0x88f9('0x112'),'foreignKey':'SubjectId'});db[_0x88f9('0xa8')][_0x88f9('0x114')](db[_0x88f9('0xa9')],{'as':_0x88f9('0x1c8'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xa8')][_0x88f9('0x114')](db[_0x88f9('0xa9')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xa8')][_0x88f9('0x125')](db['ZohoAccount'],{'as':'Account','foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xa9')]['hasMany'](db[_0x88f9('0xa9')],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0xa9')]['hasMany'](db[_0x88f9('0xa9')],{'as':_0x88f9('0x1c2'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xa9')][_0x88f9('0x114')](db[_0x88f9('0xa9')],{'as':'Field','foreignKey':'FieldId'});db[_0x88f9('0xa9')][_0x88f9('0x125')](db[_0x88f9('0x8c')],{'as':_0x88f9('0x8c'),'foreignKey':_0x88f9('0x1c3')});db[_0x88f9('0x1cc')][_0x88f9('0x114')](db['ZendeskConfiguration'],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':'AccountId'});db[_0x88f9('0x1cd')][_0x88f9('0x114')](db[_0x88f9('0xac')],{'as':_0x88f9('0x1bc'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x88f9('0x114')](db[_0x88f9('0xac')],{'as':_0x88f9('0x1c8'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0x1cd')][_0x88f9('0x114')](db['ZendeskField'],{'as':'Fields','foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0x1cd')][_0x88f9('0x125')](db['ZendeskAccount'],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0x1cd')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x1ce')});db[_0x88f9('0xac')][_0x88f9('0x114')](db[_0x88f9('0xac')],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0xac')]['hasMany'](db[_0x88f9('0xac')],{'as':_0x88f9('0x1c2'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xac')]['hasMany'](db['ZendeskField'],{'as':_0x88f9('0x1ca'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xac')][_0x88f9('0x125')](db[_0x88f9('0x8c')],{'as':_0x88f9('0x8c'),'foreignKey':_0x88f9('0x1c3')});db[_0x88f9('0xae')][_0x88f9('0x114')](db[_0x88f9('0xb0')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xb0')][_0x88f9('0x114')](db[_0x88f9('0xb1')],{'as':_0x88f9('0x1bc'),'onDelete':_0x88f9('0x112'),'foreignKey':'SubjectId'});db[_0x88f9('0xb0')][_0x88f9('0x114')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1be')});db['FreshdeskConfiguration'][_0x88f9('0x114')](db[_0x88f9('0xb1')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':'FieldId'});db[_0x88f9('0xb0')][_0x88f9('0x125')](db[_0x88f9('0xae')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xb0')][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x1cf')});db[_0x88f9('0xb1')][_0x88f9('0x114')](db[_0x88f9('0xb1')],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0xb1')]['hasMany'](db[_0x88f9('0xb1')],{'as':_0x88f9('0x1c2'),'foreignKey':'DescriptionId'});db[_0x88f9('0xb1')][_0x88f9('0x114')](db[_0x88f9('0xb1')],{'as':_0x88f9('0x1ca'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xb1')][_0x88f9('0x125')](db[_0x88f9('0x8c')],{'as':'Variable','foreignKey':_0x88f9('0x1c3')});db[_0x88f9('0xb2')]['hasMany'](db[_0x88f9('0x1d0')],{'as':'Configurations','onDelete':_0x88f9('0x112'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0x88f9('0x114')](db[_0x88f9('0xb5')],{'as':_0x88f9('0x1bc'),'foreignKey':_0x88f9('0x1bd')});db['VtigerConfiguration']['hasMany'](db[_0x88f9('0xb5')],{'as':_0x88f9('0x1c8'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0x1d0')][_0x88f9('0x114')](db[_0x88f9('0xb5')],{'as':_0x88f9('0x1b7'),'foreignKey':'FieldId'});db[_0x88f9('0x1d0')][_0x88f9('0x125')](db[_0x88f9('0xb2')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xb5')][_0x88f9('0x114')](db['VtigerField'],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0xb5')][_0x88f9('0x114')](db['VtigerField'],{'as':_0x88f9('0x1c2'),'foreignKey':_0x88f9('0x1be')});db['VtigerField'][_0x88f9('0x114')](db[_0x88f9('0xb5')],{'as':'Field','foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xb5')][_0x88f9('0x125')](db['Variable'],{'as':_0x88f9('0x8c'),'foreignKey':'VariableId'});db[_0x88f9('0xb7')][_0x88f9('0x114')](db[_0x88f9('0xb9')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':'AccountId'});db[_0x88f9('0xb9')][_0x88f9('0x114')](db['ServicenowField'],{'as':_0x88f9('0x1bc'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0xb9')][_0x88f9('0x114')](db[_0x88f9('0xbb')],{'as':_0x88f9('0x1c8'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xb9')][_0x88f9('0x114')](db[_0x88f9('0xbb')],{'as':_0x88f9('0x1b7'),'foreignKey':_0x88f9('0x1bf')});db['ServicenowConfiguration']['belongsTo'](db[_0x88f9('0xb7')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xbb')][_0x88f9('0x114')](db[_0x88f9('0xbb')],{'as':_0x88f9('0x1c1'),'foreignKey':_0x88f9('0x1bd')});db[_0x88f9('0xbb')][_0x88f9('0x114')](db[_0x88f9('0xbb')],{'as':_0x88f9('0x1c2'),'foreignKey':'DescriptionId'});db[_0x88f9('0xbb')][_0x88f9('0x114')](db[_0x88f9('0xbb')],{'as':'Field','foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xbb')][_0x88f9('0x125')](db['Variable'],{'as':_0x88f9('0x8c'),'foreignKey':_0x88f9('0x1c3')});db[_0x88f9('0xbc')][_0x88f9('0x114')](db[_0x88f9('0xbe')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xbe')][_0x88f9('0x114')](db[_0x88f9('0xbf')],{'as':_0x88f9('0x1bc'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1bd')});db['Dynamics365Configuration'][_0x88f9('0x114')](db[_0x88f9('0xbf')],{'as':_0x88f9('0x1c8'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xbe')][_0x88f9('0x114')](db[_0x88f9('0xbf')],{'as':_0x88f9('0x1b7'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xbe')][_0x88f9('0x125')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xbf')][_0x88f9('0x114')](db[_0x88f9('0xbf')],{'as':_0x88f9('0x1c1'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0x88f9('0x114')](db[_0x88f9('0xbf')],{'as':'Description','foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xbf')][_0x88f9('0x114')](db[_0x88f9('0xbf')],{'as':_0x88f9('0x1ca'),'foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xbf')][_0x88f9('0x125')](db[_0x88f9('0x8c')],{'as':'Variable','foreignKey':'VariableId'});db[_0x88f9('0xc1')][_0x88f9('0x114')](db[_0x88f9('0xc2')],{'as':_0x88f9('0x1bb'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1c0')});db[_0x88f9('0xc2')][_0x88f9('0x114')](db['FreshsalesField'],{'as':_0x88f9('0x1bc'),'foreignKey':_0x88f9('0x1bd')});db['FreshsalesConfiguration']['hasMany'](db[_0x88f9('0xc4')],{'as':'Descriptions','foreignKey':_0x88f9('0x1be')});db[_0x88f9('0xc2')][_0x88f9('0x114')](db[_0x88f9('0xc4')],{'as':'Fields','foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xc2')]['belongsTo'](db[_0x88f9('0xc1')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x1c0')});db['FreshsalesField'][_0x88f9('0x114')](db['FreshsalesField'],{'as':_0x88f9('0x1c1'),'foreignKey':'SubjectId'});db[_0x88f9('0xc4')]['hasMany'](db[_0x88f9('0xc4')],{'as':_0x88f9('0x1c2'),'foreignKey':_0x88f9('0x1be')});db['FreshsalesField'][_0x88f9('0x114')](db[_0x88f9('0xc4')],{'as':'Field','foreignKey':_0x88f9('0x1bf')});db[_0x88f9('0xc4')][_0x88f9('0x125')](db[_0x88f9('0x8c')],{'as':_0x88f9('0x8c'),'foreignKey':'VariableId'});db[_0x88f9('0xc9')][_0x88f9('0x125')](db[_0x88f9('0x5f')],{});db[_0x88f9('0xc9')]['belongsTo'](db['CmList'],{'as':_0x88f9('0x16d'),'foreignKey':'ListId'});db[_0x88f9('0xc9')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'as':_0x88f9('0x164'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0x88f9('0x125')](db[_0x88f9('0x11c')],{});db['ChatQueueReport'][_0x88f9('0x125')](db['ChatMessage'],{});db[_0x88f9('0xc9')][_0x88f9('0x125')](db['User'],{});db[_0x88f9('0xc9')]['belongsTo'](db[_0x88f9('0x68')],{});db[_0x88f9('0xca')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1d1')});db[_0x88f9('0xca')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'onDelete':_0x88f9('0x112'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0x88f9('0x114')](db[_0x88f9('0xce')],{'foreignKey':_0x88f9('0x1d2'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0xd0')][_0x88f9('0x114')](db[_0x88f9('0xcc')],{'foreignKey':_0x88f9('0x1d2'),'onDelete':'cascade'});db[_0x88f9('0x1d3')][_0x88f9('0x125')](db[_0x88f9('0x4e')],{});db['SmsQueueReport'][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db['SmsQueueReport']['belongsTo'](db[_0x88f9('0x70')],{'as':'Contact','foreignKey':_0x88f9('0x173')});db[_0x88f9('0x1d3')][_0x88f9('0x125')](db[_0x88f9('0x51')],{});db[_0x88f9('0x1d3')][_0x88f9('0x125')](db[_0x88f9('0x53')],{});db[_0x88f9('0x1d3')][_0x88f9('0x125')](db[_0x88f9('0x11')],{});db['SmsQueueReport'][_0x88f9('0x125')](db[_0x88f9('0x55')],{});db['JscriptyProject']['hasMany'](db[_0x88f9('0xd0')],{'foreignKey':_0x88f9('0x1d4')});db[_0x88f9('0x1d5')][_0x88f9('0x114')](db['JscriptyQuestionReport'],{'foreignKey':_0x88f9('0x1d4')});db[_0x88f9('0x1d5')]['hasMany'](db[_0x88f9('0xcc')],{'foreignKey':'ProjectId'});db['SquareProject'][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x177'),'through':'user_has_square_projects'});db[_0x88f9('0xde')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':_0x88f9('0x12e')});db[_0x88f9('0xde')][_0x88f9('0x128')](db[_0x88f9('0x1b')],{'through':_0x88f9('0x10b'),'as':_0x88f9('0x134')});db[_0x88f9('0xde')][_0x88f9('0x128')](db[_0x88f9('0x3b')],{'through':'team_has_mail_queues','as':_0x88f9('0x136')});db[_0x88f9('0xde')][_0x88f9('0x128')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x88f9('0x137')});db['Team'][_0x88f9('0x128')](db[_0x88f9('0x4b')],{'through':_0x88f9('0x187'),'as':_0x88f9('0x138')});db[_0x88f9('0xde')][_0x88f9('0x128')](db['SmsQueue'],{'through':_0x88f9('0x1d6'),'as':_0x88f9('0x139')});db[_0x88f9('0xde')][_0x88f9('0x128')](db['OpenchannelQueue'],{'through':_0x88f9('0x1d7'),'as':_0x88f9('0x13a')});db[_0x88f9('0xde')][_0x88f9('0x128')](db[_0x88f9('0x107')],{'through':'team_has_whatsapp_queues','as':_0x88f9('0x13b')});db[_0x88f9('0xde')][_0x88f9('0x128')](db[_0x88f9('0xf5')],{'through':_0x88f9('0x10d'),'as':_0x88f9('0x135')});db[_0x88f9('0xe2')][_0x88f9('0x114')](db['CmHopper'],{'as':_0x88f9('0x14e'),'foreignKey':_0x88f9('0x19e')});db[_0x88f9('0xe2')]['hasMany'](db[_0x88f9('0x14f')],{'as':_0x88f9('0x117'),'foreignKey':'CampaignId'});db[_0x88f9('0xe2')][_0x88f9('0x114')](db['CmHopperHistory'],{'as':_0x88f9('0x150'),'foreignKey':_0x88f9('0x19e')});db[_0x88f9('0xe2')][_0x88f9('0x114')](db['CmHopperBlack'],{'as':_0x88f9('0x152'),'foreignKey':_0x88f9('0x19e')});db[_0x88f9('0xe2')][_0x88f9('0x125')](db[_0x88f9('0x29')],{'as':_0x88f9('0x29'),'foreignKey':_0x88f9('0x154')});db[_0x88f9('0xe2')][_0x88f9('0x125')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0x88f9('0x156')});db[_0x88f9('0xe2')][_0x88f9('0x125')](db[_0x88f9('0x7e')],{'as':_0x88f9('0x7e'),'foreignKey':'IntervalId'});db['Campaign']['belongsTo'](db[_0x88f9('0xda')],{'as':_0x88f9('0xda'),'foreignKey':_0x88f9('0x1d8')});db[_0x88f9('0xe2')]['belongsToMany'](db[_0x88f9('0xf3')],{'as':_0x88f9('0x12d'),'through':'campaigns_has_cm_lists'});db[_0x88f9('0xe2')]['belongsToMany'](db[_0x88f9('0xf3')],{'as':_0x88f9('0x15c'),'through':_0x88f9('0x1d9')});db[_0x88f9('0xe6')][_0x88f9('0x125')](db[_0x88f9('0x66')],{'as':_0x88f9('0x66'),'foreignKey':_0x88f9('0x17c')});db[_0x88f9('0xea')]['belongsTo'](db['MailMessage'],{});db[_0x88f9('0xea')][_0x88f9('0x125')](db[_0x88f9('0x3e')],{});db[_0x88f9('0xea')]['belongsTo'](db[_0x88f9('0x39')],{'foreignKey':_0x88f9('0x1da'),'as':_0x88f9('0x1db')});db['MailTransferReport'][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1dc'),'as':_0x88f9('0x1dd')});db['MailTransferReport']['belongsTo'](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1de'),'as':_0x88f9('0x1df')});db[_0x88f9('0xea')][_0x88f9('0x125')](db[_0x88f9('0x3b')],{'foreignKey':'ToMailQueueId','as':_0x88f9('0x1e0')});db['MailTransferReport']['belongsTo'](db[_0x88f9('0x39')],{'foreignKey':_0x88f9('0x1e1'),'as':_0x88f9('0x1e2')});db[_0x88f9('0xec')][_0x88f9('0x125')](db[_0x88f9('0x193')],{});db[_0x88f9('0xec')][_0x88f9('0x125')](db[_0x88f9('0x11c')],{});db[_0x88f9('0xec')]['belongsTo'](db[_0x88f9('0x5f')],{'foreignKey':'FromChatWebsiteId','as':_0x88f9('0x1db')});db['ChatTransferReport'][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1dc'),'as':'FromAgent'});db[_0x88f9('0xec')]['belongsTo'](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1de'),'as':_0x88f9('0x1df')});db[_0x88f9('0xec')]['belongsTo'](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x88f9('0x1e0')});db[_0x88f9('0xec')]['belongsTo'](db[_0x88f9('0x5f')],{'foreignKey':_0x88f9('0x1e3'),'as':'ToAccount'});db['FaxTransferReport'][_0x88f9('0x125')](db[_0x88f9('0x4a')],{});db[_0x88f9('0xee')][_0x88f9('0x125')](db[_0x88f9('0x11f')],{});db[_0x88f9('0xee')][_0x88f9('0x125')](db[_0x88f9('0x140')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x88f9('0xee')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1dc'),'as':_0x88f9('0x1dd')});db[_0x88f9('0xee')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1de'),'as':_0x88f9('0x1df')});db[_0x88f9('0xee')]['belongsTo'](db[_0x88f9('0x4b')],{'foreignKey':'ToFaxQueueId','as':_0x88f9('0x1e0')});db[_0x88f9('0xee')][_0x88f9('0x125')](db[_0x88f9('0x140')],{'foreignKey':_0x88f9('0x1e4'),'as':_0x88f9('0x1e2')});db['OpenchannelTransferReport'][_0x88f9('0x125')](db['OpenchannelMessage'],{});db[_0x88f9('0xf0')]['belongsTo'](db[_0x88f9('0x11a')],{});db[_0x88f9('0xf0')]['belongsTo'](db[_0x88f9('0x57')],{'foreignKey':'FromOpenchannelAccountId','as':_0x88f9('0x1db')});db[_0x88f9('0xf0')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1dc'),'as':_0x88f9('0x1dd')});db[_0x88f9('0xf0')]['belongsTo'](db['User'],{'foreignKey':_0x88f9('0x1de'),'as':'ToAgent'});db[_0x88f9('0xf0')][_0x88f9('0x125')](db[_0x88f9('0x5d')],{'foreignKey':_0x88f9('0x1e5'),'as':'ToQueue'});db[_0x88f9('0xf0')]['belongsTo'](db[_0x88f9('0x57')],{'foreignKey':_0x88f9('0x1e6'),'as':_0x88f9('0x1e2')});db[_0x88f9('0x1e7')][_0x88f9('0x125')](db[_0x88f9('0x53')],{});db[_0x88f9('0x1e7')][_0x88f9('0x125')](db[_0x88f9('0x51')],{});db['SmsTransferReport'][_0x88f9('0x125')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x88f9('0x1db')});db[_0x88f9('0x1e7')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db['SmsTransferReport'][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1de'),'as':_0x88f9('0x1df')});db['SmsTransferReport'][_0x88f9('0x125')](db[_0x88f9('0x55')],{'foreignKey':_0x88f9('0x1e8'),'as':_0x88f9('0x1e0')});db[_0x88f9('0x1e7')]['belongsTo'](db[_0x88f9('0x4e')],{'foreignKey':_0x88f9('0x1e9'),'as':_0x88f9('0x1e2')});db[_0x88f9('0xf3')][_0x88f9('0x114')](db[_0x88f9('0x7b')],{'as':_0x88f9('0x168'),'foreignKey':'ListId','onDelete':_0x88f9('0x112')});db['CmList'][_0x88f9('0x114')](db[_0x88f9('0x76')],{'as':_0x88f9('0x1ea'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0xf3')][_0x88f9('0x114')](db[_0x88f9('0x70')],{'as':_0x88f9('0x12b'),'onDelete':'cascade','foreignKey':_0x88f9('0x16e')});db['CmList'][_0x88f9('0x114')](db[_0x88f9('0x14f')],{'as':_0x88f9('0x117'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0xf3')][_0x88f9('0x114')](db[_0x88f9('0x74')],{'as':_0x88f9('0x118'),'foreignKey':'ListId'});db[_0x88f9('0xf3')][_0x88f9('0x114')](db[_0x88f9('0x119')],{'as':'ReportAgentPreview','foreignKey':_0x88f9('0x16e')});db[_0x88f9('0xf3')][_0x88f9('0x128')](db[_0x88f9('0x1b')],{'as':_0x88f9('0x1eb'),'through':_0x88f9('0x1ec')});db[_0x88f9('0xf3')][_0x88f9('0x128')](db[_0x88f9('0x11')],{'as':_0x88f9('0x159'),'through':'cm_user_has_lists'});db[_0x88f9('0xf5')][_0x88f9('0x114')](db[_0x88f9('0x18')],{'as':'Extensions','onDelete':'cascade'});db[_0x88f9('0xf5')][_0x88f9('0x128')](db['User'],{'as':_0x88f9('0x159'),'through':_0x88f9('0x10f')});db[_0x88f9('0xf5')]['belongsToMany'](db[_0x88f9('0xde')],{'through':_0x88f9('0x10d'),'as':_0x88f9('0x15b')});db['UserProfile'][_0x88f9('0x114')](db[_0x88f9('0x11')],{'as':'Users','foreignKey':_0x88f9('0x127')});db[_0x88f9('0x126')]['hasMany'](db[_0x88f9('0xf8')],{'as':_0x88f9('0x1ed'),'foreignKey':'userProfileId','onDelete':_0x88f9('0x112')});db[_0x88f9('0xf8')][_0x88f9('0x114')](db[_0x88f9('0x1ee')],{'as':_0x88f9('0x1ef'),'foreignKey':'sectionId','onDelete':_0x88f9('0x112')});db[_0x88f9('0x145')][_0x88f9('0x114')](db[_0x88f9('0x7b')],{'as':'Dispositions','foreignKey':_0x88f9('0x1f0'),'onDelete':_0x88f9('0x112')});db[_0x88f9('0x145')]['hasMany'](db[_0x88f9('0x169')],{'as':_0x88f9('0x16a'),'foreignKey':'WhatsappAccountId'});db[_0x88f9('0x145')][_0x88f9('0x114')](db[_0x88f9('0x102')],{'as':_0x88f9('0x15e'),'foreignKey':_0x88f9('0x1f0')});db['WhatsappAccount'][_0x88f9('0x114')](db[_0x88f9('0x100')],{'as':'Interactions'});db[_0x88f9('0x145')][_0x88f9('0x114')](db[_0x88f9('0xfe')],{'as':'Applications'});db[_0x88f9('0x145')][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':'List','foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x145')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x88f9('0x158')});db[_0x88f9('0x145')][_0x88f9('0x128')](db['User'],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0x88f9('0xfe')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'onDelete':_0x88f9('0x17d')});db['WhatsappApplication']['belongsTo'](db['WhatsappQueue'],{'onDelete':'restrict'});db[_0x88f9('0xfe')][_0x88f9('0x125')](db[_0x88f9('0x145')],{'onDelete':'restrict'});db[_0x88f9('0xfe')][_0x88f9('0x125')](db['Interval'],{'onDelete':_0x88f9('0x17d'),'foreignKey':'IntervalId'});db[_0x88f9('0xfe')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x88f9('0x100')][_0x88f9('0x114')](db['WhatsappMessage'],{'as':_0x88f9('0x15e'),'onDelete':_0x88f9('0x112'),'foreignKey':_0x88f9('0x1f1')});db[_0x88f9('0x100')][_0x88f9('0x125')](db[_0x88f9('0x145')],{'as':_0x88f9('0x17a'),'foreignKey':_0x88f9('0x1f0')});db[_0x88f9('0x100')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'as':_0x88f9('0x164'),'foreignKey':'ContactId'});db[_0x88f9('0x100')]['belongsTo'](db[_0x88f9('0x11')],{'as':'Owner','foreignKey':_0x88f9('0x113')});db['WhatsappInteraction'][_0x88f9('0x128')](db['Tag'],{'through':_0x88f9('0x1b0'),'as':_0x88f9('0x18b')});db['WhatsappInteraction'][_0x88f9('0x128')](db[_0x88f9('0x87')],{'through':_0x88f9('0x1b0'),'as':_0x88f9('0x176')});db['WhatsappInteraction']['belongsToMany'](db[_0x88f9('0x11')],{'as':'Users','through':_0x88f9('0x1f2'),'foreignKey':_0x88f9('0x1f1')});db[_0x88f9('0x102')]['belongsTo'](db['User'],{'as':_0x88f9('0x11')});db[_0x88f9('0x102')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x164')});db[_0x88f9('0x102')][_0x88f9('0x125')](db[_0x88f9('0x100')],{'onDelete':_0x88f9('0x112'),'as':_0x88f9('0x179'),'foreignKey':_0x88f9('0x1f1')});db['WhatsappMessage'][_0x88f9('0x125')](db[_0x88f9('0x145')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x88f9('0x104')]['belongsTo'](db[_0x88f9('0x145')],{});db[_0x88f9('0x104')][_0x88f9('0x125')](db[_0x88f9('0xf3')],{'as':_0x88f9('0x16d'),'foreignKey':_0x88f9('0x16e')});db[_0x88f9('0x104')][_0x88f9('0x125')](db[_0x88f9('0x70')],{'as':_0x88f9('0x164'),'foreignKey':_0x88f9('0x173')});db[_0x88f9('0x104')][_0x88f9('0x125')](db['WhatsappInteraction'],{});db[_0x88f9('0x104')]['belongsTo'](db[_0x88f9('0x107')],{});db[_0x88f9('0x104')][_0x88f9('0x125')](db[_0x88f9('0x102')],{});db[_0x88f9('0x104')][_0x88f9('0x125')](db['User'],{});db[_0x88f9('0x106')][_0x88f9('0x125')](db[_0x88f9('0x102')],{});db[_0x88f9('0x106')][_0x88f9('0x125')](db[_0x88f9('0x100')],{});db[_0x88f9('0x106')][_0x88f9('0x125')](db[_0x88f9('0x145')],{'foreignKey':_0x88f9('0x1f3'),'as':'FromAccount'});db[_0x88f9('0x106')]['belongsTo'](db[_0x88f9('0x145')],{'foreignKey':_0x88f9('0x1f4'),'as':_0x88f9('0x1e2')});db['WhatsappTransferReport'][_0x88f9('0x125')](db[_0x88f9('0x107')],{'foreignKey':_0x88f9('0x1f5'),'as':_0x88f9('0x1e0')});db['WhatsappTransferReport'][_0x88f9('0x125')](db[_0x88f9('0x11')],{'foreignKey':_0x88f9('0x1dc'),'as':'FromAgent'});db[_0x88f9('0x106')]['belongsTo'](db['User'],{'foreignKey':_0x88f9('0x1de'),'as':_0x88f9('0x1df')});db[_0x88f9('0x107')][_0x88f9('0x128')](db['User'],{'as':'Agents','through':_0x88f9('0x13c'),'foreignKey':_0x88f9('0x1f6')});db[_0x88f9('0x107')][_0x88f9('0x128')](db[_0x88f9('0xde')],{'through':_0x88f9('0x1f7'),'as':_0x88f9('0x15b')});db[_0x88f9('0x1f8')][_0x88f9('0x125')](db[_0x88f9('0x11')],{'as':_0x88f9('0x1f9'),'foreignKey':_0x88f9('0x113'),'onDelete':_0x88f9('0x112'),'hooks':!![]});module[_0x88f9('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x9d50=['mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','MailAccountId','Imap','Smtp','Answers','Interactions','List','ListId','TemplateId','user_has_mail_accounts','MailMessage','Account','Contact','ContactId','Tag','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','MailQueueReport','Items','Disposition','Dispositions','FaxAccountId','Exntensions','FaxQueue','Owner','fax_interaction_has_tags','Tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','SmsAccountId','SmsApplication','user_has_sms_accounts','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','ChatGroupId','Contacts','CompanyId','CmHopper','OpenchannelInteractions','SmsInteractions','Company','cm_contact_has_tags','Queue','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','Schedule','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','Field','VariableId','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowField','Dynamics365Configuration','FreshsalesField','ChatQueueReport','FromId','ToId','SessionId','team_has_chat_queues','FaxQueues','team_has_whatsapp_queues','CampaignId','TrunkId','TrunkBackup','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','Queues','TeamVoicePrefix','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','utf8','username','password','database','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','cascade','UserId','UserSetting','userSetting','hasMany','VoiceRecording','Extensions','HopperFinals','ChatInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','belongsToMany','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','UserVoicePrefix','MailQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','SquareProject','SquareProjects','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','belongsTo','Trunk','TrunkBackupId','IntervalId','Pause'];(function(_0xa90357,_0x1b8a2b){var _0x49d9c2=function(_0x430f32){while(--_0x430f32){_0xa90357['push'](_0xa90357['shift']());}};_0x49d9c2(++_0x1b8a2b);}(_0x9d50,0xa7));var _0x09d5=function(_0x5e9ab8,_0x56c177){_0x5e9ab8=_0x5e9ab8-0x0;var _0x101d02=_0x9d50[_0x5e9ab8];return _0x101d02;};'use strict';var config=require(_0x09d5('0x0'));var Sequelize=require(_0x09d5('0x1'));var _=require(_0x09d5('0x2'));var jstz=require(_0x09d5('0x3'));var timezone=jstz['determine']();config[_0x09d5('0x1')]=_[_0x09d5('0x4')](config[_0x09d5('0x1')],{'database':_0x09d5('0x5'),'username':_0x09d5('0x6'),'password':_0x09d5('0x7'),'options':{'host':_0x09d5('0x8'),'port':0xcea,'dialect':_0x09d5('0x9'),'dialectOptions':{'charset':_0x09d5('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x09d5('0xb')}}});config[_0x09d5('0xc')]=_[_0x09d5('0x4')](config['sequelizeHistory'],{'database':_0x09d5('0x5'),'username':_0x09d5('0x6'),'password':_0x09d5('0x7'),'options':{'host':_0x09d5('0x8'),'port':0xcea,'dialect':_0x09d5('0x9'),'dialectOptions':{'charset':_0x09d5('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x09d5('0xd'),'collate':_0x09d5('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x09d5('0x1')]['database'],config[_0x09d5('0x1')][_0x09d5('0xe')],config['sequelize'][_0x09d5('0xf')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x09d5('0xc')][_0x09d5('0x10')],config[_0x09d5('0xc')]['username'],config[_0x09d5('0xc')][_0x09d5('0xf')],config['sequelizeHistory'][_0x09d5('0x11')])};db[_0x09d5('0x12')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x14'));db[_0x09d5('0x15')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x16'));db[_0x09d5('0x17')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x18'));db[_0x09d5('0x19')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x1a'));db['VoiceMusicOnHold']=db[_0x09d5('0x1')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x09d5('0x1b')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x1c'));db['VoiceRecording']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x1d'));db[_0x09d5('0x1e')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x1f'));db[_0x09d5('0x20')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x21'));db[_0x09d5('0x22')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x23'));db[_0x09d5('0x24')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x25'));db[_0x09d5('0x26')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x27'));db[_0x09d5('0x28')]=db[_0x09d5('0x1')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x09d5('0x29')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x2a'));db['Trunk']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x2b'));db[_0x09d5('0x2c')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x2d'));db[_0x09d5('0x2e')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x2f'));db[_0x09d5('0x30')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x09d5('0x31')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x32'));db[_0x09d5('0x33')]=db['sequelize']['import'](_0x09d5('0x34'));db[_0x09d5('0x35')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x36'));db[_0x09d5('0x37')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x38'));db[_0x09d5('0x39')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x3a'));db[_0x09d5('0x3b')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x3c'));db[_0x09d5('0x3d')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x3e'));db[_0x09d5('0x3f')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0x09d5('0x40')]=db[_0x09d5('0x1')]['import']('../api/mailAccount/mailAccount.model');db[_0x09d5('0x41')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x42'));db[_0x09d5('0x43')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x44'));db[_0x09d5('0x45')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x46'));db['MailMessage']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x47'));db[_0x09d5('0x48')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x49'));db['MailQueueReport']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x4a'));db[_0x09d5('0x4b')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/dashboard/dashboard.model');db[_0x09d5('0x4c')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x4d'));db['FaxAccount']=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/faxAccount/faxAccount.model');db[_0x09d5('0x4e')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x4f'));db[_0x09d5('0x50')]=db['sequelize']['import'](_0x09d5('0x51'));db[_0x09d5('0x52')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x53'));db['FaxQueue']=db[_0x09d5('0x1')]['import'](_0x09d5('0x54'));db[_0x09d5('0x55')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x56'));db[_0x09d5('0x57')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x58'));db['SmsApplication']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x59'));db[_0x09d5('0x5a')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x5b'));db[_0x09d5('0x5c')]=db['sequelize']['import'](_0x09d5('0x5d'));db[_0x09d5('0x5e')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x5f'));db[_0x09d5('0x60')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x61'));db[_0x09d5('0x62')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x63'));db[_0x09d5('0x64')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x65'));db[_0x09d5('0x66')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x67'));db[_0x09d5('0x68')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x09d5('0x69')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x6a'));db[_0x09d5('0x6b')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x6c'));db[_0x09d5('0x6d')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x09d5('0x6e')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x6f'));db['ChatOfflineMessage']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x70'));db[_0x09d5('0x71')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x72'));db[_0x09d5('0x73')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x74'));db[_0x09d5('0x75')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x76'));db[_0x09d5('0x77')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x78'));db['CmContact']=db[_0x09d5('0x1')]['import'](_0x09d5('0x79'));db['CmHopper']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x7a'));db['CmHopperBlack']=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x09d5('0x7b')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x09d5('0x7c')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x7d'));db[_0x09d5('0x7e')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x7f'));db[_0x09d5('0x80')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x81'));db[_0x09d5('0x82')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x83'));db[_0x09d5('0x84')]=db['sequelize'][_0x09d5('0x13')]('../api/automation/automation.model');db[_0x09d5('0x85')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x86'));db['Disposition']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x87'));db[_0x09d5('0x88')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x89'));db[_0x09d5('0x8a')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x8b'));db['Pause']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x8c'));db[_0x09d5('0x8d')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x8e'));db[_0x09d5('0x8f')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x90'));db['Schedule']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x91'));db[_0x09d5('0x92')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/sound/sound.model');db['Tag']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x93'));db[_0x09d5('0x94')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x95'));db['Trigger']=db[_0x09d5('0x1')]['import'](_0x09d5('0x96'));db[_0x09d5('0x97')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x98'));db[_0x09d5('0x99')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x9a'));db[_0x09d5('0x9b')]=db[_0x09d5('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0x09d5('0x9c')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x9d'));db['AnalyticDefaultReport']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x9e'));db[_0x09d5('0x9f')]=db[_0x09d5('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x09d5('0xa0')]=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0x09d5('0xa1')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xa2'));db[_0x09d5('0xa3')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0xa4'));db[_0x09d5('0xa5')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0xa6'));db[_0x09d5('0xa7')]=db[_0x09d5('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x09d5('0xa8')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0x09d5('0xa9')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xaa'));db[_0x09d5('0xab')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xac'));db[_0x09d5('0xad')]=db[_0x09d5('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x09d5('0xae')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xaf'));db[_0x09d5('0xb0')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xb1'));db[_0x09d5('0xb2')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/intDeskField/intDeskField.model');db[_0x09d5('0xb3')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xb4'));db[_0x09d5('0xb5')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x09d5('0xb6')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xb7'));db[_0x09d5('0xb8')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xb9'));db[_0x09d5('0xba')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xbb'));db[_0x09d5('0xbc')]=db['sequelize'][_0x09d5('0x13')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xbd'));db[_0x09d5('0xbe')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0xbf'));db[_0x09d5('0xc0')]=db[_0x09d5('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x09d5('0xc1')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xc2'));db[_0x09d5('0xc3')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0xc4'));db[_0x09d5('0xc5')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x09d5('0xc6')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xc7'));db[_0x09d5('0xc8')]=db['sequelize']['import'](_0x09d5('0xc9'));db['ServicenowField']=db[_0x09d5('0x1')]['import'](_0x09d5('0xca'));db[_0x09d5('0xcb')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xcc'));db['Dynamics365Configuration']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xcd'));db[_0x09d5('0xce')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x09d5('0xcf')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xd0'));db[_0x09d5('0xd1')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xd2'));db['FreshsalesField']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xd3'));db['Integration']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x9a'));db['Network']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xd4'));db['ChatQueueReport']=db[_0x09d5('0x1')]['import'](_0x09d5('0xd5'));db[_0x09d5('0xd6')]=db['sequelize']['import'](_0x09d5('0xd7'));db[_0x09d5('0xd8')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xd9'));db[_0x09d5('0xda')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xdb'));db[_0x09d5('0xdc')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xdd'));db[_0x09d5('0xde')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db['sequelize'][_0x09d5('0x13')]('../api/squareReport/squareReport.model');db[_0x09d5('0xdf')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x09d5('0xe0')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xe1'));db[_0x09d5('0xe2')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/setting/setting.model');db[_0x09d5('0xe3')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xe4'));db['SquareProject']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xe5'));db[_0x09d5('0xe6')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xe7'));db['SquareMessage']=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/squareMessage/squareMessage.model');db[_0x09d5('0xe8')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xe9'));db[_0x09d5('0xea')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0xeb'));db[_0x09d5('0xec')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0xed'));db[_0x09d5('0xee')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xef'));db[_0x09d5('0xf0')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xf1'));db[_0x09d5('0xf2')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xf3'));db[_0x09d5('0xf4')]=db[_0x09d5('0x1')]['import'](_0x09d5('0xf5'));db['ChatTransferReport']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xf6'));db[_0x09d5('0xf7')]=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0x09d5('0xf8')]=db['sequelize'][_0x09d5('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x09d5('0xf9')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xfa'));db[_0x09d5('0xfb')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0xfc'));db[_0x09d5('0xfd')]=db['sequelize']['import'](_0x09d5('0xfe'));db[_0x09d5('0xff')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x100'));db[_0x09d5('0x101')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x102'));db['UserProfileResource']=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/userProfileResource/userProfileResource.model');db[_0x09d5('0x103')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x104'));db[_0x09d5('0x105')]=db['sequelize']['import'](_0x09d5('0x106'));db[_0x09d5('0x107')]=db[_0x09d5('0x1')]['import'](_0x09d5('0x108'));db['WhatsappInteraction']=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x109'));db[_0x09d5('0x10a')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x10b'));db[_0x09d5('0x10c')]=db[_0x09d5('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x10d'));db[_0x09d5('0x10e')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x10f'));db[_0x09d5('0x110')]=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x111'));db[_0x09d5('0x112')]=db[_0x09d5('0x1')][_0x09d5('0x13')](_0x09d5('0x113'));db['TeamVoicePrefix']=db[_0x09d5('0x1')]['import'](_0x09d5('0x114'));db['UserVoicePrefix']=db[_0x09d5('0x1')][_0x09d5('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db['sequelize'][_0x09d5('0x13')](_0x09d5('0x115'));db[_0x09d5('0x12')][_0x09d5('0x116')](db['VoiceMail'],{'as':_0x09d5('0x20'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')]['hasOne'](db[_0x09d5('0x119')],{'as':_0x09d5('0x11a'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x118')});db['User'][_0x09d5('0x11b')](db[_0x09d5('0x11c')],{'as':'Recordings','foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')][_0x09d5('0x11b')](db[_0x09d5('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x09d5('0x118')});db['User']['hasMany'](db[_0x09d5('0x19')],{'as':_0x09d5('0x11d'),'onDelete':_0x09d5('0x117'),'hooks':!![]});db[_0x09d5('0x12')]['hasMany'](db[_0x09d5('0x7b')],{'as':_0x09d5('0x11e'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')][_0x09d5('0x11b')](db[_0x09d5('0x7c')],{'as':'HopperHistory','foreignKey':'UserId'});db['User'][_0x09d5('0x11b')](db[_0x09d5('0x7e')],{'as':_0x09d5('0x7e'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')]['hasMany'](db[_0x09d5('0x64')],{'as':'OpenchannelInteractions','foreignKey':_0x09d5('0x118')});db['User'][_0x09d5('0x11b')](db[_0x09d5('0x6d')],{'as':_0x09d5('0x11f'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')][_0x09d5('0x11b')](db[_0x09d5('0x5a')],{'as':'SmsInteractions','foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')][_0x09d5('0x11b')](db[_0x09d5('0x50')],{'as':'FaxInteractions','foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')][_0x09d5('0x11b')](db['MailInteraction'],{'as':_0x09d5('0x120'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')][_0x09d5('0x11b')](db[_0x09d5('0x121')],{'as':_0x09d5('0x122'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x12')][_0x09d5('0x11b')](db['UserNotification'],{'as':_0x09d5('0x123'),'foreignKey':_0x09d5('0x124')});db[_0x09d5('0x12')]['belongsTo'](db[_0x09d5('0xff')],{'as':_0x09d5('0xff'),'foreignKey':'userProfileId'});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0x09d5('0x125'),'through':_0x09d5('0x126')});db[_0x09d5('0x12')]['belongsToMany'](db[_0x09d5('0x127')],{'as':'Contacts','through':_0x09d5('0x128')});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x12a'),'through':_0x09d5('0x12b')});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0xe8')],{'through':_0x09d5('0x12c')});db['User']['belongsToMany'](db['MailInteraction'],{'as':'MailInteractions','through':_0x09d5('0x12d')});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x6d')],{'as':'ChatInteractions','through':_0x09d5('0x12e')});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x50')],{'as':_0x09d5('0x12f'),'through':'user_has_fax_interactions'});db[_0x09d5('0x12')][_0x09d5('0x129')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0x09d5('0x130')});db[_0x09d5('0x12')]['belongsToMany'](db[_0x09d5('0x64')],{'as':'OpenchannelInteractions','through':_0x09d5('0x131')});db['User']['belongsToMany'](db[_0x09d5('0x121')],{'as':_0x09d5('0x122'),'through':'user_has_whatsapp_interactions'});db[_0x09d5('0x12')]['belongsToMany'](db[_0x09d5('0x1b')],{'as':_0x09d5('0x132'),'through':'UserVoiceQueue','required':![]});db[_0x09d5('0x12')]['belongsToMany'](db[_0x09d5('0xfd')],{'as':'VoicePrefixes','through':_0x09d5('0x133'),'required':![]});db['User'][_0x09d5('0x129')](db['MailQueue'],{'as':_0x09d5('0x134'),'through':'UserMailQueue','required':![]});db['User'][_0x09d5('0x129')](db[_0x09d5('0x71')],{'as':_0x09d5('0x135'),'through':_0x09d5('0x31'),'required':![],'hooks':!![]});db['User'][_0x09d5('0x129')](db['FaxQueue'],{'as':'FaxQueues','through':_0x09d5('0x35'),'required':![]});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x5e')],{'as':_0x09d5('0x136'),'through':_0x09d5('0x37'),'required':![]});db['User'][_0x09d5('0x129')](db[_0x09d5('0x68')],{'as':_0x09d5('0x137'),'through':_0x09d5('0x39'),'required':![]});db[_0x09d5('0x12')]['belongsToMany'](db['WhatsappQueue'],{'as':_0x09d5('0x138'),'through':_0x09d5('0x3b'),'required':![]});db[_0x09d5('0x12')]['belongsToMany'](db[_0x09d5('0xfb')],{'through':_0x09d5('0x12b')});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x69')],{'as':'ChatWebsites','through':_0x09d5('0x139')});db['User'][_0x09d5('0x129')](db[_0x09d5('0x13a')],{'as':_0x09d5('0x13b'),'through':_0x09d5('0x13c')});db[_0x09d5('0x12')]['belongsToMany'](db[_0x09d5('0x40')],{'as':_0x09d5('0x13d'),'through':'user_has_mail_accounts'});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x60')],{'as':_0x09d5('0x13e'),'through':_0x09d5('0x13f')});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x57')],{'as':_0x09d5('0x140'),'through':'user_has_sms_accounts'});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x105')],{'as':_0x09d5('0x141'),'through':'user_has_whatsapp_accounts'});db[_0x09d5('0x12')][_0x09d5('0x129')](db[_0x09d5('0x142')],{'as':_0x09d5('0x143'),'through':'user_has_square_projects'});db[_0x09d5('0x15')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x144')});db[_0x09d5('0x17')][_0x09d5('0x11b')](db['VoiceExtension'],{'onDelete':_0x09d5('0x117')});db[_0x09d5('0x19')][_0x09d5('0x11b')](db[_0x09d5('0x19')],{'as':_0x09d5('0x145'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x146')][_0x09d5('0x129')](db['Sound'],{'as':_0x09d5('0x147'),'through':_0x09d5('0x148')});db['VoiceQueue']['hasMany'](db[_0x09d5('0x2e')],{'as':'Members','foreignKey':_0x09d5('0x149')});db[_0x09d5('0x1b')][_0x09d5('0x11b')](db['CmHopper'],{'as':_0x09d5('0x14a'),'foreignKey':_0x09d5('0x149')});db[_0x09d5('0x1b')]['hasMany'](db[_0x09d5('0x7b')],{'as':_0x09d5('0x11e'),'foreignKey':'VoiceQueueId'});db[_0x09d5('0x1b')][_0x09d5('0x11b')](db[_0x09d5('0x7c')],{'as':_0x09d5('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x09d5('0x1b')][_0x09d5('0x11b')](db[_0x09d5('0x7e')],{'as':_0x09d5('0x7e'),'foreignKey':_0x09d5('0x149')});db[_0x09d5('0x1b')]['hasMany'](db[_0x09d5('0x14c')],{'as':_0x09d5('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x09d5('0x1b')]['hasMany'](db[_0x09d5('0xdc')],{'as':_0x09d5('0x14e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x09d5('0x14f')](db[_0x09d5('0x150')],{'as':_0x09d5('0x150'),'foreignKey':'TrunkId'});db[_0x09d5('0x1b')][_0x09d5('0x14f')](db[_0x09d5('0x150')],{'as':'TrunkBackup','foreignKey':_0x09d5('0x151')});db[_0x09d5('0x1b')][_0x09d5('0x14f')](db[_0x09d5('0x8a')],{'as':_0x09d5('0x8a'),'foreignKey':_0x09d5('0x152')});db['VoiceQueue'][_0x09d5('0x14f')](db[_0x09d5('0x153')],{'as':_0x09d5('0x154'),'foreignKey':_0x09d5('0x155')});db[_0x09d5('0x1b')][_0x09d5('0x129')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x12a'),'through':_0x09d5('0x156')});db[_0x09d5('0x1b')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':_0x09d5('0x30')});db[_0x09d5('0x1b')][_0x09d5('0x129')](db[_0x09d5('0xe8')],{'as':_0x09d5('0x158'),'through':_0x09d5('0x112')});db['VoiceQueue'][_0x09d5('0x129')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x159'),'through':_0x09d5('0x15a')});db[_0x09d5('0x11c')]['belongsTo'](db[_0x09d5('0x12')],{'as':_0x09d5('0x12'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x1e')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':_0x09d5('0x12'),'foreignKey':'UserId'});db['VoiceMail'][_0x09d5('0x11b')](db['VoiceMailMessage'],{'as':_0x09d5('0x15b'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x15c'),'sourceKey':_0x09d5('0x15d')});db[_0x09d5('0x22')]['belongsTo'](db[_0x09d5('0x20')],{'foreignKey':_0x09d5('0x15c'),'targetKey':_0x09d5('0x15d')});db[_0x09d5('0x24')][_0x09d5('0x11b')](db[_0x09d5('0x28')],{'as':_0x09d5('0x15e'),'foreignKey':_0x09d5('0x15f'),'constraints':![]});db[_0x09d5('0x24')][_0x09d5('0x11b')](db[_0x09d5('0x160')],{'as':_0x09d5('0x161'),'foreignKey':_0x09d5('0x15f'),'constraints':![]});db['VoiceCallReport'][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':_0x09d5('0x12'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x24')]['belongsTo'](db[_0x09d5('0x127')],{'as':'Contact','foreignKey':'ContactId'});db[_0x09d5('0x3d')][_0x09d5('0x14f')](db[_0x09d5('0x40')],{'as':_0x09d5('0x40'),'foreignKey':_0x09d5('0x162')});db[_0x09d5('0x3f')]['belongsTo'](db['MailAccount'],{'as':_0x09d5('0x40'),'foreignKey':'MailAccountId'});db[_0x09d5('0x40')][_0x09d5('0x116')](db[_0x09d5('0x3d')],{'as':_0x09d5('0x163'),'onDelete':_0x09d5('0x117')});db['MailAccount'][_0x09d5('0x116')](db[_0x09d5('0x3f')],{'as':_0x09d5('0x164'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x40')][_0x09d5('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x09d5('0x162'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x40')][_0x09d5('0x11b')](db['CannedAnswer'],{'as':_0x09d5('0x165'),'foreignKey':'MailAccountId'});db[_0x09d5('0x40')][_0x09d5('0x11b')](db['MailMessage'],{'as':_0x09d5('0x15b'),'foreignKey':_0x09d5('0x162')});db['MailAccount'][_0x09d5('0x11b')](db['MailInteraction'],{'as':_0x09d5('0x166')});db[_0x09d5('0x40')]['hasMany'](db[_0x09d5('0x48')],{'as':_0x09d5('0x145')});db[_0x09d5('0x40')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x167'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0x40')][_0x09d5('0x14f')](db['Template'],{'as':'Template','foreignKey':_0x09d5('0x169')});db[_0x09d5('0x40')]['belongsTo'](db[_0x09d5('0x153')],{'as':_0x09d5('0x154'),'foreignKey':_0x09d5('0x155')});db[_0x09d5('0x40')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':_0x09d5('0x16a')});db[_0x09d5('0x41')][_0x09d5('0x129')](db['User'],{'as':_0x09d5('0x157'),'through':_0x09d5('0x33')});db['MailQueue'][_0x09d5('0x129')](db['Team'],{'through':'team_has_mail_queues','as':'Teams'});db[_0x09d5('0x45')][_0x09d5('0x11b')](db[_0x09d5('0x16b')],{'as':'Messages','onDelete':_0x09d5('0x117'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x09d5('0x14f')](db[_0x09d5('0x40')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x162')});db[_0x09d5('0x45')][_0x09d5('0x14f')](db['CmContact'],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db['MailInteraction'][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':'Owner','foreignKey':_0x09d5('0x118')});db[_0x09d5('0x45')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x170'),'as':'Tags'});db['MailInteraction'][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x170'),'as':_0x09d5('0x171')});db[_0x09d5('0x45')][_0x09d5('0x129')](db['User'],{'as':_0x09d5('0x172'),'through':_0x09d5('0x12d'),'foreignKey':_0x09d5('0x173')});db[_0x09d5('0x16b')][_0x09d5('0x11b')](db[_0x09d5('0xf0')],{'as':_0x09d5('0x174'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x16b')]['belongsTo'](db[_0x09d5('0x12')],{'as':_0x09d5('0x12')});db[_0x09d5('0x16b')][_0x09d5('0x14f')](db['CmContact'],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x16d')});db['MailMessage'][_0x09d5('0x14f')](db[_0x09d5('0x45')],{'as':_0x09d5('0x175'),'foreignKey':_0x09d5('0x173')});db['MailMessage'][_0x09d5('0x14f')](db[_0x09d5('0x40')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x162')});db[_0x09d5('0x16b')][_0x09d5('0x14f')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db['MailMessage'][_0x09d5('0x14f')](db[_0x09d5('0x176')],{'as':_0x09d5('0x176'),'foreignKey':_0x09d5('0x177')});db[_0x09d5('0x48')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'onDelete':'restrict'});db[_0x09d5('0x48')]['belongsTo'](db[_0x09d5('0x41')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x48')][_0x09d5('0x14f')](db[_0x09d5('0x40')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x48')]['belongsTo'](db[_0x09d5('0x8a')],{'onDelete':_0x09d5('0x178'),'foreignKey':_0x09d5('0x152')});db[_0x09d5('0x48')]['belongsTo'](db[_0x09d5('0x16f')],{'onDelete':_0x09d5('0x178'),'foreignKey':_0x09d5('0x179')});db[_0x09d5('0x17a')]['belongsTo'](db[_0x09d5('0x40')],{});db[_0x09d5('0x17a')][_0x09d5('0x14f')](db['CmList'],{'as':_0x09d5('0x167'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0x17a')][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':'Contact','foreignKey':_0x09d5('0x16e')});db['MailQueueReport'][_0x09d5('0x14f')](db[_0x09d5('0x45')],{});db[_0x09d5('0x17a')][_0x09d5('0x14f')](db[_0x09d5('0x16b')],{});db['MailQueueReport'][_0x09d5('0x14f')](db['User'],{});db[_0x09d5('0x17a')][_0x09d5('0x14f')](db['MailQueue'],{});db[_0x09d5('0x4b')][_0x09d5('0x11b')](db[_0x09d5('0x4c')],{'as':_0x09d5('0x17b'),'onDelete':'cascade'});db[_0x09d5('0x13a')][_0x09d5('0x11b')](db[_0x09d5('0x17c')],{'as':_0x09d5('0x17d'),'foreignKey':_0x09d5('0x17e'),'onDelete':_0x09d5('0x117')});db['FaxAccount'][_0x09d5('0x11b')](db[_0x09d5('0x85')],{'as':_0x09d5('0x165'),'foreignKey':_0x09d5('0x17e')});db[_0x09d5('0x13a')][_0x09d5('0x11b')](db[_0x09d5('0x50')],{'as':_0x09d5('0x166')});db[_0x09d5('0x13a')][_0x09d5('0x11b')](db[_0x09d5('0x4e')],{'as':_0x09d5('0x145')});db[_0x09d5('0x13a')][_0x09d5('0x11b')](db['VoiceExtension'],{'as':_0x09d5('0x17f'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x13a')][_0x09d5('0x11b')](db[_0x09d5('0x52')],{'as':_0x09d5('0x15b')});db[_0x09d5('0x13a')]['belongsTo'](db[_0x09d5('0x150')],{'as':'Trunk'});db[_0x09d5('0x13a')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':'List','foreignKey':_0x09d5('0x168')});db[_0x09d5('0x13a')][_0x09d5('0x14f')](db[_0x09d5('0x153')],{'as':_0x09d5('0x154'),'foreignKey':_0x09d5('0x155')});db[_0x09d5('0x13a')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':'user_has_fax_accounts'});db['FaxApplication']['belongsTo'](db[_0x09d5('0x12')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x4e')][_0x09d5('0x14f')](db[_0x09d5('0x180')],{'onDelete':'restrict'});db[_0x09d5('0x4e')][_0x09d5('0x14f')](db[_0x09d5('0x13a')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x4e')][_0x09d5('0x14f')](db[_0x09d5('0x16f')],{'onDelete':'restrict','foreignKey':_0x09d5('0x179')});db['FaxInteraction'][_0x09d5('0x11b')](db[_0x09d5('0x52')],{'as':_0x09d5('0x15b'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x09d5('0x50')]['belongsTo'](db[_0x09d5('0x13a')],{'as':_0x09d5('0x16c'),'foreignKey':'FaxAccountId'});db[_0x09d5('0x50')][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db['FaxInteraction'][_0x09d5('0x14f')](db['User'],{'as':_0x09d5('0x181'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x50')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x182'),'as':_0x09d5('0x183')});db[_0x09d5('0x50')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x182'),'as':_0x09d5('0x171')});db['FaxInteraction'][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':'Users','through':_0x09d5('0x184'),'foreignKey':'FaxInteractionId'});db[_0x09d5('0x52')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'onDelete':'cascade','as':_0x09d5('0x12')});db[_0x09d5('0x52')]['belongsTo'](db['FaxInteraction'],{'as':_0x09d5('0x175'),'foreignKey':_0x09d5('0x185')});db[_0x09d5('0x52')]['belongsTo'](db[_0x09d5('0x127')],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x16d')});db[_0x09d5('0x52')]['belongsTo'](db[_0x09d5('0xf0')],{'as':_0x09d5('0xf0'),'foreignKey':_0x09d5('0x186')});db[_0x09d5('0x52')][_0x09d5('0x14f')](db['FaxAccount'],{'as':'Account','foreignKey':_0x09d5('0x17e')});db[_0x09d5('0x180')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':'Agents','through':_0x09d5('0x35')});db[_0x09d5('0x180')]['belongsToMany'](db[_0x09d5('0xe8')],{'through':'team_has_fax_queues','as':_0x09d5('0x158')});db[_0x09d5('0x55')][_0x09d5('0x14f')](db['FaxAccount'],{});db[_0x09d5('0x55')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x167'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0x55')]['belongsTo'](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x55')][_0x09d5('0x14f')](db[_0x09d5('0x50')],{});db[_0x09d5('0x55')]['belongsTo'](db['FaxMessage'],{});db[_0x09d5('0x55')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{});db[_0x09d5('0x55')][_0x09d5('0x14f')](db[_0x09d5('0x180')],{});db[_0x09d5('0x57')]['hasMany'](db['Disposition'],{'as':_0x09d5('0x17d'),'foreignKey':_0x09d5('0x187'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x57')]['hasMany'](db[_0x09d5('0x85')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x09d5('0x57')][_0x09d5('0x11b')](db[_0x09d5('0x5c')],{'as':_0x09d5('0x15b'),'foreignKey':_0x09d5('0x187')});db[_0x09d5('0x57')][_0x09d5('0x11b')](db[_0x09d5('0x5a')],{'as':_0x09d5('0x166')});db['SmsAccount'][_0x09d5('0x11b')](db[_0x09d5('0x188')],{'as':_0x09d5('0x145')});db['SmsAccount'][_0x09d5('0x14f')](db['CmList'],{'as':'List','foreignKey':_0x09d5('0x168')});db[_0x09d5('0x57')][_0x09d5('0x14f')](db[_0x09d5('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x09d5('0x155')});db[_0x09d5('0x57')][_0x09d5('0x129')](db['User'],{'as':_0x09d5('0x157'),'through':_0x09d5('0x189')});db['SmsApplication'][_0x09d5('0x14f')](db['User'],{'onDelete':'restrict'});db[_0x09d5('0x188')][_0x09d5('0x14f')](db[_0x09d5('0x5e')],{'onDelete':_0x09d5('0x178')});db['SmsApplication'][_0x09d5('0x14f')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x09d5('0x188')]['belongsTo'](db['Interval'],{'onDelete':_0x09d5('0x178'),'foreignKey':'IntervalId'});db[_0x09d5('0x188')][_0x09d5('0x14f')](db[_0x09d5('0x16f')],{'onDelete':_0x09d5('0x178'),'foreignKey':_0x09d5('0x179')});db[_0x09d5('0x5a')]['hasMany'](db[_0x09d5('0x5c')],{'as':_0x09d5('0x15b'),'onDelete':'cascade','foreignKey':_0x09d5('0x18a')});db['SmsInteraction'][_0x09d5('0x14f')](db[_0x09d5('0x57')],{'as':_0x09d5('0x16c'),'foreignKey':'SmsAccountId'});db[_0x09d5('0x5a')][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':_0x09d5('0x181'),'foreignKey':'UserId'});db[_0x09d5('0x5a')]['belongsToMany'](db[_0x09d5('0x16f')],{'through':'sms_interaction_has_tags','as':_0x09d5('0x183')});db[_0x09d5('0x5a')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':'sms_interaction_has_tags','as':_0x09d5('0x171')});db['SmsInteraction'][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x172'),'through':_0x09d5('0x130'),'foreignKey':_0x09d5('0x18a')});db['SmsMessage'][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':_0x09d5('0x12')});db[_0x09d5('0x5c')][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x16d')});db['SmsMessage']['belongsTo'](db[_0x09d5('0x5a')],{'onDelete':_0x09d5('0x117'),'as':'Interaction','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x09d5('0x14f')](db['SmsAccount'],{'as':_0x09d5('0x16c'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':_0x09d5('0x37'),'foreignKey':'SmsQueueId'});db['SmsQueue']['belongsToMany'](db[_0x09d5('0xe8')],{'through':_0x09d5('0x18b'),'as':'Teams'});db[_0x09d5('0x60')][_0x09d5('0x11b')](db[_0x09d5('0x17c')],{'as':_0x09d5('0x17d'),'foreignKey':_0x09d5('0x18c'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x60')][_0x09d5('0x11b')](db[_0x09d5('0x85')],{'as':_0x09d5('0x165'),'foreignKey':_0x09d5('0x18c')});db[_0x09d5('0x60')][_0x09d5('0x11b')](db[_0x09d5('0x64')],{'as':'Interactions','foreignKey':_0x09d5('0x18c')});db['OpenchannelAccount'][_0x09d5('0x11b')](db[_0x09d5('0x66')],{'as':_0x09d5('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0x09d5('0x60')]['hasMany'](db[_0x09d5('0x62')],{'as':_0x09d5('0x145'),'foreignKey':'OpenchannelAccountId'});db[_0x09d5('0x60')][_0x09d5('0x14f')](db['CmList'],{'as':_0x09d5('0x167'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0x60')][_0x09d5('0x14f')](db[_0x09d5('0x153')],{'as':_0x09d5('0x154'),'foreignKey':_0x09d5('0x155')});db[_0x09d5('0x60')]['belongsToMany'](db[_0x09d5('0x12')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x09d5('0x62')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x62')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x09d5('0x178'),'foreignKey':_0x09d5('0x18d')});db[_0x09d5('0x62')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x09d5('0x18c')});db[_0x09d5('0x62')]['belongsTo'](db[_0x09d5('0x8a')],{'onDelete':_0x09d5('0x178'),'foreignKey':_0x09d5('0x152')});db['OpenchannelApplication'][_0x09d5('0x14f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x09d5('0x179')});db[_0x09d5('0x64')]['hasMany'](db[_0x09d5('0x66')],{'as':_0x09d5('0x15b'),'onDelete':_0x09d5('0x117'),'foreignKey':'OpenchannelInteractionId'});db[_0x09d5('0x64')]['belongsTo'](db[_0x09d5('0x60')],{'as':_0x09d5('0x16c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db['OpenchannelInteraction'][_0x09d5('0x14f')](db['User'],{'as':_0x09d5('0x181'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x64')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x09d5('0x64')]['belongsToMany'](db['Tag'],{'through':_0x09d5('0x18e'),'as':'ThroughTags'});db[_0x09d5('0x64')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x172'),'through':_0x09d5('0x131'),'foreignKey':_0x09d5('0x18f')});db[_0x09d5('0x66')]['belongsTo'](db['User'],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x12')});db[_0x09d5('0x66')]['belongsTo'](db['CmContact'],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x16d')});db[_0x09d5('0x66')][_0x09d5('0x14f')](db[_0x09d5('0x64')],{'onDelete':_0x09d5('0x117'),'as':'Interaction','foreignKey':_0x09d5('0x18f')});db[_0x09d5('0x66')][_0x09d5('0x14f')](db['Attachment'],{'as':_0x09d5('0xf0'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x09d5('0x14f')](db[_0x09d5('0x60')],{'as':'Account','foreignKey':_0x09d5('0x18c')});db[_0x09d5('0x68')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':'Agents','through':_0x09d5('0x39'),'foreignKey':_0x09d5('0x18d')});db[_0x09d5('0x68')][_0x09d5('0x129')](db[_0x09d5('0xe8')],{'through':_0x09d5('0x190'),'as':'Teams'});db[_0x09d5('0x69')][_0x09d5('0x11b')](db[_0x09d5('0x17c')],{'as':_0x09d5('0x17d'),'foreignKey':_0x09d5('0x191'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x69')][_0x09d5('0x11b')](db[_0x09d5('0x85')],{'as':_0x09d5('0x165'),'foreignKey':_0x09d5('0x191')});db[_0x09d5('0x69')][_0x09d5('0x11b')](db[_0x09d5('0x75')],{'as':_0x09d5('0x192')});db['ChatWebsite'][_0x09d5('0x11b')](db[_0x09d5('0x6d')],{'as':_0x09d5('0x166')});db[_0x09d5('0x69')]['hasMany'](db['ChatApplication'],{'as':_0x09d5('0x145')});db[_0x09d5('0x69')]['hasMany'](db[_0x09d5('0x6e')],{'as':_0x09d5('0x15b')});db[_0x09d5('0x69')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x167'),'foreignKey':'ListId'});db['ChatWebsite'][_0x09d5('0x14f')](db[_0x09d5('0x8a')],{'as':_0x09d5('0x8a'),'foreignKey':_0x09d5('0x152')});db['ChatWebsite'][_0x09d5('0x14f')](db['MailAccount'],{'as':_0x09d5('0x40'),'foreignKey':'MailAccountId'});db[_0x09d5('0x69')][_0x09d5('0x14f')](db[_0x09d5('0x153')],{'as':'mandatoryDispositionPause','foreignKey':_0x09d5('0x155')});db[_0x09d5('0x69')]['belongsToMany'](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':_0x09d5('0x139')});db[_0x09d5('0x193')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x09d5('0x193')]['belongsTo'](db[_0x09d5('0xfb')],{'as':'List','foreignKey':'ListId'});db['OpenchannelQueueReport'][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x193')][_0x09d5('0x14f')](db[_0x09d5('0x64')],{});db[_0x09d5('0x193')][_0x09d5('0x14f')](db[_0x09d5('0x66')],{});db[_0x09d5('0x193')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{});db[_0x09d5('0x193')]['belongsTo'](db[_0x09d5('0x68')],{});db[_0x09d5('0x6b')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':_0x09d5('0x194'),'foreignKey':'UserId','onDelete':_0x09d5('0x178')});db[_0x09d5('0x6b')][_0x09d5('0x14f')](db['ChatQueue'],{'as':'Queue','foreignKey':_0x09d5('0x195'),'onDelete':_0x09d5('0x178')});db[_0x09d5('0x6b')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x09d5('0x178')});db[_0x09d5('0x6b')][_0x09d5('0x14f')](db['Tag'],{'onDelete':_0x09d5('0x178'),'foreignKey':_0x09d5('0x179')});db[_0x09d5('0x6d')]['hasMany'](db[_0x09d5('0x6e')],{'as':'Messages','onDelete':_0x09d5('0x117'),'foreignKey':'ChatInteractionId'});db[_0x09d5('0x6d')][_0x09d5('0x14f')](db['ChatWebsite'],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x191')});db[_0x09d5('0x6d')][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x6d')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':_0x09d5('0x181'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x6d')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':'chat_interaction_has_tags','as':_0x09d5('0x183')});db[_0x09d5('0x6d')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x196'),'as':_0x09d5('0x171')});db[_0x09d5('0x6d')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':'Users','through':_0x09d5('0x12e'),'foreignKey':'ChatInteractionId'});db[_0x09d5('0x6e')]['belongsTo'](db[_0x09d5('0x12')],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x12')});db['ChatMessage'][_0x09d5('0x14f')](db['CmContact'],{'onDelete':'cascade','as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x6e')][_0x09d5('0x14f')](db[_0x09d5('0x6d')],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x175'),'foreignKey':_0x09d5('0x197')});db[_0x09d5('0x6e')][_0x09d5('0x14f')](db['Attachment'],{'as':_0x09d5('0xf0'),'foreignKey':_0x09d5('0x186')});db[_0x09d5('0x6e')][_0x09d5('0x14f')](db[_0x09d5('0x69')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x09d5('0x176')]['hasMany'](db[_0x09d5('0xf0')],{'as':_0x09d5('0x174'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x09d5('0x117'),'hooks':!![]});db[_0x09d5('0x176')][_0x09d5('0x14f')](db['CmContact'],{'onDelete':_0x09d5('0x117'),'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x176')][_0x09d5('0x14f')](db[_0x09d5('0x69')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x191')});db['ChatQueue'][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':_0x09d5('0x31'),'hooks':!![]});db[_0x09d5('0x71')][_0x09d5('0x129')](db[_0x09d5('0xe8')],{'through':'team_has_chat_queues','as':'Teams'});db[_0x09d5('0x73')]['hasMany'](db[_0x09d5('0xd6')],{'as':'Messages','foreignKey':_0x09d5('0x198'),'onDelete':'cascade'});db[_0x09d5('0x73')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':'Members','through':'chat_group_has_users'});db[_0x09d5('0x75')]['belongsTo'](db[_0x09d5('0x69')],{'as':'Website','foreignKey':_0x09d5('0x191')});db[_0x09d5('0x77')][_0x09d5('0x11b')](db[_0x09d5('0x127')],{'as':_0x09d5('0x199'),'foreignKey':_0x09d5('0x19a')});db[_0x09d5('0x127')][_0x09d5('0x11b')](db[_0x09d5('0x19b')],{'as':_0x09d5('0x14a'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x127')]['hasMany'](db[_0x09d5('0x7b')],{'as':'HopperFinals','foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x127')]['hasMany'](db['CmHopperHistory'],{'as':_0x09d5('0x14b'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x127')][_0x09d5('0x11b')](db[_0x09d5('0x7e')],{'as':_0x09d5('0x7e'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x127')][_0x09d5('0x11b')](db[_0x09d5('0xdc')],{'as':_0x09d5('0x14e'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x127')][_0x09d5('0x11b')](db[_0x09d5('0x64')],{'as':_0x09d5('0x19c'),'foreignKey':_0x09d5('0x16e'),'onDelete':_0x09d5('0x178')});db['CmContact'][_0x09d5('0x11b')](db[_0x09d5('0x6d')],{'as':_0x09d5('0x11f'),'foreignKey':_0x09d5('0x16e'),'onDelete':_0x09d5('0x178')});db[_0x09d5('0x127')][_0x09d5('0x11b')](db[_0x09d5('0x5a')],{'as':_0x09d5('0x19d'),'foreignKey':_0x09d5('0x16e'),'onDelete':_0x09d5('0x178')});db[_0x09d5('0x127')][_0x09d5('0x11b')](db[_0x09d5('0x50')],{'as':_0x09d5('0x12f'),'foreignKey':_0x09d5('0x16e'),'onDelete':_0x09d5('0x178')});db[_0x09d5('0x127')]['hasMany'](db[_0x09d5('0x45')],{'as':_0x09d5('0x120'),'foreignKey':_0x09d5('0x16e'),'onDelete':_0x09d5('0x178')});db[_0x09d5('0x127')][_0x09d5('0x14f')](db['CmCompany'],{'as':_0x09d5('0x19e'),'foreignKey':_0x09d5('0x19a')});db[_0x09d5('0x127')][_0x09d5('0x14f')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x09d5('0x127')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':'Users','through':_0x09d5('0x128')});db[_0x09d5('0x127')]['belongsToMany'](db['Tag'],{'as':'Tags','through':_0x09d5('0x19f')});db['CmContact'][_0x09d5('0x129')](db['Tag'],{'through':_0x09d5('0x19f'),'as':_0x09d5('0x171')});db[_0x09d5('0x19b')]['belongsTo'](db['CmContact'],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x19b')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x167'),'foreignKey':'ListId','onDelete':_0x09d5('0x117')});db[_0x09d5('0x19b')]['belongsTo'](db[_0x09d5('0x12')],{'as':'Agent','foreignKey':'UserId'});db[_0x09d5('0x19b')][_0x09d5('0x14f')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x09d5('0x149'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x19b')][_0x09d5('0x14f')](db[_0x09d5('0xec')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x09d5('0x117')});db[_0x09d5('0x19b')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x09d5('0x14c')][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopperBlack'][_0x09d5('0x14f')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x09d5('0x117')});db[_0x09d5('0x14c')]['belongsTo'](db['VoiceQueue'],{'as':_0x09d5('0x1a0'),'foreignKey':_0x09d5('0x149'),'onDelete':'cascade'});db['CmHopperBlack'][_0x09d5('0x14f')](db[_0x09d5('0xec')],{'as':_0x09d5('0xec'),'foreignKey':'CampaignId','onDelete':_0x09d5('0x117')});db[_0x09d5('0x84')]['hasMany'](db[_0x09d5('0x88')],{'as':{'plural':_0x09d5('0x1a1'),'singular':_0x09d5('0x1a2')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x09d5('0x84')]['hasMany'](db[_0x09d5('0x88')],{'as':{'plural':_0x09d5('0x1a3'),'singular':_0x09d5('0x1a4')},'foreignKey':_0x09d5('0x1a5'),'onDelete':_0x09d5('0x117'),'hooks':!![]});db['Automation'][_0x09d5('0x11b')](db[_0x09d5('0x82')],{'as':_0x09d5('0x1a6'),'foreignKey':_0x09d5('0x1a7'),'onDelete':_0x09d5('0x117'),'hooks':!![]});db[_0x09d5('0x17c')][_0x09d5('0x11b')](db['Disposition'],{'as':_0x09d5('0x17d'),'foreignKey':_0x09d5('0x1a8'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x8a')][_0x09d5('0x11b')](db['Interval'],{'as':_0x09d5('0x1a9'),'foreignKey':_0x09d5('0x152'),'onDelete':_0x09d5('0x117'),'hooks':!![],'required':![]});db['Interval'][_0x09d5('0x11b')](db[_0x09d5('0x19')],{'as':_0x09d5('0x11d'),'foreignKey':_0x09d5('0x152'),'onDelete':'restrict'});db[_0x09d5('0x8a')][_0x09d5('0x11b')](db['MailApplication'],{'as':_0x09d5('0x1aa'),'foreignKey':_0x09d5('0x152')});db[_0x09d5('0x8a')][_0x09d5('0x11b')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x09d5('0x152')});db[_0x09d5('0x8a')][_0x09d5('0x11b')](db[_0x09d5('0x4e')],{'as':_0x09d5('0x1ab'),'foreignKey':_0x09d5('0x152')});db[_0x09d5('0x8a')][_0x09d5('0x11b')](db[_0x09d5('0x188')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x09d5('0x1ac')]['belongsTo'](db[_0x09d5('0x40')],{});db[_0x09d5('0x1ac')][_0x09d5('0x14f')](db[_0x09d5('0x1ad')],{'foreignKey':_0x09d5('0x1ae')});db[_0x09d5('0x1ac')]['belongsTo'](db[_0x09d5('0x9c')],{'foreignKey':_0x09d5('0x1af')});db[_0x09d5('0x92')][_0x09d5('0x129')](db[_0x09d5('0x146')],{'as':_0x09d5('0x1b0'),'through':_0x09d5('0x148'),'onDelete':_0x09d5('0x178')});db[_0x09d5('0x16f')][_0x09d5('0x129')](db[_0x09d5('0x127')],{'through':'cm_contact_has_tags'});db[_0x09d5('0x16f')][_0x09d5('0x129')](db[_0x09d5('0x6d')],{'through':_0x09d5('0x196')});db[_0x09d5('0x16f')][_0x09d5('0x129')](db[_0x09d5('0x45')],{'through':_0x09d5('0x170')});db[_0x09d5('0x16f')][_0x09d5('0x129')](db[_0x09d5('0x5a')],{'through':'sms_interaction_has_tags'});db['Tag'][_0x09d5('0x129')](db[_0x09d5('0x50')],{'through':_0x09d5('0x182')});db[_0x09d5('0x16f')]['belongsToMany'](db[_0x09d5('0x64')],{'through':'openchannel_interaction_has_tags'});db[_0x09d5('0x16f')][_0x09d5('0x129')](db[_0x09d5('0x121')],{'through':_0x09d5('0x1b1')});db[_0x09d5('0x1b2')][_0x09d5('0x11b')](db[_0x09d5('0x88')],{'as':{'plural':_0x09d5('0x1b3'),'singular':_0x09d5('0x1b4')},'foreignKey':_0x09d5('0x1b5'),'onDelete':_0x09d5('0x117'),'hooks':!![]});db['Trigger']['hasMany'](db['Condition'],{'as':{'plural':_0x09d5('0x1b6'),'singular':_0x09d5('0x1b7')},'foreignKey':'TriggerAnyId','onDelete':_0x09d5('0x117'),'hooks':!![]});db[_0x09d5('0x1b2')][_0x09d5('0x11b')](db[_0x09d5('0x82')],{'as':_0x09d5('0x1a6'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0x09d5('0x9c')][_0x09d5('0x11b')](db[_0x09d5('0xa1')],{'as':'Fields','onDelete':_0x09d5('0x117'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x09d5('0x11b')](db[_0x09d5('0xa1')],{'as':_0x09d5('0x1b8'),'onDelete':'cascade','foreignKey':_0x09d5('0x1ae')});db[_0x09d5('0xa0')]['hasMany'](db[_0x09d5('0xa1')],{'as':_0x09d5('0x1b8'),'onDelete':'cascade','foreignKey':_0x09d5('0x1b9')});db[_0x09d5('0xa1')]['belongsTo'](db[_0x09d5('0xa0')],{'foreignKey':'MetricId'});db[_0x09d5('0xa5')][_0x09d5('0x11b')](db[_0x09d5('0xa7')],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x09d5('0x11b')](db[_0x09d5('0xa8')],{'as':_0x09d5('0x1bb'),'onDelete':'cascade','foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xa7')][_0x09d5('0x11b')](db[_0x09d5('0xa8')],{'as':_0x09d5('0x1bd'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1be')});db['SalesforceConfiguration'][_0x09d5('0x11b')](db[_0x09d5('0xa8')],{'as':_0x09d5('0x1b8'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xa7')][_0x09d5('0x14f')](db[_0x09d5('0xa5')],{'as':'Account','foreignKey':_0x09d5('0x1c0')});db['SalesforceField'][_0x09d5('0x11b')](db['SalesforceField'],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xa8')]['hasMany'](db[_0x09d5('0xa8')],{'as':_0x09d5('0x1c2'),'foreignKey':'DescriptionId'});db[_0x09d5('0xa8')][_0x09d5('0x11b')](db[_0x09d5('0xa8')],{'as':_0x09d5('0x1c3'),'foreignKey':_0x09d5('0x1bf')});db['SalesforceField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x09d5('0x1c4')});db[_0x09d5('0xa9')][_0x09d5('0x11b')](db[_0x09d5('0xab')],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1c0')});db['SugarcrmConfiguration']['hasMany'](db[_0x09d5('0xad')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x09d5('0xab')][_0x09d5('0x11b')](db[_0x09d5('0xad')],{'as':_0x09d5('0x1bd'),'onDelete':_0x09d5('0x117'),'foreignKey':'DescriptionId'});db[_0x09d5('0xab')][_0x09d5('0x11b')](db[_0x09d5('0xad')],{'as':_0x09d5('0x1b8'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xab')][_0x09d5('0x14f')](db[_0x09d5('0xa9')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xad')][_0x09d5('0x11b')](db['SugarcrmField'],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xad')][_0x09d5('0x11b')](db[_0x09d5('0xad')],{'as':'Description','foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xad')]['hasMany'](db['SugarcrmField'],{'as':_0x09d5('0x1c3'),'foreignKey':'FieldId'});db[_0x09d5('0xad')]['belongsTo'](db[_0x09d5('0x97')],{'as':_0x09d5('0x97'),'foreignKey':'VariableId'});db['DeskAccount'][_0x09d5('0x11b')](db[_0x09d5('0xb0')],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':'AccountId'});db[_0x09d5('0xb0')][_0x09d5('0x11b')](db['DeskField'],{'as':_0x09d5('0x1bb'),'onDelete':'cascade','foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xb0')][_0x09d5('0x11b')](db['DeskField'],{'as':_0x09d5('0x1bd'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xb0')]['hasMany'](db[_0x09d5('0xb2')],{'as':_0x09d5('0x1b8'),'onDelete':'cascade','foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xb0')][_0x09d5('0x14f')](db['DeskAccount'],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xb0')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x1c5')});db[_0x09d5('0xb2')][_0x09d5('0x11b')](db['DeskField'],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xb2')]['hasMany'](db[_0x09d5('0xb2')],{'as':'Description','foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xb2')][_0x09d5('0x11b')](db[_0x09d5('0xb2')],{'as':_0x09d5('0x1c3'),'foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xb2')][_0x09d5('0x14f')](db['Variable'],{'as':_0x09d5('0x97'),'foreignKey':_0x09d5('0x1c4')});db[_0x09d5('0xb3')][_0x09d5('0x11b')](db['ZohoConfiguration'],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xb5')][_0x09d5('0x11b')](db[_0x09d5('0xb6')],{'as':_0x09d5('0x1bb'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1bc')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':'Descriptions','onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xb5')]['hasMany'](db[_0x09d5('0xb6')],{'as':_0x09d5('0x1b8'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1bf')});db['ZohoConfiguration'][_0x09d5('0x14f')](db[_0x09d5('0xb3')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db['ZohoField'][_0x09d5('0x11b')](db[_0x09d5('0xb6')],{'as':'Subject','foreignKey':_0x09d5('0x1bc')});db['ZohoField'][_0x09d5('0x11b')](db[_0x09d5('0xb6')],{'as':'Description','foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xb6')][_0x09d5('0x11b')](db[_0x09d5('0xb6')],{'as':_0x09d5('0x1c3'),'foreignKey':'FieldId'});db['ZohoField'][_0x09d5('0x14f')](db[_0x09d5('0x97')],{'as':_0x09d5('0x97'),'foreignKey':_0x09d5('0x1c4')});db['ZendeskAccount'][_0x09d5('0x11b')](db['ZendeskConfiguration'],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1c0')});db['ZendeskConfiguration'][_0x09d5('0x11b')](db[_0x09d5('0xbc')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x09d5('0xba')][_0x09d5('0x11b')](db[_0x09d5('0xbc')],{'as':_0x09d5('0x1bd'),'foreignKey':'DescriptionId'});db[_0x09d5('0xba')][_0x09d5('0x11b')](db[_0x09d5('0xbc')],{'as':_0x09d5('0x1b8'),'foreignKey':'FieldId'});db[_0x09d5('0xba')][_0x09d5('0x14f')](db[_0x09d5('0xb8')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xba')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x1c6')});db[_0x09d5('0xbc')][_0x09d5('0x11b')](db[_0x09d5('0xbc')],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xbc')]['hasMany'](db[_0x09d5('0xbc')],{'as':_0x09d5('0x1c2'),'foreignKey':'DescriptionId'});db[_0x09d5('0xbc')][_0x09d5('0x11b')](db[_0x09d5('0xbc')],{'as':_0x09d5('0x1c3'),'foreignKey':_0x09d5('0x1bf')});db['ZendeskField'][_0x09d5('0x14f')](db[_0x09d5('0x97')],{'as':_0x09d5('0x97'),'foreignKey':_0x09d5('0x1c4')});db[_0x09d5('0x1c7')][_0x09d5('0x11b')](db[_0x09d5('0xbe')],{'as':_0x09d5('0x1ba'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x09d5('0xbe')]['hasMany'](db[_0x09d5('0xc0')],{'as':_0x09d5('0x1bb'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xbe')]['hasMany'](db['FreshdeskField'],{'as':_0x09d5('0x1bd'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1be')});db['FreshdeskConfiguration']['hasMany'](db[_0x09d5('0xc0')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xbe')][_0x09d5('0x14f')](db['FreshdeskAccount'],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xbe')][_0x09d5('0x129')](db['Tag'],{'through':_0x09d5('0x1c8')});db['FreshdeskField'][_0x09d5('0x11b')](db[_0x09d5('0xc0')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField']['hasMany'](db[_0x09d5('0xc0')],{'as':_0x09d5('0x1c2'),'foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xc0')][_0x09d5('0x11b')](db[_0x09d5('0xc0')],{'as':'Field','foreignKey':'FieldId'});db['FreshdeskField']['belongsTo'](db[_0x09d5('0x97')],{'as':_0x09d5('0x97'),'foreignKey':_0x09d5('0x1c4')});db[_0x09d5('0xc1')][_0x09d5('0x11b')](db['VtigerConfiguration'],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xc3')][_0x09d5('0x11b')](db['VtigerField'],{'as':_0x09d5('0x1bb'),'foreignKey':'SubjectId'});db[_0x09d5('0xc3')][_0x09d5('0x11b')](db[_0x09d5('0xc5')],{'as':_0x09d5('0x1bd'),'foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xc3')][_0x09d5('0x11b')](db[_0x09d5('0xc5')],{'as':_0x09d5('0x1b8'),'foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xc3')]['belongsTo'](db['VtigerAccount'],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db['VtigerField']['hasMany'](db[_0x09d5('0xc5')],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0xc5')]['hasMany'](db[_0x09d5('0xc5')],{'as':'Description','foreignKey':_0x09d5('0x1be')});db['VtigerField'][_0x09d5('0x11b')](db[_0x09d5('0xc5')],{'as':_0x09d5('0x1c3'),'foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xc5')][_0x09d5('0x14f')](db['Variable'],{'as':_0x09d5('0x97'),'foreignKey':'VariableId'});db[_0x09d5('0xc6')][_0x09d5('0x11b')](db[_0x09d5('0xc8')],{'as':_0x09d5('0x1ba'),'onDelete':'cascade','foreignKey':_0x09d5('0x1c0')});db['ServicenowConfiguration']['hasMany'](db[_0x09d5('0x1c9')],{'as':_0x09d5('0x1bb'),'foreignKey':'SubjectId'});db[_0x09d5('0xc8')]['hasMany'](db['ServicenowField'],{'as':_0x09d5('0x1bd'),'foreignKey':_0x09d5('0x1be')});db[_0x09d5('0xc8')][_0x09d5('0x11b')](db['ServicenowField'],{'as':_0x09d5('0x1b8'),'foreignKey':_0x09d5('0x1bf')});db[_0x09d5('0xc8')]['belongsTo'](db[_0x09d5('0xc6')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0x1c9')][_0x09d5('0x11b')](db['ServicenowField'],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db['ServicenowField'][_0x09d5('0x11b')](db[_0x09d5('0x1c9')],{'as':_0x09d5('0x1c2'),'foreignKey':_0x09d5('0x1be')});db[_0x09d5('0x1c9')][_0x09d5('0x11b')](db[_0x09d5('0x1c9')],{'as':'Field','foreignKey':_0x09d5('0x1bf')});db['ServicenowField'][_0x09d5('0x14f')](db[_0x09d5('0x97')],{'as':_0x09d5('0x97'),'foreignKey':_0x09d5('0x1c4')});db[_0x09d5('0xcb')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1c0')});db['Dynamics365Configuration'][_0x09d5('0x11b')](db['Dynamics365Field'],{'as':_0x09d5('0x1bb'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0x1ca')][_0x09d5('0x11b')](db[_0x09d5('0xce')],{'as':_0x09d5('0x1bd'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1be')});db[_0x09d5('0x1ca')][_0x09d5('0x11b')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1bf')});db['Dynamics365Configuration'][_0x09d5('0x14f')](db[_0x09d5('0xcb')],{'as':'Account','foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xce')]['hasMany'](db['Dynamics365Field'],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db['Dynamics365Field'][_0x09d5('0x11b')](db['Dynamics365Field'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x09d5('0xce')][_0x09d5('0x11b')](db['Dynamics365Field'],{'as':_0x09d5('0x1c3'),'foreignKey':'FieldId'});db[_0x09d5('0xce')][_0x09d5('0x14f')](db[_0x09d5('0x97')],{'as':'Variable','foreignKey':_0x09d5('0x1c4')});db[_0x09d5('0xcf')][_0x09d5('0x11b')](db[_0x09d5('0xd1')],{'as':_0x09d5('0x1ba'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x1c0')});db[_0x09d5('0xd1')][_0x09d5('0x11b')](db[_0x09d5('0x1cb')],{'as':_0x09d5('0x1bb'),'foreignKey':_0x09d5('0x1bc')});db['FreshsalesConfiguration'][_0x09d5('0x11b')](db[_0x09d5('0x1cb')],{'as':_0x09d5('0x1bd'),'foreignKey':'DescriptionId'});db[_0x09d5('0xd1')][_0x09d5('0x11b')](db[_0x09d5('0x1cb')],{'as':_0x09d5('0x1b8'),'foreignKey':'FieldId'});db[_0x09d5('0xd1')]['belongsTo'](db[_0x09d5('0xcf')],{'as':_0x09d5('0x16c'),'foreignKey':_0x09d5('0x1c0')});db['FreshsalesField'][_0x09d5('0x11b')](db[_0x09d5('0x1cb')],{'as':_0x09d5('0x1c1'),'foreignKey':_0x09d5('0x1bc')});db[_0x09d5('0x1cb')]['hasMany'](db['FreshsalesField'],{'as':_0x09d5('0x1c2'),'foreignKey':'DescriptionId'});db[_0x09d5('0x1cb')]['hasMany'](db[_0x09d5('0x1cb')],{'as':_0x09d5('0x1c3'),'foreignKey':'FieldId'});db[_0x09d5('0x1cb')][_0x09d5('0x14f')](db[_0x09d5('0x97')],{'as':_0x09d5('0x97'),'foreignKey':_0x09d5('0x1c4')});db[_0x09d5('0x1cc')][_0x09d5('0x14f')](db[_0x09d5('0x69')],{});db[_0x09d5('0x1cc')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x167'),'foreignKey':'ListId'});db[_0x09d5('0x1cc')]['belongsTo'](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x1cc')]['belongsTo'](db[_0x09d5('0x6d')],{});db[_0x09d5('0x1cc')][_0x09d5('0x14f')](db[_0x09d5('0x6e')],{});db[_0x09d5('0x1cc')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{});db[_0x09d5('0x1cc')][_0x09d5('0x14f')](db[_0x09d5('0x71')],{});db[_0x09d5('0xd6')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'onDelete':'cascade','foreignKey':_0x09d5('0x1cd')});db['ChatInternalMessage'][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'onDelete':'cascade','foreignKey':_0x09d5('0x1ce')});db['JscriptySessionReport'][_0x09d5('0x11b')](db[_0x09d5('0xda')],{'foreignKey':_0x09d5('0x1cf'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0xdc')][_0x09d5('0x11b')](db['JscriptyAnswerReport'],{'foreignKey':_0x09d5('0x1cf'),'onDelete':_0x09d5('0x117')});db['SmsQueueReport'][_0x09d5('0x14f')](db[_0x09d5('0x57')],{});db[_0x09d5('0xde')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x167'),'foreignKey':_0x09d5('0x168')});db['SmsQueueReport'][_0x09d5('0x14f')](db['CmContact'],{'as':_0x09d5('0x16d'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0x09d5('0x14f')](db['SmsInteraction'],{});db[_0x09d5('0xde')][_0x09d5('0x14f')](db[_0x09d5('0x5c')],{});db[_0x09d5('0xde')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{});db[_0x09d5('0xde')][_0x09d5('0x14f')](db[_0x09d5('0x5e')],{});db['JscriptyProject'][_0x09d5('0x11b')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x09d5('0xe0')][_0x09d5('0x11b')](db[_0x09d5('0xda')],{'foreignKey':'ProjectId'});db[_0x09d5('0xe0')][_0x09d5('0x11b')](db[_0x09d5('0xd8')],{'foreignKey':'ProjectId'});db[_0x09d5('0x142')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x172'),'through':'user_has_square_projects'});db[_0x09d5('0xe8')][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':'user_has_teams'});db['Team']['belongsToMany'](db[_0x09d5('0x1b')],{'through':_0x09d5('0x112'),'as':'VoiceQueues'});db[_0x09d5('0xe8')][_0x09d5('0x129')](db[_0x09d5('0x41')],{'through':'team_has_mail_queues','as':_0x09d5('0x134')});db[_0x09d5('0xe8')][_0x09d5('0x129')](db[_0x09d5('0x71')],{'through':_0x09d5('0x1d0'),'as':_0x09d5('0x135')});db[_0x09d5('0xe8')][_0x09d5('0x129')](db[_0x09d5('0x180')],{'through':'team_has_fax_queues','as':_0x09d5('0x1d1')});db[_0x09d5('0xe8')][_0x09d5('0x129')](db[_0x09d5('0x5e')],{'through':'team_has_sms_queues','as':_0x09d5('0x136')});db[_0x09d5('0xe8')][_0x09d5('0x129')](db['OpenchannelQueue'],{'through':_0x09d5('0x190'),'as':_0x09d5('0x137')});db[_0x09d5('0xe8')][_0x09d5('0x129')](db[_0x09d5('0x10e')],{'through':_0x09d5('0x1d2'),'as':'WhatsappQueues'});db[_0x09d5('0xe8')]['belongsToMany'](db[_0x09d5('0xfd')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db['Campaign']['hasMany'](db[_0x09d5('0x19b')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x09d5('0xec')][_0x09d5('0x11b')](db[_0x09d5('0x7b')],{'as':_0x09d5('0x11e'),'foreignKey':_0x09d5('0x1d3')});db[_0x09d5('0xec')]['hasMany'](db[_0x09d5('0x7c')],{'as':'HopperHistories','foreignKey':_0x09d5('0x1d3')});db[_0x09d5('0xec')][_0x09d5('0x11b')](db[_0x09d5('0x14c')],{'as':_0x09d5('0x14d'),'foreignKey':_0x09d5('0x1d3')});db[_0x09d5('0xec')][_0x09d5('0x14f')](db[_0x09d5('0x150')],{'as':_0x09d5('0x150'),'foreignKey':_0x09d5('0x1d4')});db[_0x09d5('0xec')][_0x09d5('0x14f')](db[_0x09d5('0x150')],{'as':_0x09d5('0x1d5'),'foreignKey':_0x09d5('0x151')});db[_0x09d5('0xec')]['belongsTo'](db[_0x09d5('0x8a')],{'as':_0x09d5('0x8a'),'foreignKey':_0x09d5('0x152')});db[_0x09d5('0xec')][_0x09d5('0x14f')](db[_0x09d5('0x142')],{'as':'SquareProject','foreignKey':_0x09d5('0x1d6')});db[_0x09d5('0xec')][_0x09d5('0x129')](db[_0x09d5('0xfb')],{'as':_0x09d5('0x12a'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x09d5('0x129')](db['CmList'],{'as':_0x09d5('0x159'),'through':_0x09d5('0x1d7')});db[_0x09d5('0xf0')][_0x09d5('0x14f')](db[_0x09d5('0x176')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x09d5('0xf4')][_0x09d5('0x14f')](db[_0x09d5('0x16b')],{});db[_0x09d5('0xf4')][_0x09d5('0x14f')](db[_0x09d5('0x45')],{});db[_0x09d5('0xf4')][_0x09d5('0x14f')](db['MailAccount'],{'foreignKey':_0x09d5('0x1d8'),'as':_0x09d5('0x1d9')});db[_0x09d5('0xf4')]['belongsTo'](db['User'],{'foreignKey':_0x09d5('0x1da'),'as':_0x09d5('0x1db')});db[_0x09d5('0xf4')][_0x09d5('0x14f')](db['User'],{'foreignKey':_0x09d5('0x1dc'),'as':'ToAgent'});db['MailTransferReport'][_0x09d5('0x14f')](db[_0x09d5('0x41')],{'foreignKey':_0x09d5('0x1dd'),'as':_0x09d5('0x1de')});db[_0x09d5('0xf4')]['belongsTo'](db[_0x09d5('0x40')],{'foreignKey':'ToMailAccountId','as':_0x09d5('0x1df')});db[_0x09d5('0x1e0')][_0x09d5('0x14f')](db[_0x09d5('0x6e')],{});db[_0x09d5('0x1e0')][_0x09d5('0x14f')](db['ChatInteraction'],{});db[_0x09d5('0x1e0')][_0x09d5('0x14f')](db[_0x09d5('0x69')],{'foreignKey':_0x09d5('0x1e1'),'as':_0x09d5('0x1d9')});db[_0x09d5('0x1e0')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'foreignKey':_0x09d5('0x1da'),'as':'FromAgent'});db[_0x09d5('0x1e0')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'foreignKey':_0x09d5('0x1dc'),'as':_0x09d5('0x1e2')});db[_0x09d5('0x1e0')][_0x09d5('0x14f')](db[_0x09d5('0x71')],{'foreignKey':_0x09d5('0x1e3'),'as':_0x09d5('0x1de')});db['ChatTransferReport'][_0x09d5('0x14f')](db['ChatWebsite'],{'foreignKey':_0x09d5('0x1e4'),'as':_0x09d5('0x1df')});db[_0x09d5('0xf7')][_0x09d5('0x14f')](db['FaxMessage'],{});db[_0x09d5('0xf7')][_0x09d5('0x14f')](db[_0x09d5('0x50')],{});db[_0x09d5('0xf7')]['belongsTo'](db[_0x09d5('0x13a')],{'foreignKey':_0x09d5('0x1e5'),'as':_0x09d5('0x1d9')});db[_0x09d5('0xf7')]['belongsTo'](db[_0x09d5('0x12')],{'foreignKey':_0x09d5('0x1da'),'as':_0x09d5('0x1db')});db[_0x09d5('0xf7')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'foreignKey':_0x09d5('0x1dc'),'as':_0x09d5('0x1e2')});db[_0x09d5('0xf7')][_0x09d5('0x14f')](db['FaxQueue'],{'foreignKey':_0x09d5('0x1e6'),'as':_0x09d5('0x1de')});db[_0x09d5('0xf7')][_0x09d5('0x14f')](db[_0x09d5('0x13a')],{'foreignKey':'ToFaxAccountId','as':_0x09d5('0x1df')});db[_0x09d5('0xf8')][_0x09d5('0x14f')](db[_0x09d5('0x66')],{});db[_0x09d5('0xf8')][_0x09d5('0x14f')](db[_0x09d5('0x64')],{});db[_0x09d5('0xf8')][_0x09d5('0x14f')](db[_0x09d5('0x60')],{'foreignKey':_0x09d5('0x1e7'),'as':_0x09d5('0x1d9')});db[_0x09d5('0xf8')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'foreignKey':_0x09d5('0x1da'),'as':_0x09d5('0x1db')});db[_0x09d5('0xf8')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'foreignKey':_0x09d5('0x1dc'),'as':_0x09d5('0x1e2')});db[_0x09d5('0xf8')][_0x09d5('0x14f')](db[_0x09d5('0x68')],{'foreignKey':_0x09d5('0x1e8'),'as':_0x09d5('0x1de')});db[_0x09d5('0xf8')][_0x09d5('0x14f')](db[_0x09d5('0x60')],{'foreignKey':'ToOpenchannelAccountId','as':_0x09d5('0x1df')});db['SmsTransferReport'][_0x09d5('0x14f')](db[_0x09d5('0x5c')],{});db['SmsTransferReport'][_0x09d5('0x14f')](db[_0x09d5('0x5a')],{});db[_0x09d5('0xf9')][_0x09d5('0x14f')](db[_0x09d5('0x57')],{'foreignKey':_0x09d5('0x1e9'),'as':_0x09d5('0x1d9')});db['SmsTransferReport'][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'foreignKey':'FromUserId','as':_0x09d5('0x1db')});db[_0x09d5('0xf9')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'foreignKey':_0x09d5('0x1dc'),'as':_0x09d5('0x1e2')});db[_0x09d5('0xf9')]['belongsTo'](db[_0x09d5('0x5e')],{'foreignKey':_0x09d5('0x1ea'),'as':_0x09d5('0x1de')});db[_0x09d5('0xf9')][_0x09d5('0x14f')](db[_0x09d5('0x57')],{'foreignKey':'ToSmsAccountId','as':_0x09d5('0x1df')});db[_0x09d5('0xfb')]['hasMany'](db[_0x09d5('0x17c')],{'as':_0x09d5('0x17d'),'foreignKey':_0x09d5('0x168'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0xfb')]['hasMany'](db[_0x09d5('0x80')],{'as':_0x09d5('0x1eb'),'foreignKey':'ListId'});db[_0x09d5('0xfb')][_0x09d5('0x11b')](db[_0x09d5('0x127')],{'as':_0x09d5('0x199'),'onDelete':_0x09d5('0x117'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0xfb')][_0x09d5('0x11b')](db[_0x09d5('0x7b')],{'as':_0x09d5('0x11e'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0xfb')][_0x09d5('0x11b')](db[_0x09d5('0x7c')],{'as':_0x09d5('0x1ec'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0xfb')][_0x09d5('0x11b')](db[_0x09d5('0x7e')],{'as':_0x09d5('0x7e'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0xfb')]['belongsToMany'](db['VoiceQueue'],{'as':_0x09d5('0x1ed'),'through':_0x09d5('0x156')});db[_0x09d5('0xfb')]['belongsToMany'](db['User'],{'as':'Agents','through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x09d5('0x19')],{'as':_0x09d5('0x11d'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0xfd')]['belongsToMany'](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':_0x09d5('0x133')});db[_0x09d5('0xfd')][_0x09d5('0x129')](db['Team'],{'through':_0x09d5('0x1ee'),'as':_0x09d5('0x158')});db[_0x09d5('0xff')][_0x09d5('0x11b')](db[_0x09d5('0x12')],{'as':_0x09d5('0x172'),'foreignKey':_0x09d5('0x1ef')});db[_0x09d5('0xff')]['hasMany'](db['UserProfileSection'],{'as':_0x09d5('0x1f0'),'foreignKey':_0x09d5('0x1ef'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x101')]['hasMany'](db[_0x09d5('0x1f1')],{'as':_0x09d5('0x1f2'),'foreignKey':'sectionId','onDelete':_0x09d5('0x117')});db[_0x09d5('0x105')][_0x09d5('0x11b')](db[_0x09d5('0x17c')],{'as':_0x09d5('0x17d'),'foreignKey':_0x09d5('0x1f3'),'onDelete':_0x09d5('0x117')});db[_0x09d5('0x105')][_0x09d5('0x11b')](db[_0x09d5('0x85')],{'as':_0x09d5('0x165'),'foreignKey':_0x09d5('0x1f3')});db['WhatsappAccount'][_0x09d5('0x11b')](db['WhatsappMessage'],{'as':_0x09d5('0x15b'),'foreignKey':_0x09d5('0x1f3')});db[_0x09d5('0x105')]['hasMany'](db[_0x09d5('0x121')],{'as':_0x09d5('0x166')});db[_0x09d5('0x105')][_0x09d5('0x11b')](db[_0x09d5('0x107')],{'as':_0x09d5('0x145')});db[_0x09d5('0x105')][_0x09d5('0x14f')](db['CmList'],{'as':_0x09d5('0x167'),'foreignKey':_0x09d5('0x168')});db[_0x09d5('0x105')][_0x09d5('0x14f')](db[_0x09d5('0x153')],{'as':_0x09d5('0x154'),'foreignKey':_0x09d5('0x155')});db[_0x09d5('0x105')][_0x09d5('0x129')](db['User'],{'as':_0x09d5('0x157'),'through':_0x09d5('0x1f4')});db[_0x09d5('0x107')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x107')]['belongsTo'](db[_0x09d5('0x10e')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x107')][_0x09d5('0x14f')](db[_0x09d5('0x105')],{'onDelete':_0x09d5('0x178')});db[_0x09d5('0x107')][_0x09d5('0x14f')](db[_0x09d5('0x8a')],{'onDelete':_0x09d5('0x178'),'foreignKey':_0x09d5('0x152')});db['WhatsappApplication'][_0x09d5('0x14f')](db['Tag'],{'onDelete':_0x09d5('0x178'),'foreignKey':'TagId'});db[_0x09d5('0x121')][_0x09d5('0x11b')](db[_0x09d5('0x10a')],{'as':_0x09d5('0x15b'),'onDelete':'cascade','foreignKey':_0x09d5('0x1f5')});db[_0x09d5('0x121')][_0x09d5('0x14f')](db[_0x09d5('0x105')],{'as':'Account','foreignKey':_0x09d5('0x1f3')});db[_0x09d5('0x121')][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':'Contact','foreignKey':'ContactId'});db[_0x09d5('0x121')]['belongsTo'](db[_0x09d5('0x12')],{'as':_0x09d5('0x181'),'foreignKey':_0x09d5('0x118')});db[_0x09d5('0x121')][_0x09d5('0x129')](db[_0x09d5('0x16f')],{'through':_0x09d5('0x1b1'),'as':_0x09d5('0x183')});db[_0x09d5('0x121')]['belongsToMany'](db[_0x09d5('0x16f')],{'through':_0x09d5('0x1b1'),'as':_0x09d5('0x171')});db['WhatsappInteraction'][_0x09d5('0x129')](db[_0x09d5('0x12')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x09d5('0x1f5')});db[_0x09d5('0x10a')][_0x09d5('0x14f')](db[_0x09d5('0x12')],{'as':'User'});db['WhatsappMessage']['belongsTo'](db[_0x09d5('0x127')],{'onDelete':_0x09d5('0x117'),'as':'Contact'});db['WhatsappMessage']['belongsTo'](db[_0x09d5('0x121')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x09d5('0x1f5')});db['WhatsappMessage'][_0x09d5('0x14f')](db[_0x09d5('0x105')],{'as':_0x09d5('0x16c'),'foreignKey':'WhatsappAccountId'});db[_0x09d5('0x10c')][_0x09d5('0x14f')](db['WhatsappAccount'],{});db[_0x09d5('0x10c')][_0x09d5('0x14f')](db[_0x09d5('0xfb')],{'as':'List','foreignKey':_0x09d5('0x168')});db['WhatsappQueueReport'][_0x09d5('0x14f')](db[_0x09d5('0x127')],{'as':_0x09d5('0x16d'),'foreignKey':_0x09d5('0x16e')});db[_0x09d5('0x10c')]['belongsTo'](db[_0x09d5('0x121')],{});db[_0x09d5('0x10c')][_0x09d5('0x14f')](db[_0x09d5('0x10e')],{});db[_0x09d5('0x10c')][_0x09d5('0x14f')](db[_0x09d5('0x10a')],{});db['WhatsappQueueReport'][_0x09d5('0x14f')](db[_0x09d5('0x12')],{});db[_0x09d5('0x1f6')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappInteraction'],{});db[_0x09d5('0x1f6')][_0x09d5('0x14f')](db[_0x09d5('0x105')],{'foreignKey':_0x09d5('0x1f7'),'as':_0x09d5('0x1d9')});db[_0x09d5('0x1f6')][_0x09d5('0x14f')](db[_0x09d5('0x105')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x09d5('0x1f6')][_0x09d5('0x14f')](db[_0x09d5('0x10e')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0x09d5('0x1f6')]['belongsTo'](db['User'],{'foreignKey':_0x09d5('0x1da'),'as':_0x09d5('0x1db')});db[_0x09d5('0x1f6')][_0x09d5('0x14f')](db['User'],{'foreignKey':_0x09d5('0x1dc'),'as':'ToAgent'});db[_0x09d5('0x10e')]['belongsToMany'](db[_0x09d5('0x12')],{'as':_0x09d5('0x157'),'through':_0x09d5('0x3b'),'foreignKey':_0x09d5('0x1f8')});db[_0x09d5('0x10e')][_0x09d5('0x129')](db['Team'],{'through':_0x09d5('0x1d2'),'as':_0x09d5('0x158')});db[_0x09d5('0x119')]['belongsTo'](db['User'],{'as':_0x09d5('0x1f9'),'foreignKey':'UserId','onDelete':_0x09d5('0x117'),'hooks':!![]});module[_0x09d5('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index b0fd054..6afb52e 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacc7=['/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/demo','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelQueue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./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'];(function(_0x1c12c2,_0x1b5446){var _0x3ba2c7=function(_0x1b0119){while(--_0x1b0119){_0x1c12c2['push'](_0x1c12c2['shift']());}};_0x3ba2c7(++_0x1b5446);}(_0xacc7,0x7a));var _0x7acc=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0xacc7[_0x21d0c3];return _0x4df18e;};'use strict';var path=require(_0x7acc('0x0'));var express=require(_0x7acc('0x1'));var errors=require('./errors');var config=require(_0x7acc('0x2'));var setupLoggers=require(_0x7acc('0x3'))[_0x7acc('0x4')];var clientSideLogs=require(_0x7acc('0x5'));exports['default']=function(_0x119187){return setupLoggers(_0x119187)[_0x7acc('0x6')](function(){_0x119187[_0x7acc('0x7')](_0x7acc('0x8'),require(_0x7acc('0x9')));_0x119187['use']('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x119187[_0x7acc('0x7')](_0x7acc('0xa'),require(_0x7acc('0xb')));_0x119187['use'](_0x7acc('0xc'),require(_0x7acc('0xd')));_0x119187[_0x7acc('0x7')](_0x7acc('0xe'),require(_0x7acc('0xf')));_0x119187[_0x7acc('0x7')](_0x7acc('0x10'),require('./api/voiceQueue'));_0x119187[_0x7acc('0x7')](_0x7acc('0x11'),require(_0x7acc('0x12')));_0x119187[_0x7acc('0x7')](_0x7acc('0x13'),require(_0x7acc('0x14')));_0x119187['use'](_0x7acc('0x15'),require(_0x7acc('0x16')));_0x119187[_0x7acc('0x7')](_0x7acc('0x17'),require(_0x7acc('0x18')));_0x119187[_0x7acc('0x7')]('/api/voice/calls/reports',require(_0x7acc('0x19')));_0x119187['use'](_0x7acc('0x1a'),require(_0x7acc('0x1b')));_0x119187[_0x7acc('0x7')](_0x7acc('0x1c'),require(_0x7acc('0x1d')));_0x119187[_0x7acc('0x7')](_0x7acc('0x1e'),require(_0x7acc('0x1f')));_0x119187[_0x7acc('0x7')](_0x7acc('0x20'),require('./api/memberReport'));_0x119187[_0x7acc('0x7')](_0x7acc('0x21'),require(_0x7acc('0x22')));_0x119187[_0x7acc('0x7')](_0x7acc('0x23'),require(_0x7acc('0x24')));_0x119187[_0x7acc('0x7')](_0x7acc('0x25'),require('./api/mailServerOut'));_0x119187[_0x7acc('0x7')](_0x7acc('0x26'),require(_0x7acc('0x27')));_0x119187[_0x7acc('0x7')]('/api/mail/queues',require(_0x7acc('0x28')));_0x119187[_0x7acc('0x7')](_0x7acc('0x29'),require(_0x7acc('0x2a')));_0x119187[_0x7acc('0x7')]('/api/mail/interactions',require('./api/mailInteraction'));_0x119187['use'](_0x7acc('0x2b'),require(_0x7acc('0x2c')));_0x119187[_0x7acc('0x7')]('/api/mail/applications',require(_0x7acc('0x2d')));_0x119187[_0x7acc('0x7')](_0x7acc('0x2e'),require(_0x7acc('0x2f')));_0x119187['use'](_0x7acc('0x30'),require(_0x7acc('0x31')));_0x119187[_0x7acc('0x7')](_0x7acc('0x32'),require(_0x7acc('0x33')));_0x119187[_0x7acc('0x7')](_0x7acc('0x34'),require('./api/faxAccount'));_0x119187[_0x7acc('0x7')]('/api/fax/applications',require(_0x7acc('0x35')));_0x119187[_0x7acc('0x7')]('/api/fax/interactions',require(_0x7acc('0x36')));_0x119187[_0x7acc('0x7')]('/api/fax/messages',require(_0x7acc('0x37')));_0x119187['use'](_0x7acc('0x38'),require(_0x7acc('0x39')));_0x119187[_0x7acc('0x7')]('/api/fax/reports/queue',require(_0x7acc('0x3a')));_0x119187[_0x7acc('0x7')]('/api/sms/accounts',require('./api/smsAccount'));_0x119187[_0x7acc('0x7')](_0x7acc('0x3b'),require(_0x7acc('0x3c')));_0x119187['use'](_0x7acc('0x3d'),require(_0x7acc('0x3e')));_0x119187[_0x7acc('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x119187[_0x7acc('0x7')](_0x7acc('0x3f'),require(_0x7acc('0x40')));_0x119187['use']('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x119187['use'](_0x7acc('0x41'),require(_0x7acc('0x42')));_0x119187[_0x7acc('0x7')]('/api/openchannel/interactions',require(_0x7acc('0x43')));_0x119187['use'](_0x7acc('0x44'),require('./api/openchannelMessage'));_0x119187[_0x7acc('0x7')]('/api/openchannel/queues',require(_0x7acc('0x45')));_0x119187[_0x7acc('0x7')]('/api/chat/websites',require('./api/chatWebsite'));_0x119187[_0x7acc('0x7')]('/api/openchannel/reports/queue',require(_0x7acc('0x46')));_0x119187[_0x7acc('0x7')]('/api/chat/applications',require(_0x7acc('0x47')));_0x119187[_0x7acc('0x7')](_0x7acc('0x48'),require(_0x7acc('0x49')));_0x119187[_0x7acc('0x7')](_0x7acc('0x4a'),require(_0x7acc('0x4b')));_0x119187[_0x7acc('0x7')](_0x7acc('0x4c'),require(_0x7acc('0x4d')));_0x119187[_0x7acc('0x7')]('/api/chat/queues',require(_0x7acc('0x4e')));_0x119187[_0x7acc('0x7')](_0x7acc('0x4f'),require('./api/chatGroup'));_0x119187[_0x7acc('0x7')](_0x7acc('0x50'),require('./api/chatProactiveAction'));_0x119187[_0x7acc('0x7')](_0x7acc('0x51'),require(_0x7acc('0x52')));_0x119187[_0x7acc('0x7')](_0x7acc('0x53'),require(_0x7acc('0x54')));_0x119187[_0x7acc('0x7')](_0x7acc('0x55'),require(_0x7acc('0x56')));_0x119187[_0x7acc('0x7')](_0x7acc('0x57'),require(_0x7acc('0x58')));_0x119187[_0x7acc('0x7')](_0x7acc('0x59'),require('./api/cmHopperFinal'));_0x119187[_0x7acc('0x7')](_0x7acc('0x5a'),require(_0x7acc('0x5b')));_0x119187[_0x7acc('0x7')](_0x7acc('0x5c'),require('./api/cmCustomField'));_0x119187[_0x7acc('0x7')](_0x7acc('0x5d'),require('./api/action'));_0x119187[_0x7acc('0x7')](_0x7acc('0x5e'),require(_0x7acc('0x5f')));_0x119187['use'](_0x7acc('0x60'),require(_0x7acc('0x61')));_0x119187[_0x7acc('0x7')](_0x7acc('0x62'),require('./api/disposition'));_0x119187[_0x7acc('0x7')](_0x7acc('0x63'),require('./api/condition'));_0x119187['use']('/api/intervals',require('./api/interval'));_0x119187[_0x7acc('0x7')]('/api/pauses',require('./api/pause'));_0x119187[_0x7acc('0x7')](_0x7acc('0x64'),require(_0x7acc('0x65')));_0x119187[_0x7acc('0x7')](_0x7acc('0x66'),require(_0x7acc('0x67')));_0x119187[_0x7acc('0x7')](_0x7acc('0x68'),require(_0x7acc('0x69')));_0x119187[_0x7acc('0x7')](_0x7acc('0x6a'),require(_0x7acc('0x6b')));_0x119187[_0x7acc('0x7')](_0x7acc('0x6c'),require(_0x7acc('0x6d')));_0x119187['use'](_0x7acc('0x6e'),require(_0x7acc('0x6f')));_0x119187[_0x7acc('0x7')](_0x7acc('0x70'),require('./api/trigger'));_0x119187['use']('/api/variables',require(_0x7acc('0x71')));_0x119187['use'](_0x7acc('0x72'),require(_0x7acc('0x73')));_0x119187[_0x7acc('0x7')](_0x7acc('0x74'),require('./api/integrationReport'));_0x119187[_0x7acc('0x7')](_0x7acc('0x75'),require('./api/analyticCustomReport'));_0x119187[_0x7acc('0x7')](_0x7acc('0x76'),require('./api/analyticDefaultReport'));_0x119187[_0x7acc('0x7')](_0x7acc('0x77'),require('./api/analyticExtractedReport'));_0x119187['use'](_0x7acc('0x78'),require(_0x7acc('0x79')));_0x119187[_0x7acc('0x7')](_0x7acc('0x7a'),require(_0x7acc('0x7b')));_0x119187['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x119187[_0x7acc('0x7')](_0x7acc('0x7c'),require(_0x7acc('0x7d')));_0x119187[_0x7acc('0x7')](_0x7acc('0x7e'),require(_0x7acc('0x7f')));_0x119187['use'](_0x7acc('0x80'),require(_0x7acc('0x81')));_0x119187[_0x7acc('0x7')](_0x7acc('0x82'),require(_0x7acc('0x83')));_0x119187['use'](_0x7acc('0x84'),require(_0x7acc('0x85')));_0x119187[_0x7acc('0x7')](_0x7acc('0x86'),require(_0x7acc('0x87')));_0x119187[_0x7acc('0x7')](_0x7acc('0x88'),require('./api/intDeskAccount'));_0x119187[_0x7acc('0x7')](_0x7acc('0x89'),require('./api/intDeskConfiguration'));_0x119187[_0x7acc('0x7')]('/api/integrations/desk/fields',require(_0x7acc('0x8a')));_0x119187['use'](_0x7acc('0x8b'),require(_0x7acc('0x8c')));_0x119187[_0x7acc('0x7')](_0x7acc('0x8d'),require(_0x7acc('0x8e')));_0x119187[_0x7acc('0x7')](_0x7acc('0x8f'),require(_0x7acc('0x90')));_0x119187[_0x7acc('0x7')](_0x7acc('0x91'),require(_0x7acc('0x92')));_0x119187[_0x7acc('0x7')](_0x7acc('0x93'),require('./api/intZendeskConfiguration'));_0x119187['use'](_0x7acc('0x94'),require(_0x7acc('0x95')));_0x119187[_0x7acc('0x7')](_0x7acc('0x96'),require(_0x7acc('0x97')));_0x119187[_0x7acc('0x7')](_0x7acc('0x98'),require(_0x7acc('0x99')));_0x119187[_0x7acc('0x7')](_0x7acc('0x9a'),require(_0x7acc('0x9b')));_0x119187[_0x7acc('0x7')](_0x7acc('0x9c'),require(_0x7acc('0x9d')));_0x119187[_0x7acc('0x7')](_0x7acc('0x9e'),require(_0x7acc('0x9f')));_0x119187[_0x7acc('0x7')](_0x7acc('0xa0'),require(_0x7acc('0xa1')));_0x119187['use'](_0x7acc('0xa2'),require(_0x7acc('0xa3')));_0x119187[_0x7acc('0x7')](_0x7acc('0xa4'),require(_0x7acc('0xa5')));_0x119187['use'](_0x7acc('0xa6'),require(_0x7acc('0xa7')));_0x119187['use'](_0x7acc('0xa8'),require(_0x7acc('0xa9')));_0x119187['use'](_0x7acc('0xaa'),require(_0x7acc('0xab')));_0x119187['use']('/api/integrations/dynamics365/fields',require(_0x7acc('0xac')));_0x119187[_0x7acc('0x7')](_0x7acc('0xad'),require('./api/intFreshsalesAccount'));_0x119187[_0x7acc('0x7')](_0x7acc('0xae'),require(_0x7acc('0xaf')));_0x119187['use']('/api/integrations/freshsales/fields',require(_0x7acc('0xb0')));_0x119187['use'](_0x7acc('0xb1'),require('./api/network'));_0x119187[_0x7acc('0x7')](_0x7acc('0xb2'),require(_0x7acc('0xb3')));_0x119187['use']('/api/chat/internal/messages',require(_0x7acc('0xb4')));_0x119187[_0x7acc('0x7')](_0x7acc('0xb5'),require('./api/jscriptyAnswerReport'));_0x119187['use'](_0x7acc('0xb6'),require(_0x7acc('0xb7')));_0x119187[_0x7acc('0x7')](_0x7acc('0xb8'),require(_0x7acc('0xb9')));_0x119187[_0x7acc('0x7')]('/api/sms/reports/queue',require(_0x7acc('0xba')));_0x119187[_0x7acc('0x7')](_0x7acc('0xbb'),require(_0x7acc('0xbc')));_0x119187[_0x7acc('0x7')](_0x7acc('0xbd'),require(_0x7acc('0xbe')));_0x119187[_0x7acc('0x7')](_0x7acc('0xbf'),require('./api/jscriptyProject'));_0x119187['use'](_0x7acc('0xc0'),require('./api/setting'));_0x119187[_0x7acc('0x7')](_0x7acc('0xc1'),require('./api/squareOdbc'));_0x119187[_0x7acc('0x7')](_0x7acc('0xc2'),require(_0x7acc('0xc3')));_0x119187[_0x7acc('0x7')]('/api/square/recordings',require(_0x7acc('0xc4')));_0x119187['use'](_0x7acc('0xc5'),require(_0x7acc('0xc6')));_0x119187['use'](_0x7acc('0xc7'),require('./api/team'));_0x119187[_0x7acc('0x7')]('/api/license',require(_0x7acc('0xc8')));_0x119187[_0x7acc('0x7')](_0x7acc('0xc9'),require(_0x7acc('0xca')));_0x119187[_0x7acc('0x7')](_0x7acc('0xcb'),require(_0x7acc('0xcc')));_0x119187[_0x7acc('0x7')](_0x7acc('0xcd'),require(_0x7acc('0xce')));_0x119187[_0x7acc('0x7')]('/api/plugins',require(_0x7acc('0xcf')));_0x119187[_0x7acc('0x7')](_0x7acc('0xd0'),require(_0x7acc('0xd1')));_0x119187[_0x7acc('0x7')](_0x7acc('0xd2'),require(_0x7acc('0xd3')));_0x119187[_0x7acc('0x7')](_0x7acc('0xd4'),require('./api/faxTransferReport'));_0x119187[_0x7acc('0x7')](_0x7acc('0xd5'),require(_0x7acc('0xd6')));_0x119187['use'](_0x7acc('0xd7'),require('./api/smsTransferReport'));_0x119187[_0x7acc('0x7')]('/api/cm/lists',require(_0x7acc('0xd8')));_0x119187['use'](_0x7acc('0xd9'),require(_0x7acc('0xda')));_0x119187[_0x7acc('0x7')]('/api/userProfiles',require(_0x7acc('0xdb')));_0x119187[_0x7acc('0x7')](_0x7acc('0xdc'),require(_0x7acc('0xdd')));_0x119187[_0x7acc('0x7')](_0x7acc('0xde'),require('./api/userProfileResource'));_0x119187['use'](_0x7acc('0xdf'),require(_0x7acc('0xe0')));_0x119187[_0x7acc('0x7')]('/api/whatsapp/accounts',require(_0x7acc('0xe1')));_0x119187[_0x7acc('0x7')](_0x7acc('0xe2'),require(_0x7acc('0xe3')));_0x119187[_0x7acc('0x7')](_0x7acc('0xe4'),require(_0x7acc('0xe5')));_0x119187[_0x7acc('0x7')](_0x7acc('0xe6'),require(_0x7acc('0xe7')));_0x119187[_0x7acc('0x7')](_0x7acc('0xe8'),require(_0x7acc('0xe9')));_0x119187[_0x7acc('0x7')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x119187[_0x7acc('0x7')]('/api/whatsapp/queues',require(_0x7acc('0xea')));_0x119187[_0x7acc('0x7')](_0x7acc('0xeb'),require(_0x7acc('0xec')));_0x119187[_0x7acc('0x7')]('/api/realtime',require(_0x7acc('0xed')));_0x119187[_0x7acc('0x7')](_0x7acc('0xee'),require(_0x7acc('0xef')));_0x119187[_0x7acc('0x7')](_0x7acc('0xf0'),require(_0x7acc('0xf1')));_0x119187[_0x7acc('0x7')](_0x7acc('0xf2'),require(_0x7acc('0xf3')));_0x119187['use'](_0x7acc('0xf4'),require('./api/jira'));_0x119187[_0x7acc('0x7')](_0x7acc('0xf5'),require(_0x7acc('0xf6')));_0x119187[_0x7acc('0x7')](_0x7acc('0xf7'),require(_0x7acc('0xf8')));_0x119187[_0x7acc('0x7')](_0x7acc('0xf9'),require(_0x7acc('0xfa')));_0x119187['use'](_0x7acc('0xfb'),require(_0x7acc('0xfc')));_0x119187[_0x7acc('0x7')](_0x7acc('0xfd'),require('./api/webbar'));_0x119187[_0x7acc('0x7')](_0x7acc('0xfe'),clientSideLogs);_0x119187[_0x7acc('0x7')](_0x7acc('0xff'),express[_0x7acc('0x100')](path[_0x7acc('0x101')](config[_0x7acc('0x102')],'/apidoc')));_0x119187[_0x7acc('0x7')]('/www',express[_0x7acc('0x100')](path['join'](config['root'],'/www')));_0x119187[_0x7acc('0x7')](_0x7acc('0x103'),express[_0x7acc('0x100')](path[_0x7acc('0x101')](config['root'],_0x7acc('0x103'))));_0x119187['use']('/snippet',express[_0x7acc('0x100')](path[_0x7acc('0x101')](config['root'],_0x7acc('0x104'),_0x7acc('0x105'))));_0x119187[_0x7acc('0x7')](_0x7acc('0x106'),express['static'](path['join'](config[_0x7acc('0x102')],'/server/files/plugins')));_0x119187[_0x7acc('0x107')](_0x7acc('0x108'))[_0x7acc('0x109')](errors[0x194]);_0x119187[_0x7acc('0x107')]('/*')[_0x7acc('0x109')](function(_0x4c036c,_0x8bbdfb){_0x8bbdfb[_0x7acc('0x10a')](path[_0x7acc('0x10b')](_0x119187[_0x7acc('0x109')](_0x7acc('0x10c'))+_0x7acc('0x10d')));});return _0x119187;});}; \ No newline at end of file +var _0x1633=['./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','./api/pause','/api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/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/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelInteraction'];(function(_0xbfc3,_0x5a7857){var _0xbfef4c=function(_0x4a3c46){while(--_0x4a3c46){_0xbfc3['push'](_0xbfc3['shift']());}};_0xbfef4c(++_0x5a7857);}(_0x1633,0x1e4));var _0x3163=function(_0x1504b8,_0x48980d){_0x1504b8=_0x1504b8-0x0;var _0x1b2f16=_0x1633[_0x1504b8];return _0x1b2f16;};'use strict';var path=require(_0x3163('0x0'));var express=require(_0x3163('0x1'));var errors=require(_0x3163('0x2'));var config=require(_0x3163('0x3'));var setupLoggers=require(_0x3163('0x4'))['setupLoggers'];var clientSideLogs=require(_0x3163('0x5'));exports[_0x3163('0x6')]=function(_0xe2599){return setupLoggers(_0xe2599)[_0x3163('0x7')](function(){_0xe2599[_0x3163('0x8')](_0x3163('0x9'),require(_0x3163('0xa')));_0xe2599[_0x3163('0x8')](_0x3163('0xb'),require(_0x3163('0xc')));_0xe2599[_0x3163('0x8')](_0x3163('0xd'),require(_0x3163('0xe')));_0xe2599[_0x3163('0x8')](_0x3163('0xf'),require(_0x3163('0x10')));_0xe2599[_0x3163('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0xe2599[_0x3163('0x8')]('/api/voice/queues',require(_0x3163('0x11')));_0xe2599[_0x3163('0x8')]('/api/voice/recordings',require(_0x3163('0x12')));_0xe2599[_0x3163('0x8')](_0x3163('0x13'),require('./api/screenRecording'));_0xe2599[_0x3163('0x8')](_0x3163('0x14'),require(_0x3163('0x15')));_0xe2599[_0x3163('0x8')](_0x3163('0x16'),require('./api/voiceMailMessage'));_0xe2599[_0x3163('0x8')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0xe2599[_0x3163('0x8')](_0x3163('0x17'),require(_0x3163('0x18')));_0xe2599[_0x3163('0x8')](_0x3163('0x19'),require('./api/voiceAgentReport'));_0xe2599[_0x3163('0x8')](_0x3163('0x1a'),require(_0x3163('0x1b')));_0xe2599[_0x3163('0x8')](_0x3163('0x1c'),require('./api/memberReport'));_0xe2599[_0x3163('0x8')](_0x3163('0x1d'),require(_0x3163('0x1e')));_0xe2599[_0x3163('0x8')](_0x3163('0x1f'),require(_0x3163('0x20')));_0xe2599[_0x3163('0x8')]('/api/mail/out_servers',require(_0x3163('0x21')));_0xe2599[_0x3163('0x8')](_0x3163('0x22'),require(_0x3163('0x23')));_0xe2599['use'](_0x3163('0x24'),require(_0x3163('0x25')));_0xe2599['use']('/api/mail/substatuses',require(_0x3163('0x26')));_0xe2599[_0x3163('0x8')](_0x3163('0x27'),require(_0x3163('0x28')));_0xe2599['use'](_0x3163('0x29'),require(_0x3163('0x2a')));_0xe2599[_0x3163('0x8')](_0x3163('0x2b'),require('./api/mailApplication'));_0xe2599['use']('/api/mail/reports/queue',require(_0x3163('0x2c')));_0xe2599[_0x3163('0x8')](_0x3163('0x2d'),require(_0x3163('0x2e')));_0xe2599[_0x3163('0x8')](_0x3163('0x2f'),require(_0x3163('0x30')));_0xe2599['use'](_0x3163('0x31'),require(_0x3163('0x32')));_0xe2599[_0x3163('0x8')](_0x3163('0x33'),require('./api/faxApplication'));_0xe2599[_0x3163('0x8')](_0x3163('0x34'),require('./api/faxInteraction'));_0xe2599[_0x3163('0x8')](_0x3163('0x35'),require('./api/faxMessage'));_0xe2599[_0x3163('0x8')]('/api/fax/queues',require(_0x3163('0x36')));_0xe2599[_0x3163('0x8')](_0x3163('0x37'),require(_0x3163('0x38')));_0xe2599[_0x3163('0x8')](_0x3163('0x39'),require(_0x3163('0x3a')));_0xe2599[_0x3163('0x8')](_0x3163('0x3b'),require(_0x3163('0x3c')));_0xe2599['use'](_0x3163('0x3d'),require(_0x3163('0x3e')));_0xe2599[_0x3163('0x8')]('/api/sms/messages',require(_0x3163('0x3f')));_0xe2599[_0x3163('0x8')](_0x3163('0x40'),require(_0x3163('0x41')));_0xe2599[_0x3163('0x8')](_0x3163('0x42'),require(_0x3163('0x43')));_0xe2599[_0x3163('0x8')](_0x3163('0x44'),require('./api/openchannelApplication'));_0xe2599['use']('/api/openchannel/interactions',require(_0x3163('0x45')));_0xe2599[_0x3163('0x8')]('/api/openchannel/messages',require(_0x3163('0x46')));_0xe2599['use'](_0x3163('0x47'),require('./api/openchannelQueue'));_0xe2599[_0x3163('0x8')](_0x3163('0x48'),require(_0x3163('0x49')));_0xe2599[_0x3163('0x8')](_0x3163('0x4a'),require('./api/openchannelQueueReport'));_0xe2599[_0x3163('0x8')](_0x3163('0x4b'),require(_0x3163('0x4c')));_0xe2599[_0x3163('0x8')](_0x3163('0x4d'),require(_0x3163('0x4e')));_0xe2599['use']('/api/chat/messages',require(_0x3163('0x4f')));_0xe2599[_0x3163('0x8')](_0x3163('0x50'),require(_0x3163('0x51')));_0xe2599[_0x3163('0x8')](_0x3163('0x52'),require(_0x3163('0x53')));_0xe2599['use'](_0x3163('0x54'),require('./api/chatGroup'));_0xe2599[_0x3163('0x8')](_0x3163('0x55'),require(_0x3163('0x56')));_0xe2599[_0x3163('0x8')](_0x3163('0x57'),require(_0x3163('0x58')));_0xe2599[_0x3163('0x8')]('/api/cm/contacts',require(_0x3163('0x59')));_0xe2599[_0x3163('0x8')](_0x3163('0x5a'),require('./api/cmHopper'));_0xe2599[_0x3163('0x8')](_0x3163('0x5b'),require(_0x3163('0x5c')));_0xe2599[_0x3163('0x8')](_0x3163('0x5d'),require(_0x3163('0x5e')));_0xe2599['use'](_0x3163('0x5f'),require(_0x3163('0x60')));_0xe2599[_0x3163('0x8')](_0x3163('0x61'),require(_0x3163('0x62')));_0xe2599[_0x3163('0x8')](_0x3163('0x63'),require(_0x3163('0x64')));_0xe2599[_0x3163('0x8')](_0x3163('0x65'),require(_0x3163('0x66')));_0xe2599[_0x3163('0x8')](_0x3163('0x67'),require(_0x3163('0x68')));_0xe2599[_0x3163('0x8')](_0x3163('0x69'),require(_0x3163('0x6a')));_0xe2599[_0x3163('0x8')](_0x3163('0x6b'),require('./api/condition'));_0xe2599[_0x3163('0x8')](_0x3163('0x6c'),require(_0x3163('0x6d')));_0xe2599[_0x3163('0x8')]('/api/pauses',require(_0x3163('0x6e')));_0xe2599[_0x3163('0x8')](_0x3163('0x6f'),require('./api/cdr'));_0xe2599[_0x3163('0x8')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0xe2599['use'](_0x3163('0x70'),require(_0x3163('0x71')));_0xe2599[_0x3163('0x8')](_0x3163('0x72'),require('./api/sound'));_0xe2599['use']('/api/tags',require(_0x3163('0x73')));_0xe2599[_0x3163('0x8')](_0x3163('0x74'),require(_0x3163('0x75')));_0xe2599['use'](_0x3163('0x76'),require(_0x3163('0x77')));_0xe2599['use']('/api/variables',require(_0x3163('0x78')));_0xe2599[_0x3163('0x8')](_0x3163('0x79'),require(_0x3163('0x7a')));_0xe2599['use'](_0x3163('0x7b'),require('./api/integrationReport'));_0xe2599[_0x3163('0x8')](_0x3163('0x7c'),require(_0x3163('0x7d')));_0xe2599['use'](_0x3163('0x7e'),require('./api/analyticDefaultReport'));_0xe2599['use'](_0x3163('0x7f'),require(_0x3163('0x80')));_0xe2599[_0x3163('0x8')]('/api/analytics/metrics',require(_0x3163('0x81')));_0xe2599['use']('/api/analytics/field_reports',require(_0x3163('0x82')));_0xe2599['use'](_0x3163('0x83'),require('./api/analyticTreeReport'));_0xe2599[_0x3163('0x8')](_0x3163('0x84'),require(_0x3163('0x85')));_0xe2599[_0x3163('0x8')](_0x3163('0x86'),require(_0x3163('0x87')));_0xe2599[_0x3163('0x8')](_0x3163('0x88'),require(_0x3163('0x89')));_0xe2599[_0x3163('0x8')](_0x3163('0x8a'),require(_0x3163('0x8b')));_0xe2599['use']('/api/integrations/sugarcrm/configurations',require(_0x3163('0x8c')));_0xe2599[_0x3163('0x8')](_0x3163('0x8d'),require(_0x3163('0x8e')));_0xe2599[_0x3163('0x8')](_0x3163('0x8f'),require(_0x3163('0x90')));_0xe2599['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0xe2599[_0x3163('0x8')](_0x3163('0x91'),require(_0x3163('0x92')));_0xe2599[_0x3163('0x8')](_0x3163('0x93'),require(_0x3163('0x94')));_0xe2599[_0x3163('0x8')](_0x3163('0x95'),require(_0x3163('0x96')));_0xe2599[_0x3163('0x8')](_0x3163('0x97'),require(_0x3163('0x98')));_0xe2599[_0x3163('0x8')](_0x3163('0x99'),require(_0x3163('0x9a')));_0xe2599[_0x3163('0x8')](_0x3163('0x9b'),require(_0x3163('0x9c')));_0xe2599[_0x3163('0x8')](_0x3163('0x9d'),require(_0x3163('0x9e')));_0xe2599[_0x3163('0x8')]('/api/integrations/freshdesk/accounts',require(_0x3163('0x9f')));_0xe2599[_0x3163('0x8')](_0x3163('0xa0'),require('./api/intFreshdeskConfiguration'));_0xe2599[_0x3163('0x8')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0xe2599[_0x3163('0x8')](_0x3163('0xa1'),require(_0x3163('0xa2')));_0xe2599[_0x3163('0x8')](_0x3163('0xa3'),require(_0x3163('0xa4')));_0xe2599['use'](_0x3163('0xa5'),require('./api/intVtigerField'));_0xe2599[_0x3163('0x8')](_0x3163('0xa6'),require(_0x3163('0xa7')));_0xe2599[_0x3163('0x8')]('/api/integrations/servicenow/configurations',require(_0x3163('0xa8')));_0xe2599['use'](_0x3163('0xa9'),require('./api/intServicenowField'));_0xe2599[_0x3163('0x8')](_0x3163('0xaa'),require('./api/intDynamics365Account'));_0xe2599[_0x3163('0x8')](_0x3163('0xab'),require(_0x3163('0xac')));_0xe2599[_0x3163('0x8')](_0x3163('0xad'),require(_0x3163('0xae')));_0xe2599[_0x3163('0x8')](_0x3163('0xaf'),require(_0x3163('0xb0')));_0xe2599[_0x3163('0x8')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0xe2599[_0x3163('0x8')]('/api/integrations/freshsales/fields',require(_0x3163('0xb1')));_0xe2599[_0x3163('0x8')](_0x3163('0xb2'),require(_0x3163('0xb3')));_0xe2599[_0x3163('0x8')](_0x3163('0xb4'),require(_0x3163('0xb5')));_0xe2599[_0x3163('0x8')](_0x3163('0xb6'),require(_0x3163('0xb7')));_0xe2599[_0x3163('0x8')](_0x3163('0xb8'),require(_0x3163('0xb9')));_0xe2599['use'](_0x3163('0xba'),require(_0x3163('0xbb')));_0xe2599[_0x3163('0x8')](_0x3163('0xbc'),require('./api/jscriptySessionReport'));_0xe2599[_0x3163('0x8')](_0x3163('0xbd'),require(_0x3163('0xbe')));_0xe2599['use'](_0x3163('0xbf'),require('./api/squareReport'));_0xe2599[_0x3163('0x8')](_0x3163('0xc0'),require(_0x3163('0xc1')));_0xe2599['use'](_0x3163('0xc2'),require(_0x3163('0xc3')));_0xe2599[_0x3163('0x8')](_0x3163('0xc4'),require(_0x3163('0xc5')));_0xe2599['use'](_0x3163('0xc6'),require(_0x3163('0xc7')));_0xe2599[_0x3163('0x8')](_0x3163('0xc8'),require(_0x3163('0xc9')));_0xe2599[_0x3163('0x8')](_0x3163('0xca'),require(_0x3163('0xcb')));_0xe2599[_0x3163('0x8')](_0x3163('0xcc'),require(_0x3163('0xcd')));_0xe2599[_0x3163('0x8')](_0x3163('0xce'),require(_0x3163('0xcf')));_0xe2599[_0x3163('0x8')](_0x3163('0xd0'),require(_0x3163('0xd1')));_0xe2599[_0x3163('0x8')](_0x3163('0xd2'),require(_0x3163('0xd3')));_0xe2599[_0x3163('0x8')](_0x3163('0xd4'),require('./api/migration'));_0xe2599[_0x3163('0x8')](_0x3163('0xd5'),require(_0x3163('0xd6')));_0xe2599['use'](_0x3163('0xd7'),require(_0x3163('0xd8')));_0xe2599[_0x3163('0x8')](_0x3163('0xd9'),require(_0x3163('0xda')));_0xe2599[_0x3163('0x8')](_0x3163('0xdb'),require(_0x3163('0xdc')));_0xe2599[_0x3163('0x8')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0xe2599[_0x3163('0x8')](_0x3163('0xdd'),require(_0x3163('0xde')));_0xe2599[_0x3163('0x8')](_0x3163('0xdf'),require('./api/smsTransferReport'));_0xe2599[_0x3163('0x8')](_0x3163('0xe0'),require('./api/cmList'));_0xe2599[_0x3163('0x8')](_0x3163('0xe1'),require('./api/voicePrefix'));_0xe2599['use'](_0x3163('0xe2'),require('./api/userProfile'));_0xe2599[_0x3163('0x8')]('/api/userProfile/sections',require(_0x3163('0xe3')));_0xe2599[_0x3163('0x8')]('/api/userProfile/resources',require(_0x3163('0xe4')));_0xe2599['use'](_0x3163('0xe5'),require(_0x3163('0xe6')));_0xe2599[_0x3163('0x8')]('/api/whatsapp/accounts',require(_0x3163('0xe7')));_0xe2599['use'](_0x3163('0xe8'),require(_0x3163('0xe9')));_0xe2599[_0x3163('0x8')](_0x3163('0xea'),require(_0x3163('0xeb')));_0xe2599[_0x3163('0x8')](_0x3163('0xec'),require(_0x3163('0xed')));_0xe2599[_0x3163('0x8')](_0x3163('0xee'),require(_0x3163('0xef')));_0xe2599[_0x3163('0x8')](_0x3163('0xf0'),require(_0x3163('0xf1')));_0xe2599['use'](_0x3163('0xf2'),require(_0x3163('0xf3')));_0xe2599['use'](_0x3163('0xf4'),require(_0x3163('0xf5')));_0xe2599[_0x3163('0x8')]('/api/realtime',require(_0x3163('0xf6')));_0xe2599['use'](_0x3163('0xf7'),require(_0x3163('0xf8')));_0xe2599[_0x3163('0x8')](_0x3163('0xf9'),require(_0x3163('0xfa')));_0xe2599[_0x3163('0x8')](_0x3163('0xfb'),require(_0x3163('0xfc')));_0xe2599[_0x3163('0x8')]('/api/jira',require('./api/jira'));_0xe2599['use'](_0x3163('0xfd'),require(_0x3163('0xfe')));_0xe2599[_0x3163('0x8')](_0x3163('0xff'),require('./api/version'));_0xe2599[_0x3163('0x8')](_0x3163('0x100'),require(_0x3163('0x101')));_0xe2599[_0x3163('0x8')](_0x3163('0x102'),require(_0x3163('0x103')));_0xe2599['use'](_0x3163('0x104'),require('./api/webbar'));_0xe2599[_0x3163('0x8')](_0x3163('0x105'),clientSideLogs);_0xe2599[_0x3163('0x8')](_0x3163('0x106'),express[_0x3163('0x107')](path[_0x3163('0x108')](config['root'],'/apidoc')));_0xe2599[_0x3163('0x8')](_0x3163('0x109'),express[_0x3163('0x107')](path[_0x3163('0x108')](config[_0x3163('0x10a')],_0x3163('0x109'))));_0xe2599['use']('/demo',express[_0x3163('0x107')](path[_0x3163('0x108')](config['root'],_0x3163('0x10b'))));_0xe2599['use']('/snippet',express['static'](path[_0x3163('0x108')](config[_0x3163('0x10a')],_0x3163('0x10c'),_0x3163('0x10d'))));_0xe2599[_0x3163('0x8')](_0x3163('0x10e'),express['static'](path['join'](config['root'],_0x3163('0x10f'))));_0xe2599['route'](_0x3163('0x110'))[_0x3163('0x111')](errors[0x194]);_0xe2599['route']('/*')[_0x3163('0x111')](function(_0x1086ab,_0x549f02){_0x549f02[_0x3163('0x112')](path['resolve'](_0xe2599['get'](_0x3163('0x113'))+_0x3163('0x114')));});return _0xe2599;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index eff20b1..28b62b0 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1be=['../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc'];(function(_0x5baa5a,_0x32414d){var _0x11edb2=function(_0x1d7ed7){while(--_0x1d7ed7){_0x5baa5a['push'](_0x5baa5a['shift']());}};_0x11edb2(++_0x32414d);}(_0xd1be,0x13b));var _0xed1b=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0xd1be[_0x1591d4];return _0x4c46bb;};'use strict';var jayson=require(_0xed1b('0x0'));var _=require('lodash');var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x1b745e,_0x28ca95){var _0x3d47d9={};_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x1')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x2')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/voiceQueue/voiceQueue.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x4')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x5')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x6')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x7')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x8')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x9')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0xa')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/mailAccount/mailAccount.rpc'));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0xb')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0xc')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0xd')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0xe')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0xf')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/faxAccount/faxAccount.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x10')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x11')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/faxMessage/faxMessage.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x12')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x13')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x14')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x15')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x16')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x17')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x18')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x19')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x1a')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x1b')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/chatInteraction/chatInteraction.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x1c')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x1d')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x1e')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x1f')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x20')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x21')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x22')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x23')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x24')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x25')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x26')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x27')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/variable/variable.rpc'));_0x3d47d9=_['merge'](_0x3d47d9,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x28')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x29')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x2a')));_0x3d47d9=_['merge'](_0x3d47d9,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x2b')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x2c')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x2d')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x2e')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x2f')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require('../api/squareReport/squareReport.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x30')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x31')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x32')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x33')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x34')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x35')));_0x3d47d9=_['merge'](_0x3d47d9,require(_0xed1b('0x36')));_0x3d47d9=_['merge'](_0x3d47d9,require('../api/attachment/attachment.rpc'));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x37')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x38')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x39')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x3a')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x3b')));_0x3d47d9=_[_0xed1b('0x3')](_0x3d47d9,require(_0xed1b('0x3c')));var _0x4321ca=jayson[_0xed1b('0x3d')](_0x3d47d9)['http']();var _0x16f51b=config[_0xed1b('0x3e')][_0xed1b('0x3f')]||config[_0xed1b('0x3f')]+0x1;var _0x28572b=config['rpc']['ip']||_0xed1b('0x40');_0x4321ca['on'](_0xed1b('0x41'),function(_0x23a069){return _0x28ca95(_0x23a069);});_0x4321ca[_0xed1b('0x42')](_0x16f51b,_0x28572b,function(){console[_0xed1b('0x43')](_0xed1b('0x44'),_0x28572b,_0x16f51b);require(_0xed1b('0x45'))[_0xed1b('0x46')]();return _0x1b745e(_0xed1b('0x47')+_0x28572b+':'+_0x16f51b);});});}; \ No newline at end of file +var _0x86b1=['../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.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/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/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'];(function(_0x1613f6,_0x17b8a7){var _0x34bd16=function(_0x31a268){while(--_0x31a268){_0x1613f6['push'](_0x1613f6['shift']());}};_0x34bd16(++_0x17b8a7);}(_0x86b1,0x1a2));var _0x186b=function(_0x2b5e52,_0x1a5639){_0x2b5e52=_0x2b5e52-0x0;var _0x34b198=_0x86b1[_0x2b5e52];return _0x34b198;};'use strict';var jayson=require(_0x186b('0x0'));var _=require(_0x186b('0x1'));var config=require(_0x186b('0x2'));exports[_0x186b('0x3')]=function(){return new Promise(function(_0x28f897,_0x1ae657){var _0x5bdb33={};_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x4')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x5')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x7')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x8')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x9')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0xa')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0xb')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0xc')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0xd')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5bdb33=_['merge'](_0x5bdb33,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0xe')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0xf')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x10')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x11')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x12')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x13')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x14')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x15')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x16')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x17')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/faxMessage/faxMessage.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x18')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x19')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x1a')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/smsMessage/smsMessage.rpc'));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x1b')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x1c')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x1d')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x1e')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x1f')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x20')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/cmContact/cmContact.rpc'));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x21')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x22')));_0x5bdb33=_['merge'](_0x5bdb33,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5bdb33=_['merge'](_0x5bdb33,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x23')));_0x5bdb33=_['merge'](_0x5bdb33,require('../api/interval/interval.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/pause/pause.rpc'));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x24')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x25')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x26')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x27')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x28')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x29')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x2a')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x2b')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x2c')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x2d')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x2e')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x2f')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x30')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x31')));_0x5bdb33=_['merge'](_0x5bdb33,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x32')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x33')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x34')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x35')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x36')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x37')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x38')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require('../api/campaign/campaign.rpc'));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x39')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x3a')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x3b')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x3c')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x3d')));_0x5bdb33=_['merge'](_0x5bdb33,require(_0x186b('0x3e')));_0x5bdb33=_[_0x186b('0x6')](_0x5bdb33,require(_0x186b('0x3f')));var _0x34f835=jayson[_0x186b('0x40')](_0x5bdb33)[_0x186b('0x41')]();var _0x3fc118=config['rpc'][_0x186b('0x42')]||config['port']+0x1;var _0x269f07=config[_0x186b('0x43')]['ip']||_0x186b('0x44');_0x34f835['on']('error',function(_0x3fbea4){return _0x1ae657(_0x3fbea4);});_0x34f835[_0x186b('0x3')](_0x3fc118,_0x269f07,function(){console[_0x186b('0x45')](_0x186b('0x46'),_0x269f07,_0x3fc118);require(_0x186b('0x47'))[_0x186b('0x48')]();return _0x28f897(_0x186b('0x49')+_0x269f07+':'+_0x3fc118);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b5d3cb7..db7e743 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 _0x6aa1=['error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','label','exports','lodash','events','./reply','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','substring','no\x20code','replace','result=','indexOf','substr','split','length'];(function(_0x65c31e,_0x576571){var _0x486601=function(_0x442819){while(--_0x442819){_0x65c31e['push'](_0x65c31e['shift']());}};_0x486601(++_0x576571);}(_0x6aa1,0x1da));var _0x16aa=function(_0x3078c5,_0x59fb70){_0x3078c5=_0x3078c5-0x0;var _0x23adc6=_0x6aa1[_0x3078c5];return _0x23adc6;};'use strict';var util=require('util');var _=require(_0x16aa('0x0'));var EventEmitter=require(_0x16aa('0x1'))['EventEmitter'];var AGIReply=require(_0x16aa('0x2'));var AGIError=require('./error');function AGIChannel(_0x2b1485){var _0x42d13e=this,_0x20ca23=new AGIReply(),_0x515516=![],_0x598378={};EventEmitter[_0x16aa('0x3')](_0x42d13e);_0x2b1485[_0x16aa('0x4')](_0x16aa('0x5'));_0x2b1485[_0x16aa('0x6')](0x8*0x3c*0x3c*0x3e8);_0x20ca23[_0x16aa('0x4')](_0x16aa('0x5'));_0x20ca23['on']('headers',function(_0x5bee7b){for(var _0x8ea55f in _0x5bee7b){_0x42d13e[_0x8ea55f]=_0x5bee7b[_0x8ea55f];}_0x42d13e[_0x16aa('0x7')](_0x16aa('0x8'));});_0x20ca23['on'](_0x16aa('0x9'),function(_0x4a1574){if(_0x4a1574[_0x16aa('0xa')]()==_0x16aa('0xb')){_0x42d13e[_0x16aa('0x7')](_0x16aa('0xb'));return;}if(_0x4a1574['substring'](0x0,0xb)==_0x16aa('0xc')){_0x515516=!![];}if(_0x515516){_0x598378['rx']+=_0x4a1574+'\x0a';if(_0x4a1574[_0x16aa('0xd')](_0x16aa('0xe'))!=-0x1){_0x515516=![];}}else{_0x598378['rx']=_0x4a1574;}if(_0x515516){return;}if(typeof _0x598378['cb']=='function'){var _0x419ac8=_0x598378['rx'][_0x16aa('0xf')](0x0,0x3),_0x44aa46=null,_0x5c2af0=null;_0x419ac8=parseInt(_0x419ac8);if(isNaN(_0x419ac8)){_0x598378['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x16aa('0x10')});return;}if(_0x419ac8!=0xc8){_0x598378['cb'](null,{'code':_0x419ac8,'result':-0x1,'extra':'KO'});return;}_0x44aa46=_0x598378['rx'][_0x16aa('0xf')](0x4)[_0x16aa('0x11')](_0x16aa('0x12'),'');if(_0x44aa46[_0x16aa('0x13')]('\x20')!=-0x1){_0x44aa46=_0x44aa46[_0x16aa('0x14')](0x0,_0x44aa46[_0x16aa('0x13')]('\x20'));}if(_['startsWith'](_0x44aa46,'-1')){_0x44aa46=parseInt(_0x44aa46);}_0x5c2af0=_0x598378['rx'][_0x16aa('0x15')]('\x20');if(_0x5c2af0[_0x16aa('0x16')]==0x3){_0x5c2af0=_0x5c2af0[0x2][_0x16aa('0xf')](0x1,_0x5c2af0[0x2]['length']-0x1);}else if(_0x5c2af0[_0x16aa('0x16')]>0x3){var _0x29301b=/\((.+)\)/;var _0x2d0d0f=_0x598378['rx']['match'](_0x29301b);if(_0x2d0d0f){_0x5c2af0=_0x2d0d0f[0x1];}else{_0x5c2af0=null;}}else{_0x5c2af0=null;}_0x598378['cb'](null,{'code':_0x419ac8,'result':_0x44aa46,'extra':_0x5c2af0});}});_0x2b1485['on'](_0x16aa('0x17'),function(_0x2f614c){_0x42d13e[_0x16aa('0x7')](_0x16aa('0x17'),new AGIError(_0x16aa('0x18'),_0x2f614c['code']));});_0x2b1485['on'](_0x16aa('0x19'),function(){_0x42d13e[_0x16aa('0x7')](_0x16aa('0x19'),new AGIError(_0x16aa('0x1a')));});_0x2b1485['on'](_0x16aa('0x1b'),function(){_0x42d13e[_0x16aa('0x7')](_0x16aa('0x1b'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2b1485[_0x16aa('0x1c')]();});_0x2b1485[_0x16aa('0x1d')](_0x20ca23);this[_0x16aa('0x1e')]=function(_0x2e4ed9,_0x3cf165){var _0x2e4ed9=_0x2e4ed9||'',_0x3cf165=typeof _0x3cf165=='function'?_0x3cf165:new Function();_0x598378={'tx':_0x2e4ed9,'rx':'','cb':_0x3cf165};_0x2b1485[_0x16aa('0x1f')](_0x2e4ed9+'\x0a');},this[_0x16aa('0x19')]=function(){_0x2b1485['destroy']();};}util[_0x16aa('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x16aa('0x21')]['sendRequest']=function(_0x34c604){return this[_0x16aa('0x1e')]['sync'](this,_0x34c604);};AGIChannel['prototype']['answer']=function(){return this[_0x16aa('0x22')]('ANSWER');};AGIChannel[_0x16aa('0x21')][_0x16aa('0x23')]=function(_0x35dd52,_0x475c41,_0x11f62e){_0x35dd52=_0x35dd52===undefined?'beep':_0x35dd52;_0x475c41=_0x475c41===undefined?'5':_0x475c41;_0x11f62e=_0x11f62e===undefined?'1':_0x11f62e;return this[_0x16aa('0x22')](util[_0x16aa('0x24')](_0x16aa('0x25'),_0x35dd52,_0x475c41*0x3e8,_0x11f62e));};AGIChannel['prototype'][_0x16aa('0x26')]=function(_0x35a720){_0x35a720=_0x35a720||'NO\x20MESSAGE';return this[_0x16aa('0x22')](util['format']('VERBOSE\x20\x22%s\x22',_0x35a720));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x27')]=function(_0x378b43,_0x47e026){if(_[_0x16aa('0x28')](_0x47e026)){return this[_0x16aa('0x22')](util['format'](_0x16aa('0x29'),_0x378b43,_0x47e026[_0x16aa('0x2a')](',')));}return this[_0x16aa('0x22')](util['format']('EXEC\x20%s\x20%s',_0x378b43,_0x47e026));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x2b')]=function(_0x210bfd){return this[_0x16aa('0x22')](util[_0x16aa('0x24')](_0x16aa('0x2c'),_0x210bfd));};AGIChannel['prototype'][_0x16aa('0x2d')]=function(_0x50dd4e){return this[_0x16aa('0x22')](util[_0x16aa('0x24')](_0x16aa('0x2e'),_0x50dd4e));};AGIChannel[_0x16aa('0x21')]['setPriority']=function(_0xb2a6fe){return this[_0x16aa('0x22')](util[_0x16aa('0x24')]('SET\x20PRIORITY\x20%s',_0xb2a6fe));};AGIChannel[_0x16aa('0x21')][_0x16aa('0xb')]=function(){return this[_0x16aa('0x22')](_0x16aa('0x2f'));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x30')]=function(_0x43972e,_0x1e4705){var _0x27e047=_[_0x16aa('0x31')](_0x1e4705)||_[_0x16aa('0x32')](_0x1e4705)?_0x1e4705['toString']():_0x1e4705;return this[_0x16aa('0x22')](util[_0x16aa('0x24')](_0x16aa('0x33'),_0x43972e,_0x27e047?_0x27e047[_0x16aa('0x34')]()[_0x16aa('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x35')]=function(_0x3b068b,_0x31f598){return this[_0x16aa('0x22')](util[_0x16aa('0x24')](_0x16aa('0x36'),_0x3b068b,_0x31f598));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x37')]=function(_0x19003a,_0x4a8072){return this['sendRequest'](util[_0x16aa('0x24')](_0x16aa('0x38'),_0x19003a,_0x4a8072));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x39')]=function(_0x12bd0b,_0x2a0190){return this['sendRequest'](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x12bd0b,_0x2a0190));};AGIChannel[_0x16aa('0x21')]['continueAt']=function(_0x7f699b,_0x4a34ae,_0x1aeecf){_0x4a34ae=_0x4a34ae||this['extension'];_0x1aeecf=_0x1aeecf||0x1;this['setContext'](_0x7f699b);this[_0x16aa('0x2d')](_0x4a34ae);this['setPriority'](_0x1aeecf);return this[_0x16aa('0x26')](util[_0x16aa('0x24')](_0x16aa('0x3a'),_0x7f699b,_0x4a34ae,_0x1aeecf));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x3b')]=function(_0x4a5e20){return this[_0x16aa('0x22')](util[_0x16aa('0x24')]('GET\x20VARIABLE\x20\x22%s\x22',_0x4a5e20));};AGIChannel['prototype'][_0x16aa('0x3c')]=function(_0x3bcae0,_0x39f81c,_0x5b86d4,_0x558ded,_0x327cd9,_0x2d3c84){_0x39f81c=_0x39f81c||_0x16aa('0x3d');_0x5b86d4=_0x5b86d4||'';_0x558ded=_0x558ded===undefined?-0x1:_0x558ded==='-1'?-0x1:_0x558ded*0x3e8;_0x327cd9=_0x327cd9===undefined?'':'s='+_0x327cd9;_0x2d3c84=_0x2d3c84?_0x16aa('0x3e'):'';return this[_0x16aa('0x22')](util['format'](_0x16aa('0x3f'),_0x3bcae0,_0x39f81c,_0x5b86d4,_0x558ded,_0x2d3c84,_0x327cd9));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x40')]=function(_0x31fc25,_0x1d61de){_0x1d61de=_0x1d61de||'';return this[_0x16aa('0x22')](util[_0x16aa('0x24')](_0x16aa('0x41'),_0x31fc25,_0x1d61de));};AGIChannel[_0x16aa('0x21')][_0x16aa('0x42')]=function(_0x234d93){return this[_0x16aa('0x27')](_0x16aa('0x43'),_0x234d93);};AGIChannel[_0x16aa('0x21')][_0x16aa('0x44')]=function(_0x1fb378){return this[_0x16aa('0x27')]('WAIT',_0x1fb378);};AGIChannel[_0x16aa('0x21')][_0x16aa('0x17')]=function(_0x11c363,_0x48540a){this[_0x16aa('0x26')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x11c363['id'],_0x11c363[_0x16aa('0x45')],_0x48540a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x16aa('0x46')]=AGIChannel; \ No newline at end of file +var _0xbdc1=['headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding'];(function(_0xb8540f,_0x1edf46){var _0x50fc1a=function(_0x3b0521){while(--_0x3b0521){_0xb8540f['push'](_0xb8540f['shift']());}};_0x50fc1a(++_0x1edf46);}(_0xbdc1,0x147));var _0x1bdc=function(_0x3b7afc,_0x591c4b){_0x3b7afc=_0x3b7afc-0x0;var _0x4c7bb2=_0xbdc1[_0x3b7afc];return _0x4c7bb2;};'use strict';var util=require(_0x1bdc('0x0'));var _=require('lodash');var EventEmitter=require(_0x1bdc('0x1'))[_0x1bdc('0x2')];var AGIReply=require(_0x1bdc('0x3'));var AGIError=require(_0x1bdc('0x4'));function AGIChannel(_0x1379d8){var _0xaa84ca=this,_0x59cff6=new AGIReply(),_0x4fa3e0=![],_0x29074f={};EventEmitter[_0x1bdc('0x5')](_0xaa84ca);_0x1379d8['setEncoding'](_0x1bdc('0x6'));_0x1379d8[_0x1bdc('0x7')](0x8*0x3c*0x3c*0x3e8);_0x59cff6[_0x1bdc('0x8')](_0x1bdc('0x6'));_0x59cff6['on'](_0x1bdc('0x9'),function(_0x3f852d){for(var _0x3353ca in _0x3f852d){_0xaa84ca[_0x3353ca]=_0x3f852d[_0x3353ca];}_0xaa84ca[_0x1bdc('0xa')](_0x1bdc('0xb'));});_0x59cff6['on'](_0x1bdc('0xc'),function(_0x84210){if(_0x84210[_0x1bdc('0xd')]()==_0x1bdc('0xe')){_0xaa84ca['emit'](_0x1bdc('0xe'));return;}if(_0x84210[_0x1bdc('0xf')](0x0,0xb)==_0x1bdc('0x10')){_0x4fa3e0=!![];}if(_0x4fa3e0){_0x29074f['rx']+=_0x84210+'\x0a';if(_0x84210[_0x1bdc('0x11')](_0x1bdc('0x12'))!=-0x1){_0x4fa3e0=![];}}else{_0x29074f['rx']=_0x84210;}if(_0x4fa3e0){return;}if(typeof _0x29074f['cb']==_0x1bdc('0x13')){var _0x293fcd=_0x29074f['rx'][_0x1bdc('0xf')](0x0,0x3),_0x4e429c=null,_0x1889fc=null;_0x293fcd=parseInt(_0x293fcd);if(isNaN(_0x293fcd)){_0x29074f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1bdc('0x14')});return;}if(_0x293fcd!=0xc8){_0x29074f['cb'](null,{'code':_0x293fcd,'result':-0x1,'extra':'KO'});return;}_0x4e429c=_0x29074f['rx']['substring'](0x4)[_0x1bdc('0x15')]('result=','');if(_0x4e429c[_0x1bdc('0x16')]('\x20')!=-0x1){_0x4e429c=_0x4e429c[_0x1bdc('0x17')](0x0,_0x4e429c[_0x1bdc('0x16')]('\x20'));}if(_[_0x1bdc('0x18')](_0x4e429c,'-1')){_0x4e429c=parseInt(_0x4e429c);}_0x1889fc=_0x29074f['rx'][_0x1bdc('0x19')]('\x20');if(_0x1889fc[_0x1bdc('0x1a')]==0x3){_0x1889fc=_0x1889fc[0x2]['substring'](0x1,_0x1889fc[0x2][_0x1bdc('0x1a')]-0x1);}else if(_0x1889fc['length']>0x3){var _0x3dc6ec=/\((.+)\)/;var _0x4623c8=_0x29074f['rx'][_0x1bdc('0x1b')](_0x3dc6ec);if(_0x4623c8){_0x1889fc=_0x4623c8[0x1];}else{_0x1889fc=null;}}else{_0x1889fc=null;}_0x29074f['cb'](null,{'code':_0x293fcd,'result':_0x4e429c,'extra':_0x1889fc});}});_0x1379d8['on'](_0x1bdc('0x1c'),function(_0x160a90){_0xaa84ca[_0x1bdc('0xa')](_0x1bdc('0x1c'),new AGIError(_0x1bdc('0x1d'),_0x160a90['code']));});_0x1379d8['on'](_0x1bdc('0x1e'),function(){_0xaa84ca[_0x1bdc('0xa')](_0x1bdc('0x1e'),new AGIError(_0x1bdc('0x1f')));});_0x1379d8['on'](_0x1bdc('0x20'),function(){_0xaa84ca[_0x1bdc('0xa')](_0x1bdc('0x20'),new AGIError(_0x1bdc('0x21')));_0x1379d8[_0x1bdc('0x22')]();});_0x1379d8['pipe'](_0x59cff6);this['command']=function(_0x539e9d,_0x444117){var _0x539e9d=_0x539e9d||'',_0x444117=typeof _0x444117==_0x1bdc('0x13')?_0x444117:new Function();_0x29074f={'tx':_0x539e9d,'rx':'','cb':_0x444117};_0x1379d8[_0x1bdc('0x23')](_0x539e9d+'\x0a');},this[_0x1bdc('0x1e')]=function(){_0x1379d8['destroy']();};}util[_0x1bdc('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x1bdc('0x25')]['sendRequest']=function(_0x5c7fc3){return this['command'][_0x1bdc('0x26')](this,_0x5c7fc3);};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x27')]=function(){return this[_0x1bdc('0x28')](_0x1bdc('0x29'));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x2a')]=function(_0x53300a,_0x3b07fd,_0x1e685d){_0x53300a=_0x53300a===undefined?_0x1bdc('0x2b'):_0x53300a;_0x3b07fd=_0x3b07fd===undefined?'5':_0x3b07fd;_0x1e685d=_0x1e685d===undefined?'1':_0x1e685d;return this[_0x1bdc('0x28')](util['format'](_0x1bdc('0x2c'),_0x53300a,_0x3b07fd*0x3e8,_0x1e685d));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x2d')]=function(_0x437da2){_0x437da2=_0x437da2||_0x1bdc('0x2e');return this['sendRequest'](util[_0x1bdc('0x2f')](_0x1bdc('0x30'),_0x437da2));};AGIChannel['prototype']['exec']=function(_0x2bb140,_0x279ebb){if(_[_0x1bdc('0x31')](_0x279ebb)){return this[_0x1bdc('0x28')](util['format'](_0x1bdc('0x32'),_0x2bb140,_0x279ebb[_0x1bdc('0x33')](',')));}return this['sendRequest'](util[_0x1bdc('0x2f')](_0x1bdc('0x32'),_0x2bb140,_0x279ebb));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x34')]=function(_0x2e7bed){return this[_0x1bdc('0x28')](util[_0x1bdc('0x2f')](_0x1bdc('0x35'),_0x2e7bed));};AGIChannel[_0x1bdc('0x25')]['setExtension']=function(_0x38fd5c){return this[_0x1bdc('0x28')](util[_0x1bdc('0x2f')](_0x1bdc('0x36'),_0x38fd5c));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x37')]=function(_0x5b9f5e){return this['sendRequest'](util[_0x1bdc('0x2f')](_0x1bdc('0x38'),_0x5b9f5e));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0xe')]=function(){return this[_0x1bdc('0x28')](_0x1bdc('0x39'));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x3a')]=function(_0x4066b7,_0x37667a){var _0x4228c4=_[_0x1bdc('0x3b')](_0x37667a)||_[_0x1bdc('0x3c')](_0x37667a)?_0x37667a[_0x1bdc('0x3d')]():_0x37667a;return this[_0x1bdc('0x28')](util['format'](_0x1bdc('0x3e'),_0x4066b7,_0x4228c4?_0x4228c4['toString']()[_0x1bdc('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x3f')]=function(_0xfa0a46,_0x3661d9){return this[_0x1bdc('0x28')](util[_0x1bdc('0x2f')](_0x1bdc('0x40'),_0xfa0a46,_0x3661d9));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x41')]=function(_0x223f65,_0x257e86){return this[_0x1bdc('0x28')](util[_0x1bdc('0x2f')](_0x1bdc('0x42'),_0x223f65,_0x257e86));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x43')]=function(_0x4ee723,_0x416ca8){return this['sendRequest'](util['format'](_0x1bdc('0x44'),_0x4ee723,_0x416ca8));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x45')]=function(_0x3caa55,_0x310556,_0x24775d){_0x310556=_0x310556||this[_0x1bdc('0x46')];_0x24775d=_0x24775d||0x1;this[_0x1bdc('0x34')](_0x3caa55);this[_0x1bdc('0x47')](_0x310556);this[_0x1bdc('0x37')](_0x24775d);return this[_0x1bdc('0x2d')](util[_0x1bdc('0x2f')](_0x1bdc('0x48'),_0x3caa55,_0x310556,_0x24775d));};AGIChannel['prototype']['getVariable']=function(_0xf37209){return this[_0x1bdc('0x28')](util[_0x1bdc('0x2f')](_0x1bdc('0x49'),_0xf37209));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x4a')]=function(_0x448efa,_0x22dd60,_0x30471f,_0x148318,_0x2fa964,_0x4f9f4d){_0x22dd60=_0x22dd60||_0x1bdc('0x4b');_0x30471f=_0x30471f||'';_0x148318=_0x148318===undefined?-0x1:_0x148318==='-1'?-0x1:_0x148318*0x3e8;_0x2fa964=_0x2fa964===undefined?'':'s='+_0x2fa964;_0x4f9f4d=_0x4f9f4d?'BEEP':'';return this[_0x1bdc('0x28')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x448efa,_0x22dd60,_0x30471f,_0x148318,_0x4f9f4d,_0x2fa964));};AGIChannel['prototype']['streamFile']=function(_0x2f91a4,_0x38f7fd){_0x38f7fd=_0x38f7fd||'';return this[_0x1bdc('0x28')](util[_0x1bdc('0x2f')](_0x1bdc('0x4c'),_0x2f91a4,_0x38f7fd));};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x4d')]=function(_0x3e5cb4){return this[_0x1bdc('0x4e')](_0x1bdc('0x4f'),_0x3e5cb4);};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x50')]=function(_0x454099){return this[_0x1bdc('0x4e')]('WAIT',_0x454099);};AGIChannel[_0x1bdc('0x25')][_0x1bdc('0x1c')]=function(_0x18df5e,_0x4c88bb){this[_0x1bdc('0x2d')](util['format'](_0x1bdc('0x51'),_0x18df5e['id'],_0x18df5e[_0x1bdc('0x52')],_0x4c88bb));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1bdc('0x53')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 3df49e2..2318252 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 _0xd387=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name'];(function(_0x41e7c2,_0x282472){var _0x3e754a=function(_0x5cf10b){while(--_0x5cf10b){_0x41e7c2['push'](_0x41e7c2['shift']());}};_0x3e754a(++_0x282472);}(_0xd387,0x1b1));var _0x7d38=function(_0x551360,_0x28870c){_0x551360=_0x551360-0x0;var _0x590211=_0xd387[_0x551360];return _0x590211;};'use strict';var util=require(_0x7d38('0x0'));var error={'E_AGI_UNDEFINED':_0x7d38('0x1'),'E_AGI_ARGUMENT_PORT':_0x7d38('0x2'),'E_AGI_SERVER_ERROR':_0x7d38('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x7d38('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x7d38('0x5'),'E_AGI_SOCKET_ERROR':_0x7d38('0x6'),'E_AGI_SOCKET_CLOSE':_0x7d38('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x7d38('0x8'),'E_AGI_COMMAND_EMPTY':_0x7d38('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7d38('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5d18f4){var _0x5d18f4=_0x5d18f4||null,_0x4c3d48=_0x4c3d48||[],_0x24b898=0x1,_0x4a2971='';if(!error[_0x5d18f4]){_0x5d18f4=_0x7d38('0xb');}_0x4c3d48[_0x7d38('0xc')](error[_0x5d18f4]);while(arguments[_0x24b898]){_0x4c3d48[_0x7d38('0xc')](arguments[_0x24b898]);_0x24b898++;}_0x4a2971=util[_0x7d38('0xd')][_0x7d38('0xe')](util,_0x4c3d48);this[_0x7d38('0xf')]=_0x4a2971;this[_0x7d38('0x10')]=_0x5d18f4;}module[_0x7d38('0x11')]=AGIError; \ No newline at end of file +var _0xe1e7=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0xe1e7,0xa6));var _0x7e1e=function(_0x3aa795,_0x54ae4d){_0x3aa795=_0x3aa795-0x0;var _0x13403a=_0xe1e7[_0x3aa795];return _0x13403a;};'use strict';var util=require(_0x7e1e('0x0'));var error={'E_AGI_UNDEFINED':_0x7e1e('0x1'),'E_AGI_ARGUMENT_PORT':_0x7e1e('0x2'),'E_AGI_SERVER_ERROR':_0x7e1e('0x3'),'E_AGI_SERVER_CLOSE':_0x7e1e('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x7e1e('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x7e1e('0x6'),'E_AGI_SOCKET_ERROR':_0x7e1e('0x7'),'E_AGI_SOCKET_CLOSE':_0x7e1e('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x7e1e('0x9'),'E_AGI_COMMAND_EMPTY':_0x7e1e('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7e1e('0xb'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x31f313){var _0x31f313=_0x31f313||null,_0x477d48=_0x477d48||[],_0x4d8696=0x1,_0x28e6a4='';if(!error[_0x31f313]){_0x31f313='E_AGI_UNDEFINED';}_0x477d48[_0x7e1e('0xc')](error[_0x31f313]);while(arguments[_0x4d8696]){_0x477d48['push'](arguments[_0x4d8696]);_0x4d8696++;}_0x28e6a4=util[_0x7e1e('0xd')]['apply'](util,_0x477d48);this[_0x7e1e('0xe')]=_0x28e6a4;this[_0x7e1e('0xf')]=_0x31f313;}module[_0x7e1e('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index a9a98c5..274b4f6 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 _0xfd68=['prototype','addVertex','addEdge','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges'];(function(_0x3b3d01,_0x4c0e8e){var _0x190777=function(_0x2ed66d){while(--_0x2ed66d){_0x3b3d01['push'](_0x3b3d01['shift']());}};_0x190777(++_0x4c0e8e);}(_0xfd68,0x142));var _0x8fd6=function(_0x12b142,_0x66c058){_0x12b142=_0x12b142-0x0;var _0x2782e1=_0xfd68[_0x12b142];return _0x2782e1;};'use strict';var _=require(_0x8fd6('0x0'));var logger=require(_0x8fd6('0x1'))('agi');var verticesWithRetry=[_0x8fd6('0x2'),_0x8fd6('0x3'),_0x8fd6('0x4')];var Graph=function(){this[_0x8fd6('0x5')]={};this[_0x8fd6('0x6')]={};this[_0x8fd6('0x7')]=0x0;};Graph[_0x8fd6('0x8')][_0x8fd6('0x9')]=function(_0x3c553f){this[_0x8fd6('0x5')][_0x3c553f['id']]=_0x3c553f;this[_0x8fd6('0x6')][_0x3c553f['id']]=[];};Graph['prototype'][_0x8fd6('0xa')]=function(_0x547e33,_0xbfc422,_0x335537){this['edges'][_0x547e33]['push']({'target':_0xbfc422,'condition':_0x335537});this[_0x8fd6('0x7')]+=0x1;};Graph[_0x8fd6('0x8')]['size']=function(){return _[_0x8fd6('0xb')](this['vertices']);};Graph[_0x8fd6('0x8')]['relations']=function(){return this[_0x8fd6('0x7')];};Graph[_0x8fd6('0x8')][_0x8fd6('0xc')]=function(_0x49a368){return this['vertices'][_0x49a368];};Graph[_0x8fd6('0x8')][_0x8fd6('0xd')]=function(_0x2e8387,_0x3e2eef){if(!this[_0x8fd6('0x5')][_0x2e8387]){return logger[_0x8fd6('0xe')](_0x8fd6('0xf'));}var _0x511df1=_0x3e2eef(this[_0x8fd6('0x5')][_0x2e8387]);if(!_0x511df1){return logger[_0x8fd6('0xe')](_0x8fd6('0x10'));}if(this[_0x8fd6('0x6')][_0x2e8387][_0x8fd6('0x11')]===0x0){return logger['info'](_0x8fd6('0x12'));}for(var _0x575c03=0x0,_0x352edd=[],_0x44af40=![];_0x575c03\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','format','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','isArray','length','source','target','value','then','catch','indexOf','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x39a7,0x1bd));var _0x739a=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x39a7[_0x380af2];return _0x1789dc;};'use strict';var parser=require(_0x739a('0x0'));var _=require('lodash');var syncho=require(_0x739a('0x1'));var util=require('util');var moment=require(_0x739a('0x2'));var config=require(_0x739a('0x3'));var logger=require(_0x739a('0x4'))(_0x739a('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x739a('0x6'));var Graph=require(_0x739a('0x7'));var Vertices=require(_0x739a('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x739a('0x5')]=_[_0x739a('0x9')](config[_0x739a('0x5')],{'ip':_0x739a('0xa'),'port':0x11dd});function connectionHandler(_0x3a2b1c){process[_0x739a('0xb')](function(){syncho(function(){try{setChannelVariables(_0x3a2b1c);agiHandler(_0x3a2b1c);}catch(_0x4c9c16){logger[_0x739a('0xc')](_0x4c9c16[_0x739a('0xd')]);}});});}function listeningHandler(){console[_0x739a('0xe')](_0x739a('0xf'),config['agi'][_0x739a('0x10')]);logger[_0x739a('0x11')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x739a('0x5')]['ip'],config[_0x739a('0x5')]['port']));}function errorHandler(_0x12141f){if(_0x12141f&&_0x12141f[_0x739a('0x12')]&&_0x12141f[_0x739a('0x13')]){logger[_0x739a('0xc')](util['format']('[%s]\x20%s',_0x12141f[_0x739a('0x12')],_0x12141f[_0x739a('0x13')]));}else{logger[_0x739a('0xc')](util['format']('[ERROR]\x20%s',_0x12141f[_0x739a('0xd')]));}}function closeHandler(){logger[_0x739a('0x11')](util['format'](_0x739a('0x14'),this[_0x739a('0x15')],this[_0x739a('0x16')],this[_0x739a('0x17')],this['dnid'],this[_0x739a('0x18')]));try{createSquareReport(this);}catch(_0x317983){logger[_0x739a('0xc')](_0x317983[_0x739a('0xd')]);}}function timeoutHandler(){logger[_0x739a('0x11')](util[_0x739a('0x19')](_0x739a('0x1a'),this[_0x739a('0x15')],this[_0x739a('0x16')],this[_0x739a('0x17')],this[_0x739a('0x1b')],this[_0x739a('0x18')]));}function hangupHandler(){logger[_0x739a('0x11')](util['format'](_0x739a('0x1c'),this[_0x739a('0x15')],this[_0x739a('0x16')],this[_0x739a('0x17')],this[_0x739a('0x1b')],this[_0x739a('0x18')]));this['evtHangup']=!![];}function getRoot(_0x2911de){return parser['toJson'](_0x2911de,{'object':!![]})[_0x739a('0x1d')][_0x739a('0x1e')];}function addVertex(_0x45a779,_0x3f6047,_0x42fe24){_0x3f6047[_0x739a('0x1f')]=_0x42fe24;if(_0x3f6047[_0x739a('0x20')](_0x739a('0x21'))){_0x3f6047[_0x739a('0x22')]=parseInt(_0x3f6047['retry'],0xa);}_0x45a779['addVertex'](_['omit'](_0x3f6047,'mxCell'));}function initGraph(_0x45509d,_0x62df40){var _0x3ec735=new Graph();for(var _0x55b9d1 in _0x45509d){if(_0x45509d[_0x739a('0x20')](_0x55b9d1)){if(_[_0x739a('0x23')](_0x45509d[_0x55b9d1])){for(var _0xe7b82a=0x0;_0xe7b82a<_0x45509d[_0x55b9d1]['length'];_0xe7b82a+=0x1){addVertex(_0x3ec735,_0x45509d[_0x55b9d1][_0xe7b82a],_0x55b9d1);}}else{addVertex(_0x3ec735,_0x45509d[_0x55b9d1],_0x55b9d1);}}}for(var _0x1f8a8c=0x0;_0x1f8a8c<_0x62df40[_0x739a('0x24')];_0x1f8a8c+=0x1){if(_0x62df40[_0x1f8a8c][_0x739a('0x25')]&&_0x62df40[_0x1f8a8c][_0x739a('0x26')]){_0x3ec735['addEdge'](_0x62df40[_0x1f8a8c]['source'],_0x62df40[_0x1f8a8c][_0x739a('0x26')],_0x62df40[_0x1f8a8c][_0x739a('0x27')]);}}return _0x3ec735;}function getSquareProject(_0xc735e1,_0x14f4a8){rpc['getSquareProject'](_0xc735e1)[_0x739a('0x28')](function(_0x492777){_0x14f4a8(null,_0x492777);})[_0x739a('0x29')](function(_0x3af179){_0x14f4a8(null,_0x3af179);});}function createSquareReport(_0x5aef1a,_0x11aef6){rpc['createSquareReport'](_0x5aef1a)[_0x739a('0x28')](function(_0x3e256e){if(_0x11aef6){_0x11aef6(null,_0x3e256e);}})[_0x739a('0x29')](function(_0x435f5a){if(_0x11aef6){_0x11aef6(null,_0x435f5a);}});}function setChannelVariables(_0x4e8cd0){for(var _0x1fea59 in _0x4e8cd0){if(_0x4e8cd0[_0x739a('0x20')](_0x1fea59)){if(_0x1fea59[_0x739a('0x2a')](_0x739a('0x2b'))===0x0){_0x4e8cd0[_0x1fea59['substring'](0x4)]=_0x4e8cd0[_0x1fea59];delete _0x4e8cd0[_0x1fea59];}}}}function getLogFromObject(_0x50f569){return util['inspect'](_0x50f569,{'showHidden':![],'depth':null});}function agiHandler(_0x269370){var _0xcaa390,_0x4bbb1e,_0x230787,_0x448a30,_0x5d7857;logger[_0x739a('0x2c')](_0x739a('0x2d'),JSON[_0x739a('0x2e')](_0x269370,null,0x2));logger['info'](util[_0x739a('0x19')](_0x739a('0x2f'),_0x269370[_0x739a('0x15')],_0x269370[_0x739a('0x16')],_0x269370[_0x739a('0x17')],_0x269370[_0x739a('0x1b')],_0x269370[_0x739a('0x18')]));_0x269370['on'](_0x739a('0xc'),errorHandler);_0x269370['on'](_0x739a('0x30'),closeHandler);_0x269370['on'](_0x739a('0x31'),timeoutHandler);_0x269370[_0x739a('0x32')]=![];_0x269370['on'](_0x739a('0x33'),hangupHandler);var _0x3351ec=getSquareProject[_0x739a('0x34')](null,_0x269370[_0x739a('0x15')]);if(_0x3351ec){if(_0x3351ec[_0x739a('0x35')]){_0xcaa390=getRoot(_0x3351ec[_0x739a('0x35')]);if(_0xcaa390&&_0xcaa390[_0x739a('0x36')]){logger[_0x739a('0x2c')](_0x739a('0x1e'),JSON[_0x739a('0x2e')](_0xcaa390,null,0x2));_0x269370[_0x739a('0x37')]=moment()[_0x739a('0x19')](_0x739a('0x38'));_0x4bbb1e=initGraph(_[_0x739a('0x39')](_0xcaa390,_0x739a('0x3a')),_0xcaa390[_0x739a('0x3a')]);_0x230787=new Vertices(_0x269370,rpc,mailRpc);logger[_0x739a('0x11')](util[_0x739a('0x19')](_0x739a('0x3b'),_0x269370[_0x739a('0x15')],_0x269370[_0x739a('0x16')],_0x269370[_0x739a('0x17')],_0x269370[_0x739a('0x1b')],_0x269370[_0x739a('0x18')]));_0x4bbb1e[_0x739a('0x3c')](_0xcaa390[_0x739a('0x36')]['id'],function(_0x4c6d84){try{_0x4c6d84=_0x230787[_0x739a('0x3d')](_0x4c6d84);logger['debug'](_0x739a('0x3e'),JSON[_0x739a('0x2e')](_0x4c6d84,null,0x2));if(_0x4c6d84[_0x739a('0x1f')]===_0x739a('0x3f')){logger['info'](_0x739a('0x40'));_0x269370[_0x739a('0x41')]=_0x4c6d84['context']||_0x269370[_0x739a('0x41')];_0x269370['extension']=_0x4c6d84[_0x739a('0x42')];_0x269370[_0x739a('0x43')]=_0x4c6d84[_0x739a('0x43')]?_0x4c6d84['priority']-0x1:0x1;return null;}else if(_0x4c6d84&&_0x230787[_0x4c6d84[_0x739a('0x1f')]]){_0x5d7857=_0x230787[_0x4c6d84['agicommand']](_0x4c6d84);logger[_0x739a('0x11')](_0x739a('0x44'),JSON['stringify'](_0x5d7857,null,0x2));if(_0x5d7857&&_0x5d7857['code']===AGI_CODE_SUCCESS&&_0x5d7857[_0x739a('0x45')]!==AGI_RESULT_ERROR&&!_0x269370[_0x739a('0x32')]){logger[_0x739a('0x2c')](_0x739a('0x44'),getLogFromObject(_0x5d7857));return _[_0x739a('0x46')](_0x5d7857[_0x739a('0x45')])?null:_0x5d7857[_0x739a('0x45')][_0x739a('0x47')]();}else{logger[_0x739a('0xc')](_0x739a('0x44'),getLogFromObject(_0x5d7857));return null;}}else{logger[_0x739a('0xc')](_0x739a('0x48'));return null;}}catch(_0x5ab528){logger[_0x739a('0xc')](_0x5ab528[_0x739a('0xd')]);return null;}});if(_0xcaa390['finally']){logger[_0x739a('0x11')](util['format'](_0x739a('0x49'),_0x269370[_0x739a('0x15')],_0x269370['calleridname'],_0x269370[_0x739a('0x17')],_0x269370[_0x739a('0x1b')],_0x269370['uniqueid']));_0x4bbb1e[_0x739a('0x3c')](_0xcaa390[_0x739a('0x4a')]['id'],function(_0x38748e){try{_0x38748e=_0x230787['clear'](_0x38748e);logger[_0x739a('0x2c')](_0x739a('0x3e'),JSON['stringify'](_0x38748e,null,0x2));if(_0x38748e&&_0x230787[_0x38748e[_0x739a('0x1f')]]){_0x5d7857=_0x230787[_0x38748e[_0x739a('0x1f')]](_0x38748e);if(_0x5d7857){logger['debug'](_0x739a('0x44'),getLogFromObject(_0x5d7857));return _[_0x739a('0x46')](_0x5d7857[_0x739a('0x45')])?null:_0x5d7857[_0x739a('0x45')][_0x739a('0x47')]();}else{logger['error'](_0x739a('0x44'),getLogFromObject(_0x5d7857));return null;}}else{logger[_0x739a('0xc')](_0x739a('0x48'));return null;}}catch(_0x56a02d){logger[_0x739a('0xc')](_0x56a02d['stack']);return null;}});}logger[_0x739a('0x11')](util['format'](_0x739a('0x4b'),_0x269370[_0x739a('0x15')],_0x269370['calleridname'],_0x269370[_0x739a('0x17')],_0x269370[_0x739a('0x1b')],_0x269370[_0x739a('0x18')]));logger[_0x739a('0x11')](util[_0x739a('0x19')](_0x739a('0x4c'),_0x269370[_0x739a('0x41')],_0x269370['extension'],parseInt(_0x269370[_0x739a('0x43')],0xa)+0x1));_0x269370[_0x739a('0x4d')](_0x269370[_0x739a('0x41')],_0x269370[_0x739a('0x42')],parseInt(_0x269370[_0x739a('0x43')],0xa)+0x1);_0x269370[_0x739a('0x30')]();}}else{logger[_0x739a('0xc')](util[_0x739a('0x19')](_0x739a('0x4e'),_0x269370[_0x739a('0x15')]));_0x269370[_0x739a('0x4d')](_0x269370['context'],_0x269370[_0x739a('0x42')],parseInt(_0x269370[_0x739a('0x43')],0xa)+0x1);_0x269370['close']();}}else{logger[_0x739a('0xc')](util[_0x739a('0x19')](_0x739a('0x4f'),_0x269370[_0x739a('0x15')]));_0x269370['continueAt'](_0x269370[_0x739a('0x41')],_0x269370[_0x739a('0x42')],parseInt(_0x269370[_0x739a('0x43')],0xa)+0x1);_0x269370[_0x739a('0x30')]();}}function main(){var _0x56518a;return utilLicense[_0x739a('0x50')]()[_0x739a('0x28')](function(_0x335b76){if(_0x335b76){if(_0x335b76[_0x739a('0x51')]){if(_0x335b76['callysquare']&&_0x335b76[_0x739a('0x52')]>0x0){logger[_0x739a('0x11')](util[_0x739a('0x19')](_0x739a('0x53'),_0x335b76[_0x739a('0x52')]));_0x56518a=_0x335b76['callysquare'];}else{logger[_0x739a('0x11')](_0x739a('0x54'));}}else{logger[_0x739a('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x56518a=-0x1;}}})[_0x739a('0x29')](function(_0x53afae){logger['error'](_0x739a('0x55'),_0x53afae[_0x739a('0xd')]);})[_0x739a('0x4a')](function(){var _0x25e6e0=require(_0x739a('0x56'))(config[_0x739a('0x5')][_0x739a('0x10')],config[_0x739a('0x5')]['ip'],_0x56518a);_0x25e6e0['on'](_0x739a('0xc'),errorHandler);_0x25e6e0['on']('listening',listeningHandler);_0x25e6e0['on'](_0x739a('0x57'),connectionHandler);_0x25e6e0['on'](_0x739a('0x30'),closeHandler);});}main(); \ No newline at end of file +var _0x0b22=['retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','stringify','close','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','isUndefined','response','agicommand\x20not\x20found','vertex','toString','[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','Project\x20%s\x20not\x20published','continueAt','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','port','listening','connection','lodash','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','root','agicommand'];(function(_0xa7010f,_0x734798){var _0x3f4f92=function(_0x20fc42){while(--_0x20fc42){_0xa7010f['push'](_0xa7010f['shift']());}};_0x3f4f92(++_0x734798);}(_0x0b22,0x18d));var _0x20b2=function(_0x2e594d,_0x459d78){_0x2e594d=_0x2e594d-0x0;var _0x535059=_0x0b22[_0x2e594d];return _0x535059;};'use strict';var parser=require('xml2json');var _=require(_0x20b2('0x0'));var syncho=require('syncho');var util=require('util');var moment=require(_0x20b2('0x1'));var config=require(_0x20b2('0x2'));var logger=require(_0x20b2('0x3'))(_0x20b2('0x4'));var utilLicense=require(_0x20b2('0x5'));var rpc=require(_0x20b2('0x6'));var mailRpc=require(_0x20b2('0x7'));var Graph=require(_0x20b2('0x8'));var Vertices=require(_0x20b2('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x20b2('0x4')]=_['defaults'](config['agi'],{'ip':_0x20b2('0xa'),'port':0x11dd});function connectionHandler(_0x12fa87){process[_0x20b2('0xb')](function(){syncho(function(){try{setChannelVariables(_0x12fa87);agiHandler(_0x12fa87);}catch(_0xc05cf0){logger[_0x20b2('0xc')](_0xc05cf0['stack']);}});});}function listeningHandler(){console['log'](_0x20b2('0xd'),config[_0x20b2('0x4')]['port']);logger[_0x20b2('0xe')](util[_0x20b2('0xf')](_0x20b2('0x10'),config[_0x20b2('0x4')]['ip'],config[_0x20b2('0x4')]['port']));}function errorHandler(_0x444784){if(_0x444784&&_0x444784['name']&&_0x444784[_0x20b2('0x11')]){logger[_0x20b2('0xc')](util[_0x20b2('0xf')](_0x20b2('0x12'),_0x444784[_0x20b2('0x13')],_0x444784[_0x20b2('0x11')]));}else{logger['error'](util['format'](_0x20b2('0x14'),_0x444784[_0x20b2('0x15')]));}}function closeHandler(){logger['info'](util['format'](_0x20b2('0x16'),this[_0x20b2('0x17')],this[_0x20b2('0x18')],this[_0x20b2('0x19')],this[_0x20b2('0x1a')],this[_0x20b2('0x1b')]));try{createSquareReport(this);}catch(_0x595187){logger[_0x20b2('0xc')](_0x595187[_0x20b2('0x15')]);}}function timeoutHandler(){logger[_0x20b2('0xe')](util[_0x20b2('0xf')](_0x20b2('0x1c'),this[_0x20b2('0x17')],this[_0x20b2('0x18')],this[_0x20b2('0x19')],this[_0x20b2('0x1a')],this[_0x20b2('0x1b')]));}function hangupHandler(){logger[_0x20b2('0xe')](util[_0x20b2('0xf')](_0x20b2('0x1d'),this[_0x20b2('0x17')],this[_0x20b2('0x18')],this['callerid'],this[_0x20b2('0x1a')],this[_0x20b2('0x1b')]));this[_0x20b2('0x1e')]=!![];}function getRoot(_0xe28de){return parser['toJson'](_0xe28de,{'object':!![]})['mxGraphModel'][_0x20b2('0x1f')];}function addVertex(_0x68919e,_0x589a1d,_0x47e2ec){_0x589a1d[_0x20b2('0x20')]=_0x47e2ec;if(_0x589a1d['hasOwnProperty']('retry')){_0x589a1d['maxRetry']=parseInt(_0x589a1d[_0x20b2('0x21')],0xa);}_0x68919e[_0x20b2('0x22')](_[_0x20b2('0x23')](_0x589a1d,_0x20b2('0x24')));}function initGraph(_0x5c262f,_0x55271c){var _0x4653e2=new Graph();for(var _0x34aad8 in _0x5c262f){if(_0x5c262f[_0x20b2('0x25')](_0x34aad8)){if(_[_0x20b2('0x26')](_0x5c262f[_0x34aad8])){for(var _0x2ec0a4=0x0;_0x2ec0a4<_0x5c262f[_0x34aad8][_0x20b2('0x27')];_0x2ec0a4+=0x1){addVertex(_0x4653e2,_0x5c262f[_0x34aad8][_0x2ec0a4],_0x34aad8);}}else{addVertex(_0x4653e2,_0x5c262f[_0x34aad8],_0x34aad8);}}}for(var _0x441500=0x0;_0x441500<_0x55271c['length'];_0x441500+=0x1){if(_0x55271c[_0x441500][_0x20b2('0x28')]&&_0x55271c[_0x441500][_0x20b2('0x29')]){_0x4653e2['addEdge'](_0x55271c[_0x441500][_0x20b2('0x28')],_0x55271c[_0x441500][_0x20b2('0x29')],_0x55271c[_0x441500][_0x20b2('0x2a')]);}}return _0x4653e2;}function getSquareProject(_0x59a1f0,_0x5af9f7){rpc[_0x20b2('0x2b')](_0x59a1f0)[_0x20b2('0x2c')](function(_0x52185d){_0x5af9f7(null,_0x52185d);})['catch'](function(_0x2e80bc){_0x5af9f7(null,_0x2e80bc);});}function createSquareReport(_0x50b5a7,_0x10d4e0){rpc[_0x20b2('0x2d')](_0x50b5a7)['then'](function(_0x2c39cf){if(_0x10d4e0){_0x10d4e0(null,_0x2c39cf);}})[_0x20b2('0x2e')](function(_0x4b4d2b){if(_0x10d4e0){_0x10d4e0(null,_0x4b4d2b);}});}function setChannelVariables(_0x74fb06){for(var _0x66b186 in _0x74fb06){if(_0x74fb06[_0x20b2('0x25')](_0x66b186)){if(_0x66b186[_0x20b2('0x2f')](_0x20b2('0x30'))===0x0){_0x74fb06[_0x66b186[_0x20b2('0x31')](0x4)]=_0x74fb06[_0x66b186];delete _0x74fb06[_0x66b186];}}}}function getLogFromObject(_0x32451c){return util[_0x20b2('0x32')](_0x32451c,{'showHidden':![],'depth':null});}function agiHandler(_0x558ccc){var _0x2263a0,_0x363fe9,_0x316e8d,_0x10c5ee,_0x3bb3f3;logger[_0x20b2('0x33')]('variables',JSON[_0x20b2('0x34')](_0x558ccc,null,0x2));logger[_0x20b2('0xe')](util[_0x20b2('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x558ccc[_0x20b2('0x17')],_0x558ccc['calleridname'],_0x558ccc['callerid'],_0x558ccc[_0x20b2('0x1a')],_0x558ccc[_0x20b2('0x1b')]));_0x558ccc['on'](_0x20b2('0xc'),errorHandler);_0x558ccc['on'](_0x20b2('0x35'),closeHandler);_0x558ccc['on']('timeout',timeoutHandler);_0x558ccc[_0x20b2('0x1e')]=![];_0x558ccc['on'](_0x20b2('0x36'),hangupHandler);var _0x2629d4=getSquareProject[_0x20b2('0x37')](null,_0x558ccc[_0x20b2('0x17')]);if(_0x2629d4){if(_0x2629d4[_0x20b2('0x38')]){_0x2263a0=getRoot(_0x2629d4['production']);if(_0x2263a0&&_0x2263a0[_0x20b2('0x39')]){logger[_0x20b2('0x33')](_0x20b2('0x1f'),JSON[_0x20b2('0x34')](_0x2263a0,null,0x2));_0x558ccc[_0x20b2('0x3a')]=moment()[_0x20b2('0xf')](_0x20b2('0x3b'));_0x363fe9=initGraph(_[_0x20b2('0x23')](_0x2263a0,'mxCell'),_0x2263a0[_0x20b2('0x24')]);_0x316e8d=new Vertices(_0x558ccc,rpc,mailRpc);logger['info'](util[_0x20b2('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x558ccc['arg_1'],_0x558ccc[_0x20b2('0x18')],_0x558ccc[_0x20b2('0x19')],_0x558ccc['dnid'],_0x558ccc[_0x20b2('0x1b')]));_0x363fe9[_0x20b2('0x3c')](_0x2263a0['start']['id'],function(_0x1eaf38){try{_0x1eaf38=_0x316e8d[_0x20b2('0x3d')](_0x1eaf38);logger[_0x20b2('0x33')]('vertex',JSON[_0x20b2('0x34')](_0x1eaf38,null,0x2));if(_0x1eaf38[_0x20b2('0x20')]===_0x20b2('0x3e')){logger[_0x20b2('0xe')](_0x20b2('0x3f'));_0x558ccc[_0x20b2('0x40')]=_0x1eaf38[_0x20b2('0x40')]||_0x558ccc[_0x20b2('0x40')];_0x558ccc[_0x20b2('0x41')]=_0x1eaf38[_0x20b2('0x41')];_0x558ccc[_0x20b2('0x42')]=_0x1eaf38['priority']?_0x1eaf38[_0x20b2('0x42')]-0x1:0x1;return null;}else if(_0x1eaf38&&_0x316e8d[_0x1eaf38[_0x20b2('0x20')]]){_0x3bb3f3=_0x316e8d[_0x1eaf38[_0x20b2('0x20')]](_0x1eaf38);logger[_0x20b2('0xe')]('response',JSON['stringify'](_0x3bb3f3,null,0x2));if(_0x3bb3f3&&_0x3bb3f3[_0x20b2('0x43')]===AGI_CODE_SUCCESS&&_0x3bb3f3[_0x20b2('0x44')]!==AGI_RESULT_ERROR&&!_0x558ccc[_0x20b2('0x1e')]){logger['debug']('response',getLogFromObject(_0x3bb3f3));return _[_0x20b2('0x45')](_0x3bb3f3[_0x20b2('0x44')])?null:_0x3bb3f3['result']['toString']();}else{logger[_0x20b2('0xc')](_0x20b2('0x46'),getLogFromObject(_0x3bb3f3));return null;}}else{logger[_0x20b2('0xc')](_0x20b2('0x47'));return null;}}catch(_0x5aac9d){logger['error'](_0x5aac9d[_0x20b2('0x15')]);return null;}});if(_0x2263a0['finally']){logger[_0x20b2('0xe')](util[_0x20b2('0xf')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x558ccc['arg_1'],_0x558ccc['calleridname'],_0x558ccc[_0x20b2('0x19')],_0x558ccc[_0x20b2('0x1a')],_0x558ccc[_0x20b2('0x1b')]));_0x363fe9[_0x20b2('0x3c')](_0x2263a0['finally']['id'],function(_0x121b85){try{_0x121b85=_0x316e8d['clear'](_0x121b85);logger['debug'](_0x20b2('0x48'),JSON[_0x20b2('0x34')](_0x121b85,null,0x2));if(_0x121b85&&_0x316e8d[_0x121b85['agicommand']]){_0x3bb3f3=_0x316e8d[_0x121b85[_0x20b2('0x20')]](_0x121b85);if(_0x3bb3f3){logger['debug'](_0x20b2('0x46'),getLogFromObject(_0x3bb3f3));return _[_0x20b2('0x45')](_0x3bb3f3['result'])?null:_0x3bb3f3[_0x20b2('0x44')][_0x20b2('0x49')]();}else{logger[_0x20b2('0xc')]('response',getLogFromObject(_0x3bb3f3));return null;}}else{logger[_0x20b2('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x89cee9){logger[_0x20b2('0xc')](_0x89cee9['stack']);return null;}});}logger['info'](util[_0x20b2('0xf')](_0x20b2('0x4a'),_0x558ccc[_0x20b2('0x17')],_0x558ccc[_0x20b2('0x18')],_0x558ccc[_0x20b2('0x19')],_0x558ccc[_0x20b2('0x1a')],_0x558ccc[_0x20b2('0x1b')]));logger['info'](util[_0x20b2('0xf')](_0x20b2('0x4b'),_0x558ccc['context'],_0x558ccc['extension'],parseInt(_0x558ccc[_0x20b2('0x42')],0xa)+0x1));_0x558ccc['continueAt'](_0x558ccc[_0x20b2('0x40')],_0x558ccc[_0x20b2('0x41')],parseInt(_0x558ccc['priority'],0xa)+0x1);_0x558ccc['close']();}}else{logger[_0x20b2('0xc')](util['format'](_0x20b2('0x4c'),_0x558ccc[_0x20b2('0x17')]));_0x558ccc[_0x20b2('0x4d')](_0x558ccc[_0x20b2('0x40')],_0x558ccc[_0x20b2('0x41')],parseInt(_0x558ccc['priority'],0xa)+0x1);_0x558ccc[_0x20b2('0x35')]();}}else{logger[_0x20b2('0xc')](util[_0x20b2('0xf')]('Project\x20%s\x20not\x20found',_0x558ccc[_0x20b2('0x17')]));_0x558ccc['continueAt'](_0x558ccc[_0x20b2('0x40')],_0x558ccc[_0x20b2('0x41')],parseInt(_0x558ccc[_0x20b2('0x42')],0xa)+0x1);_0x558ccc[_0x20b2('0x35')]();}}function main(){var _0x327e79;return utilLicense['getLicense']()['then'](function(_0x33a419){if(_0x33a419){if(_0x33a419[_0x20b2('0x4e')]){if(_0x33a419[_0x20b2('0x4f')]&&_0x33a419['callysquare']>0x0){logger[_0x20b2('0xe')](util[_0x20b2('0xf')]('[LICENSE]\x20CHANNELS:\x20%s',_0x33a419[_0x20b2('0x4f')]));_0x327e79=_0x33a419[_0x20b2('0x4f')];}else{logger[_0x20b2('0xe')](_0x20b2('0x50'));}}else{logger[_0x20b2('0xe')](_0x20b2('0x51'));_0x327e79=-0x1;}}})[_0x20b2('0x2e')](function(_0x140def){logger['error']('[LICENSE]',_0x140def[_0x20b2('0x15')]);})[_0x20b2('0x52')](function(){var _0x426baf=require('./server')(config[_0x20b2('0x4')][_0x20b2('0x53')],config[_0x20b2('0x4')]['ip'],_0x327e79);_0x426baf['on']('error',errorHandler);_0x426baf['on'](_0x20b2('0x54'),listeningHandler);_0x426baf['on'](_0x20b2('0x55'),connectionHandler);_0x426baf['on'](_0x20b2('0x35'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 960fcd1..2825c7d 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 _0xd7e7=['message','bluebird','client','http','request','error'];(function(_0x36d9fd,_0x3778a5){var _0x48f05a=function(_0x41defb){while(--_0x41defb){_0x36d9fd['push'](_0x36d9fd['shift']());}};_0x48f05a(++_0x3778a5);}(_0xd7e7,0x127));var _0x7d7e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd7e7[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0x7d7e('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x7d7e('0x1')][_0x7d7e('0x2')]({'port':0x232b});function request(_0x5d7291,_0x4cd73d){return new BPromise(function(_0x32ae03,_0x8b7c76){return client[_0x7d7e('0x3')](_0x5d7291,_0x4cd73d)['then'](function(_0x4c3345){if(_0x4c3345[_0x7d7e('0x4')]){return _0x8b7c76(_0x4c3345[_0x7d7e('0x4')][_0x7d7e('0x5')]);}else{return _0x32ae03(_0x4c3345['result']);}})['catch'](function(_0x59beeb){return _0x8b7c76(_0x59beeb);});});}exports['sendMailMessage']=function(_0x31f871,_0x3d332a){return request('SendMail',{'account':_0x31f871,'message':_0x3d332a});}; \ No newline at end of file +var _0x8216=['client','http','request','then','error','message','result','sendMailMessage','bluebird','jayson/promise'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x8216,0x148));var _0x6821=function(_0x4a32a7,_0x43a0ef){_0x4a32a7=_0x4a32a7-0x0;var _0x4b5fcc=_0x8216[_0x4a32a7];return _0x4b5fcc;};'use strict';var BPromise=require(_0x6821('0x0'));var jayson=require(_0x6821('0x1'));var client=jayson[_0x6821('0x2')][_0x6821('0x3')]({'port':0x232b});function request(_0x241f2b,_0x4c6ef2){return new BPromise(function(_0x215bfe,_0x34c967){return client[_0x6821('0x4')](_0x241f2b,_0x4c6ef2)[_0x6821('0x5')](function(_0x4ae156){if(_0x4ae156[_0x6821('0x6')]){return _0x34c967(_0x4ae156[_0x6821('0x6')][_0x6821('0x7')]);}else{return _0x215bfe(_0x4ae156[_0x6821('0x8')]);}})['catch'](function(_0x240407){return _0x34c967(_0x240407);});});}exports[_0x6821('0x9')]=function(_0x294192,_0x25e443){return request('SendMail',{'account':_0x294192,'message':_0x25e443});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 2cb1e6e..0ea84bc 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 _0x90bc=['split','trim','slice','emit','headers','substring','line','exports','util','stream','Transform','call','prototype','\x0d\x0a\x0d\x0a','_localBuffer','toString','_inBody','indexOf','length'];(function(_0x2e4a84,_0x3de6e1){var _0x16ffe8=function(_0x43382f){while(--_0x43382f){_0x2e4a84['push'](_0x2e4a84['shift']());}};_0x16ffe8(++_0x3de6e1);}(_0x90bc,0x14b));var _0xc90b=function(_0x29ca62,_0x419b55){_0x29ca62=_0x29ca62-0x0;var _0xc24bf9=_0x90bc[_0x29ca62];return _0xc24bf9;};'use strict';var util=require(_0xc90b('0x0'));var Transform=require(_0xc90b('0x1'))[_0xc90b('0x2')];function AGIReply(_0x1d0ce4){Transform[_0xc90b('0x3')](this,_0x1d0ce4);this['_localBuffer']='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xc90b('0x4')]['_transform']=function(_0x22621f,_0x4cd059,_0x944894){var _0x2fdbf3='\x0a',_0x77091f=['\x0a\x0a',_0xc90b('0x5')],_0x2aea8b=-0x1,_0x3a129b=-0x1,_0x56179a='',_0x1190ac=0x0,_0x38d414='',_0x54b2dc='';this[_0xc90b('0x6')]+=_0x22621f[_0xc90b('0x7')]();_0x38d414=this[_0xc90b('0x6')];if(!this[_0xc90b('0x8')]){_0x1190ac=0x0;while(_0x77091f[_0x1190ac]){while((_0x3a129b=_0x38d414[_0xc90b('0x9')](_0x77091f[_0x1190ac]))!=-0x1){_0x56179a=_0x77091f[_0x1190ac];_0x54b2dc=_0x38d414['substring'](0x0,_0x3a129b);_0x38d414=_0x38d414['substring'](_0x3a129b+_0x56179a[_0xc90b('0xa')]);var _0x4a31f1=_0x54b2dc[_0xc90b('0xb')](_0x2fdbf3),_0x50aa1d=0x0,_0x45e46b={},_0x5057f5='',_0x42a23d='',_0x3a434a=-0x1;while(_0x4a31f1[_0x50aa1d]){_0x3a434a=_0x4a31f1[_0x50aa1d][_0xc90b('0x9')](':');if(_0x3a434a!=-0x1){_0x5057f5=_0x4a31f1[_0x50aa1d]['slice'](0x0,_0x3a434a)[_0xc90b('0xc')]();_0x42a23d=_0x4a31f1[_0x50aa1d][_0xc90b('0xd')](_0x3a434a+0x1)[_0xc90b('0xc')]();if(_0x5057f5[_0xc90b('0xa')]>0x0){_0x45e46b[_0x5057f5]=_0x42a23d;}}else{}_0x50aa1d++;}this[_0xc90b('0xe')](_0xc90b('0xf'),_0x45e46b);this['_inBody']=!![];}_0x1190ac++;}this['_localBuffer']=_0x38d414;}else{while((_0x2aea8b=_0x38d414[_0xc90b('0x9')](_0x2fdbf3))!=-0x1){_0x54b2dc=_0x38d414[_0xc90b('0x10')](0x0,_0x2aea8b);this[_0xc90b('0xe')](_0xc90b('0x11'),_0x54b2dc);_0x38d414=_0x38d414['substring'](_0x2aea8b+_0x2fdbf3[_0xc90b('0xa')]);}this[_0xc90b('0x6')]=_0x38d414;}_0x944894();};module[_0xc90b('0x12')]=AGIReply; \ No newline at end of file +var _0x2d0a=['util','stream','Transform','call','_inBody','prototype','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports'];(function(_0x12ad14,_0x4bc04d){var _0x3bcb40=function(_0x61a655){while(--_0x61a655){_0x12ad14['push'](_0x12ad14['shift']());}};_0x3bcb40(++_0x4bc04d);}(_0x2d0a,0x17c));var _0xa2d0=function(_0x51c05a,_0x3133c3){_0x51c05a=_0x51c05a-0x0;var _0x1ed974=_0x2d0a[_0x51c05a];return _0x1ed974;};'use strict';var util=require(_0xa2d0('0x0'));var Transform=require(_0xa2d0('0x1'))[_0xa2d0('0x2')];function AGIReply(_0x41c828){Transform[_0xa2d0('0x3')](this,_0x41c828);this['_localBuffer']='';this[_0xa2d0('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xa2d0('0x5')]['_transform']=function(_0x4e4bf0,_0x3be4d5,_0x3f477d){var _0x3e19be='\x0a',_0x574877=['\x0a\x0a',_0xa2d0('0x6')],_0x552055=-0x1,_0x1b2ac3=-0x1,_0x447308='',_0x36fe90=0x0,_0x6998b6='',_0x536170='';this[_0xa2d0('0x7')]+=_0x4e4bf0[_0xa2d0('0x8')]();_0x6998b6=this['_localBuffer'];if(!this['_inBody']){_0x36fe90=0x0;while(_0x574877[_0x36fe90]){while((_0x1b2ac3=_0x6998b6[_0xa2d0('0x9')](_0x574877[_0x36fe90]))!=-0x1){_0x447308=_0x574877[_0x36fe90];_0x536170=_0x6998b6['substring'](0x0,_0x1b2ac3);_0x6998b6=_0x6998b6[_0xa2d0('0xa')](_0x1b2ac3+_0x447308[_0xa2d0('0xb')]);var _0x2248ba=_0x536170[_0xa2d0('0xc')](_0x3e19be),_0x45d222=0x0,_0x1adbbc={},_0x284696='',_0x3626ed='',_0x467ed6=-0x1;while(_0x2248ba[_0x45d222]){_0x467ed6=_0x2248ba[_0x45d222]['indexOf'](':');if(_0x467ed6!=-0x1){_0x284696=_0x2248ba[_0x45d222][_0xa2d0('0xd')](0x0,_0x467ed6)[_0xa2d0('0xe')]();_0x3626ed=_0x2248ba[_0x45d222][_0xa2d0('0xd')](_0x467ed6+0x1)[_0xa2d0('0xe')]();if(_0x284696[_0xa2d0('0xb')]>0x0){_0x1adbbc[_0x284696]=_0x3626ed;}}else{}_0x45d222++;}this[_0xa2d0('0xf')](_0xa2d0('0x10'),_0x1adbbc);this[_0xa2d0('0x4')]=!![];}_0x36fe90++;}this[_0xa2d0('0x7')]=_0x6998b6;}else{while((_0x552055=_0x6998b6[_0xa2d0('0x9')](_0x3e19be))!=-0x1){_0x536170=_0x6998b6[_0xa2d0('0xa')](0x0,_0x552055);this['emit'](_0xa2d0('0x11'),_0x536170);_0x6998b6=_0x6998b6[_0xa2d0('0xa')](_0x552055+_0x3e19be[_0xa2d0('0xb')]);}this[_0xa2d0('0x7')]=_0x6998b6;}_0x3f477d();};module[_0xa2d0('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 94d6c53..4028d54 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 _0x31f4=['http','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getTrunkById','getSoundById','save_name','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x31f4,0x189));var _0x431f=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x31f4[_0xef8146];return _0x5a6cb0;};'use strict';var BPromise=require(_0x431f('0x0'));var moment=require(_0x431f('0x1'));var _=require(_0x431f('0x2'));var util=require(_0x431f('0x3'));var jayson=require(_0x431f('0x4'));var client=jayson[_0x431f('0x5')][_0x431f('0x6')]({'port':0x2329});function request(_0x3f8053,_0x55e878){return new BPromise(function(_0x46b752,_0x1959e4){return client['request'](_0x3f8053,_0x55e878)[_0x431f('0x7')](function(_0x4392c0){if(_0x4392c0[_0x431f('0x8')]){return _0x1959e4(_0x4392c0[_0x431f('0x8')][_0x431f('0x9')]);}else{return _0x46b752(_0x4392c0[_0x431f('0xa')]);}})[_0x431f('0xb')](function(_0x16af4b){return _0x1959e4(_0x16af4b);});});}exports[_0x431f('0xc')]=function(_0x4b0771){return request(_0x431f('0xd'),{'options':{'raw':![],'where':{'name':_0x4b0771},'attributes':[_0x431f('0xe')]}});};exports[_0x431f('0xf')]=function(_0x4a3e2c){return request(_0x431f('0x10'),{'options':{'raw':![],'where':{'id':_0x4a3e2c},'include':[{'model':_0x431f('0x11'),'as':_0x431f('0x12')}],'attributes':['id','name',_0x431f('0x13')]}});};exports[_0x431f('0x14')]=function(_0x1ef352){return request(_0x431f('0xd'),{'options':{'where':{'id':_0x1ef352},'attributes':[_0x431f('0x15')]}});};exports[_0x431f('0x16')]=function(_0x59835d){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x59835d},'attributes':[_0x431f('0x15')]}});};exports[_0x431f('0x17')]=function(_0x2e28ef){return request(_0x431f('0x18'),{'options':{'where':{'id':_0x2e28ef},'attributes':['name']}});};exports[_0x431f('0x19')]=function(_0x571896){return request(_0x431f('0x1a'),{'options':{'where':{'id':_0x571896},'attributes':[_0x431f('0x1b')]}});};exports[_0x431f('0x1c')]=function(_0x38f864){return request('ShowUser',{'options':{'where':{'id':_0x38f864},'attributes':[_0x431f('0x15')]}});};exports[_0x431f('0x1d')]=function(_0x456159){return request('ShowTrunk',{'options':{'where':{'id':_0x456159},'attributes':[_0x431f('0x15')]}});};exports[_0x431f('0x1e')]=function(_0xd1c48a){return request('ShowSound',{'options':{'where':{'id':_0xd1c48a},'attributes':[_0x431f('0x1f')]}});};exports['getIntervalById']=function(_0x37e5db){return request(_0x431f('0x20'),{'options':{'raw':![],'where':{'id':_0x37e5db},'include':[{'model':_0x431f('0x21'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x16b1f4){return request(_0x431f('0x22'),{'options':{'where':{'id':_0x16b1f4},'attributes':['id',_0x431f('0x15')]}});};exports[_0x431f('0x23')]=function(_0x219d54){return request('CreateSmsMessage',{'body':_0x219d54});};exports['createSquareDetailsReport']=function(_0x598955){return request(_0x431f('0x24'),{'body':_0x598955});};exports[_0x431f('0x25')]=function(_0x329b6f){return request(_0x431f('0x26'),{'body':_[_0x431f('0x27')](_0x329b6f,{'project_name':_0x329b6f[_0x431f('0x28')],'prev_project_name':_0x329b6f[_0x431f('0x29')]||'','is_subproject':_0x329b6f[_0x431f('0x29')]?!![]:![],'leaveAt':moment()[_0x431f('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x431f('0x2b')]=function(_0xf8a7ef){return request('CreateSquareRecording',{'body':_0xf8a7ef});};exports[_0x431f('0x2c')]=function(_0x8ae081){return request(_0x431f('0x2d'),{'body':_0x8ae081});};exports['createCmContact']=function(_0x269759){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x269759[_0x431f('0x2e')],'ListId':_0x269759[_0x431f('0x2f')]}}})[_0x431f('0x7')](function(_0x5f1a44){if(_0x5f1a44){return _0x5f1a44;}return request('CreateCmContact',{'body':_0x269759});});};exports[_0x431f('0x30')]=function(_0x3fc071){return request(_0x431f('0x31'),{'options':{'where':{'id':_0x3fc071},'attributes':[_0x431f('0x15')]}});};exports['agentLogin']=function(_0x322a7,_0x144886){return request(_0x431f('0x32'),{'body':{'interface':_0x144886},'options':{'where':_0x322a7}});};exports[_0x431f('0x33')]=function(_0x21226c,_0x4a7822,_0xa8c69a){return request(_0x431f('0x34'),{'body':{'type':_0x4a7822,'uniqueid':_0xa8c69a},'options':{'where':_0x21226c}});};exports[_0x431f('0x35')]=function(_0x38273a){return request(_0x431f('0x36'),{'body':{},'options':{'where':_0x38273a}});};exports[_0x431f('0x37')]=function(_0x557083){return request(_0x431f('0x38'),{'body':{},'options':{'where':_0x557083}});}; \ No newline at end of file +var _0x748b=['merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','http','request','then','error','message','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareReport'];(function(_0x46da90,_0x35aa67){var _0x5cc036=function(_0x5c7150){while(--_0x5c7150){_0x46da90['push'](_0x46da90['shift']());}};_0x5cc036(++_0x35aa67);}(_0x748b,0xc2));var _0xb748=function(_0x55f82b,_0x2623ef){_0x55f82b=_0x55f82b-0x0;var _0xe5285b=_0x748b[_0x55f82b];return _0xe5285b;};'use strict';var BPromise=require(_0xb748('0x0'));var moment=require(_0xb748('0x1'));var _=require('lodash');var util=require('util');var jayson=require('jayson/promise');var client=jayson['client'][_0xb748('0x2')]({'port':0x2329});function request(_0x1ed262,_0x1e5dc0){return new BPromise(function(_0x42d9e4,_0xa6addf){return client[_0xb748('0x3')](_0x1ed262,_0x1e5dc0)[_0xb748('0x4')](function(_0x2c1b49){if(_0x2c1b49[_0xb748('0x5')]){return _0xa6addf(_0x2c1b49['error'][_0xb748('0x6')]);}else{return _0x42d9e4(_0x2c1b49['result']);}})['catch'](function(_0x20a49c){return _0xa6addf(_0x20a49c);});});}exports[_0xb748('0x7')]=function(_0x36b17f){return request(_0xb748('0x8'),{'options':{'raw':![],'where':{'name':_0x36b17f},'attributes':[_0xb748('0x9')]}});};exports[_0xb748('0xa')]=function(_0x4a23c3){return request(_0xb748('0xb'),{'options':{'raw':![],'where':{'id':_0x4a23c3},'include':[{'model':_0xb748('0xc'),'as':_0xb748('0xd')}],'attributes':['id','name',_0xb748('0xe')]}});};exports['getSquareProjectById']=function(_0x522818){return request(_0xb748('0x8'),{'options':{'where':{'id':_0x522818},'attributes':[_0xb748('0xf')]}});};exports[_0xb748('0x10')]=function(_0x286087){return request(_0xb748('0x11'),{'options':{'where':{'id':_0x286087},'attributes':[_0xb748('0xf')]}});};exports[_0xb748('0x12')]=function(_0x3afffd){return request(_0xb748('0x13'),{'options':{'where':{'id':_0x3afffd},'attributes':[_0xb748('0xf')]}});};exports[_0xb748('0x14')]=function(_0x2c1d91){return request(_0xb748('0x15'),{'options':{'where':{'id':_0x2c1d91},'attributes':[_0xb748('0x16')]}});};exports[_0xb748('0x17')]=function(_0xd16734){return request(_0xb748('0x18'),{'options':{'where':{'id':_0xd16734},'attributes':[_0xb748('0xf')]}});};exports[_0xb748('0x19')]=function(_0x5b6a3a){return request('ShowTrunk',{'options':{'where':{'id':_0x5b6a3a},'attributes':['name']}});};exports[_0xb748('0x1a')]=function(_0x524d22){return request(_0xb748('0x1b'),{'options':{'where':{'id':_0x524d22},'attributes':[_0xb748('0x1c')]}});};exports[_0xb748('0x1d')]=function(_0x30af5b){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x30af5b},'include':[{'model':_0xb748('0x1e'),'as':_0xb748('0x1f')}]}});};exports[_0xb748('0x20')]=function(_0x431975){return request(_0xb748('0x21'),{'options':{'where':{'id':_0x431975},'attributes':['id',_0xb748('0xf')]}});};exports[_0xb748('0x22')]=function(_0x713888){return request(_0xb748('0x23'),{'body':_0x713888});};exports[_0xb748('0x24')]=function(_0x1105ec){return request('CreateSquareDetailsReport',{'body':_0x1105ec});};exports['createSquareReport']=function(_0x5a6504){return request(_0xb748('0x25'),{'body':_[_0xb748('0x26')](_0x5a6504,{'project_name':_0x5a6504['arg_1'],'prev_project_name':_0x5a6504['arg_2']||'','is_subproject':_0x5a6504[_0xb748('0x27')]?!![]:![],'leaveAt':moment()[_0xb748('0x28')](_0xb748('0x29'))})});};exports[_0xb748('0x2a')]=function(_0x45f2a4){return request(_0xb748('0x2b'),{'body':_0x45f2a4});};exports['createSquareMessage']=function(_0x38af99){return request(_0xb748('0x2c'),{'body':_0x38af99});};exports[_0xb748('0x2d')]=function(_0x4f46ad){return request(_0xb748('0x2e'),{'options':{'raw':![],'where':{'phone':_0x4f46ad[_0xb748('0x2f')],'ListId':_0x4f46ad['ListId']}}})[_0xb748('0x4')](function(_0xea789b){if(_0xea789b){return _0xea789b;}return request(_0xb748('0x30'),{'body':_0x4f46ad});});};exports[_0xb748('0x31')]=function(_0x10a72a){return request(_0xb748('0x32'),{'options':{'where':{'id':_0x10a72a},'attributes':[_0xb748('0xf')]}});};exports[_0xb748('0x33')]=function(_0x56eab5,_0xb7395c){return request(_0xb748('0x34'),{'body':{'interface':_0xb7395c},'options':{'where':_0x56eab5}});};exports[_0xb748('0x35')]=function(_0x1af0a6,_0x4e9175,_0x25764a){return request('PauseUser',{'body':{'type':_0x4e9175,'uniqueid':_0x25764a},'options':{'where':_0x1af0a6}});};exports[_0xb748('0x36')]=function(_0x5736e4){return request(_0xb748('0x37'),{'body':{},'options':{'where':_0x5736e4}});};exports[_0xb748('0x38')]=function(_0x570e83){return request(_0xb748('0x39'),{'body':{},'options':{'where':_0x570e83}});}; \ 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 1d46dce..edebce9 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 _0x624c=['./lex','exports'];(function(_0x3314a3,_0x712212){var _0xc5d6a4=function(_0x34cac2){while(--_0x34cac2){_0x3314a3['push'](_0x3314a3['shift']());}};_0xc5d6a4(++_0x712212);}(_0x624c,0x1ee));var _0xc624=function(_0x5e3115,_0x540600){_0x5e3115=_0x5e3115-0x0;var _0x5a1dc6=_0x624c[_0x5e3115];return _0x5a1dc6;};var polly=require('./polly');var lex=require(_0xc624('0x0'));module[_0xc624('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xa381=['./lex','./polly'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0xa381,0x79));var _0x1a38=function(_0x330e84,_0x2c7017){_0x330e84=_0x330e84-0x0;var _0x21eb7c=_0xa381[_0x330e84];return _0x21eb7c;};var polly=require(_0x1a38('0x0'));var lex=require(_0x1a38('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 0c8627d..f74667e 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 _0xbdb7=['./lib/api','exports'];(function(_0x19635e,_0x431e63){var _0x5e7d75=function(_0x496792){while(--_0x496792){_0x19635e['push'](_0x19635e['shift']());}};_0x5e7d75(++_0x431e63);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x22da61,_0x237ba9){_0x22da61=_0x22da61-0x0;var _0x40b728=_0xbdb7[_0x22da61];return _0x40b728;};'use strict';var lex=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]=function(_0x44467d,_0x2a2c1c,_0x23c326,_0x433850,_0x4496ac,_0x2c7e07){return lex(_0x44467d,_0x2a2c1c,_0x23c326,_0x433850,_0x4496ac,_0x2c7e07);}; \ No newline at end of file +var _0x4483=['exports','./lib/api'];(function(_0x52dffe,_0x34ce19){var _0x24e4f9=function(_0x3064cb){while(--_0x3064cb){_0x52dffe['push'](_0x52dffe['shift']());}};_0x24e4f9(++_0x34ce19);}(_0x4483,0x1a3));var _0x3448=function(_0x1cb6d6,_0x2be258){_0x1cb6d6=_0x1cb6d6-0x0;var _0x279715=_0x4483[_0x1cb6d6];return _0x279715;};'use strict';var lex=require(_0x3448('0x0'));module[_0x3448('0x1')]=function(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178){return lex(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178);}; \ 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 cb2c9ff..78acee0 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(_0x10300c,_0x11081d){var _0x3d9b64=function(_0x270c72){while(--_0x270c72){_0x10300c['push'](_0x10300c['shift']());}};_0x3d9b64(++_0x11081d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x513d9a,_0x4e47da){var _0x3fe9d2=function(_0x31ab6a){while(--_0x31ab6a){_0x513d9a['push'](_0x513d9a['shift']());}};_0x3fe9d2(++_0x4e47da);}(_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 diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 74d03b2..e9b5c5a 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 _0xb4ed=['./lib/api'];(function(_0x3e5f69,_0x1eb2b1){var _0x55df21=function(_0x540c4c){while(--_0x540c4c){_0x3e5f69['push'](_0x3e5f69['shift']());}};_0x55df21(++_0x1eb2b1);}(_0xb4ed,0x1e1));var _0xdb4e=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0xb4ed[_0x127c7b];return _0x1708eb;};'use strict';var polly=require(_0xdb4e('0x0'));module['exports']=function(_0x27c9ab,_0x5b24ec,_0x1ca5c,_0x16ed00,_0x48245a,_0x4c1c37,_0x576eef){return polly(_0x27c9ab,_0x5b24ec,_0x1ca5c,_0x16ed00,_0x48245a,_0x4c1c37,_0x576eef);}; \ No newline at end of file +var _0xe32a=['exports'];(function(_0x524649,_0x32935f){var _0x29777c=function(_0x3d493c){while(--_0x3d493c){_0x524649['push'](_0x524649['shift']());}};_0x29777c(++_0x32935f);}(_0xe32a,0x1eb));var _0xae32=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xe32a[_0x36bf88];return _0x332914;};'use strict';var polly=require('./lib/api');module[_0xae32('0x0')]=function(_0x32f7d6,_0x22e068,_0x55f7c4,_0x331bcd,_0x52c2e9,_0x533f9c,_0xea660a){return polly(_0x32f7d6,_0x22e068,_0x55f7c4,_0x331bcd,_0x52c2e9,_0x533f9c,_0xea660a);}; \ 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 14e607f..85ebcca 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 _0x301f=['mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text'];(function(_0x125f16,_0x352485){var _0x241a58=function(_0x4a6e0b){while(--_0x4a6e0b){_0x125f16['push'](_0x125f16['shift']());}};_0x241a58(++_0x352485);}(_0x301f,0x1e7));var _0xf301=function(_0x1459ef,_0x3a1dea){_0x1459ef=_0x1459ef-0x0;var _0x51330c=_0x301f[_0x1459ef];return _0x51330c;};'use strict';var fs=require('fs');var path=require(_0xf301('0x0'));var BPromise=require(_0xf301('0x1'));var rs=require(_0xf301('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x5dff5a,_0x510d91,_0x5ea72b){return new BPromise(function(_0x360c27,_0x70346f){_0x5dff5a[_0xf301('0x3')](_0x510d91,function(_0x544a1a,_0x5f020c){if(_0x544a1a){_0x70346f(_0x544a1a);}else if(_0x5f020c){if(_0x5f020c[_0xf301('0x4')]instanceof Buffer){fs['writeFile'](_0x5ea72b,_0x5f020c[_0xf301('0x4')],function(_0x1f9a93){if(_0x1f9a93){_0x70346f(_0x1f9a93);}else{_0x360c27();}});}else{_0x70346f(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x70346f(new Error(_0xf301('0x5')));}});});}module[_0xf301('0x6')]=function(_0x49d624,_0x2c3ddd,_0x54be8c,_0x431e2a,_0x29ba8d,_0x161e40,_0x298db1){var _0x557db8=new AWS['Polly']({'accessKeyId':_0x49d624,'secretAccessKey':_0x2c3ddd,'region':_0x54be8c});var _0x51f408={'Text':_0x29ba8d,'TextType':_0x161e40||_0xf301('0x7'),'OutputFormat':_0xf301('0x8'),'VoiceId':_0x431e2a};return pollyResult(_0x557db8,_0x51f408,_0x298db1);}; \ No newline at end of file +var _0x7170=['aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x7170,0x1ac));var _0x0717=function(_0x1f51e7,_0x162a39){_0x1f51e7=_0x1f51e7-0x0;var _0x2a78dd=_0x7170[_0x1f51e7];return _0x2a78dd;};'use strict';var fs=require('fs');var path=require(_0x0717('0x0'));var BPromise=require('bluebird');var rs=require(_0x0717('0x1'));var AWS=require(_0x0717('0x2'));function pollyResult(_0x2820ce,_0x1469c3,_0x571e99){return new BPromise(function(_0x25a948,_0x2e13c6){_0x2820ce['synthesizeSpeech'](_0x1469c3,function(_0xa1c307,_0x44e6b6){if(_0xa1c307){_0x2e13c6(_0xa1c307);}else if(_0x44e6b6){if(_0x44e6b6[_0x0717('0x3')]instanceof Buffer){fs['writeFile'](_0x571e99,_0x44e6b6[_0x0717('0x3')],function(_0x12f4a4){if(_0x12f4a4){_0x2e13c6(_0x12f4a4);}else{_0x25a948();}});}else{_0x2e13c6(new Error(_0x0717('0x4')));}}else{_0x2e13c6(new Error(_0x0717('0x5')));}});});}module[_0x0717('0x6')]=function(_0x54baf4,_0x4321f6,_0x10d9a1,_0x42031a,_0x27c18e,_0x1c852a,_0x5cb0f9){var _0x40325b=new AWS[(_0x0717('0x7'))]({'accessKeyId':_0x54baf4,'secretAccessKey':_0x4321f6,'region':_0x10d9a1});var _0x51509b={'Text':_0x27c18e,'TextType':_0x1c852a||_0x0717('0x8'),'OutputFormat':_0x0717('0x9'),'VoiceId':_0x42031a};return pollyResult(_0x40325b,_0x51509b,_0x5cb0f9);}; \ 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 7b40cb5..c7f4411 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 _0x8203=['./lib/api','exports'];(function(_0x56a280,_0x1cf387){var _0x2b7d20=function(_0x37e642){while(--_0x37e642){_0x56a280['push'](_0x56a280['shift']());}};_0x2b7d20(++_0x1cf387);}(_0x8203,0x1da));var _0x3820=function(_0x1dfa5a,_0x1626ef){_0x1dfa5a=_0x1dfa5a-0x0;var _0x3b90d9=_0x8203[_0x1dfa5a];return _0x3b90d9;};'use strict';var asr=require(_0x3820('0x0'));module[_0x3820('0x1')]=function(_0x22970a,_0x4d84e1,_0x585a93,_0x4fec9f){return asr(_0x22970a,_0x4d84e1,_0x585a93);}; \ No newline at end of file +var _0xa14a=['./lib/api'];(function(_0xd6fa50,_0x5c66fd){var _0x142872=function(_0x154edc){while(--_0x154edc){_0xd6fa50['push'](_0xd6fa50['shift']());}};_0x142872(++_0x5c66fd);}(_0xa14a,0x6c));var _0xaa14=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xa14a[_0x1a36a5];return _0x746243;};'use strict';var asr=require(_0xaa14('0x0'));module['exports']=function(_0x1441b5,_0x20b1f0,_0x22af6e,_0x1655c1){return asr(_0x1441b5,_0x20b1f0,_0x22af6e);}; \ 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 da9bfd2..f51850f 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 _0x032a=['bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','8000'];(function(_0xd518ce,_0x5eb808){var _0x5f02f7=function(_0x4355fc){while(--_0x4355fc){_0xd518ce['push'](_0xd518ce['shift']());}};_0x5f02f7(++_0x5eb808);}(_0x032a,0xf0));var _0xa032=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x032a[_0x1facfa];return _0x9ec701;};'use strict';var url=require('url');var BPromise=require(_0xa032('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xa032('0x1')]=function(_0x39053e,_0x40e5b5,_0x2ee4ef){return new BPromise(function(_0x185934,_0x23ad84){var _0x24612f;if(typeof _0x39053e!==_0xa032('0x2')||_0x39053e[_0xa032('0x3')]===0x0){return _0x23ad84(_0xa032('0x4'));}if(typeof _0x40e5b5!==_0xa032('0x2')||_0x40e5b5[_0xa032('0x3')]===0x0){return _0x23ad84('key\x20should\x20be\x20a\x20string');}if(typeof _0x2ee4ef!==_0xa032('0x5')&&(typeof _0x2ee4ef!=='string'||_0x2ee4ef['length']===0x0)){return _0x23ad84(_0xa032('0x6'));}try{_0x24612f=fs['readFileSync'](_0x39053e)[_0xa032('0x7')](_0xa032('0x8'));}catch(_0x421ce5){return _0x23ad84(_0x421ce5);}return _0x185934({'method':_0xa032('0x9'),'uri':host+_0xa032('0xa')+_0x40e5b5,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa032('0xb'),'languageCode':_0x2ee4ef},'audio':{'content':_0x24612f}},'json':!![]});});}; \ No newline at end of file +var _0x94dc=['undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x4b6d56,_0xaa0a3e){var _0x477740=function(_0x446402){while(--_0x446402){_0x4b6d56['push'](_0x4b6d56['shift']());}};_0x477740(++_0xaa0a3e);}(_0x94dc,0xb1));var _0xc94d=function(_0x4f6aa7,_0xa03126){_0x4f6aa7=_0x4f6aa7-0x0;var _0x239cc6=_0x94dc[_0x4f6aa7];return _0x239cc6;};'use strict';var url=require(_0xc94d('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xc94d('0x1');module['exports']=function(_0x1645b0,_0x1b2070,_0x40e7d8){return new BPromise(function(_0x4b2dcc,_0x306706){var _0x41d4ec;if(typeof _0x1645b0!==_0xc94d('0x2')||_0x1645b0[_0xc94d('0x3')]===0x0){return _0x306706(_0xc94d('0x4'));}if(typeof _0x1b2070!==_0xc94d('0x2')||_0x1b2070[_0xc94d('0x3')]===0x0){return _0x306706('key\x20should\x20be\x20a\x20string');}if(typeof _0x40e7d8!==_0xc94d('0x5')&&(typeof _0x40e7d8!==_0xc94d('0x2')||_0x40e7d8[_0xc94d('0x3')]===0x0)){return _0x306706(_0xc94d('0x6'));}try{_0x41d4ec=fs[_0xc94d('0x7')](_0x1645b0)['toString'](_0xc94d('0x8'));}catch(_0x13096c){return _0x306706(_0x13096c);}return _0x4b2dcc({'method':_0xc94d('0x9'),'uri':host+_0xc94d('0xa')+_0x1b2070,'body':{'config':{'encoding':_0xc94d('0xb'),'sampleRateHertz':_0xc94d('0xc'),'languageCode':_0x40e7d8},'audio':{'content':_0x41d4ec}},'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 2a48a8e..76acb6a 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 _0xbf88=['exports','./asr'];(function(_0x26ab01,_0x1944c4){var _0x390395=function(_0x38f2d7){while(--_0x38f2d7){_0x26ab01['push'](_0x26ab01['shift']());}};_0x390395(++_0x1944c4);}(_0xbf88,0xd1));var _0x8bf8=function(_0x593ac4,_0x5b29d5){_0x593ac4=_0x593ac4-0x0;var _0x155d97=_0xbf88[_0x593ac4];return _0x155d97;};var asr=require(_0x8bf8('0x0'));module[_0x8bf8('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe7bd=['./asr','exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe7bd,0x12a));var _0xde7b=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0xe7bd[_0x19d24c];return _0x2fae8d;};var asr=require(_0xde7b('0x0'));module[_0xde7b('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 f222856..f3f90ce 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 _0x76f3=['WHAT_EVER','get','transcode','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','then','.mp3','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','source','result','resolvedQuery','action','actionIncomplete','score','status','code','endConversation','metadata','googleDialogflowV2','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','name','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','awsLex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','apiai-promise','dialogflow','md5','path','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./tilde','https://api.ispeech.org/api/rest','protocol','https:','host','error','request\x20to\x20','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','unlink','download\x20error','end'];(function(_0x41518f,_0x13360f){var _0x21d04d=function(_0x4c9f32){while(--_0x4c9f32){_0x41518f['push'](_0x41518f['shift']());}};_0x21d04d(++_0x13360f);}(_0x76f3,0x16c));var _0x376f=function(_0x4be669,_0x28a697){_0x4be669=_0x4be669-0x0;var _0x2e1141=_0x76f3[_0x4be669];return _0x2e1141;};'use strict';var apiai=require(_0x376f('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x376f('0x1'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x376f('0x2'));var path=require(_0x376f('0x3'));var querystring=require('querystring');var rp=require(_0x376f('0x4'));var rs=require(_0x376f('0x5'));var sox=require(_0x376f('0x6'));var tts=require(_0x376f('0x7'));var urlParse=require('url')[_0x376f('0x8')];var util=require(_0x376f('0x9'));var aws=require(_0x376f('0xa'));var google=require(_0x376f('0xb'));var sestek=require('./sestek');var tilde=require(_0x376f('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x376f('0xd');function downloadFile(_0x384a9d,_0x40df22){return new BPromise(function(_0x334974,_0xb194f3){var _0x1be963=urlParse(_0x384a9d);var _0xfe7325=_0x1be963[_0x376f('0xe')]===_0x376f('0xf')?https:http;var _0xc2839e={'host':_0x1be963[_0x376f('0x10')],'path':_0x1be963['path'],'headers':{'user-agent':'WHAT_EVER'}};_0xfe7325['get'](_0xc2839e,function(_0x24774f){if(_0x24774f['statusCode']!==0xc8){logger[_0x376f('0x11')](_0x376f('0x12')+_0x384a9d+'\x20failed,\x20status\x20code\x20=\x20'+_0x24774f[_0x376f('0x13')]+'\x20('+_0x24774f[_0x376f('0x14')]+')');_0xb194f3(new Error('request\x20to\x20'+_0x384a9d+_0x376f('0x15')+_0x24774f[_0x376f('0x13')]+'\x20('+_0x24774f[_0x376f('0x14')]+')'));return;}var _0x3409e7=fs[_0x376f('0x16')](_0x40df22);_0x3409e7['on'](_0x376f('0x17'),function(){logger[_0x376f('0x18')]('finish\x20download\x20file');_0x3409e7[_0x376f('0x19')](_0x334974);});_0x3409e7['on'](_0x376f('0x11'),function(_0x3d88a2){fs[_0x376f('0x1a')](_0x40df22);logger[_0x376f('0x11')](_0x376f('0x1b'),_0x3d88a2);_0xb194f3(_0x3d88a2);});_0x24774f['pipe'](_0x3409e7);})['on']('error',function(_0x3525e3){logger[_0x376f('0x11')](_0x3525e3);_0xb194f3(_0x3525e3);})[_0x376f('0x1c')]();});}function uploadFile(_0x20339d){return new BPromise(function(_0x386463,_0x8f933){var _0x1c71cd=urlParse(_0x20339d);var _0x1c133e=_0x1c71cd[_0x376f('0xe')]===_0x376f('0xf')?https:http;var _0x194449={'host':_0x1c71cd['host'],'path':_0x1c71cd[_0x376f('0x3')],'headers':{'user-agent':_0x376f('0x1d')}};_0x1c133e[_0x376f('0x1e')](_0x194449,function(_0xb9dfe3){if(_0xb9dfe3[_0x376f('0x13')]!==0xc8){_0x8f933(new Error('request\x20to\x20'+_0x20339d+_0x376f('0x15')+_0xb9dfe3['statusCode']+'\x20('+_0xb9dfe3[_0x376f('0x14')]+')'));return;}var _0x3b865c='';_0xb9dfe3['on']('data',function(_0x467f1a){_0x3b865c+=_0x467f1a;});_0xb9dfe3['on'](_0x376f('0x1c'),function(){_0x386463(_0x3b865c);});})['on'](_0x376f('0x11'),function(_0x242143){_0x8f933(_0x242143);})[_0x376f('0x1c')]();});}function convertFile(_0x234b0b,_0x53ffde){return new BPromise(function(_0x5441b8,_0x529958){var _0x387a26=sox[_0x376f('0x1f')](_0x234b0b,_0x53ffde,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x387a26['on'](_0x376f('0x11'),function(_0x29f4c4){logger[_0x376f('0x11')]('error\x20convert',_0x29f4c4);_0x529958(_0x29f4c4);});_0x387a26['on']('end',function(){logger[_0x376f('0x18')](_0x376f('0x20'));_0x5441b8();});_0x387a26[_0x376f('0x21')]();});}function base64Decode(_0x527a86,_0x1dc125){var _0xa6f71=path[_0x376f('0x22')](__dirname,_0x376f('0x23'),rs[_0x376f('0x24')](0x4)+_0x376f('0x25'));fs[_0x376f('0x26')](_0xa6f71,_0x527a86,_0x376f('0x27'));return convertFile(_0xa6f71,_0x1dc125)['then'](function(){try{fs[_0x376f('0x1a')](_0xa6f71);fs['chmodSync'](_0x1dc125,_0x376f('0x28'));}catch(_0x4302f7){logger[_0x376f('0x11')](_0x4302f7);}return _0x1dc125[_0x376f('0x29')]('.')[0x0];});}function base64Encode(_0x261d15){var _0xa76847=fs[_0x376f('0x2a')](_0x261d15);return new Buffer(_0xa76847)[_0x376f('0x2b')](_0x376f('0x27'));}exports[_0x376f('0x2c')]=function(_0x48cda9,_0x44cd43,_0x3ef444,_0x3d328e,_0x15bdc5,_0xcc620b){var _0x2723e6,_0x446ce9;var _0x7b487=_0x376f('0x2d');var _0x5a34fb=_0x376f('0x2e')+_0x48cda9;var _0x18d60b={};if(_0x44cd43===_0x376f('0x2f')){_0x18d60b[_0x376f('0x30')]={'ssml':_0x3ef444};}else{_0x18d60b[_0x376f('0x30')]={'text':_0x3ef444};};_0x18d60b['voice']={'languageCode':_0x3d328e,'ssmlGender':_0x15bdc5};_0x18d60b[_0x376f('0x31')]={'audioEncoding':_0x376f('0x32'),'sampleRateHertz':0x1f40};var _0x381e60={'url':_0x7b487+_0x376f('0x33')+_0x5a34fb,'method':_0x376f('0x34'),'json':!![],'body':_0x18d60b};return rp(_0x381e60)[_0x376f('0x35')](function(_0x260fc3){return new BPromise(function(_0x474902,_0x3f219d){_0x2723e6=path[_0x376f('0x22')](__dirname,_0x376f('0x23'),rs['generate'](0x4)+_0x376f('0x36'));var _0x2a3f4d=Buffer[_0x376f('0x37')](_0x260fc3[_0x376f('0x38')],_0x376f('0x27'));return fs[_0x376f('0x39')](_0x2723e6,_0x2a3f4d,function(_0x420471){_0x3f219d(_0x420471);},function(_0x130c03){fs[_0x376f('0x3a')](_0x2723e6,_0x376f('0x28'));_0x474902(_0x130c03);});});})[_0x376f('0x35')](function(_0xd4bbb6){_0x446ce9=path[_0x376f('0x22')](__dirname,_0x376f('0x23'),rs['generate'](0x4)+_0x376f('0x25'));return convertFile(_0x2723e6,_0x446ce9);})[_0x376f('0x35')](function(){try{fs['unlink'](_0x2723e6);fs[_0x376f('0x3a')](_0x446ce9,'777');}catch(_0x9490ea){logger[_0x376f('0x11')](_0x9490ea);}logger[_0x376f('0x18')](_0x376f('0x3b'),_0x446ce9[_0x376f('0x29')]('.')[0x0]);return _0x446ce9[_0x376f('0x29')]('.')[0x0];});};exports[_0x376f('0x3c')]=function(_0x123ec3,_0x44fded){var _0x4cb68e=_0x376f('0x3d');var _0x461acc,_0x436e94;var _0x29f844;var _0x5cf2e7={'encoding':_0x376f('0x3e'),'method':'POST','timeout':0x2710,'url':_0x4cb68e,'headers':{'Content-Type':_0x376f('0x3f')},'body':'f.req='+encodeURIComponent(JSON[_0x376f('0x40')]([[[_0x376f('0x41'),JSON[_0x376f('0x40')]([_0x123ec3,_0x44fded||'en',![],'null']),null,_0x376f('0x42')]]]))};return rp(_0x5cf2e7)[_0x376f('0x35')](function(_0x2329e0){try{_0x29f844=eval(_0x2329e0[_0x376f('0x43')](0x5))[0x0][0x2];}catch(_0x5d2b32){throw new Error(_0x376f('0x44')+_0x2329e0[_0x376f('0x45')]);}if(!_0x29f844){if(_0x123ec3[_0x376f('0x46')]>0xc8){throw new Error(_0x376f('0x47'));}else{throw new Error('lang\x20\x22'+_0x44fded+_0x376f('0x48'));}}try{_0x29f844=eval(_0x29f844)[0x0];}catch(_0x5b573c){throw new Error(_0x376f('0x44')+res['data']);}const _0x18bef2=_0x29f844;_0x461acc=path[_0x376f('0x22')](__dirname,_0x376f('0x23'),rs['generate'](0x4)+_0x376f('0x36'));fs[_0x376f('0x26')](_0x461acc,_0x29f844,{'encoding':'base64'});_0x436e94=path[_0x376f('0x22')](__dirname,'tmp',rs[_0x376f('0x24')](0x4)+_0x376f('0x25'));return convertFile(_0x461acc,_0x436e94);})[_0x376f('0x35')](function(){try{fs['unlink'](_0x461acc);fs[_0x376f('0x3a')](_0x436e94,'777');}catch(_0x433fc7){logger['error'](_0x433fc7);}logger[_0x376f('0x18')](_0x376f('0x49'),_0x436e94[_0x376f('0x29')]('.')[0x0]);return _0x436e94[_0x376f('0x29')]('.')[0x0];});};exports[_0x376f('0x4a')]=function(_0x107de2,_0x514af,_0x12627f){return google[_0x376f('0x4b')](_0x107de2,_0x514af,_0x12627f)['then'](function(_0x5b91d6){logger[_0x376f('0x18')](_0x5b91d6['uri']);return rp(_0x5b91d6);})[_0x376f('0x35')](function(_0x42fb98){var _0x546d5c='';var _0x46d423=0x0;try{fs[_0x376f('0x1a')](_0x107de2);}catch(_0x5c4184){logger['error'](_0x5c4184);}if(_0x42fb98&&_0x42fb98[_0x376f('0x4c')]){_0x546d5c=_0x42fb98[_0x376f('0x4c')][_0x376f('0x4d')](function(_0x2cea9d){return _0x2cea9d&&_0x2cea9d[_0x376f('0x4e')][0x0]&&_0x2cea9d['alternatives'][0x0][_0x376f('0x4f')]?_0x2cea9d[_0x376f('0x4e')][0x0][_0x376f('0x4f')]:'';})['join']('\x0a');_0x46d423=_0x42fb98[_0x376f('0x4c')][_0x376f('0x4d')](function(_0x30e39a){return _0x30e39a&&_0x30e39a['alternatives'][0x0]&&_0x30e39a[_0x376f('0x4e')][0x0][_0x376f('0x50')]?_0x30e39a[_0x376f('0x4e')][0x0][_0x376f('0x50')]:0x0;})[_0x376f('0x51')]('\x0a');}logger[_0x376f('0x18')](_0x376f('0x52'),_0x546d5c);logger['info'](_0x376f('0x53'),_0x46d423);return{'transcript':_0x546d5c,'confidence':_0x46d423};})[_0x376f('0x54')](function(_0x18cf21){logger[_0x376f('0x11')](_0x376f('0x55'),_0x18cf21[_0x376f('0x13')],_0x18cf21['name'],_0x18cf21['message']);});};exports[_0x376f('0x56')]=function(_0x12a858,_0x59a29c,_0x1bead0,_0x102224){var _0x1656a7=apiai(_0x59a29c,{'language':_0x102224||'en'});return _0x1656a7['textRequest'](_0x1bead0,{'sessionId':md5(_0x12a858)})[_0x376f('0x35')](function(_0xec7b15){logger[_0x376f('0x18')](JSON[_0x376f('0x40')](_0xec7b15));return{'source':_0xec7b15['result'][_0x376f('0x57')],'resolvedQuery':_0xec7b15[_0x376f('0x58')][_0x376f('0x59')],'action':_0xec7b15[_0x376f('0x58')][_0x376f('0x5a')],'actionIncomplete':_0xec7b15[_0x376f('0x58')][_0x376f('0x5b')],'speech':_0xec7b15[_0x376f('0x58')]['fulfillment']['speech'],'score':_0xec7b15[_0x376f('0x58')][_0x376f('0x5c')],'statusCode':_0xec7b15[_0x376f('0x5d')][_0x376f('0x5e')],'endConversation':_0xec7b15[_0x376f('0x58')]['metadata'][_0x376f('0x5f')]||![],'isFallbackIntent':_0xec7b15[_0x376f('0x58')][_0x376f('0x60')]['isFallbackIntent']};});};exports[_0x376f('0x61')]=function(_0x30be73,_0x212950,_0x424fb0,_0x5f4150,_0x436a12,_0xaee77a){var _0x252e8e=_0x5f4150['replace'](/\\n/g,'\x0a');var _0x504a44={'credentials':{'private_key':_0x252e8e,'client_email':_0x424fb0}};var _0x5bc9f5=new dialogflow['SessionsClient'](_0x504a44);var _0x38875c=_0x5bc9f5[_0x376f('0x62')](_0x212950,md5(_0x30be73));var _0x231900={'session':_0x38875c,'queryInput':{'text':{'text':_0x436a12,'languageCode':_0xaee77a}}};return _0x5bc9f5[_0x376f('0x63')](_0x231900)[_0x376f('0x35')](function(_0x4ab86b){if(_0x4ab86b&&_0x4ab86b[_0x376f('0x46')]){logger[_0x376f('0x18')]('Dialogflow\x20V2\x20response:',JSON[_0x376f('0x40')](_0x4ab86b));var _0x181477=_0x4ab86b[0x0];if(_0x181477){var _0x3d1c27={'action':_0x181477['queryResult'][_0x376f('0x5a')],'allRequiredParamsPresent':_0x181477[_0x376f('0x64')][_0x376f('0x65')],'endConversation':_0x181477[_0x376f('0x64')]['diagnosticInfo']&&_0x181477[_0x376f('0x64')][_0x376f('0x66')][_0x376f('0x67')]?_0x181477[_0x376f('0x64')][_0x376f('0x66')][_0x376f('0x67')][_0x376f('0x68')][_0x376f('0x69')]:![],'fulfillmentText':_0x181477[_0x376f('0x64')][_0x376f('0x6a')],'intentName':_0x181477[_0x376f('0x64')]['intent'][_0x376f('0x6b')],'intentDisplayName':_0x181477[_0x376f('0x64')][_0x376f('0x6c')][_0x376f('0x6d')],'isFallbackIntent':_0x181477[_0x376f('0x64')]['intent'][_0x376f('0x6e')],'languageCode':_0x181477[_0x376f('0x64')][_0x376f('0x6f')],'queryText':_0x181477[_0x376f('0x64')][_0x376f('0x70')],'responseId':_0x181477[_0x376f('0x71')],'score':_0x181477['queryResult'][_0x376f('0x72')],'speech':_0x181477[_0x376f('0x64')][_0x376f('0x6a')],'providerResponse':JSON['stringify'](_0x4ab86b)};return _0x3d1c27;}}});};exports['tildeASR']=function(_0x18cfd0,_0x3d6008,_0x36912e,_0x5102b0){return tilde[_0x376f('0x4b')](_0x18cfd0,_0x3d6008,_0x36912e,_0x5102b0)[_0x376f('0x35')](function(_0x5c5637){try{fs[_0x376f('0x1a')](_0x18cfd0);}catch(_0x5cacda){logger['error'](_0x5cacda);}logger['info']('Tilde\x20ASR\x20transcription',_0x5c5637[_0x376f('0x4f')]);logger[_0x376f('0x18')](_0x376f('0x73'),_0x5c5637[_0x376f('0x50')]);return _0x5c5637;});};exports[_0x376f('0x74')]=function(_0x4ba6a1,_0x4721aa,_0x510b39,_0x33a5da,_0x209ae8,_0x5e398b){var _0x53314c=path[_0x376f('0x22')](__dirname,_0x376f('0x23'),rs[_0x376f('0x24')](0x4)+_0x376f('0x36'));var _0x50e18e;return aws['polly'](_0x4ba6a1,_0x4721aa,_0x510b39,_0x33a5da,_0x209ae8,_0x5e398b,_0x53314c)[_0x376f('0x35')](function(){_0x50e18e=path[_0x376f('0x22')](__dirname,_0x376f('0x23'),rs[_0x376f('0x24')](0x4)+'.wav');return convertFile(_0x53314c,_0x50e18e);})[_0x376f('0x35')](function(){try{fs['unlink'](_0x53314c);fs[_0x376f('0x3a')](_0x50e18e,_0x376f('0x28'));}catch(_0x18bfab){logger[_0x376f('0x11')](_0x18bfab);}return _0x50e18e[_0x376f('0x29')]('.')[0x0];});};exports[_0x376f('0x75')]=function(_0x3f6485,_0x458fc3,_0x478611,_0x4126ef,_0x31f241,_0x38820f){return aws['lex'](_0x3f6485,_0x458fc3,_0x478611,_0x4126ef,_0x31f241,_0x38820f)[_0x376f('0x35')](function(_0x21a52a){logger['info'](JSON[_0x376f('0x40')](_0x21a52a));return _0x21a52a;});};exports[_0x376f('0x76')]=function(_0x3753e2,_0x4a37a6,_0x2b613d,_0x209e61){var _0x3b23e5=util[_0x376f('0x77')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3753e2,encodeURIComponent(_0x4a37a6),_0x2b613d,_0x209e61);var _0x2fec3b=path[_0x376f('0x22')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x16f408;return downloadFile(_0x3b23e5,_0x2fec3b)[_0x376f('0x35')](function(){_0x16f408=path[_0x376f('0x22')](__dirname,_0x376f('0x23'),rs[_0x376f('0x24')](0x4)+_0x376f('0x25'));return convertFile(_0x2fec3b,_0x16f408);})[_0x376f('0x35')](function(){try{fs[_0x376f('0x1a')](_0x2fec3b);fs[_0x376f('0x3a')](_0x16f408,_0x376f('0x28'));}catch(_0x378249){logger[_0x376f('0x11')](_0x378249);}return _0x16f408['split']('.')[0x0];});};exports[_0x376f('0x78')]=function(_0x2bf194,_0x5b390d,_0x57bfbc,_0x116f35){var _0xce5cf1=util[_0x376f('0x77')](_0x376f('0x79'),ISPEECH_API,_0x5b390d,_0x57bfbc,base64Encode(_0x2bf194),_0x116f35?util[_0x376f('0x77')](_0x376f('0x7a'),encodeURIComponent(_0x116f35)):'freeform=3');return uploadFile(_0xce5cf1)['then'](function(_0x112685){return querystring['parse'](_0x112685);});};exports[_0x376f('0x7b')]=function(_0x2b4d31,_0xf11036){return sestek[_0x376f('0x7c')](_0x2b4d31,_0xf11036)[_0x376f('0x35')](function(_0x1bbdc5){logger[_0x376f('0x18')](JSON[_0x376f('0x40')](_0x1bbdc5));var _0x13ee81={'speech':_0x1bbdc5[_0x376f('0x7d')],'action':_0x1bbdc5[_0x376f('0x7e')]?_0x1bbdc5[_0x376f('0x7e')][_0x376f('0x7f')]:undefined,'actiondata':_0x1bbdc5['channelData']?_0x1bbdc5[_0x376f('0x7e')][_0x376f('0x80')]:undefined};if(_0x1bbdc5[_0x376f('0x7e')]&&_0x1bbdc5[_0x376f('0x7e')][_0x376f('0x81')]){return base64Decode(_0x1bbdc5['channelData'][_0x376f('0x81')][_0x376f('0x82')],path['resolve'](__dirname,_0x376f('0x23'),rs[_0x376f('0x24')](0x4)+_0x376f('0x25')))[_0x376f('0x35')](function(_0x77d31d){_0x13ee81['audiofile']=_0x77d31d;return _0x13ee81;});}return _0x13ee81;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x67b2=['source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','text','CustomAction','channelData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','path','querystring','request-promise','randomstring','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','protocol','https:','host','WHAT_EVER','get','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','statusCode','data','end','transcode','wav','error\x20convert','start','tmp','.wav','writeFileSync','base64','then','777','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','text:synthesize','POST','resolve','.mp3','from','audioContent','writeFile','chmodSync','generate','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0x67b2,0xbc));var _0x267b=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x67b2[_0x307086];return _0x699043;};'use strict';var apiai=require(_0x267b('0x0'));var BPromise=require(_0x267b('0x1'));var dialogflow=require(_0x267b('0x2'));var fs=require('fs');var http=require(_0x267b('0x3'));var https=require('https');var md5=require(_0x267b('0x4'));var path=require(_0x267b('0x5'));var querystring=require(_0x267b('0x6'));var rp=require(_0x267b('0x7'));var rs=require(_0x267b('0x8'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x267b('0x9'))[_0x267b('0xa')];var util=require(_0x267b('0xb'));var aws=require(_0x267b('0xc'));var google=require(_0x267b('0xd'));var sestek=require(_0x267b('0xe'));var tilde=require(_0x267b('0xf'));var logger=require(_0x267b('0x10'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x37e4b0,_0x385c58){return new BPromise(function(_0x3f730a,_0x111300){var _0x5c32a8=urlParse(_0x37e4b0);var _0x597a2e=_0x5c32a8[_0x267b('0x11')]===_0x267b('0x12')?https:http;var _0x562779={'host':_0x5c32a8[_0x267b('0x13')],'path':_0x5c32a8[_0x267b('0x5')],'headers':{'user-agent':_0x267b('0x14')}};_0x597a2e[_0x267b('0x15')](_0x562779,function(_0x5e8642){if(_0x5e8642['statusCode']!==0xc8){logger[_0x267b('0x16')](_0x267b('0x17')+_0x37e4b0+'\x20failed,\x20status\x20code\x20=\x20'+_0x5e8642['statusCode']+'\x20('+_0x5e8642[_0x267b('0x18')]+')');_0x111300(new Error(_0x267b('0x17')+_0x37e4b0+_0x267b('0x19')+_0x5e8642['statusCode']+'\x20('+_0x5e8642['statusMessage']+')'));return;}var _0x7e7dbf=fs[_0x267b('0x1a')](_0x385c58);_0x7e7dbf['on'](_0x267b('0x1b'),function(){logger[_0x267b('0x1c')](_0x267b('0x1d'));_0x7e7dbf[_0x267b('0x1e')](_0x3f730a);});_0x7e7dbf['on'](_0x267b('0x16'),function(_0x3c2f08){fs[_0x267b('0x1f')](_0x385c58);logger[_0x267b('0x16')](_0x267b('0x20'),_0x3c2f08);_0x111300(_0x3c2f08);});_0x5e8642['pipe'](_0x7e7dbf);})['on'](_0x267b('0x16'),function(_0x3cb1c8){logger[_0x267b('0x16')](_0x3cb1c8);_0x111300(_0x3cb1c8);})['end']();});}function uploadFile(_0x50477c){return new BPromise(function(_0x23ea1d,_0x5050f4){var _0x33e2f4=urlParse(_0x50477c);var _0x5bb8a8=_0x33e2f4[_0x267b('0x11')]===_0x267b('0x12')?https:http;var _0x1a4fd7={'host':_0x33e2f4['host'],'path':_0x33e2f4[_0x267b('0x5')],'headers':{'user-agent':_0x267b('0x14')}};_0x5bb8a8[_0x267b('0x15')](_0x1a4fd7,function(_0x454855){if(_0x454855[_0x267b('0x21')]!==0xc8){_0x5050f4(new Error('request\x20to\x20'+_0x50477c+'\x20failed,\x20status\x20code\x20=\x20'+_0x454855[_0x267b('0x21')]+'\x20('+_0x454855['statusMessage']+')'));return;}var _0x350fed='';_0x454855['on'](_0x267b('0x22'),function(_0x1d1297){_0x350fed+=_0x1d1297;});_0x454855['on'](_0x267b('0x23'),function(){_0x23ea1d(_0x350fed);});})['on'](_0x267b('0x16'),function(_0x130c6b){_0x5050f4(_0x130c6b);})['end']();});}function convertFile(_0x44aea1,_0x2d6b9f){return new BPromise(function(_0x37460f,_0x2ffa8f){var _0x18e9bb=sox[_0x267b('0x24')](_0x44aea1,_0x2d6b9f,{'sampleRate':0x1f40,'format':_0x267b('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x18e9bb['on'](_0x267b('0x16'),function(_0x3ff0ba){logger[_0x267b('0x16')](_0x267b('0x26'),_0x3ff0ba);_0x2ffa8f(_0x3ff0ba);});_0x18e9bb['on'](_0x267b('0x23'),function(){logger['info']('finish\x20to\x20convert');_0x37460f();});_0x18e9bb[_0x267b('0x27')]();});}function base64Decode(_0x4277b6,_0x81b536){var _0x239c6d=path['resolve'](__dirname,_0x267b('0x28'),rs['generate'](0x4)+_0x267b('0x29'));fs[_0x267b('0x2a')](_0x239c6d,_0x4277b6,_0x267b('0x2b'));return convertFile(_0x239c6d,_0x81b536)[_0x267b('0x2c')](function(){try{fs['unlink'](_0x239c6d);fs['chmodSync'](_0x81b536,_0x267b('0x2d'));}catch(_0x389801){logger[_0x267b('0x16')](_0x389801);}return _0x81b536['split']('.')[0x0];});}function base64Encode(_0x3e8c77){var _0x48067b=fs[_0x267b('0x2e')](_0x3e8c77);return new Buffer(_0x48067b)[_0x267b('0x2f')](_0x267b('0x2b'));}exports['googleCloudTTS']=function(_0x5bca79,_0x2ec53d,_0x504b8b,_0x143da4,_0xf94bd1,_0x3a5168){var _0x5ac985,_0x130842;var _0x42c1c6=_0x267b('0x30');var _0x4c2630=_0x267b('0x31')+_0x5bca79;var _0x2ac434={};if(_0x2ec53d===_0x267b('0x32')){_0x2ac434[_0x267b('0x33')]={'ssml':_0x504b8b};}else{_0x2ac434[_0x267b('0x33')]={'text':_0x504b8b};};_0x2ac434['voice']={'languageCode':_0x143da4,'ssmlGender':_0xf94bd1};_0x2ac434['audioConfig']={'audioEncoding':_0x267b('0x34'),'sampleRateHertz':0x1f40};var _0x4d3023={'url':_0x42c1c6+_0x267b('0x35')+_0x4c2630,'method':_0x267b('0x36'),'json':!![],'body':_0x2ac434};return rp(_0x4d3023)['then'](function(_0x3eff4f){return new BPromise(function(_0x3fc294,_0x26c6bd){_0x5ac985=path[_0x267b('0x37')](__dirname,_0x267b('0x28'),rs['generate'](0x4)+_0x267b('0x38'));var _0x52251d=Buffer[_0x267b('0x39')](_0x3eff4f[_0x267b('0x3a')],_0x267b('0x2b'));return fs[_0x267b('0x3b')](_0x5ac985,_0x52251d,function(_0x14cb19){_0x26c6bd(_0x14cb19);},function(_0x3d4ebe){fs[_0x267b('0x3c')](_0x5ac985,'777');_0x3fc294(_0x3d4ebe);});});})['then'](function(_0x3a6be0){_0x130842=path['resolve'](__dirname,_0x267b('0x28'),rs[_0x267b('0x3d')](0x4)+_0x267b('0x29'));return convertFile(_0x5ac985,_0x130842);})[_0x267b('0x2c')](function(){try{fs[_0x267b('0x1f')](_0x5ac985);fs[_0x267b('0x3c')](_0x130842,_0x267b('0x2d'));}catch(_0xf36a5f){logger['error'](_0xf36a5f);}logger['info'](_0x267b('0x3e'),_0x130842[_0x267b('0x3f')]('.')[0x0]);return _0x130842[_0x267b('0x3f')]('.')[0x0];});};exports[_0x267b('0x40')]=function(_0x13be82,_0x26aefb){var _0x18f451=_0x267b('0x41');var _0x595b4e,_0x5e338c;var _0x22fb44;var _0x4bc147={'encoding':_0x267b('0x42'),'method':_0x267b('0x36'),'timeout':0x2710,'url':_0x18f451,'headers':{'Content-Type':_0x267b('0x43')},'body':_0x267b('0x44')+encodeURIComponent(JSON[_0x267b('0x45')]([[[_0x267b('0x46'),JSON['stringify']([_0x13be82,_0x26aefb||'en',![],_0x267b('0x47')]),null,_0x267b('0x48')]]]))};return rp(_0x4bc147)['then'](function(_0xd157fc){try{_0x22fb44=eval(_0xd157fc[_0x267b('0x49')](0x5))[0x0][0x2];}catch(_0x585806){throw new Error(_0x267b('0x4a')+_0xd157fc[_0x267b('0x22')]);}if(!_0x22fb44){if(_0x13be82[_0x267b('0x4b')]>0xc8){throw new Error(_0x267b('0x4c'));}else{throw new Error(_0x267b('0x4d')+_0x26aefb+_0x267b('0x4e'));}}try{_0x22fb44=eval(_0x22fb44)[0x0];}catch(_0x427464){throw new Error(_0x267b('0x4a')+res['data']);}const _0x2e50bc=_0x22fb44;_0x595b4e=path[_0x267b('0x37')](__dirname,_0x267b('0x28'),rs['generate'](0x4)+_0x267b('0x38'));fs['writeFileSync'](_0x595b4e,_0x22fb44,{'encoding':'base64'});_0x5e338c=path['resolve'](__dirname,'tmp',rs[_0x267b('0x3d')](0x4)+_0x267b('0x29'));return convertFile(_0x595b4e,_0x5e338c);})['then'](function(){try{fs[_0x267b('0x1f')](_0x595b4e);fs[_0x267b('0x3c')](_0x5e338c,_0x267b('0x2d'));}catch(_0x1b5adb){logger['error'](_0x1b5adb);}logger['info'](_0x267b('0x4f'),_0x5e338c[_0x267b('0x3f')]('.')[0x0]);return _0x5e338c['split']('.')[0x0];});};exports[_0x267b('0x50')]=function(_0x44327d,_0x1babd5,_0x2d9891){return google[_0x267b('0x51')](_0x44327d,_0x1babd5,_0x2d9891)[_0x267b('0x2c')](function(_0x405cfa){logger[_0x267b('0x1c')](_0x405cfa[_0x267b('0x52')]);return rp(_0x405cfa);})[_0x267b('0x2c')](function(_0x57a0c5){var _0xcfa39c='';var _0x1f78ec=0x0;try{fs[_0x267b('0x1f')](_0x44327d);}catch(_0x1dd86d){logger[_0x267b('0x16')](_0x1dd86d);}if(_0x57a0c5&&_0x57a0c5[_0x267b('0x53')]){_0xcfa39c=_0x57a0c5[_0x267b('0x53')][_0x267b('0x54')](function(_0x57cb61){return _0x57cb61&&_0x57cb61[_0x267b('0x55')][0x0]&&_0x57cb61[_0x267b('0x55')][0x0][_0x267b('0x56')]?_0x57cb61[_0x267b('0x55')][0x0][_0x267b('0x56')]:'';})[_0x267b('0x57')]('\x0a');_0x1f78ec=_0x57a0c5[_0x267b('0x53')][_0x267b('0x54')](function(_0x21638e){return _0x21638e&&_0x21638e['alternatives'][0x0]&&_0x21638e['alternatives'][0x0]['confidence']?_0x21638e[_0x267b('0x55')][0x0][_0x267b('0x58')]:0x0;})['join']('\x0a');}logger[_0x267b('0x1c')](_0x267b('0x59'),_0xcfa39c);logger['info'](_0x267b('0x5a'),_0x1f78ec);return{'transcript':_0xcfa39c,'confidence':_0x1f78ec};})[_0x267b('0x5b')](function(_0x2ba6ec){logger[_0x267b('0x16')](_0x267b('0x5c'),_0x2ba6ec['statusCode'],_0x2ba6ec[_0x267b('0x5d')],_0x2ba6ec[_0x267b('0x5e')]);});};exports[_0x267b('0x5f')]=function(_0x549185,_0x144043,_0x37c041,_0x1d1dfa){var _0x59c04a=apiai(_0x144043,{'language':_0x1d1dfa||'en'});return _0x59c04a[_0x267b('0x60')](_0x37c041,{'sessionId':md5(_0x549185)})[_0x267b('0x2c')](function(_0x23202d){logger[_0x267b('0x1c')](JSON[_0x267b('0x45')](_0x23202d));return{'source':_0x23202d[_0x267b('0x61')][_0x267b('0x62')],'resolvedQuery':_0x23202d[_0x267b('0x61')][_0x267b('0x63')],'action':_0x23202d[_0x267b('0x61')][_0x267b('0x64')],'actionIncomplete':_0x23202d['result'][_0x267b('0x65')],'speech':_0x23202d[_0x267b('0x61')][_0x267b('0x66')][_0x267b('0x67')],'score':_0x23202d[_0x267b('0x61')]['score'],'statusCode':_0x23202d[_0x267b('0x68')][_0x267b('0x69')],'endConversation':_0x23202d[_0x267b('0x61')][_0x267b('0x6a')]['endConversation']||![],'isFallbackIntent':_0x23202d[_0x267b('0x61')][_0x267b('0x6a')][_0x267b('0x6b')]};});};exports[_0x267b('0x6c')]=function(_0x116ba0,_0x35f924,_0x5ac4f9,_0x3ec96f,_0x1fa1b0,_0xf9c35e){var _0x2bdfeb=_0x3ec96f[_0x267b('0x6d')](/\\n/g,'\x0a');var _0x3d6831={'credentials':{'private_key':_0x2bdfeb,'client_email':_0x5ac4f9}};var _0x111fe2=new dialogflow[(_0x267b('0x6e'))](_0x3d6831);var _0x5f4312=_0x111fe2[_0x267b('0x6f')](_0x35f924,md5(_0x116ba0));var _0x27cfad={'session':_0x5f4312,'queryInput':{'text':{'text':_0x1fa1b0,'languageCode':_0xf9c35e}}};return _0x111fe2['detectIntent'](_0x27cfad)[_0x267b('0x2c')](function(_0x59c9f5){if(_0x59c9f5&&_0x59c9f5['length']){logger['info'](_0x267b('0x70'),JSON['stringify'](_0x59c9f5));var _0x595fab=_0x59c9f5[0x0];if(_0x595fab){var _0x2cdfd0={'action':_0x595fab[_0x267b('0x71')][_0x267b('0x64')],'allRequiredParamsPresent':_0x595fab[_0x267b('0x71')][_0x267b('0x72')],'endConversation':_0x595fab[_0x267b('0x71')][_0x267b('0x73')]&&_0x595fab[_0x267b('0x71')]['diagnosticInfo'][_0x267b('0x74')]?_0x595fab[_0x267b('0x71')][_0x267b('0x73')][_0x267b('0x74')][_0x267b('0x75')][_0x267b('0x76')]:![],'fulfillmentText':_0x595fab[_0x267b('0x71')][_0x267b('0x77')],'intentName':_0x595fab[_0x267b('0x71')][_0x267b('0x78')][_0x267b('0x5d')],'intentDisplayName':_0x595fab[_0x267b('0x71')][_0x267b('0x78')][_0x267b('0x79')],'isFallbackIntent':_0x595fab[_0x267b('0x71')][_0x267b('0x78')][_0x267b('0x7a')],'languageCode':_0x595fab[_0x267b('0x71')][_0x267b('0x7b')],'queryText':_0x595fab[_0x267b('0x71')][_0x267b('0x7c')],'responseId':_0x595fab[_0x267b('0x7d')],'score':_0x595fab[_0x267b('0x71')][_0x267b('0x7e')],'speech':_0x595fab[_0x267b('0x71')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x59c9f5)};return _0x2cdfd0;}}});};exports[_0x267b('0x7f')]=function(_0x1ebc53,_0x5135e3,_0x3f66df,_0x2cbf4e){return tilde[_0x267b('0x51')](_0x1ebc53,_0x5135e3,_0x3f66df,_0x2cbf4e)[_0x267b('0x2c')](function(_0x144962){try{fs[_0x267b('0x1f')](_0x1ebc53);}catch(_0x3824f3){logger[_0x267b('0x16')](_0x3824f3);}logger[_0x267b('0x1c')]('Tilde\x20ASR\x20transcription',_0x144962[_0x267b('0x56')]);logger['info']('Tilde\x20ASR\x20confidence',_0x144962[_0x267b('0x58')]);return _0x144962;});};exports['awsPolly']=function(_0x4477ef,_0x4826e0,_0x5b34cf,_0x44dd47,_0x4d4f29,_0x3c5eba){var _0x58cd81=path[_0x267b('0x37')](__dirname,_0x267b('0x28'),rs[_0x267b('0x3d')](0x4)+_0x267b('0x38'));var _0x4a1577;return aws[_0x267b('0x80')](_0x4477ef,_0x4826e0,_0x5b34cf,_0x44dd47,_0x4d4f29,_0x3c5eba,_0x58cd81)[_0x267b('0x2c')](function(){_0x4a1577=path[_0x267b('0x37')](__dirname,'tmp',rs[_0x267b('0x3d')](0x4)+_0x267b('0x29'));return convertFile(_0x58cd81,_0x4a1577);})[_0x267b('0x2c')](function(){try{fs['unlink'](_0x58cd81);fs[_0x267b('0x3c')](_0x4a1577,_0x267b('0x2d'));}catch(_0x2b0c1b){logger[_0x267b('0x16')](_0x2b0c1b);}return _0x4a1577[_0x267b('0x3f')]('.')[0x0];});};exports[_0x267b('0x81')]=function(_0x218e4f,_0x3246ab,_0xebe9b9,_0x25e5c6,_0x3176a3,_0xc3f554){return aws[_0x267b('0x82')](_0x218e4f,_0x3246ab,_0xebe9b9,_0x25e5c6,_0x3176a3,_0xc3f554)[_0x267b('0x2c')](function(_0x5ae368){logger[_0x267b('0x1c')](JSON['stringify'](_0x5ae368));return _0x5ae368;});};exports['ispeechTTS']=function(_0x425d5b,_0x24935b,_0x2083e8,_0x3b6152){var _0xbaca66=util['format'](_0x267b('0x83'),ISPEECH_API,_0x425d5b,encodeURIComponent(_0x24935b),_0x2083e8,_0x3b6152);var _0x43efa7=path[_0x267b('0x37')](__dirname,_0x267b('0x28'),rs[_0x267b('0x3d')](0x4)+_0x267b('0x38'));var _0x331294;return downloadFile(_0xbaca66,_0x43efa7)['then'](function(){_0x331294=path['resolve'](__dirname,_0x267b('0x28'),rs[_0x267b('0x3d')](0x4)+'.wav');return convertFile(_0x43efa7,_0x331294);})[_0x267b('0x2c')](function(){try{fs[_0x267b('0x1f')](_0x43efa7);fs[_0x267b('0x3c')](_0x331294,_0x267b('0x2d'));}catch(_0x411d01){logger[_0x267b('0x16')](_0x411d01);}return _0x331294[_0x267b('0x3f')]('.')[0x0];});};exports[_0x267b('0x84')]=function(_0x14d67b,_0xea423c,_0x40364a,_0xd5558c){var _0xcf634b=util[_0x267b('0x85')](_0x267b('0x86'),ISPEECH_API,_0xea423c,_0x40364a,base64Encode(_0x14d67b),_0xd5558c?util[_0x267b('0x85')](_0x267b('0x87'),encodeURIComponent(_0xd5558c)):'freeform=3');return uploadFile(_0xcf634b)[_0x267b('0x2c')](function(_0x35997b){return querystring[_0x267b('0xa')](_0x35997b);});};exports['sestekNDA']=function(_0x4dee9f,_0x4e0eba){return sestek[_0x267b('0x88')](_0x4dee9f,_0x4e0eba)[_0x267b('0x2c')](function(_0x27c629){logger[_0x267b('0x1c')](JSON[_0x267b('0x45')](_0x27c629));var _0x2e7ef5={'speech':_0x27c629[_0x267b('0x89')],'action':_0x27c629['channelData']?_0x27c629['channelData'][_0x267b('0x8a')]:undefined,'actiondata':_0x27c629[_0x267b('0x8b')]?_0x27c629[_0x267b('0x8b')]['CustomActionData']:undefined};if(_0x27c629['channelData']&&_0x27c629[_0x267b('0x8b')][_0x267b('0x8c')]){return base64Decode(_0x27c629[_0x267b('0x8b')][_0x267b('0x8c')]['Data'],path[_0x267b('0x37')](__dirname,_0x267b('0x28'),rs[_0x267b('0x3d')](0x4)+'.wav'))['then'](function(_0x358930){_0x2e7ef5[_0x267b('0x8d')]=_0x358930;return _0x2e7ef5;});}return _0x2e7ef5;});};exports[_0x267b('0x8e')]=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 0a895fa..f175fc5 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 _0x4fdf=['exports','./nda'];(function(_0x5f3394,_0x1c118f){var _0xbbade3=function(_0x953453){while(--_0x953453){_0x5f3394['push'](_0x5f3394['shift']());}};_0xbbade3(++_0x1c118f);}(_0x4fdf,0x1b5));var _0xf4fd=function(_0x5d3cae,_0x2e336f){_0x5d3cae=_0x5d3cae-0x0;var _0x92a58b=_0x4fdf[_0x5d3cae];return _0x92a58b;};var nda=require(_0xf4fd('0x0'));module[_0xf4fd('0x1')]={'nda':nda}; \ No newline at end of file +var _0x5658=['exports'];(function(_0x1f4d1f,_0x4e612f){var _0x4a0590=function(_0xd13f){while(--_0xd13f){_0x1f4d1f['push'](_0x1f4d1f['shift']());}};_0x4a0590(++_0x4e612f);}(_0x5658,0x66));var _0x8565=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5658[_0x20a584];return _0x4b41a8;};var nda=require('./nda');module[_0x8565('0x0')]={'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 7d7ee5d..b60315a 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 _0xec56=['dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname'];(function(_0x2a6109,_0x47853d){var _0x36c3d9=function(_0x4194c7){while(--_0x4194c7){_0x2a6109['push'](_0x2a6109['shift']());}};_0x36c3d9(++_0x47853d);}(_0xec56,0x1bd));var _0x6ec5=function(_0x5262f5,_0x27e125){_0x5262f5=_0x5262f5-0x0;var _0x44a1bf=_0xec56[_0x5262f5];return _0x44a1bf;};'use strict';var rp=require(_0x6ec5('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x6ec5('0x1'));module[_0x6ec5('0x2')]=function(_0x26a5af,_0x240ccf){var _0x43c2cd={'method':_0x6ec5('0x3'),'uri':url[_0x6ec5('0x4')](_0x240ccf[_0x6ec5('0x5')],_0x6ec5('0x6')),'form':{'grant_type':_0x6ec5('0x7'),'username':_0x240ccf[_0x6ec5('0x8')],'password':_0x240ccf[_0x6ec5('0x7')]},'json':!![]};return rp(_0x43c2cd)[_0x6ec5('0x9')](function(_0x1f59cd){var _0x3dd891={'method':_0x6ec5('0x3'),'uri':url[_0x6ec5('0x4')](_0x240ccf[_0x6ec5('0xa')],_0x6ec5('0xb')),'body':{'type':_0x240ccf['ndaactivity_type']||_0x6ec5('0xc'),'channelId':_0x6ec5('0xd'),'conversation':{'id':_0x26a5af[_0x6ec5('0xe')]},'from':{'id':_0x26a5af[_0x6ec5('0xf')],'name':_0x26a5af[_0x6ec5('0x10')]},'recipient':{'id':_0x26a5af[_0x6ec5('0x11')],'name':_0x26a5af[_0x6ec5('0x12')]},'text':_0x240ccf['text'],'channelData':{}},'headers':{'Authorization':_0x6ec5('0x13')+_0x1f59cd[_0x6ec5('0x14')]},'json':!![]};if(_0x240ccf[_0x6ec5('0x15')]){_0x3dd891[_0x6ec5('0x16')][_0x6ec5('0x17')][_0x6ec5('0x18')]=_0x240ccf[_0x6ec5('0x15')];}if(_0x240ccf[_0x6ec5('0x19')]=='1'){_0x3dd891['body'][_0x6ec5('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6ec5('0x1a')};}if(_0x240ccf[_0x6ec5('0x1b')]){_0x3dd891[_0x6ec5('0x16')][_0x6ec5('0x17')][_0x6ec5('0x1c')]=_0x240ccf['custom_action'];if(_0x240ccf[_0x6ec5('0x1d')]){_0x3dd891[_0x6ec5('0x16')][_0x6ec5('0x17')][_0x6ec5('0x1e')]=_0x240ccf[_0x6ec5('0x1d')];}}logger[_0x6ec5('0x1f')](JSON[_0x6ec5('0x20')](_0x3dd891));return rp(_0x3dd891);});}; \ No newline at end of file +var _0x2e35=['uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','request-promise','url','../../../../../config/logger','exports','resolve','ndauth_url','/token','password','ndassistant_url','ndaactivity_type','message'];(function(_0x5f0a18,_0x102fca){var _0x276ad4=function(_0x131d82){while(--_0x131d82){_0x5f0a18['push'](_0x5f0a18['shift']());}};_0x276ad4(++_0x102fca);}(_0x2e35,0x1d0));var _0x52e3=function(_0x4fc70c,_0x37dfc7){_0x4fc70c=_0x4fc70c-0x0;var _0x5fd14=_0x2e35[_0x4fc70c];return _0x5fd14;};'use strict';var rp=require(_0x52e3('0x0'));var url=require(_0x52e3('0x1'));var logger=require(_0x52e3('0x2'))('agi');module[_0x52e3('0x3')]=function(_0xcbe6c5,_0x16d807){var _0x3dc244={'method':'POST','uri':url[_0x52e3('0x4')](_0x16d807[_0x52e3('0x5')],_0x52e3('0x6')),'form':{'grant_type':_0x52e3('0x7'),'username':_0x16d807['username'],'password':_0x16d807['password']},'json':!![]};return rp(_0x3dc244)['then'](function(_0x21ae13){var _0x4d77a0={'method':'POST','uri':url[_0x52e3('0x4')](_0x16d807[_0x52e3('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x16d807[_0x52e3('0x9')]||_0x52e3('0xa'),'channelId':'Nda','conversation':{'id':_0xcbe6c5[_0x52e3('0xb')]},'from':{'id':_0xcbe6c5['callerid'],'name':_0xcbe6c5[_0x52e3('0xc')]},'recipient':{'id':_0xcbe6c5[_0x52e3('0xd')],'name':_0xcbe6c5[_0x52e3('0xe')]},'text':_0x16d807['text'],'channelData':{}},'headers':{'Authorization':_0x52e3('0xf')+_0x21ae13[_0x52e3('0x10')]},'json':!![]};if(_0x16d807['project']){_0x4d77a0[_0x52e3('0x11')]['channelData']['ProjectName']=_0x16d807['project'];}if(_0x16d807['ndagenerate_audio']=='1'){_0x4d77a0['body'][_0x52e3('0x12')][_0x52e3('0x13')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x52e3('0x14')};}if(_0x16d807[_0x52e3('0x15')]){_0x4d77a0[_0x52e3('0x11')][_0x52e3('0x12')][_0x52e3('0x16')]=_0x16d807[_0x52e3('0x15')];if(_0x16d807[_0x52e3('0x17')]){_0x4d77a0[_0x52e3('0x11')][_0x52e3('0x12')]['CustomActionData']=_0x16d807[_0x52e3('0x17')];}}logger[_0x52e3('0x18')](JSON['stringify'](_0x4d77a0));return rp(_0x4d77a0);});}; \ 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 231c3aa..6f45d3e 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 _0x2f0f=['./lib/api','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2f0f,0xc2));var _0xf2f0=function(_0x3a376f,_0x4694fb){_0x3a376f=_0x3a376f-0x0;var _0x2cc9ae=_0x2f0f[_0x3a376f];return _0x2cc9ae;};'use strict';var asr=require(_0xf2f0('0x0'));module[_0xf2f0('0x1')]=function(_0x6e0756,_0x1d7f6f,_0x34cb15,_0x4ca87c){return asr(_0x6e0756,_0x1d7f6f,_0x34cb15,_0x4ca87c);}; \ No newline at end of file +var _0x4a8b=['./lib/api','exports'];(function(_0x368ffa,_0x475383){var _0x26af4d=function(_0x27591f){while(--_0x27591f){_0x368ffa['push'](_0x368ffa['shift']());}};_0x26af4d(++_0x475383);}(_0x4a8b,0x68));var _0xb4a8=function(_0x592edb,_0x2e4d3f){_0x592edb=_0x592edb-0x0;var _0x108fc8=_0x4a8b[_0x592edb];return _0x108fc8;};'use strict';var asr=require(_0xb4a8('0x0'));module[_0xb4a8('0x1')]=function(_0x5b7995,_0x599948,_0x235907,_0x5dc80b){return asr(_0x5b7995,_0x599948,_0x235907,_0x5dc80b);}; \ 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 330072b..c6a82be 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 _0x617b=['moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','final','result','hypotheses','likelihood','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash'];(function(_0x52e653,_0xf2bf8d){var _0x47f960=function(_0x4b3e15){while(--_0x4b3e15){_0x52e653['push'](_0x52e653['shift']());}};_0x47f960(++_0xf2bf8d);}(_0x617b,0x1a0));var _0xb617=function(_0x274e87,_0x316007){_0x274e87=_0x274e87-0x0;var _0x4763a2=_0x617b[_0x274e87];return _0x4763a2;};'use strict';var BPromise=require(_0xb617('0x0'));var _=require(_0xb617('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb617('0x2'));var crypto=require(_0xb617('0x3'));var logger=require(_0xb617('0x4'))(_0xb617('0x5'));module[_0xb617('0x6')]=function(_0x57d4ee,_0x9c0d58,_0x2a5d2d,_0x41b201){return new BPromise(function(_0xfea05f,_0x2f13e0){logger[_0xb617('0x7')](_0xb617('0x8'),_0x41b201||_0xb617('0x9'));var _0x3bcee9=new WebSocket(_0x41b201||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x212213='';var _0x187bc8='0';var _0x5616e0='1';var _0x3164ab=_0xb617('0xa');function _0x2363ba(_0x23b8bf){var _0x3fe025=crypto[_0xb617('0xb')]('sha1');_0x3fe025['update'](_0x23b8bf);return _0x3fe025['digest'](_0xb617('0xc'));}function _0x407aab(){try{logger[_0xb617('0x7')](_0xb617('0xd'));var _0x59f3cd=moment()['unix']();var _0x52c417=_0x2363ba(_0x59f3cd+_0x9c0d58+_0x2a5d2d);_0x3bcee9[_0xb617('0xe')](JSON[_0xb617('0xf')]({'appID':_0x9c0d58,'timestamp':_0x59f3cd,'appKey':_0x52c417}));var _0x9e9b82=fs['createReadStream'](_0x57d4ee);_0x9e9b82['on'](_0xb617('0x10'),function(_0x3a98a3){_0x3bcee9['send'](_0x3a98a3);});_0x9e9b82['on'](_0xb617('0x11'),function(){_0x3bcee9[_0xb617('0xe')](_0xb617('0x12'));});}catch(_0x370d94){logger[_0xb617('0x13')](_0xb617('0x14'),JSON[_0xb617('0xf')](_0x370d94));_0x3bcee9['terminate']();}}function _0xd8265f(_0x34eef7){try{if(_0x34eef7){var _0x4d5860=JSON[_0xb617('0x15')](_0x34eef7);switch(_0x4d5860[_0xb617('0x16')]){case 0x0:if(_0x4d5860['result']){if(_0x4d5860['result'][_0xb617('0x17')]){logger[_0xb617('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0xb617('0xf')](_0x4d5860[_0xb617('0x18')]['hypotheses']));_0x212213=_0x4d5860['result'][_0xb617('0x19')][0x0]['transcript'];_0x187bc8=_0x4d5860['result'][_0xb617('0x19')][0x0][_0xb617('0x1a')];_0x5616e0='0';_0x3164ab=_0xb617('0x1b');_0x3bcee9[_0xb617('0x1c')]();}}break;case 0x1:logger[_0xb617('0x7')](_0xb617('0xa'));_0x5616e0='1';_0x3164ab=_0xb617('0xa');break;case 0x2:logger[_0xb617('0x7')](_0xb617('0x1d'));_0x5616e0='2';_0x3164ab='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xb617('0x1e'));_0x5616e0='9';_0x3164ab='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xb617('0x7')](_0xb617('0x1f'));_0x5616e0='10';_0x3164ab=_0xb617('0x1f');break;case 0xb:logger[_0xb617('0x7')](_0xb617('0x20'));_0x5616e0='11';_0x3164ab=_0xb617('0x20');}}}catch(_0x267900){logger['error'](_0xb617('0x21'),JSON[_0xb617('0xf')](_0x267900));_0x3bcee9[_0xb617('0x1c')]();}}function _0x4eea6(){logger[_0xb617('0x7')](_0xb617('0x22'));_0xfea05f({'transcript':_0x212213,'confidence':_0x187bc8,'status':_0x5616e0,'status_message':_0x3164ab});}function _0x45a5a1(_0x408ce3){logger['error'](_0xb617('0x23'));if(!_[_0xb617('0x24')](_0x408ce3)){logger[_0xb617('0x13')](_['isObject'](_0x408ce3)?JSON['stringify'](_0x408ce3):_0x408ce3);}}_0x3bcee9['on'](_0xb617('0x25'),_0x407aab);_0x3bcee9['on']('message',_0xd8265f);_0x3bcee9['on'](_0xb617('0x11'),_0x4eea6);_0x3bcee9['on'](_0xb617('0x13'),_0x45a5a1);});}; \ No newline at end of file +var _0x3e09=['close','crypto','../../../../../../config/logger','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','info','hypotheses','transcript','Success.','terminate','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message'];(function(_0x326719,_0x457974){var _0x47dd1f=function(_0x58b494){while(--_0x58b494){_0x326719['push'](_0x326719['shift']());}};_0x47dd1f(++_0x457974);}(_0x3e09,0xbf));var _0x93e0=function(_0x4066c2,_0xad48e8){_0x4066c2=_0x4066c2-0x0;var _0x3870a0=_0x3e09[_0x4066c2];return _0x3870a0;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x93e0('0x0'));var logger=require(_0x93e0('0x1'))('agi');module['exports']=function(_0x2470a9,_0x5318af,_0x535926,_0x95674f){return new BPromise(function(_0x5d7e0e,_0x21da5e){logger['info'](_0x93e0('0x2'),_0x95674f||_0x93e0('0x3'));var _0x273afb=new WebSocket(_0x95674f||_0x93e0('0x3'),{'perMessageDeflate':![]});var _0x43c1dd='';var _0x1af92a='0';var _0x5723e7='1';var _0xf986f7='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x241931(_0x250cf0){var _0x1c67a0=crypto[_0x93e0('0x4')](_0x93e0('0x5'));_0x1c67a0[_0x93e0('0x6')](_0x250cf0);return _0x1c67a0[_0x93e0('0x7')](_0x93e0('0x8'));}function _0x31a333(){try{logger['info'](_0x93e0('0x9'));var _0x2218a8=moment()['unix']();var _0x843975=_0x241931(_0x2218a8+_0x5318af+_0x535926);_0x273afb[_0x93e0('0xa')](JSON[_0x93e0('0xb')]({'appID':_0x5318af,'timestamp':_0x2218a8,'appKey':_0x843975}));var _0x1cdda1=fs[_0x93e0('0xc')](_0x2470a9);_0x1cdda1['on'](_0x93e0('0xd'),function(_0x226970){_0x273afb[_0x93e0('0xa')](_0x226970);});_0x1cdda1['on']('close',function(){_0x273afb[_0x93e0('0xa')](_0x93e0('0xe'));});}catch(_0x26925c){logger[_0x93e0('0xf')](_0x93e0('0x10'),JSON[_0x93e0('0xb')](_0x26925c));_0x273afb['terminate']();}}function _0x2d9560(_0x1abf01){try{if(_0x1abf01){var _0x52e8ec=JSON[_0x93e0('0x11')](_0x1abf01);switch(_0x52e8ec[_0x93e0('0x12')]){case 0x0:if(_0x52e8ec[_0x93e0('0x13')]){if(_0x52e8ec[_0x93e0('0x13')][_0x93e0('0x14')]){logger[_0x93e0('0x15')]('Tilde\x20ASR\x20hypoteses',JSON[_0x93e0('0xb')](_0x52e8ec[_0x93e0('0x13')][_0x93e0('0x16')]));_0x43c1dd=_0x52e8ec[_0x93e0('0x13')][_0x93e0('0x16')][0x0][_0x93e0('0x17')];_0x1af92a=_0x52e8ec['result']['hypotheses'][0x0]['likelihood'];_0x5723e7='0';_0xf986f7=_0x93e0('0x18');_0x273afb[_0x93e0('0x19')]();}}break;case 0x1:logger[_0x93e0('0x15')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x5723e7='1';_0xf986f7=_0x93e0('0x1a');break;case 0x2:logger[_0x93e0('0x15')](_0x93e0('0x1b'));_0x5723e7='2';_0xf986f7=_0x93e0('0x1b');break;case 0x9:logger[_0x93e0('0x15')](_0x93e0('0x1c'));_0x5723e7='9';_0xf986f7=_0x93e0('0x1c');break;case 0xa:logger[_0x93e0('0x15')](_0x93e0('0x1d'));_0x5723e7='10';_0xf986f7=_0x93e0('0x1d');break;case 0xb:logger['info'](_0x93e0('0x1e'));_0x5723e7='11';_0xf986f7=_0x93e0('0x1e');}}}catch(_0x9736ef){logger['error'](_0x93e0('0x1f'),JSON[_0x93e0('0xb')](_0x9736ef));_0x273afb[_0x93e0('0x19')]();}}function _0x3dcdeb(){logger[_0x93e0('0x15')](_0x93e0('0x20'));_0x5d7e0e({'transcript':_0x43c1dd,'confidence':_0x1af92a,'status':_0x5723e7,'status_message':_0xf986f7});}function _0x366aa2(_0x185def){logger['error'](_0x93e0('0x21'));if(!_[_0x93e0('0x22')](_0x185def)){logger[_0x93e0('0xf')](_['isObject'](_0x185def)?JSON[_0x93e0('0xb')](_0x185def):_0x185def);}}_0x273afb['on'](_0x93e0('0x23'),_0x31a333);_0x273afb['on'](_0x93e0('0x24'),_0x2d9560);_0x273afb['on'](_0x93e0('0x25'),_0x3dcdeb);_0x273afb['on'](_0x93e0('0xf'),_0x366aa2);});}; \ 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 4e5201b..360afa6 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 _0x97f3=['./asr'];(function(_0x414fb3,_0x239cf4){var _0x49be47=function(_0x1ae8f0){while(--_0x1ae8f0){_0x414fb3['push'](_0x414fb3['shift']());}};_0x49be47(++_0x239cf4);}(_0x97f3,0x1b6));var _0x397f=function(_0x3d066b,_0x3eff6a){_0x3d066b=_0x3d066b-0x0;var _0x3cc725=_0x97f3[_0x3d066b];return _0x3cc725;};var asr=require(_0x397f('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x6899=['exports'];(function(_0x221df9,_0x3e5c1d){var _0x160b88=function(_0xbccc8a){while(--_0xbccc8a){_0x221df9['push'](_0x221df9['shift']());}};_0x160b88(++_0x3e5c1d);}(_0x6899,0xe4));var _0x9689=function(_0x31b212,_0x2af39e){_0x31b212=_0x31b212-0x0;var _0x3953a9=_0x6899[_0x31b212];return _0x3953a9;};var asr=require('./asr');module[_0x9689('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 545b8e5..72edde5 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 _0x7a7f=['E_AGI_SERVER_CLOSE','inherits','exports','util','net','./channel','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','emit','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close'];(function(_0x2a04c8,_0x28fcf1){var _0x329ff0=function(_0x37a122){while(--_0x37a122){_0x2a04c8['push'](_0x2a04c8['shift']());}};_0x329ff0(++_0x28fcf1);}(_0x7a7f,0xd5));var _0xf7a7=function(_0x5dd1f9,_0xfb7dd6){_0x5dd1f9=_0x5dd1f9-0x0;var _0x275aa4=_0x7a7f[_0x5dd1f9];return _0x275aa4;};'use strict';var util=require(_0xf7a7('0x0'));var net=require(_0xf7a7('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0xf7a7('0x2'));var AGIServer=function(_0xfe7a38,_0x134f94,_0x1dfaf3){var _0x5f3fbe=this,_0xfe7a38=_0xfe7a38||0x11dd,_0x134f94=_0x134f94||'127.0.0.1',_0x4a7746=null,_0x11e8ad=0x0;EventEmitter[_0xf7a7('0x3')](_0x5f3fbe);function _0x4e9fa4(){if(!_0xfe7a38){_0x5f3fbe['emit'](_0xf7a7('0x4'),new AGIError(_0xf7a7('0x5')));return![];}_0x4a7746=net[_0xf7a7('0x6')]();_0x4a7746[_0xf7a7('0x7')](_0xfe7a38,_0x134f94);_0x4a7746['on']('listening',function(){_0x5f3fbe['emit'](_0xf7a7('0x8'));});_0x4a7746['on'](_0xf7a7('0x9'),function(_0x156188){_0x4a7746[_0xf7a7('0xa')](function(_0x207d6c,_0x2ff31b){if(_0x207d6c){_0x5f3fbe['emit'](_0xf7a7('0x4'),new AGIError(_0xf7a7('0xb'),_0x207d6c));}else if(_0x1dfaf3&&_0x1dfaf3<0x0){_0x5f3fbe[_0xf7a7('0xc')](_0xf7a7('0x4'),new AGIError(_0xf7a7('0xd')));_0x156188[_0xf7a7('0xe')]();}else if(_0x1dfaf3&&_0x1dfaf3>0x0&&_0x1dfaf3<_0x2ff31b){_0x11e8ad+=0x1;_0x5f3fbe[_0xf7a7('0xc')](_0xf7a7('0x4'),new AGIError(_0xf7a7('0xf'),_0x11e8ad));_0x156188['destroy']();}else{var _0x5deb92=new AGIChannel(_0x156188);_0x5deb92['on']('ready',function(){_0x5f3fbe[_0xf7a7('0xc')]('connection',_0x5deb92);});}});});_0x4a7746['on'](_0xf7a7('0x4'),function(_0x3f00e2){_0x5f3fbe['emit'](_0xf7a7('0x4'),new AGIError(_0xf7a7('0xb'),_0x3f00e2[_0xf7a7('0x10')]));});_0x4a7746['on'](_0xf7a7('0x11'),function(){_0x5f3fbe[_0xf7a7('0xc')](_0xf7a7('0x11'),new AGIError(_0xf7a7('0x12')));});}process['nextTick'](function(){_0x4e9fa4();});};util[_0xf7a7('0x13')](AGIServer,EventEmitter);module[_0xf7a7('0x14')]=function(_0x782ef7,_0x22ff6f,_0x3d56c7){return new AGIServer(_0x782ef7,_0x22ff6f,_0x3d56c7);}; \ No newline at end of file +var _0x1440=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','error','E_AGI_SERVER_MAXCONNECTION','ready','close','nextTick','inherits','exports','util','events','EventEmitter','./channel','127.0.0.1','call','emit','createServer','listen','listening','connection'];(function(_0x41fadc,_0x1facbe){var _0x3fed41=function(_0x50ce61){while(--_0x50ce61){_0x41fadc['push'](_0x41fadc['shift']());}};_0x3fed41(++_0x1facbe);}(_0x1440,0x79));var _0x0144=function(_0x41fa39,_0x2f4427){_0x41fa39=_0x41fa39-0x0;var _0x8df392=_0x1440[_0x41fa39];return _0x8df392;};'use strict';var util=require(_0x0144('0x0'));var net=require('net');var EventEmitter=require(_0x0144('0x1'))[_0x0144('0x2')];var AGIError=require('./error');var AGIChannel=require(_0x0144('0x3'));var AGIServer=function(_0x9a1c22,_0x32ffb2,_0xf7719a){var _0x3a9fe8=this,_0x9a1c22=_0x9a1c22||0x11dd,_0x32ffb2=_0x32ffb2||_0x0144('0x4'),_0x1e49bb=null,_0x2be1a7=0x0;EventEmitter[_0x0144('0x5')](_0x3a9fe8);function _0x364afe(){if(!_0x9a1c22){_0x3a9fe8[_0x0144('0x6')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x1e49bb=net[_0x0144('0x7')]();_0x1e49bb[_0x0144('0x8')](_0x9a1c22,_0x32ffb2);_0x1e49bb['on'](_0x0144('0x9'),function(){_0x3a9fe8[_0x0144('0x6')](_0x0144('0x9'));});_0x1e49bb['on'](_0x0144('0xa'),function(_0x34bbc0){_0x1e49bb[_0x0144('0xb')](function(_0x19257e,_0x3b6ad5){if(_0x19257e){_0x3a9fe8['emit']('error',new AGIError(_0x0144('0xc'),_0x19257e));}else if(_0xf7719a&&_0xf7719a<0x0){_0x3a9fe8['emit']('error',new AGIError(_0x0144('0xd')));_0x34bbc0[_0x0144('0xe')]();}else if(_0xf7719a&&_0xf7719a>0x0&&_0xf7719a<_0x3b6ad5){_0x2be1a7+=0x1;_0x3a9fe8[_0x0144('0x6')](_0x0144('0xf'),new AGIError(_0x0144('0x10'),_0x2be1a7));_0x34bbc0[_0x0144('0xe')]();}else{var _0x5603fc=new AGIChannel(_0x34bbc0);_0x5603fc['on'](_0x0144('0x11'),function(){_0x3a9fe8['emit'](_0x0144('0xa'),_0x5603fc);});}});});_0x1e49bb['on'](_0x0144('0xf'),function(_0x35ad2e){_0x3a9fe8[_0x0144('0x6')]('error',new AGIError(_0x0144('0xc'),_0x35ad2e['code']));});_0x1e49bb['on'](_0x0144('0x12'),function(){_0x3a9fe8[_0x0144('0x6')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x0144('0x13')](function(){_0x364afe();});};util[_0x0144('0x14')](AGIServer,EventEmitter);module[_0x0144('0x15')]=function(_0x584981,_0x2ca46d,_0x4d57e9){return new AGIServer(_0x584981,_0x2ca46d,_0x4d57e9);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 2718479..bdc9072 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 _0x1198=['channel','prototype','getVariable','rpc','getVariableById','catch','getVoiceQueue','then','name','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','IntervalId','interval','map','format','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','googleTTS','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','uri','agicommand','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','length','setVariable','split','replaceAll','extra','toString','getAndSetVariable','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','forEach','%s[%s][%s]','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','private_key','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','[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','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','email','user','bcc','subject','Smtp','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','path','lodash','shelljs','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits'];(function(_0x34750b,_0x34aae5){var _0x244258=function(_0x503bf2){while(--_0x503bf2){_0x34750b['push'](_0x34750b['shift']());}};_0x244258(++_0x34aae5);}(_0x1198,0x1b4));var _0x8119=function(_0x3bd043,_0x4aef93){_0x3bd043=_0x3bd043-0x0;var _0x5d2c65=_0x1198[_0x3bd043];return _0x5d2c65;};'use strict';var fs=require('fs');var path=require(_0x8119('0x0'));var util=require('util');var _=require(_0x8119('0x1'));var sh=require(_0x8119('0x2'));var odbc=require('odbc')();var rs=require(_0x8119('0x3'));var moment=require(_0x8119('0x4'));var Mustache=require(_0x8119('0x5'));var rp=require(_0x8119('0x6'));var logger=require('../../config/logger')(_0x8119('0x7'));var config=require(_0x8119('0x8'));var scripts=require(_0x8119('0x9'));var FILES_PATH=_0x8119('0xa');var recursiveMapAttributes=[_0x8119('0xb'),_0x8119('0xc')];var verticesWithRetry=[_0x8119('0xd'),_0x8119('0xe'),_0x8119('0xf')];var AGIVertices=function(_0x5adb86,_0x52f4c5,_0x1b30e5){this[_0x8119('0x10')]=_0x5adb86;this['rpc']=_0x52f4c5;this['mailRpc']=_0x1b30e5;};AGIVertices[_0x8119('0x11')][_0x8119('0x12')]=function(_0xa784ae,_0x5ea62f){this[_0x8119('0x13')][_0x8119('0x14')](_0xa784ae)['then'](function(_0x2c0adc){_0x5ea62f(null,_0x2c0adc?_0x2c0adc['name']:![]);})[_0x8119('0x15')](function(_0x37b974){_0x5ea62f(_0x37b974);});};AGIVertices[_0x8119('0x11')][_0x8119('0x16')]=function(_0x5cdd53,_0x58555d){this['rpc']['getVoiceQueueById'](_0x5cdd53)[_0x8119('0x17')](function(_0x1c8add){_0x58555d(null,_0x1c8add?_0x1c8add[_0x8119('0x18')]:![]);})[_0x8119('0x15')](function(_0x58af62){_0x58555d(_0x58af62);});};AGIVertices[_0x8119('0x11')]['getSquareProject']=function(_0x42f3c2,_0x59cbd8){this[_0x8119('0x13')]['getSquareProjectById'](_0x42f3c2)[_0x8119('0x17')](function(_0x8d78f0){_0x59cbd8(null,_0x8d78f0?_0x8d78f0[_0x8119('0x18')]:![]);})['catch'](function(_0x549310){_0x59cbd8(_0x549310);});};AGIVertices[_0x8119('0x11')][_0x8119('0x19')]=function(_0x37ffca,_0x2114c9){this[_0x8119('0x13')][_0x8119('0x1a')](_0x37ffca)[_0x8119('0x17')](function(_0x350b5d){_0x2114c9(null,_0x350b5d?_0x350b5d['dsn']:![]);})[_0x8119('0x15')](function(_0x446c2e){_0x2114c9(_0x446c2e);});};AGIVertices['prototype'][_0x8119('0x1b')]=function(_0x4bda7f,_0x2781a1){this['rpc'][_0x8119('0x1c')](_0x4bda7f)[_0x8119('0x17')](function(_0x2919a6){_0x2781a1(null,_0x2919a6?_0x2919a6['name']:![]);})[_0x8119('0x15')](function(_0x19ec0e){_0x2781a1(_0x19ec0e);});};AGIVertices['prototype'][_0x8119('0x1d')]=function(_0x1bc8a7,_0x395ae5){this[_0x8119('0x13')][_0x8119('0x1e')](_0x1bc8a7)[_0x8119('0x17')](function(_0x171cc7){_0x395ae5(null,_0x171cc7?_0x171cc7[_0x8119('0x18')]:![]);})[_0x8119('0x15')](function(_0x1b14ae){_0x395ae5(_0x1b14ae);});};AGIVertices[_0x8119('0x11')][_0x8119('0x1f')]=function(_0x24a655,_0x16cd04){var _0x5d453d=this;this[_0x8119('0x13')]['getSoundById'](_0x24a655)['then'](function(_0x5186b4){_0x16cd04(null,_0x5186b4?_0x5d453d['getSoundPath'](_0x5186b4['save_name']):![]);})[_0x8119('0x15')](function(_0x543882){_0x16cd04(_0x543882);});};AGIVertices['prototype'][_0x8119('0x20')]=function(_0x5e3cc3,_0x3c5d07){this[_0x8119('0x13')][_0x8119('0x21')](_0x5e3cc3)[_0x8119('0x17')](function(_0x44d95d){_0x3c5d07(null,_0x44d95d?_0x44d95d:![]);})[_0x8119('0x15')](function(_0x2a7dfd){_0x3c5d07(_0x2a7dfd);});};AGIVertices[_0x8119('0x11')][_0x8119('0x22')]=function(_0x7eb611,_0x4d0e43,_0x347000){this[_0x8119('0x23')]['sendMailMessage'](_0x7eb611,_0x4d0e43)[_0x8119('0x17')](function(){_0x347000(null);})['catch'](function(_0x522ce5){_0x347000(_0x522ce5);});};AGIVertices['prototype'][_0x8119('0x24')]=function(_0x2bc916,_0x388292){this[_0x8119('0x13')]['getIntervalById'](_0x2bc916)[_0x8119('0x17')](function(_0x49a3cd){if(_0x49a3cd){if(_0x49a3cd[_0x8119('0x25')]){_0x388292(null,[_0x49a3cd[_0x8119('0x26')]]);}else{_0x388292(null,_[_0x8119('0x27')](_0x49a3cd['Intervals'],'interval'));}}else{_0x388292(null,![]);}})['catch'](function(_0x14fb5a){_0x388292(_0x14fb5a);});};AGIVertices[_0x8119('0x11')]['getSoundPath']=function(_0x23a722){return util[_0x8119('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x23a722);};AGIVertices[_0x8119('0x11')][_0x8119('0x29')]=function(_0x4ed566,_0x58f76f,_0x25db9c){odbc[_0x8119('0x2a')](_0x4ed566,function(_0x124566){if(_0x124566){logger[_0x8119('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x124566);_0x25db9c(_0x124566);}else{logger[_0x8119('0x2c')](_0x8119('0x2d'));odbc[_0x8119('0x2e')](_0x58f76f,function(_0x5959df,_0x199490){if(_0x5959df){logger[_0x8119('0x2c')](_0x8119('0x2f'),_0x58f76f);_0x25db9c(_0x5959df);}else{logger[_0x8119('0x2c')](_0x8119('0x30'),_0x58f76f);odbc['close'](function(_0x3de43d){if(_0x3de43d){logger[_0x8119('0x2b')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x3de43d);}_0x25db9c(null,_0x199490);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x4a709f,_0x44f0e5){this[_0x8119('0x13')]['getSmsAccountById'](_0x4a709f)[_0x8119('0x17')](function(_0x1ee864){_0x44f0e5(null,_0x1ee864?_0x1ee864:![]);})['catch'](function(_0x11561a){_0x44f0e5(_0x11561a);});};AGIVertices[_0x8119('0x11')][_0x8119('0x31')]=function(_0x233b19,_0x2190df){this[_0x8119('0x13')][_0x8119('0x31')](_0x233b19)['then'](function(_0x24b07a){_0x2190df(null,_0x24b07a);})[_0x8119('0x15')](function(_0x55eb9b){_0x2190df(_0x55eb9b);});};AGIVertices[_0x8119('0x11')][_0x8119('0x32')]=function(_0x46c99a,_0x374838,_0x3be443){this[_0x8119('0x13')][_0x8119('0x32')]({'uniqueid':this[_0x8119('0x10')][_0x8119('0x33')],'node':_0x46c99a[_0x8119('0x34')],'application':_0x46c99a['agicommand'],'data':_0x374838||null,'project_name':this['channel'][_0x8119('0x35')],'callerid':this['channel']['callerid']})[_0x8119('0x17')](function(_0x426633){if(_0x3be443){_0x3be443(null,_0x426633);}})[_0x8119('0x15')](function(_0x12faa2){if(_0x3be443){_0x3be443(_0x12faa2);}});};AGIVertices[_0x8119('0x11')][_0x8119('0x36')]=function(_0x56ce68,_0x23a3c1,_0x3e8d19,_0xe6e465){this[_0x8119('0x13')][_0x8119('0x36')]({'uniqueid':this[_0x8119('0x10')]['uniqueid'],'callerid':this[_0x8119('0x10')][_0x8119('0x37')],'calleridname':this['channel'][_0x8119('0x38')],'context':this[_0x8119('0x10')]['context'],'extension':this['channel'][_0x8119('0x39')],'priority':this[_0x8119('0x10')][_0x8119('0x3a')],'accountcode':this[_0x8119('0x10')][_0x8119('0x3b')],'dnid':this[_0x8119('0x10')][_0x8119('0x3c')],'projectName':this[_0x8119('0x10')][_0x8119('0x35')],'saveName':_0x23a3c1,'filename':_0x56ce68['file']||_0x23a3c1,'savePath':_0x3e8d19})['then'](function(_0x451293){_0xe6e465(null,_0x451293);})[_0x8119('0x15')](function(_0x3055fa){_0xe6e465(_0x3055fa);});};AGIVertices[_0x8119('0x11')][_0x8119('0x3d')]=function(_0x3c7ec9,_0x2134f2,_0x44e3b5,_0x113b6c,_0x38df65){this[_0x8119('0x13')][_0x8119('0x3d')]({'uniqueid':this[_0x8119('0x10')][_0x8119('0x33')],'body':_0x3c7ec9,'direction':_0x2134f2,'providerName':_0x44e3b5,'providerResponse':_0x113b6c})[_0x8119('0x17')](function(_0xf25bc2){if(_0x38df65){_0x38df65(null,_0xf25bc2);}})[_0x8119('0x15')](function(_0x2fd28c){if(_0x38df65){_0x38df65(_0x2fd28c);}});};AGIVertices[_0x8119('0x11')][_0x8119('0x3e')]=function(_0x4110b5,_0x38b681){this[_0x8119('0x13')][_0x8119('0x3e')]({'firstName':_[_0x8119('0x3f')](_0x4110b5['name'])||_[_0x8119('0x40')](_0x4110b5[_0x8119('0x18')])?_0x8119('0x41')+Math[_0x8119('0x42')]():_0x4110b5['name'],'lastName':_[_0x8119('0x3f')](_0x4110b5[_0x8119('0x43')])||_[_0x8119('0x40')](_0x4110b5['lastName'])?null:_0x4110b5[_0x8119('0x43')],'phone':_0x4110b5[_0x8119('0x44')],'ListId':_0x4110b5[_0x8119('0x45')],'scheduledat':_0x4110b5[_0x8119('0x46')],'callbackUniqueid':this[_0x8119('0x10')][_0x8119('0x33')],'tags':_0x8119('0x47'),'description':_0x8119('0x48')+_0x4110b5[_0x8119('0x46')]['toString'](),'priority':_0x4110b5[_0x8119('0x49')]})['then'](function(_0x847b30){_0x38b681(null,_0x847b30);})[_0x8119('0x15')](function(_0x191e36){_0x38b681(_0x191e36);});};AGIVertices[_0x8119('0x11')][_0x8119('0x4a')]=function(_0x2b13c0,_0x6809ff){this[_0x8119('0x13')][_0x8119('0x4b')](_0x2b13c0)[_0x8119('0x17')](function(_0x1dca72){_0x6809ff(null,_0x1dca72?_0x1dca72[_0x8119('0x18')]:![]);})[_0x8119('0x15')](function(_0x10e43e){_0x6809ff(_0x10e43e);});};AGIVertices[_0x8119('0x11')][_0x8119('0x4c')]=function(_0x483650,_0x2b9855,_0x469fdb){var _0x3b7703={'role':_0x8119('0x4d')};_0x3b7703[_0x483650]=this[_0x8119('0x10')][_0x8119('0x37')];this[_0x8119('0x13')][_0x8119('0x4c')](_0x3b7703,_0x2b9855,this[_0x8119('0x10')][_0x8119('0x33')])[_0x8119('0x17')](function(_0x21bbcf){_0x469fdb(null,_[_0x8119('0x40')](_0x21bbcf)?![]:!![]);})[_0x8119('0x15')](function(_0x4ddfd3){logger[_0x8119('0x2b')](_0x4ddfd3);_0x469fdb(null,![]);});};AGIVertices[_0x8119('0x11')][_0x8119('0x4e')]=function(_0xe3086d,_0x3a99cc){var _0x1c6bc1={'role':_0x8119('0x4d')};_0x1c6bc1[_0xe3086d]=this[_0x8119('0x10')][_0x8119('0x37')];this['rpc'][_0x8119('0x4e')](_0x1c6bc1)['then'](function(_0x3ac7e5){_0x3a99cc(null,_[_0x8119('0x40')](_0x3ac7e5)?![]:!![]);})[_0x8119('0x15')](function(_0x5a45af){logger[_0x8119('0x2b')](_0x5a45af);_0x3a99cc(null,![]);});};AGIVertices[_0x8119('0x11')][_0x8119('0x4f')]=function(_0x46edf0,_0x11b030){var _0x350fd6={'role':_0x8119('0x4d')};_0x350fd6[_0x46edf0]=this[_0x8119('0x10')][_0x8119('0x37')];this[_0x8119('0x13')][_0x8119('0x4f')](_0x350fd6)[_0x8119('0x17')](function(_0x2d35ea){_0x11b030(null,_[_0x8119('0x40')](_0x2d35ea)?![]:!![]);})[_0x8119('0x15')](function(_0x56e624){logger[_0x8119('0x2b')](_0x56e624);_0x11b030(null,![]);});};AGIVertices[_0x8119('0x11')][_0x8119('0x50')]=function(_0x438b6b,_0x387fe9){var _0x3ae225={'role':_0x8119('0x4d')};_0x3ae225[_0x438b6b]=this[_0x8119('0x10')][_0x8119('0x37')];var _0x2411df=_0x438b6b!=_0x8119('0x51')?util[_0x8119('0x28')](_0x8119('0x52'),'LOCAL',this['channel']['callerid']):undefined;this[_0x8119('0x13')][_0x8119('0x50')](_0x3ae225,_0x2411df)[_0x8119('0x17')](function(_0x1d65ba){_0x387fe9(null,_['isNil'](_0x1d65ba)?![]:!![]);})[_0x8119('0x15')](function(_0x25313a){logger[_0x8119('0x2b')](_0x25313a);_0x387fe9(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x3c8303,_0x4ebb36){sh[_0x8119('0x53')](_[_0x8119('0x54')](_0x3c8303),function(_0xa1ee72,_0x2fc624){var _0x2fb396=_0x2fc624[_0x8119('0x55')](/(\r\n|\n|\r)/gm,'');_0x4ebb36(null,_0x2fb396);});};AGIVertices[_0x8119('0x11')][_0x8119('0x56')]=function(_0x586c9a,_0x5d1e04){scripts[_0x8119('0x56')](_0x586c9a['apiKey'],_0x586c9a[_0x8119('0x57')]||_0x8119('0x58'),_0x586c9a['text'],_0x586c9a[_0x8119('0x59')]||'en-US',_0x586c9a[_0x8119('0x5a')]||_0x8119('0x5b'),_0x586c9a['audioEncoding']||'MP3')[_0x8119('0x17')](function(_0x20f7b4){_0x5d1e04(null,_0x20f7b4);})['catch'](function(_0x348f32){_0x5d1e04(_0x348f32);});};AGIVertices[_0x8119('0x11')]['googleTTS']=function(_0xabbcee,_0x15e120){scripts[_0x8119('0x5c')](_0xabbcee['text'],_0xabbcee['google_tts_language']||'en',0x1)['then'](function(_0x3beba8){_0x15e120(null,_0x3beba8);})[_0x8119('0x15')](function(_0x12e4b1){_0x15e120(_0x12e4b1);});};AGIVertices[_0x8119('0x11')][_0x8119('0x5d')]=function(_0x376579,_0x407647){var _0x420bbc={'uri':_0x376579[_0x8119('0x5e')],'method':_0x376579[_0x8119('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x376579['timeout'])===_0x8119('0x60')&&parseInt(_0x376579[_0x8119('0x61')])>=0x1?parseInt(_0x376579['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x8119('0x62')]([_0x8119('0x63'),_0x8119('0x64')],_0x420bbc[_0x8119('0x5f')][_0x8119('0x65')]())){try{_0x420bbc['body']=_0x376579[_0x8119('0xc')]?JSON[_0x8119('0x66')](_0x376579['rawBody']):{};}catch(_0x5790ee){logger[_0x8119('0x2b')](_0x8119('0x67'),_0x5790ee);}}try{_0x420bbc['headers']=_0x376579[_0x8119('0xb')]?JSON[_0x8119('0x66')](_0x376579[_0x8119('0xb')]):{};}catch(_0x5f53f9){logger['error'](_0x8119('0x68'),_0x5f53f9);}if(_0x376579[_0x8119('0x69')]){try{var _0x1e3d38=require(_0x376579['computedVariables'])[_0x8119('0x6a')](this,_0x420bbc);_0x420bbc['uri']=Mustache[_0x8119('0x6b')](_0x376579[_0x8119('0x5e')],_0x1e3d38,{},['$$','$$']);if(_0x420bbc[_0x8119('0x6c')]){_0x420bbc[_0x8119('0x6c')]=JSON[_0x8119('0x66')](Mustache[_0x8119('0x6b')](JSON[_0x8119('0x6d')](_0x420bbc[_0x8119('0x6c')]),_0x1e3d38,{},['$$','$$']));}if(_0x420bbc[_0x8119('0x6e')]){_0x420bbc['body']=JSON[_0x8119('0x66')](Mustache[_0x8119('0x6b')](JSON[_0x8119('0x6d')](_0x420bbc['body']),_0x1e3d38,{},['$$','$$']));}}catch(_0x324409){logger[_0x8119('0x2b')](_0x8119('0x6f'),_0x324409);}}rp(_0x420bbc)[_0x8119('0x17')](function(_0x41beba){var _0x292098={'statusCode':_0x41beba[_0x8119('0x70')]||0xc8,'statusMessage':_0x41beba[_0x8119('0x71')]||'OK','headers':_0x41beba[_0x8119('0x6c')]||{},'body':_0x41beba[_0x8119('0x6e')]||{}};_0x407647(null,_0x292098);})[_0x8119('0x15')](function(_0x2fb271){var _0x3446bc={'statusCode':_0x2fb271[_0x8119('0x70')]||0x1f4,'statusMessage':_0x2fb271[_0x8119('0x72')]||_0x8119('0x73'),'headers':_0x2fb271[_0x8119('0x74')][_0x8119('0x6c')]||{},'body':_0x2fb271[_0x8119('0x74')]['body']||{}};_0x407647(null,_0x3446bc);});};AGIVertices['prototype'][_0x8119('0x75')]=function(_0x40b1be,_0x58bd8b){scripts[_0x8119('0x75')](this['channel'][_0x8119('0x33')],_0x40b1be['key'],_0x40b1be['text'],_0x40b1be[_0x8119('0x76')]||'en')[_0x8119('0x17')](function(_0x36c80f){_0x58bd8b(null,_0x36c80f);})[_0x8119('0x15')](function(_0x1d9b8c){_0x58bd8b(_0x1d9b8c);});};AGIVertices[_0x8119('0x11')][_0x8119('0x77')]=function(_0x3cb8bb,_0x4c81da){scripts[_0x8119('0x77')](this['channel'][_0x8119('0x33')],_0x3cb8bb[_0x8119('0x78')],_0x3cb8bb[_0x8119('0x79')],_0x3cb8bb['private_key'],_0x3cb8bb[_0x8119('0x58')],_0x3cb8bb['dialogflowV2_language']||'en')[_0x8119('0x17')](function(_0x1b8b69){_0x4c81da(null,_0x1b8b69);})['catch'](function(_0x1fe58c){_0x4c81da(_0x1fe58c);});};AGIVertices[_0x8119('0x11')]['sestekNDA']=function(_0x279e1a,_0x4d3154){scripts[_0x8119('0x7a')](this['channel'],_0x279e1a)[_0x8119('0x17')](function(_0x21129d){_0x4d3154(null,_0x21129d);})['catch'](function(_0x186ee6){_0x4d3154(_0x186ee6);});};AGIVertices['prototype']['ispeechTTS']=function(_0x222ef9,_0x28b480){scripts['ispeechTTS'](_0x222ef9[_0x8119('0x7b')],_0x222ef9[_0x8119('0x58')],_0x222ef9[_0x8119('0x7c')]||_0x8119('0x7d'),_0x222ef9[_0x8119('0x7e')])[_0x8119('0x17')](function(_0x478f06){_0x28b480(null,_0x478f06);})['catch'](function(_0x3f6e3a){_0x28b480(_0x3f6e3a);});};AGIVertices[_0x8119('0x11')]['ispeechASR']=function(_0x3360a9,_0x395b11,_0x3e4804){scripts[_0x8119('0x7f')](_0x395b11,_0x3360a9[_0x8119('0x7b')],_0x3360a9[_0x8119('0x80')]||'en-US',this[_0x8119('0x81')](_0x3360a9[_0x8119('0x82')])?_0x3360a9[_0x8119('0x82')]:undefined)[_0x8119('0x17')](function(_0x4a3069){_0x3e4804(null,_0x4a3069);})[_0x8119('0x15')](function(_0x3d4b30){_0x3e4804(_0x3d4b30);});};AGIVertices['prototype'][_0x8119('0x83')]=function(_0x21b2b6,_0xff084d){scripts[_0x8119('0x83')](_0x21b2b6[_0x8119('0x84')],_0x21b2b6[_0x8119('0x85')],_0x21b2b6[_0x8119('0x86')],_0x21b2b6[_0x8119('0x87')]||_0x8119('0x88'),_0x21b2b6[_0x8119('0x58')],_0x21b2b6['aws_text_type']||_0x8119('0x58'))[_0x8119('0x17')](function(_0xc88b0e){_0xff084d(null,_0xc88b0e);})[_0x8119('0x15')](function(_0x5c9b46){_0xff084d(_0x5c9b46);});};AGIVertices['prototype'][_0x8119('0x89')]=function(_0x294e92,_0x229b4c){scripts[_0x8119('0x89')](this[_0x8119('0x10')][_0x8119('0x33')],_0x294e92[_0x8119('0x84')],_0x294e92['aws_secret_access_key'],_0x294e92[_0x8119('0x8a')],_0x294e92['text'],_0x294e92[_0x8119('0x8b')])[_0x8119('0x17')](function(_0x9a94cb){_0x229b4c(null,_0x9a94cb);})[_0x8119('0x15')](function(_0xf51f61){_0x229b4c(_0xf51f61);});};AGIVertices['prototype'][_0x8119('0x8c')]=function(_0x582aa8,_0x2069bd,_0x4c2722){scripts['googleASR'](_0x2069bd,_0x582aa8[_0x8119('0x7b')],_0x582aa8['google_asr_language']||_0x8119('0x7d'))[_0x8119('0x17')](function(_0x1f02ff){_0x4c2722(null,_0x1f02ff);})[_0x8119('0x15')](function(_0xf389ef){_0x4c2722(_0xf389ef);});};AGIVertices[_0x8119('0x11')][_0x8119('0x8d')]=function(_0x2f3807,_0x5a9795,_0xbef0ff){scripts['tildeASR'](_0x5a9795,_0x2f3807['appid'],_0x2f3807['appsecret'],_0x2f3807[_0x8119('0x8e')])[_0x8119('0x17')](function(_0x3b0bc3){_0xbef0ff(null,_0x3b0bc3);})[_0x8119('0x15')](function(_0x1645e8){_0xbef0ff(_0x1645e8);});};AGIVertices[_0x8119('0x11')]['clear']=function(_0x174d42){var _0x55aa70=_[_0x8119('0x62')](verticesWithRetry,_0x174d42[_0x8119('0x8f')])?_0x174d42:_['clone'](_0x174d42);for(var _0xd8a4d8 in _0x55aa70){if(_0x55aa70[_0x8119('0x90')](_0xd8a4d8)){if(_0x55aa70[_0xd8a4d8]&&_[_0x8119('0x91')](_0x55aa70[_0xd8a4d8])){if(_[_0x8119('0x62')](recursiveMapAttributes,_0xd8a4d8)){_0x55aa70[_0xd8a4d8]=this[_0x8119('0x92')](_0x55aa70[_0xd8a4d8]);}else{_0x55aa70[_0xd8a4d8]=this[_0x8119('0x93')](_0x55aa70[_0xd8a4d8]);}}}}return _0x55aa70;};AGIVertices[_0x8119('0x11')]['recursiveNodeIndex']=function(_0x236bde){for(var _0x31b00b in _0x236bde){if(_0x236bde[_0x8119('0x90')](_0x31b00b)){if(_['isPlainObject'](_0x236bde[_0x31b00b])){this[_0x8119('0x94')](_0x236bde[_0x31b00b]);}else if(_[_0x8119('0x95')](_0x236bde[_0x31b00b])){for(var _0x1897a5=0x0;_0x1897a5<_0x236bde[_0x31b00b]['length'];_0x1897a5++){this['recursiveNodeIndex'](_0x236bde[_0x31b00b][_0x1897a5]);}}else if(_[_0x8119('0x91')](_0x236bde[_0x31b00b])){_0x236bde[_0x31b00b]=this[_0x8119('0x93')](_0x236bde[_0x31b00b]);}}}};AGIVertices['prototype'][_0x8119('0x96')]=function(_0x170cf8,_0x1e2983){for(var _0x4471bf in _0x170cf8){if(_0x170cf8[_0x8119('0x90')](_0x4471bf)){if(_['isPlainObject'](_0x170cf8[_0x4471bf])){if(!_['isEmpty'](_0x170cf8[_0x4471bf])){this[_0x8119('0x96')](_0x170cf8[_0x4471bf],util[_0x8119('0x28')](_0x8119('0x97'),_0x1e2983,_0x4471bf));}}else if(_[_0x8119('0x95')](_0x170cf8[_0x4471bf])){for(var _0x4b56f5=0x0;_0x4b56f5<_0x170cf8[_0x4471bf][_0x8119('0x98')];_0x4b56f5++){this['saveRestApiResult'](_0x170cf8[_0x4471bf][_0x4b56f5],util['format'](_0x8119('0x97'),_0x1e2983,_0x4471bf+'['+_0x4b56f5+']'));}}else{if(!_[_0x8119('0x40')](_0x170cf8[_0x4471bf])){this[_0x8119('0x10')][_0x8119('0x99')](util['format'](_0x8119('0x97'),_0x1e2983,_0x4471bf),_0x170cf8[_0x4471bf]);}}}}};AGIVertices[_0x8119('0x11')][_0x8119('0x92')]=function(_0x1b392){try{var _0x594548=JSON[_0x8119('0x66')](_0x1b392);this['recursiveNodeIndex'](_0x594548);return JSON[_0x8119('0x6d')](_0x594548);}catch(_0x4caadf){return this[_0x8119('0x93')](_0x1b392);}};AGIVertices[_0x8119('0x11')][_0x8119('0x93')]=function(_0x1c6e3e){var _0x1e8a57=_0x1c6e3e[_0x8119('0x9a')]('{');for(var _0x5a4bcd=0x1;_0x5a4bcd<_0x1e8a57[_0x8119('0x98')];_0x5a4bcd+=0x1){var _0x467a74=_0x1e8a57[_0x5a4bcd][_0x8119('0x9a')]('}');if(_0x467a74[_0x8119('0x98')]>0x1){_0x1c6e3e=_0x1c6e3e[_0x8119('0x9b')]('{'+_0x467a74[0x0]+'}',this['channel'][_0x8119('0x12')](_0x467a74[0x0])[_0x8119('0x9c')]||_0x467a74[0x0]);}}if(_0x1e8a57['length']===0x1){return _0x1c6e3e[_0x8119('0x9d')]();}return this[_0x8119('0x93')](_0x1c6e3e);};AGIVertices[_0x8119('0x11')][_0x8119('0x9e')]=function(_0x3b4c3d,_0x565d24){var _0x15622a=this[_0x8119('0x10')][_0x8119('0x12')](_0x3b4c3d);if(_0x15622a[_0x8119('0x9f')]===-0x1){return _0x15622a;}logger[_0x8119('0x2c')](util[_0x8119('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x565d24,_0x15622a[_0x8119('0x9c')]));return this['channel']['setVariable'](_0x565d24,_0x15622a['extra']);};AGIVertices[_0x8119('0x11')][_0x8119('0x81')]=function(_0x361d1d){return _0x361d1d&&_0x361d1d!=='0'&&_0x361d1d!=='-1'&&_0x361d1d!=='';};AGIVertices[_0x8119('0x11')][_0x8119('0xa0')]=function(_0x203631){this[_0x8119('0x32')][_0x8119('0x6a')](this,_0x203631,'-');_0x203631[_0x8119('0xa1')]=_0x203631[_0x8119('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8119('0x11')]['mrcpsynth']=function(_0x2982f4){logger[_0x8119('0x2c')](util['format'](_0x8119('0xa2'),_0x2982f4['label']));if(!this[_0x8119('0x81')](_0x2982f4[_0x8119('0x58')])){return this['channel'][_0x8119('0xa3')](_0x8119('0xa4'));}var _0x77d2d7='\x22'+_0x2982f4[_0x8119('0x58')]+'\x22';if(this[_0x8119('0x81')](_0x2982f4[_0x8119('0x74')])){_0x77d2d7+=','+_0x2982f4[_0x8119('0x74')];}var _0x2ff514=this['channel']['exec'](_0x8119('0xa5'),_0x77d2d7);if(_0x2ff514['result']===-0x1){return _0x2ff514;}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xa6'),_0x77d2d7));};AGIVertices[_0x8119('0x11')]['mrcprecog']=function(_0x5638d9){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xa7'),_0x5638d9[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x5638d9[_0x8119('0xa8')])){return this['channel']['noop'](_0x8119('0xa9'));}var _0x5586f7=_0x5638d9[_0x8119('0xa8')];if(this[_0x8119('0x81')](_0x5638d9[_0x8119('0x74')])){_0x5586f7+=','+_0x5638d9[_0x8119('0x74')];}var _0x21b472=this['channel']['exec'](_0x8119('0xaa'),_0x5586f7);if(_0x21b472[_0x8119('0x9f')]===-0x1){return _0x21b472;}var _0x2ff0f7=this[_0x8119('0x9e')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x2ff0f7[_0x8119('0x9f')]===-0x1){return _0x2ff0f7;}var _0x4fc481=this[_0x8119('0x9e')](_0x8119('0xab'),_0x8119('0xac'));if(_0x4fc481['result']===-0x1){return _0x4fc481;}var _0x4bb0a9=this[_0x8119('0x9e')](_0x8119('0xad'),'MRCP_RECOG_INSTANCE');if(_0x4bb0a9[_0x8119('0x9f')]===-0x1){return _0x4bb0a9;}return this['channel']['noop'](util[_0x8119('0x28')](_0x8119('0xae'),_0x5586f7));};AGIVertices['prototype'][_0x8119('0x7')]=function(_0xa8d48){logger['info'](util[_0x8119('0x28')](_0x8119('0xaf'),_0xa8d48['label']));return this[_0x8119('0x10')][_0x8119('0x7')]([_0xa8d48[_0x8119('0xb0')],_0xa8d48[_0x8119('0xb1')]]);};AGIVertices[_0x8119('0x11')][_0x8119('0xb2')]=function(_0x337b8b){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xb3'),_0x337b8b[_0x8119('0x34')]));if(this[_0x8119('0x81')](_0x337b8b[_0x8119('0x61')])){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xb4'),_0x337b8b[_0x8119('0x61')]));var _0x3103ae=this[_0x8119('0x10')]['wait'](_0x337b8b[_0x8119('0x61')]);if(_0x3103ae[_0x8119('0x9f')]===-0x1){return _0x3103ae;}}return this[_0x8119('0x10')][_0x8119('0xb2')]();};AGIVertices['prototype'][_0x8119('0x47')]=function(_0x94b677){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xb5'),_0x94b677['label']));if(!this[_0x8119('0x81')](_0x94b677[_0x8119('0x45')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x94b677,'no\x20list\x20selected');}_0x94b677[_0x8119('0x46')]=moment();if(this[_0x8119('0x81')](_0x94b677[_0x8119('0xb6')])){_0x94b677[_0x8119('0x46')]=moment()[_0x8119('0xb7')](_0x94b677[_0x8119('0xb6')],_0x8119('0xb8'));}if(!this[_0x8119('0x81')](_0x94b677[_0x8119('0x49')])){_0x94b677[_0x8119('0x49')]=0x2;}this[_0x8119('0x3e')][_0x8119('0x6a')](this,_0x94b677);return this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0xb9'),_0x94b677['phone'],_0x94b677['list_id'],_0x94b677['scheduledAt']));};AGIVertices['prototype'][_0x8119('0xba')]=function(_0x30eab9){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xbb'),_0x30eab9[_0x8119('0x34')]));var _0x249b25=this[_0x8119('0x10')]['exec'](_0x30eab9['application'],_0x30eab9[_0x8119('0x74')]);if(_0x249b25[_0x8119('0x9f')]===-0x1){return _0x249b25;}return this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0xbc'),_0x30eab9['application'],_0x30eab9[_0x8119('0x74')]));};AGIVertices['prototype'][_0x8119('0xbd')]=function(_0x1e6882){logger['info'](util['format'](_0x8119('0xbe'),_0x1e6882[_0x8119('0x34')]));if(!this['isConfigured'](_0x1e6882[_0x8119('0x58')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xa4'));}var _0x4f8f69='\x22'+_0x1e6882[_0x8119('0x58')]+'\x22';if(this[_0x8119('0x81')](_0x1e6882['options'])){_0x4f8f69+=','+_0x1e6882[_0x8119('0x74')];}var _0x34798c=this['channel'][_0x8119('0x53')](_0x8119('0xa5'),_0x4f8f69);if(_0x34798c[_0x8119('0x9f')]===-0x1){return _0x34798c;}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xa6'),_0x4f8f69));};AGIVertices[_0x8119('0x11')][_0x8119('0xbf')]=function(_0x21d74a){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xc0'),_0x21d74a[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x21d74a[_0x8119('0x58')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xa4'));}var _0x31b295='\x22'+_0x21d74a[_0x8119('0x58')]+'\x22';if(this[_0x8119('0x81')](_0x21d74a[_0x8119('0x74')])){_0x31b295+=','+_0x21d74a[_0x8119('0x74')];}var _0x5a8314=this['channel']['exec'](_0x8119('0xa5'),_0x31b295);if(_0x5a8314[_0x8119('0x9f')]===-0x1){return _0x5a8314;}return this['channel'][_0x8119('0xa3')](util[_0x8119('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x31b295));};AGIVertices[_0x8119('0x11')]['lumenvoxasr']=function(_0xab6bef){logger[_0x8119('0x2c')](util[_0x8119('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xab6bef[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0xab6bef[_0x8119('0xa8')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xa9'));}var _0x9e951e=_0xab6bef[_0x8119('0xa8')];if(this[_0x8119('0x81')](_0xab6bef['options'])){_0x9e951e+=','+_0xab6bef['options'];}var _0x4c037b=this['channel'][_0x8119('0x53')](_0x8119('0xaa'),_0x9e951e);if(_0x4c037b[_0x8119('0x9f')]===-0x1){return _0x4c037b;}var _0x2df349=this[_0x8119('0x9e')](_0x8119('0xc1'),_0x8119('0xc2'));if(_0x2df349[_0x8119('0x9f')]===-0x1){return _0x2df349;}var _0x476ed2=this[_0x8119('0x9e')](_0x8119('0xab'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x476ed2[_0x8119('0x9f')]===-0x1){return _0x476ed2;}var _0x3ef532=this[_0x8119('0x9e')]('RECOG_INSTANCE()',_0x8119('0xc3'));if(_0x3ef532[_0x8119('0x9f')]===-0x1){return _0x3ef532;}return this[_0x8119('0x10')]['noop'](util['format'](_0x8119('0xae'),_0x9e951e));};AGIVertices[_0x8119('0x11')]['sestekasr']=function(_0x4aae4d){logger[_0x8119('0x2c')](util['format'](_0x8119('0xc4'),_0x4aae4d['label']));if(!this['isConfigured'](_0x4aae4d[_0x8119('0xa8')])){return this['channel'][_0x8119('0xa3')](_0x8119('0xa9'));}var _0x2422d8=_0x4aae4d[_0x8119('0xa8')];if(this[_0x8119('0x81')](_0x4aae4d[_0x8119('0x74')])){_0x2422d8+=','+_0x4aae4d['options'];}var _0x480c8d=this[_0x8119('0x10')][_0x8119('0x53')](_0x8119('0xaa'),_0x2422d8);if(_0x480c8d[_0x8119('0x9f')]===-0x1){return _0x480c8d;}var _0x4d17bf=this[_0x8119('0x9e')](_0x8119('0xc1'),_0x8119('0xc5'));if(_0x4d17bf[_0x8119('0x9f')]===-0x1){return _0x4d17bf;}var _0x36edce=this['getAndSetVariable']('RECOG_INPUT()',_0x8119('0xc6'));if(_0x36edce[_0x8119('0x9f')]===-0x1){return _0x36edce;}var _0x4207c6=this[_0x8119('0x9e')](_0x8119('0xad'),_0x8119('0xc7'));if(_0x4207c6[_0x8119('0x9f')]===-0x1){return _0x4207c6;}return this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0xae'),_0x2422d8));};AGIVertices['prototype'][_0x8119('0xc8')]=function(_0x726609){logger[_0x8119('0x2c')](util['format'](_0x8119('0xc9'),_0x726609[_0x8119('0x34')]));if(!this['isConfigured'](_0x726609[_0x8119('0xca')])){return this[_0x8119('0x10')]['error'](_0x726609,_0x8119('0xcb'));}var _0x4bc447=this['getSquareOdbc'][_0x8119('0x6a')](this,_0x726609[_0x8119('0xca')]);if(!_0x4bc447){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x726609,_0x8119('0xcc'));}if(!this[_0x8119('0x81')](_0x726609[_0x8119('0x2e')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x726609,_0x8119('0xcd'));}var _0x1ef3ba=_0x726609[_0x8119('0x2e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')]('query:\x20%s',_0x1ef3ba));var _0x167f99=this[_0x8119('0x29')][_0x8119('0x6a')](this,_0x4bc447,_0x1ef3ba);this[_0x8119('0x32')]['sync'](this,_0x726609,_0x1ef3ba);if(!this['isConfigured'](_0x726609[_0x8119('0xce')])){return this['channel'][_0x8119('0xa3')](_0x8119('0xcf'));}var _0x22eb9c=this[_0x8119('0x12')][_0x8119('0x6a')](this,_0x726609['variable_id']);if(!_0x22eb9c){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x726609,'no\x20variable\x20found');}var _0x629f2b=this;_0x167f99['forEach'](function(_0x278147,_0x112ac1){Object[_0x8119('0xd0')](_0x278147)[_0x8119('0xd1')](function(_0x2b503b){_0x629f2b[_0x8119('0x10')][_0x8119('0x99')](util[_0x8119('0x28')](_0x8119('0xd2'),_0x22eb9c,_0x112ac1,_0x2b503b),_0x278147[_0x2b503b]);});});this['channel'][_0x8119('0x99')](util[_0x8119('0x28')]('%s_ROWS_COUNT',_0x22eb9c),_0x167f99[_0x8119('0x98')]);return this['channel'][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xd3'),_0x22eb9c));};AGIVertices['prototype']['dial']=function(_0xea8090){logger[_0x8119('0xd4')](util[_0x8119('0x28')](_0x8119('0xd5'),_0xea8090[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0xea8090['sip_id'])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0xea8090,_0x8119('0xd6'));}var _0x248ac4=this[_0x8119('0x1b')][_0x8119('0x6a')](this,_0xea8090[_0x8119('0xd7')]);if(!_0x248ac4){return this[_0x8119('0x10')]['error'](_0xea8090,_0x8119('0xd8'));}var _0x5c9c21=this[_0x8119('0x10')][_0x8119('0x53')](_0x8119('0xd9'),[util['format']('SIP/%s',_0x248ac4),_0xea8090[_0x8119('0x61')],_0xea8090['opts'],_0xea8090[_0x8119('0x5e')]]);if(_0x5c9c21[_0x8119('0x9f')]===-0x1){return _0x5c9c21;}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xda'),_0x8119('0xd9')));};AGIVertices['prototype'][_0x8119('0xdb')]=function(_0x401eb6){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xdc'),_0x401eb6[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x401eb6[_0x8119('0x7b')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xdd'));}if(!this[_0x8119('0x81')](_0x401eb6[_0x8119('0x58')])){return this[_0x8119('0x10')][_0x8119('0xa3')]('no\x20text\x20configured');}this[_0x8119('0x10')][_0x8119('0xde')]=!![];this[_0x8119('0x32')](_0x401eb6);this[_0x8119('0x3d')](_0x401eb6[_0x8119('0x58')],'in','','');this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xdf'),_0x401eb6[_0x8119('0x58')]));var _0x5a592e=this['googleDialogflow']['sync'](this,_0x401eb6);if(_0x5a592e){for(var _0x27afc2 in _0x5a592e){if(_0x5a592e[_0x8119('0x90')](_0x27afc2)){this['channel'][_0x8119('0x99')](util['format']('DIALOGFLOW_%s',_0x27afc2[_0x8119('0x65')]()),_0x5a592e[_0x27afc2]);}}this['createSquareMessage'](_0x5a592e[_0x8119('0xe0')],_0x8119('0xe1'),_0x8119('0xdb'),'');return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xe2'),_0x5a592e[_0x8119('0xe0')]));}return this[_0x8119('0x10')][_0x8119('0x2b')](_0x401eb6,_0x8119('0xe3'));};AGIVertices[_0x8119('0x11')][_0x8119('0xe4')]=function(_0x37d4a6){logger[_0x8119('0x2c')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x37d4a6['label']));if(!this['isConfigured'](_0x37d4a6[_0x8119('0x78')])){return this[_0x8119('0x10')][_0x8119('0xa3')]('no\x20project_id\x20configured');}if(!this[_0x8119('0x81')](_0x37d4a6[_0x8119('0x79')])){return this['channel'][_0x8119('0xa3')]('no\x20client_email\x20configured');}if(!this[_0x8119('0x81')](_0x37d4a6[_0x8119('0xe5')])){return this['channel'][_0x8119('0xa3')](_0x8119('0xe6'));}if(!this[_0x8119('0x81')](_0x37d4a6[_0x8119('0xe7')])){return this['channel'][_0x8119('0xa3')](_0x8119('0xe8'));}if(!this[_0x8119('0x81')](_0x37d4a6[_0x8119('0x58')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xa4'));}this[_0x8119('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0x37d4a6);this[_0x8119('0x3d')](_0x37d4a6[_0x8119('0x58')],'in','','');this['channel'][_0x8119('0xa3')](util['format'](_0x8119('0xe9'),_0x37d4a6[_0x8119('0x58')]));var _0x2b6cca=this[_0x8119('0x77')][_0x8119('0x6a')](this,_0x37d4a6);if(_0x2b6cca){for(var _0x4c7213 in _0x2b6cca){if(_0x2b6cca[_0x8119('0x90')](_0x4c7213)){if(_0x4c7213!=='providerResponse'){this['channel'][_0x8119('0x99')](util[_0x8119('0x28')](_0x8119('0xea'),_0x4c7213[_0x8119('0x65')]()),_0x2b6cca[_0x4c7213]);}}}this[_0x8119('0x3d')](_0x2b6cca['speech'],_0x8119('0xe1'),_0x8119('0xe4'),_0x2b6cca[_0x8119('0xeb')]);return this['channel'][_0x8119('0xa3')](util['format'](_0x8119('0xec'),_0x2b6cca[_0x8119('0xe0')]));}return this['channel'][_0x8119('0x2b')](_0x37d4a6,_0x8119('0xed'));};AGIVertices[_0x8119('0x11')][_0x8119('0xee')]=function(_0x477391){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xef'),_0x477391[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x477391['ndauth_url'])){return this['channel']['noop']('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x477391[_0x8119('0xf0')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xf1'));}if(!this[_0x8119('0x81')](_0x477391[_0x8119('0xf2')])){return this['channel'][_0x8119('0xa3')](_0x8119('0xf3'));}if(!this[_0x8119('0x81')](_0x477391[_0x8119('0xf4')])){return this[_0x8119('0x10')]['noop']('no\x20text\x20configured');}this[_0x8119('0x10')][_0x8119('0xde')]=!![];this['createSquareDetailsReport'](_0x477391);this[_0x8119('0x3d')](_0x477391[_0x8119('0x58')],'in','','');this['channel']['noop'](util[_0x8119('0x28')](_0x8119('0xf5'),_0x477391[_0x8119('0x58')]));var _0x1a755a=this['sestekNDA'][_0x8119('0x6a')](this,_0x477391);if(_0x1a755a){for(var _0x561db0 in _0x1a755a){if(_0x1a755a[_0x8119('0x90')](_0x561db0)){this[_0x8119('0x10')][_0x8119('0x99')](util['format'](_0x8119('0xf6'),_0x561db0[_0x8119('0x65')]()),_0x1a755a[_0x561db0]);}}this[_0x8119('0x3d')](_0x1a755a[_0x8119('0xe0')],'out','sesteknda','');if(_0x1a755a[_0x8119('0xf7')]){this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0xf8'),_0x1a755a[_0x8119('0xf7')]));var _0x31b4b8=this[_0x8119('0x10')][_0x8119('0xf9')](_0x1a755a[_0x8119('0xf7')]);try{fs[_0x8119('0xfa')](_0x1a755a[_0x8119('0xf7')]+_0x8119('0xfb'));}catch(_0x5ec5bb){logger[_0x8119('0x2b')](_0x5ec5bb);}return _0x31b4b8;}else{return this['channel'][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xfc'),_0x1a755a['speech']));}}return this['channel'][_0x8119('0x2b')](_0x477391,_0x8119('0xfd'));};AGIVertices[_0x8119('0x11')]['end']=function(_0x5dd207){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0xfe'),_0x5dd207['label']));return this[_0x8119('0x10')]['noop'](_0x8119('0xff'));};AGIVertices[_0x8119('0x11')][_0x8119('0x100')]=function(_0x4cd394){logger[_0x8119('0x2c')](util[_0x8119('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4cd394[_0x8119('0x34')]));var _0x41ba20='';if(_0x4cd394['trunk_id']){if(!this[_0x8119('0x81')](_0x4cd394['trunk_id'])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x4cd394,_0x8119('0x101'));}else{var _0xc598d0=parseInt(_0x4cd394[_0x8119('0x102')],0xa);if(isNaN(_0xc598d0)){_0x41ba20=_0x4cd394[_0x8119('0x102')];}else{_0x41ba20=this[_0x8119('0x1d')]['sync'](this,_0x4cd394[_0x8119('0x102')]);if(!_0x41ba20){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x4cd394,_0x8119('0x103'));}}}}else if(_0x4cd394[_0x8119('0x104')]){_0x41ba20=_0x4cd394['trunk_name'];}else{return this[_0x8119('0x10')][_0x8119('0x2b')](_0x4cd394,_0x8119('0x101'));}var _0x30020d=this[_0x8119('0x10')][_0x8119('0x53')](_0x8119('0xd9'),[util[_0x8119('0x28')](_0x8119('0x105'),_0x41ba20,_0x4cd394[_0x8119('0x44')]),_0x4cd394[_0x8119('0x61')],_0x4cd394['opts'],_0x4cd394['url']]);if(_0x30020d[_0x8119('0x9f')]===-0x1){return _0x30020d;}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xda'),'DIAL'));};AGIVertices[_0x8119('0x11')][_0x8119('0x106')]=function(_0x406ff1){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x107'),_0x406ff1[_0x8119('0x34')]));return this[_0x8119('0x10')]['noop']('finally');};AGIVertices['prototype']['getdigits']=function(_0xe78ca2){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x108'),_0xe78ca2['label']));if(_0xe78ca2[_0x8119('0xa1')]===0x0){return this['maxRetry'](_0xe78ca2);}_0xe78ca2[_0x8119('0xa1')]-=0x1;if(!this[_0x8119('0x81')](_0xe78ca2[_0x8119('0x109')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0xe78ca2,_0x8119('0x10a'));}var _0x51bc81=this[_0x8119('0x1f')][_0x8119('0x6a')](this,_0xe78ca2[_0x8119('0x109')]);if(!_0x51bc81){return this['channel']['error'](_0xe78ca2,_0x8119('0x10b'));}if(!this['isConfigured'](_0xe78ca2[_0x8119('0xce')])){return this[_0x8119('0x10')]['error'](_0x8119('0xcf'));}var _0x324cf0=this['channel'][_0x8119('0x10c')](_0x51bc81,_0xe78ca2[_0x8119('0x10d')],_0xe78ca2['maxdigit']);var _0x5426d4=_0x324cf0['result']?_0x324cf0[_0x8119('0x9f')]['toString']():'';logger[_0x8119('0x2c')]('test',JSON[_0x8119('0x6d')](_0x324cf0));if(_0x324cf0[_0x8119('0x9f')]===-0x1){this['createSquareDetailsReport'][_0x8119('0x6a')](this,_0xe78ca2,_0x5426d4);return _0x324cf0;}else if(_0x324cf0[_0x8119('0x9c')]===_0x8119('0x61')){_0x324cf0[_0x8119('0x9f')]=_0x5426d4[_0x8119('0x98')]>=parseInt(_0xe78ca2['mindigit'])?'x':'i';}else{_0x324cf0[_0x8119('0x9f')]=_0x5426d4['length']>=parseInt(_0xe78ca2[_0x8119('0x10e')])&&_0x5426d4[_0x8119('0x98')]<=parseInt(_0xe78ca2[_0x8119('0x10f')])?'x':'i';}var _0x49b675=this[_0x8119('0x12')][_0x8119('0x6a')](this,_0xe78ca2[_0x8119('0xce')]);if(!_0x49b675){return this['channel'][_0x8119('0x2b')](_0xe78ca2,_0x8119('0x110'));}this[_0x8119('0x10')][_0x8119('0x99')](_0x49b675,_0x5426d4);if(this['isConfigured'](_0xe78ca2[_0x8119('0x111')])){var _0x3989cb=parseInt(_0xe78ca2[_0x8119('0x111')],0xa);var _0x2571f9=rs[_0x8119('0x112')]({'charset':'*','length':_0x3989cb});var _0x1c278c=_0x5426d4[_0x8119('0x98')];if(_0x1c278c>0x0){if(_0x1c278c>_0x3989cb){this[_0x8119('0x32')][_0x8119('0x6a')](this,_0xe78ca2,_0xe78ca2['hiddendigitspos']===_0x8119('0x113')?_0x2571f9+_0x5426d4[_0x8119('0x114')](_0x3989cb):_0x5426d4['substr'](0x0,_0x1c278c-_0x3989cb)+_0x2571f9);}else{this[_0x8119('0x32')][_0x8119('0x6a')](this,_0xe78ca2,rs[_0x8119('0x112')]({'charset':'*','length':_0x1c278c}));}}else{this[_0x8119('0x32')][_0x8119('0x6a')](this,_0xe78ca2,'');}}else{this[_0x8119('0x32')]['sync'](this,_0xe78ca2,_0x5426d4);}return _0x324cf0;};AGIVertices['prototype'][_0x8119('0xf')]=function(_0x3a0b0a){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x115'),_0x3a0b0a[_0x8119('0x34')]));return this[_0x8119('0xe')](_0x3a0b0a);};AGIVertices[_0x8119('0x11')]['goal']=function(_0x11da0c){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x116'),_0x11da0c['label']));this[_0x8119('0x32')][_0x8119('0x6a')](this,_0x11da0c,_0x11da0c['goalname']);return this['channel'][_0x8119('0xa3')](util['format'](_0x8119('0x117'),_0x11da0c['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x5c15c8){logger[_0x8119('0x2c')](util['format'](_0x8119('0x118'),_0x5c15c8[_0x8119('0x34')]));if(!this['isConfigured'](_0x5c15c8[_0x8119('0x84')])||!this[_0x8119('0x81')](_0x5c15c8['aws_secret_access_key'])){return this[_0x8119('0x10')]['noop'](_0x8119('0x119'));}if(!this[_0x8119('0x81')](_0x5c15c8[_0x8119('0x58')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xa4'));}this[_0x8119('0x10')]['noop'](util['format'](_0x8119('0x11a'),_0x5c15c8[_0x8119('0x58')]));var _0x128b38=this['awsPolly']['sync'](this,_0x5c15c8);if(_0x128b38){this[_0x8119('0x10')]['noop'](util['format'](_0x8119('0x11b'),_0x128b38));var _0x48f4fa=this['channel'][_0x8119('0xf9')](_0x128b38);try{fs['unlink'](_0x128b38+_0x8119('0xfb'));}catch(_0x5851a8){logger[_0x8119('0x2b')](_0x5851a8);}return _0x48f4fa;}return this[_0x8119('0x10')][_0x8119('0x2b')](_0x5c15c8,_0x8119('0x11c'));};AGIVertices['prototype'][_0x8119('0x11d')]=function(_0x584aff){logger[_0x8119('0x2c')](util[_0x8119('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x584aff[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x584aff[_0x8119('0x84')])||!this[_0x8119('0x81')](_0x584aff[_0x8119('0x85')])){return this['channel'][_0x8119('0xa3')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8119('0x81')](_0x584aff[_0x8119('0x8b')])){return this[_0x8119('0x10')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x8119('0x81')](_0x584aff[_0x8119('0x58')])){return this[_0x8119('0x10')][_0x8119('0xa3')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x8119('0x32')](_0x584aff);this[_0x8119('0x3d')](_0x584aff['text'],'in','','');this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x11e'),_0x584aff[_0x8119('0x58')]));var _0x32e7a0=this[_0x8119('0x89')][_0x8119('0x6a')](this,_0x584aff);if(_0x32e7a0){for(var _0xb1dba2 in _0x32e7a0){if(_0x32e7a0[_0x8119('0x90')](_0xb1dba2)&&_[_0x8119('0x91')](_0x32e7a0[_0xb1dba2])){this[_0x8119('0x10')][_0x8119('0x99')](util[_0x8119('0x28')](_0x8119('0x11f'),_0xb1dba2[_0x8119('0x65')]()),_0x32e7a0[_0xb1dba2]);}}if(_[_0x8119('0x40')](_0x32e7a0['message'])){return this['channel'][_0x8119('0xa3')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x32e7a0[_0x8119('0x72')],_0x8119('0xe1'),'amazonlex','');return this[_0x8119('0x10')][_0x8119('0xa3')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x32e7a0[_0x8119('0x72')]));}}return this[_0x8119('0x10')]['error'](_0x584aff,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x8119('0x11')]['googleasr']=function(_0x29b36a){logger[_0x8119('0x2c')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x29b36a['label'],_0x29b36a[_0x8119('0x61')]));if(!this[_0x8119('0x81')](_0x29b36a[_0x8119('0x7b')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xdd'));}var _0x63db00='wav';var _0x4316db=util['format'](_0x8119('0x120'),FILES_PATH,rs[_0x8119('0x112')](0x4));var _0x5cb678=util['format'](_0x8119('0x97'),_0x4316db,_0x63db00);var _0x2e7bc9=!![];if(_0x29b36a[_0x8119('0x121')]===_0x8119('0x122')){_0x2e7bc9=![];}var _0x20e9ea=this[_0x8119('0x10')][_0x8119('0x123')](_0x4316db,_0x63db00,_0x29b36a[_0x8119('0x124')],_0x29b36a[_0x8119('0x61')],undefined,_0x2e7bc9);if(_0x20e9ea[_0x8119('0x9f')]!==-0x1){this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')]('google\x20%s\x20file\x20created',_0x5cb678));var _0x297e8e=this['googleASR'][_0x8119('0x6a')](this,_0x29b36a,_0x5cb678);if(_0x297e8e){for(var _0x27f10d in _0x297e8e){if(_0x297e8e[_0x8119('0x90')](_0x27f10d)){this[_0x8119('0x10')][_0x8119('0x99')](util['format']('GOOGLE_ASR_%s',_0x27f10d[_0x8119('0x65')]()),_0x297e8e[_0x27f10d]);}}return this['channel']['noop'](util[_0x8119('0x28')](_0x8119('0x125'),JSON['stringify'](_0x297e8e)));}}return _0x20e9ea;};AGIVertices[_0x8119('0x11')]['tildeasr']=function(_0x58c00a){logger['info'](util[_0x8119('0x28')](_0x8119('0x126'),_0x58c00a[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x58c00a[_0x8119('0x127')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x128'));}if(!this[_0x8119('0x81')](_0x58c00a[_0x8119('0x129')])){return this[_0x8119('0x10')]['noop'](_0x8119('0x12a'));}var _0x29d3c8=_0x8119('0x12b');var _0x50ede3=util['format'](_0x8119('0x120'),FILES_PATH,rs[_0x8119('0x112')](0x4));var _0x1eefba=util[_0x8119('0x28')](_0x8119('0x97'),_0x50ede3,_0x29d3c8);var _0x32cc1c=!![];if(_0x58c00a['beep']===_0x8119('0x122')){_0x32cc1c=![];}var _0x5a6e16=this[_0x8119('0x10')]['recordFile'](_0x50ede3,_0x29d3c8,_0x58c00a['intKey'],_0x58c00a[_0x8119('0x61')],undefined,_0x32cc1c);if(_0x5a6e16[_0x8119('0x9f')]!==-0x1){this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')]('tilde\x20%s\x20file\x20created',_0x1eefba));var _0x1e165a=this[_0x8119('0x8d')][_0x8119('0x6a')](this,_0x58c00a,_0x1eefba);if(_0x1e165a){for(var _0x2e2997 in _0x1e165a){if(_0x1e165a[_0x8119('0x90')](_0x2e2997)){this[_0x8119('0x10')][_0x8119('0x99')](util['format']('TILDE_ASR_%s',_0x2e2997['toUpperCase']()),_0x1e165a[_0x2e2997]);}}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x12c'),JSON[_0x8119('0x6d')](_0x1e165a)));}}return _0x5a6e16;};AGIVertices[_0x8119('0x11')][_0x8119('0x12d')]=function(_0x2047fa){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x12e'),_0x2047fa[_0x8119('0x34')]));return this[_0x8119('0x10')][_0x8119('0x12f')](_0x2047fa['context'],_0x2047fa['extension'],_0x2047fa['priority']);};AGIVertices[_0x8119('0x11')][_0x8119('0x130')]=function(_0x190362){logger[_0x8119('0x2c')](util[_0x8119('0x28')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x190362['label']));if(!this[_0x8119('0x81')](_0x190362[_0x8119('0x131')])){return this[_0x8119('0x10')]['error'](_0x190362,_0x8119('0x132'));}try{var _0x24a3ac=eval(_0x190362[_0x8119('0x131')])?'true':_0x8119('0x133');this['channel']['noop'](util[_0x8119('0x28')]('EVAL\x20CONDITION\x20%s\x20%s',_0x190362['condition'],_0x24a3ac));return{'code':0xc8,'result':_0x24a3ac};}catch(_0x25ce0b){return{'code':0xc8,'result':_0x8119('0x133')};}};AGIVertices[_0x8119('0x11')][_0x8119('0x134')]=function(_0x34e0b5){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x135'),_0x34e0b5[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x34e0b5['interval_id'])){return this['channel'][_0x8119('0x2b')](_0x34e0b5,_0x8119('0x136'));}var _0x1ca702=this[_0x8119('0x24')][_0x8119('0x6a')](this,_0x34e0b5[_0x8119('0x137')]);if(!_0x1ca702){return this[_0x8119('0x10')]['error'](_0x34e0b5,'no\x20intervals\x20found');}for(var _0xbf6a1a=0x0;_0xbf6a1a<_0x1ca702[_0x8119('0x98')];_0xbf6a1a+=0x1){var _0x837860=this['channel'][_0x8119('0x12')](util[_0x8119('0x28')](_0x8119('0x138'),_0x1ca702[_0xbf6a1a]));if(_0x837860[_0x8119('0x9f')]===-0x1){return _0x837860;}logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x139'),_0x1ca702[_0xbf6a1a],_0x837860[_0x8119('0x9c')]));if(_0x837860[_0x8119('0x9c')]===_0x8119('0x13a')){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x139'),_0x1ca702[_0xbf6a1a],_0x8119('0x13a')));this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')](_0x8119('0x139'),_0x1ca702[_0xbf6a1a],_0x8119('0x13a')));return{'code':0xc8,'result':_0x8119('0x13a')};}else{logger[_0x8119('0x2c')](util[_0x8119('0x28')]('IFTIME\x20%s\x20%s',_0x1ca702[_0xbf6a1a],_0x8119('0x133')));this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')](_0x8119('0x139'),_0x1ca702[_0xbf6a1a],_0x8119('0x133')));}}return{'code':0xc8,'result':_0x8119('0x133')};};AGIVertices[_0x8119('0x11')][_0x8119('0x13b')]=function(_0x5ab67b){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x13c'),_0x5ab67b[_0x8119('0x34')]));return this[_0x8119('0x10')][_0x8119('0x13b')]();};AGIVertices['prototype'][_0x8119('0x13d')]=function(_0x20327b){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x20327b[_0x8119('0x34')]));if(!this['isConfigured'](_0x20327b[_0x8119('0x7b')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xdd'));}var _0xeadd24=_0x8119('0x12b');var _0x56a69f=util['format'](_0x8119('0x120'),FILES_PATH,rs['generate'](0x4));var _0x3b40c4=util['format'](_0x8119('0x97'),_0x56a69f,_0xeadd24);var _0x5cfc34=!![];if(_0x20327b[_0x8119('0x121')]===_0x8119('0x122')){_0x5cfc34=![];}var _0x59b2cb=this[_0x8119('0x10')][_0x8119('0x123')](_0x56a69f,_0xeadd24,_0x20327b[_0x8119('0x124')],_0x20327b[_0x8119('0x61')],undefined,_0x5cfc34);if(_0x59b2cb['result']!==-0x1){this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x13e'),_0x3b40c4));var _0x433a2a=this[_0x8119('0x7f')]['sync'](this,_0x20327b,_0x3b40c4);if(_0x433a2a){for(var _0x52c588 in _0x433a2a){if(_0x433a2a['hasOwnProperty'](_0x52c588)){this[_0x8119('0x10')][_0x8119('0x99')](util[_0x8119('0x28')](_0x8119('0x13f'),_0x52c588[_0x8119('0x65')]()),_0x433a2a[_0x52c588]);}}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x140'),JSON[_0x8119('0x6d')](_0x433a2a)));}}return _0x59b2cb;};AGIVertices[_0x8119('0x11')][_0x8119('0x141')]=function(_0x11e233){logger[_0x8119('0x2c')](util['format'](_0x8119('0x142'),_0x11e233['label']));if(!this[_0x8119('0x81')](_0x11e233[_0x8119('0x7b')])){return this[_0x8119('0x10')]['noop'](_0x8119('0xdd'));}if(!this['isConfigured'](_0x11e233['text'])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xa4'));}this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')](_0x8119('0x143'),_0x11e233['text']));var _0x4eb36c=this[_0x8119('0x144')][_0x8119('0x6a')](this,_0x11e233);if(_0x4eb36c){this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')]('ispeech\x20%s\x20file\x20created',_0x4eb36c));var _0x464c13=this[_0x8119('0x10')][_0x8119('0xf9')](_0x4eb36c,_0x11e233[_0x8119('0x124')]);try{fs[_0x8119('0xfa')](_0x4eb36c+'.wav');}catch(_0x15af9b){logger[_0x8119('0x2b')](_0x15af9b);}return _0x464c13;}return this[_0x8119('0x10')][_0x8119('0x2b')](_0x11e233,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8119('0x11')]['login']=function(_0x37516a){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x145'),_0x37516a['label']));if(!this[_0x8119('0x81')](_0x37516a[_0x8119('0x146')])){return this[_0x8119('0x10')]['error'](_0x37516a,'no\x20find\x20by\x20configured');}logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x147'),this[_0x8119('0x10')][_0x8119('0x37')],_0x37516a[_0x8119('0x146')]));var _0x4a0f8d=this[_0x8119('0x50')][_0x8119('0x6a')](this,_0x37516a[_0x8119('0x146')]);if(_0x4a0f8d){logger[_0x8119('0x2c')](util[_0x8119('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8119('0x10')][_0x8119('0x37')],_0x37516a['findBy']));this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x8119('0x37')],_0x37516a[_0x8119('0x146')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8119('0x2c')](util[_0x8119('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8119('0x10')][_0x8119('0x37')],_0x37516a[_0x8119('0x146')]));this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')](_0x8119('0x148'),this[_0x8119('0x10')][_0x8119('0x37')],_0x37516a[_0x8119('0x146')]));return{'code':0xc8,'result':_0x8119('0x149')};}};AGIVertices[_0x8119('0x11')][_0x8119('0x14a')]=function(_0x505330){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x14b'),_0x505330[_0x8119('0x34')]));if(!this['isConfigured'](_0x505330[_0x8119('0x146')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x505330,_0x8119('0x14c'));}logger['info'](util[_0x8119('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x8119('0x37')],_0x505330[_0x8119('0x146')]));var _0x2666aa=this[_0x8119('0x4f')][_0x8119('0x6a')](this,_0x505330[_0x8119('0x146')]);if(_0x2666aa){logger['info'](util[_0x8119('0x28')](_0x8119('0x14d'),this['channel'][_0x8119('0x37')],_0x505330[_0x8119('0x146')]));this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')](_0x8119('0x14d'),this[_0x8119('0x10')][_0x8119('0x37')],_0x505330[_0x8119('0x146')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x148'),this['channel'][_0x8119('0x37')],_0x505330[_0x8119('0x146')]));this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8119('0x10')]['callerid'],_0x505330[_0x8119('0x146')]));return{'code':0xc8,'result':_0x8119('0x149')};}};AGIVertices[_0x8119('0x11')][_0x8119('0x14e')]=function(_0x54ff16){logger['info'](util['format'](_0x8119('0x14f'),_0x54ff16['label']));if(!this[_0x8119('0x81')](_0x54ff16[_0x8119('0x150')])){return this[_0x8119('0x10')]['error'](_0x54ff16,_0x8119('0x151'));}this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0x152'),_0x54ff16[_0x8119('0x150')]));var _0x1a47d=eval(_0x54ff16[_0x8119('0x150')]);if(!this[_0x8119('0x81')](_0x54ff16['variable_id'])){return this['channel']['noop'](_0x8119('0xcf'));}var _0x14dc68=this[_0x8119('0x12')]['sync'](this,_0x54ff16[_0x8119('0xce')]);if(!_0x14dc68){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x54ff16,_0x8119('0x110'));}if(_[_0x8119('0x95')](_0x1a47d)){var _0x5aca01=this;_0x1a47d[_0x8119('0xd1')](function(_0x1ee1ce,_0x42c9b6){_0x5aca01[_0x8119('0x10')]['setVariable'](util[_0x8119('0x28')](_0x8119('0x153'),_0x14dc68,_0x42c9b6),_0x1ee1ce);});return this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')](_0x8119('0x154'),_0x14dc68));}else{return this[_0x8119('0x10')]['setVariable'](_0x14dc68,_0x1a47d);}};AGIVertices[_0x8119('0x11')]['menu']=function(_0x3e754c){logger[_0x8119('0x2c')](util['format'](_0x8119('0x155'),_0x3e754c[_0x8119('0x34')]));if(_0x3e754c[_0x8119('0xa1')]===0x0){return this['maxRetry'](_0x3e754c);}_0x3e754c[_0x8119('0xa1')]-=0x1;if(!this['isConfigured'](_0x3e754c[_0x8119('0x109')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x3e754c,'no\x20file\x20audio\x20selected');}var _0x1ceca4=this[_0x8119('0x1f')][_0x8119('0x6a')](this,_0x3e754c[_0x8119('0x109')]);if(!_0x1ceca4){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x3e754c,_0x8119('0x10b'));}var _0x2e7116=this['channel']['getData'](_0x1ceca4,_0x3e754c['response'],_0x3e754c[_0x8119('0x156')]);var _0x530c6d=_0x2e7116[_0x8119('0x9f')];if(_0x2e7116[_0x8119('0x9f')]===-0x1){this[_0x8119('0x32')][_0x8119('0x6a')](this,_0x3e754c,'-1');return _0x2e7116;}else if(_0x2e7116[_0x8119('0x9c')]===_0x8119('0x61')){_0x2e7116[_0x8119('0x9f')]=_0x2e7116[_0x8119('0x9f')][_0x8119('0x98')]>0x0?_0x2e7116[_0x8119('0x9f')]:'t';}else if(_['isEmpty'](_0x2e7116[_0x8119('0x9f')])){_0x2e7116[_0x8119('0x9f')]='#';_0x530c6d='#';}if(!this['isConfigured'](_0x3e754c[_0x8119('0xce')])){this['channel']['noop'](_0x8119('0xcf'));}else{var _0xd7ba1f=this[_0x8119('0x12')][_0x8119('0x6a')](this,_0x3e754c[_0x8119('0xce')]);if(!_0xd7ba1f){return this[_0x8119('0x10')]['error'](_0x3e754c,_0x8119('0x110'));}this['channel'][_0x8119('0x99')](_0xd7ba1f,_0x530c6d);}this['createSquareDetailsReport'][_0x8119('0x6a')](this,_0x3e754c,_0x530c6d);return _0x2e7116;};AGIVertices[_0x8119('0x11')]['noop']=function(_0x57e7b8){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x157'),_0x57e7b8['label']));return this[_0x8119('0x10')][_0x8119('0xa3')](_0x57e7b8['output']||_0x57e7b8[_0x8119('0x34')]);};AGIVertices[_0x8119('0x11')][_0x8119('0x158')]=function(_0xff60ec){logger[_0x8119('0x2c')](util['format'](_0x8119('0x159'),_0xff60ec[_0x8119('0x34')]));if(!this['isConfigured'](_0xff60ec[_0x8119('0x146')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0xff60ec,_0x8119('0x14c'));}logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x147'),this[_0x8119('0x10')][_0x8119('0x37')],_0xff60ec[_0x8119('0x146')]));var _0x2f56cc=this['getPause']['sync'](this,_0xff60ec[_0x8119('0x15a')]);var _0x1653c1=this[_0x8119('0x4c')]['sync'](this,_0xff60ec[_0x8119('0x146')],_0x2f56cc);if(_0x1653c1){logger[_0x8119('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x8119('0x10')][_0x8119('0x37')],_0xff60ec[_0x8119('0x146')]));this['channel'][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x14d'),this[_0x8119('0x10')]['callerid'],_0xff60ec[_0x8119('0x146')]));return{'code':0xc8,'result':_0x8119('0x15b')};}else{logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x148'),this[_0x8119('0x10')][_0x8119('0x37')],_0xff60ec[_0x8119('0x146')]));this['channel']['noop'](util[_0x8119('0x28')](_0x8119('0x14d'),this[_0x8119('0x10')]['callerid'],_0xff60ec[_0x8119('0x146')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8119('0x11')][_0x8119('0x15c')]=function(_0x380ab1){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x15d'),_0x380ab1['label']));if(!this[_0x8119('0x81')](_0x380ab1[_0x8119('0x109')])){return this[_0x8119('0x10')]['error'](_0x380ab1,'no\x20file\x20audio\x20selected');}var _0x4d5cea=this['getSound'][_0x8119('0x6a')](this,_0x380ab1[_0x8119('0x109')]);if(!_0x4d5cea){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x380ab1,'no\x20file\x20audio\x20found');}var _0x36b177=this[_0x8119('0x10')][_0x8119('0x53')](_0x8119('0x15e'),[_0x4d5cea,_0x380ab1[_0x8119('0x15f')]]);if(_0x36b177[_0x8119('0x9f')]===-0x1){return _0x36b177;}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0xbc'),_0x8119('0x15e'),_0x4d5cea));};AGIVertices[_0x8119('0x11')][_0x8119('0x160')]=function(_0x4bf15f){logger['info'](util[_0x8119('0x28')](_0x8119('0x161'),_0x4bf15f[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x4bf15f[_0x8119('0x162')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x4bf15f,_0x8119('0x163'));}var _0x317072='';var _0x2bb404=parseInt(_0x4bf15f[_0x8119('0x162')],0xa);if(isNaN(_0x2bb404)){_0x317072=_0x4bf15f[_0x8119('0x162')];}else{_0x317072=this['getVoiceQueue'][_0x8119('0x6a')](this,_0x4bf15f['queue_id']);if(!_0x317072){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x4bf15f,_0x8119('0x164'));}}var _0x2fd1c5='';if(this[_0x8119('0x81')](_0x4bf15f[_0x8119('0x109')])){var _0xff9feb=this[_0x8119('0x1f')][_0x8119('0x6a')](this,_0x4bf15f[_0x8119('0x109')]);if(_0xff9feb){_0x2fd1c5=_0xff9feb;}}this[_0x8119('0x32')][_0x8119('0x6a')](this,_0x4bf15f,_0x317072);if(_0x4bf15f[_0x8119('0x15f')]['indexOf']('x')<0x0){_0x4bf15f[_0x8119('0x15f')]+='x';}if(_0x4bf15f[_0x8119('0x15f')]['indexOf']('X')<0x0){_0x4bf15f[_0x8119('0x15f')]+='X';}this[_0x8119('0x10')][_0x8119('0x99')](_0x8119('0x165'),_0x317072?_0x317072[_0x8119('0x166')]():'');var _0x2c9943=this['channel'][_0x8119('0x53')]('QUEUE',[_0x317072,_0x4bf15f[_0x8119('0x15f')],_0x4bf15f['url'],_0x2fd1c5,_0x4bf15f['timeout'],_0x4bf15f[_0x8119('0x7')],_0x4bf15f[_0x8119('0x167')],_0x4bf15f[_0x8119('0x168')],'',_0x4bf15f[_0x8119('0x169')]]);if(_0x2c9943[_0x8119('0x9f')]===-0x1){return _0x2c9943;}return this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0xbc'),_0x8119('0x16a'),_0x317072));};AGIVertices[_0x8119('0x11')][_0x8119('0x16b')]=function(_0x44c9f6){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x16c'),_0x44c9f6[_0x8119('0x34')]));var _0x244c3b=_0x44c9f6[_0x8119('0x16d')]||_0x8119('0x12b');var _0xe531e4=util['format'](_0x8119('0x16e'),this[_0x8119('0x10')][_0x8119('0x33')],rs[_0x8119('0x112')](0x5));var _0x646628=util[_0x8119('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0xe531e4,_0x244c3b);var _0x9e2ca7=util[_0x8119('0x28')](_0x8119('0x120'),FILES_PATH,_0xe531e4);this[_0x8119('0x36')][_0x8119('0x6a')](this,_0x44c9f6,_0xe531e4,_0x646628);this['channel']['setVariable'](_0x8119('0x16f'),_0xe531e4);logger[_0x8119('0x2c')](_0x8119('0x170'),_0x9e2ca7,_0x244c3b,_0x44c9f6[_0x8119('0x171')],_0x44c9f6[_0x8119('0x61')]);return this[_0x8119('0x10')][_0x8119('0x123')](_0x9e2ca7,_0x244c3b,_0x44c9f6[_0x8119('0x171')],_0x44c9f6['timeout'],undefined,!![]);};AGIVertices[_0x8119('0x11')]['restapi']=function(_0x9c5e91){logger['info'](util[_0x8119('0x28')](_0x8119('0x172'),_0x9c5e91['label']));if(!this[_0x8119('0x81')](_0x9c5e91[_0x8119('0x5e')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x173'));}var _0x47c76c=this['restAPI'][_0x8119('0x6a')](this,_0x9c5e91);logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x174'),util['inspect'](_0x47c76c,{'showHidden':![],'depth':null})));if(!this[_0x8119('0x81')](_0x9c5e91[_0x8119('0xce')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x175'));}var _0x434ca3=this['getVariable'][_0x8119('0x6a')](this,_0x9c5e91[_0x8119('0xce')]);if(!_0x434ca3){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x9c5e91,_0x8119('0x110'));}this[_0x8119('0x10')]['setVariable'](util[_0x8119('0x28')](_0x8119('0x176'),_0x434ca3),_0x47c76c[_0x8119('0x70')]?_0x47c76c['statusCode']:_0x8119('0x177'));this[_0x8119('0x10')][_0x8119('0x99')](util[_0x8119('0x28')]('%s_STATUS_MESSAGE',_0x434ca3),_0x47c76c[_0x8119('0x71')]?_0x47c76c[_0x8119('0x71')]:'OK');if(_0x47c76c[_0x8119('0x6e')]){try{this[_0x8119('0x96')](_0x47c76c[_0x8119('0x6e')],_0x434ca3);}catch(_0xba638b){logger[_0x8119('0x2b')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x434ca3));}}return this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0xd3'),_0x434ca3));};AGIVertices[_0x8119('0x11')]['saydigits']=function(_0x499db6){logger[_0x8119('0x2c')](util['format'](_0x8119('0x178'),_0x499db6[_0x8119('0x34')]));return this[_0x8119('0x10')][_0x8119('0x179')](_0x499db6[_0x8119('0x17a')][_0x8119('0x55')](/\s+/g,''),_0x499db6['escape_digits']);};AGIVertices[_0x8119('0x11')][_0x8119('0x17b')]=function(_0xab7264){logger['info'](util[_0x8119('0x28')](_0x8119('0x17c'),_0xab7264[_0x8119('0x34')]));return this[_0x8119('0x10')][_0x8119('0x17d')](_0xab7264[_0x8119('0x60')][_0x8119('0x55')](/\s+/g,''),_0xab7264[_0x8119('0x171')]);};AGIVertices['prototype'][_0x8119('0x17e')]=function(_0x3d19e2){logger['info'](util[_0x8119('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x3d19e2['label']));return this[_0x8119('0x10')]['sayPhonetic'](_0x3d19e2['text'],_0x3d19e2['escape_digits']);};AGIVertices[_0x8119('0x11')][_0x8119('0x17f')]=function(_0x214c59){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x180'),_0x214c59[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x214c59[_0x8119('0x181')])){return this['channel'][_0x8119('0xa3')](_0x8119('0x182'));}var _0x2fbf80=this['getMailAccount']['sync'](this,_0x214c59[_0x8119('0x181')]);if(!_0x2fbf80||!_0x2fbf80['Smtp']){return this[_0x8119('0x10')]['error'](_0x214c59,_0x8119('0x183'));}var _0xbcd29e={'from':util[_0x8119('0x28')]('\x22%s\x22\x20<%s>',_0x2fbf80[_0x8119('0x18')],_0x2fbf80[_0x8119('0x184')]||_0x2fbf80['Smtp'][_0x8119('0x185')]),'to':_0x214c59['to']||'','cc':_0x214c59['cc']||'','bcc':_0x214c59[_0x8119('0x186')]||'','subject':_0x214c59[_0x8119('0x187')],'html':_0x214c59[_0x8119('0x58')],'text':_0x214c59[_0x8119('0x58')]};var _0x28e5c3={'tls':{'rejectUnauthorized':![]}};if(_0x2fbf80[_0x8119('0x188')][_0x8119('0x189')]){_0x28e5c3[_0x8119('0x189')]=_0x2fbf80[_0x8119('0x188')]['service'];}else{_0x28e5c3[_0x8119('0x18a')]=_0x2fbf80[_0x8119('0x188')][_0x8119('0x18a')];_0x28e5c3[_0x8119('0x18b')]=_0x2fbf80[_0x8119('0x188')]['port'];_0x28e5c3[_0x8119('0x18c')]=_0x2fbf80[_0x8119('0x188')][_0x8119('0x18c')];}if(_0x2fbf80[_0x8119('0x188')][_0x8119('0x18d')]){_0x28e5c3[_0x8119('0x18e')]={'user':_0x2fbf80[_0x8119('0x188')][_0x8119('0x185')],'pass':_0x2fbf80[_0x8119('0x188')]['pass']};}if(this['isConfigured'](_0x214c59[_0x8119('0x18f')])){}logger['debug'](_0x8119('0x190'),JSON[_0x8119('0x6d')](_0xbcd29e));this[_0x8119('0x32')][_0x8119('0x6a')](this,_0x214c59,_0x214c59[_0x8119('0x181')]);this['channel'][_0x8119('0xa3')](util['format'](_0x8119('0x191'),_0x2fbf80['name']));this[_0x8119('0x22')][_0x8119('0x6a')](this,_0x28e5c3,_0xbcd29e);return this[_0x8119('0x10')]['noop'](_0x8119('0x192'));};AGIVertices['prototype'][_0x8119('0x193')]=function(_0x1c415b){logger['info'](util[_0x8119('0x28')](_0x8119('0x194'),_0x1c415b[_0x8119('0x34')]));return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x195'));};AGIVertices[_0x8119('0x11')][_0x8119('0x196')]=function(_0x325031){logger[_0x8119('0x2c')](util['format'](_0x8119('0x197'),_0x325031['label']));if(!this[_0x8119('0x81')](_0x325031[_0x8119('0x198')])){return this['channel']['noop'](_0x8119('0x199'));}var _0x37087e=this[_0x8119('0x19a')]['sync'](this,_0x325031[_0x8119('0x198')]);if(!_0x37087e){return this['channel'][_0x8119('0x2b')](_0x325031,_0x8119('0x19b'));}var _0x25e06f={'body':_0x325031[_0x8119('0x19c')],'phone':_0x325031['to']||'','SmsAccountId':_0x37087e['id']};logger['debug'](_0x8119('0x19d'),JSON[_0x8119('0x6d')](_0x25e06f));this['createSquareDetailsReport']['sync'](this,_0x325031,_0x325031[_0x8119('0x198')]);this[_0x8119('0x10')]['noop'](util[_0x8119('0x28')](_0x8119('0x19e'),_0x37087e[_0x8119('0x18')]));this['createSmsMessage'][_0x8119('0x6a')](this,_0x25e06f);return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x19f'));};AGIVertices[_0x8119('0x11')][_0x8119('0x1a0')]=function(_0xdd7856){logger[_0x8119('0x2c')](util[_0x8119('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0xdd7856[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0xdd7856[_0x8119('0xce')])){return this[_0x8119('0x10')]['error'](_0xdd7856,_0x8119('0x1a1'));}var _0x21635d=this[_0x8119('0x12')][_0x8119('0x6a')](this,_0xdd7856['variable_id']);if(!_0x21635d){return this[_0x8119('0x10')]['error'](_0xdd7856,_0x8119('0x110'));}return this[_0x8119('0x10')][_0x8119('0x99')](_0x21635d,_0xdd7856['variable_value']);};AGIVertices[_0x8119('0x11')][_0x8119('0x1a2')]=function(_0x2a3829){logger['info'](util['format'](_0x8119('0x1a3'),_0x2a3829[_0x8119('0x34')]));this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x1a4'));if(_0x2a3829['answer']===_0x8119('0x1a5')){this[_0x8119('0x10')][_0x8119('0xa3')]('Answer');return this['channel'][_0x8119('0xb2')]();}return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x1a6'));};AGIVertices['prototype'][_0x8119('0x1a7')]=function(_0x1734d4){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x1a8'),_0x1734d4[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0x1734d4[_0x8119('0x1a9')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x1734d4,'no\x20subproject\x20selected');}var _0x1bdb29=this[_0x8119('0x1aa')][_0x8119('0x6a')](this,_0x1734d4[_0x8119('0x1a9')]);if(!this['isConfigured'](_0x1bdb29)){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x1734d4,util[_0x8119('0x28')](_0x8119('0x1ab'),_0x1734d4[_0x8119('0x1a9')]));}if(_0x1bdb29===this[_0x8119('0x10')]['arg_1']){return this[_0x8119('0x10')]['error'](_0x1734d4,_0x8119('0x1ac'));}this[_0x8119('0x32')][_0x8119('0x6a')](this,_0x1734d4,_0x1bdb29);var _0x32b0bd=this[_0x8119('0x10')]['exec'](_0x8119('0x1ad'),util[_0x8119('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x8119('0x7')][_0x8119('0x18a')]||_0x8119('0x1ae'),_0x1bdb29,this[_0x8119('0x10')]['arg_1']));if(_0x32b0bd[_0x8119('0x9f')]===-0x1){return _0x32b0bd;}return this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0xbc'),_0x8119('0x1ad'),_0x1bdb29));};AGIVertices[_0x8119('0x11')]['system']=function(_0xd31b6e){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x1af'),_0xd31b6e[_0x8119('0x34')]));var _0x2f8f8c=this['shellCommand'][_0x8119('0x6a')](this,_0xd31b6e[_0x8119('0xb0')]);this['createSquareDetailsReport']['sync'](this,_0xd31b6e,_0xd31b6e[_0x8119('0xb0')]);if(this[_0x8119('0x81')](_0xd31b6e['variable_id'])){var _0x2ee1cd=this['getVariable'][_0x8119('0x6a')](this,_0xd31b6e['variable_id']);if(_0x2ee1cd){this[_0x8119('0x10')][_0x8119('0x99')](_0x2ee1cd,_0x2f8f8c);return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x1b0'),_0xd31b6e[_0x8119('0xb0')],_0x2ee1cd));}}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x1b1'),_0xd31b6e[_0x8119('0xb0')]));};AGIVertices[_0x8119('0x11')][_0x8119('0x1b2')]=function(_0x7f8c48){logger['info'](util[_0x8119('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x7f8c48[_0x8119('0x34')]));_0x7f8c48['text']=_0x7f8c48[_0x8119('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8119('0x81')](_0x7f8c48['apiKey'])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0x1b3'));}if(!this[_0x8119('0x81')](_0x7f8c48[_0x8119('0x58')])){return this[_0x8119('0x10')]['noop'](_0x8119('0xa4'));}this['channel']['noop'](util[_0x8119('0x28')](_0x8119('0x1b4'),_0x7f8c48[_0x8119('0x58')]));var _0xd739af=this[_0x8119('0x56')][_0x8119('0x6a')](this,_0x7f8c48);if(_0xd739af){this['channel'][_0x8119('0xa3')](util['format'](_0x8119('0x1b5'),_0xd739af));var _0x364d11=this[_0x8119('0x10')]['streamFile'](_0xd739af);try{fs[_0x8119('0xfa')](_0xd739af+'.wav');}catch(_0x5ec387){logger[_0x8119('0x2b')](_0x5ec387);}return _0x364d11;}return this['channel'][_0x8119('0x2b')](_0x7f8c48,_0x8119('0x1b6'));};AGIVertices[_0x8119('0x11')][_0x8119('0x1b7')]=function(_0x4b9840){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x1b8'),_0x4b9840['label']));_0x4b9840[_0x8119('0x58')]=_0x4b9840[_0x8119('0x58')][_0x8119('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8119('0x81')](_0x4b9840[_0x8119('0x58')])){return this[_0x8119('0x10')][_0x8119('0xa3')](_0x8119('0xa4'));}this[_0x8119('0x10')][_0x8119('0xa3')](util['format'](_0x8119('0x1b9'),_0x4b9840['text']));var _0x2cd63a=this['googleTTS']['sync'](this,_0x4b9840);if(_0x2cd63a){this['channel'][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x1ba'),_0x2cd63a));var _0x346723=this[_0x8119('0x10')][_0x8119('0xf9')](_0x2cd63a);try{fs['unlink'](_0x2cd63a+_0x8119('0xfb'));}catch(_0x307d84){logger[_0x8119('0x2b')](_0x307d84);}return _0x346723;}return this[_0x8119('0x10')]['error'](_0x4b9840,_0x8119('0x1bb'));};AGIVertices[_0x8119('0x11')][_0x8119('0x1bc')]=function(_0x55c4dd){logger[_0x8119('0x2c')](util[_0x8119('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x55c4dd[_0x8119('0x34')]));if(!this['isConfigured'](_0x55c4dd[_0x8119('0x146')])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0x55c4dd,_0x8119('0x14c'));}logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x147'),this[_0x8119('0x10')][_0x8119('0x37')],_0x55c4dd[_0x8119('0x146')]));var _0x5756b3=this[_0x8119('0x4e')]['sync'](this,_0x55c4dd[_0x8119('0x146')]);if(_0x5756b3){logger['info'](util[_0x8119('0x28')](_0x8119('0x14d'),this['channel'][_0x8119('0x37')],_0x55c4dd[_0x8119('0x146')]));this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')](_0x8119('0x14d'),this[_0x8119('0x10')][_0x8119('0x37')],_0x55c4dd[_0x8119('0x146')]));return{'code':0xc8,'result':_0x8119('0x15b')};}else{logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x148'),this[_0x8119('0x10')][_0x8119('0x37')],_0x55c4dd[_0x8119('0x146')]));this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8119('0x10')][_0x8119('0x37')],_0x55c4dd[_0x8119('0x146')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8119('0x11')][_0x8119('0x1bd')]=function(_0x3bade2){logger[_0x8119('0x2c')](util[_0x8119('0x28')](_0x8119('0x1be'),_0x3bade2[_0x8119('0x34')]));var _0x3ec823=this[_0x8119('0x10')]['exec'](_0x8119('0x1bf'),[_0x3bade2[_0x8119('0x1c0')],_0x3bade2[_0x8119('0x74')]]);if(_0x3ec823[_0x8119('0x9f')]===-0x1){return _0x3ec823;}return this[_0x8119('0x10')][_0x8119('0xa3')](util[_0x8119('0x28')]('Executed\x20command\x20%s\x20%s',_0x8119('0x1bf'),_0x3bade2['mailbox']));};AGIVertices[_0x8119('0x11')][_0x8119('0x1c1')]=function(_0xdeb976){logger['info'](util[_0x8119('0x28')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0xdeb976[_0x8119('0x34')]));if(!this[_0x8119('0x81')](_0xdeb976['variable_id'])){return this[_0x8119('0x10')][_0x8119('0x2b')](_0xdeb976,_0x8119('0x1a1'));}var _0x17345d=this['getVariable']['sync'](this,_0xdeb976['variable_id']);if(!_0x17345d){return this['channel'][_0x8119('0x2b')](_0xdeb976,_0x8119('0x110'));}var _0x1a055d=this[_0x8119('0x10')][_0x8119('0x12')](_0x17345d);return{'code':0xc8,'result':_0x1a055d[_0x8119('0x9c')]?_0x1a055d[_0x8119('0x9c')]:'-'};};String[_0x8119('0x11')][_0x8119('0x9b')]=function(_0x5555d8,_0x4ebb7b){return this[_0x8119('0x9a')](_0x5555d8)[_0x8119('0x1c2')](_0x4ebb7b);};module[_0x8119('0x1c3')]=AGIVertices; \ No newline at end of file +var _0x5835=['maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','result','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','googleasr','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20found','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','secure','authentication','auth','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','.wav','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','path','shelljs','odbc','mustache','../../config/logger','../../config/environment','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','getVariableById','then','getVoiceQueue','rpc','name','catch','getSquareProject','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','dnid','createSquareMessage','createCmContact','isEmpty','callback_','random','isNil','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','saveRestApiResult','isPlainObject','%s.%s','isArray','length','setVariable','split','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s'];(function(_0x40834f,_0x1dcae6){var _0x82a2b7=function(_0x757a69){while(--_0x757a69){_0x40834f['push'](_0x40834f['shift']());}};_0x82a2b7(++_0x1dcae6);}(_0x5835,0x123));var _0x5583=function(_0x5e560a,_0x3cbf18){_0x5e560a=_0x5e560a-0x0;var _0x34ba9e=_0x5835[_0x5e560a];return _0x34ba9e;};'use strict';var fs=require('fs');var path=require(_0x5583('0x0'));var util=require('util');var _=require('lodash');var sh=require(_0x5583('0x1'));var odbc=require(_0x5583('0x2'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x5583('0x3'));var rp=require('request-promise');var logger=require(_0x5583('0x4'))('agi');var config=require(_0x5583('0x5'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x5583('0x6'),_0x5583('0x7')];var verticesWithRetry=[_0x5583('0x8'),_0x5583('0x9'),_0x5583('0xa')];var AGIVertices=function(_0x35cd74,_0x42a1f7,_0x370f74){this[_0x5583('0xb')]=_0x35cd74;this['rpc']=_0x42a1f7;this['mailRpc']=_0x370f74;};AGIVertices[_0x5583('0xc')][_0x5583('0xd')]=function(_0x102820,_0x4bf2e9){this['rpc'][_0x5583('0xe')](_0x102820)[_0x5583('0xf')](function(_0xcb9ae5){_0x4bf2e9(null,_0xcb9ae5?_0xcb9ae5['name']:![]);})['catch'](function(_0x251606){_0x4bf2e9(_0x251606);});};AGIVertices[_0x5583('0xc')][_0x5583('0x10')]=function(_0x33b251,_0x22fbe6){this[_0x5583('0x11')]['getVoiceQueueById'](_0x33b251)[_0x5583('0xf')](function(_0xbe0d02){_0x22fbe6(null,_0xbe0d02?_0xbe0d02[_0x5583('0x12')]:![]);})[_0x5583('0x13')](function(_0x401c67){_0x22fbe6(_0x401c67);});};AGIVertices['prototype'][_0x5583('0x14')]=function(_0x2be6ea,_0x21f55f){this[_0x5583('0x11')]['getSquareProjectById'](_0x2be6ea)[_0x5583('0xf')](function(_0x4be517){_0x21f55f(null,_0x4be517?_0x4be517['name']:![]);})['catch'](function(_0x183883){_0x21f55f(_0x183883);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x57812c,_0x225127){this['rpc'][_0x5583('0x15')](_0x57812c)[_0x5583('0xf')](function(_0x288988){_0x225127(null,_0x288988?_0x288988[_0x5583('0x16')]:![]);})[_0x5583('0x13')](function(_0x53efa3){_0x225127(_0x53efa3);});};AGIVertices[_0x5583('0xc')][_0x5583('0x17')]=function(_0x5379a8,_0xb94c73){this[_0x5583('0x11')]['getUserById'](_0x5379a8)[_0x5583('0xf')](function(_0xa23519){_0xb94c73(null,_0xa23519?_0xa23519[_0x5583('0x12')]:![]);})[_0x5583('0x13')](function(_0x46c23e){_0xb94c73(_0x46c23e);});};AGIVertices[_0x5583('0xc')][_0x5583('0x18')]=function(_0x2a1035,_0x4870c9){this[_0x5583('0x11')][_0x5583('0x19')](_0x2a1035)['then'](function(_0xf69b10){_0x4870c9(null,_0xf69b10?_0xf69b10[_0x5583('0x12')]:![]);})[_0x5583('0x13')](function(_0x293353){_0x4870c9(_0x293353);});};AGIVertices[_0x5583('0xc')][_0x5583('0x1a')]=function(_0x557ced,_0xf2665c){var _0x3f1ea3=this;this[_0x5583('0x11')][_0x5583('0x1b')](_0x557ced)[_0x5583('0xf')](function(_0x215a1e){_0xf2665c(null,_0x215a1e?_0x3f1ea3[_0x5583('0x1c')](_0x215a1e['save_name']):![]);})[_0x5583('0x13')](function(_0x157653){_0xf2665c(_0x157653);});};AGIVertices[_0x5583('0xc')][_0x5583('0x1d')]=function(_0x19e02d,_0x48019b){this[_0x5583('0x11')][_0x5583('0x1e')](_0x19e02d)[_0x5583('0xf')](function(_0x22832d){_0x48019b(null,_0x22832d?_0x22832d:![]);})[_0x5583('0x13')](function(_0xe34d27){_0x48019b(_0xe34d27);});};AGIVertices[_0x5583('0xc')][_0x5583('0x1f')]=function(_0x4eb331,_0x240b9d,_0x569f02){this[_0x5583('0x20')][_0x5583('0x1f')](_0x4eb331,_0x240b9d)[_0x5583('0xf')](function(){_0x569f02(null);})[_0x5583('0x13')](function(_0xdb9456){_0x569f02(_0xdb9456);});};AGIVertices[_0x5583('0xc')][_0x5583('0x21')]=function(_0x197021,_0x31b91e){this['rpc']['getIntervalById'](_0x197021)[_0x5583('0xf')](function(_0x2e3812){if(_0x2e3812){if(_0x2e3812['IntervalId']){_0x31b91e(null,[_0x2e3812[_0x5583('0x22')]]);}else{_0x31b91e(null,_[_0x5583('0x23')](_0x2e3812[_0x5583('0x24')],_0x5583('0x22')));}}else{_0x31b91e(null,![]);}})[_0x5583('0x13')](function(_0x1ba14f){_0x31b91e(_0x1ba14f);});};AGIVertices['prototype'][_0x5583('0x1c')]=function(_0x1d117c){return util[_0x5583('0x25')](_0x5583('0x26'),FILES_PATH,_0x1d117c);};AGIVertices['prototype'][_0x5583('0x27')]=function(_0x38a490,_0x5e36f0,_0x321b10){odbc[_0x5583('0x28')](_0x38a490,function(_0x37fa57){if(_0x37fa57){logger[_0x5583('0x29')](_0x5583('0x2a'),_0x37fa57);_0x321b10(_0x37fa57);}else{logger[_0x5583('0x2b')](_0x5583('0x2c'));odbc['query'](_0x5e36f0,function(_0x36d796,_0x1f5c51){if(_0x36d796){logger['info'](_0x5583('0x2d'),_0x5e36f0);_0x321b10(_0x36d796);}else{logger[_0x5583('0x2b')](_0x5583('0x2e'),_0x5e36f0);odbc['close'](function(_0xcbd73a){if(_0xcbd73a){logger[_0x5583('0x29')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xcbd73a);}_0x321b10(null,_0x1f5c51);});}});}});};AGIVertices[_0x5583('0xc')][_0x5583('0x2f')]=function(_0xbe4692,_0x253a34){this[_0x5583('0x11')][_0x5583('0x30')](_0xbe4692)[_0x5583('0xf')](function(_0x520d50){_0x253a34(null,_0x520d50?_0x520d50:![]);})['catch'](function(_0x1335b8){_0x253a34(_0x1335b8);});};AGIVertices[_0x5583('0xc')]['createSmsMessage']=function(_0x5115f3,_0x1ddec2){this[_0x5583('0x11')][_0x5583('0x31')](_0x5115f3)[_0x5583('0xf')](function(_0x2d205b){_0x1ddec2(null,_0x2d205b);})['catch'](function(_0x4de74f){_0x1ddec2(_0x4de74f);});};AGIVertices[_0x5583('0xc')][_0x5583('0x32')]=function(_0x1b24de,_0x505afb,_0x2725fb){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x5583('0xb')][_0x5583('0x33')],'node':_0x1b24de[_0x5583('0x34')],'application':_0x1b24de[_0x5583('0x35')],'data':_0x505afb||null,'project_name':this[_0x5583('0xb')][_0x5583('0x36')],'callerid':this[_0x5583('0xb')][_0x5583('0x37')]})[_0x5583('0xf')](function(_0xe182cf){if(_0x2725fb){_0x2725fb(null,_0xe182cf);}})['catch'](function(_0x5b1f8a){if(_0x2725fb){_0x2725fb(_0x5b1f8a);}});};AGIVertices[_0x5583('0xc')][_0x5583('0x38')]=function(_0x19289b,_0x34af1d,_0xc05e24,_0x3c8c06){this[_0x5583('0x11')]['createSquareRecording']({'uniqueid':this[_0x5583('0xb')][_0x5583('0x33')],'callerid':this['channel'][_0x5583('0x37')],'calleridname':this[_0x5583('0xb')][_0x5583('0x39')],'context':this[_0x5583('0xb')][_0x5583('0x3a')],'extension':this[_0x5583('0xb')][_0x5583('0x3b')],'priority':this[_0x5583('0xb')]['priority'],'accountcode':this[_0x5583('0xb')]['accountcode'],'dnid':this[_0x5583('0xb')][_0x5583('0x3c')],'projectName':this[_0x5583('0xb')][_0x5583('0x36')],'saveName':_0x34af1d,'filename':_0x19289b['file']||_0x34af1d,'savePath':_0xc05e24})[_0x5583('0xf')](function(_0x2c9339){_0x3c8c06(null,_0x2c9339);})['catch'](function(_0x4f6041){_0x3c8c06(_0x4f6041);});};AGIVertices[_0x5583('0xc')]['createSquareMessage']=function(_0x249099,_0x53ee83,_0x17ec84,_0x1856b4,_0x5d0293){this[_0x5583('0x11')][_0x5583('0x3d')]({'uniqueid':this[_0x5583('0xb')][_0x5583('0x33')],'body':_0x249099,'direction':_0x53ee83,'providerName':_0x17ec84,'providerResponse':_0x1856b4})[_0x5583('0xf')](function(_0x4f1746){if(_0x5d0293){_0x5d0293(null,_0x4f1746);}})[_0x5583('0x13')](function(_0x34b846){if(_0x5d0293){_0x5d0293(_0x34b846);}});};AGIVertices['prototype'][_0x5583('0x3e')]=function(_0x1b1e28,_0x350607){this[_0x5583('0x11')]['createCmContact']({'firstName':_[_0x5583('0x3f')](_0x1b1e28[_0x5583('0x12')])||_['isNil'](_0x1b1e28[_0x5583('0x12')])?_0x5583('0x40')+Math[_0x5583('0x41')]():_0x1b1e28[_0x5583('0x12')],'lastName':_[_0x5583('0x3f')](_0x1b1e28['lastName'])||_[_0x5583('0x42')](_0x1b1e28[_0x5583('0x43')])?null:_0x1b1e28[_0x5583('0x43')],'phone':_0x1b1e28[_0x5583('0x44')],'ListId':_0x1b1e28[_0x5583('0x45')],'scheduledat':_0x1b1e28['scheduledAt'],'callbackUniqueid':this[_0x5583('0xb')][_0x5583('0x33')],'tags':_0x5583('0x46'),'description':_0x5583('0x47')+_0x1b1e28[_0x5583('0x48')][_0x5583('0x49')](),'priority':_0x1b1e28['callback_priority']})['then'](function(_0x168d1b){_0x350607(null,_0x168d1b);})[_0x5583('0x13')](function(_0x3f9cc7){_0x350607(_0x3f9cc7);});};AGIVertices[_0x5583('0xc')][_0x5583('0x4a')]=function(_0x36c681,_0x1e5cb0){this['rpc'][_0x5583('0x4b')](_0x36c681)[_0x5583('0xf')](function(_0x131bdf){_0x1e5cb0(null,_0x131bdf?_0x131bdf[_0x5583('0x12')]:![]);})[_0x5583('0x13')](function(_0x2f7e6b){_0x1e5cb0(_0x2f7e6b);});};AGIVertices[_0x5583('0xc')][_0x5583('0x4c')]=function(_0x19be10,_0x309961,_0x3c2b00){var _0x5c04de={'role':_0x5583('0x4d')};_0x5c04de[_0x19be10]=this[_0x5583('0xb')]['callerid'];this[_0x5583('0x11')]['agentPause'](_0x5c04de,_0x309961,this[_0x5583('0xb')][_0x5583('0x33')])[_0x5583('0xf')](function(_0x59640e){_0x3c2b00(null,_['isNil'](_0x59640e)?![]:!![]);})[_0x5583('0x13')](function(_0xe241ab){logger[_0x5583('0x29')](_0xe241ab);_0x3c2b00(null,![]);});};AGIVertices['prototype'][_0x5583('0x4e')]=function(_0x219008,_0x3fb6e5){var _0x5e448e={'role':_0x5583('0x4d')};_0x5e448e[_0x219008]=this[_0x5583('0xb')][_0x5583('0x37')];this[_0x5583('0x11')][_0x5583('0x4e')](_0x5e448e)[_0x5583('0xf')](function(_0x51172b){_0x3fb6e5(null,_[_0x5583('0x42')](_0x51172b)?![]:!![]);})['catch'](function(_0x5957ad){logger[_0x5583('0x29')](_0x5957ad);_0x3fb6e5(null,![]);});};AGIVertices[_0x5583('0xc')]['agentLogout']=function(_0x2a185d,_0x530611){var _0x244b64={'role':_0x5583('0x4d')};_0x244b64[_0x2a185d]=this[_0x5583('0xb')]['callerid'];this[_0x5583('0x11')][_0x5583('0x4f')](_0x244b64)[_0x5583('0xf')](function(_0xe9e83c){_0x530611(null,_[_0x5583('0x42')](_0xe9e83c)?![]:!![]);})[_0x5583('0x13')](function(_0x36166d){logger[_0x5583('0x29')](_0x36166d);_0x530611(null,![]);});};AGIVertices[_0x5583('0xc')]['agentLogin']=function(_0x3a2ec2,_0x42bb81){var _0x213be7={'role':_0x5583('0x4d')};_0x213be7[_0x3a2ec2]=this[_0x5583('0xb')][_0x5583('0x37')];var _0x569751=_0x3a2ec2!=_0x5583('0x50')?util['format']('%s/%s@from-sip/n','LOCAL',this['channel']['callerid']):undefined;this[_0x5583('0x11')][_0x5583('0x51')](_0x213be7,_0x569751)[_0x5583('0xf')](function(_0x2d06e1){_0x42bb81(null,_[_0x5583('0x42')](_0x2d06e1)?![]:!![]);})[_0x5583('0x13')](function(_0x575593){logger[_0x5583('0x29')](_0x575593);_0x42bb81(null,![]);});};AGIVertices[_0x5583('0xc')][_0x5583('0x52')]=function(_0x347db2,_0x36329a){sh['exec'](_[_0x5583('0x53')](_0x347db2),function(_0x2eeb99,_0x70beb8){var _0x1ff105=_0x70beb8[_0x5583('0x54')](/(\r\n|\n|\r)/gm,'');_0x36329a(null,_0x1ff105);});};AGIVertices[_0x5583('0xc')]['googleCloudTTS']=function(_0x12d104,_0x7eb3eb){scripts[_0x5583('0x55')](_0x12d104[_0x5583('0x56')],_0x12d104[_0x5583('0x57')]||_0x5583('0x58'),_0x12d104[_0x5583('0x58')],_0x12d104[_0x5583('0x59')]||_0x5583('0x5a'),_0x12d104[_0x5583('0x5b')]||_0x5583('0x5c'),_0x12d104[_0x5583('0x5d')]||_0x5583('0x5e'))[_0x5583('0xf')](function(_0x5b81b5){_0x7eb3eb(null,_0x5b81b5);})['catch'](function(_0x4458db){_0x7eb3eb(_0x4458db);});};AGIVertices[_0x5583('0xc')]['googleTTS']=function(_0x26a3fd,_0x51337e){scripts[_0x5583('0x5f')](_0x26a3fd[_0x5583('0x58')],_0x26a3fd[_0x5583('0x60')]||'en',0x1)[_0x5583('0xf')](function(_0x2e21b1){_0x51337e(null,_0x2e21b1);})[_0x5583('0x13')](function(_0x519b83){_0x51337e(_0x519b83);});};AGIVertices['prototype'][_0x5583('0x61')]=function(_0x2dce32,_0x32eed1){var _0x456c1b={'uri':_0x2dce32[_0x5583('0x62')],'method':_0x2dce32[_0x5583('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2dce32['timeout'])===_0x5583('0x64')&&parseInt(_0x2dce32[_0x5583('0x65')])>=0x1?parseInt(_0x2dce32[_0x5583('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x5583('0x66'),_0x5583('0x67')],_0x456c1b[_0x5583('0x63')]['toUpperCase']())){try{_0x456c1b[_0x5583('0x68')]=_0x2dce32[_0x5583('0x7')]?JSON[_0x5583('0x69')](_0x2dce32['rawBody']):{};}catch(_0xafb01e){logger[_0x5583('0x29')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0xafb01e);}}try{_0x456c1b['headers']=_0x2dce32[_0x5583('0x6')]?JSON[_0x5583('0x69')](_0x2dce32['rawHeaders']):{};}catch(_0x408d0d){logger['error'](_0x5583('0x6a'),_0x408d0d);}if(_0x2dce32[_0x5583('0x6b')]){try{var _0x5c804a=require(_0x2dce32[_0x5583('0x6b')])[_0x5583('0x6c')](this,_0x456c1b);_0x456c1b['uri']=Mustache[_0x5583('0x6d')](_0x2dce32['url'],_0x5c804a,{},['$$','$$']);if(_0x456c1b[_0x5583('0x6e')]){_0x456c1b[_0x5583('0x6e')]=JSON['parse'](Mustache[_0x5583('0x6d')](JSON['stringify'](_0x456c1b[_0x5583('0x6e')]),_0x5c804a,{},['$$','$$']));}if(_0x456c1b[_0x5583('0x68')]){_0x456c1b[_0x5583('0x68')]=JSON[_0x5583('0x69')](Mustache[_0x5583('0x6d')](JSON[_0x5583('0x6f')](_0x456c1b['body']),_0x5c804a,{},['$$','$$']));}}catch(_0x396553){logger[_0x5583('0x29')](_0x5583('0x70'),_0x396553);}}rp(_0x456c1b)[_0x5583('0xf')](function(_0x3eeb6e){var _0x1ea64d={'statusCode':_0x3eeb6e[_0x5583('0x71')]||0xc8,'statusMessage':_0x3eeb6e['statusMessage']||'OK','headers':_0x3eeb6e[_0x5583('0x6e')]||{},'body':_0x3eeb6e['body']||{}};_0x32eed1(null,_0x1ea64d);})['catch'](function(_0x33287f){var _0x42c87a={'statusCode':_0x33287f[_0x5583('0x71')]||0x1f4,'statusMessage':_0x33287f[_0x5583('0x72')]||_0x5583('0x73'),'headers':_0x33287f[_0x5583('0x74')][_0x5583('0x6e')]||{},'body':_0x33287f[_0x5583('0x74')][_0x5583('0x68')]||{}};_0x32eed1(null,_0x42c87a);});};AGIVertices[_0x5583('0xc')][_0x5583('0x75')]=function(_0x3ede69,_0x5f18dc){scripts[_0x5583('0x75')](this[_0x5583('0xb')][_0x5583('0x33')],_0x3ede69[_0x5583('0x76')],_0x3ede69['text'],_0x3ede69[_0x5583('0x77')]||'en')[_0x5583('0xf')](function(_0x5ecf61){_0x5f18dc(null,_0x5ecf61);})['catch'](function(_0x3b57f7){_0x5f18dc(_0x3b57f7);});};AGIVertices['prototype'][_0x5583('0x78')]=function(_0x3640b5,_0x2eee62){scripts[_0x5583('0x78')](this[_0x5583('0xb')][_0x5583('0x33')],_0x3640b5[_0x5583('0x79')],_0x3640b5['client_email'],_0x3640b5[_0x5583('0x7a')],_0x3640b5[_0x5583('0x58')],_0x3640b5[_0x5583('0x7b')]||'en')['then'](function(_0x5b8f0e){_0x2eee62(null,_0x5b8f0e);})[_0x5583('0x13')](function(_0x200e84){_0x2eee62(_0x200e84);});};AGIVertices[_0x5583('0xc')][_0x5583('0x7c')]=function(_0x3a7c93,_0x45ec19){scripts[_0x5583('0x7c')](this[_0x5583('0xb')],_0x3a7c93)['then'](function(_0x23d06b){_0x45ec19(null,_0x23d06b);})[_0x5583('0x13')](function(_0x501b73){_0x45ec19(_0x501b73);});};AGIVertices[_0x5583('0xc')][_0x5583('0x7d')]=function(_0x17f7e2,_0x18415e){scripts[_0x5583('0x7d')](_0x17f7e2[_0x5583('0x76')],_0x17f7e2['text'],_0x17f7e2['ispeech_tts_language']||_0x5583('0x5a'),_0x17f7e2[_0x5583('0x7e')])[_0x5583('0xf')](function(_0x1f7315){_0x18415e(null,_0x1f7315);})[_0x5583('0x13')](function(_0x238ce1){_0x18415e(_0x238ce1);});};AGIVertices['prototype'][_0x5583('0x7f')]=function(_0x3b777b,_0xd49991,_0x340c02){scripts[_0x5583('0x7f')](_0xd49991,_0x3b777b[_0x5583('0x76')],_0x3b777b[_0x5583('0x80')]||'en-US',this[_0x5583('0x81')](_0x3b777b[_0x5583('0x82')])?_0x3b777b[_0x5583('0x82')]:undefined)['then'](function(_0x2c24f3){_0x340c02(null,_0x2c24f3);})[_0x5583('0x13')](function(_0x3da783){_0x340c02(_0x3da783);});};AGIVertices[_0x5583('0xc')][_0x5583('0x83')]=function(_0x14d670,_0x7c466e){scripts[_0x5583('0x83')](_0x14d670[_0x5583('0x84')],_0x14d670[_0x5583('0x85')],_0x14d670[_0x5583('0x86')],_0x14d670[_0x5583('0x87')]||_0x5583('0x88'),_0x14d670['text'],_0x14d670[_0x5583('0x89')]||_0x5583('0x58'))[_0x5583('0xf')](function(_0x1ad653){_0x7c466e(null,_0x1ad653);})['catch'](function(_0x495607){_0x7c466e(_0x495607);});};AGIVertices['prototype'][_0x5583('0x8a')]=function(_0x51df4c,_0x130e1c){scripts[_0x5583('0x8a')](this[_0x5583('0xb')][_0x5583('0x33')],_0x51df4c[_0x5583('0x84')],_0x51df4c[_0x5583('0x85')],_0x51df4c[_0x5583('0x8b')],_0x51df4c[_0x5583('0x58')],_0x51df4c['aws_bot_name'])[_0x5583('0xf')](function(_0x7b81b){_0x130e1c(null,_0x7b81b);})[_0x5583('0x13')](function(_0x4f6bfe){_0x130e1c(_0x4f6bfe);});};AGIVertices['prototype']['googleASR']=function(_0x492441,_0x268054,_0x2fd1fd){scripts[_0x5583('0x8c')](_0x268054,_0x492441[_0x5583('0x76')],_0x492441[_0x5583('0x8d')]||_0x5583('0x5a'))[_0x5583('0xf')](function(_0x40ca5c){_0x2fd1fd(null,_0x40ca5c);})[_0x5583('0x13')](function(_0x501a4d){_0x2fd1fd(_0x501a4d);});};AGIVertices['prototype'][_0x5583('0x8e')]=function(_0x216611,_0x35dee0,_0x1028d2){scripts[_0x5583('0x8e')](_0x35dee0,_0x216611[_0x5583('0x8f')],_0x216611[_0x5583('0x90')],_0x216611[_0x5583('0x91')])[_0x5583('0xf')](function(_0x123d53){_0x1028d2(null,_0x123d53);})['catch'](function(_0x5226e9){_0x1028d2(_0x5226e9);});};AGIVertices[_0x5583('0xc')][_0x5583('0x92')]=function(_0x2286ed){var _0x12f446=_[_0x5583('0x93')](verticesWithRetry,_0x2286ed[_0x5583('0x35')])?_0x2286ed:_[_0x5583('0x94')](_0x2286ed);for(var _0x348f9e in _0x12f446){if(_0x12f446[_0x5583('0x95')](_0x348f9e)){if(_0x12f446[_0x348f9e]&&_[_0x5583('0x96')](_0x12f446[_0x348f9e])){if(_[_0x5583('0x93')](recursiveMapAttributes,_0x348f9e)){_0x12f446[_0x348f9e]=this[_0x5583('0x97')](_0x12f446[_0x348f9e]);}else{_0x12f446[_0x348f9e]=this[_0x5583('0x98')](_0x12f446[_0x348f9e]);}}}}return _0x12f446;};AGIVertices[_0x5583('0xc')][_0x5583('0x99')]=function(_0x24ff69){for(var _0x17fca0 in _0x24ff69){if(_0x24ff69[_0x5583('0x95')](_0x17fca0)){if(_['isPlainObject'](_0x24ff69[_0x17fca0])){this[_0x5583('0x99')](_0x24ff69[_0x17fca0]);}else if(_['isArray'](_0x24ff69[_0x17fca0])){for(var _0x161f7a=0x0;_0x161f7a<_0x24ff69[_0x17fca0]['length'];_0x161f7a++){this[_0x5583('0x99')](_0x24ff69[_0x17fca0][_0x161f7a]);}}else if(_[_0x5583('0x96')](_0x24ff69[_0x17fca0])){_0x24ff69[_0x17fca0]=this['replaceAllVariables'](_0x24ff69[_0x17fca0]);}}}};AGIVertices['prototype'][_0x5583('0x9a')]=function(_0x3d1fdb,_0x3abb0e){for(var _0x112aed in _0x3d1fdb){if(_0x3d1fdb['hasOwnProperty'](_0x112aed)){if(_[_0x5583('0x9b')](_0x3d1fdb[_0x112aed])){if(!_[_0x5583('0x3f')](_0x3d1fdb[_0x112aed])){this[_0x5583('0x9a')](_0x3d1fdb[_0x112aed],util[_0x5583('0x25')](_0x5583('0x9c'),_0x3abb0e,_0x112aed));}}else if(_[_0x5583('0x9d')](_0x3d1fdb[_0x112aed])){for(var _0x2cb0a8=0x0;_0x2cb0a8<_0x3d1fdb[_0x112aed][_0x5583('0x9e')];_0x2cb0a8++){this[_0x5583('0x9a')](_0x3d1fdb[_0x112aed][_0x2cb0a8],util[_0x5583('0x25')](_0x5583('0x9c'),_0x3abb0e,_0x112aed+'['+_0x2cb0a8+']'));}}else{if(!_[_0x5583('0x42')](_0x3d1fdb[_0x112aed])){this[_0x5583('0xb')][_0x5583('0x9f')](util[_0x5583('0x25')](_0x5583('0x9c'),_0x3abb0e,_0x112aed),_0x3d1fdb[_0x112aed]);}}}}};AGIVertices[_0x5583('0xc')][_0x5583('0x97')]=function(_0x4541bf){try{var _0x38cbac=JSON['parse'](_0x4541bf);this[_0x5583('0x99')](_0x38cbac);return JSON[_0x5583('0x6f')](_0x38cbac);}catch(_0x30d133){return this[_0x5583('0x98')](_0x4541bf);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x92c00c){var _0x4467a5=_0x92c00c[_0x5583('0xa0')]('{');for(var _0x3d1111=0x1;_0x3d1111<_0x4467a5[_0x5583('0x9e')];_0x3d1111+=0x1){var _0x57b513=_0x4467a5[_0x3d1111][_0x5583('0xa0')]('}');if(_0x57b513[_0x5583('0x9e')]>0x1){_0x92c00c=_0x92c00c['replaceAll']('{'+_0x57b513[0x0]+'}',this[_0x5583('0xb')]['getVariable'](_0x57b513[0x0])[_0x5583('0xa1')]||_0x57b513[0x0]);}}if(_0x4467a5[_0x5583('0x9e')]===0x1){return _0x92c00c[_0x5583('0x49')]();}return this[_0x5583('0x98')](_0x92c00c);};AGIVertices['prototype'][_0x5583('0xa2')]=function(_0x1bc04b,_0x278d15){var _0x6d662f=this[_0x5583('0xb')][_0x5583('0xd')](_0x1bc04b);if(_0x6d662f['result']===-0x1){return _0x6d662f;}logger['info'](util[_0x5583('0x25')](_0x5583('0xa3'),_0x278d15,_0x6d662f[_0x5583('0xa1')]));return this['channel'][_0x5583('0x9f')](_0x278d15,_0x6d662f['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x5be1af){return _0x5be1af&&_0x5be1af!=='0'&&_0x5be1af!=='-1'&&_0x5be1af!=='';};AGIVertices[_0x5583('0xc')][_0x5583('0xa4')]=function(_0x2249c0){this['createSquareDetailsReport']['sync'](this,_0x2249c0,'-');_0x2249c0[_0x5583('0xa5')]=_0x2249c0[_0x5583('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5583('0xc')]['mrcpsynth']=function(_0x90f34d){logger['info'](util['format'](_0x5583('0xa6'),_0x90f34d[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x90f34d['text'])){return this[_0x5583('0xb')]['noop'](_0x5583('0xa7'));}var _0x4d097b='\x22'+_0x90f34d['text']+'\x22';if(this[_0x5583('0x81')](_0x90f34d['options'])){_0x4d097b+=','+_0x90f34d[_0x5583('0x74')];}var _0x434664=this[_0x5583('0xb')][_0x5583('0xa8')](_0x5583('0xa9'),_0x4d097b);if(_0x434664['result']===-0x1){return _0x434664;}return this[_0x5583('0xb')]['noop'](util[_0x5583('0x25')](_0x5583('0xaa'),_0x4d097b));};AGIVertices['prototype']['mrcprecog']=function(_0x2452b4){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xab'),_0x2452b4['label']));if(!this[_0x5583('0x81')](_0x2452b4[_0x5583('0xac')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xae'));}var _0x20f701=_0x2452b4['grammar'];if(this[_0x5583('0x81')](_0x2452b4['options'])){_0x20f701+=','+_0x2452b4[_0x5583('0x74')];}var _0x21c7c5=this[_0x5583('0xb')]['exec'](_0x5583('0xaf'),_0x20f701);if(_0x21c7c5[_0x5583('0xb0')]===-0x1){return _0x21c7c5;}var _0x4aeb90=this[_0x5583('0xa2')]('RECOG_CONFIDENCE()',_0x5583('0xb1'));if(_0x4aeb90[_0x5583('0xb0')]===-0x1){return _0x4aeb90;}var _0x185484=this[_0x5583('0xa2')](_0x5583('0xb2'),_0x5583('0xb3'));if(_0x185484['result']===-0x1){return _0x185484;}var _0x26d365=this[_0x5583('0xa2')](_0x5583('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x26d365[_0x5583('0xb0')]===-0x1){return _0x26d365;}return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xb5'),_0x20f701));};AGIVertices['prototype'][_0x5583('0xb6')]=function(_0x5b6b2c){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xb7'),_0x5b6b2c[_0x5583('0x34')]));return this['channel'][_0x5583('0xb6')]([_0x5b6b2c[_0x5583('0xb8')],_0x5b6b2c[_0x5583('0xb9')]]);};AGIVertices[_0x5583('0xc')]['answer']=function(_0x1de9b7){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x1de9b7[_0x5583('0x34')]));if(this['isConfigured'](_0x1de9b7[_0x5583('0x65')])){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xba'),_0x1de9b7[_0x5583('0x65')]));var _0x33b96b=this[_0x5583('0xb')]['wait'](_0x1de9b7['timeout']);if(_0x33b96b[_0x5583('0xb0')]===-0x1){return _0x33b96b;}}return this['channel'][_0x5583('0xbb')]();};AGIVertices[_0x5583('0xc')][_0x5583('0x46')]=function(_0x4fd218){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xbc'),_0x4fd218[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x4fd218[_0x5583('0x45')])){return this[_0x5583('0xb')]['error'](_0x4fd218,_0x5583('0xbd'));}_0x4fd218['scheduledAt']=moment();if(this[_0x5583('0x81')](_0x4fd218[_0x5583('0xbe')])){_0x4fd218[_0x5583('0x48')]=moment()[_0x5583('0xbf')](_0x4fd218[_0x5583('0xbe')],_0x5583('0xc0'));}if(!this[_0x5583('0x81')](_0x4fd218[_0x5583('0xc1')])){_0x4fd218[_0x5583('0xc1')]=0x2;}this[_0x5583('0x3e')][_0x5583('0x6c')](this,_0x4fd218);return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xc2'),_0x4fd218['phone'],_0x4fd218[_0x5583('0x45')],_0x4fd218[_0x5583('0x48')]));};AGIVertices['prototype'][_0x5583('0xc3')]=function(_0xb52b4a){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xc4'),_0xb52b4a['label']));var _0x34ab00=this[_0x5583('0xb')]['exec'](_0xb52b4a['application'],_0xb52b4a[_0x5583('0x74')]);if(_0x34ab00[_0x5583('0xb0')]===-0x1){return _0x34ab00;}return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xc5'),_0xb52b4a[_0x5583('0xc6')],_0xb52b4a['options']));};AGIVertices['prototype'][_0x5583('0xc7')]=function(_0x549b71){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xc8'),_0x549b71[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x549b71[_0x5583('0x58')])){return this[_0x5583('0xb')][_0x5583('0xad')]('no\x20text\x20configured');}var _0x25cc85='\x22'+_0x549b71['text']+'\x22';if(this[_0x5583('0x81')](_0x549b71[_0x5583('0x74')])){_0x25cc85+=','+_0x549b71['options'];}var _0x3c8b52=this['channel'][_0x5583('0xa8')](_0x5583('0xa9'),_0x25cc85);if(_0x3c8b52['result']===-0x1){return _0x3c8b52;}return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xaa'),_0x25cc85));};AGIVertices[_0x5583('0xc')]['sestektts']=function(_0x4f34ea){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xc9'),_0x4f34ea[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x4f34ea['text'])){return this[_0x5583('0xb')]['noop'](_0x5583('0xa7'));}var _0xe95abb='\x22'+_0x4f34ea[_0x5583('0x58')]+'\x22';if(this[_0x5583('0x81')](_0x4f34ea[_0x5583('0x74')])){_0xe95abb+=','+_0x4f34ea['options'];}var _0xcc5de5=this['channel'][_0x5583('0xa8')](_0x5583('0xa9'),_0xe95abb);if(_0xcc5de5[_0x5583('0xb0')]===-0x1){return _0xcc5de5;}return this['channel'][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xaa'),_0xe95abb));};AGIVertices[_0x5583('0xc')]['lumenvoxasr']=function(_0x58bb09){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x58bb09[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x58bb09[_0x5583('0xac')])){return this[_0x5583('0xb')][_0x5583('0xad')]('no\x20grammar\x20configured');}var _0x267395=_0x58bb09[_0x5583('0xac')];if(this[_0x5583('0x81')](_0x58bb09[_0x5583('0x74')])){_0x267395+=','+_0x58bb09[_0x5583('0x74')];}var _0x1c881d=this[_0x5583('0xb')][_0x5583('0xa8')](_0x5583('0xaf'),_0x267395);if(_0x1c881d[_0x5583('0xb0')]===-0x1){return _0x1c881d;}var _0x5558d5=this['getAndSetVariable'](_0x5583('0xca'),_0x5583('0xcb'));if(_0x5558d5[_0x5583('0xb0')]===-0x1){return _0x5558d5;}var _0x36ad36=this['getAndSetVariable']('RECOG_INPUT()',_0x5583('0xcc'));if(_0x36ad36['result']===-0x1){return _0x36ad36;}var _0xeee815=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0xeee815[_0x5583('0xb0')]===-0x1){return _0xeee815;}return this[_0x5583('0xb')]['noop'](util['format'](_0x5583('0xb5'),_0x267395));};AGIVertices['prototype'][_0x5583('0xcd')]=function(_0xcf04f2){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xce'),_0xcf04f2[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0xcf04f2[_0x5583('0xac')])){return this[_0x5583('0xb')][_0x5583('0xad')]('no\x20grammar\x20configured');}var _0x4d4ff8=_0xcf04f2['grammar'];if(this[_0x5583('0x81')](_0xcf04f2[_0x5583('0x74')])){_0x4d4ff8+=','+_0xcf04f2['options'];}var _0x8f7e46=this['channel']['exec']('MRCPRecog',_0x4d4ff8);if(_0x8f7e46[_0x5583('0xb0')]===-0x1){return _0x8f7e46;}var _0x1a92e8=this['getAndSetVariable'](_0x5583('0xca'),'SESTEK_ASR_CONFIDENCE');if(_0x1a92e8['result']===-0x1){return _0x1a92e8;}var _0xd7a6f3=this[_0x5583('0xa2')](_0x5583('0xb2'),_0x5583('0xcf'));if(_0xd7a6f3[_0x5583('0xb0')]===-0x1){return _0xd7a6f3;}var _0x428a1c=this[_0x5583('0xa2')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x428a1c[_0x5583('0xb0')]===-0x1){return _0x428a1c;}return this[_0x5583('0xb')][_0x5583('0xad')](util['format'](_0x5583('0xb5'),_0x4d4ff8));};AGIVertices[_0x5583('0xc')]['database']=function(_0x30e8ea){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xd0'),_0x30e8ea[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x30e8ea['odbc_id'])){return this['channel'][_0x5583('0x29')](_0x30e8ea,_0x5583('0xd1'));}var _0x210db7=this[_0x5583('0xd2')]['sync'](this,_0x30e8ea[_0x5583('0xd3')]);if(!_0x210db7){return this[_0x5583('0xb')]['error'](_0x30e8ea,_0x5583('0xd4'));}if(!this['isConfigured'](_0x30e8ea[_0x5583('0xd5')])){return this['channel']['error'](_0x30e8ea,_0x5583('0xd6'));}var _0x1c8b55=_0x30e8ea['query'][_0x5583('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x5583('0xb')][_0x5583('0xad')](util['format']('query:\x20%s',_0x1c8b55));var _0x1b6568=this[_0x5583('0x27')][_0x5583('0x6c')](this,_0x210db7,_0x1c8b55);this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x30e8ea,_0x1c8b55);if(!this[_0x5583('0x81')](_0x30e8ea['variable_id'])){return this[_0x5583('0xb')]['noop'](_0x5583('0xd7'));}var _0x19f7d6=this[_0x5583('0xd')][_0x5583('0x6c')](this,_0x30e8ea[_0x5583('0xd8')]);if(!_0x19f7d6){return this[_0x5583('0xb')][_0x5583('0x29')](_0x30e8ea,'no\x20variable\x20found');}var _0x2e4c34=this;_0x1b6568[_0x5583('0xd9')](function(_0x1dd054,_0x5644ef){Object[_0x5583('0xda')](_0x1dd054)['forEach'](function(_0x1833c6){_0x2e4c34[_0x5583('0xb')][_0x5583('0x9f')](util[_0x5583('0x25')](_0x5583('0xdb'),_0x19f7d6,_0x5644ef,_0x1833c6),_0x1dd054[_0x1833c6]);});});this['channel']['setVariable'](util[_0x5583('0x25')](_0x5583('0xdc'),_0x19f7d6),_0x1b6568[_0x5583('0x9e')]);return this[_0x5583('0xb')]['noop'](util[_0x5583('0x25')]('variable\x20%s\x20set',_0x19f7d6));};AGIVertices['prototype'][_0x5583('0xdd')]=function(_0x20bcca){logger[_0x5583('0xde')](util[_0x5583('0x25')](_0x5583('0xdf'),_0x20bcca[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x20bcca[_0x5583('0xe0')])){return this['channel'][_0x5583('0x29')](_0x20bcca,_0x5583('0xe1'));}var _0x22e0db=this['getUser'][_0x5583('0x6c')](this,_0x20bcca[_0x5583('0xe0')]);if(!_0x22e0db){return this['channel']['error'](_0x20bcca,'no\x20user\x20found');}var _0x697762=this[_0x5583('0xb')][_0x5583('0xa8')](_0x5583('0xe2'),[util[_0x5583('0x25')](_0x5583('0xe3'),_0x22e0db),_0x20bcca['timeout'],_0x20bcca[_0x5583('0xe4')],_0x20bcca[_0x5583('0x62')]]);if(_0x697762[_0x5583('0xb0')]===-0x1){return _0x697762;}return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xe5'),_0x5583('0xe2')));};AGIVertices[_0x5583('0xc')][_0x5583('0xe6')]=function(_0x1847d){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x1847d[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x1847d['key'])){return this[_0x5583('0xb')][_0x5583('0xad')]('no\x20key\x20configured');}if(!this[_0x5583('0x81')](_0x1847d[_0x5583('0x58')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xa7'));}this[_0x5583('0xb')]['bot']=!![];this[_0x5583('0x32')](_0x1847d);this['createSquareMessage'](_0x1847d[_0x5583('0x58')],'in','','');this[_0x5583('0xb')][_0x5583('0xad')](util['format']('Trying\x20Dialogflow:\x20%s',_0x1847d['text']));var _0xf44cb2=this[_0x5583('0x75')]['sync'](this,_0x1847d);if(_0xf44cb2){for(var _0x4c5080 in _0xf44cb2){if(_0xf44cb2['hasOwnProperty'](_0x4c5080)){this[_0x5583('0xb')][_0x5583('0x9f')](util[_0x5583('0x25')](_0x5583('0xe7'),_0x4c5080[_0x5583('0xe8')]()),_0xf44cb2[_0x4c5080]);}}this[_0x5583('0x3d')](_0xf44cb2[_0x5583('0xe9')],'out',_0x5583('0xe6'),'');return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xea'),_0xf44cb2[_0x5583('0xe9')]));}return this['channel'][_0x5583('0x29')](_0x1847d,_0x5583('0xeb'));};AGIVertices[_0x5583('0xc')][_0x5583('0xec')]=function(_0x51e47c){logger['info'](util[_0x5583('0x25')](_0x5583('0xed'),_0x51e47c[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x51e47c[_0x5583('0x79')])){return this[_0x5583('0xb')]['noop'](_0x5583('0xee'));}if(!this[_0x5583('0x81')](_0x51e47c['client_email'])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xef'));}if(!this[_0x5583('0x81')](_0x51e47c[_0x5583('0x7a')])){return this['channel'][_0x5583('0xad')](_0x5583('0xf0'));}if(!this[_0x5583('0x81')](_0x51e47c['dialogflowV2_language'])){return this[_0x5583('0xb')]['noop'](_0x5583('0xf1'));}if(!this[_0x5583('0x81')](_0x51e47c[_0x5583('0x58')])){return this[_0x5583('0xb')]['noop'](_0x5583('0xa7'));}this[_0x5583('0xb')][_0x5583('0xf2')]=!![];this[_0x5583('0x32')](_0x51e47c);this[_0x5583('0x3d')](_0x51e47c[_0x5583('0x58')],'in','','');this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xf3'),_0x51e47c[_0x5583('0x58')]));var _0x24dab4=this['googleDialogflowV2'][_0x5583('0x6c')](this,_0x51e47c);if(_0x24dab4){for(var _0x4eafe0 in _0x24dab4){if(_0x24dab4[_0x5583('0x95')](_0x4eafe0)){if(_0x4eafe0!==_0x5583('0xf4')){this[_0x5583('0xb')]['setVariable'](util[_0x5583('0x25')]('DIALOGFLOW_%s',_0x4eafe0[_0x5583('0xe8')]()),_0x24dab4[_0x4eafe0]);}}}this[_0x5583('0x3d')](_0x24dab4[_0x5583('0xe9')],'out','dialogflowV2',_0x24dab4['providerResponse']);return this['channel'][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xf5'),_0x24dab4[_0x5583('0xe9')]));}return this[_0x5583('0xb')][_0x5583('0x29')](_0x51e47c,_0x5583('0xf6'));};AGIVertices['prototype']['sesteknda']=function(_0x45017d){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0xf7'),_0x45017d[_0x5583('0x34')]));if(!this['isConfigured'](_0x45017d['ndauth_url'])){return this['channel'][_0x5583('0xad')](_0x5583('0xf8'));}if(!this[_0x5583('0x81')](_0x45017d[_0x5583('0xf9')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xfa'));}if(!this[_0x5583('0x81')](_0x45017d['password'])){return this['channel'][_0x5583('0xad')]('no\x20password\x20configured');}if(!this[_0x5583('0x81')](_0x45017d[_0x5583('0xfb')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xa7'));}this['channel'][_0x5583('0xf2')]=!![];this['createSquareDetailsReport'](_0x45017d);this[_0x5583('0x3d')](_0x45017d[_0x5583('0x58')],'in','','');this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xfc'),_0x45017d[_0x5583('0x58')]));var _0x326874=this[_0x5583('0x7c')][_0x5583('0x6c')](this,_0x45017d);if(_0x326874){for(var _0xb4e06 in _0x326874){if(_0x326874[_0x5583('0x95')](_0xb4e06)){this['channel'][_0x5583('0x9f')](util[_0x5583('0x25')](_0x5583('0xfd'),_0xb4e06['toUpperCase']()),_0x326874[_0xb4e06]);}}this[_0x5583('0x3d')](_0x326874[_0x5583('0xe9')],_0x5583('0xfe'),_0x5583('0xff'),'');if(_0x326874['audiofile']){this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x100'),_0x326874[_0x5583('0x101')]));var _0x4c9b77=this[_0x5583('0xb')][_0x5583('0x102')](_0x326874[_0x5583('0x101')]);try{fs[_0x5583('0x103')](_0x326874[_0x5583('0x101')]+'.wav');}catch(_0x35646c){logger['error'](_0x35646c);}return _0x4c9b77;}else{return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x104'),_0x326874[_0x5583('0xe9')]));}}return this[_0x5583('0xb')][_0x5583('0x29')](_0x45017d,_0x5583('0x105'));};AGIVertices[_0x5583('0xc')][_0x5583('0x106')]=function(_0x20805c){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x107'),_0x20805c[_0x5583('0x34')]));return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x106'));};AGIVertices['prototype']['ext_dial']=function(_0x16842e){logger['info'](util[_0x5583('0x25')](_0x5583('0x108'),_0x16842e['label']));var _0x33260b='';if(_0x16842e[_0x5583('0x109')]){if(!this[_0x5583('0x81')](_0x16842e[_0x5583('0x109')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x16842e,_0x5583('0x10a'));}else{var _0x133dcb=parseInt(_0x16842e[_0x5583('0x109')],0xa);if(isNaN(_0x133dcb)){_0x33260b=_0x16842e['trunk_id'];}else{_0x33260b=this[_0x5583('0x18')][_0x5583('0x6c')](this,_0x16842e[_0x5583('0x109')]);if(!_0x33260b){return this[_0x5583('0xb')][_0x5583('0x29')](_0x16842e,_0x5583('0x10b'));}}}}else if(_0x16842e[_0x5583('0x10c')]){_0x33260b=_0x16842e['trunk_name'];}else{return this['channel'][_0x5583('0x29')](_0x16842e,'no\x20trunk\x20selected');}var _0x56c7e9=this[_0x5583('0xb')][_0x5583('0xa8')](_0x5583('0xe2'),[util[_0x5583('0x25')]('SIP/%s/%s',_0x33260b,_0x16842e[_0x5583('0x44')]),_0x16842e[_0x5583('0x65')],_0x16842e[_0x5583('0xe4')],_0x16842e[_0x5583('0x62')]]);if(_0x56c7e9['result']===-0x1){return _0x56c7e9;}return this[_0x5583('0xb')][_0x5583('0xad')](util['format']('Executed\x20command\x20%s',_0x5583('0xe2')));};AGIVertices[_0x5583('0xc')][_0x5583('0x10d')]=function(_0x30f07b){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x10e'),_0x30f07b[_0x5583('0x34')]));return this[_0x5583('0xb')][_0x5583('0xad')]('finally');};AGIVertices[_0x5583('0xc')][_0x5583('0x9')]=function(_0x337e7f){logger['info'](util[_0x5583('0x25')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x337e7f['label']));if(_0x337e7f[_0x5583('0xa5')]===0x0){return this['maxRetry'](_0x337e7f);}_0x337e7f[_0x5583('0xa5')]-=0x1;if(!this[_0x5583('0x81')](_0x337e7f[_0x5583('0x10f')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x337e7f,_0x5583('0x110'));}var _0x3fb4c7=this[_0x5583('0x1a')][_0x5583('0x6c')](this,_0x337e7f['file_id']);if(!_0x3fb4c7){return this[_0x5583('0xb')][_0x5583('0x29')](_0x337e7f,_0x5583('0x111'));}if(!this[_0x5583('0x81')](_0x337e7f[_0x5583('0xd8')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x5583('0xd7'));}var _0x4e1cbd=this[_0x5583('0xb')][_0x5583('0x112')](_0x3fb4c7,_0x337e7f[_0x5583('0x113')],_0x337e7f['maxdigit']);var _0x2fb433=_0x4e1cbd[_0x5583('0xb0')]?_0x4e1cbd['result'][_0x5583('0x49')]():'';logger[_0x5583('0x2b')]('test',JSON[_0x5583('0x6f')](_0x4e1cbd));if(_0x4e1cbd[_0x5583('0xb0')]===-0x1){this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x337e7f,_0x2fb433);return _0x4e1cbd;}else if(_0x4e1cbd[_0x5583('0xa1')]===_0x5583('0x65')){_0x4e1cbd[_0x5583('0xb0')]=_0x2fb433['length']>=parseInt(_0x337e7f['mindigit'])?'x':'i';}else{_0x4e1cbd['result']=_0x2fb433[_0x5583('0x9e')]>=parseInt(_0x337e7f[_0x5583('0x114')])&&_0x2fb433['length']<=parseInt(_0x337e7f[_0x5583('0x115')])?'x':'i';}var _0x5cc92f=this[_0x5583('0xd')]['sync'](this,_0x337e7f[_0x5583('0xd8')]);if(!_0x5cc92f){return this[_0x5583('0xb')]['error'](_0x337e7f,'no\x20variable\x20found');}this[_0x5583('0xb')][_0x5583('0x9f')](_0x5cc92f,_0x2fb433);if(this[_0x5583('0x81')](_0x337e7f[_0x5583('0x116')])){var _0x6262b4=parseInt(_0x337e7f[_0x5583('0x116')],0xa);var _0x34ed65=rs[_0x5583('0x117')]({'charset':'*','length':_0x6262b4});var _0x10ddce=_0x2fb433[_0x5583('0x9e')];if(_0x10ddce>0x0){if(_0x10ddce>_0x6262b4){this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x337e7f,_0x337e7f[_0x5583('0x118')]==='first'?_0x34ed65+_0x2fb433[_0x5583('0x119')](_0x6262b4):_0x2fb433[_0x5583('0x119')](0x0,_0x10ddce-_0x6262b4)+_0x34ed65);}else{this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x337e7f,rs[_0x5583('0x117')]({'charset':'*','length':_0x10ddce}));}}else{this['createSquareDetailsReport'][_0x5583('0x6c')](this,_0x337e7f,'');}}else{this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x337e7f,_0x2fb433);}return _0x4e1cbd;};AGIVertices[_0x5583('0xc')][_0x5583('0xa')]=function(_0x22ed34){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x11a'),_0x22ed34['label']));return this[_0x5583('0x9')](_0x22ed34);};AGIVertices['prototype'][_0x5583('0x11b')]=function(_0x5f1a54){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x11c'),_0x5f1a54[_0x5583('0x34')]));this[_0x5583('0x32')]['sync'](this,_0x5f1a54,_0x5f1a54[_0x5583('0x11d')]);return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x11e'),_0x5f1a54[_0x5583('0x11d')]));};AGIVertices[_0x5583('0xc')][_0x5583('0x11f')]=function(_0x125f0b){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x120'),_0x125f0b['label']));if(!this[_0x5583('0x81')](_0x125f0b[_0x5583('0x84')])||!this[_0x5583('0x81')](_0x125f0b[_0x5583('0x85')])){return this['channel'][_0x5583('0xad')](_0x5583('0x121'));}if(!this['isConfigured'](_0x125f0b[_0x5583('0x58')])){return this['channel'][_0x5583('0xad')](_0x5583('0xa7'));}this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x122'),_0x125f0b[_0x5583('0x58')]));var _0x32ceb6=this[_0x5583('0x83')][_0x5583('0x6c')](this,_0x125f0b);if(_0x32ceb6){this['channel'][_0x5583('0xad')](util[_0x5583('0x25')]('aws\x20Polly\x20%s\x20file\x20created',_0x32ceb6));var _0x583184=this['channel'][_0x5583('0x102')](_0x32ceb6);try{fs[_0x5583('0x103')](_0x32ceb6+'.wav');}catch(_0x336fdd){logger[_0x5583('0x29')](_0x336fdd);}return _0x583184;}return this[_0x5583('0xb')][_0x5583('0x29')](_0x125f0b,_0x5583('0x123'));};AGIVertices['prototype']['awslex']=function(_0x4aac84){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x124'),_0x4aac84[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x4aac84[_0x5583('0x84')])||!this[_0x5583('0x81')](_0x4aac84[_0x5583('0x85')])){return this['channel']['noop'](_0x5583('0x121'));}if(!this[_0x5583('0x81')](_0x4aac84[_0x5583('0x125')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x126'));}if(!this[_0x5583('0x81')](_0x4aac84['text'])){return this[_0x5583('0xb')][_0x5583('0xad')]('no\x20text\x20configured');}this[_0x5583('0xb')][_0x5583('0xf2')]=!![];this['createSquareDetailsReport'](_0x4aac84);this[_0x5583('0x3d')](_0x4aac84['text'],'in','','');this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x127'),_0x4aac84[_0x5583('0x58')]));var _0x579c53=this[_0x5583('0x8a')][_0x5583('0x6c')](this,_0x4aac84);if(_0x579c53){for(var _0x4e223f in _0x579c53){if(_0x579c53['hasOwnProperty'](_0x4e223f)&&_[_0x5583('0x96')](_0x579c53[_0x4e223f])){this[_0x5583('0xb')][_0x5583('0x9f')](util[_0x5583('0x25')]('AWS_LEX_%s',_0x4e223f[_0x5583('0xe8')]()),_0x579c53[_0x4e223f]);}}if(_[_0x5583('0x42')](_0x579c53[_0x5583('0x72')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x128'));}else{this['createSquareMessage'](_0x579c53['message'],'out','amazonlex','');return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')]('Amazon\x20Lex\x20Result\x20%s',_0x579c53[_0x5583('0x72')]));}}return this['channel']['error'](_0x4aac84,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x5583('0x129')]=function(_0x5440bd){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5440bd[_0x5583('0x34')],_0x5440bd[_0x5583('0x65')]));if(!this[_0x5583('0x81')](_0x5440bd[_0x5583('0x76')])){return this[_0x5583('0xb')][_0x5583('0xad')]('no\x20key\x20configured');}var _0x1fad1d='wav';var _0x38c90c=util['format'](_0x5583('0x12a'),FILES_PATH,rs[_0x5583('0x117')](0x4));var _0x3286bd=util[_0x5583('0x25')](_0x5583('0x9c'),_0x38c90c,_0x1fad1d);var _0x2ab830=!![];if(_0x5440bd[_0x5583('0x12b')]===_0x5583('0x12c')){_0x2ab830=![];}var _0x16d116=this[_0x5583('0xb')][_0x5583('0x12d')](_0x38c90c,_0x1fad1d,_0x5440bd['intKey'],_0x5440bd['timeout'],undefined,_0x2ab830);if(_0x16d116[_0x5583('0xb0')]!==-0x1){this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')]('google\x20%s\x20file\x20created',_0x3286bd));var _0x42db38=this[_0x5583('0x8c')][_0x5583('0x6c')](this,_0x5440bd,_0x3286bd);if(_0x42db38){for(var _0x332d7b in _0x42db38){if(_0x42db38[_0x5583('0x95')](_0x332d7b)){this[_0x5583('0xb')][_0x5583('0x9f')](util[_0x5583('0x25')](_0x5583('0x12e'),_0x332d7b[_0x5583('0xe8')]()),_0x42db38[_0x332d7b]);}}return this['channel'][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x12f'),JSON[_0x5583('0x6f')](_0x42db38)));}}return _0x16d116;};AGIVertices[_0x5583('0xc')][_0x5583('0x130')]=function(_0x367fa0){logger['info'](util[_0x5583('0x25')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x367fa0[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x367fa0[_0x5583('0x8f')])){return this[_0x5583('0xb')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x367fa0[_0x5583('0x90')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x131'));}var _0x1d38bb=_0x5583('0x132');var _0x165c3a=util[_0x5583('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0x5583('0x117')](0x4));var _0x3d64ee=util[_0x5583('0x25')]('%s.%s',_0x165c3a,_0x1d38bb);var _0x41308a=!![];if(_0x367fa0[_0x5583('0x12b')]===_0x5583('0x12c')){_0x41308a=![];}var _0x1939fd=this[_0x5583('0xb')][_0x5583('0x12d')](_0x165c3a,_0x1d38bb,_0x367fa0[_0x5583('0x133')],_0x367fa0[_0x5583('0x65')],undefined,_0x41308a);if(_0x1939fd[_0x5583('0xb0')]!==-0x1){this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x134'),_0x3d64ee));var _0x1716a4=this[_0x5583('0x8e')][_0x5583('0x6c')](this,_0x367fa0,_0x3d64ee);if(_0x1716a4){for(var _0x57299c in _0x1716a4){if(_0x1716a4['hasOwnProperty'](_0x57299c)){this[_0x5583('0xb')][_0x5583('0x9f')](util['format'](_0x5583('0x135'),_0x57299c[_0x5583('0xe8')]()),_0x1716a4[_0x57299c]);}}return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x136'),JSON[_0x5583('0x6f')](_0x1716a4)));}}return _0x1939fd;};AGIVertices[_0x5583('0xc')][_0x5583('0x137')]=function(_0x3f5648){logger[_0x5583('0x2b')](util['format'](_0x5583('0x138'),_0x3f5648[_0x5583('0x34')]));return this[_0x5583('0xb')][_0x5583('0x139')](_0x3f5648[_0x5583('0x3a')],_0x3f5648[_0x5583('0x3b')],_0x3f5648['priority']);};AGIVertices[_0x5583('0xc')][_0x5583('0x13a')]=function(_0x4a3e12){logger[_0x5583('0x2b')](util['format'](_0x5583('0x13b'),_0x4a3e12[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x4a3e12[_0x5583('0x13c')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x4a3e12,_0x5583('0x13d'));}try{var _0x3475fa=eval(_0x4a3e12[_0x5583('0x13c')])?_0x5583('0x13e'):'false';this[_0x5583('0xb')][_0x5583('0xad')](util['format'](_0x5583('0x13f'),_0x4a3e12[_0x5583('0x13c')],_0x3475fa));return{'code':0xc8,'result':_0x3475fa};}catch(_0x38650d){return{'code':0xc8,'result':_0x5583('0x140')};}};AGIVertices[_0x5583('0xc')][_0x5583('0x141')]=function(_0x383125){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x383125[_0x5583('0x34')]));if(!this['isConfigured'](_0x383125[_0x5583('0x142')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x383125,_0x5583('0x143'));}var _0x3fe688=this['getIntervals']['sync'](this,_0x383125[_0x5583('0x142')]);if(!_0x3fe688){return this[_0x5583('0xb')][_0x5583('0x29')](_0x383125,_0x5583('0x144'));}for(var _0x22a418=0x0;_0x22a418<_0x3fe688['length'];_0x22a418+=0x1){var _0x452d99=this[_0x5583('0xb')][_0x5583('0xd')](util[_0x5583('0x25')](_0x5583('0x145'),_0x3fe688[_0x22a418]));if(_0x452d99[_0x5583('0xb0')]===-0x1){return _0x452d99;}logger['info'](util['format'](_0x5583('0x146'),_0x3fe688[_0x22a418],_0x452d99['extra']));if(_0x452d99[_0x5583('0xa1')]===_0x5583('0x13e')){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x146'),_0x3fe688[_0x22a418],_0x5583('0x13e')));this['channel'][_0x5583('0xad')](util[_0x5583('0x25')]('IFTIME\x20%s\x20%s',_0x3fe688[_0x22a418],_0x5583('0x13e')));return{'code':0xc8,'result':_0x5583('0x13e')};}else{logger['info'](util['format'](_0x5583('0x146'),_0x3fe688[_0x22a418],_0x5583('0x140')));this['channel'][_0x5583('0xad')](util['format'](_0x5583('0x146'),_0x3fe688[_0x22a418],_0x5583('0x140')));}}return{'code':0xc8,'result':_0x5583('0x140')};};AGIVertices[_0x5583('0xc')][_0x5583('0x147')]=function(_0xb51e36){logger['info'](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0xb51e36[_0x5583('0x34')]));return this[_0x5583('0xb')]['hangup']();};AGIVertices[_0x5583('0xc')][_0x5583('0x148')]=function(_0x948cec){logger['info'](util[_0x5583('0x25')](_0x5583('0x149'),_0x948cec[_0x5583('0x34')]));if(!this['isConfigured'](_0x948cec[_0x5583('0x76')])){return this[_0x5583('0xb')]['noop'](_0x5583('0x14a'));}var _0x3280ba=_0x5583('0x132');var _0x313a6c=util[_0x5583('0x25')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3afb05=util[_0x5583('0x25')](_0x5583('0x9c'),_0x313a6c,_0x3280ba);var _0x3188a7=!![];if(_0x948cec[_0x5583('0x12b')]===_0x5583('0x12c')){_0x3188a7=![];}var _0x285431=this[_0x5583('0xb')][_0x5583('0x12d')](_0x313a6c,_0x3280ba,_0x948cec['intKey'],_0x948cec['timeout'],undefined,_0x3188a7);if(_0x285431[_0x5583('0xb0')]!==-0x1){this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x14b'),_0x3afb05));var _0x484fbd=this[_0x5583('0x7f')][_0x5583('0x6c')](this,_0x948cec,_0x3afb05);if(_0x484fbd){for(var _0x3adae8 in _0x484fbd){if(_0x484fbd[_0x5583('0x95')](_0x3adae8)){this[_0x5583('0xb')][_0x5583('0x9f')](util[_0x5583('0x25')]('ISPEECH_ASR_%s',_0x3adae8[_0x5583('0xe8')]()),_0x484fbd[_0x3adae8]);}}return this[_0x5583('0xb')]['noop'](util[_0x5583('0x25')](_0x5583('0x14c'),JSON['stringify'](_0x484fbd)));}}return _0x285431;};AGIVertices[_0x5583('0xc')][_0x5583('0x14d')]=function(_0x2f9c71){logger['info'](util[_0x5583('0x25')](_0x5583('0x14e'),_0x2f9c71[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x2f9c71[_0x5583('0x76')])){return this[_0x5583('0xb')]['noop'](_0x5583('0x14a'));}if(!this[_0x5583('0x81')](_0x2f9c71[_0x5583('0x58')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xa7'));}this[_0x5583('0xb')][_0x5583('0xad')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x2f9c71[_0x5583('0x58')]));var _0x5bf189=this['ispeechTTS'][_0x5583('0x6c')](this,_0x2f9c71);if(_0x5bf189){this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x14b'),_0x5bf189));var _0x5b01dd=this[_0x5583('0xb')][_0x5583('0x102')](_0x5bf189,_0x2f9c71[_0x5583('0x133')]);try{fs[_0x5583('0x103')](_0x5bf189+'.wav');}catch(_0x30d587){logger[_0x5583('0x29')](_0x30d587);}return _0x5b01dd;}return this[_0x5583('0xb')][_0x5583('0x29')](_0x2f9c71,_0x5583('0x14f'));};AGIVertices[_0x5583('0xc')][_0x5583('0x150')]=function(_0x508c00){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x151'),_0x508c00[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x508c00[_0x5583('0x152')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x508c00,'no\x20find\x20by\x20configured');}logger[_0x5583('0x2b')](util['format'](_0x5583('0x153'),this[_0x5583('0xb')][_0x5583('0x37')],_0x508c00[_0x5583('0x152')]));var _0x3a5fa2=this[_0x5583('0x51')][_0x5583('0x6c')](this,_0x508c00[_0x5583('0x152')]);if(_0x3a5fa2){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x154'),this[_0x5583('0xb')][_0x5583('0x37')],_0x508c00[_0x5583('0x152')]));this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x154'),this[_0x5583('0xb')]['callerid'],_0x508c00[_0x5583('0x152')]));return{'code':0xc8,'result':_0x5583('0x155')};}else{logger[_0x5583('0x2b')](util[_0x5583('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5583('0xb')][_0x5583('0x37')],_0x508c00[_0x5583('0x152')]));this['channel'][_0x5583('0xad')](util[_0x5583('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5583('0xb')]['callerid'],_0x508c00['findBy']));return{'code':0xc8,'result':_0x5583('0x156')};}};AGIVertices['prototype'][_0x5583('0x157')]=function(_0x4e5425){logger['info'](util[_0x5583('0x25')](_0x5583('0x158'),_0x4e5425[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x4e5425[_0x5583('0x152')])){return this[_0x5583('0xb')]['error'](_0x4e5425,_0x5583('0x159'));}logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x153'),this[_0x5583('0xb')][_0x5583('0x37')],_0x4e5425[_0x5583('0x152')]));var _0x2c48b6=this[_0x5583('0x4f')][_0x5583('0x6c')](this,_0x4e5425['findBy']);if(_0x2c48b6){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x154'),this[_0x5583('0xb')][_0x5583('0x37')],_0x4e5425[_0x5583('0x152')]));this[_0x5583('0xb')][_0x5583('0xad')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x5583('0xb')][_0x5583('0x37')],_0x4e5425['findBy']));return{'code':0xc8,'result':_0x5583('0x155')};}else{logger[_0x5583('0x2b')](util['format'](_0x5583('0x15a'),this[_0x5583('0xb')][_0x5583('0x37')],_0x4e5425['findBy']));this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x15a'),this[_0x5583('0xb')][_0x5583('0x37')],_0x4e5425[_0x5583('0x152')]));return{'code':0xc8,'result':_0x5583('0x156')};}};AGIVertices['prototype']['math']=function(_0x35074f){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x15b'),_0x35074f[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x35074f[_0x5583('0x15c')])){return this[_0x5583('0xb')]['error'](_0x35074f,_0x5583('0x15d'));}this['channel']['noop'](util[_0x5583('0x25')](_0x5583('0x15e'),_0x35074f[_0x5583('0x15c')]));var _0x2af0ae=eval(_0x35074f[_0x5583('0x15c')]);if(!this[_0x5583('0x81')](_0x35074f[_0x5583('0xd8')])){return this[_0x5583('0xb')]['noop'](_0x5583('0xd7'));}var _0x54158c=this['getVariable'][_0x5583('0x6c')](this,_0x35074f[_0x5583('0xd8')]);if(!_0x54158c){return this[_0x5583('0xb')]['error'](_0x35074f,_0x5583('0x15f'));}if(_['isArray'](_0x2af0ae)){var _0x3501c3=this;_0x2af0ae[_0x5583('0xd9')](function(_0x2c9d6a,_0x3762c9){_0x3501c3[_0x5583('0xb')][_0x5583('0x9f')](util['format'](_0x5583('0x160'),_0x54158c,_0x3762c9),_0x2c9d6a);});return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x161'),_0x54158c));}else{return this[_0x5583('0xb')][_0x5583('0x9f')](_0x54158c,_0x2af0ae);}};AGIVertices[_0x5583('0xc')][_0x5583('0x8')]=function(_0x3d565d){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x162'),_0x3d565d[_0x5583('0x34')]));if(_0x3d565d['retry']===0x0){return this[_0x5583('0xa4')](_0x3d565d);}_0x3d565d[_0x5583('0xa5')]-=0x1;if(!this[_0x5583('0x81')](_0x3d565d[_0x5583('0x10f')])){return this[_0x5583('0xb')]['error'](_0x3d565d,_0x5583('0x110'));}var _0x570fd6=this[_0x5583('0x1a')][_0x5583('0x6c')](this,_0x3d565d[_0x5583('0x10f')]);if(!_0x570fd6){return this['channel'][_0x5583('0x29')](_0x3d565d,_0x5583('0x111'));}var _0x14dd61=this[_0x5583('0xb')]['getData'](_0x570fd6,_0x3d565d['response'],_0x3d565d[_0x5583('0x163')]);var _0x1f31ae=_0x14dd61[_0x5583('0xb0')];if(_0x14dd61[_0x5583('0xb0')]===-0x1){this[_0x5583('0x32')]['sync'](this,_0x3d565d,'-1');return _0x14dd61;}else if(_0x14dd61[_0x5583('0xa1')]===_0x5583('0x65')){_0x14dd61['result']=_0x14dd61[_0x5583('0xb0')][_0x5583('0x9e')]>0x0?_0x14dd61['result']:'t';}else if(_[_0x5583('0x3f')](_0x14dd61['result'])){_0x14dd61['result']='#';_0x1f31ae='#';}if(!this[_0x5583('0x81')](_0x3d565d[_0x5583('0xd8')])){this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xd7'));}else{var _0xabde1d=this[_0x5583('0xd')][_0x5583('0x6c')](this,_0x3d565d[_0x5583('0xd8')]);if(!_0xabde1d){return this['channel'][_0x5583('0x29')](_0x3d565d,_0x5583('0x15f'));}this[_0x5583('0xb')]['setVariable'](_0xabde1d,_0x1f31ae);}this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x3d565d,_0x1f31ae);return _0x14dd61;};AGIVertices[_0x5583('0xc')][_0x5583('0xad')]=function(_0x305792){logger[_0x5583('0x2b')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x305792[_0x5583('0x34')]));return this['channel']['noop'](_0x305792[_0x5583('0x164')]||_0x305792[_0x5583('0x34')]);};AGIVertices[_0x5583('0xc')][_0x5583('0x165')]=function(_0x12abf5){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x166'),_0x12abf5[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x12abf5[_0x5583('0x152')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x12abf5,_0x5583('0x159'));}logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x153'),this[_0x5583('0xb')]['callerid'],_0x12abf5['findBy']));var _0x53ff78=this['getPause'][_0x5583('0x6c')](this,_0x12abf5['pause_id']);var _0x11e6b5=this['agentPause'][_0x5583('0x6c')](this,_0x12abf5[_0x5583('0x152')],_0x53ff78);if(_0x11e6b5){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x154'),this['channel'][_0x5583('0x37')],_0x12abf5[_0x5583('0x152')]));this[_0x5583('0xb')]['noop'](util[_0x5583('0x25')](_0x5583('0x154'),this['channel']['callerid'],_0x12abf5[_0x5583('0x152')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5583('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x5583('0x37')],_0x12abf5[_0x5583('0x152')]));this['channel'][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x154'),this['channel'][_0x5583('0x37')],_0x12abf5[_0x5583('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5583('0xc')]['playback']=function(_0x1febac){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x167'),_0x1febac[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x1febac[_0x5583('0x10f')])){return this['channel'][_0x5583('0x29')](_0x1febac,_0x5583('0x110'));}var _0x137c78=this['getSound'][_0x5583('0x6c')](this,_0x1febac[_0x5583('0x10f')]);if(!_0x137c78){return this['channel'][_0x5583('0x29')](_0x1febac,_0x5583('0x111'));}var _0x36b2b5=this['channel'][_0x5583('0xa8')](_0x5583('0x168'),[_0x137c78,_0x1febac['opts']]);if(_0x36b2b5[_0x5583('0xb0')]===-0x1){return _0x36b2b5;}return this[_0x5583('0xb')]['noop'](util['format'](_0x5583('0xc5'),_0x5583('0x168'),_0x137c78));};AGIVertices[_0x5583('0xc')][_0x5583('0x169')]=function(_0x550610){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x16a'),_0x550610[_0x5583('0x34')]));if(!this['isConfigured'](_0x550610[_0x5583('0x16b')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x550610,_0x5583('0x16c'));}var _0x4fdf10='';var _0x22ac03=parseInt(_0x550610['queue_id'],0xa);if(isNaN(_0x22ac03)){_0x4fdf10=_0x550610[_0x5583('0x16b')];}else{_0x4fdf10=this['getVoiceQueue'][_0x5583('0x6c')](this,_0x550610['queue_id']);if(!_0x4fdf10){return this[_0x5583('0xb')][_0x5583('0x29')](_0x550610,_0x5583('0x16d'));}}var _0xcc3b4='';if(this[_0x5583('0x81')](_0x550610[_0x5583('0x10f')])){var _0xc2032f=this[_0x5583('0x1a')][_0x5583('0x6c')](this,_0x550610[_0x5583('0x10f')]);if(_0xc2032f){_0xcc3b4=_0xc2032f;}}this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x550610,_0x4fdf10);if(_0x550610[_0x5583('0xe4')][_0x5583('0x16e')]('x')<0x0){_0x550610[_0x5583('0xe4')]+='x';}if(_0x550610[_0x5583('0xe4')][_0x5583('0x16e')]('X')<0x0){_0x550610[_0x5583('0xe4')]+='X';}this[_0x5583('0xb')][_0x5583('0x9f')](_0x5583('0x16f'),_0x4fdf10?_0x4fdf10[_0x5583('0x170')]():'');var _0x4dbcbd=this[_0x5583('0xb')][_0x5583('0xa8')](_0x5583('0x171'),[_0x4fdf10,_0x550610[_0x5583('0xe4')],_0x550610[_0x5583('0x62')],_0xcc3b4,_0x550610['timeout'],_0x550610[_0x5583('0xb6')],_0x550610[_0x5583('0x172')],_0x550610['gosub'],'',_0x550610[_0x5583('0x173')]]);if(_0x4dbcbd[_0x5583('0xb0')]===-0x1){return _0x4dbcbd;}return this[_0x5583('0xb')][_0x5583('0xad')](util['format'](_0x5583('0xc5'),_0x5583('0x171'),_0x4fdf10));};AGIVertices[_0x5583('0xc')][_0x5583('0x174')]=function(_0x4c7b21){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4c7b21[_0x5583('0x34')]));var _0x394940=_0x4c7b21[_0x5583('0x175')]||'wav';var _0x10c924=util[_0x5583('0x25')](_0x5583('0x176'),this['channel'][_0x5583('0x33')],rs[_0x5583('0x117')](0x5));var _0x349164=util[_0x5583('0x25')]('%s/recordings/%s.%s',FILES_PATH,_0x10c924,_0x394940);var _0x11b75c=util['format']('%s/recordings/%s',FILES_PATH,_0x10c924);this[_0x5583('0x38')][_0x5583('0x6c')](this,_0x4c7b21,_0x10c924,_0x349164);this[_0x5583('0xb')]['setVariable'](_0x5583('0x177'),_0x10c924);logger[_0x5583('0x2b')](_0x5583('0x178'),_0x11b75c,_0x394940,_0x4c7b21[_0x5583('0x179')],_0x4c7b21[_0x5583('0x65')]);return this[_0x5583('0xb')][_0x5583('0x12d')](_0x11b75c,_0x394940,_0x4c7b21[_0x5583('0x179')],_0x4c7b21[_0x5583('0x65')],undefined,!![]);};AGIVertices[_0x5583('0xc')]['restapi']=function(_0x266606){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x266606[_0x5583('0x34')]));if(!this['isConfigured'](_0x266606[_0x5583('0x62')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x17a'));}var _0x47beb4=this[_0x5583('0x61')]['sync'](this,_0x266606);logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Response:',util[_0x5583('0x17b')](_0x47beb4,{'showHidden':![],'depth':null})));if(!this[_0x5583('0x81')](_0x266606['variable_id'])){return this['channel'][_0x5583('0xad')](_0x5583('0x17c'));}var _0x8b801b=this[_0x5583('0xd')][_0x5583('0x6c')](this,_0x266606['variable_id']);if(!_0x8b801b){return this['channel'][_0x5583('0x29')](_0x266606,'no\x20variable\x20found');}this['channel'][_0x5583('0x9f')](util[_0x5583('0x25')](_0x5583('0x17d'),_0x8b801b),_0x47beb4[_0x5583('0x71')]?_0x47beb4[_0x5583('0x71')]:'200');this[_0x5583('0xb')][_0x5583('0x9f')](util[_0x5583('0x25')](_0x5583('0x17e'),_0x8b801b),_0x47beb4[_0x5583('0x17f')]?_0x47beb4['statusMessage']:'OK');if(_0x47beb4['body']){try{this[_0x5583('0x9a')](_0x47beb4[_0x5583('0x68')],_0x8b801b);}catch(_0x31754b){logger[_0x5583('0x29')](util[_0x5583('0x25')](_0x5583('0x180'),_0x8b801b));}}return this[_0x5583('0xb')]['noop'](util[_0x5583('0x25')](_0x5583('0x181'),_0x8b801b));};AGIVertices[_0x5583('0xc')][_0x5583('0x182')]=function(_0x5d7724){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x183'),_0x5d7724[_0x5583('0x34')]));return this[_0x5583('0xb')]['sayDigits'](_0x5d7724[_0x5583('0x184')][_0x5583('0x54')](/\s+/g,''),_0x5d7724[_0x5583('0x179')]);};AGIVertices[_0x5583('0xc')]['saynumber']=function(_0x3829f7){logger[_0x5583('0x2b')](util[_0x5583('0x25')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3829f7[_0x5583('0x34')]));return this[_0x5583('0xb')][_0x5583('0x185')](_0x3829f7[_0x5583('0x64')][_0x5583('0x54')](/\s+/g,''),_0x3829f7[_0x5583('0x179')]);};AGIVertices[_0x5583('0xc')][_0x5583('0x186')]=function(_0x1e7695){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x187'),_0x1e7695[_0x5583('0x34')]));return this['channel']['sayPhonetic'](_0x1e7695[_0x5583('0x58')],_0x1e7695['escape_digits']);};AGIVertices[_0x5583('0xc')]['sendMail']=function(_0x29712f){logger[_0x5583('0x2b')](util['format'](_0x5583('0x188'),_0x29712f[_0x5583('0x34')]));if(!this['isConfigured'](_0x29712f[_0x5583('0x189')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x18a'));}var _0x22f87c=this[_0x5583('0x1d')][_0x5583('0x6c')](this,_0x29712f['account_id']);if(!_0x22f87c||!_0x22f87c[_0x5583('0x18b')]){return this[_0x5583('0xb')][_0x5583('0x29')](_0x29712f,_0x5583('0x18c'));}var _0x70027f={'from':util[_0x5583('0x25')](_0x5583('0x18d'),_0x22f87c[_0x5583('0x12')],_0x22f87c[_0x5583('0x18e')]||_0x22f87c[_0x5583('0x18b')][_0x5583('0x18f')]),'to':_0x29712f['to']||'','cc':_0x29712f['cc']||'','bcc':_0x29712f[_0x5583('0x190')]||'','subject':_0x29712f[_0x5583('0x191')],'html':_0x29712f[_0x5583('0x58')],'text':_0x29712f[_0x5583('0x58')]};var _0x349290={'tls':{'rejectUnauthorized':![]}};if(_0x22f87c[_0x5583('0x18b')][_0x5583('0x192')]){_0x349290[_0x5583('0x192')]=_0x22f87c['Smtp'][_0x5583('0x192')];}else{_0x349290[_0x5583('0x193')]=_0x22f87c[_0x5583('0x18b')][_0x5583('0x193')];_0x349290['port']=_0x22f87c['Smtp']['port'];_0x349290['secure']=_0x22f87c['Smtp'][_0x5583('0x194')];}if(_0x22f87c[_0x5583('0x18b')][_0x5583('0x195')]){_0x349290[_0x5583('0x196')]={'user':_0x22f87c[_0x5583('0x18b')][_0x5583('0x18f')],'pass':_0x22f87c[_0x5583('0x18b')]['pass']};}if(this[_0x5583('0x81')](_0x29712f[_0x5583('0x197')])){}logger[_0x5583('0xde')]('sendMail\x20message',JSON[_0x5583('0x6f')](_0x70027f));this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x29712f,_0x29712f[_0x5583('0x189')]);this['channel'][_0x5583('0xad')](util[_0x5583('0x25')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x22f87c[_0x5583('0x12')]));this[_0x5583('0x1f')][_0x5583('0x6c')](this,_0x349290,_0x70027f);return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x198'));};AGIVertices[_0x5583('0xc')][_0x5583('0x199')]=function(_0x53fc7b){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x19a'),_0x53fc7b[_0x5583('0x34')]));return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x19b'));};AGIVertices['prototype'][_0x5583('0x19c')]=function(_0x1fb5cc){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x19d'),_0x1fb5cc['label']));if(!this['isConfigured'](_0x1fb5cc['sms_account_id'])){return this[_0x5583('0xb')][_0x5583('0xad')]('no\x20sms\x20account\x20configured');}var _0x2aebe7=this['getSmsAccount'][_0x5583('0x6c')](this,_0x1fb5cc[_0x5583('0x19e')]);if(!_0x2aebe7){return this['channel'][_0x5583('0x29')](_0x1fb5cc,_0x5583('0x19f'));}var _0x30b5dd={'body':_0x1fb5cc[_0x5583('0x1a0')],'phone':_0x1fb5cc['to']||'','SmsAccountId':_0x2aebe7['id']};logger[_0x5583('0xde')](_0x5583('0x1a1'),JSON[_0x5583('0x6f')](_0x30b5dd));this[_0x5583('0x32')]['sync'](this,_0x1fb5cc,_0x1fb5cc[_0x5583('0x19e')]);this['channel'][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x1a2'),_0x2aebe7[_0x5583('0x12')]));this[_0x5583('0x31')][_0x5583('0x6c')](this,_0x30b5dd);return this[_0x5583('0xb')]['noop'](_0x5583('0x1a3'));};AGIVertices['prototype']['set']=function(_0x42622f){logger['info'](util['format'](_0x5583('0x1a4'),_0x42622f[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x42622f['variable_id'])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x42622f,_0x5583('0x1a5'));}var _0x2971e5=this[_0x5583('0xd')][_0x5583('0x6c')](this,_0x42622f['variable_id']);if(!_0x2971e5){return this[_0x5583('0xb')][_0x5583('0x29')](_0x42622f,_0x5583('0x15f'));}return this['channel'][_0x5583('0x9f')](_0x2971e5,_0x42622f[_0x5583('0x1a6')]);};AGIVertices[_0x5583('0xc')][_0x5583('0x1a7')]=function(_0x354454){logger[_0x5583('0x2b')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x354454['label']));this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x1a8'));if(_0x354454[_0x5583('0xbb')]===_0x5583('0x1a9')){this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0x1aa'));return this[_0x5583('0xb')][_0x5583('0xbb')]();}return this['channel']['noop'](_0x5583('0x1ab'));};AGIVertices[_0x5583('0xc')][_0x5583('0x1ac')]=function(_0x334985){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x1ad'),_0x334985['label']));if(!this[_0x5583('0x81')](_0x334985[_0x5583('0x1ae')])){return this[_0x5583('0xb')]['error'](_0x334985,_0x5583('0x1af'));}var _0x2cc21d=this[_0x5583('0x14')][_0x5583('0x6c')](this,_0x334985['project_id']);if(!this['isConfigured'](_0x2cc21d)){return this[_0x5583('0xb')]['error'](_0x334985,util[_0x5583('0x25')](_0x5583('0x1b0'),_0x334985[_0x5583('0x1ae')]));}if(_0x2cc21d===this['channel'][_0x5583('0x36')]){return this['channel']['error'](_0x334985,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x334985,_0x2cc21d);var _0x51f526=this[_0x5583('0xb')][_0x5583('0xa8')]('AGI',util[_0x5583('0x25')](_0x5583('0x1b1'),config['agi'][_0x5583('0x193')]||_0x5583('0x1b2'),_0x2cc21d,this['channel'][_0x5583('0x36')]));if(_0x51f526[_0x5583('0xb0')]===-0x1){return _0x51f526;}return this[_0x5583('0xb')][_0x5583('0xad')](util['format']('Executed\x20command\x20%s\x20%s',_0x5583('0x1b3'),_0x2cc21d));};AGIVertices[_0x5583('0xc')][_0x5583('0x1b4')]=function(_0x5cd0d8){logger['info'](util[_0x5583('0x25')](_0x5583('0x1b5'),_0x5cd0d8[_0x5583('0x34')]));var _0xcc9cef=this[_0x5583('0x52')][_0x5583('0x6c')](this,_0x5cd0d8['command']);this[_0x5583('0x32')][_0x5583('0x6c')](this,_0x5cd0d8,_0x5cd0d8['command']);if(this[_0x5583('0x81')](_0x5cd0d8[_0x5583('0xd8')])){var _0x483812=this[_0x5583('0xd')]['sync'](this,_0x5cd0d8['variable_id']);if(_0x483812){this[_0x5583('0xb')][_0x5583('0x9f')](_0x483812,_0xcc9cef);return this['channel'][_0x5583('0xad')](util[_0x5583('0x25')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x5cd0d8[_0x5583('0xb8')],_0x483812));}}return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x1b6'),_0x5cd0d8[_0x5583('0xb8')]));};AGIVertices[_0x5583('0xc')][_0x5583('0x1b7')]=function(_0x37bb51){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x1b8'),_0x37bb51[_0x5583('0x34')]));_0x37bb51['text']=_0x37bb51[_0x5583('0x58')][_0x5583('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x37bb51[_0x5583('0x56')])){return this['channel']['noop'](_0x5583('0x1b9'));}if(!this[_0x5583('0x81')](_0x37bb51[_0x5583('0x58')])){return this[_0x5583('0xb')]['noop'](_0x5583('0xa7'));}this['channel'][_0x5583('0xad')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x37bb51[_0x5583('0x58')]));var _0x277491=this[_0x5583('0x55')][_0x5583('0x6c')](this,_0x37bb51);if(_0x277491){this[_0x5583('0xb')]['noop'](util['format'](_0x5583('0x1ba'),_0x277491));var _0x4d93b6=this['channel'][_0x5583('0x102')](_0x277491);try{fs[_0x5583('0x103')](_0x277491+_0x5583('0x1bb'));}catch(_0x19b919){logger['error'](_0x19b919);}return _0x4d93b6;}return this[_0x5583('0xb')][_0x5583('0x29')](_0x37bb51,_0x5583('0x1bc'));};AGIVertices[_0x5583('0xc')][_0x5583('0x1bd')]=function(_0x59499){logger['info'](util[_0x5583('0x25')](_0x5583('0x1be'),_0x59499[_0x5583('0x34')]));_0x59499[_0x5583('0x58')]=_0x59499[_0x5583('0x58')][_0x5583('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x59499[_0x5583('0x58')])){return this[_0x5583('0xb')][_0x5583('0xad')](_0x5583('0xa7'));}this['channel'][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0x1bf'),_0x59499[_0x5583('0x58')]));var _0xf0a76=this['googleTTS'][_0x5583('0x6c')](this,_0x59499);if(_0xf0a76){this[_0x5583('0xb')]['noop'](util[_0x5583('0x25')](_0x5583('0x1c0'),_0xf0a76));var _0x58ec03=this[_0x5583('0xb')][_0x5583('0x102')](_0xf0a76);try{fs[_0x5583('0x103')](_0xf0a76+'.wav');}catch(_0xb03a37){logger['error'](_0xb03a37);}return _0x58ec03;}return this[_0x5583('0xb')]['error'](_0x59499,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5583('0xc')]['unpause']=function(_0x42b8b5){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x1c1'),_0x42b8b5['label']));if(!this[_0x5583('0x81')](_0x42b8b5[_0x5583('0x152')])){return this[_0x5583('0xb')]['error'](_0x42b8b5,_0x5583('0x159'));}logger['info'](util[_0x5583('0x25')](_0x5583('0x153'),this[_0x5583('0xb')][_0x5583('0x37')],_0x42b8b5['findBy']));var _0x53c5e8=this['agentUnpause'][_0x5583('0x6c')](this,_0x42b8b5[_0x5583('0x152')]);if(_0x53c5e8){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x154'),this[_0x5583('0xb')][_0x5583('0x37')],_0x42b8b5[_0x5583('0x152')]));this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5583('0x37')],_0x42b8b5[_0x5583('0x152')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5583('0x25')](_0x5583('0x15a'),this[_0x5583('0xb')]['callerid'],_0x42b8b5[_0x5583('0x152')]));this[_0x5583('0xb')][_0x5583('0xad')](util['format'](_0x5583('0x15a'),this[_0x5583('0xb')]['callerid'],_0x42b8b5[_0x5583('0x152')]));return{'code':0xc8,'result':_0x5583('0x156')};}};AGIVertices[_0x5583('0xc')][_0x5583('0x1c2')]=function(_0x29871d){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x1c3'),_0x29871d[_0x5583('0x34')]));var _0x218c96=this[_0x5583('0xb')][_0x5583('0xa8')]('VOICEMAIL',[_0x29871d[_0x5583('0x1c4')],_0x29871d[_0x5583('0x74')]]);if(_0x218c96[_0x5583('0xb0')]===-0x1){return _0x218c96;}return this[_0x5583('0xb')][_0x5583('0xad')](util[_0x5583('0x25')](_0x5583('0xc5'),'VOICEMAIL',_0x29871d['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x2cab27){logger[_0x5583('0x2b')](util[_0x5583('0x25')](_0x5583('0x1c5'),_0x2cab27[_0x5583('0x34')]));if(!this[_0x5583('0x81')](_0x2cab27[_0x5583('0xd8')])){return this[_0x5583('0xb')][_0x5583('0x29')](_0x2cab27,_0x5583('0x1a5'));}var _0x32784d=this[_0x5583('0xd')]['sync'](this,_0x2cab27[_0x5583('0xd8')]);if(!_0x32784d){return this[_0x5583('0xb')][_0x5583('0x29')](_0x2cab27,_0x5583('0x15f'));}var _0x5a94bc=this[_0x5583('0xb')]['getVariable'](_0x32784d);return{'code':0xc8,'result':_0x5a94bc[_0x5583('0xa1')]?_0x5a94bc[_0x5583('0xa1')]:'-'};};String['prototype'][_0x5583('0x1c6')]=function(_0x1a96aa,_0x1449b8){return this[_0x5583('0xa0')](_0x1a96aa)['join'](_0x1449b8);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f0a06aa..b01abcf 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 _0x7326=['name','Action','QueuePause','then','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','catch','[%s][UPDATE][ERRORS:%s]','error','finally','[ACW][START]\x20%s','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x549e49,_0x94ee2f){var _0x53fdd3=function(_0x3a7710){while(--_0x3a7710){_0x549e49['push'](_0x549e49['shift']());}};_0x53fdd3(++_0x94ee2f);}(_0x7326,0x1c0));var _0x6732=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7326[_0x1eda20];return _0x31b953;};'use strict';var util=require('util');var _=require(_0x6732('0x0'));var moment=require(_0x6732('0x1'));var ami=require(_0x6732('0x2'));var logger=require('../../../config/logger')(_0x6732('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x6732('0x4'));function Acw(_0x5b4133){this[_0x6732('0x5')]=_0x5b4133[_0x6732('0x5')];this[_0x6732('0x6')]=_0x5b4133[_0x6732('0x6')];this[_0x6732('0x7')]=_0x5b4133['timers'];this[_0x6732('0x8')]={};ami['on'](_0x6732('0x9'),this[_0x6732('0xa')][_0x6732('0xb')](this));ami['on'](_0x6732('0xc'),this['syncHangupRequest'][_0x6732('0xb')](this));ami['on']('hangup',this['syncHangup'][_0x6732('0xb')](this));ami['on']('agentringnoanswer',this[_0x6732('0xd')][_0x6732('0xb')](this));ami['on'](_0x6732('0xe'),this[_0x6732('0xf')][_0x6732('0xb')](this));ami['on']('blindtransfer',this[_0x6732('0x10')][_0x6732('0xb')](this));ami['on'](_0x6732('0x11'),this[_0x6732('0x12')][_0x6732('0xb')](this));}function getDiff(_0x4dcd13){var _0x431604=moment()[_0x6732('0x13')](0x0);var _0xf4d489=moment(_0x4dcd13)[_0x6732('0x13')](0x0);return _0x431604['diff'](_0xf4d489,_0x6732('0x14'));}Acw[_0x6732('0x15')]['startAcw']=function(_0x2a4330){try{var _0x738dd8=this;var _0x3bba7e=this['channels'][_0x2a4330][_0x6732('0x16')];var _0x50fda8=this[_0x6732('0x8')][_0x2a4330]['queue'];var _0x3828c1=this[_0x6732('0x5')][_0x50fda8];var _0x3df9a7=![];var _0x4e60c4=_0x6732('0x17');if(_0x3828c1[_0x6732('0x18')]){if(_0x3828c1[_0x6732('0x19')][_0x6732('0x1a')]){_0x3df9a7=!![];_0x4e60c4=_0x3828c1[_0x6732('0x19')][_0x6732('0x1a')];}}ami[_0x6732('0x1b')]({'action':_0x6732('0x1c'),'interface':_0x3bba7e,'paused':!![],'reason':_0x4e60c4})[_0x6732('0x1d')](function(_0x17a6e6){if(_0x738dd8[_0x6732('0x6')][_0x3bba7e]){return RpcUser['getAgent'](_0x738dd8['agents'][_0x3bba7e]['id'])[_0x6732('0x1d')](function(_0x40957d){if(_0x40957d&&!_0x40957d['voicePause']){logger[_0x6732('0x1e')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2a4330,_0x3bba7e,_0x50fda8);var _0x19af33=_0x738dd8[_0x6732('0x8')][_0x2a4330][_0x6732('0x1f')]&&_0x738dd8[_0x6732('0x8')][_0x2a4330][_0x6732('0x20')]?_0x738dd8[_0x6732('0x8')][_0x2a4330][_0x6732('0x20')]:_0x2a4330;return RpcUser[_0x6732('0x21')](_0x738dd8[_0x6732('0x6')][_0x3bba7e],_0x4e60c4,_0x19af33)[_0x6732('0x1d')](function(_0x447d3f){if(!_0x3df9a7){_0x738dd8[_0x6732('0x7')][_0x3bba7e]={};logger[_0x6732('0x1e')](_0x6732('0x22'),_0x2a4330,_0x738dd8[_0x6732('0x5')][_0x50fda8][_0x6732('0x23')],_0x3bba7e,_0x50fda8);_0x738dd8[_0x6732('0x7')][_0x3bba7e][_0x6732('0x24')]=setTimeout(_0x738dd8[_0x6732('0x25')][_0x6732('0xb')](_0x738dd8,_0x3bba7e),_0x738dd8[_0x6732('0x5')][_0x50fda8][_0x6732('0x23')]*0x3e8);_0x738dd8['timers'][_0x3bba7e][_0x6732('0x26')]=moment()[_0x6732('0x27')](_0x6732('0x28'));_0x738dd8['timers'][_0x3bba7e][_0x6732('0x29')]=_0x2a4330;_0x738dd8[_0x6732('0x7')][_0x3bba7e][_0x6732('0x2a')]=_0x50fda8;_0x738dd8[_0x6732('0x7')][_0x3bba7e]['updateAcw']=function(){var _0x1193b7=getDiff(_0x738dd8[_0x6732('0x7')][_0x3bba7e][_0x6732('0x26')]);clearTimeout(_0x738dd8[_0x6732('0x7')][_0x3bba7e]['timer']);_0x738dd8[_0x6732('0x7')][_0x3bba7e][_0x6732('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x1193b7},_0x738dd8[_0x6732('0x7')][_0x3bba7e]['uniqueid'],_0x3bba7e)[_0x6732('0x1d')](function(_0x47a29c){logger[_0x6732('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x2a4330,_0x1193b7,_0x47a29c);})[_0x6732('0x2b')](function(_0x3254d1){logger['error'](_0x6732('0x2c'),_0x2a4330,_0x3254d1);});delete _0x738dd8[_0x6732('0x7')][_0x3bba7e];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2a4330,_0x3bba7e,_0x50fda8);}});}})['catch'](function(_0x328215){logger[_0x6732('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2a4330,_0x738dd8[_0x6732('0x5')][_0x50fda8]['acwTimeout'],_0x3bba7e,_0x50fda8);})[_0x6732('0x2e')](function(){delete _0x738dd8[_0x6732('0x8')][_0x2a4330];});}catch(_0x42db61){logger['error'](_0x6732('0x2f'),_0x42db61['message']);}};Acw[_0x6732('0x15')][_0x6732('0x25')]=function(_0x34a884){try{var _0x3541bf=this;if(_0x3541bf[_0x6732('0x7')][_0x34a884]){_0x3541bf[_0x6732('0x7')][_0x34a884][_0x6732('0x24')]=![];var _0x19aa53=_0x3541bf[_0x6732('0x7')][_0x34a884][_0x6732('0x29')];var _0x1b007d=_0x3541bf[_0x6732('0x7')][_0x34a884][_0x6732('0x2a')];var _0x2e0aad=_0x3541bf[_0x6732('0x5')][_0x1b007d]['acwTimeout'];logger[_0x6732('0x1e')]('[%s][TIMER][STOP][AGENT:%s]',_0x19aa53,_0x34a884);RpcUser[_0x6732('0x30')](this[_0x6732('0x6')][_0x34a884]);RpcVoiceAgentReport[_0x6732('0x31')]({'acwtime':_0x2e0aad,'agentacw':!![]},_0x19aa53,_0x34a884)['then'](function(_0x5ed4bc){logger[_0x6732('0x1e')](_0x6732('0x32'),_0x19aa53,_0x2e0aad,_0x5ed4bc);})['catch'](function(_0xb2e603){logger[_0x6732('0x2d')](_0x6732('0x2c'),_0x19aa53,_0xb2e603);});}else{logger[_0x6732('0x2d')](_0x6732('0x33'),_0x34a884);if(_0x3541bf[_0x6732('0x7')]){logger[_0x6732('0x1e')](_0x6732('0x34'),JSON[_0x6732('0x35')](_0x3541bf['timers']));}}}catch(_0x523a1b){logger['error'](_0x6732('0x36'),_0x523a1b[_0x6732('0x37')]);}};Acw[_0x6732('0x15')]['syncAgentConnect']=function(_0xe8620c){try{if(this[_0x6732('0x5')][_0xe8620c[_0x6732('0x2a')]]&&(this[_0x6732('0x5')][_0xe8620c[_0x6732('0x2a')]][_0x6732('0x3')]||this['voiceQueues'][_0xe8620c[_0x6732('0x2a')]]['mandatoryDisposition'])){if(this['agents'][_0xe8620c[_0x6732('0x16')]]){this[_0x6732('0x8')][_0xe8620c[_0x6732('0x29')]]={'queue':_0xe8620c[_0x6732('0x2a')],'interface':_0xe8620c[_0x6732('0x16')],'destlinkedid':_0xe8620c[_0x6732('0x20')]};}}}catch(_0x5da0a1){logger[_0x6732('0x2d')](_0x6732('0x38'),_0x5da0a1[_0x6732('0x37')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x49a21a){try{if(this[_0x6732('0x5')][_0x49a21a[_0x6732('0x2a')]]&&(this[_0x6732('0x5')][_0x49a21a[_0x6732('0x2a')]][_0x6732('0x3')]||this[_0x6732('0x5')][_0x49a21a[_0x6732('0x2a')]]['mandatoryDisposition'])){if(this[_0x6732('0x6')][_0x49a21a[_0x6732('0x16')]]){this[_0x6732('0x8')][_0x49a21a[_0x6732('0x29')]]={'queue':_0x49a21a[_0x6732('0x2a')],'interface':_0x49a21a[_0x6732('0x16')]};}}}catch(_0x4624be){logger[_0x6732('0x2d')](_0x6732('0x39'),_0x4624be['message']);}};Acw['prototype']['syncHangupRequest']=function(_0x4be6ce){try{if(this[_0x6732('0x8')][_0x4be6ce['uniqueid']]&&_[_0x6732('0x3a')](this['channels'][_0x4be6ce[_0x6732('0x29')]][_0x6732('0x1f')])){logger[_0x6732('0x1e')](_0x6732('0x3b'),_0x4be6ce[_0x6732('0x29')]);this['startAcw'](_0x4be6ce[_0x6732('0x29')]);}else if(this[_0x6732('0x8')][_0x4be6ce[_0x6732('0x3c')]]&&_[_0x6732('0x3a')](this['channels'][_0x4be6ce['linkedid']][_0x6732('0x1f')])){logger[_0x6732('0x1e')]('[%s][HANGUP:LINKEDID]',_0x4be6ce[_0x6732('0x3c')]);this[_0x6732('0x3d')](_0x4be6ce[_0x6732('0x3c')]);}}catch(_0x2a626c){logger[_0x6732('0x2d')](_0x6732('0x3e'),_0x2a626c[_0x6732('0x37')]);}};Acw['prototype']['syncHangup']=function(_0xadc78e){try{if(this['channels'][_0xadc78e[_0x6732('0x29')]]&&this[_0x6732('0x8')][_0xadc78e[_0x6732('0x29')]][_0x6732('0x1f')]){logger[_0x6732('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0xadc78e[_0x6732('0x29')]);this[_0x6732('0x3d')](_0xadc78e[_0x6732('0x29')]);}else if(this[_0x6732('0x8')][_0xadc78e[_0x6732('0x3c')]]&&this[_0x6732('0x8')][_0xadc78e[_0x6732('0x3c')]][_0x6732('0x1f')]){logger[_0x6732('0x1e')](_0x6732('0x3f'),_0xadc78e[_0x6732('0x3c')]);this['startAcw'](_0xadc78e[_0x6732('0x3c')]);}}catch(_0x4e2ba3){logger['error'](_0x6732('0x40'),_0x4e2ba3[_0x6732('0x37')]);}};Acw[_0x6732('0x15')]['syncAttendedTransfer']=function(_0x584ebc){try{if(!_[_0x6732('0x41')](this[_0x6732('0x8')][_0x584ebc['transfereeuniqueid']])){this[_0x6732('0x3d')](_0x584ebc[_0x6732('0x42')]);if(this[_0x6732('0x8')][_0x584ebc['secondtransfereruniqueid']]){this['channels'][_0x584ebc[_0x6732('0x43')]]['attended']=!![];this[_0x6732('0x8')][_0x584ebc[_0x6732('0x44')]]=this[_0x6732('0x8')][_0x584ebc[_0x6732('0x43')]];delete this['channels'][_0x584ebc['secondtransfereruniqueid']];}}else if(!_['isNil'](this['channels'][_0x584ebc[_0x6732('0x44')]])){this[_0x6732('0x3d')](_0x584ebc[_0x6732('0x44')]);if(this['channels'][_0x584ebc[_0x6732('0x45')]]){this[_0x6732('0x8')][_0x584ebc[_0x6732('0x45')]][_0x6732('0x1f')]=!![];this[_0x6732('0x8')][_0x584ebc[_0x6732('0x42')]]=this[_0x6732('0x8')][_0x584ebc[_0x6732('0x45')]];delete this[_0x6732('0x8')][_0x584ebc['origtransfereruniqueid']];}}}catch(_0x579db3){logger[_0x6732('0x2d')](_0x6732('0x46'),_0x579db3[_0x6732('0x37')]);}};Acw['prototype']['syncBlindTransfer']=function(_0xe138c2){try{if(this['channels'][_0xe138c2[_0x6732('0x47')]]){logger[_0x6732('0x1e')](_0x6732('0x48'),JSON[_0x6732('0x35')](_0xe138c2[_0x6732('0x47')]));this['startAcw'](_0xe138c2[_0x6732('0x47')]);}else if(this[_0x6732('0x8')][_0xe138c2[_0x6732('0x49')]]){logger[_0x6732('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x6732('0x35')](_0xe138c2[_0x6732('0x49')]));this['startAcw'](_0xe138c2[_0x6732('0x49')]);}}catch(_0x35b284){logger[_0x6732('0x2d')](_0x6732('0x4a'),_0x35b284[_0x6732('0x37')]);}};Acw[_0x6732('0x15')][_0x6732('0xd')]=function(_0x4e93be){try{if(this[_0x6732('0x5')][_0x4e93be[_0x6732('0x2a')]]&&this[_0x6732('0x5')][_0x4e93be['queue']][_0x6732('0x4b')]===_0x6732('0x4c')){if(this[_0x6732('0x6')][_0x4e93be['interface']]){logger['info'](_0x6732('0x4d'),_0x4e93be[_0x6732('0x29')],_0x4e93be[_0x6732('0x16')],_0x4e93be['queue']);return RpcUser[_0x6732('0x21')](this['agents'][_0x4e93be[_0x6732('0x16')]],'Auto-Pause',_0x4e93be[_0x6732('0x29')]);}}}catch(_0x155d0d){logger['error'](_0x6732('0x4e'),_0x155d0d[_0x6732('0x37')]);}};module['exports']=Acw; \ No newline at end of file +var _0xb471=['origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','interface','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','secondtransfereruniqueid','transfertargetuniqueid','isNil'];(function(_0x2feac6,_0x13eb8b){var _0x55fbe1=function(_0x2db96e){while(--_0x2db96e){_0x2feac6['push'](_0x2feac6['shift']());}};_0x55fbe1(++_0x13eb8b);}(_0xb471,0x165));var _0x1b47=function(_0x11feb8,_0xcd43f8){_0x11feb8=_0x11feb8-0x0;var _0x418b84=_0xb471[_0x11feb8];return _0x418b84;};'use strict';var util=require(_0x1b47('0x0'));var _=require(_0x1b47('0x1'));var moment=require('moment');var ami=require(_0x1b47('0x2'));var logger=require(_0x1b47('0x3'))(_0x1b47('0x4'));var RpcUser=require(_0x1b47('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x440914){this[_0x1b47('0x6')]=_0x440914[_0x1b47('0x6')];this[_0x1b47('0x7')]=_0x440914[_0x1b47('0x7')];this[_0x1b47('0x8')]=_0x440914[_0x1b47('0x8')];this[_0x1b47('0x9')]={};ami['on'](_0x1b47('0xa'),this[_0x1b47('0xb')][_0x1b47('0xc')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x1b47('0xc')](this));ami['on']('hangup',this[_0x1b47('0xd')][_0x1b47('0xc')](this));ami['on'](_0x1b47('0xe'),this[_0x1b47('0xf')]['bind'](this));ami['on']('attendedtransfer',this[_0x1b47('0x10')]['bind'](this));ami['on'](_0x1b47('0x11'),this[_0x1b47('0x12')][_0x1b47('0xc')](this));ami['on'](_0x1b47('0x13'),this[_0x1b47('0x14')][_0x1b47('0xc')](this));}function getDiff(_0x12ca99){var _0x24f7e7=moment()[_0x1b47('0x15')](0x0);var _0x163593=moment(_0x12ca99)['milliseconds'](0x0);return _0x24f7e7[_0x1b47('0x16')](_0x163593,_0x1b47('0x17'));}Acw[_0x1b47('0x18')][_0x1b47('0x19')]=function(_0x1497b9){try{var _0x2fd6a9=this;var _0xaf948=this['channels'][_0x1497b9]['interface'];var _0x3a15d9=this[_0x1b47('0x9')][_0x1497b9][_0x1b47('0x1a')];var _0xd0a509=this[_0x1b47('0x6')][_0x3a15d9];var _0x52dc2c=![];var _0x48867d=_0x1b47('0x1b');if(_0xd0a509[_0x1b47('0x1c')]){if(_0xd0a509[_0x1b47('0x1d')][_0x1b47('0x1e')]){_0x52dc2c=!![];_0x48867d=_0xd0a509[_0x1b47('0x1d')][_0x1b47('0x1e')];}}ami['Action']({'action':_0x1b47('0x1f'),'interface':_0xaf948,'paused':!![],'reason':_0x48867d})[_0x1b47('0x20')](function(_0x439964){if(_0x2fd6a9[_0x1b47('0x7')][_0xaf948]){return RpcUser[_0x1b47('0x21')](_0x2fd6a9[_0x1b47('0x7')][_0xaf948]['id'])[_0x1b47('0x20')](function(_0x269fe4){if(_0x269fe4&&!_0x269fe4[_0x1b47('0x22')]){logger[_0x1b47('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x1497b9,_0xaf948,_0x3a15d9);var _0x578c20=_0x2fd6a9[_0x1b47('0x9')][_0x1497b9][_0x1b47('0x24')]&&_0x2fd6a9[_0x1b47('0x9')][_0x1497b9][_0x1b47('0x25')]?_0x2fd6a9[_0x1b47('0x9')][_0x1497b9][_0x1b47('0x25')]:_0x1497b9;return RpcUser['savePause'](_0x2fd6a9[_0x1b47('0x7')][_0xaf948],_0x48867d,_0x578c20)[_0x1b47('0x20')](function(_0x437de2){if(!_0x52dc2c){_0x2fd6a9['timers'][_0xaf948]={};logger[_0x1b47('0x23')](_0x1b47('0x26'),_0x1497b9,_0x2fd6a9['voiceQueues'][_0x3a15d9]['acwTimeout'],_0xaf948,_0x3a15d9);_0x2fd6a9[_0x1b47('0x8')][_0xaf948][_0x1b47('0x27')]=setTimeout(_0x2fd6a9[_0x1b47('0x28')][_0x1b47('0xc')](_0x2fd6a9,_0xaf948),_0x2fd6a9['voiceQueues'][_0x3a15d9][_0x1b47('0x29')]*0x3e8);_0x2fd6a9['timers'][_0xaf948][_0x1b47('0x2a')]=moment()[_0x1b47('0x2b')](_0x1b47('0x2c'));_0x2fd6a9[_0x1b47('0x8')][_0xaf948]['uniqueid']=_0x1497b9;_0x2fd6a9['timers'][_0xaf948][_0x1b47('0x1a')]=_0x3a15d9;_0x2fd6a9[_0x1b47('0x8')][_0xaf948][_0x1b47('0x2d')]=function(){var _0x96e667=getDiff(_0x2fd6a9[_0x1b47('0x8')][_0xaf948][_0x1b47('0x2a')]);clearTimeout(_0x2fd6a9['timers'][_0xaf948][_0x1b47('0x27')]);_0x2fd6a9[_0x1b47('0x8')][_0xaf948][_0x1b47('0x27')]=![];RpcVoiceAgentReport[_0x1b47('0x2e')]({'acwtime':_0x96e667},_0x2fd6a9[_0x1b47('0x8')][_0xaf948][_0x1b47('0x2f')],_0xaf948)[_0x1b47('0x20')](function(_0x17f4fd){logger['info'](_0x1b47('0x30'),_0x1497b9,_0x96e667,_0x17f4fd);})['catch'](function(_0xfc5014){logger[_0x1b47('0x31')](_0x1b47('0x32'),_0x1497b9,_0xfc5014);});delete _0x2fd6a9[_0x1b47('0x8')][_0xaf948];};}});}else{logger[_0x1b47('0x23')](_0x1b47('0x33'),_0x1497b9,_0xaf948,_0x3a15d9);}});}})[_0x1b47('0x34')](function(_0x4488bd){logger['error'](_0x1b47('0x26'),_0x1497b9,_0x2fd6a9[_0x1b47('0x6')][_0x3a15d9]['acwTimeout'],_0xaf948,_0x3a15d9);})[_0x1b47('0x35')](function(){delete _0x2fd6a9['channels'][_0x1497b9];});}catch(_0x415203){logger[_0x1b47('0x31')](_0x1b47('0x36'),_0x415203[_0x1b47('0x37')]);}};Acw[_0x1b47('0x18')][_0x1b47('0x28')]=function(_0x2ef87c){try{var _0x581f83=this;if(_0x581f83[_0x1b47('0x8')][_0x2ef87c]){_0x581f83['timers'][_0x2ef87c][_0x1b47('0x27')]=![];var _0x156eda=_0x581f83[_0x1b47('0x8')][_0x2ef87c][_0x1b47('0x2f')];var _0x1d61f2=_0x581f83['timers'][_0x2ef87c][_0x1b47('0x1a')];var _0x1c86ed=_0x581f83[_0x1b47('0x6')][_0x1d61f2][_0x1b47('0x29')];logger[_0x1b47('0x23')](_0x1b47('0x38'),_0x156eda,_0x2ef87c);RpcUser[_0x1b47('0x39')](this[_0x1b47('0x7')][_0x2ef87c]);RpcVoiceAgentReport[_0x1b47('0x2e')]({'acwtime':_0x1c86ed,'agentacw':!![]},_0x156eda,_0x2ef87c)['then'](function(_0x20c422){logger[_0x1b47('0x23')](_0x1b47('0x30'),_0x156eda,_0x1c86ed,_0x20c422);})[_0x1b47('0x34')](function(_0x3a339a){logger['error'](_0x1b47('0x32'),_0x156eda,_0x3a339a);});}else{logger[_0x1b47('0x31')](_0x1b47('0x3a'),_0x2ef87c);if(_0x581f83[_0x1b47('0x8')]){logger[_0x1b47('0x23')]('[ACW][TIMERS]',JSON[_0x1b47('0x3b')](_0x581f83['timers']));}}}catch(_0x15b3e4){logger['error']('[ACW][STOP]\x20%s',_0x15b3e4[_0x1b47('0x37')]);}};Acw[_0x1b47('0x18')][_0x1b47('0xb')]=function(_0x580948){try{if(this[_0x1b47('0x6')][_0x580948[_0x1b47('0x1a')]]&&(this['voiceQueues'][_0x580948[_0x1b47('0x1a')]][_0x1b47('0x4')]||this[_0x1b47('0x6')][_0x580948[_0x1b47('0x1a')]][_0x1b47('0x1c')])){if(this[_0x1b47('0x7')][_0x580948[_0x1b47('0x3c')]]){this[_0x1b47('0x9')][_0x580948[_0x1b47('0x2f')]]={'queue':_0x580948['queue'],'interface':_0x580948['interface'],'destlinkedid':_0x580948[_0x1b47('0x25')]};}}}catch(_0x4aa7c5){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x4aa7c5[_0x1b47('0x37')]);}};Acw[_0x1b47('0x18')][_0x1b47('0x14')]=function(_0x2c943c){try{if(this[_0x1b47('0x6')][_0x2c943c[_0x1b47('0x1a')]]&&(this['voiceQueues'][_0x2c943c['queue']][_0x1b47('0x4')]||this[_0x1b47('0x6')][_0x2c943c[_0x1b47('0x1a')]][_0x1b47('0x1c')])){if(this['agents'][_0x2c943c['interface']]){this[_0x1b47('0x9')][_0x2c943c['uniqueid']]={'queue':_0x2c943c[_0x1b47('0x1a')],'interface':_0x2c943c[_0x1b47('0x3c')]};}}}catch(_0x3717df){logger['error'](_0x1b47('0x3d'),_0x3717df[_0x1b47('0x37')]);}};Acw['prototype'][_0x1b47('0x3e')]=function(_0x18bd96){try{if(this[_0x1b47('0x9')][_0x18bd96[_0x1b47('0x2f')]]&&_[_0x1b47('0x3f')](this[_0x1b47('0x9')][_0x18bd96[_0x1b47('0x2f')]][_0x1b47('0x24')])){logger['info'](_0x1b47('0x40'),_0x18bd96['uniqueid']);this[_0x1b47('0x19')](_0x18bd96[_0x1b47('0x2f')]);}else if(this['channels'][_0x18bd96[_0x1b47('0x41')]]&&_[_0x1b47('0x3f')](this[_0x1b47('0x9')][_0x18bd96['linkedid']][_0x1b47('0x24')])){logger[_0x1b47('0x23')]('[%s][HANGUP:LINKEDID]',_0x18bd96[_0x1b47('0x41')]);this[_0x1b47('0x19')](_0x18bd96[_0x1b47('0x41')]);}}catch(_0x579cbe){logger['error'](_0x1b47('0x42'),_0x579cbe[_0x1b47('0x37')]);}};Acw['prototype'][_0x1b47('0xd')]=function(_0x5277ac){try{if(this[_0x1b47('0x9')][_0x5277ac[_0x1b47('0x2f')]]&&this[_0x1b47('0x9')][_0x5277ac[_0x1b47('0x2f')]][_0x1b47('0x24')]){logger[_0x1b47('0x23')](_0x1b47('0x43'),_0x5277ac['uniqueid']);this[_0x1b47('0x19')](_0x5277ac[_0x1b47('0x2f')]);}else if(this[_0x1b47('0x9')][_0x5277ac['linkedid']]&&this[_0x1b47('0x9')][_0x5277ac[_0x1b47('0x41')]][_0x1b47('0x24')]){logger[_0x1b47('0x23')](_0x1b47('0x44'),_0x5277ac['linkedid']);this[_0x1b47('0x19')](_0x5277ac[_0x1b47('0x41')]);}}catch(_0x43711b){logger[_0x1b47('0x31')](_0x1b47('0x45'),_0x43711b[_0x1b47('0x37')]);}};Acw[_0x1b47('0x18')][_0x1b47('0x10')]=function(_0x5e8cac){try{if(!_['isNil'](this['channels'][_0x5e8cac['transfereeuniqueid']])){this[_0x1b47('0x19')](_0x5e8cac['transfereeuniqueid']);if(this['channels'][_0x5e8cac['secondtransfereruniqueid']]){this[_0x1b47('0x9')][_0x5e8cac[_0x1b47('0x46')]][_0x1b47('0x24')]=!![];this[_0x1b47('0x9')][_0x5e8cac[_0x1b47('0x47')]]=this[_0x1b47('0x9')][_0x5e8cac[_0x1b47('0x46')]];delete this['channels'][_0x5e8cac[_0x1b47('0x46')]];}}else if(!_[_0x1b47('0x48')](this['channels'][_0x5e8cac[_0x1b47('0x47')]])){this[_0x1b47('0x19')](_0x5e8cac[_0x1b47('0x47')]);if(this['channels'][_0x5e8cac[_0x1b47('0x49')]]){this[_0x1b47('0x9')][_0x5e8cac['origtransfereruniqueid']][_0x1b47('0x24')]=!![];this[_0x1b47('0x9')][_0x5e8cac[_0x1b47('0x4a')]]=this[_0x1b47('0x9')][_0x5e8cac[_0x1b47('0x49')]];delete this[_0x1b47('0x9')][_0x5e8cac[_0x1b47('0x49')]];}}}catch(_0x3e717b){logger[_0x1b47('0x31')](_0x1b47('0x4b'),_0x3e717b[_0x1b47('0x37')]);}};Acw[_0x1b47('0x18')][_0x1b47('0x12')]=function(_0x3fd35c){try{if(this[_0x1b47('0x9')][_0x3fd35c['transfereruniqueid']]){logger['info'](_0x1b47('0x4c'),JSON['stringify'](_0x3fd35c[_0x1b47('0x4d')]));this[_0x1b47('0x19')](_0x3fd35c['transfereruniqueid']);}else if(this[_0x1b47('0x9')][_0x3fd35c['transfererlinkedid']]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x1b47('0x3b')](_0x3fd35c[_0x1b47('0x4e')]));this['startAcw'](_0x3fd35c[_0x1b47('0x4e')]);}}catch(_0x8ca7ea){logger[_0x1b47('0x31')](_0x1b47('0x4f'),_0x8ca7ea[_0x1b47('0x37')]);}};Acw[_0x1b47('0x18')][_0x1b47('0xf')]=function(_0x15b952){try{if(this[_0x1b47('0x6')][_0x15b952[_0x1b47('0x1a')]]&&this[_0x1b47('0x6')][_0x15b952[_0x1b47('0x1a')]][_0x1b47('0x50')]===_0x1b47('0x51')){if(this[_0x1b47('0x7')][_0x15b952['interface']]){logger[_0x1b47('0x23')](_0x1b47('0x52'),_0x15b952[_0x1b47('0x2f')],_0x15b952[_0x1b47('0x3c')],_0x15b952[_0x1b47('0x1a')]);return RpcUser[_0x1b47('0x53')](this[_0x1b47('0x7')][_0x15b952[_0x1b47('0x3c')]],_0x1b47('0x54'),_0x15b952['uniqueid']);}}}catch(_0x5a7529){logger[_0x1b47('0x31')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x5a7529['message']);}};module[_0x1b47('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 9e151db..c279e32 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 _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x599951,_0x1980fc){var _0x2eee8b=function(_0x5d503d){while(--_0x5d503d){_0x599951['push'](_0x599951['shift']());}};_0x2eee8b(++_0x1980fc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2032,0xd9));var _0x2203=function(_0x3b8d7f,_0x2100b9){_0x3b8d7f=_0x3b8d7f-0x0;var _0x277ae0=_0x2032[_0x3b8d7f];return _0x277ae0;};'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 diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 6cf7ae6..c3a4598 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0xa7662e,_0x22304d){var _0x425053=function(_0x3e24a6){while(--_0x3e24a6){_0xa7662e['push'](_0xa7662e['shift']());}};_0x425053(++_0x22304d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x494bb8,_0x3fe6be){_0x494bb8=_0x494bb8-0x0;var _0x3ddcf3=_0x9bde[_0x494bb8];return _0x3ddcf3;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client; \ No newline at end of file +var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x4992db,_0x10fb7b){var _0x3c0b85=function(_0x21092d){while(--_0x21092d){_0x4992db['push'](_0x4992db['shift']());}};_0x3c0b85(++_0x10fb7b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index dbf54b4..4471753 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 _0x05ad=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','dialCutDigit','prototype','getQueue','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x121336,_0x3370ea){var _0x53ff9f=function(_0x4482fe){while(--_0x4482fe){_0x121336['push'](_0x121336['shift']());}};_0x53ff9f(++_0x3370ea);}(_0x05ad,0x12d));var _0xd05a=function(_0x43a38c,_0x1f5c60){_0x43a38c=_0x43a38c-0x0;var _0x20b8aa=_0x05ad[_0x43a38c];return _0x20b8aa;};'use strict';var util=require(_0xd05a('0x0'));var _=require(_0xd05a('0x1'));var moment=require(_0xd05a('0x2'));function checkNameSurname(_0x170d13,_0x1e786a,_0x26169f){var _0x8ccded='';if(!_[_0xd05a('0x3')](_0x1e786a)&&_0xd05a('0x4')===typeof _0x1e786a){_0x8ccded+=_0x1e786a;}if(!_[_0xd05a('0x3')](_0x26169f)&&_0xd05a('0x4')===typeof _0x26169f){_0x8ccded+='\x20'+_0x26169f;}if(_0x8ccded!==''){return _0x8ccded;}return _0x170d13;}function Action(_0x1ab98e,_0x28bb2d,_0x4954f5){this[_0xd05a('0x5')]=_0x1ab98e;this[_0xd05a('0x6')]=_0x4954f5||undefined;this[_0xd05a('0x7')]=checkNameSurname(_0x28bb2d[_0xd05a('0x8')][_0xd05a('0x9')],_0x28bb2d[_0xd05a('0x8')][_0xd05a('0xa')],_0x28bb2d[_0xd05a('0x8')][_0xd05a('0xb')]);this[_0xd05a('0xc')]=_0x28bb2d['Contact']['phone'];this['queue']=_0x1ab98e['name'];this[_0xd05a('0xd')]=_0x28bb2d[_0xd05a('0xd')]||![];this['type']=_0x1ab98e[_0xd05a('0xe')];this['dialQueueTimeout']=_0x1ab98e[_0xd05a('0xf')]||0x3;this[_0xd05a('0x10')]=_0x28bb2d[_0xd05a('0x10')];this[_0xd05a('0x11')]=_0x28bb2d['countbusyretry'];this[_0xd05a('0x12')]=_0x28bb2d[_0xd05a('0x12')];this[_0xd05a('0x13')]=_0x28bb2d[_0xd05a('0x13')];this[_0xd05a('0x14')]=_0x28bb2d[_0xd05a('0x14')];this[_0xd05a('0x15')]=_0x28bb2d[_0xd05a('0x15')];this[_0xd05a('0x16')]=_0x28bb2d['countabandonedretry'];this[_0xd05a('0x17')]=_0x28bb2d[_0xd05a('0x17')];this[_0xd05a('0x18')]=_0x28bb2d['countagentrejectretry'];this[_0xd05a('0x19')]=_0x28bb2d[_0xd05a('0x19')];this[_0xd05a('0x1a')]=_0x28bb2d[_0xd05a('0x1a')];this[_0xd05a('0x1b')]=_0x28bb2d['UserId'];this[_0xd05a('0x1c')]=_0x28bb2d[_0xd05a('0x1c')];this[_0xd05a('0x1d')]=_0x28bb2d[_0xd05a('0x1d')];this[_0xd05a('0x1e')]=_0x28bb2d['id'];this[_0xd05a('0x1f')]=_0x28bb2d[_0xd05a('0x8')][_0xd05a('0xa')]||'';this[_0xd05a('0x20')]=moment()[_0xd05a('0x21')](_0xd05a('0x22'));this[_0xd05a('0x23')]=_0x28bb2d[_0xd05a('0x23')];this['callbackuniqueid']=_0x28bb2d['callbackuniqueid'];this[_0xd05a('0x24')]=_0x28bb2d[_0xd05a('0x24')];this[_0xd05a('0x25')]=_0x28bb2d[_0xd05a('0x25')];this[_0xd05a('0x26')]='';this[_0xd05a('0x27')]='';}Action['prototype']['getCaller']=function(){return util[_0xd05a('0x21')](_0xd05a('0x28'),this['name'],this['voiceQueue'][_0xd05a('0x29')]>0x0?this[_0xd05a('0xc')]['substring'](this[_0xd05a('0x5')]['dialCutDigit']):this[_0xd05a('0xc')]);};Action[_0xd05a('0x2a')][_0xd05a('0x2b')]=function(){return this[_0xd05a('0x2c')];};module[_0xd05a('0x2d')]=Action; \ No newline at end of file +var _0x4535=['idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util','moment','string','isNil','voiceQueue','uniqueid','phone','Contact','firstName','lastName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x450230,_0x44c879){var _0x33d919=function(_0x156221){while(--_0x156221){_0x450230['push'](_0x450230['shift']());}};_0x33d919(++_0x44c879);}(_0x4535,0x111));var _0x5453=function(_0x3bbd60,_0x4c4157){_0x3bbd60=_0x3bbd60-0x0;var _0x51a512=_0x4535[_0x3bbd60];return _0x51a512;};'use strict';var util=require(_0x5453('0x0'));var _=require('lodash');var moment=require(_0x5453('0x1'));function checkNameSurname(_0x4cc8cc,_0x46a150,_0xd6f2d8){var _0x14315f='';if(!_['isNil'](_0x46a150)&&_0x5453('0x2')===typeof _0x46a150){_0x14315f+=_0x46a150;}if(!_[_0x5453('0x3')](_0xd6f2d8)&&'string'===typeof _0xd6f2d8){_0x14315f+='\x20'+_0xd6f2d8;}if(_0x14315f!==''){return _0x14315f;}return _0x4cc8cc;}function Action(_0x5981c5,_0x2c1950,_0x5601f5){this[_0x5453('0x4')]=_0x5981c5;this[_0x5453('0x5')]=_0x5601f5||undefined;this['name']=checkNameSurname(_0x2c1950['Contact'][_0x5453('0x6')],_0x2c1950[_0x5453('0x7')][_0x5453('0x8')],_0x2c1950[_0x5453('0x7')][_0x5453('0x9')]);this[_0x5453('0xa')]=_0x2c1950[_0x5453('0x7')][_0x5453('0x6')];this['queue']=_0x5981c5[_0x5453('0xb')];this[_0x5453('0xc')]=_0x2c1950['active']||![];this[_0x5453('0xd')]=_0x5981c5[_0x5453('0xd')];this[_0x5453('0xe')]=_0x5981c5['dialQueueTimeout']||0x3;this[_0x5453('0xf')]=_0x2c1950[_0x5453('0xf')];this[_0x5453('0x10')]=_0x2c1950['countbusyretry'];this['countcongestionretry']=_0x2c1950[_0x5453('0x11')];this[_0x5453('0x12')]=_0x2c1950['countnoanswerretry'];this[_0x5453('0x13')]=_0x2c1950[_0x5453('0x13')];this[_0x5453('0x14')]=_0x2c1950['countdropretry'];this[_0x5453('0x15')]=_0x2c1950[_0x5453('0x15')];this[_0x5453('0x16')]=_0x2c1950[_0x5453('0x16')];this['countagentrejectretry']=_0x2c1950['countagentrejectretry'];this[_0x5453('0x17')]=_0x2c1950['ContactId'];this['ListId']=_0x2c1950[_0x5453('0x18')];this[_0x5453('0x19')]=_0x2c1950[_0x5453('0x19')];this[_0x5453('0x1a')]=_0x2c1950[_0x5453('0x1a')];this[_0x5453('0x1b')]=_0x2c1950[_0x5453('0x1b')];this[_0x5453('0x1c')]=_0x2c1950['id'];this['ContactFirstName']=_0x2c1950['Contact'][_0x5453('0x8')]||'';this[_0x5453('0x1d')]=moment()[_0x5453('0x1e')](_0x5453('0x1f'));this[_0x5453('0x20')]=_0x2c1950['callback'];this[_0x5453('0x21')]=_0x2c1950['callbackuniqueid'];this[_0x5453('0x22')]=_0x2c1950[_0x5453('0x22')];this[_0x5453('0x23')]=_0x2c1950[_0x5453('0x23')];this[_0x5453('0x24')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x5453('0x1e')](_0x5453('0x25'),this[_0x5453('0xb')],this[_0x5453('0x4')][_0x5453('0x26')]>0x0?this[_0x5453('0xa')][_0x5453('0x27')](this[_0x5453('0x4')]['dialCutDigit']):this[_0x5453('0xa')]);};Action['prototype'][_0x5453('0x28')]=function(){return this[_0x5453('0x29')];};module[_0x5453('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 2ad0ef1..e72add6 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 _0x8f79=['originatecalleridname','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x35fee9,_0x1a9494){var _0x54680c=function(_0x1ca9b4){while(--_0x1ca9b4){_0x35fee9['push'](_0x35fee9['shift']());}};_0x54680c(++_0x1a9494);}(_0x8f79,0x149));var _0x98f7=function(_0x1bb565,_0x40a53b){_0x1bb565=_0x1bb565-0x0;var _0x2f96c0=_0x8f79[_0x1bb565];return _0x2f96c0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x144743,_0x1b43e3){var _0x173e04=moment(_0x144743)[_0x98f7('0x0')](0x0);var _0x4e956f=moment(_0x1b43e3)[_0x98f7('0x0')](0x0);return _0x173e04['diff'](_0x4e956f,_0x98f7('0x1'));}function AgentComplete(_0x375eab,_0x2e063d){this[_0x98f7('0x2')]=0x4;this[_0x98f7('0x3')]=_0x98f7('0x4');this[_0x98f7('0x5')]=_0x375eab[_0x98f7('0x5')];this[_0x98f7('0x6')]=_0x375eab[_0x98f7('0x6')];this['campaigntype']=_0x375eab[_0x98f7('0x6')]===_0x98f7('0x7')?'queue':_0x375eab[_0x98f7('0x6')];this['countbusyretry']=_0x375eab[_0x98f7('0x8')];this[_0x98f7('0x9')]=_0x375eab['countcongestionretry'];this[_0x98f7('0xa')]=_0x375eab[_0x98f7('0xa')];this[_0x98f7('0xb')]=_0x375eab['countbusyretry']+_0x375eab[_0x98f7('0x9')]+_0x375eab['countnoanswerretry']+_0x375eab[_0x98f7('0xc')]+_0x375eab['countdropretry']+_0x375eab[_0x98f7('0xd')]+_0x375eab['countmachineretry']+_0x375eab['countagentrejectretry'];this['countnosuchnumberretry']=_0x375eab['countnosuchnumberretry'];this['countdropretry']=_0x375eab[_0x98f7('0xe')];this['countabandonedretry']=_0x375eab[_0x98f7('0xd')];this[_0x98f7('0xf')]=_0x375eab[_0x98f7('0xf')];this[_0x98f7('0x10')]=_0x375eab[_0x98f7('0x10')];this[_0x98f7('0x11')]=_0x2e063d['uniqueid'];this['calleridname']=_0x375eab[_0x98f7('0x12')];this[_0x98f7('0x13')]=_0x375eab['number'];this[_0x98f7('0x14')]=_0x375eab[_0x98f7('0x14')];this[_0x98f7('0x15')]=_0x375eab[_0x98f7('0x15')];this['answertime']=_0x375eab[_0x98f7('0x16')];this[_0x98f7('0x17')]=moment()[_0x98f7('0x18')](_0x98f7('0x19'));this[_0x98f7('0x1a')]=getSeconds(_0x375eab[_0x98f7('0x15')],_0x375eab[_0x98f7('0x14')]);this[_0x98f7('0x1b')]=getSeconds(_0x375eab[_0x98f7('0x16')],_0x375eab[_0x98f7('0x15')]);this['talktime']=getSeconds(this[_0x98f7('0x17')],_0x375eab['answertime']);this['queue']=_0x2e063d[_0x98f7('0x1c')];this['membername']=_0x2e063d[_0x98f7('0x1d')];this[_0x98f7('0x1e')]=_0x2e063d[_0x98f7('0x1e')];this[_0x98f7('0x1f')]=_0x375eab[_0x98f7('0x1f')];this[_0x98f7('0x20')]=_0x375eab['callbackuniqueid'];this[_0x98f7('0x21')]=_0x375eab[_0x98f7('0x21')];this[_0x98f7('0x22')]=_0x375eab[_0x98f7('0x22')];this['ContactId']=_0x375eab[_0x98f7('0x23')];this[_0x98f7('0x24')]=_0x375eab[_0x98f7('0x24')];this[_0x98f7('0x25')]=_0x375eab[_0x98f7('0x25')];this[_0x98f7('0x26')]=_0x375eab[_0x98f7('0x26')];this[_0x98f7('0x27')]=_0x375eab[_0x98f7('0x27')];this['originatecalleridnum']=_0x375eab['originatecalleridnum']||'';this[_0x98f7('0x28')]=_0x375eab['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x9bc7=['number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum'];(function(_0x4e7799,_0x2b82bd){var _0x3eb423=function(_0x442df5){while(--_0x442df5){_0x4e7799['push'](_0x4e7799['shift']());}};_0x3eb423(++_0x2b82bd);}(_0x9bc7,0x1cd));var _0x79bc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9bc7[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0x79bc('0x0'));var _=require(_0x79bc('0x1'));var moment=require(_0x79bc('0x2'));function getSeconds(_0x3bfa23,_0x11d6c2){var _0x415bbd=moment(_0x3bfa23)[_0x79bc('0x3')](0x0);var _0x38e80d=moment(_0x11d6c2)[_0x79bc('0x3')](0x0);return _0x415bbd[_0x79bc('0x4')](_0x38e80d,'seconds');}function AgentComplete(_0x3c9d4e,_0xfe962e){this[_0x79bc('0x5')]=0x4;this['statedesc']=_0x79bc('0x6');this['scheduledat']=_0x3c9d4e[_0x79bc('0x7')];this[_0x79bc('0x8')]=_0x3c9d4e[_0x79bc('0x8')];this[_0x79bc('0x9')]=_0x3c9d4e[_0x79bc('0x8')]==='outbound'?_0x79bc('0xa'):_0x3c9d4e['type'];this[_0x79bc('0xb')]=_0x3c9d4e[_0x79bc('0xb')];this['countcongestionretry']=_0x3c9d4e['countcongestionretry'];this[_0x79bc('0xc')]=_0x3c9d4e[_0x79bc('0xc')];this[_0x79bc('0xd')]=_0x3c9d4e[_0x79bc('0xb')]+_0x3c9d4e[_0x79bc('0xe')]+_0x3c9d4e[_0x79bc('0xc')]+_0x3c9d4e[_0x79bc('0xf')]+_0x3c9d4e[_0x79bc('0x10')]+_0x3c9d4e['countabandonedretry']+_0x3c9d4e[_0x79bc('0x11')]+_0x3c9d4e[_0x79bc('0x12')];this[_0x79bc('0xf')]=_0x3c9d4e[_0x79bc('0xf')];this[_0x79bc('0x10')]=_0x3c9d4e[_0x79bc('0x10')];this['countabandonedretry']=_0x3c9d4e[_0x79bc('0x13')];this[_0x79bc('0x11')]=_0x3c9d4e['countmachineretry'];this[_0x79bc('0x12')]=_0x3c9d4e['countagentrejectretry'];this[_0x79bc('0x14')]=_0xfe962e[_0x79bc('0x14')];this['calleridname']=_0x3c9d4e[_0x79bc('0x15')];this[_0x79bc('0x16')]=_0x3c9d4e[_0x79bc('0x17')];this[_0x79bc('0x18')]=_0x3c9d4e[_0x79bc('0x18')];this['responsetime']=_0x3c9d4e[_0x79bc('0x19')];this[_0x79bc('0x1a')]=_0x3c9d4e[_0x79bc('0x1a')];this[_0x79bc('0x1b')]=moment()['format'](_0x79bc('0x1c'));this['ringtime']=getSeconds(_0x3c9d4e['responsetime'],_0x3c9d4e[_0x79bc('0x18')]);this[_0x79bc('0x1d')]=getSeconds(_0x3c9d4e[_0x79bc('0x1a')],_0x3c9d4e['responsetime']);this[_0x79bc('0x1e')]=getSeconds(this[_0x79bc('0x1b')],_0x3c9d4e[_0x79bc('0x1a')]);this[_0x79bc('0xa')]=_0xfe962e[_0x79bc('0xa')];this[_0x79bc('0x1f')]=_0xfe962e['membername'];this['reason']=_0xfe962e[_0x79bc('0x20')];this[_0x79bc('0x21')]=_0x3c9d4e[_0x79bc('0x21')];this[_0x79bc('0x22')]=_0x3c9d4e[_0x79bc('0x22')];this[_0x79bc('0x23')]=_0x3c9d4e[_0x79bc('0x23')];this[_0x79bc('0x24')]=_0x3c9d4e[_0x79bc('0x24')];this[_0x79bc('0x25')]=_0x3c9d4e[_0x79bc('0x25')];this[_0x79bc('0x26')]=_0x3c9d4e['ListId'];this['UserId']=_0x3c9d4e[_0x79bc('0x27')];this[_0x79bc('0x28')]=_0x3c9d4e['VoiceQueueId'];this[_0x79bc('0x29')]=_0x3c9d4e[_0x79bc('0x29')];this['originatecalleridnum']=_0x3c9d4e['originatecalleridnum']||'';this['originatecalleridname']=_0x3c9d4e[_0x79bc('0x2a')]||'';}module[_0x79bc('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 3bc43c3..61abb05 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 _0x1b20=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x5e76ef,_0x75e3bd){var _0x47dcad=function(_0xa3d19b){while(--_0xa3d19b){_0x5e76ef['push'](_0x5e76ef['shift']());}};_0x47dcad(++_0x75e3bd);}(_0x1b20,0x66));var _0x01b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b20[_0x17d9e3];return _0x14192d;};'use strict';var util=require('util');var _=require(_0x01b2('0x0'));var moment=require(_0x01b2('0x1'));function getSeconds(_0x4a27f9,_0x54eccf){var _0x27a406=moment(_0x4a27f9)[_0x01b2('0x2')](0x0);var _0x2d6e99=moment(_0x54eccf)[_0x01b2('0x2')](0x0);return _0x27a406[_0x01b2('0x3')](_0x2d6e99,_0x01b2('0x4'));}function Final(_0x419c17){this[_0x01b2('0x5')]=_0x419c17[_0x01b2('0x5')];this[_0x01b2('0x6')]=_0x419c17[_0x01b2('0x6')];this[_0x01b2('0x7')]=_0x419c17['type'];this[_0x01b2('0x8')]=_0x419c17['type']===_0x01b2('0x9')?_0x01b2('0xa'):_0x419c17[_0x01b2('0x7')];this[_0x01b2('0xb')]=_0x419c17[_0x01b2('0xb')];this[_0x01b2('0xc')]=_0x419c17[_0x01b2('0xc')];this[_0x01b2('0xd')]=_0x419c17['countnoanswerretry'];this[_0x01b2('0xe')]=_0x419c17['countbusyretry']+_0x419c17[_0x01b2('0xc')]+_0x419c17['countnoanswerretry']+_0x419c17[_0x01b2('0xf')]+_0x419c17[_0x01b2('0x10')]+_0x419c17[_0x01b2('0x11')]+_0x419c17[_0x01b2('0x12')]+_0x419c17['countagentrejectretry'];this[_0x01b2('0xf')]=_0x419c17[_0x01b2('0xf')];this[_0x01b2('0x10')]=_0x419c17[_0x01b2('0x10')];this[_0x01b2('0x11')]=_0x419c17['countabandonedretry'];this[_0x01b2('0x12')]=_0x419c17[_0x01b2('0x12')];this[_0x01b2('0x13')]=_0x419c17[_0x01b2('0x13')];this['queue']=_0x419c17['queue'];this[_0x01b2('0x14')]=_0x419c17[_0x01b2('0x14')];this['calleridnum']=_0x419c17[_0x01b2('0x15')];this[_0x01b2('0x16')]=_0x419c17[_0x01b2('0x16')];this['responsetime']=_0x419c17[_0x01b2('0x17')];this[_0x01b2('0x18')]=_0x419c17[_0x01b2('0x17')];this[_0x01b2('0x19')]=_0x419c17[_0x01b2('0x19')]||0x0;this['holdtime']=_0x419c17[_0x01b2('0x1a')]||0x0;this['talktime']=_0x419c17[_0x01b2('0x1b')]||0x0;this['callback']=_0x419c17[_0x01b2('0x1c')];this[_0x01b2('0x1d')]=_0x419c17[_0x01b2('0x1d')];this['callbackat']=_0x419c17[_0x01b2('0x1e')];this[_0x01b2('0x1f')]=_0x419c17[_0x01b2('0x1f')];this[_0x01b2('0x20')]=_0x419c17[_0x01b2('0x20')];this['ListId']=_0x419c17[_0x01b2('0x21')];this['UserId']=_0x419c17['UserId'];this[_0x01b2('0x22')]=_0x419c17[_0x01b2('0x22')];this[_0x01b2('0x23')]=_0x419c17[_0x01b2('0x23')];this[_0x01b2('0x24')]=_0x419c17[_0x01b2('0x24')]||'';this['originatecalleridname']=_0x419c17[_0x01b2('0x25')]||'';}module[_0x01b2('0x26')]=Final; \ No newline at end of file +var _0xe0ae=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0x4f4344,_0x3653eb){var _0x53e967=function(_0x4fd18a){while(--_0x4fd18a){_0x4f4344['push'](_0x4f4344['shift']());}};_0x53e967(++_0x3653eb);}(_0xe0ae,0xa1));var _0xee0a=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xe0ae[_0x22f85a];return _0xaa717;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xee0a('0x0'));function getSeconds(_0x401526,_0x49a5e2){var _0x42f3f6=moment(_0x401526)['milliseconds'](0x0);var _0x32cc3e=moment(_0x49a5e2)[_0xee0a('0x1')](0x0);return _0x42f3f6['diff'](_0x32cc3e,_0xee0a('0x2'));}function Final(_0x4d393b){this['uniqueid']=_0x4d393b[_0xee0a('0x3')];this[_0xee0a('0x4')]=_0x4d393b[_0xee0a('0x4')];this[_0xee0a('0x5')]=_0x4d393b['type'];this[_0xee0a('0x6')]=_0x4d393b['type']==='outbound'?_0xee0a('0x7'):_0x4d393b[_0xee0a('0x5')];this[_0xee0a('0x8')]=_0x4d393b['countbusyretry'];this[_0xee0a('0x9')]=_0x4d393b[_0xee0a('0x9')];this['countnoanswerretry']=_0x4d393b[_0xee0a('0xa')];this['countglobal']=_0x4d393b[_0xee0a('0x8')]+_0x4d393b[_0xee0a('0x9')]+_0x4d393b['countnoanswerretry']+_0x4d393b[_0xee0a('0xb')]+_0x4d393b['countdropretry']+_0x4d393b[_0xee0a('0xc')]+_0x4d393b[_0xee0a('0xd')]+_0x4d393b['countagentrejectretry'];this['countnosuchnumberretry']=_0x4d393b[_0xee0a('0xb')];this[_0xee0a('0xe')]=_0x4d393b[_0xee0a('0xe')];this[_0xee0a('0xc')]=_0x4d393b[_0xee0a('0xc')];this['countmachineretry']=_0x4d393b[_0xee0a('0xd')];this[_0xee0a('0xf')]=_0x4d393b['countagentrejectretry'];this[_0xee0a('0x7')]=_0x4d393b[_0xee0a('0x7')];this[_0xee0a('0x10')]=_0x4d393b[_0xee0a('0x10')];this['calleridnum']=_0x4d393b[_0xee0a('0x11')];this[_0xee0a('0x12')]=_0x4d393b[_0xee0a('0x12')];this['responsetime']=_0x4d393b[_0xee0a('0x13')];this[_0xee0a('0x14')]=_0x4d393b[_0xee0a('0x13')];this[_0xee0a('0x15')]=_0x4d393b['ringtime']||0x0;this[_0xee0a('0x16')]=_0x4d393b[_0xee0a('0x16')]||0x0;this[_0xee0a('0x17')]=_0x4d393b[_0xee0a('0x17')]||0x0;this['callback']=_0x4d393b[_0xee0a('0x18')];this[_0xee0a('0x19')]=_0x4d393b[_0xee0a('0x19')];this[_0xee0a('0x1a')]=_0x4d393b[_0xee0a('0x1a')];this[_0xee0a('0x1b')]=_0x4d393b[_0xee0a('0x1b')];this['ContactId']=_0x4d393b[_0xee0a('0x1c')];this[_0xee0a('0x1d')]=_0x4d393b[_0xee0a('0x1d')];this[_0xee0a('0x1e')]=_0x4d393b['UserId'];this[_0xee0a('0x1f')]=_0x4d393b[_0xee0a('0x1f')];this[_0xee0a('0x20')]=_0x4d393b[_0xee0a('0x20')];this['originatecalleridnum']=_0x4d393b['originatecalleridnum']||'';this['originatecalleridname']=_0x4d393b[_0xee0a('0x21')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 75dd65f..3a4cb94 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 _0xbbaa=['CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x1184c4,_0x557e36){var _0x3221e2=function(_0x32002b){while(--_0x32002b){_0x1184c4['push'](_0x1184c4['shift']());}};_0x3221e2(++_0x557e36);}(_0xbbaa,0x1f1));var _0xabba=function(_0x5463ea,_0x53e185){_0x5463ea=_0x5463ea-0x0;var _0x260a64=_0xbbaa[_0x5463ea];return _0x260a64;};'use strict';var util=require(_0xabba('0x0'));var _=require(_0xabba('0x1'));var moment=require('moment');function getSeconds(_0x9dfe2,_0x23454c){var _0x106c80=moment(_0x9dfe2)[_0xabba('0x2')](0x0);var _0x19c313=moment(_0x23454c)['milliseconds'](0x0);return _0x106c80[_0xabba('0x3')](_0x19c313,_0xabba('0x4'));}function Hangup(_0x3def11,_0x3608d4){this[_0xabba('0x5')]=0x4;this[_0xabba('0x6')]=_0xabba('0x7');this[_0xabba('0x8')]=_0x3def11[_0xabba('0x8')];this['type']=_0x3def11[_0xabba('0x9')];this[_0xabba('0xa')]=_0x3def11[_0xabba('0x9')]===_0xabba('0xb')?'queue':_0x3def11[_0xabba('0x9')];this[_0xabba('0xc')]=_0x3def11[_0xabba('0xc')];this['countcongestionretry']=_0x3def11[_0xabba('0xd')];this['countnoanswerretry']=_0x3def11[_0xabba('0xe')];this['countglobal']=_0x3def11[_0xabba('0xc')]+_0x3def11['countcongestionretry']+_0x3def11[_0xabba('0xe')]+_0x3def11[_0xabba('0xf')]+_0x3def11[_0xabba('0x10')]+_0x3def11[_0xabba('0x11')]+_0x3def11[_0xabba('0x12')]+_0x3def11[_0xabba('0x13')];this[_0xabba('0xf')]=_0x3def11['countnosuchnumberretry'];this['countdropretry']=_0x3def11[_0xabba('0x10')];this[_0xabba('0x11')]=_0x3def11['countabandonedretry'];this[_0xabba('0x12')]=_0x3def11['countmachineretry'];this[_0xabba('0x13')]=_0x3def11['countagentrejectretry'];this['uniqueid']=_0x3608d4[_0xabba('0x14')];this['calleridname']=_0x3def11[_0xabba('0x15')];this[_0xabba('0x16')]=_0x3def11[_0xabba('0x17')];this[_0xabba('0x18')]=_0x3def11[_0xabba('0x18')];this[_0xabba('0x19')]=_0x3def11['responsetime'];this[_0xabba('0x1a')]=moment()['format'](_0xabba('0x1b'));this[_0xabba('0x1c')]=getSeconds(_0x3def11[_0xabba('0x19')],_0x3def11['starttime']);this[_0xabba('0x1d')]=0x0;this[_0xabba('0x1e')]=getSeconds(this[_0xabba('0x1a')],_0x3def11[_0xabba('0x19')]);this[_0xabba('0x1f')]=_0x3def11[_0xabba('0x1f')];this[_0xabba('0x20')]=_0xabba('0x21');this['reason']=_0x3608d4[_0xabba('0x22')];this[_0xabba('0x23')]=_0x3def11[_0xabba('0x23')];this['callbackuniqueid']=_0x3def11[_0xabba('0x24')];this['callbackat']=_0x3def11[_0xabba('0x25')];this[_0xabba('0x26')]=_0x3def11[_0xabba('0x26')];this[_0xabba('0x27')]=_0x3def11[_0xabba('0x27')];this[_0xabba('0x28')]=_0x3def11['ListId'];this[_0xabba('0x29')]=_0x3def11[_0xabba('0x29')];this[_0xabba('0x2a')]=_0x3def11[_0xabba('0x2a')];this[_0xabba('0x2b')]=_0x3def11[_0xabba('0x2b')];}module[_0xabba('0x2c')]=Hangup; \ No newline at end of file +var _0x1064=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','endtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number'];(function(_0x2f7281,_0x504a51){var _0x17eac2=function(_0x17be1f){while(--_0x17be1f){_0x2f7281['push'](_0x2f7281['shift']());}};_0x17eac2(++_0x504a51);}(_0x1064,0x1e1));var _0x4106=function(_0x4b88f4,_0x2971e4){_0x4b88f4=_0x4b88f4-0x0;var _0x1b2096=_0x1064[_0x4b88f4];return _0x1b2096;};'use strict';var util=require(_0x4106('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x28e71e,_0x1c7b8f){var _0x2ed526=moment(_0x28e71e)[_0x4106('0x1')](0x0);var _0x52859d=moment(_0x1c7b8f)[_0x4106('0x1')](0x0);return _0x2ed526[_0x4106('0x2')](_0x52859d,_0x4106('0x3'));}function Hangup(_0x28e932,_0x2097a8){this[_0x4106('0x4')]=0x4;this['statedesc']=_0x4106('0x5');this[_0x4106('0x6')]=_0x28e932[_0x4106('0x6')];this[_0x4106('0x7')]=_0x28e932[_0x4106('0x7')];this[_0x4106('0x8')]=_0x28e932[_0x4106('0x7')]===_0x4106('0x9')?_0x4106('0xa'):_0x28e932[_0x4106('0x7')];this[_0x4106('0xb')]=_0x28e932['countbusyretry'];this[_0x4106('0xc')]=_0x28e932['countcongestionretry'];this[_0x4106('0xd')]=_0x28e932[_0x4106('0xd')];this['countglobal']=_0x28e932[_0x4106('0xb')]+_0x28e932[_0x4106('0xc')]+_0x28e932[_0x4106('0xd')]+_0x28e932['countnosuchnumberretry']+_0x28e932[_0x4106('0xe')]+_0x28e932[_0x4106('0xf')]+_0x28e932[_0x4106('0x10')]+_0x28e932[_0x4106('0x11')];this[_0x4106('0x12')]=_0x28e932[_0x4106('0x12')];this[_0x4106('0xe')]=_0x28e932[_0x4106('0xe')];this['countabandonedretry']=_0x28e932['countabandonedretry'];this['countmachineretry']=_0x28e932[_0x4106('0x10')];this[_0x4106('0x11')]=_0x28e932[_0x4106('0x11')];this['uniqueid']=_0x2097a8[_0x4106('0x13')];this['calleridname']=_0x28e932[_0x4106('0x14')];this[_0x4106('0x15')]=_0x28e932[_0x4106('0x16')];this['starttime']=_0x28e932[_0x4106('0x17')];this[_0x4106('0x18')]=_0x28e932[_0x4106('0x18')];this['endtime']=moment()[_0x4106('0x19')](_0x4106('0x1a'));this['ringtime']=getSeconds(_0x28e932[_0x4106('0x18')],_0x28e932[_0x4106('0x17')]);this['holdtime']=0x0;this[_0x4106('0x1b')]=getSeconds(this[_0x4106('0x1c')],_0x28e932[_0x4106('0x18')]);this[_0x4106('0xa')]=_0x28e932[_0x4106('0xa')];this[_0x4106('0x1d')]=_0x4106('0x1e');this[_0x4106('0x1f')]=_0x2097a8['cause-txt'];this[_0x4106('0x20')]=_0x28e932[_0x4106('0x20')];this[_0x4106('0x21')]=_0x28e932[_0x4106('0x21')];this[_0x4106('0x22')]=_0x28e932[_0x4106('0x22')];this[_0x4106('0x23')]=_0x28e932['recallme'];this[_0x4106('0x24')]=_0x28e932[_0x4106('0x24')];this[_0x4106('0x25')]=_0x28e932[_0x4106('0x25')];this['UserId']=_0x28e932[_0x4106('0x26')];this[_0x4106('0x27')]=_0x28e932[_0x4106('0x27')];this['CampaignId']=_0x28e932[_0x4106('0x28')];}module[_0x4106('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 37adc98..5e70217 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 _0x881d=['countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x356d63,_0x5582ad){var _0x46e078=function(_0x59dd88){while(--_0x59dd88){_0x356d63['push'](_0x356d63['shift']());}};_0x46e078(++_0x5582ad);}(_0x881d,0x19e));var _0xd881=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x881d[_0x1b349a];return _0x5d1f7c;};'use strict';var util=require(_0xd881('0x0'));var _=require(_0xd881('0x1'));var moment=require('moment');function getSeconds(_0x5a7176,_0x130fd8){var _0x3f7a5e=moment(_0x5a7176)[_0xd881('0x2')](0x0);var _0x46adc4=moment(_0x130fd8)['milliseconds'](0x0);return _0x3f7a5e[_0xd881('0x3')](_0x46adc4,_0xd881('0x4'));}function History(_0x5c97f4){this[_0xd881('0x5')]=_0x5c97f4[_0xd881('0x5')];this['scheduledat']=_0x5c97f4[_0xd881('0x6')]||undefined;this[_0xd881('0x7')]=_0x5c97f4[_0xd881('0x7')];this[_0xd881('0x8')]=_0x5c97f4[_0xd881('0x7')]===_0xd881('0x9')?_0xd881('0xa'):_0x5c97f4[_0xd881('0x7')];this['countbusyretry']=_0x5c97f4['countbusyretry'];this[_0xd881('0xb')]=_0x5c97f4[_0xd881('0xb')];this[_0xd881('0xc')]=_0x5c97f4[_0xd881('0xc')];this['countglobal']=_0x5c97f4[_0xd881('0xd')]+_0x5c97f4['countcongestionretry']+_0x5c97f4[_0xd881('0xc')]+_0x5c97f4[_0xd881('0xe')]+_0x5c97f4[_0xd881('0xf')]+_0x5c97f4[_0xd881('0x10')]+_0x5c97f4[_0xd881('0x11')]+_0x5c97f4[_0xd881('0x12')];this['countnosuchnumberretry']=_0x5c97f4[_0xd881('0xe')];this[_0xd881('0xf')]=_0x5c97f4['countdropretry'];this['countabandonedretry']=_0x5c97f4[_0xd881('0x10')];this[_0xd881('0x11')]=_0x5c97f4[_0xd881('0x11')];this['countagentrejectretry']=_0x5c97f4['countagentrejectretry'];this['queue']=_0x5c97f4[_0xd881('0xa')];this[_0xd881('0x13')]=_0x5c97f4[_0xd881('0x14')];this[_0xd881('0x15')]=_0x5c97f4['number'];this['starttime']=_0x5c97f4[_0xd881('0x16')];this['responsetime']=_0x5c97f4[_0xd881('0x17')];this['endtime']=_0x5c97f4[_0xd881('0x17')];this['ringtime']=getSeconds(_0x5c97f4[_0xd881('0x17')],_0x5c97f4[_0xd881('0x16')]);this['holdtime']=0x0;this[_0xd881('0x18')]=0x0;this['callback']=_0x5c97f4[_0xd881('0x19')];this[_0xd881('0x1a')]=_0x5c97f4[_0xd881('0x1a')];this[_0xd881('0x1b')]=_0x5c97f4['callbackat'];this[_0xd881('0x1c')]=_0x5c97f4[_0xd881('0x1c')];this['ContactId']=_0x5c97f4['ContactId'];this[_0xd881('0x1d')]=_0x5c97f4[_0xd881('0x1d')];this[_0xd881('0x1e')]=_0x5c97f4[_0xd881('0x1e')];this['VoiceQueueId']=_0x5c97f4[_0xd881('0x1f')];this[_0xd881('0x20')]=_0x5c97f4[_0xd881('0x20')];this['originatecalleridnum']=_0x5c97f4[_0xd881('0x21')]||'';this[_0xd881('0x22')]=_0x5c97f4[_0xd881('0x22')]||'';}module[_0xd881('0x23')]=History; \ No newline at end of file +var _0xa473=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','queue','calleridname','name','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x526074,_0x5e5d09){var _0x83c6c8=function(_0x571483){while(--_0x571483){_0x526074['push'](_0x526074['shift']());}};_0x83c6c8(++_0x5e5d09);}(_0xa473,0xf7));var _0x3a47=function(_0x2a8516,_0x413703){_0x2a8516=_0x2a8516-0x0;var _0x574b2a=_0xa473[_0x2a8516];return _0x574b2a;};'use strict';var util=require(_0x3a47('0x0'));var _=require(_0x3a47('0x1'));var moment=require(_0x3a47('0x2'));function getSeconds(_0x51fe62,_0x3f0e7d){var _0x88f031=moment(_0x51fe62)[_0x3a47('0x3')](0x0);var _0x34364b=moment(_0x3f0e7d)['milliseconds'](0x0);return _0x88f031[_0x3a47('0x4')](_0x34364b,_0x3a47('0x5'));}function History(_0x2893b0){this['uniqueid']=_0x2893b0[_0x3a47('0x6')];this[_0x3a47('0x7')]=_0x2893b0['scheduledat']||undefined;this[_0x3a47('0x8')]=_0x2893b0['type'];this[_0x3a47('0x9')]=_0x2893b0[_0x3a47('0x8')]===_0x3a47('0xa')?'queue':_0x2893b0[_0x3a47('0x8')];this[_0x3a47('0xb')]=_0x2893b0[_0x3a47('0xb')];this['countcongestionretry']=_0x2893b0['countcongestionretry'];this[_0x3a47('0xc')]=_0x2893b0[_0x3a47('0xc')];this[_0x3a47('0xd')]=_0x2893b0[_0x3a47('0xb')]+_0x2893b0[_0x3a47('0xe')]+_0x2893b0[_0x3a47('0xc')]+_0x2893b0['countnosuchnumberretry']+_0x2893b0[_0x3a47('0xf')]+_0x2893b0['countabandonedretry']+_0x2893b0[_0x3a47('0x10')]+_0x2893b0[_0x3a47('0x11')];this[_0x3a47('0x12')]=_0x2893b0[_0x3a47('0x12')];this['countdropretry']=_0x2893b0[_0x3a47('0xf')];this[_0x3a47('0x13')]=_0x2893b0['countabandonedretry'];this[_0x3a47('0x10')]=_0x2893b0[_0x3a47('0x10')];this[_0x3a47('0x11')]=_0x2893b0[_0x3a47('0x11')];this[_0x3a47('0x14')]=_0x2893b0['queue'];this[_0x3a47('0x15')]=_0x2893b0[_0x3a47('0x16')];this['calleridnum']=_0x2893b0[_0x3a47('0x17')];this[_0x3a47('0x18')]=_0x2893b0['starttime'];this[_0x3a47('0x19')]=_0x2893b0['responsetime'];this[_0x3a47('0x1a')]=_0x2893b0[_0x3a47('0x19')];this['ringtime']=getSeconds(_0x2893b0['responsetime'],_0x2893b0[_0x3a47('0x18')]);this[_0x3a47('0x1b')]=0x0;this[_0x3a47('0x1c')]=0x0;this[_0x3a47('0x1d')]=_0x2893b0['callback'];this[_0x3a47('0x1e')]=_0x2893b0['callbackuniqueid'];this[_0x3a47('0x1f')]=_0x2893b0[_0x3a47('0x1f')];this[_0x3a47('0x20')]=_0x2893b0['recallme'];this[_0x3a47('0x21')]=_0x2893b0[_0x3a47('0x21')];this[_0x3a47('0x22')]=_0x2893b0[_0x3a47('0x22')];this['UserId']=_0x2893b0[_0x3a47('0x23')];this[_0x3a47('0x24')]=_0x2893b0[_0x3a47('0x24')];this['CampaignId']=_0x2893b0[_0x3a47('0x25')];this['originatecalleridnum']=_0x2893b0[_0x3a47('0x26')]||'';this['originatecalleridname']=_0x2893b0[_0x3a47('0x27')]||'';}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 8ddf48f..63c238c 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 _0x75bb=['is\x20not\x20active','state','statedesc','[actions]','clearZombieChannels','sequence','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[syncHangupInAMDIvr][createHistory]','countglobal','countbusyretry','stateGlobal','dialMachineMaxRetry','dialMachineRetryFrequency','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','countdropretry','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','stateinterface','locked','queueBooked','push','pick','[unlockQueueStatus][undefined]','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','idHopper','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','true','iftime\x20%s,%s','timezones','content','indexOf','all','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','dialer','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsTimeout','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','floor','one\x20call\x20every:','[handlePredictive]','recallme','booked','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','reachable','countReScheduled','[countReScheduled]\x20','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./queueCallerAbandon','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Interval','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0x75bb,0x186));var _0xb75b=function(_0x2128cd,_0x112f9a){_0x2128cd=_0x2128cd-0x0;var _0x4f8d8b=_0x75bb[_0x2128cd];return _0x4f8d8b;};'use strict';var util=require(_0xb75b('0x0'));var _=require(_0xb75b('0x1'));var BPromise=require(_0xb75b('0x2'));var uuid=require(_0xb75b('0x3'));var moment=require(_0xb75b('0x4'));var rr=require('rr');var md5=require(_0xb75b('0x5'));var Redis=require('ioredis');var ut=require(_0xb75b('0x6'));var config=require(_0xb75b('0x7'));var logger=require(_0xb75b('0x8'))('dialer');var loggerBooked=require(_0xb75b('0x8'))('booked');var loggerPredictive=require(_0xb75b('0x8'))(_0xb75b('0x9'));var loggerPredictiveCalls=require(_0xb75b('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xb75b('0x8'))(_0xb75b('0xa'));var ami=require(_0xb75b('0xb'));config[_0xb75b('0xc')]=_[_0xb75b('0xd')](config[_0xb75b('0xc')],{'host':_0xb75b('0xe'),'port':0x18eb});var io=require(_0xb75b('0xf'))(new Redis(config[_0xb75b('0xc')]));var cmHopper=require(_0xb75b('0x10'));var cmHopperHistory=require(_0xb75b('0x11'));var cmHopperBlack=require(_0xb75b('0x12'));var voiceQueueRt=require(_0xb75b('0x13'));var Action=require('./action');var History=require(_0xb75b('0x14'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xb75b('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0xb75b('0x16')][_0xb75b('0x17')]||'127.0.0.1';var strategy={'rrmemory':_0xb75b('0x18'),'roundrobin':_0xb75b('0x19')};var Sequence=function(){};Sequence[_0xb75b('0x1a')][_0xb75b('0x1b')]=function(_0x5bdefc){this['tail']=this[_0xb75b('0x1c')]?this['tail']['finally'](_0x5bdefc):_0x5bdefc();};function Dialer(_0x272476,_0x3864f3){this['sequence']=new Sequence();this[_0xb75b('0x1d')]=_0x3864f3;this[_0xb75b('0x1e')]=_0x272476[_0xb75b('0x1e')];this['campaigns']=_0x272476[_0xb75b('0x1f')];this[_0xb75b('0x20')]=_0x272476[_0xb75b('0x20')];this[_0xb75b('0x21')]=_0x272476[_0xb75b('0x21')];this[_0xb75b('0x22')]=config[_0xb75b('0x22')]||0x2;this[_0xb75b('0x23')]={};this[_0xb75b('0x24')]={};this[_0xb75b('0x25')]={};this[_0xb75b('0x26')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this['queueBooked']={};this[_0xb75b('0x27')]={};ami['on'](_0xb75b('0x28'),this[_0xb75b('0x29')][_0xb75b('0x2a')](this));ami['on'](_0xb75b('0x2b'),this[_0xb75b('0x2c')]['bind'](this));ami['on'](_0xb75b('0x2d'),this[_0xb75b('0x2e')]['bind'](this));ami['on'](_0xb75b('0x2f'),this[_0xb75b('0x30')][_0xb75b('0x2a')](this));ami['on'](_0xb75b('0x31'),this[_0xb75b('0xa')]['bind'](this));ami['on'](_0xb75b('0x32'),this['syncHangup'][_0xb75b('0x2a')](this));ami['on'](_0xb75b('0x33'),this[_0xb75b('0x34')][_0xb75b('0x2a')](this));ami['on'](_0xb75b('0x35'),this[_0xb75b('0x36')][_0xb75b('0x2a')](this));ami['on'](_0xb75b('0x37'),this[_0xb75b('0x38')][_0xb75b('0x2a')](this));ami['on'](_0xb75b('0x39'),this[_0xb75b('0x3a')]['bind'](this));this['loopCampaigns']();this[_0xb75b('0x3b')]();}function isNotNull(_0x47c68d){return _0x47c68d!==null&&!_[_0xb75b('0x3c')](_0x47c68d);}function checkIsLoggedIn(_0x252947,_0x2bdc8c){return function(){if(_0x2bdc8c<=0x0){_0x252947[_0xb75b('0x3d')]=_0xb75b('0x3e');throw _0x252947[_0xb75b('0x3f')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x216526){return _0x216526;}function checkIsActive(_0x14fa20,_0x42e50e){return function(){if(!isActive(_0x42e50e)){_0x14fa20[_0xb75b('0x3d')]=_0xb75b('0x40');throw _0x14fa20[_0xb75b('0x3f')]+_0xb75b('0x41');}};}function checkInterval(_0x5c4656){return function(){if(!isNotNull(_0x5c4656['Interval'])){_0x5c4656[_0xb75b('0x3d')]=_0xb75b('0x42');throw _0x5c4656['name']+_0xb75b('0x43');}if(!isNotNull(_0x5c4656['Interval'][_0xb75b('0x44')])){_0x5c4656['message']=_0xb75b('0x42');throw _0x5c4656[_0xb75b('0x3f')]+_0xb75b('0x43');}if(!isNotNull(_[_0xb75b('0x45')](_0x5c4656[_0xb75b('0x46')]['Intervals']))){_0x5c4656[_0xb75b('0x3d')]=_0xb75b('0x42');throw _0x5c4656['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5b6a98,_0x34ad03,_0x37b140){return{'action':_0x5b6a98,'response':_0x34ad03,'message':_0x37b140,'stack':_0x37b140};}function myreject(_0x5e4cff){return function(_0x136717){return _0x5e4cff(msgResponse('[ifTime][Action]',_0xb75b('0x47'),JSON[_0xb75b('0x48')](_0x136717)));};}function getSeconds(_0x50075c,_0x284d14){var _0x1a762c=moment(_0x50075c)[_0xb75b('0x49')](0x0);var _0x96bd3=moment(_0x284d14)[_0xb75b('0x49')](0x0);return _0x1a762c[_0xb75b('0x4a')](_0x96bd3,_0xb75b('0x4b'));}function emit(_0x57c263,_0x33972d,_0x35dbb4){io['to'](_0x57c263)[_0xb75b('0x4c')](_0x33972d,_0x35dbb4);}function emitVoiceQueueSummary(_0x266859){if(_0x266859[_0xb75b('0x4d')]===_0xb75b('0x4e')){var _0x5563ad={'id':_0x266859['id'],'name':_0x266859['name'],'strategy':_0x266859[_0xb75b('0x4f')],'answered':_0x266859['answered'],'available':_0x266859[_0xb75b('0x50')],'loggedIn':_0x266859['loggedIn'],'pTalking':_0x266859[_0xb75b('0x51')],'sumBillable':_0x266859[_0xb75b('0x52')],'sumDuration':_0x266859[_0xb75b('0x53')],'sumHoldTime':_0x266859['sumHoldTime']||0x0,'talking':_0x266859[_0xb75b('0x54')],'total':_0x266859[_0xb75b('0x55')],'type':_0x266859[_0xb75b('0x4d')],'unmanaged':_0x266859[_0xb75b('0x56')],'abandoned':_0x266859[_0xb75b('0x57')],'waiting':_0x266859[_0xb75b('0x58')],'loggedInDb':_0x266859[_0xb75b('0x59')],'dialActive':_0x266859[_0xb75b('0x5a')],'dialMethod':_0x266859[_0xb75b('0x5b')],'dialOriginateCallerIdName':_0x266859['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x266859['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x266859[_0xb75b('0x5c')],'dialPrefix':_0x266859['dialPrefix'],'outboundAnswerAgiCallsDay':_0x266859['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x266859[_0xb75b('0x5d')],'outboundBlacklistCallsDay':_0x266859['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x266859['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x266859[_0xb75b('0x5e')],'outboundDropCallsDayACS':_0x266859[_0xb75b('0x5f')],'outboundDropCallsDayCallersExit':_0x266859[_0xb75b('0x60')],'outboundDropCallsDayTimeout':_0x266859['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x266859[_0xb75b('0x61')],'outboundNoSuchCallsDay':_0x266859[_0xb75b('0x62')],'outboundOriginateFailureCallsDay':_0x266859[_0xb75b('0x63')],'outboundReCallsDay':_0x266859['outboundReCallsDay'],'outboundRejectCallsDay':_0x266859[_0xb75b('0x64')],'outboundUnknownCallsDay':_0x266859[_0xb75b('0x65')],'predictiveIntervalAnsweredCalls':_0x266859[_0xb75b('0x66')],'predictiveIntervalAvgHoldtime':_0x266859[_0xb75b('0x67')],'predictiveIntervalAvgTalktime':_0x266859['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x266859[_0xb75b('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x266859['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x266859[_0xb75b('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x266859[_0xb75b('0x6a')],'predictiveIntervalHitRate':_0x266859[_0xb75b('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x266859[_0xb75b('0x6c')],'predictiveIntervalPauses':_0x266859[_0xb75b('0x6d')],'predictiveIntervalAvailable':_0x266859[_0xb75b('0x6e')],'predictiveIntervalTotalCalls':_0x266859['predictiveIntervalTotalCalls'],'message':_0x266859[_0xb75b('0x3d')],'originated':_0x266859[_0xb75b('0x6f')],'erlangCalls':_0x266859['erlangCalls'],'erlangCallToSecond':_0x266859[_0xb75b('0x70')],'erlangAbandonmentRate':_0x266859[_0xb75b('0x71')],'erlangBusyFactor':_0x266859['erlangBusyFactor'],'startPredictive':_0x266859[_0xb75b('0x72')],'startProgressive':_0x266859[_0xb75b('0x73')]};if(_0x266859[_0xb75b('0x74')]){_0x5563ad['Trunk']={'id':_0x266859[_0xb75b('0x74')]['id'],'name':_0x266859['Trunk']['name'],'active':_0x266859['Trunk']['active'],'callerid':_0x266859['Trunk'][_0xb75b('0x75')]};}if(_0x266859['Interval']){_0x5563ad[_0xb75b('0x46')]={'id':_0x266859[_0xb75b('0x46')]['id'],'name':_0x266859[_0xb75b('0x46')][_0xb75b('0x3f')]};}var _0x296902=md5(JSON['stringify'](_0x5563ad));if(_0x266859[_0xb75b('0x5')]!==_0x296902){_0x266859['md5']=_0x296902;emit(util['format'](_0xb75b('0x76'),_0x5563ad[_0xb75b('0x3f')]),_0xb75b('0x77'),_0x5563ad);}}}function emitCampaignSummary(_0x5d8e74){if(_0x5d8e74[_0xb75b('0x4d')]===_0xb75b('0x78')){emit(util[_0xb75b('0x79')](_0xb75b('0x7a'),_0x5d8e74[_0xb75b('0x3f')]),_0xb75b('0x7b'),_0x5d8e74);}}function checkGetDataPredictive(_0x17cd9){if(isNotNull(_0x17cd9)&&!_['isEmpty'](_0x17cd9)){loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x7d'));loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x7e'),_0x17cd9[_0xb75b('0x7f')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17cd9['predictiveIntervalAnsweredCalls']);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17cd9['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xb75b('0x7c')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17cd9[_0xb75b('0x68')]);loggerPredictive['info'](_0xb75b('0x80'),_0x17cd9['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xb75b('0x81'),_0x17cd9[_0xb75b('0x82')]);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x83'));if(_0x17cd9['predictiveIntervalTotalCalls']>0x0){if(!_[_0xb75b('0x3c')](_0x17cd9[_0xb75b('0x82')])&&_0x17cd9[_0xb75b('0x82')]>0x0){return!![];}loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x84'));if(!_[_0xb75b('0x3c')](_0x17cd9[_0xb75b('0x67')])&&_0x17cd9[_0xb75b('0x67')]>0x0){return!![];}loggerPredictive[_0xb75b('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0xb75b('0x85'));}}else{loggerPredictive['info'](_0xb75b('0x86'));}return![];}function mergeDataErlangB(_0x1611ce){return function(_0x59f9de){loggerPredictive['info'](_0xb75b('0x87'));loggerPredictive['info'](_0xb75b('0x88'),_0x59f9de[_0xb75b('0x89')]);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x8a'),_0x59f9de[_0xb75b('0x70')]);loggerPredictive[_0xb75b('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x59f9de[_0xb75b('0x71')]);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x8b'),_0x59f9de[_0xb75b('0x8c')]);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x8d'),_0x59f9de[_0xb75b('0x71')]);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x83'));_[_0xb75b('0x8e')](_0x1611ce,_0x59f9de);};}function getDiff(_0xf15538){var _0x550f90=moment()[_0xb75b('0x49')](0x0);var _0x18d0f0=moment(_0xf15538)[_0xb75b('0x49')](0x0);return _0x550f90[_0xb75b('0x4a')](_0x18d0f0,_0xb75b('0x4b'));}function ifInterval(_0x3ea7a3,_0x3dc755){if(_['isUndefined'](_0x3dc755)){return![];}return getDiff(_0x3dc755)<_0x3ea7a3*0x3c;}function freeVariablesPredictive(_0x1e9b9e){if(isNotNull(_0x1e9b9e)){if(!_['isUndefined'](_0x1e9b9e[_0xb75b('0x73')])){_0x1e9b9e['startProgressive']=undefined;loggerPredictive[_0xb75b('0x7c')](_0x1e9b9e['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xb75b('0x3c')](_0x1e9b9e[_0xb75b('0x72')])){_0x1e9b9e[_0xb75b('0x72')]=undefined;loggerPredictive[_0xb75b('0x7c')](_0x1e9b9e[_0xb75b('0x3f')],_0xb75b('0x8f'));}if(!_[_0xb75b('0x3c')](_0x1e9b9e[_0xb75b('0x90')])){clearInterval(_0x1e9b9e['handlePredictive']);_0x1e9b9e[_0xb75b('0x90')]=undefined;loggerPredictive[_0xb75b('0x7c')](_0x1e9b9e['name'],_0xb75b('0x91'));}}}function erlangb(_0x156521,_0x2e3528){if(_0x2e3528===0x0){return 0x0;}var _0x3732fe=0x1;for(var _0x5d057a=0x1;_0x5d057a<=_0x2e3528;_0x5d057a+=0x1){_0x3732fe=0x1+_0x3732fe*_0x5d057a/_0x156521;}return 0x1/_0x3732fe;}function isVoiceQueueOutbound(_0x278863){return _0x278863===_0xb75b('0x4e');}function isNotPreview(_0x35ce48){return _0x35ce48!==_0xb75b('0x1d');}function isCampaignIvr(_0x56116c){return _0x56116c===_0xb75b('0x78');}function getCallerId(_0x487507,_0x333804,_0x1db1b2){if(!_[_0xb75b('0x3c')](_0x1db1b2)&&typeof _0x1db1b2==='string'&&!_[_0xb75b('0x45')](_0x1db1b2)){if(!_[_0xb75b('0x3c')](_0x333804)&&typeof _0x333804==='string'&&!_[_0xb75b('0x45')](_0x333804)){return util['format'](_0xb75b('0x92'),_0x333804,_0x1db1b2);}return util[_0xb75b('0x79')](_0xb75b('0x92'),_0x1db1b2,_0x1db1b2);}if(!_['isUndefined'](_0x487507)&&typeof _0x487507===_0xb75b('0x93')&&!_[_0xb75b('0x45')](_0x487507)){return _0x487507;}return _0xb75b('0x94');}function loggerCatchQueueSummary(_0x1b6304,_0x430518){return function(_0x212a93){freeVariablesPredictive(_0x430518);emitVoiceQueueSummary(_0x430518);emitCampaignSummary(_0x430518);loggerSyncQueueSummary[_0xb75b('0x95')](_0x1b6304,util[_0xb75b('0x96')](_0x212a93,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4aa5df,_0x376eed){return function(_0x1edc39){loggerPredictive[_0xb75b('0x95')](_0x376eed['name'],_0x4aa5df);loggerPredictive['error'](_0x1edc39[_0xb75b('0x97')]);freeVariablesPredictive(_0x376eed);};}function loggerCatch(_0x53a71e){return function(_0x7a2cc9){logger[_0xb75b('0x95')](_0x53a71e,util[_0xb75b('0x96')](_0x7a2cc9,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x475a8c){return _0x475a8c&&!_[_0xb75b('0x3c')](_0x475a8c)&&_0x475a8c[_0xb75b('0x98')]>0x0;}function decremetOriginate(_0x450eea){if(!_['isUndefined'](_0x450eea)&&_0x450eea!==null){if(typeof _0x450eea[_0xb75b('0x6f')]!==_0xb75b('0x99')){if(_0x450eea[_0xb75b('0x6f')]>0x0){_0x450eea[_0xb75b('0x6f')]-=0x1;}else{logger['error'](_0xb75b('0x9a'));}}}else{logger[_0xb75b('0x95')](_0xb75b('0x9b'));}}function checkContactLowerLimitOriginate(_0x27a456,_0x138a3c,_0x1ab4af){if(_0x138a3c>_0x1ab4af){for(var _0x154b4c=0x0;_0x154b4c<_0x138a3c-_0x1ab4af;_0x154b4c+=0x1){decremetOriginate(_0x27a456);}}}function loggerGetContactDialer(_0x2e73fc,_0x217989,_0x2b4fc0){return function(_0x1e0bff){checkContactLowerLimitOriginate(_0x217989,_0x2b4fc0,0x0);logger[_0xb75b('0x95')](_0x2e73fc,util[_0xb75b('0x96')](_0x1e0bff,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x486db7){return function(_0x2e529c){if(isNotNull(_0x2e529c)&&isNotNull(_0x2e529c[0x0])){if(_0x2e529c[0x0][_0xb75b('0x9c')]>0x0){_0x486db7[_0xb75b('0x3d')]=_0xb75b('0x9d');logger[_0xb75b('0x7c')](_0xb75b('0x9e')+_0x486db7[_0xb75b('0x3f')],_0x2e529c[0x0][_0xb75b('0x9c')],_0xb75b('0x9f'));}else{_0x486db7[_0xb75b('0x3d')]=_0xb75b('0xa0');logger['info'](_0xb75b('0xa1')+_0x486db7[_0xb75b('0x3f')]);}}};}function notSendMessagesQueue(_0x3e4acf){if(_0x3e4acf['sendMessageOneNotActive']){freeVariablesPredictive(_0x3e4acf);if(_0x3e4acf[_0xb75b('0x6f')]===0x0&&_0x3e4acf['talking']===0x0&&_0x3e4acf[_0xb75b('0x58')]===0x0&&(_0x3e4acf[_0xb75b('0x51')]||0x0)===0x0){_0x3e4acf[_0xb75b('0xa2')]=![];_0x3e4acf[_0xb75b('0x50')]=0x0;_0x3e4acf[_0xb75b('0x3d')]=_0xb75b('0x40');loggerSyncQueueSummary[_0xb75b('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3e4acf[_0xb75b('0x3f')],'is\x20not\x20active');}else{_0x3e4acf[_0xb75b('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xb75b('0x95')](_0xb75b('0xa3'),_0x3e4acf[_0xb75b('0x3f')],'is\x20disactive');}emitVoiceQueueSummary(_0x3e4acf);}}function notSendMessagesCampaign(_0x2cca74){if(_0x2cca74['sendMessageOneNotActive']){if(_0x2cca74['originated']===0x0){_0x2cca74['sendMessageOneNotActive']=![];_0x2cca74['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xb75b('0x95')](_0xb75b('0xa4'),_0x2cca74[_0xb75b('0x3f')],_0xb75b('0xa5'));}else{_0x2cca74[_0xb75b('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xb75b('0x95')](_0xb75b('0xa4'),_0x2cca74[_0xb75b('0x3f')],'is\x20disactive');}emitCampaignSummary(_0x2cca74);}}function createObjHistory(_0x39a81e,_0x5a5567,_0xef0688,_0x4c12fc,_0x1514bc){_0x39a81e[_0xb75b('0x3d')]=_0xef0688;var _0x5cef0e=new Action(_0x39a81e,_0x5a5567);var _0x119f41=new History(_0x5cef0e);_0x119f41[_0xb75b('0xa6')]=_0x4c12fc;_0x119f41[_0xb75b('0xa7')]=_0x1514bc;_0x119f41['endtime']=_0x5cef0e['starttime'];return _0x119f41;}Dialer[_0xb75b('0x1a')][_0xb75b('0x3b')]=function(){var _0x1889e9=this;setInterval(function(){_0x1889e9['clearZombieChannels'](_0x1889e9[_0xb75b('0x26')],'[uniqueid]');_0x1889e9['clearZombieChannels'](_0x1889e9[_0xb75b('0x24')],_0xb75b('0xa8'));},0x32c8);};Dialer[_0xb75b('0x1a')][_0xb75b('0xa9')]=function(_0x5a301c,_0x571fcc){var _0x5070b7=this;for(var _0x1f3fb1 in _0x5a301c){if(typeof _0x5a301c[_0x1f3fb1]!==_0xb75b('0x99')){this[_0xb75b('0xaa')]['enqueue'](function(){if(!_['isNil'](_0x5a301c[_0x1f3fb1])){return ami[_0xb75b('0xab')]({'action':_0xb75b('0xac'),'channel':_0x5a301c[_0x1f3fb1][_0xb75b('0xad')]})[_0xb75b('0xae')](function(_0x4de515){if(_0x4de515[_0xb75b('0x3d')]===_0xb75b('0xaf')){setTimeout(function(){if(_0x5a301c[_0x1f3fb1]&&_0x5a301c[_0x1f3fb1]['type']!==_0xb75b('0x78')){_0x5070b7[_0xb75b('0xb0')](_0x5070b7['voiceQueues'][_0x5a301c[_0x1f3fb1][_0xb75b('0xb1')]]);logger['error'](_0xb75b('0xb2'),_0x571fcc,_0x1f3fb1,_0x5a301c[_0x1f3fb1]['queue']);delete _0x5a301c[_0x1f3fb1];}if(_0x5a301c[_0x1f3fb1]&&_0x5a301c[_0x1f3fb1][_0xb75b('0x4d')]===_0xb75b('0x78')){_0x5070b7[_0xb75b('0xb0')](_0x5070b7[_0xb75b('0x1f')][_0x5a301c[_0x1f3fb1][_0xb75b('0xb1')]]);logger[_0xb75b('0x95')](_0xb75b('0xb3'),_0x571fcc,_0x1f3fb1,_0x5a301c[_0x1f3fb1][_0xb75b('0xb1')]);delete _0x5a301c[_0x1f3fb1];}},0x2328);}});}});}}};Dialer[_0xb75b('0x1a')]['countReScheduled']=function(_0x59f0f5){return BPromise[_0xb75b('0xb4')]()[_0xb75b('0xb5')](cmHopper['countReScheduled'](_0x59f0f5))[_0xb75b('0xae')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xb75b('0x1a')][_0xb75b('0xb6')]=function(_0x53f13d){return BPromise[_0xb75b('0xb4')]()[_0xb75b('0xb5')](cmHopperBlack['checkIsBlackList'](_0x53f13d))[_0xb75b('0xae')](loggerCatch(_0xb75b('0xb7')));};Dialer[_0xb75b('0x1a')]['checkIsBlackListIvr']=function(_0x5781a1){return BPromise['resolve']()[_0xb75b('0xb5')](cmHopperBlack[_0xb75b('0xb8')](_0x5781a1))['catch'](loggerCatch(_0xb75b('0xb9')));};Dialer['prototype'][_0xb75b('0xba')]=function(_0x56c1f7){return BPromise[_0xb75b('0xb4')]()[_0xb75b('0xb5')](cmHopperHistory[_0xb75b('0xbb')](_0x56c1f7))['catch'](loggerCatch(_0xb75b('0xbc')));};Dialer['prototype'][_0xb75b('0xbd')]=function(_0x39ba03){return BPromise['resolve']()[_0xb75b('0xb5')](cmHopper[_0xb75b('0xbd')](_0x39ba03))[_0xb75b('0xae')](loggerCatch(_0xb75b('0xbe')));};Dialer['prototype']['unlockContact']=function(_0x2ac497,_0x503d61,_0x16610f){return BPromise['resolve']()[_0xb75b('0xb5')](cmHopper[_0xb75b('0xbf')](_0x2ac497,_0x503d61,_0x16610f))[_0xb75b('0xae')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xb75b('0x1a')][_0xb75b('0xc0')]=function(_0x1c229c,_0x608243,_0xcaa4bb,_0x2a1862,_0x15bdc0){return BPromise[_0xb75b('0xb4')]()[_0xb75b('0xb5')](cmHopper[_0xb75b('0xc0')](_0x1c229c,_0x608243,_0xcaa4bb,_0x2a1862))[_0xb75b('0xae')](function(_0x4251e8){_0x15bdc0['temp']-=_0xcaa4bb;_0x15bdc0[_0xb75b('0xc1')]=_0x15bdc0['temp']>0x0?_0x15bdc0['temp']:0x0;loggerCatch(_0xb75b('0xc2'))(_0x4251e8);});};Dialer[_0xb75b('0x1a')]['getContactDialerIvr']=function(_0x5f3308,_0x4edc69,_0x51e33e,_0x19de25){return BPromise[_0xb75b('0xb4')]()['then'](cmHopper[_0xb75b('0xc3')](_0x5f3308,_0x4edc69,_0x51e33e))['catch'](function(_0x1683b4){_0x19de25[_0xb75b('0xc1')]-=_0x4edc69;_0x19de25[_0xb75b('0xc1')]=_0x19de25['temp']>0x0?_0x19de25[_0xb75b('0xc1')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x1683b4);});};Dialer[_0xb75b('0x1a')]['getVoiceQueueRtPauses']=function(_0x43ea5e){return BPromise[_0xb75b('0xb4')]()[_0xb75b('0xb5')](voiceQueueRt[_0xb75b('0xc4')](_0x43ea5e))['catch'](loggerCatch(_0xb75b('0xc5')));};Dialer[_0xb75b('0x1a')][_0xb75b('0xc6')]=function(_0x4734d1){return BPromise[_0xb75b('0xb4')]()['then'](cmHopper[_0xb75b('0xc6')](_0x4734d1))[_0xb75b('0xae')](loggerCatch(_0xb75b('0xc7')));};Dialer['prototype'][_0xb75b('0xc8')]=function(_0x15c18b){return BPromise[_0xb75b('0xb4')]()[_0xb75b('0xb5')](cmHopperHistory[_0xb75b('0xc8')](_0x15c18b))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0xb75b('0x1a')][_0xb75b('0xb0')]=function(_0x353755){if(!_['isUndefined'](_0x353755)&&_0x353755!==null){if(typeof _0x353755[_0xb75b('0x6f')]!==_0xb75b('0x99')){if(_0x353755[_0xb75b('0x6f')]>0x0){_0x353755[_0xb75b('0x6f')]-=0x1;}else{logger[_0xb75b('0x95')](_0xb75b('0xc9'));}}}else{logger[_0xb75b('0x95')](_0xb75b('0xca'));}};Dialer['prototype'][_0xb75b('0xcb')]=function(_0x44f032,_0x4cd287){var _0x5e1b1b=this;return function(_0x514d28){_0x5e1b1b[_0xb75b('0xb0')](_0x4cd287);logger['error'](_0x44f032,util[_0xb75b('0x96')](_0x514d28,{'showHidden':![],'depth':null}));};};Dialer[_0xb75b('0x1a')][_0xb75b('0xcc')]=function(_0x186e25,_0x442ce7,_0x58a2ec){var _0x323adc={'state':0x19,'statedesc':_0xb75b('0xcd')};this[_0xb75b('0xb0')](_0x442ce7);this[_0xb75b('0xce')](_[_0xb75b('0x8e')](_0x323adc,_['pick'](_0x58a2ec,[_0xb75b('0xcf'),'ListId',_0xb75b('0xd0'),_0xb75b('0xd1'),_0xb75b('0xd2')])),_0xb75b('0xd3'),_0xb75b('0xd4'));logger[_0xb75b('0x95')](_0x186e25);};Dialer[_0xb75b('0x1a')][_0xb75b('0xd5')]=function(_0x289db3){return _0x289db3===_0xb75b('0xd6');};Dialer[_0xb75b('0x1a')][_0xb75b('0xd7')]=function(_0x36ccd6){return!_[_0xb75b('0x3c')](_0x36ccd6)&&_0x36ccd6&&!_['isUndefined'](_0x36ccd6['name'])&&!_['isUndefined'](_0x36ccd6[_0xb75b('0xd8')])&&_0x36ccd6[_0xb75b('0xd8')]&&(this[_0xb75b('0x21')][util[_0xb75b('0x79')]('SIP/%s',_0x36ccd6[_0xb75b('0x3f')])][_0xb75b('0xac')]==='reachable'||this[_0xb75b('0x21')][util[_0xb75b('0x79')](_0xb75b('0xd9'),_0x36ccd6[_0xb75b('0x3f')])][_0xb75b('0xac')]===_0xb75b('0xda'));};Dialer[_0xb75b('0x1a')][_0xb75b('0xce')]=function(_0x44e049,_0x4bb270,_0x5b7f30){this[_0xb75b('0xc8')](_0x44e049)[_0xb75b('0xae')](loggerCatch(_0x4bb270));this[_0xb75b('0xc6')](_0x44e049)[_0xb75b('0xae')](loggerCatch(_0x5b7f30));};Dialer[_0xb75b('0x1a')][_0xb75b('0x36')]=function(_0x49c71b){var _0x3a8584=this[_0xb75b('0x26')][_0x49c71b[_0xb75b('0xdb')]];var _0x842b79;if(!_[_0xb75b('0xdc')](_0x49c71b)&&!_['isNil'](_0x49c71b[_0xb75b('0xdd')])&&!_[_0xb75b('0xdc')](_0x49c71b['variable'][_0xb75b('0xde')])&&_0x49c71b[_0xb75b('0xdf')]===_0xb75b('0xe0')&&_0x3a8584){if(_0x3a8584[_0xb75b('0x4d')]!==_0xb75b('0x78')&&this[_0xb75b('0x1e')][_0x3a8584[_0xb75b('0xb1')]][_0xb75b('0xe1')]&&_0x49c71b['value']===_0xb75b('0xe2')){delete this[_0xb75b('0x26')][_0x49c71b['uniqueid']];this[_0xb75b('0xb0')](this[_0xb75b('0x1e')][_0x3a8584[_0xb75b('0xb1')]]);this[_0xb75b('0x1e')][_0x3a8584[_0xb75b('0xb1')]][_0xb75b('0x5d')]+=0x1;this[_0xb75b('0x1e')][_0x3a8584['queue']][_0xb75b('0xe3')]+=0x1;_0x842b79=new Hangup(_0x3a8584,_0x49c71b);_0x842b79[_0xb75b('0xa6')]=0x12;_0x842b79['statedesc']=_0xb75b('0xe4');_0x842b79[_0xb75b('0xe5')]=_0xb75b('0xe6');ami[_0xb75b('0x4c')](_0xb75b('0xe7'),ut['buildObj'](_0x842b79,_0xb75b('0xe8')));this[_0xb75b('0xce')](_0x842b79,_0xb75b('0xe9'),_0xb75b('0xea'));}if(_0x3a8584[_0xb75b('0x4d')]!==_0xb75b('0x78')&&this[_0xb75b('0x1e')][_0x3a8584[_0xb75b('0xb1')]][_0xb75b('0xe1')]&&_0x49c71b[_0xb75b('0xeb')]===_0xb75b('0xec')){var _0x478db6=this;return new BPromise(function(_0x120252,_0x29b121){delete _0x478db6[_0xb75b('0x26')][_0x49c71b[_0xb75b('0xdb')]];_0x478db6[_0xb75b('0xb0')](_0x478db6[_0xb75b('0x1e')][_0x3a8584['queue']]);_0x478db6[_0xb75b('0x1e')][_0x3a8584[_0xb75b('0xb1')]][_0xb75b('0x5d')]+=0x1;_0x478db6[_0xb75b('0x1e')][_0x3a8584['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x5a2043=_0x478db6[_0xb75b('0x1e')][_0x3a8584[_0xb75b('0xb1')]];var _0x31ed58=new Hangup(_0x3a8584,_0x49c71b);_0x31ed58[_0xb75b('0xa6')]=0x13;_0x31ed58[_0xb75b('0xa7')]=_0xb75b('0xed');_0x31ed58[_0xb75b('0xe5')]=_0xb75b('0xe6');_0x31ed58['countmachineretry']+=0x1;_0x31ed58['countglobal']+=0x1;_0x31ed58[_0xb75b('0xe8')]=!![];ami['emit'](_0xb75b('0xe7'),ut[_0xb75b('0xee')](_0x31ed58,_0xb75b('0xe8')));_0x478db6[_0xb75b('0xc8')](_0x31ed58)[_0xb75b('0xae')](loggerCatch(_0xb75b('0xef')));if(_0x31ed58['countbusyretry']+_0x31ed58[_0xb75b('0xf0')]+_0x31ed58[_0xb75b('0xf1')]+_0x31ed58[_0xb75b('0xf2')]+_0x31ed58['countdropretry']+_0x31ed58[_0xb75b('0xf3')]+_0x31ed58[_0xb75b('0xf4')]+_0x31ed58[_0xb75b('0xf5')]>=_0x5a2043[_0xb75b('0xf6')]){_0x478db6['stateGlobal'](_0x31ed58,_0x120252,_0x29b121,_0xb75b('0xf7'));}else{if(_0x31ed58['countmachineretry']>=_0x5a2043['dialMachineMaxRetry']){_0x478db6[_0xb75b('0xf8')](_0x31ed58,_0x120252,_0x29b121,_0xb75b('0xf9'));}else{_0x478db6[_0xb75b('0xbd')]({'active':![],'countmachineretry':_0x31ed58[_0xb75b('0xf4')],'scheduledat':moment()[_0xb75b('0xfa')](_0x5a2043['dialMachineRetryFrequency'],_0xb75b('0xfb'))[_0xb75b('0x79')](_0xb75b('0xfc')),'ContactId':_0x31ed58[_0xb75b('0xcf')],'ListId':_0x31ed58[_0xb75b('0xfd')],'VoiceQueueId':_0x31ed58[_0xb75b('0xd1')]||undefined,'CampaignId':_0x31ed58[_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch('[rescheduleContact][Machine]'));_0x120252({'reschedule':0x1});}}});}if(_0x3a8584['type']===_0xb75b('0x78')&&this[_0xb75b('0x1f')][_0x3a8584[_0xb75b('0xb1')]][_0xb75b('0xe1')]&&_0x49c71b['value']===_0xb75b('0xe2')){delete this[_0xb75b('0x26')][_0x49c71b['uniqueid']];this[_0xb75b('0xb0')](this[_0xb75b('0x1f')][_0x3a8584[_0xb75b('0xb1')]]);_0x842b79=new Hangup(_0x3a8584,_0x49c71b);_0x842b79[_0xb75b('0xa6')]=0x12;_0x842b79[_0xb75b('0xa7')]=_0xb75b('0xe4');_0x842b79[_0xb75b('0xe5')]=_0xb75b('0xe6');ami['emit'](_0xb75b('0xe7'),ut['buildObj'](_0x842b79,_0xb75b('0xe8')));this[_0xb75b('0xce')](_0x842b79,_0xb75b('0xfe'),'[syncHangupInAMDIvr]');}if(_0x3a8584[_0xb75b('0x4d')]===_0xb75b('0x78')&&this[_0xb75b('0x1f')][_0x3a8584[_0xb75b('0xb1')]][_0xb75b('0xe1')]&&_0x49c71b[_0xb75b('0xeb')]==='MACHINE'){var _0x478db6=this;return new BPromise(function(_0x20489f,_0x20c978){delete _0x478db6[_0xb75b('0x26')][_0x49c71b[_0xb75b('0xdb')]];_0x478db6[_0xb75b('0xb0')](_0x478db6['campaigns'][_0x3a8584[_0xb75b('0xb1')]]);_0x478db6[_0xb75b('0x1f')][_0x3a8584['queue']]['outboundAnswerCallsDay']+=0x1;_0x478db6[_0xb75b('0x1f')][_0x3a8584[_0xb75b('0xb1')]][_0xb75b('0xe3')]+=0x1;var _0x4e520e=_0x478db6['campaigns'][_0x3a8584[_0xb75b('0xb1')]];var _0x1e915d=new Hangup(_0x3a8584,_0x49c71b);_0x1e915d[_0xb75b('0xa6')]=0x13;_0x1e915d[_0xb75b('0xa7')]='Machine';_0x1e915d[_0xb75b('0xe5')]='AMD';_0x1e915d[_0xb75b('0xf4')]+=0x1;_0x1e915d[_0xb75b('0xff')]+=0x1;_0x1e915d['amd']=!![];ami['emit'](_0xb75b('0xe7'),ut[_0xb75b('0xee')](_0x1e915d,'amd'));_0x478db6[_0xb75b('0xc8')](_0x1e915d)[_0xb75b('0xae')](loggerCatch(_0xb75b('0xef')));if(_0x1e915d[_0xb75b('0x100')]+_0x1e915d['countcongestionretry']+_0x1e915d['countnoanswerretry']+_0x1e915d[_0xb75b('0xf2')]+_0x1e915d['countdropretry']+_0x1e915d[_0xb75b('0xf3')]+_0x1e915d[_0xb75b('0xf4')]+_0x1e915d[_0xb75b('0xf5')]>=_0x4e520e[_0xb75b('0xf6')]){_0x478db6[_0xb75b('0x101')](_0x1e915d,_0x20489f,_0x20c978,_0xb75b('0xf7'));}else{if(_0x1e915d['countmachineretry']>=_0x4e520e[_0xb75b('0x102')]){_0x478db6[_0xb75b('0xf8')](_0x1e915d,_0x20489f,_0x20c978,_0xb75b('0xf9'));}else{_0x478db6[_0xb75b('0xbd')]({'active':![],'countmachineretry':_0x1e915d[_0xb75b('0xf4')],'scheduledat':moment()[_0xb75b('0xfa')](_0x4e520e[_0xb75b('0x103')],_0xb75b('0xfb'))['format'](_0xb75b('0xfc')),'ContactId':_0x1e915d[_0xb75b('0xcf')],'ListId':_0x1e915d[_0xb75b('0xfd')],'VoiceQueueId':_0x1e915d[_0xb75b('0xd1')]||undefined,'CampaignId':_0x1e915d[_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch('[rescheduleContact][Machine]'));_0x20489f({'reschedule':0x1});}}});}}};Dialer[_0xb75b('0x1a')][_0xb75b('0x104')]=function(_0x3c3ff2){var _0x287b4f=this[_0xb75b('0x26')][_0x3c3ff2['uniqueid']];var _0x2de0bb=this;var _0x4ee697;if(_0x287b4f&&_0x287b4f[_0xb75b('0x4d')]==='ivr'){delete this[_0xb75b('0x26')][_0x3c3ff2[_0xb75b('0xdb')]];this[_0xb75b('0xb0')](this[_0xb75b('0x1f')][_0x287b4f[_0xb75b('0xb1')]]);this[_0xb75b('0x1f')][_0x287b4f[_0xb75b('0xb1')]][_0xb75b('0x105')]+=0x1;_0x4ee697=new Hangup(_0x287b4f,_0x3c3ff2);this[_0xb75b('0xc8')](_0x4ee697)['catch'](loggerCatch(_0xb75b('0x106')));this[_0xb75b('0xc6')](_0x4ee697)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x287b4f&&_0x287b4f[_0xb75b('0x4d')]!==_0xb75b('0x78')&&isNotNull(this[_0xb75b('0x1e')][_0x287b4f[_0xb75b('0xb1')]][_0xb75b('0x107')])){delete this[_0xb75b('0x26')][_0x3c3ff2[_0xb75b('0xdb')]];this['updateOriginated'](this['voiceQueues'][_0x287b4f[_0xb75b('0xb1')]]);this[_0xb75b('0x1e')][_0x287b4f['queue']][_0xb75b('0x5d')]+=0x1;this['voiceQueues'][_0x287b4f[_0xb75b('0xb1')]][_0xb75b('0xe3')]+=0x1;_0x4ee697=new Hangup(_0x287b4f,_0x3c3ff2);_0x4ee697[_0xb75b('0xa6')]=0x10;_0x4ee697['statedesc']=_0xb75b('0x108');_0x4ee697['membername']=_0xb75b('0x109');this['createHistory'](_0x4ee697)[_0xb75b('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x4ee697)['catch'](loggerCatch(_0xb75b('0x10a')));}if(_0x287b4f&&_0x287b4f[_0xb75b('0x4d')]!==_0xb75b('0x78')&&!isNotNull(this[_0xb75b('0x1e')][_0x287b4f[_0xb75b('0xb1')]][_0xb75b('0x107')])){delete this['uniqueId'][_0x3c3ff2[_0xb75b('0xdb')]];this[_0xb75b('0xb0')](this['voiceQueues'][_0x287b4f[_0xb75b('0xb1')]]);this[_0xb75b('0x1e')][_0x287b4f['queue']][_0xb75b('0x65')]+=0x1;_0x4ee697=new Hangup(_0x287b4f,_0x3c3ff2);_0x4ee697[_0xb75b('0xa6')]=0xc;_0x4ee697[_0xb75b('0xa7')]=_0x3c3ff2[_0xb75b('0x10b')];_0x4ee697[_0xb75b('0xe5')]=_0xb75b('0x10c');this[_0xb75b('0xc8')](_0x4ee697)['catch'](loggerCatch(_0xb75b('0x106')));this[_0xb75b('0xc6')](_0x4ee697)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x10a')));}};Dialer[_0xb75b('0x1a')][_0xb75b('0x30')]=function(_0x29fdd6){var _0x1c7c55=this[_0xb75b('0x26')][_0x29fdd6['uniqueid']];var _0x2580cf=this;if(this[_0xb75b('0x1e')][_0x29fdd6['queue']]){if(_0x1c7c55&&_0x1c7c55[_0xb75b('0x4d')]!==_0xb75b('0x78')){delete this[_0xb75b('0x26')][_0x29fdd6[_0xb75b('0xdb')]];this[_0xb75b('0x1e')][_0x29fdd6['queue']][_0xb75b('0x5d')]+=0x1;var _0x43912f=new AgentComplete(_0x1c7c55,_0x29fdd6);if(_0x29fdd6[_0xb75b('0x10d')]===_0xb75b('0x10e')){_0x43912f[_0xb75b('0x10f')]=this[_0xb75b('0x1e')][_0x29fdd6[_0xb75b('0xb1')]][_0xb75b('0x110')]&&this['voiceQueues'][_0x29fdd6['queue']][_0xb75b('0x111')]?moment()['format'](_0xb75b('0xfc')):undefined;}this[_0xb75b('0xc8')](_0x43912f)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x112')));this[_0xb75b('0xc6')](_0x43912f)[_0xb75b('0xae')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xb75b('0x1a')][_0xb75b('0x29')]=function(_0xaf72a7){if(this['voiceQueues'][_0xaf72a7[_0xb75b('0xb1')]]){if(this[_0xb75b('0x26')][_0xaf72a7[_0xb75b('0xdb')]]&&this[_0xb75b('0x26')][_0xaf72a7[_0xb75b('0xdb')]][_0xb75b('0x4d')]!=='ivr'){this['updateOriginated'](this[_0xb75b('0x1e')][_0xaf72a7[_0xb75b('0xb1')]]);this[_0xb75b('0x26')][_0xaf72a7[_0xb75b('0xdb')]][_0xb75b('0x113')]=moment()['format'](_0xb75b('0xfc'));}}};Dialer[_0xb75b('0x1a')][_0xb75b('0x114')]=function(_0x2e8c63){this['createHistory'](_0x2e8c63)[_0xb75b('0xae')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb75b('0xc6')](_0x2e8c63)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x115')));};Dialer[_0xb75b('0x1a')][_0xb75b('0x2c')]=function(_0xf73d72){var _0x1c804e=this['uniqueId'][_0xf73d72[_0xb75b('0xdb')]];var _0x1d916c=this;if(this[_0xb75b('0x1e')][_0xf73d72[_0xb75b('0xb1')]]){if(_0x1c804e&&_0x1c804e[_0xb75b('0x4d')]!==_0xb75b('0x78')){delete this['uniqueId'][_0xf73d72[_0xb75b('0xdb')]];this[_0xb75b('0xb0')](this['voiceQueues'][_0xf73d72[_0xb75b('0xb1')]]);_0x1c804e[_0xb75b('0x116')]=moment()[_0xb75b('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4b324=new QueueCallerAbandon(_0x1c804e,_0xf73d72);if(getSeconds(_0x1c804e['droptime'],_0x1c804e['responsetime'])>=_0x1c804e[_0xb75b('0x117')]){this['voiceQueues'][_0xf73d72[_0xb75b('0xb1')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xb75b('0x1e')][_0xf73d72[_0xb75b('0xb1')]][_0xb75b('0x118')]+=0x1;this[_0xb75b('0x1e')][_0xf73d72['queue']][_0xb75b('0x6a')]+=0x1;_0x4b324[_0xb75b('0xa6')]=0xa;_0x4b324['statedesc']=_0xb75b('0x119');_0x4b324[_0xb75b('0x11a')]=_0xb75b('0x11b');_0x4b324[_0xb75b('0x10f')]=this[_0xb75b('0x1e')][_0xf73d72[_0xb75b('0xb1')]][_0xb75b('0x110')]?moment()['format'](_0xb75b('0xfc')):undefined;_0x4b324[_0xb75b('0x11c')]+=0x1;_0x4b324[_0xb75b('0xff')]+=0x1;if(_0x4b324[_0xb75b('0x11c')]>=this[_0xb75b('0x1e')][_0xf73d72['queue']][_0xb75b('0x11d')]){this[_0xb75b('0x114')](_0x4b324);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4b324[_0xb75b('0x11c')],'scheduledat':moment()['add'](this[_0xb75b('0x1e')][_0xf73d72[_0xb75b('0xb1')]][_0xb75b('0x11e')],_0xb75b('0xfb'))[_0xb75b('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1c804e['ContactId'],'ListId':_0x1c804e[_0xb75b('0xfd')],'VoiceQueueId':_0x1c804e['VoiceQueueId']||undefined,'CampaignId':_0x1c804e['CampaignId']||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x11f')));var _0x5d4528=new History(_0x4b324);_0x5d4528[_0xb75b('0xa6')]=0xa;_0x5d4528[_0xb75b('0xa7')]='Drop';_0x5d4528[_0xb75b('0x120')]=moment()[_0xb75b('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d4528[_0xb75b('0x121')]=_0x5d4528['starttime'];_0x5d4528[_0xb75b('0x122')]=_0x4b324[_0xb75b('0x122')];_0x5d4528['calleridnum']=_0x4b324[_0xb75b('0x123')];this[_0xb75b('0xc8')](_0x5d4528)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x124')));}}else{this['voiceQueues'][_0xf73d72[_0xb75b('0xb1')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xb75b('0x1e')][_0xf73d72[_0xb75b('0xb1')]][_0xb75b('0x60')]+=0x1;_0x4b324[_0xb75b('0xa6')]=0xb;_0x4b324[_0xb75b('0xa7')]=_0xb75b('0x125');_0x4b324[_0xb75b('0x11a')]=_0xb75b('0x126');_0x4b324[_0xb75b('0xf3')]+=0x1;_0x4b324['countglobal']+=0x1;if(_0x4b324['countabandonedretry']>=this[_0xb75b('0x1e')][_0xf73d72['queue']][_0xb75b('0x127')]){this[_0xb75b('0x114')](_0x4b324);}else{this[_0xb75b('0xbd')]({'active':![],'countabandonedretry':_0x4b324[_0xb75b('0xf3')],'scheduledat':moment()[_0xb75b('0xfa')](this[_0xb75b('0x1e')][_0xf73d72[_0xb75b('0xb1')]][_0xb75b('0x128')],_0xb75b('0xfb'))['format'](_0xb75b('0xfc')),'ContactId':_0x1c804e[_0xb75b('0xcf')],'ListId':_0x1c804e[_0xb75b('0xfd')],'VoiceQueueId':_0x1c804e[_0xb75b('0xd1')]||undefined,'CampaignId':_0x1c804e['CampaignId']||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x129')));var _0x5d4528=new History(_0x4b324);_0x5d4528[_0xb75b('0xa6')]=0xb;_0x5d4528[_0xb75b('0xa7')]='Abandoned';_0x5d4528[_0xb75b('0x120')]=moment()[_0xb75b('0x79')](_0xb75b('0xfc'));_0x5d4528['endtime']=_0x5d4528[_0xb75b('0x120')];_0x5d4528[_0xb75b('0x122')]=_0x4b324[_0xb75b('0x122')];_0x5d4528[_0xb75b('0x123')]=_0x4b324[_0xb75b('0x123')];this['createHistory'](_0x5d4528)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x12a')));}}}}};Dialer[_0xb75b('0x1a')]['syncNewExten']=function(_0x41e86d){if(this[_0xb75b('0x24')][_0x41e86d[_0xb75b('0xdb')]]){this[_0xb75b('0x24')][_0x41e86d[_0xb75b('0xdb')]][_0xb75b('0xad')]=_0x41e86d[_0xb75b('0xad')];}if(this[_0xb75b('0x26')][_0x41e86d['uniqueid']]){this[_0xb75b('0x26')][_0x41e86d['uniqueid']][_0xb75b('0xad')]=_0x41e86d[_0xb75b('0xad')];}};Dialer['prototype'][_0xb75b('0x38')]=function(_0x43a720){if(strategy[this[_0xb75b('0x1e')][this['actions'][_0x43a720[_0xb75b('0x12b')]][_0xb75b('0xb1')]][_0xb75b('0x4f')]]==='roundrobin'){if(this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]]&&_[_0xb75b('0xdc')](this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]]['locked'])&&_0x43a720[_0xb75b('0xac')]==='1'&&_0x43a720[_0xb75b('0x12c')]==='0'){if(this[_0xb75b('0x20')][_0x43a720[_0xb75b('0x12d')]]){if(!this[_0xb75b('0x20')][_0x43a720['stateinterface']]['locked']){this['agents'][_0x43a720['stateinterface']][_0xb75b('0x12e')]=!![];this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]]['locked']=!![];this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]][_0xb75b('0x12d')]=_0x43a720[_0xb75b('0x12d')];}}}}else if((strategy[this['voiceQueues'][this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]]['queue']][_0xb75b('0x4f')]]||'rrmemory')===_0xb75b('0x18')){if(this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]]){if(this['agents'][_0x43a720[_0xb75b('0x12d')]]){this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]]['stateinterface']=_0x43a720[_0xb75b('0x12d')];if(_[_0xb75b('0xdc')](this[_0xb75b('0x12f')][this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]][_0xb75b('0xb1')]])){this[_0xb75b('0x12f')][this[_0xb75b('0x24')][_0x43a720['actionid']][_0xb75b('0xb1')]]=[];}this['queueBooked'][this[_0xb75b('0x24')][_0x43a720[_0xb75b('0x12b')]][_0xb75b('0xb1')]][_0xb75b('0x130')](_['merge'](_[_0xb75b('0x131')](this['actions'][_0x43a720['actionid']],['idHopper','stateinterface']),{'status':_0x43a720['status'],'paused':_0x43a720[_0xb75b('0x12c')]}));}}}};function unlockQueueStatus(_0x10418d,_0x15b334){setTimeout(function(){if(_['isUndefined'](_0x10418d['queueStatusComplete'])){loggerBooked['error'](_0xb75b('0x132'),_0x15b334);}_0x10418d[_0xb75b('0x133')]=!![];loggerBooked[_0xb75b('0x7c')]('[booked][unlockQueueStatus]',_0x15b334,JSON[_0xb75b('0x48')](_[_0xb75b('0x131')](_0x10418d,[_0xb75b('0x3f'),_0xb75b('0x133')])));},0x1f3);}Dialer['prototype'][_0xb75b('0x3a')]=function(_0xba47a7){var _0x2b6188=this;var _0x2d5e77=_0x2b6188[_0xb75b('0x1e')][_0x2b6188['actions'][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xb1')]];if(strategy[this[_0xb75b('0x1e')][this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xb1')]][_0xb75b('0x4f')]]===_0xb75b('0x19')){if(this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]]&&this['actions'][_0xba47a7['actionid']][_0xb75b('0x12d')]){this[_0xb75b('0x1d')][_0xb75b('0x134')](this[_0xb75b('0x24')][_0xba47a7['actionid']]['idHopper'],this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0x12d')])['catch'](function(_0x842e7d){logger[_0xb75b('0x95')](_0xb75b('0x135'),util[_0xb75b('0x96')](_0x842e7d,{'showHidden':![],'depth':null}));})[_0xb75b('0x136')](function(){_0x2b6188[_0xb75b('0xb0')](_0x2b6188['voiceQueues'][_0x2b6188[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xb1')]]);_0x2b6188[_0xb75b('0x20')][_0x2b6188[_0xb75b('0x24')][_0xba47a7['actionid']][_0xb75b('0x12d')]][_0xb75b('0x12e')]=![];delete _0x2b6188[_0xb75b('0x24')][_0xba47a7['actionid']];unlockQueueStatus(_0x2d5e77);});}else{this[_0xb75b('0xb0')](this[_0xb75b('0x1e')][this[_0xb75b('0x24')][_0xba47a7['actionid']][_0xb75b('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xcf')],'ListId':this[_0xb75b('0x24')][_0xba47a7['actionid']]['ListId'],'VoiceQueueId':this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xd1')]||undefined,'CampaignId':this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x137')));delete this[_0xb75b('0x24')][_0xba47a7['actionid']];unlockQueueStatus(_0x2d5e77);}}else if((strategy[this['voiceQueues'][this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]]['queue']][_0xb75b('0x4f')]]||'rrmemory')==='rrmemory'){var _0x2d159b;if(this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]]&&!_[_0xb75b('0x45')](this[_0xb75b('0x12f')][this[_0xb75b('0x24')][_0xba47a7['actionid']][_0xb75b('0xb1')]])){if(this['queueBookedRR'][_0x2b6188[_0xb75b('0x24')][_0xba47a7['actionid']][_0xb75b('0xb1')]]){this['queueBookedRR'][_0x2b6188[_0xb75b('0x24')][_0xba47a7['actionid']]['queue']]=this[_0xb75b('0x27')][this[_0xb75b('0x24')][_0xba47a7['actionid']][_0xb75b('0xb1')]]?this[_0xb75b('0x27')][this['actions'][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xb1')]]:this[_0xb75b('0x12f')][this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xb1')]]?this[_0xb75b('0x12f')][this['actions'][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xb1')]][_0xb75b('0x138')]||0x0:0x0;}this[_0xb75b('0x12f')][this[_0xb75b('0x24')][_0xba47a7[_0xb75b('0x12b')]][_0xb75b('0xb1')]][_0xb75b('0x138')]=this[_0xb75b('0x27')][this['actions'][_0xba47a7[_0xb75b('0x12b')]]['queue']];for(var _0x3527b4=0x0;_0x3527b4=0x0;})[_0xb75b('0xae')](myreject(_0x3dec53)));}}else{_0x1b1a22[_0xb75b('0x130')](ami[_0xb75b('0xab')]({'action':_0xb75b('0x154'),'command':util[_0xb75b('0x79')](_0xb75b('0x157'),_0x1a1572,!_['isUndefined'](config[_0xb75b('0x158')][_0x4d3adf])?_0x4d3adf:'')})['then'](function(_0x3dc0e5){return _0x3dc0e5[_0xb75b('0x159')][_0xb75b('0x15a')]('true')>=0x0;})['catch'](myreject(_0x3dec53)));}BPromise[_0xb75b('0x15b')](_0x1b1a22)[_0xb75b('0xb5')](function(_0x30c922){var _0x5a43e0=_['some'](_0x30c922);if(_0x5a43e0){return _0x1400a8(_0x5a43e0);}else{_0x2a286b[_0xb75b('0x3d')]=_0x26e6a7?_0xb75b('0x15c'):'INTERVAL_IS_OVERTIME';return _0x3dec53(msgResponse(_0xb75b('0x15d'),'Failure',_0xb75b('0x15e')+_0x26e6a7+'\x20'+_0x406660+_0xb75b('0x15f')+util[_0xb75b('0x96')](_0x1a1572,{'showHidden':![],'depth':null})+_0xb75b('0x160')+_0x4d3adf));}})[_0xb75b('0xae')](function(_0x4b3aa7){return _0x3dec53(msgResponse(_0xb75b('0x14b'),_0xb75b('0x14d'),JSON[_0xb75b('0x48')](_0x4b3aa7)));});});};Dialer[_0xb75b('0x1a')]['checkDialMethod']=function(_0x551b1b){var _0x379397=this;return function(){switch(_0x551b1b[_0xb75b('0x5b')]){case _0xb75b('0x161'):freeVariablesPredictive(_0x551b1b);_0x379397[_0xb75b('0x162')](_0x551b1b,0x1);break;case'power':freeVariablesPredictive(_0x551b1b);_0x379397[_0xb75b('0x162')](_0x551b1b,_0x551b1b['dialPowerLevel']);break;case _0xb75b('0x9'):_0x379397[_0xb75b('0x9')](_0x551b1b);break;case'booked':freeVariablesPredictive(_0x551b1b);_0x379397[_0xb75b('0x162')](_0x551b1b,0x1);break;default:freeVariablesPredictive(_0x551b1b);logger['error'](_0xb75b('0x163'),_0x551b1b[_0xb75b('0x3f')],_0xb75b('0x164'));}};};Dialer[_0xb75b('0x1a')][_0xb75b('0x165')]=function(_0x389d76){var _0x33bddd=this;return function(){_0x33bddd[_0xb75b('0x166')](_0x389d76);};};Dialer['prototype'][_0xb75b('0xa')]=function(_0x2220ab){var _0x40aa7f=this;if(isNotPreview(_0x2220ab['dialMethod'])){if(isVoiceQueueOutbound(_0x2220ab[_0xb75b('0x4d')])&&isActive(_0x2220ab[_0xb75b('0x5a')])){_0x2220ab[_0xb75b('0xa2')]=!![];BPromise['resolve']()[_0xb75b('0xb5')](checkIsLoggedIn(_0x2220ab,_0x2220ab[_0xb75b('0x167')]))[_0xb75b('0xb5')](checkIsActive(_0x2220ab,_0x2220ab[_0xb75b('0x5a')]))[_0xb75b('0xb5')](checkInterval(_0x2220ab))['then'](_0x40aa7f[_0xb75b('0x147')](_0x2220ab))[_0xb75b('0xb5')](_0x40aa7f[_0xb75b('0x14a')](_0x2220ab[_0xb75b('0x168')],_0x2220ab[_0xb75b('0x169')],_0x2220ab['name'],_0x2220ab))['then'](_0x40aa7f[_0xb75b('0x14c')](_0x2220ab[_0xb75b('0x46')],_0x2220ab[_0xb75b('0x169')],_0x2220ab[_0xb75b('0x3f')],_0x2220ab))[_0xb75b('0xb5')](_0x40aa7f[_0xb75b('0x16a')](_0x2220ab))[_0xb75b('0xae')](loggerCatchQueueSummary(_0xb75b('0x16b'),_0x2220ab));}else{notSendMessagesQueue(_0x2220ab);}}else{freeVariablesPredictive(_0x2220ab);}};Dialer[_0xb75b('0x1a')]['syncCampaigns']=function(){var _0x550b6c=this;var _0x550269;for(var _0x9d2c48 in this[_0xb75b('0x1f')]){if(typeof this[_0xb75b('0x1f')][_0x9d2c48]!=='undefined'){_0x550269=this['campaigns'][_0x9d2c48];if(isCampaignIvr(_0x550269[_0xb75b('0x4d')])&&isActive(_0x550269[_0xb75b('0xd8')])){_0x550269['sendMessageOneNotActive']=!![];BPromise[_0xb75b('0xb4')]()[_0xb75b('0xb5')](checkIsActive(_0x550269,_0x550269[_0xb75b('0xd8')]))[_0xb75b('0xb5')](checkInterval(_0x550269))[_0xb75b('0xb5')](_0x550b6c[_0xb75b('0x147')](_0x550269))[_0xb75b('0xb5')](_0x550b6c[_0xb75b('0x14a')](_0x550269[_0xb75b('0x168')],_0x550269['dialTimezone'],_0x550269[_0xb75b('0x3f')],_0x550269))[_0xb75b('0xb5')](_0x550b6c['checkIfTimeIntervals'](_0x550269[_0xb75b('0x46')],_0x550269[_0xb75b('0x169')],_0x550269['name'],_0x550269))[_0xb75b('0xb5')](_0x550b6c[_0xb75b('0x165')](_0x550269))[_0xb75b('0xae')](loggerCatchQueueSummary('[syncCampaigns]',_0x550269));}else{notSendMessagesCampaign(_0x550269);}}}};function getCallerIdRandom(_0x361403,_0x1a16de){var _0x105640;var _0x247c40;var _0xb2584f;if(_0x1a16de<=0x0){_0x1a16de=0x1;}_0x105640=new RegExp(_0xb75b('0x16c')+_0x1a16de+'}$');_0x247c40=Math[_0xb75b('0x16d')](0xa,_0x1a16de-0x1);_0xb2584f=Math[_0xb75b('0x16d')](0xa,_0x1a16de)-0x1;return util[_0xb75b('0x79')]('%s',_[_0xb75b('0x16e')](_0x361403,_0x105640,_[_0xb75b('0x16f')](_0x247c40,_0xb2584f)));}function extractCalleridName(_0x256e26){var _0x5aa165=_0x256e26[_0xb75b('0x170')](/"(.*?)"/);return _0x5aa165?_0x5aa165[0x1]:_0x256e26;}function extractCalleridNumber(_0x5271df){var _0x25c236=_0x5271df[_0xb75b('0x170')](/<(.*?)>/);return _0x25c236?_0x25c236[0x1]:_0x5271df;}Dialer[_0xb75b('0x1a')][_0xb75b('0x171')]=function(_0x4a15ec,_0x428f00){var _0x42d144=this;var _0x3508be=uuid['v4']();this['actions'][_0x3508be]=new Action(_0x4a15ec,_0x428f00,_0x3508be);return new BPromise(function(_0x1b5bb4,_0x330925){if(_[_0xb75b('0x3c')](_0x4a15ec)&&typeof _0x4a15ec!==_0xb75b('0x172')){return _0x330925(msgResponse(_0xb75b('0x173'),_0xb75b('0x14d'),_0xb75b('0x174')));}if(_[_0xb75b('0x3c')](_0x428f00[_0xb75b('0x175')][_0xb75b('0x176')])||_0x428f00[_0xb75b('0x175')]['phone']===null){return _0x330925(msgResponse('originate','Failure',_0xb75b('0x177')));}var _0x5e488d={'XMD-CALLERID':_0x42d144['actions'][_0x3508be][_0xb75b('0x178')](),'XMD-AGI':_0x4a15ec['dialQueueProject']?util[_0xb75b('0x79')](_0xb75b('0x179'),ipAgi,_0x4a15ec['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x4a15ec[_0xb75b('0x110')]?util[_0xb75b('0x79')](_0xb75b('0x179'),ipAgi,_0x4a15ec['dialQueueProject2']):'NONE','XMD-QUEUE':_0x4a15ec[_0xb75b('0x4d')]===_0xb75b('0x4e')?util['format'](_0xb75b('0x17a'),_0x4a15ec[_0xb75b('0x3f')],_0x4a15ec[_0xb75b('0x17b')]||'',_0x4a15ec[_0xb75b('0x111')]?'c':'',_0x4a15ec['dialQueueTimeout']||0x3):_0xb75b('0x17c'),'XMD-CONTACTID':_0x428f00['ContactId'],'XMD-CDRTYPE':_0xb75b('0x17d'),'CALLERID(all)':_0x42d144[_0xb75b('0x24')][_0x3508be][_0xb75b('0x178')](),'XMD-AMD':_0x4a15ec['dialAMDActive']?'ACTIVE':_0xb75b('0x17c'),'XMD-DESTINATION':_0xb75b('0xe0')};if(_0x4a15ec[_0xb75b('0xe1')]){_0x5e488d[_0xb75b('0x17e')]=_0x4a15ec['dialAMDInitialSilence']||0x9c4;_0x5e488d['XMD-AMDGREETING']=_0x4a15ec['dialAMDGreeting']||0x5dc;_0x5e488d[_0xb75b('0x17f')]=_0x4a15ec[_0xb75b('0x180')]||0x320;_0x5e488d[_0xb75b('0x181')]=_0x4a15ec[_0xb75b('0x182')]||0x1388;_0x5e488d['XMD-AMDMINWORDLENGTH']=_0x4a15ec[_0xb75b('0x183')]||0x64;_0x5e488d[_0xb75b('0x184')]=_0x4a15ec[_0xb75b('0x185')]||0x32;_0x5e488d[_0xb75b('0x186')]=_0x4a15ec[_0xb75b('0x187')]||0x3;_0x5e488d[_0xb75b('0x188')]=_0x4a15ec[_0xb75b('0x189')]||0x100;_0x5e488d[_0xb75b('0x18a')]=_0x4a15ec[_0xb75b('0x18b')]||0x1388;}if(_0x4a15ec['type']===_0xb75b('0x4e')){_0x5e488d[_0xb75b('0x18c')]=_0x428f00[_0xb75b('0xd1')];}else{_0x5e488d['XMD-CAMPAIGNID']=_0x428f00[_0xb75b('0xd2')];}for(var _0xeb2cbc in _0x428f00['Contact']){if(typeof _0x428f00[_0xb75b('0x175')][_0xeb2cbc]!=='undefined'){if(isNotNull(_0x428f00[_0xb75b('0x175')][_0xeb2cbc])&&_0xeb2cbc!=='id'&&_0xeb2cbc!==_0xb75b('0x18d')&&_0xeb2cbc!=='createdAt'&&_0xeb2cbc!=='updatedAt'){_0x5e488d[util[_0xb75b('0x79')](_0xb75b('0x18e'),_0xb75b('0x18f'),_[_0xb75b('0x190')](_0xeb2cbc))]=_0x428f00['Contact'][_0xeb2cbc];}}}var _0x526c76=_0x42d144[_0xb75b('0xd7')](_0x4a15ec[_0xb75b('0x74')])?getCallerId(_0x4a15ec[_0xb75b('0x74')]['callerid'],_0x4a15ec[_0xb75b('0x191')],_0x4a15ec[_0xb75b('0x192')]>0x0?getCallerIdRandom(_0x4a15ec[_0xb75b('0x193')],_0x4a15ec['dialRandomLastDigitCallerIdNumber']):_0x4a15ec[_0xb75b('0x193')]):getCallerId(_[_0xb75b('0xdc')](_0x4a15ec[_0xb75b('0x148')])?_0x4a15ec['Trunk']['callerid']:_0x4a15ec[_0xb75b('0x148')]['callerid'],_0x4a15ec[_0xb75b('0x191')],_0x4a15ec['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4a15ec['dialOriginateCallerIdNumber'],_0x4a15ec['dialRandomLastDigitCallerIdNumber']):_0x4a15ec[_0xb75b('0x193')]);if(_0x526c76){_0x5e488d[_0xb75b('0x194')]=_0x42d144[_0xb75b('0x24')][_0x3508be][_0xb75b('0x195')]=extractCalleridName(_0x526c76);_0x5e488d['XMD-ORIGINATECALLERIDNUM']=_0x42d144['actions'][_0x3508be][_0xb75b('0x196')]=extractCalleridNumber(_0x526c76);}return ami[_0xb75b('0xab')]({'actionid':_0x3508be,'action':_0xb75b('0x173'),'channel':_0x42d144[_0xb75b('0xd7')](_0x4a15ec[_0xb75b('0x74')])?util[_0xb75b('0x79')](_0xb75b('0x197'),_0x4a15ec[_0xb75b('0x74')][_0xb75b('0x3f')],isNotNull(_0x4a15ec[_0xb75b('0x198')])?_0x4a15ec[_0xb75b('0x198')][_0xb75b('0x199')]()||'':'',_0x4a15ec[_0xb75b('0x19a')]>0x0?_0x428f00[_0xb75b('0x175')][_0xb75b('0x176')]['substring'](_0x4a15ec[_0xb75b('0x19a')]):_0x428f00[_0xb75b('0x175')][_0xb75b('0x176')]):util[_0xb75b('0x79')](_0xb75b('0x197'),_[_0xb75b('0xdc')](_0x4a15ec[_0xb75b('0x148')])?_0x4a15ec[_0xb75b('0x74')][_0xb75b('0x3f')]:_0x4a15ec['TrunkBackup'][_0xb75b('0x3f')],isNotNull(_0x4a15ec['dialPrefix'])?_0x4a15ec[_0xb75b('0x198')]['trim']()||'':'',_0x4a15ec['dialCutDigit']>0x0?_0x428f00[_0xb75b('0x175')][_0xb75b('0x176')][_0xb75b('0x19b')](_0x4a15ec[_0xb75b('0x19a')]):_0x428f00[_0xb75b('0x175')][_0xb75b('0x176')]),'callerid':_0x526c76,'Exten':'xcally-motion-dialer','Context':_0xb75b('0x19c'),'Priority':'1','variable':_0x5e488d,'timeout':(_0x4a15ec[_0xb75b('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3508be})[_0xb75b('0xb5')](function(_0x12f41f){return _0x1b5bb4(_0x12f41f);})[_0xb75b('0xae')](function(_0x9b64fe){_0x4a15ec[_0xb75b('0x63')]+=0x1;var _0x56e3f6=new History(_0x42d144[_0xb75b('0x24')][_0x3508be]);logger[_0xb75b('0x95')](util['format'](_0xb75b('0x19d'),JSON['stringify'](_0x9b64fe)));_0x56e3f6[_0xb75b('0xa6')]=0xe;_0x56e3f6[_0xb75b('0xa7')]=_0xb75b('0x19e');_0x56e3f6[_0xb75b('0x120')]=moment()['format'](_0xb75b('0xfc'));_0x56e3f6[_0xb75b('0x121')]=_0x56e3f6[_0xb75b('0x120')];_0x42d144[_0xb75b('0xc8')](_0x56e3f6)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x19f')));_0x42d144[_0xb75b('0xc6')](_0x56e3f6)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x19f')))[_0xb75b('0x136')](function(){delete _0x42d144[_0xb75b('0x24')][_0x3508be];return _0x330925(msgResponse(_0xb75b('0x173'),_0xb75b('0x47'),_0xb75b('0x1a0')));});});});};Dialer[_0xb75b('0x1a')][_0xb75b('0x2e')]=function(_0x3763c4){var _0x46ceea=this[_0xb75b('0x24')][_0x3763c4[_0xb75b('0x12b')]];if(_0x46ceea){delete this[_0xb75b('0x24')][_0x3763c4['actionid']];_0x46ceea[_0xb75b('0x1a1')]=moment()[_0xb75b('0x79')](_0xb75b('0xfc'));var _0x17e5a0=_0x46ceea[_0xb75b('0x4d')]===_0xb75b('0x78')?this['campaigns'][_0x46ceea[_0xb75b('0xb1')]]:this['voiceQueues'][_0x46ceea[_0xb75b('0x1a2')]()];if(!this[_0xb75b('0xd5')](_0x3763c4[_0xb75b('0x1a3')])){this[_0xb75b('0xb0')](_0x17e5a0);return this[_0xb75b('0x1a4')](_0x46ceea,_0x17e5a0,_0x3763c4)[_0xb75b('0xae')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x3763c4[_0xb75b('0xdb')]]=_0x46ceea;}};Dialer['prototype'][_0xb75b('0x1a5')]=function(_0x4afd67,_0xbf4c4e,_0x233120){var _0x3d655b=new History(_0xbf4c4e);if(_0x3d655b['countbusyretry']+_0x3d655b[_0xb75b('0xf0')]+_0x3d655b[_0xb75b('0xf1')]+_0x3d655b[_0xb75b('0xf2')]+_0x3d655b[_0xb75b('0x11c')]+_0x3d655b[_0xb75b('0xf3')]+_0x3d655b['countmachineretry']+_0x3d655b[_0xb75b('0xf5')]>=_0x233120['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x4afd67){case 0x3:if(_0x3d655b['countnoanswerretry']>=_0x233120[_0xb75b('0x1a6')]-0x1){return!![];}this[_0xb75b('0xbd')]({'active':![],'countnoanswerretry':_0x3d655b[_0xb75b('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x233120['dialNoAnswerRetryFrequency'],_0xb75b('0xfb'))['format'](_0xb75b('0xfc')),'ContactId':_0x3d655b['ContactId'],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b['CampaignId']||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1a7')));break;case 0x5:if(_0x3d655b[_0xb75b('0x100')]>=_0x233120[_0xb75b('0x1a8')]-0x1){return!![];}this[_0xb75b('0xbd')]({'active':![],'countbusyretry':_0x3d655b['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x233120[_0xb75b('0x1a9')],'minutes')[_0xb75b('0x79')](_0xb75b('0xfc')),'ContactId':_0x3d655b[_0xb75b('0xcf')],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b[_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1aa')));break;case 0x8:if(_0x3d655b['countcongestionretry']>=_0x233120[_0xb75b('0x1ab')]-0x1){return!![];}this[_0xb75b('0xbd')]({'active':![],'countcongestionretry':_0x3d655b[_0xb75b('0xf0')]+=0x1,'scheduledat':moment()[_0xb75b('0xfa')](_0x233120[_0xb75b('0x1ac')],_0xb75b('0xfb'))['format'](_0xb75b('0xfc')),'ContactId':_0x3d655b[_0xb75b('0xcf')],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b[_0xb75b('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3d655b[_0xb75b('0xf2')]>=_0x233120[_0xb75b('0x1ad')]-0x1){return!![];}else{this[_0xb75b('0xbd')]({'active':![],'countnosuchnumberretry':_0x3d655b['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xb75b('0xfa')](_0x233120[_0xb75b('0x1ae')],_0xb75b('0xfb'))[_0xb75b('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3d655b[_0xb75b('0xcf')],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b[_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1af')));}break;case 0xa:if(_0x3d655b[_0xb75b('0x11c')]>=_0x233120['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x3d655b[_0xb75b('0x11c')]+=0x1,'scheduledat':moment()[_0xb75b('0xfa')](_0x233120[_0xb75b('0x11e')],'minutes')[_0xb75b('0x79')](_0xb75b('0xfc')),'ContactId':_0x3d655b[_0xb75b('0xcf')],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b[_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x11f')));break;case 0xb:if(_0x3d655b[_0xb75b('0xf3')]>=_0x233120[_0xb75b('0x127')]-0x1){return!![];}this[_0xb75b('0xbd')]({'active':![],'countabandonedretry':_0x3d655b[_0xb75b('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x233120[_0xb75b('0x128')],_0xb75b('0xfb'))[_0xb75b('0x79')](_0xb75b('0xfc')),'ContactId':_0x3d655b[_0xb75b('0xcf')],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b[_0xb75b('0xd2')]||undefined})['catch'](loggerCatch(_0xb75b('0x129')));break;case 0x13:if(_0x3d655b[_0xb75b('0xf4')]>=_0x233120['dialMachineMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3d655b[_0xb75b('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x233120[_0xb75b('0x103')],_0xb75b('0xfb'))[_0xb75b('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3d655b[_0xb75b('0xcf')],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b[_0xb75b('0xd2')]||undefined})['catch'](loggerCatch(_0xb75b('0x1b0')));break;case 0x14:if(_0x3d655b['countagentrejectretry']>=_0x233120[_0xb75b('0x1b1')]-0x1){return!![];}this[_0xb75b('0xbd')]({'active':![],'countagentrejectretry':_0x3d655b[_0xb75b('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x233120['dialAgentRejectRetryFrequency'],_0xb75b('0xfb'))[_0xb75b('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3d655b['ContactId'],'ListId':_0x3d655b[_0xb75b('0xfd')],'VoiceQueueId':_0x3d655b[_0xb75b('0xd1')]||undefined,'CampaignId':_0x3d655b['CampaignId']||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1b2')));break;default:return!![];}};Dialer[_0xb75b('0x1a')][_0xb75b('0x1a4')]=function(_0x4efa0e,_0x468cfa,_0x27394e){var _0x294c38=this;var _0x3eb51f=new History(_0x4efa0e);return new BPromise(function(_0x270c80,_0x891083){if(_['isUndefined'](_0x468cfa)&&typeof _0x468cfa!==_0xb75b('0x172')){return _0x891083(msgResponse(_0xb75b('0x1b3'),_0xb75b('0x14d'),_0xb75b('0x1b4')));}if(_[_0xb75b('0x3c')](_0x27394e)&&typeof _0x27394e!=='object'){return _0x891083(msgResponse(_0xb75b('0x1b3'),_0xb75b('0x14d'),_0xb75b('0x1b5')));}switch(_0x27394e[_0xb75b('0x10d')]){case'0':_0x468cfa[_0xb75b('0x62')]+=0x1;_0x3eb51f[_0xb75b('0xa6')]=0x0;_0x3eb51f['statedesc']=_0xb75b('0x1b6');_0x3eb51f[_0xb75b('0xf2')]+=0x1;_0x3eb51f[_0xb75b('0xff')]+=0x1;ami['emit'](_0xb75b('0x1b7'),ut['buildObj'](_0x4efa0e,'nosuchnumber'));_0x294c38[_0xb75b('0xc8')](_0x3eb51f)[_0xb75b('0xae')](loggerCatch(_0xb75b('0xef')));if(_0x294c38[_0xb75b('0x1a5')](0x0,_0x4efa0e,_0x468cfa)){if(_0x3eb51f[_0xb75b('0xf2')]>=_0x468cfa['dialNoSuchNumberMaxRetry']){_0x294c38[_0xb75b('0xf8')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1b8'));}else{_0x294c38[_0xb75b('0x101')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1b8'));}}break;case'3':_0x468cfa['outboundNoAnswerCallsDay']+=0x1;_0x3eb51f[_0xb75b('0xa6')]=0x3;_0x3eb51f[_0xb75b('0xa7')]=_0xb75b('0x1b9');_0x3eb51f[_0xb75b('0xf1')]+=0x1;_0x3eb51f[_0xb75b('0xff')]+=0x1;ami['emit']('custom:agentnoanswer',ut[_0xb75b('0xee')](_0x4efa0e,_0xb75b('0x1ba')));_0x294c38['createHistory'](_0x3eb51f)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1bb')));if(_0x294c38[_0xb75b('0x1a5')](0x3,_0x4efa0e,_0x468cfa)){if(_0x3eb51f[_0xb75b('0xf1')]>=_0x468cfa[_0xb75b('0x1a6')]){_0x294c38[_0xb75b('0xf8')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1bc'));}else{_0x294c38['stateGlobal'](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1bc'));}}break;case'5':_0x468cfa[_0xb75b('0x1bd')]+=0x1;_0x3eb51f[_0xb75b('0xa6')]=0x5;_0x3eb51f[_0xb75b('0xa7')]=_0xb75b('0x1be');_0x3eb51f[_0xb75b('0x100')]+=0x1;_0x3eb51f[_0xb75b('0xff')]+=0x1;ami[_0xb75b('0x4c')](_0xb75b('0x1bf'),ut[_0xb75b('0xee')](_0x4efa0e,'busy'));_0x294c38['createHistory'](_0x3eb51f)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1c0')));if(_0x294c38[_0xb75b('0x1a5')](0x5,_0x4efa0e,_0x468cfa)){if(_0x3eb51f[_0xb75b('0x100')]>=_0x468cfa[_0xb75b('0x1a8')]){_0x294c38[_0xb75b('0xf8')](_0x3eb51f,_0x270c80,_0x891083,'reason\x205\x20busy');}else{_0x294c38[_0xb75b('0x101')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1c1'));}}break;case'8':_0x468cfa[_0xb75b('0x5e')]+=0x1;_0x3eb51f[_0xb75b('0xa6')]=0x8;_0x3eb51f[_0xb75b('0xa7')]='Congestion';_0x3eb51f[_0xb75b('0xf0')]+=0x1;_0x3eb51f['countglobal']+=0x1;ami['emit']('custom:agentcongestion',ut[_0xb75b('0xee')](_0x4efa0e,_0xb75b('0x1c2')));_0x294c38['createHistory'](_0x3eb51f)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1c3')));if(_0x294c38[_0xb75b('0x1a5')](0x8,_0x4efa0e,_0x468cfa)){if(_0x3eb51f[_0xb75b('0xf0')]>=_0x468cfa[_0xb75b('0x1ab')]){_0x294c38[_0xb75b('0xf8')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1c4'));}else{_0x294c38[_0xb75b('0x101')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1c4'));}}break;case'11':_0x468cfa[_0xb75b('0x1c5')]+=0x1;_0x3eb51f[_0xb75b('0xa6')]=0xb;_0x3eb51f[_0xb75b('0xa7')]=_0xb75b('0x125');_0x3eb51f[_0xb75b('0xf3')]+=0x1;_0x3eb51f[_0xb75b('0xff')]+=0x1;_0x294c38[_0xb75b('0xc8')](_0x3eb51f)['catch'](loggerCatch(_0xb75b('0x12a')));if(_0x294c38[_0xb75b('0x1a5')](0xb,_0x4efa0e,_0x468cfa)){if(_0x3eb51f[_0xb75b('0xf3')]>=_0x468cfa[_0xb75b('0x127')]){_0x294c38[_0xb75b('0xf8')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1c6'));}else{_0x294c38[_0xb75b('0x101')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1c6'));}}break;case'20':_0x468cfa['outboundRejectCallsDay']+=0x1;_0x3eb51f[_0xb75b('0xa6')]=0x14;_0x3eb51f[_0xb75b('0xa7')]=_0xb75b('0x1c7');_0x3eb51f[_0xb75b('0xf5')]+=0x1;_0x3eb51f[_0xb75b('0xff')]+=0x1;ami['emit'](_0xb75b('0x1c8'),ut[_0xb75b('0xee')](_0x4efa0e,_0xb75b('0x1c9')));_0x294c38[_0xb75b('0xc8')](_0x3eb51f)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1ca')));if(_0x294c38['checkRetriveMax'](0x14,_0x4efa0e,_0x468cfa)){if(_0x3eb51f[_0xb75b('0xf5')]>=_0x468cfa[_0xb75b('0x1b1')]){_0x294c38[_0xb75b('0xf8')](_0x3eb51f,_0x270c80,_0x891083,_0xb75b('0x1cb'));}else{_0x294c38[_0xb75b('0x101')](_0x3eb51f,_0x270c80,_0x891083,'reason\x2020\x20agentreject');}}break;default:_0x468cfa['outboundUnknownCallsDay']+=0x1;_0x3eb51f[_0xb75b('0xa6')]=0xc;_0x3eb51f['statedesc']=_0x27394e['reason'];_0x294c38['createHistory'](_0x3eb51f)[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1cc')));if(_0x294c38[_0xb75b('0x1a5')](_0x27394e[_0xb75b('0x10d')],_0x4efa0e,_0x468cfa)){if(_0x3eb51f[_0xb75b('0x100')]+_0x3eb51f['countcongestionretry']+_0x3eb51f[_0xb75b('0xf1')]+_0x3eb51f[_0xb75b('0xf2')]+_0x3eb51f[_0xb75b('0x11c')]+_0x3eb51f[_0xb75b('0xf3')]+_0x3eb51f['countmachineretry']+_0x3eb51f[_0xb75b('0xf5')]>=_0x468cfa[_0xb75b('0xf6')]){_0x294c38[_0xb75b('0x101')](_0x3eb51f,_0x270c80,_0x891083,_0x27394e['reason']);}else{_0x294c38[_0xb75b('0xf8')](_0x3eb51f,_0x270c80,_0x891083,_0x27394e['reason']);}}}});};Dialer[_0xb75b('0x1a')][_0xb75b('0x101')]=function(_0x3310c0,_0x26fe9,_0x4063b5,_0x195c35){var _0xaa44d2=new Final(_0x3310c0);_0xaa44d2[_0xb75b('0xa6')]=0xf;_0xaa44d2['statedesc']=_0xb75b('0x1cd');this[_0xb75b('0xf8')](_0xaa44d2,_0x26fe9,_0x4063b5,_0x195c35);};Dialer[_0xb75b('0x1a')][_0xb75b('0xf8')]=function(_0x59682b,_0x7b37c8,_0x229943,_0x207a62){this['moveContactManagedDialer'](_0x59682b)[_0xb75b('0xb5')](function(){return _0x7b37c8(msgResponse(_0xb75b('0x1b3'),_0xb75b('0xd6'),_0x207a62));})[_0xb75b('0xae')](function(){return _0x229943(msgResponse('[moveContactManagedDialer][0]',_0xb75b('0x14d'),_0xb75b('0x1ce')));});};Dialer[_0xb75b('0x1a')][_0xb75b('0x9')]=function(_0x106f4f){var _0x4b1260=_0x106f4f[_0xb75b('0x1cf')]/0x64;var _0x48efaa=_0x106f4f['outboundDropCallsDayTimeout']/(_0x106f4f['outboundDropCallsDayTimeout']+_0x106f4f[_0xb75b('0x5d')]);var _0x5c7e28=Math[_0xb75b('0x1d0')](_0x106f4f['predictiveIntervalAvailable']*(_0x106f4f[_0xb75b('0x1d1')]/0x64));var _0x234ae4=Math[_0xb75b('0x1d0')](_0x106f4f['predictiveIntervalAvailable']*(_0x106f4f[_0xb75b('0x1d2')]/0x64));var _0x450c2b=_0x106f4f[_0xb75b('0x50')]+_0x106f4f[_0xb75b('0x54')];var _0x26a1ad=Math['floor'](_0x106f4f[_0xb75b('0x89')]*_0x106f4f[_0xb75b('0x71')]*_0x106f4f[_0xb75b('0x6b')]*_0x106f4f[_0xb75b('0x6c')]);if(_['isUndefined'](_0x106f4f[_0xb75b('0x73')])){if(!_['isUndefined'](_0x106f4f[_0xb75b('0x72')])){_0x106f4f[_0xb75b('0x72')]=undefined;loggerPredictive['error'](_0xb75b('0x1d3'),_0xb75b('0x1d4'));}if(!_[_0xb75b('0x3c')](_0x106f4f[_0xb75b('0x90')])){loggerPredictive[_0xb75b('0x95')]('[startMethodPredictive][StartProgressive]',_0xb75b('0x1d5'));clearInterval(_0x106f4f[_0xb75b('0x90')]);_0x106f4f[_0xb75b('0x90')]=undefined;}_0x106f4f[_0xb75b('0x73')]=moment()[_0xb75b('0x79')](_0xb75b('0xfc'));loggerPredictive['info'](_0x106f4f[_0xb75b('0x3f')],_0xb75b('0x1d6'),_0x106f4f[_0xb75b('0x73')]);this['handlePower'](_0x106f4f,0x1);}else if(ifInterval(_0x106f4f[_0xb75b('0x1d7')],_0x106f4f[_0xb75b('0x73')])){this['handlePower'](_0x106f4f,0x1);loggerPredictiveCalls['info'](_0xb75b('0x1d8'),_0x106f4f[_0xb75b('0x73')],_0x106f4f[_0xb75b('0x3f')]);_0x106f4f[_0xb75b('0x89')]=0x0;_0x106f4f[_0xb75b('0x6a')]=0x0;}else if(_0x4b1260<_0x48efaa&&_0x106f4f[_0xb75b('0x1d9')]===_0xb75b('0x1da')){freeVariablesPredictive(_0x106f4f);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x1db'),_0xb75b('0x1dc'),_0x48efaa,_0xb75b('0x73'),_0x106f4f['name']);}else if(_0x26a1ad<_0x106f4f[_0xb75b('0x6a')]&&_0x106f4f[_0xb75b('0x1d9')]===_0xb75b('0x1da')){freeVariablesPredictive(_0x106f4f);loggerPredictive['info'](_0xb75b('0x1dd'),'Max\x20Drop\x20',_0x26a1ad,_0xb75b('0x1de'),_0x106f4f[_0xb75b('0x6a')],_0xb75b('0x73'),_0x106f4f[_0xb75b('0x3f')]);}else if(!ifInterval(_0x106f4f[_0xb75b('0x1d7')],_0x106f4f[_0xb75b('0x73')])&&_[_0xb75b('0x3c')](_0x106f4f[_0xb75b('0x72')])&&!_['isUndefined'](_0x106f4f['startProgressive'])){_0x106f4f['startPredictive']=moment()[_0xb75b('0x79')](_0xb75b('0xfc'));loggerPredictive[_0xb75b('0x7c')](_0x106f4f[_0xb75b('0x3f')],_0xb75b('0x1df'),_0x106f4f[_0xb75b('0x72')]);this[_0xb75b('0xba')](_0x106f4f[_0xb75b('0x1d7')])[_0xb75b('0xb5')](this['getDataPredictive'](_0x106f4f))[_0xb75b('0xb5')](mergeDataErlangB(_0x106f4f))[_0xb75b('0xb5')](this['startMethodPredictive'](_0x106f4f))[_0xb75b('0xae')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x106f4f));}else if(!ifInterval(_0x106f4f['dialPredictiveInterval'],_0x106f4f[_0xb75b('0x72')])){_0x106f4f['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x106f4f[_0xb75b('0x72')]=moment()[_0xb75b('0x79')](_0xb75b('0xfc'));loggerPredictive[_0xb75b('0x7c')](_0x106f4f['name'],_0xb75b('0x1e0'),_0x106f4f[_0xb75b('0x72')]);clearInterval(_0x106f4f[_0xb75b('0x90')]);_0x106f4f['handlePredictive']=undefined;this[_0xb75b('0xba')](_0x106f4f[_0xb75b('0x1d7')])[_0xb75b('0xb5')](this[_0xb75b('0x1e1')](_0x106f4f))[_0xb75b('0xb5')](mergeDataErlangB(_0x106f4f))['then'](this['startMethodPredictive'](_0x106f4f))[_0xb75b('0xae')](loggerCatchPredictive(_0xb75b('0x1e2'),_0x106f4f));}else if(_0x106f4f[_0xb75b('0x6e')]&&_0x450c2b<_0x106f4f[_0xb75b('0x6e')]-_0x234ae4){freeVariablesPredictive(_0x106f4f);loggerPredictive[_0xb75b('0x7c')](_0x106f4f[_0xb75b('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x450c2b,_0xb75b('0x1e3'),_0x106f4f['predictiveIntervalAvailable'],'-',_0x234ae4,'=',_0x106f4f[_0xb75b('0x6e')]-_0x234ae4,')');}else if(_0x106f4f['predictiveIntervalAvailable']&&_0x450c2b>_0x106f4f[_0xb75b('0x6e')]+_0x5c7e28){freeVariablesPredictive(_0x106f4f);loggerPredictive[_0xb75b('0x7c')](_0x106f4f[_0xb75b('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x450c2b,')\x20are\x20more\x20than\x20threshold\x20(',_0x106f4f[_0xb75b('0x6e')],'+',_0x5c7e28,'=',_0x106f4f[_0xb75b('0x6e')]+_0x5c7e28,')');}};Dialer[_0xb75b('0x1a')][_0xb75b('0x1e1')]=function(_0x3ebd13){var _0x3b9790=this;return function(_0x5a0e80){return new BPromise(function(_0x784909,_0x285511){_['merge'](_0x3ebd13,_0x5a0e80[0x0]);if(checkGetDataPredictive(_0x5a0e80[0x0])){var _0x2069f6=_0x3ebd13[_0xb75b('0x6e')]=_0x3ebd13[_0xb75b('0x54')]+_0x3ebd13['available'];var _0x5eeb94=_0x3ebd13[_0xb75b('0x1d7')]*0x3c;var _0x281188=_0x5a0e80[0x0][_0xb75b('0x82')]+_0x5a0e80[0x0][_0xb75b('0x67')];var _0x217028=(_0x5a0e80[0x0][_0xb75b('0x66')]+_0x5a0e80[0x0][_0xb75b('0x1e4')]+_0x5a0e80[0x0][_0xb75b('0x68')])/_0x5a0e80[0x0]['predictiveIntervalTotalCalls'];_0x3ebd13[_0xb75b('0x6b')]=_0x217028>0x0?_0x217028:0x1;switch(_0x3ebd13[_0xb75b('0x1d9')]){case _0xb75b('0x1da'):var _0x4953a5=_0x3ebd13[_0xb75b('0x1cf')]/0x64;return _0x3b9790[_0xb75b('0x1e5')](_0x2069f6,_0x5eeb94,_0x281188,_0x217028,_0x4953a5)[_0xb75b('0xb5')](function(_0x2fa994){return _0x784909(_0x2fa994);});case _0xb75b('0x1e6'):var _0x4d5d50=_0x3ebd13[_0xb75b('0x1cf')]/0x64;return _0x3b9790[_0xb75b('0x1e7')](_0x2069f6,_0x5eeb94,_0x281188,_0x217028,_0x4d5d50)[_0xb75b('0xb5')](function(_0x4b6ebb){return _0x784909(_0x4b6ebb);});default:return _0x285511(msgResponse(_0xb75b('0x1e8'),_0xb75b('0x14d'),_0xb75b('0x1e9')));}}else{return _0x285511(msgResponse(_0xb75b('0x1e8'),_0xb75b('0x14d'),_0xb75b('0x1ea')));}});};};Dialer[_0xb75b('0x1a')]['getDataPredictiveOld']=function(_0x3e8f97){var _0x571d51=this;return function(_0x59fd2d){return new BPromise(function(_0x7d14d6,_0x94c6f6){_[_0xb75b('0x8e')](_0x3e8f97,_0x59fd2d[0x0]);if(checkGetDataPredictive(_0x59fd2d[0x0])){loggerPredictive[_0xb75b('0x7c')](JSON[_0xb75b('0x48')](_0x59fd2d[0x0]));if(_0x3e8f97[_0xb75b('0x1d9')]===_0xb75b('0x1da')){return _0x571d51[_0xb75b('0xc4')](_0x3e8f97['id'])['then'](function(_0x52dcda){var _0x1fb6db=_0x3e8f97[_0xb75b('0x167')]-_0x52dcda[0x0][_0xb75b('0x1eb')];var _0x131e73=_0x3e8f97[_0xb75b('0x1d7')]*0x3c;var _0x1e4708=_0x59fd2d[0x0][_0xb75b('0x82')]+_0x59fd2d[0x0][_0xb75b('0x67')];var _0x578c22=(_0x59fd2d[0x0][_0xb75b('0x66')]+_0x59fd2d[0x0][_0xb75b('0x1e4')]+_0x59fd2d[0x0][_0xb75b('0x68')])/_0x59fd2d[0x0][_0xb75b('0x7f')];var _0x2ef34b=_0x3e8f97['dialPredictiveOptimizationPercentage']/0x64;_0x3e8f97['predictiveIntervalPauses']=_0x52dcda[0x0][_0xb75b('0x1eb')]||0x0;_0x3e8f97[_0xb75b('0x6b')]=_0x578c22>0x0?_0x578c22:0x1;return _0x571d51['abandonmentRate'](_0x1fb6db,_0x131e73,_0x1e4708,_0x578c22,_0x2ef34b);})['then'](function(_0x575530){return _0x7d14d6(_0x575530);})[_0xb75b('0xae')](function(_0x734496){return _0x94c6f6(msgResponse('[CatchErlangB]','Failure',JSON[_0xb75b('0x48')](_0x734496)));});}if(_0x3e8f97['dialPredictiveOptimization']===_0xb75b('0x1e6')){return _0x571d51[_0xb75b('0xc4')](_0x3e8f97['id'])['then'](function(_0x5ce357){var _0x53571d=_0x3e8f97[_0xb75b('0x167')]-_0x5ce357[0x0]['outboundQueuePauses'];var _0x50bc1f=_0x3e8f97['dialPredictiveInterval']*0x3c;var _0x3fb34a=_0x59fd2d[0x0]['predictiveIntervalAvgTalktime']+_0x59fd2d[0x0][_0xb75b('0x67')];var _0x37c597=(_0x59fd2d[0x0][_0xb75b('0x66')]+_0x59fd2d[0x0][_0xb75b('0x1e4')]+_0x59fd2d[0x0][_0xb75b('0x68')])/_0x59fd2d[0x0]['predictiveIntervalTotalCalls'];var _0x4926c1=_0x3e8f97[_0xb75b('0x1cf')]/0x64;_0x3e8f97['predictiveIntervalPauses']=_0x5ce357[0x0][_0xb75b('0x1eb')]||0x0;_0x3e8f97[_0xb75b('0x6b')]=_0x37c597>0x0?_0x37c597:0x1;return _0x571d51['busyFactor'](_0x53571d,_0x50bc1f,_0x3fb34a,_0x37c597,_0x4926c1);})[_0xb75b('0xb5')](function(_0x425996){return _0x7d14d6(_0x425996);})[_0xb75b('0xae')](function(_0x5896ec){return _0x94c6f6(msgResponse('[CatchErlangB]',_0xb75b('0x14d'),JSON['stringify'](_0x5896ec)));});}}else{return _0x94c6f6(msgResponse(_0xb75b('0x1e8'),_0xb75b('0x14d'),_0xb75b('0x1ea')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x24d960){var _0x2a2ccc=this;return function(){var _0x2b353f=0x0;var _0x404bd3=Math[_0xb75b('0x1ec')](_0x24d960['erlangCallToSecond']*0x3e8);if(_0x404bd3>0x0){_0x404bd3=_0x404bd3<0x64?0x64:_0x404bd3;loggerPredictive[_0xb75b('0x7c')](_0x24d960['name'],_0xb75b('0x1ed'),_0x404bd3,_0xb75b('0x49'));_0x24d960[_0xb75b('0x90')]=setInterval(function(){_0x2a2ccc[_0xb75b('0x90')](_0x24d960);loggerPredictiveCalls[_0xb75b('0x7c')](_0xb75b('0x1ee'),_0x2b353f+=0x1);},_0x404bd3);}else{loggerPredictive[_0xb75b('0x7c')](_0x24d960['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xb75b('0x1a')]['checkContactBlack']=function(_0x43c294,_0x4c7bd5){var _0x5ee4fb=this;return function(_0x26f13c){if(_[_0xb75b('0x45')](_0x26f13c)){if(_['isNil'](_0x4c7bd5['UserId'])||!_0x4c7bd5[_0xb75b('0x1ef')]){if(_0x43c294[_0xb75b('0x5b')]===_0xb75b('0x1f0')){_0x43c294[_0xb75b('0x133')]=_[_0xb75b('0x3c')](_0x43c294['queueStatusComplete'])?!![]:_0x43c294['queueStatusComplete'];var _0x572829=uuid['v4']();_0x5ee4fb['actions'][_0x572829]=new Action(_0x43c294,_0x4c7bd5,_0x572829);loggerBooked[_0xb75b('0x7c')](_0xb75b('0x1f1'),_0x572829,'queueStatusComplete:\x20',JSON[_0xb75b('0x48')](_0x43c294[_0xb75b('0x133')]),_0xb75b('0x1f2'),_0x43c294[_0xb75b('0x3f')]);if(_0x43c294[_0xb75b('0x133')]){_0x43c294[_0xb75b('0x133')]=![];_0x5ee4fb[_0xb75b('0x12f')][_0x5ee4fb[_0xb75b('0x24')][_0x572829]['queue']]=[];ami['Action']({'actionid':_0x572829,'action':'queuestatus','queue':_0x43c294[_0xb75b('0x3f')]})['catch'](function(){_0x5ee4fb[_0xb75b('0xb0')](_0x43c294);_0x5ee4fb['rescheduleContact']({'active':![],'ContactId':_0x5ee4fb[_0xb75b('0x24')][_0x572829][_0xb75b('0xcf')],'ListId':_0x5ee4fb[_0xb75b('0x24')][_0x572829][_0xb75b('0xfd')],'VoiceQueueId':_0x5ee4fb[_0xb75b('0x24')][_0x572829][_0xb75b('0xd1')]||undefined,'CampaignId':_0x5ee4fb[_0xb75b('0x24')][_0x572829]['CampaignId']||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1f3')));delete _0x5ee4fb[_0xb75b('0x24')][_0x572829];});}else{loggerBooked[_0xb75b('0x7c')](_0xb75b('0x1f4'),JSON[_0xb75b('0x48')](_0x43c294[_0xb75b('0x133')]),_0xb75b('0x1f2'),_0x43c294[_0xb75b('0x3f')]);_0x5ee4fb[_0xb75b('0xb0')](_0x43c294);_0x5ee4fb[_0xb75b('0xbd')]({'active':![],'ContactId':_0x5ee4fb[_0xb75b('0x24')][_0x572829][_0xb75b('0xcf')],'ListId':_0x5ee4fb[_0xb75b('0x24')][_0x572829][_0xb75b('0xfd')],'VoiceQueueId':_0x5ee4fb[_0xb75b('0x24')][_0x572829]['VoiceQueueId']||undefined,'CampaignId':_0x5ee4fb['actions'][_0x572829][_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1f3')));delete _0x5ee4fb[_0xb75b('0x24')][_0x572829];}}else{return _0x5ee4fb[_0xb75b('0x171')](_0x43c294,_0x4c7bd5);}}else{if(getDiff(_0x4c7bd5[_0xb75b('0x1f5')])<_0x43c294[_0xb75b('0x1f6')]*0x3c){if(_0x4c7bd5['Agent']&&!_0x4c7bd5[_0xb75b('0x1f7')]['voicePause']){_0x5ee4fb['preview'][_0xb75b('0x134')](_0x4c7bd5['id'])[_0xb75b('0x136')](function(){_0x5ee4fb[_0xb75b('0xb0')](_0x43c294);});}else{_0x5ee4fb[_0xb75b('0xbf')]({'active':![]},_0x4c7bd5['id'],0x1)[_0xb75b('0x136')](function(){_0x5ee4fb[_0xb75b('0xb0')](_0x43c294);});}}else{_0x43c294[_0xb75b('0x1f8')]+=0x1;_0x5ee4fb[_0xb75b('0xb0')](_0x43c294);if(_0x43c294[_0xb75b('0x1f9')]){_0x5ee4fb[_0xb75b('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4c7bd5[_0xb75b('0xcf')],'ListId':_0x4c7bd5[_0xb75b('0xfd')],'VoiceQueueId':_0x4c7bd5[_0xb75b('0xd1')]||undefined,'CampaignId':_0x4c7bd5[_0xb75b('0xd2')]||undefined})[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1fa')));_0x5ee4fb[_0xb75b('0xc8')](createObjHistory(_0x43c294,_0x4c7bd5,_0xb75b('0x1fb'),0x17,_0xb75b('0x1fc')))[_0xb75b('0xae')](loggerCatch(_0xb75b('0x1fd')));}else{_0x5ee4fb[_0xb75b('0xce')](createObjHistory(_0x43c294,_0x4c7bd5,_0xb75b('0x1fe'),0x16,_0xb75b('0x1ff')),_0xb75b('0x200'),_0xb75b('0x201'));}}}}else{_0x43c294[_0xb75b('0x202')]+=0x1;_0x5ee4fb['saveInDb'](createObjHistory(_0x43c294,_0x4c7bd5,_0xb75b('0x203'),0xd,_0xb75b('0x204')),_0xb75b('0x205'),_0xb75b('0x206'));throw'inBlackList';}};};Dialer[_0xb75b('0x1a')][_0xb75b('0x166')]=function(_0x37839b){var _0x114553=this;var _0x4983df=_0x37839b[_0xb75b('0x207')]-_0x37839b[_0xb75b('0x6f')]-_0x37839b[_0xb75b('0xc1')];emitCampaignSummary(_0x37839b);if(_0x4983df>0x0){if(_0x4983df>this[_0xb75b('0x22')]){_0x4983df=this[_0xb75b('0x22')];}_0x37839b[_0xb75b('0xc1')]+=_0x4983df;this[_0xb75b('0xc3')](_0x37839b['id'],_0x4983df,_0x37839b[_0xb75b('0x208')],_0x37839b)[_0xb75b('0xb5')](function(_0x48fed2){_0x37839b['temp']-=_0x4983df;_0x37839b[_0xb75b('0xc1')]=_0x37839b['temp']>0x0?_0x37839b[_0xb75b('0xc1')]:0x0;if(!checkContactEmpty(_0x48fed2)){_0x37839b[_0xb75b('0x3d')]=_0xb75b('0xa0');logger[_0xb75b('0x7c')](_0xb75b('0x209')+_0x37839b[_0xb75b('0x3f')]);}else{_0x37839b[_0xb75b('0x6f')]+=_0x48fed2[_0xb75b('0x98')];_0x37839b['message']=_0xb75b('0x20a');for(var _0x1282fa=0x0;_0x1282fa<_0x48fed2['length'];_0x1282fa+=0x1){_0x37839b[_0xb75b('0x20b')]+=0x1;if(_['isNil'](_0x48fed2[_0x1282fa])||_['isNil'](_0x48fed2[_0x1282fa][_0xb75b('0x175')])||_['isNil'](_0x48fed2[_0x1282fa]['Contact']['phone'])){_0x114553[_0xb75b('0xcc')](_0xb75b('0x20c'),_0x37839b,_0x48fed2[_0x1282fa]);}else{_0x114553[_0xb75b('0xb8')](_[_0xb75b('0x131')](_0x48fed2[_0x1282fa],['CampaignId',_0xb75b('0x20d')]))[_0xb75b('0xb5')](_0x114553[_0xb75b('0x20e')](_0x37839b,_0x48fed2[_0x1282fa]))[_0xb75b('0xae')](_0x114553[_0xb75b('0xcb')](_0xb75b('0x20f'),_0x37839b));}}}})[_0xb75b('0xae')](loggerGetContactDialer('[getContactCampaign2]',_0x37839b,_0x4983df));}};Dialer['prototype'][_0xb75b('0x162')]=function(_0x7f37d3,_0x5bfbf8){var _0x4f425e=this;var _0x5967f3=[];var _0x382dc3=_0x5bfbf8>=0x1?_0x5bfbf8:0x1;if(_0x7f37d3['dialMethod']==='booked'){_0x382dc3=0x1;}var _0x53ba61=Math['floor'](_0x7f37d3[_0xb75b('0x50')]*_0x382dc3)-_0x7f37d3[_0xb75b('0x6f')]-_0x7f37d3[_0xb75b('0xc1')];emitVoiceQueueSummary(_0x7f37d3);if(_0x7f37d3['dialLimitQueue']>0x0){var _0x39f8fc=_0x7f37d3[_0xb75b('0x210')]-_0x7f37d3['originated']-_0x7f37d3[_0xb75b('0x54')]-_0x7f37d3['temp']-_0x7f37d3['pTalking'];if(_0x53ba61>_0x39f8fc){_0x53ba61=_0x39f8fc;}}if(_0x53ba61>0x0){if(_0x7f37d3[_0xb75b('0x5b')]==='booked'){_0x53ba61=0x1;}if(_0x53ba61>this['maxNumberOriginate']){_0x53ba61=this['maxNumberOriginate'];}_0x7f37d3[_0xb75b('0xc1')]+=_0x53ba61;for(var _0x167cb4 in this['agents']){if(typeof this['agents'][_0x167cb4]!=='undefined'){if(this[_0xb75b('0x20')][_0x167cb4][_0xb75b('0xa6')]===_0xb75b('0x211')&&this[_0xb75b('0x20')][_0x167cb4][_0xb75b('0xac')]===_0xb75b('0x212')){_0x5967f3['push'](this[_0xb75b('0x20')][_0x167cb4]['id']);}}}this[_0xb75b('0xc0')](_0x7f37d3['id'],_0x5967f3,_0x53ba61,_0x7f37d3[_0xb75b('0x208')],_0x7f37d3)[_0xb75b('0xb5')](function(_0x3b7974){_0x7f37d3[_0xb75b('0xc1')]-=_0x53ba61;_0x7f37d3[_0xb75b('0xc1')]=_0x7f37d3[_0xb75b('0xc1')]>0x0?_0x7f37d3['temp']:0x0;if(!checkContactEmpty(_0x3b7974)){_0x4f425e[_0xb75b('0x213')](_0x7f37d3)['then'](sendMessageReschedule(_0x7f37d3))[_0xb75b('0xae')](loggerCatch(_0xb75b('0x214')));}else{_0x7f37d3[_0xb75b('0x6f')]+=_0x3b7974['length'];_0x7f37d3[_0xb75b('0x3d')]=_0x7f37d3[_0xb75b('0x5b')]===_0xb75b('0x1f0')?_0xb75b('0x215'):'RUNNING';for(var _0x14b015=0x0;_0x14b015<_0x3b7974[_0xb75b('0x98')];_0x14b015+=0x1){if(_[_0xb75b('0xdc')](_0x3b7974[_0x14b015])||_['isNil'](_0x3b7974[_0x14b015][_0xb75b('0x175')])||_[_0xb75b('0xdc')](_0x3b7974[_0x14b015][_0xb75b('0x175')][_0xb75b('0x176')])){_0x4f425e['emptyContact']('[actionOriginate]\x20',_0x7f37d3,_0x3b7974[_0x14b015]);}else{_0x4f425e[_0xb75b('0xb6')](_[_0xb75b('0x131')](_0x3b7974[_0x14b015],['VoiceQueueId',_0xb75b('0x20d')]))['then'](_0x4f425e[_0xb75b('0x20e')](_0x7f37d3,_0x3b7974[_0x14b015]))['catch'](_0x4f425e[_0xb75b('0xcb')](_0xb75b('0x20c'),_0x7f37d3));}}}})['catch'](loggerGetContactDialer(_0xb75b('0x216'),_0x7f37d3,_0x53ba61));}};Dialer[_0xb75b('0x1a')][_0xb75b('0x90')]=function(_0x5ae916){if(_0x5ae916[_0xb75b('0x210')]>0x0){var _0x28f7e6=_0x5ae916[_0xb75b('0x210')]-_0x5ae916[_0xb75b('0x6f')]-_0x5ae916[_0xb75b('0x54')];if(_0x28f7e6>0x0){this[_0xb75b('0x217')](_0x5ae916);}else{loggerPredictiveCalls[_0xb75b('0x7c')]('[handlePredictive][limitChannel]');}}else{this[_0xb75b('0x217')](_0x5ae916);}};Dialer['prototype'][_0xb75b('0x217')]=function(_0x54a886){var _0x53abf5=this;var _0x48f761=[];_0x54a886[_0xb75b('0x6f')]+=0x1;for(var _0x2b42ea in this['agents']){if(typeof this['agents'][_0x2b42ea]!==_0xb75b('0x99')){if(this[_0xb75b('0x20')][_0x2b42ea][_0xb75b('0xa6')]===_0xb75b('0x211')&&this['agents'][_0x2b42ea][_0xb75b('0xac')]===_0xb75b('0x212')){_0x48f761[_0xb75b('0x130')](this[_0xb75b('0x20')][_0x2b42ea]['id']);}}}this[_0xb75b('0xc0')](_0x54a886['id'],_0x48f761,0x1,_0x54a886[_0xb75b('0x208')],_0x54a886)[_0xb75b('0xb5')](function(_0x32f630){if(!checkContactEmpty(_0x32f630)){checkContactLowerLimitOriginate(_0x54a886,0x1,0x0);_0x53abf5[_0xb75b('0x213')](_0x54a886)[_0xb75b('0xb5')](sendMessageReschedule(_0x54a886))[_0xb75b('0xae')](loggerCatch(_0xb75b('0x214')));}else{_0x54a886[_0xb75b('0x3d')]='RUNNING';if(_[_0xb75b('0xdc')](_0x32f630[0x0])||_[_0xb75b('0xdc')](_0x32f630[0x0][_0xb75b('0x175')])||_[_0xb75b('0xdc')](_0x32f630[0x0][_0xb75b('0x175')][_0xb75b('0x176')])){_0x53abf5[_0xb75b('0xcc')]('[actionOriginate]\x20',_0x54a886,_0x32f630[0x0]);}else{_0x53abf5[_0xb75b('0xb6')](_[_0xb75b('0x131')](_0x32f630[0x0],[_0xb75b('0xd1'),_0xb75b('0x20d')]))[_0xb75b('0xb5')](_0x53abf5[_0xb75b('0x20e')](_0x54a886,_0x32f630[0x0]))['catch'](_0x53abf5[_0xb75b('0xcb')](_0xb75b('0x218'),_0x54a886));}}})[_0xb75b('0xae')](loggerGetContactDialer(_0xb75b('0x219'),_0x54a886,0x1));emitVoiceQueueSummary(_0x54a886);};Dialer[_0xb75b('0x1a')]['abandonmentRate']=function(_0x2387d3,_0x179baa,_0x3c8659,_0x42e6ef,_0x29f758,_0x3bab1f){loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x21a'));loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x21b'),_0x2387d3);loggerPredictive[_0xb75b('0x7c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x179baa);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x21c'),_0x3c8659);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x21d'),_0x42e6ef);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x21e'),_0x29f758);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x83'));return new BPromise(function(_0x58ce68,_0x553a6a){if(_0x2387d3<=0x0||isNaN(_0x2387d3)){return _0x553a6a(msgResponse(_0xb75b('0x21f'),'Error','m\x20=\x20'+_0x2387d3));}if(_0x3c8659<=0x0||isNaN(_0x3c8659)){return _0x553a6a(msgResponse(_0xb75b('0x21f'),_0xb75b('0x47'),_0xb75b('0x220')+_0x3c8659));}if(_0x42e6ef<=0x0||isNaN(_0x42e6ef)){return _0x553a6a(msgResponse(_0xb75b('0x21f'),_0xb75b('0x47'),_0xb75b('0x221')+_0x42e6ef));}if(_0x179baa<=0x0||isNaN(_0x179baa)){return _0x553a6a(msgResponse(_0xb75b('0x21f'),'Error',_0xb75b('0x222')+_0x179baa));}if(_0x29f758<=0x0||isNaN(_0x29f758)){return _0x553a6a(msgResponse(_0xb75b('0x21f'),_0xb75b('0x47'),_0xb75b('0x223')+_0x29f758));}_0x3bab1f=_0x3bab1f||0x0;var _0x5dc691=0x1/_0x3c8659;var _0x48ff4d=0x0;var _0x550eb6=0x0;var _0x12161b=0x0;var _0x47d9f6=0x0;for(var _0x4f2e09=0x0;_0x12161b<_0x29f758;_0x4f2e09+=0x1){_0x550eb6=_0x4f2e09/_0x179baa;_0x48ff4d=(_0x42e6ef*_0x550eb6+_0x3bab1f)/_0x5dc691;_0x12161b=erlangb(_0x48ff4d,_0x2387d3);_0x47d9f6=_0x48ff4d/_0x2387d3*(0x1-erlangb(_0x48ff4d,_0x2387d3));}return _0x58ce68({'erlangCalls':_0x4f2e09,'erlangCallToSecond':_0x179baa/_0x4f2e09,'erlangAbandonmentRate':_0x12161b,'erlangBusyFactor':_0x47d9f6});});};Dialer[_0xb75b('0x1a')]['busyFactor']=function(_0x32ef07,_0x251292,_0x3543ed,_0x3d6547,_0x364d99,_0x3853c4){loggerPredictive['info'](_0xb75b('0x224'));loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x21b'),_0x32ef07);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x225'),_0x251292);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x21c'),_0x3543ed);loggerPredictive['info'](_0xb75b('0x21d'),_0x3d6547);loggerPredictive[_0xb75b('0x7c')](_0xb75b('0x226'),_0x364d99);loggerPredictive[_0xb75b('0x7c')]('---------------------------');return new BPromise(function(_0x432f6e,_0x5249e6){if(_0x32ef07<=0x0||isNaN(_0x32ef07)){return _0x5249e6(msgResponse(_0xb75b('0x227'),_0xb75b('0x47'),_0xb75b('0x228')+_0x32ef07));}if(_0x3543ed<=0x0||isNaN(_0x3543ed)){return _0x5249e6(msgResponse(_0xb75b('0x227'),_0xb75b('0x47'),_0xb75b('0x220')+_0x3543ed));}if(_0x3d6547<=0x0||isNaN(_0x3d6547)){return _0x5249e6(msgResponse(_0xb75b('0x227'),_0xb75b('0x47'),'p\x20=\x20'+_0x3d6547));}if(_0x251292<=0x0||isNaN(_0x251292)){return _0x5249e6(msgResponse(_0xb75b('0x227'),_0xb75b('0x47'),_0xb75b('0x222')+_0x251292));}if(_0x364d99<=0x0||isNaN(_0x364d99)){return _0x5249e6(msgResponse('[busyFactor]',_0xb75b('0x47'),_0xb75b('0x229')+_0x364d99));}_0x3853c4=_0x3853c4||0x0;var _0x582891=0x1/_0x3543ed;var _0x406b98=0x0;var _0x52a1e0=0x0;var _0x4dc0e9=0x0;var _0x461fc4=0x0;for(var _0x274261=0x0;_0x461fc4<_0x364d99;_0x274261+=0x1){_0x52a1e0=_0x274261/_0x251292;_0x406b98=(_0x3d6547*_0x52a1e0+_0x3853c4)/_0x582891;_0x4dc0e9=erlangb(_0x406b98,_0x32ef07);_0x461fc4=_0x406b98/_0x32ef07*(0x1-erlangb(_0x406b98,_0x32ef07));}return _0x432f6e({'erlangCalls':_0x274261,'erlangCallToSecond':_0x251292/_0x274261,'erlangAbandonmentRate':_0x4dc0e9,'erlangBusyFactor':_0x461fc4});});};module[_0xb75b('0x22a')]=Dialer; \ No newline at end of file +var _0x8c51=['is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','enqueue','status','channel','catch','No\x20such\x20channel','queue','updateOriginated','campaigns','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','uniqueid','isNil','variable','exten','xcally-motion-dialer','dialAMDActive','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','countglobal','amd','countbusyretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','rescheduleContact','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr]','countcongestionretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','CampaignId','syncHangup','ivrAnswerCallsDay','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','Unknow','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','add','dialDropRetryFrequency','starttime','endtime','calleridname','calleridnum','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','actions','actionid','strategy','locked','paused','stateinterface','queueBooked','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','interval','content','true','command','iftime\x20%s,%s','indexOf','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','checkDialMethod','progressive','handlePower','power','launchHandleIvr','handleIvr','dialMethod','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','tags','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','[syncAgentComplete][createHistory][5]','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','reason','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','agentBusyFactor','[CatchErlangB]','one\x20call\x20every:','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','reachable','[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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','util','lodash','bluebird','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperBlack','./action','./history','./final','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','type','outbound','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','waiting','dialActive','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20'];(function(_0x4da9f9,_0x457828){var _0x2ea1f6=function(_0x5827ed){while(--_0x5827ed){_0x4da9f9['push'](_0x4da9f9['shift']());}};_0x2ea1f6(++_0x457828);}(_0x8c51,0x172));var _0x18c5=function(_0x556638,_0x1663d0){_0x556638=_0x556638-0x0;var _0x51ef99=_0x8c51[_0x556638];return _0x51ef99;};'use strict';var util=require(_0x18c5('0x0'));var _=require(_0x18c5('0x1'));var BPromise=require(_0x18c5('0x2'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0x18c5('0x3'));var Redis=require(_0x18c5('0x4'));var ut=require(_0x18c5('0x5'));var config=require(_0x18c5('0x6'));var logger=require(_0x18c5('0x7'))(_0x18c5('0x8'));var loggerBooked=require(_0x18c5('0x7'))(_0x18c5('0x9'));var loggerPredictive=require(_0x18c5('0x7'))(_0x18c5('0xa'));var loggerPredictiveCalls=require(_0x18c5('0x7'))(_0x18c5('0xb'));var loggerSyncQueueSummary=require(_0x18c5('0x7'))(_0x18c5('0xc'));var ami=require(_0x18c5('0xd'));config[_0x18c5('0xe')]=_[_0x18c5('0xf')](config[_0x18c5('0xe')],{'host':_0x18c5('0x10'),'port':0x18eb});var io=require(_0x18c5('0x11'))(new Redis(config[_0x18c5('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x18c5('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x18c5('0x13'));var History=require(_0x18c5('0x14'));var Final=require(_0x18c5('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x18c5('0x16'));var Hangup=require(_0x18c5('0x17'));var ipAgi=process[_0x18c5('0x18')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x18c5('0x19'),'roundrobin':_0x18c5('0x1a')};var Sequence=function(){};Sequence[_0x18c5('0x1b')]['enqueue']=function(_0x270a57){this['tail']=this[_0x18c5('0x1c')]?this['tail'][_0x18c5('0x1d')](_0x270a57):_0x270a57();};function Dialer(_0x426b26,_0x3bf057){this[_0x18c5('0x1e')]=new Sequence();this[_0x18c5('0x1f')]=_0x3bf057;this[_0x18c5('0x20')]=_0x426b26[_0x18c5('0x20')];this['campaigns']=_0x426b26['campaigns'];this['agents']=_0x426b26[_0x18c5('0x21')];this[_0x18c5('0x22')]=_0x426b26[_0x18c5('0x22')];this[_0x18c5('0x23')]=config[_0x18c5('0x23')]||0x2;this[_0x18c5('0x24')]={};this['actions']={};this[_0x18c5('0x25')]={};this[_0x18c5('0x26')]={};this[_0x18c5('0x27')]={};this[_0x18c5('0x28')]={};this[_0x18c5('0x29')]={};this[_0x18c5('0x2a')]={};this['queueBooked']={};this[_0x18c5('0x2b')]={};ami['on'](_0x18c5('0x2c'),this[_0x18c5('0x2d')][_0x18c5('0x2e')](this));ami['on'](_0x18c5('0x2f'),this[_0x18c5('0x30')][_0x18c5('0x2e')](this));ami['on'](_0x18c5('0x31'),this[_0x18c5('0x32')][_0x18c5('0x2e')](this));ami['on']('agentcomplete',this[_0x18c5('0x33')][_0x18c5('0x2e')](this));ami['on'](_0x18c5('0x34'),this[_0x18c5('0xc')][_0x18c5('0x2e')](this));ami['on'](_0x18c5('0x35'),this['syncHangup'][_0x18c5('0x2e')](this));ami['on']('newexten',this[_0x18c5('0x36')][_0x18c5('0x2e')](this));ami['on'](_0x18c5('0x37'),this[_0x18c5('0x38')][_0x18c5('0x2e')](this));ami['on'](_0x18c5('0x39'),this[_0x18c5('0x3a')]['bind'](this));ami['on'](_0x18c5('0x3b'),this[_0x18c5('0x3c')]['bind'](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x2f47c9){return _0x2f47c9!==null&&!_[_0x18c5('0x3d')](_0x2f47c9);}function checkIsLoggedIn(_0x68831f,_0x267fbc){return function(){if(_0x267fbc<=0x0){_0x68831f[_0x18c5('0x3e')]=_0x18c5('0x3f');throw _0x68831f['name']+_0x18c5('0x40');}};}function isActive(_0x31a463){return _0x31a463;}function checkIsActive(_0x198d4b,_0x4d7407){return function(){if(!isActive(_0x4d7407)){_0x198d4b[_0x18c5('0x3e')]='NOT_ACTIVE';throw _0x198d4b[_0x18c5('0x41')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4d2539){return function(){if(!isNotNull(_0x4d2539[_0x18c5('0x42')])){_0x4d2539[_0x18c5('0x3e')]='INTERVAL_IS_NULL';throw _0x4d2539[_0x18c5('0x41')]+_0x18c5('0x43');}if(!isNotNull(_0x4d2539['Interval'][_0x18c5('0x44')])){_0x4d2539[_0x18c5('0x3e')]=_0x18c5('0x45');throw _0x4d2539[_0x18c5('0x41')]+_0x18c5('0x43');}if(!isNotNull(_[_0x18c5('0x46')](_0x4d2539[_0x18c5('0x42')][_0x18c5('0x44')]))){_0x4d2539['message']=_0x18c5('0x45');throw _0x4d2539[_0x18c5('0x41')]+_0x18c5('0x43');}};}function msgResponse(_0x25bc54,_0x662b7b,_0x2cb03d){return{'action':_0x25bc54,'response':_0x662b7b,'message':_0x2cb03d,'stack':_0x2cb03d};}function myreject(_0x30fce1){return function(_0x171194){return _0x30fce1(msgResponse(_0x18c5('0x47'),_0x18c5('0x48'),JSON['stringify'](_0x171194)));};}function getSeconds(_0x59e8ab,_0x3b8bc7){var _0x421fd7=moment(_0x59e8ab)['milliseconds'](0x0);var _0x5b2c79=moment(_0x3b8bc7)[_0x18c5('0x49')](0x0);return _0x421fd7[_0x18c5('0x4a')](_0x5b2c79,_0x18c5('0x4b'));}function emit(_0x13ddd3,_0x149d3e,_0x2b6053){io['to'](_0x13ddd3)['emit'](_0x149d3e,_0x2b6053);}function emitVoiceQueueSummary(_0x9dd5c7){if(_0x9dd5c7[_0x18c5('0x4c')]===_0x18c5('0x4d')){var _0xc6469d={'id':_0x9dd5c7['id'],'name':_0x9dd5c7[_0x18c5('0x41')],'strategy':_0x9dd5c7['strategy'],'answered':_0x9dd5c7['answered'],'available':_0x9dd5c7[_0x18c5('0x4e')],'loggedIn':_0x9dd5c7[_0x18c5('0x4f')],'pTalking':_0x9dd5c7[_0x18c5('0x50')],'sumBillable':_0x9dd5c7['sumBillable'],'sumDuration':_0x9dd5c7[_0x18c5('0x51')],'sumHoldTime':_0x9dd5c7[_0x18c5('0x52')]||0x0,'talking':_0x9dd5c7[_0x18c5('0x53')],'total':_0x9dd5c7['total'],'type':_0x9dd5c7['type'],'unmanaged':_0x9dd5c7['unmanaged'],'abandoned':_0x9dd5c7['abandoned'],'waiting':_0x9dd5c7[_0x18c5('0x54')],'loggedInDb':_0x9dd5c7['loggedInDb'],'dialActive':_0x9dd5c7[_0x18c5('0x55')],'dialMethod':_0x9dd5c7['dialMethod'],'dialOriginateCallerIdName':_0x9dd5c7['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x9dd5c7['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x9dd5c7[_0x18c5('0x56')],'dialPrefix':_0x9dd5c7[_0x18c5('0x57')],'outboundAnswerAgiCallsDay':_0x9dd5c7[_0x18c5('0x58')],'outboundAnswerCallsDay':_0x9dd5c7[_0x18c5('0x59')],'outboundBlacklistCallsDay':_0x9dd5c7[_0x18c5('0x5a')],'outboundBusyCallsDay':_0x9dd5c7[_0x18c5('0x5b')],'outboundCongestionCallsDay':_0x9dd5c7[_0x18c5('0x5c')],'outboundDropCallsDayACS':_0x9dd5c7['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x9dd5c7[_0x18c5('0x5d')],'outboundDropCallsDayTimeout':_0x9dd5c7[_0x18c5('0x5e')],'outboundNoAnswerCallsDay':_0x9dd5c7['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x9dd5c7['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x9dd5c7[_0x18c5('0x5f')],'outboundReCallsDay':_0x9dd5c7[_0x18c5('0x60')],'outboundRejectCallsDay':_0x9dd5c7[_0x18c5('0x61')],'outboundUnknownCallsDay':_0x9dd5c7[_0x18c5('0x62')],'predictiveIntervalAnsweredCalls':_0x9dd5c7[_0x18c5('0x63')],'predictiveIntervalAvgHoldtime':_0x9dd5c7[_0x18c5('0x64')],'predictiveIntervalAvgTalktime':_0x9dd5c7[_0x18c5('0x65')],'predictiveIntervalDroppedCallsCallersExit':_0x9dd5c7[_0x18c5('0x66')],'predictiveIntervalDroppedCallsTimeout':_0x9dd5c7['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x9dd5c7['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x9dd5c7['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x9dd5c7[_0x18c5('0x67')],'predictiveIntervalMultiplicativeFactor':_0x9dd5c7[_0x18c5('0x68')],'predictiveIntervalPauses':_0x9dd5c7['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x9dd5c7[_0x18c5('0x69')],'predictiveIntervalTotalCalls':_0x9dd5c7['predictiveIntervalTotalCalls'],'message':_0x9dd5c7[_0x18c5('0x3e')],'originated':_0x9dd5c7[_0x18c5('0x6a')],'erlangCalls':_0x9dd5c7[_0x18c5('0x6b')],'erlangCallToSecond':_0x9dd5c7['erlangCallToSecond'],'erlangAbandonmentRate':_0x9dd5c7[_0x18c5('0x6c')],'erlangBusyFactor':_0x9dd5c7[_0x18c5('0x6d')],'startPredictive':_0x9dd5c7['startPredictive'],'startProgressive':_0x9dd5c7['startProgressive']};if(_0x9dd5c7[_0x18c5('0x6e')]){_0xc6469d[_0x18c5('0x6e')]={'id':_0x9dd5c7['Trunk']['id'],'name':_0x9dd5c7[_0x18c5('0x6e')]['name'],'active':_0x9dd5c7[_0x18c5('0x6e')][_0x18c5('0x6f')],'callerid':_0x9dd5c7['Trunk'][_0x18c5('0x70')]};}if(_0x9dd5c7['Interval']){_0xc6469d['Interval']={'id':_0x9dd5c7[_0x18c5('0x42')]['id'],'name':_0x9dd5c7[_0x18c5('0x42')][_0x18c5('0x41')]};}var _0x44d9c9=md5(JSON['stringify'](_0xc6469d));if(_0x9dd5c7[_0x18c5('0x3')]!==_0x44d9c9){_0x9dd5c7[_0x18c5('0x3')]=_0x44d9c9;emit(util[_0x18c5('0x71')](_0x18c5('0x72'),_0xc6469d[_0x18c5('0x41')]),_0x18c5('0x73'),_0xc6469d);}}}function emitCampaignSummary(_0x132411){if(_0x132411[_0x18c5('0x4c')]===_0x18c5('0x74')){emit(util[_0x18c5('0x71')]('campaign:ivr:%s',_0x132411[_0x18c5('0x41')]),_0x18c5('0x75'),_0x132411);}}function checkGetDataPredictive(_0x1d4cc1){if(isNotNull(_0x1d4cc1)&&!_['isEmpty'](_0x1d4cc1)){loggerPredictive[_0x18c5('0x76')](_0x18c5('0x77'));loggerPredictive[_0x18c5('0x76')](_0x18c5('0x78'),_0x1d4cc1[_0x18c5('0x79')]);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x7a'),_0x1d4cc1[_0x18c5('0x63')]);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x7b'),_0x1d4cc1[_0x18c5('0x7c')]);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x7d'),_0x1d4cc1[_0x18c5('0x66')]);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x7e'),_0x1d4cc1['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x7f'),_0x1d4cc1['predictiveIntervalAvgTalktime']);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x80'));if(_0x1d4cc1[_0x18c5('0x79')]>0x0){if(!_[_0x18c5('0x3d')](_0x1d4cc1[_0x18c5('0x65')])&&_0x1d4cc1[_0x18c5('0x65')]>0x0){return!![];}loggerPredictive[_0x18c5('0x76')](_0x18c5('0x81'));if(!_[_0x18c5('0x3d')](_0x1d4cc1['predictiveIntervalAvgHoldtime'])&&_0x1d4cc1[_0x18c5('0x64')]>0x0){return!![];}loggerPredictive[_0x18c5('0x76')](_0x18c5('0x82'));}else{loggerPredictive[_0x18c5('0x76')](_0x18c5('0x83'));}}else{loggerPredictive[_0x18c5('0x76')](_0x18c5('0x84'));}return![];}function mergeDataErlangB(_0x2967b1){return function(_0x519889){loggerPredictive['info'](_0x18c5('0x85'));loggerPredictive[_0x18c5('0x76')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x519889[_0x18c5('0x6b')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x519889[_0x18c5('0x86')]);loggerPredictive['info'](_0x18c5('0x87'),_0x519889[_0x18c5('0x6c')]);loggerPredictive[_0x18c5('0x76')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x519889['erlangBusyFactor']);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x87'),_0x519889['erlangAbandonmentRate']);loggerPredictive[_0x18c5('0x76')]('---------------------------');_[_0x18c5('0x88')](_0x2967b1,_0x519889);};}function getDiff(_0x1ab30b){var _0x483abc=moment()['milliseconds'](0x0);var _0x4319bb=moment(_0x1ab30b)[_0x18c5('0x49')](0x0);return _0x483abc[_0x18c5('0x4a')](_0x4319bb,'seconds');}function ifInterval(_0x3f7589,_0x456dbd){if(_[_0x18c5('0x3d')](_0x456dbd)){return![];}return getDiff(_0x456dbd)<_0x3f7589*0x3c;}function freeVariablesPredictive(_0x65b52b){if(isNotNull(_0x65b52b)){if(!_['isUndefined'](_0x65b52b[_0x18c5('0x29')])){_0x65b52b[_0x18c5('0x29')]=undefined;loggerPredictive[_0x18c5('0x76')](_0x65b52b[_0x18c5('0x41')],_0x18c5('0x89'));}if(!_[_0x18c5('0x3d')](_0x65b52b[_0x18c5('0x28')])){_0x65b52b[_0x18c5('0x28')]=undefined;loggerPredictive[_0x18c5('0x76')](_0x65b52b[_0x18c5('0x41')],_0x18c5('0x8a'));}if(!_[_0x18c5('0x3d')](_0x65b52b[_0x18c5('0x8b')])){clearInterval(_0x65b52b[_0x18c5('0x8b')]);_0x65b52b[_0x18c5('0x8b')]=undefined;loggerPredictive[_0x18c5('0x76')](_0x65b52b[_0x18c5('0x41')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x3361a9,_0x4b8fc2){if(_0x4b8fc2===0x0){return 0x0;}var _0x575676=0x1;for(var _0x5700d6=0x1;_0x5700d6<=_0x4b8fc2;_0x5700d6+=0x1){_0x575676=0x1+_0x575676*_0x5700d6/_0x3361a9;}return 0x1/_0x575676;}function isVoiceQueueOutbound(_0x25457f){return _0x25457f===_0x18c5('0x4d');}function isNotPreview(_0x8bda5){return _0x8bda5!==_0x18c5('0x1f');}function isCampaignIvr(_0x32981c){return _0x32981c===_0x18c5('0x74');}function getCallerId(_0x13d7e1,_0x218636,_0x3c3e26){if(!_[_0x18c5('0x3d')](_0x3c3e26)&&typeof _0x3c3e26===_0x18c5('0x8c')&&!_['isEmpty'](_0x3c3e26)){if(!_[_0x18c5('0x3d')](_0x218636)&&typeof _0x218636===_0x18c5('0x8c')&&!_[_0x18c5('0x46')](_0x218636)){return util[_0x18c5('0x71')](_0x18c5('0x8d'),_0x218636,_0x3c3e26);}return util[_0x18c5('0x71')](_0x18c5('0x8d'),_0x3c3e26,_0x3c3e26);}if(!_['isUndefined'](_0x13d7e1)&&typeof _0x13d7e1===_0x18c5('0x8c')&&!_[_0x18c5('0x46')](_0x13d7e1)){return _0x13d7e1;}return _0x18c5('0x8e');}function loggerCatchQueueSummary(_0x5d1cee,_0x2fdfcf){return function(_0x1b9a20){freeVariablesPredictive(_0x2fdfcf);emitVoiceQueueSummary(_0x2fdfcf);emitCampaignSummary(_0x2fdfcf);loggerSyncQueueSummary[_0x18c5('0x8f')](_0x5d1cee,util['inspect'](_0x1b9a20,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5caedd,_0x5920f6){return function(_0x5b9c6c){loggerPredictive['error'](_0x5920f6[_0x18c5('0x41')],_0x5caedd);loggerPredictive[_0x18c5('0x8f')](_0x5b9c6c[_0x18c5('0x90')]);freeVariablesPredictive(_0x5920f6);};}function loggerCatch(_0x2cd6a5){return function(_0x46803d){logger['error'](_0x2cd6a5,util[_0x18c5('0x91')](_0x46803d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x51749f){return _0x51749f&&!_[_0x18c5('0x3d')](_0x51749f)&&_0x51749f[_0x18c5('0x92')]>0x0;}function decremetOriginate(_0x8f96c8){if(!_[_0x18c5('0x3d')](_0x8f96c8)&&_0x8f96c8!==null){if(typeof _0x8f96c8[_0x18c5('0x6a')]!==_0x18c5('0x93')){if(_0x8f96c8[_0x18c5('0x6a')]>0x0){_0x8f96c8['originated']-=0x1;}else{logger[_0x18c5('0x8f')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x18c5('0x8f')](_0x18c5('0x94'));}}function checkContactLowerLimitOriginate(_0xcacb79,_0x10a241,_0x5871f1){if(_0x10a241>_0x5871f1){for(var _0x55de6b=0x0;_0x55de6b<_0x10a241-_0x5871f1;_0x55de6b+=0x1){decremetOriginate(_0xcacb79);}}}function loggerGetContactDialer(_0x59cf29,_0x3c7017,_0x109534){return function(_0xe935a3){checkContactLowerLimitOriginate(_0x3c7017,_0x109534,0x0);logger[_0x18c5('0x8f')](_0x59cf29,util[_0x18c5('0x91')](_0xe935a3,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x48399e){return function(_0x22d621){if(isNotNull(_0x22d621)&&isNotNull(_0x22d621[0x0])){if(_0x22d621[0x0]['contactsRescheduled']>0x0){_0x48399e[_0x18c5('0x3e')]='RESCHEDULED_CONTACTS';logger[_0x18c5('0x76')](_0x18c5('0x95')+_0x48399e[_0x18c5('0x41')],_0x22d621[0x0][_0x18c5('0x96')],_0x18c5('0x97'));}else{_0x48399e['message']=_0x18c5('0x98');logger[_0x18c5('0x76')](_0x18c5('0x99')+_0x48399e[_0x18c5('0x41')]);}}};}function notSendMessagesQueue(_0x6e15d1){if(_0x6e15d1[_0x18c5('0x9a')]){freeVariablesPredictive(_0x6e15d1);if(_0x6e15d1['originated']===0x0&&_0x6e15d1[_0x18c5('0x53')]===0x0&&_0x6e15d1[_0x18c5('0x54')]===0x0&&(_0x6e15d1[_0x18c5('0x50')]||0x0)===0x0){_0x6e15d1['sendMessageOneNotActive']=![];_0x6e15d1[_0x18c5('0x4e')]=0x0;_0x6e15d1['message']=_0x18c5('0x9b');loggerSyncQueueSummary[_0x18c5('0x8f')](_0x18c5('0x9c'),_0x6e15d1[_0x18c5('0x41')],_0x18c5('0x9d'));}else{_0x6e15d1[_0x18c5('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x18c5('0x8f')](_0x18c5('0x9c'),_0x6e15d1[_0x18c5('0x41')],_0x18c5('0x9e'));}emitVoiceQueueSummary(_0x6e15d1);}}function notSendMessagesCampaign(_0x2ecbf0){if(_0x2ecbf0[_0x18c5('0x9a')]){if(_0x2ecbf0[_0x18c5('0x6a')]===0x0){_0x2ecbf0['sendMessageOneNotActive']=![];_0x2ecbf0[_0x18c5('0x3e')]=_0x18c5('0x9b');loggerSyncQueueSummary['error'](_0x18c5('0x9f'),_0x2ecbf0[_0x18c5('0x41')],'is\x20not\x20active');}else{_0x2ecbf0[_0x18c5('0x3e')]=_0x18c5('0xa0');loggerSyncQueueSummary[_0x18c5('0x8f')](_0x18c5('0x9f'),_0x2ecbf0[_0x18c5('0x41')],_0x18c5('0x9e'));}emitCampaignSummary(_0x2ecbf0);}}function createObjHistory(_0x56f34a,_0x155599,_0x4ae50a,_0x8b00ac,_0x554b11){_0x56f34a[_0x18c5('0x3e')]=_0x4ae50a;var _0x4885e2=new Action(_0x56f34a,_0x155599);var _0x43b60f=new History(_0x4885e2);_0x43b60f[_0x18c5('0xa1')]=_0x8b00ac;_0x43b60f[_0x18c5('0xa2')]=_0x554b11;_0x43b60f['endtime']=_0x4885e2['starttime'];return _0x43b60f;}Dialer[_0x18c5('0x1b')][_0x18c5('0xa3')]=function(){var _0x1c4f71=this;setInterval(function(){_0x1c4f71[_0x18c5('0xa4')](_0x1c4f71[_0x18c5('0x26')],_0x18c5('0xa5'));_0x1c4f71[_0x18c5('0xa4')](_0x1c4f71['actions'],_0x18c5('0xa6'));},0x32c8);};Dialer[_0x18c5('0x1b')]['clearZombieChannels']=function(_0x16bbe3,_0x2b2ccb){var _0x3c176b=this;for(var _0x519ba9 in _0x16bbe3){if(typeof _0x16bbe3[_0x519ba9]!=='undefined'){this[_0x18c5('0x1e')][_0x18c5('0xa7')](function(){if(!_['isNil'](_0x16bbe3[_0x519ba9])){return ami['Action']({'action':_0x18c5('0xa8'),'channel':_0x16bbe3[_0x519ba9][_0x18c5('0xa9')]})[_0x18c5('0xaa')](function(_0x13997c){if(_0x13997c[_0x18c5('0x3e')]===_0x18c5('0xab')){setTimeout(function(){if(_0x16bbe3[_0x519ba9]&&_0x16bbe3[_0x519ba9][_0x18c5('0x4c')]!=='ivr'){_0x3c176b['updateOriginated'](_0x3c176b[_0x18c5('0x20')][_0x16bbe3[_0x519ba9][_0x18c5('0xac')]]);logger[_0x18c5('0x8f')]('[Dialer][checkChannel]',_0x2b2ccb,_0x519ba9,_0x16bbe3[_0x519ba9][_0x18c5('0xac')]);delete _0x16bbe3[_0x519ba9];}if(_0x16bbe3[_0x519ba9]&&_0x16bbe3[_0x519ba9]['type']===_0x18c5('0x74')){_0x3c176b[_0x18c5('0xad')](_0x3c176b[_0x18c5('0xae')][_0x16bbe3[_0x519ba9][_0x18c5('0xac')]]);logger[_0x18c5('0x8f')]('[Dialer][checkChannel][ivr]',_0x2b2ccb,_0x519ba9,_0x16bbe3[_0x519ba9]['queue']);delete _0x16bbe3[_0x519ba9];}},0x2328);}});}});}}};Dialer[_0x18c5('0x1b')][_0x18c5('0xaf')]=function(_0x298236){return BPromise[_0x18c5('0xb0')]()['then'](cmHopper[_0x18c5('0xaf')](_0x298236))[_0x18c5('0xaa')](loggerCatch(_0x18c5('0xb1')));};Dialer[_0x18c5('0x1b')][_0x18c5('0xb2')]=function(_0xeb019a){return BPromise[_0x18c5('0xb0')]()['then'](cmHopperBlack[_0x18c5('0xb2')](_0xeb019a))[_0x18c5('0xaa')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x18c5('0x1b')]['checkIsBlackListIvr']=function(_0x26a101){return BPromise[_0x18c5('0xb0')]()[_0x18c5('0xb3')](cmHopperBlack[_0x18c5('0xb4')](_0x26a101))[_0x18c5('0xaa')](loggerCatch(_0x18c5('0xb5')));};Dialer['prototype'][_0x18c5('0xb6')]=function(_0xd69474){return BPromise['resolve']()[_0x18c5('0xb3')](cmHopperHistory[_0x18c5('0xb7')](_0xd69474))[_0x18c5('0xaa')](loggerCatch(_0x18c5('0xb8')));};Dialer[_0x18c5('0x1b')]['rescheduleContact']=function(_0x6db1ae){return BPromise[_0x18c5('0xb0')]()[_0x18c5('0xb3')](cmHopper['rescheduleContact'](_0x6db1ae))[_0x18c5('0xaa')](loggerCatch(_0x18c5('0xb9')));};Dialer[_0x18c5('0x1b')][_0x18c5('0xba')]=function(_0x4a35c8,_0x1c1afd,_0xb9e674){return BPromise[_0x18c5('0xb0')]()['then'](cmHopper[_0x18c5('0xba')](_0x4a35c8,_0x1c1afd,_0xb9e674))['catch'](loggerCatch(_0x18c5('0xbb')));};Dialer[_0x18c5('0x1b')][_0x18c5('0xbc')]=function(_0x3298f0,_0x41ec7b,_0x18e352,_0x243133,_0x5e0f9c){return BPromise[_0x18c5('0xb0')]()['then'](cmHopper['getContactDialer'](_0x3298f0,_0x41ec7b,_0x18e352,_0x243133))[_0x18c5('0xaa')](function(_0x5ba95e){_0x5e0f9c[_0x18c5('0xbd')]-=_0x18e352;_0x5e0f9c[_0x18c5('0xbd')]=_0x5e0f9c[_0x18c5('0xbd')]>0x0?_0x5e0f9c['temp']:0x0;loggerCatch(_0x18c5('0xbe'))(_0x5ba95e);});};Dialer[_0x18c5('0x1b')][_0x18c5('0xbf')]=function(_0x2b2f60,_0x461b7e,_0xad1b4d,_0x517487){return BPromise[_0x18c5('0xb0')]()[_0x18c5('0xb3')](cmHopper[_0x18c5('0xbf')](_0x2b2f60,_0x461b7e,_0xad1b4d))['catch'](function(_0x4bfa28){_0x517487[_0x18c5('0xbd')]-=_0x461b7e;_0x517487[_0x18c5('0xbd')]=_0x517487[_0x18c5('0xbd')]>0x0?_0x517487[_0x18c5('0xbd')]:0x0;loggerCatch(_0x18c5('0xc0'))(_0x4bfa28);});};Dialer[_0x18c5('0x1b')][_0x18c5('0xc1')]=function(_0x18a981){return BPromise[_0x18c5('0xb0')]()[_0x18c5('0xb3')](voiceQueueRt[_0x18c5('0xc1')](_0x18a981))[_0x18c5('0xaa')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x18c5('0x1b')][_0x18c5('0xc2')]=function(_0x1d764f){return BPromise[_0x18c5('0xb0')]()['then'](cmHopper[_0x18c5('0xc2')](_0x1d764f))[_0x18c5('0xaa')](loggerCatch(_0x18c5('0xc3')));};Dialer[_0x18c5('0x1b')]['createHistory']=function(_0x38dd0e){return BPromise['resolve']()[_0x18c5('0xb3')](cmHopperHistory[_0x18c5('0xc4')](_0x38dd0e))['catch'](loggerCatch(_0x18c5('0xc5')));};Dialer[_0x18c5('0x1b')][_0x18c5('0xad')]=function(_0x20dec9){if(!_[_0x18c5('0x3d')](_0x20dec9)&&_0x20dec9!==null){if(typeof _0x20dec9[_0x18c5('0x6a')]!==_0x18c5('0x93')){if(_0x20dec9[_0x18c5('0x6a')]>0x0){_0x20dec9[_0x18c5('0x6a')]-=0x1;}else{logger[_0x18c5('0x8f')](_0x18c5('0xc6'));}}}else{logger[_0x18c5('0x8f')](_0x18c5('0xc7'));}};Dialer[_0x18c5('0x1b')][_0x18c5('0xc8')]=function(_0x374a9f,_0x5be7da){var _0x17941f=this;return function(_0x5e3b07){_0x17941f[_0x18c5('0xad')](_0x5be7da);logger[_0x18c5('0x8f')](_0x374a9f,util['inspect'](_0x5e3b07,{'showHidden':![],'depth':null}));};};Dialer[_0x18c5('0x1b')][_0x18c5('0xc9')]=function(_0x108556,_0x258eae,_0x467b80){var _0x4d587b={'state':0x19,'statedesc':_0x18c5('0xca')};this[_0x18c5('0xad')](_0x258eae);this[_0x18c5('0xcb')](_[_0x18c5('0x88')](_0x4d587b,_[_0x18c5('0xcc')](_0x467b80,[_0x18c5('0xcd'),_0x18c5('0xce'),_0x18c5('0xcf'),_0x18c5('0xd0'),'CampaignId'])),'[emptyContact][createHistory]',_0x18c5('0xd1'));logger[_0x18c5('0x8f')](_0x108556);};Dialer[_0x18c5('0x1b')][_0x18c5('0xd2')]=function(_0x40bd84){return _0x40bd84===_0x18c5('0xd3');};Dialer[_0x18c5('0x1b')][_0x18c5('0xd4')]=function(_0x5c27bc){return!_['isUndefined'](_0x5c27bc)&&_0x5c27bc&&!_[_0x18c5('0x3d')](_0x5c27bc[_0x18c5('0x41')])&&!_[_0x18c5('0x3d')](_0x5c27bc['active'])&&_0x5c27bc[_0x18c5('0x6f')]&&(this[_0x18c5('0x22')][util[_0x18c5('0x71')](_0x18c5('0xd5'),_0x5c27bc[_0x18c5('0x41')])]['status']==='reachable'||this[_0x18c5('0x22')][util[_0x18c5('0x71')](_0x18c5('0xd5'),_0x5c27bc[_0x18c5('0x41')])][_0x18c5('0xa8')]==='unmonitored');};Dialer[_0x18c5('0x1b')]['saveInDb']=function(_0x4f98e0,_0x277ea0,_0x62213){this[_0x18c5('0xc4')](_0x4f98e0)[_0x18c5('0xaa')](loggerCatch(_0x277ea0));this['moveContactManagedDialer'](_0x4f98e0)[_0x18c5('0xaa')](loggerCatch(_0x62213));};Dialer[_0x18c5('0x1b')][_0x18c5('0x38')]=function(_0x259cc2){var _0x27cd02=this[_0x18c5('0x26')][_0x259cc2[_0x18c5('0xd6')]];var _0x2c42f3;if(!_[_0x18c5('0xd7')](_0x259cc2)&&!_['isNil'](_0x259cc2[_0x18c5('0xd8')])&&!_[_0x18c5('0xd7')](_0x259cc2['variable']['amdstatus'])&&_0x259cc2[_0x18c5('0xd9')]===_0x18c5('0xda')&&_0x27cd02){if(_0x27cd02[_0x18c5('0x4c')]!==_0x18c5('0x74')&&this[_0x18c5('0x20')][_0x27cd02[_0x18c5('0xac')]][_0x18c5('0xdb')]&&_0x259cc2['value']==='HANGUP'){delete this['uniqueId'][_0x259cc2[_0x18c5('0xd6')]];this['updateOriginated'](this[_0x18c5('0x20')][_0x27cd02['queue']]);this[_0x18c5('0x20')][_0x27cd02[_0x18c5('0xac')]][_0x18c5('0x59')]+=0x1;this['voiceQueues'][_0x27cd02[_0x18c5('0xac')]][_0x18c5('0x58')]+=0x1;_0x2c42f3=new Hangup(_0x27cd02,_0x259cc2);_0x2c42f3[_0x18c5('0xa1')]=0x12;_0x2c42f3[_0x18c5('0xa2')]=_0x18c5('0xdc');_0x2c42f3[_0x18c5('0xdd')]=_0x18c5('0xde');ami[_0x18c5('0xdf')](_0x18c5('0xe0'),ut[_0x18c5('0xe1')](_0x2c42f3,'amd'));this[_0x18c5('0xcb')](_0x2c42f3,'[syncHangupInAMD][createHistory]',_0x18c5('0xe2'));}if(_0x27cd02[_0x18c5('0x4c')]!==_0x18c5('0x74')&&this[_0x18c5('0x20')][_0x27cd02['queue']][_0x18c5('0xdb')]&&_0x259cc2[_0x18c5('0xe3')]===_0x18c5('0xe4')){var _0x5aab31=this;return new BPromise(function(_0x2a44b5,_0x23cd1d){delete _0x5aab31[_0x18c5('0x26')][_0x259cc2[_0x18c5('0xd6')]];_0x5aab31['updateOriginated'](_0x5aab31[_0x18c5('0x20')][_0x27cd02[_0x18c5('0xac')]]);_0x5aab31[_0x18c5('0x20')][_0x27cd02['queue']][_0x18c5('0x59')]+=0x1;_0x5aab31['voiceQueues'][_0x27cd02[_0x18c5('0xac')]][_0x18c5('0x58')]+=0x1;var _0x2b7996=_0x5aab31[_0x18c5('0x20')][_0x27cd02['queue']];var _0x508395=new Hangup(_0x27cd02,_0x259cc2);_0x508395[_0x18c5('0xa1')]=0x13;_0x508395[_0x18c5('0xa2')]=_0x18c5('0xe5');_0x508395[_0x18c5('0xdd')]=_0x18c5('0xde');_0x508395[_0x18c5('0xe6')]+=0x1;_0x508395[_0x18c5('0xe7')]+=0x1;_0x508395['amd']=!![];ami[_0x18c5('0xdf')](_0x18c5('0xe0'),ut[_0x18c5('0xe1')](_0x508395,_0x18c5('0xe8')));_0x5aab31['createHistory'](_0x508395)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x508395[_0x18c5('0xe9')]+_0x508395['countcongestionretry']+_0x508395['countnoanswerretry']+_0x508395[_0x18c5('0xea')]+_0x508395['countdropretry']+_0x508395['countabandonedretry']+_0x508395['countmachineretry']+_0x508395[_0x18c5('0xeb')]>=_0x2b7996['dialGlobalMaxRetry']){_0x5aab31[_0x18c5('0xec')](_0x508395,_0x2a44b5,_0x23cd1d,'reason19\x20machine....');}else{if(_0x508395[_0x18c5('0xe6')]>=_0x2b7996[_0x18c5('0xed')]){_0x5aab31[_0x18c5('0xee')](_0x508395,_0x2a44b5,_0x23cd1d,_0x18c5('0xef'));}else{_0x5aab31[_0x18c5('0xf0')]({'active':![],'countmachineretry':_0x508395[_0x18c5('0xe6')],'scheduledat':moment()['add'](_0x2b7996[_0x18c5('0xf1')],_0x18c5('0xf2'))[_0x18c5('0x71')](_0x18c5('0xf3')),'ContactId':_0x508395[_0x18c5('0xcd')],'ListId':_0x508395['ListId'],'VoiceQueueId':_0x508395['VoiceQueueId']||undefined,'CampaignId':_0x508395['CampaignId']||undefined})[_0x18c5('0xaa')](loggerCatch(_0x18c5('0xf4')));_0x2a44b5({'reschedule':0x1});}}});}if(_0x27cd02[_0x18c5('0x4c')]===_0x18c5('0x74')&&this[_0x18c5('0xae')][_0x27cd02['queue']][_0x18c5('0xdb')]&&_0x259cc2[_0x18c5('0xe3')]===_0x18c5('0xf5')){delete this['uniqueId'][_0x259cc2[_0x18c5('0xd6')]];this[_0x18c5('0xad')](this[_0x18c5('0xae')][_0x27cd02[_0x18c5('0xac')]]);_0x2c42f3=new Hangup(_0x27cd02,_0x259cc2);_0x2c42f3['state']=0x12;_0x2c42f3[_0x18c5('0xa2')]=_0x18c5('0xdc');_0x2c42f3[_0x18c5('0xdd')]='AMD';ami['emit'](_0x18c5('0xe0'),ut[_0x18c5('0xe1')](_0x2c42f3,_0x18c5('0xe8')));this['saveInDb'](_0x2c42f3,'[syncHangupInAMDIvr][createHistory]',_0x18c5('0xf6'));}if(_0x27cd02['type']===_0x18c5('0x74')&&this[_0x18c5('0xae')][_0x27cd02[_0x18c5('0xac')]][_0x18c5('0xdb')]&&_0x259cc2[_0x18c5('0xe3')]==='MACHINE'){var _0x5aab31=this;return new BPromise(function(_0x23b463,_0x56b4d5){delete _0x5aab31[_0x18c5('0x26')][_0x259cc2[_0x18c5('0xd6')]];_0x5aab31[_0x18c5('0xad')](_0x5aab31[_0x18c5('0xae')][_0x27cd02[_0x18c5('0xac')]]);_0x5aab31[_0x18c5('0xae')][_0x27cd02['queue']][_0x18c5('0x59')]+=0x1;_0x5aab31[_0x18c5('0xae')][_0x27cd02[_0x18c5('0xac')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x27014f=_0x5aab31['campaigns'][_0x27cd02['queue']];var _0x2809f6=new Hangup(_0x27cd02,_0x259cc2);_0x2809f6[_0x18c5('0xa1')]=0x13;_0x2809f6[_0x18c5('0xa2')]=_0x18c5('0xe5');_0x2809f6[_0x18c5('0xdd')]=_0x18c5('0xde');_0x2809f6[_0x18c5('0xe6')]+=0x1;_0x2809f6[_0x18c5('0xe7')]+=0x1;_0x2809f6[_0x18c5('0xe8')]=!![];ami[_0x18c5('0xdf')](_0x18c5('0xe0'),ut[_0x18c5('0xe1')](_0x2809f6,_0x18c5('0xe8')));_0x5aab31['createHistory'](_0x2809f6)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2809f6['countbusyretry']+_0x2809f6[_0x18c5('0xf7')]+_0x2809f6['countnoanswerretry']+_0x2809f6[_0x18c5('0xea')]+_0x2809f6[_0x18c5('0xf8')]+_0x2809f6[_0x18c5('0xf9')]+_0x2809f6['countmachineretry']+_0x2809f6[_0x18c5('0xeb')]>=_0x27014f[_0x18c5('0xfa')]){_0x5aab31['stateGlobal'](_0x2809f6,_0x23b463,_0x56b4d5,_0x18c5('0xfb'));}else{if(_0x2809f6['countmachineretry']>=_0x27014f['dialMachineMaxRetry']){_0x5aab31['createStateFinal'](_0x2809f6,_0x23b463,_0x56b4d5,_0x18c5('0xef'));}else{_0x5aab31[_0x18c5('0xf0')]({'active':![],'countmachineretry':_0x2809f6[_0x18c5('0xe6')],'scheduledat':moment()['add'](_0x27014f[_0x18c5('0xf1')],_0x18c5('0xf2'))['format'](_0x18c5('0xf3')),'ContactId':_0x2809f6[_0x18c5('0xcd')],'ListId':_0x2809f6[_0x18c5('0xce')],'VoiceQueueId':_0x2809f6[_0x18c5('0xd0')]||undefined,'CampaignId':_0x2809f6[_0x18c5('0xfc')]||undefined})[_0x18c5('0xaa')](loggerCatch('[rescheduleContact][Machine]'));_0x23b463({'reschedule':0x1});}}});}}};Dialer[_0x18c5('0x1b')][_0x18c5('0xfd')]=function(_0x2d46fd){var _0xdba1ec=this[_0x18c5('0x26')][_0x2d46fd[_0x18c5('0xd6')]];var _0x8595ab=this;var _0x353fbf;if(_0xdba1ec&&_0xdba1ec['type']==='ivr'){delete this[_0x18c5('0x26')][_0x2d46fd[_0x18c5('0xd6')]];this['updateOriginated'](this[_0x18c5('0xae')][_0xdba1ec[_0x18c5('0xac')]]);this['campaigns'][_0xdba1ec[_0x18c5('0xac')]][_0x18c5('0xfe')]+=0x1;_0x353fbf=new Hangup(_0xdba1ec,_0x2d46fd);this[_0x18c5('0xc4')](_0x353fbf)[_0x18c5('0xaa')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x18c5('0xc2')](_0x353fbf)[_0x18c5('0xaa')](loggerCatch('[syncHangupIvr]'));}if(_0xdba1ec&&_0xdba1ec[_0x18c5('0x4c')]!==_0x18c5('0x74')&&isNotNull(this[_0x18c5('0x20')][_0xdba1ec[_0x18c5('0xac')]][_0x18c5('0xff')])){delete this[_0x18c5('0x26')][_0x2d46fd[_0x18c5('0xd6')]];this[_0x18c5('0xad')](this[_0x18c5('0x20')][_0xdba1ec['queue']]);this[_0x18c5('0x20')][_0xdba1ec[_0x18c5('0xac')]][_0x18c5('0x59')]+=0x1;this['voiceQueues'][_0xdba1ec[_0x18c5('0xac')]]['outboundAnswerAgiCallsDay']+=0x1;_0x353fbf=new Hangup(_0xdba1ec,_0x2d46fd);_0x353fbf['state']=0x10;_0x353fbf['statedesc']=_0x18c5('0x100');_0x353fbf['membername']='AGI';this[_0x18c5('0xc4')](_0x353fbf)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x101')));this['moveContactManagedDialer'](_0x353fbf)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x102')));}if(_0xdba1ec&&_0xdba1ec[_0x18c5('0x4c')]!==_0x18c5('0x74')&&!isNotNull(this['voiceQueues'][_0xdba1ec[_0x18c5('0xac')]][_0x18c5('0xff')])){delete this[_0x18c5('0x26')][_0x2d46fd['uniqueid']];this['updateOriginated'](this[_0x18c5('0x20')][_0xdba1ec['queue']]);this['voiceQueues'][_0xdba1ec['queue']][_0x18c5('0x62')]+=0x1;_0x353fbf=new Hangup(_0xdba1ec,_0x2d46fd);_0x353fbf[_0x18c5('0xa1')]=0xc;_0x353fbf[_0x18c5('0xa2')]=_0x2d46fd[_0x18c5('0x103')];_0x353fbf[_0x18c5('0xdd')]=_0x18c5('0x104');this[_0x18c5('0xc4')](_0x353fbf)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x101')));this[_0x18c5('0xc2')](_0x353fbf)['catch'](loggerCatch(_0x18c5('0x102')));}};Dialer[_0x18c5('0x1b')][_0x18c5('0x33')]=function(_0xc04ad3){var _0x51c87d=this[_0x18c5('0x26')][_0xc04ad3['uniqueid']];var _0x2b8922=this;if(this['voiceQueues'][_0xc04ad3[_0x18c5('0xac')]]){if(_0x51c87d&&_0x51c87d['type']!=='ivr'){delete this[_0x18c5('0x26')][_0xc04ad3['uniqueid']];this[_0x18c5('0x20')][_0xc04ad3[_0x18c5('0xac')]][_0x18c5('0x59')]+=0x1;var _0x27d492=new AgentComplete(_0x51c87d,_0xc04ad3);if(_0xc04ad3['reason']==='agent'){_0x27d492['agiafterat']=this[_0x18c5('0x20')][_0xc04ad3[_0x18c5('0xac')]][_0x18c5('0x105')]&&this[_0x18c5('0x20')][_0xc04ad3[_0x18c5('0xac')]][_0x18c5('0x106')]?moment()[_0x18c5('0x71')](_0x18c5('0xf3')):undefined;}this[_0x18c5('0xc4')](_0x27d492)[_0x18c5('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x18c5('0xc2')](_0x27d492)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x107')));}}};Dialer[_0x18c5('0x1b')][_0x18c5('0x2d')]=function(_0x2f2e21){if(this[_0x18c5('0x20')][_0x2f2e21[_0x18c5('0xac')]]){if(this['uniqueId'][_0x2f2e21['uniqueid']]&&this[_0x18c5('0x26')][_0x2f2e21[_0x18c5('0xd6')]][_0x18c5('0x4c')]!==_0x18c5('0x74')){this[_0x18c5('0xad')](this[_0x18c5('0x20')][_0x2f2e21[_0x18c5('0xac')]]);this[_0x18c5('0x26')][_0x2f2e21[_0x18c5('0xd6')]][_0x18c5('0x108')]=moment()[_0x18c5('0x71')](_0x18c5('0xf3'));}}};Dialer[_0x18c5('0x1b')][_0x18c5('0x109')]=function(_0x2bae11){this[_0x18c5('0xc4')](_0x2bae11)[_0x18c5('0xaa')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x18c5('0xc2')](_0x2bae11)['catch'](loggerCatch(_0x18c5('0x10a')));};Dialer[_0x18c5('0x1b')]['syncQueueCallerAbandon']=function(_0x352bdd){var _0x43069e=this['uniqueId'][_0x352bdd[_0x18c5('0xd6')]];var _0x42ffc2=this;if(this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]]){if(_0x43069e&&_0x43069e[_0x18c5('0x4c')]!=='ivr'){delete this[_0x18c5('0x26')][_0x352bdd[_0x18c5('0xd6')]];this['updateOriginated'](this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]]);_0x43069e[_0x18c5('0x10b')]=moment()[_0x18c5('0x71')](_0x18c5('0xf3'));var _0x2a19ef=new QueueCallerAbandon(_0x43069e,_0x352bdd);if(getSeconds(_0x43069e['droptime'],_0x43069e[_0x18c5('0x10c')])>=_0x43069e[_0x18c5('0x10d')]){this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x7c')]+=0x1;this['voiceQueues'][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x5e')]+=0x1;this['voiceQueues'][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x10e')]+=0x1;_0x2a19ef[_0x18c5('0xa1')]=0xa;_0x2a19ef[_0x18c5('0xa2')]=_0x18c5('0x10f');_0x2a19ef[_0x18c5('0x110')]=_0x18c5('0x111');_0x2a19ef[_0x18c5('0x112')]=this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x105')]?moment()[_0x18c5('0x71')](_0x18c5('0xf3')):undefined;_0x2a19ef[_0x18c5('0xf8')]+=0x1;_0x2a19ef[_0x18c5('0xe7')]+=0x1;if(_0x2a19ef[_0x18c5('0xf8')]>=this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x113')]){this[_0x18c5('0x109')](_0x2a19ef);}else{this[_0x18c5('0xf0')]({'active':![],'countdropretry':_0x2a19ef[_0x18c5('0xf8')],'scheduledat':moment()[_0x18c5('0x114')](this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x115')],'minutes')[_0x18c5('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x43069e[_0x18c5('0xcd')],'ListId':_0x43069e[_0x18c5('0xce')],'VoiceQueueId':_0x43069e['VoiceQueueId']||undefined,'CampaignId':_0x43069e[_0x18c5('0xfc')]||undefined})[_0x18c5('0xaa')](loggerCatch('[rescheduleContact][Drop]'));var _0xd66c88=new History(_0x2a19ef);_0xd66c88[_0x18c5('0xa1')]=0xa;_0xd66c88[_0x18c5('0xa2')]=_0x18c5('0x10f');_0xd66c88[_0x18c5('0x116')]=moment()[_0x18c5('0x71')](_0x18c5('0xf3'));_0xd66c88[_0x18c5('0x117')]=_0xd66c88[_0x18c5('0x116')];_0xd66c88[_0x18c5('0x118')]=_0x2a19ef[_0x18c5('0x118')];_0xd66c88['calleridnum']=_0x2a19ef[_0x18c5('0x119')];this['createHistory'](_0xd66c88)[_0x18c5('0xaa')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x66')]+=0x1;this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]]['outboundDropCallsDayCallersExit']+=0x1;_0x2a19ef[_0x18c5('0xa1')]=0xb;_0x2a19ef[_0x18c5('0xa2')]='Abandoned';_0x2a19ef[_0x18c5('0x110')]=_0x18c5('0x11a');_0x2a19ef[_0x18c5('0xf9')]+=0x1;_0x2a19ef[_0x18c5('0xe7')]+=0x1;if(_0x2a19ef[_0x18c5('0xf9')]>=this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x11b')]){this[_0x18c5('0x109')](_0x2a19ef);}else{this[_0x18c5('0xf0')]({'active':![],'countabandonedretry':_0x2a19ef[_0x18c5('0xf9')],'scheduledat':moment()[_0x18c5('0x114')](this[_0x18c5('0x20')][_0x352bdd[_0x18c5('0xac')]][_0x18c5('0x11c')],_0x18c5('0xf2'))[_0x18c5('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x43069e[_0x18c5('0xcd')],'ListId':_0x43069e[_0x18c5('0xce')],'VoiceQueueId':_0x43069e[_0x18c5('0xd0')]||undefined,'CampaignId':_0x43069e[_0x18c5('0xfc')]||undefined})['catch'](loggerCatch(_0x18c5('0x11d')));var _0xd66c88=new History(_0x2a19ef);_0xd66c88[_0x18c5('0xa1')]=0xb;_0xd66c88[_0x18c5('0xa2')]=_0x18c5('0x11e');_0xd66c88['starttime']=moment()[_0x18c5('0x71')](_0x18c5('0xf3'));_0xd66c88[_0x18c5('0x117')]=_0xd66c88[_0x18c5('0x116')];_0xd66c88[_0x18c5('0x118')]=_0x2a19ef['calleridname'];_0xd66c88[_0x18c5('0x119')]=_0x2a19ef[_0x18c5('0x119')];this[_0x18c5('0xc4')](_0xd66c88)[_0x18c5('0xaa')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x18c5('0x1b')]['syncNewExten']=function(_0x55f27b){if(this['actions'][_0x55f27b[_0x18c5('0xd6')]]){this['actions'][_0x55f27b[_0x18c5('0xd6')]]['channel']=_0x55f27b['channel'];}if(this[_0x18c5('0x26')][_0x55f27b[_0x18c5('0xd6')]]){this['uniqueId'][_0x55f27b[_0x18c5('0xd6')]]['channel']=_0x55f27b[_0x18c5('0xa9')];}};Dialer['prototype']['syncQueueMember']=function(_0x4f0370){if(strategy[this[_0x18c5('0x20')][this[_0x18c5('0x11f')][_0x4f0370[_0x18c5('0x120')]]['queue']][_0x18c5('0x121')]]==='roundrobin'){if(this[_0x18c5('0x11f')][_0x4f0370[_0x18c5('0x120')]]&&_['isNil'](this[_0x18c5('0x11f')][_0x4f0370[_0x18c5('0x120')]][_0x18c5('0x122')])&&_0x4f0370['status']==='1'&&_0x4f0370[_0x18c5('0x123')]==='0'){if(this[_0x18c5('0x21')][_0x4f0370[_0x18c5('0x124')]]){if(!this[_0x18c5('0x21')][_0x4f0370[_0x18c5('0x124')]][_0x18c5('0x122')]){this['agents'][_0x4f0370[_0x18c5('0x124')]][_0x18c5('0x122')]=!![];this[_0x18c5('0x11f')][_0x4f0370[_0x18c5('0x120')]]['locked']=!![];this[_0x18c5('0x11f')][_0x4f0370[_0x18c5('0x120')]][_0x18c5('0x124')]=_0x4f0370['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x18c5('0x11f')][_0x4f0370[_0x18c5('0x120')]]['queue']]['strategy']]||_0x18c5('0x19'))===_0x18c5('0x19')){if(this['actions'][_0x4f0370[_0x18c5('0x120')]]){if(this[_0x18c5('0x21')][_0x4f0370[_0x18c5('0x124')]]){this[_0x18c5('0x11f')][_0x4f0370['actionid']][_0x18c5('0x124')]=_0x4f0370['stateinterface'];if(_['isNil'](this[_0x18c5('0x125')][this[_0x18c5('0x11f')][_0x4f0370[_0x18c5('0x120')]][_0x18c5('0xac')]])){this['queueBooked'][this[_0x18c5('0x11f')][_0x4f0370['actionid']]['queue']]=[];}this[_0x18c5('0x125')][this['actions'][_0x4f0370['actionid']][_0x18c5('0xac')]][_0x18c5('0x126')](_[_0x18c5('0x88')](_[_0x18c5('0xcc')](this[_0x18c5('0x11f')][_0x4f0370['actionid']],['idHopper',_0x18c5('0x124')]),{'status':_0x4f0370['status'],'paused':_0x4f0370['paused']}));}}}};function unlockQueueStatus(_0x5cf20d,_0x307b30){setTimeout(function(){if(_['isUndefined'](_0x5cf20d[_0x18c5('0x127')])){loggerBooked[_0x18c5('0x8f')](_0x18c5('0x128'),_0x307b30);}_0x5cf20d[_0x18c5('0x127')]=!![];loggerBooked[_0x18c5('0x76')](_0x18c5('0x129'),_0x307b30,JSON[_0x18c5('0x12a')](_['pick'](_0x5cf20d,[_0x18c5('0x41'),_0x18c5('0x127')])));},0x1f3);}Dialer[_0x18c5('0x1b')][_0x18c5('0x3c')]=function(_0xe1560d){var _0x47e316=this;var _0x2fb88a=_0x47e316['voiceQueues'][_0x47e316[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0xac')]];if(strategy[this[_0x18c5('0x20')][this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0xac')]][_0x18c5('0x121')]]===_0x18c5('0x1a')){if(this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]]&&this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0x124')]){this[_0x18c5('0x1f')][_0x18c5('0x12b')](this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]]['idHopper'],this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0x124')])[_0x18c5('0xaa')](function(_0x5107e0){logger[_0x18c5('0x8f')](_0x18c5('0x12c'),util[_0x18c5('0x91')](_0x5107e0,{'showHidden':![],'depth':null}));})[_0x18c5('0x1d')](function(){_0x47e316[_0x18c5('0xad')](_0x47e316[_0x18c5('0x20')][_0x47e316['actions'][_0xe1560d[_0x18c5('0x120')]]['queue']]);_0x47e316[_0x18c5('0x21')][_0x47e316[_0x18c5('0x11f')][_0xe1560d['actionid']][_0x18c5('0x124')]][_0x18c5('0x122')]=![];delete _0x47e316[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]];unlockQueueStatus(_0x2fb88a);});}else{this[_0x18c5('0xad')](this['voiceQueues'][this['actions'][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0xac')]]);this[_0x18c5('0xf0')]({'active':![],'ContactId':this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]]['ContactId'],'ListId':this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]]['ListId'],'VoiceQueueId':this['actions'][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0xd0')]||undefined,'CampaignId':this[_0x18c5('0x11f')][_0xe1560d['actionid']][_0x18c5('0xfc')]||undefined})[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x12d')));delete this[_0x18c5('0x11f')][_0xe1560d['actionid']];unlockQueueStatus(_0x2fb88a);}}else if((strategy[this['voiceQueues'][this['actions'][_0xe1560d[_0x18c5('0x120')]]['queue']][_0x18c5('0x121')]]||_0x18c5('0x19'))===_0x18c5('0x19')){var _0x1da326;if(this['actions'][_0xe1560d[_0x18c5('0x120')]]&&!_[_0x18c5('0x46')](this['queueBooked'][this[_0x18c5('0x11f')][_0xe1560d['actionid']]['queue']])){if(this[_0x18c5('0x2b')][_0x47e316['actions'][_0xe1560d['actionid']]['queue']]){this[_0x18c5('0x2b')][_0x47e316[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0xac')]]=this[_0x18c5('0x2b')][this[_0x18c5('0x11f')][_0xe1560d['actionid']][_0x18c5('0xac')]]?this['queueBookedRR'][this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0xac')]]:this[_0x18c5('0x125')][this[_0x18c5('0x11f')][_0xe1560d['actionid']][_0x18c5('0xac')]]?this[_0x18c5('0x125')][this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]]['queue']][_0x18c5('0x12e')]||0x0:0x0;}this['queueBooked'][this['actions'][_0xe1560d[_0x18c5('0x120')]]['queue']][_0x18c5('0x12e')]=this[_0x18c5('0x2b')][this[_0x18c5('0x11f')][_0xe1560d[_0x18c5('0x120')]][_0x18c5('0xac')]];for(var _0x199fa4=0x0;_0x199fa4=0x0;})[_0x18c5('0xaa')](myreject(_0xf6ab35)));}}else{_0x1e9bd7[_0x18c5('0x126')](ami[_0x18c5('0x146')]({'action':_0x18c5('0x14a'),'command':util[_0x18c5('0x71')](_0x18c5('0x14b'),_0xfa135b,!_['isUndefined'](config[_0x18c5('0x142')][_0x2a3509])?_0x2a3509:'')})[_0x18c5('0xb3')](function(_0x2d4b48){return _0x2d4b48[_0x18c5('0x148')][_0x18c5('0x14c')](_0x18c5('0x149'))>=0x0;})[_0x18c5('0xaa')](myreject(_0xf6ab35)));}BPromise['all'](_0x1e9bd7)['then'](function(_0x2645f5){var _0x4837a7=_['some'](_0x2645f5);if(_0x4837a7){return _0x6693e5(_0x4837a7);}else{_0x20de7d[_0x18c5('0x3e')]=_0x263ae7?_0x18c5('0x14d'):_0x18c5('0x14e');return _0xf6ab35(msgResponse(_0x18c5('0x14f'),'Failure',_0x18c5('0x150')+_0x263ae7+'\x20'+_0x2a5435+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0xfa135b,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2a3509));}})[_0x18c5('0xaa')](function(_0x2560d8){return _0xf6ab35(msgResponse('ifTime',_0x18c5('0x13f'),JSON[_0x18c5('0x12a')](_0x2560d8)));});});};Dialer[_0x18c5('0x1b')][_0x18c5('0x151')]=function(_0x4d386f){var _0x376d9b=this;return function(){switch(_0x4d386f['dialMethod']){case _0x18c5('0x152'):freeVariablesPredictive(_0x4d386f);_0x376d9b[_0x18c5('0x153')](_0x4d386f,0x1);break;case _0x18c5('0x154'):freeVariablesPredictive(_0x4d386f);_0x376d9b['handlePower'](_0x4d386f,_0x4d386f['dialPowerLevel']);break;case'predictive':_0x376d9b[_0x18c5('0xa')](_0x4d386f);break;case _0x18c5('0x9'):freeVariablesPredictive(_0x4d386f);_0x376d9b[_0x18c5('0x153')](_0x4d386f,0x1);break;default:freeVariablesPredictive(_0x4d386f);logger[_0x18c5('0x8f')]('Queue',_0x4d386f['name'],'method\x20not\x20recognized');}};};Dialer[_0x18c5('0x1b')][_0x18c5('0x155')]=function(_0x3e717f){var _0x5a6209=this;return function(){_0x5a6209[_0x18c5('0x156')](_0x3e717f);};};Dialer[_0x18c5('0x1b')]['syncQueueSummary']=function(_0xf45881){var _0xdb0983=this;if(isNotPreview(_0xf45881[_0x18c5('0x157')])){if(isVoiceQueueOutbound(_0xf45881[_0x18c5('0x4c')])&&isActive(_0xf45881[_0x18c5('0x55')])){_0xf45881['sendMessageOneNotActive']=!![];BPromise[_0x18c5('0xb0')]()[_0x18c5('0xb3')](checkIsLoggedIn(_0xf45881,_0xf45881[_0x18c5('0x4f')]))['then'](checkIsActive(_0xf45881,_0xf45881[_0x18c5('0x55')]))[_0x18c5('0xb3')](checkInterval(_0xf45881))[_0x18c5('0xb3')](_0xdb0983[_0x18c5('0x13b')](_0xf45881))['then'](_0xdb0983[_0x18c5('0x13d')](_0xf45881[_0x18c5('0x158')],_0xf45881[_0x18c5('0x159')],_0xf45881['name'],_0xf45881))['then'](_0xdb0983[_0x18c5('0x15a')](_0xf45881['Interval'],_0xf45881['dialTimezone'],_0xf45881['name'],_0xf45881))[_0x18c5('0xb3')](_0xdb0983[_0x18c5('0x151')](_0xf45881))[_0x18c5('0xaa')](loggerCatchQueueSummary('[syncQueueSummary]',_0xf45881));}else{notSendMessagesQueue(_0xf45881);}}else{freeVariablesPredictive(_0xf45881);}};Dialer['prototype'][_0x18c5('0x13a')]=function(){var _0x4b1db1=this;var _0x4806f5;for(var _0x19904b in this['campaigns']){if(typeof this[_0x18c5('0xae')][_0x19904b]!=='undefined'){_0x4806f5=this['campaigns'][_0x19904b];if(isCampaignIvr(_0x4806f5[_0x18c5('0x4c')])&&isActive(_0x4806f5[_0x18c5('0x6f')])){_0x4806f5['sendMessageOneNotActive']=!![];BPromise[_0x18c5('0xb0')]()[_0x18c5('0xb3')](checkIsActive(_0x4806f5,_0x4806f5[_0x18c5('0x6f')]))['then'](checkInterval(_0x4806f5))[_0x18c5('0xb3')](_0x4b1db1[_0x18c5('0x13b')](_0x4806f5))[_0x18c5('0xb3')](_0x4b1db1[_0x18c5('0x13d')](_0x4806f5[_0x18c5('0x158')],_0x4806f5[_0x18c5('0x159')],_0x4806f5[_0x18c5('0x41')],_0x4806f5))[_0x18c5('0xb3')](_0x4b1db1[_0x18c5('0x15a')](_0x4806f5['Interval'],_0x4806f5[_0x18c5('0x159')],_0x4806f5['name'],_0x4806f5))[_0x18c5('0xb3')](_0x4b1db1['launchHandleIvr'](_0x4806f5))[_0x18c5('0xaa')](loggerCatchQueueSummary('[syncCampaigns]',_0x4806f5));}else{notSendMessagesCampaign(_0x4806f5);}}}};function getCallerIdRandom(_0x27ef06,_0x5a7258){var _0x542fad;var _0x202e2e;var _0x5c9471;if(_0x5a7258<=0x0){_0x5a7258=0x1;}_0x542fad=new RegExp(_0x18c5('0x15b')+_0x5a7258+'}$');_0x202e2e=Math[_0x18c5('0x15c')](0xa,_0x5a7258-0x1);_0x5c9471=Math['pow'](0xa,_0x5a7258)-0x1;return util[_0x18c5('0x71')]('%s',_[_0x18c5('0x15d')](_0x27ef06,_0x542fad,_[_0x18c5('0x15e')](_0x202e2e,_0x5c9471)));}function extractCalleridName(_0x3af300){var _0x2cbb7a=_0x3af300[_0x18c5('0x15f')](/"(.*?)"/);return _0x2cbb7a?_0x2cbb7a[0x1]:_0x3af300;}function extractCalleridNumber(_0xcef194){var _0x524a6d=_0xcef194[_0x18c5('0x15f')](/<(.*?)>/);return _0x524a6d?_0x524a6d[0x1]:_0xcef194;}Dialer['prototype']['actionOriginate']=function(_0x16a5c3,_0xd8c43f){var _0x2a9158=this;var _0x54ed8c=uuid['v4']();this[_0x18c5('0x11f')][_0x54ed8c]=new Action(_0x16a5c3,_0xd8c43f,_0x54ed8c);return new BPromise(function(_0x1ecfc6,_0x552ced){if(_[_0x18c5('0x3d')](_0x16a5c3)&&typeof _0x16a5c3!==_0x18c5('0x160')){return _0x552ced(msgResponse(_0x18c5('0x161'),_0x18c5('0x13f'),_0x18c5('0x162')));}if(_['isUndefined'](_0xd8c43f[_0x18c5('0x163')][_0x18c5('0x164')])||_0xd8c43f[_0x18c5('0x163')][_0x18c5('0x164')]===null){return _0x552ced(msgResponse('originate',_0x18c5('0x13f'),_0x18c5('0x165')));}var _0x27f8c9={'XMD-CALLERID':_0x2a9158[_0x18c5('0x11f')][_0x54ed8c][_0x18c5('0x166')](),'XMD-AGI':_0x16a5c3[_0x18c5('0xff')]?util[_0x18c5('0x71')](_0x18c5('0x167'),ipAgi,_0x16a5c3[_0x18c5('0xff')]):'NONE','XMD-AGIAFTER':_0x16a5c3[_0x18c5('0x105')]?util['format'](_0x18c5('0x167'),ipAgi,_0x16a5c3[_0x18c5('0x105')]):_0x18c5('0x168'),'XMD-QUEUE':_0x16a5c3[_0x18c5('0x4c')]===_0x18c5('0x4d')?util['format'](_0x18c5('0x169'),_0x16a5c3[_0x18c5('0x41')],_0x16a5c3[_0x18c5('0x16a')]||'',_0x16a5c3[_0x18c5('0x106')]?'c':'',_0x16a5c3[_0x18c5('0x10d')]||0x3):'NONE','XMD-CONTACTID':_0xd8c43f[_0x18c5('0xcd')],'XMD-CDRTYPE':_0x18c5('0x8'),'CALLERID(all)':_0x2a9158[_0x18c5('0x11f')][_0x54ed8c][_0x18c5('0x166')](),'XMD-AMD':_0x16a5c3[_0x18c5('0xdb')]?_0x18c5('0x16b'):'NONE','XMD-DESTINATION':_0x18c5('0xda')};if(_0x16a5c3[_0x18c5('0xdb')]){_0x27f8c9[_0x18c5('0x16c')]=_0x16a5c3['dialAMDInitialSilence']||0x9c4;_0x27f8c9[_0x18c5('0x16d')]=_0x16a5c3[_0x18c5('0x16e')]||0x5dc;_0x27f8c9[_0x18c5('0x16f')]=_0x16a5c3[_0x18c5('0x170')]||0x320;_0x27f8c9[_0x18c5('0x171')]=_0x16a5c3[_0x18c5('0x172')]||0x1388;_0x27f8c9[_0x18c5('0x173')]=_0x16a5c3[_0x18c5('0x174')]||0x64;_0x27f8c9[_0x18c5('0x175')]=_0x16a5c3[_0x18c5('0x176')]||0x32;_0x27f8c9[_0x18c5('0x177')]=_0x16a5c3[_0x18c5('0x178')]||0x3;_0x27f8c9[_0x18c5('0x179')]=_0x16a5c3[_0x18c5('0x17a')]||0x100;_0x27f8c9[_0x18c5('0x17b')]=_0x16a5c3['dialAMDMaximumWordLength']||0x1388;}if(_0x16a5c3[_0x18c5('0x4c')]===_0x18c5('0x4d')){_0x27f8c9['XMD-VOICEQUEUEID']=_0xd8c43f['VoiceQueueId'];}else{_0x27f8c9['XMD-CAMPAIGNID']=_0xd8c43f[_0x18c5('0xfc')];}for(var _0x522a93 in _0xd8c43f[_0x18c5('0x163')]){if(typeof _0xd8c43f[_0x18c5('0x163')][_0x522a93]!==_0x18c5('0x93')){if(isNotNull(_0xd8c43f[_0x18c5('0x163')][_0x522a93])&&_0x522a93!=='id'&&_0x522a93!==_0x18c5('0x17c')&&_0x522a93!=='createdAt'&&_0x522a93!=='updatedAt'){_0x27f8c9[util[_0x18c5('0x71')](_0x18c5('0x17d'),_0x18c5('0x17e'),_['toUpper'](_0x522a93))]=_0xd8c43f[_0x18c5('0x163')][_0x522a93];}}}var _0x5229ac=_0x2a9158[_0x18c5('0xd4')](_0x16a5c3['Trunk'])?getCallerId(_0x16a5c3[_0x18c5('0x6e')][_0x18c5('0x70')],_0x16a5c3['dialOriginateCallerIdName'],_0x16a5c3[_0x18c5('0x17f')]>0x0?getCallerIdRandom(_0x16a5c3[_0x18c5('0x180')],_0x16a5c3['dialRandomLastDigitCallerIdNumber']):_0x16a5c3['dialOriginateCallerIdNumber']):getCallerId(_[_0x18c5('0xd7')](_0x16a5c3[_0x18c5('0x13c')])?_0x16a5c3[_0x18c5('0x6e')][_0x18c5('0x70')]:_0x16a5c3['TrunkBackup'][_0x18c5('0x70')],_0x16a5c3[_0x18c5('0x181')],_0x16a5c3[_0x18c5('0x17f')]>0x0?getCallerIdRandom(_0x16a5c3['dialOriginateCallerIdNumber'],_0x16a5c3[_0x18c5('0x17f')]):_0x16a5c3[_0x18c5('0x180')]);if(_0x5229ac){_0x27f8c9[_0x18c5('0x182')]=_0x2a9158[_0x18c5('0x11f')][_0x54ed8c][_0x18c5('0x183')]=extractCalleridName(_0x5229ac);_0x27f8c9['XMD-ORIGINATECALLERIDNUM']=_0x2a9158[_0x18c5('0x11f')][_0x54ed8c]['originatecalleridnum']=extractCalleridNumber(_0x5229ac);}return ami['Action']({'actionid':_0x54ed8c,'action':_0x18c5('0x161'),'channel':_0x2a9158['isTrunkReachable'](_0x16a5c3[_0x18c5('0x6e')])?util[_0x18c5('0x71')](_0x18c5('0x184'),_0x16a5c3[_0x18c5('0x6e')][_0x18c5('0x41')],isNotNull(_0x16a5c3[_0x18c5('0x57')])?_0x16a5c3['dialPrefix'][_0x18c5('0x185')]()||'':'',_0x16a5c3[_0x18c5('0x186')]>0x0?_0xd8c43f[_0x18c5('0x163')][_0x18c5('0x164')][_0x18c5('0x187')](_0x16a5c3['dialCutDigit']):_0xd8c43f[_0x18c5('0x163')][_0x18c5('0x164')]):util[_0x18c5('0x71')](_0x18c5('0x184'),_['isNil'](_0x16a5c3['TrunkBackup'])?_0x16a5c3[_0x18c5('0x6e')][_0x18c5('0x41')]:_0x16a5c3[_0x18c5('0x13c')][_0x18c5('0x41')],isNotNull(_0x16a5c3[_0x18c5('0x57')])?_0x16a5c3[_0x18c5('0x57')][_0x18c5('0x185')]()||'':'',_0x16a5c3[_0x18c5('0x186')]>0x0?_0xd8c43f[_0x18c5('0x163')][_0x18c5('0x164')][_0x18c5('0x187')](_0x16a5c3[_0x18c5('0x186')]):_0xd8c43f['Contact'][_0x18c5('0x164')]),'callerid':_0x5229ac,'Exten':'xcally-motion-dialer','Context':_0x18c5('0x188'),'Priority':'1','variable':_0x27f8c9,'timeout':(_0x16a5c3[_0x18c5('0x56')]||0x1e)*0x3e8,'async':!![],'channelid':_0x54ed8c})[_0x18c5('0xb3')](function(_0x571e05){return _0x1ecfc6(_0x571e05);})['catch'](function(_0xdb3b16){_0x16a5c3[_0x18c5('0x5f')]+=0x1;var _0x1303d9=new History(_0x2a9158[_0x18c5('0x11f')][_0x54ed8c]);logger[_0x18c5('0x8f')](util[_0x18c5('0x71')](_0x18c5('0x189'),JSON['stringify'](_0xdb3b16)));_0x1303d9[_0x18c5('0xa1')]=0xe;_0x1303d9[_0x18c5('0xa2')]=_0x18c5('0x18a');_0x1303d9[_0x18c5('0x116')]=moment()[_0x18c5('0x71')]('YYYY-MM-DD\x20HH:mm:ss');_0x1303d9[_0x18c5('0x117')]=_0x1303d9['starttime'];_0x2a9158[_0x18c5('0xc4')](_0x1303d9)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x18b')));_0x2a9158['moveContactManagedDialer'](_0x1303d9)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x18b')))[_0x18c5('0x1d')](function(){delete _0x2a9158[_0x18c5('0x11f')][_0x54ed8c];return _0x552ced(msgResponse('originate','Error','originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x18c5('0x32')]=function(_0x53a9db){var _0x6dba99=this[_0x18c5('0x11f')][_0x53a9db['actionid']];if(_0x6dba99){delete this[_0x18c5('0x11f')][_0x53a9db[_0x18c5('0x120')]];_0x6dba99[_0x18c5('0x10c')]=moment()[_0x18c5('0x71')](_0x18c5('0xf3'));var _0x523ef0=_0x6dba99[_0x18c5('0x4c')]==='ivr'?this[_0x18c5('0xae')][_0x6dba99[_0x18c5('0xac')]]:this[_0x18c5('0x20')][_0x6dba99[_0x18c5('0x18c')]()];if(!this[_0x18c5('0xd2')](_0x53a9db[_0x18c5('0x18d')])){this[_0x18c5('0xad')](_0x523ef0);return this[_0x18c5('0x18e')](_0x6dba99,_0x523ef0,_0x53a9db)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x18f')));}this['uniqueId'][_0x53a9db[_0x18c5('0xd6')]]=_0x6dba99;}};Dialer[_0x18c5('0x1b')][_0x18c5('0x190')]=function(_0x5a50c7,_0x2b6f4f,_0x137d95){var _0x29ac4f=new History(_0x2b6f4f);if(_0x29ac4f[_0x18c5('0xe9')]+_0x29ac4f['countcongestionretry']+_0x29ac4f[_0x18c5('0x191')]+_0x29ac4f[_0x18c5('0xea')]+_0x29ac4f[_0x18c5('0xf8')]+_0x29ac4f[_0x18c5('0xf9')]+_0x29ac4f['countmachineretry']+_0x29ac4f[_0x18c5('0xeb')]>=_0x137d95[_0x18c5('0xfa')]-0x1){return!![];}switch(_0x5a50c7){case 0x3:if(_0x29ac4f[_0x18c5('0x191')]>=_0x137d95[_0x18c5('0x192')]-0x1){return!![];}this[_0x18c5('0xf0')]({'active':![],'countnoanswerretry':_0x29ac4f[_0x18c5('0x191')]+=0x1,'scheduledat':moment()[_0x18c5('0x114')](_0x137d95[_0x18c5('0x193')],_0x18c5('0xf2'))[_0x18c5('0x71')](_0x18c5('0xf3')),'ContactId':_0x29ac4f[_0x18c5('0xcd')],'ListId':_0x29ac4f[_0x18c5('0xce')],'VoiceQueueId':_0x29ac4f[_0x18c5('0xd0')]||undefined,'CampaignId':_0x29ac4f[_0x18c5('0xfc')]||undefined})[_0x18c5('0xaa')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x29ac4f[_0x18c5('0xe9')]>=_0x137d95[_0x18c5('0x194')]-0x1){return!![];}this[_0x18c5('0xf0')]({'active':![],'countbusyretry':_0x29ac4f['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x137d95[_0x18c5('0x195')],_0x18c5('0xf2'))['format'](_0x18c5('0xf3')),'ContactId':_0x29ac4f[_0x18c5('0xcd')],'ListId':_0x29ac4f[_0x18c5('0xce')],'VoiceQueueId':_0x29ac4f[_0x18c5('0xd0')]||undefined,'CampaignId':_0x29ac4f[_0x18c5('0xfc')]||undefined})[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x196')));break;case 0x8:if(_0x29ac4f[_0x18c5('0xf7')]>=_0x137d95[_0x18c5('0x197')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x29ac4f[_0x18c5('0xf7')]+=0x1,'scheduledat':moment()[_0x18c5('0x114')](_0x137d95[_0x18c5('0x198')],_0x18c5('0xf2'))[_0x18c5('0x71')](_0x18c5('0xf3')),'ContactId':_0x29ac4f['ContactId'],'ListId':_0x29ac4f[_0x18c5('0xce')],'VoiceQueueId':_0x29ac4f[_0x18c5('0xd0')]||undefined,'CampaignId':_0x29ac4f['CampaignId']||undefined})[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x199')));break;case 0x0:if(_0x29ac4f[_0x18c5('0xea')]>=_0x137d95[_0x18c5('0x19a')]-0x1){return!![];}else{this[_0x18c5('0xf0')]({'active':![],'countnosuchnumberretry':_0x29ac4f['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x18c5('0x114')](_0x137d95[_0x18c5('0x19b')],_0x18c5('0xf2'))[_0x18c5('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x29ac4f[_0x18c5('0xcd')],'ListId':_0x29ac4f['ListId'],'VoiceQueueId':_0x29ac4f[_0x18c5('0xd0')]||undefined,'CampaignId':_0x29ac4f[_0x18c5('0xfc')]||undefined})[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x19c')));}break;case 0xa:if(_0x29ac4f[_0x18c5('0xf8')]>=_0x137d95[_0x18c5('0x113')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x29ac4f[_0x18c5('0xf8')]+=0x1,'scheduledat':moment()[_0x18c5('0x114')](_0x137d95[_0x18c5('0x115')],'minutes')['format'](_0x18c5('0xf3')),'ContactId':_0x29ac4f['ContactId'],'ListId':_0x29ac4f[_0x18c5('0xce')],'VoiceQueueId':_0x29ac4f['VoiceQueueId']||undefined,'CampaignId':_0x29ac4f['CampaignId']||undefined})[_0x18c5('0xaa')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x29ac4f[_0x18c5('0xf9')]>=_0x137d95[_0x18c5('0x11b')]-0x1){return!![];}this[_0x18c5('0xf0')]({'active':![],'countabandonedretry':_0x29ac4f[_0x18c5('0xf9')]+=0x1,'scheduledat':moment()[_0x18c5('0x114')](_0x137d95[_0x18c5('0x11c')],_0x18c5('0xf2'))[_0x18c5('0x71')](_0x18c5('0xf3')),'ContactId':_0x29ac4f[_0x18c5('0xcd')],'ListId':_0x29ac4f['ListId'],'VoiceQueueId':_0x29ac4f[_0x18c5('0xd0')]||undefined,'CampaignId':_0x29ac4f['CampaignId']||undefined})['catch'](loggerCatch(_0x18c5('0x11d')));break;case 0x13:if(_0x29ac4f['countmachineretry']>=_0x137d95[_0x18c5('0xed')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x29ac4f[_0x18c5('0xe6')]+=0x1,'scheduledat':moment()[_0x18c5('0x114')](_0x137d95[_0x18c5('0xf1')],'minutes')[_0x18c5('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x29ac4f['ContactId'],'ListId':_0x29ac4f[_0x18c5('0xce')],'VoiceQueueId':_0x29ac4f[_0x18c5('0xd0')]||undefined,'CampaignId':_0x29ac4f['CampaignId']||undefined})[_0x18c5('0xaa')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x29ac4f[_0x18c5('0xeb')]>=_0x137d95['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x18c5('0xf0')]({'active':![],'countagentrejectretry':_0x29ac4f[_0x18c5('0xeb')]+=0x1,'scheduledat':moment()['add'](_0x137d95[_0x18c5('0x19d')],'minutes')[_0x18c5('0x71')](_0x18c5('0xf3')),'ContactId':_0x29ac4f[_0x18c5('0xcd')],'ListId':_0x29ac4f[_0x18c5('0xce')],'VoiceQueueId':_0x29ac4f['VoiceQueueId']||undefined,'CampaignId':_0x29ac4f[_0x18c5('0xfc')]||undefined})['catch'](loggerCatch(_0x18c5('0x19e')));break;default:return!![];}};Dialer[_0x18c5('0x1b')][_0x18c5('0x18e')]=function(_0x516e54,_0x3ed29b,_0x457896){var _0x4fa02c=this;var _0x3b6ab2=new History(_0x516e54);return new BPromise(function(_0x466e8b,_0x160064){if(_[_0x18c5('0x3d')](_0x3ed29b)&&typeof _0x3ed29b!==_0x18c5('0x160')){return _0x160064(msgResponse(_0x18c5('0x19f'),_0x18c5('0x13f'),_0x18c5('0x1a0')));}if(_[_0x18c5('0x3d')](_0x457896)&&typeof _0x457896!==_0x18c5('0x160')){return _0x160064(msgResponse(_0x18c5('0x19f'),_0x18c5('0x13f'),_0x18c5('0x1a1')));}switch(_0x457896['reason']){case'0':_0x3ed29b[_0x18c5('0x1a2')]+=0x1;_0x3b6ab2['state']=0x0;_0x3b6ab2[_0x18c5('0xa2')]=_0x18c5('0x1a3');_0x3b6ab2[_0x18c5('0xea')]+=0x1;_0x3b6ab2['countglobal']+=0x1;ami[_0x18c5('0xdf')](_0x18c5('0x1a4'),ut[_0x18c5('0xe1')](_0x516e54,_0x18c5('0x1a5')));_0x4fa02c[_0x18c5('0xc4')](_0x3b6ab2)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1a6')));if(_0x4fa02c['checkRetriveMax'](0x0,_0x516e54,_0x3ed29b)){if(_0x3b6ab2['countnosuchnumberretry']>=_0x3ed29b[_0x18c5('0x19a')]){_0x4fa02c[_0x18c5('0xee')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1a7'));}else{_0x4fa02c[_0x18c5('0xec')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1a7'));}}break;case'3':_0x3ed29b['outboundNoAnswerCallsDay']+=0x1;_0x3b6ab2['state']=0x3;_0x3b6ab2[_0x18c5('0xa2')]='NoAnswer';_0x3b6ab2[_0x18c5('0x191')]+=0x1;_0x3b6ab2[_0x18c5('0xe7')]+=0x1;ami[_0x18c5('0xdf')](_0x18c5('0x1a8'),ut[_0x18c5('0xe1')](_0x516e54,_0x18c5('0x1a9')));_0x4fa02c[_0x18c5('0xc4')](_0x3b6ab2)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4fa02c[_0x18c5('0x190')](0x3,_0x516e54,_0x3ed29b)){if(_0x3b6ab2['countnoanswerretry']>=_0x3ed29b[_0x18c5('0x192')]){_0x4fa02c[_0x18c5('0xee')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1aa'));}else{_0x4fa02c[_0x18c5('0xec')](_0x3b6ab2,_0x466e8b,_0x160064,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3ed29b['outboundBusyCallsDay']+=0x1;_0x3b6ab2[_0x18c5('0xa1')]=0x5;_0x3b6ab2[_0x18c5('0xa2')]='Busy';_0x3b6ab2['countbusyretry']+=0x1;_0x3b6ab2[_0x18c5('0xe7')]+=0x1;ami[_0x18c5('0xdf')](_0x18c5('0x1ab'),ut[_0x18c5('0xe1')](_0x516e54,'busy'));_0x4fa02c[_0x18c5('0xc4')](_0x3b6ab2)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1ac')));if(_0x4fa02c[_0x18c5('0x190')](0x5,_0x516e54,_0x3ed29b)){if(_0x3b6ab2[_0x18c5('0xe9')]>=_0x3ed29b[_0x18c5('0x194')]){_0x4fa02c['createStateFinal'](_0x3b6ab2,_0x466e8b,_0x160064,'reason\x205\x20busy');}else{_0x4fa02c['stateGlobal'](_0x3b6ab2,_0x466e8b,_0x160064,'reason\x205\x20busy');}}break;case'8':_0x3ed29b[_0x18c5('0x5c')]+=0x1;_0x3b6ab2[_0x18c5('0xa1')]=0x8;_0x3b6ab2[_0x18c5('0xa2')]=_0x18c5('0x1ad');_0x3b6ab2[_0x18c5('0xf7')]+=0x1;_0x3b6ab2[_0x18c5('0xe7')]+=0x1;ami[_0x18c5('0xdf')]('custom:agentcongestion',ut['buildObj'](_0x516e54,'congestion'));_0x4fa02c[_0x18c5('0xc4')](_0x3b6ab2)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1ae')));if(_0x4fa02c[_0x18c5('0x190')](0x8,_0x516e54,_0x3ed29b)){if(_0x3b6ab2[_0x18c5('0xf7')]>=_0x3ed29b['dialCongestionMaxRetry']){_0x4fa02c[_0x18c5('0xee')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1af'));}else{_0x4fa02c[_0x18c5('0xec')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1af'));}}break;case'11':_0x3ed29b[_0x18c5('0x1b0')]+=0x1;_0x3b6ab2[_0x18c5('0xa1')]=0xb;_0x3b6ab2[_0x18c5('0xa2')]=_0x18c5('0x11e');_0x3b6ab2[_0x18c5('0xf9')]+=0x1;_0x3b6ab2[_0x18c5('0xe7')]+=0x1;_0x4fa02c[_0x18c5('0xc4')](_0x3b6ab2)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1b1')));if(_0x4fa02c['checkRetriveMax'](0xb,_0x516e54,_0x3ed29b)){if(_0x3b6ab2[_0x18c5('0xf9')]>=_0x3ed29b['dialAbandonedMaxRetry']){_0x4fa02c[_0x18c5('0xee')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1b2'));}else{_0x4fa02c[_0x18c5('0xec')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1b2'));}}break;case'20':_0x3ed29b['outboundRejectCallsDay']+=0x1;_0x3b6ab2[_0x18c5('0xa1')]=0x14;_0x3b6ab2['statedesc']=_0x18c5('0x1b3');_0x3b6ab2[_0x18c5('0xeb')]+=0x1;_0x3b6ab2['countglobal']+=0x1;ami[_0x18c5('0xdf')](_0x18c5('0x1b4'),ut[_0x18c5('0xe1')](_0x516e54,_0x18c5('0x1b5')));_0x4fa02c[_0x18c5('0xc4')](_0x3b6ab2)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1b6')));if(_0x4fa02c[_0x18c5('0x190')](0x14,_0x516e54,_0x3ed29b)){if(_0x3b6ab2['countagentrejectretry']>=_0x3ed29b[_0x18c5('0x1b7')]){_0x4fa02c[_0x18c5('0xee')](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1b8'));}else{_0x4fa02c['stateGlobal'](_0x3b6ab2,_0x466e8b,_0x160064,_0x18c5('0x1b8'));}}break;default:_0x3ed29b[_0x18c5('0x62')]+=0x1;_0x3b6ab2[_0x18c5('0xa1')]=0xc;_0x3b6ab2['statedesc']=_0x457896[_0x18c5('0x1b9')];_0x4fa02c['createHistory'](_0x3b6ab2)[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1ba')));if(_0x4fa02c[_0x18c5('0x190')](_0x457896[_0x18c5('0x1b9')],_0x516e54,_0x3ed29b)){if(_0x3b6ab2['countbusyretry']+_0x3b6ab2[_0x18c5('0xf7')]+_0x3b6ab2[_0x18c5('0x191')]+_0x3b6ab2[_0x18c5('0xea')]+_0x3b6ab2[_0x18c5('0xf8')]+_0x3b6ab2[_0x18c5('0xf9')]+_0x3b6ab2[_0x18c5('0xe6')]+_0x3b6ab2[_0x18c5('0xeb')]>=_0x3ed29b[_0x18c5('0xfa')]){_0x4fa02c['stateGlobal'](_0x3b6ab2,_0x466e8b,_0x160064,_0x457896[_0x18c5('0x1b9')]);}else{_0x4fa02c['createStateFinal'](_0x3b6ab2,_0x466e8b,_0x160064,_0x457896[_0x18c5('0x1b9')]);}}}});};Dialer['prototype'][_0x18c5('0xec')]=function(_0x5a057a,_0x5eec7a,_0x45e9ff,_0x58bdbe){var _0x3b5d59=new Final(_0x5a057a);_0x3b5d59[_0x18c5('0xa1')]=0xf;_0x3b5d59[_0x18c5('0xa2')]=_0x18c5('0x1bb');this['createStateFinal'](_0x3b5d59,_0x5eec7a,_0x45e9ff,_0x58bdbe);};Dialer[_0x18c5('0x1b')][_0x18c5('0xee')]=function(_0x5c0835,_0x224385,_0x44b19e,_0x29f5ec){this[_0x18c5('0xc2')](_0x5c0835)['then'](function(){return _0x224385(msgResponse(_0x18c5('0x19f'),_0x18c5('0xd3'),_0x29f5ec));})['catch'](function(){return _0x44b19e(msgResponse(_0x18c5('0x1bc'),'Failure',_0x18c5('0x1bd')));});};Dialer[_0x18c5('0x1b')][_0x18c5('0xa')]=function(_0x392e6f){var _0x3b1892=_0x392e6f[_0x18c5('0x1be')]/0x64;var _0x177bb4=_0x392e6f['outboundDropCallsDayTimeout']/(_0x392e6f[_0x18c5('0x5e')]+_0x392e6f[_0x18c5('0x59')]);var _0xe93df4=Math[_0x18c5('0x1bf')](_0x392e6f['predictiveIntervalAvailable']*(_0x392e6f['predictiveIntervalMaxThreshold']/0x64));var _0x52f06f=Math[_0x18c5('0x1bf')](_0x392e6f[_0x18c5('0x69')]*(_0x392e6f[_0x18c5('0x1c0')]/0x64));var _0x245db9=_0x392e6f['available']+_0x392e6f['talking'];var _0xf15950=Math[_0x18c5('0x1c1')](_0x392e6f[_0x18c5('0x6b')]*_0x392e6f[_0x18c5('0x6c')]*_0x392e6f[_0x18c5('0x67')]*_0x392e6f['predictiveIntervalMultiplicativeFactor']);if(_[_0x18c5('0x3d')](_0x392e6f[_0x18c5('0x29')])){if(!_['isUndefined'](_0x392e6f['startPredictive'])){_0x392e6f['startPredictive']=undefined;loggerPredictive[_0x18c5('0x8f')](_0x18c5('0x1c2'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x18c5('0x3d')](_0x392e6f['handlePredictive'])){loggerPredictive['error'](_0x18c5('0x1c2'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x392e6f[_0x18c5('0x8b')]);_0x392e6f['handlePredictive']=undefined;}_0x392e6f['startProgressive']=moment()[_0x18c5('0x71')](_0x18c5('0xf3'));loggerPredictive['info'](_0x392e6f[_0x18c5('0x41')],_0x18c5('0x1c3'),_0x392e6f['startProgressive']);this[_0x18c5('0x153')](_0x392e6f,0x1);}else if(ifInterval(_0x392e6f['dialPredictiveInterval'],_0x392e6f[_0x18c5('0x29')])){this[_0x18c5('0x153')](_0x392e6f,0x1);loggerPredictiveCalls[_0x18c5('0x76')](_0x18c5('0x1c4'),_0x392e6f['startProgressive'],_0x392e6f['name']);_0x392e6f[_0x18c5('0x6b')]=0x0;_0x392e6f['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3b1892<_0x177bb4&&_0x392e6f[_0x18c5('0x1c5')]===_0x18c5('0x1c6')){freeVariablesPredictive(_0x392e6f);loggerPredictive[_0x18c5('0x76')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x18c5('0x1c7'),_0x177bb4,_0x18c5('0x29'),_0x392e6f['name']);}else if(_0xf15950<_0x392e6f[_0x18c5('0x10e')]&&_0x392e6f[_0x18c5('0x1c5')]===_0x18c5('0x1c6')){freeVariablesPredictive(_0x392e6f);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x1c8'),_0x18c5('0x1c9'),_0xf15950,_0x18c5('0x1ca'),_0x392e6f[_0x18c5('0x10e')],_0x18c5('0x29'),_0x392e6f[_0x18c5('0x41')]);}else if(!ifInterval(_0x392e6f[_0x18c5('0x1cb')],_0x392e6f[_0x18c5('0x29')])&&_['isUndefined'](_0x392e6f['startPredictive'])&&!_[_0x18c5('0x3d')](_0x392e6f[_0x18c5('0x29')])){_0x392e6f[_0x18c5('0x28')]=moment()[_0x18c5('0x71')](_0x18c5('0xf3'));loggerPredictive[_0x18c5('0x76')](_0x392e6f[_0x18c5('0x41')],_0x18c5('0x1cc'),_0x392e6f['startPredictive']);this['averageHandleTime'](_0x392e6f[_0x18c5('0x1cb')])[_0x18c5('0xb3')](this['getDataPredictive'](_0x392e6f))[_0x18c5('0xb3')](mergeDataErlangB(_0x392e6f))[_0x18c5('0xb3')](this[_0x18c5('0x1cd')](_0x392e6f))[_0x18c5('0xaa')](loggerCatchPredictive(_0x18c5('0x1ce'),_0x392e6f));}else if(!ifInterval(_0x392e6f[_0x18c5('0x1cb')],_0x392e6f[_0x18c5('0x28')])){_0x392e6f['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x392e6f[_0x18c5('0x28')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x18c5('0x76')](_0x392e6f['name'],_0x18c5('0x1cf'),_0x392e6f[_0x18c5('0x28')]);clearInterval(_0x392e6f[_0x18c5('0x8b')]);_0x392e6f['handlePredictive']=undefined;this[_0x18c5('0xb6')](_0x392e6f[_0x18c5('0x1cb')])[_0x18c5('0xb3')](this[_0x18c5('0x1d0')](_0x392e6f))['then'](mergeDataErlangB(_0x392e6f))[_0x18c5('0xb3')](this[_0x18c5('0x1cd')](_0x392e6f))[_0x18c5('0xaa')](loggerCatchPredictive(_0x18c5('0x1d1'),_0x392e6f));}else if(_0x392e6f['predictiveIntervalAvailable']&&_0x245db9<_0x392e6f['predictiveIntervalAvailable']-_0x52f06f){freeVariablesPredictive(_0x392e6f);loggerPredictive[_0x18c5('0x76')](_0x392e6f[_0x18c5('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x245db9,_0x18c5('0x1d2'),_0x392e6f[_0x18c5('0x69')],'-',_0x52f06f,'=',_0x392e6f[_0x18c5('0x69')]-_0x52f06f,')');}else if(_0x392e6f['predictiveIntervalAvailable']&&_0x245db9>_0x392e6f[_0x18c5('0x69')]+_0xe93df4){freeVariablesPredictive(_0x392e6f);loggerPredictive[_0x18c5('0x76')](_0x392e6f[_0x18c5('0x41')],_0x18c5('0x1d3'),_0x245db9,')\x20are\x20more\x20than\x20threshold\x20(',_0x392e6f[_0x18c5('0x69')],'+',_0xe93df4,'=',_0x392e6f[_0x18c5('0x69')]+_0xe93df4,')');}};Dialer[_0x18c5('0x1b')][_0x18c5('0x1d0')]=function(_0x1ab2de){var _0x587e30=this;return function(_0x55aa92){return new BPromise(function(_0x335d9c,_0x346df7){_[_0x18c5('0x88')](_0x1ab2de,_0x55aa92[0x0]);if(checkGetDataPredictive(_0x55aa92[0x0])){var _0xf70a00=_0x1ab2de[_0x18c5('0x69')]=_0x1ab2de['talking']+_0x1ab2de[_0x18c5('0x4e')];var _0x468fdc=_0x1ab2de[_0x18c5('0x1cb')]*0x3c;var _0x3a1759=_0x55aa92[0x0]['predictiveIntervalAvgTalktime']+_0x55aa92[0x0][_0x18c5('0x64')];var _0x282f8d=(_0x55aa92[0x0][_0x18c5('0x63')]+_0x55aa92[0x0][_0x18c5('0x7c')]+_0x55aa92[0x0][_0x18c5('0x66')])/_0x55aa92[0x0][_0x18c5('0x79')];_0x1ab2de['predictiveIntervalHitRate']=_0x282f8d>0x0?_0x282f8d:0x1;switch(_0x1ab2de['dialPredictiveOptimization']){case _0x18c5('0x1c6'):var _0xa125af=_0x1ab2de[_0x18c5('0x1be')]/0x64;return _0x587e30[_0x18c5('0x1d4')](_0xf70a00,_0x468fdc,_0x3a1759,_0x282f8d,_0xa125af)['then'](function(_0x39b4aa){return _0x335d9c(_0x39b4aa);});case'agentBusyFactor':var _0x103348=_0x1ab2de[_0x18c5('0x1be')]/0x64;return _0x587e30[_0x18c5('0x1d5')](_0xf70a00,_0x468fdc,_0x3a1759,_0x282f8d,_0x103348)['then'](function(_0x3ff52d){return _0x335d9c(_0x3ff52d);});default:return _0x346df7(msgResponse('[getDataPredictive]',_0x18c5('0x13f'),_0x18c5('0x1d6')));}}else{return _0x346df7(msgResponse(_0x18c5('0x1d7'),_0x18c5('0x13f'),_0x18c5('0x1d8')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x133217){var _0x5b51cc=this;return function(_0x4ecbdd){return new BPromise(function(_0x42168c,_0x4382e5){_['merge'](_0x133217,_0x4ecbdd[0x0]);if(checkGetDataPredictive(_0x4ecbdd[0x0])){loggerPredictive[_0x18c5('0x76')](JSON[_0x18c5('0x12a')](_0x4ecbdd[0x0]));if(_0x133217[_0x18c5('0x1c5')]===_0x18c5('0x1c6')){return _0x5b51cc[_0x18c5('0xc1')](_0x133217['id'])[_0x18c5('0xb3')](function(_0x162d32){var _0x22afc5=_0x133217[_0x18c5('0x4f')]-_0x162d32[0x0][_0x18c5('0x1d9')];var _0xf5fe81=_0x133217['dialPredictiveInterval']*0x3c;var _0x442879=_0x4ecbdd[0x0]['predictiveIntervalAvgTalktime']+_0x4ecbdd[0x0][_0x18c5('0x64')];var _0x174a4f=(_0x4ecbdd[0x0][_0x18c5('0x63')]+_0x4ecbdd[0x0][_0x18c5('0x7c')]+_0x4ecbdd[0x0][_0x18c5('0x66')])/_0x4ecbdd[0x0]['predictiveIntervalTotalCalls'];var _0x4d8650=_0x133217[_0x18c5('0x1be')]/0x64;_0x133217[_0x18c5('0x1da')]=_0x162d32[0x0][_0x18c5('0x1d9')]||0x0;_0x133217[_0x18c5('0x67')]=_0x174a4f>0x0?_0x174a4f:0x1;return _0x5b51cc[_0x18c5('0x1d4')](_0x22afc5,_0xf5fe81,_0x442879,_0x174a4f,_0x4d8650);})[_0x18c5('0xb3')](function(_0xafdee0){return _0x42168c(_0xafdee0);})[_0x18c5('0xaa')](function(_0x273080){return _0x4382e5(msgResponse('[CatchErlangB]',_0x18c5('0x13f'),JSON[_0x18c5('0x12a')](_0x273080)));});}if(_0x133217[_0x18c5('0x1c5')]===_0x18c5('0x1db')){return _0x5b51cc[_0x18c5('0xc1')](_0x133217['id'])[_0x18c5('0xb3')](function(_0x1d4405){var _0x1a15ea=_0x133217[_0x18c5('0x4f')]-_0x1d4405[0x0]['outboundQueuePauses'];var _0x1191b0=_0x133217[_0x18c5('0x1cb')]*0x3c;var _0x169b53=_0x4ecbdd[0x0][_0x18c5('0x65')]+_0x4ecbdd[0x0][_0x18c5('0x64')];var _0x22f049=(_0x4ecbdd[0x0]['predictiveIntervalAnsweredCalls']+_0x4ecbdd[0x0][_0x18c5('0x7c')]+_0x4ecbdd[0x0][_0x18c5('0x66')])/_0x4ecbdd[0x0][_0x18c5('0x79')];var _0x3e1f1=_0x133217[_0x18c5('0x1be')]/0x64;_0x133217[_0x18c5('0x1da')]=_0x1d4405[0x0][_0x18c5('0x1d9')]||0x0;_0x133217[_0x18c5('0x67')]=_0x22f049>0x0?_0x22f049:0x1;return _0x5b51cc[_0x18c5('0x1d5')](_0x1a15ea,_0x1191b0,_0x169b53,_0x22f049,_0x3e1f1);})['then'](function(_0x19de6f){return _0x42168c(_0x19de6f);})['catch'](function(_0x2c8a2e){return _0x4382e5(msgResponse(_0x18c5('0x1dc'),'Failure',JSON['stringify'](_0x2c8a2e)));});}}else{return _0x4382e5(msgResponse(_0x18c5('0x1d7'),_0x18c5('0x13f'),_0x18c5('0x1d8')));}});};};Dialer[_0x18c5('0x1b')][_0x18c5('0x1cd')]=function(_0x113039){var _0x2d22ea=this;return function(){var _0x5badc5=0x0;var _0x42d3dc=Math[_0x18c5('0x1c1')](_0x113039['erlangCallToSecond']*0x3e8);if(_0x42d3dc>0x0){_0x42d3dc=_0x42d3dc<0x64?0x64:_0x42d3dc;loggerPredictive[_0x18c5('0x76')](_0x113039[_0x18c5('0x41')],_0x18c5('0x1dd'),_0x42d3dc,_0x18c5('0x49'));_0x113039['handlePredictive']=setInterval(function(){_0x2d22ea[_0x18c5('0x8b')](_0x113039);loggerPredictiveCalls[_0x18c5('0x76')]('[handlePredictive]',_0x5badc5+=0x1);},_0x42d3dc);}else{loggerPredictive[_0x18c5('0x76')](_0x113039['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x18c5('0x1b')][_0x18c5('0x1de')]=function(_0x1d7439,_0x23f922){var _0x21c87e=this;return function(_0x4febef){if(_[_0x18c5('0x46')](_0x4febef)){if(_[_0x18c5('0xd7')](_0x23f922[_0x18c5('0xcf')])||!_0x23f922[_0x18c5('0x1df')]){if(_0x1d7439[_0x18c5('0x157')]===_0x18c5('0x9')){_0x1d7439['queueStatusComplete']=_[_0x18c5('0x3d')](_0x1d7439[_0x18c5('0x127')])?!![]:_0x1d7439[_0x18c5('0x127')];var _0x4e977b=uuid['v4']();_0x21c87e[_0x18c5('0x11f')][_0x4e977b]=new Action(_0x1d7439,_0x23f922,_0x4e977b);loggerBooked[_0x18c5('0x76')](_0x18c5('0x1e0'),_0x4e977b,_0x18c5('0x1e1'),JSON[_0x18c5('0x12a')](_0x1d7439['queueStatusComplete']),_0x18c5('0x1e2'),_0x1d7439['name']);if(_0x1d7439['queueStatusComplete']){_0x1d7439[_0x18c5('0x127')]=![];_0x21c87e[_0x18c5('0x125')][_0x21c87e[_0x18c5('0x11f')][_0x4e977b][_0x18c5('0xac')]]=[];ami[_0x18c5('0x146')]({'actionid':_0x4e977b,'action':_0x18c5('0x1e3'),'queue':_0x1d7439['name']})[_0x18c5('0xaa')](function(){_0x21c87e[_0x18c5('0xad')](_0x1d7439);_0x21c87e[_0x18c5('0xf0')]({'active':![],'ContactId':_0x21c87e[_0x18c5('0x11f')][_0x4e977b][_0x18c5('0xcd')],'ListId':_0x21c87e['actions'][_0x4e977b][_0x18c5('0xce')],'VoiceQueueId':_0x21c87e[_0x18c5('0x11f')][_0x4e977b][_0x18c5('0xd0')]||undefined,'CampaignId':_0x21c87e[_0x18c5('0x11f')][_0x4e977b][_0x18c5('0xfc')]||undefined})[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1e4')));delete _0x21c87e[_0x18c5('0x11f')][_0x4e977b];});}else{loggerBooked[_0x18c5('0x76')]('[booked][checkContactBlack][else]',JSON[_0x18c5('0x12a')](_0x1d7439['queueStatusComplete']),_0x18c5('0x1e2'),_0x1d7439[_0x18c5('0x41')]);_0x21c87e[_0x18c5('0xad')](_0x1d7439);_0x21c87e[_0x18c5('0xf0')]({'active':![],'ContactId':_0x21c87e[_0x18c5('0x11f')][_0x4e977b]['ContactId'],'ListId':_0x21c87e[_0x18c5('0x11f')][_0x4e977b]['ListId'],'VoiceQueueId':_0x21c87e[_0x18c5('0x11f')][_0x4e977b][_0x18c5('0xd0')]||undefined,'CampaignId':_0x21c87e[_0x18c5('0x11f')][_0x4e977b][_0x18c5('0xfc')]||undefined})['catch'](loggerCatch(_0x18c5('0x1e4')));delete _0x21c87e['actions'][_0x4e977b];}}else{return _0x21c87e[_0x18c5('0x1e5')](_0x1d7439,_0x23f922);}}else{if(getDiff(_0x23f922[_0x18c5('0x1e6')])<_0x1d7439['dialRecallMeTimeout']*0x3c){if(_0x23f922[_0x18c5('0x1e7')]&&!_0x23f922[_0x18c5('0x1e7')][_0x18c5('0x1e8')]){_0x21c87e[_0x18c5('0x1f')][_0x18c5('0x12b')](_0x23f922['id'])[_0x18c5('0x1d')](function(){_0x21c87e[_0x18c5('0xad')](_0x1d7439);});}else{_0x21c87e[_0x18c5('0xba')]({'active':![]},_0x23f922['id'],0x1)[_0x18c5('0x1d')](function(){_0x21c87e['updateOriginated'](_0x1d7439);});}}else{_0x1d7439[_0x18c5('0x60')]+=0x1;_0x21c87e[_0x18c5('0xad')](_0x1d7439);if(_0x1d7439[_0x18c5('0x1e9')]){_0x21c87e['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x23f922[_0x18c5('0xcd')],'ListId':_0x23f922[_0x18c5('0xce')],'VoiceQueueId':_0x23f922['VoiceQueueId']||undefined,'CampaignId':_0x23f922['CampaignId']||undefined})[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1ea')));_0x21c87e[_0x18c5('0xc4')](createObjHistory(_0x1d7439,_0x23f922,_0x18c5('0x1eb'),0x17,_0x18c5('0x1ec')))[_0x18c5('0xaa')](loggerCatch(_0x18c5('0x1ed')));}else{_0x21c87e['saveInDb'](createObjHistory(_0x1d7439,_0x23f922,_0x18c5('0x1ee'),0x16,_0x18c5('0x1ef')),'[Originate][HistoryRecallClose][historyCatch]',_0x18c5('0x1f0'));}}}}else{_0x1d7439['outboundBlacklistCallsDay']+=0x1;_0x21c87e[_0x18c5('0xcb')](createObjHistory(_0x1d7439,_0x23f922,'BLACKLIST',0xd,_0x18c5('0x1f1')),_0x18c5('0x1f2'),_0x18c5('0x1f3'));throw _0x18c5('0x1f4');}};};Dialer[_0x18c5('0x1b')][_0x18c5('0x156')]=function(_0x5e241a){var _0xcc4447=this;var _0x1d94ba=_0x5e241a['limitCalls']-_0x5e241a[_0x18c5('0x6a')]-_0x5e241a[_0x18c5('0xbd')];emitCampaignSummary(_0x5e241a);if(_0x1d94ba>0x0){if(_0x1d94ba>this['maxNumberOriginate']){_0x1d94ba=this[_0x18c5('0x23')];}_0x5e241a[_0x18c5('0xbd')]+=_0x1d94ba;this[_0x18c5('0xbf')](_0x5e241a['id'],_0x1d94ba,_0x5e241a['dialOrderByScheduledAt'],_0x5e241a)[_0x18c5('0xb3')](function(_0x2fe7a0){_0x5e241a['temp']-=_0x1d94ba;_0x5e241a[_0x18c5('0xbd')]=_0x5e241a[_0x18c5('0xbd')]>0x0?_0x5e241a[_0x18c5('0xbd')]:0x0;if(!checkContactEmpty(_0x2fe7a0)){_0x5e241a['message']=_0x18c5('0x98');logger['info'](_0x18c5('0x1f5')+_0x5e241a[_0x18c5('0x41')]);}else{_0x5e241a[_0x18c5('0x6a')]+=_0x2fe7a0[_0x18c5('0x92')];_0x5e241a[_0x18c5('0x3e')]=_0x18c5('0x1f6');for(var _0x404716=0x0;_0x404716<_0x2fe7a0['length'];_0x404716+=0x1){_0x5e241a[_0x18c5('0x1f7')]+=0x1;if(_[_0x18c5('0xd7')](_0x2fe7a0[_0x404716])||_[_0x18c5('0xd7')](_0x2fe7a0[_0x404716][_0x18c5('0x163')])||_['isNil'](_0x2fe7a0[_0x404716][_0x18c5('0x163')][_0x18c5('0x164')])){_0xcc4447['emptyContact'](_0x18c5('0x1f8'),_0x5e241a,_0x2fe7a0[_0x404716]);}else{_0xcc4447['checkIsBlackListIvr'](_[_0x18c5('0xcc')](_0x2fe7a0[_0x404716],[_0x18c5('0xfc'),_0x18c5('0x1f9')]))[_0x18c5('0xb3')](_0xcc4447[_0x18c5('0x1de')](_0x5e241a,_0x2fe7a0[_0x404716]))['catch'](_0xcc4447['loggerHandler'](_0x18c5('0x1fa'),_0x5e241a));}}}})[_0x18c5('0xaa')](loggerGetContactDialer(_0x18c5('0x1fb'),_0x5e241a,_0x1d94ba));}};Dialer[_0x18c5('0x1b')][_0x18c5('0x153')]=function(_0x389da4,_0x212800){var _0x54bc4b=this;var _0x35376f=[];var _0x2bd71c=_0x212800>=0x1?_0x212800:0x1;if(_0x389da4['dialMethod']===_0x18c5('0x9')){_0x2bd71c=0x1;}var _0x1fc446=Math[_0x18c5('0x1c1')](_0x389da4[_0x18c5('0x4e')]*_0x2bd71c)-_0x389da4['originated']-_0x389da4[_0x18c5('0xbd')];emitVoiceQueueSummary(_0x389da4);if(_0x389da4[_0x18c5('0x1fc')]>0x0){var _0x34f67e=_0x389da4['dialLimitQueue']-_0x389da4[_0x18c5('0x6a')]-_0x389da4[_0x18c5('0x53')]-_0x389da4[_0x18c5('0xbd')]-_0x389da4['pTalking'];if(_0x1fc446>_0x34f67e){_0x1fc446=_0x34f67e;}}if(_0x1fc446>0x0){if(_0x389da4[_0x18c5('0x157')]===_0x18c5('0x9')){_0x1fc446=0x1;}if(_0x1fc446>this[_0x18c5('0x23')]){_0x1fc446=this[_0x18c5('0x23')];}_0x389da4[_0x18c5('0xbd')]+=_0x1fc446;for(var _0x23e7f4 in this[_0x18c5('0x21')]){if(typeof this['agents'][_0x23e7f4]!==_0x18c5('0x93')){if(this[_0x18c5('0x21')][_0x23e7f4]['state']===_0x18c5('0x1fd')&&this[_0x18c5('0x21')][_0x23e7f4]['status']==='reachable'){_0x35376f[_0x18c5('0x126')](this['agents'][_0x23e7f4]['id']);}}}this[_0x18c5('0xbc')](_0x389da4['id'],_0x35376f,_0x1fc446,_0x389da4[_0x18c5('0x1fe')],_0x389da4)[_0x18c5('0xb3')](function(_0x58bebd){_0x389da4[_0x18c5('0xbd')]-=_0x1fc446;_0x389da4[_0x18c5('0xbd')]=_0x389da4[_0x18c5('0xbd')]>0x0?_0x389da4['temp']:0x0;if(!checkContactEmpty(_0x58bebd)){_0x54bc4b['countReScheduled'](_0x389da4)[_0x18c5('0xb3')](sendMessageReschedule(_0x389da4))[_0x18c5('0xaa')](loggerCatch('[countReScheduled]\x20'));}else{_0x389da4[_0x18c5('0x6a')]+=_0x58bebd[_0x18c5('0x92')];_0x389da4[_0x18c5('0x3e')]=_0x389da4[_0x18c5('0x157')]===_0x18c5('0x9')?_0x18c5('0x16b'):'RUNNING';for(var _0x5a78a7=0x0;_0x5a78a7<_0x58bebd[_0x18c5('0x92')];_0x5a78a7+=0x1){if(_[_0x18c5('0xd7')](_0x58bebd[_0x5a78a7])||_[_0x18c5('0xd7')](_0x58bebd[_0x5a78a7]['Contact'])||_[_0x18c5('0xd7')](_0x58bebd[_0x5a78a7][_0x18c5('0x163')][_0x18c5('0x164')])){_0x54bc4b[_0x18c5('0xc9')]('[actionOriginate]\x20',_0x389da4,_0x58bebd[_0x5a78a7]);}else{_0x54bc4b[_0x18c5('0xb2')](_['pick'](_0x58bebd[_0x5a78a7],[_0x18c5('0xd0'),_0x18c5('0x1f9')]))[_0x18c5('0xb3')](_0x54bc4b['checkContactBlack'](_0x389da4,_0x58bebd[_0x5a78a7]))[_0x18c5('0xaa')](_0x54bc4b[_0x18c5('0xc8')](_0x18c5('0x1f8'),_0x389da4));}}}})['catch'](loggerGetContactDialer(_0x18c5('0x1ff'),_0x389da4,_0x1fc446));}};Dialer[_0x18c5('0x1b')][_0x18c5('0x8b')]=function(_0x584a9b){if(_0x584a9b[_0x18c5('0x1fc')]>0x0){var _0x5cd574=_0x584a9b[_0x18c5('0x1fc')]-_0x584a9b['originated']-_0x584a9b[_0x18c5('0x53')];if(_0x5cd574>0x0){this['tryOriginatePredictive'](_0x584a9b);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x584a9b);}};Dialer['prototype'][_0x18c5('0x200')]=function(_0x3562a0){var _0x4e1250=this;var _0x3fa804=[];_0x3562a0['originated']+=0x1;for(var _0x160a74 in this[_0x18c5('0x21')]){if(typeof this[_0x18c5('0x21')][_0x160a74]!==_0x18c5('0x93')){if(this[_0x18c5('0x21')][_0x160a74][_0x18c5('0xa1')]===_0x18c5('0x1fd')&&this[_0x18c5('0x21')][_0x160a74][_0x18c5('0xa8')]===_0x18c5('0x201')){_0x3fa804[_0x18c5('0x126')](this[_0x18c5('0x21')][_0x160a74]['id']);}}}this[_0x18c5('0xbc')](_0x3562a0['id'],_0x3fa804,0x1,_0x3562a0[_0x18c5('0x1fe')],_0x3562a0)['then'](function(_0x4f116c){if(!checkContactEmpty(_0x4f116c)){checkContactLowerLimitOriginate(_0x3562a0,0x1,0x0);_0x4e1250[_0x18c5('0xaf')](_0x3562a0)[_0x18c5('0xb3')](sendMessageReschedule(_0x3562a0))['catch'](loggerCatch(_0x18c5('0xb1')));}else{_0x3562a0['message']=_0x18c5('0x1f6');if(_[_0x18c5('0xd7')](_0x4f116c[0x0])||_['isNil'](_0x4f116c[0x0][_0x18c5('0x163')])||_[_0x18c5('0xd7')](_0x4f116c[0x0][_0x18c5('0x163')][_0x18c5('0x164')])){_0x4e1250[_0x18c5('0xc9')](_0x18c5('0x1f8'),_0x3562a0,_0x4f116c[0x0]);}else{_0x4e1250['checkIsBlackList'](_['pick'](_0x4f116c[0x0],[_0x18c5('0xd0'),_0x18c5('0x1f9')]))[_0x18c5('0xb3')](_0x4e1250[_0x18c5('0x1de')](_0x3562a0,_0x4f116c[0x0]))[_0x18c5('0xaa')](_0x4e1250[_0x18c5('0xc8')]('[actionOriginatePredictive]\x20',_0x3562a0));}}})[_0x18c5('0xaa')](loggerGetContactDialer(_0x18c5('0x202'),_0x3562a0,0x1));emitVoiceQueueSummary(_0x3562a0);};Dialer['prototype'][_0x18c5('0x1d4')]=function(_0x35c000,_0x1a923c,_0x4e18d3,_0x3b6973,_0x57a7a2,_0x28651a){loggerPredictive['info'](_0x18c5('0x203'));loggerPredictive[_0x18c5('0x76')](_0x18c5('0x204'),_0x35c000);loggerPredictive[_0x18c5('0x76')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1a923c);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x205'),_0x4e18d3);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x206'),_0x3b6973);loggerPredictive[_0x18c5('0x76')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57a7a2);loggerPredictive['info'](_0x18c5('0x80'));return new BPromise(function(_0x41d83b,_0x50aed0){if(_0x35c000<=0x0||isNaN(_0x35c000)){return _0x50aed0(msgResponse(_0x18c5('0x207'),_0x18c5('0x48'),_0x18c5('0x208')+_0x35c000));}if(_0x4e18d3<=0x0||isNaN(_0x4e18d3)){return _0x50aed0(msgResponse('[abandonmentRate]','Error',_0x18c5('0x209')+_0x4e18d3));}if(_0x3b6973<=0x0||isNaN(_0x3b6973)){return _0x50aed0(msgResponse(_0x18c5('0x207'),_0x18c5('0x48'),_0x18c5('0x20a')+_0x3b6973));}if(_0x1a923c<=0x0||isNaN(_0x1a923c)){return _0x50aed0(msgResponse(_0x18c5('0x207'),_0x18c5('0x48'),'interval\x20=\x20'+_0x1a923c));}if(_0x57a7a2<=0x0||isNaN(_0x57a7a2)){return _0x50aed0(msgResponse(_0x18c5('0x207'),_0x18c5('0x48'),'Amax\x20=\x20'+_0x57a7a2));}_0x28651a=_0x28651a||0x0;var _0x5c6830=0x1/_0x4e18d3;var _0x501179=0x0;var _0x17a301=0x0;var _0x4cff9b=0x0;var _0xd1a68b=0x0;for(var _0x354a67=0x0;_0x4cff9b<_0x57a7a2;_0x354a67+=0x1){_0x17a301=_0x354a67/_0x1a923c;_0x501179=(_0x3b6973*_0x17a301+_0x28651a)/_0x5c6830;_0x4cff9b=erlangb(_0x501179,_0x35c000);_0xd1a68b=_0x501179/_0x35c000*(0x1-erlangb(_0x501179,_0x35c000));}return _0x41d83b({'erlangCalls':_0x354a67,'erlangCallToSecond':_0x1a923c/_0x354a67,'erlangAbandonmentRate':_0x4cff9b,'erlangBusyFactor':_0xd1a68b});});};Dialer['prototype'][_0x18c5('0x1d5')]=function(_0x3439ba,_0x19ae89,_0x2bd9a6,_0x325bad,_0x2bc412,_0x4e646f){loggerPredictive[_0x18c5('0x76')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x18c5('0x76')](_0x18c5('0x204'),_0x3439ba);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x20b'),_0x19ae89);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x205'),_0x2bd9a6);loggerPredictive[_0x18c5('0x76')](_0x18c5('0x206'),_0x325bad);loggerPredictive[_0x18c5('0x76')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2bc412);loggerPredictive[_0x18c5('0x76')]('---------------------------');return new BPromise(function(_0xc32c0b,_0x54e8da){if(_0x3439ba<=0x0||isNaN(_0x3439ba)){return _0x54e8da(msgResponse(_0x18c5('0x20c'),_0x18c5('0x48'),_0x18c5('0x208')+_0x3439ba));}if(_0x2bd9a6<=0x0||isNaN(_0x2bd9a6)){return _0x54e8da(msgResponse(_0x18c5('0x20c'),_0x18c5('0x48'),_0x18c5('0x209')+_0x2bd9a6));}if(_0x325bad<=0x0||isNaN(_0x325bad)){return _0x54e8da(msgResponse(_0x18c5('0x20c'),_0x18c5('0x48'),_0x18c5('0x20a')+_0x325bad));}if(_0x19ae89<=0x0||isNaN(_0x19ae89)){return _0x54e8da(msgResponse(_0x18c5('0x20c'),'Error',_0x18c5('0x20d')+_0x19ae89));}if(_0x2bc412<=0x0||isNaN(_0x2bc412)){return _0x54e8da(msgResponse('[busyFactor]','Error',_0x18c5('0x20e')+_0x2bc412));}_0x4e646f=_0x4e646f||0x0;var _0x3238b8=0x1/_0x2bd9a6;var _0x5197d9=0x0;var _0x4a9ec9=0x0;var _0x308dce=0x0;var _0x3e9b99=0x0;for(var _0x52259d=0x0;_0x3e9b99<_0x2bc412;_0x52259d+=0x1){_0x4a9ec9=_0x52259d/_0x19ae89;_0x5197d9=(_0x325bad*_0x4a9ec9+_0x4e646f)/_0x3238b8;_0x308dce=erlangb(_0x5197d9,_0x3439ba);_0x3e9b99=_0x5197d9/_0x3439ba*(0x1-erlangb(_0x5197d9,_0x3439ba));}return _0xc32c0b({'erlangCalls':_0x52259d,'erlangCallToSecond':_0x19ae89/_0x52259d,'erlangAbandonmentRate':_0x308dce,'erlangBusyFactor':_0x3e9b99});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index c80421c..db38f68 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 _0xdaf6=['util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xdaf6,0x81));var _0x6daf=function(_0x22942f,_0x56e2ae){_0x22942f=_0x22942f-0x0;var _0x17dde5=_0xdaf6[_0x22942f];return _0x17dde5;};'use strict';var util=require(_0x6daf('0x0'));var _=require('lodash');var moment=require(_0x6daf('0x1'));function getSeconds(_0x46ad01,_0x31e589){var _0xeb0616=moment(_0x46ad01)[_0x6daf('0x2')](0x0);var _0xdf84e7=moment(_0x31e589)['milliseconds'](0x0);return _0xeb0616[_0x6daf('0x3')](_0xdf84e7,_0x6daf('0x4'));}function QueueCallerAbandon(_0x850a70,_0x4f4d01){this[_0x6daf('0x5')]=_0x850a70[_0x6daf('0x5')];this[_0x6daf('0x6')]=_0x850a70[_0x6daf('0x6')];this[_0x6daf('0x7')]=_0x850a70[_0x6daf('0x6')]===_0x6daf('0x8')?_0x6daf('0x9'):_0x850a70[_0x6daf('0x6')];this[_0x6daf('0xa')]=_0x850a70[_0x6daf('0xa')];this[_0x6daf('0xb')]=_0x850a70[_0x6daf('0xb')];this[_0x6daf('0xc')]=_0x850a70['countnoanswerretry'];this[_0x6daf('0xd')]=_0x850a70['countbusyretry']+_0x850a70[_0x6daf('0xb')]+_0x850a70[_0x6daf('0xc')]+_0x850a70[_0x6daf('0xe')]+_0x850a70[_0x6daf('0xf')]+_0x850a70['countabandonedretry']+_0x850a70[_0x6daf('0x10')]+_0x850a70[_0x6daf('0x11')];this['countnosuchnumberretry']=_0x850a70[_0x6daf('0xe')];this[_0x6daf('0xf')]=_0x850a70[_0x6daf('0xf')];this[_0x6daf('0x12')]=_0x850a70[_0x6daf('0x12')];this[_0x6daf('0x10')]=_0x850a70[_0x6daf('0x10')];this[_0x6daf('0x11')]=_0x850a70[_0x6daf('0x11')];this[_0x6daf('0x13')]=_0x4f4d01[_0x6daf('0x13')];this[_0x6daf('0x14')]=_0x850a70['name'];this[_0x6daf('0x15')]=_0x850a70[_0x6daf('0x16')];this[_0x6daf('0x17')]=_0x850a70[_0x6daf('0x17')];this[_0x6daf('0x18')]=_0x850a70[_0x6daf('0x18')];this['droptime']=_0x850a70[_0x6daf('0x19')];this[_0x6daf('0x1a')]=this[_0x6daf('0x19')];this[_0x6daf('0x1b')]=getSeconds(_0x850a70[_0x6daf('0x18')],_0x850a70[_0x6daf('0x17')]);this[_0x6daf('0x1c')]=getSeconds(this[_0x6daf('0x19')],_0x850a70[_0x6daf('0x18')]);this[_0x6daf('0x1d')]=0x0;this['queue']=_0x4f4d01[_0x6daf('0x9')];this[_0x6daf('0x1e')]=_0x4f4d01['connectedlinename'];this[_0x6daf('0x1f')]=_0x4f4d01[_0x6daf('0x1f')];this[_0x6daf('0x20')]=_0x850a70[_0x6daf('0x20')];this[_0x6daf('0x21')]=_0x850a70[_0x6daf('0x21')];this[_0x6daf('0x22')]=_0x850a70[_0x6daf('0x22')];this['recallme']=_0x850a70[_0x6daf('0x23')];this[_0x6daf('0x24')]=_0x850a70['ContactId'];this[_0x6daf('0x25')]=_0x850a70[_0x6daf('0x25')];this[_0x6daf('0x26')]=_0x850a70[_0x6daf('0x26')];this[_0x6daf('0x27')]=_0x850a70[_0x6daf('0x27')];this['CampaignId']=_0x850a70[_0x6daf('0x28')];this['originatecalleridnum']=_0x850a70['originatecalleridnum']||'';this[_0x6daf('0x29')]=_0x850a70[_0x6daf('0x29')]||'';}module[_0x6daf('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xe4bd=['ringtime','talktime','queue','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','seconds','scheduledat','type','campaigntype','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime'];(function(_0x26e4c3,_0x169fff){var _0x36ddc9=function(_0x150ad4){while(--_0x150ad4){_0x26e4c3['push'](_0x26e4c3['shift']());}};_0x36ddc9(++_0x169fff);}(_0xe4bd,0x89));var _0xde4b=function(_0x3955e9,_0x48c85e){_0x3955e9=_0x3955e9-0x0;var _0xfaebf2=_0xe4bd[_0x3955e9];return _0xfaebf2;};'use strict';var util=require(_0xde4b('0x0'));var _=require(_0xde4b('0x1'));var moment=require('moment');function getSeconds(_0x11ceea,_0x31793e){var _0x599539=moment(_0x11ceea)['milliseconds'](0x0);var _0x2a9809=moment(_0x31793e)['milliseconds'](0x0);return _0x599539['diff'](_0x2a9809,_0xde4b('0x2'));}function QueueCallerAbandon(_0x5111bc,_0x22ef57){this[_0xde4b('0x3')]=_0x5111bc['scheduledat'];this[_0xde4b('0x4')]=_0x5111bc[_0xde4b('0x4')];this[_0xde4b('0x5')]=_0x5111bc['type']==='outbound'?'queue':_0x5111bc[_0xde4b('0x4')];this['countbusyretry']=_0x5111bc['countbusyretry'];this[_0xde4b('0x6')]=_0x5111bc['countcongestionretry'];this[_0xde4b('0x7')]=_0x5111bc[_0xde4b('0x7')];this[_0xde4b('0x8')]=_0x5111bc[_0xde4b('0x9')]+_0x5111bc['countcongestionretry']+_0x5111bc[_0xde4b('0x7')]+_0x5111bc[_0xde4b('0xa')]+_0x5111bc[_0xde4b('0xb')]+_0x5111bc[_0xde4b('0xc')]+_0x5111bc['countmachineretry']+_0x5111bc[_0xde4b('0xd')];this['countnosuchnumberretry']=_0x5111bc[_0xde4b('0xa')];this[_0xde4b('0xb')]=_0x5111bc[_0xde4b('0xb')];this['countabandonedretry']=_0x5111bc[_0xde4b('0xc')];this[_0xde4b('0xe')]=_0x5111bc[_0xde4b('0xe')];this[_0xde4b('0xd')]=_0x5111bc[_0xde4b('0xd')];this['uniqueid']=_0x22ef57[_0xde4b('0xf')];this['calleridname']=_0x5111bc[_0xde4b('0x10')];this[_0xde4b('0x11')]=_0x5111bc[_0xde4b('0x12')];this[_0xde4b('0x13')]=_0x5111bc[_0xde4b('0x13')];this[_0xde4b('0x14')]=_0x5111bc[_0xde4b('0x14')];this['droptime']=_0x5111bc[_0xde4b('0x15')];this[_0xde4b('0x16')]=this[_0xde4b('0x15')];this[_0xde4b('0x17')]=getSeconds(_0x5111bc[_0xde4b('0x14')],_0x5111bc[_0xde4b('0x13')]);this['holdtime']=getSeconds(this[_0xde4b('0x15')],_0x5111bc[_0xde4b('0x14')]);this[_0xde4b('0x18')]=0x0;this[_0xde4b('0x19')]=_0x22ef57[_0xde4b('0x19')];this[_0xde4b('0x1a')]=_0x22ef57[_0xde4b('0x1b')];this[_0xde4b('0x1c')]=_0x22ef57[_0xde4b('0x1c')];this['callback']=_0x5111bc['callback'];this[_0xde4b('0x1d')]=_0x5111bc[_0xde4b('0x1d')];this['callbackat']=_0x5111bc[_0xde4b('0x1e')];this[_0xde4b('0x1f')]=_0x5111bc[_0xde4b('0x1f')];this['ContactId']=_0x5111bc[_0xde4b('0x20')];this[_0xde4b('0x21')]=_0x5111bc[_0xde4b('0x21')];this['UserId']=_0x5111bc[_0xde4b('0x22')];this[_0xde4b('0x23')]=_0x5111bc['VoiceQueueId'];this['CampaignId']=_0x5111bc[_0xde4b('0x24')];this[_0xde4b('0x25')]=_0x5111bc[_0xde4b('0x25')]||'';this[_0xde4b('0x26')]=_0x5111bc[_0xde4b('0x26')]||'';}module[_0xde4b('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8441375..257c0c7 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(_0x17ff7d,_0xdd4746){var _0x31adc9=function(_0x329725){while(--_0x329725){_0x17ff7d['push'](_0x17ff7d['shift']());}};_0x31adc9(++_0xdd4746);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x29cb88,_0x380499){var _0x3b5c0e=function(_0x426081){while(--_0x426081){_0x29cb88['push'](_0x29cb88['shift']());}};_0x3b5c0e(++_0x380499);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 3803710..7884fb3 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 _0xe1e3=['syncHangup','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','syncVarSet','variable','value','syncNewState','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','notify','.pdf','\x20notify\x20','stringify','catch','error','\x20receiveFax\x20','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','syncNewchannel','bind','varset','receivefax','syncReceiveFax'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x288fb1,_0x439d76){_0x288fb1=_0x288fb1-0x0;var _0x20ae8e=_0xe1e3[_0x288fb1];return _0x20ae8e;};'use strict';var util=require(_0x3e1e('0x0'));var _=require(_0x3e1e('0x1'));var BPromise=require('bluebird');var uuid=require(_0x3e1e('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x3e1e('0x3'));var gs=require('./util/gs');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var ami=require(_0x3e1e('0x6'));var rpcDb=require(_0x3e1e('0x7'));var Channel=require(_0x3e1e('0x8'));var ut=require(_0x3e1e('0x9'));var Action=require('./action');var faxAccount=require(_0x3e1e('0xa'));var attachment=require(_0x3e1e('0xb'));var faxMessage=require(_0x3e1e('0xc'));function Fax(_0xa67e35){this[_0x3e1e('0xd')]={};this[_0x3e1e('0xe')]=_0xa67e35['faxAccounts'];this['trunks']=_0xa67e35['trunks'];this[_0x3e1e('0xf')]={};ami['on']('newchannel',this[_0x3e1e('0x10')][_0x3e1e('0x11')](this));ami['on'](_0x3e1e('0x12'),this['syncVarSet'][_0x3e1e('0x11')](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x3e1e('0x11')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x3e1e('0x11')](this));ami['on'](_0x3e1e('0x13'),this[_0x3e1e('0x14')]['bind'](this));ami['on']('hangup',this[_0x3e1e('0x15')][_0x3e1e('0x11')](this));ami['on']('originateresponse',this[_0x3e1e('0x16')][_0x3e1e('0x11')](this));}Fax['prototype'][_0x3e1e('0x10')]=function(_0x4d0feb){if(_0x4d0feb[_0x3e1e('0x17')]===_0x3e1e('0x18')){for(var _0x1d786c in this[_0x3e1e('0xe')]){if(this[_0x3e1e('0xe')][_0x3e1e('0x19')](_0x1d786c)){if(_0x4d0feb['exten']===this['faxAccounts'][_0x1d786c]['localstationid']){this[_0x3e1e('0xd')][_0x4d0feb[_0x3e1e('0x1a')]]={};this[_0x3e1e('0xd')][_0x4d0feb['uniqueid']][_0x3e1e('0x1b')]=_0x4d0feb['channel'];this[_0x3e1e('0xd')][_0x4d0feb[_0x3e1e('0x1a')]]['id']=this[_0x3e1e('0xe')][_0x1d786c]['id'];this['channels'][_0x4d0feb[_0x3e1e('0x1a')]][_0x3e1e('0x1c')]=this[_0x3e1e('0xe')][_0x1d786c]['name'];logger['info'](_0x4d0feb[_0x3e1e('0x1a')],_0x3e1e('0x1d'));}}}}if(this['actions'][_0x4d0feb[_0x3e1e('0x1a')]]){this[_0x3e1e('0xd')][_0x4d0feb[_0x3e1e('0x1a')]]={};this[_0x3e1e('0xd')][_0x4d0feb[_0x3e1e('0x1a')]][_0x3e1e('0x1b')]=_0x4d0feb[_0x3e1e('0x1b')];logger[_0x3e1e('0x1e')](_0x4d0feb['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x3e1e('0x1f')][_0x3e1e('0x20')]=function(_0x55db8f){if(this['channels'][_0x55db8f['uniqueid']]){for(var _0x1a33bb in _0x55db8f[_0x3e1e('0x21')]){if(_0x55db8f['variable'][_0x3e1e('0x19')](_0x1a33bb)){this['channels'][_0x55db8f[_0x3e1e('0x1a')]][_0x1a33bb]=_0x55db8f[_0x3e1e('0x22')];}}}};Fax['prototype'][_0x3e1e('0x23')]=function(_0x210a84){if(this[_0x3e1e('0xd')][_0x210a84['uniqueid']]){this[_0x3e1e('0xd')][_0x210a84['uniqueid']]['channelstate']=_0x210a84['channelstate'];this[_0x3e1e('0xd')][_0x210a84['uniqueid']]['channelstatedesc']=_0x210a84[_0x3e1e('0x24')];}};Fax[_0x3e1e('0x1f')][_0x3e1e('0x25')]=function(_0x233b18){if(this[_0x3e1e('0xd')][_0x233b18['uniqueid']]){for(var _0x5522ba in _0x233b18['variable']){if(_0x233b18['variable'][_0x3e1e('0x19')](_0x5522ba)){this[_0x3e1e('0xd')][_0x233b18[_0x3e1e('0x1a')]][_0x5522ba]=_0x233b18[_0x3e1e('0x22')];}}}};Fax[_0x3e1e('0x1f')][_0x3e1e('0x26')]=function(_0x135d83){if(this[_0x3e1e('0xd')][_0x135d83['uniqueid']]){this[_0x3e1e('0xd')][_0x135d83[_0x3e1e('0x1a')]]['operation']=_0x135d83[_0x3e1e('0x27')];this[_0x3e1e('0xd')][_0x135d83[_0x3e1e('0x1a')]][_0x3e1e('0x28')]=_0x135d83['status'];this['channels'][_0x135d83[_0x3e1e('0x1a')]][_0x3e1e('0x29')]=_0x135d83['localstationid'];this[_0x3e1e('0xd')][_0x135d83[_0x3e1e('0x1a')]]['filename']=_0x135d83[_0x3e1e('0x2a')];logger[_0x3e1e('0x1e')](_0x135d83[_0x3e1e('0x1a')],_0x3e1e('0x2b'));}};Fax[_0x3e1e('0x1f')]['syncReceiveFax']=function(_0x1da527){var _0x42556a=this;if(this[_0x3e1e('0xd')][_0x1da527[_0x3e1e('0x1a')]]){var _0x51d779=this[_0x3e1e('0xd')][_0x1da527[_0x3e1e('0x1a')]]['id'];this[_0x3e1e('0xd')][_0x1da527[_0x3e1e('0x1a')]][_0x3e1e('0x2c')]=_0x1da527[_0x3e1e('0x2c')];this[_0x3e1e('0xd')][_0x1da527['uniqueid']][_0x3e1e('0x2d')]=_0x1da527['pagestransferred'];this['channels'][_0x1da527[_0x3e1e('0x1a')]][_0x3e1e('0x29')]=_0x1da527[_0x3e1e('0x29')];this['channels'][_0x1da527[_0x3e1e('0x1a')]][_0x3e1e('0x2e')]=_0x1da527['resolution'];this[_0x3e1e('0xd')][_0x1da527[_0x3e1e('0x1a')]]['transferrate']=_0x1da527['transferrate'];this[_0x3e1e('0xd')][_0x1da527['uniqueid']]['filename']=_0x1da527[_0x3e1e('0x2a')];this[_0x3e1e('0xd')][_0x1da527[_0x3e1e('0x1a')]][_0x3e1e('0x2f')]=_0x1da527[_0x3e1e('0x2f')];if(this['channels'][_0x1da527['uniqueid']][_0x3e1e('0x2d')]>0x0){tiff2pdf(_0x1da527[_0x3e1e('0x2a')],_0x3e1e('0x30'),function(_0x52e227){logger[_0x3e1e('0x1e')](_0x1da527[_0x3e1e('0x1a')],_0x3e1e('0x31'),_0x52e227['message']);attachment[_0x3e1e('0x32')]({'name':path['parse'](_0x1da527['filename'])[_0x3e1e('0x1c')],'basename':path[_0x3e1e('0x33')](_0x1da527[_0x3e1e('0x2a')])[_0x3e1e('0x1c')]+'.pdf','type':'application/pdf'})['then'](function(_0x593996){faxAccount[_0x3e1e('0x34')](_0x51d779,{'from':_0x1da527[_0x3e1e('0x2f')],'mapKey':'fax','body':path['parse'](_0x1da527[_0x3e1e('0x2a')])[_0x3e1e('0x1c')]+_0x3e1e('0x35'),'AttachmentId':_0x593996['id']})['catch'](function(_0x30f1d0){logger['error'](_0x1da527[_0x3e1e('0x1a')],_0x3e1e('0x36'),JSON[_0x3e1e('0x37')](_0x30f1d0));});})[_0x3e1e('0x38')](function(_0x28338a){logger[_0x3e1e('0x39')](_0x1da527['uniqueid'],_0x3e1e('0x3a'),JSON[_0x3e1e('0x37')](_0x28338a));});});}logger['info'](_0x1da527[_0x3e1e('0x1a')],_0x3e1e('0x3a'));}};Fax['prototype'][_0x3e1e('0x16')]=function(_0x347b3f){if(this[_0x3e1e('0xf')][_0x347b3f[_0x3e1e('0x1a')]]){_['merge'](this[_0x3e1e('0xd')][_0x347b3f[_0x3e1e('0x1a')]],_[_0x3e1e('0x3b')](_0x347b3f,[_0x3e1e('0x3c'),'reason']));}};function updateStatus(_0xbeaf39){if(_0xbeaf39[_0x3e1e('0x3d')]){faxMessage[_0x3e1e('0x3e')](_0xbeaf39[_0x3e1e('0x3d')],{'failMessage':_0x3e1e('0x3f')})[_0x3e1e('0x40')](function(_0x2d1fe9){ut[_0x3e1e('0x41')]('[Fax][Message][Error][Updated]',_0x2d1fe9);})[_0x3e1e('0x38')](function(_0x48b5e7){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x48b5e7);});}else{ut[_0x3e1e('0x41')](_0x3e1e('0x42'));}}Fax['prototype'][_0x3e1e('0x43')]=function(_0x592733,_0x5b2416,_0x3eaf76){var _0x58d425=this;var _0x56f69f={};if(_0x5b2416){_0x56f69f={'read':_0x5b2416};}else{_0x56f69f={'failMessage':_0x3eaf76};}if(this['actions'][_0x592733][_0x3e1e('0x3d')]){faxMessage[_0x3e1e('0x3e')](this[_0x3e1e('0xf')][_0x592733][_0x3e1e('0x3d')],_0x56f69f)[_0x3e1e('0x40')](function(_0xe18f8a){ut[_0x3e1e('0x41')]('[Fax][Message][Updated]',_0xe18f8a);})[_0x3e1e('0x38')](function(_0x5f5587){ut[_0x3e1e('0x41')](_0x3e1e('0x44'),_0x5f5587);})[_0x3e1e('0x45')](function(){delete _0x58d425['channels'][_0x592733];delete _0x58d425['actions'][_0x592733];});}else{ut[_0x3e1e('0x41')](_0x3e1e('0x46'));delete this['channels'][_0x592733];delete this[_0x3e1e('0xf')][_0x592733];}};Fax['prototype']['syncHangup']=function(_0x284cc7){var _0x3451ed=this;if(this['channels'][_0x284cc7[_0x3e1e('0x1a')]]){if(this['actions'][_0x284cc7['uniqueid']]){this[_0x3e1e('0xd')][_0x284cc7['uniqueid']]['id']=this[_0x3e1e('0xf')][_0x284cc7['uniqueid']]['id'];this[_0x3e1e('0xd')][_0x284cc7['uniqueid']][_0x3e1e('0x1c')]=this[_0x3e1e('0xf')][_0x284cc7['uniqueid']]['name'];}logger['info'](_0x284cc7[_0x3e1e('0x1a')],this[_0x3e1e('0xf')][_0x284cc7[_0x3e1e('0x1a')]]?'\x20hangup\x20sendFile\x20':_0x3e1e('0x47'),JSON[_0x3e1e('0x37')](this[_0x3e1e('0xd')][_0x284cc7['uniqueid']]));if(this['actions'][_0x284cc7[_0x3e1e('0x1a')]]){if(this['channels'][_0x284cc7[_0x3e1e('0x1a')]][_0x3e1e('0x48')]>0x0&&this[_0x3e1e('0xd')][_0x284cc7['uniqueid']][_0x3e1e('0x49')]==='SUCCESS'){this[_0x3e1e('0x43')](_0x284cc7[_0x3e1e('0x1a')],!![]);}else{this['updateStatus'](_0x284cc7[_0x3e1e('0x1a')],![],this['channels'][_0x284cc7[_0x3e1e('0x1a')]]['faxstatusstring']?_0x3e1e('0x4a')+this['channels'][_0x284cc7[_0x3e1e('0x1a')]][_0x3e1e('0x4b')]:_0x3e1e('0x4c'));}}}};Fax['prototype'][_0x3e1e('0x4d')]=function(_0x1fbcfc){var _0x4e6957=this;return new BPromise(function(_0x238ce0,_0x583535){_0x4e6957['execOriginate'](_0x1fbcfc,_0x4e6957['faxAccounts'][_0x1fbcfc[_0x3e1e('0x4e')]])[_0x3e1e('0x40')](function(_0x384ee6){ut[_0x3e1e('0x41')](_0x3e1e('0x4f'),_0x384ee6);_0x238ce0(ut[_0x3e1e('0x50')](_0x3e1e('0x51')));})['catch'](function(_0x30830d){ut[_0x3e1e('0x41')](_0x3e1e('0x52'),_0x30830d);updateStatus(_0x1fbcfc);_0x583535(ut[_0x3e1e('0x50')](_0x3e1e('0x53')));});});};Fax[_0x3e1e('0x1f')][_0x3e1e('0x54')]=function(_0x4314d3){var _0x4c3d6b=this;return new BPromise(function(_0x580192,_0x3d26b2){var _0x27c3d2=_0x4c3d6b[_0x3e1e('0x55')](_0x4c3d6b[_0x3e1e('0xe')][_0x4314d3[_0x3e1e('0x4e')]][_0x3e1e('0x56')],_0x4314d3);if(_0x27c3d2[_0x3e1e('0x57')]){_0x580192(ut[_0x3e1e('0x50')](_0x3e1e('0x58')));}else{_0x3d26b2(ut[_0x3e1e('0x50')](_0x27c3d2[_0x3e1e('0x50')]));}});};function originate(_0x50ba57,_0x5e148e,_0x5581ee){return new BPromise(function(_0x20bc4d,_0x29ddc4){if(_0x5581ee){var _0x477e64=util[_0x3e1e('0x59')](_0x3e1e('0x5a'),path['parse'](_0x50ba57[_0x3e1e('0x5b')])[_0x3e1e('0x1c')],_0x50ba57[_0x3e1e('0x5b')]);gs[_0x3e1e('0x5c')](_0x477e64)[_0x3e1e('0x40')](function(){_0x50ba57['path']=util[_0x3e1e('0x59')](_0x3e1e('0x5d'),path[_0x3e1e('0x33')](_0x50ba57[_0x3e1e('0x5b')])[_0x3e1e('0x5e')],path[_0x3e1e('0x33')](_0x50ba57['path'])[_0x3e1e('0x1c')]);_0x5e148e[_0x3e1e('0x5f')]=_0x50ba57[_0x3e1e('0x5b')];ut[_0x3e1e('0x41')](_0x3e1e('0x60'),'');ami[_0x3e1e('0x61')](ut['variablesAction'](_0x50ba57,_0x5e148e))[_0x3e1e('0x40')](function(_0x468fd2){_0x20bc4d(_0x468fd2);})[_0x3e1e('0x38')](function(_0x109407){_0x29ddc4(_0x109407);});})[_0x3e1e('0x38')](function(_0x12e315){_0x29ddc4(_0x12e315);});}else{ami['Action'](ut[_0x3e1e('0x62')](_0x50ba57,_0x5e148e))['then'](function(_0x167544){_0x20bc4d(_0x167544);})[_0x3e1e('0x38')](function(_0x5c7565){_0x29ddc4(_0x5c7565);});}});}Fax[_0x3e1e('0x1f')][_0x3e1e('0x63')]=function(_0x98def8,_0x43f2b4){var _0x49b219=this;return new BPromise(function(_0x381b57,_0x4a7dcc){var _0x2d6bb0=uuid['v4']();var _0x7f1301=ut[_0x3e1e('0x64')](_0x98def8,_0x43f2b4);_0x49b219[_0x3e1e('0xf')][_0x2d6bb0]=new Action(_0x2d6bb0,_0x43f2b4,_0x98def8);var _0x2ef476=_0x49b219[_0x3e1e('0xf')][_0x2d6bb0];if(path['parse'](_0x98def8[_0x3e1e('0x5b')])[_0x3e1e('0x65')]===_0x3e1e('0x35')){originate(_0x2ef476,_0x7f1301,!![])[_0x3e1e('0x40')](function(_0x4b4fd4){_0x381b57(_0x4b4fd4);})[_0x3e1e('0x38')](function(_0x11eb0a){_0x4a7dcc(_0x11eb0a);});}else{originate(_0x2ef476,_0x7f1301,![])[_0x3e1e('0x40')](function(_0x405671){_0x381b57(_0x405671);})['catch'](function(_0x2211c6){_0x4a7dcc(_0x2211c6);});}});};Fax[_0x3e1e('0x1f')][_0x3e1e('0x66')]=function(_0x2161a4){return!_[_0x3e1e('0x67')](_0x2161a4)&&!_[_0x3e1e('0x67')](_0x2161a4['name'])&&!_['isNil'](_0x2161a4['active'])&&_0x2161a4[_0x3e1e('0x68')]&&!_['isNil'](this[_0x3e1e('0x69')][util['format'](_0x3e1e('0x6a'),_0x2161a4[_0x3e1e('0x1c')])])&&!_[_0x3e1e('0x67')](this[_0x3e1e('0x69')][util['format'](_0x3e1e('0x6a'),_0x2161a4['name'])][_0x3e1e('0x28')])&&(this['trunks'][util[_0x3e1e('0x59')](_0x3e1e('0x6a'),_0x2161a4['name'])][_0x3e1e('0x28')]===_0x3e1e('0x6b')||this[_0x3e1e('0x69')][util['format']('SIP/%s',_0x2161a4[_0x3e1e('0x1c')])][_0x3e1e('0x28')]===_0x3e1e('0x6c'));};Fax['prototype'][_0x3e1e('0x55')]=function(_0x51f83f,_0x57c99b){if(!this['isTrunkReachable'](_0x51f83f)){ut[_0x3e1e('0x41')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x3e1e('0x67')](_0x51f83f)?'':_0x51f83f[_0x3e1e('0x1c')]+_0x3e1e('0x6d'));return{'isValid':![],'message':_0x3e1e('0x6e')};}if(_[_0x3e1e('0x67')](_0x57c99b[_0x3e1e('0x5')])){ut[_0x3e1e('0x41')](_0x3e1e('0x6f'),JSON[_0x3e1e('0x37')](_0x57c99b));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x57c99b[_0x3e1e('0x5b')])){ut[_0x3e1e('0x41')](_0x3e1e('0x70'),JSON[_0x3e1e('0x37')](_0x57c99b));return{'isValid':![],'message':_0x3e1e('0x71')};}return{'isValid':!![],'message':_0x3e1e('0x72')};};module[_0x3e1e('0x73')]=Fax; \ No newline at end of file +var _0x6b20=['syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','variable','value','prototype','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','then','catch','error','\x20receiveFax\x20','stringify','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','syncNewchannel','bind'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x6b20,0xd1));var _0x06b2=function(_0xa3ac6f,_0x10ccb0){_0xa3ac6f=_0xa3ac6f-0x0;var _0x59b6e6=_0x6b20[_0xa3ac6f];return _0x59b6e6;};'use strict';var util=require(_0x06b2('0x0'));var _=require(_0x06b2('0x1'));var BPromise=require('bluebird');var uuid=require(_0x06b2('0x2'));var moment=require('moment');var path=require(_0x06b2('0x3'));var tiff2pdf=require(_0x06b2('0x4'));var gs=require(_0x06b2('0x5'));var logger=require('../../../config/logger')(_0x06b2('0x6'));var ami=require(_0x06b2('0x7'));var rpcDb=require(_0x06b2('0x8'));var Channel=require(_0x06b2('0x9'));var ut=require(_0x06b2('0xa'));var Action=require(_0x06b2('0xb'));var faxAccount=require(_0x06b2('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x06b2('0xd'));function Fax(_0x1828e4){this[_0x06b2('0xe')]={};this['faxAccounts']=_0x1828e4[_0x06b2('0xf')];this['trunks']=_0x1828e4[_0x06b2('0x10')];this['actions']={};ami['on']('newchannel',this[_0x06b2('0x11')][_0x06b2('0x12')](this));ami['on']('varset',this[_0x06b2('0x13')][_0x06b2('0x12')](this));ami['on'](_0x06b2('0x14'),this[_0x06b2('0x15')][_0x06b2('0x12')](this));ami['on'](_0x06b2('0x16'),this[_0x06b2('0x17')][_0x06b2('0x12')](this));ami['on'](_0x06b2('0x18'),this[_0x06b2('0x19')][_0x06b2('0x12')](this));ami['on'](_0x06b2('0x1a'),this[_0x06b2('0x1b')]['bind'](this));ami['on'](_0x06b2('0x1c'),this[_0x06b2('0x1d')][_0x06b2('0x12')](this));ami['on'](_0x06b2('0x1e'),this[_0x06b2('0x1f')][_0x06b2('0x12')](this));}Fax['prototype'][_0x06b2('0x11')]=function(_0x3f2a53){if(_0x3f2a53['context']===_0x06b2('0x20')){for(var _0x594b48 in this['faxAccounts']){if(this[_0x06b2('0xf')][_0x06b2('0x21')](_0x594b48)){if(_0x3f2a53[_0x06b2('0x22')]===this[_0x06b2('0xf')][_0x594b48]['localstationid']){this[_0x06b2('0xe')][_0x3f2a53[_0x06b2('0x23')]]={};this[_0x06b2('0xe')][_0x3f2a53[_0x06b2('0x23')]][_0x06b2('0x24')]=_0x3f2a53[_0x06b2('0x24')];this[_0x06b2('0xe')][_0x3f2a53['uniqueid']]['id']=this[_0x06b2('0xf')][_0x594b48]['id'];this[_0x06b2('0xe')][_0x3f2a53[_0x06b2('0x23')]][_0x06b2('0x25')]=this['faxAccounts'][_0x594b48]['name'];logger[_0x06b2('0x26')](_0x3f2a53[_0x06b2('0x23')],'\x20syncNewchannel\x20');}}}}if(this[_0x06b2('0x27')][_0x3f2a53['uniqueid']]){this[_0x06b2('0xe')][_0x3f2a53[_0x06b2('0x23')]]={};this[_0x06b2('0xe')][_0x3f2a53['uniqueid']][_0x06b2('0x24')]=_0x3f2a53[_0x06b2('0x24')];logger[_0x06b2('0x26')](_0x3f2a53[_0x06b2('0x23')],_0x06b2('0x28'));}};Fax['prototype'][_0x06b2('0x13')]=function(_0x34370b){if(this[_0x06b2('0xe')][_0x34370b[_0x06b2('0x23')]]){for(var _0x1976ac in _0x34370b[_0x06b2('0x29')]){if(_0x34370b['variable'][_0x06b2('0x21')](_0x1976ac)){this[_0x06b2('0xe')][_0x34370b[_0x06b2('0x23')]][_0x1976ac]=_0x34370b[_0x06b2('0x2a')];}}}};Fax[_0x06b2('0x2b')][_0x06b2('0x15')]=function(_0x3668bb){if(this['channels'][_0x3668bb[_0x06b2('0x23')]]){this[_0x06b2('0xe')][_0x3668bb[_0x06b2('0x23')]][_0x06b2('0x2c')]=_0x3668bb[_0x06b2('0x2c')];this[_0x06b2('0xe')][_0x3668bb[_0x06b2('0x23')]][_0x06b2('0x2d')]=_0x3668bb['channelstatedesc'];}};Fax[_0x06b2('0x2b')][_0x06b2('0x17')]=function(_0x259e3d){if(this[_0x06b2('0xe')][_0x259e3d[_0x06b2('0x23')]]){for(var _0x422393 in _0x259e3d[_0x06b2('0x29')]){if(_0x259e3d['variable']['hasOwnProperty'](_0x422393)){this[_0x06b2('0xe')][_0x259e3d[_0x06b2('0x23')]][_0x422393]=_0x259e3d[_0x06b2('0x2a')];}}}};Fax['prototype'][_0x06b2('0x19')]=function(_0x25ec1a){if(this[_0x06b2('0xe')][_0x25ec1a[_0x06b2('0x23')]]){this[_0x06b2('0xe')][_0x25ec1a[_0x06b2('0x23')]]['operation']=_0x25ec1a[_0x06b2('0x2e')];this[_0x06b2('0xe')][_0x25ec1a[_0x06b2('0x23')]]['status']=_0x25ec1a[_0x06b2('0x2f')];this[_0x06b2('0xe')][_0x25ec1a['uniqueid']][_0x06b2('0x30')]=_0x25ec1a[_0x06b2('0x30')];this[_0x06b2('0xe')][_0x25ec1a[_0x06b2('0x23')]][_0x06b2('0x31')]=_0x25ec1a[_0x06b2('0x31')];logger[_0x06b2('0x26')](_0x25ec1a[_0x06b2('0x23')],_0x06b2('0x32'));}};Fax[_0x06b2('0x2b')][_0x06b2('0x1b')]=function(_0x1cc7b6){var _0x5ec05d=this;if(this[_0x06b2('0xe')][_0x1cc7b6['uniqueid']]){var _0x4a4146=this[_0x06b2('0xe')][_0x1cc7b6['uniqueid']]['id'];this[_0x06b2('0xe')][_0x1cc7b6['uniqueid']][_0x06b2('0x33')]=_0x1cc7b6[_0x06b2('0x33')];this[_0x06b2('0xe')][_0x1cc7b6[_0x06b2('0x23')]][_0x06b2('0x34')]=_0x1cc7b6['pagestransferred'];this[_0x06b2('0xe')][_0x1cc7b6[_0x06b2('0x23')]][_0x06b2('0x30')]=_0x1cc7b6[_0x06b2('0x30')];this[_0x06b2('0xe')][_0x1cc7b6[_0x06b2('0x23')]]['resolution']=_0x1cc7b6[_0x06b2('0x35')];this[_0x06b2('0xe')][_0x1cc7b6['uniqueid']]['transferrate']=_0x1cc7b6[_0x06b2('0x36')];this[_0x06b2('0xe')][_0x1cc7b6[_0x06b2('0x23')]][_0x06b2('0x31')]=_0x1cc7b6[_0x06b2('0x31')];this[_0x06b2('0xe')][_0x1cc7b6[_0x06b2('0x23')]][_0x06b2('0x37')]=_0x1cc7b6[_0x06b2('0x37')];if(this[_0x06b2('0xe')][_0x1cc7b6[_0x06b2('0x23')]][_0x06b2('0x34')]>0x0){tiff2pdf(_0x1cc7b6[_0x06b2('0x31')],_0x06b2('0x38'),function(_0x262c93){logger[_0x06b2('0x26')](_0x1cc7b6[_0x06b2('0x23')],_0x06b2('0x39'),_0x262c93[_0x06b2('0x3a')]);attachment['create']({'name':path[_0x06b2('0x3b')](_0x1cc7b6[_0x06b2('0x31')])[_0x06b2('0x25')],'basename':path[_0x06b2('0x3b')](_0x1cc7b6['filename'])[_0x06b2('0x25')]+_0x06b2('0x3c'),'type':'application/pdf'})[_0x06b2('0x3d')](function(_0x2e3a85){faxAccount['notify'](_0x4a4146,{'from':_0x1cc7b6[_0x06b2('0x37')],'mapKey':_0x06b2('0x6'),'body':path['parse'](_0x1cc7b6['filename'])['name']+_0x06b2('0x3c'),'AttachmentId':_0x2e3a85['id']})[_0x06b2('0x3e')](function(_0x4448bb){logger[_0x06b2('0x3f')](_0x1cc7b6[_0x06b2('0x23')],'\x20notify\x20',JSON['stringify'](_0x4448bb));});})[_0x06b2('0x3e')](function(_0x3d89c2){logger[_0x06b2('0x3f')](_0x1cc7b6[_0x06b2('0x23')],_0x06b2('0x40'),JSON[_0x06b2('0x41')](_0x3d89c2));});});}logger['info'](_0x1cc7b6[_0x06b2('0x23')],_0x06b2('0x40'));}};Fax[_0x06b2('0x2b')][_0x06b2('0x1f')]=function(_0x146c5c){if(this[_0x06b2('0x27')][_0x146c5c['uniqueid']]){_[_0x06b2('0x42')](this[_0x06b2('0xe')][_0x146c5c[_0x06b2('0x23')]],_[_0x06b2('0x43')](_0x146c5c,['response',_0x06b2('0x44')]));}};function updateStatus(_0x17d138){if(_0x17d138[_0x06b2('0x45')]){faxMessage[_0x06b2('0x46')](_0x17d138['AttachmentId'],{'failMessage':_0x06b2('0x47')})[_0x06b2('0x3d')](function(_0x36329e){ut[_0x06b2('0x48')](_0x06b2('0x49'),_0x36329e);})[_0x06b2('0x3e')](function(_0x3ea829){ut[_0x06b2('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x3ea829);});}else{ut[_0x06b2('0x48')](_0x06b2('0x4a'));}}Fax[_0x06b2('0x2b')][_0x06b2('0x4b')]=function(_0x2857d5,_0x2f75a0,_0x4fba4c){var _0x5db1cc=this;var _0x1bf9e7={};if(_0x2f75a0){_0x1bf9e7={'read':_0x2f75a0};}else{_0x1bf9e7={'failMessage':_0x4fba4c};}if(this['actions'][_0x2857d5]['AttachmentId']){faxMessage[_0x06b2('0x46')](this['actions'][_0x2857d5][_0x06b2('0x45')],_0x1bf9e7)[_0x06b2('0x3d')](function(_0x18a927){ut[_0x06b2('0x48')](_0x06b2('0x4c'),_0x18a927);})[_0x06b2('0x3e')](function(_0x4664c2){ut[_0x06b2('0x48')](_0x06b2('0x4d'),_0x4664c2);})[_0x06b2('0x4e')](function(){delete _0x5db1cc['channels'][_0x2857d5];delete _0x5db1cc['actions'][_0x2857d5];});}else{ut[_0x06b2('0x48')](_0x06b2('0x4f'));delete this['channels'][_0x2857d5];delete this[_0x06b2('0x27')][_0x2857d5];}};Fax[_0x06b2('0x2b')][_0x06b2('0x1d')]=function(_0x36f2a8){var _0x5d725f=this;if(this['channels'][_0x36f2a8['uniqueid']]){if(this[_0x06b2('0x27')][_0x36f2a8['uniqueid']]){this['channels'][_0x36f2a8[_0x06b2('0x23')]]['id']=this[_0x06b2('0x27')][_0x36f2a8[_0x06b2('0x23')]]['id'];this[_0x06b2('0xe')][_0x36f2a8[_0x06b2('0x23')]][_0x06b2('0x25')]=this['actions'][_0x36f2a8[_0x06b2('0x23')]][_0x06b2('0x25')];}logger['info'](_0x36f2a8[_0x06b2('0x23')],this[_0x06b2('0x27')][_0x36f2a8[_0x06b2('0x23')]]?_0x06b2('0x50'):_0x06b2('0x51'),JSON[_0x06b2('0x41')](this[_0x06b2('0xe')][_0x36f2a8[_0x06b2('0x23')]]));if(this[_0x06b2('0x27')][_0x36f2a8[_0x06b2('0x23')]]){if(this[_0x06b2('0xe')][_0x36f2a8[_0x06b2('0x23')]]['faxpages']>0x0&&this[_0x06b2('0xe')][_0x36f2a8[_0x06b2('0x23')]]['faxstatus']===_0x06b2('0x52')){this[_0x06b2('0x4b')](_0x36f2a8[_0x06b2('0x23')],!![]);}else{this[_0x06b2('0x4b')](_0x36f2a8['uniqueid'],![],this[_0x06b2('0xe')][_0x36f2a8[_0x06b2('0x23')]][_0x06b2('0x53')]?'SENDING\x20FAILED:\x20'+this[_0x06b2('0xe')][_0x36f2a8[_0x06b2('0x23')]][_0x06b2('0x53')]:_0x06b2('0x54'));}}}};Fax[_0x06b2('0x2b')][_0x06b2('0x55')]=function(_0x1aae55){var _0x10faea=this;return new BPromise(function(_0x2f0ca0,_0x5aae69){_0x10faea['execOriginate'](_0x1aae55,_0x10faea['faxAccounts'][_0x1aae55['FaxAccountId']])[_0x06b2('0x3d')](function(_0x4a1bf5){ut[_0x06b2('0x48')](_0x06b2('0x56'),_0x4a1bf5);_0x2f0ca0(ut[_0x06b2('0x3a')](_0x06b2('0x57')));})[_0x06b2('0x3e')](function(_0x378547){ut['logger']('[Fax][execOriginate][failure]',_0x378547);updateStatus(_0x1aae55);_0x5aae69(ut[_0x06b2('0x3a')](_0x06b2('0x58')));});});};Fax['prototype'][_0x06b2('0x59')]=function(_0xd826e9){var _0x4ea78f=this;return new BPromise(function(_0x353dd6,_0x1ac2f0){var _0x10f3e6=_0x4ea78f['checkTrunk'](_0x4ea78f[_0x06b2('0xf')][_0xd826e9['FaxAccountId']][_0x06b2('0x5a')],_0xd826e9);if(_0x10f3e6[_0x06b2('0x5b')]){_0x353dd6(ut[_0x06b2('0x3a')]('Trunk\x20Reachable'));}else{_0x1ac2f0(ut[_0x06b2('0x3a')](_0x10f3e6[_0x06b2('0x3a')]));}});};function originate(_0x461c4d,_0x4cc763,_0xc1010){return new BPromise(function(_0x4900d2,_0x15b345){if(_0xc1010){var _0x1ea5ed=util[_0x06b2('0x5c')](_0x06b2('0x5d'),path[_0x06b2('0x3b')](_0x461c4d[_0x06b2('0x3')])['name'],_0x461c4d[_0x06b2('0x3')]);gs[_0x06b2('0x5e')](_0x1ea5ed)[_0x06b2('0x3d')](function(){_0x461c4d[_0x06b2('0x3')]=util['format'](_0x06b2('0x5f'),path[_0x06b2('0x3b')](_0x461c4d[_0x06b2('0x3')])['dir'],path['parse'](_0x461c4d[_0x06b2('0x3')])['name']);_0x4cc763[_0x06b2('0x60')]=_0x461c4d['path'];ut['logger'](_0x06b2('0x61'),'');ami[_0x06b2('0x62')](ut['variablesAction'](_0x461c4d,_0x4cc763))[_0x06b2('0x3d')](function(_0x15f107){_0x4900d2(_0x15f107);})[_0x06b2('0x3e')](function(_0x305c36){_0x15b345(_0x305c36);});})[_0x06b2('0x3e')](function(_0x3542b4){_0x15b345(_0x3542b4);});}else{ami[_0x06b2('0x62')](ut[_0x06b2('0x63')](_0x461c4d,_0x4cc763))[_0x06b2('0x3d')](function(_0x333a76){_0x4900d2(_0x333a76);})[_0x06b2('0x3e')](function(_0x5028d4){_0x15b345(_0x5028d4);});}});}Fax[_0x06b2('0x2b')]['execOriginate']=function(_0x4a606b,_0x3257b9){var _0x32e2c4=this;return new BPromise(function(_0x4ff30d,_0x3c73fc){var _0x326b90=uuid['v4']();var _0x445a67=ut['addVariables'](_0x4a606b,_0x3257b9);_0x32e2c4[_0x06b2('0x27')][_0x326b90]=new Action(_0x326b90,_0x3257b9,_0x4a606b);var _0x3ff04f=_0x32e2c4['actions'][_0x326b90];if(path['parse'](_0x4a606b['path'])['ext']===_0x06b2('0x3c')){originate(_0x3ff04f,_0x445a67,!![])['then'](function(_0x1e4412){_0x4ff30d(_0x1e4412);})[_0x06b2('0x3e')](function(_0x1b1e6c){_0x3c73fc(_0x1b1e6c);});}else{originate(_0x3ff04f,_0x445a67,![])[_0x06b2('0x3d')](function(_0x18b76f){_0x4ff30d(_0x18b76f);})[_0x06b2('0x3e')](function(_0x406101){_0x3c73fc(_0x406101);});}});};Fax[_0x06b2('0x2b')][_0x06b2('0x64')]=function(_0x27c73d){return!_[_0x06b2('0x65')](_0x27c73d)&&!_[_0x06b2('0x65')](_0x27c73d[_0x06b2('0x25')])&&!_['isNil'](_0x27c73d['active'])&&_0x27c73d[_0x06b2('0x66')]&&!_[_0x06b2('0x65')](this[_0x06b2('0x10')][util[_0x06b2('0x5c')](_0x06b2('0x67'),_0x27c73d[_0x06b2('0x25')])])&&!_['isNil'](this['trunks'][util[_0x06b2('0x5c')](_0x06b2('0x67'),_0x27c73d[_0x06b2('0x25')])][_0x06b2('0x2f')])&&(this[_0x06b2('0x10')][util['format'](_0x06b2('0x67'),_0x27c73d['name'])]['status']===_0x06b2('0x68')||this[_0x06b2('0x10')][util['format']('SIP/%s',_0x27c73d[_0x06b2('0x25')])][_0x06b2('0x2f')]==='unmonitored');};Fax['prototype']['checkTrunk']=function(_0x512415,_0x3913cb){if(!this[_0x06b2('0x64')](_0x512415)){ut[_0x06b2('0x48')](_0x06b2('0x69'),_[_0x06b2('0x65')](_0x512415)?'':_0x512415[_0x06b2('0x25')]+_0x06b2('0x6a'));return{'isValid':![],'message':_0x06b2('0x6b')};}if(_[_0x06b2('0x65')](_0x3913cb[_0x06b2('0x6')])){ut[_0x06b2('0x48')](_0x06b2('0x6c'),JSON[_0x06b2('0x41')](_0x3913cb));return{'isValid':![],'message':_0x06b2('0x6d')};}if(_[_0x06b2('0x65')](_0x3913cb[_0x06b2('0x3')])){ut[_0x06b2('0x48')](_0x06b2('0x6e'),JSON[_0x06b2('0x41')](_0x3913cb));return{'isValid':![],'message':_0x06b2('0x6f')};}return{'isValid':!![],'message':_0x06b2('0x70')};};module[_0x06b2('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index d20be26..50c4c23 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 _0x0851=['resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x52af08,_0x1431a0){var _0x161482=function(_0x57053d){while(--_0x57053d){_0x52af08['push'](_0x52af08['shift']());}};_0x161482(++_0x1431a0);}(_0x0851,0x13c));var _0x1085=function(_0x40cbbd,_0x10185b){_0x40cbbd=_0x40cbbd-0x0;var _0x2ff260=_0x0851[_0x40cbbd];return _0x2ff260;};'use strict';var util=require(_0x1085('0x0'));var BPromise=require(_0x1085('0x1'));var logger=require(_0x1085('0x2'))(_0x1085('0x3'));var _=require(_0x1085('0x4'));var faxAccount=require(_0x1085('0x5'));function loggerCatch(_0x2b3353){return function(_0x102390){logger[_0x1085('0x6')](_0x2b3353,util[_0x1085('0x7')](_0x102390,{'showHidden':![],'depth':null}));};}exports[_0x1085('0x8')]=function(_0xf6e5a7,_0x5aae21){return BPromise[_0x1085('0x9')]()[_0x1085('0xa')](faxAccount[_0x1085('0x8')](_0xf6e5a7,_0x5aae21))[_0x1085('0xb')](loggerCatch(_0x1085('0xc')));}; \ No newline at end of file +var _0x920c=['then','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x24181d,_0x1f4229){var _0x336d16=function(_0x3583c5){while(--_0x3583c5){_0x24181d['push'](_0x24181d['shift']());}};_0x336d16(++_0x1f4229);}(_0x920c,0x176));var _0xc920=function(_0x167b2e,_0x4b900a){_0x167b2e=_0x167b2e-0x0;var _0x1e7d43=_0x920c[_0x167b2e];return _0x1e7d43;};'use strict';var util=require(_0xc920('0x0'));var BPromise=require(_0xc920('0x1'));var logger=require(_0xc920('0x2'))(_0xc920('0x3'));var _=require(_0xc920('0x4'));var faxAccount=require(_0xc920('0x5'));function loggerCatch(_0x52fdc0){return function(_0x48db10){logger['error'](_0x52fdc0,util['inspect'](_0x48db10,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x197156,_0x41ea1b){return BPromise['resolve']()[_0xc920('0x6')](faxAccount[_0xc920('0x7')](_0x197156,_0x41ea1b))[_0xc920('0x8')](loggerCatch(_0xc920('0x9')));}; \ 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 68b5eeb..ba2b9af 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 _0x7829=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x5957a5,_0x64678e){var _0x559186=function(_0x267981){while(--_0x267981){_0x5957a5['push'](_0x5957a5['shift']());}};_0x559186(++_0x64678e);}(_0x7829,0x9b));var _0x9782=function(_0x5b174a,_0x1934d1){_0x5b174a=_0x5b174a-0x0;var _0x42bd48=_0x7829[_0x5b174a];return _0x42bd48;};'use strict';var util=require(_0x9782('0x0'));var logger=require(_0x9782('0x1'))(_0x9782('0x2'));var BPromise=require(_0x9782('0x3'));var exec=require(_0x9782('0x4'))['exec'];exports[_0x9782('0x5')]=function(_0xcb4f5){return new BPromise(function(_0x2bd188,_0x5fe407){exec(_0xcb4f5,function(_0x2c4b83,_0x3fd6e1,_0x1c3972){logger[_0x9782('0x6')](_0x9782('0x7'),_0x3fd6e1);if(_0x2c4b83){logger[_0x9782('0x6')]('Exec\x20gs',_0x9782('0x8'),util[_0x9782('0x9')](_0x2c4b83,{'showHidden':![],'depth':null}),_0x3fd6e1,_0x1c3972);_0x5fe407(_0x2c4b83);}_0x2bd188(_0x3fd6e1);});});}; \ No newline at end of file +var _0x800e=['bluebird','exec','execute','info','Exec\x20gs','inspect','util'];(function(_0x54c058,_0x59c4f9){var _0x17db91=function(_0xef19ec){while(--_0xef19ec){_0x54c058['push'](_0x54c058['shift']());}};_0x17db91(++_0x59c4f9);}(_0x800e,0x125));var _0xe800=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x800e[_0x17b6e3];return _0x3906f3;};'use strict';var util=require(_0xe800('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xe800('0x1'));var exec=require('child_process')[_0xe800('0x2')];exports[_0xe800('0x3')]=function(_0x248805){return new BPromise(function(_0x1ad1b9,_0x214f44){exec(_0x248805,function(_0x4a8798,_0x58e15e,_0x4a558a){logger[_0xe800('0x4')](_0xe800('0x5'),_0x58e15e);if(_0x4a8798){logger[_0xe800('0x4')](_0xe800('0x5'),'\x20Error\x20:',util[_0xe800('0x6')](_0x4a8798,{'showHidden':![],'depth':null}),_0x58e15e,_0x4a558a);_0x214f44(_0x4a8798);}_0x1ad1b9(_0x58e15e);});});}; \ 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 69e50c9..e7498b8 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 _0x220a=['gateway','faxdetect','t38timeout','localstationid','uniqueid','originate','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','addVariables','minrate','maxrate','format','\x22%s\x22','modem'];(function(_0x5f205d,_0x357ac2){var _0xc4e8a7=function(_0x54f8b5){while(--_0x54f8b5){_0x5f205d['push'](_0x5f205d['shift']());}};_0xc4e8a7(++_0x357ac2);}(_0x220a,0x14b));var _0xa220=function(_0x3c697d,_0x4df2fb){_0x3c697d=_0x3c697d-0x0;var _0x2a6630=_0x220a[_0x3c697d];return _0x2a6630;};'use strict';var util=require(_0xa220('0x0'));var _=require(_0xa220('0x1'));var moment=require(_0xa220('0x2'));var logger=require(_0xa220('0x3'))(_0xa220('0x4'));exports[_0xa220('0x5')]=function(_0x318574){return{'message':_0x318574};};exports['logger']=function(_0x2674ea,_0x4ddb10){logger[_0xa220('0x6')](_0x2674ea,util[_0xa220('0x7')](_0x4ddb10,{'showHidden':![],'depth':null}));};exports[_0xa220('0x8')]=function(_0x6d758a,_0xbd3097){var _0x5cc96c={'XMF-ECM':_0xbd3097['ecm'],'XMF-HEADERINFO':_0xbd3097['headerinfo'],'XMF-MINRATE':_0xbd3097[_0xa220('0x9')],'XMF-MAXRATE':_0xbd3097[_0xa220('0xa')],'XMF-MODEM':util[_0xa220('0xb')](_0xa220('0xc'),_0xbd3097[_0xa220('0xd')]),'XMF-GATEWAY':_0xbd3097[_0xa220('0xe')],'XMF-FAXDETECT':_0xbd3097[_0xa220('0xf')],'XMF-T38TIMEOUT':_0xbd3097[_0xa220('0x10')],'XMF-LOCALSTATIONID':_0xbd3097[_0xa220('0x11')],'XMF-PATH':_0x6d758a['path']};return _0x5cc96c;};exports['variablesAction']=function(_0x38e242,_0x1f11ea){return{'actionid':_0x38e242[_0xa220('0x12')],'action':_0xa220('0x13'),'channel':_0x38e242['channel'],'Exten':_0xa220('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0xa220('0xb')](_0xa220('0x15'),_0x38e242[_0xa220('0x16')]?_0x38e242[_0xa220('0x16')]:'',_0x38e242['localstationid']),'variable':_0x1f11ea,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x38e242[_0xa220('0x12')]};}; \ No newline at end of file +var _0x5f8c=['channel','from-sip','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','message','info','ecm','headerinfo','minrate','maxrate','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate'];(function(_0x3b3362,_0x202631){var _0x223f5b=function(_0x21a21d){while(--_0x21a21d){_0x3b3362['push'](_0x3b3362['shift']());}};_0x223f5b(++_0x202631);}(_0x5f8c,0x1de));var _0xc5f8=function(_0x57a464,_0xca6f3b){_0x57a464=_0x57a464-0x0;var _0x4514ef=_0x5f8c[_0x57a464];return _0x4514ef;};'use strict';var util=require('util');var _=require(_0xc5f8('0x0'));var moment=require(_0xc5f8('0x1'));var logger=require(_0xc5f8('0x2'))('fax');exports[_0xc5f8('0x3')]=function(_0x401f5e){return{'message':_0x401f5e};};exports['logger']=function(_0xd68ede,_0x2c3811){logger[_0xc5f8('0x4')](_0xd68ede,util['inspect'](_0x2c3811,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1316f1,_0x35fef0){var _0x1e3d03={'XMF-ECM':_0x35fef0[_0xc5f8('0x5')],'XMF-HEADERINFO':_0x35fef0[_0xc5f8('0x6')],'XMF-MINRATE':_0x35fef0[_0xc5f8('0x7')],'XMF-MAXRATE':_0x35fef0[_0xc5f8('0x8')],'XMF-MODEM':util['format']('\x22%s\x22',_0x35fef0['modem']),'XMF-GATEWAY':_0x35fef0[_0xc5f8('0x9')],'XMF-FAXDETECT':_0x35fef0[_0xc5f8('0xa')],'XMF-T38TIMEOUT':_0x35fef0[_0xc5f8('0xb')],'XMF-LOCALSTATIONID':_0x35fef0[_0xc5f8('0xc')],'XMF-PATH':_0x1316f1[_0xc5f8('0xd')]};return _0x1e3d03;};exports['variablesAction']=function(_0x114eb6,_0x3904b4){return{'actionid':_0x114eb6[_0xc5f8('0xe')],'action':_0xc5f8('0xf'),'channel':_0x114eb6[_0xc5f8('0x10')],'Exten':'xcally-motion-fax','Context':_0xc5f8('0x11'),'Priority':'1','callerid':util['format'](_0xc5f8('0x12'),_0x114eb6['headerinfo']?_0x114eb6[_0xc5f8('0x6')]:'',_0x114eb6[_0xc5f8('0xc')]),'variable':_0x3904b4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x114eb6[_0xc5f8('0xe')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6972994..ec17249 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 _0x63af=['initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTemplates','initTemplates','getZendeskAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','inspect','listen','sync','catch','error','bluebird','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents'];(function(_0x3a30c0,_0x4d5334){var _0x1af031=function(_0x15df1e){while(--_0x15df1e){_0x3a30c0['push'](_0x3a30c0['shift']());}};_0x1af031(++_0x4d5334);}(_0x63af,0x17e));var _0xf63a=function(_0x36c4f0,_0x10a54d){_0x36c4f0=_0x36c4f0-0x0;var _0x231cb4=_0x63af[_0x36c4f0];return _0x231cb4;};'use strict';var BPromise=require(_0xf63a('0x0'));var util=require('util');var moment=require(_0xf63a('0x1'));var server=require(_0xf63a('0x2'));var Realtime=require(_0xf63a('0x3'));var Report=require('./report');var Acw=require(_0xf63a('0x4'));var Trigger=require(_0xf63a('0x5'));var Dialer=require(_0xf63a('0x6'));var Preview=require(_0xf63a('0x7'));var Fax=require(_0xf63a('0x8'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xf63a('0x9'));var voiceCallReport=require(_0xf63a('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xf63a('0xb'));var template=require(_0xf63a('0xc'));var cmHopperHistory=require(_0xf63a('0xd'));var campaign=require(_0xf63a('0xe'));var voiceExtension=require(_0xf63a('0xf'));var faxAccount=require(_0xf63a('0x10'));var zendesk=require(_0xf63a('0x11'));var salesforce=require(_0xf63a('0x12'));var sugarcrm=require(_0xf63a('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xf63a('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xf63a('0x15'));var freshsales=require(_0xf63a('0x16'));var servicenow=require(_0xf63a('0x17'));var dynamics365=require(_0xf63a('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xf63a('0x19'))(_0xf63a('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xf63a('0x1b')](_0xf63a('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xf63a('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xf63a('0x1d')]()[_0xf63a('0x1e')](user[_0xf63a('0x1f')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x20')]())[_0xf63a('0x1e')](user[_0xf63a('0x21')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x22')]())['then'](trunk[_0xf63a('0x23')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x24')]())['then'](voiceQueue['getVoiceQueues']())[_0xf63a('0x1e')](realtime[_0xf63a('0x25')]())['then'](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0xf63a('0x1e')](template[_0xf63a('0x26')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x27')]())['then'](zendesk[_0xf63a('0x28')]())[_0xf63a('0x1e')](realtime['initZendeskAccounts']())[_0xf63a('0x1e')](salesforce['getSalesforceAccounts']())[_0xf63a('0x1e')](realtime[_0xf63a('0x29')]())[_0xf63a('0x1e')](sugarcrm['getSugarcrmAccounts']())['then'](realtime['initSugarcrmAccounts']())[_0xf63a('0x1e')](freshdesk[_0xf63a('0x2a')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x2b')]())[_0xf63a('0x1e')](desk[_0xf63a('0x2c')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x2d')]())['then'](zoho[_0xf63a('0x2e')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x2f')]())['then'](vtiger[_0xf63a('0x30')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x31')]())[_0xf63a('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0xf63a('0x32')]())[_0xf63a('0x1e')](servicenow['getServicenowAccounts']())[_0xf63a('0x1e')](realtime[_0xf63a('0x33')]())[_0xf63a('0x1e')](dynamics365[_0xf63a('0x34')]())[_0xf63a('0x1e')](realtime['initDynamics365Accounts']())[_0xf63a('0x1e')](campaign[_0xf63a('0x35')]())['then'](realtime[_0xf63a('0x36')]())['then'](voiceExtension[_0xf63a('0x37')]())['then'](realtime[_0xf63a('0x38')]())[_0xf63a('0x1e')](faxAccount['getFaxAccounts']())[_0xf63a('0x1e')](realtime['initFaxAccounts']())[_0xf63a('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0xf63a('0x1d')]()[_0xf63a('0x1e')](voiceQueueReport[_0xf63a('0x39')]())[_0xf63a('0x1e')](realtime['initVoiceQueueReports']())[_0xf63a('0x1e')](cmHopperHistory[_0xf63a('0x3a')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x3b')]())[_0xf63a('0x1e')](cmHopperHistory[_0xf63a('0x3c')]())['then'](realtime[_0xf63a('0x3d')]())['then'](voiceCallReport[_0xf63a('0x3e')]())[_0xf63a('0x1e')](realtime[_0xf63a('0x3f')]())['catch'](function(_0x2be89c){logger['error']('[index.js][initParams]',util[_0xf63a('0x40')](_0x2be89c,{'showHidden':![],'depth':null}));});}function main(){return server[_0xf63a('0x41')](realtime,preview,fax)[_0xf63a('0x1e')](function(_0x44d5a5){return initRealtime();})['then'](function(){return initParams();})[_0xf63a('0x1e')](function(){report[_0xf63a('0x42')]();setInterval(initRealtime,0x1388);})[_0xf63a('0x43')](function(_0x3461c4){logger[_0xf63a('0x44')]('[index.js][main]',util[_0xf63a('0x40')](_0x3461c4,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xbabf=['initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','error','[index.js][initParams]','[index.js][main]','inspect','bluebird','util','./server','./realtime','./report','./acw','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts'];(function(_0x579906,_0x1583aa){var _0x5f0b7c=function(_0xd56bfa){while(--_0xd56bfa){_0x579906['push'](_0x579906['shift']());}};_0x5f0b7c(++_0x1583aa);}(_0xbabf,0x177));var _0xfbab=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xbabf[_0x50aa2e];return _0x5e07f0;};'use strict';var BPromise=require(_0xfbab('0x0'));var util=require(_0xfbab('0x1'));var moment=require('moment');var server=require(_0xfbab('0x2'));var Realtime=require(_0xfbab('0x3'));var Report=require(_0xfbab('0x4'));var Acw=require(_0xfbab('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xfbab('0x6'));var Preview=require(_0xfbab('0x7'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0xfbab('0x8'));var voiceQueueReport=require(_0xfbab('0x9'));var voiceCallReport=require(_0xfbab('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xfbab('0xb'));var template=require(_0xfbab('0xc'));var cmHopperHistory=require(_0xfbab('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xfbab('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xfbab('0xf'));var desk=require(_0xfbab('0x10'));var zoho=require(_0xfbab('0x11'));var vtiger=require(_0xfbab('0x12'));var freshsales=require(_0xfbab('0x13'));var servicenow=require(_0xfbab('0x14'));var dynamics365=require(_0xfbab('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xfbab('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfbab('0x17')](_0xfbab('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xfbab('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xfbab('0x19')]()[_0xfbab('0x1a')](user[_0xfbab('0x1b')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x1c')]())[_0xfbab('0x1a')](user[_0xfbab('0x1d')]())['then'](realtime[_0xfbab('0x1e')]())['then'](trunk[_0xfbab('0x1f')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x20')]())[_0xfbab('0x1a')](voiceQueue[_0xfbab('0x21')]())['then'](realtime['initVoiceQueues']())[_0xfbab('0x1a')](trigger[_0xfbab('0x22')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x23')]())[_0xfbab('0x1a')](template[_0xfbab('0x24')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x25')]())[_0xfbab('0x1a')](zendesk[_0xfbab('0x26')]())['then'](realtime[_0xfbab('0x27')]())['then'](salesforce[_0xfbab('0x28')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x29')]())[_0xfbab('0x1a')](sugarcrm[_0xfbab('0x2a')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x2b')]())[_0xfbab('0x1a')](freshdesk[_0xfbab('0x2c')]())[_0xfbab('0x1a')](realtime['initFreshdeskAccounts']())[_0xfbab('0x1a')](desk[_0xfbab('0x2d')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x2e')]())[_0xfbab('0x1a')](zoho[_0xfbab('0x2f')]())[_0xfbab('0x1a')](realtime['initZohoAccounts']())[_0xfbab('0x1a')](vtiger['getVtigerAccounts']())[_0xfbab('0x1a')](realtime[_0xfbab('0x30')]())[_0xfbab('0x1a')](freshsales[_0xfbab('0x31')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x32')]())[_0xfbab('0x1a')](servicenow['getServicenowAccounts']())[_0xfbab('0x1a')](realtime[_0xfbab('0x33')]())[_0xfbab('0x1a')](dynamics365['getDynamics365Accounts']())[_0xfbab('0x1a')](realtime[_0xfbab('0x34')]())['then'](campaign[_0xfbab('0x35')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x36')]())[_0xfbab('0x1a')](voiceExtension[_0xfbab('0x37')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x38')]())['then'](faxAccount['getFaxAccounts']())[_0xfbab('0x1a')](realtime[_0xfbab('0x39')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xfbab('0x19')]()[_0xfbab('0x1a')](voiceQueueReport[_0xfbab('0x3a')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x3b')]())[_0xfbab('0x1a')](cmHopperHistory[_0xfbab('0x3c')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x3d')]())[_0xfbab('0x1a')](cmHopperHistory[_0xfbab('0x3e')]())[_0xfbab('0x1a')](realtime[_0xfbab('0x3f')]())[_0xfbab('0x1a')](voiceCallReport['getVoiceCallReports']())['then'](realtime['initVoiceCallReports']())[_0xfbab('0x40')](function(_0x47c87a){logger[_0xfbab('0x41')](_0xfbab('0x42'),util['inspect'](_0x47c87a,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xfbab('0x1a')](function(_0x46dcfe){return initRealtime();})['then'](function(){return initParams();})[_0xfbab('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x360c55){logger[_0xfbab('0x41')](_0xfbab('0x43'),util[_0xfbab('0x44')](_0x360c55,{'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 1a79503..8c6adc0 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0xd71ff1,_0x4ae822){var _0x4ee7aa=function(_0x5a29e3){while(--_0x5a29e3){_0xd71ff1['push'](_0xd71ff1['shift']());}};_0x4ee7aa(++_0x4ae822);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x48d732,_0x202a72){var _0x221c79=function(_0x423c1e){while(--_0x423c1e){_0x48d732['push'](_0x48d732['shift']());}};_0x221c79(++_0x202a72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index f2aacfa..3fdc81d 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 _0x3b09=['dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x3b09,0x87));var _0x93b0=function(_0x33a73b,_0x2d367f){_0x33a73b=_0x33a73b-0x0;var _0x30527e=_0x3b09[_0x33a73b];return _0x30527e;};'use strict';function Campaign(_0x419995){this['id']=_0x419995['id']||0x0;this[_0x93b0('0x0')]=_0x419995['name']||'';this[_0x93b0('0x1')]=_0x419995[_0x93b0('0x1')]||_0x93b0('0x2');this[_0x93b0('0x3')]=0x0;this['temp']=0x0;this[_0x93b0('0x4')]=0x0;this[_0x93b0('0x5')]=0x0;this['message']='';this[_0x93b0('0x6')]=!![];this[_0x93b0('0x7')]=_0x419995[_0x93b0('0x7')];this['limitCalls']=_0x419995[_0x93b0('0x8')];this[_0x93b0('0x9')]=_0x419995[_0x93b0('0x9')]||null;this[_0x93b0('0xa')]=_0x419995['dialGlobalInterval']?_0x419995[_0x93b0('0xa')]:null;this[_0x93b0('0xb')]=_0x419995[_0x93b0('0xb')];this[_0x93b0('0xc')]=_0x419995[_0x93b0('0xc')];this[_0x93b0('0xd')]=_0x419995[_0x93b0('0xd')]||0x1e;this[_0x93b0('0xe')]=_0x419995[_0x93b0('0xe')];this[_0x93b0('0xf')]=_0x419995[_0x93b0('0xf')];this[_0x93b0('0x10')]=_0x419995['dialBusyMaxRetry'];this[_0x93b0('0x11')]=_0x419995[_0x93b0('0x11')];this[_0x93b0('0x12')]=_0x419995['dialNoAnswerMaxRetry'];this[_0x93b0('0x13')]=_0x419995[_0x93b0('0x13')];this[_0x93b0('0x14')]=_0x419995[_0x93b0('0x14')];this[_0x93b0('0x15')]=_0x419995[_0x93b0('0x15')]||0x3;this[_0x93b0('0x16')]=_0x419995[_0x93b0('0x16')]||0x96;this['dialDropMaxRetry']=_0x419995[_0x93b0('0x17')]||0x3;this['dialDropRetryFrequency']=_0x419995[_0x93b0('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x419995['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x419995[_0x93b0('0x19')]||0x96;this['dialMachineMaxRetry']=_0x419995[_0x93b0('0x1a')]||0x3;this[_0x93b0('0x1b')]=_0x419995['dialMachineRetryFrequency']||0x96;this[_0x93b0('0x1c')]=_0x419995[_0x93b0('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x419995[_0x93b0('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x419995['dialOrderByScheduledAt']||_0x93b0('0x1e');this['dialPrefix']=_0x419995['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x419995['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x419995[_0x93b0('0x1f')]||undefined;this[_0x93b0('0x20')]=_0x419995['TrunkBackup']?_0x419995[_0x93b0('0x20')]:undefined;this['Trunk']=_0x419995[_0x93b0('0x21')]?_0x419995[_0x93b0('0x21')]:undefined;this[_0x93b0('0x22')]=_0x419995[_0x93b0('0x22')]?_0x419995[_0x93b0('0x22')]:undefined;this[_0x93b0('0x23')]=_0x419995[_0x93b0('0x23')]?_0x419995[_0x93b0('0x23')]:undefined;this[_0x93b0('0x24')]=_0x419995['SquareProject']?_0x419995[_0x93b0('0x23')][_0x93b0('0x0')]:undefined;this[_0x93b0('0x25')]=_0x419995[_0x93b0('0x25')]||![];this[_0x93b0('0x26')]=_0x419995[_0x93b0('0x26')];this[_0x93b0('0x27')]=_0x419995['dialAMDGreeting'];this[_0x93b0('0x28')]=_0x419995[_0x93b0('0x28')];this['dialAMDTotalAnalysisTime']=_0x419995[_0x93b0('0x29')];this[_0x93b0('0x2a')]=_0x419995['dialAMDMinWordLength'];this[_0x93b0('0x2b')]=_0x419995[_0x93b0('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x419995[_0x93b0('0x2c')];this['dialAMDSilenceThreshold']=_0x419995[_0x93b0('0x2d')];this[_0x93b0('0x2e')]=_0x419995[_0x93b0('0x2e')];}module[_0x93b0('0x2f')]=Campaign; \ No newline at end of file +var _0x3384=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive'];(function(_0x2b5538,_0x28cf8d){var _0x1ab82e=function(_0x4eada6){while(--_0x4eada6){_0x2b5538['push'](_0x2b5538['shift']());}};_0x1ab82e(++_0x28cf8d);}(_0x3384,0xa9));var _0x4338=function(_0x912882,_0x4b5956){_0x912882=_0x912882-0x0;var _0xadb160=_0x3384[_0x912882];return _0xadb160;};'use strict';function Campaign(_0x1e7b7e){this['id']=_0x1e7b7e['id']||0x0;this['name']=_0x1e7b7e[_0x4338('0x0')]||'';this[_0x4338('0x1')]=_0x1e7b7e[_0x4338('0x1')]||_0x4338('0x2');this['originated']=0x0;this[_0x4338('0x3')]=0x0;this[_0x4338('0x4')]=0x0;this[_0x4338('0x5')]=0x0;this[_0x4338('0x6')]='';this[_0x4338('0x7')]=!![];this[_0x4338('0x8')]=_0x1e7b7e['active'];this[_0x4338('0x9')]=_0x1e7b7e[_0x4338('0x9')];this[_0x4338('0xa')]=_0x1e7b7e[_0x4338('0xa')]||null;this['dialGlobalInterval']=_0x1e7b7e['dialGlobalInterval']?_0x1e7b7e[_0x4338('0xb')]:null;this[_0x4338('0xc')]=_0x1e7b7e[_0x4338('0xc')];this[_0x4338('0xd')]=_0x1e7b7e[_0x4338('0xd')];this[_0x4338('0xe')]=_0x1e7b7e[_0x4338('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x1e7b7e[_0x4338('0xf')];this[_0x4338('0x10')]=_0x1e7b7e[_0x4338('0x10')];this[_0x4338('0x11')]=_0x1e7b7e[_0x4338('0x11')];this[_0x4338('0x12')]=_0x1e7b7e[_0x4338('0x12')];this[_0x4338('0x13')]=_0x1e7b7e['dialNoAnswerMaxRetry'];this[_0x4338('0x14')]=_0x1e7b7e[_0x4338('0x14')];this[_0x4338('0x15')]=_0x1e7b7e[_0x4338('0x15')];this[_0x4338('0x16')]=_0x1e7b7e[_0x4338('0x16')]||0x3;this[_0x4338('0x17')]=_0x1e7b7e['dialNoSuchNumberRetryFrequency']||0x96;this[_0x4338('0x18')]=_0x1e7b7e[_0x4338('0x18')]||0x3;this[_0x4338('0x19')]=_0x1e7b7e['dialDropRetryFrequency']||0x96;this[_0x4338('0x1a')]=_0x1e7b7e['dialAbandonedMaxRetry']||0x3;this[_0x4338('0x1b')]=_0x1e7b7e[_0x4338('0x1b')]||0x96;this[_0x4338('0x1c')]=_0x1e7b7e[_0x4338('0x1c')]||0x3;this[_0x4338('0x1d')]=_0x1e7b7e[_0x4338('0x1d')]||0x96;this[_0x4338('0x1e')]=_0x1e7b7e[_0x4338('0x1e')]||0x3;this[_0x4338('0x1f')]=_0x1e7b7e[_0x4338('0x1f')]||0x96;this[_0x4338('0x20')]=_0x1e7b7e[_0x4338('0x20')]||_0x4338('0x21');this[_0x4338('0x22')]=_0x1e7b7e[_0x4338('0x22')]||undefined;this[_0x4338('0x23')]=_0x1e7b7e[_0x4338('0x23')]||undefined;this[_0x4338('0x24')]=_0x1e7b7e[_0x4338('0x24')]||undefined;this['TrunkBackup']=_0x1e7b7e[_0x4338('0x25')]?_0x1e7b7e['TrunkBackup']:undefined;this[_0x4338('0x26')]=_0x1e7b7e['Trunk']?_0x1e7b7e[_0x4338('0x26')]:undefined;this['Interval']=_0x1e7b7e[_0x4338('0x27')]?_0x1e7b7e['Interval']:undefined;this[_0x4338('0x28')]=_0x1e7b7e[_0x4338('0x28')]?_0x1e7b7e[_0x4338('0x28')]:undefined;this[_0x4338('0x29')]=_0x1e7b7e['SquareProject']?_0x1e7b7e['SquareProject'][_0x4338('0x0')]:undefined;this[_0x4338('0x2a')]=_0x1e7b7e[_0x4338('0x2a')]||![];this[_0x4338('0x2b')]=_0x1e7b7e['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1e7b7e[_0x4338('0x2c')];this[_0x4338('0x2d')]=_0x1e7b7e[_0x4338('0x2d')];this['dialAMDTotalAnalysisTime']=_0x1e7b7e[_0x4338('0x2e')];this['dialAMDMinWordLength']=_0x1e7b7e[_0x4338('0x2f')];this['dialAMDBetweenWordsSilence']=_0x1e7b7e[_0x4338('0x30')];this[_0x4338('0x31')]=_0x1e7b7e['dialAMDMaximumNumberOfWords'];this[_0x4338('0x32')]=_0x1e7b7e[_0x4338('0x32')];this[_0x4338('0x33')]=_0x1e7b7e[_0x4338('0x33')];}module[_0x4338('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 85b6ea5..4da251a 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 _0xae24=['context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferType','exports','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode'];(function(_0x4d1518,_0x16d06c){var _0x57272c=function(_0x340daa){while(--_0x340daa){_0x4d1518['push'](_0x4d1518['shift']());}};_0x57272c(++_0x16d06c);}(_0xae24,0x180));var _0x4ae2=function(_0x1e8c5e,_0x4667b9){_0x1e8c5e=_0x1e8c5e-0x0;var _0x3010ad=_0xae24[_0x1e8c5e];return _0x3010ad;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x4ae2('0x0')]='';this[_0x4ae2('0x1')]=0x0;this[_0x4ae2('0x2')]='';this[_0x4ae2('0x3')]=undefined;this[_0x4ae2('0x4')]=undefined;this[_0x4ae2('0x5')]=0x0;this[_0x4ae2('0x6')]='';this[_0x4ae2('0x7')]=0x0;this[_0x4ae2('0x8')]=0x0;this[_0x4ae2('0x9')]=0x0;this['answered']=![];this[_0x4ae2('0xa')]=null;this[_0x4ae2('0xb')]=null;this[_0x4ae2('0xc')]=![];this['abandoned']=![];this['lastapplication']='';this[_0x4ae2('0xd')]='';this[_0x4ae2('0xe')]=0x0;this[_0x4ae2('0xf')]=0x0;this[_0x4ae2('0x10')]=0x0;this[_0x4ae2('0x11')]=null;this[_0x4ae2('0x12')]=null;this[_0x4ae2('0x13')]=null;this[_0x4ae2('0x14')]=![];this[_0x4ae2('0x15')]=null;this['queue']=null;this[_0x4ae2('0x16')]=[];this[_0x4ae2('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x4ae2('0x18')]=undefined;this['mohtime']=0x0;}module[_0x4ae2('0x19')]=Channel; \ No newline at end of file +var _0x6da1=['abandoned','lastapplication','lastdata','billableseconds','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','channel','calleridnum','calleridname','connectedlinenum','accountcode','context','linkedid','exten','answered','unmanaged'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x6da1,0x1b8));var _0x16da=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0x6da1[_0x130705];return _0x1fa991;};'use strict';function Channel(){this['starttime']=null;this[_0x16da('0x0')]='';this['destinationchannel']='';this[_0x16da('0x1')]=0x0;this[_0x16da('0x2')]='';this[_0x16da('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x16da('0x4')]=0x0;this[_0x16da('0x5')]='';this['uniqueid']=0x0;this[_0x16da('0x6')]=0x0;this[_0x16da('0x7')]=0x0;this[_0x16da('0x8')]=![];this['answertime']=null;this['endtime']=null;this[_0x16da('0x9')]=![];this[_0x16da('0xa')]=![];this[_0x16da('0xb')]='';this[_0x16da('0xc')]='';this['duration']=0x0;this[_0x16da('0xd')]=0x0;this['holdtime']=0x0;this[_0x16da('0xe')]=null;this[_0x16da('0xf')]=null;this[_0x16da('0x10')]=null;this[_0x16da('0x11')]=![];this[_0x16da('0x12')]=null;this[_0x16da('0x13')]=null;this[_0x16da('0x14')]=[];this[_0x16da('0x15')]=undefined;this[_0x16da('0x16')]=undefined;this[_0x16da('0x17')]=undefined;this[_0x16da('0x18')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 001f669..7876473 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 _0xcf8f=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x29bae0,_0x1f0422){var _0x29ac39=function(_0x536552){while(--_0x536552){_0x29bae0['push'](_0x29bae0['shift']());}};_0x29ac39(++_0x1f0422);}(_0xcf8f,0x120));var _0xfcf8=function(_0xc6cd9,_0x24938f){_0xc6cd9=_0xc6cd9-0x0;var _0x39ca4b=_0xcf8f[_0xc6cd9];return _0x39ca4b;};'use strict';function DeskAccount(_0x20d9d7){this['id']=_0x20d9d7['id']||0x0;this[_0xfcf8('0x0')]=_0x20d9d7['name']||'';this[_0xfcf8('0x1')]=_0x20d9d7['username']||'';this[_0xfcf8('0x2')]=_0x20d9d7[_0xfcf8('0x2')]||'';this[_0xfcf8('0x3')]=_0x20d9d7['authType']||'';this[_0xfcf8('0x4')]=_0x20d9d7['password']||'';this[_0xfcf8('0x5')]=_0x20d9d7[_0xfcf8('0x5')]||'';this[_0xfcf8('0x6')]=_0x20d9d7[_0xfcf8('0x6')]||'';this[_0xfcf8('0x7')]=_0x20d9d7[_0xfcf8('0x7')]||'';this[_0xfcf8('0x8')]=_0x20d9d7[_0xfcf8('0x8')]||'';this[_0xfcf8('0x9')]=_0x20d9d7['type']||'';this[_0xfcf8('0xa')]=_0x20d9d7[_0xfcf8('0xa')]||'';this[_0xfcf8('0xb')]=_0x20d9d7[_0xfcf8('0xb')]||{};}module[_0xfcf8('0xc')]=DeskAccount; \ No newline at end of file +var _0x4120=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x4120,0xe3));var _0x0412=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x4120[_0x23e7c1];return _0x1add43;};'use strict';function DeskAccount(_0x4f368f){this['id']=_0x4f368f['id']||0x0;this['name']=_0x4f368f[_0x0412('0x0')]||'';this[_0x0412('0x1')]=_0x4f368f['username']||'';this['remoteUri']=_0x4f368f[_0x0412('0x2')]||'';this[_0x0412('0x3')]=_0x4f368f[_0x0412('0x3')]||'';this[_0x0412('0x4')]=_0x4f368f[_0x0412('0x4')]||'';this[_0x0412('0x5')]=_0x4f368f[_0x0412('0x5')]||'';this[_0x0412('0x6')]=_0x4f368f['consumerSecret']||'';this[_0x0412('0x7')]=_0x4f368f[_0x0412('0x7')]||'';this[_0x0412('0x8')]=_0x4f368f[_0x0412('0x8')]||'';this[_0x0412('0x9')]=_0x4f368f[_0x0412('0x9')]||'';this[_0x0412('0xa')]=_0x4f368f[_0x0412('0xa')]||'';this[_0x0412('0xb')]=_0x4f368f['Configurations']||{};}module[_0x0412('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 5938215..22170be 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 _0x9354=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x161ddc,_0x208b32){var _0x5e2af9=function(_0x270c3c){while(--_0x270c3c){_0x161ddc['push'](_0x161ddc['shift']());}};_0x5e2af9(++_0x208b32);}(_0x9354,0x96));var _0x4935=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x9354[_0x2faddb];return _0x273c05;};'use strict';function Dynamics365Account(_0x487ab6){this['id']=_0x487ab6['id']||0x0;this[_0x4935('0x0')]=_0x487ab6[_0x4935('0x0')]||'';this['username']=_0x487ab6[_0x4935('0x1')]||'';this[_0x4935('0x2')]=_0x487ab6[_0x4935('0x2')]||'';this[_0x4935('0x3')]=_0x487ab6['remoteUri']||'';this[_0x4935('0x4')]=_0x487ab6[_0x4935('0x4')]||'';this[_0x4935('0x5')]=_0x487ab6[_0x4935('0x5')]||'';this[_0x4935('0x6')]=_0x487ab6[_0x4935('0x6')]||{};this[_0x4935('0x7')]=_0x487ab6[_0x4935('0x7')]||'';this[_0x4935('0x8')]=_0x487ab6['Configurations']||{};}module[_0x4935('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xe5b5=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0xe5b5[_0x5b077b];return _0x16faf7;};'use strict';function Dynamics365Account(_0x16118d){this['id']=_0x16118d['id']||0x0;this[_0x5e5b('0x0')]=_0x16118d[_0x5e5b('0x0')]||'';this[_0x5e5b('0x1')]=_0x16118d[_0x5e5b('0x1')]||'';this[_0x5e5b('0x2')]=_0x16118d[_0x5e5b('0x2')]||'';this[_0x5e5b('0x3')]=_0x16118d[_0x5e5b('0x3')]||'';this[_0x5e5b('0x4')]=_0x16118d[_0x5e5b('0x4')]||'';this[_0x5e5b('0x5')]=_0x16118d[_0x5e5b('0x5')]||'';this[_0x5e5b('0x6')]=_0x16118d[_0x5e5b('0x6')]||{};this[_0x5e5b('0x7')]=_0x16118d[_0x5e5b('0x7')]||'';this[_0x5e5b('0x8')]=_0x16118d[_0x5e5b('0x8')]||{};}module[_0x5e5b('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index e640189..96fe010 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 _0xac10=['Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x2318b6,_0x52d784){var _0x89f741=function(_0x3dcac3){while(--_0x3dcac3){_0x2318b6['push'](_0x2318b6['shift']());}};_0x89f741(++_0x52d784);}(_0xac10,0x123));var _0x0ac1=function(_0x540160,_0x24c6b6){_0x540160=_0x540160-0x0;var _0x476120=_0xac10[_0x540160];return _0x476120;};'use strict';function FaxAccount(_0x30408f){this['id']=_0x30408f['id']||0x0;this[_0x0ac1('0x0')]=_0x30408f['name']||'';this['description']=_0x30408f[_0x0ac1('0x1')];this[_0x0ac1('0x2')]=_0x30408f[_0x0ac1('0x2')];this[_0x0ac1('0x3')]=_0x30408f[_0x0ac1('0x3')];this['localstationid']=_0x30408f[_0x0ac1('0x4')];this[_0x0ac1('0x5')]=_0x30408f[_0x0ac1('0x5')]||0x960;this[_0x0ac1('0x6')]=_0x30408f[_0x0ac1('0x6')]||0x3840;this[_0x0ac1('0x7')]=_0x30408f[_0x0ac1('0x7')]||'v17,v27,v29';this[_0x0ac1('0x8')]=_0x30408f['gateway']||'no';this[_0x0ac1('0x9')]=_0x30408f[_0x0ac1('0x9')]||'no';this[_0x0ac1('0xa')]=_0x30408f['t38timeout']||0x1388;this[_0x0ac1('0xb')]=_0x30408f['tech']||_0x0ac1('0xc');this['Trunk']=_0x30408f[_0x0ac1('0xd')]?_0x30408f[_0x0ac1('0xd')]:undefined;this[_0x0ac1('0xe')]=_0x30408f[_0x0ac1('0xe')];this['key']=_0x30408f[_0x0ac1('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x7c2d=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7c2d,0x1e9));var _0xd7c2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7c2d[_0x4565bf];return _0x5610ba;};'use strict';function FaxAccount(_0x29c94b){this['id']=_0x29c94b['id']||0x0;this[_0xd7c2('0x0')]=_0x29c94b['name']||'';this[_0xd7c2('0x1')]=_0x29c94b[_0xd7c2('0x1')];this[_0xd7c2('0x2')]=_0x29c94b[_0xd7c2('0x2')];this[_0xd7c2('0x3')]=_0x29c94b[_0xd7c2('0x3')];this[_0xd7c2('0x4')]=_0x29c94b[_0xd7c2('0x4')];this['minrate']=_0x29c94b[_0xd7c2('0x5')]||0x960;this[_0xd7c2('0x6')]=_0x29c94b[_0xd7c2('0x6')]||0x3840;this[_0xd7c2('0x7')]=_0x29c94b[_0xd7c2('0x7')]||_0xd7c2('0x8');this[_0xd7c2('0x9')]=_0x29c94b[_0xd7c2('0x9')]||'no';this[_0xd7c2('0xa')]=_0x29c94b[_0xd7c2('0xa')]||'no';this[_0xd7c2('0xb')]=_0x29c94b[_0xd7c2('0xb')]||0x1388;this[_0xd7c2('0xc')]=_0x29c94b[_0xd7c2('0xc')]||'SIP';this[_0xd7c2('0xd')]=_0x29c94b[_0xd7c2('0xd')]?_0x29c94b[_0xd7c2('0xd')]:undefined;this[_0xd7c2('0xe')]=_0x29c94b[_0xd7c2('0xe')];this[_0xd7c2('0xf')]=_0x29c94b['key'];}module[_0xd7c2('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 33b9bd8..40fe9f8 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 _0xb9d4=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xb9d4,0x106));var _0x4b9d=function(_0x55c83a,_0x4e8561){_0x55c83a=_0x55c83a-0x0;var _0x414b56=_0xb9d4[_0x55c83a];return _0x414b56;};'use strict';function FreshdeskAccount(_0x3c059f){this['id']=_0x3c059f['id']||0x0;this[_0x4b9d('0x0')]=_0x3c059f['name']||'';this[_0x4b9d('0x1')]=_0x3c059f[_0x4b9d('0x1')]||'';this[_0x4b9d('0x2')]=_0x3c059f[_0x4b9d('0x3')]||'';this['remoteUri']=_0x3c059f[_0x4b9d('0x4')]||'';this[_0x4b9d('0x5')]=_0x3c059f[_0x4b9d('0x5')]||'';this[_0x4b9d('0x6')]=_0x3c059f[_0x4b9d('0x6')]||{};}module[_0x4b9d('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xf811=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x246695,_0x19dba7){var _0x2d84d6=function(_0x5005bf){while(--_0x5005bf){_0x246695['push'](_0x246695['shift']());}};_0x2d84d6(++_0x19dba7);}(_0xf811,0x1eb));var _0x1f81=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xf811[_0x4c440b];return _0x2d48cf;};'use strict';function FreshdeskAccount(_0x1e4403){this['id']=_0x1e4403['id']||0x0;this['name']=_0x1e4403[_0x1f81('0x0')]||'';this[_0x1f81('0x1')]=_0x1e4403['username']||'';this[_0x1f81('0x2')]=_0x1e4403[_0x1f81('0x3')]||'';this[_0x1f81('0x4')]=_0x1e4403['remoteUri']||'';this[_0x1f81('0x5')]=_0x1e4403[_0x1f81('0x5')]||'';this[_0x1f81('0x6')]=_0x1e4403[_0x1f81('0x6')]||{};}module[_0x1f81('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index beb9365..68f93ee 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 _0x3c94=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x380a75,_0x4ab6b2){var _0x59f599=function(_0x2525b6){while(--_0x2525b6){_0x380a75['push'](_0x380a75['shift']());}};_0x59f599(++_0x4ab6b2);}(_0x3c94,0xcd));var _0x43c9=function(_0x49f66e,_0x3e2369){_0x49f66e=_0x49f66e-0x0;var _0x55a1e2=_0x3c94[_0x49f66e];return _0x55a1e2;};'use strict';function FreshsalesAccount(_0x467498){this['id']=_0x467498['id']||0x0;this[_0x43c9('0x0')]=_0x467498[_0x43c9('0x0')]||'';this[_0x43c9('0x1')]=_0x467498[_0x43c9('0x1')]||'';this[_0x43c9('0x2')]=_0x467498[_0x43c9('0x3')]||'';this[_0x43c9('0x4')]=_0x467498[_0x43c9('0x4')]||'';this[_0x43c9('0x5')]=_0x467498[_0x43c9('0x5')]||'';this[_0x43c9('0x6')]=_0x467498['Configurations']||{};}module[_0x43c9('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xc99e=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x91faeb,_0x1e067b){var _0x415778=function(_0x2f0175){while(--_0x2f0175){_0x91faeb['push'](_0x91faeb['shift']());}};_0x415778(++_0x1e067b);}(_0xc99e,0x6e));var _0xec99=function(_0x390a94,_0x2f0eae){_0x390a94=_0x390a94-0x0;var _0x29735c=_0xc99e[_0x390a94];return _0x29735c;};'use strict';function FreshsalesAccount(_0x3d87e9){this['id']=_0x3d87e9['id']||0x0;this[_0xec99('0x0')]=_0x3d87e9[_0xec99('0x0')]||'';this[_0xec99('0x1')]=_0x3d87e9[_0xec99('0x1')]||'';this[_0xec99('0x2')]=_0x3d87e9['token']||'';this[_0xec99('0x3')]=_0x3d87e9[_0xec99('0x3')]||'';this[_0xec99('0x4')]=_0x3d87e9[_0xec99('0x4')]||'';this[_0xec99('0x5')]=_0x3d87e9[_0xec99('0x5')]||{};}module[_0xec99('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index e8d2cae..293fdf8 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 _0xfd2f=['queuecallercomplete','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xfd2f,0x146));var _0xffd2=function(_0x240aee,_0x5119c3){_0x240aee=_0x240aee-0x0;var _0x4eecd1=_0xfd2f[_0x240aee];return _0x4eecd1;};'use strict';function QueueReport(){this[_0xffd2('0x0')]='inbound';this[_0xffd2('0x1')]='';this[_0xffd2('0x2')]='';this[_0xffd2('0x3')]='';this[_0xffd2('0x4')]='';this[_0xffd2('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xffd2('0x6')]=0x1;this[_0xffd2('0x7')]=0x1;this[_0xffd2('0x8')]=![];this[_0xffd2('0x9')]=null;this[_0xffd2('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xffd2('0xb')]=![];this['queuecallerexitAt']=null;this[_0xffd2('0xc')]=0x1;this[_0xffd2('0xd')]='';this[_0xffd2('0xe')]='';this[_0xffd2('0xf')]='';this['accountcode']='';this[_0xffd2('0x10')]='';this[_0xffd2('0x11')]='';this[_0xffd2('0x12')]='';this[_0xffd2('0x13')]=0x0;this['assigned']=![];this[_0xffd2('0x14')]='';this[_0xffd2('0x15')]=_0xffd2('0x16');this[_0xffd2('0x17')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0xde89=['queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinename','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xde89,0x16e));var _0x9de8=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xde89[_0x22b68a];return _0x1ac67a;};'use strict';function QueueReport(){this[_0x9de8('0x0')]='inbound';this[_0x9de8('0x1')]='';this[_0x9de8('0x2')]='';this[_0x9de8('0x3')]='';this['queue']='';this[_0x9de8('0x4')]=null;this[_0x9de8('0x5')]=null;this[_0x9de8('0x6')]=0x1;this[_0x9de8('0x7')]=0x1;this[_0x9de8('0x8')]=![];this[_0x9de8('0x9')]=null;this['queuecallercomplete']=![];this[_0x9de8('0xa')]=null;this[_0x9de8('0xb')]=![];this[_0x9de8('0xc')]=null;this['originalposition']=0x1;this[_0x9de8('0xd')]='';this['connectedlinenum']='';this[_0x9de8('0xe')]='';this['accountcode']='';this[_0x9de8('0xf')]='';this[_0x9de8('0x10')]='';this['priority']='';this[_0x9de8('0x11')]=0x0;this[_0x9de8('0x12')]=![];this[_0x9de8('0x13')]='';this[_0x9de8('0x14')]=_0x9de8('0x15');this[_0x9de8('0x16')]=0x0;this[_0x9de8('0x17')]={};}module[_0x9de8('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 c6a2380..99e1101 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 _0xd63e=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name'];(function(_0x394d61,_0xea3c9d){var _0x1db755=function(_0x2f458e){while(--_0x2f458e){_0x394d61['push'](_0x394d61['shift']());}};_0x1db755(++_0xea3c9d);}(_0xd63e,0xaf));var _0xed63=function(_0x50f04d,_0x2596db){_0x50f04d=_0x50f04d-0x0;var _0x545d15=_0xd63e[_0x50f04d];return _0x545d15;};'use strict';function SalesforceAccount(_0x1a355a){this['id']=_0x1a355a['id']||0x0;this[_0xed63('0x0')]=_0x1a355a[_0xed63('0x0')]||'';this['username']=_0x1a355a[_0xed63('0x1')]||'';this[_0xed63('0x2')]=_0x1a355a[_0xed63('0x2')]||'';this[_0xed63('0x3')]=_0x1a355a['password']||'';this[_0xed63('0x4')]=_0x1a355a[_0xed63('0x4')]||'';this['clientSecret']=_0x1a355a[_0xed63('0x5')]||'';this['securityToken']=_0x1a355a[_0xed63('0x6')]||'';this[_0xed63('0x7')]=_0x1a355a[_0xed63('0x7')]||'integrationTab';this[_0xed63('0x8')]=_0x1a355a[_0xed63('0x8')]||'';this[_0xed63('0x9')]=_0x1a355a[_0xed63('0x9')]||{};}module[_0xed63('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x38c1=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x38c1,0x7f));var _0x138c=function(_0x153597,_0x492f6f){_0x153597=_0x153597-0x0;var _0x27d9de=_0x38c1[_0x153597];return _0x27d9de;};'use strict';function SalesforceAccount(_0x2e7922){this['id']=_0x2e7922['id']||0x0;this[_0x138c('0x0')]=_0x2e7922[_0x138c('0x0')]||'';this[_0x138c('0x1')]=_0x2e7922[_0x138c('0x1')]||'';this['remoteUri']=_0x2e7922['remoteUri']||'';this[_0x138c('0x2')]=_0x2e7922[_0x138c('0x2')]||'';this[_0x138c('0x3')]=_0x2e7922[_0x138c('0x3')]||'';this[_0x138c('0x4')]=_0x2e7922[_0x138c('0x4')]||'';this['securityToken']=_0x2e7922[_0x138c('0x5')]||'';this[_0x138c('0x6')]=_0x2e7922[_0x138c('0x6')]||_0x138c('0x7');this[_0x138c('0x8')]=_0x2e7922[_0x138c('0x8')]||'';this[_0x138c('0x9')]=_0x2e7922['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index edc58ca..09afc2e 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 _0x8747=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x1c4b88,_0x5001c2){var _0x5210a7=function(_0x31b130){while(--_0x31b130){_0x1c4b88['push'](_0x1c4b88['shift']());}};_0x5210a7(++_0x5001c2);}(_0x8747,0xc1));var _0x7874=function(_0x4de226,_0xf589ec){_0x4de226=_0x4de226-0x0;var _0x2fb276=_0x8747[_0x4de226];return _0x2fb276;};'use strict';function ServicenowAccount(_0x46d44b){this['id']=_0x46d44b['id']||0x0;this[_0x7874('0x0')]=_0x46d44b[_0x7874('0x0')]||'';this[_0x7874('0x1')]=_0x46d44b[_0x7874('0x1')]||'';this[_0x7874('0x2')]=_0x46d44b[_0x7874('0x2')]||'';this[_0x7874('0x3')]=_0x46d44b[_0x7874('0x3')]||'';this[_0x7874('0x4')]=_0x46d44b[_0x7874('0x4')]||'';this[_0x7874('0x5')]=_0x46d44b[_0x7874('0x5')]||{};}module[_0x7874('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x7236=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x7236,0x1e9));var _0x6723=function(_0x5ed2b3,_0x4931e0){_0x5ed2b3=_0x5ed2b3-0x0;var _0x91e496=_0x7236[_0x5ed2b3];return _0x91e496;};'use strict';function ServicenowAccount(_0x1a79c8){this['id']=_0x1a79c8['id']||0x0;this['name']=_0x1a79c8[_0x6723('0x0')]||'';this['username']=_0x1a79c8[_0x6723('0x1')]||'';this[_0x6723('0x2')]=_0x1a79c8[_0x6723('0x2')]||'';this['remoteUri']=_0x1a79c8[_0x6723('0x3')]||'';this[_0x6723('0x4')]=_0x1a79c8['serverUrl']||'';this['Configurations']=_0x1a79c8[_0x6723('0x5')]||{};}module[_0x6723('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index bbe0558..f1eaefa 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 _0x99ce=['name','username','password','remoteUri','Configurations','exports'];(function(_0x4c2d87,_0x2437e6){var _0x476354=function(_0x4c3a48){while(--_0x4c3a48){_0x4c2d87['push'](_0x4c2d87['shift']());}};_0x476354(++_0x2437e6);}(_0x99ce,0x168));var _0xe99c=function(_0x1233d2,_0x5416f4){_0x1233d2=_0x1233d2-0x0;var _0x22759e=_0x99ce[_0x1233d2];return _0x22759e;};'use strict';function SugarcrmAccount(_0xf01b2d){this['id']=_0xf01b2d['id']||0x0;this['name']=_0xf01b2d[_0xe99c('0x0')]||'';this[_0xe99c('0x1')]=_0xf01b2d[_0xe99c('0x1')]||'';this[_0xe99c('0x2')]=_0xf01b2d[_0xe99c('0x2')]||'';this[_0xe99c('0x3')]=_0xf01b2d[_0xe99c('0x3')]||'';this['serverUrl']=_0xf01b2d['serverUrl']||'';this[_0xe99c('0x4')]=_0xf01b2d[_0xe99c('0x4')]||{};}module[_0xe99c('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x1c72=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x1e05e4,_0x5c5659){var _0x3ca429=function(_0x48b71b){while(--_0x48b71b){_0x1e05e4['push'](_0x1e05e4['shift']());}};_0x3ca429(++_0x5c5659);}(_0x1c72,0x65));var _0x21c7=function(_0x1eef48,_0x5e8090){_0x1eef48=_0x1eef48-0x0;var _0x3fd189=_0x1c72[_0x1eef48];return _0x3fd189;};'use strict';function SugarcrmAccount(_0x436904){this['id']=_0x436904['id']||0x0;this[_0x21c7('0x0')]=_0x436904[_0x21c7('0x0')]||'';this['username']=_0x436904[_0x21c7('0x1')]||'';this[_0x21c7('0x2')]=_0x436904['password']||'';this['remoteUri']=_0x436904[_0x21c7('0x3')]||'';this[_0x21c7('0x4')]=_0x436904[_0x21c7('0x4')]||'';this[_0x21c7('0x5')]=_0x436904[_0x21c7('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 aa7091c..208a1ad 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 _0xeea4=['address','name','accountcode','state','unknown','stateTime','status'];(function(_0x4effc5,_0xcb4f70){var _0xdd2a3e=function(_0x33f433){while(--_0x33f433){_0x4effc5['push'](_0x4effc5['shift']());}};_0xdd2a3e(++_0xcb4f70);}(_0xeea4,0x19e));var _0x4eea=function(_0x38293f,_0x1e0bf2){_0x38293f=_0x38293f-0x0;var _0x43d472=_0xeea4[_0x38293f];return _0x43d472;};'use strict';function Telephone(_0x25a893){this['id']=_0x25a893['id']||0x0;this[_0x4eea('0x0')]=_0x25a893[_0x4eea('0x0')]||'';this[_0x4eea('0x1')]=_0x25a893[_0x4eea('0x1')]||'';this[_0x4eea('0x2')]=_0x4eea('0x3');this[_0x4eea('0x4')]=0x0;this[_0x4eea('0x5')]='unknown';this[_0x4eea('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x32e7=['name','accountcode','unknown','stateTime','status'];(function(_0x2f436c,_0x403917){var _0x573a6e=function(_0x4e3821){while(--_0x4e3821){_0x2f436c['push'](_0x2f436c['shift']());}};_0x573a6e(++_0x403917);}(_0x32e7,0xc3));var _0x732e=function(_0x3b23c1,_0x2026ba){_0x3b23c1=_0x3b23c1-0x0;var _0x226cd0=_0x32e7[_0x3b23c1];return _0x226cd0;};'use strict';function Telephone(_0x5c8dba){this['id']=_0x5c8dba['id']||0x0;this['name']=_0x5c8dba[_0x732e('0x0')]||'';this[_0x732e('0x1')]=_0x5c8dba[_0x732e('0x1')]||'';this['state']=_0x732e('0x2');this[_0x732e('0x3')]=0x0;this[_0x732e('0x4')]=_0x732e('0x2');this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 269e5ba..fcd3c9b 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(_0x1639ac,_0x6d736e){var _0x19b3d9=function(_0x1f7964){while(--_0x1f7964){_0x1639ac['push'](_0x1639ac['shift']());}};_0x19b3d9(++_0x6d736e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x18653f,_0x19147e){var _0xf65912=function(_0x4ef662){while(--_0x4ef662){_0x18653f['push'](_0x18653f['shift']());}};_0xf65912(++_0x19147e);}(_0xb10b,0x12a));var _0xbb10=function(_0x516044,_0x3677f7){_0x516044=_0x516044-0x0;var _0x31684b=_0xb10b[_0x516044];return _0x31684b;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 79c6918..36d2747 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 _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x5eb8[_0x1ae4a9];return _0x54d0b0;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x101bf3,_0xc7eeaf){var _0x3ba675=function(_0x4bfd7b){while(--_0x4bfd7b){_0x101bf3['push'](_0x101bf3['shift']());}};_0x3ba675(++_0xc7eeaf);}(_0x8603,0x190));var _0x3860=function(_0x3ad3e8,_0x30da73){_0x3ad3e8=_0x3ad3e8-0x0;var _0x5c3d25=_0x8603[_0x3ad3e8];return _0x5c3d25;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index d402ff6..1d8a8af 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 _0xc1d7=['indexOf','split','host','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','status','unknown','registry'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xc1d7,0x1aa));var _0x7c1d=function(_0x38f730,_0x2c7523){_0x38f730=_0x38f730-0x0;var _0x233bf4=_0xc1d7[_0x38f730];return _0x233bf4;};'use strict';function Trunk(_0x528fc2){this['id']=_0x528fc2['id']||0x0;this[_0x7c1d('0x0')]=_0x528fc2['active']||![];this[_0x7c1d('0x1')]=_0x528fc2[_0x7c1d('0x1')]||'';this[_0x7c1d('0x2')]='unknown';this['stateTime']=0x0;this[_0x7c1d('0x3')]=_0x7c1d('0x4');this[_0x7c1d('0x5')]=_0x528fc2[_0x7c1d('0x5')]&&_0x528fc2[_0x7c1d('0x5')][_0x7c1d('0x6')](':')?_0x528fc2[_0x7c1d('0x5')][_0x7c1d('0x7')](':')[0x0]:'';this[_0x7c1d('0x8')]='';this['port']='';this[_0x7c1d('0x9')]='';this[_0x7c1d('0xa')]='';this[_0x7c1d('0xb')]='';this[_0x7c1d('0xc')]=_0x7c1d('0x4');this[_0x7c1d('0xd')]='';this['address']='';this[_0x7c1d('0xe')]=_0x528fc2['defaultuser']||'';}module[_0x7c1d('0xf')]=Trunk; \ No newline at end of file +var _0xe653=['domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','host','port'];(function(_0x3995ad,_0x16c2a1){var _0x1d4ee6=function(_0x10bdf5){while(--_0x10bdf5){_0x3995ad['push'](_0x3995ad['shift']());}};_0x1d4ee6(++_0x16c2a1);}(_0xe653,0x1ee));var _0x3e65=function(_0x37dbbb,_0x1909de){_0x37dbbb=_0x37dbbb-0x0;var _0x10068f=_0xe653[_0x37dbbb];return _0x10068f;};'use strict';function Trunk(_0x573646){this['id']=_0x573646['id']||0x0;this[_0x3e65('0x0')]=_0x573646[_0x3e65('0x0')]||![];this[_0x3e65('0x1')]=_0x573646[_0x3e65('0x1')]||'';this[_0x3e65('0x2')]=_0x3e65('0x3');this[_0x3e65('0x4')]=0x0;this[_0x3e65('0x5')]='unknown';this[_0x3e65('0x6')]=_0x573646[_0x3e65('0x6')]&&_0x573646['registry'][_0x3e65('0x7')](':')?_0x573646[_0x3e65('0x6')]['split'](':')[0x0]:'';this[_0x3e65('0x8')]='';this[_0x3e65('0x9')]='';this[_0x3e65('0xa')]='';this[_0x3e65('0xb')]='';this[_0x3e65('0xc')]='';this[_0x3e65('0xd')]=_0x3e65('0x3');this[_0x3e65('0xe')]='';this[_0x3e65('0xf')]='';this[_0x3e65('0x10')]=_0x573646['defaultuser']||'';}module[_0x3e65('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index a501e91..44e6410 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 _0x7282=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x7282,0xc2));var _0x2728=function(_0xe36749,_0x2a45c8){_0xe36749=_0xe36749-0x0;var _0x5d86b7=_0x7282[_0xe36749];return _0x5d86b7;};'use strict';function voiceExtension(_0x2400f2){this['id']=_0x2400f2['id']||0x0;this[_0x2728('0x0')]=_0x2400f2[_0x2728('0x0')]||'';this[_0x2728('0x1')]=_0x2400f2[_0x2728('0x1')]||_0x2728('0x2');this[_0x2728('0x3')]=_0x2400f2[_0x2728('0x3')]||![];}module[_0x2728('0x4')]=voiceExtension; \ No newline at end of file +var _0x0eb0=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x15ee8c,_0x568345){var _0x2e3dd5=function(_0x610b2e){while(--_0x610b2e){_0x15ee8c['push'](_0x15ee8c['shift']());}};_0x2e3dd5(++_0x568345);}(_0x0eb0,0xfa));var _0x00eb=function(_0x50d0bf,_0x5e3c35){_0x50d0bf=_0x50d0bf-0x0;var _0x2b6eb7=_0x0eb0[_0x50d0bf];return _0x2b6eb7;};'use strict';function voiceExtension(_0x112450){this['id']=_0x112450['id']||0x0;this[_0x00eb('0x0')]=_0x112450['exten']||'';this['recordingFormat']=_0x112450[_0x00eb('0x1')]||_0x00eb('0x2');this[_0x00eb('0x3')]=_0x112450[_0x00eb('0x3')]||![];}module[_0x00eb('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 8a75c3e..509944a 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 _0x84a2=['timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','acw','acwTimeout','autopause','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking'];(function(_0x11ae05,_0xb34f47){var _0x239c2f=function(_0xd35c61){while(--_0xd35c61){_0x11ae05['push'](_0x11ae05['shift']());}};_0x239c2f(++_0xb34f47);}(_0x84a2,0x17b));var _0x284a=function(_0x44c742,_0x5d69a4){_0x44c742=_0x44c742-0x0;var _0x40fcf0=_0x84a2[_0x44c742];return _0x40fcf0;};'use strict';var statusDesc=[_0x284a('0x0'),_0x284a('0x1'),'inuse',_0x284a('0x2'),'invalid',_0x284a('0x3'),_0x284a('0x4'),'ringinuse',_0x284a('0x5')];var monitorFormat={'wav':_0x284a('0x6'),'wav49':_0x284a('0x7'),'gsm':_0x284a('0x8')};var strategy={'rrmemory':_0x284a('0x9'),'roundrobin':_0x284a('0xa')};function VoiceQueue(_0x52930f){this['id']=_0x52930f['id']||0x0;this[_0x284a('0xb')]=_0x52930f[_0x284a('0xb')]||'';this['monitor_format']=_0x52930f[_0x284a('0xc')]||'';this['type']=_0x52930f[_0x284a('0xd')]||'inbound';this[_0x284a('0xe')]=0x0;this['talking']=0x0;this[_0x284a('0xf')]=0x0;this[_0x284a('0x10')]=0x0;this[_0x284a('0x11')]=0x0;this[_0x284a('0x12')]=0x0;this['sumBillable']=0x0;this[_0x284a('0x13')]=0x0;this[_0x284a('0x14')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x284a('0x15')]=_0x52930f[_0x284a('0x15')]||![];this[_0x284a('0x16')]=_0x52930f['acwTimeout']||0xa;this['autopause']=_0x52930f[_0x284a('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0x284a('0x18')]='';this['originated']=0x0;this['temp']=0x0;this[_0x284a('0x19')]=_0x52930f[_0x284a('0x19')]||null;this['dialGlobalInterval']=_0x52930f[_0x284a('0x1a')]?_0x52930f[_0x284a('0x1a')]:null;this['dialActive']=_0x52930f[_0x284a('0x1b')];this[_0x284a('0x1c')]=_0x52930f[_0x284a('0x1c')]||_0x284a('0x1d');this[_0x284a('0x1e')]=_0x52930f[_0x284a('0x1e')]||0x0;this[_0x284a('0x1f')]=_0x52930f[_0x284a('0x1f')]||0x0;this['dialPowerLevel']=_0x52930f[_0x284a('0x20')]||0x1;this[_0x284a('0x21')]=_0x52930f['dialPredictiveOptimization']||_0x284a('0x22');this[_0x284a('0x23')]=_0x52930f[_0x284a('0x23')]||0.03;this[_0x284a('0x24')]=_0x52930f['dialPredictiveInterval']||0x258;this[_0x284a('0x25')]=_0x52930f[_0x284a('0x25')]||_0x284a('0x26');this[_0x284a('0x27')]=_0x52930f['dialOriginateCallerIdNumber']||'anonymous';this[_0x284a('0x28')]=_0x52930f[_0x284a('0x28')]||0x1e;this[_0x284a('0x29')]=_0x52930f[_0x284a('0x29')]||_0x284a('0x2a');this[_0x284a('0x2b')]=_0x52930f[_0x284a('0x2b')]||0x3;this[_0x284a('0x2c')]=_0x52930f[_0x284a('0x2c')]||undefined;this[_0x284a('0x2d')]=_0x52930f[_0x284a('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x52930f['dialCongestionRetryFrequency']||0x96;this[_0x284a('0x2e')]=_0x52930f['dialBusyMaxRetry']||0x3;this[_0x284a('0x2f')]=_0x52930f[_0x284a('0x2f')]||0x96;this[_0x284a('0x30')]=_0x52930f[_0x284a('0x30')]||0x3;this['dialNoAnswerRetryFrequency']=_0x52930f[_0x284a('0x31')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x52930f[_0x284a('0x32')]||0x3;this[_0x284a('0x33')]=_0x52930f['dialNoSuchNumberRetryFrequency']||0x96;this[_0x284a('0x34')]=_0x52930f[_0x284a('0x34')]||0x3;this[_0x284a('0x35')]=_0x52930f[_0x284a('0x35')]||0x96;this[_0x284a('0x36')]=_0x52930f[_0x284a('0x36')]||0x3;this['dialAbandonedRetryFrequency']=_0x52930f[_0x284a('0x37')]||0x96;this[_0x284a('0x38')]=_0x52930f[_0x284a('0x38')]||0x3;this['dialMachineRetryFrequency']=_0x52930f['dialMachineRetryFrequency']||0x96;this[_0x284a('0x39')]=_0x52930f[_0x284a('0x39')]||0x3;this['dialAgentRejectRetryFrequency']=_0x52930f[_0x284a('0x3a')]||0x96;this[_0x284a('0x3b')]=_0x52930f[_0x284a('0x3b')]||0x4;this['Trunk']=_0x52930f[_0x284a('0x3c')]?_0x52930f[_0x284a('0x3c')]:undefined;this['TrunkBackup']=_0x52930f[_0x284a('0x3d')]?_0x52930f[_0x284a('0x3d')]:undefined;this[_0x284a('0x3e')]=_0x52930f[_0x284a('0x3e')]||undefined;this['Interval']=_0x52930f[_0x284a('0x3f')]?_0x52930f[_0x284a('0x3f')]:undefined;this[_0x284a('0x40')]=_0x52930f['dialOrderByScheduledAt']||'DESC';this[_0x284a('0x41')]=_0x52930f[_0x284a('0x41')]||undefined;this[_0x284a('0x42')]=_0x52930f[_0x284a('0x42')]||undefined;this['strategy']=strategy[_0x52930f[_0x284a('0x43')]]||_0x284a('0x9');this[_0x284a('0x44')]=!![];this['dialAMDActive']=_0x52930f[_0x284a('0x45')]||![];this[_0x284a('0x46')]=_0x52930f[_0x284a('0x46')];this[_0x284a('0x47')]=_0x52930f[_0x284a('0x47')];this['dialAMDAfterGreetingSilence']=_0x52930f[_0x284a('0x48')];this[_0x284a('0x49')]=_0x52930f['dialAMDTotalAnalysisTime'];this[_0x284a('0x4a')]=_0x52930f[_0x284a('0x4a')];this[_0x284a('0x4b')]=_0x52930f[_0x284a('0x4b')];this[_0x284a('0x4c')]=_0x52930f['dialAMDMaximumNumberOfWords'];this[_0x284a('0x4d')]=_0x52930f[_0x284a('0x4d')];this['dialAMDMaximumWordLength']=_0x52930f[_0x284a('0x4e')];this[_0x284a('0x4f')]=0x0;this[_0x284a('0x50')]=0x0;this[_0x284a('0x51')]=_0x52930f[_0x284a('0x51')];this[_0x284a('0x52')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x284a('0x53')]=0x0;this[_0x284a('0x54')]=0x0;this[_0x284a('0x55')]=0x0;this[_0x284a('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x284a('0x57')]=0x0;this[_0x284a('0x58')]=0x0;this[_0x284a('0x59')]=0x0;this[_0x284a('0x5a')]=0x0;this[_0x284a('0x5b')]=0x0;this[_0x284a('0x5c')]=0x0;this['startProgressive']=undefined;this[_0x284a('0x5d')]=undefined;this[_0x284a('0x5e')]=undefined;this[_0x284a('0x5f')]=1.05;this[_0x284a('0x60')]=0x0;this[_0x284a('0x61')]=0x0;this[_0x284a('0x62')]=0x0;this[_0x284a('0x63')]=0x0;this[_0x284a('0x64')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x284a('0x65')]=0x0;this[_0x284a('0x66')]=_0x52930f['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x52930f['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x284a('0x67')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x284a('0x68')]=0x1;this[_0x284a('0x69')]=0x0;this[_0x284a('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x52930f['dialRecallMeTimeout']||0x1e;this[_0x284a('0x6b')]=_0x52930f[_0x284a('0x6b')]||![];this[_0x284a('0x6c')]=!!_0x52930f[_0x284a('0x6c')]||![];this[_0x284a('0x6d')]=_0x52930f[_0x284a('0x6d')]||undefined;this[_0x284a('0x6e')]=_0x52930f[_0x284a('0x6e')]||![];this[_0x284a('0x6f')]=_0x52930f['dialAgiAfterHangupAgent']||![];this[_0x284a('0xc')]=monitorFormat[_0x52930f[_0x284a('0xc')]]?monitorFormat[_0x52930f[_0x284a('0xc')]]:undefined;this[_0x284a('0x70')]=_0x52930f[_0x284a('0x70')]||![];this[_0x284a('0x71')]=_0x52930f['mandatoryDispositionPause']?_0x52930f[_0x284a('0x71')]:undefined;}module[_0x284a('0x72')]=VoiceQueue; \ No newline at end of file +var _0xde3a=['pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','ringinuse','onhold','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xde3a,0x10f));var _0xade3=function(_0x10aa6c,_0x3b66aa){_0x10aa6c=_0x10aa6c-0x0;var _0x4a21ae=_0xde3a[_0x10aa6c];return _0x4a21ae;};'use strict';var statusDesc=['unknown',_0xade3('0x0'),_0xade3('0x1'),_0xade3('0x2'),'invalid','unavailable','ringing',_0xade3('0x3'),_0xade3('0x4')];var monitorFormat={'wav':'wav','wav49':_0xade3('0x5'),'gsm':_0xade3('0x6')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xade3('0x7')};function VoiceQueue(_0x4e8c78){this['id']=_0x4e8c78['id']||0x0;this['name']=_0x4e8c78[_0xade3('0x8')]||'';this[_0xade3('0x9')]=_0x4e8c78[_0xade3('0x9')]||'';this[_0xade3('0xa')]=_0x4e8c78[_0xade3('0xa')]||_0xade3('0xb');this[_0xade3('0xc')]=0x0;this[_0xade3('0xd')]=0x0;this[_0xade3('0xe')]=0x0;this[_0xade3('0xf')]=0x0;this[_0xade3('0x10')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xade3('0x11')]=0x0;this[_0xade3('0x12')]=0x0;this['loggedIn']=0x0;this[_0xade3('0x13')]=0x0;this['acw']=_0x4e8c78[_0xade3('0x14')]||![];this[_0xade3('0x15')]=_0x4e8c78['acwTimeout']||0xa;this[_0xade3('0x16')]=_0x4e8c78[_0xade3('0x16')]||'no';this[_0xade3('0x17')]=!![];this['message']='';this['originated']=0x0;this[_0xade3('0x18')]=0x0;this['dialTimezone']=_0x4e8c78[_0xade3('0x19')]||null;this['dialGlobalInterval']=_0x4e8c78['dialGlobalInterval']?_0x4e8c78[_0xade3('0x1a')]:null;this[_0xade3('0x1b')]=_0x4e8c78[_0xade3('0x1b')];this[_0xade3('0x1c')]=_0x4e8c78[_0xade3('0x1c')]||_0xade3('0x1d');this[_0xade3('0x1e')]=_0x4e8c78['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x4e8c78['dialLimitQueue']||0x0;this[_0xade3('0x1f')]=_0x4e8c78['dialPowerLevel']||0x1;this[_0xade3('0x20')]=_0x4e8c78[_0xade3('0x20')]||'dropRate';this[_0xade3('0x21')]=_0x4e8c78['dialPredictiveOptimizationPercentage']||0.03;this[_0xade3('0x22')]=_0x4e8c78[_0xade3('0x22')]||0x258;this[_0xade3('0x23')]=_0x4e8c78[_0xade3('0x23')]||_0xade3('0x24');this[_0xade3('0x25')]=_0x4e8c78['dialOriginateCallerIdNumber']||'anonymous';this[_0xade3('0x26')]=_0x4e8c78[_0xade3('0x26')]||0x1e;this['dialQueueOptions']=_0x4e8c78[_0xade3('0x27')]||_0xade3('0x28');this['dialQueueTimeout']=_0x4e8c78[_0xade3('0x29')]||0x3;this[_0xade3('0x2a')]=_0x4e8c78[_0xade3('0x2a')]||undefined;this[_0xade3('0x2b')]=_0x4e8c78['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x4e8c78[_0xade3('0x2c')]||0x96;this['dialBusyMaxRetry']=_0x4e8c78[_0xade3('0x2d')]||0x3;this['dialBusyRetryFrequency']=_0x4e8c78[_0xade3('0x2e')]||0x96;this[_0xade3('0x2f')]=_0x4e8c78[_0xade3('0x2f')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4e8c78['dialNoAnswerRetryFrequency']||0x96;this[_0xade3('0x30')]=_0x4e8c78[_0xade3('0x30')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4e8c78[_0xade3('0x31')]||0x96;this[_0xade3('0x32')]=_0x4e8c78[_0xade3('0x32')]||0x3;this[_0xade3('0x33')]=_0x4e8c78['dialDropRetryFrequency']||0x96;this[_0xade3('0x34')]=_0x4e8c78['dialAbandonedMaxRetry']||0x3;this[_0xade3('0x35')]=_0x4e8c78['dialAbandonedRetryFrequency']||0x96;this[_0xade3('0x36')]=_0x4e8c78[_0xade3('0x36')]||0x3;this['dialMachineRetryFrequency']=_0x4e8c78[_0xade3('0x37')]||0x96;this[_0xade3('0x38')]=_0x4e8c78[_0xade3('0x38')]||0x3;this[_0xade3('0x39')]=_0x4e8c78[_0xade3('0x39')]||0x96;this[_0xade3('0x3a')]=_0x4e8c78['dialGlobalMaxRetry']||0x4;this[_0xade3('0x3b')]=_0x4e8c78[_0xade3('0x3b')]?_0x4e8c78[_0xade3('0x3b')]:undefined;this[_0xade3('0x3c')]=_0x4e8c78[_0xade3('0x3c')]?_0x4e8c78[_0xade3('0x3c')]:undefined;this[_0xade3('0x3d')]=_0x4e8c78[_0xade3('0x3d')]||undefined;this['Interval']=_0x4e8c78['Interval']?_0x4e8c78[_0xade3('0x3e')]:undefined;this[_0xade3('0x3f')]=_0x4e8c78[_0xade3('0x3f')]||_0xade3('0x40');this[_0xade3('0x41')]=_0x4e8c78[_0xade3('0x41')]||undefined;this['dialCutDigit']=_0x4e8c78[_0xade3('0x42')]||undefined;this['strategy']=strategy[_0x4e8c78[_0xade3('0x43')]]||_0xade3('0x44');this['queueStatusComplete']=!![];this[_0xade3('0x45')]=_0x4e8c78['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x4e8c78[_0xade3('0x46')];this['dialAMDGreeting']=_0x4e8c78[_0xade3('0x47')];this['dialAMDAfterGreetingSilence']=_0x4e8c78[_0xade3('0x48')];this[_0xade3('0x49')]=_0x4e8c78[_0xade3('0x49')];this[_0xade3('0x4a')]=_0x4e8c78[_0xade3('0x4a')];this['dialAMDBetweenWordsSilence']=_0x4e8c78[_0xade3('0x4b')];this[_0xade3('0x4c')]=_0x4e8c78[_0xade3('0x4c')];this[_0xade3('0x4d')]=_0x4e8c78[_0xade3('0x4d')];this['dialAMDMaximumWordLength']=_0x4e8c78[_0xade3('0x4e')];this[_0xade3('0x4f')]=0x0;this[_0xade3('0x50')]=0x0;this[_0xade3('0x51')]=_0x4e8c78['timeout'];this[_0xade3('0x52')]=0x0;this[_0xade3('0x53')]=0x0;this[_0xade3('0x54')]=0x0;this[_0xade3('0x55')]=0x0;this[_0xade3('0x56')]=0x0;this[_0xade3('0x57')]=0x0;this[_0xade3('0x58')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xade3('0x59')]=0x0;this[_0xade3('0x5a')]=0x0;this[_0xade3('0x5b')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xade3('0x5c')]=0x0;this[_0xade3('0x5d')]=0x0;this[_0xade3('0x5e')]=undefined;this['startPredictive']=undefined;this[_0xade3('0x5f')]=undefined;this[_0xade3('0x60')]=1.05;this[_0xade3('0x61')]=0x0;this[_0xade3('0x62')]=0x0;this[_0xade3('0x63')]=0x0;this[_0xade3('0x64')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xade3('0x65')]=0x0;this[_0xade3('0x66')]=0x0;this[_0xade3('0x67')]=_0x4e8c78[_0xade3('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x4e8c78['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xade3('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xade3('0x6a')]=0x1;this[_0xade3('0x6b')]=0x0;this[_0xade3('0x6c')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4e8c78[_0xade3('0x6d')]||0x1e;this[_0xade3('0x6e')]=_0x4e8c78[_0xade3('0x6e')]||![];this[_0xade3('0x6f')]=!!_0x4e8c78[_0xade3('0x6f')]||![];this['dialQueueProject2']=_0x4e8c78['dialQueueProject2']||undefined;this[_0xade3('0x70')]=_0x4e8c78[_0xade3('0x70')]||![];this['dialAgiAfterHangupAgent']=_0x4e8c78[_0xade3('0x71')]||![];this[_0xade3('0x9')]=monitorFormat[_0x4e8c78[_0xade3('0x9')]]?monitorFormat[_0x4e8c78[_0xade3('0x9')]]:undefined;this[_0xade3('0x72')]=_0x4e8c78['mandatoryDisposition']||![];this[_0xade3('0x73')]=_0x4e8c78['mandatoryDispositionPause']?_0x4e8c78['mandatoryDispositionPause']:undefined;}module[_0xade3('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 43a89cb..623ba43 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 _0x1014=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x2ce8a5,_0x18378d){var _0x3f6476=function(_0x3241fb){while(--_0x3241fb){_0x2ce8a5['push'](_0x2ce8a5['shift']());}};_0x3f6476(++_0x18378d);}(_0x1014,0x1c7));var _0x4101=function(_0x5068cb,_0x50ea15){_0x5068cb=_0x5068cb-0x0;var _0x12f94d=_0x1014[_0x5068cb];return _0x12f94d;};'use strict';function VtigerAccount(_0x371d21){this['id']=_0x371d21['id']||0x0;this[_0x4101('0x0')]=_0x371d21['name']||'';this[_0x4101('0x1')]=_0x371d21[_0x4101('0x1')]||'';this['accessKey']=_0x371d21[_0x4101('0x2')]||'';this[_0x4101('0x3')]=_0x371d21['remoteUri']||'';this[_0x4101('0x4')]=_0x371d21[_0x4101('0x4')]||'';this[_0x4101('0x5')]=_0x371d21[_0x4101('0x5')]||{};}module[_0x4101('0x6')]=VtigerAccount; \ No newline at end of file +var _0x9aa8=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x5cdd04,_0x37effa){var _0x386350=function(_0x33e1ed){while(--_0x33e1ed){_0x5cdd04['push'](_0x5cdd04['shift']());}};_0x386350(++_0x37effa);}(_0x9aa8,0x73));var _0x89aa=function(_0x3860c8,_0x2a595e){_0x3860c8=_0x3860c8-0x0;var _0x552d30=_0x9aa8[_0x3860c8];return _0x552d30;};'use strict';function VtigerAccount(_0x43594d){this['id']=_0x43594d['id']||0x0;this['name']=_0x43594d[_0x89aa('0x0')]||'';this['username']=_0x43594d[_0x89aa('0x1')]||'';this[_0x89aa('0x2')]=_0x43594d['accessKey']||'';this[_0x89aa('0x3')]=_0x43594d[_0x89aa('0x3')]||'';this[_0x89aa('0x4')]=_0x43594d[_0x89aa('0x4')]||'';this[_0x89aa('0x5')]=_0x43594d[_0x89aa('0x5')]||{};}module[_0x89aa('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 8df8657..151a94d 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 _0xf0e7=['type','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x6be190,_0x25e8dd){var _0x3867df=function(_0x204898){while(--_0x204898){_0x6be190['push'](_0x6be190['shift']());}};_0x3867df(++_0x25e8dd);}(_0xf0e7,0x1e4));var _0x7f0e=function(_0x533437,_0x4d59d1){_0x533437=_0x533437-0x0;var _0x53f4ce=_0xf0e7[_0x533437];return _0x53f4ce;};'use strict';function ZendeskAccount(_0x30dc43){this['id']=_0x30dc43['id']||0x0;this[_0x7f0e('0x0')]=_0x30dc43[_0x7f0e('0x0')]||'';this[_0x7f0e('0x1')]=_0x30dc43['username']||'';this[_0x7f0e('0x2')]=_0x30dc43[_0x7f0e('0x2')]||'';this[_0x7f0e('0x3')]=_0x30dc43[_0x7f0e('0x3')]||'';this[_0x7f0e('0x4')]=_0x30dc43[_0x7f0e('0x4')]||'';this[_0x7f0e('0x5')]=_0x30dc43[_0x7f0e('0x5')]||'';this[_0x7f0e('0x6')]=_0x30dc43[_0x7f0e('0x6')]||'integrationTab';this[_0x7f0e('0x7')]=_0x30dc43['serverUrl']||'';this[_0x7f0e('0x8')]=_0x30dc43[_0x7f0e('0x8')]||{};}module[_0x7f0e('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x96b8=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x28efee,_0x231429){var _0x104ce2=function(_0x1b46a2){while(--_0x1b46a2){_0x28efee['push'](_0x28efee['shift']());}};_0x104ce2(++_0x231429);}(_0x96b8,0x194));var _0x896b=function(_0x5f562e,_0x3280b4){_0x5f562e=_0x5f562e-0x0;var _0x49e12b=_0x96b8[_0x5f562e];return _0x49e12b;};'use strict';function ZendeskAccount(_0x586af0){this['id']=_0x586af0['id']||0x0;this[_0x896b('0x0')]=_0x586af0[_0x896b('0x0')]||'';this[_0x896b('0x1')]=_0x586af0['username']||'';this[_0x896b('0x2')]=_0x586af0['password']||'';this[_0x896b('0x3')]=_0x586af0[_0x896b('0x3')]||'';this[_0x896b('0x4')]=_0x586af0[_0x896b('0x4')]||'';this['authType']=_0x586af0[_0x896b('0x5')]||'';this[_0x896b('0x6')]=_0x586af0['type']||_0x896b('0x7');this[_0x896b('0x8')]=_0x586af0[_0x896b('0x8')]||'';this[_0x896b('0x9')]=_0x586af0['Configurations']||{};}module[_0x896b('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 80c240f..961b279 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 _0xc728=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x381eab,_0x5f1e7a){var _0x3e8f04=function(_0x4e998f){while(--_0x4e998f){_0x381eab['push'](_0x381eab['shift']());}};_0x3e8f04(++_0x5f1e7a);}(_0xc728,0xc4));var _0x8c72=function(_0x3ef25c,_0x466635){_0x3ef25c=_0x3ef25c-0x0;var _0x1faf71=_0xc728[_0x3ef25c];return _0x1faf71;};'use strict';function ZohoAccount(_0x34dff4){this['id']=_0x34dff4['id']||0x0;this['name']=_0x34dff4[_0x8c72('0x0')]||'';this[_0x8c72('0x1')]=_0x34dff4[_0x8c72('0x1')]||'';this[_0x8c72('0x2')]=_0x34dff4['host']||'';this[_0x8c72('0x3')]=_0x34dff4[_0x8c72('0x3')]||'';this['clientId']=_0x34dff4[_0x8c72('0x4')]||'';this['clientSecret']=_0x34dff4[_0x8c72('0x5')]||'';this[_0x8c72('0x6')]=_0x34dff4[_0x8c72('0x6')]||'';this['code']=_0x34dff4[_0x8c72('0x7')]||'';this['refreshToken']=_0x34dff4[_0x8c72('0x8')]||'';this[_0x8c72('0x9')]=_0x34dff4[_0x8c72('0x9')]||{};}module[_0x8c72('0xa')]=ZohoAccount; \ No newline at end of file +var _0x0777=['Configurations','exports','name','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x5bd82e,_0x26915b){var _0x38a21f=function(_0x3917f6){while(--_0x3917f6){_0x5bd82e['push'](_0x5bd82e['shift']());}};_0x38a21f(++_0x26915b);}(_0x0777,0xc0));var _0x7077=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0777[_0x31e29a];return _0x32d892;};'use strict';function ZohoAccount(_0x1a6b66){this['id']=_0x1a6b66['id']||0x0;this['name']=_0x1a6b66[_0x7077('0x0')]||'';this['description']=_0x1a6b66['description']||'';this[_0x7077('0x1')]=_0x1a6b66['host']||'';this['zone']=_0x1a6b66[_0x7077('0x2')]||'';this[_0x7077('0x3')]=_0x1a6b66['clientId']||'';this[_0x7077('0x4')]=_0x1a6b66[_0x7077('0x4')]||'';this[_0x7077('0x5')]=_0x1a6b66['serverUrl']||'';this[_0x7077('0x6')]=_0x1a6b66[_0x7077('0x6')]||'';this[_0x7077('0x7')]=_0x1a6b66[_0x7077('0x7')]||'';this[_0x7077('0x8')]=_0x1a6b66['Configurations']||{};}module[_0x7077('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 abe3d4b..cd9df23 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 _0xb16c=['util','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number'];(function(_0x112dce,_0x4ab782){var _0x2c51f5=function(_0x2d6ecc){while(--_0x2d6ecc){_0x112dce['push'](_0x112dce['shift']());}};_0x2c51f5(++_0x4ab782);}(_0xb16c,0x171));var _0xcb16=function(_0x13dd34,_0x448225){_0x13dd34=_0x13dd34-0x0;var _0x47dcc6=_0xb16c[_0x13dd34];return _0x47dcc6;};'use strict';var util=require(_0xcb16('0x0'));var _=require('lodash');var moment=require(_0xcb16('0x1'));function checkNameSurname(_0x322e1e,_0x3addfd,_0xd671df){var _0x750363='';if(!_[_0xcb16('0x2')](_0x3addfd)&&'string'===typeof _0x3addfd){_0x750363+=_0x3addfd;}if(!_[_0xcb16('0x2')](_0xd671df)&&_0xcb16('0x3')===typeof _0xd671df){_0x750363+='\x20'+_0xd671df;}if(_0x750363!==''){return _0x750363;}return _0x322e1e;}function Action(_0x21fbb1,_0x4a2778,_0x91dc16,_0x216eab,_0x39c054){this[_0xcb16('0x4')]=_0x91dc16||undefined;this[_0xcb16('0x5')]=_0x21fbb1['id'];this[_0xcb16('0x6')]=_0x4a2778['name'];this[_0xcb16('0x7')]=_0x4a2778[_0xcb16('0x7')];this[_0xcb16('0x8')]=_0xcb16('0x6');this[_0xcb16('0x9')]=![];this[_0xcb16('0xa')]=_[_0xcb16('0x2')](_0x21fbb1[_0xcb16('0xb')])?undefined:_0x21fbb1['Agent']['name'];this['channelAgent']=this[_0xcb16('0xa')]?util['format']('SIP/%s',this[_0xcb16('0xa')]):_0x216eab||undefined;this[_0xcb16('0xc')]=checkNameSurname(_0x21fbb1[_0xcb16('0xd')][_0xcb16('0xe')],_0x21fbb1['Contact'][_0xcb16('0xf')],_0x21fbb1[_0xcb16('0xd')][_0xcb16('0x10')]);this[_0xcb16('0x11')]=_0x21fbb1[_0xcb16('0x11')]||![];this[_0xcb16('0x12')]=_0x21fbb1[_0xcb16('0xd')]['phone'];this['scheduledat']=_0x21fbb1[_0xcb16('0x13')];this[_0xcb16('0x14')]=_0x21fbb1[_0xcb16('0x14')]||0x0;this[_0xcb16('0x15')]=_0x21fbb1[_0xcb16('0x15')]||0x0;this[_0xcb16('0x16')]=_0x21fbb1[_0xcb16('0x16')]||0x0;this[_0xcb16('0x17')]=(_0x21fbb1[_0xcb16('0x14')]||0x0)+(_0x21fbb1[_0xcb16('0x15')]||0x0)+(_0x21fbb1[_0xcb16('0x16')]||0x0)+(_0x21fbb1[_0xcb16('0x18')]||0x0)+(_0x21fbb1[_0xcb16('0x19')]||0x0)+(_0x21fbb1[_0xcb16('0x1a')]||0x0)+(_0x21fbb1[_0xcb16('0x1b')]||0x0)+(_0x21fbb1[_0xcb16('0x1c')]||0x0);this[_0xcb16('0x18')]=_0x21fbb1['countnosuchnumberretry']||0x0;this[_0xcb16('0x19')]=_0x21fbb1[_0xcb16('0x19')]||0x0;this[_0xcb16('0x1a')]=_0x21fbb1['countabandonedretry']||0x0;this[_0xcb16('0x1b')]=_0x21fbb1['countmachineretry']||0x0;this[_0xcb16('0x1c')]=_0x21fbb1['countagentrejectretry']||0x0;this['callback']=_0x21fbb1[_0xcb16('0x1d')];this['callbackuniqueid']=_0x21fbb1['callbackuniqueid'];this[_0xcb16('0x1e')]=_0x21fbb1[_0xcb16('0x1e')];this['recallme']=_0x21fbb1[_0xcb16('0x1f')];this[_0xcb16('0x20')]=_0x21fbb1[_0xcb16('0x20')];this[_0xcb16('0x21')]=_0x21fbb1[_0xcb16('0x21')];this['UserId']=_['isNil'](_0x21fbb1[_0xcb16('0xb')])?_0x21fbb1['UserId']:_0x21fbb1[_0xcb16('0xb')]['id'];this[_0xcb16('0x22')]=_0x21fbb1[_0xcb16('0x22')];this['originatecalleridnum']='';this[_0xcb16('0x23')]='';}Action[_0xcb16('0x24')][_0xcb16('0x25')]=function(){return util[_0xcb16('0x26')](_0xcb16('0x27'),this[_0xcb16('0xc')],this[_0xcb16('0x28')]);};module['exports']=Action; \ No newline at end of file +var _0x4753=['phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','lodash','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','Contact'];(function(_0x2daeeb,_0x44a31a){var _0x3af2e9=function(_0x28c91f){while(--_0x28c91f){_0x2daeeb['push'](_0x2daeeb['shift']());}};_0x3af2e9(++_0x44a31a);}(_0x4753,0xdb));var _0x3475=function(_0x4ad62d,_0x48c76d){_0x4ad62d=_0x4ad62d-0x0;var _0x33ceab=_0x4753[_0x4ad62d];return _0x33ceab;};'use strict';var util=require('util');var _=require(_0x3475('0x0'));var moment=require('moment');function checkNameSurname(_0x10dc25,_0x3170b8,_0x359dac){var _0x38d2e3='';if(!_[_0x3475('0x1')](_0x3170b8)&&'string'===typeof _0x3170b8){_0x38d2e3+=_0x3170b8;}if(!_[_0x3475('0x1')](_0x359dac)&&_0x3475('0x2')===typeof _0x359dac){_0x38d2e3+='\x20'+_0x359dac;}if(_0x38d2e3!==''){return _0x38d2e3;}return _0x10dc25;}function Action(_0x4da93c,_0xa76ffc,_0x25c8a4,_0x4bd804,_0x28ea15){this[_0x3475('0x3')]=_0x25c8a4||undefined;this[_0x3475('0x4')]=_0x4da93c['id'];this[_0x3475('0x5')]=_0xa76ffc['name'];this[_0x3475('0x6')]=_0xa76ffc[_0x3475('0x6')];this[_0x3475('0x7')]=_0x3475('0x5');this[_0x3475('0x8')]=![];this[_0x3475('0x9')]=_[_0x3475('0x1')](_0x4da93c['Agent'])?undefined:_0x4da93c[_0x3475('0xa')][_0x3475('0xb')];this[_0x3475('0xc')]=this['membername']?util[_0x3475('0xd')](_0x3475('0xe'),this[_0x3475('0x9')]):_0x4bd804||undefined;this['calleridname']=checkNameSurname(_0x4da93c[_0x3475('0xf')][_0x3475('0x10')],_0x4da93c[_0x3475('0xf')][_0x3475('0x11')],_0x4da93c[_0x3475('0xf')][_0x3475('0x12')]);this[_0x3475('0x13')]=_0x4da93c[_0x3475('0x13')]||![];this[_0x3475('0x14')]=_0x4da93c['Contact'][_0x3475('0x10')];this[_0x3475('0x15')]=_0x4da93c[_0x3475('0x15')];this['countbusyretry']=_0x4da93c[_0x3475('0x16')]||0x0;this[_0x3475('0x17')]=_0x4da93c[_0x3475('0x17')]||0x0;this[_0x3475('0x18')]=_0x4da93c['countnoanswerretry']||0x0;this[_0x3475('0x19')]=(_0x4da93c[_0x3475('0x16')]||0x0)+(_0x4da93c[_0x3475('0x17')]||0x0)+(_0x4da93c[_0x3475('0x18')]||0x0)+(_0x4da93c[_0x3475('0x1a')]||0x0)+(_0x4da93c[_0x3475('0x1b')]||0x0)+(_0x4da93c[_0x3475('0x1c')]||0x0)+(_0x4da93c[_0x3475('0x1d')]||0x0)+(_0x4da93c[_0x3475('0x1e')]||0x0);this['countnosuchnumberretry']=_0x4da93c[_0x3475('0x1a')]||0x0;this['countdropretry']=_0x4da93c[_0x3475('0x1b')]||0x0;this['countabandonedretry']=_0x4da93c[_0x3475('0x1c')]||0x0;this[_0x3475('0x1d')]=_0x4da93c[_0x3475('0x1d')]||0x0;this['countagentrejectretry']=_0x4da93c['countagentrejectretry']||0x0;this[_0x3475('0x1f')]=_0x4da93c[_0x3475('0x1f')];this['callbackuniqueid']=_0x4da93c[_0x3475('0x20')];this[_0x3475('0x21')]=_0x4da93c[_0x3475('0x21')];this[_0x3475('0x22')]=_0x4da93c[_0x3475('0x22')];this[_0x3475('0x23')]=_0x4da93c['ContactId'];this[_0x3475('0x24')]=_0x4da93c[_0x3475('0x24')];this[_0x3475('0x25')]=_['isNil'](_0x4da93c[_0x3475('0xa')])?_0x4da93c[_0x3475('0x25')]:_0x4da93c['Agent']['id'];this[_0x3475('0x26')]=_0x4da93c[_0x3475('0x26')];this[_0x3475('0x27')]='';this[_0x3475('0x28')]='';}Action[_0x3475('0x29')][_0x3475('0x2a')]=function(){return util['format'](_0x3475('0x2b'),this[_0x3475('0x2c')],this[_0x3475('0x2d')]);};module[_0x3475('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 0730657..d7a1a4f 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 _0x0ba7=['merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','channel','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','sumBillable','sumHoldTime','talking','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','startProgressive','Trunk','active','callerid','Interval','stringify','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','message','\x20is\x20not\x20active','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','catch','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','then','length','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentcomplete','complete','answered','decrementTalkink','[16]','Answer','createCustomerFinal','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','outboundRejectCallsDay','AgentReject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','status','unmonitored','execRun','unlock','unlockContact','recallme','isValid','Contact.phone','[Preview][checkIsBlackList]','validateContact','Agent','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','Contact','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables'];(function(_0x288f2b,_0x29706b){var _0x18d2c2=function(_0x1e7874){while(--_0x1e7874){_0x288f2b['push'](_0x288f2b['shift']());}};_0x18d2c2(++_0x29706b);}(_0x0ba7,0x16d));var _0x70ba=function(_0x3edee7,_0x5ab02d){_0x3edee7=_0x3edee7-0x0;var _0x1aa10c=_0x0ba7[_0x3edee7];return _0x1aa10c;};'use strict';var util=require(_0x70ba('0x0'));var _=require('lodash');var BPromise=require(_0x70ba('0x1'));var uuid=require(_0x70ba('0x2'));var moment=require(_0x70ba('0x3'));var md5=require(_0x70ba('0x4'));var Redis=require('ioredis');var config=require(_0x70ba('0x5'));var logger=require(_0x70ba('0x6'))(_0x70ba('0x7'));var loggerAction=require(_0x70ba('0x6'))(_0x70ba('0x8'));var ami=require(_0x70ba('0x9'));var rpcDb=require(_0x70ba('0xa'));var Action=require(_0x70ba('0xb'));var ut=require(_0x70ba('0xc'));config[_0x70ba('0xd')]=_[_0x70ba('0xe')](config[_0x70ba('0xd')],{'host':_0x70ba('0xf'),'port':0x18eb});var io=require(_0x70ba('0x10'))(new Redis(config[_0x70ba('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x70ba('0x11')]=function(_0x4de64d){this[_0x70ba('0x12')]=this[_0x70ba('0x12')]?this[_0x70ba('0x12')][_0x70ba('0x13')](_0x4de64d):_0x4de64d();};function Preview(_0x593fe9){this['sequence']=new Sequence();this[_0x70ba('0x14')]=_0x593fe9['voiceQueues'];this[_0x70ba('0x15')]=_0x593fe9['trunks'];this[_0x70ba('0x16')]={};this[_0x70ba('0x17')]=_0x593fe9['agents'];this[_0x70ba('0x18')]=0x0;ami['on']('originateresponse',this[_0x70ba('0x19')][_0x70ba('0x1a')](this));ami['on'](_0x70ba('0x1b'),this[_0x70ba('0x1c')][_0x70ba('0x1a')](this));ami['on'](_0x70ba('0x1d'),this[_0x70ba('0x1e')][_0x70ba('0x1a')](this));ami['on'](_0x70ba('0x1f'),this[_0x70ba('0x20')][_0x70ba('0x1a')](this));ami['on'](_0x70ba('0x21'),this[_0x70ba('0x22')][_0x70ba('0x1a')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x70ba('0x23'),this[_0x70ba('0x24')][_0x70ba('0x1a')](this));ami['on'](_0x70ba('0x25'),this[_0x70ba('0x26')][_0x70ba('0x1a')](this));this[_0x70ba('0x27')](this[_0x70ba('0x14')]);}function emit(_0x415879,_0x40b82c,_0x26c039){io['to'](_0x415879)[_0x70ba('0x28')](_0x40b82c,_0x26c039);}function emitCampaignPreview(_0x2a1328){if(_0x2a1328[_0x70ba('0x29')]===_0x70ba('0x2a')){var _0x5ebe9d={'id':_0x2a1328['id'],'name':_0x2a1328[_0x70ba('0x2b')],'strategy':_0x2a1328[_0x70ba('0x2c')],'answered':_0x2a1328['answered'],'available':_0x2a1328[_0x70ba('0x2d')],'loggedIn':_0x2a1328['loggedIn'],'pTalking':_0x2a1328['pTalking'],'sumBillable':_0x2a1328[_0x70ba('0x2e')],'sumDuration':_0x2a1328['sumDuration'],'sumHoldTime':_0x2a1328[_0x70ba('0x2f')]||0x0,'talking':_0x2a1328[_0x70ba('0x30')],'total':_0x2a1328['total'],'type':_0x2a1328[_0x70ba('0x29')],'unmanaged':_0x2a1328['unmanaged'],'abandoned':_0x2a1328['abandoned'],'waiting':_0x2a1328[_0x70ba('0x31')],'loggedInDb':_0x2a1328['loggedInDb'],'dialActive':_0x2a1328[_0x70ba('0x32')],'dialMethod':_0x2a1328[_0x70ba('0x33')],'dialOriginateCallerIdName':_0x2a1328[_0x70ba('0x34')],'dialOriginateCallerIdNumber':_0x2a1328[_0x70ba('0x35')],'dialOriginateTimeout':_0x2a1328[_0x70ba('0x36')],'dialPrefix':_0x2a1328[_0x70ba('0x37')],'outboundAnswerAgiCallsDay':_0x2a1328['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2a1328[_0x70ba('0x38')],'outboundBlacklistCallsDay':_0x2a1328[_0x70ba('0x39')],'outboundBusyCallsDay':_0x2a1328[_0x70ba('0x3a')],'outboundCongestionCallsDay':_0x2a1328['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2a1328[_0x70ba('0x3b')],'outboundDropCallsDayCallersExit':_0x2a1328['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2a1328['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2a1328['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2a1328[_0x70ba('0x3c')],'outboundOriginateFailureCallsDay':_0x2a1328[_0x70ba('0x3d')],'outboundReCallsDay':_0x2a1328['outboundReCallsDay'],'outboundRejectCallsDay':_0x2a1328['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2a1328[_0x70ba('0x3e')],'outboundAbandonedCallsDay':_0x2a1328['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x2a1328[_0x70ba('0x3f')],'predictiveIntervalAvgHoldtime':_0x2a1328[_0x70ba('0x40')],'predictiveIntervalAvgTalktime':_0x2a1328[_0x70ba('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x2a1328[_0x70ba('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x2a1328[_0x70ba('0x43')],'predictiveIntervalErlangCalls':_0x2a1328[_0x70ba('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x2a1328[_0x70ba('0x45')],'predictiveIntervalHitRate':_0x2a1328[_0x70ba('0x46')],'predictiveIntervalMultiplicativeFactor':_0x2a1328[_0x70ba('0x47')],'predictiveIntervalPauses':_0x2a1328[_0x70ba('0x48')],'predictiveIntervalAvailable':_0x2a1328[_0x70ba('0x49')],'predictiveIntervalTotalCalls':_0x2a1328['predictiveIntervalTotalCalls'],'message':_0x2a1328['message'],'originated':_0x2a1328[_0x70ba('0x4a')],'erlangCalls':_0x2a1328[_0x70ba('0x4b')],'erlangCallToSecond':_0x2a1328[_0x70ba('0x4c')],'erlangAbandonmentRate':_0x2a1328['erlangAbandonmentRate'],'erlangBusyFactor':_0x2a1328['erlangBusyFactor'],'startPredictive':_0x2a1328['startPredictive'],'startProgressive':_0x2a1328[_0x70ba('0x4d')]};if(_0x2a1328[_0x70ba('0x4e')]){_0x5ebe9d[_0x70ba('0x4e')]={'id':_0x2a1328['Trunk']['id'],'name':_0x2a1328[_0x70ba('0x4e')]['name'],'active':_0x2a1328['Trunk'][_0x70ba('0x4f')],'callerid':_0x2a1328['Trunk'][_0x70ba('0x50')]};}if(_0x2a1328[_0x70ba('0x51')]){_0x5ebe9d['Interval']={'id':_0x2a1328[_0x70ba('0x51')]['id'],'name':_0x2a1328[_0x70ba('0x51')][_0x70ba('0x2b')]};}var _0x48328e=md5(JSON[_0x70ba('0x52')](_0x5ebe9d));if(_0x2a1328[_0x70ba('0x4')]!==_0x48328e){_0x2a1328[_0x70ba('0x4')]=_0x48328e;emit(util[_0x70ba('0x53')]('voice:queue:%s',_0x5ebe9d[_0x70ba('0x2b')]),'voice_queue:save',_0x5ebe9d);}}}function emitVoiceQueueChannelRemove(_0x17707a){logger[_0x70ba('0x54')](_0x70ba('0x55'),JSON[_0x70ba('0x52')](_0x17707a));emit(util[_0x70ba('0x53')](_0x70ba('0x56'),_0x17707a[_0x70ba('0x2b')]),'voice_queue_channel:remove',_0x17707a);io[_0x70ba('0x28')](_0x70ba('0x57'),_0x17707a);}function notSendMessagesQueue(_0x31e713){if(_0x31e713[_0x70ba('0x58')]){if(_0x31e713[_0x70ba('0x4a')]===0x0&&_0x31e713[_0x70ba('0x59')]===0x0){_0x31e713['sendMessageOneNotActive']=![];_0x31e713[_0x70ba('0x2d')]=0x0;_0x31e713[_0x70ba('0x5a')]=0x0;_0x31e713[_0x70ba('0x5b')]='NOT_ACTIVE';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x31e713[_0x70ba('0x2b')]+_0x70ba('0x5c'));}else{_0x31e713[_0x70ba('0x5b')]='IS_DISACTIVED';ut[_0x70ba('0x5d')](_0x70ba('0x5e'),_0x31e713[_0x70ba('0x2b')]+_0x70ba('0x5f'));}emitCampaignPreview(_0x31e713);}}Preview[_0x70ba('0x60')]['loopCampaigns']=function(){var _0x5ee74c=this;setInterval(function(){_0x5ee74c[_0x70ba('0x61')]();},0x7cf);};Preview[_0x70ba('0x60')][_0x70ba('0x61')]=function(){var _0x5a1edb=this['campaignsPreview'];this[_0x70ba('0x18')]+=0x1;for(var _0x4d6467 in _0x5a1edb){if(_0x5a1edb[_0x70ba('0x62')](_0x4d6467)&&(_0x5a1edb[_0x4d6467][_0x70ba('0x33')]===_0x70ba('0x7')||_0x5a1edb[_0x4d6467][_0x70ba('0x33')]===_0x70ba('0x63'))&&_0x5a1edb[_0x4d6467]['type']===_0x70ba('0x2a')){if(this[_0x70ba('0x18')]>0x7){this[_0x70ba('0x18')]=0x0;this[_0x70ba('0x64')]();}}if(_0x5a1edb[_0x70ba('0x62')](_0x4d6467)&&_0x5a1edb[_0x4d6467][_0x70ba('0x33')]===_0x70ba('0x7')&&_0x5a1edb[_0x4d6467][_0x70ba('0x29')]===_0x70ba('0x2a')){if(_0x5a1edb[_0x4d6467][_0x70ba('0x32')]){this[_0x70ba('0x65')](_0x5a1edb[_0x4d6467]);if(_0x5a1edb[_0x4d6467][_0x70ba('0x66')])this[_0x70ba('0x67')](_0x5a1edb[_0x4d6467]);}else{notSendMessagesQueue(_0x5a1edb[_0x4d6467]);}}}};Preview[_0x70ba('0x60')][_0x70ba('0x68')]=function(_0x529e38){var _0xd7638f=this;this[_0x70ba('0x69')]['enqueue'](function(){if(!_[_0x70ba('0x6a')](_0xd7638f[_0x70ba('0x16')][_0x529e38])){loggerAction[_0x70ba('0x54')](_0x70ba('0x6b'),_0x529e38,_0x70ba('0x6c'),_0xd7638f[_0x70ba('0x16')][_0x529e38][_0x70ba('0x6d')],'originated:\x20',JSON[_0x70ba('0x52')](_0xd7638f[_0x70ba('0x14')][_0xd7638f[_0x70ba('0x16')][_0x529e38][_0x70ba('0x6d')]][_0x70ba('0x4a')]),_0x70ba('0x6e'),JSON[_0x70ba('0x52')](_0xd7638f[_0x70ba('0x14')][_0xd7638f[_0x70ba('0x16')][_0x529e38][_0x70ba('0x6d')]][_0x70ba('0x59')]),JSON[_0x70ba('0x52')](_0xd7638f[_0x70ba('0x16')][_0x529e38][_0x70ba('0x6f')]),JSON[_0x70ba('0x52')](_[_0x70ba('0x70')](_0xd7638f[_0x70ba('0x16')][_0x529e38],['contactId',_0x70ba('0x71'),_0x70ba('0x72'),_0x70ba('0x73')])));return ami[_0x70ba('0x74')]({'action':'status','channel':_0xd7638f['actions'][_0x529e38]['channel']})[_0x70ba('0x75')](function(_0x32b54f){if(_0x32b54f['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0xd7638f[_0x70ba('0x16')][_0x529e38]){ut[_0x70ba('0x76')](_0xd7638f[_0x70ba('0x14')][_0xd7638f[_0x70ba('0x16')][_0x529e38][_0x70ba('0x6d')]],_0x70ba('0x77'));if(_0xd7638f[_0x70ba('0x16')][_0x529e38]['dialAnswer']===!![]){ut['decrementTalkink'](_0xd7638f[_0x70ba('0x14')][_0xd7638f[_0x70ba('0x16')][_0x529e38][_0x70ba('0x6d')]],_0x70ba('0x77'));ut['loggerError'](_0x70ba('0x78')+_0x529e38,_0xd7638f[_0x70ba('0x16')][_0x529e38]['queue']);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x529e38,_0xd7638f['actions'][_0x529e38][_0x70ba('0x6d')]);delete _0xd7638f[_0x70ba('0x16')][_0x529e38];}},0x2328);}});}});};Preview[_0x70ba('0x60')]['clearZombieChannels']=function(){var _0x30a1b3=this;loggerAction[_0x70ba('0x54')](_0x70ba('0x79'),_['size'](this[_0x70ba('0x16')]));for(var _0x7ebcc5 in this['actions']){if(_0x30a1b3['actions'][_0x70ba('0x62')](_0x7ebcc5)){_0x30a1b3[_0x70ba('0x68')](_0x7ebcc5);}}};Preview[_0x70ba('0x60')][_0x70ba('0x67')]=function(_0x10e824){var _0x3717a0=this;rpcDb[_0x70ba('0x7a')](_0x10e824['id'],ut['agentReadyId'](this[_0x70ba('0x17')]))[_0x70ba('0x7b')](function(_0x4de412){if(!_['isNil'](_0x4de412)){for(var _0x137b7d=0x0;_0x137b7d<_0x4de412[_0x70ba('0x7c')];_0x137b7d+=0x1){if(ut['getDiff'](_0x4de412[_0x137b7d]['scheduledat'])<_0x10e824[_0x70ba('0x7d')]*0x3c){if(_0x4de412[_0x137b7d]['Agent']&&!_0x4de412[_0x137b7d]['Agent'][_0x70ba('0x7e')]){_0x3717a0[_0x70ba('0x7f')](_0x4de412[_0x137b7d]['id'])[_0x70ba('0x7b')](ut[_0x70ba('0x80')](_0x70ba('0x81')))[_0x70ba('0x75')](ut[_0x70ba('0x80')]('[RecallMe]'));}else{rpcDb[_0x70ba('0x82')](_0x4de412[_0x137b7d]['id']);}}else{var _0x46b32a=new Action(_0x4de412[_0x137b7d],_0x10e824);_0x46b32a[_0x70ba('0x83')]=moment()[_0x70ba('0x53')](_0x70ba('0x84'));_0x10e824[_0x70ba('0x85')]+=0x1;ut['logCustomer'](_0x46b32a,0x17,_0x70ba('0x86'));if(_0x10e824['dialRecallInQueue']){rpcDb[_0x70ba('0x87')](ut['createBody'](_0x4de412[_0x137b7d]));rpcDb[_0x70ba('0x88')](_0x46b32a,_0x70ba('0x89'));}else{ut[_0x70ba('0x8a')](_0x46b32a,0x16,_0x70ba('0x8b'));rpcDb[_0x70ba('0x88')](_0x46b32a,_0x70ba('0x8c'));rpcDb['createCustomerFinal'](_0x46b32a,_0x70ba('0x8c'));}}}}})['catch'](ut['logger2'](_0x70ba('0x8d')));};Preview[_0x70ba('0x60')]['setMessage']=function(_0x208333){_0x208333['sendMessageOneNotActive']=!![];if(ut[_0x70ba('0x8e')](_0x208333[_0x70ba('0x8f')])){_0x208333[_0x70ba('0x5b')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x70ba('0x90')](_0x208333['dialActive'])){_0x208333[_0x70ba('0x5b')]='NOT_ACTIVE';}else if(!this[_0x70ba('0x91')](_0x208333[_0x70ba('0x4e')])){if(!this[_0x70ba('0x91')](_0x208333[_0x70ba('0x92')])){_0x208333['message']=_0x70ba('0x93');}else{_0x208333['message']=_0x70ba('0x94');}}else{_0x208333[_0x70ba('0x5b')]=_0x70ba('0x94');}emitCampaignPreview(_0x208333);};Preview[_0x70ba('0x60')]['callProgressDetectingCustomer']=function(_0x101c11,_0x90d90c,_0x3a2132){var _0x353918=this;var _0x14c761=this[_0x70ba('0x16')][_0x90d90c];var _0x2f3b29=this[_0x70ba('0x14')][_0x14c761['queue']];var _0x8b243b;if(_0x2f3b29){switch(_0x3a2132){case'1':_0x2f3b29[_0x70ba('0x3c')]+=0x1;_0x14c761[_0x70ba('0x95')]+=0x1;_0x14c761[_0x70ba('0x96')]=ut[_0x70ba('0x97')](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0x0,_0x70ba('0x98'));ami['emit'](_0x70ba('0x99'),ut[_0x70ba('0x9a')](_0x14c761,_0x70ba('0x9b')));rpcDb[_0x70ba('0x88')](_0x14c761,_0x70ba('0x9c'));if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0xf,'Global');rpcDb['createCustomerFinal'](_0x8b243b,_0x70ba('0x9f'));}else{if(_0x14c761[_0x70ba('0x95')]>=_0x2f3b29[_0x70ba('0xa0')]){rpcDb['createCustomerFinal'](_0x14c761,_0x70ba('0x9f'));}else{rpcDb[_0x70ba('0xa1')](ut[_0x70ba('0xa2')](_0x14c761,'countnosuchnumberretry',_0x2f3b29[_0x70ba('0xa3')]),_0x14c761[_0x70ba('0xa4')],_0x14c761[_0x70ba('0xa5')]);}}delete this[_0x70ba('0x16')][_0x101c11[_0x70ba('0xa6')]];break;case _0x70ba('0xa7'):var _0x22e520=moment()['format'](_0x70ba('0x84'));_0x14c761['responsetime']=_0x22e520;_0x14c761['answertime']=_0x22e520;_0x14c761[_0x70ba('0x6f')]=!![];_0x2f3b29[_0x70ba('0x59')]+=0x1;logger[_0x70ba('0x54')](_0x70ba('0xa8'),_0x14c761[_0x70ba('0xa9')],_0x70ba('0xaa'),_0x2f3b29[_0x70ba('0x2b')],_0x70ba('0x6e'),_0x2f3b29['pTalking']);ami[_0x70ba('0x28')](_0x70ba('0xab'),ut[_0x70ba('0x9a')](_0x14c761,'connect',this['campaignsPreview'][_0x14c761['queue']]));if(_0x2f3b29[_0x70ba('0xac')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x14c761));}break;case'16':ami[_0x70ba('0x28')](_0x70ba('0xad'),ut[_0x70ba('0x9a')](_0x14c761,_0x70ba('0xae'),this[_0x70ba('0x14')][_0x14c761['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x14c761,_0x70ba('0xae')));_0x2f3b29[_0x70ba('0x38')]+=0x1;_0x2f3b29['total']+=0x1;_0x2f3b29[_0x70ba('0xaf')]+=0x1;ut[_0x70ba('0xb0')](_0x2f3b29,_0x70ba('0xb1'));_0x14c761['countglobal']=ut[_0x70ba('0x97')](_0x14c761);ut['logCustomer'](_0x14c761,0x4,_0x70ba('0xb2'));rpcDb[_0x70ba('0x88')](_0x14c761,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x70ba('0xb3')](_0x14c761,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x70ba('0xb4')](_0x14c761);_0x2f3b29[_0x70ba('0xb5')]+=_0x14c761['talktime'];_0x2f3b29[_0x70ba('0x2e')]+=_0x14c761[_0x70ba('0xb6')];logger[_0x70ba('0x54')](_0x70ba('0xb7'),_0x14c761[_0x70ba('0xa9')],_0x70ba('0xaa'),_0x2f3b29[_0x70ba('0x2b')],_0x70ba('0x6e'),_0x2f3b29[_0x70ba('0x59')]);delete this[_0x70ba('0x16')][_0x101c11['linkedid']];break;case _0x70ba('0xb8'):_0x2f3b29[_0x70ba('0x3a')]+=0x1;_0x14c761[_0x70ba('0xb9')]+=0x1;_0x14c761[_0x70ba('0x96')]=ut['totalGlobal'](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0x5,'Busy');ami[_0x70ba('0x28')]('custom:agentbusy',ut[_0x70ba('0x9a')](_0x14c761,_0x70ba('0xba')));rpcDb['createCustomerHistory'](_0x14c761,_0x70ba('0xbb'));if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0xf,_0x70ba('0xbc'));rpcDb[_0x70ba('0xb3')](_0x8b243b,_0x70ba('0xbd'));}else{if(_0x14c761[_0x70ba('0xb9')]>=_0x2f3b29['dialBusyMaxRetry']){rpcDb[_0x70ba('0xb3')](_0x14c761,_0x70ba('0xbb'));}else{rpcDb[_0x70ba('0xa1')](ut[_0x70ba('0xa2')](_0x14c761,_0x70ba('0xb9'),_0x2f3b29[_0x70ba('0xbe')]),_0x14c761[_0x70ba('0xa4')],_0x14c761[_0x70ba('0xa5')]);}}break;case'NOANSWER':_0x2f3b29[_0x70ba('0xbf')]+=0x1;_0x14c761[_0x70ba('0xc0')]+=0x1;_0x14c761[_0x70ba('0x96')]=ut['totalGlobal'](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0x3,_0x70ba('0xc1'));ami[_0x70ba('0x28')]('custom:agentnoanswer',ut['buildObj'](_0x14c761,_0x70ba('0xc2')));rpcDb['createCustomerHistory'](_0x14c761,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0xf,_0x70ba('0xbc'));rpcDb[_0x70ba('0xb3')](_0x8b243b,_0x70ba('0xc3'));}else{if(_0x14c761['countnoanswerretry']>=_0x2f3b29['dialNoAnswerMaxRetry']){rpcDb[_0x70ba('0xb3')](_0x14c761,_0x70ba('0xc4'));}else{rpcDb[_0x70ba('0xa1')](ut[_0x70ba('0xa2')](_0x14c761,'countnoanswerretry',_0x2f3b29[_0x70ba('0xc5')]),_0x14c761[_0x70ba('0xa4')],_0x14c761[_0x70ba('0xa5')]);}}break;case _0x70ba('0xc6'):_0x2f3b29[_0x70ba('0xc7')]+=0x1;_0x14c761[_0x70ba('0xc8')]+=0x1;_0x14c761[_0x70ba('0x96')]=ut[_0x70ba('0x97')](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0x8,_0x70ba('0xc9'));ami[_0x70ba('0x28')](_0x70ba('0xca'),ut[_0x70ba('0x9a')](_0x14c761,_0x70ba('0xcb')));rpcDb['createCustomerHistory'](_0x14c761,_0x70ba('0xcc'));if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut['cloneAction'](_0x14c761,0xf,'Global');rpcDb['createCustomerFinal'](_0x8b243b,_0x70ba('0xcd'));}else{if(_0x14c761[_0x70ba('0xc8')]>=_0x2f3b29[_0x70ba('0xce')]){rpcDb[_0x70ba('0xb3')](_0x14c761,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x70ba('0xa1')](ut[_0x70ba('0xa2')](_0x14c761,_0x70ba('0xc8'),_0x2f3b29[_0x70ba('0xbe')]),_0x14c761['unlockAgent'],_0x14c761['activeContact']);}}break;case'CANCEL':_0x2f3b29[_0x70ba('0xcf')]+=0x1;_0x14c761['countagentrejectretry']+=0x1;_0x14c761[_0x70ba('0x96')]=ut['totalGlobal'](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0x14,_0x70ba('0xd0'));ami['emit']('custom:agentreject',ut[_0x70ba('0x9a')](_0x14c761,'agentreject'));rpcDb['createCustomerHistory'](_0x14c761,_0x70ba('0xd1'));if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0x14,_0x70ba('0xd0'));rpcDb[_0x70ba('0xb3')](_0x8b243b,_0x70ba('0xd2'));}else{if(_0x14c761[_0x70ba('0xd3')]>=_0x2f3b29[_0x70ba('0xd4')]){rpcDb[_0x70ba('0xb3')](_0x14c761,_0x70ba('0xd2'));}else{rpcDb[_0x70ba('0xa1')](ut[_0x70ba('0xa2')](_0x14c761,_0x70ba('0xd3'),_0x2f3b29[_0x70ba('0xd5')]),_0x14c761['unlockAgent'],_0x14c761[_0x70ba('0xa5')]);}}break;case _0x70ba('0xd6'):_0x2f3b29[_0x70ba('0xd7')]+=0x1;_0x14c761['countabandonedretry']+=0x1;_0x14c761[_0x70ba('0x96')]=ut[_0x70ba('0x97')](_0x14c761);ut['logCustomer'](_0x14c761,0xb,_0x70ba('0xd8'));rpcDb['createCustomerHistory'](_0x14c761,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29['dialGlobalMaxRetry']){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0xf,'Global');rpcDb[_0x70ba('0xb3')](_0x8b243b,_0x70ba('0xd9'));}else{if(_0x14c761[_0x70ba('0xda')]>=_0x2f3b29[_0x70ba('0xdb')]){rpcDb[_0x70ba('0xb3')](_0x14c761,_0x70ba('0xd9'));}else{rpcDb[_0x70ba('0xa1')](ut[_0x70ba('0xa2')](_0x14c761,_0x70ba('0xdc'),_0x2f3b29['dialAbandonedRetryFrequency']),_0x14c761[_0x70ba('0xa4')],_0x14c761['activeContact']);}}break;case'18':_0x2f3b29[_0x70ba('0x3e')]+=0x1;_0x14c761[_0x70ba('0xdd')]+=0x1;_0x14c761[_0x70ba('0x96')]=ut[_0x70ba('0x97')](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0x12,_0x101c11[_0x70ba('0xde')]||_0x101c11[_0x70ba('0xdf')]);ami[_0x70ba('0x28')](_0x70ba('0xe0'),ut['buildObj'](_0x14c761,'amd'));rpcDb['createCustomerHistory'](_0x14c761,_0x70ba('0xe1'));if(ut['totalGlobal'](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0xf,_0x70ba('0xbc'));rpcDb['createCustomerFinal'](_0x8b243b,_0x70ba('0xe1'));}else{rpcDb[_0x70ba('0xb3')](_0x14c761,_0x70ba('0xe1'));}delete this[_0x70ba('0x16')][_0x101c11[_0x70ba('0xa6')]];break;case'19':_0x2f3b29[_0x70ba('0x3e')]+=0x1;_0x14c761['countglobal']=ut['totalGlobal'](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0x13,_0x101c11[_0x70ba('0xde')]||_0x101c11['dialstatus']);ami[_0x70ba('0x28')]('custom:amd',ut[_0x70ba('0x9a')](_0x14c761,_0x70ba('0xe2')));rpcDb['createCustomerHistory'](_0x14c761,_0x70ba('0xe3'));if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0xf,'Global');rpcDb[_0x70ba('0xb3')](_0x8b243b,_0x70ba('0xe3'));}else{rpcDb[_0x70ba('0xb3')](_0x14c761,_0x70ba('0xe3'));}delete this['actions'][_0x101c11[_0x70ba('0xa6')]];break;default:if(_0x14c761[_0x70ba('0x6f')]){ut[_0x70ba('0xb0')](_0x2f3b29,_0x70ba('0xe4'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x2f3b29[_0x70ba('0x2b')],_0x101c11);}_0x2f3b29[_0x70ba('0x3e')]+=0x1;_0x14c761['countglobal']=ut[_0x70ba('0x97')](_0x14c761);ut[_0x70ba('0x8a')](_0x14c761,0xc,_0x101c11[_0x70ba('0xde')]||_0x101c11[_0x70ba('0xdf')]);rpcDb[_0x70ba('0x88')](_0x14c761,_0x70ba('0xe5'));if(ut[_0x70ba('0x97')](_0x14c761)>=_0x2f3b29[_0x70ba('0x9d')]){_0x8b243b=ut[_0x70ba('0x9e')](_0x14c761,0xf,_0x70ba('0xbc'));rpcDb[_0x70ba('0xb3')](_0x8b243b,_0x70ba('0xe6'));}else{rpcDb[_0x70ba('0xb3')](_0x14c761,_0x70ba('0xe6'));}delete this[_0x70ba('0x16')][_0x101c11[_0x70ba('0xa6')]];}if(!(_0x14c761[_0x70ba('0x6f')]&&_0x3a2132==='16')){ut['updateOriginated'](_0x2f3b29,_0x70ba('0xe7'));logger[_0x70ba('0x54')](_0x70ba('0xe8'),_0x14c761[_0x70ba('0xa9')],_0x70ba('0xaa'),_0x2f3b29[_0x70ba('0x2b')],_0x70ba('0xe9'),_0x2f3b29['originated']);}if(_0x3a2132!=='ANSWER'){delete this[_0x70ba('0x16')][_0x101c11['linkedid']];delete this[_0x70ba('0x16')][_0x101c11[_0x70ba('0xea')]];}}};Preview[_0x70ba('0x60')][_0x70ba('0xeb')]=function(_0x3a01e9,_0x4109c8,_0x370cb4){if(_['isUndefined'](_0x4109c8)&&_0x70ba('0xec')!==typeof _0x4109c8){return;}if(_[_0x70ba('0xed')](_0x370cb4)&&_0x70ba('0xec')!==typeof _0x370cb4){return;}switch(_0x370cb4[_0x70ba('0xee')]){case'0':ut[_0x70ba('0xef')](_0x3a01e9,0x0,_0x70ba('0x98'));rpcDb['createAgentHistory'](_0x3a01e9,_0x70ba('0xf0'));break;case'3':ut[_0x70ba('0xef')](_0x3a01e9,0x3,_0x70ba('0xc1'));rpcDb[_0x70ba('0xf1')](_0x3a01e9,_0x70ba('0xf2'));break;case'5':ut[_0x70ba('0xef')](_0x3a01e9,0x5,_0x70ba('0xf3'));rpcDb['createAgentHistory'](_0x3a01e9,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x70ba('0xef')](_0x3a01e9,0x8,_0x70ba('0xc9'));rpcDb['createAgentHistory'](_0x3a01e9,_0x70ba('0xf4'));break;case'22':ut['logAgent'](_0x3a01e9,0x16,_0x70ba('0xf5'));rpcDb[_0x70ba('0xf1')](_0x3a01e9,_0x70ba('0xf6'));break;default:ut[_0x70ba('0xef')](_0x3a01e9,0xc,_0x370cb4[_0x70ba('0xee')]);rpcDb[_0x70ba('0xf1')](_0x3a01e9,_0x70ba('0xf4'));}ut[_0x70ba('0x76')](_0x4109c8,_0x70ba('0xf7'));logger['info'](_0x70ba('0xf8'),_0x3a01e9[_0x70ba('0xa9')],_0x70ba('0xaa'),_0x4109c8['name'],_0x70ba('0xe9'),_0x4109c8[_0x70ba('0x4a')]);delete this['actions'][_0x3a01e9[_0x70ba('0xa9')]];};Preview[_0x70ba('0x60')][_0x70ba('0xf9')]=function(_0x43a657,_0x45e2fb,_0x3016dd,_0x1dc54c,_0x3732f0){var _0x2baf5d=this;return new BPromise(function(_0x48c6c0,_0x36bdb4){if(_[_0x70ba('0x6a')](_0x45e2fb)||_[_0x70ba('0x6a')](_0x45e2fb['Contact'])||_[_0x70ba('0x6a')](_0x45e2fb['Contact'][_0x70ba('0xfa')])||_[_0x70ba('0x6a')](_0x45e2fb['VoiceQueueId'])){_0x36bdb4(ut['message']('Contact\x20is\x20undefined',_0x1dc54c,_0x3732f0));return;}var _0x28e339=uuid['v4']();var _0x43aba3=_0x2baf5d[_0x70ba('0x14')][_0x45e2fb[_0x70ba('0x6c')][_0x70ba('0x2b')]];var _0x5cb03a=_0x3016dd?_0x2baf5d['agents'][_0x3016dd]['id']:undefined;_0x2baf5d[_0x70ba('0x16')][_0x28e339]=new Action(_0x45e2fb,_0x43aba3,_0x28e339,_0x3016dd,_0x5cb03a);var _0x5830c4=_0x2baf5d[_0x70ba('0x16')][_0x28e339];_0x5830c4[_0x70ba('0xa4')]=_0x1dc54c;_0x5830c4[_0x70ba('0xa5')]=_0x3732f0;_0x5830c4[_0x70ba('0xfb')]=_0x3016dd;if(_[_0x70ba('0xfc')](_0x43a657)){_0x2baf5d[_0x70ba('0xfd')](_0x5830c4,_0x43aba3,_0x45e2fb,_0x3016dd)[_0x70ba('0x7b')](function(_0x3d82d5){logger[_0x70ba('0x54')](_0x70ba('0xfe'),_0x70ba('0xff')+_0x5830c4[_0x70ba('0x6d')]+_0x70ba('0x100')+_0x5830c4[_0x70ba('0x101')],JSON[_0x70ba('0x52')](_0x3d82d5));ami[_0x70ba('0x28')]('custom:agentcalled',ut[_0x70ba('0x9a')](_0x5830c4,'called',_0x2baf5d[_0x70ba('0x14')][_0x5830c4['queue']]));_0x48c6c0(ut[_0x70ba('0x5b')](_0x70ba('0x102')));})['catch'](function(_0x296bc9){ut[_0x70ba('0x5d')](_0x70ba('0x103'),_0x296bc9);_0x36bdb4(ut[_0x70ba('0x5b')](_0x70ba('0x104'),_0x1dc54c,_0x3732f0));});}else{_0x43aba3[_0x70ba('0x39')]+=0x1;ut[_0x70ba('0x105')](_0x5830c4);rpcDb[_0x70ba('0x106')](_0x5830c4,_0x70ba('0x107'));delete _0x2baf5d[_0x70ba('0x16')][_0x28e339];_0x36bdb4(ut[_0x70ba('0x5b')]('Contact\x20in\x20black\x20List',_0x1dc54c,_0x3732f0));}});};Preview[_0x70ba('0x60')][_0x70ba('0x91')]=function(_0x1e1133){return!_['isNil'](_0x1e1133)&&!_[_0x70ba('0x6a')](_0x1e1133['name'])&&!_[_0x70ba('0x6a')](_0x1e1133['active'])&&_0x1e1133[_0x70ba('0x4f')]&&!_[_0x70ba('0x6a')](this[_0x70ba('0x15')][util[_0x70ba('0x53')](_0x70ba('0x108'),_0x1e1133[_0x70ba('0x2b')])])&&!_[_0x70ba('0x6a')](this[_0x70ba('0x15')][util[_0x70ba('0x53')](_0x70ba('0x108'),_0x1e1133['name'])]['status'])&&(this['trunks'][util[_0x70ba('0x53')](_0x70ba('0x108'),_0x1e1133[_0x70ba('0x2b')])][_0x70ba('0x109')]==='reachable'||this[_0x70ba('0x15')][util[_0x70ba('0x53')](_0x70ba('0x108'),_0x1e1133[_0x70ba('0x2b')])]['status']===_0x70ba('0x10a'));};Preview[_0x70ba('0x60')]['run']=function(_0x13ce5d,_0x45a1f0){var _0x5d596a=this;return new BPromise(function(_0x20e690,_0x57a62f){_0x5d596a[_0x70ba('0x10b')](_0x13ce5d,_0x45a1f0)[_0x70ba('0x7b')](function(_0x32f8fd){_0x20e690(_[_0x70ba('0x70')](_0x32f8fd,['message']));})[_0x70ba('0x75')](function(_0x26f86f){if(_0x26f86f[_0x70ba('0x10c')]){rpcDb[_0x70ba('0x10d')](_0x13ce5d);}if(_0x26f86f[_0x70ba('0x4f')]){rpcDb['disableContact'](_0x13ce5d);}_0x57a62f(_[_0x70ba('0x70')](_0x26f86f,[_0x70ba('0x5b')]));});});};Preview['prototype'][_0x70ba('0x10b')]=function(_0x7d0cfa,_0x234fed){var _0x1b492c=this;return new BPromise(function(_0x2fcee0,_0x484ce6){var _0x17e3b4,_0x5cfc51;rpcDb['getContactPreview'](_0x7d0cfa)[_0x70ba('0x7b')](function(_0x1e1b11){if(!_['isNil'](_0x1e1b11[0x0])){_0x5cfc51=_0x1e1b11[0x0][_0x70ba('0x10e')]?![]:!![];_0x17e3b4=_0x1e1b11[0x0][_0x70ba('0x10e')]?!![]:![];_0x17e3b4=_0x234fed?!![]:_0x17e3b4;}var _0x4ad225=_0x1b492c['validateContact'](_0x1e1b11);if(_0x4ad225[_0x70ba('0x10f')]){rpcDb['checkIsBlackList'](_[_0x70ba('0x70')](_0x1e1b11[0x0],[_0x70ba('0x72'),_0x70ba('0x110')]))[_0x70ba('0x7b')](function(_0x54fa03){_0x1b492c[_0x70ba('0xf9')](_0x54fa03,_0x1e1b11[0x0],_0x234fed,_0x5cfc51,_0x17e3b4)[_0x70ba('0x7b')](function(_0x2c40c3){_0x2fcee0(_0x2c40c3);})[_0x70ba('0x75')](function(_0x45bde8){_0x484ce6(_0x45bde8);});})['catch'](function(_0xe76d93){ut['logger'](_0x70ba('0x111'),_0xe76d93);_0x484ce6(ut[_0x70ba('0x5b')]('Call\x20unsuccessful',_0x5cfc51,_0x17e3b4));});}else{_0x484ce6(ut[_0x70ba('0x5b')](_0x4ad225[_0x70ba('0x5b')],_0x5cfc51,_0x17e3b4));}})[_0x70ba('0x75')](function(_0x46d97c){ut[_0x70ba('0x5d')]('[Preview][getContactPreview]',_0x46d97c);_0x484ce6(ut[_0x70ba('0x5b')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x70ba('0x60')][_0x70ba('0x112')]=function(_0x29b478){if(_[_0x70ba('0x6a')](_0x29b478)||_[_0x70ba('0xfc')](_0x29b478)||!_[_0x70ba('0x6a')](_0x29b478[0x0]['Agent'])&&_[_0x70ba('0x6a')](_0x29b478[0x0][_0x70ba('0x113')][_0x70ba('0x2b')])){ut[_0x70ba('0x5d')]('[Preview][validateContact][Empty\x20Contact]',_0x29b478);return{'isValid':![],'message':_0x70ba('0x114')};}var _0x130a16=this[_0x70ba('0x14')][_0x29b478[0x0][_0x70ba('0x6c')][_0x70ba('0x2b')]];_0x130a16['message']=_0x70ba('0x94');if(_[_0x70ba('0x6a')](_0x130a16)){ut[_0x70ba('0x5d')](_0x70ba('0x115'),_0x130a16);return{'isValid':![],'message':_0x70ba('0x116')};}if(!this['isTrunkReachable'](_0x130a16[_0x70ba('0x4e')])){ut[_0x70ba('0x5d')](_0x70ba('0x117'),_0x70ba('0x118')+_0x130a16['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x70ba('0x91')](_0x130a16[_0x70ba('0x92')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x130a16[_0x70ba('0x2b')]+_0x70ba('0x119'));return{'isValid':![],'message':_0x70ba('0x11a')};}}if(!ut['isActive'](_0x130a16[_0x70ba('0x32')])){ut['logger'](_0x70ba('0x11b'),_0x130a16[_0x70ba('0x2b')]+_0x70ba('0x11c'));return{'isValid':![],'message':_0x70ba('0x118')+_0x130a16[_0x70ba('0x2b')]+_0x70ba('0x11c')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x70ba('0x60')]['execCall']=function(_0x32cabd,_0x1811cd,_0x296c66,_0xa5dc50){var _0x1025d8=this;return new BPromise(function(_0x1cf059,_0x37a6b1){var _0x1e08dd=_0x32cabd[_0x70ba('0xa9')];var _0x288811=_0x1025d8[_0x70ba('0x91')](_0x1811cd[_0x70ba('0x4e')])?util[_0x70ba('0x53')](_0x70ba('0x11d'),_0x1811cd[_0x70ba('0x4e')]['name'],_['isNil'](_0x1811cd[_0x70ba('0x37')])?'':_0x1811cd[_0x70ba('0x37')][_0x70ba('0x11e')]()||'',_0x1811cd[_0x70ba('0x11f')]>0x0?_0x296c66[_0x70ba('0x120')][_0x70ba('0xfa')][_0x70ba('0x121')](_0x1811cd[_0x70ba('0x11f')]):_0x296c66[_0x70ba('0x120')][_0x70ba('0xfa')]):util['format'](_0x70ba('0x11d'),_[_0x70ba('0x6a')](_0x1811cd[_0x70ba('0x92')])?_0x1811cd[_0x70ba('0x4e')][_0x70ba('0x2b')]:_0x1811cd[_0x70ba('0x92')][_0x70ba('0x2b')],_[_0x70ba('0x6a')](_0x1811cd[_0x70ba('0x37')])?'':_0x1811cd[_0x70ba('0x37')][_0x70ba('0x11e')]()||'',_0x1811cd[_0x70ba('0x11f')]>0x0?_0x296c66[_0x70ba('0x120')][_0x70ba('0xfa')]['substring'](_0x1811cd[_0x70ba('0x11f')]):_0x296c66[_0x70ba('0x120')][_0x70ba('0xfa')]);var _0x4871d9=_0x1025d8[_0x70ba('0x91')](_0x1811cd[_0x70ba('0x4e')])?ut[_0x70ba('0x122')](_0x1811cd[_0x70ba('0x4e')][_0x70ba('0x50')],_0x1811cd['dialOriginateCallerIdName'],_0x1811cd['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x70ba('0x123')](_0x1811cd[_0x70ba('0x35')],_0x1811cd['dialRandomLastDigitCallerIdNumber']):_0x1811cd[_0x70ba('0x35')]):ut[_0x70ba('0x122')](_['isNil'](_0x1811cd[_0x70ba('0x92')])?_0x1811cd[_0x70ba('0x4e')][_0x70ba('0x50')]:_0x1811cd['TrunkBackup'][_0x70ba('0x50')],_0x1811cd[_0x70ba('0x34')],_0x1811cd[_0x70ba('0x124')]>0x0?ut[_0x70ba('0x123')](_0x1811cd['dialOriginateCallerIdNumber'],_0x1811cd[_0x70ba('0x124')]):_0x1811cd['dialOriginateCallerIdNumber']);if(_0x4871d9){_0x32cabd['originatecalleridname']=ut[_0x70ba('0x125')](_0x4871d9);_0x32cabd[_0x70ba('0x126')]=ut[_0x70ba('0x127')](_0x4871d9);}var _0x4488ac=ut[_0x70ba('0x128')](_0x1811cd,_0x296c66,_0x288811,_0x4871d9,_0x1e08dd,_0x32cabd);_[_0x70ba('0x129')](_0x32cabd,ut[_0x70ba('0x12a')](_0x4488ac));_0x32cabd[_0x70ba('0x83')]=moment()['format'](_0x70ba('0x84'));ami[_0x70ba('0x74')](ut[_0x70ba('0x12b')](_0x32cabd,_0x1811cd,_0x4488ac,_0x32cabd[_0x70ba('0xa5')],_0xa5dc50))['then'](function(_0x2ffc7f){_0x1811cd['originated']+=0x1;logger['info']('[originated][increment]',_0x1e08dd,'\x20Queue',_0x1811cd[_0x70ba('0x2b')],_0x70ba('0xe9'),_0x1811cd['originated']);_0x1cf059(_0x2ffc7f);})[_0x70ba('0x75')](function(_0x101f0c){ut[_0x70ba('0xef')](_0x32cabd,0xe,_0x70ba('0x12c'));rpcDb[_0x70ba('0xf1')](_0x32cabd,_0x70ba('0x12d'));_0x37a6b1(_0x101f0c);});});};Preview['prototype'][_0x70ba('0x22')]=function(_0xba9e86){if(this[_0x70ba('0x16')][_0xba9e86[_0x70ba('0xa6')]]){this['actions'][_0xba9e86['linkedid']][_0x70ba('0x12e')]=_0xba9e86[_0x70ba('0x12e')];}};Preview[_0x70ba('0x60')][_0x70ba('0x19')]=function(_0x4aa467){var _0x4f0cc2=this;var _0x5b4710=this[_0x70ba('0x16')][_0x4aa467['actionid']];if(_0x5b4710){if(_0x5b4710['lookAgent']&&this[_0x70ba('0x17')][_0x5b4710[_0x70ba('0xfb')]]){ut[_0x70ba('0x12f')](_0x5b4710,this['agents'][_0x5b4710['lookAgent']]['name'],this[_0x70ba('0x17')][_0x5b4710[_0x70ba('0xfb')]]['id']);}var _0xe41962=_[_0x70ba('0x130')](_0x5b4710);_0xe41962['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2b8e7d=_0x4f0cc2['campaignsPreview'][_0x5b4710['queue']];if(ut[_0x70ba('0x131')](_0x4aa467[_0x70ba('0x132')])){if(_0x5b4710['unlockAgent']){rpcDb['unlockContact'](_0x5b4710[_0x70ba('0x101')]);}if(_0x5b4710[_0x70ba('0xa5')]){rpcDb[_0x70ba('0x82')](_0x5b4710['idContact']);}ami[_0x70ba('0x28')](_0x70ba('0x133'),ut['buildObj'](_0x5b4710,'rejected',this[_0x70ba('0x14')][_0x5b4710['queue']]));this[_0x70ba('0xeb')](_0xe41962,_0x2b8e7d,_0x4aa467);}else{_0x5b4710[_0x70ba('0x83')]=moment()[_0x70ba('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x70ba('0xef')](_0xe41962,0x4,_0x70ba('0xb2'));rpcDb[_0x70ba('0xf1')](_0xe41962,_0x70ba('0x134'));}}};Preview[_0x70ba('0x60')][_0x70ba('0x1c')]=function(_0x1b21cf){var _0x2ba231=this;var _0x17d5e0=this['actions'][_0x1b21cf[_0x70ba('0xa6')]];var _0x5da6f3;if(_0x17d5e0){_0x5da6f3=this[_0x70ba('0x14')][_0x17d5e0['queue']];logger['info']('[syncHangup][talking]',_0x1b21cf[_0x70ba('0xa6')],_0x70ba('0xaa'),_0x5da6f3[_0x70ba('0x2b')],_0x70ba('0x6e'),_0x5da6f3[_0x70ba('0x59')]);}if(this[_0x70ba('0x16')][_0x1b21cf[_0x70ba('0xa6')]]&&_0x1b21cf[_0x70ba('0xa6')]!==_0x1b21cf[_0x70ba('0xa9')]){if(_0x1b21cf[_0x70ba('0x135')]==='16'&&this[_0x70ba('0x16')][_0x1b21cf[_0x70ba('0xa6')]]['dialAnswer']){this[_0x70ba('0x136')](_0x1b21cf,_0x1b21cf[_0x70ba('0xa6')],_0x1b21cf[_0x70ba('0x135')]);}else if(this[_0x70ba('0x16')][_0x1b21cf['linkedid']][_0x70ba('0x6f')]){logger[_0x70ba('0x54')](_0x70ba('0x137'),_0x1b21cf['linkedid'],_0x1b21cf[_0x70ba('0x135')],_0x70ba('0xaa'),_0x5da6f3[_0x70ba('0x2b')],_0x70ba('0x6e'),_0x5da6f3['pTalking']);this[_0x70ba('0x136')](_0x1b21cf,_0x1b21cf['linkedid'],_0x1b21cf[_0x70ba('0x135')]);}}else if(_0x17d5e0&&_[_0x70ba('0x6a')](_0x17d5e0[_0x70ba('0x138')])&&_0x5da6f3[_0x70ba('0x139')]&&_0x1b21cf['linkedid']===_0x1b21cf[_0x70ba('0xa9')]&&_[_0x70ba('0x6a')](_0x1b21cf[_0x70ba('0xee')])&&_0x1b21cf['cause']==='16'&&_0x1b21cf[_0x70ba('0x13a')]==='6'&&_[_0x70ba('0xed')](_0x17d5e0[_0x70ba('0x13b')])){if(_0x17d5e0[_0x70ba('0xa4')]){rpcDb[_0x70ba('0x10d')](_0x17d5e0[_0x70ba('0x101')]);}if(_0x17d5e0[_0x70ba('0xa5')]){rpcDb[_0x70ba('0x82')](_0x17d5e0[_0x70ba('0x101')]);}_0x1b21cf['reason']='22';this[_0x70ba('0xeb')](_0x17d5e0,_0x5da6f3,_0x1b21cf);}else if(_0x17d5e0&&_0x17d5e0['transfer']){if(_0x1b21cf[_0x70ba('0x135')]==='16'&&this[_0x70ba('0x16')][_0x1b21cf[_0x70ba('0xa6')]][_0x70ba('0x6f')]){logger[_0x70ba('0x54')](_0x70ba('0x13c'),_0x1b21cf[_0x70ba('0xa6')],_0x1b21cf['cause'],'\x20Queue',_0x5da6f3[_0x70ba('0x2b')],_0x70ba('0x6e'),_0x5da6f3[_0x70ba('0x59')]);this[_0x70ba('0x136')](_0x1b21cf,_0x1b21cf[_0x70ba('0xa6')],_0x1b21cf['cause']);}else if(this[_0x70ba('0x16')][_0x1b21cf['linkedid']]['dialAnswer']){logger[_0x70ba('0x54')](_0x70ba('0x137'),_0x1b21cf['linkedid'],_0x1b21cf[_0x70ba('0x135')],'\x20Queue',_0x5da6f3[_0x70ba('0x2b')],_0x70ba('0x6e'),_0x5da6f3[_0x70ba('0x59')]);this['callProgressDetectingCustomer'](_0x1b21cf,_0x1b21cf[_0x70ba('0xa6')],_0x1b21cf[_0x70ba('0x135')]);}}};Preview[_0x70ba('0x60')][_0x70ba('0x20')]=function(_0x13ed34){if(this[_0x70ba('0x16')][_0x13ed34['destlinkedid']]&&_0x13ed34['destlinkedid']!==_0x13ed34[_0x70ba('0x13d')]){this[_0x70ba('0x136')](_0x13ed34,_0x13ed34[_0x70ba('0xea')],_0x13ed34[_0x70ba('0xdf')]);}};Preview[_0x70ba('0x60')][_0x70ba('0x1e')]=function(_0x273095){if(this[_0x70ba('0x16')][_0x273095[_0x70ba('0xa6')]]&&_0x273095['linkedid']!==_0x273095[_0x70ba('0xa9')]&&!this[_0x70ba('0x16')][_0x273095[_0x70ba('0xa6')]][_0x70ba('0x6f')]){if(_0x273095[_0x70ba('0x135')]==='1'){this[_0x70ba('0x136')](_0x273095,_0x273095[_0x70ba('0xa6')],_0x273095['cause']);}}};Preview[_0x70ba('0x60')][_0x70ba('0x13e')]=function(_0x17b77e,_0x393f9f,_0x2b60a3){if(this[_0x70ba('0x16')][_0x17b77e]){if(_[_0x70ba('0x6a')](this[_0x70ba('0x16')][_0x17b77e][_0x70ba('0x13f')])){this[_0x70ba('0x16')][_0x17b77e]['variables']={};}this['actions'][_0x17b77e][_0x70ba('0x13f')][_0x393f9f]=_0x2b60a3;}};Preview[_0x70ba('0x60')][_0x70ba('0x140')]=function(_0x3e42f4){try{if(!_[_0x70ba('0x6a')](_0x3e42f4)){if(ut[_0x70ba('0x141')](_[_0x70ba('0x142')](_0x3e42f4['variable'])[0x0])){this[_0x70ba('0x13e')](_0x3e42f4[_0x70ba('0xa9')],_[_0x70ba('0x142')](_0x3e42f4[_0x70ba('0x143')])[0x0],_0x3e42f4[_0x70ba('0x144')]);}}}catch(_0x241596){logger[_0x70ba('0x145')](_0x70ba('0x146'),util[_0x70ba('0x147')](_0x241596,{'showHidden':![],'depth':null}));}};Preview[_0x70ba('0x60')]['syncAttendedTransfer']=function(_0x50eafc){if(_0x50eafc){if(this[_0x70ba('0x16')][_0x50eafc[_0x70ba('0x148')]]){this[_0x70ba('0x16')][_0x50eafc[_0x70ba('0x148')]][_0x70ba('0x13b')]=!![];}}};Preview[_0x70ba('0x60')][_0x70ba('0x26')]=function(_0x440cb7){if(_0x440cb7){if(this[_0x70ba('0x16')][_0x440cb7[_0x70ba('0x149')]]){this['actions'][_0x440cb7[_0x70ba('0x149')]][_0x70ba('0x13b')]=!![];}}};module[_0x70ba('0x14a')]=Preview; \ No newline at end of file +var _0xb458=['active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','syncCampaigns','hasOwnProperty','preview','booked','outbound','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','originated:\x20','queue','originated','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','NOANSWER','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','countagentrejectretry','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','Queue','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','phone','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','variables','keys','variable','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','type','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0xb458,0x103));var _0x8b45=function(_0x22942f,_0x56e2ae){_0x22942f=_0x22942f-0x0;var _0x17dde5=_0xb458[_0x22942f];return _0x17dde5;};'use strict';var util=require(_0x8b45('0x0'));var _=require(_0x8b45('0x1'));var BPromise=require(_0x8b45('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x8b45('0x3'));var Redis=require(_0x8b45('0x4'));var config=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('preview');var loggerAction=require(_0x8b45('0x6'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0x8b45('0x7'));var Action=require(_0x8b45('0x8'));var ut=require(_0x8b45('0x9'));config[_0x8b45('0xa')]=_[_0x8b45('0xb')](config['redis'],{'host':_0x8b45('0xc'),'port':0x18eb});var io=require(_0x8b45('0xd'))(new Redis(config[_0x8b45('0xa')]));var Sequence=function(){};Sequence[_0x8b45('0xe')][_0x8b45('0xf')]=function(_0x499899){this[_0x8b45('0x10')]=this[_0x8b45('0x10')]?this['tail']['finally'](_0x499899):_0x499899();};function Preview(_0x5bb708){this['sequence']=new Sequence();this[_0x8b45('0x11')]=_0x5bb708[_0x8b45('0x12')];this[_0x8b45('0x13')]=_0x5bb708['trunks'];this[_0x8b45('0x14')]={};this[_0x8b45('0x15')]=_0x5bb708[_0x8b45('0x15')];this[_0x8b45('0x16')]=0x0;ami['on'](_0x8b45('0x17'),this[_0x8b45('0x18')]['bind'](this));ami['on']('hangup',this[_0x8b45('0x19')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x1b'),this[_0x8b45('0x1c')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x1d'),this[_0x8b45('0x1e')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x1f'),this[_0x8b45('0x20')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x21'),this[_0x8b45('0x22')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x23'),this[_0x8b45('0x24')][_0x8b45('0x1a')](this));ami['on'](_0x8b45('0x25'),this['syncBlindTransfer'][_0x8b45('0x1a')](this));this[_0x8b45('0x26')](this[_0x8b45('0x11')]);}function emit(_0x46e21a,_0x3e1438,_0x23eae6){io['to'](_0x46e21a)[_0x8b45('0x27')](_0x3e1438,_0x23eae6);}function emitCampaignPreview(_0x32b917){if(_0x32b917['type']==='outbound'){var _0x41154a={'id':_0x32b917['id'],'name':_0x32b917['name'],'strategy':_0x32b917[_0x8b45('0x28')],'answered':_0x32b917[_0x8b45('0x29')],'available':_0x32b917[_0x8b45('0x2a')],'loggedIn':_0x32b917[_0x8b45('0x2b')],'pTalking':_0x32b917[_0x8b45('0x2c')],'sumBillable':_0x32b917[_0x8b45('0x2d')],'sumDuration':_0x32b917[_0x8b45('0x2e')],'sumHoldTime':_0x32b917['sumHoldTime']||0x0,'talking':_0x32b917['talking'],'total':_0x32b917[_0x8b45('0x2f')],'type':_0x32b917[_0x8b45('0x30')],'unmanaged':_0x32b917['unmanaged'],'abandoned':_0x32b917['abandoned'],'waiting':_0x32b917[_0x8b45('0x31')],'loggedInDb':_0x32b917[_0x8b45('0x32')],'dialActive':_0x32b917[_0x8b45('0x33')],'dialMethod':_0x32b917[_0x8b45('0x34')],'dialOriginateCallerIdName':_0x32b917['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x32b917[_0x8b45('0x35')],'dialOriginateTimeout':_0x32b917[_0x8b45('0x36')],'dialPrefix':_0x32b917[_0x8b45('0x37')],'outboundAnswerAgiCallsDay':_0x32b917[_0x8b45('0x38')],'outboundAnswerCallsDay':_0x32b917[_0x8b45('0x39')],'outboundBlacklistCallsDay':_0x32b917[_0x8b45('0x3a')],'outboundBusyCallsDay':_0x32b917[_0x8b45('0x3b')],'outboundCongestionCallsDay':_0x32b917[_0x8b45('0x3c')],'outboundDropCallsDayACS':_0x32b917[_0x8b45('0x3d')],'outboundDropCallsDayCallersExit':_0x32b917[_0x8b45('0x3e')],'outboundDropCallsDayTimeout':_0x32b917[_0x8b45('0x3f')],'outboundNoAnswerCallsDay':_0x32b917[_0x8b45('0x40')],'outboundNoSuchCallsDay':_0x32b917[_0x8b45('0x41')],'outboundOriginateFailureCallsDay':_0x32b917['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x32b917[_0x8b45('0x42')],'outboundRejectCallsDay':_0x32b917[_0x8b45('0x43')],'outboundUnknownCallsDay':_0x32b917[_0x8b45('0x44')],'outboundAbandonedCallsDay':_0x32b917[_0x8b45('0x45')],'predictiveIntervalAnsweredCalls':_0x32b917[_0x8b45('0x46')],'predictiveIntervalAvgHoldtime':_0x32b917[_0x8b45('0x47')],'predictiveIntervalAvgTalktime':_0x32b917[_0x8b45('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x32b917[_0x8b45('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x32b917['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x32b917[_0x8b45('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x32b917[_0x8b45('0x4b')],'predictiveIntervalHitRate':_0x32b917[_0x8b45('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x32b917[_0x8b45('0x4d')],'predictiveIntervalPauses':_0x32b917[_0x8b45('0x4e')],'predictiveIntervalAvailable':_0x32b917['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x32b917[_0x8b45('0x4f')],'message':_0x32b917['message'],'originated':_0x32b917['originated'],'erlangCalls':_0x32b917[_0x8b45('0x50')],'erlangCallToSecond':_0x32b917[_0x8b45('0x51')],'erlangAbandonmentRate':_0x32b917[_0x8b45('0x52')],'erlangBusyFactor':_0x32b917[_0x8b45('0x53')],'startPredictive':_0x32b917[_0x8b45('0x54')],'startProgressive':_0x32b917[_0x8b45('0x55')]};if(_0x32b917['Trunk']){_0x41154a[_0x8b45('0x56')]={'id':_0x32b917[_0x8b45('0x56')]['id'],'name':_0x32b917[_0x8b45('0x56')][_0x8b45('0x57')],'active':_0x32b917['Trunk'][_0x8b45('0x58')],'callerid':_0x32b917[_0x8b45('0x56')][_0x8b45('0x59')]};}if(_0x32b917['Interval']){_0x41154a[_0x8b45('0x5a')]={'id':_0x32b917[_0x8b45('0x5a')]['id'],'name':_0x32b917[_0x8b45('0x5a')]['name']};}var _0x1adc4e=md5(JSON[_0x8b45('0x5b')](_0x41154a));if(_0x32b917[_0x8b45('0x3')]!==_0x1adc4e){_0x32b917[_0x8b45('0x3')]=_0x1adc4e;emit(util['format'](_0x8b45('0x5c'),_0x41154a[_0x8b45('0x57')]),_0x8b45('0x5d'),_0x41154a);}}}function emitVoiceQueueChannelRemove(_0x15df7c){logger[_0x8b45('0x5e')](_0x8b45('0x5f'),JSON['stringify'](_0x15df7c));emit(util['format'](_0x8b45('0x5c'),_0x15df7c[_0x8b45('0x57')]),_0x8b45('0x60'),_0x15df7c);io[_0x8b45('0x27')](_0x8b45('0x61'),_0x15df7c);}function notSendMessagesQueue(_0x4c4dbc){if(_0x4c4dbc[_0x8b45('0x62')]){if(_0x4c4dbc['originated']===0x0&&_0x4c4dbc[_0x8b45('0x2c')]===0x0){_0x4c4dbc[_0x8b45('0x62')]=![];_0x4c4dbc[_0x8b45('0x2a')]=0x0;_0x4c4dbc[_0x8b45('0x63')]=0x0;_0x4c4dbc[_0x8b45('0x64')]=_0x8b45('0x65');ut[_0x8b45('0x66')](_0x8b45('0x67'),_0x4c4dbc[_0x8b45('0x57')]+_0x8b45('0x68'));}else{_0x4c4dbc[_0x8b45('0x64')]='IS_DISACTIVED';ut[_0x8b45('0x66')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4c4dbc[_0x8b45('0x57')]+'\x20is\x20disactive');}emitCampaignPreview(_0x4c4dbc);}}Preview[_0x8b45('0xe')][_0x8b45('0x26')]=function(){var _0x117f25=this;setInterval(function(){_0x117f25[_0x8b45('0x69')]();},0x7cf);};Preview[_0x8b45('0xe')][_0x8b45('0x69')]=function(){var _0x58e663=this[_0x8b45('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x4c56c8 in _0x58e663){if(_0x58e663[_0x8b45('0x6a')](_0x4c56c8)&&(_0x58e663[_0x4c56c8][_0x8b45('0x34')]===_0x8b45('0x6b')||_0x58e663[_0x4c56c8]['dialMethod']===_0x8b45('0x6c'))&&_0x58e663[_0x4c56c8]['type']===_0x8b45('0x6d')){if(this[_0x8b45('0x16')]>0x7){this[_0x8b45('0x16')]=0x0;this[_0x8b45('0x6e')]();}}if(_0x58e663[_0x8b45('0x6a')](_0x4c56c8)&&_0x58e663[_0x4c56c8][_0x8b45('0x34')]==='preview'&&_0x58e663[_0x4c56c8][_0x8b45('0x30')]===_0x8b45('0x6d')){if(_0x58e663[_0x4c56c8][_0x8b45('0x33')]){this[_0x8b45('0x6f')](_0x58e663[_0x4c56c8]);if(_0x58e663[_0x4c56c8][_0x8b45('0x70')])this[_0x8b45('0x71')](_0x58e663[_0x4c56c8]);}else{notSendMessagesQueue(_0x58e663[_0x4c56c8]);}}}};Preview[_0x8b45('0xe')][_0x8b45('0x72')]=function(_0x37b94a){var _0x462b51=this;this[_0x8b45('0x73')][_0x8b45('0xf')](function(){if(!_[_0x8b45('0x74')](_0x462b51[_0x8b45('0x14')][_0x37b94a])){loggerAction[_0x8b45('0x5e')](_0x8b45('0x75'),_0x37b94a,'Queue',_0x462b51['actions'][_0x37b94a]['queue'],_0x8b45('0x76'),JSON[_0x8b45('0x5b')](_0x462b51[_0x8b45('0x11')][_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x77')]][_0x8b45('0x78')]),_0x8b45('0x79'),JSON[_0x8b45('0x5b')](_0x462b51['campaignsPreview'][_0x462b51[_0x8b45('0x14')][_0x37b94a]['queue']][_0x8b45('0x2c')]),JSON[_0x8b45('0x5b')](_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x7a')]),JSON['stringify'](_[_0x8b45('0x7b')](_0x462b51[_0x8b45('0x14')][_0x37b94a],['contactId',_0x8b45('0x7c'),_0x8b45('0x7d'),'ListId'])));return ami[_0x8b45('0x7e')]({'action':_0x8b45('0x7f'),'channel':_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x80')]})[_0x8b45('0x81')](function(_0x3d1bf1){if(_0x3d1bf1['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x462b51[_0x8b45('0x14')][_0x37b94a]){ut[_0x8b45('0x82')](_0x462b51[_0x8b45('0x11')][_0x462b51['actions'][_0x37b94a][_0x8b45('0x77')]],_0x8b45('0x83'));if(_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x7a')]===!![]){ut[_0x8b45('0x84')](_0x462b51['campaignsPreview'][_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x77')]],'[clearZombieChannel]');ut[_0x8b45('0x85')]('[Dialer][checkChannel][pTalking][Preview]'+_0x37b94a,_0x462b51[_0x8b45('0x14')][_0x37b94a][_0x8b45('0x77')]);}ut[_0x8b45('0x85')](_0x8b45('0x86')+_0x37b94a,_0x462b51['actions'][_0x37b94a][_0x8b45('0x77')]);delete _0x462b51[_0x8b45('0x14')][_0x37b94a];}},0x2328);}});}});};Preview[_0x8b45('0xe')][_0x8b45('0x6e')]=function(){var _0x3e3df2=this;loggerAction[_0x8b45('0x5e')](_0x8b45('0x87'),_[_0x8b45('0x88')](this[_0x8b45('0x14')]));for(var _0x5ba878 in this[_0x8b45('0x14')]){if(_0x3e3df2[_0x8b45('0x14')][_0x8b45('0x6a')](_0x5ba878)){_0x3e3df2[_0x8b45('0x72')](_0x5ba878);}}};Preview[_0x8b45('0xe')]['recallMe']=function(_0x1744f8){var _0x1477bd=this;rpcDb[_0x8b45('0x89')](_0x1744f8['id'],ut['agentReadyId'](this[_0x8b45('0x15')]))[_0x8b45('0x8a')](function(_0x3d7efe){if(!_[_0x8b45('0x74')](_0x3d7efe)){for(var _0x5795ca=0x0;_0x5795ca<_0x3d7efe[_0x8b45('0x8b')];_0x5795ca+=0x1){if(ut[_0x8b45('0x8c')](_0x3d7efe[_0x5795ca][_0x8b45('0x8d')])<_0x1744f8[_0x8b45('0x8e')]*0x3c){if(_0x3d7efe[_0x5795ca]['Agent']&&!_0x3d7efe[_0x5795ca][_0x8b45('0x8f')][_0x8b45('0x90')]){_0x1477bd[_0x8b45('0x91')](_0x3d7efe[_0x5795ca]['id'])[_0x8b45('0x8a')](ut[_0x8b45('0x92')]('[RecallMe]'))[_0x8b45('0x81')](ut['logger2'](_0x8b45('0x93')));}else{rpcDb[_0x8b45('0x94')](_0x3d7efe[_0x5795ca]['id']);}}else{var _0x19152b=new Action(_0x3d7efe[_0x5795ca],_0x1744f8);_0x19152b[_0x8b45('0x95')]=moment()[_0x8b45('0x96')](_0x8b45('0x97'));_0x1744f8['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x19152b,0x17,_0x8b45('0x98'));if(_0x1744f8[_0x8b45('0x99')]){rpcDb['rescheduleContactInQueue'](ut[_0x8b45('0x9a')](_0x3d7efe[_0x5795ca]));rpcDb[_0x8b45('0x9b')](_0x19152b,_0x8b45('0x9c'));}else{ut['logCustomer'](_0x19152b,0x16,'RecallFailedTimeout');rpcDb[_0x8b45('0x9b')](_0x19152b,_0x8b45('0x9d'));rpcDb['createCustomerFinal'](_0x19152b,_0x8b45('0x9d'));}}}}})['catch'](ut[_0x8b45('0x92')]('[getContactRecallMe]'));};Preview['prototype'][_0x8b45('0x6f')]=function(_0x7f5a4e){_0x7f5a4e['sendMessageOneNotActive']=!![];if(ut[_0x8b45('0x9e')](_0x7f5a4e[_0x8b45('0x2b')])){_0x7f5a4e[_0x8b45('0x64')]=_0x8b45('0x9f');}else if(!ut[_0x8b45('0xa0')](_0x7f5a4e['dialActive'])){_0x7f5a4e[_0x8b45('0x64')]=_0x8b45('0x65');}else if(!this[_0x8b45('0xa1')](_0x7f5a4e['Trunk'])){if(!this['isTrunkReachable'](_0x7f5a4e[_0x8b45('0xa2')])){_0x7f5a4e['message']=_0x8b45('0xa3');}else{_0x7f5a4e['message']='ACTIVE';}}else{_0x7f5a4e['message']=_0x8b45('0xa4');}emitCampaignPreview(_0x7f5a4e);};Preview['prototype'][_0x8b45('0xa5')]=function(_0x123117,_0x51ad6b,_0x3db84e){var _0x1b3890=this;var _0x5f3477=this[_0x8b45('0x14')][_0x51ad6b];var _0x46b686=this[_0x8b45('0x11')][_0x5f3477[_0x8b45('0x77')]];var _0x15cf9d;if(_0x46b686){switch(_0x3db84e){case'1':_0x46b686[_0x8b45('0x41')]+=0x1;_0x5f3477[_0x8b45('0xa6')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x0,_0x8b45('0xaa'));ami[_0x8b45('0x27')]('custom:agentnosuchnumber',ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xac')));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xad'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xb2'));}else{if(_0x5f3477[_0x8b45('0xa6')]>=_0x46b686[_0x8b45('0xb3')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xb2'));}else{rpcDb[_0x8b45('0xb4')](ut['scheduledAt'](_0x5f3477,_0x8b45('0xa6'),_0x46b686[_0x8b45('0xb5')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];break;case _0x8b45('0xb9'):var _0x1e7c12=moment()['format'](_0x8b45('0x97'));_0x5f3477[_0x8b45('0xba')]=_0x1e7c12;_0x5f3477[_0x8b45('0xbb')]=_0x1e7c12;_0x5f3477[_0x8b45('0x7a')]=!![];_0x46b686[_0x8b45('0x2c')]+=0x1;logger[_0x8b45('0x5e')](_0x8b45('0xbc'),_0x5f3477[_0x8b45('0xbd')],_0x8b45('0xbe'),_0x46b686[_0x8b45('0x57')],_0x8b45('0x79'),_0x46b686['pTalking']);ami['emit'](_0x8b45('0xbf'),ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xc0'),this[_0x8b45('0x11')][_0x5f3477[_0x8b45('0x77')]]));if(_0x46b686[_0x8b45('0xc1')]){ami[_0x8b45('0x27')](_0x8b45('0xc2'),ut[_0x8b45('0xc3')](_0x5f3477));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xc4'),this[_0x8b45('0x11')][_0x5f3477[_0x8b45('0x77')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5f3477,_0x8b45('0xc4')));_0x46b686[_0x8b45('0x39')]+=0x1;_0x46b686[_0x8b45('0x2f')]+=0x1;_0x46b686[_0x8b45('0x29')]+=0x1;ut[_0x8b45('0x84')](_0x46b686,_0x8b45('0xc5'));_0x5f3477['countglobal']=ut['totalGlobal'](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x4,'Answer');rpcDb['createCustomerHistory'](_0x5f3477,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xc6'));rpcDb[_0x8b45('0xc7')](_0x5f3477);_0x46b686[_0x8b45('0x2e')]+=_0x5f3477[_0x8b45('0xc8')];_0x46b686[_0x8b45('0x2d')]+=_0x5f3477[_0x8b45('0xc8')];logger[_0x8b45('0x5e')](_0x8b45('0xc9'),_0x5f3477[_0x8b45('0xbd')],_0x8b45('0xbe'),_0x46b686[_0x8b45('0x57')],_0x8b45('0x79'),_0x46b686[_0x8b45('0x2c')]);delete this[_0x8b45('0x14')][_0x123117['linkedid']];break;case _0x8b45('0xca'):_0x46b686[_0x8b45('0x3b')]+=0x1;_0x5f3477[_0x8b45('0xcb')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x5,_0x8b45('0xcc'));ami[_0x8b45('0x27')](_0x8b45('0xcd'),ut[_0x8b45('0xab')](_0x5f3477,'busy'));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xce'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb['createCustomerFinal'](_0x15cf9d,_0x8b45('0xcf'));}else{if(_0x5f3477['countbusyretry']>=_0x46b686[_0x8b45('0xd0')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xce'));}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,_0x8b45('0xcb'),_0x46b686['dialBusyRetryFrequency']),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}break;case _0x8b45('0xd2'):_0x46b686[_0x8b45('0x40')]+=0x1;_0x5f3477['countnoanswerretry']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut['logCustomer'](_0x5f3477,0x3,'NoAnswer');ami[_0x8b45('0x27')](_0x8b45('0xd3'),ut[_0x8b45('0xab')](_0x5f3477,'noanswer'));rpcDb[_0x8b45('0x9b')](_0x5f3477,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,'Global');rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xd4'));}else{if(_0x5f3477[_0x8b45('0xd5')]>=_0x46b686[_0x8b45('0xd6')]){rpcDb['createCustomerFinal'](_0x5f3477,_0x8b45('0xd7'));}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,_0x8b45('0xd5'),_0x46b686[_0x8b45('0xd8')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477['activeContact']);}}break;case _0x8b45('0xd9'):_0x46b686[_0x8b45('0x3c')]+=0x1;_0x5f3477['countcongestionretry']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut['logCustomer'](_0x5f3477,0x8,'Congestion');ami['emit'](_0x8b45('0xda'),ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xdb')));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xdc'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xdd'));}else{if(_0x5f3477[_0x8b45('0xde')]>=_0x46b686[_0x8b45('0xdf')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,_0x8b45('0xde'),_0x46b686[_0x8b45('0xe0')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477['activeContact']);}}break;case'CANCEL':_0x46b686[_0x8b45('0x43')]+=0x1;_0x5f3477[_0x8b45('0xe1')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x14,'AgentReject');ami[_0x8b45('0x27')]('custom:agentreject',ut[_0x8b45('0xab')](_0x5f3477,'agentreject'));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xe2'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0x14,_0x8b45('0xe3'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xe4'));}else{if(_0x5f3477[_0x8b45('0xe1')]>=_0x46b686[_0x8b45('0xe5')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xe4'));}else{rpcDb[_0x8b45('0xb4')](ut[_0x8b45('0xd1')](_0x5f3477,'countagentrejectretry',_0x46b686[_0x8b45('0xe6')]),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}break;case'ABANDONED':_0x46b686[_0x8b45('0x45')]+=0x1;_0x5f3477['countabandonedretry']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut['logCustomer'](_0x5f3477,0xb,_0x8b45('0xe7'));rpcDb['createCustomerHistory'](_0x5f3477,_0x8b45('0xe8'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x5f3477['countabandonedetry']>=_0x46b686[_0x8b45('0xe9')]){rpcDb[_0x8b45('0xb1')](_0x5f3477,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5f3477,_0x8b45('0xea'),_0x46b686['dialAbandonedRetryFrequency']),_0x5f3477[_0x8b45('0xb6')],_0x5f3477[_0x8b45('0xb7')]);}}break;case'18':_0x46b686[_0x8b45('0x44')]+=0x1;_0x5f3477[_0x8b45('0xeb')]+=0x1;_0x5f3477['countglobal']=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x12,_0x123117[_0x8b45('0xec')]||_0x123117[_0x8b45('0xed')]);ami[_0x8b45('0x27')](_0x8b45('0xee'),ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xef')));rpcDb['createCustomerHistory'](_0x5f3477,_0x8b45('0xf0'));if(ut['totalGlobal'](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut['cloneAction'](_0x5f3477,0xf,'Global');rpcDb['createCustomerFinal'](_0x15cf9d,_0x8b45('0xf0'));}else{rpcDb[_0x8b45('0xb1')](_0x5f3477,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];break;case'19':_0x46b686[_0x8b45('0x44')]+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0x13,_0x123117[_0x8b45('0xec')]||_0x123117[_0x8b45('0xed')]);ami[_0x8b45('0x27')]('custom:amd',ut[_0x8b45('0xab')](_0x5f3477,_0x8b45('0xef')));rpcDb[_0x8b45('0x9b')](_0x5f3477,_0x8b45('0xf1'));if(ut['totalGlobal'](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xf1'));}else{rpcDb['createCustomerFinal'](_0x5f3477,_0x8b45('0xf1'));}delete this['actions'][_0x123117[_0x8b45('0xb8')]];break;default:if(_0x5f3477[_0x8b45('0x7a')]){ut['decrementTalkink'](_0x46b686,'[default]');ut[_0x8b45('0x85')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x46b686[_0x8b45('0x57')],_0x123117);}_0x46b686['outboundUnknownCallsDay']+=0x1;_0x5f3477[_0x8b45('0xa7')]=ut[_0x8b45('0xa8')](_0x5f3477);ut[_0x8b45('0xa9')](_0x5f3477,0xc,_0x123117['cause-txt']||_0x123117[_0x8b45('0xed')]);rpcDb['createCustomerHistory'](_0x5f3477,_0x8b45('0xf2'));if(ut[_0x8b45('0xa8')](_0x5f3477)>=_0x46b686[_0x8b45('0xae')]){_0x15cf9d=ut[_0x8b45('0xaf')](_0x5f3477,0xf,_0x8b45('0xb0'));rpcDb[_0x8b45('0xb1')](_0x15cf9d,_0x8b45('0xf3'));}else{rpcDb[_0x8b45('0xb1')](_0x5f3477,_0x8b45('0xf3'));}delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];}if(!(_0x5f3477[_0x8b45('0x7a')]&&_0x3db84e==='16')){ut[_0x8b45('0x82')](_0x46b686,_0x8b45('0xf4'));logger[_0x8b45('0x5e')]('[originated][decrement][callProgressDetectingCustomer]',_0x5f3477[_0x8b45('0xbd')],_0x8b45('0xbe'),_0x46b686['name'],'originated:\x20',_0x46b686[_0x8b45('0x78')]);}if(_0x3db84e!==_0x8b45('0xb9')){delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xb8')]];delete this[_0x8b45('0x14')][_0x123117[_0x8b45('0xf5')]];}}};Preview[_0x8b45('0xe')][_0x8b45('0xf6')]=function(_0xc28f57,_0x4ad1fe,_0x39626f){if(_[_0x8b45('0xf7')](_0x4ad1fe)&&'object'!==typeof _0x4ad1fe){return;}if(_[_0x8b45('0xf7')](_0x39626f)&&_0x8b45('0xf8')!==typeof _0x39626f){return;}switch(_0x39626f[_0x8b45('0xf9')]){case'0':ut[_0x8b45('0xfa')](_0xc28f57,0x0,_0x8b45('0xaa'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0xfc'));break;case'3':ut[_0x8b45('0xfa')](_0xc28f57,0x3,_0x8b45('0xfd'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0xfe'));break;case'5':ut[_0x8b45('0xfa')](_0xc28f57,0x5,_0x8b45('0xcc'));rpcDb['createAgentHistory'](_0xc28f57,_0x8b45('0xff'));break;case'8':ut['logAgent'](_0xc28f57,0x8,_0x8b45('0x100'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0x101'));break;case'22':ut['logAgent'](_0xc28f57,0x16,_0x8b45('0x102'));rpcDb[_0x8b45('0xfb')](_0xc28f57,_0x8b45('0x103'));break;default:ut[_0x8b45('0xfa')](_0xc28f57,0xc,_0x39626f[_0x8b45('0xf9')]);rpcDb[_0x8b45('0xfb')](_0xc28f57,'[callProgressDetectingAgent][logCongestion]');}ut[_0x8b45('0x82')](_0x4ad1fe,_0x8b45('0x104'));logger[_0x8b45('0x5e')](_0x8b45('0x105'),_0xc28f57['uniqueid'],_0x8b45('0xbe'),_0x4ad1fe[_0x8b45('0x57')],_0x8b45('0x76'),_0x4ad1fe[_0x8b45('0x78')]);delete this['actions'][_0xc28f57[_0x8b45('0xbd')]];};Preview[_0x8b45('0xe')][_0x8b45('0x106')]=function(_0x4d5539,_0x1d2f2d,_0x1411e0,_0xeee220,_0x1d3a00){var _0x2783b2=this;return new BPromise(function(_0x82ec51,_0x59c08a){if(_[_0x8b45('0x74')](_0x1d2f2d)||_[_0x8b45('0x74')](_0x1d2f2d['Contact'])||_[_0x8b45('0x74')](_0x1d2f2d[_0x8b45('0x107')]['phone'])||_[_0x8b45('0x74')](_0x1d2f2d[_0x8b45('0x7d')])){_0x59c08a(ut[_0x8b45('0x64')](_0x8b45('0x108'),_0xeee220,_0x1d3a00));return;}var _0x1d5e77=uuid['v4']();var _0x3e62af=_0x2783b2[_0x8b45('0x11')][_0x1d2f2d[_0x8b45('0x109')]['name']];var _0x147b83=_0x1411e0?_0x2783b2['agents'][_0x1411e0]['id']:undefined;_0x2783b2[_0x8b45('0x14')][_0x1d5e77]=new Action(_0x1d2f2d,_0x3e62af,_0x1d5e77,_0x1411e0,_0x147b83);var _0x255b6a=_0x2783b2[_0x8b45('0x14')][_0x1d5e77];_0x255b6a['unlockAgent']=_0xeee220;_0x255b6a[_0x8b45('0xb7')]=_0x1d3a00;_0x255b6a[_0x8b45('0x10a')]=_0x1411e0;if(_['isEmpty'](_0x4d5539)){_0x2783b2[_0x8b45('0x10b')](_0x255b6a,_0x3e62af,_0x1d2f2d,_0x1411e0)[_0x8b45('0x8a')](function(_0x2884a4){logger[_0x8b45('0x5e')](_0x8b45('0x10c'),_0x8b45('0x10d')+_0x255b6a[_0x8b45('0x77')]+_0x8b45('0x10e')+_0x255b6a[_0x8b45('0x10f')],JSON['stringify'](_0x2884a4));ami[_0x8b45('0x27')](_0x8b45('0x110'),ut[_0x8b45('0xab')](_0x255b6a,'called',_0x2783b2[_0x8b45('0x11')][_0x255b6a['queue']]));_0x82ec51(ut[_0x8b45('0x64')]('Calling'));})['catch'](function(_0x1cfe9d){ut[_0x8b45('0x66')](_0x8b45('0x111'),_0x1cfe9d);_0x59c08a(ut['message'](_0x8b45('0x112'),_0xeee220,_0x1d3a00));});}else{_0x3e62af[_0x8b45('0x3a')]+=0x1;ut[_0x8b45('0x113')](_0x255b6a);rpcDb[_0x8b45('0x114')](_0x255b6a,_0x8b45('0x115'));delete _0x2783b2[_0x8b45('0x14')][_0x1d5e77];_0x59c08a(ut[_0x8b45('0x64')](_0x8b45('0x116'),_0xeee220,_0x1d3a00));}});};Preview['prototype'][_0x8b45('0xa1')]=function(_0x43c32c){return!_[_0x8b45('0x74')](_0x43c32c)&&!_[_0x8b45('0x74')](_0x43c32c[_0x8b45('0x57')])&&!_[_0x8b45('0x74')](_0x43c32c['active'])&&_0x43c32c['active']&&!_[_0x8b45('0x74')](this['trunks'][util['format'](_0x8b45('0x117'),_0x43c32c[_0x8b45('0x57')])])&&!_[_0x8b45('0x74')](this[_0x8b45('0x13')][util[_0x8b45('0x96')]('SIP/%s',_0x43c32c[_0x8b45('0x57')])][_0x8b45('0x7f')])&&(this['trunks'][util['format'](_0x8b45('0x117'),_0x43c32c[_0x8b45('0x57')])][_0x8b45('0x7f')]===_0x8b45('0x118')||this[_0x8b45('0x13')][util[_0x8b45('0x96')](_0x8b45('0x117'),_0x43c32c[_0x8b45('0x57')])][_0x8b45('0x7f')]===_0x8b45('0x119'));};Preview[_0x8b45('0xe')][_0x8b45('0x91')]=function(_0x584b98,_0x3ef8be){var _0x475cb8=this;return new BPromise(function(_0x181134,_0x47a0d9){_0x475cb8[_0x8b45('0x11a')](_0x584b98,_0x3ef8be)['then'](function(_0x208e72){_0x181134(_[_0x8b45('0x7b')](_0x208e72,[_0x8b45('0x64')]));})[_0x8b45('0x81')](function(_0x28d0de){if(_0x28d0de[_0x8b45('0x11b')]){rpcDb[_0x8b45('0x11c')](_0x584b98);}if(_0x28d0de[_0x8b45('0x58')]){rpcDb[_0x8b45('0x94')](_0x584b98);}_0x47a0d9(_[_0x8b45('0x7b')](_0x28d0de,['message']));});});};Preview[_0x8b45('0xe')][_0x8b45('0x11a')]=function(_0x5e8425,_0x252ef3){var _0x2a3676=this;return new BPromise(function(_0x3cafc4,_0x461169){var _0x221594,_0x3468c7;rpcDb[_0x8b45('0x11d')](_0x5e8425)['then'](function(_0x19222d){if(!_['isNil'](_0x19222d[0x0])){_0x3468c7=_0x19222d[0x0][_0x8b45('0x11e')]?![]:!![];_0x221594=_0x19222d[0x0][_0x8b45('0x11e')]?!![]:![];_0x221594=_0x252ef3?!![]:_0x221594;}var _0x4e7673=_0x2a3676[_0x8b45('0x11f')](_0x19222d);if(_0x4e7673[_0x8b45('0x120')]){rpcDb[_0x8b45('0x121')](_[_0x8b45('0x7b')](_0x19222d[0x0],[_0x8b45('0x7d'),'Contact.phone']))[_0x8b45('0x8a')](function(_0x5a31c8){_0x2a3676[_0x8b45('0x106')](_0x5a31c8,_0x19222d[0x0],_0x252ef3,_0x3468c7,_0x221594)[_0x8b45('0x8a')](function(_0x4bd7e8){_0x3cafc4(_0x4bd7e8);})['catch'](function(_0x4a998f){_0x461169(_0x4a998f);});})['catch'](function(_0x1f8c01){ut[_0x8b45('0x66')](_0x8b45('0x122'),_0x1f8c01);_0x461169(ut[_0x8b45('0x64')](_0x8b45('0x123'),_0x3468c7,_0x221594));});}else{_0x461169(ut[_0x8b45('0x64')](_0x4e7673[_0x8b45('0x64')],_0x3468c7,_0x221594));}})[_0x8b45('0x81')](function(_0x2458eb){ut[_0x8b45('0x66')](_0x8b45('0x124'),_0x2458eb);_0x461169(ut[_0x8b45('0x64')](_0x8b45('0x123'),![],!![]));});});};Preview[_0x8b45('0xe')][_0x8b45('0x11f')]=function(_0x556900){if(_['isNil'](_0x556900)||_[_0x8b45('0x125')](_0x556900)||!_[_0x8b45('0x74')](_0x556900[0x0]['Agent'])&&_[_0x8b45('0x74')](_0x556900[0x0][_0x8b45('0x8f')][_0x8b45('0x57')])){ut[_0x8b45('0x66')](_0x8b45('0x126'),_0x556900);return{'isValid':![],'message':_0x8b45('0x127')};}var _0x4ede39=this[_0x8b45('0x11')][_0x556900[0x0]['Queue']['name']];_0x4ede39[_0x8b45('0x64')]='ACTIVE';if(_[_0x8b45('0x74')](_0x4ede39)){ut[_0x8b45('0x66')](_0x8b45('0x128'),_0x4ede39);return{'isValid':![],'message':_0x8b45('0x129')};}if(!this[_0x8b45('0xa1')](_0x4ede39[_0x8b45('0x56')])){ut[_0x8b45('0x66')](_0x8b45('0x12a'),_0x8b45('0x12b')+_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x12c'));if(!this[_0x8b45('0xa1')](_0x4ede39[_0x8b45('0xa2')])){ut['logger'](_0x8b45('0x12a'),_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x12d'));return{'isValid':![],'message':_0x8b45('0x12e')};}}if(!ut[_0x8b45('0xa0')](_0x4ede39['dialActive'])){ut[_0x8b45('0x66')](_0x8b45('0x12f'),_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x130'));return{'isValid':![],'message':_0x8b45('0x12b')+_0x4ede39[_0x8b45('0x57')]+_0x8b45('0x130')};}return{'isValid':!![],'message':_0x8b45('0x131')};};Preview[_0x8b45('0xe')][_0x8b45('0x10b')]=function(_0x478262,_0x3aec32,_0x218549,_0x160165){var _0xa534a1=this;return new BPromise(function(_0x3976ff,_0x6b30ad){var _0x4245d6=_0x478262[_0x8b45('0xbd')];var _0x3b857f=_0xa534a1[_0x8b45('0xa1')](_0x3aec32['Trunk'])?util[_0x8b45('0x96')](_0x8b45('0x132'),_0x3aec32['Trunk'][_0x8b45('0x57')],_[_0x8b45('0x74')](_0x3aec32[_0x8b45('0x37')])?'':_0x3aec32[_0x8b45('0x37')][_0x8b45('0x133')]()||'',_0x3aec32['dialCutDigit']>0x0?_0x218549[_0x8b45('0x107')][_0x8b45('0x134')][_0x8b45('0x135')](_0x3aec32[_0x8b45('0x136')]):_0x218549[_0x8b45('0x107')][_0x8b45('0x134')]):util['format']('SIP/%s/%s%s',_[_0x8b45('0x74')](_0x3aec32[_0x8b45('0xa2')])?_0x3aec32[_0x8b45('0x56')]['name']:_0x3aec32[_0x8b45('0xa2')][_0x8b45('0x57')],_['isNil'](_0x3aec32[_0x8b45('0x37')])?'':_0x3aec32['dialPrefix'][_0x8b45('0x133')]()||'',_0x3aec32[_0x8b45('0x136')]>0x0?_0x218549[_0x8b45('0x107')][_0x8b45('0x134')]['substring'](_0x3aec32[_0x8b45('0x136')]):_0x218549[_0x8b45('0x107')][_0x8b45('0x134')]);var _0x443cf7=_0xa534a1[_0x8b45('0xa1')](_0x3aec32[_0x8b45('0x56')])?ut[_0x8b45('0x137')](_0x3aec32[_0x8b45('0x56')][_0x8b45('0x59')],_0x3aec32['dialOriginateCallerIdName'],_0x3aec32[_0x8b45('0x138')]>0x0?ut['getCallerIdRandom'](_0x3aec32[_0x8b45('0x35')],_0x3aec32[_0x8b45('0x138')]):_0x3aec32[_0x8b45('0x35')]):ut[_0x8b45('0x137')](_[_0x8b45('0x74')](_0x3aec32[_0x8b45('0xa2')])?_0x3aec32[_0x8b45('0x56')][_0x8b45('0x59')]:_0x3aec32[_0x8b45('0xa2')][_0x8b45('0x59')],_0x3aec32[_0x8b45('0x139')],_0x3aec32['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8b45('0x13a')](_0x3aec32[_0x8b45('0x35')],_0x3aec32[_0x8b45('0x138')]):_0x3aec32[_0x8b45('0x35')]);if(_0x443cf7){_0x478262[_0x8b45('0x13b')]=ut[_0x8b45('0x13c')](_0x443cf7);_0x478262['originatecalleridnum']=ut[_0x8b45('0x13d')](_0x443cf7);}var _0x261277=ut[_0x8b45('0x13e')](_0x3aec32,_0x218549,_0x3b857f,_0x443cf7,_0x4245d6,_0x478262);_[_0x8b45('0x13f')](_0x478262,ut[_0x8b45('0x140')](_0x261277));_0x478262[_0x8b45('0x95')]=moment()[_0x8b45('0x96')](_0x8b45('0x97'));ami[_0x8b45('0x7e')](ut[_0x8b45('0x141')](_0x478262,_0x3aec32,_0x261277,_0x478262[_0x8b45('0xb7')],_0x160165))['then'](function(_0x46a362){_0x3aec32[_0x8b45('0x78')]+=0x1;logger[_0x8b45('0x5e')]('[originated][increment]',_0x4245d6,'\x20Queue',_0x3aec32[_0x8b45('0x57')],'originated:\x20',_0x3aec32['originated']);_0x3976ff(_0x46a362);})[_0x8b45('0x81')](function(_0x43c29d){ut[_0x8b45('0xfa')](_0x478262,0xe,_0x8b45('0x142'));rpcDb[_0x8b45('0xfb')](_0x478262,_0x8b45('0x143'));_0x6b30ad(_0x43c29d);});});};Preview[_0x8b45('0xe')][_0x8b45('0x20')]=function(_0x3b6466){if(this['actions'][_0x3b6466['linkedid']]){this[_0x8b45('0x14')][_0x3b6466[_0x8b45('0xb8')]]['channel']=_0x3b6466['channel'];}};Preview[_0x8b45('0xe')]['syncOriginateResponse']=function(_0xf96b96){var _0x2cbd75=this;var _0x42acdb=this[_0x8b45('0x14')][_0xf96b96[_0x8b45('0x144')]];if(_0x42acdb){if(_0x42acdb[_0x8b45('0x10a')]&&this[_0x8b45('0x15')][_0x42acdb[_0x8b45('0x10a')]]){ut[_0x8b45('0x145')](_0x42acdb,this[_0x8b45('0x15')][_0x42acdb[_0x8b45('0x10a')]][_0x8b45('0x57')],this[_0x8b45('0x15')][_0x42acdb[_0x8b45('0x10a')]]['id']);}var _0x4f1d30=_[_0x8b45('0x146')](_0x42acdb);_0x4f1d30[_0x8b45('0xba')]=moment()[_0x8b45('0x96')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5ae53d=_0x2cbd75[_0x8b45('0x11')][_0x42acdb[_0x8b45('0x77')]];if(ut[_0x8b45('0x147')](_0xf96b96['response'])){if(_0x42acdb['unlockAgent']){rpcDb[_0x8b45('0x11c')](_0x42acdb[_0x8b45('0x10f')]);}if(_0x42acdb[_0x8b45('0xb7')]){rpcDb[_0x8b45('0x94')](_0x42acdb['idContact']);}ami[_0x8b45('0x27')](_0x8b45('0x148'),ut[_0x8b45('0xab')](_0x42acdb,_0x8b45('0x149'),this[_0x8b45('0x11')][_0x42acdb[_0x8b45('0x77')]]));this[_0x8b45('0xf6')](_0x4f1d30,_0x5ae53d,_0xf96b96);}else{_0x42acdb[_0x8b45('0x95')]=moment()[_0x8b45('0x96')](_0x8b45('0x97'));ut['logAgent'](_0x4f1d30,0x4,'Answer');rpcDb[_0x8b45('0xfb')](_0x4f1d30,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x8b45('0xe')]['syncHangup']=function(_0x17e00a){var _0x309a59=this;var _0x31e15c=this['actions'][_0x17e00a[_0x8b45('0xb8')]];var _0x457bea;if(_0x31e15c){_0x457bea=this[_0x8b45('0x11')][_0x31e15c[_0x8b45('0x77')]];logger[_0x8b45('0x5e')](_0x8b45('0x14a'),_0x17e00a[_0x8b45('0xb8')],_0x8b45('0xbe'),_0x457bea['name'],'pTalking:\x20',_0x457bea[_0x8b45('0x2c')]);}if(this[_0x8b45('0x14')][_0x17e00a['linkedid']]&&_0x17e00a[_0x8b45('0xb8')]!==_0x17e00a['uniqueid']){if(_0x17e00a[_0x8b45('0x14b')]==='16'&&this[_0x8b45('0x14')][_0x17e00a['linkedid']][_0x8b45('0x7a')]){this['callProgressDetectingCustomer'](_0x17e00a,_0x17e00a['linkedid'],_0x17e00a[_0x8b45('0x14b')]);}else if(this[_0x8b45('0x14')][_0x17e00a[_0x8b45('0xb8')]][_0x8b45('0x7a')]){logger[_0x8b45('0x5e')]('[syncHangup][talking][cause]',_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')],'\x20Queue',_0x457bea[_0x8b45('0x57')],_0x8b45('0x79'),_0x457bea['pTalking']);this['callProgressDetectingCustomer'](_0x17e00a,_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')]);}}else if(_0x31e15c&&_[_0x8b45('0x74')](_0x31e15c[_0x8b45('0x14c')])&&_0x457bea['dialQueueProject']&&_0x17e00a[_0x8b45('0xb8')]===_0x17e00a[_0x8b45('0xbd')]&&_[_0x8b45('0x74')](_0x17e00a[_0x8b45('0xf9')])&&_0x17e00a[_0x8b45('0x14b')]==='16'&&_0x17e00a[_0x8b45('0x14d')]==='6'&&_[_0x8b45('0xf7')](_0x31e15c[_0x8b45('0x14e')])){if(_0x31e15c[_0x8b45('0xb6')]){rpcDb[_0x8b45('0x11c')](_0x31e15c[_0x8b45('0x10f')]);}if(_0x31e15c['activeContact']){rpcDb[_0x8b45('0x94')](_0x31e15c[_0x8b45('0x10f')]);}_0x17e00a[_0x8b45('0xf9')]='22';this[_0x8b45('0xf6')](_0x31e15c,_0x457bea,_0x17e00a);}else if(_0x31e15c&&_0x31e15c[_0x8b45('0x14e')]){if(_0x17e00a[_0x8b45('0x14b')]==='16'&&this['actions'][_0x17e00a[_0x8b45('0xb8')]][_0x8b45('0x7a')]){logger[_0x8b45('0x5e')](_0x8b45('0x14f'),_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')],_0x8b45('0xbe'),_0x457bea[_0x8b45('0x57')],_0x8b45('0x79'),_0x457bea[_0x8b45('0x2c')]);this[_0x8b45('0xa5')](_0x17e00a,_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')]);}else if(this[_0x8b45('0x14')][_0x17e00a[_0x8b45('0xb8')]][_0x8b45('0x7a')]){logger[_0x8b45('0x5e')](_0x8b45('0x150'),_0x17e00a[_0x8b45('0xb8')],_0x17e00a[_0x8b45('0x14b')],_0x8b45('0xbe'),_0x457bea[_0x8b45('0x57')],_0x8b45('0x79'),_0x457bea['pTalking']);this[_0x8b45('0xa5')](_0x17e00a,_0x17e00a[_0x8b45('0xb8')],_0x17e00a['cause']);}}};Preview[_0x8b45('0xe')][_0x8b45('0x1e')]=function(_0x10b08c){if(this[_0x8b45('0x14')][_0x10b08c[_0x8b45('0xf5')]]&&_0x10b08c[_0x8b45('0xf5')]!==_0x10b08c['destuniqueid']){this[_0x8b45('0xa5')](_0x10b08c,_0x10b08c['destlinkedid'],_0x10b08c[_0x8b45('0xed')]);}};Preview[_0x8b45('0xe')][_0x8b45('0x1c')]=function(_0x20c8b4){if(this['actions'][_0x20c8b4[_0x8b45('0xb8')]]&&_0x20c8b4[_0x8b45('0xb8')]!==_0x20c8b4[_0x8b45('0xbd')]&&!this[_0x8b45('0x14')][_0x20c8b4[_0x8b45('0xb8')]]['dialAnswer']){if(_0x20c8b4[_0x8b45('0x14b')]==='1'){this[_0x8b45('0xa5')](_0x20c8b4,_0x20c8b4[_0x8b45('0xb8')],_0x20c8b4['cause']);}}};Preview[_0x8b45('0xe')][_0x8b45('0x151')]=function(_0xa2711,_0x57e75e,_0xd631be){if(this[_0x8b45('0x14')][_0xa2711]){if(_[_0x8b45('0x74')](this['actions'][_0xa2711][_0x8b45('0x152')])){this[_0x8b45('0x14')][_0xa2711]['variables']={};}this[_0x8b45('0x14')][_0xa2711][_0x8b45('0x152')][_0x57e75e]=_0xd631be;}};Preview[_0x8b45('0xe')][_0x8b45('0x22')]=function(_0x3e9ec4){try{if(!_['isNil'](_0x3e9ec4)){if(ut['filterKey'](_[_0x8b45('0x153')](_0x3e9ec4['variable'])[0x0])){this[_0x8b45('0x151')](_0x3e9ec4['uniqueid'],_[_0x8b45('0x153')](_0x3e9ec4[_0x8b45('0x154')])[0x0],_0x3e9ec4['value']);}}}catch(_0x3f9e9a){logger[_0x8b45('0x155')]('[syncVarSet][Preview]',util[_0x8b45('0x156')](_0x3f9e9a,{'showHidden':![],'depth':null}));}};Preview[_0x8b45('0xe')]['syncAttendedTransfer']=function(_0x2a4615){if(_0x2a4615){if(this[_0x8b45('0x14')][_0x2a4615[_0x8b45('0x157')]]){this[_0x8b45('0x14')][_0x2a4615['transfertargetlinkedid']][_0x8b45('0x14e')]=!![];}}};Preview[_0x8b45('0xe')][_0x8b45('0x158')]=function(_0x32d3bf){if(_0x32d3bf){if(this[_0x8b45('0x14')][_0x32d3bf[_0x8b45('0x159')]]){this[_0x8b45('0x14')][_0x32d3bf['transfererlinkedid']]['transfer']=!![];}}};module[_0x8b45('0x15a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index feafe90..e64146c 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 _0x3004=['../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3004,0xf7));var _0x4300=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x3004[_0x166742];return _0xb7814a;};'use strict';var util=require(_0x4300('0x0'));var BPromise=require(_0x4300('0x1'));var logger=require(_0x4300('0x2'))('preview');var _=require(_0x4300('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x4300('0x4'));var cmHopperHistory=require(_0x4300('0x5'));var cmHopperBlack=require(_0x4300('0x6'));var voiceQueueRt=require(_0x4300('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x4300('0x8'));function loggerCatch(_0x588f1d){return function(_0x233160){logger['error'](_0x588f1d,util[_0x4300('0x9')](_0x233160,{'showHidden':![],'depth':null}));};}function create(_0x4d7b56){return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](cmHopperHistory[_0x4300('0xc')](_0x4d7b56))[_0x4300('0xd')](loggerCatch(_0x4300('0xe')));}function createAgent(_0x1eaf78){return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](agentReportPreview[_0x4300('0xc')](_0x1eaf78))[_0x4300('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x36f4b6){return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](cmHopper[_0x4300('0xf')](_0x36f4b6,!![]))['catch'](loggerCatch(_0x4300('0x10')));}exports[_0x4300('0x11')]=function(_0x2a23a0){return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](cmHopperBlack[_0x4300('0x11')](_0x2a23a0))[_0x4300('0xd')](loggerCatch(_0x4300('0x12')));};exports['getContactPreview']=function(_0x38f00){return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](cmHopper[_0x4300('0x13')](_0x38f00))['catch'](loggerCatch(_0x4300('0x14')));};exports['createHistory']=function(_0x5e7dd2,_0x14cea1){create(_0x5e7dd2)['catch'](loggerCatch(_0x14cea1));moveContact(_0x5e7dd2)[_0x4300('0xd')](loggerCatch(_0x14cea1));};exports[_0x4300('0x15')]=function(_0x273953,_0xff10c3){createAgent(_0x273953)[_0x4300('0xd')](loggerCatch(_0xff10c3));};exports[_0x4300('0x16')]=function(_0x5a5264,_0x1826d9){create(_0x5a5264)[_0x4300('0xd')](loggerCatch(_0x1826d9));};exports['createCustomerFinal']=function(_0x25ff37,_0x2a8d6e){moveContact(_0x25ff37)[_0x4300('0xd')](loggerCatch(_0x2a8d6e));};exports[_0x4300('0x17')]=function(_0x16948a,_0x49028e,_0x4a90cc){if(_0x49028e){_0x16948a[_0x4300('0x18')]=null;}if(_0x4a90cc){_0x16948a['active']=![];}return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](cmHopper[_0x4300('0x17')](_0x16948a))['catch'](loggerCatch(_0x4300('0x19')));};exports[_0x4300('0x1a')]=function(_0x784824){return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](cmHopper[_0x4300('0x1a')](_0x784824))[_0x4300('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0x4300('0x1b')]=function(_0x293342){return BPromise[_0x4300('0xa')]()['then'](cmHopper[_0x4300('0x1b')]({'UserId':null},_0x293342,0x1))[_0x4300('0xd')](loggerCatch('[unlockContact]\x20'));};exports[_0x4300('0x1c')]=function(_0x33535a){return BPromise['resolve']()[_0x4300('0xb')](cmHopper[_0x4300('0x1b')]({'active':![]},_0x33535a,0x1))[_0x4300('0xd')](loggerCatch(_0x4300('0x1d')));};exports[_0x4300('0x1e')]=function(_0x3ea165){var _0x7b4101={};_0x7b4101[_0x4300('0x1f')]=_0x3ea165[_0x4300('0x1f')];_0x7b4101['uniqueid']=_0x3ea165[_0x4300('0x20')];_0x7b4101[_0x4300('0x21')]=_0x3ea165[_0x4300('0x21')];_0x7b4101[_0x4300('0x22')]=_0x3ea165['calleridname'];_0x7b4101[_0x4300('0x23')]=_0x3ea165[_0x4300('0x23')];_0x7b4101[_0x4300('0x24')]=_0x3ea165[_0x4300('0x25')];_0x7b4101[_0x4300('0x26')]=_0x3ea165[_0x4300('0x25')];_0x7b4101['queuecallercomplete']=0x1;_0x7b4101[_0x4300('0x27')]=_0x3ea165['endtime'];_0x7b4101['connectedlinename']=_0x3ea165[_0x4300('0x28')];_0x7b4101[_0x4300('0x29')]='from-sip';_0x7b4101[_0x4300('0x2a')]=_0x4300('0x2b');_0x7b4101[_0x4300('0x2c')]=0x0;_0x7b4101[_0x4300('0x2d')]=0x1;_0x7b4101[_0x4300('0x2e')]=_0x3ea165[_0x4300('0x28')];_0x7b4101['queuecallerexitreason']=_0x4300('0x2f');return BPromise[_0x4300('0xa')]()['then'](voiceQueueReport['create'](_0x7b4101))[_0x4300('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x4300('0x30')]=function(_0x4ba519,_0x1053c5){return BPromise['resolve']()[_0x4300('0xb')](cmHopper[_0x4300('0x30')](_0x4ba519,_0x1053c5))[_0x4300('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x4300('0x31')]=function(_0x39d358){return BPromise[_0x4300('0xa')]()[_0x4300('0xb')](cmHopper[_0x4300('0x17')](_0x39d358,!![],!![]))['catch'](loggerCatch(_0x4300('0x32')));}; \ No newline at end of file +var _0xd000=['createCustomerFinal','rescheduleContact','UserId','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','createHistory','resolve','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','createAgentHistory','createCustomerHistory'];(function(_0x235dca,_0x2d591c){var _0x5ad9cf=function(_0x1e2b2b){while(--_0x1e2b2b){_0x235dca['push'](_0x235dca['shift']());}};_0x5ad9cf(++_0x2d591c);}(_0xd000,0xee));var _0x0d00=function(_0x2fafe8,_0x24be3d){_0x2fafe8=_0x2fafe8-0x0;var _0x41e46c=_0xd000[_0x2fafe8];return _0x41e46c;};'use strict';var util=require(_0x0d00('0x0'));var BPromise=require(_0x0d00('0x1'));var logger=require('../../../config/logger')(_0x0d00('0x2'));var _=require(_0x0d00('0x3'));var cmHopper=require(_0x0d00('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x0d00('0x5'));var cmHopperBlack=require(_0x0d00('0x6'));var voiceQueueRt=require(_0x0d00('0x7'));var agentReportPreview=require(_0x0d00('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x130dfe){return function(_0x1e2e87){logger[_0x0d00('0x9')](_0x130dfe,util[_0x0d00('0xa')](_0x1e2e87,{'showHidden':![],'depth':null}));};}function create(_0x339468){return BPromise['resolve']()[_0x0d00('0xb')](cmHopperHistory[_0x0d00('0xc')](_0x339468))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x56d9fe){return BPromise[_0x0d00('0xd')]()[_0x0d00('0xb')](agentReportPreview[_0x0d00('0xc')](_0x56d9fe))[_0x0d00('0xe')](loggerCatch(_0x0d00('0xf')));}function moveContact(_0x59cd3e){return BPromise['resolve']()[_0x0d00('0xb')](cmHopper[_0x0d00('0x10')](_0x59cd3e,!![]))[_0x0d00('0xe')](loggerCatch(_0x0d00('0x11')));}exports[_0x0d00('0x12')]=function(_0x471d08){return BPromise[_0x0d00('0xd')]()[_0x0d00('0xb')](cmHopperBlack[_0x0d00('0x12')](_0x471d08))[_0x0d00('0xe')](loggerCatch(_0x0d00('0x13')));};exports['getContactPreview']=function(_0x4c196f){return BPromise['resolve']()[_0x0d00('0xb')](cmHopper['getContactPreview'](_0x4c196f))[_0x0d00('0xe')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0xa1649,_0x3b920f){create(_0xa1649)[_0x0d00('0xe')](loggerCatch(_0x3b920f));moveContact(_0xa1649)['catch'](loggerCatch(_0x3b920f));};exports[_0x0d00('0x14')]=function(_0x4d2055,_0x21e08a){createAgent(_0x4d2055)[_0x0d00('0xe')](loggerCatch(_0x21e08a));};exports[_0x0d00('0x15')]=function(_0x19da24,_0xec0728){create(_0x19da24)['catch'](loggerCatch(_0xec0728));};exports[_0x0d00('0x16')]=function(_0x1bf8d5,_0x1681c0){moveContact(_0x1bf8d5)[_0x0d00('0xe')](loggerCatch(_0x1681c0));};exports[_0x0d00('0x17')]=function(_0x5db564,_0x580bbe,_0x1c0221){if(_0x580bbe){_0x5db564[_0x0d00('0x18')]=null;}if(_0x1c0221){_0x5db564['active']=![];}return BPromise[_0x0d00('0xd')]()[_0x0d00('0xb')](cmHopper['rescheduleContact'](_0x5db564))[_0x0d00('0xe')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x0d00('0x19')]=function(_0x589519){return BPromise['resolve']()[_0x0d00('0xb')](cmHopper['countReScheduled'](_0x589519))[_0x0d00('0xe')](loggerCatch(_0x0d00('0x1a')));};exports[_0x0d00('0x1b')]=function(_0x3f96b8){return BPromise[_0x0d00('0xd')]()['then'](cmHopper[_0x0d00('0x1b')]({'UserId':null},_0x3f96b8,0x1))[_0x0d00('0xe')](loggerCatch(_0x0d00('0x1c')));};exports[_0x0d00('0x1d')]=function(_0x2bcecf){return BPromise[_0x0d00('0xd')]()[_0x0d00('0xb')](cmHopper[_0x0d00('0x1b')]({'active':![]},_0x2bcecf,0x1))[_0x0d00('0xe')](loggerCatch(_0x0d00('0x1e')));};exports[_0x0d00('0x1f')]=function(_0x136cc2){var _0x52cc35={};_0x52cc35['type']=_0x136cc2[_0x0d00('0x20')];_0x52cc35[_0x0d00('0x21')]=_0x136cc2['uniqueid'];_0x52cc35[_0x0d00('0x22')]=_0x136cc2[_0x0d00('0x22')];_0x52cc35['calleridname']=_0x136cc2[_0x0d00('0x23')];_0x52cc35[_0x0d00('0x24')]=_0x136cc2[_0x0d00('0x24')];_0x52cc35['queuecallerjoinAt']=_0x136cc2[_0x0d00('0x25')];_0x52cc35['queuecallerleaveAt']=_0x136cc2[_0x0d00('0x25')];_0x52cc35[_0x0d00('0x26')]=0x1;_0x52cc35[_0x0d00('0x27')]=_0x136cc2[_0x0d00('0x28')];_0x52cc35[_0x0d00('0x29')]=_0x136cc2['membername'];_0x52cc35['context']=_0x0d00('0x2a');_0x52cc35['exten']='xcally-motion-preview';_0x52cc35[_0x0d00('0x2b')]=0x0;_0x52cc35['assigned']=0x1;_0x52cc35[_0x0d00('0x2c')]=_0x136cc2[_0x0d00('0x2d')];_0x52cc35[_0x0d00('0x2e')]=_0x0d00('0x2f');return BPromise[_0x0d00('0xd')]()[_0x0d00('0xb')](voiceQueueReport[_0x0d00('0x30')](_0x52cc35))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x0d00('0x31')]=function(_0x53887f,_0x11517c){return BPromise[_0x0d00('0xd')]()[_0x0d00('0xb')](cmHopper[_0x0d00('0x31')](_0x53887f,_0x11517c))['catch'](loggerCatch(_0x0d00('0x32')));};exports[_0x0d00('0x33')]=function(_0x346017){return BPromise['resolve']()[_0x0d00('0xb')](cmHopper[_0x0d00('0x17')](_0x346017,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 66c204c..6430a19 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 _0xcae4=['endtime','logAgent','starttime','membername','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','scheduledat','add','ListId','VoiceQueueId','pTalking','buildObj','lastevent','queue','interface','channelAgent','voice','mandatoryDisposition','buildAcw','not_inuse','push','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridNumber','util','lodash','moment','preview','env','127.0.0.1','milliseconds','loggerCatch','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','updatedAt','%s%s','toUpper','toLowerVariables','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime'];(function(_0x5cd84b,_0x10b92c){var _0x3f9aa8=function(_0x387b8d){while(--_0x387b8d){_0x5cd84b['push'](_0x5cd84b['shift']());}};_0x3f9aa8(++_0x10b92c);}(_0xcae4,0x165));var _0x4cae=function(_0x5d0186,_0x27d279){_0x5d0186=_0x5d0186-0x0;var _0x48ece9=_0xcae4[_0x5d0186];return _0x48ece9;};'use strict';var util=require(_0x4cae('0x0'));var _=require(_0x4cae('0x1'));var moment=require(_0x4cae('0x2'));var logger=require('../../../../config/logger')(_0x4cae('0x3'));var ipAgi=process[_0x4cae('0x4')]['XCALLY_IP_AGI']||_0x4cae('0x5');function getSeconds(_0x5ccdcf,_0x502870){var _0x4d96a3=moment(_0x5ccdcf)[_0x4cae('0x6')](0x0);var _0x5d8b95=moment(_0x502870)['milliseconds'](0x0);return _0x4d96a3['diff'](_0x5d8b95,'seconds');}exports[_0x4cae('0x7')]=function(_0x260912){return function(_0x23bebd){logger[_0x4cae('0x8')](_0x260912,util[_0x4cae('0x9')](_0x23bebd,{'showHidden':![],'depth':null}));};};exports[_0x4cae('0xa')]=function(_0x17b441,_0x1cc4e1){logger['info'](_0x17b441,util[_0x4cae('0x9')](_0x1cc4e1,{'showHidden':![],'depth':null}));};exports[_0x4cae('0xb')]=function(_0x28114c,_0x854de0){logger[_0x4cae('0x8')](_0x28114c,util['inspect'](_0x854de0,{'showHidden':![],'depth':null}));};exports[_0x4cae('0xc')]=function(_0x3b9a1c){return function(_0x4234ca){logger[_0x4cae('0xd')](_0x3b9a1c,util['inspect'](_0x4234ca,{'showHidden':![],'depth':null}));};};exports[_0x4cae('0xe')]=function(_0x2687a1,_0x5a011b,_0x3dafbe){return{'message':_0x2687a1,'unlock':_0x5a011b,'active':_0x3dafbe};};exports[_0x4cae('0xf')]=function(_0x568c50,_0x58e1f5,_0x22af86){if(!_[_0x4cae('0x10')](_0x22af86)&&_0x4cae('0x11')===typeof _0x22af86&&!_[_0x4cae('0x12')](_0x22af86)){if(!_[_0x4cae('0x10')](_0x58e1f5)&&_0x4cae('0x11')===typeof _0x58e1f5&&!_['isEmpty'](_0x58e1f5)){return util[_0x4cae('0x13')](_0x4cae('0x14'),_0x58e1f5,_0x22af86);}return util[_0x4cae('0x13')](_0x4cae('0x14'),_0x22af86,_0x22af86);}if(!_[_0x4cae('0x10')](_0x568c50)&&'string'===typeof _0x568c50&&!_[_0x4cae('0x12')](_0x568c50)){return _0x568c50;}return _0x4cae('0x15');};exports[_0x4cae('0x16')]=function(_0x413dd2){if(_['isNil'](_0x413dd2)){return![];}return _0x413dd2;};exports[_0x4cae('0x17')]=function(_0x436865,_0x1caa3d,_0x30c201,_0x565a28,_0x47f1cf,_0x199bcf){var _0x5d91ea={'XMD-QUEUE':_0x1caa3d[_0x4cae('0x18')]?_0x1caa3d[_0x4cae('0x18')][_0x4cae('0x19')]:'','XMD-CALLERID':_0x565a28,'XMD-CALLERID-PREVIEW':_0x199bcf?util[_0x4cae('0x13')](_0x4cae('0x14'),_0x199bcf[_0x4cae('0x1a')],_0x199bcf[_0x4cae('0x1b')]):_0x565a28,'XMD-DIALID':_0x47f1cf,'XMD-CONTACTID':_0x1caa3d[_0x4cae('0x1c')],'XMD-CDRTYPE':_0x4cae('0x1d'),'CALLERID(all)':_0x565a28,'XMD-VOICEQUEUEID':_0x1caa3d['VoiceQueueId'],'XMD-DIALCHANNEL':_0x30c201,'XMD-DIALTIMEOUT':_0x436865[_0x4cae('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x4cae('0x13')](_0x4cae('0x1f'),_0x436865[_0x4cae('0x20')]?'g':'',_[_0x4cae('0x12')](_0x436865['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x436865[_0x4cae('0x21')]||'','XMD-AGI':_0x436865[_0x4cae('0x22')]?util[_0x4cae('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x436865['dialQueueProject']):_0x4cae('0x23'),'XMD-AGIAFTER':_0x436865['dialQueueProject2']?util['format'](_0x4cae('0x24'),ipAgi,_0x436865[_0x4cae('0x20')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x199bcf?_0x199bcf[_0x4cae('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x199bcf?_0x199bcf[_0x4cae('0x26')]:'','XMD-DESTINATION':_0x4cae('0x27'),'SIPADDHEADER':_0x4cae('0x28')};if(!_[_0x4cae('0x12')](_0x436865[_0x4cae('0x29')])){_0x5d91ea[util[_0x4cae('0x13')]('%s',_0x4cae('0x2a'))]=_0x436865['monitor_format'];_0x5d91ea[util[_0x4cae('0x13')]('%s',_0x4cae('0x2b'))]=_0x47f1cf;}if(_0x1caa3d&&_0x1caa3d[_0x4cae('0x2c')]){for(var _0x38f820 in _0x1caa3d[_0x4cae('0x2c')]){if(_0x1caa3d[_0x4cae('0x2c')][_0x4cae('0x2d')](_0x38f820)){if(!_[_0x4cae('0x2e')](_0x1caa3d[_0x4cae('0x2c')][_0x38f820])&&_0x38f820!=='id'&&_0x38f820!==_0x4cae('0x2f')&&_0x38f820!=='createdAt'&&_0x38f820!==_0x4cae('0x30')){_0x5d91ea[util[_0x4cae('0x13')](_0x4cae('0x31'),'XMD-',_[_0x4cae('0x32')](_0x38f820))]=_0x1caa3d[_0x4cae('0x2c')][_0x38f820];}}}}return _0x5d91ea;};exports[_0x4cae('0x33')]=function(_0x2559e7){var _0x3eb408={};for(var _0x334492 in _0x2559e7){if(_0x2559e7['hasOwnProperty'](_0x334492)){_0x3eb408[util[_0x4cae('0x13')]('%s',_['toLower'](_0x334492))]=_0x2559e7[_0x334492];}}return{'variables':_0x3eb408};};exports[_0x4cae('0x34')]=function(_0x1dd121,_0x412179){if(!_[_0x4cae('0x2e')](_0x1dd121)){if(_0x1dd121[_0x4cae('0x2d')](_0x4cae('0x35'))){if(_0x1dd121[_0x4cae('0x35')]>0x0){_0x1dd121[_0x4cae('0x35')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x412179);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x412179);}};exports[_0x4cae('0x36')]=function(_0x2c9c38){var _0x31be7f=moment()[_0x4cae('0x13')](_0x4cae('0x37'));_0x2c9c38[_0x4cae('0x38')]=0xd;_0x2c9c38[_0x4cae('0x39')]=_0x4cae('0x3a');_0x2c9c38['starttime']=_0x31be7f;_0x2c9c38[_0x4cae('0x3b')]=_0x31be7f;_0x2c9c38[_0x4cae('0x3c')]=_0x31be7f;};exports[_0x4cae('0x3d')]=function(_0x4b4a62,_0x30b173,_0x20659c){var _0x132655=moment()[_0x4cae('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b4a62[_0x4cae('0x38')]=_0x30b173;_0x4b4a62[_0x4cae('0x39')]=_0x20659c;_0x4b4a62[_0x4cae('0x3b')]=_0x132655;_0x4b4a62['ringtime']=getSeconds(_0x4b4a62[_0x4cae('0x3b')],_0x4b4a62[_0x4cae('0x3e')]);};exports['logLookAgent']=function(_0x10f56a,_0x399f3f,_0x1815f3){_0x10f56a[_0x4cae('0x3f')]=_0x399f3f;_0x10f56a[_0x4cae('0x40')]=_0x1815f3;};exports[_0x4cae('0x41')]=function(_0x34af54,_0x51e302,_0x573403){var _0xf1f885=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x34af54[_0x4cae('0x38')]=_0x51e302;_0x34af54[_0x4cae('0x39')]=_0x573403;_0x34af54[_0x4cae('0x3b')]=_0x34af54[_0x4cae('0x3b')]?_0x34af54[_0x4cae('0x3b')]:_0xf1f885;_0x34af54[_0x4cae('0x3c')]=_0x34af54[_0x4cae('0x3c')]?_0x34af54[_0x4cae('0x3c')]:_0xf1f885;_0x34af54[_0x4cae('0x42')]=getSeconds(_0x34af54[_0x4cae('0x3b')]||0x0,_0x34af54[_0x4cae('0x3e')]||0x0);_0x34af54[_0x4cae('0x43')]=_0x34af54[_0x4cae('0x44')]?getSeconds(_0x34af54['endtime'],_0x34af54[_0x4cae('0x44')]):0x0;};exports[_0x4cae('0x45')]=function(_0x4abdb0){return _0x4abdb0===_0x4cae('0x46');};exports[_0x4cae('0x47')]=function(_0x57cd0e,_0x2b84ba,_0x54a62b,_0x1af70f,_0xec0140){var _0x434011=_0x1af70f?'RECALL':_0x57cd0e[_0x4cae('0x1a')];_0x434011=_0xec0140?_0x4cae('0x48'):_0x434011;return{'actionid':_0x57cd0e[_0x4cae('0x49')],'action':_0x4cae('0x4a'),'channel':_0x57cd0e['channelAgent'],'callerid':util[_0x4cae('0x13')](_0x4cae('0x14'),_0x434011,_0x57cd0e[_0x4cae('0x1b')]),'Exten':_0x4cae('0x27'),'Context':'from-sip','Priority':'1','variable':_0x54a62b,'timeout':(_0x2b84ba['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x57cd0e[_0x4cae('0x49')]};};exports['totalGlobal']=function(_0x4c2aee){return _0x4c2aee[_0x4cae('0x4b')]+_0x4c2aee[_0x4cae('0x4c')]+_0x4c2aee[_0x4cae('0x4d')]+_0x4c2aee['countagentrejectretry']+_0x4c2aee[_0x4cae('0x4e')];};exports[_0x4cae('0x4f')]=function(_0x36ce76){var _0x35fd02=_[_0x4cae('0x50')](_0x36ce76);_0x35fd02['state']=0xf;_0x35fd02['statedesc']='Global';return _0x35fd02;};exports['scheduledAt']=function(_0x3ea14b,_0x52481b,_0x121fea){var _0x343334={};_0x343334[_0x52481b]=_0x3ea14b[_0x52481b];_0x343334['active']=![];_0x343334[_0x4cae('0x51')]=moment()[_0x4cae('0x52')](_0x121fea,'minutes')[_0x4cae('0x13')](_0x4cae('0x37'));_0x343334[_0x4cae('0x1c')]=_0x3ea14b[_0x4cae('0x1c')];_0x343334[_0x4cae('0x53')]=_0x3ea14b[_0x4cae('0x53')];_0x343334['VoiceQueueId']=_0x3ea14b[_0x4cae('0x54')]||undefined;return _0x343334;};exports['decrementTalkink']=function(_0x117a7c,_0x4c32a0){if(!_[_0x4cae('0x2e')](_0x117a7c)){if(_0x117a7c[_0x4cae('0x55')]>0x0){_0x117a7c[_0x4cae('0x55')]-=0x1;}else{logger[_0x4cae('0x8')](_0x4c32a0,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x4cae('0x8')](_0x4c32a0,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x3d859c){if(_0x3d859c<=0x0){return!![];}return![];};exports[_0x4cae('0x56')]=function(_0x3e509e,_0x1578a1,_0x2dff08){_0x3e509e[_0x4cae('0x57')]=_0x1578a1;_0x3e509e[_0x4cae('0x19')]=_0x3e509e[_0x4cae('0x58')];_0x3e509e[_0x4cae('0x59')]=_0x3e509e[_0x4cae('0x5a')];_0x3e509e['motionChannel']=_0x4cae('0x5b');if(_0x2dff08){_0x3e509e['mandatoryDisposition']=_0x2dff08[_0x4cae('0x5c')];}return _0x3e509e;};exports[_0x4cae('0x5d')]=function(_0x174bfb){var _0x3dead9={};_0x3dead9[_0x4cae('0x58')]=_0x174bfb[_0x4cae('0x58')];_0x3dead9[_0x4cae('0x59')]=_0x174bfb[_0x4cae('0x5a')];_0x3dead9[_0x4cae('0x49')]=_0x174bfb[_0x4cae('0x49')];return _0x3dead9;};exports['agentReadyId']=function(_0xa8df0){var _0x1272c2=[];for(var _0x2bb1f3 in _0xa8df0){if(_0xa8df0[_0x4cae('0x2d')](_0x2bb1f3)){if(!_[_0x4cae('0x2e')](_0xa8df0[_0x2bb1f3])&&_0xa8df0[_0x2bb1f3]['state']===_0x4cae('0x5e')&&_0xa8df0[_0x2bb1f3]['status']==='reachable'){_0x1272c2[_0x4cae('0x5f')](_0xa8df0[_0x2bb1f3]['id']);}}}return _0x1272c2;};exports[_0x4cae('0x60')]=function(_0xa0b2c5){var _0x3989ef=moment()[_0x4cae('0x6')](0x0);var _0x945d3d=moment(_0xa0b2c5)['milliseconds'](0x0);return _0x3989ef[_0x4cae('0x61')](_0x945d3d,_0x4cae('0x62'));};exports[_0x4cae('0x63')]=function(_0x3322f9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3322f9['ContactId'],'ListId':_0x3322f9['ListId'],'VoiceQueueId':_0x3322f9['VoiceQueueId']||undefined,'CampaignId':_0x3322f9[_0x4cae('0x64')]||undefined};};exports[_0x4cae('0x65')]=function(_0x25db75){if(_0x25db75===_0x4cae('0x49')||_0x25db75===_0x4cae('0x66')||_0x25db75===_0x4cae('0x58')||_0x25db75===_0x4cae('0x67')||_0x25db75===_0x4cae('0x68')||_0x25db75===_0x4cae('0x69')||_0x25db75===_0x4cae('0x3f')||_0x25db75==='channelAgent'||_0x25db75==='calleridname'||_0x25db75===_0x4cae('0x6a')||_0x25db75==='calleridnum'||_0x25db75===_0x4cae('0x51')||_0x25db75===_0x4cae('0x4b')||_0x25db75===_0x4cae('0x4c')||_0x25db75===_0x4cae('0x4d')||_0x25db75==='countglobal'||_0x25db75===_0x4cae('0x6b')||_0x25db75===_0x4cae('0x6c')||_0x25db75===_0x4cae('0x6d')||_0x25db75===_0x4cae('0x6e')||_0x25db75===_0x4cae('0x1c')||_0x25db75==='ListId'||_0x25db75===_0x4cae('0x40')||_0x25db75==='VoiceQueueId'||_0x25db75===_0x4cae('0x6f')||_0x25db75===_0x4cae('0x70')||_0x25db75===_0x4cae('0x71')||_0x25db75===_0x4cae('0x72')||_0x25db75===_0x4cae('0x73')||_0x25db75===_0x4cae('0x74')||_0x25db75===_0x4cae('0x75')||_0x25db75===_0x4cae('0x76')||_0x25db75===_0x4cae('0x77')||_0x25db75===_0x4cae('0x78')||_0x25db75==='xmd-contactid'||_0x25db75===_0x4cae('0x79')||_0x25db75===_0x4cae('0x7a')||_0x25db75===_0x4cae('0x7b')||_0x25db75==='xmd-agi'||_0x25db75===_0x4cae('0x7c')||_0x25db75===_0x4cae('0x7d')||_0x25db75===_0x4cae('0x7e')||_0x25db75===_0x4cae('0x7f')||_0x25db75===_0x4cae('0x80')||_0x25db75===_0x4cae('0x81')||_0x25db75===_0x4cae('0x82')||_0x25db75===_0x4cae('0x83')||_0x25db75==='rtpaudioqos'||_0x25db75===_0x4cae('0x7d')||_0x25db75===_0x4cae('0x7e')||_0x25db75==='rtpaudioqosjitterbridged'||_0x25db75==='rtpaudioqosloss'||_0x25db75===_0x4cae('0x81')||_0x25db75===_0x4cae('0x82')||_0x25db75===_0x4cae('0x83')||_0x25db75===_0x4cae('0x84')||_0x25db75===_0x4cae('0x85')||_0x25db75===_0x4cae('0x38')||_0x25db75===_0x4cae('0x39')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x3b61e0,_0x2a1901){var _0x2d2074,_0x283ad3,_0x54f076;if(_0x2a1901<=0x0){_0x2a1901=0x1;}_0x2d2074=new RegExp(_0x4cae('0x86')+_0x2a1901+'}$');_0x283ad3=Math[_0x4cae('0x87')](0xa,_0x2a1901-0x1);_0x54f076=Math[_0x4cae('0x87')](0xa,_0x2a1901)-0x1;return util['format']('%s',_[_0x4cae('0x88')](_0x3b61e0,_0x2d2074,_[_0x4cae('0x89')](_0x283ad3,_0x54f076)));};exports['extractCalleridName']=function(_0x2b16aa){var _0x1fdd21=_0x2b16aa['match'](/"(.*?)"/);return _0x1fdd21?_0x1fdd21[0x1]:_0x2b16aa;};exports[_0x4cae('0x8a')]=function(_0x1f0f20){var _0x570dfa=_0x1f0f20['match'](/<(.*?)>/);return _0x570dfa?_0x570dfa[0x1]:_0x1f0f20;}; \ No newline at end of file +var _0xbf58=['xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','diff','loggerCatch','error','inspect','loggerError','logger2','info','message','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','logLookAgent','membername','UserId','logCustomer','YYYY-MM-DD\x20HH:mm:ss','talktime','answertime','isFailure','variablesAction','RECALL','calleridname','BOOKED','channelAgent','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','mandatoryDisposition','buildAcw','queue','uniqueid','agentReadyId','status','reachable','push','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid'];(function(_0x26d34c,_0x55b436){var _0x174bd0=function(_0x2a1f05){while(--_0x2a1f05){_0x26d34c['push'](_0x26d34c['shift']());}};_0x174bd0(++_0x55b436);}(_0xbf58,0xa7));var _0x8bf5=function(_0x616dad,_0x17f78b){_0x616dad=_0x616dad-0x0;var _0x2be93b=_0xbf58[_0x616dad];return _0x2be93b;};'use strict';var util=require('util');var _=require(_0x8bf5('0x0'));var moment=require(_0x8bf5('0x1'));var logger=require(_0x8bf5('0x2'))(_0x8bf5('0x3'));var ipAgi=process[_0x8bf5('0x4')][_0x8bf5('0x5')]||_0x8bf5('0x6');function getSeconds(_0x39f287,_0x66a111){var _0x3ba90f=moment(_0x39f287)['milliseconds'](0x0);var _0x54ae30=moment(_0x66a111)['milliseconds'](0x0);return _0x3ba90f[_0x8bf5('0x7')](_0x54ae30,'seconds');}exports[_0x8bf5('0x8')]=function(_0x403324){return function(_0x529cc2){logger[_0x8bf5('0x9')](_0x403324,util[_0x8bf5('0xa')](_0x529cc2,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5bb5c3,_0x1ab8bf){logger['info'](_0x5bb5c3,util['inspect'](_0x1ab8bf,{'showHidden':![],'depth':null}));};exports[_0x8bf5('0xb')]=function(_0x45456c,_0x7d367c){logger[_0x8bf5('0x9')](_0x45456c,util[_0x8bf5('0xa')](_0x7d367c,{'showHidden':![],'depth':null}));};exports[_0x8bf5('0xc')]=function(_0xd0bf79){return function(_0x3f6109){logger[_0x8bf5('0xd')](_0xd0bf79,util[_0x8bf5('0xa')](_0x3f6109,{'showHidden':![],'depth':null}));};};exports[_0x8bf5('0xe')]=function(_0x59beb4,_0x281a11,_0x555a54){return{'message':_0x59beb4,'unlock':_0x281a11,'active':_0x555a54};};exports[_0x8bf5('0xf')]=function(_0x4b108e,_0x536825,_0x147508){if(!_[_0x8bf5('0x10')](_0x147508)&&'string'===typeof _0x147508&&!_[_0x8bf5('0x11')](_0x147508)){if(!_[_0x8bf5('0x10')](_0x536825)&&'string'===typeof _0x536825&&!_['isEmpty'](_0x536825)){return util['format']('\x22%s\x22\x20<%s>',_0x536825,_0x147508);}return util[_0x8bf5('0x12')](_0x8bf5('0x13'),_0x147508,_0x147508);}if(!_[_0x8bf5('0x10')](_0x4b108e)&&'string'===typeof _0x4b108e&&!_[_0x8bf5('0x11')](_0x4b108e)){return _0x4b108e;}return _0x8bf5('0x14');};exports[_0x8bf5('0x15')]=function(_0xbcf40){if(_[_0x8bf5('0x16')](_0xbcf40)){return![];}return _0xbcf40;};exports['addVariables']=function(_0x5819f0,_0x3c1a81,_0x41477c,_0x231355,_0x3fbbf0,_0x42d001){var _0x27fa59={'XMD-QUEUE':_0x3c1a81[_0x8bf5('0x17')]?_0x3c1a81[_0x8bf5('0x17')][_0x8bf5('0x18')]:'','XMD-CALLERID':_0x231355,'XMD-CALLERID-PREVIEW':_0x42d001?util['format'](_0x8bf5('0x13'),_0x42d001['calleridname'],_0x42d001[_0x8bf5('0x19')]):_0x231355,'XMD-DIALID':_0x3fbbf0,'XMD-CONTACTID':_0x3c1a81['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x231355,'XMD-VOICEQUEUEID':_0x3c1a81['VoiceQueueId'],'XMD-DIALCHANNEL':_0x41477c,'XMD-DIALTIMEOUT':_0x5819f0[_0x8bf5('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x8bf5('0x12')](_0x8bf5('0x1b'),_0x5819f0[_0x8bf5('0x1c')]?'g':'',_[_0x8bf5('0x11')](_0x5819f0[_0x8bf5('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5819f0[_0x8bf5('0x1e')]||'','XMD-AGI':_0x5819f0[_0x8bf5('0x1f')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x5819f0[_0x8bf5('0x1f')]):'NONE','XMD-AGIAFTER':_0x5819f0[_0x8bf5('0x1c')]?util['format'](_0x8bf5('0x20'),ipAgi,_0x5819f0['dialQueueProject2']):_0x8bf5('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x42d001?_0x42d001['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x42d001?_0x42d001[_0x8bf5('0x22')]:'','XMD-DESTINATION':_0x8bf5('0x23'),'SIPADDHEADER':_0x8bf5('0x24')};if(!_[_0x8bf5('0x11')](_0x5819f0[_0x8bf5('0x1d')])){_0x27fa59[util['format']('%s',_0x8bf5('0x25'))]=_0x5819f0[_0x8bf5('0x1d')];_0x27fa59[util[_0x8bf5('0x12')]('%s',_0x8bf5('0x26'))]=_0x3fbbf0;}if(_0x3c1a81&&_0x3c1a81[_0x8bf5('0x27')]){for(var _0x28e6c0 in _0x3c1a81[_0x8bf5('0x27')]){if(_0x3c1a81[_0x8bf5('0x27')][_0x8bf5('0x28')](_0x28e6c0)){if(!_[_0x8bf5('0x16')](_0x3c1a81['Contact'][_0x28e6c0])&&_0x28e6c0!=='id'&&_0x28e6c0!==_0x8bf5('0x29')&&_0x28e6c0!=='createdAt'&&_0x28e6c0!==_0x8bf5('0x2a')){_0x27fa59[util[_0x8bf5('0x12')](_0x8bf5('0x2b'),_0x8bf5('0x2c'),_[_0x8bf5('0x2d')](_0x28e6c0))]=_0x3c1a81['Contact'][_0x28e6c0];}}}}return _0x27fa59;};exports['toLowerVariables']=function(_0x1a8edc){var _0x3d45b4={};for(var _0x32b9e8 in _0x1a8edc){if(_0x1a8edc[_0x8bf5('0x28')](_0x32b9e8)){_0x3d45b4[util[_0x8bf5('0x12')]('%s',_[_0x8bf5('0x2e')](_0x32b9e8))]=_0x1a8edc[_0x32b9e8];}}return{'variables':_0x3d45b4};};exports[_0x8bf5('0x2f')]=function(_0x4bf992,_0x5df382){if(!_[_0x8bf5('0x16')](_0x4bf992)){if(_0x4bf992[_0x8bf5('0x28')](_0x8bf5('0x30'))){if(_0x4bf992[_0x8bf5('0x30')]>0x0){_0x4bf992[_0x8bf5('0x30')]-=0x1;}else{logger[_0x8bf5('0x9')](_0x8bf5('0x31'),_0x5df382);}}}else{logger[_0x8bf5('0x9')](_0x8bf5('0x32'),_0x5df382);}};exports[_0x8bf5('0x33')]=function(_0x5cf92d){var _0x15ce4a=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5cf92d['state']=0xd;_0x5cf92d[_0x8bf5('0x34')]=_0x8bf5('0x35');_0x5cf92d[_0x8bf5('0x36')]=_0x15ce4a;_0x5cf92d[_0x8bf5('0x37')]=_0x15ce4a;_0x5cf92d[_0x8bf5('0x38')]=_0x15ce4a;};exports[_0x8bf5('0x39')]=function(_0x334d71,_0x240dfb,_0x5bde68){var _0x1ddc2f=moment()[_0x8bf5('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x334d71[_0x8bf5('0x3a')]=_0x240dfb;_0x334d71[_0x8bf5('0x34')]=_0x5bde68;_0x334d71[_0x8bf5('0x37')]=_0x1ddc2f;_0x334d71[_0x8bf5('0x3b')]=getSeconds(_0x334d71[_0x8bf5('0x37')],_0x334d71[_0x8bf5('0x36')]);};exports[_0x8bf5('0x3c')]=function(_0x217023,_0x44d9a9,_0x351591){_0x217023[_0x8bf5('0x3d')]=_0x44d9a9;_0x217023[_0x8bf5('0x3e')]=_0x351591;};exports[_0x8bf5('0x3f')]=function(_0x4f3bac,_0x20ea90,_0x594cd1){var _0x4dd169=moment()['format'](_0x8bf5('0x40'));_0x4f3bac[_0x8bf5('0x3a')]=_0x20ea90;_0x4f3bac[_0x8bf5('0x34')]=_0x594cd1;_0x4f3bac[_0x8bf5('0x37')]=_0x4f3bac[_0x8bf5('0x37')]?_0x4f3bac[_0x8bf5('0x37')]:_0x4dd169;_0x4f3bac['endtime']=_0x4f3bac[_0x8bf5('0x38')]?_0x4f3bac['endtime']:_0x4dd169;_0x4f3bac[_0x8bf5('0x3b')]=getSeconds(_0x4f3bac['responsetime']||0x0,_0x4f3bac[_0x8bf5('0x36')]||0x0);_0x4f3bac[_0x8bf5('0x41')]=_0x4f3bac[_0x8bf5('0x42')]?getSeconds(_0x4f3bac[_0x8bf5('0x38')],_0x4f3bac['answertime']):0x0;};exports[_0x8bf5('0x43')]=function(_0x131f02){return _0x131f02==='Failure';};exports[_0x8bf5('0x44')]=function(_0x242b63,_0x52d2c2,_0x49e6ba,_0x41edd9,_0x3588da){var _0x8f77f7=_0x41edd9?_0x8bf5('0x45'):_0x242b63[_0x8bf5('0x46')];_0x8f77f7=_0x3588da?_0x8bf5('0x47'):_0x8f77f7;return{'actionid':_0x242b63['uniqueid'],'action':'originate','channel':_0x242b63[_0x8bf5('0x48')],'callerid':util['format'](_0x8bf5('0x13'),_0x8f77f7,_0x242b63['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x49e6ba,'timeout':(_0x52d2c2[_0x8bf5('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x242b63['uniqueid']};};exports['totalGlobal']=function(_0x23063f){return _0x23063f['countbusyretry']+_0x23063f[_0x8bf5('0x4a')]+_0x23063f[_0x8bf5('0x4b')]+_0x23063f[_0x8bf5('0x4c')]+_0x23063f['countnosuchnumberretry'];};exports[_0x8bf5('0x4d')]=function(_0x59c154){var _0x530e9b=_['clone'](_0x59c154);_0x530e9b[_0x8bf5('0x3a')]=0xf;_0x530e9b[_0x8bf5('0x34')]=_0x8bf5('0x4e');return _0x530e9b;};exports[_0x8bf5('0x4f')]=function(_0x14ca7a,_0x87ec99,_0x34b54e){var _0x2f78d9={};_0x2f78d9[_0x87ec99]=_0x14ca7a[_0x87ec99];_0x2f78d9[_0x8bf5('0x50')]=![];_0x2f78d9[_0x8bf5('0x51')]=moment()[_0x8bf5('0x52')](_0x34b54e,_0x8bf5('0x53'))[_0x8bf5('0x12')](_0x8bf5('0x40'));_0x2f78d9[_0x8bf5('0x54')]=_0x14ca7a[_0x8bf5('0x54')];_0x2f78d9[_0x8bf5('0x55')]=_0x14ca7a['ListId'];_0x2f78d9[_0x8bf5('0x56')]=_0x14ca7a[_0x8bf5('0x56')]||undefined;return _0x2f78d9;};exports[_0x8bf5('0x57')]=function(_0x47d48c,_0x2ec47b){if(!_[_0x8bf5('0x16')](_0x47d48c)){if(_0x47d48c[_0x8bf5('0x58')]>0x0){_0x47d48c[_0x8bf5('0x58')]-=0x1;}else{logger['error'](_0x2ec47b,_0x8bf5('0x59'));}}else{logger[_0x8bf5('0x9')](_0x2ec47b,_0x8bf5('0x5a'));}};exports[_0x8bf5('0x5b')]=function(_0x51c621){if(_0x51c621<=0x0){return!![];}return![];};exports['buildObj']=function(_0xcb21dc,_0x1912f0,_0x391d23){_0xcb21dc[_0x8bf5('0x5c')]=_0x1912f0;_0xcb21dc[_0x8bf5('0x18')]=_0xcb21dc['queue'];_0xcb21dc[_0x8bf5('0x5d')]=_0xcb21dc[_0x8bf5('0x48')];_0xcb21dc[_0x8bf5('0x5e')]='voice';if(_0x391d23){_0xcb21dc['mandatoryDisposition']=_0x391d23[_0x8bf5('0x5f')];}return _0xcb21dc;};exports[_0x8bf5('0x60')]=function(_0x33bcca){var _0x892723={};_0x892723[_0x8bf5('0x61')]=_0x33bcca[_0x8bf5('0x61')];_0x892723[_0x8bf5('0x5d')]=_0x33bcca[_0x8bf5('0x48')];_0x892723[_0x8bf5('0x62')]=_0x33bcca[_0x8bf5('0x62')];return _0x892723;};exports[_0x8bf5('0x63')]=function(_0x1365c7){var _0x5670fc=[];for(var _0x288997 in _0x1365c7){if(_0x1365c7[_0x8bf5('0x28')](_0x288997)){if(!_[_0x8bf5('0x16')](_0x1365c7[_0x288997])&&_0x1365c7[_0x288997][_0x8bf5('0x3a')]==='not_inuse'&&_0x1365c7[_0x288997][_0x8bf5('0x64')]===_0x8bf5('0x65')){_0x5670fc[_0x8bf5('0x66')](_0x1365c7[_0x288997]['id']);}}}return _0x5670fc;};exports['getDiff']=function(_0x11f588){var _0x29d6fd=moment()['milliseconds'](0x0);var _0xe30edb=moment(_0x11f588)['milliseconds'](0x0);return _0x29d6fd[_0x8bf5('0x7')](_0xe30edb,_0x8bf5('0x67'));};exports[_0x8bf5('0x68')]=function(_0x2ea7de){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ea7de[_0x8bf5('0x54')],'ListId':_0x2ea7de[_0x8bf5('0x55')],'VoiceQueueId':_0x2ea7de[_0x8bf5('0x56')]||undefined,'CampaignId':_0x2ea7de[_0x8bf5('0x69')]||undefined};};exports[_0x8bf5('0x6a')]=function(_0x378be2){if(_0x378be2===_0x8bf5('0x62')||_0x378be2===_0x8bf5('0x6b')||_0x378be2===_0x8bf5('0x61')||_0x378be2===_0x8bf5('0x6c')||_0x378be2===_0x8bf5('0x6d')||_0x378be2==='dialAnswer'||_0x378be2===_0x8bf5('0x3d')||_0x378be2===_0x8bf5('0x48')||_0x378be2===_0x8bf5('0x46')||_0x378be2===_0x8bf5('0x50')||_0x378be2===_0x8bf5('0x19')||_0x378be2===_0x8bf5('0x51')||_0x378be2==='countbusyretry'||_0x378be2===_0x8bf5('0x4a')||_0x378be2===_0x8bf5('0x4b')||_0x378be2===_0x8bf5('0x6e')||_0x378be2===_0x8bf5('0x6f')||_0x378be2===_0x8bf5('0x70')||_0x378be2===_0x8bf5('0x71')||_0x378be2===_0x8bf5('0x72')||_0x378be2==='ContactId'||_0x378be2===_0x8bf5('0x55')||_0x378be2===_0x8bf5('0x3e')||_0x378be2===_0x8bf5('0x56')||_0x378be2===_0x8bf5('0x73')||_0x378be2===_0x8bf5('0x74')||_0x378be2===_0x8bf5('0x75')||_0x378be2==='xmd-phone'||_0x378be2===_0x8bf5('0x76')||_0x378be2===_0x8bf5('0x77')||_0x378be2===_0x8bf5('0x78')||_0x378be2===_0x8bf5('0x79')||_0x378be2==='xmd-dialid'||_0x378be2==='xmd-dialchannel'||_0x378be2===_0x8bf5('0x7a')||_0x378be2==='xmd-cdrtype'||_0x378be2===_0x8bf5('0x7b')||_0x378be2===_0x8bf5('0x7c')||_0x378be2==='xmd-agi'||_0x378be2===_0x8bf5('0x7d')||_0x378be2===_0x8bf5('0x7e')||_0x378be2==='rtpaudioqosjitter'||_0x378be2===_0x8bf5('0x7f')||_0x378be2===_0x8bf5('0x80')||_0x378be2===_0x8bf5('0x81')||_0x378be2===_0x8bf5('0x82')||_0x378be2===_0x8bf5('0x83')||_0x378be2===_0x8bf5('0x7d')||_0x378be2===_0x8bf5('0x7e')||_0x378be2===_0x8bf5('0x84')||_0x378be2===_0x8bf5('0x7f')||_0x378be2==='rtpaudioqosloss'||_0x378be2===_0x8bf5('0x81')||_0x378be2==='rtpaudioqosrtt'||_0x378be2===_0x8bf5('0x83')||_0x378be2===_0x8bf5('0x85')||_0x378be2===_0x8bf5('0x86')||_0x378be2==='state'||_0x378be2===_0x8bf5('0x34')){return![];}return!![];};exports[_0x8bf5('0x87')]=function(_0x1fa8ed,_0x2c8722){var _0x3defbe,_0x22a6b9,_0xc39ca6;if(_0x2c8722<=0x0){_0x2c8722=0x1;}_0x3defbe=new RegExp(_0x8bf5('0x88')+_0x2c8722+'}$');_0x22a6b9=Math[_0x8bf5('0x89')](0xa,_0x2c8722-0x1);_0xc39ca6=Math[_0x8bf5('0x89')](0xa,_0x2c8722)-0x1;return util[_0x8bf5('0x12')]('%s',_[_0x8bf5('0x8a')](_0x1fa8ed,_0x3defbe,_[_0x8bf5('0x8b')](_0x22a6b9,_0xc39ca6)));};exports['extractCalleridName']=function(_0x28a250){var _0x4bb909=_0x28a250[_0x8bf5('0x8c')](/"(.*?)"/);return _0x4bb909?_0x4bb909[0x1]:_0x28a250;};exports[_0x8bf5('0x8d')]=function(_0x3e5c36){var _0x2a3f4a=_0x3e5c36[_0x8bf5('0x8c')](/<(.*?)>/);return _0x2a3f4a?_0x2a3f4a[0x1]:_0x3e5c36;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 50bbe43..a809602 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 _0x08b7=['queueadd','string','number','boolean','queueremove','queuepause','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x2755ba,_0x5e0e39){var _0x2c3a3d=function(_0xa76964){while(--_0xa76964){_0x2755ba['push'](_0x2755ba['shift']());}};_0x2c3a3d(++_0x5e0e39);}(_0x08b7,0x1b0));var _0x708b=function(_0x5c0c9d,_0x23d745){_0x5c0c9d=_0x5c0c9d-0x0;var _0xb1767d=_0x08b7[_0x5c0c9d];return _0xb1767d;};'use strict';exports[_0x708b('0x0')]={'queue':{'type':_0x708b('0x1'),'required':!![]},'interface':{'type':_0x708b('0x1'),'required':!![]},'membername':{'type':_0x708b('0x1'),'required':!![]},'penalty':{'type':_0x708b('0x2'),'required':![]},'paused':{'type':_0x708b('0x3'),'required':![]}};exports[_0x708b('0x4')]={'queue':{'type':_0x708b('0x1'),'required':!![]},'interface':{'type':_0x708b('0x1'),'required':!![]}};exports[_0x708b('0x5')]={'interface':{'type':_0x708b('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x708b('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x708b('0x1'),'required':!![]}};exports[_0x708b('0x6')]={'uniqueid':{'type':_0x708b('0x1'),'required':!![]},'filename':{'type':_0x708b('0x1')},'format':{'type':_0x708b('0x1')},'mixmonitorid':{'type':_0x708b('0x1')}};exports[_0x708b('0x7')]={'uniqueid':{'type':_0x708b('0x1'),'required':!![]}};exports[_0x708b('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x708b('0x1'),'required':!![]},'context':{'type':_0x708b('0x1')}}; \ No newline at end of file +var _0xd75b=['voicechannel','voicequeuechannelhangup','string','number','queuepause','boolean','reload'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0xd75b,0x1de));var _0xbd75=function(_0x67c05b,_0x366c79){_0x67c05b=_0x67c05b-0x0;var _0x252a3c=_0xd75b[_0x67c05b];return _0x252a3c;};'use strict';exports['queueadd']={'queue':{'type':_0xbd75('0x0'),'required':!![]},'interface':{'type':_0xbd75('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xbd75('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xbd75('0x2')]={'interface':{'type':_0xbd75('0x0'),'required':!![]},'paused':{'type':_0xbd75('0x3')},'reason':{'type':'string','required':![]}};exports[_0xbd75('0x4')]={'module':{'type':_0xbd75('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0xbd75('0x5')]={'uniqueid':{'type':_0xbd75('0x0'),'required':!![]},'filename':{'type':_0xbd75('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0xbd75('0x0')}};exports[_0xbd75('0x6')]={'uniqueid':{'type':_0xbd75('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xbd75('0x0'),'required':!![]},'exten':{'type':_0xbd75('0x0'),'required':!![]},'context':{'type':_0xbd75('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index f9360ee..1246152 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 _0x5649=['initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','SquareProject','initCampaignHopperHistory','exports','bluebird','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','isEmpty','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','length','isUndefined','initTelephones','mergeFromDatabase','initTrunks','initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','salesforceAccounts','initZohoAccounts','zohoAccounts','deskAccounts','initSugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerabandonAt','diff','queuecallerjoinAt','seconds','queuecallercomplete','queuecallercompleteAt'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x5649,0x143));var _0x9564=function(_0x324496,_0x3a4cdd){_0x324496=_0x324496-0x0;var _0x899545=_0x5649[_0x324496];return _0x899545;};'use strict';var BPromise=require(_0x9564('0x0'));var util=require(_0x9564('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x9564('0x2'));var Telephone=require(_0x9564('0x3'));var Trunk=require(_0x9564('0x4'));var VoiceQueue=require(_0x9564('0x5'));var Trigger=require(_0x9564('0x6'));var Template=require(_0x9564('0x7'));var Campaign=require(_0x9564('0x8'));var VoiceExtension=require(_0x9564('0x9'));var ZendeskAccount=require(_0x9564('0xa'));var SalesforceAccount=require(_0x9564('0xb'));var FreshdeskAccount=require(_0x9564('0xc'));var SugarcrmAccount=require(_0x9564('0xd'));var ZohoAccount=require(_0x9564('0xe'));var DeskAccount=require(_0x9564('0xf'));var VtigerAccount=require(_0x9564('0x10'));var ServicenowAccount=require(_0x9564('0x11'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x9564('0x12'));var FaxAccount=require(_0x9564('0x13'));var Realtime=function(){this[_0x9564('0x14')]={};this[_0x9564('0x15')]={};this[_0x9564('0x16')]={};this[_0x9564('0x17')]={};this[_0x9564('0x18')]={};this[_0x9564('0x19')]={};this[_0x9564('0x1a')]={};this[_0x9564('0x1b')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9564('0x1c')]={};this[_0x9564('0x1d')]={};this[_0x9564('0x1e')]={};this['outboundChannels']={};this[_0x9564('0x1f')]={};this[_0x9564('0x20')]={};this[_0x9564('0x21')]={};this['salesforceAccounts']={};this[_0x9564('0x22')]={};this[_0x9564('0x23')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0x9564('0x24')]={};this[_0x9564('0x25')]={};this['dynamics365Accounts']={};this[_0x9564('0x26')]={};this[_0x9564('0x27')]={};};function freeIsNotKey(_0x160a1c,_0x55faee,_0x2e1b80){var _0xe5bd8b=_[_0x9564('0x28')](_0x160a1c,function(_0x1fea04,_0x2a5706){return _0x1fea04[_0x2e1b80];});for(var _0x1497a0 in _0x55faee){if(_0x55faee[_0x9564('0x29')](_0x1497a0)){if(!_0xe5bd8b[_0x1497a0]){delete _0x55faee[_0x1497a0];}}}}function freeIsNotKeySip(_0x486401,_0x41ceaa){var _0x4dff35=_[_0x9564('0x28')](_0x486401,function(_0x22d78d,_0x2f39fb){return util[_0x9564('0x2a')](_0x9564('0x2b'),_0x22d78d[_0x9564('0x2c')]);});for(var _0xd5a583 in _0x41ceaa){if(_0x41ceaa[_0x9564('0x29')](_0xd5a583)){if(!_0x4dff35[_0xd5a583]){delete _0x41ceaa[_0xd5a583];}}}}function freeIsNotKeyAgent(_0x37402a,_0x250263){var _0x55c2e5=_[_0x9564('0x28')](_0x37402a,function(_0x31a2f0,_0x419c88){var _0x2390c4=_[_0x9564('0x2d')](_0x31a2f0[_0x9564('0x2e')])?util[_0x9564('0x2a')](_0x9564('0x2b'),_0x31a2f0[_0x9564('0x2c')]):_0x31a2f0[_0x9564('0x2e')];return _0x2390c4;});for(var _0x11d7e0 in _0x250263){if(_0x250263[_0x9564('0x29')](_0x11d7e0)){if(!_0x55c2e5[_0x11d7e0]){delete _0x250263[_0x11d7e0];}}}}function clearVoiceCallReports(_0x3afd09){_0x3afd09[_0x9564('0x2f')]=0x0;_0x3afd09[_0x9564('0x30')]=0x0;_0x3afd09[_0x9564('0x31')]=0x0;_0x3afd09[_0x9564('0x32')]=0x0;_0x3afd09['sumBillable']=0x0;}function clearCampaigns(_0x32e7cc){if(!_[_0x9564('0x33')](_0x32e7cc)){for(var _0x1c2808 in _0x32e7cc){if(_0x32e7cc['hasOwnProperty'](_0x1c2808)){_0x32e7cc[_0x1c2808]['ivrTotalCallsDays']=0x0;_0x32e7cc[_0x1c2808]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x15dba6){if(!_['isEmpty'](_0x15dba6)){for(var _0x592078 in _0x15dba6){if(_0x15dba6['hasOwnProperty'](_0x592078)){_0x15dba6[_0x592078][_0x9564('0x2f')]=0x0;_0x15dba6[_0x592078]['answered']=0x0;_0x15dba6[_0x592078]['unmanaged']=0x0;_0x15dba6[_0x592078][_0x9564('0x34')]=0x0;_0x15dba6[_0x592078][_0x9564('0x31')]=0x0;_0x15dba6[_0x592078][_0x9564('0x32')]=0x0;_0x15dba6[_0x592078][_0x9564('0x35')]=0x0;_0x15dba6[_0x592078][_0x9564('0x36')]=0x0;_0x15dba6[_0x592078][_0x9564('0x37')]=0x0;_0x15dba6[_0x592078]['outboundBusyCallsDay']=0x0;_0x15dba6[_0x592078][_0x9564('0x38')]=0x0;_0x15dba6[_0x592078]['outboundNoSuchCallsDay']=0x0;_0x15dba6[_0x592078]['outboundUnknownCallsDay']=0x0;_0x15dba6[_0x592078]['outboundDropCallsDayTimeout']=0x0;_0x15dba6[_0x592078][_0x9564('0x39')]=0x0;_0x15dba6[_0x592078][_0x9564('0x3a')]=0x0;_0x15dba6[_0x592078][_0x9564('0x3b')]=0x0;_0x15dba6[_0x592078][_0x9564('0x3c')]=0x0;_0x15dba6[_0x592078][_0x9564('0x3d')]=0x0;_0x15dba6[_0x592078][_0x9564('0x36')]=0x0;_0x15dba6[_0x592078][_0x9564('0x3e')]=0x0;_0x15dba6[_0x592078][_0x9564('0x3f')]=!![];}}}}Realtime[_0x9564('0x40')]['mergeFromDatabase']=function(_0x307769,_0x13acaf){for(var _0x1fd05d in _0x13acaf){if(_0x307769[_0x9564('0x29')](_0x1fd05d)){_0x307769[_0x1fd05d]=_0x13acaf[_0x1fd05d];}}};Realtime[_0x9564('0x40')]['initAgents']=function(){var _0x43af59=this;return function(_0x522aa7){if(_0x522aa7){freeIsNotKeyAgent(_0x522aa7,_0x43af59[_0x9564('0x14')]);for(var _0x45c056=0x0,_0x1e9cc3={},_0x57932e={};_0x45c056<_0x522aa7[_0x9564('0x41')];_0x45c056+=0x1){_0x1e9cc3=_0x522aa7[_0x45c056];var _0x462c4b=_['isNil'](_0x1e9cc3[_0x9564('0x2e')])?util[_0x9564('0x2a')](_0x9564('0x2b'),_0x1e9cc3[_0x9564('0x2c')]):_0x1e9cc3['interface'];if(_[_0x9564('0x42')](_0x43af59[_0x9564('0x14')][_0x462c4b])){_0x43af59[_0x9564('0x14')][_0x462c4b]=new Agent(_0x1e9cc3);}else{_0x43af59['mergeFromDatabase'](_0x43af59[_0x9564('0x14')][_0x462c4b],_0x1e9cc3);}}}return _0x43af59['agents'];};};Realtime[_0x9564('0x40')][_0x9564('0x43')]=function(){var _0x3dba08=this;return function(_0xa6ee0a){if(_0xa6ee0a){freeIsNotKeySip(_0xa6ee0a,_0x3dba08['telephones']);for(var _0x306f8e=0x0,_0x22bb03={},_0x1e1580={};_0x306f8e<_0xa6ee0a[_0x9564('0x41')];_0x306f8e+=0x1){_0x22bb03=_0xa6ee0a[_0x306f8e];if(_[_0x9564('0x42')](_0x3dba08[_0x9564('0x15')][util['format'](_0x9564('0x2b'),_0x22bb03['name'])])){_0x3dba08[_0x9564('0x15')][util['format'](_0x9564('0x2b'),_0x22bb03['name'])]=new Telephone(_0x22bb03);}else{_0x3dba08[_0x9564('0x44')](_0x3dba08[_0x9564('0x15')][util[_0x9564('0x2a')](_0x9564('0x2b'),_0x22bb03['name'])],_0x22bb03);}}}return _0x3dba08['telephones'];};};Realtime[_0x9564('0x40')][_0x9564('0x45')]=function(){var _0x671916=this;return function(_0x4821dc){if(_0x4821dc){freeIsNotKeySip(_0x4821dc,_0x671916[_0x9564('0x16')]);for(var _0x20b1ed=0x0,_0x44d433={},_0x4cb36e={};_0x20b1ed<_0x4821dc[_0x9564('0x41')];_0x20b1ed+=0x1){_0x44d433=_0x4821dc[_0x20b1ed];if(_[_0x9564('0x42')](_0x671916[_0x9564('0x16')][util['format'](_0x9564('0x2b'),_0x44d433[_0x9564('0x2c')])])){_0x671916[_0x9564('0x16')][util[_0x9564('0x2a')]('SIP/%s',_0x44d433[_0x9564('0x2c')])]=new Trunk(_0x44d433);}else{_0x671916['mergeFromDatabase'](_0x671916[_0x9564('0x16')][util[_0x9564('0x2a')]('SIP/%s',_0x44d433[_0x9564('0x2c')])],_0x44d433);}}}return _0x671916[_0x9564('0x16')];};};Realtime['prototype'][_0x9564('0x46')]=function(){var _0x52ed5a=this;return function(_0x2be658){if(_0x2be658){freeIsNotKey(_0x2be658,_0x52ed5a[_0x9564('0x17')],_0x9564('0x2c'));for(var _0xde45cd=0x0,_0x411210={},_0x3263d6={};_0xde45cd<_0x2be658[_0x9564('0x41')];_0xde45cd+=0x1){_0x411210=_0x2be658[_0xde45cd];if(_[_0x9564('0x42')](_0x52ed5a[_0x9564('0x17')][_0x411210[_0x9564('0x2c')]])){_0x52ed5a[_0x9564('0x17')][_0x411210[_0x9564('0x2c')]]=new VoiceQueue(_0x411210);}else{_0x52ed5a[_0x9564('0x44')](_0x52ed5a[_0x9564('0x17')][_0x411210[_0x9564('0x2c')]],_0x411210);}}}return _0x52ed5a[_0x9564('0x17')];};};Realtime['prototype'][_0x9564('0x47')]=function(){var _0x5922ed=this;return function(_0x48f04b){if(_0x48f04b){freeIsNotKey(_0x48f04b,_0x5922ed['triggers'],'id');for(var _0xaa5156=0x0,_0x57d5c7={},_0x2a287d={};_0xaa5156<_0x48f04b[_0x9564('0x41')];_0xaa5156+=0x1){_0x57d5c7=_0x48f04b[_0xaa5156];if(_[_0x9564('0x42')](_0x5922ed[_0x9564('0x18')][_0x57d5c7['id']])){_0x5922ed[_0x9564('0x18')][_0x57d5c7['id']]=new Trigger(_0x57d5c7);}else{_0x5922ed['mergeFromDatabase'](_0x5922ed['triggers'][_0x57d5c7['id']],_0x57d5c7);}}}return _0x5922ed['triggers'];};};Realtime[_0x9564('0x40')][_0x9564('0x48')]=function(){var _0x488e31=this;return function(_0x208b46){if(_0x208b46){freeIsNotKey(_0x208b46,_0x488e31['templates'],'id');for(var _0x22b861=0x0,_0x4ad704={},_0x551887={};_0x22b861<_0x208b46[_0x9564('0x41')];_0x22b861+=0x1){_0x4ad704=_0x208b46[_0x22b861];if(_[_0x9564('0x42')](_0x488e31['templates'][_0x4ad704['id']])){_0x488e31[_0x9564('0x1a')][_0x4ad704['id']]=new Template(_0x4ad704);}else{_0x488e31[_0x9564('0x44')](_0x488e31[_0x9564('0x1a')][_0x4ad704['id']],_0x4ad704);}}}return _0x488e31['templates'];};};Realtime[_0x9564('0x40')]['initZendeskAccounts']=function(){var _0x5d113c=this;return function(_0x554659){if(_0x554659){freeIsNotKey(_0x554659,_0x5d113c[_0x9564('0x21')],'id');for(var _0x429a61=0x0,_0x3db790={},_0x102e3c={};_0x429a61<_0x554659[_0x9564('0x41')];_0x429a61+=0x1){_0x3db790=_0x554659[_0x429a61];if(_[_0x9564('0x42')](_0x5d113c['zendeskAccounts'][_0x3db790['id']])){_0x5d113c[_0x9564('0x21')][_0x3db790['id']]=new ZendeskAccount(_0x3db790);}else{_0x5d113c[_0x9564('0x44')](_0x5d113c['zendeskAccounts'][_0x3db790['id']],_0x3db790);}}}return _0x5d113c[_0x9564('0x21')];};};Realtime[_0x9564('0x40')][_0x9564('0x49')]=function(){var _0xa99416=this;return function(_0x5795db){if(_0x5795db){freeIsNotKey(_0x5795db,_0xa99416[_0x9564('0x4a')],'id');for(var _0x22a987=0x0,_0x35e058={},_0x5d422f={};_0x22a987<_0x5795db[_0x9564('0x41')];_0x22a987+=0x1){_0x35e058=_0x5795db[_0x22a987];if(_[_0x9564('0x42')](_0xa99416[_0x9564('0x4a')][_0x35e058['id']])){_0xa99416[_0x9564('0x4a')][_0x35e058['id']]=new SalesforceAccount(_0x35e058);}else{_0xa99416[_0x9564('0x44')](_0xa99416[_0x9564('0x4a')][_0x35e058['id']],_0x35e058);}}}return _0xa99416['salesforceAccounts'];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x26c4f8=this;return function(_0x2cd5be){if(_0x2cd5be){freeIsNotKey(_0x2cd5be,_0x26c4f8[_0x9564('0x23')],'id');for(var _0x1b3b79=0x0,_0x452b9a={},_0x3694f5={};_0x1b3b79<_0x2cd5be[_0x9564('0x41')];_0x1b3b79+=0x1){_0x452b9a=_0x2cd5be[_0x1b3b79];if(_[_0x9564('0x42')](_0x26c4f8[_0x9564('0x23')][_0x452b9a['id']])){_0x26c4f8[_0x9564('0x23')][_0x452b9a['id']]=new FreshdeskAccount(_0x452b9a);}else{_0x26c4f8[_0x9564('0x44')](_0x26c4f8[_0x9564('0x23')][_0x452b9a['id']],_0x452b9a);}}}return _0x26c4f8[_0x9564('0x23')];};};Realtime['prototype'][_0x9564('0x4b')]=function(){var _0x4e2e5e=this;return function(_0x3f1591){if(_0x3f1591){freeIsNotKey(_0x3f1591,_0x4e2e5e[_0x9564('0x4c')],'id');for(var _0x19ee9b=0x0,_0x8cbc68={},_0x115402={};_0x19ee9b<_0x3f1591[_0x9564('0x41')];_0x19ee9b+=0x1){_0x8cbc68=_0x3f1591[_0x19ee9b];if(_[_0x9564('0x42')](_0x4e2e5e[_0x9564('0x4c')][_0x8cbc68['id']])){_0x4e2e5e[_0x9564('0x4c')][_0x8cbc68['id']]=new ZohoAccount(_0x8cbc68);}else{_0x4e2e5e[_0x9564('0x44')](_0x4e2e5e[_0x9564('0x4c')][_0x8cbc68['id']],_0x8cbc68);}}}return _0x4e2e5e[_0x9564('0x4c')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x28eeaf=this;return function(_0x37cdd2){if(_0x37cdd2){freeIsNotKey(_0x37cdd2,_0x28eeaf[_0x9564('0x4d')],'id');for(var _0x129359=0x0,_0x466447={},_0x557e00={};_0x129359<_0x37cdd2[_0x9564('0x41')];_0x129359+=0x1){_0x466447=_0x37cdd2[_0x129359];if(_[_0x9564('0x42')](_0x28eeaf['deskAccounts'][_0x466447['id']])){_0x28eeaf[_0x9564('0x4d')][_0x466447['id']]=new DeskAccount(_0x466447);}else{_0x28eeaf[_0x9564('0x44')](_0x28eeaf[_0x9564('0x4d')][_0x466447['id']],_0x466447);}}}return _0x28eeaf[_0x9564('0x4d')];};};Realtime[_0x9564('0x40')][_0x9564('0x4e')]=function(){var _0x23defb=this;return function(_0x76200d){if(_0x76200d){freeIsNotKey(_0x76200d,_0x23defb[_0x9564('0x22')],'id');for(var _0x32a22c=0x0,_0x5b4e87={},_0x5f5931={};_0x32a22c<_0x76200d[_0x9564('0x41')];_0x32a22c+=0x1){_0x5b4e87=_0x76200d[_0x32a22c];if(_[_0x9564('0x42')](_0x23defb[_0x9564('0x22')][_0x5b4e87['id']])){_0x23defb['sugarcrmAccounts'][_0x5b4e87['id']]=new SugarcrmAccount(_0x5b4e87);}else{_0x23defb[_0x9564('0x44')](_0x23defb['sugarcrmAccounts'][_0x5b4e87['id']],_0x5b4e87);}}}return _0x23defb['sugarcrmAccounts'];};};Realtime[_0x9564('0x40')]['initVtigerAccounts']=function(){var _0x176778=this;return function(_0x377452){if(_0x377452){freeIsNotKey(_0x377452,_0x176778[_0x9564('0x24')],'id');for(var _0x2d6071=0x0,_0x2cf434={},_0x5093b0={};_0x2d6071<_0x377452[_0x9564('0x41')];_0x2d6071+=0x1){_0x2cf434=_0x377452[_0x2d6071];if(_[_0x9564('0x42')](_0x176778[_0x9564('0x24')][_0x2cf434['id']])){_0x176778[_0x9564('0x24')][_0x2cf434['id']]=new VtigerAccount(_0x2cf434);}else{_0x176778[_0x9564('0x44')](_0x176778[_0x9564('0x24')][_0x2cf434['id']],_0x2cf434);}}}return _0x176778[_0x9564('0x24')];};};Realtime[_0x9564('0x40')][_0x9564('0x4f')]=function(){var _0x1b60bf=this;return function(_0x8aebe3){if(_0x8aebe3){freeIsNotKey(_0x8aebe3,_0x1b60bf['servicenowAccounts'],'id');for(var _0x369ab9=0x0,_0x27dc2d={},_0x4c0095={};_0x369ab9<_0x8aebe3[_0x9564('0x41')];_0x369ab9+=0x1){_0x27dc2d=_0x8aebe3[_0x369ab9];if(_[_0x9564('0x42')](_0x1b60bf['servicenowAccounts'][_0x27dc2d['id']])){_0x1b60bf[_0x9564('0x25')][_0x27dc2d['id']]=new ServicenowAccount(_0x27dc2d);}else{_0x1b60bf[_0x9564('0x44')](_0x1b60bf[_0x9564('0x25')][_0x27dc2d['id']],_0x27dc2d);}}}return _0x1b60bf[_0x9564('0x25')];};};Realtime[_0x9564('0x40')][_0x9564('0x50')]=function(){var _0x452e74=this;return function(_0x1c5b3f){if(_0x1c5b3f){freeIsNotKey(_0x1c5b3f,_0x452e74[_0x9564('0x51')],'id');for(var _0x228996=0x0,_0x39bb38={},_0x2c46c0={};_0x228996<_0x1c5b3f[_0x9564('0x41')];_0x228996+=0x1){_0x39bb38=_0x1c5b3f[_0x228996];if(_[_0x9564('0x42')](_0x452e74['dynamics365Accounts'][_0x39bb38['id']])){_0x452e74[_0x9564('0x51')][_0x39bb38['id']]=new Dynamics365Account(_0x39bb38);}else{_0x452e74[_0x9564('0x44')](_0x452e74[_0x9564('0x51')][_0x39bb38['id']],_0x39bb38);}}}return _0x452e74[_0x9564('0x51')];};};Realtime[_0x9564('0x40')]['initFreshsalesAccounts']=function(){var _0x30841e=this;return function(_0x58e9da){if(_0x58e9da){freeIsNotKey(_0x58e9da,_0x30841e[_0x9564('0x26')],'id');for(var _0x33c3be=0x0,_0x581b85={},_0x4e56d5={};_0x33c3be<_0x58e9da[_0x9564('0x41')];_0x33c3be+=0x1){_0x581b85=_0x58e9da[_0x33c3be];if(_[_0x9564('0x42')](_0x30841e[_0x9564('0x26')][_0x581b85['id']])){_0x30841e[_0x9564('0x26')][_0x581b85['id']]=new FreshsalesAccount(_0x581b85);}else{_0x30841e[_0x9564('0x44')](_0x30841e[_0x9564('0x26')][_0x581b85['id']],_0x581b85);}}}return _0x30841e[_0x9564('0x26')];};};Realtime[_0x9564('0x40')][_0x9564('0x52')]=function(){var _0x5738d9=this;return function(_0x3f88f){for(var _0x2a9d75=0x0;_0x2a9d75<_0x3f88f['length'];_0x2a9d75+=0x1){_[_0x9564('0x53')](_0x5738d9['voiceQueues'][_0x3f88f[_0x2a9d75][_0x9564('0x2c')]],_0x3f88f[_0x2a9d75]);}return _0x5738d9[_0x9564('0x17')];};};Realtime['prototype'][_0x9564('0x54')]=function(){var _0x4450a3=this;return function(_0x404cdb){clearVoiceQueues(_0x4450a3[_0x9564('0x17')]);if(_0x404cdb){_0x404cdb=_[_0x9564('0x55')](_0x404cdb,_0x9564('0x56'));for(var _0xfb4e05 in _0x404cdb){if(_0x404cdb[_0x9564('0x29')](_0xfb4e05)){var _0x1b44ce={};for(var _0x48f6ce=0x0;_0x48f6ce<_0x404cdb[_0xfb4e05]['length'];_0x48f6ce+=0x1){var _0x268618=_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x57')];if(_0x4450a3[_0x9564('0x17')][_0x268618]){if(_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x58')]){_0x4450a3[_0x9564('0x17')][_0x268618]['unmanaged']+=0x1;}if(_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x59')]){_0x4450a3[_0x9564('0x17')][_0x268618][_0x9564('0x34')]+=0x1;}_0x4450a3[_0x9564('0x17')][_0x268618][_0x9564('0x31')]+=moment(_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x5a')])['diff'](moment(_0x404cdb[_0xfb4e05][_0x48f6ce]['queuecallerjoinAt']),'seconds')||0x0;if(_0x48f6ce===_0x404cdb[_0xfb4e05][_0x9564('0x41')]-0x1){_0x4450a3[_0x9564('0x17')][_0x268618][_0x9564('0x32')]+=moment(_0x404cdb[_0xfb4e05][_0x48f6ce]['queuecallercompleteAt']||_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x5b')]||_0x404cdb[_0xfb4e05][_0x48f6ce]['queuecallerexitAt'])[_0x9564('0x5c')](moment(_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x5d')]),_0x9564('0x5e'))||0x0;_0x4450a3['voiceQueues'][_0x268618][_0x9564('0x2f')]+=0x1;if(_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x5f')]){_0x4450a3['voiceQueues'][_0x268618][_0x9564('0x30')]+=0x1;_0x4450a3[_0x9564('0x17')][_0x268618][_0x9564('0x35')]+=moment(_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x60')])[_0x9564('0x5c')](moment(_0x404cdb[_0xfb4e05][_0x48f6ce][_0x9564('0x5a')]),_0x9564('0x5e'))||0x0;}}else{_0x4450a3[_0x9564('0x17')][_0x268618][_0x9564('0x32')]+=_0x4450a3[_0x9564('0x17')][_0x268618][_0x9564('0x31')]||0x0;}}}}}}return _0x4450a3[_0x9564('0x17')];};};Realtime[_0x9564('0x40')][_0x9564('0x61')]=function(){var _0xc05a3a=this;return function(_0x42b003){clearVoiceCallReports(_0xc05a3a[_0x9564('0x1b')]);if(_0x42b003){for(var _0x3f1eba=0x0;_0x3f1eba<_0x42b003['length'];_0x3f1eba+=0x1){_0xc05a3a[_0x9564('0x1b')][_0x9564('0x2f')]+=0x1;_0xc05a3a[_0x9564('0x1b')][_0x9564('0x32')]+=_0x42b003[_0x3f1eba][_0x9564('0x62')];if(_0x42b003[_0x3f1eba][_0x9564('0x63')]===_0x9564('0x64')){_0xc05a3a['outbound'][_0x9564('0x30')]+=0x1;_0xc05a3a[_0x9564('0x1b')][_0x9564('0x31')]+=_0x42b003[_0x3f1eba][_0x9564('0x62')]-_0x42b003[_0x3f1eba][_0x9564('0x65')]||0x0;_0xc05a3a[_0x9564('0x1b')][_0x9564('0x35')]+=_0x42b003[_0x3f1eba][_0x9564('0x65')];}}}return _0xc05a3a[_0x9564('0x1b')];};};Realtime[_0x9564('0x40')]['initCampaigns']=function(){var _0x1a6dc4=this;return function(_0xe6159b){if(_0xe6159b){freeIsNotKey(_0xe6159b,_0x1a6dc4[_0x9564('0x19')],_0x9564('0x2c'));for(var _0x46f9ad=0x0,_0x4b17da={};_0x46f9ad<_0xe6159b[_0x9564('0x41')];_0x46f9ad+=0x1){_0x4b17da=_0xe6159b[_0x46f9ad];if(_['isUndefined'](_0x1a6dc4[_0x9564('0x19')][_0x4b17da[_0x9564('0x2c')]])){_0x1a6dc4['campaigns'][_0x4b17da['name']]=new Campaign(_0x4b17da);}else{_0x1a6dc4[_0x9564('0x44')](_0x1a6dc4[_0x9564('0x19')][_0x4b17da['name']],_0x4b17da);_0x1a6dc4[_0x9564('0x19')][_0x4b17da[_0x9564('0x2c')]]['dialQueueProject']=_0x4b17da['SquareProject']?_0x4b17da[_0x9564('0x66')][_0x9564('0x2c')]:undefined;}}}return _0x1a6dc4[_0x9564('0x19')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x359e8b=this;return function(_0x2879a6){if(_0x2879a6){freeIsNotKey(_0x2879a6,_0x359e8b[_0x9564('0x1c')],'id');for(var _0x12f690=0x0,_0x2ad9ee={};_0x12f690<_0x2879a6[_0x9564('0x41')];_0x12f690+=0x1){_0x2ad9ee=_0x2879a6[_0x12f690];if(_[_0x9564('0x42')](_0x359e8b[_0x9564('0x1c')][_0x2ad9ee['id']])){_0x359e8b[_0x9564('0x1c')][_0x2ad9ee['id']]=new VoiceExtension(_0x2ad9ee);}else{_0x359e8b['mergeFromDatabase'](_0x359e8b[_0x9564('0x1c')][_0x2ad9ee['id']],_0x2ad9ee);}}}return _0x359e8b[_0x9564('0x1c')];};};Realtime[_0x9564('0x40')][_0x9564('0x67')]=function(){var _0x55537c=this;return function(_0x31373b){clearCampaigns(_0x55537c[_0x9564('0x19')]);for(var _0x4a241=0x0;_0x4a241<_0x31373b['length'];_0x4a241+=0x1){_[_0x9564('0x53')](_0x55537c['campaigns'][_0x31373b[_0x4a241][_0x9564('0x2c')]],_0x31373b[_0x4a241]);}return _0x55537c[_0x9564('0x19')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0xe1f563=this;return function(_0x4b6abe){if(_0x4b6abe){freeIsNotKey(_0x4b6abe,_0xe1f563[_0x9564('0x27')],'id');for(var _0x222d21=0x0,_0x15e240={},_0x40c599={};_0x222d21<_0x4b6abe[_0x9564('0x41')];_0x222d21+=0x1){_0x15e240=_0x4b6abe[_0x222d21];if(_['isUndefined'](_0xe1f563['faxAccounts'][_0x15e240['id']])){_0xe1f563[_0x9564('0x27')][_0x15e240['id']]=new FaxAccount(_0x15e240);}else{_0xe1f563[_0x9564('0x44')](_0xe1f563[_0x9564('0x27')][_0x15e240['id']],_0x15e240);}}}return _0xe1f563[_0x9564('0x27')];};};module[_0x9564('0x68')]=Realtime; \ No newline at end of file +var _0xa8ed=['../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','format','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','trunks','initVoiceQueues','initTriggers','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template'];(function(_0xa20971,_0x1bf32c){var _0x4f4271=function(_0x299c14){while(--_0x299c14){_0xa20971['push'](_0xa20971['shift']());}};_0x4f4271(++_0x1bf32c);}(_0xa8ed,0xd1));var _0xda8e=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xa8ed[_0x279d37];return _0x530173;};'use strict';var BPromise=require(_0xda8e('0x0'));var util=require('util');var _=require('lodash');var moment=require(_0xda8e('0x1'));var Agent=require(_0xda8e('0x2'));var Telephone=require(_0xda8e('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xda8e('0x4'));var Trigger=require(_0xda8e('0x5'));var Template=require(_0xda8e('0x6'));var Campaign=require(_0xda8e('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xda8e('0x8'));var SalesforceAccount=require(_0xda8e('0x9'));var FreshdeskAccount=require(_0xda8e('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xda8e('0xb'));var DeskAccount=require(_0xda8e('0xc'));var VtigerAccount=require(_0xda8e('0xd'));var ServicenowAccount=require(_0xda8e('0xe'));var Dynamics365Account=require(_0xda8e('0xf'));var FreshsalesAccount=require(_0xda8e('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xda8e('0x11')]={};this[_0xda8e('0x12')]={};this['trunks']={};this[_0xda8e('0x13')]={};this[_0xda8e('0x14')]={};this['campaigns']={};this[_0xda8e('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xda8e('0x16')]={};this[_0xda8e('0x17')]={};this[_0xda8e('0x18')]={};this[_0xda8e('0x19')]={};this['timers']={};this[_0xda8e('0x1a')]={};this[_0xda8e('0x1b')]={};this[_0xda8e('0x1c')]={};this['sugarcrmAccounts']={};this[_0xda8e('0x1d')]={};this[_0xda8e('0x1e')]={};this[_0xda8e('0x1f')]={};this[_0xda8e('0x20')]={};this[_0xda8e('0x21')]={};this[_0xda8e('0x22')]={};this[_0xda8e('0x23')]={};this[_0xda8e('0x24')]={};};function freeIsNotKey(_0x2f7d0a,_0x336173,_0x4d9546){var _0x377694=_[_0xda8e('0x25')](_0x2f7d0a,function(_0x313ad4,_0x448713){return _0x313ad4[_0x4d9546];});for(var _0x199715 in _0x336173){if(_0x336173[_0xda8e('0x26')](_0x199715)){if(!_0x377694[_0x199715]){delete _0x336173[_0x199715];}}}}function freeIsNotKeySip(_0x53f8d4,_0x38ac8e){var _0xdf005e=_[_0xda8e('0x25')](_0x53f8d4,function(_0x460f55,_0x21d635){return util['format'](_0xda8e('0x27'),_0x460f55[_0xda8e('0x28')]);});for(var _0x35666f in _0x38ac8e){if(_0x38ac8e[_0xda8e('0x26')](_0x35666f)){if(!_0xdf005e[_0x35666f]){delete _0x38ac8e[_0x35666f];}}}}function freeIsNotKeyAgent(_0x409739,_0x1851d1){var _0x4ec84d=_[_0xda8e('0x25')](_0x409739,function(_0x39a982,_0x38d07c){var _0x1357ad=_['isNil'](_0x39a982['interface'])?util[_0xda8e('0x29')](_0xda8e('0x27'),_0x39a982[_0xda8e('0x28')]):_0x39a982[_0xda8e('0x2a')];return _0x1357ad;});for(var _0x5c81ff in _0x1851d1){if(_0x1851d1[_0xda8e('0x26')](_0x5c81ff)){if(!_0x4ec84d[_0x5c81ff]){delete _0x1851d1[_0x5c81ff];}}}}function clearVoiceCallReports(_0x5dfc91){_0x5dfc91[_0xda8e('0x2b')]=0x0;_0x5dfc91[_0xda8e('0x2c')]=0x0;_0x5dfc91[_0xda8e('0x2d')]=0x0;_0x5dfc91[_0xda8e('0x2e')]=0x0;_0x5dfc91[_0xda8e('0x2f')]=0x0;}function clearCampaigns(_0x426f0b){if(!_['isEmpty'](_0x426f0b)){for(var _0x3edc3a in _0x426f0b){if(_0x426f0b['hasOwnProperty'](_0x3edc3a)){_0x426f0b[_0x3edc3a]['ivrTotalCallsDays']=0x0;_0x426f0b[_0x3edc3a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x393bc7){if(!_[_0xda8e('0x30')](_0x393bc7)){for(var _0x22a5d9 in _0x393bc7){if(_0x393bc7[_0xda8e('0x26')](_0x22a5d9)){_0x393bc7[_0x22a5d9][_0xda8e('0x2b')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x2c')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x31')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x32')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x2d')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x2e')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x2f')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x33')]=0x0;_0x393bc7[_0x22a5d9]['outboundNoAnswerCallsDay']=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x34')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x35')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x36')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x37')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x38')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x39')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x3a')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x3b')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x3c')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x3d')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x33')]=0x0;_0x393bc7[_0x22a5d9][_0xda8e('0x3e')]=0x0;_0x393bc7[_0x22a5d9]['queueStatusComplete']=!![];}}}}Realtime[_0xda8e('0x3f')][_0xda8e('0x40')]=function(_0x24ffb4,_0x1a107e){for(var _0x4dcb06 in _0x1a107e){if(_0x24ffb4[_0xda8e('0x26')](_0x4dcb06)){_0x24ffb4[_0x4dcb06]=_0x1a107e[_0x4dcb06];}}};Realtime[_0xda8e('0x3f')][_0xda8e('0x41')]=function(){var _0x517bdc=this;return function(_0x32d5b3){if(_0x32d5b3){freeIsNotKeyAgent(_0x32d5b3,_0x517bdc[_0xda8e('0x11')]);for(var _0x45a800=0x0,_0x333262={},_0x112722={};_0x45a800<_0x32d5b3[_0xda8e('0x42')];_0x45a800+=0x1){_0x333262=_0x32d5b3[_0x45a800];var _0x4419aa=_[_0xda8e('0x43')](_0x333262[_0xda8e('0x2a')])?util[_0xda8e('0x29')](_0xda8e('0x27'),_0x333262[_0xda8e('0x28')]):_0x333262[_0xda8e('0x2a')];if(_[_0xda8e('0x44')](_0x517bdc[_0xda8e('0x11')][_0x4419aa])){_0x517bdc[_0xda8e('0x11')][_0x4419aa]=new Agent(_0x333262);}else{_0x517bdc[_0xda8e('0x40')](_0x517bdc[_0xda8e('0x11')][_0x4419aa],_0x333262);}}}return _0x517bdc[_0xda8e('0x11')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x45')]=function(){var _0xa34ff8=this;return function(_0x3ad029){if(_0x3ad029){freeIsNotKeySip(_0x3ad029,_0xa34ff8['telephones']);for(var _0x2220c2=0x0,_0x2362d={},_0x5931f9={};_0x2220c2<_0x3ad029['length'];_0x2220c2+=0x1){_0x2362d=_0x3ad029[_0x2220c2];if(_[_0xda8e('0x44')](_0xa34ff8[_0xda8e('0x12')][util[_0xda8e('0x29')]('SIP/%s',_0x2362d['name'])])){_0xa34ff8[_0xda8e('0x12')][util[_0xda8e('0x29')](_0xda8e('0x27'),_0x2362d[_0xda8e('0x28')])]=new Telephone(_0x2362d);}else{_0xa34ff8[_0xda8e('0x40')](_0xa34ff8['telephones'][util[_0xda8e('0x29')]('SIP/%s',_0x2362d['name'])],_0x2362d);}}}return _0xa34ff8[_0xda8e('0x12')];};};Realtime[_0xda8e('0x3f')]['initTrunks']=function(){var _0x2b2e65=this;return function(_0x2c42a7){if(_0x2c42a7){freeIsNotKeySip(_0x2c42a7,_0x2b2e65['trunks']);for(var _0x4ea89c=0x0,_0x1d9a7d={},_0x2d05a5={};_0x4ea89c<_0x2c42a7[_0xda8e('0x42')];_0x4ea89c+=0x1){_0x1d9a7d=_0x2c42a7[_0x4ea89c];if(_[_0xda8e('0x44')](_0x2b2e65['trunks'][util[_0xda8e('0x29')]('SIP/%s',_0x1d9a7d['name'])])){_0x2b2e65[_0xda8e('0x46')][util[_0xda8e('0x29')](_0xda8e('0x27'),_0x1d9a7d['name'])]=new Trunk(_0x1d9a7d);}else{_0x2b2e65[_0xda8e('0x40')](_0x2b2e65[_0xda8e('0x46')][util[_0xda8e('0x29')](_0xda8e('0x27'),_0x1d9a7d[_0xda8e('0x28')])],_0x1d9a7d);}}}return _0x2b2e65[_0xda8e('0x46')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x47')]=function(){var _0x27d280=this;return function(_0x55a21c){if(_0x55a21c){freeIsNotKey(_0x55a21c,_0x27d280[_0xda8e('0x13')],_0xda8e('0x28'));for(var _0x379ba4=0x0,_0x2bbda4={},_0x5603ae={};_0x379ba4<_0x55a21c['length'];_0x379ba4+=0x1){_0x2bbda4=_0x55a21c[_0x379ba4];if(_[_0xda8e('0x44')](_0x27d280[_0xda8e('0x13')][_0x2bbda4[_0xda8e('0x28')]])){_0x27d280['voiceQueues'][_0x2bbda4[_0xda8e('0x28')]]=new VoiceQueue(_0x2bbda4);}else{_0x27d280[_0xda8e('0x40')](_0x27d280['voiceQueues'][_0x2bbda4[_0xda8e('0x28')]],_0x2bbda4);}}}return _0x27d280[_0xda8e('0x13')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x48')]=function(){var _0x3f1127=this;return function(_0x5aa857){if(_0x5aa857){freeIsNotKey(_0x5aa857,_0x3f1127[_0xda8e('0x14')],'id');for(var _0x18df35=0x0,_0x461c4d={},_0x1823ea={};_0x18df35<_0x5aa857[_0xda8e('0x42')];_0x18df35+=0x1){_0x461c4d=_0x5aa857[_0x18df35];if(_[_0xda8e('0x44')](_0x3f1127[_0xda8e('0x14')][_0x461c4d['id']])){_0x3f1127[_0xda8e('0x14')][_0x461c4d['id']]=new Trigger(_0x461c4d);}else{_0x3f1127[_0xda8e('0x40')](_0x3f1127[_0xda8e('0x14')][_0x461c4d['id']],_0x461c4d);}}}return _0x3f1127[_0xda8e('0x14')];};};Realtime[_0xda8e('0x3f')]['initTemplates']=function(){var _0x3458ab=this;return function(_0x5104c6){if(_0x5104c6){freeIsNotKey(_0x5104c6,_0x3458ab[_0xda8e('0x15')],'id');for(var _0x204b3a=0x0,_0x1f44f9={},_0x1c4342={};_0x204b3a<_0x5104c6[_0xda8e('0x42')];_0x204b3a+=0x1){_0x1f44f9=_0x5104c6[_0x204b3a];if(_[_0xda8e('0x44')](_0x3458ab[_0xda8e('0x15')][_0x1f44f9['id']])){_0x3458ab[_0xda8e('0x15')][_0x1f44f9['id']]=new Template(_0x1f44f9);}else{_0x3458ab[_0xda8e('0x40')](_0x3458ab[_0xda8e('0x15')][_0x1f44f9['id']],_0x1f44f9);}}}return _0x3458ab[_0xda8e('0x15')];};};Realtime[_0xda8e('0x3f')]['initZendeskAccounts']=function(){var _0x2c2391=this;return function(_0x5adcd7){if(_0x5adcd7){freeIsNotKey(_0x5adcd7,_0x2c2391[_0xda8e('0x1b')],'id');for(var _0x2e44f1=0x0,_0x5f3e07={},_0x253273={};_0x2e44f1<_0x5adcd7[_0xda8e('0x42')];_0x2e44f1+=0x1){_0x5f3e07=_0x5adcd7[_0x2e44f1];if(_[_0xda8e('0x44')](_0x2c2391[_0xda8e('0x1b')][_0x5f3e07['id']])){_0x2c2391[_0xda8e('0x1b')][_0x5f3e07['id']]=new ZendeskAccount(_0x5f3e07);}else{_0x2c2391[_0xda8e('0x40')](_0x2c2391['zendeskAccounts'][_0x5f3e07['id']],_0x5f3e07);}}}return _0x2c2391['zendeskAccounts'];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x49')]=function(){var _0x3316a0=this;return function(_0x5e66ed){if(_0x5e66ed){freeIsNotKey(_0x5e66ed,_0x3316a0[_0xda8e('0x1c')],'id');for(var _0x595cba=0x0,_0x342b47={},_0x112f40={};_0x595cba<_0x5e66ed['length'];_0x595cba+=0x1){_0x342b47=_0x5e66ed[_0x595cba];if(_[_0xda8e('0x44')](_0x3316a0[_0xda8e('0x1c')][_0x342b47['id']])){_0x3316a0[_0xda8e('0x1c')][_0x342b47['id']]=new SalesforceAccount(_0x342b47);}else{_0x3316a0[_0xda8e('0x40')](_0x3316a0[_0xda8e('0x1c')][_0x342b47['id']],_0x342b47);}}}return _0x3316a0[_0xda8e('0x1c')];};};Realtime[_0xda8e('0x3f')]['initFreshdeskAccounts']=function(){var _0x2c4b6f=this;return function(_0x26ce03){if(_0x26ce03){freeIsNotKey(_0x26ce03,_0x2c4b6f[_0xda8e('0x1d')],'id');for(var _0x338cec=0x0,_0x5d6ebf={},_0x28fc64={};_0x338cec<_0x26ce03[_0xda8e('0x42')];_0x338cec+=0x1){_0x5d6ebf=_0x26ce03[_0x338cec];if(_[_0xda8e('0x44')](_0x2c4b6f[_0xda8e('0x1d')][_0x5d6ebf['id']])){_0x2c4b6f[_0xda8e('0x1d')][_0x5d6ebf['id']]=new FreshdeskAccount(_0x5d6ebf);}else{_0x2c4b6f[_0xda8e('0x40')](_0x2c4b6f[_0xda8e('0x1d')][_0x5d6ebf['id']],_0x5d6ebf);}}}return _0x2c4b6f['freshdeskAccounts'];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x4a')]=function(){var _0x4c5654=this;return function(_0x3e9e86){if(_0x3e9e86){freeIsNotKey(_0x3e9e86,_0x4c5654[_0xda8e('0x1e')],'id');for(var _0xfe4a8=0x0,_0x45a639={},_0x5a7b54={};_0xfe4a8<_0x3e9e86[_0xda8e('0x42')];_0xfe4a8+=0x1){_0x45a639=_0x3e9e86[_0xfe4a8];if(_['isUndefined'](_0x4c5654[_0xda8e('0x1e')][_0x45a639['id']])){_0x4c5654['zohoAccounts'][_0x45a639['id']]=new ZohoAccount(_0x45a639);}else{_0x4c5654['mergeFromDatabase'](_0x4c5654['zohoAccounts'][_0x45a639['id']],_0x45a639);}}}return _0x4c5654[_0xda8e('0x1e')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x4b')]=function(){var _0x2ab800=this;return function(_0x5cde73){if(_0x5cde73){freeIsNotKey(_0x5cde73,_0x2ab800[_0xda8e('0x1f')],'id');for(var _0x5ee382=0x0,_0xd2688c={},_0x3067fb={};_0x5ee382<_0x5cde73[_0xda8e('0x42')];_0x5ee382+=0x1){_0xd2688c=_0x5cde73[_0x5ee382];if(_[_0xda8e('0x44')](_0x2ab800[_0xda8e('0x1f')][_0xd2688c['id']])){_0x2ab800[_0xda8e('0x1f')][_0xd2688c['id']]=new DeskAccount(_0xd2688c);}else{_0x2ab800[_0xda8e('0x40')](_0x2ab800[_0xda8e('0x1f')][_0xd2688c['id']],_0xd2688c);}}}return _0x2ab800[_0xda8e('0x1f')];};};Realtime[_0xda8e('0x3f')]['initSugarcrmAccounts']=function(){var _0x35d467=this;return function(_0x270063){if(_0x270063){freeIsNotKey(_0x270063,_0x35d467['sugarcrmAccounts'],'id');for(var _0xb2614b=0x0,_0x9691b5={},_0x1b5772={};_0xb2614b<_0x270063[_0xda8e('0x42')];_0xb2614b+=0x1){_0x9691b5=_0x270063[_0xb2614b];if(_[_0xda8e('0x44')](_0x35d467['sugarcrmAccounts'][_0x9691b5['id']])){_0x35d467['sugarcrmAccounts'][_0x9691b5['id']]=new SugarcrmAccount(_0x9691b5);}else{_0x35d467[_0xda8e('0x40')](_0x35d467[_0xda8e('0x4c')][_0x9691b5['id']],_0x9691b5);}}}return _0x35d467[_0xda8e('0x4c')];};};Realtime['prototype'][_0xda8e('0x4d')]=function(){var _0x4b4e96=this;return function(_0x19c2d9){if(_0x19c2d9){freeIsNotKey(_0x19c2d9,_0x4b4e96[_0xda8e('0x20')],'id');for(var _0x2165a5=0x0,_0x2282a6={},_0x141f38={};_0x2165a5<_0x19c2d9['length'];_0x2165a5+=0x1){_0x2282a6=_0x19c2d9[_0x2165a5];if(_[_0xda8e('0x44')](_0x4b4e96[_0xda8e('0x20')][_0x2282a6['id']])){_0x4b4e96[_0xda8e('0x20')][_0x2282a6['id']]=new VtigerAccount(_0x2282a6);}else{_0x4b4e96['mergeFromDatabase'](_0x4b4e96['vtigerAccounts'][_0x2282a6['id']],_0x2282a6);}}}return _0x4b4e96['vtigerAccounts'];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x4e')]=function(){var _0x2191f7=this;return function(_0x3777ee){if(_0x3777ee){freeIsNotKey(_0x3777ee,_0x2191f7[_0xda8e('0x21')],'id');for(var _0x5c5128=0x0,_0x46de44={},_0x35ce99={};_0x5c5128<_0x3777ee[_0xda8e('0x42')];_0x5c5128+=0x1){_0x46de44=_0x3777ee[_0x5c5128];if(_[_0xda8e('0x44')](_0x2191f7[_0xda8e('0x21')][_0x46de44['id']])){_0x2191f7[_0xda8e('0x21')][_0x46de44['id']]=new ServicenowAccount(_0x46de44);}else{_0x2191f7[_0xda8e('0x40')](_0x2191f7[_0xda8e('0x21')][_0x46de44['id']],_0x46de44);}}}return _0x2191f7[_0xda8e('0x21')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x4f')]=function(){var _0x14c98a=this;return function(_0x5a73c0){if(_0x5a73c0){freeIsNotKey(_0x5a73c0,_0x14c98a[_0xda8e('0x22')],'id');for(var _0xdd4c46=0x0,_0x40105f={},_0xb77013={};_0xdd4c46<_0x5a73c0[_0xda8e('0x42')];_0xdd4c46+=0x1){_0x40105f=_0x5a73c0[_0xdd4c46];if(_['isUndefined'](_0x14c98a['dynamics365Accounts'][_0x40105f['id']])){_0x14c98a['dynamics365Accounts'][_0x40105f['id']]=new Dynamics365Account(_0x40105f);}else{_0x14c98a['mergeFromDatabase'](_0x14c98a['dynamics365Accounts'][_0x40105f['id']],_0x40105f);}}}return _0x14c98a['dynamics365Accounts'];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x50')]=function(){var _0x55613a=this;return function(_0x3b7d5f){if(_0x3b7d5f){freeIsNotKey(_0x3b7d5f,_0x55613a['freshsalesAccounts'],'id');for(var _0x2993af=0x0,_0xf18056={},_0x3b27c5={};_0x2993af<_0x3b7d5f['length'];_0x2993af+=0x1){_0xf18056=_0x3b7d5f[_0x2993af];if(_[_0xda8e('0x44')](_0x55613a[_0xda8e('0x23')][_0xf18056['id']])){_0x55613a[_0xda8e('0x23')][_0xf18056['id']]=new FreshsalesAccount(_0xf18056);}else{_0x55613a[_0xda8e('0x40')](_0x55613a[_0xda8e('0x23')][_0xf18056['id']],_0xf18056);}}}return _0x55613a['freshsalesAccounts'];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x51')]=function(){var _0x417fb0=this;return function(_0x2b6e4a){for(var _0x35969b=0x0;_0x35969b<_0x2b6e4a['length'];_0x35969b+=0x1){_[_0xda8e('0x52')](_0x417fb0[_0xda8e('0x13')][_0x2b6e4a[_0x35969b][_0xda8e('0x28')]],_0x2b6e4a[_0x35969b]);}return _0x417fb0['voiceQueues'];};};Realtime[_0xda8e('0x3f')]['initVoiceQueueReports']=function(){var _0x2e5427=this;return function(_0x4c526e){clearVoiceQueues(_0x2e5427[_0xda8e('0x13')]);if(_0x4c526e){_0x4c526e=_[_0xda8e('0x53')](_0x4c526e,_0xda8e('0x54'));for(var _0x567fb1 in _0x4c526e){if(_0x4c526e['hasOwnProperty'](_0x567fb1)){var _0x3c1073={};for(var _0x2a9cbc=0x0;_0x2a9cbc<_0x4c526e[_0x567fb1]['length'];_0x2a9cbc+=0x1){var _0x33ea26=_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x55')];if(_0x2e5427[_0xda8e('0x13')][_0x33ea26]){if(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x56')]){_0x2e5427[_0xda8e('0x13')][_0x33ea26][_0xda8e('0x31')]+=0x1;}if(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x57')]){_0x2e5427['voiceQueues'][_0x33ea26][_0xda8e('0x32')]+=0x1;}_0x2e5427[_0xda8e('0x13')][_0x33ea26][_0xda8e('0x2d')]+=moment(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x58')])[_0xda8e('0x59')](moment(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x5a')]),_0xda8e('0x5b'))||0x0;if(_0x2a9cbc===_0x4c526e[_0x567fb1]['length']-0x1){_0x2e5427['voiceQueues'][_0x33ea26]['sumDuration']+=moment(_0x4c526e[_0x567fb1][_0x2a9cbc]['queuecallercompleteAt']||_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x5c')]||_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x5d')])[_0xda8e('0x59')](moment(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x5a')]),_0xda8e('0x5b'))||0x0;_0x2e5427[_0xda8e('0x13')][_0x33ea26]['total']+=0x1;if(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x5e')]){_0x2e5427['voiceQueues'][_0x33ea26][_0xda8e('0x2c')]+=0x1;_0x2e5427[_0xda8e('0x13')][_0x33ea26][_0xda8e('0x2f')]+=moment(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x5f')])[_0xda8e('0x59')](moment(_0x4c526e[_0x567fb1][_0x2a9cbc][_0xda8e('0x58')]),'seconds')||0x0;}}else{_0x2e5427[_0xda8e('0x13')][_0x33ea26][_0xda8e('0x2e')]+=_0x2e5427[_0xda8e('0x13')][_0x33ea26][_0xda8e('0x2d')]||0x0;}}}}}}return _0x2e5427[_0xda8e('0x13')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x60')]=function(){var _0x2bea62=this;return function(_0x2b59b0){clearVoiceCallReports(_0x2bea62['outbound']);if(_0x2b59b0){for(var _0x41d501=0x0;_0x41d501<_0x2b59b0['length'];_0x41d501+=0x1){_0x2bea62[_0xda8e('0x61')]['total']+=0x1;_0x2bea62[_0xda8e('0x61')][_0xda8e('0x2e')]+=_0x2b59b0[_0x41d501][_0xda8e('0x62')];if(_0x2b59b0[_0x41d501][_0xda8e('0x63')]===_0xda8e('0x64')){_0x2bea62[_0xda8e('0x61')]['answered']+=0x1;_0x2bea62[_0xda8e('0x61')]['sumHoldTime']+=_0x2b59b0[_0x41d501]['duration']-_0x2b59b0[_0x41d501]['billableseconds']||0x0;_0x2bea62[_0xda8e('0x61')]['sumBillable']+=_0x2b59b0[_0x41d501]['billableseconds'];}}}return _0x2bea62[_0xda8e('0x61')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x65')]=function(){var _0x405527=this;return function(_0x4b7efd){if(_0x4b7efd){freeIsNotKey(_0x4b7efd,_0x405527[_0xda8e('0x66')],_0xda8e('0x28'));for(var _0x2056d4=0x0,_0x40361b={};_0x2056d4<_0x4b7efd[_0xda8e('0x42')];_0x2056d4+=0x1){_0x40361b=_0x4b7efd[_0x2056d4];if(_[_0xda8e('0x44')](_0x405527[_0xda8e('0x66')][_0x40361b[_0xda8e('0x28')]])){_0x405527[_0xda8e('0x66')][_0x40361b['name']]=new Campaign(_0x40361b);}else{_0x405527[_0xda8e('0x40')](_0x405527['campaigns'][_0x40361b['name']],_0x40361b);_0x405527[_0xda8e('0x66')][_0x40361b['name']][_0xda8e('0x67')]=_0x40361b[_0xda8e('0x68')]?_0x40361b[_0xda8e('0x68')]['name']:undefined;}}}return _0x405527[_0xda8e('0x66')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x69')]=function(){var _0x4c3466=this;return function(_0x453d88){if(_0x453d88){freeIsNotKey(_0x453d88,_0x4c3466[_0xda8e('0x16')],'id');for(var _0x149ffa=0x0,_0x1c7e24={};_0x149ffa<_0x453d88[_0xda8e('0x42')];_0x149ffa+=0x1){_0x1c7e24=_0x453d88[_0x149ffa];if(_[_0xda8e('0x44')](_0x4c3466[_0xda8e('0x16')][_0x1c7e24['id']])){_0x4c3466[_0xda8e('0x16')][_0x1c7e24['id']]=new VoiceExtension(_0x1c7e24);}else{_0x4c3466['mergeFromDatabase'](_0x4c3466[_0xda8e('0x16')][_0x1c7e24['id']],_0x1c7e24);}}}return _0x4c3466[_0xda8e('0x16')];};};Realtime[_0xda8e('0x3f')][_0xda8e('0x6a')]=function(){var _0x56efe9=this;return function(_0x2efb52){clearCampaigns(_0x56efe9[_0xda8e('0x66')]);for(var _0x27bfd9=0x0;_0x27bfd9<_0x2efb52['length'];_0x27bfd9+=0x1){_[_0xda8e('0x52')](_0x56efe9[_0xda8e('0x66')][_0x2efb52[_0x27bfd9][_0xda8e('0x28')]],_0x2efb52[_0x27bfd9]);}return _0x56efe9[_0xda8e('0x66')];};};Realtime[_0xda8e('0x3f')]['initFaxAccounts']=function(){var _0xbe28c=this;return function(_0x313f8e){if(_0x313f8e){freeIsNotKey(_0x313f8e,_0xbe28c[_0xda8e('0x24')],'id');for(var _0x28c211=0x0,_0x51e836={},_0xbca8f4={};_0x28c211<_0x313f8e[_0xda8e('0x42')];_0x28c211+=0x1){_0x51e836=_0x313f8e[_0x28c211];if(_[_0xda8e('0x44')](_0xbe28c[_0xda8e('0x24')][_0x51e836['id']])){_0xbe28c[_0xda8e('0x24')][_0x51e836['id']]=new FaxAccount(_0x51e836);}else{_0xbe28c['mergeFromDatabase'](_0xbe28c[_0xda8e('0x24')][_0x51e836['id']],_0x51e836);}}}return _0xbe28c[_0xda8e('0x24')];};};module[_0xda8e('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 6d5a17b..d438552 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 _0x8a1a=['UserId','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','Local','indexOf','mobile','phone','substring','lastIndexOf','membername','transfererlinkedid','lodash','moment','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','isNil','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','lastdata','queue','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x8a1a,0xc8));var _0xa8a1=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0x8a1a[_0x13524d];return _0x9918b4;};'use strict';var _=require(_0xa8a1('0x0'));var moment=require(_0xa8a1('0x1'));var util=require(_0xa8a1('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xa8a1('0x3'));var RpcVoiceCallReport=require(_0xa8a1('0x4'));var RpcVoiceDialReport=require(_0xa8a1('0x5'));var RpcMemberReport=require(_0xa8a1('0x6'));var RpcVoiceQueueReport=require(_0xa8a1('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xa8a1('0x8'));var VoiceCallReport=require(_0xa8a1('0x9'));var VoiceAgentReport=require(_0xa8a1('0xa'));var VoiceDialReport=require(_0xa8a1('0xb'));var UserReport=require(_0xa8a1('0xc'));function Report(_0x52ffdf){this[_0xa8a1('0xd')]=_0x52ffdf;this[_0xa8a1('0xe')]=_0x52ffdf[_0xa8a1('0xe')];this[_0xa8a1('0xf')]=_0x52ffdf[_0xa8a1('0xf')];}Report[_0xa8a1('0x10')][_0xa8a1('0x11')]=function(_0x52a86a){var _0x5e8120=new VoiceQueueReport(this[_0xa8a1('0xd')]);var _0x5a4643=new VoiceAgentReport(this[_0xa8a1('0xd')]);var _0x19ebe6=new VoiceDialReport(this[_0xa8a1('0xd')]);var _0x3c49d4=new VoiceCallReport(this[_0xa8a1('0xd')]);var _0x4fb5d9=new UserReport(this['realtime']);if(config[_0xa8a1('0x12')]&&config[_0xa8a1('0x12')]['disabled']){ami['on'](_0xa8a1('0x13'),this['voiceQueueReport'][_0xa8a1('0x14')](this));ami['on'](_0xa8a1('0x15'),this[_0xa8a1('0x16')][_0xa8a1('0x14')](this));ami['on'](_0xa8a1('0x17'),this[_0xa8a1('0x18')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xa8a1('0x19')][_0xa8a1('0x14')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0xa8a1('0x1a'),this[_0xa8a1('0x1b')]['bind'](this));}};Report[_0xa8a1('0x10')][_0xa8a1('0x1c')]=function(_0x185394){var _0x453da8;_0x453da8=_[_0xa8a1('0x1d')](this[_0xa8a1('0xe')],function(_0x1c90c2){return _0x1c90c2[_0xa8a1('0x1e')]==_0x185394||_0x1c90c2[_0xa8a1('0x1f')]==_0x185394;});if(_['isNil'](_0x453da8)){var _0x4b831e=_['find'](this['telephones'],function(_0x1933fa){return _0x1933fa['accountcode']==_0x185394||_0x1933fa[_0xa8a1('0x1f')]==_0x185394;});if(_0x4b831e){_0x453da8=_['find'](this[_0xa8a1('0xe')],function(_0xe0b513){return _0xe0b513[_0xa8a1('0x20')]==util['format'](_0xa8a1('0x21'),_0x4b831e['name']);});}}return _0x453da8;};Report['prototype'][_0xa8a1('0x22')]=function(_0x3ed565){for(var _0x136fc3=0x0;_0x136fc3<_0x3ed565[_0xa8a1('0x23')];_0x136fc3+=0x1){var _0x132b3f=this[_0xa8a1('0x1c')](_0x3ed565[_0x136fc3][_0xa8a1('0x24')]);if(_0x132b3f){_0x3ed565[_0x136fc3][_0xa8a1('0x1e')]=_0x132b3f[_0xa8a1('0x1e')];_0x3ed565[_0x136fc3][_0xa8a1('0x25')]=!![];_0x3ed565[_0x136fc3]['lastAssignedTo']=_0x132b3f[_0xa8a1('0x1f')];_0x3ed565[_0x136fc3][_0xa8a1('0x20')]=_[_0xa8a1('0x26')](_0x132b3f['interface'])?util['format'](_0xa8a1('0x21'),_0x132b3f[_0xa8a1('0x1f')]):_0x132b3f[_0xa8a1('0x20')];if(_0x3ed565[_0x136fc3][_0xa8a1('0x27')]){_0x3ed565[_0x136fc3][_0xa8a1('0x28')]=moment()[_0xa8a1('0x29')](_0xa8a1('0x2a'));}if(_0x3ed565[_0x136fc3][_0xa8a1('0x2b')]){_0x3ed565[_0x136fc3][_0xa8a1('0x2c')]=moment()[_0xa8a1('0x29')](_0xa8a1('0x2a'));}RpcMemberReport[_0xa8a1('0x22')](_0x3ed565[_0x136fc3]);}RpcVoiceQueueReport[_0xa8a1('0x2d')](_0x3ed565[_0x136fc3]);}};function extractCalleridNumber(_0x3e00a2){var _0x353a1f=_0x3e00a2[_0xa8a1('0x2e')](/<(.*?)>/);return _0x353a1f?_0x353a1f[0x1]:_0x3e00a2;}Report[_0xa8a1('0x10')][_0xa8a1('0x2f')]=function(_0x4aea00){for(var _0x49f0f3=0x0;_0x49f0f3','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername'];(function(_0x7440e0,_0x42d9b8){var _0x33ee99=function(_0x3edb33){while(--_0x3edb33){_0x7440e0['push'](_0x7440e0['shift']());}};_0x33ee99(++_0x42d9b8);}(_0xcf36,0xd2));var _0x6cf3=function(_0x5bd2a5,_0x589eac){_0x5bd2a5=_0x5bd2a5-0x0;var _0x593c9d=_0xcf36[_0x5bd2a5];return _0x593c9d;};'use strict';var _=require(_0x6cf3('0x0'));var moment=require(_0x6cf3('0x1'));var util=require('util');var config=require(_0x6cf3('0x2'));var ami=require(_0x6cf3('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x6cf3('0x4'));var RpcVoiceDialReport=require(_0x6cf3('0x5'));var RpcMemberReport=require(_0x6cf3('0x6'));var RpcVoiceQueueReport=require(_0x6cf3('0x7'));var RpcVoiceRecording=require(_0x6cf3('0x8'));var RpcVoiceTransferReport=require(_0x6cf3('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x6cf3('0xa'));var VoiceAgentReport=require(_0x6cf3('0xb'));var VoiceDialReport=require(_0x6cf3('0xc'));var UserReport=require('./userReport');function Report(_0x533590){this[_0x6cf3('0xd')]=_0x533590;this['agents']=_0x533590[_0x6cf3('0xe')];this[_0x6cf3('0xf')]=_0x533590['telephones'];}Report['prototype'][_0x6cf3('0x10')]=function(_0x505c54){var _0x4c3dc8=new VoiceQueueReport(this[_0x6cf3('0xd')]);var _0x1606bd=new VoiceAgentReport(this[_0x6cf3('0xd')]);var _0x14dee8=new VoiceDialReport(this['realtime']);var _0x334c19=new VoiceCallReport(this[_0x6cf3('0xd')]);var _0x5bee25=new UserReport(this[_0x6cf3('0xd')]);if(config[_0x6cf3('0x11')]&&config[_0x6cf3('0x11')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x6cf3('0x12')](this));ami['on'](_0x6cf3('0x13'),this[_0x6cf3('0x14')]['bind'](this));ami['on'](_0x6cf3('0x15'),this['voiceAgentReport']['bind'](this));ami['on'](_0x6cf3('0x16'),this[_0x6cf3('0x17')][_0x6cf3('0x12')](this));ami['on'](_0x6cf3('0x18'),this[_0x6cf3('0x19')][_0x6cf3('0x12')](this));ami['on'](_0x6cf3('0x1a'),this[_0x6cf3('0x1b')][_0x6cf3('0x12')](this));}};Report[_0x6cf3('0x1c')][_0x6cf3('0x1d')]=function(_0x525c72){var _0x5bbbc0;_0x5bbbc0=_[_0x6cf3('0x1e')](this[_0x6cf3('0xe')],function(_0x35afa2){return _0x35afa2[_0x6cf3('0x1f')]==_0x525c72||_0x35afa2[_0x6cf3('0x20')]==_0x525c72;});if(_[_0x6cf3('0x21')](_0x5bbbc0)){var _0x58e04f=_[_0x6cf3('0x1e')](this['telephones'],function(_0x4f3992){return _0x4f3992['accountcode']==_0x525c72||_0x4f3992[_0x6cf3('0x20')]==_0x525c72;});if(_0x58e04f){_0x5bbbc0=_[_0x6cf3('0x1e')](this[_0x6cf3('0xe')],function(_0x561e92){return _0x561e92['interface']==util['format'](_0x6cf3('0x22'),_0x58e04f[_0x6cf3('0x20')]);});}}return _0x5bbbc0;};Report[_0x6cf3('0x1c')][_0x6cf3('0x23')]=function(_0x201a0e){for(var _0x54f512=0x0;_0x54f512<_0x201a0e[_0x6cf3('0x24')];_0x54f512+=0x1){var _0x34eb15=this[_0x6cf3('0x1d')](_0x201a0e[_0x54f512][_0x6cf3('0x25')]);if(_0x34eb15){_0x201a0e[_0x54f512][_0x6cf3('0x1f')]=_0x34eb15[_0x6cf3('0x1f')];_0x201a0e[_0x54f512][_0x6cf3('0x26')]=!![];_0x201a0e[_0x54f512][_0x6cf3('0x27')]=_0x34eb15[_0x6cf3('0x20')];_0x201a0e[_0x54f512][_0x6cf3('0x28')]=_[_0x6cf3('0x21')](_0x34eb15[_0x6cf3('0x28')])?util[_0x6cf3('0x29')]('SIP/%s',_0x34eb15[_0x6cf3('0x20')]):_0x34eb15['interface'];if(_0x201a0e[_0x54f512][_0x6cf3('0x2a')]){_0x201a0e[_0x54f512][_0x6cf3('0x2b')]=moment()[_0x6cf3('0x29')](_0x6cf3('0x2c'));}if(_0x201a0e[_0x54f512][_0x6cf3('0x2d')]){_0x201a0e[_0x54f512]['queuecallerexitAt']=moment()[_0x6cf3('0x29')](_0x6cf3('0x2c'));}RpcMemberReport['voiceQueueReport'](_0x201a0e[_0x54f512]);}RpcVoiceQueueReport[_0x6cf3('0x2e')](_0x201a0e[_0x54f512]);}};function extractCalleridNumber(_0x4e6d2d){var _0x397083=_0x4e6d2d['match'](/<(.*?)>/);return _0x397083?_0x397083[0x1]:_0x4e6d2d;}Report[_0x6cf3('0x1c')][_0x6cf3('0x2f')]=function(_0x32a98e){for(var _0x1155c9=0x0;_0x1155c90x0?_0x289c1b:0x0;this[_0xaefb('0x13')][_0x2aee72[_0xaefb('0x71')]][_0xaefb('0x5e')]=this[_0xaefb('0x13')][_0x2aee72['queue']][_0xaefb('0x5e')]>_[_0xaefb('0x76')](_0x2aee72['loggedin'])?_[_0xaefb('0x76')](_0x2aee72[_0xaefb('0x78')]):this[_0xaefb('0x13')][_0x2aee72[_0xaefb('0x71')]][_0xaefb('0x5e')];this[_0xaefb('0x79')](this[_0xaefb('0x13')][_0x2aee72[_0xaefb('0x71')]],'queuesummary');}logger[_0xaefb('0x49')](_0xaefb('0x7a'),util[_0xaefb('0x40')](this[_0xaefb('0x13')][_0x2aee72[_0xaefb('0x71')]],{'showHidden':![],'depth':null}));ami[_0xaefb('0x48')](_0xaefb('0x7b'),this['voiceQueues'][_0x2aee72[_0xaefb('0x71')]]);}}}catch(_0xc0ac7a){logger[_0xaefb('0x3e')]('[voiceQueueReport][queuesummary]',util[_0xaefb('0x40')](_0xc0ac7a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaefb('0xc')][_0xaefb('0x19')]=function(_0x47bb90){logger['debug'](_0xaefb('0x7c'),util[_0xaefb('0x40')](_0x47bb90,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xaefb('0x7d')]=function(_0x84f86e){try{if(this[_0xaefb('0x69')](_0x84f86e)){logger['debug'](_0xaefb('0x7e'),_0x84f86e['uniqueid'],util['inspect'](_0x84f86e,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x84f86e[_0xaefb('0x4b')]]))this[_0xaefb('0xf')][_0x84f86e[_0xaefb('0x4b')]]=[];if(_[_0xaefb('0x6a')](this[_0xaefb('0x11')][_0x84f86e[_0xaefb('0x4b')]]))this[_0xaefb('0x11')][_0x84f86e[_0xaefb('0x4b')]]={};var _0x3da59d=new QueueReport();_0x3da59d[_0xaefb('0x4e')]=_0x84f86e[_0xaefb('0x71')];_0x3da59d[_0xaefb('0x7f')]=this[_0xaefb('0x13')][_0x3da59d[_0xaefb('0x4e')]]&&this[_0xaefb('0x13')][_0x3da59d[_0xaefb('0x4e')]][_0xaefb('0x7f')]?this[_0xaefb('0x13')][_0x3da59d['name']][_0xaefb('0x7f')]||_0xaefb('0x56'):'inbound';_0x3da59d[_0xaefb('0x71')]=_0x84f86e['queue'];_0x3da59d[_0xaefb('0x80')]=moment()[_0xaefb('0x4c')](_0xaefb('0x81'));_0x3da59d[_0xaefb('0x82')]=_0x84f86e[_0xaefb('0x82')];_0x3da59d[_0xaefb('0x83')]=_0x84f86e['count'];_0x3da59d['uniqueid']=_0x84f86e[_0xaefb('0x4b')];_0x3da59d[_0xaefb('0x84')]=this[_0xaefb('0x11')][_0x84f86e[_0xaefb('0x4b')]][_0xaefb('0x84')];logger[_0xaefb('0x73')](_0xaefb('0x85'),_0x3da59d[_0xaefb('0x4e')],_0x3da59d[_0xaefb('0x7f')]);_[_0xaefb('0x86')](_0x3da59d,_[_0xaefb('0x87')](_0x84f86e,_['keys'](_0x3da59d)));this['queueReports'][_0x84f86e[_0xaefb('0x4b')]][_0xaefb('0x88')](_0x3da59d);this[_0xaefb('0x11')][_0x84f86e['uniqueid']]=_0x3da59d;this['emitVoiceQueueChannelSave'](_0x3da59d,_0xaefb('0x1a'));}}catch(_0x55ddd1){logger[_0xaefb('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x84f86e[_0xaefb('0x4b')],util[_0xaefb('0x40')](_0x55ddd1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaefb('0xc')][_0xaefb('0x1c')]=function(_0x570972){try{if(this['isNotNull'](_0x570972)){logger[_0xaefb('0x49')]('[%s][voiceQueueReport][queuecallerabandon]',_0x570972[_0xaefb('0x4b')],util[_0xaefb('0x40')](_0x570972,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x570972['uniqueid']]){var _0x3f1af6=_[_0xaefb('0x89')](this[_0xaefb('0xf')][_0x570972['uniqueid']]);_0x3f1af6[_0xaefb('0x8a')]=![];_0x3f1af6['queuecallercompleteAt']=null;_0x3f1af6[_0xaefb('0x8b')]=_0x570972[_0xaefb('0x8b')];_0x3f1af6[_0xaefb('0x8c')]=_0x570972[_0xaefb('0x8c')];_0x3f1af6['queuecallerabandon']=!![];_0x3f1af6[_0xaefb('0x8d')]=moment()['format'](_0xaefb('0x81'));_0x3f1af6[_0xaefb('0x8e')]=_0xaefb('0x8f');_0x3f1af6[_0xaefb('0x90')]=null;logger['info'](_0xaefb('0x91'),_0x3f1af6[_0xaefb('0x4e')],_0x3f1af6[_0xaefb('0x7f')]);this[_0xaefb('0x11')][_0x570972[_0xaefb('0x4b')]]=_0x3f1af6;this[_0xaefb('0x51')](_0x3f1af6,_0xaefb('0x1b'));}}}catch(_0x182966){logger['error'](_0xaefb('0x92'),_0x570972[_0xaefb('0x4b')],util[_0xaefb('0x40')](_0x182966,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaefb('0x93')]=function(_0x31fbe1){try{if(this[_0xaefb('0x69')](_0x31fbe1)){logger[_0xaefb('0x49')](_0xaefb('0x94'),_0x31fbe1[_0xaefb('0x4b')],util['inspect'](_0x31fbe1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x31fbe1[_0xaefb('0x4b')]]){var _0x186a2d=_[_0xaefb('0x89')](this[_0xaefb('0xf')][_0x31fbe1[_0xaefb('0x4b')]]);_0x186a2d[_0xaefb('0x95')]=moment()[_0xaefb('0x4c')](_0xaefb('0x81'));_0x186a2d['connectedlinenum']=_0x31fbe1[_0xaefb('0x96')];_0x186a2d['connectedlinename']=_0x31fbe1[_0xaefb('0x97')];logger[_0xaefb('0x73')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x186a2d[_0xaefb('0x4e')],_0x186a2d[_0xaefb('0x7f')],_0x31fbe1['connectedlinenum'],_0x31fbe1[_0xaefb('0x97')]);this[_0xaefb('0x11')][_0x31fbe1['uniqueid']]=_0x186a2d;this['emitVoiceQueueChannelSave'](_0x186a2d,_0xaefb('0x1d'));}}}catch(_0x19fbbe){logger[_0xaefb('0x3e')]('[%s][voiceQueueReport][queuecallerleave]',_0x31fbe1['uniqueid'],util[_0xaefb('0x40')](_0x19fbbe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaefb('0xc')][_0xaefb('0x1f')]=function(_0x20e60e){try{if(this[_0xaefb('0x69')](_0x20e60e)){logger[_0xaefb('0x49')](_0xaefb('0x98'),_0x20e60e[_0xaefb('0x4b')],util['inspect'](_0x20e60e,{'showHidden':![],'depth':null}));if(this[_0xaefb('0xf')][_0x20e60e['uniqueid']]){var _0x445f3b=_[_0xaefb('0x89')](this[_0xaefb('0xf')][_0x20e60e['uniqueid']]);_0x445f3b[_0xaefb('0x8a')]=!![];_0x445f3b[_0xaefb('0x8e')]=_0xaefb('0x99');logger[_0xaefb('0x73')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x445f3b[_0xaefb('0x4e')],_0x445f3b['type']);}}}catch(_0x511fea){logger[_0xaefb('0x3e')](_0xaefb('0x98'),_0x20e60e[_0xaefb('0x4b')],util[_0xaefb('0x40')](_0x511fea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaefb('0xc')]['syncAgentComplete']=function(_0x588443){try{if(this['isNotNull'](_0x588443)){logger[_0xaefb('0x49')](_0xaefb('0x9a'),_0x588443[_0xaefb('0x4b')],util[_0xaefb('0x40')](_0x588443,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x588443['uniqueid']]){var _0x2d3bd5=_[_0xaefb('0x89')](this[_0xaefb('0xf')][_0x588443['uniqueid']]);_0x2d3bd5[_0xaefb('0x1b')]=![];_0x2d3bd5['queuecallerabandonAt']=null;_0x2d3bd5[_0xaefb('0x9b')]=!![];_0x2d3bd5['lastAssignedTo']=_0x588443[_0xaefb('0x9c')];_0x2d3bd5['holdtime']=_0x588443[_0xaefb('0x8b')];_0x2d3bd5[_0xaefb('0x8a')]=!![];_0x2d3bd5[_0xaefb('0x9d')]=![];_0x2d3bd5[_0xaefb('0x9e')]=null;if(!_0x2d3bd5['transfer']){if(_0x588443['reason']==_0xaefb('0x9f')){_0x2d3bd5[_0xaefb('0x8e')]=_0xaefb('0xa0');logger[_0xaefb('0x73')](_0xaefb('0xa1'),_0x2d3bd5[_0xaefb('0x4e')],_0x2d3bd5[_0xaefb('0x7f')]);}else{if(_['startsWith'](_0x588443[_0xaefb('0xa2')]['toLowerCase'](),'local/')){if(this[_0xaefb('0xf')][_0x588443['linkedid']]){var _0x525c3a=_[_0xaefb('0x89')](this[_0xaefb('0xf')][_0x588443[_0xaefb('0xa3')]]);_0x525c3a[_0xaefb('0x8a')]=![];_0x525c3a['queuecallerexit']=!![];_0x525c3a[_0xaefb('0x9e')]=moment(_0x2d3bd5[_0xaefb('0x80')])['add'](_0x588443[_0xaefb('0x8b')],_0xaefb('0xa4'))[_0xaefb('0x4c')](_0xaefb('0x81'));_0x525c3a[_0xaefb('0x8e')]=_0xaefb('0xa5');_0x525c3a[_0xaefb('0x9f')]=!![];_0x525c3a[_0xaefb('0xa6')]=_0xaefb('0xa7');_0x525c3a['transferexten']=_0x588443[_0xaefb('0xa8')];_0x525c3a[_0xaefb('0xa9')]=_0x588443['uniqueid'];logger[_0xaefb('0x73')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x525c3a['name'],_0x525c3a[_0xaefb('0x7f')]);var _0x1f229f=this[_0xaefb('0xf')][_0x588443[_0xaefb('0xa3')]];this['queueReports'][_0x588443[_0xaefb('0xa3')]]=this[_0xaefb('0xf')][_0x588443[_0xaefb('0x4b')]];this[_0xaefb('0xf')][_0x588443[_0xaefb('0x4b')]]=_0x1f229f;}}else{_0x2d3bd5[_0xaefb('0x8e')]='COMPLETEDBY'+_0x588443[_0xaefb('0xaa')][_0xaefb('0xab')]();logger[_0xaefb('0x73')](_0xaefb('0xac'),_0x2d3bd5['name'],_0x2d3bd5['type'],_0x2d3bd5[_0xaefb('0x8e')]);}}}this[_0xaefb('0x11')][_0x588443[_0xaefb('0x4b')]]=_0x2d3bd5;this['emitVoiceQueueChannelRemove'](_0x2d3bd5,_0xaefb('0xad'));}}}catch(_0x10ea8f){logger[_0xaefb('0x3e')](_0xaefb('0x9a'),_0x588443[_0xaefb('0x4b')],util['inspect'](_0x10ea8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xaefb('0xc')][_0xaefb('0x21')]=function(_0x150d5d){try{if(this['isNotNull'](_0x150d5d)){logger[_0xaefb('0x49')](_0xaefb('0xae'),_0x150d5d['uniqueid'],util['inspect'](_0x150d5d,{'showHidden':![],'depth':null}));this[_0xaefb('0xaf')](_0x150d5d['uniqueid'],_[_0xaefb('0xb0')](_0x150d5d[_0xaefb('0xb1')])[0x0],_0x150d5d['value']);if(this[_0xaefb('0xf')][_0x150d5d[_0xaefb('0x4b')]]){var _0x1f89bd=_[_0xaefb('0x89')](this[_0xaefb('0xf')][_0x150d5d[_0xaefb('0x4b')]]);if(_0x1f89bd){if(this[_0xaefb('0x69')](_0x150d5d[_0xaefb('0xb1')])&&this['isNotNull'](_0x150d5d[_0xaefb('0xb1')][_0xaefb('0xb2')])){switch(_0x150d5d[_0xaefb('0xb3')]){case _0xaefb('0xb4'):_0x1f89bd[_0xaefb('0x9d')]=![];_0x1f89bd[_0xaefb('0x9e')]=null;break;case _0xaefb('0xb5'):_0x1f89bd[_0xaefb('0xb6')]=_0xaefb('0xb7');_0x1f89bd['queuecallerexit']=!![];_0x1f89bd[_0xaefb('0x9e')]=moment()[_0xaefb('0x4c')](_0xaefb('0x81'));_0x1f89bd[_0xaefb('0x95')]=moment()[_0xaefb('0x4c')](_0xaefb('0x81'));logger[_0xaefb('0x49')](_0xaefb('0xb8'),_0x150d5d[_0xaefb('0x4b')],util[_0xaefb('0x40')](_0x1f89bd,{'showHidden':![],'depth':null}));ami[_0xaefb('0x48')](_0xaefb('0xb9'),_0x1f89bd);break;default:_0x1f89bd[_0xaefb('0x9d')]=!![];_0x1f89bd['queuecallerexitAt']=moment()[_0xaefb('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f89bd[_0xaefb('0x95')]=moment()[_0xaefb('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1f89bd['queuecallerabandon']=![];_0x1f89bd[_0xaefb('0x8d')]=null;_0x1f89bd[_0xaefb('0x8e')]=_0x150d5d[_0xaefb('0xb3')];this[_0xaefb('0x11')][_0x150d5d[_0xaefb('0x4b')]]=_0x1f89bd;this[_0xaefb('0x51')](_0x1f89bd,_0xaefb('0x20'));}else if(this[_0xaefb('0x69')](_0x150d5d['variable'])&&this['isNotNull'](_0x150d5d[_0xaefb('0xb1')]['queueposition'])){if(!_0x1f89bd['queuecallerabandon']){_0x1f89bd[_0xaefb('0x9d')]=!![];_0x1f89bd[_0xaefb('0x9e')]=moment()[_0xaefb('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f89bd['queuecallerexitreason']='EXITWITHKEY';_0x1f89bd['queuecallerleaveAt']=moment()['format'](_0xaefb('0x81'));this['channels'][_0x150d5d[_0xaefb('0x4b')]]=_0x1f89bd;}}logger[_0xaefb('0x73')](_0xaefb('0xba'),_0x150d5d[_0xaefb('0x4b')],_0x1f89bd[_0xaefb('0x4e')],_0x1f89bd[_0xaefb('0x7f')],_[_0xaefb('0xb0')](_0x150d5d[_0xaefb('0xb1')])[0x0],_0x150d5d[_0xaefb('0xb3')]);_0x1f89bd[_0xaefb('0x42')]=this[_0xaefb('0x42')][_0x150d5d['uniqueid']];}}}}catch(_0x301081){logger['error'](_0xaefb('0xae'),_0x150d5d[_0xaefb('0x4b')],util['inspect'](_0x301081,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xaefb('0xaf')]=function(_0x354839,_0x7d8980,_0x3f0c5d){var _0x45a8f4=[_0xaefb('0xbb'),_0xaefb('0xbc'),_0xaefb('0xbd'),_0xaefb('0xbe'),_0xaefb('0xbf'),_0xaefb('0xc0'),_0xaefb('0xc1'),_0xaefb('0xc2'),_0xaefb('0xc3'),'sipuri',_0xaefb('0xc4'),'bridgepvtcallid',_0xaefb('0xc5'),_0xaefb('0xc6'),'memberinterface',_0xaefb('0xc7'),_0xaefb('0x9c'),_0xaefb('0xc8'),_0xaefb('0xc9')];if(!_['isNil'](_0x7d8980)&&!_[_0xaefb('0xca')](_0x45a8f4,_0x7d8980)){if(_[_0xaefb('0x6a')](this[_0xaefb('0x42')][_0x354839])){this['variables'][_0x354839]={};}this[_0xaefb('0x42')][_0x354839][_0x7d8980]=_0x3f0c5d;}};VoiceQueueReport[_0xaefb('0xc')][_0xaefb('0x23')]=function(_0x371923){try{if(this[_0xaefb('0x69')](_0x371923)){logger[_0xaefb('0x49')]('[%s][voiceQueueReport][hangup]',_0x371923[_0xaefb('0x4b')],util[_0xaefb('0x40')](_0x371923,{'showHidden':![],'depth':null}));if(this[_0xaefb('0xf')][_0x371923[_0xaefb('0x4b')]]){for(var _0x46ac08=0x0,_0x2ed769={};_0x46ac080x0?_0x7700c3:0x0;this['voiceQueues'][_0x2439b3[_0x50bd('0x6d')]][_0x50bd('0x31')]=this[_0x50bd('0x11')][_0x2439b3['queue']][_0x50bd('0x31')]>_['toNumber'](_0x2439b3[_0x50bd('0x71')])?_[_0x50bd('0x70')](_0x2439b3[_0x50bd('0x71')]):this[_0x50bd('0x11')][_0x2439b3[_0x50bd('0x6d')]]['talking'];this[_0x50bd('0x51')](this[_0x50bd('0x11')][_0x2439b3[_0x50bd('0x6d')]],_0x50bd('0x67'));}logger['debug'](_0x50bd('0x72'),util[_0x50bd('0x3e')](this[_0x50bd('0x11')][_0x2439b3[_0x50bd('0x6d')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this[_0x50bd('0x11')][_0x2439b3[_0x50bd('0x6d')]]);}}}catch(_0x3db394){logger[_0x50bd('0x3c')](_0x50bd('0x69'),util[_0x50bd('0x3e')](_0x3db394,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x50bd('0x16')]=function(_0x56fa1f){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x50bd('0x3e')](_0x56fa1f,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x50bd('0x35')]['syncQueueCallerJoin']=function(_0x28d11e){try{if(this[_0x50bd('0x62')](_0x28d11e)){logger[_0x50bd('0x46')](_0x50bd('0x73'),_0x28d11e[_0x50bd('0x49')],util['inspect'](_0x28d11e,{'showHidden':![],'depth':null}));if(_[_0x50bd('0x74')](this[_0x50bd('0x3f')][_0x28d11e['uniqueid']]))this['queueReports'][_0x28d11e[_0x50bd('0x49')]]=[];if(_[_0x50bd('0x74')](this[_0x50bd('0xf')][_0x28d11e['uniqueid']]))this[_0x50bd('0xf')][_0x28d11e[_0x50bd('0x49')]]={};var _0xdcc260=new QueueReport();_0xdcc260[_0x50bd('0x4c')]=_0x28d11e[_0x50bd('0x6d')];_0xdcc260[_0x50bd('0x52')]=this[_0x50bd('0x11')][_0xdcc260['name']]&&this[_0x50bd('0x11')][_0xdcc260[_0x50bd('0x4c')]][_0x50bd('0x52')]?this['voiceQueues'][_0xdcc260['name']]['type']||_0x50bd('0x53'):_0x50bd('0x53');_0xdcc260['queue']=_0x28d11e[_0x50bd('0x6d')];_0xdcc260[_0x50bd('0x75')]=moment()[_0x50bd('0x4a')](_0x50bd('0x76'));_0xdcc260[_0x50bd('0x77')]=_0x28d11e[_0x50bd('0x77')];_0xdcc260[_0x50bd('0x78')]=_0x28d11e[_0x50bd('0x78')];_0xdcc260['uniqueid']=_0x28d11e[_0x50bd('0x49')];_0xdcc260[_0x50bd('0x79')]=this['channels'][_0x28d11e[_0x50bd('0x49')]][_0x50bd('0x79')];logger[_0x50bd('0x6b')](_0x50bd('0x7a'),_0xdcc260[_0x50bd('0x4c')],_0xdcc260['type']);_[_0x50bd('0x7b')](_0xdcc260,_[_0x50bd('0x7c')](_0x28d11e,_[_0x50bd('0x7d')](_0xdcc260)));this['queueReports'][_0x28d11e['uniqueid']][_0x50bd('0x7e')](_0xdcc260);this[_0x50bd('0xf')][_0x28d11e[_0x50bd('0x49')]]=_0xdcc260;this['emitVoiceQueueChannelSave'](_0xdcc260,_0x50bd('0x7f'));}}catch(_0xbdc78b){logger[_0x50bd('0x3c')]('[%s][voiceQueueReport][queuecallerjoin]',_0x28d11e[_0x50bd('0x49')],util['inspect'](_0xbdc78b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x50bd('0x35')]['syncQueueCallerAbandon']=function(_0x663ea2){try{if(this[_0x50bd('0x62')](_0x663ea2)){logger[_0x50bd('0x46')]('[%s][voiceQueueReport][queuecallerabandon]',_0x663ea2[_0x50bd('0x49')],util[_0x50bd('0x3e')](_0x663ea2,{'showHidden':![],'depth':null}));if(this[_0x50bd('0x3f')][_0x663ea2[_0x50bd('0x49')]]){var _0x261096=_[_0x50bd('0x80')](this[_0x50bd('0x3f')][_0x663ea2[_0x50bd('0x49')]]);_0x261096['queuecallercomplete']=![];_0x261096[_0x50bd('0x81')]=null;_0x261096[_0x50bd('0x82')]=_0x663ea2[_0x50bd('0x82')];_0x261096[_0x50bd('0x83')]=_0x663ea2[_0x50bd('0x83')];_0x261096[_0x50bd('0x19')]=!![];_0x261096[_0x50bd('0x84')]=moment()['format'](_0x50bd('0x76'));_0x261096[_0x50bd('0x85')]=_0x50bd('0x86');_0x261096[_0x50bd('0x87')]=null;logger[_0x50bd('0x6b')](_0x50bd('0x88'),_0x261096[_0x50bd('0x4c')],_0x261096[_0x50bd('0x52')]);this['channels'][_0x663ea2['uniqueid']]=_0x261096;this[_0x50bd('0x4f')](_0x261096,_0x50bd('0x19'));}}}catch(_0x32291e){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x663ea2['uniqueid'],util[_0x50bd('0x3e')](_0x32291e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x50bd('0x35')][_0x50bd('0x1c')]=function(_0x1b7501){try{if(this[_0x50bd('0x62')](_0x1b7501)){logger[_0x50bd('0x46')](_0x50bd('0x89'),_0x1b7501[_0x50bd('0x49')],util['inspect'](_0x1b7501,{'showHidden':![],'depth':null}));if(this[_0x50bd('0x3f')][_0x1b7501[_0x50bd('0x49')]]){var _0x1c1745=_[_0x50bd('0x80')](this[_0x50bd('0x3f')][_0x1b7501[_0x50bd('0x49')]]);_0x1c1745[_0x50bd('0x8a')]=moment()[_0x50bd('0x4a')](_0x50bd('0x76'));_0x1c1745[_0x50bd('0x8b')]=_0x1b7501['connectedlinenum'];_0x1c1745['connectedlinename']=_0x1b7501[_0x50bd('0x8c')];logger[_0x50bd('0x6b')](_0x50bd('0x8d'),_0x1c1745[_0x50bd('0x4c')],_0x1c1745[_0x50bd('0x52')],_0x1b7501[_0x50bd('0x8b')],_0x1b7501['connectedlinename']);this['channels'][_0x1b7501['uniqueid']]=_0x1c1745;this[_0x50bd('0x45')](_0x1c1745,'queuecallerleave');}}}catch(_0x3decb5){logger[_0x50bd('0x3c')](_0x50bd('0x89'),_0x1b7501['uniqueid'],util['inspect'](_0x3decb5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x50bd('0x35')][_0x50bd('0x20')]=function(_0x51e3ee){try{if(this[_0x50bd('0x62')](_0x51e3ee)){logger[_0x50bd('0x46')]('[%s][voiceQueueReport][agentconnect]',_0x51e3ee['uniqueid'],util[_0x50bd('0x3e')](_0x51e3ee,{'showHidden':![],'depth':null}));if(this[_0x50bd('0x3f')][_0x51e3ee[_0x50bd('0x49')]]){var _0x4947e1=_[_0x50bd('0x80')](this[_0x50bd('0x3f')][_0x51e3ee['uniqueid']]);_0x4947e1[_0x50bd('0x8e')]=!![];_0x4947e1[_0x50bd('0x85')]=_0x50bd('0x8f');logger[_0x50bd('0x6b')](_0x50bd('0x90'),_0x4947e1[_0x50bd('0x4c')],_0x4947e1[_0x50bd('0x52')]);}}}catch(_0x18bf7e){logger[_0x50bd('0x3c')](_0x50bd('0x91'),_0x51e3ee[_0x50bd('0x49')],util['inspect'](_0x18bf7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x50bd('0x1e')]=function(_0x42050a){try{if(this[_0x50bd('0x62')](_0x42050a)){logger[_0x50bd('0x46')](_0x50bd('0x92'),_0x42050a[_0x50bd('0x49')],util[_0x50bd('0x3e')](_0x42050a,{'showHidden':![],'depth':null}));if(this[_0x50bd('0x3f')][_0x42050a[_0x50bd('0x49')]]){var _0xe5af05=_['last'](this[_0x50bd('0x3f')][_0x42050a[_0x50bd('0x49')]]);_0xe5af05['queuecallerabandon']=![];_0xe5af05['queuecallerabandonAt']=null;_0xe5af05[_0x50bd('0x93')]=!![];_0xe5af05[_0x50bd('0x87')]=_0x42050a[_0x50bd('0x94')];_0xe5af05[_0x50bd('0x82')]=_0x42050a[_0x50bd('0x82')];_0xe5af05[_0x50bd('0x8e')]=!![];_0xe5af05[_0x50bd('0x95')]=![];_0xe5af05[_0x50bd('0x96')]=null;if(!_0xe5af05[_0x50bd('0x97')]){if(_0x42050a[_0x50bd('0x98')]==_0x50bd('0x97')){_0xe5af05[_0x50bd('0x85')]='COMPLETED';logger[_0x50bd('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xe5af05[_0x50bd('0x4c')],_0xe5af05['type']);}else{if(_[_0x50bd('0x99')](_0x42050a['channel'][_0x50bd('0x9a')](),_0x50bd('0x9b'))){if(this['queueReports'][_0x42050a[_0x50bd('0x9c')]]){var _0x25f9fe=_[_0x50bd('0x80')](this[_0x50bd('0x3f')][_0x42050a[_0x50bd('0x9c')]]);_0x25f9fe[_0x50bd('0x8e')]=![];_0x25f9fe[_0x50bd('0x95')]=!![];_0x25f9fe[_0x50bd('0x96')]=moment(_0xe5af05[_0x50bd('0x75')])[_0x50bd('0x9d')](_0x42050a[_0x50bd('0x82')],_0x50bd('0x9e'))[_0x50bd('0x4a')](_0x50bd('0x76'));_0x25f9fe[_0x50bd('0x85')]=_0x50bd('0x9f');_0x25f9fe['transfer']=!![];_0x25f9fe[_0x50bd('0xa0')]=_0x50bd('0xa1');_0x25f9fe[_0x50bd('0xa2')]=_0x42050a[_0x50bd('0xa3')];_0x25f9fe[_0x50bd('0xa4')]=_0x42050a[_0x50bd('0x49')];logger[_0x50bd('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x25f9fe['name'],_0x25f9fe['type']);var _0x203b86=this['queueReports'][_0x42050a[_0x50bd('0x9c')]];this['queueReports'][_0x42050a['linkedid']]=this[_0x50bd('0x3f')][_0x42050a[_0x50bd('0x49')]];this['queueReports'][_0x42050a['uniqueid']]=_0x203b86;}}else{_0xe5af05[_0x50bd('0x85')]=_0x50bd('0xa5')+_0x42050a[_0x50bd('0x98')]['toUpperCase']();logger[_0x50bd('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0xe5af05[_0x50bd('0x4c')],_0xe5af05[_0x50bd('0x52')],_0xe5af05[_0x50bd('0x85')]);}}}this[_0x50bd('0xf')][_0x42050a[_0x50bd('0x49')]]=_0xe5af05;this[_0x50bd('0x4f')](_0xe5af05,_0x50bd('0x1d'));}}}catch(_0x50f0bb){logger['error'](_0x50bd('0x92'),_0x42050a[_0x50bd('0x49')],util[_0x50bd('0x3e')](_0x50f0bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x17400d){try{if(this[_0x50bd('0x62')](_0x17400d)){logger['debug'](_0x50bd('0xa6'),_0x17400d[_0x50bd('0x49')],util[_0x50bd('0x3e')](_0x17400d,{'showHidden':![],'depth':null}));this[_0x50bd('0xa7')](_0x17400d[_0x50bd('0x49')],_[_0x50bd('0x7d')](_0x17400d[_0x50bd('0xa8')])[0x0],_0x17400d[_0x50bd('0xa9')]);if(this[_0x50bd('0x3f')][_0x17400d[_0x50bd('0x49')]]){var _0x222985=_[_0x50bd('0x80')](this['queueReports'][_0x17400d[_0x50bd('0x49')]]);if(_0x222985){if(this[_0x50bd('0x62')](_0x17400d[_0x50bd('0xa8')])&&this['isNotNull'](_0x17400d[_0x50bd('0xa8')][_0x50bd('0xaa')])){switch(_0x17400d[_0x50bd('0xa9')]){case'CONTINUE':_0x222985['queuecallerexit']=![];_0x222985[_0x50bd('0x96')]=null;break;case _0x50bd('0xab'):_0x222985['lastevent']=_0x50bd('0xac');_0x222985[_0x50bd('0x95')]=!![];_0x222985[_0x50bd('0x96')]=moment()[_0x50bd('0x4a')](_0x50bd('0x76'));_0x222985[_0x50bd('0x8a')]=moment()[_0x50bd('0x4a')](_0x50bd('0x76'));logger[_0x50bd('0x46')](_0x50bd('0xad'),_0x17400d[_0x50bd('0x49')],util[_0x50bd('0x3e')](_0x222985,{'showHidden':![],'depth':null}));ami['emit'](_0x50bd('0xae'),_0x222985);break;default:_0x222985[_0x50bd('0x95')]=!![];_0x222985[_0x50bd('0x96')]=moment()[_0x50bd('0x4a')](_0x50bd('0x76'));_0x222985[_0x50bd('0x8a')]=moment()[_0x50bd('0x4a')](_0x50bd('0x76'));}_0x222985['queuecallerabandon']=![];_0x222985[_0x50bd('0x84')]=null;_0x222985['queuecallerexitreason']=_0x17400d['value'];this[_0x50bd('0xf')][_0x17400d[_0x50bd('0x49')]]=_0x222985;this[_0x50bd('0x4f')](_0x222985,'varset');}else if(this[_0x50bd('0x62')](_0x17400d[_0x50bd('0xa8')])&&this[_0x50bd('0x62')](_0x17400d[_0x50bd('0xa8')][_0x50bd('0xaf')])){if(!_0x222985[_0x50bd('0x19')]){_0x222985['queuecallerexit']=!![];_0x222985[_0x50bd('0x96')]=moment()[_0x50bd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x222985[_0x50bd('0x85')]='EXITWITHKEY';_0x222985[_0x50bd('0x8a')]=moment()[_0x50bd('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x50bd('0xf')][_0x17400d[_0x50bd('0x49')]]=_0x222985;}}logger['info'](_0x50bd('0xb0'),_0x17400d[_0x50bd('0x49')],_0x222985[_0x50bd('0x4c')],_0x222985[_0x50bd('0x52')],_[_0x50bd('0x7d')](_0x17400d[_0x50bd('0xa8')])[0x0],_0x17400d[_0x50bd('0xa9')]);_0x222985[_0x50bd('0x13')]=this[_0x50bd('0x13')][_0x17400d[_0x50bd('0x49')]];}}}}catch(_0x20a914){logger['error'](_0x50bd('0xa6'),_0x17400d[_0x50bd('0x49')],util[_0x50bd('0x3e')](_0x20a914,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x50bd('0x35')][_0x50bd('0xa7')]=function(_0x44dd45,_0xdb1343,_0x48fc8b){var _0x466dd3=[_0x50bd('0xb1'),'rtpaudioqosbridged',_0x50bd('0xb2'),_0x50bd('0xb3'),_0x50bd('0xb4'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x50bd('0xb5'),_0x50bd('0xb6'),'sipuri',_0x50bd('0xb7'),_0x50bd('0xb8'),_0x50bd('0xb9'),_0x50bd('0xba'),'memberinterface',_0x50bd('0xbb'),_0x50bd('0x94'),_0x50bd('0xbc'),_0x50bd('0xbd')];if(!_[_0x50bd('0x38')](_0xdb1343)&&!_[_0x50bd('0xbe')](_0x466dd3,_0xdb1343)){if(_[_0x50bd('0x74')](this['variables'][_0x44dd45])){this[_0x50bd('0x13')][_0x44dd45]={};}this[_0x50bd('0x13')][_0x44dd45][_0xdb1343]=_0x48fc8b;}};VoiceQueueReport[_0x50bd('0x35')][_0x50bd('0x22')]=function(_0x26a655){try{if(this[_0x50bd('0x62')](_0x26a655)){logger[_0x50bd('0x46')](_0x50bd('0xbf'),_0x26a655[_0x50bd('0x49')],util[_0x50bd('0x3e')](_0x26a655,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x26a655['uniqueid']]){for(var _0x4579d4=0x0,_0x532bc7={};_0x4579d4=0x0?moment(_0x48776c[_0x61f3('0x18')])[_0x61f3('0x19')](_0x48776c[_0x61f3('0x17')],'seconds'):null,'data1':_0x61f3('0x1a'),'data2':_0x48776c[_0x61f3('0x14')],'data3':_0x48776c['exten'],'data4':_0x48776c[_0x61f3('0x1b')]||null,'role':_0x61f3('0x13'),'internal':_0x48776c[_0x61f3('0x14')]?_[_0x61f3('0x1c')](_0x48776c[_0x61f3('0x14')]):undefined,'uniqueid':_0x48776c[_0x61f3('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xc5a2=['seconds','inbound','exten','toNumber','uniqueid','voiceDialReport','CreateMemberReport','starttime','endtime','outbound','dialstring','agent','accountcode','moment','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','diff'];(function(_0x57c474,_0x8870e5){var _0x483f98=function(_0x2d862b){while(--_0x2d862b){_0x57c474['push'](_0x57c474['shift']());}};_0x483f98(++_0x8870e5);}(_0xc5a2,0x195));var _0x2c5a=function(_0x3fe178,_0x39239a){_0x3fe178=_0x3fe178-0x0;var _0x53076c=_0xc5a2[_0x3fe178];return _0x53076c;};'use strict';var moment=require(_0x2c5a('0x0'));var _=require('lodash');var util=require(_0x2c5a('0x1'));var client=require('../client');exports[_0x2c5a('0x2')]=function(_0x6d56fc){var _0xb90730=_0x6d56fc[_0x2c5a('0x3')]||_0x6d56fc[_0x2c5a('0x4')];return client[_0x2c5a('0x5')]('CreateMemberReport',{'body':{'channel':_0x2c5a('0x6'),'membername':_0x6d56fc['lastAssignedTo'],'interface':_[_0x2c5a('0x7')](_0x6d56fc[_0x2c5a('0x8')])?util[_0x2c5a('0x9')](_0x2c5a('0xa'),_0x6d56fc[_0x2c5a('0xb')]):_0x6d56fc[_0x2c5a('0x8')],'type':_0x2c5a('0xc'),'enterAt':_0x6d56fc[_0x2c5a('0xd')],'exitAt':_0xb90730,'duration':moment(_0xb90730)[_0x2c5a('0xe')](_0x6d56fc[_0x2c5a('0xd')],_0x2c5a('0xf')),'data1':_0x2c5a('0x10'),'data2':_0x6d56fc['calleridnum'],'data3':_0x6d56fc[_0x2c5a('0x11')],'data4':null,'data5':_0x6d56fc['queue'],'role':'agent','internal':_0x6d56fc['accountcode']?_[_0x2c5a('0x12')](_0x6d56fc['accountcode']):undefined,'uniqueid':_0x6d56fc[_0x2c5a('0x13')]},'log':'CreateMemberReport'});};exports[_0x2c5a('0x14')]=function(_0x433456){return client[_0x2c5a('0x5')](_0x2c5a('0x15'),{'body':{'channel':_0x2c5a('0x6'),'membername':_0x433456['membername'],'interface':_0x433456['interface'],'type':'TALKING','enterAt':_0x433456[_0x2c5a('0x16')],'exitAt':_0x433456[_0x2c5a('0x17')],'duration':moment(_0x433456['endtime'])[_0x2c5a('0xe')](_0x433456[_0x2c5a('0x16')],_0x2c5a('0xf'))>=0x0?moment(_0x433456[_0x2c5a('0x17')])[_0x2c5a('0xe')](_0x433456[_0x2c5a('0x16')],_0x2c5a('0xf')):null,'data1':_0x2c5a('0x18'),'data2':_0x433456['accountcode'],'data3':_0x433456['exten'],'data4':_0x433456[_0x2c5a('0x19')]||null,'role':_0x2c5a('0x1a'),'internal':_0x433456[_0x2c5a('0x1b')]?_[_0x2c5a('0x12')](_0x433456[_0x2c5a('0x1b')]):undefined,'uniqueid':_0x433456[_0x2c5a('0x13')]},'log':_0x2c5a('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index ccba2a3..5835d80 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 _0xbfcc=['GetSettings','../client','ShowSetting','stopRecordingOnTransfer'];(function(_0x3521db,_0x286d82){var _0x2098d3=function(_0x228501){while(--_0x228501){_0x3521db['push'](_0x3521db['shift']());}};_0x2098d3(++_0x286d82);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x5275b8,_0x51e5dd){_0x5275b8=_0x5275b8-0x0;var _0x568a9b=_0xbfcc[_0x5275b8];return _0x568a9b;};'use strict';var client=require(_0xcbfc('0x0'));exports['getSettings']=function(){return client['Request'](_0xcbfc('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xcbfc('0x2')]},'log':_0xcbfc('0x3')});}; \ No newline at end of file +var _0x22ef=['../client','getSettings','stopRecordingOnTransfer','GetSettings'];(function(_0x4a7c2d,_0x2c031a){var _0x43b574=function(_0x4a6d78){while(--_0x4a6d78){_0x4a7c2d['push'](_0x4a7c2d['shift']());}};_0x43b574(++_0x2c031a);}(_0x22ef,0xd8));var _0xf22e=function(_0xbad45c,_0x1ddc99){_0xbad45c=_0xbad45c-0x0;var _0x261692=_0x22ef[_0xbad45c];return _0x261692;};'use strict';var client=require(_0xf22e('0x0'));exports[_0xf22e('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xf22e('0x2')]},'log':_0xf22e('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6215326..bc0c550 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 _0xfd46=['Request','GetTemplate','name','html','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd46,0x176));var _0x6fd4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xfd46[_0x1035c1];return _0x308d67;};'use strict';var client=require(_0x6fd4('0x0'));exports['getTemplates']=function(_0x21e205){return function(_0x4701db){return client[_0x6fd4('0x1')](_0x6fd4('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6fd4('0x3'),_0x6fd4('0x4')]},'log':_0x6fd4('0x2')});};}; \ No newline at end of file +var _0xecfc=['getTemplates','Request','GetTemplate','name','html'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0xecfc,0x14a));var _0xcecf=function(_0x498ae8,_0x3002d2){_0x498ae8=_0x498ae8-0x0;var _0x125145=_0xecfc[_0x498ae8];return _0x125145;};'use strict';var client=require('../client');exports[_0xcecf('0x0')]=function(_0x106817){return function(_0x44290a){return client[_0xcecf('0x1')](_0xcecf('0x2'),{'options':{'raw':!![],'attributes':['id',_0xcecf('0x3'),_0xcecf('0x4')]},'log':_0xcecf('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 77d1d8f..c00b9df 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 _0xbf33=['../client','getTriggers','Request','GetTrigger','channel','Condition','AllConditions','operator','AnyConditions','field','value','Action','Actions','action','data1','data2','data3','data4','data6','data7'];(function(_0x379caa,_0x1718bd){var _0x19a226=function(_0x17a93a){while(--_0x17a93a){_0x379caa['push'](_0x379caa['shift']());}};_0x19a226(++_0x1718bd);}(_0xbf33,0x12c));var _0x3bf3=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xbf33[_0x5b78e8];return _0xf2c321;};'use strict';var client=require(_0x3bf3('0x0'));exports[_0x3bf3('0x1')]=function(_0x17c7c7){return function(_0x496337){return client[_0x3bf3('0x2')](_0x3bf3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x3bf3('0x4'),'status'],'include':[{'model':_0x3bf3('0x5'),'as':_0x3bf3('0x6'),'attributes':['id','field',_0x3bf3('0x7'),'value']},{'model':_0x3bf3('0x5'),'as':_0x3bf3('0x8'),'attributes':['id',_0x3bf3('0x9'),_0x3bf3('0x7'),_0x3bf3('0xa')]},{'model':_0x3bf3('0xb'),'as':_0x3bf3('0xc'),'attributes':['id',_0x3bf3('0xd'),_0x3bf3('0xe'),_0x3bf3('0xf'),_0x3bf3('0x10'),_0x3bf3('0x11'),'data5',_0x3bf3('0x12'),_0x3bf3('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xb30e=['AllConditions','value','Action','Actions','action','data1','data2','data3','data5','data6','../client','getTriggers','Request','name','channel','status','Condition'];(function(_0x381a17,_0x50f0af){var _0x2cbc26=function(_0x97e64d){while(--_0x97e64d){_0x381a17['push'](_0x381a17['shift']());}};_0x2cbc26(++_0x50f0af);}(_0xb30e,0x92));var _0xeb30=function(_0x266244,_0x4d55a4){_0x266244=_0x266244-0x0;var _0x187672=_0xb30e[_0x266244];return _0x187672;};'use strict';var client=require(_0xeb30('0x0'));exports[_0xeb30('0x1')]=function(_0x4bcce1){return function(_0x2e19ba){return client[_0xeb30('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xeb30('0x3'),_0xeb30('0x4'),_0xeb30('0x5')],'include':[{'model':_0xeb30('0x6'),'as':_0xeb30('0x7'),'attributes':['id','field','operator','value']},{'model':_0xeb30('0x6'),'as':'AnyConditions','attributes':['id','field','operator',_0xeb30('0x8')]},{'model':_0xeb30('0x9'),'as':_0xeb30('0xa'),'attributes':['id',_0xeb30('0xb'),_0xeb30('0xc'),_0xeb30('0xd'),_0xeb30('0xe'),'data4',_0xeb30('0xf'),_0xeb30('0x10'),'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 93e3aba..e0c4873 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 _0xf749=['../client','getTrunks','Request','name','registry','defaultuser','GetTrunk'];(function(_0x182648,_0x2a7b01){var _0x10d106=function(_0x343645){while(--_0x343645){_0x182648['push'](_0x182648['shift']());}};_0x10d106(++_0x2a7b01);}(_0xf749,0x70));var _0x9f74=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf749[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x9f74('0x0'));exports[_0x9f74('0x1')]=function(_0x25e447){return function(_0x4d511e){return client[_0x9f74('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9f74('0x3'),_0x9f74('0x4'),_0x9f74('0x5')]},'log':_0x9f74('0x6')});};}; \ No newline at end of file +var _0x62da=['registry','defaultuser','../client','Request','GetTrunk'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xa62d('0x0'));exports['getTrunks']=function(_0x377e56){return function(_0x31a9bf){return client[_0xa62d('0x1')](_0xa62d('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xa62d('0x3'),_0xa62d('0x4')]},'log':_0xa62d('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index ca374c9..337430c 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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x523a3d,_0x285843){var _0x363f49=function(_0x175208){while(--_0x175208){_0x523a3d['push'](_0x523a3d['shift']());}};_0x363f49(++_0x285843);}(_0x34e8,0x12c));var _0x834e=function(_0x26fd4a,_0x450acc){_0x26fd4a=_0x26fd4a-0x0;var _0x378756=_0x34e8[_0x26fd4a];return _0x378756;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index de48385..f0b3a54 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 _0x7f46=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x34f46d,_0x1d6712){var _0x3a2d9e=function(_0x13eaec){while(--_0x13eaec){_0x34f46d['push'](_0x34f46d['shift']());}};_0x3a2d9e(++_0x1d6712);}(_0x7f46,0x17c));var _0x67f4=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x7f46[_0x2543d6];return _0x55213c;};'use strict';var client=require(_0x67f4('0x0'));exports['create']=function(_0x231163){return client[_0x67f4('0x1')]('CreateVoiceAgentReport',{'body':_0x231163,'log':_0x67f4('0x2')});};exports[_0x67f4('0x3')]=function(_0x19d3e0,_0x298e46,_0x8cc72f){return client[_0x67f4('0x1')]('UpdateVoiceAgentReport',{'body':_0x19d3e0,'options':{'where':{'uniqueid':_0x298e46,'interface':_0x8cc72f,'agentcomplete':!![]}},'log':_0x67f4('0x4')});}; \ No newline at end of file +var _0x3794=['CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client','create'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x3794,0x15a));var _0x4379=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0x3794[_0x2d5934];return _0x5807c8;};'use strict';var client=require(_0x4379('0x0'));exports[_0x4379('0x1')]=function(_0xb55e3a){return client['Request'](_0x4379('0x2'),{'body':_0xb55e3a,'log':_0x4379('0x2')});};exports[_0x4379('0x3')]=function(_0x3f26cf,_0x131ec1,_0x27c230){return client[_0x4379('0x4')](_0x4379('0x5'),{'body':_0x3f26cf,'options':{'where':{'uniqueid':_0x131ec1,'interface':_0x27c230,'agentcomplete':!![]}},'log':_0x4379('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index d879f86..c32ee10 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 _0xb03d=['Request','GetVoiceCallReport','outbound','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','GetVoiceCallReports','util','../client','create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION'];(function(_0x24a205,_0x30ccd4){var _0x4a745f=function(_0x5ab310){while(--_0x5ab310){_0x24a205['push'](_0x24a205['shift']());}};_0x4a745f(++_0x30ccd4);}(_0xb03d,0x186));var _0xdb03=function(_0x7e6cb6,_0xc76d0c){_0x7e6cb6=_0x7e6cb6-0x0;var _0x343a98=_0xb03d[_0x7e6cb6];return _0x343a98;};'use strict';var moment=require('moment');var util=require(_0xdb03('0x0'));var _=require('lodash');var client=require(_0xdb03('0x1'));exports[_0xdb03('0x2')]=function(_0x521501){return client['Request'](_0xdb03('0x3'),{'body':_[_0xdb03('0x4')](_0x521501,{'source':_0x521501[_0xdb03('0x5')],'destinationcontext':_0x521501[_0xdb03('0x6')],'callerid':_0x521501[_0xdb03('0x7')],'amaflags':_0xdb03('0x8')}),'log':_0xdb03('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xdb03('0x9')](_0xdb03('0xa'),{'options':{'where':{'type':[_0xdb03('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xdb03('0xc'))[_0xdb03('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xdb03('0xe')](_0xdb03('0xc'))[_0xdb03('0xd')](_0xdb03('0xf'))]}},'attributes':[_0xdb03('0x10'),_0xdb03('0x11'),'duration','billableseconds']},'log':_0xdb03('0x12')});};}; \ No newline at end of file +var _0x23b3=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day'];(function(_0x350f77,_0x12a9b8){var _0x1305b6=function(_0x1477a9){while(--_0x1477a9){_0x350f77['push'](_0x350f77['shift']());}};_0x1305b6(++_0x12a9b8);}(_0x23b3,0x1ac));var _0x323b=function(_0xbe0bad,_0x242e22){_0xbe0bad=_0xbe0bad-0x0;var _0x2a18cc=_0x23b3[_0xbe0bad];return _0x2a18cc;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x323b('0x0'));var client=require('../client');exports[_0x323b('0x1')]=function(_0x5bc1da){return client[_0x323b('0x2')](_0x323b('0x3'),{'body':_[_0x323b('0x4')](_0x5bc1da,{'source':_0x5bc1da[_0x323b('0x5')],'destinationcontext':_0x5bc1da[_0x323b('0x6')],'callerid':_0x5bc1da[_0x323b('0x7')],'amaflags':_0x323b('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x323b('0x9')]=function(){return function(){return client[_0x323b('0x2')](_0x323b('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x323b('0xb')](_0x323b('0xc'))[_0x323b('0xd')](_0x323b('0xe')),moment()[_0x323b('0xf')](_0x323b('0xc'))[_0x323b('0xd')](_0x323b('0xe'))]}},'attributes':[_0x323b('0x10'),_0x323b('0x11'),_0x323b('0x12'),_0x323b('0x13')]},'log':_0x323b('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 84d5439..8f5ea8a 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 _0xbdfe=['../client','create','Request','CreateVoiceDialReport'];(function(_0x506566,_0x2d02f3){var _0x43e2e5=function(_0x54f164){while(--_0x54f164){_0x506566['push'](_0x506566['shift']());}};_0x43e2e5(++_0x2d02f3);}(_0xbdfe,0x108));var _0xebdf=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0xbdfe[_0x2eb5bc];return _0x51c7b1;};'use strict';var client=require(_0xebdf('0x0'));exports[_0xebdf('0x1')]=function(_0x58e6f5){return client[_0xebdf('0x2')]('CreateVoiceDialReport',{'body':_0x58e6f5,'log':_0xebdf('0x3')});}; \ No newline at end of file +var _0xa66f=['CreateVoiceDialReport','../client','create','Request'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa66f,0xe5));var _0xfa66=function(_0xfde72e,_0x3847c1){_0xfde72e=_0xfde72e-0x0;var _0x18ca84=_0xa66f[_0xfde72e];return _0x18ca84;};'use strict';var client=require(_0xfa66('0x0'));exports[_0xfa66('0x1')]=function(_0x297a05){return client[_0xfa66('0x2')](_0xfa66('0x3'),{'body':_0x297a05,'log':_0xfa66('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ba0e83a..efaab7a 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 _0x13f6=['../client','getVoiceExtensions','exten','recordingFormat'];(function(_0x2bcfb8,_0x248578){var _0xc7c47e=function(_0x450f86){while(--_0x450f86){_0x2bcfb8['push'](_0x2bcfb8['shift']());}};_0xc7c47e(++_0x248578);}(_0x13f6,0x124));var _0x613f=function(_0x212b7b,_0x179e1c){_0x212b7b=_0x212b7b-0x0;var _0x5ba0e9=_0x13f6[_0x212b7b];return _0x5ba0e9;};'use strict';var client=require(_0x613f('0x0'));exports[_0x613f('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x613f('0x2'),_0x613f('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x613f('0x1')});};}; \ No newline at end of file +var _0x6931=['recordingFormat','../client','getVoiceExtensions','exten'];(function(_0x3286f0,_0x3667fc){var _0x51c533=function(_0xca50b8){while(--_0xca50b8){_0x3286f0['push'](_0x3286f0['shift']());}};_0x51c533(++_0x3667fc);}(_0x6931,0xa5));var _0x1693=function(_0xf2824b,_0xce0efa){_0xf2824b=_0xf2824b-0x0;var _0x536776=_0x6931[_0xf2824b];return _0x536776;};'use strict';var client=require(_0x1693('0x0'));exports[_0x1693('0x1')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x1693('0x2'),_0x1693('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x1693('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index dbbe904..8bf8b1d 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 _0xed54=['dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','dialActive','dialMethod'];(function(_0x11d8a9,_0x462404){var _0x2c1939=function(_0x1d2f8d){while(--_0x1d2f8d){_0x11d8a9['push'](_0x11d8a9['shift']());}};_0x2c1939(++_0x462404);}(_0xed54,0xfc));var _0x4ed5=function(_0xe9efcc,_0x24cba9){_0xe9efcc=_0xe9efcc-0x0;var _0x100cf1=_0xed54[_0xe9efcc];return _0x100cf1;};'use strict';var client=require('../client');exports[_0x4ed5('0x0')]=function(){return function(){return client[_0x4ed5('0x1')](_0x4ed5('0x2'),{'options':{'raw':![],'attributes':['id',_0x4ed5('0x3'),'acw',_0x4ed5('0x4'),_0x4ed5('0x5'),'monitor_format','type',_0x4ed5('0x6'),_0x4ed5('0x7'),_0x4ed5('0x8'),_0x4ed5('0x9'),_0x4ed5('0xa'),_0x4ed5('0xb'),_0x4ed5('0xc'),'dialPredictiveInterval',_0x4ed5('0xd'),_0x4ed5('0xe'),_0x4ed5('0xf'),_0x4ed5('0x10'),_0x4ed5('0x11'),'dialQueueProject',_0x4ed5('0x12'),_0x4ed5('0x13'),_0x4ed5('0x14'),_0x4ed5('0x15'),_0x4ed5('0x16'),'dialNoAnswerRetryFrequency',_0x4ed5('0x17'),_0x4ed5('0x18'),_0x4ed5('0x19'),_0x4ed5('0x1a'),_0x4ed5('0x1b'),_0x4ed5('0x1c'),_0x4ed5('0x1d'),_0x4ed5('0x1e'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x4ed5('0x1f'),_0x4ed5('0x20'),_0x4ed5('0x21'),_0x4ed5('0x22'),_0x4ed5('0x23'),_0x4ed5('0x24'),_0x4ed5('0x25'),_0x4ed5('0x26'),_0x4ed5('0x27'),_0x4ed5('0x28'),_0x4ed5('0x29'),_0x4ed5('0x2a'),_0x4ed5('0x2b'),_0x4ed5('0x2c'),_0x4ed5('0x2d'),_0x4ed5('0x2e'),'dialNoSuchNumberMaxRetry',_0x4ed5('0x2f'),_0x4ed5('0x30'),_0x4ed5('0x31'),'dialAbandonedMaxRetry',_0x4ed5('0x32'),_0x4ed5('0x33'),_0x4ed5('0x34'),_0x4ed5('0x35'),_0x4ed5('0x36'),_0x4ed5('0x37'),_0x4ed5('0x38'),_0x4ed5('0x39'),'dialPreviewAutoRecallMe'],'include':[{'model':_0x4ed5('0x3a'),'as':_0x4ed5('0x3a'),'attributes':['id','name',_0x4ed5('0x3b'),'active']},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x4ed5('0x3')]},{'model':'Trunk','as':_0x4ed5('0x3c'),'attributes':['id',_0x4ed5('0x3'),_0x4ed5('0x3b'),_0x4ed5('0x3d')]},{'model':_0x4ed5('0x3e'),'as':_0x4ed5('0x3e'),'attributes':['id',_0x4ed5('0x3')],'include':[{'model':'Interval','as':_0x4ed5('0x3f'),'attributes':['id',_0x4ed5('0x3'),_0x4ed5('0x40')]}]}]},'log':_0x4ed5('0x0')});};}; \ No newline at end of file +var _0x600f=['monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acwTimeout','autopause'];(function(_0x26a4ea,_0xa72fb8){var _0x1b669e=function(_0x4e8bba){while(--_0x4e8bba){_0x26a4ea['push'](_0x26a4ea['shift']());}};_0x1b669e(++_0xa72fb8);}(_0x600f,0xb4));var _0xf600=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0x600f[_0x5dc03e];return _0x466a07;};'use strict';var client=require(_0xf600('0x0'));exports[_0xf600('0x1')]=function(){return function(){return client[_0xf600('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xf600('0x3'),'acw',_0xf600('0x4'),_0xf600('0x5'),_0xf600('0x6'),_0xf600('0x7'),_0xf600('0x8'),_0xf600('0x9'),_0xf600('0xa'),_0xf600('0xb'),'dialPowerLevel',_0xf600('0xc'),'dialPredictiveOptimizationPercentage',_0xf600('0xd'),'dialOriginateCallerIdName',_0xf600('0xe'),_0xf600('0xf'),_0xf600('0x10'),_0xf600('0x11'),'dialQueueProject',_0xf600('0x12'),_0xf600('0x13'),_0xf600('0x14'),_0xf600('0x15'),'dialNoAnswerMaxRetry',_0xf600('0x16'),'dialGlobalMaxRetry',_0xf600('0x17'),_0xf600('0x18'),_0xf600('0x19'),_0xf600('0x1a'),_0xf600('0x1b'),_0xf600('0x1c'),_0xf600('0x1d'),_0xf600('0x1e'),'dialAMDTotalAnalysisTime',_0xf600('0x1f'),_0xf600('0x20'),_0xf600('0x21'),'dialAMDSilenceThreshold',_0xf600('0x22'),'timeout','dialRecallMeTimeout',_0xf600('0x23'),_0xf600('0x24'),_0xf600('0x25'),_0xf600('0x26'),_0xf600('0x27'),'monitor_format',_0xf600('0x28'),_0xf600('0x29'),_0xf600('0x2a'),_0xf600('0x2b'),_0xf600('0x2c'),_0xf600('0x2d'),_0xf600('0x2e'),'dialAbandonedMaxRetry',_0xf600('0x2f'),'dialMachineMaxRetry',_0xf600('0x30'),_0xf600('0x31'),_0xf600('0x32'),_0xf600('0x33'),_0xf600('0x34'),'dialPredictiveIntervalMinThreshold',_0xf600('0x35')],'include':[{'model':_0xf600('0x36'),'as':_0xf600('0x36'),'attributes':['id',_0xf600('0x3'),_0xf600('0x37'),_0xf600('0x38')]},{'model':_0xf600('0x39'),'as':_0xf600('0x3a'),'attributes':['id',_0xf600('0x3')]},{'model':_0xf600('0x36'),'as':'TrunkBackup','attributes':['id','name','callerid',_0xf600('0x38')]},{'model':_0xf600('0x3b'),'as':_0xf600('0x3b'),'attributes':['id',_0xf600('0x3')],'include':[{'model':_0xf600('0x3b'),'as':_0xf600('0x3c'),'attributes':['id',_0xf600('0x3'),_0xf600('0x3d')]}]}]},'log':_0xf600('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d9a881e..ed57d6f 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(_0x2e4449,_0x4fb097){var _0x571ef6=function(_0x115a05){while(--_0x115a05){_0x2e4449['push'](_0x2e4449['shift']());}};_0x571ef6(++_0x4fb097);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +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(_0x5b575f,_0x38809d){var _0xf3c3f2=function(_0x2c4127){while(--_0x2c4127){_0x5b575f['push'](_0x5b575f['shift']());}};_0xf3c3f2(++_0x38809d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 1f489b4..2cbb296 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 _0x41b6=['getVoiceQueueRtPauses'];(function(_0x1f7001,_0x58cd96){var _0x2f572b=function(_0x3bacc0){while(--_0x3bacc0){_0x1f7001['push'](_0x1f7001['shift']());}};_0x2f572b(++_0x58cd96);}(_0x41b6,0x1ef));var _0x641b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b6[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x641b('0x0')]=function(_0x4a5d8f){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4a5d8f,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xdcc4=['Request','getVoiceQueueRtPauses'];(function(_0x424f3a,_0x1e79b7){var _0x1d5f73=function(_0x2859ac){while(--_0x2859ac){_0x424f3a['push'](_0x424f3a['shift']());}};_0x1d5f73(++_0x1e79b7);}(_0xdcc4,0x1af));var _0x4dcc=function(_0x40e32e,_0x253820){_0x40e32e=_0x40e32e-0x0;var _0x16aeed=_0xdcc4[_0x40e32e];return _0x16aeed;};'use strict';var client=require('../client');exports[_0x4dcc('0x0')]=function(_0x2a6e3e){return function(){return client[_0x4dcc('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x2a6e3e,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index b9ca41c..6262c29 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0xb6fd62,_0x5764a0){var _0x16387b=function(_0x691bf0){while(--_0x691bf0){_0xb6fd62['push'](_0xb6fd62['shift']());}};_0x16387b(++_0x5764a0);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1d3e6c,_0x188877){var _0x39cb2=function(_0x4acede){while(--_0x4acede){_0x1d3e6c['push'](_0x1d3e6c['shift']());}};_0x39cb2(++_0x188877);}(_0x7a54,0x106));var _0x47a5=function(_0x51683e,_0x113e0d){_0x51683e=_0x51683e-0x0;var _0x4853d3=_0x7a54[_0x51683e];return _0x4853d3;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 1497f7a..8b776c3 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 _0x88c7=['attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten'];(function(_0x1ebfc7,_0x2797db){var _0x1627b8=function(_0x59ceee){while(--_0x59ceee){_0x1ebfc7['push'](_0x1ebfc7['shift']());}};_0x1627b8(++_0x2797db);}(_0x88c7,0x17d));var _0x788c=function(_0x8b734e,_0x31075d){_0x8b734e=_0x8b734e-0x0;var _0x26b1ca=_0x88c7[_0x8b734e];return _0x26b1ca;};'use strict';var client=require(_0x788c('0x0'));exports['transfers']={};exports[_0x788c('0x1')]=function(_0x32ac08){return client[_0x788c('0x2')](_0x788c('0x3'),{'body':{'result':_0x32ac08[_0x788c('0x4')],'transfererchannel':_0x32ac08['transfererchannel'],'transferercalleridnum':_0x32ac08[_0x788c('0x5')],'transferercalleridname':_0x32ac08[_0x788c('0x6')],'transfererconnectedlinenum':_0x32ac08[_0x788c('0x7')],'transfererconnectedlinename':_0x32ac08[_0x788c('0x8')],'transfereraccountcode':_0x32ac08[_0x788c('0x9')],'transferercontext':_0x32ac08['transferercontext'],'transfererexten':_0x32ac08['transfererexten'],'transfererlinkedid':_0x32ac08[_0x788c('0xa')],'transfereechannel':_0x32ac08[_0x788c('0xb')],'transfereecalleridnum':_0x32ac08[_0x788c('0xc')],'transfereecalleridname':_0x32ac08['transfereecalleridname'],'transfereeconnectedlinenum':_0x32ac08[_0x788c('0xd')],'transfereeconnectedlinename':_0x32ac08[_0x788c('0xe')],'transfereeaccountcode':_0x32ac08[_0x788c('0xf')],'transfereecontext':_0x32ac08[_0x788c('0x10')],'transfereeexten':_0x32ac08[_0x788c('0x11')],'transfereelinkedid':_0x32ac08[_0x788c('0x12')],'isexternal':_0x32ac08[_0x788c('0x13')],'context':_0x32ac08[_0x788c('0x14')],'extension':_0x32ac08['extension'],'type':_0x788c('0x15')},'log':_0x788c('0x3')});};exports['attendedTransfer']=function(_0x5760f8){return client[_0x788c('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x5760f8[_0x788c('0x4')],'transfererchannel':_0x5760f8[_0x788c('0x16')],'transferercalleridnum':_0x5760f8[_0x788c('0x17')],'transferercalleridname':_0x5760f8[_0x788c('0x18')],'transfererconnectedlinenum':_0x5760f8['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5760f8['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5760f8[_0x788c('0x19')],'transferercontext':_0x5760f8['secondtransferercontext'],'transfererexten':_0x5760f8['secondtransfererexten'],'transfererlinkedid':_0x5760f8[_0x788c('0x1a')],'transfereechannel':_0x5760f8[_0x788c('0x1b')],'transfereecalleridnum':_0x5760f8[_0x788c('0x1c')],'transfereecalleridname':_0x5760f8[_0x788c('0x1d')],'transfereeconnectedlinenum':_0x5760f8['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5760f8[_0x788c('0x1e')],'transfereeaccountcode':_0x5760f8[_0x788c('0x1f')],'transfereecontext':_0x5760f8[_0x788c('0x20')],'transfereeexten':_0x5760f8[_0x788c('0x21')],'transfereelinkedid':_0x5760f8[_0x788c('0x22')],'isexternal':_0x5760f8[_0x788c('0x13')],'context':_0x5760f8[_0x788c('0x23')],'extension':_0x5760f8[_0x788c('0x24')],'type':_0x788c('0x25')},'log':_0x788c('0x3')});}; \ No newline at end of file +var _0x18c8=['transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','transferercalleridnum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereelinkedid','isexternal','context','extension','attendedTransfer','Request','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x18c8,0x17d));var _0x818c=function(_0x557e1b,_0x5d53e3){_0x557e1b=_0x557e1b-0x0;var _0x345349=_0x18c8[_0x557e1b];return _0x345349;};'use strict';var client=require(_0x818c('0x0'));exports[_0x818c('0x1')]={};exports[_0x818c('0x2')]=function(_0x1543bd){return client['Request'](_0x818c('0x3'),{'body':{'result':_0x1543bd['result'],'transfererchannel':_0x1543bd['transfererchannel'],'transferercalleridnum':_0x1543bd[_0x818c('0x4')],'transferercalleridname':_0x1543bd['transferercalleridname'],'transfererconnectedlinenum':_0x1543bd['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1543bd[_0x818c('0x5')],'transfereraccountcode':_0x1543bd['transfereraccountcode'],'transferercontext':_0x1543bd[_0x818c('0x6')],'transfererexten':_0x1543bd[_0x818c('0x7')],'transfererlinkedid':_0x1543bd[_0x818c('0x8')],'transfereechannel':_0x1543bd[_0x818c('0x9')],'transfereecalleridnum':_0x1543bd['transfereecalleridnum'],'transfereecalleridname':_0x1543bd['transfereecalleridname'],'transfereeconnectedlinenum':_0x1543bd[_0x818c('0xa')],'transfereeconnectedlinename':_0x1543bd[_0x818c('0xb')],'transfereeaccountcode':_0x1543bd[_0x818c('0xc')],'transfereecontext':_0x1543bd['transfereecontext'],'transfereeexten':_0x1543bd['transfereeexten'],'transfereelinkedid':_0x1543bd[_0x818c('0xd')],'isexternal':_0x1543bd[_0x818c('0xe')],'context':_0x1543bd[_0x818c('0xf')],'extension':_0x1543bd[_0x818c('0x10')],'type':'blind'},'log':_0x818c('0x3')});};exports[_0x818c('0x11')]=function(_0x234157){return client[_0x818c('0x12')]('CreateVoiceTransferReport',{'body':{'result':_0x234157['result'],'transfererchannel':_0x234157[_0x818c('0x13')],'transferercalleridnum':_0x234157['origtransferercalleridnum'],'transferercalleridname':_0x234157['origtransferercalleridname'],'transfererconnectedlinenum':_0x234157[_0x818c('0x14')],'transfererconnectedlinename':_0x234157['secondtransfererconnectedlinename'],'transfereraccountcode':_0x234157[_0x818c('0x15')],'transferercontext':_0x234157[_0x818c('0x16')],'transfererexten':_0x234157[_0x818c('0x17')],'transfererlinkedid':_0x234157[_0x818c('0x18')],'transfereechannel':_0x234157[_0x818c('0x19')],'transfereecalleridnum':_0x234157[_0x818c('0x1a')],'transfereecalleridname':_0x234157[_0x818c('0x1b')],'transfereeconnectedlinenum':_0x234157['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x234157[_0x818c('0x1c')],'transfereeaccountcode':_0x234157['transfertargetaccountcode'],'transfereecontext':_0x234157[_0x818c('0x1d')],'transfereeexten':_0x234157[_0x818c('0x1e')],'transfereelinkedid':_0x234157[_0x818c('0x1f')],'isexternal':_0x234157[_0x818c('0xe')],'context':_0x234157[_0x818c('0x20')],'extension':_0x234157[_0x818c('0x21')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 5284b17..deff9c1 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 _0xe714=['abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','catch','Channel\x20doesn\x27t\x20exist','isConnected','resolve','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','faxAccounts','send','checkAfterSend','server','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','moment','../properties','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','asterisk','join','pick','action','Reload','Action','then','message','error','username','ami\x20disconnected','command','Command','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumHoldTime','talking','type'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0xe714,0xe2));var _0x4e71=function(_0x2854fb,_0x37ae77){_0x2854fb=_0x2854fb-0x0;var _0x96290a=_0xe714[_0x2854fb];return _0x96290a;};'use strict';var _=require(_0x4e71('0x0'));var util=require('util');var jayson=require(_0x4e71('0x1'));var schema=require(_0x4e71('0x2'));var BPromise=require(_0x4e71('0x3'));var moment=require(_0x4e71('0x4'));var config=require('../../../config/environment');var properties=require(_0x4e71('0x5'));var ami=require('../ami');exports[_0x4e71('0x6')]=function(_0x19e056,_0x28ce78,_0x204a19){return new BPromise(function(_0xfe1559,_0x1f1d35){var _0x55b1cc={'QueuePause':function(_0x3b0a3a){return new Promise(function(_0x32b6d0,_0xda346c){var _0x564d0f=util[_0x4e71('0x7')]('%s/%s',_0x4e71('0x8'),_0x3b0a3a[_0x4e71('0x9')]);if(_0x19e056[_0x4e71('0xa')]&&_0x19e056[_0x4e71('0xa')][_0x564d0f]&&_0x19e056[_0x4e71('0xa')][_0x564d0f][_0x4e71('0xb')]){_0x19e056[_0x4e71('0xa')][_0x564d0f][_0x4e71('0xc')]();}if(_0x19e056['agents'][_0x564d0f]){_0x19e056[_0x4e71('0xd')][_0x564d0f][_0x4e71('0xe')]({'statePause':_0x3b0a3a['pause']?!![]:![]});}_0x32b6d0({'code':0xc8,'message':_0x4e71('0xf')});});},'Reload':function(_0x311b12){var _0x5775b0=this;return new Promise(function(_0x139d96,_0x2e416e){if(ami['isConnected']()==![]){return _0x2e416e(_0x5775b0['error'](0x1f4,[config[_0x4e71('0x10')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x4e71('0x11')]('\x20')));}_0x311b12=_[_0x4e71('0x12')](_0x311b12,_['keys'](properties['module']));_0x311b12[_0x4e71('0x13')]=_0x4e71('0x14');return ami[_0x4e71('0x15')](_0x311b12)[_0x4e71('0x16')](function(_0x40f288){_0x139d96({'code':0xc8,'message':_0x40f288[_0x4e71('0x17')]});})['catch'](function(_0x18b745){_0x2e416e(_0x5775b0[_0x4e71('0x18')](0x1f5,_0x18b745['message']));});});},'Command':function(_0x38416f){var _0x20b3ef=this;return new Promise(function(_0x59ac5a,_0x573bad){if(ami['isConnected']()==![]){return _0x573bad(_0x20b3ef[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}_0x38416f=_[_0x4e71('0x12')](_0x38416f,_0x4e71('0x1b'));_0x38416f[_0x4e71('0x13')]=_0x4e71('0x1c');return ami[_0x4e71('0x15')](_0x38416f)[_0x4e71('0x16')](function(_0x5e90f0){_0x59ac5a({'code':0xc8,'message':_0x5e90f0['content']});})['catch'](function(_0x5b6584){_0x573bad(_0x20b3ef[_0x4e71('0x18')](0x1f5,_0x5b6584[_0x4e71('0x17')]));});});},'VoiceQueues':function(_0x31705d){return new Promise(function(_0x4ab095,_0x35f181){var _0x237057=[];for(var _0x564afb in _0x19e056[_0x4e71('0x1d')]){if(_0x19e056[_0x4e71('0x1d')][_0x4e71('0x1e')](_0x564afb)){var _0x53b08a=_0x19e056['voiceQueues'][_0x564afb];var _0xede8c0={'id':_0x53b08a['id'],'name':_0x53b08a[_0x4e71('0x9')],'strategy':_0x53b08a[_0x4e71('0x1f')],'answered':_0x53b08a[_0x4e71('0x20')],'available':_0x53b08a[_0x4e71('0x21')],'loggedIn':_0x53b08a[_0x4e71('0x22')],'pTalking':_0x53b08a['pTalking'],'sumBillable':_0x53b08a['sumBillable'],'sumDuration':_0x53b08a['sumDuration'],'sumHoldTime':_0x53b08a[_0x4e71('0x23')]||0x0,'talking':_0x53b08a[_0x4e71('0x24')],'total':_0x53b08a['total'],'type':_0x53b08a[_0x4e71('0x25')],'unmanaged':_0x53b08a['unmanaged'],'abandoned':_0x53b08a[_0x4e71('0x26')],'waiting':_0x53b08a[_0x4e71('0x27')],'loggedInDb':_0x53b08a[_0x4e71('0x28')]};if(_0x53b08a[_0x4e71('0x25')]===_0x4e71('0x29')){_0xede8c0['dialActive']=_0x53b08a[_0x4e71('0x2a')];_0xede8c0['dialMethod']=_0x53b08a[_0x4e71('0x2b')];_0xede8c0[_0x4e71('0x2c')]=_0x53b08a[_0x4e71('0x2c')];_0xede8c0[_0x4e71('0x2d')]=_0x53b08a[_0x4e71('0x2d')];_0xede8c0['dialOriginateTimeout']=_0x53b08a['dialOriginateTimeout'];_0xede8c0['dialPrefix']=_0x53b08a[_0x4e71('0x2e')];_0xede8c0[_0x4e71('0x2f')]=_0x53b08a['temp'];_0xede8c0[_0x4e71('0x30')]=_0x53b08a[_0x4e71('0x30')];_0xede8c0['outboundAnswerCallsDay']=_0x53b08a['outboundAnswerCallsDay'];_0xede8c0[_0x4e71('0x31')]=_0x53b08a[_0x4e71('0x31')];_0xede8c0['outboundBusyCallsDay']=_0x53b08a[_0x4e71('0x32')];_0xede8c0[_0x4e71('0x33')]=_0x53b08a['outboundCongestionCallsDay'];_0xede8c0[_0x4e71('0x34')]=_0x53b08a[_0x4e71('0x34')];_0xede8c0[_0x4e71('0x35')]=_0x53b08a['outboundDropCallsDayCallersExit'];_0xede8c0[_0x4e71('0x36')]=_0x53b08a[_0x4e71('0x36')];_0xede8c0[_0x4e71('0x37')]=_0x53b08a[_0x4e71('0x37')];_0xede8c0[_0x4e71('0x38')]=_0x53b08a['outboundNoSuchCallsDay'];_0xede8c0[_0x4e71('0x39')]=_0x53b08a[_0x4e71('0x39')];_0xede8c0[_0x4e71('0x3a')]=_0x53b08a[_0x4e71('0x3a')];_0xede8c0[_0x4e71('0x3b')]=_0x53b08a['outboundRejectCallsDay'];_0xede8c0['outboundUnknownCallsDay']=_0x53b08a[_0x4e71('0x3c')];_0xede8c0[_0x4e71('0x3d')]=_0x53b08a[_0x4e71('0x3d')];_0xede8c0[_0x4e71('0x3e')]=_0x53b08a[_0x4e71('0x3e')];_0xede8c0['predictiveIntervalAvgTalktime']=_0x53b08a[_0x4e71('0x3f')];_0xede8c0['predictiveIntervalDroppedCallsCallersExit']=_0x53b08a[_0x4e71('0x40')];_0xede8c0['predictiveIntervalDroppedCallsTimeout']=_0x53b08a[_0x4e71('0x41')];_0xede8c0[_0x4e71('0x42')]=_0x53b08a['predictiveIntervalErlangCalls'];_0xede8c0[_0x4e71('0x43')]=_0x53b08a[_0x4e71('0x43')];_0xede8c0[_0x4e71('0x44')]=_0x53b08a[_0x4e71('0x44')];_0xede8c0[_0x4e71('0x45')]=_0x53b08a[_0x4e71('0x45')];_0xede8c0[_0x4e71('0x46')]=_0x53b08a[_0x4e71('0x46')];_0xede8c0[_0x4e71('0x47')]=_0x53b08a['predictiveIntervalAvailable'];_0xede8c0['predictiveIntervalTotalCalls']=_0x53b08a[_0x4e71('0x48')];_0xede8c0[_0x4e71('0x17')]=_0x53b08a[_0x4e71('0x17')];_0xede8c0[_0x4e71('0x49')]=_0x53b08a['originated'];_0xede8c0['erlangCalls']=_0x53b08a[_0x4e71('0x4a')];_0xede8c0[_0x4e71('0x4b')]=_0x53b08a[_0x4e71('0x4b')];_0xede8c0[_0x4e71('0x4c')]=_0x53b08a[_0x4e71('0x4c')];_0xede8c0[_0x4e71('0x4d')]=_0x53b08a[_0x4e71('0x4d')];_0xede8c0[_0x4e71('0x4e')]=_0x53b08a[_0x4e71('0x4e')];_0xede8c0[_0x4e71('0x4f')]=_0x53b08a[_0x4e71('0x4f')];}if(_0x53b08a[_0x4e71('0x50')]){_0xede8c0['Trunk']={'id':_0x53b08a[_0x4e71('0x50')]['id'],'name':_0x53b08a[_0x4e71('0x50')][_0x4e71('0x9')],'active':_0x53b08a['Trunk']['active'],'callerid':_0x53b08a['Trunk']['callerid']};}if(_0x53b08a[_0x4e71('0x51')]){_0xede8c0[_0x4e71('0x51')]={'id':_0x53b08a['Interval']['id'],'name':_0x53b08a['Interval']['name']};}_0x237057[_0x4e71('0x52')](_0xede8c0);}}_0x4ab095({'count':_0x237057[_0x4e71('0x53')],'rows':_0x237057});});},'UpdateVoiceQueue':function(_0x11c6c8){return new Promise(function(_0x390b9c,_0x3daa67){var _0x259273=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x1d')],{'id':parseInt(_0x11c6c8['id'])});var _0x3e2e47=_[_0x4e71('0x55')](_0x11c6c8,['id']);if(_0x259273){for(var _0x55b025 in _0x3e2e47){if(typeof _0x3e2e47[_0x55b025]!==_0x4e71('0x56')&&typeof _0x259273[_0x55b025]!==_0x4e71('0x56')){_0x259273[_0x55b025]=_0x3e2e47[_0x55b025];}}_0x390b9c(_0x259273);}else{_0x3daa67();}});},'VoiceChannels':function(_0x5e6345){return new Promise(function(_0x43a710,_0x37964e){var _0x5a7a22=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x58')]);_0x43a710({'count':_0x5a7a22[_0x4e71('0x53')],'rows':_0x5a7a22});});},'VoiceChannelMixMonitor':function(_0x355d0c){var _0x4ca022=this;return new Promise(function(_0x450663,_0x4cc90a){if(ami['isConnected']()==![]){return _0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}var _0x5004c2=schema(properties[_0x4e71('0x59')])[_0x4e71('0x2')](_0x355d0c);if(_0x5004c2[_0x4e71('0x53')]>0x0){return _0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f4,_[_0x4e71('0x5a')](_0x5004c2,'message')['join'](',\x20')));}var _0x362334=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x58')],{'uniqueid':_0x355d0c[_0x4e71('0x5b')]});if(_0x362334&&_0x362334[_0x4e71('0x5c')]){var _0x149e71=util[_0x4e71('0x7')](_0x4e71('0x5d'),_0x355d0c[_0x4e71('0x5e')]||_0x355d0c[_0x4e71('0x5b')],_0x355d0c['format']||_0x4e71('0x5f'));return ami[_0x4e71('0x15')]({'action':_0x4e71('0x60'),'channel':_0x362334[_0x4e71('0x5c')],'file':_0x149e71,'options':_0x4e71('0x61')})[_0x4e71('0x16')](function(_0x1385ef){var _0x3622d8=_[_0x4e71('0x54')](_0x362334[_0x4e71('0x62')],{'filename':_0x4e71('0x63')+_0x149e71[_0x4e71('0x64')]()});if(_[_0x4e71('0x65')](_0x3622d8)){_0x362334['monitors'][_0x4e71('0x52')]({'filename':_0x4e71('0x63')+_0x149e71[_0x4e71('0x64')](),'createdAt':moment()[_0x4e71('0x7')](_0x4e71('0x66')),'mixmonitorid':_0x1385ef[_0x4e71('0x67')],'status':_0x4e71('0x68')});}else{_0x3622d8['mixmonitorid']=_0x1385ef[_0x4e71('0x67')];_0x3622d8['status']=_0x4e71('0x68');}_0x450663({'code':0xc8,'message':[_0x355d0c[_0x4e71('0x5b')],_0x4e71('0x69'),_0x1385ef['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x1385ef[_0x4e71('0x67')]});})[_0x4e71('0x6a')](function(_0x34910c){_0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f5,[_0x355d0c['uniqueid'],_0x34910c[_0x4e71('0x17')]['toLowerCase']()][_0x4e71('0x11')]('\x20')));});}else{return _0x4cc90a(_0x4ca022[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x58561c){var _0x419417=this;return new Promise(function(_0x18cd5b,_0x3d09a9){if(ami[_0x4e71('0x6c')]()==![]){return _0x3d09a9(_0x419417[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')]['username'],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}var _0x231250=schema(properties[_0x4e71('0x59')])[_0x4e71('0x2')](_0x58561c);if(_0x231250[_0x4e71('0x53')]>0x0){return _0x3d09a9(_0x419417['error'](0x1f4,_[_0x4e71('0x5a')](_0x231250,_0x4e71('0x17'))[_0x4e71('0x11')](',\x20')));}var _0x4a04b3=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x58')],{'uniqueid':_0x58561c[_0x4e71('0x5b')]});if(_0x4a04b3){return BPromise[_0x4e71('0x6d')]()[_0x4e71('0x16')](function(){if(_0x4a04b3[_0x4e71('0x5c')]){return ami['Action']({'action':_0x4e71('0x6e'),'channel':_0x4a04b3['channel'],'mixmonitorid':_0x58561c[_0x4e71('0x67')]})['catch'](function(_0x436022){});}})['then'](function(){if(_0x4a04b3[_0x4e71('0x6f')]){return ami[_0x4e71('0x15')]({'action':_0x4e71('0x6e'),'channel':_0x4a04b3[_0x4e71('0x6f')],'mixmonitorid':_0x58561c[_0x4e71('0x67')]})['catch'](function(_0x18c394){});}})[_0x4e71('0x16')](function(_0x274c38){var _0x276c78=_[_0x4e71('0x54')](_0x4a04b3[_0x4e71('0x62')],{'mixmonitorid':_0x58561c['mixmonitorid']});if(_0x276c78){_0x276c78['status']='stop';}})[_0x4e71('0x16')](function(){var _0x2cd3fd=util['format']('%s.%s',_0x58561c['filename']||_0x58561c[_0x4e71('0x5b')],_0x58561c[_0x4e71('0x7')]||'wav');var _0x1f7623=_[_0x4e71('0x54')](_0x4a04b3[_0x4e71('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x2cd3fd['toLowerCase']()});if(_0x1f7623){_0x1f7623[_0x4e71('0x70')]=_0x4e71('0x71');}})[_0x4e71('0x16')](function(){_0x18cd5b({'code':0xc8,'message':[_0x58561c['uniqueid'],'StopMixMonitor\x20Success'][_0x4e71('0x11')]('\x20')});})[_0x4e71('0x6a')](function(_0x4a066c){_0x3d09a9(_0x419417['error'](0x1f5,[_0x58561c[_0x4e71('0x5b')],_0x4a066c[_0x4e71('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x3d09a9(_0x419417['error'](0x1f5,_0x4e71('0x6b')));}});},'VoiceQueuesChannels':function(_0x38d593){return new Promise(function(_0x53e962,_0xeaf4c8){var _0x5aedd3=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x72')]);_0x53e962({'count':_0x5aedd3[_0x4e71('0x53')],'rows':_0x5aedd3});});},'VoiceQueuesChannel':function(_0x12ead0){var _0x22b4d4=this;return new Promise(function(_0x3b9f60,_0x300b9a){var _0x5337d8=schema(properties[_0x4e71('0x73')])[_0x4e71('0x2')](_0x12ead0);if(_0x5337d8['length']>0x0){return _0x300b9a(_0x22b4d4[_0x4e71('0x18')](0x1f4,_[_0x4e71('0x5a')](_0x5337d8,_0x4e71('0x17'))[_0x4e71('0x11')](',\x20')));}var _0x31501c=_[_0x4e71('0x54')](_0x19e056[_0x4e71('0x72')],{'uniqueid':_0x12ead0[_0x4e71('0x5b')]});if(_0x31501c){_0x3b9f60(_0x31501c);}else{return _0x300b9a(_0x22b4d4[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x183cf2){var _0x50ec2e=this;return new Promise(function(_0x1a3554,_0x3a5531){if(ami['isConnected']()==![]){return _0x3a5531(_0x50ec2e[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],_0x4e71('0x1a')][_0x4e71('0x11')]('\x20')));}var _0x3dc233=schema(properties[_0x4e71('0x74')])['validate'](_0x183cf2);if(_0x3dc233[_0x4e71('0x53')]>0x0){return _0x3a5531(_0x50ec2e['error'](0x1f4,_[_0x4e71('0x5a')](_0x3dc233,'message')[_0x4e71('0x11')](',\x20')));}var _0x1c96b9=_[_0x4e71('0x54')](_0x19e056['queueChannels'],{'uniqueid':_0x183cf2['uniqueid']});if(_0x1c96b9&&_0x1c96b9[_0x4e71('0x5c')]){return ami[_0x4e71('0x15')]({'action':_0x4e71('0x75'),'channel':_0x1c96b9[_0x4e71('0x5c')]})[_0x4e71('0x16')](function(_0xeb27c5){_0x1a3554({'code':0xc8,'message':[_0x183cf2['uniqueid'],_0xeb27c5[_0x4e71('0x17')][_0x4e71('0x64')]()]['join']('\x20')});})['catch'](function(_0x4e155d){_0x3a5531(_0x50ec2e[_0x4e71('0x18')](0x1f5,[_0x183cf2[_0x4e71('0x5b')],_0x4e155d['message'][_0x4e71('0x64')]()][_0x4e71('0x11')]('\x20')));});}else{return _0x3a5531(_0x50ec2e[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x31e64a){var _0x5b965d=this;return new Promise(function(_0x4600c4,_0x4b1bba){if(ami[_0x4e71('0x6c')]()==![]){return _0x4b1bba(_0x5b965d[_0x4e71('0x18')](0x1f4,[config[_0x4e71('0x10')]['ip'],config[_0x4e71('0x10')][_0x4e71('0x19')],'ami\x20disconnected']['join']('\x20')));}var _0x3c516e=schema(properties[_0x4e71('0x76')])[_0x4e71('0x2')](_0x31e64a);if(_0x3c516e[_0x4e71('0x53')]>0x0){return _0x4b1bba(_0x5b965d['error'](0x1f4,_[_0x4e71('0x5a')](_0x3c516e,_0x4e71('0x17'))['join'](',\x20')));}var _0x1b644f=_[_0x4e71('0x54')](_0x19e056['queueChannels'],{'uniqueid':_0x31e64a[_0x4e71('0x5b')]});if(_0x1b644f&&_0x1b644f[_0x4e71('0x5c')]){return ami[_0x4e71('0x15')]({'action':_0x4e71('0x77'),'channel':_0x1b644f['channel'],'exten':_0x31e64a[_0x4e71('0x78')],'context':_0x31e64a[_0x4e71('0x79')]||_0x1b644f[_0x4e71('0x79')],'priority':0x1})[_0x4e71('0x16')](function(_0x301c2a){_0x4600c4({'code':0xc8,'message':[_0x31e64a[_0x4e71('0x5b')],_0x301c2a[_0x4e71('0x17')][_0x4e71('0x64')]()]['join']('\x20')});})[_0x4e71('0x6a')](function(_0x3af198){_0x4b1bba(_0x5b965d['error'](0x1f5,[_0x31e64a['uniqueid'],_0x3af198[_0x4e71('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x4b1bba(_0x5b965d[_0x4e71('0x18')](0x1f5,_0x4e71('0x6b')));}});},'Agents':function(_0x11aa61){return new Promise(function(_0x1fc7cb,_0x79266e){var _0x125d9e=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0xd')]);_0x1fc7cb({'count':_0x125d9e[_0x4e71('0x53')],'rows':_0x125d9e});});},'Telephones':function(_0x4b4aaa){return new Promise(function(_0x3d5ff1,_0x1b1d77){var _0xfc3c7d=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7a')]);_0x3d5ff1({'count':_0xfc3c7d['length'],'rows':_0xfc3c7d});});},'Trunks':function(_0xd25de3){return new Promise(function(_0x2a3439,_0x541348){var _0x29a739=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7b')]);_0x2a3439({'count':_0x29a739[_0x4e71('0x53')],'rows':_0x29a739});});},'OutboundChannels':function(_0x49f352){return new Promise(function(_0x1481d4,_0xfd6926){var _0x15e526=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7c')]);_0x1481d4({'count':_0x15e526['length'],'rows':_0x15e526});});},'Outbound':function(_0x56d7f0){return new Promise(function(_0x338166,_0xc836c8){_0x338166(_0x19e056[_0x4e71('0x29')]);});},'Campaigns':function(_0x570636){return new Promise(function(_0x5efb18,_0x491253){var _0x2a1b26=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7d')]);_0x5efb18({'count':_0x2a1b26[_0x4e71('0x53')],'rows':_0x2a1b26});});},'VoiceQueuesPreview':function(_0x1d883b){var _0x594a9a=this;return new Promise(function(_0x4dcde4,_0x2705a4){_0x28ce78[_0x4e71('0x7e')](_0x1d883b['id'])[_0x4e71('0x16')](function(_0x428bbd){_0x4dcde4({'code':0xc8,'message':_0x428bbd[_0x4e71('0x17')]});})[_0x4e71('0x6a')](function(_0x323576){_0x2705a4(_0x594a9a['error'](0x1f4,_0x323576[_0x4e71('0x17')]));});});},'EventManager':function(_0x1d93d6){var _0x461144=this;return new Promise(function(_0x2ee25b,_0x55b9cd){if(!_0x1d93d6['event']){return _0x55b9cd(_0x461144['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit']('custom:'+_0x1d93d6['event'],_0x1d93d6[_0x4e71('0x17')]);_0x2ee25b({'code':0xc8,'message':_0x1d93d6});});},'FaxAccounts':function(_0x22c77a){return new Promise(function(_0x47ad27,_0xf43f7d){var _0x4e3658=_[_0x4e71('0x57')](_0x19e056[_0x4e71('0x7f')]);_0x47ad27({'count':_0x4e3658[_0x4e71('0x53')],'rows':_0x4e3658});});},'SendFax':function(_0x1e3f4f){var _0x14ea6f=this;return new Promise(function(_0x58a79e,_0x96a336){_0x204a19[_0x4e71('0x80')](_0x1e3f4f)['then'](function(_0x252246){_0x58a79e({'code':0xc8,'message':_0x252246[_0x4e71('0x17')]});})[_0x4e71('0x6a')](function(_0x5a05b2){_0x96a336(_0x14ea6f[_0x4e71('0x18')](0x1f4,_0x5a05b2[_0x4e71('0x17')]));});});},'CheckAfterSend':function(_0xf281ac){var _0x1598b9=this;return new Promise(function(_0x128a8d,_0x2ba20f){_0x204a19[_0x4e71('0x81')](_0xf281ac)[_0x4e71('0x16')](function(_0x248f3f){_0x128a8d({'code':0xc8,'message':_0x248f3f['message']});})[_0x4e71('0x6a')](function(_0x14eb37){_0x2ba20f(_0x1598b9['error'](0x1f4,_0x14eb37['message']));});});}};var _0x4fb0df=jayson[_0x4e71('0x82')](_0x55b1cc)['http']();_0x4fb0df['on']('error',function(_0x226ba6){return _0x1f1d35(_0x226ba6);});_0x4fb0df[_0x4e71('0x6')](0x232a,'127.0.0.1',function(){console['log'](_0x4e71('0x83'),0x232a);return _0xfe1559('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x4c60=['erlangBusyFactor','startPredictive','Trunk','name','active','callerid','Interval','length','find','undefined','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','values','telephones','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','faxAccounts','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','format','%s/%s','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','catch','command','Command','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x4c60,0xc1));var _0x04c6=function(_0x391e93,_0x2f0c6d){_0x391e93=_0x391e93-0x0;var _0x454818=_0x4c60[_0x391e93];return _0x454818;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var jayson=require(_0x04c6('0x2'));var schema=require(_0x04c6('0x3'));var BPromise=require('bluebird');var moment=require(_0x04c6('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require('../ami');exports['listen']=function(_0x3a9493,_0xc6e772,_0x2054da){return new BPromise(function(_0x12bd5d,_0x2b9041){var _0x39be2d={'QueuePause':function(_0x8f9b13){return new Promise(function(_0x530a48,_0x2a4b51){var _0x43a27e=util[_0x04c6('0x5')](_0x04c6('0x6'),'SIP',_0x8f9b13['name']);if(_0x3a9493['timers']&&_0x3a9493[_0x04c6('0x7')][_0x43a27e]&&_0x3a9493['timers'][_0x43a27e][_0x04c6('0x8')]){_0x3a9493[_0x04c6('0x7')][_0x43a27e]['updateAcw']();}if(_0x3a9493[_0x04c6('0x9')][_0x43a27e]){_0x3a9493[_0x04c6('0x9')][_0x43a27e][_0x04c6('0xa')]({'statePause':_0x8f9b13[_0x04c6('0xb')]?!![]:![]});}_0x530a48({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x257a0a){var _0x453342=this;return new Promise(function(_0x4384ad,_0x56422a){if(ami[_0x04c6('0xc')]()==![]){return _0x56422a(_0x453342[_0x04c6('0xd')](0x1f4,[config[_0x04c6('0xe')]['ip'],config[_0x04c6('0xe')][_0x04c6('0xf')],_0x04c6('0x10')][_0x04c6('0x11')]('\x20')));}_0x257a0a=_[_0x04c6('0x12')](_0x257a0a,_['keys'](properties[_0x04c6('0x13')]));_0x257a0a[_0x04c6('0x14')]=_0x04c6('0x15');return ami[_0x04c6('0x16')](_0x257a0a)[_0x04c6('0x17')](function(_0xfb4db5){_0x4384ad({'code':0xc8,'message':_0xfb4db5[_0x04c6('0x18')]});})[_0x04c6('0x19')](function(_0x47f400){_0x56422a(_0x453342[_0x04c6('0xd')](0x1f5,_0x47f400[_0x04c6('0x18')]));});});},'Command':function(_0xa70fd2){var _0x558b43=this;return new Promise(function(_0x4cef4e,_0x53ac86){if(ami[_0x04c6('0xc')]()==![]){return _0x53ac86(_0x558b43[_0x04c6('0xd')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x04c6('0xf')],_0x04c6('0x10')][_0x04c6('0x11')]('\x20')));}_0xa70fd2=_['pick'](_0xa70fd2,_0x04c6('0x1a'));_0xa70fd2[_0x04c6('0x14')]=_0x04c6('0x1b');return ami['Action'](_0xa70fd2)[_0x04c6('0x17')](function(_0x41e29f){_0x4cef4e({'code':0xc8,'message':_0x41e29f['content']});})['catch'](function(_0x4c8d72){_0x53ac86(_0x558b43[_0x04c6('0xd')](0x1f5,_0x4c8d72[_0x04c6('0x18')]));});});},'VoiceQueues':function(_0xd5828d){return new Promise(function(_0x115e35,_0x3e1328){var _0x52e5f5=[];for(var _0x562952 in _0x3a9493[_0x04c6('0x1c')]){if(_0x3a9493[_0x04c6('0x1c')][_0x04c6('0x1d')](_0x562952)){var _0x3233d7=_0x3a9493[_0x04c6('0x1c')][_0x562952];var _0x1f5aaf={'id':_0x3233d7['id'],'name':_0x3233d7['name'],'strategy':_0x3233d7[_0x04c6('0x1e')],'answered':_0x3233d7[_0x04c6('0x1f')],'available':_0x3233d7['available'],'loggedIn':_0x3233d7[_0x04c6('0x20')],'pTalking':_0x3233d7[_0x04c6('0x21')],'sumBillable':_0x3233d7['sumBillable'],'sumDuration':_0x3233d7['sumDuration'],'sumHoldTime':_0x3233d7[_0x04c6('0x22')]||0x0,'talking':_0x3233d7[_0x04c6('0x23')],'total':_0x3233d7[_0x04c6('0x24')],'type':_0x3233d7[_0x04c6('0x25')],'unmanaged':_0x3233d7[_0x04c6('0x26')],'abandoned':_0x3233d7[_0x04c6('0x27')],'waiting':_0x3233d7['waiting'],'loggedInDb':_0x3233d7['loggedInDb']};if(_0x3233d7['type']===_0x04c6('0x28')){_0x1f5aaf['dialActive']=_0x3233d7[_0x04c6('0x29')];_0x1f5aaf[_0x04c6('0x2a')]=_0x3233d7['dialMethod'];_0x1f5aaf[_0x04c6('0x2b')]=_0x3233d7[_0x04c6('0x2b')];_0x1f5aaf[_0x04c6('0x2c')]=_0x3233d7[_0x04c6('0x2c')];_0x1f5aaf['dialOriginateTimeout']=_0x3233d7[_0x04c6('0x2d')];_0x1f5aaf[_0x04c6('0x2e')]=_0x3233d7[_0x04c6('0x2e')];_0x1f5aaf[_0x04c6('0x2f')]=_0x3233d7[_0x04c6('0x2f')];_0x1f5aaf[_0x04c6('0x30')]=_0x3233d7[_0x04c6('0x30')];_0x1f5aaf[_0x04c6('0x31')]=_0x3233d7[_0x04c6('0x31')];_0x1f5aaf[_0x04c6('0x32')]=_0x3233d7[_0x04c6('0x32')];_0x1f5aaf[_0x04c6('0x33')]=_0x3233d7[_0x04c6('0x33')];_0x1f5aaf[_0x04c6('0x34')]=_0x3233d7[_0x04c6('0x34')];_0x1f5aaf['outboundDropCallsDayACS']=_0x3233d7[_0x04c6('0x35')];_0x1f5aaf[_0x04c6('0x36')]=_0x3233d7[_0x04c6('0x36')];_0x1f5aaf[_0x04c6('0x37')]=_0x3233d7['outboundDropCallsDayTimeout'];_0x1f5aaf[_0x04c6('0x38')]=_0x3233d7[_0x04c6('0x38')];_0x1f5aaf['outboundNoSuchCallsDay']=_0x3233d7['outboundNoSuchCallsDay'];_0x1f5aaf['outboundOriginateFailureCallsDay']=_0x3233d7[_0x04c6('0x39')];_0x1f5aaf[_0x04c6('0x3a')]=_0x3233d7['outboundReCallsDay'];_0x1f5aaf[_0x04c6('0x3b')]=_0x3233d7['outboundRejectCallsDay'];_0x1f5aaf[_0x04c6('0x3c')]=_0x3233d7[_0x04c6('0x3c')];_0x1f5aaf[_0x04c6('0x3d')]=_0x3233d7[_0x04c6('0x3d')];_0x1f5aaf['predictiveIntervalAvgHoldtime']=_0x3233d7['predictiveIntervalAvgHoldtime'];_0x1f5aaf[_0x04c6('0x3e')]=_0x3233d7[_0x04c6('0x3e')];_0x1f5aaf['predictiveIntervalDroppedCallsCallersExit']=_0x3233d7[_0x04c6('0x3f')];_0x1f5aaf['predictiveIntervalDroppedCallsTimeout']=_0x3233d7['predictiveIntervalDroppedCallsTimeout'];_0x1f5aaf[_0x04c6('0x40')]=_0x3233d7['predictiveIntervalErlangCalls'];_0x1f5aaf[_0x04c6('0x41')]=_0x3233d7[_0x04c6('0x41')];_0x1f5aaf['predictiveIntervalHitRate']=_0x3233d7[_0x04c6('0x42')];_0x1f5aaf['predictiveIntervalMultiplicativeFactor']=_0x3233d7[_0x04c6('0x43')];_0x1f5aaf[_0x04c6('0x44')]=_0x3233d7[_0x04c6('0x44')];_0x1f5aaf[_0x04c6('0x45')]=_0x3233d7[_0x04c6('0x45')];_0x1f5aaf['predictiveIntervalTotalCalls']=_0x3233d7[_0x04c6('0x46')];_0x1f5aaf['message']=_0x3233d7[_0x04c6('0x18')];_0x1f5aaf['originated']=_0x3233d7[_0x04c6('0x47')];_0x1f5aaf[_0x04c6('0x48')]=_0x3233d7[_0x04c6('0x48')];_0x1f5aaf[_0x04c6('0x49')]=_0x3233d7[_0x04c6('0x49')];_0x1f5aaf[_0x04c6('0x4a')]=_0x3233d7[_0x04c6('0x4a')];_0x1f5aaf['erlangBusyFactor']=_0x3233d7[_0x04c6('0x4b')];_0x1f5aaf['startPredictive']=_0x3233d7[_0x04c6('0x4c')];_0x1f5aaf['startProgressive']=_0x3233d7['startProgressive'];}if(_0x3233d7[_0x04c6('0x4d')]){_0x1f5aaf['Trunk']={'id':_0x3233d7[_0x04c6('0x4d')]['id'],'name':_0x3233d7[_0x04c6('0x4d')][_0x04c6('0x4e')],'active':_0x3233d7['Trunk'][_0x04c6('0x4f')],'callerid':_0x3233d7[_0x04c6('0x4d')][_0x04c6('0x50')]};}if(_0x3233d7[_0x04c6('0x51')]){_0x1f5aaf[_0x04c6('0x51')]={'id':_0x3233d7[_0x04c6('0x51')]['id'],'name':_0x3233d7[_0x04c6('0x51')]['name']};}_0x52e5f5['push'](_0x1f5aaf);}}_0x115e35({'count':_0x52e5f5[_0x04c6('0x52')],'rows':_0x52e5f5});});},'UpdateVoiceQueue':function(_0x18aa99){return new Promise(function(_0x417cb7,_0x5d6726){var _0x46164a=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x1c')],{'id':parseInt(_0x18aa99['id'])});var _0x549911=_['omit'](_0x18aa99,['id']);if(_0x46164a){for(var _0x56c7e6 in _0x549911){if(typeof _0x549911[_0x56c7e6]!==_0x04c6('0x54')&&typeof _0x46164a[_0x56c7e6]!==_0x04c6('0x54')){_0x46164a[_0x56c7e6]=_0x549911[_0x56c7e6];}}_0x417cb7(_0x46164a);}else{_0x5d6726();}});},'VoiceChannels':function(_0x5f578b){return new Promise(function(_0x261512,_0x3de8a9){var _0x2bd045=_['values'](_0x3a9493[_0x04c6('0x55')]);_0x261512({'count':_0x2bd045[_0x04c6('0x52')],'rows':_0x2bd045});});},'VoiceChannelMixMonitor':function(_0x5e68e0){var _0x25a6fc=this;return new Promise(function(_0x203943,_0x2472ed){if(ami[_0x04c6('0xc')]()==![]){return _0x2472ed(_0x25a6fc['error'](0x1f4,[config[_0x04c6('0xe')]['ip'],config[_0x04c6('0xe')][_0x04c6('0xf')],_0x04c6('0x10')]['join']('\x20')));}var _0x192437=schema(properties[_0x04c6('0x56')])[_0x04c6('0x3')](_0x5e68e0);if(_0x192437[_0x04c6('0x52')]>0x0){return _0x2472ed(_0x25a6fc['error'](0x1f4,_[_0x04c6('0x57')](_0x192437,_0x04c6('0x18'))[_0x04c6('0x11')](',\x20')));}var _0x489361=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x55')],{'uniqueid':_0x5e68e0[_0x04c6('0x58')]});if(_0x489361&&_0x489361[_0x04c6('0x59')]){var _0x6ae67=util[_0x04c6('0x5')](_0x04c6('0x5a'),_0x5e68e0[_0x04c6('0x5b')]||_0x5e68e0[_0x04c6('0x58')],_0x5e68e0[_0x04c6('0x5')]||_0x04c6('0x5c'));return ami[_0x04c6('0x16')]({'action':_0x04c6('0x5d'),'channel':_0x489361['channel'],'file':_0x6ae67,'options':_0x04c6('0x5e')})[_0x04c6('0x17')](function(_0x5ce521){var _0xa0284e=_[_0x04c6('0x53')](_0x489361['monitors'],{'filename':_0x04c6('0x5f')+_0x6ae67[_0x04c6('0x60')]()});if(_[_0x04c6('0x61')](_0xa0284e)){_0x489361[_0x04c6('0x62')][_0x04c6('0x63')]({'filename':_0x04c6('0x5f')+_0x6ae67[_0x04c6('0x60')](),'createdAt':moment()[_0x04c6('0x5')](_0x04c6('0x64')),'mixmonitorid':_0x5ce521[_0x04c6('0x65')],'status':'rec'});}else{_0xa0284e['mixmonitorid']=_0x5ce521['mixmonitorid'];_0xa0284e['status']=_0x04c6('0x66');}_0x203943({'code':0xc8,'message':[_0x5e68e0['uniqueid'],_0x04c6('0x67'),_0x5ce521['mixmonitorid']][_0x04c6('0x11')]('\x20'),'mixmonitorid':_0x5ce521[_0x04c6('0x65')]});})['catch'](function(_0x4dd6bb){_0x2472ed(_0x25a6fc[_0x04c6('0xd')](0x1f5,[_0x5e68e0[_0x04c6('0x58')],_0x4dd6bb[_0x04c6('0x18')][_0x04c6('0x60')]()]['join']('\x20')));});}else{return _0x2472ed(_0x25a6fc[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x216cb0){var _0x18b51d=this;return new Promise(function(_0x24c5be,_0x29c72f){if(ami[_0x04c6('0xc')]()==![]){return _0x29c72f(_0x18b51d['error'](0x1f4,[config[_0x04c6('0xe')]['ip'],config['asterisk'][_0x04c6('0xf')],_0x04c6('0x10')]['join']('\x20')));}var _0x3477b7=schema(properties[_0x04c6('0x56')])[_0x04c6('0x3')](_0x216cb0);if(_0x3477b7[_0x04c6('0x52')]>0x0){return _0x29c72f(_0x18b51d[_0x04c6('0xd')](0x1f4,_[_0x04c6('0x57')](_0x3477b7,_0x04c6('0x18'))[_0x04c6('0x11')](',\x20')));}var _0x5c51dc=_[_0x04c6('0x53')](_0x3a9493['channels'],{'uniqueid':_0x216cb0[_0x04c6('0x58')]});if(_0x5c51dc){return BPromise[_0x04c6('0x69')]()['then'](function(){if(_0x5c51dc['channel']){return ami[_0x04c6('0x16')]({'action':'StopMixMonitor','channel':_0x5c51dc[_0x04c6('0x59')],'mixmonitorid':_0x216cb0[_0x04c6('0x65')]})['catch'](function(_0x306ad9){});}})[_0x04c6('0x17')](function(){if(_0x5c51dc[_0x04c6('0x6a')]){return ami[_0x04c6('0x16')]({'action':_0x04c6('0x6b'),'channel':_0x5c51dc[_0x04c6('0x6a')],'mixmonitorid':_0x216cb0[_0x04c6('0x65')]})[_0x04c6('0x19')](function(_0x243bc4){});}})[_0x04c6('0x17')](function(_0x2c9c36){var _0x52413f=_[_0x04c6('0x53')](_0x5c51dc[_0x04c6('0x62')],{'mixmonitorid':_0x216cb0[_0x04c6('0x65')]});if(_0x52413f){_0x52413f[_0x04c6('0x6c')]='stop';}})[_0x04c6('0x17')](function(){var _0x356a9d=util[_0x04c6('0x5')]('%s.%s',_0x216cb0['filename']||_0x216cb0[_0x04c6('0x58')],_0x216cb0[_0x04c6('0x5')]||_0x04c6('0x5c'));var _0x396f79=_[_0x04c6('0x53')](_0x5c51dc[_0x04c6('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x356a9d[_0x04c6('0x60')]()});if(_0x396f79){_0x396f79[_0x04c6('0x6c')]=_0x04c6('0x6d');}})['then'](function(){_0x24c5be({'code':0xc8,'message':[_0x216cb0['uniqueid'],_0x04c6('0x6e')][_0x04c6('0x11')]('\x20')});})[_0x04c6('0x19')](function(_0xc20f3c){_0x29c72f(_0x18b51d['error'](0x1f5,[_0x216cb0[_0x04c6('0x58')],_0xc20f3c['message']['toLowerCase']()][_0x04c6('0x11')]('\x20')));});}else{return _0x29c72f(_0x18b51d[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'VoiceQueuesChannels':function(_0x1904d4){return new Promise(function(_0x43260e,_0x281c2b){var _0x369ce6=_['values'](_0x3a9493[_0x04c6('0x6f')]);_0x43260e({'count':_0x369ce6[_0x04c6('0x52')],'rows':_0x369ce6});});},'VoiceQueuesChannel':function(_0x1f5b9a){var _0x329c82=this;return new Promise(function(_0x1c2e79,_0x4c9d95){var _0x5ade3d=schema(properties[_0x04c6('0x70')])[_0x04c6('0x3')](_0x1f5b9a);if(_0x5ade3d[_0x04c6('0x52')]>0x0){return _0x4c9d95(_0x329c82['error'](0x1f4,_[_0x04c6('0x57')](_0x5ade3d,_0x04c6('0x18'))['join'](',\x20')));}var _0x12d92e=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x6f')],{'uniqueid':_0x1f5b9a[_0x04c6('0x58')]});if(_0x12d92e){_0x1c2e79(_0x12d92e);}else{return _0x4c9d95(_0x329c82[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x3a673b){var _0x1a2365=this;return new Promise(function(_0x22ae65,_0x3552cd){if(ami[_0x04c6('0xc')]()==![]){return _0x3552cd(_0x1a2365[_0x04c6('0xd')](0x1f4,[config[_0x04c6('0xe')]['ip'],config['asterisk'][_0x04c6('0xf')],_0x04c6('0x10')]['join']('\x20')));}var _0xf1e91d=schema(properties[_0x04c6('0x71')])[_0x04c6('0x3')](_0x3a673b);if(_0xf1e91d[_0x04c6('0x52')]>0x0){return _0x3552cd(_0x1a2365[_0x04c6('0xd')](0x1f4,_['map'](_0xf1e91d,_0x04c6('0x18'))['join'](',\x20')));}var _0x299dd3=_['find'](_0x3a9493[_0x04c6('0x6f')],{'uniqueid':_0x3a673b[_0x04c6('0x58')]});if(_0x299dd3&&_0x299dd3[_0x04c6('0x59')]){return ami[_0x04c6('0x16')]({'action':_0x04c6('0x72'),'channel':_0x299dd3[_0x04c6('0x59')]})[_0x04c6('0x17')](function(_0x242bff){_0x22ae65({'code':0xc8,'message':[_0x3a673b[_0x04c6('0x58')],_0x242bff['message'][_0x04c6('0x60')]()][_0x04c6('0x11')]('\x20')});})['catch'](function(_0x9825cf){_0x3552cd(_0x1a2365['error'](0x1f5,[_0x3a673b[_0x04c6('0x58')],_0x9825cf[_0x04c6('0x18')]['toLowerCase']()][_0x04c6('0x11')]('\x20')));});}else{return _0x3552cd(_0x1a2365[_0x04c6('0xd')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x16f932){var _0x140f93=this;return new Promise(function(_0x4fbb5d,_0x7b9132){if(ami[_0x04c6('0xc')]()==![]){return _0x7b9132(_0x140f93['error'](0x1f4,[config[_0x04c6('0xe')]['ip'],config[_0x04c6('0xe')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x37d3e0=schema(properties[_0x04c6('0x73')])[_0x04c6('0x3')](_0x16f932);if(_0x37d3e0[_0x04c6('0x52')]>0x0){return _0x7b9132(_0x140f93[_0x04c6('0xd')](0x1f4,_['map'](_0x37d3e0,_0x04c6('0x18'))[_0x04c6('0x11')](',\x20')));}var _0x1a5356=_[_0x04c6('0x53')](_0x3a9493[_0x04c6('0x6f')],{'uniqueid':_0x16f932[_0x04c6('0x58')]});if(_0x1a5356&&_0x1a5356[_0x04c6('0x59')]){return ami['Action']({'action':_0x04c6('0x74'),'channel':_0x1a5356['channel'],'exten':_0x16f932[_0x04c6('0x75')],'context':_0x16f932['context']||_0x1a5356['context'],'priority':0x1})[_0x04c6('0x17')](function(_0x58f619){_0x4fbb5d({'code':0xc8,'message':[_0x16f932[_0x04c6('0x58')],_0x58f619[_0x04c6('0x18')][_0x04c6('0x60')]()][_0x04c6('0x11')]('\x20')});})[_0x04c6('0x19')](function(_0x48fbdd){_0x7b9132(_0x140f93['error'](0x1f5,[_0x16f932[_0x04c6('0x58')],_0x48fbdd[_0x04c6('0x18')][_0x04c6('0x60')]()][_0x04c6('0x11')]('\x20')));});}else{return _0x7b9132(_0x140f93[_0x04c6('0xd')](0x1f5,_0x04c6('0x68')));}});},'Agents':function(_0x541f14){return new Promise(function(_0x1a9a95,_0x4c3f9e){var _0x5e403d=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x9')]);_0x1a9a95({'count':_0x5e403d[_0x04c6('0x52')],'rows':_0x5e403d});});},'Telephones':function(_0x787dab){return new Promise(function(_0x449286,_0x42459d){var _0x2e65f0=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x77')]);_0x449286({'count':_0x2e65f0[_0x04c6('0x52')],'rows':_0x2e65f0});});},'Trunks':function(_0x21dc7c){return new Promise(function(_0x5763c1,_0xc6e3a6){var _0x5608ce=_['values'](_0x3a9493[_0x04c6('0x78')]);_0x5763c1({'count':_0x5608ce[_0x04c6('0x52')],'rows':_0x5608ce});});},'OutboundChannels':function(_0x3c9c5a){return new Promise(function(_0x294700,_0xcb0dc2){var _0x215eb3=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x79')]);_0x294700({'count':_0x215eb3[_0x04c6('0x52')],'rows':_0x215eb3});});},'Outbound':function(_0x431732){return new Promise(function(_0xcd4078,_0x5c82f1){_0xcd4078(_0x3a9493['outbound']);});},'Campaigns':function(_0x2c15d1){return new Promise(function(_0x1149f5,_0x52dfe5){var _0xb0b3aa=_[_0x04c6('0x76')](_0x3a9493['campaigns']);_0x1149f5({'count':_0xb0b3aa[_0x04c6('0x52')],'rows':_0xb0b3aa});});},'VoiceQueuesPreview':function(_0xdd49da){var _0x390a49=this;return new Promise(function(_0x102dc7,_0x3a3fb2){_0xc6e772[_0x04c6('0x7a')](_0xdd49da['id'])[_0x04c6('0x17')](function(_0x5efcc8){_0x102dc7({'code':0xc8,'message':_0x5efcc8['message']});})[_0x04c6('0x19')](function(_0x592d6a){_0x3a3fb2(_0x390a49[_0x04c6('0xd')](0x1f4,_0x592d6a[_0x04c6('0x18')]));});});},'EventManager':function(_0x23b79a){var _0x15f484=this;return new Promise(function(_0x5d5795,_0x2864a0){if(!_0x23b79a['event']){return _0x2864a0(_0x15f484[_0x04c6('0xd')](0x1f4,_0x04c6('0x7b')));}ami[_0x04c6('0x7c')]('custom:'+_0x23b79a['event'],_0x23b79a['message']);_0x5d5795({'code':0xc8,'message':_0x23b79a});});},'FaxAccounts':function(_0xcb5660){return new Promise(function(_0x181268,_0x47f933){var _0xd17fa3=_[_0x04c6('0x76')](_0x3a9493[_0x04c6('0x7d')]);_0x181268({'count':_0xd17fa3['length'],'rows':_0xd17fa3});});},'SendFax':function(_0x343c1f){var _0x485457=this;return new Promise(function(_0x1c0c74,_0x3a1b76){_0x2054da[_0x04c6('0x7e')](_0x343c1f)['then'](function(_0x534d1f){_0x1c0c74({'code':0xc8,'message':_0x534d1f[_0x04c6('0x18')]});})[_0x04c6('0x19')](function(_0x2e92d5){_0x3a1b76(_0x485457[_0x04c6('0xd')](0x1f4,_0x2e92d5['message']));});});},'CheckAfterSend':function(_0x58c790){var _0x3e12a4=this;return new Promise(function(_0x8637e0,_0x91f883){_0x2054da['checkAfterSend'](_0x58c790)[_0x04c6('0x17')](function(_0xe08ff4){_0x8637e0({'code':0xc8,'message':_0xe08ff4[_0x04c6('0x18')]});})[_0x04c6('0x19')](function(_0x49f1e0){_0x91f883(_0x3e12a4[_0x04c6('0xd')](0x1f4,_0x49f1e0[_0x04c6('0x18')]));});});}};var _0x369aba=jayson[_0x04c6('0x7f')](_0x39be2d)[_0x04c6('0x80')]();_0x369aba['on']('error',function(_0x14ce9e){return _0x2b9041(_0x14ce9e);});_0x369aba[_0x04c6('0x81')](0x232a,_0x04c6('0x82'),function(){console[_0x04c6('0x83')](_0x04c6('0x84'),0x232a);return _0x12bd5d(_0x04c6('0x85')+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 1d0d76b..5a5efb0 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 _0x84ab=['resolve','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','createContact','push','format','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','updatedAt','union'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x84ab,0x12f));var _0xb84a=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0x84ab[_0x56b138];return _0x3df878;};'use strict';var _=require(_0xb84a('0x0'));var BPromise=require(_0xb84a('0x1'));var Redis=require(_0xb84a('0x2'));var util=require(_0xb84a('0x3'));var config=require(_0xb84a('0x4'));var logger=require('../../../../config/logger')(_0xb84a('0x5'));var cmContactRpc=require(_0xb84a('0x6'));config['redis']=_[_0xb84a('0x7')](config[_0xb84a('0x8')],{'host':_0xb84a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4dc496,_0xd445b5,_0x4fac4d,_0x3e9086,_0x8d9dbe){logger['info'](_0xb84a('0xa'),_0x4dc496,_0xd445b5['id'],_0x4fac4d,_0x3e9086,JSON['stringify'](_0x8d9dbe));io['to'](_0x4fac4d)[_0xb84a('0xb')](_0x3e9086,_0x8d9dbe);}exports[_0xb84a('0xc')]=function(_0x42daf5,_0x5d3b29,_0x5a34f7,_0x591de9){var _0x1e0180,_0x17379b;var _0x350e99={};var _0x35c6c5=Number(_0x5a34f7[_0xb84a('0xd')]);var _0x4d3758=_0x5a34f7[_0xb84a('0xe')]?Boolean(Number(_0x5a34f7[_0xb84a('0xe')])):![];var _0x39a0df;var _0x3c161c=![];if(!_[_0xb84a('0xf')](_0x5a34f7[_0xb84a('0x10')])){if(_0x5a34f7[_0xb84a('0x10')]=='1')_0x3c161c=!![];}if(!_0x3c161c){if(_0x591de9[_0xb84a('0x11')]){_0x350e99['id']=_0x591de9[_0xb84a('0x11')];}}if(!_0x350e99['id']){_0x350e99[_0xb84a('0x12')]=_0x35c6c5;_0x39a0df=_0x5a34f7[_0xb84a('0x13')]&&_0x5a34f7[_0xb84a('0x13')]!=='0'?_0x5a34f7['data3'][_0xb84a('0x14')](','):[_0xb84a('0x15')];_0x350e99[_0xb84a('0x16')]=_[_0xb84a('0x17')](_0x39a0df,function(_0x1c7378){var _0x1be87a={};_0x1be87a[_0x1c7378]=_0x591de9[_0xb84a('0x18')]?_0x591de9[_0xb84a('0x19')]:_0x591de9[_0xb84a('0x1a')];return _0x1be87a;});}var _0x3f7437=['id',_0xb84a('0x1b'),_0xb84a('0x1c'),_0xb84a('0x15'),_0xb84a('0x1d'),'fax',_0xb84a('0x12'),_0xb84a('0x1e'),'scheduledAt',_0xb84a('0x1f')];var _0x61ef03=_[_0xb84a('0x20')](_0x3f7437,_0x39a0df);BPromise[_0xb84a('0x21')]()['then'](cmContactRpc['getContacts']({'attributes':_0x61ef03,'where':_0x350e99}))[_0xb84a('0x22')](function(_0x19097d){_0x17379b=_0x19097d;if(!_[_0xb84a('0x23')](_0x17379b)){if(_0x17379b[_0xb84a('0x24')]===0x1){_0x1e0180=_0x17379b[0x0];logger[_0xb84a('0x25')](_0xb84a('0x26'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id'],_0x1e0180['id']);}else{logger[_0xb84a('0x25')](_0xb84a('0x28'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id'],_[_0xb84a('0x17')](_0x17379b,'id')[_0xb84a('0x29')](','));}return;}else{logger[_0xb84a('0x25')](_0xb84a('0x2a'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id']);var _0x3258a9={'ListId':_0x35c6c5};var _0x378ce1=_0x5a34f7[_0xb84a('0x2b')]&&_0x5a34f7[_0xb84a('0x2b')]!=='0'?_0x5a34f7[_0xb84a('0x2b')]:_0xb84a('0x15');if(_0x4d3758){logger[_0xb84a('0x25')](_0xb84a('0x2c'),_0x591de9[_0xb84a('0x27')],_0x5d3b29['id']);_0x3258a9[_0x378ce1]=_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])?_0x591de9['calleridnum']:_0x591de9['destcalleridnum'];if(_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])){_0x3258a9['firstName']=_0x591de9[_0xb84a('0x2d')]&&_0x591de9[_0xb84a('0x2d')]!==''?_0x591de9['calleridname']:_0xb84a('0x2e');}else{_0x3258a9[_0xb84a('0x1b')]=_0x591de9['destcalleridname']&&_0x591de9[_0xb84a('0x2f')]!==_0xb84a('0x30')?_0x591de9[_0xb84a('0x2f')]:_0xb84a('0x2e');}return BPromise[_0xb84a('0x21')]()[_0xb84a('0x22')](cmContactRpc[_0xb84a('0x31')](_0x3258a9))[_0xb84a('0x22')](function(_0x54ec50){_0x1e0180=_0x54ec50;_0x17379b[_0xb84a('0x32')](_0x54ec50);if(_0x1e0180){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x591de9[_0xb84a('0x27')],_0x5d3b29['id'],_0x1e0180['id']);}return;});}else{logger[_0xb84a('0x25')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x591de9['uniqueid'],_0x5d3b29['id']);_0x3258a9[_0x378ce1]=_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])?_0x591de9[_0xb84a('0x1a')]:_0x591de9[_0xb84a('0x19')];if(_[_0xb84a('0xf')](_0x591de9[_0xb84a('0x18')])){_0x3258a9[_0xb84a('0x1b')]=_0x591de9[_0xb84a('0x2d')]&&_0x591de9['calleridname']!==_0xb84a('0x30')?_0x591de9[_0xb84a('0x2d')]:_0xb84a('0x2e');}else{_0x3258a9[_0xb84a('0x1b')]=_0x591de9[_0xb84a('0x2f')]&&_0x591de9[_0xb84a('0x2f')]!==_0xb84a('0x30')?_0x591de9['destcalleridname']:_0xb84a('0x2e');}_0x1e0180=_0x3258a9;_0x17379b['push'](_0x3258a9);return;}}})[_0xb84a('0x22')](function(){if(_0x42daf5){emit(_0x591de9[_0xb84a('0x27')],_0x5d3b29,util[_0xb84a('0x33')]('user:%s',_0x42daf5['name']),util[_0xb84a('0x33')](_0xb84a('0x34'),_0x5a34f7[_0xb84a('0x35')][_0xb84a('0x36')]()),{'evt':_[_0xb84a('0x37')](_0x591de9,{'autoCreate':_0x4d3758}),'contact':_0x1e0180===undefined?{}:_0x1e0180,'contacts':_0x17379b['length']===0x0?undefined:_0x17379b});}});}; \ No newline at end of file +var _0x2d17=['ListId','data3','split','$or','destcalleridnum','calleridnum','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','isEmpty','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','then','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','trigger:%s','action','merge','length','lodash','bluebird','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','localhost','redis','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0x785dec,_0x3d3f67){_0x785dec=_0x785dec-0x0;var _0x2b496f=_0x2d17[_0x785dec];return _0x2b496f;};'use strict';var _=require(_0x72d1('0x0'));var BPromise=require(_0x72d1('0x1'));var Redis=require('ioredis');var util=require(_0x72d1('0x2'));var config=require(_0x72d1('0x3'));var logger=require('../../../../config/logger')(_0x72d1('0x4'));var cmContactRpc=require(_0x72d1('0x5'));config['redis']=_[_0x72d1('0x6')](config['redis'],{'host':_0x72d1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x72d1('0x8')]));function emit(_0x239d1f,_0x5b40a9,_0x477264,_0x422f5a,_0x19e248){logger['info'](_0x72d1('0x9'),_0x239d1f,_0x5b40a9['id'],_0x477264,_0x422f5a,JSON[_0x72d1('0xa')](_0x19e248));io['to'](_0x477264)[_0x72d1('0xb')](_0x422f5a,_0x19e248);}exports['exec']=function(_0x1d7520,_0x3a35c6,_0x45eb4a,_0x14a41e){var _0x3cb9c2,_0x3916f2;var _0x2bfe66={};var _0x14ef98=Number(_0x45eb4a[_0x72d1('0xc')]);var _0x2f5a78=_0x45eb4a['data2']?Boolean(Number(_0x45eb4a[_0x72d1('0xd')])):![];var _0x37017c;var _0x4c1038=![];if(!_[_0x72d1('0xe')](_0x45eb4a[_0x72d1('0xf')])){if(_0x45eb4a[_0x72d1('0xf')]=='1')_0x4c1038=!![];}if(!_0x4c1038){if(_0x14a41e[_0x72d1('0x10')]){_0x2bfe66['id']=_0x14a41e[_0x72d1('0x10')];}}if(!_0x2bfe66['id']){_0x2bfe66[_0x72d1('0x11')]=_0x14ef98;_0x37017c=_0x45eb4a[_0x72d1('0x12')]&&_0x45eb4a[_0x72d1('0x12')]!=='0'?_0x45eb4a[_0x72d1('0x12')][_0x72d1('0x13')](','):['phone'];_0x2bfe66[_0x72d1('0x14')]=_['map'](_0x37017c,function(_0x3885b2){var _0x2c9851={};_0x2c9851[_0x3885b2]=_0x14a41e['routeId']?_0x14a41e[_0x72d1('0x15')]:_0x14a41e[_0x72d1('0x16')];return _0x2c9851;});}var _0x1ca18d=['id','firstName','lastName',_0x72d1('0x17'),_0x72d1('0x18'),_0x72d1('0x19'),_0x72d1('0x11'),_0x72d1('0x1a'),_0x72d1('0x1b'),_0x72d1('0x1c')];var _0x5c7982=_[_0x72d1('0x1d')](_0x1ca18d,_0x37017c);BPromise['resolve']()['then'](cmContactRpc['getContacts']({'attributes':_0x5c7982,'where':_0x2bfe66}))['then'](function(_0x445985){_0x3916f2=_0x445985;if(!_[_0x72d1('0x1e')](_0x3916f2)){if(_0x3916f2['length']===0x1){_0x3cb9c2=_0x3916f2[0x0];logger[_0x72d1('0x1f')](_0x72d1('0x20'),_0x14a41e[_0x72d1('0x21')],_0x3a35c6['id'],_0x3cb9c2['id']);}else{logger[_0x72d1('0x1f')](_0x72d1('0x22'),_0x14a41e['uniqueid'],_0x3a35c6['id'],_['map'](_0x3916f2,'id')[_0x72d1('0x23')](','));}return;}else{logger[_0x72d1('0x1f')](_0x72d1('0x24'),_0x14a41e[_0x72d1('0x21')],_0x3a35c6['id']);var _0xdf6a69={'ListId':_0x14ef98};var _0x33d530=_0x45eb4a[_0x72d1('0x25')]&&_0x45eb4a['data4']!=='0'?_0x45eb4a['data4']:_0x72d1('0x17');if(_0x2f5a78){logger['info'](_0x72d1('0x26'),_0x14a41e[_0x72d1('0x21')],_0x3a35c6['id']);_0xdf6a69[_0x33d530]=_[_0x72d1('0xe')](_0x14a41e['routeId'])?_0x14a41e[_0x72d1('0x16')]:_0x14a41e['destcalleridnum'];if(_[_0x72d1('0xe')](_0x14a41e[_0x72d1('0x27')])){_0xdf6a69[_0x72d1('0x28')]=_0x14a41e[_0x72d1('0x29')]&&_0x14a41e['calleridname']!==_0x72d1('0x2a')?_0x14a41e['calleridname']:_0x72d1('0x2b');}else{_0xdf6a69[_0x72d1('0x28')]=_0x14a41e['destcalleridname']&&_0x14a41e[_0x72d1('0x2c')]!==_0x72d1('0x2a')?_0x14a41e[_0x72d1('0x2c')]:_0x72d1('0x2b');}return BPromise[_0x72d1('0x2d')]()['then'](cmContactRpc[_0x72d1('0x2e')](_0xdf6a69))[_0x72d1('0x2f')](function(_0x9efc2f){_0x3cb9c2=_0x9efc2f;_0x3916f2['push'](_0x9efc2f);if(_0x3cb9c2){logger[_0x72d1('0x1f')](_0x72d1('0x30'),_0x14a41e['uniqueid'],_0x3a35c6['id'],_0x3cb9c2['id']);}return;});}else{logger[_0x72d1('0x1f')](_0x72d1('0x31'),_0x14a41e[_0x72d1('0x21')],_0x3a35c6['id']);_0xdf6a69[_0x33d530]=_['isNil'](_0x14a41e[_0x72d1('0x27')])?_0x14a41e['calleridnum']:_0x14a41e[_0x72d1('0x15')];if(_[_0x72d1('0xe')](_0x14a41e[_0x72d1('0x27')])){_0xdf6a69[_0x72d1('0x28')]=_0x14a41e[_0x72d1('0x29')]&&_0x14a41e[_0x72d1('0x29')]!==_0x72d1('0x2a')?_0x14a41e[_0x72d1('0x29')]:_0x72d1('0x2b');}else{_0xdf6a69[_0x72d1('0x28')]=_0x14a41e[_0x72d1('0x2c')]&&_0x14a41e['destcalleridname']!==_0x72d1('0x2a')?_0x14a41e[_0x72d1('0x2c')]:_0x72d1('0x2b');}_0x3cb9c2=_0xdf6a69;_0x3916f2[_0x72d1('0x32')](_0xdf6a69);return;}}})['then'](function(){if(_0x1d7520){emit(_0x14a41e[_0x72d1('0x21')],_0x3a35c6,util[_0x72d1('0x33')](_0x72d1('0x34'),_0x1d7520['name']),util[_0x72d1('0x33')](_0x72d1('0x35'),_0x45eb4a[_0x72d1('0x36')]['toLowerCase']()),{'evt':_[_0x72d1('0x37')](_0x14a41e,{'autoCreate':_0x2f5a78}),'contact':_0x3cb9c2===undefined?{}:_0x3cb9c2,'contacts':_0x3916f2[_0x72d1('0x38')]===0x0?undefined:_0x3916f2});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0cdf0ba..6280c1b 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 _0x41d7=['syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','data1','data2','render','html','isNil','data3','data4','uriLocation','800','data5','windowHeight','data6','600','winArguments','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','exec','routeId','urlforward','script','buildUri','parse','query','search','replace','channel','every','AllConditions','AnyConditions','some','checkConditions','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','mailSubstatus','null','substatus','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin'];(function(_0x43097e,_0x383f88){var _0x2864d4=function(_0x447d8b){while(--_0x447d8b){_0x43097e['push'](_0x43097e['shift']());}};_0x2864d4(++_0x383f88);}(_0x41d7,0x1c2));var _0x741d=function(_0x1de164,_0x67197){_0x1de164=_0x1de164-0x0;var _0x1b263f=_0x41d7[_0x1de164];return _0x1b263f;};'use strict';var util=require(_0x741d('0x0'));var _=require(_0x741d('0x1'));var url=require(_0x741d('0x2'));var Mustache=require(_0x741d('0x3'));var Redis=require(_0x741d('0x4'));var urlforward=require(_0x741d('0x5'));var integration=require('./integration');var cmContact=require(_0x741d('0x6'));var script=require(_0x741d('0x7'));var config=require(_0x741d('0x8'));var logger=require(_0x741d('0x9'))(_0x741d('0xa'));var ami=require(_0x741d('0xb'));config[_0x741d('0xc')]=_['defaults'](config[_0x741d('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x741d('0xc')]));var operators={'equals':function(_0x47a805,_0x3913ad){return _0x47a805==_0x3913ad;},'not_equals':function(_0x1b8874,_0x134477){return _0x1b8874!=_0x134477;}};var barAndWebActions=[_0x741d('0xd'),_0x741d('0x2'),_0x741d('0xe')];function Trigger(_0x70c5ef){this['triggers']=_0x70c5ef[_0x741d('0xf')];this[_0x741d('0x10')]=_0x70c5ef[_0x741d('0x10')];this[_0x741d('0x11')]=_0x70c5ef['voiceQueues'];this[_0x741d('0x12')]=_0x70c5ef[_0x741d('0x12')];this[_0x741d('0x13')]=_0x70c5ef[_0x741d('0x13')];this[_0x741d('0x14')]=_0x70c5ef[_0x741d('0x14')];this[_0x741d('0x15')]=_0x70c5ef['freshdeskAccounts'];this[_0x741d('0x16')]=_0x70c5ef['salesforceAccounts'];this[_0x741d('0x17')]=_0x70c5ef[_0x741d('0x17')];this['zohoAccounts']=_0x70c5ef[_0x741d('0x18')];this[_0x741d('0x19')]=_0x70c5ef['deskAccounts'];this[_0x741d('0x1a')]=_0x70c5ef[_0x741d('0x1a')];this[_0x741d('0x1b')]=_0x70c5ef['servicenowAccounts'];this[_0x741d('0x1c')]=_0x70c5ef[_0x741d('0x1c')];this[_0x741d('0x1d')]=_0x70c5ef[_0x741d('0x1d')];this[_0x741d('0x1e')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x741d('0x16')],'freshdesk':this[_0x741d('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x741d('0x19')],'vtiger':this[_0x741d('0x1a')],'dynamics365':this[_0x741d('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x741d('0x1b')]};ami['on'](_0x741d('0x1f'),this[_0x741d('0x20')]['bind'](this));ami['on']('custom:agentconnect',this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on'](_0x741d('0x22'),this['syncCustomEvent'][_0x741d('0x21')](this));ami['on'](_0x741d('0x23'),this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0x741d('0x21')](this));ami['on'](_0x741d('0x24'),this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on']('custom:agentbusy',this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on'](_0x741d('0x25'),this[_0x741d('0x20')]['bind'](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0x741d('0x21')](this));ami['on'](_0x741d('0x26'),this[_0x741d('0x20')]['bind'](this));ami['on'](_0x741d('0x27'),this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on'](_0x741d('0x28'),this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on'](_0x741d('0x29'),this[_0x741d('0x2a')][_0x741d('0x21')](this));ami['on'](_0x741d('0x2b'),this[_0x741d('0x2a')][_0x741d('0x21')](this));ami['on'](_0x741d('0x2c'),this['syncAgentDial'][_0x741d('0x21')](this));ami['on'](_0x741d('0x2d'),this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on'](_0x741d('0x2e'),this['syncCustomEvent'][_0x741d('0x21')](this));ami['on'](_0x741d('0x2f'),this[_0x741d('0x20')]['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x741d('0x21')](this));ami['on'](_0x741d('0x30'),this[_0x741d('0x20')][_0x741d('0x21')](this));ami['on'](_0x741d('0x31'),this[_0x741d('0x20')]['bind'](this));ami['on'](_0x741d('0x32'),this['syncCustomEvent'][_0x741d('0x21')](this));}Trigger[_0x741d('0x33')][_0x741d('0x34')]=function(_0x50f96e,_0x54ba0c,_0x6c4657){logger[_0x741d('0x35')](_0x50f96e,_0x54ba0c,JSON[_0x741d('0x36')](_0x6c4657));io['to'](_0x50f96e)[_0x741d('0x34')](_0x54ba0c,_0x6c4657);};Trigger[_0x741d('0x33')][_0x741d('0x20')]=function(_0x4b23b8){var _0x1bb2a2=_['clone'](_0x4b23b8);if(typeof _0x1bb2a2[_0x741d('0x37')]===_0x741d('0x38')){_0x1bb2a2[_0x741d('0x37')]=_0x741d('0x39');}this[_0x741d('0x3a')](_0x1bb2a2);};Trigger['prototype'][_0x741d('0x2a')]=function(_0x26b992){if(this[_0x741d('0x10')][_0x26b992[_0x741d('0x3b')]]){this['syncCustomEvent'](_0x26b992);}};Trigger[_0x741d('0x33')][_0x741d('0x3a')]=function(_0x5a13ff){var _0x78cca4;for(var _0x459228 in this[_0x741d('0xf')]){if(this[_0x741d('0xf')][_0x741d('0x3c')](_0x459228)){if(this[_0x741d('0xf')][_0x459228][_0x741d('0x3d')]){_0x78cca4=this[_0x741d('0x3e')](this['triggers'][_0x459228],_0x5a13ff);if(_0x78cca4){_['merge'](_0x5a13ff,_0x5a13ff[_0x741d('0x3f')]);for(var _0x255679=0x0,_0xcb53e7,_0x3842bb,_0xdebb3f;_0x2556790x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x41f300,_0x19027c){var _0x1c3aa0=function(_0x14e19f){while(--_0x14e19f){_0x41f300['push'](_0x41f300['shift']());}};_0x1c3aa0(++_0x19027c);}(_0x55ca,0x126));var _0xa55c=function(_0x57ec1a,_0x2b7624){_0x57ec1a=_0x57ec1a-0x0;var _0x2159ad=_0x55ca[_0x57ec1a];return _0x2159ad;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index e96e8c8..72aa555 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 _0x711c=['toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','outbound','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','Bearer\x20','value','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','idField','indexOf','ticketType','incident','getString','/contacts(','Fields','phonecall','assign','Descriptions','queue','callDirection','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','error','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','message'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x711c,0xec));var _0xc711=function(_0x479746,_0x574758){_0x479746=_0x479746-0x0;var _0x36d2aa=_0x711c[_0x479746];return _0x36d2aa;};'use strict';var _=require(_0xc711('0x0'));var BPromise=require(_0xc711('0x1'));var rp=require('request-promise');var util=require(_0xc711('0x2'));var intUtil=require(_0xc711('0x3'));var md5=require(_0xc711('0x4'));var Redis=require(_0xc711('0x5'));var logger=require(_0xc711('0x6'))(_0xc711('0x7'));var config=require(_0xc711('0x8'));config['redis']=_[_0xc711('0x9')](config['redis'],{'host':_0xc711('0xa'),'port':0x18eb});var io=require(_0xc711('0xb'))(new Redis(config[_0xc711('0xc')]));function getAuthToken(_0x3be3b2,_0x55109b,_0x35b3e8){var _0x5f26f0={'method':_0xc711('0xd'),'uri':_0x55109b,'form':{'client_id':_0x3be3b2[_0xc711('0xe')],'resource':_0x3be3b2[_0xc711('0xf')],'username':_0x3be3b2[_0xc711('0x10')],'password':_0x3be3b2[_0xc711('0x11')],'grant_type':_0xc711('0x11'),'client_secret':_0x3be3b2[_0xc711('0x12')]},'json':!![]};return rp(_0x5f26f0)[_0xc711('0x13')](function(_0x277141){return _0x277141[_0xc711('0x14')];})[_0xc711('0x15')](function(_0x503df7){logger['error']('['+[_0x35b3e8[_0xc711('0x16')]()]+']\x20Wrong\x20credentials!');return _0x503df7['message'];});}function getUser(_0x5e47d5,_0x388e0a,_0x5c3645,_0x2006ba,_0x3428f9,_0x195994){return new BPromise(function(_0x4278e4,_0x46ec17){return getAuthToken(_0x388e0a,_0x2006ba,_0x195994)[_0xc711('0x13')](function(_0x382c18){var _0x4246d0={'method':_0xc711('0x17'),'uri':_0x3428f9+_0xc711('0x18'),'headers':{'Authorization':'Bearer\x20'+_0x382c18,'OData-Version':_0xc711('0x19')},'json':!![]};return rp(_0x4246d0);})[_0xc711('0x13')](function(_0x30a626){var _0x4408b0=_0x30a626['value'];var _0x3fe9c5=![];var _0x3cbc04=null;if(!_[_0xc711('0x1a')](_0x5c3645)){if(intUtil['validateEmail'](_0x5c3645[_0xc711('0x1b')])){_0x5e47d5[_0xc711('0x1c')]=_0x5c3645[_0xc711('0x1b')];for(_0x3cbc04=0x0;_0x3cbc04<_0x4408b0[_0xc711('0x1d')];_0x3cbc04++){if(_0x4408b0[_0x3cbc04][_0xc711('0x1e')]===_0x5c3645['email']&&!_0x4408b0[_0x3cbc04][_0xc711('0x1f')]){_0x3fe9c5=!![];logger[_0xc711('0x20')]('['+[_0x195994[_0xc711('0x16')]()]+_0xc711('0x21')+_0x4408b0[_0x3cbc04][_0xc711('0x22')]+'!');_0x5e47d5['userId']=_0x4408b0[_0x3cbc04]['systemuserid'];}}}}if(!_0x3fe9c5){logger['info']('['+[_0x195994[_0xc711('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x5e47d5['userEmail']=_0x388e0a['username'];for(_0x3cbc04=0x0;_0x3cbc04<_0x4408b0[_0xc711('0x1d')];_0x3cbc04++){if(_0x4408b0[_0x3cbc04]['internalemailaddress']===_0x388e0a['username']){_0x5e47d5[_0xc711('0x23')]=_0x4408b0[_0x3cbc04][_0xc711('0x22')];}}}_0x4278e4(_0x5e47d5);})[_0xc711('0x15')](function(_0x2a8c5c){_0x46ec17(_0x2a8c5c[_0xc711('0x24')]);});});}function createEndUser(_0x524260,_0x370089,_0x71da67,_0x140cad,_0x398842,_0x22100c){return new BPromise(function(_0x346392,_0x37705b){return getAuthToken(_0x370089,_0x71da67,_0x22100c)[_0xc711('0x13')](function(_0x50f92e){var _0x2b7a66=_0x22100c[_0xc711('0x25')]()==='outbound'?_0x398842[_0xc711('0x26')]:_0x398842[_0xc711('0x27')];var _0x31c3e3={'method':_0xc711('0xd'),'uri':_0x140cad+_0xc711('0x28'),'body':{'telephone1':_0x2b7a66,'fullname':_0x2b7a66,'firstname':_0x2b7a66,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc711('0x29')+_0x524260['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x50f92e,'OData-Version':_0xc711('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x31c3e3);})[_0xc711('0x13')](function(_0x348c22){var _0x1f6bb5=_0x348c22[_0xc711('0x2a')]['odata-entityid'];var _0x26c67d=_0x1f6bb5[_0xc711('0x2b')](_0x1f6bb5[_0xc711('0x2c')]('(')+0x1,_0x1f6bb5[_0xc711('0x2c')](')'));_0x524260[_0xc711('0x2d')]=_0x26c67d;_0x346392(_0x524260);})[_0xc711('0x15')](function(_0x2ba371){_0x37705b(_0x2ba371[_0xc711('0x24')]);});});}function getEndUser(_0x57c4c2,_0x59478d,_0x369593,_0x4bf280,_0x427025,_0x5c9282){return new BPromise(function(_0x513e38,_0x359a91){var _0x7287e3=_0x5c9282[_0xc711('0x25')]()===_0xc711('0x2e')?_0x427025[_0xc711('0x26')]:_0x427025[_0xc711('0x27')];return getAuthToken(_0x59478d,_0x369593,_0x5c9282)[_0xc711('0x13')](function(_0x267957){var _0x561b92={'method':_0xc711('0x17'),'uri':_0x4bf280+_0xc711('0x2f')+_0x7287e3['replace']('+','%2b')+'\x27','headers':{'Authorization':_0xc711('0x30')+_0x267957,'If-None-Match':null,'OData-Version':_0xc711('0x19')},'json':!![]};return rp(_0x561b92);})[_0xc711('0x13')](function(_0x27a49e){var _0x41e63d=null;if(_0x27a49e){var _0x215105=_0x27a49e[_0xc711('0x31')];var _0x58417c=![];for(_0x41e63d=0x0;_0x41e63d<_0x215105[_0xc711('0x1d')];_0x41e63d++){if(_0x215105[_0x41e63d][_0xc711('0x32')]===_0x7287e3){_0x58417c=!![];_0x57c4c2[_0xc711('0x2d')]=_0x215105[_0x41e63d]['contactid'];}}if(_0x58417c){_0x513e38(_0x57c4c2);}else{return createEndUser(_0x57c4c2,_0x59478d,_0x369593,_0x4bf280,_0x427025,_0x5c9282)['then'](function(_0x4e11b2){logger[_0xc711('0x20')]('['+[_0x5c9282[_0xc711('0x16')]()]+_0xc711('0x33'),_0x4e11b2[_0xc711('0x2d')]);_0x513e38(_0x4e11b2);});}}else{return createEndUser(_0x57c4c2,_0x59478d,_0x369593,_0x4bf280,_0x427025,_0x5c9282)[_0xc711('0x13')](function(_0x32d0b3){logger[_0xc711('0x20')]('['+[_0x5c9282[_0xc711('0x16')]()]+_0xc711('0x34'),_0x32d0b3['enduserId']);_0x513e38(_0x32d0b3);});}});});}function getCustomFields(_0x492c69,_0x4b21e5,_0x3e0463){var _0x3f2067={};if(_0x492c69['length']>0x0){_[_0xc711('0x35')](_0x492c69,function(_0x3ff03e){if(_[_0xc711('0x36')]([_0xc711('0x37'),_0xc711('0x38')],_0x3ff03e['type'])&&_0x3ff03e['nameField']&&!_0x3ff03e['customField']){var _0x5e7570=_0x3ff03e[_0xc711('0x39')][_0xc711('0x25')]();var _0x511afd=_0x5e7570[_0xc711('0x2b')](0x0,_0x5e7570[_0xc711('0x3a')]('_'));var _0x407462=_0x5e7570[_0xc711('0x2b')](_0x5e7570[_0xc711('0x3a')]('_')+0x1);if(_0x511afd===_0x3e0463){_0x3f2067[_0x407462]=_0x3ff03e['content'];}}});}return _0x3f2067;}function getTicket(_0x91f35a,_0x315bf5,_0x51a01d,_0x39098a,_0x44aad0,_0x26a7f7,_0x65d2fb){return new BPromise(function(_0x5a14e6,_0x959c04){var _0x21049e;return getAuthToken(_0x315bf5,_0x51a01d,_0x65d2fb)[_0xc711('0x13')](function(_0x30fe88){if(_0x26a7f7[_0xc711('0x3b')]===_0xc711('0x3c')){_0x21049e={'method':_0xc711('0xd'),'uri':_0x39098a+'incidents','body':Object['assign']({},{'title':intUtil[_0xc711('0x3d')](_0x26a7f7['Subjects'],_0x44aad0,'\x20'),'description':intUtil[_0xc711('0x3d')](_0x26a7f7['Descriptions'],_0x44aad0,'\x0a'),'customerid_contact@odata.bind':_0xc711('0x3e')+_0x91f35a[_0xc711('0x2d')]+')','ownerid@odata.bind':_0xc711('0x29')+_0x91f35a[_0xc711('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x26a7f7[_0xc711('0x3f')],_0x44aad0,_0x26a7f7[_0xc711('0x3b')])),'headers':{'Authorization':_0xc711('0x30')+_0x30fe88,'OData-Version':_0xc711('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x26a7f7['ticketType']===_0xc711('0x40')){_0x21049e={'method':'POST','uri':_0x39098a+'phonecalls','body':Object[_0xc711('0x41')]({},{'subject':intUtil['getString'](_0x26a7f7['Subjects'],_0x44aad0,'\x20'),'phonenumber':String(_0x44aad0[_0xc711('0x27')]),'description':intUtil[_0xc711('0x3d')](_0x26a7f7[_0xc711('0x42')],_0x44aad0,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc711('0x3e')+_0x91f35a[_0xc711('0x2d')]+')','ownerid@odata.bind':_0xc711('0x29')+_0x91f35a[_0xc711('0x23')]+')','directioncode':_0x91f35a['callDirection']===_0xc711('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xc711('0x29')+_0x91f35a[_0xc711('0x23')]+')','participationtypemask':_0x91f35a[_0xc711('0x44')]===_0xc711('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0xc711('0x3e')+_0x91f35a[_0xc711('0x2d')]+')','participationtypemask':_0x91f35a[_0xc711('0x44')]===_0xc711('0x43')?0x1:0x2}]},getCustomFields(_0x26a7f7[_0xc711('0x3f')],_0x44aad0,_0x26a7f7[_0xc711('0x3b')])),'headers':{'Authorization':_0xc711('0x30')+_0x30fe88,'OData-Version':_0xc711('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x21049e);})[_0xc711('0x13')](function(_0x1a6eeb){var _0x290079=_0x1a6eeb[_0xc711('0x2a')][_0xc711('0x45')];var _0x5d4902=_0x290079['substring'](_0x290079[_0xc711('0x2c')]('(')+0x1,_0x290079[_0xc711('0x2c')](')'));_0x91f35a[_0xc711('0x46')]=_0x5d4902;_0x5a14e6(_0x91f35a);})[_0xc711('0x15')](function(_0x3fe7eb){_0x959c04(_0x3fe7eb[_0xc711('0x24')]);});});}function emit(_0x1b11d4,_0x270c06,_0x47aa17,_0xd453a0){var _0x1d1250={'uri':util['format'](_0xc711('0x47'),_0x1b11d4,_0x47aa17,_0xd453a0)};io['to'](util['format'](_0xc711('0x48'),_0x270c06))['emit']('trigger:browser:url',_0x1d1250);}exports['cs']=function(_0x39abcf,_0x1ddecc,_0x35f2b4,_0x23c080,_0x5b2be3,_0x2f7982,_0x4fde17,_0xb48f3){var _0x28ae00={};_0x2f7982[_0xc711('0xf')]=intUtil[_0xc711('0x49')](_0x2f7982['remoteUri']);_0x2f7982['serverUrl']=intUtil[_0xc711('0x49')](_0x2f7982[_0xc711('0x4a')]);_0x28ae00[_0xc711('0x44')]=_0xb48f3===_0xc711('0x43')||_0xb48f3===_0xc711('0x4b')?'queue':_0xc711('0x2e');var _0x4f0d12=util[_0xc711('0x4c')](_0xc711('0x4d'),_0x2f7982['remoteUri']);var _0x58d340=util[_0xc711('0x4c')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2f7982[_0xc711('0x4e')]);var _0xaf541c=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f7982[_0xc711('0x4a')],_0x1ddecc[_0xc711('0x4f')],md5(_0x1ddecc[_0xc711('0x4f')]));if(_0x5b2be3&&_0x5b2be3[_0xc711('0x50')]){logger[_0xc711('0x20')](_0xc711('0x51'),_0xc711('0x52'));_0x1ddecc['recordingURL']=_0xaf541c;}else if(_0x4fde17&&_0x4fde17[_0xc711('0x53')]&&_0x4fde17['recordingFormat']!==_0xc711('0x54')){logger[_0xc711('0x20')](_0xc711('0x55'),'Recording\x20is\x20enabled!');_0x1ddecc[_0xc711('0x56')]=_0xaf541c;}else{_0x1ddecc[_0xc711('0x56')]='';}return getUser(_0x28ae00,_0x2f7982,_0x23c080,_0x58d340,_0x4f0d12,_0xb48f3)[_0xc711('0x13')](function(_0x4ce7b0){logger[_0xc711('0x20')]('['+_0xb48f3[_0xc711('0x16')]()+_0xc711('0x57'),_0x4ce7b0[_0xc711('0x23')]);logger['info']('['+_0xb48f3[_0xc711('0x16')]()+']\x20The\x20User\x20email\x20is:',_0x4ce7b0[_0xc711('0x1c')]);return getEndUser(_0x4ce7b0,_0x2f7982,_0x58d340,_0x4f0d12,_0x1ddecc,_0xb48f3);})[_0xc711('0x13')](function(_0x30ce68){logger[_0xc711('0x20')]('['+_0xb48f3[_0xc711('0x16')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x30ce68[_0xc711('0x2d')]);logger['info']('['+_0xb48f3[_0xc711('0x16')]()+_0xc711('0x58'),_0x1ddecc[_0xc711('0x27')]);return getTicket(_0x30ce68,_0x2f7982,_0x58d340,_0x4f0d12,_0x1ddecc,_0x35f2b4,_0xb48f3);})[_0xc711('0x13')](function(_0x3a7e4d){logger[_0xc711('0x20')](util[_0xc711('0x4c')]('['+_0xb48f3[_0xc711('0x16')]()+_0xc711('0x59'),_0x35f2b4[_0xc711('0x3b')],_0x3a7e4d[_0xc711('0x46')]));logger[_0xc711('0x20')](util[_0xc711('0x4c')]('['+_0xb48f3[_0xc711('0x16')]()+']\x20Call\x20direction:\x20%s',_0xb48f3));if(_0xb48f3!==_0xc711('0x4b')){logger[_0xc711('0x20')]('['+_0xb48f3[_0xc711('0x16')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2f7982[_0xc711('0xf')],_0x23c080['name'],_0x35f2b4[_0xc711('0x3b')],_0x3a7e4d['ticketId']);}})[_0xc711('0x15')](function(_0x130247){logger[_0xc711('0x5a')]('['+_0xb48f3[_0xc711('0x16')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x130247,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x485f=['error',']\x20Error\x20running\x20Dynamics365\x20integration','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid','includes','customField','idField','indexOf','content','incidents','assign','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','Subjects','callDirection','queue','headers','format','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','name'];(function(_0x18ae8f,_0x25f684){var _0x43e219=function(_0x1cb733){while(--_0x1cb733){_0x18ae8f['push'](_0x18ae8f['shift']());}};_0x43e219(++_0x25f684);}(_0x485f,0x162));var _0xf485=function(_0x2c94ef,_0x4bc3b5){_0x2c94ef=_0x2c94ef-0x0;var _0x5382bf=_0x485f[_0x2c94ef];return _0x5382bf;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0xf485('0x0'));var intUtil=require(_0xf485('0x1'));var md5=require(_0xf485('0x2'));var Redis=require(_0xf485('0x3'));var logger=require(_0xf485('0x4'))(_0xf485('0x5'));var config=require(_0xf485('0x6'));config[_0xf485('0x7')]=_[_0xf485('0x8')](config[_0xf485('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf485('0x9'))(new Redis(config[_0xf485('0x7')]));function getAuthToken(_0x1b6d99,_0x112281,_0x6a373){var _0x18f75a={'method':_0xf485('0xa'),'uri':_0x112281,'form':{'client_id':_0x1b6d99[_0xf485('0xb')],'resource':_0x1b6d99[_0xf485('0xc')],'username':_0x1b6d99[_0xf485('0xd')],'password':_0x1b6d99[_0xf485('0xe')],'grant_type':_0xf485('0xe'),'client_secret':_0x1b6d99[_0xf485('0xf')]},'json':!![]};return rp(_0x18f75a)[_0xf485('0x10')](function(_0x59d3bb){return _0x59d3bb[_0xf485('0x11')];})[_0xf485('0x12')](function(_0x199859){logger['error']('['+[_0x6a373[_0xf485('0x13')]()]+']\x20Wrong\x20credentials!');return _0x199859['message'];});}function getUser(_0x6cc9bd,_0x555f00,_0x4a7269,_0x518b81,_0x5d5dec,_0x514914){return new BPromise(function(_0xe006da,_0xce26cc){return getAuthToken(_0x555f00,_0x518b81,_0x514914)[_0xf485('0x10')](function(_0x399e11){var _0x27c4ef={'method':_0xf485('0x14'),'uri':_0x5d5dec+_0xf485('0x15'),'headers':{'Authorization':_0xf485('0x16')+_0x399e11,'OData-Version':_0xf485('0x17')},'json':!![]};return rp(_0x27c4ef);})[_0xf485('0x10')](function(_0x2b5652){var _0x3d4258=_0x2b5652[_0xf485('0x18')];var _0x2cb9da=![];var _0x3a26f4=null;if(!_[_0xf485('0x19')](_0x4a7269)){if(intUtil['validateEmail'](_0x4a7269[_0xf485('0x1a')])){_0x6cc9bd[_0xf485('0x1b')]=_0x4a7269[_0xf485('0x1a')];for(_0x3a26f4=0x0;_0x3a26f4<_0x3d4258[_0xf485('0x1c')];_0x3a26f4++){if(_0x3d4258[_0x3a26f4][_0xf485('0x1d')]===_0x4a7269['email']&&!_0x3d4258[_0x3a26f4]['isdisabled']){_0x2cb9da=!![];logger[_0xf485('0x1e')]('['+[_0x514914[_0xf485('0x13')]()]+_0xf485('0x1f')+_0x3d4258[_0x3a26f4][_0xf485('0x20')]+'!');_0x6cc9bd[_0xf485('0x21')]=_0x3d4258[_0x3a26f4]['systemuserid'];}}}}if(!_0x2cb9da){logger[_0xf485('0x1e')]('['+[_0x514914['toUpperCase']()]+_0xf485('0x22'));_0x6cc9bd[_0xf485('0x1b')]=_0x555f00[_0xf485('0xd')];for(_0x3a26f4=0x0;_0x3a26f4<_0x3d4258[_0xf485('0x1c')];_0x3a26f4++){if(_0x3d4258[_0x3a26f4]['internalemailaddress']===_0x555f00[_0xf485('0xd')]){_0x6cc9bd[_0xf485('0x21')]=_0x3d4258[_0x3a26f4][_0xf485('0x20')];}}}_0xe006da(_0x6cc9bd);})[_0xf485('0x12')](function(_0x539752){_0xce26cc(_0x539752[_0xf485('0x23')]);});});}function createEndUser(_0x24dcd1,_0x550185,_0x493713,_0x3fccb9,_0x2f103b,_0x5a9e1e){return new BPromise(function(_0x3e12e7,_0x218f9d){return getAuthToken(_0x550185,_0x493713,_0x5a9e1e)[_0xf485('0x10')](function(_0x1f2971){var _0x4da428=_0x5a9e1e[_0xf485('0x24')]()===_0xf485('0x25')?_0x2f103b['destcalleridnum']:_0x2f103b[_0xf485('0x26')];var _0x47e19e={'method':_0xf485('0xa'),'uri':_0x3fccb9+_0xf485('0x27'),'body':{'telephone1':_0x4da428,'fullname':_0x4da428,'firstname':_0x4da428,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf485('0x28')+_0x24dcd1['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x1f2971,'OData-Version':_0xf485('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x47e19e);})[_0xf485('0x10')](function(_0x1d4f98){var _0x18b72a=_0x1d4f98['headers'][_0xf485('0x29')];var _0x1223b3=_0x18b72a[_0xf485('0x2a')](_0x18b72a[_0xf485('0x2b')]('(')+0x1,_0x18b72a[_0xf485('0x2b')](')'));_0x24dcd1[_0xf485('0x2c')]=_0x1223b3;_0x3e12e7(_0x24dcd1);})[_0xf485('0x12')](function(_0x2b96f5){_0x218f9d(_0x2b96f5[_0xf485('0x23')]);});});}function getEndUser(_0x41b210,_0x12f2c8,_0x1f1ff5,_0xc4d350,_0x1916d8,_0x1f0058){return new BPromise(function(_0x480247,_0x5ee066){var _0x15a68c=_0x1f0058[_0xf485('0x24')]()===_0xf485('0x25')?_0x1916d8[_0xf485('0x2d')]:_0x1916d8[_0xf485('0x26')];return getAuthToken(_0x12f2c8,_0x1f1ff5,_0x1f0058)[_0xf485('0x10')](function(_0x51b02b){var _0x5581f5={'method':_0xf485('0x14'),'uri':_0xc4d350+_0xf485('0x2e')+_0x15a68c['replace']('+',_0xf485('0x2f'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x51b02b,'If-None-Match':null,'OData-Version':_0xf485('0x17')},'json':!![]};return rp(_0x5581f5);})[_0xf485('0x10')](function(_0x4ee547){var _0x3e7b85=null;if(_0x4ee547){var _0x47d731=_0x4ee547[_0xf485('0x18')];var _0x4d33d1=![];for(_0x3e7b85=0x0;_0x3e7b85<_0x47d731[_0xf485('0x1c')];_0x3e7b85++){if(_0x47d731[_0x3e7b85][_0xf485('0x30')]===_0x15a68c){_0x4d33d1=!![];_0x41b210['enduserId']=_0x47d731[_0x3e7b85][_0xf485('0x31')];}}if(_0x4d33d1){_0x480247(_0x41b210);}else{return createEndUser(_0x41b210,_0x12f2c8,_0x1f1ff5,_0xc4d350,_0x1916d8,_0x1f0058)['then'](function(_0x3333d2){logger[_0xf485('0x1e')]('['+[_0x1f0058[_0xf485('0x13')]()]+']\x20Enduser\x20created!',_0x3333d2[_0xf485('0x2c')]);_0x480247(_0x3333d2);});}}else{return createEndUser(_0x41b210,_0x12f2c8,_0x1f1ff5,_0xc4d350,_0x1916d8,_0x1f0058)[_0xf485('0x10')](function(_0x511ad5){logger[_0xf485('0x1e')]('['+[_0x1f0058['toUpperCase']()]+']\x20Enduser\x20Created!',_0x511ad5[_0xf485('0x2c')]);_0x480247(_0x511ad5);});}});});}function getCustomFields(_0x14b8d3,_0x360947,_0x26c298){var _0x5fa9a1={};if(_0x14b8d3[_0xf485('0x1c')]>0x0){_['forEach'](_0x14b8d3,function(_0x43dd0e){if(_[_0xf485('0x32')](['string','picklist'],_0x43dd0e['type'])&&_0x43dd0e['nameField']&&!_0x43dd0e[_0xf485('0x33')]){var _0x18827b=_0x43dd0e[_0xf485('0x34')][_0xf485('0x24')]();var _0x27d70f=_0x18827b[_0xf485('0x2a')](0x0,_0x18827b[_0xf485('0x35')]('_'));var _0x3cd2a5=_0x18827b[_0xf485('0x2a')](_0x18827b[_0xf485('0x35')]('_')+0x1);if(_0x27d70f===_0x26c298){_0x5fa9a1[_0x3cd2a5]=_0x43dd0e[_0xf485('0x36')];}}});}return _0x5fa9a1;}function getTicket(_0x1fcc60,_0x3860da,_0x2defd7,_0x32ff64,_0x4fc8b7,_0xa3f88c,_0x4479a1){return new BPromise(function(_0x42f470,_0x49ea38){var _0x51ec02;return getAuthToken(_0x3860da,_0x2defd7,_0x4479a1)[_0xf485('0x10')](function(_0x5a886f){if(_0xa3f88c['ticketType']==='incident'){_0x51ec02={'method':_0xf485('0xa'),'uri':_0x32ff64+_0xf485('0x37'),'body':Object[_0xf485('0x38')]({},{'title':intUtil[_0xf485('0x39')](_0xa3f88c['Subjects'],_0x4fc8b7,'\x20'),'description':intUtil[_0xf485('0x39')](_0xa3f88c[_0xf485('0x3a')],_0x4fc8b7,'\x0a'),'customerid_contact@odata.bind':_0xf485('0x3b')+_0x1fcc60[_0xf485('0x2c')]+')','ownerid@odata.bind':_0xf485('0x28')+_0x1fcc60[_0xf485('0x21')]+')','caseorigincode':'1'},getCustomFields(_0xa3f88c[_0xf485('0x3c')],_0x4fc8b7,_0xa3f88c[_0xf485('0x3d')])),'headers':{'Authorization':_0xf485('0x16')+_0x5a886f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xa3f88c[_0xf485('0x3d')]===_0xf485('0x3e')){_0x51ec02={'method':'POST','uri':_0x32ff64+_0xf485('0x3f'),'body':Object[_0xf485('0x38')]({},{'subject':intUtil[_0xf485('0x39')](_0xa3f88c[_0xf485('0x40')],_0x4fc8b7,'\x20'),'phonenumber':String(_0x4fc8b7[_0xf485('0x26')]),'description':intUtil[_0xf485('0x39')](_0xa3f88c[_0xf485('0x3a')],_0x4fc8b7,'\x0a'),'regardingobjectid_contact@odata.bind':_0xf485('0x3b')+_0x1fcc60[_0xf485('0x2c')]+')','ownerid@odata.bind':_0xf485('0x28')+_0x1fcc60[_0xf485('0x21')]+')','directioncode':_0x1fcc60[_0xf485('0x41')]===_0xf485('0x42')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xf485('0x28')+_0x1fcc60[_0xf485('0x21')]+')','participationtypemask':_0x1fcc60['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1fcc60[_0xf485('0x2c')]+')','participationtypemask':_0x1fcc60[_0xf485('0x41')]==='queue'?0x1:0x2}]},getCustomFields(_0xa3f88c[_0xf485('0x3c')],_0x4fc8b7,_0xa3f88c[_0xf485('0x3d')])),'headers':{'Authorization':'Bearer\x20'+_0x5a886f,'OData-Version':_0xf485('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x51ec02);})['then'](function(_0x8979da){var _0x3d7e02=_0x8979da[_0xf485('0x43')]['odata-entityid'];var _0x100a2c=_0x3d7e02[_0xf485('0x2a')](_0x3d7e02[_0xf485('0x2b')]('(')+0x1,_0x3d7e02[_0xf485('0x2b')](')'));_0x1fcc60['ticketId']=_0x100a2c;_0x42f470(_0x1fcc60);})[_0xf485('0x12')](function(_0x58dfd0){_0x49ea38(_0x58dfd0[_0xf485('0x23')]);});});}function emit(_0x43c8f2,_0x3db502,_0x4349e6,_0x924dc9){var _0x37a329={'uri':util[_0xf485('0x44')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x43c8f2,_0x4349e6,_0x924dc9)};io['to'](util[_0xf485('0x44')]('user:%s',_0x3db502))['emit']('trigger:browser:url',_0x37a329);}exports['cs']=function(_0x34297d,_0x5727c5,_0x42af74,_0x3a9d68,_0x4d8faf,_0x438497,_0x20aeae,_0xf0ccf){var _0x210d73={};_0x438497[_0xf485('0xc')]=intUtil[_0xf485('0x45')](_0x438497[_0xf485('0xc')]);_0x438497[_0xf485('0x46')]=intUtil[_0xf485('0x45')](_0x438497[_0xf485('0x46')]);_0x210d73[_0xf485('0x41')]=_0xf0ccf===_0xf485('0x42')||_0xf0ccf===_0xf485('0x47')?'queue':_0xf485('0x25');var _0x549e8e=util[_0xf485('0x44')]('%s/api/data/v9.0/',_0x438497['remoteUri']);var _0x2cd6ec=util[_0xf485('0x44')](_0xf485('0x48'),_0x438497['tenantId']);var _0x477f21=util[_0xf485('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x438497[_0xf485('0x46')],_0x5727c5[_0xf485('0x49')],md5(_0x5727c5[_0xf485('0x49')]));if(_0x4d8faf&&_0x4d8faf[_0xf485('0x4a')]){logger['info']('[QUEUE]',_0xf485('0x4b'));_0x5727c5[_0xf485('0x4c')]=_0x477f21;}else if(_0x20aeae&&_0x20aeae[_0xf485('0x4d')]&&_0x20aeae[_0xf485('0x4d')]!=='none'){logger[_0xf485('0x1e')]('[OUTBOUND]',_0xf485('0x4b'));_0x5727c5['recordingURL']=_0x477f21;}else{_0x5727c5[_0xf485('0x4c')]='';}return getUser(_0x210d73,_0x438497,_0x3a9d68,_0x2cd6ec,_0x549e8e,_0xf0ccf)[_0xf485('0x10')](function(_0x2717f6){logger[_0xf485('0x1e')]('['+_0xf0ccf[_0xf485('0x13')]()+_0xf485('0x4e'),_0x2717f6[_0xf485('0x21')]);logger[_0xf485('0x1e')]('['+_0xf0ccf['toUpperCase']()+_0xf485('0x4f'),_0x2717f6[_0xf485('0x1b')]);return getEndUser(_0x2717f6,_0x438497,_0x2cd6ec,_0x549e8e,_0x5727c5,_0xf0ccf);})[_0xf485('0x10')](function(_0x201d3f){logger[_0xf485('0x1e')]('['+_0xf0ccf['toUpperCase']()+_0xf485('0x50'),_0x201d3f['enduserId']);logger['info']('['+_0xf0ccf[_0xf485('0x13')]()+_0xf485('0x51'),_0x5727c5[_0xf485('0x26')]);return getTicket(_0x201d3f,_0x438497,_0x2cd6ec,_0x549e8e,_0x5727c5,_0x42af74,_0xf0ccf);})[_0xf485('0x10')](function(_0x45dcb4){logger['info'](util[_0xf485('0x44')]('['+_0xf0ccf[_0xf485('0x13')]()+_0xf485('0x52'),_0x42af74['ticketType'],_0x45dcb4[_0xf485('0x53')]));logger[_0xf485('0x1e')](util[_0xf485('0x44')]('['+_0xf0ccf['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0xf0ccf));if(_0xf0ccf!==_0xf485('0x47')){logger[_0xf485('0x1e')]('['+_0xf0ccf['toUpperCase']()+']',_0xf485('0x54'));emit(_0x438497['remoteUri'],_0x3a9d68[_0xf485('0x55')],_0x42af74[_0xf485('0x3d')],_0x45dcb4[_0xf485('0x53')]);}})[_0xf485('0x12')](function(_0x212d57){logger[_0xf485('0x56')]('['+_0xf0ccf['toUpperCase']()+_0xf485('0x57'),util['inspect'](_0x212d57,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 9935c30..1fc114e 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 _0xb215=['Ticket\x20created!','validateEmail','format','%s/api/v2/agents','length','Agent\x20found!','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','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','apiKey','base64','debug','GET','includes','picklist','type','nameField','toLowerCase','toString','string','idField','push','content','variable','variableName','customField','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','getString','Descriptions','
','Tags','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','then','info'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb215,0x150));var _0x5b21=function(_0x214e0c,_0x38024a){_0x214e0c=_0x214e0c-0x0;var _0x25d385=_0xb215[_0x214e0c];return _0x25d385;};'use strict';var _=require(_0x5b21('0x0'));var rp=require(_0x5b21('0x1'));var md5=require(_0x5b21('0x2'));var util=require(_0x5b21('0x3'));var Redis=require(_0x5b21('0x4'));var intUtil=require(_0x5b21('0x5'));var config=require(_0x5b21('0x6'));var logger=require(_0x5b21('0x7'))(_0x5b21('0x8'));config[_0x5b21('0x9')]=_[_0x5b21('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5b21('0xb'))(new Redis(config[_0x5b21('0x9')]));var headers={'Content-Type':_0x5b21('0xc'),'Accept':_0x5b21('0xc')};function emit(_0x228cbe,_0x3b55bd,_0x5292ab){io['to'](_0x228cbe)[_0x5b21('0xd')](_0x3b55bd,_0x5292ab);}function getTicket(_0x328e90,_0x2abd7b,_0x3c2458,_0x266200,_0x149258){logger['info'](_0x5b21('0xe'));var _0x2cbc60=_['merge']({'responder_id':_0x2abd7b['id'],'requester_id':_0x3c2458['id'],'name':util['format'](_0x5b21('0xf'),_0x149258[_0x5b21('0x10')]),'phone':_0x149258['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x266200['Subjects'],_0x149258,'\x20'),'description':intUtil[_0x5b21('0x11')](_0x266200[_0x5b21('0x12')],_0x149258,_0x5b21('0x13')),'tags':getTags(_0x266200[_0x5b21('0x14')],'name')},getCustomFields(_0x266200['Fields'],_0x149258));_0x2cbc60[_0x5b21('0x15')]=_[_0x5b21('0x16')](_['keyBy'](_0x2cbc60['custom_fields'],'id'),_0x5b21('0x17'));return request({'uri':util['format'](_0x5b21('0x18'),_0x328e90[_0x5b21('0x19')]),'method':'POST','body':_0x2cbc60})[_0x5b21('0x1a')](function(_0x37ce26){logger[_0x5b21('0x1b')](_0x5b21('0x1c'));return _0x37ce26;});}function getUser(_0x24cb30,_0x32b7f5){if(intUtil[_0x5b21('0x1d')](_0x32b7f5)){return request({'uri':util[_0x5b21('0x1e')](_0x5b21('0x1f'),_0x24cb30['remoteUri']),'qs':{'email':_0x32b7f5}})['then'](function(_0x7c2503){if(_0x7c2503[_0x5b21('0x20')]){logger[_0x5b21('0x1b')](_0x5b21('0x21'));return _['find'](_0x7c2503,function(_0x5aca71){return _0x5aca71[_0x5b21('0x22')][_0x5b21('0x23')]===_0x32b7f5;});}else{logger['info'](_0x5b21('0x24'));return request({'uri':util[_0x5b21('0x1e')](_0x5b21('0x25'),_0x24cb30[_0x5b21('0x19')])})[_0x5b21('0x1a')](function(_0x2b215a){logger[_0x5b21('0x1b')](_0x5b21('0x26'));return _0x2b215a;});}});}else{logger[_0x5b21('0x1b')](_0x5b21('0x27'));return request({'uri':util[_0x5b21('0x1e')](_0x5b21('0x25'),_0x24cb30[_0x5b21('0x19')])})[_0x5b21('0x1a')](function(_0x2fd3d0){logger[_0x5b21('0x1b')](_0x5b21('0x26'));return _0x2fd3d0;});}}function getEndUser(_0x37204b,_0x2ad4aa,_0x1f6df4){logger[_0x5b21('0x1b')](_0x5b21('0x28'),_0x1f6df4);return request({'uri':util[_0x5b21('0x1e')]('%s/api/v2/contacts',_0x37204b[_0x5b21('0x19')]),'qs':{'phone':_0x1f6df4}})['then'](function(_0x3e4545){if(_0x3e4545[_0x5b21('0x20')]){logger[_0x5b21('0x1b')]('Enduser\x20found!');return _[_0x5b21('0x29')](_0x3e4545,{'phone':_0x1f6df4});}else{logger[_0x5b21('0x1b')](_0x5b21('0x2a'));return request({'uri':util[_0x5b21('0x1e')](_0x5b21('0x2b'),_0x37204b['remoteUri']),'method':'POST','body':{'name':_0x2ad4aa,'phone':_0x1f6df4}})[_0x5b21('0x1a')](function(_0x65a511){logger[_0x5b21('0x1b')]('Enduser\x20created.');return _0x65a511;});}});}function getAuth(_0x290c27){return util[_0x5b21('0x1e')](_0x5b21('0x2c'),new Buffer(_0x290c27[_0x5b21('0x2d')]+':X')['toString'](_0x5b21('0x2e')));}function request(_0x433ead){logger[_0x5b21('0x2f')]('[HTTP]',JSON['stringify'](_0x433ead));return rp(_[_0x5b21('0xa')](_0x433ead,{'method':_0x5b21('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x5ca9a7,_0x21dc01){var _0x11808c=[];if(_0x5ca9a7&&_0x5ca9a7['length']>0x0){_0x11808c=_['map'](_0x5ca9a7,_0x21dc01);}return _0x11808c;}function getCustomFields(_0x20456d,_0x541f6f){var _0x55510c=[];var _0x170670={'custom_fields':[]};if(_0x20456d[_0x5b21('0x20')]>0x0){_['forEach'](_0x20456d,function(_0x4f77e2){if(_[_0x5b21('0x31')](['string',_0x5b21('0x32')],_0x4f77e2[_0x5b21('0x33')])&&_0x4f77e2['nameField']&&!_0x4f77e2['customField']){_0x170670[_0x4f77e2[_0x5b21('0x34')][_0x5b21('0x35')]()]=_0x4f77e2['content'][_0x5b21('0x36')]();}else if(_['includes']([_0x5b21('0x37'),_0x5b21('0x32')],_0x4f77e2[_0x5b21('0x33')])&&_0x4f77e2[_0x5b21('0x38')]&&_0x4f77e2['customField']){_0x170670[_0x5b21('0x15')][_0x5b21('0x39')]({'id':_0x4f77e2[_0x5b21('0x38')],'value':_0x4f77e2[_0x5b21('0x3a')]['toString']()});}else if(_0x4f77e2[_0x5b21('0x33')]===_0x5b21('0x3b')&&_0x4f77e2[_0x5b21('0x3c')]&&_0x4f77e2[_0x5b21('0x38')]&&_0x4f77e2[_0x5b21('0x3d')]){_0x541f6f[_0x4f77e2['variableName']]&&_0x170670[_0x5b21('0x15')][_0x5b21('0x39')]({'id':_0x4f77e2[_0x5b21('0x38')],'value':_0x541f6f[_0x4f77e2['variableName']][_0x5b21('0x36')]()});}else if(_0x4f77e2['type']==='customVariable'&&_0x4f77e2[_0x5b21('0x3e')]&&_0x4f77e2[_0x5b21('0x3e')][_0x5b21('0x3f')]&&_0x4f77e2['idField']&&_0x4f77e2[_0x5b21('0x3d')]){_0x541f6f[_0x4f77e2[_0x5b21('0x3e')]['name']['toLowerCase']()]&&_0x170670[_0x5b21('0x15')]['push']({'id':_0x4f77e2['idField'],'value':_0x541f6f[_0x4f77e2['Variable'][_0x5b21('0x3f')][_0x5b21('0x35')]()][_0x5b21('0x36')]()});}});}return _0x170670;}exports[_0x5b21('0x40')]=function(_0x2b9b90,_0x3ce2d1,_0xf7f4f8,_0x9396e9,_0x2c28fe,_0x3ec3bb){var _0x493248,_0x387a86;_0x3ec3bb['remoteUri']=intUtil[_0x5b21('0x41')](_0x3ec3bb['remoteUri']);_0x3ec3bb[_0x5b21('0x42')]=intUtil[_0x5b21('0x41')](_0x3ec3bb[_0x5b21('0x42')]);if(_0x2c28fe&&_0x2c28fe['monitor_format']){logger[_0x5b21('0x1b')](_0x5b21('0x43'),_0x5b21('0x44'));_0x3ce2d1['recordingURL']=util[_0x5b21('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ec3bb['serverUrl'],_0x3ce2d1['uniqueid'],md5(_0x3ce2d1[_0x5b21('0x45')]));}else{_0x3ce2d1['recordingURL']='';}headers[_0x5b21('0x46')]=getAuth(_0x3ec3bb);return getUser(_0x3ec3bb,_0x9396e9[_0x5b21('0x23')])[_0x5b21('0x1a')](function(_0xb21570){_0x493248=_0xb21570;logger[_0x5b21('0x1b')]('The\x20User\x20ID\x20is:',_0x493248['id']);return getEndUser(_0x3ec3bb,_0x3ce2d1[_0x5b21('0x10')],_0x3ce2d1[_0x5b21('0x47')]);})['then'](function(_0x49a397){_0x387a86=_0x49a397;logger[_0x5b21('0x1b')](_0x5b21('0x48'),_0x387a86['id']);return getTicket(_0x3ec3bb,_0x493248,_0x387a86,_0xf7f4f8,_0x3ce2d1);})[_0x5b21('0x1a')](function(_0x37ad87){if(_0x37ad87&&_0x37ad87['id']){logger[_0x5b21('0x1b')](_0x5b21('0x1c'));logger[_0x5b21('0x1b')](_0x5b21('0x49'),_0x37ad87['id']);logger[_0x5b21('0x1b')](_0x5b21('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5b21('0x1e')]('user:%s',_0x9396e9[_0x5b21('0x3f')]),_0x5b21('0x4a'),{'uri':util[_0x5b21('0x1e')](_0x5b21('0x4b'),_0x3ec3bb[_0x5b21('0x19')],_0x37ad87['id'])});}})[_0x5b21('0x4c')](function(_0x1c57f4){logger[_0x5b21('0x4d')](_0x5b21('0x43'),JSON[_0x5b21('0x4e')](_0x1c57f4));});};exports[_0x5b21('0x4f')]=function(_0x277273,_0x166377,_0x2b6f85,_0x4a5199,_0xbb60b2,_0x26b105,_0x21de7a){var _0x42bb29,_0x47247f;_0x26b105[_0x5b21('0x19')]=intUtil[_0x5b21('0x41')](_0x26b105['remoteUri']);_0x26b105[_0x5b21('0x42')]=intUtil[_0x5b21('0x41')](_0x26b105[_0x5b21('0x42')]);if(_0x21de7a&&_0x21de7a[_0x5b21('0x50')]&&_0x21de7a[_0x5b21('0x50')]!==_0x5b21('0x51')){logger[_0x5b21('0x1b')](_0x5b21('0x52'),'Recording\x20is\x20enabled!');_0x166377[_0x5b21('0x53')]=util[_0x5b21('0x1e')](_0x5b21('0x54'),_0x26b105[_0x5b21('0x42')],_0x166377[_0x5b21('0x45')],md5(_0x166377[_0x5b21('0x45')]));}headers[_0x5b21('0x46')]=getAuth(_0x26b105);return getUser(_0x26b105,_0x4a5199[_0x5b21('0x23')])[_0x5b21('0x1a')](function(_0x1bf7d1){_0x42bb29=_0x1bf7d1;logger[_0x5b21('0x1b')](_0x5b21('0x55'),_0x42bb29['id']);return getEndUser(_0x26b105,_0x166377[_0x5b21('0x56')],_0x166377[_0x5b21('0x57')]);})[_0x5b21('0x1a')](function(_0x181c8d){_0x47247f=_0x181c8d;logger[_0x5b21('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x47247f['id']);return getTicket(_0x26b105,_0x42bb29,_0x47247f,_0x2b6f85,_0x166377);})['then'](function(_0x45e3dc){if(_0x45e3dc&&_0x45e3dc['id']){logger[_0x5b21('0x1b')]('Ticket\x20created!');logger['info'](_0x5b21('0x49'),_0x45e3dc['id']);logger[_0x5b21('0x1b')](_0x5b21('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5b21('0x1e')]('user:%s',_0x4a5199[_0x5b21('0x3f')]),_0x5b21('0x4a'),{'uri':util[_0x5b21('0x1e')](_0x5b21('0x4b'),_0x26b105[_0x5b21('0x19')],_0x45e3dc['id'])});}})['catch'](function(_0x4a7b7e){logger[_0x5b21('0x4d')](_0x5b21('0x52'),JSON[_0x5b21('0x4e')](_0x4a7b7e));});};exports[_0x5b21('0x58')]=function(_0x916f87,_0x3e1337,_0x4b697c,_0x3851c6,_0x10b7b2,_0x5a36c0){var _0x30ab0c,_0x1903b7;_0x5a36c0[_0x5b21('0x19')]=intUtil[_0x5b21('0x41')](_0x5a36c0[_0x5b21('0x19')]);_0x5a36c0[_0x5b21('0x42')]=intUtil[_0x5b21('0x41')](_0x5a36c0[_0x5b21('0x42')]);if(_0x10b7b2&&_0x10b7b2['monitor_format']){logger[_0x5b21('0x1b')]('['+_0x3e1337[_0x5b21('0x59')][_0x5b21('0x5a')]()+']',_0x5b21('0x44'));_0x3e1337[_0x5b21('0x53')]=util[_0x5b21('0x1e')](_0x5b21('0x54'),_0x5a36c0[_0x5b21('0x42')],_0x3e1337[_0x5b21('0x45')],md5(_0x3e1337['uniqueid']));}else{_0x3e1337['recordingURL']='';}headers[_0x5b21('0x46')]=getAuth(_0x5a36c0);return getUser(_0x5a36c0,'')['then'](function(_0x4551af){_0x30ab0c=_0x4551af;logger[_0x5b21('0x1b')]('The\x20User\x20ID\x20is:',_0x30ab0c['id']);return getEndUser(_0x5a36c0,_0x3e1337[_0x5b21('0x10')],_0x3e1337[_0x5b21('0x47')]);})['then'](function(_0xcb6d2e){_0x1903b7=_0xcb6d2e;logger[_0x5b21('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x1903b7['id']);return getTicket(_0x5a36c0,_0x30ab0c,_0x1903b7,_0x4b697c,_0x3e1337);})['then'](function(_0x5169d7){if(_0x5169d7){logger[_0x5b21('0x1b')](_0x5b21('0x1c'));logger[_0x5b21('0x1b')](_0x5b21('0x49'),_0x5169d7['id']);}})[_0x5b21('0x4c')](function(_0x24ac98){logger[_0x5b21('0x4d')]('['+_0x3e1337['lastevent'][_0x5b21('0x5a')]()+']',JSON['stringify'](_0x24ac98));});}; \ No newline at end of file +var _0x1c5e=['request-promise','md5','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','name','Fields','custom_fields','keyBy','value','format','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Basic\x20%s','apiKey','base64','debug','[HTTP]','GET','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','push','variableName','customVariable','Variable','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','error','stringify','recordingFormat','[OUTBOUND]','uniqueid','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','trigger:browser:url','catch','unmanaged','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x1c5e,0xfc));var _0xe1c5=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x1c5e[_0x1cb18a];return _0x22442e;};'use strict';var _=require('lodash');var rp=require(_0xe1c5('0x0'));var md5=require(_0xe1c5('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xe1c5('0x2'));var logger=require(_0xe1c5('0x3'))('freshdesk');config[_0xe1c5('0x4')]=_[_0xe1c5('0x5')](config['redis'],{'host':_0xe1c5('0x6'),'port':0x18eb});var io=require(_0xe1c5('0x7'))(new Redis(config[_0xe1c5('0x4')]));var headers={'Content-Type':_0xe1c5('0x8'),'Accept':_0xe1c5('0x8')};function emit(_0x4c73f0,_0x3686b7,_0x1e6f78){io['to'](_0x4c73f0)['emit'](_0x3686b7,_0x1e6f78);}function getTicket(_0x1e3875,_0x5f5b17,_0x3dca82,_0x2e4c6b,_0x598d1a){logger[_0xe1c5('0x9')](_0xe1c5('0xa'));var _0x84bae3=_[_0xe1c5('0xb')]({'responder_id':_0x5f5b17['id'],'requester_id':_0x3dca82['id'],'name':util['format'](_0xe1c5('0xc'),_0x598d1a[_0xe1c5('0xd')]),'phone':_0x598d1a[_0xe1c5('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe1c5('0xf')](_0x2e4c6b[_0xe1c5('0x10')],_0x598d1a,'\x20'),'description':intUtil[_0xe1c5('0xf')](_0x2e4c6b['Descriptions'],_0x598d1a,_0xe1c5('0x11')),'tags':getTags(_0x2e4c6b['Tags'],_0xe1c5('0x12'))},getCustomFields(_0x2e4c6b[_0xe1c5('0x13')],_0x598d1a));_0x84bae3[_0xe1c5('0x14')]=_['mapValues'](_[_0xe1c5('0x15')](_0x84bae3[_0xe1c5('0x14')],'id'),_0xe1c5('0x16'));return request({'uri':util[_0xe1c5('0x17')]('%s/api/v2/tickets',_0x1e3875['remoteUri']),'method':_0xe1c5('0x18'),'body':_0x84bae3})['then'](function(_0x2f961e){logger[_0xe1c5('0x9')](_0xe1c5('0x19'));return _0x2f961e;});}function getUser(_0x8733e6,_0x1d2813){if(intUtil[_0xe1c5('0x1a')](_0x1d2813)){return request({'uri':util[_0xe1c5('0x17')](_0xe1c5('0x1b'),_0x8733e6[_0xe1c5('0x1c')]),'qs':{'email':_0x1d2813}})[_0xe1c5('0x1d')](function(_0xf5d296){if(_0xf5d296[_0xe1c5('0x1e')]){logger[_0xe1c5('0x9')]('Agent\x20found!');return _['find'](_0xf5d296,function(_0x395fd0){return _0x395fd0[_0xe1c5('0x1f')][_0xe1c5('0x20')]===_0x1d2813;});}else{logger['info'](_0xe1c5('0x21'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x8733e6[_0xe1c5('0x1c')])})[_0xe1c5('0x1d')](function(_0xf710a6){logger[_0xe1c5('0x9')]('Admin\x20account\x20selected.');return _0xf710a6;});}});}else{logger['info'](_0xe1c5('0x22'));return request({'uri':util[_0xe1c5('0x17')](_0xe1c5('0x23'),_0x8733e6['remoteUri'])})[_0xe1c5('0x1d')](function(_0x49f7c8){logger[_0xe1c5('0x9')]('Admin\x20account\x20selected.');return _0x49f7c8;});}}function getEndUser(_0x35a7eb,_0x3e5b9c,_0x50c8b6){logger[_0xe1c5('0x9')](_0xe1c5('0x24'),_0x50c8b6);return request({'uri':util[_0xe1c5('0x17')](_0xe1c5('0x25'),_0x35a7eb[_0xe1c5('0x1c')]),'qs':{'phone':_0x50c8b6}})['then'](function(_0x3c83a2){if(_0x3c83a2['length']){logger[_0xe1c5('0x9')]('Enduser\x20found!');return _['find'](_0x3c83a2,{'phone':_0x50c8b6});}else{logger[_0xe1c5('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xe1c5('0x17')](_0xe1c5('0x25'),_0x35a7eb[_0xe1c5('0x1c')]),'method':_0xe1c5('0x18'),'body':{'name':_0x3e5b9c,'phone':_0x50c8b6}})[_0xe1c5('0x1d')](function(_0x46ae66){logger['info']('Enduser\x20created.');return _0x46ae66;});}});}function getAuth(_0x5ec8d2){return util['format'](_0xe1c5('0x26'),new Buffer(_0x5ec8d2[_0xe1c5('0x27')]+':X')['toString'](_0xe1c5('0x28')));}function request(_0x19b15f){logger[_0xe1c5('0x29')](_0xe1c5('0x2a'),JSON['stringify'](_0x19b15f));return rp(_[_0xe1c5('0x5')](_0x19b15f,{'method':_0xe1c5('0x2b'),'headers':headers,'json':!![]}));}function getTags(_0x5871de,_0x37edd6){var _0x17f857=[];if(_0x5871de&&_0x5871de[_0xe1c5('0x1e')]>0x0){_0x17f857=_['map'](_0x5871de,_0x37edd6);}return _0x17f857;}function getCustomFields(_0x4d3b9a,_0x16e709){var _0x19e0a7=[];var _0x12e4b3={'custom_fields':[]};if(_0x4d3b9a[_0xe1c5('0x1e')]>0x0){_[_0xe1c5('0x2c')](_0x4d3b9a,function(_0x1fe96d){if(_[_0xe1c5('0x2d')]([_0xe1c5('0x2e'),'picklist'],_0x1fe96d[_0xe1c5('0x2f')])&&_0x1fe96d[_0xe1c5('0x30')]&&!_0x1fe96d[_0xe1c5('0x31')]){_0x12e4b3[_0x1fe96d['nameField'][_0xe1c5('0x32')]()]=_0x1fe96d[_0xe1c5('0x33')][_0xe1c5('0x34')]();}else if(_[_0xe1c5('0x2d')]([_0xe1c5('0x2e'),_0xe1c5('0x35')],_0x1fe96d[_0xe1c5('0x2f')])&&_0x1fe96d[_0xe1c5('0x36')]&&_0x1fe96d[_0xe1c5('0x31')]){_0x12e4b3[_0xe1c5('0x14')][_0xe1c5('0x37')]({'id':_0x1fe96d[_0xe1c5('0x36')],'value':_0x1fe96d[_0xe1c5('0x33')][_0xe1c5('0x34')]()});}else if(_0x1fe96d[_0xe1c5('0x2f')]==='variable'&&_0x1fe96d[_0xe1c5('0x38')]&&_0x1fe96d[_0xe1c5('0x36')]&&_0x1fe96d[_0xe1c5('0x31')]){_0x16e709[_0x1fe96d['variableName']]&&_0x12e4b3[_0xe1c5('0x14')][_0xe1c5('0x37')]({'id':_0x1fe96d['idField'],'value':_0x16e709[_0x1fe96d['variableName']]['toString']()});}else if(_0x1fe96d[_0xe1c5('0x2f')]===_0xe1c5('0x39')&&_0x1fe96d['Variable']&&_0x1fe96d[_0xe1c5('0x3a')][_0xe1c5('0x12')]&&_0x1fe96d['idField']&&_0x1fe96d[_0xe1c5('0x31')]){_0x16e709[_0x1fe96d[_0xe1c5('0x3a')][_0xe1c5('0x12')][_0xe1c5('0x32')]()]&&_0x12e4b3[_0xe1c5('0x14')][_0xe1c5('0x37')]({'id':_0x1fe96d[_0xe1c5('0x36')],'value':_0x16e709[_0x1fe96d['Variable'][_0xe1c5('0x12')]['toLowerCase']()][_0xe1c5('0x34')]()});}});}return _0x12e4b3;}exports['queue']=function(_0x160b3d,_0x138134,_0x29abb3,_0x448f70,_0x4c3ca1,_0x12753c){var _0x4a85cc,_0x1a2df5;_0x12753c[_0xe1c5('0x1c')]=intUtil['stripTrailingSlash'](_0x12753c[_0xe1c5('0x1c')]);_0x12753c[_0xe1c5('0x3b')]=intUtil[_0xe1c5('0x3c')](_0x12753c['serverUrl']);if(_0x4c3ca1&&_0x4c3ca1['monitor_format']){logger['info'](_0xe1c5('0x3d'),_0xe1c5('0x3e'));_0x138134[_0xe1c5('0x3f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12753c[_0xe1c5('0x3b')],_0x138134['uniqueid'],md5(_0x138134['uniqueid']));}else{_0x138134[_0xe1c5('0x3f')]='';}headers['Authorization']=getAuth(_0x12753c);return getUser(_0x12753c,_0x448f70['email'])[_0xe1c5('0x1d')](function(_0x4d859c){_0x4a85cc=_0x4d859c;logger[_0xe1c5('0x9')](_0xe1c5('0x40'),_0x4a85cc['id']);return getEndUser(_0x12753c,_0x138134[_0xe1c5('0xd')],_0x138134[_0xe1c5('0xe')]);})[_0xe1c5('0x1d')](function(_0x314000){_0x1a2df5=_0x314000;logger[_0xe1c5('0x9')](_0xe1c5('0x41'),_0x1a2df5['id']);return getTicket(_0x12753c,_0x4a85cc,_0x1a2df5,_0x29abb3,_0x138134);})[_0xe1c5('0x1d')](function(_0x8b23dd){if(_0x8b23dd&&_0x8b23dd['id']){logger[_0xe1c5('0x9')](_0xe1c5('0x19'));logger[_0xe1c5('0x9')]('The\x20Ticket\x20ID\x20is:',_0x8b23dd['id']);logger[_0xe1c5('0x9')](_0xe1c5('0x3d'),_0xe1c5('0x42'));emit(util[_0xe1c5('0x17')]('user:%s',_0x448f70['name']),'trigger:browser:url',{'uri':util[_0xe1c5('0x17')](_0xe1c5('0x43'),_0x12753c['remoteUri'],_0x8b23dd['id'])});}})['catch'](function(_0x1a8071){logger[_0xe1c5('0x44')](_0xe1c5('0x3d'),JSON[_0xe1c5('0x45')](_0x1a8071));});};exports['outbound']=function(_0x5edb44,_0x1c9431,_0x509b16,_0x103296,_0x22aa69,_0x49200f,_0x406cf4){var _0x24f21b,_0x55c409;_0x49200f[_0xe1c5('0x1c')]=intUtil[_0xe1c5('0x3c')](_0x49200f['remoteUri']);_0x49200f[_0xe1c5('0x3b')]=intUtil['stripTrailingSlash'](_0x49200f[_0xe1c5('0x3b')]);if(_0x406cf4&&_0x406cf4[_0xe1c5('0x46')]&&_0x406cf4['recordingFormat']!=='none'){logger['info'](_0xe1c5('0x47'),'Recording\x20is\x20enabled!');_0x1c9431['recordingURL']=util[_0xe1c5('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49200f[_0xe1c5('0x3b')],_0x1c9431['uniqueid'],md5(_0x1c9431[_0xe1c5('0x48')]));}headers[_0xe1c5('0x49')]=getAuth(_0x49200f);return getUser(_0x49200f,_0x103296[_0xe1c5('0x20')])[_0xe1c5('0x1d')](function(_0x4e4228){_0x24f21b=_0x4e4228;logger[_0xe1c5('0x9')]('The\x20User\x20ID\x20is:',_0x24f21b['id']);return getEndUser(_0x49200f,_0x1c9431[_0xe1c5('0x4a')],_0x1c9431[_0xe1c5('0x4b')]);})['then'](function(_0x4b8360){_0x55c409=_0x4b8360;logger[_0xe1c5('0x9')]('The\x20Enduser\x20ID\x20is:',_0x55c409['id']);return getTicket(_0x49200f,_0x24f21b,_0x55c409,_0x509b16,_0x1c9431);})['then'](function(_0x4a3a46){if(_0x4a3a46&&_0x4a3a46['id']){logger[_0xe1c5('0x9')](_0xe1c5('0x19'));logger[_0xe1c5('0x9')](_0xe1c5('0x4c'),_0x4a3a46['id']);logger['info'](_0xe1c5('0x47'),_0xe1c5('0x42'));emit(util[_0xe1c5('0x17')]('user:%s',_0x103296['name']),_0xe1c5('0x4d'),{'uri':util[_0xe1c5('0x17')](_0xe1c5('0x43'),_0x49200f[_0xe1c5('0x1c')],_0x4a3a46['id'])});}})[_0xe1c5('0x4e')](function(_0x567128){logger['error']('[OUTBOUND]',JSON[_0xe1c5('0x45')](_0x567128));});};exports[_0xe1c5('0x4f')]=function(_0x56f0ea,_0xc7b928,_0x445741,_0x20ab57,_0x5c6df8,_0x1c5e87){var _0x1dda2d,_0x522249;_0x1c5e87[_0xe1c5('0x1c')]=intUtil[_0xe1c5('0x3c')](_0x1c5e87[_0xe1c5('0x1c')]);_0x1c5e87['serverUrl']=intUtil[_0xe1c5('0x3c')](_0x1c5e87[_0xe1c5('0x3b')]);if(_0x5c6df8&&_0x5c6df8[_0xe1c5('0x50')]){logger['info']('['+_0xc7b928[_0xe1c5('0x51')][_0xe1c5('0x52')]()+']',_0xe1c5('0x3e'));_0xc7b928[_0xe1c5('0x3f')]=util[_0xe1c5('0x17')](_0xe1c5('0x53'),_0x1c5e87[_0xe1c5('0x3b')],_0xc7b928[_0xe1c5('0x48')],md5(_0xc7b928['uniqueid']));}else{_0xc7b928['recordingURL']='';}headers[_0xe1c5('0x49')]=getAuth(_0x1c5e87);return getUser(_0x1c5e87,'')[_0xe1c5('0x1d')](function(_0x59716d){_0x1dda2d=_0x59716d;logger[_0xe1c5('0x9')](_0xe1c5('0x40'),_0x1dda2d['id']);return getEndUser(_0x1c5e87,_0xc7b928[_0xe1c5('0xd')],_0xc7b928[_0xe1c5('0xe')]);})[_0xe1c5('0x1d')](function(_0x1fa7ea){_0x522249=_0x1fa7ea;logger[_0xe1c5('0x9')](_0xe1c5('0x41'),_0x522249['id']);return getTicket(_0x1c5e87,_0x1dda2d,_0x522249,_0x445741,_0xc7b928);})['then'](function(_0x321db9){if(_0x321db9){logger[_0xe1c5('0x9')]('Ticket\x20created!');logger['info'](_0xe1c5('0x4c'),_0x321db9['id']);}})[_0xe1c5('0x4e')](function(_0x465c83){logger[_0xe1c5('0x44')]('['+_0xc7b928[_0xe1c5('0x51')][_0xe1c5('0x52')]()+']',JSON[_0xe1c5('0x45')](_0x465c83));});}; \ 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 a8c7a10..852df87 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 _0xcd3b=['user:%s','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','catch','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','POST','getString','Subjects','Contact','add','task','Task\x20created:','ticketId','/contacts/'];(function(_0x44ff4c,_0xe7fd1c){var _0x2615d5=function(_0xe9392e){while(--_0xe9392e){_0x44ff4c['push'](_0x44ff4c['shift']());}};_0x2615d5(++_0xe7fd1c);}(_0xcd3b,0x162));var _0xbcd3=function(_0x1b2220,_0x5603eb){_0x1b2220=_0x1b2220-0x0;var _0x3454e0=_0xcd3b[_0x1b2220];return _0x3454e0;};'use strict';var _=require(_0xbcd3('0x0'));var rp=require(_0xbcd3('0x1'));var md5=require('md5');var util=require(_0xbcd3('0x2'));var moment=require(_0xbcd3('0x3'));var Promise=require(_0xbcd3('0x4'));var Redis=require('ioredis');var intUtil=require(_0xbcd3('0x5'));var config=require(_0xbcd3('0x6'));var logger=require(_0xbcd3('0x7'))(_0xbcd3('0x8'));config['redis']=_[_0xbcd3('0x9')](config[_0xbcd3('0xa')],{'host':_0xbcd3('0xb'),'port':0x18eb});var io=require(_0xbcd3('0xc'))(new Redis(config[_0xbcd3('0xa')]));function getAdminId(_0x3b505a,_0x2b7be2,_0x5c2cdf,_0x5d4447){return new Promise(function(_0x440e45,_0x56966c){var _0x3dec90=![];var _0x1465c5={'method':_0xbcd3('0xd'),'uri':_0x5d4447+_0xbcd3('0xe'),'json':!![]};_0x1465c5[_0xbcd3('0xf')]=_0x5c2cdf;logger[_0xbcd3('0x10')](_0xbcd3('0x11'));return rp(_0x1465c5)[_0xbcd3('0x12')](function(_0x1d006e){if(_0x1d006e){var _0x57733c=_0x1d006e[_0xbcd3('0x13')];var _0x31ce69=null;for(_0x31ce69=0x0;_0x31ce69<_0x57733c[_0xbcd3('0x14')];_0x31ce69++){if(_0x57733c[_0x31ce69]['email']===_0x3b505a[_0xbcd3('0x15')]){_0x3b505a[_0xbcd3('0x16')]=_0x57733c[_0x31ce69]['id'];_0x3dec90=!![];}}if(_0x3dec90){logger['info'](_0xbcd3('0x17'),_0x3b505a['adminId']);_0x440e45(_0x3b505a);}else{_0x56966c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x56966c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xbcd3('0x18')](function(_0x413b2e){logger[_0xbcd3('0x19')]('['+[_0x2b7be2['toUpperCase']()]+']',_0x413b2e[_0xbcd3('0x1a')]);_0x56966c(_0x413b2e);});});}function getUser(_0x453b74,_0x32fe58,_0x5cf573){return function(_0x18d557){return new Promise(function(_0x3d3bfd,_0x32dee6){var _0x14eff1={'method':_0xbcd3('0xd'),'uri':_0x5cf573+'/api/selector/owners','json':!![]};_0x14eff1[_0xbcd3('0xf')]=_0x32fe58;logger['info'](_0xbcd3('0x1b'));return rp(_0x14eff1)[_0xbcd3('0x12')](function(_0x1ef2b3){if(_0x1ef2b3){var _0x2f4af9=_0x1ef2b3[_0xbcd3('0x13')];var _0x2e61f2=![];var _0x55f7a2=null;if(_0x18d557[_0xbcd3('0x1c')]!==null){logger[_0xbcd3('0x10')](_0xbcd3('0x1d'),_0x18d557[_0xbcd3('0x1c')]);_0x18d557[_0xbcd3('0x1e')]=_0x18d557[_0xbcd3('0x1c')];for(_0x55f7a2=0x0;_0x55f7a2<_0x2f4af9[_0xbcd3('0x14')];_0x55f7a2++){if(_0x2f4af9[_0x55f7a2][_0xbcd3('0x1f')]===_0x18d557[_0xbcd3('0x1c')]){_0x2e61f2=!![];_0x18d557[_0xbcd3('0x20')]=_0x2f4af9[_0x55f7a2]['id'];logger[_0xbcd3('0x10')](_0xbcd3('0x21'),_0x18d557['userId']);}}}if(!_0x2e61f2){logger['info'](_0xbcd3('0x22'));_0x18d557[_0xbcd3('0x1e')]=_0x18d557[_0xbcd3('0x15')];_0x18d557[_0xbcd3('0x20')]=_0x18d557[_0xbcd3('0x16')];_0x2e61f2=!![];}if(_0x2e61f2){_0x3d3bfd(_0x18d557);}else{_0x32dee6({'statusCode':0x194,'message':_0xbcd3('0x23')});}}else{_0x32dee6({'statusCode':0x194,'message':_0xbcd3('0x23')});}})['catch'](function(_0x2ae369){logger[_0xbcd3('0x19')]('['+[_0x453b74['toUpperCase']()]+']',_0x2ae369[_0xbcd3('0x1a')]);_0x32dee6(_0x2ae369);});});};}function searchContact(_0x54ca6e,_0x4a4a01,_0x353b0f,_0x45cff0){return new Promise(function(_0x56ff9e,_0x660b6f){var _0x2d296d={'method':_0xbcd3('0xd'),'headers':_0x4a4a01,'uri':_0x54ca6e+_0xbcd3('0x24')+_0x45cff0+_0xbcd3('0x25')+_0x353b0f+_0xbcd3('0x26'),'json':!![]};rp(_0x2d296d)['then'](function(_0xdf56be){var _0x2eb4fd=_[_0xbcd3('0x27')](_0xdf56be[_0xbcd3('0x28')][_0xbcd3('0x28')],[_0x353b0f,_0x45cff0]);_0x56ff9e(_0x2eb4fd);})[_0xbcd3('0x18')](function(_0x559761){_0x660b6f(_0x559761);});});}function getEndUser(_0x519dd6,_0x2c34e4,_0x19ee6f){return function(_0x467b8b){return new Promise(function(_0x382c12,_0xcb4d1a){logger[_0xbcd3('0x10')](util['format'](_0xbcd3('0x29'),_0x467b8b[_0xbcd3('0x2a')]));searchContact(_0x19ee6f,_0x2c34e4,'mobile_number',_0x467b8b['contactNumber'])['then'](function(_0x309b99){if(_0x309b99){_0x467b8b[_0xbcd3('0x2b')]=_0x309b99['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x467b8b[_0xbcd3('0x2b')]);return _0x382c12(_0x467b8b);}searchContact(_0x19ee6f,_0x2c34e4,'work_number',_0x467b8b[_0xbcd3('0x2a')])[_0xbcd3('0x12')](function(_0x490700){if(_0x490700){_0x467b8b[_0xbcd3('0x2b')]=_0x490700['id'];logger[_0xbcd3('0x10')](_0xbcd3('0x2c'),_0x467b8b[_0xbcd3('0x2b')]);return _0x382c12(_0x467b8b);}createEndUser(_0x467b8b,_0x519dd6,_0x2c34e4,_0x19ee6f)['then'](function(_0x178b77){logger[_0xbcd3('0x10')](_0xbcd3('0x2d'),_0x178b77['endUserId']);return _0x382c12(_0x178b77);});});})[_0xbcd3('0x18')](function(_0x2f42d1){_0xcb4d1a(_0x2f42d1);});});};}function createEndUser(_0x2577b2,_0x45e1d5,_0x350432,_0x1245be){return new Promise(function(_0x5a0ed1,_0x22aa99){var _0x49480d=moment();var _0x382570={'method':'POST','uri':_0x1245be+_0xbcd3('0x2e'),'body':{'contact':{'last_name':_0x2577b2['contactNumber'],'work_number':_0x2577b2[_0xbcd3('0x2a')],'mobile_number':_0x2577b2[_0xbcd3('0x2a')],'owner_id':_0x2577b2['userId'],'created_at':_0x49480d[_0xbcd3('0x2f')](_0xbcd3('0x30'))}},'json':!![]};_0x382570[_0xbcd3('0xf')]=_0x350432;logger[_0xbcd3('0x10')](_0xbcd3('0x31'));return rp(_0x382570)[_0xbcd3('0x12')](function(_0x2f136c){_0x2577b2[_0xbcd3('0x2b')]=_0x2f136c[_0xbcd3('0x32')]['id'];_0x5a0ed1(_0x2577b2);})[_0xbcd3('0x18')](function(_0x4d49ff){logger['error']('['+[_0x45e1d5[_0xbcd3('0x33')]()]+']',_0x4d49ff[_0xbcd3('0x1a')]);_0x22aa99(_0x4d49ff[_0xbcd3('0x1a')]);});});}function getTicket(_0x4b6b25,_0x2934a1,_0x38d9ba,_0x8944c4,_0x28a8da){return function(_0x337bb2){logger[_0xbcd3('0x10')]('Creating\x20new\x20task');return new Promise(function(_0x3380e9,_0x24f9b9){var _0x517294=moment();var _0x38f3e3={'method':_0xbcd3('0x34'),'uri':_0x38d9ba+'/api/tasks','body':{'title':intUtil[_0xbcd3('0x35')](_0x8944c4[_0xbcd3('0x36')],_0x28a8da,'\x20'),'description':intUtil[_0xbcd3('0x35')](_0x8944c4['Descriptions'],_0x28a8da,'\x0a'),'owner_id':_0x337bb2[_0xbcd3('0x20')],'creater_id':_0x337bb2[_0xbcd3('0x16')],'targetable_id':_0x337bb2[_0xbcd3('0x2b')],'targetable_type':_0xbcd3('0x37'),'created_at':_0x517294[_0xbcd3('0x2f')](_0xbcd3('0x30')),'due_date':_0x517294[_0xbcd3('0x38')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x38f3e3[_0xbcd3('0xf')]=_0x2934a1;return rp(_0x38f3e3)[_0xbcd3('0x12')](function(_0x51c05b){_0x337bb2['ticketId']=_0x51c05b[_0xbcd3('0x39')]['id'];logger[_0xbcd3('0x10')](_0xbcd3('0x3a'),_0x337bb2[_0xbcd3('0x3b')]);_0x3380e9(_0x337bb2);})[_0xbcd3('0x18')](function(_0x56c869){logger[_0xbcd3('0x19')]('['+[_0x4b6b25[_0xbcd3('0x33')]()]+']',_0x56c869[_0xbcd3('0x1a')]);_0x24f9b9(_0x56c869[_0xbcd3('0x1a')]);});});};}function emit(_0x30ca57,_0x50c4bc,_0x1cf634){var _0x39beaa={'uri':_0x30ca57+_0xbcd3('0x3c')+_0x1cf634};io['to'](util['format'](_0xbcd3('0x3d'),_0x50c4bc))['emit']('trigger:browser:url',_0x39beaa);}exports['cs']=function(_0x59bd90,_0x1b7e96,_0x1aff13,_0x2ba93a,_0x143f51,_0x39ee8d,_0x19004c,_0xc8bd1d){var _0x58e038={};var _0x1825ae={'Authorization':_0xbcd3('0x3e')+_0x39ee8d[_0xbcd3('0x3f')]};_0x39ee8d[_0xbcd3('0x40')]=intUtil[_0xbcd3('0x41')](_0x39ee8d[_0xbcd3('0x40')]);_0x39ee8d['serverUrl']=intUtil[_0xbcd3('0x41')](_0x39ee8d[_0xbcd3('0x42')]);var _0x23a8d6=_0x39ee8d['remoteUri'];_0x58e038[_0xbcd3('0x15')]=_0x39ee8d[_0xbcd3('0x43')];_0x58e038[_0xbcd3('0x2a')]=_0xc8bd1d[_0xbcd3('0x44')]()===_0xbcd3('0x45')?_0x1b7e96['destcalleridnum']:_0x1b7e96['calleridnum'];_0x58e038[_0xbcd3('0x46')]=_0xc8bd1d==='queue'||_0xc8bd1d===_0xbcd3('0x47')?_0xbcd3('0x48'):_0xbcd3('0x45');if(_0x2ba93a){_0x58e038[_0xbcd3('0x1c')]=_0x2ba93a[_0xbcd3('0x1f')];}var _0x48c625=util[_0xbcd3('0x2f')](_0xbcd3('0x49'),_0x39ee8d[_0xbcd3('0x42')],_0x1b7e96[_0xbcd3('0x4a')],md5(_0x1b7e96[_0xbcd3('0x4a')]));if(_0x143f51&&_0x143f51['monitor_format']){logger['info'](_0xbcd3('0x4b'),_0xbcd3('0x4c'));_0x1b7e96[_0xbcd3('0x4d')]=_0x48c625;}else if(_0x19004c&&_0x19004c[_0xbcd3('0x4e')]&&_0x19004c[_0xbcd3('0x4e')]!=='none'){logger[_0xbcd3('0x10')](_0xbcd3('0x4f'),_0xbcd3('0x4c'));_0x1b7e96[_0xbcd3('0x4d')]=_0x48c625;}else{_0x1b7e96[_0xbcd3('0x4d')]='';}return getAdminId(_0x58e038,_0xc8bd1d,_0x1825ae,_0x23a8d6)[_0xbcd3('0x12')](getUser(_0xc8bd1d,_0x1825ae,_0x23a8d6))[_0xbcd3('0x12')](getEndUser(_0xc8bd1d,_0x1825ae,_0x23a8d6))[_0xbcd3('0x12')](getTicket(_0xc8bd1d,_0x1825ae,_0x23a8d6,_0x1aff13,_0x1b7e96))[_0xbcd3('0x12')](function(_0x4c47fb){logger[_0xbcd3('0x10')](util[_0xbcd3('0x2f')](_0xbcd3('0x50'),_0x4c47fb[_0xbcd3('0x3b')]));if(_0xc8bd1d!==_0xbcd3('0x47')){logger[_0xbcd3('0x10')]('['+[_0xc8bd1d[_0xbcd3('0x33')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x23a8d6,_0x2ba93a[_0xbcd3('0x51')],_0x4c47fb[_0xbcd3('0x2b')]);}})[_0xbcd3('0x18')](function(_0x591c13){logger[_0xbcd3('0x19')]('['+[_0xc8bd1d[_0xbcd3('0x33')]()]+_0xbcd3('0x52'),util['inspect'](_0x591c13,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3075=['agentEmail','userId','User\x20found:','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','GET','headers','info','then','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','userEmail'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0x3075,0x134));var _0x5307=function(_0x25ef03,_0x5d5bcd){_0x25ef03=_0x25ef03-0x0;var _0x528716=_0x3075[_0x25ef03];return _0x528716;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x5307('0x0'));var util=require(_0x5307('0x1'));var moment=require(_0x5307('0x2'));var Promise=require(_0x5307('0x3'));var Redis=require('ioredis');var intUtil=require(_0x5307('0x4'));var config=require(_0x5307('0x5'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0x5307('0x6')](config[_0x5307('0x7')],{'host':_0x5307('0x8'),'port':0x18eb});var io=require(_0x5307('0x9'))(new Redis(config[_0x5307('0x7')]));function getAdminId(_0x55c453,_0x49dd57,_0x404aa5,_0x337389){return new Promise(function(_0x5c31be,_0x2f314b){var _0x8ec9b3=![];var _0x209f5f={'method':_0x5307('0xa'),'uri':_0x337389+'/api/selector/owners','json':!![]};_0x209f5f[_0x5307('0xb')]=_0x404aa5;logger[_0x5307('0xc')]('Getting\x20admin\x20information');return rp(_0x209f5f)[_0x5307('0xd')](function(_0x599890){if(_0x599890){var _0x27e4fc=_0x599890[_0x5307('0xe')];var _0x1e3048=null;for(_0x1e3048=0x0;_0x1e3048<_0x27e4fc[_0x5307('0xf')];_0x1e3048++){if(_0x27e4fc[_0x1e3048][_0x5307('0x10')]===_0x55c453[_0x5307('0x11')]){_0x55c453['adminId']=_0x27e4fc[_0x1e3048]['id'];_0x8ec9b3=!![];}}if(_0x8ec9b3){logger['info'](_0x5307('0x12'),_0x55c453[_0x5307('0x13')]);_0x5c31be(_0x55c453);}else{_0x2f314b({'statusCode':0x194,'message':_0x5307('0x14')});}}else{_0x2f314b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x5307('0x15')](function(_0x38b462){logger['error']('['+[_0x49dd57[_0x5307('0x16')]()]+']',_0x38b462[_0x5307('0x17')]);_0x2f314b(_0x38b462);});});}function getUser(_0x38b860,_0x24c5f0,_0x3d1e19){return function(_0x2b62b0){return new Promise(function(_0x1e0d31,_0x2f38f9){var _0x312d6c={'method':_0x5307('0xa'),'uri':_0x3d1e19+_0x5307('0x18'),'json':!![]};_0x312d6c['headers']=_0x24c5f0;logger[_0x5307('0xc')](_0x5307('0x19'));return rp(_0x312d6c)[_0x5307('0xd')](function(_0x37754a){if(_0x37754a){var _0x3a8692=_0x37754a['users'];var _0x4ef4de=![];var _0x7853b2=null;if(_0x2b62b0['agentEmail']!==null){logger[_0x5307('0xc')](_0x5307('0x1a'),_0x2b62b0['agentEmail']);_0x2b62b0[_0x5307('0x1b')]=_0x2b62b0[_0x5307('0x1c')];for(_0x7853b2=0x0;_0x7853b2<_0x3a8692[_0x5307('0xf')];_0x7853b2++){if(_0x3a8692[_0x7853b2][_0x5307('0x10')]===_0x2b62b0[_0x5307('0x1c')]){_0x4ef4de=!![];_0x2b62b0[_0x5307('0x1d')]=_0x3a8692[_0x7853b2]['id'];logger[_0x5307('0xc')](_0x5307('0x1e'),_0x2b62b0[_0x5307('0x1d')]);}}}if(!_0x4ef4de){logger['info'](_0x5307('0x1f'));_0x2b62b0['userEmail']=_0x2b62b0[_0x5307('0x11')];_0x2b62b0[_0x5307('0x1d')]=_0x2b62b0[_0x5307('0x13')];_0x4ef4de=!![];}if(_0x4ef4de){_0x1e0d31(_0x2b62b0);}else{_0x2f38f9({'statusCode':0x194,'message':_0x5307('0x14')});}}else{_0x2f38f9({'statusCode':0x194,'message':_0x5307('0x14')});}})[_0x5307('0x15')](function(_0x2832d2){logger[_0x5307('0x20')]('['+[_0x38b860[_0x5307('0x16')]()]+']',_0x2832d2['message']);_0x2f38f9(_0x2832d2);});});};}function searchContact(_0x4b5226,_0xebae61,_0x8b49a,_0x8589fc){return new Promise(function(_0x5728ea,_0x2323cd){var _0x27b9ed={'method':_0x5307('0xa'),'headers':_0xebae61,'uri':_0x4b5226+_0x5307('0x21')+_0x8589fc+_0x5307('0x22')+_0x8b49a+_0x5307('0x23'),'json':!![]};rp(_0x27b9ed)[_0x5307('0xd')](function(_0x59a806){var _0xf87be=_[_0x5307('0x24')](_0x59a806[_0x5307('0x25')][_0x5307('0x25')],[_0x8b49a,_0x8589fc]);_0x5728ea(_0xf87be);})[_0x5307('0x15')](function(_0x5b5993){_0x2323cd(_0x5b5993);});});}function getEndUser(_0x318956,_0x6eed84,_0x5b7756){return function(_0x2ddbd1){return new Promise(function(_0x3ebdb0,_0x456c3c){logger[_0x5307('0xc')](util['format'](_0x5307('0x26'),_0x2ddbd1[_0x5307('0x27')]));searchContact(_0x5b7756,_0x6eed84,_0x5307('0x28'),_0x2ddbd1[_0x5307('0x27')])['then'](function(_0x4fb815){if(_0x4fb815){_0x2ddbd1[_0x5307('0x29')]=_0x4fb815['id'];logger[_0x5307('0xc')](_0x5307('0x2a'),_0x2ddbd1[_0x5307('0x29')]);return _0x3ebdb0(_0x2ddbd1);}searchContact(_0x5b7756,_0x6eed84,_0x5307('0x2b'),_0x2ddbd1[_0x5307('0x27')])[_0x5307('0xd')](function(_0x41c826){if(_0x41c826){_0x2ddbd1[_0x5307('0x29')]=_0x41c826['id'];logger[_0x5307('0xc')](_0x5307('0x2c'),_0x2ddbd1[_0x5307('0x29')]);return _0x3ebdb0(_0x2ddbd1);}createEndUser(_0x2ddbd1,_0x318956,_0x6eed84,_0x5b7756)[_0x5307('0xd')](function(_0x95d85a){logger[_0x5307('0xc')](_0x5307('0x2d'),_0x95d85a[_0x5307('0x29')]);return _0x3ebdb0(_0x95d85a);});});})[_0x5307('0x15')](function(_0x394696){_0x456c3c(_0x394696);});});};}function createEndUser(_0xfb3ffd,_0x289dac,_0x50f29e,_0x48c937){return new Promise(function(_0x486ebe,_0x1deeff){var _0x1d93b4=moment();var _0x108aac={'method':_0x5307('0x2e'),'uri':_0x48c937+_0x5307('0x2f'),'body':{'contact':{'last_name':_0xfb3ffd[_0x5307('0x27')],'work_number':_0xfb3ffd['contactNumber'],'mobile_number':_0xfb3ffd[_0x5307('0x27')],'owner_id':_0xfb3ffd['userId'],'created_at':_0x1d93b4[_0x5307('0x30')](_0x5307('0x31'))}},'json':!![]};_0x108aac[_0x5307('0xb')]=_0x50f29e;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x108aac)[_0x5307('0xd')](function(_0x3d26d3){_0xfb3ffd[_0x5307('0x29')]=_0x3d26d3['contact']['id'];_0x486ebe(_0xfb3ffd);})[_0x5307('0x15')](function(_0x3a21d0){logger[_0x5307('0x20')]('['+[_0x289dac[_0x5307('0x16')]()]+']',_0x3a21d0[_0x5307('0x17')]);_0x1deeff(_0x3a21d0[_0x5307('0x17')]);});});}function getTicket(_0x14d234,_0x23a519,_0x11dafb,_0x41e67b,_0x29c968){return function(_0x1da1ce){logger[_0x5307('0xc')](_0x5307('0x32'));return new Promise(function(_0x20c8df,_0x2deb0c){var _0x35e73b=moment();var _0x458a98={'method':_0x5307('0x2e'),'uri':_0x11dafb+_0x5307('0x33'),'body':{'title':intUtil[_0x5307('0x34')](_0x41e67b['Subjects'],_0x29c968,'\x20'),'description':intUtil[_0x5307('0x34')](_0x41e67b[_0x5307('0x35')],_0x29c968,'\x0a'),'owner_id':_0x1da1ce['userId'],'creater_id':_0x1da1ce['adminId'],'targetable_id':_0x1da1ce[_0x5307('0x29')],'targetable_type':'Contact','created_at':_0x35e73b[_0x5307('0x30')](_0x5307('0x31')),'due_date':_0x35e73b[_0x5307('0x36')](0x1e,'m')[_0x5307('0x30')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x458a98[_0x5307('0xb')]=_0x23a519;return rp(_0x458a98)[_0x5307('0xd')](function(_0x2da6cb){_0x1da1ce['ticketId']=_0x2da6cb[_0x5307('0x37')]['id'];logger[_0x5307('0xc')](_0x5307('0x38'),_0x1da1ce[_0x5307('0x39')]);_0x20c8df(_0x1da1ce);})[_0x5307('0x15')](function(_0x56a4d4){logger[_0x5307('0x20')]('['+[_0x14d234[_0x5307('0x16')]()]+']',_0x56a4d4[_0x5307('0x17')]);_0x2deb0c(_0x56a4d4[_0x5307('0x17')]);});});};}function emit(_0x18c218,_0x391f32,_0x1e2f3c){var _0x508fcc={'uri':_0x18c218+_0x5307('0x3a')+_0x1e2f3c};io['to'](util[_0x5307('0x30')](_0x5307('0x3b'),_0x391f32))[_0x5307('0x3c')](_0x5307('0x3d'),_0x508fcc);}exports['cs']=function(_0x44cbeb,_0xe530cd,_0x1f63c5,_0x19c4e0,_0x562c00,_0x16ac1,_0x219e69,_0x1c2cd8){var _0x427627={};var _0x5470e5={'Authorization':_0x5307('0x3e')+_0x16ac1['apiKey']};_0x16ac1[_0x5307('0x3f')]=intUtil[_0x5307('0x40')](_0x16ac1[_0x5307('0x3f')]);_0x16ac1[_0x5307('0x41')]=intUtil[_0x5307('0x40')](_0x16ac1[_0x5307('0x41')]);var _0x8988d3=_0x16ac1[_0x5307('0x3f')];_0x427627[_0x5307('0x11')]=_0x16ac1[_0x5307('0x42')];_0x427627[_0x5307('0x27')]=_0x1c2cd8['toLowerCase']()===_0x5307('0x43')?_0xe530cd[_0x5307('0x44')]:_0xe530cd[_0x5307('0x45')];_0x427627[_0x5307('0x46')]=_0x1c2cd8==='queue'||_0x1c2cd8===_0x5307('0x47')?_0x5307('0x48'):_0x5307('0x43');if(_0x19c4e0){_0x427627[_0x5307('0x1c')]=_0x19c4e0[_0x5307('0x10')];}var _0x76cf37=util[_0x5307('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x16ac1[_0x5307('0x41')],_0xe530cd['uniqueid'],md5(_0xe530cd[_0x5307('0x49')]));if(_0x562c00&&_0x562c00[_0x5307('0x4a')]){logger['info']('[QUEUE]',_0x5307('0x4b'));_0xe530cd['recordingURL']=_0x76cf37;}else if(_0x219e69&&_0x219e69['recordingFormat']&&_0x219e69[_0x5307('0x4c')]!==_0x5307('0x4d')){logger[_0x5307('0xc')](_0x5307('0x4e'),_0x5307('0x4b'));_0xe530cd['recordingURL']=_0x76cf37;}else{_0xe530cd[_0x5307('0x4f')]='';}return getAdminId(_0x427627,_0x1c2cd8,_0x5470e5,_0x8988d3)[_0x5307('0xd')](getUser(_0x1c2cd8,_0x5470e5,_0x8988d3))[_0x5307('0xd')](getEndUser(_0x1c2cd8,_0x5470e5,_0x8988d3))[_0x5307('0xd')](getTicket(_0x1c2cd8,_0x5470e5,_0x8988d3,_0x1f63c5,_0xe530cd))[_0x5307('0xd')](function(_0x506d9b){logger[_0x5307('0xc')](util['format'](_0x5307('0x50'),_0x506d9b[_0x5307('0x39')]));if(_0x1c2cd8!==_0x5307('0x47')){logger[_0x5307('0xc')]('['+[_0x1c2cd8[_0x5307('0x16')]()]+']',_0x5307('0x51'));emit(_0x8988d3,_0x19c4e0['name'],_0x506d9b[_0x5307('0x29')]);}})[_0x5307('0x15')](function(_0x40384f){logger['error']('['+[_0x1c2cd8[_0x5307('0x16')]()]+_0x5307('0x52'),util[_0x5307('0x53')](_0x40384f,{'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 aee9911..664e77f 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 _0x9416=['queue','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','zoho','desk','vtiger','freshsales','servicenow','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','error','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','dynamics365','includes','data1','toLowerCase','find'];(function(_0x28317f,_0x57883a){var _0x44bfc9=function(_0x69755c){while(--_0x69755c){_0x28317f['push'](_0x28317f['shift']());}};_0x44bfc9(++_0x57883a);}(_0x9416,0xf0));var _0x6941=function(_0x5d2977,_0x3e7573){_0x5d2977=_0x5d2977-0x0;var _0x173c79=_0x9416[_0x5d2977];return _0x173c79;};'use strict';var _=require(_0x6941('0x0'));var util=require(_0x6941('0x1'));var zendesk=require(_0x6941('0x2'));var salesforce=require(_0x6941('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x6941('0x4'));var zoho=require(_0x6941('0x5'));var desk=require(_0x6941('0x6'));var vtiger=require(_0x6941('0x7'));var servicenow=require(_0x6941('0x8'));var dynamics365=require(_0x6941('0x9'));var freshsales=require(_0x6941('0xa'));var integrations=[_0x6941('0xb'),_0x6941('0xc'),'sugarcrm',_0x6941('0xd'),'zoho','desk','vtiger',_0x6941('0xe'),'freshsales','servicenow'];exports['exec']=function(_0x2970ed,_0x84c3f9,_0x5e62a4,_0x2a0b84,_0x50d41a,_0x55e04c){if(_0x5e62a4){if(_[_0x6941('0xf')](integrations,_0x2970ed[_0x6941('0x10')][_0x6941('0x11')]())){try{var _0x5278fc=null;var _0x39b514='';var _0xca528c=_0x5e62a4[_0x2970ed[_0x6941('0x10')][_0x6941('0x11')]()];if(_0xca528c){var _0x36c326=_0xca528c[_0x2970ed['data2']];if(_0x36c326){var _0x35fd1d=_[_0x6941('0x12')](_0x36c326['Configurations'],{'id':parseInt(_0x2970ed['data3'],0xa)});if(_0x35fd1d){if(_0x2a0b84){if(_0x50d41a&&_0x84c3f9[_0x6941('0x13')]){_0x39b514=_0x6941('0x13');}else if(_0x84c3f9['routeId']){_0x39b514='outbound';}else{console[_0x6941('0x14')](_0x6941('0x15'),_0x84c3f9);}}else{_0x39b514=_0x6941('0x16');}switch(_0x2970ed[_0x6941('0x10')][_0x6941('0x11')]()){case'zendesk':zendesk[_0x39b514](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c);break;case'salesforce':salesforce[_0x39b514](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c);break;case _0x6941('0x17'):sugarcrm[_0x39b514](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c);break;case _0x6941('0xd'):freshdesk[_0x39b514](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c);break;case _0x6941('0x18'):zoho[_0x39b514](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c);break;case _0x6941('0x19'):desk[_0x39b514](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c);break;case _0x6941('0x1a'):vtiger[_0x39b514](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c);break;case _0x6941('0x1b'):freshsales['cs'](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c,_0x39b514);break;case _0x6941('0x1c'):servicenow['cs'](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c,_0x39b514);break;case _0x6941('0xe'):dynamics365['cs'](_0x2970ed,_0x84c3f9,_0x35fd1d,_0x2a0b84,_0x50d41a,_0x36c326,_0x55e04c,_0x39b514);break;default:console[_0x6941('0x14')](_0x6941('0x1d'));}}else{_0x5278fc=require(_0x6941('0x1e'))(_0x2970ed[_0x6941('0x10')][_0x6941('0x11')]());_0x5278fc['error'](_0x6941('0x1f'),util[_0x6941('0x20')](_0x6941('0x21'),_0x2970ed[_0x6941('0x10')]['toLowerCase'](),_0x2970ed[_0x6941('0x22')]));}}else{_0x5278fc=require(_0x6941('0x1e'))(_0x2970ed[_0x6941('0x10')][_0x6941('0x11')]());_0x5278fc['error'](_0x6941('0x1f'),util[_0x6941('0x20')](_0x6941('0x23'),_0x2970ed[_0x6941('0x10')][_0x6941('0x11')](),_0x2970ed['data2']));}}else{}}catch(_0x118d7c){console[_0x6941('0x24')](_0x118d7c);}}}}; \ No newline at end of file +var _0xb368=['Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','zoho','desk','vtiger','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','freshsales','data1','toLowerCase','find'];(function(_0x584e3e,_0x16fe93){var _0x2ff398=function(_0x2e7626){while(--_0x2e7626){_0x584e3e['push'](_0x584e3e['shift']());}};_0x2ff398(++_0x16fe93);}(_0xb368,0x17d));var _0x8b36=function(_0x140a1b,_0x2f5485){_0x140a1b=_0x140a1b-0x0;var _0x12be2c=_0xb368[_0x140a1b];return _0x12be2c;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x8b36('0x0'));var salesforce=require(_0x8b36('0x1'));var sugarcrm=require(_0x8b36('0x2'));var freshdesk=require(_0x8b36('0x3'));var zoho=require('./zoho');var desk=require(_0x8b36('0x4'));var vtiger=require(_0x8b36('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x8b36('0x6'));var freshsales=require(_0x8b36('0x7'));var integrations=[_0x8b36('0x8'),'salesforce',_0x8b36('0x9'),_0x8b36('0xa'),'zoho','desk','vtiger','dynamics365',_0x8b36('0xb'),'servicenow'];exports['exec']=function(_0x4c730a,_0x535e19,_0x3774c1,_0x381232,_0x3fe262,_0x40f89d){if(_0x3774c1){if(_['includes'](integrations,_0x4c730a['data1']['toLowerCase']())){try{var _0x4290cc=null;var _0x1bf674='';var _0x47af8d=_0x3774c1[_0x4c730a[_0x8b36('0xc')][_0x8b36('0xd')]()];if(_0x47af8d){var _0x460943=_0x47af8d[_0x4c730a['data2']];if(_0x460943){var _0x2bb15e=_[_0x8b36('0xe')](_0x460943[_0x8b36('0xf')],{'id':parseInt(_0x4c730a[_0x8b36('0x10')],0xa)});if(_0x2bb15e){if(_0x381232){if(_0x3fe262&&_0x535e19[_0x8b36('0x11')]){_0x1bf674=_0x8b36('0x11');}else if(_0x535e19[_0x8b36('0x12')]){_0x1bf674=_0x8b36('0x13');}else{console[_0x8b36('0x14')](_0x8b36('0x15'),_0x535e19);}}else{_0x1bf674=_0x8b36('0x16');}switch(_0x4c730a[_0x8b36('0xc')][_0x8b36('0xd')]()){case'zendesk':zendesk[_0x1bf674](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d);break;case _0x8b36('0x17'):salesforce[_0x1bf674](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d);break;case _0x8b36('0x9'):sugarcrm[_0x1bf674](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d);break;case'freshdesk':freshdesk[_0x1bf674](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d);break;case _0x8b36('0x18'):zoho[_0x1bf674](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d);break;case _0x8b36('0x19'):desk[_0x1bf674](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d);break;case _0x8b36('0x1a'):vtiger[_0x1bf674](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d);break;case _0x8b36('0xb'):freshsales['cs'](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d,_0x1bf674);break;case _0x8b36('0x1b'):servicenow['cs'](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d,_0x1bf674);break;case _0x8b36('0x1c'):dynamics365['cs'](_0x4c730a,_0x535e19,_0x2bb15e,_0x381232,_0x3fe262,_0x460943,_0x40f89d,_0x1bf674);break;default:console[_0x8b36('0x14')](_0x8b36('0x1d'));}}else{_0x4290cc=require(_0x8b36('0x1e'))(_0x4c730a[_0x8b36('0xc')][_0x8b36('0xd')]());_0x4290cc[_0x8b36('0x1f')](_0x8b36('0x20'),util[_0x8b36('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0x4c730a['data1']['toLowerCase'](),_0x4c730a[_0x8b36('0x10')]));}}else{_0x4290cc=require(_0x8b36('0x1e'))(_0x4c730a['data1'][_0x8b36('0xd')]());_0x4290cc[_0x8b36('0x1f')](_0x8b36('0x20'),util[_0x8b36('0x21')](_0x8b36('0x22'),_0x4c730a[_0x8b36('0xc')]['toLowerCase'](),_0x4c730a[_0x8b36('0x23')]));}}else{}}catch(_0x32cdaa){console[_0x8b36('0x1f')](_0x32cdaa);}}}}; \ 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 6e74f13..9455086 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 _0x0bff=['jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','IsRecurrence','contact','endUserType','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','validateEmail','sobject','User','find','execute','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Company','format','upperFirst','create','forEach','string','idField','content','toString','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','login','username','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','email','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','isNil','calleridname',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird'];(function(_0x14a489,_0x83c2dc){var _0x48591c=function(_0x5d8b7c){while(--_0x5d8b7c){_0x14a489['push'](_0x14a489['shift']());}};_0x48591c(++_0x83c2dc);}(_0x0bff,0x17a));var _0xf0bf=function(_0x42f216,_0x47ebad){_0x42f216=_0x42f216-0x0;var _0x15f4eb=_0x0bff[_0x42f216];return _0x15f4eb;};'use strict';var _=require('lodash');var rp=require(_0xf0bf('0x0'));var moment=require(_0xf0bf('0x1'));var BPromise=require(_0xf0bf('0x2'));var md5=require('md5');var jsforce=require(_0xf0bf('0x3'));var util=require(_0xf0bf('0x4'));var Redis=require(_0xf0bf('0x5'));var intUtil=require(_0xf0bf('0x6'));var config=require(_0xf0bf('0x7'));var logger=require(_0xf0bf('0x8'))(_0xf0bf('0x9'));config['redis']=_['defaults'](config[_0xf0bf('0xa')],{'host':_0xf0bf('0xb'),'port':0x18eb});var io=require(_0xf0bf('0xc'))(new Redis(config[_0xf0bf('0xa')]));function emit(_0x39f823,_0x364bcd,_0x38240b){io['to'](_0x39f823)[_0xf0bf('0xd')](_0x364bcd,_0x38240b);}function getTicket(_0xd2347a,_0x18d9cd,_0x4ff763,_0x14d5da,_0x457a7c,_0x2dac5b,_0x18ce2a,_0x32a9d1){var _0x1c9f84=Object[_0xf0bf('0xe')]({},{'OwnerId':_0x18d9cd['id'],'Subject':intUtil[_0xf0bf('0xf')](_0x14d5da[_0xf0bf('0x10')],_0x457a7c,'\x20'),'Description':intUtil[_0xf0bf('0xf')](_0x14d5da[_0xf0bf('0x11')],_0x457a7c,'\x0a')},getCustomFields(_0x2dac5b,_0x457a7c));if(_0x4ff763){if(_0x14d5da[_0xf0bf('0x12')]===_0xf0bf('0x13')){_0x1c9f84['ActivityDate']=moment['utc']();_0x1c9f84['IsReminderSet']=![];_0x1c9f84[_0xf0bf('0x14')]=![];if(_0x4ff763['endUserType']===_0xf0bf('0x15')||_0x4ff763[_0xf0bf('0x16')]===_0xf0bf('0x17')){_0x1c9f84[_0xf0bf('0x18')]=_0x4ff763['id'];}else if(_0x4ff763[_0xf0bf('0x16')]===_0xf0bf('0x19')){_0x1c9f84[_0xf0bf('0x1a')]=_0x4ff763['id'];}}else if(_0x14d5da[_0xf0bf('0x12')]===_0xf0bf('0x1b')){if(_0x4ff763[_0xf0bf('0x16')]==='contact'){_0x1c9f84[_0xf0bf('0x1c')]=_0x4ff763['id'];}else if(_0x4ff763[_0xf0bf('0x16')]==='account'){_0x1c9f84[_0xf0bf('0x1d')]=_0x4ff763['id'];}else if(_0x4ff763[_0xf0bf('0x16')]===_0xf0bf('0x17')&&_0x14d5da[_0xf0bf('0x1e')]){_0x1c9f84[_0x14d5da[_0xf0bf('0x1e')]]=_0x4ff763['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x18ce2a['sobject'](_0x14d5da['ticketType'])['create'](_0x1c9f84);}function getUser(_0x2f5d34,_0x10a333,_0x22515e){if(!_['isNil'](_0x10a333)&&intUtil[_0xf0bf('0x1f')](_0x10a333)){var _0x53c8d3={'Email':_0x10a333};var _0x414e74={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x22515e[_0xf0bf('0x20')](_0xf0bf('0x21'))[_0xf0bf('0x22')](_0x53c8d3,_0x414e74)[_0xf0bf('0x23')]()['then'](function(_0x401fa6){if(_0x401fa6[_0xf0bf('0x24')]){var _0x515129=_['find'](_0x401fa6,function(_0x59a05e){return _0x59a05e[_0xf0bf('0x25')]===_0x10a333;});if(_0x515129){logger[_0xf0bf('0x26')](_0xf0bf('0x27'),_0x10a333);return BPromise[_0xf0bf('0x28')]({'id':_0x515129['Id'],'name':_0x515129[_0xf0bf('0x29')]});}}else{logger[_0xf0bf('0x26')](_0xf0bf('0x2a'),_0x10a333);return _0x22515e[_0xf0bf('0x2b')]()[_0xf0bf('0x2c')](function(_0x2922a9){return BPromise['resolve']({'id':_0x2922a9[_0xf0bf('0x2d')],'name':_0x2922a9[_0xf0bf('0x2e')]});});}});}else{logger[_0xf0bf('0x26')](_0xf0bf('0x2a'),_0x10a333);return _0x22515e['identity']()[_0xf0bf('0x2c')](function(_0x26aaf1){return BPromise[_0xf0bf('0x28')]({'id':_0x26aaf1[_0xf0bf('0x2d')],'name':_0x26aaf1['display_name']});});}}function getEndUser(_0x2c605a,_0x8a5ed1,_0x3e81d9,_0x3c6728,_0x43d500){var _0x678bfa={'$or':{'Phone':_0x3c6728}};var _0x544248={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf0bf('0x28')]()[_0xf0bf('0x2c')](function(){logger[_0xf0bf('0x26')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3c6728,_0x8a5ed1[_0xf0bf('0x2f')]);switch(_0x8a5ed1[_0xf0bf('0x2f')]){case _0xf0bf('0x30'):var _0x296a32=_[_0xf0bf('0x31')](_0x678bfa);if(_0x8a5ed1[_0xf0bf('0x32')]){var _0x4edaa2={};_0x4edaa2[_0x8a5ed1[_0xf0bf('0x32')]]=_0x3c6728;_[_0xf0bf('0x33')](_0x296a32[_0xf0bf('0x34')],_0x4edaa2);}return _0x43d500['sobject'](_0xf0bf('0x35'))[_0xf0bf('0x22')](_0x296a32,_0x544248)['execute']()['then'](function(_0x51aa1e){if(_0x51aa1e&&_0x51aa1e[_0xf0bf('0x24')]){return _0x51aa1e;}else{var _0x117659=_[_0xf0bf('0x31')](_0x678bfa);if(_0x8a5ed1[_0xf0bf('0x36')]){var _0x535511={};_0x535511[_0x8a5ed1[_0xf0bf('0x36')]]=_0x3c6728;_[_0xf0bf('0x33')](_0x117659[_0xf0bf('0x34')],_0x535511);}return _0x43d500[_0xf0bf('0x20')]('Lead')['find'](_0x117659,_0x544248);}});case _0xf0bf('0x37'):var _0x2d86fc=_[_0xf0bf('0x31')](_0x678bfa);if(_0x8a5ed1[_0xf0bf('0x38')]){var _0x4edaa2={};_0x4edaa2[_0x8a5ed1['additionalSearchAccount']]=_0x3c6728;_['merge'](_0x2d86fc['$or'],_0x4edaa2);}return _0x43d500[_0xf0bf('0x20')](_0xf0bf('0x39'))[_0xf0bf('0x22')](_0x2d86fc,_0x544248)[_0xf0bf('0x23')]()['then'](function(_0x29a157){if(_0x29a157&&_0x29a157[_0xf0bf('0x24')]){return _0x29a157;}else{var _0x3bd2ab=_['cloneDeep'](_0x678bfa);if(_0x8a5ed1[_0xf0bf('0x32')]){var _0x1d5eff={};_0x1d5eff[_0x8a5ed1['additionalSearchContact']]=_0x3c6728;_[_0xf0bf('0x33')](_0x3bd2ab[_0xf0bf('0x34')],_0x1d5eff);}return _0x43d500[_0xf0bf('0x20')](_0xf0bf('0x35'))[_0xf0bf('0x22')](_0x3bd2ab,_0x544248)[_0xf0bf('0x2c')](function(_0xce262b){if(_0xce262b&&_0xce262b[_0xf0bf('0x24')]){return _0xce262b;}else{var _0x233c28=_['cloneDeep'](_0x678bfa);if(_0x8a5ed1[_0xf0bf('0x36')]){var _0x5fa70d={};_0x5fa70d[_0x8a5ed1[_0xf0bf('0x36')]]=_0x3c6728;_['merge'](_0x233c28[_0xf0bf('0x34')],_0x5fa70d);}return _0x43d500[_0xf0bf('0x20')](_0xf0bf('0x3a'))[_0xf0bf('0x22')](_0x233c28,_0x544248);}});}});case _0xf0bf('0x15'):var _0x296a32=_['cloneDeep'](_0x678bfa);if(_0x8a5ed1['additionalSearchContact']){var _0x4edaa2={};_0x4edaa2[_0x8a5ed1[_0xf0bf('0x32')]]=_0x3c6728;_[_0xf0bf('0x33')](_0x296a32[_0xf0bf('0x34')],_0x4edaa2);}return _0x43d500[_0xf0bf('0x20')]('Contact')[_0xf0bf('0x22')](_0x296a32,_0x544248)[_0xf0bf('0x23')]();case _0xf0bf('0x17'):var _0x2c7be0=_[_0xf0bf('0x31')](_0x678bfa);if(_0x8a5ed1[_0xf0bf('0x36')]){var _0x4edaa2={};_0x4edaa2[_0x8a5ed1[_0xf0bf('0x36')]]=_0x3c6728;_['merge'](_0x2c7be0['$or'],_0x4edaa2);}return _0x43d500[_0xf0bf('0x20')](_0xf0bf('0x3a'))['find'](_0x2c7be0,_0x544248);case _0xf0bf('0x19'):var _0x2d86fc=_[_0xf0bf('0x31')](_0x678bfa);if(_0x8a5ed1[_0xf0bf('0x38')]){var _0x4edaa2={};_0x4edaa2[_0x8a5ed1[_0xf0bf('0x38')]]=_0x3c6728;_['merge'](_0x2d86fc[_0xf0bf('0x34')],_0x4edaa2);}return _0x43d500[_0xf0bf('0x20')](_0xf0bf('0x39'))[_0xf0bf('0x22')](_0x2d86fc,_0x544248);default:return null;}})[_0xf0bf('0x2c')](function(_0x3e434b){if(_0x3e434b&&_0x3e434b[_0xf0bf('0x24')]){var _0x129165=_['first'](_0x3e434b);if(_0x129165){return BPromise[_0xf0bf('0x28')]({'id':_0x129165['Id'],'name':_0x129165[_0xf0bf('0x29')],'phone':_0x129165[_0xf0bf('0x3b')],'endUserType':_0x129165[_0xf0bf('0x3c')][_0xf0bf('0x3d')][_0xf0bf('0x3e')]()});}}})[_0xf0bf('0x2c')](function(_0x434ae7){if(_0x434ae7){logger['info'](_0xf0bf('0x3f'),_0x434ae7[_0xf0bf('0x16')],_0x3c6728);return BPromise[_0xf0bf('0x28')](_0x434ae7);}else{logger[_0xf0bf('0x26')](_0xf0bf('0x40'),_0x3c6728);var _0x266914={'Phone':_0x3c6728};if(_0x8a5ed1[_0xf0bf('0x41')]){if(_0x8a5ed1[_0xf0bf('0x41')]==='contact'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3c6728,_0x8a5ed1['moduleCreate']);_0x266914['LastName']=_0x3e81d9!==''?_0x3e81d9:util['format'](_0xf0bf('0x42'),_0x3c6728);}else if(_0x8a5ed1['moduleCreate']===_0xf0bf('0x17')){logger['info'](_0xf0bf('0x43'),_0x3c6728,_0x8a5ed1[_0xf0bf('0x41')]);_0x266914[_0xf0bf('0x44')]=_0x3e81d9!==_0xf0bf('0x45')?_0x3e81d9:util['format'](_0xf0bf('0x42'),_0x3c6728);_0x266914[_0xf0bf('0x46')]='No\x20Company';}else if(_0x8a5ed1['moduleCreate']===_0xf0bf('0x19')){logger['info'](_0xf0bf('0x43'),_0x3c6728,_0x8a5ed1[_0xf0bf('0x41')]);_0x266914[_0xf0bf('0x29')]=_0x3e81d9!==''?_0x3e81d9:util[_0xf0bf('0x47')](_0xf0bf('0x42'),_0x3c6728);}else{return null;}}return _0x43d500[_0xf0bf('0x20')](_[_0xf0bf('0x48')](_0x8a5ed1['moduleCreate']))[_0xf0bf('0x49')](_0x266914)[_0xf0bf('0x2c')](function(_0x3bf2c7){return BPromise[_0xf0bf('0x28')]({'id':_0x3bf2c7['id'],'endUserType':_0x8a5ed1[_0xf0bf('0x41')]});});}});}function getCustomFields(_0x2dceb2,_0x50bb9a){var _0x621d1={};if(_0x2dceb2['length']>0x0){_[_0xf0bf('0x4a')](_0x2dceb2,function(_0x1c1c73){if(_['includes']([_0xf0bf('0x4b'),'picklist'],_0x1c1c73['type'])&&_0x1c1c73[_0xf0bf('0x4c')]){_0x621d1[_0x1c1c73[_0xf0bf('0x4c')]]=_0x1c1c73[_0xf0bf('0x4d')][_0xf0bf('0x4e')]();}else if(_0x1c1c73[_0xf0bf('0x3d')]==='variable'&&_0x1c1c73[_0xf0bf('0x4f')]&&_0x1c1c73[_0xf0bf('0x4c')]){_0x50bb9a[_0x1c1c73[_0xf0bf('0x4f')]]&&(_0x621d1[_0x1c1c73['idField']]=_0x50bb9a[_0x1c1c73[_0xf0bf('0x4f')]][_0xf0bf('0x4e')]());}else if(_0x1c1c73[_0xf0bf('0x3d')]===_0xf0bf('0x50')&&_0x1c1c73[_0xf0bf('0x51')]&&_0x1c1c73[_0xf0bf('0x51')][_0xf0bf('0x52')]&&_0x1c1c73[_0xf0bf('0x4c')]){_0x50bb9a[_0x1c1c73['Variable'][_0xf0bf('0x52')][_0xf0bf('0x3e')]()]&&(_0x621d1[_0x1c1c73['idField']]=_0x50bb9a[_0x1c1c73[_0xf0bf('0x51')][_0xf0bf('0x52')][_0xf0bf('0x3e')]()][_0xf0bf('0x4e')]());}});}return _0x621d1;}function getConnection(_0x334a38){var _0x2ad672=_0x334a38[_0xf0bf('0x53')][_0xf0bf('0x54')](_0x334a38['securityToken']);var _0x594775=new jsforce[(_0xf0bf('0x55'))]({'oauth2':{'loginUrl':_0x334a38[_0xf0bf('0x56')]||_0xf0bf('0x57'),'clientId':_0x334a38['clientId'],'clientSecret':_0x334a38['clientSecret']}});return _0x594775[_0xf0bf('0x58')](_0x334a38[_0xf0bf('0x59')],_0x2ad672)[_0xf0bf('0x2c')](function(){logger[_0xf0bf('0x26')]('Connection\x20established.');return _0x594775;});}exports['queue']=function(_0x490360,_0x338854,_0x406876,_0x3a0886,_0x4975f4,_0x1bf6a8){var _0x1af1da,_0xab0fb6,_0x1f2ff8,_0x1e56a6;_0x1bf6a8[_0xf0bf('0x5a')]=intUtil[_0xf0bf('0x5b')](_0x1bf6a8[_0xf0bf('0x5a')]);_0x1bf6a8['remoteUri']=intUtil[_0xf0bf('0x5b')](_0x1bf6a8['remoteUri']);if(_0x4975f4&&_0x4975f4[_0xf0bf('0x5c')]){logger['info'](_0xf0bf('0x5d'),_0xf0bf('0x5e'));_0x338854[_0xf0bf('0x5f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1bf6a8[_0xf0bf('0x5a')],_0x338854[_0xf0bf('0x60')],md5(_0x338854[_0xf0bf('0x60')]));}else{_0x338854[_0xf0bf('0x5f')]='';}return getConnection(_0x1bf6a8)[_0xf0bf('0x2c')](function(_0x58b209){_0x1e56a6=_0x58b209;return getUser(_0x1bf6a8,_0x3a0886['email'],_0x1e56a6);})[_0xf0bf('0x2c')](function(_0x2a5b87){_0x1af1da=_0x2a5b87;return getEndUser(_0x1bf6a8,_0x406876,_0x338854['calleridname'],_0x338854[_0xf0bf('0x61')],_0x1e56a6);})[_0xf0bf('0x2c')](function(_0x4b2dd8){_0xab0fb6=_0x4b2dd8;return getTicket(_0x1bf6a8,_0x1af1da,_0xab0fb6,_0x406876,_0x338854,_0x406876[_0xf0bf('0x62')],_0x1e56a6,_0xf0bf('0x63'));})['then'](function(_0x3437d8){_0x1f2ff8=_0x3437d8;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x1f2ff8['id']);logger[_0xf0bf('0x26')](_0xf0bf('0x64'),_0x1f2ff8['id'],_0x3a0886[_0xf0bf('0x52')],_0x1bf6a8['type']);switch(_0x1bf6a8[_0xf0bf('0x3d')]){case _0xf0bf('0x65'):emit(util['format'](_0xf0bf('0x66'),_0x3a0886[_0xf0bf('0x52')]),_0xf0bf('0x67'),{'recordId':_0x1f2ff8['id']});break;case'newTab':emit(util[_0xf0bf('0x47')](_0xf0bf('0x66'),_0x3a0886[_0xf0bf('0x52')]),_0xf0bf('0x68'),{'uri':util[_0xf0bf('0x47')](_0xf0bf('0x69'),_0x1e56a6[_0xf0bf('0x6a')],_0x1f2ff8['id'])});break;default:logger[_0xf0bf('0x6b')](_0xf0bf('0x6c'));}})[_0xf0bf('0x6d')](function(_0x3ec458){logger[_0xf0bf('0x6b')](_0xf0bf('0x5d'),_0x3ec458);});};exports['outbound']=function(_0xc9210f,_0x49613d,_0x457b83,_0x1d590d,_0x210456,_0x1ec106,_0x1e14e4){var _0x481074,_0x152f0a,_0x12e037,_0x34cc42;_0x1ec106[_0xf0bf('0x5a')]=intUtil[_0xf0bf('0x5b')](_0x1ec106[_0xf0bf('0x5a')]);_0x1ec106[_0xf0bf('0x56')]=intUtil['stripTrailingSlash'](_0x1ec106['remoteUri']);if(_0x1e14e4&&_0x1e14e4['recordingFormat']&&_0x1e14e4[_0xf0bf('0x6e')]!=='none'){logger[_0xf0bf('0x26')]('[OUTBOUND]',_0xf0bf('0x5e'));_0x49613d[_0xf0bf('0x5f')]=util[_0xf0bf('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1ec106[_0xf0bf('0x5a')],_0x49613d['uniqueid'],md5(_0x49613d['uniqueid']));}return getConnection(_0x1ec106)['then'](function(_0x341405){_0x34cc42=_0x341405;return getUser(_0x1ec106,_0x1d590d[_0xf0bf('0x6f')],_0x34cc42);})[_0xf0bf('0x2c')](function(_0x10bb71){_0x481074=_0x10bb71;return getEndUser(_0x1ec106,_0x457b83,_0x49613d[_0xf0bf('0x70')],_0x49613d[_0xf0bf('0x71')],_0x34cc42);})[_0xf0bf('0x2c')](function(_0x5ebf08){_0x152f0a=_0x5ebf08;return getTicket(_0x1ec106,_0x481074,_0x152f0a,_0x457b83,_0x49613d,_0x457b83[_0xf0bf('0x62')],_0x34cc42,_0xf0bf('0x72'));})[_0xf0bf('0x2c')](function(_0x5ae067){_0x12e037=_0x5ae067;logger[_0xf0bf('0x26')](_0xf0bf('0x73'),_0x12e037['id']);logger['info'](_0xf0bf('0x74'),_0x12e037['id'],_0x1d590d[_0xf0bf('0x52')],_0x1ec106[_0xf0bf('0x3d')]);switch(_0x1ec106[_0xf0bf('0x3d')]){case _0xf0bf('0x65'):emit(util[_0xf0bf('0x47')]('user:%s',_0x1d590d[_0xf0bf('0x52')]),'trigger:salesforce:display',{'recordId':_0x12e037['id']});break;case _0xf0bf('0x75'):emit(util[_0xf0bf('0x47')](_0xf0bf('0x66'),_0x1d590d['name']),_0xf0bf('0x68'),{'uri':util['format'](_0xf0bf('0x69'),_0x34cc42[_0xf0bf('0x6a')],_0x12e037['id'])});break;default:logger[_0xf0bf('0x6b')](_0xf0bf('0x76'),_0xf0bf('0x77'));}})['catch'](function(_0x56c553){logger['error']('[OUTBOUND]',_0x56c553);});};exports[_0xf0bf('0x78')]=function(_0x58cc2c,_0x355023,_0x474d83,_0x593b10,_0x17cad0,_0xcdbe9e){var _0x3f6883,_0x1f6f43,_0x16a969,_0x5d4fc9;_0xcdbe9e[_0xf0bf('0x5a')]=intUtil[_0xf0bf('0x5b')](_0xcdbe9e['serverUrl']);_0xcdbe9e[_0xf0bf('0x56')]=intUtil[_0xf0bf('0x5b')](_0xcdbe9e['remoteUri']);if(_0x17cad0&&_0x17cad0[_0xf0bf('0x5c')]){logger[_0xf0bf('0x26')]('['+_0x355023[_0xf0bf('0x79')][_0xf0bf('0x7a')]()+']',_0xf0bf('0x5e'));_0x355023[_0xf0bf('0x5f')]=util['format'](_0xf0bf('0x7b'),_0xcdbe9e[_0xf0bf('0x5a')],_0x355023[_0xf0bf('0x60')],md5(_0x355023[_0xf0bf('0x60')]));}else{_0x355023[_0xf0bf('0x5f')]='';}return getConnection(_0xcdbe9e)[_0xf0bf('0x2c')](function(_0x49fbed){_0x5d4fc9=_0x49fbed;if(!_[_0xf0bf('0x7c')](_0x593b10)){return getUser(_0xcdbe9e,_0x593b10[_0xf0bf('0x52')],_0x5d4fc9);}else{return getUser(_0xcdbe9e,null,_0x5d4fc9);}})[_0xf0bf('0x2c')](function(_0x4d3847){_0x3f6883=_0x4d3847;return getEndUser(_0xcdbe9e,_0x474d83,_0x355023[_0xf0bf('0x7d')],_0x355023['calleridnum'],_0x5d4fc9);})[_0xf0bf('0x2c')](function(_0x52627b){_0x1f6f43=_0x52627b;return getTicket(_0xcdbe9e,_0x3f6883,_0x1f6f43,_0x474d83,_0x355023,_0x474d83['Fields'],_0x5d4fc9);})[_0xf0bf('0x2c')](function(_0x42393d){_0x16a969=_0x42393d;logger[_0xf0bf('0x26')]('['+_0x355023['lastevent'][_0xf0bf('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0x16a969['id']);logger['info']('['+_0x355023[_0xf0bf('0x79')][_0xf0bf('0x7a')]()+_0xf0bf('0x7e'),_0xcdbe9e[_0xf0bf('0x3d')]);})['catch'](function(_0x5dbfb2){logger[_0xf0bf('0x6b')]('['+_0x355023[_0xf0bf('0x79')][_0xf0bf('0x7a')]()+']',_0x5dbfb2);});}; \ No newline at end of file +var _0x8537=['[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','lead','account','WhatId','Case','contact','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','length','find','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','resolve','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Company','Caller\x20-\x20%s','upperFirst','forEach','includes','picklist','idField','toString','variable','variableName','Variable','name','password','concat','Connection','remoteUri','clientId','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum'];(function(_0x4b1434,_0x1fa900){var _0x9870da=function(_0x1e9432){while(--_0x1e9432){_0x4b1434['push'](_0x4b1434['shift']());}};_0x9870da(++_0x1fa900);}(_0x8537,0x17d));var _0x7853=function(_0x4fd4fe,_0x5f00db){_0x4fd4fe=_0x4fd4fe-0x0;var _0x1ad1a4=_0x8537[_0x4fd4fe];return _0x1ad1a4;};'use strict';var _=require(_0x7853('0x0'));var rp=require(_0x7853('0x1'));var moment=require(_0x7853('0x2'));var BPromise=require(_0x7853('0x3'));var md5=require(_0x7853('0x4'));var jsforce=require('jsforce');var util=require(_0x7853('0x5'));var Redis=require(_0x7853('0x6'));var intUtil=require(_0x7853('0x7'));var config=require(_0x7853('0x8'));var logger=require(_0x7853('0x9'))(_0x7853('0xa'));config[_0x7853('0xb')]=_['defaults'](config[_0x7853('0xb')],{'host':_0x7853('0xc'),'port':0x18eb});var io=require(_0x7853('0xd'))(new Redis(config[_0x7853('0xb')]));function emit(_0x18aff7,_0x1f58b5,_0x3b0be8){io['to'](_0x18aff7)['emit'](_0x1f58b5,_0x3b0be8);}function getTicket(_0x2ca44c,_0x45642f,_0x509b7e,_0x4ff4d4,_0x4ce4cf,_0x363646,_0x5e381d,_0x2677f9){var _0x4b3e54=Object['assign']({},{'OwnerId':_0x45642f['id'],'Subject':intUtil['getString'](_0x4ff4d4[_0x7853('0xe')],_0x4ce4cf,'\x20'),'Description':intUtil[_0x7853('0xf')](_0x4ff4d4[_0x7853('0x10')],_0x4ce4cf,'\x0a')},getCustomFields(_0x363646,_0x4ce4cf));if(_0x509b7e){if(_0x4ff4d4[_0x7853('0x11')]===_0x7853('0x12')){_0x4b3e54[_0x7853('0x13')]=moment['utc']();_0x4b3e54[_0x7853('0x14')]=![];_0x4b3e54[_0x7853('0x15')]=![];if(_0x509b7e['endUserType']==='contact'||_0x509b7e[_0x7853('0x16')]===_0x7853('0x17')){_0x4b3e54['WhoId']=_0x509b7e['id'];}else if(_0x509b7e[_0x7853('0x16')]===_0x7853('0x18')){_0x4b3e54[_0x7853('0x19')]=_0x509b7e['id'];}}else if(_0x4ff4d4[_0x7853('0x11')]===_0x7853('0x1a')){if(_0x509b7e[_0x7853('0x16')]===_0x7853('0x1b')){_0x4b3e54['ContactId']=_0x509b7e['id'];}else if(_0x509b7e[_0x7853('0x16')]===_0x7853('0x18')){_0x4b3e54[_0x7853('0x1c')]=_0x509b7e['id'];}else if(_0x509b7e[_0x7853('0x16')]==='lead'&&_0x4ff4d4[_0x7853('0x1d')]){_0x4b3e54[_0x4ff4d4[_0x7853('0x1d')]]=_0x509b7e['id'];}else{logger[_0x7853('0x1e')](_0x7853('0x1f'));}}}return _0x5e381d[_0x7853('0x20')](_0x4ff4d4[_0x7853('0x11')])[_0x7853('0x21')](_0x4b3e54);}function getUser(_0x7a2d39,_0x3542db,_0x5e2b65){if(!_[_0x7853('0x22')](_0x3542db)&&intUtil[_0x7853('0x23')](_0x3542db)){var _0x48c86c={'Email':_0x3542db};var _0x474bb3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5e2b65['sobject'](_0x7853('0x24'))['find'](_0x48c86c,_0x474bb3)[_0x7853('0x25')]()['then'](function(_0x2910d4){if(_0x2910d4[_0x7853('0x26')]){var _0x9ccf8e=_[_0x7853('0x27')](_0x2910d4,function(_0x58b069){return _0x58b069[_0x7853('0x28')]===_0x3542db;});if(_0x9ccf8e){logger[_0x7853('0x1e')](_0x7853('0x29'),_0x3542db);return BPromise['resolve']({'id':_0x9ccf8e['Id'],'name':_0x9ccf8e[_0x7853('0x2a')]});}}else{logger[_0x7853('0x1e')](_0x7853('0x2b'),_0x3542db);return _0x5e2b65['identity']()[_0x7853('0x2c')](function(_0x5ca272){return BPromise[_0x7853('0x2d')]({'id':_0x5ca272[_0x7853('0x2e')],'name':_0x5ca272['display_name']});});}});}else{logger[_0x7853('0x1e')](_0x7853('0x2b'),_0x3542db);return _0x5e2b65[_0x7853('0x2f')]()[_0x7853('0x2c')](function(_0x3bf173){return BPromise[_0x7853('0x2d')]({'id':_0x3bf173[_0x7853('0x2e')],'name':_0x3bf173[_0x7853('0x30')]});});}}function getEndUser(_0x37b1c2,_0x577f2f,_0x408a2b,_0x3d2cb3,_0x1f0caf){var _0x208038={'$or':{'Phone':_0x3d2cb3}};var _0x38d867={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7853('0x2d')]()[_0x7853('0x2c')](function(){logger[_0x7853('0x1e')](_0x7853('0x31'),_0x3d2cb3,_0x577f2f['moduleSearch']);switch(_0x577f2f[_0x7853('0x32')]){case'contact_lead':var _0x1864b5=_[_0x7853('0x33')](_0x208038);if(_0x577f2f['additionalSearchContact']){var _0x451706={};_0x451706[_0x577f2f[_0x7853('0x34')]]=_0x3d2cb3;_[_0x7853('0x35')](_0x1864b5[_0x7853('0x36')],_0x451706);}return _0x1f0caf['sobject']('Contact')['find'](_0x1864b5,_0x38d867)['execute']()[_0x7853('0x2c')](function(_0x5902c3){if(_0x5902c3&&_0x5902c3[_0x7853('0x26')]){return _0x5902c3;}else{var _0x23515c=_[_0x7853('0x33')](_0x208038);if(_0x577f2f[_0x7853('0x37')]){var _0x4d8508={};_0x4d8508[_0x577f2f[_0x7853('0x37')]]=_0x3d2cb3;_['merge'](_0x23515c[_0x7853('0x36')],_0x4d8508);}return _0x1f0caf['sobject'](_0x7853('0x38'))[_0x7853('0x27')](_0x23515c,_0x38d867);}});case _0x7853('0x39'):var _0x521b12=_[_0x7853('0x33')](_0x208038);if(_0x577f2f[_0x7853('0x3a')]){var _0x451706={};_0x451706[_0x577f2f[_0x7853('0x3a')]]=_0x3d2cb3;_[_0x7853('0x35')](_0x521b12[_0x7853('0x36')],_0x451706);}return _0x1f0caf['sobject'](_0x7853('0x3b'))[_0x7853('0x27')](_0x521b12,_0x38d867)[_0x7853('0x25')]()[_0x7853('0x2c')](function(_0x438c68){if(_0x438c68&&_0x438c68[_0x7853('0x26')]){return _0x438c68;}else{var _0x49f34a=_[_0x7853('0x33')](_0x208038);if(_0x577f2f['additionalSearchContact']){var _0x2c6a59={};_0x2c6a59[_0x577f2f[_0x7853('0x34')]]=_0x3d2cb3;_[_0x7853('0x35')](_0x49f34a[_0x7853('0x36')],_0x2c6a59);}return _0x1f0caf[_0x7853('0x20')](_0x7853('0x3c'))[_0x7853('0x27')](_0x49f34a,_0x38d867)[_0x7853('0x2c')](function(_0x43a382){if(_0x43a382&&_0x43a382[_0x7853('0x26')]){return _0x43a382;}else{var _0xc21551=_[_0x7853('0x33')](_0x208038);if(_0x577f2f[_0x7853('0x37')]){var _0x7e0475={};_0x7e0475[_0x577f2f['additionalSearchLead']]=_0x3d2cb3;_['merge'](_0xc21551[_0x7853('0x36')],_0x7e0475);}return _0x1f0caf[_0x7853('0x20')](_0x7853('0x38'))[_0x7853('0x27')](_0xc21551,_0x38d867);}});}});case _0x7853('0x1b'):var _0x1864b5=_['cloneDeep'](_0x208038);if(_0x577f2f[_0x7853('0x34')]){var _0x451706={};_0x451706[_0x577f2f[_0x7853('0x34')]]=_0x3d2cb3;_[_0x7853('0x35')](_0x1864b5[_0x7853('0x36')],_0x451706);}return _0x1f0caf['sobject']('Contact')[_0x7853('0x27')](_0x1864b5,_0x38d867)[_0x7853('0x25')]();case _0x7853('0x17'):var _0x4cafd6=_[_0x7853('0x33')](_0x208038);if(_0x577f2f['additionalSearchLead']){var _0x451706={};_0x451706[_0x577f2f['additionalSearchLead']]=_0x3d2cb3;_[_0x7853('0x35')](_0x4cafd6['$or'],_0x451706);}return _0x1f0caf['sobject']('Lead')[_0x7853('0x27')](_0x4cafd6,_0x38d867);case _0x7853('0x18'):var _0x521b12=_[_0x7853('0x33')](_0x208038);if(_0x577f2f['additionalSearchAccount']){var _0x451706={};_0x451706[_0x577f2f[_0x7853('0x3a')]]=_0x3d2cb3;_[_0x7853('0x35')](_0x521b12['$or'],_0x451706);}return _0x1f0caf[_0x7853('0x20')](_0x7853('0x3b'))[_0x7853('0x27')](_0x521b12,_0x38d867);default:return null;}})[_0x7853('0x2c')](function(_0x4493bf){if(_0x4493bf&&_0x4493bf[_0x7853('0x26')]){var _0x53dab1=_[_0x7853('0x3d')](_0x4493bf);if(_0x53dab1){return BPromise[_0x7853('0x2d')]({'id':_0x53dab1['Id'],'name':_0x53dab1[_0x7853('0x2a')],'phone':_0x53dab1['Phone'],'endUserType':_0x53dab1[_0x7853('0x3e')][_0x7853('0x3f')][_0x7853('0x40')]()});}}})[_0x7853('0x2c')](function(_0x216664){if(_0x216664){logger[_0x7853('0x1e')](_0x7853('0x41'),_0x216664['endUserType'],_0x3d2cb3);return BPromise[_0x7853('0x2d')](_0x216664);}else{logger['info'](_0x7853('0x42'),_0x3d2cb3);var _0x119020={'Phone':_0x3d2cb3};if(_0x577f2f[_0x7853('0x43')]){if(_0x577f2f[_0x7853('0x43')]===_0x7853('0x1b')){logger[_0x7853('0x1e')](_0x7853('0x44'),_0x3d2cb3,_0x577f2f['moduleCreate']);_0x119020[_0x7853('0x45')]=_0x408a2b!==''?_0x408a2b:util['format']('Caller\x20-\x20%s',_0x3d2cb3);}else if(_0x577f2f['moduleCreate']===_0x7853('0x17')){logger['info'](_0x7853('0x44'),_0x3d2cb3,_0x577f2f[_0x7853('0x43')]);_0x119020[_0x7853('0x45')]=_0x408a2b!==_0x7853('0x46')?_0x408a2b:util[_0x7853('0x47')]('Caller\x20-\x20%s',_0x3d2cb3);_0x119020[_0x7853('0x48')]='No\x20Company';}else if(_0x577f2f[_0x7853('0x43')]===_0x7853('0x18')){logger['info'](_0x7853('0x44'),_0x3d2cb3,_0x577f2f[_0x7853('0x43')]);_0x119020[_0x7853('0x2a')]=_0x408a2b!==_0x7853('0x46')?_0x408a2b:util[_0x7853('0x47')](_0x7853('0x49'),_0x3d2cb3);}else{return null;}}return _0x1f0caf[_0x7853('0x20')](_[_0x7853('0x4a')](_0x577f2f['moduleCreate']))[_0x7853('0x21')](_0x119020)[_0x7853('0x2c')](function(_0x22dfe6){return BPromise[_0x7853('0x2d')]({'id':_0x22dfe6['id'],'endUserType':_0x577f2f[_0x7853('0x43')]});});}});}function getCustomFields(_0x68b9d7,_0x55baef){var _0x41e9a7={};if(_0x68b9d7['length']>0x0){_[_0x7853('0x4b')](_0x68b9d7,function(_0x1b49c1){if(_[_0x7853('0x4c')](['string',_0x7853('0x4d')],_0x1b49c1[_0x7853('0x3f')])&&_0x1b49c1[_0x7853('0x4e')]){_0x41e9a7[_0x1b49c1[_0x7853('0x4e')]]=_0x1b49c1['content'][_0x7853('0x4f')]();}else if(_0x1b49c1[_0x7853('0x3f')]===_0x7853('0x50')&&_0x1b49c1['variableName']&&_0x1b49c1[_0x7853('0x4e')]){_0x55baef[_0x1b49c1[_0x7853('0x51')]]&&(_0x41e9a7[_0x1b49c1['idField']]=_0x55baef[_0x1b49c1['variableName']][_0x7853('0x4f')]());}else if(_0x1b49c1['type']==='customVariable'&&_0x1b49c1[_0x7853('0x52')]&&_0x1b49c1[_0x7853('0x52')][_0x7853('0x53')]&&_0x1b49c1[_0x7853('0x4e')]){_0x55baef[_0x1b49c1['Variable']['name'][_0x7853('0x40')]()]&&(_0x41e9a7[_0x1b49c1[_0x7853('0x4e')]]=_0x55baef[_0x1b49c1[_0x7853('0x52')][_0x7853('0x53')][_0x7853('0x40')]()]['toString']());}});}return _0x41e9a7;}function getConnection(_0x51802c){var _0xc9383f=_0x51802c[_0x7853('0x54')][_0x7853('0x55')](_0x51802c['securityToken']);var _0x4affa5=new jsforce[(_0x7853('0x56'))]({'oauth2':{'loginUrl':_0x51802c[_0x7853('0x57')]||'https://login.salesforce.com','clientId':_0x51802c[_0x7853('0x58')],'clientSecret':_0x51802c[_0x7853('0x59')]}});return _0x4affa5['login'](_0x51802c[_0x7853('0x5a')],_0xc9383f)[_0x7853('0x2c')](function(){logger[_0x7853('0x1e')](_0x7853('0x5b'));return _0x4affa5;});}exports[_0x7853('0x5c')]=function(_0x1c2602,_0x2692f1,_0x5a1396,_0xc4d466,_0x53397b,_0x5ca57e){var _0x3e42b8,_0x1d1196,_0x4a54f3,_0x3bce74;_0x5ca57e['serverUrl']=intUtil['stripTrailingSlash'](_0x5ca57e[_0x7853('0x5d')]);_0x5ca57e[_0x7853('0x57')]=intUtil[_0x7853('0x5e')](_0x5ca57e[_0x7853('0x57')]);if(_0x53397b&&_0x53397b[_0x7853('0x5f')]){logger['info'](_0x7853('0x60'),_0x7853('0x61'));_0x2692f1[_0x7853('0x62')]=util[_0x7853('0x47')](_0x7853('0x63'),_0x5ca57e[_0x7853('0x5d')],_0x2692f1[_0x7853('0x64')],md5(_0x2692f1['uniqueid']));}else{_0x2692f1[_0x7853('0x62')]='';}return getConnection(_0x5ca57e)[_0x7853('0x2c')](function(_0xbb9415){_0x3bce74=_0xbb9415;return getUser(_0x5ca57e,_0xc4d466[_0x7853('0x65')],_0x3bce74);})['then'](function(_0x5a2e36){_0x3e42b8=_0x5a2e36;return getEndUser(_0x5ca57e,_0x5a1396,_0x2692f1[_0x7853('0x66')],_0x2692f1[_0x7853('0x67')],_0x3bce74);})[_0x7853('0x2c')](function(_0x4370cc){_0x1d1196=_0x4370cc;return getTicket(_0x5ca57e,_0x3e42b8,_0x1d1196,_0x5a1396,_0x2692f1,_0x5a1396[_0x7853('0x68')],_0x3bce74,_0x7853('0x5c'));})[_0x7853('0x2c')](function(_0x3675a7){_0x4a54f3=_0x3675a7;logger[_0x7853('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4a54f3['id']);logger[_0x7853('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4a54f3['id'],_0xc4d466[_0x7853('0x53')],_0x5ca57e[_0x7853('0x3f')]);switch(_0x5ca57e[_0x7853('0x3f')]){case _0x7853('0x69'):emit(util['format']('user:%s',_0xc4d466[_0x7853('0x53')]),_0x7853('0x6a'),{'recordId':_0x4a54f3['id']});break;case'newTab':emit(util[_0x7853('0x47')](_0x7853('0x6b'),_0xc4d466[_0x7853('0x53')]),_0x7853('0x6c'),{'uri':util['format'](_0x7853('0x6d'),_0x3bce74[_0x7853('0x6e')],_0x4a54f3['id'])});break;default:logger[_0x7853('0x6f')](_0x7853('0x70'));}})['catch'](function(_0x5df6dc){logger[_0x7853('0x6f')](_0x7853('0x60'),_0x5df6dc);});};exports[_0x7853('0x71')]=function(_0x5ae8eb,_0x482acb,_0x3cece4,_0x4edeef,_0x138925,_0x2c2fe1,_0x4cbff0){var _0x358cac,_0x5cbed5,_0x374cb3,_0x57d4b4;_0x2c2fe1[_0x7853('0x5d')]=intUtil[_0x7853('0x5e')](_0x2c2fe1[_0x7853('0x5d')]);_0x2c2fe1[_0x7853('0x57')]=intUtil[_0x7853('0x5e')](_0x2c2fe1[_0x7853('0x57')]);if(_0x4cbff0&&_0x4cbff0[_0x7853('0x72')]&&_0x4cbff0['recordingFormat']!==_0x7853('0x73')){logger[_0x7853('0x1e')](_0x7853('0x74'),_0x7853('0x61'));_0x482acb[_0x7853('0x62')]=util[_0x7853('0x47')](_0x7853('0x63'),_0x2c2fe1['serverUrl'],_0x482acb[_0x7853('0x64')],md5(_0x482acb['uniqueid']));}return getConnection(_0x2c2fe1)[_0x7853('0x2c')](function(_0x131e62){_0x57d4b4=_0x131e62;return getUser(_0x2c2fe1,_0x4edeef['email'],_0x57d4b4);})[_0x7853('0x2c')](function(_0x1c949c){_0x358cac=_0x1c949c;return getEndUser(_0x2c2fe1,_0x3cece4,_0x482acb[_0x7853('0x75')],_0x482acb[_0x7853('0x76')],_0x57d4b4);})[_0x7853('0x2c')](function(_0x35a0dd){_0x5cbed5=_0x35a0dd;return getTicket(_0x2c2fe1,_0x358cac,_0x5cbed5,_0x3cece4,_0x482acb,_0x3cece4[_0x7853('0x68')],_0x57d4b4,_0x7853('0x71'));})['then'](function(_0x4a3cad){_0x374cb3=_0x4a3cad;logger[_0x7853('0x1e')](_0x7853('0x77'),_0x374cb3['id']);logger[_0x7853('0x1e')](_0x7853('0x78'),_0x374cb3['id'],_0x4edeef[_0x7853('0x53')],_0x2c2fe1[_0x7853('0x3f')]);switch(_0x2c2fe1[_0x7853('0x3f')]){case _0x7853('0x69'):emit(util[_0x7853('0x47')](_0x7853('0x6b'),_0x4edeef['name']),_0x7853('0x6a'),{'recordId':_0x374cb3['id']});break;case _0x7853('0x79'):emit(util[_0x7853('0x47')](_0x7853('0x6b'),_0x4edeef['name']),_0x7853('0x6c'),{'uri':util[_0x7853('0x47')](_0x7853('0x6d'),_0x57d4b4[_0x7853('0x6e')],_0x374cb3['id'])});break;default:logger[_0x7853('0x6f')](_0x7853('0x74'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x101f99){logger[_0x7853('0x6f')](_0x7853('0x74'),_0x101f99);});};exports['unmanaged']=function(_0x2b6e67,_0x16fba4,_0x118e4c,_0x3f0881,_0x2c5523,_0x102281){var _0x49ce6f,_0x2dfe80,_0x5e8b45,_0x13daaa;_0x102281[_0x7853('0x5d')]=intUtil['stripTrailingSlash'](_0x102281[_0x7853('0x5d')]);_0x102281[_0x7853('0x57')]=intUtil[_0x7853('0x5e')](_0x102281[_0x7853('0x57')]);if(_0x2c5523&&_0x2c5523['monitor_format']){logger[_0x7853('0x1e')]('['+_0x16fba4[_0x7853('0x7a')][_0x7853('0x7b')]()+']',_0x7853('0x61'));_0x16fba4[_0x7853('0x62')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x102281[_0x7853('0x5d')],_0x16fba4[_0x7853('0x64')],md5(_0x16fba4[_0x7853('0x64')]));}else{_0x16fba4[_0x7853('0x62')]='';}return getConnection(_0x102281)[_0x7853('0x2c')](function(_0x369f57){_0x13daaa=_0x369f57;if(!_[_0x7853('0x22')](_0x3f0881)){return getUser(_0x102281,_0x3f0881[_0x7853('0x53')],_0x13daaa);}else{return getUser(_0x102281,null,_0x13daaa);}})[_0x7853('0x2c')](function(_0x5368d9){_0x49ce6f=_0x5368d9;return getEndUser(_0x102281,_0x118e4c,_0x16fba4['calleridname'],_0x16fba4[_0x7853('0x67')],_0x13daaa);})[_0x7853('0x2c')](function(_0x596cff){_0x2dfe80=_0x596cff;return getTicket(_0x102281,_0x49ce6f,_0x2dfe80,_0x118e4c,_0x16fba4,_0x118e4c[_0x7853('0x68')],_0x13daaa);})[_0x7853('0x2c')](function(_0x2b3893){_0x5e8b45=_0x2b3893;logger[_0x7853('0x1e')]('['+_0x16fba4[_0x7853('0x7a')][_0x7853('0x7b')]()+_0x7853('0x7c'),_0x5e8b45['id']);logger[_0x7853('0x1e')]('['+_0x16fba4[_0x7853('0x7a')][_0x7853('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x102281[_0x7853('0x3f')]);})['catch'](function(_0x9ab79f){logger['error']('['+_0x16fba4[_0x7853('0x7a')][_0x7853('0x7b')]()+']',_0x9ab79f);});}; \ 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 c37bc87..d5046f8 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 _0x67c1=['incident','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','util','ioredis','../../../../config/environment','servicenow','redis','localhost','socket.io-emitter','GET','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','active','true','userId','error',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','customField','nameField','toString','type','idField','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number','label'];(function(_0x54203e,_0x3b1bc1){var _0x175988=function(_0x599bf0){while(--_0x599bf0){_0x54203e['push'](_0x54203e['shift']());}};_0x175988(++_0x3b1bc1);}(_0x67c1,0x8d));var _0x167c=function(_0x21a89c,_0x5beaa1){_0x21a89c=_0x21a89c-0x0;var _0x4a22cf=_0x67c1[_0x21a89c];return _0x4a22cf;};'use strict';var _=require(_0x167c('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x167c('0x1'));var md5=require('md5');var Redis=require(_0x167c('0x2'));var intUtil=require('./util');var config=require(_0x167c('0x3'));var logger=require('../../../../config/logger')(_0x167c('0x4'));config[_0x167c('0x5')]=_['defaults'](config[_0x167c('0x5')],{'host':_0x167c('0x6'),'port':0x18eb});var io=require(_0x167c('0x7'))(new Redis(config['redis']));function getAdminUser(_0x169187,_0x3023c1,_0x2f7c60,_0x1f8d84,_0x3ee6a7,_0x3ff06c){return new Promise(function(_0x418d4c,_0xb167ba){var _0x3c0d08={'method':_0x167c('0x8'),'uri':_0x1f8d84+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x3ee6a7+'&'+_0x3ff06c,'auth':_0x3023c1,'json':!![]};return rp(_0x3c0d08)[_0x167c('0x9')](function(_0x2633b6){if(_0x2633b6['result'][_0x167c('0xa')]>0x0){_0x2f7c60[_0x167c('0xb')]=_0x2633b6[_0x167c('0xc')][0x0][_0x167c('0xd')];}logger[_0x167c('0xe')]('['+[_0x169187[_0x167c('0xf')]()]+_0x167c('0x10'),_0x2f7c60);_0x418d4c(_0x2f7c60);})[_0x167c('0x11')](function(_0x4b235c){logger['error']('['+[_0x169187[_0x167c('0xf')]()]+']',_0x4b235c[_0x167c('0x12')]);_0xb167ba(_0x4b235c['message']);});});}function getUser(_0x5af63c,_0x323827,_0x16ecc5,_0x1cf6c5,_0xc90774){return function(_0x4aa33c){logger[_0x167c('0xe')]('['+[_0x5af63c[_0x167c('0xf')]()]+_0x167c('0x13'),_0x4aa33c);return new Promise(function(_0x186a69,_0x41e390){if(intUtil[_0x167c('0x14')](_0x4aa33c['userEmail'])){var _0x1bcdd3={'method':'GET','uri':_0x16ecc5+_0x167c('0x15')+_0x4aa33c[_0x167c('0x16')]+'&'+_0x1cf6c5+'&'+_0xc90774,'auth':_0x323827,'json':!![]};logger['info']('['+[_0x5af63c[_0x167c('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x1bcdd3);return rp(_0x1bcdd3)['then'](function(_0x3516e6){logger[_0x167c('0xe')]('['+[_0x5af63c[_0x167c('0xf')]()]+'],\x20getUser\x20entity',_0x3516e6);if(_0x3516e6[_0x167c('0xc')][_0x167c('0xa')]>0x0&&String(_0x3516e6['result'][0x0][_0x167c('0x17')])===_0x167c('0x18')){_0x4aa33c['userId']=_0x3516e6[_0x167c('0xc')][0x0][_0x167c('0xd')];}else{_0x4aa33c[_0x167c('0x19')]=_0x4aa33c['adminId'];_0x4aa33c[_0x167c('0x16')]=_0x4aa33c['adminEmail'];}logger[_0x167c('0xe')]('['+[_0x5af63c[_0x167c('0xf')]()]+'],\x20getUser\x20crm',_0x4aa33c);_0x186a69(_0x4aa33c);})[_0x167c('0x11')](function(_0x3acfe9){logger[_0x167c('0x1a')]('['+[_0x5af63c[_0x167c('0xf')]()]+']',_0x3acfe9[_0x167c('0x12')]);_0x41e390(_0x3acfe9[_0x167c('0x12')]);});}else{logger[_0x167c('0xe')]('['+[_0x5af63c[_0x167c('0xf')]()]+_0x167c('0x1b'));_0x4aa33c[_0x167c('0x19')]=_0x4aa33c['adminId'];_0x4aa33c[_0x167c('0x16')]=_0x4aa33c[_0x167c('0x1c')];_0x186a69(_0x4aa33c);}});};}function createEndUser(_0x162b2d,_0x3c6f94,_0xbfed15,_0x41f708,_0x23131d){logger[_0x167c('0xe')]('['+[_0x162b2d[_0x167c('0xf')]()]+_0x167c('0x1d'),_0xbfed15);return new Promise(function(_0x4d1870,_0x29c385){var _0x1dbb90={'method':_0x167c('0x1e'),'uri':_0x41f708+_0x167c('0x1f')+_0x23131d,'body':{'user_name':_0xbfed15[_0x167c('0x20')],'roles':_0x167c('0x21'),'first_name':_0xbfed15[_0x167c('0x20')],'active':_0x167c('0x18'),'date_format':_0x167c('0x22'),'phone':_0xbfed15[_0x167c('0x20')]},'auth':_0x3c6f94,'json':!![]};return rp(_0x1dbb90)[_0x167c('0x9')](function(_0x35ce80){logger['info']('['+[_0x162b2d[_0x167c('0xf')]()]+_0x167c('0x23'),_0x35ce80[_0x167c('0xc')]);_0xbfed15[_0x167c('0x24')]=_0x35ce80['result'][_0x167c('0xd')];_0x4d1870(_0xbfed15);})[_0x167c('0x11')](function(_0x288558){logger[_0x167c('0x1a')]('['+[_0x162b2d[_0x167c('0xf')]()]+']',_0x288558[_0x167c('0x12')]);_0x29c385(_0x288558[_0x167c('0x12')]);});});}function getEndUser(_0x3ebf45,_0xd82c1c,_0x421c09,_0x2a7279,_0x1b2f83){return function(_0x2ec02e){logger[_0x167c('0xe')]('['+[_0x3ebf45['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x2ec02e);return new Promise(function(_0x56efa9,_0x354d9){var _0x4d666d={'method':_0x167c('0x8'),'uri':_0x421c09+_0x167c('0x25')+_0x2ec02e[_0x167c('0x20')]+'&'+_0x2a7279+'&'+_0x1b2f83,'auth':_0xd82c1c,'json':!![]};return rp(_0x4d666d)[_0x167c('0x9')](function(_0x436292){if(_0x436292[_0x167c('0xc')][_0x167c('0xa')]>0x0){_0x2ec02e['endUserId']=_0x436292['result'][0x0]['sys_id'];logger[_0x167c('0xe')]('['+[_0x3ebf45['toUpperCase']()]+_0x167c('0x26'),_0x2ec02e);_0x56efa9(_0x2ec02e);}else{return createEndUser(_0x3ebf45,_0xd82c1c,_0x2ec02e,_0x421c09,_0x2a7279)[_0x167c('0x9')](function(_0x3aba4f){logger['info']('['+[_0x3ebf45['toUpperCase']()]+_0x167c('0x27'),_0x3aba4f);_0x56efa9(_0x3aba4f);});}})[_0x167c('0x11')](function(_0x758013){logger[_0x167c('0x1a')]('['+[_0x3ebf45[_0x167c('0xf')]()]+']',_0x758013[_0x167c('0x12')]);_0x354d9(_0x758013[_0x167c('0x12')]);});});};}function getCustomFields(_0x311e6d,_0x483fac){var _0x5f4e29={};if(_0x311e6d[_0x167c('0xa')]>0x0){_[_0x167c('0x28')](_0x311e6d,function(_0x5c82f8){if(_[_0x167c('0x29')]([_0x167c('0x2a'),_0x167c('0x2b')],_0x5c82f8['type'])&&_0x5c82f8['nameField']&&!_0x5c82f8[_0x167c('0x2c')]){_0x5f4e29[_0x5c82f8[_0x167c('0x2d')]['toLowerCase']()]=_0x5c82f8['content'][_0x167c('0x2e')]();}else if(_['includes']([_0x167c('0x2a'),'picklist'],_0x5c82f8[_0x167c('0x2f')])&&_0x5c82f8['idField']&&_0x5c82f8[_0x167c('0x2c')]){_0x5f4e29[_0x5c82f8[_0x167c('0x30')][_0x167c('0x31')]()]=_0x5c82f8['content']['toString']();}else if(_0x5c82f8['type']===_0x167c('0x32')&&_0x5c82f8[_0x167c('0x33')]&&_0x5c82f8[_0x167c('0x30')]&&_0x5c82f8['customField']){_0x5f4e29[_0x5c82f8['idField'][_0x167c('0x31')]()]=_0x483fac[_0x5c82f8[_0x167c('0x33')]][_0x167c('0x2e')]();}else if(_0x5c82f8['type']==='customVariable'&&_0x5c82f8[_0x167c('0x34')]&&_0x5c82f8[_0x167c('0x34')][_0x167c('0x35')]&&_0x5c82f8['idField']&&_0x5c82f8[_0x167c('0x2c')]){_0x5f4e29[_0x5c82f8[_0x167c('0x30')]['toLowerCase']()]=_0x483fac[_0x5c82f8[_0x167c('0x34')][_0x167c('0x35')]['toLowerCase']()]['toString']();}});}return _0x5f4e29;}function getTicket(_0x48f157,_0x3b5be9,_0x5c36b9,_0x259f24,_0x2945a4,_0xa95549){return function(_0x4b163a){logger[_0x167c('0xe')]('['+[_0x48f157[_0x167c('0xf')]()]+_0x167c('0x36'),_0x4b163a);return new Promise(function(_0x257cf3,_0x2487ac){var _0x244253=_0x48f157['toLowerCase']()==='outbound'?_0x4b163a[_0x167c('0x19')]:_0x4b163a[_0x167c('0x24')];var _0x51927e={'method':_0x167c('0x1e'),'uri':_0x5c36b9+'incident'+'?'+_0xa95549,'body':Object[_0x167c('0x37')]({},{'active':_0x167c('0x18'),'caller_id':_0x244253,'assigned_to':_0x4b163a[_0x167c('0x19')],'short_description':intUtil[_0x167c('0x38')](_0x259f24[_0x167c('0x39')],_0x2945a4,'\x20'),'description':intUtil[_0x167c('0x38')](_0x259f24[_0x167c('0x3a')],_0x2945a4,'\x0a')},getCustomFields(_0x259f24[_0x167c('0x3b')],_0x2945a4)),'auth':_0x3b5be9,'json':!![]};return rp(_0x51927e)[_0x167c('0x9')](function(_0x5ba2de){logger['info']('['+[_0x48f157[_0x167c('0xf')]()]+_0x167c('0x3c'),_0x5ba2de[_0x167c('0xc')]);_0x4b163a['ticketId']=_0x5ba2de[_0x167c('0xc')][_0x167c('0xd')];_0x4b163a['ticketNumber']=_0x5ba2de[_0x167c('0xc')][_0x167c('0x3d')];logger[_0x167c('0xe')]('['+[_0x48f157[_0x167c('0xf')]()]+']\x20getTicket\x20crm',_0x4b163a);_0x257cf3(_0x4b163a);})['catch'](function(_0x581bb8){logger[_0x167c('0x1a')]('['+[_0x48f157[_0x167c('0xf')]()]+']',_0x581bb8[_0x167c('0x12')]);_0x2487ac(_0x581bb8[_0x167c('0x12')]);});});};}function createRemoteTag(_0x435047,_0xd9bb8e,_0x32dcb1,_0x4d22f0){return new Promise(function(_0x1652f2,_0x1df18c){var _0x382b32={'method':'POST','uri':_0x32dcb1+_0x167c('0x3e')+'?'+_0x4d22f0,'body':{'short_description':_0x435047,'global':!![],'active':!![],'name':_0x435047},'auth':_0xd9bb8e,'json':!![]};return rp(_0x382b32)[_0x167c('0x9')](function(_0x30e30e){var _0x1c49d1=_0x30e30e[_0x167c('0xc')][_0x167c('0xd')];_0x1652f2(_0x1c49d1);});});}function getRemoteTag(_0x989759,_0x41b50c,_0x3b6568,_0x2942b4,_0x78c6ae){return new Promise(function(_0x3f218,_0x288dc3){var _0x300b19={'method':_0x167c('0x8'),'uri':_0x3b6568+'label'+'?sysparm_query=name%3D'+_0x989759+'&'+_0x2942b4,'auth':_0x41b50c,'json':!![]};return rp(_0x300b19)['then'](function(_0x190149){if(_0x190149['result'][_0x167c('0xa')]>0x0){var _0x395f95=_0x190149[_0x167c('0xc')][0x0][_0x167c('0xd')];_0x3f218(_0x395f95);}else{return createRemoteTag(_0x989759,_0x41b50c,_0x3b6568,_0x2942b4)[_0x167c('0x9')](function(_0x3e3bac){_0x3f218(_0x3e3bac);});}});});}function assignTagToIncident(_0x5b17b3,_0x598c94,_0x4ccb94,_0x2884db,_0xef1be7){return new Promise(function(_0x3f53f1,_0x8691d1){var _0x486687={'method':'POST','uri':_0x4ccb94+'label_entry'+'?'+_0xef1be7,'body':{'label':_0x5b17b3,'table':_0x167c('0x3f'),'id_type':_0x167c('0x40'),'table_key':_0x2884db[_0x167c('0x41')],'title':_0x167c('0x42')+_0x2884db[_0x167c('0x43')],'id_display':_0x2884db[_0x167c('0x43')]},'auth':_0x598c94,'json':!![]};return rp(_0x486687)[_0x167c('0x9')](function(_0x49a2ce){_0x3f53f1();})[_0x167c('0x11')](function(){_0x3f53f1();});});}function manageTags(_0x331212,_0x258f1e,_0x46f153,_0x2ac28d,_0x279c81,_0x2fdb4a,_0x236572){return new Promise(function(_0x193409,_0x3689fc){var _0x3b1436=[];_0x258f1e[_0x167c('0x28')](function(_0x25f003){_0x3b1436[_0x167c('0x44')](getRemoteTag(_0x25f003,_0x46f153,_0x2ac28d,_0x2fdb4a,_0x236572));});return Promise[_0x167c('0x45')](_0x3b1436)[_0x167c('0x9')](function(_0x25b494){if(_0x25b494[_0x167c('0xa')]){logger['info']('['+[_0x331212['toUpperCase']()]+_0x167c('0x46'),_0x25b494);var _0x53d285=[];_0x25b494[_0x167c('0x28')](function(_0x3821dd){_0x53d285[_0x167c('0x44')](assignTagToIncident(_0x3821dd,_0x46f153,_0x2ac28d,_0x279c81,_0x2fdb4a));});return Promise[_0x167c('0x45')](_0x53d285)[_0x167c('0x9')](function(){_0x193409();})['catch'](function(){_0x193409();});}else{_0x193409();}});});}function getTags(_0x21ddd9,_0x4b2949,_0x209b07,_0x4fd16f,_0x269c91,_0x4b1e90){return function(_0x3edfbd){return new Promise(function(_0x3e6fda,_0x1eea94){var _0x273056=[];var _0x5ecc09=_0x4fd16f['Tags'];if(_0x5ecc09&&_0x5ecc09['length']>0x0){_0x273056=_[_0x167c('0x47')](_0x5ecc09,_0x167c('0x35'));}if(_0x273056[_0x167c('0xa')]>0x0){return manageTags(_0x21ddd9,_0x273056,_0x4b2949,_0x209b07,_0x3edfbd,_0x269c91,_0x4b1e90)[_0x167c('0x9')](function(){_0x3e6fda(_0x3edfbd);});}else{_0x3e6fda(_0x3edfbd);}});};}function emit(_0x25d0ab,_0x436366,_0x3e8dd2){var _0x30ae3b=_0x167c('0x48')+_0x167c('0x49')+_0x167c('0x4a')+'%255EORDERBYDESCnumber';var _0x2d3cf9={'uri':_0x25d0ab+_0x167c('0x4b')+_0x3e8dd2+_0x30ae3b};io['to'](util[_0x167c('0x4c')]('user:%s',_0x436366))[_0x167c('0x4d')]('trigger:browser:url',_0x2d3cf9);}exports['cs']=function(_0x340fd1,_0x45ce8c,_0x3d5350,_0x1723da,_0x5660e5,_0x1070e8,_0x3e420f,_0x1d49c6){var _0xf87a97={};var _0x1cfc2c={'user':_0x1070e8[_0x167c('0x4e')],'pass':_0x1070e8['password']};var _0x28ae41=_0x167c('0x4f');var _0xd31eef=_0x167c('0x50');_0x1070e8[_0x167c('0x51')]=intUtil[_0x167c('0x52')](_0x1070e8['remoteUri']);_0x1070e8[_0x167c('0x53')]=intUtil[_0x167c('0x52')](_0x1070e8['serverUrl']);var _0x4ca2fa=util['format'](_0x167c('0x54'),_0x1070e8['remoteUri']);_0xf87a97[_0x167c('0x16')]=!_[_0x167c('0x55')](_0x1723da)?_0x1723da[_0x167c('0x56')]:null;_0xf87a97[_0x167c('0x1c')]=_0x1070e8['email'];_0xf87a97['endUserNumber']=_0x1d49c6[_0x167c('0x31')]()===_0x167c('0x57')?_0x45ce8c[_0x167c('0x58')]:_0x45ce8c[_0x167c('0x59')];_0xf87a97[_0x167c('0x5a')]=_0x1d49c6==='queue'||_0x1d49c6===_0x167c('0x5b')?_0x167c('0x5c'):_0x167c('0x57');var _0x56f012=util[_0x167c('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1070e8['serverUrl'],_0x45ce8c['uniqueid'],md5(_0x45ce8c[_0x167c('0x5d')]));if(_0x5660e5&&_0x5660e5[_0x167c('0x5e')]){logger['info'](_0x167c('0x5f'),'Recording\x20is\x20enabled!');_0x45ce8c[_0x167c('0x60')]=_0x56f012;}else if(_0x3e420f&&_0x3e420f[_0x167c('0x61')]&&_0x3e420f[_0x167c('0x61')]!==_0x167c('0x62')){logger[_0x167c('0xe')](_0x167c('0x63'),'Recording\x20is\x20enabled!');_0x45ce8c['recordingURL']=_0x56f012;}else{_0x45ce8c['recordingURL']='';}return getAdminUser(_0x1d49c6,_0x1cfc2c,_0xf87a97,_0x4ca2fa,_0xd31eef,_0x28ae41)[_0x167c('0x9')](getUser(_0x1d49c6,_0x1cfc2c,_0x4ca2fa,_0xd31eef,_0x28ae41))[_0x167c('0x9')](getEndUser(_0x1d49c6,_0x1cfc2c,_0x4ca2fa,_0xd31eef,_0x28ae41))[_0x167c('0x9')](getTicket(_0x1d49c6,_0x1cfc2c,_0x4ca2fa,_0x3d5350,_0x45ce8c,_0xd31eef))['then'](function(_0x16fe7f){logger['info'](util[_0x167c('0x4c')]('The\x20ticket\x20ID\x20is:\x20%s',_0x16fe7f[_0x167c('0x41')]));logger[_0x167c('0xe')](util[_0x167c('0x4c')](_0x167c('0x64'),_0x1d49c6));if(_0x1d49c6!==_0x167c('0x5b')){logger['info']('['+[_0x1d49c6[_0x167c('0xf')]()]+']',_0x167c('0x65'));emit(_0x1070e8[_0x167c('0x51')],_0x1723da[_0x167c('0x35')],_0x16fe7f['ticketId']);}})[_0x167c('0x11')](function(_0x18566d){logger['error']('['+[_0x1d49c6['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x18566d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6dd9=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','length','active','true','userId','adminId','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','content','toString','includes','customField','idField','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','ticketNumber','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','adminEmail','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','message','],\x20getUser\x20input\x20crm'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x6dd9,0x144));var _0x96dd=function(_0x44f4ed,_0x186319){_0x44f4ed=_0x44f4ed-0x0;var _0x2fdebf=_0x6dd9[_0x44f4ed];return _0x2fdebf;};'use strict';var _=require(_0x96dd('0x0'));var Promise=require(_0x96dd('0x1'));var rp=require(_0x96dd('0x2'));var util=require(_0x96dd('0x3'));var md5=require(_0x96dd('0x4'));var Redis=require(_0x96dd('0x5'));var intUtil=require(_0x96dd('0x6'));var config=require(_0x96dd('0x7'));var logger=require(_0x96dd('0x8'))(_0x96dd('0x9'));config[_0x96dd('0xa')]=_[_0x96dd('0xb')](config['redis'],{'host':_0x96dd('0xc'),'port':0x18eb});var io=require(_0x96dd('0xd'))(new Redis(config[_0x96dd('0xa')]));function getAdminUser(_0x46a14b,_0x56ff01,_0x23e93a,_0xac257c,_0x4e6386,_0x4bfa23){return new Promise(function(_0x51ad6e,_0x55cfe5){var _0x307cef={'method':_0x96dd('0xe'),'uri':_0xac257c+_0x96dd('0xf')+'&'+_0x4e6386+'&'+_0x4bfa23,'auth':_0x56ff01,'json':!![]};return rp(_0x307cef)[_0x96dd('0x10')](function(_0x1fe3df){if(_0x1fe3df[_0x96dd('0x11')]['length']>0x0){_0x23e93a['adminId']=_0x1fe3df[_0x96dd('0x11')][0x0][_0x96dd('0x12')];}logger[_0x96dd('0x13')]('['+[_0x46a14b[_0x96dd('0x14')]()]+_0x96dd('0x15'),_0x23e93a);_0x51ad6e(_0x23e93a);})['catch'](function(_0x1fafaf){logger['error']('['+[_0x46a14b[_0x96dd('0x14')]()]+']',_0x1fafaf['message']);_0x55cfe5(_0x1fafaf[_0x96dd('0x16')]);});});}function getUser(_0x4b775c,_0x5ef04b,_0x5ae38b,_0x51ac0a,_0x136ede){return function(_0x11fad5){logger['info']('['+[_0x4b775c[_0x96dd('0x14')]()]+_0x96dd('0x17'),_0x11fad5);return new Promise(function(_0x389496,_0x4df307){if(intUtil[_0x96dd('0x18')](_0x11fad5[_0x96dd('0x19')])){var _0x4f509d={'method':_0x96dd('0xe'),'uri':_0x5ae38b+_0x96dd('0x1a')+_0x11fad5[_0x96dd('0x19')]+'&'+_0x51ac0a+'&'+_0x136ede,'auth':_0x5ef04b,'json':!![]};logger[_0x96dd('0x13')]('['+[_0x4b775c['toUpperCase']()]+_0x96dd('0x1b'),_0x4f509d);return rp(_0x4f509d)[_0x96dd('0x10')](function(_0xaea810){logger[_0x96dd('0x13')]('['+[_0x4b775c[_0x96dd('0x14')]()]+'],\x20getUser\x20entity',_0xaea810);if(_0xaea810['result'][_0x96dd('0x1c')]>0x0&&String(_0xaea810['result'][0x0][_0x96dd('0x1d')])===_0x96dd('0x1e')){_0x11fad5[_0x96dd('0x1f')]=_0xaea810[_0x96dd('0x11')][0x0][_0x96dd('0x12')];}else{_0x11fad5['userId']=_0x11fad5[_0x96dd('0x20')];_0x11fad5[_0x96dd('0x19')]=_0x11fad5['adminEmail'];}logger[_0x96dd('0x13')]('['+[_0x4b775c['toUpperCase']()]+_0x96dd('0x21'),_0x11fad5);_0x389496(_0x11fad5);})['catch'](function(_0x41d767){logger[_0x96dd('0x22')]('['+[_0x4b775c[_0x96dd('0x14')]()]+']',_0x41d767[_0x96dd('0x16')]);_0x4df307(_0x41d767[_0x96dd('0x16')]);});}else{logger[_0x96dd('0x13')]('['+[_0x4b775c[_0x96dd('0x14')]()]+_0x96dd('0x23'));_0x11fad5[_0x96dd('0x1f')]=_0x11fad5['adminId'];_0x11fad5['userEmail']=_0x11fad5['adminEmail'];_0x389496(_0x11fad5);}});};}function createEndUser(_0x4fa319,_0x4945fa,_0x31f343,_0x4a6b96,_0x78ce94){logger[_0x96dd('0x13')]('['+[_0x4fa319[_0x96dd('0x14')]()]+_0x96dd('0x24'),_0x31f343);return new Promise(function(_0x2fc4f5,_0x4c4d5e){var _0x13607d={'method':'POST','uri':_0x4a6b96+_0x96dd('0x25')+_0x78ce94,'body':{'user_name':_0x31f343[_0x96dd('0x26')],'roles':'user','first_name':_0x31f343['endUserNumber'],'active':_0x96dd('0x1e'),'date_format':_0x96dd('0x27'),'phone':_0x31f343['endUserNumber']},'auth':_0x4945fa,'json':!![]};return rp(_0x13607d)[_0x96dd('0x10')](function(_0x10c4c9){logger[_0x96dd('0x13')]('['+[_0x4fa319[_0x96dd('0x14')]()]+_0x96dd('0x28'),_0x10c4c9[_0x96dd('0x11')]);_0x31f343[_0x96dd('0x29')]=_0x10c4c9[_0x96dd('0x11')][_0x96dd('0x12')];_0x2fc4f5(_0x31f343);})[_0x96dd('0x2a')](function(_0x24b711){logger[_0x96dd('0x22')]('['+[_0x4fa319[_0x96dd('0x14')]()]+']',_0x24b711['message']);_0x4c4d5e(_0x24b711[_0x96dd('0x16')]);});});}function getEndUser(_0x247a1a,_0x2bbf71,_0x4d9607,_0x40181d,_0x39819c){return function(_0x23c015){logger[_0x96dd('0x13')]('['+[_0x247a1a[_0x96dd('0x14')]()]+_0x96dd('0x2b'),_0x23c015);return new Promise(function(_0x59b42a,_0x5ba4ef){var _0x30489e={'method':_0x96dd('0xe'),'uri':_0x4d9607+_0x96dd('0x2c')+_0x23c015['endUserNumber']+'&'+_0x40181d+'&'+_0x39819c,'auth':_0x2bbf71,'json':!![]};return rp(_0x30489e)[_0x96dd('0x10')](function(_0x4bf555){if(_0x4bf555[_0x96dd('0x11')]['length']>0x0){_0x23c015['endUserId']=_0x4bf555[_0x96dd('0x11')][0x0][_0x96dd('0x12')];logger[_0x96dd('0x13')]('['+[_0x247a1a[_0x96dd('0x14')]()]+'],\x20getEndUser\x20crm',_0x23c015);_0x59b42a(_0x23c015);}else{return createEndUser(_0x247a1a,_0x2bbf71,_0x23c015,_0x4d9607,_0x40181d)[_0x96dd('0x10')](function(_0x2cac40){logger[_0x96dd('0x13')]('['+[_0x247a1a[_0x96dd('0x14')]()]+_0x96dd('0x2d'),_0x2cac40);_0x59b42a(_0x2cac40);});}})[_0x96dd('0x2a')](function(_0x294be4){logger['error']('['+[_0x247a1a['toUpperCase']()]+']',_0x294be4[_0x96dd('0x16')]);_0x5ba4ef(_0x294be4[_0x96dd('0x16')]);});});};}function getCustomFields(_0x1c92b4,_0x14814a){var _0x8c70ac={};if(_0x1c92b4['length']>0x0){_[_0x96dd('0x2e')](_0x1c92b4,function(_0x32f441){if(_['includes']([_0x96dd('0x2f'),_0x96dd('0x30')],_0x32f441[_0x96dd('0x31')])&&_0x32f441[_0x96dd('0x32')]&&!_0x32f441['customField']){_0x8c70ac[_0x32f441[_0x96dd('0x32')]['toLowerCase']()]=_0x32f441[_0x96dd('0x33')][_0x96dd('0x34')]();}else if(_[_0x96dd('0x35')]([_0x96dd('0x2f'),_0x96dd('0x30')],_0x32f441[_0x96dd('0x31')])&&_0x32f441['idField']&&_0x32f441[_0x96dd('0x36')]){_0x8c70ac[_0x32f441[_0x96dd('0x37')][_0x96dd('0x38')]()]=_0x32f441[_0x96dd('0x33')][_0x96dd('0x34')]();}else if(_0x32f441['type']===_0x96dd('0x39')&&_0x32f441[_0x96dd('0x3a')]&&_0x32f441[_0x96dd('0x37')]&&_0x32f441[_0x96dd('0x36')]){_0x8c70ac[_0x32f441['idField']['toLowerCase']()]=_0x14814a[_0x32f441[_0x96dd('0x3a')]][_0x96dd('0x34')]();}else if(_0x32f441[_0x96dd('0x31')]==='customVariable'&&_0x32f441['Variable']&&_0x32f441[_0x96dd('0x3b')][_0x96dd('0x3c')]&&_0x32f441[_0x96dd('0x37')]&&_0x32f441[_0x96dd('0x36')]){_0x8c70ac[_0x32f441[_0x96dd('0x37')]['toLowerCase']()]=_0x14814a[_0x32f441[_0x96dd('0x3b')][_0x96dd('0x3c')][_0x96dd('0x38')]()][_0x96dd('0x34')]();}});}return _0x8c70ac;}function getTicket(_0x15919f,_0x30f768,_0xf3df2a,_0x408083,_0x42ce81,_0x3ce8cf){return function(_0x3659a3){logger[_0x96dd('0x13')]('['+[_0x15919f[_0x96dd('0x14')]()]+_0x96dd('0x3d'),_0x3659a3);return new Promise(function(_0x2c3f68,_0x1d66ce){var _0x1d5601=_0x15919f[_0x96dd('0x38')]()===_0x96dd('0x3e')?_0x3659a3[_0x96dd('0x1f')]:_0x3659a3[_0x96dd('0x29')];var _0x5e8e99={'method':_0x96dd('0x3f'),'uri':_0xf3df2a+_0x96dd('0x40')+'?'+_0x3ce8cf,'body':Object[_0x96dd('0x41')]({},{'active':_0x96dd('0x1e'),'caller_id':_0x1d5601,'assigned_to':_0x3659a3[_0x96dd('0x1f')],'short_description':intUtil[_0x96dd('0x42')](_0x408083[_0x96dd('0x43')],_0x42ce81,'\x20'),'description':intUtil[_0x96dd('0x42')](_0x408083[_0x96dd('0x44')],_0x42ce81,'\x0a')},getCustomFields(_0x408083[_0x96dd('0x45')],_0x42ce81)),'auth':_0x30f768,'json':!![]};return rp(_0x5e8e99)['then'](function(_0x39a10d){logger[_0x96dd('0x13')]('['+[_0x15919f['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x39a10d[_0x96dd('0x11')]);_0x3659a3[_0x96dd('0x46')]=_0x39a10d[_0x96dd('0x11')][_0x96dd('0x12')];_0x3659a3['ticketNumber']=_0x39a10d[_0x96dd('0x11')][_0x96dd('0x47')];logger[_0x96dd('0x13')]('['+[_0x15919f[_0x96dd('0x14')]()]+_0x96dd('0x48'),_0x3659a3);_0x2c3f68(_0x3659a3);})[_0x96dd('0x2a')](function(_0x5e824b){logger[_0x96dd('0x22')]('['+[_0x15919f[_0x96dd('0x14')]()]+']',_0x5e824b[_0x96dd('0x16')]);_0x1d66ce(_0x5e824b[_0x96dd('0x16')]);});});};}function createRemoteTag(_0x5ba608,_0x50d911,_0x21196b,_0x1014ac){return new Promise(function(_0x401ca3,_0x55d97f){var _0x6a1d72={'method':_0x96dd('0x3f'),'uri':_0x21196b+'label'+'?'+_0x1014ac,'body':{'short_description':_0x5ba608,'global':!![],'active':!![],'name':_0x5ba608},'auth':_0x50d911,'json':!![]};return rp(_0x6a1d72)[_0x96dd('0x10')](function(_0xca0120){var _0x4f9eef=_0xca0120[_0x96dd('0x11')][_0x96dd('0x12')];_0x401ca3(_0x4f9eef);});});}function getRemoteTag(_0x1076f7,_0x188299,_0x318522,_0x28094c,_0x1607b8){return new Promise(function(_0x4a8b1f,_0x922bc7){var _0x84abd7={'method':_0x96dd('0xe'),'uri':_0x318522+_0x96dd('0x49')+_0x96dd('0x4a')+_0x1076f7+'&'+_0x28094c,'auth':_0x188299,'json':!![]};return rp(_0x84abd7)[_0x96dd('0x10')](function(_0x3fac6c){if(_0x3fac6c[_0x96dd('0x11')][_0x96dd('0x1c')]>0x0){var _0x441751=_0x3fac6c[_0x96dd('0x11')][0x0][_0x96dd('0x12')];_0x4a8b1f(_0x441751);}else{return createRemoteTag(_0x1076f7,_0x188299,_0x318522,_0x28094c)[_0x96dd('0x10')](function(_0x25d51e){_0x4a8b1f(_0x25d51e);});}});});}function assignTagToIncident(_0x26f9e7,_0x3f24c7,_0x4c71c4,_0x3ca42d,_0x4f70e2){return new Promise(function(_0xd12480,_0x2eebaf){var _0x3b9b88={'method':_0x96dd('0x3f'),'uri':_0x4c71c4+_0x96dd('0x4b')+'?'+_0x4f70e2,'body':{'label':_0x26f9e7,'table':'incident','id_type':'Incident','table_key':_0x3ca42d[_0x96dd('0x46')],'title':_0x96dd('0x4c')+_0x3ca42d[_0x96dd('0x4d')],'id_display':_0x3ca42d[_0x96dd('0x4d')]},'auth':_0x3f24c7,'json':!![]};return rp(_0x3b9b88)[_0x96dd('0x10')](function(_0x15d3cb){_0xd12480();})[_0x96dd('0x2a')](function(){_0xd12480();});});}function manageTags(_0x11fed3,_0x1add92,_0x55ef36,_0x1b11a1,_0x57fe7a,_0x3681da,_0x197d92){return new Promise(function(_0x5db2d9,_0x16d20f){var _0x2a6e30=[];_0x1add92[_0x96dd('0x2e')](function(_0x6475d3){_0x2a6e30[_0x96dd('0x4e')](getRemoteTag(_0x6475d3,_0x55ef36,_0x1b11a1,_0x3681da,_0x197d92));});return Promise['all'](_0x2a6e30)[_0x96dd('0x10')](function(_0xb7308b){if(_0xb7308b[_0x96dd('0x1c')]){logger[_0x96dd('0x13')]('['+[_0x11fed3[_0x96dd('0x14')]()]+_0x96dd('0x4f'),_0xb7308b);var _0x597550=[];_0xb7308b[_0x96dd('0x2e')](function(_0x4ba972){_0x597550[_0x96dd('0x4e')](assignTagToIncident(_0x4ba972,_0x55ef36,_0x1b11a1,_0x57fe7a,_0x3681da));});return Promise['all'](_0x597550)[_0x96dd('0x10')](function(){_0x5db2d9();})[_0x96dd('0x2a')](function(){_0x5db2d9();});}else{_0x5db2d9();}});});}function getTags(_0x3c3f69,_0x5b60d7,_0x1281b0,_0xe23eb1,_0x3f511c,_0x496383){return function(_0xef0039){return new Promise(function(_0xe92885,_0x35c4ee){var _0x3da3be=[];var _0x4f9a2b=_0xe23eb1[_0x96dd('0x50')];if(_0x4f9a2b&&_0x4f9a2b[_0x96dd('0x1c')]>0x0){_0x3da3be=_[_0x96dd('0x51')](_0x4f9a2b,_0x96dd('0x3c'));}if(_0x3da3be['length']>0x0){return manageTags(_0x3c3f69,_0x3da3be,_0x5b60d7,_0x1281b0,_0xef0039,_0x3f511c,_0x496383)[_0x96dd('0x10')](function(){_0xe92885(_0xef0039);});}else{_0xe92885(_0xef0039);}});};}function emit(_0x2b6f3d,_0x2c90dc,_0x124aed){var _0x19e827=_0x96dd('0x52')+_0x96dd('0x53')+_0x96dd('0x54')+_0x96dd('0x55');var _0x5512a2={'uri':_0x2b6f3d+_0x96dd('0x56')+_0x124aed+_0x19e827};io['to'](util[_0x96dd('0x57')](_0x96dd('0x58'),_0x2c90dc))[_0x96dd('0x59')](_0x96dd('0x5a'),_0x5512a2);}exports['cs']=function(_0x29ca37,_0x1ab66e,_0x1c0bc7,_0x362ebb,_0x1db9f3,_0x5c64f8,_0x5ba00c,_0x269afc){var _0x237b57={};var _0x1a911d={'user':_0x5c64f8[_0x96dd('0x5b')],'pass':_0x5c64f8[_0x96dd('0x5c')]};var _0xad08ee=_0x96dd('0x5d');var _0x3dc54c='sysparm_display_value=true';_0x5c64f8[_0x96dd('0x5e')]=intUtil[_0x96dd('0x5f')](_0x5c64f8[_0x96dd('0x5e')]);_0x5c64f8[_0x96dd('0x60')]=intUtil[_0x96dd('0x5f')](_0x5c64f8[_0x96dd('0x60')]);var _0x398de8=util['format'](_0x96dd('0x61'),_0x5c64f8[_0x96dd('0x5e')]);_0x237b57[_0x96dd('0x19')]=!_[_0x96dd('0x62')](_0x362ebb)?_0x362ebb[_0x96dd('0x63')]:null;_0x237b57[_0x96dd('0x64')]=_0x5c64f8[_0x96dd('0x63')];_0x237b57['endUserNumber']=_0x269afc[_0x96dd('0x38')]()===_0x96dd('0x3e')?_0x1ab66e['destcalleridnum']:_0x1ab66e['calleridnum'];_0x237b57['callDirection']=_0x269afc===_0x96dd('0x65')||_0x269afc===_0x96dd('0x66')?_0x96dd('0x65'):_0x96dd('0x3e');var _0x281efc=util[_0x96dd('0x57')](_0x96dd('0x67'),_0x5c64f8['serverUrl'],_0x1ab66e[_0x96dd('0x68')],md5(_0x1ab66e['uniqueid']));if(_0x1db9f3&&_0x1db9f3[_0x96dd('0x69')]){logger[_0x96dd('0x13')](_0x96dd('0x6a'),_0x96dd('0x6b'));_0x1ab66e[_0x96dd('0x6c')]=_0x281efc;}else if(_0x5ba00c&&_0x5ba00c[_0x96dd('0x6d')]&&_0x5ba00c[_0x96dd('0x6d')]!==_0x96dd('0x6e')){logger[_0x96dd('0x13')](_0x96dd('0x6f'),'Recording\x20is\x20enabled!');_0x1ab66e[_0x96dd('0x6c')]=_0x281efc;}else{_0x1ab66e[_0x96dd('0x6c')]='';}return getAdminUser(_0x269afc,_0x1a911d,_0x237b57,_0x398de8,_0x3dc54c,_0xad08ee)['then'](getUser(_0x269afc,_0x1a911d,_0x398de8,_0x3dc54c,_0xad08ee))[_0x96dd('0x10')](getEndUser(_0x269afc,_0x1a911d,_0x398de8,_0x3dc54c,_0xad08ee))[_0x96dd('0x10')](getTicket(_0x269afc,_0x1a911d,_0x398de8,_0x1c0bc7,_0x1ab66e,_0x3dc54c))[_0x96dd('0x10')](function(_0x3be829){logger['info'](util[_0x96dd('0x57')](_0x96dd('0x70'),_0x3be829[_0x96dd('0x46')]));logger[_0x96dd('0x13')](util[_0x96dd('0x57')](_0x96dd('0x71'),_0x269afc));if(_0x269afc!==_0x96dd('0x66')){logger[_0x96dd('0x13')]('['+[_0x269afc[_0x96dd('0x14')]()]+']',_0x96dd('0x72'));emit(_0x5c64f8[_0x96dd('0x5e')],_0x362ebb[_0x96dd('0x3c')],_0x3be829[_0x96dd('0x46')]);}})[_0x96dd('0x2a')](function(_0x309557){logger[_0x96dd('0x22')]('['+[_0x269afc[_0x96dd('0x14')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x96dd('0x73')](_0x309557,{'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 e88fa93..915661f 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 _0xe1b4=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','forEach','type','string','customField','content','custom_fields','Variable','toLowerCase','login','username','password','PLAIN','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','calleridname','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','user_name','entry_list','find','resolve','name_value_list','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!'];(function(_0xfb7ecb,_0x2837dc){var _0x4deac2=function(_0xd955de){while(--_0xd955de){_0xfb7ecb['push'](_0xfb7ecb['shift']());}};_0x4deac2(++_0x2837dc);}(_0xe1b4,0x1a8));var _0x4e1b=function(_0x32ad2d,_0x188218){_0x32ad2d=_0x32ad2d-0x0;var _0x2e5aa2=_0xe1b4[_0x32ad2d];return _0x2e5aa2;};'use strict';var _=require('lodash');var rp=require(_0x4e1b('0x0'));var BPromise=require(_0x4e1b('0x1'));var md5=require(_0x4e1b('0x2'));var util=require('util');var Redis=require(_0x4e1b('0x3'));var intUtil=require(_0x4e1b('0x4'));var config=require(_0x4e1b('0x5'));var logger=require(_0x4e1b('0x6'))('sugarcrm');config[_0x4e1b('0x7')]=_[_0x4e1b('0x8')](config[_0x4e1b('0x7')],{'host':_0x4e1b('0x9'),'port':0x18eb});var io=require(_0x4e1b('0xa'))(new Redis(config[_0x4e1b('0x7')]));var def={'method':_0x4e1b('0xb'),'json':!![]};function emit(_0x214c80,_0x225481,_0x5c87ec){io['to'](_0x214c80)[_0x4e1b('0xc')](_0x225481,_0x5c87ec);}function getTicket(_0x937241,_0x5d70f3,_0x43a939,_0x5e64b,_0x3c8532,_0x42f1d8,_0x3437fa,_0x2231b2){logger[_0x4e1b('0xd')](_0x4e1b('0xe'));var _0x41261=new Date();var _0xe97be5=[{'name':_0x4e1b('0xf'),'value':intUtil[_0x4e1b('0x10')](_0x5e64b[_0x4e1b('0x11')],_0x3c8532,'\x20')},{'name':'assigned_user_id','value':_0x5d70f3['id']},{'name':'created_by','value':_0x5d70f3['id']},{'name':'description','value':intUtil[_0x4e1b('0x10')](_0x5e64b[_0x4e1b('0x12')],_0x3c8532,'\x0a')},{'name':_0x4e1b('0x13'),'value':_0x41261[_0x4e1b('0x14')]()[_0x4e1b('0x15')](0x0,0x13)[_0x4e1b('0x16')]('T','\x20')},{'name':_0x4e1b('0x17'),'value':'0'},{'name':_0x4e1b('0x18'),'value':'15'},{'name':_0x4e1b('0x19'),'value':_0x43a939['id']},{'name':_0x4e1b('0x1a'),'value':'Contacts'},{'name':_0x4e1b('0x1b'),'value':_0x43a939[_0x4e1b('0xf')]},{'name':_0x4e1b('0x1c'),'value':_0x2231b2}];if(_0x42f1d8[_0x4e1b('0x1d')]){_['forEach'](_0x42f1d8,function(_0x482db1){if(_0x3c8532[_0x482db1[_0x4e1b('0x1e')]]){_0xe97be5[_0x4e1b('0x1f')]({'name':_0x482db1[_0x4e1b('0x20')],'value':_0x3c8532[_0x482db1['variableName']]});}});}return request({'form':{'method':_0x4e1b('0x21'),'input_type':_0x4e1b('0x22'),'response_type':_0x4e1b('0x22'),'rest_data':JSON[_0x4e1b('0x23')]({'session':_0x3437fa['id'],'module_name':_0x4e1b('0x24'),'name_value_list':_0xe97be5})}});}function getAuth(_0x21c39a){return util[_0x4e1b('0x25')](_0x4e1b('0x26'),new Buffer(_0x21c39a[_0x4e1b('0x27')]+':X')[_0x4e1b('0x28')](_0x4e1b('0x29')));}function getServerInfo(_0x2af7e){return request({'form':{'method':_0x4e1b('0x2a'),'input_type':_0x4e1b('0x22'),'response_type':_0x4e1b('0x22'),'rest_data':JSON[_0x4e1b('0x23')]({'session':_0x2af7e['id']})}});}function getUser(_0x3d7be3,_0xd759c7,_0x2de688){if(!_[_0x4e1b('0x2b')](_0xd759c7)){logger[_0x4e1b('0xd')](_0x4e1b('0x2c'),_0xd759c7);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x4e1b('0x22'),'rest_data':JSON[_0x4e1b('0x23')]({'session':_0x2de688['id'],'module_name':'Employees','query':util[_0x4e1b('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0xd759c7),'order_by':'','offset':'0','select_fields':['id',_0x4e1b('0xf'),_0x4e1b('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x23a710){if(_0x23a710[_0x4e1b('0x2e')][_0x4e1b('0x1d')]){var _0x155752=_[_0x4e1b('0x2f')](_0x23a710['entry_list'],function(_0x2ad875){return _0x2ad875['name_value_list']['user_name']['value']===_0xd759c7;});if(_0x155752){logger[_0x4e1b('0xd')]('Agent\x20found!');return BPromise[_0x4e1b('0x30')]({'id':_0x155752[_0x4e1b('0x31')]['id'][_0x4e1b('0x32')],'name':_0x155752['name_value_list'][_0x4e1b('0xf')]['value']});}}logger[_0x4e1b('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4e1b('0x30')]({'id':_0x2de688[_0x4e1b('0x31')][_0x4e1b('0x33')][_0x4e1b('0x32')],'name':_0x2de688[_0x4e1b('0x31')][_0x4e1b('0x2d')][_0x4e1b('0x32')]});});}else{logger[_0x4e1b('0xd')](_0x4e1b('0x34'));return BPromise[_0x4e1b('0x30')]({'id':_0x2de688[_0x4e1b('0x31')][_0x4e1b('0x33')][_0x4e1b('0x32')],'name':_0x2de688[_0x4e1b('0x31')][_0x4e1b('0x2d')][_0x4e1b('0x32')]});}}function getEndUser(_0x2db5fd,_0x28b250,_0x20b86e,_0x14ffad){logger[_0x4e1b('0xd')](_0x4e1b('0x35'),_0x20b86e);return request({'form':{'method':_0x4e1b('0x36'),'input_type':_0x4e1b('0x22'),'response_type':'JSON','rest_data':JSON[_0x4e1b('0x23')]({'session':_0x14ffad['id'],'module_name':_0x4e1b('0x37'),'query':util['format'](_0x4e1b('0x38'),_0x20b86e),'order_by':'','offset':'0','select_fields':['id',_0x4e1b('0xf'),_0x4e1b('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4e1b('0x3a')](function(_0x3d11d2){if(_0x3d11d2['entry_list'][_0x4e1b('0x1d')]){var _0x51270f=_['find'](_0x3d11d2[_0x4e1b('0x2e')],function(_0x18bd4a){return _0x18bd4a[_0x4e1b('0x31')][_0x4e1b('0x39')][_0x4e1b('0x32')]===_0x20b86e;});if(_0x51270f){logger[_0x4e1b('0xd')](_0x4e1b('0x3b'));return BPromise[_0x4e1b('0x30')]({'id':_0x51270f[_0x4e1b('0x31')]['id'][_0x4e1b('0x32')],'name':_0x51270f[_0x4e1b('0x31')][_0x4e1b('0xf')][_0x4e1b('0x32')],'phone':_0x51270f[_0x4e1b('0x31')][_0x4e1b('0x39')][_0x4e1b('0x32')]});}}else{logger[_0x4e1b('0xd')](_0x4e1b('0x3c'));return request({'form':{'method':_0x4e1b('0x21'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x14ffad['id'],'module_name':_0x4e1b('0x37'),'name_value_list':[{'name':_0x4e1b('0x3d'),'value':_0x28b250!==_0x4e1b('0x3e')?_0x28b250:util[_0x4e1b('0x25')](_0x4e1b('0x3f'),_0x20b86e)},{'name':_0x4e1b('0x39'),'value':_0x20b86e}]})}})['then'](function(_0x10b126){logger[_0x4e1b('0xd')](_0x4e1b('0x40'));return BPromise[_0x4e1b('0x30')]({'id':_0x10b126['id'],'name':_0x10b126['entry_list'][_0x4e1b('0x3d')]['value'],'phone':_0x10b126[_0x4e1b('0x2e')][_0x4e1b('0x39')]['value']});});}});}function request(_0x8f8e85){logger['debug'](_0x4e1b('0x41'),JSON[_0x4e1b('0x23')](_0x8f8e85));return rp(_[_0x4e1b('0x42')](def,_0x8f8e85));}function getTags(_0x235dbd,_0x409f7a){var _0x8b8f51=[];if(_0x235dbd&&_0x235dbd[_0x4e1b('0x1d')]>0x0){_0x8b8f51=_[_0x4e1b('0x43')](_0x235dbd,_0x409f7a);}return _0x8b8f51;}function getCustomFields(_0x3a9ab8,_0x3470bf){var _0x304f91=[];var _0x1c0649={'custom_fields':[]};if(_0x3a9ab8[_0x4e1b('0x1d')]>0x0){_[_0x4e1b('0x44')](_0x3a9ab8,function(_0x220dc9){if(_0x220dc9[_0x4e1b('0x45')]===_0x4e1b('0x46')&&_0x220dc9['nameField']&&!_0x220dc9[_0x4e1b('0x47')]){_0x1c0649[_0x220dc9['nameField']['toLowerCase']()]=_0x220dc9[_0x4e1b('0x48')]['toString']();}else if(_0x220dc9[_0x4e1b('0x45')]===_0x4e1b('0x46')&&_0x220dc9['idField']&&_0x220dc9[_0x4e1b('0x47')]){_0x1c0649[_0x4e1b('0x49')]['push']({'id':_0x220dc9[_0x4e1b('0x20')],'value':_0x220dc9['content'][_0x4e1b('0x28')]()});}else if(_0x220dc9[_0x4e1b('0x45')]==='variable'&&_0x220dc9[_0x4e1b('0x1e')]&&_0x220dc9['idField']&&_0x220dc9[_0x4e1b('0x47')]){_0x3470bf[_0x220dc9[_0x4e1b('0x1e')]]&&_0x1c0649[_0x4e1b('0x49')][_0x4e1b('0x1f')]({'id':_0x220dc9[_0x4e1b('0x20')],'value':_0x3470bf[_0x220dc9[_0x4e1b('0x1e')]][_0x4e1b('0x28')]()});}else if(_0x220dc9[_0x4e1b('0x45')]==='customVariable'&&_0x220dc9[_0x4e1b('0x4a')]&&_0x220dc9[_0x4e1b('0x4a')][_0x4e1b('0xf')]&&_0x220dc9[_0x4e1b('0x20')]&&_0x220dc9[_0x4e1b('0x47')]){_0x3470bf[_0x220dc9['Variable'][_0x4e1b('0xf')][_0x4e1b('0x4b')]()]&&_0x1c0649[_0x4e1b('0x49')][_0x4e1b('0x1f')]({'id':_0x220dc9[_0x4e1b('0x20')],'value':_0x3470bf[_0x220dc9['Variable'][_0x4e1b('0xf')][_0x4e1b('0x4b')]()][_0x4e1b('0x28')]()});}});}return _0x1c0649;}function getConnection(_0x12af3d){return request({'method':'POST','form':{'method':_0x4e1b('0x4c'),'input_type':_0x4e1b('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x12af3d[_0x4e1b('0x4d')],'password':_0x12af3d[_0x4e1b('0x4e')],'encryption':_0x4e1b('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x4e1b('0x3a')](function(_0x58aaeb){var _0x42955d=_0x58aaeb;if(_0x42955d['id']){def[_0x4e1b('0x50')]=_0x42955d['id'];return BPromise[_0x4e1b('0x30')](_0x42955d);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x12af3d['id']));}});}function setRelationship(_0xc65f62,_0x2bd7bf,_0x54c44d,_0x46ec5c){return request({'form':{'method':_0x4e1b('0x51'),'input_type':_0x4e1b('0x22'),'response_type':_0x4e1b('0x22'),'rest_data':JSON[_0x4e1b('0x23')]({'session':_0xc65f62['id'],'module_name':_0x4e1b('0x24'),'module_id':_0x54c44d['id'],'link_field_name':_0x46ec5c,'related_ids':[_0x2bd7bf['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4e1b('0x52')]=function(_0x2d15a3,_0x59fffe,_0x5023ec,_0x30cda2,_0xf61ed,_0x3848de){var _0x2b7e29,_0x36b3eb,_0x53d73d,_0x20d310;_0x3848de['remoteUri']=intUtil[_0x4e1b('0x53')](_0x3848de[_0x4e1b('0x54')]);_0x3848de[_0x4e1b('0x55')]=intUtil[_0x4e1b('0x53')](_0x3848de[_0x4e1b('0x55')]);def[_0x4e1b('0x56')]=util['format'](_0x4e1b('0x57'),_0x3848de[_0x4e1b('0x54')]);if(_0xf61ed&&_0xf61ed['monitor_format']){logger['info'](_0x4e1b('0x58'),_0x4e1b('0x59'));_0x59fffe[_0x4e1b('0x5a')]=util[_0x4e1b('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3848de['serverUrl'],_0x59fffe['uniqueid'],md5(_0x59fffe[_0x4e1b('0x5b')]));}else{_0x59fffe[_0x4e1b('0x5a')]='';}return getConnection(_0x3848de)[_0x4e1b('0x3a')](function(_0x186307){_0x20d310=_0x186307;return getUser(_0x3848de,_0x30cda2[_0x4e1b('0xf')],_0x20d310);})[_0x4e1b('0x3a')](function(_0x94ce3d){_0x2b7e29=_0x94ce3d;logger[_0x4e1b('0xd')](_0x4e1b('0x5c'),_0x2b7e29['id']);return getEndUser(_0x3848de,_0x59fffe['calleridname'],_0x59fffe[_0x4e1b('0x5d')],_0x20d310);})[_0x4e1b('0x3a')](function(_0x551bbc){_0x36b3eb=_0x551bbc;logger['info'](_0x4e1b('0x5e'),_0x36b3eb['id']);return getTicket(_0x3848de,_0x2b7e29,_0x36b3eb,_0x5023ec,_0x59fffe,_0x5023ec[_0x4e1b('0x5f')],_0x20d310,_0x4e1b('0x60'));})[_0x4e1b('0x3a')](function(_0x2cf9a9){_0x53d73d=_0x2cf9a9;logger[_0x4e1b('0xd')](_0x4e1b('0x61'));logger[_0x4e1b('0xd')](_0x4e1b('0x62'),_0x53d73d['id']);return setRelationship(_0x20d310,_0x2b7e29,_0x53d73d,_0x4e1b('0x63'));})[_0x4e1b('0x3a')](function(){return setRelationship(_0x20d310,_0x36b3eb,_0x53d73d,_0x4e1b('0x64'));})[_0x4e1b('0x3a')](function(){return getServerInfo(_0x20d310);})[_0x4e1b('0x3a')](function(_0xa078d4){var _0xf147d0=parseInt(_0xa078d4[_0x4e1b('0x65')][_0x4e1b('0x66')](0x0));var _0x2a0a99=util[_0x4e1b('0x25')](_0x4e1b('0x67'),_0x3848de[_0x4e1b('0x54')],_0x53d73d['id']);if(_0xf147d0>0x6){_0x2a0a99=util['format'](_0x4e1b('0x68'),_0x3848de[_0x4e1b('0x54')],_0x53d73d['id']);}logger[_0x4e1b('0xd')](_0x4e1b('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4e1b('0x25')](_0x4e1b('0x69'),_0x30cda2['name']),_0x4e1b('0x6a'),{'uri':_0x2a0a99});})[_0x4e1b('0x6b')](function(_0x24f0e3){logger[_0x4e1b('0x6c')](_0x4e1b('0x58'),JSON[_0x4e1b('0x23')](_0x24f0e3));});};exports[_0x4e1b('0x6d')]=function(_0x4f3a20,_0x26bac5,_0x482fb0,_0x4142fd,_0x52673e,_0xa6c97d,_0x455000){var _0x1b30e6,_0x23dd42,_0x22cdaf,_0x57d058;_0xa6c97d[_0x4e1b('0x54')]=intUtil['stripTrailingSlash'](_0xa6c97d[_0x4e1b('0x54')]);_0xa6c97d['serverUrl']=intUtil['stripTrailingSlash'](_0xa6c97d[_0x4e1b('0x55')]);def[_0x4e1b('0x56')]=util[_0x4e1b('0x25')]('%s/service/v4_1/rest.php',_0xa6c97d['remoteUri']);if(_0x455000&&_0x455000[_0x4e1b('0x6e')]&&_0x455000[_0x4e1b('0x6e')]!==_0x4e1b('0x6f')){logger[_0x4e1b('0xd')](_0x4e1b('0x70'),'Recording\x20is\x20enabled!');_0x26bac5[_0x4e1b('0x5a')]=util['format'](_0x4e1b('0x71'),_0xa6c97d['serverUrl'],_0x26bac5[_0x4e1b('0x5b')],md5(_0x26bac5['uniqueid']));}return getConnection(_0xa6c97d)['then'](function(_0x412670){_0x57d058=_0x412670;return getUser(_0xa6c97d,_0x4142fd[_0x4e1b('0xf')],_0x57d058);})[_0x4e1b('0x3a')](function(_0x4be717){_0x1b30e6=_0x4be717;logger[_0x4e1b('0xd')](_0x4e1b('0x5c'),_0x1b30e6['id']);return getEndUser(_0xa6c97d,_0x26bac5[_0x4e1b('0x72')],_0x26bac5[_0x4e1b('0x73')],_0x57d058);})[_0x4e1b('0x3a')](function(_0x2d5b46){_0x23dd42=_0x2d5b46;logger['info']('The\x20Enduser\x20ID\x20is:',_0x23dd42['id']);return getTicket(_0xa6c97d,_0x1b30e6,_0x23dd42,_0x482fb0,_0x26bac5,_0x482fb0[_0x4e1b('0x5f')],_0x57d058,_0x4e1b('0x74'));})[_0x4e1b('0x3a')](function(_0x35bf3a){_0x22cdaf=_0x35bf3a;logger['info'](_0x4e1b('0x61'));logger['info'](_0x4e1b('0x62'),_0x22cdaf['id']);return setRelationship(_0x57d058,_0x1b30e6,_0x22cdaf,_0x4e1b('0x63'));})[_0x4e1b('0x3a')](function(){return setRelationship(_0x57d058,_0x23dd42,_0x22cdaf,_0x4e1b('0x64'));})[_0x4e1b('0x3a')](function(){return getServerInfo(_0x57d058);})['then'](function(_0x4bc1ad){var _0x4a4150=parseInt(_0x4bc1ad[_0x4e1b('0x65')][_0x4e1b('0x66')](0x0));var _0x45e65d=util[_0x4e1b('0x25')](_0x4e1b('0x67'),_0xa6c97d[_0x4e1b('0x54')],_0x22cdaf['id']);if(_0x4a4150>0x6){_0x45e65d=util[_0x4e1b('0x25')](_0x4e1b('0x68'),_0xa6c97d[_0x4e1b('0x54')],_0x22cdaf['id']);}logger[_0x4e1b('0xd')](_0x4e1b('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4e1b('0x25')]('user:%s',_0x4142fd[_0x4e1b('0xf')]),_0x4e1b('0x6a'),{'uri':_0x45e65d});})[_0x4e1b('0x6b')](function(_0x5b67a3){logger[_0x4e1b('0x6c')](_0x4e1b('0x70'),JSON[_0x4e1b('0x23')](_0x5b67a3));});};exports[_0x4e1b('0x75')]=function(_0x22f5a6,_0x3f61b3,_0x52f3ed,_0x24561d,_0x38deb4,_0x522b48){var _0x13065b,_0x338505,_0x509848,_0x3dc44d;_0x522b48['remoteUri']=intUtil[_0x4e1b('0x53')](_0x522b48[_0x4e1b('0x54')]);_0x522b48['serverUrl']=intUtil[_0x4e1b('0x53')](_0x522b48[_0x4e1b('0x55')]);def['uri']=util[_0x4e1b('0x25')](_0x4e1b('0x57'),_0x522b48[_0x4e1b('0x54')]);if(_0x38deb4&&_0x38deb4['monitor_format']){logger['info']('['+_0x3f61b3[_0x4e1b('0x76')][_0x4e1b('0x77')]()+']','Recording\x20is\x20enabled!');_0x3f61b3[_0x4e1b('0x5a')]=util[_0x4e1b('0x25')](_0x4e1b('0x71'),_0x522b48[_0x4e1b('0x55')],_0x3f61b3[_0x4e1b('0x5b')],md5(_0x3f61b3[_0x4e1b('0x5b')]));}else{_0x3f61b3['recordingURL']='';}return getConnection(_0x522b48)['then'](function(_0x6aa714){_0x3dc44d=_0x6aa714;if(!_['isNil'](_0x24561d)){return getUser(_0x522b48,_0x24561d[_0x4e1b('0xf')],_0x3dc44d);}else{return getUser(_0x522b48,null,_0x3dc44d);}})[_0x4e1b('0x3a')](function(_0x236b65){_0x13065b=_0x236b65;logger[_0x4e1b('0xd')]('The\x20User\x20ID\x20is:',_0x13065b['id']);return getEndUser(_0x522b48,_0x3f61b3[_0x4e1b('0x78')],_0x3f61b3[_0x4e1b('0x5d')],_0x3dc44d);})[_0x4e1b('0x3a')](function(_0x4bde4b){_0x338505=_0x4bde4b;logger[_0x4e1b('0xd')](_0x4e1b('0x5e'),_0x338505['id']);return getTicket(_0x522b48,_0x13065b,_0x338505,_0x52f3ed,_0x3f61b3,_0x52f3ed['Fields'],_0x3dc44d,_0x4e1b('0x60'));})[_0x4e1b('0x3a')](function(_0x4c9654){_0x509848=_0x4c9654;logger['info'](_0x4e1b('0x61'));logger[_0x4e1b('0xd')](_0x4e1b('0x62'),_0x509848['id']);return setRelationship(_0x3dc44d,_0x13065b,_0x509848,_0x4e1b('0x63'));})[_0x4e1b('0x3a')](function(){return setRelationship(_0x3dc44d,_0x338505,_0x509848,_0x4e1b('0x64'));})[_0x4e1b('0x3a')](function(){return getServerInfo(_0x3dc44d);})[_0x4e1b('0x6b')](function(_0x10d5bc){logger[_0x4e1b('0x6c')]('['+_0x3f61b3[_0x4e1b('0x76')][_0x4e1b('0x77')]()+']',JSON[_0x4e1b('0x23')](_0x10d5bc));});}; \ No newline at end of file +var _0x541a=['[OUTBOUND]','The\x20User\x20ID\x20is:','Outbound','The\x20Ticket\x20ID\x20is:','contacts','error','lastevent','isNil','Inbound','toUpperCase','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','name','getString','assigned_user_id','created_by','description','date_start','toISOString','replace','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','info','Getting\x20agent\x20with\x20name','Employees','entry_list','find','name_value_list','user_name','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','then','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Enduser\x20created.','debug','[HTTP]','merge','type','string','nameField','customField','content','variable','custom_fields','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none'];(function(_0x2c884c,_0x2be82a){var _0x21d0c5=function(_0x1a2ace){while(--_0x1a2ace){_0x2c884c['push'](_0x2c884c['shift']());}};_0x21d0c5(++_0x2be82a);}(_0x541a,0x7e));var _0xa541=function(_0x34f8ba,_0x2bb6a8){_0x34f8ba=_0x34f8ba-0x0;var _0xa5ed05=_0x541a[_0x34f8ba];return _0xa5ed05;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0xa541('0x0'));var util=require(_0xa541('0x1'));var Redis=require(_0xa541('0x2'));var intUtil=require('./util');var config=require(_0xa541('0x3'));var logger=require(_0xa541('0x4'))(_0xa541('0x5'));config['redis']=_['defaults'](config[_0xa541('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xa541('0x7'))(new Redis(config[_0xa541('0x6')]));var def={'method':_0xa541('0x8'),'json':!![]};function emit(_0x373cd9,_0x37c04e,_0x5772e3){io['to'](_0x373cd9)[_0xa541('0x9')](_0x37c04e,_0x5772e3);}function getTicket(_0x5c4d35,_0x15c3cd,_0x121a18,_0x21f04c,_0x1d1d36,_0x36b97b,_0x4788c6,_0xfc839c){logger['info']('Creating\x20new\x20ticket...');var _0x44aba1=new Date();var _0x1f309c=[{'name':_0xa541('0xa'),'value':intUtil[_0xa541('0xb')](_0x21f04c['Subjects'],_0x1d1d36,'\x20')},{'name':_0xa541('0xc'),'value':_0x15c3cd['id']},{'name':_0xa541('0xd'),'value':_0x15c3cd['id']},{'name':_0xa541('0xe'),'value':intUtil[_0xa541('0xb')](_0x21f04c['Descriptions'],_0x1d1d36,'\x0a')},{'name':_0xa541('0xf'),'value':_0x44aba1[_0xa541('0x10')]()['slice'](0x0,0x13)[_0xa541('0x11')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xa541('0x12'),'value':'15'},{'name':_0xa541('0x13'),'value':_0x121a18['id']},{'name':_0xa541('0x14'),'value':_0xa541('0x15')},{'name':'parent_name','value':_0x121a18['name']},{'name':_0xa541('0x16'),'value':_0xfc839c}];if(_0x36b97b[_0xa541('0x17')]){_[_0xa541('0x18')](_0x36b97b,function(_0x3eed4d){if(_0x1d1d36[_0x3eed4d[_0xa541('0x19')]]){_0x1f309c[_0xa541('0x1a')]({'name':_0x3eed4d[_0xa541('0x1b')],'value':_0x1d1d36[_0x3eed4d[_0xa541('0x19')]]});}});}return request({'form':{'method':_0xa541('0x1c'),'input_type':_0xa541('0x1d'),'response_type':_0xa541('0x1d'),'rest_data':JSON[_0xa541('0x1e')]({'session':_0x4788c6['id'],'module_name':_0xa541('0x1f'),'name_value_list':_0x1f309c})}});}function getAuth(_0x2a0455){return util[_0xa541('0x20')](_0xa541('0x21'),new Buffer(_0x2a0455[_0xa541('0x22')]+':X')[_0xa541('0x23')](_0xa541('0x24')));}function getServerInfo(_0x41967c){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa541('0x1e')]({'session':_0x41967c['id']})}});}function getUser(_0xd7a8f8,_0x5b5cc2,_0x2d5875){if(!_['isNil'](_0x5b5cc2)){logger[_0xa541('0x25')](_0xa541('0x26'),_0x5b5cc2);return request({'form':{'method':'get_entry_list','input_type':_0xa541('0x1d'),'response_type':_0xa541('0x1d'),'rest_data':JSON[_0xa541('0x1e')]({'session':_0x2d5875['id'],'module_name':_0xa541('0x27'),'query':util[_0xa541('0x20')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5b5cc2),'order_by':'','offset':'0','select_fields':['id',_0xa541('0xa'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x21c72e){if(_0x21c72e[_0xa541('0x28')][_0xa541('0x17')]){var _0x4cea1c=_[_0xa541('0x29')](_0x21c72e[_0xa541('0x28')],function(_0x1945ca){return _0x1945ca[_0xa541('0x2a')][_0xa541('0x2b')]['value']===_0x5b5cc2;});if(_0x4cea1c){logger[_0xa541('0x25')](_0xa541('0x2c'));return BPromise[_0xa541('0x2d')]({'id':_0x4cea1c[_0xa541('0x2a')]['id'][_0xa541('0x2e')],'name':_0x4cea1c['name_value_list'][_0xa541('0xa')][_0xa541('0x2e')]});}}logger[_0xa541('0x25')](_0xa541('0x2f'));return BPromise['resolve']({'id':_0x2d5875[_0xa541('0x2a')][_0xa541('0x30')][_0xa541('0x2e')],'name':_0x2d5875['name_value_list']['user_name'][_0xa541('0x2e')]});});}else{logger[_0xa541('0x25')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa541('0x2d')]({'id':_0x2d5875[_0xa541('0x2a')][_0xa541('0x30')]['value'],'name':_0x2d5875[_0xa541('0x2a')]['user_name'][_0xa541('0x2e')]});}}function getEndUser(_0x2723d7,_0x5bf285,_0x17f1a0,_0x7d470a){logger['info'](_0xa541('0x31'),_0x17f1a0);return request({'form':{'method':_0xa541('0x32'),'input_type':_0xa541('0x1d'),'response_type':_0xa541('0x1d'),'rest_data':JSON[_0xa541('0x1e')]({'session':_0x7d470a['id'],'module_name':_0xa541('0x15'),'query':util['format'](_0xa541('0x33'),_0x17f1a0),'order_by':'','offset':'0','select_fields':['id',_0xa541('0xa'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa541('0x34')](function(_0xe6e0d9){if(_0xe6e0d9['entry_list'][_0xa541('0x17')]){var _0x35a195=_['find'](_0xe6e0d9['entry_list'],function(_0x17a5fa){return _0x17a5fa['name_value_list'][_0xa541('0x35')][_0xa541('0x2e')]===_0x17f1a0;});if(_0x35a195){logger[_0xa541('0x25')](_0xa541('0x36'));return BPromise[_0xa541('0x2d')]({'id':_0x35a195[_0xa541('0x2a')]['id'][_0xa541('0x2e')],'name':_0x35a195[_0xa541('0x2a')][_0xa541('0xa')][_0xa541('0x2e')],'phone':_0x35a195[_0xa541('0x2a')][_0xa541('0x35')]['value']});}}else{logger[_0xa541('0x25')](_0xa541('0x37'));return request({'form':{'method':_0xa541('0x1c'),'input_type':_0xa541('0x1d'),'response_type':_0xa541('0x1d'),'rest_data':JSON['stringify']({'session':_0x7d470a['id'],'module_name':'Contacts','name_value_list':[{'name':_0xa541('0x38'),'value':_0x5bf285!==''?_0x5bf285:util[_0xa541('0x20')]('Caller\x20-\x20%s',_0x17f1a0)},{'name':_0xa541('0x35'),'value':_0x17f1a0}]})}})[_0xa541('0x34')](function(_0x5d51f7){logger[_0xa541('0x25')](_0xa541('0x39'));return BPromise[_0xa541('0x2d')]({'id':_0x5d51f7['id'],'name':_0x5d51f7['entry_list'][_0xa541('0x38')][_0xa541('0x2e')],'phone':_0x5d51f7['entry_list'][_0xa541('0x35')][_0xa541('0x2e')]});});}});}function request(_0x16ba5a){logger[_0xa541('0x3a')](_0xa541('0x3b'),JSON[_0xa541('0x1e')](_0x16ba5a));return rp(_[_0xa541('0x3c')](def,_0x16ba5a));}function getTags(_0x19bc30,_0x5280c3){var _0x45e999=[];if(_0x19bc30&&_0x19bc30['length']>0x0){_0x45e999=_['map'](_0x19bc30,_0x5280c3);}return _0x45e999;}function getCustomFields(_0x2a907c,_0x495f2a){var _0x16b968=[];var _0xc9961f={'custom_fields':[]};if(_0x2a907c[_0xa541('0x17')]>0x0){_[_0xa541('0x18')](_0x2a907c,function(_0x2c93ac){if(_0x2c93ac[_0xa541('0x3d')]===_0xa541('0x3e')&&_0x2c93ac[_0xa541('0x3f')]&&!_0x2c93ac['customField']){_0xc9961f[_0x2c93ac['nameField']['toLowerCase']()]=_0x2c93ac['content'][_0xa541('0x23')]();}else if(_0x2c93ac[_0xa541('0x3d')]===_0xa541('0x3e')&&_0x2c93ac[_0xa541('0x1b')]&&_0x2c93ac[_0xa541('0x40')]){_0xc9961f['custom_fields']['push']({'id':_0x2c93ac[_0xa541('0x1b')],'value':_0x2c93ac[_0xa541('0x41')]['toString']()});}else if(_0x2c93ac[_0xa541('0x3d')]===_0xa541('0x42')&&_0x2c93ac[_0xa541('0x19')]&&_0x2c93ac[_0xa541('0x1b')]&&_0x2c93ac[_0xa541('0x40')]){_0x495f2a[_0x2c93ac[_0xa541('0x19')]]&&_0xc9961f[_0xa541('0x43')][_0xa541('0x1a')]({'id':_0x2c93ac[_0xa541('0x1b')],'value':_0x495f2a[_0x2c93ac[_0xa541('0x19')]]['toString']()});}else if(_0x2c93ac[_0xa541('0x3d')]===_0xa541('0x44')&&_0x2c93ac[_0xa541('0x45')]&&_0x2c93ac[_0xa541('0x45')][_0xa541('0xa')]&&_0x2c93ac['idField']&&_0x2c93ac['customField']){_0x495f2a[_0x2c93ac['Variable']['name'][_0xa541('0x46')]()]&&_0xc9961f[_0xa541('0x43')][_0xa541('0x1a')]({'id':_0x2c93ac[_0xa541('0x1b')],'value':_0x495f2a[_0x2c93ac['Variable'][_0xa541('0xa')]['toLowerCase']()][_0xa541('0x23')]()});}});}return _0xc9961f;}function getConnection(_0x47b2cf){return request({'method':_0xa541('0x8'),'form':{'method':_0xa541('0x47'),'input_type':_0xa541('0x1d'),'response_type':_0xa541('0x1d'),'rest_data':JSON[_0xa541('0x1e')]({'user_auth':{'user_name':_0x47b2cf[_0xa541('0x48')],'password':_0x47b2cf[_0xa541('0x49')],'encryption':_0xa541('0x4a')},'application':_0xa541('0x4b')})}})[_0xa541('0x34')](function(_0x47ca03){var _0x4e56a9=_0x47ca03;if(_0x4e56a9['id']){def[_0xa541('0x4c')]=_0x4e56a9['id'];return BPromise[_0xa541('0x2d')](_0x4e56a9);}else{throw new Error(util[_0xa541('0x20')](_0xa541('0x4d'),_0x47b2cf['id']));}});}function setRelationship(_0x2f2971,_0x4a6008,_0x1c4dc9,_0x99d3){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xa541('0x1d'),'rest_data':JSON['stringify']({'session':_0x2f2971['id'],'module_name':_0xa541('0x1f'),'module_id':_0x1c4dc9['id'],'link_field_name':_0x99d3,'related_ids':[_0x4a6008['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x1ab55f,_0x50ae0c,_0x7bb8ef,_0x4c8cf0,_0x32ea5,_0x47f506){var _0x2184cb,_0x555a44,_0x31e309,_0x4fef6f;_0x47f506[_0xa541('0x4e')]=intUtil[_0xa541('0x4f')](_0x47f506[_0xa541('0x4e')]);_0x47f506[_0xa541('0x50')]=intUtil[_0xa541('0x4f')](_0x47f506['serverUrl']);def['uri']=util[_0xa541('0x20')]('%s/service/v4_1/rest.php',_0x47f506[_0xa541('0x4e')]);if(_0x32ea5&&_0x32ea5[_0xa541('0x51')]){logger[_0xa541('0x25')](_0xa541('0x52'),_0xa541('0x53'));_0x50ae0c[_0xa541('0x54')]=util['format'](_0xa541('0x55'),_0x47f506['serverUrl'],_0x50ae0c[_0xa541('0x56')],md5(_0x50ae0c['uniqueid']));}else{_0x50ae0c['recordingURL']='';}return getConnection(_0x47f506)['then'](function(_0x5bfa06){_0x4fef6f=_0x5bfa06;return getUser(_0x47f506,_0x4c8cf0[_0xa541('0xa')],_0x4fef6f);})['then'](function(_0x459228){_0x2184cb=_0x459228;logger[_0xa541('0x25')]('The\x20User\x20ID\x20is:',_0x2184cb['id']);return getEndUser(_0x47f506,_0x50ae0c[_0xa541('0x57')],_0x50ae0c[_0xa541('0x58')],_0x4fef6f);})[_0xa541('0x34')](function(_0x59da32){_0x555a44=_0x59da32;logger[_0xa541('0x25')](_0xa541('0x59'),_0x555a44['id']);return getTicket(_0x47f506,_0x2184cb,_0x555a44,_0x7bb8ef,_0x50ae0c,_0x7bb8ef[_0xa541('0x5a')],_0x4fef6f,'Inbound');})[_0xa541('0x34')](function(_0x4aeee3){_0x31e309=_0x4aeee3;logger[_0xa541('0x25')](_0xa541('0x5b'));logger[_0xa541('0x25')]('The\x20Ticket\x20ID\x20is:',_0x31e309['id']);return setRelationship(_0x4fef6f,_0x2184cb,_0x31e309,_0xa541('0x5c'));})[_0xa541('0x34')](function(){return setRelationship(_0x4fef6f,_0x555a44,_0x31e309,'contacts');})['then'](function(){return getServerInfo(_0x4fef6f);})[_0xa541('0x34')](function(_0x274819){var _0x22d8b3=parseInt(_0x274819[_0xa541('0x5d')][_0xa541('0x5e')](0x0));var _0x1312cd=util[_0xa541('0x20')](_0xa541('0x5f'),_0x47f506[_0xa541('0x4e')],_0x31e309['id']);if(_0x22d8b3>0x6){_0x1312cd=util['format'](_0xa541('0x60'),_0x47f506[_0xa541('0x4e')],_0x31e309['id']);}logger['info'](_0xa541('0x52'),_0xa541('0x61'));emit(util['format'](_0xa541('0x62'),_0x4c8cf0[_0xa541('0xa')]),_0xa541('0x63'),{'uri':_0x1312cd});})[_0xa541('0x64')](function(_0x1b0e1f){logger['error'](_0xa541('0x52'),JSON[_0xa541('0x1e')](_0x1b0e1f));});};exports[_0xa541('0x65')]=function(_0x404c47,_0x182860,_0x5f32be,_0x4eace6,_0x75fec3,_0x2f5b41,_0xa59f23){var _0x352e94,_0x542d1c,_0x5d778f,_0x7420c1;_0x2f5b41[_0xa541('0x4e')]=intUtil[_0xa541('0x4f')](_0x2f5b41[_0xa541('0x4e')]);_0x2f5b41[_0xa541('0x50')]=intUtil['stripTrailingSlash'](_0x2f5b41[_0xa541('0x50')]);def[_0xa541('0x66')]=util[_0xa541('0x20')](_0xa541('0x67'),_0x2f5b41['remoteUri']);if(_0xa59f23&&_0xa59f23[_0xa541('0x68')]&&_0xa59f23[_0xa541('0x68')]!==_0xa541('0x69')){logger['info'](_0xa541('0x6a'),_0xa541('0x53'));_0x182860['recordingURL']=util[_0xa541('0x20')](_0xa541('0x55'),_0x2f5b41['serverUrl'],_0x182860[_0xa541('0x56')],md5(_0x182860[_0xa541('0x56')]));}return getConnection(_0x2f5b41)[_0xa541('0x34')](function(_0xe998b6){_0x7420c1=_0xe998b6;return getUser(_0x2f5b41,_0x4eace6[_0xa541('0xa')],_0x7420c1);})[_0xa541('0x34')](function(_0xc37bca){_0x352e94=_0xc37bca;logger['info'](_0xa541('0x6b'),_0x352e94['id']);return getEndUser(_0x2f5b41,_0x182860['destcalleridname'],_0x182860['destcalleridnum'],_0x7420c1);})[_0xa541('0x34')](function(_0x112d0c){_0x542d1c=_0x112d0c;logger[_0xa541('0x25')](_0xa541('0x59'),_0x542d1c['id']);return getTicket(_0x2f5b41,_0x352e94,_0x542d1c,_0x5f32be,_0x182860,_0x5f32be[_0xa541('0x5a')],_0x7420c1,_0xa541('0x6c'));})[_0xa541('0x34')](function(_0x5473bc){_0x5d778f=_0x5473bc;logger[_0xa541('0x25')](_0xa541('0x5b'));logger[_0xa541('0x25')](_0xa541('0x6d'),_0x5d778f['id']);return setRelationship(_0x7420c1,_0x352e94,_0x5d778f,'users');})[_0xa541('0x34')](function(){return setRelationship(_0x7420c1,_0x542d1c,_0x5d778f,_0xa541('0x6e'));})[_0xa541('0x34')](function(){return getServerInfo(_0x7420c1);})['then'](function(_0x308081){var _0x4bf9e8=parseInt(_0x308081['version']['charAt'](0x0));var _0x1a6089=util[_0xa541('0x20')](_0xa541('0x5f'),_0x2f5b41[_0xa541('0x4e')],_0x5d778f['id']);if(_0x4bf9e8>0x6){_0x1a6089=util['format'](_0xa541('0x60'),_0x2f5b41[_0xa541('0x4e')],_0x5d778f['id']);}logger[_0xa541('0x25')](_0xa541('0x6a'),_0xa541('0x61'));emit(util[_0xa541('0x20')]('user:%s',_0x4eace6[_0xa541('0xa')]),_0xa541('0x63'),{'uri':_0x1a6089});})[_0xa541('0x64')](function(_0x2bda7f){logger[_0xa541('0x6f')](_0xa541('0x6a'),JSON['stringify'](_0x2bda7f));});};exports['unmanaged']=function(_0x53da4f,_0x13eb3e,_0x10df40,_0x490696,_0x65940d,_0x3ce2c2){var _0x4560a5,_0x229cfd,_0x373dc1,_0x4b7306;_0x3ce2c2[_0xa541('0x4e')]=intUtil[_0xa541('0x4f')](_0x3ce2c2[_0xa541('0x4e')]);_0x3ce2c2[_0xa541('0x50')]=intUtil['stripTrailingSlash'](_0x3ce2c2[_0xa541('0x50')]);def['uri']=util[_0xa541('0x20')](_0xa541('0x67'),_0x3ce2c2['remoteUri']);if(_0x65940d&&_0x65940d[_0xa541('0x51')]){logger[_0xa541('0x25')]('['+_0x13eb3e[_0xa541('0x70')]['toUpperCase']()+']',_0xa541('0x53'));_0x13eb3e[_0xa541('0x54')]=util[_0xa541('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ce2c2[_0xa541('0x50')],_0x13eb3e[_0xa541('0x56')],md5(_0x13eb3e['uniqueid']));}else{_0x13eb3e[_0xa541('0x54')]='';}return getConnection(_0x3ce2c2)[_0xa541('0x34')](function(_0x23ee88){_0x4b7306=_0x23ee88;if(!_[_0xa541('0x71')](_0x490696)){return getUser(_0x3ce2c2,_0x490696[_0xa541('0xa')],_0x4b7306);}else{return getUser(_0x3ce2c2,null,_0x4b7306);}})[_0xa541('0x34')](function(_0x3c37d2){_0x4560a5=_0x3c37d2;logger['info'](_0xa541('0x6b'),_0x4560a5['id']);return getEndUser(_0x3ce2c2,_0x13eb3e[_0xa541('0x57')],_0x13eb3e[_0xa541('0x58')],_0x4b7306);})['then'](function(_0x13c1c6){_0x229cfd=_0x13c1c6;logger[_0xa541('0x25')](_0xa541('0x59'),_0x229cfd['id']);return getTicket(_0x3ce2c2,_0x4560a5,_0x229cfd,_0x10df40,_0x13eb3e,_0x10df40['Fields'],_0x4b7306,_0xa541('0x72'));})[_0xa541('0x34')](function(_0x596701){_0x373dc1=_0x596701;logger['info'](_0xa541('0x5b'));logger['info'](_0xa541('0x6d'),_0x373dc1['id']);return setRelationship(_0x4b7306,_0x4560a5,_0x373dc1,_0xa541('0x5c'));})[_0xa541('0x34')](function(){return setRelationship(_0x4b7306,_0x229cfd,_0x373dc1,'contacts');})['then'](function(){return getServerInfo(_0x4b7306);})[_0xa541('0x64')](function(_0x5d3d1b){logger[_0xa541('0x6f')]('['+_0x13eb3e['lastevent'][_0xa541('0x73')]()+']',JSON[_0xa541('0x1e')](_0x5d3d1b));});}; \ 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 e11285c..947f689 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 _0xa88d=['customVariable','join','stripTrailingSlash','slice','substring','validateEmail','isNil','util','getString','length','sortBy','string','push','content','type','variableName','Variable','name','toLowerCase','toString','keyValue','keyType','format','%s:\x20%s','keyContent','variable','key'];(function(_0x5723fd,_0x445ea6){var _0x4f966d=function(_0x27f7ab){while(--_0x27f7ab){_0x5723fd['push'](_0x5723fd['shift']());}};_0x4f966d(++_0x445ea6);}(_0xa88d,0x1d2));var _0xda88=function(_0x1b6433,_0x40072d){_0x1b6433=_0x1b6433-0x0;var _0x473eac=_0xa88d[_0x1b6433];return _0x473eac;};'use strict';var _=require('lodash');var util=require(_0xda88('0x0'));exports[_0xda88('0x1')]=function(_0x459d7d,_0x18a416,_0x595f78){var _0x2bf2d7=[];if(_0x459d7d[_0xda88('0x2')]>0x0){var _0x34dfd6=_[_0xda88('0x3')](_0x459d7d,['id']);for(var _0x4323fb=0x0;_0x4323fb<_0x34dfd6['length'];_0x4323fb++){var _0x1013df=_0x34dfd6[_0x4323fb];if(_0x1013df['type']===_0xda88('0x4')){_0x2bf2d7[_0xda88('0x5')](_0x1013df[_0xda88('0x6')]);}else if(_0x1013df[_0xda88('0x7')]==='variable'&&_0x1013df[_0xda88('0x8')]){_0x18a416[_0x1013df[_0xda88('0x8')]]&&_0x2bf2d7['push'](_0x18a416[_0x1013df[_0xda88('0x8')]]['toString']());}else if(_0x1013df['type']==='customVariable'&&_0x1013df[_0xda88('0x9')]&&_0x1013df['Variable'][_0xda88('0xa')]){_0x18a416[_0x1013df[_0xda88('0x9')][_0xda88('0xa')][_0xda88('0xb')]()]&&_0x2bf2d7['push'](_0x18a416[_0x1013df[_0xda88('0x9')][_0xda88('0xa')][_0xda88('0xb')]()][_0xda88('0xc')]());}else if(_0x1013df[_0xda88('0x7')]===_0xda88('0xd')){if(_0x1013df[_0xda88('0xe')]==='string'&&_0x1013df['key']){_0x2bf2d7[_0xda88('0x5')](util[_0xda88('0xf')](_0xda88('0x10'),_0x1013df['key'],_0x1013df[_0xda88('0x11')]));}else if(_0x1013df[_0xda88('0xe')]===_0xda88('0x12')&&_0x1013df[_0xda88('0x8')]&&_0x1013df[_0xda88('0x13')]){_0x18a416[_0x1013df['variableName']]&&_0x2bf2d7[_0xda88('0x5')](util['format'](_0xda88('0x10'),_0x1013df[_0xda88('0x13')],_0x18a416[_0x1013df[_0xda88('0x8')]]));}else if(_0x1013df['keyType']===_0xda88('0x14')&&_0x1013df[_0xda88('0x9')]&&_0x1013df[_0xda88('0x9')]['name']&&_0x1013df[_0xda88('0x13')]){_0x18a416[_0x1013df[_0xda88('0x9')][_0xda88('0xa')][_0xda88('0xb')]()]&&_0x2bf2d7[_0xda88('0x5')](util[_0xda88('0xf')](_0xda88('0x10'),_0x1013df[_0xda88('0x13')],_0x18a416[_0x1013df[_0xda88('0x9')][_0xda88('0xa')]['toLowerCase']()]));}}}}return _0x2bf2d7[_0xda88('0x15')](_0x595f78);};exports[_0xda88('0x16')]=function(_0x565776){var _0x39d9dd=_0x565776[_0xda88('0x17')](-0x1);if(_0x39d9dd==='/'){_0x565776=_0x565776[_0xda88('0x18')](0x0,_0x565776['lastIndexOf'](_0x39d9dd));}return _0x565776;};exports[_0xda88('0x19')]=function(_0x2298dc){if(!_[_0xda88('0x1a')](_0x2298dc)&&_0x2298dc!==''){var _0x19ff6c=/^(([^<>()\[\]\\.,;:\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 _0x19ff6c['test'](String(_0x2298dc)[_0xda88('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x6f5b=['validateEmail','test','util','getString','sortBy','length','type','push','variable','variableName','toString','name','Variable','toLowerCase','string','key','%s:\x20%s','keyType','format','customVariable','slice','substring'];(function(_0x104662,_0x53a7a7){var _0x19cba7=function(_0x5a76c0){while(--_0x5a76c0){_0x104662['push'](_0x104662['shift']());}};_0x19cba7(++_0x53a7a7);}(_0x6f5b,0x70));var _0xb6f5=function(_0x2da3fe,_0x55ad2d){_0x2da3fe=_0x2da3fe-0x0;var _0x564b34=_0x6f5b[_0x2da3fe];return _0x564b34;};'use strict';var _=require('lodash');var util=require(_0xb6f5('0x0'));exports[_0xb6f5('0x1')]=function(_0x35c7af,_0x32f890,_0x2b199c){var _0x2463a4=[];if(_0x35c7af['length']>0x0){var _0x20b765=_[_0xb6f5('0x2')](_0x35c7af,['id']);for(var _0x1c5857=0x0;_0x1c5857<_0x20b765[_0xb6f5('0x3')];_0x1c5857++){var _0x145c63=_0x20b765[_0x1c5857];if(_0x145c63[_0xb6f5('0x4')]==='string'){_0x2463a4[_0xb6f5('0x5')](_0x145c63['content']);}else if(_0x145c63[_0xb6f5('0x4')]===_0xb6f5('0x6')&&_0x145c63[_0xb6f5('0x7')]){_0x32f890[_0x145c63[_0xb6f5('0x7')]]&&_0x2463a4[_0xb6f5('0x5')](_0x32f890[_0x145c63['variableName']][_0xb6f5('0x8')]());}else if(_0x145c63[_0xb6f5('0x4')]==='customVariable'&&_0x145c63['Variable']&&_0x145c63['Variable'][_0xb6f5('0x9')]){_0x32f890[_0x145c63[_0xb6f5('0xa')][_0xb6f5('0x9')][_0xb6f5('0xb')]()]&&_0x2463a4[_0xb6f5('0x5')](_0x32f890[_0x145c63[_0xb6f5('0xa')][_0xb6f5('0x9')][_0xb6f5('0xb')]()]['toString']());}else if(_0x145c63['type']==='keyValue'){if(_0x145c63['keyType']===_0xb6f5('0xc')&&_0x145c63[_0xb6f5('0xd')]){_0x2463a4[_0xb6f5('0x5')](util['format'](_0xb6f5('0xe'),_0x145c63[_0xb6f5('0xd')],_0x145c63['keyContent']));}else if(_0x145c63[_0xb6f5('0xf')]===_0xb6f5('0x6')&&_0x145c63['variableName']&&_0x145c63[_0xb6f5('0xd')]){_0x32f890[_0x145c63['variableName']]&&_0x2463a4[_0xb6f5('0x5')](util[_0xb6f5('0x10')]('%s:\x20%s',_0x145c63[_0xb6f5('0xd')],_0x32f890[_0x145c63[_0xb6f5('0x7')]]));}else if(_0x145c63[_0xb6f5('0xf')]===_0xb6f5('0x11')&&_0x145c63[_0xb6f5('0xa')]&&_0x145c63[_0xb6f5('0xa')][_0xb6f5('0x9')]&&_0x145c63[_0xb6f5('0xd')]){_0x32f890[_0x145c63['Variable'][_0xb6f5('0x9')][_0xb6f5('0xb')]()]&&_0x2463a4[_0xb6f5('0x5')](util[_0xb6f5('0x10')](_0xb6f5('0xe'),_0x145c63[_0xb6f5('0xd')],_0x32f890[_0x145c63['Variable']['name'][_0xb6f5('0xb')]()]));}}}}return _0x2463a4['join'](_0x2b199c);};exports['stripTrailingSlash']=function(_0x21ad45){var _0x5c32a8=_0x21ad45[_0xb6f5('0x12')](-0x1);if(_0x5c32a8==='/'){_0x21ad45=_0x21ad45[_0xb6f5('0x13')](0x0,_0x21ad45['lastIndexOf'](_0x5c32a8));}return _0x21ad45;};exports[_0xb6f5('0x14')]=function(_0x15bc67){if(!_['isNil'](_0x15bc67)&&_0x15bc67!==''){var _0x35a596=/^(([^<>()\[\]\\.,;:\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 _0x35a596[_0xb6f5('0x15')](String(_0x15bc67)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 3a871b3..c3b05e3 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 7aa6a1e..9a1af06 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 _0xda4e=['Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','map','includes','nameField','customField','toLowerCase','string','picklist','idField','push','content','type','variable','variableName','custom_fields','Variable','name','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','calleridname','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','Tags','getString','Subjects','Descriptions','Fields','then'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0xda4e,0xcf));var _0xeda4=function(_0x2673e1,_0xc17dfc){_0x2673e1=_0x2673e1-0x0;var _0x14d9d8=_0xda4e[_0x2673e1];return _0x14d9d8;};'use strict';var _=require(_0xeda4('0x0'));var rp=require('request-promise');var md5=require(_0xeda4('0x1'));var util=require('util');var Redis=require(_0xeda4('0x2'));var intUtil=require(_0xeda4('0x3'));var config=require(_0xeda4('0x4'));var logger=require(_0xeda4('0x5'))(_0xeda4('0x6'));config[_0xeda4('0x7')]=_[_0xeda4('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xeda4('0x9'))(new Redis(config[_0xeda4('0x7')]));function emit(_0x2bc326,_0x465c50,_0x1df013){io['to'](_0x2bc326)[_0xeda4('0xa')](_0x465c50,_0x1df013);}var headers={'Content-Type':_0xeda4('0xb'),'Accept':_0xeda4('0xb')};function getTicket(_0x11ad35,_0x43fb8d,_0x2f3a2a,_0x1ac4da,_0x3e03d2){logger[_0xeda4('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xeda4('0xd')](_0xeda4('0xe'),_0x11ad35[_0xeda4('0xf')]),'method':_0xeda4('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x2f3a2a['id'],'submitter_id':_0x43fb8d?_0x43fb8d['id']:undefined,'assignee_id':_0x43fb8d?_0x43fb8d['id']:undefined,'tags':getTags(_0x1ac4da[_0xeda4('0x11')],'name'),'subject':intUtil[_0xeda4('0x12')](_0x1ac4da[_0xeda4('0x13')],_0x3e03d2,'\x20'),'description':intUtil['getString'](_0x1ac4da[_0xeda4('0x14')],_0x3e03d2,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x1ac4da[_0xeda4('0x14')],_0x3e03d2,'\x0a')}},getCustomFields(_0x1ac4da[_0xeda4('0x15')],_0x3e03d2))}})[_0xeda4('0x16')](function(_0x4859ed){logger[_0xeda4('0xc')](_0xeda4('0x17'));return _0x4859ed[_0xeda4('0x18')];});}function getUser(_0xecd166,_0x19f48d){if(intUtil['validateEmail'](_0x19f48d)){logger[_0xeda4('0xc')](_0xeda4('0x19'),_0x19f48d);return request({'uri':util[_0xeda4('0xd')](_0xeda4('0x1a'),_0xecd166[_0xeda4('0xf')]),'qs':{'query':util[_0xeda4('0xd')](_0xeda4('0x1b'),_0x19f48d)}})[_0xeda4('0x16')](function(_0x3139a4){if(_0x3139a4[_0xeda4('0x1c')]){logger[_0xeda4('0xc')](_0xeda4('0x1d'));return _[_0xeda4('0x1e')](_0x3139a4[_0xeda4('0x1f')],{'email':_0x19f48d,'role':_0xeda4('0x20')});}else{logger[_0xeda4('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xeda4('0x21'),_0xecd166[_0xeda4('0xf')])})[_0xeda4('0x16')](function(_0x25a610){logger[_0xeda4('0xc')](_0xeda4('0x22'));return _0x25a610[_0xeda4('0x23')];});}});}else{logger[_0xeda4('0xc')](_0xeda4('0x24'));return request({'uri':util[_0xeda4('0xd')]('%s/users/me.json',_0xecd166['remoteUri'])})['then'](function(_0x53792a){logger[_0xeda4('0xc')]('Admin\x20account\x20selected.');return _0x53792a[_0xeda4('0x23')];});}}function getEndUser(_0x5c7059,_0x25c198,_0x217164){logger[_0xeda4('0xc')]('Searching\x20enduser\x20with\x20phone',_0x217164);return request({'uri':util[_0xeda4('0xd')](_0xeda4('0x1a'),_0x5c7059[_0xeda4('0xf')]),'qs':{'query':util[_0xeda4('0xd')](_0xeda4('0x25'),_0x217164)}})[_0xeda4('0x16')](function(_0x188191){var _0x202bc5;if(_0x188191['results'][_0xeda4('0x26')]){_0x188191['results']=_['filter'](_0x188191[_0xeda4('0x1f')],{'suspended':![],'role':_0xeda4('0x27')});if(_0x188191[_0xeda4('0x1f')]['length']){_0x202bc5=_['first'](_0x188191[_0xeda4('0x1f')]);}}if(_0x202bc5){logger[_0xeda4('0xc')](_0xeda4('0x28'));return _0x202bc5;}else{logger[_0xeda4('0xc')](_0xeda4('0x29'));return request({'uri':util[_0xeda4('0xd')](_0xeda4('0x2a'),_0x5c7059['remoteUri']),'method':_0xeda4('0x10'),'body':{'user':{'role':_0xeda4('0x27'),'name':util[_0xeda4('0xd')](_0xeda4('0x2b'),_0x25c198||_0x217164),'phone':_0x217164}}})[_0xeda4('0x16')](function(_0x57a31e){logger['info'](_0xeda4('0x2c'));return _0x57a31e['user'];});}});}function getAuth(_0x4965a7){var _0x56e959;if(_0x4965a7['authType']===_0xeda4('0x2d')){_0x56e959=util[_0xeda4('0xd')](_0xeda4('0x2e'),_0x4965a7[_0xeda4('0x2f')],_0x4965a7[_0xeda4('0x2d')]);}else if(_0x4965a7[_0xeda4('0x30')]===_0xeda4('0x31')){_0x56e959=util['format'](_0xeda4('0x32'),_0x4965a7['username'],_0x4965a7['token']);}return util['format'](_0xeda4('0x33'),new Buffer(_0x56e959)[_0xeda4('0x34')](_0xeda4('0x35')));}function request(_0x66b928){logger[_0xeda4('0x36')]('[HTTP]',JSON[_0xeda4('0x37')](_0x66b928));return rp(_[_0xeda4('0x8')](_0x66b928,{'method':_0xeda4('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x26f97b,_0x59ac34){var _0x4d4d11=[];if(_0x26f97b&&_0x26f97b[_0xeda4('0x26')]>0x0){_0x4d4d11=_[_0xeda4('0x39')](_0x26f97b,_0x59ac34);}return _0x4d4d11;}function getCustomFields(_0x4e13e3,_0x180a0a){var _0x993d5b=[];var _0x5a0c2c={'custom_fields':[]};if(_0x4e13e3[_0xeda4('0x26')]>0x0){_['forEach'](_0x4e13e3,function(_0x58f0a2){if(_[_0xeda4('0x3a')](['string','picklist'],_0x58f0a2['type'])&&_0x58f0a2[_0xeda4('0x3b')]&&!_0x58f0a2[_0xeda4('0x3c')]){_0x5a0c2c[_0x58f0a2['nameField'][_0xeda4('0x3d')]()]=_0x58f0a2['content'][_0xeda4('0x34')]();}else if(_[_0xeda4('0x3a')]([_0xeda4('0x3e'),_0xeda4('0x3f')],_0x58f0a2['type'])&&_0x58f0a2[_0xeda4('0x40')]&&_0x58f0a2[_0xeda4('0x3c')]){_0x5a0c2c['custom_fields'][_0xeda4('0x41')]({'id':_0x58f0a2[_0xeda4('0x40')],'value':_0x58f0a2[_0xeda4('0x42')]['toString']()});}else if(_0x58f0a2[_0xeda4('0x43')]===_0xeda4('0x44')&&_0x58f0a2[_0xeda4('0x45')]&&_0x58f0a2['idField']&&_0x58f0a2[_0xeda4('0x3c')]){_0x180a0a[_0x58f0a2['variableName']]&&_0x5a0c2c[_0xeda4('0x46')][_0xeda4('0x41')]({'id':_0x58f0a2[_0xeda4('0x40')],'value':_0x180a0a[_0x58f0a2[_0xeda4('0x45')]]['toString']()});}else if(_0x58f0a2[_0xeda4('0x43')]==='customVariable'&&_0x58f0a2[_0xeda4('0x47')]&&_0x58f0a2['Variable'][_0xeda4('0x48')]&&_0x58f0a2[_0xeda4('0x40')]&&_0x58f0a2['customField']){_0x180a0a[_0x58f0a2[_0xeda4('0x47')][_0xeda4('0x48')][_0xeda4('0x3d')]()]&&_0x5a0c2c['custom_fields'][_0xeda4('0x41')]({'id':_0x58f0a2[_0xeda4('0x40')],'value':_0x180a0a[_0x58f0a2[_0xeda4('0x47')][_0xeda4('0x48')]['toLowerCase']()][_0xeda4('0x34')]()});}});}return _0x5a0c2c;}exports[_0xeda4('0x49')]=function(_0xb1d2e1,_0x274b2f,_0x1f57e8,_0x32b33b,_0x29dd02,_0x43eb1){var _0x3f3896,_0x278db5;_0x43eb1[_0xeda4('0xf')]=intUtil['stripTrailingSlash'](_0x43eb1[_0xeda4('0xf')]);_0x43eb1[_0xeda4('0x4a')]=intUtil[_0xeda4('0x4b')](_0x43eb1[_0xeda4('0x4a')]);if(_0x29dd02&&_0x29dd02['monitor_format']){logger[_0xeda4('0xc')](_0xeda4('0x4c'),_0xeda4('0x4d'));_0x274b2f[_0xeda4('0x4e')]=util[_0xeda4('0xd')](_0xeda4('0x4f'),_0x43eb1[_0xeda4('0x4a')],_0x274b2f[_0xeda4('0x50')],md5(_0x274b2f['uniqueid']));}else{_0x274b2f[_0xeda4('0x4e')]='';}headers[_0xeda4('0x51')]=getAuth(_0x43eb1);return getUser(_0x43eb1,_0x32b33b[_0xeda4('0x52')])['then'](function(_0x5ae3d3){_0x3f3896=_0x5ae3d3;logger[_0xeda4('0xc')](_0xeda4('0x53'),_0x3f3896['id']);return getEndUser(_0x43eb1,_0x274b2f['calleridname'],_0x274b2f[_0xeda4('0x54')]);})['then'](function(_0x4ce6a9){_0x278db5=_0x4ce6a9;logger[_0xeda4('0xc')](_0xeda4('0x55'),_0x278db5['id']);return getTicket(_0x43eb1,_0x3f3896,_0x278db5,_0x1f57e8,_0x274b2f);})['then'](function(_0x2acb45){if(_0x2acb45){logger[_0xeda4('0xc')](_0xeda4('0x56'),_0x2acb45['id']);switch(_0x43eb1[_0xeda4('0x43')]){case _0xeda4('0x57'):logger[_0xeda4('0xc')]('[QUEUE]',_0xeda4('0x58'));return request({'uri':util[_0xeda4('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x43eb1[_0xeda4('0xf')],_0x3f3896['id'],_0x2acb45['id']),'method':'POST'});case _0xeda4('0x59'):logger[_0xeda4('0xc')](_0xeda4('0x4c'),_0xeda4('0x5a'));emit(util[_0xeda4('0xd')](_0xeda4('0x5b'),_0x32b33b[_0xeda4('0x48')]),_0xeda4('0x5c'),{'uri':util['format'](_0xeda4('0x5d'),_0x43eb1[_0xeda4('0xf')][_0xeda4('0x5e')]('/api/v2',''),_0x2acb45['id'])});break;default:logger[_0xeda4('0x5f')](_0xeda4('0x4c'),_0xeda4('0x60'));}}})[_0xeda4('0x61')](function(_0x7049cb){logger[_0xeda4('0x5f')](_0xeda4('0x62'),util[_0xeda4('0x63')](_0x7049cb,{'showHidden':!![],'depth':null}));});};exports[_0xeda4('0x64')]=function(_0x3dada1,_0x5c2490,_0x3d1b7b,_0x47500a,_0x2dfdee,_0x156048,_0x316681){var _0x5e075c,_0x40c29b;_0x156048[_0xeda4('0xf')]=intUtil[_0xeda4('0x4b')](_0x156048[_0xeda4('0xf')]);_0x156048['serverUrl']=intUtil[_0xeda4('0x4b')](_0x156048['serverUrl']);if(_0x316681&&_0x316681[_0xeda4('0x65')]&&_0x316681[_0xeda4('0x65')]!==_0xeda4('0x66')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5c2490[_0xeda4('0x4e')]=util[_0xeda4('0xd')](_0xeda4('0x4f'),_0x156048['serverUrl'],_0x5c2490['uniqueid'],md5(_0x5c2490['uniqueid']));}headers['Authorization']=getAuth(_0x156048);return getUser(_0x156048,_0x47500a[_0xeda4('0x52')])[_0xeda4('0x16')](function(_0x5c6cbc){_0x5e075c=_0x5c6cbc;logger[_0xeda4('0xc')](_0xeda4('0x53'),_0x5e075c['id']);return getEndUser(_0x156048,_0x5c2490[_0xeda4('0x67')],_0x5c2490[_0xeda4('0x68')]);})['then'](function(_0x288ed7){_0x40c29b=_0x288ed7;logger['info'](_0xeda4('0x55'),_0x40c29b['id']);return getTicket(_0x156048,_0x5e075c,_0x40c29b,_0x3d1b7b,_0x5c2490);})[_0xeda4('0x16')](function(_0x5f3cce){if(_0x5f3cce){logger['info'](_0xeda4('0x56'),_0x5f3cce['id']);switch(_0x156048[_0xeda4('0x43')]){case'integrationTab':logger[_0xeda4('0xc')](_0xeda4('0x69'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xeda4('0xd')](_0xeda4('0x6a'),_0x156048[_0xeda4('0xf')],_0x5e075c['id'],_0x5f3cce['id']),'method':_0xeda4('0x10')});case _0xeda4('0x59'):logger[_0xeda4('0xc')](_0xeda4('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xeda4('0x5b'),_0x47500a[_0xeda4('0x48')]),_0xeda4('0x5c'),{'uri':util[_0xeda4('0xd')](_0xeda4('0x5d'),_0x156048['remoteUri'][_0xeda4('0x5e')](_0xeda4('0x6b'),''),_0x5f3cce['id'])});break;default:logger[_0xeda4('0x5f')](_0xeda4('0x69'),_0xeda4('0x60'));}}})['catch'](function(_0x5218c9){logger[_0xeda4('0x5f')](_0xeda4('0x6c'),util[_0xeda4('0x63')](_0x5218c9,{'showHidden':!![],'depth':null}));});};exports[_0xeda4('0x6d')]=function(_0x89bc08,_0x57fd7e,_0x1f4e0f,_0x4e8e10,_0x40ebaa,_0x3abe7e){var _0x48460a,_0xd121e2;_0x3abe7e[_0xeda4('0xf')]=intUtil[_0xeda4('0x4b')](_0x3abe7e[_0xeda4('0xf')]);_0x3abe7e['serverUrl']=intUtil[_0xeda4('0x4b')](_0x3abe7e[_0xeda4('0x4a')]);if(_0x40ebaa&&_0x40ebaa[_0xeda4('0x6e')]){logger[_0xeda4('0xc')]('['+_0x57fd7e['lastevent']['toUpperCase']()+']',_0xeda4('0x4d'));_0x57fd7e[_0xeda4('0x4e')]=util[_0xeda4('0xd')](_0xeda4('0x4f'),_0x3abe7e['serverUrl'],_0x57fd7e[_0xeda4('0x50')],md5(_0x57fd7e[_0xeda4('0x50')]));}else{_0x57fd7e[_0xeda4('0x4e')]='';}headers[_0xeda4('0x51')]=getAuth(_0x3abe7e);return getUser(_0x3abe7e)[_0xeda4('0x16')](function(_0x3e9688){_0x48460a=_0x3e9688;logger[_0xeda4('0xc')](_0xeda4('0x53'),_0x48460a['id']);return getEndUser(_0x3abe7e,_0x57fd7e[_0xeda4('0x6f')],_0x57fd7e['calleridnum']);})[_0xeda4('0x16')](function(_0x3868c2){_0xd121e2=_0x3868c2;logger[_0xeda4('0xc')](_0xeda4('0x55'),_0xd121e2['id']);return getTicket(_0x3abe7e,_0x48460a,_0xd121e2,_0x1f4e0f,_0x57fd7e);})[_0xeda4('0x16')](function(_0x4cb586){if(_0x4cb586){logger['info']('The\x20Ticket\x20ID\x20is:',_0x4cb586['id']);}})[_0xeda4('0x61')](function(_0x340e2c){logger[_0xeda4('0x5f')]('['+_0x57fd7e[_0xeda4('0x70')][_0xeda4('0x71')]()+']'+_0xeda4('0x72'),util[_0xeda4('0x63')](_0x340e2c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1a3d=['push','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Descriptions','Fields','then','ticket','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','filter','end-user','length','first','Enduser\x20found!','%s/users.json','POST','Enduser\x20created.','authType','%s:%s','username','token','Basic\x20%s','toString','[HTTP]','stringify','map','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField'];(function(_0x139147,_0x2e1543){var _0x2c7a66=function(_0x17fb57){while(--_0x17fb57){_0x139147['push'](_0x139147['shift']());}};_0x2c7a66(++_0x2e1543);}(_0x1a3d,0x164));var _0xd1a3=function(_0x38784d,_0x12c025){_0x38784d=_0x38784d-0x0;var _0x20533f=_0x1a3d[_0x38784d];return _0x20533f;};'use strict';var _=require(_0xd1a3('0x0'));var rp=require(_0xd1a3('0x1'));var md5=require('md5');var util=require(_0xd1a3('0x2'));var Redis=require('ioredis');var intUtil=require(_0xd1a3('0x3'));var config=require(_0xd1a3('0x4'));var logger=require(_0xd1a3('0x5'))(_0xd1a3('0x6'));config[_0xd1a3('0x7')]=_[_0xd1a3('0x8')](config[_0xd1a3('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd1a3('0x9'))(new Redis(config[_0xd1a3('0x7')]));function emit(_0x46d313,_0x2cd8fa,_0x2d3bd9){io['to'](_0x46d313)[_0xd1a3('0xa')](_0x2cd8fa,_0x2d3bd9);}var headers={'Content-Type':_0xd1a3('0xb'),'Accept':'application/json'};function getTicket(_0x599b67,_0xf97db9,_0x3ca1a2,_0x245d9f,_0x3e8960){logger[_0xd1a3('0xc')](_0xd1a3('0xd'));return request({'uri':util[_0xd1a3('0xe')](_0xd1a3('0xf'),_0x599b67[_0xd1a3('0x10')]),'method':'POST','body':{'ticket':_[_0xd1a3('0x11')]({'requester_id':_0x3ca1a2['id'],'submitter_id':_0xf97db9?_0xf97db9['id']:undefined,'assignee_id':_0xf97db9?_0xf97db9['id']:undefined,'tags':getTags(_0x245d9f['Tags'],'name'),'subject':intUtil['getString'](_0x245d9f['Subjects'],_0x3e8960,'\x20'),'description':intUtil['getString'](_0x245d9f[_0xd1a3('0x12')],_0x3e8960,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x245d9f[_0xd1a3('0x12')],_0x3e8960,'\x0a')}},getCustomFields(_0x245d9f[_0xd1a3('0x13')],_0x3e8960))}})[_0xd1a3('0x14')](function(_0x120d82){logger[_0xd1a3('0xc')]('Ticket\x20created!');return _0x120d82[_0xd1a3('0x15')];});}function getUser(_0x11f46a,_0x569c83){if(intUtil['validateEmail'](_0x569c83)){logger['info']('Getting\x20agent\x20with\x20email',_0x569c83);return request({'uri':util[_0xd1a3('0xe')](_0xd1a3('0x16'),_0x11f46a[_0xd1a3('0x10')]),'qs':{'query':util[_0xd1a3('0xe')](_0xd1a3('0x17'),_0x569c83)}})[_0xd1a3('0x14')](function(_0x5a9943){if(_0x5a9943[_0xd1a3('0x18')]){logger[_0xd1a3('0xc')](_0xd1a3('0x19'));return _[_0xd1a3('0x1a')](_0x5a9943[_0xd1a3('0x1b')],{'email':_0x569c83,'role':'agent'});}else{logger['info'](_0xd1a3('0x1c'));return request({'uri':util[_0xd1a3('0xe')](_0xd1a3('0x1d'),_0x11f46a[_0xd1a3('0x10')])})[_0xd1a3('0x14')](function(_0x5e2837){logger[_0xd1a3('0xc')](_0xd1a3('0x1e'));return _0x5e2837['user'];});}});}else{logger[_0xd1a3('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd1a3('0xe')](_0xd1a3('0x1d'),_0x11f46a[_0xd1a3('0x10')])})[_0xd1a3('0x14')](function(_0x3b3558){logger[_0xd1a3('0xc')](_0xd1a3('0x1e'));return _0x3b3558[_0xd1a3('0x1f')];});}}function getEndUser(_0xa881c4,_0x842706,_0x549a7c){logger[_0xd1a3('0xc')](_0xd1a3('0x20'),_0x549a7c);return request({'uri':util[_0xd1a3('0xe')](_0xd1a3('0x16'),_0xa881c4[_0xd1a3('0x10')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x549a7c)}})['then'](function(_0x38bec8){var _0x4eef76;if(_0x38bec8[_0xd1a3('0x1b')]['length']){_0x38bec8[_0xd1a3('0x1b')]=_[_0xd1a3('0x21')](_0x38bec8[_0xd1a3('0x1b')],{'suspended':![],'role':_0xd1a3('0x22')});if(_0x38bec8['results'][_0xd1a3('0x23')]){_0x4eef76=_[_0xd1a3('0x24')](_0x38bec8[_0xd1a3('0x1b')]);}}if(_0x4eef76){logger['info'](_0xd1a3('0x25'));return _0x4eef76;}else{logger[_0xd1a3('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xd1a3('0xe')](_0xd1a3('0x26'),_0xa881c4['remoteUri']),'method':_0xd1a3('0x27'),'body':{'user':{'role':_0xd1a3('0x22'),'name':util[_0xd1a3('0xe')]('Caller\x20-\x20%s',_0x842706||_0x549a7c),'phone':_0x549a7c}}})[_0xd1a3('0x14')](function(_0x5a7796){logger['info'](_0xd1a3('0x28'));return _0x5a7796[_0xd1a3('0x1f')];});}});}function getAuth(_0x2f202b){var _0x41cd8c;if(_0x2f202b[_0xd1a3('0x29')]==='password'){_0x41cd8c=util[_0xd1a3('0xe')](_0xd1a3('0x2a'),_0x2f202b[_0xd1a3('0x2b')],_0x2f202b['password']);}else if(_0x2f202b[_0xd1a3('0x29')]===_0xd1a3('0x2c')){_0x41cd8c=util[_0xd1a3('0xe')]('%s/token:%s',_0x2f202b[_0xd1a3('0x2b')],_0x2f202b[_0xd1a3('0x2c')]);}return util['format'](_0xd1a3('0x2d'),new Buffer(_0x41cd8c)[_0xd1a3('0x2e')]('base64'));}function request(_0x2c94e5){logger['debug'](_0xd1a3('0x2f'),JSON[_0xd1a3('0x30')](_0x2c94e5));return rp(_[_0xd1a3('0x8')](_0x2c94e5,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x578bf,_0x516ba4){var _0x2499ff=[];if(_0x578bf&&_0x578bf['length']>0x0){_0x2499ff=_[_0xd1a3('0x31')](_0x578bf,_0x516ba4);}return _0x2499ff;}function getCustomFields(_0x539769,_0x2c8339){var _0x1e0b41=[];var _0x4e2409={'custom_fields':[]};if(_0x539769[_0xd1a3('0x23')]>0x0){_[_0xd1a3('0x32')](_0x539769,function(_0x2bcc5c){if(_[_0xd1a3('0x33')]([_0xd1a3('0x34'),'picklist'],_0x2bcc5c[_0xd1a3('0x35')])&&_0x2bcc5c[_0xd1a3('0x36')]&&!_0x2bcc5c[_0xd1a3('0x37')]){_0x4e2409[_0x2bcc5c[_0xd1a3('0x36')][_0xd1a3('0x38')]()]=_0x2bcc5c[_0xd1a3('0x39')]['toString']();}else if(_[_0xd1a3('0x33')]([_0xd1a3('0x34'),_0xd1a3('0x3a')],_0x2bcc5c[_0xd1a3('0x35')])&&_0x2bcc5c[_0xd1a3('0x3b')]&&_0x2bcc5c[_0xd1a3('0x37')]){_0x4e2409['custom_fields'][_0xd1a3('0x3c')]({'id':_0x2bcc5c[_0xd1a3('0x3b')],'value':_0x2bcc5c[_0xd1a3('0x39')][_0xd1a3('0x2e')]()});}else if(_0x2bcc5c['type']==='variable'&&_0x2bcc5c['variableName']&&_0x2bcc5c[_0xd1a3('0x3b')]&&_0x2bcc5c[_0xd1a3('0x37')]){_0x2c8339[_0x2bcc5c[_0xd1a3('0x3d')]]&&_0x4e2409['custom_fields']['push']({'id':_0x2bcc5c['idField'],'value':_0x2c8339[_0x2bcc5c[_0xd1a3('0x3d')]]['toString']()});}else if(_0x2bcc5c[_0xd1a3('0x35')]==='customVariable'&&_0x2bcc5c[_0xd1a3('0x3e')]&&_0x2bcc5c[_0xd1a3('0x3e')]['name']&&_0x2bcc5c[_0xd1a3('0x3b')]&&_0x2bcc5c['customField']){_0x2c8339[_0x2bcc5c[_0xd1a3('0x3e')][_0xd1a3('0x3f')][_0xd1a3('0x38')]()]&&_0x4e2409['custom_fields'][_0xd1a3('0x3c')]({'id':_0x2bcc5c[_0xd1a3('0x3b')],'value':_0x2c8339[_0x2bcc5c[_0xd1a3('0x3e')][_0xd1a3('0x3f')][_0xd1a3('0x38')]()][_0xd1a3('0x2e')]()});}});}return _0x4e2409;}exports[_0xd1a3('0x40')]=function(_0x50c653,_0x5d3c0f,_0x58adcc,_0x5c29c1,_0x1ddc59,_0x3d4df5){var _0x3e7fca,_0x3ef5a0;_0x3d4df5['remoteUri']=intUtil[_0xd1a3('0x41')](_0x3d4df5['remoteUri']);_0x3d4df5[_0xd1a3('0x42')]=intUtil[_0xd1a3('0x41')](_0x3d4df5[_0xd1a3('0x42')]);if(_0x1ddc59&&_0x1ddc59['monitor_format']){logger[_0xd1a3('0xc')](_0xd1a3('0x43'),_0xd1a3('0x44'));_0x5d3c0f['recordingURL']=util[_0xd1a3('0xe')](_0xd1a3('0x45'),_0x3d4df5['serverUrl'],_0x5d3c0f[_0xd1a3('0x46')],md5(_0x5d3c0f[_0xd1a3('0x46')]));}else{_0x5d3c0f[_0xd1a3('0x47')]='';}headers[_0xd1a3('0x48')]=getAuth(_0x3d4df5);return getUser(_0x3d4df5,_0x5c29c1[_0xd1a3('0x49')])['then'](function(_0x375507){_0x3e7fca=_0x375507;logger[_0xd1a3('0xc')]('The\x20User\x20ID\x20is:',_0x3e7fca['id']);return getEndUser(_0x3d4df5,_0x5d3c0f[_0xd1a3('0x4a')],_0x5d3c0f[_0xd1a3('0x4b')]);})[_0xd1a3('0x14')](function(_0x5dcde2){_0x3ef5a0=_0x5dcde2;logger[_0xd1a3('0xc')](_0xd1a3('0x4c'),_0x3ef5a0['id']);return getTicket(_0x3d4df5,_0x3e7fca,_0x3ef5a0,_0x58adcc,_0x5d3c0f);})[_0xd1a3('0x14')](function(_0x5bfd83){if(_0x5bfd83){logger[_0xd1a3('0xc')](_0xd1a3('0x4d'),_0x5bfd83['id']);switch(_0x3d4df5[_0xd1a3('0x35')]){case _0xd1a3('0x4e'):logger[_0xd1a3('0xc')]('[QUEUE]',_0xd1a3('0x4f'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3d4df5['remoteUri'],_0x3e7fca['id'],_0x5bfd83['id']),'method':'POST'});case _0xd1a3('0x50'):logger['info'](_0xd1a3('0x43'),_0xd1a3('0x51'));emit(util[_0xd1a3('0xe')]('user:%s',_0x5c29c1[_0xd1a3('0x3f')]),_0xd1a3('0x52'),{'uri':util[_0xd1a3('0xe')](_0xd1a3('0x53'),_0x3d4df5['remoteUri'][_0xd1a3('0x54')](_0xd1a3('0x55'),''),_0x5bfd83['id'])});break;default:logger[_0xd1a3('0x56')](_0xd1a3('0x43'),_0xd1a3('0x57'));}}})[_0xd1a3('0x58')](function(_0xdc5f98){logger[_0xd1a3('0x56')](_0xd1a3('0x59'),util[_0xd1a3('0x5a')](_0xdc5f98,{'showHidden':!![],'depth':null}));});};exports[_0xd1a3('0x5b')]=function(_0x587eca,_0x5d1add,_0x276931,_0x2e0a95,_0x4caa01,_0x2503ee,_0x52c031){var _0x5d4e10,_0x257ab8;_0x2503ee[_0xd1a3('0x10')]=intUtil[_0xd1a3('0x41')](_0x2503ee[_0xd1a3('0x10')]);_0x2503ee[_0xd1a3('0x42')]=intUtil[_0xd1a3('0x41')](_0x2503ee[_0xd1a3('0x42')]);if(_0x52c031&&_0x52c031[_0xd1a3('0x5c')]&&_0x52c031[_0xd1a3('0x5c')]!==_0xd1a3('0x5d')){logger[_0xd1a3('0xc')](_0xd1a3('0x5e'),'Recording\x20is\x20enabled!');_0x5d1add[_0xd1a3('0x47')]=util[_0xd1a3('0xe')](_0xd1a3('0x45'),_0x2503ee[_0xd1a3('0x42')],_0x5d1add['uniqueid'],md5(_0x5d1add['uniqueid']));}headers[_0xd1a3('0x48')]=getAuth(_0x2503ee);return getUser(_0x2503ee,_0x2e0a95[_0xd1a3('0x49')])['then'](function(_0x2449b1){_0x5d4e10=_0x2449b1;logger[_0xd1a3('0xc')](_0xd1a3('0x5f'),_0x5d4e10['id']);return getEndUser(_0x2503ee,_0x5d1add['destcalleridname'],_0x5d1add[_0xd1a3('0x60')]);})['then'](function(_0x34c713){_0x257ab8=_0x34c713;logger[_0xd1a3('0xc')](_0xd1a3('0x4c'),_0x257ab8['id']);return getTicket(_0x2503ee,_0x5d4e10,_0x257ab8,_0x276931,_0x5d1add);})[_0xd1a3('0x14')](function(_0x5b3951){if(_0x5b3951){logger[_0xd1a3('0xc')](_0xd1a3('0x4d'),_0x5b3951['id']);switch(_0x2503ee[_0xd1a3('0x35')]){case _0xd1a3('0x4e'):logger[_0xd1a3('0xc')](_0xd1a3('0x5e'),_0xd1a3('0x4f'));return request({'uri':util[_0xd1a3('0xe')](_0xd1a3('0x61'),_0x2503ee['remoteUri'],_0x5d4e10['id'],_0x5b3951['id']),'method':'POST'});case _0xd1a3('0x50'):logger[_0xd1a3('0xc')]('[OUTBOUND]',_0xd1a3('0x51'));emit(util[_0xd1a3('0xe')](_0xd1a3('0x62'),_0x2e0a95[_0xd1a3('0x3f')]),_0xd1a3('0x52'),{'uri':util['format'](_0xd1a3('0x53'),_0x2503ee[_0xd1a3('0x10')][_0xd1a3('0x54')](_0xd1a3('0x55'),''),_0x5b3951['id'])});break;default:logger[_0xd1a3('0x56')](_0xd1a3('0x5e'),_0xd1a3('0x57'));}}})[_0xd1a3('0x58')](function(_0x27cee9){logger[_0xd1a3('0x56')](_0xd1a3('0x63'),util['inspect'](_0x27cee9,{'showHidden':!![],'depth':null}));});};exports[_0xd1a3('0x64')]=function(_0x2f53da,_0x12184e,_0x169010,_0x373947,_0x4579a5,_0x1d89f7){var _0x30f82f,_0x3f496a;_0x1d89f7[_0xd1a3('0x10')]=intUtil[_0xd1a3('0x41')](_0x1d89f7[_0xd1a3('0x10')]);_0x1d89f7[_0xd1a3('0x42')]=intUtil[_0xd1a3('0x41')](_0x1d89f7[_0xd1a3('0x42')]);if(_0x4579a5&&_0x4579a5[_0xd1a3('0x65')]){logger[_0xd1a3('0xc')]('['+_0x12184e[_0xd1a3('0x66')][_0xd1a3('0x67')]()+']',_0xd1a3('0x44'));_0x12184e[_0xd1a3('0x47')]=util['format'](_0xd1a3('0x45'),_0x1d89f7[_0xd1a3('0x42')],_0x12184e[_0xd1a3('0x46')],md5(_0x12184e[_0xd1a3('0x46')]));}else{_0x12184e[_0xd1a3('0x47')]='';}headers[_0xd1a3('0x48')]=getAuth(_0x1d89f7);return getUser(_0x1d89f7)['then'](function(_0x439e20){_0x30f82f=_0x439e20;logger[_0xd1a3('0xc')]('The\x20User\x20ID\x20is:',_0x30f82f['id']);return getEndUser(_0x1d89f7,_0x12184e[_0xd1a3('0x4a')],_0x12184e[_0xd1a3('0x4b')]);})[_0xd1a3('0x14')](function(_0x432bab){_0x3f496a=_0x432bab;logger[_0xd1a3('0xc')](_0xd1a3('0x4c'),_0x3f496a['id']);return getTicket(_0x1d89f7,_0x30f82f,_0x3f496a,_0x169010,_0x12184e);})[_0xd1a3('0x14')](function(_0x65f038){if(_0x65f038){logger['info'](_0xd1a3('0x4d'),_0x65f038['id']);}})['catch'](function(_0x425061){logger[_0xd1a3('0x56')]('['+_0x12184e['lastevent'][_0xd1a3('0x67')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xd1a3('0x5a')](_0x425061,{'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 6404ab4..e70b270 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 _0x1edd=['talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','uniqueid','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','string','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','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','refresh_token','then','add','seconds','error','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','last_name','code','details','catch','log','CREATE\x20ERROR','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','Owner','administrator','first_name','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0x1edd,0xcd));var _0xd1ed=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x1edd[_0x5de532];return _0x4e9192;};'use strict';var _=require(_0xd1ed('0x0'));var rp=require(_0xd1ed('0x1'));var md5=require(_0xd1ed('0x2'));var util=require(_0xd1ed('0x3'));var intUtil=require(_0xd1ed('0x4'));var moment=require(_0xd1ed('0x5'));var Redis=require('ioredis');var BPromise=require(_0xd1ed('0x6'));var config=require(_0xd1ed('0x7'));var logger=require('../../../../config/logger')(_0xd1ed('0x8'));config[_0xd1ed('0x9')]=_['defaults'](config['redis'],{'host':_0xd1ed('0xa'),'port':0x18eb});var io=require(_0xd1ed('0xb'))(new Redis(config[_0xd1ed('0x9')]));function emit(_0x43a437,_0x2d36e9,_0x4e7531){io['to'](_0x43a437)[_0xd1ed('0xc')](_0x2d36e9,_0x4e7531);}function request(_0x1a4ada){logger[_0xd1ed('0xd')](_0xd1ed('0xe'),JSON[_0xd1ed('0xf')](_0x1a4ada));return rp(_0x1a4ada);}function getCustomFields(_0x5107a6,_0x5ee467){var _0x28b255={};if(_0x5107a6['length']>0x0){_[_0xd1ed('0x10')](_0x5107a6,function(_0x57c97e){if(_[_0xd1ed('0x11')]([_0xd1ed('0x12'),'picklist'],_0x57c97e[_0xd1ed('0x13')])&&_0x57c97e[_0xd1ed('0x14')]){_0x28b255[_0x57c97e[_0xd1ed('0x14')]]=_0x57c97e[_0xd1ed('0x15')][_0xd1ed('0x16')]();}else if(_0x57c97e[_0xd1ed('0x13')]==='variable'&&_0x57c97e[_0xd1ed('0x17')]&&_0x57c97e['idField']&&_0x5ee467[_0x57c97e[_0xd1ed('0x17')]]){_0x28b255[_0x57c97e[_0xd1ed('0x14')]]=_0x5ee467[_0x57c97e[_0xd1ed('0x17')]]['toString']();}else if(_0x57c97e[_0xd1ed('0x13')]===_0xd1ed('0x18')&&_0x57c97e['Variable']&&_0x57c97e[_0xd1ed('0x19')][_0xd1ed('0x1a')]&&_0x57c97e['idField']&&_0x5ee467[_0x57c97e['Variable'][_0xd1ed('0x1a')][_0xd1ed('0x1b')]()]){_0x28b255[_0x57c97e[_0xd1ed('0x14')]]=_0x5ee467[_0x57c97e[_0xd1ed('0x19')]['name'][_0xd1ed('0x1b')]()][_0xd1ed('0x16')]();}});}return _0x28b255;}function getName(_0x43254a){if(_0x43254a[_0xd1ed('0x1c')]('\x20')>0x0){var _0x35a50a=_0x43254a['split'](/ (.+)/);if(_0x35a50a[0x1]){return _0x35a50a;}}return[_0x43254a,_0x43254a];}var accountsTokens={};function getAccessToken(_0x4b5a5e){return new Promise(function(_0x643fed,_0x3c7087){if(!_[_0xd1ed('0x1d')](accountsTokens[_0x4b5a5e['id']])&&!_['isNil'](accountsTokens[_0x4b5a5e['id']][_0xd1ed('0x1e')])){if(moment()[_0xd1ed('0x1f')](accountsTokens[_0x4b5a5e['id']][_0xd1ed('0x20')])){_0x643fed(accountsTokens[_0x4b5a5e['id']][_0xd1ed('0x1e')]);}}var _0x5e664f;switch(_0x4b5a5e[_0xd1ed('0x21')]){case'US':_0x5e664f=_0xd1ed('0x22');break;case'AU':_0x5e664f=_0xd1ed('0x23');break;case'EU':_0x5e664f='https://accounts.zoho.eu';break;case'IN':_0x5e664f=_0xd1ed('0x24');break;case'CN':_0x5e664f=_0xd1ed('0x25');break;default:_0x5e664f=_0xd1ed('0x26');break;}var _0x34f6d9={'method':_0xd1ed('0x27'),'uri':_0x5e664f+_0xd1ed('0x28'),'qs':{'refresh_token':_0x4b5a5e[_0xd1ed('0x29')],'client_id':_0x4b5a5e[_0xd1ed('0x2a')],'client_secret':_0x4b5a5e['clientSecret'],'grant_type':_0xd1ed('0x2b')},'json':!![]};return rp(_0x34f6d9)[_0xd1ed('0x2c')](function(_0x4797cc){accountsTokens[_0x4b5a5e['id']]={'access_token':_0x4797cc[_0xd1ed('0x1e')],'expires_in':moment()[_0xd1ed('0x2d')](_0x4797cc[_0xd1ed('0x20')],_0xd1ed('0x2e'))};_0x643fed(_0x4797cc[_0xd1ed('0x1e')]);})['catch'](function(_0x1bdb24){logger[_0xd1ed('0x2f')]('Failing\x20creating\x20the\x20access_token',_0x1bdb24['stack']);_0x3c7087(_0x1bdb24);});});}function getUser(_0x2d701f,_0x2f6dc1,_0x4e7b75,_0x429f8f){logger[_0xd1ed('0x30')](_0xd1ed('0x31'));return request({'method':_0xd1ed('0x32'),'uri':util[_0xd1ed('0x33')](_0xd1ed('0x34'),_0x2f6dc1),'qs':{'type':_0xd1ed('0x35')},'headers':{'Authorization':_0xd1ed('0x36')+_0x2d701f},'json':!![]})[_0xd1ed('0x2c')](function(_0x5ae1e1){if(_0x5ae1e1[_0xd1ed('0x37')]){var _0x3e9e73=-0x1;if(_[_0xd1ed('0x38')](_0x5ae1e1[_0xd1ed('0x37')])){if(!_['isNil'](_0x429f8f)){_0x3e9e73=_[_0xd1ed('0x39')](_0x5ae1e1['users'],function(_0x96697e){return _0x96697e[_0xd1ed('0x3a')]===_0x429f8f;});}if(_0x3e9e73>=0x0){logger['info'](_0xd1ed('0x3b'));}else{logger['info'](_0xd1ed('0x3c'));_0x3e9e73=_[_0xd1ed('0x39')](_0x5ae1e1['users'],function(_0x2e817c){return _0x2e817c[_0xd1ed('0x3d')][_0xd1ed('0x1a')]===_0xd1ed('0x3e');});}return _0x5ae1e1['users'][_0x3e9e73];}else{if(_0x5ae1e1[_0xd1ed('0x3f')][_0xd1ed('0x3d')][_0xd1ed('0x1a')]===_0xd1ed('0x3e')){logger['info'](_0xd1ed('0x3c'));user=_0x5ae1e1['user'];return user;}else{logger['error'](_0xd1ed('0x40'),JSON[_0xd1ed('0xf')](_0x5ae1e1));throw new Error(_0xd1ed('0x41')+JSON[_0xd1ed('0xf')](_0x5ae1e1));}}}else{logger[_0xd1ed('0x2f')](_0xd1ed('0x40'),JSON['stringify'](_0x5ae1e1));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x5ae1e1));}})['catch'](function(_0x30afa0){console[_0xd1ed('0x2f')](_0x30afa0);});}function getZohoUser(_0x4b737f,_0x16248e){return new BPromise(function(_0x4f0c99,_0x42fd03){request(_0x4b737f)[_0xd1ed('0x2c')](function(_0x3aec31){var _0x338ea6=null;if(_0x3aec31){_0x338ea6=_0x3aec31[_0xd1ed('0x42')][0x0];_0x338ea6[_0xd1ed('0x43')]=_0x16248e;}_0x4f0c99(_0x338ea6);})['catch'](function(_0x826954){_0x42fd03(_0x826954);});});}function createEndUser(_0x1f2f15,_0x4ec267,_0x54149a,_0x54c9bb,_0x28f207,_0x1bb23a){var _0x54149a=getName(_0x54149a);return request({'method':'POST','uri':_0xd1ed('0x44')+_0x4ec267+'/crm/v2/'+_[_0xd1ed('0x45')](_0x1bb23a[_0xd1ed('0x46')])+'s','body':{'data':[{'Last_Name':_0x54149a[0x1],'First_Name':_0x54149a[0x0],'Phone':_0x54c9bb,'Owner':{'name':!_[_0xd1ed('0x1d')](_0x28f207[_0xd1ed('0x47')][_0xd1ed('0x1a')])?_0x28f207[_0xd1ed('0x47')]['name']:!_[_0xd1ed('0x1d')](_0x28f207['first_name'])?_0x28f207['first_name']+'\x20'+_0x28f207[_0xd1ed('0x48')]:_0x28f207[_0xd1ed('0x48')],'id':_0x28f207['id']}}]},'headers':{'Authorization':_0xd1ed('0x36')+_0x1f2f15},'json':!![]})[_0xd1ed('0x2c')](function(_0x1aeabd){if(_0x1aeabd&&_0x1aeabd['data'][0x0][_0xd1ed('0x49')]==='SUCCESS'){var _0xe6279e=_0x1aeabd[_0xd1ed('0x42')][0x0][_0xd1ed('0x4a')];_0xe6279e[_0xd1ed('0x43')]=_[_0xd1ed('0x45')](_0x1bb23a[_0xd1ed('0x46')])+'s';return _0xe6279e;}logger[_0xd1ed('0x2f')](_0xd1ed('0x40'),JSON[_0xd1ed('0xf')](data));throw new Error('Error:\x20'+JSON[_0xd1ed('0xf')](data));})[_0xd1ed('0x4b')](function(_0x2fc672){console[_0xd1ed('0x4c')](_0xd1ed('0x4d'),_0x2fc672);});}function getEndUser(_0x189aaf,_0x27bd30,_0x14d4ce,_0x111e39,_0x47b2aa,_0x1fa50e,_0x1e85ff){var _0x1e2ed5={'method':'GET','uri':'','headers':{'Authorization':_0xd1ed('0x36')+_0x189aaf},'json':!![]};switch(_0x1e85ff['moduleSearch']){case'contact_lead':_0x1e2ed5[_0xd1ed('0x4e')]=_0xd1ed('0x44')+_0x27bd30+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x47b2aa+'))';return getZohoUser(_0x1e2ed5,_0xd1ed('0x4f'))['then'](function(_0x1ff97d){if(_0x1ff97d)return _0x1ff97d;_0x1e2ed5['uri']='https://www.zohoapis.'+_0x27bd30+_0xd1ed('0x50')+_0x47b2aa+'))';return getZohoUser(_0x1e2ed5,_0xd1ed('0x51'))[_0xd1ed('0x2c')](function(_0xa2f036){if(_0xa2f036)return _0xa2f036;if(_0x1e85ff[_0xd1ed('0x46')]!='nothing'){return createEndUser(_0x189aaf,_0x27bd30,_0x111e39,_0x47b2aa,_0x1fa50e,_0x1e85ff);}else{return{};}});});break;case _0xd1ed('0x52'):_0x1e2ed5[_0xd1ed('0x4e')]=_0xd1ed('0x44')+_0x27bd30+_0xd1ed('0x53')+_0x47b2aa+'))';return getZohoUser(_0x1e2ed5,'Contacts')['then'](function(_0x4deade){if(_0x4deade)return _0x4deade;if(_0x1e85ff[_0xd1ed('0x46')]!=_0xd1ed('0x54')){return createEndUser(_0x189aaf,_0x27bd30,_0x111e39,_0x47b2aa,_0x1fa50e,_0x1e85ff);}else{return{};}});break;case _0xd1ed('0x55'):_0x1e2ed5[_0xd1ed('0x4e')]=_0xd1ed('0x44')+_0x27bd30+_0xd1ed('0x50')+_0x47b2aa+'))';return getZohoUser(_0x1e2ed5,_0xd1ed('0x51'))[_0xd1ed('0x2c')](function(_0x50ec7e){if(_0x50ec7e)return _0x50ec7e;if(_0x1e85ff[_0xd1ed('0x46')]!=_0xd1ed('0x54')){return createEndUser(_0x189aaf,_0x27bd30,_0x111e39,_0x47b2aa,_0x1fa50e,_0x1e85ff);}else{return{};}});break;}}function getCall(_0x425ccc,_0x31724d,_0x4579be,_0x4be686,_0x357b24,_0x2e4e31,_0x30b984,_0xf8691a){logger['info'](_0xd1ed('0x56'));var _0x236de0={};_0x236de0[_0xd1ed('0x57')]={'name':!_['isNil'](_0x4be686[_0xd1ed('0x47')][_0xd1ed('0x1a')])&&!_[_0xd1ed('0x1d')](_0x4be686[_0xd1ed('0x3d')][_0xd1ed('0x1a')])&&_0x4be686['profile'][_0xd1ed('0x1a')]===_0xd1ed('0x58')?_0x4be686[_0xd1ed('0x47')][_0xd1ed('0x1a')]:!_[_0xd1ed('0x1d')](_0x4be686[_0xd1ed('0x59')])?_0x4be686[_0xd1ed('0x59')]+'\x20'+_0x4be686['last_name']:_0x4be686['last_name'],'id':_0x4be686['id']};_0x236de0['Subject']=intUtil[_0xd1ed('0x5a')](_0x2e4e31[_0xd1ed('0x5b')],_0x30b984,'\x20');_0x236de0[_0xd1ed('0x5c')]=intUtil[_0xd1ed('0x5a')](_0x2e4e31['Descriptions'],_0x30b984,'\x0a');if(_0x357b24[_0xd1ed('0x43')]===_0xd1ed('0x4f')){_0x236de0[_0xd1ed('0x5d')]={'name':!_[_0xd1ed('0x1d')](_0x357b24['Full_Name'])?_0x357b24[_0xd1ed('0x5e')]:!_[_0xd1ed('0x1d')](_0x357b24[_0xd1ed('0x5f')])?_0x357b24[_0xd1ed('0x5f')]+'\x20'+_0x357b24[_0xd1ed('0x60')]:_0x357b24['Last_Name'],'id':_0x357b24['id']};}if(_0x357b24['enduserType']===_0xd1ed('0x51')){_0x236de0['What_Id']={'name':!_[_0xd1ed('0x1d')](_0x357b24[_0xd1ed('0x5e')])?_0x357b24['Full_Name']:!_[_0xd1ed('0x1d')](_0x357b24[_0xd1ed('0x5f')])?_0x357b24[_0xd1ed('0x5f')]+'\x20'+_0x357b24[_0xd1ed('0x60')]:_0x357b24[_0xd1ed('0x60')],'id':_0x357b24['id']};_0x236de0['$se_module']=_[_0xd1ed('0x45')](_0x357b24[_0xd1ed('0x43')]);}if(_0x30b984[_0xd1ed('0x61')]){_0x236de0[_0xd1ed('0x62')]=moment[_0xd1ed('0x63')](parseInt(_0x30b984[_0xd1ed('0x61')])*0x3e8)[_0xd1ed('0x33')](_0xd1ed('0x64'));}else if(_0x30b984['answertime']&&_0x30b984[_0xd1ed('0x65')]){_0x236de0['Call_Duration']=moment[_0xd1ed('0x63')](moment(_0x30b984[_0xd1ed('0x65')],_0xd1ed('0x66'))['diff'](moment(_0x30b984[_0xd1ed('0x67')],_0xd1ed('0x66'))))['format'](_0xd1ed('0x64'));}switch(_0x30b984[_0xd1ed('0x68')]){case'called':_0x236de0['Call_Result']=_0xd1ed('0x69');break;case _0xd1ed('0x6a'):case _0xd1ed('0x6b'):_0x236de0[_0xd1ed('0x6c')]=_0xd1ed('0x6d');break;case _0xd1ed('0x6e'):_0x236de0['Call_Result']=_0xd1ed('0x6f');break;case _0xd1ed('0x70'):_0x236de0[_0xd1ed('0x6c')]='Abandoned';break;case _0xd1ed('0x71'):_0x236de0['Call_Result']='Timeout';default:}_0x236de0[_0xd1ed('0x72')]=(_0xf8691a===_0xd1ed('0x73')?moment(_0x30b984[_0xd1ed('0x67')])[_0xd1ed('0x33')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x30b984[_0xd1ed('0x74')])[_0xd1ed('0x33')](_0xd1ed('0x66')))||moment()[_0xd1ed('0x33')]('YYYY-MM-DDTHH:mm:ss');_0x236de0[_0xd1ed('0x75')]=_0xf8691a||'Inbound';_0x236de0=_[_0xd1ed('0x76')](_0x236de0,getCustomFields(_0x2e4e31[_0xd1ed('0x77')],_0x30b984));return request({'method':_0xd1ed('0x27'),'uri':_0xd1ed('0x44')+_0x31724d+_0xd1ed('0x78'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x425ccc},'body':{'data':[_0x236de0]},'json':!![]})[_0xd1ed('0x2c')](function(_0x11bf72){if(_0x11bf72&&_0x11bf72[_0xd1ed('0x42')][0x0]['code']==='SUCCESS'){logger[_0xd1ed('0x30')](_0xd1ed('0x79'));return{'id':_0x11bf72['data'][0x0][_0xd1ed('0x4a')]['id']};}})[_0xd1ed('0x4b')](function(_0x5e72c4){logger['info'](_0xd1ed('0x7a'),_0x5e72c4['stack']);console[_0xd1ed('0x4c')](_0xd1ed('0x7a'),_0x5e72c4);});}exports[_0xd1ed('0x7b')]=function(_0x34e6bc,_0x2cbe52,_0x5b4800,_0x15e92b,_0x294c5b,_0x1a820f){var _0x332ad9,_0x45f1c8,_0x326536;_0x1a820f[_0xd1ed('0x7c')]=intUtil[_0xd1ed('0x7d')](_0x1a820f['host']);_0x1a820f[_0xd1ed('0x7e')]=intUtil['stripTrailingSlash'](_0x1a820f[_0xd1ed('0x7e')]);if(_0x294c5b&&_0x294c5b[_0xd1ed('0x7f')]){logger[_0xd1ed('0x30')](_0xd1ed('0x80'),_0xd1ed('0x81'));_0x2cbe52['recordingURL']=_0x1a820f[_0xd1ed('0x7e')]+_0xd1ed('0x82')+_0x2cbe52['uniqueid']+_0xd1ed('0x83')+md5(_0x2cbe52['uniqueid']);}else{_0x2cbe52[_0xd1ed('0x84')]='';}var _0x1a8d42=_0x1a820f['host']===_0xd1ed('0x85')?'eu':_0xd1ed('0x86');return getAccessToken(_0x1a820f)[_0xd1ed('0x2c')](function(_0x56ec47){_0x326536=_0x56ec47;return getUser(_0x326536,_0x1a8d42,_0x1a820f,_0x15e92b[_0xd1ed('0x3a')]);})['then'](function(_0x5368d4){_0x332ad9=_0x5368d4;logger[_0xd1ed('0x30')]('The\x20User\x20ID\x20is:',_0x332ad9['id']);return getEndUser(_0x326536,_0x1a8d42,_0x1a820f,_0x2cbe52[_0xd1ed('0x87')],_0x2cbe52[_0xd1ed('0x88')],_0x332ad9,_0x5b4800);})[_0xd1ed('0x2c')](function(_0x4c1850){_0x45f1c8=_0x4c1850;return getCall(_0x326536,_0x1a8d42,_0x1a820f,_0x332ad9,_0x45f1c8,_0x5b4800,_0x2cbe52,_0xd1ed('0x89'));})[_0xd1ed('0x2c')](function(_0x141405){if(_0x141405){logger[_0xd1ed('0x30')](_0xd1ed('0x8a'),_0x141405['id']);logger[_0xd1ed('0x30')](_0xd1ed('0x80'),_0xd1ed('0x8b'));emit(util[_0xd1ed('0x33')](_0xd1ed('0x8c'),_0x15e92b[_0xd1ed('0x1a')]),_0xd1ed('0x8d'),{'uri':_0xd1ed('0x8e')+_0x1a820f[_0xd1ed('0x7c')]+_0xd1ed('0x8f')+_0x141405['id']});}})[_0xd1ed('0x4b')](function(_0x180d31){logger['error'](_0xd1ed('0x80'),JSON[_0xd1ed('0xf')](_0x180d31));});};exports[_0xd1ed('0x73')]=function(_0x2535bb,_0x346422,_0x4abfd0,_0x2a887b,_0x2ba7f5,_0x4173ce,_0x2de7de){var _0x2776f8,_0x199d8d,_0x122eaf;_0x4173ce[_0xd1ed('0x7c')]=intUtil[_0xd1ed('0x7d')](_0x4173ce[_0xd1ed('0x7c')]);_0x4173ce[_0xd1ed('0x7e')]=intUtil[_0xd1ed('0x7d')](_0x4173ce[_0xd1ed('0x7e')]);if(_0x2de7de&&_0x2de7de[_0xd1ed('0x90')]&&_0x2de7de[_0xd1ed('0x90')]!==_0xd1ed('0x91')){logger['info'](_0xd1ed('0x92'),_0xd1ed('0x81'));_0x346422[_0xd1ed('0x84')]=_0x4173ce[_0xd1ed('0x7e')]+_0xd1ed('0x82')+_0x346422[_0xd1ed('0x93')]+_0xd1ed('0x83')+md5(_0x346422[_0xd1ed('0x93')]);}var _0x42b3d5=_0x4173ce[_0xd1ed('0x7c')]===_0xd1ed('0x85')?'eu':_0xd1ed('0x86');return getAccessToken(_0x4173ce)[_0xd1ed('0x2c')](function(_0xa30f59){_0x122eaf=_0xa30f59;return getUser(_0x122eaf,_0x42b3d5,_0x4173ce,_0x2a887b['email']);})[_0xd1ed('0x2c')](function(_0x16e444){_0x2776f8=_0x16e444;logger[_0xd1ed('0x30')]('The\x20User\x20ID\x20is:',_0x2776f8['id']);return getEndUser(_0x122eaf,_0x42b3d5,_0x4173ce,_0x346422['destcalleridname'],_0x346422['destcalleridnum'],_0x2776f8,_0x4abfd0);})['then'](function(_0x57776b){_0x199d8d=_0x57776b;return getCall(_0x122eaf,_0x42b3d5,_0x4173ce,_0x2776f8,_0x199d8d,_0x4abfd0,_0x346422,'Outbound');})['then'](function(_0xef3e10){if(_0xef3e10){logger[_0xd1ed('0x30')]('The\x20Call\x20ID\x20is:',_0xef3e10['id']);logger[_0xd1ed('0x30')](_0xd1ed('0x92'),_0xd1ed('0x8b'));emit(util[_0xd1ed('0x33')]('user:%s',_0x2a887b[_0xd1ed('0x1a')]),_0xd1ed('0x8d'),{'uri':_0xd1ed('0x8e')+_0x4173ce[_0xd1ed('0x7c')]+_0xd1ed('0x8f')+_0xef3e10['id']});}})['catch'](function(_0x6cdc98){logger[_0xd1ed('0x2f')](_0xd1ed('0x92'),JSON[_0xd1ed('0xf')](_0x6cdc98));});};exports[_0xd1ed('0x94')]=function(_0x1aba92,_0x43e818,_0x459114,_0x27e487,_0x3dd5b7,_0x452b88){var _0x410711,_0xb8392b,_0x23c3d8;_0x452b88[_0xd1ed('0x7c')]=intUtil['stripTrailingSlash'](_0x452b88[_0xd1ed('0x7c')]);_0x452b88[_0xd1ed('0x7e')]=intUtil['stripTrailingSlash'](_0x452b88[_0xd1ed('0x7e')]);if(_0x3dd5b7&&_0x3dd5b7[_0xd1ed('0x7f')]){logger[_0xd1ed('0x30')]('['+_0x43e818[_0xd1ed('0x68')][_0xd1ed('0x95')]()+']',_0xd1ed('0x81'));_0x43e818[_0xd1ed('0x84')]=_0x452b88[_0xd1ed('0x7e')]+_0xd1ed('0x82')+_0x43e818['uniqueid']+_0xd1ed('0x83')+md5(_0x43e818['uniqueid']);}else{_0x43e818[_0xd1ed('0x84')]='';}var _0x398ac1=_0x452b88[_0xd1ed('0x7c')]===_0xd1ed('0x85')?'eu':_0xd1ed('0x86');return getAccessToken(_0x452b88)[_0xd1ed('0x2c')](function(_0x1b5121){_0x23c3d8=_0x1b5121;return getUser(_0x23c3d8,_0x398ac1,_0x452b88);})[_0xd1ed('0x2c')](function(_0x1770f0){_0x410711=_0x1770f0;logger['info'](_0xd1ed('0x96'),_0x410711['id']);return getEndUser(_0x23c3d8,_0x398ac1,_0x452b88,_0x43e818[_0xd1ed('0x87')],_0x43e818[_0xd1ed('0x88')],_0x410711,_0x459114);})[_0xd1ed('0x2c')](function(_0x94e7f6){_0xb8392b=_0x94e7f6;return getCall(_0x23c3d8,_0x398ac1,_0x452b88,_0x410711,_0xb8392b,_0x459114,_0x43e818,_0xd1ed('0x89'));})[_0xd1ed('0x2c')](function(_0xfd6383){if(_0xfd6383){logger['info'](_0xd1ed('0x8a'),_0xfd6383['id']);}})['catch'](function(_0x202669){logger[_0xd1ed('0x2f')]('['+_0x43e818[_0xd1ed('0x68')][_0xd1ed('0x95')]()+']',JSON[_0xd1ed('0xf')](_0x202669));});}; \ No newline at end of file +var _0xc743=['users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','POST','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','startCase','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','diff','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','https://crm.','unmanaged','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20'];(function(_0xa1b74d,_0x614e6f){var _0x56bad4=function(_0x29795c){while(--_0x29795c){_0xa1b74d['push'](_0xa1b74d['shift']());}};_0x56bad4(++_0x614e6f);}(_0xc743,0x103));var _0x3c74=function(_0x5b9179,_0x191c2a){_0x5b9179=_0x5b9179-0x0;var _0x4dfc1e=_0xc743[_0x5b9179];return _0x4dfc1e;};'use strict';var _=require(_0x3c74('0x0'));var rp=require(_0x3c74('0x1'));var md5=require(_0x3c74('0x2'));var util=require('util');var intUtil=require(_0x3c74('0x3'));var moment=require(_0x3c74('0x4'));var Redis=require(_0x3c74('0x5'));var BPromise=require(_0x3c74('0x6'));var config=require(_0x3c74('0x7'));var logger=require(_0x3c74('0x8'))('zoho');config['redis']=_[_0x3c74('0x9')](config[_0x3c74('0xa')],{'host':_0x3c74('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3c74('0xa')]));function emit(_0x1ac23e,_0x366914,_0x4f21ee){io['to'](_0x1ac23e)[_0x3c74('0xc')](_0x366914,_0x4f21ee);}function request(_0x544bad){logger[_0x3c74('0xd')](_0x3c74('0xe'),JSON[_0x3c74('0xf')](_0x544bad));return rp(_0x544bad);}function getCustomFields(_0x2cc591,_0x1212ec){var _0x1448c1={};if(_0x2cc591['length']>0x0){_[_0x3c74('0x10')](_0x2cc591,function(_0x356ea0){if(_[_0x3c74('0x11')]([_0x3c74('0x12'),_0x3c74('0x13')],_0x356ea0[_0x3c74('0x14')])&&_0x356ea0['idField']){_0x1448c1[_0x356ea0[_0x3c74('0x15')]]=_0x356ea0['content'][_0x3c74('0x16')]();}else if(_0x356ea0[_0x3c74('0x14')]===_0x3c74('0x17')&&_0x356ea0[_0x3c74('0x18')]&&_0x356ea0[_0x3c74('0x15')]&&_0x1212ec[_0x356ea0['variableName']]){_0x1448c1[_0x356ea0[_0x3c74('0x15')]]=_0x1212ec[_0x356ea0[_0x3c74('0x18')]][_0x3c74('0x16')]();}else if(_0x356ea0[_0x3c74('0x14')]===_0x3c74('0x19')&&_0x356ea0[_0x3c74('0x1a')]&&_0x356ea0[_0x3c74('0x1a')][_0x3c74('0x1b')]&&_0x356ea0[_0x3c74('0x15')]&&_0x1212ec[_0x356ea0[_0x3c74('0x1a')]['name'][_0x3c74('0x1c')]()]){_0x1448c1[_0x356ea0[_0x3c74('0x15')]]=_0x1212ec[_0x356ea0[_0x3c74('0x1a')][_0x3c74('0x1b')]['toLowerCase']()][_0x3c74('0x16')]();}});}return _0x1448c1;}function getName(_0x525451){if(_0x525451['indexOf']('\x20')>0x0){var _0x5b1e9b=_0x525451[_0x3c74('0x1d')](/ (.+)/);if(_0x5b1e9b[0x1]){return _0x5b1e9b;}}return[_0x525451,_0x525451];}var accountsTokens={};function getAccessToken(_0x47e8bc){return new Promise(function(_0x3d5270,_0x34f952){if(!_[_0x3c74('0x1e')](accountsTokens[_0x47e8bc['id']])&&!_[_0x3c74('0x1e')](accountsTokens[_0x47e8bc['id']][_0x3c74('0x1f')])){if(moment()[_0x3c74('0x20')](accountsTokens[_0x47e8bc['id']][_0x3c74('0x21')])){_0x3d5270(accountsTokens[_0x47e8bc['id']]['access_token']);}}var _0x277926;switch(_0x47e8bc[_0x3c74('0x22')]){case'US':_0x277926=_0x3c74('0x23');break;case'AU':_0x277926=_0x3c74('0x24');break;case'EU':_0x277926=_0x3c74('0x25');break;case'IN':_0x277926=_0x3c74('0x26');break;case'CN':_0x277926='https://accounts.zoho.com.cn';break;default:_0x277926=_0x3c74('0x25');break;}var _0x51ca44={'method':'POST','uri':_0x277926+_0x3c74('0x27'),'qs':{'refresh_token':_0x47e8bc['refreshToken'],'client_id':_0x47e8bc[_0x3c74('0x28')],'client_secret':_0x47e8bc[_0x3c74('0x29')],'grant_type':_0x3c74('0x2a')},'json':!![]};return rp(_0x51ca44)[_0x3c74('0x2b')](function(_0x16c1da){accountsTokens[_0x47e8bc['id']]={'access_token':_0x16c1da[_0x3c74('0x1f')],'expires_in':moment()['add'](_0x16c1da[_0x3c74('0x21')],_0x3c74('0x2c'))};_0x3d5270(_0x16c1da[_0x3c74('0x1f')]);})[_0x3c74('0x2d')](function(_0x51959e){logger[_0x3c74('0x2e')](_0x3c74('0x2f'),_0x51959e[_0x3c74('0x30')]);_0x34f952(_0x51959e);});});}function getUser(_0x1f21c8,_0x4149ab,_0x1c204b,_0x387ddc){logger[_0x3c74('0x31')](_0x3c74('0x32'));return request({'method':_0x3c74('0x33'),'uri':util['format'](_0x3c74('0x34'),_0x4149ab),'qs':{'type':_0x3c74('0x35')},'headers':{'Authorization':_0x3c74('0x36')+_0x1f21c8},'json':!![]})[_0x3c74('0x2b')](function(_0x1ee9e8){if(_0x1ee9e8[_0x3c74('0x37')]){var _0x3a5676=-0x1;if(_[_0x3c74('0x38')](_0x1ee9e8[_0x3c74('0x37')])){if(!_[_0x3c74('0x1e')](_0x387ddc)){_0x3a5676=_[_0x3c74('0x39')](_0x1ee9e8[_0x3c74('0x37')],function(_0x2d7614){return _0x2d7614['email']===_0x387ddc;});}if(_0x3a5676>=0x0){logger[_0x3c74('0x31')](_0x3c74('0x3a'));}else{logger['info'](_0x3c74('0x3b'));_0x3a5676=_[_0x3c74('0x39')](_0x1ee9e8['users'],function(_0x3346f7){return _0x3346f7[_0x3c74('0x3c')][_0x3c74('0x1b')]===_0x3c74('0x3d');});}return _0x1ee9e8[_0x3c74('0x37')][_0x3a5676];}else{if(_0x1ee9e8[_0x3c74('0x3e')][_0x3c74('0x3c')]['name']===_0x3c74('0x3d')){logger[_0x3c74('0x31')](_0x3c74('0x3b'));user=_0x1ee9e8[_0x3c74('0x3e')];return user;}else{logger[_0x3c74('0x2e')](_0x3c74('0x3f'),JSON[_0x3c74('0xf')](_0x1ee9e8));throw new Error(_0x3c74('0x40')+JSON['stringify'](_0x1ee9e8));}}}else{logger[_0x3c74('0x2e')](_0x3c74('0x3f'),JSON[_0x3c74('0xf')](_0x1ee9e8));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x3c74('0xf')](_0x1ee9e8));}})[_0x3c74('0x2d')](function(_0x2d8335){console[_0x3c74('0x2e')](_0x2d8335);});}function getZohoUser(_0x5f3207,_0x42184a){return new BPromise(function(_0x2efcea,_0x229dd0){request(_0x5f3207)[_0x3c74('0x2b')](function(_0x2c5b31){var _0x2f8acd=null;if(_0x2c5b31){_0x2f8acd=_0x2c5b31['data'][0x0];_0x2f8acd[_0x3c74('0x41')]=_0x42184a;}_0x2efcea(_0x2f8acd);})[_0x3c74('0x2d')](function(_0x350c82){_0x229dd0(_0x350c82);});});}function createEndUser(_0xf32552,_0x1b14db,_0x23dc0d,_0x12ce9c,_0x2a1c47,_0x99ae7e){var _0x23dc0d=getName(_0x23dc0d);return request({'method':_0x3c74('0x42'),'uri':_0x3c74('0x43')+_0x1b14db+_0x3c74('0x44')+_['startCase'](_0x99ae7e[_0x3c74('0x45')])+'s','body':{'data':[{'Last_Name':_0x23dc0d[0x1],'First_Name':_0x23dc0d[0x0],'Phone':_0x12ce9c,'Owner':{'name':!_[_0x3c74('0x1e')](_0x2a1c47[_0x3c74('0x46')]['name'])?_0x2a1c47[_0x3c74('0x46')][_0x3c74('0x1b')]:!_[_0x3c74('0x1e')](_0x2a1c47['first_name'])?_0x2a1c47[_0x3c74('0x47')]+'\x20'+_0x2a1c47[_0x3c74('0x48')]:_0x2a1c47[_0x3c74('0x48')],'id':_0x2a1c47['id']}}]},'headers':{'Authorization':_0x3c74('0x36')+_0xf32552},'json':!![]})[_0x3c74('0x2b')](function(_0x286175){if(_0x286175&&_0x286175[_0x3c74('0x49')][0x0][_0x3c74('0x4a')]===_0x3c74('0x4b')){var _0x3759d4=_0x286175[_0x3c74('0x49')][0x0][_0x3c74('0x4c')];_0x3759d4[_0x3c74('0x41')]=_[_0x3c74('0x4d')](_0x99ae7e[_0x3c74('0x45')])+'s';return _0x3759d4;}logger[_0x3c74('0x2e')](_0x3c74('0x3f'),JSON[_0x3c74('0xf')](data));throw new Error('Error:\x20'+JSON[_0x3c74('0xf')](data));})[_0x3c74('0x2d')](function(_0x2ce7cc){console[_0x3c74('0x4e')](_0x3c74('0x4f'),_0x2ce7cc);});}function getEndUser(_0x364b57,_0x45921d,_0xee0c2f,_0x59e315,_0x2b9f1f,_0x1ce72b,_0x58845e){var _0x2c4660={'method':_0x3c74('0x33'),'uri':'','headers':{'Authorization':_0x3c74('0x36')+_0x364b57},'json':!![]};switch(_0x58845e[_0x3c74('0x50')]){case _0x3c74('0x51'):_0x2c4660[_0x3c74('0x52')]=_0x3c74('0x43')+_0x45921d+_0x3c74('0x53')+_0x2b9f1f+'))';return getZohoUser(_0x2c4660,_0x3c74('0x54'))[_0x3c74('0x2b')](function(_0x4ab7c9){if(_0x4ab7c9)return _0x4ab7c9;_0x2c4660[_0x3c74('0x52')]=_0x3c74('0x43')+_0x45921d+_0x3c74('0x55')+_0x2b9f1f+'))';return getZohoUser(_0x2c4660,_0x3c74('0x56'))[_0x3c74('0x2b')](function(_0x3e300b){if(_0x3e300b)return _0x3e300b;if(_0x58845e[_0x3c74('0x45')]!=_0x3c74('0x57')){return createEndUser(_0x364b57,_0x45921d,_0x59e315,_0x2b9f1f,_0x1ce72b,_0x58845e);}else{return{};}});});break;case'contact':_0x2c4660[_0x3c74('0x52')]='https://www.zohoapis.'+_0x45921d+_0x3c74('0x53')+_0x2b9f1f+'))';return getZohoUser(_0x2c4660,'Contacts')[_0x3c74('0x2b')](function(_0x524d56){if(_0x524d56)return _0x524d56;if(_0x58845e[_0x3c74('0x45')]!=_0x3c74('0x57')){return createEndUser(_0x364b57,_0x45921d,_0x59e315,_0x2b9f1f,_0x1ce72b,_0x58845e);}else{return{};}});break;case _0x3c74('0x58'):_0x2c4660[_0x3c74('0x52')]='https://www.zohoapis.'+_0x45921d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2b9f1f+'))';return getZohoUser(_0x2c4660,_0x3c74('0x56'))[_0x3c74('0x2b')](function(_0x45410b){if(_0x45410b)return _0x45410b;if(_0x58845e[_0x3c74('0x45')]!=_0x3c74('0x57')){return createEndUser(_0x364b57,_0x45921d,_0x59e315,_0x2b9f1f,_0x1ce72b,_0x58845e);}else{return{};}});break;}}function getCall(_0x5e55a1,_0x5e941b,_0xf1929c,_0x571536,_0x4736d4,_0x112f33,_0x87fcd4,_0x4e29e3){logger[_0x3c74('0x31')](_0x3c74('0x59'));var _0x5238e0={};_0x5238e0[_0x3c74('0x5a')]={'name':!_[_0x3c74('0x1e')](_0x571536[_0x3c74('0x46')]['name'])&&!_['isNil'](_0x571536['profile']['name'])&&_0x571536[_0x3c74('0x3c')][_0x3c74('0x1b')]===_0x3c74('0x5b')?_0x571536['role']['name']:!_[_0x3c74('0x1e')](_0x571536[_0x3c74('0x47')])?_0x571536['first_name']+'\x20'+_0x571536[_0x3c74('0x48')]:_0x571536['last_name'],'id':_0x571536['id']};_0x5238e0[_0x3c74('0x5c')]=intUtil[_0x3c74('0x5d')](_0x112f33['Subjects'],_0x87fcd4,'\x20');_0x5238e0['Description']=intUtil[_0x3c74('0x5d')](_0x112f33['Descriptions'],_0x87fcd4,'\x0a');if(_0x4736d4['enduserType']===_0x3c74('0x54')){_0x5238e0[_0x3c74('0x5e')]={'name':!_[_0x3c74('0x1e')](_0x4736d4['Full_Name'])?_0x4736d4[_0x3c74('0x5f')]:!_[_0x3c74('0x1e')](_0x4736d4['First_Name'])?_0x4736d4[_0x3c74('0x60')]+'\x20'+_0x4736d4['Last_Name']:_0x4736d4[_0x3c74('0x61')],'id':_0x4736d4['id']};}if(_0x4736d4[_0x3c74('0x41')]===_0x3c74('0x56')){_0x5238e0[_0x3c74('0x62')]={'name':!_[_0x3c74('0x1e')](_0x4736d4['Full_Name'])?_0x4736d4[_0x3c74('0x5f')]:!_[_0x3c74('0x1e')](_0x4736d4[_0x3c74('0x60')])?_0x4736d4[_0x3c74('0x60')]+'\x20'+_0x4736d4[_0x3c74('0x61')]:_0x4736d4['Last_Name'],'id':_0x4736d4['id']};_0x5238e0[_0x3c74('0x63')]=_[_0x3c74('0x4d')](_0x4736d4[_0x3c74('0x41')]);}if(_0x87fcd4[_0x3c74('0x64')]){_0x5238e0[_0x3c74('0x65')]=moment[_0x3c74('0x66')](parseInt(_0x87fcd4[_0x3c74('0x64')])*0x3e8)[_0x3c74('0x67')](_0x3c74('0x68'));}else if(_0x87fcd4[_0x3c74('0x69')]&&_0x87fcd4[_0x3c74('0x6a')]){_0x5238e0['Call_Duration']=moment[_0x3c74('0x66')](moment(_0x87fcd4['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x3c74('0x6b')](moment(_0x87fcd4['starttime'],_0x3c74('0x6c'))))['format'](_0x3c74('0x68'));}switch(_0x87fcd4[_0x3c74('0x6d')]){case'called':_0x5238e0[_0x3c74('0x6e')]=_0x3c74('0x6f');break;case _0x3c74('0x70'):case'connect':_0x5238e0['Call_Result']=_0x3c74('0x71');break;case _0x3c74('0x72'):_0x5238e0[_0x3c74('0x6e')]='Rejected';break;case _0x3c74('0x73'):_0x5238e0[_0x3c74('0x6e')]=_0x3c74('0x74');break;case _0x3c74('0x75'):_0x5238e0[_0x3c74('0x6e')]=_0x3c74('0x76');default:}_0x5238e0[_0x3c74('0x77')]=(_0x4e29e3===_0x3c74('0x78')?moment(_0x87fcd4[_0x3c74('0x79')])[_0x3c74('0x67')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x87fcd4[_0x3c74('0x7a')])[_0x3c74('0x67')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x3c74('0x6c'));_0x5238e0[_0x3c74('0x7b')]=_0x4e29e3||_0x3c74('0x7c');_0x5238e0=_[_0x3c74('0x7d')](_0x5238e0,getCustomFields(_0x112f33[_0x3c74('0x7e')],_0x87fcd4));return request({'method':_0x3c74('0x42'),'uri':'https://www.zohoapis.'+_0x5e941b+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5e55a1},'body':{'data':[_0x5238e0]},'json':!![]})[_0x3c74('0x2b')](function(_0x431748){if(_0x431748&&_0x431748[_0x3c74('0x49')][0x0]['code']==='SUCCESS'){logger['info'](_0x3c74('0x7f'));return{'id':_0x431748['data'][0x0][_0x3c74('0x4c')]['id']};}})[_0x3c74('0x2d')](function(_0x56b2a7){logger[_0x3c74('0x31')](_0x3c74('0x80'),_0x56b2a7[_0x3c74('0x30')]);console['log'](_0x3c74('0x80'),_0x56b2a7);});}exports['queue']=function(_0x128959,_0x4caa6f,_0x44b0c7,_0x9bc2c2,_0x2f9223,_0x3bda5b){var _0x413d1a,_0x3a4c2e,_0x23e037;_0x3bda5b[_0x3c74('0x81')]=intUtil['stripTrailingSlash'](_0x3bda5b[_0x3c74('0x81')]);_0x3bda5b['serverUrl']=intUtil[_0x3c74('0x82')](_0x3bda5b[_0x3c74('0x83')]);if(_0x2f9223&&_0x2f9223[_0x3c74('0x84')]){logger[_0x3c74('0x31')]('[QUEUE]',_0x3c74('0x85'));_0x4caa6f[_0x3c74('0x86')]=_0x3bda5b[_0x3c74('0x83')]+_0x3c74('0x87')+_0x4caa6f[_0x3c74('0x88')]+_0x3c74('0x89')+md5(_0x4caa6f[_0x3c74('0x88')]);}else{_0x4caa6f[_0x3c74('0x86')]='';}var _0x4e34d7=_0x3bda5b[_0x3c74('0x81')]===_0x3c74('0x8a')?'eu':_0x3c74('0x8b');return getAccessToken(_0x3bda5b)[_0x3c74('0x2b')](function(_0x205155){_0x23e037=_0x205155;return getUser(_0x23e037,_0x4e34d7,_0x3bda5b,_0x9bc2c2[_0x3c74('0x8c')]);})[_0x3c74('0x2b')](function(_0x5caf3c){_0x413d1a=_0x5caf3c;logger['info'](_0x3c74('0x8d'),_0x413d1a['id']);return getEndUser(_0x23e037,_0x4e34d7,_0x3bda5b,_0x4caa6f[_0x3c74('0x8e')],_0x4caa6f[_0x3c74('0x8f')],_0x413d1a,_0x44b0c7);})[_0x3c74('0x2b')](function(_0x545dd0){_0x3a4c2e=_0x545dd0;return getCall(_0x23e037,_0x4e34d7,_0x3bda5b,_0x413d1a,_0x3a4c2e,_0x44b0c7,_0x4caa6f,_0x3c74('0x7c'));})[_0x3c74('0x2b')](function(_0x5966ec){if(_0x5966ec){logger['info'](_0x3c74('0x90'),_0x5966ec['id']);logger[_0x3c74('0x31')](_0x3c74('0x91'),_0x3c74('0x92'));emit(util[_0x3c74('0x67')](_0x3c74('0x93'),_0x9bc2c2[_0x3c74('0x1b')]),_0x3c74('0x94'),{'uri':'https://crm.'+_0x3bda5b[_0x3c74('0x81')]+_0x3c74('0x95')+_0x5966ec['id']});}})[_0x3c74('0x2d')](function(_0x407c06){logger[_0x3c74('0x2e')](_0x3c74('0x91'),JSON['stringify'](_0x407c06));});};exports['outbound']=function(_0x1e3642,_0x50a971,_0x3adef1,_0x2c5e43,_0x98e804,_0x47c5e5,_0x150df7){var _0x564896,_0x32fae4,_0x21996e;_0x47c5e5['host']=intUtil['stripTrailingSlash'](_0x47c5e5[_0x3c74('0x81')]);_0x47c5e5[_0x3c74('0x83')]=intUtil[_0x3c74('0x82')](_0x47c5e5[_0x3c74('0x83')]);if(_0x150df7&&_0x150df7['recordingFormat']&&_0x150df7[_0x3c74('0x96')]!==_0x3c74('0x97')){logger[_0x3c74('0x31')](_0x3c74('0x98'),_0x3c74('0x85'));_0x50a971['recordingURL']=_0x47c5e5['serverUrl']+_0x3c74('0x87')+_0x50a971['uniqueid']+_0x3c74('0x89')+md5(_0x50a971[_0x3c74('0x88')]);}var _0x4b5d3d=_0x47c5e5['host']===_0x3c74('0x8a')?'eu':'com';return getAccessToken(_0x47c5e5)[_0x3c74('0x2b')](function(_0x160dfe){_0x21996e=_0x160dfe;return getUser(_0x21996e,_0x4b5d3d,_0x47c5e5,_0x2c5e43['email']);})['then'](function(_0x1692c9){_0x564896=_0x1692c9;logger[_0x3c74('0x31')](_0x3c74('0x8d'),_0x564896['id']);return getEndUser(_0x21996e,_0x4b5d3d,_0x47c5e5,_0x50a971[_0x3c74('0x99')],_0x50a971['destcalleridnum'],_0x564896,_0x3adef1);})[_0x3c74('0x2b')](function(_0x4fb963){_0x32fae4=_0x4fb963;return getCall(_0x21996e,_0x4b5d3d,_0x47c5e5,_0x564896,_0x32fae4,_0x3adef1,_0x50a971,'Outbound');})[_0x3c74('0x2b')](function(_0x23e670){if(_0x23e670){logger[_0x3c74('0x31')](_0x3c74('0x90'),_0x23e670['id']);logger['info'](_0x3c74('0x98'),_0x3c74('0x92'));emit(util[_0x3c74('0x67')](_0x3c74('0x93'),_0x2c5e43['name']),_0x3c74('0x94'),{'uri':_0x3c74('0x9a')+_0x47c5e5[_0x3c74('0x81')]+_0x3c74('0x95')+_0x23e670['id']});}})[_0x3c74('0x2d')](function(_0x1c1e18){logger['error'](_0x3c74('0x98'),JSON['stringify'](_0x1c1e18));});};exports[_0x3c74('0x9b')]=function(_0x5c3657,_0x29c2ed,_0x5004c1,_0x3023b9,_0x25a812,_0x14a6a0){var _0xc0d7f6,_0x4a0633,_0x48fe4d;_0x14a6a0[_0x3c74('0x81')]=intUtil[_0x3c74('0x82')](_0x14a6a0[_0x3c74('0x81')]);_0x14a6a0[_0x3c74('0x83')]=intUtil['stripTrailingSlash'](_0x14a6a0[_0x3c74('0x83')]);if(_0x25a812&&_0x25a812[_0x3c74('0x84')]){logger[_0x3c74('0x31')]('['+_0x29c2ed[_0x3c74('0x6d')][_0x3c74('0x9c')]()+']',_0x3c74('0x85'));_0x29c2ed[_0x3c74('0x86')]=_0x14a6a0[_0x3c74('0x83')]+'/api/voice/recordings/'+_0x29c2ed['uniqueid']+_0x3c74('0x89')+md5(_0x29c2ed[_0x3c74('0x88')]);}else{_0x29c2ed[_0x3c74('0x86')]='';}var _0xecf484=_0x14a6a0[_0x3c74('0x81')]==='zoho.eu'?'eu':_0x3c74('0x8b');return getAccessToken(_0x14a6a0)['then'](function(_0x55aaf5){_0x48fe4d=_0x55aaf5;return getUser(_0x48fe4d,_0xecf484,_0x14a6a0);})[_0x3c74('0x2b')](function(_0x42b0b5){_0xc0d7f6=_0x42b0b5;logger[_0x3c74('0x31')](_0x3c74('0x8d'),_0xc0d7f6['id']);return getEndUser(_0x48fe4d,_0xecf484,_0x14a6a0,_0x29c2ed[_0x3c74('0x8e')],_0x29c2ed[_0x3c74('0x8f')],_0xc0d7f6,_0x5004c1);})[_0x3c74('0x2b')](function(_0x27e5ee){_0x4a0633=_0x27e5ee;return getCall(_0x48fe4d,_0xecf484,_0x14a6a0,_0xc0d7f6,_0x4a0633,_0x5004c1,_0x29c2ed,'Inbound');})[_0x3c74('0x2b')](function(_0x3687cf){if(_0x3687cf){logger[_0x3c74('0x31')](_0x3c74('0x90'),_0x3687cf['id']);}})[_0x3c74('0x2d')](function(_0x499a51){logger['error']('['+_0x29c2ed[_0x3c74('0x6d')][_0x3c74('0x9c')]()+']',JSON['stringify'](_0x499a51));});}; \ 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 c6c10c7..0e3e8a7 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 _0x51ac=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','exec','data2','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x4f08d0,_0x2969e7){var _0x166808=function(_0x35fcff){while(--_0x35fcff){_0x4f08d0['push'](_0x4f08d0['shift']());}};_0x166808(++_0x2969e7);}(_0x51ac,0x12d));var _0xc51a=function(_0x38a3f3,_0x2513e3){_0x38a3f3=_0x38a3f3-0x0;var _0x3f9a06=_0x51ac[_0x38a3f3];return _0x3f9a06;};'use strict';var util=require(_0xc51a('0x0'));var sh=require(_0xc51a('0x1'));var Mustache=require(_0xc51a('0x2'));var logger=require(_0xc51a('0x3'))('trigger');exports[_0xc51a('0x4')]=function(_0x46926b,_0x12bdbd){var _0x3b5c11=_0x46926b[_0xc51a('0x5')]?_0x46926b[_0xc51a('0x5')]:'Script';var _0x3cc5c2=_0x46926b[_0xc51a('0x6')]?Mustache[_0xc51a('0x7')](_0x46926b[_0xc51a('0x6')],_0x12bdbd):_0x12bdbd;sh[_0xc51a('0x4')](_0x3cc5c2,function(_0x2f989b,_0x10cc61,_0x512e7b){if(_0x2f989b!==0x0){logger['error'](util[_0xc51a('0x8')](_0xc51a('0x9'),_0x3b5c11,_0x3cc5c2,_0x2f989b,_0x512e7b));}else{logger[_0xc51a('0xa')](util['format'](_0xc51a('0xb'),_0x3b5c11,_0x3cc5c2,_0x10cc61));}});}; \ No newline at end of file +var _0xf8b6=['info','shelljs','mustache','../../../../config/logger','trigger','data2','Script','render','data3','exec','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x5dd181,_0x1eac8b){var _0x27cc98=function(_0x5814ce){while(--_0x5814ce){_0x5dd181['push'](_0x5dd181['shift']());}};_0x27cc98(++_0x1eac8b);}(_0xf8b6,0x115));var _0x6f8b=function(_0x310974,_0x1188f1){_0x310974=_0x310974-0x0;var _0xebfaba=_0xf8b6[_0x310974];return _0xebfaba;};'use strict';var util=require('util');var sh=require(_0x6f8b('0x0'));var Mustache=require(_0x6f8b('0x1'));var logger=require(_0x6f8b('0x2'))(_0x6f8b('0x3'));exports['exec']=function(_0x3c1e82,_0x1fc071){var _0xceb78e=_0x3c1e82[_0x6f8b('0x4')]?_0x3c1e82['data2']:_0x6f8b('0x5');var _0x34cbff=_0x3c1e82['data3']?Mustache[_0x6f8b('0x6')](_0x3c1e82[_0x6f8b('0x7')],_0x1fc071):_0x1fc071;sh[_0x6f8b('0x8')](_0x34cbff,function(_0x365950,_0x4dac5c,_0xf9f4d4){if(_0x365950!==0x0){logger[_0x6f8b('0x9')](util['format'](_0x6f8b('0xa'),_0xceb78e,_0x34cbff,_0x365950,_0xf9f4d4));}else{logger[_0x6f8b('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xceb78e,_0x34cbff,_0x4dac5c));}});}; \ 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 44ba297..ba2120e 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 _0x0bff=['lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','number','headers','parse','render','data6','error','stack','GET','POST','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','then','isNil',',\x20request\x20body:\x20','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','message','util'];(function(_0x511c4e,_0x22b6f7){var _0x302dc9=function(_0x29e5f4){while(--_0x29e5f4){_0x511c4e['push'](_0x511c4e['shift']());}};_0x302dc9(++_0x22b6f7);}(_0x0bff,0xf4));var _0xf0bf=function(_0x522090,_0xef5b3d){_0x522090=_0x522090-0x0;var _0xe0ad17=_0x0bff[_0x522090];return _0xe0ad17;};'use strict';var rp=require('request-promise');var util=require(_0xf0bf('0x0'));var _=require(_0xf0bf('0x1'));var Mustache=require('mustache');var logger=require(_0xf0bf('0x2'))(_0xf0bf('0x3'));exports[_0xf0bf('0x4')]=function(_0x1229bf,_0x45aee5){var _0x118de1,_0x4f1f11;var _0x12bdce={'method':_0x1229bf[_0xf0bf('0x5')][_0xf0bf('0x6')](),'uri':Mustache['render'](_0x1229bf[_0xf0bf('0x7')],_0x45aee5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1229bf[_0xf0bf('0x8')])===_0xf0bf('0x9')&&parseInt(_0x1229bf[_0xf0bf('0x8')])>=0x1&&parseInt(_0x1229bf[_0xf0bf('0x8')])<=0xa?parseInt(_0x1229bf[_0xf0bf('0x8')])*0x3e8:0x5*0x3e8};try{_0x12bdce[_0xf0bf('0xa')]=_0x1229bf['data6']?JSON[_0xf0bf('0xb')](Mustache[_0xf0bf('0xc')](_0x1229bf[_0xf0bf('0xd')],_0x45aee5)):{};}catch(_0x3d8992){logger[_0xf0bf('0xe')](_0x3d8992[_0xf0bf('0xf')]);}switch(_0x1229bf[_0xf0bf('0x5')][_0xf0bf('0x6')]()){case _0xf0bf('0x10'):case'DELETE':_0x118de1=null;_0x12bdce['qs']=_0x45aee5;break;case _0xf0bf('0x11'):case'PUT':if(_0x1229bf[_0xf0bf('0x12')]){try{_0x118de1=JSON[_0xf0bf('0xb')](Mustache[_0xf0bf('0xc')](_0x1229bf['data7'],_0x45aee5));_0x12bdce[_0xf0bf('0x13')]=_0x118de1;}catch(_0x53e1d5){logger[_0xf0bf('0xe')](_0x53e1d5[_0xf0bf('0xf')]);logger['error'](_0xf0bf('0x14'));}}else{_0x118de1=_0x45aee5;_0x12bdce['body']=_0x118de1;}break;}logger[_0xf0bf('0x15')](util[_0xf0bf('0x16')](_0xf0bf('0x17'),_0x1229bf[_0xf0bf('0x5')],_0x1229bf[_0xf0bf('0x7')],JSON[_0xf0bf('0x18')](_0x12bdce)));rp(_0x12bdce)[_0xf0bf('0x19')](function(_0xcb70){_0x118de1=!_[_0xf0bf('0x1a')](_0x118de1)?_0xf0bf('0x1b')+_0x118de1:'';_0x4f1f11=typeof _0xcb70[_0xf0bf('0x13')]===_0xf0bf('0x1c')?JSON[_0xf0bf('0x18')](_0xcb70[_0xf0bf('0x13')]):_0xcb70[_0xf0bf('0x13')];logger[_0xf0bf('0x15')](util[_0xf0bf('0x16')](_0xf0bf('0x1d'),_0x1229bf['data1'],_0x1229bf['data2'],_0xcb70[_0xf0bf('0x1e')],_0x4f1f11));})[_0xf0bf('0x1f')](function(_0x31c92b){logger[_0xf0bf('0xe')](util[_0xf0bf('0x16')](_0xf0bf('0x20'),_0x1229bf[_0xf0bf('0x5')],_0x1229bf['data2'],_0x31c92b[_0xf0bf('0x1e')],_0x31c92b[_0xf0bf('0x21')],_0x31c92b[_0xf0bf('0x22')]));});}; \ No newline at end of file +var _0x2507=['mustache','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','GET','DELETE','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash'];(function(_0x491a9b,_0x16feba){var _0x290f6b=function(_0x17997d){while(--_0x17997d){_0x491a9b['push'](_0x491a9b['shift']());}};_0x290f6b(++_0x16feba);}(_0x2507,0xa8));var _0x7250=function(_0xa3e4e6,_0x21cd54){_0xa3e4e6=_0xa3e4e6-0x0;var _0x448895=_0x2507[_0xa3e4e6];return _0x448895;};'use strict';var rp=require('request-promise');var util=require(_0x7250('0x0'));var _=require(_0x7250('0x1'));var Mustache=require(_0x7250('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x7250('0x3')]=function(_0x257ae9,_0x1608b2){var _0x1c4289,_0x13fd2c;var _0x3dfccb={'method':_0x257ae9[_0x7250('0x4')][_0x7250('0x5')](),'uri':Mustache[_0x7250('0x6')](_0x257ae9[_0x7250('0x7')],_0x1608b2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x257ae9[_0x7250('0x8')])===_0x7250('0x9')&&parseInt(_0x257ae9[_0x7250('0x8')])>=0x1&&parseInt(_0x257ae9[_0x7250('0x8')])<=0xa?parseInt(_0x257ae9[_0x7250('0x8')])*0x3e8:0x5*0x3e8};try{_0x3dfccb[_0x7250('0xa')]=_0x257ae9[_0x7250('0xb')]?JSON[_0x7250('0xc')](Mustache['render'](_0x257ae9['data6'],_0x1608b2)):{};}catch(_0x47a94b){logger[_0x7250('0xd')](_0x47a94b['stack']);}switch(_0x257ae9[_0x7250('0x4')][_0x7250('0x5')]()){case _0x7250('0xe'):case _0x7250('0xf'):_0x1c4289=null;_0x3dfccb['qs']=_0x1608b2;break;case'POST':case _0x7250('0x10'):if(_0x257ae9['data7']){try{_0x1c4289=JSON[_0x7250('0xc')](Mustache[_0x7250('0x6')](_0x257ae9[_0x7250('0x11')],_0x1608b2));_0x3dfccb[_0x7250('0x12')]=_0x1c4289;}catch(_0x3d84b4){logger[_0x7250('0xd')](_0x3d84b4[_0x7250('0x13')]);logger[_0x7250('0xd')](_0x7250('0x14'));}}else{_0x1c4289=_0x1608b2;_0x3dfccb[_0x7250('0x12')]=_0x1c4289;}break;}logger[_0x7250('0x15')](util[_0x7250('0x16')](_0x7250('0x17'),_0x257ae9[_0x7250('0x4')],_0x257ae9[_0x7250('0x7')],JSON['stringify'](_0x3dfccb)));rp(_0x3dfccb)['then'](function(_0x14e0c0){_0x1c4289=!_[_0x7250('0x18')](_0x1c4289)?_0x7250('0x19')+_0x1c4289:'';_0x13fd2c=typeof _0x14e0c0[_0x7250('0x12')]===_0x7250('0x1a')?JSON[_0x7250('0x1b')](_0x14e0c0['body']):_0x14e0c0[_0x7250('0x12')];logger[_0x7250('0x15')](util['format'](_0x7250('0x1c'),_0x257ae9[_0x7250('0x4')],_0x257ae9[_0x7250('0x7')],_0x14e0c0[_0x7250('0x1d')],_0x13fd2c));})[_0x7250('0x1e')](function(_0x4bc2f2){logger[_0x7250('0xd')](util['format'](_0x7250('0x1f'),_0x257ae9[_0x7250('0x4')],_0x257ae9[_0x7250('0x7')],_0x4bc2f2['statusCode'],_0x4bc2f2[_0x7250('0x20')],_0x4bc2f2[_0x7250('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 2433d50..8fe11de 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 _0xc4ec=['http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x3f7ba1,_0x1d9709){var _0x446307=function(_0x3847a0){while(--_0x3847a0){_0x3f7ba1['push'](_0x3f7ba1['shift']());}};_0x446307(++_0x1d9709);}(_0xc4ec,0xa4));var _0xcc4e=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0xc4ec[_0x4b5813];return _0x423465;};'use strict';var jayson=require(_0xcc4e('0x0'));var BPromise=require(_0xcc4e('0x1'));var logger=require(_0xcc4e('0x2'))(_0xcc4e('0x3'));var client=jayson['client'][_0xcc4e('0x4')]({'port':0x2329});client['Request']=function(_0x126374,_0x1c2ee4){return new BPromise(function(_0x321e65,_0x152170){return client[_0xcc4e('0x5')](_0x126374,_0x1c2ee4)[_0xcc4e('0x6')](function(_0x3310b3){logger[_0xcc4e('0x7')](_0xcc4e('0x8'),_0xcc4e('0x3'),_0x126374,_0x1c2ee4,_0x3310b3);if(_0x3310b3[_0xcc4e('0x9')]){logger[_0xcc4e('0x9')](_0xcc4e('0x8'),_0xcc4e('0x3'),_0x126374,_0x3310b3[_0xcc4e('0x9')][_0xcc4e('0xa')],_0x1c2ee4);return _0x152170(_0x3310b3[_0xcc4e('0x9')][_0xcc4e('0xa')]);}else{return _0x321e65(_0x3310b3[_0xcc4e('0xb')]);}})[_0xcc4e('0xc')](function(_0x13c7ae){logger[_0xcc4e('0x9')](_0xcc4e('0x8'),_0xcc4e('0x3'),_0x126374,_0x13c7ae,_0x1c2ee4);return _0x152170(_0x13c7ae);});});};module[_0xcc4e('0xd')]=client; \ No newline at end of file +var _0x3d1f=['debug','error','rpc','catch','jayson/promise','../../config/logger','routing','http','Request','request','then'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x3d1f,0x9e));var _0xf3d1=function(_0x41210b,_0x2bc525){_0x41210b=_0x41210b-0x0;var _0x387ede=_0x3d1f[_0x41210b];return _0x387ede;};'use strict';var jayson=require(_0xf3d1('0x0'));var BPromise=require('bluebird');var logger=require(_0xf3d1('0x1'))(_0xf3d1('0x2'));var client=jayson['client'][_0xf3d1('0x3')]({'port':0x2329});client[_0xf3d1('0x4')]=function(_0x54ebbe,_0x5c985a){return new BPromise(function(_0xf86f88,_0x24f51d){return client[_0xf3d1('0x5')](_0x54ebbe,_0x5c985a)[_0xf3d1('0x6')](function(_0x25821c){logger[_0xf3d1('0x7')]('rpc',_0xf3d1('0x2'),_0x54ebbe,_0x5c985a,_0x25821c);if(_0x25821c[_0xf3d1('0x8')]){logger['error'](_0xf3d1('0x9'),_0xf3d1('0x2'),_0x54ebbe,_0x25821c['error']['message'],_0x5c985a);return _0x24f51d(_0x25821c[_0xf3d1('0x8')]['message']);}else{return _0xf86f88(_0x25821c['result']);}})[_0xf3d1('0xa')](function(_0x5729b0){logger[_0xf3d1('0x8')](_0xf3d1('0x9'),'routing',_0x54ebbe,_0x5729b0,_0x5c985a);return _0x24f51d(_0x5729b0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b7a7705..4e89fac 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 _0x9127=['catch','./server','./realtime','./lib/email','./rpc/setting','then','getMailAccounts','refresh','mailAccounts','listen','getSettings'];(function(_0x322719,_0x16b381){var _0x30cb6f=function(_0x1e5698){while(--_0x1e5698){_0x322719['push'](_0x322719['shift']());}};_0x30cb6f(++_0x16b381);}(_0x9127,0x1b9));var _0x7912=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0x9127[_0x54b062];return _0x255e41;};'use strict';var BPromise=require('bluebird');var server=require(_0x7912('0x0'));var Realtime=require(_0x7912('0x1'));var EmailChannel=require(_0x7912('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x7912('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x7912('0x4')](mailAccount[_0x7912('0x5')]())[_0x7912('0x4')](realtime['initMailAccounts']())[_0x7912('0x4')](function(){email[_0x7912('0x6')](realtime[_0x7912('0x7')]);return realtime;});}function main(){return server[_0x7912('0x8')](realtime,email)[_0x7912('0x4')](function(){return initRealtime();})['then'](function(){return setting[_0x7912('0x9')]();})['then'](function(_0x216824){return setInterval(initRealtime,_0x216824['loginMailFrequency']*0x3e8);})[_0x7912('0xa')](function(_0x1a5d42){console['log'](_0x1a5d42);});}main(); \ No newline at end of file +var _0x04c6=['./lib/email','./rpc/mailAccount','./rpc/setting','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','./server','./realtime'];(function(_0x1407f4,_0x50d9ef){var _0x3f7766=function(_0x3af57b){while(--_0x3af57b){_0x1407f4['push'](_0x1407f4['shift']());}};_0x3f7766(++_0x50d9ef);}(_0x04c6,0xc1));var _0x604c=function(_0x1b779a,_0x35adf8){_0x1b779a=_0x1b779a-0x0;var _0x86bf8b=_0x04c6[_0x1b779a];return _0x86bf8b;};'use strict';var BPromise=require('bluebird');var server=require(_0x604c('0x0'));var Realtime=require(_0x604c('0x1'));var EmailChannel=require(_0x604c('0x2'));var mailAccount=require(_0x604c('0x3'));var setting=require(_0x604c('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0x604c('0x5')]())['then'](realtime[_0x604c('0x6')]())[_0x604c('0x7')](function(){email[_0x604c('0x8')](realtime[_0x604c('0x9')]);return realtime;});}function main(){return server[_0x604c('0xa')](realtime,email)[_0x604c('0x7')](function(){return initRealtime();})[_0x604c('0x7')](function(){return setting[_0x604c('0xb')]();})[_0x604c('0x7')](function(_0x506992){return setInterval(initRealtime,_0x506992[_0x604c('0xc')]*0x3e8);})[_0x604c('0xd')](function(_0x190209){console[_0x604c('0xe')](_0x190209);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 8bf199e..75c44c9 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 _0xb00a=['mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','status','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','../rpc/mailAccount','start\x20email\x20channel'];(function(_0x367336,_0x18c229){var _0x3423a7=function(_0xa8fa05){while(--_0xa8fa05){_0x367336['push'](_0x367336['shift']());}};_0x3423a7(++_0x18c229);}(_0xb00a,0x107));var _0xab00=function(_0x37551f,_0x1b4ef0){_0x37551f=_0x37551f-0x0;var _0x34d899=_0xb00a[_0x37551f];return _0x34d899;};'use strict';var _=require(_0xab00('0x0'));var moment=require(_0xab00('0x1'));var BPromise=require('bluebird');var md5=require(_0xab00('0x2'));var Redis=require(_0xab00('0x3'));var config=require(_0xab00('0x4'));var logger=require(_0xab00('0x5'))(_0xab00('0x6'));config[_0xab00('0x7')]=_[_0xab00('0x8')](config['redis'],{'host':_0xab00('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab00('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xab00('0xa'));var md5Accounts={};function EmailChannel(_0x32620b){logger['info'](_0xab00('0xb'));this[_0xab00('0xc')]=_0x32620b[_0xab00('0xc')];this[_0xab00('0xd')]={};this[_0xab00('0xe')]=new EmailSmtp();}EmailChannel[_0xab00('0xf')][_0xab00('0x10')]=function(_0x4e0e9c){var _0x39fedd=this[_0xab00('0xc')][_0x4e0e9c];var _0x2005f8={'id':_0x39fedd['id'],'name':_0x39fedd[_0xab00('0x11')],'key':_0x39fedd[_0xab00('0x12')],'active':_0x39fedd[_0xab00('0x13')],'Imap':{'status':_0x39fedd['Imap']['status'],'messageStatus':_0x39fedd[_0xab00('0x14')][_0xab00('0x15')],'total':_0x39fedd['Imap'][_0xab00('0x16')]}};if(_[_0xab00('0x17')](md5Accounts[_0x4e0e9c])){md5Accounts[_0x4e0e9c]={};}var _0x27a9e8=md5(JSON[_0xab00('0x18')](_0x2005f8));if(md5Accounts[_0x4e0e9c]['md5']!==_0x27a9e8){md5Accounts[_0x4e0e9c][_0xab00('0x2')]=_0x27a9e8;io[_0xab00('0x10')](_0xab00('0x19'),_0x2005f8);}};EmailChannel['prototype'][_0xab00('0x1a')]=function(_0x5d1a09){for(var _0x579b0e in _0x5d1a09){if(_0x5d1a09['hasOwnProperty'](_0x579b0e)){if(_0x5d1a09[_0x579b0e]['Imap']&&_0x5d1a09[_0x579b0e][_0xab00('0x13')]){var _0x362281=_0x5d1a09[_0x579b0e][_0xab00('0x14')];if(!this[_0xab00('0xd')][_0xab00('0x1b')](_0x362281['id'])){this['imapAccounts'][_0x362281['id']]=new EmailImap(_0x362281,_0x5d1a09[_0x579b0e][_0xab00('0x6')]);this[_0xab00('0xd')][_0x362281['id']]['on'](_0xab00('0x1c'),this[_0xab00('0x1d')][_0xab00('0x1e')](this,_0x579b0e));this[_0xab00('0xd')][_0x362281['id']]['on']('email',this[_0xab00('0x1f')][_0xab00('0x1e')](this,_0x579b0e));this[_0xab00('0xd')][_0x362281['id']]['on'](_0xab00('0x20'),this[_0xab00('0x21')][_0xab00('0x1e')](this,_0x579b0e));this[_0xab00('0xd')][_0x362281['id']]['on'](_0xab00('0x22'),this['handleImapError'][_0xab00('0x1e')](this,_0x579b0e));}}else{if(_[_0xab00('0x17')](this['mailAccounts'][_0x579b0e]['Imap'])){this[_0xab00('0xc')][_0x579b0e][_0xab00('0x14')]={};}this[_0xab00('0xc')][_0x579b0e]['Imap'][_0xab00('0x23')]='disabled';this[_0xab00('0xc')][_0x579b0e]['Imap']['messageStatus']='';this[_0xab00('0x10')](_0x579b0e);}}}};EmailChannel[_0xab00('0xf')][_0xab00('0x1d')]=function(_0x4b8220,_0x6c86ea){if(this[_0xab00('0xc')][_0x4b8220]){this[_0xab00('0xc')][_0x4b8220][_0xab00('0x14')][_0xab00('0x23')]=_0xab00('0x24');this[_0xab00('0xc')][_0x4b8220]['Imap'][_0xab00('0x15')]=_0x6c86ea['name'];if(_0x6c86ea['messages']){this[_0xab00('0xc')][_0x4b8220]['Imap'][_0xab00('0x16')]=_0x6c86ea[_0xab00('0x25')][_0xab00('0x16')];}return this[_0xab00('0x10')](_0x4b8220);}};EmailChannel[_0xab00('0xf')]['handleImapEmail']=function(_0xe2eae2,_0x4907fd){logger[_0xab00('0x26')](_0xab00('0x27'),_0x4907fd[_0xab00('0x28')],_0x4907fd[_0xab00('0x29')],_0x4907fd[_0xab00('0x2a')],_0xe2eae2);if(this[_0xab00('0xc')][_0xe2eae2]){return mailAccount[_0xab00('0x2b')](_0xe2eae2,_0x4907fd)[_0xab00('0x2c')](function(_0xb9ae57){if(_0xb9ae57){logger[_0xab00('0x26')](_0xab00('0x2d'));}})['catch'](function(_0x2ca0c7){logger['error'](_0xab00('0x2e'),JSON['stringify'](_0x2ca0c7));});}};EmailChannel[_0xab00('0xf')][_0xab00('0x21')]=function(_0x5167d3){if(this[_0xab00('0xc')][_0x5167d3]&&this[_0xab00('0xc')][_0x5167d3][_0xab00('0x14')]){if(this[_0xab00('0xd')][this[_0xab00('0xc')][_0x5167d3][_0xab00('0x14')]['id']]){delete this['imapAccounts'][this[_0xab00('0xc')][_0x5167d3][_0xab00('0x14')]['id']];}this[_0xab00('0xc')][_0x5167d3][_0xab00('0x14')][_0xab00('0x2f')]=moment();this['emit'](_0x5167d3);}};EmailChannel[_0xab00('0xf')][_0xab00('0x30')]=function(_0x327b53,_0xc82097){if(this[_0xab00('0xc')][_0x327b53]){this[_0xab00('0xc')][_0x327b53][_0xab00('0x14')][_0xab00('0x23')]=_0xab00('0x22');this[_0xab00('0xc')][_0x327b53]['Imap'][_0xab00('0x15')]=_0xc82097;return this['emit'](_0x327b53);}};EmailChannel[_0xab00('0xf')][_0xab00('0x31')]=function(_0x10415e,_0x219c4b){return this[_0xab00('0xe')]['send'](_0x10415e,_0x219c4b);};EmailChannel[_0xab00('0xf')][_0xab00('0x32')]=function(_0x27446d){var _0x517e8d=this;if(this[_0xab00('0xc')][_0x27446d['id']]){if(_[_0xab00('0x17')](this[_0xab00('0xc')][_0x27446d['id']][_0xab00('0x33')])){this[_0xab00('0xc')][_0x27446d['id']][_0xab00('0x33')]={};}this[_0xab00('0xc')][_0x27446d['id']][_0xab00('0x33')][_0xab00('0x2f')]=moment();return new BPromise(function(_0x20189a,_0x4084c4){return _0x517e8d[_0xab00('0xe')][_0xab00('0x34')](_0x27446d)[_0xab00('0x2c')](function(_0x16433f){_0x517e8d[_0xab00('0xc')][_0x27446d['id']][_0xab00('0x33')][_0xab00('0x23')]=_0xab00('0x35');_0x517e8d[_0xab00('0xc')][_0x27446d['id']][_0xab00('0x33')][_0xab00('0x15')]='';_0x517e8d[_0xab00('0x10')](_0x27446d['id']);_0x20189a(_0x16433f);})['catch'](function(_0x26f15f){_0x517e8d[_0xab00('0xc')][_0x27446d['id']][_0xab00('0x33')]['status']='error';_0x517e8d[_0xab00('0xc')][_0x27446d['id']][_0xab00('0x33')]['messageStatus']=_0x26f15f;_0x517e8d[_0xab00('0x10')](_0x27446d['id']);_0x4084c4(_0x26f15f);});});}return this['smtp'][_0xab00('0x34')](_0x27446d);};module[_0xab00('0x36')]=EmailChannel; \ No newline at end of file +var _0xa6f2=['active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','handleImapEmail','end','handleImapEnd','bind','handleImapError','disabled','connected','messages','prototype','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','error','send','Smtp','lastSync','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa6f2,0x90));var _0x2a6f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xa6f2[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x2a6f('0x0'));var moment=require(_0x2a6f('0x1'));var BPromise=require(_0x2a6f('0x2'));var md5=require(_0x2a6f('0x3'));var Redis=require(_0x2a6f('0x4'));var config=require(_0x2a6f('0x5'));var logger=require(_0x2a6f('0x6'))(_0x2a6f('0x7'));config[_0x2a6f('0x8')]=_['defaults'](config[_0x2a6f('0x8')],{'host':_0x2a6f('0x9'),'port':0x18eb});var io=require(_0x2a6f('0xa'))(new Redis(config[_0x2a6f('0x8')]));var EmailImap=require(_0x2a6f('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x2a6f('0xc'));var md5Accounts={};function EmailChannel(_0x4ed8c0){logger[_0x2a6f('0xd')](_0x2a6f('0xe'));this[_0x2a6f('0xf')]=_0x4ed8c0[_0x2a6f('0xf')];this[_0x2a6f('0x10')]={};this[_0x2a6f('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0x2a6f('0x12')]=function(_0x1b5a0f){var _0xbca0c=this['mailAccounts'][_0x1b5a0f];var _0x51e777={'id':_0xbca0c['id'],'name':_0xbca0c[_0x2a6f('0x13')],'key':_0xbca0c[_0x2a6f('0x14')],'active':_0xbca0c[_0x2a6f('0x15')],'Imap':{'status':_0xbca0c[_0x2a6f('0x16')][_0x2a6f('0x17')],'messageStatus':_0xbca0c[_0x2a6f('0x16')][_0x2a6f('0x18')],'total':_0xbca0c[_0x2a6f('0x16')][_0x2a6f('0x19')]}};if(_[_0x2a6f('0x1a')](md5Accounts[_0x1b5a0f])){md5Accounts[_0x1b5a0f]={};}var _0x4f2ae3=md5(JSON[_0x2a6f('0x1b')](_0x51e777));if(md5Accounts[_0x1b5a0f]['md5']!==_0x4f2ae3){md5Accounts[_0x1b5a0f][_0x2a6f('0x3')]=_0x4f2ae3;io['emit'](_0x2a6f('0x1c'),_0x51e777);}};EmailChannel['prototype'][_0x2a6f('0x1d')]=function(_0x31fb73){for(var _0x2dbad7 in _0x31fb73){if(_0x31fb73[_0x2a6f('0x1e')](_0x2dbad7)){if(_0x31fb73[_0x2dbad7][_0x2a6f('0x16')]&&_0x31fb73[_0x2dbad7][_0x2a6f('0x15')]){var _0x14832d=_0x31fb73[_0x2dbad7]['Imap'];if(!this[_0x2a6f('0x10')]['hasOwnProperty'](_0x14832d['id'])){this['imapAccounts'][_0x14832d['id']]=new EmailImap(_0x14832d,_0x31fb73[_0x2dbad7][_0x2a6f('0x7')]);this[_0x2a6f('0x10')][_0x14832d['id']]['on'](_0x2a6f('0x1f'),this[_0x2a6f('0x20')]['bind'](this,_0x2dbad7));this[_0x2a6f('0x10')][_0x14832d['id']]['on'](_0x2a6f('0x7'),this[_0x2a6f('0x21')]['bind'](this,_0x2dbad7));this[_0x2a6f('0x10')][_0x14832d['id']]['on'](_0x2a6f('0x22'),this[_0x2a6f('0x23')][_0x2a6f('0x24')](this,_0x2dbad7));this[_0x2a6f('0x10')][_0x14832d['id']]['on']('error',this[_0x2a6f('0x25')]['bind'](this,_0x2dbad7));}}else{if(_[_0x2a6f('0x1a')](this[_0x2a6f('0xf')][_0x2dbad7][_0x2a6f('0x16')])){this[_0x2a6f('0xf')][_0x2dbad7]['Imap']={};}this[_0x2a6f('0xf')][_0x2dbad7][_0x2a6f('0x16')][_0x2a6f('0x17')]=_0x2a6f('0x26');this['mailAccounts'][_0x2dbad7][_0x2a6f('0x16')][_0x2a6f('0x18')]='';this['emit'](_0x2dbad7);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x30f95c,_0x2b7928){if(this[_0x2a6f('0xf')][_0x30f95c]){this[_0x2a6f('0xf')][_0x30f95c][_0x2a6f('0x16')][_0x2a6f('0x17')]=_0x2a6f('0x27');this[_0x2a6f('0xf')][_0x30f95c][_0x2a6f('0x16')][_0x2a6f('0x18')]=_0x2b7928[_0x2a6f('0x13')];if(_0x2b7928['messages']){this['mailAccounts'][_0x30f95c]['Imap'][_0x2a6f('0x19')]=_0x2b7928[_0x2a6f('0x28')][_0x2a6f('0x19')];}return this[_0x2a6f('0x12')](_0x30f95c);}};EmailChannel[_0x2a6f('0x29')]['handleImapEmail']=function(_0x355ada,_0x314750){logger[_0x2a6f('0xd')](_0x2a6f('0x2a'),_0x314750['firstName'],_0x314750[_0x2a6f('0x2b')],_0x314750[_0x2a6f('0x2c')],_0x355ada);if(this['mailAccounts'][_0x355ada]){return mailAccount['notify'](_0x355ada,_0x314750)[_0x2a6f('0x2d')](function(_0x4bd5ad){if(_0x4bd5ad){logger[_0x2a6f('0xd')](_0x2a6f('0x2e'));}})[_0x2a6f('0x2f')](function(_0x44fcde){logger['error'](_0x2a6f('0x30'),JSON[_0x2a6f('0x1b')](_0x44fcde));});}};EmailChannel[_0x2a6f('0x29')]['handleImapEnd']=function(_0x2deae0){if(this['mailAccounts'][_0x2deae0]&&this['mailAccounts'][_0x2deae0][_0x2a6f('0x16')]){if(this[_0x2a6f('0x10')][this[_0x2a6f('0xf')][_0x2deae0][_0x2a6f('0x16')]['id']]){delete this[_0x2a6f('0x10')][this[_0x2a6f('0xf')][_0x2deae0][_0x2a6f('0x16')]['id']];}this[_0x2a6f('0xf')][_0x2deae0]['Imap']['lastSync']=moment();this[_0x2a6f('0x12')](_0x2deae0);}};EmailChannel['prototype'][_0x2a6f('0x25')]=function(_0xf90e12,_0x98c6ea){if(this[_0x2a6f('0xf')][_0xf90e12]){this[_0x2a6f('0xf')][_0xf90e12][_0x2a6f('0x16')][_0x2a6f('0x17')]=_0x2a6f('0x31');this[_0x2a6f('0xf')][_0xf90e12][_0x2a6f('0x16')][_0x2a6f('0x18')]=_0x98c6ea;return this['emit'](_0xf90e12);}};EmailChannel[_0x2a6f('0x29')]['sendMail']=function(_0x57fece,_0x3b63af){return this['smtp'][_0x2a6f('0x32')](_0x57fece,_0x3b63af);};EmailChannel['prototype']['verifySmtp']=function(_0x2677f8){var _0x2434a1=this;if(this['mailAccounts'][_0x2677f8['id']]){if(_[_0x2a6f('0x1a')](this['mailAccounts'][_0x2677f8['id']][_0x2a6f('0x33')])){this[_0x2a6f('0xf')][_0x2677f8['id']][_0x2a6f('0x33')]={};}this['mailAccounts'][_0x2677f8['id']][_0x2a6f('0x33')][_0x2a6f('0x34')]=moment();return new BPromise(function(_0x328893,_0x2ff889){return _0x2434a1['smtp'][_0x2a6f('0x35')](_0x2677f8)[_0x2a6f('0x2d')](function(_0x2f9622){_0x2434a1[_0x2a6f('0xf')][_0x2677f8['id']]['Smtp'][_0x2a6f('0x17')]=_0x2a6f('0x36');_0x2434a1[_0x2a6f('0xf')][_0x2677f8['id']]['Smtp']['messageStatus']='';_0x2434a1[_0x2a6f('0x12')](_0x2677f8['id']);_0x328893(_0x2f9622);})[_0x2a6f('0x2f')](function(_0x258655){_0x2434a1[_0x2a6f('0xf')][_0x2677f8['id']][_0x2a6f('0x33')][_0x2a6f('0x17')]=_0x2a6f('0x31');_0x2434a1['mailAccounts'][_0x2677f8['id']][_0x2a6f('0x33')][_0x2a6f('0x18')]=_0x258655;_0x2434a1[_0x2a6f('0x12')](_0x2677f8['id']);_0x2ff889(_0x258655);});});}return this[_0x2a6f('0x11')][_0x2a6f('0x35')](_0x2677f8);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index de34912..0238536 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 _0x2617=['Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','end','handleEnd','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','password','host','port','tls','autotls','user','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','handleFetchError','textCode','hasOwnProperty','upperFirst','path','lodash','randomstring','mailparser','simpleParser'];(function(_0x7a3a94,_0x39354e){var _0x2afebc=function(_0x1ed94a){while(--_0x1ed94a){_0x7a3a94['push'](_0x7a3a94['shift']());}};_0x2afebc(++_0x39354e);}(_0x2617,0xb8));var _0x7261=function(_0x3cc501,_0x78a695){_0x3cc501=_0x3cc501-0x0;var _0x212e9c=_0x2617[_0x3cc501];return _0x212e9c;};'use strict';var fs=require('fs');var path=require(_0x7261('0x0'));var util=require('util');var Imap=require('imap');var _=require(_0x7261('0x1'));var rs=require(_0x7261('0x2'));var simpleParser=require(_0x7261('0x3'))[_0x7261('0x4')];var Iconv=require('iconv')[_0x7261('0x5')];var EventEmitter=require(_0x7261('0x6'))[_0x7261('0x7')];var utils=require(_0x7261('0x8'));var logger=require(_0x7261('0x9'))(_0x7261('0xa'));function EmailImap(_0x383e90,_0x170d00){this[_0x7261('0xb')]=_0x7261('0xc');this[_0x7261('0xd')]=this[_0x7261('0xe')](_0x383e90,_0x170d00);this[_0x7261('0xf')]=new Imap(this[_0x7261('0xd')]);this[_0x7261('0xf')][_0x7261('0x10')](_0x7261('0x11'),this[_0x7261('0x12')]['bind'](this));this['imap'][_0x7261('0x10')](_0x7261('0x13'),this[_0x7261('0x14')][_0x7261('0x15')](this));this[_0x7261('0xf')]['on'](_0x7261('0x16'),this[_0x7261('0x17')][_0x7261('0x15')](this));this[_0x7261('0xf')][_0x7261('0x18')]();}util[_0x7261('0x19')](EmailImap,EventEmitter);EmailImap[_0x7261('0x1a')][_0x7261('0xe')]=function(_0x1428d7,_0x310276){var _0xa83c7e={'connTimeout':_0x1428d7[_0x7261('0x1b')]?_0x1428d7[_0x7261('0x1b')]*0x3e8:0x2710,'authTimeout':_0x1428d7[_0x7261('0x1c')]?_0x1428d7[_0x7261('0x1c')]*0x3e8:0x1388};if(_[_0x7261('0x1d')](_0x1428d7[_0x7261('0x1e')])){if(_0x1428d7[_0x7261('0x1f')]){_0xa83c7e['user']=_0x1428d7['user'];_0xa83c7e[_0x7261('0x20')]=_0x1428d7[_0x7261('0x20')];}_0xa83c7e[_0x7261('0x21')]=_0x1428d7['host'];_0xa83c7e['port']=_0x1428d7[_0x7261('0x22')]||0x3e1;if(_0x1428d7[_0x7261('0x23')]){_0xa83c7e[_0x7261('0x23')]=!![];}else{_0xa83c7e[_0x7261('0x23')]=![];_0xa83c7e[_0x7261('0x24')]='required';}}else{_0xa83c7e[_0x7261('0x25')]=_0x1428d7[_0x7261('0x25')];_0xa83c7e[_0x7261('0x20')]=_0x1428d7[_0x7261('0x20')];_0xa83c7e[_0x7261('0x21')]=utils['getHost'](_0x1428d7['service']);_0xa83c7e['port']=0x3e1;_0xa83c7e[_0x7261('0x23')]=!![];}_0xa83c7e[_0x7261('0xa')]=_0x310276||_0x1428d7['user']||_0x7261('0x26');return _0xa83c7e;};EmailImap[_0x7261('0x1a')][_0x7261('0x12')]=function(){this['imap'][_0x7261('0x27')](this[_0x7261('0xb')],![],this['handleOpenBox'][_0x7261('0x15')](this));};EmailImap[_0x7261('0x1a')][_0x7261('0x28')]=function(_0x1c5b7e,_0x2e0219){if(_0x1c5b7e){this['handleError'](_0x1c5b7e,!![]);}else{this[_0x7261('0x29')](_0x7261('0x2a'),_0x2e0219);this[_0x7261('0x2b')]();}};EmailImap[_0x7261('0x1a')][_0x7261('0x2c')]=function(_0x268083){if(_0x268083){this[_0x7261('0x17')](_0x268083,!![]);}else{this['imap'][_0x7261('0x13')]();}};EmailImap[_0x7261('0x1a')][_0x7261('0x2b')]=function(){this[_0x7261('0xf')][_0x7261('0x2d')]([_0x7261('0x2e')],this[_0x7261('0x2f')]['bind'](this));};EmailImap[_0x7261('0x1a')][_0x7261('0x2f')]=function(_0x26fb52,_0x16eb3f){if(_0x26fb52){this[_0x7261('0x17')](_0x26fb52,!![]);}else{if(_0x16eb3f['length']){try{var _0xae8df9=this[_0x7261('0xf')][_0x7261('0x30')](_0x16eb3f,{'bodies':'','markSeen':!![]});_0xae8df9['on']('message',this[_0x7261('0x31')]['bind'](this));_0xae8df9[_0x7261('0x10')]('error',this['handleFetchError']['bind'](this));_0xae8df9[_0x7261('0x10')](_0x7261('0x13'),this[_0x7261('0x32')][_0x7261('0x15')](this));}catch(_0x267e33){logger[_0x7261('0x16')](_0x267e33);}}else{this['imap'][_0x7261('0x33')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0x7261('0x1a')]['handleFetchMessage']=function(_0x20ef39,_0x475ac3){_0x20ef39['on'](_0x7261('0x34'),this['handleMessageBody']['bind'](this));_0x20ef39['once'](_0x7261('0x35'),this[_0x7261('0x36')]['bind'](this));_0x20ef39[_0x7261('0x10')](_0x7261('0x13'),this['handleMessageEnd']['bind'](this));};EmailImap[_0x7261('0x1a')][_0x7261('0x37')]=function(_0x190231,_0x44cc23){simpleParser(_0x190231,{'Iconv':Iconv},this[_0x7261('0x38')][_0x7261('0x15')](this));};EmailImap[_0x7261('0x1a')][_0x7261('0x36')]=function(_0x5d72d8){};EmailImap['prototype'][_0x7261('0x39')]=function(){};EmailImap[_0x7261('0x1a')][_0x7261('0x38')]=function(_0x7154b9,_0x366376){if(_0x7154b9){logger[_0x7261('0x16')](_0x7154b9);}else{var _0xae852e=this;utils[_0x7261('0x3a')](this[_0x7261('0xd')],_0x366376,function(_0x467f90){_0xae852e[_0x7261('0x29')](_0x7261('0xa'),_0x467f90);});}};EmailImap[_0x7261('0x1a')][_0x7261('0x32')]=function(){this['imap'][_0x7261('0x33')](!![],this[_0x7261('0x2c')][_0x7261('0x15')](this));};EmailImap['prototype'][_0x7261('0x3b')]=function(_0x468f93){this[_0x7261('0x17')](_0x468f93);this['imap'][_0x7261('0x33')](!![],this[_0x7261('0x2c')]['bind'](this));};EmailImap[_0x7261('0x1a')][_0x7261('0x14')]=function(){this[_0x7261('0x29')](_0x7261('0x13'));};EmailImap[_0x7261('0x1a')][_0x7261('0x17')]=function(_0x42427f,_0x728360){logger[_0x7261('0x16')]('handleError',this[_0x7261('0xd')][_0x7261('0xa')],JSON['stringify'](_0x42427f));var _0x2dd81b='';if(_0x42427f){if(_0x42427f[_0x7261('0x3c')]){_0x2dd81b=_0x42427f['textCode'];}else{for(var _0x3ff336 in _0x42427f){if(_0x42427f[_0x7261('0x3d')](_0x3ff336)){_0x2dd81b+=_[_0x7261('0x3e')](_0x3ff336)+':\x20'+_0x42427f[_0x3ff336]+'\x0a';}}}}if(_0x728360){this[_0x7261('0xf')]['end']();}else{this['emit'](_0x7261('0x16'),_0x2dd81b);this[_0x7261('0x29')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0xc31f=['readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','fetch','message','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','account','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','mailparser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','getAccount','once','ready','handleReady','end','handleEnd','bind','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','box'];(function(_0x39f039,_0x565c08){var _0x515887=function(_0x287ba9){while(--_0x287ba9){_0x39f039['push'](_0x39f039['shift']());}};_0x515887(++_0x565c08);}(_0xc31f,0x146));var _0xfc31=function(_0x4b50e4,_0x23a661){_0x4b50e4=_0x4b50e4-0x0;var _0x3e96bb=_0xc31f[_0x4b50e4];return _0x3e96bb;};'use strict';var fs=require('fs');var path=require(_0xfc31('0x0'));var util=require(_0xfc31('0x1'));var Imap=require(_0xfc31('0x2'));var _=require(_0xfc31('0x3'));var rs=require('randomstring');var simpleParser=require(_0xfc31('0x4'))['simpleParser'];var Iconv=require(_0xfc31('0x5'))[_0xfc31('0x6')];var EventEmitter=require(_0xfc31('0x7'))[_0xfc31('0x8')];var utils=require(_0xfc31('0x9'));var logger=require('../../../config/logger')(_0xfc31('0xa'));function EmailImap(_0x182425,_0xa41f6a){this[_0xfc31('0xb')]=_0xfc31('0xc');this['account']=this[_0xfc31('0xd')](_0x182425,_0xa41f6a);this[_0xfc31('0x2')]=new Imap(this['account']);this[_0xfc31('0x2')][_0xfc31('0xe')](_0xfc31('0xf'),this[_0xfc31('0x10')]['bind'](this));this[_0xfc31('0x2')][_0xfc31('0xe')](_0xfc31('0x11'),this[_0xfc31('0x12')][_0xfc31('0x13')](this));this['imap']['on'](_0xfc31('0x14'),this[_0xfc31('0x15')]['bind'](this));this[_0xfc31('0x2')][_0xfc31('0x16')]();}util[_0xfc31('0x17')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x5f0430,_0x1ae13e){var _0x48150b={'connTimeout':_0x5f0430['connTimeout']?_0x5f0430[_0xfc31('0x18')]*0x3e8:0x2710,'authTimeout':_0x5f0430[_0xfc31('0x19')]?_0x5f0430['authTimeout']*0x3e8:0x1388};if(_[_0xfc31('0x1a')](_0x5f0430[_0xfc31('0x1b')])){if(_0x5f0430['authentication']){_0x48150b[_0xfc31('0x1c')]=_0x5f0430['user'];_0x48150b[_0xfc31('0x1d')]=_0x5f0430[_0xfc31('0x1d')];}_0x48150b['host']=_0x5f0430[_0xfc31('0x1e')];_0x48150b['port']=_0x5f0430[_0xfc31('0x1f')]||0x3e1;if(_0x5f0430[_0xfc31('0x20')]){_0x48150b[_0xfc31('0x20')]=!![];}else{_0x48150b['tls']=![];_0x48150b[_0xfc31('0x21')]=_0xfc31('0x22');}}else{_0x48150b[_0xfc31('0x1c')]=_0x5f0430['user'];_0x48150b['password']=_0x5f0430[_0xfc31('0x1d')];_0x48150b[_0xfc31('0x1e')]=utils['getHost'](_0x5f0430[_0xfc31('0x1b')]);_0x48150b['port']=0x3e1;_0x48150b[_0xfc31('0x20')]=!![];}_0x48150b[_0xfc31('0xa')]=_0x1ae13e||_0x5f0430[_0xfc31('0x1c')]||'anonymous@xcally.com';return _0x48150b;};EmailImap[_0xfc31('0x23')][_0xfc31('0x10')]=function(){this['imap'][_0xfc31('0x24')](this[_0xfc31('0xb')],![],this[_0xfc31('0x25')][_0xfc31('0x13')](this));};EmailImap['prototype'][_0xfc31('0x25')]=function(_0x15298d,_0x229093){if(_0x15298d){this[_0xfc31('0x15')](_0x15298d,!![]);}else{this[_0xfc31('0x26')](_0xfc31('0x27'),_0x229093);this[_0xfc31('0x28')]();}};EmailImap[_0xfc31('0x23')][_0xfc31('0x29')]=function(_0x3a9fed){if(_0x3a9fed){this[_0xfc31('0x15')](_0x3a9fed,!![]);}else{this[_0xfc31('0x2')][_0xfc31('0x11')]();}};EmailImap[_0xfc31('0x23')][_0xfc31('0x28')]=function(){this[_0xfc31('0x2')]['search']([_0xfc31('0x2a')],this[_0xfc31('0x2b')]['bind'](this));};EmailImap[_0xfc31('0x23')]['handleReadUnseen']=function(_0x53d94c,_0x309b7e){if(_0x53d94c){this[_0xfc31('0x15')](_0x53d94c,!![]);}else{if(_0x309b7e['length']){try{var _0x31bc9b=this[_0xfc31('0x2')][_0xfc31('0x2c')](_0x309b7e,{'bodies':'','markSeen':!![]});_0x31bc9b['on'](_0xfc31('0x2d'),this['handleFetchMessage'][_0xfc31('0x13')](this));_0x31bc9b[_0xfc31('0xe')]('error',this['handleFetchError']['bind'](this));_0x31bc9b['once'](_0xfc31('0x11'),this['handleFetchEnd']['bind'](this));}catch(_0x1b0a33){logger[_0xfc31('0x14')](_0x1b0a33);}}else{this[_0xfc31('0x2')][_0xfc31('0x2e')](!![],this['handleCloseBox'][_0xfc31('0x13')](this));}}};EmailImap[_0xfc31('0x23')][_0xfc31('0x2f')]=function(_0x4bea39,_0x2a57c0){_0x4bea39['on'](_0xfc31('0x30'),this[_0xfc31('0x31')][_0xfc31('0x13')](this));_0x4bea39['once'](_0xfc31('0x32'),this['handleMessageAttributes'][_0xfc31('0x13')](this));_0x4bea39[_0xfc31('0xe')](_0xfc31('0x11'),this[_0xfc31('0x33')][_0xfc31('0x13')](this));};EmailImap[_0xfc31('0x23')][_0xfc31('0x31')]=function(_0xb811ea,_0x596ff2){simpleParser(_0xb811ea,{'Iconv':Iconv},this[_0xfc31('0x34')][_0xfc31('0x13')](this));};EmailImap[_0xfc31('0x23')]['handleMessageAttributes']=function(_0x32d817){};EmailImap[_0xfc31('0x23')][_0xfc31('0x33')]=function(){};EmailImap[_0xfc31('0x23')][_0xfc31('0x34')]=function(_0x3145ef,_0x1c0514){if(_0x3145ef){logger[_0xfc31('0x14')](_0x3145ef);}else{var _0x41d08f=this;utils[_0xfc31('0x35')](this[_0xfc31('0x36')],_0x1c0514,function(_0x59859a){_0x41d08f[_0xfc31('0x26')](_0xfc31('0xa'),_0x59859a);});}};EmailImap[_0xfc31('0x23')][_0xfc31('0x37')]=function(){this['imap'][_0xfc31('0x2e')](!![],this[_0xfc31('0x29')][_0xfc31('0x13')](this));};EmailImap[_0xfc31('0x23')]['handleFetchError']=function(_0x49fd67){this[_0xfc31('0x15')](_0x49fd67);this['imap']['closeBox'](!![],this[_0xfc31('0x29')]['bind'](this));};EmailImap[_0xfc31('0x23')][_0xfc31('0x12')]=function(){this['emit']('end');};EmailImap[_0xfc31('0x23')]['handleError']=function(_0x919627,_0x88d915){logger[_0xfc31('0x14')](_0xfc31('0x15'),this[_0xfc31('0x36')][_0xfc31('0xa')],JSON[_0xfc31('0x38')](_0x919627));var _0x33998f='';if(_0x919627){if(_0x919627[_0xfc31('0x39')]){_0x33998f=_0x919627['textCode'];}else{for(var _0x196c06 in _0x919627){if(_0x919627[_0xfc31('0x3a')](_0x196c06)){_0x33998f+=_[_0xfc31('0x3b')](_0x196c06)+':\x20'+_0x919627[_0x196c06]+'\x0a';}}}}if(_0x88d915){this[_0xfc31('0x2')][_0xfc31('0x11')]();}else{this[_0xfc31('0x26')](_0xfc31('0x14'),_0x33998f);this['emit'](_0xfc31('0x11'));}};module[_0xfc31('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 019fcbc..76dd259 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 _0xb5b2=['Not\x20verifired','exports','nodemailer','bluebird','createTransport','use','compile','sendMail','toString','prototype','verify'];(function(_0x3ae06f,_0xebb324){var _0x48e936=function(_0x1ae3b6){while(--_0x1ae3b6){_0x3ae06f['push'](_0x3ae06f['shift']());}};_0x48e936(++_0xebb324);}(_0xb5b2,0x12b));var _0x2b5b=function(_0x49b290,_0x541035){_0x49b290=_0x49b290-0x0;var _0x169c91=_0xb5b2[_0x49b290];return _0x169c91;};'use strict';var nodemailer=require(_0x2b5b('0x0'));var BPromise=require(_0x2b5b('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x2a6994,_0x1ea2bf){return new BPromise(function(_0x4ba1d5,_0x5e73c8){var _0x4b271b=nodemailer[_0x2b5b('0x2')](_0x2a6994);_0x4b271b[_0x2b5b('0x3')](_0x2b5b('0x4'),inlineBase64());_0x4b271b[_0x2b5b('0x5')](_0x1ea2bf,function(_0x206948,_0x4e7d77){if(_0x206948){_0x5e73c8(_0x206948[_0x2b5b('0x6')]());}else{_0x4ba1d5(_0x4e7d77);}});});};EmailSmtp[_0x2b5b('0x7')][_0x2b5b('0x8')]=function(_0x582b93){return new BPromise(function(_0x5bc08c,_0x1ba186){var _0x2c5377=nodemailer['createTransport'](_0x582b93);_0x2c5377[_0x2b5b('0x8')](function(_0x231006,_0x25552e){if(_0x231006){_0x1ba186(_0x231006[_0x2b5b('0x6')]());}else{if(_0x25552e){_0x5bc08c(_0x25552e);}else{_0x1ba186(_0x2b5b('0x9'));}}});});};module[_0x2b5b('0xa')]=EmailSmtp; \ No newline at end of file +var _0xa4e3=['bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','nodemailer'];(function(_0x27eff8,_0x4cd9b7){var _0x5e2fab=function(_0x1caa43){while(--_0x1caa43){_0x27eff8['push'](_0x27eff8['shift']());}};_0x5e2fab(++_0x4cd9b7);}(_0xa4e3,0xb3));var _0x3a4e=function(_0x75b399,_0x46f90d){_0x75b399=_0x75b399-0x0;var _0x22e8e4=_0xa4e3[_0x75b399];return _0x22e8e4;};'use strict';var nodemailer=require(_0x3a4e('0x0'));var BPromise=require(_0x3a4e('0x1'));var inlineBase64=require(_0x3a4e('0x2'));function EmailSmtp(){}EmailSmtp[_0x3a4e('0x3')][_0x3a4e('0x4')]=function(_0xe0cc2a,_0x268738){return new BPromise(function(_0x75fd89,_0x5d37fc){var _0x5d41d3=nodemailer[_0x3a4e('0x5')](_0xe0cc2a);_0x5d41d3[_0x3a4e('0x6')](_0x3a4e('0x7'),inlineBase64());_0x5d41d3[_0x3a4e('0x8')](_0x268738,function(_0x8464f0,_0x3bb684){if(_0x8464f0){_0x5d37fc(_0x8464f0[_0x3a4e('0x9')]());}else{_0x75fd89(_0x3bb684);}});});};EmailSmtp[_0x3a4e('0x3')]['verify']=function(_0x1e9508){return new BPromise(function(_0x39fe6a,_0x52bbd5){var _0x563a16=nodemailer['createTransport'](_0x1e9508);_0x563a16[_0x3a4e('0xa')](function(_0x39b9bc,_0x127983){if(_0x39b9bc){_0x52bbd5(_0x39b9bc[_0x3a4e('0x9')]());}else{if(_0x127983){_0x39fe6a(_0x127983);}else{_0x52bbd5(_0x3a4e('0xb'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ea336ef..d3fbfa9 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 _0xbbbc=['push','contentType','headerLines','Precedence:\x20auto_reply','indexOf','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','length','join','Anonymous','pop','isEmpty','html','test','replace','includes','attachments','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x3766c2['slice'](0x0,-0x1)[_0xcbbb('0x10')]('\x20'):_0x150355['name'];}return _0xcbbb('0x11');}function getLastName(_0x15ba43){var _0x1cece7=_['head'](_0x15ba43[_0xcbbb('0x9')]);if(_0x1cece7&&_0x1cece7[_0xcbbb('0xe')]){var _0x8a325c=_0x1cece7[_0xcbbb('0xe')]['split'](/\s+/);return _0x8a325c['length']>0x1?_0x8a325c[_0xcbbb('0x12')]():'';}return'';}function getMails(_0x30297d,_0xf76038){var _0x188698='';for(var _0x5e25ca=0x0;_0x5e25ca<_0xf76038[_0xcbbb('0x9')]['length'];_0x5e25ca+=0x1){if(_0xf76038[_0xcbbb('0x9')][_0x5e25ca][_0xcbbb('0xa')]!==_0x30297d){if(!_[_0xcbbb('0x13')](_0x188698)){_0x188698+=',';}_0x188698+=_0xf76038['value'][_0x5e25ca]['name']||_0xf76038['value'][_0x5e25ca][_0xcbbb('0xa')]||'';_0x188698+='\x20<';_0x188698+=_0xf76038[_0xcbbb('0x9')][_0x5e25ca][_0xcbbb('0xa')]?_0xf76038[_0xcbbb('0x9')][_0x5e25ca][_0xcbbb('0xa')]:_0xcbbb('0xb')+random[_0xcbbb('0xc')](0x6)+_0xcbbb('0xd');_0x188698+='>';}}return _0x188698;}function parseEmail(_0x959609,_0x2d4335,_0x594b3f){if(_0x2d4335[_0xcbbb('0x14')]){var _0xe07b0=/)<[^<]*)*<\/script>/gi;while(_0xe07b0[_0xcbbb('0x15')](_0x2d4335[_0xcbbb('0x14')])){_0x2d4335[_0xcbbb('0x14')]=_0x2d4335[_0xcbbb('0x14')][_0xcbbb('0x16')](_0xe07b0,'');}if(_0x2d4335[_0xcbbb('0x14')][_0xcbbb('0x17')]('{_0xf39ddd['push'](_0x32625f['filename']);});var _0x575d56=/]+>/g;var _0x32e070=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x548440=_0x2d4335['html']['replace'](_0x32e070,_0xcbbb('0x19'));var _0x55e1d8=_0x548440['replace'](_0x575d56,_0xcbbb('0x1a'));for(let _0x2902c6=0x0;_0x2902c6<_0xf39ddd[_0xcbbb('0xf')];_0x2902c6++){var _0x13121e=_0x55e1d8[_0xcbbb('0x16')](_0xcbbb('0x1a'),_0xcbbb('0x1b')+_0xf39ddd[_0x2902c6]+_0xcbbb('0x1c'));_0x55e1d8=_0x13121e;}_0x2d4335[_0xcbbb('0x14')]=_0x55e1d8;}_0x594b3f[_0xcbbb('0x1d')]=_0x2d4335[_0xcbbb('0x14')];}else{_0x594b3f[_0xcbbb('0x1d')]=_0x2d4335[_0xcbbb('0x1e')];}if(_0x594b3f[_0xcbbb('0x1d')]){_0x594b3f[_0xcbbb('0x1d')]=_0x594b3f[_0xcbbb('0x1d')][_0xcbbb('0x16')](/0x0){var _0x5651fd=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0xcbbb('0x31')];for(var _0x3bf48b=0x0;_0x3bf48b<_0x2d4335[_0xcbbb('0x30')][_0xcbbb('0xf')];_0x3bf48b++){var _0x15f2b1=_[_0xcbbb('0x32')](_0x5651fd,_0x2d4335[_0xcbbb('0x30')][_0x3bf48b]['line']);if(_0x15f2b1>=0x0){_0x594b3f[_0xcbbb('0x33')]=!![];}}}return _0x594b3f;}exports[_0xcbbb('0x34')]=function(_0x5550d2,_0x15b3bc,_0xa8eff0){var _0x351c89={'from':getAddress(_0x15b3bc[_0xcbbb('0x35')]),'firstName':getFirstName(_0x15b3bc[_0xcbbb('0x35')]),'lastName':getLastName(_0x15b3bc['from']),'mapKey':_0xcbbb('0x23'),'message':{'from':getMails(_0x5550d2['email'],_0x15b3bc['from']),'to':_0x5550d2[_0xcbbb('0x23')],'cc':'','subject':_0x15b3bc[_0xcbbb('0x36')]||'','messageId':_0x15b3bc[_0xcbbb('0x37')],'inReplyTo':_0x15b3bc[_0xcbbb('0x38')],'sentAt':moment(_0x15b3bc[_0xcbbb('0x39')])[_0xcbbb('0x28')](_0xcbbb('0x3a')),'attach':![],'attachments':[]}};if(!_0x15b3bc[_0xcbbb('0x14')]&&!_0x15b3bc[_0xcbbb('0x1e')]){var _0x25ab3e=_[_0xcbbb('0x3b')](_0x15b3bc[_0xcbbb('0x18')],{'contentType':_0xcbbb('0x3c')});if(_0x25ab3e[_0xcbbb('0xf')]){logger['info'](util[_0xcbbb('0x28')](_0xcbbb('0x3d'),_0x15b3bc[_0xcbbb('0x37')]));tnef[_0xcbbb('0x3e')](_['first'](_0x25ab3e)['content'],function(_0x58ba49,_0x225b58){if(_0x225b58){_0x15b3bc[_0xcbbb('0x14')]=_0x225b58[_0xcbbb('0x3f')]||_0xcbbb('0x40');if(_0x225b58[_0xcbbb('0x41')]){for(var _0x1ef25b=0x0;_0x1ef25b<_0x225b58[_0xcbbb('0x41')]['length'];_0x1ef25b++){var _0x34026e=_0x225b58[_0xcbbb('0x41')][_0x1ef25b];_0x351c89[_0xcbbb('0x21')][_0xcbbb('0x18')]['push']({'filename':_0x34026e[_0xcbbb('0x42')],'content':Buffer[_0xcbbb('0x35')](_0x34026e[_0xcbbb('0x43')])});}}}_0xa8eff0(parseEmail(_0x5550d2,_0x15b3bc,_0x351c89));});}else{_0x15b3bc[_0xcbbb('0x14')]='

Empty\x20message

';_0xa8eff0(parseEmail(_0x5550d2,_0x15b3bc,_0x351c89));}}else{_0xa8eff0(parseEmail(_0x5550d2,_0x15b3bc,_0x351c89));}};exports['getHost']=function(_0x3e1fdc){switch(_0x3e1fdc){case _0xcbbb('0x44'):return _0xcbbb('0x45');case'yahoo':return'imap.mail.yahoo.com';case'hotmail':return _0xcbbb('0x46');case _0xcbbb('0x47'):return'outlook.office365.com';}return _0xcbbb('0x48');}; \ No newline at end of file +var _0xf9ac=['replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','127.0.0.1','lodash','path','util','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','length','slice','Anonymous','split','pop','isEmpty','html','test'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9ac,0x87));var _0xcf9a=function(_0x17b8aa,_0x262dca){_0x17b8aa=_0x17b8aa-0x0;var _0x227fd7=_0xf9ac[_0x17b8aa];return _0x227fd7;};'use strict';var _=require(_0xcf9a('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xcf9a('0x1'));var util=require(_0xcf9a('0x2'));var tnef=require('node-tnef');var logger=require(_0xcf9a('0x3'))('email');var config=require(_0xcf9a('0x4'));function getAddress(_0x518dc3){var _0x48da91=_[_0xcf9a('0x5')](_0x518dc3[_0xcf9a('0x6')]);return _0x48da91&&_0x48da91[_0xcf9a('0x7')]?_0x48da91[_0xcf9a('0x7')]:'anonymous'+random[_0xcf9a('0x8')](0x6)+_0xcf9a('0x9');}function getFirstName(_0x4c0665){var _0x536f2f=_[_0xcf9a('0x5')](_0x4c0665['value']);if(_0x536f2f&&_0x536f2f[_0xcf9a('0xa')]){if(_0x536f2f['name']==_0x536f2f[_0xcf9a('0x7')]){return _0x536f2f['name'][_0xcf9a('0xb')](0x0,_0x536f2f[_0xcf9a('0xa')][_0xcf9a('0xc')]('@'));}var _0x53c5ae=_0x536f2f['name']['split'](/\s+/);return _0x53c5ae[_0xcf9a('0xd')]>0x1?_0x53c5ae[_0xcf9a('0xe')](0x0,-0x1)['join']('\x20'):_0x536f2f[_0xcf9a('0xa')];}return _0xcf9a('0xf');}function getLastName(_0xe8fe56){var _0x583cdf=_[_0xcf9a('0x5')](_0xe8fe56['value']);if(_0x583cdf&&_0x583cdf['name']){var _0x58cdd2=_0x583cdf['name'][_0xcf9a('0x10')](/\s+/);return _0x58cdd2[_0xcf9a('0xd')]>0x1?_0x58cdd2[_0xcf9a('0x11')]():'';}return'';}function getMails(_0xaadfd7,_0x16b7d){var _0xced14a='';for(var _0x25dc10=0x0;_0x25dc10<_0x16b7d['value'][_0xcf9a('0xd')];_0x25dc10+=0x1){if(_0x16b7d[_0xcf9a('0x6')][_0x25dc10]['address']!==_0xaadfd7){if(!_[_0xcf9a('0x12')](_0xced14a)){_0xced14a+=',';}_0xced14a+=_0x16b7d['value'][_0x25dc10][_0xcf9a('0xa')]||_0x16b7d['value'][_0x25dc10][_0xcf9a('0x7')]||'';_0xced14a+='\x20<';_0xced14a+=_0x16b7d[_0xcf9a('0x6')][_0x25dc10][_0xcf9a('0x7')]?_0x16b7d[_0xcf9a('0x6')][_0x25dc10][_0xcf9a('0x7')]:'anonymous'+random['generate'](0x6)+_0xcf9a('0x9');_0xced14a+='>';}}return _0xced14a;}function parseEmail(_0x5f3ac0,_0x46d8b0,_0x2e308a){if(_0x46d8b0[_0xcf9a('0x13')]){var _0x5e8019=/)<[^<]*)*<\/script>/gi;while(_0x5e8019[_0xcf9a('0x14')](_0x46d8b0[_0xcf9a('0x13')])){_0x46d8b0[_0xcf9a('0x13')]=_0x46d8b0['html'][_0xcf9a('0x15')](_0x5e8019,'');}if(_0x46d8b0[_0xcf9a('0x13')][_0xcf9a('0x16')]('{_0x4f43b9[_0xcf9a('0x19')](_0x11f372[_0xcf9a('0x1a')]);});var _0x3d2135=/]+>/g;var _0x4f9b8c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2c46c5=_0x46d8b0['html']['replace'](_0x4f9b8c,_0xcf9a('0x1b'));var _0x798016=_0x2c46c5[_0xcf9a('0x15')](_0x3d2135,_0xcf9a('0x1c'));for(let _0x3497f4=0x0;_0x3497f4<_0x4f43b9[_0xcf9a('0xd')];_0x3497f4++){var _0x17386b=_0x798016['replace']('_IMG',_0xcf9a('0x1d')+_0x4f43b9[_0x3497f4]+_0xcf9a('0x1e'));_0x798016=_0x17386b;}_0x46d8b0['html']=_0x798016;}_0x2e308a['body']=_0x46d8b0['html'];}else{_0x2e308a[_0xcf9a('0x1f')]=_0x46d8b0[_0xcf9a('0x20')];}if(_0x2e308a[_0xcf9a('0x1f')]){_0x2e308a['body']=_0x2e308a[_0xcf9a('0x1f')][_0xcf9a('0x15')](/0x0){var _0x2da846=[_0xcf9a('0x32'),_0xcf9a('0x33'),_0xcf9a('0x34')];for(var _0x27273a=0x0;_0x27273a<_0x46d8b0[_0xcf9a('0x31')][_0xcf9a('0xd')];_0x27273a++){var _0x3a6a6d=_['indexOf'](_0x2da846,_0x46d8b0['headerLines'][_0x27273a][_0xcf9a('0x35')]);if(_0x3a6a6d>=0x0){_0x2e308a['isAutoreply']=!![];}}}return _0x2e308a;}exports[_0xcf9a('0x36')]=function(_0x325d85,_0x46233c,_0x4ad76b){var _0x424476={'from':getAddress(_0x46233c[_0xcf9a('0x37')]),'firstName':getFirstName(_0x46233c[_0xcf9a('0x37')]),'lastName':getLastName(_0x46233c[_0xcf9a('0x37')]),'mapKey':'email','message':{'from':getMails(_0x325d85[_0xcf9a('0x23')],_0x46233c[_0xcf9a('0x37')]),'to':_0x325d85[_0xcf9a('0x23')],'cc':'','subject':_0x46233c[_0xcf9a('0x38')]||'','messageId':_0x46233c['messageId'],'inReplyTo':_0x46233c[_0xcf9a('0x39')],'sentAt':moment(_0x46233c[_0xcf9a('0x3a')])[_0xcf9a('0x29')](_0xcf9a('0x3b')),'attach':![],'attachments':[]}};if(!_0x46233c[_0xcf9a('0x13')]&&!_0x46233c[_0xcf9a('0x20')]){var _0x48b3af=_['filter'](_0x46233c[_0xcf9a('0x17')],{'contentType':_0xcf9a('0x3c')});if(_0x48b3af[_0xcf9a('0xd')]){logger[_0xcf9a('0x3d')](util[_0xcf9a('0x29')](_0xcf9a('0x3e'),_0x46233c[_0xcf9a('0x3f')]));tnef[_0xcf9a('0x40')](_[_0xcf9a('0x41')](_0x48b3af)[_0xcf9a('0x2f')],function(_0xacf25,_0x435973){if(_0x435973){_0x46233c[_0xcf9a('0x13')]=_0x435973[_0xcf9a('0x42')]||_0xcf9a('0x43');if(_0x435973['Attachments']){for(var _0x15a195=0x0;_0x15a195<_0x435973[_0xcf9a('0x44')][_0xcf9a('0xd')];_0x15a195++){var _0x2b02bf=_0x435973[_0xcf9a('0x44')][_0x15a195];_0x424476[_0xcf9a('0x24')][_0xcf9a('0x17')][_0xcf9a('0x19')]({'filename':_0x2b02bf[_0xcf9a('0x45')],'content':Buffer[_0xcf9a('0x37')](_0x2b02bf['Data'])});}}}_0x4ad76b(parseEmail(_0x325d85,_0x46233c,_0x424476));});}else{_0x46233c[_0xcf9a('0x13')]=_0xcf9a('0x43');_0x4ad76b(parseEmail(_0x325d85,_0x46233c,_0x424476));}}else{_0x4ad76b(parseEmail(_0x325d85,_0x46233c,_0x424476));}};exports[_0xcf9a('0x46')]=function(_0x5058d8){switch(_0x5058d8){case _0xcf9a('0x47'):return _0xcf9a('0x48');case _0xcf9a('0x49'):return _0xcf9a('0x4a');case _0xcf9a('0x4b'):return _0xcf9a('0x4c');case'outlook365':return'outlook.office365.com';}return _0xcf9a('0x4d');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 6fd4064..a44ce32 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 _0xad0b=['name','key','active','Imap','Smtp','exports','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad0b,0xa7));var _0xbad0=function(_0x30eb8c,_0x3fc75e){_0x30eb8c=_0x30eb8c-0x0;var _0x1e6683=_0xad0b[_0x30eb8c];return _0x1e6683;};'use strict';var _=require(_0xbad0('0x0'));function MailAccount(_0x2244a9){this['id']=_0x2244a9['id']||0x0;this[_0xbad0('0x1')]=_0x2244a9['name']||'Service';this[_0xbad0('0x2')]=_0x2244a9['key']||'SERV';this[_0xbad0('0x3')]=_0x2244a9[_0xbad0('0x3')]||![];this[_0xbad0('0x4')]=_0x2244a9[_0xbad0('0x4')]||[];this[_0xbad0('0x5')]=_0x2244a9[_0xbad0('0x5')]||[];}module[_0xbad0('0x6')]=MailAccount; \ No newline at end of file +var _0xb853=['SERV','active','Imap','Smtp','exports','lodash','Service','key'];(function(_0x44c910,_0xf9dbf5){var _0x296bac=function(_0x47328e){while(--_0x47328e){_0x44c910['push'](_0x44c910['shift']());}};_0x296bac(++_0xf9dbf5);}(_0xb853,0x14d));var _0x3b85=function(_0x2fa9f7,_0x1ab581){_0x2fa9f7=_0x2fa9f7-0x0;var _0xd18cec=_0xb853[_0x2fa9f7];return _0xd18cec;};'use strict';var _=require(_0x3b85('0x0'));function MailAccount(_0x21eff9){this['id']=_0x21eff9['id']||0x0;this['name']=_0x21eff9['name']||_0x3b85('0x1');this[_0x3b85('0x2')]=_0x21eff9[_0x3b85('0x2')]||_0x3b85('0x3');this[_0x3b85('0x4')]=_0x21eff9[_0x3b85('0x4')]||![];this[_0x3b85('0x5')]=_0x21eff9[_0x3b85('0x5')]||[];this[_0x3b85('0x6')]=_0x21eff9[_0x3b85('0x6')]||[];}module[_0x3b85('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 3674f23..a2758b1 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 _0xf7bb=['exports','lodash','../model/mailAccount','hasOwnProperty','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge'];(function(_0x522b11,_0x6f9b5a){var _0x47bb7a=function(_0x14bb93){while(--_0x14bb93){_0x522b11['push'](_0x522b11['shift']());}};_0x47bb7a(++_0x6f9b5a);}(_0xf7bb,0xab));var _0xbf7b=function(_0xa86433,_0x36e3cf){_0xa86433=_0xa86433-0x0;var _0x669482=_0xf7bb[_0xa86433];return _0x669482;};'use strict';var _=require(_0xbf7b('0x0'));var MailAccount=require(_0xbf7b('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5074df,_0x245017,_0x5088b9){var _0x589608=_['mapKeys'](_0x5074df,function(_0x417db7,_0x56bca7){return _0x417db7[_0x5088b9];});for(var _0x22326f in _0x245017){if(_0x245017[_0xbf7b('0x2')](_0x22326f)){if(!_0x589608[_0x22326f]){delete _0x245017[_0x22326f];}}}}Realtime['prototype'][_0xbf7b('0x3')]=function(_0x4a866e,_0xaad9e){for(var _0x2b379f in _0xaad9e){if(_0x4a866e['hasOwnProperty'](_0x2b379f)){_0x4a866e[_0x2b379f]=_0xaad9e[_0x2b379f];}}};Realtime['prototype'][_0xbf7b('0x4')]=function(){var _0x13ba39=this;return function(_0x43b19){if(_0x43b19){freeIsNotKey(_0x43b19,_0x13ba39[_0xbf7b('0x5')],'id');for(var _0x294512=0x0,_0x1eba0e={},_0x1bcac7={};_0x294512<_0x43b19[_0xbf7b('0x6')];_0x294512+=0x1){_0x1eba0e=_0x43b19[_0x294512];if(_[_0xbf7b('0x7')](_0x13ba39['mailAccounts'][_0x1eba0e['id']])){_0x13ba39[_0xbf7b('0x5')][_0x1eba0e['id']]=new MailAccount(_0x1eba0e);}else{_[_0xbf7b('0x8')](_0x13ba39[_0xbf7b('0x5')][_0x1eba0e['id']],_0x1eba0e);}}}return _0x13ba39[_0xbf7b('0x5')];};};module[_0xbf7b('0x9')]=Realtime; \ No newline at end of file +var _0x66b3=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','merge'];(function(_0x133229,_0x53ea26){var _0x16bb6f=function(_0x332d99){while(--_0x332d99){_0x133229['push'](_0x133229['shift']());}};_0x16bb6f(++_0x53ea26);}(_0x66b3,0x11f));var _0x366b=function(_0x175144,_0x28d089){_0x175144=_0x175144-0x0;var _0x1ac733=_0x66b3[_0x175144];return _0x1ac733;};'use strict';var _=require(_0x366b('0x0'));var MailAccount=require(_0x366b('0x1'));var Realtime=function(){this[_0x366b('0x2')]={};};function freeIsNotKey(_0x3349d2,_0x390f9f,_0x542ccf){var _0x4a89f4=_[_0x366b('0x3')](_0x3349d2,function(_0x5c04f6,_0x2a80bf){return _0x5c04f6[_0x542ccf];});for(var _0x5dd6fc in _0x390f9f){if(_0x390f9f[_0x366b('0x4')](_0x5dd6fc)){if(!_0x4a89f4[_0x5dd6fc]){delete _0x390f9f[_0x5dd6fc];}}}}Realtime[_0x366b('0x5')][_0x366b('0x6')]=function(_0xe23f80,_0x2a3223){for(var _0x371484 in _0x2a3223){if(_0xe23f80['hasOwnProperty'](_0x371484)){_0xe23f80[_0x371484]=_0x2a3223[_0x371484];}}};Realtime[_0x366b('0x5')][_0x366b('0x7')]=function(){var _0x214afe=this;return function(_0x366bdd){if(_0x366bdd){freeIsNotKey(_0x366bdd,_0x214afe[_0x366b('0x2')],'id');for(var _0x55fb0d=0x0,_0x1ed5fd={},_0x17765b={};_0x55fb0d<_0x366bdd[_0x366b('0x8')];_0x55fb0d+=0x1){_0x1ed5fd=_0x366bdd[_0x55fb0d];if(_['isUndefined'](_0x214afe[_0x366b('0x2')][_0x1ed5fd['id']])){_0x214afe['mailAccounts'][_0x1ed5fd['id']]=new MailAccount(_0x1ed5fd);}else{_[_0x366b('0x9')](_0x214afe[_0x366b('0x2')][_0x1ed5fd['id']],_0x1ed5fd);}}}return _0x214afe['mailAccounts'];};};module[_0x366b('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 943144f..0e0c787 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 _0x881e=['notify','NotifyMailAccount','Request','GetMailAccount','service','active','key','ListId','TemplateId','Imap','MailServerOut','getMailAccount'];(function(_0x479b99,_0x1e5bec){var _0x1e7eb7=function(_0x52ac6c){while(--_0x52ac6c){_0x479b99['push'](_0x479b99['shift']());}};_0x1e7eb7(++_0x1e5bec);}(_0x881e,0x146));var _0xe881=function(_0x330477,_0x37ec69){_0x330477=_0x330477-0x0;var _0x3a93d0=_0x881e[_0x330477];return _0x3a93d0;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0xe881('0x0')](_0xe881('0x1'),{'options':{'attributes':['id','name',_0xe881('0x2'),'email',_0xe881('0x3'),_0xe881('0x4'),_0xe881('0x5'),_0xe881('0x6')],'raw':![],'include':[{'model':'MailServerIn','as':_0xe881('0x7')},{'model':_0xe881('0x8'),'as':'Smtp'}]},'log':_0xe881('0x9')});};};exports[_0xe881('0xa')]=function(_0xe16d23,_0x547217){return client['Request'](_0xe881('0xb'),{'account':{'id':_0xe16d23},'body':_0x547217,'log':_0xe881('0xb')});}; \ No newline at end of file +var _0x8343=['NotifyMailAccount','../client','getMailAccounts','Request','name','email','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','notify'];(function(_0x2b3df5,_0x4f5e92){var _0x20231=function(_0x376577){while(--_0x376577){_0x2b3df5['push'](_0x2b3df5['shift']());}};_0x20231(++_0x4f5e92);}(_0x8343,0xa9));var _0x3834=function(_0x57f91e,_0x44f971){_0x57f91e=_0x57f91e-0x0;var _0x31f2b3=_0x8343[_0x57f91e];return _0x31f2b3;};'use strict';var client=require(_0x3834('0x0'));exports[_0x3834('0x1')]=function(){return function(){return client[_0x3834('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x3834('0x3'),'service',_0x3834('0x4'),'active','key','ListId',_0x3834('0x5')],'raw':![],'include':[{'model':_0x3834('0x6'),'as':_0x3834('0x7')},{'model':'MailServerOut','as':_0x3834('0x8')}]},'log':_0x3834('0x9')});};};exports[_0x3834('0xa')]=function(_0x994230,_0x520a4f){return client['Request'](_0x3834('0xb'),{'account':{'id':_0x994230},'body':_0x520a4f,'log':_0x3834('0xb')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index ef9f0a7..1e2b50c 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 _0x2ed5=['loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x174bed,_0x43c3f3){var _0x2f69e4=function(_0x2b2262){while(--_0x2b2262){_0x174bed['push'](_0x174bed['shift']());}};_0x2f69e4(++_0x43c3f3);}(_0x2ed5,0x183));var _0x52ed=function(_0x5b0177,_0xaed843){_0x5b0177=_0x5b0177-0x0;var _0x56ba0c=_0x2ed5[_0x5b0177];return _0x56ba0c;};'use strict';var client=require(_0x52ed('0x0'));exports[_0x52ed('0x1')]=function(){return client[_0x52ed('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x52ed('0x3')]},'log':_0x52ed('0x4')});}; \ No newline at end of file +var _0x4e13=['getSettings','Request','GetSettings','../client'];(function(_0x25e296,_0x172c5e){var _0x3cd140=function(_0x2e82c1){while(--_0x2e82c1){_0x25e296['push'](_0x25e296['shift']());}};_0x3cd140(++_0x172c5e);}(_0x4e13,0x153));var _0x34e1=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x4e13[_0x1ee5be];return _0x177140;};'use strict';var client=require(_0x34e1('0x0'));exports[_0x34e1('0x1')]=function(){return client[_0x34e1('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x34e1('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 1dd998a..5448469 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 da91848..2746a5a 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 _0x493c=['ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','sticky-session'];(function(_0x7beb1e,_0x112d19){var _0xfb137b=function(_0x1dfcaa){while(--_0x1dfcaa){_0x7beb1e['push'](_0x7beb1e['shift']());}};_0xfb137b(++_0x112d19);}(_0x493c,0x125));var _0xc493=function(_0x1f682f,_0x1ddc85){_0x1f682f=_0x1f682f-0x0;var _0x3636e7=_0x493c[_0x1f682f];return _0x3636e7;};'use strict';var _=require('lodash');var http=require('http');var express=require('express');var sticky=require(_0xc493('0x0'));var Redis=require(_0xc493('0x1'));var config=require(_0xc493('0x2'));var app=express();var server=http[_0xc493('0x3')](app);server[_0xc493('0x4')]=0xdbba0;if(sticky[_0xc493('0x5')](server,config[_0xc493('0x6')])){var socketio=require(_0xc493('0x7'))(server,{'transports':[_0xc493('0x8'),_0xc493('0x9')]});config['redis']=_[_0xc493('0xa')](config[_0xc493('0xb')],{'host':_0xc493('0xc'),'port':0x18eb});socketio[_0xc493('0xd')](require(_0xc493('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xc493('0xb')])}));require(_0xc493('0xf'))[_0xc493('0x10')]();require('../../config/socketio')['default'](socketio);require('../../config/express')['default'](app);require(_0xc493('0x11'))['default'](app);}else{server['once']('listening',function(){console[_0xc493('0x12')](_0xc493('0x13'),config[_0xc493('0x6')]);});}exports=module[_0xc493('0x14')]=app; \ No newline at end of file +var _0x9f6e=['../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','socket.io-redis','../../config/triggers','default','../../config/socketio'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x9f6e,0x116));var _0xe9f6=function(_0x24cfd1,_0x59ddd5){_0x24cfd1=_0x24cfd1-0x0;var _0x48285e=_0x9f6e[_0x24cfd1];return _0x48285e;};'use strict';var _=require('lodash');var http=require(_0xe9f6('0x0'));var express=require('express');var sticky=require(_0xe9f6('0x1'));var Redis=require(_0xe9f6('0x2'));var config=require(_0xe9f6('0x3'));var app=express();var server=http[_0xe9f6('0x4')](app);server[_0xe9f6('0x5')]=0xdbba0;if(sticky[_0xe9f6('0x6')](server,config[_0xe9f6('0x7')])){var socketio=require(_0xe9f6('0x8'))(server,{'transports':[_0xe9f6('0x9'),'polling']});config[_0xe9f6('0xa')]=_[_0xe9f6('0xb')](config[_0xe9f6('0xa')],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0xe9f6('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xe9f6('0xd'))[_0xe9f6('0xe')]();require(_0xe9f6('0xf'))[_0xe9f6('0xe')](socketio);require(_0xe9f6('0x10'))[_0xe9f6('0xe')](app);require(_0xe9f6('0x11'))['default'](app);}else{server[_0xe9f6('0x12')]('listening',function(){console[_0xe9f6('0x13')](_0xe9f6('0x14'),config['port']);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 6ae0ca7..8e915cc 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 _0x8bb0=['bluebird','routing','client','http','Request','request','then','debug','rpc','error','message','result','exports','jayson/promise'];(function(_0x5de83e,_0x58dc33){var _0x20559a=function(_0x15af49){while(--_0x15af49){_0x5de83e['push'](_0x5de83e['shift']());}};_0x20559a(++_0x58dc33);}(_0x8bb0,0x1e9));var _0x08bb=function(_0x4bda2a,_0x328fd6){_0x4bda2a=_0x4bda2a-0x0;var _0x40f2e0=_0x8bb0[_0x4bda2a];return _0x40f2e0;};'use strict';var jayson=require(_0x08bb('0x0'));var BPromise=require(_0x08bb('0x1'));var logger=require('../../config/logger')(_0x08bb('0x2'));var client=jayson[_0x08bb('0x3')][_0x08bb('0x4')]({'port':0x2329});client[_0x08bb('0x5')]=function(_0x265e1c,_0x3009d6){return new BPromise(function(_0x45ec9a,_0x5e31c3){return client[_0x08bb('0x6')](_0x265e1c,_0x3009d6)[_0x08bb('0x7')](function(_0x18b7f5){logger[_0x08bb('0x8')](_0x08bb('0x9'),_0x08bb('0x2'),_0x265e1c,_0x3009d6,_0x18b7f5);if(_0x18b7f5['error']){logger[_0x08bb('0xa')](_0x08bb('0x9'),_0x08bb('0x2'),_0x265e1c,_0x18b7f5[_0x08bb('0xa')]['message'],_0x3009d6);return _0x5e31c3(_0x18b7f5[_0x08bb('0xa')][_0x08bb('0xb')]);}else{return _0x45ec9a(_0x18b7f5[_0x08bb('0xc')]);}})['catch'](function(_0x51edd3){logger[_0x08bb('0xa')](_0x08bb('0x9'),'routing',_0x265e1c,_0x51edd3,_0x3009d6);return _0x5e31c3(_0x51edd3);});});};module[_0x08bb('0xd')]=client; \ No newline at end of file +var _0x7dc9=['then','rpc','error','message','catch','bluebird','../../config/logger','routing','client','http','request'];(function(_0x56dbb8,_0x239ee1){var _0xfeef25=function(_0x273c5e){while(--_0x273c5e){_0x56dbb8['push'](_0x56dbb8['shift']());}};_0xfeef25(++_0x239ee1);}(_0x7dc9,0x1a7));var _0x97dc=function(_0x9b42c3,_0x4205c9){_0x9b42c3=_0x9b42c3-0x0;var _0x4487e8=_0x7dc9[_0x9b42c3];return _0x4487e8;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x97dc('0x0'));var logger=require(_0x97dc('0x1'))(_0x97dc('0x2'));var client=jayson[_0x97dc('0x3')][_0x97dc('0x4')]({'port':0x2329});client['Request']=function(_0x112e75,_0x2264ae){return new BPromise(function(_0x4eb4c5,_0x37cae6){return client[_0x97dc('0x5')](_0x112e75,_0x2264ae)[_0x97dc('0x6')](function(_0x45c64c){logger['debug'](_0x97dc('0x7'),_0x97dc('0x2'),_0x112e75,_0x2264ae,_0x45c64c);if(_0x45c64c[_0x97dc('0x8')]){logger['error']('rpc',_0x97dc('0x2'),_0x112e75,_0x45c64c[_0x97dc('0x8')][_0x97dc('0x9')],_0x2264ae);return _0x37cae6(_0x45c64c['error']['message']);}else{return _0x4eb4c5(_0x45c64c['result']);}})[_0x97dc('0xa')](function(_0x196796){logger[_0x97dc('0x8')]('rpc',_0x97dc('0x2'),_0x112e75,_0x196796,_0x2264ae);return _0x37cae6(_0x196796);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index b2a851e..db07943 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 _0xb811=['resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','initWhatsappQueues','listen','catch','./server','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xb811,0x18a));var _0x1b81=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb811[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require('bluebird');var server=require(_0x1b81('0x0'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x1b81('0x1'));var chatQueue=require(_0x1b81('0x2'));var smsQueue=require(_0x1b81('0x3'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x1b81('0x4'));var whatsappQueue=require(_0x1b81('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1b81('0x6')]()['then'](user['getAgents']())[_0x1b81('0x7')](realtime[_0x1b81('0x8')]())['then'](interval[_0x1b81('0x9')]())['then'](realtime[_0x1b81('0xa')]())[_0x1b81('0x7')](openchannelQueue[_0x1b81('0xb')]())[_0x1b81('0x7')](realtime[_0x1b81('0xc')]())[_0x1b81('0x7')](chatQueue[_0x1b81('0xd')]())['then'](realtime[_0x1b81('0xe')]())[_0x1b81('0x7')](smsQueue[_0x1b81('0xf')]())[_0x1b81('0x7')](realtime[_0x1b81('0x10')]())[_0x1b81('0x7')](mailQueue['getMailQueues']())[_0x1b81('0x7')](realtime['initMailQueues']())[_0x1b81('0x7')](faxQueue['getFaxQueues']())[_0x1b81('0x7')](realtime['initFaxQueues']())[_0x1b81('0x7')](whatsappQueue['getWhatsappQueues']())[_0x1b81('0x7')](realtime[_0x1b81('0x11')]())[_0x1b81('0x7')](function(){return realtime;});}function main(){return server[_0x1b81('0x12')](realtime)[_0x1b81('0x7')](function(_0x5f4614){return initRealtime();})['then'](function(_0x1d7c0e){return setInterval(initRealtime,0x1388);})[_0x1b81('0x13')](function(_0x2c08c7){console['log'](_0x2c08c7);});}main(); \ No newline at end of file +var _0xc7e2=['initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues'];(function(_0x2f4adf,_0x2fb261){var _0x19831e=function(_0xb477cb){while(--_0xb477cb){_0x2f4adf['push'](_0x2f4adf['shift']());}};_0x19831e(++_0x2fb261);}(_0xc7e2,0xa3));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x2c7e('0x0'));var server=require(_0x2c7e('0x1'));var Realtime=require('./realtime');var user=require(_0x2c7e('0x2'));var interval=require(_0x2c7e('0x3'));var openchannelQueue=require(_0x2c7e('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x2c7e('0x5'));var mailQueue=require(_0x2c7e('0x6'));var faxQueue=require(_0x2c7e('0x7'));var whatsappQueue=require(_0x2c7e('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x2c7e('0x9')]()['then'](user[_0x2c7e('0xa')]())['then'](realtime[_0x2c7e('0xb')]())[_0x2c7e('0xc')](interval[_0x2c7e('0xd')]())[_0x2c7e('0xc')](realtime[_0x2c7e('0xe')]())[_0x2c7e('0xc')](openchannelQueue[_0x2c7e('0xf')]())[_0x2c7e('0xc')](realtime[_0x2c7e('0x10')]())[_0x2c7e('0xc')](chatQueue[_0x2c7e('0x11')]())[_0x2c7e('0xc')](realtime['initChatQueues']())[_0x2c7e('0xc')](smsQueue[_0x2c7e('0x12')]())['then'](realtime[_0x2c7e('0x13')]())[_0x2c7e('0xc')](mailQueue[_0x2c7e('0x14')]())[_0x2c7e('0xc')](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())[_0x2c7e('0xc')](realtime[_0x2c7e('0x15')]())[_0x2c7e('0xc')](whatsappQueue[_0x2c7e('0x16')]())['then'](realtime[_0x2c7e('0x17')]())[_0x2c7e('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x2c7e('0xc')](function(_0x507349){return initRealtime();})['then'](function(_0x5c8a57){return setInterval(initRealtime,0x1388);})[_0x2c7e('0x18')](function(_0x2b1177){console[_0x2c7e('0x19')](_0x2b1177);});}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 bf303d2..612f415 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0xb58700,_0x45f2ad){var _0x25d252=function(_0x2441f8){while(--_0x2441f8){_0xb58700['push'](_0xb58700['shift']());}};_0x25d252(++_0x45f2ad);}(_0x7a54,0x106));var _0x47a5=function(_0x4350a1,_0x3f161b){_0x4350a1=_0x4350a1-0x0;var _0x216ce6=_0x7a54[_0x4350a1];return _0x216ce6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x1d646a,_0x129159){var _0x1909be=function(_0x4487d6){while(--_0x4487d6){_0x1d646a['push'](_0x1d646a['shift']());}};_0x1909be(++_0x129159);}(_0x7a54,0x106));var _0x47a5=function(_0x472663,_0x1e50c9){_0x472663=_0x472663-0x0;var _0x34911a=_0x7a54[_0x472663];return _0x34911a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 16c2209..0ee10c5 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 _0x5e4e=['error','message','result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0x5e4e,0xd7));var _0xe5e4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5e4e[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe5e4('0x0'));var client=jayson[_0xe5e4('0x1')][_0xe5e4('0x2')]({'port':0x232b});function request(_0x7bff9b,_0x2f5e21){return new BPromise(function(_0x498a38,_0x3eb8c5){return client[_0xe5e4('0x3')](_0x7bff9b,_0x2f5e21)[_0xe5e4('0x4')](function(_0x2ef966){if(_0x2ef966['error']){return _0x3eb8c5(_0x2ef966[_0xe5e4('0x5')][_0xe5e4('0x6')]);}else{return _0x498a38(_0x2ef966[_0xe5e4('0x7')]);}})[_0xe5e4('0x8')](function(_0x213acd){return _0x3eb8c5(_0x213acd);});});}exports[_0xe5e4('0x9')]=function(_0x5635b1,_0x314e22){return request(_0xe5e4('0xa'),{'account':_0x5635b1,'message':_0x314e22});}; \ No newline at end of file +var _0x0795=['jayson/promise','client','http','error','message','result','catch','sendMailMessage'];(function(_0x38cc06,_0x16c4f8){var _0x3365d3=function(_0x58560b){while(--_0x58560b){_0x38cc06['push'](_0x38cc06['shift']());}};_0x3365d3(++_0x16c4f8);}(_0x0795,0x78));var _0x5079=function(_0x44ad53,_0x4a34b1){_0x44ad53=_0x44ad53-0x0;var _0x34cb4b=_0x0795[_0x44ad53];return _0x34cb4b;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x5079('0x0'));var client=jayson[_0x5079('0x1')][_0x5079('0x2')]({'port':0x232b});function request(_0x18fc7b,_0x1ce3ad){return new BPromise(function(_0x3fd84f,_0x984aef){return client['request'](_0x18fc7b,_0x1ce3ad)['then'](function(_0x2fd4d8){if(_0x2fd4d8[_0x5079('0x3')]){return _0x984aef(_0x2fd4d8[_0x5079('0x3')][_0x5079('0x4')]);}else{return _0x3fd84f(_0x2fd4d8[_0x5079('0x5')]);}})[_0x5079('0x6')](function(_0x2275e5){return _0x984aef(_0x2275e5);});});}exports[_0x5079('0x7')]=function(_0x439a2d,_0x44f6b9){return request('SendMail',{'account':_0x439a2d,'message':_0x44f6b9});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index fe1b83f..620625d 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 _0x4200=['smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','length','Status','format','chatStatusTime','faxStatus','faxCurrentCapacity','openchannelStatus','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause'];(function(_0x15d1f7,_0x567bba){var _0x318629=function(_0x1eadad){while(--_0x1eadad){_0x15d1f7['push'](_0x15d1f7['shift']());}};_0x318629(++_0x567bba);}(_0x4200,0x188));var _0x0420=function(_0x5ce85f,_0x28f0b3){_0x5ce85f=_0x5ce85f-0x0;var _0x2b15e1=_0x4200[_0x5ce85f];return _0x2b15e1;};'use strict';var _=require(_0x0420('0x0'));var moment=require(_0x0420('0x1'));var md5=require(_0x0420('0x2'));var Redis=require(_0x0420('0x3'));var config=require(_0x0420('0x4'));config[_0x0420('0x5')]=_[_0x0420('0x6')](config[_0x0420('0x5')],{'host':_0x0420('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0420('0x5')]));function Agent(_0x44837a){this['id']=_0x44837a['id']||0x0;this[_0x0420('0x8')]=_0x44837a[_0x0420('0x8')]||'';this[_0x0420('0x9')]=_0x44837a['online']||!![];this[_0x0420('0xa')]=_0x44837a['voicePause']||![];this[_0x0420('0xb')]=_0x44837a['chatPause']||![];this[_0x0420('0xc')]=_0x44837a[_0x0420('0xc')]||![];this[_0x0420('0xd')]=_0x44837a[_0x0420('0xd')]||![];this['smsPause']=_0x44837a[_0x0420('0xe')]||![];this[_0x0420('0xf')]=_0x44837a[_0x0420('0xf')]||![];this[_0x0420('0x10')]='unknown';this['chatStatusTime']=0x0;this[_0x0420('0x11')]=_0x44837a[_0x0420('0x11')]||0x0;this[_0x0420('0x12')]=0x0;this[_0x0420('0x13')]=_0x0420('0x14');this[_0x0420('0x15')]=0x0;this[_0x0420('0x16')]=_0x44837a[_0x0420('0x16')]||0x0;this[_0x0420('0x17')]=0x0;this['faxStatus']=_0x0420('0x14');this[_0x0420('0x18')]=0x0;this[_0x0420('0x19')]=_0x44837a[_0x0420('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x0420('0x1a')]=_0x0420('0x14');this[_0x0420('0x1b')]=0x0;this[_0x0420('0x1c')]=_0x44837a[_0x0420('0x1c')]||0x0;this[_0x0420('0x1d')]=0x0;this['whatsappStatus']=_0x0420('0x14');this[_0x0420('0x1e')]=0x0;this[_0x0420('0x1f')]=_0x44837a[_0x0420('0x1f')]||0x0;this[_0x0420('0x20')]=0x0;this['openchannelStatus']=_0x0420('0x14');this[_0x0420('0x21')]=0x0;this[_0x0420('0x22')]=_0x44837a['openchannelCapacity']||0x0;this[_0x0420('0x23')]=0x0;this[_0x0420('0x24')]=![];this[_0x0420('0x25')]=undefined;this[_0x0420('0x2')]='';this[_0x0420('0x26')]();}Agent['prototype'][_0x0420('0x27')]=function(_0x4c75dd){if(this[_0x4c75dd+'CurrentCapacity']>0x0){if(this[_0x4c75dd+'Capacity']>0x0&&this[_0x4c75dd+_0x0420('0x28')]>=this[_0x4c75dd+_0x0420('0x29')]){return _0x0420('0x2a');}else{return _0x0420('0x2b');}}else{return _0x0420('0x2c');}};Agent[_0x0420('0x2d')]['updateRealtime']=function(){var _0x542282=[_0x0420('0x2e'),_0x0420('0x2f'),'openchannel','fax','sms','whatsapp'];for(var _0x14cea9=0x0;_0x14cea9<_0x542282[_0x0420('0x30')];_0x14cea9+=0x1){var _0x17c737=this[_0x0420('0x27')](_0x542282[_0x14cea9]);if(this[_0x542282[_0x14cea9]+_0x0420('0x31')]!==_0x17c737){this[_0x542282[_0x14cea9]+'StatusTime']=_['toNumber'](moment()[_0x0420('0x32')]('x'));}this[_0x542282[_0x14cea9]+_0x0420('0x31')]=_0x17c737;}var _0x9f6eb8={'id':this['id'],'name':this[_0x0420('0x8')],'online':this[_0x0420('0x9')],'voicePause':this[_0x0420('0xa')],'chatPause':this[_0x0420('0xb')],'mailPause':this[_0x0420('0xc')],'smsPause':this[_0x0420('0xe')],'faxPause':this[_0x0420('0xd')],'openchannelPause':this[_0x0420('0xf')],'chatStatus':this[_0x0420('0x10')],'chatStatusTime':this[_0x0420('0x33')],'chatCapacity':this[_0x0420('0x11')],'chatCurrentCapacity':this[_0x0420('0x12')],'mailStatus':this[_0x0420('0x13')],'mailStatusTime':this[_0x0420('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x0420('0x34')],'faxStatusTime':this[_0x0420('0x18')],'faxCapacity':this[_0x0420('0x19')],'faxCurrentCapacity':this[_0x0420('0x35')],'smsStatus':this[_0x0420('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x0420('0x1c')],'smsCurrentCapacity':this[_0x0420('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x0420('0x1e')],'whatsappCapacity':this[_0x0420('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x0420('0x36')],'openchannelStatusTime':this[_0x0420('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x0420('0x23')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x350a54=md5(JSON[_0x0420('0x37')](_0x9f6eb8));if(this[_0x0420('0x2')]!==_0x350a54){this[_0x0420('0x2')]=_0x350a54;io[_0x0420('0x38')](_0x0420('0x39'),_0x9f6eb8);}};module['exports']=Agent; \ No newline at end of file +var _0x9eef=['busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','idle','prototype','mail','chat','openchannel','sms','whatsapp','Status','StatusTime','toNumber','format','smsPause','mailStatus','mailStatusTime','faxStatus','whatsappStatus','stringify','lodash','moment','md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9eef,0x103));var _0xf9ee=function(_0x7a68b,_0x964789){_0x7a68b=_0x7a68b-0x0;var _0x110d37=_0x9eef[_0x7a68b];return _0x110d37;};'use strict';var _=require(_0xf9ee('0x0'));var moment=require(_0xf9ee('0x1'));var md5=require(_0xf9ee('0x2'));var Redis=require(_0xf9ee('0x3'));var config=require(_0xf9ee('0x4'));config['redis']=_[_0xf9ee('0x5')](config['redis'],{'host':_0xf9ee('0x6'),'port':0x18eb});var io=require(_0xf9ee('0x7'))(new Redis(config[_0xf9ee('0x8')]));function Agent(_0x298955){this['id']=_0x298955['id']||0x0;this[_0xf9ee('0x9')]=_0x298955[_0xf9ee('0x9')]||'';this['online']=_0x298955[_0xf9ee('0xa')]||!![];this[_0xf9ee('0xb')]=_0x298955[_0xf9ee('0xb')]||![];this[_0xf9ee('0xc')]=_0x298955['chatPause']||![];this[_0xf9ee('0xd')]=_0x298955[_0xf9ee('0xd')]||![];this[_0xf9ee('0xe')]=_0x298955[_0xf9ee('0xe')]||![];this['smsPause']=_0x298955['smsPause']||![];this[_0xf9ee('0xf')]=_0x298955[_0xf9ee('0xf')]||![];this[_0xf9ee('0x10')]=_0xf9ee('0x11');this[_0xf9ee('0x12')]=0x0;this[_0xf9ee('0x13')]=_0x298955[_0xf9ee('0x13')]||0x0;this[_0xf9ee('0x14')]=0x0;this['mailStatus']=_0xf9ee('0x11');this['mailStatusTime']=0x0;this['mailCapacity']=_0x298955[_0xf9ee('0x15')]||0x0;this[_0xf9ee('0x16')]=0x0;this['faxStatus']=_0xf9ee('0x11');this[_0xf9ee('0x17')]=0x0;this[_0xf9ee('0x18')]=_0x298955[_0xf9ee('0x18')]||0x0;this[_0xf9ee('0x19')]=0x0;this[_0xf9ee('0x1a')]=_0xf9ee('0x11');this[_0xf9ee('0x1b')]=0x0;this['smsCapacity']=_0x298955[_0xf9ee('0x1c')]||0x0;this[_0xf9ee('0x1d')]=0x0;this['whatsappStatus']='unknown';this[_0xf9ee('0x1e')]=0x0;this['whatsappCapacity']=_0x298955['whatsappCapacity']||0x0;this[_0xf9ee('0x1f')]=0x0;this[_0xf9ee('0x20')]=_0xf9ee('0x11');this[_0xf9ee('0x21')]=0x0;this[_0xf9ee('0x22')]=_0x298955[_0xf9ee('0x22')]||0x0;this[_0xf9ee('0x23')]=0x0;this[_0xf9ee('0x24')]=![];this[_0xf9ee('0x25')]=undefined;this[_0xf9ee('0x2')]='';this[_0xf9ee('0x26')]();}Agent['prototype'][_0xf9ee('0x27')]=function(_0x4704b2){if(this[_0x4704b2+_0xf9ee('0x28')]>0x0){if(this[_0x4704b2+_0xf9ee('0x29')]>0x0&&this[_0x4704b2+_0xf9ee('0x28')]>=this[_0x4704b2+_0xf9ee('0x29')]){return'maxcapacity';}else{return'working';}}else{return _0xf9ee('0x2a');}};Agent[_0xf9ee('0x2b')][_0xf9ee('0x26')]=function(){var _0x5ec77b=[_0xf9ee('0x2c'),_0xf9ee('0x2d'),_0xf9ee('0x2e'),'fax',_0xf9ee('0x2f'),_0xf9ee('0x30')];for(var _0x1da284=0x0;_0x1da284<_0x5ec77b['length'];_0x1da284+=0x1){var _0x5f29b2=this['getChannelStatus'](_0x5ec77b[_0x1da284]);if(this[_0x5ec77b[_0x1da284]+_0xf9ee('0x31')]!==_0x5f29b2){this[_0x5ec77b[_0x1da284]+_0xf9ee('0x32')]=_[_0xf9ee('0x33')](moment()[_0xf9ee('0x34')]('x'));}this[_0x5ec77b[_0x1da284]+_0xf9ee('0x31')]=_0x5f29b2;}var _0x18aaca={'id':this['id'],'name':this['name'],'online':this[_0xf9ee('0xa')],'voicePause':this[_0xf9ee('0xb')],'chatPause':this['chatPause'],'mailPause':this[_0xf9ee('0xd')],'smsPause':this[_0xf9ee('0x35')],'faxPause':this[_0xf9ee('0xe')],'openchannelPause':this[_0xf9ee('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xf9ee('0x13')],'chatCurrentCapacity':this[_0xf9ee('0x14')],'mailStatus':this[_0xf9ee('0x36')],'mailStatusTime':this[_0xf9ee('0x37')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xf9ee('0x16')],'faxStatus':this[_0xf9ee('0x38')],'faxStatusTime':this[_0xf9ee('0x17')],'faxCapacity':this[_0xf9ee('0x18')],'faxCurrentCapacity':this[_0xf9ee('0x19')],'smsStatus':this[_0xf9ee('0x1a')],'smsStatusTime':this[_0xf9ee('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xf9ee('0x1d')],'whatsappStatus':this[_0xf9ee('0x39')],'whatsappStatusTime':this[_0xf9ee('0x1e')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xf9ee('0x1f')],'openchannelStatus':this[_0xf9ee('0x20')],'openchannelStatusTime':this[_0xf9ee('0x21')],'openchannelCapacity':this[_0xf9ee('0x22')],'openchannelCurrentCapacity':this[_0xf9ee('0x23')],'busy':this[_0xf9ee('0x24')],'busyQueue':this['busyQueue']};var _0xbe059f=md5(JSON[_0xf9ee('0x3a')](_0x18aaca));if(this[_0xf9ee('0x2')]!==_0xbe059f){this['md5']=_0xbe059f;io['emit']('user:save',_0x18aaca);}};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 60b3762..fb58745 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 _0xb064=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','available','stringify','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name'];(function(_0x5bd33b,_0x435c35){var _0x5866f7=function(_0x118319){while(--_0x118319){_0x5bd33b['push'](_0x5bd33b['shift']());}};_0x5866f7(++_0x435c35);}(_0xb064,0x153));var _0x4b06=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb064[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x4b06('0x0'));var md5=require(_0x4b06('0x1'));var util=require(_0x4b06('0x2'));var Redis=require(_0x4b06('0x3'));var config=require(_0x4b06('0x4'));config[_0x4b06('0x5')]=_['defaults'](config[_0x4b06('0x5')],{'host':_0x4b06('0x6'),'port':0x18eb});var io=require(_0x4b06('0x7'))(new Redis(config[_0x4b06('0x5')]));function ChatQueue(_0x16e900){this['id']=_0x16e900['id']||0x0;this[_0x4b06('0x8')]=_0x16e900['name']||'';this['timeout']=_0x16e900[_0x4b06('0x9')]||0xa;this[_0x4b06('0xa')]=_0x16e900[_0x4b06('0xa')]||_0x4b06('0xb');this['Agents']=_0x16e900[_0x4b06('0xc')];this[_0x4b06('0xd')]={};this[_0x4b06('0xe')]=0x0;this[_0x4b06('0x1')]='';this[_0x4b06('0xf')]();this[_0x4b06('0x10')]();}ChatQueue['prototype'][_0x4b06('0xf')]=function(){var _0x545c72=this['mapAgentsId'][_0x4b06('0x11')];this[_0x4b06('0xd')]=_[_0x4b06('0x12')](this['Agents'],'id');this[_0x4b06('0xd')][_0x4b06('0x11')]=_0x545c72;};ChatQueue[_0x4b06('0x13')]['updateRealtime']=function(){this[_0x4b06('0x14')]=0x0;this[_0x4b06('0x15')]=0x0;for(var _0x49b406=0x0;_0x49b406=0x0?this[_0x4b06('0x18')]:0x0;var _0x574bcf={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4b06('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x216da5=md5(JSON[_0x4b06('0x19')](_0x574bcf));if(this['md5']!==_0x216da5){this['md5']=_0x216da5;io['to'](util[_0x4b06('0x1a')]('chat:queue:%s',_0x574bcf[_0x4b06('0x8')]))[_0x4b06('0x1b')]('chat_queue:save',_0x574bcf);}};module[_0x4b06('0x1c')]=ChatQueue; \ No newline at end of file +var _0x8554=['available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','chatPause'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x8554,0x19b));var _0x4855=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8554[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x4855('0x0'));var md5=require(_0x4855('0x1'));var util=require(_0x4855('0x2'));var Redis=require(_0x4855('0x3'));var config=require('../../../config/environment');config[_0x4855('0x4')]=_[_0x4855('0x5')](config[_0x4855('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4855('0x6'))(new Redis(config[_0x4855('0x4')]));function ChatQueue(_0x31109d){this['id']=_0x31109d['id']||0x0;this[_0x4855('0x7')]=_0x31109d['name']||'';this[_0x4855('0x8')]=_0x31109d[_0x4855('0x8')]||0xa;this['strategy']=_0x31109d[_0x4855('0x9')]||_0x4855('0xa');this[_0x4855('0xb')]=_0x31109d[_0x4855('0xb')];this[_0x4855('0xc')]={};this[_0x4855('0xd')]=0x0;this[_0x4855('0x1')]='';this[_0x4855('0xe')]();this[_0x4855('0xf')]();}ChatQueue[_0x4855('0x10')][_0x4855('0xe')]=function(){var _0xb56600=this[_0x4855('0xc')]['_rr'];this[_0x4855('0xc')]=_['map'](this[_0x4855('0xb')],'id');this[_0x4855('0xc')][_0x4855('0x11')]=_0xb56600;};ChatQueue[_0x4855('0x10')][_0x4855('0xf')]=function(){this[_0x4855('0x12')]=0x0;this[_0x4855('0x13')]=0x0;for(var _0x139f1a=0x0;_0x139f1a=0x0?this[_0x4855('0x15')]:0x0;var _0x4b6c16={'id':this['id'],'available':this[_0x4855('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x4855('0x13')],'waiting':this[_0x4855('0xd')]};var _0x360395=md5(JSON[_0x4855('0x16')](_0x4b6c16));if(this['md5']!==_0x360395){this[_0x4855('0x1')]=_0x360395;io['to'](util[_0x4855('0x17')](_0x4855('0x18'),_0x4b6c16[_0x4855('0x7')]))[_0x4855('0x19')]('chat_queue:save',_0x4b6c16);}};module[_0x4855('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index bffb1fc..da74ab2 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 _0x37d0=['stringify','md5','format','emit','fax_queue:save','lodash','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','faxPause','available'];(function(_0x360e5c,_0x1d60de){var _0x3629ea=function(_0x3f12b6){while(--_0x3f12b6){_0x360e5c['push'](_0x360e5c['shift']());}};_0x3629ea(++_0x1d60de);}(_0x37d0,0x161));var _0x037d=function(_0x50e2f0,_0x484ed1){_0x50e2f0=_0x50e2f0-0x0;var _0x20b304=_0x37d0[_0x50e2f0];return _0x20b304;};'use strict';var _=require(_0x037d('0x0'));var md5=require('md5');var util=require(_0x037d('0x1'));var Redis=require(_0x037d('0x2'));var config=require('../../../config/environment');config[_0x037d('0x3')]=_[_0x037d('0x4')](config[_0x037d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x037d('0x5'))(new Redis(config[_0x037d('0x3')]));function FaxQueue(_0x579e91){this['id']=_0x579e91['id']||0x0;this[_0x037d('0x6')]=_0x579e91[_0x037d('0x6')]||'';this[_0x037d('0x7')]=_0x579e91[_0x037d('0x7')]||0xa;this[_0x037d('0x8')]=_0x579e91[_0x037d('0x8')]||_0x037d('0x9');this['Agents']=_0x579e91[_0x037d('0xa')];this[_0x037d('0xb')]={};this[_0x037d('0xc')]=0x0;this['md5']='';this[_0x037d('0xd')]();this[_0x037d('0xe')]();}FaxQueue[_0x037d('0xf')][_0x037d('0xd')]=function(){var _0x41e8e5=this[_0x037d('0xb')][_0x037d('0x10')];this[_0x037d('0xb')]=_[_0x037d('0x11')](this['Agents'],'id');this[_0x037d('0xb')][_0x037d('0x10')]=_0x41e8e5;};FaxQueue[_0x037d('0xf')][_0x037d('0xe')]=function(){this[_0x037d('0x12')]=0x0;this[_0x037d('0x13')]=0x0;for(var _0x39e03b=0x0;_0x39e03b=0x0?this[_0x037d('0x17')]:0x0;var _0x1a515c={'id':this['id'],'available':this[_0x037d('0x17')],'loggedIn':this[_0x037d('0x12')],'name':this[_0x037d('0x6')],'paused':this[_0x037d('0x13')],'waiting':this[_0x037d('0xc')]};var _0xe8fd1a=md5(JSON[_0x037d('0x18')](_0x1a515c));if(this['md5']!==_0xe8fd1a){this[_0x037d('0x19')]=_0xe8fd1a;io['to'](util[_0x037d('0x1a')]('fax:queue:%s',_0x1a515c[_0x037d('0x6')]))[_0x037d('0x1b')](_0x037d('0x1c'),_0x1a515c);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x96dd=['emit','lodash','md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','length','online','faxPause','available','paused','format','fax:queue:%s'];(function(_0x400354,_0x50cfcd){var _0x53c553=function(_0x57365a){while(--_0x57365a){_0x400354['push'](_0x400354['shift']());}};_0x53c553(++_0x50cfcd);}(_0x96dd,0x140));var _0xd96d=function(_0x2fcd85,_0x5b2fa2){_0x2fcd85=_0x2fcd85-0x0;var _0xf756d0=_0x96dd[_0x2fcd85];return _0xf756d0;};'use strict';var _=require(_0xd96d('0x0'));var md5=require(_0xd96d('0x1'));var util=require(_0xd96d('0x2'));var Redis=require('ioredis');var config=require(_0xd96d('0x3'));config['redis']=_[_0xd96d('0x4')](config[_0xd96d('0x5')],{'host':_0xd96d('0x6'),'port':0x18eb});var io=require(_0xd96d('0x7'))(new Redis(config['redis']));function FaxQueue(_0x42cdc4){this['id']=_0x42cdc4['id']||0x0;this[_0xd96d('0x8')]=_0x42cdc4[_0xd96d('0x8')]||'';this['timeout']=_0x42cdc4[_0xd96d('0x9')]||0xa;this[_0xd96d('0xa')]=_0x42cdc4[_0xd96d('0xa')]||_0xd96d('0xb');this[_0xd96d('0xc')]=_0x42cdc4[_0xd96d('0xc')];this[_0xd96d('0xd')]={};this[_0xd96d('0xe')]=0x0;this[_0xd96d('0x1')]='';this['updateRouting']();this[_0xd96d('0xf')]();}FaxQueue['prototype'][_0xd96d('0x10')]=function(){var _0x22cd91=this[_0xd96d('0xd')][_0xd96d('0x11')];this['mapAgentsId']=_[_0xd96d('0x12')](this[_0xd96d('0xc')],'id');this[_0xd96d('0xd')][_0xd96d('0x11')]=_0x22cd91;};FaxQueue[_0xd96d('0x13')]['updateRealtime']=function(){this[_0xd96d('0x14')]=0x0;this['paused']=0x0;for(var _0x7ed33b=0x0;_0x7ed33b=0x0?this[_0xd96d('0x18')]:0x0;var _0x15c0b5={'id':this['id'],'available':this[_0xd96d('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xd96d('0x8')],'paused':this[_0xd96d('0x19')],'waiting':this['waiting']};var _0x414b1c=md5(JSON['stringify'](_0x15c0b5));if(this[_0xd96d('0x1')]!==_0x414b1c){this[_0xd96d('0x1')]=_0x414b1c;io['to'](util[_0xd96d('0x1a')](_0xd96d('0x1b'),_0x15c0b5['name']))[_0xd96d('0x1c')]('fax_queue:save',_0x15c0b5);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1db1323..a48e034 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 _0x19bb=['name','Intervals','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x19bb,0xd8));var _0xb19b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x19bb[_0x57b54c];return _0x59cc19;};'use strict';function Interval(_0x52ed1f){this['id']=_0x52ed1f['id']||0x0;this[_0xb19b('0x0')]=_0x52ed1f[_0xb19b('0x0')]||'';this[_0xb19b('0x1')]=_0x52ed1f[_0xb19b('0x1')]||{};}module[_0xb19b('0x2')]=Interval; \ No newline at end of file +var _0x5a44=['Intervals','exports','name'];(function(_0x4e3764,_0x44595e){var _0x2294c0=function(_0x1d3a29){while(--_0x1d3a29){_0x4e3764['push'](_0x4e3764['shift']());}};_0x2294c0(++_0x44595e);}(_0x5a44,0x182));var _0x45a4=function(_0x5d361e,_0xb97794){_0x5d361e=_0x5d361e-0x0;var _0x4f2a26=_0x5a44[_0x5d361e];return _0x4f2a26;};'use strict';function Interval(_0xa2f7ca){this['id']=_0xa2f7ca['id']||0x0;this[_0x45a4('0x0')]=_0xa2f7ca[_0x45a4('0x0')]||'';this['Intervals']=_0xa2f7ca[_0x45a4('0x1')]||{};}module[_0x45a4('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 5993493..c4cd6e8 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 _0xbd95=['beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd95,0x1b7));var _0x5bd9=function(_0x397fa1,_0x458249){_0x397fa1=_0x397fa1-0x0;var _0xb042f2=_0xbd95[_0x397fa1];return _0xb042f2;};'use strict';var _=require(_0x5bd9('0x0'));var md5=require(_0x5bd9('0x1'));var util=require('util');var Redis=require(_0x5bd9('0x2'));var config=require(_0x5bd9('0x3'));config[_0x5bd9('0x4')]=_[_0x5bd9('0x5')](config['redis'],{'host':_0x5bd9('0x6'),'port':0x18eb});var io=require(_0x5bd9('0x7'))(new Redis(config[_0x5bd9('0x4')]));function MailQueue(_0x304a85){this['id']=_0x304a85['id']||0x0;this[_0x5bd9('0x8')]=_0x304a85['name']||'';this[_0x5bd9('0x9')]=_0x304a85[_0x5bd9('0x9')]||0xa;this[_0x5bd9('0xa')]=_0x304a85[_0x5bd9('0xa')]||_0x5bd9('0xb');this[_0x5bd9('0xc')]=_0x304a85[_0x5bd9('0xc')];this[_0x5bd9('0xd')]={};this[_0x5bd9('0xe')]=0x0;this['md5']='';this[_0x5bd9('0xf')]();this['updateRealtime']();}MailQueue[_0x5bd9('0x10')][_0x5bd9('0xf')]=function(){var _0x499934=this[_0x5bd9('0xd')]['_rr'];this[_0x5bd9('0xd')]=_['map'](this[_0x5bd9('0xc')],'id');this[_0x5bd9('0xd')][_0x5bd9('0x11')]=_0x499934;};MailQueue[_0x5bd9('0x10')][_0x5bd9('0x12')]=function(){this[_0x5bd9('0x13')]=0x0;this[_0x5bd9('0x14')]=0x0;for(var _0x27f725=0x0;_0x27f725=0x0?this[_0x5bd9('0x18')]:0x0;var _0x5a362e={'id':this['id'],'available':this[_0x5bd9('0x18')],'loggedIn':this[_0x5bd9('0x13')],'name':this[_0x5bd9('0x8')],'paused':this[_0x5bd9('0x14')],'waiting':this['waiting']};var _0x67f26f=md5(JSON[_0x5bd9('0x19')](_0x5a362e));if(this['md5']!==_0x67f26f){this[_0x5bd9('0x1')]=_0x67f26f;io['to'](util[_0x5bd9('0x1a')](_0x5bd9('0x1b'),_0x5a362e[_0x5bd9('0x8')]))[_0x5bd9('0x1c')]('mail_queue:save',_0x5a362e);}};module[_0x5bd9('0x1d')]=MailQueue; \ No newline at end of file +var _0xc797=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xc797,0x86));var _0x7c79=function(_0x50743a,_0x5ca591){_0x50743a=_0x50743a-0x0;var _0x319a78=_0xc797[_0x50743a];return _0x319a78;};'use strict';var _=require(_0x7c79('0x0'));var md5=require(_0x7c79('0x1'));var util=require(_0x7c79('0x2'));var Redis=require(_0x7c79('0x3'));var config=require(_0x7c79('0x4'));config[_0x7c79('0x5')]=_['defaults'](config[_0x7c79('0x5')],{'host':_0x7c79('0x6'),'port':0x18eb});var io=require(_0x7c79('0x7'))(new Redis(config[_0x7c79('0x5')]));function MailQueue(_0xebbb56){this['id']=_0xebbb56['id']||0x0;this[_0x7c79('0x8')]=_0xebbb56['name']||'';this['timeout']=_0xebbb56[_0x7c79('0x9')]||0xa;this[_0x7c79('0xa')]=_0xebbb56['strategy']||'beepall';this['Agents']=_0xebbb56[_0x7c79('0xb')];this[_0x7c79('0xc')]={};this[_0x7c79('0xd')]=0x0;this['md5']='';this[_0x7c79('0xe')]();this[_0x7c79('0xf')]();}MailQueue[_0x7c79('0x10')][_0x7c79('0xe')]=function(){var _0x2d0437=this['mapAgentsId']['_rr'];this[_0x7c79('0xc')]=_['map'](this[_0x7c79('0xb')],'id');this[_0x7c79('0xc')][_0x7c79('0x11')]=_0x2d0437;};MailQueue['prototype'][_0x7c79('0xf')]=function(){this[_0x7c79('0x12')]=0x0;this[_0x7c79('0x13')]=0x0;for(var _0x332957=0x0;_0x332957=0x0?this[_0x7c79('0x17')]:0x0;var _0x3d2a05={'id':this['id'],'available':this[_0x7c79('0x17')],'loggedIn':this[_0x7c79('0x12')],'name':this[_0x7c79('0x8')],'paused':this['paused'],'waiting':this[_0x7c79('0xd')]};var _0x21e154=md5(JSON[_0x7c79('0x18')](_0x3d2a05));if(this[_0x7c79('0x1')]!==_0x21e154){this['md5']=_0x21e154;io['to'](util[_0x7c79('0x19')](_0x7c79('0x1a'),_0x3d2a05['name']))['emit']('mail_queue:save',_0x3d2a05);}};module[_0x7c79('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 c150aa0..26fc94e 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 _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(_0x2f7125,_0x2b0ae0){var _0xe81a8=function(_0x261823){while(--_0x261823){_0x2f7125['push'](_0x2f7125['shift']());}};_0xe81a8(++_0x2b0ae0);}(_0x814b,0x1a2));var _0xb814=function(_0x24ae03,_0x334660){_0x24ae03=_0x24ae03-0x0;var _0x38a29e=_0x814b[_0x24ae03];return _0x38a29e;};'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 +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x5fc3,0xa8));var _0x35fc=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x5fc3[_0x162780];return _0x1ea2dc;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c4edc68..1c641a4 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 _0x2504=['strategy','beepall','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','map','prototype','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0xb9cc14,_0x449bd9){var _0x4c2155=function(_0x31e7ab){while(--_0x31e7ab){_0xb9cc14['push'](_0xb9cc14['shift']());}};_0x4c2155(++_0x449bd9);}(_0x2504,0xee));var _0x4250=function(_0x17d7ce,_0x1fc8e6){_0x17d7ce=_0x17d7ce-0x0;var _0x11f18e=_0x2504[_0x17d7ce];return _0x11f18e;};'use strict';var _=require(_0x4250('0x0'));var md5=require(_0x4250('0x1'));var util=require(_0x4250('0x2'));var Redis=require(_0x4250('0x3'));var config=require(_0x4250('0x4'));config[_0x4250('0x5')]=_[_0x4250('0x6')](config[_0x4250('0x5')],{'host':_0x4250('0x7'),'port':0x18eb});var io=require(_0x4250('0x8'))(new Redis(config[_0x4250('0x5')]));function SmsQueue(_0x33d70b){this['id']=_0x33d70b['id']||0x0;this['name']=_0x33d70b[_0x4250('0x9')]||'';this['timeout']=_0x33d70b['timeout']||0xa;this[_0x4250('0xa')]=_0x33d70b[_0x4250('0xa')]||_0x4250('0xb');this[_0x4250('0xc')]=_0x33d70b[_0x4250('0xc')];this['mapAgentsId']={};this[_0x4250('0xd')]=0x0;this['md5']='';this[_0x4250('0xe')]();this[_0x4250('0xf')]();}SmsQueue['prototype'][_0x4250('0xe')]=function(){var _0x583057=this['mapAgentsId'][_0x4250('0x10')];this[_0x4250('0x11')]=_[_0x4250('0x12')](this[_0x4250('0xc')],'id');this[_0x4250('0x11')]['_rr']=_0x583057;};SmsQueue[_0x4250('0x13')][_0x4250('0xf')]=function(){this[_0x4250('0x14')]=0x0;this[_0x4250('0x15')]=0x0;for(var _0xfa4d8a=0x0;_0xfa4d8a=0x0?this[_0x4250('0x18')]:0x0;var _0x369010={'id':this['id'],'available':this[_0x4250('0x18')],'loggedIn':this[_0x4250('0x14')],'name':this['name'],'paused':this[_0x4250('0x15')],'waiting':this['waiting']};var _0x5aa26e=md5(JSON[_0x4250('0x19')](_0x369010));if(this[_0x4250('0x1')]!==_0x5aa26e){this[_0x4250('0x1')]=_0x5aa26e;io['to'](util[_0x4250('0x1a')](_0x4250('0x1b'),_0x369010[_0x4250('0x9')]))[_0x4250('0x1c')](_0x4250('0x1d'),_0x369010);}};module[_0x4250('0x1e')]=SmsQueue; \ No newline at end of file +var _0xbf5c=['sms_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','available','waiting','stringify','format'];(function(_0x2f930d,_0x162de8){var _0x5d4e07=function(_0xbf2300){while(--_0xbf2300){_0x2f930d['push'](_0x2f930d['shift']());}};_0x5d4e07(++_0x162de8);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x5ba1fd,_0x5f100c){_0x5ba1fd=_0x5ba1fd-0x0;var _0x1c7251=_0xbf5c[_0x5ba1fd];return _0x1c7251;};'use strict';var _=require(_0xcbf5('0x0'));var md5=require(_0xcbf5('0x1'));var util=require(_0xcbf5('0x2'));var Redis=require('ioredis');var config=require(_0xcbf5('0x3'));config[_0xcbf5('0x4')]=_[_0xcbf5('0x5')](config['redis'],{'host':_0xcbf5('0x6'),'port':0x18eb});var io=require(_0xcbf5('0x7'))(new Redis(config['redis']));function SmsQueue(_0x3457d0){this['id']=_0x3457d0['id']||0x0;this[_0xcbf5('0x8')]=_0x3457d0[_0xcbf5('0x8')]||'';this['timeout']=_0x3457d0[_0xcbf5('0x9')]||0xa;this[_0xcbf5('0xa')]=_0x3457d0['strategy']||'beepall';this[_0xcbf5('0xb')]=_0x3457d0[_0xcbf5('0xb')];this[_0xcbf5('0xc')]={};this['waiting']=0x0;this[_0xcbf5('0x1')]='';this[_0xcbf5('0xd')]();this[_0xcbf5('0xe')]();}SmsQueue[_0xcbf5('0xf')][_0xcbf5('0xd')]=function(){var _0x248575=this['mapAgentsId'][_0xcbf5('0x10')];this[_0xcbf5('0xc')]=_[_0xcbf5('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xcbf5('0x10')]=_0x248575;};SmsQueue['prototype'][_0xcbf5('0xe')]=function(){this[_0xcbf5('0x12')]=0x0;this[_0xcbf5('0x13')]=0x0;for(var _0x2e7536=0x0;_0x2e7536=0x0?this[_0xcbf5('0x14')]:0x0;var _0x53939d={'id':this['id'],'available':this[_0xcbf5('0x14')],'loggedIn':this[_0xcbf5('0x12')],'name':this[_0xcbf5('0x8')],'paused':this[_0xcbf5('0x13')],'waiting':this[_0xcbf5('0x15')]};var _0x3b3022=md5(JSON[_0xcbf5('0x16')](_0x53939d));if(this[_0xcbf5('0x1')]!==_0x3b3022){this['md5']=_0x3b3022;io['to'](util[_0xcbf5('0x17')]('sms:queue:%s',_0x53939d[_0xcbf5('0x8')]))['emit'](_0xcbf5('0x18'),_0x53939d);}};module[_0xcbf5('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index f564ace..202aa73 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 _0x0fd4=['strategy','beepall','Agents','mapAgentsId','waiting','prototype','map','_rr','updateRealtime','paused','online','loggedIn','available','stringify','format','emit','whatsapp_queue:save','exports','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x30225a,_0x233ad6){var _0x3551ef=function(_0x1a32d5){while(--_0x1a32d5){_0x30225a['push'](_0x30225a['shift']());}};_0x3551ef(++_0x233ad6);}(_0x0fd4,0x13b));var _0x40fd=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x0fd4[_0x272638];return _0x19d027;};'use strict';var _=require('lodash');var md5=require(_0x40fd('0x0'));var util=require(_0x40fd('0x1'));var Redis=require('ioredis');var config=require(_0x40fd('0x2'));config[_0x40fd('0x3')]=_[_0x40fd('0x4')](config[_0x40fd('0x3')],{'host':_0x40fd('0x5'),'port':0x18eb});var io=require(_0x40fd('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x66f25a){this['id']=_0x66f25a['id']||0x0;this[_0x40fd('0x7')]=_0x66f25a['name']||'';this['timeout']=_0x66f25a[_0x40fd('0x8')]||0xa;this[_0x40fd('0x9')]=_0x66f25a['strategy']||_0x40fd('0xa');this[_0x40fd('0xb')]=_0x66f25a['Agents'];this[_0x40fd('0xc')]={};this[_0x40fd('0xd')]=0x0;this[_0x40fd('0x0')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x40fd('0xe')]['updateRouting']=function(){var _0x5a3dd1=this[_0x40fd('0xc')]['_rr'];this[_0x40fd('0xc')]=_[_0x40fd('0xf')](this[_0x40fd('0xb')],'id');this[_0x40fd('0xc')][_0x40fd('0x10')]=_0x5a3dd1;};WhatsappQueue[_0x40fd('0xe')][_0x40fd('0x11')]=function(){this['loggedIn']=0x0;this[_0x40fd('0x12')]=0x0;for(var _0x234843=0x0;_0x234843=0x0?this[_0x40fd('0x15')]:0x0;var _0x34d425={'id':this['id'],'available':this[_0x40fd('0x15')],'loggedIn':this[_0x40fd('0x14')],'name':this[_0x40fd('0x7')],'paused':this['paused'],'waiting':this[_0x40fd('0xd')]};var _0x4aa19b=md5(JSON[_0x40fd('0x16')](_0x34d425));if(this[_0x40fd('0x0')]!==_0x4aa19b){this[_0x40fd('0x0')]=_0x4aa19b;io['to'](util[_0x40fd('0x17')]('whatsapp:queue:%s',_0x34d425[_0x40fd('0x7')]))[_0x40fd('0x18')](_0x40fd('0x19'),_0x34d425);}};module[_0x40fd('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x8e9f=['paused','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8e9f,0x183));var _0xf8e9=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x8e9f[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0xf8e9('0x0'));var md5=require(_0xf8e9('0x1'));var util=require(_0xf8e9('0x2'));var Redis=require(_0xf8e9('0x3'));var config=require(_0xf8e9('0x4'));config[_0xf8e9('0x5')]=_['defaults'](config[_0xf8e9('0x5')],{'host':_0xf8e9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf8e9('0x5')]));function WhatsappQueue(_0x20296a){this['id']=_0x20296a['id']||0x0;this[_0xf8e9('0x7')]=_0x20296a[_0xf8e9('0x7')]||'';this[_0xf8e9('0x8')]=_0x20296a[_0xf8e9('0x8')]||0xa;this[_0xf8e9('0x9')]=_0x20296a[_0xf8e9('0x9')]||_0xf8e9('0xa');this[_0xf8e9('0xb')]=_0x20296a[_0xf8e9('0xb')];this[_0xf8e9('0xc')]={};this[_0xf8e9('0xd')]=0x0;this['md5']='';this[_0xf8e9('0xe')]();this['updateRealtime']();}WhatsappQueue[_0xf8e9('0xf')]['updateRouting']=function(){var _0xd5657c=this['mapAgentsId'][_0xf8e9('0x10')];this[_0xf8e9('0xc')]=_[_0xf8e9('0x11')](this[_0xf8e9('0xb')],'id');this['mapAgentsId'][_0xf8e9('0x10')]=_0xd5657c;};WhatsappQueue[_0xf8e9('0xf')][_0xf8e9('0x12')]=function(){this['loggedIn']=0x0;this[_0xf8e9('0x13')]=0x0;for(var _0x30f714=0x0;_0x30f714=0x0?this[_0xf8e9('0x17')]:0x0;var _0x39c786={'id':this['id'],'available':this[_0xf8e9('0x17')],'loggedIn':this[_0xf8e9('0x15')],'name':this[_0xf8e9('0x7')],'paused':this[_0xf8e9('0x13')],'waiting':this[_0xf8e9('0xd')]};var _0x552030=md5(JSON[_0xf8e9('0x18')](_0x39c786));if(this['md5']!==_0x552030){this[_0xf8e9('0x1')]=_0x552030;io['to'](util[_0xf8e9('0x19')](_0xf8e9('0x1a'),_0x39c786['name']))[_0xf8e9('0x1b')]('whatsapp_queue:save',_0x39c786);}};module[_0xf8e9('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 320480c..2f4d747 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x5bedc5,_0x2fd183){var _0x164fb4=function(_0x1bf5f3){while(--_0x1bf5f3){_0x5bedc5['push'](_0x5bedc5['shift']());}};_0x164fb4(++_0x2fd183);}(_0xb10b,0x12a));var _0xbb10=function(_0x52be73,_0x1b4cbd){_0x52be73=_0x52be73-0x0;var _0x26f66a=_0xb10b[_0x52be73];return _0x26f66a;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index c1fc407..25d60a9 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 _0xe3ee=['addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction'];(function(_0x5ac6c2,_0x3f7478){var _0x59e89a=function(_0x7d8870){while(--_0x7d8870){_0x5ac6c2['push'](_0x5ac6c2['shift']());}};_0x59e89a(++_0x3f7478);}(_0xe3ee,0x15d));var _0xee3e=function(_0x2a8db7,_0x33d043){_0x2a8db7=_0x2a8db7-0x0;var _0x3049d8=_0xe3ee[_0x2a8db7];return _0x3049d8;};'use strict';var client=require('../client');exports[_0xee3e('0x0')]=function(_0x4bdba0,_0x3a0d36){return client[_0xee3e('0x1')](_0xee3e('0x2'),{'body':_0x3a0d36,'options':{'where':{'id':_0x4bdba0}},'log':_0xee3e('0x3')});};exports['addTags']=function(_0x4b06b2,_0x52f15f){return client[_0xee3e('0x1')](_0xee3e('0x4'),{'body':_0x52f15f,'options':{'where':{'id':_0x4b06b2}},'log':_0xee3e('0x5')});}; \ No newline at end of file +var _0x7f0b=['addTagsToChatInteraction','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x2f4697,_0x4bda75){var _0x2c60b7=function(_0x52c434){while(--_0x52c434){_0x2f4697['push'](_0x2f4697['shift']());}};_0x2c60b7(++_0x4bda75);}(_0x7f0b,0x101));var _0xb7f0=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x7f0b[_0x580576];return _0x3f55a0;};'use strict';var client=require('../client');exports['update']=function(_0x5763f4,_0x18be6c){return client['Request'](_0xb7f0('0x0'),{'body':_0x18be6c,'options':{'where':{'id':_0x5763f4}},'log':_0xb7f0('0x1')});};exports[_0xb7f0('0x2')]=function(_0x5d4586,_0x57e04b){return client['Request']('AddTagsToChatInteraction',{'body':_0x57e04b,'options':{'where':{'id':_0x5d4586}},'log':_0xb7f0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 87294db..b7ac58d 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 _0x6d98=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x345de7,_0x1de531){var _0x26ffc7=function(_0x5b8539){while(--_0x5b8539){_0x345de7['push'](_0x345de7['shift']());}};_0x26ffc7(++_0x1de531);}(_0x6d98,0x147));var _0x86d9=function(_0x1b832e,_0x501fdd){_0x1b832e=_0x1b832e-0x0;var _0x34734f=_0x6d98[_0x1b832e];return _0x34734f;};'use strict';var client=require('../client');exports[_0x86d9('0x0')]=function(_0xb52bca){return client[_0x86d9('0x1')](_0x86d9('0x2'),{'body':_0xb52bca,'log':_0x86d9('0x3')});}; \ No newline at end of file +var _0x33d2=['Request','CreateChatMessage','create'];(function(_0x907201,_0x20ec4c){var _0xb5e883=function(_0xfe00d1){while(--_0xfe00d1){_0x907201['push'](_0x907201['shift']());}};_0xb5e883(++_0x20ec4c);}(_0x33d2,0xda));var _0x233d=function(_0x3a87d1,_0x584e71){_0x3a87d1=_0x3a87d1-0x0;var _0x3aa6d8=_0x33d2[_0x3a87d1];return _0x3aa6d8;};'use strict';var client=require('../client');exports[_0x233d('0x0')]=function(_0x557f3a){return client[_0x233d('0x1')](_0x233d('0x2'),{'body':_0x557f3a,'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 3554f4f..24c418c 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 _0x7163=['name','timeout','User','Agents','online','../client','GetChatQueue'];(function(_0x2a0bf0,_0x247ffd){var _0x104fd6=function(_0x555e9b){while(--_0x555e9b){_0x2a0bf0['push'](_0x2a0bf0['shift']());}};_0x104fd6(++_0x247ffd);}(_0x7163,0x1ef));var _0x3716=function(_0x57db49,_0x288094){_0x57db49=_0x57db49-0x0;var _0xd0636f=_0x7163[_0x57db49];return _0xd0636f;};'use strict';var client=require(_0x3716('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x3716('0x1'),{'options':{'raw':![],'attributes':['id',_0x3716('0x2'),_0x3716('0x3'),'strategy'],'include':[{'model':_0x3716('0x4'),'as':_0x3716('0x5'),'attributes':['id',_0x3716('0x2'),_0x3716('0x6'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x308a=['timeout','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name'];(function(_0x1290c6,_0xe9bcb1){var _0xe14903=function(_0x5f4823){while(--_0x5f4823){_0x1290c6['push'](_0x1290c6['shift']());}};_0xe14903(++_0xe9bcb1);}(_0x308a,0x71));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa308('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xa308('0x1')](_0xa308('0x2'),{'options':{'raw':![],'attributes':['id',_0xa308('0x3'),_0xa308('0x4'),'strategy'],'include':[{'model':'User','as':_0xa308('0x5'),'attributes':['id',_0xa308('0x3'),_0xa308('0x6'),_0xa308('0x7')]}]},'log':_0xa308('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index fafed21..aef7a28 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 _0x81a4=['DESC','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x81a4,0x1a6));var _0x481a=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x81a4[_0xaaf2e2];return _0x28bc36;};'use strict';var client=require(_0x481a('0x0'));exports[_0x481a('0x1')]=function(_0x3ca1d0){return client[_0x481a('0x2')]('CreateChatQueueReport',{'body':_0x3ca1d0,'log':_0x481a('0x3')});};exports['update']=function(_0x174f8c,_0x27a5dd){return client[_0x481a('0x2')]('UpdateChatQueueReport',{'body':_0x27a5dd,'options':{'where':{'uniqueid':_0x174f8c},'order':[['id',_0x481a('0x4')]],'limit':0x1},'log':_0x481a('0x5')});}; \ No newline at end of file +var _0x05b0=['DESC','UpdateChatQueueReport','Request','CreateChatQueueReport','update'];(function(_0x1ed23a,_0x5cf526){var _0x433878=function(_0x37f6bb){while(--_0x37f6bb){_0x1ed23a['push'](_0x1ed23a['shift']());}};_0x433878(++_0x5cf526);}(_0x05b0,0x188));var _0x005b=function(_0x4b65f7,_0x27f89b){_0x4b65f7=_0x4b65f7-0x0;var _0x11386d=_0x05b0[_0x4b65f7];return _0x11386d;};'use strict';var client=require('../client');exports['create']=function(_0xa096af){return client[_0x005b('0x0')]('CreateChatQueueReport',{'body':_0xa096af,'log':_0x005b('0x1')});};exports[_0x005b('0x2')]=function(_0x4a76d7,_0x342d08){return client[_0x005b('0x0')]('UpdateChatQueueReport',{'body':_0x342d08,'options':{'where':{'uniqueid':_0x4a76d7},'order':[['id',_0x005b('0x3')]],'limit':0x1},'log':_0x005b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 0ae5d7c..73518aa 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1e9d62,_0x25bb8e){var _0x56c490=function(_0x19f4e7){while(--_0x19f4e7){_0x1e9d62['push'](_0x1e9d62['shift']());}};_0x56c490(++_0x25bb8e);}(_0x7a54,0x106));var _0x47a5=function(_0x573b0e,_0x1a0801){_0x573b0e=_0x573b0e-0x0;var _0x48edcd=_0x7a54[_0x573b0e];return _0x48edcd;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7a54,0x106));var _0x47a5=function(_0x29f276,_0x1d84a2){_0x29f276=_0x29f276-0x0;var _0x5e696b=_0x7a54[_0x29f276];return _0x5e696b;};'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 6e12f58..3c128d9 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 _0xbce6=['Request','CreateFaxMessage','create'];(function(_0x4d4782,_0x1ae19c){var _0x475664=function(_0xd82ffc){while(--_0xd82ffc){_0x4d4782['push'](_0x4d4782['shift']());}};_0x475664(++_0x1ae19c);}(_0xbce6,0xc8));var _0x6bce=function(_0x3510fb,_0x8be0af){_0x3510fb=_0x3510fb-0x0;var _0x3d7218=_0xbce6[_0x3510fb];return _0x3d7218;};'use strict';var client=require('../client');exports[_0x6bce('0x0')]=function(_0x102529){return client[_0x6bce('0x1')](_0x6bce('0x2'),{'body':_0x102529,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xca70=['Request','CreateFaxMessage','../client','create'];(function(_0x4ac743,_0x3fa20d){var _0x3e60a3=function(_0x197da0){while(--_0x197da0){_0x4ac743['push'](_0x4ac743['shift']());}};_0x3e60a3(++_0x3fa20d);}(_0xca70,0x1c6));var _0x0ca7=function(_0x2f0b6e,_0x2fe0f4){_0x2f0b6e=_0x2f0b6e-0x0;var _0x3188fb=_0xca70[_0x2f0b6e];return _0x3188fb;};'use strict';var client=require(_0x0ca7('0x0'));exports[_0x0ca7('0x1')]=function(_0x4de9d4){return client[_0x0ca7('0x2')](_0x0ca7('0x3'),{'body':_0x4de9d4,'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 7f6c839..5efeafa 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 _0x27a2=['name','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x5b9e69,_0x42a491){var _0x49723b=function(_0x36cfbc){while(--_0x36cfbc){_0x5b9e69['push'](_0x5b9e69['shift']());}};_0x49723b(++_0x42a491);}(_0x27a2,0x11c));var _0x227a=function(_0x215af8,_0x52e198){_0x215af8=_0x215af8-0x0;var _0x193a01=_0x27a2[_0x215af8];return _0x193a01;};'use strict';var client=require(_0x227a('0x0'));exports[_0x227a('0x1')]=function(){return function(){return client[_0x227a('0x2')](_0x227a('0x3'),{'options':{'raw':![],'attributes':['id',_0x227a('0x4'),'timeout','strategy'],'include':[{'model':_0x227a('0x5'),'as':_0x227a('0x6'),'attributes':['id','name',_0x227a('0x7'),_0x227a('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x4887=['getFaxQueues','Request','GetFaxQueue','name','Agents','online','faxPause','../client'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x4887,0x6f));var _0x7488=function(_0x4619eb,_0x4bf82d){_0x4619eb=_0x4619eb-0x0;var _0x3ab99e=_0x4887[_0x4619eb];return _0x3ab99e;};'use strict';var client=require(_0x7488('0x0'));exports[_0x7488('0x1')]=function(){return function(){return client[_0x7488('0x2')](_0x7488('0x3'),{'options':{'raw':![],'attributes':['id',_0x7488('0x4'),'timeout','strategy'],'include':[{'model':'User','as':_0x7488('0x5'),'attributes':['id',_0x7488('0x4'),_0x7488('0x6'),_0x7488('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 84c6101..3b12fc3 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 _0x5acf=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x26f20a,_0x57d085){var _0x16dd11=function(_0x567d20){while(--_0x567d20){_0x26f20a['push'](_0x26f20a['shift']());}};_0x16dd11(++_0x57d085);}(_0x5acf,0x171));var _0xf5ac=function(_0x121eb4,_0x279712){_0x121eb4=_0x121eb4-0x0;var _0x1052ef=_0x5acf[_0x121eb4];return _0x1052ef;};'use strict';var client=require(_0xf5ac('0x0'));exports['create']=function(_0x2c21ac){return client[_0xf5ac('0x1')]('CreateFaxQueueReport',{'body':_0x2c21ac,'log':_0xf5ac('0x2')});};exports[_0xf5ac('0x3')]=function(_0x401e66,_0x551fc5){return client[_0xf5ac('0x1')](_0xf5ac('0x4'),{'body':_0x551fc5,'options':{'where':{'uniqueid':_0x401e66},'order':[['id','DESC']],'limit':0x1},'log':_0xf5ac('0x4')});}; \ No newline at end of file +var _0x5a5d=['UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport'];(function(_0x444361,_0x2056fb){var _0x5f385c=function(_0x1ae35c){while(--_0x1ae35c){_0x444361['push'](_0x444361['shift']());}};_0x5f385c(++_0x2056fb);}(_0x5a5d,0x84));var _0xd5a5=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x5a5d[_0xd09668];return _0x68726;};'use strict';var client=require(_0xd5a5('0x0'));exports[_0xd5a5('0x1')]=function(_0x2724c4){return client['Request'](_0xd5a5('0x2'),{'body':_0x2724c4,'log':_0xd5a5('0x2')});};exports['update']=function(_0x5a4839,_0x22d69a){return client['Request'](_0xd5a5('0x3'),{'body':_0x22d69a,'options':{'where':{'uniqueid':_0x5a4839},'order':[['id',_0xd5a5('0x4')]],'limit':0x1},'log':_0xd5a5('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index bc15ee9..9d8291b 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 _0x0586=['name','Interval','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0x4c95fd,_0x5cb658){var _0x12be2c=function(_0x10971d){while(--_0x10971d){_0x4c95fd['push'](_0x4c95fd['shift']());}};_0x12be2c(++_0x5cb658);}(_0x0586,0x84));var _0x6058=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0586[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6058('0x0'));exports[_0x6058('0x1')]=function(){return function(){return client[_0x6058('0x2')](_0x6058('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x6058('0x4')],'include':[{'model':_0x6058('0x5'),'as':_0x6058('0x6'),'attributes':['id',_0x6058('0x4'),_0x6058('0x7')]}]},'log':_0x6058('0x1')});};}; \ No newline at end of file +var _0x15f9=['Interval','Intervals','interval','getIntervals','../client','Request','name'];(function(_0x196683,_0x5529bd){var _0x2adc5e=function(_0x3f976c){while(--_0x3f976c){_0x196683['push'](_0x196683['shift']());}};_0x2adc5e(++_0x5529bd);}(_0x15f9,0x1b6));var _0x915f=function(_0xf97759,_0x38737c){_0xf97759=_0xf97759-0x0;var _0x3ae12a=_0x15f9[_0xf97759];return _0x3ae12a;};'use strict';var client=require(_0x915f('0x0'));exports['getIntervals']=function(){return function(){return client[_0x915f('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x915f('0x2')],'include':[{'model':_0x915f('0x3'),'as':_0x915f('0x4'),'attributes':['id',_0x915f('0x2'),_0x915f('0x5')]}]},'log':_0x915f('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b201417..6c8ad15 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 _0x66fa=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x245327,_0x2bbe5f){var _0x4d441c=function(_0x281a13){while(--_0x281a13){_0x245327['push'](_0x245327['shift']());}};_0x4d441c(++_0x2bbe5f);}(_0x66fa,0x117));var _0xa66f=function(_0x4f239a,_0x5286f9){_0x4f239a=_0x4f239a-0x0;var _0x3556e5=_0x66fa[_0x4f239a];return _0x3556e5;};'use strict';var client=require(_0xa66f('0x0'));exports[_0xa66f('0x1')]=function(_0x52947a,_0x1fc161){return client[_0xa66f('0x2')](_0xa66f('0x3'),{'body':_0x1fc161,'options':{'where':{'id':_0x52947a}},'log':_0xa66f('0x4')});};exports[_0xa66f('0x5')]=function(_0x2a2abf,_0x3f4904){return client['Request']('AddTagsToMailInteraction',{'body':_0x3f4904,'options':{'where':{'id':_0x2a2abf}},'log':_0xa66f('0x6')});}; \ No newline at end of file +var _0x5c3c=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x971cde,_0x219912){var _0x5d8d26=function(_0x312685){while(--_0x312685){_0x971cde['push'](_0x971cde['shift']());}};_0x5d8d26(++_0x219912);}(_0x5c3c,0x132));var _0xc5c3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5c3c[_0x173441];return _0x2423a8;};'use strict';var client=require(_0xc5c3('0x0'));exports[_0xc5c3('0x1')]=function(_0x11705d,_0x32103c){return client['Request'](_0xc5c3('0x2'),{'body':_0x32103c,'options':{'where':{'id':_0x11705d}},'log':_0xc5c3('0x3')});};exports[_0xc5c3('0x4')]=function(_0x2a3649,_0x2535e0){return client[_0xc5c3('0x5')](_0xc5c3('0x6'),{'body':_0x2535e0,'options':{'where':{'id':_0x2a3649}},'log':_0xc5c3('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 4ed3bbd..3db9214 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 _0x4d2f=['../client','CreateMailMessage','createMailMessage'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x4d2f,0x11a));var _0xf4d2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4d2f[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0xf4d2('0x0'));exports['create']=function(_0x4e13fb){return client['Request'](_0xf4d2('0x1'),{'body':_0x4e13fb,'log':_0xf4d2('0x2')});}; \ No newline at end of file +var _0xd038=['../client','Request','CreateMailMessage','createMailMessage'];(function(_0x2af194,_0xd434e4){var _0x140b4f=function(_0x4bec08){while(--_0x4bec08){_0x2af194['push'](_0x2af194['shift']());}};_0x140b4f(++_0xd434e4);}(_0xd038,0x114));var _0x8d03=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0xd038[_0x4664db];return _0x5615b4;};'use strict';var client=require(_0x8d03('0x0'));exports['create']=function(_0x2db6f0){return client[_0x8d03('0x1')](_0x8d03('0x2'),{'body':_0x2db6f0,'log':_0x8d03('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c6d9a31..646c2af 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 _0xef5a=['name','timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xef5a,0x1e0));var _0xaef5=function(_0x3f6335,_0x3cef9f){_0x3f6335=_0x3f6335-0x0;var _0x58d32d=_0xef5a[_0x3f6335];return _0x58d32d;};'use strict';var client=require(_0xaef5('0x0'));exports[_0xaef5('0x1')]=function(){return function(){return client[_0xaef5('0x2')](_0xaef5('0x3'),{'options':{'raw':![],'attributes':['id',_0xaef5('0x4'),_0xaef5('0x5'),_0xaef5('0x6')],'include':[{'model':_0xaef5('0x7'),'as':_0xaef5('0x8'),'attributes':['id','name',_0xaef5('0x9'),_0xaef5('0xa')]}]},'log':_0xaef5('0x1')});};}; \ No newline at end of file +var _0xdc69=['timeout','strategy','User','name','mailPause','../client','Request','GetMailQueue'];(function(_0x398cca,_0x154eb3){var _0x563d85=function(_0x3566b5){while(--_0x3566b5){_0x398cca['push'](_0x398cca['shift']());}};_0x563d85(++_0x154eb3);}(_0xdc69,0x165));var _0x9dc6=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0xdc69[_0x954b3a];return _0x3a313e;};'use strict';var client=require(_0x9dc6('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x9dc6('0x1')](_0x9dc6('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9dc6('0x3'),_0x9dc6('0x4')],'include':[{'model':_0x9dc6('0x5'),'as':'Agents','attributes':['id',_0x9dc6('0x6'),'online',_0x9dc6('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 29f5540..a51a74a 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 _0x32a2=['update','DESC','create','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x32a2,0xaa));var _0x232a=function(_0x9a4f41,_0x17c0c2){_0x9a4f41=_0x9a4f41-0x0;var _0x1cbc32=_0x32a2[_0x9a4f41];return _0x1cbc32;};'use strict';var client=require('../client');exports[_0x232a('0x0')]=function(_0x19d0cb){return client[_0x232a('0x1')]('CreateMailQueueReport',{'body':_0x19d0cb,'log':'CreateMailQueueReport'});};exports[_0x232a('0x2')]=function(_0x47c723,_0x163d30){return client['Request']('UpdateMailQueueReport',{'body':_0x163d30,'options':{'where':{'uniqueid':_0x47c723},'order':[['id',_0x232a('0x3')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xf730=['CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0x3d7811,_0x59daeb){var _0x927cfa=function(_0x5ce736){while(--_0x5ce736){_0x3d7811['push'](_0x3d7811['shift']());}};_0x927cfa(++_0x59daeb);}(_0xf730,0x6f));var _0x0f73=function(_0x4667bd,_0xec80ab){_0x4667bd=_0x4667bd-0x0;var _0x4ce09b=_0xf730[_0x4667bd];return _0x4ce09b;};'use strict';var client=require(_0x0f73('0x0'));exports['create']=function(_0x34824b){return client['Request'](_0x0f73('0x1'),{'body':_0x34824b,'log':_0x0f73('0x1')});};exports[_0x0f73('0x2')]=function(_0x48ed58,_0x54ab9b){return client['Request'](_0x0f73('0x3'),{'body':_0x54ab9b,'options':{'where':{'uniqueid':_0x48ed58},'order':[['id','DESC']],'limit':0x1},'log':_0x0f73('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index f5eb90c..05dc2b6 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 _0xa916=['addTags','AddTagsToOpenchannelInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x34a257,_0x521057){var _0xb8818c=function(_0x3fac06){while(--_0x3fac06){_0x34a257['push'](_0x34a257['shift']());}};_0xb8818c(++_0x521057);}(_0xa916,0x1ec));var _0x6a91=function(_0x1dd8d4,_0x3b784b){_0x1dd8d4=_0x1dd8d4-0x0;var _0xd023c2=_0xa916[_0x1dd8d4];return _0xd023c2;};'use strict';var client=require(_0x6a91('0x0'));exports[_0x6a91('0x1')]=function(_0x5626d3,_0x9f1d21){return client[_0x6a91('0x2')](_0x6a91('0x3'),{'body':_0x9f1d21,'options':{'where':{'id':_0x5626d3}},'log':_0x6a91('0x4')});};exports[_0x6a91('0x5')]=function(_0x1de6d7,_0x25c3e5){return client['Request'](_0x6a91('0x6'),{'body':_0x25c3e5,'options':{'where':{'id':_0x1de6d7}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x397a=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','Request'];(function(_0x4b56cc,_0x3eae2d){var _0x1e72f4=function(_0x2496c4){while(--_0x2496c4){_0x4b56cc['push'](_0x4b56cc['shift']());}};_0x1e72f4(++_0x3eae2d);}(_0x397a,0x72));var _0xa397=function(_0x461fa5,_0x35b592){_0x461fa5=_0x461fa5-0x0;var _0x487052=_0x397a[_0x461fa5];return _0x487052;};'use strict';var client=require('../client');exports['update']=function(_0x1e6a3d,_0x525cd9){return client[_0xa397('0x0')](_0xa397('0x1'),{'body':_0x525cd9,'options':{'where':{'id':_0x1e6a3d}},'log':_0xa397('0x2')});};exports['addTags']=function(_0x3a2fea,_0x11ae4d){return client[_0xa397('0x0')](_0xa397('0x3'),{'body':_0x11ae4d,'options':{'where':{'id':_0x3a2fea}},'log':_0xa397('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 3e1be36..8ae1672 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 _0x8feb=['createOpenchannelMessage','Request'];(function(_0x4510bb,_0x29124e){var _0x2b012f=function(_0x42be18){while(--_0x42be18){_0x4510bb['push'](_0x4510bb['shift']());}};_0x2b012f(++_0x29124e);}(_0x8feb,0x1b3));var _0xb8fe=function(_0x166035,_0x59e3ae){_0x166035=_0x166035-0x0;var _0x4ed773=_0x8feb[_0x166035];return _0x4ed773;};'use strict';var client=require('../client');exports['create']=function(_0x8fb01e){return client[_0xb8fe('0x0')]('CreateOpenchannelMessage',{'body':_0x8fb01e,'log':_0xb8fe('0x1')});}; \ No newline at end of file +var _0x047e=['Request'];(function(_0xe332,_0x3b0423){var _0x1ba78a=function(_0x27c5a4){while(--_0x27c5a4){_0xe332['push'](_0xe332['shift']());}};_0x1ba78a(++_0x3b0423);}(_0x047e,0x1e0));var _0xe047=function(_0x43dc83,_0x59360b){_0x43dc83=_0x43dc83-0x0;var _0x56c9b7=_0x047e[_0x43dc83];return _0x56c9b7;};'use strict';var client=require('../client');exports['create']=function(_0x4d869a){return client[_0xe047('0x0')]('CreateOpenchannelMessage',{'body':_0x4d869a,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index b61a7e9..95829ec 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 _0x60ff=['getOpenchannelQueues','../client','Request','name','User','Agents','online'];(function(_0x215128,_0x9aab32){var _0x1c1eb1=function(_0x7c8e1){while(--_0x7c8e1){_0x215128['push'](_0x215128['shift']());}};_0x1c1eb1(++_0x9aab32);}(_0x60ff,0x1d6));var _0xf60f=function(_0x38b024,_0x41fc0b){_0x38b024=_0x38b024-0x0;var _0x10e998=_0x60ff[_0x38b024];return _0x10e998;};'use strict';var client=require(_0xf60f('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xf60f('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xf60f('0x2'),'timeout','strategy'],'include':[{'model':_0xf60f('0x3'),'as':_0xf60f('0x4'),'attributes':['id',_0xf60f('0x2'),_0xf60f('0x5'),'openchannelPause']}]},'log':_0xf60f('0x6')});};}; \ No newline at end of file +var _0x39c5=['getOpenchannelQueues','strategy','User','online','openchannelPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39c5,0x114));var _0x539c=function(_0x494659,_0x1b8e75){_0x494659=_0x494659-0x0;var _0x36a11d=_0x39c5[_0x494659];return _0x36a11d;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x539c('0x0')],'include':[{'model':_0x539c('0x1'),'as':'Agents','attributes':['id','name',_0x539c('0x2'),_0x539c('0x3')]}]},'log':_0x539c('0x4')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e7f402e..69a93e7 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 _0xb78d=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','Request'];(function(_0x228fc9,_0x38935e){var _0x2b435f=function(_0x8ae00c){while(--_0x8ae00c){_0x228fc9['push'](_0x228fc9['shift']());}};_0x2b435f(++_0x38935e);}(_0xb78d,0x14d));var _0xdb78=function(_0x239a7e,_0x1a7499){_0x239a7e=_0x239a7e-0x0;var _0x26fafa=_0xb78d[_0x239a7e];return _0x26fafa;};'use strict';var client=require(_0xdb78('0x0'));exports['create']=function(_0x53cb01){return client[_0xdb78('0x1')](_0xdb78('0x2'),{'body':_0x53cb01,'log':_0xdb78('0x2')});};exports['update']=function(_0x844fee,_0x58518d){return client[_0xdb78('0x1')](_0xdb78('0x3'),{'body':_0x58518d,'options':{'where':{'uniqueid':_0x844fee},'order':[['id',_0xdb78('0x4')]],'limit':0x1},'log':_0xdb78('0x3')});}; \ No newline at end of file +var _0x921a=['../client','CreateOpenchannelQueueReport','update','Request','DESC','UpdateOpenchannelQueueReport'];(function(_0x4895fb,_0x68bfd7){var _0x4f33cf=function(_0xb52f25){while(--_0xb52f25){_0x4895fb['push'](_0x4895fb['shift']());}};_0x4f33cf(++_0x68bfd7);}(_0x921a,0x1ce));var _0xa921=function(_0x26c2a1,_0x5c515b){_0x26c2a1=_0x26c2a1-0x0;var _0x197935=_0x921a[_0x26c2a1];return _0x197935;};'use strict';var client=require(_0xa921('0x0'));exports['create']=function(_0x260daa){return client['Request'](_0xa921('0x1'),{'body':_0x260daa,'log':_0xa921('0x1')});};exports[_0xa921('0x2')]=function(_0x39be3b,_0x423aed){return client[_0xa921('0x3')]('UpdateOpenchannelQueueReport',{'body':_0x423aed,'options':{'where':{'uniqueid':_0x39be3b},'order':[['id',_0xa921('0x4')]],'limit':0x1},'log':_0xa921('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index d4691ea..c43da10 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 _0x02ef=['addTags','AddTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x4d8950,_0x1a6648){var _0x184947=function(_0x2ece3c){while(--_0x2ece3c){_0x4d8950['push'](_0x4d8950['shift']());}};_0x184947(++_0x1a6648);}(_0x02ef,0x11a));var _0xf02e=function(_0x4b1be5,_0x3933bd){_0x4b1be5=_0x4b1be5-0x0;var _0x4a68bf=_0x02ef[_0x4b1be5];return _0x4a68bf;};'use strict';var client=require(_0xf02e('0x0'));exports['update']=function(_0x3c6866,_0x4ba323){return client[_0xf02e('0x1')](_0xf02e('0x2'),{'body':_0x4ba323,'options':{'where':{'id':_0x3c6866}},'log':'updateSmsInteraction'});};exports[_0xf02e('0x3')]=function(_0x4783f7,_0x1edc1c){return client[_0xf02e('0x1')](_0xf02e('0x4'),{'body':_0x1edc1c,'options':{'where':{'id':_0x4783f7}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x004c=['../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','addTagsToSmsInteraction'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x004c,0x85));var _0xc004=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x004c[_0x58e469];return _0x4c01c5;};'use strict';var client=require(_0xc004('0x0'));exports[_0xc004('0x1')]=function(_0x3fa239,_0x2cf6a8){return client['Request'](_0xc004('0x2'),{'body':_0x2cf6a8,'options':{'where':{'id':_0x3fa239}},'log':_0xc004('0x3')});};exports[_0xc004('0x4')]=function(_0x38a8b9,_0x571646){return client[_0xc004('0x5')]('AddTagsToSmsInteraction',{'body':_0x571646,'options':{'where':{'id':_0x38a8b9}},'log':_0xc004('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index a6dcef8..b881e61 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 _0xc151=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x1b67d2,_0x1030da){var _0x275470=function(_0x6b627c){while(--_0x6b627c){_0x1b67d2['push'](_0x1b67d2['shift']());}};_0x275470(++_0x1030da);}(_0xc151,0xd6));var _0x1c15=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc151[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x1c15('0x0'));exports[_0x1c15('0x1')]=function(_0x358577){return client['Request'](_0x1c15('0x2'),{'body':_0x358577,'log':_0x1c15('0x3')});}; \ No newline at end of file +var _0x78f1=['CreateSmsMessage','createSmsMessage','create','Request'];(function(_0x1bd266,_0xe4fc20){var _0x3073fd=function(_0x51d1e){while(--_0x51d1e){_0x1bd266['push'](_0x1bd266['shift']());}};_0x3073fd(++_0xe4fc20);}(_0x78f1,0x8e));var _0x178f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x78f1[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require('../client');exports[_0x178f('0x0')]=function(_0x29862d){return client[_0x178f('0x1')](_0x178f('0x2'),{'body':_0x29862d,'log':_0x178f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 233ce7a..b7923c3 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 _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x42e29e,_0x5add29){var _0x21b5cf=function(_0x161836){while(--_0x161836){_0x42e29e['push'](_0x42e29e['shift']());}};_0x21b5cf(++_0x5add29);}(_0xb7e7,0x121));var _0x7b7e=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb7e7[_0x36eaaa];return _0x461349;};'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 +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x5bbac5,_0x7eeb89){var _0xcdaff8=function(_0x455b08){while(--_0x455b08){_0x5bbac5['push'](_0x5bbac5['shift']());}};_0xcdaff8(++_0x7eeb89);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'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 33425e3..7de62a9 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x1db595,_0x3de1e0){var _0x528bf2=function(_0x4825de){while(--_0x4825de){_0x1db595['push'](_0x1db595['shift']());}};_0x528bf2(++_0x3de1e0);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x55946f,_0x4aaf8c){var _0x5b8360=function(_0x1569b5){while(--_0x1569b5){_0x55946f['push'](_0x55946f['shift']());}};_0x5b8360(++_0x4aaf8c);}(_0x3e74,0x175));var _0x43e7=function(_0x4ab7f8,_0x58c9ca){_0x4ab7f8=_0x4ab7f8-0x0;var _0x4ddcf9=_0x3e74[_0x4ab7f8];return _0x4ddcf9;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 6e8e139..0630b1f 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(_0x326ac6,_0x20e9c8){var _0x5378c8=function(_0x1bf223){while(--_0x1bf223){_0x326ac6['push'](_0x326ac6['shift']());}};_0x5378c8(++_0x20e9c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x375630,_0x5d4e33){var _0x32ace1=function(_0xbf4e93){while(--_0xbf4e93){_0x375630['push'](_0x375630['shift']());}};_0x32ace1(++_0x5d4e33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 f8409d2..dd56f23 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 _0xe1d3=['../client','update','Request','updateWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x5253fc,_0x21e833){var _0x483542=function(_0x47dc8c){while(--_0x47dc8c){_0x5253fc['push'](_0x5253fc['shift']());}};_0x483542(++_0x21e833);}(_0xe1d3,0x159));var _0x3e1d=function(_0x109271,_0x26c538){_0x109271=_0x109271-0x0;var _0x1d14ec=_0xe1d3[_0x109271];return _0x1d14ec;};'use strict';var client=require(_0x3e1d('0x0'));exports[_0x3e1d('0x1')]=function(_0x1aa7c7,_0x1340c7){return client[_0x3e1d('0x2')]('UpdateWhatsappInteraction',{'body':_0x1340c7,'options':{'where':{'id':_0x1aa7c7}},'log':_0x3e1d('0x3')});};exports['addTags']=function(_0x23f59b,_0x38df15){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x38df15,'options':{'where':{'id':_0x23f59b}},'log':_0x3e1d('0x4')});}; \ No newline at end of file +var _0xf8af=['Request','UpdateWhatsappInteraction','addTags','../client'];(function(_0x366e3a,_0x56ace9){var _0x195cac=function(_0x4fa027){while(--_0x4fa027){_0x366e3a['push'](_0x366e3a['shift']());}};_0x195cac(++_0x56ace9);}(_0xf8af,0x8b));var _0xff8a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf8af[_0x27af45];return _0x18df21;};'use strict';var client=require(_0xff8a('0x0'));exports['update']=function(_0x873efc,_0x3991a6){return client[_0xff8a('0x1')](_0xff8a('0x2'),{'body':_0x3991a6,'options':{'where':{'id':_0x873efc}},'log':'updateWhatsappInteraction'});};exports[_0xff8a('0x3')]=function(_0x460bf6,_0x11cfa2){return client[_0xff8a('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x11cfa2,'options':{'where':{'id':_0x460bf6}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index f780a35..d326ad5 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 _0x84d8=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x1525bf,_0x5212a9){var _0x56e8ca=function(_0x3e4c6b){while(--_0x3e4c6b){_0x1525bf['push'](_0x1525bf['shift']());}};_0x56e8ca(++_0x5212a9);}(_0x84d8,0x1c9));var _0x884d=function(_0x1b33d5,_0x37bfa){_0x1b33d5=_0x1b33d5-0x0;var _0x578d2a=_0x84d8[_0x1b33d5];return _0x578d2a;};'use strict';var client=require('../client');exports[_0x884d('0x0')]=function(_0x5ad4cd){return client[_0x884d('0x1')](_0x884d('0x2'),{'body':_0x5ad4cd,'log':_0x884d('0x3')});}; \ No newline at end of file +var _0x1c69=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x5e1dd2,_0x3d2af5){var _0x19652d=function(_0x467ff6){while(--_0x467ff6){_0x5e1dd2['push'](_0x5e1dd2['shift']());}};_0x19652d(++_0x3d2af5);}(_0x1c69,0xe9));var _0x91c6=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x1c69[_0x2d34d6];return _0x1d3d12;};'use strict';var client=require(_0x91c6('0x0'));exports[_0x91c6('0x1')]=function(_0x32636d){return client[_0x91c6('0x2')](_0x91c6('0x3'),{'body':_0x32636d,'log':_0x91c6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 443db73..2dcdffb 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 _0x9039=['User','Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0xb60aee,_0x19a4af){var _0x52352a=function(_0x33ec5e){while(--_0x33ec5e){_0xb60aee['push'](_0xb60aee['shift']());}};_0x52352a(++_0x19a4af);}(_0x9039,0xff));var _0x9903=function(_0x23b76a,_0x2bdcd1){_0x23b76a=_0x23b76a-0x0;var _0x1e8e93=_0x9039[_0x23b76a];return _0x1e8e93;};'use strict';var client=require(_0x9903('0x0'));exports[_0x9903('0x1')]=function(){return function(){return client[_0x9903('0x2')](_0x9903('0x3'),{'options':{'raw':![],'attributes':['id',_0x9903('0x4'),_0x9903('0x5'),'strategy'],'include':[{'model':_0x9903('0x6'),'as':_0x9903('0x7'),'attributes':['id','name','online',_0x9903('0x8')]}]},'log':_0x9903('0x1')});};}; \ No newline at end of file +var _0x3ef3=['whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','Agents','online'];(function(_0x1e46f4,_0x52eb03){var _0x12e449=function(_0x504ba2){while(--_0x504ba2){_0x1e46f4['push'](_0x1e46f4['shift']());}};_0x12e449(++_0x52eb03);}(_0x3ef3,0xb5));var _0x33ef=function(_0x23f049,_0x991ac7){_0x23f049=_0x23f049-0x0;var _0x45b914=_0x3ef3[_0x23f049];return _0x45b914;};'use strict';var client=require(_0x33ef('0x0'));exports[_0x33ef('0x1')]=function(){return function(){return client['Request'](_0x33ef('0x2'),{'options':{'raw':![],'attributes':['id',_0x33ef('0x3'),_0x33ef('0x4'),_0x33ef('0x5')],'include':[{'model':'User','as':_0x33ef('0x6'),'attributes':['id',_0x33ef('0x3'),_0x33ef('0x7'),_0x33ef('0x8')]}]},'log':_0x33ef('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index ad067f7..ede4a6d 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 _0xb54e=['Request','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x402b50,_0x352f58){var _0x3fc58c=function(_0x3045e1){while(--_0x3045e1){_0x402b50['push'](_0x402b50['shift']());}};_0x3fc58c(++_0x352f58);}(_0xb54e,0xe8));var _0xeb54=function(_0x2d9568,_0x520b1b){_0x2d9568=_0x2d9568-0x0;var _0x5edbd1=_0xb54e[_0x2d9568];return _0x5edbd1;};'use strict';var client=require(_0xeb54('0x0'));exports[_0xeb54('0x1')]=function(_0x243bd0){return client[_0xeb54('0x2')]('CreateWhatsappQueueReport',{'body':_0x243bd0,'log':'CreateWhatsappQueueReport'});};exports[_0xeb54('0x3')]=function(_0x3be97c,_0x2d213d){return client['Request'](_0xeb54('0x4'),{'body':_0x2d213d,'options':{'where':{'uniqueid':_0x3be97c},'order':[['id',_0xeb54('0x5')]],'limit':0x1},'log':_0xeb54('0x4')});}; \ No newline at end of file +var _0x0573=['UpdateWhatsappQueueReport','DESC','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x0573,0xd4));var _0x3057=function(_0x345888,_0x5ea654){_0x345888=_0x345888-0x0;var _0x274bbd=_0x0573[_0x345888];return _0x274bbd;};'use strict';var client=require(_0x3057('0x0'));exports['create']=function(_0x4bef5e){return client[_0x3057('0x1')](_0x3057('0x2'),{'body':_0x4bef5e,'log':'CreateWhatsappQueueReport'});};exports[_0x3057('0x3')]=function(_0x40189f,_0x24e41e){return client[_0x3057('0x1')](_0x3057('0x4'),{'body':_0x24e41e,'options':{'where':{'uniqueid':_0x40189f},'order':[['id',_0x3057('0x5')]],'limit':0x1},'log':_0x3057('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 f9659db..1b36b7a 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 _0xa939=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','close','complete','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate','lodash','util','../../../../config/logger','routing'];(function(_0x123c01,_0x281257){var _0x6355bd=function(_0x8e900e){while(--_0x8e900e){_0x123c01['push'](_0x123c01['shift']());}};_0x6355bd(++_0x281257);}(_0xa939,0x83));var _0x9a93=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xa939[_0x1ae5ab];return _0x1ce001;};'use strict';var schema=require(_0x9a93('0x0'));var _=require(_0x9a93('0x1'));var util=require(_0x9a93('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x9a93('0x3'))(_0x9a93('0x4'));var strategy=require(_0x9a93('0x5'));var queue=schema({'name':{'type':_0x9a93('0x6'),'required':!![],'message':_0x9a93('0x7')},'timeout':{'type':'number','message':_0x9a93('0x8')}});function writeLog(_0x53cf78,_0x431268,_0x488a58){return logger[_0x9a93('0x9')](util[_0x9a93('0xa')](_0x9a93('0xb'),_0x53cf78,_0x431268[_0x9a93('0xc')],_0x488a58));}function handleFindAgent(_0xee7b87){return function(_0x5095a6){return _0x5095a6[_0x9a93('0xc')][_0x9a93('0xd')]()===_0xee7b87[_0x9a93('0xd')]();};}exports[_0x9a93('0xe')]=function(_0x58bf8c,_0x8f343b,_0x5a307c,_0x3f2c34){return function(_0x18d0d1){try{var _0x34a10d={'name':_0x8f343b[0x0],'timeout':_0x8f343b[0x1]};var _0x223359=queue[_0x9a93('0x0')](_0x34a10d,{'typecast':!![]});if(_0x223359[_0x9a93('0xf')]){logger[_0x9a93('0x10')](_0x9a93('0x11'),_0x58bf8c,_[_0x9a93('0x12')](_0x223359,_0x9a93('0x13'))[_0x9a93('0x14')](',\x20'));_0x18d0d1[_0x9a93('0x15')]();}else{var _0x3944b6=_['find'](_0x5a307c[_0x9a93('0x16')],handleFindAgent(_0x34a10d[_0x9a93('0xc')]));if(_0x3944b6){var _0x50bd2c=(_0x34a10d[_0x9a93('0x17')]||0xa)*0x3e8;var _0xea5fdf,_0x26a8e3;var _0x5c6733=seqqueue[_0x9a93('0x18')](_0x50bd2c);_0x5c6733['id']=_0x58bf8c;_0x5c6733[_0x9a93('0x19')]=_0x50bd2c;_0x5c6733[_0x9a93('0x1a')]=_0x3f2c34[_0x9a93('0x1a')];writeLog(_0x58bf8c,_0x3944b6,util['format'](_0x9a93('0x1b'),_0x50bd2c));_0x5a307c[_0x9a93('0x1c')][_0x58bf8c]['on']('end',function(){logger[_0x9a93('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x58bf8c);clearTimeout(_0x26a8e3);_0x26a8e3=undefined;_0x5c6733[_0x9a93('0x1d')]();if(_0x5a307c[_0x9a93('0x1c')][_0x58bf8c]){delete _0x5a307c['rules'][_0x58bf8c];}_0x18d0d1[_0x9a93('0x15')]();});_0x5a307c[_0x9a93('0x1c')][_0x58bf8c]['on'](_0x9a93('0x1e'),function(){if(_0x5a307c[_0x9a93('0x1c')][_0x58bf8c]){delete _0x5a307c[_0x9a93('0x1c')][_0x58bf8c];}});_0x26a8e3=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x58bf8c);clearTimeout(_0x26a8e3);_0x5c6733[_0x9a93('0x1d')]();_0x18d0d1['next']();},_0x50bd2c);strategy[_0x9a93('0x1f')](_0x5c6733,_0x3944b6,_0x5a307c,_0x3f2c34);}else{logger[_0x9a93('0x10')](_0x9a93('0x20'),_0x58bf8c,_0x34a10d['name']);_0x18d0d1[_0x9a93('0x15')]();}}}catch(_0x4b3e19){console['log'](_0x4b3e19);logger[_0x9a93('0x10')]('[%s][QUEUE]\x20%s',_0x58bf8c,_0x4b3e19[_0x9a93('0x21')]);_0x18d0d1[_0x9a93('0x15')]();}};}; \ No newline at end of file +var _0xc186=['[%s][AGENT]\x20ROUTING\x20END','close','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','info','rules','stop','complete'];(function(_0x3ae19a,_0x237b66){var _0x40f708=function(_0x434f69){while(--_0x434f69){_0x3ae19a['push'](_0x3ae19a['shift']());}};_0x40f708(++_0x237b66);}(_0xc186,0x73));var _0x6c18=function(_0x1a6c9e,_0x2cef7f){_0x1a6c9e=_0x1a6c9e-0x0;var _0x16c318=_0xc186[_0x1a6c9e];return _0x16c318;};'use strict';var schema=require('validate');var _=require(_0x6c18('0x0'));var util=require(_0x6c18('0x1'));var seqqueue=require(_0x6c18('0x2'));var logger=require(_0x6c18('0x3'))(_0x6c18('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x6c18('0x5')},'timeout':{'type':_0x6c18('0x6'),'message':_0x6c18('0x7')}});function writeLog(_0x88742,_0x1bfce3,_0x2b2c09){return logger['info'](util[_0x6c18('0x8')](_0x6c18('0x9'),_0x88742,_0x1bfce3[_0x6c18('0xa')],_0x2b2c09));}function handleFindAgent(_0x581bf9){return function(_0x5f33cc){return _0x5f33cc['name'][_0x6c18('0xb')]()===_0x581bf9[_0x6c18('0xb')]();};}exports[_0x6c18('0xc')]=function(_0x10762c,_0x17a863,_0x1d0876,_0x333515){return function(_0x3a7d46){try{var _0x2c214c={'name':_0x17a863[0x0],'timeout':_0x17a863[0x1]};var _0x4b0ccd=queue['validate'](_0x2c214c,{'typecast':!![]});if(_0x4b0ccd[_0x6c18('0xd')]){logger[_0x6c18('0xe')](_0x6c18('0xf'),_0x10762c,_['map'](_0x4b0ccd,_0x6c18('0x10'))['join'](',\x20'));_0x3a7d46['stop']();}else{var _0x42bda1=_[_0x6c18('0x11')](_0x1d0876[_0x6c18('0x12')],handleFindAgent(_0x2c214c['name']));if(_0x42bda1){var _0x455072=(_0x2c214c[_0x6c18('0x13')]||0xa)*0x3e8;var _0x14f5e7,_0x185dd3;var _0x20aaca=seqqueue[_0x6c18('0x14')](_0x455072);_0x20aaca['id']=_0x10762c;_0x20aaca[_0x6c18('0x15')]=_0x455072;_0x20aaca[_0x6c18('0x16')]=_0x333515[_0x6c18('0x16')];writeLog(_0x10762c,_0x42bda1,util[_0x6c18('0x8')](_0x6c18('0x17'),_0x455072));_0x1d0876['rules'][_0x10762c]['on'](_0x6c18('0x18'),function(){logger[_0x6c18('0x19')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x10762c);clearTimeout(_0x185dd3);_0x185dd3=undefined;_0x20aaca['close']();if(_0x1d0876[_0x6c18('0x1a')][_0x10762c]){delete _0x1d0876[_0x6c18('0x1a')][_0x10762c];}_0x3a7d46[_0x6c18('0x1b')]();});_0x1d0876[_0x6c18('0x1a')][_0x10762c]['on'](_0x6c18('0x1c'),function(){if(_0x1d0876[_0x6c18('0x1a')][_0x10762c]){delete _0x1d0876[_0x6c18('0x1a')][_0x10762c];}});_0x185dd3=setTimeout(function(){logger[_0x6c18('0x19')](_0x6c18('0x1d'),_0x10762c);clearTimeout(_0x185dd3);_0x20aaca[_0x6c18('0x1e')]();_0x3a7d46[_0x6c18('0x1f')]();},_0x455072);strategy['agent'](_0x20aaca,_0x42bda1,_0x1d0876,_0x333515);}else{logger[_0x6c18('0xe')](_0x6c18('0x20'),_0x10762c,_0x2c214c[_0x6c18('0xa')]);_0x3a7d46['stop']();}}}catch(_0x60f2de){console[_0x6c18('0x21')](_0x60f2de);logger[_0x6c18('0xe')](_0x6c18('0x22'),_0x10762c,_0x60f2de[_0x6c18('0x23')]);_0x3a7d46[_0x6c18('0x1b')]();}};}; \ 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 b68642d..2091023 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 _0x999b=['amazonlex','providerName','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','postText','message'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x999b,0x96));var _0xb999=function(_0x290f6b,_0x259478){_0x290f6b=_0x290f6b-0x0;var _0x5c46e4=_0x999b[_0x290f6b];return _0x5c46e4;};'use strict';var _=require(_0xb999('0x0'));var moment=require(_0xb999('0x1'));var AWS=require(_0xb999('0x2'));var utils=require(_0xb999('0x3'));var logger=require(_0xb999('0x4'))(_0xb999('0x5'));var rpc={'chatMessage':require(_0xb999('0x6')),'openchannelMessage':require(_0xb999('0x7')),'mailMessage':require(_0xb999('0x8')),'smsMessage':require(_0xb999('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb999('0xa'))};exports[_0xb999('0xb')]=function(_0x522030,_0x2996c5){return function(_0x38a2b8){try{if(!_[_0xb999('0xc')](this[_0xb999('0xd')][_0xb999('0xe')])){logger[_0xb999('0xf')]('[%s][AMAZONLEX]\x20%s',_0x522030,_0xb999('0x10'));return _0x38a2b8[_0xb999('0x11')]();}var _0x454985={'ContactId':this[_0xb999('0x12')]['id'],'sentAt':moment()[_0xb999('0x13')](_0xb999('0x14')),'direction':_0xb999('0x15')};if(this[_0xb999('0x16')]==='sms'||this[_0xb999('0x16')]===_0xb999('0x17')){_0x454985[_0xb999('0x18')]=this[_0xb999('0xd')][_0xb999('0x18')];}var _0x16b8a4=this[_0xb999('0x16')];if(_0x16b8a4===_0xb999('0x19')){_0x454985[_0xb999('0x1a')]=this['account']['id'];}else{_0x454985[_[_0xb999('0x1b')](_0x16b8a4)+_0xb999('0x1c')]=this['account']['id'];}_0x454985[_[_0xb999('0x1b')](_0x16b8a4)+_0xb999('0x1d')]=this['interaction']['id'];if(this[_0xb999('0xd')][_0xb999('0x1e')]){var _0x4561a4=_0x2996c5[0x4];if(!_[_0xb999('0x1f')](_0x4561a4)){_0x454985[_0xb999('0x20')]=utils[_0xb999('0x21')](_0x4561a4,this);return rpc[_0x16b8a4+_0xb999('0x22')][_0xb999('0x23')](_0x454985)[_0xb999('0x24')](function(_0x55838a){logger[_0xb999('0xf')](_0xb999('0x25'),_0x522030,_0x454985[_0xb999('0x20')]);})[_0xb999('0x26')](function(_0xe0cde3){logger[_0xb999('0x27')](_0xb999('0x25'),_0x522030,JSON[_0xb999('0x28')](_0xe0cde3));})['finally'](function(){logger[_0xb999('0xf')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x522030);_0x38a2b8[_0xb999('0x29')]();});}else{logger[_0xb999('0xf')](_0xb999('0x2a'),_0x522030);_0x38a2b8[_0xb999('0x29')]();}}else{var _0x1476cf=this;var _0x67f6f3=new AWS['LexRuntime']({'accessKeyId':_0x2996c5[0x0],'secretAccessKey':_0x2996c5[0x1],'region':_0x2996c5[0x2]});var _0x10f42e={'botAlias':_0xb999('0x2b'),'botName':_0x2996c5[0x3],'inputText':this['message'][_0xb999('0x20')],'userId':this[_0xb999('0x16')]+':'+this['interaction']['id']['toString']()};_0x67f6f3[_0xb999('0x2c')](_0x10f42e,function(_0x5e4933,_0x1ca6ba){if(_0x5e4933){logger[_0xb999('0x27')](_0xb999('0x25'),_0x522030,_0x5e4933[_0xb999('0x2d')]);_0x38a2b8[_0xb999('0x11')]();}else if(_0x1ca6ba&&_0x1ca6ba[_0xb999('0x2d')]){_0x1476cf[_0xb999('0x20')][_0xb999('0x2e')]=_0x1ca6ba;_0x454985[_0xb999('0x20')]=_0x1ca6ba[_0xb999('0x2d')];_0x454985[_0xb999('0x2f')]=_0xb999('0x2e');_0x454985['providerResponse']=JSON[_0xb999('0x28')](_0x1ca6ba);return rpc[_0x16b8a4+_0xb999('0x22')]['create'](_0x454985)[_0xb999('0x24')](function(_0x3eda35){logger[_0xb999('0xf')](_0xb999('0x25'),_0x522030,_0x454985[_0xb999('0x20')]);if(_0x1ca6ba['dialogState']==_0xb999('0x30')){_0x38a2b8[_0xb999('0x11')]();}else{_0x38a2b8[_0xb999('0x29')]();}})['catch'](function(_0x4c3f79){logger[_0xb999('0x27')](_0xb999('0x25'),_0x522030,JSON[_0xb999('0x28')](_0x4c3f79));_0x38a2b8[_0xb999('0x11')]();});}else{_0x38a2b8['next']();}});}}catch(_0x459d9d){logger[_0xb999('0x27')](_0xb999('0x25'),_0x522030,JSON[_0xb999('0x28')](_0x459d9d));_0x38a2b8[_0xb999('0x29')]();}};}; \ No newline at end of file +var _0x223f=['next','contact','out','channel','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','body','Message','create','then','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','postText','message','amazonlex','providerResponse','dialogState','Failed','stringify','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s'];(function(_0x5d9e80,_0x3b56eb){var _0x5bae8f=function(_0x294799){while(--_0x294799){_0x5d9e80['push'](_0x5d9e80['shift']());}};_0x5bae8f(++_0x3b56eb);}(_0x223f,0x159));var _0xf223=function(_0x24e47a,_0x34e114){_0x24e47a=_0x24e47a-0x0;var _0xc64dc=_0x223f[_0x24e47a];return _0xc64dc;};'use strict';var _=require(_0xf223('0x0'));var moment=require('moment');var AWS=require(_0xf223('0x1'));var utils=require('./utils');var logger=require(_0xf223('0x2'))(_0xf223('0x3'));var rpc={'chatMessage':require(_0xf223('0x4')),'openchannelMessage':require(_0xf223('0x5')),'mailMessage':require(_0xf223('0x6')),'smsMessage':require(_0xf223('0x7')),'faxMessage':require(_0xf223('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf223('0x9')]=function(_0xbdb87a,_0x5738db){return function(_0x1e5fdc){try{if(!_[_0xf223('0xa')](this[_0xf223('0xb')][_0xf223('0xc')])){logger[_0xf223('0xd')](_0xf223('0xe'),_0xbdb87a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1e5fdc[_0xf223('0xf')]();}var _0x21ce47={'ContactId':this[_0xf223('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf223('0x11')};if(this[_0xf223('0x12')]==='sms'||this[_0xf223('0x12')]==='whatsapp'){_0x21ce47['phone']=this[_0xf223('0xb')][_0xf223('0x13')];}var _0x4d6984=this[_0xf223('0x12')];if(_0x4d6984===_0xf223('0x14')){_0x21ce47[_0xf223('0x15')]=this['account']['id'];}else{_0x21ce47[_[_0xf223('0x16')](_0x4d6984)+_0xf223('0x17')]=this[_0xf223('0x18')]['id'];}_0x21ce47[_[_0xf223('0x16')](_0x4d6984)+_0xf223('0x19')]=this['interaction']['id'];if(this[_0xf223('0xb')]['created']){var _0x79423b=_0x5738db[0x4];if(!_[_0xf223('0x1a')](_0x79423b)){_0x21ce47[_0xf223('0x1b')]=utils['getMustacheRender'](_0x79423b,this);return rpc[_0x4d6984+_0xf223('0x1c')][_0xf223('0x1d')](_0x21ce47)[_0xf223('0x1e')](function(_0x3b7998){logger[_0xf223('0xd')]('[%s][AMAZONLEX]\x20%s',_0xbdb87a,_0x21ce47['body']);})[_0xf223('0x1f')](function(_0x2e9bd7){logger[_0xf223('0x20')](_0xf223('0xe'),_0xbdb87a,JSON['stringify'](_0x2e9bd7));})[_0xf223('0x21')](function(){logger[_0xf223('0xd')](_0xf223('0x22'),_0xbdb87a);_0x1e5fdc[_0xf223('0x23')]();});}else{logger[_0xf223('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xbdb87a);_0x1e5fdc['stop']();}}else{var _0x3683e0=this;var _0x36bdd5=new AWS[(_0xf223('0x24'))]({'accessKeyId':_0x5738db[0x0],'secretAccessKey':_0x5738db[0x1],'region':_0x5738db[0x2]});var _0x41247={'botAlias':_0xf223('0x25'),'botName':_0x5738db[0x3],'inputText':this['message'][_0xf223('0x1b')],'userId':this[_0xf223('0x12')]+':'+this[_0xf223('0xb')]['id']['toString']()};_0x36bdd5[_0xf223('0x26')](_0x41247,function(_0x286158,_0x3c1dda){if(_0x286158){logger[_0xf223('0x20')](_0xf223('0xe'),_0xbdb87a,_0x286158[_0xf223('0x27')]);_0x1e5fdc[_0xf223('0xf')]();}else if(_0x3c1dda&&_0x3c1dda[_0xf223('0x27')]){_0x3683e0[_0xf223('0x1b')][_0xf223('0x28')]=_0x3c1dda;_0x21ce47[_0xf223('0x1b')]=_0x3c1dda['message'];_0x21ce47['providerName']=_0xf223('0x28');_0x21ce47[_0xf223('0x29')]=JSON['stringify'](_0x3c1dda);return rpc[_0x4d6984+_0xf223('0x1c')][_0xf223('0x1d')](_0x21ce47)[_0xf223('0x1e')](function(_0x489e7d){logger['info'](_0xf223('0xe'),_0xbdb87a,_0x21ce47[_0xf223('0x1b')]);if(_0x3c1dda[_0xf223('0x2a')]==_0xf223('0x2b')){_0x1e5fdc[_0xf223('0xf')]();}else{_0x1e5fdc['stop']();}})['catch'](function(_0x133c5a){logger[_0xf223('0x20')](_0xf223('0xe'),_0xbdb87a,JSON[_0xf223('0x2c')](_0x133c5a));_0x1e5fdc['next']();});}else{_0x1e5fdc[_0xf223('0xf')]();}});}}catch(_0x550533){logger[_0xf223('0x20')](_0xf223('0xe'),_0xbdb87a,JSON[_0xf223('0x2c')](_0x550533));_0x1e5fdc['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 d0c534f..ea92378 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 _0xafb1=[''+_[_0x1afb('0x36')](_0x43f52a[_0x1afb('0xe')],_0x1afb('0x37'),_0x1afb('0x38'))+'';_0x43f52a[_0x1afb('0x39')]={'Auto-Submitted':_0x1afb('0x3a'),'X-Auto-Response-Suppress':'All','Precedence':_0x1afb('0x3b')};return mailRpc['sendMailMessage'](_0x39be81,_0x43f52a)['then'](function(_0x38e94f){logger[_0x1afb('0x10')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x1d109b);_0x43f52a[_0x1afb('0x34')]=_0x38e94f[_0x1afb('0x1f')][_0x1afb('0x34')];return rpc[_0x4bf1fb+_0x1afb('0x3c')][_0x1afb('0x3d')](_0x43f52a);})[_0x1afb('0x3e')](function(_0x4d2211){logger[_0x1afb('0x10')](_0x1afb('0x11'),_0x1d109b,JSON[_0x1afb('0x3f')](_0x4d2211));})['catch'](function(_0x284802){logger['error'](_0x1afb('0x40'),_0x1d109b,JSON[_0x1afb('0x3f')](_0x284802));})[_0x1afb('0x41')](function(){Promise[_0x1afb('0x42')]()[_0x1afb('0x3e')](function(){if(_0x12ba31[0x0]!=='2'||_0x3c6929['autoreplyExecuted'])return;return rpc[_0x4bf1fb+_0x1afb('0x43')][_0x1afb('0x44')](_0x3c6929['id'],{'autoreplyExecuted':!![]})[_0x1afb('0x3e')](function(_0x120e6f){logger[_0x1afb('0x10')](_0x1afb('0x19'),_0x1d109b,JSON[_0x1afb('0x3f')](_0x120e6f));})[_0x1afb('0x45')](function(_0x60c93d){logger[_0x1afb('0x46')](_0x1afb('0x47'),_0x1d109b,JSON[_0x1afb('0x3f')](_0x60c93d));});})['then'](function(){_0x1c8d23[_0x1afb('0x13')]();});});}else{return rpc[this[_0x1afb('0x1d')]+_0x1afb('0x3c')][_0x1afb('0x3d')](_0x43f52a)[_0x1afb('0x3e')](function(_0x38c44f){logger[_0x1afb('0x10')](_0x1afb('0x11'),_0x1d109b,_0x43f52a['body']);})[_0x1afb('0x45')](function(_0x244a38){logger[_0x1afb('0x46')](_0x1afb('0x11'),_0x1d109b,JSON[_0x1afb('0x3f')](_0x244a38));})[_0x1afb('0x41')](function(){Promise[_0x1afb('0x42')]()['then'](function(){if(_0x12ba31[0x0]!=='2'||_0x3c6929['autoreplyExecuted'])return;return rpc[_0x4bf1fb+'Interaction'][_0x1afb('0x44')](_0x3c6929['id'],{'autoreplyExecuted':!![]})[_0x1afb('0x3e')](function(_0x4f6d4e){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1d109b,JSON['stringify'](_0x4f6d4e));})[_0x1afb('0x45')](function(_0x25dceb){logger[_0x1afb('0x46')](_0x1afb('0x47'),_0x1d109b,JSON[_0x1afb('0x3f')](_0x25dceb));});})['then'](function(){_0x1c8d23[_0x1afb('0x13')]();});});}}}catch(_0x38954f){logger[_0x1afb('0x46')]('[%s][AUTOREPLY]\x20%s',_0x1d109b,JSON[_0x1afb('0x3f')](_0x38954f));_0x1c8d23[_0x1afb('0x48')]();}};}; \ No newline at end of file +var _0x451c=['update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','out','channel','mail','getMustacheRender','from','message','phone','read','subject','Re:\x20','ChatWebsiteId','upperFirst','account','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','','replace','';_0xc8437d[_0xc451('0x37')]={'Auto-Submitted':_0xc451('0x38'),'X-Auto-Response-Suppress':'All','Precedence':_0xc451('0x39')};return mailRpc[_0xc451('0x3a')](_0x10fc99,_0xc8437d)[_0xc451('0x3b')](function(_0x4fe353){logger['info'](_0xc451('0x3c'),_0x288863);_0xc8437d['messageId']=_0x4fe353['message'][_0xc451('0x32')];return rpc[_0x2f0f84+'Message'][_0xc451('0x3d')](_0xc8437d);})[_0xc451('0x3b')](function(_0x1ff0e3){logger[_0xc451('0xf')](_0xc451('0x10'),_0x288863,JSON[_0xc451('0x3e')](_0x1ff0e3));})['catch'](function(_0x107426){logger[_0xc451('0x3f')](_0xc451('0x40'),_0x288863,JSON[_0xc451('0x3e')](_0x107426));})[_0xc451('0x41')](function(){Promise[_0xc451('0x42')]()['then'](function(){if(_0x4710bc[0x0]!=='2'||_0x20e421[_0xc451('0x16')])return;return rpc[_0x2f0f84+_0xc451('0x43')][_0xc451('0x44')](_0x20e421['id'],{'autoreplyExecuted':!![]})['then'](function(_0xdc70f7){logger[_0xc451('0xf')](_0xc451('0x17'),_0x288863,JSON[_0xc451('0x3e')](_0xdc70f7));})[_0xc451('0x45')](function(_0x8079cb){logger[_0xc451('0x3f')](_0xc451('0x46'),_0x288863,JSON[_0xc451('0x3e')](_0x8079cb));});})[_0xc451('0x3b')](function(){_0x183f8b[_0xc451('0x15')]();});});}else{return rpc[this[_0xc451('0x1b')]+_0xc451('0x27')]['create'](_0xc8437d)['then'](function(_0x2a40a4){logger[_0xc451('0xf')](_0xc451('0x10'),_0x288863,_0xc8437d[_0xc451('0xd')]);})[_0xc451('0x45')](function(_0x3f79c3){logger[_0xc451('0x3f')](_0xc451('0x10'),_0x288863,JSON[_0xc451('0x3e')](_0x3f79c3));})[_0xc451('0x41')](function(){Promise[_0xc451('0x42')]()['then'](function(){if(_0x4710bc[0x0]!=='2'||_0x20e421[_0xc451('0x16')])return;return rpc[_0x2f0f84+'Interaction'][_0xc451('0x44')](_0x20e421['id'],{'autoreplyExecuted':!![]})['then'](function(_0x58740b){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x288863,JSON[_0xc451('0x3e')](_0x58740b));})[_0xc451('0x45')](function(_0x4f755a){logger['error'](_0xc451('0x46'),_0x288863,JSON[_0xc451('0x3e')](_0x4f755a));});})[_0xc451('0x3b')](function(){_0x183f8b[_0xc451('0x15')]();});});}}}catch(_0x3cbe66){logger[_0xc451('0x3f')](_0xc451('0x10'),_0x288863,JSON[_0xc451('0x3e')](_0x3cbe66));_0x183f8b[_0xc451('0x47')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 7b6456f..f86b404 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d09=['consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','stop','moment','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x24002c,_0x50f532){var _0x4801c7=function(_0x58216a){while(--_0x58216a){_0x24002c['push'](_0x24002c['shift']());}};_0x4801c7(++_0x50f532);}(_0x5d09,0xe0));var _0x95d0=function(_0x54514c,_0xf1c84a){_0x54514c=_0x54514c-0x0;var _0x5cd80e=_0x5d09[_0x54514c];return _0x5cd80e;};'use strict';var moment=require(_0x95d0('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0x95d0('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x95d0('0x2')),'mailInteraction':require(_0x95d0('0x3')),'faxInteraction':require(_0x95d0('0x4')),'whatsappInteraction':require(_0x95d0('0x5'))};exports[_0x95d0('0x6')]=function(_0x58d4f1,_0x23389c,_0x3203b3,_0xb67b21){return function(_0x2e2587){try{logger[_0x95d0('0x7')](_0x95d0('0x8'),_0x58d4f1,_0x23389c[0x0]);var _0x100a7a={'closed':0x1,'closedAt':moment()[_0x95d0('0x9')](_0x95d0('0xa')),'closeReason':_0x95d0('0xb'),'disposition':_0x23389c[0x0]};if(rpc[_0xb67b21[_0x95d0('0xc')]+_0x95d0('0xd')]){rpc[_0xb67b21['channel']+'Interaction'][_0x95d0('0xe')](_0xb67b21[_0x95d0('0xf')]['id'],_0x100a7a)[_0x95d0('0x10')](function(_0x4e91c4){logger[_0x95d0('0x7')](_0x95d0('0x11'),_0x58d4f1,_0xb67b21[_0x95d0('0xf')]['id']);})[_0x95d0('0x12')](function(_0x45a2b7){logger[_0x95d0('0x13')]('[%s][CLOSE]\x20%s',_0x58d4f1,JSON[_0x95d0('0x14')](_0x45a2b7));})[_0x95d0('0x15')](function(){_0x2e2587['stop']();});}}catch(_0x1ce273){logger['error']('[%s][CLOSE]\x20%s',_0x58d4f1,JSON[_0x95d0('0x14')](_0x1ce273));_0x2e2587[_0x95d0('0x16')]();}};}; \ No newline at end of file +var _0x6155=['catch','error','finally','stop','[%s][CLOSE]\x20%s','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x536bb1,_0x100fa3){var _0x3794c5=function(_0x4f76ef){while(--_0x4f76ef){_0x536bb1['push'](_0x536bb1['shift']());}};_0x3794c5(++_0x100fa3);}(_0x6155,0x17f));var _0x5615=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x6155[_0x31ced5];return _0x10d9e5;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x5615('0x0'));var rpc={'chatInteraction':require(_0x5615('0x1')),'openchannelInteraction':require(_0x5615('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x5615('0x3')),'faxInteraction':require(_0x5615('0x4')),'whatsappInteraction':require(_0x5615('0x5'))};exports[_0x5615('0x6')]=function(_0x427dfd,_0x341309,_0x1bd63c,_0x4d0efa){return function(_0x2a1d3){try{logger[_0x5615('0x7')](_0x5615('0x8'),_0x427dfd,_0x341309[0x0]);var _0x51ba77={'closed':0x1,'closedAt':moment()['format'](_0x5615('0x9')),'closeReason':_0x5615('0xa'),'disposition':_0x341309[0x0]};if(rpc[_0x4d0efa[_0x5615('0xb')]+'Interaction']){rpc[_0x4d0efa[_0x5615('0xb')]+_0x5615('0xc')]['update'](_0x4d0efa[_0x5615('0xd')]['id'],_0x51ba77)[_0x5615('0xe')](function(_0x452ce1){logger[_0x5615('0x7')](_0x5615('0xf'),_0x427dfd,_0x4d0efa['interaction']['id']);})[_0x5615('0x10')](function(_0x224546){logger[_0x5615('0x11')]('[%s][CLOSE]\x20%s',_0x427dfd,JSON['stringify'](_0x224546));})[_0x5615('0x12')](function(){_0x2a1d3[_0x5615('0x13')]();});}}catch(_0x1da94c){logger[_0x5615('0x11')](_0x5615('0x14'),_0x427dfd,JSON['stringify'](_0x1da94c));_0x2a1d3[_0x5615('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index c674a45..126a904 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbea5=['interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','body','getMustacheRender','Message','then','[%s][DIALOGFLOW]\x20%s','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerName','create','next','stringify','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage'];(function(_0x2717ce,_0x3d39b3){var _0x5d2d8a=function(_0x109bad){while(--_0x109bad){_0x2717ce['push'](_0x2717ce['shift']());}};_0x5d2d8a(++_0x3d39b3);}(_0xbea5,0x177));var _0x5bea=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0xbea5[_0x5f49c0];return _0x5ab653;};'use strict';var _=require(_0x5bea('0x0'));var moment=require(_0x5bea('0x1'));var apiai=require('apiai-promise');var md5=require(_0x5bea('0x2'));var utils=require(_0x5bea('0x3'));var logger=require(_0x5bea('0x4'))(_0x5bea('0x5'));var rpc={'chatMessage':require(_0x5bea('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5bea('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5bea('0x8'))};exports['consequence']=function(_0x487888,_0x40bb15){return function(_0x581c55){try{if(!_['isNil'](this[_0x5bea('0x9')][_0x5bea('0xa')])){logger[_0x5bea('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x487888,_0x5bea('0xc'));return _0x581c55['next']();}var _0x4e793c={'ContactId':this[_0x5bea('0xd')]['id'],'sentAt':moment()[_0x5bea('0xe')](_0x5bea('0xf')),'direction':_0x5bea('0x10')};if(this[_0x5bea('0x11')]===_0x5bea('0x12')||this['channel']===_0x5bea('0x13')){_0x4e793c[_0x5bea('0x14')]=this['interaction'][_0x5bea('0x14')];}var _0x15d0af=this['channel'];if(_0x15d0af===_0x5bea('0x15')){_0x4e793c[_0x5bea('0x16')]=this[_0x5bea('0x17')]['id'];}else{_0x4e793c[_[_0x5bea('0x18')](_0x15d0af)+_0x5bea('0x19')]=this[_0x5bea('0x17')]['id'];}_0x4e793c[_[_0x5bea('0x18')](_0x15d0af)+'InteractionId']=this['interaction']['id'];if(this[_0x5bea('0x9')][_0x5bea('0x1a')]){var _0x22f509=_0x40bb15[0x2];if(!_['isEmpty'](_0x22f509)){_0x4e793c[_0x5bea('0x1b')]=utils[_0x5bea('0x1c')](_0x22f509,this);return rpc[_0x15d0af+_0x5bea('0x1d')]['create'](_0x4e793c)[_0x5bea('0x1e')](function(_0x23fa96){logger['info'](_0x5bea('0x1f'),_0x487888,_0x4e793c['body']);})[_0x5bea('0x20')](function(_0x358ad0){logger[_0x5bea('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x487888,JSON['stringify'](_0x358ad0));})[_0x5bea('0x22')](function(){logger[_0x5bea('0xb')](_0x5bea('0x23'),_0x487888);_0x581c55['stop']();});}else{logger[_0x5bea('0xb')](_0x5bea('0x24'),_0x487888);_0x581c55[_0x5bea('0x25')]();}}else{var _0xda92cf=this;var _0x595ee1=apiai(_0x40bb15[0x0],{'language':_0x40bb15[0x1]||'en'});return _0x595ee1[_0x5bea('0x26')](this[_0x5bea('0x27')][_0x5bea('0x1b')],{'sessionId':md5(this[_0x5bea('0x9')]['id'])})['then'](function(_0x406ac8){_0xda92cf['body'][_0x5bea('0x28')]=_0x406ac8;_0x4e793c['body']=_0x406ac8[_0x5bea('0x29')][_0x5bea('0x2a')][_0x5bea('0x2b')];_0x4e793c[_0x5bea('0x2c')]='dialogflow';_0x4e793c['providerResponse']=JSON['stringify'](_0x406ac8);return rpc[_0x15d0af+_0x5bea('0x1d')][_0x5bea('0x2d')](_0x4e793c)['then'](function(_0x4aa9a1){logger[_0x5bea('0xb')](_0x5bea('0x1f'),_0x487888,_0x4e793c['body']);if(_0x406ac8[_0x5bea('0x29')]['metadata']['endConversation']){_0x581c55[_0x5bea('0x2e')]();}else{_0x581c55[_0x5bea('0x25')]();}})[_0x5bea('0x20')](function(_0x102ffb){logger[_0x5bea('0x21')](_0x5bea('0x1f'),_0x487888,JSON[_0x5bea('0x2f')](_0x102ffb));_0x581c55[_0x5bea('0x2e')]();});})[_0x5bea('0x20')](function(_0x4c023f){logger['error'](_0x5bea('0x1f'),_0x487888,_0x4c023f[_0x5bea('0x27')]);_0x581c55[_0x5bea('0x2e')]();});}}catch(_0x26840e){logger['error'](_0x5bea('0x1f'),_0x487888,JSON[_0x5bea('0x2f')](_0x26840e));_0x581c55[_0x5bea('0x25')]();}};}; \ No newline at end of file +var _0x1b94=['phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','Message','create','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','body','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','endConversation','error','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','channel'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x1b94,0x1f2));var _0x41b9=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x1b94[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x41b9('0x0'));var moment=require(_0x41b9('0x1'));var apiai=require(_0x41b9('0x2'));var md5=require(_0x41b9('0x3'));var utils=require(_0x41b9('0x4'));var logger=require('../../../../config/logger')(_0x41b9('0x5'));var rpc={'chatMessage':require(_0x41b9('0x6')),'openchannelMessage':require(_0x41b9('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x41b9('0x8')),'faxMessage':require(_0x41b9('0x9')),'whatsappMessage':require(_0x41b9('0xa'))};exports['consequence']=function(_0x310fd8,_0x3e9325){return function(_0x2a0eed){try{if(!_[_0x41b9('0xb')](this[_0x41b9('0xc')]['UserId'])){logger[_0x41b9('0xd')](_0x41b9('0xe'),_0x310fd8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2a0eed[_0x41b9('0xf')]();}var _0x386807={'ContactId':this['contact']['id'],'sentAt':moment()[_0x41b9('0x10')](_0x41b9('0x11')),'direction':'out'};if(this[_0x41b9('0x12')]==='sms'||this[_0x41b9('0x12')]==='whatsapp'){_0x386807[_0x41b9('0x13')]=this[_0x41b9('0xc')][_0x41b9('0x13')];}var _0x1b33c7=this[_0x41b9('0x12')];if(_0x1b33c7==='chat'){_0x386807[_0x41b9('0x14')]=this[_0x41b9('0x15')]['id'];}else{_0x386807[_['upperFirst'](_0x1b33c7)+_0x41b9('0x16')]=this[_0x41b9('0x15')]['id'];}_0x386807[_[_0x41b9('0x17')](_0x1b33c7)+_0x41b9('0x18')]=this['interaction']['id'];if(this['interaction']['created']){var _0x2d7bf0=_0x3e9325[0x2];if(!_[_0x41b9('0x19')](_0x2d7bf0)){_0x386807['body']=utils['getMustacheRender'](_0x2d7bf0,this);return rpc[_0x1b33c7+_0x41b9('0x1a')][_0x41b9('0x1b')](_0x386807)[_0x41b9('0x1c')](function(_0x3ba9f3){logger[_0x41b9('0xd')](_0x41b9('0xe'),_0x310fd8,_0x386807['body']);})[_0x41b9('0x1d')](function(_0x12cab8){logger['error'](_0x41b9('0xe'),_0x310fd8,JSON[_0x41b9('0x1e')](_0x12cab8));})[_0x41b9('0x1f')](function(){logger[_0x41b9('0xd')](_0x41b9('0x20'),_0x310fd8);_0x2a0eed[_0x41b9('0x21')]();});}else{logger['info'](_0x41b9('0x22'),_0x310fd8);_0x2a0eed['stop']();}}else{var _0x319452=this;var _0x14dc16=apiai(_0x3e9325[0x0],{'language':_0x3e9325[0x1]||'en'});return _0x14dc16[_0x41b9('0x23')](this[_0x41b9('0x24')][_0x41b9('0x25')],{'sessionId':md5(this['interaction']['id'])})[_0x41b9('0x1c')](function(_0x50e26b){_0x319452['body']['dialogflow']=_0x50e26b;_0x386807[_0x41b9('0x25')]=_0x50e26b[_0x41b9('0x26')][_0x41b9('0x27')][_0x41b9('0x28')];_0x386807[_0x41b9('0x29')]=_0x41b9('0x2a');_0x386807[_0x41b9('0x2b')]=JSON[_0x41b9('0x1e')](_0x50e26b);return rpc[_0x1b33c7+_0x41b9('0x1a')]['create'](_0x386807)['then'](function(_0x1a3aee){logger[_0x41b9('0xd')](_0x41b9('0xe'),_0x310fd8,_0x386807[_0x41b9('0x25')]);if(_0x50e26b[_0x41b9('0x26')][_0x41b9('0x2c')][_0x41b9('0x2d')]){_0x2a0eed[_0x41b9('0xf')]();}else{_0x2a0eed['stop']();}})['catch'](function(_0x1ae013){logger['error'](_0x41b9('0xe'),_0x310fd8,JSON['stringify'](_0x1ae013));_0x2a0eed[_0x41b9('0xf')]();});})[_0x41b9('0x1d')](function(_0x4be093){logger['error'](_0x41b9('0xe'),_0x310fd8,_0x4be093[_0x41b9('0x24')]);_0x2a0eed['next']();});}}catch(_0x18c95b){logger[_0x41b9('0x2e')]('[%s][DIALOGFLOW]\x20%s',_0x310fd8,JSON[_0x41b9('0x1e')](_0x18c95b));_0x2a0eed['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 7784a51..1db3e5d 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7073=['../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','then','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','diagnosticInfo','fields','queryResult','end_conversation','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','dialogflowV2','providerResponse','push','fulfillmentText','lodash','dialogflow','moment','bluebird'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x7073,0x114));var _0x3707=function(_0x3361f8,_0x2b1788){_0x3361f8=_0x3361f8-0x0;var _0xe53372=_0x7073[_0x3361f8];return _0xe53372;};'use strict';var _=require(_0x3707('0x0'));var dialogflow=require(_0x3707('0x1'));var md5=require('md5');var moment=require(_0x3707('0x2'));var Promise=require(_0x3707('0x3'));var logger=require(_0x3707('0x4'))(_0x3707('0x5'));var utils=require(_0x3707('0x6'));var rpc={'chatMessage':require(_0x3707('0x7')),'openchannelMessage':require(_0x3707('0x8')),'mailMessage':require(_0x3707('0x9')),'smsMessage':require(_0x3707('0xa')),'faxMessage':require(_0x3707('0xb')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x58a1ee,_0xccee62,_0x18b22f,_0x59873a){return new Promise(function(_0x43b580,_0x3942b6){var _0x1cec77=_[_0x3707('0xc')](_0x18b22f);_0x1cec77[_0x3707('0xd')]=_0x59873a;return rpc[_0xccee62+_0x3707('0xe')][_0x3707('0xf')](_0x1cec77)['then'](function(){logger[_0x3707('0x10')](_0x3707('0x11'),_0x58a1ee,_0x1cec77['body']);_0x43b580();})[_0x3707('0x12')](function(_0xe33778){logger['error'](_0x3707('0x11'),_0x58a1ee,JSON[_0x3707('0x13')](_0xe33778));_0x3942b6(_0xe33778);});});}exports[_0x3707('0x14')]=function(_0x439595,_0x349cd5){return function(_0x782969){try{if(!_['isNil'](this['interaction'][_0x3707('0x15')])){logger['info'](_0x3707('0x11'),_0x439595,_0x3707('0x16'));return _0x782969[_0x3707('0x17')]();}var _0x57099e={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3707('0x18')};if(this['channel']==='sms'||this[_0x3707('0x19')]===_0x3707('0x1a')){_0x57099e[_0x3707('0x1b')]=this[_0x3707('0x1c')][_0x3707('0x1b')];}var _0x46349b=this[_0x3707('0x19')];if(_0x46349b===_0x3707('0x1d')){_0x57099e[_0x3707('0x1e')]=this[_0x3707('0x1f')]['id'];}else{_0x57099e[_[_0x3707('0x20')](_0x46349b)+_0x3707('0x21')]=this[_0x3707('0x1f')]['id'];}_0x57099e[_[_0x3707('0x20')](_0x46349b)+_0x3707('0x22')]=this[_0x3707('0x1c')]['id'];if(this[_0x3707('0x1c')][_0x3707('0x23')]){var _0x2abf01=_0x349cd5[0x4];if(!_[_0x3707('0x24')](_0x2abf01)){_0x57099e[_0x3707('0xd')]=utils[_0x3707('0x25')](_0x2abf01,this);return rpc[_0x46349b+_0x3707('0xe')]['create'](_0x57099e)[_0x3707('0x26')](function(_0x2fdc0c){logger[_0x3707('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x439595,_0x57099e[_0x3707('0xd')]);})[_0x3707('0x12')](function(_0x4b721c){logger[_0x3707('0x27')](_0x3707('0x11'),_0x439595,JSON['stringify'](_0x4b721c));})[_0x3707('0x28')](function(){logger['info'](_0x3707('0x29'),_0x439595);_0x782969[_0x3707('0x2a')]();});}else{logger[_0x3707('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x439595);_0x782969[_0x3707('0x2a')]();}}else{var _0x3942b0=this;var _0x56f795=_0x349cd5[0x2][_0x3707('0x2b')](/\\n/g,'\x0a');var _0x19d5a2={'credentials':{'private_key':_0x56f795,'client_email':_0x349cd5[0x1]}};var _0x1b00a0=new dialogflow[(_0x3707('0x2c'))](_0x19d5a2);var _0x2b8001=_0x1b00a0[_0x3707('0x2d')](_0x349cd5[0x0],md5(_0x3942b0[_0x3707('0x1c')]['id']));var _0x486e23={'session':_0x2b8001,'queryInput':{'text':{'text':_0x3942b0[_0x3707('0x2e')][_0x3707('0xd')],'languageCode':_0x349cd5[0x3]||'en'}}};return _0x1b00a0[_0x3707('0x2f')](_0x486e23)['then'](function(_0x2f887b){if(_0x2f887b&&_0x2f887b[_0x3707('0x30')]){_0x3942b0[_0x3707('0xd')]['dialogflowV2']=_0x2f887b;var _0xc8d602=_0x2f887b[0x0];var _0x3d6c72=_0xc8d602['queryResult'][_0x3707('0x31')]&&_0xc8d602['queryResult'][_0x3707('0x31')][_0x3707('0x32')]?_0xc8d602[_0x3707('0x33')]['diagnosticInfo'][_0x3707('0x32')][_0x3707('0x34')][_0x3707('0x35')]:![];_0x3942b0[_0x3707('0xd')]['DIALOGFLOWV2_ACTION']=_0xc8d602[_0x3707('0x33')][_0x3707('0x36')];_0x3942b0[_0x3707('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0xc8d602[_0x3707('0x33')][_0x3707('0x37')];_0x3942b0[_0x3707('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0xc8d602[_0x3707('0x33')]['diagnosticInfo']&&_0xc8d602[_0x3707('0x33')]['diagnosticInfo'][_0x3707('0x32')]?_0xc8d602['queryResult'][_0x3707('0x31')][_0x3707('0x32')][_0x3707('0x34')][_0x3707('0x35')]:![];_0x3942b0[_0x3707('0xd')][_0x3707('0x38')]=_0xc8d602[_0x3707('0x33')][_0x3707('0x39')]['name'];_0x3942b0['body'][_0x3707('0x3a')]=_0xc8d602['queryResult'][_0x3707('0x39')][_0x3707('0x3b')];_0x3942b0['body'][_0x3707('0x3c')]=_0xc8d602['queryResult'][_0x3707('0x39')][_0x3707('0x3d')];_0x3942b0[_0x3707('0xd')]['DIALOGFLOWV2_LANGUAGECODE']=_0xc8d602[_0x3707('0x33')][_0x3707('0x3e')];_0x3942b0[_0x3707('0xd')][_0x3707('0x3f')]=_0xc8d602[_0x3707('0x33')][_0x3707('0x40')];_0x3942b0[_0x3707('0xd')][_0x3707('0x41')]=_0xc8d602['queryResult']['intentDetectionConfidence'];_0x57099e['providerName']=_0x3707('0x42');_0x57099e[_0x3707('0x43')]=JSON['stringify'](_0x2f887b);var _0x449c0b=[];for(var _0xbeb062=0x0;_0xbeb062<_0x2f887b['length'];_0xbeb062++){var _0x14a570=_0x2f887b[_0xbeb062];if(_0x14a570&&_0x14a570[_0x3707('0x33')]&&_0x14a570[_0x3707('0x33')]['fulfillmentText']){_0x449c0b[_0x3707('0x44')](createMessage(_0x439595,_0x46349b,_0x57099e,_0x14a570[_0x3707('0x33')][_0x3707('0x45')]));}}return Promise['all'](_0x449c0b)[_0x3707('0x26')](function(){if(_0x3d6c72){_0x782969['next']();}else{_0x782969['stop']();}})[_0x3707('0x12')](function(_0x21c9af){logger[_0x3707('0x27')](_0x3707('0x11'),_0x439595,JSON[_0x3707('0x13')](_0x21c9af));_0x782969[_0x3707('0x17')]();});}})[_0x3707('0x12')](function(_0x303d1e){logger[_0x3707('0x27')](_0x3707('0x11'),_0x439595,_0x303d1e['message']);_0x782969[_0x3707('0x17')]();});}}catch(_0x229e88){logger[_0x3707('0x27')](_0x3707('0x11'),_0x439595,JSON[_0x3707('0x13')](_0x229e88));_0x782969[_0x3707('0x2a')]();}};}; \ No newline at end of file +var _0xebf4=['boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','all','lodash','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation'];(function(_0x3fad18,_0x5d8c26){var _0x35ef22=function(_0x4d98b1){while(--_0x4d98b1){_0x3fad18['push'](_0x3fad18['shift']());}};_0x35ef22(++_0x5d8c26);}(_0xebf4,0xe3));var _0x4ebf=function(_0x2e8bce,_0x262370){_0x2e8bce=_0x2e8bce-0x0;var _0x3d1e2f=_0xebf4[_0x2e8bce];return _0x3d1e2f;};'use strict';var _=require(_0x4ebf('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require('moment');var Promise=require(_0x4ebf('0x1'));var logger=require(_0x4ebf('0x2'))('routing');var utils=require(_0x4ebf('0x3'));var rpc={'chatMessage':require(_0x4ebf('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4ebf('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4ebf('0x6'))};function createMessage(_0x4d2f74,_0x4ce322,_0x5b6a14,_0x4ac8e2){return new Promise(function(_0x45c96f,_0x173a8c){var _0x5cc1ab=_[_0x4ebf('0x7')](_0x5b6a14);_0x5cc1ab['body']=_0x4ac8e2;return rpc[_0x4ce322+_0x4ebf('0x8')][_0x4ebf('0x9')](_0x5cc1ab)[_0x4ebf('0xa')](function(){logger[_0x4ebf('0xb')](_0x4ebf('0xc'),_0x4d2f74,_0x5cc1ab[_0x4ebf('0xd')]);_0x45c96f();})[_0x4ebf('0xe')](function(_0x55b450){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x4d2f74,JSON[_0x4ebf('0xf')](_0x55b450));_0x173a8c(_0x55b450);});});}exports[_0x4ebf('0x10')]=function(_0x6039d9,_0x2e9b4c){return function(_0x76f93a){try{if(!_[_0x4ebf('0x11')](this['interaction'][_0x4ebf('0x12')])){logger[_0x4ebf('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x6039d9,_0x4ebf('0x13'));return _0x76f93a[_0x4ebf('0x14')]();}var _0x205cf={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x4ebf('0x15')),'direction':_0x4ebf('0x16')};if(this[_0x4ebf('0x17')]==='sms'||this[_0x4ebf('0x17')]===_0x4ebf('0x18')){_0x205cf[_0x4ebf('0x19')]=this[_0x4ebf('0x1a')]['phone'];}var _0x174763=this[_0x4ebf('0x17')];if(_0x174763===_0x4ebf('0x1b')){_0x205cf[_0x4ebf('0x1c')]=this[_0x4ebf('0x1d')]['id'];}else{_0x205cf[_['upperFirst'](_0x174763)+_0x4ebf('0x1e')]=this[_0x4ebf('0x1d')]['id'];}_0x205cf[_[_0x4ebf('0x1f')](_0x174763)+_0x4ebf('0x20')]=this[_0x4ebf('0x1a')]['id'];if(this['interaction'][_0x4ebf('0x21')]){var _0x1be515=_0x2e9b4c[0x4];if(!_[_0x4ebf('0x22')](_0x1be515)){_0x205cf[_0x4ebf('0xd')]=utils[_0x4ebf('0x23')](_0x1be515,this);return rpc[_0x174763+_0x4ebf('0x8')]['create'](_0x205cf)[_0x4ebf('0xa')](function(_0x2c8829){logger[_0x4ebf('0xb')](_0x4ebf('0xc'),_0x6039d9,_0x205cf[_0x4ebf('0xd')]);})[_0x4ebf('0xe')](function(_0x142ed6){logger[_0x4ebf('0x24')](_0x4ebf('0xc'),_0x6039d9,JSON[_0x4ebf('0xf')](_0x142ed6));})[_0x4ebf('0x25')](function(){logger[_0x4ebf('0xb')](_0x4ebf('0x26'),_0x6039d9);_0x76f93a[_0x4ebf('0x27')]();});}else{logger[_0x4ebf('0xb')](_0x4ebf('0x28'),_0x6039d9);_0x76f93a['stop']();}}else{var _0x235672=this;var _0x49c2df=_0x2e9b4c[0x2]['replace'](/\\n/g,'\x0a');var _0x3227b3={'credentials':{'private_key':_0x49c2df,'client_email':_0x2e9b4c[0x1]}};var _0x11a81f=new dialogflow['SessionsClient'](_0x3227b3);var _0x3d8d3b=_0x11a81f[_0x4ebf('0x29')](_0x2e9b4c[0x0],md5(_0x235672[_0x4ebf('0x1a')]['id']));var _0x3316cf={'session':_0x3d8d3b,'queryInput':{'text':{'text':_0x235672[_0x4ebf('0x2a')][_0x4ebf('0xd')],'languageCode':_0x2e9b4c[0x3]||'en'}}};return _0x11a81f[_0x4ebf('0x2b')](_0x3316cf)[_0x4ebf('0xa')](function(_0x2ae72f){if(_0x2ae72f&&_0x2ae72f['length']){_0x235672[_0x4ebf('0xd')][_0x4ebf('0x2c')]=_0x2ae72f;var _0x3725ae=_0x2ae72f[0x0];var _0x4173ef=_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x2e')]&&_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x2e')]['fields']?_0x3725ae[_0x4ebf('0x2d')]['diagnosticInfo'][_0x4ebf('0x2f')][_0x4ebf('0x30')][_0x4ebf('0x31')]:![];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x32')]=_0x3725ae[_0x4ebf('0x2d')]['action'];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x33')]=_0x3725ae['queryResult']['allRequiredParamsPresent'];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x34')]=_0x3725ae[_0x4ebf('0x2d')]['diagnosticInfo']&&_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x2e')]['fields']?_0x3725ae[_0x4ebf('0x2d')]['diagnosticInfo']['fields'][_0x4ebf('0x30')][_0x4ebf('0x31')]:![];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x35')]=_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x36')][_0x4ebf('0x37')];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x38')]=_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x36')]['displayName'];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x39')]=_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x36')]['isFallback'];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x3a')]=_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x3b')];_0x235672['body'][_0x4ebf('0x3c')]=_0x3725ae['queryResult'][_0x4ebf('0x3d')];_0x235672[_0x4ebf('0xd')][_0x4ebf('0x3e')]=_0x3725ae[_0x4ebf('0x2d')][_0x4ebf('0x3f')];_0x205cf[_0x4ebf('0x40')]=_0x4ebf('0x2c');_0x205cf[_0x4ebf('0x41')]=JSON[_0x4ebf('0xf')](_0x2ae72f);var _0x5a16b9=[];for(var _0xd18b94=0x0;_0xd18b94<_0x2ae72f[_0x4ebf('0x42')];_0xd18b94++){var _0xc2958d=_0x2ae72f[_0xd18b94];if(_0xc2958d&&_0xc2958d[_0x4ebf('0x2d')]&&_0xc2958d[_0x4ebf('0x2d')][_0x4ebf('0x43')]){_0x5a16b9['push'](createMessage(_0x6039d9,_0x174763,_0x205cf,_0xc2958d[_0x4ebf('0x2d')][_0x4ebf('0x43')]));}}return Promise[_0x4ebf('0x44')](_0x5a16b9)[_0x4ebf('0xa')](function(){if(_0x4173ef){_0x76f93a[_0x4ebf('0x14')]();}else{_0x76f93a[_0x4ebf('0x27')]();}})[_0x4ebf('0xe')](function(_0xfabe8e){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x6039d9,JSON[_0x4ebf('0xf')](_0xfabe8e));_0x76f93a[_0x4ebf('0x14')]();});}})['catch'](function(_0x5f4979){logger[_0x4ebf('0x24')](_0x4ebf('0xc'),_0x6039d9,_0x5f4979[_0x4ebf('0x2a')]);_0x76f93a[_0x4ebf('0x14')]();});}}catch(_0x9c4f9b){logger[_0x4ebf('0x24')](_0x4ebf('0xc'),_0x6039d9,JSON[_0x4ebf('0xf')](_0x9c4f9b));_0x76f93a[_0x4ebf('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index be0707f..1b6b606 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf09=['[%s][GOTOIF]\x20%s','validate','html-to-text','./utils','routing','string','number','consequence','fromString','getMustacheRender','error','map','message','condition','priorityTrue','priorityFalse','info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdf09,0xbe));var _0x9df0=function(_0xa432a8,_0x14f647){_0xa432a8=_0xa432a8-0x0;var _0x2cb34e=_0xdf09[_0xa432a8];return _0x2cb34e;};'use strict';var schema=require(_0x9df0('0x0'));var _=require('lodash');var htmlToText=require(_0x9df0('0x1'));var utils=require(_0x9df0('0x2'));var logger=require('../../../../config/logger')(_0x9df0('0x3'));var gotoif=schema({'condition':{'type':_0x9df0('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x9df0('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x9df0('0x6')]=function(_0x45622d,_0x17c951){return function(_0x526fd5){try{var _0x10264d={'condition':htmlToText[_0x9df0('0x7')](utils[_0x9df0('0x8')](_0x17c951[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x17c951[0x1],'priorityFalse':_0x17c951[0x2]};var _0x5474a0=gotoif['validate'](_0x10264d,{'typecast':!![]});if(_0x5474a0['length']){logger[_0x9df0('0x9')]('[%s][GOTOIF]\x20%s',_0x45622d,_[_0x9df0('0xa')](_0x5474a0,_0x9df0('0xb'))['join'](',\x20'));_0x526fd5['stop']();}else{try{var _0x28cecd=eval('('+_0x10264d[_0x9df0('0xc')]+')');var _0x42488b=_0x28cecd?_0x10264d[_0x9df0('0xd')]:_0x10264d[_0x9df0('0xe')];logger[_0x9df0('0xf')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x45622d,_0x10264d[_0x9df0('0xc')],_0x28cecd,_0x42488b||_0x9df0('0x10'));if(_0x42488b){var _0x3b8ad8=_[_0x9df0('0x11')](_0x526fd5['rules'](),{'p':_0x42488b});if(_0x3b8ad8>=0x0){logger[_0x9df0('0xf')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x45622d,_0x42488b||'next',_0x3b8ad8);_0x526fd5['next'](_0x3b8ad8);}else{logger[_0x9df0('0xf')](_0x9df0('0x12'),_0x45622d,_0x42488b||_0x9df0('0x10'));_0x526fd5[_0x9df0('0x13')]();}}else{_0x526fd5['next']();}}catch(_0x384dd7){logger[_0x9df0('0x9')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x45622d,_0x384dd7[_0x9df0('0xb')]);_0x526fd5[_0x9df0('0x13')]();}}}catch(_0x41e1b7){logger[_0x9df0('0x9')](_0x9df0('0x14'),_0x45622d,JSON['stringify'](_0x41e1b7));_0x526fd5[_0x9df0('0x13')]();}};}; \ No newline at end of file +var _0x64f6=['map','message','join','stop','condition','priorityFalse','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','error','stringify','validate','html-to-text','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','[%s][GOTOIF]\x20%s'];(function(_0x62cfe,_0x894025){var _0x3ecfda=function(_0x3169d0){while(--_0x3169d0){_0x62cfe['push'](_0x62cfe['shift']());}};_0x3ecfda(++_0x894025);}(_0x64f6,0xc5));var _0x664f=function(_0x1f20d6,_0x1b4431){_0x1f20d6=_0x1f20d6-0x0;var _0x2a7f7f=_0x64f6[_0x1f20d6];return _0x2a7f7f;};'use strict';var schema=require(_0x664f('0x0'));var _=require('lodash');var htmlToText=require(_0x664f('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x664f('0x2'));var gotoif=schema({'condition':{'type':_0x664f('0x3'),'required':!![],'message':_0x664f('0x4')},'priorityTrue':{'type':'number','message':_0x664f('0x5')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x664f('0x6')]=function(_0x5ad9e2,_0x1f0c2e){return function(_0x21d787){try{var _0x49bd5a={'condition':htmlToText[_0x664f('0x7')](utils[_0x664f('0x8')](_0x1f0c2e[0x0],this),{'wordwrap':![]})[_0x664f('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1f0c2e[0x1],'priorityFalse':_0x1f0c2e[0x2]};var _0x29b364=gotoif['validate'](_0x49bd5a,{'typecast':!![]});if(_0x29b364['length']){logger['error'](_0x664f('0xa'),_0x5ad9e2,_[_0x664f('0xb')](_0x29b364,_0x664f('0xc'))[_0x664f('0xd')](',\x20'));_0x21d787[_0x664f('0xe')]();}else{try{var _0x1e3191=eval('('+_0x49bd5a[_0x664f('0xf')]+')');var _0x3226cf=_0x1e3191?_0x49bd5a['priorityTrue']:_0x49bd5a[_0x664f('0x10')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5ad9e2,_0x49bd5a['condition'],_0x1e3191,_0x3226cf||_0x664f('0x11'));if(_0x3226cf){var _0x4152b3=_[_0x664f('0x12')](_0x21d787[_0x664f('0x13')](),{'p':_0x3226cf});if(_0x4152b3>=0x0){logger[_0x664f('0x14')](_0x664f('0x15'),_0x5ad9e2,_0x3226cf||'next',_0x4152b3);_0x21d787['next'](_0x4152b3);}else{logger[_0x664f('0x14')](_0x664f('0x16'),_0x5ad9e2,_0x3226cf||'next');_0x21d787['stop']();}}else{_0x21d787[_0x664f('0x11')]();}}catch(_0x456771){logger['error'](_0x664f('0x17'),_0x5ad9e2,_0x456771[_0x664f('0xc')]);_0x21d787[_0x664f('0xe')]();}}}catch(_0x3ddaa4){logger[_0x664f('0x18')]('[%s][GOTOIF]\x20%s',_0x5ad9e2,JSON[_0x664f('0x19')](_0x3ddaa4));_0x21d787['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 58dce87..5410282 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 _0x153d=['error','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length'];(function(_0x4efd59,_0x178fe0){var _0x4cd142=function(_0x3d1032){while(--_0x3d1032){_0x4efd59['push'](_0x4efd59['shift']());}};_0x4cd142(++_0x178fe0);}(_0x153d,0x1f0));var _0xd153=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x153d[_0x6cf19c];return _0xce14f3;};'use strict';var schema=require('validate');var _=require(_0xd153('0x0'));var logger=require(_0xd153('0x1'))(_0xd153('0x2'));var gotop=schema({'priority':{'type':_0xd153('0x3'),'required':!![],'message':_0xd153('0x4')}});exports[_0xd153('0x5')]=function(_0x1854f8,_0x6618e0){return function(_0x4d094c){try{var _0x461f30={'priority':_0x6618e0[0x0]};var _0x186d94=gotop[_0xd153('0x6')](_0x461f30,{'typecast':!![]});if(_0x186d94[_0xd153('0x7')]){logger[_0xd153('0x8')]('[%s][GOTOP]\x20%s',_0x1854f8,_['map'](_0x186d94,_0xd153('0x9'))[_0xd153('0xa')](',\x20'));_0x4d094c[_0xd153('0xb')]();}else{logger[_0xd153('0xc')](_0xd153('0xd'),_0x1854f8,_0x461f30[_0xd153('0xe')]);if(_0x461f30['priority']){var _0x3ac29c=_['findIndex'](_0x4d094c[_0xd153('0xf')](),{'p':_0x461f30[_0xd153('0xe')]});if(_0x3ac29c>=0x0){logger['info'](_0xd153('0x10'),_0x1854f8,_0x461f30[_0xd153('0xe')]||_0xd153('0x11'),_0x3ac29c);_0x4d094c[_0xd153('0x11')](_0x3ac29c);}else{logger[_0xd153('0xc')](_0xd153('0x12'),_0x1854f8,_0x461f30[_0xd153('0xe')]||_0xd153('0x11'));_0x4d094c[_0xd153('0xb')]();}}else{_0x4d094c['next']();}}}catch(_0x5d5657){logger['error'](_0xd153('0x13'),_0x1854f8,JSON[_0xd153('0x14')](_0x5d5657));_0x4d094c['stop']();}};}; \ No newline at end of file +var _0x37f0=['validate','lodash','number','consequence','error','[%s][GOTOP]\x20%s','message','stop','info','[%s][GOTOP]\x20priority\x20%s','findIndex','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify'];(function(_0xf8e464,_0x2d6c3c){var _0x160d8d=function(_0x284876){while(--_0x284876){_0xf8e464['push'](_0xf8e464['shift']());}};_0x160d8d(++_0x2d6c3c);}(_0x37f0,0x1a9));var _0x037f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x37f0[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require(_0x037f('0x0'));var _=require(_0x037f('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x037f('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x037f('0x3')]=function(_0x373e0d,_0x29793f){return function(_0x108a22){try{var _0x5ca0a4={'priority':_0x29793f[0x0]};var _0x4d5e87=gotop[_0x037f('0x0')](_0x5ca0a4,{'typecast':!![]});if(_0x4d5e87['length']){logger[_0x037f('0x4')](_0x037f('0x5'),_0x373e0d,_['map'](_0x4d5e87,_0x037f('0x6'))['join'](',\x20'));_0x108a22[_0x037f('0x7')]();}else{logger[_0x037f('0x8')](_0x037f('0x9'),_0x373e0d,_0x5ca0a4['priority']);if(_0x5ca0a4['priority']){var _0x13371b=_[_0x037f('0xa')](_0x108a22[_0x037f('0xb')](),{'p':_0x5ca0a4[_0x037f('0xc')]});if(_0x13371b>=0x0){logger[_0x037f('0x8')](_0x037f('0xd'),_0x373e0d,_0x5ca0a4[_0x037f('0xc')]||'next',_0x13371b);_0x108a22[_0x037f('0xe')](_0x13371b);}else{logger[_0x037f('0x8')](_0x037f('0xf'),_0x373e0d,_0x5ca0a4[_0x037f('0xc')]||_0x037f('0xe'));_0x108a22['stop']();}}else{_0x108a22['next']();}}}catch(_0x5a0411){logger[_0x037f('0x4')](_0x037f('0x5'),_0x373e0d,JSON[_0x037f('0x10')](_0x5a0411));_0x108a22['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 1cd0a74..c0fa46e 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 _0x9c02=['account','upperFirst','channel','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/smsMessage','../../rpc/whatsappMessage','getMustacheRender','chat','ChatWebsiteId'];(function(_0x2cbd93,_0x27f7fe){var _0x544b4d=function(_0x3d3f9c){while(--_0x3d3f9c){_0x2cbd93['push'](_0x2cbd93['shift']());}};_0x544b4d(++_0x27f7fe);}(_0x9c02,0x196));var _0x29c0=function(_0x5950f4,_0x142596){_0x5950f4=_0x5950f4-0x0;var _0x428c69=_0x9c02[_0x5950f4];return _0x428c69;};'use strict';var _=require(_0x29c0('0x0'));var utils=require(_0x29c0('0x1'));var logger=require(_0x29c0('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x29c0('0x3')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x29c0('0x4'))};exports['consequence']=function(_0x14d17f,_0x4bc5cf){return function(_0x2fb607){try{var _0x308869={'body':utils[_0x29c0('0x5')](_0x4bc5cf[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x29c0('0x6')){_0x308869[_0x29c0('0x7')]=this[_0x29c0('0x8')]['id'];}else{_0x308869[_[_0x29c0('0x9')](this[_0x29c0('0xa')])+'AccountId']=this['account']['id'];}_0x308869[_[_0x29c0('0x9')](this['channel'])+_0x29c0('0xb')]=this[_0x29c0('0xc')]['id'];if(rpc[this[_0x29c0('0xa')]+_0x29c0('0xd')]){return rpc[this[_0x29c0('0xa')]+_0x29c0('0xd')]['create'](_0x308869)[_0x29c0('0xe')](function(_0x350922){logger[_0x29c0('0xf')](_0x29c0('0x10'),_0x14d17f,_0x308869[_0x29c0('0x11')]);_0x2fb607[_0x29c0('0x12')]();})[_0x29c0('0x13')](function(_0x2947da){logger[_0x29c0('0x14')](_0x29c0('0x10'),_0x14d17f,JSON[_0x29c0('0x15')](_0x2947da));_0x2fb607[_0x29c0('0x16')]();});}}catch(_0x235725){logger[_0x29c0('0x14')](_0x29c0('0x10'),_0x14d17f,JSON[_0x29c0('0x15')](_0x235725));_0x2fb607[_0x29c0('0x16')]();}};}; \ No newline at end of file +var _0x486e=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage'];(function(_0x559b38,_0x1ac810){var _0x472261=function(_0xf3d60){while(--_0xf3d60){_0x559b38['push'](_0x559b38['shift']());}};_0x472261(++_0x1ac810);}(_0x486e,0xb2));var _0xe486=function(_0x731aa2,_0x30a2de){_0x731aa2=_0x731aa2-0x0;var _0xf3690a=_0x486e[_0x731aa2];return _0xf3690a;};'use strict';var _=require(_0xe486('0x0'));var utils=require(_0xe486('0x1'));var logger=require('../../../../config/logger')(_0xe486('0x2'));var rpc={'chatMessage':require(_0xe486('0x3')),'openchannelMessage':require(_0xe486('0x4')),'mailMessage':require(_0xe486('0x5')),'smsMessage':require(_0xe486('0x6')),'faxMessage':require(_0xe486('0x7')),'whatsappMessage':require(_0xe486('0x8'))};exports[_0xe486('0x9')]=function(_0x37910f,_0x25034d){return function(_0x1bf55d){try{var _0x4fac5d={'body':utils[_0xe486('0xa')](_0x25034d[0x0],this),'ContactId':this[_0xe486('0xb')]['id']};if(this[_0xe486('0xc')]===_0xe486('0xd')){_0x4fac5d[_0xe486('0xe')]=this[_0xe486('0xf')]['id'];}else{_0x4fac5d[_[_0xe486('0x10')](this[_0xe486('0xc')])+'AccountId']=this['account']['id'];}_0x4fac5d[_[_0xe486('0x10')](this[_0xe486('0xc')])+_0xe486('0x11')]=this[_0xe486('0x12')]['id'];if(rpc[this[_0xe486('0xc')]+_0xe486('0x13')]){return rpc[this[_0xe486('0xc')]+_0xe486('0x13')][_0xe486('0x14')](_0x4fac5d)['then'](function(_0x5a1aad){logger[_0xe486('0x15')](_0xe486('0x16'),_0x37910f,_0x4fac5d[_0xe486('0x17')]);_0x1bf55d['next']();})['catch'](function(_0x339746){logger['error'](_0xe486('0x16'),_0x37910f,JSON[_0xe486('0x18')](_0x339746));_0x1bf55d[_0xe486('0x19')]();});}}catch(_0x355002){logger['error']('[%s][MESSAGE]\x20%s',_0x37910f,JSON[_0xe486('0x18')](_0x355002));_0x1bf55d[_0xe486('0x19')]();}};}; \ 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 2553927..5ccfaba 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 _0x9870=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x15f68f,_0x19b992){var _0x148f60=function(_0x58d06c){while(--_0x58d06c){_0x15f68f['push'](_0x15f68f['shift']());}};_0x148f60(++_0x19b992);}(_0x9870,0x88));var _0x0987=function(_0x5a3390,_0x4219ff){_0x5a3390=_0x5a3390-0x0;var _0x42213c=_0x9870[_0x5a3390];return _0x42213c;};'use strict';var utils=require(_0x0987('0x0'));var logger=require(_0x0987('0x1'))(_0x0987('0x2'));exports[_0x0987('0x3')]=function(_0x359a4e,_0x37a6f8){return function(_0x5cfd85){try{logger[_0x0987('0x4')](_0x0987('0x5'),_0x359a4e,utils[_0x0987('0x6')](_0x37a6f8[0x0],this));_0x5cfd85[_0x0987('0x7')]();}catch(_0x298c5f){logger['error']('[%s][NOOP]\x20%s',_0x359a4e,JSON[_0x0987('0x8')](_0x298c5f));_0x5cfd85[_0x0987('0x9')]();}};}; \ No newline at end of file +var _0xde7e=['error','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x548e1a,_0x5a44b8){var _0xf20a8c=function(_0x2ad4d1){while(--_0x2ad4d1){_0x548e1a['push'](_0x548e1a['shift']());}};_0xf20a8c(++_0x5a44b8);}(_0xde7e,0x69));var _0xede7=function(_0x199933,_0x238bf5){_0x199933=_0x199933-0x0;var _0x382ca0=_0xde7e[_0x199933];return _0x382ca0;};'use strict';var utils=require(_0xede7('0x0'));var logger=require(_0xede7('0x1'))(_0xede7('0x2'));exports[_0xede7('0x3')]=function(_0x1dce29,_0x2120c4){return function(_0xe81f2d){try{logger[_0xede7('0x4')](_0xede7('0x5'),_0x1dce29,utils[_0xede7('0x6')](_0x2120c4[0x0],this));_0xe81f2d['next']();}catch(_0x56d18a){logger[_0xede7('0x7')](_0xede7('0x5'),_0x1dce29,JSON['stringify'](_0x56d18a));_0xe81f2d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 8e3f41d..0083b03 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 _0x2a76=['routing','./strategy','redis','defaults','localhost','queue_id','account','from','clone','queue','%sQueuesWaitingInteractions','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger'];(function(_0xbf935b,_0x83f5e7){var _0x15b488=function(_0x389110){while(--_0x389110){_0xbf935b['push'](_0xbf935b['shift']());}};_0x15b488(++_0x83f5e7);}(_0x2a76,0xe9));var _0x62a7=function(_0x2a0bec,_0x1cab51){_0x2a0bec=_0x2a0bec-0x0;var _0xe48b0e=_0x2a76[_0x2a0bec];return _0xe48b0e;};'use strict';var schema=require(_0x62a7('0x0'));var _=require(_0x62a7('0x1'));var util=require(_0x62a7('0x2'));var seqqueue=require(_0x62a7('0x3'));var moment=require(_0x62a7('0x4'));var Redis=require('ioredis');var config=require(_0x62a7('0x5'));var logger=require(_0x62a7('0x6'))(_0x62a7('0x7'));var strategy=require(_0x62a7('0x8'));config[_0x62a7('0x9')]=_[_0x62a7('0xa')](config[_0x62a7('0x9')],{'host':_0x62a7('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x62a7('0x9')]));var attributes=['id',_0x62a7('0xc'),_0x62a7('0xd'),'queue',_0x62a7('0xe'),'joinAt'];function emit(_0x18dc9b,_0x49e4da,_0x4edf15){io['to'](_0x18dc9b)['emit'](_0x49e4da,_0x4edf15);}function emitChannelQueueInteraction(_0x229a65,_0x1b01f3,_0x3cfea1,_0x433caa,_0x300c99,_0x28818d,_0xdc22a2,_0x5361b8){var _0x225c46=_[_0x62a7('0xf')](_0x3cfea1);_0x225c46['queue_id']=_0x5361b8;_0x225c46[_0x62a7('0x10')]=_0x1b01f3;_0x225c46[_0x62a7('0xd')]=_0x433caa;_0x225c46['id']=_0x300c99;if(_0x28818d){_0xdc22a2[util['format'](_0x62a7('0x11'),_0x229a65)][_0x300c99]=_['pick'](_0x225c46,attributes);}else{delete _0xdc22a2[util[_0x62a7('0x12')](_0x62a7('0x11'),_0x229a65)][_0x300c99];}emit(util['format'](_0x62a7('0x13'),_0x229a65,_0x1b01f3),util[_0x62a7('0x12')](_0x62a7('0x14'),_0x229a65,_0x28818d?_0x62a7('0x15'):'remove'),_[_0x62a7('0x16')](_0x225c46,attributes));}var rpc={'openchannelQueueReport':require(_0x62a7('0x17')),'mailQueueReport':require(_0x62a7('0x18')),'chatQueueReport':require(_0x62a7('0x19')),'smsQueueReport':require(_0x62a7('0x1a')),'faxQueueReport':require(_0x62a7('0x1b')),'whatsappQueueReport':require(_0x62a7('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x62a7('0x1d')},'timeout':{'type':_0x62a7('0x1e'),'message':_0x62a7('0x1f')}});function startRouting(_0x4e071e,_0x1316c8,_0x2096f8,_0x11e14f){if(_0x4e071e&&_0x1316c8&&_0x2096f8){_0x1316c8[_0x62a7('0x20')]+=0x1;var _0x47a530={'uniqueid':_0x4e071e,'from':_0x2096f8[_0x62a7('0x21')]?_0x2096f8['body'][_0x62a7('0xe')]:'','joinAt':moment()[_0x62a7('0x12')](_0x62a7('0x22')),'ContactId':_0x2096f8[_0x62a7('0x23')]?_0x2096f8[_0x62a7('0x23')]['id']:null,'ListId':_0x2096f8[_0x62a7('0x24')]?_0x2096f8[_0x62a7('0x24')]['id']:null};_0x47a530[_[_0x62a7('0x25')](_0x2096f8[_0x62a7('0x26')])+_0x62a7('0x27')]=_0x1316c8['id']||null;_0x47a530[_['upperFirst'](_0x2096f8[_0x62a7('0x26')])+'InteractionId']=_0x2096f8[_0x62a7('0x28')]?_0x2096f8[_0x62a7('0x28')]['id']:null;_0x47a530[_['upperFirst'](_0x2096f8['channel'])+'MessageId']=_0x2096f8[_0x62a7('0x29')]?_0x2096f8[_0x62a7('0x29')]['id']:null;_0x47a530[_['upperFirst'](_0x2096f8[_0x62a7('0x26')])+(_0x2096f8[_0x62a7('0x26')]!==_0x62a7('0x2a')?_0x62a7('0x2b'):_0x62a7('0x2c'))]=_0x2096f8[_0x62a7('0xd')]?_0x2096f8[_0x62a7('0xd')]['id']:null;logger[_0x62a7('0x2d')](util[_0x62a7('0x12')](_0x62a7('0x2e'),_0x4e071e,_0x1316c8['name']));emitChannelQueueInteraction(_0x2096f8[_0x62a7('0x26')],_0x1316c8[_0x62a7('0x2f')],_0x47a530,_0x2096f8[_0x62a7('0xd')][_0x62a7('0x2f')],_0x2096f8[_0x62a7('0x29')]['id'],!![],_0x11e14f,_0x1316c8['id']);if(rpc[_0x2096f8[_0x62a7('0x26')]+_0x62a7('0x30')]){return rpc[_0x2096f8[_0x62a7('0x26')]+_0x62a7('0x30')][_0x62a7('0x31')](_0x47a530)['catch'](function(_0x12d1f2){logger[_0x62a7('0x32')](_0x62a7('0x33'));});}}}function stopRouting(_0x3130ae,_0x295b00,_0x42f1e9,_0x350c26){if(_0x3130ae&&_0x295b00){_0x295b00[_0x62a7('0x20')]-=0x1;var _0x2d6ce6={'leaveAt':moment()[_0x62a7('0x12')](_0x62a7('0x22')),'acceptAt':moment()['format'](_0x62a7('0x22')),'reason':_0x62a7('0x34')};logger['info'](util[_0x62a7('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x3130ae,_0x295b00[_0x62a7('0x2f')]));emitChannelQueueInteraction(_0x42f1e9[_0x62a7('0x26')],_0x295b00[_0x62a7('0x2f')],_0x42f1e9[_0x62a7('0x21')],_0x42f1e9[_0x62a7('0xd')][_0x62a7('0x2f')],_0x42f1e9[_0x62a7('0x29')]['id'],![],_0x350c26,_0x295b00['id']);if(rpc[_0x42f1e9[_0x62a7('0x26')]+_0x62a7('0x30')]){return rpc[_0x42f1e9[_0x62a7('0x26')]+_0x62a7('0x30')][_0x62a7('0x35')](_0x3130ae,_0x2d6ce6)[_0x62a7('0x36')](function(_0x15d510){logger['error'](_0x62a7('0x37'));});}}}function endRouting(_0x2ff20a,_0x22f226,_0x1c21f9,_0x195973){if(_0x2ff20a&&_0x22f226){_0x22f226['waiting']-=0x1;var _0x135070={'leaveAt':moment()[_0x62a7('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x62a7('0x12')](_0x62a7('0x22')),'reason':_0x62a7('0x38')};logger[_0x62a7('0x2d')](util[_0x62a7('0x12')](_0x62a7('0x39'),_0x2ff20a,_0x22f226['name']));emitChannelQueueInteraction(_0x1c21f9[_0x62a7('0x26')],_0x22f226['name'],_0x1c21f9[_0x62a7('0x21')],_0x1c21f9[_0x62a7('0xd')][_0x62a7('0x2f')],_0x1c21f9['message']['id'],![],_0x195973);if(rpc[_0x1c21f9[_0x62a7('0x26')]+_0x62a7('0x30')]){return rpc[_0x1c21f9['channel']+'QueueReport']['update'](_0x2ff20a,_0x135070)[_0x62a7('0x36')](function(_0x2a1bbd){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x5d6eae){return function(_0x1dd47e){return _0x1dd47e[_0x62a7('0x2f')][_0x62a7('0x3a')]()===_0x5d6eae[_0x62a7('0x3a')]();};}exports[_0x62a7('0x3b')]=function(_0x1fc38,_0x813c4d,_0x1e22c6,_0xcb326b){return function(_0x3d5d42){try{var _0x561ad1={'name':_0x813c4d[0x0],'timeout':_0x813c4d[0x1]};var _0x1d05b2=queue['validate'](_0x561ad1,{'typecast':!![]});if(_0x1d05b2[_0x62a7('0x3c')]){logger['error'](_0x62a7('0x3d'),_0x1fc38,_[_0x62a7('0x3e')](_0x1d05b2,_0x62a7('0x29'))[_0x62a7('0x3f')](',\x20'));_0x3d5d42[_0x62a7('0x40')]();}else{var _0x229647=_[_0x62a7('0x41')](_0x1e22c6[_0xcb326b['channel']+_0x62a7('0x42')],handleFindQueue(_0x561ad1[_0x62a7('0x2f')]));if(_0x229647){startRouting(_0x1fc38,_0x229647,_0xcb326b,_0x1e22c6);var _0xc989af=(_0x229647[_0x62a7('0x38')]||0xa)*0x3e8;var _0x30eb0d=(_0x561ad1[_0x62a7('0x38')]||0x14)*0x3e8;var _0x23f53a,_0x34e7eb;if(_0xc989af>_0x30eb0d){_0x30eb0d=_0xc989af;}var _0x3d20e0=seqqueue[_0x62a7('0x43')](_0xc989af);_0x3d20e0['id']=_0x1fc38;_0x3d20e0[_0x62a7('0x44')]=_0xc989af;_0x3d20e0[_0x62a7('0x45')]=_0x30eb0d;_0x3d20e0[_0x62a7('0x26')]=_0xcb326b[_0x62a7('0x26')];_0x1e22c6[_0x62a7('0x46')][_0x1fc38]['on'](_0x62a7('0x47'),function(){logger[_0x62a7('0x2d')](_0x62a7('0x48'),_0x1fc38);stopRouting(_0x1fc38,_0x229647,_0xcb326b,_0x1e22c6);clearTimeout(_0x23f53a);_0x23f53a=undefined;_0x3d20e0[_0x62a7('0x49')](!![]);if(_0x1e22c6[_0x62a7('0x46')][_0x1fc38]){delete _0x1e22c6[_0x62a7('0x46')][_0x1fc38];}_0x3d5d42['stop']();});_0x1e22c6[_0x62a7('0x46')][_0x1fc38]['on'](_0x62a7('0x4a'),function(){if(_0x1e22c6[_0x62a7('0x46')][_0x1fc38]){delete _0x1e22c6[_0x62a7('0x46')][_0x1fc38];}});_0x23f53a=setTimeout(function(){logger[_0x62a7('0x2d')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x1fc38);endRouting(_0x1fc38,_0x229647,_0xcb326b,_0x1e22c6);clearTimeout(_0x23f53a);_0x3d20e0[_0x62a7('0x49')](!![]);_0x3d5d42[_0x62a7('0x4b')]();},_0x30eb0d);switch(_0x229647['strategy']){case'rrmemory':strategy[_0x62a7('0x4c')](_0x3d20e0,_0x229647,_0x1e22c6,_0xcb326b);break;default:strategy[_0x62a7('0x4d')](_0x3d20e0,_0x229647,_0x1e22c6,_0xcb326b);}}else{logger[_0x62a7('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1fc38,_0x561ad1[_0x62a7('0x2f')]);_0x3d5d42[_0x62a7('0x40')]();}}}catch(_0x5bf381){console[_0x62a7('0x4e')](_0x5bf381);logger[_0x62a7('0x32')](_0x62a7('0x3d'),_0x1fc38,_0x5bf381[_0x62a7('0x4f')]);_0x3d5d42[_0x62a7('0x40')]();}};}; \ No newline at end of file +var _0x83d9=['rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','from','joinAt','emit','queue','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','validate','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','createQueue','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83d9,0x134));var _0x983d=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x83d9[_0x55abd9];return _0x3e5669;};'use strict';var schema=require('validate');var _=require(_0x983d('0x0'));var util=require(_0x983d('0x1'));var seqqueue=require(_0x983d('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x983d('0x3'))(_0x983d('0x4'));var strategy=require(_0x983d('0x5'));config[_0x983d('0x6')]=_[_0x983d('0x7')](config[_0x983d('0x6')],{'host':_0x983d('0x8'),'port':0x18eb});var io=require(_0x983d('0x9'))(new Redis(config[_0x983d('0x6')]));var attributes=['id',_0x983d('0xa'),'account','queue',_0x983d('0xb'),_0x983d('0xc')];function emit(_0x5ea70f,_0x1b201e,_0x199605){io['to'](_0x5ea70f)[_0x983d('0xd')](_0x1b201e,_0x199605);}function emitChannelQueueInteraction(_0x4caedc,_0x198b4e,_0x3a4d2b,_0x36f130,_0x586c25,_0x5c1fbc,_0x48c409,_0x212e9c){var _0x47c3f7=_['clone'](_0x3a4d2b);_0x47c3f7['queue_id']=_0x212e9c;_0x47c3f7[_0x983d('0xe')]=_0x198b4e;_0x47c3f7[_0x983d('0xf')]=_0x36f130;_0x47c3f7['id']=_0x586c25;if(_0x5c1fbc){_0x48c409[util[_0x983d('0x10')](_0x983d('0x11'),_0x4caedc)][_0x586c25]=_[_0x983d('0x12')](_0x47c3f7,attributes);}else{delete _0x48c409[util[_0x983d('0x10')](_0x983d('0x11'),_0x4caedc)][_0x586c25];}emit(util['format'](_0x983d('0x13'),_0x4caedc,_0x198b4e),util['format'](_0x983d('0x14'),_0x4caedc,_0x5c1fbc?_0x983d('0x15'):_0x983d('0x16')),_['pick'](_0x47c3f7,attributes));}var rpc={'openchannelQueueReport':require(_0x983d('0x17')),'mailQueueReport':require(_0x983d('0x18')),'chatQueueReport':require(_0x983d('0x19')),'smsQueueReport':require(_0x983d('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x983d('0x1b'),'required':!![],'message':_0x983d('0x1c')},'timeout':{'type':'number','message':_0x983d('0x1d')}});function startRouting(_0xb84d59,_0x13590e,_0x23c0bf,_0x4108c0){if(_0xb84d59&&_0x13590e&&_0x23c0bf){_0x13590e[_0x983d('0x1e')]+=0x1;var _0x4c19a0={'uniqueid':_0xb84d59,'from':_0x23c0bf[_0x983d('0x1f')]?_0x23c0bf[_0x983d('0x1f')][_0x983d('0xb')]:'','joinAt':moment()[_0x983d('0x10')](_0x983d('0x20')),'ContactId':_0x23c0bf[_0x983d('0x21')]?_0x23c0bf[_0x983d('0x21')]['id']:null,'ListId':_0x23c0bf[_0x983d('0x22')]?_0x23c0bf['list']['id']:null};_0x4c19a0[_[_0x983d('0x23')](_0x23c0bf[_0x983d('0x24')])+_0x983d('0x25')]=_0x13590e['id']||null;_0x4c19a0[_['upperFirst'](_0x23c0bf[_0x983d('0x24')])+'InteractionId']=_0x23c0bf[_0x983d('0x26')]?_0x23c0bf[_0x983d('0x26')]['id']:null;_0x4c19a0[_[_0x983d('0x23')](_0x23c0bf[_0x983d('0x24')])+_0x983d('0x27')]=_0x23c0bf[_0x983d('0x28')]?_0x23c0bf[_0x983d('0x28')]['id']:null;_0x4c19a0[_[_0x983d('0x23')](_0x23c0bf['channel'])+(_0x23c0bf['channel']!=='chat'?'AccountId':_0x983d('0x29'))]=_0x23c0bf['account']?_0x23c0bf[_0x983d('0xf')]['id']:null;logger[_0x983d('0x2a')](util['format'](_0x983d('0x2b'),_0xb84d59,_0x13590e[_0x983d('0x2c')]));emitChannelQueueInteraction(_0x23c0bf[_0x983d('0x24')],_0x13590e[_0x983d('0x2c')],_0x4c19a0,_0x23c0bf[_0x983d('0xf')][_0x983d('0x2c')],_0x23c0bf[_0x983d('0x28')]['id'],!![],_0x4108c0,_0x13590e['id']);if(rpc[_0x23c0bf[_0x983d('0x24')]+_0x983d('0x2d')]){return rpc[_0x23c0bf[_0x983d('0x24')]+_0x983d('0x2d')][_0x983d('0x2e')](_0x4c19a0)['catch'](function(_0x39209b){logger[_0x983d('0x2f')](_0x983d('0x30'));});}}}function stopRouting(_0x1f1116,_0x55bbe7,_0x37f2b4,_0x47a303){if(_0x1f1116&&_0x55bbe7){_0x55bbe7[_0x983d('0x1e')]-=0x1;var _0x631435={'leaveAt':moment()['format'](_0x983d('0x20')),'acceptAt':moment()[_0x983d('0x10')](_0x983d('0x20')),'reason':'accepted'};logger['info'](util[_0x983d('0x10')](_0x983d('0x31'),_0x1f1116,_0x55bbe7[_0x983d('0x2c')]));emitChannelQueueInteraction(_0x37f2b4[_0x983d('0x24')],_0x55bbe7['name'],_0x37f2b4[_0x983d('0x1f')],_0x37f2b4[_0x983d('0xf')][_0x983d('0x2c')],_0x37f2b4[_0x983d('0x28')]['id'],![],_0x47a303,_0x55bbe7['id']);if(rpc[_0x37f2b4[_0x983d('0x24')]+_0x983d('0x2d')]){return rpc[_0x37f2b4['channel']+_0x983d('0x2d')][_0x983d('0x32')](_0x1f1116,_0x631435)[_0x983d('0x33')](function(_0x1681fa){logger[_0x983d('0x2f')](_0x983d('0x34'));});}}}function endRouting(_0x33b034,_0xc1c9bf,_0x4f9a04,_0x587d96){if(_0x33b034&&_0xc1c9bf){_0xc1c9bf[_0x983d('0x1e')]-=0x1;var _0x4f0b9b={'leaveAt':moment()[_0x983d('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x983d('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x983d('0x2a')](util[_0x983d('0x10')](_0x983d('0x35'),_0x33b034,_0xc1c9bf[_0x983d('0x2c')]));emitChannelQueueInteraction(_0x4f9a04[_0x983d('0x24')],_0xc1c9bf['name'],_0x4f9a04[_0x983d('0x1f')],_0x4f9a04['account'][_0x983d('0x2c')],_0x4f9a04[_0x983d('0x28')]['id'],![],_0x587d96);if(rpc[_0x4f9a04['channel']+_0x983d('0x2d')]){return rpc[_0x4f9a04[_0x983d('0x24')]+_0x983d('0x2d')][_0x983d('0x32')](_0x33b034,_0x4f0b9b)[_0x983d('0x33')](function(_0x282e2b){logger[_0x983d('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x4895f7){return function(_0xb93ef7){return _0xb93ef7[_0x983d('0x2c')][_0x983d('0x36')]()===_0x4895f7['toLowerCase']();};}exports['consequence']=function(_0x2935a9,_0x14be26,_0x2ff3d7,_0x33e537){return function(_0x147311){try{var _0x92ba82={'name':_0x14be26[0x0],'timeout':_0x14be26[0x1]};var _0x15ac5c=queue[_0x983d('0x37')](_0x92ba82,{'typecast':!![]});if(_0x15ac5c['length']){logger[_0x983d('0x2f')](_0x983d('0x38'),_0x2935a9,_[_0x983d('0x39')](_0x15ac5c,_0x983d('0x28'))[_0x983d('0x3a')](',\x20'));_0x147311[_0x983d('0x3b')]();}else{var _0x5d29c3=_[_0x983d('0x3c')](_0x2ff3d7[_0x33e537[_0x983d('0x24')]+_0x983d('0x3d')],handleFindQueue(_0x92ba82[_0x983d('0x2c')]));if(_0x5d29c3){startRouting(_0x2935a9,_0x5d29c3,_0x33e537,_0x2ff3d7);var _0x599a1c=(_0x5d29c3[_0x983d('0x3e')]||0xa)*0x3e8;var _0x310827=(_0x92ba82[_0x983d('0x3e')]||0x14)*0x3e8;var _0x5b8375,_0x30d394;if(_0x599a1c>_0x310827){_0x310827=_0x599a1c;}var _0x29219f=seqqueue[_0x983d('0x3f')](_0x599a1c);_0x29219f['id']=_0x2935a9;_0x29219f['atimeout']=_0x599a1c;_0x29219f[_0x983d('0x40')]=_0x310827;_0x29219f[_0x983d('0x24')]=_0x33e537[_0x983d('0x24')];_0x2ff3d7['rules'][_0x2935a9]['on']('end',function(){logger[_0x983d('0x2a')](_0x983d('0x41'),_0x2935a9);stopRouting(_0x2935a9,_0x5d29c3,_0x33e537,_0x2ff3d7);clearTimeout(_0x5b8375);_0x5b8375=undefined;_0x29219f['close'](!![]);if(_0x2ff3d7[_0x983d('0x42')][_0x2935a9]){delete _0x2ff3d7[_0x983d('0x42')][_0x2935a9];}_0x147311[_0x983d('0x3b')]();});_0x2ff3d7[_0x983d('0x42')][_0x2935a9]['on'](_0x983d('0x43'),function(){if(_0x2ff3d7[_0x983d('0x42')][_0x2935a9]){delete _0x2ff3d7[_0x983d('0x42')][_0x2935a9];}});_0x5b8375=setTimeout(function(){logger[_0x983d('0x2a')](_0x983d('0x44'),_0x2935a9);endRouting(_0x2935a9,_0x5d29c3,_0x33e537,_0x2ff3d7);clearTimeout(_0x5b8375);_0x29219f[_0x983d('0x45')](!![]);_0x147311[_0x983d('0x46')]();},_0x310827);switch(_0x5d29c3[_0x983d('0x47')]){case'rrmemory':strategy[_0x983d('0x48')](_0x29219f,_0x5d29c3,_0x2ff3d7,_0x33e537);break;default:strategy['beepall'](_0x29219f,_0x5d29c3,_0x2ff3d7,_0x33e537);}}else{logger[_0x983d('0x2f')](_0x983d('0x49'),_0x2935a9,_0x92ba82[_0x983d('0x2c')]);_0x147311[_0x983d('0x3b')]();}}}catch(_0x5e6354){console[_0x983d('0x4a')](_0x5e6354);logger[_0x983d('0x2f')](_0x983d('0x38'),_0x2935a9,_0x5e6354[_0x983d('0x4b')]);_0x147311[_0x983d('0x3b')]();}};}; \ 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 c318c96..443fed8 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 _0xd788=['handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','notificationId','STOP','TIMEOUT','exports','../../../../../config/logger','squeue','agent','realtime','routing','push'];(function(_0x1db4df,_0x11ea1d){var _0xdb04a0=function(_0x408ad5){while(--_0x408ad5){_0x1db4df['push'](_0x1db4df['shift']());}};_0xdb04a0(++_0x11ea1d);}(_0xd788,0x190));var _0x8d78=function(_0x181ce0,_0x58eecd){_0x181ce0=_0x181ce0-0x0;var _0x2ed4e8=_0xd788[_0x181ce0];return _0x2ed4e8;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require(_0x8d78('0x0'))('routing');var Agent=function(_0x315b78,_0x3c715f,_0x5a3418,_0x1bde50){this['notificationId']=uuid['v4']();this[_0x8d78('0x1')]=_0x315b78;this[_0x8d78('0x2')]=_0x3c715f;this[_0x8d78('0x3')]=_0x5a3418;this[_0x8d78('0x4')]=_0x1bde50;this['squeue'][_0x8d78('0x5')](this[_0x8d78('0x6')]['bind'](this),this['handleTimeout'][_0x8d78('0x7')](this));this[_0x8d78('0x1')]['on'](_0x8d78('0x8'),this[_0x8d78('0x9')][_0x8d78('0x7')](this));this['squeue']['on'](_0x8d78('0xa'),this[_0x8d78('0xb')][_0x8d78('0x7')](this));};Agent[_0x8d78('0xc')]['push']=function(){this[_0x8d78('0x1')][_0x8d78('0x5')](this[_0x8d78('0x6')][_0x8d78('0x7')](this),this[_0x8d78('0x9')][_0x8d78('0x7')](this));};Agent[_0x8d78('0xc')][_0x8d78('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x8d78('0xc')][_0x8d78('0x6')]=function(_0x259855){logger[_0x8d78('0xd')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x8d78('0x1')]['id'],this['agent']['id']);if(_[_0x8d78('0xe')](this['realtime'][_0x8d78('0xf')][this['agent']['id']])){logger[_0x8d78('0xd')](_0x8d78('0x10'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x8d78('0x5')]['bind'](this),0x3e8);}else{if(this[_0x8d78('0x4')][_0x8d78('0x11')]||util[_0x8d78('0x12')](this['squeue']['id'],this[_0x8d78('0x3')][_0x8d78('0xf')][this[_0x8d78('0x2')]['id']],this['squeue'][_0x8d78('0x13')],![])){this[_0x8d78('0x3')]['agents'][this[_0x8d78('0x2')]['id']][_0x8d78('0x14')]=!![];this[_0x8d78('0x3')][_0x8d78('0xf')][this['agent']['id']][_0x8d78('0x15')]=undefined;util[_0x8d78('0x16')](this['notificationId'],this[_0x8d78('0x1')]['id'],this[_0x8d78('0x3')][_0x8d78('0xf')][this[_0x8d78('0x2')]['id']],null,this[_0x8d78('0x4')]);util[_0x8d78('0x17')](this[_0x8d78('0x1')]['id'],this['realtime'][_0x8d78('0xf')][this[_0x8d78('0x2')]['id']],_0x8d78('0x18')+(this[_0x8d78('0x4')][_0x8d78('0x11')]?':FORCED':''));}else{logger[_0x8d78('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x8d78('0x1')]['id'],this['agent']['id']);setTimeout(this[_0x8d78('0x5')][_0x8d78('0x7')](this),0x3e8);}}};Agent['prototype'][_0x8d78('0x9')]=function(_0x20f26d){if(_[_0x8d78('0xe')](this[_0x8d78('0x3')][_0x8d78('0xf')][this[_0x8d78('0x2')]['id']])){return logger[_0x8d78('0xd')](_0x8d78('0x10'),this[_0x8d78('0x1')]['id'],this[_0x8d78('0x2')]['id']);}else{logger[_0x8d78('0xd')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x8d78('0x1')]['id'],this[_0x8d78('0x2')]['id']);util['hideNotification'](this[_0x8d78('0x19')],this[_0x8d78('0x1')]['id'],this['realtime'][_0x8d78('0xf')][this['agent']['id']],null,this['routing']);this[_0x8d78('0x3')][_0x8d78('0xf')][this[_0x8d78('0x2')]['id']][_0x8d78('0x14')]=![];this[_0x8d78('0x3')][_0x8d78('0xf')][this['agent']['id']][_0x8d78('0x15')]=undefined;util[_0x8d78('0x17')](this[_0x8d78('0x1')]['id'],this[_0x8d78('0x3')][_0x8d78('0xf')][this[_0x8d78('0x2')]['id']],_0x20f26d?_0x8d78('0x1a'):_0x8d78('0x1b'));}if(!_0x20f26d){setTimeout(this['push'][_0x8d78('0x7')](this),0x3e8);}};function agent(_0x3f97d1,_0x1f3e78,_0x1f9d15,_0x1046e3){return new Agent(_0x3f97d1,_0x1f3e78,_0x1f9d15,_0x1046e3);}module[_0x8d78('0x1c')]=agent; \ No newline at end of file +var _0xe311=['notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','TIMEOUT','exports','lodash','uuid','./util','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','forcedOwnership','agents','channel','busyQueue','showNotification'];(function(_0x13c1e2,_0x38c545){var _0x44cc88=function(_0x52b933){while(--_0x52b933){_0x13c1e2['push'](_0x13c1e2['shift']());}};_0x44cc88(++_0x38c545);}(_0xe311,0x7f));var _0x1e31=function(_0x5b2f4b,_0xc43392){_0x5b2f4b=_0x5b2f4b-0x0;var _0x308f28=_0xe311[_0x5b2f4b];return _0x308f28;};'use strict';var _=require(_0x1e31('0x0'));var uuid=require(_0x1e31('0x1'));var util=require(_0x1e31('0x2'));var logger=require('../../../../../config/logger')(_0x1e31('0x3'));var Agent=function(_0x2260e8,_0x1d57a4,_0x1d38f8,_0x455382){this['notificationId']=uuid['v4']();this[_0x1e31('0x4')]=_0x2260e8;this[_0x1e31('0x5')]=_0x1d57a4;this[_0x1e31('0x6')]=_0x1d38f8;this['routing']=_0x455382;this[_0x1e31('0x4')][_0x1e31('0x7')](this[_0x1e31('0x8')][_0x1e31('0x9')](this),this[_0x1e31('0xa')][_0x1e31('0x9')](this));this[_0x1e31('0x4')]['on'](_0x1e31('0xb'),this[_0x1e31('0xa')][_0x1e31('0x9')](this));this['squeue']['on'](_0x1e31('0xc'),this[_0x1e31('0xd')]['bind'](this));};Agent['prototype'][_0x1e31('0x7')]=function(){this[_0x1e31('0x4')][_0x1e31('0x7')](this[_0x1e31('0x8')][_0x1e31('0x9')](this),this[_0x1e31('0xa')][_0x1e31('0x9')](this));};Agent[_0x1e31('0xe')]['handleDrained']=function(){this[_0x1e31('0xa')](!![]);};Agent[_0x1e31('0xe')][_0x1e31('0x8')]=function(_0x597abb){logger[_0x1e31('0xf')](_0x1e31('0x10'),this[_0x1e31('0x4')]['id'],this[_0x1e31('0x5')]['id']);if(_[_0x1e31('0x11')](this['realtime']['agents'][this[_0x1e31('0x5')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x1e31('0x5')]['id']);setTimeout(this[_0x1e31('0x7')]['bind'](this),0x3e8);}else{if(this[_0x1e31('0x3')][_0x1e31('0x12')]||util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0x1e31('0x13')][this[_0x1e31('0x5')]['id']],this[_0x1e31('0x4')][_0x1e31('0x14')],![])){this['realtime'][_0x1e31('0x13')][this['agent']['id']]['busy']=!![];this[_0x1e31('0x6')][_0x1e31('0x13')][this['agent']['id']][_0x1e31('0x15')]=undefined;util[_0x1e31('0x16')](this[_0x1e31('0x17')],this[_0x1e31('0x4')]['id'],this[_0x1e31('0x6')]['agents'][this[_0x1e31('0x5')]['id']],null,this[_0x1e31('0x3')]);util[_0x1e31('0x18')](this[_0x1e31('0x4')]['id'],this[_0x1e31('0x6')][_0x1e31('0x13')][this[_0x1e31('0x5')]['id']],_0x1e31('0x19')+(this['routing'][_0x1e31('0x12')]?':FORCED':''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x1e31('0x4')]['id'],this[_0x1e31('0x5')]['id']);setTimeout(this[_0x1e31('0x7')][_0x1e31('0x9')](this),0x3e8);}}};Agent[_0x1e31('0xe')][_0x1e31('0xa')]=function(_0x4dffa4){if(_[_0x1e31('0x11')](this[_0x1e31('0x6')][_0x1e31('0x13')][this[_0x1e31('0x5')]['id']])){return logger[_0x1e31('0xf')](_0x1e31('0x1a'),this[_0x1e31('0x4')]['id'],this[_0x1e31('0x5')]['id']);}else{logger['info'](_0x1e31('0x1b'),this[_0x1e31('0x4')]['id'],this[_0x1e31('0x5')]['id']);util['hideNotification'](this[_0x1e31('0x17')],this['squeue']['id'],this[_0x1e31('0x6')]['agents'][this[_0x1e31('0x5')]['id']],null,this[_0x1e31('0x3')]);this[_0x1e31('0x6')]['agents'][this[_0x1e31('0x5')]['id']]['busy']=![];this['realtime'][_0x1e31('0x13')][this[_0x1e31('0x5')]['id']][_0x1e31('0x15')]=undefined;util[_0x1e31('0x18')](this['squeue']['id'],this[_0x1e31('0x6')][_0x1e31('0x13')][this['agent']['id']],_0x4dffa4?'STOP':_0x1e31('0x1c'));}if(!_0x4dffa4){setTimeout(this[_0x1e31('0x7')][_0x1e31('0x9')](this),0x3e8);}};function agent(_0x9fb268,_0x31fe54,_0x4c3da1,_0x27c24a){return new Agent(_0x9fb268,_0x31fe54,_0x4c3da1,_0x27c24a);}module[_0x1e31('0x1d')]=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 7bef97b..b0c6ae9 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 _0x294b=['busy','busyQueue','name','showNotification','notificationId','info','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','exports','lodash','./util','../../../../../config/logger','routing','squeue','queue','realtime','handleRun','timeout','handleTimeout','handleDrained','bind','prototype','push','isNil','Agents','length','agents','isAgentAvailable','channel','writeLog','RINGING'];(function(_0x1c03d5,_0x56241d){var _0xff4691=function(_0x93c3a6){while(--_0x93c3a6){_0x1c03d5['push'](_0x1c03d5['shift']());}};_0xff4691(++_0x56241d);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var uuid=require('uuid');var util=require(_0xb294('0x1'));var logger=require(_0xb294('0x2'))(_0xb294('0x3'));var Beepall=function(_0x411640,_0x1cd458,_0x417648,_0x58fe24){this['notificationId']=uuid['v4']();this[_0xb294('0x4')]=_0x411640;this[_0xb294('0x5')]=_0x1cd458;this[_0xb294('0x6')]=_0x417648;this[_0xb294('0x3')]=_0x58fe24;this[_0xb294('0x4')]['push'](this[_0xb294('0x7')]['bind'](this),this['handleTimeout']['bind'](this));this[_0xb294('0x4')]['on'](_0xb294('0x8'),this[_0xb294('0x9')]['bind'](this));this['squeue']['on']('drained',this[_0xb294('0xa')][_0xb294('0xb')](this));};Beepall[_0xb294('0xc')][_0xb294('0xd')]=function(){this[_0xb294('0x4')][_0xb294('0xd')](this[_0xb294('0x7')][_0xb294('0xb')](this),this[_0xb294('0x9')][_0xb294('0xb')](this));};Beepall['prototype']['handleDrained']=function(_0xe8178e){this['handleTimeout'](!![]);};Beepall['prototype'][_0xb294('0x7')]=function(_0x870d74){var _0x46a7b9=!![];if(!_[_0xb294('0xe')](this[_0xb294('0x5')])&&!_[_0xb294('0xe')](this[_0xb294('0x5')][_0xb294('0xf')])&&this[_0xb294('0x5')][_0xb294('0xf')][_0xb294('0x10')]>0x0){for(var _0x51110b=0x0,_0x191b7f;_0x51110b0x0){for(var _0x1b2be5=0x0,_0xa74362;_0x1b2be50x0&&_0x2d3277[_0x41e29f+_0x04c6('0x23')]>=_0x2d3277[_0x41e29f+_0x04c6('0x24')]){writeLog(_0x49c179,_0x2d3277,_0x41e29f[_0x04c6('0x25')]()+_0x04c6('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x1d0d3f,_0x165cb5,_0x4e00fe,_0x264cde,_0x1cd16a){return sendNotification(!![],_0x1d0d3f,_0x165cb5,_0x4e00fe,_0x264cde,_0x1cd16a);};exports['hideNotification']=function(_0x5c9003,_0x115d84,_0x3a6d92,_0x2a191f,_0xbb9e81){return sendNotification(![],_0x5c9003,_0x115d84,_0x3a6d92,_0x2a191f,_0xbb9e81);};exports[_0x04c6('0x27')]=writeLog; \ No newline at end of file +var _0xef17=['emit','format','user:%s','name','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','error','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter'];(function(_0x29733c,_0x2da30b){var _0x49e72f=function(_0x405c92){while(--_0x405c92){_0x29733c['push'](_0x29733c['shift']());}};_0x49e72f(++_0x2da30b);}(_0xef17,0x136));var _0x7ef1=function(_0x1be8e3,_0x4e6ea9){_0x1be8e3=_0x1be8e3-0x0;var _0x92c7fa=_0xef17[_0x1be8e3];return _0x92c7fa;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var utils=require(_0x7ef1('0x2'));var Mustache=require(_0x7ef1('0x3'));var Redis=require(_0x7ef1('0x4'));var config=require(_0x7ef1('0x5'));var logger=require(_0x7ef1('0x6'))(_0x7ef1('0x7'));config[_0x7ef1('0x8')]=_['defaults'](config[_0x7ef1('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7ef1('0x9'))(new Redis(config['redis']));function emit(_0x34a040,_0x4ba2f0,_0x5aec63){io['to'](_0x34a040)[_0x7ef1('0xa')](_0x4ba2f0,_0x5aec63);}function sendNotification(_0x3398a6,_0x56ab07,_0xeb10e9,_0x1d5b33,_0x4534fc,_0x3d47e2){io['to'](util[_0x7ef1('0xb')](_0x7ef1('0xc'),_0x1d5b33[_0x7ef1('0xd')]))['emit']('user:save',_0x1d5b33);var _0x1d4522=_0x3d47e2||{};var _0x4dc653=_0xeb10e9['split']('.');var _0x4d60ae={'uniqueid':_0x56ab07,'channel':_0x4dc653[0x0],'id':_0x4dc653[0x1],'title':_0x4dc653[0x0]+_0x7ef1('0xe'),'interactionId':_0x4dc653[0x2],'queue':_0x4534fc?_0x4534fc['name']:null,'sound':_0x1d4522[_0x7ef1('0xf')][_0x7ef1('0x10')],'shake':_0x1d4522[_0x7ef1('0xf')][_0x7ef1('0x11')]};try{if(!_0x1d4522[_0x7ef1('0x12')]){_0x1d4522[_0x7ef1('0x12')]={};}if(_0x4534fc){_0x1d4522[_0x7ef1('0x12')][_0x7ef1('0x13')]=_0x4534fc;}else if(_0x1d4522['body']['queue']){delete _0x1d4522[_0x7ef1('0x12')]['queue'];}_0x4d60ae[_0x7ef1('0x14')]=utils[_0x7ef1('0x15')](_0x1d4522['account']['notificationTemplate'],_0x1d4522);}catch(_0x5d269a){_0x4d60ae[_0x7ef1('0x14')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x7ef1('0x16')](util['format']('[%s][QUEUE]\x20%s',_0x56ab07,_0x5d269a['message']));}io['to'](util[_0x7ef1('0xb')]('user:%s',_0x1d5b33[_0x7ef1('0xd')]))[_0x7ef1('0xa')](util['format']('notification:%s',_0x3398a6?_0x7ef1('0x17'):'remove'),_0x4d60ae);}function writeLog(_0x458459,_0x33f89b,_0x2f8164){return logger[_0x7ef1('0x18')](util[_0x7ef1('0xb')](_0x7ef1('0x19'),_0x458459,_0x33f89b[_0x7ef1('0xd')],_0x2f8164));}exports[_0x7ef1('0x1a')]=function(_0x490162,_0x2a1bdd,_0x3b118f,_0x3f26fb){if(_0x2a1bdd[_0x7ef1('0x1b')]){writeLog(_0x490162,_0x2a1bdd,_0x7ef1('0x1c'));return![];}if(!_0x2a1bdd[_0x7ef1('0x1d')]){writeLog(_0x490162,_0x2a1bdd,_0x7ef1('0x1e'));return![];}if(_0x2a1bdd[_0x3b118f+_0x7ef1('0x1f')]){writeLog(_0x490162,_0x2a1bdd,'PAUSE');return![];}if(_0x3f26fb&&_0x2a1bdd['hasOwnProperty'](_0x3b118f+_0x7ef1('0x20'))&&_0x2a1bdd[_0x7ef1('0x21')](_0x3b118f+_0x7ef1('0x22'))){if(_0x2a1bdd[_0x3b118f+_0x7ef1('0x20')]>0x0&&_0x2a1bdd[_0x3b118f+_0x7ef1('0x22')]>=_0x2a1bdd[_0x3b118f+'Capacity']){writeLog(_0x490162,_0x2a1bdd,_0x3b118f[_0x7ef1('0x23')]()+_0x7ef1('0x24'));return![];}}return!![];};exports[_0x7ef1('0x25')]=function(_0x4af5f5,_0x232f4e,_0x238fdc,_0x21e8c5,_0x58e7ee){return sendNotification(!![],_0x4af5f5,_0x232f4e,_0x238fdc,_0x21e8c5,_0x58e7ee);};exports[_0x7ef1('0x26')]=function(_0x4b0380,_0x3306b0,_0x2546bf,_0x4b5fde,_0x5f25de){return sendNotification(![],_0x4b0380,_0x3306b0,_0x2546bf,_0x4b5fde,_0x5f25de);};exports[_0x7ef1('0x27')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 68fadf6..7a5e9e8 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 _0x33a4=['length','[%s][SYSTEM]\x20%s','map','message','join','next','getMustacheRender','info','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','./utils','../../../../config/logger','routing'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0x33a4,0x88));var _0x433a=function(_0x437c45,_0x2e2c5f){_0x437c45=_0x437c45-0x0;var _0x2cd74d=_0x33a4[_0x437c45];return _0x2cd74d;};'use strict';var schema=require('validate');var sh=require(_0x433a('0x0'));var _=require('lodash');var utils=require(_0x433a('0x1'));var logger=require(_0x433a('0x2'))(_0x433a('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x19166b,_0x12121b){return function(_0x346360){try{var _0x60b6b3={'command':_0x12121b[0x0]};var _0x1b6f5a=system['validate'](_0x60b6b3,{'typecast':!![]});if(_0x1b6f5a[_0x433a('0x4')]){logger['error'](_0x433a('0x5'),_0x19166b,_[_0x433a('0x6')](_0x1b6f5a,_0x433a('0x7'))[_0x433a('0x8')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x19166b);_0x346360[_0x433a('0x9')]();}else{var _0x12db5c=this;var _0x19a533=utils[_0x433a('0xa')](_0x12121b[0x0],this);logger[_0x433a('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x19166b,_0x19a533);sh['exec'](_[_0x433a('0xc')](_0x19a533),function(_0x38d8ef,_0x25006f){logger[_0x433a('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x19166b,_0x38d8ef);if(_0x38d8ef==0x0){var _0x2d064c=_0x25006f[_0x433a('0xd')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x12121b[0x1])||_[_0x433a('0xe')](_0x12121b[0x1])){logger['info'](_0x433a('0xf'),_0x19166b);_0x12db5c[_0x433a('0x10')][_0x12121b[0x1]]=_0x2d064c;}else{logger[_0x433a('0xb')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x19166b,_0x12121b[0x1],_0x2d064c);_0x12db5c['body'][_0x12121b[0x1]]=_0x2d064c;}}_0x346360[_0x433a('0x9')]();});}}catch(_0x24311f){logger[_0x433a('0x11')](_0x433a('0x5'),_0x19166b,_[_0x433a('0x12')](_0x24311f)?JSON['stringify'](_0x24311f):_0x24311f);logger['info'](_0x433a('0x13'),_0x19166b);_0x346360[_0x433a('0x9')]();}};}; \ No newline at end of file +var _0x2dab=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','string','consequence','error','[%s][SYSTEM]\x20%s','map','message','join'];(function(_0x2e0837,_0x502d9c){var _0x43037e=function(_0x49367e){while(--_0x49367e){_0x2e0837['push'](_0x2e0837['shift']());}};_0x43037e(++_0x502d9c);}(_0x2dab,0x120));var _0xb2da=function(_0x321cc7,_0x9bdd22){_0x321cc7=_0x321cc7-0x0;var _0x5c1ce3=_0x2dab[_0x321cc7];return _0x5c1ce3;};'use strict';var schema=require(_0xb2da('0x0'));var sh=require(_0xb2da('0x1'));var _=require(_0xb2da('0x2'));var utils=require(_0xb2da('0x3'));var logger=require(_0xb2da('0x4'))('routing');var system=schema({'command':{'type':_0xb2da('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xb2da('0x6')]=function(_0x1f7ad6,_0x2fdaa4){return function(_0x35e14b){try{var _0x309b46={'command':_0x2fdaa4[0x0]};var _0x3b0e4e=system[_0xb2da('0x0')](_0x309b46,{'typecast':!![]});if(_0x3b0e4e['length']){logger[_0xb2da('0x7')](_0xb2da('0x8'),_0x1f7ad6,_[_0xb2da('0x9')](_0x3b0e4e,_0xb2da('0xa'))[_0xb2da('0xb')](',\x20'));logger[_0xb2da('0xc')](_0xb2da('0xd'),_0x1f7ad6);_0x35e14b[_0xb2da('0xe')]();}else{var _0x5ecb99=this;var _0x5d4fba=utils[_0xb2da('0xf')](_0x2fdaa4[0x0],this);logger[_0xb2da('0xc')](_0xb2da('0x10'),_0x1f7ad6,_0x5d4fba);sh[_0xb2da('0x11')](_['trim'](_0x5d4fba),function(_0x568ebb,_0x186aa6){logger[_0xb2da('0xc')](_0xb2da('0x12'),_0x1f7ad6,_0x568ebb);if(_0x568ebb==0x0){var _0xb1807c=_0x186aa6['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xb2da('0x13')](_0x2fdaa4[0x1])||_[_0xb2da('0x14')](_0x2fdaa4[0x1])){logger[_0xb2da('0xc')](_0xb2da('0x15'),_0x1f7ad6);_0x5ecb99[_0xb2da('0x16')][_0x2fdaa4[0x1]]=_0xb1807c;}else{logger[_0xb2da('0xc')](_0xb2da('0x17'),_0x1f7ad6,_0x2fdaa4[0x1],_0xb1807c);_0x5ecb99['body'][_0x2fdaa4[0x1]]=_0xb1807c;}}_0x35e14b['next']();});}}catch(_0x3c74e7){logger['error'](_0xb2da('0x8'),_0x1f7ad6,_['isObject'](_0x3c74e7)?JSON[_0xb2da('0x18')](_0x3c74e7):_0x3c74e7);logger[_0xb2da('0xc')](_0xb2da('0xd'),_0x1f7ad6);_0x35e14b[_0xb2da('0xe')]();}};}; \ 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 1918b77..2d95e1a 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 _0x5150=['message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','next','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map'];(function(_0x479f28,_0x5ba4bd){var _0x2dca64=function(_0x53219c){while(--_0x53219c){_0x479f28['push'](_0x479f28['shift']());}};_0x2dca64(++_0x5ba4bd);}(_0x5150,0x11b));var _0x0515=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x5150[_0x287a47];return _0x3fb726;};'use strict';var schema=require(_0x0515('0x0'));var _=require(_0x0515('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x0515('0x2')),'smsInteraction':require(_0x0515('0x3')),'mailInteraction':require(_0x0515('0x4')),'faxInteraction':require(_0x0515('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x0515('0x6'));var tag=schema({'tag':{'type':_0x0515('0x7'),'required':!![],'message':_0x0515('0x8')}});exports[_0x0515('0x9')]=function(_0x3167eb,_0xe9f630,_0x568950,_0xd2489b){return function(_0x86ad6){try{var _0x11d3c0={'tag':_0xe9f630[0x0]};var _0x32ada0=tag['validate'](_0x11d3c0,{'typecast':!![]});if(_0x32ada0[_0x0515('0xa')]){logger[_0x0515('0xb')](_0x0515('0xc'),_0x3167eb,_[_0x0515('0xd')](_0x32ada0,_0x0515('0xe'))[_0x0515('0xf')](',\x20'));logger[_0x0515('0x10')](_0x0515('0x11'),_0x3167eb);_0x86ad6['next']();}else{var _0xc10198={'ids':[_0xe9f630[0x0]]};if(rpc[_0xd2489b[_0x0515('0x12')]+_0x0515('0x13')]){rpc[_0xd2489b[_0x0515('0x12')]+'Interaction']['addTags'](_0xd2489b[_0x0515('0x14')]['id'],_0xc10198)[_0x0515('0x15')](function(_0x3e80bf){logger['info'](_0x0515('0x16'),_0x3167eb,_0xe9f630[0x1],_0xd2489b['channel'],_0xd2489b[_0x0515('0x14')]['id']);})['catch'](function(_0x12f044){logger[_0x0515('0xb')]('[%s][TAG]\x20%s',_0x3167eb,JSON[_0x0515('0x17')](_0x12f044));logger[_0x0515('0x10')](_0x0515('0x11'),_0x3167eb);})[_0x0515('0x18')](function(){_0x86ad6[_0x0515('0x19')]();});}}}catch(_0x149337){logger['error'](_0x0515('0xc'),_0x3167eb,_[_0x0515('0x1a')](_0x149337)?JSON[_0x0515('0x17')](_0x149337):_0x149337);logger[_0x0515('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3167eb);_0x86ad6['next']();}};}; \ No newline at end of file +var _0xe604=['validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','finally','next'];(function(_0x33a86a,_0x4dfb14){var _0x3d97e3=function(_0x250dc6){while(--_0x250dc6){_0x33a86a['push'](_0x33a86a['shift']());}};_0x3d97e3(++_0x4dfb14);}(_0xe604,0x8c));var _0x4e60=function(_0x2300f0,_0x3c6371){_0x2300f0=_0x2300f0-0x0;var _0x8107e4=_0xe604[_0x2300f0];return _0x8107e4;};'use strict';var schema=require(_0x4e60('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x4e60('0x1')),'openchannelInteraction':require(_0x4e60('0x2')),'smsInteraction':require(_0x4e60('0x3')),'mailInteraction':require(_0x4e60('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x4e60('0x5'))};var logger=require(_0x4e60('0x6'))(_0x4e60('0x7'));var tag=schema({'tag':{'type':_0x4e60('0x8'),'required':!![],'message':_0x4e60('0x9')}});exports[_0x4e60('0xa')]=function(_0x29b445,_0x719add,_0x1eb641,_0x35081a){return function(_0x47800a){try{var _0x18e909={'tag':_0x719add[0x0]};var _0x4b97d7=tag[_0x4e60('0x0')](_0x18e909,{'typecast':!![]});if(_0x4b97d7['length']){logger[_0x4e60('0xb')](_0x4e60('0xc'),_0x29b445,_[_0x4e60('0xd')](_0x4b97d7,_0x4e60('0xe'))[_0x4e60('0xf')](',\x20'));logger['info'](_0x4e60('0x10'),_0x29b445);_0x47800a['next']();}else{var _0x2a6bf7={'ids':[_0x719add[0x0]]};if(rpc[_0x35081a[_0x4e60('0x11')]+_0x4e60('0x12')]){rpc[_0x35081a[_0x4e60('0x11')]+_0x4e60('0x12')][_0x4e60('0x13')](_0x35081a['interaction']['id'],_0x2a6bf7)[_0x4e60('0x14')](function(_0xc5e2f7){logger[_0x4e60('0x15')](_0x4e60('0x16'),_0x29b445,_0x719add[0x1],_0x35081a[_0x4e60('0x11')],_0x35081a[_0x4e60('0x17')]['id']);})[_0x4e60('0x18')](function(_0x372ad5){logger[_0x4e60('0xb')]('[%s][TAG]\x20%s',_0x29b445,JSON[_0x4e60('0x19')](_0x372ad5));logger[_0x4e60('0x15')](_0x4e60('0x10'),_0x29b445);})[_0x4e60('0x1a')](function(){_0x47800a[_0x4e60('0x1b')]();});}}}catch(_0x3f156f){logger[_0x4e60('0xb')](_0x4e60('0xc'),_0x29b445,_['isObject'](_0x3f156f)?JSON[_0x4e60('0x19')](_0x3f156f):_0x3f156f);logger[_0x4e60('0x15')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x29b445);_0x47800a['next']();}};}; \ 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 6ccf193..478d17e 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 _0x1e27=['[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','lodash','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','method','login','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','stringify','then','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1e27,0x112));var _0x71e2=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1e27[_0x5ddb1c];return _0x354adc;};'use strict';var rp=require(_0x71e2('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0x71e2('0x1'));var arr=[];exports['consequence']=function(_0x239baa,_0x10ea8f){return function(_0xe8a43c){var _0xb33628=_0x10ea8f[0xa];var _0x12ce7d=_0x10ea8f[0xb];var _0x34f2c5=_0x10ea8f[0xc];var _0x8fec7b=_0x10ea8f[0xd];var _0x22fd40=_0x10ea8f[0xe];var _0x2d99ea=_0x10ea8f[0xf][_0x71e2('0x2')](/\n/g,_0x71e2('0x3'));var _0xba0b6d=_0x10ea8f[0x10][_0x71e2('0x2')](/\n/g,'\x20');if(!arr['includes'](_0x12ce7d)){arr[_0x71e2('0x4')](_0x12ce7d);var _0x303848=_0x10ea8f[0x3];var _0x53ceb9=_0x10ea8f[0x4];var _0x494ccf=_0x10ea8f[0x1];var _0x1b75c9=_0x10ea8f[0x0];var _0x4f4e84={};_0x4f4e84[_0x71e2('0x5')]=_0x10ea8f[0x8]+_0x71e2('0x6')+_0x34f2c5+'|'+_0xb33628+'|'+_0x8fec7b+'|'+_0x12ce7d+'|'+_0x22fd40;_0x4f4e84[_0x71e2('0x7')]=_0x10ea8f[0x7]+_0x71e2('0x6')+_0x34f2c5+'|'+_0xb33628+'|'+_0x8fec7b+'|'+_0x12ce7d+'|'+_0x22fd40+'|'+_0x2d99ea+'|'+_0xba0b6d;_0x4f4e84[_0x71e2('0x8')]=_0x10ea8f[0x9];var _0x17c4f8={};_0x17c4f8['jsonrpc']='2.0';_0x17c4f8[_0x71e2('0x9')]=_0x71e2('0xa');var _0x3f9435=[];_0x3f9435[_0x71e2('0x4')](_0x10ea8f[0x2]);_0x3f9435['push'](_0x10ea8f[0x5]);_0x3f9435['push'](_0x10ea8f[0x6]);_0x17c4f8['params']=_0x3f9435;_0x17c4f8['id']=0x1;var _0x38da19=JSON['stringify'](_0x17c4f8);var _0x2cd11e={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x303848,'headers':{'Content-Type':'application/json-rpc'},'body':_0x38da19};return rp(_0x2cd11e)['then'](function(_0xb10a51){const _0x2cec8e=JSON[_0x71e2('0xb')](_0xb10a51);if(!_0x2cec8e[_0x71e2('0xc')]['logged']){throw new Error(_0x71e2('0xd'));}var _0x494537=_0x12ce7d;var _0x2bf690=_0x71e2('0xe')+_0x494ccf+_0x71e2('0xf')+_0x1b75c9+'&sessionId='+_0x494537+_0x71e2('0x10')+JSON[_0x71e2('0x11')](_0x4f4e84);var _0x1d9fe0=_0x53ceb9+'?'+_0x2bf690;return rp(_0x1d9fe0);})[_0x71e2('0x12')](function(_0x156151){logger['info'](_0x71e2('0x13'),_0x239baa,_0x156151);_0xe8a43c[_0x71e2('0x14')]();})[_0x71e2('0x15')](function(_0x557af3){logger[_0x71e2('0x16')](_0x71e2('0x17'),_0x239baa,_[_0x71e2('0x18')](_0x557af3)?JSON['stringify'](_0x557af3):_0x557af3);_0xe8a43c[_0x71e2('0x14')]();});}else{logger['info'](_0x71e2('0x19'),_0x239baa);_0xe8a43c[_0x71e2('0x1a')]();}};}; \ No newline at end of file +var _0xe0be=['\x20-\x20','includes','push','?params=','urlOnRing','title','method','login','params','utf8','POST','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','catch','error','isObject','stop','next','request-promise','lodash','consequence','replace'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xe0be,0x10a));var _0xee0b=function(_0x1a632a,_0x270843){_0x1a632a=_0x1a632a-0x0;var _0x311d27=_0xe0be[_0x1a632a];return _0x311d27;};'use strict';var rp=require(_0xee0b('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0xee0b('0x1'));var arr=[];exports[_0xee0b('0x2')]=function(_0x4d02a5,_0x2abf10){return function(_0x513552){var _0x3916c3=_0x2abf10[0xa];var _0x541220=_0x2abf10[0xb];var _0x2ea966=_0x2abf10[0xc];var _0x5975c6=_0x2abf10[0xd];var _0x45ff32=_0x2abf10[0xe];var _0x7d32e8=_0x2abf10[0xf][_0xee0b('0x3')](/\n/g,_0xee0b('0x4'));var _0x2cea3c=_0x2abf10[0x10][_0xee0b('0x3')](/\n/g,'\x20');if(!arr[_0xee0b('0x5')](_0x541220)){arr[_0xee0b('0x6')](_0x541220);var _0x33cba8=_0x2abf10[0x3];var _0x1f2483=_0x2abf10[0x4];var _0x10b518=_0x2abf10[0x1];var _0x2ff460=_0x2abf10[0x0];var _0x40a5d2={};_0x40a5d2['urlOnAnswer']=_0x2abf10[0x8]+_0xee0b('0x7')+_0x2ea966+'|'+_0x3916c3+'|'+_0x5975c6+'|'+_0x541220+'|'+_0x45ff32;_0x40a5d2[_0xee0b('0x8')]=_0x2abf10[0x7]+'?params='+_0x2ea966+'|'+_0x3916c3+'|'+_0x5975c6+'|'+_0x541220+'|'+_0x45ff32+'|'+_0x7d32e8+'|'+_0x2cea3c;_0x40a5d2[_0xee0b('0x9')]=_0x2abf10[0x9];var _0x229da4={};_0x229da4['jsonrpc']='2.0';_0x229da4[_0xee0b('0xa')]=_0xee0b('0xb');var _0x1248c3=[];_0x1248c3[_0xee0b('0x6')](_0x2abf10[0x2]);_0x1248c3['push'](_0x2abf10[0x5]);_0x1248c3[_0xee0b('0x6')](_0x2abf10[0x6]);_0x229da4[_0xee0b('0xc')]=_0x1248c3;_0x229da4['id']=0x1;var _0x2e7749=JSON['stringify'](_0x229da4);var _0x562a89={'encoding':_0xee0b('0xd'),'method':_0xee0b('0xe'),'timeout':0x2710,'url':_0x33cba8,'headers':{'Content-Type':_0xee0b('0xf')},'body':_0x2e7749};return rp(_0x562a89)[_0xee0b('0x10')](function(_0x2a7eeb){const _0x2b2ad6=JSON['parse'](_0x2a7eeb);if(!_0x2b2ad6[_0xee0b('0x11')][_0xee0b('0x12')]){throw new Error(_0xee0b('0x13'));}var _0x45f19e=_0x541220;var _0x3a54c9=_0xee0b('0x14')+_0x10b518+_0xee0b('0x15')+_0x2ff460+_0xee0b('0x16')+_0x45f19e+_0xee0b('0x17')+JSON['stringify'](_0x40a5d2);var _0x229d4e=_0x1f2483+'?'+_0x3a54c9;return rp(_0x229d4e);})[_0xee0b('0x10')](function(_0x345399){logger[_0xee0b('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x4d02a5,_0x345399);_0x513552['stop']();})[_0xee0b('0x19')](function(_0x3c1997){logger[_0xee0b('0x1a')]('[%s][TVOX]\x20%s',_0x4d02a5,_[_0xee0b('0x1b')](_0x3c1997)?JSON['stringify'](_0x3c1997):_0x3c1997);_0x513552[_0xee0b('0x1c')]();});}else{logger[_0xee0b('0x18')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x4d02a5);_0x513552[_0xee0b('0x1d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 31b0222..8e33aaa 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x2d2f7c,_0x7e0361){var _0x42b316=function(_0x16760f){while(--_0x16760f){_0x2d2f7c['push'](_0x2d2f7c['shift']());}};_0x42b316(++_0x7e0361);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x186e90,_0x293334){var _0x363851=function(_0x5ebee0){while(--_0x5ebee0){_0x186e90['push'](_0x186e90['shift']());}};_0x363851(++_0x293334);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 5f33738..8db2ef0 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 _0x2904=['Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','message','interaction','applications','length','existsSync','app','.js','toLowerCase','autoreply','appdata','channel','mail','push','join','slice','dialogflow','dialogflowv2','split','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','./applications/','consequence','priority','info','Push\x20new\x20rule','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log'];(function(_0x3ae750,_0x2c37a9){var _0x484a18=function(_0x21bac4){while(--_0x21bac4){_0x3ae750['push'](_0x3ae750['shift']());}};_0x484a18(++_0x2c37a9);}(_0x2904,0x137));var _0x4290=function(_0x57de4a,_0x4b9c38){_0x57de4a=_0x57de4a-0x0;var _0x3f48bf=_0x2904[_0x57de4a];return _0x3f48bf;};'use strict';var _=require(_0x4290('0x0'));var util=require(_0x4290('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x4290('0x2'));var BPromise=require('bluebird');var uuid=require(_0x4290('0x3'));var utils=require(_0x4290('0x4'));var config=require(_0x4290('0x5'));var logger=require(_0x4290('0x6'))(_0x4290('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4290('0x8')),'chatQueueReport':require(_0x4290('0x9')),'smsQueueReport':require(_0x4290('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4290('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x50248b,_0xa79538,_0x5434eb){return util[_0x4290('0xc')](_0x4290('0xd'),_0x50248b,_0xa79538||0x0,_0x5434eb||0x0);}function getIntervals(_0x4e0e0e,_0xca467e){var _0x2d9de0=[];if(!_[_0x4290('0xe')](_0xca467e[_0x4290('0xf')])&&!_[_0x4290('0xe')](_0x4e0e0e[_0xca467e[_0x4290('0xf')]])&&!_[_0x4290('0xe')](_0x4e0e0e[_0xca467e[_0x4290('0xf')]][_0x4290('0x10')])){_0x2d9de0=_['map'](_0x4e0e0e[_0xca467e[_0x4290('0xf')]][_0x4290('0x10')],'interval');}else if(!_[_0x4290('0xe')](_0xca467e['interval'])){_0x2d9de0=[_0xca467e[_0x4290('0x11')]];}return _0x2d9de0;}exports['listen']=function(_0x418062){_0x418062[_0x4290('0x12')]={};return new BPromise(function(_0x59a02c,_0x3e13b6){var _0x5f13c4={'Start':function(_0x1c8d95){var _0xf2f5c9=this;return new Promise(function(_0x1ff10f,_0x5d0a1f){if(_0x1c8d95){try{var _0x10ff09=[];var _0x15f816=getId(_0x1c8d95['channel'],_0x1c8d95[_0x4290('0x13')]?_0x1c8d95[_0x4290('0x13')]['id']:0x0,_0x1c8d95[_0x4290('0x14')]?_0x1c8d95[_0x4290('0x14')]['id']:0x0);if(_0x1c8d95[_0x4290('0x15')]&&_['isArray'](_0x1c8d95[_0x4290('0x15')])&&_0x1c8d95['applications'][_0x4290('0x16')]){for(var _0x25cb57=0x0;_0x25cb57<_0x1c8d95[_0x4290('0x15')]['length'];_0x25cb57+=0x1){var _0xa6f7=_0x1c8d95['applications'][_0x25cb57];if(fs[_0x4290('0x17')](path['join'](__dirname,'applications',_0xa6f7[_0x4290('0x18')]+_0x4290('0x19')))){var _0x832c9f=[];switch(_0xa6f7[_0x4290('0x18')][_0x4290('0x1a')]()){case _0x4290('0x1b'):var _0x58284f=_0xa6f7[_0x4290('0x1c')]['split'](',');if(_0x1c8d95[_0x4290('0x1d')]===_0x4290('0x1e')){_0x832c9f[_0x4290('0x1f')](_0x58284f[0x0]);_0x832c9f[_0x4290('0x1f')](_0x58284f[0x1]);_0x832c9f['push'](_0x58284f['slice'](0x2,_0x58284f[_0x4290('0x16')])[_0x4290('0x20')](','));}else{_0x832c9f[_0x4290('0x1f')](_0x58284f[0x0]);_0x832c9f[_0x4290('0x1f')](_0x58284f[_0x4290('0x21')](0x1,_0x58284f[_0x4290('0x16')])[_0x4290('0x20')](','));}break;case _0x4290('0x22'):var _0x1af4b8=_0xa6f7[_0x4290('0x1c')]['split'](',');_0x832c9f[_0x4290('0x1f')](_0x1af4b8[0x0]);_0x832c9f[_0x4290('0x1f')](_0x1af4b8[0x1]);_0x832c9f['push'](_0x1af4b8[_0x4290('0x21')](0x2,_0x1af4b8[_0x4290('0x16')])[_0x4290('0x20')](','));break;case _0x4290('0x23'):var _0x53c1c0=_0xa6f7[_0x4290('0x1c')][_0x4290('0x24')](',');_0x832c9f['push'](_0x53c1c0[0x0]);_0x832c9f[_0x4290('0x1f')](_0x53c1c0[0x1]);_0x832c9f[_0x4290('0x1f')](_0x53c1c0[0x2]);_0x832c9f[_0x4290('0x1f')](_0x53c1c0[0x3]);_0x832c9f[_0x4290('0x1f')](_0x53c1c0[_0x4290('0x21')](0x4,_0x53c1c0[_0x4290('0x16')])[_0x4290('0x20')](','));break;case _0x4290('0x25'):var _0x3eb106=_0xa6f7[_0x4290('0x1c')][_0x4290('0x24')](',');_0x832c9f[_0x4290('0x1f')](_0x3eb106[0x0]);_0x832c9f[_0x4290('0x1f')](_0x3eb106[0x1]);_0x832c9f[_0x4290('0x1f')](_0x3eb106[0x2]);_0x832c9f[_0x4290('0x1f')](_0x3eb106[0x3]);_0x832c9f[_0x4290('0x1f')](_0x3eb106[_0x4290('0x21')](0x4,_0x3eb106[_0x4290('0x16')])[_0x4290('0x20')](','));break;case _0x4290('0x13'):_0x832c9f[_0x4290('0x1f')](_0xa6f7['appdata']);break;case'tag':_0x832c9f[_0x4290('0x1f')](_0xa6f7[_0x4290('0x26')]);_0x832c9f['push'](_0xa6f7['appdata']);break;case _0x4290('0x27'):var _0x3aa849=utils[_0x4290('0x28')](_0x1c8d95[_0x4290('0x29')][_0x4290('0x2a')],_0x1c8d95);var _0x50046d=_0xa6f7[_0x4290('0x1c')][_0x4290('0x24')](',');_0x832c9f[_0x4290('0x1f')](_0x50046d[0x0]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0x1]);_0x832c9f['push'](_0x50046d[0x2]);_0x832c9f['push'](_0x50046d[0x3]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0x4]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0x5]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0x6]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0x7]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0x8]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0x9]);_0x832c9f[_0x4290('0x1f')](_0x50046d[0xa]);_0x832c9f[_0x4290('0x1f')](_0x1c8d95[_0x4290('0x14')]['id']);_0x832c9f[_0x4290('0x1f')](_0x1c8d95[_0x4290('0x13')]['id']);_0x832c9f[_0x4290('0x1f')](_0xa6f7[_0x4290('0x2b')]);_0x832c9f[_0x4290('0x1f')](_0x1c8d95['interaction'][_0x4290('0x2c')]);_0x832c9f[_0x4290('0x1f')](_0x1c8d95[_0x4290('0x2d')]['body']);_0x832c9f[_0x4290('0x1f')](_0x3aa849);break;default:_0x832c9f=_[_0x4290('0xe')](_0xa6f7['appdata'])?[]:_0xa6f7[_0x4290('0x1c')]['split'](',');}var _0xbd3f02={'id':util['format'](_0x4290('0x2e'),_0x15f816,_0xa6f7['id'],_0xa6f7[_0x4290('0x18')]),'condition':require(_0x4290('0x2f'))['condition'](_0x15f816,getIntervals(_0x418062['intervals'],_0xa6f7),_0x418062),'consequence':require(_0x4290('0x30')+_0xa6f7[_0x4290('0x18')])[_0x4290('0x31')](_0x15f816,_0x832c9f,_0x418062,_0x1c8d95),'p':_0xa6f7[_0x4290('0x32')]||0x0};logger[_0x4290('0x33')](_0x4290('0x34'),_0xbd3f02['id'],'on\x20interval',getIntervals(_0x418062[_0x4290('0x35')],_0xa6f7)[_0x4290('0x20')](_0x4290('0x36')));_0x10ff09[_0x4290('0x1f')](_0xbd3f02);}else{logger[_0x4290('0x37')](_0x4290('0x38'),path[_0x4290('0x20')](__dirname,_0x4290('0x15'),_0xa6f7['app']+_0x4290('0x19')));}}_0x418062[_0x4290('0x12')][_0x15f816]=new RuleEngine(_0x10ff09);_0x418062[_0x4290('0x12')][_0x15f816][_0x4290('0x39')](_0x1c8d95,function(_0x359249){logger[_0x4290('0x33')](_0x4290('0x3a'),JSON[_0x4290('0x3b')](_0x359249['matchPath']));if(_0x418062[_0x4290('0x12')][_0x15f816]){_0x418062[_0x4290('0x12')][_0x15f816][_0x4290('0x3c')]('complete');}});return _0x1ff10f({'code':0xc8,'message':_0x1c8d95});}else{logger[_0x4290('0x33')](_0x4290('0x3d'));return _0x1ff10f({'code':0xc8,'message':_0x1c8d95});}}catch(_0x33b9c7){logger['error'](_0x33b9c7[_0x4290('0x3e')]);return _0x5d0a1f(_0xf2f5c9[_0x4290('0x37')](0x1f4,_0x33b9c7));}}return _0x5d0a1f(_0x4290('0x3f'));});},'AcceptMessage':function(_0x5188c5){var _0x4dce69=this;return new Promise(function(_0x2ffd12,_0x3dab56){if(_0x5188c5['agent']&&_0x5188c5[_0x4290('0x40')]['id']){if(_0x418062[_0x4290('0x41')][_0x5188c5['agent']['id']]){_0x418062[_0x4290('0x41')][_0x5188c5[_0x4290('0x40')]['id']][_0x4290('0x42')]=![];_0x418062['agents'][_0x5188c5[_0x4290('0x40')]['id']][_0x4290('0x43')]=undefined;}}if(_0x5188c5[_0x4290('0x13')]&&_0x5188c5[_0x4290('0x13')]['id']){try{var _0x24fb74=getId(_0x5188c5[_0x4290('0x1d')],_0x5188c5[_0x4290('0x13')]?_0x5188c5['message']['id']:0x0,_0x5188c5[_0x4290('0x14')]?_0x5188c5[_0x4290('0x14')]['id']:0x0);if(_0x418062[_0x4290('0x12')][_0x24fb74]){_0x418062[_0x4290('0x12')][_0x24fb74]['emit'](_0x4290('0x44'));if(rpc[_0x5188c5[_0x4290('0x1d')]+_0x4290('0x45')]){rpc[_0x5188c5[_0x4290('0x1d')]+_0x4290('0x45')][_0x4290('0x46')](_0x24fb74,{'UserId':_0x5188c5[_0x4290('0x13')][_0x4290('0x47')]})[_0x4290('0x48')](function(_0x482d0b){logger['error']('error\x20update\x20queue\x20report');});}}return _0x2ffd12({'code':0xc8,'message':_0x5188c5});}catch(_0x38f7e2){logger[_0x4290('0x37')](_0x38f7e2[_0x4290('0x3e')]);return _0x3dab56(_0x4dce69['error'](0x1f4,_0x38f7e2));}}logger[_0x4290('0x37')](_0x4290('0x49'));return _0x3dab56(_0x4dce69[_0x4290('0x37')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x1f1798){var _0x5294ef=this;return new Promise(function(_0x405072,_0xdebc6d){if(_0x1f1798['agent']&&_0x1f1798[_0x4290('0x40')]['id']){try{if(_0x418062[_0x4290('0x41')][_0x1f1798[_0x4290('0x40')]['id']]){_0x418062[_0x4290('0x41')][_0x1f1798['agent']['id']]['busy']=![];_0x418062[_0x4290('0x41')][_0x1f1798[_0x4290('0x40')]['id']][_0x4290('0x43')]=undefined;}return _0x405072({'code':0xc8,'message':_0x1f1798});}catch(_0x118fbe){logger[_0x4290('0x37')](_0x118fbe[_0x4290('0x3e')]);return _0xdebc6d(_0x5294ef['error'](0x1f4,_0x118fbe));}}logger['error']('message\x20is\x20empty');return _0xdebc6d(_0x5294ef[_0x4290('0x37')](0x1f4,_0x4290('0x49')));});},'AbandonInteraction':function(_0x3d112b){var _0x1b4e38=this;return new Promise(function(_0x8a75ff,_0x241e47){if(_0x3d112b['channel']&&_0x3d112b[_0x4290('0x14')]&&_0x3d112b['interaction']['id']){try{var _0x176ba6=getId(_0x3d112b[_0x4290('0x1d')],_0x3d112b[_0x4290('0x13')]?_0x3d112b['message']['id']:0x0,_0x3d112b[_0x4290('0x14')]?_0x3d112b['interaction']['id']:0x0);if(_0x418062[_0x4290('0x12')][_0x176ba6]){_0x418062['rules'][_0x176ba6][_0x4290('0x3c')](_0x4290('0x44'));}return _0x8a75ff({'code':0xc8,'message':_0x3d112b});}catch(_0x20b8b4){logger['error'](_0x20b8b4[_0x4290('0x3e')]);return _0x241e47(_0x1b4e38[_0x4290('0x37')](0x1f4,_0x20b8b4));}}logger[_0x4290('0x37')]('message\x20is\x20empty');return _0x241e47(_0x1b4e38['error'](0x1f4,_0x4290('0x49')));});},'AgentCapacity':function(_0xd6f143){var _0x4589c0=this;return new Promise(function(_0x46f0b4,_0x27070e){if(_0x418062[_0x4290('0x41')][_0x4290('0x4a')](_0xd6f143['id'])){for(var _0x2e1e6b in _0xd6f143[_0x4290('0x4b')]){if(_0xd6f143[_0x4290('0x4b')]['hasOwnProperty'](_0x2e1e6b)){if(_0x418062['agents'][_0xd6f143['id']][_0x4290('0x4a')](_0x2e1e6b+_0x4290('0x4c'))){_0x418062['agents'][_0xd6f143['id']][_0x2e1e6b+_0x4290('0x4c')]=parseInt(_0xd6f143[_0x4290('0x4b')][_0x2e1e6b],0xa);}}}_0x418062['agents'][_0xd6f143['id']][_0x4290('0x4d')]();return _0x46f0b4({'code':0xc8,'message':_0x418062['agents'][_0xd6f143['id']]});}else{return _0x27070e(_0x4589c0[_0x4290('0x37')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x104862){return new Promise(function(_0x3f8611,_0xeeec6a){var _0x9b6a73=_[_0x4290('0x4e')](_0x418062[_0x4290('0x41')]);_0x3f8611({'count':_0x9b6a73[_0x4290('0x16')],'rows':_0x9b6a73});});},'ChatQueues':function(_0xe6aad7){return new Promise(function(_0x55e3ed,_0x316a03){var _0x376a96=[];for(var _0x56f869 in _0x418062[_0x4290('0x4f')]){if(_0x418062[_0x4290('0x4f')][_0x4290('0x4a')](_0x56f869)){var _0x4d1ffd=_0x418062[_0x4290('0x4f')][_0x56f869];var _0x1a6453={'id':_0x4d1ffd['id'],'available':_0x4d1ffd[_0x4290('0x50')],'loggedIn':_0x4d1ffd[_0x4290('0x51')],'name':_0x4d1ffd[_0x4290('0x52')],'paused':_0x4d1ffd['paused'],'waiting':_0x4d1ffd[_0x4290('0x53')]};_0x376a96[_0x4290('0x1f')](_0x1a6453);}}_0x55e3ed({'count':_0x376a96[_0x4290('0x16')],'rows':_0x376a96});});},'MailQueues':function(_0x50b472){return new Promise(function(_0x35ad4d,_0x972119){var _0x593b2b=[];for(var _0x510c71 in _0x418062[_0x4290('0x54')]){if(_0x418062[_0x4290('0x54')][_0x4290('0x4a')](_0x510c71)){var _0x233047=_0x418062[_0x4290('0x54')][_0x510c71];var _0x5eef61={'id':_0x233047['id'],'available':_0x233047['available'],'loggedIn':_0x233047[_0x4290('0x51')],'name':_0x233047[_0x4290('0x52')],'paused':_0x233047[_0x4290('0x55')],'waiting':_0x233047[_0x4290('0x53')]};_0x593b2b[_0x4290('0x1f')](_0x5eef61);}}_0x35ad4d({'count':_0x593b2b['length'],'rows':_0x593b2b});});},'OpenchannelQueues':function(_0x1c72f4){return new Promise(function(_0x34c796,_0x6edae0){var _0x199b3=[];for(var _0x510d6d in _0x418062[_0x4290('0x56')]){if(_0x418062[_0x4290('0x56')][_0x4290('0x4a')](_0x510d6d)){var _0x5b25ea=_0x418062[_0x4290('0x56')][_0x510d6d];var _0xde0d5b={'id':_0x5b25ea['id'],'available':_0x5b25ea['available'],'loggedIn':_0x5b25ea[_0x4290('0x51')],'name':_0x5b25ea[_0x4290('0x52')],'paused':_0x5b25ea[_0x4290('0x55')],'waiting':_0x5b25ea[_0x4290('0x53')]};_0x199b3[_0x4290('0x1f')](_0xde0d5b);}}_0x34c796({'count':_0x199b3[_0x4290('0x16')],'rows':_0x199b3});});},'SmsQueues':function(_0xee2cb5){return new Promise(function(_0x187bfa,_0x3022c5){var _0x565866=[];for(var _0xbbb525 in _0x418062[_0x4290('0x57')]){if(_0x418062[_0x4290('0x57')][_0x4290('0x4a')](_0xbbb525)){var _0x4ea5b0=_0x418062[_0x4290('0x57')][_0xbbb525];var _0x3af26b={'id':_0x4ea5b0['id'],'available':_0x4ea5b0[_0x4290('0x50')],'loggedIn':_0x4ea5b0[_0x4290('0x51')],'name':_0x4ea5b0[_0x4290('0x52')],'paused':_0x4ea5b0[_0x4290('0x55')],'waiting':_0x4ea5b0[_0x4290('0x53')]};_0x565866[_0x4290('0x1f')](_0x3af26b);}}_0x187bfa({'count':_0x565866[_0x4290('0x16')],'rows':_0x565866});});},'FaxQueues':function(_0x2ff306){return new Promise(function(_0x42187e,_0x4c047e){var _0x15495d=[];for(var _0x4beeac in _0x418062[_0x4290('0x58')]){if(_0x418062[_0x4290('0x58')][_0x4290('0x4a')](_0x4beeac)){var _0x496549=_0x418062[_0x4290('0x58')][_0x4beeac];var _0x552dbf={'id':_0x496549['id'],'available':_0x496549[_0x4290('0x50')],'loggedIn':_0x496549[_0x4290('0x51')],'name':_0x496549[_0x4290('0x52')],'paused':_0x496549[_0x4290('0x55')],'waiting':_0x496549['waiting']};_0x15495d[_0x4290('0x1f')](_0x552dbf);}}_0x42187e({'count':_0x15495d[_0x4290('0x16')],'rows':_0x15495d});});},'WhatsappQueues':function(_0x57fc9d){return new Promise(function(_0x34d09a,_0x2fa757){var _0x278b42=[];for(var _0x4e34f6 in _0x418062['whatsappQueues']){if(_0x418062[_0x4290('0x59')][_0x4290('0x4a')](_0x4e34f6)){var _0x343d1c=_0x418062[_0x4290('0x59')][_0x4e34f6];var _0x4bb593={'id':_0x343d1c['id'],'available':_0x343d1c[_0x4290('0x50')],'loggedIn':_0x343d1c[_0x4290('0x51')],'name':_0x343d1c['name'],'paused':_0x343d1c[_0x4290('0x55')],'waiting':_0x343d1c[_0x4290('0x53')]};_0x278b42[_0x4290('0x1f')](_0x4bb593);}}_0x34d09a({'count':_0x278b42['length'],'rows':_0x278b42});});},'ChatQueuesWaitingInteractions':function(_0x3bf5c0){return new Promise(function(_0x531890,_0x17b73e){var _0x2963d8=_[_0x4290('0x4e')](_0x418062[_0x4290('0x5a')]);_0x531890({'count':_0x2963d8[_0x4290('0x16')],'rows':_0x2963d8});});},'MailQueuesWaitingInteractions':function(_0x2d44dd){return new Promise(function(_0x136be5,_0x3ec706){var _0x1102d8=_[_0x4290('0x4e')](_0x418062[_0x4290('0x5b')]);_0x136be5({'count':_0x1102d8[_0x4290('0x16')],'rows':_0x1102d8});});},'OpenchannelQueuesWaitingInteractions':function(_0x385b1c){return new Promise(function(_0xb1d1c2,_0x453dac){var _0x296a66=_[_0x4290('0x4e')](_0x418062[_0x4290('0x5c')]);_0xb1d1c2({'count':_0x296a66['length'],'rows':_0x296a66});});},'SmsQueuesWaitingInteractions':function(_0x246e54){return new Promise(function(_0x5d5b89,_0x32a1c2){var _0x255d80=_[_0x4290('0x4e')](_0x418062[_0x4290('0x5d')]);_0x5d5b89({'count':_0x255d80[_0x4290('0x16')],'rows':_0x255d80});});},'FaxQueuesWaitingInteractions':function(_0x4ff2c2){return new Promise(function(_0x9cb14f,_0x560c3e){var _0x1027ed=_[_0x4290('0x4e')](_0x418062[_0x4290('0x5e')]);_0x9cb14f({'count':_0x1027ed[_0x4290('0x16')],'rows':_0x1027ed});});},'WhatsappQueuesWaitingInteractions':function(_0x24f83e){return new Promise(function(_0x3c79c4,_0x5b96c6){var _0x4273ef=_[_0x4290('0x4e')](_0x418062[_0x4290('0x5f')]);_0x3c79c4({'count':_0x4273ef[_0x4290('0x16')],'rows':_0x4273ef});});}};var _0x157e7f=jayson[_0x4290('0x60')](_0x5f13c4)[_0x4290('0x61')]();_0x157e7f['on'](_0x4290('0x37'),function(_0x31dfc6){logger[_0x4290('0x37')](JSON['stringify'](_0x31dfc6));return _0x3e13b6(_0x31dfc6);});_0x157e7f[_0x4290('0x62')](0x232c,_0x4290('0x63'),function(){console[_0x4290('0x64')](_0x4290('0x65'),0x232c);return _0x59a02c(_0x4290('0x66')+0x232c);});});}; \ No newline at end of file +var _0xacfe=['\x20|\x20','error','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','channel','mail','push','slice','dialogflowv2','amazonlex','TagId','tvox','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','on\x20interval'];(function(_0x84773f,_0x5aef02){var _0x43323a=function(_0x5b4d0b){while(--_0x5b4d0b){_0x84773f['push'](_0x84773f['shift']());}};_0x43323a(++_0x5aef02);}(_0xacfe,0xfd));var _0xeacf=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xacfe[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0xeacf('0x0'));var fs=require('fs');var jayson=require(_0xeacf('0x1'));var BPromise=require(_0xeacf('0x2'));var uuid=require(_0xeacf('0x3'));var utils=require(_0xeacf('0x4'));var config=require(_0xeacf('0x5'));var logger=require(_0xeacf('0x6'))(_0xeacf('0x7'));var rpc={'openchannelQueueReport':require(_0xeacf('0x8')),'mailQueueReport':require(_0xeacf('0x9')),'chatQueueReport':require(_0xeacf('0xa')),'smsQueueReport':require(_0xeacf('0xb')),'faxQueueReport':require(_0xeacf('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xeacf('0xd'));function getId(_0xce0437,_0x17b21c,_0xf5c2e4){return util['format'](_0xeacf('0xe'),_0xce0437,_0x17b21c||0x0,_0xf5c2e4||0x0);}function getIntervals(_0x4b62cf,_0x41f6ed){var _0x20e7d7=[];if(!_[_0xeacf('0xf')](_0x41f6ed[_0xeacf('0x10')])&&!_[_0xeacf('0xf')](_0x4b62cf[_0x41f6ed[_0xeacf('0x10')]])&&!_[_0xeacf('0xf')](_0x4b62cf[_0x41f6ed[_0xeacf('0x10')]][_0xeacf('0x11')])){_0x20e7d7=_[_0xeacf('0x12')](_0x4b62cf[_0x41f6ed['IntervalId']][_0xeacf('0x11')],_0xeacf('0x13'));}else if(!_[_0xeacf('0xf')](_0x41f6ed[_0xeacf('0x13')])){_0x20e7d7=[_0x41f6ed['interval']];}return _0x20e7d7;}exports[_0xeacf('0x14')]=function(_0xe8eab2){_0xe8eab2[_0xeacf('0x15')]={};return new BPromise(function(_0x57d0fb,_0x5328a3){var _0x5e3c80={'Start':function(_0xdef37f){var _0x51619b=this;return new Promise(function(_0x31bc9a,_0x5f3326){if(_0xdef37f){try{var _0x1505a3=[];var _0x1df080=getId(_0xdef37f['channel'],_0xdef37f[_0xeacf('0x16')]?_0xdef37f['message']['id']:0x0,_0xdef37f[_0xeacf('0x17')]?_0xdef37f[_0xeacf('0x17')]['id']:0x0);if(_0xdef37f[_0xeacf('0x18')]&&_[_0xeacf('0x19')](_0xdef37f['applications'])&&_0xdef37f[_0xeacf('0x18')]['length']){for(var _0xabd595=0x0;_0xabd595<_0xdef37f[_0xeacf('0x18')][_0xeacf('0x1a')];_0xabd595+=0x1){var _0x4a8e66=_0xdef37f[_0xeacf('0x18')][_0xabd595];if(fs[_0xeacf('0x1b')](path[_0xeacf('0x1c')](__dirname,_0xeacf('0x18'),_0x4a8e66[_0xeacf('0x1d')]+_0xeacf('0x1e')))){var _0x340a85=[];switch(_0x4a8e66[_0xeacf('0x1d')][_0xeacf('0x1f')]()){case'autoreply':var _0x7ba6a4=_0x4a8e66[_0xeacf('0x20')][_0xeacf('0x21')](',');if(_0xdef37f[_0xeacf('0x22')]===_0xeacf('0x23')){_0x340a85[_0xeacf('0x24')](_0x7ba6a4[0x0]);_0x340a85[_0xeacf('0x24')](_0x7ba6a4[0x1]);_0x340a85['push'](_0x7ba6a4['slice'](0x2,_0x7ba6a4[_0xeacf('0x1a')])[_0xeacf('0x1c')](','));}else{_0x340a85['push'](_0x7ba6a4[0x0]);_0x340a85[_0xeacf('0x24')](_0x7ba6a4[_0xeacf('0x25')](0x1,_0x7ba6a4[_0xeacf('0x1a')])[_0xeacf('0x1c')](','));}break;case'dialogflow':var _0x3aae94=_0x4a8e66[_0xeacf('0x20')]['split'](',');_0x340a85[_0xeacf('0x24')](_0x3aae94[0x0]);_0x340a85[_0xeacf('0x24')](_0x3aae94[0x1]);_0x340a85[_0xeacf('0x24')](_0x3aae94[_0xeacf('0x25')](0x2,_0x3aae94['length'])[_0xeacf('0x1c')](','));break;case _0xeacf('0x26'):var _0x4f6c25=_0x4a8e66['appdata']['split'](',');_0x340a85['push'](_0x4f6c25[0x0]);_0x340a85[_0xeacf('0x24')](_0x4f6c25[0x1]);_0x340a85[_0xeacf('0x24')](_0x4f6c25[0x2]);_0x340a85[_0xeacf('0x24')](_0x4f6c25[0x3]);_0x340a85[_0xeacf('0x24')](_0x4f6c25['slice'](0x4,_0x4f6c25[_0xeacf('0x1a')])[_0xeacf('0x1c')](','));break;case _0xeacf('0x27'):var _0x2c9808=_0x4a8e66[_0xeacf('0x20')][_0xeacf('0x21')](',');_0x340a85['push'](_0x2c9808[0x0]);_0x340a85[_0xeacf('0x24')](_0x2c9808[0x1]);_0x340a85[_0xeacf('0x24')](_0x2c9808[0x2]);_0x340a85['push'](_0x2c9808[0x3]);_0x340a85['push'](_0x2c9808[_0xeacf('0x25')](0x4,_0x2c9808[_0xeacf('0x1a')])['join'](','));break;case _0xeacf('0x16'):_0x340a85[_0xeacf('0x24')](_0x4a8e66[_0xeacf('0x20')]);break;case'tag':_0x340a85[_0xeacf('0x24')](_0x4a8e66[_0xeacf('0x28')]);_0x340a85[_0xeacf('0x24')](_0x4a8e66[_0xeacf('0x20')]);break;case _0xeacf('0x29'):var _0x2e680a=utils['getMustacheRender'](_0xdef37f[_0xeacf('0x2a')][_0xeacf('0x2b')],_0xdef37f);var _0x586ac7=_0x4a8e66[_0xeacf('0x20')][_0xeacf('0x21')](',');_0x340a85['push'](_0x586ac7[0x0]);_0x340a85['push'](_0x586ac7[0x1]);_0x340a85['push'](_0x586ac7[0x2]);_0x340a85['push'](_0x586ac7[0x3]);_0x340a85[_0xeacf('0x24')](_0x586ac7[0x4]);_0x340a85['push'](_0x586ac7[0x5]);_0x340a85[_0xeacf('0x24')](_0x586ac7[0x6]);_0x340a85[_0xeacf('0x24')](_0x586ac7[0x7]);_0x340a85[_0xeacf('0x24')](_0x586ac7[0x8]);_0x340a85['push'](_0x586ac7[0x9]);_0x340a85[_0xeacf('0x24')](_0x586ac7[0xa]);_0x340a85[_0xeacf('0x24')](_0xdef37f[_0xeacf('0x17')]['id']);_0x340a85[_0xeacf('0x24')](_0xdef37f[_0xeacf('0x16')]['id']);_0x340a85[_0xeacf('0x24')](_0x4a8e66[_0xeacf('0x2c')]);_0x340a85['push'](_0xdef37f[_0xeacf('0x17')]['ContactId']);_0x340a85[_0xeacf('0x24')](_0xdef37f[_0xeacf('0x2d')][_0xeacf('0x2d')]);_0x340a85['push'](_0x2e680a);break;default:_0x340a85=_[_0xeacf('0xf')](_0x4a8e66['appdata'])?[]:_0x4a8e66['appdata'][_0xeacf('0x21')](',');}var _0x5950b0={'id':util['format'](_0xeacf('0x2e'),_0x1df080,_0x4a8e66['id'],_0x4a8e66[_0xeacf('0x1d')]),'condition':require(_0xeacf('0x2f'))[_0xeacf('0x30')](_0x1df080,getIntervals(_0xe8eab2[_0xeacf('0x31')],_0x4a8e66),_0xe8eab2),'consequence':require(_0xeacf('0x32')+_0x4a8e66['app'])['consequence'](_0x1df080,_0x340a85,_0xe8eab2,_0xdef37f),'p':_0x4a8e66[_0xeacf('0x33')]||0x0};logger['info']('Push\x20new\x20rule',_0x5950b0['id'],_0xeacf('0x34'),getIntervals(_0xe8eab2[_0xeacf('0x31')],_0x4a8e66)['join'](_0xeacf('0x35')));_0x1505a3[_0xeacf('0x24')](_0x5950b0);}else{logger[_0xeacf('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xeacf('0x1c')](__dirname,_0xeacf('0x18'),_0x4a8e66[_0xeacf('0x1d')]+_0xeacf('0x1e')));}}_0xe8eab2[_0xeacf('0x15')][_0x1df080]=new RuleEngine(_0x1505a3);_0xe8eab2[_0xeacf('0x15')][_0x1df080][_0xeacf('0x37')](_0xdef37f,function(_0x36061d){logger[_0xeacf('0x38')](_0xeacf('0x39'),JSON[_0xeacf('0x3a')](_0x36061d[_0xeacf('0x3b')]));if(_0xe8eab2['rules'][_0x1df080]){_0xe8eab2[_0xeacf('0x15')][_0x1df080][_0xeacf('0x3c')](_0xeacf('0x3d'));}});return _0x31bc9a({'code':0xc8,'message':_0xdef37f});}else{logger['info'](_0xeacf('0x3e'));return _0x31bc9a({'code':0xc8,'message':_0xdef37f});}}catch(_0x557df4){logger[_0xeacf('0x36')](_0x557df4[_0xeacf('0x3f')]);return _0x5f3326(_0x51619b[_0xeacf('0x36')](0x1f4,_0x557df4));}}return _0x5f3326(_0xeacf('0x40'));});},'AcceptMessage':function(_0x524838){var _0x32ef28=this;return new Promise(function(_0x49dbd0,_0x406863){if(_0x524838[_0xeacf('0x41')]&&_0x524838[_0xeacf('0x41')]['id']){if(_0xe8eab2[_0xeacf('0x42')][_0x524838['agent']['id']]){_0xe8eab2[_0xeacf('0x42')][_0x524838[_0xeacf('0x41')]['id']][_0xeacf('0x43')]=![];_0xe8eab2['agents'][_0x524838[_0xeacf('0x41')]['id']][_0xeacf('0x44')]=undefined;}}if(_0x524838['message']&&_0x524838[_0xeacf('0x16')]['id']){try{var _0xc4328d=getId(_0x524838[_0xeacf('0x22')],_0x524838[_0xeacf('0x16')]?_0x524838[_0xeacf('0x16')]['id']:0x0,_0x524838['interaction']?_0x524838['interaction']['id']:0x0);if(_0xe8eab2[_0xeacf('0x15')][_0xc4328d]){_0xe8eab2[_0xeacf('0x15')][_0xc4328d][_0xeacf('0x3c')](_0xeacf('0x45'));if(rpc[_0x524838['channel']+_0xeacf('0x46')]){rpc[_0x524838[_0xeacf('0x22')]+'QueueReport']['update'](_0xc4328d,{'UserId':_0x524838[_0xeacf('0x16')]['UserId']})[_0xeacf('0x47')](function(_0x174672){logger['error'](_0xeacf('0x48'));});}}return _0x49dbd0({'code':0xc8,'message':_0x524838});}catch(_0x29a01f){logger[_0xeacf('0x36')](_0x29a01f[_0xeacf('0x3f')]);return _0x406863(_0x32ef28['error'](0x1f4,_0x29a01f));}}logger[_0xeacf('0x36')](_0xeacf('0x49'));return _0x406863(_0x32ef28[_0xeacf('0x36')](0x1f4,_0xeacf('0x49')));});},'RejectMessage':function(_0x5d8dc0){var _0x3d007e=this;return new Promise(function(_0x115ea8,_0x4e6108){if(_0x5d8dc0[_0xeacf('0x41')]&&_0x5d8dc0[_0xeacf('0x41')]['id']){try{if(_0xe8eab2[_0xeacf('0x42')][_0x5d8dc0[_0xeacf('0x41')]['id']]){_0xe8eab2[_0xeacf('0x42')][_0x5d8dc0[_0xeacf('0x41')]['id']][_0xeacf('0x43')]=![];_0xe8eab2[_0xeacf('0x42')][_0x5d8dc0[_0xeacf('0x41')]['id']]['busyQueue']=undefined;}return _0x115ea8({'code':0xc8,'message':_0x5d8dc0});}catch(_0x12b099){logger[_0xeacf('0x36')](_0x12b099['stack']);return _0x4e6108(_0x3d007e[_0xeacf('0x36')](0x1f4,_0x12b099));}}logger[_0xeacf('0x36')](_0xeacf('0x49'));return _0x4e6108(_0x3d007e[_0xeacf('0x36')](0x1f4,_0xeacf('0x49')));});},'AbandonInteraction':function(_0x5edebb){var _0x3f9bc2=this;return new Promise(function(_0x26118e,_0x46240d){if(_0x5edebb[_0xeacf('0x22')]&&_0x5edebb[_0xeacf('0x17')]&&_0x5edebb['interaction']['id']){try{var _0x3367e3=getId(_0x5edebb[_0xeacf('0x22')],_0x5edebb[_0xeacf('0x16')]?_0x5edebb[_0xeacf('0x16')]['id']:0x0,_0x5edebb[_0xeacf('0x17')]?_0x5edebb[_0xeacf('0x17')]['id']:0x0);if(_0xe8eab2[_0xeacf('0x15')][_0x3367e3]){_0xe8eab2[_0xeacf('0x15')][_0x3367e3]['emit'](_0xeacf('0x45'));}return _0x26118e({'code':0xc8,'message':_0x5edebb});}catch(_0x451939){logger[_0xeacf('0x36')](_0x451939['stack']);return _0x46240d(_0x3f9bc2[_0xeacf('0x36')](0x1f4,_0x451939));}}logger[_0xeacf('0x36')](_0xeacf('0x49'));return _0x46240d(_0x3f9bc2['error'](0x1f4,_0xeacf('0x49')));});},'AgentCapacity':function(_0x3f79f1){var _0x40b95b=this;return new Promise(function(_0x3c582a,_0x78ddb9){if(_0xe8eab2['agents'][_0xeacf('0x4a')](_0x3f79f1['id'])){for(var _0x456a94 in _0x3f79f1[_0xeacf('0x4b')]){if(_0x3f79f1[_0xeacf('0x4b')][_0xeacf('0x4a')](_0x456a94)){if(_0xe8eab2[_0xeacf('0x42')][_0x3f79f1['id']][_0xeacf('0x4a')](_0x456a94+_0xeacf('0x4c'))){_0xe8eab2[_0xeacf('0x42')][_0x3f79f1['id']][_0x456a94+'CurrentCapacity']=parseInt(_0x3f79f1[_0xeacf('0x4b')][_0x456a94],0xa);}}}_0xe8eab2[_0xeacf('0x42')][_0x3f79f1['id']][_0xeacf('0x4d')]();return _0x3c582a({'code':0xc8,'message':_0xe8eab2[_0xeacf('0x42')][_0x3f79f1['id']]});}else{return _0x78ddb9(_0x40b95b[_0xeacf('0x36')](0x1f4,_0xeacf('0x4e')));}});},'Agents':function(_0x380840){return new Promise(function(_0x548ad9,_0x3af1b4){var _0x13e9c4=_[_0xeacf('0x4f')](_0xe8eab2[_0xeacf('0x42')]);_0x548ad9({'count':_0x13e9c4[_0xeacf('0x1a')],'rows':_0x13e9c4});});},'ChatQueues':function(_0xa7c8e2){return new Promise(function(_0x22c8c8,_0x40e510){var _0x41dc52=[];for(var _0x18875b in _0xe8eab2[_0xeacf('0x50')]){if(_0xe8eab2[_0xeacf('0x50')][_0xeacf('0x4a')](_0x18875b)){var _0x1ad844=_0xe8eab2[_0xeacf('0x50')][_0x18875b];var _0x36780e={'id':_0x1ad844['id'],'available':_0x1ad844[_0xeacf('0x51')],'loggedIn':_0x1ad844[_0xeacf('0x52')],'name':_0x1ad844[_0xeacf('0x53')],'paused':_0x1ad844[_0xeacf('0x54')],'waiting':_0x1ad844[_0xeacf('0x55')]};_0x41dc52[_0xeacf('0x24')](_0x36780e);}}_0x22c8c8({'count':_0x41dc52[_0xeacf('0x1a')],'rows':_0x41dc52});});},'MailQueues':function(_0x49fdb8){return new Promise(function(_0x406c48,_0x3a7340){var _0x5c44ce=[];for(var _0x10f803 in _0xe8eab2[_0xeacf('0x56')]){if(_0xe8eab2['mailQueues'][_0xeacf('0x4a')](_0x10f803)){var _0x58267d=_0xe8eab2[_0xeacf('0x56')][_0x10f803];var _0x3f393a={'id':_0x58267d['id'],'available':_0x58267d[_0xeacf('0x51')],'loggedIn':_0x58267d['loggedIn'],'name':_0x58267d['name'],'paused':_0x58267d['paused'],'waiting':_0x58267d[_0xeacf('0x55')]};_0x5c44ce[_0xeacf('0x24')](_0x3f393a);}}_0x406c48({'count':_0x5c44ce[_0xeacf('0x1a')],'rows':_0x5c44ce});});},'OpenchannelQueues':function(_0x113135){return new Promise(function(_0x49489d,_0x26db58){var _0x3e1897=[];for(var _0x3b4a83 in _0xe8eab2[_0xeacf('0x57')]){if(_0xe8eab2[_0xeacf('0x57')]['hasOwnProperty'](_0x3b4a83)){var _0x28f699=_0xe8eab2[_0xeacf('0x57')][_0x3b4a83];var _0x6c8c30={'id':_0x28f699['id'],'available':_0x28f699['available'],'loggedIn':_0x28f699[_0xeacf('0x52')],'name':_0x28f699['name'],'paused':_0x28f699[_0xeacf('0x54')],'waiting':_0x28f699[_0xeacf('0x55')]};_0x3e1897[_0xeacf('0x24')](_0x6c8c30);}}_0x49489d({'count':_0x3e1897[_0xeacf('0x1a')],'rows':_0x3e1897});});},'SmsQueues':function(_0x588af0){return new Promise(function(_0x444db8,_0x36edd0){var _0x47c1f0=[];for(var _0x5283d6 in _0xe8eab2[_0xeacf('0x58')]){if(_0xe8eab2[_0xeacf('0x58')][_0xeacf('0x4a')](_0x5283d6)){var _0x1fdbf9=_0xe8eab2[_0xeacf('0x58')][_0x5283d6];var _0xd63e28={'id':_0x1fdbf9['id'],'available':_0x1fdbf9[_0xeacf('0x51')],'loggedIn':_0x1fdbf9[_0xeacf('0x52')],'name':_0x1fdbf9[_0xeacf('0x53')],'paused':_0x1fdbf9[_0xeacf('0x54')],'waiting':_0x1fdbf9[_0xeacf('0x55')]};_0x47c1f0[_0xeacf('0x24')](_0xd63e28);}}_0x444db8({'count':_0x47c1f0[_0xeacf('0x1a')],'rows':_0x47c1f0});});},'FaxQueues':function(_0x5c997d){return new Promise(function(_0x167a98,_0x2e02b7){var _0x1b2dd7=[];for(var _0x351953 in _0xe8eab2[_0xeacf('0x59')]){if(_0xe8eab2[_0xeacf('0x59')][_0xeacf('0x4a')](_0x351953)){var _0x118502=_0xe8eab2[_0xeacf('0x59')][_0x351953];var _0x34b576={'id':_0x118502['id'],'available':_0x118502[_0xeacf('0x51')],'loggedIn':_0x118502['loggedIn'],'name':_0x118502[_0xeacf('0x53')],'paused':_0x118502[_0xeacf('0x54')],'waiting':_0x118502[_0xeacf('0x55')]};_0x1b2dd7['push'](_0x34b576);}}_0x167a98({'count':_0x1b2dd7[_0xeacf('0x1a')],'rows':_0x1b2dd7});});},'WhatsappQueues':function(_0x5e1e62){return new Promise(function(_0x2c9681,_0xf3c42d){var _0x4fbc23=[];for(var _0x5cb6ed in _0xe8eab2[_0xeacf('0x5a')]){if(_0xe8eab2[_0xeacf('0x5a')][_0xeacf('0x4a')](_0x5cb6ed)){var _0x3357e6=_0xe8eab2[_0xeacf('0x5a')][_0x5cb6ed];var _0x3d6885={'id':_0x3357e6['id'],'available':_0x3357e6[_0xeacf('0x51')],'loggedIn':_0x3357e6['loggedIn'],'name':_0x3357e6['name'],'paused':_0x3357e6['paused'],'waiting':_0x3357e6[_0xeacf('0x55')]};_0x4fbc23[_0xeacf('0x24')](_0x3d6885);}}_0x2c9681({'count':_0x4fbc23['length'],'rows':_0x4fbc23});});},'ChatQueuesWaitingInteractions':function(_0xce2d59){return new Promise(function(_0x359d56,_0x24a81c){var _0x5091f1=_[_0xeacf('0x4f')](_0xe8eab2[_0xeacf('0x5b')]);_0x359d56({'count':_0x5091f1['length'],'rows':_0x5091f1});});},'MailQueuesWaitingInteractions':function(_0x307f80){return new Promise(function(_0x2ec956,_0x322bcc){var _0x42a4b6=_[_0xeacf('0x4f')](_0xe8eab2[_0xeacf('0x5c')]);_0x2ec956({'count':_0x42a4b6[_0xeacf('0x1a')],'rows':_0x42a4b6});});},'OpenchannelQueuesWaitingInteractions':function(_0x2703d8){return new Promise(function(_0x4f4aa5,_0x4f0bc6){var _0x11fc1e=_['values'](_0xe8eab2[_0xeacf('0x5d')]);_0x4f4aa5({'count':_0x11fc1e['length'],'rows':_0x11fc1e});});},'SmsQueuesWaitingInteractions':function(_0x4940f0){return new Promise(function(_0x4a27a7,_0x2ebdd8){var _0xa81b78=_['values'](_0xe8eab2['smsQueuesWaitingInteractions']);_0x4a27a7({'count':_0xa81b78['length'],'rows':_0xa81b78});});},'FaxQueuesWaitingInteractions':function(_0x4ce65a){return new Promise(function(_0x17fab9,_0x105a0b){var _0x50845e=_[_0xeacf('0x4f')](_0xe8eab2[_0xeacf('0x5e')]);_0x17fab9({'count':_0x50845e[_0xeacf('0x1a')],'rows':_0x50845e});});},'WhatsappQueuesWaitingInteractions':function(_0x3d1d55){return new Promise(function(_0x28df21,_0x3cbdd9){var _0x52c9a2=_[_0xeacf('0x4f')](_0xe8eab2[_0xeacf('0x5f')]);_0x28df21({'count':_0x52c9a2['length'],'rows':_0x52c9a2});});}};var _0x190380=jayson[_0xeacf('0x60')](_0x5e3c80)[_0xeacf('0x61')]();_0x190380['on'](_0xeacf('0x36'),function(_0x17b123){logger[_0xeacf('0x36')](JSON[_0xeacf('0x3a')](_0x17b123));return _0x5328a3(_0x17b123);});_0x190380[_0xeacf('0x14')](0x232c,_0xeacf('0x62'),function(){console[_0xeacf('0x63')](_0xeacf('0x64'),0x232c);return _0x57d0fb(_0xeacf('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f666151..6c67693 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 _0x9fc1=['all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','then','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','indexOf','error','[%s][INTERVAL]\x20%s'];(function(_0x2df688,_0x1f66e7){var _0x2ed4fc=function(_0x3c25b5){while(--_0x3c25b5){_0x2df688['push'](_0x2df688['shift']());}};_0x2ed4fc(++_0x1f66e7);}(_0x9fc1,0x13b));var _0x19fc=function(_0x5200b6,_0x10f232){_0x5200b6=_0x5200b6-0x0;var _0x463aed=_0x9fc1[_0x5200b6];return _0x463aed;};'use strict';var util=require(_0x19fc('0x0'));var BPromise=require(_0x19fc('0x1'));var jayson=require(_0x19fc('0x2'));var _=require(_0x19fc('0x3'));var logger=require(_0x19fc('0x4'))(_0x19fc('0x5'));var client=jayson['client'][_0x19fc('0x6')]({'port':0x232a});function request(_0x9a5155,_0x37be42){return new BPromise(function(_0x48aebb,_0xc19e44){return client['request'](_0x9a5155,_0x37be42)[_0x19fc('0x7')](function(_0x2552a7){if(_0x2552a7['error']){return _0xc19e44(_0x2552a7['error'][_0x19fc('0x8')]);}else{return _0x48aebb(_0x2552a7['result']);}})[_0x19fc('0x9')](function(_0x436dfb){return _0xc19e44(_0x436dfb);});});}exports['condition']=function(_0x2a6a7d,_0x23afc0,_0x12bb21){return function(_0x463c6e){if(_0x12bb21[_0x19fc('0xa')]&&!_0x12bb21[_0x19fc('0xa')][_0x2a6a7d]){logger[_0x19fc('0xb')](_0x19fc('0xc'),_0x2a6a7d);return _0x463c6e[_0x19fc('0xd')]();}var _0x663874=[];for(var _0x180ec5=0x0;_0x180ec5<_0x23afc0[_0x19fc('0xe')];_0x180ec5+=0x1){_0x663874['push'](request(_0x19fc('0xf'),{'command':util[_0x19fc('0x10')](_0x19fc('0x11'),_0x23afc0[_0x180ec5])})[_0x19fc('0x7')](function(_0x477c54){return _0x477c54&&_0x477c54[_0x19fc('0x8')]&&_0x477c54['message'][_0x19fc('0x12')]('true')>=0x0?!![]:![];})['catch'](function(_0x13bc7d){logger[_0x19fc('0x13')](_0x19fc('0x14'),_0x2a6a7d,_0x23afc0[_0x180ec5]);}));}BPromise[_0x19fc('0x15')](_0x663874)[_0x19fc('0x7')](function(_0x2e0536){var _0x4b7baa=_[_0x19fc('0x16')](_0x2e0536);logger[_0x19fc('0xb')](_0x19fc('0x17'),_0x2a6a7d,_0x23afc0[_0x19fc('0x18')]('\x20|\x20'),_0x4b7baa);_0x463c6e[_0x19fc('0x19')](_0x4b7baa);})['catch'](function(_0x124d41){console[_0x19fc('0x1a')](_0x124d41);logger['error'](_0x19fc('0x17'),_0x2a6a7d,_0x23afc0['join']('\x20|\x20'),_0x124d41[_0x19fc('0x1b')]);_0x463c6e['stop']();});};}; \ No newline at end of file +var _0xb174=['stop','length','push','Command','format','iftime\x20%s','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','log','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules','info'];(function(_0x15035b,_0x3eba0a){var _0x2cc7b1=function(_0x144b32){while(--_0x144b32){_0x15035b['push'](_0x15035b['shift']());}};_0x2cc7b1(++_0x3eba0a);}(_0xb174,0xe8));var _0x4b17=function(_0x1eb578,_0x1a7a53){_0x1eb578=_0x1eb578-0x0;var _0x521171=_0xb174[_0x1eb578];return _0x521171;};'use strict';var util=require(_0x4b17('0x0'));var BPromise=require(_0x4b17('0x1'));var jayson=require(_0x4b17('0x2'));var _=require(_0x4b17('0x3'));var logger=require(_0x4b17('0x4'))(_0x4b17('0x5'));var client=jayson['client'][_0x4b17('0x6')]({'port':0x232a});function request(_0x30a305,_0x7e39cd){return new BPromise(function(_0x51459e,_0x939c85){return client[_0x4b17('0x7')](_0x30a305,_0x7e39cd)[_0x4b17('0x8')](function(_0x236505){if(_0x236505['error']){return _0x939c85(_0x236505[_0x4b17('0x9')][_0x4b17('0xa')]);}else{return _0x51459e(_0x236505[_0x4b17('0xb')]);}})[_0x4b17('0xc')](function(_0x436a3f){return _0x939c85(_0x436a3f);});});}exports[_0x4b17('0xd')]=function(_0x320c52,_0x258c00,_0x4743f7){return function(_0x32deeb){if(_0x4743f7[_0x4b17('0xe')]&&!_0x4743f7[_0x4b17('0xe')][_0x320c52]){logger[_0x4b17('0xf')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x320c52);return _0x32deeb[_0x4b17('0x10')]();}var _0x180e19=[];for(var _0x48c3fd=0x0;_0x48c3fd<_0x258c00[_0x4b17('0x11')];_0x48c3fd+=0x1){_0x180e19[_0x4b17('0x12')](request(_0x4b17('0x13'),{'command':util[_0x4b17('0x14')](_0x4b17('0x15'),_0x258c00[_0x48c3fd])})[_0x4b17('0x8')](function(_0x3489f3){return _0x3489f3&&_0x3489f3[_0x4b17('0xa')]&&_0x3489f3[_0x4b17('0xa')][_0x4b17('0x16')](_0x4b17('0x17'))>=0x0?!![]:![];})[_0x4b17('0xc')](function(_0x6be300){logger[_0x4b17('0x9')]('[%s][INTERVAL]\x20%s',_0x320c52,_0x258c00[_0x48c3fd]);}));}BPromise[_0x4b17('0x18')](_0x180e19)[_0x4b17('0x8')](function(_0x403f1d){var _0x2d638a=_[_0x4b17('0x19')](_0x403f1d);logger['info'](_0x4b17('0x1a'),_0x320c52,_0x258c00[_0x4b17('0x1b')]('\x20|\x20'),_0x2d638a);_0x32deeb['when'](_0x2d638a);})[_0x4b17('0xc')](function(_0x356c91){console[_0x4b17('0x1c')](_0x356c91);logger['error'](_0x4b17('0x1a'),_0x320c52,_0x258c00[_0x4b17('0x1b')](_0x4b17('0x1d')),_0x356c91[_0x4b17('0x1e')]);_0x32deeb[_0x4b17('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 36ea1ce..53b04f6 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 _0x5ff3=['ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','transfer','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','then','type','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime'];(function(_0x4bc7ea,_0x5e3b49){var _0x5a2f25=function(_0xd08366){while(--_0xd08366){_0x4bc7ea['push'](_0x4bc7ea['shift']());}};_0x5a2f25(++_0x5e3b49);}(_0x5ff3,0x17d));var _0x35ff=function(_0x43748c,_0x614f0c){_0x43748c=_0x43748c-0x0;var _0x5723fc=_0x5ff3[_0x43748c];return _0x5723fc;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1763a,_0x47c98d){utils[_0x35ff('0x1')](util[_0x35ff('0x2')](_0x35ff('0x3'),_0x1763a[_0x35ff('0x4')],_0x1763a['channel'],_0x1763a[_0x35ff('0x5')],_0x1763a[_0x35ff('0x6')],_0x1763a[_0x35ff('0x7')],_0x1763a[_0x35ff('0x8')],_0x1763a[_0x35ff('0x9')],_0x1763a['lastevent']));if(_0x1763a[_0x35ff('0x5')]){utils['getVoiceQueueByName'](_0x1763a[_0x35ff('0x5')])[_0x35ff('0xa')](function(_0x224ce5){if(_0x224ce5){_0x1763a['type']=_0x224ce5[_0x35ff('0xb')];_0x1763a['agentacw']=_0x1763a[_0x35ff('0xc')]?_0x224ce5[_0x35ff('0xd')]:![];_0x1763a['acwtime']=_0x1763a['agentacw']?_0x224ce5[_0x35ff('0xe')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x1763a);});}else{utils['request'](_0x35ff('0xf'),_0x1763a);}if(_0x47c98d){delete transfers[_0x1763a[_0x35ff('0x4')]];}else{delete agents[_0x1763a[_0x35ff('0x10')]];}}exports[_0x35ff('0x11')]=function(_0x559e33){try{utils[_0x35ff('0x12')](util[_0x35ff('0x2')](_0x35ff('0x13'),_0x559e33['uniqueid']),_0x559e33);agents[_0x559e33[_0x35ff('0x10')]]=_0x559e33;agents[_0x559e33[_0x35ff('0x10')]][_0x35ff('0x14')]=utils[_0x35ff('0x15')]();agents[_0x559e33[_0x35ff('0x10')]][_0x35ff('0x16')]=_0x35ff('0x17');agents[_0x559e33[_0x35ff('0x10')]][_0x35ff('0x9')]=null;agents[_0x559e33[_0x35ff('0x10')]][_0x35ff('0x18')]=null;utils[_0x35ff('0x1')](util[_0x35ff('0x2')](_0x35ff('0x19'),_0x559e33[_0x35ff('0x4')],agents[_0x559e33['destuniqueid']][_0x35ff('0x6')],_0x559e33[_0x35ff('0x10')]));}catch(_0x350e71){utils[_0x35ff('0x1a')](util['format']('[%s][agents][agentcalled]',_0x559e33[_0x35ff('0x4')]),_0x350e71);}};exports[_0x35ff('0x1b')]=function(_0x4c8dd4){try{if(!_[_0x35ff('0x1c')](agents[_0x4c8dd4[_0x35ff('0x10')]])){utils[_0x35ff('0x12')](util[_0x35ff('0x2')]('[%s][agents][agentringnoanswer]',_0x4c8dd4[_0x35ff('0x4')]),_0x4c8dd4);utils['info'](util[_0x35ff('0x2')](_0x35ff('0x1d'),_0x4c8dd4[_0x35ff('0x4')],agents[_0x4c8dd4[_0x35ff('0x10')]][_0x35ff('0x6')],_0x4c8dd4[_0x35ff('0x10')]));agents[_0x4c8dd4[_0x35ff('0x10')]]['agentringnoanswer']=!![];agents[_0x4c8dd4[_0x35ff('0x10')]][_0x35ff('0x1e')]=utils['now']();agents[_0x4c8dd4[_0x35ff('0x10')]]['lastevent']='timeout';agents[_0x4c8dd4[_0x35ff('0x10')]][_0x35ff('0x1f')]=_0x35ff('0x20');agents[_0x4c8dd4[_0x35ff('0x10')]][_0x35ff('0x21')]=_0x4c8dd4['ringtime']?parseInt(_0x4c8dd4[_0x35ff('0x22')])/0x3e8:0x0;agents[_0x4c8dd4[_0x35ff('0x10')]][_0x35ff('0x23')]=0x0;unanswered['push'](_0x4c8dd4[_0x35ff('0x10')]);}}catch(_0x1f51c5){utils[_0x35ff('0x1a')](util[_0x35ff('0x2')](_0x35ff('0x24'),_0x4c8dd4[_0x35ff('0x4')]),_0x1f51c5);}};exports[_0x35ff('0x25')]=function(_0xdf6ff){try{_[_0x35ff('0x26')](agents,function(_0x47d8fa,_0x3f9440){if(_0x47d8fa['uniqueid']==_0xdf6ff[_0x35ff('0x4')]&&!_[_0x35ff('0x27')](unanswered,_0x47d8fa[_0x35ff('0x10')])){utils[_0x35ff('0x12')](util['format'](_0x35ff('0x28'),_0xdf6ff['uniqueid']),_0xdf6ff);utils[_0x35ff('0x1')](util[_0x35ff('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xdf6ff['uniqueid'],_0x47d8fa[_0x35ff('0x6')],_0x47d8fa[_0x35ff('0x10')]));_0x47d8fa['agentringnoanswer']=!![];_0x47d8fa[_0x35ff('0x1e')]=utils[_0x35ff('0x15')]();_0x47d8fa['lastevent']=_0x35ff('0x29');_0x47d8fa[_0x35ff('0x1f')]=_0x35ff('0x29');_0x47d8fa[_0x35ff('0x21')]=_0xdf6ff[_0x35ff('0x21')];_0x47d8fa[_0x35ff('0x23')]=0x0;writeDB(_0x47d8fa);}});}catch(_0x293edc){utils[_0x35ff('0x1a')](util[_0x35ff('0x2')](_0x35ff('0x28'),_0xdf6ff[_0x35ff('0x4')]),_0x293edc);}};exports[_0x35ff('0x2a')]=function(_0x41b48d){try{if(agents[_0x41b48d['destuniqueid']]){utils[_0x35ff('0x12')](util['format'](_0x35ff('0x2b'),_0x41b48d[_0x35ff('0x4')]),_0x41b48d);utils[_0x35ff('0x1')](util[_0x35ff('0x2')](_0x35ff('0x2c'),_0x41b48d['uniqueid'],agents[_0x41b48d[_0x35ff('0x10')]][_0x35ff('0x6')],_0x41b48d[_0x35ff('0x10')]));agents[_0x41b48d[_0x35ff('0x10')]][_0x35ff('0x2d')]=utils['now']();agents[_0x41b48d[_0x35ff('0x10')]][_0x35ff('0x9')]=_0x41b48d[_0x35ff('0x9')];agents[_0x41b48d['destuniqueid']]['connectedlinename']=_0x41b48d[_0x35ff('0x18')];agents[_0x41b48d[_0x35ff('0x10')]][_0x35ff('0x21')]=_0x41b48d[_0x35ff('0x22')];agents[_0x41b48d[_0x35ff('0x10')]][_0x35ff('0x16')]=_0x35ff('0x2e');_[_0x35ff('0x26')](agents,function(_0x5dc229,_0x5dcc7c){if(_0x5dc229['destuniqueid']!=_0x41b48d[_0x35ff('0x10')]&&_0x5dc229[_0x35ff('0x4')]==_0x41b48d[_0x35ff('0x4')]){_0x5dc229[_0x35ff('0x23')]=0x0;_0x5dc229[_0x35ff('0x21')]=_0x41b48d['ringtime'];_0x5dc229[_0x35ff('0x1b')]=!![];_0x5dc229[_0x35ff('0x1e')]=utils[_0x35ff('0x15')]();_0x5dc229[_0x35ff('0x16')]=_0x35ff('0x2f');_0x5dc229[_0x35ff('0x1f')]='answered_elsewhere';_0x5dc229['answeredelsewheredestinationuniqueid']=_0x41b48d[_0x35ff('0x10')];_0x5dc229[_0x35ff('0x30')]=_0x41b48d[_0x35ff('0x6')];writeDB(_0x5dc229);}});}}catch(_0x21b123){utils['error'](util['format'](_0x35ff('0x2b'),_0x41b48d[_0x35ff('0x4')]),_0x21b123);}};exports[_0x35ff('0xc')]=function(_0x1cd2c8){try{if(!_[_0x35ff('0x1c')](agents[_0x1cd2c8[_0x35ff('0x10')]])){utils[_0x35ff('0x12')](util['format']('[%s][agents][agentcomplete]',_0x1cd2c8[_0x35ff('0x4')]),_0x1cd2c8);utils[_0x35ff('0x1')](util[_0x35ff('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1cd2c8[_0x35ff('0x4')],agents[_0x1cd2c8[_0x35ff('0x10')]]['membername'],_0x1cd2c8['destuniqueid']));agents[_0x1cd2c8[_0x35ff('0x10')]]['agentcomplete']=!![];agents[_0x1cd2c8[_0x35ff('0x10')]][_0x35ff('0x31')]=utils['now']();agents[_0x1cd2c8[_0x35ff('0x10')]]['talktime']=utils['diffTime'](agents[_0x1cd2c8[_0x35ff('0x10')]][_0x35ff('0x31')],agents[_0x1cd2c8[_0x35ff('0x10')]][_0x35ff('0x2d')]);agents[_0x1cd2c8[_0x35ff('0x10')]][_0x35ff('0x1f')]=_0x1cd2c8[_0x35ff('0x1f')];agents[_0x1cd2c8[_0x35ff('0x10')]][_0x35ff('0x16')]=_0x35ff('0x32');writeDB(agents[_0x1cd2c8[_0x35ff('0x10')]]);}}catch(_0x2d3f46){utils['error'](util[_0x35ff('0x2')](_0x35ff('0x33'),_0x1cd2c8[_0x35ff('0x4')]),_0x2d3f46);}};exports[_0x35ff('0x34')]=function(_0x506def){try{if(!_['isNil'](agents[_0x506def[_0x35ff('0x35')]])){utils['debug'](util[_0x35ff('0x2')](_0x35ff('0x36'),_0x506def[_0x35ff('0x4')]),_0x506def);utils[_0x35ff('0x1')](util[_0x35ff('0x2')](_0x35ff('0x37'),_0x506def[_0x35ff('0x4')],agents[_0x506def[_0x35ff('0x35')]][_0x35ff('0x6')],agents[_0x506def['transfereruniqueid']]['uniqueid']));agents[_0x506def[_0x35ff('0x35')]]['transfer']=!![];agents[_0x506def[_0x35ff('0x35')]][_0x35ff('0x38')]=_0x35ff('0x39');agents[_0x506def[_0x35ff('0x35')]][_0x35ff('0x3a')]=_0x506def[_0x35ff('0x3b')];agents[_0x506def[_0x35ff('0x35')]][_0x35ff('0x3c')]=agents[_0x506def[_0x35ff('0x35')]]['uniqueid'];}}catch(_0x3aa649){utils[_0x35ff('0x1a')](util[_0x35ff('0x2')](_0x35ff('0x36'),_0x506def['uniqueid']),_0x3aa649);}};exports['attendedtransfer']=function(_0x591776){try{utils[_0x35ff('0x12')](util[_0x35ff('0x2')](_0x35ff('0x3d'),_0x591776['origtransfereruniqueid']),_0x591776);if(_0x591776[_0x35ff('0x3e')]==_0x591776['origtransfererlinkedid']){if(!_[_0x35ff('0x1c')](agents[_0x591776['secondtransfereruniqueid']])){utils[_0x35ff('0x1')](util[_0x35ff('0x2')](_0x35ff('0x3f'),_0x591776[_0x35ff('0x3e')],agents[_0x591776['secondtransfereruniqueid']]['membername']));agents[_0x591776[_0x35ff('0x40')]]['transfer']=!![];agents[_0x591776[_0x35ff('0x40')]][_0x35ff('0x38')]='ATTENDED';agents[_0x591776[_0x35ff('0x40')]]['transferexten']=_0x591776[_0x35ff('0x41')];agents[_0x591776[_0x35ff('0x40')]][_0x35ff('0x3c')]=_0x591776[_0x35ff('0x3e')];}if(_0x591776[_0x35ff('0x42')]&&agents[_0x591776[_0x35ff('0x42')]]){agents[_0x591776['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x591776[_0x35ff('0x42')]]=_[_0x35ff('0x43')](agents[_0x591776['transfereeuniqueid']]);transfers[_0x591776[_0x35ff('0x42')]][_0x35ff('0x8')]=agents[_0x591776['secondtransfereruniqueid']][_0x35ff('0x8')];transfers[_0x591776[_0x35ff('0x42')]][_0x35ff('0x44')]=agents[_0x591776[_0x35ff('0x40')]][_0x35ff('0x44')];transfers[_0x591776['transfereeuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x591776[_0x35ff('0x42')]]['agentconnectAt']=utils[_0x35ff('0x15')]();transfers[_0x591776['transfereeuniqueid']][_0x35ff('0x21')]=0x0;transfers[_0x591776[_0x35ff('0x42')]][_0x35ff('0x45')]=0x2;}}else if(_0x591776[_0x35ff('0x40')]==_0x591776[_0x35ff('0x46')]){if(!_[_0x35ff('0x1c')](agents[_0x591776['origtransfereruniqueid']])){utils[_0x35ff('0x1')](util[_0x35ff('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x591776[_0x35ff('0x3e')],agents[_0x591776[_0x35ff('0x3e')]][_0x35ff('0x6')]));agents[_0x591776[_0x35ff('0x3e')]][_0x35ff('0x47')]=!![];agents[_0x591776[_0x35ff('0x3e')]][_0x35ff('0x38')]=_0x35ff('0x48');agents[_0x591776[_0x35ff('0x3e')]]['transferexten']=_0x591776[_0x35ff('0x49')];agents[_0x591776[_0x35ff('0x3e')]][_0x35ff('0x3c')]=_0x591776[_0x35ff('0x40')];}if(_0x591776[_0x35ff('0x4a')]&&agents[_0x591776[_0x35ff('0x4a')]]){agents[_0x591776['transfertargetuniqueid']][_0x35ff('0x45')]=0x1;transfers[_0x591776[_0x35ff('0x4a')]]=_[_0x35ff('0x43')](agents[_0x591776['transfertargetuniqueid']]);transfers[_0x591776[_0x35ff('0x4a')]]['calleridnum']=agents[_0x591776['origtransfereruniqueid']][_0x35ff('0x8')];transfers[_0x591776[_0x35ff('0x4a')]]['calleridname']=agents[_0x591776[_0x35ff('0x3e')]][_0x35ff('0x44')];transfers[_0x591776[_0x35ff('0x4a')]][_0x35ff('0x14')]=utils[_0x35ff('0x15')]();transfers[_0x591776[_0x35ff('0x4a')]][_0x35ff('0x2d')]=utils[_0x35ff('0x15')]();transfers[_0x591776[_0x35ff('0x4a')]][_0x35ff('0x21')]=0x0;transfers[_0x591776[_0x35ff('0x4a')]][_0x35ff('0x45')]=0x2;}}}catch(_0xbfda70){utils[_0x35ff('0x1a')](util[_0x35ff('0x2')](_0x35ff('0x3d'),_0x591776['origtransfereruniqueid']),_0xbfda70);}};exports[_0x35ff('0x4b')]=function(_0x229ca2){try{utils['debug'](util[_0x35ff('0x2')](_0x35ff('0x4c'),_0x229ca2['uniqueid']),_0x229ca2);if(agents[_0x229ca2['uniqueid']]&&agents[_0x229ca2[_0x35ff('0x4')]]['reason']===_0x35ff('0x20')){if(_0x229ca2[_0x35ff('0x4d')]==='21'){agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x1f')]=_0x35ff('0x4e');agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x16')]=_0x35ff('0x4e');}utils[_0x35ff('0x1')](util['format'](_0x35ff('0x4f'),_0x229ca2['uniqueid'],agents[_0x229ca2[_0x35ff('0x4')]]['membername'],agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x1f')],agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x16')]));writeDB(agents[_0x229ca2[_0x35ff('0x4')]]);var _0x4857d1=unanswered[_0x35ff('0x50')](_0x229ca2[_0x35ff('0x4')]);if(_0x4857d1>-0x1){unanswered['splice'](_0x4857d1,0x1);}}if(transfers[_0x229ca2['uniqueid']]){transfers[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0xc')]=!![];transfers[_0x229ca2['uniqueid']][_0x35ff('0x31')]=utils[_0x35ff('0x15')]();transfers[_0x229ca2[_0x35ff('0x4')]]['talktime']=utils[_0x35ff('0x51')](transfers[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x31')],transfers[_0x229ca2['uniqueid']][_0x35ff('0x2d')]);transfers[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x1f')]=_0x35ff('0x52');transfers[_0x229ca2[_0x35ff('0x4')]]['lastevent']=_0x35ff('0x32');utils[_0x35ff('0x1')](util[_0x35ff('0x2')](_0x35ff('0x4f'),_0x229ca2[_0x35ff('0x4')],transfers[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x6')],transfers[_0x229ca2['uniqueid']][_0x35ff('0x1f')],transfers[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x16')]));writeDB(transfers[_0x229ca2[_0x35ff('0x4')]],!![]);}if(agents[_0x229ca2[_0x35ff('0x4')]]&&agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x2d')]){agents[_0x229ca2['uniqueid']][_0x35ff('0xc')]=!![];agents[_0x229ca2['uniqueid']][_0x35ff('0x31')]=utils[_0x35ff('0x15')]();agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x23')]=utils[_0x35ff('0x51')](agents[_0x229ca2['uniqueid']]['agentcompleteAt'],agents[_0x229ca2[_0x35ff('0x4')]]['agentconnectAt']);agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x1f')]=agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x47')]?_0x35ff('0x47'):_0x35ff('0x52');agents[_0x229ca2[_0x35ff('0x4')]]['lastevent']=_0x35ff('0x32');utils['info'](util[_0x35ff('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x229ca2[_0x35ff('0x4')],agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x6')],agents[_0x229ca2['uniqueid']]['reason'],agents[_0x229ca2[_0x35ff('0x4')]][_0x35ff('0x16')]));writeDB(agents[_0x229ca2['uniqueid']]);}}catch(_0xf9c766){utils[_0x35ff('0x1a')](util['format'](_0x35ff('0x4c'),_0x229ca2[_0x35ff('0x4')]),_0xf9c766);}}; \ No newline at end of file +var _0xae60=['transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','lodash','util','./utils','info','format','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten'];(function(_0x42d701,_0xc6e12a){var _0x4ce2ac=function(_0x2f2eb9){while(--_0x2f2eb9){_0x42d701['push'](_0x42d701['shift']());}};_0x4ce2ac(++_0xc6e12a);}(_0xae60,0x1c7));var _0x0ae6=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xae60[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var utils=require(_0x0ae6('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x52d7cd,_0x267ad6){utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x52d7cd[_0x0ae6('0x5')],_0x52d7cd[_0x0ae6('0x6')],_0x52d7cd['queue'],_0x52d7cd[_0x0ae6('0x7')],_0x52d7cd[_0x0ae6('0x8')],_0x52d7cd[_0x0ae6('0x9')],_0x52d7cd[_0x0ae6('0xa')],_0x52d7cd[_0x0ae6('0xb')]));if(_0x52d7cd[_0x0ae6('0xc')]){utils[_0x0ae6('0xd')](_0x52d7cd[_0x0ae6('0xc')])['then'](function(_0x3b3fc3){if(_0x3b3fc3){_0x52d7cd[_0x0ae6('0xe')]=_0x3b3fc3[_0x0ae6('0xe')];_0x52d7cd[_0x0ae6('0xf')]=_0x52d7cd['agentcomplete']?_0x3b3fc3[_0x0ae6('0x10')]:![];_0x52d7cd[_0x0ae6('0x11')]=_0x52d7cd[_0x0ae6('0xf')]?_0x3b3fc3[_0x0ae6('0x12')]:0x0;}utils[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x52d7cd);});}else{utils[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x52d7cd);}if(_0x267ad6){delete transfers[_0x52d7cd[_0x0ae6('0x5')]];}else{delete agents[_0x52d7cd[_0x0ae6('0x15')]];}}exports[_0x0ae6('0x16')]=function(_0xf86cad){try{utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')]('[%s][agents][agentcalled]',_0xf86cad[_0x0ae6('0x5')]),_0xf86cad);agents[_0xf86cad[_0x0ae6('0x15')]]=_0xf86cad;agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0x18')]=utils[_0x0ae6('0x19')]();agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0xb')]=_0x0ae6('0x1a');agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0xa')]=null;agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0x1b')]=null;utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x1c'),_0xf86cad[_0x0ae6('0x5')],agents[_0xf86cad[_0x0ae6('0x15')]][_0x0ae6('0x7')],_0xf86cad[_0x0ae6('0x15')]));}catch(_0x9e2c46){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')]('[%s][agents][agentcalled]',_0xf86cad[_0x0ae6('0x5')]),_0x9e2c46);}};exports[_0x0ae6('0x1e')]=function(_0x140a3b){try{if(!_[_0x0ae6('0x1f')](agents[_0x140a3b[_0x0ae6('0x15')]])){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')](_0x0ae6('0x20'),_0x140a3b['uniqueid']),_0x140a3b);utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x21'),_0x140a3b[_0x0ae6('0x5')],agents[_0x140a3b[_0x0ae6('0x15')]]['membername'],_0x140a3b[_0x0ae6('0x15')]));agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x1e')]=!![];agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x22')]=utils[_0x0ae6('0x19')]();agents[_0x140a3b['destuniqueid']][_0x0ae6('0xb')]=_0x0ae6('0x23');agents[_0x140a3b['destuniqueid']]['reason']=_0x0ae6('0x23');agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x24')]=_0x140a3b['ringtime']?parseInt(_0x140a3b[_0x0ae6('0x25')])/0x3e8:0x0;agents[_0x140a3b[_0x0ae6('0x15')]][_0x0ae6('0x26')]=0x0;unanswered['push'](_0x140a3b[_0x0ae6('0x15')]);}}catch(_0x29fef3){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x20'),_0x140a3b[_0x0ae6('0x5')]),_0x29fef3);}};exports['queuecallerabandon']=function(_0x5b2ad6){try{_[_0x0ae6('0x27')](agents,function(_0x419384,_0x4e6df8){if(_0x419384['uniqueid']==_0x5b2ad6[_0x0ae6('0x5')]&&!_[_0x0ae6('0x28')](unanswered,_0x419384[_0x0ae6('0x15')])){utils[_0x0ae6('0x17')](util['format'](_0x0ae6('0x29'),_0x5b2ad6[_0x0ae6('0x5')]),_0x5b2ad6);utils[_0x0ae6('0x3')](util['format'](_0x0ae6('0x2a'),_0x5b2ad6[_0x0ae6('0x5')],_0x419384[_0x0ae6('0x7')],_0x419384[_0x0ae6('0x15')]));_0x419384[_0x0ae6('0x1e')]=!![];_0x419384[_0x0ae6('0x22')]=utils[_0x0ae6('0x19')]();_0x419384[_0x0ae6('0xb')]=_0x0ae6('0x2b');_0x419384[_0x0ae6('0x2c')]='abandoned';_0x419384[_0x0ae6('0x24')]=_0x5b2ad6[_0x0ae6('0x24')];_0x419384['talktime']=0x0;writeDB(_0x419384);}});}catch(_0x3264d5){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')]('[%s][agents][queuecallerabandon]',_0x5b2ad6[_0x0ae6('0x5')]),_0x3264d5);}};exports['agentconnect']=function(_0x59e388){try{if(agents[_0x59e388[_0x0ae6('0x15')]]){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')](_0x0ae6('0x2d'),_0x59e388[_0x0ae6('0x5')]),_0x59e388);utils['info'](util['format'](_0x0ae6('0x2e'),_0x59e388['uniqueid'],agents[_0x59e388[_0x0ae6('0x15')]]['membername'],_0x59e388[_0x0ae6('0x15')]));agents[_0x59e388['destuniqueid']][_0x0ae6('0x2f')]=utils[_0x0ae6('0x19')]();agents[_0x59e388[_0x0ae6('0x15')]][_0x0ae6('0xa')]=_0x59e388['connectedlinenum'];agents[_0x59e388['destuniqueid']][_0x0ae6('0x1b')]=_0x59e388[_0x0ae6('0x1b')];agents[_0x59e388[_0x0ae6('0x15')]]['holdtime']=_0x59e388[_0x0ae6('0x25')];agents[_0x59e388['destuniqueid']][_0x0ae6('0xb')]=_0x0ae6('0x30');_[_0x0ae6('0x27')](agents,function(_0x19403c,_0x450f00){if(_0x19403c[_0x0ae6('0x15')]!=_0x59e388['destuniqueid']&&_0x19403c[_0x0ae6('0x5')]==_0x59e388[_0x0ae6('0x5')]){_0x19403c[_0x0ae6('0x26')]=0x0;_0x19403c[_0x0ae6('0x24')]=_0x59e388[_0x0ae6('0x25')];_0x19403c[_0x0ae6('0x1e')]=!![];_0x19403c[_0x0ae6('0x22')]=utils[_0x0ae6('0x19')]();_0x19403c['lastevent']=_0x0ae6('0x31');_0x19403c[_0x0ae6('0x2c')]=_0x0ae6('0x31');_0x19403c[_0x0ae6('0x32')]=_0x59e388[_0x0ae6('0x15')];_0x19403c[_0x0ae6('0x33')]=_0x59e388[_0x0ae6('0x7')];writeDB(_0x19403c);}});}}catch(_0x21431e){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x2d'),_0x59e388[_0x0ae6('0x5')]),_0x21431e);}};exports[_0x0ae6('0x34')]=function(_0x85d9ce){try{if(!_[_0x0ae6('0x1f')](agents[_0x85d9ce[_0x0ae6('0x15')]])){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')]('[%s][agents][agentcomplete]',_0x85d9ce[_0x0ae6('0x5')]),_0x85d9ce);utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x35'),_0x85d9ce[_0x0ae6('0x5')],agents[_0x85d9ce[_0x0ae6('0x15')]]['membername'],_0x85d9ce[_0x0ae6('0x15')]));agents[_0x85d9ce[_0x0ae6('0x15')]][_0x0ae6('0x34')]=!![];agents[_0x85d9ce[_0x0ae6('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x85d9ce['destuniqueid']][_0x0ae6('0x26')]=utils[_0x0ae6('0x36')](agents[_0x85d9ce[_0x0ae6('0x15')]]['agentcompleteAt'],agents[_0x85d9ce[_0x0ae6('0x15')]][_0x0ae6('0x2f')]);agents[_0x85d9ce['destuniqueid']][_0x0ae6('0x2c')]=_0x85d9ce[_0x0ae6('0x2c')];agents[_0x85d9ce['destuniqueid']][_0x0ae6('0xb')]=_0x0ae6('0x37');writeDB(agents[_0x85d9ce['destuniqueid']]);}}catch(_0x76e561){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')]('[%s][agents][agentcomplete]',_0x85d9ce[_0x0ae6('0x5')]),_0x76e561);}};exports[_0x0ae6('0x38')]=function(_0x46075a){try{if(!_[_0x0ae6('0x1f')](agents[_0x46075a[_0x0ae6('0x39')]])){utils[_0x0ae6('0x17')](util[_0x0ae6('0x4')]('[%s][agents][blindtransfer]',_0x46075a['uniqueid']),_0x46075a);utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x3a'),_0x46075a['uniqueid'],agents[_0x46075a[_0x0ae6('0x39')]]['membername'],agents[_0x46075a['transfereruniqueid']][_0x0ae6('0x5')]));agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x3b')]=!![];agents[_0x46075a['transfereruniqueid']][_0x0ae6('0x3c')]=_0x0ae6('0x3d');agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x3e')]=_0x46075a[_0x0ae6('0x3f')];agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x40')]=agents[_0x46075a[_0x0ae6('0x39')]][_0x0ae6('0x5')];}}catch(_0x117d24){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x41'),_0x46075a[_0x0ae6('0x5')]),_0x117d24);}};exports[_0x0ae6('0x42')]=function(_0x5c4785){try{utils['debug'](util[_0x0ae6('0x4')](_0x0ae6('0x43'),_0x5c4785[_0x0ae6('0x44')]),_0x5c4785);if(_0x5c4785[_0x0ae6('0x44')]==_0x5c4785[_0x0ae6('0x45')]){if(!_[_0x0ae6('0x1f')](agents[_0x5c4785[_0x0ae6('0x46')]])){utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x47'),_0x5c4785[_0x0ae6('0x44')],agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x7')]));agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x3b')]=!![];agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x3c')]=_0x0ae6('0x48');agents[_0x5c4785['secondtransfereruniqueid']][_0x0ae6('0x3e')]=_0x5c4785[_0x0ae6('0x49')];agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x40')]=_0x5c4785[_0x0ae6('0x44')];}if(_0x5c4785[_0x0ae6('0x4a')]&&agents[_0x5c4785[_0x0ae6('0x4a')]]){agents[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x4b')]=0x1;transfers[_0x5c4785[_0x0ae6('0x4a')]]=_['clone'](agents[_0x5c4785[_0x0ae6('0x4a')]]);transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x9')]=agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x9')];transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x4c')]=agents[_0x5c4785[_0x0ae6('0x46')]][_0x0ae6('0x4c')];transfers[_0x5c4785['transfereeuniqueid']]['agentcalledAt']=utils[_0x0ae6('0x19')]();transfers[_0x5c4785[_0x0ae6('0x4a')]]['agentconnectAt']=utils['now']();transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x24')]=0x0;transfers[_0x5c4785[_0x0ae6('0x4a')]][_0x0ae6('0x4b')]=0x2;}}else if(_0x5c4785[_0x0ae6('0x46')]==_0x5c4785[_0x0ae6('0x4d')]){if(!_[_0x0ae6('0x1f')](agents[_0x5c4785['origtransfereruniqueid']])){utils[_0x0ae6('0x3')](util['format'](_0x0ae6('0x47'),_0x5c4785[_0x0ae6('0x44')],agents[_0x5c4785['origtransfereruniqueid']][_0x0ae6('0x7')]));agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x3b')]=!![];agents[_0x5c4785['origtransfereruniqueid']][_0x0ae6('0x3c')]='ATTENDED';agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x3e')]=_0x5c4785[_0x0ae6('0x4e')];agents[_0x5c4785[_0x0ae6('0x44')]]['transferuniqueid']=_0x5c4785['secondtransfereruniqueid'];}if(_0x5c4785[_0x0ae6('0x4f')]&&agents[_0x5c4785[_0x0ae6('0x4f')]]){agents[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x4b')]=0x1;transfers[_0x5c4785[_0x0ae6('0x4f')]]=_[_0x0ae6('0x50')](agents[_0x5c4785['transfertargetuniqueid']]);transfers[_0x5c4785['transfertargetuniqueid']][_0x0ae6('0x9')]=agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x9')];transfers[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x4c')]=agents[_0x5c4785[_0x0ae6('0x44')]][_0x0ae6('0x4c')];transfers[_0x5c4785[_0x0ae6('0x4f')]]['agentcalledAt']=utils[_0x0ae6('0x19')]();transfers[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x2f')]=utils[_0x0ae6('0x19')]();transfers[_0x5c4785[_0x0ae6('0x4f')]][_0x0ae6('0x24')]=0x0;transfers[_0x5c4785['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x35068d){utils[_0x0ae6('0x1d')](util['format'](_0x0ae6('0x43'),_0x5c4785[_0x0ae6('0x44')]),_0x35068d);}};exports[_0x0ae6('0x51')]=function(_0x37ad9b){try{utils['debug'](util[_0x0ae6('0x4')](_0x0ae6('0x52'),_0x37ad9b[_0x0ae6('0x5')]),_0x37ad9b);if(agents[_0x37ad9b[_0x0ae6('0x5')]]&&agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')]===_0x0ae6('0x23')){if(_0x37ad9b[_0x0ae6('0x53')]==='21'){agents[_0x37ad9b['uniqueid']][_0x0ae6('0x2c')]=_0x0ae6('0x54');agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]=_0x0ae6('0x54');}utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x55'),_0x37ad9b[_0x0ae6('0x5')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x7')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]));writeDB(agents[_0x37ad9b[_0x0ae6('0x5')]]);var _0x346d19=unanswered[_0x0ae6('0x56')](_0x37ad9b[_0x0ae6('0x5')]);if(_0x346d19>-0x1){unanswered[_0x0ae6('0x57')](_0x346d19,0x1);}}if(transfers[_0x37ad9b[_0x0ae6('0x5')]]){transfers[_0x37ad9b['uniqueid']][_0x0ae6('0x34')]=!![];transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x58')]=utils[_0x0ae6('0x19')]();transfers[_0x37ad9b['uniqueid']][_0x0ae6('0x26')]=utils[_0x0ae6('0x36')](transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x58')],transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2f')]);transfers[_0x37ad9b['uniqueid']][_0x0ae6('0x2c')]='agent';transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]=_0x0ae6('0x37');utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')](_0x0ae6('0x55'),_0x37ad9b[_0x0ae6('0x5')],transfers[_0x37ad9b['uniqueid']]['membername'],transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')],transfers[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]));writeDB(transfers[_0x37ad9b['uniqueid']],!![]);}if(agents[_0x37ad9b[_0x0ae6('0x5')]]&&agents[_0x37ad9b[_0x0ae6('0x5')]]['agentconnectAt']){agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x34')]=!![];agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x58')]=utils[_0x0ae6('0x19')]();agents[_0x37ad9b[_0x0ae6('0x5')]]['talktime']=utils['diffTime'](agents[_0x37ad9b['uniqueid']][_0x0ae6('0x58')],agents[_0x37ad9b['uniqueid']]['agentconnectAt']);agents[_0x37ad9b['uniqueid']]['reason']=agents[_0x37ad9b[_0x0ae6('0x5')]]['transfer']?_0x0ae6('0x3b'):'agent';agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]=_0x0ae6('0x37');utils[_0x0ae6('0x3')](util[_0x0ae6('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x37ad9b[_0x0ae6('0x5')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x7')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0x2c')],agents[_0x37ad9b[_0x0ae6('0x5')]][_0x0ae6('0xb')]));writeDB(agents[_0x37ad9b['uniqueid']]);}}catch(_0x435707){utils[_0x0ae6('0x1d')](util[_0x0ae6('0x4')](_0x0ae6('0x52'),_0x37ad9b[_0x0ae6('0x5')]),_0x435707);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 7fb186a..e827075 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 _0x7b92=['debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','callerid','cause-txt','diffTime','endtime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-callerid','xmcs-queue','xmd-queue','Queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','execif','gotoif','lastapplication','lastdata','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','accountcode','then','UserId','CreateVoiceCallReport','request','recording','newchannel','format','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error'];(function(_0x19dbe3,_0x1e876a){var _0x6a14a1=function(_0x3b4419){while(--_0x3b4419){_0x19dbe3['push'](_0x19dbe3['shift']());}};_0x6a14a1(++_0x1e876a);}(_0x7b92,0x1e3));var _0x27b9=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x7b92[_0x1bfe2b];return _0x1477d4;};'use strict';var _=require(_0x27b9('0x0'));var util=require('util');var utils=require(_0x27b9('0x1'));var transfers=require(_0x27b9('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0x27b9('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0x27b9('0x4'),_0x27b9('0x5'),'BUSY',_0x27b9('0x3'),_0x27b9('0x3'),'FAILED'];var channels={};function writeDB(_0x3969c5){var _0x1160bb;if(transfers['blinds'][_0x3969c5[_0x27b9('0x6')]]){_0x1160bb=_0x3969c5[_0x27b9('0x6')];_0x3969c5[_0x27b9('0x6')]=transfers[_0x27b9('0x7')][_0x3969c5[_0x27b9('0x6')]][_0x27b9('0x8')];}utils[_0x27b9('0x9')](util['format'](_0x27b9('0xa'),_0x3969c5[_0x27b9('0x6')],_0x3969c5[_0x27b9('0xb')],_0x3969c5[_0x27b9('0xc')],_0x3969c5[_0x27b9('0xd')],_0x3969c5['interface'],_0x3969c5[_0x27b9('0xe')],_0x3969c5[_0x27b9('0xf')],_0x3969c5['lastevent']));if(_0x3969c5[_0x27b9('0x10')]){utils['getUserByInternal'](_0x3969c5['accountcode'])[_0x27b9('0x11')](function(_0x4f8c9e){if(_0x4f8c9e){_0x3969c5[_0x27b9('0x12')]=_0x4f8c9e['id'];}utils['request'](_0x27b9('0x13'),_0x3969c5);});}else{utils[_0x27b9('0x14')](_0x27b9('0x13'),_0x3969c5);}if(channels[_0x3969c5[_0x27b9('0x6')]]){delete channels[_0x3969c5['uniqueid']];}else if(_0x1160bb&&channels[_0x1160bb]){if(!transfers[_0x27b9('0x7')][_0x1160bb][_0x27b9('0x15')])delete transfers[_0x27b9('0x7')][_0x1160bb];delete channels[_0x1160bb];}}exports[_0x27b9('0x16')]=function(_0x4bdc49){try{utils['debug'](util[_0x27b9('0x17')](_0x27b9('0x18'),_0x4bdc49[_0x27b9('0x6')]),_0x4bdc49);if(_0x4bdc49[_0x27b9('0x6')]==_0x4bdc49[_0x27b9('0x19')]&&_0x4bdc49[_0x27b9('0xb')]!='OutgoingSpoolFailed'){utils['info'](util['format'](_0x27b9('0x1a'),_0x4bdc49[_0x27b9('0x6')],_0x4bdc49[_0x27b9('0x1b')],_0x4bdc49[_0x27b9('0x1c')]));channels[_0x4bdc49[_0x27b9('0x6')]]={'uniqueid':_0x4bdc49[_0x27b9('0x6')],'accountcode':_0x4bdc49[_0x27b9('0x10')],'source':_0x4bdc49[_0x27b9('0xe')],'destination':_0x4bdc49[_0x27b9('0x1c')],'destinationcontext':_0x4bdc49['context'],'channel':_0x4bdc49[_0x27b9('0xb')],'starttime':utils[_0x27b9('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x27b9('0x4'),'amaflags':_0x27b9('0x1e')};}}catch(_0xf69565){utils[_0x27b9('0x1f')](util[_0x27b9('0x17')](_0x27b9('0x18'),_0x4bdc49[_0x27b9('0x6')]),_0xf69565);}};exports['newstate']=function(_0x4a1b52){try{utils[_0x27b9('0x20')](util['format'](_0x27b9('0x21'),_0x4a1b52['uniqueid']),_0x4a1b52);if(!_[_0x27b9('0x22')](channels[_0x4a1b52[_0x27b9('0x6')]])&&_0x4a1b52[_0x27b9('0x23')]==0x6){utils['info'](util['format'](_0x27b9('0x24'),_0x4a1b52[_0x27b9('0x6')],_0x4a1b52[_0x27b9('0x1b')],_0x4a1b52[_0x27b9('0xb')]));if(_[_0x27b9('0x22')](channels[_0x4a1b52[_0x27b9('0x6')]][_0x27b9('0x25')])){channels[_0x4a1b52[_0x27b9('0x6')]][_0x27b9('0x25')]=utils[_0x27b9('0x1d')]();}}else if(!_[_0x27b9('0x22')](channels[_0x4a1b52[_0x27b9('0x19')]])&&_0x4a1b52[_0x27b9('0x23')]==0x6&&_0x4a1b52[_0x27b9('0x1b')]!='transfer'){utils[_0x27b9('0x9')](util[_0x27b9('0x17')](_0x27b9('0x26'),_0x4a1b52[_0x27b9('0x6')],_0x4a1b52[_0x27b9('0x19')],_0x4a1b52[_0x27b9('0x1b')],_0x4a1b52[_0x27b9('0xb')]));channels[_0x4a1b52[_0x27b9('0x19')]][_0x27b9('0x10')]=_0x4a1b52[_0x27b9('0x10')];channels[_0x4a1b52[_0x27b9('0x19')]]['destinationchannel']=_0x4a1b52[_0x27b9('0xb')];if(_['isNil'](channels[_0x4a1b52[_0x27b9('0x19')]]['answertime'])){channels[_0x4a1b52[_0x27b9('0x19')]][_0x27b9('0x27')]=utils['now']();}channels[_0x4a1b52[_0x27b9('0x19')]][_0x27b9('0x28')]=dispositions[_[_0x27b9('0x29')](_0x4a1b52['channelstate'])]||'ANSWERED';}}catch(_0x20174c){utils[_0x27b9('0x1f')](util['format'](_0x27b9('0x21'),_0x4a1b52[_0x27b9('0x6')]),_0x20174c);}};exports[_0x27b9('0x2a')]=function(_0xcfdd5b){try{if(!_[_0x27b9('0x22')](channels[_0xcfdd5b[_0x27b9('0x6')]])){utils[_0x27b9('0x20')](util[_0x27b9('0x17')](_0x27b9('0x2b'),_0xcfdd5b[_0x27b9('0x6')]),_0xcfdd5b);if(_['isNil'](channels[_0xcfdd5b['uniqueid']]['callerid'])){channels[_0xcfdd5b[_0x27b9('0x6')]]['callerid']=_0xcfdd5b[_0x27b9('0x2c')]+'\x20<'+_0xcfdd5b[_0x27b9('0xe')]+'>';}utils[_0x27b9('0x9')](util[_0x27b9('0x17')](_0x27b9('0x2d'),_0xcfdd5b[_0x27b9('0x6')],channels[_0xcfdd5b[_0x27b9('0x6')]][_0x27b9('0x2e')],_0xcfdd5b[_0x27b9('0x2f')]));channels[_0xcfdd5b[_0x27b9('0x6')]]['endtime']=utils[_0x27b9('0x1d')]();channels[_0xcfdd5b[_0x27b9('0x6')]]['duration']=utils[_0x27b9('0x30')](channels[_0xcfdd5b['uniqueid']][_0x27b9('0x31')],channels[_0xcfdd5b['uniqueid']]['starttime']);channels[_0xcfdd5b[_0x27b9('0x6')]][_0x27b9('0x32')]=channels[_0xcfdd5b[_0x27b9('0x6')]]['answertime']?utils['diffTime'](channels[_0xcfdd5b['uniqueid']][_0x27b9('0x31')],channels[_0xcfdd5b[_0x27b9('0x6')]][_0x27b9('0x27')]):0x0;writeDB(channels[_0xcfdd5b[_0x27b9('0x6')]]);}}catch(_0x1bdf00){utils[_0x27b9('0x1f')](util[_0x27b9('0x17')](_0x27b9('0x2b'),_0xcfdd5b[_0x27b9('0x6')]),_0x1bdf00);}};exports['attendedtransfer']=function(_0x303d13){try{if(!_[_0x27b9('0x22')](channels[_0x303d13[_0x27b9('0x33')]])){utils[_0x27b9('0x20')](util[_0x27b9('0x17')](_0x27b9('0x34'),_0x303d13[_0x27b9('0x35')]),_0x303d13);if(channels[_0x303d13[_0x27b9('0x33')]]['channel']==_0x303d13[_0x27b9('0x36')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x303d13[_0x27b9('0x35')],_0x303d13[_0x27b9('0x33')],_0x303d13[_0x27b9('0x37')]));channels[_0x303d13[_0x27b9('0x33')]][_0x27b9('0x38')]=_0x303d13[_0x27b9('0x37')];channels[_0x303d13['localtwolinkedid']][_0x27b9('0x39')]=_0x27b9('0x3a');}else if(channels[_0x303d13[_0x27b9('0x33')]][_0x27b9('0xb')]=_0x303d13[_0x27b9('0x3b')]){utils[_0x27b9('0x9')](util['format'](_0x27b9('0x3c'),_0x303d13[_0x27b9('0x35')],_0x303d13[_0x27b9('0x33')],_0x303d13[_0x27b9('0x3d')]));channels[_0x303d13[_0x27b9('0x33')]]['destinationchannel']=_0x303d13[_0x27b9('0x3d')];channels[_0x303d13[_0x27b9('0x33')]][_0x27b9('0x39')]=_0x27b9('0x3a');}}}catch(_0xfe663a){utils[_0x27b9('0x1f')](util[_0x27b9('0x17')](_0x27b9('0x34'),_0x303d13[_0x27b9('0x35')]),_0xfe663a);}};exports[_0x27b9('0x3e')]=function(_0x46f5f2){try{if(!_[_0x27b9('0x22')](channels[_0x46f5f2[_0x27b9('0x6')]])){utils[_0x27b9('0x20')](util[_0x27b9('0x17')](_0x27b9('0x3f'),_0x46f5f2['uniqueid']),_0x46f5f2);channels[_0x46f5f2[_0x27b9('0x6')]][_0x27b9('0x40')]=utils['now']();utils['info'](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x46f5f2[_0x27b9('0x6')],channels[_0x46f5f2['uniqueid']]['musiconholdstartAt']));}}catch(_0x43e32e){utils[_0x27b9('0x1f')](util[_0x27b9('0x17')](_0x27b9('0x3f'),_0x46f5f2[_0x27b9('0x6')]),_0x43e32e);}};exports[_0x27b9('0x41')]=function(_0x3072a2){try{if(!_[_0x27b9('0x22')](channels[_0x3072a2[_0x27b9('0x6')]])){utils[_0x27b9('0x20')](util[_0x27b9('0x17')](_0x27b9('0x42'),_0x3072a2[_0x27b9('0x6')]),_0x3072a2);if(!_['isNil'](channels[_0x3072a2['uniqueid']][_0x27b9('0x40')])){channels[_0x3072a2[_0x27b9('0x6')]][_0x27b9('0x43')]+=utils[_0x27b9('0x30')](utils['now'](),channels[_0x3072a2['uniqueid']][_0x27b9('0x40')]);utils[_0x27b9('0x9')](util[_0x27b9('0x17')](_0x27b9('0x44'),_0x3072a2[_0x27b9('0x6')],channels[_0x3072a2[_0x27b9('0x6')]][_0x27b9('0x43')]));delete channels[_0x3072a2[_0x27b9('0x6')]][_0x27b9('0x40')];}}}catch(_0x56d290){utils[_0x27b9('0x1f')](util[_0x27b9('0x17')]('[%s][calls][musiconholdstop]',_0x3072a2['uniqueid']),_0x56d290);}};exports['varset']=function(_0x466869){try{if(!_[_0x27b9('0x22')](channels[_0x466869[_0x27b9('0x6')]])){utils[_0x27b9('0x20')](util[_0x27b9('0x17')](_0x27b9('0x45'),_0x466869[_0x27b9('0x6')]),_0x466869);if(!_[_0x27b9('0x22')](_0x466869[_0x27b9('0x46')]['xmd-originatecalleridnum'])){utils['info'](util[_0x27b9('0x17')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x466869[_0x27b9('0x6')],_0x466869['value']));channels[_0x466869[_0x27b9('0x6')]]['source']=_0x466869[_0x27b9('0x47')];}if(!_['isNil'](_0x466869[_0x27b9('0x46')]['xmd-phone'])){utils[_0x27b9('0x9')](util[_0x27b9('0x17')](_0x27b9('0x48'),_0x466869[_0x27b9('0x6')],_0x466869[_0x27b9('0x47')]));channels[_0x466869['uniqueid']]['destination']=_0x466869['value'];channels[_0x466869[_0x27b9('0x6')]][_0x27b9('0x2e')]='\x22'+_0x466869['value']+_0x27b9('0x49')+_0x466869[_0x27b9('0x47')]+'>';}if(!_[_0x27b9('0x22')](_0x466869['variable']['xmd-callerid-preview'])||!_['isNil'](_0x466869[_0x27b9('0x46')]['xmd-callerid'])){utils[_0x27b9('0x9')](util['format'](_0x27b9('0x4a'),_0x466869['uniqueid'],!_['isNil'](_0x466869[_0x27b9('0x46')][_0x27b9('0x4b')])?_0x27b9('0x4b'):_0x27b9('0x4c'),_0x466869[_0x27b9('0x47')]));channels[_0x466869[_0x27b9('0x6')]][_0x27b9('0x2e')]=_0x466869[_0x27b9('0x47')];}if(!_[_0x27b9('0x22')](_0x466869[_0x27b9('0x46')]['xmd-queue'])||!_['isNil'](_0x466869['variable'][_0x27b9('0x4d')])){utils[_0x27b9('0x9')](util[_0x27b9('0x17')](_0x27b9('0x4a'),_0x466869[_0x27b9('0x6')],!_[_0x27b9('0x22')](_0x466869[_0x27b9('0x46')][_0x27b9('0x4e')])?_0x27b9('0x4e'):_0x27b9('0x4d'),_0x466869[_0x27b9('0x47')]));channels[_0x466869['uniqueid']]['lastapplication']=_0x27b9('0x4f');channels[_0x466869[_0x27b9('0x6')]]['lastdata']=_0x466869['value'];channels[_0x466869[_0x27b9('0x6')]]['queue']=!![];}if(!_[_0x27b9('0x22')](_0x466869[_0x27b9('0x46')]['xmd-contactid'])){utils['info'](util['format'](_0x27b9('0x50'),_0x466869[_0x27b9('0x6')],_0x466869['value']));channels[_0x466869[_0x27b9('0x6')]][_0x27b9('0x51')]=_0x466869[_0x27b9('0x47')];}if(!_[_0x27b9('0x22')](_0x466869['variable'][_0x27b9('0x52')])){utils[_0x27b9('0x9')](util[_0x27b9('0x17')](_0x27b9('0x53'),_0x466869[_0x27b9('0x6')],_0x466869[_0x27b9('0x47')]));channels[_0x466869[_0x27b9('0x6')]][_0x27b9('0x54')]=_0x466869[_0x27b9('0x47')];}if(!_[_0x27b9('0x22')](_0x466869[_0x27b9('0x46')][_0x27b9('0x55')])){utils[_0x27b9('0x9')](util['format'](_0x27b9('0x56'),_0x466869['uniqueid'],_0x466869['value']));channels[_0x466869['uniqueid']][_0x27b9('0x57')]=_0x466869[_0x27b9('0x47')];}if(!_[_0x27b9('0x22')](_0x466869['variable'][_0x27b9('0x58')])){utils[_0x27b9('0x9')](util[_0x27b9('0x17')](_0x27b9('0x59'),_0x466869[_0x27b9('0x6')],_0x466869[_0x27b9('0x47')]));channels[_0x466869['uniqueid']][_0x27b9('0x58')]=_0x466869['value'];}}}catch(_0x546e12){utils[_0x27b9('0x1f')](util[_0x27b9('0x17')](_0x27b9('0x45'),_0x466869[_0x27b9('0x6')]),_0x546e12);}};exports['newexten']=function(_0x2f01ff){try{if(!_[_0x27b9('0x22')](channels[_0x2f01ff['uniqueid']])){utils['debug'](util[_0x27b9('0x17')](_0x27b9('0x5a'),_0x2f01ff[_0x27b9('0x6')]),_0x2f01ff);utils[_0x27b9('0x9')](util[_0x27b9('0x17')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2f01ff[_0x27b9('0x6')],_0x2f01ff[_0x27b9('0x5b')],_0x2f01ff[_0x27b9('0x5c')]));if(_0x2f01ff[_0x27b9('0x5b')][_0x27b9('0x5d')]()=='set'&&_[_0x27b9('0x5e')](_0x2f01ff['appdata'][_0x27b9('0x5d')](),_0x27b9('0x5f'))){var _0x29a2d8=_0x2f01ff[_0x27b9('0x5c')][_0x27b9('0x60')]('=');var _0x2daaba=_0x29a2d8[0x0][_0x27b9('0x61')](_0x29a2d8[0x0][_0x27b9('0x62')]('(')+0x1,_0x29a2d8[0x0][_0x27b9('0x62')](')'));var _0x3bf0f8=_0x29a2d8[0x1];channels[_0x2f01ff[_0x27b9('0x6')]][_0x2daaba]=_0x3bf0f8;}if(!_['includes']([_0x27b9('0x2a'),'noop',_0x27b9('0x63'),'set',_0x27b9('0x64')],_0x2f01ff[_0x27b9('0x5b')][_0x27b9('0x5d')]())){channels[_0x2f01ff['uniqueid']][_0x27b9('0x65')]=_0x2f01ff['application'];channels[_0x2f01ff['uniqueid']][_0x27b9('0x66')]=_0x2f01ff[_0x27b9('0x5c')];}}}catch(_0x9f309a){utils[_0x27b9('0x1f')](util[_0x27b9('0x17')]('[%s][calls][newexten]',_0x2f01ff[_0x27b9('0x6')]),_0x9f309a);}}; \ No newline at end of file +var _0x63d4=['starttime','localtwolinkedid','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','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<','variable','xmd-callerid-preview','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','hangup','noop','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','request','CreateVoiceCallReport','recording','newchannel','debug','format','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','transfer','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x63d4,0x117));var _0x463d=function(_0x1e76e4,_0x4d2c17){_0x1e76e4=_0x1e76e4-0x0;var _0x127765=_0x63d4[_0x1e76e4];return _0x127765;};'use strict';var _=require(_0x463d('0x0'));var util=require(_0x463d('0x1'));var utils=require(_0x463d('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x463d('0x3'),_0x463d('0x4'),_0x463d('0x4'),_0x463d('0x3'),_0x463d('0x3'),'NO\x20ANSWER',_0x463d('0x5'),_0x463d('0x6'),'FAILED',_0x463d('0x4'),_0x463d('0x4')];var channels={};function writeDB(_0x2635aa){var _0x41dc01;if(transfers[_0x463d('0x7')][_0x2635aa['uniqueid']]){_0x41dc01=_0x2635aa[_0x463d('0x8')];_0x2635aa['uniqueid']=transfers[_0x463d('0x7')][_0x2635aa[_0x463d('0x8')]][_0x463d('0x9')];}utils[_0x463d('0xa')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2635aa[_0x463d('0x8')],_0x2635aa['channel'],_0x2635aa[_0x463d('0xb')],_0x2635aa[_0x463d('0xc')],_0x2635aa[_0x463d('0xd')],_0x2635aa[_0x463d('0xe')],_0x2635aa[_0x463d('0xf')],_0x2635aa[_0x463d('0x10')]));if(_0x2635aa[_0x463d('0x11')]){utils['getUserByInternal'](_0x2635aa[_0x463d('0x11')])[_0x463d('0x12')](function(_0x436dba){if(_0x436dba){_0x2635aa['UserId']=_0x436dba['id'];}utils[_0x463d('0x13')](_0x463d('0x14'),_0x2635aa);});}else{utils[_0x463d('0x13')](_0x463d('0x14'),_0x2635aa);}if(channels[_0x2635aa[_0x463d('0x8')]]){delete channels[_0x2635aa[_0x463d('0x8')]];}else if(_0x41dc01&&channels[_0x41dc01]){if(!transfers['blinds'][_0x41dc01][_0x463d('0x15')])delete transfers['blinds'][_0x41dc01];delete channels[_0x41dc01];}}exports[_0x463d('0x16')]=function(_0x40cdb5){try{utils[_0x463d('0x17')](util[_0x463d('0x18')](_0x463d('0x19'),_0x40cdb5[_0x463d('0x8')]),_0x40cdb5);if(_0x40cdb5['uniqueid']==_0x40cdb5[_0x463d('0x1a')]&&_0x40cdb5[_0x463d('0x1b')]!=_0x463d('0x1c')){utils[_0x463d('0xa')](util[_0x463d('0x18')](_0x463d('0x1d'),_0x40cdb5[_0x463d('0x8')],_0x40cdb5[_0x463d('0x1e')],_0x40cdb5[_0x463d('0x1f')]));channels[_0x40cdb5[_0x463d('0x8')]]={'uniqueid':_0x40cdb5[_0x463d('0x8')],'accountcode':_0x40cdb5[_0x463d('0x11')],'source':_0x40cdb5[_0x463d('0xe')],'destination':_0x40cdb5[_0x463d('0x1f')],'destinationcontext':_0x40cdb5[_0x463d('0x1e')],'channel':_0x40cdb5['channel'],'starttime':utils[_0x463d('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x463d('0x21')};}}catch(_0x1a2756){utils['error'](util['format'](_0x463d('0x19'),_0x40cdb5[_0x463d('0x8')]),_0x1a2756);}};exports['newstate']=function(_0x2efdb4){try{utils['debug'](util[_0x463d('0x18')](_0x463d('0x22'),_0x2efdb4[_0x463d('0x8')]),_0x2efdb4);if(!_['isNil'](channels[_0x2efdb4[_0x463d('0x8')]])&&_0x2efdb4[_0x463d('0x23')]==0x6){utils[_0x463d('0xa')](util[_0x463d('0x18')](_0x463d('0x24'),_0x2efdb4[_0x463d('0x8')],_0x2efdb4[_0x463d('0x1e')],_0x2efdb4['channel']));if(_['isNil'](channels[_0x2efdb4[_0x463d('0x8')]]['systemanswertime'])){channels[_0x2efdb4[_0x463d('0x8')]][_0x463d('0x25')]=utils[_0x463d('0x20')]();}}else if(!_[_0x463d('0x26')](channels[_0x2efdb4['linkedid']])&&_0x2efdb4[_0x463d('0x23')]==0x6&&_0x2efdb4[_0x463d('0x1e')]!=_0x463d('0x27')){utils[_0x463d('0xa')](util[_0x463d('0x18')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2efdb4[_0x463d('0x8')],_0x2efdb4[_0x463d('0x1a')],_0x2efdb4['context'],_0x2efdb4[_0x463d('0x1b')]));channels[_0x2efdb4['linkedid']][_0x463d('0x11')]=_0x2efdb4[_0x463d('0x11')];channels[_0x2efdb4[_0x463d('0x1a')]][_0x463d('0x28')]=_0x2efdb4[_0x463d('0x1b')];if(_['isNil'](channels[_0x2efdb4[_0x463d('0x1a')]][_0x463d('0x29')])){channels[_0x2efdb4[_0x463d('0x1a')]][_0x463d('0x29')]=utils[_0x463d('0x20')]();}channels[_0x2efdb4[_0x463d('0x1a')]][_0x463d('0x2a')]=dispositions[_[_0x463d('0x2b')](_0x2efdb4[_0x463d('0x23')])]||_0x463d('0x5');}}catch(_0x118b08){utils[_0x463d('0x2c')](util[_0x463d('0x18')](_0x463d('0x22'),_0x2efdb4[_0x463d('0x8')]),_0x118b08);}};exports['hangup']=function(_0x153fab){try{if(!_[_0x463d('0x26')](channels[_0x153fab[_0x463d('0x8')]])){utils[_0x463d('0x17')](util[_0x463d('0x18')](_0x463d('0x2d'),_0x153fab[_0x463d('0x8')]),_0x153fab);if(_[_0x463d('0x26')](channels[_0x153fab[_0x463d('0x8')]][_0x463d('0x2e')])){channels[_0x153fab[_0x463d('0x8')]]['callerid']=_0x153fab['calleridname']+'\x20<'+_0x153fab[_0x463d('0xe')]+'>';}utils[_0x463d('0xa')](util['format'](_0x463d('0x2f'),_0x153fab['uniqueid'],channels[_0x153fab['uniqueid']][_0x463d('0x2e')],_0x153fab['cause-txt']));channels[_0x153fab[_0x463d('0x8')]][_0x463d('0x30')]=utils['now']();channels[_0x153fab[_0x463d('0x8')]][_0x463d('0x31')]=utils[_0x463d('0x32')](channels[_0x153fab[_0x463d('0x8')]][_0x463d('0x30')],channels[_0x153fab[_0x463d('0x8')]][_0x463d('0x33')]);channels[_0x153fab['uniqueid']]['billableseconds']=channels[_0x153fab[_0x463d('0x8')]][_0x463d('0x29')]?utils[_0x463d('0x32')](channels[_0x153fab['uniqueid']]['endtime'],channels[_0x153fab[_0x463d('0x8')]]['answertime']):0x0;writeDB(channels[_0x153fab[_0x463d('0x8')]]);}}catch(_0x42263b){utils[_0x463d('0x2c')](util[_0x463d('0x18')](_0x463d('0x2d'),_0x153fab[_0x463d('0x8')]),_0x42263b);}};exports['attendedtransfer']=function(_0x12ac2a){try{if(!_['isNil'](channels[_0x12ac2a[_0x463d('0x34')]])){utils[_0x463d('0x17')](util['format']('[%s][calls][attendedtransfer]',_0x12ac2a[_0x463d('0x35')]),_0x12ac2a);if(channels[_0x12ac2a[_0x463d('0x34')]]['channel']==_0x12ac2a['transfereechannel']){utils[_0x463d('0xa')](util['format'](_0x463d('0x36'),_0x12ac2a[_0x463d('0x35')],_0x12ac2a[_0x463d('0x34')],_0x12ac2a[_0x463d('0x37')]));channels[_0x12ac2a[_0x463d('0x34')]]['destinationchannel']=_0x12ac2a[_0x463d('0x37')];channels[_0x12ac2a[_0x463d('0x34')]][_0x463d('0x38')]=_0x463d('0x39');}else if(channels[_0x12ac2a[_0x463d('0x34')]][_0x463d('0x1b')]=_0x12ac2a[_0x463d('0x3a')]){utils[_0x463d('0xa')](util['format'](_0x463d('0x36'),_0x12ac2a['origtransfereruniqueid'],_0x12ac2a['localtwolinkedid'],_0x12ac2a['origtransfererchannel']));channels[_0x12ac2a['localtwolinkedid']][_0x463d('0x28')]=_0x12ac2a[_0x463d('0x3b')];channels[_0x12ac2a[_0x463d('0x34')]][_0x463d('0x38')]=_0x463d('0x39');}}}catch(_0x100f68){utils[_0x463d('0x2c')](util['format'](_0x463d('0x3c'),_0x12ac2a['origtransfereruniqueid']),_0x100f68);}};exports[_0x463d('0x3d')]=function(_0x1ffbfe){try{if(!_[_0x463d('0x26')](channels[_0x1ffbfe[_0x463d('0x8')]])){utils[_0x463d('0x17')](util[_0x463d('0x18')](_0x463d('0x3e'),_0x1ffbfe[_0x463d('0x8')]),_0x1ffbfe);channels[_0x1ffbfe[_0x463d('0x8')]]['musiconholdstartAt']=utils[_0x463d('0x20')]();utils[_0x463d('0xa')](util[_0x463d('0x18')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1ffbfe['uniqueid'],channels[_0x1ffbfe[_0x463d('0x8')]]['musiconholdstartAt']));}}catch(_0x929d8){utils[_0x463d('0x2c')](util[_0x463d('0x18')]('[%s][calls][musiconholdstart]',_0x1ffbfe[_0x463d('0x8')]),_0x929d8);}};exports[_0x463d('0x3f')]=function(_0x4abb94){try{if(!_['isNil'](channels[_0x4abb94[_0x463d('0x8')]])){utils[_0x463d('0x17')](util[_0x463d('0x18')](_0x463d('0x40'),_0x4abb94[_0x463d('0x8')]),_0x4abb94);if(!_[_0x463d('0x26')](channels[_0x4abb94[_0x463d('0x8')]][_0x463d('0x41')])){channels[_0x4abb94[_0x463d('0x8')]][_0x463d('0x42')]+=utils['diffTime'](utils['now'](),channels[_0x4abb94[_0x463d('0x8')]]['musiconholdstartAt']);utils['info'](util['format'](_0x463d('0x43'),_0x4abb94[_0x463d('0x8')],channels[_0x4abb94[_0x463d('0x8')]]['mohtime']));delete channels[_0x4abb94[_0x463d('0x8')]][_0x463d('0x41')];}}}catch(_0x48b92a){utils[_0x463d('0x2c')](util[_0x463d('0x18')]('[%s][calls][musiconholdstop]',_0x4abb94[_0x463d('0x8')]),_0x48b92a);}};exports[_0x463d('0x44')]=function(_0x115599){try{if(!_['isNil'](channels[_0x115599['uniqueid']])){utils[_0x463d('0x17')](util[_0x463d('0x18')](_0x463d('0x45'),_0x115599[_0x463d('0x8')]),_0x115599);if(!_[_0x463d('0x26')](_0x115599['variable'][_0x463d('0x46')])){utils[_0x463d('0xa')](util[_0x463d('0x18')](_0x463d('0x47'),_0x115599[_0x463d('0x8')],_0x115599[_0x463d('0x48')]));channels[_0x115599['uniqueid']][_0x463d('0x49')]=_0x115599['value'];}if(!_[_0x463d('0x26')](_0x115599['variable'][_0x463d('0x4a')])){utils['info'](util['format'](_0x463d('0x4b'),_0x115599[_0x463d('0x8')],_0x115599['value']));channels[_0x115599[_0x463d('0x8')]][_0x463d('0x4c')]=_0x115599[_0x463d('0x48')];channels[_0x115599['uniqueid']][_0x463d('0x2e')]='\x22'+_0x115599['value']+_0x463d('0x4d')+_0x115599['value']+'>';}if(!_[_0x463d('0x26')](_0x115599[_0x463d('0x4e')][_0x463d('0x4f')])||!_['isNil'](_0x115599['variable']['xmd-callerid'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x115599[_0x463d('0x8')],!_['isNil'](_0x115599[_0x463d('0x4e')][_0x463d('0x4f')])?_0x463d('0x4f'):'xmd-callerid',_0x115599[_0x463d('0x48')]));channels[_0x115599[_0x463d('0x8')]][_0x463d('0x2e')]=_0x115599[_0x463d('0x48')];}if(!_[_0x463d('0x26')](_0x115599[_0x463d('0x4e')][_0x463d('0x50')])||!_[_0x463d('0x26')](_0x115599['variable']['xmcs-queue'])){utils[_0x463d('0xa')](util[_0x463d('0x18')](_0x463d('0x51'),_0x115599['uniqueid'],!_[_0x463d('0x26')](_0x115599[_0x463d('0x4e')]['xmd-queue'])?_0x463d('0x50'):_0x463d('0x52'),_0x115599['value']));channels[_0x115599[_0x463d('0x8')]][_0x463d('0x53')]=_0x463d('0x54');channels[_0x115599[_0x463d('0x8')]][_0x463d('0x55')]=_0x115599[_0x463d('0x48')];channels[_0x115599[_0x463d('0x8')]][_0x463d('0xb')]=!![];}if(!_[_0x463d('0x26')](_0x115599[_0x463d('0x4e')][_0x463d('0x56')])){utils[_0x463d('0xa')](util[_0x463d('0x18')](_0x463d('0x57'),_0x115599['uniqueid'],_0x115599[_0x463d('0x48')]));channels[_0x115599[_0x463d('0x8')]][_0x463d('0x58')]=_0x115599['value'];}if(!_[_0x463d('0x26')](_0x115599[_0x463d('0x4e')][_0x463d('0x59')])){utils['info'](util[_0x463d('0x18')](_0x463d('0x5a'),_0x115599[_0x463d('0x8')],_0x115599['value']));channels[_0x115599[_0x463d('0x8')]][_0x463d('0x5b')]=_0x115599['value'];}if(!_['isNil'](_0x115599['variable'][_0x463d('0x5c')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x115599[_0x463d('0x8')],_0x115599[_0x463d('0x48')]));channels[_0x115599['uniqueid']][_0x463d('0x5d')]=_0x115599[_0x463d('0x48')];}if(!_['isNil'](_0x115599[_0x463d('0x4e')]['sipcallid'])){utils['info'](util[_0x463d('0x18')](_0x463d('0x5e'),_0x115599['uniqueid'],_0x115599['value']));channels[_0x115599['uniqueid']][_0x463d('0x5f')]=_0x115599['value'];}}}catch(_0x2e19b3){utils[_0x463d('0x2c')](util[_0x463d('0x18')](_0x463d('0x45'),_0x115599[_0x463d('0x8')]),_0x2e19b3);}};exports[_0x463d('0x60')]=function(_0x4f439b){try{if(!_[_0x463d('0x26')](channels[_0x4f439b['uniqueid']])){utils[_0x463d('0x17')](util['format'](_0x463d('0x61'),_0x4f439b[_0x463d('0x8')]),_0x4f439b);utils['info'](util[_0x463d('0x18')](_0x463d('0x62'),_0x4f439b[_0x463d('0x8')],_0x4f439b[_0x463d('0x63')],_0x4f439b[_0x463d('0x64')]));if(_0x4f439b['application'][_0x463d('0x65')]()==_0x463d('0x66')&&_[_0x463d('0x67')](_0x4f439b[_0x463d('0x64')]['toLowerCase'](),_0x463d('0x68'))){var _0x2cd216=_0x4f439b[_0x463d('0x64')]['split']('=');var _0x30d8aa=_0x2cd216[0x0][_0x463d('0x69')](_0x2cd216[0x0][_0x463d('0x6a')]('(')+0x1,_0x2cd216[0x0][_0x463d('0x6a')](')'));var _0x22585b=_0x2cd216[0x1];channels[_0x4f439b['uniqueid']][_0x30d8aa]=_0x22585b;}if(!_['includes']([_0x463d('0x6b'),_0x463d('0x6c'),'execif',_0x463d('0x66'),_0x463d('0x6d')],_0x4f439b['application'][_0x463d('0x65')]())){channels[_0x4f439b[_0x463d('0x8')]]['lastapplication']=_0x4f439b[_0x463d('0x63')];channels[_0x4f439b[_0x463d('0x8')]][_0x463d('0x55')]=_0x4f439b[_0x463d('0x64')];}}}catch(_0x52bf5e){utils['error'](util['format'](_0x463d('0x61'),_0x4f439b['uniqueid']),_0x52bf5e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e3b27af..e4c7232 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 _0x1bb4=['close','[core]\x20close','managerevent','./utils','connect','[core]\x20connected','shutdown','[core]\x20shutdown','info','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x1bb4,0x153));var _0x41bb=function(_0x592acc,_0x2bf43e){_0x592acc=_0x592acc-0x0;var _0x49e7a6=_0x1bb4[_0x592acc];return _0x49e7a6;};'use strict';var utils=require(_0x41bb('0x0'));exports[_0x41bb('0x1')]=function(){utils['info'](_0x41bb('0x2'));};exports[_0x41bb('0x3')]=function(){utils['info'](_0x41bb('0x4'));};exports['fullybooted']=function(){utils[_0x41bb('0x5')](_0x41bb('0x6'));};exports['error']=function(_0x18b897){utils[_0x41bb('0x7')](_0x41bb('0x8'),_0x18b897);};exports[_0x41bb('0x9')]=function(){utils[_0x41bb('0x5')](_0x41bb('0xa'));};exports[_0x41bb('0xb')]=function(_0x534db6){}; \ No newline at end of file +var _0xf3d1=['managerevent','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x40c2ea,_0x7afb97){var _0x1b8426=function(_0x103d3c){while(--_0x103d3c){_0x40c2ea['push'](_0x40c2ea['shift']());}};_0x1b8426(++_0x7afb97);}(_0xf3d1,0x1da));var _0x1f3d=function(_0x2cfcc3,_0x105116){_0x2cfcc3=_0x2cfcc3-0x0;var _0x1e5863=_0xf3d1[_0x2cfcc3];return _0x1e5863;};'use strict';var utils=require('./utils');exports[_0x1f3d('0x0')]=function(){utils[_0x1f3d('0x1')](_0x1f3d('0x2'));};exports[_0x1f3d('0x3')]=function(){utils[_0x1f3d('0x1')](_0x1f3d('0x4'));};exports[_0x1f3d('0x5')]=function(){utils['info'](_0x1f3d('0x6'));};exports[_0x1f3d('0x7')]=function(_0x57e84e){utils[_0x1f3d('0x7')](_0x1f3d('0x8'),_0x57e84e);};exports[_0x1f3d('0x9')]=function(){utils[_0x1f3d('0x1')]('[core]\x20close');};exports[_0x1f3d('0xa')]=function(_0x5e6310){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 6e7bf47..ed6a563 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 _0x55e5=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','holdtime','diffTime','endtime','billableseconds','lodash','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','[%s][dials][varset]','isNil','variable','outboundrouteid','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]'];(function(_0x8b7515,_0x139c78){var _0x5324d6=function(_0x4c7036){while(--_0x4c7036){_0x8b7515['push'](_0x8b7515['shift']());}};_0x5324d6(++_0x139c78);}(_0x55e5,0x1dc));var _0x555e=function(_0x23792e,_0x38e999){_0x23792e=_0x23792e-0x0;var _0x34631d=_0x55e5[_0x23792e];return _0x34631d;};'use strict';var _=require(_0x555e('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x21c118){utils['info'](util[_0x555e('0x1')](_0x555e('0x2'),_0x21c118[_0x555e('0x3')],_0x21c118[_0x555e('0x4')],_0x21c118[_0x555e('0x5')],_0x21c118[_0x555e('0x6')],_0x21c118[_0x555e('0x7')],_0x21c118[_0x555e('0x8')]));utils[_0x555e('0x9')]('CreateVoiceDialReport',_0x21c118);delete dials[_0x21c118[_0x555e('0x3')]];}exports[_0x555e('0xa')]=function(_0x1a56cb){try{utils[_0x555e('0xb')](util[_0x555e('0x1')](_0x555e('0xc'),_0x1a56cb[_0x555e('0x3')]),_0x1a56cb);utils['info'](util['format'](_0x555e('0xd'),_0x1a56cb[_0x555e('0x3')],_0x1a56cb[_0x555e('0xe')],_0x1a56cb[_0x555e('0xf')]));if(_0x1a56cb[_0x555e('0xe')][_0x555e('0x10')]()==_0x555e('0x11')&&_['startsWith'](_0x1a56cb[_0x555e('0xf')][_0x555e('0x10')](),_0x555e('0x12'))){var _0xcb874=_0x1a56cb['appdata'][_0x555e('0x13')]('=');dials[_0x1a56cb[_0x555e('0x3')]]={'routeId':_0xcb874[0x1]};}}catch(_0x3f55d0){utils['error'](util[_0x555e('0x1')](_0x555e('0xc'),_0x1a56cb['uniqueid']),_0x3f55d0);}};exports['varset']=function(_0x5cb451){try{utils['debug'](util[_0x555e('0x1')](_0x555e('0x14'),_0x5cb451['uniqueid']),_0x5cb451);if(!_[_0x555e('0x15')](_0x5cb451[_0x555e('0x16')][_0x555e('0x17')])){utils[_0x555e('0x18')](util[_0x555e('0x1')](_0x555e('0x19'),_0x5cb451[_0x555e('0x3')],_0x5cb451[_0x555e('0x1a')]));dials[_0x5cb451['uniqueid']]={'routeId':_0x5cb451[_0x555e('0x1a')]};}}catch(_0x1c7b10){utils[_0x555e('0x1b')](util[_0x555e('0x1')](_0x555e('0x14'),_0x5cb451[_0x555e('0x3')]),_0x1c7b10);}};exports[_0x555e('0x1c')]=function(_0x319d9a){try{if(!_[_0x555e('0x15')](dials[_0x319d9a[_0x555e('0x3')]])){utils[_0x555e('0xb')](util['format'](_0x555e('0x1d'),_0x319d9a[_0x555e('0x3')]),_0x319d9a);dials[_0x319d9a['uniqueid']]=_[_0x555e('0x1e')](dials[_0x319d9a[_0x555e('0x3')]],_0x319d9a);dials[_0x319d9a[_0x555e('0x3')]][_0x555e('0x1f')]=utils[_0x555e('0x20')]();dials[_0x319d9a[_0x555e('0x3')]][_0x555e('0x21')]=_0x555e('0x22');utils['info'](util[_0x555e('0x1')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x319d9a[_0x555e('0x3')],dials[_0x319d9a[_0x555e('0x3')]][_0x555e('0x1f')]));}}catch(_0x1120b4){utils[_0x555e('0x1b')](util['format'](_0x555e('0x1d'),_0x319d9a['uniqueid']),_0x1120b4);}};exports[_0x555e('0x23')]=function(_0x50de45){try{if(!_[_0x555e('0x15')](dials[_0x50de45['uniqueid']])){utils['debug'](util[_0x555e('0x1')](_0x555e('0x24'),_0x50de45[_0x555e('0x3')]),_0x50de45);dials[_0x50de45['uniqueid']][_0x555e('0x8')]=_0x50de45[_0x555e('0x8')];if(_0x50de45['dialstatus']==_0x555e('0x25')){dials[_0x50de45[_0x555e('0x3')]]=_[_0x555e('0x1e')](dials[_0x50de45[_0x555e('0x3')]],_0x50de45);dials[_0x50de45['uniqueid']]['answertime']=utils['now']();dials[_0x50de45[_0x555e('0x3')]][_0x555e('0x21')]=_0x555e('0x26');utils[_0x555e('0x18')](util[_0x555e('0x1')](_0x555e('0x27'),_0x50de45[_0x555e('0x3')],_0x50de45['dialstatus'],dials[_0x50de45[_0x555e('0x3')]][_0x555e('0x28')]));}else{utils[_0x555e('0x18')](util[_0x555e('0x1')](_0x555e('0x29'),_0x50de45[_0x555e('0x3')],_0x50de45[_0x555e('0x8')]));}}}catch(_0x5e40e7){utils[_0x555e('0x1b')](util[_0x555e('0x1')](_0x555e('0x24'),_0x50de45['uniqueid']),_0x5e40e7);}};exports[_0x555e('0x2a')]=function(_0x3414de){try{if(!_[_0x555e('0x15')](dials[_0x3414de[_0x555e('0x3')]])){utils['debug'](util['format'](_0x555e('0x2b'),_0x3414de['uniqueid']),_0x3414de);utils[_0x555e('0x18')](util['format'](_0x555e('0x2c'),_0x3414de[_0x555e('0x3')],_0x3414de['calleridnum'],_0x3414de['calleridname'],_0x3414de[_0x555e('0x2d')]));dials[_0x3414de[_0x555e('0x3')]]=_[_0x555e('0x1e')](dials[_0x3414de[_0x555e('0x3')]],{'endtime':utils['now'](),'lastevent':_0x555e('0x2e')});dials[_0x3414de[_0x555e('0x3')]][_0x555e('0x2f')]=utils['diffTime'](dials[_0x3414de['uniqueid']]['endtime'],dials[_0x3414de['uniqueid']][_0x555e('0x1f')]);dials[_0x3414de[_0x555e('0x3')]][_0x555e('0x30')]=utils[_0x555e('0x31')](dials[_0x3414de['uniqueid']]['answertime']||dials[_0x3414de[_0x555e('0x3')]][_0x555e('0x32')],dials[_0x3414de[_0x555e('0x3')]][_0x555e('0x1f')]);dials[_0x3414de['uniqueid']][_0x555e('0x33')]=dials[_0x3414de[_0x555e('0x3')]][_0x555e('0x28')]?utils['diffTime'](dials[_0x3414de['uniqueid']][_0x555e('0x32')],dials[_0x3414de[_0x555e('0x3')]][_0x555e('0x28')]):0x0;writeDB(dials[_0x3414de[_0x555e('0x3')]]);}}catch(_0x4f0258){utils[_0x555e('0x1b')](util[_0x555e('0x1')]('[%s][dials][hangup]',_0x3414de['uniqueid']),_0x4f0258);}}; \ No newline at end of file +var _0x565f=['info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','variable','outboundrouteid','value','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','isNil','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','diffTime','endtime','holdtime','billableseconds','lodash'];(function(_0x5c88ba,_0x5c3a18){var _0x2f064f=function(_0xd5dc83){while(--_0xd5dc83){_0x5c88ba['push'](_0x5c88ba['shift']());}};_0x2f064f(++_0x5c3a18);}(_0x565f,0xb7));var _0xf565=function(_0x3d0fbf,_0x5cf4d0){_0x3d0fbf=_0x3d0fbf-0x0;var _0x55ee31=_0x565f[_0x3d0fbf];return _0x55ee31;};'use strict';var _=require(_0xf565('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x140ba4){utils[_0xf565('0x1')](util[_0xf565('0x2')](_0xf565('0x3'),_0x140ba4[_0xf565('0x4')],_0x140ba4[_0xf565('0x5')],_0x140ba4[_0xf565('0x6')],_0x140ba4['calleridnum'],_0x140ba4[_0xf565('0x7')],_0x140ba4[_0xf565('0x8')]));utils[_0xf565('0x9')]('CreateVoiceDialReport',_0x140ba4);delete dials[_0x140ba4[_0xf565('0x4')]];}exports[_0xf565('0xa')]=function(_0x249886){try{utils[_0xf565('0xb')](util[_0xf565('0x2')](_0xf565('0xc'),_0x249886['uniqueid']),_0x249886);utils[_0xf565('0x1')](util[_0xf565('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x249886[_0xf565('0x4')],_0x249886[_0xf565('0xd')],_0x249886[_0xf565('0xe')]));if(_0x249886[_0xf565('0xd')][_0xf565('0xf')]()=='set'&&_[_0xf565('0x10')](_0x249886['appdata']['toLowerCase'](),_0xf565('0x11'))){var _0xaaebf0=_0x249886['appdata']['split']('=');dials[_0x249886[_0xf565('0x4')]]={'routeId':_0xaaebf0[0x1]};}}catch(_0x5c6378){utils[_0xf565('0x12')](util['format'](_0xf565('0xc'),_0x249886[_0xf565('0x4')]),_0x5c6378);}};exports[_0xf565('0x13')]=function(_0x2695f1){try{utils[_0xf565('0xb')](util['format'](_0xf565('0x14'),_0x2695f1[_0xf565('0x4')]),_0x2695f1);if(!_['isNil'](_0x2695f1[_0xf565('0x15')][_0xf565('0x16')])){utils[_0xf565('0x1')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x2695f1[_0xf565('0x4')],_0x2695f1[_0xf565('0x17')]));dials[_0x2695f1[_0xf565('0x4')]]={'routeId':_0x2695f1[_0xf565('0x17')]};}}catch(_0x3d6a40){utils[_0xf565('0x12')](util['format'](_0xf565('0x14'),_0x2695f1['uniqueid']),_0x3d6a40);}};exports['dialbegin']=function(_0x3f6762){try{if(!_['isNil'](dials[_0x3f6762[_0xf565('0x4')]])){utils[_0xf565('0xb')](util[_0xf565('0x2')]('[%s][dials][dialbegin]',_0x3f6762[_0xf565('0x4')]),_0x3f6762);dials[_0x3f6762['uniqueid']]=_[_0xf565('0x18')](dials[_0x3f6762['uniqueid']],_0x3f6762);dials[_0x3f6762[_0xf565('0x4')]][_0xf565('0x19')]=utils[_0xf565('0x1a')]();dials[_0x3f6762[_0xf565('0x4')]][_0xf565('0x1b')]='called';utils['info'](util[_0xf565('0x2')](_0xf565('0x1c'),_0x3f6762['uniqueid'],dials[_0x3f6762[_0xf565('0x4')]][_0xf565('0x19')]));}}catch(_0x299042){utils['error'](util['format'](_0xf565('0x1d'),_0x3f6762[_0xf565('0x4')]),_0x299042);}};exports[_0xf565('0x1e')]=function(_0x51678f){try{if(!_['isNil'](dials[_0x51678f[_0xf565('0x4')]])){utils[_0xf565('0xb')](util[_0xf565('0x2')](_0xf565('0x1f'),_0x51678f[_0xf565('0x4')]),_0x51678f);dials[_0x51678f[_0xf565('0x4')]][_0xf565('0x8')]=_0x51678f[_0xf565('0x8')];if(_0x51678f[_0xf565('0x8')]==_0xf565('0x20')){dials[_0x51678f['uniqueid']]=_[_0xf565('0x18')](dials[_0x51678f[_0xf565('0x4')]],_0x51678f);dials[_0x51678f['uniqueid']][_0xf565('0x21')]=utils['now']();dials[_0x51678f[_0xf565('0x4')]]['lastevent']=_0xf565('0x22');utils[_0xf565('0x1')](util[_0xf565('0x2')](_0xf565('0x23'),_0x51678f[_0xf565('0x4')],_0x51678f[_0xf565('0x8')],dials[_0x51678f[_0xf565('0x4')]]['answertime']));}else{utils[_0xf565('0x1')](util[_0xf565('0x2')](_0xf565('0x24'),_0x51678f[_0xf565('0x4')],_0x51678f[_0xf565('0x8')]));}}}catch(_0x31e9d8){utils[_0xf565('0x12')](util['format']('[%s][dials][dialend]',_0x51678f[_0xf565('0x4')]),_0x31e9d8);}};exports[_0xf565('0x25')]=function(_0x51e8c9){try{if(!_[_0xf565('0x26')](dials[_0x51e8c9[_0xf565('0x4')]])){utils[_0xf565('0xb')](util['format'](_0xf565('0x27'),_0x51e8c9[_0xf565('0x4')]),_0x51e8c9);utils['info'](util[_0xf565('0x2')](_0xf565('0x28'),_0x51e8c9[_0xf565('0x4')],_0x51e8c9['calleridnum'],_0x51e8c9['calleridname'],_0x51e8c9[_0xf565('0x29')]));dials[_0x51e8c9['uniqueid']]=_[_0xf565('0x18')](dials[_0x51e8c9['uniqueid']],{'endtime':utils[_0xf565('0x1a')](),'lastevent':'complete'});dials[_0x51e8c9['uniqueid']]['duration']=utils[_0xf565('0x2a')](dials[_0x51e8c9[_0xf565('0x4')]][_0xf565('0x2b')],dials[_0x51e8c9[_0xf565('0x4')]][_0xf565('0x19')]);dials[_0x51e8c9[_0xf565('0x4')]][_0xf565('0x2c')]=utils[_0xf565('0x2a')](dials[_0x51e8c9[_0xf565('0x4')]][_0xf565('0x21')]||dials[_0x51e8c9[_0xf565('0x4')]][_0xf565('0x2b')],dials[_0x51e8c9['uniqueid']][_0xf565('0x19')]);dials[_0x51e8c9['uniqueid']][_0xf565('0x2d')]=dials[_0x51e8c9[_0xf565('0x4')]][_0xf565('0x21')]?utils[_0xf565('0x2a')](dials[_0x51e8c9[_0xf565('0x4')]]['endtime'],dials[_0x51e8c9[_0xf565('0x4')]][_0xf565('0x21')]):0x0;writeDB(dials[_0x51e8c9[_0xf565('0x4')]]);}}catch(_0x402e48){utils['error'](util[_0xf565('0x2')](_0xf565('0x27'),_0x51e8c9[_0xf565('0x4')]),_0x402e48);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 91ec94c..97dce88 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 _0xfd50=['newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','env','production','local','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]'];(function(_0x5a03c0,_0x5b6f8f){var _0x504314=function(_0x4d6761){while(--_0x4d6761){_0x5a03c0['push'](_0x5a03c0['shift']());}};_0x504314(++_0x5b6f8f);}(_0xfd50,0x178));var _0x0fd5=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0xfd50[_0x1646fa];return _0x5a47a5;};var AsteriskManager=require('asterisk-manager');var config=require(_0x0fd5('0x0'));var utils=require(_0x0fd5('0x1'));var util=require(_0x0fd5('0x2'));var isXDREnabled=config[_0x0fd5('0x3')]&&!config[_0x0fd5('0x3')]['disabled'];var isProduction=config[_0x0fd5('0x4')]===_0x0fd5('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x0fd5('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x0fd5('0x7')][_0x0fd5('0x8')],config[_0x0fd5('0x7')]['ip'],config['asterisk'][_0x0fd5('0x9')],config[_0x0fd5('0x7')]['password'],!![]);ami[_0x0fd5('0xa')]();if(!isXDREnabled){utils[_0x0fd5('0xb')](_0x0fd5('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x0fd5('0xb')](_0x0fd5('0xd'));}else{var agents=require(_0x0fd5('0xe'));var calls=require(_0x0fd5('0xf'));var queues=require('./queues.controller');var recordings=require(_0x0fd5('0x10'));var members=require(_0x0fd5('0x11'));var dials=require('./dials.controller');var transfers=require(_0x0fd5('0x12'));var core=require(_0x0fd5('0x13'));ami['on'](_0x0fd5('0x14'),core[_0x0fd5('0x14')]);ami['on'](_0x0fd5('0x15'),core[_0x0fd5('0x15')]);ami['on'](_0x0fd5('0x16'),core['fullybooted']);ami['on']('error',core[_0x0fd5('0x17')]);ami['on']('close',core[_0x0fd5('0x18')]);ami['on'](_0x0fd5('0x19'),core[_0x0fd5('0x19')]);ami['on'](_0x0fd5('0x1a'),function(_0x200639){try{utils['debug'](util[_0x0fd5('0x1b')](_0x0fd5('0x1c'),_0x200639[_0x0fd5('0x1d')]),_0x200639);members[_0x0fd5('0x1a')](_0x200639);}catch(_0xe6e3d2){utils[_0x0fd5('0x17')](util['format'](_0x0fd5('0x1c'),_0x200639[_0x0fd5('0x1d')]),_0xe6e3d2);}});ami['on'](_0x0fd5('0x1e'),function(_0x442815){try{utils[_0x0fd5('0x1f')](util['format'](_0x0fd5('0x20'),_0x442815[_0x0fd5('0x21')]),_0x442815);agents[_0x0fd5('0x1e')](_0x442815);}catch(_0x25ed9d){utils[_0x0fd5('0x17')](util['format'](_0x0fd5('0x20'),_0x442815['uniqueid']),_0x25ed9d);}});ami['on'](_0x0fd5('0x22'),function(_0x8c4670){try{utils['debug'](util[_0x0fd5('0x1b')](_0x0fd5('0x23'),_0x8c4670[_0x0fd5('0x21')]),_0x8c4670);agents[_0x0fd5('0x22')](_0x8c4670);}catch(_0x5ab5f5){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x23'),_0x8c4670[_0x0fd5('0x21')]),_0x5ab5f5);}});ami['on']('agentconnect',function(_0x5cd24){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x24'),_0x5cd24[_0x0fd5('0x21')]),_0x5cd24);agents[_0x0fd5('0x25')](_0x5cd24);queues[_0x0fd5('0x25')](_0x5cd24);}catch(_0x1166c4){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x24'),_0x5cd24[_0x0fd5('0x21')]),_0x1166c4);}});ami['on'](_0x0fd5('0x26'),function(_0x52a6a2){try{utils['debug'](util['format'](_0x0fd5('0x27'),_0x52a6a2[_0x0fd5('0x21')]),_0x52a6a2);agents['agentcomplete'](_0x52a6a2);queues[_0x0fd5('0x26')](_0x52a6a2);members[_0x0fd5('0x26')](_0x52a6a2);}catch(_0x23c6b9){utils[_0x0fd5('0x17')](util['format'](_0x0fd5('0x27'),_0x52a6a2[_0x0fd5('0x21')]),_0x23c6b9);}});ami['on'](_0x0fd5('0x28'),function(_0x4cc40b){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x29'),_0x4cc40b[_0x0fd5('0x21')]),_0x4cc40b);agents[_0x0fd5('0x28')](_0x4cc40b);queues['queuecallerabandon'](_0x4cc40b);}catch(_0x165ba3){utils['error'](util['format'](_0x0fd5('0x29'),_0x4cc40b['uniqueid']),_0x165ba3);}});ami['on'](_0x0fd5('0x2a'),function(_0x2d20f2){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x2b'),_0x2d20f2[_0x0fd5('0x21')]),_0x2d20f2);queues[_0x0fd5('0x2a')](_0x2d20f2);recordings[_0x0fd5('0x2a')](_0x2d20f2);}catch(_0x4a1309){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x2b'),_0x2d20f2[_0x0fd5('0x21')]),_0x4a1309);}});ami['on'](_0x0fd5('0x2c'),function(_0x37f1da){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x2d'),_0x37f1da[_0x0fd5('0x21')]),_0x37f1da);queues[_0x0fd5('0x2c')](_0x37f1da);}catch(_0x220da9){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')]('[%s][index][queuecallerleave]',_0x37f1da['uniqueid']),_0x220da9);}});ami['on'](_0x0fd5('0x2e'),function(_0x5781fa){try{utils['debug'](util[_0x0fd5('0x1b')](_0x0fd5('0x2f'),_0x5781fa[_0x0fd5('0x21')]),_0x5781fa);queues[_0x0fd5('0x2e')](_0x5781fa);calls[_0x0fd5('0x2e')](_0x5781fa);}catch(_0x4736b0){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x2f'),_0x5781fa[_0x0fd5('0x21')]),_0x4736b0);}});ami['on'](_0x0fd5('0x30'),function(_0xffd38e){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x31'),_0xffd38e[_0x0fd5('0x21')]),_0xffd38e);queues['musiconholdstop'](_0xffd38e);calls[_0x0fd5('0x30')](_0xffd38e);}catch(_0x5e1261){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x31'),_0xffd38e['uniqueid']),_0x5e1261);}});ami['on'](_0x0fd5('0x32'),function(_0x38f128){try{utils['debug'](util[_0x0fd5('0x1b')](_0x0fd5('0x33'),_0x38f128['uniqueid']),_0x38f128);calls[_0x0fd5('0x32')](_0x38f128);recordings[_0x0fd5('0x32')](_0x38f128);}catch(_0x70c17b){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x33'),_0x38f128[_0x0fd5('0x21')]),_0x70c17b);}});ami['on'](_0x0fd5('0x34'),function(_0x2aa940){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x35'),_0x2aa940[_0x0fd5('0x21')]),_0x2aa940);calls[_0x0fd5('0x34')](_0x2aa940);recordings[_0x0fd5('0x34')](_0x2aa940);dials['hangup'](_0x2aa940);agents[_0x0fd5('0x34')](_0x2aa940);queues[_0x0fd5('0x34')](_0x2aa940);}catch(_0x18ee45){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x35'),_0x2aa940[_0x0fd5('0x21')]),_0x18ee45);}});ami['on'](_0x0fd5('0x36'),function(_0x54a29d){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x37'),_0x54a29d[_0x0fd5('0x21')]),_0x54a29d);members[_0x0fd5('0x36')](_0x54a29d);}catch(_0x183d3c){utils['error'](util[_0x0fd5('0x1b')]('[%s][index][cdr]',_0x54a29d['uniqueid']),_0x183d3c);}});ami['on']('blindtransfer',function(_0x16c801){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')]('[%s][index][blindtransfer]',_0x16c801[_0x0fd5('0x21')]),_0x16c801);queues[_0x0fd5('0x38')](_0x16c801);agents[_0x0fd5('0x38')](_0x16c801);transfers[_0x0fd5('0x38')](_0x16c801);recordings['blindtransfer'](_0x16c801);}catch(_0x121491){utils['error'](util[_0x0fd5('0x1b')](_0x0fd5('0x39'),_0x16c801[_0x0fd5('0x21')]),_0x121491);}});ami['on'](_0x0fd5('0x3a'),function(_0x5b2445){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')]('[%s][index][attendedtransfer]',_0x5b2445[_0x0fd5('0x3b')]),_0x5b2445);queues[_0x0fd5('0x3a')](_0x5b2445);transfers[_0x0fd5('0x3a')](_0x5b2445);agents[_0x0fd5('0x3a')](_0x5b2445);calls['attendedtransfer'](_0x5b2445);}catch(_0x21b553){utils['error'](util[_0x0fd5('0x1b')](_0x0fd5('0x3c'),_0x5b2445[_0x0fd5('0x3b')]),_0x21b553);}});ami['on'](_0x0fd5('0x3d'),function(_0x1d5b10){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x3e'),_0x1d5b10[_0x0fd5('0x21')]),_0x1d5b10);queues[_0x0fd5('0x3d')](_0x1d5b10);recordings[_0x0fd5('0x3d')](_0x1d5b10);calls[_0x0fd5('0x3d')](_0x1d5b10);dials[_0x0fd5('0x3d')](_0x1d5b10);}catch(_0x459ef8){utils['error'](util[_0x0fd5('0x1b')](_0x0fd5('0x3e'),_0x1d5b10[_0x0fd5('0x21')]),_0x459ef8);}});ami['on'](_0x0fd5('0x3f'),function(_0x31e9b5){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x40'),_0x31e9b5['uniqueid']),_0x31e9b5);calls[_0x0fd5('0x3f')](_0x31e9b5);recordings[_0x0fd5('0x3f')](_0x31e9b5);dials['newexten'](_0x31e9b5);}catch(_0x3cbc29){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x40'),_0x31e9b5[_0x0fd5('0x21')]),_0x3cbc29);}});ami['on'](_0x0fd5('0x41'),function(_0x4829fe){try{utils[_0x0fd5('0x1f')](util['format'](_0x0fd5('0x42'),_0x4829fe[_0x0fd5('0x21')]),_0x4829fe);calls[_0x0fd5('0x41')](_0x4829fe);recordings['newchannel'](_0x4829fe);}catch(_0x5bf63b){utils[_0x0fd5('0x17')](util['format'](_0x0fd5('0x42'),_0x4829fe['uniqueid']),_0x5bf63b);}});ami['on'](_0x0fd5('0x43'),function(_0x3118e0){try{utils['debug'](util[_0x0fd5('0x1b')]('[%s][index][dialbegin]',_0x3118e0[_0x0fd5('0x21')]),_0x3118e0);dials[_0x0fd5('0x43')](_0x3118e0);}catch(_0x5a930f){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x44'),_0x3118e0[_0x0fd5('0x21')]),_0x5a930f);}});ami['on'](_0x0fd5('0x45'),function(_0x4e8120){try{utils[_0x0fd5('0x1f')](util[_0x0fd5('0x1b')](_0x0fd5('0x46'),_0x4e8120[_0x0fd5('0x21')]),_0x4e8120);dials[_0x0fd5('0x45')](_0x4e8120);}catch(_0xe57850){utils[_0x0fd5('0x17')](util[_0x0fd5('0x1b')](_0x0fd5('0x46'),_0x4e8120[_0x0fd5('0x21')]),_0xe57850);}});} \ No newline at end of file +var _0x8802=['keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','device','devicestatechange','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','xdr','disabled','env','production','local','asterisk','port','username'];(function(_0x407941,_0x4e781d){var _0x141e78=function(_0x308e8a){while(--_0x308e8a){_0x407941['push'](_0x407941['shift']());}};_0x141e78(++_0x4e781d);}(_0x8802,0x7e));var _0x2880=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0x8802[_0x397bfb];return _0x16c9b9;};var AsteriskManager=require(_0x2880('0x0'));var config=require('../../config/environment');var utils=require(_0x2880('0x1'));var util=require('util');var isXDREnabled=config[_0x2880('0x2')]&&!config[_0x2880('0x2')][_0x2880('0x3')];var isProduction=config[_0x2880('0x4')]===_0x2880('0x5')||![];var isLocalAsterisk=config[_0x2880('0x2')]&&config[_0x2880('0x2')][_0x2880('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x2880('0x7')][_0x2880('0x8')],config[_0x2880('0x7')]['ip'],config[_0x2880('0x7')][_0x2880('0x9')],config[_0x2880('0x7')]['password'],!![]);ami[_0x2880('0xa')]();if(!isXDREnabled){utils[_0x2880('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x2880('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x2880('0xd'));var queues=require(_0x2880('0xe'));var recordings=require(_0x2880('0xf'));var members=require(_0x2880('0x10'));var dials=require(_0x2880('0x11'));var transfers=require('./transfers.controller');var core=require(_0x2880('0x12'));ami['on'](_0x2880('0x13'),core[_0x2880('0x13')]);ami['on']('shutdown',core[_0x2880('0x14')]);ami['on']('fullybooted',core[_0x2880('0x15')]);ami['on'](_0x2880('0x16'),core[_0x2880('0x16')]);ami['on'](_0x2880('0x17'),core[_0x2880('0x17')]);ami['on'](_0x2880('0x18'),core[_0x2880('0x18')]);ami['on']('devicestatechange',function(_0x5c26c5){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')]('[%s][index][devicestatechange]',_0x5c26c5[_0x2880('0x1b')]),_0x5c26c5);members[_0x2880('0x1c')](_0x5c26c5);}catch(_0x5e689f){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x1d'),_0x5c26c5[_0x2880('0x1b')]),_0x5e689f);}});ami['on']('agentcalled',function(_0x525dd1){try{utils[_0x2880('0x19')](util['format'](_0x2880('0x1e'),_0x525dd1[_0x2880('0x1f')]),_0x525dd1);agents['agentcalled'](_0x525dd1);}catch(_0x401728){utils['error'](util[_0x2880('0x1a')]('[%s][index][agentcalled]',_0x525dd1[_0x2880('0x1f')]),_0x401728);}});ami['on'](_0x2880('0x20'),function(_0x2c3ab1){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')](_0x2880('0x21'),_0x2c3ab1[_0x2880('0x1f')]),_0x2c3ab1);agents[_0x2880('0x20')](_0x2c3ab1);}catch(_0x23e7c3){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x21'),_0x2c3ab1[_0x2880('0x1f')]),_0x23e7c3);}});ami['on'](_0x2880('0x22'),function(_0x213281){try{utils[_0x2880('0x19')](util['format']('[%s][index][agentconnect]',_0x213281[_0x2880('0x1f')]),_0x213281);agents[_0x2880('0x22')](_0x213281);queues['agentconnect'](_0x213281);}catch(_0x5c1276){utils[_0x2880('0x16')](util[_0x2880('0x1a')]('[%s][index][agentconnect]',_0x213281[_0x2880('0x1f')]),_0x5c1276);}});ami['on']('agentcomplete',function(_0x506ee5){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')](_0x2880('0x23'),_0x506ee5[_0x2880('0x1f')]),_0x506ee5);agents['agentcomplete'](_0x506ee5);queues[_0x2880('0x24')](_0x506ee5);members[_0x2880('0x24')](_0x506ee5);}catch(_0x468c61){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x23'),_0x506ee5['uniqueid']),_0x468c61);}});ami['on'](_0x2880('0x25'),function(_0x32670b){try{utils['debug'](util[_0x2880('0x1a')](_0x2880('0x26'),_0x32670b[_0x2880('0x1f')]),_0x32670b);agents[_0x2880('0x25')](_0x32670b);queues['queuecallerabandon'](_0x32670b);}catch(_0x3c9a3c){utils['error'](util[_0x2880('0x1a')](_0x2880('0x26'),_0x32670b['uniqueid']),_0x3c9a3c);}});ami['on'](_0x2880('0x27'),function(_0x11796f){try{utils[_0x2880('0x19')](util['format'](_0x2880('0x28'),_0x11796f[_0x2880('0x1f')]),_0x11796f);queues[_0x2880('0x27')](_0x11796f);recordings[_0x2880('0x27')](_0x11796f);}catch(_0x49de45){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x28'),_0x11796f[_0x2880('0x1f')]),_0x49de45);}});ami['on'](_0x2880('0x29'),function(_0x260d41){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')](_0x2880('0x2a'),_0x260d41[_0x2880('0x1f')]),_0x260d41);queues['queuecallerleave'](_0x260d41);}catch(_0x25ffde){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x2a'),_0x260d41[_0x2880('0x1f')]),_0x25ffde);}});ami['on']('musiconholdstart',function(_0x3981fd){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')](_0x2880('0x2b'),_0x3981fd[_0x2880('0x1f')]),_0x3981fd);queues[_0x2880('0x2c')](_0x3981fd);calls['musiconholdstart'](_0x3981fd);}catch(_0x13ee7e){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x2b'),_0x3981fd[_0x2880('0x1f')]),_0x13ee7e);}});ami['on'](_0x2880('0x2d'),function(_0x5b3577){try{utils['debug'](util[_0x2880('0x1a')](_0x2880('0x2e'),_0x5b3577[_0x2880('0x1f')]),_0x5b3577);queues[_0x2880('0x2d')](_0x5b3577);calls[_0x2880('0x2d')](_0x5b3577);}catch(_0x27c1dc){utils['error'](util['format'](_0x2880('0x2e'),_0x5b3577[_0x2880('0x1f')]),_0x27c1dc);}});ami['on'](_0x2880('0x2f'),function(_0x39b830){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')](_0x2880('0x30'),_0x39b830[_0x2880('0x1f')]),_0x39b830);calls['newstate'](_0x39b830);recordings['newstate'](_0x39b830);}catch(_0x23f93b){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x30'),_0x39b830[_0x2880('0x1f')]),_0x23f93b);}});ami['on'](_0x2880('0x31'),function(_0x61d918){try{utils['debug'](util['format'](_0x2880('0x32'),_0x61d918['uniqueid']),_0x61d918);calls[_0x2880('0x31')](_0x61d918);recordings['hangup'](_0x61d918);dials['hangup'](_0x61d918);agents[_0x2880('0x31')](_0x61d918);queues[_0x2880('0x31')](_0x61d918);}catch(_0x4f2b0f){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x32'),_0x61d918['uniqueid']),_0x4f2b0f);}});ami['on'](_0x2880('0x33'),function(_0x2dd716){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')]('[%s][index][cdr]',_0x2dd716[_0x2880('0x1f')]),_0x2dd716);members['cdr'](_0x2dd716);}catch(_0x41581e){utils[_0x2880('0x16')](util['format'](_0x2880('0x34'),_0x2dd716[_0x2880('0x1f')]),_0x41581e);}});ami['on'](_0x2880('0x35'),function(_0x1b3470){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')](_0x2880('0x36'),_0x1b3470['uniqueid']),_0x1b3470);queues[_0x2880('0x35')](_0x1b3470);agents[_0x2880('0x35')](_0x1b3470);transfers[_0x2880('0x35')](_0x1b3470);recordings[_0x2880('0x35')](_0x1b3470);}catch(_0x4a6e8c){utils[_0x2880('0x16')](util['format'](_0x2880('0x36'),_0x1b3470[_0x2880('0x1f')]),_0x4a6e8c);}});ami['on'](_0x2880('0x37'),function(_0x53c4bd){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')](_0x2880('0x38'),_0x53c4bd['origtransfereruniqueid']),_0x53c4bd);queues[_0x2880('0x37')](_0x53c4bd);transfers[_0x2880('0x37')](_0x53c4bd);agents['attendedtransfer'](_0x53c4bd);calls[_0x2880('0x37')](_0x53c4bd);}catch(_0x845edf){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x38'),_0x53c4bd[_0x2880('0x39')]),_0x845edf);}});ami['on']('varset',function(_0x583ec8){try{utils['debug'](util[_0x2880('0x1a')](_0x2880('0x3a'),_0x583ec8[_0x2880('0x1f')]),_0x583ec8);queues[_0x2880('0x3b')](_0x583ec8);recordings[_0x2880('0x3b')](_0x583ec8);calls[_0x2880('0x3b')](_0x583ec8);dials[_0x2880('0x3b')](_0x583ec8);}catch(_0x177a37){utils[_0x2880('0x16')](util['format'](_0x2880('0x3a'),_0x583ec8[_0x2880('0x1f')]),_0x177a37);}});ami['on'](_0x2880('0x3c'),function(_0x4da44c){try{utils[_0x2880('0x19')](util[_0x2880('0x1a')]('[%s][index][newexten]',_0x4da44c['uniqueid']),_0x4da44c);calls[_0x2880('0x3c')](_0x4da44c);recordings[_0x2880('0x3c')](_0x4da44c);dials[_0x2880('0x3c')](_0x4da44c);}catch(_0x5f0f48){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x3d'),_0x4da44c['uniqueid']),_0x5f0f48);}});ami['on'](_0x2880('0x3e'),function(_0x55259){try{utils['debug'](util[_0x2880('0x1a')](_0x2880('0x3f'),_0x55259[_0x2880('0x1f')]),_0x55259);calls[_0x2880('0x3e')](_0x55259);recordings[_0x2880('0x3e')](_0x55259);}catch(_0x40f6b7){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x3f'),_0x55259[_0x2880('0x1f')]),_0x40f6b7);}});ami['on'](_0x2880('0x40'),function(_0x577709){try{utils['debug'](util[_0x2880('0x1a')](_0x2880('0x41'),_0x577709['uniqueid']),_0x577709);dials[_0x2880('0x40')](_0x577709);}catch(_0x6c7e9c){utils[_0x2880('0x16')](util[_0x2880('0x1a')]('[%s]dialbegin',_0x577709[_0x2880('0x1f')]),_0x6c7e9c);}});ami['on'](_0x2880('0x42'),function(_0x15f4fd){try{utils[_0x2880('0x19')](util['format']('[%s][index][dialend]',_0x15f4fd[_0x2880('0x1f')]),_0x15f4fd);dials[_0x2880('0x42')](_0x15f4fd);}catch(_0x1cc164){utils[_0x2880('0x16')](util[_0x2880('0x1a')](_0x2880('0x43'),_0x15f4fd[_0x2880('0x1f')]),_0x1cc164);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 362eec7..4b1822c 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 _0x8653=['name','catch','error','format','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','duration','diffTime','exitAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','Local/_attended@transfer','Queue:','info','uniqueid','channel','membername','type','interface','then','internal','request','CreateMemberReport','getUserByName','split'];(function(_0x4075a5,_0x1d3197){var _0x45505a=function(_0x334f61){while(--_0x334f61){_0x4075a5['push'](_0x4075a5['shift']());}};_0x45505a(++_0x1d3197);}(_0x8653,0x17a));var _0x3865=function(_0x584859,_0x4bdf75){_0x584859=_0x584859-0x0;var _0x10a2fa=_0x8653[_0x584859];return _0x10a2fa;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x3865('0x0'),_0x3865('0x1')];function writeDB(_0x593110){utils[_0x3865('0x2')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x593110[_0x3865('0x3')],_0x593110['interface'],_0x593110[_0x3865('0x4')],_0x593110['data2'],_0x593110[_0x3865('0x5')],_0x593110[_0x3865('0x6')]));if(_0x593110['interface']){utils['getUserByInterface'](_0x593110[_0x3865('0x7')])[_0x3865('0x8')](function(_0x5c789e){if(_0x5c789e){_0x593110[_0x3865('0x5')]=_0x5c789e['name'];_0x593110[_0x3865('0x9')]=_0x5c789e[_0x3865('0x9')];utils[_0x3865('0xa')](_0x3865('0xb'),_0x593110);}else{utils[_0x3865('0xc')](_0x593110[_0x3865('0x7')][_0x3865('0xd')]('/')[0x1])[_0x3865('0x8')](function(_0x591c14){if(_0x591c14){_0x593110[_0x3865('0x5')]=_0x591c14[_0x3865('0xe')];_0x593110[_0x3865('0x9')]=_0x591c14[_0x3865('0x9')];utils[_0x3865('0xa')]('CreateMemberReport',_0x593110);}});}})[_0x3865('0xf')](function(_0x44c958){utils[_0x3865('0x10')](util[_0x3865('0x11')]('[%s][members][writeDB]',_0x593110['uniqueid']),_0x44c958);});}delete members[_0x593110[_0x3865('0x7')]];}function startsWith(_0x41ca5d,_0x2e22ae){return _[_0x3865('0x12')](_0x41ca5d,function(_0x551f4e){return _[_0x3865('0x13')](_0x2e22ae,_0x551f4e);});}exports[_0x3865('0x14')]=function(_0x58bf09){try{utils['debug'](util[_0x3865('0x11')](_0x3865('0x15'),members[_0x58bf09[_0x3865('0x16')]]?members[_0x58bf09[_0x3865('0x16')]][_0x3865('0x3')]:_0x58bf09[_0x3865('0x16')]),_0x58bf09);utils[_0x3865('0x2')](util[_0x3865('0x11')](_0x3865('0x17'),members[_0x58bf09['device']]?members[_0x58bf09[_0x3865('0x16')]][_0x3865('0x3')]:_0x58bf09[_0x3865('0x16')],_0x58bf09[_0x3865('0x18')],_0x58bf09['device']));switch(_0x58bf09[_0x3865('0x18')]){case _0x3865('0x19'):case _0x3865('0x1a'):if(!startsWith(exclude,_0x58bf09[_0x3865('0x16')])){members[_0x58bf09[_0x3865('0x16')]]={'channel':_0x3865('0x1b'),'interface':_0x58bf09[_0x3865('0x16')],'type':_0x3865('0x1c'),'enterAt':utils[_0x3865('0x1d')](),'role':'agent'};}break;case _0x3865('0x1e'):if(!_[_0x3865('0x1f')](members[_0x58bf09['device']])){members[_0x58bf09[_0x3865('0x16')]]['exitAt']=utils[_0x3865('0x1d')]();members[_0x58bf09[_0x3865('0x16')]][_0x3865('0x20')]=utils[_0x3865('0x21')](members[_0x58bf09[_0x3865('0x16')]][_0x3865('0x22')],members[_0x58bf09['device']]['enterAt']);if(members[_0x58bf09[_0x3865('0x16')]][_0x3865('0x3')]){writeDB(members[_0x58bf09['device']]);}}break;default:break;}}catch(_0x9ac938){utils[_0x3865('0x10')](util['format'](_0x3865('0x15'),members[_0x58bf09[_0x3865('0x16')]]?members[_0x58bf09[_0x3865('0x16')]]['uniqueid']:_0x58bf09[_0x3865('0x16')]),_0x9ac938);}};exports[_0x3865('0x23')]=function(_0x33bbda){try{if(!_[_0x3865('0x1f')](members[_0x33bbda['interface']])){utils[_0x3865('0x24')](util[_0x3865('0x11')](_0x3865('0x25'),_0x33bbda[_0x3865('0x3')]),_0x33bbda);utils[_0x3865('0x2')](util['format'](_0x3865('0x26'),_0x33bbda[_0x3865('0x3')],_0x33bbda[_0x3865('0x7')],_0x33bbda[_0x3865('0x27')]));members[_0x33bbda[_0x3865('0x7')]]=_[_0x3865('0x28')](members[_0x33bbda['interface']],{'data4':_0x33bbda[_0x3865('0x27')],'uniqueid':_0x33bbda[_0x3865('0x3')]});}}catch(_0x19c5af){utils[_0x3865('0x10')](util[_0x3865('0x11')](_0x3865('0x25'),_0x33bbda[_0x3865('0x3')]),_0x19c5af);}};exports['cdr']=function(_0x264390){try{utils['debug'](util[_0x3865('0x11')](_0x3865('0x29'),_0x264390[_0x3865('0x3')]),_0x264390);if(_0x264390[_0x3865('0x4')]){var _0x2e7b69=_0x264390[_0x3865('0x4')][_0x3865('0xd')]('-')[0x0];if(!_[_0x3865('0x1f')](members[_0x2e7b69])){members[_0x2e7b69]=_[_0x3865('0x28')](members[_0x2e7b69],{'data1':members[_0x2e7b69]['data1']||_0x264390['type'],'data2':members[_0x2e7b69][_0x3865('0x2a')]||_0x264390[_0x3865('0x2b')],'data3':members[_0x2e7b69][_0x3865('0x2c')]||_0x264390[_0x3865('0x2d')],'uniqueid':members[_0x2e7b69][_0x3865('0x3')]||_0x264390[_0x3865('0x3')]});utils[_0x3865('0x2')](util[_0x3865('0x11')](_0x3865('0x2e'),_0x264390[_0x3865('0x3')],members[_0x2e7b69][_0x3865('0x2f')],members[_0x2e7b69][_0x3865('0x2a')],members[_0x2e7b69][_0x3865('0x2c')]));if(members[_0x2e7b69]['exitAt']){writeDB(members[_0x2e7b69]);}}}if(_0x264390[_0x3865('0x30')]){var _0x1c548f=_0x264390['destinationchannel']['split']('-')[0x0];if(!_[_0x3865('0x1f')](members[_0x1c548f])){members[_0x1c548f]=_[_0x3865('0x28')](members[_0x1c548f],{'data1':members[_0x1c548f][_0x3865('0x2f')]||_0x264390[_0x3865('0x6')],'data2':members[_0x1c548f][_0x3865('0x2a')]||_0x264390[_0x3865('0x2b')],'data3':members[_0x1c548f][_0x3865('0x2c')]||_0x264390[_0x3865('0x2d')],'uniqueid':members[_0x1c548f]['uniqueid']||_0x264390[_0x3865('0x3')]});utils['info'](util[_0x3865('0x11')](_0x3865('0x2e'),_0x264390['uniqueid'],members[_0x1c548f]['data1'],members[_0x1c548f][_0x3865('0x2a')],members[_0x1c548f][_0x3865('0x2c')]));if(members[_0x1c548f][_0x3865('0x22')]){writeDB(members[_0x1c548f]);}}}}catch(_0x1730fc){utils[_0x3865('0x10')](util['format']('[%s][members][cdr]',_0x264390['uniqueid']),_0x1730fc);}}; \ No newline at end of file +var _0xa1a2=['[%s][members][devicestatechange]','device','state','INUSE','now','agent','isNil','duration','diffTime','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','split','assign','data1','source','data3','exitAt','destinationchannel','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','internal','request','getUserByName','name','catch','error','[%s][members][writeDB]','startsWith','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1a2,0x76));var _0x2a1a=function(_0x5da0a3,_0x208c05){_0x5da0a3=_0x5da0a3-0x0;var _0x12b6c1=_0xa1a2[_0x5da0a3];return _0x12b6c1;};'use strict';var _=require(_0x2a1a('0x0'));var util=require(_0x2a1a('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0x2a1a('0x2')];function writeDB(_0x2149ed){utils[_0x2a1a('0x3')](util[_0x2a1a('0x4')](_0x2a1a('0x5'),_0x2149ed[_0x2a1a('0x6')],_0x2149ed[_0x2a1a('0x7')],_0x2149ed[_0x2a1a('0x8')],_0x2149ed[_0x2a1a('0x9')],_0x2149ed[_0x2a1a('0xa')],_0x2149ed[_0x2a1a('0xb')]));if(_0x2149ed[_0x2a1a('0x7')]){utils[_0x2a1a('0xc')](_0x2149ed['interface'])[_0x2a1a('0xd')](function(_0x485725){if(_0x485725){_0x2149ed[_0x2a1a('0xa')]=_0x485725['name'];_0x2149ed[_0x2a1a('0xe')]=_0x485725[_0x2a1a('0xe')];utils[_0x2a1a('0xf')]('CreateMemberReport',_0x2149ed);}else{utils[_0x2a1a('0x10')](_0x2149ed[_0x2a1a('0x7')]['split']('/')[0x1])[_0x2a1a('0xd')](function(_0x1fd772){if(_0x1fd772){_0x2149ed['membername']=_0x1fd772[_0x2a1a('0x11')];_0x2149ed[_0x2a1a('0xe')]=_0x1fd772['internal'];utils[_0x2a1a('0xf')]('CreateMemberReport',_0x2149ed);}});}})[_0x2a1a('0x12')](function(_0x50560c){utils[_0x2a1a('0x13')](util[_0x2a1a('0x4')](_0x2a1a('0x14'),_0x2149ed[_0x2a1a('0x6')]),_0x50560c);});}delete members[_0x2149ed[_0x2a1a('0x7')]];}function startsWith(_0x28fd00,_0x27f019){return _['some'](_0x28fd00,function(_0x2d3ade){return _[_0x2a1a('0x15')](_0x27f019,_0x2d3ade);});}exports['devicestatechange']=function(_0x33c00e){try{utils[_0x2a1a('0x16')](util[_0x2a1a('0x4')](_0x2a1a('0x17'),members[_0x33c00e[_0x2a1a('0x18')]]?members[_0x33c00e[_0x2a1a('0x18')]][_0x2a1a('0x6')]:_0x33c00e[_0x2a1a('0x18')]),_0x33c00e);utils[_0x2a1a('0x3')](util[_0x2a1a('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x33c00e[_0x2a1a('0x18')]]?members[_0x33c00e[_0x2a1a('0x18')]][_0x2a1a('0x6')]:_0x33c00e[_0x2a1a('0x18')],_0x33c00e[_0x2a1a('0x19')],_0x33c00e['device']));switch(_0x33c00e[_0x2a1a('0x19')]){case _0x2a1a('0x1a'):case'BUSY':if(!startsWith(exclude,_0x33c00e[_0x2a1a('0x18')])){members[_0x33c00e[_0x2a1a('0x18')]]={'channel':'voice','interface':_0x33c00e[_0x2a1a('0x18')],'type':'TALKING','enterAt':utils[_0x2a1a('0x1b')](),'role':_0x2a1a('0x1c')};}break;case'NOT_INUSE':if(!_[_0x2a1a('0x1d')](members[_0x33c00e[_0x2a1a('0x18')]])){members[_0x33c00e[_0x2a1a('0x18')]]['exitAt']=utils[_0x2a1a('0x1b')]();members[_0x33c00e['device']][_0x2a1a('0x1e')]=utils[_0x2a1a('0x1f')](members[_0x33c00e[_0x2a1a('0x18')]]['exitAt'],members[_0x33c00e['device']]['enterAt']);if(members[_0x33c00e[_0x2a1a('0x18')]]['uniqueid']){writeDB(members[_0x33c00e[_0x2a1a('0x18')]]);}}break;default:break;}}catch(_0x18c908){utils[_0x2a1a('0x13')](util[_0x2a1a('0x4')]('[%s][members][devicestatechange]',members[_0x33c00e[_0x2a1a('0x18')]]?members[_0x33c00e[_0x2a1a('0x18')]]['uniqueid']:_0x33c00e['device']),_0x18c908);}};exports[_0x2a1a('0x20')]=function(_0x290292){try{if(!_['isNil'](members[_0x290292['interface']])){utils[_0x2a1a('0x16')](util[_0x2a1a('0x4')](_0x2a1a('0x21'),_0x290292[_0x2a1a('0x6')]),_0x290292);utils[_0x2a1a('0x3')](util['format'](_0x2a1a('0x22'),_0x290292['uniqueid'],_0x290292[_0x2a1a('0x7')],_0x290292[_0x2a1a('0x23')]));members[_0x290292['interface']]=_['assign'](members[_0x290292[_0x2a1a('0x7')]],{'data4':_0x290292['queue'],'uniqueid':_0x290292[_0x2a1a('0x6')]});}}catch(_0x49f7d5){utils['error'](util[_0x2a1a('0x4')](_0x2a1a('0x21'),_0x290292[_0x2a1a('0x6')]),_0x49f7d5);}};exports[_0x2a1a('0x24')]=function(_0x1cdffa){try{utils[_0x2a1a('0x16')](util['format'](_0x2a1a('0x25'),_0x1cdffa[_0x2a1a('0x6')]),_0x1cdffa);if(_0x1cdffa[_0x2a1a('0x8')]){var _0x24a0d6=_0x1cdffa['channel'][_0x2a1a('0x26')]('-')[0x0];if(!_['isNil'](members[_0x24a0d6])){members[_0x24a0d6]=_[_0x2a1a('0x27')](members[_0x24a0d6],{'data1':members[_0x24a0d6][_0x2a1a('0x28')]||_0x1cdffa['type'],'data2':members[_0x24a0d6][_0x2a1a('0x9')]||_0x1cdffa[_0x2a1a('0x29')],'data3':members[_0x24a0d6][_0x2a1a('0x2a')]||_0x1cdffa['destination'],'uniqueid':members[_0x24a0d6][_0x2a1a('0x6')]||_0x1cdffa[_0x2a1a('0x6')]});utils[_0x2a1a('0x3')](util[_0x2a1a('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1cdffa['uniqueid'],members[_0x24a0d6]['data1'],members[_0x24a0d6][_0x2a1a('0x9')],members[_0x24a0d6][_0x2a1a('0x2a')]));if(members[_0x24a0d6][_0x2a1a('0x2b')]){writeDB(members[_0x24a0d6]);}}}if(_0x1cdffa[_0x2a1a('0x2c')]){var _0x1df829=_0x1cdffa[_0x2a1a('0x2c')]['split']('-')[0x0];if(!_['isNil'](members[_0x1df829])){members[_0x1df829]=_[_0x2a1a('0x27')](members[_0x1df829],{'data1':members[_0x1df829][_0x2a1a('0x28')]||_0x1cdffa[_0x2a1a('0xb')],'data2':members[_0x1df829][_0x2a1a('0x9')]||_0x1cdffa[_0x2a1a('0x29')],'data3':members[_0x1df829][_0x2a1a('0x2a')]||_0x1cdffa[_0x2a1a('0x2d')],'uniqueid':members[_0x1df829]['uniqueid']||_0x1cdffa[_0x2a1a('0x6')]});utils[_0x2a1a('0x3')](util[_0x2a1a('0x4')](_0x2a1a('0x2e'),_0x1cdffa['uniqueid'],members[_0x1df829][_0x2a1a('0x28')],members[_0x1df829]['data2'],members[_0x1df829]['data3']));if(members[_0x1df829][_0x2a1a('0x2b')]){writeDB(members[_0x1df829]);}}}}catch(_0x3af3ba){utils[_0x2a1a('0x13')](util[_0x2a1a('0x4')]('[%s][members][cdr]',_0x1cdffa[_0x2a1a('0x6')]),_0x3af3ba);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index c34adb9..48b6ec6 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 _0x2129=['value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertype','transfertargetlinkedid','transfertargetuniqueid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','queue','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','CONTINUE','queuecallerexitAt'];(function(_0xaba415,_0x513052){var _0x2a0c42=function(_0x5190c6){while(--_0x5190c6){_0xaba415['push'](_0xaba415['shift']());}};_0x2a0c42(++_0x513052);}(_0x2129,0x123));var _0x9212=function(_0x50d343,_0x16a472){_0x50d343=_0x50d343-0x0;var _0x537f3a=_0x2129[_0x50d343];return _0x537f3a;};'use strict';var _=require(_0x9212('0x0'));var util=require(_0x9212('0x1'));var utils=require(_0x9212('0x2'));var queues={};function writeDB(_0x5e5dce){utils['info'](util[_0x9212('0x3')](_0x9212('0x4'),_0x5e5dce[_0x9212('0x5')],_0x5e5dce['channel'],_0x5e5dce['queue'],_0x5e5dce[_0x9212('0x6')],_0x5e5dce[_0x9212('0x7')],_0x5e5dce[_0x9212('0x8')],_0x5e5dce['queuecallerexitreason']));if(_0x5e5dce['queue']){utils[_0x9212('0x9')](_0x5e5dce[_0x9212('0xa')])[_0x9212('0xb')](function(_0x5a4452){if(_0x5a4452){_0x5e5dce[_0x9212('0xc')]=_0x5a4452[_0x9212('0xc')];}utils['request'](_0x9212('0xd'),_0x5e5dce);});}else{utils[_0x9212('0xe')](_0x9212('0xd'),_0x5e5dce);}if(_0x5e5dce[_0x9212('0xf')]){delete queues[_0x5e5dce[_0x9212('0xf')]];}else{delete queues[_0x5e5dce[_0x9212('0x5')]];}}exports[_0x9212('0x10')]=function(_0x527ac9){try{utils['debug'](util[_0x9212('0x3')](_0x9212('0x11'),_0x527ac9['uniqueid']),_0x527ac9);utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x13'),_0x527ac9[_0x9212('0x5')],_0x527ac9[_0x9212('0xa')],_0x527ac9[_0x9212('0x14')]));queues[_0x527ac9[_0x9212('0x5')]]=_['assign'](_0x527ac9,{'originalposition':_0x527ac9[_0x9212('0x14')],'queuecallerjoinAt':utils[_0x9212('0x15')](),'mohtime':0x0});}catch(_0x596b7c){utils[_0x9212('0x16')](util['format'](_0x9212('0x11'),_0x527ac9[_0x9212('0x5')]),_0x596b7c);}};exports[_0x9212('0x17')]=function(_0x185cd6){try{if(!_[_0x9212('0x18')](queues[_0x185cd6[_0x9212('0x5')]])){utils[_0x9212('0x19')](util['format'](_0x9212('0x1a'),_0x185cd6[_0x9212('0x5')]),_0x185cd6);if(queues[_0x185cd6[_0x9212('0x5')]]['queuecallerleaveAt']){if(!queues[_0x185cd6[_0x9212('0x5')]][_0x9212('0x1b')]&&!queues[_0x185cd6['uniqueid']][_0x9212('0x1c')]){queues[_0x185cd6[_0x9212('0x5')]]['queuecallercomplete']=!![];queues[_0x185cd6[_0x9212('0x5')]][_0x9212('0x1d')]=utils[_0x9212('0x15')]();queues[_0x185cd6[_0x9212('0x5')]][_0x9212('0x1e')]=_0x9212('0x1f');}utils['info'](util[_0x9212('0x3')](_0x9212('0x20'),_0x185cd6[_0x9212('0x5')],queues[_0x185cd6['uniqueid']]['name'],queues[_0x185cd6[_0x9212('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x185cd6['uniqueid']]);}else if(queues[_0x185cd6[_0x9212('0x5')]]['transfereduniqueid']){utils[_0x9212('0x12')](util['format'](_0x9212('0x21'),_0x185cd6[_0x9212('0x5')],queues[_0x185cd6[_0x9212('0x5')]][_0x9212('0x22')],queues[_0x185cd6[_0x9212('0x5')]][_0x9212('0xf')]));queues[queues[_0x185cd6[_0x9212('0x5')]][_0x9212('0xf')]]=queues[_0x185cd6[_0x9212('0x5')]];queues[queues[_0x185cd6[_0x9212('0x5')]][_0x9212('0xf')]][_0x9212('0x23')]=0x2;delete queues[_0x185cd6[_0x9212('0x5')]];}}}catch(_0x3e8e7f){utils[_0x9212('0x16')](util['format'](_0x9212('0x1a'),_0x185cd6[_0x9212('0x5')]),_0x3e8e7f);}};exports[_0x9212('0x24')]=function(_0x242372){try{utils[_0x9212('0x19')](util['format'](_0x9212('0x25'),_0x242372[_0x9212('0x5')]),_0x242372);if(!_[_0x9212('0x18')](_0x242372[_0x9212('0x26')][_0x9212('0x27')])&&_0x242372['value']['toUpperCase']()!==_0x9212('0x28')){if(!_[_0x9212('0x18')](queues[_0x242372[_0x9212('0x5')]])){queues[_0x242372[_0x9212('0x5')]]['queuecallerabandon']=![];queues[_0x242372[_0x9212('0x5')]]['queuecallerabandonAt']=null;queues[_0x242372[_0x9212('0x5')]][_0x9212('0x1c')]=!![];queues[_0x242372[_0x9212('0x5')]][_0x9212('0x29')]=utils[_0x9212('0x15')]();queues[_0x242372['uniqueid']][_0x9212('0x1e')]=_0x242372[_0x9212('0x2a')][_0x9212('0x2b')]();utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x2c'),_0x242372[_0x9212('0x5')],queues[_0x242372[_0x9212('0x5')]][_0x9212('0x22')],_0x242372['value'],queues[_0x242372[_0x9212('0x5')]][_0x9212('0x1e')]));writeDB(queues[_0x242372[_0x9212('0x5')]]);}}else if(!_[_0x9212('0x18')](_0x242372[_0x9212('0x26')][_0x9212('0x2d')])){if(!_[_0x9212('0x18')](queues[_0x242372[_0x9212('0x5')]])&&!queues[_0x242372[_0x9212('0x5')]][_0x9212('0x1b')]){queues[_0x242372[_0x9212('0x5')]][_0x9212('0x1b')]=![];queues[_0x242372['uniqueid']][_0x9212('0x2e')]=null;queues[_0x242372[_0x9212('0x5')]][_0x9212('0x1c')]=!![];queues[_0x242372[_0x9212('0x5')]][_0x9212('0x29')]=utils[_0x9212('0x15')]();queues[_0x242372[_0x9212('0x5')]][_0x9212('0x1e')]=_0x9212('0x2f');utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x30'),_0x242372[_0x9212('0x5')],queues[_0x242372[_0x9212('0x5')]][_0x9212('0x22')],_0x242372['value'],queues[_0x242372[_0x9212('0x5')]]['queuecallerexitreason']));}}}catch(_0x218a8b){utils[_0x9212('0x16')](util[_0x9212('0x3')](_0x9212('0x25'),_0x242372[_0x9212('0x5')]),_0x218a8b);}};exports[_0x9212('0x1b')]=function(_0x493a7e){try{if(!_[_0x9212('0x18')](queues[_0x493a7e['uniqueid']])){utils[_0x9212('0x19')](util[_0x9212('0x3')](_0x9212('0x31'),_0x493a7e[_0x9212('0x5')]),_0x493a7e);queues[_0x493a7e[_0x9212('0x5')]][_0x9212('0x1c')]=![];queues[_0x493a7e[_0x9212('0x5')]][_0x9212('0x29')]=null;queues[_0x493a7e[_0x9212('0x5')]][_0x9212('0x1b')]=!![];queues[_0x493a7e[_0x9212('0x5')]][_0x9212('0x2e')]=utils['now']();queues[_0x493a7e['uniqueid']][_0x9212('0x1e')]=_0x9212('0x32');utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x33'),_0x493a7e[_0x9212('0x5')],queues[_0x493a7e[_0x9212('0x5')]]['name'],queues[_0x493a7e[_0x9212('0x5')]][_0x9212('0x1e')]));}}catch(_0x55a268){utils[_0x9212('0x16')](util[_0x9212('0x3')](_0x9212('0x31'),_0x493a7e[_0x9212('0x5')]),_0x55a268);}};exports[_0x9212('0x34')]=function(_0x209f8d){try{if(!_[_0x9212('0x18')](queues[_0x209f8d['uniqueid']])){utils['debug'](util['format'](_0x9212('0x35'),_0x209f8d['uniqueid']),_0x209f8d);utils['info'](util[_0x9212('0x3')](_0x9212('0x36'),_0x209f8d[_0x9212('0x5')],queues[_0x209f8d['uniqueid']][_0x9212('0x22')],_0x209f8d[_0x9212('0x37')],_0x209f8d['connectedlinename']));queues[_0x209f8d[_0x9212('0x5')]][_0x9212('0x34')]=!![];queues[_0x209f8d[_0x9212('0x5')]][_0x9212('0x38')]=utils['now']();queues[_0x209f8d[_0x9212('0x5')]][_0x9212('0x39')]=utils[_0x9212('0x3a')](queues[_0x209f8d[_0x9212('0x5')]]['queuecallerleaveAt'],queues[_0x209f8d['uniqueid']][_0x9212('0x3b')]);queues[_0x209f8d[_0x9212('0x5')]][_0x9212('0x14')]=_0x209f8d[_0x9212('0x14')];queues[_0x209f8d[_0x9212('0x5')]][_0x9212('0x3c')]=_0x209f8d[_0x9212('0x3c')];queues[_0x209f8d[_0x9212('0x5')]][_0x9212('0x37')]=_0x209f8d[_0x9212('0x37')];queues[_0x209f8d[_0x9212('0x5')]][_0x9212('0x3d')]=_0x209f8d[_0x9212('0x3d')];}}catch(_0x52d97c){utils[_0x9212('0x16')](util[_0x9212('0x3')]('[%s][queues][queuecallerleave]',_0x209f8d[_0x9212('0x5')]),_0x52d97c);}};exports['agentconnect']=function(_0x394d69){try{if(!_[_0x9212('0x18')](queues[_0x394d69[_0x9212('0x5')]])){utils['debug'](util[_0x9212('0x3')]('[%s][queues][agentconnect]',_0x394d69[_0x9212('0x5')]),_0x394d69);utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x3e'),_0x394d69[_0x9212('0x5')],queues[_0x394d69[_0x9212('0x5')]][_0x9212('0x22')],_0x394d69[_0x9212('0x3f')],_0x394d69[_0x9212('0x40')]));queues[_0x394d69[_0x9212('0x5')]][_0x9212('0x1b')]=![];queues[_0x394d69['uniqueid']]['queuecallerabandon']=![];queues[_0x394d69[_0x9212('0x5')]][_0x9212('0x2e')]=null;queues[_0x394d69[_0x9212('0x5')]][_0x9212('0x1c')]=![];queues[_0x394d69[_0x9212('0x5')]]['queuecallerexitreason']=null;queues[_0x394d69[_0x9212('0x5')]][_0x9212('0x29')]=null;queues[_0x394d69[_0x9212('0x5')]][_0x9212('0x41')]=!![];queues[_0x394d69[_0x9212('0x5')]][_0x9212('0x8')]=_0x394d69[_0x9212('0x40')];queues[_0x394d69[_0x9212('0x5')]]['lastAssignedTo']=_0x394d69['membername'];}}catch(_0x7f4912){utils[_0x9212('0x16')](util[_0x9212('0x3')](_0x9212('0x42'),_0x394d69[_0x9212('0x5')]),_0x7f4912);}};exports[_0x9212('0x43')]=function(_0x833106){try{if(!_['isNil'](queues[_0x833106[_0x9212('0x5')]])){if(queues[_0x833106[_0x9212('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0x9212('0x3')](_0x9212('0x44'),_0x833106['uniqueid']),_0x833106);queues[_0x833106[_0x9212('0x5')]]['queuecallerabandon']=![];queues[_0x833106[_0x9212('0x5')]][_0x9212('0x1b')]=![];queues[_0x833106[_0x9212('0x5')]]['queuecallerabandonAt']=null;queues[_0x833106[_0x9212('0x5')]][_0x9212('0x1c')]=![];queues[_0x833106[_0x9212('0x5')]][_0x9212('0x29')]=null;queues[_0x833106[_0x9212('0x5')]][_0x9212('0x41')]=!![];queues[_0x833106[_0x9212('0x5')]]['lastAssignedTo']=_0x833106[_0x9212('0x3f')];queues[_0x833106[_0x9212('0x5')]][_0x9212('0x45')]=!![];queues[_0x833106[_0x9212('0x5')]]['queuecallercompleteAt']=utils[_0x9212('0x15')]();if(_0x833106[_0x9212('0x46')]=='transfer'){if(!queues[_0x833106[_0x9212('0x5')]][_0x9212('0x47')]){queues[_0x833106['uniqueid']]['queuecallerexitreason']=_0x9212('0x48');}}else{queues[_0x833106[_0x9212('0x5')]]['queuecallerexitreason']=_0x9212('0x49')+_0x833106[_0x9212('0x46')][_0x9212('0x2b')]();}utils['info'](util[_0x9212('0x3')](_0x9212('0x4a'),_0x833106['uniqueid'],queues[_0x833106[_0x9212('0x5')]][_0x9212('0x22')],_0x833106[_0x9212('0x3f')],queues[_0x833106[_0x9212('0x5')]][_0x9212('0x1e')]));writeDB(queues[_0x833106[_0x9212('0x5')]]);}}}catch(_0x2ace7a){utils[_0x9212('0x16')](util['format'](_0x9212('0x44'),_0x833106['uniqueid']),_0x2ace7a);}};exports['blindtransfer']=function(_0x358926){try{if(!_['isNil'](queues[_0x358926[_0x9212('0x4b')]])){utils['debug'](util['format']('[%s][queues][blindtransfer]',_0x358926[_0x9212('0x5')]),_0x358926);queues[_0x358926['transfereeuniqueid']][_0x9212('0x47')]=!![];queues[_0x358926[_0x9212('0x4b')]]['transfertype']=_0x9212('0x4c');queues[_0x358926[_0x9212('0x4b')]][_0x9212('0x4d')]=_0x358926[_0x9212('0x4e')];queues[_0x358926[_0x9212('0x4b')]][_0x9212('0x4f')]=_0x358926[_0x9212('0x4b')];queues[_0x358926[_0x9212('0x4b')]][_0x9212('0x1e')]=_0x9212('0x50');utils[_0x9212('0x12')](util[_0x9212('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x358926['uniqueid'],queues[_0x358926[_0x9212('0x4b')]][_0x9212('0x22')],_0x358926[_0x9212('0x4b')],_0x358926[_0x9212('0x4e')]));}}catch(_0x39e6ea){utils['error'](util['format'](_0x9212('0x51'),_0x358926['uniqueid']),_0x39e6ea);}};exports[_0x9212('0x52')]=function(_0x123655){try{utils['debug'](util[_0x9212('0x3')]('[%s][queues][attendedtransfer]',_0x123655['origtransfereruniqueid']),_0x123655);if(_0x123655['origtransfereruniqueid']==_0x123655[_0x9212('0x53')]){if(!_[_0x9212('0x18')](queues[_0x123655[_0x9212('0x54')]])){utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x55'),_0x123655[_0x9212('0x56')],queues[_0x123655[_0x9212('0x54')]][_0x9212('0x22')],_0x123655[_0x9212('0x57')]));queues[_0x123655[_0x9212('0x54')]][_0x9212('0x47')]=!![];queues[_0x123655['secondtransfererlinkedid']]['transfertype']=_0x9212('0x58');queues[_0x123655[_0x9212('0x54')]]['transferexten']=_0x123655[_0x9212('0x57')];queues[_0x123655[_0x9212('0x54')]][_0x9212('0x4f')]=_0x123655[_0x9212('0x56')];queues[_0x123655[_0x9212('0x54')]]['queuecallerexitreason']=_0x9212('0x59');}if(!_[_0x9212('0x18')](queues[_0x123655[_0x9212('0x53')]])){if(_0x123655[_0x9212('0x5a')]&&queues[_0x123655[_0x9212('0x5a')]]){queues[_0x123655['transfereelinkedid']][_0x9212('0x23')]=0x1;queues[_0x123655['transfereeuniqueid']]=_['clone'](queues[_0x123655[_0x9212('0x5a')]]);queues[_0x123655[_0x9212('0x4b')]]['transfereduniqueid']=_0x123655['transfertargetuniqueid'];queues[_0x123655[_0x9212('0x4b')]]['queuecallerenterreason']=0x2;queues[_0x123655[_0x9212('0x4b')]][_0x9212('0x7')]=queues[_0x123655[_0x9212('0x54')]]['calleridnum'];queues[_0x123655[_0x9212('0x4b')]][_0x9212('0x5b')]=queues[_0x123655[_0x9212('0x54')]]['calleridname'];queues[_0x123655[_0x9212('0x4b')]][_0x9212('0x3b')]=utils['now']();queues[_0x123655[_0x9212('0x4b')]][_0x9212('0x38')]=utils[_0x9212('0x15')]();queues[_0x123655[_0x9212('0x4b')]]['holdtime']=0x0;queues[_0x123655['transfereeuniqueid']][_0x9212('0x5c')]=0x0;utils['info'](util[_0x9212('0x3')](_0x9212('0x5d'),_0x123655[_0x9212('0x56')],queues[_0x123655[_0x9212('0x4b')]]['name'],queues[_0x123655[_0x9212('0x4b')]][_0x9212('0x7')],queues[_0x123655['transfereeuniqueid']][_0x9212('0x5b')]));}else{utils['info'](util[_0x9212('0x3')](_0x9212('0x5e'),_0x123655[_0x9212('0x56')],queues[_0x123655['origtransfererlinkedid']]['name'],_0x123655['secondtransfererlinkedid']));queues[_0x123655[_0x9212('0x53')]][_0x9212('0xf')]=_0x123655['secondtransfererlinkedid'];}}}else if(_0x123655[_0x9212('0x5f')]==_0x123655[_0x9212('0x54')]){if(!_[_0x9212('0x18')](queues[_0x123655[_0x9212('0x53')]])){utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x60'),_0x123655[_0x9212('0x56')],queues[_0x123655[_0x9212('0x53')]][_0x9212('0x22')],_0x123655[_0x9212('0x5f')],_0x123655[_0x9212('0x61')]));queues[_0x123655[_0x9212('0x53')]][_0x9212('0x47')]=!![];queues[_0x123655['origtransfererlinkedid']][_0x9212('0x62')]=_0x9212('0x58');queues[_0x123655[_0x9212('0x53')]]['transferexten']=_0x123655[_0x9212('0x61')];queues[_0x123655[_0x9212('0x53')]]['transferuniqueid']=_0x123655[_0x9212('0x5f')];queues[_0x123655['origtransfererlinkedid']][_0x9212('0x1e')]=_0x9212('0x59');}if(!_[_0x9212('0x18')](queues[_0x123655[_0x9212('0x54')]])){if(_0x123655[_0x9212('0x63')]&&queues[_0x123655[_0x9212('0x63')]]){queues[_0x123655[_0x9212('0x63')]]['queuecallerenterreason']=0x1;queues[_0x123655[_0x9212('0x64')]]=_[_0x9212('0x65')](queues[_0x123655[_0x9212('0x63')]]);queues[_0x123655['transfertargetuniqueid']][_0x9212('0xf')]=_0x123655[_0x9212('0x64')];queues[_0x123655[_0x9212('0x64')]]['queuecallerenterreason']=0x2;queues[_0x123655['transfertargetuniqueid']]['calleridnum']=queues[_0x123655[_0x9212('0x53')]][_0x9212('0x7')];queues[_0x123655['transfertargetuniqueid']][_0x9212('0x5b')]=queues[_0x123655['origtransfererlinkedid']]['calleridname'];queues[_0x123655[_0x9212('0x64')]]['queuecallerjoinAt']=utils[_0x9212('0x15')]();queues[_0x123655[_0x9212('0x64')]][_0x9212('0x38')]=utils[_0x9212('0x15')]();queues[_0x123655['transfertargetuniqueid']][_0x9212('0x39')]=0x0;queues[_0x123655[_0x9212('0x64')]][_0x9212('0x5c')]=0x0;utils['info'](util['format'](_0x9212('0x66'),_0x123655[_0x9212('0x56')],queues[_0x123655[_0x9212('0x64')]][_0x9212('0x22')],queues[_0x123655['transfertargetuniqueid']][_0x9212('0xf')],queues[_0x123655[_0x9212('0x64')]][_0x9212('0x7')],queues[_0x123655[_0x9212('0x64')]][_0x9212('0x5b')]));}else{utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x5e'),_0x123655[_0x9212('0x56')],queues[_0x123655[_0x9212('0x54')]][_0x9212('0x22')],_0x123655[_0x9212('0x53')]));queues[_0x123655[_0x9212('0x54')]]['transfereduniqueid']=_0x123655[_0x9212('0x53')];}}}}catch(_0x2f34d5){utils[_0x9212('0x16')](util[_0x9212('0x3')](_0x9212('0x67'),_0x123655['origtransfereruniqueid']),_0x2f34d5);}};exports[_0x9212('0x68')]=function(_0x574eb8){try{if(!_['isNil'](queues[_0x574eb8[_0x9212('0x5')]])){utils[_0x9212('0x19')](util[_0x9212('0x3')](_0x9212('0x69'),_0x574eb8[_0x9212('0x5')]),_0x574eb8);queues[_0x574eb8[_0x9212('0x5')]][_0x9212('0x6a')]=utils[_0x9212('0x15')]();utils[_0x9212('0x12')](util[_0x9212('0x3')](_0x9212('0x6b'),_0x574eb8[_0x9212('0x5')],queues[_0x574eb8[_0x9212('0x5')]][_0x9212('0x22')],queues[_0x574eb8[_0x9212('0x5')]]['musiconholdstartAt']));}}catch(_0x4f2335){utils[_0x9212('0x16')](util['format'](_0x9212('0x69'),_0x574eb8['uniqueid']),_0x4f2335);}};exports[_0x9212('0x6c')]=function(_0x26c576){try{if(!_['isNil'](queues[_0x26c576[_0x9212('0x5')]])){if(!_[_0x9212('0x18')](queues[_0x26c576[_0x9212('0x5')]][_0x9212('0x6a')])){utils['debug'](util[_0x9212('0x3')]('[%s][queues][musiconholdstop]',_0x26c576[_0x9212('0x5')]),_0x26c576);queues[_0x26c576[_0x9212('0x5')]][_0x9212('0x5c')]+=utils[_0x9212('0x3a')](utils[_0x9212('0x15')](),queues[_0x26c576['uniqueid']][_0x9212('0x6a')]);utils['info'](util[_0x9212('0x3')](_0x9212('0x6d'),_0x26c576[_0x9212('0x5')],queues[_0x26c576[_0x9212('0x5')]][_0x9212('0x22')],queues[_0x26c576[_0x9212('0x5')]][_0x9212('0x5c')]));delete queues[_0x26c576['uniqueid']][_0x9212('0x6a')];}}}catch(_0x346028){utils[_0x9212('0x16')](util['format'](_0x9212('0x6e'),_0x26c576['uniqueid']),_0x346028);}}; \ No newline at end of file +var _0x0d3e=['transferexten','extension','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','toUpperCase','queuecallerabandon','queuecallerabandonAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','holdtime','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND'];(function(_0x1b4b25,_0x314c18){var _0x47a055=function(_0x5d7465){while(--_0x5d7465){_0x1b4b25['push'](_0x1b4b25['shift']());}};_0x47a055(++_0x314c18);}(_0x0d3e,0xe9));var _0xe0d3=function(_0x2e1389,_0x1f4433){_0x2e1389=_0x2e1389-0x0;var _0x53acb3=_0x0d3e[_0x2e1389];return _0x53acb3;};'use strict';var _=require('lodash');var util=require(_0xe0d3('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x33e9fa){utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')](_0xe0d3('0x3'),_0x33e9fa[_0xe0d3('0x4')],_0x33e9fa[_0xe0d3('0x5')],_0x33e9fa[_0xe0d3('0x6')],_0x33e9fa['lastAssignedTo'],_0x33e9fa[_0xe0d3('0x7')],_0x33e9fa['accountcode'],_0x33e9fa[_0xe0d3('0x8')]));if(_0x33e9fa[_0xe0d3('0x6')]){utils[_0xe0d3('0x9')](_0x33e9fa[_0xe0d3('0x6')])[_0xe0d3('0xa')](function(_0x464b7d){if(_0x464b7d){_0x33e9fa[_0xe0d3('0xb')]=_0x464b7d['type'];}utils[_0xe0d3('0xc')](_0xe0d3('0xd'),_0x33e9fa);});}else{utils['request']('CreateVoiceQueueReport',_0x33e9fa);}if(_0x33e9fa['transfereduniqueid']){delete queues[_0x33e9fa[_0xe0d3('0xe')]];}else{delete queues[_0x33e9fa[_0xe0d3('0x4')]];}}exports[_0xe0d3('0xf')]=function(_0x4b9d25){try{utils[_0xe0d3('0x10')](util['format']('[%s][queues][queuecallerjoin]',_0x4b9d25[_0xe0d3('0x4')]),_0x4b9d25);utils[_0xe0d3('0x1')](util['format'](_0xe0d3('0x11'),_0x4b9d25[_0xe0d3('0x4')],_0x4b9d25[_0xe0d3('0x6')],_0x4b9d25[_0xe0d3('0x12')]));queues[_0x4b9d25['uniqueid']]=_[_0xe0d3('0x13')](_0x4b9d25,{'originalposition':_0x4b9d25[_0xe0d3('0x12')],'queuecallerjoinAt':utils[_0xe0d3('0x14')](),'mohtime':0x0});}catch(_0x4c894d){utils[_0xe0d3('0x15')](util[_0xe0d3('0x2')](_0xe0d3('0x16'),_0x4b9d25['uniqueid']),_0x4c894d);}};exports['hangup']=function(_0x4b026f){try{if(!_[_0xe0d3('0x17')](queues[_0x4b026f[_0xe0d3('0x4')]])){utils[_0xe0d3('0x10')](util['format'](_0xe0d3('0x18'),_0x4b026f[_0xe0d3('0x4')]),_0x4b026f);if(queues[_0x4b026f['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x4b026f['uniqueid']]['queuecallerabandon']&&!queues[_0x4b026f['uniqueid']][_0xe0d3('0x19')]){queues[_0x4b026f[_0xe0d3('0x4')]][_0xe0d3('0x1a')]=!![];queues[_0x4b026f[_0xe0d3('0x4')]]['queuecallercompleteAt']=utils[_0xe0d3('0x14')]();queues[_0x4b026f[_0xe0d3('0x4')]][_0xe0d3('0x8')]=_0xe0d3('0x1b');}utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')](_0xe0d3('0x1c'),_0x4b026f[_0xe0d3('0x4')],queues[_0x4b026f[_0xe0d3('0x4')]]['name'],queues[_0x4b026f[_0xe0d3('0x4')]][_0xe0d3('0x8')]));writeDB(queues[_0x4b026f[_0xe0d3('0x4')]]);}else if(queues[_0x4b026f[_0xe0d3('0x4')]][_0xe0d3('0xe')]){utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')](_0xe0d3('0x1d'),_0x4b026f[_0xe0d3('0x4')],queues[_0x4b026f[_0xe0d3('0x4')]][_0xe0d3('0x1e')],queues[_0x4b026f['uniqueid']]['transfereduniqueid']));queues[queues[_0x4b026f[_0xe0d3('0x4')]][_0xe0d3('0xe')]]=queues[_0x4b026f[_0xe0d3('0x4')]];queues[queues[_0x4b026f['uniqueid']][_0xe0d3('0xe')]][_0xe0d3('0x1f')]=0x2;delete queues[_0x4b026f[_0xe0d3('0x4')]];}}}catch(_0x4df7c0){utils[_0xe0d3('0x15')](util[_0xe0d3('0x2')](_0xe0d3('0x18'),_0x4b026f[_0xe0d3('0x4')]),_0x4df7c0);}};exports[_0xe0d3('0x20')]=function(_0x3ecf8c){try{utils[_0xe0d3('0x10')](util['format'](_0xe0d3('0x21'),_0x3ecf8c['uniqueid']),_0x3ecf8c);if(!_[_0xe0d3('0x17')](_0x3ecf8c[_0xe0d3('0x22')]['queuestatus'])&&_0x3ecf8c['value'][_0xe0d3('0x23')]()!=='CONTINUE'){if(!_[_0xe0d3('0x17')](queues[_0x3ecf8c[_0xe0d3('0x4')]])){queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x24')]=![];queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x25')]=null;queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x19')]=!![];queues[_0x3ecf8c[_0xe0d3('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x3ecf8c['uniqueid']][_0xe0d3('0x8')]=_0x3ecf8c[_0xe0d3('0x26')][_0xe0d3('0x23')]();utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')](_0xe0d3('0x27'),_0x3ecf8c[_0xe0d3('0x4')],queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x1e')],_0x3ecf8c[_0xe0d3('0x26')],queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x8')]));writeDB(queues[_0x3ecf8c[_0xe0d3('0x4')]]);}}else if(!_[_0xe0d3('0x17')](_0x3ecf8c[_0xe0d3('0x22')]['queueposition'])){if(!_[_0xe0d3('0x17')](queues[_0x3ecf8c['uniqueid']])&&!queues[_0x3ecf8c['uniqueid']][_0xe0d3('0x24')]){queues[_0x3ecf8c['uniqueid']][_0xe0d3('0x24')]=![];queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x25')]=null;queues[_0x3ecf8c[_0xe0d3('0x4')]]['queuecallerexit']=!![];queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x28')]=utils[_0xe0d3('0x14')]();queues[_0x3ecf8c[_0xe0d3('0x4')]]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util[_0xe0d3('0x2')](_0xe0d3('0x29'),_0x3ecf8c[_0xe0d3('0x4')],queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x1e')],_0x3ecf8c['value'],queues[_0x3ecf8c[_0xe0d3('0x4')]][_0xe0d3('0x8')]));}}}catch(_0x2ea048){utils[_0xe0d3('0x15')](util[_0xe0d3('0x2')](_0xe0d3('0x21'),_0x3ecf8c['uniqueid']),_0x2ea048);}};exports['queuecallerabandon']=function(_0x1fdb90){try{if(!_['isNil'](queues[_0x1fdb90['uniqueid']])){utils[_0xe0d3('0x10')](util[_0xe0d3('0x2')]('[%s][queues][queuecallerabandon]',_0x1fdb90[_0xe0d3('0x4')]),_0x1fdb90);queues[_0x1fdb90[_0xe0d3('0x4')]][_0xe0d3('0x19')]=![];queues[_0x1fdb90[_0xe0d3('0x4')]][_0xe0d3('0x28')]=null;queues[_0x1fdb90[_0xe0d3('0x4')]]['queuecallerabandon']=!![];queues[_0x1fdb90[_0xe0d3('0x4')]][_0xe0d3('0x25')]=utils['now']();queues[_0x1fdb90['uniqueid']]['queuecallerexitreason']=_0xe0d3('0x2a');utils['info'](util[_0xe0d3('0x2')](_0xe0d3('0x2b'),_0x1fdb90[_0xe0d3('0x4')],queues[_0x1fdb90[_0xe0d3('0x4')]][_0xe0d3('0x1e')],queues[_0x1fdb90[_0xe0d3('0x4')]][_0xe0d3('0x8')]));}}catch(_0x5a6528){utils['error'](util[_0xe0d3('0x2')](_0xe0d3('0x2c'),_0x1fdb90['uniqueid']),_0x5a6528);}};exports[_0xe0d3('0x2d')]=function(_0x25fbec){try{if(!_['isNil'](queues[_0x25fbec[_0xe0d3('0x4')]])){utils['debug'](util[_0xe0d3('0x2')](_0xe0d3('0x2e'),_0x25fbec[_0xe0d3('0x4')]),_0x25fbec);utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')](_0xe0d3('0x2f'),_0x25fbec[_0xe0d3('0x4')],queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x1e')],_0x25fbec[_0xe0d3('0x30')],_0x25fbec['connectedlinename']));queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x2d')]=!![];queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x31')]=utils['now']();queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x32')]=utils[_0xe0d3('0x33')](queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x31')],queues[_0x25fbec[_0xe0d3('0x4')]]['queuecallerjoinAt']);queues[_0x25fbec['uniqueid']][_0xe0d3('0x12')]=_0x25fbec['position'];queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x34')]=_0x25fbec['count'];queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x30')]=_0x25fbec[_0xe0d3('0x30')];queues[_0x25fbec[_0xe0d3('0x4')]][_0xe0d3('0x35')]=_0x25fbec[_0xe0d3('0x35')];}}catch(_0x21125d){utils[_0xe0d3('0x15')](util[_0xe0d3('0x2')](_0xe0d3('0x2e'),_0x25fbec['uniqueid']),_0x21125d);}};exports[_0xe0d3('0x36')]=function(_0x4dfdf9){try{if(!_[_0xe0d3('0x17')](queues[_0x4dfdf9[_0xe0d3('0x4')]])){utils[_0xe0d3('0x10')](util['format'](_0xe0d3('0x37'),_0x4dfdf9[_0xe0d3('0x4')]),_0x4dfdf9);utils['info'](util[_0xe0d3('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4dfdf9['uniqueid'],queues[_0x4dfdf9[_0xe0d3('0x4')]][_0xe0d3('0x1e')],_0x4dfdf9[_0xe0d3('0x38')],_0x4dfdf9[_0xe0d3('0x39')]));queues[_0x4dfdf9[_0xe0d3('0x4')]][_0xe0d3('0x24')]=![];queues[_0x4dfdf9[_0xe0d3('0x4')]]['queuecallerabandon']=![];queues[_0x4dfdf9['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4dfdf9[_0xe0d3('0x4')]][_0xe0d3('0x19')]=![];queues[_0x4dfdf9[_0xe0d3('0x4')]][_0xe0d3('0x8')]=null;queues[_0x4dfdf9[_0xe0d3('0x4')]]['queuecallerexitAt']=null;queues[_0x4dfdf9[_0xe0d3('0x4')]][_0xe0d3('0x3a')]=!![];queues[_0x4dfdf9[_0xe0d3('0x4')]]['accountcode']=_0x4dfdf9[_0xe0d3('0x39')];queues[_0x4dfdf9[_0xe0d3('0x4')]][_0xe0d3('0x3b')]=_0x4dfdf9[_0xe0d3('0x38')];}}catch(_0x10f774){utils['error'](util[_0xe0d3('0x2')](_0xe0d3('0x37'),_0x4dfdf9['uniqueid']),_0x10f774);}};exports[_0xe0d3('0x3c')]=function(_0x13adba){try{if(!_[_0xe0d3('0x17')](queues[_0x13adba[_0xe0d3('0x4')]])){if(queues[_0x13adba[_0xe0d3('0x4')]][_0xe0d3('0x31')]){utils[_0xe0d3('0x10')](util['format'](_0xe0d3('0x3d'),_0x13adba[_0xe0d3('0x4')]),_0x13adba);queues[_0x13adba['uniqueid']][_0xe0d3('0x24')]=![];queues[_0x13adba[_0xe0d3('0x4')]]['queuecallerabandon']=![];queues[_0x13adba['uniqueid']][_0xe0d3('0x25')]=null;queues[_0x13adba[_0xe0d3('0x4')]][_0xe0d3('0x19')]=![];queues[_0x13adba[_0xe0d3('0x4')]][_0xe0d3('0x28')]=null;queues[_0x13adba['uniqueid']][_0xe0d3('0x3a')]=!![];queues[_0x13adba[_0xe0d3('0x4')]][_0xe0d3('0x3b')]=_0x13adba['membername'];queues[_0x13adba['uniqueid']]['queuecallercomplete']=!![];queues[_0x13adba[_0xe0d3('0x4')]][_0xe0d3('0x3e')]=utils[_0xe0d3('0x14')]();if(_0x13adba[_0xe0d3('0x3f')]==_0xe0d3('0x40')){if(!queues[_0x13adba['uniqueid']][_0xe0d3('0x40')]){queues[_0x13adba[_0xe0d3('0x4')]]['queuecallerexitreason']=_0xe0d3('0x41');}}else{queues[_0x13adba[_0xe0d3('0x4')]][_0xe0d3('0x8')]=_0xe0d3('0x42')+_0x13adba['reason'][_0xe0d3('0x23')]();}utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')](_0xe0d3('0x43'),_0x13adba[_0xe0d3('0x4')],queues[_0x13adba[_0xe0d3('0x4')]]['name'],_0x13adba['membername'],queues[_0x13adba[_0xe0d3('0x4')]][_0xe0d3('0x8')]));writeDB(queues[_0x13adba['uniqueid']]);}}}catch(_0xbe6597){utils[_0xe0d3('0x15')](util[_0xe0d3('0x2')](_0xe0d3('0x3d'),_0x13adba['uniqueid']),_0xbe6597);}};exports[_0xe0d3('0x44')]=function(_0xb3d331){try{if(!_[_0xe0d3('0x17')](queues[_0xb3d331['transfereeuniqueid']])){utils['debug'](util[_0xe0d3('0x2')](_0xe0d3('0x45'),_0xb3d331['uniqueid']),_0xb3d331);queues[_0xb3d331['transfereeuniqueid']][_0xe0d3('0x40')]=!![];queues[_0xb3d331[_0xe0d3('0x46')]][_0xe0d3('0x47')]=_0xe0d3('0x48');queues[_0xb3d331[_0xe0d3('0x46')]][_0xe0d3('0x49')]=_0xb3d331[_0xe0d3('0x4a')];queues[_0xb3d331[_0xe0d3('0x46')]][_0xe0d3('0x4b')]=_0xb3d331[_0xe0d3('0x46')];queues[_0xb3d331[_0xe0d3('0x46')]][_0xe0d3('0x8')]=_0xe0d3('0x4c');utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0xb3d331[_0xe0d3('0x4')],queues[_0xb3d331[_0xe0d3('0x46')]][_0xe0d3('0x1e')],_0xb3d331['transfereeuniqueid'],_0xb3d331['extension']));}}catch(_0xf30a4e){utils[_0xe0d3('0x15')](util[_0xe0d3('0x2')](_0xe0d3('0x45'),_0xb3d331[_0xe0d3('0x4')]),_0xf30a4e);}};exports['attendedtransfer']=function(_0x426fe5){try{utils[_0xe0d3('0x10')](util[_0xe0d3('0x2')]('[%s][queues][attendedtransfer]',_0x426fe5['origtransfereruniqueid']),_0x426fe5);if(_0x426fe5[_0xe0d3('0x4d')]==_0x426fe5[_0xe0d3('0x4e')]){if(!_['isNil'](queues[_0x426fe5[_0xe0d3('0x4f')]])){utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')](_0xe0d3('0x50'),_0x426fe5[_0xe0d3('0x4d')],queues[_0x426fe5['secondtransfererlinkedid']]['name'],_0x426fe5['origtransfererexten']));queues[_0x426fe5['secondtransfererlinkedid']][_0xe0d3('0x40')]=!![];queues[_0x426fe5[_0xe0d3('0x4f')]]['transfertype']='ATTENDED';queues[_0x426fe5['secondtransfererlinkedid']][_0xe0d3('0x49')]=_0x426fe5[_0xe0d3('0x51')];queues[_0x426fe5[_0xe0d3('0x4f')]][_0xe0d3('0x4b')]=_0x426fe5[_0xe0d3('0x4d')];queues[_0x426fe5[_0xe0d3('0x4f')]][_0xe0d3('0x8')]=_0xe0d3('0x52');}if(!_[_0xe0d3('0x17')](queues[_0x426fe5[_0xe0d3('0x4e')]])){if(_0x426fe5[_0xe0d3('0x53')]&&queues[_0x426fe5['transfereelinkedid']]){queues[_0x426fe5[_0xe0d3('0x53')]][_0xe0d3('0x1f')]=0x1;queues[_0x426fe5[_0xe0d3('0x46')]]=_[_0xe0d3('0x54')](queues[_0x426fe5[_0xe0d3('0x53')]]);queues[_0x426fe5[_0xe0d3('0x46')]][_0xe0d3('0xe')]=_0x426fe5[_0xe0d3('0x55')];queues[_0x426fe5['transfereeuniqueid']][_0xe0d3('0x1f')]=0x2;queues[_0x426fe5[_0xe0d3('0x46')]]['calleridnum']=queues[_0x426fe5[_0xe0d3('0x4f')]]['calleridnum'];queues[_0x426fe5[_0xe0d3('0x46')]][_0xe0d3('0x56')]=queues[_0x426fe5['secondtransfererlinkedid']][_0xe0d3('0x56')];queues[_0x426fe5[_0xe0d3('0x46')]][_0xe0d3('0x57')]=utils[_0xe0d3('0x14')]();queues[_0x426fe5[_0xe0d3('0x46')]][_0xe0d3('0x31')]=utils[_0xe0d3('0x14')]();queues[_0x426fe5[_0xe0d3('0x46')]][_0xe0d3('0x32')]=0x0;queues[_0x426fe5[_0xe0d3('0x46')]][_0xe0d3('0x58')]=0x0;utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x426fe5[_0xe0d3('0x4d')],queues[_0x426fe5['transfereeuniqueid']][_0xe0d3('0x1e')],queues[_0x426fe5['transfereeuniqueid']][_0xe0d3('0x7')],queues[_0x426fe5['transfereeuniqueid']][_0xe0d3('0x56')]));}else{utils[_0xe0d3('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x426fe5[_0xe0d3('0x4d')],queues[_0x426fe5['origtransfererlinkedid']][_0xe0d3('0x1e')],_0x426fe5[_0xe0d3('0x4f')]));queues[_0x426fe5[_0xe0d3('0x4e')]][_0xe0d3('0xe')]=_0x426fe5['secondtransfererlinkedid'];}}}else if(_0x426fe5['secondtransfereruniqueid']==_0x426fe5[_0xe0d3('0x4f')]){if(!_[_0xe0d3('0x17')](queues[_0x426fe5[_0xe0d3('0x4e')]])){utils[_0xe0d3('0x1')](util['format'](_0xe0d3('0x59'),_0x426fe5[_0xe0d3('0x4d')],queues[_0x426fe5[_0xe0d3('0x4e')]]['name'],_0x426fe5[_0xe0d3('0x5a')],_0x426fe5[_0xe0d3('0x5b')]));queues[_0x426fe5['origtransfererlinkedid']]['transfer']=!![];queues[_0x426fe5[_0xe0d3('0x4e')]]['transfertype']=_0xe0d3('0x5c');queues[_0x426fe5[_0xe0d3('0x4e')]][_0xe0d3('0x49')]=_0x426fe5[_0xe0d3('0x5b')];queues[_0x426fe5[_0xe0d3('0x4e')]][_0xe0d3('0x4b')]=_0x426fe5[_0xe0d3('0x5a')];queues[_0x426fe5[_0xe0d3('0x4e')]]['queuecallerexitreason']=_0xe0d3('0x52');}if(!_[_0xe0d3('0x17')](queues[_0x426fe5['secondtransfererlinkedid']])){if(_0x426fe5[_0xe0d3('0x5d')]&&queues[_0x426fe5['transfertargetlinkedid']]){queues[_0x426fe5[_0xe0d3('0x5d')]][_0xe0d3('0x1f')]=0x1;queues[_0x426fe5[_0xe0d3('0x55')]]=_[_0xe0d3('0x54')](queues[_0x426fe5['transfertargetlinkedid']]);queues[_0x426fe5[_0xe0d3('0x55')]][_0xe0d3('0xe')]=_0x426fe5[_0xe0d3('0x55')];queues[_0x426fe5[_0xe0d3('0x55')]][_0xe0d3('0x1f')]=0x2;queues[_0x426fe5[_0xe0d3('0x55')]][_0xe0d3('0x7')]=queues[_0x426fe5['origtransfererlinkedid']][_0xe0d3('0x7')];queues[_0x426fe5['transfertargetuniqueid']][_0xe0d3('0x56')]=queues[_0x426fe5[_0xe0d3('0x4e')]][_0xe0d3('0x56')];queues[_0x426fe5[_0xe0d3('0x55')]]['queuecallerjoinAt']=utils[_0xe0d3('0x14')]();queues[_0x426fe5['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xe0d3('0x14')]();queues[_0x426fe5[_0xe0d3('0x55')]][_0xe0d3('0x32')]=0x0;queues[_0x426fe5[_0xe0d3('0x55')]][_0xe0d3('0x58')]=0x0;utils[_0xe0d3('0x1')](util['format'](_0xe0d3('0x5e'),_0x426fe5[_0xe0d3('0x4d')],queues[_0x426fe5[_0xe0d3('0x55')]]['name'],queues[_0x426fe5[_0xe0d3('0x55')]]['transfereduniqueid'],queues[_0x426fe5[_0xe0d3('0x55')]][_0xe0d3('0x7')],queues[_0x426fe5[_0xe0d3('0x55')]][_0xe0d3('0x56')]));}else{utils[_0xe0d3('0x1')](util['format'](_0xe0d3('0x5f'),_0x426fe5[_0xe0d3('0x4d')],queues[_0x426fe5[_0xe0d3('0x4f')]]['name'],_0x426fe5[_0xe0d3('0x4e')]));queues[_0x426fe5[_0xe0d3('0x4f')]]['transfereduniqueid']=_0x426fe5[_0xe0d3('0x4e')];}}}}catch(_0x2af3f9){utils[_0xe0d3('0x15')](util[_0xe0d3('0x2')](_0xe0d3('0x60'),_0x426fe5[_0xe0d3('0x4d')]),_0x2af3f9);}};exports[_0xe0d3('0x61')]=function(_0x282a66){try{if(!_[_0xe0d3('0x17')](queues[_0x282a66[_0xe0d3('0x4')]])){utils[_0xe0d3('0x10')](util[_0xe0d3('0x2')]('[%s][queues][musiconholdstart]',_0x282a66[_0xe0d3('0x4')]),_0x282a66);queues[_0x282a66[_0xe0d3('0x4')]]['musiconholdstartAt']=utils[_0xe0d3('0x14')]();utils['info'](util[_0xe0d3('0x2')](_0xe0d3('0x62'),_0x282a66['uniqueid'],queues[_0x282a66[_0xe0d3('0x4')]][_0xe0d3('0x1e')],queues[_0x282a66[_0xe0d3('0x4')]][_0xe0d3('0x63')]));}}catch(_0x4f78a0){utils[_0xe0d3('0x15')](util['format'](_0xe0d3('0x64'),_0x282a66['uniqueid']),_0x4f78a0);}};exports['musiconholdstop']=function(_0x33be74){try{if(!_[_0xe0d3('0x17')](queues[_0x33be74[_0xe0d3('0x4')]])){if(!_[_0xe0d3('0x17')](queues[_0x33be74['uniqueid']]['musiconholdstartAt'])){utils[_0xe0d3('0x10')](util[_0xe0d3('0x2')](_0xe0d3('0x65'),_0x33be74[_0xe0d3('0x4')]),_0x33be74);queues[_0x33be74[_0xe0d3('0x4')]][_0xe0d3('0x58')]+=utils[_0xe0d3('0x33')](utils[_0xe0d3('0x14')](),queues[_0x33be74[_0xe0d3('0x4')]]['musiconholdstartAt']);utils[_0xe0d3('0x1')](util[_0xe0d3('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x33be74[_0xe0d3('0x4')],queues[_0x33be74[_0xe0d3('0x4')]]['name'],queues[_0x33be74[_0xe0d3('0x4')]][_0xe0d3('0x58')]));delete queues[_0x33be74[_0xe0d3('0x4')]]['musiconholdstartAt'];}}}catch(_0x43304d){utils['error'](util[_0xe0d3('0x2')](_0xe0d3('0x65'),_0x33be74[_0xe0d3('0x4')]),_0x43304d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 047a2d4..be24499 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 _0x5616=['[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','transfereecalleridname','transfereruniqueid','recording','info','format','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%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'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5616,0xb5));var _0x6561=function(_0xa85690,_0x2d449f){_0xa85690=_0xa85690-0x0;var _0x41bfc1=_0x5616[_0xa85690];return _0x41bfc1;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x52baaf){var _0x38a46f;utils[_0x6561('0x0')](util[_0x6561('0x1')](_0x6561('0x2'),_0x52baaf[_0x6561('0x3')]));if(transfers[_0x6561('0x4')][_0x52baaf['uniqueid']]){_0x38a46f=_0x52baaf[_0x6561('0x3')];_0x52baaf[_0x6561('0x3')]=transfers['blinds'][_0x52baaf[_0x6561('0x3')]]['transfereeuniqueid'];}if(_0x52baaf[_0x6561('0x5')]){utils['getUserByInternal'](_0x52baaf['accountcode'])[_0x6561('0x6')](function(_0x2ee764){if(_0x2ee764){_0x52baaf[_0x6561('0x7')]=_0x2ee764[_0x6561('0x8')];_0x52baaf[_0x6561('0x9')]=_0x2ee764['id'];}utils[_0x6561('0xa')](_0x6561('0xb'),_0x52baaf);});}else{utils[_0x6561('0xa')]('CreateVoiceRecording',_0x52baaf);}if(_0x38a46f)delete transfers[_0x6561('0x4')][_0x38a46f];}exports[_0x6561('0xc')]=function(_0x2a50b2){try{utils['debug'](util[_0x6561('0x1')](_0x6561('0xd'),_0x2a50b2['uniqueid']),_0x2a50b2);if(_0x2a50b2['uniqueid']==_0x2a50b2[_0x6561('0xe')]){utils[_0x6561('0x0')](util[_0x6561('0x1')](_0x6561('0xf'),_0x2a50b2[_0x6561('0x3')],_0x2a50b2[_0x6561('0x10')],_0x2a50b2[_0x6561('0x11')]));recordings[_0x2a50b2['uniqueid']]={'uniqueid':_0x2a50b2[_0x6561('0x3')],'accountcode':_0x2a50b2['accountcode'],'exten':_0x2a50b2[_0x6561('0x11')],'context':_0x2a50b2['context'],'channel':_0x2a50b2[_0x6561('0x12')],'monitors':[]};}}catch(_0x339a2f){utils[_0x6561('0x13')](util[_0x6561('0x1')]('[%s][recordings][newchannel]',_0x2a50b2[_0x6561('0x3')]),_0x339a2f);}};exports[_0x6561('0x14')]=function(_0xa4ea20){try{utils['debug'](util['format'](_0x6561('0x15'),_0xa4ea20[_0x6561('0x3')]),_0xa4ea20);if(!_[_0x6561('0x16')](recordings[_0xa4ea20[_0x6561('0x3')]])&&_0xa4ea20[_0x6561('0x17')]==0x6){utils[_0x6561('0x0')](util[_0x6561('0x1')](_0x6561('0x18'),_0xa4ea20[_0x6561('0x3')],_0xa4ea20[_0x6561('0x10')],_0xa4ea20['channel']));}else if(!_[_0x6561('0x16')](recordings[_0xa4ea20[_0x6561('0xe')]])&&_0xa4ea20[_0x6561('0x17')]==0x6&&_0xa4ea20['context']!=_0x6561('0x19')){utils[_0x6561('0x0')](util['format'](_0x6561('0x1a'),_0xa4ea20[_0x6561('0x3')],_0xa4ea20[_0x6561('0xe')],_0xa4ea20['context'],_0xa4ea20[_0x6561('0x12')]));recordings[_0xa4ea20['linkedid']][_0x6561('0x5')]=_0xa4ea20[_0x6561('0x5')];}}catch(_0x4c4d50){utils[_0x6561('0x13')](util['format'](_0x6561('0x15'),_0xa4ea20['uniqueid']),_0x4c4d50);}};exports['varset']=function(_0x963b5a){try{if(!_['isNil'](_0x963b5a[_0x6561('0x1b')])&&!_[_0x6561('0x16')](_0x963b5a[_0x6561('0x1b')][_0x6561('0x1c')])){utils[_0x6561('0x1d')](util[_0x6561('0x1')](_0x6561('0x1e'),_0x963b5a[_0x6561('0x3')]),_0x963b5a);utils[_0x6561('0x0')](util['format'](_0x6561('0x1f'),_0x963b5a[_0x6561('0x3')],_0x963b5a[_0x6561('0x1b')],_0x963b5a[_0x6561('0x20')]));if(_[_0x6561('0x21')](_0x963b5a[_0x6561('0x20')],_0x6561('0x22'))){_0x963b5a[_0x6561('0x20')]=_0x963b5a['value']['replace'](_0x6561('0x22'),'.WAV');}if(recordings[_0x963b5a[_0x6561('0xe')]]){var _0x21e0cb=_['find'](recordings[_0x963b5a[_0x6561('0xe')]][_0x6561('0x23')],{'value':_0x963b5a['value']});if(_[_0x6561('0x16')](_0x21e0cb)){recordings[_0x963b5a[_0x6561('0xe')]][_0x6561('0x23')][_0x6561('0x24')]({'value':_0x963b5a[_0x6561('0x20')]});}}}}catch(_0x51ed52){utils['error'](util[_0x6561('0x1')]('[%s][recordings][varset]',_0x963b5a[_0x6561('0x3')]),_0x51ed52);}};exports[_0x6561('0x25')]=function(_0x58ea67){try{if(!_[_0x6561('0x16')](recordings[_0x58ea67[_0x6561('0x3')]])){utils[_0x6561('0x1d')](util[_0x6561('0x1')]('[%s][recordings][hangup]',_0x58ea67['uniqueid']),_0x58ea67);utils[_0x6561('0x0')](util[_0x6561('0x1')](_0x6561('0x26'),_0x58ea67[_0x6561('0x3')],_0x58ea67[_0x6561('0x27')],_0x58ea67[_0x6561('0x28')],_0x58ea67[_0x6561('0x29')]));recordings[_0x58ea67[_0x6561('0x3')]]['calleridnum']=_0x58ea67[_0x6561('0x27')];recordings[_0x58ea67['uniqueid']][_0x6561('0x28')]=_0x58ea67[_0x6561('0x28')];recordings[_0x58ea67['uniqueid']]['connectedlinenum']=_0x58ea67[_0x6561('0x2a')];recordings[_0x58ea67['uniqueid']][_0x6561('0x2b')]=_0x58ea67['connectedlinename'];if(recordings[_0x58ea67[_0x6561('0x3')]][_0x6561('0x2c')]==_0x6561('0x2d')&&recordings[_0x58ea67[_0x6561('0x3')]][_0x6561('0x5')]){recordings[_0x58ea67[_0x6561('0x3')]][_0x6561('0x2a')]=recordings[_0x58ea67[_0x6561('0x3')]][_0x6561('0x5')];recordings[_0x58ea67[_0x6561('0x3')]][_0x6561('0x2b')]='';}recordings[_0x58ea67['uniqueid']]['monitors'][_0x6561('0x2e')](function(_0x99fb3){var _0x5f5d9c=_[_0x6561('0x2f')](recordings[_0x58ea67[_0x6561('0x3')]]);_0x5f5d9c['value']=_0x99fb3[_0x6561('0x20')];writeDB(_0x5f5d9c);});delete recordings[_0x58ea67[_0x6561('0x3')]];}}catch(_0x471343){utils[_0x6561('0x13')](util[_0x6561('0x1')](_0x6561('0x30'),_0x58ea67[_0x6561('0x3')]),_0x471343);}};exports[_0x6561('0x31')]=function(_0x112ea7){try{if(!_[_0x6561('0x16')](recordings[_0x112ea7[_0x6561('0x3')]])){utils['debug'](util[_0x6561('0x1')](_0x6561('0x32'),_0x112ea7[_0x6561('0x3')]),_0x112ea7);utils[_0x6561('0x0')](util[_0x6561('0x1')](_0x6561('0x33'),_0x112ea7[_0x6561('0x3')],_0x112ea7['application'],_0x112ea7[_0x6561('0x34')]));if(_0x112ea7[_0x6561('0x35')][_0x6561('0x36')]()==_0x6561('0x37')&&_[_0x6561('0x38')](_0x112ea7[_0x6561('0x34')][_0x6561('0x36')](),_0x6561('0x39'))){var _0x48d1d0=_0x112ea7['appdata'][_0x6561('0x3a')]('=');var _0x31044d=_0x48d1d0[0x0][_0x6561('0x3b')](_0x48d1d0[0x0][_0x6561('0x3c')]('(')+0x1,_0x48d1d0[0x0]['lastIndexOf'](')'));var _0x314d84=_0x48d1d0[0x1];recordings[_0x112ea7['uniqueid']][_0x31044d]=_0x314d84;}}}catch(_0xf80a70){utils['error'](util[_0x6561('0x1')](_0x6561('0x32'),_0x112ea7['uniqueid']),_0xf80a70);}};exports[_0x6561('0x3d')]=function(_0x2abbea){try{if(!_[_0x6561('0x16')](recordings[_0x2abbea[_0x6561('0x3')]])){utils['debug'](util['format'](_0x6561('0x3e'),_0x2abbea[_0x6561('0x3')]),_0x2abbea);utils[_0x6561('0x0')](util[_0x6561('0x1')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2abbea['uniqueid'],_0x2abbea[_0x6561('0x3f')]));recordings[_0x2abbea[_0x6561('0x3')]][_0x6561('0x3f')]=_0x2abbea[_0x6561('0x3f')];}}catch(_0x1003cd){utils[_0x6561('0x13')](util[_0x6561('0x1')](_0x6561('0x3e'),_0x2abbea[_0x6561('0x3')]),_0x1003cd);}};exports[_0x6561('0x40')]=function(_0xb421bc){try{utils['debug'](util[_0x6561('0x1')](_0x6561('0x41'),_0xb421bc[_0x6561('0x3')]),_0xb421bc);utils['info'](util[_0x6561('0x1')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xb421bc[_0x6561('0x3')],_0xb421bc['transferercalleridnum'],_0xb421bc['transferercalleridname'],_0xb421bc['transfereecalleridnum'],_0xb421bc[_0x6561('0x42')]));if(recordings[_0xb421bc[_0x6561('0x43')]]&&transfers[_0x6561('0x4')][_0xb421bc[_0x6561('0x43')]]){transfers[_0x6561('0x4')][_0xb421bc[_0x6561('0x43')]][_0x6561('0x44')]=!![];}}catch(_0x25fcae){utils[_0x6561('0x13')](util[_0x6561('0x1')]('[%s][recordings][blindtransfer]',_0xb421bc['uniqueid']),_0x25fcae);}}; \ No newline at end of file +var _0x8d62=['then','membername','name','UserId','request','CreateVoiceRecording','newchannel','linkedid','context','exten','channel','error','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','./utils','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8d62,0x10c));var _0x28d6=function(_0x5a31e8,_0x1ec02f){_0x5a31e8=_0x5a31e8-0x0;var _0x2d15b1=_0x8d62[_0x5a31e8];return _0x2d15b1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x28d6('0x0'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x585421){var _0x547b17;utils[_0x28d6('0x1')](util[_0x28d6('0x2')]('[%s][recordings][writeDB]',_0x585421[_0x28d6('0x3')]));if(transfers['blinds'][_0x585421['uniqueid']]){_0x547b17=_0x585421[_0x28d6('0x3')];_0x585421[_0x28d6('0x3')]=transfers[_0x28d6('0x4')][_0x585421[_0x28d6('0x3')]][_0x28d6('0x5')];}if(_0x585421[_0x28d6('0x6')]){utils[_0x28d6('0x7')](_0x585421[_0x28d6('0x6')])[_0x28d6('0x8')](function(_0x4685d7){if(_0x4685d7){_0x585421[_0x28d6('0x9')]=_0x4685d7[_0x28d6('0xa')];_0x585421[_0x28d6('0xb')]=_0x4685d7['id'];}utils[_0x28d6('0xc')](_0x28d6('0xd'),_0x585421);});}else{utils[_0x28d6('0xc')](_0x28d6('0xd'),_0x585421);}if(_0x547b17)delete transfers['blinds'][_0x547b17];}exports[_0x28d6('0xe')]=function(_0x142c53){try{utils['debug'](util[_0x28d6('0x2')]('[%s][recordings][newchannel]',_0x142c53['uniqueid']),_0x142c53);if(_0x142c53['uniqueid']==_0x142c53[_0x28d6('0xf')]){utils[_0x28d6('0x1')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x142c53['uniqueid'],_0x142c53[_0x28d6('0x10')],_0x142c53[_0x28d6('0x11')]));recordings[_0x142c53[_0x28d6('0x3')]]={'uniqueid':_0x142c53[_0x28d6('0x3')],'accountcode':_0x142c53[_0x28d6('0x6')],'exten':_0x142c53['exten'],'context':_0x142c53[_0x28d6('0x10')],'channel':_0x142c53[_0x28d6('0x12')],'monitors':[]};}}catch(_0x1aaefe){utils[_0x28d6('0x13')](util[_0x28d6('0x2')](_0x28d6('0x14'),_0x142c53[_0x28d6('0x3')]),_0x1aaefe);}};exports[_0x28d6('0x15')]=function(_0x4073fd){try{utils[_0x28d6('0x16')](util[_0x28d6('0x2')](_0x28d6('0x17'),_0x4073fd[_0x28d6('0x3')]),_0x4073fd);if(!_[_0x28d6('0x18')](recordings[_0x4073fd[_0x28d6('0x3')]])&&_0x4073fd['channelstate']==0x6){utils[_0x28d6('0x1')](util[_0x28d6('0x2')](_0x28d6('0x19'),_0x4073fd[_0x28d6('0x3')],_0x4073fd[_0x28d6('0x10')],_0x4073fd[_0x28d6('0x12')]));}else if(!_[_0x28d6('0x18')](recordings[_0x4073fd[_0x28d6('0xf')]])&&_0x4073fd['channelstate']==0x6&&_0x4073fd['context']!=_0x28d6('0x1a')){utils[_0x28d6('0x1')](util[_0x28d6('0x2')](_0x28d6('0x1b'),_0x4073fd['uniqueid'],_0x4073fd['linkedid'],_0x4073fd[_0x28d6('0x10')],_0x4073fd['channel']));recordings[_0x4073fd[_0x28d6('0xf')]][_0x28d6('0x6')]=_0x4073fd[_0x28d6('0x6')];}}catch(_0xfe7532){utils[_0x28d6('0x13')](util['format'](_0x28d6('0x17'),_0x4073fd[_0x28d6('0x3')]),_0xfe7532);}};exports[_0x28d6('0x1c')]=function(_0x18c5c8){try{if(!_[_0x28d6('0x18')](_0x18c5c8[_0x28d6('0x1d')])&&!_['isNil'](_0x18c5c8[_0x28d6('0x1d')][_0x28d6('0x1e')])){utils['debug'](util[_0x28d6('0x2')](_0x28d6('0x1f'),_0x18c5c8[_0x28d6('0x3')]),_0x18c5c8);utils[_0x28d6('0x1')](util[_0x28d6('0x2')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x18c5c8['uniqueid'],_0x18c5c8['variable'],_0x18c5c8[_0x28d6('0x20')]));if(_[_0x28d6('0x21')](_0x18c5c8['value'],_0x28d6('0x22'))){_0x18c5c8[_0x28d6('0x20')]=_0x18c5c8[_0x28d6('0x20')][_0x28d6('0x23')](_0x28d6('0x22'),_0x28d6('0x24'));}if(recordings[_0x18c5c8[_0x28d6('0xf')]]){var _0x1c3f31=_[_0x28d6('0x25')](recordings[_0x18c5c8[_0x28d6('0xf')]]['monitors'],{'value':_0x18c5c8['value']});if(_[_0x28d6('0x18')](_0x1c3f31)){recordings[_0x18c5c8[_0x28d6('0xf')]][_0x28d6('0x26')][_0x28d6('0x27')]({'value':_0x18c5c8[_0x28d6('0x20')]});}}}}catch(_0x43240e){utils[_0x28d6('0x13')](util[_0x28d6('0x2')]('[%s][recordings][varset]',_0x18c5c8[_0x28d6('0x3')]),_0x43240e);}};exports['hangup']=function(_0x258b43){try{if(!_[_0x28d6('0x18')](recordings[_0x258b43[_0x28d6('0x3')]])){utils[_0x28d6('0x16')](util[_0x28d6('0x2')](_0x28d6('0x28'),_0x258b43[_0x28d6('0x3')]),_0x258b43);utils[_0x28d6('0x1')](util[_0x28d6('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x258b43['uniqueid'],_0x258b43[_0x28d6('0x29')],_0x258b43['calleridname'],_0x258b43[_0x28d6('0x2a')]));recordings[_0x258b43[_0x28d6('0x3')]]['calleridnum']=_0x258b43['calleridnum'];recordings[_0x258b43[_0x28d6('0x3')]][_0x28d6('0x2b')]=_0x258b43[_0x28d6('0x2b')];recordings[_0x258b43['uniqueid']][_0x28d6('0x2c')]=_0x258b43[_0x28d6('0x2c')];recordings[_0x258b43[_0x28d6('0x3')]][_0x28d6('0x2d')]=_0x258b43[_0x28d6('0x2d')];if(recordings[_0x258b43[_0x28d6('0x3')]][_0x28d6('0x2e')]=='outbound'&&recordings[_0x258b43['uniqueid']][_0x28d6('0x6')]){recordings[_0x258b43[_0x28d6('0x3')]][_0x28d6('0x2c')]=recordings[_0x258b43[_0x28d6('0x3')]][_0x28d6('0x6')];recordings[_0x258b43['uniqueid']][_0x28d6('0x2d')]='';}recordings[_0x258b43[_0x28d6('0x3')]]['monitors'][_0x28d6('0x2f')](function(_0x395c0d){var _0x10bd30=_[_0x28d6('0x30')](recordings[_0x258b43['uniqueid']]);_0x10bd30[_0x28d6('0x20')]=_0x395c0d[_0x28d6('0x20')];writeDB(_0x10bd30);});delete recordings[_0x258b43[_0x28d6('0x3')]];}}catch(_0x250591){utils[_0x28d6('0x13')](util[_0x28d6('0x2')](_0x28d6('0x28'),_0x258b43[_0x28d6('0x3')]),_0x250591);}};exports[_0x28d6('0x31')]=function(_0x3c0606){try{if(!_[_0x28d6('0x18')](recordings[_0x3c0606[_0x28d6('0x3')]])){utils[_0x28d6('0x16')](util['format']('[%s][recordings][newexten]',_0x3c0606[_0x28d6('0x3')]),_0x3c0606);utils['info'](util[_0x28d6('0x2')](_0x28d6('0x32'),_0x3c0606[_0x28d6('0x3')],_0x3c0606[_0x28d6('0x33')],_0x3c0606[_0x28d6('0x34')]));if(_0x3c0606['application'][_0x28d6('0x35')]()==_0x28d6('0x36')&&_[_0x28d6('0x37')](_0x3c0606[_0x28d6('0x34')][_0x28d6('0x35')](),_0x28d6('0x38'))){var _0x3600fc=_0x3c0606[_0x28d6('0x34')][_0x28d6('0x39')]('=');var _0x15654f=_0x3600fc[0x0]['substring'](_0x3600fc[0x0][_0x28d6('0x3a')]('(')+0x1,_0x3600fc[0x0][_0x28d6('0x3a')](')'));var _0x1dd71d=_0x3600fc[0x1];recordings[_0x3c0606['uniqueid']][_0x15654f]=_0x1dd71d;}}}catch(_0x156d8e){utils[_0x28d6('0x13')](util[_0x28d6('0x2')](_0x28d6('0x3b'),_0x3c0606[_0x28d6('0x3')]),_0x156d8e);}};exports['queuecallerjoin']=function(_0x2c71ea){try{if(!_[_0x28d6('0x18')](recordings[_0x2c71ea[_0x28d6('0x3')]])){utils[_0x28d6('0x16')](util[_0x28d6('0x2')](_0x28d6('0x3c'),_0x2c71ea['uniqueid']),_0x2c71ea);utils['info'](util[_0x28d6('0x2')](_0x28d6('0x3d'),_0x2c71ea[_0x28d6('0x3')],_0x2c71ea[_0x28d6('0x3e')]));recordings[_0x2c71ea[_0x28d6('0x3')]][_0x28d6('0x3e')]=_0x2c71ea[_0x28d6('0x3e')];}}catch(_0x1e6e33){utils[_0x28d6('0x13')](util[_0x28d6('0x2')]('[%s][recordings][queuecallerjoin]',_0x2c71ea[_0x28d6('0x3')]),_0x1e6e33);}};exports[_0x28d6('0x3f')]=function(_0xcf4940){try{utils[_0x28d6('0x16')](util['format']('[%s][recordings][blindtransfer]',_0xcf4940[_0x28d6('0x3')]),_0xcf4940);utils['info'](util[_0x28d6('0x2')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xcf4940[_0x28d6('0x3')],_0xcf4940[_0x28d6('0x40')],_0xcf4940['transferercalleridname'],_0xcf4940[_0x28d6('0x41')],_0xcf4940[_0x28d6('0x42')]));if(recordings[_0xcf4940[_0x28d6('0x43')]]&&transfers[_0x28d6('0x4')][_0xcf4940['transfereruniqueid']]){transfers[_0x28d6('0x4')][_0xcf4940[_0x28d6('0x43')]]['recording']=!![];}}catch(_0x369558){utils[_0x28d6('0x13')](util[_0x28d6('0x2')](_0x28d6('0x44'),_0xcf4940['uniqueid']),_0x369558);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 24e1c20..79dcbea 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 _0x97c7=['info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util'];(function(_0x544525,_0x5ac8a9){var _0x2e2e9d=function(_0xdb595){while(--_0xdb595){_0x544525['push'](_0x544525['shift']());}};_0x2e2e9d(++_0x5ac8a9);}(_0x97c7,0x1b6));var _0x797c=function(_0x217b35,_0x46d480){_0x217b35=_0x217b35-0x0;var _0x444bf3=_0x97c7[_0x217b35];return _0x444bf3;};'use strict';var _=require(_0x797c('0x0'));var util=require(_0x797c('0x1'));var utils=require('./utils');function writeDB(_0x1be268){utils[_0x797c('0x2')](util['format'](_0x797c('0x3'),_0x1be268[_0x797c('0x4')]===_0x797c('0x5')?_0x1be268[_0x797c('0x6')]:_0x1be268[_0x797c('0x7')],_0x1be268[_0x797c('0x4')]));utils[_0x797c('0x8')](_0x797c('0x9'),_0x1be268);}exports[_0x797c('0xa')]={};exports[_0x797c('0xb')]=function(_0x24965a){try{utils['debug'](util[_0x797c('0xc')]('[%s][transfers][blindtransfer]',_0x24965a['uniqueid']),_0x24965a);utils[_0x797c('0x2')](util[_0x797c('0xc')](_0x797c('0xd'),_0x24965a[_0x797c('0x7')],_0x24965a[_0x797c('0xe')],_0x24965a[_0x797c('0xf')],_0x24965a[_0x797c('0x10')],_0x24965a[_0x797c('0x11')]));_0x24965a[_0x797c('0x4')]='blind';exports['blinds'][_0x24965a['transfereruniqueid']]=_0x24965a;writeDB(_0x24965a);}catch(_0x124e50){utils[_0x797c('0x12')](util[_0x797c('0xc')]('[%s][transfers][blindtransfer]',_0x24965a[_0x797c('0x7')]),_0x124e50);}};exports[_0x797c('0x13')]=function(_0x3f974c){try{utils['debug'](util[_0x797c('0xc')](_0x797c('0x14'),_0x3f974c[_0x797c('0x6')]),_0x3f974c);utils['info'](util[_0x797c('0xc')](_0x797c('0x15'),_0x3f974c[_0x797c('0x6')],_0x3f974c[_0x797c('0x16')],_0x3f974c[_0x797c('0x17')],_0x3f974c[_0x797c('0x18')],_0x3f974c[_0x797c('0x19')]));_0x3f974c=_['assign'](_0x3f974c,{'transfererchannel':_0x3f974c[_0x797c('0x1a')],'transferercalleridnum':_0x3f974c[_0x797c('0x16')],'transferercalleridname':_0x3f974c[_0x797c('0x17')],'transfererconnectedlinenum':_0x3f974c[_0x797c('0x1b')],'transfererconnectedlinename':_0x3f974c[_0x797c('0x1c')],'transfereraccountcode':_0x3f974c[_0x797c('0x1d')],'transferercontext':_0x3f974c[_0x797c('0x1e')],'transfererexten':_0x3f974c['secondtransfererexten'],'transfererlinkedid':_0x3f974c[_0x797c('0x1f')],'context':_0x3f974c['origtransferercontext'],'extension':_0x3f974c['origtransfererexten'],'type':_0x797c('0x5')});if(_['isNil'](_0x3f974c['transfereechannel'])){_0x3f974c=_[_0x797c('0x20')](_0x3f974c,{'transfereechannel':_0x3f974c[_0x797c('0x21')],'transfereecalleridnum':_0x3f974c[_0x797c('0x18')],'transfereecalleridname':_0x3f974c[_0x797c('0x19')],'transfereeconnectedlinenum':_0x3f974c[_0x797c('0x22')],'transfereeconnectedlinename':_0x3f974c[_0x797c('0x23')],'transfereeaccountcode':_0x3f974c[_0x797c('0x24')],'transfereecontext':_0x3f974c[_0x797c('0x25')],'transfereeexten':_0x3f974c[_0x797c('0x26')],'transfereelinkedid':_0x3f974c[_0x797c('0x27')]});}writeDB(_0x3f974c);}catch(_0x17fd24){utils[_0x797c('0x12')](util[_0x797c('0xc')](_0x797c('0x14'),_0x3f974c[_0x797c('0x6')]),_0x17fd24);}}; \ No newline at end of file +var _0xc70f=['util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','[%s][transfers][attendedtransfer]','lodash'];(function(_0x2657c1,_0x50043d){var _0x2a94c3=function(_0x6915e2){while(--_0x6915e2){_0x2657c1['push'](_0x2657c1['shift']());}};_0x2a94c3(++_0x50043d);}(_0xc70f,0x147));var _0xfc70=function(_0x35b190,_0x340522){_0x35b190=_0x35b190-0x0;var _0x322e9e=_0xc70f[_0x35b190];return _0x322e9e;};'use strict';var _=require(_0xfc70('0x0'));var util=require(_0xfc70('0x1'));var utils=require(_0xfc70('0x2'));function writeDB(_0x520b7e){utils['info'](util[_0xfc70('0x3')](_0xfc70('0x4'),_0x520b7e[_0xfc70('0x5')]==='attended'?_0x520b7e[_0xfc70('0x6')]:_0x520b7e[_0xfc70('0x7')],_0x520b7e[_0xfc70('0x5')]));utils[_0xfc70('0x8')](_0xfc70('0x9'),_0x520b7e);}exports[_0xfc70('0xa')]={};exports['blindtransfer']=function(_0x312f34){try{utils[_0xfc70('0xb')](util[_0xfc70('0x3')](_0xfc70('0xc'),_0x312f34[_0xfc70('0x7')]),_0x312f34);utils[_0xfc70('0xd')](util[_0xfc70('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x312f34[_0xfc70('0x7')],_0x312f34[_0xfc70('0xe')],_0x312f34[_0xfc70('0xf')],_0x312f34[_0xfc70('0x10')],_0x312f34['transfereecalleridname']));_0x312f34[_0xfc70('0x5')]=_0xfc70('0x11');exports[_0xfc70('0xa')][_0x312f34['transfereruniqueid']]=_0x312f34;writeDB(_0x312f34);}catch(_0xc0f8fb){utils[_0xfc70('0x12')](util[_0xfc70('0x3')](_0xfc70('0xc'),_0x312f34['uniqueid']),_0xc0f8fb);}};exports[_0xfc70('0x13')]=function(_0x36c02d){try{utils[_0xfc70('0xb')](util['format']('[%s][transfers][attendedtransfer]',_0x36c02d[_0xfc70('0x6')]),_0x36c02d);utils[_0xfc70('0xd')](util[_0xfc70('0x3')](_0xfc70('0x14'),_0x36c02d[_0xfc70('0x6')],_0x36c02d[_0xfc70('0x15')],_0x36c02d[_0xfc70('0x16')],_0x36c02d[_0xfc70('0x17')],_0x36c02d[_0xfc70('0x18')]));_0x36c02d=_['assign'](_0x36c02d,{'transfererchannel':_0x36c02d[_0xfc70('0x19')],'transferercalleridnum':_0x36c02d[_0xfc70('0x15')],'transferercalleridname':_0x36c02d[_0xfc70('0x16')],'transfererconnectedlinenum':_0x36c02d[_0xfc70('0x1a')],'transfererconnectedlinename':_0x36c02d[_0xfc70('0x1b')],'transfereraccountcode':_0x36c02d[_0xfc70('0x1c')],'transferercontext':_0x36c02d[_0xfc70('0x1d')],'transfererexten':_0x36c02d[_0xfc70('0x1e')],'transfererlinkedid':_0x36c02d['origtransfererlinkedid'],'context':_0x36c02d['origtransferercontext'],'extension':_0x36c02d[_0xfc70('0x1f')],'type':_0xfc70('0x20')});if(_[_0xfc70('0x21')](_0x36c02d[_0xfc70('0x22')])){_0x36c02d=_[_0xfc70('0x23')](_0x36c02d,{'transfereechannel':_0x36c02d[_0xfc70('0x24')],'transfereecalleridnum':_0x36c02d[_0xfc70('0x17')],'transfereecalleridname':_0x36c02d[_0xfc70('0x18')],'transfereeconnectedlinenum':_0x36c02d[_0xfc70('0x25')],'transfereeconnectedlinename':_0x36c02d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x36c02d[_0xfc70('0x26')],'transfereecontext':_0x36c02d['transfertargetcontext'],'transfereeexten':_0x36c02d[_0xfc70('0x27')],'transfereelinkedid':_0x36c02d['transfertargetlinkedid']});}writeDB(_0x36c02d);}catch(_0x19da75){utils[_0xfc70('0x12')](util[_0xfc70('0x3')](_0xfc70('0x28'),_0x36c02d['origtransfereruniqueid']),_0x19da75);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 497c0df..6f51187 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 _0x41cb=['seconds','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','format','isAfter','isBefore','moment','util','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add'];(function(_0x127462,_0x547a2c){var _0x323378=function(_0x8f002a){while(--_0x8f002a){_0x127462['push'](_0x127462['shift']());}};_0x323378(++_0x547a2c);}(_0x41cb,0x124));var _0xb41c=function(_0x2e5db6,_0x518e24){_0x2e5db6=_0x2e5db6-0x0;var _0x4bbfc0=_0x41cb[_0x2e5db6];return _0x4bbfc0;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xb41c('0x0'));var util=require(_0xb41c('0x1'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0xb41c('0x2'))(_0xb41c('0x3'));exports[_0xb41c('0x4')]=function(_0x390d5c,_0x37d268){logger[_0xb41c('0x4')](_0x390d5c,_0x37d268?util[_0xb41c('0x5')](_0x37d268,{'showHidden':![],'depth':null}):'');};exports[_0xb41c('0x6')]=function(_0x53f4dc,_0x41ef19){logger[_0xb41c('0x6')](_0x53f4dc,_0x41ef19?util[_0xb41c('0x5')](_0x41ef19,{'showHidden':![],'depth':null}):'');};exports[_0xb41c('0x7')]=function(_0x4192ab,_0x39f47a){logger[_0xb41c('0x7')](_0x4192ab,_0x39f47a?util[_0xb41c('0x5')](_0x39f47a,{'showHidden':![],'depth':null}):'');};exports[_0xb41c('0x8')]=function(_0x3cbe9d,_0x459b9c){return client[_0xb41c('0x8')](_0x3cbe9d,{'body':_0x459b9c})['then'](function(_0x1d44f3){logger[_0xb41c('0x6')]('[utils][request]\x20name:%s',_0x3cbe9d,_0x1d44f3?util['inspect'](_0x1d44f3,{'showHidden':![],'depth':null}):'');})[_0xb41c('0x9')](function(_0x582a6b){logger[_0xb41c('0x7')](_0xb41c('0xa'),_0x3cbe9d,_0x582a6b?util[_0xb41c('0x5')](_0x582a6b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3a73c0){return client[_0xb41c('0x8')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xb41c('0xb'),_0xb41c('0xc'),_0xb41c('0xd')],'where':_0x3a73c0,'limit':0x1}})[_0xb41c('0xe')](function(_0x91ad1a){logger[_0xb41c('0x6')](_0xb41c('0xf'),JSON[_0xb41c('0x10')](_0x3a73c0),_0x91ad1a?util['inspect'](_0x91ad1a,{'showHidden':![],'depth':null}):'');return _0x91ad1a[_0xb41c('0x11')][_0xb41c('0x12')]?_0x91ad1a['result'][0x0]:null;});}exports[_0xb41c('0x13')]=function(_0x13fa83){return new BPromise(function(_0x5981e9,_0x4204c9){if(_0x13fa83){return getUser({'internal':_0x13fa83})['then'](function(_0x54c806){logger[_0xb41c('0x4')](_0xb41c('0x14'),_0x13fa83,_0x54c806?_0xb41c('0x15'):_0xb41c('0x16'));return _0x5981e9(_0x54c806);})[_0xb41c('0x9')](function(_0x1710ba){logger['error'](_0xb41c('0x17'),_0x1710ba?util['inspect'](_0x1710ba,{'showHidden':![],'depth':null}):'');return _0x5981e9(null);});}return _0x5981e9(null);});};exports[_0xb41c('0x18')]=function(_0x2fc39c){return new BPromise(function(_0x3ce1b5,_0x424c87){if(_0x2fc39c){return getUser({'interface':_0x2fc39c})[_0xb41c('0xe')](function(_0xd7a0bf){logger[_0xb41c('0x4')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2fc39c,_0xd7a0bf?'found':_0xb41c('0x16'));return _0x3ce1b5(_0xd7a0bf);})['catch'](function(_0x188770){logger['error'](_0xb41c('0x19'),_0x188770?util[_0xb41c('0x5')](_0x188770,{'showHidden':![],'depth':null}):'');return _0x3ce1b5(null);});}return _0x3ce1b5(null);});};exports[_0xb41c('0x1a')]=function(_0x2d779d){return new BPromise(function(_0x4fb778,_0x4ff3ef){if(_0x2d779d){return getUser({'name':_0x2d779d})[_0xb41c('0xe')](function(_0x14bd24){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x2d779d,_0x14bd24?_0xb41c('0x15'):'notfound');return _0x4fb778(_0x14bd24);})[_0xb41c('0x9')](function(_0x1ed10c){logger[_0xb41c('0x7')](_0xb41c('0x1b'),_0x1ed10c?util[_0xb41c('0x5')](_0x1ed10c,{'showHidden':![],'depth':null}):'');return _0x4fb778(null);});}return _0x4fb778(null);});};exports[_0xb41c('0x1c')]=function(_0x194729){return new BPromise(function(_0x42223e,_0x311c26){if(_0x194729){return client[_0xb41c('0x8')](_0xb41c('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0xb41c('0x1e'),_0xb41c('0x1f'),'acwTimeout'],'where':{'name':_0x194729},'limit':0x1}})['then'](function(_0x6c6a5a){logger[_0xb41c('0x6')](_0xb41c('0x20'),_0x194729,_0x6c6a5a?util[_0xb41c('0x5')](_0x6c6a5a,{'showHidden':![],'depth':null}):'');logger[_0xb41c('0x4')](_0xb41c('0x21'),_0x194729,_0x6c6a5a?_0xb41c('0x15'):'notfound');return _0x42223e(_0x6c6a5a['result'][_0xb41c('0x12')]?_0x6c6a5a[_0xb41c('0x11')][0x0]:null);})[_0xb41c('0x9')](function(_0x2d1d2f){logger[_0xb41c('0x7')](_0xb41c('0x22'),_0x2d1d2f?util['inspect'](_0x2d1d2f,{'showHidden':![],'depth':null}):'');return _0x42223e(null);});}return _0x42223e(null);});};exports[_0xb41c('0x23')]=function(_0xfc157,_0x16054d){return moment(_0xfc157)[_0xb41c('0x24')](_0x16054d,_0xb41c('0x25'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb41c('0x26')]=function(_0x2c7e2a,_0xbc2c7e){return moment(_0x2c7e2a)[_0xb41c('0x27')](_0xbc2c7e,'seconds')['format'](_0xb41c('0x28'));};exports[_0xb41c('0x29')]=function(_0x21a302,_0x2fd2c6){return moment(_0x21a302)['diff'](moment(_0x2fd2c6),_0xb41c('0x25'));};exports[_0xb41c('0x2a')]=function(_0x36f377,_0x3220f6){return parseInt(_0x36f377,0xa)+parseInt(_0x3220f6,0xa);};exports[_0xb41c('0x2b')]=function(){return moment()[_0xb41c('0x2c')](_0xb41c('0x28'));};exports[_0xb41c('0x2d')]=function(_0x2b031c,_0x1ecd74){if(_0x1ecd74){return moment(_0x2b031c)[_0xb41c('0x2d')](_0x1ecd74);}return!![];};exports[_0xb41c('0x2e')]=function(_0x249c83,_0x469f95){if(_0x469f95){return moment(_0x249c83)['isBefore'](_0x469f95);}else if(_0x249c83){return!![];}return![];}; \ No newline at end of file +var _0x20d4=['[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x5ed88a,_0x1d13a7){var _0x5233fb=function(_0x161cf2){while(--_0x161cf2){_0x5ed88a['push'](_0x5ed88a['shift']());}};_0x5233fb(++_0x1d13a7);}(_0x20d4,0xdc));var _0x420d=function(_0x1ddb8b,_0x9cb6f5){_0x1ddb8b=_0x1ddb8b-0x0;var _0x1e9f9e=_0x20d4[_0x1ddb8b];return _0x1e9f9e;};'use strict';var BPromise=require(_0x420d('0x0'));var jayson=require(_0x420d('0x1'));var moment=require(_0x420d('0x2'));var util=require(_0x420d('0x3'));var client=jayson[_0x420d('0x4')][_0x420d('0x5')]({'port':0x2329});var logger=require(_0x420d('0x6'))('xdr');exports[_0x420d('0x7')]=function(_0x130cfd,_0x48b149){logger['info'](_0x130cfd,_0x48b149?util[_0x420d('0x8')](_0x48b149,{'showHidden':![],'depth':null}):'');};exports[_0x420d('0x9')]=function(_0x20af68,_0x293543){logger[_0x420d('0x9')](_0x20af68,_0x293543?util['inspect'](_0x293543,{'showHidden':![],'depth':null}):'');};exports[_0x420d('0xa')]=function(_0x1526d4,_0x404b3d){logger[_0x420d('0xa')](_0x1526d4,_0x404b3d?util[_0x420d('0x8')](_0x404b3d,{'showHidden':![],'depth':null}):'');};exports[_0x420d('0xb')]=function(_0x181d87,_0x1afa2f){return client[_0x420d('0xb')](_0x181d87,{'body':_0x1afa2f})[_0x420d('0xc')](function(_0x52ff8f){logger['debug'](_0x420d('0xd'),_0x181d87,_0x52ff8f?util[_0x420d('0x8')](_0x52ff8f,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5b1056){logger[_0x420d('0xa')](_0x420d('0xd'),_0x181d87,_0x5b1056?util[_0x420d('0x8')](_0x5b1056,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4544fe){return client[_0x420d('0xb')](_0x420d('0xe'),{'options':{'raw':!![],'attributes':['id',_0x420d('0xf'),_0x420d('0x10'),_0x420d('0x11')],'where':_0x4544fe,'limit':0x1}})[_0x420d('0xc')](function(_0x2e3b7f){logger[_0x420d('0x9')](_0x420d('0x12'),JSON[_0x420d('0x13')](_0x4544fe),_0x2e3b7f?util[_0x420d('0x8')](_0x2e3b7f,{'showHidden':![],'depth':null}):'');return _0x2e3b7f['result']['length']?_0x2e3b7f[_0x420d('0x14')][0x0]:null;});}exports[_0x420d('0x15')]=function(_0x543c0b){return new BPromise(function(_0x5297e8,_0x3b2c9e){if(_0x543c0b){return getUser({'internal':_0x543c0b})[_0x420d('0xc')](function(_0xa50cc1){logger[_0x420d('0x7')](_0x420d('0x16'),_0x543c0b,_0xa50cc1?_0x420d('0x17'):'notfound');return _0x5297e8(_0xa50cc1);})[_0x420d('0x18')](function(_0xf89dc7){logger[_0x420d('0xa')]('[utils][getUserByInternal]',_0xf89dc7?util[_0x420d('0x8')](_0xf89dc7,{'showHidden':![],'depth':null}):'');return _0x5297e8(null);});}return _0x5297e8(null);});};exports[_0x420d('0x19')]=function(_0x512fe9){return new BPromise(function(_0x468b66,_0x504e88){if(_0x512fe9){return getUser({'interface':_0x512fe9})[_0x420d('0xc')](function(_0x4c8369){logger['info'](_0x420d('0x1a'),_0x512fe9,_0x4c8369?_0x420d('0x17'):_0x420d('0x1b'));return _0x468b66(_0x4c8369);})['catch'](function(_0x4b339a){logger[_0x420d('0xa')]('[utils][getUserByInterface]',_0x4b339a?util[_0x420d('0x8')](_0x4b339a,{'showHidden':![],'depth':null}):'');return _0x468b66(null);});}return _0x468b66(null);});};exports[_0x420d('0x1c')]=function(_0x16c4f7){return new BPromise(function(_0x24bb76,_0x2f188b){if(_0x16c4f7){return getUser({'name':_0x16c4f7})[_0x420d('0xc')](function(_0x3600d7){logger['info'](_0x420d('0x1d'),_0x16c4f7,_0x3600d7?_0x420d('0x17'):_0x420d('0x1b'));return _0x24bb76(_0x3600d7);})[_0x420d('0x18')](function(_0x4d3a3e){logger[_0x420d('0xa')](_0x420d('0x1e'),_0x4d3a3e?util[_0x420d('0x8')](_0x4d3a3e,{'showHidden':![],'depth':null}):'');return _0x24bb76(null);});}return _0x24bb76(null);});};exports[_0x420d('0x1f')]=function(_0x4949df){return new BPromise(function(_0x1b95d9,_0x4b4cff){if(_0x4949df){return client[_0x420d('0xb')](_0x420d('0x20'),{'options':{'raw':!![],'attributes':['id',_0x420d('0x10'),_0x420d('0x21'),_0x420d('0x22'),_0x420d('0x23')],'where':{'name':_0x4949df},'limit':0x1}})[_0x420d('0xc')](function(_0x4b5604){logger[_0x420d('0x9')](_0x420d('0x24'),_0x4949df,_0x4b5604?util[_0x420d('0x8')](_0x4b5604,{'showHidden':![],'depth':null}):'');logger[_0x420d('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4949df,_0x4b5604?_0x420d('0x17'):_0x420d('0x1b'));return _0x1b95d9(_0x4b5604[_0x420d('0x14')]['length']?_0x4b5604[_0x420d('0x14')][0x0]:null);})[_0x420d('0x18')](function(_0x321bc7){logger[_0x420d('0xa')]('[utils][getVoiceQueueByName]',_0x321bc7?util['inspect'](_0x321bc7,{'showHidden':![],'depth':null}):'');return _0x1b95d9(null);});}return _0x1b95d9(null);});};exports[_0x420d('0x25')]=function(_0x1c9380,_0xd3ddc0){return moment(_0x1c9380)[_0x420d('0x26')](_0xd3ddc0,_0x420d('0x27'))[_0x420d('0x28')](_0x420d('0x29'));};exports[_0x420d('0x2a')]=function(_0xec24a9,_0x21216a){return moment(_0xec24a9)[_0x420d('0x2b')](_0x21216a,'seconds')[_0x420d('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x420d('0x2c')]=function(_0x5c39ea,_0x2bfb4f){return moment(_0x5c39ea)[_0x420d('0x2d')](moment(_0x2bfb4f),_0x420d('0x27'));};exports[_0x420d('0x2e')]=function(_0x1dea86,_0x609dd){return parseInt(_0x1dea86,0xa)+parseInt(_0x609dd,0xa);};exports[_0x420d('0x2f')]=function(){return moment()[_0x420d('0x28')](_0x420d('0x29'));};exports[_0x420d('0x30')]=function(_0x295921,_0x346afb){if(_0x346afb){return moment(_0x295921)[_0x420d('0x30')](_0x346afb);}return!![];};exports[_0x420d('0x31')]=function(_0x1b7250,_0x26c883){if(_0x26c883){return moment(_0x1b7250)[_0x420d('0x31')](_0x26c883);}else if(_0x1b7250){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 051aa8e..a26e58c 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 _0x2fe6=['LOG\x20~\x20loggerLevel','timestamp','error','api','auth','set','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','responseTime','use','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','connection','remoteAddress','url','statusCode','device','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','log','xcally','join','client','role','name','ensureDir','catch','then','user','data','LOG\x20~\x20payload'];(function(_0x1d5714,_0x2fa5f4){var _0x1b620e=function(_0x9a0a73){while(--_0x9a0a73){_0x1d5714['push'](_0x1d5714['shift']());}};_0x1b620e(++_0x2fa5f4);}(_0x2fe6,0xab));var _0x62fe=function(_0x238e4d,_0x42ea00){_0x238e4d=_0x238e4d-0x0;var _0x2162c8=_0x2fe6[_0x238e4d];return _0x2162c8;};var fs=require(_0x62fe('0x0'));var _=require(_0x62fe('0x1'));var ewinston=require(_0x62fe('0x2'));var path=require('path');var util=require(_0x62fe('0x3'));var fileLogger=require(_0x62fe('0x4'))['fileLogger'];var safeTemplate=require(_0x62fe('0x5'))[_0x62fe('0x6')];var maskSensitiveData=require(_0x62fe('0x7'))[_0x62fe('0x8')];function ClientSideLogger(){function _0xef2a5d(_0x4c09db){var _0x5597de=path['join']('/var',_0x62fe('0x9'),_0x62fe('0xa'));var _0x1a92cf=path[_0x62fe('0xb')](_0x62fe('0xc'),_0x4c09db[_0x62fe('0xd')]+'-'+_0x4c09db[_0x62fe('0xe')]);return fs[_0x62fe('0xf')](path[_0x62fe('0xb')](_0x5597de,_0x1a92cf))['then'](function(){var _0x22771d=fileLogger('client',path[_0x62fe('0xb')](_0x5597de,_0x1a92cf));return _0x22771d;})[_0x62fe('0x10')](function(_0x57458c){throw _0x57458c;});}this[_0x62fe('0x9')]=function(_0x12ae6f,_0xcf91,_0x53e512,_0x577cbe){return _0xef2a5d(_0x12ae6f['user'])[_0x62fe('0x11')](function(_0x3c09cb){var _0x31763b=_0x3c09cb[_0xcf91];return _0x31763b;})[_0x62fe('0x11')](function(_0x44b98f){var _0x24277c=_0x12ae6f[_0x62fe('0x12')]?_0x12ae6f[_0x62fe('0x12')]['id']:'no-user';if(_0x577cbe[_0x62fe('0x13')]){console[_0x62fe('0x9')](_0x62fe('0x14'),_0x577cbe);console[_0x62fe('0x9')](_0x62fe('0x15'),_0x44b98f);}var _0x33b61a=_0x577cbe[_0x62fe('0x13')];var _0x26bb51=_0x577cbe[_0x62fe('0x16')];var _0x4ce950=new Date(Number(_0x26bb51));return _0x44b98f(_0x24277c,_0x4ce950,_0x53e512,_0x33b61a);})[_0x62fe('0x10')](function(_0x4249ae){fileLogger(_0x62fe('0xc'))[_0x62fe('0x17')](_0x4249ae);});};}function setupLoggers(_0x224515){return new Promise(function(_0x3231c2){var _0x59d069=new ClientSideLogger();var _0x31c15d=fileLogger(_0x62fe('0x18'));var _0x16821d=fileLogger(_0x62fe('0x19'));_0x224515[_0x62fe('0x1a')]('client-side-logger',_0x59d069);_0x224515['use'](ewinston[_0x62fe('0x1b')]({'winstonInstance':_0x31c15d,'meta':![],'statusLevels':!![],'msg':function(_0x5e2791,_0x14fdb8){var _0x2e34ce=_0x62fe('0x1c');if(!_[_0x62fe('0x1d')](_0x5e2791[_0x62fe('0x1e')])){_0x2e34ce+=_0x62fe('0x1f');var _0x2d257e=_0x5e2791['body'];maskSensitiveData(_0x2d257e);}return safeTemplate(util[_0x62fe('0x20')](_0x2e34ce,_0x5e2791[_0x62fe('0x21')],_0x5e2791[_0x62fe('0x22')]['x-forwarded-for']?_0x5e2791[_0x62fe('0x22')]['x-forwarded-for']:_0x5e2791['connection']['remoteAddress']||_0x5e2791['ip'],_0x5e2791['url'],_0x14fdb8['statusCode'],_0x14fdb8[_0x62fe('0x23')],_0x5e2791[_0x62fe('0x12')]?_0x5e2791[_0x62fe('0x12')]['id']:null,_0x5e2791[_0x62fe('0x12')]?_0x5e2791['user'][_0x62fe('0xe')]:null,_0x5e2791['user']?_0x5e2791[_0x62fe('0x12')][_0x62fe('0xd')]:null,_0x2d257e?util['inspect'](_0x2d257e,![],null):''));}}));_0x224515[_0x62fe('0x24')](ewinston[_0x62fe('0x1b')]({'winstonInstance':_0x16821d,'meta':![],'statusLevels':!![],'msg':function(_0x59d81f,_0x177ab4){var _0x13eda6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x59d81f[_0x62fe('0x1e')]&&_0x59d81f[_0x62fe('0x1e')]['device']&&_0x59d81f['body'][_0x62fe('0x25')]){_0x13eda6=_0x62fe('0x26');}return util['format'](_0x13eda6,_0x59d81f[_0x62fe('0x21')],_0x59d81f[_0x62fe('0x22')]['x-forwarded-for']?_0x59d81f['headers'][_0x62fe('0x27')]:_0x59d81f[_0x62fe('0x28')][_0x62fe('0x29')]||_0x59d81f['ip'],_0x59d81f[_0x62fe('0x2a')],_0x177ab4[_0x62fe('0x2b')],_0x177ab4[_0x62fe('0x23')],_0x59d81f[_0x62fe('0x12')]?_0x59d81f[_0x62fe('0x12')]['id']:null,_0x59d81f[_0x62fe('0x12')]?_0x59d81f[_0x62fe('0x12')][_0x62fe('0xe')]:null,_0x59d81f[_0x62fe('0x12')]?_0x59d81f[_0x62fe('0x12')][_0x62fe('0xd')]:null,_0x59d81f['body']&&_0x59d81f['body'][_0x62fe('0x2c')]?_0x59d81f['body']['device']:'other',_0x59d81f[_0x62fe('0x1e')]&&_0x59d81f[_0x62fe('0x1e')][_0x62fe('0x25')]?_0x59d81f[_0x62fe('0x1e')][_0x62fe('0x25')]:'',_0x59d81f[_0x62fe('0x1e')]&&_0x59d81f[_0x62fe('0x1e')][_0x62fe('0x2d')]?_0x59d81f[_0x62fe('0x1e')][_0x62fe('0x2d')]:'');},'ignoreRoute':function(_0x29915c){var _0x20e65f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x20e65f[_0x62fe('0x2e')](_0x29915c[_0x62fe('0x2a')]);}}));return _0x3231c2();});}exports[_0x62fe('0x2f')]=setupLoggers; \ No newline at end of file +var _0xdf93=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_name','test','setupLoggers','lodash','express-winston','path','util','./loggers','safeTemplate','maskSensitiveData','join','/var','xcally','role','name','ensureDir','then','catch','log','user','LOG\x20~\x20loggerLevel','timestamp','error','auth','set','use'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xdf93,0x99));var _0x3df9=function(_0x5ce57b,_0x4c78f6){_0x5ce57b=_0x5ce57b-0x0;var _0x358141=_0xdf93[_0x5ce57b];return _0x358141;};var fs=require('fs-extra');var _=require(_0x3df9('0x0'));var ewinston=require(_0x3df9('0x1'));var path=require(_0x3df9('0x2'));var util=require(_0x3df9('0x3'));var fileLogger=require(_0x3df9('0x4'))['fileLogger'];var safeTemplate=require('./safe-template')[_0x3df9('0x5')];var maskSensitiveData=require('./mask-sensitive-data')[_0x3df9('0x6')];function ClientSideLogger(){function _0x536715(_0x2e907d){var _0x560688=path[_0x3df9('0x7')](_0x3df9('0x8'),'log',_0x3df9('0x9'));var _0x26a477=path['join']('client',_0x2e907d[_0x3df9('0xa')]+'-'+_0x2e907d[_0x3df9('0xb')]);return fs[_0x3df9('0xc')](path[_0x3df9('0x7')](_0x560688,_0x26a477))[_0x3df9('0xd')](function(){var _0x12fa91=fileLogger('client',path['join'](_0x560688,_0x26a477));return _0x12fa91;})[_0x3df9('0xe')](function(_0xd78a09){throw _0xd78a09;});}this[_0x3df9('0xf')]=function(_0x224341,_0x403f85,_0x3f7c3e,_0x459c91){return _0x536715(_0x224341[_0x3df9('0x10')])[_0x3df9('0xd')](function(_0x4bf6e1){var _0x99e35f=_0x4bf6e1[_0x403f85];return _0x99e35f;})[_0x3df9('0xd')](function(_0xa37d5c){var _0x39c5c0=_0x224341[_0x3df9('0x10')]?_0x224341['user']['id']:'no-user';if(_0x459c91['data']){console[_0x3df9('0xf')]('LOG\x20~\x20payload',_0x459c91);console[_0x3df9('0xf')](_0x3df9('0x11'),_0xa37d5c);}var _0x283c91=_0x459c91['data'];var _0x3442b9=_0x459c91[_0x3df9('0x12')];var _0x4a4ba2=new Date(Number(_0x3442b9));return _0xa37d5c(_0x39c5c0,_0x4a4ba2,_0x3f7c3e,_0x283c91);})['catch'](function(_0x4f5e64){fileLogger('client')[_0x3df9('0x13')](_0x4f5e64);});};}function setupLoggers(_0x49b62f){return new Promise(function(_0x58247f){var _0xa070bc=new ClientSideLogger();var _0x160434=fileLogger('api');var _0x532334=fileLogger(_0x3df9('0x14'));_0x49b62f[_0x3df9('0x15')]('client-side-logger',_0xa070bc);_0x49b62f[_0x3df9('0x16')](ewinston['logger']({'winstonInstance':_0x160434,'meta':![],'statusLevels':!![],'msg':function(_0x218df7,_0x423b2d){var _0x13c55b=_0x3df9('0x17');if(!_['isEmpty'](_0x218df7['body'])){_0x13c55b+='\x20body=%s';var _0x3fbcdd=_0x218df7[_0x3df9('0x18')];maskSensitiveData(_0x3fbcdd);}return safeTemplate(util[_0x3df9('0x19')](_0x13c55b,_0x218df7[_0x3df9('0x1a')],_0x218df7[_0x3df9('0x1b')][_0x3df9('0x1c')]?_0x218df7[_0x3df9('0x1b')][_0x3df9('0x1c')]:_0x218df7['connection'][_0x3df9('0x1d')]||_0x218df7['ip'],_0x218df7[_0x3df9('0x1e')],_0x423b2d[_0x3df9('0x1f')],_0x423b2d[_0x3df9('0x20')],_0x218df7[_0x3df9('0x10')]?_0x218df7['user']['id']:null,_0x218df7['user']?_0x218df7[_0x3df9('0x10')][_0x3df9('0xb')]:null,_0x218df7[_0x3df9('0x10')]?_0x218df7[_0x3df9('0x10')][_0x3df9('0xa')]:null,_0x3fbcdd?util[_0x3df9('0x21')](_0x3fbcdd,![],null):''));}}));_0x49b62f[_0x3df9('0x16')](ewinston[_0x3df9('0x22')]({'winstonInstance':_0x532334,'meta':![],'statusLevels':!![],'msg':function(_0x531170,_0x5d92ef){var _0x53344c=_0x3df9('0x23');if(_0x531170[_0x3df9('0x18')]&&_0x531170[_0x3df9('0x18')][_0x3df9('0x24')]&&_0x531170['body'][_0x3df9('0x25')]){_0x53344c=_0x3df9('0x26');}return util['format'](_0x53344c,_0x531170[_0x3df9('0x1a')],_0x531170[_0x3df9('0x1b')][_0x3df9('0x1c')]?_0x531170['headers']['x-forwarded-for']:_0x531170[_0x3df9('0x27')][_0x3df9('0x1d')]||_0x531170['ip'],_0x531170[_0x3df9('0x1e')],_0x5d92ef[_0x3df9('0x1f')],_0x5d92ef[_0x3df9('0x20')],_0x531170[_0x3df9('0x10')]?_0x531170['user']['id']:null,_0x531170['user']?_0x531170[_0x3df9('0x10')][_0x3df9('0xb')]:null,_0x531170[_0x3df9('0x10')]?_0x531170['user']['role']:null,_0x531170['body']&&_0x531170['body'][_0x3df9('0x24')]?_0x531170[_0x3df9('0x18')][_0x3df9('0x24')]:_0x3df9('0x28'),_0x531170[_0x3df9('0x18')]&&_0x531170[_0x3df9('0x18')][_0x3df9('0x25')]?_0x531170[_0x3df9('0x18')]['agent_id']:'',_0x531170[_0x3df9('0x18')]&&_0x531170['body'][_0x3df9('0x29')]?_0x531170[_0x3df9('0x18')][_0x3df9('0x29')]:'');},'ignoreRoute':function(_0x239566){var _0x2f64b8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2f64b8[_0x3df9('0x2a')](_0x239566[_0x3df9('0x1e')]);}}));return _0x58247f();});}exports[_0x3df9('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 70b4711..952a911 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7df=['format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','warn','File','%s-%s','error','info','fileLogger','path','util','moment','winston','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0xf7df,0x1df));var _0xff7d=function(_0x1cde4e,_0x343a31){_0x1cde4e=_0x1cde4e-0x0;var _0x43a896=_0xf7df[_0x1cde4e];return _0x43a896;};'use strict';var path=require(_0xff7d('0x0'));var util=require(_0xff7d('0x1'));var moment=require(_0xff7d('0x2'));var winston=require(_0xff7d('0x3'));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':_0xff7d('0x4'),'error':'red','warn':_0xff7d('0x5'),'info':_0xff7d('0x6'),'print':_0xff7d('0x7'),'success':_0xff7d('0x8'),'http':_0xff7d('0x9'),'verbose':_0xff7d('0xa'),'debug':'bold\x20blue','silly':_0xff7d('0xb')};winston[_0xff7d('0xc')](XC_LOG_COLORS);function getLogFileName(_0x3bf1f4,_0x457b7f,_0x14ce85){var _0x3b0bd7=_0x3bf1f4||_0xff7d('0xd');return path[_0xff7d('0xe')](_0x3b0bd7,util[_0xff7d('0xf')](_0xff7d('0x10'),_0x457b7f,_0x14ce85));}function formatter(_0x595b14,_0xcc19a4){_0xcc19a4[_0xff7d('0x11')]=_0xcc19a4[_0xff7d('0x11')][_0xff7d('0x12')](/@@{/g,_0xff7d('0x13'))[_0xff7d('0x12')](/}@@/g,_0xff7d('0x14'))['replace'](/@{/g,'{{')[_0xff7d('0x12')](/}@/g,'}}');return util[_0xff7d('0xf')](_0xff7d('0x15'),moment()['format'](_0xff7d('0x16')),_0xcc19a4['level'][_0xff7d('0x17')](),_0x595b14,_0xcc19a4[_0xff7d('0x11')]);}function fileFormat(_0x5e6223,_0x2b5b01){_0x2b5b01[_0xff7d('0x11')]=_0x2b5b01['message'][_0xff7d('0x12')](/@@{/g,_0xff7d('0x13'))[_0xff7d('0x12')](/}@@/g,_0xff7d('0x14'))[_0xff7d('0x12')](/@{/g,'{{')[_0xff7d('0x12')](/}@/g,'}}');var _0x453755=_0x2b5b01[_0xff7d('0x18')]&&Object[_0xff7d('0x19')](_0x2b5b01[_0xff7d('0x18')])[_0xff7d('0x1a')]?'\x0a\x09'+JSON[_0xff7d('0x1b')](_0x2b5b01[_0xff7d('0x18')]):'';return util[_0xff7d('0xf')](_0xff7d('0x1c'),moment()['format'](_0xff7d('0x16')),_0x2b5b01[_0xff7d('0x1d')][_0xff7d('0x17')](),_0x5e6223,_0x2b5b01[_0xff7d('0x11')],_0x453755);}function consoleLogger(){var _0xce046c=new winston[(_0xff7d('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xff7d('0x1f'))]['Console']({'level':_0xff7d('0x20'),'json':![],'formatter':function(_0x3b3b06){return formatter('',_0x3b3b06);}})]});return _0xce046c;}function fileLogger(_0x3bff86,_0x4d8f67){var _0x4bfef4=new winston[(_0xff7d('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xff7d('0x1f'))][(_0xff7d('0x21'))]({'name':util['format'](_0xff7d('0x22'),_0x3bff86,_0xff7d('0x23')),'filename':getLogFileName(_0x4d8f67,_0x3bff86,_0xff7d('0x23')),'level':_0xff7d('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x54b32c){return fileFormat(_0x3bff86,_0x54b32c);}}),new winston[(_0xff7d('0x1f'))][(_0xff7d('0x21'))]({'name':util['format']('%s-%s',_0x3bff86,_0xff7d('0x24')),'filename':getLogFileName(_0x4d8f67,_0x3bff86,_0xff7d('0x24')),'level':_0xff7d('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbfd82d){return fileFormat(_0x3bff86,_0xbfd82d);}}),new winston[(_0xff7d('0x1f'))]['Console']({'level':'warn','json':![],'formatter':function(_0x96248f){return fileFormat(_0x3bff86,_0x96248f);}})]});return _0x4bfef4;}exports['consoleLogger']=consoleLogger;exports[_0xff7d('0x25')]=fileLogger; \ No newline at end of file +var _0x38dc=['message','replace','{{{','}}}','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','error','File','info','Console','consoleLogger','fileLogger','path','moment','winston','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','/var/log/xcally','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38dc,0x10b));var _0xc38d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x38dc[_0x167cc1];return _0x10bc4b;};'use strict';var path=require(_0xc38d('0x0'));var util=require('util');var moment=require(_0xc38d('0x1'));var winston=require(_0xc38d('0x2'));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':_0xc38d('0x3'),'error':_0xc38d('0x4'),'warn':_0xc38d('0x5'),'info':_0xc38d('0x6'),'print':'bold\x20white','success':_0xc38d('0x7'),'http':_0xc38d('0x8'),'verbose':_0xc38d('0x9'),'debug':'bold\x20blue','silly':_0xc38d('0xa')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x410574,_0x464b4e,_0x45b054){var _0x2e25ce=_0x410574||_0xc38d('0xb');return path[_0xc38d('0xc')](_0x2e25ce,util['format']('%s-%s.log',_0x464b4e,_0x45b054));}function formatter(_0x3016a8,_0xbfbc2f){_0xbfbc2f[_0xc38d('0xd')]=_0xbfbc2f[_0xc38d('0xd')][_0xc38d('0xe')](/@@{/g,_0xc38d('0xf'))[_0xc38d('0xe')](/}@@/g,_0xc38d('0x10'))[_0xc38d('0xe')](/@{/g,'{{')[_0xc38d('0xe')](/}@/g,'}}');return util[_0xc38d('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xc38d('0x11')](_0xc38d('0x12')),_0xbfbc2f[_0xc38d('0x13')][_0xc38d('0x14')](),_0x3016a8,_0xbfbc2f['message']);}function fileFormat(_0x3b8932,_0x4e2173){_0x4e2173[_0xc38d('0xd')]=_0x4e2173[_0xc38d('0xd')]['replace'](/@@{/g,_0xc38d('0xf'))[_0xc38d('0xe')](/}@@/g,_0xc38d('0x10'))['replace'](/@{/g,'{{')[_0xc38d('0xe')](/}@/g,'}}');var _0x4ae403=_0x4e2173[_0xc38d('0x15')]&&Object[_0xc38d('0x16')](_0x4e2173[_0xc38d('0x15')])[_0xc38d('0x17')]?'\x0a\x09'+JSON[_0xc38d('0x18')](_0x4e2173[_0xc38d('0x15')]):'';return util[_0xc38d('0x11')](_0xc38d('0x19'),moment()[_0xc38d('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4e2173['level']['toUpperCase'](),_0x3b8932,_0x4e2173[_0xc38d('0xd')],_0x4ae403);}function consoleLogger(){var _0x6eb5e4=new winston[(_0xc38d('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc38d('0x1b'))]['Console']({'level':_0xc38d('0x1c'),'json':![],'formatter':function(_0x3be873){return formatter('',_0x3be873);}})]});return _0x6eb5e4;}function fileLogger(_0x48d131,_0x5f6e5){var _0xeaee62=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0xc38d('0x11')]('%s-%s',_0x48d131,_0xc38d('0x1d')),'filename':getLogFileName(_0x5f6e5,_0x48d131,_0xc38d('0x1d')),'level':_0xc38d('0x1d'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2cd9ca){return fileFormat(_0x48d131,_0x2cd9ca);}}),new winston[(_0xc38d('0x1b'))][(_0xc38d('0x1e'))]({'name':util['format']('%s-%s',_0x48d131,_0xc38d('0x1f')),'filename':getLogFileName(_0x5f6e5,_0x48d131,_0xc38d('0x1f')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd19c3e){return fileFormat(_0x48d131,_0xd19c3e);}}),new winston[(_0xc38d('0x1b'))][(_0xc38d('0x20'))]({'level':_0xc38d('0x1c'),'json':![],'formatter':function(_0x31ed23){return fileFormat(_0x48d131,_0x31ed23);}})]});return _0xeaee62;}exports[_0xc38d('0x21')]=consoleLogger;exports[_0xc38d('0x22')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index d708c17..61bd0e6 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 _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x26d57b,_0x192171){var _0x162d8e=function(_0x3f7854){while(--_0x3f7854){_0x26d57b['push'](_0x26d57b['shift']());}};_0x162d8e(++_0x192171);}(_0xadb5,0xad));var _0x5adb=function(_0x5dcd35,_0x231202){_0x5dcd35=_0x5dcd35-0x0;var _0x4cc995=_0xadb5[_0x5dcd35];return _0x4cc995;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x1b5a61,_0x5aaf77){var _0x3c0a35=function(_0x5634f7){while(--_0x5634f7){_0x1b5a61['push'](_0x1b5a61['shift']());}};_0x3c0a35(++_0x5aaf77);}(_0xadb5,0xad));var _0x5adb=function(_0x1bd35f,_0x383f18){_0x1bd35f=_0x1bd35f-0x0;var _0x41cb84=_0xadb5[_0x1bd35f];return _0x41cb84;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}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 7b0fabc..213e6ad 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 _0x9ffd=['{\x20{\x20','string','replace','map','keys','reduce','exports','safeTemplate','lodash'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2b2418,_0x5a6380){_0x2b2418=_0x2b2418-0x0;var _0x5b4ad3=_0x9ffd[_0x2b2418];return _0x5b4ad3;};var _=require(_0xd9ff('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x413161){return _0x413161==='{{'?_0xd9ff('0x1'):'\x20}\x20}';}function safeTemplate(_0x3480c0){var _0x1530b1=_0x3480c0;if(typeof _0x3480c0===_0xd9ff('0x2')){_0x1530b1=_0x3480c0[_0xd9ff('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x3480c0)){_0x1530b1=_0x3480c0[_0xd9ff('0x4')](function(_0x111697){return safeTemplate(_0x111697);});}else if(_['isPlainObject'](_0x3480c0)){_0x1530b1=Object[_0xd9ff('0x5')](_0x3480c0)[_0xd9ff('0x6')](function(_0x13ea8c,_0x270eb2){_0x13ea8c[_0x270eb2]=safeTemplate(_0x3480c0[_0x270eb2]);return _0x13ea8c;},{});}return _0x1530b1;}module[_0xd9ff('0x7')][_0xd9ff('0x8')]=safeTemplate; \ No newline at end of file +var _0xda2d=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','map','isPlainObject','keys','reduce'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xda2d,0x102));var _0xdda2=function(_0x58780a,_0x577a7e){_0x58780a=_0x58780a-0x0;var _0x39507e=_0xda2d[_0x58780a];return _0x39507e;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x14e970){return _0x14e970==='{{'?_0xdda2('0x0'):_0xdda2('0x1');}function safeTemplate(_0x1f1fcc){var _0x329c5e=_0x1f1fcc;if(typeof _0x1f1fcc==='string'){_0x329c5e=_0x1f1fcc['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1f1fcc)){_0x329c5e=_0x1f1fcc[_0xdda2('0x2')](function(_0x319129){return safeTemplate(_0x319129);});}else if(_[_0xdda2('0x3')](_0x1f1fcc)){_0x329c5e=Object[_0xdda2('0x4')](_0x1f1fcc)[_0xdda2('0x5')](function(_0xf38e58,_0x2f55dc){_0xf38e58[_0x2f55dc]=safeTemplate(_0x1f1fcc[_0x2f55dc]);return _0xf38e58;},{});}return _0x329c5e;}module[_0xdda2('0x6')][_0xdda2('0x7')]=safeTemplate; \ No newline at end of file